Skip to content
This repository was archived by the owner on Jun 15, 2023. It is now read-only.

Commit 0900fe1

Browse files
authored
Add files via upload
1 parent 0ca5dc0 commit 0900fe1

File tree

1 file changed

+48
-0
lines changed

1 file changed

+48
-0
lines changed

other/ChocolateBar.java

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
package other;
2+
3+
import java.io.BufferedReader;
4+
import java.io.IOException;
5+
import java.io.InputStreamReader;
6+
7+
public class ChocolateBar {
8+
9+
public static BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
10+
11+
public static void main(String[] args) throws IOException {
12+
int n = readInt();
13+
14+
String[] input;
15+
for (int i = 0; i < n; i++) {
16+
input = readSpaceInput();
17+
System.out.println(Integer.parseInt(input[0]) * Integer.parseInt(input[1]) - 1);
18+
}
19+
}
20+
21+
public static String readLine() throws IOException {
22+
return in.readLine();
23+
}
24+
25+
public static String readString() throws IOException {
26+
return readLine();
27+
}
28+
29+
public static int readInt() throws IOException {
30+
return Integer.parseInt(readLine());
31+
}
32+
33+
public static long readLong() throws IOException {
34+
return Long.parseLong(readLine());
35+
36+
}
37+
public static double readDouble() throws IOException {
38+
return Double.parseDouble(readLine());
39+
}
40+
41+
public static char readCharacter() throws IOException {
42+
return readLine().charAt(0);
43+
}
44+
45+
public static String[] readSpaceInput() throws IOException {
46+
return in.readLine().split(" ");
47+
}
48+
}

0 commit comments

Comments
 (0)