This repository was archived by the owner on Jun 15, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +48
-0
lines changed Expand file tree Collapse file tree 1 file changed +48
-0
lines changed Original file line number Diff line number Diff line change
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
+ }
You can’t perform that action at this time.
0 commit comments