-
Notifications
You must be signed in to change notification settings - Fork 2
/
Main.java
40 lines (31 loc) · 1.04 KB
/
Main.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
package io.github.tahanima.uva._11044;
import java.util.Scanner;
public class Main {
/**
* @param grid denotes a 2D integer array containing
* the size of the grid (values for rows and columns)
* @return an integer array containing the answers
*/
public static int[] solve(int[][] grid) {
// Implement this method
return new int[0];
}
/**
* Takes care of the problem's input and output.
*/
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
StringBuilder stringBuilder = new StringBuilder();
int testCases = scanner.nextInt();
int[][] grid = new int[testCases][2];
for (int cases = 0; cases < testCases; cases++) {
grid[cases][0] = scanner.nextInt();
grid[cases][1] = scanner.nextInt();
}
int[] answer = solve(grid);
for (int n: answer) {
stringBuilder.append(String.format("%d%n", n));
}
System.out.print(stringBuilder);
}
}