node_ids
sequencelengths 4
1.4k
| edge_index
sequencelengths 1
2.22k
| text
sequencelengths 4
1.4k
| source
stringlengths 14
427k
|
---|---|---|---|
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
42,
4,
18,
13,
30,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
41,
13,
13,
41,
13,
13,
42,
2,
13,
17,
30,
0,
13,
2,
13,
13,
41,
13,
13,
0,
13,
13,
0,
13,
13,
4,
18,
18,
13,
13,
2,
2,
13,
17,
2,
2,
13,
13,
13,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
69,
5
],
[
69,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
13,
14
],
[
14,
15
],
[
12,
16
],
[
16,
17
],
[
17,
18
],
[
17,
19
],
[
19,
20
],
[
20,
21
],
[
16,
22
],
[
22,
23
],
[
22,
24
],
[
24,
25
],
[
25,
26
],
[
16,
27
],
[
27,
28
],
[
27,
29
],
[
16,
30
],
[
30,
31
],
[
30,
32
],
[
16,
33
],
[
33,
34
],
[
34,
35
],
[
34,
36
],
[
33,
37
],
[
37,
38
],
[
38,
39
],
[
38,
40
],
[
40,
41
],
[
40,
42
],
[
37,
43
],
[
43,
44
],
[
43,
45
],
[
37,
46
],
[
46,
47
],
[
46,
48
],
[
37,
49
],
[
49,
50
],
[
49,
51
],
[
16,
52
],
[
52,
53
],
[
53,
54
],
[
54,
55
],
[
54,
56
],
[
52,
57
],
[
58,
58
],
[
58,
59
],
[
58,
60
],
[
58,
61
],
[
61,
62
],
[
62,
63
],
[
62,
64
],
[
61,
65
],
[
6,
66
],
[
66,
67
],
[
0,
68
],
[
68,
69
],
[
68,
70
]
] | [
"import java.util.*;\npublic class Main {\n\tpublic static void main(String[] args){\n\t\tScanner in = new Scanner(System.in);\n\t\twhile(in.hasNext()){\n\t\t\tlong x = in.nextLong();\n\t\t\tlong y = in.nextLong();\n\t\t\tlong mx=x,my=y;\n\t\t\twhile(y!=0){\n\t\t\t\tx = x%y;\n\t\t\t\tlong test=x;\n\t\t\t\tx = y;\n\t\t\t\ty = test;\n\t\t\t}\n\t\t\tSystem.out.println(x+\" \"+(mx/x*my));\n\t\t}\n\t}\n}",
"import java.util.*;",
"util.*",
"java",
"public class Main {\n\tpublic static void main(String[] args){\n\t\tScanner in = new Scanner(System.in);\n\t\twhile(in.hasNext()){\n\t\t\tlong x = in.nextLong();\n\t\t\tlong y = in.nextLong();\n\t\t\tlong mx=x,my=y;\n\t\t\twhile(y!=0){\n\t\t\t\tx = x%y;\n\t\t\t\tlong test=x;\n\t\t\t\tx = y;\n\t\t\t\ty = test;\n\t\t\t}\n\t\t\tSystem.out.println(x+\" \"+(mx/x*my));\n\t\t}\n\t}\n}",
"Main",
"public static void main(String[] args){\n\t\tScanner in = new Scanner(System.in);\n\t\twhile(in.hasNext()){\n\t\t\tlong x = in.nextLong();\n\t\t\tlong y = in.nextLong();\n\t\t\tlong mx=x,my=y;\n\t\t\twhile(y!=0){\n\t\t\t\tx = x%y;\n\t\t\t\tlong test=x;\n\t\t\t\tx = y;\n\t\t\t\ty = test;\n\t\t\t}\n\t\t\tSystem.out.println(x+\" \"+(mx/x*my));\n\t\t}\n\t}",
"main",
"{\n\t\tScanner in = new Scanner(System.in);\n\t\twhile(in.hasNext()){\n\t\t\tlong x = in.nextLong();\n\t\t\tlong y = in.nextLong();\n\t\t\tlong mx=x,my=y;\n\t\t\twhile(y!=0){\n\t\t\t\tx = x%y;\n\t\t\t\tlong test=x;\n\t\t\t\tx = y;\n\t\t\t\ty = test;\n\t\t\t}\n\t\t\tSystem.out.println(x+\" \"+(mx/x*my));\n\t\t}\n\t}",
"Scanner in = new Scanner(System.in);",
"in",
"new Scanner(System.in)",
"while(in.hasNext()){\n\t\t\tlong x = in.nextLong();\n\t\t\tlong y = in.nextLong();\n\t\t\tlong mx=x,my=y;\n\t\t\twhile(y!=0){\n\t\t\t\tx = x%y;\n\t\t\t\tlong test=x;\n\t\t\t\tx = y;\n\t\t\t\ty = test;\n\t\t\t}\n\t\t\tSystem.out.println(x+\" \"+(mx/x*my));\n\t\t}",
"in.hasNext()",
"in.hasNext",
"in",
"{\n\t\t\tlong x = in.nextLong();\n\t\t\tlong y = in.nextLong();\n\t\t\tlong mx=x,my=y;\n\t\t\twhile(y!=0){\n\t\t\t\tx = x%y;\n\t\t\t\tlong test=x;\n\t\t\t\tx = y;\n\t\t\t\ty = test;\n\t\t\t}\n\t\t\tSystem.out.println(x+\" \"+(mx/x*my));\n\t\t}",
"long x = in.nextLong();",
"x",
"in.nextLong()",
"in.nextLong",
"in",
"long y = in.nextLong();",
"y",
"in.nextLong()",
"in.nextLong",
"in",
"long mx=x",
"mx",
"x",
"my=y;",
"my",
"y",
"while(y!=0){\n\t\t\t\tx = x%y;\n\t\t\t\tlong test=x;\n\t\t\t\tx = y;\n\t\t\t\ty = test;\n\t\t\t}",
"y!=0",
"y",
"0",
"{\n\t\t\t\tx = x%y;\n\t\t\t\tlong test=x;\n\t\t\t\tx = y;\n\t\t\t\ty = test;\n\t\t\t}",
"x = x%y",
"x",
"x%y",
"x",
"y",
"long test=x;",
"test",
"x",
"x = y",
"x",
"y",
"y = test",
"y",
"test",
"System.out.println(x+\" \"+(mx/x*my))",
"System.out.println",
"System.out",
"System",
"System.out",
"x+\" \"+(mx/x*my)",
"x+\" \"+(mx/x*my)",
"x",
"\" \"",
"(mx/x*my)",
"mx/x",
"mx",
"x",
"my",
"String[] args",
"args",
"public class Main {\n\tpublic static void main(String[] args){\n\t\tScanner in = new Scanner(System.in);\n\t\twhile(in.hasNext()){\n\t\t\tlong x = in.nextLong();\n\t\t\tlong y = in.nextLong();\n\t\t\tlong mx=x,my=y;\n\t\t\twhile(y!=0){\n\t\t\t\tx = x%y;\n\t\t\t\tlong test=x;\n\t\t\t\tx = y;\n\t\t\t\ty = test;\n\t\t\t}\n\t\t\tSystem.out.println(x+\" \"+(mx/x*my));\n\t\t}\n\t}\n}",
"public class Main {\n\tpublic static void main(String[] args){\n\t\tScanner in = new Scanner(System.in);\n\t\twhile(in.hasNext()){\n\t\t\tlong x = in.nextLong();\n\t\t\tlong y = in.nextLong();\n\t\t\tlong mx=x,my=y;\n\t\t\twhile(y!=0){\n\t\t\t\tx = x%y;\n\t\t\t\tlong test=x;\n\t\t\t\tx = y;\n\t\t\t\ty = test;\n\t\t\t}\n\t\t\tSystem.out.println(x+\" \"+(mx/x*my));\n\t\t}\n\t}\n}",
"Main"
] | import java.util.*;
public class Main {
public static void main(String[] args){
Scanner in = new Scanner(System.in);
while(in.hasNext()){
long x = in.nextLong();
long y = in.nextLong();
long mx=x,my=y;
while(y!=0){
x = x%y;
long test=x;
x = y;
y = test;
}
System.out.println(x+" "+(mx/x*my));
}
}
} |
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
41,
13,
41,
13,
41,
13,
41,
13,
42,
2,
0,
13,
4,
18,
13,
17,
30,
41,
13,
4,
18,
13,
17,
17,
0,
13,
4,
18,
13,
18,
13,
17,
0,
13,
4,
18,
13,
18,
13,
17,
0,
13,
4,
13,
13,
13,
0,
13,
2,
2,
13,
13,
13,
4,
18,
18,
13,
13,
2,
2,
13,
17,
13,
23,
13,
12,
13,
30,
41,
13,
14,
2,
13,
13,
30,
0,
13,
13,
0,
13,
13,
0,
13,
13,
14,
2,
13,
17,
29,
40,
17,
14,
2,
2,
13,
13,
17,
29,
13,
29,
4,
13,
13,
2,
13,
13,
23,
13,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
131,
11
],
[
131,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
15,
17
],
[
14,
18
],
[
18,
19
],
[
14,
20
],
[
20,
21
],
[
14,
22
],
[
22,
23
],
[
14,
24
],
[
24,
25
],
[
14,
26
],
[
26,
27
],
[
14,
28
],
[
28,
29
],
[
29,
30
],
[
30,
31
],
[
30,
32
],
[
32,
33
],
[
33,
34
],
[
29,
35
],
[
28,
36
],
[
36,
37
],
[
37,
38
],
[
37,
39
],
[
39,
40
],
[
40,
41
],
[
39,
42
],
[
39,
43
],
[
36,
44
],
[
44,
45
],
[
44,
46
],
[
46,
47
],
[
47,
48
],
[
46,
49
],
[
49,
50
],
[
49,
51
],
[
36,
52
],
[
52,
53
],
[
52,
54
],
[
54,
55
],
[
55,
56
],
[
54,
57
],
[
57,
58
],
[
57,
59
],
[
36,
60
],
[
60,
61
],
[
60,
62
],
[
62,
63
],
[
62,
64
],
[
62,
65
],
[
36,
66
],
[
66,
67
],
[
66,
68
],
[
68,
69
],
[
69,
70
],
[
69,
71
],
[
68,
72
],
[
36,
73
],
[
73,
74
],
[
74,
75
],
[
75,
76
],
[
75,
77
],
[
73,
78
],
[
79,
79
],
[
79,
80
],
[
79,
81
],
[
79,
82
],
[
12,
83
],
[
83,
84
],
[
131,
85
],
[
85,
86
],
[
85,
87
],
[
87,
88
],
[
88,
89
],
[
87,
90
],
[
90,
91
],
[
91,
92
],
[
91,
93
],
[
90,
94
],
[
94,
95
],
[
95,
96
],
[
95,
97
],
[
94,
98
],
[
98,
99
],
[
98,
100
],
[
94,
101
],
[
101,
102
],
[
101,
103
],
[
87,
104
],
[
104,
105
],
[
105,
106
],
[
105,
107
],
[
104,
108
],
[
108,
109
],
[
109,
110
],
[
87,
111
],
[
111,
112
],
[
112,
113
],
[
113,
114
],
[
113,
115
],
[
112,
116
],
[
111,
117
],
[
117,
118
],
[
87,
119
],
[
119,
120
],
[
120,
121
],
[
120,
122
],
[
120,
123
],
[
123,
124
],
[
123,
125
],
[
85,
126
],
[
126,
127
],
[
85,
128
],
[
128,
129
],
[
0,
130
],
[
130,
131
],
[
130,
132
]
] | [
"import java.io.BufferedReader;\nimport java.io.IOException;\nimport java.io.InputStreamReader;\n\npublic class Main {\n\n\tpublic static void main(String[] args) throws IOException {\n\t\t//??????????????°?¨????\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\t\tString str;\n\t\tint a, b, GCD, LCM;\n\n\t\twhile ((str = br.readLine()) != null) {\n\t\t\tString[] num = str.split(\" \", 0);\n\t\t\t//?????????\n\t\t\ta = Integer.parseInt(num[0]);\n\t\t\tb = Integer.parseInt(num[1]);\n\t\t\t//???????¨????\n\t\t\tGCD = euclid(a, b);\n\t\t\tLCM = a / GCD * b;\n\t\t\tSystem.out.println(GCD + \" \" + LCM);\n\t\t}\n\t}\n\t//??????????????????\n\tstatic int euclid(int u, int v) {\n\t\tint temp;\n\t\tif (u < v) {\n\t\t\ttemp = u; u = v; v = temp;\n\t\t}\n\t\tif (v < 1) return -1;\n\t\tif (u % v == 0) return v;\n\t\treturn euclid(v, u % v);\n\t}\n\n}",
"import java.io.BufferedReader;",
"BufferedReader",
"java.io",
"import java.io.IOException;",
"IOException",
"java.io",
"import java.io.InputStreamReader;",
"InputStreamReader",
"java.io",
"public class Main {\n\n\tpublic static void main(String[] args) throws IOException {\n\t\t//??????????????°?¨????\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\t\tString str;\n\t\tint a, b, GCD, LCM;\n\n\t\twhile ((str = br.readLine()) != null) {\n\t\t\tString[] num = str.split(\" \", 0);\n\t\t\t//?????????\n\t\t\ta = Integer.parseInt(num[0]);\n\t\t\tb = Integer.parseInt(num[1]);\n\t\t\t//???????¨????\n\t\t\tGCD = euclid(a, b);\n\t\t\tLCM = a / GCD * b;\n\t\t\tSystem.out.println(GCD + \" \" + LCM);\n\t\t}\n\t}\n\t//??????????????????\n\tstatic int euclid(int u, int v) {\n\t\tint temp;\n\t\tif (u < v) {\n\t\t\ttemp = u; u = v; v = temp;\n\t\t}\n\t\tif (v < 1) return -1;\n\t\tif (u % v == 0) return v;\n\t\treturn euclid(v, u % v);\n\t}\n\n}",
"Main",
"public static void main(String[] args) throws IOException {\n\t\t//??????????????°?¨????\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\t\tString str;\n\t\tint a, b, GCD, LCM;\n\n\t\twhile ((str = br.readLine()) != null) {\n\t\t\tString[] num = str.split(\" \", 0);\n\t\t\t//?????????\n\t\t\ta = Integer.parseInt(num[0]);\n\t\t\tb = Integer.parseInt(num[1]);\n\t\t\t//???????¨????\n\t\t\tGCD = euclid(a, b);\n\t\t\tLCM = a / GCD * b;\n\t\t\tSystem.out.println(GCD + \" \" + LCM);\n\t\t}\n\t}",
"main",
"{\n\t\t//??????????????°?¨????\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\t\tString str;\n\t\tint a, b, GCD, LCM;\n\n\t\twhile ((str = br.readLine()) != null) {\n\t\t\tString[] num = str.split(\" \", 0);\n\t\t\t//?????????\n\t\t\ta = Integer.parseInt(num[0]);\n\t\t\tb = Integer.parseInt(num[1]);\n\t\t\t//???????¨????\n\t\t\tGCD = euclid(a, b);\n\t\t\tLCM = a / GCD * b;\n\t\t\tSystem.out.println(GCD + \" \" + LCM);\n\t\t}\n\t}",
"BufferedReader br = new BufferedReader(new InputStreamReader(System.in));",
"br",
"new BufferedReader(new InputStreamReader(System.in))",
"String str;",
"str",
"int a",
"a",
"b",
"b",
"GCD",
"GCD",
"LCM;",
"LCM",
"while ((str = br.readLine()) != null) {\n\t\t\tString[] num = str.split(\" \", 0);\n\t\t\t//?????????\n\t\t\ta = Integer.parseInt(num[0]);\n\t\t\tb = Integer.parseInt(num[1]);\n\t\t\t//???????¨????\n\t\t\tGCD = euclid(a, b);\n\t\t\tLCM = a / GCD * b;\n\t\t\tSystem.out.println(GCD + \" \" + LCM);\n\t\t}",
"(str = br.readLine()) != null",
"(str = br.readLine())",
"str",
"br.readLine()",
"br.readLine",
"br",
"null",
"{\n\t\t\tString[] num = str.split(\" \", 0);\n\t\t\t//?????????\n\t\t\ta = Integer.parseInt(num[0]);\n\t\t\tb = Integer.parseInt(num[1]);\n\t\t\t//???????¨????\n\t\t\tGCD = euclid(a, b);\n\t\t\tLCM = a / GCD * b;\n\t\t\tSystem.out.println(GCD + \" \" + LCM);\n\t\t}",
"String[] num = str.split(\" \", 0);",
"num",
"str.split(\" \", 0)",
"str.split",
"str",
"\" \"",
"0",
"a = Integer.parseInt(num[0])",
"a",
"Integer.parseInt(num[0])",
"Integer.parseInt",
"Integer",
"num[0]",
"num",
"0",
"b = Integer.parseInt(num[1])",
"b",
"Integer.parseInt(num[1])",
"Integer.parseInt",
"Integer",
"num[1]",
"num",
"1",
"GCD = euclid(a, b)",
"GCD",
"euclid(a, b)",
"euclid",
"a",
"b",
"LCM = a / GCD * b",
"LCM",
"a / GCD * b",
"a / GCD",
"a",
"GCD",
"b",
"System.out.println(GCD + \" \" + LCM)",
"System.out.println",
"System.out",
"System",
"System.out",
"GCD + \" \" + LCM",
"GCD + \" \" + LCM",
"GCD",
"\" \"",
"LCM",
"String[] args",
"args",
"//??????????????????\n\tstatic int euclid(int u, int v) {\n\t\tint temp;\n\t\tif (u < v) {\n\t\t\ttemp = u; u = v; v = temp;\n\t\t}\n\t\tif (v < 1) return -1;\n\t\tif (u % v == 0) return v;\n\t\treturn euclid(v, u % v);\n\t}",
"euclid",
"{\n\t\tint temp;\n\t\tif (u < v) {\n\t\t\ttemp = u; u = v; v = temp;\n\t\t}\n\t\tif (v < 1) return -1;\n\t\tif (u % v == 0) return v;\n\t\treturn euclid(v, u % v);\n\t}",
"int temp;",
"temp",
"if (u < v) {\n\t\t\ttemp = u; u = v; v = temp;\n\t\t}",
"u < v",
"u",
"v",
"{\n\t\t\ttemp = u; u = v; v = temp;\n\t\t}",
"temp = u",
"temp",
"u",
"u = v",
"u",
"v",
"v = temp",
"v",
"temp",
"if (v < 1) return -1;",
"v < 1",
"v",
"1",
"return -1;",
"-1",
"1",
"if (u % v == 0) return v;",
"u % v == 0",
"u % v",
"u",
"v",
"0",
"return v;",
"v",
"return euclid(v, u % v);",
"euclid(v, u % v)",
"euclid",
"v",
"u % v",
"u",
"v",
"int u",
"u",
"int v",
"v",
"public class Main {\n\n\tpublic static void main(String[] args) throws IOException {\n\t\t//??????????????°?¨????\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\t\tString str;\n\t\tint a, b, GCD, LCM;\n\n\t\twhile ((str = br.readLine()) != null) {\n\t\t\tString[] num = str.split(\" \", 0);\n\t\t\t//?????????\n\t\t\ta = Integer.parseInt(num[0]);\n\t\t\tb = Integer.parseInt(num[1]);\n\t\t\t//???????¨????\n\t\t\tGCD = euclid(a, b);\n\t\t\tLCM = a / GCD * b;\n\t\t\tSystem.out.println(GCD + \" \" + LCM);\n\t\t}\n\t}\n\t//??????????????????\n\tstatic int euclid(int u, int v) {\n\t\tint temp;\n\t\tif (u < v) {\n\t\t\ttemp = u; u = v; v = temp;\n\t\t}\n\t\tif (v < 1) return -1;\n\t\tif (u % v == 0) return v;\n\t\treturn euclid(v, u % v);\n\t}\n\n}",
"public class Main {\n\n\tpublic static void main(String[] args) throws IOException {\n\t\t//??????????????°?¨????\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\t\tString str;\n\t\tint a, b, GCD, LCM;\n\n\t\twhile ((str = br.readLine()) != null) {\n\t\t\tString[] num = str.split(\" \", 0);\n\t\t\t//?????????\n\t\t\ta = Integer.parseInt(num[0]);\n\t\t\tb = Integer.parseInt(num[1]);\n\t\t\t//???????¨????\n\t\t\tGCD = euclid(a, b);\n\t\t\tLCM = a / GCD * b;\n\t\t\tSystem.out.println(GCD + \" \" + LCM);\n\t\t}\n\t}\n\t//??????????????????\n\tstatic int euclid(int u, int v) {\n\t\tint temp;\n\t\tif (u < v) {\n\t\t\ttemp = u; u = v; v = temp;\n\t\t}\n\t\tif (v < 1) return -1;\n\t\tif (u % v == 0) return v;\n\t\treturn euclid(v, u % v);\n\t}\n\n}",
"Main"
] | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class Main {
public static void main(String[] args) throws IOException {
//??????????????°?¨????
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
String str;
int a, b, GCD, LCM;
while ((str = br.readLine()) != null) {
String[] num = str.split(" ", 0);
//?????????
a = Integer.parseInt(num[0]);
b = Integer.parseInt(num[1]);
//???????¨????
GCD = euclid(a, b);
LCM = a / GCD * b;
System.out.println(GCD + " " + LCM);
}
}
//??????????????????
static int euclid(int u, int v) {
int temp;
if (u < v) {
temp = u; u = v; v = temp;
}
if (v < 1) return -1;
if (u % v == 0) return v;
return euclid(v, u % v);
}
} |
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
42,
17,
30,
41,
13,
38,
5,
13,
30,
3,
30,
0,
13,
4,
18,
13,
41,
13,
4,
18,
13,
17,
41,
13,
4,
18,
13,
18,
13,
17,
41,
13,
4,
18,
13,
18,
13,
17,
41,
13,
41,
13,
14,
2,
13,
13,
30,
0,
13,
13,
0,
13,
13,
30,
0,
13,
13,
0,
13,
13,
42,
2,
2,
13,
17,
2,
13,
17,
30,
41,
13,
2,
13,
13,
0,
13,
13,
0,
13,
13,
14,
2,
13,
17,
30,
4,
18,
18,
13,
13,
2,
2,
13,
17,
2,
2,
13,
13,
13,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
114,
5
],
[
114,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
14,
17
],
[
17,
18
],
[
18,
19
],
[
18,
20
],
[
20,
21
],
[
17,
22
],
[
22,
23
],
[
23,
24
],
[
23,
25
],
[
25,
26
],
[
26,
27
],
[
14,
28
],
[
28,
29
],
[
28,
30
],
[
30,
31
],
[
31,
32
],
[
30,
33
],
[
14,
34
],
[
34,
35
],
[
34,
36
],
[
36,
37
],
[
37,
38
],
[
36,
39
],
[
39,
40
],
[
39,
41
],
[
14,
42
],
[
42,
43
],
[
42,
44
],
[
44,
45
],
[
45,
46
],
[
44,
47
],
[
47,
48
],
[
47,
49
],
[
14,
50
],
[
50,
51
],
[
14,
52
],
[
52,
53
],
[
14,
54
],
[
54,
55
],
[
55,
56
],
[
55,
57
],
[
54,
58
],
[
58,
59
],
[
59,
60
],
[
59,
61
],
[
58,
62
],
[
62,
63
],
[
62,
64
],
[
54,
65
],
[
65,
66
],
[
66,
67
],
[
66,
68
],
[
65,
69
],
[
69,
70
],
[
69,
71
],
[
14,
72
],
[
72,
73
],
[
73,
74
],
[
74,
75
],
[
74,
76
],
[
73,
77
],
[
77,
78
],
[
77,
79
],
[
72,
80
],
[
80,
81
],
[
81,
82
],
[
81,
83
],
[
83,
84
],
[
83,
85
],
[
80,
86
],
[
86,
87
],
[
86,
88
],
[
80,
89
],
[
89,
90
],
[
89,
91
],
[
80,
92
],
[
92,
93
],
[
93,
94
],
[
93,
95
],
[
92,
96
],
[
96,
97
],
[
97,
98
],
[
98,
99
],
[
99,
100
],
[
99,
101
],
[
97,
102
],
[
103,
103
],
[
103,
104
],
[
103,
105
],
[
103,
106
],
[
106,
107
],
[
107,
108
],
[
107,
109
],
[
106,
110
],
[
6,
111
],
[
111,
112
],
[
0,
113
],
[
113,
114
],
[
113,
115
]
] | [
"import java.util.*;\npublic class Main {\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n while(true) {\n String li;\n try {\n li = sc.nextLine();\n }catch(Exception e) {\n break;\n }\n String[] lisp = li.split(\" \");\n int a = Integer.parseInt(lisp[0]);\n int b = Integer.parseInt(lisp[1]);\n int x;\n int y;\n if(a > b) {\n x = a;\n y = b;\n }else {\n x = b;\n y = a;\n }\n while(x > 0 && y > 0) {\n int z = x % y;\n x = y;\n y = z;\n if(y == 0) {\n System.out.println(x + \" \" + (a / x * b));\n }\n }\n }\n }\n } ",
"import java.util.*;",
"util.*",
"java",
"public class Main {\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n while(true) {\n String li;\n try {\n li = sc.nextLine();\n }catch(Exception e) {\n break;\n }\n String[] lisp = li.split(\" \");\n int a = Integer.parseInt(lisp[0]);\n int b = Integer.parseInt(lisp[1]);\n int x;\n int y;\n if(a > b) {\n x = a;\n y = b;\n }else {\n x = b;\n y = a;\n }\n while(x > 0 && y > 0) {\n int z = x % y;\n x = y;\n y = z;\n if(y == 0) {\n System.out.println(x + \" \" + (a / x * b));\n }\n }\n }\n }\n }",
"Main",
"public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n while(true) {\n String li;\n try {\n li = sc.nextLine();\n }catch(Exception e) {\n break;\n }\n String[] lisp = li.split(\" \");\n int a = Integer.parseInt(lisp[0]);\n int b = Integer.parseInt(lisp[1]);\n int x;\n int y;\n if(a > b) {\n x = a;\n y = b;\n }else {\n x = b;\n y = a;\n }\n while(x > 0 && y > 0) {\n int z = x % y;\n x = y;\n y = z;\n if(y == 0) {\n System.out.println(x + \" \" + (a / x * b));\n }\n }\n }\n }",
"main",
"{\n Scanner sc = new Scanner(System.in);\n while(true) {\n String li;\n try {\n li = sc.nextLine();\n }catch(Exception e) {\n break;\n }\n String[] lisp = li.split(\" \");\n int a = Integer.parseInt(lisp[0]);\n int b = Integer.parseInt(lisp[1]);\n int x;\n int y;\n if(a > b) {\n x = a;\n y = b;\n }else {\n x = b;\n y = a;\n }\n while(x > 0 && y > 0) {\n int z = x % y;\n x = y;\n y = z;\n if(y == 0) {\n System.out.println(x + \" \" + (a / x * b));\n }\n }\n }\n }",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"while(true) {\n String li;\n try {\n li = sc.nextLine();\n }catch(Exception e) {\n break;\n }\n String[] lisp = li.split(\" \");\n int a = Integer.parseInt(lisp[0]);\n int b = Integer.parseInt(lisp[1]);\n int x;\n int y;\n if(a > b) {\n x = a;\n y = b;\n }else {\n x = b;\n y = a;\n }\n while(x > 0 && y > 0) {\n int z = x % y;\n x = y;\n y = z;\n if(y == 0) {\n System.out.println(x + \" \" + (a / x * b));\n }\n }\n }",
"true",
"{\n String li;\n try {\n li = sc.nextLine();\n }catch(Exception e) {\n break;\n }\n String[] lisp = li.split(\" \");\n int a = Integer.parseInt(lisp[0]);\n int b = Integer.parseInt(lisp[1]);\n int x;\n int y;\n if(a > b) {\n x = a;\n y = b;\n }else {\n x = b;\n y = a;\n }\n while(x > 0 && y > 0) {\n int z = x % y;\n x = y;\n y = z;\n if(y == 0) {\n System.out.println(x + \" \" + (a / x * b));\n }\n }\n }",
"String li;",
"li",
"try {\n li = sc.nextLine();\n }catch(Exception e) {\n break;\n }",
"catch(Exception e) {\n break;\n }",
"Exception e",
"{\n break;\n }",
"break;",
"{\n li = sc.nextLine();\n }",
"li = sc.nextLine()",
"li",
"sc.nextLine()",
"sc.nextLine",
"sc",
"String[] lisp = li.split(\" \");",
"lisp",
"li.split(\" \")",
"li.split",
"li",
"\" \"",
"int a = Integer.parseInt(lisp[0]);",
"a",
"Integer.parseInt(lisp[0])",
"Integer.parseInt",
"Integer",
"lisp[0]",
"lisp",
"0",
"int b = Integer.parseInt(lisp[1]);",
"b",
"Integer.parseInt(lisp[1])",
"Integer.parseInt",
"Integer",
"lisp[1]",
"lisp",
"1",
"int x;",
"x",
"int y;",
"y",
"if(a > b) {\n x = a;\n y = b;\n }else {\n x = b;\n y = a;\n }",
"a > b",
"a",
"b",
"{\n x = a;\n y = b;\n }",
"x = a",
"x",
"a",
"y = b",
"y",
"b",
"{\n x = b;\n y = a;\n }",
"x = b",
"x",
"b",
"y = a",
"y",
"a",
"while(x > 0 && y > 0) {\n int z = x % y;\n x = y;\n y = z;\n if(y == 0) {\n System.out.println(x + \" \" + (a / x * b));\n }\n }",
"x > 0 && y > 0",
"x > 0",
"x",
"0",
"y > 0",
"y",
"0",
"{\n int z = x % y;\n x = y;\n y = z;\n if(y == 0) {\n System.out.println(x + \" \" + (a / x * b));\n }\n }",
"int z = x % y;",
"z",
"x % y",
"x",
"y",
"x = y",
"x",
"y",
"y = z",
"y",
"z",
"if(y == 0) {\n System.out.println(x + \" \" + (a / x * b));\n }",
"y == 0",
"y",
"0",
"{\n System.out.println(x + \" \" + (a / x * b));\n }",
"System.out.println(x + \" \" + (a / x * b))",
"System.out.println",
"System.out",
"System",
"System.out",
"x + \" \" + (a / x * b)",
"x + \" \" + (a / x * b)",
"x",
"\" \"",
"(a / x * b)",
"a / x",
"a",
"x",
"b",
"String[] args",
"args",
"public class Main {\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n while(true) {\n String li;\n try {\n li = sc.nextLine();\n }catch(Exception e) {\n break;\n }\n String[] lisp = li.split(\" \");\n int a = Integer.parseInt(lisp[0]);\n int b = Integer.parseInt(lisp[1]);\n int x;\n int y;\n if(a > b) {\n x = a;\n y = b;\n }else {\n x = b;\n y = a;\n }\n while(x > 0 && y > 0) {\n int z = x % y;\n x = y;\n y = z;\n if(y == 0) {\n System.out.println(x + \" \" + (a / x * b));\n }\n }\n }\n }\n }",
"public class Main {\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n while(true) {\n String li;\n try {\n li = sc.nextLine();\n }catch(Exception e) {\n break;\n }\n String[] lisp = li.split(\" \");\n int a = Integer.parseInt(lisp[0]);\n int b = Integer.parseInt(lisp[1]);\n int x;\n int y;\n if(a > b) {\n x = a;\n y = b;\n }else {\n x = b;\n y = a;\n }\n while(x > 0 && y > 0) {\n int z = x % y;\n x = y;\n y = z;\n if(y == 0) {\n System.out.println(x + \" \" + (a / x * b));\n }\n }\n }\n }\n }",
"Main"
] | import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
while(true) {
String li;
try {
li = sc.nextLine();
}catch(Exception e) {
break;
}
String[] lisp = li.split(" ");
int a = Integer.parseInt(lisp[0]);
int b = Integer.parseInt(lisp[1]);
int x;
int y;
if(a > b) {
x = a;
y = b;
}else {
x = b;
y = a;
}
while(x > 0 && y > 0) {
int z = x % y;
x = y;
y = z;
if(y == 0) {
System.out.println(x + " " + (a / x * b));
}
}
}
}
}
|
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
20,
41,
13,
41,
13,
38,
5,
13,
30,
4,
18,
13,
30,
42,
4,
18,
13,
30,
0,
13,
4,
18,
13,
0,
13,
4,
13,
13,
4,
18,
18,
13,
13,
2,
2,
4,
13,
18,
13,
17,
18,
13,
17,
17,
4,
13,
18,
13,
17,
18,
13,
17,
4,
18,
13,
23,
13,
12,
13,
30,
14,
2,
13,
13,
30,
41,
13,
13,
0,
13,
13,
0,
13,
13,
14,
2,
13,
17,
30,
29,
13,
30,
29,
4,
13,
13,
2,
13,
13,
23,
13,
23,
13,
12,
13,
30,
29,
2,
2,
13,
13,
4,
13,
13,
13,
23,
13,
23,
13,
12,
13,
30,
41,
13,
4,
18,
13,
17,
41,
13,
20,
18,
13,
13,
11,
1,
41,
13,
17,
2,
13,
18,
13,
13,
1,
40,
13,
30,
30,
0,
18,
13,
13,
4,
18,
13,
18,
13,
13,
29,
13,
23,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
10,
11
],
[
10,
12
],
[
0,
13
],
[
13,
14
],
[
13,
15
],
[
0,
16
],
[
16,
17
],
[
16,
18
],
[
0,
19
],
[
19,
20
],
[
19,
21
],
[
21,
22
],
[
21,
23
],
[
23,
24
],
[
24,
25
],
[
24,
26
],
[
23,
27
],
[
27,
28
],
[
27,
29
],
[
23,
30
],
[
30,
31
],
[
23,
32
],
[
32,
33
],
[
23,
34
],
[
34,
35
],
[
35,
36
],
[
35,
37
],
[
37,
38
],
[
38,
39
],
[
39,
40
],
[
34,
41
],
[
41,
42
],
[
42,
43
],
[
43,
44
],
[
44,
45
],
[
42,
46
],
[
46,
47
],
[
47,
48
],
[
47,
49
],
[
49,
50
],
[
50,
51
],
[
46,
52
],
[
52,
53
],
[
52,
54
],
[
54,
55
],
[
54,
56
],
[
46,
57
],
[
57,
58
],
[
58,
59
],
[
59,
60
],
[
59,
61
],
[
57,
62
],
[
63,
63
],
[
63,
64
],
[
64,
65
],
[
64,
66
],
[
66,
67
],
[
66,
68
],
[
64,
69
],
[
69,
70
],
[
69,
71
],
[
63,
72
],
[
63,
73
],
[
73,
74
],
[
73,
75
],
[
75,
76
],
[
75,
77
],
[
73,
78
],
[
78,
79
],
[
78,
80
],
[
41,
81
],
[
81,
82
],
[
82,
83
],
[
21,
84
],
[
84,
85
],
[
19,
86
],
[
86,
87
],
[
86,
88
],
[
88,
89
],
[
89,
90
],
[
90,
91
],
[
90,
92
],
[
89,
93
],
[
93,
94
],
[
94,
95
],
[
94,
96
],
[
93,
97
],
[
97,
98
],
[
97,
99
],
[
93,
100
],
[
100,
101
],
[
100,
102
],
[
88,
103
],
[
103,
104
],
[
104,
105
],
[
104,
106
],
[
103,
107
],
[
107,
108
],
[
108,
109
],
[
103,
110
],
[
110,
111
],
[
111,
112
],
[
112,
113
],
[
112,
114
],
[
112,
115
],
[
115,
116
],
[
115,
117
],
[
86,
118
],
[
118,
119
],
[
86,
120
],
[
120,
121
],
[
19,
122
],
[
122,
123
],
[
122,
124
],
[
124,
125
],
[
125,
126
],
[
126,
127
],
[
127,
128
],
[
127,
129
],
[
126,
130
],
[
130,
131
],
[
130,
132
],
[
130,
133
],
[
122,
134
],
[
134,
135
],
[
122,
136
],
[
136,
137
],
[
19,
138
],
[
138,
139
],
[
138,
140
],
[
140,
141
],
[
141,
142
],
[
141,
143
],
[
143,
144
],
[
144,
145
],
[
143,
146
],
[
140,
147
],
[
147,
148
],
[
147,
149
],
[
150,
151
],
[
150,
152
],
[
140,
153
],
[
153,
154
],
[
154,
155
],
[
155,
156
],
[
155,
157
],
[
153,
158
],
[
158,
159
],
[
158,
160
],
[
160,
161
],
[
160,
162
],
[
153,
163
],
[
163,
164
],
[
164,
165
],
[
153,
166
],
[
167,
167
],
[
167,
168
],
[
168,
169
],
[
169,
170
],
[
169,
171
],
[
168,
172
],
[
172,
173
],
[
173,
174
],
[
172,
175
],
[
175,
176
],
[
175,
177
],
[
140,
178
],
[
178,
179
],
[
138,
180
],
[
180,
181
]
] | [
"import java.util.Scanner;\nimport java.io.BufferedReader;\nimport java.io.IOException;\nimport java.io.InputStreamReader;\nimport java.util.Arrays;\nimport java.lang.Math;\n\nclass Main{\n public static void main(String[] args){\n InputStreamReader inputStreamReader = new InputStreamReader(System.in);\n BufferedReader reader = new BufferedReader(inputStreamReader);\n \n String str;\n int[] num;\n \n try {\n while(reader.ready()){\n str = reader.readLine();\n num = getNum(str);\n\n System.out.println(gcd(num[0], num[1]) + \" \" + lcm(num[0], num[1]));\n }\n reader.close();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n\n\n // ----- 自作関数 ----- //\n\n private static int gcd(int a, int b){\n if (a < b) {\n int buff = a;\n a = b;\n b = buff;\n }\n\n if (b == 0) {\n return a;\n }\n else{\n return gcd(b, a%b);\n }\n }\n\n private static int lcm(int a, int b) {\n return (int) (((long)a * b) / gcd(a, b));\n }\n\n private static int[] getNum(String str){\n String[] data = str.split(\" \"); \n int[] num = new int[data.length];\n\n for (int i = 0; i < data.length; i++){\n num[i] = Integer.parseInt(data[i]);\n }\n return num;\n }\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"import java.io.BufferedReader;",
"BufferedReader",
"java.io",
"import java.io.IOException;",
"IOException",
"java.io",
"import java.io.InputStreamReader;",
"InputStreamReader",
"java.io",
"import java.util.Arrays;",
"Arrays",
"java.util",
"import java.lang.Math;",
"Math",
"java.lang",
"class Main{\n public static void main(String[] args){\n InputStreamReader inputStreamReader = new InputStreamReader(System.in);\n BufferedReader reader = new BufferedReader(inputStreamReader);\n \n String str;\n int[] num;\n \n try {\n while(reader.ready()){\n str = reader.readLine();\n num = getNum(str);\n\n System.out.println(gcd(num[0], num[1]) + \" \" + lcm(num[0], num[1]));\n }\n reader.close();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n\n\n // ----- 自作関数 ----- //\n\n private static int gcd(int a, int b){\n if (a < b) {\n int buff = a;\n a = b;\n b = buff;\n }\n\n if (b == 0) {\n return a;\n }\n else{\n return gcd(b, a%b);\n }\n }\n\n private static int lcm(int a, int b) {\n return (int) (((long)a * b) / gcd(a, b));\n }\n\n private static int[] getNum(String str){\n String[] data = str.split(\" \"); \n int[] num = new int[data.length];\n\n for (int i = 0; i < data.length; i++){\n num[i] = Integer.parseInt(data[i]);\n }\n return num;\n }\n}",
"Main",
"public static void main(String[] args){\n InputStreamReader inputStreamReader = new InputStreamReader(System.in);\n BufferedReader reader = new BufferedReader(inputStreamReader);\n \n String str;\n int[] num;\n \n try {\n while(reader.ready()){\n str = reader.readLine();\n num = getNum(str);\n\n System.out.println(gcd(num[0], num[1]) + \" \" + lcm(num[0], num[1]));\n }\n reader.close();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }",
"main",
"{\n InputStreamReader inputStreamReader = new InputStreamReader(System.in);\n BufferedReader reader = new BufferedReader(inputStreamReader);\n \n String str;\n int[] num;\n \n try {\n while(reader.ready()){\n str = reader.readLine();\n num = getNum(str);\n\n System.out.println(gcd(num[0], num[1]) + \" \" + lcm(num[0], num[1]));\n }\n reader.close();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }",
"InputStreamReader inputStreamReader = new InputStreamReader(System.in);",
"inputStreamReader",
"new InputStreamReader(System.in)",
"BufferedReader reader = new BufferedReader(inputStreamReader);",
"reader",
"new BufferedReader(inputStreamReader)",
"String str;",
"str",
"int[] num;",
"num",
"try {\n while(reader.ready()){\n str = reader.readLine();\n num = getNum(str);\n\n System.out.println(gcd(num[0], num[1]) + \" \" + lcm(num[0], num[1]));\n }\n reader.close();\n } catch (IOException e) {\n e.printStackTrace();\n }",
"catch (IOException e) {\n e.printStackTrace();\n }",
"IOException e",
"{\n e.printStackTrace();\n }",
"e.printStackTrace()",
"e.printStackTrace",
"e",
"{\n while(reader.ready()){\n str = reader.readLine();\n num = getNum(str);\n\n System.out.println(gcd(num[0], num[1]) + \" \" + lcm(num[0], num[1]));\n }\n reader.close();\n }",
"while(reader.ready()){\n str = reader.readLine();\n num = getNum(str);\n\n System.out.println(gcd(num[0], num[1]) + \" \" + lcm(num[0], num[1]));\n }",
"reader.ready()",
"reader.ready",
"reader",
"{\n str = reader.readLine();\n num = getNum(str);\n\n System.out.println(gcd(num[0], num[1]) + \" \" + lcm(num[0], num[1]));\n }",
"str = reader.readLine()",
"str",
"reader.readLine()",
"reader.readLine",
"reader",
"num = getNum(str)",
"num",
"getNum(str)",
"getNum",
"str",
"System.out.println(gcd(num[0], num[1]) + \" \" + lcm(num[0], num[1]))",
"System.out.println",
"System.out",
"System",
"System.out",
"gcd(num[0], num[1]) + \" \" + lcm(num[0], num[1])",
"gcd(num[0], num[1]) + \" \" + lcm(num[0], num[1])",
"gcd(num[0], num[1])",
"gcd",
"num[0]",
"num",
"0",
"num[1]",
"num",
"1",
"\" \"",
"lcm(num[0], num[1])",
"lcm",
"num[0]",
"num",
"0",
"num[1]",
"num",
"1",
"reader.close()",
"reader.close",
"reader",
"String[] args",
"args",
"private static int gcd(int a, int b){\n if (a < b) {\n int buff = a;\n a = b;\n b = buff;\n }\n\n if (b == 0) {\n return a;\n }\n else{\n return gcd(b, a%b);\n }\n }",
"gcd",
"{\n if (a < b) {\n int buff = a;\n a = b;\n b = buff;\n }\n\n if (b == 0) {\n return a;\n }\n else{\n return gcd(b, a%b);\n }\n }",
"if (a < b) {\n int buff = a;\n a = b;\n b = buff;\n }",
"a < b",
"a",
"b",
"{\n int buff = a;\n a = b;\n b = buff;\n }",
"int buff = a;",
"buff",
"a",
"a = b",
"a",
"b",
"b = buff",
"b",
"buff",
"if (b == 0) {\n return a;\n }\n else{\n return gcd(b, a%b);\n }",
"b == 0",
"b",
"0",
"{\n return a;\n }",
"return a;",
"a",
"{\n return gcd(b, a%b);\n }",
"return gcd(b, a%b);",
"gcd(b, a%b)",
"gcd",
"b",
"a%b",
"a",
"b",
"int a",
"a",
"int b",
"b",
"private static int lcm(int a, int b) {\n return (int) (((long)a * b) / gcd(a, b));\n }",
"lcm",
"{\n return (int) (((long)a * b) / gcd(a, b));\n }",
"return (int) (((long)a * b) / gcd(a, b));",
"(int) (((long)a * b) / gcd(a, b))",
"((long)a * b)",
"(long)a",
"b",
"gcd(a, b)",
"gcd",
"a",
"b",
"int a",
"a",
"int b",
"b",
"private static int[] getNum(String str){\n String[] data = str.split(\" \"); \n int[] num = new int[data.length];\n\n for (int i = 0; i < data.length; i++){\n num[i] = Integer.parseInt(data[i]);\n }\n return num;\n }",
"getNum",
"{\n String[] data = str.split(\" \"); \n int[] num = new int[data.length];\n\n for (int i = 0; i < data.length; i++){\n num[i] = Integer.parseInt(data[i]);\n }\n return num;\n }",
"String[] data = str.split(\" \");",
"data",
"str.split(\" \")",
"str.split",
"str",
"\" \"",
"int[] num = new int[data.length];",
"num",
"new int[data.length]",
"data.length",
"data",
"data.length",
"for (int i = 0; i < data.length; i++){\n num[i] = Integer.parseInt(data[i]);\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < data.length",
"i",
"data.length",
"data",
"data.length",
"i++",
"i++",
"i",
"{\n num[i] = Integer.parseInt(data[i]);\n }",
"{\n num[i] = Integer.parseInt(data[i]);\n }",
"num[i] = Integer.parseInt(data[i])",
"num[i]",
"num",
"i",
"Integer.parseInt(data[i])",
"Integer.parseInt",
"Integer",
"data[i]",
"data",
"i",
"return num;",
"num",
"String str",
"str"
] | import java.util.Scanner;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.lang.Math;
class Main{
public static void main(String[] args){
InputStreamReader inputStreamReader = new InputStreamReader(System.in);
BufferedReader reader = new BufferedReader(inputStreamReader);
String str;
int[] num;
try {
while(reader.ready()){
str = reader.readLine();
num = getNum(str);
System.out.println(gcd(num[0], num[1]) + " " + lcm(num[0], num[1]));
}
reader.close();
} catch (IOException e) {
e.printStackTrace();
}
}
// ----- 自作関数 ----- //
private static int gcd(int a, int b){
if (a < b) {
int buff = a;
a = b;
b = buff;
}
if (b == 0) {
return a;
}
else{
return gcd(b, a%b);
}
}
private static int lcm(int a, int b) {
return (int) (((long)a * b) / gcd(a, b));
}
private static int[] getNum(String str){
String[] data = str.split(" ");
int[] num = new int[data.length];
for (int i = 0; i < data.length; i++){
num[i] = Integer.parseInt(data[i]);
}
return num;
}
}
|
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
14,
2,
13,
17,
30,
29,
13,
30,
29,
4,
13,
13,
2,
13,
13,
23,
13,
23,
13,
12,
13,
30,
29,
2,
2,
13,
4,
13,
13,
13,
13,
23,
13,
23,
13,
12,
13,
30,
41,
13,
20,
42,
4,
18,
13,
30,
41,
13,
17,
41,
13,
17,
0,
13,
4,
18,
13,
0,
13,
4,
18,
13,
4,
18,
18,
13,
13,
2,
4,
13,
13,
13,
17,
4,
18,
18,
13,
13,
4,
13,
13,
13,
23,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
10,
11
],
[
10,
12
],
[
9,
13
],
[
13,
14
],
[
14,
15
],
[
9,
16
],
[
16,
17
],
[
17,
18
],
[
18,
19
],
[
18,
20
],
[
18,
21
],
[
21,
22
],
[
21,
23
],
[
6,
24
],
[
24,
25
],
[
6,
26
],
[
26,
27
],
[
4,
28
],
[
28,
29
],
[
28,
30
],
[
30,
31
],
[
31,
32
],
[
32,
33
],
[
33,
34
],
[
33,
35
],
[
35,
36
],
[
35,
37
],
[
35,
38
],
[
32,
39
],
[
28,
40
],
[
40,
41
],
[
28,
42
],
[
42,
43
],
[
4,
44
],
[
44,
45
],
[
44,
46
],
[
46,
47
],
[
47,
48
],
[
47,
49
],
[
46,
50
],
[
50,
51
],
[
51,
52
],
[
52,
53
],
[
50,
54
],
[
54,
55
],
[
55,
56
],
[
55,
57
],
[
54,
58
],
[
58,
59
],
[
58,
60
],
[
54,
61
],
[
61,
62
],
[
61,
63
],
[
63,
64
],
[
64,
65
],
[
54,
66
],
[
66,
67
],
[
66,
68
],
[
68,
69
],
[
69,
70
],
[
54,
71
],
[
71,
72
],
[
72,
73
],
[
73,
74
],
[
73,
75
],
[
71,
76
],
[
76,
77
],
[
77,
78
],
[
77,
79
],
[
77,
80
],
[
76,
81
],
[
54,
82
],
[
82,
83
],
[
83,
84
],
[
84,
85
],
[
84,
86
],
[
82,
87
],
[
87,
88
],
[
87,
89
],
[
87,
90
],
[
44,
91
],
[
91,
92
]
] | [
"import java.util.Scanner;\nclass Main{\n\tpublic static int gcd(int m, int n) {\n\t\tif(n ==0){\n\t\t\treturn m;\n\t\t}else{\n\t\t\treturn gcd(n,m%n);\n\t\t}\n\t}\n\tpublic static long lcm(int m, int n){\n\t\treturn (m / gcd(m, n)) * n; \n\t}\n public static void main(String[] a){\n \t\n \tScanner scan = new Scanner(System.in);\n \twhile (scan.hasNext()){ \n \tint n = 0;\n \tint m = 0;\n \tm = scan.nextInt();\n \tn = scan.nextInt();\n \tSystem.out.print(gcd(m,n) + \" \");\n \tSystem.out.println(lcm(m,n));\n \t\n \t}\n }\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"class Main{\n\tpublic static int gcd(int m, int n) {\n\t\tif(n ==0){\n\t\t\treturn m;\n\t\t}else{\n\t\t\treturn gcd(n,m%n);\n\t\t}\n\t}\n\tpublic static long lcm(int m, int n){\n\t\treturn (m / gcd(m, n)) * n; \n\t}\n public static void main(String[] a){\n \t\n \tScanner scan = new Scanner(System.in);\n \twhile (scan.hasNext()){ \n \tint n = 0;\n \tint m = 0;\n \tm = scan.nextInt();\n \tn = scan.nextInt();\n \tSystem.out.print(gcd(m,n) + \" \");\n \tSystem.out.println(lcm(m,n));\n \t\n \t}\n }\n}",
"Main",
"public static int gcd(int m, int n) {\n\t\tif(n ==0){\n\t\t\treturn m;\n\t\t}else{\n\t\t\treturn gcd(n,m%n);\n\t\t}\n\t}",
"gcd",
"{\n\t\tif(n ==0){\n\t\t\treturn m;\n\t\t}else{\n\t\t\treturn gcd(n,m%n);\n\t\t}\n\t}",
"if(n ==0){\n\t\t\treturn m;\n\t\t}else{\n\t\t\treturn gcd(n,m%n);\n\t\t}",
"n ==0",
"n",
"0",
"{\n\t\t\treturn m;\n\t\t}",
"return m;",
"m",
"{\n\t\t\treturn gcd(n,m%n);\n\t\t}",
"return gcd(n,m%n);",
"gcd(n,m%n)",
"gcd",
"n",
"m%n",
"m",
"n",
"int m",
"m",
"int n",
"n",
"public static long lcm(int m, int n){\n\t\treturn (m / gcd(m, n)) * n; \n\t}",
"lcm",
"{\n\t\treturn (m / gcd(m, n)) * n; \n\t}",
"return (m / gcd(m, n)) * n;",
"(m / gcd(m, n)) * n",
"(m / gcd(m, n))",
"m",
"gcd(m, n)",
"gcd",
"m",
"n",
"n",
"int m",
"m",
"int n",
"n",
"public static void main(String[] a){\n \t\n \tScanner scan = new Scanner(System.in);\n \twhile (scan.hasNext()){ \n \tint n = 0;\n \tint m = 0;\n \tm = scan.nextInt();\n \tn = scan.nextInt();\n \tSystem.out.print(gcd(m,n) + \" \");\n \tSystem.out.println(lcm(m,n));\n \t\n \t}\n }",
"main",
"{\n \t\n \tScanner scan = new Scanner(System.in);\n \twhile (scan.hasNext()){ \n \tint n = 0;\n \tint m = 0;\n \tm = scan.nextInt();\n \tn = scan.nextInt();\n \tSystem.out.print(gcd(m,n) + \" \");\n \tSystem.out.println(lcm(m,n));\n \t\n \t}\n }",
"Scanner scan = new Scanner(System.in);",
"scan",
"new Scanner(System.in)",
"while (scan.hasNext()){ \n \tint n = 0;\n \tint m = 0;\n \tm = scan.nextInt();\n \tn = scan.nextInt();\n \tSystem.out.print(gcd(m,n) + \" \");\n \tSystem.out.println(lcm(m,n));\n \t\n \t}",
"scan.hasNext()",
"scan.hasNext",
"scan",
"{ \n \tint n = 0;\n \tint m = 0;\n \tm = scan.nextInt();\n \tn = scan.nextInt();\n \tSystem.out.print(gcd(m,n) + \" \");\n \tSystem.out.println(lcm(m,n));\n \t\n \t}",
"int n = 0;",
"n",
"0",
"int m = 0;",
"m",
"0",
"m = scan.nextInt()",
"m",
"scan.nextInt()",
"scan.nextInt",
"scan",
"n = scan.nextInt()",
"n",
"scan.nextInt()",
"scan.nextInt",
"scan",
"System.out.print(gcd(m,n) + \" \")",
"System.out.print",
"System.out",
"System",
"System.out",
"gcd(m,n) + \" \"",
"gcd(m,n)",
"gcd",
"m",
"n",
"\" \"",
"System.out.println(lcm(m,n))",
"System.out.println",
"System.out",
"System",
"System.out",
"lcm(m,n)",
"lcm",
"m",
"n",
"String[] a",
"a"
] | import java.util.Scanner;
class Main{
public static int gcd(int m, int n) {
if(n ==0){
return m;
}else{
return gcd(n,m%n);
}
}
public static long lcm(int m, int n){
return (m / gcd(m, n)) * n;
}
public static void main(String[] a){
Scanner scan = new Scanner(System.in);
while (scan.hasNext()){
int n = 0;
int m = 0;
m = scan.nextInt();
n = scan.nextInt();
System.out.print(gcd(m,n) + " ");
System.out.println(lcm(m,n));
}
}
} |
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
38,
5,
13,
30,
4,
18,
18,
13,
13,
13,
30,
41,
13,
41,
13,
41,
13,
41,
13,
4,
18,
13,
41,
13,
42,
2,
13,
17,
30,
0,
13,
20,
0,
13,
4,
18,
13,
4,
18,
13,
0,
13,
4,
18,
13,
4,
18,
13,
41,
13,
20,
0,
13,
4,
18,
13,
13,
13,
4,
18,
18,
13,
13,
2,
2,
13,
17,
4,
18,
13,
13,
13,
13,
0,
13,
4,
18,
13,
23,
13,
6,
13,
41,
13,
12,
13,
30,
42,
17,
30,
14,
2,
13,
13,
30,
0,
13,
2,
13,
13,
30,
3,
14,
2,
2,
13,
13,
17,
30,
0,
13,
13,
30,
4,
13,
13,
13,
29,
13,
23,
13,
23,
13,
12,
13,
30,
29,
2,
2,
13,
13,
13,
23,
13,
23,
13,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
157,
11
],
[
157,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
15,
17
],
[
14,
18
],
[
18,
19
],
[
19,
20
],
[
19,
21
],
[
21,
22
],
[
22,
23
],
[
23,
24
],
[
24,
25
],
[
24,
26
],
[
22,
27
],
[
18,
28
],
[
28,
29
],
[
29,
30
],
[
28,
31
],
[
31,
32
],
[
28,
33
],
[
33,
34
],
[
28,
35
],
[
35,
36
],
[
35,
37
],
[
37,
38
],
[
38,
39
],
[
28,
40
],
[
40,
41
],
[
28,
42
],
[
42,
43
],
[
43,
44
],
[
43,
45
],
[
42,
46
],
[
46,
47
],
[
47,
48
],
[
47,
49
],
[
46,
50
],
[
50,
51
],
[
50,
52
],
[
52,
53
],
[
53,
54
],
[
52,
55
],
[
55,
56
],
[
56,
57
],
[
46,
58
],
[
58,
59
],
[
58,
60
],
[
60,
61
],
[
61,
62
],
[
60,
63
],
[
63,
64
],
[
64,
65
],
[
46,
66
],
[
66,
67
],
[
66,
68
],
[
46,
69
],
[
69,
70
],
[
69,
71
],
[
71,
72
],
[
72,
73
],
[
71,
74
],
[
71,
75
],
[
46,
76
],
[
76,
77
],
[
77,
78
],
[
78,
79
],
[
78,
80
],
[
76,
81
],
[
82,
82
],
[
82,
83
],
[
82,
84
],
[
82,
85
],
[
85,
86
],
[
86,
87
],
[
85,
88
],
[
85,
89
],
[
85,
90
],
[
46,
91
],
[
91,
92
],
[
91,
93
],
[
93,
94
],
[
94,
95
],
[
12,
96
],
[
96,
97
],
[
0,
98
],
[
98,
99
],
[
98,
100
],
[
100,
101
],
[
98,
102
],
[
102,
103
],
[
102,
104
],
[
104,
105
],
[
105,
106
],
[
105,
107
],
[
107,
108
],
[
108,
109
],
[
109,
110
],
[
109,
111
],
[
108,
112
],
[
112,
113
],
[
113,
114
],
[
113,
115
],
[
115,
116
],
[
115,
117
],
[
108,
118
],
[
118,
119
],
[
104,
120
],
[
120,
121
],
[
121,
122
],
[
122,
123
],
[
122,
124
],
[
121,
125
],
[
120,
126
],
[
126,
127
],
[
127,
128
],
[
127,
129
],
[
120,
130
],
[
130,
131
],
[
131,
132
],
[
131,
133
],
[
131,
134
],
[
104,
135
],
[
135,
136
],
[
102,
137
],
[
137,
138
],
[
102,
139
],
[
139,
140
],
[
98,
141
],
[
141,
142
],
[
141,
143
],
[
143,
144
],
[
144,
145
],
[
145,
146
],
[
146,
147
],
[
146,
148
],
[
145,
149
],
[
141,
150
],
[
150,
151
],
[
141,
152
],
[
152,
153
],
[
141,
154
],
[
154,
155
],
[
0,
156
],
[
156,
157
],
[
156,
158
]
] | [
"import java.io.BufferedReader;\nimport java.io.InputStreamReader;\nimport java.util.StringTokenizer;\n\npublic class Main {\n public static void main(String[] args) throws Exception {\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n try {\n long a,b,gcd;\n String line = br.readLine();\n StringTokenizer st;\n while(line!=null){\n st=new StringTokenizer(line);\n a=Long.parseLong(st.nextToken());\n b=Long.parseLong(st.nextToken());\n Test t = new Test();\n gcd=t.gcd(a,b);\n System.out.println(gcd + \" \" + t.lcm(a,b,gcd));\n line = br.readLine();\n }\n } catch (Exception e) {\n System.out.println(e);\n }\n }\n}\n\nclass Test{\n long r;\n long gcd(long a, long b){\n while(true){\n if(a>b){\n a=a-b;\n }else{\n break;\n }\n }\n if(b%a==0){\n r=a;\n }else{\n gcd(b,a);\n }\n return r;\n }\n\n long lcm(long a, long b,long gcd){\n return a*b/gcd;\n }\n}",
"import java.io.BufferedReader;",
"BufferedReader",
"java.io",
"import java.io.InputStreamReader;",
"InputStreamReader",
"java.io",
"import java.util.StringTokenizer;",
"StringTokenizer",
"java.util",
"public class Main {\n public static void main(String[] args) throws Exception {\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n try {\n long a,b,gcd;\n String line = br.readLine();\n StringTokenizer st;\n while(line!=null){\n st=new StringTokenizer(line);\n a=Long.parseLong(st.nextToken());\n b=Long.parseLong(st.nextToken());\n Test t = new Test();\n gcd=t.gcd(a,b);\n System.out.println(gcd + \" \" + t.lcm(a,b,gcd));\n line = br.readLine();\n }\n } catch (Exception e) {\n System.out.println(e);\n }\n }\n}",
"Main",
"public static void main(String[] args) throws Exception {\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n try {\n long a,b,gcd;\n String line = br.readLine();\n StringTokenizer st;\n while(line!=null){\n st=new StringTokenizer(line);\n a=Long.parseLong(st.nextToken());\n b=Long.parseLong(st.nextToken());\n Test t = new Test();\n gcd=t.gcd(a,b);\n System.out.println(gcd + \" \" + t.lcm(a,b,gcd));\n line = br.readLine();\n }\n } catch (Exception e) {\n System.out.println(e);\n }\n }",
"main",
"{\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n try {\n long a,b,gcd;\n String line = br.readLine();\n StringTokenizer st;\n while(line!=null){\n st=new StringTokenizer(line);\n a=Long.parseLong(st.nextToken());\n b=Long.parseLong(st.nextToken());\n Test t = new Test();\n gcd=t.gcd(a,b);\n System.out.println(gcd + \" \" + t.lcm(a,b,gcd));\n line = br.readLine();\n }\n } catch (Exception e) {\n System.out.println(e);\n }\n }",
"BufferedReader br = new BufferedReader(new InputStreamReader(System.in));",
"br",
"new BufferedReader(new InputStreamReader(System.in))",
"try {\n long a,b,gcd;\n String line = br.readLine();\n StringTokenizer st;\n while(line!=null){\n st=new StringTokenizer(line);\n a=Long.parseLong(st.nextToken());\n b=Long.parseLong(st.nextToken());\n Test t = new Test();\n gcd=t.gcd(a,b);\n System.out.println(gcd + \" \" + t.lcm(a,b,gcd));\n line = br.readLine();\n }\n } catch (Exception e) {\n System.out.println(e);\n }",
"catch (Exception e) {\n System.out.println(e);\n }",
"Exception e",
"{\n System.out.println(e);\n }",
"System.out.println(e)",
"System.out.println",
"System.out",
"System",
"System.out",
"e",
"{\n long a,b,gcd;\n String line = br.readLine();\n StringTokenizer st;\n while(line!=null){\n st=new StringTokenizer(line);\n a=Long.parseLong(st.nextToken());\n b=Long.parseLong(st.nextToken());\n Test t = new Test();\n gcd=t.gcd(a,b);\n System.out.println(gcd + \" \" + t.lcm(a,b,gcd));\n line = br.readLine();\n }\n }",
"long a",
"a",
"b",
"b",
"gcd;",
"gcd",
"String line = br.readLine();",
"line",
"br.readLine()",
"br.readLine",
"br",
"StringTokenizer st;",
"st",
"while(line!=null){\n st=new StringTokenizer(line);\n a=Long.parseLong(st.nextToken());\n b=Long.parseLong(st.nextToken());\n Test t = new Test();\n gcd=t.gcd(a,b);\n System.out.println(gcd + \" \" + t.lcm(a,b,gcd));\n line = br.readLine();\n }",
"line!=null",
"line",
"null",
"{\n st=new StringTokenizer(line);\n a=Long.parseLong(st.nextToken());\n b=Long.parseLong(st.nextToken());\n Test t = new Test();\n gcd=t.gcd(a,b);\n System.out.println(gcd + \" \" + t.lcm(a,b,gcd));\n line = br.readLine();\n }",
"st=new StringTokenizer(line)",
"st",
"new StringTokenizer(line)",
"a=Long.parseLong(st.nextToken())",
"a",
"Long.parseLong(st.nextToken())",
"Long.parseLong",
"Long",
"st.nextToken()",
"st.nextToken",
"st",
"b=Long.parseLong(st.nextToken())",
"b",
"Long.parseLong(st.nextToken())",
"Long.parseLong",
"Long",
"st.nextToken()",
"st.nextToken",
"st",
"Test t = new Test();",
"t",
"new Test()",
"gcd=t.gcd(a,b)",
"gcd",
"t.gcd(a,b)",
"t.gcd",
"t",
"a",
"b",
"System.out.println(gcd + \" \" + t.lcm(a,b,gcd))",
"System.out.println",
"System.out",
"System",
"System.out",
"gcd + \" \" + t.lcm(a,b,gcd)",
"gcd + \" \" + t.lcm(a,b,gcd)",
"gcd",
"\" \"",
"t.lcm(a,b,gcd)",
"t.lcm",
"t",
"a",
"b",
"gcd",
"line = br.readLine()",
"line",
"br.readLine()",
"br.readLine",
"br",
"String[] args",
"args",
"class Test{\n long r;\n long gcd(long a, long b){\n while(true){\n if(a>b){\n a=a-b;\n }else{\n break;\n }\n }\n if(b%a==0){\n r=a;\n }else{\n gcd(b,a);\n }\n return r;\n }\n\n long lcm(long a, long b,long gcd){\n return a*b/gcd;\n }\n}",
"Test",
"long r;",
"r",
"long gcd(long a, long b){\n while(true){\n if(a>b){\n a=a-b;\n }else{\n break;\n }\n }\n if(b%a==0){\n r=a;\n }else{\n gcd(b,a);\n }\n return r;\n }",
"gcd",
"{\n while(true){\n if(a>b){\n a=a-b;\n }else{\n break;\n }\n }\n if(b%a==0){\n r=a;\n }else{\n gcd(b,a);\n }\n return r;\n }",
"while(true){\n if(a>b){\n a=a-b;\n }else{\n break;\n }\n }",
"true",
"{\n if(a>b){\n a=a-b;\n }else{\n break;\n }\n }",
"if(a>b){\n a=a-b;\n }else{\n break;\n }",
"a>b",
"a",
"b",
"{\n a=a-b;\n }",
"a=a-b",
"a",
"a-b",
"a",
"b",
"{\n break;\n }",
"break;",
"if(b%a==0){\n r=a;\n }else{\n gcd(b,a);\n }",
"b%a==0",
"b%a",
"b",
"a",
"0",
"{\n r=a;\n }",
"r=a",
"r",
"a",
"{\n gcd(b,a);\n }",
"gcd(b,a)",
"gcd",
"b",
"a",
"return r;",
"r",
"long a",
"a",
"long b",
"b",
"long lcm(long a, long b,long gcd){\n return a*b/gcd;\n }",
"lcm",
"{\n return a*b/gcd;\n }",
"return a*b/gcd;",
"a*b/gcd",
"a*b",
"a",
"b",
"gcd",
"long a",
"a",
"long b",
"b",
"long gcd",
"gcd",
"public class Main {\n public static void main(String[] args) throws Exception {\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n try {\n long a,b,gcd;\n String line = br.readLine();\n StringTokenizer st;\n while(line!=null){\n st=new StringTokenizer(line);\n a=Long.parseLong(st.nextToken());\n b=Long.parseLong(st.nextToken());\n Test t = new Test();\n gcd=t.gcd(a,b);\n System.out.println(gcd + \" \" + t.lcm(a,b,gcd));\n line = br.readLine();\n }\n } catch (Exception e) {\n System.out.println(e);\n }\n }\n}",
"public class Main {\n public static void main(String[] args) throws Exception {\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n try {\n long a,b,gcd;\n String line = br.readLine();\n StringTokenizer st;\n while(line!=null){\n st=new StringTokenizer(line);\n a=Long.parseLong(st.nextToken());\n b=Long.parseLong(st.nextToken());\n Test t = new Test();\n gcd=t.gcd(a,b);\n System.out.println(gcd + \" \" + t.lcm(a,b,gcd));\n line = br.readLine();\n }\n } catch (Exception e) {\n System.out.println(e);\n }\n }\n}",
"Main"
] | import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.StringTokenizer;
public class Main {
public static void main(String[] args) throws Exception {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
try {
long a,b,gcd;
String line = br.readLine();
StringTokenizer st;
while(line!=null){
st=new StringTokenizer(line);
a=Long.parseLong(st.nextToken());
b=Long.parseLong(st.nextToken());
Test t = new Test();
gcd=t.gcd(a,b);
System.out.println(gcd + " " + t.lcm(a,b,gcd));
line = br.readLine();
}
} catch (Exception e) {
System.out.println(e);
}
}
}
class Test{
long r;
long gcd(long a, long b){
while(true){
if(a>b){
a=a-b;
}else{
break;
}
}
if(b%a==0){
r=a;
}else{
gcd(b,a);
}
return r;
}
long lcm(long a, long b,long gcd){
return a*b/gcd;
}
} |
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
38,
30,
41,
13,
20,
4,
13,
13,
23,
13,
12,
13,
30,
42,
4,
18,
13,
30,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
41,
13,
4,
13,
13,
13,
41,
13,
2,
2,
13,
13,
13,
4,
18,
18,
13,
13,
2,
2,
13,
17,
13,
23,
13,
12,
13,
30,
14,
2,
13,
17,
29,
13,
29,
4,
13,
13,
2,
13,
13,
23,
13,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
83,
5
],
[
83,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
10,
11
],
[
11,
12
],
[
11,
13
],
[
10,
14
],
[
14,
15
],
[
14,
16
],
[
6,
17
],
[
17,
18
],
[
83,
19
],
[
19,
20
],
[
19,
21
],
[
21,
22
],
[
22,
23
],
[
23,
24
],
[
24,
25
],
[
22,
26
],
[
26,
27
],
[
27,
28
],
[
27,
29
],
[
29,
30
],
[
30,
31
],
[
26,
32
],
[
32,
33
],
[
32,
34
],
[
34,
35
],
[
35,
36
],
[
26,
37
],
[
37,
38
],
[
37,
39
],
[
39,
40
],
[
39,
41
],
[
39,
42
],
[
26,
43
],
[
43,
44
],
[
43,
45
],
[
45,
46
],
[
46,
47
],
[
46,
48
],
[
45,
49
],
[
26,
50
],
[
50,
51
],
[
51,
52
],
[
52,
53
],
[
52,
54
],
[
50,
55
],
[
56,
56
],
[
56,
57
],
[
56,
58
],
[
56,
59
],
[
19,
60
],
[
60,
61
],
[
83,
62
],
[
62,
63
],
[
62,
64
],
[
64,
65
],
[
65,
66
],
[
66,
67
],
[
66,
68
],
[
65,
69
],
[
69,
70
],
[
64,
71
],
[
71,
72
],
[
72,
73
],
[
72,
74
],
[
72,
75
],
[
75,
76
],
[
75,
77
],
[
62,
78
],
[
78,
79
],
[
62,
80
],
[
80,
81
],
[
0,
82
],
[
82,
83
],
[
82,
84
]
] | [
"import java.util.Scanner;\n\npublic class Main {\n public static void main(String[] args) {\n try (Scanner in = new Scanner(System.in)) {\n solve(in);\n }\n }\n\n private static void solve(Scanner in) {\n while (in.hasNext()) {\n int a = in.nextInt(), b = in.nextInt();\n int gcd = gcd(a, b);\n int lcm = a / gcd * b;\n System.out.println(gcd + \" \" + lcm);\n }\n }\n\n private static int gcd(int a, int b) {\n if (b == 0)\n return a;\n return gcd(b, a % b);\n }\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n public static void main(String[] args) {\n try (Scanner in = new Scanner(System.in)) {\n solve(in);\n }\n }\n\n private static void solve(Scanner in) {\n while (in.hasNext()) {\n int a = in.nextInt(), b = in.nextInt();\n int gcd = gcd(a, b);\n int lcm = a / gcd * b;\n System.out.println(gcd + \" \" + lcm);\n }\n }\n\n private static int gcd(int a, int b) {\n if (b == 0)\n return a;\n return gcd(b, a % b);\n }\n}",
"Main",
"public static void main(String[] args) {\n try (Scanner in = new Scanner(System.in)) {\n solve(in);\n }\n }",
"main",
"{\n try (Scanner in = new Scanner(System.in)) {\n solve(in);\n }\n }",
"try (Scanner in = new Scanner(System.in)) {\n solve(in);\n }",
"{\n solve(in);\n }",
"Scanner in = new Scanner(System.in)",
"Scanner in = new Scanner(System.in)",
"new Scanner(System.in)",
"solve(in)",
"solve",
"in",
"String[] args",
"args",
"private static void solve(Scanner in) {\n while (in.hasNext()) {\n int a = in.nextInt(), b = in.nextInt();\n int gcd = gcd(a, b);\n int lcm = a / gcd * b;\n System.out.println(gcd + \" \" + lcm);\n }\n }",
"solve",
"{\n while (in.hasNext()) {\n int a = in.nextInt(), b = in.nextInt();\n int gcd = gcd(a, b);\n int lcm = a / gcd * b;\n System.out.println(gcd + \" \" + lcm);\n }\n }",
"while (in.hasNext()) {\n int a = in.nextInt(), b = in.nextInt();\n int gcd = gcd(a, b);\n int lcm = a / gcd * b;\n System.out.println(gcd + \" \" + lcm);\n }",
"in.hasNext()",
"in.hasNext",
"in",
"{\n int a = in.nextInt(), b = in.nextInt();\n int gcd = gcd(a, b);\n int lcm = a / gcd * b;\n System.out.println(gcd + \" \" + lcm);\n }",
"int a = in.nextInt()",
"a",
"in.nextInt()",
"in.nextInt",
"in",
"b = in.nextInt();",
"b",
"in.nextInt()",
"in.nextInt",
"in",
"int gcd = gcd(a, b);",
"gcd",
"gcd(a, b)",
"gcd",
"a",
"b",
"int lcm = a / gcd * b;",
"lcm",
"a / gcd * b",
"a / gcd",
"a",
"gcd",
"b",
"System.out.println(gcd + \" \" + lcm)",
"System.out.println",
"System.out",
"System",
"System.out",
"gcd + \" \" + lcm",
"gcd + \" \" + lcm",
"gcd",
"\" \"",
"lcm",
"Scanner in",
"in",
"private static int gcd(int a, int b) {\n if (b == 0)\n return a;\n return gcd(b, a % b);\n }",
"gcd",
"{\n if (b == 0)\n return a;\n return gcd(b, a % b);\n }",
"if (b == 0)\n return a;",
"b == 0",
"b",
"0",
"return a;",
"a",
"return gcd(b, a % b);",
"gcd(b, a % b)",
"gcd",
"b",
"a % b",
"a",
"b",
"int a",
"a",
"int b",
"b",
"public class Main {\n public static void main(String[] args) {\n try (Scanner in = new Scanner(System.in)) {\n solve(in);\n }\n }\n\n private static void solve(Scanner in) {\n while (in.hasNext()) {\n int a = in.nextInt(), b = in.nextInt();\n int gcd = gcd(a, b);\n int lcm = a / gcd * b;\n System.out.println(gcd + \" \" + lcm);\n }\n }\n\n private static int gcd(int a, int b) {\n if (b == 0)\n return a;\n return gcd(b, a % b);\n }\n}",
"public class Main {\n public static void main(String[] args) {\n try (Scanner in = new Scanner(System.in)) {\n solve(in);\n }\n }\n\n private static void solve(Scanner in) {\n while (in.hasNext()) {\n int a = in.nextInt(), b = in.nextInt();\n int gcd = gcd(a, b);\n int lcm = a / gcd * b;\n System.out.println(gcd + \" \" + lcm);\n }\n }\n\n private static int gcd(int a, int b) {\n if (b == 0)\n return a;\n return gcd(b, a % b);\n }\n}",
"Main"
] | import java.util.Scanner;
public class Main {
public static void main(String[] args) {
try (Scanner in = new Scanner(System.in)) {
solve(in);
}
}
private static void solve(Scanner in) {
while (in.hasNext()) {
int a = in.nextInt(), b = in.nextInt();
int gcd = gcd(a, b);
int lcm = a / gcd * b;
System.out.println(gcd + " " + lcm);
}
}
private static int gcd(int a, int b) {
if (b == 0)
return a;
return gcd(b, a % b);
}
} |
[
7,
15,
13,
17,
6,
13,
41,
13,
20,
12,
13,
30,
41,
13,
41,
13,
42,
4,
18,
13,
30,
0,
13,
4,
18,
13,
0,
13,
4,
18,
13,
4,
18,
18,
13,
13,
2,
2,
4,
13,
13,
13,
17,
4,
13,
13,
13,
23,
13,
12,
13,
30,
41,
13,
13,
42,
2,
2,
13,
13,
17,
30,
0,
13,
2,
13,
13,
0,
13,
13,
0,
13,
13,
29,
13,
23,
13,
23,
13,
12,
13,
30,
29,
2,
2,
13,
13,
4,
13,
13,
13,
23,
13,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
96,
5
],
[
96,
6
],
[
6,
7
],
[
6,
8
],
[
96,
9
],
[
9,
10
],
[
9,
11
],
[
11,
12
],
[
12,
13
],
[
11,
14
],
[
14,
15
],
[
11,
16
],
[
16,
17
],
[
17,
18
],
[
18,
19
],
[
16,
20
],
[
20,
21
],
[
21,
22
],
[
21,
23
],
[
23,
24
],
[
24,
25
],
[
20,
26
],
[
26,
27
],
[
26,
28
],
[
28,
29
],
[
29,
30
],
[
20,
31
],
[
31,
32
],
[
32,
33
],
[
33,
34
],
[
33,
35
],
[
31,
36
],
[
37,
37
],
[
37,
38
],
[
38,
39
],
[
38,
40
],
[
38,
41
],
[
37,
42
],
[
37,
43
],
[
43,
44
],
[
43,
45
],
[
43,
46
],
[
9,
47
],
[
47,
48
],
[
96,
49
],
[
49,
50
],
[
49,
51
],
[
51,
52
],
[
52,
53
],
[
52,
54
],
[
51,
55
],
[
55,
56
],
[
56,
57
],
[
57,
58
],
[
57,
59
],
[
56,
60
],
[
55,
61
],
[
61,
62
],
[
62,
63
],
[
62,
64
],
[
64,
65
],
[
64,
66
],
[
61,
67
],
[
67,
68
],
[
67,
69
],
[
61,
70
],
[
70,
71
],
[
70,
72
],
[
51,
73
],
[
73,
74
],
[
49,
75
],
[
75,
76
],
[
49,
77
],
[
77,
78
],
[
96,
79
],
[
79,
80
],
[
79,
81
],
[
81,
82
],
[
82,
83
],
[
83,
84
],
[
84,
85
],
[
84,
86
],
[
83,
87
],
[
87,
88
],
[
87,
89
],
[
87,
90
],
[
79,
91
],
[
91,
92
],
[
79,
93
],
[
93,
94
],
[
0,
95
],
[
95,
96
],
[
95,
97
]
] | [
"import java.util.Scanner;\n\npublic class Main {\n\tstatic Scanner sc = new Scanner(System.in);\n\n\tpublic static void main(String[] args) {\n\t\tlong a;\n\t\tlong b;\n\n\t\twhile(sc.hasNext()) {\n\t\t\ta = sc.nextInt();\n\t\t\tb = sc.nextInt();\n\n\t\t\tSystem.out.println(gcd(a, b) + \" \" + lcm(a, b));\n\t\t}\n\t}\n\n\tpublic static long gcd(long a, long b) {\n\t\tlong gcd = a;\n\t\twhile(b % a != 0) {\n\t\t\tgcd = b % a;\n\t\t\tb = a;\n\t\t\ta = gcd;\n\t\t}\n\t\treturn gcd;\n\t}\n\n\tpublic static long lcm(long a, long b) {\n\t\treturn (a * b) / gcd(a, b);\n\t}\n\n\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n\tstatic Scanner sc = new Scanner(System.in);\n\n\tpublic static void main(String[] args) {\n\t\tlong a;\n\t\tlong b;\n\n\t\twhile(sc.hasNext()) {\n\t\t\ta = sc.nextInt();\n\t\t\tb = sc.nextInt();\n\n\t\t\tSystem.out.println(gcd(a, b) + \" \" + lcm(a, b));\n\t\t}\n\t}\n\n\tpublic static long gcd(long a, long b) {\n\t\tlong gcd = a;\n\t\twhile(b % a != 0) {\n\t\t\tgcd = b % a;\n\t\t\tb = a;\n\t\t\ta = gcd;\n\t\t}\n\t\treturn gcd;\n\t}\n\n\tpublic static long lcm(long a, long b) {\n\t\treturn (a * b) / gcd(a, b);\n\t}\n\n\n}",
"Main",
"static Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"public static void main(String[] args) {\n\t\tlong a;\n\t\tlong b;\n\n\t\twhile(sc.hasNext()) {\n\t\t\ta = sc.nextInt();\n\t\t\tb = sc.nextInt();\n\n\t\t\tSystem.out.println(gcd(a, b) + \" \" + lcm(a, b));\n\t\t}\n\t}",
"main",
"{\n\t\tlong a;\n\t\tlong b;\n\n\t\twhile(sc.hasNext()) {\n\t\t\ta = sc.nextInt();\n\t\t\tb = sc.nextInt();\n\n\t\t\tSystem.out.println(gcd(a, b) + \" \" + lcm(a, b));\n\t\t}\n\t}",
"long a;",
"a",
"long b;",
"b",
"while(sc.hasNext()) {\n\t\t\ta = sc.nextInt();\n\t\t\tb = sc.nextInt();\n\n\t\t\tSystem.out.println(gcd(a, b) + \" \" + lcm(a, b));\n\t\t}",
"sc.hasNext()",
"sc.hasNext",
"sc",
"{\n\t\t\ta = sc.nextInt();\n\t\t\tb = sc.nextInt();\n\n\t\t\tSystem.out.println(gcd(a, b) + \" \" + lcm(a, b));\n\t\t}",
"a = sc.nextInt()",
"a",
"sc.nextInt()",
"sc.nextInt",
"sc",
"b = sc.nextInt()",
"b",
"sc.nextInt()",
"sc.nextInt",
"sc",
"System.out.println(gcd(a, b) + \" \" + lcm(a, b))",
"System.out.println",
"System.out",
"System",
"System.out",
"gcd(a, b) + \" \" + lcm(a, b)",
"gcd(a, b) + \" \" + lcm(a, b)",
"gcd(a, b)",
"gcd",
"a",
"b",
"\" \"",
"lcm(a, b)",
"lcm",
"a",
"b",
"String[] args",
"args",
"public static long gcd(long a, long b) {\n\t\tlong gcd = a;\n\t\twhile(b % a != 0) {\n\t\t\tgcd = b % a;\n\t\t\tb = a;\n\t\t\ta = gcd;\n\t\t}\n\t\treturn gcd;\n\t}",
"gcd",
"{\n\t\tlong gcd = a;\n\t\twhile(b % a != 0) {\n\t\t\tgcd = b % a;\n\t\t\tb = a;\n\t\t\ta = gcd;\n\t\t}\n\t\treturn gcd;\n\t}",
"long gcd = a;",
"gcd",
"a",
"while(b % a != 0) {\n\t\t\tgcd = b % a;\n\t\t\tb = a;\n\t\t\ta = gcd;\n\t\t}",
"b % a != 0",
"b % a",
"b",
"a",
"0",
"{\n\t\t\tgcd = b % a;\n\t\t\tb = a;\n\t\t\ta = gcd;\n\t\t}",
"gcd = b % a",
"gcd",
"b % a",
"b",
"a",
"b = a",
"b",
"a",
"a = gcd",
"a",
"gcd",
"return gcd;",
"gcd",
"long a",
"a",
"long b",
"b",
"public static long lcm(long a, long b) {\n\t\treturn (a * b) / gcd(a, b);\n\t}",
"lcm",
"{\n\t\treturn (a * b) / gcd(a, b);\n\t}",
"return (a * b) / gcd(a, b);",
"(a * b) / gcd(a, b)",
"(a * b)",
"a",
"b",
"gcd(a, b)",
"gcd",
"a",
"b",
"long a",
"a",
"long b",
"b",
"public class Main {\n\tstatic Scanner sc = new Scanner(System.in);\n\n\tpublic static void main(String[] args) {\n\t\tlong a;\n\t\tlong b;\n\n\t\twhile(sc.hasNext()) {\n\t\t\ta = sc.nextInt();\n\t\t\tb = sc.nextInt();\n\n\t\t\tSystem.out.println(gcd(a, b) + \" \" + lcm(a, b));\n\t\t}\n\t}\n\n\tpublic static long gcd(long a, long b) {\n\t\tlong gcd = a;\n\t\twhile(b % a != 0) {\n\t\t\tgcd = b % a;\n\t\t\tb = a;\n\t\t\ta = gcd;\n\t\t}\n\t\treturn gcd;\n\t}\n\n\tpublic static long lcm(long a, long b) {\n\t\treturn (a * b) / gcd(a, b);\n\t}\n\n\n}",
"public class Main {\n\tstatic Scanner sc = new Scanner(System.in);\n\n\tpublic static void main(String[] args) {\n\t\tlong a;\n\t\tlong b;\n\n\t\twhile(sc.hasNext()) {\n\t\t\ta = sc.nextInt();\n\t\t\tb = sc.nextInt();\n\n\t\t\tSystem.out.println(gcd(a, b) + \" \" + lcm(a, b));\n\t\t}\n\t}\n\n\tpublic static long gcd(long a, long b) {\n\t\tlong gcd = a;\n\t\twhile(b % a != 0) {\n\t\t\tgcd = b % a;\n\t\t\tb = a;\n\t\t\ta = gcd;\n\t\t}\n\t\treturn gcd;\n\t}\n\n\tpublic static long lcm(long a, long b) {\n\t\treturn (a * b) / gcd(a, b);\n\t}\n\n\n}",
"Main"
] | import java.util.Scanner;
public class Main {
static Scanner sc = new Scanner(System.in);
public static void main(String[] args) {
long a;
long b;
while(sc.hasNext()) {
a = sc.nextInt();
b = sc.nextInt();
System.out.println(gcd(a, b) + " " + lcm(a, b));
}
}
public static long gcd(long a, long b) {
long gcd = a;
while(b % a != 0) {
gcd = b % a;
b = a;
a = gcd;
}
return gcd;
}
public static long lcm(long a, long b) {
return (a * b) / gcd(a, b);
}
} |
[
7,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
11,
1,
41,
13,
20,
4,
18,
13,
30,
30,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
4,
18,
18,
13,
13,
2,
2,
4,
18,
13,
13,
17,
4,
18,
4,
18,
13,
13,
4,
18,
13,
13,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
57,
8
],
[
57,
9
],
[
9,
10
],
[
9,
11
],
[
11,
12
],
[
12,
13
],
[
13,
14
],
[
14,
15
],
[
14,
16
],
[
12,
17
],
[
17,
18
],
[
18,
19
],
[
12,
20
],
[
21,
21
],
[
21,
22
],
[
22,
23
],
[
22,
24
],
[
24,
25
],
[
25,
26
],
[
21,
27
],
[
27,
28
],
[
27,
29
],
[
29,
30
],
[
30,
31
],
[
21,
32
],
[
32,
33
],
[
33,
34
],
[
34,
35
],
[
34,
36
],
[
32,
37
],
[
38,
38
],
[
38,
39
],
[
39,
40
],
[
40,
41
],
[
39,
42
],
[
38,
43
],
[
38,
44
],
[
44,
45
],
[
45,
46
],
[
46,
47
],
[
47,
48
],
[
46,
49
],
[
44,
50
],
[
50,
51
],
[
51,
52
],
[
50,
53
],
[
9,
54
],
[
54,
55
],
[
0,
56
],
[
56,
57
],
[
56,
58
]
] | [
"import java.math.*;import java.util.*;public class Main{public static void main(String[]a){for(Scanner s=new Scanner(System.in);s.hasNext();){BigInteger x=s.nextBigInteger(),y=s.nextBigInteger();System.out.println(x.gcd(y)+\" \"+x.multiply(y).divide(x.gcd(y)));}}}",
"import java.math.*;",
"math.*",
"java",
"import java.util.*;",
"util.*",
"java",
"public class Main{public static void main(String[]a){for(Scanner s=new Scanner(System.in);s.hasNext();){BigInteger x=s.nextBigInteger(),y=s.nextBigInteger();System.out.println(x.gcd(y)+\" \"+x.multiply(y).divide(x.gcd(y)));}}}",
"Main",
"public static void main(String[]a){for(Scanner s=new Scanner(System.in);s.hasNext();){BigInteger x=s.nextBigInteger(),y=s.nextBigInteger();System.out.println(x.gcd(y)+\" \"+x.multiply(y).divide(x.gcd(y)));}}",
"main",
"{for(Scanner s=new Scanner(System.in);s.hasNext();){BigInteger x=s.nextBigInteger(),y=s.nextBigInteger();System.out.println(x.gcd(y)+\" \"+x.multiply(y).divide(x.gcd(y)));}}",
"for(Scanner s=new Scanner(System.in);s.hasNext();){BigInteger x=s.nextBigInteger(),y=s.nextBigInteger();System.out.println(x.gcd(y)+\" \"+x.multiply(y).divide(x.gcd(y)));}",
"Scanner s=new Scanner(System.in);",
"Scanner s=new Scanner(System.in);",
"s",
"new Scanner(System.in)",
"s.hasNext()",
"s.hasNext",
"s",
"{BigInteger x=s.nextBigInteger(),y=s.nextBigInteger();System.out.println(x.gcd(y)+\" \"+x.multiply(y).divide(x.gcd(y)));}",
"{BigInteger x=s.nextBigInteger(),y=s.nextBigInteger();System.out.println(x.gcd(y)+\" \"+x.multiply(y).divide(x.gcd(y)));}",
"BigInteger x=s.nextBigInteger()",
"x",
"s.nextBigInteger()",
"s.nextBigInteger",
"s",
"y=s.nextBigInteger();",
"y",
"s.nextBigInteger()",
"s.nextBigInteger",
"s",
"System.out.println(x.gcd(y)+\" \"+x.multiply(y).divide(x.gcd(y)))",
"System.out.println",
"System.out",
"System",
"System.out",
"x.gcd(y)+\" \"+x.multiply(y).divide(x.gcd(y))",
"x.gcd(y)+\" \"+x.multiply(y).divide(x.gcd(y))",
"x.gcd(y)",
"x.gcd",
"x",
"y",
"\" \"",
"x.multiply(y).divide(x.gcd(y))",
"x.multiply(y).divide",
"x.multiply(y)",
"x.multiply",
"x",
"y",
"x.gcd(y)",
"x.gcd",
"x",
"y",
"String[]a",
"a",
"public class Main{public static void main(String[]a){for(Scanner s=new Scanner(System.in);s.hasNext();){BigInteger x=s.nextBigInteger(),y=s.nextBigInteger();System.out.println(x.gcd(y)+\" \"+x.multiply(y).divide(x.gcd(y)));}}}",
"public class Main{public static void main(String[]a){for(Scanner s=new Scanner(System.in);s.hasNext();){BigInteger x=s.nextBigInteger(),y=s.nextBigInteger();System.out.println(x.gcd(y)+\" \"+x.multiply(y).divide(x.gcd(y)));}}}",
"Main"
] | import java.math.*;import java.util.*;public class Main{public static void main(String[]a){for(Scanner s=new Scanner(System.in);s.hasNext();){BigInteger x=s.nextBigInteger(),y=s.nextBigInteger();System.out.println(x.gcd(y)+" "+x.multiply(y).divide(x.gcd(y)));}}} |
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
42,
4,
18,
13,
30,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
14,
2,
13,
13,
30,
41,
13,
13,
0,
13,
13,
0,
13,
13,
41,
13,
4,
13,
13,
13,
4,
18,
18,
13,
13,
2,
2,
13,
17,
2,
2,
13,
13,
13,
23,
13,
12,
13,
30,
14,
2,
2,
13,
13,
17,
29,
13,
29,
4,
13,
13,
2,
13,
13,
23,
13,
23,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
13,
14
],
[
14,
15
],
[
12,
16
],
[
16,
17
],
[
17,
18
],
[
17,
19
],
[
19,
20
],
[
20,
21
],
[
16,
22
],
[
22,
23
],
[
22,
24
],
[
24,
25
],
[
25,
26
],
[
16,
27
],
[
27,
28
],
[
28,
29
],
[
28,
30
],
[
27,
31
],
[
31,
32
],
[
32,
33
],
[
32,
34
],
[
31,
35
],
[
35,
36
],
[
35,
37
],
[
31,
38
],
[
38,
39
],
[
38,
40
],
[
16,
41
],
[
41,
42
],
[
41,
43
],
[
43,
44
],
[
43,
45
],
[
43,
46
],
[
16,
47
],
[
47,
48
],
[
48,
49
],
[
49,
50
],
[
49,
51
],
[
47,
52
],
[
53,
53
],
[
53,
54
],
[
53,
55
],
[
53,
56
],
[
56,
57
],
[
57,
58
],
[
57,
59
],
[
56,
60
],
[
6,
61
],
[
61,
62
],
[
4,
63
],
[
63,
64
],
[
63,
65
],
[
65,
66
],
[
66,
67
],
[
67,
68
],
[
68,
69
],
[
68,
70
],
[
67,
71
],
[
66,
72
],
[
72,
73
],
[
65,
74
],
[
74,
75
],
[
75,
76
],
[
75,
77
],
[
75,
78
],
[
78,
79
],
[
78,
80
],
[
63,
81
],
[
81,
82
],
[
63,
83
],
[
83,
84
]
] | [
"import java.util.Scanner;\nclass Main{\n\tpublic static void main(String[] a){\n\t\tScanner scan = new Scanner(System.in);\n\t\twhile(scan.hasNext()){\n\t\t\tint num1 = scan.nextInt(), num2 = scan.nextInt();\n\t\t\tif(num1 < num2){\n\t\t\t\tint sub = num1;\n\t\t\t\tnum1 = num2;\n\t\t\t\tnum2 = sub;\n\t\t\t}\n\t\t\tint div = euclid(num1, num2);\n\t\t\tSystem.out.println(div + \" \" + num1 / div * num2);\n\t\t}\n\t}\n\tstatic int euclid(int num1, int num2){\n\t\tif(num1 % num2 == 0) return num2;\n\t\treturn euclid(num2, num1 % num2);\n\t}\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"class Main{\n\tpublic static void main(String[] a){\n\t\tScanner scan = new Scanner(System.in);\n\t\twhile(scan.hasNext()){\n\t\t\tint num1 = scan.nextInt(), num2 = scan.nextInt();\n\t\t\tif(num1 < num2){\n\t\t\t\tint sub = num1;\n\t\t\t\tnum1 = num2;\n\t\t\t\tnum2 = sub;\n\t\t\t}\n\t\t\tint div = euclid(num1, num2);\n\t\t\tSystem.out.println(div + \" \" + num1 / div * num2);\n\t\t}\n\t}\n\tstatic int euclid(int num1, int num2){\n\t\tif(num1 % num2 == 0) return num2;\n\t\treturn euclid(num2, num1 % num2);\n\t}\n}",
"Main",
"public static void main(String[] a){\n\t\tScanner scan = new Scanner(System.in);\n\t\twhile(scan.hasNext()){\n\t\t\tint num1 = scan.nextInt(), num2 = scan.nextInt();\n\t\t\tif(num1 < num2){\n\t\t\t\tint sub = num1;\n\t\t\t\tnum1 = num2;\n\t\t\t\tnum2 = sub;\n\t\t\t}\n\t\t\tint div = euclid(num1, num2);\n\t\t\tSystem.out.println(div + \" \" + num1 / div * num2);\n\t\t}\n\t}",
"main",
"{\n\t\tScanner scan = new Scanner(System.in);\n\t\twhile(scan.hasNext()){\n\t\t\tint num1 = scan.nextInt(), num2 = scan.nextInt();\n\t\t\tif(num1 < num2){\n\t\t\t\tint sub = num1;\n\t\t\t\tnum1 = num2;\n\t\t\t\tnum2 = sub;\n\t\t\t}\n\t\t\tint div = euclid(num1, num2);\n\t\t\tSystem.out.println(div + \" \" + num1 / div * num2);\n\t\t}\n\t}",
"Scanner scan = new Scanner(System.in);",
"scan",
"new Scanner(System.in)",
"while(scan.hasNext()){\n\t\t\tint num1 = scan.nextInt(), num2 = scan.nextInt();\n\t\t\tif(num1 < num2){\n\t\t\t\tint sub = num1;\n\t\t\t\tnum1 = num2;\n\t\t\t\tnum2 = sub;\n\t\t\t}\n\t\t\tint div = euclid(num1, num2);\n\t\t\tSystem.out.println(div + \" \" + num1 / div * num2);\n\t\t}",
"scan.hasNext()",
"scan.hasNext",
"scan",
"{\n\t\t\tint num1 = scan.nextInt(), num2 = scan.nextInt();\n\t\t\tif(num1 < num2){\n\t\t\t\tint sub = num1;\n\t\t\t\tnum1 = num2;\n\t\t\t\tnum2 = sub;\n\t\t\t}\n\t\t\tint div = euclid(num1, num2);\n\t\t\tSystem.out.println(div + \" \" + num1 / div * num2);\n\t\t}",
"int num1 = scan.nextInt()",
"num1",
"scan.nextInt()",
"scan.nextInt",
"scan",
"num2 = scan.nextInt();",
"num2",
"scan.nextInt()",
"scan.nextInt",
"scan",
"if(num1 < num2){\n\t\t\t\tint sub = num1;\n\t\t\t\tnum1 = num2;\n\t\t\t\tnum2 = sub;\n\t\t\t}",
"num1 < num2",
"num1",
"num2",
"{\n\t\t\t\tint sub = num1;\n\t\t\t\tnum1 = num2;\n\t\t\t\tnum2 = sub;\n\t\t\t}",
"int sub = num1;",
"sub",
"num1",
"num1 = num2",
"num1",
"num2",
"num2 = sub",
"num2",
"sub",
"int div = euclid(num1, num2);",
"div",
"euclid(num1, num2)",
"euclid",
"num1",
"num2",
"System.out.println(div + \" \" + num1 / div * num2)",
"System.out.println",
"System.out",
"System",
"System.out",
"div + \" \" + num1 / div * num2",
"div + \" \" + num1 / div * num2",
"div",
"\" \"",
"num1 / div * num2",
"num1 / div",
"num1",
"div",
"num2",
"String[] a",
"a",
"static int euclid(int num1, int num2){\n\t\tif(num1 % num2 == 0) return num2;\n\t\treturn euclid(num2, num1 % num2);\n\t}",
"euclid",
"{\n\t\tif(num1 % num2 == 0) return num2;\n\t\treturn euclid(num2, num1 % num2);\n\t}",
"if(num1 % num2 == 0) return num2;",
"num1 % num2 == 0",
"num1 % num2",
"num1",
"num2",
"0",
"return num2;",
"num2",
"return euclid(num2, num1 % num2);",
"euclid(num2, num1 % num2)",
"euclid",
"num2",
"num1 % num2",
"num1",
"num2",
"int num1",
"num1",
"int num2",
"num2"
] | import java.util.Scanner;
class Main{
public static void main(String[] a){
Scanner scan = new Scanner(System.in);
while(scan.hasNext()){
int num1 = scan.nextInt(), num2 = scan.nextInt();
if(num1 < num2){
int sub = num1;
num1 = num2;
num2 = sub;
}
int div = euclid(num1, num2);
System.out.println(div + " " + num1 / div * num2);
}
}
static int euclid(int num1, int num2){
if(num1 % num2 == 0) return num2;
return euclid(num2, num1 % num2);
}
} |
[
7,
15,
13,
17,
6,
13,
41,
13,
12,
13,
30,
14,
2,
13,
13,
30,
41,
13,
13,
0,
13,
13,
0,
13,
13,
14,
2,
13,
17,
29,
13,
29,
4,
13,
13,
2,
13,
13,
23,
13,
23,
13,
12,
13,
30,
29,
2,
2,
13,
13,
4,
13,
13,
13,
23,
13,
23,
13,
12,
13,
30,
0,
13,
20,
42,
4,
18,
13,
30,
41,
13,
41,
13,
0,
13,
4,
18,
13,
0,
13,
4,
18,
13,
4,
18,
18,
13,
13,
2,
2,
4,
13,
13,
13,
17,
4,
13,
13,
13,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
102,
5
],
[
102,
6
],
[
6,
7
],
[
102,
8
],
[
8,
9
],
[
8,
10
],
[
10,
11
],
[
11,
12
],
[
12,
13
],
[
12,
14
],
[
11,
15
],
[
15,
16
],
[
16,
17
],
[
16,
18
],
[
15,
19
],
[
19,
20
],
[
19,
21
],
[
15,
22
],
[
22,
23
],
[
22,
24
],
[
10,
25
],
[
25,
26
],
[
26,
27
],
[
26,
28
],
[
25,
29
],
[
29,
30
],
[
10,
31
],
[
31,
32
],
[
32,
33
],
[
32,
34
],
[
32,
35
],
[
35,
36
],
[
35,
37
],
[
8,
38
],
[
38,
39
],
[
8,
40
],
[
40,
41
],
[
102,
42
],
[
42,
43
],
[
42,
44
],
[
44,
45
],
[
45,
46
],
[
46,
47
],
[
47,
48
],
[
47,
49
],
[
46,
50
],
[
50,
51
],
[
50,
52
],
[
50,
53
],
[
42,
54
],
[
54,
55
],
[
42,
56
],
[
56,
57
],
[
102,
58
],
[
58,
59
],
[
58,
60
],
[
60,
61
],
[
61,
62
],
[
61,
63
],
[
60,
64
],
[
64,
65
],
[
65,
66
],
[
66,
67
],
[
64,
68
],
[
68,
69
],
[
69,
70
],
[
68,
71
],
[
71,
72
],
[
68,
73
],
[
73,
74
],
[
73,
75
],
[
75,
76
],
[
76,
77
],
[
68,
78
],
[
78,
79
],
[
78,
80
],
[
80,
81
],
[
81,
82
],
[
68,
83
],
[
83,
84
],
[
84,
85
],
[
85,
86
],
[
85,
87
],
[
83,
88
],
[
89,
89
],
[
89,
90
],
[
90,
91
],
[
90,
92
],
[
90,
93
],
[
89,
94
],
[
89,
95
],
[
95,
96
],
[
95,
97
],
[
95,
98
],
[
58,
99
],
[
99,
100
],
[
0,
101
],
[
101,
102
],
[
101,
103
]
] | [
"import java.util.Scanner;\n\npublic class Main\n{\n\tstatic Scanner in;\n\tstatic long gcd(long p,long q)\n\t{\n\t\tif(p<q){long t=p;p=q;q=t;}\n\t\tif(q==0)return p;\n\t\treturn gcd(q,p%q);\n\t}\n\tstatic long lcm(long p,long q)\n\t{\n\t\treturn p*q/gcd(p,q);\n\t}\n\tpublic static void main(String[] args)\n\t{\n\t\tin=new Scanner(System.in);\n\n\t\twhile(in.hasNext())\n\t\t{\n\t\t long n,m;\n\t\t\tn=in.nextLong();m=in.nextLong();\n\t\t System.out.println(gcd(n,m)+\" \"+lcm(n,m));\n\t\t}\n\t}\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main\n{\n\tstatic Scanner in;\n\tstatic long gcd(long p,long q)\n\t{\n\t\tif(p<q){long t=p;p=q;q=t;}\n\t\tif(q==0)return p;\n\t\treturn gcd(q,p%q);\n\t}\n\tstatic long lcm(long p,long q)\n\t{\n\t\treturn p*q/gcd(p,q);\n\t}\n\tpublic static void main(String[] args)\n\t{\n\t\tin=new Scanner(System.in);\n\n\t\twhile(in.hasNext())\n\t\t{\n\t\t long n,m;\n\t\t\tn=in.nextLong();m=in.nextLong();\n\t\t System.out.println(gcd(n,m)+\" \"+lcm(n,m));\n\t\t}\n\t}\n}",
"Main",
"static Scanner in;",
"in",
"static long gcd(long p,long q)\n\t{\n\t\tif(p<q){long t=p;p=q;q=t;}\n\t\tif(q==0)return p;\n\t\treturn gcd(q,p%q);\n\t}",
"gcd",
"{\n\t\tif(p<q){long t=p;p=q;q=t;}\n\t\tif(q==0)return p;\n\t\treturn gcd(q,p%q);\n\t}",
"if(p<q){long t=p;p=q;q=t;}",
"p<q",
"p",
"q",
"{long t=p;p=q;q=t;}",
"long t=p;",
"t",
"p",
"p=q",
"p",
"q",
"q=t",
"q",
"t",
"if(q==0)return p;",
"q==0",
"q",
"0",
"return p;",
"p",
"return gcd(q,p%q);",
"gcd(q,p%q)",
"gcd",
"q",
"p%q",
"p",
"q",
"long p",
"p",
"long q",
"q",
"static long lcm(long p,long q)\n\t{\n\t\treturn p*q/gcd(p,q);\n\t}",
"lcm",
"{\n\t\treturn p*q/gcd(p,q);\n\t}",
"return p*q/gcd(p,q);",
"p*q/gcd(p,q)",
"p*q",
"p",
"q",
"gcd(p,q)",
"gcd",
"p",
"q",
"long p",
"p",
"long q",
"q",
"public static void main(String[] args)\n\t{\n\t\tin=new Scanner(System.in);\n\n\t\twhile(in.hasNext())\n\t\t{\n\t\t long n,m;\n\t\t\tn=in.nextLong();m=in.nextLong();\n\t\t System.out.println(gcd(n,m)+\" \"+lcm(n,m));\n\t\t}\n\t}",
"main",
"{\n\t\tin=new Scanner(System.in);\n\n\t\twhile(in.hasNext())\n\t\t{\n\t\t long n,m;\n\t\t\tn=in.nextLong();m=in.nextLong();\n\t\t System.out.println(gcd(n,m)+\" \"+lcm(n,m));\n\t\t}\n\t}",
"in=new Scanner(System.in)",
"in",
"new Scanner(System.in)",
"while(in.hasNext())\n\t\t{\n\t\t long n,m;\n\t\t\tn=in.nextLong();m=in.nextLong();\n\t\t System.out.println(gcd(n,m)+\" \"+lcm(n,m));\n\t\t}",
"in.hasNext()",
"in.hasNext",
"in",
"{\n\t\t long n,m;\n\t\t\tn=in.nextLong();m=in.nextLong();\n\t\t System.out.println(gcd(n,m)+\" \"+lcm(n,m));\n\t\t}",
"long n",
"n",
"m;",
"m",
"n=in.nextLong()",
"n",
"in.nextLong()",
"in.nextLong",
"in",
"m=in.nextLong()",
"m",
"in.nextLong()",
"in.nextLong",
"in",
"System.out.println(gcd(n,m)+\" \"+lcm(n,m))",
"System.out.println",
"System.out",
"System",
"System.out",
"gcd(n,m)+\" \"+lcm(n,m)",
"gcd(n,m)+\" \"+lcm(n,m)",
"gcd(n,m)",
"gcd",
"n",
"m",
"\" \"",
"lcm(n,m)",
"lcm",
"n",
"m",
"String[] args",
"args",
"public class Main\n{\n\tstatic Scanner in;\n\tstatic long gcd(long p,long q)\n\t{\n\t\tif(p<q){long t=p;p=q;q=t;}\n\t\tif(q==0)return p;\n\t\treturn gcd(q,p%q);\n\t}\n\tstatic long lcm(long p,long q)\n\t{\n\t\treturn p*q/gcd(p,q);\n\t}\n\tpublic static void main(String[] args)\n\t{\n\t\tin=new Scanner(System.in);\n\n\t\twhile(in.hasNext())\n\t\t{\n\t\t long n,m;\n\t\t\tn=in.nextLong();m=in.nextLong();\n\t\t System.out.println(gcd(n,m)+\" \"+lcm(n,m));\n\t\t}\n\t}\n}",
"public class Main\n{\n\tstatic Scanner in;\n\tstatic long gcd(long p,long q)\n\t{\n\t\tif(p<q){long t=p;p=q;q=t;}\n\t\tif(q==0)return p;\n\t\treturn gcd(q,p%q);\n\t}\n\tstatic long lcm(long p,long q)\n\t{\n\t\treturn p*q/gcd(p,q);\n\t}\n\tpublic static void main(String[] args)\n\t{\n\t\tin=new Scanner(System.in);\n\n\t\twhile(in.hasNext())\n\t\t{\n\t\t long n,m;\n\t\t\tn=in.nextLong();m=in.nextLong();\n\t\t System.out.println(gcd(n,m)+\" \"+lcm(n,m));\n\t\t}\n\t}\n}",
"Main"
] | import java.util.Scanner;
public class Main
{
static Scanner in;
static long gcd(long p,long q)
{
if(p<q){long t=p;p=q;q=t;}
if(q==0)return p;
return gcd(q,p%q);
}
static long lcm(long p,long q)
{
return p*q/gcd(p,q);
}
public static void main(String[] args)
{
in=new Scanner(System.in);
while(in.hasNext())
{
long n,m;
n=in.nextLong();m=in.nextLong();
System.out.println(gcd(n,m)+" "+lcm(n,m));
}
}
} |
[
7,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
41,
13,
42,
4,
18,
13,
30,
0,
13,
4,
18,
13,
0,
13,
4,
18,
13,
41,
13,
4,
13,
13,
13,
4,
18,
18,
13,
13,
2,
2,
18,
13,
17,
17,
18,
13,
17,
23,
13,
12,
13,
30,
41,
13,
20,
42,
2,
40,
4,
13,
13,
40,
4,
13,
13,
30,
41,
13,
14,
2,
4,
13,
13,
4,
13,
13,
30,
0,
13,
4,
13,
13,
0,
13,
2,
13,
13,
0,
13,
2,
13,
13,
4,
18,
13,
13,
14,
2,
4,
13,
13,
4,
13,
13,
30,
0,
13,
4,
13,
13,
14,
2,
2,
13,
13,
17,
30,
0,
13,
2,
13,
13,
0,
13,
2,
13,
13,
4,
18,
13,
13,
30,
0,
13,
17,
14,
2,
2,
2,
13,
13,
17,
2,
2,
13,
17,
17,
30,
0,
13,
2,
13,
13,
0,
13,
2,
13,
13,
4,
18,
13,
13,
30,
3,
14,
2,
4,
13,
13,
4,
13,
13,
30,
0,
13,
4,
13,
13,
14,
2,
2,
13,
13,
17,
30,
0,
13,
2,
13,
13,
0,
13,
2,
13,
13,
4,
18,
13,
13,
30,
0,
13,
17,
14,
2,
2,
2,
13,
13,
17,
2,
2,
13,
17,
17,
30,
0,
13,
2,
13,
13,
0,
13,
2,
13,
13,
4,
18,
13,
13,
30,
3,
14,
2,
13,
13,
30,
0,
13,
2,
13,
13,
0,
13,
2,
13,
13,
4,
18,
13,
13,
41,
13,
20,
17,
0,
18,
13,
17,
17,
0,
18,
13,
17,
17,
28,
13,
13,
30,
30,
0,
18,
13,
17,
2,
18,
13,
17,
13,
0,
18,
13,
17,
2,
2,
18,
13,
17,
13,
13,
29,
13,
23,
13,
23,
13,
12,
13,
30,
14,
2,
2,
13,
17,
17,
29,
17,
14,
2,
2,
13,
17,
17,
29,
17,
14,
2,
2,
13,
17,
17,
29,
17,
41,
13,
17,
42,
2,
2,
13,
13,
13,
30,
14,
2,
2,
13,
13,
13,
30,
29,
13,
0,
13,
17,
29,
13,
23,
13,
12,
13,
30,
14,
2,
4,
13,
13,
13,
30,
29,
17,
30,
29,
17,
23,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
9,
10
],
[
9,
11
],
[
11,
12
],
[
12,
13
],
[
12,
14
],
[
11,
15
],
[
15,
16
],
[
11,
17
],
[
17,
18
],
[
11,
19
],
[
19,
20
],
[
20,
21
],
[
21,
22
],
[
19,
23
],
[
23,
24
],
[
24,
25
],
[
24,
26
],
[
26,
27
],
[
27,
28
],
[
23,
29
],
[
29,
30
],
[
29,
31
],
[
31,
32
],
[
32,
33
],
[
23,
34
],
[
34,
35
],
[
34,
36
],
[
36,
37
],
[
36,
38
],
[
36,
39
],
[
23,
40
],
[
40,
41
],
[
41,
42
],
[
42,
43
],
[
42,
44
],
[
40,
45
],
[
46,
46
],
[
46,
47
],
[
47,
48
],
[
47,
49
],
[
46,
50
],
[
46,
51
],
[
51,
52
],
[
51,
53
],
[
9,
54
],
[
54,
55
],
[
7,
56
],
[
56,
57
],
[
56,
58
],
[
58,
59
],
[
59,
60
],
[
59,
61
],
[
58,
62
],
[
62,
63
],
[
63,
64
],
[
64,
65
],
[
65,
66
],
[
65,
67
],
[
63,
68
],
[
68,
69
],
[
69,
70
],
[
69,
71
],
[
62,
72
],
[
72,
73
],
[
73,
74
],
[
72,
75
],
[
75,
76
],
[
76,
77
],
[
77,
78
],
[
77,
79
],
[
76,
80
],
[
80,
81
],
[
80,
82
],
[
75,
83
],
[
83,
84
],
[
84,
85
],
[
84,
86
],
[
86,
87
],
[
86,
88
],
[
83,
89
],
[
89,
90
],
[
89,
91
],
[
91,
92
],
[
91,
93
],
[
83,
94
],
[
94,
95
],
[
94,
96
],
[
96,
97
],
[
96,
98
],
[
83,
99
],
[
99,
100
],
[
100,
101
],
[
99,
102
],
[
75,
103
],
[
103,
104
],
[
104,
105
],
[
105,
106
],
[
105,
107
],
[
104,
108
],
[
108,
109
],
[
108,
110
],
[
103,
111
],
[
111,
112
],
[
112,
113
],
[
112,
114
],
[
114,
115
],
[
114,
116
],
[
111,
117
],
[
117,
118
],
[
118,
119
],
[
119,
120
],
[
119,
121
],
[
118,
122
],
[
117,
123
],
[
123,
124
],
[
124,
125
],
[
124,
126
],
[
126,
127
],
[
126,
128
],
[
123,
129
],
[
129,
130
],
[
129,
131
],
[
131,
132
],
[
131,
133
],
[
123,
134
],
[
134,
135
],
[
135,
136
],
[
134,
137
],
[
117,
138
],
[
138,
139
],
[
139,
140
],
[
139,
141
],
[
138,
142
],
[
142,
143
],
[
143,
144
],
[
144,
145
],
[
145,
146
],
[
145,
147
],
[
144,
148
],
[
143,
149
],
[
149,
150
],
[
150,
151
],
[
150,
152
],
[
149,
153
],
[
142,
154
],
[
154,
155
],
[
155,
156
],
[
155,
157
],
[
157,
158
],
[
157,
159
],
[
154,
160
],
[
160,
161
],
[
160,
162
],
[
162,
163
],
[
162,
164
],
[
154,
165
],
[
165,
166
],
[
166,
167
],
[
165,
168
],
[
142,
169
],
[
169,
170
],
[
103,
171
],
[
171,
172
],
[
172,
173
],
[
173,
174
],
[
173,
175
],
[
172,
176
],
[
176,
177
],
[
176,
178
],
[
171,
179
],
[
179,
180
],
[
180,
181
],
[
180,
182
],
[
182,
183
],
[
182,
184
],
[
179,
185
],
[
185,
186
],
[
186,
187
],
[
187,
188
],
[
187,
189
],
[
186,
190
],
[
185,
191
],
[
191,
192
],
[
192,
193
],
[
192,
194
],
[
194,
195
],
[
194,
196
],
[
191,
197
],
[
197,
198
],
[
197,
199
],
[
199,
200
],
[
199,
201
],
[
191,
202
],
[
202,
203
],
[
203,
204
],
[
202,
205
],
[
185,
206
],
[
206,
207
],
[
207,
208
],
[
207,
209
],
[
206,
210
],
[
210,
211
],
[
211,
212
],
[
212,
213
],
[
213,
214
],
[
213,
215
],
[
212,
216
],
[
211,
217
],
[
217,
218
],
[
218,
219
],
[
218,
220
],
[
217,
221
],
[
210,
222
],
[
222,
223
],
[
223,
224
],
[
223,
225
],
[
225,
226
],
[
225,
227
],
[
222,
228
],
[
228,
229
],
[
228,
230
],
[
230,
231
],
[
230,
232
],
[
222,
233
],
[
233,
234
],
[
234,
235
],
[
233,
236
],
[
210,
237
],
[
237,
238
],
[
58,
239
],
[
239,
240
],
[
240,
241
],
[
240,
242
],
[
239,
243
],
[
243,
244
],
[
244,
245
],
[
244,
246
],
[
246,
247
],
[
246,
248
],
[
243,
249
],
[
249,
250
],
[
249,
251
],
[
251,
252
],
[
251,
253
],
[
243,
254
],
[
254,
255
],
[
255,
256
],
[
254,
257
],
[
58,
258
],
[
258,
259
],
[
258,
260
],
[
58,
262
],
[
262,
263
],
[
263,
264
],
[
263,
265
],
[
262,
266
],
[
58,
267
],
[
267,
268
],
[
268,
269
],
[
268,
270
],
[
267,
271
],
[
58,
272
],
[
272,
273
],
[
272,
274
],
[
272,
275
],
[
276,
276
],
[
276,
277
],
[
277,
278
],
[
278,
279
],
[
278,
280
],
[
277,
281
],
[
281,
282
],
[
282,
283
],
[
282,
284
],
[
281,
285
],
[
58,
286
],
[
286,
287
],
[
287,
288
],
[
287,
289
],
[
286,
290
],
[
291,
291
],
[
291,
292
],
[
292,
293
],
[
292,
294
],
[
291,
295
],
[
291,
296
],
[
58,
297
],
[
297,
298
],
[
56,
299
],
[
299,
300
],
[
56,
301
],
[
301,
302
],
[
7,
303
],
[
303,
304
],
[
303,
305
],
[
305,
306
],
[
306,
307
],
[
307,
308
],
[
308,
309
],
[
308,
310
],
[
307,
311
],
[
306,
312
],
[
312,
313
],
[
305,
314
],
[
314,
315
],
[
315,
316
],
[
316,
317
],
[
316,
318
],
[
315,
319
],
[
314,
320
],
[
320,
321
],
[
305,
322
],
[
322,
323
],
[
323,
324
],
[
324,
325
],
[
324,
326
],
[
323,
327
],
[
322,
328
],
[
328,
329
],
[
305,
330
],
[
330,
331
],
[
330,
332
],
[
305,
333
],
[
333,
334
],
[
334,
335
],
[
335,
336
],
[
335,
337
],
[
334,
338
],
[
333,
339
],
[
339,
340
],
[
340,
341
],
[
341,
342
],
[
342,
343
],
[
342,
344
],
[
341,
345
],
[
340,
346
],
[
346,
347
],
[
347,
348
],
[
339,
349
],
[
349,
350
],
[
349,
351
],
[
305,
352
],
[
352,
353
],
[
303,
354
],
[
354,
355
],
[
7,
356
],
[
356,
357
],
[
356,
358
],
[
358,
359
],
[
359,
360
],
[
360,
361
],
[
361,
362
],
[
361,
363
],
[
360,
364
],
[
359,
365
],
[
365,
366
],
[
366,
367
],
[
359,
368
],
[
368,
369
],
[
369,
370
],
[
356,
371
],
[
371,
372
]
] | [
"import java.util.ArrayList;\nimport java.util.Scanner;\n\nclass Main{\n public static void main(String[] args){\n \tScanner scan = new Scanner(System.in);\n \t\n \tint a;\n \tint b;\n \twhile (scan.hasNextInt()){\n \t\ta = scan.nextInt();\n \t\tb = scan.nextInt();\n \t\tint[] result = doThem(a, b);\n \t\tSystem.out.println(result[0] + \" \" + result[1]);\n \t}\n }\n \n public static int[] doThem(int a, int b){\n \tArrayList<Integer> comfac = new ArrayList<Integer>();\n\t\t\n\t\twhile (!isprime(a) || !isprime(b)){\n\t\t\t\n\t\t\tint fac;\n\t\t\tif (minfactor(a) == minfactor(b)){\n\t\t\t\tfac = minfactor(a);\n\t\t\t\ta = a / fac;\n\t\t\t\tb = b / fac;\n\t\t\t\tcomfac.add(fac);\n\t\t\t}else if(minfactor(a) < minfactor(b)){\n\t\t\t\tfac = minfactor(b);\n\t\t\t\tif(a % fac == 0){\n\t\t\t\t\ta = a / fac;\n\t\t\t\t\tb = b / fac;\n\t\t\t\t\tcomfac.add(fac);\n\t\t\t\t}else{\n\t\t\t\t\tfac = 5;\n\t\t\t\t\tif(a % fac == 0 && b % 5 == 0){\n\t\t\t\t\t\ta = a / fac;\n\t\t\t\t\t\tb = b / fac;\n\t\t\t\t\t\tcomfac.add(fac);\n\t\t\t\t\t}else{\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}else if(minfactor(a) > minfactor(b)){\n\t\t\t\tfac = minfactor(a);\n\t\t\t\tif(b % fac == 0){\n\t\t\t\t\ta = a / fac;\n\t\t\t\t\tb = b / fac;\n\t\t\t\t\tcomfac.add(fac);\n\t\t\t\t}else{\n\t\t\t\t\tfac = 5;\n\t\t\t\t\tif(a % fac == 0 && b % 5 == 0){\n\t\t\t\t\t\ta = a / fac;\n\t\t\t\t\t\tb = b / fac;\n\t\t\t\t\t\tcomfac.add(fac);\n\t\t\t\t\t}else{\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tif(a == b){\n\t\t\ta = a / a;\n\t\t\tb = b / a;\n\t\t\tcomfac.add(a);\n\t\t}\n\t\t\n\t\tint[] result = new int[2];\n\t\tresult[0] = 1; result[1] = 1;\n\t\tfor(Integer value : comfac){\n\t\t\tresult[0] = result[0] * value;\n\t\t}\n\t\tresult[1] = result[0]*a*b;\n\t\treturn result;\n }\n \n public static int minfactor(int n){\n \tif (n % 2 == 0) return 2;\n \tif (n % 3 == 0) return 3;\n \tif (n % 5 == 0) return 5;\n \t\n \tint m = 7;\n \twhile (m*m <= n){\n \t\tif (m*m == n){\n \t\t\treturn m;\n \t\t}\n \t\tm += 2;\n \t}\n \t\n \treturn n;\n }\n \n public static boolean isprime(int n){\n \tif(minfactor(n) == n){\n \t\treturn true;\n \t}else{\n \t\treturn false;\n \t}\n }\n}",
"import java.util.ArrayList;",
"ArrayList",
"java.util",
"import java.util.Scanner;",
"Scanner",
"java.util",
"class Main{\n public static void main(String[] args){\n \tScanner scan = new Scanner(System.in);\n \t\n \tint a;\n \tint b;\n \twhile (scan.hasNextInt()){\n \t\ta = scan.nextInt();\n \t\tb = scan.nextInt();\n \t\tint[] result = doThem(a, b);\n \t\tSystem.out.println(result[0] + \" \" + result[1]);\n \t}\n }\n \n public static int[] doThem(int a, int b){\n \tArrayList<Integer> comfac = new ArrayList<Integer>();\n\t\t\n\t\twhile (!isprime(a) || !isprime(b)){\n\t\t\t\n\t\t\tint fac;\n\t\t\tif (minfactor(a) == minfactor(b)){\n\t\t\t\tfac = minfactor(a);\n\t\t\t\ta = a / fac;\n\t\t\t\tb = b / fac;\n\t\t\t\tcomfac.add(fac);\n\t\t\t}else if(minfactor(a) < minfactor(b)){\n\t\t\t\tfac = minfactor(b);\n\t\t\t\tif(a % fac == 0){\n\t\t\t\t\ta = a / fac;\n\t\t\t\t\tb = b / fac;\n\t\t\t\t\tcomfac.add(fac);\n\t\t\t\t}else{\n\t\t\t\t\tfac = 5;\n\t\t\t\t\tif(a % fac == 0 && b % 5 == 0){\n\t\t\t\t\t\ta = a / fac;\n\t\t\t\t\t\tb = b / fac;\n\t\t\t\t\t\tcomfac.add(fac);\n\t\t\t\t\t}else{\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}else if(minfactor(a) > minfactor(b)){\n\t\t\t\tfac = minfactor(a);\n\t\t\t\tif(b % fac == 0){\n\t\t\t\t\ta = a / fac;\n\t\t\t\t\tb = b / fac;\n\t\t\t\t\tcomfac.add(fac);\n\t\t\t\t}else{\n\t\t\t\t\tfac = 5;\n\t\t\t\t\tif(a % fac == 0 && b % 5 == 0){\n\t\t\t\t\t\ta = a / fac;\n\t\t\t\t\t\tb = b / fac;\n\t\t\t\t\t\tcomfac.add(fac);\n\t\t\t\t\t}else{\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tif(a == b){\n\t\t\ta = a / a;\n\t\t\tb = b / a;\n\t\t\tcomfac.add(a);\n\t\t}\n\t\t\n\t\tint[] result = new int[2];\n\t\tresult[0] = 1; result[1] = 1;\n\t\tfor(Integer value : comfac){\n\t\t\tresult[0] = result[0] * value;\n\t\t}\n\t\tresult[1] = result[0]*a*b;\n\t\treturn result;\n }\n \n public static int minfactor(int n){\n \tif (n % 2 == 0) return 2;\n \tif (n % 3 == 0) return 3;\n \tif (n % 5 == 0) return 5;\n \t\n \tint m = 7;\n \twhile (m*m <= n){\n \t\tif (m*m == n){\n \t\t\treturn m;\n \t\t}\n \t\tm += 2;\n \t}\n \t\n \treturn n;\n }\n \n public static boolean isprime(int n){\n \tif(minfactor(n) == n){\n \t\treturn true;\n \t}else{\n \t\treturn false;\n \t}\n }\n}",
"Main",
"public static void main(String[] args){\n \tScanner scan = new Scanner(System.in);\n \t\n \tint a;\n \tint b;\n \twhile (scan.hasNextInt()){\n \t\ta = scan.nextInt();\n \t\tb = scan.nextInt();\n \t\tint[] result = doThem(a, b);\n \t\tSystem.out.println(result[0] + \" \" + result[1]);\n \t}\n }",
"main",
"{\n \tScanner scan = new Scanner(System.in);\n \t\n \tint a;\n \tint b;\n \twhile (scan.hasNextInt()){\n \t\ta = scan.nextInt();\n \t\tb = scan.nextInt();\n \t\tint[] result = doThem(a, b);\n \t\tSystem.out.println(result[0] + \" \" + result[1]);\n \t}\n }",
"Scanner scan = new Scanner(System.in);",
"scan",
"new Scanner(System.in)",
"int a;",
"a",
"int b;",
"b",
"while (scan.hasNextInt()){\n \t\ta = scan.nextInt();\n \t\tb = scan.nextInt();\n \t\tint[] result = doThem(a, b);\n \t\tSystem.out.println(result[0] + \" \" + result[1]);\n \t}",
"scan.hasNextInt()",
"scan.hasNextInt",
"scan",
"{\n \t\ta = scan.nextInt();\n \t\tb = scan.nextInt();\n \t\tint[] result = doThem(a, b);\n \t\tSystem.out.println(result[0] + \" \" + result[1]);\n \t}",
"a = scan.nextInt()",
"a",
"scan.nextInt()",
"scan.nextInt",
"scan",
"b = scan.nextInt()",
"b",
"scan.nextInt()",
"scan.nextInt",
"scan",
"int[] result = doThem(a, b);",
"result",
"doThem(a, b)",
"doThem",
"a",
"b",
"System.out.println(result[0] + \" \" + result[1])",
"System.out.println",
"System.out",
"System",
"System.out",
"result[0] + \" \" + result[1]",
"result[0] + \" \" + result[1]",
"result[0]",
"result",
"0",
"\" \"",
"result[1]",
"result",
"1",
"String[] args",
"args",
"public static int[] doThem(int a, int b){\n \tArrayList<Integer> comfac = new ArrayList<Integer>();\n\t\t\n\t\twhile (!isprime(a) || !isprime(b)){\n\t\t\t\n\t\t\tint fac;\n\t\t\tif (minfactor(a) == minfactor(b)){\n\t\t\t\tfac = minfactor(a);\n\t\t\t\ta = a / fac;\n\t\t\t\tb = b / fac;\n\t\t\t\tcomfac.add(fac);\n\t\t\t}else if(minfactor(a) < minfactor(b)){\n\t\t\t\tfac = minfactor(b);\n\t\t\t\tif(a % fac == 0){\n\t\t\t\t\ta = a / fac;\n\t\t\t\t\tb = b / fac;\n\t\t\t\t\tcomfac.add(fac);\n\t\t\t\t}else{\n\t\t\t\t\tfac = 5;\n\t\t\t\t\tif(a % fac == 0 && b % 5 == 0){\n\t\t\t\t\t\ta = a / fac;\n\t\t\t\t\t\tb = b / fac;\n\t\t\t\t\t\tcomfac.add(fac);\n\t\t\t\t\t}else{\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}else if(minfactor(a) > minfactor(b)){\n\t\t\t\tfac = minfactor(a);\n\t\t\t\tif(b % fac == 0){\n\t\t\t\t\ta = a / fac;\n\t\t\t\t\tb = b / fac;\n\t\t\t\t\tcomfac.add(fac);\n\t\t\t\t}else{\n\t\t\t\t\tfac = 5;\n\t\t\t\t\tif(a % fac == 0 && b % 5 == 0){\n\t\t\t\t\t\ta = a / fac;\n\t\t\t\t\t\tb = b / fac;\n\t\t\t\t\t\tcomfac.add(fac);\n\t\t\t\t\t}else{\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tif(a == b){\n\t\t\ta = a / a;\n\t\t\tb = b / a;\n\t\t\tcomfac.add(a);\n\t\t}\n\t\t\n\t\tint[] result = new int[2];\n\t\tresult[0] = 1; result[1] = 1;\n\t\tfor(Integer value : comfac){\n\t\t\tresult[0] = result[0] * value;\n\t\t}\n\t\tresult[1] = result[0]*a*b;\n\t\treturn result;\n }",
"doThem",
"{\n \tArrayList<Integer> comfac = new ArrayList<Integer>();\n\t\t\n\t\twhile (!isprime(a) || !isprime(b)){\n\t\t\t\n\t\t\tint fac;\n\t\t\tif (minfactor(a) == minfactor(b)){\n\t\t\t\tfac = minfactor(a);\n\t\t\t\ta = a / fac;\n\t\t\t\tb = b / fac;\n\t\t\t\tcomfac.add(fac);\n\t\t\t}else if(minfactor(a) < minfactor(b)){\n\t\t\t\tfac = minfactor(b);\n\t\t\t\tif(a % fac == 0){\n\t\t\t\t\ta = a / fac;\n\t\t\t\t\tb = b / fac;\n\t\t\t\t\tcomfac.add(fac);\n\t\t\t\t}else{\n\t\t\t\t\tfac = 5;\n\t\t\t\t\tif(a % fac == 0 && b % 5 == 0){\n\t\t\t\t\t\ta = a / fac;\n\t\t\t\t\t\tb = b / fac;\n\t\t\t\t\t\tcomfac.add(fac);\n\t\t\t\t\t}else{\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}else if(minfactor(a) > minfactor(b)){\n\t\t\t\tfac = minfactor(a);\n\t\t\t\tif(b % fac == 0){\n\t\t\t\t\ta = a / fac;\n\t\t\t\t\tb = b / fac;\n\t\t\t\t\tcomfac.add(fac);\n\t\t\t\t}else{\n\t\t\t\t\tfac = 5;\n\t\t\t\t\tif(a % fac == 0 && b % 5 == 0){\n\t\t\t\t\t\ta = a / fac;\n\t\t\t\t\t\tb = b / fac;\n\t\t\t\t\t\tcomfac.add(fac);\n\t\t\t\t\t}else{\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tif(a == b){\n\t\t\ta = a / a;\n\t\t\tb = b / a;\n\t\t\tcomfac.add(a);\n\t\t}\n\t\t\n\t\tint[] result = new int[2];\n\t\tresult[0] = 1; result[1] = 1;\n\t\tfor(Integer value : comfac){\n\t\t\tresult[0] = result[0] * value;\n\t\t}\n\t\tresult[1] = result[0]*a*b;\n\t\treturn result;\n }",
"ArrayList<Integer> comfac = new ArrayList<Integer>();",
"comfac",
"new ArrayList<Integer>()",
"while (!isprime(a) || !isprime(b)){\n\t\t\t\n\t\t\tint fac;\n\t\t\tif (minfactor(a) == minfactor(b)){\n\t\t\t\tfac = minfactor(a);\n\t\t\t\ta = a / fac;\n\t\t\t\tb = b / fac;\n\t\t\t\tcomfac.add(fac);\n\t\t\t}else if(minfactor(a) < minfactor(b)){\n\t\t\t\tfac = minfactor(b);\n\t\t\t\tif(a % fac == 0){\n\t\t\t\t\ta = a / fac;\n\t\t\t\t\tb = b / fac;\n\t\t\t\t\tcomfac.add(fac);\n\t\t\t\t}else{\n\t\t\t\t\tfac = 5;\n\t\t\t\t\tif(a % fac == 0 && b % 5 == 0){\n\t\t\t\t\t\ta = a / fac;\n\t\t\t\t\t\tb = b / fac;\n\t\t\t\t\t\tcomfac.add(fac);\n\t\t\t\t\t}else{\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}else if(minfactor(a) > minfactor(b)){\n\t\t\t\tfac = minfactor(a);\n\t\t\t\tif(b % fac == 0){\n\t\t\t\t\ta = a / fac;\n\t\t\t\t\tb = b / fac;\n\t\t\t\t\tcomfac.add(fac);\n\t\t\t\t}else{\n\t\t\t\t\tfac = 5;\n\t\t\t\t\tif(a % fac == 0 && b % 5 == 0){\n\t\t\t\t\t\ta = a / fac;\n\t\t\t\t\t\tb = b / fac;\n\t\t\t\t\t\tcomfac.add(fac);\n\t\t\t\t\t}else{\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"!isprime(a) || !isprime(b)",
"!isprime(a)",
"isprime(a)",
"isprime",
"a",
"!isprime(b)",
"isprime(b)",
"isprime",
"b",
"{\n\t\t\t\n\t\t\tint fac;\n\t\t\tif (minfactor(a) == minfactor(b)){\n\t\t\t\tfac = minfactor(a);\n\t\t\t\ta = a / fac;\n\t\t\t\tb = b / fac;\n\t\t\t\tcomfac.add(fac);\n\t\t\t}else if(minfactor(a) < minfactor(b)){\n\t\t\t\tfac = minfactor(b);\n\t\t\t\tif(a % fac == 0){\n\t\t\t\t\ta = a / fac;\n\t\t\t\t\tb = b / fac;\n\t\t\t\t\tcomfac.add(fac);\n\t\t\t\t}else{\n\t\t\t\t\tfac = 5;\n\t\t\t\t\tif(a % fac == 0 && b % 5 == 0){\n\t\t\t\t\t\ta = a / fac;\n\t\t\t\t\t\tb = b / fac;\n\t\t\t\t\t\tcomfac.add(fac);\n\t\t\t\t\t}else{\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}else if(minfactor(a) > minfactor(b)){\n\t\t\t\tfac = minfactor(a);\n\t\t\t\tif(b % fac == 0){\n\t\t\t\t\ta = a / fac;\n\t\t\t\t\tb = b / fac;\n\t\t\t\t\tcomfac.add(fac);\n\t\t\t\t}else{\n\t\t\t\t\tfac = 5;\n\t\t\t\t\tif(a % fac == 0 && b % 5 == 0){\n\t\t\t\t\t\ta = a / fac;\n\t\t\t\t\t\tb = b / fac;\n\t\t\t\t\t\tcomfac.add(fac);\n\t\t\t\t\t}else{\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"int fac;",
"fac",
"if (minfactor(a) == minfactor(b)){\n\t\t\t\tfac = minfactor(a);\n\t\t\t\ta = a / fac;\n\t\t\t\tb = b / fac;\n\t\t\t\tcomfac.add(fac);\n\t\t\t}else if(minfactor(a) < minfactor(b)){\n\t\t\t\tfac = minfactor(b);\n\t\t\t\tif(a % fac == 0){\n\t\t\t\t\ta = a / fac;\n\t\t\t\t\tb = b / fac;\n\t\t\t\t\tcomfac.add(fac);\n\t\t\t\t}else{\n\t\t\t\t\tfac = 5;\n\t\t\t\t\tif(a % fac == 0 && b % 5 == 0){\n\t\t\t\t\t\ta = a / fac;\n\t\t\t\t\t\tb = b / fac;\n\t\t\t\t\t\tcomfac.add(fac);\n\t\t\t\t\t}else{\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}else if(minfactor(a) > minfactor(b)){\n\t\t\t\tfac = minfactor(a);\n\t\t\t\tif(b % fac == 0){\n\t\t\t\t\ta = a / fac;\n\t\t\t\t\tb = b / fac;\n\t\t\t\t\tcomfac.add(fac);\n\t\t\t\t}else{\n\t\t\t\t\tfac = 5;\n\t\t\t\t\tif(a % fac == 0 && b % 5 == 0){\n\t\t\t\t\t\ta = a / fac;\n\t\t\t\t\t\tb = b / fac;\n\t\t\t\t\t\tcomfac.add(fac);\n\t\t\t\t\t}else{\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}",
"minfactor(a) == minfactor(b)",
"minfactor(a)",
"minfactor",
"a",
"minfactor(b)",
"minfactor",
"b",
"{\n\t\t\t\tfac = minfactor(a);\n\t\t\t\ta = a / fac;\n\t\t\t\tb = b / fac;\n\t\t\t\tcomfac.add(fac);\n\t\t\t}",
"fac = minfactor(a)",
"fac",
"minfactor(a)",
"minfactor",
"a",
"a = a / fac",
"a",
"a / fac",
"a",
"fac",
"b = b / fac",
"b",
"b / fac",
"b",
"fac",
"comfac.add(fac)",
"comfac.add",
"comfac",
"fac",
"if(minfactor(a) < minfactor(b)){\n\t\t\t\tfac = minfactor(b);\n\t\t\t\tif(a % fac == 0){\n\t\t\t\t\ta = a / fac;\n\t\t\t\t\tb = b / fac;\n\t\t\t\t\tcomfac.add(fac);\n\t\t\t\t}else{\n\t\t\t\t\tfac = 5;\n\t\t\t\t\tif(a % fac == 0 && b % 5 == 0){\n\t\t\t\t\t\ta = a / fac;\n\t\t\t\t\t\tb = b / fac;\n\t\t\t\t\t\tcomfac.add(fac);\n\t\t\t\t\t}else{\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}else if(minfactor(a) > minfactor(b)){\n\t\t\t\tfac = minfactor(a);\n\t\t\t\tif(b % fac == 0){\n\t\t\t\t\ta = a / fac;\n\t\t\t\t\tb = b / fac;\n\t\t\t\t\tcomfac.add(fac);\n\t\t\t\t}else{\n\t\t\t\t\tfac = 5;\n\t\t\t\t\tif(a % fac == 0 && b % 5 == 0){\n\t\t\t\t\t\ta = a / fac;\n\t\t\t\t\t\tb = b / fac;\n\t\t\t\t\t\tcomfac.add(fac);\n\t\t\t\t\t}else{\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}",
"minfactor(a) < minfactor(b)",
"minfactor(a)",
"minfactor",
"a",
"minfactor(b)",
"minfactor",
"b",
"{\n\t\t\t\tfac = minfactor(b);\n\t\t\t\tif(a % fac == 0){\n\t\t\t\t\ta = a / fac;\n\t\t\t\t\tb = b / fac;\n\t\t\t\t\tcomfac.add(fac);\n\t\t\t\t}else{\n\t\t\t\t\tfac = 5;\n\t\t\t\t\tif(a % fac == 0 && b % 5 == 0){\n\t\t\t\t\t\ta = a / fac;\n\t\t\t\t\t\tb = b / fac;\n\t\t\t\t\t\tcomfac.add(fac);\n\t\t\t\t\t}else{\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}",
"fac = minfactor(b)",
"fac",
"minfactor(b)",
"minfactor",
"b",
"if(a % fac == 0){\n\t\t\t\t\ta = a / fac;\n\t\t\t\t\tb = b / fac;\n\t\t\t\t\tcomfac.add(fac);\n\t\t\t\t}else{\n\t\t\t\t\tfac = 5;\n\t\t\t\t\tif(a % fac == 0 && b % 5 == 0){\n\t\t\t\t\t\ta = a / fac;\n\t\t\t\t\t\tb = b / fac;\n\t\t\t\t\t\tcomfac.add(fac);\n\t\t\t\t\t}else{\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}",
"a % fac == 0",
"a % fac",
"a",
"fac",
"0",
"{\n\t\t\t\t\ta = a / fac;\n\t\t\t\t\tb = b / fac;\n\t\t\t\t\tcomfac.add(fac);\n\t\t\t\t}",
"a = a / fac",
"a",
"a / fac",
"a",
"fac",
"b = b / fac",
"b",
"b / fac",
"b",
"fac",
"comfac.add(fac)",
"comfac.add",
"comfac",
"fac",
"{\n\t\t\t\t\tfac = 5;\n\t\t\t\t\tif(a % fac == 0 && b % 5 == 0){\n\t\t\t\t\t\ta = a / fac;\n\t\t\t\t\t\tb = b / fac;\n\t\t\t\t\t\tcomfac.add(fac);\n\t\t\t\t\t}else{\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}",
"fac = 5",
"fac",
"5",
"if(a % fac == 0 && b % 5 == 0){\n\t\t\t\t\t\ta = a / fac;\n\t\t\t\t\t\tb = b / fac;\n\t\t\t\t\t\tcomfac.add(fac);\n\t\t\t\t\t}else{\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}",
"a % fac == 0 && b % 5 == 0",
"a % fac == 0",
"a % fac",
"a",
"fac",
"0",
"b % 5 == 0",
"b % 5",
"b",
"5",
"0",
"{\n\t\t\t\t\t\ta = a / fac;\n\t\t\t\t\t\tb = b / fac;\n\t\t\t\t\t\tcomfac.add(fac);\n\t\t\t\t\t}",
"a = a / fac",
"a",
"a / fac",
"a",
"fac",
"b = b / fac",
"b",
"b / fac",
"b",
"fac",
"comfac.add(fac)",
"comfac.add",
"comfac",
"fac",
"{\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}",
"break;",
"if(minfactor(a) > minfactor(b)){\n\t\t\t\tfac = minfactor(a);\n\t\t\t\tif(b % fac == 0){\n\t\t\t\t\ta = a / fac;\n\t\t\t\t\tb = b / fac;\n\t\t\t\t\tcomfac.add(fac);\n\t\t\t\t}else{\n\t\t\t\t\tfac = 5;\n\t\t\t\t\tif(a % fac == 0 && b % 5 == 0){\n\t\t\t\t\t\ta = a / fac;\n\t\t\t\t\t\tb = b / fac;\n\t\t\t\t\t\tcomfac.add(fac);\n\t\t\t\t\t}else{\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}",
"minfactor(a) > minfactor(b)",
"minfactor(a)",
"minfactor",
"a",
"minfactor(b)",
"minfactor",
"b",
"{\n\t\t\t\tfac = minfactor(a);\n\t\t\t\tif(b % fac == 0){\n\t\t\t\t\ta = a / fac;\n\t\t\t\t\tb = b / fac;\n\t\t\t\t\tcomfac.add(fac);\n\t\t\t\t}else{\n\t\t\t\t\tfac = 5;\n\t\t\t\t\tif(a % fac == 0 && b % 5 == 0){\n\t\t\t\t\t\ta = a / fac;\n\t\t\t\t\t\tb = b / fac;\n\t\t\t\t\t\tcomfac.add(fac);\n\t\t\t\t\t}else{\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}",
"fac = minfactor(a)",
"fac",
"minfactor(a)",
"minfactor",
"a",
"if(b % fac == 0){\n\t\t\t\t\ta = a / fac;\n\t\t\t\t\tb = b / fac;\n\t\t\t\t\tcomfac.add(fac);\n\t\t\t\t}else{\n\t\t\t\t\tfac = 5;\n\t\t\t\t\tif(a % fac == 0 && b % 5 == 0){\n\t\t\t\t\t\ta = a / fac;\n\t\t\t\t\t\tb = b / fac;\n\t\t\t\t\t\tcomfac.add(fac);\n\t\t\t\t\t}else{\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}",
"b % fac == 0",
"b % fac",
"b",
"fac",
"0",
"{\n\t\t\t\t\ta = a / fac;\n\t\t\t\t\tb = b / fac;\n\t\t\t\t\tcomfac.add(fac);\n\t\t\t\t}",
"a = a / fac",
"a",
"a / fac",
"a",
"fac",
"b = b / fac",
"b",
"b / fac",
"b",
"fac",
"comfac.add(fac)",
"comfac.add",
"comfac",
"fac",
"{\n\t\t\t\t\tfac = 5;\n\t\t\t\t\tif(a % fac == 0 && b % 5 == 0){\n\t\t\t\t\t\ta = a / fac;\n\t\t\t\t\t\tb = b / fac;\n\t\t\t\t\t\tcomfac.add(fac);\n\t\t\t\t\t}else{\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}",
"fac = 5",
"fac",
"5",
"if(a % fac == 0 && b % 5 == 0){\n\t\t\t\t\t\ta = a / fac;\n\t\t\t\t\t\tb = b / fac;\n\t\t\t\t\t\tcomfac.add(fac);\n\t\t\t\t\t}else{\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}",
"a % fac == 0 && b % 5 == 0",
"a % fac == 0",
"a % fac",
"a",
"fac",
"0",
"b % 5 == 0",
"b % 5",
"b",
"5",
"0",
"{\n\t\t\t\t\t\ta = a / fac;\n\t\t\t\t\t\tb = b / fac;\n\t\t\t\t\t\tcomfac.add(fac);\n\t\t\t\t\t}",
"a = a / fac",
"a",
"a / fac",
"a",
"fac",
"b = b / fac",
"b",
"b / fac",
"b",
"fac",
"comfac.add(fac)",
"comfac.add",
"comfac",
"fac",
"{\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}",
"break;",
"if(a == b){\n\t\t\ta = a / a;\n\t\t\tb = b / a;\n\t\t\tcomfac.add(a);\n\t\t}",
"a == b",
"a",
"b",
"{\n\t\t\ta = a / a;\n\t\t\tb = b / a;\n\t\t\tcomfac.add(a);\n\t\t}",
"a = a / a",
"a",
"a / a",
"a",
"a",
"b = b / a",
"b",
"b / a",
"b",
"a",
"comfac.add(a)",
"comfac.add",
"comfac",
"a",
"int[] result = new int[2];",
"result",
"new int[2]",
"2",
"result[0] = 1",
"result[0]",
"result",
"0",
"1",
"result[1] = 1",
"result[1]",
"result",
"1",
"1",
"for(Integer value : comfac){\n\t\t\tresult[0] = result[0] * value;\n\t\t}",
"Integer value",
"comfac",
"{\n\t\t\tresult[0] = result[0] * value;\n\t\t}",
"{\n\t\t\tresult[0] = result[0] * value;\n\t\t}",
"result[0] = result[0] * value",
"result[0]",
"result",
"0",
"result[0] * value",
"result[0]",
"result",
"0",
"value",
"result[1] = result[0]*a*b",
"result[1]",
"result",
"1",
"result[0]*a*b",
"result[0]*a*b",
"result[0]",
"result",
"0",
"a",
"b",
"return result;",
"result",
"int a",
"a",
"int b",
"b",
"public static int minfactor(int n){\n \tif (n % 2 == 0) return 2;\n \tif (n % 3 == 0) return 3;\n \tif (n % 5 == 0) return 5;\n \t\n \tint m = 7;\n \twhile (m*m <= n){\n \t\tif (m*m == n){\n \t\t\treturn m;\n \t\t}\n \t\tm += 2;\n \t}\n \t\n \treturn n;\n }",
"minfactor",
"{\n \tif (n % 2 == 0) return 2;\n \tif (n % 3 == 0) return 3;\n \tif (n % 5 == 0) return 5;\n \t\n \tint m = 7;\n \twhile (m*m <= n){\n \t\tif (m*m == n){\n \t\t\treturn m;\n \t\t}\n \t\tm += 2;\n \t}\n \t\n \treturn n;\n }",
"if (n % 2 == 0) return 2;",
"n % 2 == 0",
"n % 2",
"n",
"2",
"0",
"return 2;",
"2",
"if (n % 3 == 0) return 3;",
"n % 3 == 0",
"n % 3",
"n",
"3",
"0",
"return 3;",
"3",
"if (n % 5 == 0) return 5;",
"n % 5 == 0",
"n % 5",
"n",
"5",
"0",
"return 5;",
"5",
"int m = 7;",
"m",
"7",
"while (m*m <= n){\n \t\tif (m*m == n){\n \t\t\treturn m;\n \t\t}\n \t\tm += 2;\n \t}",
"m*m <= n",
"m*m",
"m",
"m",
"n",
"{\n \t\tif (m*m == n){\n \t\t\treturn m;\n \t\t}\n \t\tm += 2;\n \t}",
"if (m*m == n){\n \t\t\treturn m;\n \t\t}",
"m*m == n",
"m*m",
"m",
"m",
"n",
"{\n \t\t\treturn m;\n \t\t}",
"return m;",
"m",
"m += 2",
"m",
"2",
"return n;",
"n",
"int n",
"n",
"public static boolean isprime(int n){\n \tif(minfactor(n) == n){\n \t\treturn true;\n \t}else{\n \t\treturn false;\n \t}\n }",
"isprime",
"{\n \tif(minfactor(n) == n){\n \t\treturn true;\n \t}else{\n \t\treturn false;\n \t}\n }",
"if(minfactor(n) == n){\n \t\treturn true;\n \t}else{\n \t\treturn false;\n \t}",
"minfactor(n) == n",
"minfactor(n)",
"minfactor",
"n",
"n",
"{\n \t\treturn true;\n \t}",
"return true;",
"true",
"{\n \t\treturn false;\n \t}",
"return false;",
"false",
"int n",
"n"
] | import java.util.ArrayList;
import java.util.Scanner;
class Main{
public static void main(String[] args){
Scanner scan = new Scanner(System.in);
int a;
int b;
while (scan.hasNextInt()){
a = scan.nextInt();
b = scan.nextInt();
int[] result = doThem(a, b);
System.out.println(result[0] + " " + result[1]);
}
}
public static int[] doThem(int a, int b){
ArrayList<Integer> comfac = new ArrayList<Integer>();
while (!isprime(a) || !isprime(b)){
int fac;
if (minfactor(a) == minfactor(b)){
fac = minfactor(a);
a = a / fac;
b = b / fac;
comfac.add(fac);
}else if(minfactor(a) < minfactor(b)){
fac = minfactor(b);
if(a % fac == 0){
a = a / fac;
b = b / fac;
comfac.add(fac);
}else{
fac = 5;
if(a % fac == 0 && b % 5 == 0){
a = a / fac;
b = b / fac;
comfac.add(fac);
}else{
break;
}
}
}else if(minfactor(a) > minfactor(b)){
fac = minfactor(a);
if(b % fac == 0){
a = a / fac;
b = b / fac;
comfac.add(fac);
}else{
fac = 5;
if(a % fac == 0 && b % 5 == 0){
a = a / fac;
b = b / fac;
comfac.add(fac);
}else{
break;
}
}
}
}
if(a == b){
a = a / a;
b = b / a;
comfac.add(a);
}
int[] result = new int[2];
result[0] = 1; result[1] = 1;
for(Integer value : comfac){
result[0] = result[0] * value;
}
result[1] = result[0]*a*b;
return result;
}
public static int minfactor(int n){
if (n % 2 == 0) return 2;
if (n % 3 == 0) return 3;
if (n % 5 == 0) return 5;
int m = 7;
while (m*m <= n){
if (m*m == n){
return m;
}
m += 2;
}
return n;
}
public static boolean isprime(int n){
if(minfactor(n) == n){
return true;
}else{
return false;
}
}
} |
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
20,
41,
13,
20,
42,
4,
18,
13,
30,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
14,
2,
13,
13,
30,
41,
13,
13,
0,
13,
13,
0,
13,
13,
41,
13,
13,
41,
13,
13,
42,
2,
13,
17,
30,
41,
13,
13,
0,
13,
2,
13,
13,
0,
13,
13,
4,
18,
13,
13,
4,
18,
13,
2,
2,
13,
13,
13,
41,
13,
4,
18,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
4,
18,
18,
13,
13,
2,
2,
4,
18,
13,
17,
4,
18,
13,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
116,
5
],
[
116,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
8,
15
],
[
15,
16
],
[
15,
17
],
[
8,
18
],
[
18,
19
],
[
19,
20
],
[
20,
21
],
[
18,
22
],
[
22,
23
],
[
23,
24
],
[
23,
25
],
[
25,
26
],
[
26,
27
],
[
22,
28
],
[
28,
29
],
[
28,
30
],
[
30,
31
],
[
31,
32
],
[
22,
33
],
[
33,
34
],
[
34,
35
],
[
34,
36
],
[
33,
37
],
[
37,
38
],
[
38,
39
],
[
38,
40
],
[
37,
41
],
[
41,
42
],
[
41,
43
],
[
37,
44
],
[
44,
45
],
[
44,
46
],
[
22,
47
],
[
47,
48
],
[
47,
49
],
[
22,
50
],
[
50,
51
],
[
50,
52
],
[
22,
53
],
[
53,
54
],
[
54,
55
],
[
54,
56
],
[
53,
57
],
[
57,
58
],
[
58,
59
],
[
58,
60
],
[
57,
61
],
[
61,
62
],
[
61,
63
],
[
63,
64
],
[
63,
65
],
[
57,
66
],
[
66,
67
],
[
66,
68
],
[
22,
69
],
[
69,
70
],
[
70,
71
],
[
69,
72
],
[
22,
73
],
[
73,
74
],
[
74,
75
],
[
73,
76
],
[
76,
77
],
[
77,
78
],
[
77,
79
],
[
76,
80
],
[
8,
81
],
[
81,
82
],
[
81,
83
],
[
83,
84
],
[
84,
85
],
[
8,
86
],
[
86,
87
],
[
87,
88
],
[
88,
89
],
[
88,
90
],
[
86,
91
],
[
91,
92
],
[
91,
93
],
[
86,
94
],
[
94,
95
],
[
95,
96
],
[
86,
97
],
[
98,
98
],
[
98,
99
],
[
99,
100
],
[
100,
101
],
[
101,
102
],
[
101,
103
],
[
99,
104
],
[
105,
105
],
[
105,
106
],
[
106,
107
],
[
107,
108
],
[
105,
109
],
[
105,
110
],
[
110,
111
],
[
111,
112
],
[
6,
113
],
[
113,
114
],
[
0,
115
],
[
115,
116
],
[
115,
117
]
] | [
"import java.util.*;\n\npublic class Main {\n\n\tpublic static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\tArrayDeque<Integer> ansA = new ArrayDeque<Integer>();\n\t\tArrayDeque<Integer> ansB = new ArrayDeque<Integer>();\n\n\t\twhile(sc.hasNext()){\n\t\t\tint m = sc.nextInt();\n\t\t\tint n = sc.nextInt();\n\t\t\tif(n>m){\n\t\t\t\tint l = m;\n\t\t\t\tm=n;\n\t\t\t\tn=l;\n\t\t\t}\n\t\t\tint a = m;\n\t\t\tint b = n;\t\t\t\n\t\t\twhile(n!=0){\n\t\t\t\tint l = n;\n\t\t\t\tn = m%n;\n\t\t\t\tm = l;\n\t\t\t}\n\t\t\tansA.push(m);\n\t\t\tansB.push((a/m)*b);\n\t\t}\n\t\tint num = ansA.size();\n\t\tfor(int i=0;i<num;i++){\n\t\t\tSystem.out.println(ansA.pollLast() + \" \" + ansB.pollLast());\n\t\t}\n\t}\n}",
"import java.util.*;",
"util.*",
"java",
"public class Main {\n\n\tpublic static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\tArrayDeque<Integer> ansA = new ArrayDeque<Integer>();\n\t\tArrayDeque<Integer> ansB = new ArrayDeque<Integer>();\n\n\t\twhile(sc.hasNext()){\n\t\t\tint m = sc.nextInt();\n\t\t\tint n = sc.nextInt();\n\t\t\tif(n>m){\n\t\t\t\tint l = m;\n\t\t\t\tm=n;\n\t\t\t\tn=l;\n\t\t\t}\n\t\t\tint a = m;\n\t\t\tint b = n;\t\t\t\n\t\t\twhile(n!=0){\n\t\t\t\tint l = n;\n\t\t\t\tn = m%n;\n\t\t\t\tm = l;\n\t\t\t}\n\t\t\tansA.push(m);\n\t\t\tansB.push((a/m)*b);\n\t\t}\n\t\tint num = ansA.size();\n\t\tfor(int i=0;i<num;i++){\n\t\t\tSystem.out.println(ansA.pollLast() + \" \" + ansB.pollLast());\n\t\t}\n\t}\n}",
"Main",
"public static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\tArrayDeque<Integer> ansA = new ArrayDeque<Integer>();\n\t\tArrayDeque<Integer> ansB = new ArrayDeque<Integer>();\n\n\t\twhile(sc.hasNext()){\n\t\t\tint m = sc.nextInt();\n\t\t\tint n = sc.nextInt();\n\t\t\tif(n>m){\n\t\t\t\tint l = m;\n\t\t\t\tm=n;\n\t\t\t\tn=l;\n\t\t\t}\n\t\t\tint a = m;\n\t\t\tint b = n;\t\t\t\n\t\t\twhile(n!=0){\n\t\t\t\tint l = n;\n\t\t\t\tn = m%n;\n\t\t\t\tm = l;\n\t\t\t}\n\t\t\tansA.push(m);\n\t\t\tansB.push((a/m)*b);\n\t\t}\n\t\tint num = ansA.size();\n\t\tfor(int i=0;i<num;i++){\n\t\t\tSystem.out.println(ansA.pollLast() + \" \" + ansB.pollLast());\n\t\t}\n\t}",
"main",
"{\n\t\tScanner sc = new Scanner(System.in);\n\t\tArrayDeque<Integer> ansA = new ArrayDeque<Integer>();\n\t\tArrayDeque<Integer> ansB = new ArrayDeque<Integer>();\n\n\t\twhile(sc.hasNext()){\n\t\t\tint m = sc.nextInt();\n\t\t\tint n = sc.nextInt();\n\t\t\tif(n>m){\n\t\t\t\tint l = m;\n\t\t\t\tm=n;\n\t\t\t\tn=l;\n\t\t\t}\n\t\t\tint a = m;\n\t\t\tint b = n;\t\t\t\n\t\t\twhile(n!=0){\n\t\t\t\tint l = n;\n\t\t\t\tn = m%n;\n\t\t\t\tm = l;\n\t\t\t}\n\t\t\tansA.push(m);\n\t\t\tansB.push((a/m)*b);\n\t\t}\n\t\tint num = ansA.size();\n\t\tfor(int i=0;i<num;i++){\n\t\t\tSystem.out.println(ansA.pollLast() + \" \" + ansB.pollLast());\n\t\t}\n\t}",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"ArrayDeque<Integer> ansA = new ArrayDeque<Integer>();",
"ansA",
"new ArrayDeque<Integer>()",
"ArrayDeque<Integer> ansB = new ArrayDeque<Integer>();",
"ansB",
"new ArrayDeque<Integer>()",
"while(sc.hasNext()){\n\t\t\tint m = sc.nextInt();\n\t\t\tint n = sc.nextInt();\n\t\t\tif(n>m){\n\t\t\t\tint l = m;\n\t\t\t\tm=n;\n\t\t\t\tn=l;\n\t\t\t}\n\t\t\tint a = m;\n\t\t\tint b = n;\t\t\t\n\t\t\twhile(n!=0){\n\t\t\t\tint l = n;\n\t\t\t\tn = m%n;\n\t\t\t\tm = l;\n\t\t\t}\n\t\t\tansA.push(m);\n\t\t\tansB.push((a/m)*b);\n\t\t}",
"sc.hasNext()",
"sc.hasNext",
"sc",
"{\n\t\t\tint m = sc.nextInt();\n\t\t\tint n = sc.nextInt();\n\t\t\tif(n>m){\n\t\t\t\tint l = m;\n\t\t\t\tm=n;\n\t\t\t\tn=l;\n\t\t\t}\n\t\t\tint a = m;\n\t\t\tint b = n;\t\t\t\n\t\t\twhile(n!=0){\n\t\t\t\tint l = n;\n\t\t\t\tn = m%n;\n\t\t\t\tm = l;\n\t\t\t}\n\t\t\tansA.push(m);\n\t\t\tansB.push((a/m)*b);\n\t\t}",
"int m = sc.nextInt();",
"m",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int n = sc.nextInt();",
"n",
"sc.nextInt()",
"sc.nextInt",
"sc",
"if(n>m){\n\t\t\t\tint l = m;\n\t\t\t\tm=n;\n\t\t\t\tn=l;\n\t\t\t}",
"n>m",
"n",
"m",
"{\n\t\t\t\tint l = m;\n\t\t\t\tm=n;\n\t\t\t\tn=l;\n\t\t\t}",
"int l = m;",
"l",
"m",
"m=n",
"m",
"n",
"n=l",
"n",
"l",
"int a = m;",
"a",
"m",
"int b = n;",
"b",
"n",
"while(n!=0){\n\t\t\t\tint l = n;\n\t\t\t\tn = m%n;\n\t\t\t\tm = l;\n\t\t\t}",
"n!=0",
"n",
"0",
"{\n\t\t\t\tint l = n;\n\t\t\t\tn = m%n;\n\t\t\t\tm = l;\n\t\t\t}",
"int l = n;",
"l",
"n",
"n = m%n",
"n",
"m%n",
"m",
"n",
"m = l",
"m",
"l",
"ansA.push(m)",
"ansA.push",
"ansA",
"m",
"ansB.push((a/m)*b)",
"ansB.push",
"ansB",
"(a/m)*b",
"(a/m)",
"a",
"m",
"b",
"int num = ansA.size();",
"num",
"ansA.size()",
"ansA.size",
"ansA",
"for(int i=0;i<num;i++){\n\t\t\tSystem.out.println(ansA.pollLast() + \" \" + ansB.pollLast());\n\t\t}",
"int i=0;",
"int i=0;",
"i",
"0",
"i<num",
"i",
"num",
"i++",
"i++",
"i",
"{\n\t\t\tSystem.out.println(ansA.pollLast() + \" \" + ansB.pollLast());\n\t\t}",
"{\n\t\t\tSystem.out.println(ansA.pollLast() + \" \" + ansB.pollLast());\n\t\t}",
"System.out.println(ansA.pollLast() + \" \" + ansB.pollLast())",
"System.out.println",
"System.out",
"System",
"System.out",
"ansA.pollLast() + \" \" + ansB.pollLast()",
"ansA.pollLast() + \" \" + ansB.pollLast()",
"ansA.pollLast()",
"ansA.pollLast",
"ansA",
"\" \"",
"ansB.pollLast()",
"ansB.pollLast",
"ansB",
"String[] args",
"args",
"public class Main {\n\n\tpublic static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\tArrayDeque<Integer> ansA = new ArrayDeque<Integer>();\n\t\tArrayDeque<Integer> ansB = new ArrayDeque<Integer>();\n\n\t\twhile(sc.hasNext()){\n\t\t\tint m = sc.nextInt();\n\t\t\tint n = sc.nextInt();\n\t\t\tif(n>m){\n\t\t\t\tint l = m;\n\t\t\t\tm=n;\n\t\t\t\tn=l;\n\t\t\t}\n\t\t\tint a = m;\n\t\t\tint b = n;\t\t\t\n\t\t\twhile(n!=0){\n\t\t\t\tint l = n;\n\t\t\t\tn = m%n;\n\t\t\t\tm = l;\n\t\t\t}\n\t\t\tansA.push(m);\n\t\t\tansB.push((a/m)*b);\n\t\t}\n\t\tint num = ansA.size();\n\t\tfor(int i=0;i<num;i++){\n\t\t\tSystem.out.println(ansA.pollLast() + \" \" + ansB.pollLast());\n\t\t}\n\t}\n}",
"public class Main {\n\n\tpublic static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\tArrayDeque<Integer> ansA = new ArrayDeque<Integer>();\n\t\tArrayDeque<Integer> ansB = new ArrayDeque<Integer>();\n\n\t\twhile(sc.hasNext()){\n\t\t\tint m = sc.nextInt();\n\t\t\tint n = sc.nextInt();\n\t\t\tif(n>m){\n\t\t\t\tint l = m;\n\t\t\t\tm=n;\n\t\t\t\tn=l;\n\t\t\t}\n\t\t\tint a = m;\n\t\t\tint b = n;\t\t\t\n\t\t\twhile(n!=0){\n\t\t\t\tint l = n;\n\t\t\t\tn = m%n;\n\t\t\t\tm = l;\n\t\t\t}\n\t\t\tansA.push(m);\n\t\t\tansB.push((a/m)*b);\n\t\t}\n\t\tint num = ansA.size();\n\t\tfor(int i=0;i<num;i++){\n\t\t\tSystem.out.println(ansA.pollLast() + \" \" + ansB.pollLast());\n\t\t}\n\t}\n}",
"Main"
] | import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
ArrayDeque<Integer> ansA = new ArrayDeque<Integer>();
ArrayDeque<Integer> ansB = new ArrayDeque<Integer>();
while(sc.hasNext()){
int m = sc.nextInt();
int n = sc.nextInt();
if(n>m){
int l = m;
m=n;
n=l;
}
int a = m;
int b = n;
while(n!=0){
int l = n;
n = m%n;
m = l;
}
ansA.push(m);
ansB.push((a/m)*b);
}
int num = ansA.size();
for(int i=0;i<num;i++){
System.out.println(ansA.pollLast() + " " + ansB.pollLast());
}
}
} |
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
42,
4,
18,
13,
30,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
41,
13,
13,
41,
13,
13,
42,
2,
2,
13,
13,
17,
30,
41,
13,
13,
0,
13,
13,
0,
13,
2,
13,
13,
41,
13,
13,
41,
13,
2,
2,
13,
13,
13,
4,
18,
18,
13,
13,
17,
13,
13,
4,
18,
13,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
75,
5
],
[
75,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
13,
14
],
[
14,
15
],
[
12,
16
],
[
16,
17
],
[
17,
18
],
[
17,
19
],
[
19,
20
],
[
20,
21
],
[
16,
22
],
[
22,
23
],
[
22,
24
],
[
24,
25
],
[
25,
26
],
[
16,
27
],
[
27,
28
],
[
27,
29
],
[
16,
30
],
[
30,
31
],
[
30,
32
],
[
16,
33
],
[
33,
34
],
[
34,
35
],
[
35,
36
],
[
35,
37
],
[
34,
38
],
[
33,
39
],
[
39,
40
],
[
40,
41
],
[
40,
42
],
[
39,
43
],
[
43,
44
],
[
43,
45
],
[
39,
46
],
[
46,
47
],
[
46,
48
],
[
48,
49
],
[
48,
50
],
[
16,
51
],
[
51,
52
],
[
51,
53
],
[
16,
54
],
[
54,
55
],
[
54,
56
],
[
56,
57
],
[
57,
58
],
[
57,
59
],
[
56,
60
],
[
16,
61
],
[
61,
62
],
[
62,
63
],
[
63,
64
],
[
63,
65
],
[
61,
66
],
[
61,
67
],
[
61,
68
],
[
8,
69
],
[
69,
70
],
[
70,
71
],
[
6,
72
],
[
72,
73
],
[
0,
74
],
[
74,
75
],
[
74,
76
]
] | [
"\n\nimport java.util.Scanner;\n\npublic class Main{\n\n\tpublic static void main(String[] args) {\n\t\tScanner scanner = new Scanner(System.in);\n\t\twhile(scanner.hasNext()) {\n\t\t\tlong a = scanner.nextInt();\n\t\t\tlong b = scanner.nextInt();\n\t\t\tlong m = a ;\n\t\t\tlong n = b ;\n\t\t\twhile(m % n != 0){\n\t\t\t\tlong tmp = m;\n\t\t\t\tm = n;\n\t\t\t\tn = tmp % n;\n\t\t\t}\n\t\t\t//最大公約数\n\t\t\tlong GCD = n;\n\t\t\t//最小公倍数\n\t\t\tlong LCM = a * b / GCD;\n\n\t\t\tSystem.out.printf(\"%d %d\\n\", GCD, LCM);\n\t\t}\n\t\tscanner.close();\n\t}\n\n}\n",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main{\n\n\tpublic static void main(String[] args) {\n\t\tScanner scanner = new Scanner(System.in);\n\t\twhile(scanner.hasNext()) {\n\t\t\tlong a = scanner.nextInt();\n\t\t\tlong b = scanner.nextInt();\n\t\t\tlong m = a ;\n\t\t\tlong n = b ;\n\t\t\twhile(m % n != 0){\n\t\t\t\tlong tmp = m;\n\t\t\t\tm = n;\n\t\t\t\tn = tmp % n;\n\t\t\t}\n\t\t\t//最大公約数\n\t\t\tlong GCD = n;\n\t\t\t//最小公倍数\n\t\t\tlong LCM = a * b / GCD;\n\n\t\t\tSystem.out.printf(\"%d %d\\n\", GCD, LCM);\n\t\t}\n\t\tscanner.close();\n\t}\n\n}",
"Main",
"public static void main(String[] args) {\n\t\tScanner scanner = new Scanner(System.in);\n\t\twhile(scanner.hasNext()) {\n\t\t\tlong a = scanner.nextInt();\n\t\t\tlong b = scanner.nextInt();\n\t\t\tlong m = a ;\n\t\t\tlong n = b ;\n\t\t\twhile(m % n != 0){\n\t\t\t\tlong tmp = m;\n\t\t\t\tm = n;\n\t\t\t\tn = tmp % n;\n\t\t\t}\n\t\t\t//最大公約数\n\t\t\tlong GCD = n;\n\t\t\t//最小公倍数\n\t\t\tlong LCM = a * b / GCD;\n\n\t\t\tSystem.out.printf(\"%d %d\\n\", GCD, LCM);\n\t\t}\n\t\tscanner.close();\n\t}",
"main",
"{\n\t\tScanner scanner = new Scanner(System.in);\n\t\twhile(scanner.hasNext()) {\n\t\t\tlong a = scanner.nextInt();\n\t\t\tlong b = scanner.nextInt();\n\t\t\tlong m = a ;\n\t\t\tlong n = b ;\n\t\t\twhile(m % n != 0){\n\t\t\t\tlong tmp = m;\n\t\t\t\tm = n;\n\t\t\t\tn = tmp % n;\n\t\t\t}\n\t\t\t//最大公約数\n\t\t\tlong GCD = n;\n\t\t\t//最小公倍数\n\t\t\tlong LCM = a * b / GCD;\n\n\t\t\tSystem.out.printf(\"%d %d\\n\", GCD, LCM);\n\t\t}\n\t\tscanner.close();\n\t}",
"Scanner scanner = new Scanner(System.in);",
"scanner",
"new Scanner(System.in)",
"while(scanner.hasNext()) {\n\t\t\tlong a = scanner.nextInt();\n\t\t\tlong b = scanner.nextInt();\n\t\t\tlong m = a ;\n\t\t\tlong n = b ;\n\t\t\twhile(m % n != 0){\n\t\t\t\tlong tmp = m;\n\t\t\t\tm = n;\n\t\t\t\tn = tmp % n;\n\t\t\t}\n\t\t\t//最大公約数\n\t\t\tlong GCD = n;\n\t\t\t//最小公倍数\n\t\t\tlong LCM = a * b / GCD;\n\n\t\t\tSystem.out.printf(\"%d %d\\n\", GCD, LCM);\n\t\t}",
"scanner.hasNext()",
"scanner.hasNext",
"scanner",
"{\n\t\t\tlong a = scanner.nextInt();\n\t\t\tlong b = scanner.nextInt();\n\t\t\tlong m = a ;\n\t\t\tlong n = b ;\n\t\t\twhile(m % n != 0){\n\t\t\t\tlong tmp = m;\n\t\t\t\tm = n;\n\t\t\t\tn = tmp % n;\n\t\t\t}\n\t\t\t//最大公約数\n\t\t\tlong GCD = n;\n\t\t\t//最小公倍数\n\t\t\tlong LCM = a * b / GCD;\n\n\t\t\tSystem.out.printf(\"%d %d\\n\", GCD, LCM);\n\t\t}",
"long a = scanner.nextInt();",
"a",
"scanner.nextInt()",
"scanner.nextInt",
"scanner",
"long b = scanner.nextInt();",
"b",
"scanner.nextInt()",
"scanner.nextInt",
"scanner",
"long m = a ;",
"m",
"a",
"long n = b ;",
"n",
"b",
"while(m % n != 0){\n\t\t\t\tlong tmp = m;\n\t\t\t\tm = n;\n\t\t\t\tn = tmp % n;\n\t\t\t}",
"m % n != 0",
"m % n",
"m",
"n",
"0",
"{\n\t\t\t\tlong tmp = m;\n\t\t\t\tm = n;\n\t\t\t\tn = tmp % n;\n\t\t\t}",
"long tmp = m;",
"tmp",
"m",
"m = n",
"m",
"n",
"n = tmp % n",
"n",
"tmp % n",
"tmp",
"n",
"long GCD = n;",
"GCD",
"n",
"long LCM = a * b / GCD;",
"LCM",
"a * b / GCD",
"a * b",
"a",
"b",
"GCD",
"System.out.printf(\"%d %d\\n\", GCD, LCM)",
"System.out.printf",
"System.out",
"System",
"System.out",
"\"%d %d\\n\"",
"GCD",
"LCM",
"scanner.close()",
"scanner.close",
"scanner",
"String[] args",
"args",
"public class Main{\n\n\tpublic static void main(String[] args) {\n\t\tScanner scanner = new Scanner(System.in);\n\t\twhile(scanner.hasNext()) {\n\t\t\tlong a = scanner.nextInt();\n\t\t\tlong b = scanner.nextInt();\n\t\t\tlong m = a ;\n\t\t\tlong n = b ;\n\t\t\twhile(m % n != 0){\n\t\t\t\tlong tmp = m;\n\t\t\t\tm = n;\n\t\t\t\tn = tmp % n;\n\t\t\t}\n\t\t\t//最大公約数\n\t\t\tlong GCD = n;\n\t\t\t//最小公倍数\n\t\t\tlong LCM = a * b / GCD;\n\n\t\t\tSystem.out.printf(\"%d %d\\n\", GCD, LCM);\n\t\t}\n\t\tscanner.close();\n\t}\n\n}",
"public class Main{\n\n\tpublic static void main(String[] args) {\n\t\tScanner scanner = new Scanner(System.in);\n\t\twhile(scanner.hasNext()) {\n\t\t\tlong a = scanner.nextInt();\n\t\t\tlong b = scanner.nextInt();\n\t\t\tlong m = a ;\n\t\t\tlong n = b ;\n\t\t\twhile(m % n != 0){\n\t\t\t\tlong tmp = m;\n\t\t\t\tm = n;\n\t\t\t\tn = tmp % n;\n\t\t\t}\n\t\t\t//最大公約数\n\t\t\tlong GCD = n;\n\t\t\t//最小公倍数\n\t\t\tlong LCM = a * b / GCD;\n\n\t\t\tSystem.out.printf(\"%d %d\\n\", GCD, LCM);\n\t\t}\n\t\tscanner.close();\n\t}\n\n}",
"Main"
] |
import java.util.Scanner;
public class Main{
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
while(scanner.hasNext()) {
long a = scanner.nextInt();
long b = scanner.nextInt();
long m = a ;
long n = b ;
while(m % n != 0){
long tmp = m;
m = n;
n = tmp % n;
}
//最大公約数
long GCD = n;
//最小公倍数
long LCM = a * b / GCD;
System.out.printf("%d %d\n", GCD, LCM);
}
scanner.close();
}
}
|
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
42,
4,
18,
13,
30,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
41,
13,
13,
41,
13,
13,
41,
13,
17,
41,
13,
17,
42,
2,
13,
13,
30,
14,
2,
13,
13,
30,
41,
13,
13,
0,
13,
13,
0,
13,
13,
0,
13,
2,
13,
13,
0,
13,
13,
0,
13,
2,
2,
13,
13,
13,
4,
18,
18,
13,
13,
2,
2,
13,
17,
13,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
86,
5
],
[
86,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
13,
14
],
[
14,
15
],
[
12,
16
],
[
16,
17
],
[
17,
18
],
[
17,
19
],
[
19,
20
],
[
20,
21
],
[
16,
22
],
[
22,
23
],
[
22,
24
],
[
24,
25
],
[
25,
26
],
[
16,
27
],
[
27,
28
],
[
27,
29
],
[
16,
30
],
[
30,
31
],
[
30,
32
],
[
16,
33
],
[
33,
34
],
[
33,
35
],
[
16,
36
],
[
36,
37
],
[
36,
38
],
[
16,
39
],
[
39,
40
],
[
40,
41
],
[
40,
42
],
[
39,
43
],
[
43,
44
],
[
44,
45
],
[
45,
46
],
[
45,
47
],
[
44,
48
],
[
48,
49
],
[
49,
50
],
[
49,
51
],
[
48,
52
],
[
52,
53
],
[
52,
54
],
[
48,
55
],
[
55,
56
],
[
55,
57
],
[
43,
58
],
[
58,
59
],
[
58,
60
],
[
60,
61
],
[
60,
62
],
[
16,
63
],
[
63,
64
],
[
63,
65
],
[
16,
66
],
[
66,
67
],
[
66,
68
],
[
68,
69
],
[
69,
70
],
[
69,
71
],
[
68,
72
],
[
16,
73
],
[
73,
74
],
[
74,
75
],
[
75,
76
],
[
75,
77
],
[
73,
78
],
[
79,
79
],
[
79,
80
],
[
79,
81
],
[
79,
82
],
[
6,
83
],
[
83,
84
],
[
0,
85
],
[
85,
86
],
[
85,
87
]
] | [
"import java.util.*;\n\npublic class Main {\n public static void main (String[] args) {\n Scanner scanner = new Scanner(System.in);\n \n while (scanner.hasNext()) {\n long x0 = scanner.nextLong();\n long y0 = scanner.nextLong();\n \n long x = x0;\n long y = y0;\n long gcd = 0;\n long lcm = 0;\n \n while (x != y) {\n if (y > x) {\n long temp = y;\n y = x;\n x = temp;\n }\n x = x - y; \n }\n gcd = x; \n lcm = x0 * y0 /gcd;\n System.out.println(gcd + \" \" + lcm);\n }\n }\n}",
"import java.util.*;",
"util.*",
"java",
"public class Main {\n public static void main (String[] args) {\n Scanner scanner = new Scanner(System.in);\n \n while (scanner.hasNext()) {\n long x0 = scanner.nextLong();\n long y0 = scanner.nextLong();\n \n long x = x0;\n long y = y0;\n long gcd = 0;\n long lcm = 0;\n \n while (x != y) {\n if (y > x) {\n long temp = y;\n y = x;\n x = temp;\n }\n x = x - y; \n }\n gcd = x; \n lcm = x0 * y0 /gcd;\n System.out.println(gcd + \" \" + lcm);\n }\n }\n}",
"Main",
"public static void main (String[] args) {\n Scanner scanner = new Scanner(System.in);\n \n while (scanner.hasNext()) {\n long x0 = scanner.nextLong();\n long y0 = scanner.nextLong();\n \n long x = x0;\n long y = y0;\n long gcd = 0;\n long lcm = 0;\n \n while (x != y) {\n if (y > x) {\n long temp = y;\n y = x;\n x = temp;\n }\n x = x - y; \n }\n gcd = x; \n lcm = x0 * y0 /gcd;\n System.out.println(gcd + \" \" + lcm);\n }\n }",
"main",
"{\n Scanner scanner = new Scanner(System.in);\n \n while (scanner.hasNext()) {\n long x0 = scanner.nextLong();\n long y0 = scanner.nextLong();\n \n long x = x0;\n long y = y0;\n long gcd = 0;\n long lcm = 0;\n \n while (x != y) {\n if (y > x) {\n long temp = y;\n y = x;\n x = temp;\n }\n x = x - y; \n }\n gcd = x; \n lcm = x0 * y0 /gcd;\n System.out.println(gcd + \" \" + lcm);\n }\n }",
"Scanner scanner = new Scanner(System.in);",
"scanner",
"new Scanner(System.in)",
"while (scanner.hasNext()) {\n long x0 = scanner.nextLong();\n long y0 = scanner.nextLong();\n \n long x = x0;\n long y = y0;\n long gcd = 0;\n long lcm = 0;\n \n while (x != y) {\n if (y > x) {\n long temp = y;\n y = x;\n x = temp;\n }\n x = x - y; \n }\n gcd = x; \n lcm = x0 * y0 /gcd;\n System.out.println(gcd + \" \" + lcm);\n }",
"scanner.hasNext()",
"scanner.hasNext",
"scanner",
"{\n long x0 = scanner.nextLong();\n long y0 = scanner.nextLong();\n \n long x = x0;\n long y = y0;\n long gcd = 0;\n long lcm = 0;\n \n while (x != y) {\n if (y > x) {\n long temp = y;\n y = x;\n x = temp;\n }\n x = x - y; \n }\n gcd = x; \n lcm = x0 * y0 /gcd;\n System.out.println(gcd + \" \" + lcm);\n }",
"long x0 = scanner.nextLong();",
"x0",
"scanner.nextLong()",
"scanner.nextLong",
"scanner",
"long y0 = scanner.nextLong();",
"y0",
"scanner.nextLong()",
"scanner.nextLong",
"scanner",
"long x = x0;",
"x",
"x0",
"long y = y0;",
"y",
"y0",
"long gcd = 0;",
"gcd",
"0",
"long lcm = 0;",
"lcm",
"0",
"while (x != y) {\n if (y > x) {\n long temp = y;\n y = x;\n x = temp;\n }\n x = x - y; \n }",
"x != y",
"x",
"y",
"{\n if (y > x) {\n long temp = y;\n y = x;\n x = temp;\n }\n x = x - y; \n }",
"if (y > x) {\n long temp = y;\n y = x;\n x = temp;\n }",
"y > x",
"y",
"x",
"{\n long temp = y;\n y = x;\n x = temp;\n }",
"long temp = y;",
"temp",
"y",
"y = x",
"y",
"x",
"x = temp",
"x",
"temp",
"x = x - y",
"x",
"x - y",
"x",
"y",
"gcd = x",
"gcd",
"x",
"lcm = x0 * y0 /gcd",
"lcm",
"x0 * y0 /gcd",
"x0 * y0",
"x0",
"y0",
"gcd",
"System.out.println(gcd + \" \" + lcm)",
"System.out.println",
"System.out",
"System",
"System.out",
"gcd + \" \" + lcm",
"gcd + \" \" + lcm",
"gcd",
"\" \"",
"lcm",
"String[] args",
"args",
"public class Main {\n public static void main (String[] args) {\n Scanner scanner = new Scanner(System.in);\n \n while (scanner.hasNext()) {\n long x0 = scanner.nextLong();\n long y0 = scanner.nextLong();\n \n long x = x0;\n long y = y0;\n long gcd = 0;\n long lcm = 0;\n \n while (x != y) {\n if (y > x) {\n long temp = y;\n y = x;\n x = temp;\n }\n x = x - y; \n }\n gcd = x; \n lcm = x0 * y0 /gcd;\n System.out.println(gcd + \" \" + lcm);\n }\n }\n}",
"public class Main {\n public static void main (String[] args) {\n Scanner scanner = new Scanner(System.in);\n \n while (scanner.hasNext()) {\n long x0 = scanner.nextLong();\n long y0 = scanner.nextLong();\n \n long x = x0;\n long y = y0;\n long gcd = 0;\n long lcm = 0;\n \n while (x != y) {\n if (y > x) {\n long temp = y;\n y = x;\n x = temp;\n }\n x = x - y; \n }\n gcd = x; \n lcm = x0 * y0 /gcd;\n System.out.println(gcd + \" \" + lcm);\n }\n }\n}",
"Main"
] | import java.util.*;
public class Main {
public static void main (String[] args) {
Scanner scanner = new Scanner(System.in);
while (scanner.hasNext()) {
long x0 = scanner.nextLong();
long y0 = scanner.nextLong();
long x = x0;
long y = y0;
long gcd = 0;
long lcm = 0;
while (x != y) {
if (y > x) {
long temp = y;
y = x;
x = temp;
}
x = x - y;
}
gcd = x;
lcm = x0 * y0 /gcd;
System.out.println(gcd + " " + lcm);
}
}
} |
[
7,
15,
13,
17,
15,
13,
17,
6,
13,
41,
13,
20,
12,
13,
30,
42,
4,
18,
13,
30,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
41,
13,
4,
13,
13,
13,
41,
13,
2,
2,
13,
13,
13,
4,
18,
18,
13,
13,
2,
2,
13,
17,
13,
23,
13,
12,
13,
30,
14,
2,
13,
17,
29,
13,
29,
4,
13,
13,
2,
13,
13,
23,
13,
23,
13,
6,
13,
41,
13,
41,
13,
20,
17,
41,
13,
17,
41,
13,
17,
12,
13,
30,
4,
13,
18,
13,
13,
12,
13,
30,
4,
13,
18,
13,
13,
0,
18,
36,
13,
13,
23,
13,
12,
13,
30,
14,
2,
13,
13,
29,
17,
30,
0,
13,
17,
38,
5,
13,
30,
4,
18,
13,
30,
0,
13,
4,
18,
13,
13,
14,
2,
13,
17,
29,
17,
29,
17,
12,
13,
30,
14,
4,
13,
29,
18,
13,
40,
13,
29,
40,
17,
12,
13,
30,
29,
2,
2,
17,
13,
2,
13,
17,
23,
13,
12,
13,
30,
42,
2,
4,
13,
40,
4,
13,
18,
13,
13,
40,
13,
12,
13,
30,
4,
13,
29,
4,
13,
12,
13,
30,
14,
40,
4,
13,
37,
20,
41,
13,
17,
41,
13,
17,
41,
13,
4,
13,
14,
2,
13,
17,
30,
0,
13,
17,
0,
13,
4,
13,
14,
2,
2,
13,
17,
2,
17,
13,
37,
20,
42,
17,
30,
14,
2,
2,
17,
13,
2,
13,
17,
30,
0,
13,
17,
0,
13,
2,
13,
17,
14,
2,
2,
13,
40,
17,
40,
4,
13,
13,
29,
8,
13,
40,
13,
13,
37,
20,
0,
13,
4,
13,
12,
13,
30,
41,
13,
4,
13,
14,
2,
2,
13,
18,
13,
13,
2,
13,
18,
13,
13,
37,
20,
29,
13,
12,
13,
30,
4,
18,
33,
38,
5,
13,
30,
30,
4,
18,
13,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
319,
8
],
[
319,
9
],
[
9,
10
],
[
9,
11
],
[
319,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
16,
17
],
[
17,
18
],
[
15,
19
],
[
19,
20
],
[
20,
21
],
[
20,
22
],
[
22,
23
],
[
23,
24
],
[
19,
25
],
[
25,
26
],
[
25,
27
],
[
27,
28
],
[
28,
29
],
[
19,
30
],
[
30,
31
],
[
30,
32
],
[
32,
33
],
[
32,
34
],
[
32,
35
],
[
19,
36
],
[
36,
37
],
[
36,
38
],
[
38,
39
],
[
39,
40
],
[
39,
41
],
[
38,
42
],
[
19,
43
],
[
43,
44
],
[
44,
45
],
[
45,
46
],
[
45,
47
],
[
43,
48
],
[
49,
49
],
[
49,
50
],
[
49,
51
],
[
49,
52
],
[
12,
53
],
[
53,
54
],
[
319,
55
],
[
55,
56
],
[
55,
57
],
[
57,
58
],
[
58,
59
],
[
59,
60
],
[
59,
61
],
[
58,
62
],
[
62,
63
],
[
57,
64
],
[
64,
65
],
[
65,
66
],
[
65,
67
],
[
65,
68
],
[
68,
69
],
[
68,
70
],
[
55,
71
],
[
71,
72
],
[
55,
73
],
[
73,
74
],
[
319,
75
],
[
75,
76
],
[
75,
77
],
[
77,
78
],
[
75,
79
],
[
79,
80
],
[
79,
81
],
[
75,
83
],
[
83,
84
],
[
83,
85
],
[
75,
86
],
[
86,
87
],
[
86,
88
],
[
75,
89
],
[
89,
90
],
[
89,
91
],
[
91,
92
],
[
92,
93
],
[
92,
94
],
[
94,
95
],
[
94,
96
],
[
75,
97
],
[
97,
98
],
[
97,
99
],
[
99,
100
],
[
100,
101
],
[
100,
102
],
[
102,
103
],
[
102,
104
],
[
99,
105
],
[
105,
106
],
[
106,
107
],
[
106,
108
],
[
105,
109
],
[
97,
110
],
[
110,
111
],
[
75,
112
],
[
112,
113
],
[
112,
114
],
[
114,
115
],
[
115,
116
],
[
116,
117
],
[
116,
118
],
[
115,
119
],
[
119,
120
],
[
115,
121
],
[
121,
122
],
[
122,
123
],
[
122,
124
],
[
121,
125
],
[
125,
126
],
[
126,
127
],
[
126,
128
],
[
128,
129
],
[
129,
130
],
[
130,
131
],
[
125,
132
],
[
132,
133
],
[
133,
134
],
[
133,
135
],
[
135,
136
],
[
136,
137
],
[
135,
138
],
[
121,
139
],
[
139,
140
],
[
140,
141
],
[
140,
142
],
[
139,
143
],
[
143,
144
],
[
114,
145
],
[
145,
146
],
[
75,
147
],
[
147,
148
],
[
147,
149
],
[
149,
150
],
[
150,
151
],
[
151,
152
],
[
150,
153
],
[
153,
154
],
[
154,
155
],
[
154,
156
],
[
156,
157
],
[
150,
158
],
[
158,
159
],
[
159,
160
],
[
75,
161
],
[
161,
162
],
[
161,
163
],
[
163,
164
],
[
164,
165
],
[
165,
166
],
[
166,
167
],
[
166,
168
],
[
165,
169
],
[
169,
170
],
[
169,
171
],
[
161,
172
],
[
172,
173
],
[
75,
174
],
[
174,
175
],
[
174,
176
],
[
176,
177
],
[
177,
178
],
[
178,
179
],
[
179,
180
],
[
178,
181
],
[
181,
182
],
[
182,
183
],
[
182,
184
],
[
184,
185
],
[
184,
186
],
[
177,
187
],
[
187,
188
],
[
75,
189
],
[
189,
190
],
[
189,
191
],
[
191,
192
],
[
192,
193
],
[
191,
194
],
[
194,
195
],
[
195,
196
],
[
75,
197
],
[
197,
198
],
[
197,
199
],
[
199,
200
],
[
200,
201
],
[
201,
202
],
[
202,
203
],
[
200,
204
],
[
204,
205
],
[
199,
206
],
[
206,
207
],
[
206,
208
],
[
199,
209
],
[
209,
210
],
[
209,
211
],
[
199,
212
],
[
212,
213
],
[
212,
214
],
[
214,
215
],
[
199,
216
],
[
216,
217
],
[
217,
218
],
[
217,
219
],
[
216,
220
],
[
220,
221
],
[
221,
222
],
[
221,
223
],
[
220,
224
],
[
224,
225
],
[
224,
226
],
[
226,
227
],
[
199,
228
],
[
228,
229
],
[
229,
230
],
[
230,
231
],
[
230,
232
],
[
229,
233
],
[
233,
234
],
[
233,
235
],
[
228,
236
],
[
236,
237
],
[
199,
238
],
[
238,
239
],
[
238,
240
],
[
240,
241
],
[
241,
242
],
[
242,
243
],
[
243,
244
],
[
243,
245
],
[
242,
246
],
[
246,
247
],
[
246,
248
],
[
241,
249
],
[
249,
250
],
[
250,
251
],
[
250,
252
],
[
249,
253
],
[
253,
254
],
[
253,
255
],
[
255,
256
],
[
255,
257
],
[
241,
258
],
[
258,
259
],
[
259,
260
],
[
260,
261
],
[
260,
262
],
[
262,
263
],
[
259,
264
],
[
264,
265
],
[
265,
266
],
[
265,
267
],
[
258,
268
],
[
268,
269
],
[
269,
270
],
[
269,
271
],
[
271,
272
],
[
269,
273
],
[
258,
274
],
[
274,
275
],
[
240,
276
],
[
276,
277
],
[
276,
278
],
[
278,
279
],
[
75,
280
],
[
280,
281
],
[
280,
282
],
[
282,
283
],
[
283,
284
],
[
283,
285
],
[
285,
286
],
[
282,
287
],
[
287,
288
],
[
288,
289
],
[
289,
290
],
[
289,
291
],
[
291,
292
],
[
291,
293
],
[
288,
294
],
[
294,
295
],
[
294,
296
],
[
296,
297
],
[
296,
298
],
[
287,
299
],
[
299,
300
],
[
282,
301
],
[
301,
302
],
[
75,
303
],
[
303,
304
],
[
303,
305
],
[
305,
306
],
[
306,
307
],
[
307,
308
],
[
305,
309
],
[
309,
310
],
[
310,
311
],
[
310,
312
],
[
309,
313
],
[
313,
314
],
[
314,
315
],
[
315,
316
],
[
75,
317
],
[
0,
318
],
[
318,
319
],
[
318,
320
]
] | [
"import java.util.*;\nimport java.io.*;\n\npublic class Main {\n static IO io = new IO();\n public static void main(String[] args) {\n while (io.hasNext()) {\n long a = io.nextInt();\n long b = io.nextInt();\n long g = gcd(a,b);\n long l = a*b/g;\n System.out.println(g + \" \" + l);\n }\n }\n\n static long gcd(long a, long b) {\n if (b==0) return a;\n return gcd(b, a%b);\n }\n\n static class IO extends PrintWriter {\n private final InputStream in;\n private final byte[] buffer = new byte[1024];\n private int ptr = 0;\n private int buflen = 0;\n\n IO() {\n this(System.in);\n }\n\n IO(InputStream source) {\n super(System.out);\n this.in = source;\n }\n\n boolean hasNextByte() {\n if (ptr < buflen) return true;\n else {\n ptr = 0;\n try {\n buflen = in.read(buffer);\n } catch (IOException e) {\n e.printStackTrace();\n }\n if (buflen <= 0) return false;\n }\n return true;\n }\n\n int readByte() {\n if (hasNextByte()) return buffer[ptr++];\n else return -1;\n }\n\n boolean isPrintableChar(int c) {\n return 33 <= c && c <= 126;\n }\n\n void skipUnprintable() {\n while (hasNextByte() && !isPrintableChar(buffer[ptr])) ptr++;\n }\n\n boolean hasNext() {\n skipUnprintable();\n return hasNextByte();\n }\n\n long nextLong() {\n if (!hasNext()) throw new NoSuchElementException();\n long n = 0;\n boolean minus = false;\n int b = readByte();\n if (b == '-') {\n minus = true;\n b = readByte();\n }\n if (b < '0' || '9' < b) throw new NumberFormatException();\n while (true) {\n if ('0' <= b && b <= '9') {\n n *= 10;\n n += b - '0';\n } else if (b == -1 || !isPrintableChar(b)) return minus ? -n : n;\n else throw new NumberFormatException();\n b = readByte();\n }\n }\n\n int nextInt() {\n long nl = nextLong();\n if (nl < Integer.MIN_VALUE || nl > Integer.MAX_VALUE) throw new NumberFormatException();\n return (int) nl;\n }\n\n public void close() {\n super.close();\n try {\n in.close();\n } catch (IOException ignored) {\n }\n }\n }\n}",
"import java.util.*;",
"util.*",
"java",
"import java.io.*;",
"io.*",
"java",
"public class Main {\n static IO io = new IO();\n public static void main(String[] args) {\n while (io.hasNext()) {\n long a = io.nextInt();\n long b = io.nextInt();\n long g = gcd(a,b);\n long l = a*b/g;\n System.out.println(g + \" \" + l);\n }\n }\n\n static long gcd(long a, long b) {\n if (b==0) return a;\n return gcd(b, a%b);\n }\n\n static class IO extends PrintWriter {\n private final InputStream in;\n private final byte[] buffer = new byte[1024];\n private int ptr = 0;\n private int buflen = 0;\n\n IO() {\n this(System.in);\n }\n\n IO(InputStream source) {\n super(System.out);\n this.in = source;\n }\n\n boolean hasNextByte() {\n if (ptr < buflen) return true;\n else {\n ptr = 0;\n try {\n buflen = in.read(buffer);\n } catch (IOException e) {\n e.printStackTrace();\n }\n if (buflen <= 0) return false;\n }\n return true;\n }\n\n int readByte() {\n if (hasNextByte()) return buffer[ptr++];\n else return -1;\n }\n\n boolean isPrintableChar(int c) {\n return 33 <= c && c <= 126;\n }\n\n void skipUnprintable() {\n while (hasNextByte() && !isPrintableChar(buffer[ptr])) ptr++;\n }\n\n boolean hasNext() {\n skipUnprintable();\n return hasNextByte();\n }\n\n long nextLong() {\n if (!hasNext()) throw new NoSuchElementException();\n long n = 0;\n boolean minus = false;\n int b = readByte();\n if (b == '-') {\n minus = true;\n b = readByte();\n }\n if (b < '0' || '9' < b) throw new NumberFormatException();\n while (true) {\n if ('0' <= b && b <= '9') {\n n *= 10;\n n += b - '0';\n } else if (b == -1 || !isPrintableChar(b)) return minus ? -n : n;\n else throw new NumberFormatException();\n b = readByte();\n }\n }\n\n int nextInt() {\n long nl = nextLong();\n if (nl < Integer.MIN_VALUE || nl > Integer.MAX_VALUE) throw new NumberFormatException();\n return (int) nl;\n }\n\n public void close() {\n super.close();\n try {\n in.close();\n } catch (IOException ignored) {\n }\n }\n }\n}",
"Main",
"static IO io = new IO();",
"io",
"new IO()",
"public static void main(String[] args) {\n while (io.hasNext()) {\n long a = io.nextInt();\n long b = io.nextInt();\n long g = gcd(a,b);\n long l = a*b/g;\n System.out.println(g + \" \" + l);\n }\n }",
"main",
"{\n while (io.hasNext()) {\n long a = io.nextInt();\n long b = io.nextInt();\n long g = gcd(a,b);\n long l = a*b/g;\n System.out.println(g + \" \" + l);\n }\n }",
"while (io.hasNext()) {\n long a = io.nextInt();\n long b = io.nextInt();\n long g = gcd(a,b);\n long l = a*b/g;\n System.out.println(g + \" \" + l);\n }",
"io.hasNext()",
"io.hasNext",
"io",
"{\n long a = io.nextInt();\n long b = io.nextInt();\n long g = gcd(a,b);\n long l = a*b/g;\n System.out.println(g + \" \" + l);\n }",
"long a = io.nextInt();",
"a",
"io.nextInt()",
"io.nextInt",
"io",
"long b = io.nextInt();",
"b",
"io.nextInt()",
"io.nextInt",
"io",
"long g = gcd(a,b);",
"g",
"gcd(a,b)",
"gcd",
"a",
"b",
"long l = a*b/g;",
"l",
"a*b/g",
"a*b",
"a",
"b",
"g",
"System.out.println(g + \" \" + l)",
"System.out.println",
"System.out",
"System",
"System.out",
"g + \" \" + l",
"g + \" \" + l",
"g",
"\" \"",
"l",
"String[] args",
"args",
"static long gcd(long a, long b) {\n if (b==0) return a;\n return gcd(b, a%b);\n }",
"gcd",
"{\n if (b==0) return a;\n return gcd(b, a%b);\n }",
"if (b==0) return a;",
"b==0",
"b",
"0",
"return a;",
"a",
"return gcd(b, a%b);",
"gcd(b, a%b)",
"gcd",
"b",
"a%b",
"a",
"b",
"long a",
"a",
"long b",
"b",
"static class IO extends PrintWriter {\n private final InputStream in;\n private final byte[] buffer = new byte[1024];\n private int ptr = 0;\n private int buflen = 0;\n\n IO() {\n this(System.in);\n }\n\n IO(InputStream source) {\n super(System.out);\n this.in = source;\n }\n\n boolean hasNextByte() {\n if (ptr < buflen) return true;\n else {\n ptr = 0;\n try {\n buflen = in.read(buffer);\n } catch (IOException e) {\n e.printStackTrace();\n }\n if (buflen <= 0) return false;\n }\n return true;\n }\n\n int readByte() {\n if (hasNextByte()) return buffer[ptr++];\n else return -1;\n }\n\n boolean isPrintableChar(int c) {\n return 33 <= c && c <= 126;\n }\n\n void skipUnprintable() {\n while (hasNextByte() && !isPrintableChar(buffer[ptr])) ptr++;\n }\n\n boolean hasNext() {\n skipUnprintable();\n return hasNextByte();\n }\n\n long nextLong() {\n if (!hasNext()) throw new NoSuchElementException();\n long n = 0;\n boolean minus = false;\n int b = readByte();\n if (b == '-') {\n minus = true;\n b = readByte();\n }\n if (b < '0' || '9' < b) throw new NumberFormatException();\n while (true) {\n if ('0' <= b && b <= '9') {\n n *= 10;\n n += b - '0';\n } else if (b == -1 || !isPrintableChar(b)) return minus ? -n : n;\n else throw new NumberFormatException();\n b = readByte();\n }\n }\n\n int nextInt() {\n long nl = nextLong();\n if (nl < Integer.MIN_VALUE || nl > Integer.MAX_VALUE) throw new NumberFormatException();\n return (int) nl;\n }\n\n public void close() {\n super.close();\n try {\n in.close();\n } catch (IOException ignored) {\n }\n }\n }",
"IO",
"private final InputStream in;",
"in",
"private final byte[] buffer = new byte[1024];",
"buffer",
"new byte[1024]",
"1024",
"private int ptr = 0;",
"ptr",
"0",
"private int buflen = 0;",
"buflen",
"0",
"IO() {\n this(System.in);\n }",
"IO",
"{\n this(System.in);\n }",
"this(System.in)",
"this",
"System.in",
"System",
"System.in",
"IO(InputStream source) {\n super(System.out);\n this.in = source;\n }",
"IO",
"{\n super(System.out);\n this.in = source;\n }",
"super(System.out)",
"super",
"System.out",
"System",
"System.out",
"this.in = source",
"this.in",
"this",
"this.in",
"source",
"InputStream source",
"source",
"boolean hasNextByte() {\n if (ptr < buflen) return true;\n else {\n ptr = 0;\n try {\n buflen = in.read(buffer);\n } catch (IOException e) {\n e.printStackTrace();\n }\n if (buflen <= 0) return false;\n }\n return true;\n }",
"hasNextByte",
"{\n if (ptr < buflen) return true;\n else {\n ptr = 0;\n try {\n buflen = in.read(buffer);\n } catch (IOException e) {\n e.printStackTrace();\n }\n if (buflen <= 0) return false;\n }\n return true;\n }",
"if (ptr < buflen) return true;\n else {\n ptr = 0;\n try {\n buflen = in.read(buffer);\n } catch (IOException e) {\n e.printStackTrace();\n }\n if (buflen <= 0) return false;\n }",
"ptr < buflen",
"ptr",
"buflen",
"return true;",
"true",
"{\n ptr = 0;\n try {\n buflen = in.read(buffer);\n } catch (IOException e) {\n e.printStackTrace();\n }\n if (buflen <= 0) return false;\n }",
"ptr = 0",
"ptr",
"0",
"try {\n buflen = in.read(buffer);\n } catch (IOException e) {\n e.printStackTrace();\n }",
"catch (IOException e) {\n e.printStackTrace();\n }",
"IOException e",
"{\n e.printStackTrace();\n }",
"e.printStackTrace()",
"e.printStackTrace",
"e",
"{\n buflen = in.read(buffer);\n }",
"buflen = in.read(buffer)",
"buflen",
"in.read(buffer)",
"in.read",
"in",
"buffer",
"if (buflen <= 0) return false;",
"buflen <= 0",
"buflen",
"0",
"return false;",
"false",
"return true;",
"true",
"int readByte() {\n if (hasNextByte()) return buffer[ptr++];\n else return -1;\n }",
"readByte",
"{\n if (hasNextByte()) return buffer[ptr++];\n else return -1;\n }",
"if (hasNextByte()) return buffer[ptr++];\n else return -1;",
"hasNextByte()",
"hasNextByte",
"return buffer[ptr++];",
"buffer[ptr++]",
"buffer",
"ptr++",
"ptr",
"return -1;",
"-1",
"1",
"boolean isPrintableChar(int c) {\n return 33 <= c && c <= 126;\n }",
"isPrintableChar",
"{\n return 33 <= c && c <= 126;\n }",
"return 33 <= c && c <= 126;",
"33 <= c && c <= 126",
"33 <= c",
"33",
"c",
"c <= 126",
"c",
"126",
"int c",
"c",
"void skipUnprintable() {\n while (hasNextByte() && !isPrintableChar(buffer[ptr])) ptr++;\n }",
"skipUnprintable",
"{\n while (hasNextByte() && !isPrintableChar(buffer[ptr])) ptr++;\n }",
"while (hasNextByte() && !isPrintableChar(buffer[ptr])) ptr++;",
"hasNextByte() && !isPrintableChar(buffer[ptr])",
"hasNextByte()",
"hasNextByte",
"!isPrintableChar(buffer[ptr])",
"isPrintableChar(buffer[ptr])",
"isPrintableChar",
"buffer[ptr]",
"buffer",
"ptr",
"ptr++",
"ptr",
"boolean hasNext() {\n skipUnprintable();\n return hasNextByte();\n }",
"hasNext",
"{\n skipUnprintable();\n return hasNextByte();\n }",
"skipUnprintable()",
"skipUnprintable",
"return hasNextByte();",
"hasNextByte()",
"hasNextByte",
"long nextLong() {\n if (!hasNext()) throw new NoSuchElementException();\n long n = 0;\n boolean minus = false;\n int b = readByte();\n if (b == '-') {\n minus = true;\n b = readByte();\n }\n if (b < '0' || '9' < b) throw new NumberFormatException();\n while (true) {\n if ('0' <= b && b <= '9') {\n n *= 10;\n n += b - '0';\n } else if (b == -1 || !isPrintableChar(b)) return minus ? -n : n;\n else throw new NumberFormatException();\n b = readByte();\n }\n }",
"nextLong",
"{\n if (!hasNext()) throw new NoSuchElementException();\n long n = 0;\n boolean minus = false;\n int b = readByte();\n if (b == '-') {\n minus = true;\n b = readByte();\n }\n if (b < '0' || '9' < b) throw new NumberFormatException();\n while (true) {\n if ('0' <= b && b <= '9') {\n n *= 10;\n n += b - '0';\n } else if (b == -1 || !isPrintableChar(b)) return minus ? -n : n;\n else throw new NumberFormatException();\n b = readByte();\n }\n }",
"if (!hasNext()) throw new NoSuchElementException();",
"!hasNext()",
"hasNext()",
"hasNext",
"throw new NoSuchElementException();",
"new NoSuchElementException()",
"long n = 0;",
"n",
"0",
"boolean minus = false;",
"minus",
"false",
"int b = readByte();",
"b",
"readByte()",
"readByte",
"if (b == '-') {\n minus = true;\n b = readByte();\n }",
"b == '-'",
"b",
"'-'",
"{\n minus = true;\n b = readByte();\n }",
"minus = true",
"minus",
"true",
"b = readByte()",
"b",
"readByte()",
"readByte",
"if (b < '0' || '9' < b) throw new NumberFormatException();",
"b < '0' || '9' < b",
"b < '0'",
"b",
"'0'",
"'9' < b",
"'9'",
"b",
"throw new NumberFormatException();",
"new NumberFormatException()",
"while (true) {\n if ('0' <= b && b <= '9') {\n n *= 10;\n n += b - '0';\n } else if (b == -1 || !isPrintableChar(b)) return minus ? -n : n;\n else throw new NumberFormatException();\n b = readByte();\n }",
"true",
"{\n if ('0' <= b && b <= '9') {\n n *= 10;\n n += b - '0';\n } else if (b == -1 || !isPrintableChar(b)) return minus ? -n : n;\n else throw new NumberFormatException();\n b = readByte();\n }",
"if ('0' <= b && b <= '9') {\n n *= 10;\n n += b - '0';\n } else if (b == -1 || !isPrintableChar(b)) return minus ? -n : n;\n else throw new NumberFormatException();",
"'0' <= b && b <= '9'",
"'0' <= b",
"'0'",
"b",
"b <= '9'",
"b",
"'9'",
"{\n n *= 10;\n n += b - '0';\n }",
"n *= 10",
"n",
"10",
"n += b - '0'",
"n",
"b - '0'",
"b",
"'0'",
"if (b == -1 || !isPrintableChar(b)) return minus ? -n : n;\n else throw new NumberFormatException();",
"b == -1 || !isPrintableChar(b)",
"b == -1",
"b",
"-1",
"1",
"!isPrintableChar(b)",
"isPrintableChar(b)",
"isPrintableChar",
"b",
"return minus ? -n : n;",
"minus ? -n : n",
"minus",
"-n",
"n",
"n",
"throw new NumberFormatException();",
"new NumberFormatException()",
"b = readByte()",
"b",
"readByte()",
"readByte",
"int nextInt() {\n long nl = nextLong();\n if (nl < Integer.MIN_VALUE || nl > Integer.MAX_VALUE) throw new NumberFormatException();\n return (int) nl;\n }",
"nextInt",
"{\n long nl = nextLong();\n if (nl < Integer.MIN_VALUE || nl > Integer.MAX_VALUE) throw new NumberFormatException();\n return (int) nl;\n }",
"long nl = nextLong();",
"nl",
"nextLong()",
"nextLong",
"if (nl < Integer.MIN_VALUE || nl > Integer.MAX_VALUE) throw new NumberFormatException();",
"nl < Integer.MIN_VALUE || nl > Integer.MAX_VALUE",
"nl < Integer.MIN_VALUE",
"nl",
"Integer.MIN_VALUE",
"Integer",
"Integer.MIN_VALUE",
"nl > Integer.MAX_VALUE",
"nl",
"Integer.MAX_VALUE",
"Integer",
"Integer.MAX_VALUE",
"throw new NumberFormatException();",
"new NumberFormatException()",
"return (int) nl;",
"(int) nl",
"public void close() {\n super.close();\n try {\n in.close();\n } catch (IOException ignored) {\n }\n }",
"close",
"{\n super.close();\n try {\n in.close();\n } catch (IOException ignored) {\n }\n }",
"super.close()",
"super.close",
"super",
"try {\n in.close();\n } catch (IOException ignored) {\n }",
"catch (IOException ignored) {\n }",
"IOException ignored",
"{\n }",
"{\n in.close();\n }",
"in.close()",
"in.close",
"in",
"PrintWriter",
"public class Main {\n static IO io = new IO();\n public static void main(String[] args) {\n while (io.hasNext()) {\n long a = io.nextInt();\n long b = io.nextInt();\n long g = gcd(a,b);\n long l = a*b/g;\n System.out.println(g + \" \" + l);\n }\n }\n\n static long gcd(long a, long b) {\n if (b==0) return a;\n return gcd(b, a%b);\n }\n\n static class IO extends PrintWriter {\n private final InputStream in;\n private final byte[] buffer = new byte[1024];\n private int ptr = 0;\n private int buflen = 0;\n\n IO() {\n this(System.in);\n }\n\n IO(InputStream source) {\n super(System.out);\n this.in = source;\n }\n\n boolean hasNextByte() {\n if (ptr < buflen) return true;\n else {\n ptr = 0;\n try {\n buflen = in.read(buffer);\n } catch (IOException e) {\n e.printStackTrace();\n }\n if (buflen <= 0) return false;\n }\n return true;\n }\n\n int readByte() {\n if (hasNextByte()) return buffer[ptr++];\n else return -1;\n }\n\n boolean isPrintableChar(int c) {\n return 33 <= c && c <= 126;\n }\n\n void skipUnprintable() {\n while (hasNextByte() && !isPrintableChar(buffer[ptr])) ptr++;\n }\n\n boolean hasNext() {\n skipUnprintable();\n return hasNextByte();\n }\n\n long nextLong() {\n if (!hasNext()) throw new NoSuchElementException();\n long n = 0;\n boolean minus = false;\n int b = readByte();\n if (b == '-') {\n minus = true;\n b = readByte();\n }\n if (b < '0' || '9' < b) throw new NumberFormatException();\n while (true) {\n if ('0' <= b && b <= '9') {\n n *= 10;\n n += b - '0';\n } else if (b == -1 || !isPrintableChar(b)) return minus ? -n : n;\n else throw new NumberFormatException();\n b = readByte();\n }\n }\n\n int nextInt() {\n long nl = nextLong();\n if (nl < Integer.MIN_VALUE || nl > Integer.MAX_VALUE) throw new NumberFormatException();\n return (int) nl;\n }\n\n public void close() {\n super.close();\n try {\n in.close();\n } catch (IOException ignored) {\n }\n }\n }\n}",
"public class Main {\n static IO io = new IO();\n public static void main(String[] args) {\n while (io.hasNext()) {\n long a = io.nextInt();\n long b = io.nextInt();\n long g = gcd(a,b);\n long l = a*b/g;\n System.out.println(g + \" \" + l);\n }\n }\n\n static long gcd(long a, long b) {\n if (b==0) return a;\n return gcd(b, a%b);\n }\n\n static class IO extends PrintWriter {\n private final InputStream in;\n private final byte[] buffer = new byte[1024];\n private int ptr = 0;\n private int buflen = 0;\n\n IO() {\n this(System.in);\n }\n\n IO(InputStream source) {\n super(System.out);\n this.in = source;\n }\n\n boolean hasNextByte() {\n if (ptr < buflen) return true;\n else {\n ptr = 0;\n try {\n buflen = in.read(buffer);\n } catch (IOException e) {\n e.printStackTrace();\n }\n if (buflen <= 0) return false;\n }\n return true;\n }\n\n int readByte() {\n if (hasNextByte()) return buffer[ptr++];\n else return -1;\n }\n\n boolean isPrintableChar(int c) {\n return 33 <= c && c <= 126;\n }\n\n void skipUnprintable() {\n while (hasNextByte() && !isPrintableChar(buffer[ptr])) ptr++;\n }\n\n boolean hasNext() {\n skipUnprintable();\n return hasNextByte();\n }\n\n long nextLong() {\n if (!hasNext()) throw new NoSuchElementException();\n long n = 0;\n boolean minus = false;\n int b = readByte();\n if (b == '-') {\n minus = true;\n b = readByte();\n }\n if (b < '0' || '9' < b) throw new NumberFormatException();\n while (true) {\n if ('0' <= b && b <= '9') {\n n *= 10;\n n += b - '0';\n } else if (b == -1 || !isPrintableChar(b)) return minus ? -n : n;\n else throw new NumberFormatException();\n b = readByte();\n }\n }\n\n int nextInt() {\n long nl = nextLong();\n if (nl < Integer.MIN_VALUE || nl > Integer.MAX_VALUE) throw new NumberFormatException();\n return (int) nl;\n }\n\n public void close() {\n super.close();\n try {\n in.close();\n } catch (IOException ignored) {\n }\n }\n }\n}",
"Main"
] | import java.util.*;
import java.io.*;
public class Main {
static IO io = new IO();
public static void main(String[] args) {
while (io.hasNext()) {
long a = io.nextInt();
long b = io.nextInt();
long g = gcd(a,b);
long l = a*b/g;
System.out.println(g + " " + l);
}
}
static long gcd(long a, long b) {
if (b==0) return a;
return gcd(b, a%b);
}
static class IO extends PrintWriter {
private final InputStream in;
private final byte[] buffer = new byte[1024];
private int ptr = 0;
private int buflen = 0;
IO() {
this(System.in);
}
IO(InputStream source) {
super(System.out);
this.in = source;
}
boolean hasNextByte() {
if (ptr < buflen) return true;
else {
ptr = 0;
try {
buflen = in.read(buffer);
} catch (IOException e) {
e.printStackTrace();
}
if (buflen <= 0) return false;
}
return true;
}
int readByte() {
if (hasNextByte()) return buffer[ptr++];
else return -1;
}
boolean isPrintableChar(int c) {
return 33 <= c && c <= 126;
}
void skipUnprintable() {
while (hasNextByte() && !isPrintableChar(buffer[ptr])) ptr++;
}
boolean hasNext() {
skipUnprintable();
return hasNextByte();
}
long nextLong() {
if (!hasNext()) throw new NoSuchElementException();
long n = 0;
boolean minus = false;
int b = readByte();
if (b == '-') {
minus = true;
b = readByte();
}
if (b < '0' || '9' < b) throw new NumberFormatException();
while (true) {
if ('0' <= b && b <= '9') {
n *= 10;
n += b - '0';
} else if (b == -1 || !isPrintableChar(b)) return minus ? -n : n;
else throw new NumberFormatException();
b = readByte();
}
}
int nextInt() {
long nl = nextLong();
if (nl < Integer.MIN_VALUE || nl > Integer.MAX_VALUE) throw new NumberFormatException();
return (int) nl;
}
public void close() {
super.close();
try {
in.close();
} catch (IOException ignored) {
}
}
}
} |
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
20,
42,
4,
18,
13,
30,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
4,
18,
13,
4,
18,
13,
17,
4,
13,
13,
13,
4,
13,
13,
13,
11,
1,
41,
13,
17,
41,
13,
4,
18,
13,
2,
13,
13,
1,
40,
13,
30,
30,
4,
18,
18,
13,
13,
4,
18,
13,
13,
23,
13,
12,
13,
30,
42,
2,
13,
13,
30,
14,
2,
13,
13,
0,
13,
13,
0,
13,
13,
29,
13,
23,
13,
23,
13,
12,
13,
30,
29,
2,
2,
13,
13,
4,
13,
13,
13,
23,
13,
23,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
8,
15
],
[
15,
16
],
[
16,
17
],
[
17,
18
],
[
15,
19
],
[
19,
20
],
[
20,
21
],
[
20,
22
],
[
22,
23
],
[
23,
24
],
[
19,
25
],
[
25,
26
],
[
25,
27
],
[
27,
28
],
[
28,
29
],
[
19,
30
],
[
30,
31
],
[
31,
32
],
[
30,
33
],
[
33,
34
],
[
34,
35
],
[
33,
36
],
[
33,
37
],
[
37,
38
],
[
37,
39
],
[
37,
40
],
[
33,
41
],
[
41,
42
],
[
41,
43
],
[
41,
44
],
[
8,
45
],
[
45,
46
],
[
46,
47
],
[
47,
48
],
[
47,
49
],
[
46,
50
],
[
50,
51
],
[
50,
52
],
[
52,
53
],
[
53,
54
],
[
45,
55
],
[
55,
56
],
[
55,
57
],
[
45,
58
],
[
58,
59
],
[
59,
60
],
[
45,
61
],
[
62,
62
],
[
62,
63
],
[
63,
64
],
[
64,
65
],
[
65,
66
],
[
65,
67
],
[
63,
68
],
[
68,
69
],
[
69,
70
],
[
68,
71
],
[
6,
72
],
[
72,
73
],
[
4,
74
],
[
74,
75
],
[
74,
76
],
[
76,
77
],
[
77,
78
],
[
78,
79
],
[
78,
80
],
[
77,
81
],
[
81,
82
],
[
82,
83
],
[
83,
84
],
[
83,
85
],
[
82,
86
],
[
86,
87
],
[
86,
88
],
[
82,
89
],
[
89,
90
],
[
89,
91
],
[
76,
92
],
[
92,
93
],
[
74,
94
],
[
94,
95
],
[
74,
96
],
[
96,
97
],
[
4,
98
],
[
98,
99
],
[
98,
100
],
[
100,
101
],
[
101,
102
],
[
102,
103
],
[
103,
104
],
[
103,
105
],
[
102,
106
],
[
106,
107
],
[
106,
108
],
[
106,
109
],
[
98,
110
],
[
110,
111
],
[
98,
112
],
[
112,
113
]
] | [
"import java.util.*;\n\nclass Main{\n public static void main(String[] args){\n Scanner sc = new Scanner(System.in);\n ArrayList<String> ans = new ArrayList<>();\n while(sc.hasNext()){\n long a = sc.nextLong(),b = sc.nextLong();\n ans.add(String.format(\"%d %d\",getGCD(a,b),getLCM(a,b)));\n }\n for(int i = 0,size = ans.size();i < size;i++){\n System.out.println(ans.get(i));\n }\n }\n static long getGCD(long a,long b){\n while(a != b){\n if(a > b) a -= b;\n else b -= a;\n }\n return a;\n }\n static long getLCM(long a,long b){\n return a * b / getGCD(a,b);\n }\n}",
"import java.util.*;",
"util.*",
"java",
"class Main{\n public static void main(String[] args){\n Scanner sc = new Scanner(System.in);\n ArrayList<String> ans = new ArrayList<>();\n while(sc.hasNext()){\n long a = sc.nextLong(),b = sc.nextLong();\n ans.add(String.format(\"%d %d\",getGCD(a,b),getLCM(a,b)));\n }\n for(int i = 0,size = ans.size();i < size;i++){\n System.out.println(ans.get(i));\n }\n }\n static long getGCD(long a,long b){\n while(a != b){\n if(a > b) a -= b;\n else b -= a;\n }\n return a;\n }\n static long getLCM(long a,long b){\n return a * b / getGCD(a,b);\n }\n}",
"Main",
"public static void main(String[] args){\n Scanner sc = new Scanner(System.in);\n ArrayList<String> ans = new ArrayList<>();\n while(sc.hasNext()){\n long a = sc.nextLong(),b = sc.nextLong();\n ans.add(String.format(\"%d %d\",getGCD(a,b),getLCM(a,b)));\n }\n for(int i = 0,size = ans.size();i < size;i++){\n System.out.println(ans.get(i));\n }\n }",
"main",
"{\n Scanner sc = new Scanner(System.in);\n ArrayList<String> ans = new ArrayList<>();\n while(sc.hasNext()){\n long a = sc.nextLong(),b = sc.nextLong();\n ans.add(String.format(\"%d %d\",getGCD(a,b),getLCM(a,b)));\n }\n for(int i = 0,size = ans.size();i < size;i++){\n System.out.println(ans.get(i));\n }\n }",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"ArrayList<String> ans = new ArrayList<>();",
"ans",
"new ArrayList<>()",
"while(sc.hasNext()){\n long a = sc.nextLong(),b = sc.nextLong();\n ans.add(String.format(\"%d %d\",getGCD(a,b),getLCM(a,b)));\n }",
"sc.hasNext()",
"sc.hasNext",
"sc",
"{\n long a = sc.nextLong(),b = sc.nextLong();\n ans.add(String.format(\"%d %d\",getGCD(a,b),getLCM(a,b)));\n }",
"long a = sc.nextLong()",
"a",
"sc.nextLong()",
"sc.nextLong",
"sc",
"b = sc.nextLong();",
"b",
"sc.nextLong()",
"sc.nextLong",
"sc",
"ans.add(String.format(\"%d %d\",getGCD(a,b),getLCM(a,b)))",
"ans.add",
"ans",
"String.format(\"%d %d\",getGCD(a,b),getLCM(a,b))",
"String.format",
"String",
"\"%d %d\"",
"getGCD(a,b)",
"getGCD",
"a",
"b",
"getLCM(a,b)",
"getLCM",
"a",
"b",
"for(int i = 0,size = ans.size();i < size;i++){\n System.out.println(ans.get(i));\n }",
"int i = 0,size = ans.size();",
"int i = 0",
"i",
"0",
"size = ans.size();",
"size",
"ans.size()",
"ans.size",
"ans",
"i < size",
"i",
"size",
"i++",
"i++",
"i",
"{\n System.out.println(ans.get(i));\n }",
"{\n System.out.println(ans.get(i));\n }",
"System.out.println(ans.get(i))",
"System.out.println",
"System.out",
"System",
"System.out",
"ans.get(i)",
"ans.get",
"ans",
"i",
"String[] args",
"args",
"static long getGCD(long a,long b){\n while(a != b){\n if(a > b) a -= b;\n else b -= a;\n }\n return a;\n }",
"getGCD",
"{\n while(a != b){\n if(a > b) a -= b;\n else b -= a;\n }\n return a;\n }",
"while(a != b){\n if(a > b) a -= b;\n else b -= a;\n }",
"a != b",
"a",
"b",
"{\n if(a > b) a -= b;\n else b -= a;\n }",
"if(a > b) a -= b;\n else b -= a;",
"a > b",
"a",
"b",
"a -= b",
"a",
"b",
"b -= a",
"b",
"a",
"return a;",
"a",
"long a",
"a",
"long b",
"b",
"static long getLCM(long a,long b){\n return a * b / getGCD(a,b);\n }",
"getLCM",
"{\n return a * b / getGCD(a,b);\n }",
"return a * b / getGCD(a,b);",
"a * b / getGCD(a,b)",
"a * b",
"a",
"b",
"getGCD(a,b)",
"getGCD",
"a",
"b",
"long a",
"a",
"long b",
"b"
] | import java.util.*;
class Main{
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
ArrayList<String> ans = new ArrayList<>();
while(sc.hasNext()){
long a = sc.nextLong(),b = sc.nextLong();
ans.add(String.format("%d %d",getGCD(a,b),getLCM(a,b)));
}
for(int i = 0,size = ans.size();i < size;i++){
System.out.println(ans.get(i));
}
}
static long getGCD(long a,long b){
while(a != b){
if(a > b) a -= b;
else b -= a;
}
return a;
}
static long getLCM(long a,long b){
return a * b / getGCD(a,b);
}
} |
[
7,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
41,
13,
42,
4,
18,
13,
30,
0,
13,
4,
18,
13,
0,
13,
4,
18,
13,
4,
18,
18,
13,
13,
17,
4,
13,
13,
13,
4,
13,
13,
13,
23,
13,
12,
13,
30,
14,
2,
13,
13,
30,
41,
13,
13,
0,
13,
13,
0,
13,
13,
14,
2,
13,
17,
29,
13,
29,
4,
13,
13,
2,
13,
13,
23,
13,
23,
13,
12,
13,
30,
29,
2,
2,
13,
4,
13,
13,
13,
13,
23,
13,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
101,
8
],
[
101,
9
],
[
9,
10
],
[
9,
11
],
[
11,
12
],
[
12,
13
],
[
12,
14
],
[
11,
15
],
[
15,
16
],
[
11,
17
],
[
17,
18
],
[
11,
19
],
[
19,
20
],
[
20,
21
],
[
21,
22
],
[
19,
23
],
[
23,
24
],
[
24,
25
],
[
24,
26
],
[
26,
27
],
[
27,
28
],
[
23,
29
],
[
29,
30
],
[
29,
31
],
[
31,
32
],
[
32,
33
],
[
23,
34
],
[
34,
35
],
[
35,
36
],
[
36,
37
],
[
36,
38
],
[
34,
39
],
[
34,
40
],
[
40,
41
],
[
40,
42
],
[
40,
43
],
[
34,
44
],
[
44,
45
],
[
44,
46
],
[
44,
47
],
[
9,
48
],
[
48,
49
],
[
101,
50
],
[
50,
51
],
[
50,
52
],
[
52,
53
],
[
53,
54
],
[
54,
55
],
[
54,
56
],
[
53,
57
],
[
57,
58
],
[
58,
59
],
[
58,
60
],
[
57,
61
],
[
61,
62
],
[
61,
63
],
[
57,
64
],
[
64,
65
],
[
64,
66
],
[
52,
67
],
[
67,
68
],
[
68,
69
],
[
68,
70
],
[
67,
71
],
[
71,
72
],
[
52,
73
],
[
73,
74
],
[
74,
75
],
[
74,
76
],
[
74,
77
],
[
77,
78
],
[
77,
79
],
[
50,
80
],
[
80,
81
],
[
50,
82
],
[
82,
83
],
[
101,
84
],
[
84,
85
],
[
84,
86
],
[
86,
87
],
[
87,
88
],
[
88,
89
],
[
89,
90
],
[
89,
91
],
[
91,
92
],
[
91,
93
],
[
91,
94
],
[
88,
95
],
[
84,
96
],
[
96,
97
],
[
84,
98
],
[
98,
99
],
[
0,
100
],
[
100,
101
],
[
100,
102
]
] | [
"import java.util.Arrays;\nimport java.util.Scanner;\n\n\npublic class Main {\n\n\t/**\n\t * @param args\n\t */\n\tpublic static void main(String[] args) {\n\t\t// TODO Auto-generated method stub\n\t\tScanner cin=new Scanner(System.in);\n\t\tint a,b;\n\t\twhile(cin.hasNext()){\n\t\t\ta=cin.nextInt();\n\t\t\tb=cin.nextInt();\n\t\t\tSystem.out.printf(\"%d %d\\n\",GCD(a,b),LCM(a,b));\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t}\n\t}\n\tstatic int GCD(int a,int b){\n\t\tif(a<b){\n\t\t\tint temp=a;a=b;b=temp;\n\t\t}\n\t\tif(b==0) return a;\n\t\treturn GCD(b,a%b);\n\t}\n\tstatic int LCM(int a,int b){\n\t\treturn a/GCD(a,b)*b;\n\t}\n\n}",
"import java.util.Arrays;",
"Arrays",
"java.util",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n\n\t/**\n\t * @param args\n\t */\n\tpublic static void main(String[] args) {\n\t\t// TODO Auto-generated method stub\n\t\tScanner cin=new Scanner(System.in);\n\t\tint a,b;\n\t\twhile(cin.hasNext()){\n\t\t\ta=cin.nextInt();\n\t\t\tb=cin.nextInt();\n\t\t\tSystem.out.printf(\"%d %d\\n\",GCD(a,b),LCM(a,b));\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t}\n\t}\n\tstatic int GCD(int a,int b){\n\t\tif(a<b){\n\t\t\tint temp=a;a=b;b=temp;\n\t\t}\n\t\tif(b==0) return a;\n\t\treturn GCD(b,a%b);\n\t}\n\tstatic int LCM(int a,int b){\n\t\treturn a/GCD(a,b)*b;\n\t}\n\n}",
"Main",
"/**\n\t * @param args\n\t */\n\tpublic static void main(String[] args) {\n\t\t// TODO Auto-generated method stub\n\t\tScanner cin=new Scanner(System.in);\n\t\tint a,b;\n\t\twhile(cin.hasNext()){\n\t\t\ta=cin.nextInt();\n\t\t\tb=cin.nextInt();\n\t\t\tSystem.out.printf(\"%d %d\\n\",GCD(a,b),LCM(a,b));\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t}\n\t}",
"main",
"{\n\t\t// TODO Auto-generated method stub\n\t\tScanner cin=new Scanner(System.in);\n\t\tint a,b;\n\t\twhile(cin.hasNext()){\n\t\t\ta=cin.nextInt();\n\t\t\tb=cin.nextInt();\n\t\t\tSystem.out.printf(\"%d %d\\n\",GCD(a,b),LCM(a,b));\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t}\n\t}",
"Scanner cin=new Scanner(System.in);",
"cin",
"new Scanner(System.in)",
"int a",
"a",
"b;",
"b",
"while(cin.hasNext()){\n\t\t\ta=cin.nextInt();\n\t\t\tb=cin.nextInt();\n\t\t\tSystem.out.printf(\"%d %d\\n\",GCD(a,b),LCM(a,b));\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t}",
"cin.hasNext()",
"cin.hasNext",
"cin",
"{\n\t\t\ta=cin.nextInt();\n\t\t\tb=cin.nextInt();\n\t\t\tSystem.out.printf(\"%d %d\\n\",GCD(a,b),LCM(a,b));\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t}",
"a=cin.nextInt()",
"a",
"cin.nextInt()",
"cin.nextInt",
"cin",
"b=cin.nextInt()",
"b",
"cin.nextInt()",
"cin.nextInt",
"cin",
"System.out.printf(\"%d %d\\n\",GCD(a,b),LCM(a,b))",
"System.out.printf",
"System.out",
"System",
"System.out",
"\"%d %d\\n\"",
"GCD(a,b)",
"GCD",
"a",
"b",
"LCM(a,b)",
"LCM",
"a",
"b",
"String[] args",
"args",
"static int GCD(int a,int b){\n\t\tif(a<b){\n\t\t\tint temp=a;a=b;b=temp;\n\t\t}\n\t\tif(b==0) return a;\n\t\treturn GCD(b,a%b);\n\t}",
"GCD",
"{\n\t\tif(a<b){\n\t\t\tint temp=a;a=b;b=temp;\n\t\t}\n\t\tif(b==0) return a;\n\t\treturn GCD(b,a%b);\n\t}",
"if(a<b){\n\t\t\tint temp=a;a=b;b=temp;\n\t\t}",
"a<b",
"a",
"b",
"{\n\t\t\tint temp=a;a=b;b=temp;\n\t\t}",
"int temp=a;",
"temp",
"a",
"a=b",
"a",
"b",
"b=temp",
"b",
"temp",
"if(b==0) return a;",
"b==0",
"b",
"0",
"return a;",
"a",
"return GCD(b,a%b);",
"GCD(b,a%b)",
"GCD",
"b",
"a%b",
"a",
"b",
"int a",
"a",
"int b",
"b",
"static int LCM(int a,int b){\n\t\treturn a/GCD(a,b)*b;\n\t}",
"LCM",
"{\n\t\treturn a/GCD(a,b)*b;\n\t}",
"return a/GCD(a,b)*b;",
"a/GCD(a,b)*b",
"a/GCD(a,b)",
"a",
"GCD(a,b)",
"GCD",
"a",
"b",
"b",
"int a",
"a",
"int b",
"b",
"public class Main {\n\n\t/**\n\t * @param args\n\t */\n\tpublic static void main(String[] args) {\n\t\t// TODO Auto-generated method stub\n\t\tScanner cin=new Scanner(System.in);\n\t\tint a,b;\n\t\twhile(cin.hasNext()){\n\t\t\ta=cin.nextInt();\n\t\t\tb=cin.nextInt();\n\t\t\tSystem.out.printf(\"%d %d\\n\",GCD(a,b),LCM(a,b));\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t}\n\t}\n\tstatic int GCD(int a,int b){\n\t\tif(a<b){\n\t\t\tint temp=a;a=b;b=temp;\n\t\t}\n\t\tif(b==0) return a;\n\t\treturn GCD(b,a%b);\n\t}\n\tstatic int LCM(int a,int b){\n\t\treturn a/GCD(a,b)*b;\n\t}\n\n}",
"public class Main {\n\n\t/**\n\t * @param args\n\t */\n\tpublic static void main(String[] args) {\n\t\t// TODO Auto-generated method stub\n\t\tScanner cin=new Scanner(System.in);\n\t\tint a,b;\n\t\twhile(cin.hasNext()){\n\t\t\ta=cin.nextInt();\n\t\t\tb=cin.nextInt();\n\t\t\tSystem.out.printf(\"%d %d\\n\",GCD(a,b),LCM(a,b));\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t}\n\t}\n\tstatic int GCD(int a,int b){\n\t\tif(a<b){\n\t\t\tint temp=a;a=b;b=temp;\n\t\t}\n\t\tif(b==0) return a;\n\t\treturn GCD(b,a%b);\n\t}\n\tstatic int LCM(int a,int b){\n\t\treturn a/GCD(a,b)*b;\n\t}\n\n}",
"Main"
] | import java.util.Arrays;
import java.util.Scanner;
public class Main {
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
Scanner cin=new Scanner(System.in);
int a,b;
while(cin.hasNext()){
a=cin.nextInt();
b=cin.nextInt();
System.out.printf("%d %d\n",GCD(a,b),LCM(a,b));
}
}
static int GCD(int a,int b){
if(a<b){
int temp=a;a=b;b=temp;
}
if(b==0) return a;
return GCD(b,a%b);
}
static int LCM(int a,int b){
return a/GCD(a,b)*b;
}
} |
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
42,
4,
18,
13,
30,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
14,
2,
13,
13,
30,
41,
13,
13,
0,
13,
13,
0,
13,
13,
41,
13,
4,
13,
13,
13,
4,
18,
18,
13,
13,
2,
2,
13,
17,
2,
2,
13,
13,
13,
23,
13,
12,
13,
30,
14,
2,
13,
17,
30,
29,
13,
29,
4,
13,
13,
2,
13,
13,
23,
13,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
85,
5
],
[
85,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
13,
14
],
[
14,
15
],
[
12,
16
],
[
16,
17
],
[
17,
18
],
[
17,
19
],
[
19,
20
],
[
20,
21
],
[
16,
22
],
[
22,
23
],
[
22,
24
],
[
24,
25
],
[
25,
26
],
[
16,
27
],
[
27,
28
],
[
28,
29
],
[
28,
30
],
[
27,
31
],
[
31,
32
],
[
32,
33
],
[
32,
34
],
[
31,
35
],
[
35,
36
],
[
35,
37
],
[
31,
38
],
[
38,
39
],
[
38,
40
],
[
16,
41
],
[
41,
42
],
[
41,
43
],
[
43,
44
],
[
43,
45
],
[
43,
46
],
[
16,
47
],
[
47,
48
],
[
48,
49
],
[
49,
50
],
[
49,
51
],
[
47,
52
],
[
53,
53
],
[
53,
54
],
[
53,
55
],
[
53,
56
],
[
56,
57
],
[
57,
58
],
[
57,
59
],
[
56,
60
],
[
6,
61
],
[
61,
62
],
[
85,
63
],
[
63,
64
],
[
63,
65
],
[
65,
66
],
[
66,
67
],
[
67,
68
],
[
67,
69
],
[
66,
70
],
[
70,
71
],
[
71,
72
],
[
65,
73
],
[
73,
74
],
[
74,
75
],
[
74,
76
],
[
74,
77
],
[
77,
78
],
[
77,
79
],
[
63,
80
],
[
80,
81
],
[
63,
82
],
[
82,
83
],
[
0,
84
],
[
84,
85
],
[
84,
86
]
] | [
"import java.util.*;\npublic class Main \n{\n\tpublic static void main(String[] args) \n\t{\n\t\tScanner stdIn = new Scanner(System.in);\n\t\twhile(stdIn.hasNext())\n\t\t{\n\t\t\tlong a = stdIn.nextLong();\n\t\t\tlong b = stdIn.nextLong();\n\t\t\tif(a < b)\n\t\t\t{\n\t\t\t\tlong temp = a;\n\t\t\t\ta = b;\n\t\t\t\tb = temp;\n\t\t\t}\n\t\t\tlong g = gcd(a, b);\n\t\t\tSystem.out.println(g + \" \" + (a * b / g));\n\t\t}\n\t}\n\t\n\tstatic long gcd(long a, long b)\n\t{\n\t\tif(b == 0)\n\t\t{\n\t\t\treturn(a);\n\t\t}\n\t\treturn(gcd(b, a % b));\n\t}\n}",
"import java.util.*;",
"util.*",
"java",
"public class Main \n{\n\tpublic static void main(String[] args) \n\t{\n\t\tScanner stdIn = new Scanner(System.in);\n\t\twhile(stdIn.hasNext())\n\t\t{\n\t\t\tlong a = stdIn.nextLong();\n\t\t\tlong b = stdIn.nextLong();\n\t\t\tif(a < b)\n\t\t\t{\n\t\t\t\tlong temp = a;\n\t\t\t\ta = b;\n\t\t\t\tb = temp;\n\t\t\t}\n\t\t\tlong g = gcd(a, b);\n\t\t\tSystem.out.println(g + \" \" + (a * b / g));\n\t\t}\n\t}\n\t\n\tstatic long gcd(long a, long b)\n\t{\n\t\tif(b == 0)\n\t\t{\n\t\t\treturn(a);\n\t\t}\n\t\treturn(gcd(b, a % b));\n\t}\n}",
"Main",
"public static void main(String[] args) \n\t{\n\t\tScanner stdIn = new Scanner(System.in);\n\t\twhile(stdIn.hasNext())\n\t\t{\n\t\t\tlong a = stdIn.nextLong();\n\t\t\tlong b = stdIn.nextLong();\n\t\t\tif(a < b)\n\t\t\t{\n\t\t\t\tlong temp = a;\n\t\t\t\ta = b;\n\t\t\t\tb = temp;\n\t\t\t}\n\t\t\tlong g = gcd(a, b);\n\t\t\tSystem.out.println(g + \" \" + (a * b / g));\n\t\t}\n\t}",
"main",
"{\n\t\tScanner stdIn = new Scanner(System.in);\n\t\twhile(stdIn.hasNext())\n\t\t{\n\t\t\tlong a = stdIn.nextLong();\n\t\t\tlong b = stdIn.nextLong();\n\t\t\tif(a < b)\n\t\t\t{\n\t\t\t\tlong temp = a;\n\t\t\t\ta = b;\n\t\t\t\tb = temp;\n\t\t\t}\n\t\t\tlong g = gcd(a, b);\n\t\t\tSystem.out.println(g + \" \" + (a * b / g));\n\t\t}\n\t}",
"Scanner stdIn = new Scanner(System.in);",
"stdIn",
"new Scanner(System.in)",
"while(stdIn.hasNext())\n\t\t{\n\t\t\tlong a = stdIn.nextLong();\n\t\t\tlong b = stdIn.nextLong();\n\t\t\tif(a < b)\n\t\t\t{\n\t\t\t\tlong temp = a;\n\t\t\t\ta = b;\n\t\t\t\tb = temp;\n\t\t\t}\n\t\t\tlong g = gcd(a, b);\n\t\t\tSystem.out.println(g + \" \" + (a * b / g));\n\t\t}",
"stdIn.hasNext()",
"stdIn.hasNext",
"stdIn",
"{\n\t\t\tlong a = stdIn.nextLong();\n\t\t\tlong b = stdIn.nextLong();\n\t\t\tif(a < b)\n\t\t\t{\n\t\t\t\tlong temp = a;\n\t\t\t\ta = b;\n\t\t\t\tb = temp;\n\t\t\t}\n\t\t\tlong g = gcd(a, b);\n\t\t\tSystem.out.println(g + \" \" + (a * b / g));\n\t\t}",
"long a = stdIn.nextLong();",
"a",
"stdIn.nextLong()",
"stdIn.nextLong",
"stdIn",
"long b = stdIn.nextLong();",
"b",
"stdIn.nextLong()",
"stdIn.nextLong",
"stdIn",
"if(a < b)\n\t\t\t{\n\t\t\t\tlong temp = a;\n\t\t\t\ta = b;\n\t\t\t\tb = temp;\n\t\t\t}",
"a < b",
"a",
"b",
"{\n\t\t\t\tlong temp = a;\n\t\t\t\ta = b;\n\t\t\t\tb = temp;\n\t\t\t}",
"long temp = a;",
"temp",
"a",
"a = b",
"a",
"b",
"b = temp",
"b",
"temp",
"long g = gcd(a, b);",
"g",
"gcd(a, b)",
"gcd",
"a",
"b",
"System.out.println(g + \" \" + (a * b / g))",
"System.out.println",
"System.out",
"System",
"System.out",
"g + \" \" + (a * b / g)",
"g + \" \" + (a * b / g)",
"g",
"\" \"",
"(a * b / g)",
"a * b",
"a",
"b",
"g",
"String[] args",
"args",
"static long gcd(long a, long b)\n\t{\n\t\tif(b == 0)\n\t\t{\n\t\t\treturn(a);\n\t\t}\n\t\treturn(gcd(b, a % b));\n\t}",
"gcd",
"{\n\t\tif(b == 0)\n\t\t{\n\t\t\treturn(a);\n\t\t}\n\t\treturn(gcd(b, a % b));\n\t}",
"if(b == 0)\n\t\t{\n\t\t\treturn(a);\n\t\t}",
"b == 0",
"b",
"0",
"{\n\t\t\treturn(a);\n\t\t}",
"return(a);",
"(a)",
"return(gcd(b, a % b));",
"(gcd(b, a % b))",
"gcd",
"b",
"a % b",
"a",
"b",
"long a",
"a",
"long b",
"b",
"public class Main \n{\n\tpublic static void main(String[] args) \n\t{\n\t\tScanner stdIn = new Scanner(System.in);\n\t\twhile(stdIn.hasNext())\n\t\t{\n\t\t\tlong a = stdIn.nextLong();\n\t\t\tlong b = stdIn.nextLong();\n\t\t\tif(a < b)\n\t\t\t{\n\t\t\t\tlong temp = a;\n\t\t\t\ta = b;\n\t\t\t\tb = temp;\n\t\t\t}\n\t\t\tlong g = gcd(a, b);\n\t\t\tSystem.out.println(g + \" \" + (a * b / g));\n\t\t}\n\t}\n\t\n\tstatic long gcd(long a, long b)\n\t{\n\t\tif(b == 0)\n\t\t{\n\t\t\treturn(a);\n\t\t}\n\t\treturn(gcd(b, a % b));\n\t}\n}",
"public class Main \n{\n\tpublic static void main(String[] args) \n\t{\n\t\tScanner stdIn = new Scanner(System.in);\n\t\twhile(stdIn.hasNext())\n\t\t{\n\t\t\tlong a = stdIn.nextLong();\n\t\t\tlong b = stdIn.nextLong();\n\t\t\tif(a < b)\n\t\t\t{\n\t\t\t\tlong temp = a;\n\t\t\t\ta = b;\n\t\t\t\tb = temp;\n\t\t\t}\n\t\t\tlong g = gcd(a, b);\n\t\t\tSystem.out.println(g + \" \" + (a * b / g));\n\t\t}\n\t}\n\t\n\tstatic long gcd(long a, long b)\n\t{\n\t\tif(b == 0)\n\t\t{\n\t\t\treturn(a);\n\t\t}\n\t\treturn(gcd(b, a % b));\n\t}\n}",
"Main"
] | import java.util.*;
public class Main
{
public static void main(String[] args)
{
Scanner stdIn = new Scanner(System.in);
while(stdIn.hasNext())
{
long a = stdIn.nextLong();
long b = stdIn.nextLong();
if(a < b)
{
long temp = a;
a = b;
b = temp;
}
long g = gcd(a, b);
System.out.println(g + " " + (a * b / g));
}
}
static long gcd(long a, long b)
{
if(b == 0)
{
return(a);
}
return(gcd(b, a % b));
}
} |
[
7,
15,
13,
17,
6,
13,
41,
13,
20,
12,
13,
30,
42,
4,
18,
13,
30,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
14,
2,
13,
13,
30,
41,
13,
13,
0,
13,
13,
0,
13,
13,
41,
13,
13,
42,
2,
2,
2,
13,
13,
17,
2,
2,
13,
13,
17,
30,
0,
13,
2,
13,
17,
14,
2,
13,
17,
0,
13,
17,
41,
13,
2,
2,
13,
13,
13,
4,
18,
18,
13,
13,
2,
2,
13,
17,
13,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
89,
5
],
[
89,
6
],
[
6,
7
],
[
6,
8
],
[
89,
9
],
[
9,
10
],
[
9,
11
],
[
11,
12
],
[
12,
13
],
[
13,
14
],
[
14,
15
],
[
12,
16
],
[
16,
17
],
[
17,
18
],
[
17,
19
],
[
19,
20
],
[
20,
21
],
[
16,
22
],
[
22,
23
],
[
22,
24
],
[
24,
25
],
[
25,
26
],
[
16,
27
],
[
27,
28
],
[
28,
29
],
[
28,
30
],
[
27,
31
],
[
31,
32
],
[
32,
33
],
[
32,
34
],
[
31,
35
],
[
35,
36
],
[
35,
37
],
[
31,
38
],
[
38,
39
],
[
38,
40
],
[
16,
41
],
[
41,
42
],
[
41,
43
],
[
16,
44
],
[
44,
45
],
[
45,
46
],
[
46,
47
],
[
47,
48
],
[
47,
49
],
[
46,
50
],
[
45,
51
],
[
51,
52
],
[
52,
53
],
[
52,
54
],
[
51,
55
],
[
44,
56
],
[
56,
57
],
[
57,
58
],
[
57,
59
],
[
59,
60
],
[
59,
61
],
[
56,
62
],
[
62,
63
],
[
63,
64
],
[
63,
65
],
[
62,
66
],
[
66,
67
],
[
66,
68
],
[
16,
69
],
[
69,
70
],
[
69,
71
],
[
71,
72
],
[
72,
73
],
[
72,
74
],
[
71,
75
],
[
16,
76
],
[
76,
77
],
[
77,
78
],
[
78,
79
],
[
78,
80
],
[
76,
81
],
[
82,
82
],
[
82,
83
],
[
82,
84
],
[
82,
85
],
[
9,
86
],
[
86,
87
],
[
0,
88
],
[
88,
89
],
[
88,
90
]
] | [
"import java.util.*;\npublic class Main{\n static Scanner kbd = new Scanner(System.in);\n public static void main(String[] args){\n\twhile(kbd.hasNext()){\n\t long a = kbd.nextLong();\n\t long b = kbd.nextLong();\n\t // a<bにしておく\n\t if(a>b) {\n\t\tlong w = a;\n\t\ta = b; \n\t\tb = w;\n\t }\n\n\t long gcd = a;\n\n\t while(a%gcd!=0 || b%gcd!=0) {\n\t\tgcd = gcd-2;\n\t\tif(gcd==0) gcd = 1;\n\t }\n\n\t long lcm = a*b/gcd;\n\n\t System.out.println(gcd+\" \"+lcm);\n\t}\n }\n}",
"import java.util.*;",
"util.*",
"java",
"public class Main{\n static Scanner kbd = new Scanner(System.in);\n public static void main(String[] args){\n\twhile(kbd.hasNext()){\n\t long a = kbd.nextLong();\n\t long b = kbd.nextLong();\n\t // a<bにしておく\n\t if(a>b) {\n\t\tlong w = a;\n\t\ta = b; \n\t\tb = w;\n\t }\n\n\t long gcd = a;\n\n\t while(a%gcd!=0 || b%gcd!=0) {\n\t\tgcd = gcd-2;\n\t\tif(gcd==0) gcd = 1;\n\t }\n\n\t long lcm = a*b/gcd;\n\n\t System.out.println(gcd+\" \"+lcm);\n\t}\n }\n}",
"Main",
"static Scanner kbd = new Scanner(System.in);",
"kbd",
"new Scanner(System.in)",
"public static void main(String[] args){\n\twhile(kbd.hasNext()){\n\t long a = kbd.nextLong();\n\t long b = kbd.nextLong();\n\t // a<bにしておく\n\t if(a>b) {\n\t\tlong w = a;\n\t\ta = b; \n\t\tb = w;\n\t }\n\n\t long gcd = a;\n\n\t while(a%gcd!=0 || b%gcd!=0) {\n\t\tgcd = gcd-2;\n\t\tif(gcd==0) gcd = 1;\n\t }\n\n\t long lcm = a*b/gcd;\n\n\t System.out.println(gcd+\" \"+lcm);\n\t}\n }",
"main",
"{\n\twhile(kbd.hasNext()){\n\t long a = kbd.nextLong();\n\t long b = kbd.nextLong();\n\t // a<bにしておく\n\t if(a>b) {\n\t\tlong w = a;\n\t\ta = b; \n\t\tb = w;\n\t }\n\n\t long gcd = a;\n\n\t while(a%gcd!=0 || b%gcd!=0) {\n\t\tgcd = gcd-2;\n\t\tif(gcd==0) gcd = 1;\n\t }\n\n\t long lcm = a*b/gcd;\n\n\t System.out.println(gcd+\" \"+lcm);\n\t}\n }",
"while(kbd.hasNext()){\n\t long a = kbd.nextLong();\n\t long b = kbd.nextLong();\n\t // a<bにしておく\n\t if(a>b) {\n\t\tlong w = a;\n\t\ta = b; \n\t\tb = w;\n\t }\n\n\t long gcd = a;\n\n\t while(a%gcd!=0 || b%gcd!=0) {\n\t\tgcd = gcd-2;\n\t\tif(gcd==0) gcd = 1;\n\t }\n\n\t long lcm = a*b/gcd;\n\n\t System.out.println(gcd+\" \"+lcm);\n\t}",
"kbd.hasNext()",
"kbd.hasNext",
"kbd",
"{\n\t long a = kbd.nextLong();\n\t long b = kbd.nextLong();\n\t // a<bにしておく\n\t if(a>b) {\n\t\tlong w = a;\n\t\ta = b; \n\t\tb = w;\n\t }\n\n\t long gcd = a;\n\n\t while(a%gcd!=0 || b%gcd!=0) {\n\t\tgcd = gcd-2;\n\t\tif(gcd==0) gcd = 1;\n\t }\n\n\t long lcm = a*b/gcd;\n\n\t System.out.println(gcd+\" \"+lcm);\n\t}",
"long a = kbd.nextLong();",
"a",
"kbd.nextLong()",
"kbd.nextLong",
"kbd",
"long b = kbd.nextLong();",
"b",
"kbd.nextLong()",
"kbd.nextLong",
"kbd",
"if(a>b) {\n\t\tlong w = a;\n\t\ta = b; \n\t\tb = w;\n\t }",
"a>b",
"a",
"b",
"{\n\t\tlong w = a;\n\t\ta = b; \n\t\tb = w;\n\t }",
"long w = a;",
"w",
"a",
"a = b",
"a",
"b",
"b = w",
"b",
"w",
"long gcd = a;",
"gcd",
"a",
"while(a%gcd!=0 || b%gcd!=0) {\n\t\tgcd = gcd-2;\n\t\tif(gcd==0) gcd = 1;\n\t }",
"a%gcd!=0 || b%gcd!=0",
"a%gcd!=0",
"a%gcd",
"a",
"gcd",
"0",
"b%gcd!=0",
"b%gcd",
"b",
"gcd",
"0",
"{\n\t\tgcd = gcd-2;\n\t\tif(gcd==0) gcd = 1;\n\t }",
"gcd = gcd-2",
"gcd",
"gcd-2",
"gcd",
"2",
"if(gcd==0) gcd = 1;",
"gcd==0",
"gcd",
"0",
"gcd = 1",
"gcd",
"1",
"long lcm = a*b/gcd;",
"lcm",
"a*b/gcd",
"a*b",
"a",
"b",
"gcd",
"System.out.println(gcd+\" \"+lcm)",
"System.out.println",
"System.out",
"System",
"System.out",
"gcd+\" \"+lcm",
"gcd+\" \"+lcm",
"gcd",
"\" \"",
"lcm",
"String[] args",
"args",
"public class Main{\n static Scanner kbd = new Scanner(System.in);\n public static void main(String[] args){\n\twhile(kbd.hasNext()){\n\t long a = kbd.nextLong();\n\t long b = kbd.nextLong();\n\t // a<bにしておく\n\t if(a>b) {\n\t\tlong w = a;\n\t\ta = b; \n\t\tb = w;\n\t }\n\n\t long gcd = a;\n\n\t while(a%gcd!=0 || b%gcd!=0) {\n\t\tgcd = gcd-2;\n\t\tif(gcd==0) gcd = 1;\n\t }\n\n\t long lcm = a*b/gcd;\n\n\t System.out.println(gcd+\" \"+lcm);\n\t}\n }\n}",
"public class Main{\n static Scanner kbd = new Scanner(System.in);\n public static void main(String[] args){\n\twhile(kbd.hasNext()){\n\t long a = kbd.nextLong();\n\t long b = kbd.nextLong();\n\t // a<bにしておく\n\t if(a>b) {\n\t\tlong w = a;\n\t\ta = b; \n\t\tb = w;\n\t }\n\n\t long gcd = a;\n\n\t while(a%gcd!=0 || b%gcd!=0) {\n\t\tgcd = gcd-2;\n\t\tif(gcd==0) gcd = 1;\n\t }\n\n\t long lcm = a*b/gcd;\n\n\t System.out.println(gcd+\" \"+lcm);\n\t}\n }\n}",
"Main"
] | import java.util.*;
public class Main{
static Scanner kbd = new Scanner(System.in);
public static void main(String[] args){
while(kbd.hasNext()){
long a = kbd.nextLong();
long b = kbd.nextLong();
// a<bにしておく
if(a>b) {
long w = a;
a = b;
b = w;
}
long gcd = a;
while(a%gcd!=0 || b%gcd!=0) {
gcd = gcd-2;
if(gcd==0) gcd = 1;
}
long lcm = a*b/gcd;
System.out.println(gcd+" "+lcm);
}
}
} |
[
7,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
42,
4,
18,
13,
30,
41,
13,
20,
17,
0,
18,
13,
17,
4,
18,
13,
0,
18,
13,
17,
4,
18,
13,
4,
18,
13,
13,
41,
13,
17,
41,
13,
17,
41,
13,
17,
14,
2,
18,
13,
17,
17,
30,
41,
13,
18,
13,
17,
41,
13,
18,
13,
17,
42,
17,
30,
14,
2,
2,
13,
13,
17,
30,
0,
13,
13,
0,
13,
2,
13,
13,
0,
13,
13,
14,
2,
2,
13,
13,
17,
30,
0,
13,
13,
3,
30,
0,
13,
18,
13,
17,
0,
13,
2,
2,
18,
13,
17,
18,
13,
17,
13,
4,
18,
18,
13,
13,
2,
2,
13,
17,
13,
23,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
9,
10
],
[
9,
11
],
[
11,
12
],
[
12,
13
],
[
12,
14
],
[
11,
15
],
[
15,
16
],
[
16,
17
],
[
17,
18
],
[
15,
19
],
[
19,
20
],
[
20,
21
],
[
20,
22
],
[
19,
24
],
[
24,
25
],
[
25,
26
],
[
25,
27
],
[
24,
28
],
[
28,
29
],
[
29,
30
],
[
19,
31
],
[
31,
32
],
[
32,
33
],
[
32,
34
],
[
31,
35
],
[
35,
36
],
[
36,
37
],
[
19,
38
],
[
38,
39
],
[
39,
40
],
[
38,
41
],
[
19,
42
],
[
42,
43
],
[
42,
44
],
[
19,
45
],
[
45,
46
],
[
45,
47
],
[
19,
48
],
[
48,
49
],
[
48,
50
],
[
19,
51
],
[
51,
52
],
[
52,
53
],
[
53,
54
],
[
53,
55
],
[
52,
56
],
[
51,
57
],
[
57,
58
],
[
58,
59
],
[
58,
60
],
[
60,
61
],
[
60,
62
],
[
57,
63
],
[
63,
64
],
[
63,
65
],
[
65,
66
],
[
65,
67
],
[
57,
68
],
[
68,
69
],
[
68,
70
],
[
70,
71
],
[
71,
72
],
[
72,
73
],
[
73,
74
],
[
73,
75
],
[
72,
76
],
[
71,
77
],
[
77,
78
],
[
78,
79
],
[
78,
80
],
[
77,
81
],
[
81,
82
],
[
81,
83
],
[
83,
84
],
[
83,
85
],
[
77,
86
],
[
86,
87
],
[
86,
88
],
[
71,
89
],
[
89,
90
],
[
90,
91
],
[
91,
92
],
[
91,
93
],
[
90,
94
],
[
89,
95
],
[
95,
96
],
[
96,
97
],
[
96,
98
],
[
95,
99
],
[
51,
100
],
[
100,
101
],
[
101,
102
],
[
101,
103
],
[
103,
104
],
[
103,
105
],
[
19,
106
],
[
106,
107
],
[
106,
108
],
[
108,
109
],
[
109,
110
],
[
110,
111
],
[
110,
112
],
[
109,
113
],
[
113,
114
],
[
113,
115
],
[
108,
116
],
[
19,
117
],
[
117,
118
],
[
118,
119
],
[
119,
120
],
[
119,
121
],
[
117,
122
],
[
123,
123
],
[
123,
124
],
[
123,
125
],
[
123,
126
],
[
9,
127
],
[
127,
128
]
] | [
"import java.util.Scanner;\nimport java.util.Arrays;\n\nclass Main {\n\tpublic static void main(String[] args) {\n\t\tScanner scan = new Scanner(System.in);\n\t\t\n\t\twhile( scan.hasNextInt() ) {\n\t\t\tInteger[] ary = new Integer[2];\n\t\t\tary[0] = scan.nextInt();\n\t\t\tary[1] = scan.nextInt();\n\t\t\t\n\t\t\tArrays.sort(ary);\n\t\t\t\n\t\t\tint divisor = 0, temp = 0;\n\t\t\tlong multiple = 0;\n\t\t\t\n\t\t\tif(ary[0] != 0) {\n\t\t\t\tint m = ary[1];\n\t\t\t\tint n = ary[0];\n\t\t\t\t\n\t\t\t\twhile(true) {\n\t\t\t\t\tif(m % n != 0) {\n\t\t\t\t\t\ttemp = n;\n\t\t\t\t\t\tn = m % n;\n\t\t\t\t\t\tm = temp;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\telse if(m % n == 0){\n\t\t\t\t\t\tdivisor = n;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\telse {\n\t\t\t\tdivisor = ary[1];\n\t\t\t}\n\t\t\t\n\t\t\tmultiple = (ary[0] * (long)ary[1]) / divisor;\n\t\t\t\n\t\t\t\n\t\t\tSystem.out.println(divisor + \" \" + multiple);\n\t\t}\n\t}\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"import java.util.Arrays;",
"Arrays",
"java.util",
"class Main {\n\tpublic static void main(String[] args) {\n\t\tScanner scan = new Scanner(System.in);\n\t\t\n\t\twhile( scan.hasNextInt() ) {\n\t\t\tInteger[] ary = new Integer[2];\n\t\t\tary[0] = scan.nextInt();\n\t\t\tary[1] = scan.nextInt();\n\t\t\t\n\t\t\tArrays.sort(ary);\n\t\t\t\n\t\t\tint divisor = 0, temp = 0;\n\t\t\tlong multiple = 0;\n\t\t\t\n\t\t\tif(ary[0] != 0) {\n\t\t\t\tint m = ary[1];\n\t\t\t\tint n = ary[0];\n\t\t\t\t\n\t\t\t\twhile(true) {\n\t\t\t\t\tif(m % n != 0) {\n\t\t\t\t\t\ttemp = n;\n\t\t\t\t\t\tn = m % n;\n\t\t\t\t\t\tm = temp;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\telse if(m % n == 0){\n\t\t\t\t\t\tdivisor = n;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\telse {\n\t\t\t\tdivisor = ary[1];\n\t\t\t}\n\t\t\t\n\t\t\tmultiple = (ary[0] * (long)ary[1]) / divisor;\n\t\t\t\n\t\t\t\n\t\t\tSystem.out.println(divisor + \" \" + multiple);\n\t\t}\n\t}\n}",
"Main",
"public static void main(String[] args) {\n\t\tScanner scan = new Scanner(System.in);\n\t\t\n\t\twhile( scan.hasNextInt() ) {\n\t\t\tInteger[] ary = new Integer[2];\n\t\t\tary[0] = scan.nextInt();\n\t\t\tary[1] = scan.nextInt();\n\t\t\t\n\t\t\tArrays.sort(ary);\n\t\t\t\n\t\t\tint divisor = 0, temp = 0;\n\t\t\tlong multiple = 0;\n\t\t\t\n\t\t\tif(ary[0] != 0) {\n\t\t\t\tint m = ary[1];\n\t\t\t\tint n = ary[0];\n\t\t\t\t\n\t\t\t\twhile(true) {\n\t\t\t\t\tif(m % n != 0) {\n\t\t\t\t\t\ttemp = n;\n\t\t\t\t\t\tn = m % n;\n\t\t\t\t\t\tm = temp;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\telse if(m % n == 0){\n\t\t\t\t\t\tdivisor = n;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\telse {\n\t\t\t\tdivisor = ary[1];\n\t\t\t}\n\t\t\t\n\t\t\tmultiple = (ary[0] * (long)ary[1]) / divisor;\n\t\t\t\n\t\t\t\n\t\t\tSystem.out.println(divisor + \" \" + multiple);\n\t\t}\n\t}",
"main",
"{\n\t\tScanner scan = new Scanner(System.in);\n\t\t\n\t\twhile( scan.hasNextInt() ) {\n\t\t\tInteger[] ary = new Integer[2];\n\t\t\tary[0] = scan.nextInt();\n\t\t\tary[1] = scan.nextInt();\n\t\t\t\n\t\t\tArrays.sort(ary);\n\t\t\t\n\t\t\tint divisor = 0, temp = 0;\n\t\t\tlong multiple = 0;\n\t\t\t\n\t\t\tif(ary[0] != 0) {\n\t\t\t\tint m = ary[1];\n\t\t\t\tint n = ary[0];\n\t\t\t\t\n\t\t\t\twhile(true) {\n\t\t\t\t\tif(m % n != 0) {\n\t\t\t\t\t\ttemp = n;\n\t\t\t\t\t\tn = m % n;\n\t\t\t\t\t\tm = temp;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\telse if(m % n == 0){\n\t\t\t\t\t\tdivisor = n;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\telse {\n\t\t\t\tdivisor = ary[1];\n\t\t\t}\n\t\t\t\n\t\t\tmultiple = (ary[0] * (long)ary[1]) / divisor;\n\t\t\t\n\t\t\t\n\t\t\tSystem.out.println(divisor + \" \" + multiple);\n\t\t}\n\t}",
"Scanner scan = new Scanner(System.in);",
"scan",
"new Scanner(System.in)",
"while( scan.hasNextInt() ) {\n\t\t\tInteger[] ary = new Integer[2];\n\t\t\tary[0] = scan.nextInt();\n\t\t\tary[1] = scan.nextInt();\n\t\t\t\n\t\t\tArrays.sort(ary);\n\t\t\t\n\t\t\tint divisor = 0, temp = 0;\n\t\t\tlong multiple = 0;\n\t\t\t\n\t\t\tif(ary[0] != 0) {\n\t\t\t\tint m = ary[1];\n\t\t\t\tint n = ary[0];\n\t\t\t\t\n\t\t\t\twhile(true) {\n\t\t\t\t\tif(m % n != 0) {\n\t\t\t\t\t\ttemp = n;\n\t\t\t\t\t\tn = m % n;\n\t\t\t\t\t\tm = temp;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\telse if(m % n == 0){\n\t\t\t\t\t\tdivisor = n;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\telse {\n\t\t\t\tdivisor = ary[1];\n\t\t\t}\n\t\t\t\n\t\t\tmultiple = (ary[0] * (long)ary[1]) / divisor;\n\t\t\t\n\t\t\t\n\t\t\tSystem.out.println(divisor + \" \" + multiple);\n\t\t}",
"scan.hasNextInt()",
"scan.hasNextInt",
"scan",
"{\n\t\t\tInteger[] ary = new Integer[2];\n\t\t\tary[0] = scan.nextInt();\n\t\t\tary[1] = scan.nextInt();\n\t\t\t\n\t\t\tArrays.sort(ary);\n\t\t\t\n\t\t\tint divisor = 0, temp = 0;\n\t\t\tlong multiple = 0;\n\t\t\t\n\t\t\tif(ary[0] != 0) {\n\t\t\t\tint m = ary[1];\n\t\t\t\tint n = ary[0];\n\t\t\t\t\n\t\t\t\twhile(true) {\n\t\t\t\t\tif(m % n != 0) {\n\t\t\t\t\t\ttemp = n;\n\t\t\t\t\t\tn = m % n;\n\t\t\t\t\t\tm = temp;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\telse if(m % n == 0){\n\t\t\t\t\t\tdivisor = n;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\telse {\n\t\t\t\tdivisor = ary[1];\n\t\t\t}\n\t\t\t\n\t\t\tmultiple = (ary[0] * (long)ary[1]) / divisor;\n\t\t\t\n\t\t\t\n\t\t\tSystem.out.println(divisor + \" \" + multiple);\n\t\t}",
"Integer[] ary = new Integer[2];",
"ary",
"new Integer[2]",
"2",
"ary[0] = scan.nextInt()",
"ary[0]",
"ary",
"0",
"scan.nextInt()",
"scan.nextInt",
"scan",
"ary[1] = scan.nextInt()",
"ary[1]",
"ary",
"1",
"scan.nextInt()",
"scan.nextInt",
"scan",
"Arrays.sort(ary)",
"Arrays.sort",
"Arrays",
"ary",
"int divisor = 0",
"divisor",
"0",
"temp = 0;",
"temp",
"0",
"long multiple = 0;",
"multiple",
"0",
"if(ary[0] != 0) {\n\t\t\t\tint m = ary[1];\n\t\t\t\tint n = ary[0];\n\t\t\t\t\n\t\t\t\twhile(true) {\n\t\t\t\t\tif(m % n != 0) {\n\t\t\t\t\t\ttemp = n;\n\t\t\t\t\t\tn = m % n;\n\t\t\t\t\t\tm = temp;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\telse if(m % n == 0){\n\t\t\t\t\t\tdivisor = n;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\telse {\n\t\t\t\tdivisor = ary[1];\n\t\t\t}",
"ary[0] != 0",
"ary[0]",
"ary",
"0",
"0",
"{\n\t\t\t\tint m = ary[1];\n\t\t\t\tint n = ary[0];\n\t\t\t\t\n\t\t\t\twhile(true) {\n\t\t\t\t\tif(m % n != 0) {\n\t\t\t\t\t\ttemp = n;\n\t\t\t\t\t\tn = m % n;\n\t\t\t\t\t\tm = temp;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\telse if(m % n == 0){\n\t\t\t\t\t\tdivisor = n;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}",
"int m = ary[1];",
"m",
"ary[1]",
"ary",
"1",
"int n = ary[0];",
"n",
"ary[0]",
"ary",
"0",
"while(true) {\n\t\t\t\t\tif(m % n != 0) {\n\t\t\t\t\t\ttemp = n;\n\t\t\t\t\t\tn = m % n;\n\t\t\t\t\t\tm = temp;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\telse if(m % n == 0){\n\t\t\t\t\t\tdivisor = n;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}",
"true",
"{\n\t\t\t\t\tif(m % n != 0) {\n\t\t\t\t\t\ttemp = n;\n\t\t\t\t\t\tn = m % n;\n\t\t\t\t\t\tm = temp;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\telse if(m % n == 0){\n\t\t\t\t\t\tdivisor = n;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}",
"if(m % n != 0) {\n\t\t\t\t\t\ttemp = n;\n\t\t\t\t\t\tn = m % n;\n\t\t\t\t\t\tm = temp;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\telse if(m % n == 0){\n\t\t\t\t\t\tdivisor = n;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}",
"m % n != 0",
"m % n",
"m",
"n",
"0",
"{\n\t\t\t\t\t\ttemp = n;\n\t\t\t\t\t\tn = m % n;\n\t\t\t\t\t\tm = temp;\n\t\t\t\t\t}",
"temp = n",
"temp",
"n",
"n = m % n",
"n",
"m % n",
"m",
"n",
"m = temp",
"m",
"temp",
"if(m % n == 0){\n\t\t\t\t\t\tdivisor = n;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}",
"m % n == 0",
"m % n",
"m",
"n",
"0",
"{\n\t\t\t\t\t\tdivisor = n;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}",
"divisor = n",
"divisor",
"n",
"break;",
"{\n\t\t\t\tdivisor = ary[1];\n\t\t\t}",
"divisor = ary[1]",
"divisor",
"ary[1]",
"ary",
"1",
"multiple = (ary[0] * (long)ary[1]) / divisor",
"multiple",
"(ary[0] * (long)ary[1]) / divisor",
"(ary[0] * (long)ary[1])",
"ary[0]",
"ary",
"0",
"(long)ary[1]",
"ary",
"1",
"divisor",
"System.out.println(divisor + \" \" + multiple)",
"System.out.println",
"System.out",
"System",
"System.out",
"divisor + \" \" + multiple",
"divisor + \" \" + multiple",
"divisor",
"\" \"",
"multiple",
"String[] args",
"args"
] | import java.util.Scanner;
import java.util.Arrays;
class Main {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
while( scan.hasNextInt() ) {
Integer[] ary = new Integer[2];
ary[0] = scan.nextInt();
ary[1] = scan.nextInt();
Arrays.sort(ary);
int divisor = 0, temp = 0;
long multiple = 0;
if(ary[0] != 0) {
int m = ary[1];
int n = ary[0];
while(true) {
if(m % n != 0) {
temp = n;
n = m % n;
m = temp;
}
else if(m % n == 0){
divisor = n;
break;
}
}
}
else {
divisor = ary[1];
}
multiple = (ary[0] * (long)ary[1]) / divisor;
System.out.println(divisor + " " + multiple);
}
}
} |
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
41,
13,
20,
38,
5,
13,
30,
4,
18,
13,
30,
38,
5,
13,
30,
30,
4,
18,
13,
30,
42,
2,
17,
0,
13,
4,
18,
13,
30,
41,
13,
4,
18,
13,
17,
41,
13,
4,
18,
13,
18,
13,
17,
41,
13,
4,
18,
13,
18,
13,
17,
41,
13,
8,
2,
13,
13,
4,
13,
13,
13,
4,
13,
13,
13,
41,
13,
2,
2,
2,
13,
13,
2,
13,
13,
13,
4,
18,
18,
13,
13,
2,
2,
13,
17,
13,
23,
13,
12,
13,
30,
14,
2,
13,
17,
30,
29,
13,
41,
13,
2,
13,
13,
29,
4,
13,
13,
13,
23,
13,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
130,
11
],
[
130,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
14,
17
],
[
17,
18
],
[
17,
19
],
[
14,
20
],
[
20,
21
],
[
21,
22
],
[
21,
23
],
[
23,
24
],
[
24,
25
],
[
25,
26
],
[
20,
27
],
[
27,
28
],
[
28,
29
],
[
29,
30
],
[
29,
31
],
[
28,
32
],
[
32,
33
],
[
33,
34
],
[
34,
35
],
[
20,
36
],
[
36,
37
],
[
37,
38
],
[
38,
39
],
[
38,
40
],
[
40,
41
],
[
40,
42
],
[
42,
43
],
[
43,
44
],
[
37,
45
],
[
45,
46
],
[
46,
47
],
[
46,
48
],
[
48,
49
],
[
49,
50
],
[
48,
51
],
[
45,
52
],
[
52,
53
],
[
52,
54
],
[
54,
55
],
[
55,
56
],
[
54,
57
],
[
57,
58
],
[
57,
59
],
[
45,
60
],
[
60,
61
],
[
60,
62
],
[
62,
63
],
[
63,
64
],
[
62,
65
],
[
65,
66
],
[
65,
67
],
[
45,
68
],
[
68,
69
],
[
68,
70
],
[
70,
71
],
[
71,
72
],
[
71,
73
],
[
70,
74
],
[
74,
75
],
[
74,
76
],
[
74,
77
],
[
70,
78
],
[
78,
79
],
[
78,
80
],
[
78,
81
],
[
45,
82
],
[
82,
83
],
[
82,
84
],
[
85,
85
],
[
85,
86
],
[
86,
87
],
[
86,
88
],
[
85,
89
],
[
89,
90
],
[
89,
91
],
[
85,
92
],
[
45,
93
],
[
93,
94
],
[
94,
95
],
[
95,
96
],
[
95,
97
],
[
93,
98
],
[
99,
99
],
[
99,
100
],
[
99,
101
],
[
99,
102
],
[
12,
103
],
[
103,
104
],
[
130,
105
],
[
105,
106
],
[
105,
107
],
[
107,
108
],
[
108,
109
],
[
109,
110
],
[
109,
111
],
[
108,
112
],
[
112,
113
],
[
113,
114
],
[
107,
115
],
[
115,
116
],
[
115,
117
],
[
117,
118
],
[
117,
119
],
[
107,
120
],
[
120,
121
],
[
121,
122
],
[
121,
123
],
[
121,
124
],
[
105,
125
],
[
125,
126
],
[
105,
127
],
[
127,
128
],
[
0,
129
],
[
129,
130
],
[
129,
131
]
] | [
"import java.io.BufferedReader;\nimport java.io.IOException;\nimport java.io.InputStreamReader;\n\npublic class Main {\n\n\tpublic static void main(String[] a){\n\n\t\tString str;\n\t\tBufferedReader bf = new BufferedReader(new InputStreamReader(System.in));\n\n\t\ttry {\n\t\t\twhile(null != ( str = bf.readLine() )){\n\t\t\t\tString[] arr = str.split(\" \");\n\t\t\t\tlong num1 = Long.parseLong(arr[0]);\n\t\t\t\tlong num2 = Long.parseLong(arr[1]);\n\t\t\t\tlong min_num = num1>num2 ? euclidean( num1, num2) : euclidean(num2, num1);\n\t\t\t\tlong max_num = ( num1 / min_num ) * ( num2 / min_num ) * min_num;\n\t\t\t\tSystem.out.println(min_num + \" \" + max_num);\n\t\t\t}\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t} finally {\n\t\t\ttry {\n\t\t\t\tbf.close();\n\t\t\t} catch (IOException e) {\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate static long euclidean(long num1, long num2){\n\t\tif(num2 == 0){\n\t\t\treturn num1;\n\t\t}\n\t\tlong tmp_num = num1 % num2;\n\t\treturn euclidean(num2, tmp_num);\n\t}\n}",
"import java.io.BufferedReader;",
"BufferedReader",
"java.io",
"import java.io.IOException;",
"IOException",
"java.io",
"import java.io.InputStreamReader;",
"InputStreamReader",
"java.io",
"public class Main {\n\n\tpublic static void main(String[] a){\n\n\t\tString str;\n\t\tBufferedReader bf = new BufferedReader(new InputStreamReader(System.in));\n\n\t\ttry {\n\t\t\twhile(null != ( str = bf.readLine() )){\n\t\t\t\tString[] arr = str.split(\" \");\n\t\t\t\tlong num1 = Long.parseLong(arr[0]);\n\t\t\t\tlong num2 = Long.parseLong(arr[1]);\n\t\t\t\tlong min_num = num1>num2 ? euclidean( num1, num2) : euclidean(num2, num1);\n\t\t\t\tlong max_num = ( num1 / min_num ) * ( num2 / min_num ) * min_num;\n\t\t\t\tSystem.out.println(min_num + \" \" + max_num);\n\t\t\t}\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t} finally {\n\t\t\ttry {\n\t\t\t\tbf.close();\n\t\t\t} catch (IOException e) {\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate static long euclidean(long num1, long num2){\n\t\tif(num2 == 0){\n\t\t\treturn num1;\n\t\t}\n\t\tlong tmp_num = num1 % num2;\n\t\treturn euclidean(num2, tmp_num);\n\t}\n}",
"Main",
"public static void main(String[] a){\n\n\t\tString str;\n\t\tBufferedReader bf = new BufferedReader(new InputStreamReader(System.in));\n\n\t\ttry {\n\t\t\twhile(null != ( str = bf.readLine() )){\n\t\t\t\tString[] arr = str.split(\" \");\n\t\t\t\tlong num1 = Long.parseLong(arr[0]);\n\t\t\t\tlong num2 = Long.parseLong(arr[1]);\n\t\t\t\tlong min_num = num1>num2 ? euclidean( num1, num2) : euclidean(num2, num1);\n\t\t\t\tlong max_num = ( num1 / min_num ) * ( num2 / min_num ) * min_num;\n\t\t\t\tSystem.out.println(min_num + \" \" + max_num);\n\t\t\t}\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t} finally {\n\t\t\ttry {\n\t\t\t\tbf.close();\n\t\t\t} catch (IOException e) {\n\t\t\t}\n\t\t}\n\t}",
"main",
"{\n\n\t\tString str;\n\t\tBufferedReader bf = new BufferedReader(new InputStreamReader(System.in));\n\n\t\ttry {\n\t\t\twhile(null != ( str = bf.readLine() )){\n\t\t\t\tString[] arr = str.split(\" \");\n\t\t\t\tlong num1 = Long.parseLong(arr[0]);\n\t\t\t\tlong num2 = Long.parseLong(arr[1]);\n\t\t\t\tlong min_num = num1>num2 ? euclidean( num1, num2) : euclidean(num2, num1);\n\t\t\t\tlong max_num = ( num1 / min_num ) * ( num2 / min_num ) * min_num;\n\t\t\t\tSystem.out.println(min_num + \" \" + max_num);\n\t\t\t}\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t} finally {\n\t\t\ttry {\n\t\t\t\tbf.close();\n\t\t\t} catch (IOException e) {\n\t\t\t}\n\t\t}\n\t}",
"String str;",
"str",
"BufferedReader bf = new BufferedReader(new InputStreamReader(System.in));",
"bf",
"new BufferedReader(new InputStreamReader(System.in))",
"try {\n\t\t\twhile(null != ( str = bf.readLine() )){\n\t\t\t\tString[] arr = str.split(\" \");\n\t\t\t\tlong num1 = Long.parseLong(arr[0]);\n\t\t\t\tlong num2 = Long.parseLong(arr[1]);\n\t\t\t\tlong min_num = num1>num2 ? euclidean( num1, num2) : euclidean(num2, num1);\n\t\t\t\tlong max_num = ( num1 / min_num ) * ( num2 / min_num ) * min_num;\n\t\t\t\tSystem.out.println(min_num + \" \" + max_num);\n\t\t\t}\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t} finally {\n\t\t\ttry {\n\t\t\t\tbf.close();\n\t\t\t} catch (IOException e) {\n\t\t\t}\n\t\t}",
"catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}",
"IOException e",
"{\n\t\t\te.printStackTrace();\n\t\t}",
"e.printStackTrace()",
"e.printStackTrace",
"e",
"{\n\t\t\ttry {\n\t\t\t\tbf.close();\n\t\t\t} catch (IOException e) {\n\t\t\t}\n\t\t}",
"try {\n\t\t\t\tbf.close();\n\t\t\t} catch (IOException e) {\n\t\t\t}",
"catch (IOException e) {\n\t\t\t}",
"IOException e",
"{\n\t\t\t}",
"{\n\t\t\t\tbf.close();\n\t\t\t}",
"bf.close()",
"bf.close",
"bf",
"{\n\t\t\twhile(null != ( str = bf.readLine() )){\n\t\t\t\tString[] arr = str.split(\" \");\n\t\t\t\tlong num1 = Long.parseLong(arr[0]);\n\t\t\t\tlong num2 = Long.parseLong(arr[1]);\n\t\t\t\tlong min_num = num1>num2 ? euclidean( num1, num2) : euclidean(num2, num1);\n\t\t\t\tlong max_num = ( num1 / min_num ) * ( num2 / min_num ) * min_num;\n\t\t\t\tSystem.out.println(min_num + \" \" + max_num);\n\t\t\t}\n\t\t}",
"while(null != ( str = bf.readLine() )){\n\t\t\t\tString[] arr = str.split(\" \");\n\t\t\t\tlong num1 = Long.parseLong(arr[0]);\n\t\t\t\tlong num2 = Long.parseLong(arr[1]);\n\t\t\t\tlong min_num = num1>num2 ? euclidean( num1, num2) : euclidean(num2, num1);\n\t\t\t\tlong max_num = ( num1 / min_num ) * ( num2 / min_num ) * min_num;\n\t\t\t\tSystem.out.println(min_num + \" \" + max_num);\n\t\t\t}",
"null != ( str = bf.readLine() )",
"null",
"( str = bf.readLine() )",
"str",
"bf.readLine()",
"bf.readLine",
"bf",
"{\n\t\t\t\tString[] arr = str.split(\" \");\n\t\t\t\tlong num1 = Long.parseLong(arr[0]);\n\t\t\t\tlong num2 = Long.parseLong(arr[1]);\n\t\t\t\tlong min_num = num1>num2 ? euclidean( num1, num2) : euclidean(num2, num1);\n\t\t\t\tlong max_num = ( num1 / min_num ) * ( num2 / min_num ) * min_num;\n\t\t\t\tSystem.out.println(min_num + \" \" + max_num);\n\t\t\t}",
"String[] arr = str.split(\" \");",
"arr",
"str.split(\" \")",
"str.split",
"str",
"\" \"",
"long num1 = Long.parseLong(arr[0]);",
"num1",
"Long.parseLong(arr[0])",
"Long.parseLong",
"Long",
"arr[0]",
"arr",
"0",
"long num2 = Long.parseLong(arr[1]);",
"num2",
"Long.parseLong(arr[1])",
"Long.parseLong",
"Long",
"arr[1]",
"arr",
"1",
"long min_num = num1>num2 ? euclidean( num1, num2) : euclidean(num2, num1);",
"min_num",
"num1>num2 ? euclidean( num1, num2) : euclidean(num2, num1)",
"num1>num2",
"num1",
"num2",
"euclidean( num1, num2)",
"euclidean",
"num1",
"num2",
"euclidean(num2, num1)",
"euclidean",
"num2",
"num1",
"long max_num = ( num1 / min_num ) * ( num2 / min_num ) * min_num;",
"max_num",
"( num1 / min_num ) * ( num2 / min_num ) * min_num",
"( num1 / min_num ) * ( num2 / min_num ) * min_num",
"( num1 / min_num )",
"num1",
"min_num",
"( num2 / min_num )",
"num2",
"min_num",
"min_num",
"System.out.println(min_num + \" \" + max_num)",
"System.out.println",
"System.out",
"System",
"System.out",
"min_num + \" \" + max_num",
"min_num + \" \" + max_num",
"min_num",
"\" \"",
"max_num",
"String[] a",
"a",
"private static long euclidean(long num1, long num2){\n\t\tif(num2 == 0){\n\t\t\treturn num1;\n\t\t}\n\t\tlong tmp_num = num1 % num2;\n\t\treturn euclidean(num2, tmp_num);\n\t}",
"euclidean",
"{\n\t\tif(num2 == 0){\n\t\t\treturn num1;\n\t\t}\n\t\tlong tmp_num = num1 % num2;\n\t\treturn euclidean(num2, tmp_num);\n\t}",
"if(num2 == 0){\n\t\t\treturn num1;\n\t\t}",
"num2 == 0",
"num2",
"0",
"{\n\t\t\treturn num1;\n\t\t}",
"return num1;",
"num1",
"long tmp_num = num1 % num2;",
"tmp_num",
"num1 % num2",
"num1",
"num2",
"return euclidean(num2, tmp_num);",
"euclidean(num2, tmp_num)",
"euclidean",
"num2",
"tmp_num",
"long num1",
"num1",
"long num2",
"num2",
"public class Main {\n\n\tpublic static void main(String[] a){\n\n\t\tString str;\n\t\tBufferedReader bf = new BufferedReader(new InputStreamReader(System.in));\n\n\t\ttry {\n\t\t\twhile(null != ( str = bf.readLine() )){\n\t\t\t\tString[] arr = str.split(\" \");\n\t\t\t\tlong num1 = Long.parseLong(arr[0]);\n\t\t\t\tlong num2 = Long.parseLong(arr[1]);\n\t\t\t\tlong min_num = num1>num2 ? euclidean( num1, num2) : euclidean(num2, num1);\n\t\t\t\tlong max_num = ( num1 / min_num ) * ( num2 / min_num ) * min_num;\n\t\t\t\tSystem.out.println(min_num + \" \" + max_num);\n\t\t\t}\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t} finally {\n\t\t\ttry {\n\t\t\t\tbf.close();\n\t\t\t} catch (IOException e) {\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate static long euclidean(long num1, long num2){\n\t\tif(num2 == 0){\n\t\t\treturn num1;\n\t\t}\n\t\tlong tmp_num = num1 % num2;\n\t\treturn euclidean(num2, tmp_num);\n\t}\n}",
"public class Main {\n\n\tpublic static void main(String[] a){\n\n\t\tString str;\n\t\tBufferedReader bf = new BufferedReader(new InputStreamReader(System.in));\n\n\t\ttry {\n\t\t\twhile(null != ( str = bf.readLine() )){\n\t\t\t\tString[] arr = str.split(\" \");\n\t\t\t\tlong num1 = Long.parseLong(arr[0]);\n\t\t\t\tlong num2 = Long.parseLong(arr[1]);\n\t\t\t\tlong min_num = num1>num2 ? euclidean( num1, num2) : euclidean(num2, num1);\n\t\t\t\tlong max_num = ( num1 / min_num ) * ( num2 / min_num ) * min_num;\n\t\t\t\tSystem.out.println(min_num + \" \" + max_num);\n\t\t\t}\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t} finally {\n\t\t\ttry {\n\t\t\t\tbf.close();\n\t\t\t} catch (IOException e) {\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate static long euclidean(long num1, long num2){\n\t\tif(num2 == 0){\n\t\t\treturn num1;\n\t\t}\n\t\tlong tmp_num = num1 % num2;\n\t\treturn euclidean(num2, tmp_num);\n\t}\n}",
"Main"
] | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class Main {
public static void main(String[] a){
String str;
BufferedReader bf = new BufferedReader(new InputStreamReader(System.in));
try {
while(null != ( str = bf.readLine() )){
String[] arr = str.split(" ");
long num1 = Long.parseLong(arr[0]);
long num2 = Long.parseLong(arr[1]);
long min_num = num1>num2 ? euclidean( num1, num2) : euclidean(num2, num1);
long max_num = ( num1 / min_num ) * ( num2 / min_num ) * min_num;
System.out.println(min_num + " " + max_num);
}
} catch (IOException e) {
e.printStackTrace();
} finally {
try {
bf.close();
} catch (IOException e) {
}
}
}
private static long euclidean(long num1, long num2){
if(num2 == 0){
return num1;
}
long tmp_num = num1 % num2;
return euclidean(num2, tmp_num);
}
} |
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
42,
4,
18,
13,
30,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
4,
18,
18,
13,
13,
2,
2,
4,
13,
13,
13,
17,
2,
2,
13,
4,
13,
13,
13,
13,
23,
13,
12,
13,
30,
14,
2,
13,
17,
29,
13,
29,
4,
13,
13,
2,
13,
13,
23,
13,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
70,
5
],
[
70,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
13,
14
],
[
14,
15
],
[
12,
16
],
[
16,
17
],
[
17,
18
],
[
17,
19
],
[
19,
20
],
[
20,
21
],
[
16,
22
],
[
22,
23
],
[
22,
24
],
[
24,
25
],
[
25,
26
],
[
16,
27
],
[
27,
28
],
[
28,
29
],
[
29,
30
],
[
29,
31
],
[
27,
32
],
[
33,
33
],
[
33,
34
],
[
34,
35
],
[
34,
36
],
[
34,
37
],
[
33,
38
],
[
33,
39
],
[
39,
40
],
[
40,
41
],
[
40,
42
],
[
42,
43
],
[
42,
44
],
[
42,
45
],
[
39,
46
],
[
6,
47
],
[
47,
48
],
[
70,
49
],
[
49,
50
],
[
49,
51
],
[
51,
52
],
[
52,
53
],
[
53,
54
],
[
53,
55
],
[
52,
56
],
[
56,
57
],
[
52,
58
],
[
58,
59
],
[
59,
60
],
[
59,
61
],
[
59,
62
],
[
62,
63
],
[
62,
64
],
[
49,
65
],
[
65,
66
],
[
49,
67
],
[
67,
68
],
[
0,
69
],
[
69,
70
],
[
69,
71
]
] | [
"import java.util.*;\npublic class Main {\n\tpublic static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t while(sc.hasNext()){\n\t \tlong a=sc.nextLong();\n\t \tlong b=sc.nextLong();\n\t System.out.println(gcd(a,b)+\" \"+a/gcd(a,b)*b);\n\t }\n\t}\n\tpublic static long gcd(long a,long b){\n\t\tif(b==0)return a;\n\t\telse return gcd(b,a%b);\n\t} \n}\n//by TTTMongolia 11/05/2012",
"import java.util.*;",
"util.*",
"java",
"public class Main {\n\tpublic static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t while(sc.hasNext()){\n\t \tlong a=sc.nextLong();\n\t \tlong b=sc.nextLong();\n\t System.out.println(gcd(a,b)+\" \"+a/gcd(a,b)*b);\n\t }\n\t}\n\tpublic static long gcd(long a,long b){\n\t\tif(b==0)return a;\n\t\telse return gcd(b,a%b);\n\t} \n}",
"Main",
"public static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t while(sc.hasNext()){\n\t \tlong a=sc.nextLong();\n\t \tlong b=sc.nextLong();\n\t System.out.println(gcd(a,b)+\" \"+a/gcd(a,b)*b);\n\t }\n\t}",
"main",
"{\n\t\tScanner sc = new Scanner(System.in);\n\t while(sc.hasNext()){\n\t \tlong a=sc.nextLong();\n\t \tlong b=sc.nextLong();\n\t System.out.println(gcd(a,b)+\" \"+a/gcd(a,b)*b);\n\t }\n\t}",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"while(sc.hasNext()){\n\t \tlong a=sc.nextLong();\n\t \tlong b=sc.nextLong();\n\t System.out.println(gcd(a,b)+\" \"+a/gcd(a,b)*b);\n\t }",
"sc.hasNext()",
"sc.hasNext",
"sc",
"{\n\t \tlong a=sc.nextLong();\n\t \tlong b=sc.nextLong();\n\t System.out.println(gcd(a,b)+\" \"+a/gcd(a,b)*b);\n\t }",
"long a=sc.nextLong();",
"a",
"sc.nextLong()",
"sc.nextLong",
"sc",
"long b=sc.nextLong();",
"b",
"sc.nextLong()",
"sc.nextLong",
"sc",
"System.out.println(gcd(a,b)+\" \"+a/gcd(a,b)*b)",
"System.out.println",
"System.out",
"System",
"System.out",
"gcd(a,b)+\" \"+a/gcd(a,b)*b",
"gcd(a,b)+\" \"+a/gcd(a,b)*b",
"gcd(a,b)",
"gcd",
"a",
"b",
"\" \"",
"a/gcd(a,b)*b",
"a/gcd(a,b)",
"a",
"gcd(a,b)",
"gcd",
"a",
"b",
"b",
"String[] args",
"args",
"public static long gcd(long a,long b){\n\t\tif(b==0)return a;\n\t\telse return gcd(b,a%b);\n\t}",
"gcd",
"{\n\t\tif(b==0)return a;\n\t\telse return gcd(b,a%b);\n\t}",
"if(b==0)return a;\n\t\telse return gcd(b,a%b);",
"b==0",
"b",
"0",
"return a;",
"a",
"return gcd(b,a%b);",
"gcd(b,a%b)",
"gcd",
"b",
"a%b",
"a",
"b",
"long a",
"a",
"long b",
"b",
"public class Main {\n\tpublic static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t while(sc.hasNext()){\n\t \tlong a=sc.nextLong();\n\t \tlong b=sc.nextLong();\n\t System.out.println(gcd(a,b)+\" \"+a/gcd(a,b)*b);\n\t }\n\t}\n\tpublic static long gcd(long a,long b){\n\t\tif(b==0)return a;\n\t\telse return gcd(b,a%b);\n\t} \n}",
"public class Main {\n\tpublic static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t while(sc.hasNext()){\n\t \tlong a=sc.nextLong();\n\t \tlong b=sc.nextLong();\n\t System.out.println(gcd(a,b)+\" \"+a/gcd(a,b)*b);\n\t }\n\t}\n\tpublic static long gcd(long a,long b){\n\t\tif(b==0)return a;\n\t\telse return gcd(b,a%b);\n\t} \n}",
"Main"
] | import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
while(sc.hasNext()){
long a=sc.nextLong();
long b=sc.nextLong();
System.out.println(gcd(a,b)+" "+a/gcd(a,b)*b);
}
}
public static long gcd(long a,long b){
if(b==0)return a;
else return gcd(b,a%b);
}
}
//by TTTMongolia 11/05/2012 |
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
18,
13,
13,
41,
13,
18,
13,
13,
41,
13,
20,
41,
13,
20,
41,
13,
20,
4,
18,
13,
17,
13,
13,
4,
18,
13,
23,
13,
6,
13,
12,
13,
30,
42,
4,
18,
13,
30,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
41,
13,
4,
13,
13,
13,
41,
13,
2,
13,
13,
41,
13,
2,
13,
13,
4,
18,
13,
17,
13,
13,
23,
13,
23,
13,
23,
13,
12,
13,
30,
42,
2,
13,
17,
30,
41,
13,
2,
13,
13,
0,
13,
13,
0,
13,
13,
29,
13,
23,
13,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
10,
11
],
[
10,
12
],
[
0,
13
],
[
13,
14
],
[
13,
15
],
[
0,
16
],
[
125,
17
],
[
125,
18
],
[
18,
19
],
[
18,
20
],
[
20,
21
],
[
21,
22
],
[
21,
23
],
[
23,
24
],
[
23,
25
],
[
20,
26
],
[
26,
27
],
[
26,
28
],
[
28,
29
],
[
28,
30
],
[
20,
31
],
[
31,
32
],
[
31,
33
],
[
20,
34
],
[
34,
35
],
[
34,
36
],
[
20,
37
],
[
37,
38
],
[
37,
39
],
[
20,
40
],
[
40,
41
],
[
41,
42
],
[
40,
43
],
[
40,
44
],
[
40,
45
],
[
20,
46
],
[
46,
47
],
[
47,
48
],
[
18,
49
],
[
49,
50
],
[
125,
51
],
[
51,
52
],
[
51,
53
],
[
53,
54
],
[
53,
55
],
[
55,
56
],
[
56,
57
],
[
57,
58
],
[
58,
59
],
[
56,
60
],
[
60,
61
],
[
61,
62
],
[
61,
63
],
[
63,
64
],
[
64,
65
],
[
60,
66
],
[
66,
67
],
[
66,
68
],
[
68,
69
],
[
69,
70
],
[
60,
71
],
[
71,
72
],
[
71,
73
],
[
73,
74
],
[
73,
75
],
[
73,
76
],
[
60,
77
],
[
77,
78
],
[
77,
79
],
[
79,
80
],
[
79,
81
],
[
60,
82
],
[
82,
83
],
[
82,
84
],
[
84,
85
],
[
84,
86
],
[
60,
87
],
[
87,
88
],
[
88,
89
],
[
87,
90
],
[
87,
91
],
[
87,
92
],
[
53,
93
],
[
93,
94
],
[
53,
95
],
[
95,
96
],
[
53,
97
],
[
97,
98
],
[
51,
99
],
[
99,
100
],
[
99,
101
],
[
101,
102
],
[
102,
103
],
[
103,
104
],
[
103,
105
],
[
102,
106
],
[
106,
107
],
[
107,
108
],
[
107,
109
],
[
109,
110
],
[
109,
111
],
[
106,
112
],
[
112,
113
],
[
112,
114
],
[
106,
115
],
[
115,
116
],
[
115,
117
],
[
101,
118
],
[
118,
119
],
[
99,
120
],
[
120,
121
],
[
99,
122
],
[
122,
123
],
[
0,
124
],
[
124,
125
],
[
124,
126
]
] | [
"import java.io.OutputStream;\nimport java.io.IOException;\nimport java.io.InputStream;\nimport java.io.PrintWriter;\nimport java.util.Scanner;\n\n/**\n * Built using CHelper plug-in\n * Actual solution is at the top\n */\npublic class Main {\n public static void main(String[] args) {\n InputStream inputStream = System.in;\n OutputStream outputStream = System.out;\n Scanner in = new Scanner(inputStream);\n PrintWriter out = new PrintWriter(outputStream);\n AizuGCDLCM solver = new AizuGCDLCM();\n solver.solve(1, in, out);\n out.close();\n }\n\n static class AizuGCDLCM {\n public void solve(int testNumber, Scanner in, PrintWriter out) {\n while (in.hasNext()) {\n int x = in.nextInt();\n int y = in.nextInt();\n\n int g = gcd(x, y);\n long p = (long) x * y;\n long l = p / g;\n\n out.printf(\"%d %d\\n\", g, l);\n }\n }\n\n private int gcd(int x, int y) {\n while (y != 0) {\n int t = x % y;\n x = y;\n y = t;\n }\n\n return x;\n }\n\n }\n}\n\n",
"import java.io.OutputStream;",
"OutputStream",
"java.io",
"import java.io.IOException;",
"IOException",
"java.io",
"import java.io.InputStream;",
"InputStream",
"java.io",
"import java.io.PrintWriter;",
"PrintWriter",
"java.io",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n public static void main(String[] args) {\n InputStream inputStream = System.in;\n OutputStream outputStream = System.out;\n Scanner in = new Scanner(inputStream);\n PrintWriter out = new PrintWriter(outputStream);\n AizuGCDLCM solver = new AizuGCDLCM();\n solver.solve(1, in, out);\n out.close();\n }\n\n static class AizuGCDLCM {\n public void solve(int testNumber, Scanner in, PrintWriter out) {\n while (in.hasNext()) {\n int x = in.nextInt();\n int y = in.nextInt();\n\n int g = gcd(x, y);\n long p = (long) x * y;\n long l = p / g;\n\n out.printf(\"%d %d\\n\", g, l);\n }\n }\n\n private int gcd(int x, int y) {\n while (y != 0) {\n int t = x % y;\n x = y;\n y = t;\n }\n\n return x;\n }\n\n }\n}",
"Main",
"public static void main(String[] args) {\n InputStream inputStream = System.in;\n OutputStream outputStream = System.out;\n Scanner in = new Scanner(inputStream);\n PrintWriter out = new PrintWriter(outputStream);\n AizuGCDLCM solver = new AizuGCDLCM();\n solver.solve(1, in, out);\n out.close();\n }",
"main",
"{\n InputStream inputStream = System.in;\n OutputStream outputStream = System.out;\n Scanner in = new Scanner(inputStream);\n PrintWriter out = new PrintWriter(outputStream);\n AizuGCDLCM solver = new AizuGCDLCM();\n solver.solve(1, in, out);\n out.close();\n }",
"InputStream inputStream = System.in;",
"inputStream",
"System.in",
"System",
"System.in",
"OutputStream outputStream = System.out;",
"outputStream",
"System.out",
"System",
"System.out",
"Scanner in = new Scanner(inputStream);",
"in",
"new Scanner(inputStream)",
"PrintWriter out = new PrintWriter(outputStream);",
"out",
"new PrintWriter(outputStream)",
"AizuGCDLCM solver = new AizuGCDLCM();",
"solver",
"new AizuGCDLCM()",
"solver.solve(1, in, out)",
"solver.solve",
"solver",
"1",
"in",
"out",
"out.close()",
"out.close",
"out",
"String[] args",
"args",
"static class AizuGCDLCM {\n public void solve(int testNumber, Scanner in, PrintWriter out) {\n while (in.hasNext()) {\n int x = in.nextInt();\n int y = in.nextInt();\n\n int g = gcd(x, y);\n long p = (long) x * y;\n long l = p / g;\n\n out.printf(\"%d %d\\n\", g, l);\n }\n }\n\n private int gcd(int x, int y) {\n while (y != 0) {\n int t = x % y;\n x = y;\n y = t;\n }\n\n return x;\n }\n\n }",
"AizuGCDLCM",
"public void solve(int testNumber, Scanner in, PrintWriter out) {\n while (in.hasNext()) {\n int x = in.nextInt();\n int y = in.nextInt();\n\n int g = gcd(x, y);\n long p = (long) x * y;\n long l = p / g;\n\n out.printf(\"%d %d\\n\", g, l);\n }\n }",
"solve",
"{\n while (in.hasNext()) {\n int x = in.nextInt();\n int y = in.nextInt();\n\n int g = gcd(x, y);\n long p = (long) x * y;\n long l = p / g;\n\n out.printf(\"%d %d\\n\", g, l);\n }\n }",
"while (in.hasNext()) {\n int x = in.nextInt();\n int y = in.nextInt();\n\n int g = gcd(x, y);\n long p = (long) x * y;\n long l = p / g;\n\n out.printf(\"%d %d\\n\", g, l);\n }",
"in.hasNext()",
"in.hasNext",
"in",
"{\n int x = in.nextInt();\n int y = in.nextInt();\n\n int g = gcd(x, y);\n long p = (long) x * y;\n long l = p / g;\n\n out.printf(\"%d %d\\n\", g, l);\n }",
"int x = in.nextInt();",
"x",
"in.nextInt()",
"in.nextInt",
"in",
"int y = in.nextInt();",
"y",
"in.nextInt()",
"in.nextInt",
"in",
"int g = gcd(x, y);",
"g",
"gcd(x, y)",
"gcd",
"x",
"y",
"long p = (long) x * y;",
"p",
"(long) x * y",
"(long) x",
"y",
"long l = p / g;",
"l",
"p / g",
"p",
"g",
"out.printf(\"%d %d\\n\", g, l)",
"out.printf",
"out",
"\"%d %d\\n\"",
"g",
"l",
"int testNumber",
"testNumber",
"Scanner in",
"in",
"PrintWriter out",
"out",
"private int gcd(int x, int y) {\n while (y != 0) {\n int t = x % y;\n x = y;\n y = t;\n }\n\n return x;\n }",
"gcd",
"{\n while (y != 0) {\n int t = x % y;\n x = y;\n y = t;\n }\n\n return x;\n }",
"while (y != 0) {\n int t = x % y;\n x = y;\n y = t;\n }",
"y != 0",
"y",
"0",
"{\n int t = x % y;\n x = y;\n y = t;\n }",
"int t = x % y;",
"t",
"x % y",
"x",
"y",
"x = y",
"x",
"y",
"y = t",
"y",
"t",
"return x;",
"x",
"int x",
"x",
"int y",
"y",
"public class Main {\n public static void main(String[] args) {\n InputStream inputStream = System.in;\n OutputStream outputStream = System.out;\n Scanner in = new Scanner(inputStream);\n PrintWriter out = new PrintWriter(outputStream);\n AizuGCDLCM solver = new AizuGCDLCM();\n solver.solve(1, in, out);\n out.close();\n }\n\n static class AizuGCDLCM {\n public void solve(int testNumber, Scanner in, PrintWriter out) {\n while (in.hasNext()) {\n int x = in.nextInt();\n int y = in.nextInt();\n\n int g = gcd(x, y);\n long p = (long) x * y;\n long l = p / g;\n\n out.printf(\"%d %d\\n\", g, l);\n }\n }\n\n private int gcd(int x, int y) {\n while (y != 0) {\n int t = x % y;\n x = y;\n y = t;\n }\n\n return x;\n }\n\n }\n}",
"public class Main {\n public static void main(String[] args) {\n InputStream inputStream = System.in;\n OutputStream outputStream = System.out;\n Scanner in = new Scanner(inputStream);\n PrintWriter out = new PrintWriter(outputStream);\n AizuGCDLCM solver = new AizuGCDLCM();\n solver.solve(1, in, out);\n out.close();\n }\n\n static class AizuGCDLCM {\n public void solve(int testNumber, Scanner in, PrintWriter out) {\n while (in.hasNext()) {\n int x = in.nextInt();\n int y = in.nextInt();\n\n int g = gcd(x, y);\n long p = (long) x * y;\n long l = p / g;\n\n out.printf(\"%d %d\\n\", g, l);\n }\n }\n\n private int gcd(int x, int y) {\n while (y != 0) {\n int t = x % y;\n x = y;\n y = t;\n }\n\n return x;\n }\n\n }\n}",
"Main"
] | import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Scanner;
/**
* Built using CHelper plug-in
* Actual solution is at the top
*/
public class Main {
public static void main(String[] args) {
InputStream inputStream = System.in;
OutputStream outputStream = System.out;
Scanner in = new Scanner(inputStream);
PrintWriter out = new PrintWriter(outputStream);
AizuGCDLCM solver = new AizuGCDLCM();
solver.solve(1, in, out);
out.close();
}
static class AizuGCDLCM {
public void solve(int testNumber, Scanner in, PrintWriter out) {
while (in.hasNext()) {
int x = in.nextInt();
int y = in.nextInt();
int g = gcd(x, y);
long p = (long) x * y;
long l = p / g;
out.printf("%d %d\n", g, l);
}
}
private int gcd(int x, int y) {
while (y != 0) {
int t = x % y;
x = y;
y = t;
}
return x;
}
}
}
|
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
42,
17,
30,
38,
5,
13,
30,
3,
30,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
41,
13,
13,
41,
13,
13,
42,
17,
30,
41,
13,
2,
13,
13,
14,
2,
13,
17,
3,
0,
13,
13,
0,
13,
13,
4,
18,
18,
13,
13,
2,
4,
18,
13,
13,
17,
4,
18,
18,
13,
13,
4,
18,
13,
2,
2,
13,
13,
13,
23,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
16,
17
],
[
16,
18
],
[
18,
19
],
[
15,
20
],
[
20,
21
],
[
21,
22
],
[
21,
23
],
[
23,
24
],
[
24,
25
],
[
20,
26
],
[
26,
27
],
[
26,
28
],
[
28,
29
],
[
29,
30
],
[
20,
31
],
[
31,
32
],
[
31,
33
],
[
20,
34
],
[
34,
35
],
[
34,
36
],
[
20,
37
],
[
37,
38
],
[
37,
39
],
[
39,
40
],
[
40,
41
],
[
40,
42
],
[
42,
43
],
[
42,
44
],
[
39,
45
],
[
45,
46
],
[
46,
47
],
[
46,
48
],
[
45,
49
],
[
39,
50
],
[
50,
51
],
[
50,
52
],
[
39,
53
],
[
53,
54
],
[
53,
55
],
[
20,
56
],
[
56,
57
],
[
57,
58
],
[
58,
59
],
[
58,
60
],
[
56,
61
],
[
61,
62
],
[
62,
63
],
[
63,
64
],
[
62,
65
],
[
61,
66
],
[
20,
67
],
[
67,
68
],
[
68,
69
],
[
69,
70
],
[
69,
71
],
[
67,
72
],
[
72,
73
],
[
73,
74
],
[
72,
75
],
[
75,
76
],
[
76,
77
],
[
76,
78
],
[
75,
79
],
[
6,
80
],
[
80,
81
]
] | [
"import java.util.Scanner;\n\nclass Main\n{\n\tpublic static void main(String args[])\n\t{\n\t\tScanner sc = new Scanner(System.in);\n\t\twhile(true)\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\tlong a = sc.nextInt();\n\t\t\t\tlong b = sc.nextInt();\n\t\t\t\t\n\t\t\t\tlong n = a;\n\t\t\t\tlong m = b;\n\t\t\t\twhile (true)\n\t\t\t\t{\n\t\t\t\t\tlong k = m % n;\n\t\t\t\t\tif (k == 0) break;\n\t\t\t\t\tm = n;\n\t\t\t\t\tn = k;\n\t\t\t\t}\n\t\t\t\tSystem.out.print(Long.toString(n) + \" \");\n\t\t\t\tSystem.out.println(Long.toString(a * b / n));\n\t\t\t}\n\t\t\tcatch (Exception e)\n\t\t\t{\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"class Main\n{\n\tpublic static void main(String args[])\n\t{\n\t\tScanner sc = new Scanner(System.in);\n\t\twhile(true)\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\tlong a = sc.nextInt();\n\t\t\t\tlong b = sc.nextInt();\n\t\t\t\t\n\t\t\t\tlong n = a;\n\t\t\t\tlong m = b;\n\t\t\t\twhile (true)\n\t\t\t\t{\n\t\t\t\t\tlong k = m % n;\n\t\t\t\t\tif (k == 0) break;\n\t\t\t\t\tm = n;\n\t\t\t\t\tn = k;\n\t\t\t\t}\n\t\t\t\tSystem.out.print(Long.toString(n) + \" \");\n\t\t\t\tSystem.out.println(Long.toString(a * b / n));\n\t\t\t}\n\t\t\tcatch (Exception e)\n\t\t\t{\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n}",
"Main",
"public static void main(String args[])\n\t{\n\t\tScanner sc = new Scanner(System.in);\n\t\twhile(true)\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\tlong a = sc.nextInt();\n\t\t\t\tlong b = sc.nextInt();\n\t\t\t\t\n\t\t\t\tlong n = a;\n\t\t\t\tlong m = b;\n\t\t\t\twhile (true)\n\t\t\t\t{\n\t\t\t\t\tlong k = m % n;\n\t\t\t\t\tif (k == 0) break;\n\t\t\t\t\tm = n;\n\t\t\t\t\tn = k;\n\t\t\t\t}\n\t\t\t\tSystem.out.print(Long.toString(n) + \" \");\n\t\t\t\tSystem.out.println(Long.toString(a * b / n));\n\t\t\t}\n\t\t\tcatch (Exception e)\n\t\t\t{\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}",
"main",
"{\n\t\tScanner sc = new Scanner(System.in);\n\t\twhile(true)\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\tlong a = sc.nextInt();\n\t\t\t\tlong b = sc.nextInt();\n\t\t\t\t\n\t\t\t\tlong n = a;\n\t\t\t\tlong m = b;\n\t\t\t\twhile (true)\n\t\t\t\t{\n\t\t\t\t\tlong k = m % n;\n\t\t\t\t\tif (k == 0) break;\n\t\t\t\t\tm = n;\n\t\t\t\t\tn = k;\n\t\t\t\t}\n\t\t\t\tSystem.out.print(Long.toString(n) + \" \");\n\t\t\t\tSystem.out.println(Long.toString(a * b / n));\n\t\t\t}\n\t\t\tcatch (Exception e)\n\t\t\t{\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"while(true)\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\tlong a = sc.nextInt();\n\t\t\t\tlong b = sc.nextInt();\n\t\t\t\t\n\t\t\t\tlong n = a;\n\t\t\t\tlong m = b;\n\t\t\t\twhile (true)\n\t\t\t\t{\n\t\t\t\t\tlong k = m % n;\n\t\t\t\t\tif (k == 0) break;\n\t\t\t\t\tm = n;\n\t\t\t\t\tn = k;\n\t\t\t\t}\n\t\t\t\tSystem.out.print(Long.toString(n) + \" \");\n\t\t\t\tSystem.out.println(Long.toString(a * b / n));\n\t\t\t}\n\t\t\tcatch (Exception e)\n\t\t\t{\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}",
"true",
"{\n\t\t\ttry\n\t\t\t{\n\t\t\t\tlong a = sc.nextInt();\n\t\t\t\tlong b = sc.nextInt();\n\t\t\t\t\n\t\t\t\tlong n = a;\n\t\t\t\tlong m = b;\n\t\t\t\twhile (true)\n\t\t\t\t{\n\t\t\t\t\tlong k = m % n;\n\t\t\t\t\tif (k == 0) break;\n\t\t\t\t\tm = n;\n\t\t\t\t\tn = k;\n\t\t\t\t}\n\t\t\t\tSystem.out.print(Long.toString(n) + \" \");\n\t\t\t\tSystem.out.println(Long.toString(a * b / n));\n\t\t\t}\n\t\t\tcatch (Exception e)\n\t\t\t{\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}",
"try\n\t\t\t{\n\t\t\t\tlong a = sc.nextInt();\n\t\t\t\tlong b = sc.nextInt();\n\t\t\t\t\n\t\t\t\tlong n = a;\n\t\t\t\tlong m = b;\n\t\t\t\twhile (true)\n\t\t\t\t{\n\t\t\t\t\tlong k = m % n;\n\t\t\t\t\tif (k == 0) break;\n\t\t\t\t\tm = n;\n\t\t\t\t\tn = k;\n\t\t\t\t}\n\t\t\t\tSystem.out.print(Long.toString(n) + \" \");\n\t\t\t\tSystem.out.println(Long.toString(a * b / n));\n\t\t\t}\n\t\t\tcatch (Exception e)\n\t\t\t{\n\t\t\t\tbreak;\n\t\t\t}",
"catch (Exception e)\n\t\t\t{\n\t\t\t\tbreak;\n\t\t\t}",
"Exception e",
"{\n\t\t\t\tbreak;\n\t\t\t}",
"break;",
"{\n\t\t\t\tlong a = sc.nextInt();\n\t\t\t\tlong b = sc.nextInt();\n\t\t\t\t\n\t\t\t\tlong n = a;\n\t\t\t\tlong m = b;\n\t\t\t\twhile (true)\n\t\t\t\t{\n\t\t\t\t\tlong k = m % n;\n\t\t\t\t\tif (k == 0) break;\n\t\t\t\t\tm = n;\n\t\t\t\t\tn = k;\n\t\t\t\t}\n\t\t\t\tSystem.out.print(Long.toString(n) + \" \");\n\t\t\t\tSystem.out.println(Long.toString(a * b / n));\n\t\t\t}",
"long a = sc.nextInt();",
"a",
"sc.nextInt()",
"sc.nextInt",
"sc",
"long b = sc.nextInt();",
"b",
"sc.nextInt()",
"sc.nextInt",
"sc",
"long n = a;",
"n",
"a",
"long m = b;",
"m",
"b",
"while (true)\n\t\t\t\t{\n\t\t\t\t\tlong k = m % n;\n\t\t\t\t\tif (k == 0) break;\n\t\t\t\t\tm = n;\n\t\t\t\t\tn = k;\n\t\t\t\t}",
"true",
"{\n\t\t\t\t\tlong k = m % n;\n\t\t\t\t\tif (k == 0) break;\n\t\t\t\t\tm = n;\n\t\t\t\t\tn = k;\n\t\t\t\t}",
"long k = m % n;",
"k",
"m % n",
"m",
"n",
"if (k == 0) break;",
"k == 0",
"k",
"0",
"break;",
"m = n",
"m",
"n",
"n = k",
"n",
"k",
"System.out.print(Long.toString(n) + \" \")",
"System.out.print",
"System.out",
"System",
"System.out",
"Long.toString(n) + \" \"",
"Long.toString(n)",
"Long.toString",
"Long",
"n",
"\" \"",
"System.out.println(Long.toString(a * b / n))",
"System.out.println",
"System.out",
"System",
"System.out",
"Long.toString(a * b / n)",
"Long.toString",
"Long",
"a * b / n",
"a * b",
"a",
"b",
"n",
"String args[]",
"args"
] | import java.util.Scanner;
class Main
{
public static void main(String args[])
{
Scanner sc = new Scanner(System.in);
while(true)
{
try
{
long a = sc.nextInt();
long b = sc.nextInt();
long n = a;
long m = b;
while (true)
{
long k = m % n;
if (k == 0) break;
m = n;
n = k;
}
System.out.print(Long.toString(n) + " ");
System.out.println(Long.toString(a * b / n));
}
catch (Exception e)
{
break;
}
}
}
} |
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
41,
13,
42,
4,
18,
13,
30,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
0,
13,
4,
18,
13,
13,
13,
0,
13,
4,
18,
13,
13,
13,
11,
1,
30,
30,
0,
13,
2,
13,
13,
14,
2,
13,
17,
3,
41,
13,
13,
0,
13,
13,
0,
13,
13,
4,
18,
18,
13,
13,
2,
2,
13,
17,
2,
2,
13,
13,
13,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
85,
5
],
[
85,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
8,
14
],
[
14,
15
],
[
8,
16
],
[
16,
17
],
[
17,
18
],
[
18,
19
],
[
16,
20
],
[
20,
21
],
[
21,
22
],
[
21,
23
],
[
23,
24
],
[
24,
25
],
[
20,
26
],
[
26,
27
],
[
26,
28
],
[
28,
29
],
[
29,
30
],
[
20,
31
],
[
31,
32
],
[
31,
33
],
[
33,
34
],
[
34,
35
],
[
33,
36
],
[
33,
37
],
[
20,
38
],
[
38,
39
],
[
38,
40
],
[
40,
41
],
[
41,
42
],
[
40,
43
],
[
40,
44
],
[
20,
45
],
[
45,
46
],
[
45,
47
],
[
48,
48
],
[
48,
49
],
[
49,
50
],
[
49,
51
],
[
51,
52
],
[
51,
53
],
[
48,
54
],
[
54,
55
],
[
55,
56
],
[
55,
57
],
[
54,
58
],
[
48,
59
],
[
59,
60
],
[
59,
61
],
[
48,
62
],
[
62,
63
],
[
62,
64
],
[
48,
65
],
[
65,
66
],
[
65,
67
],
[
20,
68
],
[
68,
69
],
[
69,
70
],
[
70,
71
],
[
70,
72
],
[
68,
73
],
[
74,
74
],
[
74,
75
],
[
74,
76
],
[
74,
77
],
[
77,
78
],
[
78,
79
],
[
78,
80
],
[
77,
81
],
[
6,
82
],
[
82,
83
],
[
0,
84
],
[
84,
85
],
[
84,
86
]
] | [
"import java.util.*;\n\npublic class Main{\n public static void main(String[] args) {\n\t Scanner sc =new Scanner(System.in);\nint a,b;\nwhile(sc.hasNext()){\nint n1=sc.nextInt();\nint n2=sc.nextInt();\na=Math.max(n1,n2);\nb=Math.min(n1,n2);\nfor(;;){\na =a%b;\nif(a==0)break;\nint temp=b;\nb=a;\na=temp;\n}\nSystem.out.println(b+\" \"+(long)n1*n2/b);\n }\n }\n}",
"import java.util.*;",
"util.*",
"java",
"public class Main{\n public static void main(String[] args) {\n\t Scanner sc =new Scanner(System.in);\nint a,b;\nwhile(sc.hasNext()){\nint n1=sc.nextInt();\nint n2=sc.nextInt();\na=Math.max(n1,n2);\nb=Math.min(n1,n2);\nfor(;;){\na =a%b;\nif(a==0)break;\nint temp=b;\nb=a;\na=temp;\n}\nSystem.out.println(b+\" \"+(long)n1*n2/b);\n }\n }\n}",
"Main",
"public static void main(String[] args) {\n\t Scanner sc =new Scanner(System.in);\nint a,b;\nwhile(sc.hasNext()){\nint n1=sc.nextInt();\nint n2=sc.nextInt();\na=Math.max(n1,n2);\nb=Math.min(n1,n2);\nfor(;;){\na =a%b;\nif(a==0)break;\nint temp=b;\nb=a;\na=temp;\n}\nSystem.out.println(b+\" \"+(long)n1*n2/b);\n }\n }",
"main",
"{\n\t Scanner sc =new Scanner(System.in);\nint a,b;\nwhile(sc.hasNext()){\nint n1=sc.nextInt();\nint n2=sc.nextInt();\na=Math.max(n1,n2);\nb=Math.min(n1,n2);\nfor(;;){\na =a%b;\nif(a==0)break;\nint temp=b;\nb=a;\na=temp;\n}\nSystem.out.println(b+\" \"+(long)n1*n2/b);\n }\n }",
"Scanner sc =new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"int a",
"a",
"b;",
"b",
"while(sc.hasNext()){\nint n1=sc.nextInt();\nint n2=sc.nextInt();\na=Math.max(n1,n2);\nb=Math.min(n1,n2);\nfor(;;){\na =a%b;\nif(a==0)break;\nint temp=b;\nb=a;\na=temp;\n}\nSystem.out.println(b+\" \"+(long)n1*n2/b);\n }",
"sc.hasNext()",
"sc.hasNext",
"sc",
"{\nint n1=sc.nextInt();\nint n2=sc.nextInt();\na=Math.max(n1,n2);\nb=Math.min(n1,n2);\nfor(;;){\na =a%b;\nif(a==0)break;\nint temp=b;\nb=a;\na=temp;\n}\nSystem.out.println(b+\" \"+(long)n1*n2/b);\n }",
"int n1=sc.nextInt();",
"n1",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int n2=sc.nextInt();",
"n2",
"sc.nextInt()",
"sc.nextInt",
"sc",
"a=Math.max(n1,n2)",
"a",
"Math.max(n1,n2)",
"Math.max",
"Math",
"n1",
"n2",
"b=Math.min(n1,n2)",
"b",
"Math.min(n1,n2)",
"Math.min",
"Math",
"n1",
"n2",
"for(;;){\na =a%b;\nif(a==0)break;\nint temp=b;\nb=a;\na=temp;\n}",
";",
"{\na =a%b;\nif(a==0)break;\nint temp=b;\nb=a;\na=temp;\n}",
"{\na =a%b;\nif(a==0)break;\nint temp=b;\nb=a;\na=temp;\n}",
"a =a%b",
"a",
"a%b",
"a",
"b",
"if(a==0)break;",
"a==0",
"a",
"0",
"break;",
"int temp=b;",
"temp",
"b",
"b=a",
"b",
"a",
"a=temp",
"a",
"temp",
"System.out.println(b+\" \"+(long)n1*n2/b)",
"System.out.println",
"System.out",
"System",
"System.out",
"b+\" \"+(long)n1*n2/b",
"b+\" \"+(long)n1*n2/b",
"b",
"\" \"",
"(long)n1*n2/b",
"(long)n1*n2",
"(long)n1",
"n2",
"b",
"String[] args",
"args",
"public class Main{\n public static void main(String[] args) {\n\t Scanner sc =new Scanner(System.in);\nint a,b;\nwhile(sc.hasNext()){\nint n1=sc.nextInt();\nint n2=sc.nextInt();\na=Math.max(n1,n2);\nb=Math.min(n1,n2);\nfor(;;){\na =a%b;\nif(a==0)break;\nint temp=b;\nb=a;\na=temp;\n}\nSystem.out.println(b+\" \"+(long)n1*n2/b);\n }\n }\n}",
"public class Main{\n public static void main(String[] args) {\n\t Scanner sc =new Scanner(System.in);\nint a,b;\nwhile(sc.hasNext()){\nint n1=sc.nextInt();\nint n2=sc.nextInt();\na=Math.max(n1,n2);\nb=Math.min(n1,n2);\nfor(;;){\na =a%b;\nif(a==0)break;\nint temp=b;\nb=a;\na=temp;\n}\nSystem.out.println(b+\" \"+(long)n1*n2/b);\n }\n }\n}",
"Main"
] | import java.util.*;
public class Main{
public static void main(String[] args) {
Scanner sc =new Scanner(System.in);
int a,b;
while(sc.hasNext()){
int n1=sc.nextInt();
int n2=sc.nextInt();
a=Math.max(n1,n2);
b=Math.min(n1,n2);
for(;;){
a =a%b;
if(a==0)break;
int temp=b;
b=a;
a=temp;
}
System.out.println(b+" "+(long)n1*n2/b);
}
}
} |
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
42,
4,
18,
13,
30,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
4,
18,
18,
13,
13,
2,
2,
4,
13,
13,
13,
17,
4,
13,
13,
13,
4,
18,
13,
23,
13,
12,
13,
30,
14,
2,
13,
13,
30,
41,
13,
13,
0,
13,
13,
0,
13,
13,
42,
2,
13,
17,
30,
41,
13,
2,
13,
13,
0,
13,
13,
0,
13,
13,
29,
13,
23,
13,
23,
13,
12,
13,
30,
41,
13,
13,
41,
13,
13,
42,
2,
13,
13,
30,
14,
2,
13,
13,
30,
0,
13,
13,
30,
0,
13,
13,
29,
13,
23,
13,
23,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
13,
14
],
[
14,
15
],
[
12,
16
],
[
16,
17
],
[
17,
18
],
[
17,
19
],
[
19,
20
],
[
20,
21
],
[
16,
22
],
[
22,
23
],
[
22,
24
],
[
24,
25
],
[
25,
26
],
[
16,
27
],
[
27,
28
],
[
28,
29
],
[
29,
30
],
[
29,
31
],
[
27,
32
],
[
33,
33
],
[
33,
34
],
[
34,
35
],
[
34,
36
],
[
34,
37
],
[
33,
38
],
[
33,
39
],
[
39,
40
],
[
39,
41
],
[
39,
42
],
[
8,
43
],
[
43,
44
],
[
44,
45
],
[
6,
46
],
[
46,
47
],
[
4,
48
],
[
48,
49
],
[
48,
50
],
[
50,
51
],
[
51,
52
],
[
52,
53
],
[
52,
54
],
[
51,
55
],
[
55,
56
],
[
56,
57
],
[
56,
58
],
[
55,
59
],
[
59,
60
],
[
59,
61
],
[
55,
62
],
[
62,
63
],
[
62,
64
],
[
50,
65
],
[
65,
66
],
[
66,
67
],
[
66,
68
],
[
65,
69
],
[
69,
70
],
[
70,
71
],
[
70,
72
],
[
72,
73
],
[
72,
74
],
[
69,
75
],
[
75,
76
],
[
75,
77
],
[
69,
78
],
[
78,
79
],
[
78,
80
],
[
50,
81
],
[
81,
82
],
[
48,
83
],
[
83,
84
],
[
48,
85
],
[
85,
86
],
[
4,
87
],
[
87,
88
],
[
87,
89
],
[
89,
90
],
[
90,
91
],
[
90,
92
],
[
89,
93
],
[
93,
94
],
[
93,
95
],
[
89,
96
],
[
96,
97
],
[
97,
98
],
[
97,
99
],
[
96,
100
],
[
100,
101
],
[
101,
102
],
[
102,
103
],
[
102,
104
],
[
101,
105
],
[
105,
106
],
[
106,
107
],
[
106,
108
],
[
101,
109
],
[
109,
110
],
[
110,
111
],
[
110,
112
],
[
89,
113
],
[
113,
114
],
[
87,
115
],
[
115,
116
],
[
87,
117
],
[
117,
118
]
] | [
"import java.util.*;\n\nclass Main{\n public static void main(String[] args){\n Scanner sc = new Scanner(System.in);\n while(sc.hasNext()){\n int a = sc.nextInt();\n int b = sc.nextInt();\n System.out.println(gcd(a,b) + \" \" + lcm(a,b));\n } \n sc.close();\n } \n static int gcd(int a, int b){\n if(a < b){ \n int tmp = a;\n a = b;\n b = tmp;\n } \n do{ \n int r = a%b;\n a = b;\n b = r;\n }while(b != 0); \n return a;\n } \n static int lcm(int a, int b){\n int _a = a;\n int _b = b;\n while(_a != _b){\n if(_a < _b){\n _a += a;\n }else{\n _b += b;\n } \n } \n return _a; \n } \n}",
"import java.util.*;",
"util.*",
"java",
"class Main{\n public static void main(String[] args){\n Scanner sc = new Scanner(System.in);\n while(sc.hasNext()){\n int a = sc.nextInt();\n int b = sc.nextInt();\n System.out.println(gcd(a,b) + \" \" + lcm(a,b));\n } \n sc.close();\n } \n static int gcd(int a, int b){\n if(a < b){ \n int tmp = a;\n a = b;\n b = tmp;\n } \n do{ \n int r = a%b;\n a = b;\n b = r;\n }while(b != 0); \n return a;\n } \n static int lcm(int a, int b){\n int _a = a;\n int _b = b;\n while(_a != _b){\n if(_a < _b){\n _a += a;\n }else{\n _b += b;\n } \n } \n return _a; \n } \n}",
"Main",
"public static void main(String[] args){\n Scanner sc = new Scanner(System.in);\n while(sc.hasNext()){\n int a = sc.nextInt();\n int b = sc.nextInt();\n System.out.println(gcd(a,b) + \" \" + lcm(a,b));\n } \n sc.close();\n }",
"main",
"{\n Scanner sc = new Scanner(System.in);\n while(sc.hasNext()){\n int a = sc.nextInt();\n int b = sc.nextInt();\n System.out.println(gcd(a,b) + \" \" + lcm(a,b));\n } \n sc.close();\n }",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"while(sc.hasNext()){\n int a = sc.nextInt();\n int b = sc.nextInt();\n System.out.println(gcd(a,b) + \" \" + lcm(a,b));\n }",
"sc.hasNext()",
"sc.hasNext",
"sc",
"{\n int a = sc.nextInt();\n int b = sc.nextInt();\n System.out.println(gcd(a,b) + \" \" + lcm(a,b));\n }",
"int a = sc.nextInt();",
"a",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int b = sc.nextInt();",
"b",
"sc.nextInt()",
"sc.nextInt",
"sc",
"System.out.println(gcd(a,b) + \" \" + lcm(a,b))",
"System.out.println",
"System.out",
"System",
"System.out",
"gcd(a,b) + \" \" + lcm(a,b)",
"gcd(a,b) + \" \" + lcm(a,b)",
"gcd(a,b)",
"gcd",
"a",
"b",
"\" \"",
"lcm(a,b)",
"lcm",
"a",
"b",
"sc.close()",
"sc.close",
"sc",
"String[] args",
"args",
"static int gcd(int a, int b){\n if(a < b){ \n int tmp = a;\n a = b;\n b = tmp;\n } \n do{ \n int r = a%b;\n a = b;\n b = r;\n }while(b != 0); \n return a;\n }",
"gcd",
"{\n if(a < b){ \n int tmp = a;\n a = b;\n b = tmp;\n } \n do{ \n int r = a%b;\n a = b;\n b = r;\n }while(b != 0); \n return a;\n }",
"if(a < b){ \n int tmp = a;\n a = b;\n b = tmp;\n }",
"a < b",
"a",
"b",
"{ \n int tmp = a;\n a = b;\n b = tmp;\n }",
"int tmp = a;",
"tmp",
"a",
"a = b",
"a",
"b",
"b = tmp",
"b",
"tmp",
"do{ \n int r = a%b;\n a = b;\n b = r;\n }while(b != 0);",
"b != 0",
"b",
"0",
"{ \n int r = a%b;\n a = b;\n b = r;\n }",
"int r = a%b;",
"r",
"a%b",
"a",
"b",
"a = b",
"a",
"b",
"b = r",
"b",
"r",
"return a;",
"a",
"int a",
"a",
"int b",
"b",
"static int lcm(int a, int b){\n int _a = a;\n int _b = b;\n while(_a != _b){\n if(_a < _b){\n _a += a;\n }else{\n _b += b;\n } \n } \n return _a; \n }",
"lcm",
"{\n int _a = a;\n int _b = b;\n while(_a != _b){\n if(_a < _b){\n _a += a;\n }else{\n _b += b;\n } \n } \n return _a; \n }",
"int _a = a;",
"_a",
"a",
"int _b = b;",
"_b",
"b",
"while(_a != _b){\n if(_a < _b){\n _a += a;\n }else{\n _b += b;\n } \n }",
"_a != _b",
"_a",
"_b",
"{\n if(_a < _b){\n _a += a;\n }else{\n _b += b;\n } \n }",
"if(_a < _b){\n _a += a;\n }else{\n _b += b;\n }",
"_a < _b",
"_a",
"_b",
"{\n _a += a;\n }",
"_a += a",
"_a",
"a",
"{\n _b += b;\n }",
"_b += b",
"_b",
"b",
"return _a;",
"_a",
"int a",
"a",
"int b",
"b"
] | import java.util.*;
class Main{
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
while(sc.hasNext()){
int a = sc.nextInt();
int b = sc.nextInt();
System.out.println(gcd(a,b) + " " + lcm(a,b));
}
sc.close();
}
static int gcd(int a, int b){
if(a < b){
int tmp = a;
a = b;
b = tmp;
}
do{
int r = a%b;
a = b;
b = r;
}while(b != 0);
return a;
}
static int lcm(int a, int b){
int _a = a;
int _b = b;
while(_a != _b){
if(_a < _b){
_a += a;
}else{
_b += b;
}
}
return _a;
}
} |
[
7,
15,
13,
17,
6,
13,
41,
13,
41,
13,
41,
13,
20,
12,
13,
30,
42,
4,
13,
30,
4,
18,
18,
13,
13,
2,
2,
4,
13,
13,
13,
17,
4,
13,
13,
13,
23,
13,
12,
13,
30,
14,
40,
4,
18,
13,
29,
17,
0,
13,
4,
18,
13,
0,
13,
4,
18,
13,
29,
17,
12,
13,
30,
14,
2,
13,
17,
29,
13,
29,
4,
13,
13,
2,
13,
13,
23,
13,
23,
13,
12,
13,
30,
29,
2,
2,
13,
13,
4,
13,
13,
13,
23,
13,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
97,
5
],
[
97,
6
],
[
6,
7
],
[
97,
8
],
[
8,
9
],
[
97,
10
],
[
10,
11
],
[
10,
12
],
[
97,
13
],
[
13,
14
],
[
13,
15
],
[
15,
16
],
[
16,
17
],
[
17,
18
],
[
16,
19
],
[
19,
20
],
[
20,
21
],
[
21,
22
],
[
22,
23
],
[
22,
24
],
[
20,
25
],
[
26,
26
],
[
26,
27
],
[
27,
28
],
[
27,
29
],
[
27,
30
],
[
26,
31
],
[
26,
32
],
[
32,
33
],
[
32,
34
],
[
32,
35
],
[
13,
36
],
[
36,
37
],
[
97,
38
],
[
38,
39
],
[
38,
40
],
[
40,
41
],
[
41,
42
],
[
42,
43
],
[
43,
44
],
[
44,
45
],
[
41,
46
],
[
46,
47
],
[
40,
48
],
[
48,
49
],
[
48,
50
],
[
50,
51
],
[
51,
52
],
[
40,
53
],
[
53,
54
],
[
53,
55
],
[
55,
56
],
[
56,
57
],
[
40,
58
],
[
58,
59
],
[
97,
60
],
[
60,
61
],
[
60,
62
],
[
62,
63
],
[
63,
64
],
[
64,
65
],
[
64,
66
],
[
63,
67
],
[
67,
68
],
[
63,
69
],
[
69,
70
],
[
70,
71
],
[
70,
72
],
[
70,
73
],
[
73,
74
],
[
73,
75
],
[
60,
76
],
[
76,
77
],
[
60,
78
],
[
78,
79
],
[
97,
80
],
[
80,
81
],
[
80,
82
],
[
82,
83
],
[
83,
84
],
[
84,
85
],
[
85,
86
],
[
85,
87
],
[
84,
88
],
[
88,
89
],
[
88,
90
],
[
88,
91
],
[
80,
92
],
[
92,
93
],
[
80,
94
],
[
94,
95
],
[
0,
96
],
[
96,
97
],
[
96,
98
]
] | [
"import java.util.Scanner;\n\npublic class Main {\n\tstatic long a,b;\n\tstatic Scanner cin = new Scanner(System.in);\n\tpublic static void main(String[] args) {\n\t\twhile(read()){\n\t\t\tSystem.out.println(gcd(a,b)+\" \"+lcm(a,b));\n\t\t}\n\t}\n\n\tprivate static boolean read() {\n\t\tif(!cin.hasNext())\n \treturn false;\n a = cin.nextLong();\n b = cin.nextLong();\n\t\treturn true;\n\t}\n\n\tprivate static long gcd(long a, long b) {\n\t\tif(b == 0)\n\t\t\treturn a;\n\t\telse\n\t\t\treturn gcd(b,a%b);\n\t}\n\n\tprivate static long lcm(long a, long b) {\n\t\treturn a*b/gcd(a,b);\n\t}\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n\tstatic long a,b;\n\tstatic Scanner cin = new Scanner(System.in);\n\tpublic static void main(String[] args) {\n\t\twhile(read()){\n\t\t\tSystem.out.println(gcd(a,b)+\" \"+lcm(a,b));\n\t\t}\n\t}\n\n\tprivate static boolean read() {\n\t\tif(!cin.hasNext())\n \treturn false;\n a = cin.nextLong();\n b = cin.nextLong();\n\t\treturn true;\n\t}\n\n\tprivate static long gcd(long a, long b) {\n\t\tif(b == 0)\n\t\t\treturn a;\n\t\telse\n\t\t\treturn gcd(b,a%b);\n\t}\n\n\tprivate static long lcm(long a, long b) {\n\t\treturn a*b/gcd(a,b);\n\t}\n}",
"Main",
"static long a",
"a",
"b;",
"b",
"static Scanner cin = new Scanner(System.in);",
"cin",
"new Scanner(System.in)",
"public static void main(String[] args) {\n\t\twhile(read()){\n\t\t\tSystem.out.println(gcd(a,b)+\" \"+lcm(a,b));\n\t\t}\n\t}",
"main",
"{\n\t\twhile(read()){\n\t\t\tSystem.out.println(gcd(a,b)+\" \"+lcm(a,b));\n\t\t}\n\t}",
"while(read()){\n\t\t\tSystem.out.println(gcd(a,b)+\" \"+lcm(a,b));\n\t\t}",
"read()",
"read",
"{\n\t\t\tSystem.out.println(gcd(a,b)+\" \"+lcm(a,b));\n\t\t}",
"System.out.println(gcd(a,b)+\" \"+lcm(a,b))",
"System.out.println",
"System.out",
"System",
"System.out",
"gcd(a,b)+\" \"+lcm(a,b)",
"gcd(a,b)+\" \"+lcm(a,b)",
"gcd(a,b)",
"gcd",
"a",
"b",
"\" \"",
"lcm(a,b)",
"lcm",
"a",
"b",
"String[] args",
"args",
"private static boolean read() {\n\t\tif(!cin.hasNext())\n \treturn false;\n a = cin.nextLong();\n b = cin.nextLong();\n\t\treturn true;\n\t}",
"read",
"{\n\t\tif(!cin.hasNext())\n \treturn false;\n a = cin.nextLong();\n b = cin.nextLong();\n\t\treturn true;\n\t}",
"if(!cin.hasNext())\n \treturn false;",
"!cin.hasNext()",
"cin.hasNext()",
"cin.hasNext",
"cin",
"return false;",
"false",
"a = cin.nextLong()",
"a",
"cin.nextLong()",
"cin.nextLong",
"cin",
"b = cin.nextLong()",
"b",
"cin.nextLong()",
"cin.nextLong",
"cin",
"return true;",
"true",
"private static long gcd(long a, long b) {\n\t\tif(b == 0)\n\t\t\treturn a;\n\t\telse\n\t\t\treturn gcd(b,a%b);\n\t}",
"gcd",
"{\n\t\tif(b == 0)\n\t\t\treturn a;\n\t\telse\n\t\t\treturn gcd(b,a%b);\n\t}",
"if(b == 0)\n\t\t\treturn a;\n\t\telse\n\t\t\treturn gcd(b,a%b);",
"b == 0",
"b",
"0",
"return a;",
"a",
"return gcd(b,a%b);",
"gcd(b,a%b)",
"gcd",
"b",
"a%b",
"a",
"b",
"long a",
"a",
"long b",
"b",
"private static long lcm(long a, long b) {\n\t\treturn a*b/gcd(a,b);\n\t}",
"lcm",
"{\n\t\treturn a*b/gcd(a,b);\n\t}",
"return a*b/gcd(a,b);",
"a*b/gcd(a,b)",
"a*b",
"a",
"b",
"gcd(a,b)",
"gcd",
"a",
"b",
"long a",
"a",
"long b",
"b",
"public class Main {\n\tstatic long a,b;\n\tstatic Scanner cin = new Scanner(System.in);\n\tpublic static void main(String[] args) {\n\t\twhile(read()){\n\t\t\tSystem.out.println(gcd(a,b)+\" \"+lcm(a,b));\n\t\t}\n\t}\n\n\tprivate static boolean read() {\n\t\tif(!cin.hasNext())\n \treturn false;\n a = cin.nextLong();\n b = cin.nextLong();\n\t\treturn true;\n\t}\n\n\tprivate static long gcd(long a, long b) {\n\t\tif(b == 0)\n\t\t\treturn a;\n\t\telse\n\t\t\treturn gcd(b,a%b);\n\t}\n\n\tprivate static long lcm(long a, long b) {\n\t\treturn a*b/gcd(a,b);\n\t}\n}",
"public class Main {\n\tstatic long a,b;\n\tstatic Scanner cin = new Scanner(System.in);\n\tpublic static void main(String[] args) {\n\t\twhile(read()){\n\t\t\tSystem.out.println(gcd(a,b)+\" \"+lcm(a,b));\n\t\t}\n\t}\n\n\tprivate static boolean read() {\n\t\tif(!cin.hasNext())\n \treturn false;\n a = cin.nextLong();\n b = cin.nextLong();\n\t\treturn true;\n\t}\n\n\tprivate static long gcd(long a, long b) {\n\t\tif(b == 0)\n\t\t\treturn a;\n\t\telse\n\t\t\treturn gcd(b,a%b);\n\t}\n\n\tprivate static long lcm(long a, long b) {\n\t\treturn a*b/gcd(a,b);\n\t}\n}",
"Main"
] | import java.util.Scanner;
public class Main {
static long a,b;
static Scanner cin = new Scanner(System.in);
public static void main(String[] args) {
while(read()){
System.out.println(gcd(a,b)+" "+lcm(a,b));
}
}
private static boolean read() {
if(!cin.hasNext())
return false;
a = cin.nextLong();
b = cin.nextLong();
return true;
}
private static long gcd(long a, long b) {
if(b == 0)
return a;
else
return gcd(b,a%b);
}
private static long lcm(long a, long b) {
return a*b/gcd(a,b);
}
} |
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
41,
13,
41,
13,
42,
4,
18,
13,
30,
0,
13,
4,
18,
4,
18,
13,
17,
0,
13,
4,
18,
13,
18,
13,
17,
0,
13,
4,
18,
13,
18,
13,
17,
41,
13,
4,
13,
13,
13,
41,
13,
4,
13,
13,
13,
4,
18,
18,
13,
13,
2,
2,
13,
17,
13,
23,
13,
12,
13,
30,
41,
13,
2,
13,
13,
14,
2,
13,
17,
30,
29,
13,
29,
4,
13,
13,
13,
23,
13,
23,
13,
12,
13,
30,
14,
2,
2,
13,
17,
2,
13,
17,
30,
29,
17,
41,
13,
17,
41,
13,
4,
18,
13,
13,
13,
41,
13,
2,
13,
40,
13,
41,
13,
4,
18,
13,
13,
13,
42,
2,
2,
13,
13,
17,
30,
0,
13,
2,
13,
40,
13,
29,
2,
2,
13,
13,
4,
13,
13,
13,
23,
13,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
159,
5
],
[
159,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
8,
14
],
[
14,
15
],
[
8,
16
],
[
16,
17
],
[
8,
18
],
[
18,
19
],
[
19,
20
],
[
20,
21
],
[
18,
22
],
[
22,
23
],
[
23,
24
],
[
23,
25
],
[
25,
26
],
[
26,
27
],
[
27,
28
],
[
28,
29
],
[
25,
30
],
[
22,
31
],
[
31,
32
],
[
31,
33
],
[
33,
34
],
[
34,
35
],
[
33,
36
],
[
36,
37
],
[
36,
38
],
[
22,
39
],
[
39,
40
],
[
39,
41
],
[
41,
42
],
[
42,
43
],
[
41,
44
],
[
44,
45
],
[
44,
46
],
[
22,
47
],
[
47,
48
],
[
47,
49
],
[
49,
50
],
[
49,
51
],
[
49,
52
],
[
22,
53
],
[
53,
54
],
[
53,
55
],
[
55,
56
],
[
55,
57
],
[
55,
58
],
[
22,
59
],
[
59,
60
],
[
60,
61
],
[
61,
62
],
[
61,
63
],
[
59,
64
],
[
65,
65
],
[
65,
66
],
[
65,
67
],
[
65,
68
],
[
6,
69
],
[
69,
70
],
[
159,
71
],
[
71,
72
],
[
71,
73
],
[
73,
74
],
[
74,
75
],
[
74,
76
],
[
76,
77
],
[
76,
78
],
[
73,
79
],
[
79,
80
],
[
80,
81
],
[
80,
82
],
[
79,
83
],
[
83,
84
],
[
84,
85
],
[
73,
86
],
[
86,
87
],
[
87,
88
],
[
87,
89
],
[
87,
90
],
[
71,
91
],
[
91,
92
],
[
71,
93
],
[
93,
94
],
[
159,
95
],
[
95,
96
],
[
95,
97
],
[
97,
98
],
[
98,
99
],
[
99,
100
],
[
100,
101
],
[
100,
102
],
[
99,
103
],
[
103,
104
],
[
103,
105
],
[
98,
106
],
[
106,
107
],
[
107,
108
],
[
97,
109
],
[
109,
110
],
[
109,
111
],
[
97,
112
],
[
112,
113
],
[
112,
114
],
[
114,
115
],
[
115,
116
],
[
114,
117
],
[
114,
118
],
[
97,
119
],
[
119,
120
],
[
119,
121
],
[
121,
122
],
[
121,
123
],
[
123,
124
],
[
97,
125
],
[
125,
126
],
[
125,
127
],
[
127,
128
],
[
128,
129
],
[
127,
130
],
[
127,
131
],
[
97,
132
],
[
132,
133
],
[
133,
134
],
[
134,
135
],
[
134,
136
],
[
133,
137
],
[
132,
138
],
[
138,
139
],
[
139,
140
],
[
139,
141
],
[
141,
142
],
[
141,
143
],
[
143,
144
],
[
97,
145
],
[
145,
146
],
[
146,
147
],
[
147,
148
],
[
147,
149
],
[
146,
150
],
[
150,
151
],
[
150,
152
],
[
150,
153
],
[
95,
154
],
[
154,
155
],
[
95,
156
],
[
156,
157
],
[
0,
158
],
[
158,
159
],
[
158,
160
]
] | [
"import java.util.Scanner;\npublic class Main {\n public static void main (String[] args) {\n\tScanner scan = new Scanner(System.in);\n\tlong a, b;\n\tString[] input;\n\twhile (scan.hasNext()){\n\t input = scan.nextLine().split(\" \");\n\t a = Integer.parseInt(input[0]);\n\t b = Integer.parseInt(input[1]);\n\t long lcm = solveLCM(a, b);\n\t long gcd = solveGCD(a, b);\n\t System.out.println(gcd + \" \" + lcm);\n\t}\n }\n static long solveGCD (long a, long b) {\n\tlong gcd = a % b;\n\tif (gcd == 0) {\n\t return b;\n\t}\n\treturn solveGCD(b, gcd);\n }\n\n static long solveLCM (long a, long b) {\n\tif (a == 0 || b == 0) {\n\t return 0;\n\t}\n\tlong i = 1;\n\tlong max = Math.max(a, b);\n\tlong lcm = max * i++;\n\tlong min = Math.min(a, b);\n\twhile (lcm % min != 0) {\n\t lcm = max * i++;\n\t}\n\t//return lcm;\n\treturn a * b / solveGCD(a,b);\n }\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n public static void main (String[] args) {\n\tScanner scan = new Scanner(System.in);\n\tlong a, b;\n\tString[] input;\n\twhile (scan.hasNext()){\n\t input = scan.nextLine().split(\" \");\n\t a = Integer.parseInt(input[0]);\n\t b = Integer.parseInt(input[1]);\n\t long lcm = solveLCM(a, b);\n\t long gcd = solveGCD(a, b);\n\t System.out.println(gcd + \" \" + lcm);\n\t}\n }\n static long solveGCD (long a, long b) {\n\tlong gcd = a % b;\n\tif (gcd == 0) {\n\t return b;\n\t}\n\treturn solveGCD(b, gcd);\n }\n\n static long solveLCM (long a, long b) {\n\tif (a == 0 || b == 0) {\n\t return 0;\n\t}\n\tlong i = 1;\n\tlong max = Math.max(a, b);\n\tlong lcm = max * i++;\n\tlong min = Math.min(a, b);\n\twhile (lcm % min != 0) {\n\t lcm = max * i++;\n\t}\n\t//return lcm;\n\treturn a * b / solveGCD(a,b);\n }\n}",
"Main",
"public static void main (String[] args) {\n\tScanner scan = new Scanner(System.in);\n\tlong a, b;\n\tString[] input;\n\twhile (scan.hasNext()){\n\t input = scan.nextLine().split(\" \");\n\t a = Integer.parseInt(input[0]);\n\t b = Integer.parseInt(input[1]);\n\t long lcm = solveLCM(a, b);\n\t long gcd = solveGCD(a, b);\n\t System.out.println(gcd + \" \" + lcm);\n\t}\n }",
"main",
"{\n\tScanner scan = new Scanner(System.in);\n\tlong a, b;\n\tString[] input;\n\twhile (scan.hasNext()){\n\t input = scan.nextLine().split(\" \");\n\t a = Integer.parseInt(input[0]);\n\t b = Integer.parseInt(input[1]);\n\t long lcm = solveLCM(a, b);\n\t long gcd = solveGCD(a, b);\n\t System.out.println(gcd + \" \" + lcm);\n\t}\n }",
"Scanner scan = new Scanner(System.in);",
"scan",
"new Scanner(System.in)",
"long a",
"a",
"b;",
"b",
"String[] input;",
"input",
"while (scan.hasNext()){\n\t input = scan.nextLine().split(\" \");\n\t a = Integer.parseInt(input[0]);\n\t b = Integer.parseInt(input[1]);\n\t long lcm = solveLCM(a, b);\n\t long gcd = solveGCD(a, b);\n\t System.out.println(gcd + \" \" + lcm);\n\t}",
"scan.hasNext()",
"scan.hasNext",
"scan",
"{\n\t input = scan.nextLine().split(\" \");\n\t a = Integer.parseInt(input[0]);\n\t b = Integer.parseInt(input[1]);\n\t long lcm = solveLCM(a, b);\n\t long gcd = solveGCD(a, b);\n\t System.out.println(gcd + \" \" + lcm);\n\t}",
"input = scan.nextLine().split(\" \")",
"input",
"scan.nextLine().split(\" \")",
"scan.nextLine().split",
"scan.nextLine()",
"scan.nextLine",
"scan",
"\" \"",
"a = Integer.parseInt(input[0])",
"a",
"Integer.parseInt(input[0])",
"Integer.parseInt",
"Integer",
"input[0]",
"input",
"0",
"b = Integer.parseInt(input[1])",
"b",
"Integer.parseInt(input[1])",
"Integer.parseInt",
"Integer",
"input[1]",
"input",
"1",
"long lcm = solveLCM(a, b);",
"lcm",
"solveLCM(a, b)",
"solveLCM",
"a",
"b",
"long gcd = solveGCD(a, b);",
"gcd",
"solveGCD(a, b)",
"solveGCD",
"a",
"b",
"System.out.println(gcd + \" \" + lcm)",
"System.out.println",
"System.out",
"System",
"System.out",
"gcd + \" \" + lcm",
"gcd + \" \" + lcm",
"gcd",
"\" \"",
"lcm",
"String[] args",
"args",
"static long solveGCD (long a, long b) {\n\tlong gcd = a % b;\n\tif (gcd == 0) {\n\t return b;\n\t}\n\treturn solveGCD(b, gcd);\n }",
"solveGCD",
"{\n\tlong gcd = a % b;\n\tif (gcd == 0) {\n\t return b;\n\t}\n\treturn solveGCD(b, gcd);\n }",
"long gcd = a % b;",
"gcd",
"a % b",
"a",
"b",
"if (gcd == 0) {\n\t return b;\n\t}",
"gcd == 0",
"gcd",
"0",
"{\n\t return b;\n\t}",
"return b;",
"b",
"return solveGCD(b, gcd);",
"solveGCD(b, gcd)",
"solveGCD",
"b",
"gcd",
"long a",
"a",
"long b",
"b",
"static long solveLCM (long a, long b) {\n\tif (a == 0 || b == 0) {\n\t return 0;\n\t}\n\tlong i = 1;\n\tlong max = Math.max(a, b);\n\tlong lcm = max * i++;\n\tlong min = Math.min(a, b);\n\twhile (lcm % min != 0) {\n\t lcm = max * i++;\n\t}\n\t//return lcm;\n\treturn a * b / solveGCD(a,b);\n }",
"solveLCM",
"{\n\tif (a == 0 || b == 0) {\n\t return 0;\n\t}\n\tlong i = 1;\n\tlong max = Math.max(a, b);\n\tlong lcm = max * i++;\n\tlong min = Math.min(a, b);\n\twhile (lcm % min != 0) {\n\t lcm = max * i++;\n\t}\n\t//return lcm;\n\treturn a * b / solveGCD(a,b);\n }",
"if (a == 0 || b == 0) {\n\t return 0;\n\t}",
"a == 0 || b == 0",
"a == 0",
"a",
"0",
"b == 0",
"b",
"0",
"{\n\t return 0;\n\t}",
"return 0;",
"0",
"long i = 1;",
"i",
"1",
"long max = Math.max(a, b);",
"max",
"Math.max(a, b)",
"Math.max",
"Math",
"a",
"b",
"long lcm = max * i++;",
"lcm",
"max * i++",
"max",
"i++",
"i",
"long min = Math.min(a, b);",
"min",
"Math.min(a, b)",
"Math.min",
"Math",
"a",
"b",
"while (lcm % min != 0) {\n\t lcm = max * i++;\n\t}",
"lcm % min != 0",
"lcm % min",
"lcm",
"min",
"0",
"{\n\t lcm = max * i++;\n\t}",
"lcm = max * i++",
"lcm",
"max * i++",
"max",
"i++",
"i",
"return a * b / solveGCD(a,b);",
"a * b / solveGCD(a,b)",
"a * b",
"a",
"b",
"solveGCD(a,b)",
"solveGCD",
"a",
"b",
"long a",
"a",
"long b",
"b",
"public class Main {\n public static void main (String[] args) {\n\tScanner scan = new Scanner(System.in);\n\tlong a, b;\n\tString[] input;\n\twhile (scan.hasNext()){\n\t input = scan.nextLine().split(\" \");\n\t a = Integer.parseInt(input[0]);\n\t b = Integer.parseInt(input[1]);\n\t long lcm = solveLCM(a, b);\n\t long gcd = solveGCD(a, b);\n\t System.out.println(gcd + \" \" + lcm);\n\t}\n }\n static long solveGCD (long a, long b) {\n\tlong gcd = a % b;\n\tif (gcd == 0) {\n\t return b;\n\t}\n\treturn solveGCD(b, gcd);\n }\n\n static long solveLCM (long a, long b) {\n\tif (a == 0 || b == 0) {\n\t return 0;\n\t}\n\tlong i = 1;\n\tlong max = Math.max(a, b);\n\tlong lcm = max * i++;\n\tlong min = Math.min(a, b);\n\twhile (lcm % min != 0) {\n\t lcm = max * i++;\n\t}\n\t//return lcm;\n\treturn a * b / solveGCD(a,b);\n }\n}",
"public class Main {\n public static void main (String[] args) {\n\tScanner scan = new Scanner(System.in);\n\tlong a, b;\n\tString[] input;\n\twhile (scan.hasNext()){\n\t input = scan.nextLine().split(\" \");\n\t a = Integer.parseInt(input[0]);\n\t b = Integer.parseInt(input[1]);\n\t long lcm = solveLCM(a, b);\n\t long gcd = solveGCD(a, b);\n\t System.out.println(gcd + \" \" + lcm);\n\t}\n }\n static long solveGCD (long a, long b) {\n\tlong gcd = a % b;\n\tif (gcd == 0) {\n\t return b;\n\t}\n\treturn solveGCD(b, gcd);\n }\n\n static long solveLCM (long a, long b) {\n\tif (a == 0 || b == 0) {\n\t return 0;\n\t}\n\tlong i = 1;\n\tlong max = Math.max(a, b);\n\tlong lcm = max * i++;\n\tlong min = Math.min(a, b);\n\twhile (lcm % min != 0) {\n\t lcm = max * i++;\n\t}\n\t//return lcm;\n\treturn a * b / solveGCD(a,b);\n }\n}",
"Main"
] | import java.util.Scanner;
public class Main {
public static void main (String[] args) {
Scanner scan = new Scanner(System.in);
long a, b;
String[] input;
while (scan.hasNext()){
input = scan.nextLine().split(" ");
a = Integer.parseInt(input[0]);
b = Integer.parseInt(input[1]);
long lcm = solveLCM(a, b);
long gcd = solveGCD(a, b);
System.out.println(gcd + " " + lcm);
}
}
static long solveGCD (long a, long b) {
long gcd = a % b;
if (gcd == 0) {
return b;
}
return solveGCD(b, gcd);
}
static long solveLCM (long a, long b) {
if (a == 0 || b == 0) {
return 0;
}
long i = 1;
long max = Math.max(a, b);
long lcm = max * i++;
long min = Math.min(a, b);
while (lcm % min != 0) {
lcm = max * i++;
}
//return lcm;
return a * b / solveGCD(a,b);
}
} |
[
7,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
38,
5,
13,
30,
4,
18,
13,
17,
30,
41,
13,
20,
41,
13,
20,
41,
13,
20,
17,
41,
13,
20,
17,
41,
13,
42,
2,
17,
0,
13,
4,
18,
13,
30,
41,
13,
4,
18,
13,
17,
0,
18,
13,
17,
4,
18,
13,
18,
13,
17,
0,
18,
13,
17,
4,
18,
13,
18,
13,
17,
0,
18,
13,
17,
18,
13,
17,
0,
18,
13,
17,
18,
13,
17,
42,
2,
18,
13,
17,
18,
13,
17,
30,
14,
2,
18,
13,
17,
18,
13,
17,
30,
0,
18,
13,
17,
2,
18,
13,
17,
18,
13,
17,
30,
0,
18,
13,
17,
2,
18,
13,
17,
18,
13,
17,
4,
18,
18,
13,
13,
2,
2,
18,
13,
17,
17,
2,
2,
18,
13,
17,
18,
13,
17,
18,
13,
17,
23,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
9,
10
],
[
9,
11
],
[
11,
12
],
[
12,
13
],
[
11,
14
],
[
14,
15
],
[
15,
16
],
[
15,
17
],
[
17,
18
],
[
18,
19
],
[
19,
20
],
[
18,
21
],
[
14,
22
],
[
22,
23
],
[
23,
24
],
[
23,
25
],
[
22,
26
],
[
26,
27
],
[
26,
28
],
[
22,
29
],
[
29,
30
],
[
29,
31
],
[
22,
33
],
[
33,
34
],
[
33,
35
],
[
22,
37
],
[
37,
38
],
[
22,
39
],
[
39,
40
],
[
40,
41
],
[
40,
42
],
[
42,
43
],
[
42,
44
],
[
44,
45
],
[
45,
46
],
[
39,
47
],
[
47,
48
],
[
48,
49
],
[
48,
50
],
[
50,
51
],
[
51,
52
],
[
50,
53
],
[
47,
54
],
[
54,
55
],
[
55,
56
],
[
55,
57
],
[
54,
58
],
[
58,
59
],
[
59,
60
],
[
58,
61
],
[
61,
62
],
[
61,
63
],
[
47,
64
],
[
64,
65
],
[
65,
66
],
[
65,
67
],
[
64,
68
],
[
68,
69
],
[
69,
70
],
[
68,
71
],
[
71,
72
],
[
71,
73
],
[
47,
74
],
[
74,
75
],
[
75,
76
],
[
75,
77
],
[
74,
78
],
[
78,
79
],
[
78,
80
],
[
47,
81
],
[
81,
82
],
[
82,
83
],
[
82,
84
],
[
81,
85
],
[
85,
86
],
[
85,
87
],
[
47,
88
],
[
88,
89
],
[
89,
90
],
[
90,
91
],
[
90,
92
],
[
89,
93
],
[
93,
94
],
[
93,
95
],
[
88,
96
],
[
96,
97
],
[
97,
98
],
[
98,
99
],
[
99,
100
],
[
99,
101
],
[
98,
102
],
[
102,
103
],
[
102,
104
],
[
97,
105
],
[
105,
106
],
[
106,
107
],
[
107,
108
],
[
107,
109
],
[
106,
110
],
[
110,
111
],
[
111,
112
],
[
111,
113
],
[
110,
114
],
[
114,
115
],
[
114,
116
],
[
97,
117
],
[
117,
118
],
[
118,
119
],
[
119,
120
],
[
119,
121
],
[
118,
122
],
[
122,
123
],
[
123,
124
],
[
123,
125
],
[
122,
126
],
[
126,
127
],
[
126,
128
],
[
47,
129
],
[
129,
130
],
[
130,
131
],
[
131,
132
],
[
131,
133
],
[
129,
134
],
[
135,
135
],
[
135,
136
],
[
136,
137
],
[
136,
138
],
[
135,
139
],
[
135,
140
],
[
140,
141
],
[
141,
142
],
[
142,
143
],
[
142,
144
],
[
141,
145
],
[
145,
146
],
[
145,
147
],
[
140,
148
],
[
148,
149
],
[
148,
150
],
[
9,
151
],
[
151,
152
]
] | [
"import java.io.BufferedReader;\nimport java.io.InputStreamReader;\nclass Main{\n public static void main(String args[]){\n\tString str;\n\ttry{\n\t InputStreamReader is = new InputStreamReader(System.in);\n\t BufferedReader br = new BufferedReader(is);\n\t int[] n = new int[2];\n\t long[] l = new long[2];\n\t int temp;\n\t while(null != (str = br.readLine())){\n\t\tString[] strary = str.split(\" \");\n\t\tn[0] = Integer.parseInt(strary[0]);\n\t\tn[1] = Integer.parseInt(strary[1]);\n\t\tl[0] = n[0];\n\t\tl[1] = n[1];\n\t\twhile(n[0] != n[1]){\n\t\t if(n[0] > n[1]){\n\t\t\tn[0] = n[0]-n[1];\n\t\t }\n\t\t else{\n\t\t\tn[1] = n[1]-n[0];\n\t\t }\n\t\t}\n\t\tSystem.out.println(n[0]+\" \"+((l[0]*l[1])/n[0]));\n\t }\n\t}\n\tcatch(Exception e){\n\t System.exit(0);\n\t}\n }\n}",
"import java.io.BufferedReader;",
"BufferedReader",
"java.io",
"import java.io.InputStreamReader;",
"InputStreamReader",
"java.io",
"class Main{\n public static void main(String args[]){\n\tString str;\n\ttry{\n\t InputStreamReader is = new InputStreamReader(System.in);\n\t BufferedReader br = new BufferedReader(is);\n\t int[] n = new int[2];\n\t long[] l = new long[2];\n\t int temp;\n\t while(null != (str = br.readLine())){\n\t\tString[] strary = str.split(\" \");\n\t\tn[0] = Integer.parseInt(strary[0]);\n\t\tn[1] = Integer.parseInt(strary[1]);\n\t\tl[0] = n[0];\n\t\tl[1] = n[1];\n\t\twhile(n[0] != n[1]){\n\t\t if(n[0] > n[1]){\n\t\t\tn[0] = n[0]-n[1];\n\t\t }\n\t\t else{\n\t\t\tn[1] = n[1]-n[0];\n\t\t }\n\t\t}\n\t\tSystem.out.println(n[0]+\" \"+((l[0]*l[1])/n[0]));\n\t }\n\t}\n\tcatch(Exception e){\n\t System.exit(0);\n\t}\n }\n}",
"Main",
"public static void main(String args[]){\n\tString str;\n\ttry{\n\t InputStreamReader is = new InputStreamReader(System.in);\n\t BufferedReader br = new BufferedReader(is);\n\t int[] n = new int[2];\n\t long[] l = new long[2];\n\t int temp;\n\t while(null != (str = br.readLine())){\n\t\tString[] strary = str.split(\" \");\n\t\tn[0] = Integer.parseInt(strary[0]);\n\t\tn[1] = Integer.parseInt(strary[1]);\n\t\tl[0] = n[0];\n\t\tl[1] = n[1];\n\t\twhile(n[0] != n[1]){\n\t\t if(n[0] > n[1]){\n\t\t\tn[0] = n[0]-n[1];\n\t\t }\n\t\t else{\n\t\t\tn[1] = n[1]-n[0];\n\t\t }\n\t\t}\n\t\tSystem.out.println(n[0]+\" \"+((l[0]*l[1])/n[0]));\n\t }\n\t}\n\tcatch(Exception e){\n\t System.exit(0);\n\t}\n }",
"main",
"{\n\tString str;\n\ttry{\n\t InputStreamReader is = new InputStreamReader(System.in);\n\t BufferedReader br = new BufferedReader(is);\n\t int[] n = new int[2];\n\t long[] l = new long[2];\n\t int temp;\n\t while(null != (str = br.readLine())){\n\t\tString[] strary = str.split(\" \");\n\t\tn[0] = Integer.parseInt(strary[0]);\n\t\tn[1] = Integer.parseInt(strary[1]);\n\t\tl[0] = n[0];\n\t\tl[1] = n[1];\n\t\twhile(n[0] != n[1]){\n\t\t if(n[0] > n[1]){\n\t\t\tn[0] = n[0]-n[1];\n\t\t }\n\t\t else{\n\t\t\tn[1] = n[1]-n[0];\n\t\t }\n\t\t}\n\t\tSystem.out.println(n[0]+\" \"+((l[0]*l[1])/n[0]));\n\t }\n\t}\n\tcatch(Exception e){\n\t System.exit(0);\n\t}\n }",
"String str;",
"str",
"try{\n\t InputStreamReader is = new InputStreamReader(System.in);\n\t BufferedReader br = new BufferedReader(is);\n\t int[] n = new int[2];\n\t long[] l = new long[2];\n\t int temp;\n\t while(null != (str = br.readLine())){\n\t\tString[] strary = str.split(\" \");\n\t\tn[0] = Integer.parseInt(strary[0]);\n\t\tn[1] = Integer.parseInt(strary[1]);\n\t\tl[0] = n[0];\n\t\tl[1] = n[1];\n\t\twhile(n[0] != n[1]){\n\t\t if(n[0] > n[1]){\n\t\t\tn[0] = n[0]-n[1];\n\t\t }\n\t\t else{\n\t\t\tn[1] = n[1]-n[0];\n\t\t }\n\t\t}\n\t\tSystem.out.println(n[0]+\" \"+((l[0]*l[1])/n[0]));\n\t }\n\t}\n\tcatch(Exception e){\n\t System.exit(0);\n\t}",
"catch(Exception e){\n\t System.exit(0);\n\t}",
"Exception e",
"{\n\t System.exit(0);\n\t}",
"System.exit(0)",
"System.exit",
"System",
"0",
"{\n\t InputStreamReader is = new InputStreamReader(System.in);\n\t BufferedReader br = new BufferedReader(is);\n\t int[] n = new int[2];\n\t long[] l = new long[2];\n\t int temp;\n\t while(null != (str = br.readLine())){\n\t\tString[] strary = str.split(\" \");\n\t\tn[0] = Integer.parseInt(strary[0]);\n\t\tn[1] = Integer.parseInt(strary[1]);\n\t\tl[0] = n[0];\n\t\tl[1] = n[1];\n\t\twhile(n[0] != n[1]){\n\t\t if(n[0] > n[1]){\n\t\t\tn[0] = n[0]-n[1];\n\t\t }\n\t\t else{\n\t\t\tn[1] = n[1]-n[0];\n\t\t }\n\t\t}\n\t\tSystem.out.println(n[0]+\" \"+((l[0]*l[1])/n[0]));\n\t }\n\t}",
"InputStreamReader is = new InputStreamReader(System.in);",
"is",
"new InputStreamReader(System.in)",
"BufferedReader br = new BufferedReader(is);",
"br",
"new BufferedReader(is)",
"int[] n = new int[2];",
"n",
"new int[2]",
"2",
"long[] l = new long[2];",
"l",
"new long[2]",
"2",
"int temp;",
"temp",
"while(null != (str = br.readLine())){\n\t\tString[] strary = str.split(\" \");\n\t\tn[0] = Integer.parseInt(strary[0]);\n\t\tn[1] = Integer.parseInt(strary[1]);\n\t\tl[0] = n[0];\n\t\tl[1] = n[1];\n\t\twhile(n[0] != n[1]){\n\t\t if(n[0] > n[1]){\n\t\t\tn[0] = n[0]-n[1];\n\t\t }\n\t\t else{\n\t\t\tn[1] = n[1]-n[0];\n\t\t }\n\t\t}\n\t\tSystem.out.println(n[0]+\" \"+((l[0]*l[1])/n[0]));\n\t }",
"null != (str = br.readLine())",
"null",
"(str = br.readLine())",
"str",
"br.readLine()",
"br.readLine",
"br",
"{\n\t\tString[] strary = str.split(\" \");\n\t\tn[0] = Integer.parseInt(strary[0]);\n\t\tn[1] = Integer.parseInt(strary[1]);\n\t\tl[0] = n[0];\n\t\tl[1] = n[1];\n\t\twhile(n[0] != n[1]){\n\t\t if(n[0] > n[1]){\n\t\t\tn[0] = n[0]-n[1];\n\t\t }\n\t\t else{\n\t\t\tn[1] = n[1]-n[0];\n\t\t }\n\t\t}\n\t\tSystem.out.println(n[0]+\" \"+((l[0]*l[1])/n[0]));\n\t }",
"String[] strary = str.split(\" \");",
"strary",
"str.split(\" \")",
"str.split",
"str",
"\" \"",
"n[0] = Integer.parseInt(strary[0])",
"n[0]",
"n",
"0",
"Integer.parseInt(strary[0])",
"Integer.parseInt",
"Integer",
"strary[0]",
"strary",
"0",
"n[1] = Integer.parseInt(strary[1])",
"n[1]",
"n",
"1",
"Integer.parseInt(strary[1])",
"Integer.parseInt",
"Integer",
"strary[1]",
"strary",
"1",
"l[0] = n[0]",
"l[0]",
"l",
"0",
"n[0]",
"n",
"0",
"l[1] = n[1]",
"l[1]",
"l",
"1",
"n[1]",
"n",
"1",
"while(n[0] != n[1]){\n\t\t if(n[0] > n[1]){\n\t\t\tn[0] = n[0]-n[1];\n\t\t }\n\t\t else{\n\t\t\tn[1] = n[1]-n[0];\n\t\t }\n\t\t}",
"n[0] != n[1]",
"n[0]",
"n",
"0",
"n[1]",
"n",
"1",
"{\n\t\t if(n[0] > n[1]){\n\t\t\tn[0] = n[0]-n[1];\n\t\t }\n\t\t else{\n\t\t\tn[1] = n[1]-n[0];\n\t\t }\n\t\t}",
"if(n[0] > n[1]){\n\t\t\tn[0] = n[0]-n[1];\n\t\t }\n\t\t else{\n\t\t\tn[1] = n[1]-n[0];\n\t\t }",
"n[0] > n[1]",
"n[0]",
"n",
"0",
"n[1]",
"n",
"1",
"{\n\t\t\tn[0] = n[0]-n[1];\n\t\t }",
"n[0] = n[0]-n[1]",
"n[0]",
"n",
"0",
"n[0]-n[1]",
"n[0]",
"n",
"0",
"n[1]",
"n",
"1",
"{\n\t\t\tn[1] = n[1]-n[0];\n\t\t }",
"n[1] = n[1]-n[0]",
"n[1]",
"n",
"1",
"n[1]-n[0]",
"n[1]",
"n",
"1",
"n[0]",
"n",
"0",
"System.out.println(n[0]+\" \"+((l[0]*l[1])/n[0]))",
"System.out.println",
"System.out",
"System",
"System.out",
"n[0]+\" \"+((l[0]*l[1])/n[0])",
"n[0]+\" \"+((l[0]*l[1])/n[0])",
"n[0]",
"n",
"0",
"\" \"",
"((l[0]*l[1])/n[0])",
"(l[0]*l[1])",
"l[0]",
"l",
"0",
"l[1]",
"l",
"1",
"n[0]",
"n",
"0",
"String args[]",
"args"
] | import java.io.BufferedReader;
import java.io.InputStreamReader;
class Main{
public static void main(String args[]){
String str;
try{
InputStreamReader is = new InputStreamReader(System.in);
BufferedReader br = new BufferedReader(is);
int[] n = new int[2];
long[] l = new long[2];
int temp;
while(null != (str = br.readLine())){
String[] strary = str.split(" ");
n[0] = Integer.parseInt(strary[0]);
n[1] = Integer.parseInt(strary[1]);
l[0] = n[0];
l[1] = n[1];
while(n[0] != n[1]){
if(n[0] > n[1]){
n[0] = n[0]-n[1];
}
else{
n[1] = n[1]-n[0];
}
}
System.out.println(n[0]+" "+((l[0]*l[1])/n[0]));
}
}
catch(Exception e){
System.exit(0);
}
}
} |
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
42,
4,
18,
13,
30,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
41,
13,
4,
13,
13,
13,
41,
13,
2,
2,
13,
13,
13,
4,
18,
18,
13,
13,
2,
2,
13,
17,
13,
4,
18,
13,
23,
13,
12,
13,
30,
29,
8,
2,
13,
17,
13,
4,
13,
13,
2,
13,
13,
23,
13,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
75,
5
],
[
75,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
13,
14
],
[
14,
15
],
[
12,
16
],
[
16,
17
],
[
17,
18
],
[
17,
19
],
[
19,
20
],
[
20,
21
],
[
16,
22
],
[
22,
23
],
[
22,
24
],
[
24,
25
],
[
25,
26
],
[
16,
27
],
[
27,
28
],
[
27,
29
],
[
29,
30
],
[
29,
31
],
[
29,
32
],
[
16,
33
],
[
33,
34
],
[
33,
35
],
[
35,
36
],
[
36,
37
],
[
36,
38
],
[
35,
39
],
[
16,
40
],
[
40,
41
],
[
41,
42
],
[
42,
43
],
[
42,
44
],
[
40,
45
],
[
46,
46
],
[
46,
47
],
[
46,
48
],
[
46,
49
],
[
8,
50
],
[
50,
51
],
[
51,
52
],
[
6,
53
],
[
53,
54
],
[
75,
55
],
[
55,
56
],
[
55,
57
],
[
57,
58
],
[
58,
59
],
[
59,
60
],
[
60,
61
],
[
60,
62
],
[
59,
63
],
[
59,
64
],
[
64,
65
],
[
64,
66
],
[
64,
67
],
[
67,
68
],
[
67,
69
],
[
55,
70
],
[
70,
71
],
[
55,
72
],
[
72,
73
],
[
0,
74
],
[
74,
75
],
[
74,
76
]
] | [
"import java.util.Scanner;\n\npublic class Main {\n\tpublic static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\twhile (sc.hasNext()) {\n\t\t\tlong a = sc.nextLong();\n\t\t\tlong b = sc.nextLong();\n\t\t\tlong gcd = gcd(a, b);\n\t\t\tlong lcm = (a * b) / gcd;\n\t\t\tSystem.out.println(gcd + \" \" + lcm);\n\t\t}\n\t\tsc.close();\n\t}\n\n\tstatic long gcd(long a, long b) {\n\t\treturn b == 0 ? a : gcd(b, a % b);\n\t}\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n\tpublic static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\twhile (sc.hasNext()) {\n\t\t\tlong a = sc.nextLong();\n\t\t\tlong b = sc.nextLong();\n\t\t\tlong gcd = gcd(a, b);\n\t\t\tlong lcm = (a * b) / gcd;\n\t\t\tSystem.out.println(gcd + \" \" + lcm);\n\t\t}\n\t\tsc.close();\n\t}\n\n\tstatic long gcd(long a, long b) {\n\t\treturn b == 0 ? a : gcd(b, a % b);\n\t}\n}",
"Main",
"public static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\twhile (sc.hasNext()) {\n\t\t\tlong a = sc.nextLong();\n\t\t\tlong b = sc.nextLong();\n\t\t\tlong gcd = gcd(a, b);\n\t\t\tlong lcm = (a * b) / gcd;\n\t\t\tSystem.out.println(gcd + \" \" + lcm);\n\t\t}\n\t\tsc.close();\n\t}",
"main",
"{\n\t\tScanner sc = new Scanner(System.in);\n\t\twhile (sc.hasNext()) {\n\t\t\tlong a = sc.nextLong();\n\t\t\tlong b = sc.nextLong();\n\t\t\tlong gcd = gcd(a, b);\n\t\t\tlong lcm = (a * b) / gcd;\n\t\t\tSystem.out.println(gcd + \" \" + lcm);\n\t\t}\n\t\tsc.close();\n\t}",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"while (sc.hasNext()) {\n\t\t\tlong a = sc.nextLong();\n\t\t\tlong b = sc.nextLong();\n\t\t\tlong gcd = gcd(a, b);\n\t\t\tlong lcm = (a * b) / gcd;\n\t\t\tSystem.out.println(gcd + \" \" + lcm);\n\t\t}",
"sc.hasNext()",
"sc.hasNext",
"sc",
"{\n\t\t\tlong a = sc.nextLong();\n\t\t\tlong b = sc.nextLong();\n\t\t\tlong gcd = gcd(a, b);\n\t\t\tlong lcm = (a * b) / gcd;\n\t\t\tSystem.out.println(gcd + \" \" + lcm);\n\t\t}",
"long a = sc.nextLong();",
"a",
"sc.nextLong()",
"sc.nextLong",
"sc",
"long b = sc.nextLong();",
"b",
"sc.nextLong()",
"sc.nextLong",
"sc",
"long gcd = gcd(a, b);",
"gcd",
"gcd(a, b)",
"gcd",
"a",
"b",
"long lcm = (a * b) / gcd;",
"lcm",
"(a * b) / gcd",
"(a * b)",
"a",
"b",
"gcd",
"System.out.println(gcd + \" \" + lcm)",
"System.out.println",
"System.out",
"System",
"System.out",
"gcd + \" \" + lcm",
"gcd + \" \" + lcm",
"gcd",
"\" \"",
"lcm",
"sc.close()",
"sc.close",
"sc",
"String[] args",
"args",
"static long gcd(long a, long b) {\n\t\treturn b == 0 ? a : gcd(b, a % b);\n\t}",
"gcd",
"{\n\t\treturn b == 0 ? a : gcd(b, a % b);\n\t}",
"return b == 0 ? a : gcd(b, a % b);",
"b == 0 ? a : gcd(b, a % b)",
"b == 0",
"b",
"0",
"a",
"gcd(b, a % b)",
"gcd",
"b",
"a % b",
"a",
"b",
"long a",
"a",
"long b",
"b",
"public class Main {\n\tpublic static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\twhile (sc.hasNext()) {\n\t\t\tlong a = sc.nextLong();\n\t\t\tlong b = sc.nextLong();\n\t\t\tlong gcd = gcd(a, b);\n\t\t\tlong lcm = (a * b) / gcd;\n\t\t\tSystem.out.println(gcd + \" \" + lcm);\n\t\t}\n\t\tsc.close();\n\t}\n\n\tstatic long gcd(long a, long b) {\n\t\treturn b == 0 ? a : gcd(b, a % b);\n\t}\n}",
"public class Main {\n\tpublic static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\twhile (sc.hasNext()) {\n\t\t\tlong a = sc.nextLong();\n\t\t\tlong b = sc.nextLong();\n\t\t\tlong gcd = gcd(a, b);\n\t\t\tlong lcm = (a * b) / gcd;\n\t\t\tSystem.out.println(gcd + \" \" + lcm);\n\t\t}\n\t\tsc.close();\n\t}\n\n\tstatic long gcd(long a, long b) {\n\t\treturn b == 0 ? a : gcd(b, a % b);\n\t}\n}",
"Main"
] | import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
while (sc.hasNext()) {
long a = sc.nextLong();
long b = sc.nextLong();
long gcd = gcd(a, b);
long lcm = (a * b) / gcd;
System.out.println(gcd + " " + lcm);
}
sc.close();
}
static long gcd(long a, long b) {
return b == 0 ? a : gcd(b, a % b);
}
} |
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
42,
2,
0,
13,
4,
18,
13,
17,
30,
41,
13,
4,
18,
13,
17,
41,
13,
4,
18,
13,
18,
13,
17,
41,
13,
4,
18,
13,
18,
13,
17,
41,
13,
4,
13,
13,
13,
41,
13,
2,
2,
13,
13,
13,
4,
18,
18,
13,
13,
2,
2,
13,
17,
13,
23,
13,
12,
13,
30,
42,
2,
13,
17,
30,
41,
13,
13,
0,
13,
13,
0,
13,
2,
13,
13,
29,
13,
23,
13,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
96,
5
],
[
96,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
8,
14
],
[
14,
15
],
[
15,
16
],
[
16,
17
],
[
16,
18
],
[
18,
19
],
[
19,
20
],
[
15,
21
],
[
14,
22
],
[
22,
23
],
[
23,
24
],
[
23,
25
],
[
25,
26
],
[
26,
27
],
[
25,
28
],
[
22,
29
],
[
29,
30
],
[
29,
31
],
[
31,
32
],
[
32,
33
],
[
31,
34
],
[
34,
35
],
[
34,
36
],
[
22,
37
],
[
37,
38
],
[
37,
39
],
[
39,
40
],
[
40,
41
],
[
39,
42
],
[
42,
43
],
[
42,
44
],
[
22,
45
],
[
45,
46
],
[
45,
47
],
[
47,
48
],
[
47,
49
],
[
47,
50
],
[
22,
51
],
[
51,
52
],
[
51,
53
],
[
53,
54
],
[
54,
55
],
[
54,
56
],
[
53,
57
],
[
22,
58
],
[
58,
59
],
[
59,
60
],
[
60,
61
],
[
60,
62
],
[
58,
63
],
[
64,
64
],
[
64,
65
],
[
64,
66
],
[
64,
67
],
[
6,
68
],
[
68,
69
],
[
96,
70
],
[
70,
71
],
[
70,
72
],
[
72,
73
],
[
73,
74
],
[
74,
75
],
[
74,
76
],
[
73,
77
],
[
77,
78
],
[
78,
79
],
[
78,
80
],
[
77,
81
],
[
81,
82
],
[
81,
83
],
[
77,
84
],
[
84,
85
],
[
84,
86
],
[
86,
87
],
[
86,
88
],
[
72,
89
],
[
89,
90
],
[
70,
91
],
[
91,
92
],
[
70,
93
],
[
93,
94
],
[
0,
95
],
[
95,
96
],
[
95,
97
]
] | [
"\nimport java.io.*;\n\npublic class Main {\n\t \n public static void main(String[] args) throws IOException {\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n \n String s;\n while ((s = br.readLine()) != null) {\n String[] lc = s.split(\" \");\n int a = Integer.parseInt(lc[0]);\n int b = Integer.parseInt(lc[1]);\n \n int gcd = gcd(a,b);\n int lcm = a / gcd * b;\n \n System.out.println(gcd + \" \" + lcm);\n }\n \n }\n \n private static int gcd(int a, int b) {\n \twhile(b!=0){\n \t\tint aa = a;\n \t\ta = b;\n \t\tb = aa%b;\n \t}\n \treturn a;\n }\n}",
"import java.io.*;",
"io.*",
"java",
"public class Main {\n\t \n public static void main(String[] args) throws IOException {\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n \n String s;\n while ((s = br.readLine()) != null) {\n String[] lc = s.split(\" \");\n int a = Integer.parseInt(lc[0]);\n int b = Integer.parseInt(lc[1]);\n \n int gcd = gcd(a,b);\n int lcm = a / gcd * b;\n \n System.out.println(gcd + \" \" + lcm);\n }\n \n }\n \n private static int gcd(int a, int b) {\n \twhile(b!=0){\n \t\tint aa = a;\n \t\ta = b;\n \t\tb = aa%b;\n \t}\n \treturn a;\n }\n}",
"Main",
"public static void main(String[] args) throws IOException {\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n \n String s;\n while ((s = br.readLine()) != null) {\n String[] lc = s.split(\" \");\n int a = Integer.parseInt(lc[0]);\n int b = Integer.parseInt(lc[1]);\n \n int gcd = gcd(a,b);\n int lcm = a / gcd * b;\n \n System.out.println(gcd + \" \" + lcm);\n }\n \n }",
"main",
"{\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n \n String s;\n while ((s = br.readLine()) != null) {\n String[] lc = s.split(\" \");\n int a = Integer.parseInt(lc[0]);\n int b = Integer.parseInt(lc[1]);\n \n int gcd = gcd(a,b);\n int lcm = a / gcd * b;\n \n System.out.println(gcd + \" \" + lcm);\n }\n \n }",
"BufferedReader br = new BufferedReader(new InputStreamReader(System.in));",
"br",
"new BufferedReader(new InputStreamReader(System.in))",
"String s;",
"s",
"while ((s = br.readLine()) != null) {\n String[] lc = s.split(\" \");\n int a = Integer.parseInt(lc[0]);\n int b = Integer.parseInt(lc[1]);\n \n int gcd = gcd(a,b);\n int lcm = a / gcd * b;\n \n System.out.println(gcd + \" \" + lcm);\n }",
"(s = br.readLine()) != null",
"(s = br.readLine())",
"s",
"br.readLine()",
"br.readLine",
"br",
"null",
"{\n String[] lc = s.split(\" \");\n int a = Integer.parseInt(lc[0]);\n int b = Integer.parseInt(lc[1]);\n \n int gcd = gcd(a,b);\n int lcm = a / gcd * b;\n \n System.out.println(gcd + \" \" + lcm);\n }",
"String[] lc = s.split(\" \");",
"lc",
"s.split(\" \")",
"s.split",
"s",
"\" \"",
"int a = Integer.parseInt(lc[0]);",
"a",
"Integer.parseInt(lc[0])",
"Integer.parseInt",
"Integer",
"lc[0]",
"lc",
"0",
"int b = Integer.parseInt(lc[1]);",
"b",
"Integer.parseInt(lc[1])",
"Integer.parseInt",
"Integer",
"lc[1]",
"lc",
"1",
"int gcd = gcd(a,b);",
"gcd",
"gcd(a,b)",
"gcd",
"a",
"b",
"int lcm = a / gcd * b;",
"lcm",
"a / gcd * b",
"a / gcd",
"a",
"gcd",
"b",
"System.out.println(gcd + \" \" + lcm)",
"System.out.println",
"System.out",
"System",
"System.out",
"gcd + \" \" + lcm",
"gcd + \" \" + lcm",
"gcd",
"\" \"",
"lcm",
"String[] args",
"args",
"private static int gcd(int a, int b) {\n \twhile(b!=0){\n \t\tint aa = a;\n \t\ta = b;\n \t\tb = aa%b;\n \t}\n \treturn a;\n }",
"gcd",
"{\n \twhile(b!=0){\n \t\tint aa = a;\n \t\ta = b;\n \t\tb = aa%b;\n \t}\n \treturn a;\n }",
"while(b!=0){\n \t\tint aa = a;\n \t\ta = b;\n \t\tb = aa%b;\n \t}",
"b!=0",
"b",
"0",
"{\n \t\tint aa = a;\n \t\ta = b;\n \t\tb = aa%b;\n \t}",
"int aa = a;",
"aa",
"a",
"a = b",
"a",
"b",
"b = aa%b",
"b",
"aa%b",
"aa",
"b",
"return a;",
"a",
"int a",
"a",
"int b",
"b",
"public class Main {\n\t \n public static void main(String[] args) throws IOException {\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n \n String s;\n while ((s = br.readLine()) != null) {\n String[] lc = s.split(\" \");\n int a = Integer.parseInt(lc[0]);\n int b = Integer.parseInt(lc[1]);\n \n int gcd = gcd(a,b);\n int lcm = a / gcd * b;\n \n System.out.println(gcd + \" \" + lcm);\n }\n \n }\n \n private static int gcd(int a, int b) {\n \twhile(b!=0){\n \t\tint aa = a;\n \t\ta = b;\n \t\tb = aa%b;\n \t}\n \treturn a;\n }\n}",
"public class Main {\n\t \n public static void main(String[] args) throws IOException {\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n \n String s;\n while ((s = br.readLine()) != null) {\n String[] lc = s.split(\" \");\n int a = Integer.parseInt(lc[0]);\n int b = Integer.parseInt(lc[1]);\n \n int gcd = gcd(a,b);\n int lcm = a / gcd * b;\n \n System.out.println(gcd + \" \" + lcm);\n }\n \n }\n \n private static int gcd(int a, int b) {\n \twhile(b!=0){\n \t\tint aa = a;\n \t\ta = b;\n \t\tb = aa%b;\n \t}\n \treturn a;\n }\n}",
"Main"
] |
import java.io.*;
public class Main {
public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
String s;
while ((s = br.readLine()) != null) {
String[] lc = s.split(" ");
int a = Integer.parseInt(lc[0]);
int b = Integer.parseInt(lc[1]);
int gcd = gcd(a,b);
int lcm = a / gcd * b;
System.out.println(gcd + " " + lcm);
}
}
private static int gcd(int a, int b) {
while(b!=0){
int aa = a;
a = b;
b = aa%b;
}
return a;
}
} |
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
14,
2,
13,
17,
29,
13,
29,
4,
13,
13,
2,
13,
13,
23,
13,
23,
13,
12,
13,
30,
41,
13,
20,
42,
4,
18,
13,
30,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
41,
13,
4,
13,
13,
13,
41,
13,
2,
4,
18,
13,
2,
13,
13,
13,
4,
18,
18,
13,
13,
2,
2,
2,
17,
13,
17,
13,
23,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
10,
11
],
[
10,
12
],
[
0,
13
],
[
13,
14
],
[
13,
15
],
[
15,
16
],
[
15,
17
],
[
17,
18
],
[
18,
19
],
[
19,
20
],
[
19,
21
],
[
18,
22
],
[
22,
23
],
[
17,
24
],
[
24,
25
],
[
25,
26
],
[
25,
27
],
[
25,
28
],
[
28,
29
],
[
28,
30
],
[
15,
31
],
[
31,
32
],
[
15,
33
],
[
33,
34
],
[
13,
35
],
[
35,
36
],
[
35,
37
],
[
37,
38
],
[
38,
39
],
[
38,
40
],
[
37,
41
],
[
41,
42
],
[
42,
43
],
[
43,
44
],
[
41,
45
],
[
45,
46
],
[
46,
47
],
[
46,
48
],
[
48,
49
],
[
49,
50
],
[
45,
51
],
[
51,
52
],
[
51,
53
],
[
53,
54
],
[
54,
55
],
[
45,
56
],
[
56,
57
],
[
56,
58
],
[
58,
59
],
[
58,
60
],
[
58,
61
],
[
45,
62
],
[
62,
63
],
[
62,
64
],
[
64,
65
],
[
65,
66
],
[
66,
67
],
[
65,
68
],
[
68,
69
],
[
68,
70
],
[
64,
71
],
[
45,
72
],
[
72,
73
],
[
73,
74
],
[
74,
75
],
[
74,
76
],
[
72,
77
],
[
79,
78
],
[
78,
79
],
[
79,
80
],
[
79,
81
],
[
78,
82
],
[
79,
83
],
[
35,
84
],
[
84,
85
]
] | [
"import java.io.*;\nimport java.util.ArrayList;\nimport java.util.Collections;\nimport java.util.Scanner;\n\nclass Main {\n /* Euclid???????????? */\n public static long gcd(long a, long b) {\n if(b == 0) return a;\n return gcd(b, a % b);\n }\n public static void main(String[] args) throws IOException {\n Scanner in = new Scanner(System.in);\n while (in.hasNextInt()) {\n long a = in.nextInt();\n long b = in.nextInt();\n\n long gcd = gcd(a, b);\n long lcm = Math.abs(a*b) / gcd;\n System.out.println(\"\"+gcd+\" \"+lcm);\n }\n }\n}",
"import java.io.*;",
"io.*",
"java",
"import java.util.ArrayList;",
"ArrayList",
"java.util",
"import java.util.Collections;",
"Collections",
"java.util",
"import java.util.Scanner;",
"Scanner",
"java.util",
"class Main {\n /* Euclid???????????? */\n public static long gcd(long a, long b) {\n if(b == 0) return a;\n return gcd(b, a % b);\n }\n public static void main(String[] args) throws IOException {\n Scanner in = new Scanner(System.in);\n while (in.hasNextInt()) {\n long a = in.nextInt();\n long b = in.nextInt();\n\n long gcd = gcd(a, b);\n long lcm = Math.abs(a*b) / gcd;\n System.out.println(\"\"+gcd+\" \"+lcm);\n }\n }\n}",
"Main",
"/* Euclid???????????? */\n public static long gcd(long a, long b) {\n if(b == 0) return a;\n return gcd(b, a % b);\n }",
"gcd",
"{\n if(b == 0) return a;\n return gcd(b, a % b);\n }",
"if(b == 0) return a;",
"b == 0",
"b",
"0",
"return a;",
"a",
"return gcd(b, a % b);",
"gcd(b, a % b)",
"gcd",
"b",
"a % b",
"a",
"b",
"long a",
"a",
"long b",
"b",
"public static void main(String[] args) throws IOException {\n Scanner in = new Scanner(System.in);\n while (in.hasNextInt()) {\n long a = in.nextInt();\n long b = in.nextInt();\n\n long gcd = gcd(a, b);\n long lcm = Math.abs(a*b) / gcd;\n System.out.println(\"\"+gcd+\" \"+lcm);\n }\n }",
"main",
"{\n Scanner in = new Scanner(System.in);\n while (in.hasNextInt()) {\n long a = in.nextInt();\n long b = in.nextInt();\n\n long gcd = gcd(a, b);\n long lcm = Math.abs(a*b) / gcd;\n System.out.println(\"\"+gcd+\" \"+lcm);\n }\n }",
"Scanner in = new Scanner(System.in);",
"in",
"new Scanner(System.in)",
"while (in.hasNextInt()) {\n long a = in.nextInt();\n long b = in.nextInt();\n\n long gcd = gcd(a, b);\n long lcm = Math.abs(a*b) / gcd;\n System.out.println(\"\"+gcd+\" \"+lcm);\n }",
"in.hasNextInt()",
"in.hasNextInt",
"in",
"{\n long a = in.nextInt();\n long b = in.nextInt();\n\n long gcd = gcd(a, b);\n long lcm = Math.abs(a*b) / gcd;\n System.out.println(\"\"+gcd+\" \"+lcm);\n }",
"long a = in.nextInt();",
"a",
"in.nextInt()",
"in.nextInt",
"in",
"long b = in.nextInt();",
"b",
"in.nextInt()",
"in.nextInt",
"in",
"long gcd = gcd(a, b);",
"gcd",
"gcd(a, b)",
"gcd",
"a",
"b",
"long lcm = Math.abs(a*b) / gcd;",
"lcm",
"Math.abs(a*b) / gcd",
"Math.abs(a*b)",
"Math.abs",
"Math",
"a*b",
"a",
"b",
"gcd",
"System.out.println(\"\"+gcd+\" \"+lcm)",
"System.out.println",
"System.out",
"System",
"System.out",
"\"\"+gcd+\" \"+lcm",
"\" \"",
"\"\"+gcd+\" \"+lcm",
"\"\"",
"gcd",
"\" \"",
"lcm",
"String[] args",
"args"
] | import java.io.*;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Scanner;
class Main {
/* Euclid???????????? */
public static long gcd(long a, long b) {
if(b == 0) return a;
return gcd(b, a % b);
}
public static void main(String[] args) throws IOException {
Scanner in = new Scanner(System.in);
while (in.hasNextInt()) {
long a = in.nextInt();
long b = in.nextInt();
long gcd = gcd(a, b);
long lcm = Math.abs(a*b) / gcd;
System.out.println(""+gcd+" "+lcm);
}
}
} |
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
17,
41,
13,
17,
41,
13,
20,
38,
30,
4,
18,
13,
30,
42,
4,
18,
13,
30,
41,
13,
4,
18,
13,
41,
13,
20,
41,
13,
17,
42,
4,
18,
13,
30,
14,
2,
13,
17,
30,
0,
13,
4,
18,
13,
14,
2,
13,
17,
30,
0,
13,
4,
18,
13,
40,
13,
41,
13,
17,
41,
13,
17,
41,
13,
17,
41,
13,
4,
18,
13,
13,
41,
13,
4,
18,
13,
13,
14,
2,
13,
13,
30,
0,
13,
13,
0,
13,
13,
30,
0,
13,
13,
0,
13,
13,
42,
2,
13,
17,
30,
0,
13,
2,
13,
13,
0,
13,
13,
14,
2,
13,
17,
30,
3,
30,
0,
13,
13,
41,
13,
2,
2,
13,
13,
13,
4,
18,
18,
13,
13,
2,
2,
13,
17,
13,
23,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
8,
15
],
[
15,
16
],
[
15,
17
],
[
8,
18
],
[
18,
19
],
[
19,
20
],
[
20,
21
],
[
21,
22
],
[
18,
23
],
[
23,
24
],
[
24,
25
],
[
25,
26
],
[
26,
27
],
[
24,
28
],
[
28,
29
],
[
29,
30
],
[
29,
31
],
[
31,
32
],
[
32,
33
],
[
28,
34
],
[
34,
35
],
[
34,
36
],
[
28,
37
],
[
37,
38
],
[
37,
39
],
[
28,
40
],
[
40,
41
],
[
41,
42
],
[
42,
43
],
[
40,
44
],
[
44,
45
],
[
45,
46
],
[
46,
47
],
[
46,
48
],
[
45,
49
],
[
49,
50
],
[
50,
51
],
[
50,
52
],
[
52,
53
],
[
53,
54
],
[
44,
55
],
[
55,
56
],
[
56,
57
],
[
56,
58
],
[
55,
59
],
[
59,
60
],
[
60,
61
],
[
60,
62
],
[
62,
63
],
[
63,
64
],
[
59,
65
],
[
65,
66
],
[
28,
67
],
[
67,
68
],
[
67,
69
],
[
28,
70
],
[
70,
71
],
[
70,
72
],
[
28,
73
],
[
73,
74
],
[
73,
75
],
[
28,
76
],
[
76,
77
],
[
76,
78
],
[
78,
79
],
[
79,
80
],
[
78,
81
],
[
28,
82
],
[
82,
83
],
[
82,
84
],
[
84,
85
],
[
85,
86
],
[
84,
87
],
[
28,
88
],
[
88,
89
],
[
89,
90
],
[
89,
91
],
[
88,
92
],
[
92,
93
],
[
93,
94
],
[
93,
95
],
[
92,
96
],
[
96,
97
],
[
96,
98
],
[
88,
99
],
[
99,
100
],
[
100,
101
],
[
100,
102
],
[
99,
103
],
[
103,
104
],
[
103,
105
],
[
28,
106
],
[
106,
107
],
[
107,
108
],
[
107,
109
],
[
106,
110
],
[
110,
111
],
[
111,
112
],
[
111,
113
],
[
113,
114
],
[
113,
115
],
[
110,
116
],
[
116,
117
],
[
116,
118
],
[
110,
119
],
[
119,
120
],
[
120,
121
],
[
120,
122
],
[
119,
123
],
[
123,
124
],
[
119,
125
],
[
125,
126
],
[
126,
127
],
[
126,
128
],
[
28,
129
],
[
129,
130
],
[
129,
131
],
[
131,
132
],
[
132,
133
],
[
132,
134
],
[
131,
135
],
[
28,
136
],
[
136,
137
],
[
137,
138
],
[
138,
139
],
[
138,
140
],
[
136,
141
],
[
142,
142
],
[
142,
143
],
[
142,
144
],
[
142,
145
],
[
6,
146
],
[
146,
147
]
] | [
"import java.util.*;\nclass Main{\n public static void main(String[] a){\n String b =\" \";\n String c =\" \";\n Scanner k = new Scanner( System.in);\n try{\n while(k.hasNextLine()){\n String line = k.nextLine();\n StringTokenizer st = new StringTokenizer(line);\n int count=0;\n while(st.hasMoreTokens()){\n if(count==1){\n c=st.nextToken();\n }\n if(count==0){\n b = st.nextToken();\n count++;\n }\n }\n long dividend=0;\n long divisor=0;\n long remainder=1;\n long i = Long.parseLong(b);\n long j = Long.parseLong(c);\n if(i>j){\n dividend = i;\n divisor = j;\n }else{\n dividend = j;\n divisor = i;\n }\n while(remainder!=0){ \n remainder = dividend%divisor;\n dividend = divisor;\n \n if(remainder==0){\n break;\n }else{\n divisor = remainder;\n }\n }\n long lcm = (i*j)/divisor;\n System.out.println(divisor+\" \"+lcm);\n \n }\n \n }finally{\n k.close();\n }\n }\n}",
"import java.util.*;",
"util.*",
"java",
"class Main{\n public static void main(String[] a){\n String b =\" \";\n String c =\" \";\n Scanner k = new Scanner( System.in);\n try{\n while(k.hasNextLine()){\n String line = k.nextLine();\n StringTokenizer st = new StringTokenizer(line);\n int count=0;\n while(st.hasMoreTokens()){\n if(count==1){\n c=st.nextToken();\n }\n if(count==0){\n b = st.nextToken();\n count++;\n }\n }\n long dividend=0;\n long divisor=0;\n long remainder=1;\n long i = Long.parseLong(b);\n long j = Long.parseLong(c);\n if(i>j){\n dividend = i;\n divisor = j;\n }else{\n dividend = j;\n divisor = i;\n }\n while(remainder!=0){ \n remainder = dividend%divisor;\n dividend = divisor;\n \n if(remainder==0){\n break;\n }else{\n divisor = remainder;\n }\n }\n long lcm = (i*j)/divisor;\n System.out.println(divisor+\" \"+lcm);\n \n }\n \n }finally{\n k.close();\n }\n }\n}",
"Main",
"public static void main(String[] a){\n String b =\" \";\n String c =\" \";\n Scanner k = new Scanner( System.in);\n try{\n while(k.hasNextLine()){\n String line = k.nextLine();\n StringTokenizer st = new StringTokenizer(line);\n int count=0;\n while(st.hasMoreTokens()){\n if(count==1){\n c=st.nextToken();\n }\n if(count==0){\n b = st.nextToken();\n count++;\n }\n }\n long dividend=0;\n long divisor=0;\n long remainder=1;\n long i = Long.parseLong(b);\n long j = Long.parseLong(c);\n if(i>j){\n dividend = i;\n divisor = j;\n }else{\n dividend = j;\n divisor = i;\n }\n while(remainder!=0){ \n remainder = dividend%divisor;\n dividend = divisor;\n \n if(remainder==0){\n break;\n }else{\n divisor = remainder;\n }\n }\n long lcm = (i*j)/divisor;\n System.out.println(divisor+\" \"+lcm);\n \n }\n \n }finally{\n k.close();\n }\n }",
"main",
"{\n String b =\" \";\n String c =\" \";\n Scanner k = new Scanner( System.in);\n try{\n while(k.hasNextLine()){\n String line = k.nextLine();\n StringTokenizer st = new StringTokenizer(line);\n int count=0;\n while(st.hasMoreTokens()){\n if(count==1){\n c=st.nextToken();\n }\n if(count==0){\n b = st.nextToken();\n count++;\n }\n }\n long dividend=0;\n long divisor=0;\n long remainder=1;\n long i = Long.parseLong(b);\n long j = Long.parseLong(c);\n if(i>j){\n dividend = i;\n divisor = j;\n }else{\n dividend = j;\n divisor = i;\n }\n while(remainder!=0){ \n remainder = dividend%divisor;\n dividend = divisor;\n \n if(remainder==0){\n break;\n }else{\n divisor = remainder;\n }\n }\n long lcm = (i*j)/divisor;\n System.out.println(divisor+\" \"+lcm);\n \n }\n \n }finally{\n k.close();\n }\n }",
"String b =\" \";",
"b",
"\" \"",
"String c =\" \";",
"c",
"\" \"",
"Scanner k = new Scanner( System.in);",
"k",
"new Scanner( System.in)",
"try{\n while(k.hasNextLine()){\n String line = k.nextLine();\n StringTokenizer st = new StringTokenizer(line);\n int count=0;\n while(st.hasMoreTokens()){\n if(count==1){\n c=st.nextToken();\n }\n if(count==0){\n b = st.nextToken();\n count++;\n }\n }\n long dividend=0;\n long divisor=0;\n long remainder=1;\n long i = Long.parseLong(b);\n long j = Long.parseLong(c);\n if(i>j){\n dividend = i;\n divisor = j;\n }else{\n dividend = j;\n divisor = i;\n }\n while(remainder!=0){ \n remainder = dividend%divisor;\n dividend = divisor;\n \n if(remainder==0){\n break;\n }else{\n divisor = remainder;\n }\n }\n long lcm = (i*j)/divisor;\n System.out.println(divisor+\" \"+lcm);\n \n }\n \n }finally{\n k.close();\n }",
"{\n k.close();\n }",
"k.close()",
"k.close",
"k",
"{\n while(k.hasNextLine()){\n String line = k.nextLine();\n StringTokenizer st = new StringTokenizer(line);\n int count=0;\n while(st.hasMoreTokens()){\n if(count==1){\n c=st.nextToken();\n }\n if(count==0){\n b = st.nextToken();\n count++;\n }\n }\n long dividend=0;\n long divisor=0;\n long remainder=1;\n long i = Long.parseLong(b);\n long j = Long.parseLong(c);\n if(i>j){\n dividend = i;\n divisor = j;\n }else{\n dividend = j;\n divisor = i;\n }\n while(remainder!=0){ \n remainder = dividend%divisor;\n dividend = divisor;\n \n if(remainder==0){\n break;\n }else{\n divisor = remainder;\n }\n }\n long lcm = (i*j)/divisor;\n System.out.println(divisor+\" \"+lcm);\n \n }\n \n }",
"while(k.hasNextLine()){\n String line = k.nextLine();\n StringTokenizer st = new StringTokenizer(line);\n int count=0;\n while(st.hasMoreTokens()){\n if(count==1){\n c=st.nextToken();\n }\n if(count==0){\n b = st.nextToken();\n count++;\n }\n }\n long dividend=0;\n long divisor=0;\n long remainder=1;\n long i = Long.parseLong(b);\n long j = Long.parseLong(c);\n if(i>j){\n dividend = i;\n divisor = j;\n }else{\n dividend = j;\n divisor = i;\n }\n while(remainder!=0){ \n remainder = dividend%divisor;\n dividend = divisor;\n \n if(remainder==0){\n break;\n }else{\n divisor = remainder;\n }\n }\n long lcm = (i*j)/divisor;\n System.out.println(divisor+\" \"+lcm);\n \n }",
"k.hasNextLine()",
"k.hasNextLine",
"k",
"{\n String line = k.nextLine();\n StringTokenizer st = new StringTokenizer(line);\n int count=0;\n while(st.hasMoreTokens()){\n if(count==1){\n c=st.nextToken();\n }\n if(count==0){\n b = st.nextToken();\n count++;\n }\n }\n long dividend=0;\n long divisor=0;\n long remainder=1;\n long i = Long.parseLong(b);\n long j = Long.parseLong(c);\n if(i>j){\n dividend = i;\n divisor = j;\n }else{\n dividend = j;\n divisor = i;\n }\n while(remainder!=0){ \n remainder = dividend%divisor;\n dividend = divisor;\n \n if(remainder==0){\n break;\n }else{\n divisor = remainder;\n }\n }\n long lcm = (i*j)/divisor;\n System.out.println(divisor+\" \"+lcm);\n \n }",
"String line = k.nextLine();",
"line",
"k.nextLine()",
"k.nextLine",
"k",
"StringTokenizer st = new StringTokenizer(line);",
"st",
"new StringTokenizer(line)",
"int count=0;",
"count",
"0",
"while(st.hasMoreTokens()){\n if(count==1){\n c=st.nextToken();\n }\n if(count==0){\n b = st.nextToken();\n count++;\n }\n }",
"st.hasMoreTokens()",
"st.hasMoreTokens",
"st",
"{\n if(count==1){\n c=st.nextToken();\n }\n if(count==0){\n b = st.nextToken();\n count++;\n }\n }",
"if(count==1){\n c=st.nextToken();\n }",
"count==1",
"count",
"1",
"{\n c=st.nextToken();\n }",
"c=st.nextToken()",
"c",
"st.nextToken()",
"st.nextToken",
"st",
"if(count==0){\n b = st.nextToken();\n count++;\n }",
"count==0",
"count",
"0",
"{\n b = st.nextToken();\n count++;\n }",
"b = st.nextToken()",
"b",
"st.nextToken()",
"st.nextToken",
"st",
"count++",
"count",
"long dividend=0;",
"dividend",
"0",
"long divisor=0;",
"divisor",
"0",
"long remainder=1;",
"remainder",
"1",
"long i = Long.parseLong(b);",
"i",
"Long.parseLong(b)",
"Long.parseLong",
"Long",
"b",
"long j = Long.parseLong(c);",
"j",
"Long.parseLong(c)",
"Long.parseLong",
"Long",
"c",
"if(i>j){\n dividend = i;\n divisor = j;\n }else{\n dividend = j;\n divisor = i;\n }",
"i>j",
"i",
"j",
"{\n dividend = i;\n divisor = j;\n }",
"dividend = i",
"dividend",
"i",
"divisor = j",
"divisor",
"j",
"{\n dividend = j;\n divisor = i;\n }",
"dividend = j",
"dividend",
"j",
"divisor = i",
"divisor",
"i",
"while(remainder!=0){ \n remainder = dividend%divisor;\n dividend = divisor;\n \n if(remainder==0){\n break;\n }else{\n divisor = remainder;\n }\n }",
"remainder!=0",
"remainder",
"0",
"{ \n remainder = dividend%divisor;\n dividend = divisor;\n \n if(remainder==0){\n break;\n }else{\n divisor = remainder;\n }\n }",
"remainder = dividend%divisor",
"remainder",
"dividend%divisor",
"dividend",
"divisor",
"dividend = divisor",
"dividend",
"divisor",
"if(remainder==0){\n break;\n }else{\n divisor = remainder;\n }",
"remainder==0",
"remainder",
"0",
"{\n break;\n }",
"break;",
"{\n divisor = remainder;\n }",
"divisor = remainder",
"divisor",
"remainder",
"long lcm = (i*j)/divisor;",
"lcm",
"(i*j)/divisor",
"(i*j)",
"i",
"j",
"divisor",
"System.out.println(divisor+\" \"+lcm)",
"System.out.println",
"System.out",
"System",
"System.out",
"divisor+\" \"+lcm",
"divisor+\" \"+lcm",
"divisor",
"\" \"",
"lcm",
"String[] a",
"a"
] | import java.util.*;
class Main{
public static void main(String[] a){
String b =" ";
String c =" ";
Scanner k = new Scanner( System.in);
try{
while(k.hasNextLine()){
String line = k.nextLine();
StringTokenizer st = new StringTokenizer(line);
int count=0;
while(st.hasMoreTokens()){
if(count==1){
c=st.nextToken();
}
if(count==0){
b = st.nextToken();
count++;
}
}
long dividend=0;
long divisor=0;
long remainder=1;
long i = Long.parseLong(b);
long j = Long.parseLong(c);
if(i>j){
dividend = i;
divisor = j;
}else{
dividend = j;
divisor = i;
}
while(remainder!=0){
remainder = dividend%divisor;
dividend = divisor;
if(remainder==0){
break;
}else{
divisor = remainder;
}
}
long lcm = (i*j)/divisor;
System.out.println(divisor+" "+lcm);
}
}finally{
k.close();
}
}
} |
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
42,
4,
18,
13,
30,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
41,
13,
4,
13,
13,
13,
41,
13,
2,
2,
13,
13,
13,
4,
18,
18,
13,
13,
2,
2,
13,
17,
13,
4,
18,
13,
23,
13,
12,
13,
30,
14,
2,
13,
13,
30,
14,
2,
2,
13,
13,
17,
30,
29,
13,
30,
29,
4,
13,
13,
2,
13,
13,
30,
14,
2,
2,
13,
13,
17,
30,
29,
13,
30,
29,
4,
13,
2,
13,
13,
13,
23,
13,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
103,
5
],
[
103,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
13,
14
],
[
14,
15
],
[
12,
16
],
[
16,
17
],
[
17,
18
],
[
17,
19
],
[
19,
20
],
[
20,
21
],
[
16,
22
],
[
22,
23
],
[
22,
24
],
[
24,
25
],
[
25,
26
],
[
16,
27
],
[
27,
28
],
[
27,
29
],
[
29,
30
],
[
29,
31
],
[
29,
32
],
[
16,
33
],
[
33,
34
],
[
33,
35
],
[
35,
36
],
[
36,
37
],
[
36,
38
],
[
35,
39
],
[
16,
40
],
[
40,
41
],
[
41,
42
],
[
42,
43
],
[
42,
44
],
[
40,
45
],
[
46,
46
],
[
46,
47
],
[
46,
48
],
[
46,
49
],
[
8,
50
],
[
50,
51
],
[
51,
52
],
[
6,
53
],
[
53,
54
],
[
103,
55
],
[
55,
56
],
[
55,
57
],
[
57,
58
],
[
58,
59
],
[
59,
60
],
[
59,
61
],
[
58,
62
],
[
62,
63
],
[
63,
64
],
[
64,
65
],
[
65,
66
],
[
65,
67
],
[
64,
68
],
[
63,
69
],
[
69,
70
],
[
70,
71
],
[
63,
72
],
[
72,
73
],
[
73,
74
],
[
74,
75
],
[
74,
76
],
[
74,
77
],
[
77,
78
],
[
77,
79
],
[
58,
80
],
[
80,
81
],
[
81,
82
],
[
82,
83
],
[
83,
84
],
[
83,
85
],
[
82,
86
],
[
81,
87
],
[
87,
88
],
[
88,
89
],
[
81,
90
],
[
90,
91
],
[
91,
92
],
[
92,
93
],
[
92,
94
],
[
94,
95
],
[
94,
96
],
[
92,
97
],
[
55,
98
],
[
98,
99
],
[
55,
100
],
[
100,
101
],
[
0,
102
],
[
102,
103
],
[
102,
104
]
] | [
"import java.util.Scanner;\n\npublic class Main {\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n while (sc.hasNext()) {\n int a = sc.nextInt();\n int b = sc.nextInt();\n int GCD = GCD(a, b);\n int LCM = a / GCD * b;\n System.out.println(GCD + \" \" + LCM);\n }\n sc.close();\n }\n\n static int GCD(int a, int b) {\n if (a < b) {\n if (b % a == 0) {\n return a;\n } else {\n return GCD(a, b % a);\n }\n } else {\n if (a % b == 0) {\n return b;\n } else {\n return GCD(a % b, b);\n }\n }\n }\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n while (sc.hasNext()) {\n int a = sc.nextInt();\n int b = sc.nextInt();\n int GCD = GCD(a, b);\n int LCM = a / GCD * b;\n System.out.println(GCD + \" \" + LCM);\n }\n sc.close();\n }\n\n static int GCD(int a, int b) {\n if (a < b) {\n if (b % a == 0) {\n return a;\n } else {\n return GCD(a, b % a);\n }\n } else {\n if (a % b == 0) {\n return b;\n } else {\n return GCD(a % b, b);\n }\n }\n }\n}",
"Main",
"public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n while (sc.hasNext()) {\n int a = sc.nextInt();\n int b = sc.nextInt();\n int GCD = GCD(a, b);\n int LCM = a / GCD * b;\n System.out.println(GCD + \" \" + LCM);\n }\n sc.close();\n }",
"main",
"{\n Scanner sc = new Scanner(System.in);\n while (sc.hasNext()) {\n int a = sc.nextInt();\n int b = sc.nextInt();\n int GCD = GCD(a, b);\n int LCM = a / GCD * b;\n System.out.println(GCD + \" \" + LCM);\n }\n sc.close();\n }",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"while (sc.hasNext()) {\n int a = sc.nextInt();\n int b = sc.nextInt();\n int GCD = GCD(a, b);\n int LCM = a / GCD * b;\n System.out.println(GCD + \" \" + LCM);\n }",
"sc.hasNext()",
"sc.hasNext",
"sc",
"{\n int a = sc.nextInt();\n int b = sc.nextInt();\n int GCD = GCD(a, b);\n int LCM = a / GCD * b;\n System.out.println(GCD + \" \" + LCM);\n }",
"int a = sc.nextInt();",
"a",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int b = sc.nextInt();",
"b",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int GCD = GCD(a, b);",
"GCD",
"GCD(a, b)",
"GCD",
"a",
"b",
"int LCM = a / GCD * b;",
"LCM",
"a / GCD * b",
"a / GCD",
"a",
"GCD",
"b",
"System.out.println(GCD + \" \" + LCM)",
"System.out.println",
"System.out",
"System",
"System.out",
"GCD + \" \" + LCM",
"GCD + \" \" + LCM",
"GCD",
"\" \"",
"LCM",
"sc.close()",
"sc.close",
"sc",
"String[] args",
"args",
"static int GCD(int a, int b) {\n if (a < b) {\n if (b % a == 0) {\n return a;\n } else {\n return GCD(a, b % a);\n }\n } else {\n if (a % b == 0) {\n return b;\n } else {\n return GCD(a % b, b);\n }\n }\n }",
"GCD",
"{\n if (a < b) {\n if (b % a == 0) {\n return a;\n } else {\n return GCD(a, b % a);\n }\n } else {\n if (a % b == 0) {\n return b;\n } else {\n return GCD(a % b, b);\n }\n }\n }",
"if (a < b) {\n if (b % a == 0) {\n return a;\n } else {\n return GCD(a, b % a);\n }\n } else {\n if (a % b == 0) {\n return b;\n } else {\n return GCD(a % b, b);\n }\n }",
"a < b",
"a",
"b",
"{\n if (b % a == 0) {\n return a;\n } else {\n return GCD(a, b % a);\n }\n }",
"if (b % a == 0) {\n return a;\n } else {\n return GCD(a, b % a);\n }",
"b % a == 0",
"b % a",
"b",
"a",
"0",
"{\n return a;\n }",
"return a;",
"a",
"{\n return GCD(a, b % a);\n }",
"return GCD(a, b % a);",
"GCD(a, b % a)",
"GCD",
"a",
"b % a",
"b",
"a",
"{\n if (a % b == 0) {\n return b;\n } else {\n return GCD(a % b, b);\n }\n }",
"if (a % b == 0) {\n return b;\n } else {\n return GCD(a % b, b);\n }",
"a % b == 0",
"a % b",
"a",
"b",
"0",
"{\n return b;\n }",
"return b;",
"b",
"{\n return GCD(a % b, b);\n }",
"return GCD(a % b, b);",
"GCD(a % b, b)",
"GCD",
"a % b",
"a",
"b",
"b",
"int a",
"a",
"int b",
"b",
"public class Main {\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n while (sc.hasNext()) {\n int a = sc.nextInt();\n int b = sc.nextInt();\n int GCD = GCD(a, b);\n int LCM = a / GCD * b;\n System.out.println(GCD + \" \" + LCM);\n }\n sc.close();\n }\n\n static int GCD(int a, int b) {\n if (a < b) {\n if (b % a == 0) {\n return a;\n } else {\n return GCD(a, b % a);\n }\n } else {\n if (a % b == 0) {\n return b;\n } else {\n return GCD(a % b, b);\n }\n }\n }\n}",
"public class Main {\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n while (sc.hasNext()) {\n int a = sc.nextInt();\n int b = sc.nextInt();\n int GCD = GCD(a, b);\n int LCM = a / GCD * b;\n System.out.println(GCD + \" \" + LCM);\n }\n sc.close();\n }\n\n static int GCD(int a, int b) {\n if (a < b) {\n if (b % a == 0) {\n return a;\n } else {\n return GCD(a, b % a);\n }\n } else {\n if (a % b == 0) {\n return b;\n } else {\n return GCD(a % b, b);\n }\n }\n }\n}",
"Main"
] | import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
while (sc.hasNext()) {
int a = sc.nextInt();
int b = sc.nextInt();
int GCD = GCD(a, b);
int LCM = a / GCD * b;
System.out.println(GCD + " " + LCM);
}
sc.close();
}
static int GCD(int a, int b) {
if (a < b) {
if (b % a == 0) {
return a;
} else {
return GCD(a, b % a);
}
} else {
if (a % b == 0) {
return b;
} else {
return GCD(a % b, b);
}
}
}
}
|
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
41,
13,
20,
41,
13,
4,
18,
13,
17,
41,
13,
17,
12,
13,
30,
41,
13,
42,
2,
0,
13,
4,
18,
13,
17,
30,
41,
13,
4,
18,
13,
17,
41,
13,
4,
18,
13,
18,
13,
17,
41,
13,
4,
18,
13,
18,
13,
17,
4,
18,
18,
13,
13,
2,
2,
4,
13,
13,
13,
17,
4,
13,
13,
13,
12,
13,
30,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
4,
18,
18,
13,
13,
18,
13,
13,
14,
2,
13,
2,
13,
17,
4,
18,
18,
13,
13,
17,
4,
18,
18,
13,
13,
17,
23,
13,
23,
13,
12,
13,
30,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
4,
13,
18,
13,
13,
13,
23,
13,
23,
13,
23,
13,
12,
13,
30,
29,
4,
18,
13,
4,
18,
4,
18,
13,
12,
13,
30,
29,
4,
18,
13,
4,
18,
4,
18,
13,
12,
13,
30,
29,
4,
18,
13,
12,
13,
30,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
14,
2,
2,
13,
13,
17,
29,
17,
29,
17,
23,
13,
12,
13,
30,
41,
13,
20,
4,
18,
13,
17,
41,
13,
17,
41,
13,
17,
42,
2,
4,
18,
13,
13,
30,
0,
13,
17,
41,
13,
4,
18,
13,
13,
28,
13,
13,
30,
30,
14,
2,
13,
13,
30,
4,
18,
13,
13,
3,
14,
2,
2,
13,
13,
17,
3,
29,
4,
18,
13,
2,
4,
18,
13,
17,
23,
13,
12,
13,
30,
29,
2,
2,
13,
13,
4,
13,
13,
13,
23,
13,
23,
13,
12,
13,
30,
14,
2,
13,
13,
30,
41,
13,
13,
0,
13,
13,
0,
13,
13,
41,
13,
2,
13,
13,
14,
2,
13,
17,
29,
13,
29,
4,
13,
13,
13,
23,
13,
23,
13,
12,
13,
30,
4,
18,
18,
13,
13,
2,
2,
2,
17,
13,
17,
13,
23,
13,
23,
13,
12,
13,
30,
4,
18,
20,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
354,
11
],
[
354,
12
],
[
12,
13
],
[
12,
14
],
[
354,
15
],
[
15,
16
],
[
15,
17
],
[
17,
18
],
[
18,
19
],
[
17,
20
],
[
354,
21
],
[
21,
22
],
[
21,
23
],
[
354,
24
],
[
24,
25
],
[
24,
26
],
[
26,
27
],
[
27,
28
],
[
26,
29
],
[
29,
30
],
[
30,
31
],
[
31,
32
],
[
31,
33
],
[
33,
34
],
[
34,
35
],
[
30,
36
],
[
29,
37
],
[
37,
38
],
[
38,
39
],
[
38,
40
],
[
40,
41
],
[
41,
42
],
[
40,
43
],
[
37,
44
],
[
44,
45
],
[
44,
46
],
[
46,
47
],
[
47,
48
],
[
46,
49
],
[
49,
50
],
[
49,
51
],
[
37,
52
],
[
52,
53
],
[
52,
54
],
[
54,
55
],
[
55,
56
],
[
54,
57
],
[
57,
58
],
[
57,
59
],
[
37,
60
],
[
60,
61
],
[
61,
62
],
[
62,
63
],
[
62,
64
],
[
60,
65
],
[
66,
66
],
[
66,
67
],
[
67,
68
],
[
67,
69
],
[
67,
70
],
[
66,
71
],
[
66,
72
],
[
72,
73
],
[
72,
74
],
[
72,
75
],
[
354,
76
],
[
76,
77
],
[
76,
78
],
[
78,
79
],
[
79,
80
],
[
80,
81
],
[
81,
82
],
[
81,
83
],
[
79,
84
],
[
84,
85
],
[
84,
86
],
[
79,
87
],
[
87,
88
],
[
88,
89
],
[
79,
90
],
[
91,
91
],
[
91,
92
],
[
92,
93
],
[
93,
94
],
[
94,
95
],
[
94,
96
],
[
92,
97
],
[
97,
98
],
[
97,
99
],
[
91,
100
],
[
100,
101
],
[
101,
102
],
[
101,
103
],
[
103,
104
],
[
103,
105
],
[
100,
106
],
[
106,
107
],
[
107,
108
],
[
108,
109
],
[
108,
110
],
[
106,
111
],
[
78,
112
],
[
112,
113
],
[
113,
114
],
[
114,
115
],
[
114,
116
],
[
112,
117
],
[
76,
118
],
[
118,
119
],
[
76,
120
],
[
120,
121
],
[
354,
122
],
[
122,
123
],
[
122,
124
],
[
124,
125
],
[
125,
126
],
[
126,
127
],
[
127,
128
],
[
127,
129
],
[
125,
130
],
[
130,
131
],
[
130,
132
],
[
125,
133
],
[
133,
134
],
[
134,
135
],
[
125,
136
],
[
136,
137
],
[
137,
138
],
[
137,
139
],
[
139,
140
],
[
139,
141
],
[
137,
142
],
[
122,
143
],
[
143,
144
],
[
122,
145
],
[
145,
146
],
[
122,
147
],
[
147,
148
],
[
354,
149
],
[
149,
150
],
[
149,
151
],
[
151,
152
],
[
152,
153
],
[
153,
154
],
[
154,
155
],
[
153,
156
],
[
156,
157
],
[
157,
158
],
[
158,
159
],
[
159,
160
],
[
354,
161
],
[
161,
162
],
[
161,
163
],
[
163,
164
],
[
164,
165
],
[
165,
166
],
[
166,
167
],
[
165,
168
],
[
168,
169
],
[
169,
170
],
[
170,
171
],
[
171,
172
],
[
354,
173
],
[
173,
174
],
[
173,
175
],
[
175,
176
],
[
176,
177
],
[
177,
178
],
[
178,
179
],
[
354,
180
],
[
180,
181
],
[
180,
182
],
[
182,
183
],
[
183,
184
],
[
184,
185
],
[
185,
186
],
[
185,
187
],
[
183,
188
],
[
188,
189
],
[
188,
190
],
[
183,
191
],
[
191,
192
],
[
192,
193
],
[
183,
194
],
[
195,
195
],
[
195,
196
],
[
196,
197
],
[
197,
198
],
[
198,
199
],
[
198,
200
],
[
197,
201
],
[
196,
202
],
[
202,
203
],
[
182,
204
],
[
204,
205
],
[
180,
206
],
[
206,
207
],
[
354,
208
],
[
208,
209
],
[
208,
210
],
[
210,
211
],
[
211,
212
],
[
211,
213
],
[
210,
214
],
[
214,
215
],
[
215,
216
],
[
214,
217
],
[
210,
218
],
[
218,
219
],
[
218,
220
],
[
210,
221
],
[
221,
222
],
[
221,
223
],
[
210,
224
],
[
224,
225
],
[
225,
226
],
[
226,
227
],
[
227,
228
],
[
225,
229
],
[
224,
230
],
[
230,
231
],
[
231,
232
],
[
231,
233
],
[
230,
234
],
[
234,
235
],
[
234,
236
],
[
236,
237
],
[
237,
238
],
[
236,
239
],
[
230,
240
],
[
240,
241
],
[
240,
242
],
[
240,
243
],
[
244,
244
],
[
244,
245
],
[
245,
246
],
[
246,
247
],
[
246,
248
],
[
245,
249
],
[
249,
250
],
[
250,
251
],
[
251,
252
],
[
250,
253
],
[
249,
254
],
[
244,
255
],
[
255,
256
],
[
256,
257
],
[
257,
258
],
[
257,
259
],
[
256,
260
],
[
255,
261
],
[
210,
262
],
[
262,
263
],
[
263,
264
],
[
264,
265
],
[
263,
266
],
[
266,
267
],
[
267,
268
],
[
268,
269
],
[
266,
270
],
[
208,
271
],
[
271,
272
],
[
354,
273
],
[
273,
274
],
[
273,
275
],
[
275,
276
],
[
276,
277
],
[
277,
278
],
[
278,
279
],
[
278,
280
],
[
277,
281
],
[
281,
282
],
[
281,
283
],
[
281,
284
],
[
273,
285
],
[
285,
286
],
[
273,
287
],
[
287,
288
],
[
354,
289
],
[
289,
290
],
[
289,
291
],
[
291,
292
],
[
292,
293
],
[
293,
294
],
[
293,
295
],
[
292,
296
],
[
296,
297
],
[
297,
298
],
[
297,
299
],
[
296,
300
],
[
300,
301
],
[
300,
302
],
[
296,
303
],
[
303,
304
],
[
303,
305
],
[
291,
306
],
[
306,
307
],
[
306,
308
],
[
308,
309
],
[
308,
310
],
[
291,
311
],
[
311,
312
],
[
312,
313
],
[
312,
314
],
[
311,
315
],
[
315,
316
],
[
311,
317
],
[
317,
318
],
[
318,
319
],
[
318,
320
],
[
318,
321
],
[
289,
322
],
[
322,
323
],
[
289,
324
],
[
324,
325
],
[
354,
326
],
[
326,
327
],
[
326,
328
],
[
328,
329
],
[
329,
330
],
[
330,
331
],
[
331,
332
],
[
331,
333
],
[
329,
334
],
[
336,
335
],
[
335,
336
],
[
336,
337
],
[
336,
338
],
[
335,
339
],
[
336,
340
],
[
326,
341
],
[
341,
342
],
[
326,
343
],
[
343,
344
],
[
354,
345
],
[
345,
346
],
[
345,
347
],
[
347,
348
],
[
348,
349
],
[
349,
350
],
[
345,
351
],
[
351,
352
],
[
0,
353
],
[
353,
354
],
[
353,
355
]
] | [
"import java.io.BufferedReader;\nimport java.io.InputStreamReader;\nimport java.util.*;\n\npublic class Main {\n final BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n final String LINE_SPR = System.getProperty(\"line.separator\");\n final int BIG_MOD = 1000000007;\n\n void run() throws Exception {\n String line;\n while((line = br.readLine()) != null) {\n String[] nums = line.split(\" \");\n long a = Integer.parseInt(nums[0]);\n long b = Integer.parseInt(nums[1]);\n System.out.println(gcd(a, b) + \" \" + lcm(a, b));\n }\n }\n\n\n /*\n * Templates\n */\n void dumpObjArr(Object[] arr, int n) {\n for(int i = 0; i < n; i++) {\n System.out.print(arr[i]);\n if(i < n - 1)\n System.out.print(\" \");\n }\n System.out.println(\"\");\n }\n\n void dumpObjArr2(Object[][] arr, int m, int n) {\n for(int j = 0; j < m; j++) \n dumpObjArr(arr[j], n);\n }\n\n int ni() throws Exception {\n return Integer.parseInt(br.readLine().trim());\n }\n\n long nl() throws Exception {\n return Long.parseLong(br.readLine().trim());\n }\n\n String ns() throws Exception {\n return br.readLine();\n }\n\n boolean isPrime(int n) {\n for(int i=2;i<n;i++) {\n if(n%i==0)\n return false;\n }\n return true;\n }\n\n int getPrime(int n) {\n List<Integer> primes = new ArrayList<Integer>();\n primes.add(2);\n int count = 1;\n\n int x = 1;\n while(primes.size() < n) {\n x+=2;\n int m = (int)Math.sqrt(x);\n for(int p : primes) {\n if(p > m) {\n primes.add(x);\n break;\n }\n\n if(x % p == 0) \n break;\n }\n }\n\n return primes.get(primes.size() - 1);\n }\n\n long lcm(long a, long b) {\n return a * b / gcd(a, b);\n }\n\n long gcd(long a, long b) {\n if(a < b) {\n long tmp = a;\n a = b;\n b = tmp;\n }\n // a >= b\n long mod = a % b;\n if(mod == 0) \n return b;\n else \n return gcd(b, mod);\n }\n\n void gcjPrint(String str, int t) {\n System.out.println(\"Case #\" + t + \": \" + str);\n }\n\n public static void main(String[] args) throws Exception {\n new Main().run();\n }\n}",
"import java.io.BufferedReader;",
"BufferedReader",
"java.io",
"import java.io.InputStreamReader;",
"InputStreamReader",
"java.io",
"import java.util.*;",
"util.*",
"java",
"public class Main {\n final BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n final String LINE_SPR = System.getProperty(\"line.separator\");\n final int BIG_MOD = 1000000007;\n\n void run() throws Exception {\n String line;\n while((line = br.readLine()) != null) {\n String[] nums = line.split(\" \");\n long a = Integer.parseInt(nums[0]);\n long b = Integer.parseInt(nums[1]);\n System.out.println(gcd(a, b) + \" \" + lcm(a, b));\n }\n }\n\n\n /*\n * Templates\n */\n void dumpObjArr(Object[] arr, int n) {\n for(int i = 0; i < n; i++) {\n System.out.print(arr[i]);\n if(i < n - 1)\n System.out.print(\" \");\n }\n System.out.println(\"\");\n }\n\n void dumpObjArr2(Object[][] arr, int m, int n) {\n for(int j = 0; j < m; j++) \n dumpObjArr(arr[j], n);\n }\n\n int ni() throws Exception {\n return Integer.parseInt(br.readLine().trim());\n }\n\n long nl() throws Exception {\n return Long.parseLong(br.readLine().trim());\n }\n\n String ns() throws Exception {\n return br.readLine();\n }\n\n boolean isPrime(int n) {\n for(int i=2;i<n;i++) {\n if(n%i==0)\n return false;\n }\n return true;\n }\n\n int getPrime(int n) {\n List<Integer> primes = new ArrayList<Integer>();\n primes.add(2);\n int count = 1;\n\n int x = 1;\n while(primes.size() < n) {\n x+=2;\n int m = (int)Math.sqrt(x);\n for(int p : primes) {\n if(p > m) {\n primes.add(x);\n break;\n }\n\n if(x % p == 0) \n break;\n }\n }\n\n return primes.get(primes.size() - 1);\n }\n\n long lcm(long a, long b) {\n return a * b / gcd(a, b);\n }\n\n long gcd(long a, long b) {\n if(a < b) {\n long tmp = a;\n a = b;\n b = tmp;\n }\n // a >= b\n long mod = a % b;\n if(mod == 0) \n return b;\n else \n return gcd(b, mod);\n }\n\n void gcjPrint(String str, int t) {\n System.out.println(\"Case #\" + t + \": \" + str);\n }\n\n public static void main(String[] args) throws Exception {\n new Main().run();\n }\n}",
"Main",
"final BufferedReader br = new BufferedReader(new InputStreamReader(System.in));",
"br",
"new BufferedReader(new InputStreamReader(System.in))",
"final String LINE_SPR = System.getProperty(\"line.separator\");",
"LINE_SPR",
"System.getProperty(\"line.separator\")",
"System.getProperty",
"System",
"\"line.separator\"",
"final int BIG_MOD = 1000000007;",
"BIG_MOD",
"1000000007",
"void run() throws Exception {\n String line;\n while((line = br.readLine()) != null) {\n String[] nums = line.split(\" \");\n long a = Integer.parseInt(nums[0]);\n long b = Integer.parseInt(nums[1]);\n System.out.println(gcd(a, b) + \" \" + lcm(a, b));\n }\n }",
"run",
"{\n String line;\n while((line = br.readLine()) != null) {\n String[] nums = line.split(\" \");\n long a = Integer.parseInt(nums[0]);\n long b = Integer.parseInt(nums[1]);\n System.out.println(gcd(a, b) + \" \" + lcm(a, b));\n }\n }",
"String line;",
"line",
"while((line = br.readLine()) != null) {\n String[] nums = line.split(\" \");\n long a = Integer.parseInt(nums[0]);\n long b = Integer.parseInt(nums[1]);\n System.out.println(gcd(a, b) + \" \" + lcm(a, b));\n }",
"(line = br.readLine()) != null",
"(line = br.readLine())",
"line",
"br.readLine()",
"br.readLine",
"br",
"null",
"{\n String[] nums = line.split(\" \");\n long a = Integer.parseInt(nums[0]);\n long b = Integer.parseInt(nums[1]);\n System.out.println(gcd(a, b) + \" \" + lcm(a, b));\n }",
"String[] nums = line.split(\" \");",
"nums",
"line.split(\" \")",
"line.split",
"line",
"\" \"",
"long a = Integer.parseInt(nums[0]);",
"a",
"Integer.parseInt(nums[0])",
"Integer.parseInt",
"Integer",
"nums[0]",
"nums",
"0",
"long b = Integer.parseInt(nums[1]);",
"b",
"Integer.parseInt(nums[1])",
"Integer.parseInt",
"Integer",
"nums[1]",
"nums",
"1",
"System.out.println(gcd(a, b) + \" \" + lcm(a, b))",
"System.out.println",
"System.out",
"System",
"System.out",
"gcd(a, b) + \" \" + lcm(a, b)",
"gcd(a, b) + \" \" + lcm(a, b)",
"gcd(a, b)",
"gcd",
"a",
"b",
"\" \"",
"lcm(a, b)",
"lcm",
"a",
"b",
"/*\n * Templates\n */\n void dumpObjArr(Object[] arr, int n) {\n for(int i = 0; i < n; i++) {\n System.out.print(arr[i]);\n if(i < n - 1)\n System.out.print(\" \");\n }\n System.out.println(\"\");\n }",
"dumpObjArr",
"{\n for(int i = 0; i < n; i++) {\n System.out.print(arr[i]);\n if(i < n - 1)\n System.out.print(\" \");\n }\n System.out.println(\"\");\n }",
"for(int i = 0; i < n; i++) {\n System.out.print(arr[i]);\n if(i < n - 1)\n System.out.print(\" \");\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < n",
"i",
"n",
"i++",
"i++",
"i",
"{\n System.out.print(arr[i]);\n if(i < n - 1)\n System.out.print(\" \");\n }",
"{\n System.out.print(arr[i]);\n if(i < n - 1)\n System.out.print(\" \");\n }",
"System.out.print(arr[i])",
"System.out.print",
"System.out",
"System",
"System.out",
"arr[i]",
"arr",
"i",
"if(i < n - 1)\n System.out.print(\" \");",
"i < n - 1",
"i",
"n - 1",
"n",
"1",
"System.out.print(\" \")",
"System.out.print",
"System.out",
"System",
"System.out",
"\" \"",
"System.out.println(\"\")",
"System.out.println",
"System.out",
"System",
"System.out",
"\"\"",
"Object[] arr",
"arr",
"int n",
"n",
"void dumpObjArr2(Object[][] arr, int m, int n) {\n for(int j = 0; j < m; j++) \n dumpObjArr(arr[j], n);\n }",
"dumpObjArr2",
"{\n for(int j = 0; j < m; j++) \n dumpObjArr(arr[j], n);\n }",
"for(int j = 0; j < m; j++) \n dumpObjArr(arr[j], n);",
"int j = 0;",
"int j = 0;",
"j",
"0",
"j < m",
"j",
"m",
"j++",
"j++",
"j",
"dumpObjArr(arr[j], n);",
"dumpObjArr(arr[j], n)",
"dumpObjArr",
"arr[j]",
"arr",
"j",
"n",
"Object[][] arr",
"arr",
"int m",
"m",
"int n",
"n",
"int ni() throws Exception {\n return Integer.parseInt(br.readLine().trim());\n }",
"ni",
"{\n return Integer.parseInt(br.readLine().trim());\n }",
"return Integer.parseInt(br.readLine().trim());",
"Integer.parseInt(br.readLine().trim())",
"Integer.parseInt",
"Integer",
"br.readLine().trim()",
"br.readLine().trim",
"br.readLine()",
"br.readLine",
"br",
"long nl() throws Exception {\n return Long.parseLong(br.readLine().trim());\n }",
"nl",
"{\n return Long.parseLong(br.readLine().trim());\n }",
"return Long.parseLong(br.readLine().trim());",
"Long.parseLong(br.readLine().trim())",
"Long.parseLong",
"Long",
"br.readLine().trim()",
"br.readLine().trim",
"br.readLine()",
"br.readLine",
"br",
"String ns() throws Exception {\n return br.readLine();\n }",
"ns",
"{\n return br.readLine();\n }",
"return br.readLine();",
"br.readLine()",
"br.readLine",
"br",
"boolean isPrime(int n) {\n for(int i=2;i<n;i++) {\n if(n%i==0)\n return false;\n }\n return true;\n }",
"isPrime",
"{\n for(int i=2;i<n;i++) {\n if(n%i==0)\n return false;\n }\n return true;\n }",
"for(int i=2;i<n;i++) {\n if(n%i==0)\n return false;\n }",
"int i=2;",
"int i=2;",
"i",
"2",
"i<n",
"i",
"n",
"i++",
"i++",
"i",
"{\n if(n%i==0)\n return false;\n }",
"{\n if(n%i==0)\n return false;\n }",
"if(n%i==0)\n return false;",
"n%i==0",
"n%i",
"n",
"i",
"0",
"return false;",
"false",
"return true;",
"true",
"int n",
"n",
"int getPrime(int n) {\n List<Integer> primes = new ArrayList<Integer>();\n primes.add(2);\n int count = 1;\n\n int x = 1;\n while(primes.size() < n) {\n x+=2;\n int m = (int)Math.sqrt(x);\n for(int p : primes) {\n if(p > m) {\n primes.add(x);\n break;\n }\n\n if(x % p == 0) \n break;\n }\n }\n\n return primes.get(primes.size() - 1);\n }",
"getPrime",
"{\n List<Integer> primes = new ArrayList<Integer>();\n primes.add(2);\n int count = 1;\n\n int x = 1;\n while(primes.size() < n) {\n x+=2;\n int m = (int)Math.sqrt(x);\n for(int p : primes) {\n if(p > m) {\n primes.add(x);\n break;\n }\n\n if(x % p == 0) \n break;\n }\n }\n\n return primes.get(primes.size() - 1);\n }",
"List<Integer> primes = new ArrayList<Integer>();",
"primes",
"new ArrayList<Integer>()",
"primes.add(2)",
"primes.add",
"primes",
"2",
"int count = 1;",
"count",
"1",
"int x = 1;",
"x",
"1",
"while(primes.size() < n) {\n x+=2;\n int m = (int)Math.sqrt(x);\n for(int p : primes) {\n if(p > m) {\n primes.add(x);\n break;\n }\n\n if(x % p == 0) \n break;\n }\n }",
"primes.size() < n",
"primes.size()",
"primes.size",
"primes",
"n",
"{\n x+=2;\n int m = (int)Math.sqrt(x);\n for(int p : primes) {\n if(p > m) {\n primes.add(x);\n break;\n }\n\n if(x % p == 0) \n break;\n }\n }",
"x+=2",
"x",
"2",
"int m = (int)Math.sqrt(x);",
"m",
"(int)Math.sqrt(x)",
"Math.sqrt",
"Math",
"x",
"for(int p : primes) {\n if(p > m) {\n primes.add(x);\n break;\n }\n\n if(x % p == 0) \n break;\n }",
"int p",
"primes",
"{\n if(p > m) {\n primes.add(x);\n break;\n }\n\n if(x % p == 0) \n break;\n }",
"{\n if(p > m) {\n primes.add(x);\n break;\n }\n\n if(x % p == 0) \n break;\n }",
"if(p > m) {\n primes.add(x);\n break;\n }",
"p > m",
"p",
"m",
"{\n primes.add(x);\n break;\n }",
"primes.add(x)",
"primes.add",
"primes",
"x",
"break;",
"if(x % p == 0) \n break;",
"x % p == 0",
"x % p",
"x",
"p",
"0",
"break;",
"return primes.get(primes.size() - 1);",
"primes.get(primes.size() - 1)",
"primes.get",
"primes",
"primes.size() - 1",
"primes.size()",
"primes.size",
"primes",
"1",
"int n",
"n",
"long lcm(long a, long b) {\n return a * b / gcd(a, b);\n }",
"lcm",
"{\n return a * b / gcd(a, b);\n }",
"return a * b / gcd(a, b);",
"a * b / gcd(a, b)",
"a * b",
"a",
"b",
"gcd(a, b)",
"gcd",
"a",
"b",
"long a",
"a",
"long b",
"b",
"long gcd(long a, long b) {\n if(a < b) {\n long tmp = a;\n a = b;\n b = tmp;\n }\n // a >= b\n long mod = a % b;\n if(mod == 0) \n return b;\n else \n return gcd(b, mod);\n }",
"gcd",
"{\n if(a < b) {\n long tmp = a;\n a = b;\n b = tmp;\n }\n // a >= b\n long mod = a % b;\n if(mod == 0) \n return b;\n else \n return gcd(b, mod);\n }",
"if(a < b) {\n long tmp = a;\n a = b;\n b = tmp;\n }",
"a < b",
"a",
"b",
"{\n long tmp = a;\n a = b;\n b = tmp;\n }",
"long tmp = a;",
"tmp",
"a",
"a = b",
"a",
"b",
"b = tmp",
"b",
"tmp",
"long mod = a % b;",
"mod",
"a % b",
"a",
"b",
"if(mod == 0) \n return b;\n else \n return gcd(b, mod);",
"mod == 0",
"mod",
"0",
"return b;",
"b",
"return gcd(b, mod);",
"gcd(b, mod)",
"gcd",
"b",
"mod",
"long a",
"a",
"long b",
"b",
"void gcjPrint(String str, int t) {\n System.out.println(\"Case #\" + t + \": \" + str);\n }",
"gcjPrint",
"{\n System.out.println(\"Case #\" + t + \": \" + str);\n }",
"System.out.println(\"Case #\" + t + \": \" + str)",
"System.out.println",
"System.out",
"System",
"System.out",
"\"Case #\" + t + \": \" + str",
"\": \"",
"\"Case #\" + t + \": \" + str",
"\"Case #\"",
"t",
"\": \"",
"str",
"String str",
"str",
"int t",
"t",
"public static void main(String[] args) throws Exception {\n new Main().run();\n }",
"main",
"{\n new Main().run();\n }",
"new Main().run()",
"new Main().run",
"new Main()",
"String[] args",
"args",
"public class Main {\n final BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n final String LINE_SPR = System.getProperty(\"line.separator\");\n final int BIG_MOD = 1000000007;\n\n void run() throws Exception {\n String line;\n while((line = br.readLine()) != null) {\n String[] nums = line.split(\" \");\n long a = Integer.parseInt(nums[0]);\n long b = Integer.parseInt(nums[1]);\n System.out.println(gcd(a, b) + \" \" + lcm(a, b));\n }\n }\n\n\n /*\n * Templates\n */\n void dumpObjArr(Object[] arr, int n) {\n for(int i = 0; i < n; i++) {\n System.out.print(arr[i]);\n if(i < n - 1)\n System.out.print(\" \");\n }\n System.out.println(\"\");\n }\n\n void dumpObjArr2(Object[][] arr, int m, int n) {\n for(int j = 0; j < m; j++) \n dumpObjArr(arr[j], n);\n }\n\n int ni() throws Exception {\n return Integer.parseInt(br.readLine().trim());\n }\n\n long nl() throws Exception {\n return Long.parseLong(br.readLine().trim());\n }\n\n String ns() throws Exception {\n return br.readLine();\n }\n\n boolean isPrime(int n) {\n for(int i=2;i<n;i++) {\n if(n%i==0)\n return false;\n }\n return true;\n }\n\n int getPrime(int n) {\n List<Integer> primes = new ArrayList<Integer>();\n primes.add(2);\n int count = 1;\n\n int x = 1;\n while(primes.size() < n) {\n x+=2;\n int m = (int)Math.sqrt(x);\n for(int p : primes) {\n if(p > m) {\n primes.add(x);\n break;\n }\n\n if(x % p == 0) \n break;\n }\n }\n\n return primes.get(primes.size() - 1);\n }\n\n long lcm(long a, long b) {\n return a * b / gcd(a, b);\n }\n\n long gcd(long a, long b) {\n if(a < b) {\n long tmp = a;\n a = b;\n b = tmp;\n }\n // a >= b\n long mod = a % b;\n if(mod == 0) \n return b;\n else \n return gcd(b, mod);\n }\n\n void gcjPrint(String str, int t) {\n System.out.println(\"Case #\" + t + \": \" + str);\n }\n\n public static void main(String[] args) throws Exception {\n new Main().run();\n }\n}",
"public class Main {\n final BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n final String LINE_SPR = System.getProperty(\"line.separator\");\n final int BIG_MOD = 1000000007;\n\n void run() throws Exception {\n String line;\n while((line = br.readLine()) != null) {\n String[] nums = line.split(\" \");\n long a = Integer.parseInt(nums[0]);\n long b = Integer.parseInt(nums[1]);\n System.out.println(gcd(a, b) + \" \" + lcm(a, b));\n }\n }\n\n\n /*\n * Templates\n */\n void dumpObjArr(Object[] arr, int n) {\n for(int i = 0; i < n; i++) {\n System.out.print(arr[i]);\n if(i < n - 1)\n System.out.print(\" \");\n }\n System.out.println(\"\");\n }\n\n void dumpObjArr2(Object[][] arr, int m, int n) {\n for(int j = 0; j < m; j++) \n dumpObjArr(arr[j], n);\n }\n\n int ni() throws Exception {\n return Integer.parseInt(br.readLine().trim());\n }\n\n long nl() throws Exception {\n return Long.parseLong(br.readLine().trim());\n }\n\n String ns() throws Exception {\n return br.readLine();\n }\n\n boolean isPrime(int n) {\n for(int i=2;i<n;i++) {\n if(n%i==0)\n return false;\n }\n return true;\n }\n\n int getPrime(int n) {\n List<Integer> primes = new ArrayList<Integer>();\n primes.add(2);\n int count = 1;\n\n int x = 1;\n while(primes.size() < n) {\n x+=2;\n int m = (int)Math.sqrt(x);\n for(int p : primes) {\n if(p > m) {\n primes.add(x);\n break;\n }\n\n if(x % p == 0) \n break;\n }\n }\n\n return primes.get(primes.size() - 1);\n }\n\n long lcm(long a, long b) {\n return a * b / gcd(a, b);\n }\n\n long gcd(long a, long b) {\n if(a < b) {\n long tmp = a;\n a = b;\n b = tmp;\n }\n // a >= b\n long mod = a % b;\n if(mod == 0) \n return b;\n else \n return gcd(b, mod);\n }\n\n void gcjPrint(String str, int t) {\n System.out.println(\"Case #\" + t + \": \" + str);\n }\n\n public static void main(String[] args) throws Exception {\n new Main().run();\n }\n}",
"Main"
] | import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.*;
public class Main {
final BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
final String LINE_SPR = System.getProperty("line.separator");
final int BIG_MOD = 1000000007;
void run() throws Exception {
String line;
while((line = br.readLine()) != null) {
String[] nums = line.split(" ");
long a = Integer.parseInt(nums[0]);
long b = Integer.parseInt(nums[1]);
System.out.println(gcd(a, b) + " " + lcm(a, b));
}
}
/*
* Templates
*/
void dumpObjArr(Object[] arr, int n) {
for(int i = 0; i < n; i++) {
System.out.print(arr[i]);
if(i < n - 1)
System.out.print(" ");
}
System.out.println("");
}
void dumpObjArr2(Object[][] arr, int m, int n) {
for(int j = 0; j < m; j++)
dumpObjArr(arr[j], n);
}
int ni() throws Exception {
return Integer.parseInt(br.readLine().trim());
}
long nl() throws Exception {
return Long.parseLong(br.readLine().trim());
}
String ns() throws Exception {
return br.readLine();
}
boolean isPrime(int n) {
for(int i=2;i<n;i++) {
if(n%i==0)
return false;
}
return true;
}
int getPrime(int n) {
List<Integer> primes = new ArrayList<Integer>();
primes.add(2);
int count = 1;
int x = 1;
while(primes.size() < n) {
x+=2;
int m = (int)Math.sqrt(x);
for(int p : primes) {
if(p > m) {
primes.add(x);
break;
}
if(x % p == 0)
break;
}
}
return primes.get(primes.size() - 1);
}
long lcm(long a, long b) {
return a * b / gcd(a, b);
}
long gcd(long a, long b) {
if(a < b) {
long tmp = a;
a = b;
b = tmp;
}
// a >= b
long mod = a % b;
if(mod == 0)
return b;
else
return gcd(b, mod);
}
void gcjPrint(String str, int t) {
System.out.println("Case #" + t + ": " + str);
}
public static void main(String[] args) throws Exception {
new Main().run();
}
} |
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
42,
17,
30,
41,
13,
4,
18,
13,
14,
2,
13,
17,
30,
3,
41,
13,
4,
18,
13,
17,
41,
13,
4,
18,
13,
18,
13,
17,
41,
13,
4,
18,
13,
18,
13,
17,
41,
13,
4,
13,
13,
13,
41,
13,
4,
13,
13,
13,
13,
4,
18,
18,
13,
13,
2,
2,
13,
17,
13,
23,
13,
12,
13,
30,
41,
13,
42,
2,
2,
13,
13,
17,
30,
0,
13,
13,
0,
13,
2,
13,
13,
0,
13,
13,
29,
13,
23,
13,
23,
13,
12,
13,
30,
29,
2,
13,
2,
13,
13,
23,
13,
23,
13,
23,
13,
12,
13,
30,
41,
13,
4,
13,
13,
13,
29,
4,
13,
13,
13,
13,
23,
13,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
143,
11
],
[
143,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
15,
17
],
[
14,
18
],
[
18,
19
],
[
18,
20
],
[
20,
21
],
[
21,
22
],
[
21,
23
],
[
23,
24
],
[
24,
25
],
[
20,
26
],
[
26,
27
],
[
27,
28
],
[
27,
29
],
[
26,
30
],
[
30,
31
],
[
20,
32
],
[
32,
33
],
[
32,
34
],
[
34,
35
],
[
35,
36
],
[
34,
37
],
[
20,
38
],
[
38,
39
],
[
38,
40
],
[
40,
41
],
[
41,
42
],
[
40,
43
],
[
43,
44
],
[
43,
45
],
[
20,
46
],
[
46,
47
],
[
46,
48
],
[
48,
49
],
[
49,
50
],
[
48,
51
],
[
51,
52
],
[
51,
53
],
[
20,
54
],
[
54,
55
],
[
54,
56
],
[
56,
57
],
[
56,
58
],
[
56,
59
],
[
20,
60
],
[
60,
61
],
[
60,
62
],
[
62,
63
],
[
62,
64
],
[
62,
65
],
[
62,
66
],
[
20,
67
],
[
67,
68
],
[
68,
69
],
[
69,
70
],
[
69,
71
],
[
67,
72
],
[
73,
73
],
[
73,
74
],
[
73,
75
],
[
73,
76
],
[
12,
77
],
[
77,
78
],
[
143,
79
],
[
79,
80
],
[
79,
81
],
[
81,
82
],
[
82,
83
],
[
81,
84
],
[
84,
85
],
[
85,
86
],
[
86,
87
],
[
86,
88
],
[
85,
89
],
[
84,
90
],
[
90,
91
],
[
91,
92
],
[
91,
93
],
[
90,
94
],
[
94,
95
],
[
94,
96
],
[
96,
97
],
[
96,
98
],
[
90,
99
],
[
99,
100
],
[
99,
101
],
[
81,
102
],
[
102,
103
],
[
79,
104
],
[
104,
105
],
[
79,
106
],
[
106,
107
],
[
143,
108
],
[
108,
109
],
[
108,
110
],
[
110,
111
],
[
111,
112
],
[
112,
113
],
[
112,
114
],
[
114,
115
],
[
114,
116
],
[
108,
117
],
[
117,
118
],
[
108,
119
],
[
119,
120
],
[
108,
121
],
[
121,
122
],
[
143,
123
],
[
123,
124
],
[
123,
125
],
[
125,
126
],
[
126,
127
],
[
126,
128
],
[
128,
129
],
[
128,
130
],
[
128,
131
],
[
125,
132
],
[
132,
133
],
[
133,
134
],
[
133,
135
],
[
133,
136
],
[
133,
137
],
[
123,
138
],
[
138,
139
],
[
123,
140
],
[
140,
141
],
[
0,
142
],
[
142,
143
],
[
142,
144
]
] | [
"import java.io.BufferedReader;\nimport java.io.IOException;\nimport java.io.InputStreamReader;\n\npublic class Main {\n\n public static void main(String[] args) throws IOException {\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\n while(true){\n String tmp = br.readLine();\n\n if(tmp == null){\n break;\n }\n\n String[] tmpArray = tmp.split(\" \");\n int a = Integer.parseInt(tmpArray[0]);\n int b = Integer.parseInt(tmpArray[1]);\n\n int GCD = gcd(a, b);\n\n int LCM = lcm(a, b, GCD);\n System.out.println(GCD + \" \"+ LCM);\n }\n }\n\n static int gcd(int a, int b){\n \tint tmp;\n\n \twhile (a % b != 0)\n \t{\n \t\ttmp = b;\n \t\tb = a % b;\n \t\ta = tmp;\n \t}\n \treturn b;\n }\n\n static int lcm(int a, int b, int gcd){\n \treturn a*(b/gcd);\n }\n\n static int lcm(int a, int b){\n \tint g = gcd(a, b);\n\n \treturn lcm(a,b,g);\n }\n\n}",
"import java.io.BufferedReader;",
"BufferedReader",
"java.io",
"import java.io.IOException;",
"IOException",
"java.io",
"import java.io.InputStreamReader;",
"InputStreamReader",
"java.io",
"public class Main {\n\n public static void main(String[] args) throws IOException {\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\n while(true){\n String tmp = br.readLine();\n\n if(tmp == null){\n break;\n }\n\n String[] tmpArray = tmp.split(\" \");\n int a = Integer.parseInt(tmpArray[0]);\n int b = Integer.parseInt(tmpArray[1]);\n\n int GCD = gcd(a, b);\n\n int LCM = lcm(a, b, GCD);\n System.out.println(GCD + \" \"+ LCM);\n }\n }\n\n static int gcd(int a, int b){\n \tint tmp;\n\n \twhile (a % b != 0)\n \t{\n \t\ttmp = b;\n \t\tb = a % b;\n \t\ta = tmp;\n \t}\n \treturn b;\n }\n\n static int lcm(int a, int b, int gcd){\n \treturn a*(b/gcd);\n }\n\n static int lcm(int a, int b){\n \tint g = gcd(a, b);\n\n \treturn lcm(a,b,g);\n }\n\n}",
"Main",
"public static void main(String[] args) throws IOException {\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\n while(true){\n String tmp = br.readLine();\n\n if(tmp == null){\n break;\n }\n\n String[] tmpArray = tmp.split(\" \");\n int a = Integer.parseInt(tmpArray[0]);\n int b = Integer.parseInt(tmpArray[1]);\n\n int GCD = gcd(a, b);\n\n int LCM = lcm(a, b, GCD);\n System.out.println(GCD + \" \"+ LCM);\n }\n }",
"main",
"{\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\n while(true){\n String tmp = br.readLine();\n\n if(tmp == null){\n break;\n }\n\n String[] tmpArray = tmp.split(\" \");\n int a = Integer.parseInt(tmpArray[0]);\n int b = Integer.parseInt(tmpArray[1]);\n\n int GCD = gcd(a, b);\n\n int LCM = lcm(a, b, GCD);\n System.out.println(GCD + \" \"+ LCM);\n }\n }",
"BufferedReader br = new BufferedReader(new InputStreamReader(System.in));",
"br",
"new BufferedReader(new InputStreamReader(System.in))",
"while(true){\n String tmp = br.readLine();\n\n if(tmp == null){\n break;\n }\n\n String[] tmpArray = tmp.split(\" \");\n int a = Integer.parseInt(tmpArray[0]);\n int b = Integer.parseInt(tmpArray[1]);\n\n int GCD = gcd(a, b);\n\n int LCM = lcm(a, b, GCD);\n System.out.println(GCD + \" \"+ LCM);\n }",
"true",
"{\n String tmp = br.readLine();\n\n if(tmp == null){\n break;\n }\n\n String[] tmpArray = tmp.split(\" \");\n int a = Integer.parseInt(tmpArray[0]);\n int b = Integer.parseInt(tmpArray[1]);\n\n int GCD = gcd(a, b);\n\n int LCM = lcm(a, b, GCD);\n System.out.println(GCD + \" \"+ LCM);\n }",
"String tmp = br.readLine();",
"tmp",
"br.readLine()",
"br.readLine",
"br",
"if(tmp == null){\n break;\n }",
"tmp == null",
"tmp",
"null",
"{\n break;\n }",
"break;",
"String[] tmpArray = tmp.split(\" \");",
"tmpArray",
"tmp.split(\" \")",
"tmp.split",
"tmp",
"\" \"",
"int a = Integer.parseInt(tmpArray[0]);",
"a",
"Integer.parseInt(tmpArray[0])",
"Integer.parseInt",
"Integer",
"tmpArray[0]",
"tmpArray",
"0",
"int b = Integer.parseInt(tmpArray[1]);",
"b",
"Integer.parseInt(tmpArray[1])",
"Integer.parseInt",
"Integer",
"tmpArray[1]",
"tmpArray",
"1",
"int GCD = gcd(a, b);",
"GCD",
"gcd(a, b)",
"gcd",
"a",
"b",
"int LCM = lcm(a, b, GCD);",
"LCM",
"lcm(a, b, GCD)",
"lcm",
"a",
"b",
"GCD",
"System.out.println(GCD + \" \"+ LCM)",
"System.out.println",
"System.out",
"System",
"System.out",
"GCD + \" \"+ LCM",
"GCD + \" \"+ LCM",
"GCD",
"\" \"",
"LCM",
"String[] args",
"args",
"static int gcd(int a, int b){\n \tint tmp;\n\n \twhile (a % b != 0)\n \t{\n \t\ttmp = b;\n \t\tb = a % b;\n \t\ta = tmp;\n \t}\n \treturn b;\n }",
"gcd",
"{\n \tint tmp;\n\n \twhile (a % b != 0)\n \t{\n \t\ttmp = b;\n \t\tb = a % b;\n \t\ta = tmp;\n \t}\n \treturn b;\n }",
"int tmp;",
"tmp",
"while (a % b != 0)\n \t{\n \t\ttmp = b;\n \t\tb = a % b;\n \t\ta = tmp;\n \t}",
"a % b != 0",
"a % b",
"a",
"b",
"0",
"{\n \t\ttmp = b;\n \t\tb = a % b;\n \t\ta = tmp;\n \t}",
"tmp = b",
"tmp",
"b",
"b = a % b",
"b",
"a % b",
"a",
"b",
"a = tmp",
"a",
"tmp",
"return b;",
"b",
"int a",
"a",
"int b",
"b",
"static int lcm(int a, int b, int gcd){\n \treturn a*(b/gcd);\n }",
"lcm",
"{\n \treturn a*(b/gcd);\n }",
"return a*(b/gcd);",
"a*(b/gcd)",
"a",
"(b/gcd)",
"b",
"gcd",
"int a",
"a",
"int b",
"b",
"int gcd",
"gcd",
"static int lcm(int a, int b){\n \tint g = gcd(a, b);\n\n \treturn lcm(a,b,g);\n }",
"lcm",
"{\n \tint g = gcd(a, b);\n\n \treturn lcm(a,b,g);\n }",
"int g = gcd(a, b);",
"g",
"gcd(a, b)",
"gcd",
"a",
"b",
"return lcm(a,b,g);",
"lcm(a,b,g)",
"lcm",
"a",
"b",
"g",
"int a",
"a",
"int b",
"b",
"public class Main {\n\n public static void main(String[] args) throws IOException {\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\n while(true){\n String tmp = br.readLine();\n\n if(tmp == null){\n break;\n }\n\n String[] tmpArray = tmp.split(\" \");\n int a = Integer.parseInt(tmpArray[0]);\n int b = Integer.parseInt(tmpArray[1]);\n\n int GCD = gcd(a, b);\n\n int LCM = lcm(a, b, GCD);\n System.out.println(GCD + \" \"+ LCM);\n }\n }\n\n static int gcd(int a, int b){\n \tint tmp;\n\n \twhile (a % b != 0)\n \t{\n \t\ttmp = b;\n \t\tb = a % b;\n \t\ta = tmp;\n \t}\n \treturn b;\n }\n\n static int lcm(int a, int b, int gcd){\n \treturn a*(b/gcd);\n }\n\n static int lcm(int a, int b){\n \tint g = gcd(a, b);\n\n \treturn lcm(a,b,g);\n }\n\n}",
"public class Main {\n\n public static void main(String[] args) throws IOException {\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\n while(true){\n String tmp = br.readLine();\n\n if(tmp == null){\n break;\n }\n\n String[] tmpArray = tmp.split(\" \");\n int a = Integer.parseInt(tmpArray[0]);\n int b = Integer.parseInt(tmpArray[1]);\n\n int GCD = gcd(a, b);\n\n int LCM = lcm(a, b, GCD);\n System.out.println(GCD + \" \"+ LCM);\n }\n }\n\n static int gcd(int a, int b){\n \tint tmp;\n\n \twhile (a % b != 0)\n \t{\n \t\ttmp = b;\n \t\tb = a % b;\n \t\ta = tmp;\n \t}\n \treturn b;\n }\n\n static int lcm(int a, int b, int gcd){\n \treturn a*(b/gcd);\n }\n\n static int lcm(int a, int b){\n \tint g = gcd(a, b);\n\n \treturn lcm(a,b,g);\n }\n\n}",
"Main"
] | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class Main {
public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
while(true){
String tmp = br.readLine();
if(tmp == null){
break;
}
String[] tmpArray = tmp.split(" ");
int a = Integer.parseInt(tmpArray[0]);
int b = Integer.parseInt(tmpArray[1]);
int GCD = gcd(a, b);
int LCM = lcm(a, b, GCD);
System.out.println(GCD + " "+ LCM);
}
}
static int gcd(int a, int b){
int tmp;
while (a % b != 0)
{
tmp = b;
b = a % b;
a = tmp;
}
return b;
}
static int lcm(int a, int b, int gcd){
return a*(b/gcd);
}
static int lcm(int a, int b){
int g = gcd(a, b);
return lcm(a,b,g);
}
} |
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
41,
13,
41,
13,
41,
13,
41,
13,
42,
4,
18,
13,
30,
0,
13,
0,
13,
4,
18,
13,
0,
13,
0,
13,
4,
18,
13,
42,
2,
13,
17,
30,
0,
13,
2,
13,
13,
0,
13,
13,
0,
13,
13,
0,
13,
13,
0,
13,
2,
2,
13,
13,
13,
4,
18,
18,
13,
13,
2,
2,
13,
17,
13,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
80,
5
],
[
80,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
8,
14
],
[
14,
15
],
[
8,
16
],
[
16,
17
],
[
8,
18
],
[
18,
19
],
[
8,
20
],
[
20,
21
],
[
8,
22
],
[
22,
23
],
[
23,
24
],
[
24,
25
],
[
22,
26
],
[
26,
27
],
[
27,
28
],
[
27,
29
],
[
29,
30
],
[
29,
31
],
[
31,
32
],
[
32,
33
],
[
26,
34
],
[
34,
35
],
[
34,
36
],
[
36,
37
],
[
36,
38
],
[
38,
39
],
[
39,
40
],
[
26,
41
],
[
41,
42
],
[
42,
43
],
[
42,
44
],
[
41,
45
],
[
45,
46
],
[
46,
47
],
[
46,
48
],
[
48,
49
],
[
48,
50
],
[
45,
51
],
[
51,
52
],
[
51,
53
],
[
45,
54
],
[
54,
55
],
[
54,
56
],
[
45,
57
],
[
57,
58
],
[
57,
59
],
[
26,
60
],
[
60,
61
],
[
60,
62
],
[
62,
63
],
[
63,
64
],
[
63,
65
],
[
62,
66
],
[
26,
67
],
[
67,
68
],
[
68,
69
],
[
69,
70
],
[
69,
71
],
[
67,
72
],
[
73,
73
],
[
73,
74
],
[
73,
75
],
[
73,
76
],
[
6,
77
],
[
77,
78
],
[
0,
79
],
[
79,
80
],
[
79,
81
]
] | [
"import java.util.Scanner;\n\npublic class Main\n{\n\tpublic static void main(String[] args)\n\t{\n\t\tScanner cin = new Scanner(System.in);\n\n\t\tint a,b,t,gcd,lcm;\n\t\t\n\t\twhile(cin.hasNext())\n\t\t{\n\t\t\ta=lcm=cin.nextInt();\n\t\t\tb=gcd=cin.nextInt();\n\t\t\t\n\t\t\twhile(gcd!=0)\n\t\t\t{\n\t\t\t\tlcm=lcm%gcd;\n\t\t\t\tt=lcm; lcm=gcd; gcd=t;\t\n\t\t\t}\n\t\t\tgcd = a/lcm*b;\n\n\t\t\tSystem.out.println(lcm+\" \"+gcd);\n\t\t}\n\t}\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main\n{\n\tpublic static void main(String[] args)\n\t{\n\t\tScanner cin = new Scanner(System.in);\n\n\t\tint a,b,t,gcd,lcm;\n\t\t\n\t\twhile(cin.hasNext())\n\t\t{\n\t\t\ta=lcm=cin.nextInt();\n\t\t\tb=gcd=cin.nextInt();\n\t\t\t\n\t\t\twhile(gcd!=0)\n\t\t\t{\n\t\t\t\tlcm=lcm%gcd;\n\t\t\t\tt=lcm; lcm=gcd; gcd=t;\t\n\t\t\t}\n\t\t\tgcd = a/lcm*b;\n\n\t\t\tSystem.out.println(lcm+\" \"+gcd);\n\t\t}\n\t}\n}",
"Main",
"public static void main(String[] args)\n\t{\n\t\tScanner cin = new Scanner(System.in);\n\n\t\tint a,b,t,gcd,lcm;\n\t\t\n\t\twhile(cin.hasNext())\n\t\t{\n\t\t\ta=lcm=cin.nextInt();\n\t\t\tb=gcd=cin.nextInt();\n\t\t\t\n\t\t\twhile(gcd!=0)\n\t\t\t{\n\t\t\t\tlcm=lcm%gcd;\n\t\t\t\tt=lcm; lcm=gcd; gcd=t;\t\n\t\t\t}\n\t\t\tgcd = a/lcm*b;\n\n\t\t\tSystem.out.println(lcm+\" \"+gcd);\n\t\t}\n\t}",
"main",
"{\n\t\tScanner cin = new Scanner(System.in);\n\n\t\tint a,b,t,gcd,lcm;\n\t\t\n\t\twhile(cin.hasNext())\n\t\t{\n\t\t\ta=lcm=cin.nextInt();\n\t\t\tb=gcd=cin.nextInt();\n\t\t\t\n\t\t\twhile(gcd!=0)\n\t\t\t{\n\t\t\t\tlcm=lcm%gcd;\n\t\t\t\tt=lcm; lcm=gcd; gcd=t;\t\n\t\t\t}\n\t\t\tgcd = a/lcm*b;\n\n\t\t\tSystem.out.println(lcm+\" \"+gcd);\n\t\t}\n\t}",
"Scanner cin = new Scanner(System.in);",
"cin",
"new Scanner(System.in)",
"int a",
"a",
"b",
"b",
"t",
"t",
"gcd",
"gcd",
"lcm;",
"lcm",
"while(cin.hasNext())\n\t\t{\n\t\t\ta=lcm=cin.nextInt();\n\t\t\tb=gcd=cin.nextInt();\n\t\t\t\n\t\t\twhile(gcd!=0)\n\t\t\t{\n\t\t\t\tlcm=lcm%gcd;\n\t\t\t\tt=lcm; lcm=gcd; gcd=t;\t\n\t\t\t}\n\t\t\tgcd = a/lcm*b;\n\n\t\t\tSystem.out.println(lcm+\" \"+gcd);\n\t\t}",
"cin.hasNext()",
"cin.hasNext",
"cin",
"{\n\t\t\ta=lcm=cin.nextInt();\n\t\t\tb=gcd=cin.nextInt();\n\t\t\t\n\t\t\twhile(gcd!=0)\n\t\t\t{\n\t\t\t\tlcm=lcm%gcd;\n\t\t\t\tt=lcm; lcm=gcd; gcd=t;\t\n\t\t\t}\n\t\t\tgcd = a/lcm*b;\n\n\t\t\tSystem.out.println(lcm+\" \"+gcd);\n\t\t}",
"a=lcm=cin.nextInt()",
"a",
"lcm=cin.nextInt()",
"lcm",
"cin.nextInt()",
"cin.nextInt",
"cin",
"b=gcd=cin.nextInt()",
"b",
"gcd=cin.nextInt()",
"gcd",
"cin.nextInt()",
"cin.nextInt",
"cin",
"while(gcd!=0)\n\t\t\t{\n\t\t\t\tlcm=lcm%gcd;\n\t\t\t\tt=lcm; lcm=gcd; gcd=t;\t\n\t\t\t}",
"gcd!=0",
"gcd",
"0",
"{\n\t\t\t\tlcm=lcm%gcd;\n\t\t\t\tt=lcm; lcm=gcd; gcd=t;\t\n\t\t\t}",
"lcm=lcm%gcd",
"lcm",
"lcm%gcd",
"lcm",
"gcd",
"t=lcm",
"t",
"lcm",
"lcm=gcd",
"lcm",
"gcd",
"gcd=t",
"gcd",
"t",
"gcd = a/lcm*b",
"gcd",
"a/lcm*b",
"a/lcm",
"a",
"lcm",
"b",
"System.out.println(lcm+\" \"+gcd)",
"System.out.println",
"System.out",
"System",
"System.out",
"lcm+\" \"+gcd",
"lcm+\" \"+gcd",
"lcm",
"\" \"",
"gcd",
"String[] args",
"args",
"public class Main\n{\n\tpublic static void main(String[] args)\n\t{\n\t\tScanner cin = new Scanner(System.in);\n\n\t\tint a,b,t,gcd,lcm;\n\t\t\n\t\twhile(cin.hasNext())\n\t\t{\n\t\t\ta=lcm=cin.nextInt();\n\t\t\tb=gcd=cin.nextInt();\n\t\t\t\n\t\t\twhile(gcd!=0)\n\t\t\t{\n\t\t\t\tlcm=lcm%gcd;\n\t\t\t\tt=lcm; lcm=gcd; gcd=t;\t\n\t\t\t}\n\t\t\tgcd = a/lcm*b;\n\n\t\t\tSystem.out.println(lcm+\" \"+gcd);\n\t\t}\n\t}\n}",
"public class Main\n{\n\tpublic static void main(String[] args)\n\t{\n\t\tScanner cin = new Scanner(System.in);\n\n\t\tint a,b,t,gcd,lcm;\n\t\t\n\t\twhile(cin.hasNext())\n\t\t{\n\t\t\ta=lcm=cin.nextInt();\n\t\t\tb=gcd=cin.nextInt();\n\t\t\t\n\t\t\twhile(gcd!=0)\n\t\t\t{\n\t\t\t\tlcm=lcm%gcd;\n\t\t\t\tt=lcm; lcm=gcd; gcd=t;\t\n\t\t\t}\n\t\t\tgcd = a/lcm*b;\n\n\t\t\tSystem.out.println(lcm+\" \"+gcd);\n\t\t}\n\t}\n}",
"Main"
] | import java.util.Scanner;
public class Main
{
public static void main(String[] args)
{
Scanner cin = new Scanner(System.in);
int a,b,t,gcd,lcm;
while(cin.hasNext())
{
a=lcm=cin.nextInt();
b=gcd=cin.nextInt();
while(gcd!=0)
{
lcm=lcm%gcd;
t=lcm; lcm=gcd; gcd=t;
}
gcd = a/lcm*b;
System.out.println(lcm+" "+gcd);
}
}
} |
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
41,
13,
41,
13,
41,
13,
17,
41,
13,
17,
41,
13,
20,
41,
13,
20,
38,
5,
13,
30,
4,
18,
13,
30,
41,
13,
20,
42,
2,
0,
13,
4,
18,
13,
17,
30,
4,
18,
13,
13,
4,
18,
13,
11,
1,
41,
13,
17,
2,
13,
4,
18,
13,
1,
40,
13,
30,
30,
41,
13,
4,
18,
4,
18,
13,
13,
17,
11,
1,
41,
13,
17,
2,
13,
18,
13,
13,
1,
40,
13,
30,
30,
4,
18,
13,
4,
18,
13,
18,
13,
13,
4,
18,
13,
13,
0,
13,
4,
18,
13,
17,
0,
13,
4,
18,
13,
17,
0,
13,
4,
13,
13,
13,
0,
13,
4,
13,
13,
13,
4,
18,
18,
13,
13,
2,
2,
13,
17,
13,
4,
18,
13,
23,
13,
12,
13,
30,
14,
2,
2,
13,
13,
17,
30,
29,
13,
30,
41,
13,
17,
42,
2,
13,
17,
30,
0,
13,
2,
13,
13,
0,
13,
13,
0,
13,
13,
29,
13,
23,
13,
23,
13,
12,
13,
30,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
14,
2,
2,
2,
13,
13,
13,
17,
30,
29,
2,
13,
13,
29,
17,
23,
13,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
10,
11
],
[
10,
12
],
[
0,
13
],
[
13,
14
],
[
13,
15
],
[
0,
16
],
[
231,
17
],
[
231,
18
],
[
18,
19
],
[
18,
20
],
[
20,
21
],
[
21,
22
],
[
20,
23
],
[
23,
24
],
[
20,
25
],
[
25,
26
],
[
20,
27
],
[
27,
28
],
[
27,
29
],
[
20,
30
],
[
30,
31
],
[
30,
32
],
[
20,
33
],
[
33,
34
],
[
33,
35
],
[
20,
36
],
[
36,
37
],
[
36,
38
],
[
20,
39
],
[
39,
40
],
[
40,
41
],
[
40,
42
],
[
42,
43
],
[
43,
44
],
[
44,
45
],
[
39,
46
],
[
46,
47
],
[
47,
48
],
[
47,
49
],
[
46,
50
],
[
50,
51
],
[
51,
52
],
[
52,
53
],
[
52,
54
],
[
54,
55
],
[
55,
56
],
[
51,
57
],
[
50,
58
],
[
58,
59
],
[
59,
60
],
[
60,
61
],
[
59,
62
],
[
46,
63
],
[
63,
64
],
[
64,
65
],
[
20,
66
],
[
66,
67
],
[
67,
68
],
[
68,
69
],
[
68,
70
],
[
66,
71
],
[
71,
72
],
[
71,
73
],
[
73,
74
],
[
74,
75
],
[
66,
76
],
[
76,
77
],
[
77,
78
],
[
66,
79
],
[
80,
80
],
[
80,
81
],
[
81,
82
],
[
81,
83
],
[
83,
84
],
[
84,
85
],
[
85,
86
],
[
86,
87
],
[
85,
88
],
[
83,
89
],
[
80,
90
],
[
90,
91
],
[
91,
92
],
[
92,
93
],
[
92,
94
],
[
90,
95
],
[
95,
96
],
[
95,
97
],
[
97,
98
],
[
97,
99
],
[
90,
100
],
[
100,
101
],
[
101,
102
],
[
90,
103
],
[
104,
104
],
[
104,
105
],
[
105,
106
],
[
106,
107
],
[
105,
108
],
[
108,
109
],
[
109,
110
],
[
108,
111
],
[
111,
112
],
[
111,
113
],
[
80,
114
],
[
114,
115
],
[
115,
116
],
[
114,
117
],
[
80,
118
],
[
118,
119
],
[
118,
120
],
[
120,
121
],
[
121,
122
],
[
120,
123
],
[
80,
124
],
[
124,
125
],
[
124,
126
],
[
126,
127
],
[
127,
128
],
[
126,
129
],
[
80,
130
],
[
130,
131
],
[
130,
132
],
[
132,
133
],
[
132,
134
],
[
132,
135
],
[
80,
136
],
[
136,
137
],
[
136,
138
],
[
138,
139
],
[
138,
140
],
[
138,
141
],
[
80,
142
],
[
142,
143
],
[
143,
144
],
[
144,
145
],
[
144,
146
],
[
142,
147
],
[
148,
148
],
[
148,
149
],
[
148,
150
],
[
148,
151
],
[
80,
152
],
[
152,
153
],
[
153,
154
],
[
18,
155
],
[
155,
156
],
[
231,
157
],
[
157,
158
],
[
157,
159
],
[
159,
160
],
[
160,
161
],
[
161,
162
],
[
162,
163
],
[
162,
164
],
[
161,
165
],
[
160,
166
],
[
166,
167
],
[
167,
168
],
[
160,
169
],
[
169,
170
],
[
170,
171
],
[
170,
172
],
[
169,
173
],
[
173,
174
],
[
174,
175
],
[
174,
176
],
[
173,
177
],
[
177,
178
],
[
178,
179
],
[
178,
180
],
[
180,
181
],
[
180,
182
],
[
177,
183
],
[
183,
184
],
[
183,
185
],
[
177,
186
],
[
186,
187
],
[
186,
188
],
[
169,
189
],
[
189,
190
],
[
157,
191
],
[
191,
192
],
[
157,
193
],
[
193,
194
],
[
231,
195
],
[
195,
196
],
[
195,
197
],
[
197,
198
],
[
198,
199
],
[
199,
200
],
[
200,
201
],
[
200,
202
],
[
198,
203
],
[
203,
204
],
[
203,
205
],
[
198,
206
],
[
206,
207
],
[
207,
208
],
[
198,
209
],
[
210,
210
],
[
210,
211
],
[
211,
212
],
[
212,
213
],
[
213,
214
],
[
214,
215
],
[
214,
216
],
[
213,
217
],
[
212,
218
],
[
211,
219
],
[
219,
220
],
[
220,
221
],
[
221,
222
],
[
221,
223
],
[
197,
224
],
[
224,
225
],
[
195,
226
],
[
226,
227
],
[
195,
228
],
[
228,
229
],
[
0,
230
],
[
230,
231
],
[
230,
232
]
] | [
"import java.io.BufferedReader;\nimport java.io.IOException;\nimport java.io.InputStreamReader;\nimport java.util.ArrayList;\nimport java.util.Collections;\n\npublic class Main {\n\tpublic static void main(String[] args){\n\t\tString\t\tstr;\n\t\tint a,b,multiple = 0,divisor = 0;\n\t\tArrayList<String>\tlist\t= new ArrayList<String>();\n\t\tArrayList<Integer>\tintList\t= new ArrayList<Integer>();\n\t\ttry {\n\t\t\tBufferedReader br\t=\tnew BufferedReader(new InputStreamReader(System.in));\n\t\t\twhile((str=br.readLine())!=null){\n\t\t\t\tlist.add(str);\t\t\t\t\t\t//行単位でArrayListに追加\n\t\t\t}\n\t\t\tbr.close();\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\n\t\tfor(int i=0; i<list.size(); i++){\t\t\t//一行文のデータ毎に処理する\n\t\t\tString[] s = list.get(i).split(\" \");\t//listの要素を空白で区切って配列を作成\n\t\t\tfor(int j=0; j<s.length; j++){\t\t\t//int型に変換してArrayListに追加\n\t\t\t\tintList.add(Integer.parseInt(s[j]));\n\t\t\t}\n\t\t\tCollections.sort(intList);\t\t\t\t//小さい順に並べる\n\n\t\t\ta = intList.get(0);\t\t\t\t\t\t//a,bを決める。a<bとなっている。\n\t\t\tb = intList.get(1);\n\t\t\t\n\t\t\t//最大公約数を求める\n\t\t\tdivisor = getDivisor(a,b);\n\n\t\t\t//最小公倍数を求める\n\t\t\tmultiple = getMultiple(a,b);\n\t\t\t\n\t\t\t//結果の表示\n\t\t\tSystem.out.println(divisor + \" \" + multiple);\n\t\t\t\n\t\t\tintList.clear();\t\t\t\t\t\t//リストのクリア\n\t\t}\n\t}\n\t\n\t//最大公約数を求めるメソッド\n\tstatic int getDivisor(int x, int y){\n\t\tif(x%y==0){\n\t\t\treturn y;\n\t\t}else{\n\t\t\tint m = 1;\n\t\t\twhile(m!=0){\n\t\t\t\tm = y%x;\n\t\t\t\ty = x;\n\t\t\t\tx = m;\n\t\t\t}\n\t\t\treturn y;\n\t\t}\n\t}\n\t//最小公倍数を求めるメソッド\n\tstatic int getMultiple(int x, int y){\n\t\tfor(int i=1; i<=x; i++){\n\t\t\tif(y*i%x==0){\n\t\t\t\treturn y*i;\n\t\t\t}\n\t\t}\n\t\treturn 0;\n\t}\n}",
"import java.io.BufferedReader;",
"BufferedReader",
"java.io",
"import java.io.IOException;",
"IOException",
"java.io",
"import java.io.InputStreamReader;",
"InputStreamReader",
"java.io",
"import java.util.ArrayList;",
"ArrayList",
"java.util",
"import java.util.Collections;",
"Collections",
"java.util",
"public class Main {\n\tpublic static void main(String[] args){\n\t\tString\t\tstr;\n\t\tint a,b,multiple = 0,divisor = 0;\n\t\tArrayList<String>\tlist\t= new ArrayList<String>();\n\t\tArrayList<Integer>\tintList\t= new ArrayList<Integer>();\n\t\ttry {\n\t\t\tBufferedReader br\t=\tnew BufferedReader(new InputStreamReader(System.in));\n\t\t\twhile((str=br.readLine())!=null){\n\t\t\t\tlist.add(str);\t\t\t\t\t\t//行単位でArrayListに追加\n\t\t\t}\n\t\t\tbr.close();\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\n\t\tfor(int i=0; i<list.size(); i++){\t\t\t//一行文のデータ毎に処理する\n\t\t\tString[] s = list.get(i).split(\" \");\t//listの要素を空白で区切って配列を作成\n\t\t\tfor(int j=0; j<s.length; j++){\t\t\t//int型に変換してArrayListに追加\n\t\t\t\tintList.add(Integer.parseInt(s[j]));\n\t\t\t}\n\t\t\tCollections.sort(intList);\t\t\t\t//小さい順に並べる\n\n\t\t\ta = intList.get(0);\t\t\t\t\t\t//a,bを決める。a<bとなっている。\n\t\t\tb = intList.get(1);\n\t\t\t\n\t\t\t//最大公約数を求める\n\t\t\tdivisor = getDivisor(a,b);\n\n\t\t\t//最小公倍数を求める\n\t\t\tmultiple = getMultiple(a,b);\n\t\t\t\n\t\t\t//結果の表示\n\t\t\tSystem.out.println(divisor + \" \" + multiple);\n\t\t\t\n\t\t\tintList.clear();\t\t\t\t\t\t//リストのクリア\n\t\t}\n\t}\n\t\n\t//最大公約数を求めるメソッド\n\tstatic int getDivisor(int x, int y){\n\t\tif(x%y==0){\n\t\t\treturn y;\n\t\t}else{\n\t\t\tint m = 1;\n\t\t\twhile(m!=0){\n\t\t\t\tm = y%x;\n\t\t\t\ty = x;\n\t\t\t\tx = m;\n\t\t\t}\n\t\t\treturn y;\n\t\t}\n\t}\n\t//最小公倍数を求めるメソッド\n\tstatic int getMultiple(int x, int y){\n\t\tfor(int i=1; i<=x; i++){\n\t\t\tif(y*i%x==0){\n\t\t\t\treturn y*i;\n\t\t\t}\n\t\t}\n\t\treturn 0;\n\t}\n}",
"Main",
"public static void main(String[] args){\n\t\tString\t\tstr;\n\t\tint a,b,multiple = 0,divisor = 0;\n\t\tArrayList<String>\tlist\t= new ArrayList<String>();\n\t\tArrayList<Integer>\tintList\t= new ArrayList<Integer>();\n\t\ttry {\n\t\t\tBufferedReader br\t=\tnew BufferedReader(new InputStreamReader(System.in));\n\t\t\twhile((str=br.readLine())!=null){\n\t\t\t\tlist.add(str);\t\t\t\t\t\t//行単位でArrayListに追加\n\t\t\t}\n\t\t\tbr.close();\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\n\t\tfor(int i=0; i<list.size(); i++){\t\t\t//一行文のデータ毎に処理する\n\t\t\tString[] s = list.get(i).split(\" \");\t//listの要素を空白で区切って配列を作成\n\t\t\tfor(int j=0; j<s.length; j++){\t\t\t//int型に変換してArrayListに追加\n\t\t\t\tintList.add(Integer.parseInt(s[j]));\n\t\t\t}\n\t\t\tCollections.sort(intList);\t\t\t\t//小さい順に並べる\n\n\t\t\ta = intList.get(0);\t\t\t\t\t\t//a,bを決める。a<bとなっている。\n\t\t\tb = intList.get(1);\n\t\t\t\n\t\t\t//最大公約数を求める\n\t\t\tdivisor = getDivisor(a,b);\n\n\t\t\t//最小公倍数を求める\n\t\t\tmultiple = getMultiple(a,b);\n\t\t\t\n\t\t\t//結果の表示\n\t\t\tSystem.out.println(divisor + \" \" + multiple);\n\t\t\t\n\t\t\tintList.clear();\t\t\t\t\t\t//リストのクリア\n\t\t}\n\t}",
"main",
"{\n\t\tString\t\tstr;\n\t\tint a,b,multiple = 0,divisor = 0;\n\t\tArrayList<String>\tlist\t= new ArrayList<String>();\n\t\tArrayList<Integer>\tintList\t= new ArrayList<Integer>();\n\t\ttry {\n\t\t\tBufferedReader br\t=\tnew BufferedReader(new InputStreamReader(System.in));\n\t\t\twhile((str=br.readLine())!=null){\n\t\t\t\tlist.add(str);\t\t\t\t\t\t//行単位でArrayListに追加\n\t\t\t}\n\t\t\tbr.close();\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\n\t\tfor(int i=0; i<list.size(); i++){\t\t\t//一行文のデータ毎に処理する\n\t\t\tString[] s = list.get(i).split(\" \");\t//listの要素を空白で区切って配列を作成\n\t\t\tfor(int j=0; j<s.length; j++){\t\t\t//int型に変換してArrayListに追加\n\t\t\t\tintList.add(Integer.parseInt(s[j]));\n\t\t\t}\n\t\t\tCollections.sort(intList);\t\t\t\t//小さい順に並べる\n\n\t\t\ta = intList.get(0);\t\t\t\t\t\t//a,bを決める。a<bとなっている。\n\t\t\tb = intList.get(1);\n\t\t\t\n\t\t\t//最大公約数を求める\n\t\t\tdivisor = getDivisor(a,b);\n\n\t\t\t//最小公倍数を求める\n\t\t\tmultiple = getMultiple(a,b);\n\t\t\t\n\t\t\t//結果の表示\n\t\t\tSystem.out.println(divisor + \" \" + multiple);\n\t\t\t\n\t\t\tintList.clear();\t\t\t\t\t\t//リストのクリア\n\t\t}\n\t}",
"String\t\tstr;",
"str",
"int a",
"a",
"b",
"b",
"multiple = 0",
"multiple",
"0",
"divisor = 0;",
"divisor",
"0",
"ArrayList<String>\tlist\t= new ArrayList<String>();",
"list",
"new ArrayList<String>()",
"ArrayList<Integer>\tintList\t= new ArrayList<Integer>();",
"intList",
"new ArrayList<Integer>()",
"try {\n\t\t\tBufferedReader br\t=\tnew BufferedReader(new InputStreamReader(System.in));\n\t\t\twhile((str=br.readLine())!=null){\n\t\t\t\tlist.add(str);\t\t\t\t\t\t//行単位でArrayListに追加\n\t\t\t}\n\t\t\tbr.close();\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}",
"catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}",
"IOException e",
"{\n\t\t\te.printStackTrace();\n\t\t}",
"e.printStackTrace()",
"e.printStackTrace",
"e",
"{\n\t\t\tBufferedReader br\t=\tnew BufferedReader(new InputStreamReader(System.in));\n\t\t\twhile((str=br.readLine())!=null){\n\t\t\t\tlist.add(str);\t\t\t\t\t\t//行単位でArrayListに追加\n\t\t\t}\n\t\t\tbr.close();\n\t\t}",
"BufferedReader br\t=\tnew BufferedReader(new InputStreamReader(System.in));",
"br",
"new BufferedReader(new InputStreamReader(System.in))",
"while((str=br.readLine())!=null){\n\t\t\t\tlist.add(str);\t\t\t\t\t\t//行単位でArrayListに追加\n\t\t\t}",
"(str=br.readLine())!=null",
"(str=br.readLine())",
"str",
"br.readLine()",
"br.readLine",
"br",
"null",
"{\n\t\t\t\tlist.add(str);\t\t\t\t\t\t//行単位でArrayListに追加\n\t\t\t}",
"list.add(str)",
"list.add",
"list",
"str",
"br.close()",
"br.close",
"br",
"for(int i=0; i<list.size(); i++){\t\t\t//一行文のデータ毎に処理する\n\t\t\tString[] s = list.get(i).split(\" \");\t//listの要素を空白で区切って配列を作成\n\t\t\tfor(int j=0; j<s.length; j++){\t\t\t//int型に変換してArrayListに追加\n\t\t\t\tintList.add(Integer.parseInt(s[j]));\n\t\t\t}\n\t\t\tCollections.sort(intList);\t\t\t\t//小さい順に並べる\n\n\t\t\ta = intList.get(0);\t\t\t\t\t\t//a,bを決める。a<bとなっている。\n\t\t\tb = intList.get(1);\n\t\t\t\n\t\t\t//最大公約数を求める\n\t\t\tdivisor = getDivisor(a,b);\n\n\t\t\t//最小公倍数を求める\n\t\t\tmultiple = getMultiple(a,b);\n\t\t\t\n\t\t\t//結果の表示\n\t\t\tSystem.out.println(divisor + \" \" + multiple);\n\t\t\t\n\t\t\tintList.clear();\t\t\t\t\t\t//リストのクリア\n\t\t}",
"int i=0;",
"int i=0;",
"i",
"0",
"i<list.size()",
"i",
"list.size()",
"list.size",
"list",
"i++",
"i++",
"i",
"{\t\t\t//一行文のデータ毎に処理する\n\t\t\tString[] s = list.get(i).split(\" \");\t//listの要素を空白で区切って配列を作成\n\t\t\tfor(int j=0; j<s.length; j++){\t\t\t//int型に変換してArrayListに追加\n\t\t\t\tintList.add(Integer.parseInt(s[j]));\n\t\t\t}\n\t\t\tCollections.sort(intList);\t\t\t\t//小さい順に並べる\n\n\t\t\ta = intList.get(0);\t\t\t\t\t\t//a,bを決める。a<bとなっている。\n\t\t\tb = intList.get(1);\n\t\t\t\n\t\t\t//最大公約数を求める\n\t\t\tdivisor = getDivisor(a,b);\n\n\t\t\t//最小公倍数を求める\n\t\t\tmultiple = getMultiple(a,b);\n\t\t\t\n\t\t\t//結果の表示\n\t\t\tSystem.out.println(divisor + \" \" + multiple);\n\t\t\t\n\t\t\tintList.clear();\t\t\t\t\t\t//リストのクリア\n\t\t}",
"{\t\t\t//一行文のデータ毎に処理する\n\t\t\tString[] s = list.get(i).split(\" \");\t//listの要素を空白で区切って配列を作成\n\t\t\tfor(int j=0; j<s.length; j++){\t\t\t//int型に変換してArrayListに追加\n\t\t\t\tintList.add(Integer.parseInt(s[j]));\n\t\t\t}\n\t\t\tCollections.sort(intList);\t\t\t\t//小さい順に並べる\n\n\t\t\ta = intList.get(0);\t\t\t\t\t\t//a,bを決める。a<bとなっている。\n\t\t\tb = intList.get(1);\n\t\t\t\n\t\t\t//最大公約数を求める\n\t\t\tdivisor = getDivisor(a,b);\n\n\t\t\t//最小公倍数を求める\n\t\t\tmultiple = getMultiple(a,b);\n\t\t\t\n\t\t\t//結果の表示\n\t\t\tSystem.out.println(divisor + \" \" + multiple);\n\t\t\t\n\t\t\tintList.clear();\t\t\t\t\t\t//リストのクリア\n\t\t}",
"String[] s = list.get(i).split(\" \");",
"s",
"list.get(i).split(\" \")",
"list.get(i).split",
"list.get(i)",
"list.get",
"list",
"i",
"\" \"",
"for(int j=0; j<s.length; j++){\t\t\t//int型に変換してArrayListに追加\n\t\t\t\tintList.add(Integer.parseInt(s[j]));\n\t\t\t}",
"int j=0;",
"int j=0;",
"j",
"0",
"j<s.length",
"j",
"s.length",
"s",
"s.length",
"j++",
"j++",
"j",
"{\t\t\t//int型に変換してArrayListに追加\n\t\t\t\tintList.add(Integer.parseInt(s[j]));\n\t\t\t}",
"{\t\t\t//int型に変換してArrayListに追加\n\t\t\t\tintList.add(Integer.parseInt(s[j]));\n\t\t\t}",
"intList.add(Integer.parseInt(s[j]))",
"intList.add",
"intList",
"Integer.parseInt(s[j])",
"Integer.parseInt",
"Integer",
"s[j]",
"s",
"j",
"Collections.sort(intList)",
"Collections.sort",
"Collections",
"intList",
"a = intList.get(0)",
"a",
"intList.get(0)",
"intList.get",
"intList",
"0",
"b = intList.get(1)",
"b",
"intList.get(1)",
"intList.get",
"intList",
"1",
"divisor = getDivisor(a,b)",
"divisor",
"getDivisor(a,b)",
"getDivisor",
"a",
"b",
"multiple = getMultiple(a,b)",
"multiple",
"getMultiple(a,b)",
"getMultiple",
"a",
"b",
"System.out.println(divisor + \" \" + multiple)",
"System.out.println",
"System.out",
"System",
"System.out",
"divisor + \" \" + multiple",
"divisor + \" \" + multiple",
"divisor",
"\" \"",
"multiple",
"intList.clear()",
"intList.clear",
"intList",
"String[] args",
"args",
"//最大公約数を求めるメソッド\n\tstatic int getDivisor(int x, int y){\n\t\tif(x%y==0){\n\t\t\treturn y;\n\t\t}else{\n\t\t\tint m = 1;\n\t\t\twhile(m!=0){\n\t\t\t\tm = y%x;\n\t\t\t\ty = x;\n\t\t\t\tx = m;\n\t\t\t}\n\t\t\treturn y;\n\t\t}\n\t}",
"getDivisor",
"{\n\t\tif(x%y==0){\n\t\t\treturn y;\n\t\t}else{\n\t\t\tint m = 1;\n\t\t\twhile(m!=0){\n\t\t\t\tm = y%x;\n\t\t\t\ty = x;\n\t\t\t\tx = m;\n\t\t\t}\n\t\t\treturn y;\n\t\t}\n\t}",
"if(x%y==0){\n\t\t\treturn y;\n\t\t}else{\n\t\t\tint m = 1;\n\t\t\twhile(m!=0){\n\t\t\t\tm = y%x;\n\t\t\t\ty = x;\n\t\t\t\tx = m;\n\t\t\t}\n\t\t\treturn y;\n\t\t}",
"x%y==0",
"x%y",
"x",
"y",
"0",
"{\n\t\t\treturn y;\n\t\t}",
"return y;",
"y",
"{\n\t\t\tint m = 1;\n\t\t\twhile(m!=0){\n\t\t\t\tm = y%x;\n\t\t\t\ty = x;\n\t\t\t\tx = m;\n\t\t\t}\n\t\t\treturn y;\n\t\t}",
"int m = 1;",
"m",
"1",
"while(m!=0){\n\t\t\t\tm = y%x;\n\t\t\t\ty = x;\n\t\t\t\tx = m;\n\t\t\t}",
"m!=0",
"m",
"0",
"{\n\t\t\t\tm = y%x;\n\t\t\t\ty = x;\n\t\t\t\tx = m;\n\t\t\t}",
"m = y%x",
"m",
"y%x",
"y",
"x",
"y = x",
"y",
"x",
"x = m",
"x",
"m",
"return y;",
"y",
"int x",
"x",
"int y",
"y",
"//最小公倍数を求めるメソッド\n\tstatic int getMultiple(int x, int y){\n\t\tfor(int i=1; i<=x; i++){\n\t\t\tif(y*i%x==0){\n\t\t\t\treturn y*i;\n\t\t\t}\n\t\t}\n\t\treturn 0;\n\t}",
"getMultiple",
"{\n\t\tfor(int i=1; i<=x; i++){\n\t\t\tif(y*i%x==0){\n\t\t\t\treturn y*i;\n\t\t\t}\n\t\t}\n\t\treturn 0;\n\t}",
"for(int i=1; i<=x; i++){\n\t\t\tif(y*i%x==0){\n\t\t\t\treturn y*i;\n\t\t\t}\n\t\t}",
"int i=1;",
"int i=1;",
"i",
"1",
"i<=x",
"i",
"x",
"i++",
"i++",
"i",
"{\n\t\t\tif(y*i%x==0){\n\t\t\t\treturn y*i;\n\t\t\t}\n\t\t}",
"{\n\t\t\tif(y*i%x==0){\n\t\t\t\treturn y*i;\n\t\t\t}\n\t\t}",
"if(y*i%x==0){\n\t\t\t\treturn y*i;\n\t\t\t}",
"y*i%x==0",
"y*i%x",
"y*i",
"y",
"i",
"x",
"0",
"{\n\t\t\t\treturn y*i;\n\t\t\t}",
"return y*i;",
"y*i",
"y",
"i",
"return 0;",
"0",
"int x",
"x",
"int y",
"y",
"public class Main {\n\tpublic static void main(String[] args){\n\t\tString\t\tstr;\n\t\tint a,b,multiple = 0,divisor = 0;\n\t\tArrayList<String>\tlist\t= new ArrayList<String>();\n\t\tArrayList<Integer>\tintList\t= new ArrayList<Integer>();\n\t\ttry {\n\t\t\tBufferedReader br\t=\tnew BufferedReader(new InputStreamReader(System.in));\n\t\t\twhile((str=br.readLine())!=null){\n\t\t\t\tlist.add(str);\t\t\t\t\t\t//行単位でArrayListに追加\n\t\t\t}\n\t\t\tbr.close();\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\n\t\tfor(int i=0; i<list.size(); i++){\t\t\t//一行文のデータ毎に処理する\n\t\t\tString[] s = list.get(i).split(\" \");\t//listの要素を空白で区切って配列を作成\n\t\t\tfor(int j=0; j<s.length; j++){\t\t\t//int型に変換してArrayListに追加\n\t\t\t\tintList.add(Integer.parseInt(s[j]));\n\t\t\t}\n\t\t\tCollections.sort(intList);\t\t\t\t//小さい順に並べる\n\n\t\t\ta = intList.get(0);\t\t\t\t\t\t//a,bを決める。a<bとなっている。\n\t\t\tb = intList.get(1);\n\t\t\t\n\t\t\t//最大公約数を求める\n\t\t\tdivisor = getDivisor(a,b);\n\n\t\t\t//最小公倍数を求める\n\t\t\tmultiple = getMultiple(a,b);\n\t\t\t\n\t\t\t//結果の表示\n\t\t\tSystem.out.println(divisor + \" \" + multiple);\n\t\t\t\n\t\t\tintList.clear();\t\t\t\t\t\t//リストのクリア\n\t\t}\n\t}\n\t\n\t//最大公約数を求めるメソッド\n\tstatic int getDivisor(int x, int y){\n\t\tif(x%y==0){\n\t\t\treturn y;\n\t\t}else{\n\t\t\tint m = 1;\n\t\t\twhile(m!=0){\n\t\t\t\tm = y%x;\n\t\t\t\ty = x;\n\t\t\t\tx = m;\n\t\t\t}\n\t\t\treturn y;\n\t\t}\n\t}\n\t//最小公倍数を求めるメソッド\n\tstatic int getMultiple(int x, int y){\n\t\tfor(int i=1; i<=x; i++){\n\t\t\tif(y*i%x==0){\n\t\t\t\treturn y*i;\n\t\t\t}\n\t\t}\n\t\treturn 0;\n\t}\n}",
"public class Main {\n\tpublic static void main(String[] args){\n\t\tString\t\tstr;\n\t\tint a,b,multiple = 0,divisor = 0;\n\t\tArrayList<String>\tlist\t= new ArrayList<String>();\n\t\tArrayList<Integer>\tintList\t= new ArrayList<Integer>();\n\t\ttry {\n\t\t\tBufferedReader br\t=\tnew BufferedReader(new InputStreamReader(System.in));\n\t\t\twhile((str=br.readLine())!=null){\n\t\t\t\tlist.add(str);\t\t\t\t\t\t//行単位でArrayListに追加\n\t\t\t}\n\t\t\tbr.close();\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\n\t\tfor(int i=0; i<list.size(); i++){\t\t\t//一行文のデータ毎に処理する\n\t\t\tString[] s = list.get(i).split(\" \");\t//listの要素を空白で区切って配列を作成\n\t\t\tfor(int j=0; j<s.length; j++){\t\t\t//int型に変換してArrayListに追加\n\t\t\t\tintList.add(Integer.parseInt(s[j]));\n\t\t\t}\n\t\t\tCollections.sort(intList);\t\t\t\t//小さい順に並べる\n\n\t\t\ta = intList.get(0);\t\t\t\t\t\t//a,bを決める。a<bとなっている。\n\t\t\tb = intList.get(1);\n\t\t\t\n\t\t\t//最大公約数を求める\n\t\t\tdivisor = getDivisor(a,b);\n\n\t\t\t//最小公倍数を求める\n\t\t\tmultiple = getMultiple(a,b);\n\t\t\t\n\t\t\t//結果の表示\n\t\t\tSystem.out.println(divisor + \" \" + multiple);\n\t\t\t\n\t\t\tintList.clear();\t\t\t\t\t\t//リストのクリア\n\t\t}\n\t}\n\t\n\t//最大公約数を求めるメソッド\n\tstatic int getDivisor(int x, int y){\n\t\tif(x%y==0){\n\t\t\treturn y;\n\t\t}else{\n\t\t\tint m = 1;\n\t\t\twhile(m!=0){\n\t\t\t\tm = y%x;\n\t\t\t\ty = x;\n\t\t\t\tx = m;\n\t\t\t}\n\t\t\treturn y;\n\t\t}\n\t}\n\t//最小公倍数を求めるメソッド\n\tstatic int getMultiple(int x, int y){\n\t\tfor(int i=1; i<=x; i++){\n\t\t\tif(y*i%x==0){\n\t\t\t\treturn y*i;\n\t\t\t}\n\t\t}\n\t\treturn 0;\n\t}\n}",
"Main"
] | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Collections;
public class Main {
public static void main(String[] args){
String str;
int a,b,multiple = 0,divisor = 0;
ArrayList<String> list = new ArrayList<String>();
ArrayList<Integer> intList = new ArrayList<Integer>();
try {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
while((str=br.readLine())!=null){
list.add(str); //行単位でArrayListに追加
}
br.close();
} catch (IOException e) {
e.printStackTrace();
}
for(int i=0; i<list.size(); i++){ //一行文のデータ毎に処理する
String[] s = list.get(i).split(" "); //listの要素を空白で区切って配列を作成
for(int j=0; j<s.length; j++){ //int型に変換してArrayListに追加
intList.add(Integer.parseInt(s[j]));
}
Collections.sort(intList); //小さい順に並べる
a = intList.get(0); //a,bを決める。a<bとなっている。
b = intList.get(1);
//最大公約数を求める
divisor = getDivisor(a,b);
//最小公倍数を求める
multiple = getMultiple(a,b);
//結果の表示
System.out.println(divisor + " " + multiple);
intList.clear(); //リストのクリア
}
}
//最大公約数を求めるメソッド
static int getDivisor(int x, int y){
if(x%y==0){
return y;
}else{
int m = 1;
while(m!=0){
m = y%x;
y = x;
x = m;
}
return y;
}
}
//最小公倍数を求めるメソッド
static int getMultiple(int x, int y){
for(int i=1; i<=x; i++){
if(y*i%x==0){
return y*i;
}
}
return 0;
}
} |
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
42,
4,
18,
13,
30,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
4,
18,
18,
13,
13,
2,
2,
4,
13,
13,
13,
17,
4,
13,
13,
13,
23,
13,
12,
13,
30,
41,
13,
13,
0,
13,
13,
0,
13,
13,
23,
13,
23,
13,
12,
13,
30,
14,
2,
13,
13,
4,
13,
13,
13,
42,
2,
13,
17,
30,
41,
13,
13,
0,
13,
2,
13,
13,
0,
13,
13,
29,
13,
23,
13,
23,
13,
12,
13,
30,
29,
2,
2,
13,
4,
13,
13,
13,
13,
23,
13,
23,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
13,
14
],
[
14,
15
],
[
12,
16
],
[
16,
17
],
[
17,
18
],
[
17,
19
],
[
19,
20
],
[
20,
21
],
[
16,
22
],
[
22,
23
],
[
22,
24
],
[
24,
25
],
[
25,
26
],
[
16,
27
],
[
27,
28
],
[
28,
29
],
[
29,
30
],
[
29,
31
],
[
27,
32
],
[
33,
33
],
[
33,
34
],
[
34,
35
],
[
34,
36
],
[
34,
37
],
[
33,
38
],
[
33,
39
],
[
39,
40
],
[
39,
41
],
[
39,
42
],
[
6,
43
],
[
43,
44
],
[
4,
45
],
[
45,
46
],
[
45,
47
],
[
47,
48
],
[
48,
49
],
[
48,
50
],
[
47,
51
],
[
51,
52
],
[
51,
53
],
[
47,
54
],
[
54,
55
],
[
54,
56
],
[
45,
57
],
[
57,
58
],
[
45,
59
],
[
59,
60
],
[
4,
61
],
[
61,
62
],
[
61,
63
],
[
63,
64
],
[
64,
65
],
[
65,
66
],
[
65,
67
],
[
64,
68
],
[
68,
69
],
[
68,
70
],
[
68,
71
],
[
63,
72
],
[
72,
73
],
[
73,
74
],
[
73,
75
],
[
72,
76
],
[
76,
77
],
[
77,
78
],
[
77,
79
],
[
76,
80
],
[
80,
81
],
[
80,
82
],
[
82,
83
],
[
82,
84
],
[
76,
85
],
[
85,
86
],
[
85,
87
],
[
63,
88
],
[
88,
89
],
[
61,
90
],
[
90,
91
],
[
61,
92
],
[
92,
93
],
[
4,
94
],
[
94,
95
],
[
94,
96
],
[
96,
97
],
[
97,
98
],
[
98,
99
],
[
99,
100
],
[
99,
101
],
[
101,
102
],
[
101,
103
],
[
101,
104
],
[
98,
105
],
[
94,
106
],
[
106,
107
],
[
94,
108
],
[
108,
109
]
] | [
"import java.util.Scanner;\n\nclass Main {\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n\n while (sc.hasNext()) {\n int a = sc.nextInt();\n int b = sc.nextInt();\n\n System.out.println(gcd(a, b) + \" \" + lcm(a, b));\n }\n }\n\n static void swap(int a, int b) {\n int temp = a;\n a = b;\n b = temp;\n }\n\n static int gcd(int a, int b) {\n if (a < b) swap(a, b);\n\n while (b != 0) {\n int temp = b;\n b = a % b;\n a = temp;\n }\n\n return a;\n }\n\n static int lcm(int a, int b) {\n return a / gcd(a, b) * b;\n }\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"class Main {\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n\n while (sc.hasNext()) {\n int a = sc.nextInt();\n int b = sc.nextInt();\n\n System.out.println(gcd(a, b) + \" \" + lcm(a, b));\n }\n }\n\n static void swap(int a, int b) {\n int temp = a;\n a = b;\n b = temp;\n }\n\n static int gcd(int a, int b) {\n if (a < b) swap(a, b);\n\n while (b != 0) {\n int temp = b;\n b = a % b;\n a = temp;\n }\n\n return a;\n }\n\n static int lcm(int a, int b) {\n return a / gcd(a, b) * b;\n }\n}",
"Main",
"public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n\n while (sc.hasNext()) {\n int a = sc.nextInt();\n int b = sc.nextInt();\n\n System.out.println(gcd(a, b) + \" \" + lcm(a, b));\n }\n }",
"main",
"{\n Scanner sc = new Scanner(System.in);\n\n while (sc.hasNext()) {\n int a = sc.nextInt();\n int b = sc.nextInt();\n\n System.out.println(gcd(a, b) + \" \" + lcm(a, b));\n }\n }",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"while (sc.hasNext()) {\n int a = sc.nextInt();\n int b = sc.nextInt();\n\n System.out.println(gcd(a, b) + \" \" + lcm(a, b));\n }",
"sc.hasNext()",
"sc.hasNext",
"sc",
"{\n int a = sc.nextInt();\n int b = sc.nextInt();\n\n System.out.println(gcd(a, b) + \" \" + lcm(a, b));\n }",
"int a = sc.nextInt();",
"a",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int b = sc.nextInt();",
"b",
"sc.nextInt()",
"sc.nextInt",
"sc",
"System.out.println(gcd(a, b) + \" \" + lcm(a, b))",
"System.out.println",
"System.out",
"System",
"System.out",
"gcd(a, b) + \" \" + lcm(a, b)",
"gcd(a, b) + \" \" + lcm(a, b)",
"gcd(a, b)",
"gcd",
"a",
"b",
"\" \"",
"lcm(a, b)",
"lcm",
"a",
"b",
"String[] args",
"args",
"static void swap(int a, int b) {\n int temp = a;\n a = b;\n b = temp;\n }",
"swap",
"{\n int temp = a;\n a = b;\n b = temp;\n }",
"int temp = a;",
"temp",
"a",
"a = b",
"a",
"b",
"b = temp",
"b",
"temp",
"int a",
"a",
"int b",
"b",
"static int gcd(int a, int b) {\n if (a < b) swap(a, b);\n\n while (b != 0) {\n int temp = b;\n b = a % b;\n a = temp;\n }\n\n return a;\n }",
"gcd",
"{\n if (a < b) swap(a, b);\n\n while (b != 0) {\n int temp = b;\n b = a % b;\n a = temp;\n }\n\n return a;\n }",
"if (a < b) swap(a, b);",
"a < b",
"a",
"b",
"swap(a, b)",
"swap",
"a",
"b",
"while (b != 0) {\n int temp = b;\n b = a % b;\n a = temp;\n }",
"b != 0",
"b",
"0",
"{\n int temp = b;\n b = a % b;\n a = temp;\n }",
"int temp = b;",
"temp",
"b",
"b = a % b",
"b",
"a % b",
"a",
"b",
"a = temp",
"a",
"temp",
"return a;",
"a",
"int a",
"a",
"int b",
"b",
"static int lcm(int a, int b) {\n return a / gcd(a, b) * b;\n }",
"lcm",
"{\n return a / gcd(a, b) * b;\n }",
"return a / gcd(a, b) * b;",
"a / gcd(a, b) * b",
"a / gcd(a, b)",
"a",
"gcd(a, b)",
"gcd",
"a",
"b",
"b",
"int a",
"a",
"int b",
"b"
] | import java.util.Scanner;
class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
while (sc.hasNext()) {
int a = sc.nextInt();
int b = sc.nextInt();
System.out.println(gcd(a, b) + " " + lcm(a, b));
}
}
static void swap(int a, int b) {
int temp = a;
a = b;
b = temp;
}
static int gcd(int a, int b) {
if (a < b) swap(a, b);
while (b != 0) {
int temp = b;
b = a % b;
a = temp;
}
return a;
}
static int lcm(int a, int b) {
return a / gcd(a, b) * b;
}
} |
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
42,
4,
18,
13,
30,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
41,
13,
17,
11,
1,
41,
13,
17,
2,
2,
13,
13,
2,
13,
13,
1,
0,
13,
17,
30,
30,
14,
2,
2,
2,
13,
13,
17,
2,
2,
13,
13,
17,
30,
0,
13,
13,
0,
13,
13,
0,
13,
13,
30,
40,
13,
4,
18,
18,
13,
13,
2,
2,
13,
17,
2,
2,
13,
13,
13,
0,
13,
17,
23,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
13,
14
],
[
14,
15
],
[
12,
16
],
[
16,
17
],
[
17,
18
],
[
17,
19
],
[
19,
20
],
[
20,
21
],
[
16,
22
],
[
22,
23
],
[
22,
24
],
[
24,
25
],
[
25,
26
],
[
16,
27
],
[
27,
28
],
[
27,
29
],
[
16,
30
],
[
30,
31
],
[
31,
32
],
[
32,
33
],
[
32,
34
],
[
30,
35
],
[
35,
36
],
[
36,
37
],
[
36,
38
],
[
35,
39
],
[
39,
40
],
[
39,
41
],
[
30,
42
],
[
42,
43
],
[
43,
44
],
[
43,
45
],
[
30,
46
],
[
47,
47
],
[
47,
48
],
[
48,
49
],
[
49,
50
],
[
50,
51
],
[
51,
52
],
[
51,
53
],
[
50,
54
],
[
49,
55
],
[
55,
56
],
[
56,
57
],
[
56,
58
],
[
55,
59
],
[
48,
60
],
[
60,
61
],
[
61,
62
],
[
61,
63
],
[
60,
64
],
[
64,
65
],
[
64,
66
],
[
60,
67
],
[
67,
68
],
[
67,
69
],
[
48,
70
],
[
70,
71
],
[
71,
72
],
[
16,
73
],
[
73,
74
],
[
74,
75
],
[
75,
76
],
[
75,
77
],
[
73,
78
],
[
79,
79
],
[
79,
80
],
[
79,
81
],
[
79,
82
],
[
83,
83
],
[
83,
84
],
[
83,
85
],
[
83,
86
],
[
16,
87
],
[
87,
88
],
[
87,
89
],
[
6,
90
],
[
90,
91
]
] | [
"import java.util.Scanner;\n\nclass Main{\t\n\t\n\tpublic static void main (String[] args){\n\t\tScanner sc = new Scanner(System.in);\n\t\t\n\t\twhile (sc.hasNext()){\n\t\tint a = sc.nextInt();\n\t\tint b = sc.nextInt();\n\t\tint n = 1;\n\t\tfor(int i=2; i<=a&&i<=b ;i+=0){\n\t\t\tif(a%i==0 &&b%i==0){\n\t\t\t\tn *= i;\n\t\t\t\ta /= i;\n\t\t\t\tb /= i;\n\t\t\t}else{\n\t\t\t\ti++;\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(n+\" \"+n*a*b);\n\t\tn=1;\n\t\t}\n\t\n\t}\n} ",
"import java.util.Scanner;",
"Scanner",
"java.util",
"class Main{\t\n\t\n\tpublic static void main (String[] args){\n\t\tScanner sc = new Scanner(System.in);\n\t\t\n\t\twhile (sc.hasNext()){\n\t\tint a = sc.nextInt();\n\t\tint b = sc.nextInt();\n\t\tint n = 1;\n\t\tfor(int i=2; i<=a&&i<=b ;i+=0){\n\t\t\tif(a%i==0 &&b%i==0){\n\t\t\t\tn *= i;\n\t\t\t\ta /= i;\n\t\t\t\tb /= i;\n\t\t\t}else{\n\t\t\t\ti++;\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(n+\" \"+n*a*b);\n\t\tn=1;\n\t\t}\n\t\n\t}\n}",
"Main",
"public static void main (String[] args){\n\t\tScanner sc = new Scanner(System.in);\n\t\t\n\t\twhile (sc.hasNext()){\n\t\tint a = sc.nextInt();\n\t\tint b = sc.nextInt();\n\t\tint n = 1;\n\t\tfor(int i=2; i<=a&&i<=b ;i+=0){\n\t\t\tif(a%i==0 &&b%i==0){\n\t\t\t\tn *= i;\n\t\t\t\ta /= i;\n\t\t\t\tb /= i;\n\t\t\t}else{\n\t\t\t\ti++;\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(n+\" \"+n*a*b);\n\t\tn=1;\n\t\t}\n\t\n\t}",
"main",
"{\n\t\tScanner sc = new Scanner(System.in);\n\t\t\n\t\twhile (sc.hasNext()){\n\t\tint a = sc.nextInt();\n\t\tint b = sc.nextInt();\n\t\tint n = 1;\n\t\tfor(int i=2; i<=a&&i<=b ;i+=0){\n\t\t\tif(a%i==0 &&b%i==0){\n\t\t\t\tn *= i;\n\t\t\t\ta /= i;\n\t\t\t\tb /= i;\n\t\t\t}else{\n\t\t\t\ti++;\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(n+\" \"+n*a*b);\n\t\tn=1;\n\t\t}\n\t\n\t}",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"while (sc.hasNext()){\n\t\tint a = sc.nextInt();\n\t\tint b = sc.nextInt();\n\t\tint n = 1;\n\t\tfor(int i=2; i<=a&&i<=b ;i+=0){\n\t\t\tif(a%i==0 &&b%i==0){\n\t\t\t\tn *= i;\n\t\t\t\ta /= i;\n\t\t\t\tb /= i;\n\t\t\t}else{\n\t\t\t\ti++;\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(n+\" \"+n*a*b);\n\t\tn=1;\n\t\t}",
"sc.hasNext()",
"sc.hasNext",
"sc",
"{\n\t\tint a = sc.nextInt();\n\t\tint b = sc.nextInt();\n\t\tint n = 1;\n\t\tfor(int i=2; i<=a&&i<=b ;i+=0){\n\t\t\tif(a%i==0 &&b%i==0){\n\t\t\t\tn *= i;\n\t\t\t\ta /= i;\n\t\t\t\tb /= i;\n\t\t\t}else{\n\t\t\t\ti++;\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(n+\" \"+n*a*b);\n\t\tn=1;\n\t\t}",
"int a = sc.nextInt();",
"a",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int b = sc.nextInt();",
"b",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int n = 1;",
"n",
"1",
"for(int i=2; i<=a&&i<=b ;i+=0){\n\t\t\tif(a%i==0 &&b%i==0){\n\t\t\t\tn *= i;\n\t\t\t\ta /= i;\n\t\t\t\tb /= i;\n\t\t\t}else{\n\t\t\t\ti++;\n\t\t\t}\n\t\t}",
"int i=2;",
"int i=2;",
"i",
"2",
"i<=a&&i<=b",
"i<=a",
"i",
"a",
"i<=b",
"i",
"b",
"i+=0",
"i+=0",
"i",
"0",
"{\n\t\t\tif(a%i==0 &&b%i==0){\n\t\t\t\tn *= i;\n\t\t\t\ta /= i;\n\t\t\t\tb /= i;\n\t\t\t}else{\n\t\t\t\ti++;\n\t\t\t}\n\t\t}",
"{\n\t\t\tif(a%i==0 &&b%i==0){\n\t\t\t\tn *= i;\n\t\t\t\ta /= i;\n\t\t\t\tb /= i;\n\t\t\t}else{\n\t\t\t\ti++;\n\t\t\t}\n\t\t}",
"if(a%i==0 &&b%i==0){\n\t\t\t\tn *= i;\n\t\t\t\ta /= i;\n\t\t\t\tb /= i;\n\t\t\t}else{\n\t\t\t\ti++;\n\t\t\t}",
"a%i==0 &&b%i==0",
"a%i==0",
"a%i",
"a",
"i",
"0",
"b%i==0",
"b%i",
"b",
"i",
"0",
"{\n\t\t\t\tn *= i;\n\t\t\t\ta /= i;\n\t\t\t\tb /= i;\n\t\t\t}",
"n *= i",
"n",
"i",
"a /= i",
"a",
"i",
"b /= i",
"b",
"i",
"{\n\t\t\t\ti++;\n\t\t\t}",
"i++",
"i",
"System.out.println(n+\" \"+n*a*b)",
"System.out.println",
"System.out",
"System",
"System.out",
"n+\" \"+n*a*b",
"n+\" \"+n*a*b",
"n",
"\" \"",
"n*a*b",
"n*a*b",
"n",
"a",
"b",
"n=1",
"n",
"1",
"String[] args",
"args"
] | import java.util.Scanner;
class Main{
public static void main (String[] args){
Scanner sc = new Scanner(System.in);
while (sc.hasNext()){
int a = sc.nextInt();
int b = sc.nextInt();
int n = 1;
for(int i=2; i<=a&&i<=b ;i+=0){
if(a%i==0 &&b%i==0){
n *= i;
a /= i;
b /= i;
}else{
i++;
}
}
System.out.println(n+" "+n*a*b);
n=1;
}
}
} |
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
14,
2,
13,
17,
30,
29,
13,
30,
29,
4,
13,
13,
2,
13,
13,
23,
13,
23,
13,
12,
13,
30,
41,
13,
4,
13,
13,
13,
14,
2,
2,
13,
13,
17,
30,
29,
2,
2,
13,
13,
13,
30,
29,
2,
2,
13,
13,
13,
23,
13,
23,
13,
12,
13,
30,
41,
13,
41,
13,
41,
13,
41,
13,
41,
13,
20,
42,
4,
18,
13,
30,
0,
13,
4,
18,
13,
0,
13,
4,
18,
13,
0,
13,
4,
13,
4,
18,
13,
13,
13,
4,
18,
13,
13,
13,
0,
13,
4,
13,
13,
13,
4,
18,
18,
13,
13,
2,
2,
13,
17,
13,
4,
18,
13,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
126,
5
],
[
126,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
10,
11
],
[
10,
12
],
[
9,
13
],
[
13,
14
],
[
14,
15
],
[
9,
16
],
[
16,
17
],
[
17,
18
],
[
18,
19
],
[
18,
20
],
[
18,
21
],
[
21,
22
],
[
21,
23
],
[
6,
24
],
[
24,
25
],
[
6,
26
],
[
26,
27
],
[
126,
28
],
[
28,
29
],
[
28,
30
],
[
30,
31
],
[
31,
32
],
[
31,
33
],
[
33,
34
],
[
33,
35
],
[
33,
36
],
[
30,
37
],
[
37,
38
],
[
38,
39
],
[
39,
40
],
[
39,
41
],
[
38,
42
],
[
37,
43
],
[
43,
44
],
[
44,
45
],
[
45,
46
],
[
46,
47
],
[
46,
48
],
[
45,
49
],
[
37,
50
],
[
50,
51
],
[
51,
52
],
[
52,
53
],
[
53,
54
],
[
53,
55
],
[
52,
56
],
[
28,
57
],
[
57,
58
],
[
28,
59
],
[
59,
60
],
[
126,
61
],
[
61,
62
],
[
61,
63
],
[
63,
64
],
[
64,
65
],
[
63,
66
],
[
66,
67
],
[
63,
68
],
[
68,
69
],
[
63,
70
],
[
70,
71
],
[
63,
72
],
[
72,
73
],
[
72,
74
],
[
63,
75
],
[
75,
76
],
[
76,
77
],
[
77,
78
],
[
75,
79
],
[
79,
80
],
[
80,
81
],
[
80,
82
],
[
82,
83
],
[
83,
84
],
[
79,
85
],
[
85,
86
],
[
85,
87
],
[
87,
88
],
[
88,
89
],
[
79,
90
],
[
90,
91
],
[
90,
92
],
[
92,
93
],
[
92,
94
],
[
94,
95
],
[
95,
96
],
[
94,
97
],
[
94,
98
],
[
92,
99
],
[
99,
100
],
[
100,
101
],
[
99,
102
],
[
99,
103
],
[
79,
104
],
[
104,
105
],
[
104,
106
],
[
106,
107
],
[
106,
108
],
[
106,
109
],
[
79,
110
],
[
110,
111
],
[
111,
112
],
[
112,
113
],
[
112,
114
],
[
110,
115
],
[
116,
116
],
[
116,
117
],
[
116,
118
],
[
116,
119
],
[
63,
120
],
[
120,
121
],
[
121,
122
],
[
61,
123
],
[
123,
124
],
[
0,
125
],
[
125,
126
],
[
125,
127
]
] | [
"import java.util.Scanner;\n\npublic class Main\n{\n\tprivate static int calcGCD(int a,int b)\n\t{\n\t\tif(b==0){\n\t\t\treturn a;\n\t\t}else{\n\t\t\treturn calcGCD(b,a%b);\n\t\t}\n\t}\n\tprivate static int calcLCM(int a,int b)\n\t{\n\t\tint gcd=calcGCD(a,b);\n\t\tif(a%gcd==0){\n\t\t\treturn (a/gcd)*b;\n\t\t}else{\n\t\t\treturn (b/gcd)*a;\n\t\t}\n\t}\n\t\n\tpublic static void main(String[] args)\n\t{\n\t\tint a,b;\n\t\tint gcd,lcm;\n\t\tScanner scan=new Scanner(System.in);\n\t\twhile(scan.hasNext()){\n\t\t\ta=scan.nextInt();\n\t\t\tb=scan.nextInt();\n\t\t\tgcd=calcGCD(Math.max(a,b),Math.min(a,b));\n\t\t\tlcm=calcLCM(a,b);\n\t\t\tSystem.out.println(gcd+\" \"+lcm);\n\t\t}\n\t\tscan.close();\n\t}\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main\n{\n\tprivate static int calcGCD(int a,int b)\n\t{\n\t\tif(b==0){\n\t\t\treturn a;\n\t\t}else{\n\t\t\treturn calcGCD(b,a%b);\n\t\t}\n\t}\n\tprivate static int calcLCM(int a,int b)\n\t{\n\t\tint gcd=calcGCD(a,b);\n\t\tif(a%gcd==0){\n\t\t\treturn (a/gcd)*b;\n\t\t}else{\n\t\t\treturn (b/gcd)*a;\n\t\t}\n\t}\n\t\n\tpublic static void main(String[] args)\n\t{\n\t\tint a,b;\n\t\tint gcd,lcm;\n\t\tScanner scan=new Scanner(System.in);\n\t\twhile(scan.hasNext()){\n\t\t\ta=scan.nextInt();\n\t\t\tb=scan.nextInt();\n\t\t\tgcd=calcGCD(Math.max(a,b),Math.min(a,b));\n\t\t\tlcm=calcLCM(a,b);\n\t\t\tSystem.out.println(gcd+\" \"+lcm);\n\t\t}\n\t\tscan.close();\n\t}\n}",
"Main",
"private static int calcGCD(int a,int b)\n\t{\n\t\tif(b==0){\n\t\t\treturn a;\n\t\t}else{\n\t\t\treturn calcGCD(b,a%b);\n\t\t}\n\t}",
"calcGCD",
"{\n\t\tif(b==0){\n\t\t\treturn a;\n\t\t}else{\n\t\t\treturn calcGCD(b,a%b);\n\t\t}\n\t}",
"if(b==0){\n\t\t\treturn a;\n\t\t}else{\n\t\t\treturn calcGCD(b,a%b);\n\t\t}",
"b==0",
"b",
"0",
"{\n\t\t\treturn a;\n\t\t}",
"return a;",
"a",
"{\n\t\t\treturn calcGCD(b,a%b);\n\t\t}",
"return calcGCD(b,a%b);",
"calcGCD(b,a%b)",
"calcGCD",
"b",
"a%b",
"a",
"b",
"int a",
"a",
"int b",
"b",
"private static int calcLCM(int a,int b)\n\t{\n\t\tint gcd=calcGCD(a,b);\n\t\tif(a%gcd==0){\n\t\t\treturn (a/gcd)*b;\n\t\t}else{\n\t\t\treturn (b/gcd)*a;\n\t\t}\n\t}",
"calcLCM",
"{\n\t\tint gcd=calcGCD(a,b);\n\t\tif(a%gcd==0){\n\t\t\treturn (a/gcd)*b;\n\t\t}else{\n\t\t\treturn (b/gcd)*a;\n\t\t}\n\t}",
"int gcd=calcGCD(a,b);",
"gcd",
"calcGCD(a,b)",
"calcGCD",
"a",
"b",
"if(a%gcd==0){\n\t\t\treturn (a/gcd)*b;\n\t\t}else{\n\t\t\treturn (b/gcd)*a;\n\t\t}",
"a%gcd==0",
"a%gcd",
"a",
"gcd",
"0",
"{\n\t\t\treturn (a/gcd)*b;\n\t\t}",
"return (a/gcd)*b;",
"(a/gcd)*b",
"(a/gcd)",
"a",
"gcd",
"b",
"{\n\t\t\treturn (b/gcd)*a;\n\t\t}",
"return (b/gcd)*a;",
"(b/gcd)*a",
"(b/gcd)",
"b",
"gcd",
"a",
"int a",
"a",
"int b",
"b",
"public static void main(String[] args)\n\t{\n\t\tint a,b;\n\t\tint gcd,lcm;\n\t\tScanner scan=new Scanner(System.in);\n\t\twhile(scan.hasNext()){\n\t\t\ta=scan.nextInt();\n\t\t\tb=scan.nextInt();\n\t\t\tgcd=calcGCD(Math.max(a,b),Math.min(a,b));\n\t\t\tlcm=calcLCM(a,b);\n\t\t\tSystem.out.println(gcd+\" \"+lcm);\n\t\t}\n\t\tscan.close();\n\t}",
"main",
"{\n\t\tint a,b;\n\t\tint gcd,lcm;\n\t\tScanner scan=new Scanner(System.in);\n\t\twhile(scan.hasNext()){\n\t\t\ta=scan.nextInt();\n\t\t\tb=scan.nextInt();\n\t\t\tgcd=calcGCD(Math.max(a,b),Math.min(a,b));\n\t\t\tlcm=calcLCM(a,b);\n\t\t\tSystem.out.println(gcd+\" \"+lcm);\n\t\t}\n\t\tscan.close();\n\t}",
"int a",
"a",
"b;",
"b",
"int gcd",
"gcd",
"lcm;",
"lcm",
"Scanner scan=new Scanner(System.in);",
"scan",
"new Scanner(System.in)",
"while(scan.hasNext()){\n\t\t\ta=scan.nextInt();\n\t\t\tb=scan.nextInt();\n\t\t\tgcd=calcGCD(Math.max(a,b),Math.min(a,b));\n\t\t\tlcm=calcLCM(a,b);\n\t\t\tSystem.out.println(gcd+\" \"+lcm);\n\t\t}",
"scan.hasNext()",
"scan.hasNext",
"scan",
"{\n\t\t\ta=scan.nextInt();\n\t\t\tb=scan.nextInt();\n\t\t\tgcd=calcGCD(Math.max(a,b),Math.min(a,b));\n\t\t\tlcm=calcLCM(a,b);\n\t\t\tSystem.out.println(gcd+\" \"+lcm);\n\t\t}",
"a=scan.nextInt()",
"a",
"scan.nextInt()",
"scan.nextInt",
"scan",
"b=scan.nextInt()",
"b",
"scan.nextInt()",
"scan.nextInt",
"scan",
"gcd=calcGCD(Math.max(a,b),Math.min(a,b))",
"gcd",
"calcGCD(Math.max(a,b),Math.min(a,b))",
"calcGCD",
"Math.max(a,b)",
"Math.max",
"Math",
"a",
"b",
"Math.min(a,b)",
"Math.min",
"Math",
"a",
"b",
"lcm=calcLCM(a,b)",
"lcm",
"calcLCM(a,b)",
"calcLCM",
"a",
"b",
"System.out.println(gcd+\" \"+lcm)",
"System.out.println",
"System.out",
"System",
"System.out",
"gcd+\" \"+lcm",
"gcd+\" \"+lcm",
"gcd",
"\" \"",
"lcm",
"scan.close()",
"scan.close",
"scan",
"String[] args",
"args",
"public class Main\n{\n\tprivate static int calcGCD(int a,int b)\n\t{\n\t\tif(b==0){\n\t\t\treturn a;\n\t\t}else{\n\t\t\treturn calcGCD(b,a%b);\n\t\t}\n\t}\n\tprivate static int calcLCM(int a,int b)\n\t{\n\t\tint gcd=calcGCD(a,b);\n\t\tif(a%gcd==0){\n\t\t\treturn (a/gcd)*b;\n\t\t}else{\n\t\t\treturn (b/gcd)*a;\n\t\t}\n\t}\n\t\n\tpublic static void main(String[] args)\n\t{\n\t\tint a,b;\n\t\tint gcd,lcm;\n\t\tScanner scan=new Scanner(System.in);\n\t\twhile(scan.hasNext()){\n\t\t\ta=scan.nextInt();\n\t\t\tb=scan.nextInt();\n\t\t\tgcd=calcGCD(Math.max(a,b),Math.min(a,b));\n\t\t\tlcm=calcLCM(a,b);\n\t\t\tSystem.out.println(gcd+\" \"+lcm);\n\t\t}\n\t\tscan.close();\n\t}\n}",
"public class Main\n{\n\tprivate static int calcGCD(int a,int b)\n\t{\n\t\tif(b==0){\n\t\t\treturn a;\n\t\t}else{\n\t\t\treturn calcGCD(b,a%b);\n\t\t}\n\t}\n\tprivate static int calcLCM(int a,int b)\n\t{\n\t\tint gcd=calcGCD(a,b);\n\t\tif(a%gcd==0){\n\t\t\treturn (a/gcd)*b;\n\t\t}else{\n\t\t\treturn (b/gcd)*a;\n\t\t}\n\t}\n\t\n\tpublic static void main(String[] args)\n\t{\n\t\tint a,b;\n\t\tint gcd,lcm;\n\t\tScanner scan=new Scanner(System.in);\n\t\twhile(scan.hasNext()){\n\t\t\ta=scan.nextInt();\n\t\t\tb=scan.nextInt();\n\t\t\tgcd=calcGCD(Math.max(a,b),Math.min(a,b));\n\t\t\tlcm=calcLCM(a,b);\n\t\t\tSystem.out.println(gcd+\" \"+lcm);\n\t\t}\n\t\tscan.close();\n\t}\n}",
"Main"
] | import java.util.Scanner;
public class Main
{
private static int calcGCD(int a,int b)
{
if(b==0){
return a;
}else{
return calcGCD(b,a%b);
}
}
private static int calcLCM(int a,int b)
{
int gcd=calcGCD(a,b);
if(a%gcd==0){
return (a/gcd)*b;
}else{
return (b/gcd)*a;
}
}
public static void main(String[] args)
{
int a,b;
int gcd,lcm;
Scanner scan=new Scanner(System.in);
while(scan.hasNext()){
a=scan.nextInt();
b=scan.nextInt();
gcd=calcGCD(Math.max(a,b),Math.min(a,b));
lcm=calcLCM(a,b);
System.out.println(gcd+" "+lcm);
}
scan.close();
}
} |
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
42,
4,
18,
13,
30,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
41,
13,
14,
2,
13,
13,
30,
4,
18,
18,
13,
13,
2,
2,
17,
17,
13,
9,
14,
2,
13,
13,
30,
0,
13,
13,
0,
13,
13,
0,
13,
13,
41,
13,
17,
41,
13,
13,
41,
13,
13,
41,
13,
13,
41,
13,
42,
17,
30,
0,
13,
2,
13,
13,
14,
2,
13,
17,
30,
0,
13,
13,
0,
13,
13,
30,
0,
13,
13,
0,
13,
2,
2,
13,
13,
13,
3,
4,
18,
18,
13,
13,
2,
2,
13,
17,
13,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
117,
5
],
[
117,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
13,
14
],
[
14,
15
],
[
12,
16
],
[
16,
17
],
[
17,
18
],
[
17,
19
],
[
19,
20
],
[
20,
21
],
[
16,
22
],
[
22,
23
],
[
22,
24
],
[
24,
25
],
[
25,
26
],
[
16,
27
],
[
27,
28
],
[
16,
29
],
[
29,
30
],
[
30,
31
],
[
30,
32
],
[
29,
33
],
[
33,
34
],
[
34,
35
],
[
35,
36
],
[
36,
37
],
[
36,
38
],
[
34,
39
],
[
40,
40
],
[
40,
41
],
[
40,
42
],
[
40,
43
],
[
33,
44
],
[
16,
45
],
[
45,
46
],
[
46,
47
],
[
46,
48
],
[
45,
49
],
[
49,
50
],
[
50,
51
],
[
50,
52
],
[
49,
53
],
[
53,
54
],
[
53,
55
],
[
49,
56
],
[
56,
57
],
[
56,
58
],
[
16,
59
],
[
59,
60
],
[
59,
61
],
[
16,
62
],
[
62,
63
],
[
62,
64
],
[
16,
65
],
[
65,
66
],
[
65,
67
],
[
16,
68
],
[
68,
69
],
[
68,
70
],
[
16,
71
],
[
71,
72
],
[
16,
73
],
[
73,
74
],
[
73,
75
],
[
75,
76
],
[
76,
77
],
[
76,
78
],
[
78,
79
],
[
78,
80
],
[
75,
81
],
[
81,
82
],
[
82,
83
],
[
82,
84
],
[
81,
85
],
[
85,
86
],
[
86,
87
],
[
86,
88
],
[
85,
89
],
[
89,
90
],
[
89,
91
],
[
81,
92
],
[
92,
93
],
[
93,
94
],
[
93,
95
],
[
92,
96
],
[
96,
97
],
[
96,
98
],
[
98,
99
],
[
99,
100
],
[
99,
101
],
[
98,
102
],
[
92,
103
],
[
16,
104
],
[
104,
105
],
[
105,
106
],
[
106,
107
],
[
106,
108
],
[
104,
109
],
[
110,
110
],
[
110,
111
],
[
110,
112
],
[
110,
113
],
[
6,
114
],
[
114,
115
],
[
0,
116
],
[
116,
117
],
[
116,
118
]
] | [
"\nimport java.util.*;\n\npublic class Main {\n public static void main(String[] args){\n Scanner sc = new Scanner(System.in);\n while(sc.hasNext()){\n long a=sc.nextLong();\n long b=sc.nextLong();\n long temp;\n if(a==b){\n System.out.println(1+\" \"+a);\n continue;\n }\n \n if(a<b){\n temp=a;\n a=b;\n b=temp; //a>bにしちゃったの\n }\n \n //a = b*p + r\n //b = r*p' + r'\n long GCD=1; //最大公約数\n long LCM=a; //最小公倍数\n long c=a,d=b;\n long r;\n while(true){\n r = c%d;\n if(r!=0){\n c = d;\n d = r;\n }else{\n GCD=d;\n LCM=a*b/GCD;\n /*\n a=p*GCD\n b=q*GCD pとqは互いに素\n このとき\n LCM=p*q*GCD\n =p*q*GCD*GCD/GCD\n =(p*GCD)*(q*GCD)/GCD\n =a*b/GCD\n よって\n LCM=a*b/GCD \n */\n \n break;\n }\n }\n System.out.println(GCD+\" \"+LCM);\n \n \n }\n }\n}",
"import java.util.*;",
"util.*",
"java",
"public class Main {\n public static void main(String[] args){\n Scanner sc = new Scanner(System.in);\n while(sc.hasNext()){\n long a=sc.nextLong();\n long b=sc.nextLong();\n long temp;\n if(a==b){\n System.out.println(1+\" \"+a);\n continue;\n }\n \n if(a<b){\n temp=a;\n a=b;\n b=temp; //a>bにしちゃったの\n }\n \n //a = b*p + r\n //b = r*p' + r'\n long GCD=1; //最大公約数\n long LCM=a; //最小公倍数\n long c=a,d=b;\n long r;\n while(true){\n r = c%d;\n if(r!=0){\n c = d;\n d = r;\n }else{\n GCD=d;\n LCM=a*b/GCD;\n /*\n a=p*GCD\n b=q*GCD pとqは互いに素\n このとき\n LCM=p*q*GCD\n =p*q*GCD*GCD/GCD\n =(p*GCD)*(q*GCD)/GCD\n =a*b/GCD\n よって\n LCM=a*b/GCD \n */\n \n break;\n }\n }\n System.out.println(GCD+\" \"+LCM);\n \n \n }\n }\n}",
"Main",
"public static void main(String[] args){\n Scanner sc = new Scanner(System.in);\n while(sc.hasNext()){\n long a=sc.nextLong();\n long b=sc.nextLong();\n long temp;\n if(a==b){\n System.out.println(1+\" \"+a);\n continue;\n }\n \n if(a<b){\n temp=a;\n a=b;\n b=temp; //a>bにしちゃったの\n }\n \n //a = b*p + r\n //b = r*p' + r'\n long GCD=1; //最大公約数\n long LCM=a; //最小公倍数\n long c=a,d=b;\n long r;\n while(true){\n r = c%d;\n if(r!=0){\n c = d;\n d = r;\n }else{\n GCD=d;\n LCM=a*b/GCD;\n /*\n a=p*GCD\n b=q*GCD pとqは互いに素\n このとき\n LCM=p*q*GCD\n =p*q*GCD*GCD/GCD\n =(p*GCD)*(q*GCD)/GCD\n =a*b/GCD\n よって\n LCM=a*b/GCD \n */\n \n break;\n }\n }\n System.out.println(GCD+\" \"+LCM);\n \n \n }\n }",
"main",
"{\n Scanner sc = new Scanner(System.in);\n while(sc.hasNext()){\n long a=sc.nextLong();\n long b=sc.nextLong();\n long temp;\n if(a==b){\n System.out.println(1+\" \"+a);\n continue;\n }\n \n if(a<b){\n temp=a;\n a=b;\n b=temp; //a>bにしちゃったの\n }\n \n //a = b*p + r\n //b = r*p' + r'\n long GCD=1; //最大公約数\n long LCM=a; //最小公倍数\n long c=a,d=b;\n long r;\n while(true){\n r = c%d;\n if(r!=0){\n c = d;\n d = r;\n }else{\n GCD=d;\n LCM=a*b/GCD;\n /*\n a=p*GCD\n b=q*GCD pとqは互いに素\n このとき\n LCM=p*q*GCD\n =p*q*GCD*GCD/GCD\n =(p*GCD)*(q*GCD)/GCD\n =a*b/GCD\n よって\n LCM=a*b/GCD \n */\n \n break;\n }\n }\n System.out.println(GCD+\" \"+LCM);\n \n \n }\n }",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"while(sc.hasNext()){\n long a=sc.nextLong();\n long b=sc.nextLong();\n long temp;\n if(a==b){\n System.out.println(1+\" \"+a);\n continue;\n }\n \n if(a<b){\n temp=a;\n a=b;\n b=temp; //a>bにしちゃったの\n }\n \n //a = b*p + r\n //b = r*p' + r'\n long GCD=1; //最大公約数\n long LCM=a; //最小公倍数\n long c=a,d=b;\n long r;\n while(true){\n r = c%d;\n if(r!=0){\n c = d;\n d = r;\n }else{\n GCD=d;\n LCM=a*b/GCD;\n /*\n a=p*GCD\n b=q*GCD pとqは互いに素\n このとき\n LCM=p*q*GCD\n =p*q*GCD*GCD/GCD\n =(p*GCD)*(q*GCD)/GCD\n =a*b/GCD\n よって\n LCM=a*b/GCD \n */\n \n break;\n }\n }\n System.out.println(GCD+\" \"+LCM);\n \n \n }",
"sc.hasNext()",
"sc.hasNext",
"sc",
"{\n long a=sc.nextLong();\n long b=sc.nextLong();\n long temp;\n if(a==b){\n System.out.println(1+\" \"+a);\n continue;\n }\n \n if(a<b){\n temp=a;\n a=b;\n b=temp; //a>bにしちゃったの\n }\n \n //a = b*p + r\n //b = r*p' + r'\n long GCD=1; //最大公約数\n long LCM=a; //最小公倍数\n long c=a,d=b;\n long r;\n while(true){\n r = c%d;\n if(r!=0){\n c = d;\n d = r;\n }else{\n GCD=d;\n LCM=a*b/GCD;\n /*\n a=p*GCD\n b=q*GCD pとqは互いに素\n このとき\n LCM=p*q*GCD\n =p*q*GCD*GCD/GCD\n =(p*GCD)*(q*GCD)/GCD\n =a*b/GCD\n よって\n LCM=a*b/GCD \n */\n \n break;\n }\n }\n System.out.println(GCD+\" \"+LCM);\n \n \n }",
"long a=sc.nextLong();",
"a",
"sc.nextLong()",
"sc.nextLong",
"sc",
"long b=sc.nextLong();",
"b",
"sc.nextLong()",
"sc.nextLong",
"sc",
"long temp;",
"temp",
"if(a==b){\n System.out.println(1+\" \"+a);\n continue;\n }",
"a==b",
"a",
"b",
"{\n System.out.println(1+\" \"+a);\n continue;\n }",
"System.out.println(1+\" \"+a)",
"System.out.println",
"System.out",
"System",
"System.out",
"1+\" \"+a",
"1+\" \"+a",
"1",
"\" \"",
"a",
"continue;",
"if(a<b){\n temp=a;\n a=b;\n b=temp; //a>bにしちゃったの\n }",
"a<b",
"a",
"b",
"{\n temp=a;\n a=b;\n b=temp; //a>bにしちゃったの\n }",
"temp=a",
"temp",
"a",
"a=b",
"a",
"b",
"b=temp",
"b",
"temp",
"long GCD=1;",
"GCD",
"1",
"long LCM=a;",
"LCM",
"a",
"long c=a",
"c",
"a",
"d=b;",
"d",
"b",
"long r;",
"r",
"while(true){\n r = c%d;\n if(r!=0){\n c = d;\n d = r;\n }else{\n GCD=d;\n LCM=a*b/GCD;\n /*\n a=p*GCD\n b=q*GCD pとqは互いに素\n このとき\n LCM=p*q*GCD\n =p*q*GCD*GCD/GCD\n =(p*GCD)*(q*GCD)/GCD\n =a*b/GCD\n よって\n LCM=a*b/GCD \n */\n \n break;\n }\n }",
"true",
"{\n r = c%d;\n if(r!=0){\n c = d;\n d = r;\n }else{\n GCD=d;\n LCM=a*b/GCD;\n /*\n a=p*GCD\n b=q*GCD pとqは互いに素\n このとき\n LCM=p*q*GCD\n =p*q*GCD*GCD/GCD\n =(p*GCD)*(q*GCD)/GCD\n =a*b/GCD\n よって\n LCM=a*b/GCD \n */\n \n break;\n }\n }",
"r = c%d",
"r",
"c%d",
"c",
"d",
"if(r!=0){\n c = d;\n d = r;\n }else{\n GCD=d;\n LCM=a*b/GCD;\n /*\n a=p*GCD\n b=q*GCD pとqは互いに素\n このとき\n LCM=p*q*GCD\n =p*q*GCD*GCD/GCD\n =(p*GCD)*(q*GCD)/GCD\n =a*b/GCD\n よって\n LCM=a*b/GCD \n */\n \n break;\n }",
"r!=0",
"r",
"0",
"{\n c = d;\n d = r;\n }",
"c = d",
"c",
"d",
"d = r",
"d",
"r",
"{\n GCD=d;\n LCM=a*b/GCD;\n /*\n a=p*GCD\n b=q*GCD pとqは互いに素\n このとき\n LCM=p*q*GCD\n =p*q*GCD*GCD/GCD\n =(p*GCD)*(q*GCD)/GCD\n =a*b/GCD\n よって\n LCM=a*b/GCD \n */\n \n break;\n }",
"GCD=d",
"GCD",
"d",
"LCM=a*b/GCD",
"LCM",
"a*b/GCD",
"a*b",
"a",
"b",
"GCD",
"break;",
"System.out.println(GCD+\" \"+LCM)",
"System.out.println",
"System.out",
"System",
"System.out",
"GCD+\" \"+LCM",
"GCD+\" \"+LCM",
"GCD",
"\" \"",
"LCM",
"String[] args",
"args",
"public class Main {\n public static void main(String[] args){\n Scanner sc = new Scanner(System.in);\n while(sc.hasNext()){\n long a=sc.nextLong();\n long b=sc.nextLong();\n long temp;\n if(a==b){\n System.out.println(1+\" \"+a);\n continue;\n }\n \n if(a<b){\n temp=a;\n a=b;\n b=temp; //a>bにしちゃったの\n }\n \n //a = b*p + r\n //b = r*p' + r'\n long GCD=1; //最大公約数\n long LCM=a; //最小公倍数\n long c=a,d=b;\n long r;\n while(true){\n r = c%d;\n if(r!=0){\n c = d;\n d = r;\n }else{\n GCD=d;\n LCM=a*b/GCD;\n /*\n a=p*GCD\n b=q*GCD pとqは互いに素\n このとき\n LCM=p*q*GCD\n =p*q*GCD*GCD/GCD\n =(p*GCD)*(q*GCD)/GCD\n =a*b/GCD\n よって\n LCM=a*b/GCD \n */\n \n break;\n }\n }\n System.out.println(GCD+\" \"+LCM);\n \n \n }\n }\n}",
"public class Main {\n public static void main(String[] args){\n Scanner sc = new Scanner(System.in);\n while(sc.hasNext()){\n long a=sc.nextLong();\n long b=sc.nextLong();\n long temp;\n if(a==b){\n System.out.println(1+\" \"+a);\n continue;\n }\n \n if(a<b){\n temp=a;\n a=b;\n b=temp; //a>bにしちゃったの\n }\n \n //a = b*p + r\n //b = r*p' + r'\n long GCD=1; //最大公約数\n long LCM=a; //最小公倍数\n long c=a,d=b;\n long r;\n while(true){\n r = c%d;\n if(r!=0){\n c = d;\n d = r;\n }else{\n GCD=d;\n LCM=a*b/GCD;\n /*\n a=p*GCD\n b=q*GCD pとqは互いに素\n このとき\n LCM=p*q*GCD\n =p*q*GCD*GCD/GCD\n =(p*GCD)*(q*GCD)/GCD\n =a*b/GCD\n よって\n LCM=a*b/GCD \n */\n \n break;\n }\n }\n System.out.println(GCD+\" \"+LCM);\n \n \n }\n }\n}",
"Main"
] |
import java.util.*;
public class Main {
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
while(sc.hasNext()){
long a=sc.nextLong();
long b=sc.nextLong();
long temp;
if(a==b){
System.out.println(1+" "+a);
continue;
}
if(a<b){
temp=a;
a=b;
b=temp; //a>bにしちゃったの
}
//a = b*p + r
//b = r*p' + r'
long GCD=1; //最大公約数
long LCM=a; //最小公倍数
long c=a,d=b;
long r;
while(true){
r = c%d;
if(r!=0){
c = d;
d = r;
}else{
GCD=d;
LCM=a*b/GCD;
/*
a=p*GCD
b=q*GCD pとqは互いに素
このとき
LCM=p*q*GCD
=p*q*GCD*GCD/GCD
=(p*GCD)*(q*GCD)/GCD
=a*b/GCD
よって
LCM=a*b/GCD
*/
break;
}
}
System.out.println(GCD+" "+LCM);
}
}
} |
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
14,
2,
17,
13,
29,
13,
29,
4,
13,
13,
2,
13,
13,
23,
13,
23,
13,
12,
13,
30,
29,
2,
2,
13,
4,
13,
13,
13,
13,
23,
13,
23,
13,
12,
13,
30,
41,
13,
20,
42,
4,
18,
13,
30,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
4,
18,
18,
13,
13,
2,
2,
4,
13,
13,
13,
17,
4,
13,
13,
13,
4,
18,
18,
13,
13,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
87,
5
],
[
87,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
10,
11
],
[
10,
12
],
[
9,
13
],
[
13,
14
],
[
8,
15
],
[
15,
16
],
[
16,
17
],
[
16,
18
],
[
16,
19
],
[
19,
20
],
[
19,
21
],
[
6,
22
],
[
22,
23
],
[
6,
24
],
[
24,
25
],
[
87,
26
],
[
26,
27
],
[
26,
28
],
[
28,
29
],
[
29,
30
],
[
30,
31
],
[
31,
32
],
[
31,
33
],
[
33,
34
],
[
33,
35
],
[
33,
36
],
[
30,
37
],
[
26,
38
],
[
38,
39
],
[
26,
40
],
[
40,
41
],
[
87,
42
],
[
42,
43
],
[
42,
44
],
[
44,
45
],
[
45,
46
],
[
45,
47
],
[
44,
48
],
[
48,
49
],
[
49,
50
],
[
50,
51
],
[
48,
52
],
[
52,
53
],
[
53,
54
],
[
53,
55
],
[
55,
56
],
[
56,
57
],
[
52,
58
],
[
58,
59
],
[
58,
60
],
[
60,
61
],
[
61,
62
],
[
52,
63
],
[
63,
64
],
[
64,
65
],
[
65,
66
],
[
65,
67
],
[
63,
68
],
[
69,
69
],
[
69,
70
],
[
70,
71
],
[
70,
72
],
[
70,
73
],
[
69,
74
],
[
69,
75
],
[
75,
76
],
[
75,
77
],
[
75,
78
],
[
52,
79
],
[
79,
80
],
[
80,
81
],
[
81,
82
],
[
81,
83
],
[
42,
84
],
[
84,
85
],
[
0,
86
],
[
86,
87
],
[
86,
88
]
] | [
"import java.util.*;\n\npublic class Main\n{\n private static int gcd(int x, int y)\n {\n if (0 == y)\n return x;\n return gcd(y, x % y);\n }\n\n private static int lcm(int x, int y)\n {\n return x / gcd(x, y) * y;\n }\n\n public static void main(String[] main)\n {\n Scanner in = new Scanner(System.in);\n\n while (in.hasNext())\n {\n int x = in.nextInt();\n int y = in.nextInt();\n\n System.out.print(gcd(x, y) + \" \" + lcm(x, y));\n System.out.println();\n }\n }\n}",
"import java.util.*;",
"util.*",
"java",
"public class Main\n{\n private static int gcd(int x, int y)\n {\n if (0 == y)\n return x;\n return gcd(y, x % y);\n }\n\n private static int lcm(int x, int y)\n {\n return x / gcd(x, y) * y;\n }\n\n public static void main(String[] main)\n {\n Scanner in = new Scanner(System.in);\n\n while (in.hasNext())\n {\n int x = in.nextInt();\n int y = in.nextInt();\n\n System.out.print(gcd(x, y) + \" \" + lcm(x, y));\n System.out.println();\n }\n }\n}",
"Main",
"private static int gcd(int x, int y)\n {\n if (0 == y)\n return x;\n return gcd(y, x % y);\n }",
"gcd",
"{\n if (0 == y)\n return x;\n return gcd(y, x % y);\n }",
"if (0 == y)\n return x;",
"0 == y",
"0",
"y",
"return x;",
"x",
"return gcd(y, x % y);",
"gcd(y, x % y)",
"gcd",
"y",
"x % y",
"x",
"y",
"int x",
"x",
"int y",
"y",
"private static int lcm(int x, int y)\n {\n return x / gcd(x, y) * y;\n }",
"lcm",
"{\n return x / gcd(x, y) * y;\n }",
"return x / gcd(x, y) * y;",
"x / gcd(x, y) * y",
"x / gcd(x, y)",
"x",
"gcd(x, y)",
"gcd",
"x",
"y",
"y",
"int x",
"x",
"int y",
"y",
"public static void main(String[] main)\n {\n Scanner in = new Scanner(System.in);\n\n while (in.hasNext())\n {\n int x = in.nextInt();\n int y = in.nextInt();\n\n System.out.print(gcd(x, y) + \" \" + lcm(x, y));\n System.out.println();\n }\n }",
"main",
"{\n Scanner in = new Scanner(System.in);\n\n while (in.hasNext())\n {\n int x = in.nextInt();\n int y = in.nextInt();\n\n System.out.print(gcd(x, y) + \" \" + lcm(x, y));\n System.out.println();\n }\n }",
"Scanner in = new Scanner(System.in);",
"in",
"new Scanner(System.in)",
"while (in.hasNext())\n {\n int x = in.nextInt();\n int y = in.nextInt();\n\n System.out.print(gcd(x, y) + \" \" + lcm(x, y));\n System.out.println();\n }",
"in.hasNext()",
"in.hasNext",
"in",
"{\n int x = in.nextInt();\n int y = in.nextInt();\n\n System.out.print(gcd(x, y) + \" \" + lcm(x, y));\n System.out.println();\n }",
"int x = in.nextInt();",
"x",
"in.nextInt()",
"in.nextInt",
"in",
"int y = in.nextInt();",
"y",
"in.nextInt()",
"in.nextInt",
"in",
"System.out.print(gcd(x, y) + \" \" + lcm(x, y))",
"System.out.print",
"System.out",
"System",
"System.out",
"gcd(x, y) + \" \" + lcm(x, y)",
"gcd(x, y) + \" \" + lcm(x, y)",
"gcd(x, y)",
"gcd",
"x",
"y",
"\" \"",
"lcm(x, y)",
"lcm",
"x",
"y",
"System.out.println()",
"System.out.println",
"System.out",
"System",
"System.out",
"String[] main",
"main",
"public class Main\n{\n private static int gcd(int x, int y)\n {\n if (0 == y)\n return x;\n return gcd(y, x % y);\n }\n\n private static int lcm(int x, int y)\n {\n return x / gcd(x, y) * y;\n }\n\n public static void main(String[] main)\n {\n Scanner in = new Scanner(System.in);\n\n while (in.hasNext())\n {\n int x = in.nextInt();\n int y = in.nextInt();\n\n System.out.print(gcd(x, y) + \" \" + lcm(x, y));\n System.out.println();\n }\n }\n}",
"public class Main\n{\n private static int gcd(int x, int y)\n {\n if (0 == y)\n return x;\n return gcd(y, x % y);\n }\n\n private static int lcm(int x, int y)\n {\n return x / gcd(x, y) * y;\n }\n\n public static void main(String[] main)\n {\n Scanner in = new Scanner(System.in);\n\n while (in.hasNext())\n {\n int x = in.nextInt();\n int y = in.nextInt();\n\n System.out.print(gcd(x, y) + \" \" + lcm(x, y));\n System.out.println();\n }\n }\n}",
"Main"
] | import java.util.*;
public class Main
{
private static int gcd(int x, int y)
{
if (0 == y)
return x;
return gcd(y, x % y);
}
private static int lcm(int x, int y)
{
return x / gcd(x, y) * y;
}
public static void main(String[] main)
{
Scanner in = new Scanner(System.in);
while (in.hasNext())
{
int x = in.nextInt();
int y = in.nextInt();
System.out.print(gcd(x, y) + " " + lcm(x, y));
System.out.println();
}
}
} |
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
42,
4,
18,
13,
30,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
14,
2,
13,
13,
30,
4,
18,
18,
13,
13,
2,
2,
13,
17,
17,
30,
41,
13,
4,
13,
13,
13,
41,
13,
4,
13,
13,
13,
41,
13,
17,
41,
13,
17,
41,
13,
2,
13,
13,
0,
13,
4,
13,
13,
13,
0,
13,
4,
13,
13,
13,
41,
13,
2,
13,
13,
42,
2,
13,
17,
30,
0,
13,
13,
0,
13,
4,
13,
13,
13,
0,
13,
4,
13,
13,
13,
0,
13,
2,
13,
13,
0,
13,
13,
0,
13,
2,
2,
13,
13,
13,
4,
18,
18,
13,
13,
2,
2,
13,
17,
13,
4,
18,
13,
23,
13,
12,
13,
30,
29,
8,
2,
13,
13,
13,
13,
23,
13,
23,
13,
12,
13,
30,
29,
8,
2,
13,
13,
13,
13,
23,
13,
23,
13,
12,
13,
30,
29,
8,
2,
13,
17,
40,
13,
13,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
175,
5
],
[
175,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
13,
14
],
[
14,
15
],
[
12,
16
],
[
16,
17
],
[
17,
18
],
[
17,
19
],
[
19,
20
],
[
20,
21
],
[
16,
22
],
[
22,
23
],
[
22,
24
],
[
24,
25
],
[
25,
26
],
[
16,
27
],
[
27,
28
],
[
28,
29
],
[
28,
30
],
[
27,
31
],
[
31,
32
],
[
32,
33
],
[
33,
34
],
[
34,
35
],
[
34,
36
],
[
32,
37
],
[
38,
38
],
[
38,
39
],
[
38,
40
],
[
38,
41
],
[
27,
42
],
[
42,
43
],
[
43,
44
],
[
43,
45
],
[
45,
46
],
[
45,
47
],
[
45,
48
],
[
42,
49
],
[
49,
50
],
[
49,
51
],
[
51,
52
],
[
51,
53
],
[
51,
54
],
[
42,
55
],
[
55,
56
],
[
55,
57
],
[
42,
58
],
[
58,
59
],
[
58,
60
],
[
42,
61
],
[
61,
62
],
[
61,
63
],
[
63,
64
],
[
63,
65
],
[
42,
66
],
[
66,
67
],
[
66,
68
],
[
68,
69
],
[
68,
70
],
[
68,
71
],
[
42,
72
],
[
72,
73
],
[
72,
74
],
[
74,
75
],
[
74,
76
],
[
74,
77
],
[
42,
78
],
[
78,
79
],
[
78,
80
],
[
80,
81
],
[
80,
82
],
[
42,
83
],
[
83,
84
],
[
84,
85
],
[
84,
86
],
[
83,
87
],
[
87,
88
],
[
88,
89
],
[
88,
90
],
[
87,
91
],
[
91,
92
],
[
91,
93
],
[
93,
94
],
[
93,
95
],
[
93,
96
],
[
87,
97
],
[
97,
98
],
[
97,
99
],
[
99,
100
],
[
99,
101
],
[
99,
102
],
[
87,
103
],
[
103,
104
],
[
103,
105
],
[
105,
106
],
[
105,
107
],
[
42,
108
],
[
108,
109
],
[
108,
110
],
[
42,
111
],
[
111,
112
],
[
111,
113
],
[
113,
114
],
[
114,
115
],
[
114,
116
],
[
113,
117
],
[
42,
118
],
[
118,
119
],
[
119,
120
],
[
120,
121
],
[
120,
122
],
[
118,
123
],
[
124,
124
],
[
124,
125
],
[
124,
126
],
[
124,
127
],
[
8,
128
],
[
128,
129
],
[
129,
130
],
[
6,
131
],
[
131,
132
],
[
175,
133
],
[
133,
134
],
[
133,
135
],
[
135,
136
],
[
136,
137
],
[
137,
138
],
[
138,
139
],
[
138,
140
],
[
137,
141
],
[
137,
142
],
[
133,
143
],
[
143,
144
],
[
133,
145
],
[
145,
146
],
[
175,
147
],
[
147,
148
],
[
147,
149
],
[
149,
150
],
[
150,
151
],
[
151,
152
],
[
152,
153
],
[
152,
154
],
[
151,
155
],
[
151,
156
],
[
147,
157
],
[
157,
158
],
[
147,
159
],
[
159,
160
],
[
175,
161
],
[
161,
162
],
[
161,
163
],
[
163,
164
],
[
164,
165
],
[
165,
166
],
[
166,
167
],
[
166,
168
],
[
165,
169
],
[
169,
170
],
[
165,
171
],
[
161,
172
],
[
172,
173
],
[
0,
174
],
[
174,
175
],
[
174,
176
]
] | [
"import java.util.Scanner;\n\npublic class Main {\n\tpublic static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\twhile (sc.hasNext()) {\n\t\t\tlong a = sc.nextLong();\n\t\t\tlong b = sc.nextLong();\n\t\t\tif (a == b) {\n\t\t\t\tSystem.out.println(a + \" \" + 1);\n\t\t\t} else {\n\t\t\t\tlong A = max(a, b);\n\t\t\t\tlong B = min(a, b);\n\t\t\t\tlong ans1 = 1, ans2 = 1;\n\t\t\t\tlong rr = A - B;\n\t\t\t\tA = max(B, rr);\n\t\t\t\tB = min(B, rr);\n\t\t\t\tlong r = A - B;\n\t\t\t\twhile (r > 0) {\n\t\t\t\t\trr = r;\n\t\t\t\t\tA = max(B, rr);\n\t\t\t\t\tB = min(B, rr);\n\t\t\t\t\tr = A - B;\n\t\t\t\t}\n\t\t\t\tans1 = rr;\n\t\t\t\tans2 = (a * b) / ans1;\n\t\t\t\tSystem.out.println(ans1 + \" \" + ans2);\n\t\t\t}\n\t\t}\n\t\tsc.close();\n\t}\n\n\tstatic long max(long a, long b) {\n\t\treturn a < b ? b : a;\n\t}\n\n\tstatic long min(long a, long b) {\n\t\treturn a < b ? a : b;\n\t}\n\n\tstatic long abs(long a) {\n\t\treturn a < 0 ? -a : a;\n\t}\n\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n\tpublic static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\twhile (sc.hasNext()) {\n\t\t\tlong a = sc.nextLong();\n\t\t\tlong b = sc.nextLong();\n\t\t\tif (a == b) {\n\t\t\t\tSystem.out.println(a + \" \" + 1);\n\t\t\t} else {\n\t\t\t\tlong A = max(a, b);\n\t\t\t\tlong B = min(a, b);\n\t\t\t\tlong ans1 = 1, ans2 = 1;\n\t\t\t\tlong rr = A - B;\n\t\t\t\tA = max(B, rr);\n\t\t\t\tB = min(B, rr);\n\t\t\t\tlong r = A - B;\n\t\t\t\twhile (r > 0) {\n\t\t\t\t\trr = r;\n\t\t\t\t\tA = max(B, rr);\n\t\t\t\t\tB = min(B, rr);\n\t\t\t\t\tr = A - B;\n\t\t\t\t}\n\t\t\t\tans1 = rr;\n\t\t\t\tans2 = (a * b) / ans1;\n\t\t\t\tSystem.out.println(ans1 + \" \" + ans2);\n\t\t\t}\n\t\t}\n\t\tsc.close();\n\t}\n\n\tstatic long max(long a, long b) {\n\t\treturn a < b ? b : a;\n\t}\n\n\tstatic long min(long a, long b) {\n\t\treturn a < b ? a : b;\n\t}\n\n\tstatic long abs(long a) {\n\t\treturn a < 0 ? -a : a;\n\t}\n\n}",
"Main",
"public static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\twhile (sc.hasNext()) {\n\t\t\tlong a = sc.nextLong();\n\t\t\tlong b = sc.nextLong();\n\t\t\tif (a == b) {\n\t\t\t\tSystem.out.println(a + \" \" + 1);\n\t\t\t} else {\n\t\t\t\tlong A = max(a, b);\n\t\t\t\tlong B = min(a, b);\n\t\t\t\tlong ans1 = 1, ans2 = 1;\n\t\t\t\tlong rr = A - B;\n\t\t\t\tA = max(B, rr);\n\t\t\t\tB = min(B, rr);\n\t\t\t\tlong r = A - B;\n\t\t\t\twhile (r > 0) {\n\t\t\t\t\trr = r;\n\t\t\t\t\tA = max(B, rr);\n\t\t\t\t\tB = min(B, rr);\n\t\t\t\t\tr = A - B;\n\t\t\t\t}\n\t\t\t\tans1 = rr;\n\t\t\t\tans2 = (a * b) / ans1;\n\t\t\t\tSystem.out.println(ans1 + \" \" + ans2);\n\t\t\t}\n\t\t}\n\t\tsc.close();\n\t}",
"main",
"{\n\t\tScanner sc = new Scanner(System.in);\n\t\twhile (sc.hasNext()) {\n\t\t\tlong a = sc.nextLong();\n\t\t\tlong b = sc.nextLong();\n\t\t\tif (a == b) {\n\t\t\t\tSystem.out.println(a + \" \" + 1);\n\t\t\t} else {\n\t\t\t\tlong A = max(a, b);\n\t\t\t\tlong B = min(a, b);\n\t\t\t\tlong ans1 = 1, ans2 = 1;\n\t\t\t\tlong rr = A - B;\n\t\t\t\tA = max(B, rr);\n\t\t\t\tB = min(B, rr);\n\t\t\t\tlong r = A - B;\n\t\t\t\twhile (r > 0) {\n\t\t\t\t\trr = r;\n\t\t\t\t\tA = max(B, rr);\n\t\t\t\t\tB = min(B, rr);\n\t\t\t\t\tr = A - B;\n\t\t\t\t}\n\t\t\t\tans1 = rr;\n\t\t\t\tans2 = (a * b) / ans1;\n\t\t\t\tSystem.out.println(ans1 + \" \" + ans2);\n\t\t\t}\n\t\t}\n\t\tsc.close();\n\t}",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"while (sc.hasNext()) {\n\t\t\tlong a = sc.nextLong();\n\t\t\tlong b = sc.nextLong();\n\t\t\tif (a == b) {\n\t\t\t\tSystem.out.println(a + \" \" + 1);\n\t\t\t} else {\n\t\t\t\tlong A = max(a, b);\n\t\t\t\tlong B = min(a, b);\n\t\t\t\tlong ans1 = 1, ans2 = 1;\n\t\t\t\tlong rr = A - B;\n\t\t\t\tA = max(B, rr);\n\t\t\t\tB = min(B, rr);\n\t\t\t\tlong r = A - B;\n\t\t\t\twhile (r > 0) {\n\t\t\t\t\trr = r;\n\t\t\t\t\tA = max(B, rr);\n\t\t\t\t\tB = min(B, rr);\n\t\t\t\t\tr = A - B;\n\t\t\t\t}\n\t\t\t\tans1 = rr;\n\t\t\t\tans2 = (a * b) / ans1;\n\t\t\t\tSystem.out.println(ans1 + \" \" + ans2);\n\t\t\t}\n\t\t}",
"sc.hasNext()",
"sc.hasNext",
"sc",
"{\n\t\t\tlong a = sc.nextLong();\n\t\t\tlong b = sc.nextLong();\n\t\t\tif (a == b) {\n\t\t\t\tSystem.out.println(a + \" \" + 1);\n\t\t\t} else {\n\t\t\t\tlong A = max(a, b);\n\t\t\t\tlong B = min(a, b);\n\t\t\t\tlong ans1 = 1, ans2 = 1;\n\t\t\t\tlong rr = A - B;\n\t\t\t\tA = max(B, rr);\n\t\t\t\tB = min(B, rr);\n\t\t\t\tlong r = A - B;\n\t\t\t\twhile (r > 0) {\n\t\t\t\t\trr = r;\n\t\t\t\t\tA = max(B, rr);\n\t\t\t\t\tB = min(B, rr);\n\t\t\t\t\tr = A - B;\n\t\t\t\t}\n\t\t\t\tans1 = rr;\n\t\t\t\tans2 = (a * b) / ans1;\n\t\t\t\tSystem.out.println(ans1 + \" \" + ans2);\n\t\t\t}\n\t\t}",
"long a = sc.nextLong();",
"a",
"sc.nextLong()",
"sc.nextLong",
"sc",
"long b = sc.nextLong();",
"b",
"sc.nextLong()",
"sc.nextLong",
"sc",
"if (a == b) {\n\t\t\t\tSystem.out.println(a + \" \" + 1);\n\t\t\t} else {\n\t\t\t\tlong A = max(a, b);\n\t\t\t\tlong B = min(a, b);\n\t\t\t\tlong ans1 = 1, ans2 = 1;\n\t\t\t\tlong rr = A - B;\n\t\t\t\tA = max(B, rr);\n\t\t\t\tB = min(B, rr);\n\t\t\t\tlong r = A - B;\n\t\t\t\twhile (r > 0) {\n\t\t\t\t\trr = r;\n\t\t\t\t\tA = max(B, rr);\n\t\t\t\t\tB = min(B, rr);\n\t\t\t\t\tr = A - B;\n\t\t\t\t}\n\t\t\t\tans1 = rr;\n\t\t\t\tans2 = (a * b) / ans1;\n\t\t\t\tSystem.out.println(ans1 + \" \" + ans2);\n\t\t\t}",
"a == b",
"a",
"b",
"{\n\t\t\t\tSystem.out.println(a + \" \" + 1);\n\t\t\t}",
"System.out.println(a + \" \" + 1)",
"System.out.println",
"System.out",
"System",
"System.out",
"a + \" \" + 1",
"a + \" \" + 1",
"a",
"\" \"",
"1",
"{\n\t\t\t\tlong A = max(a, b);\n\t\t\t\tlong B = min(a, b);\n\t\t\t\tlong ans1 = 1, ans2 = 1;\n\t\t\t\tlong rr = A - B;\n\t\t\t\tA = max(B, rr);\n\t\t\t\tB = min(B, rr);\n\t\t\t\tlong r = A - B;\n\t\t\t\twhile (r > 0) {\n\t\t\t\t\trr = r;\n\t\t\t\t\tA = max(B, rr);\n\t\t\t\t\tB = min(B, rr);\n\t\t\t\t\tr = A - B;\n\t\t\t\t}\n\t\t\t\tans1 = rr;\n\t\t\t\tans2 = (a * b) / ans1;\n\t\t\t\tSystem.out.println(ans1 + \" \" + ans2);\n\t\t\t}",
"long A = max(a, b);",
"A",
"max(a, b)",
"max",
"a",
"b",
"long B = min(a, b);",
"B",
"min(a, b)",
"min",
"a",
"b",
"long ans1 = 1",
"ans1",
"1",
"ans2 = 1;",
"ans2",
"1",
"long rr = A - B;",
"rr",
"A - B",
"A",
"B",
"A = max(B, rr)",
"A",
"max(B, rr)",
"max",
"B",
"rr",
"B = min(B, rr)",
"B",
"min(B, rr)",
"min",
"B",
"rr",
"long r = A - B;",
"r",
"A - B",
"A",
"B",
"while (r > 0) {\n\t\t\t\t\trr = r;\n\t\t\t\t\tA = max(B, rr);\n\t\t\t\t\tB = min(B, rr);\n\t\t\t\t\tr = A - B;\n\t\t\t\t}",
"r > 0",
"r",
"0",
"{\n\t\t\t\t\trr = r;\n\t\t\t\t\tA = max(B, rr);\n\t\t\t\t\tB = min(B, rr);\n\t\t\t\t\tr = A - B;\n\t\t\t\t}",
"rr = r",
"rr",
"r",
"A = max(B, rr)",
"A",
"max(B, rr)",
"max",
"B",
"rr",
"B = min(B, rr)",
"B",
"min(B, rr)",
"min",
"B",
"rr",
"r = A - B",
"r",
"A - B",
"A",
"B",
"ans1 = rr",
"ans1",
"rr",
"ans2 = (a * b) / ans1",
"ans2",
"(a * b) / ans1",
"(a * b)",
"a",
"b",
"ans1",
"System.out.println(ans1 + \" \" + ans2)",
"System.out.println",
"System.out",
"System",
"System.out",
"ans1 + \" \" + ans2",
"ans1 + \" \" + ans2",
"ans1",
"\" \"",
"ans2",
"sc.close()",
"sc.close",
"sc",
"String[] args",
"args",
"static long max(long a, long b) {\n\t\treturn a < b ? b : a;\n\t}",
"max",
"{\n\t\treturn a < b ? b : a;\n\t}",
"return a < b ? b : a;",
"a < b ? b : a",
"a < b",
"a",
"b",
"b",
"a",
"long a",
"a",
"long b",
"b",
"static long min(long a, long b) {\n\t\treturn a < b ? a : b;\n\t}",
"min",
"{\n\t\treturn a < b ? a : b;\n\t}",
"return a < b ? a : b;",
"a < b ? a : b",
"a < b",
"a",
"b",
"a",
"b",
"long a",
"a",
"long b",
"b",
"static long abs(long a) {\n\t\treturn a < 0 ? -a : a;\n\t}",
"abs",
"{\n\t\treturn a < 0 ? -a : a;\n\t}",
"return a < 0 ? -a : a;",
"a < 0 ? -a : a",
"a < 0",
"a",
"0",
"-a",
"a",
"a",
"long a",
"a",
"public class Main {\n\tpublic static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\twhile (sc.hasNext()) {\n\t\t\tlong a = sc.nextLong();\n\t\t\tlong b = sc.nextLong();\n\t\t\tif (a == b) {\n\t\t\t\tSystem.out.println(a + \" \" + 1);\n\t\t\t} else {\n\t\t\t\tlong A = max(a, b);\n\t\t\t\tlong B = min(a, b);\n\t\t\t\tlong ans1 = 1, ans2 = 1;\n\t\t\t\tlong rr = A - B;\n\t\t\t\tA = max(B, rr);\n\t\t\t\tB = min(B, rr);\n\t\t\t\tlong r = A - B;\n\t\t\t\twhile (r > 0) {\n\t\t\t\t\trr = r;\n\t\t\t\t\tA = max(B, rr);\n\t\t\t\t\tB = min(B, rr);\n\t\t\t\t\tr = A - B;\n\t\t\t\t}\n\t\t\t\tans1 = rr;\n\t\t\t\tans2 = (a * b) / ans1;\n\t\t\t\tSystem.out.println(ans1 + \" \" + ans2);\n\t\t\t}\n\t\t}\n\t\tsc.close();\n\t}\n\n\tstatic long max(long a, long b) {\n\t\treturn a < b ? b : a;\n\t}\n\n\tstatic long min(long a, long b) {\n\t\treturn a < b ? a : b;\n\t}\n\n\tstatic long abs(long a) {\n\t\treturn a < 0 ? -a : a;\n\t}\n\n}",
"public class Main {\n\tpublic static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\twhile (sc.hasNext()) {\n\t\t\tlong a = sc.nextLong();\n\t\t\tlong b = sc.nextLong();\n\t\t\tif (a == b) {\n\t\t\t\tSystem.out.println(a + \" \" + 1);\n\t\t\t} else {\n\t\t\t\tlong A = max(a, b);\n\t\t\t\tlong B = min(a, b);\n\t\t\t\tlong ans1 = 1, ans2 = 1;\n\t\t\t\tlong rr = A - B;\n\t\t\t\tA = max(B, rr);\n\t\t\t\tB = min(B, rr);\n\t\t\t\tlong r = A - B;\n\t\t\t\twhile (r > 0) {\n\t\t\t\t\trr = r;\n\t\t\t\t\tA = max(B, rr);\n\t\t\t\t\tB = min(B, rr);\n\t\t\t\t\tr = A - B;\n\t\t\t\t}\n\t\t\t\tans1 = rr;\n\t\t\t\tans2 = (a * b) / ans1;\n\t\t\t\tSystem.out.println(ans1 + \" \" + ans2);\n\t\t\t}\n\t\t}\n\t\tsc.close();\n\t}\n\n\tstatic long max(long a, long b) {\n\t\treturn a < b ? b : a;\n\t}\n\n\tstatic long min(long a, long b) {\n\t\treturn a < b ? a : b;\n\t}\n\n\tstatic long abs(long a) {\n\t\treturn a < 0 ? -a : a;\n\t}\n\n}",
"Main"
] | import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
while (sc.hasNext()) {
long a = sc.nextLong();
long b = sc.nextLong();
if (a == b) {
System.out.println(a + " " + 1);
} else {
long A = max(a, b);
long B = min(a, b);
long ans1 = 1, ans2 = 1;
long rr = A - B;
A = max(B, rr);
B = min(B, rr);
long r = A - B;
while (r > 0) {
rr = r;
A = max(B, rr);
B = min(B, rr);
r = A - B;
}
ans1 = rr;
ans2 = (a * b) / ans1;
System.out.println(ans1 + " " + ans2);
}
}
sc.close();
}
static long max(long a, long b) {
return a < b ? b : a;
}
static long min(long a, long b) {
return a < b ? a : b;
}
static long abs(long a) {
return a < 0 ? -a : a;
}
} |
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
41,
13,
41,
13,
17,
41,
13,
17,
41,
13,
41,
13,
41,
13,
17,
41,
13,
17,
42,
4,
18,
13,
30,
0,
13,
4,
18,
13,
0,
13,
4,
18,
13,
0,
13,
13,
0,
13,
13,
42,
17,
30,
14,
2,
13,
13,
3,
14,
2,
13,
13,
30,
0,
13,
2,
13,
13,
40,
13,
14,
2,
13,
13,
30,
0,
13,
2,
13,
13,
40,
13,
0,
13,
13,
0,
13,
17,
0,
13,
17,
0,
13,
13,
0,
13,
13,
42,
17,
30,
14,
2,
13,
13,
3,
14,
2,
13,
13,
30,
40,
13,
14,
2,
2,
13,
13,
17,
30,
0,
13,
2,
13,
13,
14,
2,
13,
13,
30,
40,
13,
14,
2,
2,
13,
13,
17,
30,
0,
13,
2,
13,
13,
0,
13,
13,
4,
18,
18,
13,
13,
2,
2,
13,
17,
13,
0,
13,
17,
0,
13,
17,
0,
13,
17,
0,
13,
17,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
174,
5
],
[
174,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
8,
14
],
[
14,
15
],
[
8,
16
],
[
16,
17
],
[
16,
18
],
[
8,
19
],
[
19,
20
],
[
19,
21
],
[
8,
22
],
[
22,
23
],
[
8,
24
],
[
24,
25
],
[
8,
26
],
[
26,
27
],
[
26,
28
],
[
8,
29
],
[
29,
30
],
[
29,
31
],
[
8,
32
],
[
32,
33
],
[
33,
34
],
[
34,
35
],
[
32,
36
],
[
36,
37
],
[
37,
38
],
[
37,
39
],
[
39,
40
],
[
40,
41
],
[
36,
42
],
[
42,
43
],
[
42,
44
],
[
44,
45
],
[
45,
46
],
[
36,
47
],
[
47,
48
],
[
47,
49
],
[
36,
50
],
[
50,
51
],
[
50,
52
],
[
36,
53
],
[
53,
54
],
[
53,
55
],
[
55,
56
],
[
56,
57
],
[
57,
58
],
[
57,
59
],
[
56,
60
],
[
55,
61
],
[
61,
62
],
[
62,
63
],
[
62,
64
],
[
61,
65
],
[
65,
66
],
[
66,
67
],
[
66,
68
],
[
68,
69
],
[
68,
70
],
[
65,
71
],
[
71,
72
],
[
55,
73
],
[
73,
74
],
[
74,
75
],
[
74,
76
],
[
73,
77
],
[
77,
78
],
[
78,
79
],
[
78,
80
],
[
80,
81
],
[
80,
82
],
[
77,
83
],
[
83,
84
],
[
36,
85
],
[
85,
86
],
[
85,
87
],
[
36,
88
],
[
88,
89
],
[
88,
90
],
[
36,
91
],
[
91,
92
],
[
91,
93
],
[
36,
94
],
[
94,
95
],
[
94,
96
],
[
36,
97
],
[
97,
98
],
[
97,
99
],
[
36,
100
],
[
100,
101
],
[
100,
102
],
[
102,
103
],
[
103,
104
],
[
104,
105
],
[
104,
106
],
[
103,
107
],
[
102,
108
],
[
108,
109
],
[
109,
110
],
[
109,
111
],
[
108,
112
],
[
112,
113
],
[
113,
114
],
[
112,
115
],
[
115,
116
],
[
116,
117
],
[
117,
118
],
[
117,
119
],
[
116,
120
],
[
115,
121
],
[
121,
122
],
[
122,
123
],
[
122,
124
],
[
124,
125
],
[
124,
126
],
[
102,
127
],
[
127,
128
],
[
128,
129
],
[
128,
130
],
[
127,
131
],
[
131,
132
],
[
132,
133
],
[
131,
134
],
[
134,
135
],
[
135,
136
],
[
136,
137
],
[
136,
138
],
[
135,
139
],
[
134,
140
],
[
140,
141
],
[
141,
142
],
[
141,
143
],
[
143,
144
],
[
143,
145
],
[
36,
146
],
[
146,
147
],
[
146,
148
],
[
36,
149
],
[
149,
150
],
[
150,
151
],
[
151,
152
],
[
151,
153
],
[
149,
154
],
[
155,
155
],
[
155,
156
],
[
155,
157
],
[
155,
158
],
[
36,
159
],
[
159,
160
],
[
159,
161
],
[
36,
162
],
[
162,
163
],
[
162,
164
],
[
36,
165
],
[
165,
166
],
[
165,
167
],
[
36,
168
],
[
168,
169
],
[
168,
170
],
[
6,
171
],
[
171,
172
],
[
0,
173
],
[
173,
174
],
[
173,
175
]
] | [
"import java.util.Scanner;\npublic class Main {\n\tpublic static void main(String[] args) {\n\t\tScanner s=new Scanner(System.in);\n\t\tint a,b,k=1,t=1,x,y;\n\t\tint i=1,j=1;\n\t\twhile(s.hasNext()){\n\t\t\ta=s.nextInt();\n\t\t\tb=s.nextInt();\n\t\t\t//\n\t\t\tk=a;t=b;\n\t\t\twhile(true){\n\t\t\t\tif(k==t)\n\t\t\t\t\tbreak;\n\t\t\t\tif(k<t){\n\t\t\t\t\tk=a*i;\n\t\t\t\t\ti++;\n\t\t\t\t}\n\t\t\t\tif(t<k){\n\t\t\t\t\tt=b*j;\n\t\t\t\t\tj++;\n\t\t\t\t}\n\t\t\t}\n\t\t\tx=k;\n\t\t\t//\n\t\t\ti=1;j=1;k=a;t=b;\n\t\t\twhile(true){\n\t\t\t\tif(k==t)\n\t\t\t\t\tbreak;\n\t\t\t\tif(t<k){\n\t\t\t\t\ti++;\n\t\t\t\t\tif(a%i==0){\n\t\t\t\t\tk=a/i;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(k<t){\n\t\t\t\t\tj++;\n\t\t\t\t\tif(b%j==0){\n\t\t\t\t\tt=b/j;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\ty=k;\n\t\t\tSystem.out.println(y+\" \"+x);\n\t\t\ti=1;j=1;k=1;t=1;\n\t\t}\n\t}\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n\tpublic static void main(String[] args) {\n\t\tScanner s=new Scanner(System.in);\n\t\tint a,b,k=1,t=1,x,y;\n\t\tint i=1,j=1;\n\t\twhile(s.hasNext()){\n\t\t\ta=s.nextInt();\n\t\t\tb=s.nextInt();\n\t\t\t//\n\t\t\tk=a;t=b;\n\t\t\twhile(true){\n\t\t\t\tif(k==t)\n\t\t\t\t\tbreak;\n\t\t\t\tif(k<t){\n\t\t\t\t\tk=a*i;\n\t\t\t\t\ti++;\n\t\t\t\t}\n\t\t\t\tif(t<k){\n\t\t\t\t\tt=b*j;\n\t\t\t\t\tj++;\n\t\t\t\t}\n\t\t\t}\n\t\t\tx=k;\n\t\t\t//\n\t\t\ti=1;j=1;k=a;t=b;\n\t\t\twhile(true){\n\t\t\t\tif(k==t)\n\t\t\t\t\tbreak;\n\t\t\t\tif(t<k){\n\t\t\t\t\ti++;\n\t\t\t\t\tif(a%i==0){\n\t\t\t\t\tk=a/i;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(k<t){\n\t\t\t\t\tj++;\n\t\t\t\t\tif(b%j==0){\n\t\t\t\t\tt=b/j;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\ty=k;\n\t\t\tSystem.out.println(y+\" \"+x);\n\t\t\ti=1;j=1;k=1;t=1;\n\t\t}\n\t}\n}",
"Main",
"public static void main(String[] args) {\n\t\tScanner s=new Scanner(System.in);\n\t\tint a,b,k=1,t=1,x,y;\n\t\tint i=1,j=1;\n\t\twhile(s.hasNext()){\n\t\t\ta=s.nextInt();\n\t\t\tb=s.nextInt();\n\t\t\t//\n\t\t\tk=a;t=b;\n\t\t\twhile(true){\n\t\t\t\tif(k==t)\n\t\t\t\t\tbreak;\n\t\t\t\tif(k<t){\n\t\t\t\t\tk=a*i;\n\t\t\t\t\ti++;\n\t\t\t\t}\n\t\t\t\tif(t<k){\n\t\t\t\t\tt=b*j;\n\t\t\t\t\tj++;\n\t\t\t\t}\n\t\t\t}\n\t\t\tx=k;\n\t\t\t//\n\t\t\ti=1;j=1;k=a;t=b;\n\t\t\twhile(true){\n\t\t\t\tif(k==t)\n\t\t\t\t\tbreak;\n\t\t\t\tif(t<k){\n\t\t\t\t\ti++;\n\t\t\t\t\tif(a%i==0){\n\t\t\t\t\tk=a/i;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(k<t){\n\t\t\t\t\tj++;\n\t\t\t\t\tif(b%j==0){\n\t\t\t\t\tt=b/j;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\ty=k;\n\t\t\tSystem.out.println(y+\" \"+x);\n\t\t\ti=1;j=1;k=1;t=1;\n\t\t}\n\t}",
"main",
"{\n\t\tScanner s=new Scanner(System.in);\n\t\tint a,b,k=1,t=1,x,y;\n\t\tint i=1,j=1;\n\t\twhile(s.hasNext()){\n\t\t\ta=s.nextInt();\n\t\t\tb=s.nextInt();\n\t\t\t//\n\t\t\tk=a;t=b;\n\t\t\twhile(true){\n\t\t\t\tif(k==t)\n\t\t\t\t\tbreak;\n\t\t\t\tif(k<t){\n\t\t\t\t\tk=a*i;\n\t\t\t\t\ti++;\n\t\t\t\t}\n\t\t\t\tif(t<k){\n\t\t\t\t\tt=b*j;\n\t\t\t\t\tj++;\n\t\t\t\t}\n\t\t\t}\n\t\t\tx=k;\n\t\t\t//\n\t\t\ti=1;j=1;k=a;t=b;\n\t\t\twhile(true){\n\t\t\t\tif(k==t)\n\t\t\t\t\tbreak;\n\t\t\t\tif(t<k){\n\t\t\t\t\ti++;\n\t\t\t\t\tif(a%i==0){\n\t\t\t\t\tk=a/i;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(k<t){\n\t\t\t\t\tj++;\n\t\t\t\t\tif(b%j==0){\n\t\t\t\t\tt=b/j;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\ty=k;\n\t\t\tSystem.out.println(y+\" \"+x);\n\t\t\ti=1;j=1;k=1;t=1;\n\t\t}\n\t}",
"Scanner s=new Scanner(System.in);",
"s",
"new Scanner(System.in)",
"int a",
"a",
"b",
"b",
"k=1",
"k",
"1",
"t=1",
"t",
"1",
"x",
"x",
"y;",
"y",
"int i=1",
"i",
"1",
"j=1;",
"j",
"1",
"while(s.hasNext()){\n\t\t\ta=s.nextInt();\n\t\t\tb=s.nextInt();\n\t\t\t//\n\t\t\tk=a;t=b;\n\t\t\twhile(true){\n\t\t\t\tif(k==t)\n\t\t\t\t\tbreak;\n\t\t\t\tif(k<t){\n\t\t\t\t\tk=a*i;\n\t\t\t\t\ti++;\n\t\t\t\t}\n\t\t\t\tif(t<k){\n\t\t\t\t\tt=b*j;\n\t\t\t\t\tj++;\n\t\t\t\t}\n\t\t\t}\n\t\t\tx=k;\n\t\t\t//\n\t\t\ti=1;j=1;k=a;t=b;\n\t\t\twhile(true){\n\t\t\t\tif(k==t)\n\t\t\t\t\tbreak;\n\t\t\t\tif(t<k){\n\t\t\t\t\ti++;\n\t\t\t\t\tif(a%i==0){\n\t\t\t\t\tk=a/i;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(k<t){\n\t\t\t\t\tj++;\n\t\t\t\t\tif(b%j==0){\n\t\t\t\t\tt=b/j;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\ty=k;\n\t\t\tSystem.out.println(y+\" \"+x);\n\t\t\ti=1;j=1;k=1;t=1;\n\t\t}",
"s.hasNext()",
"s.hasNext",
"s",
"{\n\t\t\ta=s.nextInt();\n\t\t\tb=s.nextInt();\n\t\t\t//\n\t\t\tk=a;t=b;\n\t\t\twhile(true){\n\t\t\t\tif(k==t)\n\t\t\t\t\tbreak;\n\t\t\t\tif(k<t){\n\t\t\t\t\tk=a*i;\n\t\t\t\t\ti++;\n\t\t\t\t}\n\t\t\t\tif(t<k){\n\t\t\t\t\tt=b*j;\n\t\t\t\t\tj++;\n\t\t\t\t}\n\t\t\t}\n\t\t\tx=k;\n\t\t\t//\n\t\t\ti=1;j=1;k=a;t=b;\n\t\t\twhile(true){\n\t\t\t\tif(k==t)\n\t\t\t\t\tbreak;\n\t\t\t\tif(t<k){\n\t\t\t\t\ti++;\n\t\t\t\t\tif(a%i==0){\n\t\t\t\t\tk=a/i;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(k<t){\n\t\t\t\t\tj++;\n\t\t\t\t\tif(b%j==0){\n\t\t\t\t\tt=b/j;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\ty=k;\n\t\t\tSystem.out.println(y+\" \"+x);\n\t\t\ti=1;j=1;k=1;t=1;\n\t\t}",
"a=s.nextInt()",
"a",
"s.nextInt()",
"s.nextInt",
"s",
"b=s.nextInt()",
"b",
"s.nextInt()",
"s.nextInt",
"s",
"k=a",
"k",
"a",
"t=b",
"t",
"b",
"while(true){\n\t\t\t\tif(k==t)\n\t\t\t\t\tbreak;\n\t\t\t\tif(k<t){\n\t\t\t\t\tk=a*i;\n\t\t\t\t\ti++;\n\t\t\t\t}\n\t\t\t\tif(t<k){\n\t\t\t\t\tt=b*j;\n\t\t\t\t\tj++;\n\t\t\t\t}\n\t\t\t}",
"true",
"{\n\t\t\t\tif(k==t)\n\t\t\t\t\tbreak;\n\t\t\t\tif(k<t){\n\t\t\t\t\tk=a*i;\n\t\t\t\t\ti++;\n\t\t\t\t}\n\t\t\t\tif(t<k){\n\t\t\t\t\tt=b*j;\n\t\t\t\t\tj++;\n\t\t\t\t}\n\t\t\t}",
"if(k==t)\n\t\t\t\t\tbreak;",
"k==t",
"k",
"t",
"break;",
"if(k<t){\n\t\t\t\t\tk=a*i;\n\t\t\t\t\ti++;\n\t\t\t\t}",
"k<t",
"k",
"t",
"{\n\t\t\t\t\tk=a*i;\n\t\t\t\t\ti++;\n\t\t\t\t}",
"k=a*i",
"k",
"a*i",
"a",
"i",
"i++",
"i",
"if(t<k){\n\t\t\t\t\tt=b*j;\n\t\t\t\t\tj++;\n\t\t\t\t}",
"t<k",
"t",
"k",
"{\n\t\t\t\t\tt=b*j;\n\t\t\t\t\tj++;\n\t\t\t\t}",
"t=b*j",
"t",
"b*j",
"b",
"j",
"j++",
"j",
"x=k",
"x",
"k",
"i=1",
"i",
"1",
"j=1",
"j",
"1",
"k=a",
"k",
"a",
"t=b",
"t",
"b",
"while(true){\n\t\t\t\tif(k==t)\n\t\t\t\t\tbreak;\n\t\t\t\tif(t<k){\n\t\t\t\t\ti++;\n\t\t\t\t\tif(a%i==0){\n\t\t\t\t\tk=a/i;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(k<t){\n\t\t\t\t\tj++;\n\t\t\t\t\tif(b%j==0){\n\t\t\t\t\tt=b/j;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}",
"true",
"{\n\t\t\t\tif(k==t)\n\t\t\t\t\tbreak;\n\t\t\t\tif(t<k){\n\t\t\t\t\ti++;\n\t\t\t\t\tif(a%i==0){\n\t\t\t\t\tk=a/i;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(k<t){\n\t\t\t\t\tj++;\n\t\t\t\t\tif(b%j==0){\n\t\t\t\t\tt=b/j;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}",
"if(k==t)\n\t\t\t\t\tbreak;",
"k==t",
"k",
"t",
"break;",
"if(t<k){\n\t\t\t\t\ti++;\n\t\t\t\t\tif(a%i==0){\n\t\t\t\t\tk=a/i;\n\t\t\t\t\t}\n\t\t\t\t}",
"t<k",
"t",
"k",
"{\n\t\t\t\t\ti++;\n\t\t\t\t\tif(a%i==0){\n\t\t\t\t\tk=a/i;\n\t\t\t\t\t}\n\t\t\t\t}",
"i++",
"i",
"if(a%i==0){\n\t\t\t\t\tk=a/i;\n\t\t\t\t\t}",
"a%i==0",
"a%i",
"a",
"i",
"0",
"{\n\t\t\t\t\tk=a/i;\n\t\t\t\t\t}",
"k=a/i",
"k",
"a/i",
"a",
"i",
"if(k<t){\n\t\t\t\t\tj++;\n\t\t\t\t\tif(b%j==0){\n\t\t\t\t\tt=b/j;\n\t\t\t\t\t}\n\t\t\t\t}",
"k<t",
"k",
"t",
"{\n\t\t\t\t\tj++;\n\t\t\t\t\tif(b%j==0){\n\t\t\t\t\tt=b/j;\n\t\t\t\t\t}\n\t\t\t\t}",
"j++",
"j",
"if(b%j==0){\n\t\t\t\t\tt=b/j;\n\t\t\t\t\t}",
"b%j==0",
"b%j",
"b",
"j",
"0",
"{\n\t\t\t\t\tt=b/j;\n\t\t\t\t\t}",
"t=b/j",
"t",
"b/j",
"b",
"j",
"y=k",
"y",
"k",
"System.out.println(y+\" \"+x)",
"System.out.println",
"System.out",
"System",
"System.out",
"y+\" \"+x",
"y+\" \"+x",
"y",
"\" \"",
"x",
"i=1",
"i",
"1",
"j=1",
"j",
"1",
"k=1",
"k",
"1",
"t=1",
"t",
"1",
"String[] args",
"args",
"public class Main {\n\tpublic static void main(String[] args) {\n\t\tScanner s=new Scanner(System.in);\n\t\tint a,b,k=1,t=1,x,y;\n\t\tint i=1,j=1;\n\t\twhile(s.hasNext()){\n\t\t\ta=s.nextInt();\n\t\t\tb=s.nextInt();\n\t\t\t//\n\t\t\tk=a;t=b;\n\t\t\twhile(true){\n\t\t\t\tif(k==t)\n\t\t\t\t\tbreak;\n\t\t\t\tif(k<t){\n\t\t\t\t\tk=a*i;\n\t\t\t\t\ti++;\n\t\t\t\t}\n\t\t\t\tif(t<k){\n\t\t\t\t\tt=b*j;\n\t\t\t\t\tj++;\n\t\t\t\t}\n\t\t\t}\n\t\t\tx=k;\n\t\t\t//\n\t\t\ti=1;j=1;k=a;t=b;\n\t\t\twhile(true){\n\t\t\t\tif(k==t)\n\t\t\t\t\tbreak;\n\t\t\t\tif(t<k){\n\t\t\t\t\ti++;\n\t\t\t\t\tif(a%i==0){\n\t\t\t\t\tk=a/i;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(k<t){\n\t\t\t\t\tj++;\n\t\t\t\t\tif(b%j==0){\n\t\t\t\t\tt=b/j;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\ty=k;\n\t\t\tSystem.out.println(y+\" \"+x);\n\t\t\ti=1;j=1;k=1;t=1;\n\t\t}\n\t}\n}",
"public class Main {\n\tpublic static void main(String[] args) {\n\t\tScanner s=new Scanner(System.in);\n\t\tint a,b,k=1,t=1,x,y;\n\t\tint i=1,j=1;\n\t\twhile(s.hasNext()){\n\t\t\ta=s.nextInt();\n\t\t\tb=s.nextInt();\n\t\t\t//\n\t\t\tk=a;t=b;\n\t\t\twhile(true){\n\t\t\t\tif(k==t)\n\t\t\t\t\tbreak;\n\t\t\t\tif(k<t){\n\t\t\t\t\tk=a*i;\n\t\t\t\t\ti++;\n\t\t\t\t}\n\t\t\t\tif(t<k){\n\t\t\t\t\tt=b*j;\n\t\t\t\t\tj++;\n\t\t\t\t}\n\t\t\t}\n\t\t\tx=k;\n\t\t\t//\n\t\t\ti=1;j=1;k=a;t=b;\n\t\t\twhile(true){\n\t\t\t\tif(k==t)\n\t\t\t\t\tbreak;\n\t\t\t\tif(t<k){\n\t\t\t\t\ti++;\n\t\t\t\t\tif(a%i==0){\n\t\t\t\t\tk=a/i;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(k<t){\n\t\t\t\t\tj++;\n\t\t\t\t\tif(b%j==0){\n\t\t\t\t\tt=b/j;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\ty=k;\n\t\t\tSystem.out.println(y+\" \"+x);\n\t\t\ti=1;j=1;k=1;t=1;\n\t\t}\n\t}\n}",
"Main"
] | import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner s=new Scanner(System.in);
int a,b,k=1,t=1,x,y;
int i=1,j=1;
while(s.hasNext()){
a=s.nextInt();
b=s.nextInt();
//
k=a;t=b;
while(true){
if(k==t)
break;
if(k<t){
k=a*i;
i++;
}
if(t<k){
t=b*j;
j++;
}
}
x=k;
//
i=1;j=1;k=a;t=b;
while(true){
if(k==t)
break;
if(t<k){
i++;
if(a%i==0){
k=a/i;
}
}
if(k<t){
j++;
if(b%j==0){
t=b/j;
}
}
}
y=k;
System.out.println(y+" "+x);
i=1;j=1;k=1;t=1;
}
}
} |
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
14,
2,
13,
17,
30,
29,
13,
30,
29,
4,
13,
13,
2,
13,
13,
23,
13,
23,
13,
12,
13,
30,
41,
13,
20,
41,
13,
41,
13,
41,
13,
41,
13,
42,
4,
18,
13,
30,
0,
13,
4,
18,
13,
0,
13,
4,
18,
13,
14,
2,
13,
13,
30,
41,
13,
13,
0,
13,
13,
0,
13,
13,
0,
13,
4,
13,
13,
13,
0,
13,
2,
2,
13,
13,
13,
4,
18,
18,
13,
13,
2,
2,
13,
17,
13,
23,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
10,
11
],
[
10,
12
],
[
9,
13
],
[
13,
14
],
[
14,
15
],
[
9,
16
],
[
16,
17
],
[
17,
18
],
[
18,
19
],
[
18,
20
],
[
18,
21
],
[
21,
22
],
[
21,
23
],
[
6,
24
],
[
24,
25
],
[
6,
26
],
[
26,
27
],
[
4,
28
],
[
28,
29
],
[
28,
30
],
[
30,
31
],
[
31,
32
],
[
31,
33
],
[
30,
34
],
[
34,
35
],
[
30,
36
],
[
36,
37
],
[
30,
38
],
[
38,
39
],
[
30,
40
],
[
40,
41
],
[
30,
42
],
[
42,
43
],
[
43,
44
],
[
44,
45
],
[
42,
46
],
[
46,
47
],
[
47,
48
],
[
47,
49
],
[
49,
50
],
[
50,
51
],
[
46,
52
],
[
52,
53
],
[
52,
54
],
[
54,
55
],
[
55,
56
],
[
46,
57
],
[
57,
58
],
[
58,
59
],
[
58,
60
],
[
57,
61
],
[
61,
62
],
[
62,
63
],
[
62,
64
],
[
61,
65
],
[
65,
66
],
[
65,
67
],
[
61,
68
],
[
68,
69
],
[
68,
70
],
[
46,
71
],
[
71,
72
],
[
71,
73
],
[
73,
74
],
[
73,
75
],
[
73,
76
],
[
46,
77
],
[
77,
78
],
[
77,
79
],
[
79,
80
],
[
80,
81
],
[
80,
82
],
[
79,
83
],
[
46,
84
],
[
84,
85
],
[
85,
86
],
[
86,
87
],
[
86,
88
],
[
84,
89
],
[
90,
90
],
[
90,
91
],
[
90,
92
],
[
90,
93
],
[
28,
94
],
[
94,
95
]
] | [
"import java.util.Scanner;\n\nclass Main {\n\n public static long euclid (long a, long b) {\n\tif (b == 0) {\n\t return a;\n\t}\n\telse {\n\t return euclid (b, a%b);\n\t}\n }\n \n public static void main (String args[]) {\n\tScanner scan = new Scanner(System.in);\n\tlong a, b, G, L;\n\n\twhile (scan.hasNext()) {\n\t a = scan.nextLong();\n\t b = scan.nextLong();\n\n\t if (a < b) {\n\t\tlong tmp = a;\n\t\ta = b;\n\t\tb = tmp;\n\t }\n\n\t G = euclid (a, b);\n\t L = a*b/G;\n\n\t System.out.println(G+\" \"+L);\n\t}\n }\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"class Main {\n\n public static long euclid (long a, long b) {\n\tif (b == 0) {\n\t return a;\n\t}\n\telse {\n\t return euclid (b, a%b);\n\t}\n }\n \n public static void main (String args[]) {\n\tScanner scan = new Scanner(System.in);\n\tlong a, b, G, L;\n\n\twhile (scan.hasNext()) {\n\t a = scan.nextLong();\n\t b = scan.nextLong();\n\n\t if (a < b) {\n\t\tlong tmp = a;\n\t\ta = b;\n\t\tb = tmp;\n\t }\n\n\t G = euclid (a, b);\n\t L = a*b/G;\n\n\t System.out.println(G+\" \"+L);\n\t}\n }\n}",
"Main",
"public static long euclid (long a, long b) {\n\tif (b == 0) {\n\t return a;\n\t}\n\telse {\n\t return euclid (b, a%b);\n\t}\n }",
"euclid",
"{\n\tif (b == 0) {\n\t return a;\n\t}\n\telse {\n\t return euclid (b, a%b);\n\t}\n }",
"if (b == 0) {\n\t return a;\n\t}\n\telse {\n\t return euclid (b, a%b);\n\t}",
"b == 0",
"b",
"0",
"{\n\t return a;\n\t}",
"return a;",
"a",
"{\n\t return euclid (b, a%b);\n\t}",
"return euclid (b, a%b);",
"euclid (b, a%b)",
"euclid",
"b",
"a%b",
"a",
"b",
"long a",
"a",
"long b",
"b",
"public static void main (String args[]) {\n\tScanner scan = new Scanner(System.in);\n\tlong a, b, G, L;\n\n\twhile (scan.hasNext()) {\n\t a = scan.nextLong();\n\t b = scan.nextLong();\n\n\t if (a < b) {\n\t\tlong tmp = a;\n\t\ta = b;\n\t\tb = tmp;\n\t }\n\n\t G = euclid (a, b);\n\t L = a*b/G;\n\n\t System.out.println(G+\" \"+L);\n\t}\n }",
"main",
"{\n\tScanner scan = new Scanner(System.in);\n\tlong a, b, G, L;\n\n\twhile (scan.hasNext()) {\n\t a = scan.nextLong();\n\t b = scan.nextLong();\n\n\t if (a < b) {\n\t\tlong tmp = a;\n\t\ta = b;\n\t\tb = tmp;\n\t }\n\n\t G = euclid (a, b);\n\t L = a*b/G;\n\n\t System.out.println(G+\" \"+L);\n\t}\n }",
"Scanner scan = new Scanner(System.in);",
"scan",
"new Scanner(System.in)",
"long a",
"a",
"b",
"b",
"G",
"G",
"L;",
"L",
"while (scan.hasNext()) {\n\t a = scan.nextLong();\n\t b = scan.nextLong();\n\n\t if (a < b) {\n\t\tlong tmp = a;\n\t\ta = b;\n\t\tb = tmp;\n\t }\n\n\t G = euclid (a, b);\n\t L = a*b/G;\n\n\t System.out.println(G+\" \"+L);\n\t}",
"scan.hasNext()",
"scan.hasNext",
"scan",
"{\n\t a = scan.nextLong();\n\t b = scan.nextLong();\n\n\t if (a < b) {\n\t\tlong tmp = a;\n\t\ta = b;\n\t\tb = tmp;\n\t }\n\n\t G = euclid (a, b);\n\t L = a*b/G;\n\n\t System.out.println(G+\" \"+L);\n\t}",
"a = scan.nextLong()",
"a",
"scan.nextLong()",
"scan.nextLong",
"scan",
"b = scan.nextLong()",
"b",
"scan.nextLong()",
"scan.nextLong",
"scan",
"if (a < b) {\n\t\tlong tmp = a;\n\t\ta = b;\n\t\tb = tmp;\n\t }",
"a < b",
"a",
"b",
"{\n\t\tlong tmp = a;\n\t\ta = b;\n\t\tb = tmp;\n\t }",
"long tmp = a;",
"tmp",
"a",
"a = b",
"a",
"b",
"b = tmp",
"b",
"tmp",
"G = euclid (a, b)",
"G",
"euclid (a, b)",
"euclid",
"a",
"b",
"L = a*b/G",
"L",
"a*b/G",
"a*b",
"a",
"b",
"G",
"System.out.println(G+\" \"+L)",
"System.out.println",
"System.out",
"System",
"System.out",
"G+\" \"+L",
"G+\" \"+L",
"G",
"\" \"",
"L",
"String args[]",
"args"
] | import java.util.Scanner;
class Main {
public static long euclid (long a, long b) {
if (b == 0) {
return a;
}
else {
return euclid (b, a%b);
}
}
public static void main (String args[]) {
Scanner scan = new Scanner(System.in);
long a, b, G, L;
while (scan.hasNext()) {
a = scan.nextLong();
b = scan.nextLong();
if (a < b) {
long tmp = a;
a = b;
b = tmp;
}
G = euclid (a, b);
L = a*b/G;
System.out.println(G+" "+L);
}
}
} |
[
7,
15,
13,
17,
6,
13,
41,
13,
20,
12,
13,
30,
14,
2,
13,
13,
30,
41,
13,
13,
0,
13,
13,
0,
13,
13,
42,
2,
13,
17,
30,
41,
13,
2,
13,
13,
0,
13,
13,
0,
13,
13,
29,
13,
23,
13,
23,
13,
12,
13,
30,
41,
13,
2,
13,
13,
41,
13,
2,
13,
13,
41,
13,
2,
2,
13,
13,
13,
29,
13,
23,
13,
23,
13,
23,
13,
12,
13,
30,
42,
4,
18,
13,
30,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
41,
13,
4,
13,
13,
13,
41,
13,
4,
13,
13,
13,
13,
4,
18,
18,
13,
13,
17,
13,
13,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
118,
5
],
[
118,
6
],
[
6,
7
],
[
6,
8
],
[
118,
9
],
[
9,
10
],
[
9,
11
],
[
11,
12
],
[
12,
13
],
[
13,
14
],
[
13,
15
],
[
12,
16
],
[
16,
17
],
[
17,
18
],
[
17,
19
],
[
16,
20
],
[
20,
21
],
[
20,
22
],
[
16,
23
],
[
23,
24
],
[
23,
25
],
[
11,
26
],
[
26,
27
],
[
27,
28
],
[
27,
29
],
[
26,
30
],
[
30,
31
],
[
31,
32
],
[
31,
33
],
[
33,
34
],
[
33,
35
],
[
30,
36
],
[
36,
37
],
[
36,
38
],
[
30,
39
],
[
39,
40
],
[
39,
41
],
[
11,
42
],
[
42,
43
],
[
9,
44
],
[
44,
45
],
[
9,
46
],
[
46,
47
],
[
118,
48
],
[
48,
49
],
[
48,
50
],
[
50,
51
],
[
51,
52
],
[
51,
53
],
[
53,
54
],
[
53,
55
],
[
50,
56
],
[
56,
57
],
[
56,
58
],
[
58,
59
],
[
58,
60
],
[
50,
61
],
[
61,
62
],
[
61,
63
],
[
64,
64
],
[
64,
65
],
[
64,
66
],
[
64,
67
],
[
50,
68
],
[
68,
69
],
[
48,
70
],
[
70,
71
],
[
48,
72
],
[
72,
73
],
[
48,
74
],
[
74,
75
],
[
118,
76
],
[
76,
77
],
[
76,
78
],
[
78,
79
],
[
79,
80
],
[
80,
81
],
[
81,
82
],
[
79,
83
],
[
83,
84
],
[
84,
85
],
[
84,
86
],
[
86,
87
],
[
87,
88
],
[
83,
89
],
[
89,
90
],
[
89,
91
],
[
91,
92
],
[
92,
93
],
[
83,
94
],
[
94,
95
],
[
94,
96
],
[
96,
97
],
[
96,
98
],
[
96,
99
],
[
83,
100
],
[
100,
101
],
[
100,
102
],
[
102,
103
],
[
102,
104
],
[
102,
105
],
[
102,
106
],
[
83,
107
],
[
107,
108
],
[
108,
109
],
[
109,
110
],
[
109,
111
],
[
107,
112
],
[
107,
113
],
[
107,
114
],
[
76,
115
],
[
115,
116
],
[
0,
117
],
[
117,
118
],
[
117,
119
]
] | [
"import java.util.*;\n\npublic class Main{\n\tprivate static final Scanner scan = new Scanner(System.in);\n\n\tpublic static long gcd(long a, long b){\n\t\tif(a < b){\n\t\t\tlong tmp = a;\n\t\t\ta = b;\n\t\t\tb = tmp;\n\t\t}\n\t\twhile(b > 0){\n\t\t\tlong r = a % b;\n\t\t\ta = b;\n\t\t\tb = r;\n\t\t}\n\t\treturn a;\n\t}\n\n\tpublic static long lcm(long a, long b, long g){\n\t\tlong v = a / g;\n\t\tlong w = b / g;\n\t\tlong l = v * w * g;\n\t\treturn l;\n\t}\n\n\tpublic static void main(String[] args){\n\n\t\twhile(scan.hasNext()){\n\t\t\tlong a = scan.nextLong();\n\t\t\tlong b = scan.nextLong();\n\t\t\tlong g = gcd(a, b);\n\t\t\tlong l = lcm(a, b, g);\n\t\t\tSystem.out.printf(\"%d %d\\n\", g, l);\n\t\t}\n\t}\n}",
"import java.util.*;",
"util.*",
"java",
"public class Main{\n\tprivate static final Scanner scan = new Scanner(System.in);\n\n\tpublic static long gcd(long a, long b){\n\t\tif(a < b){\n\t\t\tlong tmp = a;\n\t\t\ta = b;\n\t\t\tb = tmp;\n\t\t}\n\t\twhile(b > 0){\n\t\t\tlong r = a % b;\n\t\t\ta = b;\n\t\t\tb = r;\n\t\t}\n\t\treturn a;\n\t}\n\n\tpublic static long lcm(long a, long b, long g){\n\t\tlong v = a / g;\n\t\tlong w = b / g;\n\t\tlong l = v * w * g;\n\t\treturn l;\n\t}\n\n\tpublic static void main(String[] args){\n\n\t\twhile(scan.hasNext()){\n\t\t\tlong a = scan.nextLong();\n\t\t\tlong b = scan.nextLong();\n\t\t\tlong g = gcd(a, b);\n\t\t\tlong l = lcm(a, b, g);\n\t\t\tSystem.out.printf(\"%d %d\\n\", g, l);\n\t\t}\n\t}\n}",
"Main",
"private static final Scanner scan = new Scanner(System.in);",
"scan",
"new Scanner(System.in)",
"public static long gcd(long a, long b){\n\t\tif(a < b){\n\t\t\tlong tmp = a;\n\t\t\ta = b;\n\t\t\tb = tmp;\n\t\t}\n\t\twhile(b > 0){\n\t\t\tlong r = a % b;\n\t\t\ta = b;\n\t\t\tb = r;\n\t\t}\n\t\treturn a;\n\t}",
"gcd",
"{\n\t\tif(a < b){\n\t\t\tlong tmp = a;\n\t\t\ta = b;\n\t\t\tb = tmp;\n\t\t}\n\t\twhile(b > 0){\n\t\t\tlong r = a % b;\n\t\t\ta = b;\n\t\t\tb = r;\n\t\t}\n\t\treturn a;\n\t}",
"if(a < b){\n\t\t\tlong tmp = a;\n\t\t\ta = b;\n\t\t\tb = tmp;\n\t\t}",
"a < b",
"a",
"b",
"{\n\t\t\tlong tmp = a;\n\t\t\ta = b;\n\t\t\tb = tmp;\n\t\t}",
"long tmp = a;",
"tmp",
"a",
"a = b",
"a",
"b",
"b = tmp",
"b",
"tmp",
"while(b > 0){\n\t\t\tlong r = a % b;\n\t\t\ta = b;\n\t\t\tb = r;\n\t\t}",
"b > 0",
"b",
"0",
"{\n\t\t\tlong r = a % b;\n\t\t\ta = b;\n\t\t\tb = r;\n\t\t}",
"long r = a % b;",
"r",
"a % b",
"a",
"b",
"a = b",
"a",
"b",
"b = r",
"b",
"r",
"return a;",
"a",
"long a",
"a",
"long b",
"b",
"public static long lcm(long a, long b, long g){\n\t\tlong v = a / g;\n\t\tlong w = b / g;\n\t\tlong l = v * w * g;\n\t\treturn l;\n\t}",
"lcm",
"{\n\t\tlong v = a / g;\n\t\tlong w = b / g;\n\t\tlong l = v * w * g;\n\t\treturn l;\n\t}",
"long v = a / g;",
"v",
"a / g",
"a",
"g",
"long w = b / g;",
"w",
"b / g",
"b",
"g",
"long l = v * w * g;",
"l",
"v * w * g",
"v * w * g",
"v",
"w",
"g",
"return l;",
"l",
"long a",
"a",
"long b",
"b",
"long g",
"g",
"public static void main(String[] args){\n\n\t\twhile(scan.hasNext()){\n\t\t\tlong a = scan.nextLong();\n\t\t\tlong b = scan.nextLong();\n\t\t\tlong g = gcd(a, b);\n\t\t\tlong l = lcm(a, b, g);\n\t\t\tSystem.out.printf(\"%d %d\\n\", g, l);\n\t\t}\n\t}",
"main",
"{\n\n\t\twhile(scan.hasNext()){\n\t\t\tlong a = scan.nextLong();\n\t\t\tlong b = scan.nextLong();\n\t\t\tlong g = gcd(a, b);\n\t\t\tlong l = lcm(a, b, g);\n\t\t\tSystem.out.printf(\"%d %d\\n\", g, l);\n\t\t}\n\t}",
"while(scan.hasNext()){\n\t\t\tlong a = scan.nextLong();\n\t\t\tlong b = scan.nextLong();\n\t\t\tlong g = gcd(a, b);\n\t\t\tlong l = lcm(a, b, g);\n\t\t\tSystem.out.printf(\"%d %d\\n\", g, l);\n\t\t}",
"scan.hasNext()",
"scan.hasNext",
"scan",
"{\n\t\t\tlong a = scan.nextLong();\n\t\t\tlong b = scan.nextLong();\n\t\t\tlong g = gcd(a, b);\n\t\t\tlong l = lcm(a, b, g);\n\t\t\tSystem.out.printf(\"%d %d\\n\", g, l);\n\t\t}",
"long a = scan.nextLong();",
"a",
"scan.nextLong()",
"scan.nextLong",
"scan",
"long b = scan.nextLong();",
"b",
"scan.nextLong()",
"scan.nextLong",
"scan",
"long g = gcd(a, b);",
"g",
"gcd(a, b)",
"gcd",
"a",
"b",
"long l = lcm(a, b, g);",
"l",
"lcm(a, b, g)",
"lcm",
"a",
"b",
"g",
"System.out.printf(\"%d %d\\n\", g, l)",
"System.out.printf",
"System.out",
"System",
"System.out",
"\"%d %d\\n\"",
"g",
"l",
"String[] args",
"args",
"public class Main{\n\tprivate static final Scanner scan = new Scanner(System.in);\n\n\tpublic static long gcd(long a, long b){\n\t\tif(a < b){\n\t\t\tlong tmp = a;\n\t\t\ta = b;\n\t\t\tb = tmp;\n\t\t}\n\t\twhile(b > 0){\n\t\t\tlong r = a % b;\n\t\t\ta = b;\n\t\t\tb = r;\n\t\t}\n\t\treturn a;\n\t}\n\n\tpublic static long lcm(long a, long b, long g){\n\t\tlong v = a / g;\n\t\tlong w = b / g;\n\t\tlong l = v * w * g;\n\t\treturn l;\n\t}\n\n\tpublic static void main(String[] args){\n\n\t\twhile(scan.hasNext()){\n\t\t\tlong a = scan.nextLong();\n\t\t\tlong b = scan.nextLong();\n\t\t\tlong g = gcd(a, b);\n\t\t\tlong l = lcm(a, b, g);\n\t\t\tSystem.out.printf(\"%d %d\\n\", g, l);\n\t\t}\n\t}\n}",
"public class Main{\n\tprivate static final Scanner scan = new Scanner(System.in);\n\n\tpublic static long gcd(long a, long b){\n\t\tif(a < b){\n\t\t\tlong tmp = a;\n\t\t\ta = b;\n\t\t\tb = tmp;\n\t\t}\n\t\twhile(b > 0){\n\t\t\tlong r = a % b;\n\t\t\ta = b;\n\t\t\tb = r;\n\t\t}\n\t\treturn a;\n\t}\n\n\tpublic static long lcm(long a, long b, long g){\n\t\tlong v = a / g;\n\t\tlong w = b / g;\n\t\tlong l = v * w * g;\n\t\treturn l;\n\t}\n\n\tpublic static void main(String[] args){\n\n\t\twhile(scan.hasNext()){\n\t\t\tlong a = scan.nextLong();\n\t\t\tlong b = scan.nextLong();\n\t\t\tlong g = gcd(a, b);\n\t\t\tlong l = lcm(a, b, g);\n\t\t\tSystem.out.printf(\"%d %d\\n\", g, l);\n\t\t}\n\t}\n}",
"Main"
] | import java.util.*;
public class Main{
private static final Scanner scan = new Scanner(System.in);
public static long gcd(long a, long b){
if(a < b){
long tmp = a;
a = b;
b = tmp;
}
while(b > 0){
long r = a % b;
a = b;
b = r;
}
return a;
}
public static long lcm(long a, long b, long g){
long v = a / g;
long w = b / g;
long l = v * w * g;
return l;
}
public static void main(String[] args){
while(scan.hasNext()){
long a = scan.nextLong();
long b = scan.nextLong();
long g = gcd(a, b);
long l = lcm(a, b, g);
System.out.printf("%d %d\n", g, l);
}
}
} |
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
23,
13,
12,
13,
30,
41,
13,
20,
41,
13,
17,
42,
4,
18,
13,
30,
0,
13,
4,
18,
13,
41,
13,
4,
18,
13,
17,
41,
13,
4,
18,
13,
18,
13,
17,
41,
13,
4,
18,
13,
18,
13,
17,
14,
2,
13,
13,
30,
41,
13,
13,
0,
13,
13,
0,
13,
13,
4,
13,
13,
13,
12,
13,
30,
41,
13,
4,
13,
13,
13,
41,
13,
4,
13,
13,
13,
13,
4,
18,
18,
13,
13,
2,
2,
13,
17,
13,
23,
13,
23,
13,
12,
13,
30,
14,
2,
2,
13,
13,
17,
29,
13,
29,
4,
13,
13,
2,
13,
13,
23,
13,
23,
13,
12,
13,
30,
29,
2,
2,
13,
13,
13,
23,
13,
23,
13,
23,
13,
12,
13,
30,
14,
2,
13,
17,
30,
14,
2,
13,
13,
29,
13,
29,
2,
13,
13,
14,
2,
2,
13,
13,
17,
30,
29,
13,
41,
13,
13,
11,
1,
41,
13,
17,
2,
2,
13,
13,
13,
1,
40,
13,
30,
30,
41,
13,
17,
42,
2,
2,
13,
13,
17,
30,
0,
13,
2,
13,
13,
0,
13,
13,
41,
13,
17,
42,
2,
2,
13,
13,
17,
30,
0,
13,
2,
13,
13,
0,
13,
13,
14,
2,
13,
13,
0,
13,
2,
13,
13,
29,
2,
13,
13,
23,
13,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
239,
5
],
[
239,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
6,
12
],
[
12,
13
],
[
239,
14
],
[
14,
15
],
[
14,
16
],
[
16,
17
],
[
17,
18
],
[
17,
19
],
[
16,
20
],
[
20,
21
],
[
20,
22
],
[
16,
23
],
[
23,
24
],
[
24,
25
],
[
25,
26
],
[
23,
27
],
[
27,
28
],
[
28,
29
],
[
28,
30
],
[
30,
31
],
[
31,
32
],
[
27,
33
],
[
33,
34
],
[
33,
35
],
[
35,
36
],
[
36,
37
],
[
35,
38
],
[
27,
39
],
[
39,
40
],
[
39,
41
],
[
41,
42
],
[
42,
43
],
[
41,
44
],
[
44,
45
],
[
44,
46
],
[
27,
47
],
[
47,
48
],
[
47,
49
],
[
49,
50
],
[
50,
51
],
[
49,
52
],
[
52,
53
],
[
52,
54
],
[
27,
55
],
[
55,
56
],
[
56,
57
],
[
56,
58
],
[
55,
59
],
[
59,
60
],
[
60,
61
],
[
60,
62
],
[
59,
63
],
[
63,
64
],
[
63,
65
],
[
59,
66
],
[
66,
67
],
[
66,
68
],
[
27,
69
],
[
69,
70
],
[
69,
71
],
[
69,
72
],
[
239,
73
],
[
73,
74
],
[
73,
75
],
[
75,
76
],
[
76,
77
],
[
76,
78
],
[
78,
79
],
[
78,
80
],
[
78,
81
],
[
75,
82
],
[
82,
83
],
[
82,
84
],
[
84,
85
],
[
84,
86
],
[
84,
87
],
[
84,
88
],
[
75,
89
],
[
89,
90
],
[
90,
91
],
[
91,
92
],
[
91,
93
],
[
89,
94
],
[
95,
95
],
[
95,
96
],
[
95,
97
],
[
95,
98
],
[
73,
99
],
[
99,
100
],
[
73,
101
],
[
101,
102
],
[
239,
103
],
[
103,
104
],
[
103,
105
],
[
105,
106
],
[
106,
107
],
[
107,
108
],
[
108,
109
],
[
108,
110
],
[
107,
111
],
[
106,
112
],
[
112,
113
],
[
105,
114
],
[
114,
115
],
[
115,
116
],
[
115,
117
],
[
115,
118
],
[
118,
119
],
[
118,
120
],
[
103,
121
],
[
121,
122
],
[
103,
123
],
[
123,
124
],
[
239,
125
],
[
125,
126
],
[
125,
127
],
[
127,
128
],
[
128,
129
],
[
129,
130
],
[
130,
131
],
[
130,
132
],
[
129,
133
],
[
125,
134
],
[
134,
135
],
[
125,
136
],
[
136,
137
],
[
125,
138
],
[
138,
139
],
[
239,
140
],
[
140,
141
],
[
140,
142
],
[
142,
143
],
[
143,
144
],
[
144,
145
],
[
144,
146
],
[
143,
147
],
[
147,
148
],
[
148,
149
],
[
149,
150
],
[
149,
151
],
[
148,
152
],
[
152,
153
],
[
148,
154
],
[
154,
155
],
[
155,
156
],
[
155,
157
],
[
143,
158
],
[
158,
159
],
[
159,
160
],
[
160,
161
],
[
160,
162
],
[
159,
163
],
[
158,
164
],
[
164,
165
],
[
165,
166
],
[
142,
167
],
[
167,
168
],
[
167,
169
],
[
142,
170
],
[
170,
171
],
[
171,
172
],
[
172,
173
],
[
172,
174
],
[
170,
175
],
[
175,
176
],
[
176,
177
],
[
176,
178
],
[
175,
179
],
[
170,
180
],
[
180,
181
],
[
181,
182
],
[
170,
183
],
[
184,
184
],
[
184,
185
],
[
185,
186
],
[
185,
187
],
[
184,
188
],
[
188,
189
],
[
189,
190
],
[
190,
191
],
[
190,
192
],
[
189,
193
],
[
188,
194
],
[
194,
195
],
[
195,
196
],
[
195,
197
],
[
197,
198
],
[
197,
199
],
[
194,
200
],
[
200,
201
],
[
200,
202
],
[
184,
203
],
[
203,
204
],
[
203,
205
],
[
184,
206
],
[
206,
207
],
[
207,
208
],
[
208,
209
],
[
208,
210
],
[
207,
211
],
[
206,
212
],
[
212,
213
],
[
213,
214
],
[
213,
215
],
[
215,
216
],
[
215,
217
],
[
212,
218
],
[
218,
219
],
[
218,
220
],
[
184,
221
],
[
221,
222
],
[
222,
223
],
[
222,
224
],
[
221,
225
],
[
225,
226
],
[
225,
227
],
[
227,
228
],
[
227,
229
],
[
142,
230
],
[
230,
231
],
[
231,
232
],
[
231,
233
],
[
140,
234
],
[
234,
235
],
[
140,
236
],
[
236,
237
],
[
0,
238
],
[
238,
239
],
[
238,
240
]
] | [
"\nimport java.util.Scanner;\n\npublic class Main {\n\tpublic static void main(String[] args) {\n\t\tMain p = new Main();\n\t}\n\n\tpublic Main() {\n\t\tScanner sc = new Scanner(System.in);\n\t\tString str = \"\";\n\t\n\t\twhile(sc.hasNextLine()){\n\t\t\tstr = sc.nextLine();\n\t\t\tString[] numStrs = str.split(\" \");\n\t\t\tint a = Integer.parseInt(numStrs[0]);\n\t\t\tint b = Integer.parseInt(numStrs[1]);\n\t\t\tif(b>a){\n\t\t\t\tint w = a;\n\t\t\t\ta = b;\n\t\t\t\tb = w;\n\t\t\t}\n\t\t\tsolve(a, b);\n\t\t}\n\t}\n\n\tpublic void solve(int a, int b) {\n\t\tint gcdRes = gcd(a, b);\n\t\tint lcmRes = lcm(a, b, gcdRes);\n\t\t\n\t\tSystem.out.println(gcdRes + \" \" + lcmRes);\n\t}\n\t\n\tprivate int gcd(int a, int b){\n\t\tif(a%b == 0)\n\t\t\treturn b;\n\t\t\n\t\treturn gcd(b, a%b);\n\t}\n\t\n\tprivate int lcm(int a, int b, int gcdNum){\n\t\treturn (int)(((long)a*b) / gcdNum);\n\t}\n\t\n\t/** バグがある? **/\n\tprivate int lcm(int a, int b){\n\t\tif(a<=3){\n\t\t\tif(a==b)\n\t\t\t\treturn a;\n\t\t\telse\n\t\t\t\treturn a*b;\n\t\t}else if(a%b==0){\n\t\t\treturn a;\n\t\t}\n\n\t\tint r = b;\n\t\tfor(int i=2;i*i<=a;i++){\n\t\t\tint aFact = 1;\n\t\t\twhile(a%i==0){\n\t\t\t\ta = a/i;\n\t\t\t\taFact*=i;\n\t\t\t}\n\t\t\t\n\t\t\tint bFact = 1;\n\t\t\twhile(b%i==0){\n\t\t\t\tb = b/i;\n\t\t\t\tbFact*=i;\n\t\t\t}\n\t\t\t\n\t\t\tif(aFact>bFact)\n\t\t\t\tr *= (aFact/bFact);\n\t\t}\n\t\treturn r*a;\n\t\t\n\t}\n\t\n\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n\tpublic static void main(String[] args) {\n\t\tMain p = new Main();\n\t}\n\n\tpublic Main() {\n\t\tScanner sc = new Scanner(System.in);\n\t\tString str = \"\";\n\t\n\t\twhile(sc.hasNextLine()){\n\t\t\tstr = sc.nextLine();\n\t\t\tString[] numStrs = str.split(\" \");\n\t\t\tint a = Integer.parseInt(numStrs[0]);\n\t\t\tint b = Integer.parseInt(numStrs[1]);\n\t\t\tif(b>a){\n\t\t\t\tint w = a;\n\t\t\t\ta = b;\n\t\t\t\tb = w;\n\t\t\t}\n\t\t\tsolve(a, b);\n\t\t}\n\t}\n\n\tpublic void solve(int a, int b) {\n\t\tint gcdRes = gcd(a, b);\n\t\tint lcmRes = lcm(a, b, gcdRes);\n\t\t\n\t\tSystem.out.println(gcdRes + \" \" + lcmRes);\n\t}\n\t\n\tprivate int gcd(int a, int b){\n\t\tif(a%b == 0)\n\t\t\treturn b;\n\t\t\n\t\treturn gcd(b, a%b);\n\t}\n\t\n\tprivate int lcm(int a, int b, int gcdNum){\n\t\treturn (int)(((long)a*b) / gcdNum);\n\t}\n\t\n\t/** バグがある? **/\n\tprivate int lcm(int a, int b){\n\t\tif(a<=3){\n\t\t\tif(a==b)\n\t\t\t\treturn a;\n\t\t\telse\n\t\t\t\treturn a*b;\n\t\t}else if(a%b==0){\n\t\t\treturn a;\n\t\t}\n\n\t\tint r = b;\n\t\tfor(int i=2;i*i<=a;i++){\n\t\t\tint aFact = 1;\n\t\t\twhile(a%i==0){\n\t\t\t\ta = a/i;\n\t\t\t\taFact*=i;\n\t\t\t}\n\t\t\t\n\t\t\tint bFact = 1;\n\t\t\twhile(b%i==0){\n\t\t\t\tb = b/i;\n\t\t\t\tbFact*=i;\n\t\t\t}\n\t\t\t\n\t\t\tif(aFact>bFact)\n\t\t\t\tr *= (aFact/bFact);\n\t\t}\n\t\treturn r*a;\n\t\t\n\t}\n\t\n\n}",
"Main",
"public static void main(String[] args) {\n\t\tMain p = new Main();\n\t}",
"main",
"{\n\t\tMain p = new Main();\n\t}",
"Main p = new Main();",
"p",
"new Main()",
"String[] args",
"args",
"public Main() {\n\t\tScanner sc = new Scanner(System.in);\n\t\tString str = \"\";\n\t\n\t\twhile(sc.hasNextLine()){\n\t\t\tstr = sc.nextLine();\n\t\t\tString[] numStrs = str.split(\" \");\n\t\t\tint a = Integer.parseInt(numStrs[0]);\n\t\t\tint b = Integer.parseInt(numStrs[1]);\n\t\t\tif(b>a){\n\t\t\t\tint w = a;\n\t\t\t\ta = b;\n\t\t\t\tb = w;\n\t\t\t}\n\t\t\tsolve(a, b);\n\t\t}\n\t}",
"Main",
"{\n\t\tScanner sc = new Scanner(System.in);\n\t\tString str = \"\";\n\t\n\t\twhile(sc.hasNextLine()){\n\t\t\tstr = sc.nextLine();\n\t\t\tString[] numStrs = str.split(\" \");\n\t\t\tint a = Integer.parseInt(numStrs[0]);\n\t\t\tint b = Integer.parseInt(numStrs[1]);\n\t\t\tif(b>a){\n\t\t\t\tint w = a;\n\t\t\t\ta = b;\n\t\t\t\tb = w;\n\t\t\t}\n\t\t\tsolve(a, b);\n\t\t}\n\t}",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"String str = \"\";",
"str",
"\"\"",
"while(sc.hasNextLine()){\n\t\t\tstr = sc.nextLine();\n\t\t\tString[] numStrs = str.split(\" \");\n\t\t\tint a = Integer.parseInt(numStrs[0]);\n\t\t\tint b = Integer.parseInt(numStrs[1]);\n\t\t\tif(b>a){\n\t\t\t\tint w = a;\n\t\t\t\ta = b;\n\t\t\t\tb = w;\n\t\t\t}\n\t\t\tsolve(a, b);\n\t\t}",
"sc.hasNextLine()",
"sc.hasNextLine",
"sc",
"{\n\t\t\tstr = sc.nextLine();\n\t\t\tString[] numStrs = str.split(\" \");\n\t\t\tint a = Integer.parseInt(numStrs[0]);\n\t\t\tint b = Integer.parseInt(numStrs[1]);\n\t\t\tif(b>a){\n\t\t\t\tint w = a;\n\t\t\t\ta = b;\n\t\t\t\tb = w;\n\t\t\t}\n\t\t\tsolve(a, b);\n\t\t}",
"str = sc.nextLine()",
"str",
"sc.nextLine()",
"sc.nextLine",
"sc",
"String[] numStrs = str.split(\" \");",
"numStrs",
"str.split(\" \")",
"str.split",
"str",
"\" \"",
"int a = Integer.parseInt(numStrs[0]);",
"a",
"Integer.parseInt(numStrs[0])",
"Integer.parseInt",
"Integer",
"numStrs[0]",
"numStrs",
"0",
"int b = Integer.parseInt(numStrs[1]);",
"b",
"Integer.parseInt(numStrs[1])",
"Integer.parseInt",
"Integer",
"numStrs[1]",
"numStrs",
"1",
"if(b>a){\n\t\t\t\tint w = a;\n\t\t\t\ta = b;\n\t\t\t\tb = w;\n\t\t\t}",
"b>a",
"b",
"a",
"{\n\t\t\t\tint w = a;\n\t\t\t\ta = b;\n\t\t\t\tb = w;\n\t\t\t}",
"int w = a;",
"w",
"a",
"a = b",
"a",
"b",
"b = w",
"b",
"w",
"solve(a, b)",
"solve",
"a",
"b",
"public void solve(int a, int b) {\n\t\tint gcdRes = gcd(a, b);\n\t\tint lcmRes = lcm(a, b, gcdRes);\n\t\t\n\t\tSystem.out.println(gcdRes + \" \" + lcmRes);\n\t}",
"solve",
"{\n\t\tint gcdRes = gcd(a, b);\n\t\tint lcmRes = lcm(a, b, gcdRes);\n\t\t\n\t\tSystem.out.println(gcdRes + \" \" + lcmRes);\n\t}",
"int gcdRes = gcd(a, b);",
"gcdRes",
"gcd(a, b)",
"gcd",
"a",
"b",
"int lcmRes = lcm(a, b, gcdRes);",
"lcmRes",
"lcm(a, b, gcdRes)",
"lcm",
"a",
"b",
"gcdRes",
"System.out.println(gcdRes + \" \" + lcmRes)",
"System.out.println",
"System.out",
"System",
"System.out",
"gcdRes + \" \" + lcmRes",
"gcdRes + \" \" + lcmRes",
"gcdRes",
"\" \"",
"lcmRes",
"int a",
"a",
"int b",
"b",
"private int gcd(int a, int b){\n\t\tif(a%b == 0)\n\t\t\treturn b;\n\t\t\n\t\treturn gcd(b, a%b);\n\t}",
"gcd",
"{\n\t\tif(a%b == 0)\n\t\t\treturn b;\n\t\t\n\t\treturn gcd(b, a%b);\n\t}",
"if(a%b == 0)\n\t\t\treturn b;",
"a%b == 0",
"a%b",
"a",
"b",
"0",
"return b;",
"b",
"return gcd(b, a%b);",
"gcd(b, a%b)",
"gcd",
"b",
"a%b",
"a",
"b",
"int a",
"a",
"int b",
"b",
"private int lcm(int a, int b, int gcdNum){\n\t\treturn (int)(((long)a*b) / gcdNum);\n\t}",
"lcm",
"{\n\t\treturn (int)(((long)a*b) / gcdNum);\n\t}",
"return (int)(((long)a*b) / gcdNum);",
"(int)(((long)a*b) / gcdNum)",
"((long)a*b)",
"(long)a",
"b",
"gcdNum",
"int a",
"a",
"int b",
"b",
"int gcdNum",
"gcdNum",
"/** バグがある? **/\n\tprivate int lcm(int a, int b){\n\t\tif(a<=3){\n\t\t\tif(a==b)\n\t\t\t\treturn a;\n\t\t\telse\n\t\t\t\treturn a*b;\n\t\t}else if(a%b==0){\n\t\t\treturn a;\n\t\t}\n\n\t\tint r = b;\n\t\tfor(int i=2;i*i<=a;i++){\n\t\t\tint aFact = 1;\n\t\t\twhile(a%i==0){\n\t\t\t\ta = a/i;\n\t\t\t\taFact*=i;\n\t\t\t}\n\t\t\t\n\t\t\tint bFact = 1;\n\t\t\twhile(b%i==0){\n\t\t\t\tb = b/i;\n\t\t\t\tbFact*=i;\n\t\t\t}\n\t\t\t\n\t\t\tif(aFact>bFact)\n\t\t\t\tr *= (aFact/bFact);\n\t\t}\n\t\treturn r*a;\n\t\t\n\t}",
"lcm",
"{\n\t\tif(a<=3){\n\t\t\tif(a==b)\n\t\t\t\treturn a;\n\t\t\telse\n\t\t\t\treturn a*b;\n\t\t}else if(a%b==0){\n\t\t\treturn a;\n\t\t}\n\n\t\tint r = b;\n\t\tfor(int i=2;i*i<=a;i++){\n\t\t\tint aFact = 1;\n\t\t\twhile(a%i==0){\n\t\t\t\ta = a/i;\n\t\t\t\taFact*=i;\n\t\t\t}\n\t\t\t\n\t\t\tint bFact = 1;\n\t\t\twhile(b%i==0){\n\t\t\t\tb = b/i;\n\t\t\t\tbFact*=i;\n\t\t\t}\n\t\t\t\n\t\t\tif(aFact>bFact)\n\t\t\t\tr *= (aFact/bFact);\n\t\t}\n\t\treturn r*a;\n\t\t\n\t}",
"if(a<=3){\n\t\t\tif(a==b)\n\t\t\t\treturn a;\n\t\t\telse\n\t\t\t\treturn a*b;\n\t\t}else if(a%b==0){\n\t\t\treturn a;\n\t\t}",
"a<=3",
"a",
"3",
"{\n\t\t\tif(a==b)\n\t\t\t\treturn a;\n\t\t\telse\n\t\t\t\treturn a*b;\n\t\t}",
"if(a==b)\n\t\t\t\treturn a;\n\t\t\telse\n\t\t\t\treturn a*b;",
"a==b",
"a",
"b",
"return a;",
"a",
"return a*b;",
"a*b",
"a",
"b",
"if(a%b==0){\n\t\t\treturn a;\n\t\t}",
"a%b==0",
"a%b",
"a",
"b",
"0",
"{\n\t\t\treturn a;\n\t\t}",
"return a;",
"a",
"int r = b;",
"r",
"b",
"for(int i=2;i*i<=a;i++){\n\t\t\tint aFact = 1;\n\t\t\twhile(a%i==0){\n\t\t\t\ta = a/i;\n\t\t\t\taFact*=i;\n\t\t\t}\n\t\t\t\n\t\t\tint bFact = 1;\n\t\t\twhile(b%i==0){\n\t\t\t\tb = b/i;\n\t\t\t\tbFact*=i;\n\t\t\t}\n\t\t\t\n\t\t\tif(aFact>bFact)\n\t\t\t\tr *= (aFact/bFact);\n\t\t}",
"int i=2;",
"int i=2;",
"i",
"2",
"i*i<=a",
"i*i",
"i",
"i",
"a",
"i++",
"i++",
"i",
"{\n\t\t\tint aFact = 1;\n\t\t\twhile(a%i==0){\n\t\t\t\ta = a/i;\n\t\t\t\taFact*=i;\n\t\t\t}\n\t\t\t\n\t\t\tint bFact = 1;\n\t\t\twhile(b%i==0){\n\t\t\t\tb = b/i;\n\t\t\t\tbFact*=i;\n\t\t\t}\n\t\t\t\n\t\t\tif(aFact>bFact)\n\t\t\t\tr *= (aFact/bFact);\n\t\t}",
"{\n\t\t\tint aFact = 1;\n\t\t\twhile(a%i==0){\n\t\t\t\ta = a/i;\n\t\t\t\taFact*=i;\n\t\t\t}\n\t\t\t\n\t\t\tint bFact = 1;\n\t\t\twhile(b%i==0){\n\t\t\t\tb = b/i;\n\t\t\t\tbFact*=i;\n\t\t\t}\n\t\t\t\n\t\t\tif(aFact>bFact)\n\t\t\t\tr *= (aFact/bFact);\n\t\t}",
"int aFact = 1;",
"aFact",
"1",
"while(a%i==0){\n\t\t\t\ta = a/i;\n\t\t\t\taFact*=i;\n\t\t\t}",
"a%i==0",
"a%i",
"a",
"i",
"0",
"{\n\t\t\t\ta = a/i;\n\t\t\t\taFact*=i;\n\t\t\t}",
"a = a/i",
"a",
"a/i",
"a",
"i",
"aFact*=i",
"aFact",
"i",
"int bFact = 1;",
"bFact",
"1",
"while(b%i==0){\n\t\t\t\tb = b/i;\n\t\t\t\tbFact*=i;\n\t\t\t}",
"b%i==0",
"b%i",
"b",
"i",
"0",
"{\n\t\t\t\tb = b/i;\n\t\t\t\tbFact*=i;\n\t\t\t}",
"b = b/i",
"b",
"b/i",
"b",
"i",
"bFact*=i",
"bFact",
"i",
"if(aFact>bFact)\n\t\t\t\tr *= (aFact/bFact);",
"aFact>bFact",
"aFact",
"bFact",
"r *= (aFact/bFact)",
"r",
"(aFact/bFact)",
"aFact",
"bFact",
"return r*a;",
"r*a",
"r",
"a",
"int a",
"a",
"int b",
"b",
"public class Main {\n\tpublic static void main(String[] args) {\n\t\tMain p = new Main();\n\t}\n\n\tpublic Main() {\n\t\tScanner sc = new Scanner(System.in);\n\t\tString str = \"\";\n\t\n\t\twhile(sc.hasNextLine()){\n\t\t\tstr = sc.nextLine();\n\t\t\tString[] numStrs = str.split(\" \");\n\t\t\tint a = Integer.parseInt(numStrs[0]);\n\t\t\tint b = Integer.parseInt(numStrs[1]);\n\t\t\tif(b>a){\n\t\t\t\tint w = a;\n\t\t\t\ta = b;\n\t\t\t\tb = w;\n\t\t\t}\n\t\t\tsolve(a, b);\n\t\t}\n\t}\n\n\tpublic void solve(int a, int b) {\n\t\tint gcdRes = gcd(a, b);\n\t\tint lcmRes = lcm(a, b, gcdRes);\n\t\t\n\t\tSystem.out.println(gcdRes + \" \" + lcmRes);\n\t}\n\t\n\tprivate int gcd(int a, int b){\n\t\tif(a%b == 0)\n\t\t\treturn b;\n\t\t\n\t\treturn gcd(b, a%b);\n\t}\n\t\n\tprivate int lcm(int a, int b, int gcdNum){\n\t\treturn (int)(((long)a*b) / gcdNum);\n\t}\n\t\n\t/** バグがある? **/\n\tprivate int lcm(int a, int b){\n\t\tif(a<=3){\n\t\t\tif(a==b)\n\t\t\t\treturn a;\n\t\t\telse\n\t\t\t\treturn a*b;\n\t\t}else if(a%b==0){\n\t\t\treturn a;\n\t\t}\n\n\t\tint r = b;\n\t\tfor(int i=2;i*i<=a;i++){\n\t\t\tint aFact = 1;\n\t\t\twhile(a%i==0){\n\t\t\t\ta = a/i;\n\t\t\t\taFact*=i;\n\t\t\t}\n\t\t\t\n\t\t\tint bFact = 1;\n\t\t\twhile(b%i==0){\n\t\t\t\tb = b/i;\n\t\t\t\tbFact*=i;\n\t\t\t}\n\t\t\t\n\t\t\tif(aFact>bFact)\n\t\t\t\tr *= (aFact/bFact);\n\t\t}\n\t\treturn r*a;\n\t\t\n\t}\n\t\n\n}",
"public class Main {\n\tpublic static void main(String[] args) {\n\t\tMain p = new Main();\n\t}\n\n\tpublic Main() {\n\t\tScanner sc = new Scanner(System.in);\n\t\tString str = \"\";\n\t\n\t\twhile(sc.hasNextLine()){\n\t\t\tstr = sc.nextLine();\n\t\t\tString[] numStrs = str.split(\" \");\n\t\t\tint a = Integer.parseInt(numStrs[0]);\n\t\t\tint b = Integer.parseInt(numStrs[1]);\n\t\t\tif(b>a){\n\t\t\t\tint w = a;\n\t\t\t\ta = b;\n\t\t\t\tb = w;\n\t\t\t}\n\t\t\tsolve(a, b);\n\t\t}\n\t}\n\n\tpublic void solve(int a, int b) {\n\t\tint gcdRes = gcd(a, b);\n\t\tint lcmRes = lcm(a, b, gcdRes);\n\t\t\n\t\tSystem.out.println(gcdRes + \" \" + lcmRes);\n\t}\n\t\n\tprivate int gcd(int a, int b){\n\t\tif(a%b == 0)\n\t\t\treturn b;\n\t\t\n\t\treturn gcd(b, a%b);\n\t}\n\t\n\tprivate int lcm(int a, int b, int gcdNum){\n\t\treturn (int)(((long)a*b) / gcdNum);\n\t}\n\t\n\t/** バグがある? **/\n\tprivate int lcm(int a, int b){\n\t\tif(a<=3){\n\t\t\tif(a==b)\n\t\t\t\treturn a;\n\t\t\telse\n\t\t\t\treturn a*b;\n\t\t}else if(a%b==0){\n\t\t\treturn a;\n\t\t}\n\n\t\tint r = b;\n\t\tfor(int i=2;i*i<=a;i++){\n\t\t\tint aFact = 1;\n\t\t\twhile(a%i==0){\n\t\t\t\ta = a/i;\n\t\t\t\taFact*=i;\n\t\t\t}\n\t\t\t\n\t\t\tint bFact = 1;\n\t\t\twhile(b%i==0){\n\t\t\t\tb = b/i;\n\t\t\t\tbFact*=i;\n\t\t\t}\n\t\t\t\n\t\t\tif(aFact>bFact)\n\t\t\t\tr *= (aFact/bFact);\n\t\t}\n\t\treturn r*a;\n\t\t\n\t}\n\t\n\n}",
"Main"
] |
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Main p = new Main();
}
public Main() {
Scanner sc = new Scanner(System.in);
String str = "";
while(sc.hasNextLine()){
str = sc.nextLine();
String[] numStrs = str.split(" ");
int a = Integer.parseInt(numStrs[0]);
int b = Integer.parseInt(numStrs[1]);
if(b>a){
int w = a;
a = b;
b = w;
}
solve(a, b);
}
}
public void solve(int a, int b) {
int gcdRes = gcd(a, b);
int lcmRes = lcm(a, b, gcdRes);
System.out.println(gcdRes + " " + lcmRes);
}
private int gcd(int a, int b){
if(a%b == 0)
return b;
return gcd(b, a%b);
}
private int lcm(int a, int b, int gcdNum){
return (int)(((long)a*b) / gcdNum);
}
/** バグがある? **/
private int lcm(int a, int b){
if(a<=3){
if(a==b)
return a;
else
return a*b;
}else if(a%b==0){
return a;
}
int r = b;
for(int i=2;i*i<=a;i++){
int aFact = 1;
while(a%i==0){
a = a/i;
aFact*=i;
}
int bFact = 1;
while(b%i==0){
b = b/i;
bFact*=i;
}
if(aFact>bFact)
r *= (aFact/bFact);
}
return r*a;
}
} |
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
41,
13,
14,
2,
13,
13,
30,
29,
13,
14,
2,
13,
13,
30,
0,
13,
13,
0,
13,
13,
30,
0,
13,
13,
0,
13,
13,
41,
13,
2,
13,
13,
14,
2,
13,
17,
30,
29,
13,
30,
29,
4,
13,
13,
13,
23,
13,
23,
13,
12,
13,
30,
41,
13,
20,
41,
13,
20,
42,
4,
18,
13,
30,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
13,
13,
4,
18,
18,
13,
13,
2,
2,
13,
17,
2,
2,
13,
13,
13,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
108,
5
],
[
108,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
8,
11
],
[
11,
12
],
[
8,
13
],
[
13,
14
],
[
14,
15
],
[
14,
16
],
[
13,
17
],
[
17,
18
],
[
18,
19
],
[
13,
20
],
[
20,
21
],
[
21,
22
],
[
21,
23
],
[
20,
24
],
[
24,
25
],
[
25,
26
],
[
25,
27
],
[
24,
28
],
[
28,
29
],
[
28,
30
],
[
20,
31
],
[
31,
32
],
[
32,
33
],
[
32,
34
],
[
31,
35
],
[
35,
36
],
[
35,
37
],
[
8,
38
],
[
38,
39
],
[
38,
40
],
[
40,
41
],
[
40,
42
],
[
8,
43
],
[
43,
44
],
[
44,
45
],
[
44,
46
],
[
43,
47
],
[
47,
48
],
[
48,
49
],
[
43,
50
],
[
50,
51
],
[
51,
52
],
[
52,
53
],
[
52,
54
],
[
52,
55
],
[
6,
56
],
[
56,
57
],
[
6,
58
],
[
58,
59
],
[
108,
60
],
[
60,
61
],
[
60,
62
],
[
62,
63
],
[
63,
64
],
[
63,
65
],
[
62,
66
],
[
66,
67
],
[
66,
68
],
[
62,
69
],
[
69,
70
],
[
70,
71
],
[
71,
72
],
[
69,
73
],
[
73,
74
],
[
74,
75
],
[
74,
76
],
[
76,
77
],
[
77,
78
],
[
73,
79
],
[
79,
80
],
[
79,
81
],
[
81,
82
],
[
82,
83
],
[
73,
84
],
[
84,
85
],
[
84,
86
],
[
86,
87
],
[
87,
88
],
[
86,
89
],
[
86,
90
],
[
73,
91
],
[
91,
92
],
[
92,
93
],
[
93,
94
],
[
93,
95
],
[
91,
96
],
[
97,
97
],
[
97,
98
],
[
97,
99
],
[
97,
100
],
[
100,
101
],
[
101,
102
],
[
101,
103
],
[
100,
104
],
[
60,
105
],
[
105,
106
],
[
0,
107
],
[
107,
108
],
[
107,
109
]
] | [
"import java.util.Scanner;\n\n\npublic class Main {\n\n\tpublic int calcGCD(int a_in, int b_in) {\n\t\tint a, b;\n\t\tif (a_in == b_in) { return a_in;\n\t\t} else if (a_in < b_in) { a = b_in; b = a_in;\n\t\t} else { a = a_in; b = b_in; }\n\n\t\tint r = a % b;\n\t\tif (r == 0) { return b;\n\t\t} else { return calcGCD(b, r); }\n\t}\n\n\tpublic static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\tMain m = new Main();\n\n\t\twhile (sc.hasNext()) {\n\t\t\tint a = sc.nextInt(), b = sc.nextInt();\n\t\t\tint gcd = m.calcGCD(a, b);\n\t\t\tSystem.out.println(gcd+\" \"+(a/gcd*b));\n\t\t}\n\n\t}\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n\n\tpublic int calcGCD(int a_in, int b_in) {\n\t\tint a, b;\n\t\tif (a_in == b_in) { return a_in;\n\t\t} else if (a_in < b_in) { a = b_in; b = a_in;\n\t\t} else { a = a_in; b = b_in; }\n\n\t\tint r = a % b;\n\t\tif (r == 0) { return b;\n\t\t} else { return calcGCD(b, r); }\n\t}\n\n\tpublic static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\tMain m = new Main();\n\n\t\twhile (sc.hasNext()) {\n\t\t\tint a = sc.nextInt(), b = sc.nextInt();\n\t\t\tint gcd = m.calcGCD(a, b);\n\t\t\tSystem.out.println(gcd+\" \"+(a/gcd*b));\n\t\t}\n\n\t}\n}",
"Main",
"public int calcGCD(int a_in, int b_in) {\n\t\tint a, b;\n\t\tif (a_in == b_in) { return a_in;\n\t\t} else if (a_in < b_in) { a = b_in; b = a_in;\n\t\t} else { a = a_in; b = b_in; }\n\n\t\tint r = a % b;\n\t\tif (r == 0) { return b;\n\t\t} else { return calcGCD(b, r); }\n\t}",
"calcGCD",
"{\n\t\tint a, b;\n\t\tif (a_in == b_in) { return a_in;\n\t\t} else if (a_in < b_in) { a = b_in; b = a_in;\n\t\t} else { a = a_in; b = b_in; }\n\n\t\tint r = a % b;\n\t\tif (r == 0) { return b;\n\t\t} else { return calcGCD(b, r); }\n\t}",
"int a",
"a",
"b;",
"b",
"if (a_in == b_in) { return a_in;\n\t\t} else if (a_in < b_in) { a = b_in; b = a_in;\n\t\t} else { a = a_in; b = b_in; }",
"a_in == b_in",
"a_in",
"b_in",
"{ return a_in;\n\t\t}",
"return a_in;",
"a_in",
"if (a_in < b_in) { a = b_in; b = a_in;\n\t\t} else { a = a_in; b = b_in; }",
"a_in < b_in",
"a_in",
"b_in",
"{ a = b_in; b = a_in;\n\t\t}",
"a = b_in",
"a",
"b_in",
"b = a_in",
"b",
"a_in",
"{ a = a_in; b = b_in; }",
"a = a_in",
"a",
"a_in",
"b = b_in",
"b",
"b_in",
"int r = a % b;",
"r",
"a % b",
"a",
"b",
"if (r == 0) { return b;\n\t\t} else { return calcGCD(b, r); }",
"r == 0",
"r",
"0",
"{ return b;\n\t\t}",
"return b;",
"b",
"{ return calcGCD(b, r); }",
"return calcGCD(b, r);",
"calcGCD(b, r)",
"calcGCD",
"b",
"r",
"int a_in",
"a_in",
"int b_in",
"b_in",
"public static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\tMain m = new Main();\n\n\t\twhile (sc.hasNext()) {\n\t\t\tint a = sc.nextInt(), b = sc.nextInt();\n\t\t\tint gcd = m.calcGCD(a, b);\n\t\t\tSystem.out.println(gcd+\" \"+(a/gcd*b));\n\t\t}\n\n\t}",
"main",
"{\n\t\tScanner sc = new Scanner(System.in);\n\t\tMain m = new Main();\n\n\t\twhile (sc.hasNext()) {\n\t\t\tint a = sc.nextInt(), b = sc.nextInt();\n\t\t\tint gcd = m.calcGCD(a, b);\n\t\t\tSystem.out.println(gcd+\" \"+(a/gcd*b));\n\t\t}\n\n\t}",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"Main m = new Main();",
"m",
"new Main()",
"while (sc.hasNext()) {\n\t\t\tint a = sc.nextInt(), b = sc.nextInt();\n\t\t\tint gcd = m.calcGCD(a, b);\n\t\t\tSystem.out.println(gcd+\" \"+(a/gcd*b));\n\t\t}",
"sc.hasNext()",
"sc.hasNext",
"sc",
"{\n\t\t\tint a = sc.nextInt(), b = sc.nextInt();\n\t\t\tint gcd = m.calcGCD(a, b);\n\t\t\tSystem.out.println(gcd+\" \"+(a/gcd*b));\n\t\t}",
"int a = sc.nextInt()",
"a",
"sc.nextInt()",
"sc.nextInt",
"sc",
"b = sc.nextInt();",
"b",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int gcd = m.calcGCD(a, b);",
"gcd",
"m.calcGCD(a, b)",
"m.calcGCD",
"m",
"a",
"b",
"System.out.println(gcd+\" \"+(a/gcd*b))",
"System.out.println",
"System.out",
"System",
"System.out",
"gcd+\" \"+(a/gcd*b)",
"gcd+\" \"+(a/gcd*b)",
"gcd",
"\" \"",
"(a/gcd*b)",
"a/gcd",
"a",
"gcd",
"b",
"String[] args",
"args",
"public class Main {\n\n\tpublic int calcGCD(int a_in, int b_in) {\n\t\tint a, b;\n\t\tif (a_in == b_in) { return a_in;\n\t\t} else if (a_in < b_in) { a = b_in; b = a_in;\n\t\t} else { a = a_in; b = b_in; }\n\n\t\tint r = a % b;\n\t\tif (r == 0) { return b;\n\t\t} else { return calcGCD(b, r); }\n\t}\n\n\tpublic static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\tMain m = new Main();\n\n\t\twhile (sc.hasNext()) {\n\t\t\tint a = sc.nextInt(), b = sc.nextInt();\n\t\t\tint gcd = m.calcGCD(a, b);\n\t\t\tSystem.out.println(gcd+\" \"+(a/gcd*b));\n\t\t}\n\n\t}\n}",
"public class Main {\n\n\tpublic int calcGCD(int a_in, int b_in) {\n\t\tint a, b;\n\t\tif (a_in == b_in) { return a_in;\n\t\t} else if (a_in < b_in) { a = b_in; b = a_in;\n\t\t} else { a = a_in; b = b_in; }\n\n\t\tint r = a % b;\n\t\tif (r == 0) { return b;\n\t\t} else { return calcGCD(b, r); }\n\t}\n\n\tpublic static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\tMain m = new Main();\n\n\t\twhile (sc.hasNext()) {\n\t\t\tint a = sc.nextInt(), b = sc.nextInt();\n\t\t\tint gcd = m.calcGCD(a, b);\n\t\t\tSystem.out.println(gcd+\" \"+(a/gcd*b));\n\t\t}\n\n\t}\n}",
"Main"
] | import java.util.Scanner;
public class Main {
public int calcGCD(int a_in, int b_in) {
int a, b;
if (a_in == b_in) { return a_in;
} else if (a_in < b_in) { a = b_in; b = a_in;
} else { a = a_in; b = b_in; }
int r = a % b;
if (r == 0) { return b;
} else { return calcGCD(b, r); }
}
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
Main m = new Main();
while (sc.hasNext()) {
int a = sc.nextInt(), b = sc.nextInt();
int gcd = m.calcGCD(a, b);
System.out.println(gcd+" "+(a/gcd*b));
}
}
} |
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
42,
4,
18,
13,
30,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
41,
13,
13,
41,
13,
13,
14,
2,
13,
13,
30,
41,
13,
13,
0,
13,
13,
0,
13,
13,
42,
17,
30,
14,
2,
2,
13,
13,
17,
30,
4,
18,
18,
13,
13,
2,
13,
17,
3,
41,
13,
2,
13,
13,
0,
13,
13,
0,
13,
13,
4,
13,
13,
13,
23,
13,
12,
13,
30,
41,
13,
17,
41,
13,
17,
42,
2,
2,
13,
13,
17,
30,
41,
13,
17,
41,
13,
17,
42,
2,
2,
13,
13,
17,
30,
40,
13,
0,
13,
2,
13,
13,
42,
2,
2,
13,
13,
17,
30,
40,
13,
0,
13,
2,
13,
13,
41,
13,
4,
18,
13,
13,
13,
0,
13,
2,
13,
4,
18,
13,
13,
4,
18,
13,
13,
13,
40,
13,
4,
18,
18,
13,
13,
13,
23,
13,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
166,
5
],
[
166,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
13,
14
],
[
14,
15
],
[
12,
16
],
[
16,
17
],
[
17,
18
],
[
17,
19
],
[
19,
20
],
[
20,
21
],
[
16,
22
],
[
22,
23
],
[
22,
24
],
[
24,
25
],
[
25,
26
],
[
16,
27
],
[
27,
28
],
[
27,
29
],
[
16,
30
],
[
30,
31
],
[
30,
32
],
[
16,
33
],
[
33,
34
],
[
34,
35
],
[
34,
36
],
[
33,
37
],
[
37,
38
],
[
38,
39
],
[
38,
40
],
[
37,
41
],
[
41,
42
],
[
41,
43
],
[
37,
44
],
[
44,
45
],
[
44,
46
],
[
16,
47
],
[
47,
48
],
[
47,
49
],
[
49,
50
],
[
50,
51
],
[
51,
52
],
[
52,
53
],
[
52,
54
],
[
51,
55
],
[
50,
56
],
[
56,
57
],
[
57,
58
],
[
58,
59
],
[
59,
60
],
[
59,
61
],
[
57,
62
],
[
62,
63
],
[
62,
64
],
[
56,
65
],
[
49,
66
],
[
66,
67
],
[
66,
68
],
[
68,
69
],
[
68,
70
],
[
49,
71
],
[
71,
72
],
[
71,
73
],
[
49,
74
],
[
74,
75
],
[
74,
76
],
[
16,
77
],
[
77,
78
],
[
77,
79
],
[
77,
80
],
[
6,
81
],
[
81,
82
],
[
166,
83
],
[
83,
84
],
[
83,
85
],
[
85,
86
],
[
86,
87
],
[
86,
88
],
[
85,
89
],
[
89,
90
],
[
89,
91
],
[
85,
92
],
[
92,
93
],
[
93,
94
],
[
94,
95
],
[
94,
96
],
[
93,
97
],
[
92,
98
],
[
98,
99
],
[
99,
100
],
[
99,
101
],
[
98,
102
],
[
102,
103
],
[
102,
104
],
[
98,
105
],
[
105,
106
],
[
106,
107
],
[
107,
108
],
[
107,
109
],
[
106,
110
],
[
105,
111
],
[
111,
112
],
[
112,
113
],
[
111,
114
],
[
114,
115
],
[
114,
116
],
[
116,
117
],
[
116,
118
],
[
98,
119
],
[
119,
120
],
[
120,
121
],
[
121,
122
],
[
121,
123
],
[
120,
124
],
[
119,
125
],
[
125,
126
],
[
126,
127
],
[
125,
128
],
[
128,
129
],
[
128,
130
],
[
130,
131
],
[
130,
132
],
[
98,
133
],
[
133,
134
],
[
133,
135
],
[
135,
136
],
[
136,
137
],
[
135,
138
],
[
135,
139
],
[
98,
140
],
[
140,
141
],
[
140,
142
],
[
142,
143
],
[
142,
144
],
[
144,
145
],
[
145,
146
],
[
144,
147
],
[
144,
148
],
[
148,
149
],
[
149,
150
],
[
148,
151
],
[
148,
152
],
[
98,
153
],
[
153,
154
],
[
85,
155
],
[
155,
156
],
[
156,
157
],
[
157,
158
],
[
157,
159
],
[
155,
160
],
[
83,
161
],
[
161,
162
],
[
83,
163
],
[
163,
164
],
[
0,
165
],
[
165,
166
],
[
165,
167
]
] | [
"\n\nimport java.util.Scanner;\n\npublic class Main {\n\tpublic static void main(String[] args){\n\t\tScanner stdIn = new Scanner(System.in);\n\t\t\n\t\twhile(stdIn.hasNext()){\n\t\t\tint a = stdIn.nextInt();\n\t\t\tint b = stdIn.nextInt();\n\t\t\tint c = a;\n\t\t\tint d = b;\n\t\t\t\n\t\t\tif(a<b){\n\t\t\t\tint tmp = b;\n\t\t\t\tb = a;\n\t\t\t\ta = tmp;\n\t\t\t}\n\t\t\t\n\t\t\twhile(true){\n\t\t\t\tif(a%b==0){\n\t\t\t\t\tSystem.out.print(b+\" \");\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tint tmp = a%b;\n\t\t\t\ta = b;\n\t\t\t\tb = tmp;\n\t\t\t}\n\t\t\t\n\t\t\tfunc(c,d);\n\t\t\t\n\t\t}\n\t}\n\t\n\tstatic void func(int a,int b){\n\t\tint ans = 1;\n\t\tint i = 2;\n\t\t\n\t\twhile(a*b!=1){\n\t\t\tint count_a = 0;\n\t\t\tint count_b = 0;\n\t\t\twhile(a%i==0){\n\t\t\t\tcount_a++;\n\t\t\t\ta = a/i;\n\t\t\t}\n\t\t\twhile(b%i==0){\n\t\t\t\tcount_b++;\n\t\t\t\tb = b/i;\n\t\t\t}\n\t\t\tint t = Math.max(count_a, count_b);\n\t\t\tans = ans*(int)Math.pow(i,Math.max(count_a, count_b));\n\t\t\ti++;\n\t\t}\n\t\t\n\t\tSystem.out.println(ans);\n\t}\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n\tpublic static void main(String[] args){\n\t\tScanner stdIn = new Scanner(System.in);\n\t\t\n\t\twhile(stdIn.hasNext()){\n\t\t\tint a = stdIn.nextInt();\n\t\t\tint b = stdIn.nextInt();\n\t\t\tint c = a;\n\t\t\tint d = b;\n\t\t\t\n\t\t\tif(a<b){\n\t\t\t\tint tmp = b;\n\t\t\t\tb = a;\n\t\t\t\ta = tmp;\n\t\t\t}\n\t\t\t\n\t\t\twhile(true){\n\t\t\t\tif(a%b==0){\n\t\t\t\t\tSystem.out.print(b+\" \");\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tint tmp = a%b;\n\t\t\t\ta = b;\n\t\t\t\tb = tmp;\n\t\t\t}\n\t\t\t\n\t\t\tfunc(c,d);\n\t\t\t\n\t\t}\n\t}\n\t\n\tstatic void func(int a,int b){\n\t\tint ans = 1;\n\t\tint i = 2;\n\t\t\n\t\twhile(a*b!=1){\n\t\t\tint count_a = 0;\n\t\t\tint count_b = 0;\n\t\t\twhile(a%i==0){\n\t\t\t\tcount_a++;\n\t\t\t\ta = a/i;\n\t\t\t}\n\t\t\twhile(b%i==0){\n\t\t\t\tcount_b++;\n\t\t\t\tb = b/i;\n\t\t\t}\n\t\t\tint t = Math.max(count_a, count_b);\n\t\t\tans = ans*(int)Math.pow(i,Math.max(count_a, count_b));\n\t\t\ti++;\n\t\t}\n\t\t\n\t\tSystem.out.println(ans);\n\t}\n}",
"Main",
"public static void main(String[] args){\n\t\tScanner stdIn = new Scanner(System.in);\n\t\t\n\t\twhile(stdIn.hasNext()){\n\t\t\tint a = stdIn.nextInt();\n\t\t\tint b = stdIn.nextInt();\n\t\t\tint c = a;\n\t\t\tint d = b;\n\t\t\t\n\t\t\tif(a<b){\n\t\t\t\tint tmp = b;\n\t\t\t\tb = a;\n\t\t\t\ta = tmp;\n\t\t\t}\n\t\t\t\n\t\t\twhile(true){\n\t\t\t\tif(a%b==0){\n\t\t\t\t\tSystem.out.print(b+\" \");\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tint tmp = a%b;\n\t\t\t\ta = b;\n\t\t\t\tb = tmp;\n\t\t\t}\n\t\t\t\n\t\t\tfunc(c,d);\n\t\t\t\n\t\t}\n\t}",
"main",
"{\n\t\tScanner stdIn = new Scanner(System.in);\n\t\t\n\t\twhile(stdIn.hasNext()){\n\t\t\tint a = stdIn.nextInt();\n\t\t\tint b = stdIn.nextInt();\n\t\t\tint c = a;\n\t\t\tint d = b;\n\t\t\t\n\t\t\tif(a<b){\n\t\t\t\tint tmp = b;\n\t\t\t\tb = a;\n\t\t\t\ta = tmp;\n\t\t\t}\n\t\t\t\n\t\t\twhile(true){\n\t\t\t\tif(a%b==0){\n\t\t\t\t\tSystem.out.print(b+\" \");\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tint tmp = a%b;\n\t\t\t\ta = b;\n\t\t\t\tb = tmp;\n\t\t\t}\n\t\t\t\n\t\t\tfunc(c,d);\n\t\t\t\n\t\t}\n\t}",
"Scanner stdIn = new Scanner(System.in);",
"stdIn",
"new Scanner(System.in)",
"while(stdIn.hasNext()){\n\t\t\tint a = stdIn.nextInt();\n\t\t\tint b = stdIn.nextInt();\n\t\t\tint c = a;\n\t\t\tint d = b;\n\t\t\t\n\t\t\tif(a<b){\n\t\t\t\tint tmp = b;\n\t\t\t\tb = a;\n\t\t\t\ta = tmp;\n\t\t\t}\n\t\t\t\n\t\t\twhile(true){\n\t\t\t\tif(a%b==0){\n\t\t\t\t\tSystem.out.print(b+\" \");\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tint tmp = a%b;\n\t\t\t\ta = b;\n\t\t\t\tb = tmp;\n\t\t\t}\n\t\t\t\n\t\t\tfunc(c,d);\n\t\t\t\n\t\t}",
"stdIn.hasNext()",
"stdIn.hasNext",
"stdIn",
"{\n\t\t\tint a = stdIn.nextInt();\n\t\t\tint b = stdIn.nextInt();\n\t\t\tint c = a;\n\t\t\tint d = b;\n\t\t\t\n\t\t\tif(a<b){\n\t\t\t\tint tmp = b;\n\t\t\t\tb = a;\n\t\t\t\ta = tmp;\n\t\t\t}\n\t\t\t\n\t\t\twhile(true){\n\t\t\t\tif(a%b==0){\n\t\t\t\t\tSystem.out.print(b+\" \");\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tint tmp = a%b;\n\t\t\t\ta = b;\n\t\t\t\tb = tmp;\n\t\t\t}\n\t\t\t\n\t\t\tfunc(c,d);\n\t\t\t\n\t\t}",
"int a = stdIn.nextInt();",
"a",
"stdIn.nextInt()",
"stdIn.nextInt",
"stdIn",
"int b = stdIn.nextInt();",
"b",
"stdIn.nextInt()",
"stdIn.nextInt",
"stdIn",
"int c = a;",
"c",
"a",
"int d = b;",
"d",
"b",
"if(a<b){\n\t\t\t\tint tmp = b;\n\t\t\t\tb = a;\n\t\t\t\ta = tmp;\n\t\t\t}",
"a<b",
"a",
"b",
"{\n\t\t\t\tint tmp = b;\n\t\t\t\tb = a;\n\t\t\t\ta = tmp;\n\t\t\t}",
"int tmp = b;",
"tmp",
"b",
"b = a",
"b",
"a",
"a = tmp",
"a",
"tmp",
"while(true){\n\t\t\t\tif(a%b==0){\n\t\t\t\t\tSystem.out.print(b+\" \");\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tint tmp = a%b;\n\t\t\t\ta = b;\n\t\t\t\tb = tmp;\n\t\t\t}",
"true",
"{\n\t\t\t\tif(a%b==0){\n\t\t\t\t\tSystem.out.print(b+\" \");\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tint tmp = a%b;\n\t\t\t\ta = b;\n\t\t\t\tb = tmp;\n\t\t\t}",
"if(a%b==0){\n\t\t\t\t\tSystem.out.print(b+\" \");\n\t\t\t\t\tbreak;\n\t\t\t\t}",
"a%b==0",
"a%b",
"a",
"b",
"0",
"{\n\t\t\t\t\tSystem.out.print(b+\" \");\n\t\t\t\t\tbreak;\n\t\t\t\t}",
"System.out.print(b+\" \")",
"System.out.print",
"System.out",
"System",
"System.out",
"b+\" \"",
"b",
"\" \"",
"break;",
"int tmp = a%b;",
"tmp",
"a%b",
"a",
"b",
"a = b",
"a",
"b",
"b = tmp",
"b",
"tmp",
"func(c,d)",
"func",
"c",
"d",
"String[] args",
"args",
"static void func(int a,int b){\n\t\tint ans = 1;\n\t\tint i = 2;\n\t\t\n\t\twhile(a*b!=1){\n\t\t\tint count_a = 0;\n\t\t\tint count_b = 0;\n\t\t\twhile(a%i==0){\n\t\t\t\tcount_a++;\n\t\t\t\ta = a/i;\n\t\t\t}\n\t\t\twhile(b%i==0){\n\t\t\t\tcount_b++;\n\t\t\t\tb = b/i;\n\t\t\t}\n\t\t\tint t = Math.max(count_a, count_b);\n\t\t\tans = ans*(int)Math.pow(i,Math.max(count_a, count_b));\n\t\t\ti++;\n\t\t}\n\t\t\n\t\tSystem.out.println(ans);\n\t}",
"func",
"{\n\t\tint ans = 1;\n\t\tint i = 2;\n\t\t\n\t\twhile(a*b!=1){\n\t\t\tint count_a = 0;\n\t\t\tint count_b = 0;\n\t\t\twhile(a%i==0){\n\t\t\t\tcount_a++;\n\t\t\t\ta = a/i;\n\t\t\t}\n\t\t\twhile(b%i==0){\n\t\t\t\tcount_b++;\n\t\t\t\tb = b/i;\n\t\t\t}\n\t\t\tint t = Math.max(count_a, count_b);\n\t\t\tans = ans*(int)Math.pow(i,Math.max(count_a, count_b));\n\t\t\ti++;\n\t\t}\n\t\t\n\t\tSystem.out.println(ans);\n\t}",
"int ans = 1;",
"ans",
"1",
"int i = 2;",
"i",
"2",
"while(a*b!=1){\n\t\t\tint count_a = 0;\n\t\t\tint count_b = 0;\n\t\t\twhile(a%i==0){\n\t\t\t\tcount_a++;\n\t\t\t\ta = a/i;\n\t\t\t}\n\t\t\twhile(b%i==0){\n\t\t\t\tcount_b++;\n\t\t\t\tb = b/i;\n\t\t\t}\n\t\t\tint t = Math.max(count_a, count_b);\n\t\t\tans = ans*(int)Math.pow(i,Math.max(count_a, count_b));\n\t\t\ti++;\n\t\t}",
"a*b!=1",
"a*b",
"a",
"b",
"1",
"{\n\t\t\tint count_a = 0;\n\t\t\tint count_b = 0;\n\t\t\twhile(a%i==0){\n\t\t\t\tcount_a++;\n\t\t\t\ta = a/i;\n\t\t\t}\n\t\t\twhile(b%i==0){\n\t\t\t\tcount_b++;\n\t\t\t\tb = b/i;\n\t\t\t}\n\t\t\tint t = Math.max(count_a, count_b);\n\t\t\tans = ans*(int)Math.pow(i,Math.max(count_a, count_b));\n\t\t\ti++;\n\t\t}",
"int count_a = 0;",
"count_a",
"0",
"int count_b = 0;",
"count_b",
"0",
"while(a%i==0){\n\t\t\t\tcount_a++;\n\t\t\t\ta = a/i;\n\t\t\t}",
"a%i==0",
"a%i",
"a",
"i",
"0",
"{\n\t\t\t\tcount_a++;\n\t\t\t\ta = a/i;\n\t\t\t}",
"count_a++",
"count_a",
"a = a/i",
"a",
"a/i",
"a",
"i",
"while(b%i==0){\n\t\t\t\tcount_b++;\n\t\t\t\tb = b/i;\n\t\t\t}",
"b%i==0",
"b%i",
"b",
"i",
"0",
"{\n\t\t\t\tcount_b++;\n\t\t\t\tb = b/i;\n\t\t\t}",
"count_b++",
"count_b",
"b = b/i",
"b",
"b/i",
"b",
"i",
"int t = Math.max(count_a, count_b);",
"t",
"Math.max(count_a, count_b)",
"Math.max",
"Math",
"count_a",
"count_b",
"ans = ans*(int)Math.pow(i,Math.max(count_a, count_b))",
"ans",
"ans*(int)Math.pow(i,Math.max(count_a, count_b))",
"ans",
"(int)Math.pow(i,Math.max(count_a, count_b))",
"Math.pow",
"Math",
"i",
"Math.max(count_a, count_b)",
"Math.max",
"Math",
"count_a",
"count_b",
"i++",
"i",
"System.out.println(ans)",
"System.out.println",
"System.out",
"System",
"System.out",
"ans",
"int a",
"a",
"int b",
"b",
"public class Main {\n\tpublic static void main(String[] args){\n\t\tScanner stdIn = new Scanner(System.in);\n\t\t\n\t\twhile(stdIn.hasNext()){\n\t\t\tint a = stdIn.nextInt();\n\t\t\tint b = stdIn.nextInt();\n\t\t\tint c = a;\n\t\t\tint d = b;\n\t\t\t\n\t\t\tif(a<b){\n\t\t\t\tint tmp = b;\n\t\t\t\tb = a;\n\t\t\t\ta = tmp;\n\t\t\t}\n\t\t\t\n\t\t\twhile(true){\n\t\t\t\tif(a%b==0){\n\t\t\t\t\tSystem.out.print(b+\" \");\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tint tmp = a%b;\n\t\t\t\ta = b;\n\t\t\t\tb = tmp;\n\t\t\t}\n\t\t\t\n\t\t\tfunc(c,d);\n\t\t\t\n\t\t}\n\t}\n\t\n\tstatic void func(int a,int b){\n\t\tint ans = 1;\n\t\tint i = 2;\n\t\t\n\t\twhile(a*b!=1){\n\t\t\tint count_a = 0;\n\t\t\tint count_b = 0;\n\t\t\twhile(a%i==0){\n\t\t\t\tcount_a++;\n\t\t\t\ta = a/i;\n\t\t\t}\n\t\t\twhile(b%i==0){\n\t\t\t\tcount_b++;\n\t\t\t\tb = b/i;\n\t\t\t}\n\t\t\tint t = Math.max(count_a, count_b);\n\t\t\tans = ans*(int)Math.pow(i,Math.max(count_a, count_b));\n\t\t\ti++;\n\t\t}\n\t\t\n\t\tSystem.out.println(ans);\n\t}\n}",
"public class Main {\n\tpublic static void main(String[] args){\n\t\tScanner stdIn = new Scanner(System.in);\n\t\t\n\t\twhile(stdIn.hasNext()){\n\t\t\tint a = stdIn.nextInt();\n\t\t\tint b = stdIn.nextInt();\n\t\t\tint c = a;\n\t\t\tint d = b;\n\t\t\t\n\t\t\tif(a<b){\n\t\t\t\tint tmp = b;\n\t\t\t\tb = a;\n\t\t\t\ta = tmp;\n\t\t\t}\n\t\t\t\n\t\t\twhile(true){\n\t\t\t\tif(a%b==0){\n\t\t\t\t\tSystem.out.print(b+\" \");\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tint tmp = a%b;\n\t\t\t\ta = b;\n\t\t\t\tb = tmp;\n\t\t\t}\n\t\t\t\n\t\t\tfunc(c,d);\n\t\t\t\n\t\t}\n\t}\n\t\n\tstatic void func(int a,int b){\n\t\tint ans = 1;\n\t\tint i = 2;\n\t\t\n\t\twhile(a*b!=1){\n\t\t\tint count_a = 0;\n\t\t\tint count_b = 0;\n\t\t\twhile(a%i==0){\n\t\t\t\tcount_a++;\n\t\t\t\ta = a/i;\n\t\t\t}\n\t\t\twhile(b%i==0){\n\t\t\t\tcount_b++;\n\t\t\t\tb = b/i;\n\t\t\t}\n\t\t\tint t = Math.max(count_a, count_b);\n\t\t\tans = ans*(int)Math.pow(i,Math.max(count_a, count_b));\n\t\t\ti++;\n\t\t}\n\t\t\n\t\tSystem.out.println(ans);\n\t}\n}",
"Main"
] |
import java.util.Scanner;
public class Main {
public static void main(String[] args){
Scanner stdIn = new Scanner(System.in);
while(stdIn.hasNext()){
int a = stdIn.nextInt();
int b = stdIn.nextInt();
int c = a;
int d = b;
if(a<b){
int tmp = b;
b = a;
a = tmp;
}
while(true){
if(a%b==0){
System.out.print(b+" ");
break;
}
int tmp = a%b;
a = b;
b = tmp;
}
func(c,d);
}
}
static void func(int a,int b){
int ans = 1;
int i = 2;
while(a*b!=1){
int count_a = 0;
int count_b = 0;
while(a%i==0){
count_a++;
a = a/i;
}
while(b%i==0){
count_b++;
b = b/i;
}
int t = Math.max(count_a, count_b);
ans = ans*(int)Math.pow(i,Math.max(count_a, count_b));
i++;
}
System.out.println(ans);
}
} |
[
7,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
11,
1,
41,
13,
17,
2,
13,
2,
4,
18,
13,
17,
1,
40,
13,
30,
30,
41,
13,
41,
13,
41,
13,
41,
13,
41,
13,
41,
13,
0,
13,
17,
0,
13,
17,
14,
2,
4,
18,
13,
2,
13,
17,
4,
18,
13,
2,
2,
13,
17,
17,
30,
0,
13,
4,
18,
13,
2,
13,
17,
0,
13,
4,
18,
13,
2,
2,
13,
17,
17,
0,
13,
13,
0,
13,
13,
30,
0,
13,
4,
18,
13,
2,
2,
13,
17,
17,
0,
13,
4,
18,
13,
2,
13,
17,
0,
13,
13,
0,
13,
13,
0,
13,
2,
13,
13,
42,
2,
13,
17,
30,
0,
13,
13,
0,
13,
13,
0,
13,
2,
13,
13,
4,
18,
13,
13,
0,
13,
2,
2,
13,
13,
13,
4,
18,
13,
13,
29,
13,
23,
13,
12,
13,
30,
41,
13,
41,
13,
41,
13,
41,
13,
11,
1,
41,
13,
17,
2,
13,
2,
4,
18,
13,
17,
1,
40,
13,
30,
30,
0,
13,
4,
18,
13,
2,
13,
17,
0,
13,
4,
18,
13,
2,
2,
13,
17,
17,
4,
18,
18,
13,
13,
2,
2,
13,
17,
13,
23,
13,
12,
13,
30,
41,
13,
20,
41,
13,
20,
41,
13,
42,
4,
18,
13,
30,
41,
13,
4,
18,
13,
0,
13,
4,
18,
4,
18,
13,
13,
4,
18,
13,
13,
41,
13,
20,
0,
13,
4,
13,
13,
4,
13,
13,
23,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
9,
10
],
[
9,
11
],
[
11,
12
],
[
12,
13
],
[
12,
14
],
[
11,
15
],
[
15,
16
],
[
16,
17
],
[
17,
18
],
[
17,
19
],
[
15,
20
],
[
20,
21
],
[
20,
22
],
[
22,
23
],
[
23,
24
],
[
24,
25
],
[
22,
26
],
[
15,
27
],
[
27,
28
],
[
28,
29
],
[
15,
30
],
[
31,
31
],
[
31,
32
],
[
32,
33
],
[
31,
34
],
[
34,
35
],
[
31,
36
],
[
36,
37
],
[
31,
38
],
[
38,
39
],
[
31,
40
],
[
40,
41
],
[
31,
42
],
[
42,
43
],
[
31,
44
],
[
44,
45
],
[
44,
46
],
[
31,
47
],
[
47,
48
],
[
47,
49
],
[
31,
50
],
[
50,
51
],
[
51,
52
],
[
52,
53
],
[
53,
54
],
[
52,
55
],
[
55,
56
],
[
55,
57
],
[
51,
58
],
[
58,
59
],
[
59,
60
],
[
58,
61
],
[
61,
62
],
[
62,
63
],
[
62,
64
],
[
61,
65
],
[
50,
66
],
[
66,
67
],
[
67,
68
],
[
67,
69
],
[
69,
70
],
[
70,
71
],
[
69,
72
],
[
72,
73
],
[
72,
74
],
[
66,
75
],
[
75,
76
],
[
75,
77
],
[
77,
78
],
[
78,
79
],
[
77,
80
],
[
80,
81
],
[
81,
82
],
[
81,
83
],
[
80,
84
],
[
66,
85
],
[
85,
86
],
[
85,
87
],
[
66,
88
],
[
88,
89
],
[
88,
90
],
[
50,
91
],
[
91,
92
],
[
92,
93
],
[
92,
94
],
[
94,
95
],
[
95,
96
],
[
94,
97
],
[
97,
98
],
[
98,
99
],
[
98,
100
],
[
97,
101
],
[
91,
102
],
[
102,
103
],
[
102,
104
],
[
104,
105
],
[
105,
106
],
[
104,
107
],
[
107,
108
],
[
107,
109
],
[
91,
110
],
[
110,
111
],
[
110,
112
],
[
91,
113
],
[
113,
114
],
[
113,
115
],
[
31,
116
],
[
116,
117
],
[
116,
118
],
[
118,
119
],
[
118,
120
],
[
31,
121
],
[
121,
122
],
[
122,
123
],
[
122,
124
],
[
121,
125
],
[
125,
126
],
[
126,
127
],
[
126,
128
],
[
125,
129
],
[
129,
130
],
[
129,
131
],
[
125,
132
],
[
132,
133
],
[
132,
134
],
[
134,
135
],
[
134,
136
],
[
31,
137
],
[
137,
138
],
[
138,
139
],
[
137,
140
],
[
31,
141
],
[
141,
142
],
[
141,
143
],
[
143,
144
],
[
144,
145
],
[
144,
146
],
[
143,
147
],
[
31,
148
],
[
148,
149
],
[
149,
150
],
[
148,
151
],
[
11,
152
],
[
152,
153
],
[
9,
154
],
[
154,
155
],
[
7,
156
],
[
156,
157
],
[
156,
158
],
[
158,
159
],
[
159,
160
],
[
158,
161
],
[
161,
162
],
[
158,
163
],
[
163,
164
],
[
158,
165
],
[
165,
166
],
[
158,
167
],
[
167,
168
],
[
168,
169
],
[
169,
170
],
[
169,
171
],
[
167,
172
],
[
172,
173
],
[
172,
174
],
[
174,
175
],
[
175,
176
],
[
176,
177
],
[
174,
178
],
[
167,
179
],
[
179,
180
],
[
180,
181
],
[
167,
182
],
[
183,
183
],
[
183,
184
],
[
184,
185
],
[
184,
186
],
[
186,
187
],
[
187,
188
],
[
186,
189
],
[
189,
190
],
[
189,
191
],
[
183,
192
],
[
192,
193
],
[
192,
194
],
[
194,
195
],
[
195,
196
],
[
194,
197
],
[
197,
198
],
[
198,
199
],
[
198,
200
],
[
197,
201
],
[
183,
202
],
[
202,
203
],
[
203,
204
],
[
204,
205
],
[
204,
206
],
[
202,
207
],
[
208,
208
],
[
208,
209
],
[
208,
210
],
[
208,
211
],
[
156,
212
],
[
212,
213
],
[
7,
214
],
[
214,
215
],
[
214,
216
],
[
216,
217
],
[
217,
218
],
[
217,
219
],
[
216,
220
],
[
220,
221
],
[
220,
222
],
[
216,
223
],
[
223,
224
],
[
216,
225
],
[
225,
226
],
[
226,
227
],
[
227,
228
],
[
225,
229
],
[
229,
230
],
[
230,
231
],
[
230,
232
],
[
232,
233
],
[
233,
234
],
[
229,
235
],
[
235,
236
],
[
235,
237
],
[
237,
238
],
[
238,
239
],
[
239,
240
],
[
240,
241
],
[
239,
242
],
[
229,
243
],
[
243,
244
],
[
244,
245
],
[
243,
246
],
[
216,
247
],
[
247,
248
],
[
247,
249
],
[
216,
250
],
[
250,
251
],
[
250,
252
],
[
252,
253
],
[
252,
254
],
[
216,
255
],
[
255,
256
],
[
255,
257
],
[
214,
258
],
[
258,
259
]
] | [
"import java.io.*;\n\nimport java.util.*;\n\n\n\nclass Main{\n\n\tprivate static ArrayList<Integer> calc_gcd_lcm(ArrayList<Integer> a){\n\n\t\tArrayList<Integer> b = new ArrayList<Integer>();\n\n\t\t\t\t\n\n\t\tfor(int i = 0;i<a.size()/2;i++){\n\n\t\t\t\n\n\t\t\tint x,y,x1,y1,j,k;\n\t\t\tx1 = 0;\n\t\t\ty1 = 0;\n\n\t\t\tif(a.get(i*2) > a.get(i*2+1)){\n\t\t\t\tx = a.get(i*2);\n\t\t\t\ty = a.get(i*2+1);\n\t\t\t\tx1 = x;\n\t\t\t\ty1 = y;\n\t\t\t}\n\t\t\telse{\n\t\t\t\tx = a.get(i*2+1);\n\t\t\t\ty = a.get(i*2);\n\t\t\t\tx1 = x;\n\t\t\t\ty1 = y;\n\t\t\t}\n\n\t\t\tj = x1%y1;\n\t\t\t\n\t\t\twhile(j != 0){\n\t\t\t\tx1 = y1;\n\t\t\t\ty1 = j;\n\t\t\t\tj = x1%y1;\n\t\t\t}\n\t\t\tb.add(y1);\n\t\t\tk = x/y1*y;\n\t\t\tb.add(k);\n\n\t\t\t\n\n\t\t\t}\n\n\t\treturn b;\n\n\t}\n\n\tprivate static void print_calc(ArrayList<Integer> a){\n\n\t\tString str1,str2;\n\n\t\tint x,y;\n\n\t\t\n\n\t\tfor(int i = 0;i<a.size()/2;i++){\t\n\n\t\t\t\n\n\t\t\tx = a.get(i*2);\n\n\t\t\ty = a.get(i*2+1);\n\n\t\t\t\n\n\t\t\tSystem.out.println( x + \" \" + y );\n\n\t\t\t\n\n\t\t}\n\n\t}\n\n\t\tpublic static void main(String args[]) throws IOException{\n\n\t\t\tArrayList<Integer> val = new ArrayList<Integer>();\n\n\t\t\tScanner scan = new Scanner(System.in);\n\n\t\t\tint n;\n\n\t\t\t\n\n\t\t\twhile(scan.hasNext()){\n\n\t\t\t\t\tString str1 = scan.next();\n\t\t\t\t\tn = Integer.valueOf(str1).intValue(); \n\n\t\t\t\t\tval.add(n);\n\n\t\t\t}\n\n\t\t\t\t\t\t\n\n\t\t\t\n\n\t\t\tArrayList<Integer> res = new ArrayList<Integer>();\n\n\t\t\tres = calc_gcd_lcm(val);\n\n\t\t\tprint_calc(res);\n\n\t}\n\n}",
"import java.io.*;",
"io.*",
"java",
"import java.util.*;",
"util.*",
"java",
"class Main{\n\n\tprivate static ArrayList<Integer> calc_gcd_lcm(ArrayList<Integer> a){\n\n\t\tArrayList<Integer> b = new ArrayList<Integer>();\n\n\t\t\t\t\n\n\t\tfor(int i = 0;i<a.size()/2;i++){\n\n\t\t\t\n\n\t\t\tint x,y,x1,y1,j,k;\n\t\t\tx1 = 0;\n\t\t\ty1 = 0;\n\n\t\t\tif(a.get(i*2) > a.get(i*2+1)){\n\t\t\t\tx = a.get(i*2);\n\t\t\t\ty = a.get(i*2+1);\n\t\t\t\tx1 = x;\n\t\t\t\ty1 = y;\n\t\t\t}\n\t\t\telse{\n\t\t\t\tx = a.get(i*2+1);\n\t\t\t\ty = a.get(i*2);\n\t\t\t\tx1 = x;\n\t\t\t\ty1 = y;\n\t\t\t}\n\n\t\t\tj = x1%y1;\n\t\t\t\n\t\t\twhile(j != 0){\n\t\t\t\tx1 = y1;\n\t\t\t\ty1 = j;\n\t\t\t\tj = x1%y1;\n\t\t\t}\n\t\t\tb.add(y1);\n\t\t\tk = x/y1*y;\n\t\t\tb.add(k);\n\n\t\t\t\n\n\t\t\t}\n\n\t\treturn b;\n\n\t}\n\n\tprivate static void print_calc(ArrayList<Integer> a){\n\n\t\tString str1,str2;\n\n\t\tint x,y;\n\n\t\t\n\n\t\tfor(int i = 0;i<a.size()/2;i++){\t\n\n\t\t\t\n\n\t\t\tx = a.get(i*2);\n\n\t\t\ty = a.get(i*2+1);\n\n\t\t\t\n\n\t\t\tSystem.out.println( x + \" \" + y );\n\n\t\t\t\n\n\t\t}\n\n\t}\n\n\t\tpublic static void main(String args[]) throws IOException{\n\n\t\t\tArrayList<Integer> val = new ArrayList<Integer>();\n\n\t\t\tScanner scan = new Scanner(System.in);\n\n\t\t\tint n;\n\n\t\t\t\n\n\t\t\twhile(scan.hasNext()){\n\n\t\t\t\t\tString str1 = scan.next();\n\t\t\t\t\tn = Integer.valueOf(str1).intValue(); \n\n\t\t\t\t\tval.add(n);\n\n\t\t\t}\n\n\t\t\t\t\t\t\n\n\t\t\t\n\n\t\t\tArrayList<Integer> res = new ArrayList<Integer>();\n\n\t\t\tres = calc_gcd_lcm(val);\n\n\t\t\tprint_calc(res);\n\n\t}\n\n}",
"Main",
"private static ArrayList<Integer> calc_gcd_lcm(ArrayList<Integer> a){\n\n\t\tArrayList<Integer> b = new ArrayList<Integer>();\n\n\t\t\t\t\n\n\t\tfor(int i = 0;i<a.size()/2;i++){\n\n\t\t\t\n\n\t\t\tint x,y,x1,y1,j,k;\n\t\t\tx1 = 0;\n\t\t\ty1 = 0;\n\n\t\t\tif(a.get(i*2) > a.get(i*2+1)){\n\t\t\t\tx = a.get(i*2);\n\t\t\t\ty = a.get(i*2+1);\n\t\t\t\tx1 = x;\n\t\t\t\ty1 = y;\n\t\t\t}\n\t\t\telse{\n\t\t\t\tx = a.get(i*2+1);\n\t\t\t\ty = a.get(i*2);\n\t\t\t\tx1 = x;\n\t\t\t\ty1 = y;\n\t\t\t}\n\n\t\t\tj = x1%y1;\n\t\t\t\n\t\t\twhile(j != 0){\n\t\t\t\tx1 = y1;\n\t\t\t\ty1 = j;\n\t\t\t\tj = x1%y1;\n\t\t\t}\n\t\t\tb.add(y1);\n\t\t\tk = x/y1*y;\n\t\t\tb.add(k);\n\n\t\t\t\n\n\t\t\t}\n\n\t\treturn b;\n\n\t}",
"calc_gcd_lcm",
"{\n\n\t\tArrayList<Integer> b = new ArrayList<Integer>();\n\n\t\t\t\t\n\n\t\tfor(int i = 0;i<a.size()/2;i++){\n\n\t\t\t\n\n\t\t\tint x,y,x1,y1,j,k;\n\t\t\tx1 = 0;\n\t\t\ty1 = 0;\n\n\t\t\tif(a.get(i*2) > a.get(i*2+1)){\n\t\t\t\tx = a.get(i*2);\n\t\t\t\ty = a.get(i*2+1);\n\t\t\t\tx1 = x;\n\t\t\t\ty1 = y;\n\t\t\t}\n\t\t\telse{\n\t\t\t\tx = a.get(i*2+1);\n\t\t\t\ty = a.get(i*2);\n\t\t\t\tx1 = x;\n\t\t\t\ty1 = y;\n\t\t\t}\n\n\t\t\tj = x1%y1;\n\t\t\t\n\t\t\twhile(j != 0){\n\t\t\t\tx1 = y1;\n\t\t\t\ty1 = j;\n\t\t\t\tj = x1%y1;\n\t\t\t}\n\t\t\tb.add(y1);\n\t\t\tk = x/y1*y;\n\t\t\tb.add(k);\n\n\t\t\t\n\n\t\t\t}\n\n\t\treturn b;\n\n\t}",
"ArrayList<Integer> b = new ArrayList<Integer>();",
"b",
"new ArrayList<Integer>()",
"for(int i = 0;i<a.size()/2;i++){\n\n\t\t\t\n\n\t\t\tint x,y,x1,y1,j,k;\n\t\t\tx1 = 0;\n\t\t\ty1 = 0;\n\n\t\t\tif(a.get(i*2) > a.get(i*2+1)){\n\t\t\t\tx = a.get(i*2);\n\t\t\t\ty = a.get(i*2+1);\n\t\t\t\tx1 = x;\n\t\t\t\ty1 = y;\n\t\t\t}\n\t\t\telse{\n\t\t\t\tx = a.get(i*2+1);\n\t\t\t\ty = a.get(i*2);\n\t\t\t\tx1 = x;\n\t\t\t\ty1 = y;\n\t\t\t}\n\n\t\t\tj = x1%y1;\n\t\t\t\n\t\t\twhile(j != 0){\n\t\t\t\tx1 = y1;\n\t\t\t\ty1 = j;\n\t\t\t\tj = x1%y1;\n\t\t\t}\n\t\t\tb.add(y1);\n\t\t\tk = x/y1*y;\n\t\t\tb.add(k);\n\n\t\t\t\n\n\t\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i<a.size()/2",
"i",
"a.size()/2",
"a.size()",
"a.size",
"a",
"2",
"i++",
"i++",
"i",
"{\n\n\t\t\t\n\n\t\t\tint x,y,x1,y1,j,k;\n\t\t\tx1 = 0;\n\t\t\ty1 = 0;\n\n\t\t\tif(a.get(i*2) > a.get(i*2+1)){\n\t\t\t\tx = a.get(i*2);\n\t\t\t\ty = a.get(i*2+1);\n\t\t\t\tx1 = x;\n\t\t\t\ty1 = y;\n\t\t\t}\n\t\t\telse{\n\t\t\t\tx = a.get(i*2+1);\n\t\t\t\ty = a.get(i*2);\n\t\t\t\tx1 = x;\n\t\t\t\ty1 = y;\n\t\t\t}\n\n\t\t\tj = x1%y1;\n\t\t\t\n\t\t\twhile(j != 0){\n\t\t\t\tx1 = y1;\n\t\t\t\ty1 = j;\n\t\t\t\tj = x1%y1;\n\t\t\t}\n\t\t\tb.add(y1);\n\t\t\tk = x/y1*y;\n\t\t\tb.add(k);\n\n\t\t\t\n\n\t\t\t}",
"{\n\n\t\t\t\n\n\t\t\tint x,y,x1,y1,j,k;\n\t\t\tx1 = 0;\n\t\t\ty1 = 0;\n\n\t\t\tif(a.get(i*2) > a.get(i*2+1)){\n\t\t\t\tx = a.get(i*2);\n\t\t\t\ty = a.get(i*2+1);\n\t\t\t\tx1 = x;\n\t\t\t\ty1 = y;\n\t\t\t}\n\t\t\telse{\n\t\t\t\tx = a.get(i*2+1);\n\t\t\t\ty = a.get(i*2);\n\t\t\t\tx1 = x;\n\t\t\t\ty1 = y;\n\t\t\t}\n\n\t\t\tj = x1%y1;\n\t\t\t\n\t\t\twhile(j != 0){\n\t\t\t\tx1 = y1;\n\t\t\t\ty1 = j;\n\t\t\t\tj = x1%y1;\n\t\t\t}\n\t\t\tb.add(y1);\n\t\t\tk = x/y1*y;\n\t\t\tb.add(k);\n\n\t\t\t\n\n\t\t\t}",
"int x",
"x",
"y",
"y",
"x1",
"x1",
"y1",
"y1",
"j",
"j",
"k;",
"k",
"x1 = 0",
"x1",
"0",
"y1 = 0",
"y1",
"0",
"if(a.get(i*2) > a.get(i*2+1)){\n\t\t\t\tx = a.get(i*2);\n\t\t\t\ty = a.get(i*2+1);\n\t\t\t\tx1 = x;\n\t\t\t\ty1 = y;\n\t\t\t}\n\t\t\telse{\n\t\t\t\tx = a.get(i*2+1);\n\t\t\t\ty = a.get(i*2);\n\t\t\t\tx1 = x;\n\t\t\t\ty1 = y;\n\t\t\t}",
"a.get(i*2) > a.get(i*2+1)",
"a.get(i*2)",
"a.get",
"a",
"i*2",
"i",
"2",
"a.get(i*2+1)",
"a.get",
"a",
"i*2+1",
"i*2",
"i",
"2",
"1",
"{\n\t\t\t\tx = a.get(i*2);\n\t\t\t\ty = a.get(i*2+1);\n\t\t\t\tx1 = x;\n\t\t\t\ty1 = y;\n\t\t\t}",
"x = a.get(i*2)",
"x",
"a.get(i*2)",
"a.get",
"a",
"i*2",
"i",
"2",
"y = a.get(i*2+1)",
"y",
"a.get(i*2+1)",
"a.get",
"a",
"i*2+1",
"i*2",
"i",
"2",
"1",
"x1 = x",
"x1",
"x",
"y1 = y",
"y1",
"y",
"{\n\t\t\t\tx = a.get(i*2+1);\n\t\t\t\ty = a.get(i*2);\n\t\t\t\tx1 = x;\n\t\t\t\ty1 = y;\n\t\t\t}",
"x = a.get(i*2+1)",
"x",
"a.get(i*2+1)",
"a.get",
"a",
"i*2+1",
"i*2",
"i",
"2",
"1",
"y = a.get(i*2)",
"y",
"a.get(i*2)",
"a.get",
"a",
"i*2",
"i",
"2",
"x1 = x",
"x1",
"x",
"y1 = y",
"y1",
"y",
"j = x1%y1",
"j",
"x1%y1",
"x1",
"y1",
"while(j != 0){\n\t\t\t\tx1 = y1;\n\t\t\t\ty1 = j;\n\t\t\t\tj = x1%y1;\n\t\t\t}",
"j != 0",
"j",
"0",
"{\n\t\t\t\tx1 = y1;\n\t\t\t\ty1 = j;\n\t\t\t\tj = x1%y1;\n\t\t\t}",
"x1 = y1",
"x1",
"y1",
"y1 = j",
"y1",
"j",
"j = x1%y1",
"j",
"x1%y1",
"x1",
"y1",
"b.add(y1)",
"b.add",
"b",
"y1",
"k = x/y1*y",
"k",
"x/y1*y",
"x/y1",
"x",
"y1",
"y",
"b.add(k)",
"b.add",
"b",
"k",
"return b;",
"b",
"ArrayList<Integer> a",
"a",
"private static void print_calc(ArrayList<Integer> a){\n\n\t\tString str1,str2;\n\n\t\tint x,y;\n\n\t\t\n\n\t\tfor(int i = 0;i<a.size()/2;i++){\t\n\n\t\t\t\n\n\t\t\tx = a.get(i*2);\n\n\t\t\ty = a.get(i*2+1);\n\n\t\t\t\n\n\t\t\tSystem.out.println( x + \" \" + y );\n\n\t\t\t\n\n\t\t}\n\n\t}",
"print_calc",
"{\n\n\t\tString str1,str2;\n\n\t\tint x,y;\n\n\t\t\n\n\t\tfor(int i = 0;i<a.size()/2;i++){\t\n\n\t\t\t\n\n\t\t\tx = a.get(i*2);\n\n\t\t\ty = a.get(i*2+1);\n\n\t\t\t\n\n\t\t\tSystem.out.println( x + \" \" + y );\n\n\t\t\t\n\n\t\t}\n\n\t}",
"String str1",
"str1",
"str2;",
"str2",
"int x",
"x",
"y;",
"y",
"for(int i = 0;i<a.size()/2;i++){\t\n\n\t\t\t\n\n\t\t\tx = a.get(i*2);\n\n\t\t\ty = a.get(i*2+1);\n\n\t\t\t\n\n\t\t\tSystem.out.println( x + \" \" + y );\n\n\t\t\t\n\n\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i<a.size()/2",
"i",
"a.size()/2",
"a.size()",
"a.size",
"a",
"2",
"i++",
"i++",
"i",
"{\t\n\n\t\t\t\n\n\t\t\tx = a.get(i*2);\n\n\t\t\ty = a.get(i*2+1);\n\n\t\t\t\n\n\t\t\tSystem.out.println( x + \" \" + y );\n\n\t\t\t\n\n\t\t}",
"{\t\n\n\t\t\t\n\n\t\t\tx = a.get(i*2);\n\n\t\t\ty = a.get(i*2+1);\n\n\t\t\t\n\n\t\t\tSystem.out.println( x + \" \" + y );\n\n\t\t\t\n\n\t\t}",
"x = a.get(i*2)",
"x",
"a.get(i*2)",
"a.get",
"a",
"i*2",
"i",
"2",
"y = a.get(i*2+1)",
"y",
"a.get(i*2+1)",
"a.get",
"a",
"i*2+1",
"i*2",
"i",
"2",
"1",
"System.out.println( x + \" \" + y )",
"System.out.println",
"System.out",
"System",
"System.out",
"x + \" \" + y",
"x + \" \" + y",
"x",
"\" \"",
"y",
"ArrayList<Integer> a",
"a",
"public static void main(String args[]) throws IOException{\n\n\t\t\tArrayList<Integer> val = new ArrayList<Integer>();\n\n\t\t\tScanner scan = new Scanner(System.in);\n\n\t\t\tint n;\n\n\t\t\t\n\n\t\t\twhile(scan.hasNext()){\n\n\t\t\t\t\tString str1 = scan.next();\n\t\t\t\t\tn = Integer.valueOf(str1).intValue(); \n\n\t\t\t\t\tval.add(n);\n\n\t\t\t}\n\n\t\t\t\t\t\t\n\n\t\t\t\n\n\t\t\tArrayList<Integer> res = new ArrayList<Integer>();\n\n\t\t\tres = calc_gcd_lcm(val);\n\n\t\t\tprint_calc(res);\n\n\t}",
"main",
"{\n\n\t\t\tArrayList<Integer> val = new ArrayList<Integer>();\n\n\t\t\tScanner scan = new Scanner(System.in);\n\n\t\t\tint n;\n\n\t\t\t\n\n\t\t\twhile(scan.hasNext()){\n\n\t\t\t\t\tString str1 = scan.next();\n\t\t\t\t\tn = Integer.valueOf(str1).intValue(); \n\n\t\t\t\t\tval.add(n);\n\n\t\t\t}\n\n\t\t\t\t\t\t\n\n\t\t\t\n\n\t\t\tArrayList<Integer> res = new ArrayList<Integer>();\n\n\t\t\tres = calc_gcd_lcm(val);\n\n\t\t\tprint_calc(res);\n\n\t}",
"ArrayList<Integer> val = new ArrayList<Integer>();",
"val",
"new ArrayList<Integer>()",
"Scanner scan = new Scanner(System.in);",
"scan",
"new Scanner(System.in)",
"int n;",
"n",
"while(scan.hasNext()){\n\n\t\t\t\t\tString str1 = scan.next();\n\t\t\t\t\tn = Integer.valueOf(str1).intValue(); \n\n\t\t\t\t\tval.add(n);\n\n\t\t\t}",
"scan.hasNext()",
"scan.hasNext",
"scan",
"{\n\n\t\t\t\t\tString str1 = scan.next();\n\t\t\t\t\tn = Integer.valueOf(str1).intValue(); \n\n\t\t\t\t\tval.add(n);\n\n\t\t\t}",
"String str1 = scan.next();",
"str1",
"scan.next()",
"scan.next",
"scan",
"n = Integer.valueOf(str1).intValue()",
"n",
"Integer.valueOf(str1).intValue()",
"Integer.valueOf(str1).intValue",
"Integer.valueOf(str1)",
"Integer.valueOf",
"Integer",
"str1",
"val.add(n)",
"val.add",
"val",
"n",
"ArrayList<Integer> res = new ArrayList<Integer>();",
"res",
"new ArrayList<Integer>()",
"res = calc_gcd_lcm(val)",
"res",
"calc_gcd_lcm(val)",
"calc_gcd_lcm",
"val",
"print_calc(res)",
"print_calc",
"res",
"String args[]",
"args"
] | import java.io.*;
import java.util.*;
class Main{
private static ArrayList<Integer> calc_gcd_lcm(ArrayList<Integer> a){
ArrayList<Integer> b = new ArrayList<Integer>();
for(int i = 0;i<a.size()/2;i++){
int x,y,x1,y1,j,k;
x1 = 0;
y1 = 0;
if(a.get(i*2) > a.get(i*2+1)){
x = a.get(i*2);
y = a.get(i*2+1);
x1 = x;
y1 = y;
}
else{
x = a.get(i*2+1);
y = a.get(i*2);
x1 = x;
y1 = y;
}
j = x1%y1;
while(j != 0){
x1 = y1;
y1 = j;
j = x1%y1;
}
b.add(y1);
k = x/y1*y;
b.add(k);
}
return b;
}
private static void print_calc(ArrayList<Integer> a){
String str1,str2;
int x,y;
for(int i = 0;i<a.size()/2;i++){
x = a.get(i*2);
y = a.get(i*2+1);
System.out.println( x + " " + y );
}
}
public static void main(String args[]) throws IOException{
ArrayList<Integer> val = new ArrayList<Integer>();
Scanner scan = new Scanner(System.in);
int n;
while(scan.hasNext()){
String str1 = scan.next();
n = Integer.valueOf(str1).intValue();
val.add(n);
}
ArrayList<Integer> res = new ArrayList<Integer>();
res = calc_gcd_lcm(val);
print_calc(res);
}
} |
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
17,
41,
13,
41,
13,
14,
2,
13,
13,
30,
0,
13,
13,
0,
13,
13,
30,
0,
13,
13,
0,
13,
13,
14,
2,
2,
13,
13,
17,
30,
29,
13,
11,
1,
41,
13,
17,
2,
13,
2,
4,
18,
13,
13,
17,
1,
40,
13,
30,
30,
14,
2,
2,
13,
13,
17,
30,
14,
2,
2,
13,
13,
17,
30,
14,
2,
13,
13,
0,
13,
13,
41,
13,
2,
13,
13,
14,
2,
2,
13,
13,
17,
30,
14,
2,
13,
13,
0,
13,
13,
29,
13,
23,
13,
23,
13,
12,
13,
30,
41,
13,
17,
41,
13,
41,
13,
14,
2,
13,
13,
30,
0,
13,
13,
0,
13,
13,
30,
0,
13,
13,
0,
13,
13,
41,
13,
17,
42,
2,
13,
17,
30,
14,
2,
2,
2,
13,
13,
13,
17,
30,
0,
13,
2,
13,
13,
40,
13,
29,
13,
23,
13,
23,
13,
12,
13,
30,
41,
13,
20,
41,
13,
42,
2,
0,
13,
4,
18,
13,
17,
30,
41,
13,
4,
18,
13,
17,
41,
13,
39,
4,
18,
13,
18,
13,
17,
4,
18,
13,
18,
13,
17,
41,
13,
4,
13,
18,
13,
17,
18,
13,
17,
41,
13,
4,
13,
18,
13,
17,
18,
13,
17,
4,
18,
18,
13,
13,
2,
2,
13,
17,
13,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
236,
5
],
[
236,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
8,
14
],
[
14,
15
],
[
8,
16
],
[
16,
17
],
[
17,
18
],
[
17,
19
],
[
16,
20
],
[
20,
21
],
[
21,
22
],
[
21,
23
],
[
20,
24
],
[
24,
25
],
[
24,
26
],
[
16,
27
],
[
27,
28
],
[
28,
29
],
[
28,
30
],
[
27,
31
],
[
31,
32
],
[
31,
33
],
[
8,
34
],
[
34,
35
],
[
35,
36
],
[
36,
37
],
[
36,
38
],
[
35,
39
],
[
34,
40
],
[
40,
41
],
[
41,
42
],
[
8,
43
],
[
43,
44
],
[
44,
45
],
[
45,
46
],
[
45,
47
],
[
43,
48
],
[
48,
49
],
[
48,
50
],
[
50,
51
],
[
51,
52
],
[
52,
53
],
[
51,
54
],
[
50,
55
],
[
43,
56
],
[
56,
57
],
[
57,
58
],
[
43,
59
],
[
60,
60
],
[
60,
61
],
[
61,
62
],
[
62,
63
],
[
63,
64
],
[
63,
65
],
[
62,
66
],
[
61,
67
],
[
67,
68
],
[
68,
69
],
[
69,
70
],
[
70,
71
],
[
70,
72
],
[
69,
73
],
[
68,
74
],
[
74,
75
],
[
75,
76
],
[
76,
77
],
[
76,
78
],
[
75,
79
],
[
79,
80
],
[
79,
81
],
[
67,
82
],
[
82,
83
],
[
82,
84
],
[
84,
85
],
[
84,
86
],
[
67,
87
],
[
87,
88
],
[
88,
89
],
[
89,
90
],
[
89,
91
],
[
88,
92
],
[
87,
93
],
[
93,
94
],
[
94,
95
],
[
95,
96
],
[
95,
97
],
[
94,
98
],
[
98,
99
],
[
98,
100
],
[
8,
101
],
[
101,
102
],
[
6,
103
],
[
103,
104
],
[
6,
105
],
[
105,
106
],
[
236,
107
],
[
107,
108
],
[
107,
109
],
[
109,
110
],
[
110,
111
],
[
110,
112
],
[
109,
113
],
[
113,
114
],
[
109,
115
],
[
115,
116
],
[
109,
117
],
[
117,
118
],
[
118,
119
],
[
118,
120
],
[
117,
121
],
[
121,
122
],
[
122,
123
],
[
122,
124
],
[
121,
125
],
[
125,
126
],
[
125,
127
],
[
117,
128
],
[
128,
129
],
[
129,
130
],
[
129,
131
],
[
128,
132
],
[
132,
133
],
[
132,
134
],
[
109,
135
],
[
135,
136
],
[
135,
137
],
[
109,
138
],
[
138,
139
],
[
139,
140
],
[
139,
141
],
[
138,
142
],
[
142,
143
],
[
143,
144
],
[
144,
145
],
[
145,
146
],
[
146,
147
],
[
146,
148
],
[
145,
149
],
[
144,
150
],
[
143,
151
],
[
151,
152
],
[
152,
153
],
[
152,
154
],
[
154,
155
],
[
154,
156
],
[
142,
157
],
[
157,
158
],
[
109,
159
],
[
159,
160
],
[
107,
161
],
[
161,
162
],
[
107,
163
],
[
163,
164
],
[
236,
165
],
[
165,
166
],
[
165,
167
],
[
167,
168
],
[
168,
169
],
[
168,
170
],
[
167,
171
],
[
171,
172
],
[
167,
173
],
[
173,
174
],
[
174,
175
],
[
175,
176
],
[
175,
177
],
[
177,
178
],
[
178,
179
],
[
174,
180
],
[
173,
181
],
[
181,
182
],
[
182,
183
],
[
182,
184
],
[
184,
185
],
[
185,
186
],
[
184,
187
],
[
181,
188
],
[
188,
189
],
[
188,
190
],
[
190,
191
],
[
191,
192
],
[
192,
193
],
[
191,
194
],
[
194,
195
],
[
194,
196
],
[
190,
197
],
[
197,
198
],
[
198,
199
],
[
197,
200
],
[
200,
201
],
[
200,
202
],
[
181,
203
],
[
203,
204
],
[
203,
205
],
[
205,
206
],
[
205,
207
],
[
207,
208
],
[
207,
209
],
[
205,
210
],
[
210,
211
],
[
210,
212
],
[
181,
213
],
[
213,
214
],
[
213,
215
],
[
215,
216
],
[
215,
217
],
[
217,
218
],
[
217,
219
],
[
215,
220
],
[
220,
221
],
[
220,
222
],
[
181,
223
],
[
223,
224
],
[
224,
225
],
[
225,
226
],
[
225,
227
],
[
223,
228
],
[
229,
229
],
[
229,
230
],
[
229,
231
],
[
229,
232
],
[
165,
233
],
[
233,
234
],
[
0,
235
],
[
235,
236
],
[
235,
237
]
] | [
"import java.io.*;\n\npublic class Main{\n\t\n\tpublic static long findGcd(long f1, long f2){\n\t\tlong gcd = 1;\n\t\tlong max, min;\n\t\tif(f1 > f2){max = f1; min = f2;}\n\t\telse{max = f2; min = f1;}\n\t\t\n\t\tif(max % min == 0){\n\t\t\treturn min;\n\t\t}\n\t\t\n\t\tfor(long i=1; i<(long)(Math.sqrt(min)+1); i++){\n\t\t\tif((min % i) == 0){\n\t\t\t\tif((max % i) == 0){\n\t\t\t\t\tif(gcd < i)gcd = i;\n\t\t\t\t}\n\t\t\t\tlong tmp = min/i;\n\t\t\t\tif((max % tmp) == 0){\n\t\t\t\t\tif(gcd < tmp)gcd = tmp;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn gcd;\n\t}\n\t\n\t\n\tpublic static long findlcm(long f1, long f2){\n\t\tlong lcm = 0;\n\t\tlong max, min;\n\t\tif(f1 > f2){max = f1; min = f2;}\n\t\telse{max = f2; min = f1;}\n\t\tlong i=1;\n\t\twhile(lcm == 0){\n\t\t\tif((max * i)%min == 0){\n\t\t\t\tlcm = max * i;\n\t\t\t}\n\t\t\ti++;\n\t\t}\n\t\treturn lcm;\n\t}\n\t\n\t/*\n\t//最大公約数を求めるメソッド\n static long findGcd(long x, long y){\n if(x%y==0){\n return y;\n }else{\n long m = 1;\n while(m!=0){\n m = y%x;\n y = x;\n x = m;\n }\n return y;\n }\n }\n */\n\t\n\tpublic static void main(String[] argv) throws NumberFormatException, IOException{\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\t\tString line;\n\t\twhile((line = br.readLine()) != null){\n\t\t\tString[] lineArray = line.split(\" \");\n\t\t\tlong[] factor = {Long.parseLong(lineArray[0]), Long.parseLong(lineArray[1])};\n\t\t\tlong gcd = findGcd(factor[0], factor[1]);\n\t\t\tlong lcm = findlcm(factor[0], factor[1]);\n\t\t\tSystem.out.println(gcd + \" \" + lcm);\n\t\t}\n\t}\n}",
"import java.io.*;",
"io.*",
"java",
"public class Main{\n\t\n\tpublic static long findGcd(long f1, long f2){\n\t\tlong gcd = 1;\n\t\tlong max, min;\n\t\tif(f1 > f2){max = f1; min = f2;}\n\t\telse{max = f2; min = f1;}\n\t\t\n\t\tif(max % min == 0){\n\t\t\treturn min;\n\t\t}\n\t\t\n\t\tfor(long i=1; i<(long)(Math.sqrt(min)+1); i++){\n\t\t\tif((min % i) == 0){\n\t\t\t\tif((max % i) == 0){\n\t\t\t\t\tif(gcd < i)gcd = i;\n\t\t\t\t}\n\t\t\t\tlong tmp = min/i;\n\t\t\t\tif((max % tmp) == 0){\n\t\t\t\t\tif(gcd < tmp)gcd = tmp;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn gcd;\n\t}\n\t\n\t\n\tpublic static long findlcm(long f1, long f2){\n\t\tlong lcm = 0;\n\t\tlong max, min;\n\t\tif(f1 > f2){max = f1; min = f2;}\n\t\telse{max = f2; min = f1;}\n\t\tlong i=1;\n\t\twhile(lcm == 0){\n\t\t\tif((max * i)%min == 0){\n\t\t\t\tlcm = max * i;\n\t\t\t}\n\t\t\ti++;\n\t\t}\n\t\treturn lcm;\n\t}\n\t\n\t/*\n\t//最大公約数を求めるメソッド\n static long findGcd(long x, long y){\n if(x%y==0){\n return y;\n }else{\n long m = 1;\n while(m!=0){\n m = y%x;\n y = x;\n x = m;\n }\n return y;\n }\n }\n */\n\t\n\tpublic static void main(String[] argv) throws NumberFormatException, IOException{\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\t\tString line;\n\t\twhile((line = br.readLine()) != null){\n\t\t\tString[] lineArray = line.split(\" \");\n\t\t\tlong[] factor = {Long.parseLong(lineArray[0]), Long.parseLong(lineArray[1])};\n\t\t\tlong gcd = findGcd(factor[0], factor[1]);\n\t\t\tlong lcm = findlcm(factor[0], factor[1]);\n\t\t\tSystem.out.println(gcd + \" \" + lcm);\n\t\t}\n\t}\n}",
"Main",
"public static long findGcd(long f1, long f2){\n\t\tlong gcd = 1;\n\t\tlong max, min;\n\t\tif(f1 > f2){max = f1; min = f2;}\n\t\telse{max = f2; min = f1;}\n\t\t\n\t\tif(max % min == 0){\n\t\t\treturn min;\n\t\t}\n\t\t\n\t\tfor(long i=1; i<(long)(Math.sqrt(min)+1); i++){\n\t\t\tif((min % i) == 0){\n\t\t\t\tif((max % i) == 0){\n\t\t\t\t\tif(gcd < i)gcd = i;\n\t\t\t\t}\n\t\t\t\tlong tmp = min/i;\n\t\t\t\tif((max % tmp) == 0){\n\t\t\t\t\tif(gcd < tmp)gcd = tmp;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn gcd;\n\t}",
"findGcd",
"{\n\t\tlong gcd = 1;\n\t\tlong max, min;\n\t\tif(f1 > f2){max = f1; min = f2;}\n\t\telse{max = f2; min = f1;}\n\t\t\n\t\tif(max % min == 0){\n\t\t\treturn min;\n\t\t}\n\t\t\n\t\tfor(long i=1; i<(long)(Math.sqrt(min)+1); i++){\n\t\t\tif((min % i) == 0){\n\t\t\t\tif((max % i) == 0){\n\t\t\t\t\tif(gcd < i)gcd = i;\n\t\t\t\t}\n\t\t\t\tlong tmp = min/i;\n\t\t\t\tif((max % tmp) == 0){\n\t\t\t\t\tif(gcd < tmp)gcd = tmp;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn gcd;\n\t}",
"long gcd = 1;",
"gcd",
"1",
"long max",
"max",
"min;",
"min",
"if(f1 > f2){max = f1; min = f2;}\n\t\telse{max = f2; min = f1;}",
"f1 > f2",
"f1",
"f2",
"{max = f1; min = f2;}",
"max = f1",
"max",
"f1",
"min = f2",
"min",
"f2",
"{max = f2; min = f1;}",
"max = f2",
"max",
"f2",
"min = f1",
"min",
"f1",
"if(max % min == 0){\n\t\t\treturn min;\n\t\t}",
"max % min == 0",
"max % min",
"max",
"min",
"0",
"{\n\t\t\treturn min;\n\t\t}",
"return min;",
"min",
"for(long i=1; i<(long)(Math.sqrt(min)+1); i++){\n\t\t\tif((min % i) == 0){\n\t\t\t\tif((max % i) == 0){\n\t\t\t\t\tif(gcd < i)gcd = i;\n\t\t\t\t}\n\t\t\t\tlong tmp = min/i;\n\t\t\t\tif((max % tmp) == 0){\n\t\t\t\t\tif(gcd < tmp)gcd = tmp;\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"long i=1;",
"long i=1;",
"i",
"1",
"i<(long)(Math.sqrt(min)+1)",
"i",
"(long)(Math.sqrt(min)+1)",
"Math.sqrt(min)",
"Math.sqrt",
"Math",
"min",
"1",
"i++",
"i++",
"i",
"{\n\t\t\tif((min % i) == 0){\n\t\t\t\tif((max % i) == 0){\n\t\t\t\t\tif(gcd < i)gcd = i;\n\t\t\t\t}\n\t\t\t\tlong tmp = min/i;\n\t\t\t\tif((max % tmp) == 0){\n\t\t\t\t\tif(gcd < tmp)gcd = tmp;\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"{\n\t\t\tif((min % i) == 0){\n\t\t\t\tif((max % i) == 0){\n\t\t\t\t\tif(gcd < i)gcd = i;\n\t\t\t\t}\n\t\t\t\tlong tmp = min/i;\n\t\t\t\tif((max % tmp) == 0){\n\t\t\t\t\tif(gcd < tmp)gcd = tmp;\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"if((min % i) == 0){\n\t\t\t\tif((max % i) == 0){\n\t\t\t\t\tif(gcd < i)gcd = i;\n\t\t\t\t}\n\t\t\t\tlong tmp = min/i;\n\t\t\t\tif((max % tmp) == 0){\n\t\t\t\t\tif(gcd < tmp)gcd = tmp;\n\t\t\t\t}\n\t\t\t}",
"(min % i) == 0",
"(min % i)",
"min",
"i",
"0",
"{\n\t\t\t\tif((max % i) == 0){\n\t\t\t\t\tif(gcd < i)gcd = i;\n\t\t\t\t}\n\t\t\t\tlong tmp = min/i;\n\t\t\t\tif((max % tmp) == 0){\n\t\t\t\t\tif(gcd < tmp)gcd = tmp;\n\t\t\t\t}\n\t\t\t}",
"if((max % i) == 0){\n\t\t\t\t\tif(gcd < i)gcd = i;\n\t\t\t\t}",
"(max % i) == 0",
"(max % i)",
"max",
"i",
"0",
"{\n\t\t\t\t\tif(gcd < i)gcd = i;\n\t\t\t\t}",
"if(gcd < i)gcd = i;",
"gcd < i",
"gcd",
"i",
"gcd = i",
"gcd",
"i",
"long tmp = min/i;",
"tmp",
"min/i",
"min",
"i",
"if((max % tmp) == 0){\n\t\t\t\t\tif(gcd < tmp)gcd = tmp;\n\t\t\t\t}",
"(max % tmp) == 0",
"(max % tmp)",
"max",
"tmp",
"0",
"{\n\t\t\t\t\tif(gcd < tmp)gcd = tmp;\n\t\t\t\t}",
"if(gcd < tmp)gcd = tmp;",
"gcd < tmp",
"gcd",
"tmp",
"gcd = tmp",
"gcd",
"tmp",
"return gcd;",
"gcd",
"long f1",
"f1",
"long f2",
"f2",
"public static long findlcm(long f1, long f2){\n\t\tlong lcm = 0;\n\t\tlong max, min;\n\t\tif(f1 > f2){max = f1; min = f2;}\n\t\telse{max = f2; min = f1;}\n\t\tlong i=1;\n\t\twhile(lcm == 0){\n\t\t\tif((max * i)%min == 0){\n\t\t\t\tlcm = max * i;\n\t\t\t}\n\t\t\ti++;\n\t\t}\n\t\treturn lcm;\n\t}",
"findlcm",
"{\n\t\tlong lcm = 0;\n\t\tlong max, min;\n\t\tif(f1 > f2){max = f1; min = f2;}\n\t\telse{max = f2; min = f1;}\n\t\tlong i=1;\n\t\twhile(lcm == 0){\n\t\t\tif((max * i)%min == 0){\n\t\t\t\tlcm = max * i;\n\t\t\t}\n\t\t\ti++;\n\t\t}\n\t\treturn lcm;\n\t}",
"long lcm = 0;",
"lcm",
"0",
"long max",
"max",
"min;",
"min",
"if(f1 > f2){max = f1; min = f2;}\n\t\telse{max = f2; min = f1;}",
"f1 > f2",
"f1",
"f2",
"{max = f1; min = f2;}",
"max = f1",
"max",
"f1",
"min = f2",
"min",
"f2",
"{max = f2; min = f1;}",
"max = f2",
"max",
"f2",
"min = f1",
"min",
"f1",
"long i=1;",
"i",
"1",
"while(lcm == 0){\n\t\t\tif((max * i)%min == 0){\n\t\t\t\tlcm = max * i;\n\t\t\t}\n\t\t\ti++;\n\t\t}",
"lcm == 0",
"lcm",
"0",
"{\n\t\t\tif((max * i)%min == 0){\n\t\t\t\tlcm = max * i;\n\t\t\t}\n\t\t\ti++;\n\t\t}",
"if((max * i)%min == 0){\n\t\t\t\tlcm = max * i;\n\t\t\t}",
"(max * i)%min == 0",
"(max * i)%min",
"(max * i)",
"max",
"i",
"min",
"0",
"{\n\t\t\t\tlcm = max * i;\n\t\t\t}",
"lcm = max * i",
"lcm",
"max * i",
"max",
"i",
"i++",
"i",
"return lcm;",
"lcm",
"long f1",
"f1",
"long f2",
"f2",
"public static void main(String[] argv) throws NumberFormatException, IOException{\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\t\tString line;\n\t\twhile((line = br.readLine()) != null){\n\t\t\tString[] lineArray = line.split(\" \");\n\t\t\tlong[] factor = {Long.parseLong(lineArray[0]), Long.parseLong(lineArray[1])};\n\t\t\tlong gcd = findGcd(factor[0], factor[1]);\n\t\t\tlong lcm = findlcm(factor[0], factor[1]);\n\t\t\tSystem.out.println(gcd + \" \" + lcm);\n\t\t}\n\t}",
"main",
"{\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\t\tString line;\n\t\twhile((line = br.readLine()) != null){\n\t\t\tString[] lineArray = line.split(\" \");\n\t\t\tlong[] factor = {Long.parseLong(lineArray[0]), Long.parseLong(lineArray[1])};\n\t\t\tlong gcd = findGcd(factor[0], factor[1]);\n\t\t\tlong lcm = findlcm(factor[0], factor[1]);\n\t\t\tSystem.out.println(gcd + \" \" + lcm);\n\t\t}\n\t}",
"BufferedReader br = new BufferedReader(new InputStreamReader(System.in));",
"br",
"new BufferedReader(new InputStreamReader(System.in))",
"String line;",
"line",
"while((line = br.readLine()) != null){\n\t\t\tString[] lineArray = line.split(\" \");\n\t\t\tlong[] factor = {Long.parseLong(lineArray[0]), Long.parseLong(lineArray[1])};\n\t\t\tlong gcd = findGcd(factor[0], factor[1]);\n\t\t\tlong lcm = findlcm(factor[0], factor[1]);\n\t\t\tSystem.out.println(gcd + \" \" + lcm);\n\t\t}",
"(line = br.readLine()) != null",
"(line = br.readLine())",
"line",
"br.readLine()",
"br.readLine",
"br",
"null",
"{\n\t\t\tString[] lineArray = line.split(\" \");\n\t\t\tlong[] factor = {Long.parseLong(lineArray[0]), Long.parseLong(lineArray[1])};\n\t\t\tlong gcd = findGcd(factor[0], factor[1]);\n\t\t\tlong lcm = findlcm(factor[0], factor[1]);\n\t\t\tSystem.out.println(gcd + \" \" + lcm);\n\t\t}",
"String[] lineArray = line.split(\" \");",
"lineArray",
"line.split(\" \")",
"line.split",
"line",
"\" \"",
"long[] factor = {Long.parseLong(lineArray[0]), Long.parseLong(lineArray[1])};",
"factor",
"{Long.parseLong(lineArray[0]), Long.parseLong(lineArray[1])}",
"Long.parseLong(lineArray[0])",
"Long.parseLong",
"Long",
"lineArray[0]",
"lineArray",
"0",
"Long.parseLong(lineArray[1])",
"Long.parseLong",
"Long",
"lineArray[1]",
"lineArray",
"1",
"long gcd = findGcd(factor[0], factor[1]);",
"gcd",
"findGcd(factor[0], factor[1])",
"findGcd",
"factor[0]",
"factor",
"0",
"factor[1]",
"factor",
"1",
"long lcm = findlcm(factor[0], factor[1]);",
"lcm",
"findlcm(factor[0], factor[1])",
"findlcm",
"factor[0]",
"factor",
"0",
"factor[1]",
"factor",
"1",
"System.out.println(gcd + \" \" + lcm)",
"System.out.println",
"System.out",
"System",
"System.out",
"gcd + \" \" + lcm",
"gcd + \" \" + lcm",
"gcd",
"\" \"",
"lcm",
"String[] argv",
"argv",
"public class Main{\n\t\n\tpublic static long findGcd(long f1, long f2){\n\t\tlong gcd = 1;\n\t\tlong max, min;\n\t\tif(f1 > f2){max = f1; min = f2;}\n\t\telse{max = f2; min = f1;}\n\t\t\n\t\tif(max % min == 0){\n\t\t\treturn min;\n\t\t}\n\t\t\n\t\tfor(long i=1; i<(long)(Math.sqrt(min)+1); i++){\n\t\t\tif((min % i) == 0){\n\t\t\t\tif((max % i) == 0){\n\t\t\t\t\tif(gcd < i)gcd = i;\n\t\t\t\t}\n\t\t\t\tlong tmp = min/i;\n\t\t\t\tif((max % tmp) == 0){\n\t\t\t\t\tif(gcd < tmp)gcd = tmp;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn gcd;\n\t}\n\t\n\t\n\tpublic static long findlcm(long f1, long f2){\n\t\tlong lcm = 0;\n\t\tlong max, min;\n\t\tif(f1 > f2){max = f1; min = f2;}\n\t\telse{max = f2; min = f1;}\n\t\tlong i=1;\n\t\twhile(lcm == 0){\n\t\t\tif((max * i)%min == 0){\n\t\t\t\tlcm = max * i;\n\t\t\t}\n\t\t\ti++;\n\t\t}\n\t\treturn lcm;\n\t}\n\t\n\t/*\n\t//最大公約数を求めるメソッド\n static long findGcd(long x, long y){\n if(x%y==0){\n return y;\n }else{\n long m = 1;\n while(m!=0){\n m = y%x;\n y = x;\n x = m;\n }\n return y;\n }\n }\n */\n\t\n\tpublic static void main(String[] argv) throws NumberFormatException, IOException{\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\t\tString line;\n\t\twhile((line = br.readLine()) != null){\n\t\t\tString[] lineArray = line.split(\" \");\n\t\t\tlong[] factor = {Long.parseLong(lineArray[0]), Long.parseLong(lineArray[1])};\n\t\t\tlong gcd = findGcd(factor[0], factor[1]);\n\t\t\tlong lcm = findlcm(factor[0], factor[1]);\n\t\t\tSystem.out.println(gcd + \" \" + lcm);\n\t\t}\n\t}\n}",
"public class Main{\n\t\n\tpublic static long findGcd(long f1, long f2){\n\t\tlong gcd = 1;\n\t\tlong max, min;\n\t\tif(f1 > f2){max = f1; min = f2;}\n\t\telse{max = f2; min = f1;}\n\t\t\n\t\tif(max % min == 0){\n\t\t\treturn min;\n\t\t}\n\t\t\n\t\tfor(long i=1; i<(long)(Math.sqrt(min)+1); i++){\n\t\t\tif((min % i) == 0){\n\t\t\t\tif((max % i) == 0){\n\t\t\t\t\tif(gcd < i)gcd = i;\n\t\t\t\t}\n\t\t\t\tlong tmp = min/i;\n\t\t\t\tif((max % tmp) == 0){\n\t\t\t\t\tif(gcd < tmp)gcd = tmp;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn gcd;\n\t}\n\t\n\t\n\tpublic static long findlcm(long f1, long f2){\n\t\tlong lcm = 0;\n\t\tlong max, min;\n\t\tif(f1 > f2){max = f1; min = f2;}\n\t\telse{max = f2; min = f1;}\n\t\tlong i=1;\n\t\twhile(lcm == 0){\n\t\t\tif((max * i)%min == 0){\n\t\t\t\tlcm = max * i;\n\t\t\t}\n\t\t\ti++;\n\t\t}\n\t\treturn lcm;\n\t}\n\t\n\t/*\n\t//最大公約数を求めるメソッド\n static long findGcd(long x, long y){\n if(x%y==0){\n return y;\n }else{\n long m = 1;\n while(m!=0){\n m = y%x;\n y = x;\n x = m;\n }\n return y;\n }\n }\n */\n\t\n\tpublic static void main(String[] argv) throws NumberFormatException, IOException{\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\t\tString line;\n\t\twhile((line = br.readLine()) != null){\n\t\t\tString[] lineArray = line.split(\" \");\n\t\t\tlong[] factor = {Long.parseLong(lineArray[0]), Long.parseLong(lineArray[1])};\n\t\t\tlong gcd = findGcd(factor[0], factor[1]);\n\t\t\tlong lcm = findlcm(factor[0], factor[1]);\n\t\t\tSystem.out.println(gcd + \" \" + lcm);\n\t\t}\n\t}\n}",
"Main"
] | import java.io.*;
public class Main{
public static long findGcd(long f1, long f2){
long gcd = 1;
long max, min;
if(f1 > f2){max = f1; min = f2;}
else{max = f2; min = f1;}
if(max % min == 0){
return min;
}
for(long i=1; i<(long)(Math.sqrt(min)+1); i++){
if((min % i) == 0){
if((max % i) == 0){
if(gcd < i)gcd = i;
}
long tmp = min/i;
if((max % tmp) == 0){
if(gcd < tmp)gcd = tmp;
}
}
}
return gcd;
}
public static long findlcm(long f1, long f2){
long lcm = 0;
long max, min;
if(f1 > f2){max = f1; min = f2;}
else{max = f2; min = f1;}
long i=1;
while(lcm == 0){
if((max * i)%min == 0){
lcm = max * i;
}
i++;
}
return lcm;
}
/*
//最大公約数を求めるメソッド
static long findGcd(long x, long y){
if(x%y==0){
return y;
}else{
long m = 1;
while(m!=0){
m = y%x;
y = x;
x = m;
}
return y;
}
}
*/
public static void main(String[] argv) throws NumberFormatException, IOException{
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
String line;
while((line = br.readLine()) != null){
String[] lineArray = line.split(" ");
long[] factor = {Long.parseLong(lineArray[0]), Long.parseLong(lineArray[1])};
long gcd = findGcd(factor[0], factor[1]);
long lcm = findlcm(factor[0], factor[1]);
System.out.println(gcd + " " + lcm);
}
}
} |
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
42,
4,
18,
13,
30,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
41,
13,
17,
41,
13,
17,
41,
13,
17,
0,
13,
2,
13,
13,
14,
2,
13,
13,
30,
0,
13,
13,
0,
13,
13,
0,
13,
13,
11,
1,
0,
13,
2,
13,
13,
2,
13,
17,
30,
30,
0,
13,
13,
0,
13,
2,
13,
13,
0,
13,
13,
0,
13,
2,
13,
13,
4,
18,
18,
13,
13,
2,
2,
13,
17,
13,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
96,
5
],
[
96,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
13,
14
],
[
14,
15
],
[
12,
16
],
[
16,
17
],
[
17,
18
],
[
17,
19
],
[
19,
20
],
[
20,
21
],
[
16,
22
],
[
22,
23
],
[
22,
24
],
[
24,
25
],
[
25,
26
],
[
16,
27
],
[
27,
28
],
[
27,
29
],
[
16,
30
],
[
30,
31
],
[
30,
32
],
[
16,
33
],
[
33,
34
],
[
33,
35
],
[
16,
36
],
[
36,
37
],
[
36,
38
],
[
38,
39
],
[
38,
40
],
[
16,
41
],
[
41,
42
],
[
42,
43
],
[
42,
44
],
[
41,
45
],
[
45,
46
],
[
46,
47
],
[
46,
48
],
[
45,
49
],
[
49,
50
],
[
49,
51
],
[
45,
52
],
[
52,
53
],
[
52,
54
],
[
16,
55
],
[
55,
56
],
[
56,
57
],
[
57,
58
],
[
57,
59
],
[
59,
60
],
[
59,
61
],
[
55,
62
],
[
62,
63
],
[
62,
64
],
[
55,
65
],
[
66,
66
],
[
66,
67
],
[
67,
68
],
[
67,
69
],
[
66,
70
],
[
70,
71
],
[
70,
72
],
[
72,
73
],
[
72,
74
],
[
66,
75
],
[
75,
76
],
[
75,
77
],
[
16,
78
],
[
78,
79
],
[
78,
80
],
[
80,
81
],
[
80,
82
],
[
16,
83
],
[
83,
84
],
[
84,
85
],
[
85,
86
],
[
85,
87
],
[
83,
88
],
[
89,
89
],
[
89,
90
],
[
89,
91
],
[
89,
92
],
[
6,
93
],
[
93,
94
],
[
0,
95
],
[
95,
96
],
[
95,
97
]
] | [
"import java.util.*;\npublic class Main{\n\tpublic static void main(String[] args){\n\tScanner sc= new Scanner (System.in);\n\twhile(sc.hasNext()){\n\tlong a = sc.nextLong();\n\t\tlong b = sc.nextLong();\n\t\tlong r = 0;\n\t\tlong temp = 0;\n\t\tlong LCM = 0;\n\t\tLCM = a * b;\n\t\tif ( a < b){\n\t\t\ttemp = a;\n\t\t\ta = b;\n\t\t\tb = temp;\t\n\t\t}\n\tfor( r = a % b; r!=0;){\n\t\ttemp = r;\n\t\tr = b % r;\n\t\tb = temp;\n\t}\n\tLCM = LCM / b; \n\tSystem.out.println(b +\" \"+ LCM);\n\t}\n}\n}",
"import java.util.*;",
"util.*",
"java",
"public class Main{\n\tpublic static void main(String[] args){\n\tScanner sc= new Scanner (System.in);\n\twhile(sc.hasNext()){\n\tlong a = sc.nextLong();\n\t\tlong b = sc.nextLong();\n\t\tlong r = 0;\n\t\tlong temp = 0;\n\t\tlong LCM = 0;\n\t\tLCM = a * b;\n\t\tif ( a < b){\n\t\t\ttemp = a;\n\t\t\ta = b;\n\t\t\tb = temp;\t\n\t\t}\n\tfor( r = a % b; r!=0;){\n\t\ttemp = r;\n\t\tr = b % r;\n\t\tb = temp;\n\t}\n\tLCM = LCM / b; \n\tSystem.out.println(b +\" \"+ LCM);\n\t}\n}\n}",
"Main",
"public static void main(String[] args){\n\tScanner sc= new Scanner (System.in);\n\twhile(sc.hasNext()){\n\tlong a = sc.nextLong();\n\t\tlong b = sc.nextLong();\n\t\tlong r = 0;\n\t\tlong temp = 0;\n\t\tlong LCM = 0;\n\t\tLCM = a * b;\n\t\tif ( a < b){\n\t\t\ttemp = a;\n\t\t\ta = b;\n\t\t\tb = temp;\t\n\t\t}\n\tfor( r = a % b; r!=0;){\n\t\ttemp = r;\n\t\tr = b % r;\n\t\tb = temp;\n\t}\n\tLCM = LCM / b; \n\tSystem.out.println(b +\" \"+ LCM);\n\t}\n}",
"main",
"{\n\tScanner sc= new Scanner (System.in);\n\twhile(sc.hasNext()){\n\tlong a = sc.nextLong();\n\t\tlong b = sc.nextLong();\n\t\tlong r = 0;\n\t\tlong temp = 0;\n\t\tlong LCM = 0;\n\t\tLCM = a * b;\n\t\tif ( a < b){\n\t\t\ttemp = a;\n\t\t\ta = b;\n\t\t\tb = temp;\t\n\t\t}\n\tfor( r = a % b; r!=0;){\n\t\ttemp = r;\n\t\tr = b % r;\n\t\tb = temp;\n\t}\n\tLCM = LCM / b; \n\tSystem.out.println(b +\" \"+ LCM);\n\t}\n}",
"Scanner sc= new Scanner (System.in);",
"sc",
"new Scanner (System.in)",
"while(sc.hasNext()){\n\tlong a = sc.nextLong();\n\t\tlong b = sc.nextLong();\n\t\tlong r = 0;\n\t\tlong temp = 0;\n\t\tlong LCM = 0;\n\t\tLCM = a * b;\n\t\tif ( a < b){\n\t\t\ttemp = a;\n\t\t\ta = b;\n\t\t\tb = temp;\t\n\t\t}\n\tfor( r = a % b; r!=0;){\n\t\ttemp = r;\n\t\tr = b % r;\n\t\tb = temp;\n\t}\n\tLCM = LCM / b; \n\tSystem.out.println(b +\" \"+ LCM);\n\t}",
"sc.hasNext()",
"sc.hasNext",
"sc",
"{\n\tlong a = sc.nextLong();\n\t\tlong b = sc.nextLong();\n\t\tlong r = 0;\n\t\tlong temp = 0;\n\t\tlong LCM = 0;\n\t\tLCM = a * b;\n\t\tif ( a < b){\n\t\t\ttemp = a;\n\t\t\ta = b;\n\t\t\tb = temp;\t\n\t\t}\n\tfor( r = a % b; r!=0;){\n\t\ttemp = r;\n\t\tr = b % r;\n\t\tb = temp;\n\t}\n\tLCM = LCM / b; \n\tSystem.out.println(b +\" \"+ LCM);\n\t}",
"long a = sc.nextLong();",
"a",
"sc.nextLong()",
"sc.nextLong",
"sc",
"long b = sc.nextLong();",
"b",
"sc.nextLong()",
"sc.nextLong",
"sc",
"long r = 0;",
"r",
"0",
"long temp = 0;",
"temp",
"0",
"long LCM = 0;",
"LCM",
"0",
"LCM = a * b",
"LCM",
"a * b",
"a",
"b",
"if ( a < b){\n\t\t\ttemp = a;\n\t\t\ta = b;\n\t\t\tb = temp;\t\n\t\t}",
"a < b",
"a",
"b",
"{\n\t\t\ttemp = a;\n\t\t\ta = b;\n\t\t\tb = temp;\t\n\t\t}",
"temp = a",
"temp",
"a",
"a = b",
"a",
"b",
"b = temp",
"b",
"temp",
"for( r = a % b; r!=0;){\n\t\ttemp = r;\n\t\tr = b % r;\n\t\tb = temp;\n\t}",
"r = a % b;",
"r = a % b",
"r",
"a % b",
"a",
"b",
"r!=0",
"r",
"0",
"{\n\t\ttemp = r;\n\t\tr = b % r;\n\t\tb = temp;\n\t}",
"{\n\t\ttemp = r;\n\t\tr = b % r;\n\t\tb = temp;\n\t}",
"temp = r",
"temp",
"r",
"r = b % r",
"r",
"b % r",
"b",
"r",
"b = temp",
"b",
"temp",
"LCM = LCM / b",
"LCM",
"LCM / b",
"LCM",
"b",
"System.out.println(b +\" \"+ LCM)",
"System.out.println",
"System.out",
"System",
"System.out",
"b +\" \"+ LCM",
"b +\" \"+ LCM",
"b",
"\" \"",
"LCM",
"String[] args",
"args",
"public class Main{\n\tpublic static void main(String[] args){\n\tScanner sc= new Scanner (System.in);\n\twhile(sc.hasNext()){\n\tlong a = sc.nextLong();\n\t\tlong b = sc.nextLong();\n\t\tlong r = 0;\n\t\tlong temp = 0;\n\t\tlong LCM = 0;\n\t\tLCM = a * b;\n\t\tif ( a < b){\n\t\t\ttemp = a;\n\t\t\ta = b;\n\t\t\tb = temp;\t\n\t\t}\n\tfor( r = a % b; r!=0;){\n\t\ttemp = r;\n\t\tr = b % r;\n\t\tb = temp;\n\t}\n\tLCM = LCM / b; \n\tSystem.out.println(b +\" \"+ LCM);\n\t}\n}\n}",
"public class Main{\n\tpublic static void main(String[] args){\n\tScanner sc= new Scanner (System.in);\n\twhile(sc.hasNext()){\n\tlong a = sc.nextLong();\n\t\tlong b = sc.nextLong();\n\t\tlong r = 0;\n\t\tlong temp = 0;\n\t\tlong LCM = 0;\n\t\tLCM = a * b;\n\t\tif ( a < b){\n\t\t\ttemp = a;\n\t\t\ta = b;\n\t\t\tb = temp;\t\n\t\t}\n\tfor( r = a % b; r!=0;){\n\t\ttemp = r;\n\t\tr = b % r;\n\t\tb = temp;\n\t}\n\tLCM = LCM / b; \n\tSystem.out.println(b +\" \"+ LCM);\n\t}\n}\n}",
"Main"
] | import java.util.*;
public class Main{
public static void main(String[] args){
Scanner sc= new Scanner (System.in);
while(sc.hasNext()){
long a = sc.nextLong();
long b = sc.nextLong();
long r = 0;
long temp = 0;
long LCM = 0;
LCM = a * b;
if ( a < b){
temp = a;
a = b;
b = temp;
}
for( r = a % b; r!=0;){
temp = r;
r = b % r;
b = temp;
}
LCM = LCM / b;
System.out.println(b +" "+ LCM);
}
}
} |
[
7,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
14,
2,
13,
17,
29,
13,
29,
4,
13,
13,
2,
13,
13,
23,
13,
23,
13,
12,
13,
30,
29,
2,
2,
13,
13,
4,
13,
13,
13,
23,
13,
23,
13,
12,
13,
30,
41,
13,
20,
41,
13,
20,
42,
17,
30,
41,
13,
4,
18,
13,
14,
2,
13,
17,
3,
41,
13,
20,
41,
13,
4,
18,
13,
4,
18,
13,
41,
13,
4,
18,
13,
4,
18,
13,
4,
18,
13,
2,
2,
4,
18,
13,
4,
13,
13,
13,
17,
4,
18,
13,
4,
13,
13,
13,
28,
13,
13,
30,
30,
4,
18,
18,
13,
13,
13,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
120,
8
],
[
120,
9
],
[
9,
10
],
[
9,
11
],
[
11,
12
],
[
12,
13
],
[
13,
14
],
[
13,
15
],
[
12,
16
],
[
16,
17
],
[
11,
18
],
[
18,
19
],
[
19,
20
],
[
19,
21
],
[
19,
22
],
[
22,
23
],
[
22,
24
],
[
9,
25
],
[
25,
26
],
[
9,
27
],
[
27,
28
],
[
120,
29
],
[
29,
30
],
[
29,
31
],
[
31,
32
],
[
32,
33
],
[
33,
34
],
[
34,
35
],
[
34,
36
],
[
33,
37
],
[
37,
38
],
[
37,
39
],
[
37,
40
],
[
29,
41
],
[
41,
42
],
[
29,
43
],
[
43,
44
],
[
120,
45
],
[
45,
46
],
[
45,
47
],
[
47,
48
],
[
48,
49
],
[
48,
50
],
[
47,
51
],
[
51,
52
],
[
51,
53
],
[
47,
54
],
[
54,
55
],
[
54,
56
],
[
56,
57
],
[
57,
58
],
[
57,
59
],
[
59,
60
],
[
60,
61
],
[
56,
62
],
[
62,
63
],
[
63,
64
],
[
63,
65
],
[
62,
66
],
[
56,
67
],
[
67,
68
],
[
67,
69
],
[
56,
70
],
[
70,
71
],
[
70,
72
],
[
72,
73
],
[
73,
74
],
[
72,
75
],
[
75,
76
],
[
76,
77
],
[
56,
78
],
[
78,
79
],
[
78,
80
],
[
80,
81
],
[
81,
82
],
[
80,
83
],
[
83,
84
],
[
84,
85
],
[
56,
86
],
[
86,
87
],
[
87,
88
],
[
86,
89
],
[
90,
90
],
[
90,
91
],
[
91,
92
],
[
92,
93
],
[
91,
94
],
[
94,
95
],
[
94,
96
],
[
94,
97
],
[
90,
98
],
[
90,
99
],
[
99,
100
],
[
100,
101
],
[
99,
102
],
[
102,
103
],
[
102,
104
],
[
102,
105
],
[
47,
106
],
[
106,
107
],
[
106,
108
],
[
106,
109
],
[
110,
110
],
[
110,
111
],
[
111,
112
],
[
112,
113
],
[
113,
114
],
[
113,
115
],
[
111,
116
],
[
45,
117
],
[
117,
118
],
[
0,
119
],
[
119,
120
],
[
119,
121
]
] | [
"import java.io.*;\nimport java.util.*;\n\npublic class Main {\n\t\n\tpublic static int gcd(int m, int n) {\n\t\tif(n == 0) return m;\n\t\treturn gcd(n, m % n);\n\t}\n\t\n\tpublic static long lcm(int m, int n) {\n\t\treturn ((long)m * n) / gcd(m, n);\n\t}\n\t\n\tpublic static void main(String[] args) throws IOException {\n\t\t\n\t\tBufferedReader br = \n\t\t\tnew BufferedReader(new InputStreamReader(System.in));\n\t\t\n\t\tArrayList<String> ans = new ArrayList<String>();\n\t\t\n\t\twhile (true) {\n\t\t\t\n\t\t\tString s = br.readLine();\n\t\t\tif(s == null) break;\n\t\t\tStringTokenizer st = new StringTokenizer(s,\" \");\n\t\t\tint a = Integer.parseInt(st.nextToken());\n\t\t\tint b = Integer.parseInt(st.nextToken());\n\t\t\tans.add(String.valueOf(gcd(a,b)) + \" \" + String.valueOf(lcm(a,b)));\n\t\t\t\n\t\t}\n\t\tfor(String q : ans) {\n\t\t\tSystem.out.println(q);\n\t\t}\n\t\t\n\t}\n\t\n}",
"import java.io.*;",
"io.*",
"java",
"import java.util.*;",
"util.*",
"java",
"public class Main {\n\t\n\tpublic static int gcd(int m, int n) {\n\t\tif(n == 0) return m;\n\t\treturn gcd(n, m % n);\n\t}\n\t\n\tpublic static long lcm(int m, int n) {\n\t\treturn ((long)m * n) / gcd(m, n);\n\t}\n\t\n\tpublic static void main(String[] args) throws IOException {\n\t\t\n\t\tBufferedReader br = \n\t\t\tnew BufferedReader(new InputStreamReader(System.in));\n\t\t\n\t\tArrayList<String> ans = new ArrayList<String>();\n\t\t\n\t\twhile (true) {\n\t\t\t\n\t\t\tString s = br.readLine();\n\t\t\tif(s == null) break;\n\t\t\tStringTokenizer st = new StringTokenizer(s,\" \");\n\t\t\tint a = Integer.parseInt(st.nextToken());\n\t\t\tint b = Integer.parseInt(st.nextToken());\n\t\t\tans.add(String.valueOf(gcd(a,b)) + \" \" + String.valueOf(lcm(a,b)));\n\t\t\t\n\t\t}\n\t\tfor(String q : ans) {\n\t\t\tSystem.out.println(q);\n\t\t}\n\t\t\n\t}\n\t\n}",
"Main",
"public static int gcd(int m, int n) {\n\t\tif(n == 0) return m;\n\t\treturn gcd(n, m % n);\n\t}",
"gcd",
"{\n\t\tif(n == 0) return m;\n\t\treturn gcd(n, m % n);\n\t}",
"if(n == 0) return m;",
"n == 0",
"n",
"0",
"return m;",
"m",
"return gcd(n, m % n);",
"gcd(n, m % n)",
"gcd",
"n",
"m % n",
"m",
"n",
"int m",
"m",
"int n",
"n",
"public static long lcm(int m, int n) {\n\t\treturn ((long)m * n) / gcd(m, n);\n\t}",
"lcm",
"{\n\t\treturn ((long)m * n) / gcd(m, n);\n\t}",
"return ((long)m * n) / gcd(m, n);",
"((long)m * n) / gcd(m, n)",
"((long)m * n)",
"(long)m",
"n",
"gcd(m, n)",
"gcd",
"m",
"n",
"int m",
"m",
"int n",
"n",
"public static void main(String[] args) throws IOException {\n\t\t\n\t\tBufferedReader br = \n\t\t\tnew BufferedReader(new InputStreamReader(System.in));\n\t\t\n\t\tArrayList<String> ans = new ArrayList<String>();\n\t\t\n\t\twhile (true) {\n\t\t\t\n\t\t\tString s = br.readLine();\n\t\t\tif(s == null) break;\n\t\t\tStringTokenizer st = new StringTokenizer(s,\" \");\n\t\t\tint a = Integer.parseInt(st.nextToken());\n\t\t\tint b = Integer.parseInt(st.nextToken());\n\t\t\tans.add(String.valueOf(gcd(a,b)) + \" \" + String.valueOf(lcm(a,b)));\n\t\t\t\n\t\t}\n\t\tfor(String q : ans) {\n\t\t\tSystem.out.println(q);\n\t\t}\n\t\t\n\t}",
"main",
"{\n\t\t\n\t\tBufferedReader br = \n\t\t\tnew BufferedReader(new InputStreamReader(System.in));\n\t\t\n\t\tArrayList<String> ans = new ArrayList<String>();\n\t\t\n\t\twhile (true) {\n\t\t\t\n\t\t\tString s = br.readLine();\n\t\t\tif(s == null) break;\n\t\t\tStringTokenizer st = new StringTokenizer(s,\" \");\n\t\t\tint a = Integer.parseInt(st.nextToken());\n\t\t\tint b = Integer.parseInt(st.nextToken());\n\t\t\tans.add(String.valueOf(gcd(a,b)) + \" \" + String.valueOf(lcm(a,b)));\n\t\t\t\n\t\t}\n\t\tfor(String q : ans) {\n\t\t\tSystem.out.println(q);\n\t\t}\n\t\t\n\t}",
"BufferedReader br = \n\t\t\tnew BufferedReader(new InputStreamReader(System.in));",
"br",
"new BufferedReader(new InputStreamReader(System.in))",
"ArrayList<String> ans = new ArrayList<String>();",
"ans",
"new ArrayList<String>()",
"while (true) {\n\t\t\t\n\t\t\tString s = br.readLine();\n\t\t\tif(s == null) break;\n\t\t\tStringTokenizer st = new StringTokenizer(s,\" \");\n\t\t\tint a = Integer.parseInt(st.nextToken());\n\t\t\tint b = Integer.parseInt(st.nextToken());\n\t\t\tans.add(String.valueOf(gcd(a,b)) + \" \" + String.valueOf(lcm(a,b)));\n\t\t\t\n\t\t}",
"true",
"{\n\t\t\t\n\t\t\tString s = br.readLine();\n\t\t\tif(s == null) break;\n\t\t\tStringTokenizer st = new StringTokenizer(s,\" \");\n\t\t\tint a = Integer.parseInt(st.nextToken());\n\t\t\tint b = Integer.parseInt(st.nextToken());\n\t\t\tans.add(String.valueOf(gcd(a,b)) + \" \" + String.valueOf(lcm(a,b)));\n\t\t\t\n\t\t}",
"String s = br.readLine();",
"s",
"br.readLine()",
"br.readLine",
"br",
"if(s == null) break;",
"s == null",
"s",
"null",
"break;",
"StringTokenizer st = new StringTokenizer(s,\" \");",
"st",
"new StringTokenizer(s,\" \")",
"int a = Integer.parseInt(st.nextToken());",
"a",
"Integer.parseInt(st.nextToken())",
"Integer.parseInt",
"Integer",
"st.nextToken()",
"st.nextToken",
"st",
"int b = Integer.parseInt(st.nextToken());",
"b",
"Integer.parseInt(st.nextToken())",
"Integer.parseInt",
"Integer",
"st.nextToken()",
"st.nextToken",
"st",
"ans.add(String.valueOf(gcd(a,b)) + \" \" + String.valueOf(lcm(a,b)))",
"ans.add",
"ans",
"String.valueOf(gcd(a,b)) + \" \" + String.valueOf(lcm(a,b))",
"String.valueOf(gcd(a,b)) + \" \" + String.valueOf(lcm(a,b))",
"String.valueOf(gcd(a,b))",
"String.valueOf",
"String",
"gcd(a,b)",
"gcd",
"a",
"b",
"\" \"",
"String.valueOf(lcm(a,b))",
"String.valueOf",
"String",
"lcm(a,b)",
"lcm",
"a",
"b",
"for(String q : ans) {\n\t\t\tSystem.out.println(q);\n\t\t}",
"String q",
"ans",
"{\n\t\t\tSystem.out.println(q);\n\t\t}",
"{\n\t\t\tSystem.out.println(q);\n\t\t}",
"System.out.println(q)",
"System.out.println",
"System.out",
"System",
"System.out",
"q",
"String[] args",
"args",
"public class Main {\n\t\n\tpublic static int gcd(int m, int n) {\n\t\tif(n == 0) return m;\n\t\treturn gcd(n, m % n);\n\t}\n\t\n\tpublic static long lcm(int m, int n) {\n\t\treturn ((long)m * n) / gcd(m, n);\n\t}\n\t\n\tpublic static void main(String[] args) throws IOException {\n\t\t\n\t\tBufferedReader br = \n\t\t\tnew BufferedReader(new InputStreamReader(System.in));\n\t\t\n\t\tArrayList<String> ans = new ArrayList<String>();\n\t\t\n\t\twhile (true) {\n\t\t\t\n\t\t\tString s = br.readLine();\n\t\t\tif(s == null) break;\n\t\t\tStringTokenizer st = new StringTokenizer(s,\" \");\n\t\t\tint a = Integer.parseInt(st.nextToken());\n\t\t\tint b = Integer.parseInt(st.nextToken());\n\t\t\tans.add(String.valueOf(gcd(a,b)) + \" \" + String.valueOf(lcm(a,b)));\n\t\t\t\n\t\t}\n\t\tfor(String q : ans) {\n\t\t\tSystem.out.println(q);\n\t\t}\n\t\t\n\t}\n\t\n}",
"public class Main {\n\t\n\tpublic static int gcd(int m, int n) {\n\t\tif(n == 0) return m;\n\t\treturn gcd(n, m % n);\n\t}\n\t\n\tpublic static long lcm(int m, int n) {\n\t\treturn ((long)m * n) / gcd(m, n);\n\t}\n\t\n\tpublic static void main(String[] args) throws IOException {\n\t\t\n\t\tBufferedReader br = \n\t\t\tnew BufferedReader(new InputStreamReader(System.in));\n\t\t\n\t\tArrayList<String> ans = new ArrayList<String>();\n\t\t\n\t\twhile (true) {\n\t\t\t\n\t\t\tString s = br.readLine();\n\t\t\tif(s == null) break;\n\t\t\tStringTokenizer st = new StringTokenizer(s,\" \");\n\t\t\tint a = Integer.parseInt(st.nextToken());\n\t\t\tint b = Integer.parseInt(st.nextToken());\n\t\t\tans.add(String.valueOf(gcd(a,b)) + \" \" + String.valueOf(lcm(a,b)));\n\t\t\t\n\t\t}\n\t\tfor(String q : ans) {\n\t\t\tSystem.out.println(q);\n\t\t}\n\t\t\n\t}\n\t\n}",
"Main"
] | import java.io.*;
import java.util.*;
public class Main {
public static int gcd(int m, int n) {
if(n == 0) return m;
return gcd(n, m % n);
}
public static long lcm(int m, int n) {
return ((long)m * n) / gcd(m, n);
}
public static void main(String[] args) throws IOException {
BufferedReader br =
new BufferedReader(new InputStreamReader(System.in));
ArrayList<String> ans = new ArrayList<String>();
while (true) {
String s = br.readLine();
if(s == null) break;
StringTokenizer st = new StringTokenizer(s," ");
int a = Integer.parseInt(st.nextToken());
int b = Integer.parseInt(st.nextToken());
ans.add(String.valueOf(gcd(a,b)) + " " + String.valueOf(lcm(a,b)));
}
for(String q : ans) {
System.out.println(q);
}
}
} |
[
7,
15,
13,
17,
6,
13,
41,
13,
41,
13,
12,
13,
30,
41,
13,
4,
13,
13,
13,
0,
18,
36,
13,
13,
0,
18,
36,
13,
2,
2,
13,
13,
13,
23,
13,
23,
13,
12,
13,
30,
42,
2,
13,
13,
30,
14,
2,
13,
13,
30,
0,
13,
13,
14,
2,
13,
13,
30,
0,
13,
13,
29,
13,
23,
13,
23,
13,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
20,
4,
18,
13,
17,
41,
13,
42,
4,
18,
13,
30,
0,
13,
4,
18,
4,
18,
13,
17,
4,
18,
13,
20,
28,
13,
13,
30,
30,
4,
18,
18,
13,
13,
2,
2,
18,
13,
13,
17,
18,
13,
13,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
6,
7
],
[
4,
8
],
[
8,
9
],
[
4,
10
],
[
10,
11
],
[
10,
12
],
[
12,
13
],
[
13,
14
],
[
13,
15
],
[
15,
16
],
[
15,
17
],
[
15,
18
],
[
12,
19
],
[
19,
20
],
[
20,
21
],
[
20,
22
],
[
19,
23
],
[
12,
24
],
[
24,
25
],
[
25,
26
],
[
25,
27
],
[
24,
28
],
[
28,
29
],
[
29,
30
],
[
29,
31
],
[
28,
32
],
[
10,
33
],
[
33,
34
],
[
10,
35
],
[
35,
36
],
[
4,
37
],
[
37,
38
],
[
37,
39
],
[
39,
40
],
[
40,
41
],
[
41,
42
],
[
41,
43
],
[
40,
44
],
[
44,
45
],
[
45,
46
],
[
46,
47
],
[
46,
48
],
[
45,
49
],
[
49,
50
],
[
50,
51
],
[
50,
52
],
[
45,
53
],
[
53,
54
],
[
54,
55
],
[
54,
56
],
[
53,
57
],
[
57,
58
],
[
58,
59
],
[
58,
60
],
[
39,
61
],
[
61,
62
],
[
37,
63
],
[
63,
64
],
[
37,
65
],
[
65,
66
],
[
0,
67
],
[
125,
68
],
[
125,
69
],
[
69,
70
],
[
69,
71
],
[
71,
72
],
[
72,
73
],
[
72,
74
],
[
71,
75
],
[
75,
76
],
[
75,
77
],
[
77,
78
],
[
78,
79
],
[
77,
80
],
[
80,
81
],
[
81,
82
],
[
80,
83
],
[
71,
84
],
[
84,
85
],
[
71,
86
],
[
86,
87
],
[
87,
88
],
[
88,
89
],
[
86,
90
],
[
90,
91
],
[
91,
92
],
[
91,
93
],
[
93,
94
],
[
94,
95
],
[
95,
96
],
[
96,
97
],
[
93,
98
],
[
90,
99
],
[
99,
100
],
[
100,
101
],
[
99,
102
],
[
71,
103
],
[
103,
104
],
[
103,
105
],
[
103,
106
],
[
107,
107
],
[
107,
108
],
[
108,
109
],
[
109,
110
],
[
110,
111
],
[
110,
112
],
[
108,
113
],
[
114,
114
],
[
114,
115
],
[
115,
116
],
[
115,
117
],
[
114,
118
],
[
114,
119
],
[
119,
120
],
[
119,
121
],
[
69,
122
],
[
122,
123
],
[
0,
124
],
[
124,
125
],
[
124,
126
]
] | [
"import java.util.*;\n\nclass GL {\n\tpublic long GCD,LCM;\n\n\tpublic GL(long a,long b){\n\t\tlong g = gcd(a,b);\n\t\tthis.GCD = g;\n\t\tthis.LCM = a * b / g;\n\t}\n\tprivate long gcd(long a,long b){\n\t\twhile( a != b ){\n\t\t\tif( a < b ){\n\t\t\t\tb -= a;\n\t\t\t} else if( a > b ){\n\t\t\t\ta -= b;\n\t\t\t}\n\t\t}\n\t\treturn a;\n\t}\n}\n\npublic class Main {\n\tpublic static void main(String[] args) {\n\n\t\tArrayList<GL> ar = new ArrayList<GL>();\n\n\t\t//input\n\t\tScanner sc = new Scanner(System.in).useDelimiter(System.getProperty(\"line.separator\"));\n\t\tString[] s;\n while(sc.hasNext()){\n s = sc.next().split(\"\\\\s\");\n ar.add(new GL(Long.parseLong(s[0]),Long.parseLong(s[1])));\n }\n\t\t\n //output\n for(GL g:ar){System.out.println(g.GCD + \" \" + g.LCM);}\n\t}\n}",
"import java.util.*;",
"util.*",
"java",
"class GL {\n\tpublic long GCD,LCM;\n\n\tpublic GL(long a,long b){\n\t\tlong g = gcd(a,b);\n\t\tthis.GCD = g;\n\t\tthis.LCM = a * b / g;\n\t}\n\tprivate long gcd(long a,long b){\n\t\twhile( a != b ){\n\t\t\tif( a < b ){\n\t\t\t\tb -= a;\n\t\t\t} else if( a > b ){\n\t\t\t\ta -= b;\n\t\t\t}\n\t\t}\n\t\treturn a;\n\t}\n}",
"GL",
"public long GCD",
"GCD",
"LCM;",
"LCM",
"public GL(long a,long b){\n\t\tlong g = gcd(a,b);\n\t\tthis.GCD = g;\n\t\tthis.LCM = a * b / g;\n\t}",
"GL",
"{\n\t\tlong g = gcd(a,b);\n\t\tthis.GCD = g;\n\t\tthis.LCM = a * b / g;\n\t}",
"long g = gcd(a,b);",
"g",
"gcd(a,b)",
"gcd",
"a",
"b",
"this.GCD = g",
"this.GCD",
"this",
"this.GCD",
"g",
"this.LCM = a * b / g",
"this.LCM",
"this",
"this.LCM",
"a * b / g",
"a * b",
"a",
"b",
"g",
"long a",
"a",
"long b",
"b",
"private long gcd(long a,long b){\n\t\twhile( a != b ){\n\t\t\tif( a < b ){\n\t\t\t\tb -= a;\n\t\t\t} else if( a > b ){\n\t\t\t\ta -= b;\n\t\t\t}\n\t\t}\n\t\treturn a;\n\t}",
"gcd",
"{\n\t\twhile( a != b ){\n\t\t\tif( a < b ){\n\t\t\t\tb -= a;\n\t\t\t} else if( a > b ){\n\t\t\t\ta -= b;\n\t\t\t}\n\t\t}\n\t\treturn a;\n\t}",
"while( a != b ){\n\t\t\tif( a < b ){\n\t\t\t\tb -= a;\n\t\t\t} else if( a > b ){\n\t\t\t\ta -= b;\n\t\t\t}\n\t\t}",
"a != b",
"a",
"b",
"{\n\t\t\tif( a < b ){\n\t\t\t\tb -= a;\n\t\t\t} else if( a > b ){\n\t\t\t\ta -= b;\n\t\t\t}\n\t\t}",
"if( a < b ){\n\t\t\t\tb -= a;\n\t\t\t} else if( a > b ){\n\t\t\t\ta -= b;\n\t\t\t}",
"a < b",
"a",
"b",
"{\n\t\t\t\tb -= a;\n\t\t\t}",
"b -= a",
"b",
"a",
"if( a > b ){\n\t\t\t\ta -= b;\n\t\t\t}",
"a > b",
"a",
"b",
"{\n\t\t\t\ta -= b;\n\t\t\t}",
"a -= b",
"a",
"b",
"return a;",
"a",
"long a",
"a",
"long b",
"b",
"public class Main {\n\tpublic static void main(String[] args) {\n\n\t\tArrayList<GL> ar = new ArrayList<GL>();\n\n\t\t//input\n\t\tScanner sc = new Scanner(System.in).useDelimiter(System.getProperty(\"line.separator\"));\n\t\tString[] s;\n while(sc.hasNext()){\n s = sc.next().split(\"\\\\s\");\n ar.add(new GL(Long.parseLong(s[0]),Long.parseLong(s[1])));\n }\n\t\t\n //output\n for(GL g:ar){System.out.println(g.GCD + \" \" + g.LCM);}\n\t}\n}",
"Main",
"public static void main(String[] args) {\n\n\t\tArrayList<GL> ar = new ArrayList<GL>();\n\n\t\t//input\n\t\tScanner sc = new Scanner(System.in).useDelimiter(System.getProperty(\"line.separator\"));\n\t\tString[] s;\n while(sc.hasNext()){\n s = sc.next().split(\"\\\\s\");\n ar.add(new GL(Long.parseLong(s[0]),Long.parseLong(s[1])));\n }\n\t\t\n //output\n for(GL g:ar){System.out.println(g.GCD + \" \" + g.LCM);}\n\t}",
"main",
"{\n\n\t\tArrayList<GL> ar = new ArrayList<GL>();\n\n\t\t//input\n\t\tScanner sc = new Scanner(System.in).useDelimiter(System.getProperty(\"line.separator\"));\n\t\tString[] s;\n while(sc.hasNext()){\n s = sc.next().split(\"\\\\s\");\n ar.add(new GL(Long.parseLong(s[0]),Long.parseLong(s[1])));\n }\n\t\t\n //output\n for(GL g:ar){System.out.println(g.GCD + \" \" + g.LCM);}\n\t}",
"ArrayList<GL> ar = new ArrayList<GL>();",
"ar",
"new ArrayList<GL>()",
"Scanner sc = new Scanner(System.in).useDelimiter(System.getProperty(\"line.separator\"));",
"sc",
"new Scanner(System.in).useDelimiter(System.getProperty(\"line.separator\"))",
"new Scanner(System.in).useDelimiter",
"new Scanner(System.in)",
"System.getProperty(\"line.separator\")",
"System.getProperty",
"System",
"\"line.separator\"",
"String[] s;",
"s",
"while(sc.hasNext()){\n s = sc.next().split(\"\\\\s\");\n ar.add(new GL(Long.parseLong(s[0]),Long.parseLong(s[1])));\n }",
"sc.hasNext()",
"sc.hasNext",
"sc",
"{\n s = sc.next().split(\"\\\\s\");\n ar.add(new GL(Long.parseLong(s[0]),Long.parseLong(s[1])));\n }",
"s = sc.next().split(\"\\\\s\")",
"s",
"sc.next().split(\"\\\\s\")",
"sc.next().split",
"sc.next()",
"sc.next",
"sc",
"\"\\\\s\"",
"ar.add(new GL(Long.parseLong(s[0]),Long.parseLong(s[1])))",
"ar.add",
"ar",
"new GL(Long.parseLong(s[0]),Long.parseLong(s[1]))",
"for(GL g:ar){System.out.println(g.GCD + \" \" + g.LCM);}",
"GL g",
"ar",
"{System.out.println(g.GCD + \" \" + g.LCM);}",
"{System.out.println(g.GCD + \" \" + g.LCM);}",
"System.out.println(g.GCD + \" \" + g.LCM)",
"System.out.println",
"System.out",
"System",
"System.out",
"g.GCD + \" \" + g.LCM",
"g.GCD + \" \" + g.LCM",
"g.GCD",
"g",
"g.GCD",
"\" \"",
"g.LCM",
"g",
"g.LCM",
"String[] args",
"args",
"public class Main {\n\tpublic static void main(String[] args) {\n\n\t\tArrayList<GL> ar = new ArrayList<GL>();\n\n\t\t//input\n\t\tScanner sc = new Scanner(System.in).useDelimiter(System.getProperty(\"line.separator\"));\n\t\tString[] s;\n while(sc.hasNext()){\n s = sc.next().split(\"\\\\s\");\n ar.add(new GL(Long.parseLong(s[0]),Long.parseLong(s[1])));\n }\n\t\t\n //output\n for(GL g:ar){System.out.println(g.GCD + \" \" + g.LCM);}\n\t}\n}",
"public class Main {\n\tpublic static void main(String[] args) {\n\n\t\tArrayList<GL> ar = new ArrayList<GL>();\n\n\t\t//input\n\t\tScanner sc = new Scanner(System.in).useDelimiter(System.getProperty(\"line.separator\"));\n\t\tString[] s;\n while(sc.hasNext()){\n s = sc.next().split(\"\\\\s\");\n ar.add(new GL(Long.parseLong(s[0]),Long.parseLong(s[1])));\n }\n\t\t\n //output\n for(GL g:ar){System.out.println(g.GCD + \" \" + g.LCM);}\n\t}\n}",
"Main"
] | import java.util.*;
class GL {
public long GCD,LCM;
public GL(long a,long b){
long g = gcd(a,b);
this.GCD = g;
this.LCM = a * b / g;
}
private long gcd(long a,long b){
while( a != b ){
if( a < b ){
b -= a;
} else if( a > b ){
a -= b;
}
}
return a;
}
}
public class Main {
public static void main(String[] args) {
ArrayList<GL> ar = new ArrayList<GL>();
//input
Scanner sc = new Scanner(System.in).useDelimiter(System.getProperty("line.separator"));
String[] s;
while(sc.hasNext()){
s = sc.next().split("\\s");
ar.add(new GL(Long.parseLong(s[0]),Long.parseLong(s[1])));
}
//output
for(GL g:ar){System.out.println(g.GCD + " " + g.LCM);}
}
} |
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
14,
2,
2,
13,
13,
17,
30,
29,
13,
30,
41,
13,
17,
42,
2,
13,
17,
30,
0,
13,
2,
13,
13,
0,
13,
13,
0,
13,
13,
29,
13,
23,
13,
23,
13,
12,
13,
30,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
14,
2,
2,
2,
13,
13,
13,
17,
30,
29,
2,
13,
13,
29,
17,
23,
13,
23,
13,
12,
13,
30,
41,
13,
20,
41,
13,
42,
2,
0,
13,
4,
18,
13,
17,
30,
41,
13,
4,
18,
13,
17,
41,
13,
39,
4,
18,
13,
18,
13,
17,
4,
18,
13,
18,
13,
17,
41,
13,
4,
13,
18,
13,
17,
18,
13,
17,
41,
13,
4,
13,
18,
13,
17,
18,
13,
17,
4,
18,
18,
13,
13,
2,
2,
13,
17,
13,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
150,
5
],
[
150,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
10,
11
],
[
11,
12
],
[
11,
13
],
[
10,
14
],
[
9,
15
],
[
15,
16
],
[
16,
17
],
[
9,
18
],
[
18,
19
],
[
19,
20
],
[
19,
21
],
[
18,
22
],
[
22,
23
],
[
23,
24
],
[
23,
25
],
[
22,
26
],
[
26,
27
],
[
27,
28
],
[
27,
29
],
[
29,
30
],
[
29,
31
],
[
26,
32
],
[
32,
33
],
[
32,
34
],
[
26,
35
],
[
35,
36
],
[
35,
37
],
[
18,
38
],
[
38,
39
],
[
6,
40
],
[
40,
41
],
[
6,
42
],
[
42,
43
],
[
150,
44
],
[
44,
45
],
[
44,
46
],
[
46,
47
],
[
47,
48
],
[
48,
49
],
[
49,
50
],
[
49,
51
],
[
47,
52
],
[
52,
53
],
[
52,
54
],
[
47,
55
],
[
55,
56
],
[
56,
57
],
[
47,
58
],
[
59,
59
],
[
59,
60
],
[
60,
61
],
[
61,
62
],
[
62,
63
],
[
63,
64
],
[
63,
65
],
[
62,
66
],
[
61,
67
],
[
60,
68
],
[
68,
69
],
[
69,
70
],
[
70,
71
],
[
70,
72
],
[
46,
73
],
[
73,
74
],
[
44,
75
],
[
75,
76
],
[
44,
77
],
[
77,
78
],
[
150,
79
],
[
79,
80
],
[
79,
81
],
[
81,
82
],
[
82,
83
],
[
82,
84
],
[
81,
85
],
[
85,
86
],
[
81,
87
],
[
87,
88
],
[
88,
89
],
[
89,
90
],
[
89,
91
],
[
91,
92
],
[
92,
93
],
[
88,
94
],
[
87,
95
],
[
95,
96
],
[
96,
97
],
[
96,
98
],
[
98,
99
],
[
99,
100
],
[
98,
101
],
[
95,
102
],
[
102,
103
],
[
102,
104
],
[
104,
105
],
[
105,
106
],
[
106,
107
],
[
105,
108
],
[
108,
109
],
[
108,
110
],
[
104,
111
],
[
111,
112
],
[
112,
113
],
[
111,
114
],
[
114,
115
],
[
114,
116
],
[
95,
117
],
[
117,
118
],
[
117,
119
],
[
119,
120
],
[
119,
121
],
[
121,
122
],
[
121,
123
],
[
119,
124
],
[
124,
125
],
[
124,
126
],
[
95,
127
],
[
127,
128
],
[
127,
129
],
[
129,
130
],
[
129,
131
],
[
131,
132
],
[
131,
133
],
[
129,
134
],
[
134,
135
],
[
134,
136
],
[
95,
137
],
[
137,
138
],
[
138,
139
],
[
139,
140
],
[
139,
141
],
[
137,
142
],
[
143,
143
],
[
143,
144
],
[
143,
145
],
[
143,
146
],
[
79,
147
],
[
147,
148
],
[
0,
149
],
[
149,
150
],
[
149,
151
]
] | [
"import java.io.*;\n\npublic class Main{\n\t/*\n\tpublic static long findGcd(long f1, long f2){\n\t\tlong gcd = 1;\n\t\tlong max, min;\n\t\tif(f1 > f2){max = f1; min = f2;}\n\t\telse{max = f2; min = f1;}\n\t\tfor(long i=1; i<=(long)(Math.sqrt(min)+1); i++){\n\t\t\tif(min % i == 0){\n\t\t\t\tlong tmp = min / i;\n\t\t\t\tif((max % tmp) == 0){\n\t\t\t\t\tgcd = tmp;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn gcd;\n\t}\n\t\n\tpublic static long findlcm(long f1, long f2){\n\t\tlong lcm = 0;\n\t\tlong max, min;\n\t\tif(f1 > f2){max = f1; min = f2;}\n\t\telse{max = f2; min = f1;}\n\t\tlong i=1;\n\t\twhile(lcm == 0){\n\t\t\tif((max * i)%min == 0){\n\t\t\t\tlcm = max * i;\n\t\t\t}\n\t\t\ti++;\n\t\t}\n\t\treturn lcm;\n\t}\n\t*/\n\t\n\t//最大公約数を求めるメソッド\n static long findGcd(long x, long y){\n if(x%y==0){\n return y;\n }else{\n long m = 1;\n while(m!=0){\n m = y%x;\n y = x;\n x = m;\n }\n return y;\n }\n }\n //最小公倍数を求めるメソッド\n static long findlcm(long x, long y){\n for(long i=1; i<=x; i++){\n if(y*i%x==0){\n return y*i;\n }\n }\n return 0;\n }\n\t\n\tpublic static void main(String[] argv) throws NumberFormatException, IOException{\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\t\tString line;\n\t\twhile((line = br.readLine()) != null){\n\t\t\tString[] lineArray = line.split(\" \");\n\t\t\tlong[] factor = {Long.parseLong(lineArray[0]), Long.parseLong(lineArray[1])};\n\t\t\tlong gcd = findGcd(factor[0], factor[1]);\n\t\t\tlong lcm = findlcm(factor[0], factor[1]);\n\t\t\tSystem.out.println(gcd + \" \" + lcm);\n\t\t}\n\t}\n}",
"import java.io.*;",
"io.*",
"java",
"public class Main{\n\t/*\n\tpublic static long findGcd(long f1, long f2){\n\t\tlong gcd = 1;\n\t\tlong max, min;\n\t\tif(f1 > f2){max = f1; min = f2;}\n\t\telse{max = f2; min = f1;}\n\t\tfor(long i=1; i<=(long)(Math.sqrt(min)+1); i++){\n\t\t\tif(min % i == 0){\n\t\t\t\tlong tmp = min / i;\n\t\t\t\tif((max % tmp) == 0){\n\t\t\t\t\tgcd = tmp;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn gcd;\n\t}\n\t\n\tpublic static long findlcm(long f1, long f2){\n\t\tlong lcm = 0;\n\t\tlong max, min;\n\t\tif(f1 > f2){max = f1; min = f2;}\n\t\telse{max = f2; min = f1;}\n\t\tlong i=1;\n\t\twhile(lcm == 0){\n\t\t\tif((max * i)%min == 0){\n\t\t\t\tlcm = max * i;\n\t\t\t}\n\t\t\ti++;\n\t\t}\n\t\treturn lcm;\n\t}\n\t*/\n\t\n\t//最大公約数を求めるメソッド\n static long findGcd(long x, long y){\n if(x%y==0){\n return y;\n }else{\n long m = 1;\n while(m!=0){\n m = y%x;\n y = x;\n x = m;\n }\n return y;\n }\n }\n //最小公倍数を求めるメソッド\n static long findlcm(long x, long y){\n for(long i=1; i<=x; i++){\n if(y*i%x==0){\n return y*i;\n }\n }\n return 0;\n }\n\t\n\tpublic static void main(String[] argv) throws NumberFormatException, IOException{\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\t\tString line;\n\t\twhile((line = br.readLine()) != null){\n\t\t\tString[] lineArray = line.split(\" \");\n\t\t\tlong[] factor = {Long.parseLong(lineArray[0]), Long.parseLong(lineArray[1])};\n\t\t\tlong gcd = findGcd(factor[0], factor[1]);\n\t\t\tlong lcm = findlcm(factor[0], factor[1]);\n\t\t\tSystem.out.println(gcd + \" \" + lcm);\n\t\t}\n\t}\n}",
"Main",
"//最大公約数を求めるメソッド\n static long findGcd(long x, long y){\n if(x%y==0){\n return y;\n }else{\n long m = 1;\n while(m!=0){\n m = y%x;\n y = x;\n x = m;\n }\n return y;\n }\n }",
"findGcd",
"{\n if(x%y==0){\n return y;\n }else{\n long m = 1;\n while(m!=0){\n m = y%x;\n y = x;\n x = m;\n }\n return y;\n }\n }",
"if(x%y==0){\n return y;\n }else{\n long m = 1;\n while(m!=0){\n m = y%x;\n y = x;\n x = m;\n }\n return y;\n }",
"x%y==0",
"x%y",
"x",
"y",
"0",
"{\n return y;\n }",
"return y;",
"y",
"{\n long m = 1;\n while(m!=0){\n m = y%x;\n y = x;\n x = m;\n }\n return y;\n }",
"long m = 1;",
"m",
"1",
"while(m!=0){\n m = y%x;\n y = x;\n x = m;\n }",
"m!=0",
"m",
"0",
"{\n m = y%x;\n y = x;\n x = m;\n }",
"m = y%x",
"m",
"y%x",
"y",
"x",
"y = x",
"y",
"x",
"x = m",
"x",
"m",
"return y;",
"y",
"long x",
"x",
"long y",
"y",
"//最小公倍数を求めるメソッド\n static long findlcm(long x, long y){\n for(long i=1; i<=x; i++){\n if(y*i%x==0){\n return y*i;\n }\n }\n return 0;\n }",
"findlcm",
"{\n for(long i=1; i<=x; i++){\n if(y*i%x==0){\n return y*i;\n }\n }\n return 0;\n }",
"for(long i=1; i<=x; i++){\n if(y*i%x==0){\n return y*i;\n }\n }",
"long i=1;",
"long i=1;",
"i",
"1",
"i<=x",
"i",
"x",
"i++",
"i++",
"i",
"{\n if(y*i%x==0){\n return y*i;\n }\n }",
"{\n if(y*i%x==0){\n return y*i;\n }\n }",
"if(y*i%x==0){\n return y*i;\n }",
"y*i%x==0",
"y*i%x",
"y*i",
"y",
"i",
"x",
"0",
"{\n return y*i;\n }",
"return y*i;",
"y*i",
"y",
"i",
"return 0;",
"0",
"long x",
"x",
"long y",
"y",
"public static void main(String[] argv) throws NumberFormatException, IOException{\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\t\tString line;\n\t\twhile((line = br.readLine()) != null){\n\t\t\tString[] lineArray = line.split(\" \");\n\t\t\tlong[] factor = {Long.parseLong(lineArray[0]), Long.parseLong(lineArray[1])};\n\t\t\tlong gcd = findGcd(factor[0], factor[1]);\n\t\t\tlong lcm = findlcm(factor[0], factor[1]);\n\t\t\tSystem.out.println(gcd + \" \" + lcm);\n\t\t}\n\t}",
"main",
"{\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\t\tString line;\n\t\twhile((line = br.readLine()) != null){\n\t\t\tString[] lineArray = line.split(\" \");\n\t\t\tlong[] factor = {Long.parseLong(lineArray[0]), Long.parseLong(lineArray[1])};\n\t\t\tlong gcd = findGcd(factor[0], factor[1]);\n\t\t\tlong lcm = findlcm(factor[0], factor[1]);\n\t\t\tSystem.out.println(gcd + \" \" + lcm);\n\t\t}\n\t}",
"BufferedReader br = new BufferedReader(new InputStreamReader(System.in));",
"br",
"new BufferedReader(new InputStreamReader(System.in))",
"String line;",
"line",
"while((line = br.readLine()) != null){\n\t\t\tString[] lineArray = line.split(\" \");\n\t\t\tlong[] factor = {Long.parseLong(lineArray[0]), Long.parseLong(lineArray[1])};\n\t\t\tlong gcd = findGcd(factor[0], factor[1]);\n\t\t\tlong lcm = findlcm(factor[0], factor[1]);\n\t\t\tSystem.out.println(gcd + \" \" + lcm);\n\t\t}",
"(line = br.readLine()) != null",
"(line = br.readLine())",
"line",
"br.readLine()",
"br.readLine",
"br",
"null",
"{\n\t\t\tString[] lineArray = line.split(\" \");\n\t\t\tlong[] factor = {Long.parseLong(lineArray[0]), Long.parseLong(lineArray[1])};\n\t\t\tlong gcd = findGcd(factor[0], factor[1]);\n\t\t\tlong lcm = findlcm(factor[0], factor[1]);\n\t\t\tSystem.out.println(gcd + \" \" + lcm);\n\t\t}",
"String[] lineArray = line.split(\" \");",
"lineArray",
"line.split(\" \")",
"line.split",
"line",
"\" \"",
"long[] factor = {Long.parseLong(lineArray[0]), Long.parseLong(lineArray[1])};",
"factor",
"{Long.parseLong(lineArray[0]), Long.parseLong(lineArray[1])}",
"Long.parseLong(lineArray[0])",
"Long.parseLong",
"Long",
"lineArray[0]",
"lineArray",
"0",
"Long.parseLong(lineArray[1])",
"Long.parseLong",
"Long",
"lineArray[1]",
"lineArray",
"1",
"long gcd = findGcd(factor[0], factor[1]);",
"gcd",
"findGcd(factor[0], factor[1])",
"findGcd",
"factor[0]",
"factor",
"0",
"factor[1]",
"factor",
"1",
"long lcm = findlcm(factor[0], factor[1]);",
"lcm",
"findlcm(factor[0], factor[1])",
"findlcm",
"factor[0]",
"factor",
"0",
"factor[1]",
"factor",
"1",
"System.out.println(gcd + \" \" + lcm)",
"System.out.println",
"System.out",
"System",
"System.out",
"gcd + \" \" + lcm",
"gcd + \" \" + lcm",
"gcd",
"\" \"",
"lcm",
"String[] argv",
"argv",
"public class Main{\n\t/*\n\tpublic static long findGcd(long f1, long f2){\n\t\tlong gcd = 1;\n\t\tlong max, min;\n\t\tif(f1 > f2){max = f1; min = f2;}\n\t\telse{max = f2; min = f1;}\n\t\tfor(long i=1; i<=(long)(Math.sqrt(min)+1); i++){\n\t\t\tif(min % i == 0){\n\t\t\t\tlong tmp = min / i;\n\t\t\t\tif((max % tmp) == 0){\n\t\t\t\t\tgcd = tmp;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn gcd;\n\t}\n\t\n\tpublic static long findlcm(long f1, long f2){\n\t\tlong lcm = 0;\n\t\tlong max, min;\n\t\tif(f1 > f2){max = f1; min = f2;}\n\t\telse{max = f2; min = f1;}\n\t\tlong i=1;\n\t\twhile(lcm == 0){\n\t\t\tif((max * i)%min == 0){\n\t\t\t\tlcm = max * i;\n\t\t\t}\n\t\t\ti++;\n\t\t}\n\t\treturn lcm;\n\t}\n\t*/\n\t\n\t//最大公約数を求めるメソッド\n static long findGcd(long x, long y){\n if(x%y==0){\n return y;\n }else{\n long m = 1;\n while(m!=0){\n m = y%x;\n y = x;\n x = m;\n }\n return y;\n }\n }\n //最小公倍数を求めるメソッド\n static long findlcm(long x, long y){\n for(long i=1; i<=x; i++){\n if(y*i%x==0){\n return y*i;\n }\n }\n return 0;\n }\n\t\n\tpublic static void main(String[] argv) throws NumberFormatException, IOException{\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\t\tString line;\n\t\twhile((line = br.readLine()) != null){\n\t\t\tString[] lineArray = line.split(\" \");\n\t\t\tlong[] factor = {Long.parseLong(lineArray[0]), Long.parseLong(lineArray[1])};\n\t\t\tlong gcd = findGcd(factor[0], factor[1]);\n\t\t\tlong lcm = findlcm(factor[0], factor[1]);\n\t\t\tSystem.out.println(gcd + \" \" + lcm);\n\t\t}\n\t}\n}",
"public class Main{\n\t/*\n\tpublic static long findGcd(long f1, long f2){\n\t\tlong gcd = 1;\n\t\tlong max, min;\n\t\tif(f1 > f2){max = f1; min = f2;}\n\t\telse{max = f2; min = f1;}\n\t\tfor(long i=1; i<=(long)(Math.sqrt(min)+1); i++){\n\t\t\tif(min % i == 0){\n\t\t\t\tlong tmp = min / i;\n\t\t\t\tif((max % tmp) == 0){\n\t\t\t\t\tgcd = tmp;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn gcd;\n\t}\n\t\n\tpublic static long findlcm(long f1, long f2){\n\t\tlong lcm = 0;\n\t\tlong max, min;\n\t\tif(f1 > f2){max = f1; min = f2;}\n\t\telse{max = f2; min = f1;}\n\t\tlong i=1;\n\t\twhile(lcm == 0){\n\t\t\tif((max * i)%min == 0){\n\t\t\t\tlcm = max * i;\n\t\t\t}\n\t\t\ti++;\n\t\t}\n\t\treturn lcm;\n\t}\n\t*/\n\t\n\t//最大公約数を求めるメソッド\n static long findGcd(long x, long y){\n if(x%y==0){\n return y;\n }else{\n long m = 1;\n while(m!=0){\n m = y%x;\n y = x;\n x = m;\n }\n return y;\n }\n }\n //最小公倍数を求めるメソッド\n static long findlcm(long x, long y){\n for(long i=1; i<=x; i++){\n if(y*i%x==0){\n return y*i;\n }\n }\n return 0;\n }\n\t\n\tpublic static void main(String[] argv) throws NumberFormatException, IOException{\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\t\tString line;\n\t\twhile((line = br.readLine()) != null){\n\t\t\tString[] lineArray = line.split(\" \");\n\t\t\tlong[] factor = {Long.parseLong(lineArray[0]), Long.parseLong(lineArray[1])};\n\t\t\tlong gcd = findGcd(factor[0], factor[1]);\n\t\t\tlong lcm = findlcm(factor[0], factor[1]);\n\t\t\tSystem.out.println(gcd + \" \" + lcm);\n\t\t}\n\t}\n}",
"Main"
] | import java.io.*;
public class Main{
/*
public static long findGcd(long f1, long f2){
long gcd = 1;
long max, min;
if(f1 > f2){max = f1; min = f2;}
else{max = f2; min = f1;}
for(long i=1; i<=(long)(Math.sqrt(min)+1); i++){
if(min % i == 0){
long tmp = min / i;
if((max % tmp) == 0){
gcd = tmp;
break;
}
}
}
return gcd;
}
public static long findlcm(long f1, long f2){
long lcm = 0;
long max, min;
if(f1 > f2){max = f1; min = f2;}
else{max = f2; min = f1;}
long i=1;
while(lcm == 0){
if((max * i)%min == 0){
lcm = max * i;
}
i++;
}
return lcm;
}
*/
//最大公約数を求めるメソッド
static long findGcd(long x, long y){
if(x%y==0){
return y;
}else{
long m = 1;
while(m!=0){
m = y%x;
y = x;
x = m;
}
return y;
}
}
//最小公倍数を求めるメソッド
static long findlcm(long x, long y){
for(long i=1; i<=x; i++){
if(y*i%x==0){
return y*i;
}
}
return 0;
}
public static void main(String[] argv) throws NumberFormatException, IOException{
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
String line;
while((line = br.readLine()) != null){
String[] lineArray = line.split(" ");
long[] factor = {Long.parseLong(lineArray[0]), Long.parseLong(lineArray[1])};
long gcd = findGcd(factor[0], factor[1]);
long lcm = findlcm(factor[0], factor[1]);
System.out.println(gcd + " " + lcm);
}
}
} |
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
42,
2,
0,
13,
4,
18,
13,
17,
30,
41,
13,
4,
18,
13,
17,
41,
13,
4,
18,
13,
18,
13,
17,
41,
13,
4,
18,
13,
18,
13,
17,
41,
13,
4,
13,
13,
13,
41,
13,
2,
2,
13,
13,
13,
4,
18,
18,
13,
13,
2,
2,
13,
17,
13,
23,
13,
12,
13,
30,
14,
2,
13,
13,
30,
41,
13,
13,
0,
13,
13,
0,
13,
13,
42,
2,
13,
17,
30,
41,
13,
2,
13,
13,
0,
13,
13,
0,
13,
13,
29,
13,
23,
13,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
116,
11
],
[
116,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
15,
17
],
[
14,
18
],
[
18,
19
],
[
14,
20
],
[
20,
21
],
[
21,
22
],
[
22,
23
],
[
22,
24
],
[
24,
25
],
[
25,
26
],
[
21,
27
],
[
20,
28
],
[
28,
29
],
[
29,
30
],
[
29,
31
],
[
31,
32
],
[
32,
33
],
[
31,
34
],
[
28,
35
],
[
35,
36
],
[
35,
37
],
[
37,
38
],
[
38,
39
],
[
37,
40
],
[
40,
41
],
[
40,
42
],
[
28,
43
],
[
43,
44
],
[
43,
45
],
[
45,
46
],
[
46,
47
],
[
45,
48
],
[
48,
49
],
[
48,
50
],
[
28,
51
],
[
51,
52
],
[
51,
53
],
[
53,
54
],
[
53,
55
],
[
53,
56
],
[
28,
57
],
[
57,
58
],
[
57,
59
],
[
59,
60
],
[
60,
61
],
[
60,
62
],
[
59,
63
],
[
28,
64
],
[
64,
65
],
[
65,
66
],
[
66,
67
],
[
66,
68
],
[
64,
69
],
[
70,
70
],
[
70,
71
],
[
70,
72
],
[
70,
73
],
[
12,
74
],
[
74,
75
],
[
116,
76
],
[
76,
77
],
[
76,
78
],
[
78,
79
],
[
79,
80
],
[
80,
81
],
[
80,
82
],
[
79,
83
],
[
83,
84
],
[
84,
85
],
[
84,
86
],
[
83,
87
],
[
87,
88
],
[
87,
89
],
[
83,
90
],
[
90,
91
],
[
90,
92
],
[
78,
93
],
[
93,
94
],
[
94,
95
],
[
94,
96
],
[
93,
97
],
[
97,
98
],
[
98,
99
],
[
98,
100
],
[
100,
101
],
[
100,
102
],
[
97,
103
],
[
103,
104
],
[
103,
105
],
[
97,
106
],
[
106,
107
],
[
106,
108
],
[
78,
109
],
[
109,
110
],
[
76,
111
],
[
111,
112
],
[
76,
113
],
[
113,
114
],
[
0,
115
],
[
115,
116
],
[
115,
117
]
] | [
"\n\nimport java.io.BufferedReader;\nimport java.io.IOException;\nimport java.io.InputStreamReader;\n\npublic class Main{\n\n\tpublic static void main(String[] args) throws IOException {\n\t\t// TODO Auto-generated method stub\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\t\t\n\t\tString line;\n\t\twhile ((line = br.readLine()) != null) {\n\t\t\tString[] arr = line.split(\" \");\n\t\t\tlong a = Integer.parseInt(arr[0]);\n\t\t\tlong b = Integer.parseInt(arr[1]);\n\t\t\t\n\t\t\tlong n_gcd = gcd(a, b);\n\t\t\tlong n_lcm = a * b / n_gcd;\n\t\t\t\n\t\t\tSystem.out.println(n_gcd + \" \" + n_lcm);\n\t\t}\n\t}\n\t\n\tpublic static long gcd(long x, long y) {\n\t\tif (x < y) {\n\t\t\tlong temp = x;\n\t\t\tx = y;\n\t\t\ty = temp;\n\t\t}\n\t\t\n\t\twhile (y > 0) {\n\t\t\tlong r = x % y;\n\t\t\tx = y;\n\t\t\ty = r;\n\t\t}\n\t\t\n\t\treturn x;\n\t}\n\n}",
"import java.io.BufferedReader;",
"BufferedReader",
"java.io",
"import java.io.IOException;",
"IOException",
"java.io",
"import java.io.InputStreamReader;",
"InputStreamReader",
"java.io",
"public class Main{\n\n\tpublic static void main(String[] args) throws IOException {\n\t\t// TODO Auto-generated method stub\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\t\t\n\t\tString line;\n\t\twhile ((line = br.readLine()) != null) {\n\t\t\tString[] arr = line.split(\" \");\n\t\t\tlong a = Integer.parseInt(arr[0]);\n\t\t\tlong b = Integer.parseInt(arr[1]);\n\t\t\t\n\t\t\tlong n_gcd = gcd(a, b);\n\t\t\tlong n_lcm = a * b / n_gcd;\n\t\t\t\n\t\t\tSystem.out.println(n_gcd + \" \" + n_lcm);\n\t\t}\n\t}\n\t\n\tpublic static long gcd(long x, long y) {\n\t\tif (x < y) {\n\t\t\tlong temp = x;\n\t\t\tx = y;\n\t\t\ty = temp;\n\t\t}\n\t\t\n\t\twhile (y > 0) {\n\t\t\tlong r = x % y;\n\t\t\tx = y;\n\t\t\ty = r;\n\t\t}\n\t\t\n\t\treturn x;\n\t}\n\n}",
"Main",
"public static void main(String[] args) throws IOException {\n\t\t// TODO Auto-generated method stub\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\t\t\n\t\tString line;\n\t\twhile ((line = br.readLine()) != null) {\n\t\t\tString[] arr = line.split(\" \");\n\t\t\tlong a = Integer.parseInt(arr[0]);\n\t\t\tlong b = Integer.parseInt(arr[1]);\n\t\t\t\n\t\t\tlong n_gcd = gcd(a, b);\n\t\t\tlong n_lcm = a * b / n_gcd;\n\t\t\t\n\t\t\tSystem.out.println(n_gcd + \" \" + n_lcm);\n\t\t}\n\t}",
"main",
"{\n\t\t// TODO Auto-generated method stub\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\t\t\n\t\tString line;\n\t\twhile ((line = br.readLine()) != null) {\n\t\t\tString[] arr = line.split(\" \");\n\t\t\tlong a = Integer.parseInt(arr[0]);\n\t\t\tlong b = Integer.parseInt(arr[1]);\n\t\t\t\n\t\t\tlong n_gcd = gcd(a, b);\n\t\t\tlong n_lcm = a * b / n_gcd;\n\t\t\t\n\t\t\tSystem.out.println(n_gcd + \" \" + n_lcm);\n\t\t}\n\t}",
"BufferedReader br = new BufferedReader(new InputStreamReader(System.in));",
"br",
"new BufferedReader(new InputStreamReader(System.in))",
"String line;",
"line",
"while ((line = br.readLine()) != null) {\n\t\t\tString[] arr = line.split(\" \");\n\t\t\tlong a = Integer.parseInt(arr[0]);\n\t\t\tlong b = Integer.parseInt(arr[1]);\n\t\t\t\n\t\t\tlong n_gcd = gcd(a, b);\n\t\t\tlong n_lcm = a * b / n_gcd;\n\t\t\t\n\t\t\tSystem.out.println(n_gcd + \" \" + n_lcm);\n\t\t}",
"(line = br.readLine()) != null",
"(line = br.readLine())",
"line",
"br.readLine()",
"br.readLine",
"br",
"null",
"{\n\t\t\tString[] arr = line.split(\" \");\n\t\t\tlong a = Integer.parseInt(arr[0]);\n\t\t\tlong b = Integer.parseInt(arr[1]);\n\t\t\t\n\t\t\tlong n_gcd = gcd(a, b);\n\t\t\tlong n_lcm = a * b / n_gcd;\n\t\t\t\n\t\t\tSystem.out.println(n_gcd + \" \" + n_lcm);\n\t\t}",
"String[] arr = line.split(\" \");",
"arr",
"line.split(\" \")",
"line.split",
"line",
"\" \"",
"long a = Integer.parseInt(arr[0]);",
"a",
"Integer.parseInt(arr[0])",
"Integer.parseInt",
"Integer",
"arr[0]",
"arr",
"0",
"long b = Integer.parseInt(arr[1]);",
"b",
"Integer.parseInt(arr[1])",
"Integer.parseInt",
"Integer",
"arr[1]",
"arr",
"1",
"long n_gcd = gcd(a, b);",
"n_gcd",
"gcd(a, b)",
"gcd",
"a",
"b",
"long n_lcm = a * b / n_gcd;",
"n_lcm",
"a * b / n_gcd",
"a * b",
"a",
"b",
"n_gcd",
"System.out.println(n_gcd + \" \" + n_lcm)",
"System.out.println",
"System.out",
"System",
"System.out",
"n_gcd + \" \" + n_lcm",
"n_gcd + \" \" + n_lcm",
"n_gcd",
"\" \"",
"n_lcm",
"String[] args",
"args",
"public static long gcd(long x, long y) {\n\t\tif (x < y) {\n\t\t\tlong temp = x;\n\t\t\tx = y;\n\t\t\ty = temp;\n\t\t}\n\t\t\n\t\twhile (y > 0) {\n\t\t\tlong r = x % y;\n\t\t\tx = y;\n\t\t\ty = r;\n\t\t}\n\t\t\n\t\treturn x;\n\t}",
"gcd",
"{\n\t\tif (x < y) {\n\t\t\tlong temp = x;\n\t\t\tx = y;\n\t\t\ty = temp;\n\t\t}\n\t\t\n\t\twhile (y > 0) {\n\t\t\tlong r = x % y;\n\t\t\tx = y;\n\t\t\ty = r;\n\t\t}\n\t\t\n\t\treturn x;\n\t}",
"if (x < y) {\n\t\t\tlong temp = x;\n\t\t\tx = y;\n\t\t\ty = temp;\n\t\t}",
"x < y",
"x",
"y",
"{\n\t\t\tlong temp = x;\n\t\t\tx = y;\n\t\t\ty = temp;\n\t\t}",
"long temp = x;",
"temp",
"x",
"x = y",
"x",
"y",
"y = temp",
"y",
"temp",
"while (y > 0) {\n\t\t\tlong r = x % y;\n\t\t\tx = y;\n\t\t\ty = r;\n\t\t}",
"y > 0",
"y",
"0",
"{\n\t\t\tlong r = x % y;\n\t\t\tx = y;\n\t\t\ty = r;\n\t\t}",
"long r = x % y;",
"r",
"x % y",
"x",
"y",
"x = y",
"x",
"y",
"y = r",
"y",
"r",
"return x;",
"x",
"long x",
"x",
"long y",
"y",
"public class Main{\n\n\tpublic static void main(String[] args) throws IOException {\n\t\t// TODO Auto-generated method stub\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\t\t\n\t\tString line;\n\t\twhile ((line = br.readLine()) != null) {\n\t\t\tString[] arr = line.split(\" \");\n\t\t\tlong a = Integer.parseInt(arr[0]);\n\t\t\tlong b = Integer.parseInt(arr[1]);\n\t\t\t\n\t\t\tlong n_gcd = gcd(a, b);\n\t\t\tlong n_lcm = a * b / n_gcd;\n\t\t\t\n\t\t\tSystem.out.println(n_gcd + \" \" + n_lcm);\n\t\t}\n\t}\n\t\n\tpublic static long gcd(long x, long y) {\n\t\tif (x < y) {\n\t\t\tlong temp = x;\n\t\t\tx = y;\n\t\t\ty = temp;\n\t\t}\n\t\t\n\t\twhile (y > 0) {\n\t\t\tlong r = x % y;\n\t\t\tx = y;\n\t\t\ty = r;\n\t\t}\n\t\t\n\t\treturn x;\n\t}\n\n}",
"public class Main{\n\n\tpublic static void main(String[] args) throws IOException {\n\t\t// TODO Auto-generated method stub\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\t\t\n\t\tString line;\n\t\twhile ((line = br.readLine()) != null) {\n\t\t\tString[] arr = line.split(\" \");\n\t\t\tlong a = Integer.parseInt(arr[0]);\n\t\t\tlong b = Integer.parseInt(arr[1]);\n\t\t\t\n\t\t\tlong n_gcd = gcd(a, b);\n\t\t\tlong n_lcm = a * b / n_gcd;\n\t\t\t\n\t\t\tSystem.out.println(n_gcd + \" \" + n_lcm);\n\t\t}\n\t}\n\t\n\tpublic static long gcd(long x, long y) {\n\t\tif (x < y) {\n\t\t\tlong temp = x;\n\t\t\tx = y;\n\t\t\ty = temp;\n\t\t}\n\t\t\n\t\twhile (y > 0) {\n\t\t\tlong r = x % y;\n\t\t\tx = y;\n\t\t\ty = r;\n\t\t}\n\t\t\n\t\treturn x;\n\t}\n\n}",
"Main"
] |
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class Main{
public static void main(String[] args) throws IOException {
// TODO Auto-generated method stub
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
String line;
while ((line = br.readLine()) != null) {
String[] arr = line.split(" ");
long a = Integer.parseInt(arr[0]);
long b = Integer.parseInt(arr[1]);
long n_gcd = gcd(a, b);
long n_lcm = a * b / n_gcd;
System.out.println(n_gcd + " " + n_lcm);
}
}
public static long gcd(long x, long y) {
if (x < y) {
long temp = x;
x = y;
y = temp;
}
while (y > 0) {
long r = x % y;
x = y;
y = r;
}
return x;
}
} |
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
41,
13,
17,
12,
13,
30,
41,
13,
17,
42,
2,
0,
13,
4,
13,
17,
30,
4,
13,
13,
23,
13,
12,
13,
30,
41,
13,
17,
38,
5,
13,
30,
5,
13,
30,
30,
41,
13,
4,
18,
13,
14,
2,
13,
17,
30,
14,
40,
4,
18,
13,
30,
0,
13,
20,
17,
41,
13,
4,
18,
13,
17,
41,
13,
4,
18,
13,
18,
13,
17,
41,
13,
4,
18,
13,
18,
13,
17,
0,
18,
13,
17,
13,
0,
18,
13,
17,
13,
29,
13,
12,
13,
30,
41,
13,
4,
13,
18,
13,
17,
18,
13,
17,
41,
13,
8,
2,
13,
17,
17,
2,
18,
13,
17,
2,
18,
13,
17,
13,
4,
18,
18,
13,
13,
17,
13,
13,
23,
13,
12,
13,
30,
41,
13,
17,
41,
13,
20,
17,
14,
2,
13,
13,
30,
0,
13,
13,
30,
0,
18,
13,
17,
13,
0,
18,
13,
17,
13,
0,
18,
13,
17,
4,
18,
13,
2,
13,
13,
4,
18,
13,
13,
0,
13,
4,
13,
18,
13,
17,
18,
13,
17,
29,
13,
23,
13,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
10,
11
],
[
10,
12
],
[
0,
13
],
[
204,
14
],
[
204,
15
],
[
15,
16
],
[
15,
17
],
[
204,
18
],
[
18,
19
],
[
18,
20
],
[
20,
21
],
[
21,
22
],
[
21,
23
],
[
20,
24
],
[
24,
25
],
[
25,
26
],
[
26,
27
],
[
26,
28
],
[
28,
29
],
[
25,
30
],
[
24,
31
],
[
31,
32
],
[
32,
33
],
[
32,
34
],
[
18,
35
],
[
35,
36
],
[
204,
37
],
[
37,
38
],
[
37,
39
],
[
39,
40
],
[
40,
41
],
[
40,
42
],
[
39,
43
],
[
43,
44
],
[
44,
45
],
[
44,
46
],
[
43,
47
],
[
47,
48
],
[
47,
49
],
[
43,
50
],
[
50,
51
],
[
51,
52
],
[
51,
53
],
[
53,
54
],
[
54,
55
],
[
50,
56
],
[
56,
57
],
[
57,
58
],
[
57,
59
],
[
56,
60
],
[
60,
61
],
[
61,
62
],
[
62,
63
],
[
63,
64
],
[
64,
65
],
[
61,
66
],
[
66,
67
],
[
67,
68
],
[
67,
69
],
[
66,
71
],
[
71,
72
],
[
71,
73
],
[
73,
74
],
[
74,
75
],
[
73,
76
],
[
66,
77
],
[
77,
78
],
[
77,
79
],
[
79,
80
],
[
80,
81
],
[
79,
82
],
[
82,
83
],
[
82,
84
],
[
66,
85
],
[
85,
86
],
[
85,
87
],
[
87,
88
],
[
88,
89
],
[
87,
90
],
[
90,
91
],
[
90,
92
],
[
66,
93
],
[
93,
94
],
[
94,
95
],
[
94,
96
],
[
93,
97
],
[
66,
98
],
[
98,
99
],
[
99,
100
],
[
99,
101
],
[
98,
102
],
[
39,
103
],
[
103,
104
],
[
204,
105
],
[
105,
106
],
[
105,
107
],
[
107,
108
],
[
108,
109
],
[
108,
110
],
[
110,
111
],
[
110,
112
],
[
112,
113
],
[
112,
114
],
[
110,
115
],
[
115,
116
],
[
115,
117
],
[
107,
118
],
[
118,
119
],
[
118,
120
],
[
120,
121
],
[
121,
122
],
[
121,
123
],
[
120,
124
],
[
120,
125
],
[
125,
126
],
[
126,
127
],
[
126,
128
],
[
125,
129
],
[
129,
130
],
[
130,
131
],
[
130,
132
],
[
129,
133
],
[
107,
134
],
[
134,
135
],
[
135,
136
],
[
136,
137
],
[
136,
138
],
[
134,
139
],
[
134,
140
],
[
134,
141
],
[
105,
142
],
[
142,
143
],
[
204,
144
],
[
144,
145
],
[
144,
146
],
[
146,
147
],
[
147,
148
],
[
147,
149
],
[
146,
150
],
[
150,
151
],
[
150,
152
],
[
146,
154
],
[
154,
155
],
[
155,
156
],
[
155,
157
],
[
154,
158
],
[
158,
159
],
[
159,
160
],
[
159,
161
],
[
154,
162
],
[
162,
163
],
[
163,
164
],
[
164,
165
],
[
164,
166
],
[
163,
167
],
[
162,
168
],
[
168,
169
],
[
169,
170
],
[
169,
171
],
[
168,
172
],
[
162,
173
],
[
173,
174
],
[
174,
175
],
[
174,
176
],
[
173,
177
],
[
177,
178
],
[
178,
179
],
[
177,
180
],
[
180,
181
],
[
180,
182
],
[
162,
183
],
[
183,
184
],
[
184,
185
],
[
183,
186
],
[
162,
187
],
[
187,
188
],
[
187,
189
],
[
189,
190
],
[
189,
191
],
[
191,
192
],
[
191,
193
],
[
189,
194
],
[
194,
195
],
[
194,
196
],
[
146,
197
],
[
197,
198
],
[
144,
199
],
[
199,
200
],
[
144,
201
],
[
201,
202
],
[
0,
203
],
[
203,
204
],
[
203,
205
]
] | [
"import java.io.BufferedReader;\nimport java.io.IOException;\nimport java.io.InputStreamReader;\nimport java.util.Arrays;\n\n\npublic class Main {\n\tprivate\tstatic\tBufferedReader br = null;\n\n\tstatic {\n\t\tbr = new BufferedReader(new InputStreamReader(System.in));\n\t}\n\n\t/**\n\t * @param args\n\t */\n\tpublic static void main(String[] args) {\n\t\t// TODO Auto-generated method stub\n\t\tint[]\taPair = null;\n\n\t\twhile((aPair = parsePair()) != null) {\n\t\t\tcalc(aPair);\n\t\t}\n\t}\n\n\tprivate static int[] parsePair() {\n\t\tint[]\taPair = null;\n\n\t\ttry {\n\t\t\tString line = br.readLine();\n\t\t\tif (line != null) {\n\t\t\t\tif (!line.isEmpty()) {\n\t\t\t\t\taPair = new int[2];\n\t\n\t\t\t\t\tString[]\tas = line.split(\" \");\n\t\t\t\t\tint\t\t\tn1 = Integer.parseInt(as[0]);\n\t\t\t\t\tint\t\t\tn2 = Integer.parseInt(as[1]);\n\t\n\t\t\t\t\taPair[0] = n1;\n\t\t\t\t\taPair[1] = n2;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tcatch (NumberFormatException e) {}\n\t\tcatch (IOException e) {}\n\n\t\treturn aPair;\n\t}\n\n\tprivate static void calc(int[] aMatrix) {\n\t\tint\tnGcd = gcd(aMatrix[0], aMatrix[1]);\t\t\t\t\t\t\t// 最大公約数\n\t\tint\tnLcm = (nGcd == 0) ? 0 : aMatrix[0] * (aMatrix[1] / nGcd);\t// 最小公倍数\n\n\t\tSystem.out.printf(\"%d %d\\n\", nGcd, nLcm);\n\t}\n\n\tprivate static int gcd(int n1, int n2) {\n\t\tint\t\tnGcd = 0;\t\t\t// 最大公約数\n\t\tint[]\taNum = new int[3];\t// 計算用の配列\n\n\t\tif (n1 == n2) {\n\t\t\tnGcd = n1;\n\t\t}\n\t\telse {\n\t\t\taNum[0] = n1;\n\t\t\taNum[1] = n2;\n\t\t\taNum[2] = Math.abs(n1 - n2);\n\n\t\t\tArrays.sort(aNum);\n\t\t\tnGcd = gcd(aNum[0], aNum[1]);\n\t\t}\n\t\t\n\t\treturn nGcd;\n\t}\n}",
"import java.io.BufferedReader;",
"BufferedReader",
"java.io",
"import java.io.IOException;",
"IOException",
"java.io",
"import java.io.InputStreamReader;",
"InputStreamReader",
"java.io",
"import java.util.Arrays;",
"Arrays",
"java.util",
"public class Main {\n\tprivate\tstatic\tBufferedReader br = null;\n\n\tstatic {\n\t\tbr = new BufferedReader(new InputStreamReader(System.in));\n\t}\n\n\t/**\n\t * @param args\n\t */\n\tpublic static void main(String[] args) {\n\t\t// TODO Auto-generated method stub\n\t\tint[]\taPair = null;\n\n\t\twhile((aPair = parsePair()) != null) {\n\t\t\tcalc(aPair);\n\t\t}\n\t}\n\n\tprivate static int[] parsePair() {\n\t\tint[]\taPair = null;\n\n\t\ttry {\n\t\t\tString line = br.readLine();\n\t\t\tif (line != null) {\n\t\t\t\tif (!line.isEmpty()) {\n\t\t\t\t\taPair = new int[2];\n\t\n\t\t\t\t\tString[]\tas = line.split(\" \");\n\t\t\t\t\tint\t\t\tn1 = Integer.parseInt(as[0]);\n\t\t\t\t\tint\t\t\tn2 = Integer.parseInt(as[1]);\n\t\n\t\t\t\t\taPair[0] = n1;\n\t\t\t\t\taPair[1] = n2;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tcatch (NumberFormatException e) {}\n\t\tcatch (IOException e) {}\n\n\t\treturn aPair;\n\t}\n\n\tprivate static void calc(int[] aMatrix) {\n\t\tint\tnGcd = gcd(aMatrix[0], aMatrix[1]);\t\t\t\t\t\t\t// 最大公約数\n\t\tint\tnLcm = (nGcd == 0) ? 0 : aMatrix[0] * (aMatrix[1] / nGcd);\t// 最小公倍数\n\n\t\tSystem.out.printf(\"%d %d\\n\", nGcd, nLcm);\n\t}\n\n\tprivate static int gcd(int n1, int n2) {\n\t\tint\t\tnGcd = 0;\t\t\t// 最大公約数\n\t\tint[]\taNum = new int[3];\t// 計算用の配列\n\n\t\tif (n1 == n2) {\n\t\t\tnGcd = n1;\n\t\t}\n\t\telse {\n\t\t\taNum[0] = n1;\n\t\t\taNum[1] = n2;\n\t\t\taNum[2] = Math.abs(n1 - n2);\n\n\t\t\tArrays.sort(aNum);\n\t\t\tnGcd = gcd(aNum[0], aNum[1]);\n\t\t}\n\t\t\n\t\treturn nGcd;\n\t}\n}",
"Main",
"private\tstatic\tBufferedReader br = null;",
"br",
"null",
"/**\n\t * @param args\n\t */\n\tpublic static void main(String[] args) {\n\t\t// TODO Auto-generated method stub\n\t\tint[]\taPair = null;\n\n\t\twhile((aPair = parsePair()) != null) {\n\t\t\tcalc(aPair);\n\t\t}\n\t}",
"main",
"{\n\t\t// TODO Auto-generated method stub\n\t\tint[]\taPair = null;\n\n\t\twhile((aPair = parsePair()) != null) {\n\t\t\tcalc(aPair);\n\t\t}\n\t}",
"int[]\taPair = null;",
"aPair",
"null",
"while((aPair = parsePair()) != null) {\n\t\t\tcalc(aPair);\n\t\t}",
"(aPair = parsePair()) != null",
"(aPair = parsePair())",
"aPair",
"parsePair()",
"parsePair",
"null",
"{\n\t\t\tcalc(aPair);\n\t\t}",
"calc(aPair)",
"calc",
"aPair",
"String[] args",
"args",
"private static int[] parsePair() {\n\t\tint[]\taPair = null;\n\n\t\ttry {\n\t\t\tString line = br.readLine();\n\t\t\tif (line != null) {\n\t\t\t\tif (!line.isEmpty()) {\n\t\t\t\t\taPair = new int[2];\n\t\n\t\t\t\t\tString[]\tas = line.split(\" \");\n\t\t\t\t\tint\t\t\tn1 = Integer.parseInt(as[0]);\n\t\t\t\t\tint\t\t\tn2 = Integer.parseInt(as[1]);\n\t\n\t\t\t\t\taPair[0] = n1;\n\t\t\t\t\taPair[1] = n2;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tcatch (NumberFormatException e) {}\n\t\tcatch (IOException e) {}\n\n\t\treturn aPair;\n\t}",
"parsePair",
"{\n\t\tint[]\taPair = null;\n\n\t\ttry {\n\t\t\tString line = br.readLine();\n\t\t\tif (line != null) {\n\t\t\t\tif (!line.isEmpty()) {\n\t\t\t\t\taPair = new int[2];\n\t\n\t\t\t\t\tString[]\tas = line.split(\" \");\n\t\t\t\t\tint\t\t\tn1 = Integer.parseInt(as[0]);\n\t\t\t\t\tint\t\t\tn2 = Integer.parseInt(as[1]);\n\t\n\t\t\t\t\taPair[0] = n1;\n\t\t\t\t\taPair[1] = n2;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tcatch (NumberFormatException e) {}\n\t\tcatch (IOException e) {}\n\n\t\treturn aPair;\n\t}",
"int[]\taPair = null;",
"aPair",
"null",
"try {\n\t\t\tString line = br.readLine();\n\t\t\tif (line != null) {\n\t\t\t\tif (!line.isEmpty()) {\n\t\t\t\t\taPair = new int[2];\n\t\n\t\t\t\t\tString[]\tas = line.split(\" \");\n\t\t\t\t\tint\t\t\tn1 = Integer.parseInt(as[0]);\n\t\t\t\t\tint\t\t\tn2 = Integer.parseInt(as[1]);\n\t\n\t\t\t\t\taPair[0] = n1;\n\t\t\t\t\taPair[1] = n2;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tcatch (NumberFormatException e) {}\n\t\tcatch (IOException e) {}",
"catch (NumberFormatException e) {}",
"NumberFormatException e",
"{}",
"catch (IOException e) {}",
"IOException e",
"{}",
"{\n\t\t\tString line = br.readLine();\n\t\t\tif (line != null) {\n\t\t\t\tif (!line.isEmpty()) {\n\t\t\t\t\taPair = new int[2];\n\t\n\t\t\t\t\tString[]\tas = line.split(\" \");\n\t\t\t\t\tint\t\t\tn1 = Integer.parseInt(as[0]);\n\t\t\t\t\tint\t\t\tn2 = Integer.parseInt(as[1]);\n\t\n\t\t\t\t\taPair[0] = n1;\n\t\t\t\t\taPair[1] = n2;\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"String line = br.readLine();",
"line",
"br.readLine()",
"br.readLine",
"br",
"if (line != null) {\n\t\t\t\tif (!line.isEmpty()) {\n\t\t\t\t\taPair = new int[2];\n\t\n\t\t\t\t\tString[]\tas = line.split(\" \");\n\t\t\t\t\tint\t\t\tn1 = Integer.parseInt(as[0]);\n\t\t\t\t\tint\t\t\tn2 = Integer.parseInt(as[1]);\n\t\n\t\t\t\t\taPair[0] = n1;\n\t\t\t\t\taPair[1] = n2;\n\t\t\t\t}\n\t\t\t}",
"line != null",
"line",
"null",
"{\n\t\t\t\tif (!line.isEmpty()) {\n\t\t\t\t\taPair = new int[2];\n\t\n\t\t\t\t\tString[]\tas = line.split(\" \");\n\t\t\t\t\tint\t\t\tn1 = Integer.parseInt(as[0]);\n\t\t\t\t\tint\t\t\tn2 = Integer.parseInt(as[1]);\n\t\n\t\t\t\t\taPair[0] = n1;\n\t\t\t\t\taPair[1] = n2;\n\t\t\t\t}\n\t\t\t}",
"if (!line.isEmpty()) {\n\t\t\t\t\taPair = new int[2];\n\t\n\t\t\t\t\tString[]\tas = line.split(\" \");\n\t\t\t\t\tint\t\t\tn1 = Integer.parseInt(as[0]);\n\t\t\t\t\tint\t\t\tn2 = Integer.parseInt(as[1]);\n\t\n\t\t\t\t\taPair[0] = n1;\n\t\t\t\t\taPair[1] = n2;\n\t\t\t\t}",
"!line.isEmpty()",
"line.isEmpty()",
"line.isEmpty",
"line",
"{\n\t\t\t\t\taPair = new int[2];\n\t\n\t\t\t\t\tString[]\tas = line.split(\" \");\n\t\t\t\t\tint\t\t\tn1 = Integer.parseInt(as[0]);\n\t\t\t\t\tint\t\t\tn2 = Integer.parseInt(as[1]);\n\t\n\t\t\t\t\taPair[0] = n1;\n\t\t\t\t\taPair[1] = n2;\n\t\t\t\t}",
"aPair = new int[2]",
"aPair",
"new int[2]",
"2",
"String[]\tas = line.split(\" \");",
"as",
"line.split(\" \")",
"line.split",
"line",
"\" \"",
"int\t\t\tn1 = Integer.parseInt(as[0]);",
"n1",
"Integer.parseInt(as[0])",
"Integer.parseInt",
"Integer",
"as[0]",
"as",
"0",
"int\t\t\tn2 = Integer.parseInt(as[1]);",
"n2",
"Integer.parseInt(as[1])",
"Integer.parseInt",
"Integer",
"as[1]",
"as",
"1",
"aPair[0] = n1",
"aPair[0]",
"aPair",
"0",
"n1",
"aPair[1] = n2",
"aPair[1]",
"aPair",
"1",
"n2",
"return aPair;",
"aPair",
"private static void calc(int[] aMatrix) {\n\t\tint\tnGcd = gcd(aMatrix[0], aMatrix[1]);\t\t\t\t\t\t\t// 最大公約数\n\t\tint\tnLcm = (nGcd == 0) ? 0 : aMatrix[0] * (aMatrix[1] / nGcd);\t// 最小公倍数\n\n\t\tSystem.out.printf(\"%d %d\\n\", nGcd, nLcm);\n\t}",
"calc",
"{\n\t\tint\tnGcd = gcd(aMatrix[0], aMatrix[1]);\t\t\t\t\t\t\t// 最大公約数\n\t\tint\tnLcm = (nGcd == 0) ? 0 : aMatrix[0] * (aMatrix[1] / nGcd);\t// 最小公倍数\n\n\t\tSystem.out.printf(\"%d %d\\n\", nGcd, nLcm);\n\t}",
"int\tnGcd = gcd(aMatrix[0], aMatrix[1]);",
"nGcd",
"gcd(aMatrix[0], aMatrix[1])",
"gcd",
"aMatrix[0]",
"aMatrix",
"0",
"aMatrix[1]",
"aMatrix",
"1",
"int\tnLcm = (nGcd == 0) ? 0 : aMatrix[0] * (aMatrix[1] / nGcd);",
"nLcm",
"(nGcd == 0) ? 0 : aMatrix[0] * (aMatrix[1] / nGcd)",
"(nGcd == 0)",
"nGcd",
"0",
"0",
"aMatrix[0] * (aMatrix[1] / nGcd)",
"aMatrix[0]",
"aMatrix",
"0",
"(aMatrix[1] / nGcd)",
"aMatrix[1]",
"aMatrix",
"1",
"nGcd",
"System.out.printf(\"%d %d\\n\", nGcd, nLcm)",
"System.out.printf",
"System.out",
"System",
"System.out",
"\"%d %d\\n\"",
"nGcd",
"nLcm",
"int[] aMatrix",
"aMatrix",
"private static int gcd(int n1, int n2) {\n\t\tint\t\tnGcd = 0;\t\t\t// 最大公約数\n\t\tint[]\taNum = new int[3];\t// 計算用の配列\n\n\t\tif (n1 == n2) {\n\t\t\tnGcd = n1;\n\t\t}\n\t\telse {\n\t\t\taNum[0] = n1;\n\t\t\taNum[1] = n2;\n\t\t\taNum[2] = Math.abs(n1 - n2);\n\n\t\t\tArrays.sort(aNum);\n\t\t\tnGcd = gcd(aNum[0], aNum[1]);\n\t\t}\n\t\t\n\t\treturn nGcd;\n\t}",
"gcd",
"{\n\t\tint\t\tnGcd = 0;\t\t\t// 最大公約数\n\t\tint[]\taNum = new int[3];\t// 計算用の配列\n\n\t\tif (n1 == n2) {\n\t\t\tnGcd = n1;\n\t\t}\n\t\telse {\n\t\t\taNum[0] = n1;\n\t\t\taNum[1] = n2;\n\t\t\taNum[2] = Math.abs(n1 - n2);\n\n\t\t\tArrays.sort(aNum);\n\t\t\tnGcd = gcd(aNum[0], aNum[1]);\n\t\t}\n\t\t\n\t\treturn nGcd;\n\t}",
"int\t\tnGcd = 0;",
"nGcd",
"0",
"int[]\taNum = new int[3];",
"aNum",
"new int[3]",
"3",
"if (n1 == n2) {\n\t\t\tnGcd = n1;\n\t\t}\n\t\telse {\n\t\t\taNum[0] = n1;\n\t\t\taNum[1] = n2;\n\t\t\taNum[2] = Math.abs(n1 - n2);\n\n\t\t\tArrays.sort(aNum);\n\t\t\tnGcd = gcd(aNum[0], aNum[1]);\n\t\t}",
"n1 == n2",
"n1",
"n2",
"{\n\t\t\tnGcd = n1;\n\t\t}",
"nGcd = n1",
"nGcd",
"n1",
"{\n\t\t\taNum[0] = n1;\n\t\t\taNum[1] = n2;\n\t\t\taNum[2] = Math.abs(n1 - n2);\n\n\t\t\tArrays.sort(aNum);\n\t\t\tnGcd = gcd(aNum[0], aNum[1]);\n\t\t}",
"aNum[0] = n1",
"aNum[0]",
"aNum",
"0",
"n1",
"aNum[1] = n2",
"aNum[1]",
"aNum",
"1",
"n2",
"aNum[2] = Math.abs(n1 - n2)",
"aNum[2]",
"aNum",
"2",
"Math.abs(n1 - n2)",
"Math.abs",
"Math",
"n1 - n2",
"n1",
"n2",
"Arrays.sort(aNum)",
"Arrays.sort",
"Arrays",
"aNum",
"nGcd = gcd(aNum[0], aNum[1])",
"nGcd",
"gcd(aNum[0], aNum[1])",
"gcd",
"aNum[0]",
"aNum",
"0",
"aNum[1]",
"aNum",
"1",
"return nGcd;",
"nGcd",
"int n1",
"n1",
"int n2",
"n2",
"public class Main {\n\tprivate\tstatic\tBufferedReader br = null;\n\n\tstatic {\n\t\tbr = new BufferedReader(new InputStreamReader(System.in));\n\t}\n\n\t/**\n\t * @param args\n\t */\n\tpublic static void main(String[] args) {\n\t\t// TODO Auto-generated method stub\n\t\tint[]\taPair = null;\n\n\t\twhile((aPair = parsePair()) != null) {\n\t\t\tcalc(aPair);\n\t\t}\n\t}\n\n\tprivate static int[] parsePair() {\n\t\tint[]\taPair = null;\n\n\t\ttry {\n\t\t\tString line = br.readLine();\n\t\t\tif (line != null) {\n\t\t\t\tif (!line.isEmpty()) {\n\t\t\t\t\taPair = new int[2];\n\t\n\t\t\t\t\tString[]\tas = line.split(\" \");\n\t\t\t\t\tint\t\t\tn1 = Integer.parseInt(as[0]);\n\t\t\t\t\tint\t\t\tn2 = Integer.parseInt(as[1]);\n\t\n\t\t\t\t\taPair[0] = n1;\n\t\t\t\t\taPair[1] = n2;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tcatch (NumberFormatException e) {}\n\t\tcatch (IOException e) {}\n\n\t\treturn aPair;\n\t}\n\n\tprivate static void calc(int[] aMatrix) {\n\t\tint\tnGcd = gcd(aMatrix[0], aMatrix[1]);\t\t\t\t\t\t\t// 最大公約数\n\t\tint\tnLcm = (nGcd == 0) ? 0 : aMatrix[0] * (aMatrix[1] / nGcd);\t// 最小公倍数\n\n\t\tSystem.out.printf(\"%d %d\\n\", nGcd, nLcm);\n\t}\n\n\tprivate static int gcd(int n1, int n2) {\n\t\tint\t\tnGcd = 0;\t\t\t// 最大公約数\n\t\tint[]\taNum = new int[3];\t// 計算用の配列\n\n\t\tif (n1 == n2) {\n\t\t\tnGcd = n1;\n\t\t}\n\t\telse {\n\t\t\taNum[0] = n1;\n\t\t\taNum[1] = n2;\n\t\t\taNum[2] = Math.abs(n1 - n2);\n\n\t\t\tArrays.sort(aNum);\n\t\t\tnGcd = gcd(aNum[0], aNum[1]);\n\t\t}\n\t\t\n\t\treturn nGcd;\n\t}\n}",
"public class Main {\n\tprivate\tstatic\tBufferedReader br = null;\n\n\tstatic {\n\t\tbr = new BufferedReader(new InputStreamReader(System.in));\n\t}\n\n\t/**\n\t * @param args\n\t */\n\tpublic static void main(String[] args) {\n\t\t// TODO Auto-generated method stub\n\t\tint[]\taPair = null;\n\n\t\twhile((aPair = parsePair()) != null) {\n\t\t\tcalc(aPair);\n\t\t}\n\t}\n\n\tprivate static int[] parsePair() {\n\t\tint[]\taPair = null;\n\n\t\ttry {\n\t\t\tString line = br.readLine();\n\t\t\tif (line != null) {\n\t\t\t\tif (!line.isEmpty()) {\n\t\t\t\t\taPair = new int[2];\n\t\n\t\t\t\t\tString[]\tas = line.split(\" \");\n\t\t\t\t\tint\t\t\tn1 = Integer.parseInt(as[0]);\n\t\t\t\t\tint\t\t\tn2 = Integer.parseInt(as[1]);\n\t\n\t\t\t\t\taPair[0] = n1;\n\t\t\t\t\taPair[1] = n2;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tcatch (NumberFormatException e) {}\n\t\tcatch (IOException e) {}\n\n\t\treturn aPair;\n\t}\n\n\tprivate static void calc(int[] aMatrix) {\n\t\tint\tnGcd = gcd(aMatrix[0], aMatrix[1]);\t\t\t\t\t\t\t// 最大公約数\n\t\tint\tnLcm = (nGcd == 0) ? 0 : aMatrix[0] * (aMatrix[1] / nGcd);\t// 最小公倍数\n\n\t\tSystem.out.printf(\"%d %d\\n\", nGcd, nLcm);\n\t}\n\n\tprivate static int gcd(int n1, int n2) {\n\t\tint\t\tnGcd = 0;\t\t\t// 最大公約数\n\t\tint[]\taNum = new int[3];\t// 計算用の配列\n\n\t\tif (n1 == n2) {\n\t\t\tnGcd = n1;\n\t\t}\n\t\telse {\n\t\t\taNum[0] = n1;\n\t\t\taNum[1] = n2;\n\t\t\taNum[2] = Math.abs(n1 - n2);\n\n\t\t\tArrays.sort(aNum);\n\t\t\tnGcd = gcd(aNum[0], aNum[1]);\n\t\t}\n\t\t\n\t\treturn nGcd;\n\t}\n}",
"Main"
] | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Arrays;
public class Main {
private static BufferedReader br = null;
static {
br = new BufferedReader(new InputStreamReader(System.in));
}
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
int[] aPair = null;
while((aPair = parsePair()) != null) {
calc(aPair);
}
}
private static int[] parsePair() {
int[] aPair = null;
try {
String line = br.readLine();
if (line != null) {
if (!line.isEmpty()) {
aPair = new int[2];
String[] as = line.split(" ");
int n1 = Integer.parseInt(as[0]);
int n2 = Integer.parseInt(as[1]);
aPair[0] = n1;
aPair[1] = n2;
}
}
}
catch (NumberFormatException e) {}
catch (IOException e) {}
return aPair;
}
private static void calc(int[] aMatrix) {
int nGcd = gcd(aMatrix[0], aMatrix[1]); // 最大公約数
int nLcm = (nGcd == 0) ? 0 : aMatrix[0] * (aMatrix[1] / nGcd); // 最小公倍数
System.out.printf("%d %d\n", nGcd, nLcm);
}
private static int gcd(int n1, int n2) {
int nGcd = 0; // 最大公約数
int[] aNum = new int[3]; // 計算用の配列
if (n1 == n2) {
nGcd = n1;
}
else {
aNum[0] = n1;
aNum[1] = n2;
aNum[2] = Math.abs(n1 - n2);
Arrays.sort(aNum);
nGcd = gcd(aNum[0], aNum[1]);
}
return nGcd;
}
} |
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
42,
2,
13,
17,
30,
41,
13,
13,
0,
13,
2,
13,
13,
0,
13,
13,
29,
13,
23,
13,
23,
13,
12,
13,
30,
29,
2,
13,
2,
13,
4,
13,
13,
13,
23,
13,
23,
13,
12,
13,
30,
41,
13,
20,
41,
13,
41,
13,
41,
13,
41,
13,
41,
13,
41,
13,
41,
13,
41,
13,
41,
13,
41,
13,
42,
2,
2,
0,
13,
4,
18,
13,
17,
40,
4,
18,
13,
17,
30,
41,
13,
4,
18,
13,
17,
0,
13,
4,
18,
13,
18,
13,
17,
0,
13,
4,
18,
13,
18,
13,
17,
4,
18,
18,
13,
13,
2,
2,
4,
13,
13,
13,
17,
4,
13,
13,
13,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
10,
11
],
[
10,
12
],
[
0,
13
],
[
13,
14
],
[
13,
15
],
[
0,
16
],
[
141,
17
],
[
141,
18
],
[
18,
19
],
[
18,
20
],
[
20,
21
],
[
21,
22
],
[
22,
23
],
[
22,
24
],
[
21,
25
],
[
25,
26
],
[
26,
27
],
[
26,
28
],
[
25,
29
],
[
29,
30
],
[
29,
31
],
[
31,
32
],
[
31,
33
],
[
25,
34
],
[
34,
35
],
[
34,
36
],
[
20,
37
],
[
37,
38
],
[
18,
39
],
[
39,
40
],
[
18,
41
],
[
41,
42
],
[
141,
43
],
[
43,
44
],
[
43,
45
],
[
45,
46
],
[
46,
47
],
[
47,
48
],
[
47,
49
],
[
49,
50
],
[
49,
51
],
[
51,
52
],
[
51,
53
],
[
51,
54
],
[
43,
55
],
[
55,
56
],
[
43,
57
],
[
57,
58
],
[
141,
59
],
[
59,
60
],
[
59,
61
],
[
61,
62
],
[
62,
63
],
[
62,
64
],
[
61,
65
],
[
65,
66
],
[
61,
67
],
[
67,
68
],
[
61,
69
],
[
69,
70
],
[
61,
71
],
[
71,
72
],
[
61,
73
],
[
73,
74
],
[
61,
75
],
[
75,
76
],
[
61,
77
],
[
77,
78
],
[
61,
79
],
[
79,
80
],
[
61,
81
],
[
81,
82
],
[
61,
83
],
[
83,
84
],
[
61,
85
],
[
85,
86
],
[
86,
87
],
[
87,
88
],
[
88,
89
],
[
88,
90
],
[
90,
91
],
[
91,
92
],
[
87,
93
],
[
86,
94
],
[
94,
95
],
[
95,
96
],
[
96,
97
],
[
95,
98
],
[
85,
99
],
[
99,
100
],
[
100,
101
],
[
100,
102
],
[
102,
103
],
[
103,
104
],
[
102,
105
],
[
99,
106
],
[
106,
107
],
[
106,
108
],
[
108,
109
],
[
109,
110
],
[
108,
111
],
[
111,
112
],
[
111,
113
],
[
99,
114
],
[
114,
115
],
[
114,
116
],
[
116,
117
],
[
117,
118
],
[
116,
119
],
[
119,
120
],
[
119,
121
],
[
99,
122
],
[
122,
123
],
[
123,
124
],
[
124,
125
],
[
124,
126
],
[
122,
127
],
[
128,
128
],
[
128,
129
],
[
129,
130
],
[
129,
131
],
[
129,
132
],
[
128,
133
],
[
128,
134
],
[
134,
135
],
[
134,
136
],
[
134,
137
],
[
59,
138
],
[
138,
139
],
[
0,
140
],
[
140,
141
],
[
140,
142
]
] | [
"import java.io.BufferedReader;\nimport java.io.InputStreamReader;\nimport java.math.BigInteger;\nimport java.util.*;\nimport java.util.stream.IntStream;\n\n\npublic class Main {\n private static int gcd(int a, int b)\n {\n while (b > 0)\n {\n int temp = b;\n b = a % b; // % is remainder\n a = temp;\n }\n return a;\n }\n\n private static int lcm(int a, int b)\n {\n return a * (b / gcd(a, b));\n }\n\n\n public static void main(String[] args) throws java.lang.Exception {\n BufferedReader in\n = new BufferedReader(new InputStreamReader(System.in));\n\n String line;\n int rows, cols;\n int two, three, a, b;\n double rate;\n boolean checker;\n double count;\n while ((line = in.readLine()) != null && !(line.equals(\"\"))) {\n String [] temp = line.split(\" \");\n a = Integer.parseInt(temp[0]);\n b = Integer.parseInt(temp[1]);\n\n System.out.println(gcd(a, b) + \" \" +lcm(a, b));\n\n }\n\n\n }\n}",
"import java.io.BufferedReader;",
"BufferedReader",
"java.io",
"import java.io.InputStreamReader;",
"InputStreamReader",
"java.io",
"import java.math.BigInteger;",
"BigInteger",
"java.math",
"import java.util.*;",
"util.*",
"java",
"import java.util.stream.IntStream;",
"IntStream",
"java.util.stream",
"public class Main {\n private static int gcd(int a, int b)\n {\n while (b > 0)\n {\n int temp = b;\n b = a % b; // % is remainder\n a = temp;\n }\n return a;\n }\n\n private static int lcm(int a, int b)\n {\n return a * (b / gcd(a, b));\n }\n\n\n public static void main(String[] args) throws java.lang.Exception {\n BufferedReader in\n = new BufferedReader(new InputStreamReader(System.in));\n\n String line;\n int rows, cols;\n int two, three, a, b;\n double rate;\n boolean checker;\n double count;\n while ((line = in.readLine()) != null && !(line.equals(\"\"))) {\n String [] temp = line.split(\" \");\n a = Integer.parseInt(temp[0]);\n b = Integer.parseInt(temp[1]);\n\n System.out.println(gcd(a, b) + \" \" +lcm(a, b));\n\n }\n\n\n }\n}",
"Main",
"private static int gcd(int a, int b)\n {\n while (b > 0)\n {\n int temp = b;\n b = a % b; // % is remainder\n a = temp;\n }\n return a;\n }",
"gcd",
"{\n while (b > 0)\n {\n int temp = b;\n b = a % b; // % is remainder\n a = temp;\n }\n return a;\n }",
"while (b > 0)\n {\n int temp = b;\n b = a % b; // % is remainder\n a = temp;\n }",
"b > 0",
"b",
"0",
"{\n int temp = b;\n b = a % b; // % is remainder\n a = temp;\n }",
"int temp = b;",
"temp",
"b",
"b = a % b",
"b",
"a % b",
"a",
"b",
"a = temp",
"a",
"temp",
"return a;",
"a",
"int a",
"a",
"int b",
"b",
"private static int lcm(int a, int b)\n {\n return a * (b / gcd(a, b));\n }",
"lcm",
"{\n return a * (b / gcd(a, b));\n }",
"return a * (b / gcd(a, b));",
"a * (b / gcd(a, b))",
"a",
"(b / gcd(a, b))",
"b",
"gcd(a, b)",
"gcd",
"a",
"b",
"int a",
"a",
"int b",
"b",
"public static void main(String[] args) throws java.lang.Exception {\n BufferedReader in\n = new BufferedReader(new InputStreamReader(System.in));\n\n String line;\n int rows, cols;\n int two, three, a, b;\n double rate;\n boolean checker;\n double count;\n while ((line = in.readLine()) != null && !(line.equals(\"\"))) {\n String [] temp = line.split(\" \");\n a = Integer.parseInt(temp[0]);\n b = Integer.parseInt(temp[1]);\n\n System.out.println(gcd(a, b) + \" \" +lcm(a, b));\n\n }\n\n\n }",
"main",
"{\n BufferedReader in\n = new BufferedReader(new InputStreamReader(System.in));\n\n String line;\n int rows, cols;\n int two, three, a, b;\n double rate;\n boolean checker;\n double count;\n while ((line = in.readLine()) != null && !(line.equals(\"\"))) {\n String [] temp = line.split(\" \");\n a = Integer.parseInt(temp[0]);\n b = Integer.parseInt(temp[1]);\n\n System.out.println(gcd(a, b) + \" \" +lcm(a, b));\n\n }\n\n\n }",
"BufferedReader in\n = new BufferedReader(new InputStreamReader(System.in));",
"in",
"new BufferedReader(new InputStreamReader(System.in))",
"String line;",
"line",
"int rows",
"rows",
"cols;",
"cols",
"int two",
"two",
"three",
"three",
"a",
"a",
"b;",
"b",
"double rate;",
"rate",
"boolean checker;",
"checker",
"double count;",
"count",
"while ((line = in.readLine()) != null && !(line.equals(\"\"))) {\n String [] temp = line.split(\" \");\n a = Integer.parseInt(temp[0]);\n b = Integer.parseInt(temp[1]);\n\n System.out.println(gcd(a, b) + \" \" +lcm(a, b));\n\n }",
"(line = in.readLine()) != null && !(line.equals(\"\"))",
"(line = in.readLine()) != null",
"(line = in.readLine())",
"line",
"in.readLine()",
"in.readLine",
"in",
"null",
"!(line.equals(\"\"))",
"(line.equals(\"\"))",
"line.equals",
"line",
"\"\"",
"{\n String [] temp = line.split(\" \");\n a = Integer.parseInt(temp[0]);\n b = Integer.parseInt(temp[1]);\n\n System.out.println(gcd(a, b) + \" \" +lcm(a, b));\n\n }",
"String [] temp = line.split(\" \");",
"temp",
"line.split(\" \")",
"line.split",
"line",
"\" \"",
"a = Integer.parseInt(temp[0])",
"a",
"Integer.parseInt(temp[0])",
"Integer.parseInt",
"Integer",
"temp[0]",
"temp",
"0",
"b = Integer.parseInt(temp[1])",
"b",
"Integer.parseInt(temp[1])",
"Integer.parseInt",
"Integer",
"temp[1]",
"temp",
"1",
"System.out.println(gcd(a, b) + \" \" +lcm(a, b))",
"System.out.println",
"System.out",
"System",
"System.out",
"gcd(a, b) + \" \" +lcm(a, b)",
"gcd(a, b) + \" \" +lcm(a, b)",
"gcd(a, b)",
"gcd",
"a",
"b",
"\" \"",
"lcm(a, b)",
"lcm",
"a",
"b",
"String[] args",
"args",
"public class Main {\n private static int gcd(int a, int b)\n {\n while (b > 0)\n {\n int temp = b;\n b = a % b; // % is remainder\n a = temp;\n }\n return a;\n }\n\n private static int lcm(int a, int b)\n {\n return a * (b / gcd(a, b));\n }\n\n\n public static void main(String[] args) throws java.lang.Exception {\n BufferedReader in\n = new BufferedReader(new InputStreamReader(System.in));\n\n String line;\n int rows, cols;\n int two, three, a, b;\n double rate;\n boolean checker;\n double count;\n while ((line = in.readLine()) != null && !(line.equals(\"\"))) {\n String [] temp = line.split(\" \");\n a = Integer.parseInt(temp[0]);\n b = Integer.parseInt(temp[1]);\n\n System.out.println(gcd(a, b) + \" \" +lcm(a, b));\n\n }\n\n\n }\n}",
"public class Main {\n private static int gcd(int a, int b)\n {\n while (b > 0)\n {\n int temp = b;\n b = a % b; // % is remainder\n a = temp;\n }\n return a;\n }\n\n private static int lcm(int a, int b)\n {\n return a * (b / gcd(a, b));\n }\n\n\n public static void main(String[] args) throws java.lang.Exception {\n BufferedReader in\n = new BufferedReader(new InputStreamReader(System.in));\n\n String line;\n int rows, cols;\n int two, three, a, b;\n double rate;\n boolean checker;\n double count;\n while ((line = in.readLine()) != null && !(line.equals(\"\"))) {\n String [] temp = line.split(\" \");\n a = Integer.parseInt(temp[0]);\n b = Integer.parseInt(temp[1]);\n\n System.out.println(gcd(a, b) + \" \" +lcm(a, b));\n\n }\n\n\n }\n}",
"Main"
] | import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.math.BigInteger;
import java.util.*;
import java.util.stream.IntStream;
public class Main {
private static int gcd(int a, int b)
{
while (b > 0)
{
int temp = b;
b = a % b; // % is remainder
a = temp;
}
return a;
}
private static int lcm(int a, int b)
{
return a * (b / gcd(a, b));
}
public static void main(String[] args) throws java.lang.Exception {
BufferedReader in
= new BufferedReader(new InputStreamReader(System.in));
String line;
int rows, cols;
int two, three, a, b;
double rate;
boolean checker;
double count;
while ((line = in.readLine()) != null && !(line.equals(""))) {
String [] temp = line.split(" ");
a = Integer.parseInt(temp[0]);
b = Integer.parseInt(temp[1]);
System.out.println(gcd(a, b) + " " +lcm(a, b));
}
}
} |
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
20,
17,
41,
13,
41,
13,
41,
13,
20,
17,
41,
13,
42,
2,
0,
13,
4,
18,
13,
17,
30,
0,
13,
4,
18,
13,
17,
11,
1,
41,
13,
17,
2,
13,
18,
13,
13,
1,
40,
13,
30,
30,
0,
18,
13,
13,
4,
18,
13,
18,
13,
13,
0,
13,
4,
13,
18,
13,
17,
18,
13,
17,
0,
13,
4,
13,
18,
13,
17,
18,
13,
17,
4,
18,
18,
13,
13,
17,
13,
13,
23,
13,
12,
13,
30,
14,
2,
13,
13,
30,
41,
13,
0,
13,
13,
0,
13,
13,
0,
13,
13,
42,
2,
13,
17,
30,
41,
13,
13,
0,
13,
2,
13,
13,
0,
13,
13,
29,
13,
23,
13,
23,
13,
12,
13,
30,
29,
2,
2,
13,
13,
4,
13,
13,
13,
23,
13,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
10,
11
],
[
10,
12
],
[
0,
13
],
[
13,
14
],
[
13,
15
],
[
0,
16
],
[
166,
17
],
[
166,
18
],
[
18,
19
],
[
18,
20
],
[
20,
21
],
[
21,
22
],
[
21,
23
],
[
20,
24
],
[
24,
25
],
[
24,
26
],
[
20,
28
],
[
28,
29
],
[
20,
30
],
[
30,
31
],
[
20,
32
],
[
32,
33
],
[
32,
34
],
[
20,
36
],
[
36,
37
],
[
20,
38
],
[
38,
39
],
[
39,
40
],
[
40,
41
],
[
40,
42
],
[
42,
43
],
[
43,
44
],
[
39,
45
],
[
38,
46
],
[
46,
47
],
[
47,
48
],
[
47,
49
],
[
49,
50
],
[
50,
51
],
[
49,
52
],
[
46,
53
],
[
53,
54
],
[
54,
55
],
[
55,
56
],
[
55,
57
],
[
53,
58
],
[
58,
59
],
[
58,
60
],
[
60,
61
],
[
60,
62
],
[
53,
63
],
[
63,
64
],
[
64,
65
],
[
53,
66
],
[
67,
67
],
[
67,
68
],
[
68,
69
],
[
69,
70
],
[
69,
71
],
[
68,
72
],
[
72,
73
],
[
73,
74
],
[
72,
75
],
[
75,
76
],
[
75,
77
],
[
46,
78
],
[
78,
79
],
[
78,
80
],
[
80,
81
],
[
80,
82
],
[
82,
83
],
[
82,
84
],
[
80,
85
],
[
85,
86
],
[
85,
87
],
[
46,
88
],
[
88,
89
],
[
88,
90
],
[
90,
91
],
[
90,
92
],
[
92,
93
],
[
92,
94
],
[
90,
95
],
[
95,
96
],
[
95,
97
],
[
46,
98
],
[
98,
99
],
[
99,
100
],
[
100,
101
],
[
100,
102
],
[
98,
103
],
[
98,
104
],
[
98,
105
],
[
18,
106
],
[
106,
107
],
[
166,
108
],
[
108,
109
],
[
108,
110
],
[
110,
111
],
[
111,
112
],
[
112,
113
],
[
112,
114
],
[
111,
115
],
[
115,
116
],
[
116,
117
],
[
115,
118
],
[
118,
119
],
[
118,
120
],
[
115,
121
],
[
121,
122
],
[
121,
123
],
[
115,
124
],
[
124,
125
],
[
124,
126
],
[
110,
127
],
[
127,
128
],
[
128,
129
],
[
128,
130
],
[
127,
131
],
[
131,
132
],
[
132,
133
],
[
132,
134
],
[
131,
135
],
[
135,
136
],
[
135,
137
],
[
137,
138
],
[
137,
139
],
[
131,
140
],
[
140,
141
],
[
140,
142
],
[
110,
143
],
[
143,
144
],
[
108,
145
],
[
145,
146
],
[
108,
147
],
[
147,
148
],
[
166,
149
],
[
149,
150
],
[
149,
151
],
[
151,
152
],
[
152,
153
],
[
153,
154
],
[
154,
155
],
[
154,
156
],
[
153,
157
],
[
157,
158
],
[
157,
159
],
[
157,
160
],
[
149,
161
],
[
161,
162
],
[
149,
163
],
[
163,
164
],
[
0,
165
],
[
165,
166
],
[
165,
167
]
] | [
"import java.io.BufferedReader;\nimport java.io.InputStreamReader;\nimport java.lang.Exception;\nimport java.lang.String;\nimport java.lang.System;\n\npublic class Main {\n public static void main(String[] a) throws Exception {\n BufferedReader r = new BufferedReader(new InputStreamReader(System.in));\n long num[] = new long[2];\n long gcd, lcm;\n String numStr[] = new String[2];\n String str;\n\n while((str = r.readLine()) != null) {\n numStr = str.split(\" \");\n for(int i = 0; i < numStr.length; i++) {\n num[i] = Long.parseLong(numStr[i]);\n }\n gcd = getGCD(num[0], num[1]);\n lcm = getLCM(num[0], num[1]);\n System.out.printf(\"%d %d\\n\", gcd, lcm);\n }\n }\n\n // a, bの最大公約数を求める\n private static long getGCD(long a, long b) {\n if(a > b) {\n long tmp;\n tmp = a;\n a = b;\n b = tmp;\n }\n\n while(a != 0) {\n long tmp = a;\n a = b%a;\n b = tmp;\n }\n\n return b;\n }\n\n // a, bの最小公倍数を求める\n private static long getLCM(long a, long b) {\n return (a * b)/getGCD(a, b);\n }\n}",
"import java.io.BufferedReader;",
"BufferedReader",
"java.io",
"import java.io.InputStreamReader;",
"InputStreamReader",
"java.io",
"import java.lang.Exception;",
"Exception",
"java.lang",
"import java.lang.String;",
"String",
"java.lang",
"import java.lang.System;",
"System",
"java.lang",
"public class Main {\n public static void main(String[] a) throws Exception {\n BufferedReader r = new BufferedReader(new InputStreamReader(System.in));\n long num[] = new long[2];\n long gcd, lcm;\n String numStr[] = new String[2];\n String str;\n\n while((str = r.readLine()) != null) {\n numStr = str.split(\" \");\n for(int i = 0; i < numStr.length; i++) {\n num[i] = Long.parseLong(numStr[i]);\n }\n gcd = getGCD(num[0], num[1]);\n lcm = getLCM(num[0], num[1]);\n System.out.printf(\"%d %d\\n\", gcd, lcm);\n }\n }\n\n // a, bの最大公約数を求める\n private static long getGCD(long a, long b) {\n if(a > b) {\n long tmp;\n tmp = a;\n a = b;\n b = tmp;\n }\n\n while(a != 0) {\n long tmp = a;\n a = b%a;\n b = tmp;\n }\n\n return b;\n }\n\n // a, bの最小公倍数を求める\n private static long getLCM(long a, long b) {\n return (a * b)/getGCD(a, b);\n }\n}",
"Main",
"public static void main(String[] a) throws Exception {\n BufferedReader r = new BufferedReader(new InputStreamReader(System.in));\n long num[] = new long[2];\n long gcd, lcm;\n String numStr[] = new String[2];\n String str;\n\n while((str = r.readLine()) != null) {\n numStr = str.split(\" \");\n for(int i = 0; i < numStr.length; i++) {\n num[i] = Long.parseLong(numStr[i]);\n }\n gcd = getGCD(num[0], num[1]);\n lcm = getLCM(num[0], num[1]);\n System.out.printf(\"%d %d\\n\", gcd, lcm);\n }\n }",
"main",
"{\n BufferedReader r = new BufferedReader(new InputStreamReader(System.in));\n long num[] = new long[2];\n long gcd, lcm;\n String numStr[] = new String[2];\n String str;\n\n while((str = r.readLine()) != null) {\n numStr = str.split(\" \");\n for(int i = 0; i < numStr.length; i++) {\n num[i] = Long.parseLong(numStr[i]);\n }\n gcd = getGCD(num[0], num[1]);\n lcm = getLCM(num[0], num[1]);\n System.out.printf(\"%d %d\\n\", gcd, lcm);\n }\n }",
"BufferedReader r = new BufferedReader(new InputStreamReader(System.in));",
"r",
"new BufferedReader(new InputStreamReader(System.in))",
"long num[] = new long[2];",
"num",
"new long[2]",
"2",
"long gcd",
"gcd",
"lcm;",
"lcm",
"String numStr[] = new String[2];",
"numStr",
"new String[2]",
"2",
"String str;",
"str",
"while((str = r.readLine()) != null) {\n numStr = str.split(\" \");\n for(int i = 0; i < numStr.length; i++) {\n num[i] = Long.parseLong(numStr[i]);\n }\n gcd = getGCD(num[0], num[1]);\n lcm = getLCM(num[0], num[1]);\n System.out.printf(\"%d %d\\n\", gcd, lcm);\n }",
"(str = r.readLine()) != null",
"(str = r.readLine())",
"str",
"r.readLine()",
"r.readLine",
"r",
"null",
"{\n numStr = str.split(\" \");\n for(int i = 0; i < numStr.length; i++) {\n num[i] = Long.parseLong(numStr[i]);\n }\n gcd = getGCD(num[0], num[1]);\n lcm = getLCM(num[0], num[1]);\n System.out.printf(\"%d %d\\n\", gcd, lcm);\n }",
"numStr = str.split(\" \")",
"numStr",
"str.split(\" \")",
"str.split",
"str",
"\" \"",
"for(int i = 0; i < numStr.length; i++) {\n num[i] = Long.parseLong(numStr[i]);\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < numStr.length",
"i",
"numStr.length",
"numStr",
"numStr.length",
"i++",
"i++",
"i",
"{\n num[i] = Long.parseLong(numStr[i]);\n }",
"{\n num[i] = Long.parseLong(numStr[i]);\n }",
"num[i] = Long.parseLong(numStr[i])",
"num[i]",
"num",
"i",
"Long.parseLong(numStr[i])",
"Long.parseLong",
"Long",
"numStr[i]",
"numStr",
"i",
"gcd = getGCD(num[0], num[1])",
"gcd",
"getGCD(num[0], num[1])",
"getGCD",
"num[0]",
"num",
"0",
"num[1]",
"num",
"1",
"lcm = getLCM(num[0], num[1])",
"lcm",
"getLCM(num[0], num[1])",
"getLCM",
"num[0]",
"num",
"0",
"num[1]",
"num",
"1",
"System.out.printf(\"%d %d\\n\", gcd, lcm)",
"System.out.printf",
"System.out",
"System",
"System.out",
"\"%d %d\\n\"",
"gcd",
"lcm",
"String[] a",
"a",
"// a, bの最大公約数を求める\n private static long getGCD(long a, long b) {\n if(a > b) {\n long tmp;\n tmp = a;\n a = b;\n b = tmp;\n }\n\n while(a != 0) {\n long tmp = a;\n a = b%a;\n b = tmp;\n }\n\n return b;\n }",
"getGCD",
"{\n if(a > b) {\n long tmp;\n tmp = a;\n a = b;\n b = tmp;\n }\n\n while(a != 0) {\n long tmp = a;\n a = b%a;\n b = tmp;\n }\n\n return b;\n }",
"if(a > b) {\n long tmp;\n tmp = a;\n a = b;\n b = tmp;\n }",
"a > b",
"a",
"b",
"{\n long tmp;\n tmp = a;\n a = b;\n b = tmp;\n }",
"long tmp;",
"tmp",
"tmp = a",
"tmp",
"a",
"a = b",
"a",
"b",
"b = tmp",
"b",
"tmp",
"while(a != 0) {\n long tmp = a;\n a = b%a;\n b = tmp;\n }",
"a != 0",
"a",
"0",
"{\n long tmp = a;\n a = b%a;\n b = tmp;\n }",
"long tmp = a;",
"tmp",
"a",
"a = b%a",
"a",
"b%a",
"b",
"a",
"b = tmp",
"b",
"tmp",
"return b;",
"b",
"long a",
"a",
"long b",
"b",
"// a, bの最小公倍数を求める\n private static long getLCM(long a, long b) {\n return (a * b)/getGCD(a, b);\n }",
"getLCM",
"{\n return (a * b)/getGCD(a, b);\n }",
"return (a * b)/getGCD(a, b);",
"(a * b)/getGCD(a, b)",
"(a * b)",
"a",
"b",
"getGCD(a, b)",
"getGCD",
"a",
"b",
"long a",
"a",
"long b",
"b",
"public class Main {\n public static void main(String[] a) throws Exception {\n BufferedReader r = new BufferedReader(new InputStreamReader(System.in));\n long num[] = new long[2];\n long gcd, lcm;\n String numStr[] = new String[2];\n String str;\n\n while((str = r.readLine()) != null) {\n numStr = str.split(\" \");\n for(int i = 0; i < numStr.length; i++) {\n num[i] = Long.parseLong(numStr[i]);\n }\n gcd = getGCD(num[0], num[1]);\n lcm = getLCM(num[0], num[1]);\n System.out.printf(\"%d %d\\n\", gcd, lcm);\n }\n }\n\n // a, bの最大公約数を求める\n private static long getGCD(long a, long b) {\n if(a > b) {\n long tmp;\n tmp = a;\n a = b;\n b = tmp;\n }\n\n while(a != 0) {\n long tmp = a;\n a = b%a;\n b = tmp;\n }\n\n return b;\n }\n\n // a, bの最小公倍数を求める\n private static long getLCM(long a, long b) {\n return (a * b)/getGCD(a, b);\n }\n}",
"public class Main {\n public static void main(String[] a) throws Exception {\n BufferedReader r = new BufferedReader(new InputStreamReader(System.in));\n long num[] = new long[2];\n long gcd, lcm;\n String numStr[] = new String[2];\n String str;\n\n while((str = r.readLine()) != null) {\n numStr = str.split(\" \");\n for(int i = 0; i < numStr.length; i++) {\n num[i] = Long.parseLong(numStr[i]);\n }\n gcd = getGCD(num[0], num[1]);\n lcm = getLCM(num[0], num[1]);\n System.out.printf(\"%d %d\\n\", gcd, lcm);\n }\n }\n\n // a, bの最大公約数を求める\n private static long getGCD(long a, long b) {\n if(a > b) {\n long tmp;\n tmp = a;\n a = b;\n b = tmp;\n }\n\n while(a != 0) {\n long tmp = a;\n a = b%a;\n b = tmp;\n }\n\n return b;\n }\n\n // a, bの最小公倍数を求める\n private static long getLCM(long a, long b) {\n return (a * b)/getGCD(a, b);\n }\n}",
"Main"
] | import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.lang.Exception;
import java.lang.String;
import java.lang.System;
public class Main {
public static void main(String[] a) throws Exception {
BufferedReader r = new BufferedReader(new InputStreamReader(System.in));
long num[] = new long[2];
long gcd, lcm;
String numStr[] = new String[2];
String str;
while((str = r.readLine()) != null) {
numStr = str.split(" ");
for(int i = 0; i < numStr.length; i++) {
num[i] = Long.parseLong(numStr[i]);
}
gcd = getGCD(num[0], num[1]);
lcm = getLCM(num[0], num[1]);
System.out.printf("%d %d\n", gcd, lcm);
}
}
// a, bの最大公約数を求める
private static long getGCD(long a, long b) {
if(a > b) {
long tmp;
tmp = a;
a = b;
b = tmp;
}
while(a != 0) {
long tmp = a;
a = b%a;
b = tmp;
}
return b;
}
// a, bの最小公倍数を求める
private static long getLCM(long a, long b) {
return (a * b)/getGCD(a, b);
}
} |
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
41,
13,
41,
13,
41,
13,
41,
13,
41,
13,
20,
42,
2,
0,
13,
4,
18,
13,
17,
30,
0,
13,
4,
18,
13,
18,
4,
18,
13,
17,
17,
0,
13,
4,
18,
13,
18,
4,
18,
13,
17,
17,
0,
13,
13,
0,
13,
13,
14,
2,
13,
13,
30,
41,
13,
13,
0,
13,
13,
0,
13,
13,
41,
13,
42,
2,
0,
13,
2,
13,
13,
17,
30,
0,
13,
13,
0,
13,
13,
4,
18,
18,
13,
13,
2,
2,
13,
17,
2,
2,
13,
13,
13,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
113,
11
],
[
113,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
14,
17
],
[
17,
18
],
[
14,
19
],
[
19,
20
],
[
14,
21
],
[
21,
22
],
[
14,
23
],
[
23,
24
],
[
14,
25
],
[
25,
26
],
[
25,
27
],
[
14,
28
],
[
28,
29
],
[
29,
30
],
[
30,
31
],
[
30,
32
],
[
32,
33
],
[
33,
34
],
[
29,
35
],
[
28,
36
],
[
36,
37
],
[
37,
38
],
[
37,
39
],
[
39,
40
],
[
40,
41
],
[
39,
42
],
[
42,
43
],
[
43,
44
],
[
44,
45
],
[
43,
46
],
[
42,
47
],
[
36,
48
],
[
48,
49
],
[
48,
50
],
[
50,
51
],
[
51,
52
],
[
50,
53
],
[
53,
54
],
[
54,
55
],
[
55,
56
],
[
54,
57
],
[
53,
58
],
[
36,
59
],
[
59,
60
],
[
59,
61
],
[
36,
62
],
[
62,
63
],
[
62,
64
],
[
36,
65
],
[
65,
66
],
[
66,
67
],
[
66,
68
],
[
65,
69
],
[
69,
70
],
[
70,
71
],
[
70,
72
],
[
69,
73
],
[
73,
74
],
[
73,
75
],
[
69,
76
],
[
76,
77
],
[
76,
78
],
[
36,
79
],
[
79,
80
],
[
36,
81
],
[
81,
82
],
[
82,
83
],
[
83,
84
],
[
83,
85
],
[
85,
86
],
[
85,
87
],
[
82,
88
],
[
81,
89
],
[
89,
90
],
[
90,
91
],
[
90,
92
],
[
89,
93
],
[
93,
94
],
[
93,
95
],
[
36,
96
],
[
96,
97
],
[
97,
98
],
[
98,
99
],
[
98,
100
],
[
96,
101
],
[
102,
102
],
[
102,
103
],
[
102,
104
],
[
102,
105
],
[
105,
106
],
[
106,
107
],
[
106,
108
],
[
105,
109
],
[
12,
110
],
[
110,
111
],
[
0,
112
],
[
112,
113
],
[
112,
114
]
] | [
"import java.io.BufferedReader;\nimport java.io.IOException;\nimport java.io.InputStreamReader;\n\npublic class Main {\n\tpublic static void main(String[] args) throws NumberFormatException, IOException {\n\t\tlong \t\t\tx, y, origX, origY;\n\t\tString\t\t\tbuffer;\n\t\tBufferedReader \treader = new BufferedReader(new InputStreamReader(System.in));\n\n\t\twhile((buffer = reader.readLine()) != null){\n\t\t\tx = Long.parseLong(buffer.split(\" \")[0]);\n\t\t\ty = Long.parseLong(buffer.split(\" \")[1]);\n\n\t\t\torigX = x;\n\t\t\torigY = y;\n\n\t\t\tif(x < y){\n\t\t\t\tlong tmp = x;\n\t\t\t\tx = y;\n\t\t\t\ty = tmp;\n\t\t\t}\n\n\t\t\tlong mod;\n\t\t\twhile((mod = x % y) != 0){\n\t\t\t\tx = y;\n\t\t\t\ty = mod;\n\t\t\t}\n\n\t\t\tSystem.out.println(y + \" \" + (origX * origY / y));\n\t\t}\n\n\n\t}\n\n}",
"import java.io.BufferedReader;",
"BufferedReader",
"java.io",
"import java.io.IOException;",
"IOException",
"java.io",
"import java.io.InputStreamReader;",
"InputStreamReader",
"java.io",
"public class Main {\n\tpublic static void main(String[] args) throws NumberFormatException, IOException {\n\t\tlong \t\t\tx, y, origX, origY;\n\t\tString\t\t\tbuffer;\n\t\tBufferedReader \treader = new BufferedReader(new InputStreamReader(System.in));\n\n\t\twhile((buffer = reader.readLine()) != null){\n\t\t\tx = Long.parseLong(buffer.split(\" \")[0]);\n\t\t\ty = Long.parseLong(buffer.split(\" \")[1]);\n\n\t\t\torigX = x;\n\t\t\torigY = y;\n\n\t\t\tif(x < y){\n\t\t\t\tlong tmp = x;\n\t\t\t\tx = y;\n\t\t\t\ty = tmp;\n\t\t\t}\n\n\t\t\tlong mod;\n\t\t\twhile((mod = x % y) != 0){\n\t\t\t\tx = y;\n\t\t\t\ty = mod;\n\t\t\t}\n\n\t\t\tSystem.out.println(y + \" \" + (origX * origY / y));\n\t\t}\n\n\n\t}\n\n}",
"Main",
"public static void main(String[] args) throws NumberFormatException, IOException {\n\t\tlong \t\t\tx, y, origX, origY;\n\t\tString\t\t\tbuffer;\n\t\tBufferedReader \treader = new BufferedReader(new InputStreamReader(System.in));\n\n\t\twhile((buffer = reader.readLine()) != null){\n\t\t\tx = Long.parseLong(buffer.split(\" \")[0]);\n\t\t\ty = Long.parseLong(buffer.split(\" \")[1]);\n\n\t\t\torigX = x;\n\t\t\torigY = y;\n\n\t\t\tif(x < y){\n\t\t\t\tlong tmp = x;\n\t\t\t\tx = y;\n\t\t\t\ty = tmp;\n\t\t\t}\n\n\t\t\tlong mod;\n\t\t\twhile((mod = x % y) != 0){\n\t\t\t\tx = y;\n\t\t\t\ty = mod;\n\t\t\t}\n\n\t\t\tSystem.out.println(y + \" \" + (origX * origY / y));\n\t\t}\n\n\n\t}",
"main",
"{\n\t\tlong \t\t\tx, y, origX, origY;\n\t\tString\t\t\tbuffer;\n\t\tBufferedReader \treader = new BufferedReader(new InputStreamReader(System.in));\n\n\t\twhile((buffer = reader.readLine()) != null){\n\t\t\tx = Long.parseLong(buffer.split(\" \")[0]);\n\t\t\ty = Long.parseLong(buffer.split(\" \")[1]);\n\n\t\t\torigX = x;\n\t\t\torigY = y;\n\n\t\t\tif(x < y){\n\t\t\t\tlong tmp = x;\n\t\t\t\tx = y;\n\t\t\t\ty = tmp;\n\t\t\t}\n\n\t\t\tlong mod;\n\t\t\twhile((mod = x % y) != 0){\n\t\t\t\tx = y;\n\t\t\t\ty = mod;\n\t\t\t}\n\n\t\t\tSystem.out.println(y + \" \" + (origX * origY / y));\n\t\t}\n\n\n\t}",
"long \t\t\tx",
"x",
"y",
"y",
"origX",
"origX",
"origY;",
"origY",
"String\t\t\tbuffer;",
"buffer",
"BufferedReader \treader = new BufferedReader(new InputStreamReader(System.in));",
"reader",
"new BufferedReader(new InputStreamReader(System.in))",
"while((buffer = reader.readLine()) != null){\n\t\t\tx = Long.parseLong(buffer.split(\" \")[0]);\n\t\t\ty = Long.parseLong(buffer.split(\" \")[1]);\n\n\t\t\torigX = x;\n\t\t\torigY = y;\n\n\t\t\tif(x < y){\n\t\t\t\tlong tmp = x;\n\t\t\t\tx = y;\n\t\t\t\ty = tmp;\n\t\t\t}\n\n\t\t\tlong mod;\n\t\t\twhile((mod = x % y) != 0){\n\t\t\t\tx = y;\n\t\t\t\ty = mod;\n\t\t\t}\n\n\t\t\tSystem.out.println(y + \" \" + (origX * origY / y));\n\t\t}",
"(buffer = reader.readLine()) != null",
"(buffer = reader.readLine())",
"buffer",
"reader.readLine()",
"reader.readLine",
"reader",
"null",
"{\n\t\t\tx = Long.parseLong(buffer.split(\" \")[0]);\n\t\t\ty = Long.parseLong(buffer.split(\" \")[1]);\n\n\t\t\torigX = x;\n\t\t\torigY = y;\n\n\t\t\tif(x < y){\n\t\t\t\tlong tmp = x;\n\t\t\t\tx = y;\n\t\t\t\ty = tmp;\n\t\t\t}\n\n\t\t\tlong mod;\n\t\t\twhile((mod = x % y) != 0){\n\t\t\t\tx = y;\n\t\t\t\ty = mod;\n\t\t\t}\n\n\t\t\tSystem.out.println(y + \" \" + (origX * origY / y));\n\t\t}",
"x = Long.parseLong(buffer.split(\" \")[0])",
"x",
"Long.parseLong(buffer.split(\" \")[0])",
"Long.parseLong",
"Long",
"buffer.split(\" \")[0]",
"buffer.split(\" \")",
"buffer.split",
"buffer",
"\" \"",
"0",
"y = Long.parseLong(buffer.split(\" \")[1])",
"y",
"Long.parseLong(buffer.split(\" \")[1])",
"Long.parseLong",
"Long",
"buffer.split(\" \")[1]",
"buffer.split(\" \")",
"buffer.split",
"buffer",
"\" \"",
"1",
"origX = x",
"origX",
"x",
"origY = y",
"origY",
"y",
"if(x < y){\n\t\t\t\tlong tmp = x;\n\t\t\t\tx = y;\n\t\t\t\ty = tmp;\n\t\t\t}",
"x < y",
"x",
"y",
"{\n\t\t\t\tlong tmp = x;\n\t\t\t\tx = y;\n\t\t\t\ty = tmp;\n\t\t\t}",
"long tmp = x;",
"tmp",
"x",
"x = y",
"x",
"y",
"y = tmp",
"y",
"tmp",
"long mod;",
"mod",
"while((mod = x % y) != 0){\n\t\t\t\tx = y;\n\t\t\t\ty = mod;\n\t\t\t}",
"(mod = x % y) != 0",
"(mod = x % y)",
"mod",
"x % y",
"x",
"y",
"0",
"{\n\t\t\t\tx = y;\n\t\t\t\ty = mod;\n\t\t\t}",
"x = y",
"x",
"y",
"y = mod",
"y",
"mod",
"System.out.println(y + \" \" + (origX * origY / y))",
"System.out.println",
"System.out",
"System",
"System.out",
"y + \" \" + (origX * origY / y)",
"y + \" \" + (origX * origY / y)",
"y",
"\" \"",
"(origX * origY / y)",
"origX * origY",
"origX",
"origY",
"y",
"String[] args",
"args",
"public class Main {\n\tpublic static void main(String[] args) throws NumberFormatException, IOException {\n\t\tlong \t\t\tx, y, origX, origY;\n\t\tString\t\t\tbuffer;\n\t\tBufferedReader \treader = new BufferedReader(new InputStreamReader(System.in));\n\n\t\twhile((buffer = reader.readLine()) != null){\n\t\t\tx = Long.parseLong(buffer.split(\" \")[0]);\n\t\t\ty = Long.parseLong(buffer.split(\" \")[1]);\n\n\t\t\torigX = x;\n\t\t\torigY = y;\n\n\t\t\tif(x < y){\n\t\t\t\tlong tmp = x;\n\t\t\t\tx = y;\n\t\t\t\ty = tmp;\n\t\t\t}\n\n\t\t\tlong mod;\n\t\t\twhile((mod = x % y) != 0){\n\t\t\t\tx = y;\n\t\t\t\ty = mod;\n\t\t\t}\n\n\t\t\tSystem.out.println(y + \" \" + (origX * origY / y));\n\t\t}\n\n\n\t}\n\n}",
"public class Main {\n\tpublic static void main(String[] args) throws NumberFormatException, IOException {\n\t\tlong \t\t\tx, y, origX, origY;\n\t\tString\t\t\tbuffer;\n\t\tBufferedReader \treader = new BufferedReader(new InputStreamReader(System.in));\n\n\t\twhile((buffer = reader.readLine()) != null){\n\t\t\tx = Long.parseLong(buffer.split(\" \")[0]);\n\t\t\ty = Long.parseLong(buffer.split(\" \")[1]);\n\n\t\t\torigX = x;\n\t\t\torigY = y;\n\n\t\t\tif(x < y){\n\t\t\t\tlong tmp = x;\n\t\t\t\tx = y;\n\t\t\t\ty = tmp;\n\t\t\t}\n\n\t\t\tlong mod;\n\t\t\twhile((mod = x % y) != 0){\n\t\t\t\tx = y;\n\t\t\t\ty = mod;\n\t\t\t}\n\n\t\t\tSystem.out.println(y + \" \" + (origX * origY / y));\n\t\t}\n\n\n\t}\n\n}",
"Main"
] | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class Main {
public static void main(String[] args) throws NumberFormatException, IOException {
long x, y, origX, origY;
String buffer;
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
while((buffer = reader.readLine()) != null){
x = Long.parseLong(buffer.split(" ")[0]);
y = Long.parseLong(buffer.split(" ")[1]);
origX = x;
origY = y;
if(x < y){
long tmp = x;
x = y;
y = tmp;
}
long mod;
while((mod = x % y) != 0){
x = y;
y = mod;
}
System.out.println(y + " " + (origX * origY / y));
}
}
} |
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
41,
13,
41,
13,
42,
4,
18,
13,
30,
0,
13,
4,
18,
4,
18,
13,
17,
0,
13,
4,
18,
13,
18,
13,
17,
0,
13,
4,
18,
13,
18,
13,
17,
41,
13,
4,
13,
13,
13,
41,
13,
4,
13,
13,
13,
4,
18,
18,
13,
13,
2,
2,
13,
17,
13,
23,
13,
12,
13,
30,
41,
13,
2,
13,
13,
14,
2,
13,
17,
30,
29,
13,
29,
4,
13,
13,
13,
23,
13,
23,
13,
12,
13,
30,
14,
2,
2,
13,
17,
2,
13,
17,
30,
29,
17,
29,
2,
2,
13,
13,
4,
13,
13,
13,
23,
13,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
123,
5
],
[
123,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
8,
14
],
[
14,
15
],
[
8,
16
],
[
16,
17
],
[
8,
18
],
[
18,
19
],
[
19,
20
],
[
20,
21
],
[
18,
22
],
[
22,
23
],
[
23,
24
],
[
23,
25
],
[
25,
26
],
[
26,
27
],
[
27,
28
],
[
28,
29
],
[
25,
30
],
[
22,
31
],
[
31,
32
],
[
31,
33
],
[
33,
34
],
[
34,
35
],
[
33,
36
],
[
36,
37
],
[
36,
38
],
[
22,
39
],
[
39,
40
],
[
39,
41
],
[
41,
42
],
[
42,
43
],
[
41,
44
],
[
44,
45
],
[
44,
46
],
[
22,
47
],
[
47,
48
],
[
47,
49
],
[
49,
50
],
[
49,
51
],
[
49,
52
],
[
22,
53
],
[
53,
54
],
[
53,
55
],
[
55,
56
],
[
55,
57
],
[
55,
58
],
[
22,
59
],
[
59,
60
],
[
60,
61
],
[
61,
62
],
[
61,
63
],
[
59,
64
],
[
65,
65
],
[
65,
66
],
[
65,
67
],
[
65,
68
],
[
6,
69
],
[
69,
70
],
[
123,
71
],
[
71,
72
],
[
71,
73
],
[
73,
74
],
[
74,
75
],
[
74,
76
],
[
76,
77
],
[
76,
78
],
[
73,
79
],
[
79,
80
],
[
80,
81
],
[
80,
82
],
[
79,
83
],
[
83,
84
],
[
84,
85
],
[
73,
86
],
[
86,
87
],
[
87,
88
],
[
87,
89
],
[
87,
90
],
[
71,
91
],
[
91,
92
],
[
71,
93
],
[
93,
94
],
[
123,
95
],
[
95,
96
],
[
95,
97
],
[
97,
98
],
[
98,
99
],
[
99,
100
],
[
100,
101
],
[
100,
102
],
[
99,
103
],
[
103,
104
],
[
103,
105
],
[
98,
106
],
[
106,
107
],
[
107,
108
],
[
97,
109
],
[
109,
110
],
[
110,
111
],
[
111,
112
],
[
111,
113
],
[
110,
114
],
[
114,
115
],
[
114,
116
],
[
114,
117
],
[
95,
118
],
[
118,
119
],
[
95,
120
],
[
120,
121
],
[
0,
122
],
[
122,
123
],
[
122,
124
]
] | [
"import java.util.Scanner;\npublic class Main {\n public static void main (String[] args) {\n\tScanner scan = new Scanner(System.in);\n\tlong a, b;\n\tString[] input;\n\twhile (scan.hasNext()){\n\t input = scan.nextLine().split(\" \");\n\t a = Integer.parseInt(input[0]);\n\t b = Integer.parseInt(input[1]);\n\t long lcm = solveLCM(a, b);\n\t long gcd = solveGCD(a, b);\n\t System.out.println(gcd + \" \" + lcm);\n\t}\n }\n static long solveGCD (long a, long b) {\n\tlong gcd = a % b;\n\tif (gcd == 0) {\n\t return b;\n\t}\n\treturn solveGCD(b, gcd);\n }\n\n static long solveLCM (long a, long b) {\n\tif (a == 0 || b == 0) {\n\t return 0;\n\t}\n\treturn a * b / solveGCD(a,b);\n }\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n public static void main (String[] args) {\n\tScanner scan = new Scanner(System.in);\n\tlong a, b;\n\tString[] input;\n\twhile (scan.hasNext()){\n\t input = scan.nextLine().split(\" \");\n\t a = Integer.parseInt(input[0]);\n\t b = Integer.parseInt(input[1]);\n\t long lcm = solveLCM(a, b);\n\t long gcd = solveGCD(a, b);\n\t System.out.println(gcd + \" \" + lcm);\n\t}\n }\n static long solveGCD (long a, long b) {\n\tlong gcd = a % b;\n\tif (gcd == 0) {\n\t return b;\n\t}\n\treturn solveGCD(b, gcd);\n }\n\n static long solveLCM (long a, long b) {\n\tif (a == 0 || b == 0) {\n\t return 0;\n\t}\n\treturn a * b / solveGCD(a,b);\n }\n}",
"Main",
"public static void main (String[] args) {\n\tScanner scan = new Scanner(System.in);\n\tlong a, b;\n\tString[] input;\n\twhile (scan.hasNext()){\n\t input = scan.nextLine().split(\" \");\n\t a = Integer.parseInt(input[0]);\n\t b = Integer.parseInt(input[1]);\n\t long lcm = solveLCM(a, b);\n\t long gcd = solveGCD(a, b);\n\t System.out.println(gcd + \" \" + lcm);\n\t}\n }",
"main",
"{\n\tScanner scan = new Scanner(System.in);\n\tlong a, b;\n\tString[] input;\n\twhile (scan.hasNext()){\n\t input = scan.nextLine().split(\" \");\n\t a = Integer.parseInt(input[0]);\n\t b = Integer.parseInt(input[1]);\n\t long lcm = solveLCM(a, b);\n\t long gcd = solveGCD(a, b);\n\t System.out.println(gcd + \" \" + lcm);\n\t}\n }",
"Scanner scan = new Scanner(System.in);",
"scan",
"new Scanner(System.in)",
"long a",
"a",
"b;",
"b",
"String[] input;",
"input",
"while (scan.hasNext()){\n\t input = scan.nextLine().split(\" \");\n\t a = Integer.parseInt(input[0]);\n\t b = Integer.parseInt(input[1]);\n\t long lcm = solveLCM(a, b);\n\t long gcd = solveGCD(a, b);\n\t System.out.println(gcd + \" \" + lcm);\n\t}",
"scan.hasNext()",
"scan.hasNext",
"scan",
"{\n\t input = scan.nextLine().split(\" \");\n\t a = Integer.parseInt(input[0]);\n\t b = Integer.parseInt(input[1]);\n\t long lcm = solveLCM(a, b);\n\t long gcd = solveGCD(a, b);\n\t System.out.println(gcd + \" \" + lcm);\n\t}",
"input = scan.nextLine().split(\" \")",
"input",
"scan.nextLine().split(\" \")",
"scan.nextLine().split",
"scan.nextLine()",
"scan.nextLine",
"scan",
"\" \"",
"a = Integer.parseInt(input[0])",
"a",
"Integer.parseInt(input[0])",
"Integer.parseInt",
"Integer",
"input[0]",
"input",
"0",
"b = Integer.parseInt(input[1])",
"b",
"Integer.parseInt(input[1])",
"Integer.parseInt",
"Integer",
"input[1]",
"input",
"1",
"long lcm = solveLCM(a, b);",
"lcm",
"solveLCM(a, b)",
"solveLCM",
"a",
"b",
"long gcd = solveGCD(a, b);",
"gcd",
"solveGCD(a, b)",
"solveGCD",
"a",
"b",
"System.out.println(gcd + \" \" + lcm)",
"System.out.println",
"System.out",
"System",
"System.out",
"gcd + \" \" + lcm",
"gcd + \" \" + lcm",
"gcd",
"\" \"",
"lcm",
"String[] args",
"args",
"static long solveGCD (long a, long b) {\n\tlong gcd = a % b;\n\tif (gcd == 0) {\n\t return b;\n\t}\n\treturn solveGCD(b, gcd);\n }",
"solveGCD",
"{\n\tlong gcd = a % b;\n\tif (gcd == 0) {\n\t return b;\n\t}\n\treturn solveGCD(b, gcd);\n }",
"long gcd = a % b;",
"gcd",
"a % b",
"a",
"b",
"if (gcd == 0) {\n\t return b;\n\t}",
"gcd == 0",
"gcd",
"0",
"{\n\t return b;\n\t}",
"return b;",
"b",
"return solveGCD(b, gcd);",
"solveGCD(b, gcd)",
"solveGCD",
"b",
"gcd",
"long a",
"a",
"long b",
"b",
"static long solveLCM (long a, long b) {\n\tif (a == 0 || b == 0) {\n\t return 0;\n\t}\n\treturn a * b / solveGCD(a,b);\n }",
"solveLCM",
"{\n\tif (a == 0 || b == 0) {\n\t return 0;\n\t}\n\treturn a * b / solveGCD(a,b);\n }",
"if (a == 0 || b == 0) {\n\t return 0;\n\t}",
"a == 0 || b == 0",
"a == 0",
"a",
"0",
"b == 0",
"b",
"0",
"{\n\t return 0;\n\t}",
"return 0;",
"0",
"return a * b / solveGCD(a,b);",
"a * b / solveGCD(a,b)",
"a * b",
"a",
"b",
"solveGCD(a,b)",
"solveGCD",
"a",
"b",
"long a",
"a",
"long b",
"b",
"public class Main {\n public static void main (String[] args) {\n\tScanner scan = new Scanner(System.in);\n\tlong a, b;\n\tString[] input;\n\twhile (scan.hasNext()){\n\t input = scan.nextLine().split(\" \");\n\t a = Integer.parseInt(input[0]);\n\t b = Integer.parseInt(input[1]);\n\t long lcm = solveLCM(a, b);\n\t long gcd = solveGCD(a, b);\n\t System.out.println(gcd + \" \" + lcm);\n\t}\n }\n static long solveGCD (long a, long b) {\n\tlong gcd = a % b;\n\tif (gcd == 0) {\n\t return b;\n\t}\n\treturn solveGCD(b, gcd);\n }\n\n static long solveLCM (long a, long b) {\n\tif (a == 0 || b == 0) {\n\t return 0;\n\t}\n\treturn a * b / solveGCD(a,b);\n }\n}",
"public class Main {\n public static void main (String[] args) {\n\tScanner scan = new Scanner(System.in);\n\tlong a, b;\n\tString[] input;\n\twhile (scan.hasNext()){\n\t input = scan.nextLine().split(\" \");\n\t a = Integer.parseInt(input[0]);\n\t b = Integer.parseInt(input[1]);\n\t long lcm = solveLCM(a, b);\n\t long gcd = solveGCD(a, b);\n\t System.out.println(gcd + \" \" + lcm);\n\t}\n }\n static long solveGCD (long a, long b) {\n\tlong gcd = a % b;\n\tif (gcd == 0) {\n\t return b;\n\t}\n\treturn solveGCD(b, gcd);\n }\n\n static long solveLCM (long a, long b) {\n\tif (a == 0 || b == 0) {\n\t return 0;\n\t}\n\treturn a * b / solveGCD(a,b);\n }\n}",
"Main"
] | import java.util.Scanner;
public class Main {
public static void main (String[] args) {
Scanner scan = new Scanner(System.in);
long a, b;
String[] input;
while (scan.hasNext()){
input = scan.nextLine().split(" ");
a = Integer.parseInt(input[0]);
b = Integer.parseInt(input[1]);
long lcm = solveLCM(a, b);
long gcd = solveGCD(a, b);
System.out.println(gcd + " " + lcm);
}
}
static long solveGCD (long a, long b) {
long gcd = a % b;
if (gcd == 0) {
return b;
}
return solveGCD(b, gcd);
}
static long solveLCM (long a, long b) {
if (a == 0 || b == 0) {
return 0;
}
return a * b / solveGCD(a,b);
}
} |
[
7,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
42,
4,
18,
13,
30,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
13,
41,
13,
4,
18,
4,
18,
13,
13,
13,
4,
18,
18,
13,
13,
2,
13,
17,
4,
18,
18,
13,
13,
13,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
62,
8
],
[
62,
9
],
[
9,
10
],
[
9,
11
],
[
11,
12
],
[
12,
13
],
[
12,
14
],
[
11,
15
],
[
15,
16
],
[
16,
17
],
[
17,
18
],
[
15,
19
],
[
19,
20
],
[
20,
21
],
[
20,
22
],
[
22,
23
],
[
23,
24
],
[
19,
25
],
[
25,
26
],
[
25,
27
],
[
27,
28
],
[
28,
29
],
[
19,
30
],
[
30,
31
],
[
30,
32
],
[
32,
33
],
[
33,
34
],
[
32,
35
],
[
19,
36
],
[
36,
37
],
[
36,
38
],
[
38,
39
],
[
39,
40
],
[
40,
41
],
[
41,
42
],
[
40,
43
],
[
38,
44
],
[
19,
45
],
[
45,
46
],
[
46,
47
],
[
47,
48
],
[
47,
49
],
[
45,
50
],
[
50,
51
],
[
50,
52
],
[
19,
53
],
[
53,
54
],
[
54,
55
],
[
55,
56
],
[
55,
57
],
[
53,
58
],
[
9,
59
],
[
59,
60
],
[
0,
61
],
[
61,
62
],
[
61,
63
]
] | [
"import java.math.BigInteger;\nimport java.util.Scanner;\n\npublic class Main\n{\n\tpublic static void main(String arg[])\n\t{\n\t\tScanner sc = new Scanner(System.in); \n\t\twhile(sc.hasNext())\n\t\t{\n\t\t\n\t\tBigInteger x = sc.nextBigInteger();\n\t\tBigInteger y = sc.nextBigInteger();\n\n\t\tBigInteger gcd = x.gcd(y);\n\t\tBigInteger lcm = x.multiply(y).divide(gcd);\n\t\tSystem.out.print(gcd+\" \");\n\t\tSystem.out.println(lcm);\n\t\t}\n\t}\n\t/*public static int gcd(int x, int y) //ユークリッド互除法\n\t{\n\t\tint div=-1;\n\t\twhile(true)\n\t\t{\n\t\t\tdiv = x%y;\n\t\t\tif(div==0)\n\t\t\t\tbreak;\n\t\t\tx=y;\n\t\t\ty=div;\n\t\t}\t\n\t\treturn y;\n\t}\n\t */\n\n\n}",
"import java.math.BigInteger;",
"BigInteger",
"java.math",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main\n{\n\tpublic static void main(String arg[])\n\t{\n\t\tScanner sc = new Scanner(System.in); \n\t\twhile(sc.hasNext())\n\t\t{\n\t\t\n\t\tBigInteger x = sc.nextBigInteger();\n\t\tBigInteger y = sc.nextBigInteger();\n\n\t\tBigInteger gcd = x.gcd(y);\n\t\tBigInteger lcm = x.multiply(y).divide(gcd);\n\t\tSystem.out.print(gcd+\" \");\n\t\tSystem.out.println(lcm);\n\t\t}\n\t}\n\t/*public static int gcd(int x, int y) //ユークリッド互除法\n\t{\n\t\tint div=-1;\n\t\twhile(true)\n\t\t{\n\t\t\tdiv = x%y;\n\t\t\tif(div==0)\n\t\t\t\tbreak;\n\t\t\tx=y;\n\t\t\ty=div;\n\t\t}\t\n\t\treturn y;\n\t}\n\t */\n\n\n}",
"Main",
"public static void main(String arg[])\n\t{\n\t\tScanner sc = new Scanner(System.in); \n\t\twhile(sc.hasNext())\n\t\t{\n\t\t\n\t\tBigInteger x = sc.nextBigInteger();\n\t\tBigInteger y = sc.nextBigInteger();\n\n\t\tBigInteger gcd = x.gcd(y);\n\t\tBigInteger lcm = x.multiply(y).divide(gcd);\n\t\tSystem.out.print(gcd+\" \");\n\t\tSystem.out.println(lcm);\n\t\t}\n\t}",
"main",
"{\n\t\tScanner sc = new Scanner(System.in); \n\t\twhile(sc.hasNext())\n\t\t{\n\t\t\n\t\tBigInteger x = sc.nextBigInteger();\n\t\tBigInteger y = sc.nextBigInteger();\n\n\t\tBigInteger gcd = x.gcd(y);\n\t\tBigInteger lcm = x.multiply(y).divide(gcd);\n\t\tSystem.out.print(gcd+\" \");\n\t\tSystem.out.println(lcm);\n\t\t}\n\t}",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"while(sc.hasNext())\n\t\t{\n\t\t\n\t\tBigInteger x = sc.nextBigInteger();\n\t\tBigInteger y = sc.nextBigInteger();\n\n\t\tBigInteger gcd = x.gcd(y);\n\t\tBigInteger lcm = x.multiply(y).divide(gcd);\n\t\tSystem.out.print(gcd+\" \");\n\t\tSystem.out.println(lcm);\n\t\t}",
"sc.hasNext()",
"sc.hasNext",
"sc",
"{\n\t\t\n\t\tBigInteger x = sc.nextBigInteger();\n\t\tBigInteger y = sc.nextBigInteger();\n\n\t\tBigInteger gcd = x.gcd(y);\n\t\tBigInteger lcm = x.multiply(y).divide(gcd);\n\t\tSystem.out.print(gcd+\" \");\n\t\tSystem.out.println(lcm);\n\t\t}",
"BigInteger x = sc.nextBigInteger();",
"x",
"sc.nextBigInteger()",
"sc.nextBigInteger",
"sc",
"BigInteger y = sc.nextBigInteger();",
"y",
"sc.nextBigInteger()",
"sc.nextBigInteger",
"sc",
"BigInteger gcd = x.gcd(y);",
"gcd",
"x.gcd(y)",
"x.gcd",
"x",
"y",
"BigInteger lcm = x.multiply(y).divide(gcd);",
"lcm",
"x.multiply(y).divide(gcd)",
"x.multiply(y).divide",
"x.multiply(y)",
"x.multiply",
"x",
"y",
"gcd",
"System.out.print(gcd+\" \")",
"System.out.print",
"System.out",
"System",
"System.out",
"gcd+\" \"",
"gcd",
"\" \"",
"System.out.println(lcm)",
"System.out.println",
"System.out",
"System",
"System.out",
"lcm",
"String arg[]",
"arg",
"public class Main\n{\n\tpublic static void main(String arg[])\n\t{\n\t\tScanner sc = new Scanner(System.in); \n\t\twhile(sc.hasNext())\n\t\t{\n\t\t\n\t\tBigInteger x = sc.nextBigInteger();\n\t\tBigInteger y = sc.nextBigInteger();\n\n\t\tBigInteger gcd = x.gcd(y);\n\t\tBigInteger lcm = x.multiply(y).divide(gcd);\n\t\tSystem.out.print(gcd+\" \");\n\t\tSystem.out.println(lcm);\n\t\t}\n\t}\n\t/*public static int gcd(int x, int y) //ユークリッド互除法\n\t{\n\t\tint div=-1;\n\t\twhile(true)\n\t\t{\n\t\t\tdiv = x%y;\n\t\t\tif(div==0)\n\t\t\t\tbreak;\n\t\t\tx=y;\n\t\t\ty=div;\n\t\t}\t\n\t\treturn y;\n\t}\n\t */\n\n\n}",
"public class Main\n{\n\tpublic static void main(String arg[])\n\t{\n\t\tScanner sc = new Scanner(System.in); \n\t\twhile(sc.hasNext())\n\t\t{\n\t\t\n\t\tBigInteger x = sc.nextBigInteger();\n\t\tBigInteger y = sc.nextBigInteger();\n\n\t\tBigInteger gcd = x.gcd(y);\n\t\tBigInteger lcm = x.multiply(y).divide(gcd);\n\t\tSystem.out.print(gcd+\" \");\n\t\tSystem.out.println(lcm);\n\t\t}\n\t}\n\t/*public static int gcd(int x, int y) //ユークリッド互除法\n\t{\n\t\tint div=-1;\n\t\twhile(true)\n\t\t{\n\t\t\tdiv = x%y;\n\t\t\tif(div==0)\n\t\t\t\tbreak;\n\t\t\tx=y;\n\t\t\ty=div;\n\t\t}\t\n\t\treturn y;\n\t}\n\t */\n\n\n}",
"Main"
] | import java.math.BigInteger;
import java.util.Scanner;
public class Main
{
public static void main(String arg[])
{
Scanner sc = new Scanner(System.in);
while(sc.hasNext())
{
BigInteger x = sc.nextBigInteger();
BigInteger y = sc.nextBigInteger();
BigInteger gcd = x.gcd(y);
BigInteger lcm = x.multiply(y).divide(gcd);
System.out.print(gcd+" ");
System.out.println(lcm);
}
}
/*public static int gcd(int x, int y) //ユークリッド互除法
{
int div=-1;
while(true)
{
div = x%y;
if(div==0)
break;
x=y;
y=div;
}
return y;
}
*/
} |
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
42,
4,
18,
13,
30,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
41,
13,
4,
13,
13,
13,
41,
13,
4,
13,
13,
13,
4,
18,
18,
13,
13,
2,
2,
13,
17,
13,
23,
13,
12,
13,
30,
14,
2,
13,
13,
30,
41,
13,
13,
0,
13,
13,
0,
13,
13,
41,
13,
42,
2,
17,
13,
30,
0,
13,
2,
13,
13,
0,
13,
13,
0,
13,
13,
41,
13,
13,
29,
13,
23,
13,
23,
13,
12,
13,
30,
41,
13,
17,
0,
13,
2,
2,
13,
4,
13,
13,
13,
13,
29,
13,
23,
13,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
118,
5
],
[
118,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
13,
14
],
[
14,
15
],
[
12,
16
],
[
16,
17
],
[
17,
18
],
[
17,
19
],
[
19,
20
],
[
20,
21
],
[
16,
22
],
[
22,
23
],
[
22,
24
],
[
24,
25
],
[
25,
26
],
[
16,
27
],
[
27,
28
],
[
27,
29
],
[
29,
30
],
[
29,
31
],
[
29,
32
],
[
16,
33
],
[
33,
34
],
[
33,
35
],
[
35,
36
],
[
35,
37
],
[
35,
38
],
[
16,
39
],
[
39,
40
],
[
40,
41
],
[
41,
42
],
[
41,
43
],
[
39,
44
],
[
45,
45
],
[
45,
46
],
[
45,
47
],
[
45,
48
],
[
6,
49
],
[
49,
50
],
[
118,
51
],
[
51,
52
],
[
51,
53
],
[
53,
54
],
[
54,
55
],
[
55,
56
],
[
55,
57
],
[
54,
58
],
[
58,
59
],
[
59,
60
],
[
59,
61
],
[
58,
62
],
[
62,
63
],
[
62,
64
],
[
58,
65
],
[
65,
66
],
[
65,
67
],
[
53,
68
],
[
68,
69
],
[
53,
70
],
[
70,
71
],
[
71,
72
],
[
71,
73
],
[
70,
74
],
[
74,
75
],
[
75,
76
],
[
75,
77
],
[
77,
78
],
[
77,
79
],
[
74,
80
],
[
80,
81
],
[
80,
82
],
[
74,
83
],
[
83,
84
],
[
83,
85
],
[
53,
86
],
[
86,
87
],
[
86,
88
],
[
53,
89
],
[
89,
90
],
[
51,
91
],
[
91,
92
],
[
51,
93
],
[
93,
94
],
[
118,
95
],
[
95,
96
],
[
95,
97
],
[
97,
98
],
[
98,
99
],
[
98,
100
],
[
97,
101
],
[
101,
102
],
[
101,
103
],
[
103,
104
],
[
104,
105
],
[
104,
106
],
[
106,
107
],
[
106,
108
],
[
106,
109
],
[
103,
110
],
[
97,
111
],
[
111,
112
],
[
95,
113
],
[
113,
114
],
[
95,
115
],
[
115,
116
],
[
0,
117
],
[
117,
118
],
[
117,
119
]
] | [
"import java.util.Scanner;\n\npublic class Main {\n\tpublic static void main(String[] args){\n\t\tScanner stdIn = new Scanner(System.in);\n\n\t\twhile(stdIn.hasNext()){\n\t\t\tlong numA = stdIn.nextLong();\n\t\t\tlong numB = stdIn.nextLong();\n\t\t\tlong GCD = getGCD(numA,numB);\t\t\t\t//最大公約数\n\t\t\tlong LCM = getLCM(numA,numB);\t\t\t\t//最小公倍数\n\t\t\tSystem.out.println(GCD + \" \" + LCM);\n\t\t}\n\t}\n\n\t//++++++++++++++++++++++++++++++++++++++++++++++++++\n\t//最大公約数(GCD)取得メソッド\n\t//++++++++++++++++++++++++++++++++++++++++++++++++++\n\tpublic static long getGCD(long numA,long numB){\n\t\t//以下、ユークリッドの互除法\n\t\tif(numA > numB){\n\t\t\tlong temp = numA;\n\t\t\tnumA = numB;\n\t\t\tnumB = temp;\n\t\t}\n\t\tlong r;\n\t\twhile(0 != numB){\n\t\t\tr = numA % numB;\n\t\t\tnumA = numB;\n\t\t\tnumB = r;\n\t\t}\n\t\tlong GCD = numA;\n\n\t\treturn GCD;\n\t}\n\n\t//++++++++++++++++++++++++++++++++++++++++++++++++++\n\t//最小公倍数(LCM)取得メソッド\n\t//++++++++++++++++++++++++++++++++++++++++++++++++++\n\tpublic static long getLCM(long numA,long numB){\n\t\tlong LCM = 0L;\n\t\tLCM = numA / getGCD(numA,numB) * numB;\n\t\treturn LCM;\n\t}\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n\tpublic static void main(String[] args){\n\t\tScanner stdIn = new Scanner(System.in);\n\n\t\twhile(stdIn.hasNext()){\n\t\t\tlong numA = stdIn.nextLong();\n\t\t\tlong numB = stdIn.nextLong();\n\t\t\tlong GCD = getGCD(numA,numB);\t\t\t\t//最大公約数\n\t\t\tlong LCM = getLCM(numA,numB);\t\t\t\t//最小公倍数\n\t\t\tSystem.out.println(GCD + \" \" + LCM);\n\t\t}\n\t}\n\n\t//++++++++++++++++++++++++++++++++++++++++++++++++++\n\t//最大公約数(GCD)取得メソッド\n\t//++++++++++++++++++++++++++++++++++++++++++++++++++\n\tpublic static long getGCD(long numA,long numB){\n\t\t//以下、ユークリッドの互除法\n\t\tif(numA > numB){\n\t\t\tlong temp = numA;\n\t\t\tnumA = numB;\n\t\t\tnumB = temp;\n\t\t}\n\t\tlong r;\n\t\twhile(0 != numB){\n\t\t\tr = numA % numB;\n\t\t\tnumA = numB;\n\t\t\tnumB = r;\n\t\t}\n\t\tlong GCD = numA;\n\n\t\treturn GCD;\n\t}\n\n\t//++++++++++++++++++++++++++++++++++++++++++++++++++\n\t//最小公倍数(LCM)取得メソッド\n\t//++++++++++++++++++++++++++++++++++++++++++++++++++\n\tpublic static long getLCM(long numA,long numB){\n\t\tlong LCM = 0L;\n\t\tLCM = numA / getGCD(numA,numB) * numB;\n\t\treturn LCM;\n\t}\n}",
"Main",
"public static void main(String[] args){\n\t\tScanner stdIn = new Scanner(System.in);\n\n\t\twhile(stdIn.hasNext()){\n\t\t\tlong numA = stdIn.nextLong();\n\t\t\tlong numB = stdIn.nextLong();\n\t\t\tlong GCD = getGCD(numA,numB);\t\t\t\t//最大公約数\n\t\t\tlong LCM = getLCM(numA,numB);\t\t\t\t//最小公倍数\n\t\t\tSystem.out.println(GCD + \" \" + LCM);\n\t\t}\n\t}",
"main",
"{\n\t\tScanner stdIn = new Scanner(System.in);\n\n\t\twhile(stdIn.hasNext()){\n\t\t\tlong numA = stdIn.nextLong();\n\t\t\tlong numB = stdIn.nextLong();\n\t\t\tlong GCD = getGCD(numA,numB);\t\t\t\t//最大公約数\n\t\t\tlong LCM = getLCM(numA,numB);\t\t\t\t//最小公倍数\n\t\t\tSystem.out.println(GCD + \" \" + LCM);\n\t\t}\n\t}",
"Scanner stdIn = new Scanner(System.in);",
"stdIn",
"new Scanner(System.in)",
"while(stdIn.hasNext()){\n\t\t\tlong numA = stdIn.nextLong();\n\t\t\tlong numB = stdIn.nextLong();\n\t\t\tlong GCD = getGCD(numA,numB);\t\t\t\t//最大公約数\n\t\t\tlong LCM = getLCM(numA,numB);\t\t\t\t//最小公倍数\n\t\t\tSystem.out.println(GCD + \" \" + LCM);\n\t\t}",
"stdIn.hasNext()",
"stdIn.hasNext",
"stdIn",
"{\n\t\t\tlong numA = stdIn.nextLong();\n\t\t\tlong numB = stdIn.nextLong();\n\t\t\tlong GCD = getGCD(numA,numB);\t\t\t\t//最大公約数\n\t\t\tlong LCM = getLCM(numA,numB);\t\t\t\t//最小公倍数\n\t\t\tSystem.out.println(GCD + \" \" + LCM);\n\t\t}",
"long numA = stdIn.nextLong();",
"numA",
"stdIn.nextLong()",
"stdIn.nextLong",
"stdIn",
"long numB = stdIn.nextLong();",
"numB",
"stdIn.nextLong()",
"stdIn.nextLong",
"stdIn",
"long GCD = getGCD(numA,numB);",
"GCD",
"getGCD(numA,numB)",
"getGCD",
"numA",
"numB",
"long LCM = getLCM(numA,numB);",
"LCM",
"getLCM(numA,numB)",
"getLCM",
"numA",
"numB",
"System.out.println(GCD + \" \" + LCM)",
"System.out.println",
"System.out",
"System",
"System.out",
"GCD + \" \" + LCM",
"GCD + \" \" + LCM",
"GCD",
"\" \"",
"LCM",
"String[] args",
"args",
"//++++++++++++++++++++++++++++++++++++++++++++++++++\n\t//最大公約数(GCD)取得メソッド\n\t//++++++++++++++++++++++++++++++++++++++++++++++++++\n\tpublic static long getGCD(long numA,long numB){\n\t\t//以下、ユークリッドの互除法\n\t\tif(numA > numB){\n\t\t\tlong temp = numA;\n\t\t\tnumA = numB;\n\t\t\tnumB = temp;\n\t\t}\n\t\tlong r;\n\t\twhile(0 != numB){\n\t\t\tr = numA % numB;\n\t\t\tnumA = numB;\n\t\t\tnumB = r;\n\t\t}\n\t\tlong GCD = numA;\n\n\t\treturn GCD;\n\t}",
"getGCD",
"{\n\t\t//以下、ユークリッドの互除法\n\t\tif(numA > numB){\n\t\t\tlong temp = numA;\n\t\t\tnumA = numB;\n\t\t\tnumB = temp;\n\t\t}\n\t\tlong r;\n\t\twhile(0 != numB){\n\t\t\tr = numA % numB;\n\t\t\tnumA = numB;\n\t\t\tnumB = r;\n\t\t}\n\t\tlong GCD = numA;\n\n\t\treturn GCD;\n\t}",
"if(numA > numB){\n\t\t\tlong temp = numA;\n\t\t\tnumA = numB;\n\t\t\tnumB = temp;\n\t\t}",
"numA > numB",
"numA",
"numB",
"{\n\t\t\tlong temp = numA;\n\t\t\tnumA = numB;\n\t\t\tnumB = temp;\n\t\t}",
"long temp = numA;",
"temp",
"numA",
"numA = numB",
"numA",
"numB",
"numB = temp",
"numB",
"temp",
"long r;",
"r",
"while(0 != numB){\n\t\t\tr = numA % numB;\n\t\t\tnumA = numB;\n\t\t\tnumB = r;\n\t\t}",
"0 != numB",
"0",
"numB",
"{\n\t\t\tr = numA % numB;\n\t\t\tnumA = numB;\n\t\t\tnumB = r;\n\t\t}",
"r = numA % numB",
"r",
"numA % numB",
"numA",
"numB",
"numA = numB",
"numA",
"numB",
"numB = r",
"numB",
"r",
"long GCD = numA;",
"GCD",
"numA",
"return GCD;",
"GCD",
"long numA",
"numA",
"long numB",
"numB",
"//++++++++++++++++++++++++++++++++++++++++++++++++++\n\t//最小公倍数(LCM)取得メソッド\n\t//++++++++++++++++++++++++++++++++++++++++++++++++++\n\tpublic static long getLCM(long numA,long numB){\n\t\tlong LCM = 0L;\n\t\tLCM = numA / getGCD(numA,numB) * numB;\n\t\treturn LCM;\n\t}",
"getLCM",
"{\n\t\tlong LCM = 0L;\n\t\tLCM = numA / getGCD(numA,numB) * numB;\n\t\treturn LCM;\n\t}",
"long LCM = 0L;",
"LCM",
"0L",
"LCM = numA / getGCD(numA,numB) * numB",
"LCM",
"numA / getGCD(numA,numB) * numB",
"numA / getGCD(numA,numB)",
"numA",
"getGCD(numA,numB)",
"getGCD",
"numA",
"numB",
"numB",
"return LCM;",
"LCM",
"long numA",
"numA",
"long numB",
"numB",
"public class Main {\n\tpublic static void main(String[] args){\n\t\tScanner stdIn = new Scanner(System.in);\n\n\t\twhile(stdIn.hasNext()){\n\t\t\tlong numA = stdIn.nextLong();\n\t\t\tlong numB = stdIn.nextLong();\n\t\t\tlong GCD = getGCD(numA,numB);\t\t\t\t//最大公約数\n\t\t\tlong LCM = getLCM(numA,numB);\t\t\t\t//最小公倍数\n\t\t\tSystem.out.println(GCD + \" \" + LCM);\n\t\t}\n\t}\n\n\t//++++++++++++++++++++++++++++++++++++++++++++++++++\n\t//最大公約数(GCD)取得メソッド\n\t//++++++++++++++++++++++++++++++++++++++++++++++++++\n\tpublic static long getGCD(long numA,long numB){\n\t\t//以下、ユークリッドの互除法\n\t\tif(numA > numB){\n\t\t\tlong temp = numA;\n\t\t\tnumA = numB;\n\t\t\tnumB = temp;\n\t\t}\n\t\tlong r;\n\t\twhile(0 != numB){\n\t\t\tr = numA % numB;\n\t\t\tnumA = numB;\n\t\t\tnumB = r;\n\t\t}\n\t\tlong GCD = numA;\n\n\t\treturn GCD;\n\t}\n\n\t//++++++++++++++++++++++++++++++++++++++++++++++++++\n\t//最小公倍数(LCM)取得メソッド\n\t//++++++++++++++++++++++++++++++++++++++++++++++++++\n\tpublic static long getLCM(long numA,long numB){\n\t\tlong LCM = 0L;\n\t\tLCM = numA / getGCD(numA,numB) * numB;\n\t\treturn LCM;\n\t}\n}",
"public class Main {\n\tpublic static void main(String[] args){\n\t\tScanner stdIn = new Scanner(System.in);\n\n\t\twhile(stdIn.hasNext()){\n\t\t\tlong numA = stdIn.nextLong();\n\t\t\tlong numB = stdIn.nextLong();\n\t\t\tlong GCD = getGCD(numA,numB);\t\t\t\t//最大公約数\n\t\t\tlong LCM = getLCM(numA,numB);\t\t\t\t//最小公倍数\n\t\t\tSystem.out.println(GCD + \" \" + LCM);\n\t\t}\n\t}\n\n\t//++++++++++++++++++++++++++++++++++++++++++++++++++\n\t//最大公約数(GCD)取得メソッド\n\t//++++++++++++++++++++++++++++++++++++++++++++++++++\n\tpublic static long getGCD(long numA,long numB){\n\t\t//以下、ユークリッドの互除法\n\t\tif(numA > numB){\n\t\t\tlong temp = numA;\n\t\t\tnumA = numB;\n\t\t\tnumB = temp;\n\t\t}\n\t\tlong r;\n\t\twhile(0 != numB){\n\t\t\tr = numA % numB;\n\t\t\tnumA = numB;\n\t\t\tnumB = r;\n\t\t}\n\t\tlong GCD = numA;\n\n\t\treturn GCD;\n\t}\n\n\t//++++++++++++++++++++++++++++++++++++++++++++++++++\n\t//最小公倍数(LCM)取得メソッド\n\t//++++++++++++++++++++++++++++++++++++++++++++++++++\n\tpublic static long getLCM(long numA,long numB){\n\t\tlong LCM = 0L;\n\t\tLCM = numA / getGCD(numA,numB) * numB;\n\t\treturn LCM;\n\t}\n}",
"Main"
] | import java.util.Scanner;
public class Main {
public static void main(String[] args){
Scanner stdIn = new Scanner(System.in);
while(stdIn.hasNext()){
long numA = stdIn.nextLong();
long numB = stdIn.nextLong();
long GCD = getGCD(numA,numB); //最大公約数
long LCM = getLCM(numA,numB); //最小公倍数
System.out.println(GCD + " " + LCM);
}
}
//++++++++++++++++++++++++++++++++++++++++++++++++++
//最大公約数(GCD)取得メソッド
//++++++++++++++++++++++++++++++++++++++++++++++++++
public static long getGCD(long numA,long numB){
//以下、ユークリッドの互除法
if(numA > numB){
long temp = numA;
numA = numB;
numB = temp;
}
long r;
while(0 != numB){
r = numA % numB;
numA = numB;
numB = r;
}
long GCD = numA;
return GCD;
}
//++++++++++++++++++++++++++++++++++++++++++++++++++
//最小公倍数(LCM)取得メソッド
//++++++++++++++++++++++++++++++++++++++++++++++++++
public static long getLCM(long numA,long numB){
long LCM = 0L;
LCM = numA / getGCD(numA,numB) * numB;
return LCM;
}
} |
[
7,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
42,
4,
18,
13,
30,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
41,
13,
4,
13,
13,
13,
41,
13,
2,
2,
13,
13,
13,
4,
18,
18,
13,
13,
2,
2,
13,
17,
13,
23,
13,
12,
13,
30,
41,
13,
14,
2,
13,
13,
30,
41,
13,
13,
0,
13,
13,
0,
13,
13,
0,
13,
2,
13,
13,
29,
8,
2,
13,
17,
13,
4,
13,
13,
13,
23,
13,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
94,
8
],
[
94,
9
],
[
9,
10
],
[
9,
11
],
[
11,
12
],
[
12,
13
],
[
12,
14
],
[
11,
15
],
[
15,
16
],
[
16,
17
],
[
17,
18
],
[
15,
19
],
[
19,
20
],
[
20,
21
],
[
20,
22
],
[
22,
23
],
[
23,
24
],
[
19,
25
],
[
25,
26
],
[
25,
27
],
[
27,
28
],
[
28,
29
],
[
19,
30
],
[
30,
31
],
[
30,
32
],
[
32,
33
],
[
32,
34
],
[
32,
35
],
[
19,
36
],
[
36,
37
],
[
36,
38
],
[
38,
39
],
[
39,
40
],
[
39,
41
],
[
38,
42
],
[
19,
43
],
[
43,
44
],
[
44,
45
],
[
45,
46
],
[
45,
47
],
[
43,
48
],
[
49,
49
],
[
49,
50
],
[
49,
51
],
[
49,
52
],
[
9,
53
],
[
53,
54
],
[
94,
55
],
[
55,
56
],
[
55,
57
],
[
57,
58
],
[
58,
59
],
[
57,
60
],
[
60,
61
],
[
61,
62
],
[
61,
63
],
[
60,
64
],
[
64,
65
],
[
65,
66
],
[
65,
67
],
[
64,
68
],
[
68,
69
],
[
68,
70
],
[
64,
71
],
[
71,
72
],
[
71,
73
],
[
57,
74
],
[
74,
75
],
[
74,
76
],
[
76,
77
],
[
76,
78
],
[
57,
79
],
[
79,
80
],
[
80,
81
],
[
81,
82
],
[
81,
83
],
[
80,
84
],
[
80,
85
],
[
85,
86
],
[
85,
87
],
[
85,
88
],
[
55,
89
],
[
89,
90
],
[
55,
91
],
[
91,
92
],
[
0,
93
],
[
93,
94
],
[
93,
95
]
] | [
"\n\nimport java.io.IOException;\nimport java.util.Scanner;\n\n\npublic class Main{\n\n\tpublic static void main(String[] args) throws IOException {\n\t\tScanner scan = new Scanner(System.in);\n\t\twhile (scan.hasNext()) {\n\t\t\tlong a = scan.nextLong();\n\t\t\tlong b = scan.nextLong();\n\t\t\tlong gcd = divide(a, b);\n\n\t\t\tlong lcm = a * b / gcd;\n\t\t\tSystem.out.println(gcd + \" \" + lcm);\n\n\t\t}\n\t}\n\n\tpublic static long divide(long a, long b) {\n\t\tlong r;\n\t\tif (a < b) {\n\t\t\tlong temp = b;\n\t\t\tb = a;\n\t\t\ta = temp;\n\t\t}\n\t\tr = a % b;\n\n\t\treturn r == 0 ? b : divide(b, r);\n\t}\n\n}",
"import java.io.IOException;",
"IOException",
"java.io",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main{\n\n\tpublic static void main(String[] args) throws IOException {\n\t\tScanner scan = new Scanner(System.in);\n\t\twhile (scan.hasNext()) {\n\t\t\tlong a = scan.nextLong();\n\t\t\tlong b = scan.nextLong();\n\t\t\tlong gcd = divide(a, b);\n\n\t\t\tlong lcm = a * b / gcd;\n\t\t\tSystem.out.println(gcd + \" \" + lcm);\n\n\t\t}\n\t}\n\n\tpublic static long divide(long a, long b) {\n\t\tlong r;\n\t\tif (a < b) {\n\t\t\tlong temp = b;\n\t\t\tb = a;\n\t\t\ta = temp;\n\t\t}\n\t\tr = a % b;\n\n\t\treturn r == 0 ? b : divide(b, r);\n\t}\n\n}",
"Main",
"public static void main(String[] args) throws IOException {\n\t\tScanner scan = new Scanner(System.in);\n\t\twhile (scan.hasNext()) {\n\t\t\tlong a = scan.nextLong();\n\t\t\tlong b = scan.nextLong();\n\t\t\tlong gcd = divide(a, b);\n\n\t\t\tlong lcm = a * b / gcd;\n\t\t\tSystem.out.println(gcd + \" \" + lcm);\n\n\t\t}\n\t}",
"main",
"{\n\t\tScanner scan = new Scanner(System.in);\n\t\twhile (scan.hasNext()) {\n\t\t\tlong a = scan.nextLong();\n\t\t\tlong b = scan.nextLong();\n\t\t\tlong gcd = divide(a, b);\n\n\t\t\tlong lcm = a * b / gcd;\n\t\t\tSystem.out.println(gcd + \" \" + lcm);\n\n\t\t}\n\t}",
"Scanner scan = new Scanner(System.in);",
"scan",
"new Scanner(System.in)",
"while (scan.hasNext()) {\n\t\t\tlong a = scan.nextLong();\n\t\t\tlong b = scan.nextLong();\n\t\t\tlong gcd = divide(a, b);\n\n\t\t\tlong lcm = a * b / gcd;\n\t\t\tSystem.out.println(gcd + \" \" + lcm);\n\n\t\t}",
"scan.hasNext()",
"scan.hasNext",
"scan",
"{\n\t\t\tlong a = scan.nextLong();\n\t\t\tlong b = scan.nextLong();\n\t\t\tlong gcd = divide(a, b);\n\n\t\t\tlong lcm = a * b / gcd;\n\t\t\tSystem.out.println(gcd + \" \" + lcm);\n\n\t\t}",
"long a = scan.nextLong();",
"a",
"scan.nextLong()",
"scan.nextLong",
"scan",
"long b = scan.nextLong();",
"b",
"scan.nextLong()",
"scan.nextLong",
"scan",
"long gcd = divide(a, b);",
"gcd",
"divide(a, b)",
"divide",
"a",
"b",
"long lcm = a * b / gcd;",
"lcm",
"a * b / gcd",
"a * b",
"a",
"b",
"gcd",
"System.out.println(gcd + \" \" + lcm)",
"System.out.println",
"System.out",
"System",
"System.out",
"gcd + \" \" + lcm",
"gcd + \" \" + lcm",
"gcd",
"\" \"",
"lcm",
"String[] args",
"args",
"public static long divide(long a, long b) {\n\t\tlong r;\n\t\tif (a < b) {\n\t\t\tlong temp = b;\n\t\t\tb = a;\n\t\t\ta = temp;\n\t\t}\n\t\tr = a % b;\n\n\t\treturn r == 0 ? b : divide(b, r);\n\t}",
"divide",
"{\n\t\tlong r;\n\t\tif (a < b) {\n\t\t\tlong temp = b;\n\t\t\tb = a;\n\t\t\ta = temp;\n\t\t}\n\t\tr = a % b;\n\n\t\treturn r == 0 ? b : divide(b, r);\n\t}",
"long r;",
"r",
"if (a < b) {\n\t\t\tlong temp = b;\n\t\t\tb = a;\n\t\t\ta = temp;\n\t\t}",
"a < b",
"a",
"b",
"{\n\t\t\tlong temp = b;\n\t\t\tb = a;\n\t\t\ta = temp;\n\t\t}",
"long temp = b;",
"temp",
"b",
"b = a",
"b",
"a",
"a = temp",
"a",
"temp",
"r = a % b",
"r",
"a % b",
"a",
"b",
"return r == 0 ? b : divide(b, r);",
"r == 0 ? b : divide(b, r)",
"r == 0",
"r",
"0",
"b",
"divide(b, r)",
"divide",
"b",
"r",
"long a",
"a",
"long b",
"b",
"public class Main{\n\n\tpublic static void main(String[] args) throws IOException {\n\t\tScanner scan = new Scanner(System.in);\n\t\twhile (scan.hasNext()) {\n\t\t\tlong a = scan.nextLong();\n\t\t\tlong b = scan.nextLong();\n\t\t\tlong gcd = divide(a, b);\n\n\t\t\tlong lcm = a * b / gcd;\n\t\t\tSystem.out.println(gcd + \" \" + lcm);\n\n\t\t}\n\t}\n\n\tpublic static long divide(long a, long b) {\n\t\tlong r;\n\t\tif (a < b) {\n\t\t\tlong temp = b;\n\t\t\tb = a;\n\t\t\ta = temp;\n\t\t}\n\t\tr = a % b;\n\n\t\treturn r == 0 ? b : divide(b, r);\n\t}\n\n}",
"public class Main{\n\n\tpublic static void main(String[] args) throws IOException {\n\t\tScanner scan = new Scanner(System.in);\n\t\twhile (scan.hasNext()) {\n\t\t\tlong a = scan.nextLong();\n\t\t\tlong b = scan.nextLong();\n\t\t\tlong gcd = divide(a, b);\n\n\t\t\tlong lcm = a * b / gcd;\n\t\t\tSystem.out.println(gcd + \" \" + lcm);\n\n\t\t}\n\t}\n\n\tpublic static long divide(long a, long b) {\n\t\tlong r;\n\t\tif (a < b) {\n\t\t\tlong temp = b;\n\t\t\tb = a;\n\t\t\ta = temp;\n\t\t}\n\t\tr = a % b;\n\n\t\treturn r == 0 ? b : divide(b, r);\n\t}\n\n}",
"Main"
] |
import java.io.IOException;
import java.util.Scanner;
public class Main{
public static void main(String[] args) throws IOException {
Scanner scan = new Scanner(System.in);
while (scan.hasNext()) {
long a = scan.nextLong();
long b = scan.nextLong();
long gcd = divide(a, b);
long lcm = a * b / gcd;
System.out.println(gcd + " " + lcm);
}
}
public static long divide(long a, long b) {
long r;
if (a < b) {
long temp = b;
b = a;
a = temp;
}
r = a % b;
return r == 0 ? b : divide(b, r);
}
} |
[
7,
15,
13,
17,
15,
13,
17,
6,
13,
41,
13,
12,
13,
30,
14,
2,
13,
13,
30,
41,
13,
13,
0,
13,
13,
0,
13,
13,
42,
2,
13,
17,
30,
41,
13,
13,
0,
13,
2,
13,
13,
0,
13,
13,
29,
13,
23,
13,
23,
13,
12,
13,
30,
29,
2,
2,
13,
4,
13,
13,
13,
13,
23,
13,
23,
13,
12,
13,
30,
0,
13,
20,
42,
17,
30,
38,
5,
13,
30,
3,
30,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
4,
18,
18,
13,
13,
2,
4,
13,
13,
13,
17,
4,
18,
18,
13,
13,
4,
13,
13,
13,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
114,
8
],
[
114,
9
],
[
9,
10
],
[
114,
11
],
[
11,
12
],
[
11,
13
],
[
13,
14
],
[
14,
15
],
[
15,
16
],
[
15,
17
],
[
14,
18
],
[
18,
19
],
[
19,
20
],
[
19,
21
],
[
18,
22
],
[
22,
23
],
[
22,
24
],
[
18,
25
],
[
25,
26
],
[
25,
27
],
[
13,
28
],
[
28,
29
],
[
29,
30
],
[
29,
31
],
[
28,
32
],
[
32,
33
],
[
33,
34
],
[
33,
35
],
[
32,
36
],
[
36,
37
],
[
36,
38
],
[
38,
39
],
[
38,
40
],
[
32,
41
],
[
41,
42
],
[
41,
43
],
[
13,
44
],
[
44,
45
],
[
11,
46
],
[
46,
47
],
[
11,
48
],
[
48,
49
],
[
114,
50
],
[
50,
51
],
[
50,
52
],
[
52,
53
],
[
53,
54
],
[
54,
55
],
[
55,
56
],
[
55,
57
],
[
57,
58
],
[
57,
59
],
[
57,
60
],
[
54,
61
],
[
50,
62
],
[
62,
63
],
[
50,
64
],
[
64,
65
],
[
114,
66
],
[
66,
67
],
[
66,
68
],
[
68,
69
],
[
69,
70
],
[
69,
71
],
[
68,
72
],
[
72,
73
],
[
72,
74
],
[
74,
75
],
[
75,
76
],
[
76,
77
],
[
76,
78
],
[
78,
79
],
[
75,
80
],
[
80,
81
],
[
81,
82
],
[
81,
83
],
[
83,
84
],
[
84,
85
],
[
80,
86
],
[
86,
87
],
[
86,
88
],
[
88,
89
],
[
89,
90
],
[
80,
91
],
[
91,
92
],
[
92,
93
],
[
93,
94
],
[
93,
95
],
[
91,
96
],
[
96,
97
],
[
97,
98
],
[
97,
99
],
[
97,
100
],
[
96,
101
],
[
80,
102
],
[
102,
103
],
[
103,
104
],
[
104,
105
],
[
104,
106
],
[
102,
107
],
[
107,
108
],
[
107,
109
],
[
107,
110
],
[
66,
111
],
[
111,
112
],
[
0,
113
],
[
113,
114
],
[
113,
115
]
] | [
"import java.util.NoSuchElementException;\nimport java.util.Scanner;\n\npublic class Main {\n\tprivate static Scanner sc;\n\tstatic int getGCD(int a,int b){\n\t\tif(b>a){\n\t\t\tint tmp=a;\n\t\t\ta=b;\n\t\t\tb=tmp;\n\t\t}\n\t\twhile(b!=0){\n\t\t\tint tmp=b;\n\t\t\tb=a%b;\n\t\t\ta=tmp;\n\t\t}\n\t\treturn a;\n\t}\n\tstatic int getLCM(int a,int b){\n\t\treturn a/getGCD(a,b)*b;\n\t}\n\tpublic static void main(String[] args){\n\t\tsc=new Scanner(System.in);\n\t\twhile(true){\n\t\t\ttry{\n\t\t\t\tint a=sc.nextInt();\n\t\t\t\tint b=sc.nextInt();\n\t\t\t\tSystem.out.print(getGCD(a,b)+\" \");\n\t\t\t\tSystem.out.println(getLCM(a,b));\n\t\t\t}catch(NoSuchElementException e){\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n}",
"import java.util.NoSuchElementException;",
"NoSuchElementException",
"java.util",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n\tprivate static Scanner sc;\n\tstatic int getGCD(int a,int b){\n\t\tif(b>a){\n\t\t\tint tmp=a;\n\t\t\ta=b;\n\t\t\tb=tmp;\n\t\t}\n\t\twhile(b!=0){\n\t\t\tint tmp=b;\n\t\t\tb=a%b;\n\t\t\ta=tmp;\n\t\t}\n\t\treturn a;\n\t}\n\tstatic int getLCM(int a,int b){\n\t\treturn a/getGCD(a,b)*b;\n\t}\n\tpublic static void main(String[] args){\n\t\tsc=new Scanner(System.in);\n\t\twhile(true){\n\t\t\ttry{\n\t\t\t\tint a=sc.nextInt();\n\t\t\t\tint b=sc.nextInt();\n\t\t\t\tSystem.out.print(getGCD(a,b)+\" \");\n\t\t\t\tSystem.out.println(getLCM(a,b));\n\t\t\t}catch(NoSuchElementException e){\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n}",
"Main",
"private static Scanner sc;",
"sc",
"static int getGCD(int a,int b){\n\t\tif(b>a){\n\t\t\tint tmp=a;\n\t\t\ta=b;\n\t\t\tb=tmp;\n\t\t}\n\t\twhile(b!=0){\n\t\t\tint tmp=b;\n\t\t\tb=a%b;\n\t\t\ta=tmp;\n\t\t}\n\t\treturn a;\n\t}",
"getGCD",
"{\n\t\tif(b>a){\n\t\t\tint tmp=a;\n\t\t\ta=b;\n\t\t\tb=tmp;\n\t\t}\n\t\twhile(b!=0){\n\t\t\tint tmp=b;\n\t\t\tb=a%b;\n\t\t\ta=tmp;\n\t\t}\n\t\treturn a;\n\t}",
"if(b>a){\n\t\t\tint tmp=a;\n\t\t\ta=b;\n\t\t\tb=tmp;\n\t\t}",
"b>a",
"b",
"a",
"{\n\t\t\tint tmp=a;\n\t\t\ta=b;\n\t\t\tb=tmp;\n\t\t}",
"int tmp=a;",
"tmp",
"a",
"a=b",
"a",
"b",
"b=tmp",
"b",
"tmp",
"while(b!=0){\n\t\t\tint tmp=b;\n\t\t\tb=a%b;\n\t\t\ta=tmp;\n\t\t}",
"b!=0",
"b",
"0",
"{\n\t\t\tint tmp=b;\n\t\t\tb=a%b;\n\t\t\ta=tmp;\n\t\t}",
"int tmp=b;",
"tmp",
"b",
"b=a%b",
"b",
"a%b",
"a",
"b",
"a=tmp",
"a",
"tmp",
"return a;",
"a",
"int a",
"a",
"int b",
"b",
"static int getLCM(int a,int b){\n\t\treturn a/getGCD(a,b)*b;\n\t}",
"getLCM",
"{\n\t\treturn a/getGCD(a,b)*b;\n\t}",
"return a/getGCD(a,b)*b;",
"a/getGCD(a,b)*b",
"a/getGCD(a,b)",
"a",
"getGCD(a,b)",
"getGCD",
"a",
"b",
"b",
"int a",
"a",
"int b",
"b",
"public static void main(String[] args){\n\t\tsc=new Scanner(System.in);\n\t\twhile(true){\n\t\t\ttry{\n\t\t\t\tint a=sc.nextInt();\n\t\t\t\tint b=sc.nextInt();\n\t\t\t\tSystem.out.print(getGCD(a,b)+\" \");\n\t\t\t\tSystem.out.println(getLCM(a,b));\n\t\t\t}catch(NoSuchElementException e){\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}",
"main",
"{\n\t\tsc=new Scanner(System.in);\n\t\twhile(true){\n\t\t\ttry{\n\t\t\t\tint a=sc.nextInt();\n\t\t\t\tint b=sc.nextInt();\n\t\t\t\tSystem.out.print(getGCD(a,b)+\" \");\n\t\t\t\tSystem.out.println(getLCM(a,b));\n\t\t\t}catch(NoSuchElementException e){\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}",
"sc=new Scanner(System.in)",
"sc",
"new Scanner(System.in)",
"while(true){\n\t\t\ttry{\n\t\t\t\tint a=sc.nextInt();\n\t\t\t\tint b=sc.nextInt();\n\t\t\t\tSystem.out.print(getGCD(a,b)+\" \");\n\t\t\t\tSystem.out.println(getLCM(a,b));\n\t\t\t}catch(NoSuchElementException e){\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}",
"true",
"{\n\t\t\ttry{\n\t\t\t\tint a=sc.nextInt();\n\t\t\t\tint b=sc.nextInt();\n\t\t\t\tSystem.out.print(getGCD(a,b)+\" \");\n\t\t\t\tSystem.out.println(getLCM(a,b));\n\t\t\t}catch(NoSuchElementException e){\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}",
"try{\n\t\t\t\tint a=sc.nextInt();\n\t\t\t\tint b=sc.nextInt();\n\t\t\t\tSystem.out.print(getGCD(a,b)+\" \");\n\t\t\t\tSystem.out.println(getLCM(a,b));\n\t\t\t}catch(NoSuchElementException e){\n\t\t\t\tbreak;\n\t\t\t}",
"catch(NoSuchElementException e){\n\t\t\t\tbreak;\n\t\t\t}",
"NoSuchElementException e",
"{\n\t\t\t\tbreak;\n\t\t\t}",
"break;",
"{\n\t\t\t\tint a=sc.nextInt();\n\t\t\t\tint b=sc.nextInt();\n\t\t\t\tSystem.out.print(getGCD(a,b)+\" \");\n\t\t\t\tSystem.out.println(getLCM(a,b));\n\t\t\t}",
"int a=sc.nextInt();",
"a",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int b=sc.nextInt();",
"b",
"sc.nextInt()",
"sc.nextInt",
"sc",
"System.out.print(getGCD(a,b)+\" \")",
"System.out.print",
"System.out",
"System",
"System.out",
"getGCD(a,b)+\" \"",
"getGCD(a,b)",
"getGCD",
"a",
"b",
"\" \"",
"System.out.println(getLCM(a,b))",
"System.out.println",
"System.out",
"System",
"System.out",
"getLCM(a,b)",
"getLCM",
"a",
"b",
"String[] args",
"args",
"public class Main {\n\tprivate static Scanner sc;\n\tstatic int getGCD(int a,int b){\n\t\tif(b>a){\n\t\t\tint tmp=a;\n\t\t\ta=b;\n\t\t\tb=tmp;\n\t\t}\n\t\twhile(b!=0){\n\t\t\tint tmp=b;\n\t\t\tb=a%b;\n\t\t\ta=tmp;\n\t\t}\n\t\treturn a;\n\t}\n\tstatic int getLCM(int a,int b){\n\t\treturn a/getGCD(a,b)*b;\n\t}\n\tpublic static void main(String[] args){\n\t\tsc=new Scanner(System.in);\n\t\twhile(true){\n\t\t\ttry{\n\t\t\t\tint a=sc.nextInt();\n\t\t\t\tint b=sc.nextInt();\n\t\t\t\tSystem.out.print(getGCD(a,b)+\" \");\n\t\t\t\tSystem.out.println(getLCM(a,b));\n\t\t\t}catch(NoSuchElementException e){\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n}",
"public class Main {\n\tprivate static Scanner sc;\n\tstatic int getGCD(int a,int b){\n\t\tif(b>a){\n\t\t\tint tmp=a;\n\t\t\ta=b;\n\t\t\tb=tmp;\n\t\t}\n\t\twhile(b!=0){\n\t\t\tint tmp=b;\n\t\t\tb=a%b;\n\t\t\ta=tmp;\n\t\t}\n\t\treturn a;\n\t}\n\tstatic int getLCM(int a,int b){\n\t\treturn a/getGCD(a,b)*b;\n\t}\n\tpublic static void main(String[] args){\n\t\tsc=new Scanner(System.in);\n\t\twhile(true){\n\t\t\ttry{\n\t\t\t\tint a=sc.nextInt();\n\t\t\t\tint b=sc.nextInt();\n\t\t\t\tSystem.out.print(getGCD(a,b)+\" \");\n\t\t\t\tSystem.out.println(getLCM(a,b));\n\t\t\t}catch(NoSuchElementException e){\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n}",
"Main"
] | import java.util.NoSuchElementException;
import java.util.Scanner;
public class Main {
private static Scanner sc;
static int getGCD(int a,int b){
if(b>a){
int tmp=a;
a=b;
b=tmp;
}
while(b!=0){
int tmp=b;
b=a%b;
a=tmp;
}
return a;
}
static int getLCM(int a,int b){
return a/getGCD(a,b)*b;
}
public static void main(String[] args){
sc=new Scanner(System.in);
while(true){
try{
int a=sc.nextInt();
int b=sc.nextInt();
System.out.print(getGCD(a,b)+" ");
System.out.println(getLCM(a,b));
}catch(NoSuchElementException e){
break;
}
}
}
} |
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
38,
5,
13,
30,
30,
42,
4,
18,
13,
30,
41,
13,
20,
41,
13,
20,
41,
13,
4,
18,
13,
13,
41,
13,
4,
18,
4,
18,
13,
13,
13,
4,
18,
18,
13,
13,
2,
2,
13,
17,
13,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
10,
11
],
[
10,
12
],
[
0,
13
],
[
65,
14
],
[
65,
15
],
[
15,
16
],
[
15,
17
],
[
17,
18
],
[
18,
19
],
[
18,
20
],
[
17,
21
],
[
21,
22
],
[
22,
23
],
[
22,
24
],
[
21,
25
],
[
25,
26
],
[
26,
27
],
[
27,
28
],
[
28,
29
],
[
26,
30
],
[
30,
31
],
[
31,
32
],
[
31,
33
],
[
30,
34
],
[
34,
35
],
[
34,
36
],
[
30,
37
],
[
37,
38
],
[
37,
39
],
[
39,
40
],
[
40,
41
],
[
39,
42
],
[
30,
43
],
[
43,
44
],
[
43,
45
],
[
45,
46
],
[
46,
47
],
[
47,
48
],
[
48,
49
],
[
47,
50
],
[
45,
51
],
[
30,
52
],
[
52,
53
],
[
53,
54
],
[
54,
55
],
[
54,
56
],
[
52,
57
],
[
58,
58
],
[
58,
59
],
[
58,
60
],
[
58,
61
],
[
15,
62
],
[
62,
63
],
[
0,
64
],
[
64,
65
],
[
64,
66
]
] | [
"import java.io.BufferedReader;\nimport java.io.InputStreamReader;\nimport java.math.BigInteger;\nimport java.util.Scanner;\n\npublic class Main {\n\n\tpublic static void main(String[] args) {\n\t\tScanner scan=new Scanner(new BufferedReader(new InputStreamReader(System.in)));\n\t\ttry {\n\t\t\twhile(scan.hasNext()){\n\t\t\t\tBigInteger bigInteger1=new BigInteger(scan.next());\n\t\t\t\tBigInteger bigInteger2=new BigInteger(scan.next());\n\t\t\t\tBigInteger bigInteger3=bigInteger1.gcd(bigInteger2);\n\t\t\t\tBigInteger bigInteger4=bigInteger1.multiply(bigInteger2).divide(bigInteger3);\n\t\t\t\tSystem.out.println(bigInteger3+\" \"+bigInteger4);\n\t\t\t\t\n\t\t\t\t\n\t\t\t}\n\t\t} catch (Exception e) {\n\t\t\t// TODO: handle exception\n\t\t}\n\t\t\n\t}\n\n}",
"import java.io.BufferedReader;",
"BufferedReader",
"java.io",
"import java.io.InputStreamReader;",
"InputStreamReader",
"java.io",
"import java.math.BigInteger;",
"BigInteger",
"java.math",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n\n\tpublic static void main(String[] args) {\n\t\tScanner scan=new Scanner(new BufferedReader(new InputStreamReader(System.in)));\n\t\ttry {\n\t\t\twhile(scan.hasNext()){\n\t\t\t\tBigInteger bigInteger1=new BigInteger(scan.next());\n\t\t\t\tBigInteger bigInteger2=new BigInteger(scan.next());\n\t\t\t\tBigInteger bigInteger3=bigInteger1.gcd(bigInteger2);\n\t\t\t\tBigInteger bigInteger4=bigInteger1.multiply(bigInteger2).divide(bigInteger3);\n\t\t\t\tSystem.out.println(bigInteger3+\" \"+bigInteger4);\n\t\t\t\t\n\t\t\t\t\n\t\t\t}\n\t\t} catch (Exception e) {\n\t\t\t// TODO: handle exception\n\t\t}\n\t\t\n\t}\n\n}",
"Main",
"public static void main(String[] args) {\n\t\tScanner scan=new Scanner(new BufferedReader(new InputStreamReader(System.in)));\n\t\ttry {\n\t\t\twhile(scan.hasNext()){\n\t\t\t\tBigInteger bigInteger1=new BigInteger(scan.next());\n\t\t\t\tBigInteger bigInteger2=new BigInteger(scan.next());\n\t\t\t\tBigInteger bigInteger3=bigInteger1.gcd(bigInteger2);\n\t\t\t\tBigInteger bigInteger4=bigInteger1.multiply(bigInteger2).divide(bigInteger3);\n\t\t\t\tSystem.out.println(bigInteger3+\" \"+bigInteger4);\n\t\t\t\t\n\t\t\t\t\n\t\t\t}\n\t\t} catch (Exception e) {\n\t\t\t// TODO: handle exception\n\t\t}\n\t\t\n\t}",
"main",
"{\n\t\tScanner scan=new Scanner(new BufferedReader(new InputStreamReader(System.in)));\n\t\ttry {\n\t\t\twhile(scan.hasNext()){\n\t\t\t\tBigInteger bigInteger1=new BigInteger(scan.next());\n\t\t\t\tBigInteger bigInteger2=new BigInteger(scan.next());\n\t\t\t\tBigInteger bigInteger3=bigInteger1.gcd(bigInteger2);\n\t\t\t\tBigInteger bigInteger4=bigInteger1.multiply(bigInteger2).divide(bigInteger3);\n\t\t\t\tSystem.out.println(bigInteger3+\" \"+bigInteger4);\n\t\t\t\t\n\t\t\t\t\n\t\t\t}\n\t\t} catch (Exception e) {\n\t\t\t// TODO: handle exception\n\t\t}\n\t\t\n\t}",
"Scanner scan=new Scanner(new BufferedReader(new InputStreamReader(System.in)));",
"scan",
"new Scanner(new BufferedReader(new InputStreamReader(System.in)))",
"try {\n\t\t\twhile(scan.hasNext()){\n\t\t\t\tBigInteger bigInteger1=new BigInteger(scan.next());\n\t\t\t\tBigInteger bigInteger2=new BigInteger(scan.next());\n\t\t\t\tBigInteger bigInteger3=bigInteger1.gcd(bigInteger2);\n\t\t\t\tBigInteger bigInteger4=bigInteger1.multiply(bigInteger2).divide(bigInteger3);\n\t\t\t\tSystem.out.println(bigInteger3+\" \"+bigInteger4);\n\t\t\t\t\n\t\t\t\t\n\t\t\t}\n\t\t} catch (Exception e) {\n\t\t\t// TODO: handle exception\n\t\t}",
"catch (Exception e) {\n\t\t\t// TODO: handle exception\n\t\t}",
"Exception e",
"{\n\t\t\t// TODO: handle exception\n\t\t}",
"{\n\t\t\twhile(scan.hasNext()){\n\t\t\t\tBigInteger bigInteger1=new BigInteger(scan.next());\n\t\t\t\tBigInteger bigInteger2=new BigInteger(scan.next());\n\t\t\t\tBigInteger bigInteger3=bigInteger1.gcd(bigInteger2);\n\t\t\t\tBigInteger bigInteger4=bigInteger1.multiply(bigInteger2).divide(bigInteger3);\n\t\t\t\tSystem.out.println(bigInteger3+\" \"+bigInteger4);\n\t\t\t\t\n\t\t\t\t\n\t\t\t}\n\t\t}",
"while(scan.hasNext()){\n\t\t\t\tBigInteger bigInteger1=new BigInteger(scan.next());\n\t\t\t\tBigInteger bigInteger2=new BigInteger(scan.next());\n\t\t\t\tBigInteger bigInteger3=bigInteger1.gcd(bigInteger2);\n\t\t\t\tBigInteger bigInteger4=bigInteger1.multiply(bigInteger2).divide(bigInteger3);\n\t\t\t\tSystem.out.println(bigInteger3+\" \"+bigInteger4);\n\t\t\t\t\n\t\t\t\t\n\t\t\t}",
"scan.hasNext()",
"scan.hasNext",
"scan",
"{\n\t\t\t\tBigInteger bigInteger1=new BigInteger(scan.next());\n\t\t\t\tBigInteger bigInteger2=new BigInteger(scan.next());\n\t\t\t\tBigInteger bigInteger3=bigInteger1.gcd(bigInteger2);\n\t\t\t\tBigInteger bigInteger4=bigInteger1.multiply(bigInteger2).divide(bigInteger3);\n\t\t\t\tSystem.out.println(bigInteger3+\" \"+bigInteger4);\n\t\t\t\t\n\t\t\t\t\n\t\t\t}",
"BigInteger bigInteger1=new BigInteger(scan.next());",
"bigInteger1",
"new BigInteger(scan.next())",
"BigInteger bigInteger2=new BigInteger(scan.next());",
"bigInteger2",
"new BigInteger(scan.next())",
"BigInteger bigInteger3=bigInteger1.gcd(bigInteger2);",
"bigInteger3",
"bigInteger1.gcd(bigInteger2)",
"bigInteger1.gcd",
"bigInteger1",
"bigInteger2",
"BigInteger bigInteger4=bigInteger1.multiply(bigInteger2).divide(bigInteger3);",
"bigInteger4",
"bigInteger1.multiply(bigInteger2).divide(bigInteger3)",
"bigInteger1.multiply(bigInteger2).divide",
"bigInteger1.multiply(bigInteger2)",
"bigInteger1.multiply",
"bigInteger1",
"bigInteger2",
"bigInteger3",
"System.out.println(bigInteger3+\" \"+bigInteger4)",
"System.out.println",
"System.out",
"System",
"System.out",
"bigInteger3+\" \"+bigInteger4",
"bigInteger3+\" \"+bigInteger4",
"bigInteger3",
"\" \"",
"bigInteger4",
"String[] args",
"args",
"public class Main {\n\n\tpublic static void main(String[] args) {\n\t\tScanner scan=new Scanner(new BufferedReader(new InputStreamReader(System.in)));\n\t\ttry {\n\t\t\twhile(scan.hasNext()){\n\t\t\t\tBigInteger bigInteger1=new BigInteger(scan.next());\n\t\t\t\tBigInteger bigInteger2=new BigInteger(scan.next());\n\t\t\t\tBigInteger bigInteger3=bigInteger1.gcd(bigInteger2);\n\t\t\t\tBigInteger bigInteger4=bigInteger1.multiply(bigInteger2).divide(bigInteger3);\n\t\t\t\tSystem.out.println(bigInteger3+\" \"+bigInteger4);\n\t\t\t\t\n\t\t\t\t\n\t\t\t}\n\t\t} catch (Exception e) {\n\t\t\t// TODO: handle exception\n\t\t}\n\t\t\n\t}\n\n}",
"public class Main {\n\n\tpublic static void main(String[] args) {\n\t\tScanner scan=new Scanner(new BufferedReader(new InputStreamReader(System.in)));\n\t\ttry {\n\t\t\twhile(scan.hasNext()){\n\t\t\t\tBigInteger bigInteger1=new BigInteger(scan.next());\n\t\t\t\tBigInteger bigInteger2=new BigInteger(scan.next());\n\t\t\t\tBigInteger bigInteger3=bigInteger1.gcd(bigInteger2);\n\t\t\t\tBigInteger bigInteger4=bigInteger1.multiply(bigInteger2).divide(bigInteger3);\n\t\t\t\tSystem.out.println(bigInteger3+\" \"+bigInteger4);\n\t\t\t\t\n\t\t\t\t\n\t\t\t}\n\t\t} catch (Exception e) {\n\t\t\t// TODO: handle exception\n\t\t}\n\t\t\n\t}\n\n}",
"Main"
] | import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.math.BigInteger;
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner scan=new Scanner(new BufferedReader(new InputStreamReader(System.in)));
try {
while(scan.hasNext()){
BigInteger bigInteger1=new BigInteger(scan.next());
BigInteger bigInteger2=new BigInteger(scan.next());
BigInteger bigInteger3=bigInteger1.gcd(bigInteger2);
BigInteger bigInteger4=bigInteger1.multiply(bigInteger2).divide(bigInteger3);
System.out.println(bigInteger3+" "+bigInteger4);
}
} catch (Exception e) {
// TODO: handle exception
}
}
} |
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
42,
4,
18,
13,
30,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
41,
13,
4,
13,
13,
13,
41,
13,
2,
2,
13,
13,
13,
4,
18,
18,
13,
13,
2,
2,
13,
17,
13,
23,
13,
12,
13,
30,
14,
2,
2,
13,
13,
17,
30,
29,
4,
13,
13,
2,
13,
13,
30,
29,
13,
23,
13,
23,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
13,
14
],
[
14,
15
],
[
12,
16
],
[
16,
17
],
[
17,
18
],
[
17,
19
],
[
19,
20
],
[
20,
21
],
[
16,
22
],
[
22,
23
],
[
22,
24
],
[
24,
25
],
[
25,
26
],
[
16,
27
],
[
27,
28
],
[
27,
29
],
[
29,
30
],
[
29,
31
],
[
29,
32
],
[
16,
33
],
[
33,
34
],
[
33,
35
],
[
35,
36
],
[
36,
37
],
[
36,
38
],
[
35,
39
],
[
16,
40
],
[
40,
41
],
[
41,
42
],
[
42,
43
],
[
42,
44
],
[
40,
45
],
[
46,
46
],
[
46,
47
],
[
46,
48
],
[
46,
49
],
[
6,
50
],
[
50,
51
],
[
4,
52
],
[
52,
53
],
[
52,
54
],
[
54,
55
],
[
55,
56
],
[
56,
57
],
[
57,
58
],
[
57,
59
],
[
56,
60
],
[
55,
61
],
[
61,
62
],
[
62,
63
],
[
63,
64
],
[
63,
65
],
[
63,
66
],
[
66,
67
],
[
66,
68
],
[
55,
69
],
[
69,
70
],
[
70,
71
],
[
52,
72
],
[
72,
73
],
[
52,
74
],
[
74,
75
]
] | [
"/* package whatever; // don't place package name! */\n\nimport java.util.Scanner;\n\nclass Main\n{\n\tpublic static void main (String[] args) throws java.lang.Exception\n\t{\n\t\tScanner cin = new Scanner(System.in);\n\t\t\n\t\twhile (cin.hasNext()){\n\t\t\tint a = cin.nextInt();\n\t\t\tint b = cin.nextInt();\n\t\t\tint gcd = GCD(a, b);\n\t\t\tint lcm = a / gcd * b;\n\t\t\t\n\t\t\tSystem.out.println(gcd + \" \" + lcm);\n\t\t}\n\t}\n\t\n\tprivate static int GCD(int a, int b)\n\t{\n\t\tif (a % b != 0){\n\t\t\treturn (GCD(b, a % b));\n\t\t}\n\t\telse {\n\t\t\treturn (b);\n\t\t}\n\t}\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"class Main\n{\n\tpublic static void main (String[] args) throws java.lang.Exception\n\t{\n\t\tScanner cin = new Scanner(System.in);\n\t\t\n\t\twhile (cin.hasNext()){\n\t\t\tint a = cin.nextInt();\n\t\t\tint b = cin.nextInt();\n\t\t\tint gcd = GCD(a, b);\n\t\t\tint lcm = a / gcd * b;\n\t\t\t\n\t\t\tSystem.out.println(gcd + \" \" + lcm);\n\t\t}\n\t}\n\t\n\tprivate static int GCD(int a, int b)\n\t{\n\t\tif (a % b != 0){\n\t\t\treturn (GCD(b, a % b));\n\t\t}\n\t\telse {\n\t\t\treturn (b);\n\t\t}\n\t}\n}",
"Main",
"public static void main (String[] args) throws java.lang.Exception\n\t{\n\t\tScanner cin = new Scanner(System.in);\n\t\t\n\t\twhile (cin.hasNext()){\n\t\t\tint a = cin.nextInt();\n\t\t\tint b = cin.nextInt();\n\t\t\tint gcd = GCD(a, b);\n\t\t\tint lcm = a / gcd * b;\n\t\t\t\n\t\t\tSystem.out.println(gcd + \" \" + lcm);\n\t\t}\n\t}",
"main",
"{\n\t\tScanner cin = new Scanner(System.in);\n\t\t\n\t\twhile (cin.hasNext()){\n\t\t\tint a = cin.nextInt();\n\t\t\tint b = cin.nextInt();\n\t\t\tint gcd = GCD(a, b);\n\t\t\tint lcm = a / gcd * b;\n\t\t\t\n\t\t\tSystem.out.println(gcd + \" \" + lcm);\n\t\t}\n\t}",
"Scanner cin = new Scanner(System.in);",
"cin",
"new Scanner(System.in)",
"while (cin.hasNext()){\n\t\t\tint a = cin.nextInt();\n\t\t\tint b = cin.nextInt();\n\t\t\tint gcd = GCD(a, b);\n\t\t\tint lcm = a / gcd * b;\n\t\t\t\n\t\t\tSystem.out.println(gcd + \" \" + lcm);\n\t\t}",
"cin.hasNext()",
"cin.hasNext",
"cin",
"{\n\t\t\tint a = cin.nextInt();\n\t\t\tint b = cin.nextInt();\n\t\t\tint gcd = GCD(a, b);\n\t\t\tint lcm = a / gcd * b;\n\t\t\t\n\t\t\tSystem.out.println(gcd + \" \" + lcm);\n\t\t}",
"int a = cin.nextInt();",
"a",
"cin.nextInt()",
"cin.nextInt",
"cin",
"int b = cin.nextInt();",
"b",
"cin.nextInt()",
"cin.nextInt",
"cin",
"int gcd = GCD(a, b);",
"gcd",
"GCD(a, b)",
"GCD",
"a",
"b",
"int lcm = a / gcd * b;",
"lcm",
"a / gcd * b",
"a / gcd",
"a",
"gcd",
"b",
"System.out.println(gcd + \" \" + lcm)",
"System.out.println",
"System.out",
"System",
"System.out",
"gcd + \" \" + lcm",
"gcd + \" \" + lcm",
"gcd",
"\" \"",
"lcm",
"String[] args",
"args",
"private static int GCD(int a, int b)\n\t{\n\t\tif (a % b != 0){\n\t\t\treturn (GCD(b, a % b));\n\t\t}\n\t\telse {\n\t\t\treturn (b);\n\t\t}\n\t}",
"GCD",
"{\n\t\tif (a % b != 0){\n\t\t\treturn (GCD(b, a % b));\n\t\t}\n\t\telse {\n\t\t\treturn (b);\n\t\t}\n\t}",
"if (a % b != 0){\n\t\t\treturn (GCD(b, a % b));\n\t\t}\n\t\telse {\n\t\t\treturn (b);\n\t\t}",
"a % b != 0",
"a % b",
"a",
"b",
"0",
"{\n\t\t\treturn (GCD(b, a % b));\n\t\t}",
"return (GCD(b, a % b));",
"(GCD(b, a % b))",
"GCD",
"b",
"a % b",
"a",
"b",
"{\n\t\t\treturn (b);\n\t\t}",
"return (b);",
"(b)",
"int a",
"a",
"int b",
"b"
] | /* package whatever; // don't place package name! */
import java.util.Scanner;
class Main
{
public static void main (String[] args) throws java.lang.Exception
{
Scanner cin = new Scanner(System.in);
while (cin.hasNext()){
int a = cin.nextInt();
int b = cin.nextInt();
int gcd = GCD(a, b);
int lcm = a / gcd * b;
System.out.println(gcd + " " + lcm);
}
}
private static int GCD(int a, int b)
{
if (a % b != 0){
return (GCD(b, a % b));
}
else {
return (b);
}
}
} |
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
17,
41,
13,
20,
41,
13,
17,
41,
13,
17,
41,
13,
20,
17,
42,
2,
2,
13,
13,
2,
0,
13,
4,
18,
13,
17,
30,
41,
13,
4,
18,
13,
17,
40,
17,
0,
18,
13,
17,
4,
18,
13,
18,
13,
17,
0,
18,
13,
17,
4,
18,
13,
18,
13,
17,
41,
13,
17,
11,
1,
41,
13,
2,
18,
13,
17,
17,
2,
13,
17,
1,
40,
13,
30,
30,
14,
2,
2,
2,
18,
13,
17,
13,
17,
2,
2,
18,
13,
17,
13,
17,
30,
0,
18,
13,
17,
2,
18,
13,
17,
13,
0,
18,
13,
17,
2,
18,
13,
17,
13,
0,
13,
2,
13,
13,
41,
13,
2,
2,
13,
18,
13,
17,
18,
13,
17,
4,
18,
18,
13,
13,
2,
2,
13,
17,
13,
40,
13,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
158,
11
],
[
158,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
15,
17
],
[
14,
18
],
[
18,
19
],
[
18,
20
],
[
14,
21
],
[
21,
22
],
[
21,
23
],
[
14,
24
],
[
24,
25
],
[
24,
26
],
[
14,
27
],
[
27,
28
],
[
27,
29
],
[
14,
31
],
[
31,
32
],
[
32,
33
],
[
33,
34
],
[
33,
35
],
[
32,
36
],
[
36,
37
],
[
37,
38
],
[
37,
39
],
[
39,
40
],
[
40,
41
],
[
36,
42
],
[
31,
43
],
[
43,
44
],
[
44,
45
],
[
44,
46
],
[
46,
47
],
[
47,
48
],
[
46,
49
],
[
46,
50
],
[
50,
51
],
[
43,
52
],
[
52,
53
],
[
53,
54
],
[
53,
55
],
[
52,
56
],
[
56,
57
],
[
57,
58
],
[
56,
59
],
[
59,
60
],
[
59,
61
],
[
43,
62
],
[
62,
63
],
[
63,
64
],
[
63,
65
],
[
62,
66
],
[
66,
67
],
[
67,
68
],
[
66,
69
],
[
69,
70
],
[
69,
71
],
[
43,
72
],
[
72,
73
],
[
72,
74
],
[
43,
75
],
[
75,
76
],
[
76,
77
],
[
77,
78
],
[
77,
79
],
[
79,
80
],
[
80,
81
],
[
80,
82
],
[
79,
83
],
[
75,
84
],
[
84,
85
],
[
84,
86
],
[
75,
87
],
[
87,
88
],
[
88,
89
],
[
75,
90
],
[
91,
91
],
[
91,
92
],
[
92,
93
],
[
93,
94
],
[
94,
95
],
[
95,
96
],
[
96,
97
],
[
96,
98
],
[
95,
99
],
[
94,
100
],
[
93,
101
],
[
101,
102
],
[
102,
103
],
[
103,
104
],
[
103,
105
],
[
102,
106
],
[
101,
107
],
[
92,
108
],
[
108,
109
],
[
109,
110
],
[
110,
111
],
[
110,
112
],
[
109,
113
],
[
113,
114
],
[
114,
115
],
[
114,
116
],
[
113,
117
],
[
108,
118
],
[
118,
119
],
[
119,
120
],
[
119,
121
],
[
118,
122
],
[
122,
123
],
[
123,
124
],
[
123,
125
],
[
122,
126
],
[
108,
127
],
[
127,
128
],
[
127,
129
],
[
129,
130
],
[
129,
131
],
[
43,
132
],
[
132,
133
],
[
132,
134
],
[
135,
135
],
[
135,
136
],
[
135,
137
],
[
137,
138
],
[
137,
139
],
[
135,
140
],
[
140,
141
],
[
140,
142
],
[
43,
143
],
[
143,
144
],
[
144,
145
],
[
145,
146
],
[
145,
147
],
[
143,
148
],
[
149,
149
],
[
149,
150
],
[
149,
151
],
[
149,
152
],
[
43,
153
],
[
153,
154
],
[
12,
155
],
[
155,
156
],
[
0,
157
],
[
157,
158
],
[
157,
159
]
] | [
"\nimport java.io.BufferedReader;\nimport java.io.IOException;\nimport java.io.InputStreamReader;\n\npublic class Main {\n\n\tpublic static void main(String[] a) throws IOException{\n\n\t\tString strLine =\"\";\n\t\tBufferedReader stdReader =\n\t\t\t\tnew BufferedReader(new InputStreamReader(System.in));\n\n\t\tint i = 0;\n\t\tint max = 50;\n\t\tint[] tempInt = new int[2];\n\n\t\twhile ( i <= max && ((strLine = stdReader.readLine()) != null) ){\n\n\n\t\t\t\t//??????????????§?????????\n\t\t\t\tString[] temp = strLine.split(\" \",-10);\n\t\t\t\ttempInt[0] =Integer.parseInt(temp[0]);\n\t\t\t\ttempInt[1] = Integer.parseInt(temp[1]);\n\n\t\t\t\tint maxYakusu = 1;\n\n\t\t\t\tfor(int k = tempInt[1]-1 ; k > 1 ; k--){\n\n\t\t\t\t\tif((tempInt[0]%k == 0)&&(tempInt[1]%k == 0)){\n\t\t\t\t\t\ttempInt[0] = tempInt[0]/k;\n\t\t\t\t\t\ttempInt[1] = tempInt[1]/k;\n\t\t\t\t\t\tmaxYakusu = maxYakusu * k;\n\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\n\t\t\t\t//????°???¬?????°????±????????????????????´???????\n\t\t\t\tint maxBaisu = maxYakusu * tempInt[0] * tempInt[1];\n\n\t\t\t\tSystem.out.println(maxYakusu+\" \"+maxBaisu);\n\t\t\t\ti++;\n\t\t}\n\n\t}\n\n}",
"import java.io.BufferedReader;",
"BufferedReader",
"java.io",
"import java.io.IOException;",
"IOException",
"java.io",
"import java.io.InputStreamReader;",
"InputStreamReader",
"java.io",
"public class Main {\n\n\tpublic static void main(String[] a) throws IOException{\n\n\t\tString strLine =\"\";\n\t\tBufferedReader stdReader =\n\t\t\t\tnew BufferedReader(new InputStreamReader(System.in));\n\n\t\tint i = 0;\n\t\tint max = 50;\n\t\tint[] tempInt = new int[2];\n\n\t\twhile ( i <= max && ((strLine = stdReader.readLine()) != null) ){\n\n\n\t\t\t\t//??????????????§?????????\n\t\t\t\tString[] temp = strLine.split(\" \",-10);\n\t\t\t\ttempInt[0] =Integer.parseInt(temp[0]);\n\t\t\t\ttempInt[1] = Integer.parseInt(temp[1]);\n\n\t\t\t\tint maxYakusu = 1;\n\n\t\t\t\tfor(int k = tempInt[1]-1 ; k > 1 ; k--){\n\n\t\t\t\t\tif((tempInt[0]%k == 0)&&(tempInt[1]%k == 0)){\n\t\t\t\t\t\ttempInt[0] = tempInt[0]/k;\n\t\t\t\t\t\ttempInt[1] = tempInt[1]/k;\n\t\t\t\t\t\tmaxYakusu = maxYakusu * k;\n\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\n\t\t\t\t//????°???¬?????°????±????????????????????´???????\n\t\t\t\tint maxBaisu = maxYakusu * tempInt[0] * tempInt[1];\n\n\t\t\t\tSystem.out.println(maxYakusu+\" \"+maxBaisu);\n\t\t\t\ti++;\n\t\t}\n\n\t}\n\n}",
"Main",
"public static void main(String[] a) throws IOException{\n\n\t\tString strLine =\"\";\n\t\tBufferedReader stdReader =\n\t\t\t\tnew BufferedReader(new InputStreamReader(System.in));\n\n\t\tint i = 0;\n\t\tint max = 50;\n\t\tint[] tempInt = new int[2];\n\n\t\twhile ( i <= max && ((strLine = stdReader.readLine()) != null) ){\n\n\n\t\t\t\t//??????????????§?????????\n\t\t\t\tString[] temp = strLine.split(\" \",-10);\n\t\t\t\ttempInt[0] =Integer.parseInt(temp[0]);\n\t\t\t\ttempInt[1] = Integer.parseInt(temp[1]);\n\n\t\t\t\tint maxYakusu = 1;\n\n\t\t\t\tfor(int k = tempInt[1]-1 ; k > 1 ; k--){\n\n\t\t\t\t\tif((tempInt[0]%k == 0)&&(tempInt[1]%k == 0)){\n\t\t\t\t\t\ttempInt[0] = tempInt[0]/k;\n\t\t\t\t\t\ttempInt[1] = tempInt[1]/k;\n\t\t\t\t\t\tmaxYakusu = maxYakusu * k;\n\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\n\t\t\t\t//????°???¬?????°????±????????????????????´???????\n\t\t\t\tint maxBaisu = maxYakusu * tempInt[0] * tempInt[1];\n\n\t\t\t\tSystem.out.println(maxYakusu+\" \"+maxBaisu);\n\t\t\t\ti++;\n\t\t}\n\n\t}",
"main",
"{\n\n\t\tString strLine =\"\";\n\t\tBufferedReader stdReader =\n\t\t\t\tnew BufferedReader(new InputStreamReader(System.in));\n\n\t\tint i = 0;\n\t\tint max = 50;\n\t\tint[] tempInt = new int[2];\n\n\t\twhile ( i <= max && ((strLine = stdReader.readLine()) != null) ){\n\n\n\t\t\t\t//??????????????§?????????\n\t\t\t\tString[] temp = strLine.split(\" \",-10);\n\t\t\t\ttempInt[0] =Integer.parseInt(temp[0]);\n\t\t\t\ttempInt[1] = Integer.parseInt(temp[1]);\n\n\t\t\t\tint maxYakusu = 1;\n\n\t\t\t\tfor(int k = tempInt[1]-1 ; k > 1 ; k--){\n\n\t\t\t\t\tif((tempInt[0]%k == 0)&&(tempInt[1]%k == 0)){\n\t\t\t\t\t\ttempInt[0] = tempInt[0]/k;\n\t\t\t\t\t\ttempInt[1] = tempInt[1]/k;\n\t\t\t\t\t\tmaxYakusu = maxYakusu * k;\n\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\n\t\t\t\t//????°???¬?????°????±????????????????????´???????\n\t\t\t\tint maxBaisu = maxYakusu * tempInt[0] * tempInt[1];\n\n\t\t\t\tSystem.out.println(maxYakusu+\" \"+maxBaisu);\n\t\t\t\ti++;\n\t\t}\n\n\t}",
"String strLine =\"\";",
"strLine",
"\"\"",
"BufferedReader stdReader =\n\t\t\t\tnew BufferedReader(new InputStreamReader(System.in));",
"stdReader",
"new BufferedReader(new InputStreamReader(System.in))",
"int i = 0;",
"i",
"0",
"int max = 50;",
"max",
"50",
"int[] tempInt = new int[2];",
"tempInt",
"new int[2]",
"2",
"while ( i <= max && ((strLine = stdReader.readLine()) != null) ){\n\n\n\t\t\t\t//??????????????§?????????\n\t\t\t\tString[] temp = strLine.split(\" \",-10);\n\t\t\t\ttempInt[0] =Integer.parseInt(temp[0]);\n\t\t\t\ttempInt[1] = Integer.parseInt(temp[1]);\n\n\t\t\t\tint maxYakusu = 1;\n\n\t\t\t\tfor(int k = tempInt[1]-1 ; k > 1 ; k--){\n\n\t\t\t\t\tif((tempInt[0]%k == 0)&&(tempInt[1]%k == 0)){\n\t\t\t\t\t\ttempInt[0] = tempInt[0]/k;\n\t\t\t\t\t\ttempInt[1] = tempInt[1]/k;\n\t\t\t\t\t\tmaxYakusu = maxYakusu * k;\n\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\n\t\t\t\t//????°???¬?????°????±????????????????????´???????\n\t\t\t\tint maxBaisu = maxYakusu * tempInt[0] * tempInt[1];\n\n\t\t\t\tSystem.out.println(maxYakusu+\" \"+maxBaisu);\n\t\t\t\ti++;\n\t\t}",
"i <= max && ((strLine = stdReader.readLine()) != null)",
"i <= max",
"i",
"max",
"((strLine = stdReader.readLine()) != null)",
"(strLine = stdReader.readLine())",
"strLine",
"stdReader.readLine()",
"stdReader.readLine",
"stdReader",
"null",
"{\n\n\n\t\t\t\t//??????????????§?????????\n\t\t\t\tString[] temp = strLine.split(\" \",-10);\n\t\t\t\ttempInt[0] =Integer.parseInt(temp[0]);\n\t\t\t\ttempInt[1] = Integer.parseInt(temp[1]);\n\n\t\t\t\tint maxYakusu = 1;\n\n\t\t\t\tfor(int k = tempInt[1]-1 ; k > 1 ; k--){\n\n\t\t\t\t\tif((tempInt[0]%k == 0)&&(tempInt[1]%k == 0)){\n\t\t\t\t\t\ttempInt[0] = tempInt[0]/k;\n\t\t\t\t\t\ttempInt[1] = tempInt[1]/k;\n\t\t\t\t\t\tmaxYakusu = maxYakusu * k;\n\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\n\t\t\t\t//????°???¬?????°????±????????????????????´???????\n\t\t\t\tint maxBaisu = maxYakusu * tempInt[0] * tempInt[1];\n\n\t\t\t\tSystem.out.println(maxYakusu+\" \"+maxBaisu);\n\t\t\t\ti++;\n\t\t}",
"String[] temp = strLine.split(\" \",-10);",
"temp",
"strLine.split(\" \",-10)",
"strLine.split",
"strLine",
"\" \"",
"-10",
"10",
"tempInt[0] =Integer.parseInt(temp[0])",
"tempInt[0]",
"tempInt",
"0",
"Integer.parseInt(temp[0])",
"Integer.parseInt",
"Integer",
"temp[0]",
"temp",
"0",
"tempInt[1] = Integer.parseInt(temp[1])",
"tempInt[1]",
"tempInt",
"1",
"Integer.parseInt(temp[1])",
"Integer.parseInt",
"Integer",
"temp[1]",
"temp",
"1",
"int maxYakusu = 1;",
"maxYakusu",
"1",
"for(int k = tempInt[1]-1 ; k > 1 ; k--){\n\n\t\t\t\t\tif((tempInt[0]%k == 0)&&(tempInt[1]%k == 0)){\n\t\t\t\t\t\ttempInt[0] = tempInt[0]/k;\n\t\t\t\t\t\ttempInt[1] = tempInt[1]/k;\n\t\t\t\t\t\tmaxYakusu = maxYakusu * k;\n\n\n\t\t\t\t\t}\n\n\t\t\t\t}",
"int k = tempInt[1]-1 ;",
"int k = tempInt[1]-1 ;",
"k",
"tempInt[1]-1",
"tempInt[1]",
"tempInt",
"1",
"1",
"k > 1",
"k",
"1",
"k--",
"k--",
"k",
"{\n\n\t\t\t\t\tif((tempInt[0]%k == 0)&&(tempInt[1]%k == 0)){\n\t\t\t\t\t\ttempInt[0] = tempInt[0]/k;\n\t\t\t\t\t\ttempInt[1] = tempInt[1]/k;\n\t\t\t\t\t\tmaxYakusu = maxYakusu * k;\n\n\n\t\t\t\t\t}\n\n\t\t\t\t}",
"{\n\n\t\t\t\t\tif((tempInt[0]%k == 0)&&(tempInt[1]%k == 0)){\n\t\t\t\t\t\ttempInt[0] = tempInt[0]/k;\n\t\t\t\t\t\ttempInt[1] = tempInt[1]/k;\n\t\t\t\t\t\tmaxYakusu = maxYakusu * k;\n\n\n\t\t\t\t\t}\n\n\t\t\t\t}",
"if((tempInt[0]%k == 0)&&(tempInt[1]%k == 0)){\n\t\t\t\t\t\ttempInt[0] = tempInt[0]/k;\n\t\t\t\t\t\ttempInt[1] = tempInt[1]/k;\n\t\t\t\t\t\tmaxYakusu = maxYakusu * k;\n\n\n\t\t\t\t\t}",
"(tempInt[0]%k == 0)&&(tempInt[1]%k == 0)",
"(tempInt[0]%k == 0)",
"tempInt[0]%k",
"tempInt[0]",
"tempInt",
"0",
"k",
"0",
"(tempInt[1]%k == 0)",
"tempInt[1]%k",
"tempInt[1]",
"tempInt",
"1",
"k",
"0",
"{\n\t\t\t\t\t\ttempInt[0] = tempInt[0]/k;\n\t\t\t\t\t\ttempInt[1] = tempInt[1]/k;\n\t\t\t\t\t\tmaxYakusu = maxYakusu * k;\n\n\n\t\t\t\t\t}",
"tempInt[0] = tempInt[0]/k",
"tempInt[0]",
"tempInt",
"0",
"tempInt[0]/k",
"tempInt[0]",
"tempInt",
"0",
"k",
"tempInt[1] = tempInt[1]/k",
"tempInt[1]",
"tempInt",
"1",
"tempInt[1]/k",
"tempInt[1]",
"tempInt",
"1",
"k",
"maxYakusu = maxYakusu * k",
"maxYakusu",
"maxYakusu * k",
"maxYakusu",
"k",
"int maxBaisu = maxYakusu * tempInt[0] * tempInt[1];",
"maxBaisu",
"maxYakusu * tempInt[0] * tempInt[1]",
"maxYakusu * tempInt[0] * tempInt[1]",
"maxYakusu",
"tempInt[0]",
"tempInt",
"0",
"tempInt[1]",
"tempInt",
"1",
"System.out.println(maxYakusu+\" \"+maxBaisu)",
"System.out.println",
"System.out",
"System",
"System.out",
"maxYakusu+\" \"+maxBaisu",
"maxYakusu+\" \"+maxBaisu",
"maxYakusu",
"\" \"",
"maxBaisu",
"i++",
"i",
"String[] a",
"a",
"public class Main {\n\n\tpublic static void main(String[] a) throws IOException{\n\n\t\tString strLine =\"\";\n\t\tBufferedReader stdReader =\n\t\t\t\tnew BufferedReader(new InputStreamReader(System.in));\n\n\t\tint i = 0;\n\t\tint max = 50;\n\t\tint[] tempInt = new int[2];\n\n\t\twhile ( i <= max && ((strLine = stdReader.readLine()) != null) ){\n\n\n\t\t\t\t//??????????????§?????????\n\t\t\t\tString[] temp = strLine.split(\" \",-10);\n\t\t\t\ttempInt[0] =Integer.parseInt(temp[0]);\n\t\t\t\ttempInt[1] = Integer.parseInt(temp[1]);\n\n\t\t\t\tint maxYakusu = 1;\n\n\t\t\t\tfor(int k = tempInt[1]-1 ; k > 1 ; k--){\n\n\t\t\t\t\tif((tempInt[0]%k == 0)&&(tempInt[1]%k == 0)){\n\t\t\t\t\t\ttempInt[0] = tempInt[0]/k;\n\t\t\t\t\t\ttempInt[1] = tempInt[1]/k;\n\t\t\t\t\t\tmaxYakusu = maxYakusu * k;\n\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\n\t\t\t\t//????°???¬?????°????±????????????????????´???????\n\t\t\t\tint maxBaisu = maxYakusu * tempInt[0] * tempInt[1];\n\n\t\t\t\tSystem.out.println(maxYakusu+\" \"+maxBaisu);\n\t\t\t\ti++;\n\t\t}\n\n\t}\n\n}",
"public class Main {\n\n\tpublic static void main(String[] a) throws IOException{\n\n\t\tString strLine =\"\";\n\t\tBufferedReader stdReader =\n\t\t\t\tnew BufferedReader(new InputStreamReader(System.in));\n\n\t\tint i = 0;\n\t\tint max = 50;\n\t\tint[] tempInt = new int[2];\n\n\t\twhile ( i <= max && ((strLine = stdReader.readLine()) != null) ){\n\n\n\t\t\t\t//??????????????§?????????\n\t\t\t\tString[] temp = strLine.split(\" \",-10);\n\t\t\t\ttempInt[0] =Integer.parseInt(temp[0]);\n\t\t\t\ttempInt[1] = Integer.parseInt(temp[1]);\n\n\t\t\t\tint maxYakusu = 1;\n\n\t\t\t\tfor(int k = tempInt[1]-1 ; k > 1 ; k--){\n\n\t\t\t\t\tif((tempInt[0]%k == 0)&&(tempInt[1]%k == 0)){\n\t\t\t\t\t\ttempInt[0] = tempInt[0]/k;\n\t\t\t\t\t\ttempInt[1] = tempInt[1]/k;\n\t\t\t\t\t\tmaxYakusu = maxYakusu * k;\n\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\n\t\t\t\t//????°???¬?????°????±????????????????????´???????\n\t\t\t\tint maxBaisu = maxYakusu * tempInt[0] * tempInt[1];\n\n\t\t\t\tSystem.out.println(maxYakusu+\" \"+maxBaisu);\n\t\t\t\ti++;\n\t\t}\n\n\t}\n\n}",
"Main"
] |
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class Main {
public static void main(String[] a) throws IOException{
String strLine ="";
BufferedReader stdReader =
new BufferedReader(new InputStreamReader(System.in));
int i = 0;
int max = 50;
int[] tempInt = new int[2];
while ( i <= max && ((strLine = stdReader.readLine()) != null) ){
//??????????????§?????????
String[] temp = strLine.split(" ",-10);
tempInt[0] =Integer.parseInt(temp[0]);
tempInt[1] = Integer.parseInt(temp[1]);
int maxYakusu = 1;
for(int k = tempInt[1]-1 ; k > 1 ; k--){
if((tempInt[0]%k == 0)&&(tempInt[1]%k == 0)){
tempInt[0] = tempInt[0]/k;
tempInt[1] = tempInt[1]/k;
maxYakusu = maxYakusu * k;
}
}
//????°???¬?????°????±????????????????????´???????
int maxBaisu = maxYakusu * tempInt[0] * tempInt[1];
System.out.println(maxYakusu+" "+maxBaisu);
i++;
}
}
} |
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
38,
30,
41,
13,
20,
42,
4,
18,
13,
30,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
41,
13,
4,
13,
13,
13,
41,
13,
2,
2,
13,
13,
13,
4,
18,
18,
13,
13,
17,
13,
13,
23,
13,
12,
13,
30,
42,
2,
13,
13,
30,
14,
2,
13,
13,
30,
0,
13,
2,
13,
13,
30,
0,
13,
2,
13,
13,
29,
13,
23,
13,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
83,
5
],
[
83,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
10,
11
],
[
11,
12
],
[
11,
13
],
[
10,
14
],
[
14,
15
],
[
15,
16
],
[
16,
17
],
[
14,
18
],
[
18,
19
],
[
19,
20
],
[
19,
21
],
[
21,
22
],
[
22,
23
],
[
18,
24
],
[
24,
25
],
[
24,
26
],
[
26,
27
],
[
27,
28
],
[
18,
29
],
[
29,
30
],
[
29,
31
],
[
31,
32
],
[
31,
33
],
[
31,
34
],
[
18,
35
],
[
35,
36
],
[
35,
37
],
[
37,
38
],
[
38,
39
],
[
38,
40
],
[
37,
41
],
[
18,
42
],
[
42,
43
],
[
43,
44
],
[
44,
45
],
[
44,
46
],
[
42,
47
],
[
42,
48
],
[
42,
49
],
[
6,
50
],
[
50,
51
],
[
83,
52
],
[
52,
53
],
[
52,
54
],
[
54,
55
],
[
55,
56
],
[
56,
57
],
[
56,
58
],
[
55,
59
],
[
59,
60
],
[
60,
61
],
[
61,
62
],
[
61,
63
],
[
60,
64
],
[
64,
65
],
[
65,
66
],
[
65,
67
],
[
67,
68
],
[
67,
69
],
[
60,
70
],
[
70,
71
],
[
71,
72
],
[
71,
73
],
[
73,
74
],
[
73,
75
],
[
54,
76
],
[
76,
77
],
[
52,
78
],
[
78,
79
],
[
52,
80
],
[
80,
81
],
[
0,
82
],
[
82,
83
],
[
82,
84
]
] | [
"import java.util.Scanner;\n\npublic class Main {\n\tpublic static void main(String[] args) {\n\t\ttry (Scanner sc = new Scanner(System.in)) {\n\t\t\twhile (sc.hasNext()) {\n\t\t\t\tlong x = sc.nextLong();\n\t\t\t\tlong y = sc.nextLong();\n\n\t\t\t\tlong gcd = gcd(x, y);\n\t\t\t\tlong lcm = (x / gcd) * y;\n\t\t\t\tSystem.out.printf(\"%s %s\\n\", gcd, lcm);\n\t\t\t}\n\t\t}\n\t}\n\tpublic static long gcd(long a, long b) {\n\t\twhile (a != b) {\n\t\t\tif (a > b) {\n\t\t\t\ta = a - b;\n\t\t\t} else {\n\t\t\t\tb = b - a;\n\t\t\t}\n\t\t}\n\t\treturn a;\n\t}\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n\tpublic static void main(String[] args) {\n\t\ttry (Scanner sc = new Scanner(System.in)) {\n\t\t\twhile (sc.hasNext()) {\n\t\t\t\tlong x = sc.nextLong();\n\t\t\t\tlong y = sc.nextLong();\n\n\t\t\t\tlong gcd = gcd(x, y);\n\t\t\t\tlong lcm = (x / gcd) * y;\n\t\t\t\tSystem.out.printf(\"%s %s\\n\", gcd, lcm);\n\t\t\t}\n\t\t}\n\t}\n\tpublic static long gcd(long a, long b) {\n\t\twhile (a != b) {\n\t\t\tif (a > b) {\n\t\t\t\ta = a - b;\n\t\t\t} else {\n\t\t\t\tb = b - a;\n\t\t\t}\n\t\t}\n\t\treturn a;\n\t}\n}",
"Main",
"public static void main(String[] args) {\n\t\ttry (Scanner sc = new Scanner(System.in)) {\n\t\t\twhile (sc.hasNext()) {\n\t\t\t\tlong x = sc.nextLong();\n\t\t\t\tlong y = sc.nextLong();\n\n\t\t\t\tlong gcd = gcd(x, y);\n\t\t\t\tlong lcm = (x / gcd) * y;\n\t\t\t\tSystem.out.printf(\"%s %s\\n\", gcd, lcm);\n\t\t\t}\n\t\t}\n\t}",
"main",
"{\n\t\ttry (Scanner sc = new Scanner(System.in)) {\n\t\t\twhile (sc.hasNext()) {\n\t\t\t\tlong x = sc.nextLong();\n\t\t\t\tlong y = sc.nextLong();\n\n\t\t\t\tlong gcd = gcd(x, y);\n\t\t\t\tlong lcm = (x / gcd) * y;\n\t\t\t\tSystem.out.printf(\"%s %s\\n\", gcd, lcm);\n\t\t\t}\n\t\t}\n\t}",
"try (Scanner sc = new Scanner(System.in)) {\n\t\t\twhile (sc.hasNext()) {\n\t\t\t\tlong x = sc.nextLong();\n\t\t\t\tlong y = sc.nextLong();\n\n\t\t\t\tlong gcd = gcd(x, y);\n\t\t\t\tlong lcm = (x / gcd) * y;\n\t\t\t\tSystem.out.printf(\"%s %s\\n\", gcd, lcm);\n\t\t\t}\n\t\t}",
"{\n\t\t\twhile (sc.hasNext()) {\n\t\t\t\tlong x = sc.nextLong();\n\t\t\t\tlong y = sc.nextLong();\n\n\t\t\t\tlong gcd = gcd(x, y);\n\t\t\t\tlong lcm = (x / gcd) * y;\n\t\t\t\tSystem.out.printf(\"%s %s\\n\", gcd, lcm);\n\t\t\t}\n\t\t}",
"Scanner sc = new Scanner(System.in)",
"Scanner sc = new Scanner(System.in)",
"new Scanner(System.in)",
"while (sc.hasNext()) {\n\t\t\t\tlong x = sc.nextLong();\n\t\t\t\tlong y = sc.nextLong();\n\n\t\t\t\tlong gcd = gcd(x, y);\n\t\t\t\tlong lcm = (x / gcd) * y;\n\t\t\t\tSystem.out.printf(\"%s %s\\n\", gcd, lcm);\n\t\t\t}",
"sc.hasNext()",
"sc.hasNext",
"sc",
"{\n\t\t\t\tlong x = sc.nextLong();\n\t\t\t\tlong y = sc.nextLong();\n\n\t\t\t\tlong gcd = gcd(x, y);\n\t\t\t\tlong lcm = (x / gcd) * y;\n\t\t\t\tSystem.out.printf(\"%s %s\\n\", gcd, lcm);\n\t\t\t}",
"long x = sc.nextLong();",
"x",
"sc.nextLong()",
"sc.nextLong",
"sc",
"long y = sc.nextLong();",
"y",
"sc.nextLong()",
"sc.nextLong",
"sc",
"long gcd = gcd(x, y);",
"gcd",
"gcd(x, y)",
"gcd",
"x",
"y",
"long lcm = (x / gcd) * y;",
"lcm",
"(x / gcd) * y",
"(x / gcd)",
"x",
"gcd",
"y",
"System.out.printf(\"%s %s\\n\", gcd, lcm)",
"System.out.printf",
"System.out",
"System",
"System.out",
"\"%s %s\\n\"",
"gcd",
"lcm",
"String[] args",
"args",
"public static long gcd(long a, long b) {\n\t\twhile (a != b) {\n\t\t\tif (a > b) {\n\t\t\t\ta = a - b;\n\t\t\t} else {\n\t\t\t\tb = b - a;\n\t\t\t}\n\t\t}\n\t\treturn a;\n\t}",
"gcd",
"{\n\t\twhile (a != b) {\n\t\t\tif (a > b) {\n\t\t\t\ta = a - b;\n\t\t\t} else {\n\t\t\t\tb = b - a;\n\t\t\t}\n\t\t}\n\t\treturn a;\n\t}",
"while (a != b) {\n\t\t\tif (a > b) {\n\t\t\t\ta = a - b;\n\t\t\t} else {\n\t\t\t\tb = b - a;\n\t\t\t}\n\t\t}",
"a != b",
"a",
"b",
"{\n\t\t\tif (a > b) {\n\t\t\t\ta = a - b;\n\t\t\t} else {\n\t\t\t\tb = b - a;\n\t\t\t}\n\t\t}",
"if (a > b) {\n\t\t\t\ta = a - b;\n\t\t\t} else {\n\t\t\t\tb = b - a;\n\t\t\t}",
"a > b",
"a",
"b",
"{\n\t\t\t\ta = a - b;\n\t\t\t}",
"a = a - b",
"a",
"a - b",
"a",
"b",
"{\n\t\t\t\tb = b - a;\n\t\t\t}",
"b = b - a",
"b",
"b - a",
"b",
"a",
"return a;",
"a",
"long a",
"a",
"long b",
"b",
"public class Main {\n\tpublic static void main(String[] args) {\n\t\ttry (Scanner sc = new Scanner(System.in)) {\n\t\t\twhile (sc.hasNext()) {\n\t\t\t\tlong x = sc.nextLong();\n\t\t\t\tlong y = sc.nextLong();\n\n\t\t\t\tlong gcd = gcd(x, y);\n\t\t\t\tlong lcm = (x / gcd) * y;\n\t\t\t\tSystem.out.printf(\"%s %s\\n\", gcd, lcm);\n\t\t\t}\n\t\t}\n\t}\n\tpublic static long gcd(long a, long b) {\n\t\twhile (a != b) {\n\t\t\tif (a > b) {\n\t\t\t\ta = a - b;\n\t\t\t} else {\n\t\t\t\tb = b - a;\n\t\t\t}\n\t\t}\n\t\treturn a;\n\t}\n}",
"public class Main {\n\tpublic static void main(String[] args) {\n\t\ttry (Scanner sc = new Scanner(System.in)) {\n\t\t\twhile (sc.hasNext()) {\n\t\t\t\tlong x = sc.nextLong();\n\t\t\t\tlong y = sc.nextLong();\n\n\t\t\t\tlong gcd = gcd(x, y);\n\t\t\t\tlong lcm = (x / gcd) * y;\n\t\t\t\tSystem.out.printf(\"%s %s\\n\", gcd, lcm);\n\t\t\t}\n\t\t}\n\t}\n\tpublic static long gcd(long a, long b) {\n\t\twhile (a != b) {\n\t\t\tif (a > b) {\n\t\t\t\ta = a - b;\n\t\t\t} else {\n\t\t\t\tb = b - a;\n\t\t\t}\n\t\t}\n\t\treturn a;\n\t}\n}",
"Main"
] | import java.util.Scanner;
public class Main {
public static void main(String[] args) {
try (Scanner sc = new Scanner(System.in)) {
while (sc.hasNext()) {
long x = sc.nextLong();
long y = sc.nextLong();
long gcd = gcd(x, y);
long lcm = (x / gcd) * y;
System.out.printf("%s %s\n", gcd, lcm);
}
}
}
public static long gcd(long a, long b) {
while (a != b) {
if (a > b) {
a = a - b;
} else {
b = b - a;
}
}
return a;
}
} |
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
17,
41,
13,
17,
42,
4,
18,
13,
30,
0,
13,
4,
18,
13,
0,
13,
4,
18,
13,
41,
13,
4,
13,
13,
13,
41,
13,
4,
13,
13,
13,
13,
4,
18,
18,
13,
13,
2,
2,
13,
17,
13,
23,
13,
12,
13,
30,
41,
13,
8,
2,
13,
13,
13,
13,
41,
13,
8,
2,
13,
13,
13,
13,
41,
13,
8,
2,
13,
13,
13,
13,
42,
17,
30,
41,
13,
4,
13,
13,
13,
13,
14,
2,
13,
13,
30,
29,
13,
14,
2,
13,
13,
30,
0,
13,
13,
0,
13,
13,
0,
13,
8,
2,
13,
13,
13,
13,
30,
0,
13,
13,
23,
13,
23,
13,
12,
13,
30,
41,
13,
17,
42,
17,
30,
14,
2,
13,
2,
2,
13,
13,
13,
30,
29,
2,
2,
13,
13,
13,
40,
13,
23,
13,
23,
13,
23,
13,
12,
13,
30,
29,
2,
2,
13,
13,
13,
23,
13,
23,
13,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
177,
5
],
[
177,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
8,
15
],
[
15,
16
],
[
15,
17
],
[
8,
18
],
[
18,
19
],
[
19,
20
],
[
20,
21
],
[
18,
22
],
[
22,
23
],
[
23,
24
],
[
23,
25
],
[
25,
26
],
[
26,
27
],
[
22,
28
],
[
28,
29
],
[
28,
30
],
[
30,
31
],
[
31,
32
],
[
22,
33
],
[
33,
34
],
[
33,
35
],
[
35,
36
],
[
35,
37
],
[
35,
38
],
[
22,
39
],
[
39,
40
],
[
39,
41
],
[
41,
42
],
[
41,
43
],
[
41,
44
],
[
41,
45
],
[
22,
46
],
[
46,
47
],
[
47,
48
],
[
48,
49
],
[
48,
50
],
[
46,
51
],
[
52,
52
],
[
52,
53
],
[
52,
54
],
[
52,
55
],
[
6,
56
],
[
56,
57
],
[
177,
58
],
[
58,
59
],
[
58,
60
],
[
60,
61
],
[
61,
62
],
[
61,
63
],
[
63,
64
],
[
64,
65
],
[
64,
66
],
[
63,
67
],
[
63,
68
],
[
60,
69
],
[
69,
70
],
[
69,
71
],
[
71,
72
],
[
72,
73
],
[
72,
74
],
[
71,
75
],
[
71,
76
],
[
60,
77
],
[
77,
78
],
[
77,
79
],
[
79,
80
],
[
80,
81
],
[
80,
82
],
[
79,
83
],
[
79,
84
],
[
60,
85
],
[
85,
86
],
[
85,
87
],
[
87,
88
],
[
88,
89
],
[
88,
90
],
[
90,
91
],
[
90,
92
],
[
90,
93
],
[
90,
94
],
[
87,
95
],
[
95,
96
],
[
96,
97
],
[
96,
98
],
[
95,
99
],
[
99,
100
],
[
100,
101
],
[
95,
102
],
[
102,
103
],
[
103,
104
],
[
103,
105
],
[
102,
106
],
[
106,
107
],
[
107,
108
],
[
107,
109
],
[
106,
110
],
[
110,
111
],
[
110,
112
],
[
106,
113
],
[
113,
114
],
[
113,
115
],
[
115,
116
],
[
116,
117
],
[
116,
118
],
[
115,
119
],
[
115,
120
],
[
102,
121
],
[
121,
122
],
[
122,
123
],
[
122,
124
],
[
58,
125
],
[
125,
126
],
[
58,
127
],
[
127,
128
],
[
177,
129
],
[
129,
130
],
[
129,
131
],
[
131,
132
],
[
132,
133
],
[
132,
134
],
[
131,
135
],
[
135,
136
],
[
135,
137
],
[
137,
138
],
[
138,
139
],
[
139,
140
],
[
139,
141
],
[
141,
142
],
[
142,
143
],
[
142,
144
],
[
141,
145
],
[
138,
146
],
[
146,
147
],
[
147,
148
],
[
148,
149
],
[
149,
150
],
[
149,
151
],
[
148,
152
],
[
137,
153
],
[
153,
154
],
[
129,
155
],
[
155,
156
],
[
129,
157
],
[
157,
158
],
[
129,
159
],
[
159,
160
],
[
177,
161
],
[
161,
162
],
[
161,
163
],
[
163,
164
],
[
164,
165
],
[
165,
166
],
[
166,
167
],
[
166,
168
],
[
165,
169
],
[
161,
170
],
[
170,
171
],
[
161,
172
],
[
172,
173
],
[
161,
174
],
[
174,
175
],
[
0,
176
],
[
176,
177
],
[
176,
178
]
] | [
"import java.util.Scanner;\n\npublic class Main {\n\n\t/**\n\t * @param args\n\t */\n\tpublic static void main(String[] args) {\n\t\tScanner scanner = new Scanner(System.in);\n\n\t\tlong a = 0;\n\t\tlong b = 0;\n\t\twhile (scanner.hasNext()) {\n\t\t\ta = scanner.nextLong();\n\t\t\tb = scanner.nextLong();\n\n\t\t\tlong lcm = calcLCM(a, b);\n\t\t\tlong gcd = calcGCD(a, b, lcm);\n\t\t\tSystem.out.println(gcd + \" \" + lcm);\n\t\t}\n\n\t}\n\n\t/**\n\t * ?????§??¬?´???°????±???????\n\t * @param a ?¬¬????????°\n\t * @param b ?¬¬????????°\n\t * @return ?????§??¬?´???°\n\t */\n\tprivate static long calcLCM(long a, long b) {\n\t\tlong large = a >= b ? a : b;\n\t\tlong small = a >= b ? b : a;\n\t\tlong base = a >= b ? b : a;\n\t\twhile (true) {\n\t\t\tlong result = calc(large, small, base);\n\t\t\tif (large == result) {\n\t\t\t\treturn result;\n\t\t\t} else if (large < result) {\n\t\t\t\tsmall = large;\n\t\t\t\tlarge = result;\n\t\t\t\tbase = base == a ? b : a;\n\t\t\t} else {\n\t\t\t\tsmall = result;\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate static long calc(long large, long small, long base) {\n\t\tint count = 0;\n\t\twhile (true) {\n\t\t\tif (large <= base * count + small) {\n\t\t\t\treturn base * count + small;\n\t\t\t}\n\t\t\tcount++;\n\t\t}\n\t}\n\n\t/**\n\t * ????°???¬?????°????±???????\n\t * @param a ?¬¬????????°\n\t * @param b ?¬¬????????°\n\t * @param gcd ?????§??¬?´???°\n\t * @return ????°???¬?????°\n\t */\n\tprivate static long calcGCD(long a, long b, long gcd) {\n\t\treturn (a * b) / gcd;\n\t}\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n\n\t/**\n\t * @param args\n\t */\n\tpublic static void main(String[] args) {\n\t\tScanner scanner = new Scanner(System.in);\n\n\t\tlong a = 0;\n\t\tlong b = 0;\n\t\twhile (scanner.hasNext()) {\n\t\t\ta = scanner.nextLong();\n\t\t\tb = scanner.nextLong();\n\n\t\t\tlong lcm = calcLCM(a, b);\n\t\t\tlong gcd = calcGCD(a, b, lcm);\n\t\t\tSystem.out.println(gcd + \" \" + lcm);\n\t\t}\n\n\t}\n\n\t/**\n\t * ?????§??¬?´???°????±???????\n\t * @param a ?¬¬????????°\n\t * @param b ?¬¬????????°\n\t * @return ?????§??¬?´???°\n\t */\n\tprivate static long calcLCM(long a, long b) {\n\t\tlong large = a >= b ? a : b;\n\t\tlong small = a >= b ? b : a;\n\t\tlong base = a >= b ? b : a;\n\t\twhile (true) {\n\t\t\tlong result = calc(large, small, base);\n\t\t\tif (large == result) {\n\t\t\t\treturn result;\n\t\t\t} else if (large < result) {\n\t\t\t\tsmall = large;\n\t\t\t\tlarge = result;\n\t\t\t\tbase = base == a ? b : a;\n\t\t\t} else {\n\t\t\t\tsmall = result;\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate static long calc(long large, long small, long base) {\n\t\tint count = 0;\n\t\twhile (true) {\n\t\t\tif (large <= base * count + small) {\n\t\t\t\treturn base * count + small;\n\t\t\t}\n\t\t\tcount++;\n\t\t}\n\t}\n\n\t/**\n\t * ????°???¬?????°????±???????\n\t * @param a ?¬¬????????°\n\t * @param b ?¬¬????????°\n\t * @param gcd ?????§??¬?´???°\n\t * @return ????°???¬?????°\n\t */\n\tprivate static long calcGCD(long a, long b, long gcd) {\n\t\treturn (a * b) / gcd;\n\t}\n}",
"Main",
"/**\n\t * @param args\n\t */\n\tpublic static void main(String[] args) {\n\t\tScanner scanner = new Scanner(System.in);\n\n\t\tlong a = 0;\n\t\tlong b = 0;\n\t\twhile (scanner.hasNext()) {\n\t\t\ta = scanner.nextLong();\n\t\t\tb = scanner.nextLong();\n\n\t\t\tlong lcm = calcLCM(a, b);\n\t\t\tlong gcd = calcGCD(a, b, lcm);\n\t\t\tSystem.out.println(gcd + \" \" + lcm);\n\t\t}\n\n\t}",
"main",
"{\n\t\tScanner scanner = new Scanner(System.in);\n\n\t\tlong a = 0;\n\t\tlong b = 0;\n\t\twhile (scanner.hasNext()) {\n\t\t\ta = scanner.nextLong();\n\t\t\tb = scanner.nextLong();\n\n\t\t\tlong lcm = calcLCM(a, b);\n\t\t\tlong gcd = calcGCD(a, b, lcm);\n\t\t\tSystem.out.println(gcd + \" \" + lcm);\n\t\t}\n\n\t}",
"Scanner scanner = new Scanner(System.in);",
"scanner",
"new Scanner(System.in)",
"long a = 0;",
"a",
"0",
"long b = 0;",
"b",
"0",
"while (scanner.hasNext()) {\n\t\t\ta = scanner.nextLong();\n\t\t\tb = scanner.nextLong();\n\n\t\t\tlong lcm = calcLCM(a, b);\n\t\t\tlong gcd = calcGCD(a, b, lcm);\n\t\t\tSystem.out.println(gcd + \" \" + lcm);\n\t\t}",
"scanner.hasNext()",
"scanner.hasNext",
"scanner",
"{\n\t\t\ta = scanner.nextLong();\n\t\t\tb = scanner.nextLong();\n\n\t\t\tlong lcm = calcLCM(a, b);\n\t\t\tlong gcd = calcGCD(a, b, lcm);\n\t\t\tSystem.out.println(gcd + \" \" + lcm);\n\t\t}",
"a = scanner.nextLong()",
"a",
"scanner.nextLong()",
"scanner.nextLong",
"scanner",
"b = scanner.nextLong()",
"b",
"scanner.nextLong()",
"scanner.nextLong",
"scanner",
"long lcm = calcLCM(a, b);",
"lcm",
"calcLCM(a, b)",
"calcLCM",
"a",
"b",
"long gcd = calcGCD(a, b, lcm);",
"gcd",
"calcGCD(a, b, lcm)",
"calcGCD",
"a",
"b",
"lcm",
"System.out.println(gcd + \" \" + lcm)",
"System.out.println",
"System.out",
"System",
"System.out",
"gcd + \" \" + lcm",
"gcd + \" \" + lcm",
"gcd",
"\" \"",
"lcm",
"String[] args",
"args",
"/**\n\t * ?????§??¬?´???°????±???????\n\t * @param a ?¬¬????????°\n\t * @param b ?¬¬????????°\n\t * @return ?????§??¬?´???°\n\t */\n\tprivate static long calcLCM(long a, long b) {\n\t\tlong large = a >= b ? a : b;\n\t\tlong small = a >= b ? b : a;\n\t\tlong base = a >= b ? b : a;\n\t\twhile (true) {\n\t\t\tlong result = calc(large, small, base);\n\t\t\tif (large == result) {\n\t\t\t\treturn result;\n\t\t\t} else if (large < result) {\n\t\t\t\tsmall = large;\n\t\t\t\tlarge = result;\n\t\t\t\tbase = base == a ? b : a;\n\t\t\t} else {\n\t\t\t\tsmall = result;\n\t\t\t}\n\t\t}\n\t}",
"calcLCM",
"{\n\t\tlong large = a >= b ? a : b;\n\t\tlong small = a >= b ? b : a;\n\t\tlong base = a >= b ? b : a;\n\t\twhile (true) {\n\t\t\tlong result = calc(large, small, base);\n\t\t\tif (large == result) {\n\t\t\t\treturn result;\n\t\t\t} else if (large < result) {\n\t\t\t\tsmall = large;\n\t\t\t\tlarge = result;\n\t\t\t\tbase = base == a ? b : a;\n\t\t\t} else {\n\t\t\t\tsmall = result;\n\t\t\t}\n\t\t}\n\t}",
"long large = a >= b ? a : b;",
"large",
"a >= b ? a : b",
"a >= b",
"a",
"b",
"a",
"b",
"long small = a >= b ? b : a;",
"small",
"a >= b ? b : a",
"a >= b",
"a",
"b",
"b",
"a",
"long base = a >= b ? b : a;",
"base",
"a >= b ? b : a",
"a >= b",
"a",
"b",
"b",
"a",
"while (true) {\n\t\t\tlong result = calc(large, small, base);\n\t\t\tif (large == result) {\n\t\t\t\treturn result;\n\t\t\t} else if (large < result) {\n\t\t\t\tsmall = large;\n\t\t\t\tlarge = result;\n\t\t\t\tbase = base == a ? b : a;\n\t\t\t} else {\n\t\t\t\tsmall = result;\n\t\t\t}\n\t\t}",
"true",
"{\n\t\t\tlong result = calc(large, small, base);\n\t\t\tif (large == result) {\n\t\t\t\treturn result;\n\t\t\t} else if (large < result) {\n\t\t\t\tsmall = large;\n\t\t\t\tlarge = result;\n\t\t\t\tbase = base == a ? b : a;\n\t\t\t} else {\n\t\t\t\tsmall = result;\n\t\t\t}\n\t\t}",
"long result = calc(large, small, base);",
"result",
"calc(large, small, base)",
"calc",
"large",
"small",
"base",
"if (large == result) {\n\t\t\t\treturn result;\n\t\t\t} else if (large < result) {\n\t\t\t\tsmall = large;\n\t\t\t\tlarge = result;\n\t\t\t\tbase = base == a ? b : a;\n\t\t\t} else {\n\t\t\t\tsmall = result;\n\t\t\t}",
"large == result",
"large",
"result",
"{\n\t\t\t\treturn result;\n\t\t\t}",
"return result;",
"result",
"if (large < result) {\n\t\t\t\tsmall = large;\n\t\t\t\tlarge = result;\n\t\t\t\tbase = base == a ? b : a;\n\t\t\t} else {\n\t\t\t\tsmall = result;\n\t\t\t}",
"large < result",
"large",
"result",
"{\n\t\t\t\tsmall = large;\n\t\t\t\tlarge = result;\n\t\t\t\tbase = base == a ? b : a;\n\t\t\t}",
"small = large",
"small",
"large",
"large = result",
"large",
"result",
"base = base == a ? b : a",
"base",
"base == a ? b : a",
"base == a",
"base",
"a",
"b",
"a",
"{\n\t\t\t\tsmall = result;\n\t\t\t}",
"small = result",
"small",
"result",
"long a",
"a",
"long b",
"b",
"private static long calc(long large, long small, long base) {\n\t\tint count = 0;\n\t\twhile (true) {\n\t\t\tif (large <= base * count + small) {\n\t\t\t\treturn base * count + small;\n\t\t\t}\n\t\t\tcount++;\n\t\t}\n\t}",
"calc",
"{\n\t\tint count = 0;\n\t\twhile (true) {\n\t\t\tif (large <= base * count + small) {\n\t\t\t\treturn base * count + small;\n\t\t\t}\n\t\t\tcount++;\n\t\t}\n\t}",
"int count = 0;",
"count",
"0",
"while (true) {\n\t\t\tif (large <= base * count + small) {\n\t\t\t\treturn base * count + small;\n\t\t\t}\n\t\t\tcount++;\n\t\t}",
"true",
"{\n\t\t\tif (large <= base * count + small) {\n\t\t\t\treturn base * count + small;\n\t\t\t}\n\t\t\tcount++;\n\t\t}",
"if (large <= base * count + small) {\n\t\t\t\treturn base * count + small;\n\t\t\t}",
"large <= base * count + small",
"large",
"base * count + small",
"base * count",
"base",
"count",
"small",
"{\n\t\t\t\treturn base * count + small;\n\t\t\t}",
"return base * count + small;",
"base * count + small",
"base * count",
"base",
"count",
"small",
"count++",
"count",
"long large",
"large",
"long small",
"small",
"long base",
"base",
"/**\n\t * ????°???¬?????°????±???????\n\t * @param a ?¬¬????????°\n\t * @param b ?¬¬????????°\n\t * @param gcd ?????§??¬?´???°\n\t * @return ????°???¬?????°\n\t */\n\tprivate static long calcGCD(long a, long b, long gcd) {\n\t\treturn (a * b) / gcd;\n\t}",
"calcGCD",
"{\n\t\treturn (a * b) / gcd;\n\t}",
"return (a * b) / gcd;",
"(a * b) / gcd",
"(a * b)",
"a",
"b",
"gcd",
"long a",
"a",
"long b",
"b",
"long gcd",
"gcd",
"public class Main {\n\n\t/**\n\t * @param args\n\t */\n\tpublic static void main(String[] args) {\n\t\tScanner scanner = new Scanner(System.in);\n\n\t\tlong a = 0;\n\t\tlong b = 0;\n\t\twhile (scanner.hasNext()) {\n\t\t\ta = scanner.nextLong();\n\t\t\tb = scanner.nextLong();\n\n\t\t\tlong lcm = calcLCM(a, b);\n\t\t\tlong gcd = calcGCD(a, b, lcm);\n\t\t\tSystem.out.println(gcd + \" \" + lcm);\n\t\t}\n\n\t}\n\n\t/**\n\t * ?????§??¬?´???°????±???????\n\t * @param a ?¬¬????????°\n\t * @param b ?¬¬????????°\n\t * @return ?????§??¬?´???°\n\t */\n\tprivate static long calcLCM(long a, long b) {\n\t\tlong large = a >= b ? a : b;\n\t\tlong small = a >= b ? b : a;\n\t\tlong base = a >= b ? b : a;\n\t\twhile (true) {\n\t\t\tlong result = calc(large, small, base);\n\t\t\tif (large == result) {\n\t\t\t\treturn result;\n\t\t\t} else if (large < result) {\n\t\t\t\tsmall = large;\n\t\t\t\tlarge = result;\n\t\t\t\tbase = base == a ? b : a;\n\t\t\t} else {\n\t\t\t\tsmall = result;\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate static long calc(long large, long small, long base) {\n\t\tint count = 0;\n\t\twhile (true) {\n\t\t\tif (large <= base * count + small) {\n\t\t\t\treturn base * count + small;\n\t\t\t}\n\t\t\tcount++;\n\t\t}\n\t}\n\n\t/**\n\t * ????°???¬?????°????±???????\n\t * @param a ?¬¬????????°\n\t * @param b ?¬¬????????°\n\t * @param gcd ?????§??¬?´???°\n\t * @return ????°???¬?????°\n\t */\n\tprivate static long calcGCD(long a, long b, long gcd) {\n\t\treturn (a * b) / gcd;\n\t}\n}",
"public class Main {\n\n\t/**\n\t * @param args\n\t */\n\tpublic static void main(String[] args) {\n\t\tScanner scanner = new Scanner(System.in);\n\n\t\tlong a = 0;\n\t\tlong b = 0;\n\t\twhile (scanner.hasNext()) {\n\t\t\ta = scanner.nextLong();\n\t\t\tb = scanner.nextLong();\n\n\t\t\tlong lcm = calcLCM(a, b);\n\t\t\tlong gcd = calcGCD(a, b, lcm);\n\t\t\tSystem.out.println(gcd + \" \" + lcm);\n\t\t}\n\n\t}\n\n\t/**\n\t * ?????§??¬?´???°????±???????\n\t * @param a ?¬¬????????°\n\t * @param b ?¬¬????????°\n\t * @return ?????§??¬?´???°\n\t */\n\tprivate static long calcLCM(long a, long b) {\n\t\tlong large = a >= b ? a : b;\n\t\tlong small = a >= b ? b : a;\n\t\tlong base = a >= b ? b : a;\n\t\twhile (true) {\n\t\t\tlong result = calc(large, small, base);\n\t\t\tif (large == result) {\n\t\t\t\treturn result;\n\t\t\t} else if (large < result) {\n\t\t\t\tsmall = large;\n\t\t\t\tlarge = result;\n\t\t\t\tbase = base == a ? b : a;\n\t\t\t} else {\n\t\t\t\tsmall = result;\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate static long calc(long large, long small, long base) {\n\t\tint count = 0;\n\t\twhile (true) {\n\t\t\tif (large <= base * count + small) {\n\t\t\t\treturn base * count + small;\n\t\t\t}\n\t\t\tcount++;\n\t\t}\n\t}\n\n\t/**\n\t * ????°???¬?????°????±???????\n\t * @param a ?¬¬????????°\n\t * @param b ?¬¬????????°\n\t * @param gcd ?????§??¬?´???°\n\t * @return ????°???¬?????°\n\t */\n\tprivate static long calcGCD(long a, long b, long gcd) {\n\t\treturn (a * b) / gcd;\n\t}\n}",
"Main"
] | import java.util.Scanner;
public class Main {
/**
* @param args
*/
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
long a = 0;
long b = 0;
while (scanner.hasNext()) {
a = scanner.nextLong();
b = scanner.nextLong();
long lcm = calcLCM(a, b);
long gcd = calcGCD(a, b, lcm);
System.out.println(gcd + " " + lcm);
}
}
/**
* ?????§??¬?´???°????±???????
* @param a ?¬¬????????°
* @param b ?¬¬????????°
* @return ?????§??¬?´???°
*/
private static long calcLCM(long a, long b) {
long large = a >= b ? a : b;
long small = a >= b ? b : a;
long base = a >= b ? b : a;
while (true) {
long result = calc(large, small, base);
if (large == result) {
return result;
} else if (large < result) {
small = large;
large = result;
base = base == a ? b : a;
} else {
small = result;
}
}
}
private static long calc(long large, long small, long base) {
int count = 0;
while (true) {
if (large <= base * count + small) {
return base * count + small;
}
count++;
}
}
/**
* ????°???¬?????°????±???????
* @param a ?¬¬????????°
* @param b ?¬¬????????°
* @param gcd ?????§??¬?´???°
* @return ????°???¬?????°
*/
private static long calcGCD(long a, long b, long gcd) {
return (a * b) / gcd;
}
} |
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
20,
17,
41,
13,
41,
13,
41,
13,
17,
41,
13,
17,
42,
4,
18,
13,
30,
0,
13,
4,
18,
13,
4,
18,
13,
0,
13,
4,
18,
13,
4,
18,
13,
0,
18,
13,
17,
13,
0,
18,
13,
17,
13,
4,
18,
18,
18,
13,
13,
13,
13,
42,
2,
18,
13,
17,
17,
30,
41,
13,
18,
13,
17,
0,
18,
13,
17,
2,
18,
13,
17,
18,
13,
17,
0,
18,
13,
17,
13,
0,
13,
18,
13,
17,
0,
13,
2,
2,
13,
13,
13,
4,
18,
18,
13,
13,
2,
2,
13,
17,
13,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
118,
5
],
[
118,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
8,
16
],
[
16,
17
],
[
8,
18
],
[
18,
19
],
[
8,
20
],
[
20,
21
],
[
20,
22
],
[
8,
23
],
[
23,
24
],
[
23,
25
],
[
8,
26
],
[
26,
27
],
[
27,
28
],
[
28,
29
],
[
26,
30
],
[
30,
31
],
[
31,
32
],
[
31,
33
],
[
33,
34
],
[
34,
35
],
[
33,
36
],
[
36,
37
],
[
37,
38
],
[
30,
39
],
[
39,
40
],
[
39,
41
],
[
41,
42
],
[
42,
43
],
[
41,
44
],
[
44,
45
],
[
45,
46
],
[
30,
47
],
[
47,
48
],
[
48,
49
],
[
48,
50
],
[
47,
51
],
[
30,
52
],
[
52,
53
],
[
53,
54
],
[
53,
55
],
[
52,
56
],
[
30,
57
],
[
57,
58
],
[
58,
59
],
[
59,
60
],
[
60,
61
],
[
60,
62
],
[
59,
63
],
[
57,
64
],
[
30,
65
],
[
65,
66
],
[
66,
67
],
[
67,
68
],
[
67,
69
],
[
66,
70
],
[
65,
71
],
[
71,
72
],
[
72,
73
],
[
72,
74
],
[
74,
75
],
[
74,
76
],
[
71,
77
],
[
77,
78
],
[
78,
79
],
[
78,
80
],
[
77,
81
],
[
81,
82
],
[
82,
83
],
[
82,
84
],
[
81,
85
],
[
85,
86
],
[
85,
87
],
[
71,
88
],
[
88,
89
],
[
89,
90
],
[
89,
91
],
[
88,
92
],
[
30,
93
],
[
93,
94
],
[
93,
95
],
[
95,
96
],
[
95,
97
],
[
30,
98
],
[
98,
99
],
[
98,
100
],
[
100,
101
],
[
101,
102
],
[
101,
103
],
[
100,
104
],
[
30,
105
],
[
105,
106
],
[
106,
107
],
[
107,
108
],
[
107,
109
],
[
105,
110
],
[
111,
111
],
[
111,
112
],
[
111,
113
],
[
111,
114
],
[
6,
115
],
[
115,
116
],
[
0,
117
],
[
117,
118
],
[
117,
119
]
] | [
"import java.util.Scanner;\n\npublic class Main {\n\tpublic static void main(String[] args) {\n\t\tScanner scan = new Scanner(System.in);\n\t\tlong[] ab = new long[2];\n\t\tlong a,b;\n\t\tlong gcd = 0;\n\t\tlong lcm = 0;\n\n\t\twhile ((scan.hasNext())) {\n\t\t\ta = Integer.parseInt(scan.next());\n\t\t\tb = Integer.parseInt(scan.next());\n\n\t\t\tab[0] = a;\n\t\t\tab[1] = b;\n\n\t\t\tjava.util.Arrays.sort(ab);\n\n\t\t\twhile(ab[0] != 0){\n\t\t\t\tlong pool = ab[0];\n\t\t\t\tab[0] = ab[1] % ab[0];\n\t\t\t\tab[1] = pool;\n\t\t\t}\n\t\t\tgcd = ab[1];\n\n\n\t\t\t// Ŭö{\n\t\t\tlcm = a * b / gcd;\n\t\t\tSystem.out.println(gcd+\" \"+lcm);\n\t\t}\n\t}\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n\tpublic static void main(String[] args) {\n\t\tScanner scan = new Scanner(System.in);\n\t\tlong[] ab = new long[2];\n\t\tlong a,b;\n\t\tlong gcd = 0;\n\t\tlong lcm = 0;\n\n\t\twhile ((scan.hasNext())) {\n\t\t\ta = Integer.parseInt(scan.next());\n\t\t\tb = Integer.parseInt(scan.next());\n\n\t\t\tab[0] = a;\n\t\t\tab[1] = b;\n\n\t\t\tjava.util.Arrays.sort(ab);\n\n\t\t\twhile(ab[0] != 0){\n\t\t\t\tlong pool = ab[0];\n\t\t\t\tab[0] = ab[1] % ab[0];\n\t\t\t\tab[1] = pool;\n\t\t\t}\n\t\t\tgcd = ab[1];\n\n\n\t\t\t// Ŭö{\n\t\t\tlcm = a * b / gcd;\n\t\t\tSystem.out.println(gcd+\" \"+lcm);\n\t\t}\n\t}\n}",
"Main",
"public static void main(String[] args) {\n\t\tScanner scan = new Scanner(System.in);\n\t\tlong[] ab = new long[2];\n\t\tlong a,b;\n\t\tlong gcd = 0;\n\t\tlong lcm = 0;\n\n\t\twhile ((scan.hasNext())) {\n\t\t\ta = Integer.parseInt(scan.next());\n\t\t\tb = Integer.parseInt(scan.next());\n\n\t\t\tab[0] = a;\n\t\t\tab[1] = b;\n\n\t\t\tjava.util.Arrays.sort(ab);\n\n\t\t\twhile(ab[0] != 0){\n\t\t\t\tlong pool = ab[0];\n\t\t\t\tab[0] = ab[1] % ab[0];\n\t\t\t\tab[1] = pool;\n\t\t\t}\n\t\t\tgcd = ab[1];\n\n\n\t\t\t// Ŭö{\n\t\t\tlcm = a * b / gcd;\n\t\t\tSystem.out.println(gcd+\" \"+lcm);\n\t\t}\n\t}",
"main",
"{\n\t\tScanner scan = new Scanner(System.in);\n\t\tlong[] ab = new long[2];\n\t\tlong a,b;\n\t\tlong gcd = 0;\n\t\tlong lcm = 0;\n\n\t\twhile ((scan.hasNext())) {\n\t\t\ta = Integer.parseInt(scan.next());\n\t\t\tb = Integer.parseInt(scan.next());\n\n\t\t\tab[0] = a;\n\t\t\tab[1] = b;\n\n\t\t\tjava.util.Arrays.sort(ab);\n\n\t\t\twhile(ab[0] != 0){\n\t\t\t\tlong pool = ab[0];\n\t\t\t\tab[0] = ab[1] % ab[0];\n\t\t\t\tab[1] = pool;\n\t\t\t}\n\t\t\tgcd = ab[1];\n\n\n\t\t\t// Ŭö{\n\t\t\tlcm = a * b / gcd;\n\t\t\tSystem.out.println(gcd+\" \"+lcm);\n\t\t}\n\t}",
"Scanner scan = new Scanner(System.in);",
"scan",
"new Scanner(System.in)",
"long[] ab = new long[2];",
"ab",
"new long[2]",
"2",
"long a",
"a",
"b;",
"b",
"long gcd = 0;",
"gcd",
"0",
"long lcm = 0;",
"lcm",
"0",
"while ((scan.hasNext())) {\n\t\t\ta = Integer.parseInt(scan.next());\n\t\t\tb = Integer.parseInt(scan.next());\n\n\t\t\tab[0] = a;\n\t\t\tab[1] = b;\n\n\t\t\tjava.util.Arrays.sort(ab);\n\n\t\t\twhile(ab[0] != 0){\n\t\t\t\tlong pool = ab[0];\n\t\t\t\tab[0] = ab[1] % ab[0];\n\t\t\t\tab[1] = pool;\n\t\t\t}\n\t\t\tgcd = ab[1];\n\n\n\t\t\t// Ŭö{\n\t\t\tlcm = a * b / gcd;\n\t\t\tSystem.out.println(gcd+\" \"+lcm);\n\t\t}",
"(scan.hasNext())",
"scan.hasNext",
"scan",
"{\n\t\t\ta = Integer.parseInt(scan.next());\n\t\t\tb = Integer.parseInt(scan.next());\n\n\t\t\tab[0] = a;\n\t\t\tab[1] = b;\n\n\t\t\tjava.util.Arrays.sort(ab);\n\n\t\t\twhile(ab[0] != 0){\n\t\t\t\tlong pool = ab[0];\n\t\t\t\tab[0] = ab[1] % ab[0];\n\t\t\t\tab[1] = pool;\n\t\t\t}\n\t\t\tgcd = ab[1];\n\n\n\t\t\t// Ŭö{\n\t\t\tlcm = a * b / gcd;\n\t\t\tSystem.out.println(gcd+\" \"+lcm);\n\t\t}",
"a = Integer.parseInt(scan.next())",
"a",
"Integer.parseInt(scan.next())",
"Integer.parseInt",
"Integer",
"scan.next()",
"scan.next",
"scan",
"b = Integer.parseInt(scan.next())",
"b",
"Integer.parseInt(scan.next())",
"Integer.parseInt",
"Integer",
"scan.next()",
"scan.next",
"scan",
"ab[0] = a",
"ab[0]",
"ab",
"0",
"a",
"ab[1] = b",
"ab[1]",
"ab",
"1",
"b",
"java.util.Arrays.sort(ab)",
"java.util.Arrays.sort",
"java.util.Arrays",
"java.util",
"java",
"java.util",
"java.util.Arrays",
"ab",
"while(ab[0] != 0){\n\t\t\t\tlong pool = ab[0];\n\t\t\t\tab[0] = ab[1] % ab[0];\n\t\t\t\tab[1] = pool;\n\t\t\t}",
"ab[0] != 0",
"ab[0]",
"ab",
"0",
"0",
"{\n\t\t\t\tlong pool = ab[0];\n\t\t\t\tab[0] = ab[1] % ab[0];\n\t\t\t\tab[1] = pool;\n\t\t\t}",
"long pool = ab[0];",
"pool",
"ab[0]",
"ab",
"0",
"ab[0] = ab[1] % ab[0]",
"ab[0]",
"ab",
"0",
"ab[1] % ab[0]",
"ab[1]",
"ab",
"1",
"ab[0]",
"ab",
"0",
"ab[1] = pool",
"ab[1]",
"ab",
"1",
"pool",
"gcd = ab[1]",
"gcd",
"ab[1]",
"ab",
"1",
"lcm = a * b / gcd",
"lcm",
"a * b / gcd",
"a * b",
"a",
"b",
"gcd",
"System.out.println(gcd+\" \"+lcm)",
"System.out.println",
"System.out",
"System",
"System.out",
"gcd+\" \"+lcm",
"gcd+\" \"+lcm",
"gcd",
"\" \"",
"lcm",
"String[] args",
"args",
"public class Main {\n\tpublic static void main(String[] args) {\n\t\tScanner scan = new Scanner(System.in);\n\t\tlong[] ab = new long[2];\n\t\tlong a,b;\n\t\tlong gcd = 0;\n\t\tlong lcm = 0;\n\n\t\twhile ((scan.hasNext())) {\n\t\t\ta = Integer.parseInt(scan.next());\n\t\t\tb = Integer.parseInt(scan.next());\n\n\t\t\tab[0] = a;\n\t\t\tab[1] = b;\n\n\t\t\tjava.util.Arrays.sort(ab);\n\n\t\t\twhile(ab[0] != 0){\n\t\t\t\tlong pool = ab[0];\n\t\t\t\tab[0] = ab[1] % ab[0];\n\t\t\t\tab[1] = pool;\n\t\t\t}\n\t\t\tgcd = ab[1];\n\n\n\t\t\t// Ŭö{\n\t\t\tlcm = a * b / gcd;\n\t\t\tSystem.out.println(gcd+\" \"+lcm);\n\t\t}\n\t}\n}",
"public class Main {\n\tpublic static void main(String[] args) {\n\t\tScanner scan = new Scanner(System.in);\n\t\tlong[] ab = new long[2];\n\t\tlong a,b;\n\t\tlong gcd = 0;\n\t\tlong lcm = 0;\n\n\t\twhile ((scan.hasNext())) {\n\t\t\ta = Integer.parseInt(scan.next());\n\t\t\tb = Integer.parseInt(scan.next());\n\n\t\t\tab[0] = a;\n\t\t\tab[1] = b;\n\n\t\t\tjava.util.Arrays.sort(ab);\n\n\t\t\twhile(ab[0] != 0){\n\t\t\t\tlong pool = ab[0];\n\t\t\t\tab[0] = ab[1] % ab[0];\n\t\t\t\tab[1] = pool;\n\t\t\t}\n\t\t\tgcd = ab[1];\n\n\n\t\t\t// Ŭö{\n\t\t\tlcm = a * b / gcd;\n\t\t\tSystem.out.println(gcd+\" \"+lcm);\n\t\t}\n\t}\n}",
"Main"
] | import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
long[] ab = new long[2];
long a,b;
long gcd = 0;
long lcm = 0;
while ((scan.hasNext())) {
a = Integer.parseInt(scan.next());
b = Integer.parseInt(scan.next());
ab[0] = a;
ab[1] = b;
java.util.Arrays.sort(ab);
while(ab[0] != 0){
long pool = ab[0];
ab[0] = ab[1] % ab[0];
ab[1] = pool;
}
gcd = ab[1];
// Ŭö{
lcm = a * b / gcd;
System.out.println(gcd+" "+lcm);
}
}
} |
[
7,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
42,
4,
18,
13,
30,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
13,
41,
13,
4,
18,
4,
18,
13,
13,
13,
4,
18,
18,
13,
13,
2,
2,
13,
17,
13,
23,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
9,
10
],
[
9,
11
],
[
11,
12
],
[
12,
13
],
[
12,
14
],
[
11,
15
],
[
15,
16
],
[
16,
17
],
[
17,
18
],
[
15,
19
],
[
19,
20
],
[
20,
21
],
[
20,
22
],
[
22,
23
],
[
23,
24
],
[
19,
25
],
[
25,
26
],
[
25,
27
],
[
27,
28
],
[
28,
29
],
[
19,
30
],
[
30,
31
],
[
30,
32
],
[
32,
33
],
[
33,
34
],
[
32,
35
],
[
19,
36
],
[
36,
37
],
[
36,
38
],
[
38,
39
],
[
39,
40
],
[
40,
41
],
[
41,
42
],
[
40,
43
],
[
38,
44
],
[
19,
45
],
[
45,
46
],
[
46,
47
],
[
47,
48
],
[
47,
49
],
[
45,
50
],
[
51,
51
],
[
51,
52
],
[
51,
53
],
[
51,
54
],
[
9,
55
],
[
55,
56
]
] | [
"import java.math.BigInteger;\nimport java.util.Scanner;\n\nclass Main {\n public static void main(String args[]) {\n Scanner sc = new Scanner(System.in);\n\n while (sc.hasNext()) {\n BigInteger a = sc.nextBigInteger();\n BigInteger b = sc.nextBigInteger();\n\n BigInteger gcd = a.gcd(b);\n BigInteger lcm = a.multiply(b).divide(gcd);\n System.out.println(gcd + \" \" + lcm);\n }\n }\n}",
"import java.math.BigInteger;",
"BigInteger",
"java.math",
"import java.util.Scanner;",
"Scanner",
"java.util",
"class Main {\n public static void main(String args[]) {\n Scanner sc = new Scanner(System.in);\n\n while (sc.hasNext()) {\n BigInteger a = sc.nextBigInteger();\n BigInteger b = sc.nextBigInteger();\n\n BigInteger gcd = a.gcd(b);\n BigInteger lcm = a.multiply(b).divide(gcd);\n System.out.println(gcd + \" \" + lcm);\n }\n }\n}",
"Main",
"public static void main(String args[]) {\n Scanner sc = new Scanner(System.in);\n\n while (sc.hasNext()) {\n BigInteger a = sc.nextBigInteger();\n BigInteger b = sc.nextBigInteger();\n\n BigInteger gcd = a.gcd(b);\n BigInteger lcm = a.multiply(b).divide(gcd);\n System.out.println(gcd + \" \" + lcm);\n }\n }",
"main",
"{\n Scanner sc = new Scanner(System.in);\n\n while (sc.hasNext()) {\n BigInteger a = sc.nextBigInteger();\n BigInteger b = sc.nextBigInteger();\n\n BigInteger gcd = a.gcd(b);\n BigInteger lcm = a.multiply(b).divide(gcd);\n System.out.println(gcd + \" \" + lcm);\n }\n }",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"while (sc.hasNext()) {\n BigInteger a = sc.nextBigInteger();\n BigInteger b = sc.nextBigInteger();\n\n BigInteger gcd = a.gcd(b);\n BigInteger lcm = a.multiply(b).divide(gcd);\n System.out.println(gcd + \" \" + lcm);\n }",
"sc.hasNext()",
"sc.hasNext",
"sc",
"{\n BigInteger a = sc.nextBigInteger();\n BigInteger b = sc.nextBigInteger();\n\n BigInteger gcd = a.gcd(b);\n BigInteger lcm = a.multiply(b).divide(gcd);\n System.out.println(gcd + \" \" + lcm);\n }",
"BigInteger a = sc.nextBigInteger();",
"a",
"sc.nextBigInteger()",
"sc.nextBigInteger",
"sc",
"BigInteger b = sc.nextBigInteger();",
"b",
"sc.nextBigInteger()",
"sc.nextBigInteger",
"sc",
"BigInteger gcd = a.gcd(b);",
"gcd",
"a.gcd(b)",
"a.gcd",
"a",
"b",
"BigInteger lcm = a.multiply(b).divide(gcd);",
"lcm",
"a.multiply(b).divide(gcd)",
"a.multiply(b).divide",
"a.multiply(b)",
"a.multiply",
"a",
"b",
"gcd",
"System.out.println(gcd + \" \" + lcm)",
"System.out.println",
"System.out",
"System",
"System.out",
"gcd + \" \" + lcm",
"gcd + \" \" + lcm",
"gcd",
"\" \"",
"lcm",
"String args[]",
"args"
] | import java.math.BigInteger;
import java.util.Scanner;
class Main {
public static void main(String args[]) {
Scanner sc = new Scanner(System.in);
while (sc.hasNext()) {
BigInteger a = sc.nextBigInteger();
BigInteger b = sc.nextBigInteger();
BigInteger gcd = a.gcd(b);
BigInteger lcm = a.multiply(b).divide(gcd);
System.out.println(gcd + " " + lcm);
}
}
} |
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
14,
2,
2,
13,
13,
17,
30,
29,
13,
30,
29,
4,
13,
13,
2,
13,
13,
23,
13,
23,
13,
12,
13,
30,
41,
13,
4,
13,
13,
13,
29,
2,
2,
13,
13,
13,
23,
13,
23,
13,
12,
13,
30,
41,
13,
20,
42,
4,
18,
13,
30,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
4,
18,
18,
13,
13,
2,
2,
4,
13,
13,
13,
17,
4,
13,
13,
13,
12,
13,
30,
4,
13,
23,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
10,
11
],
[
11,
12
],
[
11,
13
],
[
10,
14
],
[
9,
15
],
[
15,
16
],
[
16,
17
],
[
9,
18
],
[
18,
19
],
[
19,
20
],
[
20,
21
],
[
20,
22
],
[
20,
23
],
[
23,
24
],
[
23,
25
],
[
6,
26
],
[
26,
27
],
[
6,
28
],
[
28,
29
],
[
4,
30
],
[
30,
31
],
[
30,
32
],
[
32,
33
],
[
33,
34
],
[
33,
35
],
[
35,
36
],
[
35,
37
],
[
35,
38
],
[
32,
39
],
[
39,
40
],
[
40,
41
],
[
41,
42
],
[
41,
43
],
[
40,
44
],
[
30,
45
],
[
45,
46
],
[
30,
47
],
[
47,
48
],
[
4,
49
],
[
49,
50
],
[
49,
51
],
[
51,
52
],
[
52,
53
],
[
52,
54
],
[
51,
55
],
[
55,
56
],
[
56,
57
],
[
57,
58
],
[
55,
59
],
[
59,
60
],
[
60,
61
],
[
60,
62
],
[
62,
63
],
[
63,
64
],
[
59,
65
],
[
65,
66
],
[
65,
67
],
[
67,
68
],
[
68,
69
],
[
59,
70
],
[
70,
71
],
[
71,
72
],
[
72,
73
],
[
72,
74
],
[
70,
75
],
[
76,
76
],
[
76,
77
],
[
77,
78
],
[
77,
79
],
[
77,
80
],
[
76,
81
],
[
76,
82
],
[
82,
83
],
[
82,
84
],
[
82,
85
],
[
4,
86
],
[
86,
87
],
[
86,
88
],
[
88,
89
],
[
89,
90
],
[
86,
91
],
[
91,
92
]
] | [
"import java.util.Scanner;\n\nclass Main {\n private static long gcd(long a, long b) {\n if (a % b == 0) {\n return b;\n } else {\n return gcd(b, a % b);\n }\n }\n\n private static long lcm(long a, long b) {\n long gcd = gcd(a, b);\n return a * b / gcd;\n }\n\n private static void solve() {\n Scanner scanner = new Scanner(System.in);\n while (scanner.hasNextLong()) {\n long a = scanner.nextLong();\n long b = scanner.nextLong();\n System.out.println(gcd(a, b) + \" \" + lcm(a, b));\n }\n }\n\n public static void main(String... args) {\n solve();\n }\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"class Main {\n private static long gcd(long a, long b) {\n if (a % b == 0) {\n return b;\n } else {\n return gcd(b, a % b);\n }\n }\n\n private static long lcm(long a, long b) {\n long gcd = gcd(a, b);\n return a * b / gcd;\n }\n\n private static void solve() {\n Scanner scanner = new Scanner(System.in);\n while (scanner.hasNextLong()) {\n long a = scanner.nextLong();\n long b = scanner.nextLong();\n System.out.println(gcd(a, b) + \" \" + lcm(a, b));\n }\n }\n\n public static void main(String... args) {\n solve();\n }\n}",
"Main",
"private static long gcd(long a, long b) {\n if (a % b == 0) {\n return b;\n } else {\n return gcd(b, a % b);\n }\n }",
"gcd",
"{\n if (a % b == 0) {\n return b;\n } else {\n return gcd(b, a % b);\n }\n }",
"if (a % b == 0) {\n return b;\n } else {\n return gcd(b, a % b);\n }",
"a % b == 0",
"a % b",
"a",
"b",
"0",
"{\n return b;\n }",
"return b;",
"b",
"{\n return gcd(b, a % b);\n }",
"return gcd(b, a % b);",
"gcd(b, a % b)",
"gcd",
"b",
"a % b",
"a",
"b",
"long a",
"a",
"long b",
"b",
"private static long lcm(long a, long b) {\n long gcd = gcd(a, b);\n return a * b / gcd;\n }",
"lcm",
"{\n long gcd = gcd(a, b);\n return a * b / gcd;\n }",
"long gcd = gcd(a, b);",
"gcd",
"gcd(a, b)",
"gcd",
"a",
"b",
"return a * b / gcd;",
"a * b / gcd",
"a * b",
"a",
"b",
"gcd",
"long a",
"a",
"long b",
"b",
"private static void solve() {\n Scanner scanner = new Scanner(System.in);\n while (scanner.hasNextLong()) {\n long a = scanner.nextLong();\n long b = scanner.nextLong();\n System.out.println(gcd(a, b) + \" \" + lcm(a, b));\n }\n }",
"solve",
"{\n Scanner scanner = new Scanner(System.in);\n while (scanner.hasNextLong()) {\n long a = scanner.nextLong();\n long b = scanner.nextLong();\n System.out.println(gcd(a, b) + \" \" + lcm(a, b));\n }\n }",
"Scanner scanner = new Scanner(System.in);",
"scanner",
"new Scanner(System.in)",
"while (scanner.hasNextLong()) {\n long a = scanner.nextLong();\n long b = scanner.nextLong();\n System.out.println(gcd(a, b) + \" \" + lcm(a, b));\n }",
"scanner.hasNextLong()",
"scanner.hasNextLong",
"scanner",
"{\n long a = scanner.nextLong();\n long b = scanner.nextLong();\n System.out.println(gcd(a, b) + \" \" + lcm(a, b));\n }",
"long a = scanner.nextLong();",
"a",
"scanner.nextLong()",
"scanner.nextLong",
"scanner",
"long b = scanner.nextLong();",
"b",
"scanner.nextLong()",
"scanner.nextLong",
"scanner",
"System.out.println(gcd(a, b) + \" \" + lcm(a, b))",
"System.out.println",
"System.out",
"System",
"System.out",
"gcd(a, b) + \" \" + lcm(a, b)",
"gcd(a, b) + \" \" + lcm(a, b)",
"gcd(a, b)",
"gcd",
"a",
"b",
"\" \"",
"lcm(a, b)",
"lcm",
"a",
"b",
"public static void main(String... args) {\n solve();\n }",
"main",
"{\n solve();\n }",
"solve()",
"solve",
"String... args",
"args"
] | import java.util.Scanner;
class Main {
private static long gcd(long a, long b) {
if (a % b == 0) {
return b;
} else {
return gcd(b, a % b);
}
}
private static long lcm(long a, long b) {
long gcd = gcd(a, b);
return a * b / gcd;
}
private static void solve() {
Scanner scanner = new Scanner(System.in);
while (scanner.hasNextLong()) {
long a = scanner.nextLong();
long b = scanner.nextLong();
System.out.println(gcd(a, b) + " " + lcm(a, b));
}
}
public static void main(String... args) {
solve();
}
} |
[
7,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
42,
4,
18,
13,
30,
41,
13,
20,
41,
13,
20,
41,
13,
4,
18,
13,
13,
41,
13,
4,
18,
4,
18,
13,
13,
13,
4,
18,
18,
13,
13,
2,
2,
13,
17,
13,
23,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
9,
10
],
[
9,
11
],
[
11,
12
],
[
12,
13
],
[
12,
14
],
[
11,
15
],
[
15,
16
],
[
16,
17
],
[
17,
18
],
[
15,
19
],
[
19,
20
],
[
20,
21
],
[
20,
22
],
[
19,
23
],
[
23,
24
],
[
23,
25
],
[
19,
26
],
[
26,
27
],
[
26,
28
],
[
28,
29
],
[
29,
30
],
[
28,
31
],
[
19,
32
],
[
32,
33
],
[
32,
34
],
[
34,
35
],
[
35,
36
],
[
36,
37
],
[
37,
38
],
[
36,
39
],
[
34,
40
],
[
19,
41
],
[
41,
42
],
[
42,
43
],
[
43,
44
],
[
43,
45
],
[
41,
46
],
[
47,
47
],
[
47,
48
],
[
47,
49
],
[
47,
50
],
[
9,
51
],
[
51,
52
]
] | [
"import java.util.Scanner;\nimport java.math.BigInteger;\nclass Main{\n public static void main(String[] args){\n Scanner sc = new Scanner(System.in);\n while(sc.hasNext()) {\n BigInteger bda = new BigInteger(sc.next());\n BigInteger bdb = new BigInteger(sc.next());\n BigInteger gcd = bda.gcd(bdb);\n BigInteger lcm = bda.multiply(bdb).divide(gcd);\n System.out.println(gcd+\" \"+lcm);\n }\n }\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"import java.math.BigInteger;",
"BigInteger",
"java.math",
"class Main{\n public static void main(String[] args){\n Scanner sc = new Scanner(System.in);\n while(sc.hasNext()) {\n BigInteger bda = new BigInteger(sc.next());\n BigInteger bdb = new BigInteger(sc.next());\n BigInteger gcd = bda.gcd(bdb);\n BigInteger lcm = bda.multiply(bdb).divide(gcd);\n System.out.println(gcd+\" \"+lcm);\n }\n }\n}",
"Main",
"public static void main(String[] args){\n Scanner sc = new Scanner(System.in);\n while(sc.hasNext()) {\n BigInteger bda = new BigInteger(sc.next());\n BigInteger bdb = new BigInteger(sc.next());\n BigInteger gcd = bda.gcd(bdb);\n BigInteger lcm = bda.multiply(bdb).divide(gcd);\n System.out.println(gcd+\" \"+lcm);\n }\n }",
"main",
"{\n Scanner sc = new Scanner(System.in);\n while(sc.hasNext()) {\n BigInteger bda = new BigInteger(sc.next());\n BigInteger bdb = new BigInteger(sc.next());\n BigInteger gcd = bda.gcd(bdb);\n BigInteger lcm = bda.multiply(bdb).divide(gcd);\n System.out.println(gcd+\" \"+lcm);\n }\n }",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"while(sc.hasNext()) {\n BigInteger bda = new BigInteger(sc.next());\n BigInteger bdb = new BigInteger(sc.next());\n BigInteger gcd = bda.gcd(bdb);\n BigInteger lcm = bda.multiply(bdb).divide(gcd);\n System.out.println(gcd+\" \"+lcm);\n }",
"sc.hasNext()",
"sc.hasNext",
"sc",
"{\n BigInteger bda = new BigInteger(sc.next());\n BigInteger bdb = new BigInteger(sc.next());\n BigInteger gcd = bda.gcd(bdb);\n BigInteger lcm = bda.multiply(bdb).divide(gcd);\n System.out.println(gcd+\" \"+lcm);\n }",
"BigInteger bda = new BigInteger(sc.next());",
"bda",
"new BigInteger(sc.next())",
"BigInteger bdb = new BigInteger(sc.next());",
"bdb",
"new BigInteger(sc.next())",
"BigInteger gcd = bda.gcd(bdb);",
"gcd",
"bda.gcd(bdb)",
"bda.gcd",
"bda",
"bdb",
"BigInteger lcm = bda.multiply(bdb).divide(gcd);",
"lcm",
"bda.multiply(bdb).divide(gcd)",
"bda.multiply(bdb).divide",
"bda.multiply(bdb)",
"bda.multiply",
"bda",
"bdb",
"gcd",
"System.out.println(gcd+\" \"+lcm)",
"System.out.println",
"System.out",
"System",
"System.out",
"gcd+\" \"+lcm",
"gcd+\" \"+lcm",
"gcd",
"\" \"",
"lcm",
"String[] args",
"args"
] | import java.util.Scanner;
import java.math.BigInteger;
class Main{
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
while(sc.hasNext()) {
BigInteger bda = new BigInteger(sc.next());
BigInteger bdb = new BigInteger(sc.next());
BigInteger gcd = bda.gcd(bdb);
BigInteger lcm = bda.multiply(bdb).divide(gcd);
System.out.println(gcd+" "+lcm);
}
}
} |
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
14,
2,
13,
13,
30,
0,
13,
13,
0,
13,
13,
0,
13,
13,
42,
2,
13,
17,
30,
0,
13,
13,
0,
13,
2,
13,
13,
0,
13,
13,
29,
13,
23,
13,
23,
13,
12,
13,
30,
41,
13,
20,
42,
4,
18,
13,
30,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
4,
18,
18,
13,
13,
2,
2,
4,
13,
13,
13,
17,
2,
2,
13,
4,
13,
13,
13,
13,
23,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
8,
11
],
[
11,
12
],
[
12,
13
],
[
12,
14
],
[
11,
15
],
[
15,
16
],
[
16,
17
],
[
16,
18
],
[
15,
19
],
[
19,
20
],
[
19,
21
],
[
15,
22
],
[
22,
23
],
[
22,
24
],
[
8,
25
],
[
25,
26
],
[
26,
27
],
[
26,
28
],
[
25,
29
],
[
29,
30
],
[
30,
31
],
[
30,
32
],
[
29,
33
],
[
33,
34
],
[
33,
35
],
[
35,
36
],
[
35,
37
],
[
29,
38
],
[
38,
39
],
[
38,
40
],
[
8,
41
],
[
41,
42
],
[
6,
43
],
[
43,
44
],
[
6,
45
],
[
45,
46
],
[
4,
47
],
[
47,
48
],
[
47,
49
],
[
49,
50
],
[
50,
51
],
[
50,
52
],
[
49,
53
],
[
53,
54
],
[
54,
55
],
[
55,
56
],
[
53,
57
],
[
57,
58
],
[
58,
59
],
[
58,
60
],
[
60,
61
],
[
61,
62
],
[
57,
63
],
[
63,
64
],
[
63,
65
],
[
65,
66
],
[
66,
67
],
[
57,
68
],
[
68,
69
],
[
69,
70
],
[
70,
71
],
[
70,
72
],
[
68,
73
],
[
74,
74
],
[
74,
75
],
[
75,
76
],
[
75,
77
],
[
75,
78
],
[
74,
79
],
[
74,
80
],
[
80,
81
],
[
81,
82
],
[
81,
83
],
[
83,
84
],
[
83,
85
],
[
83,
86
],
[
80,
87
],
[
47,
88
],
[
88,
89
]
] | [
"import java.util.Scanner;\n\nclass Main{\n public static int gcd(int a, int b){\n int t;\n if(a < b){\n t = a;\n a = b;\n b = t;\n }\n while(b > 0){\n t = b;\n b = a % b;\n a = t;\n }\n return a;\n }\n public static void main(String[] args){\n Scanner in = new Scanner(System.in);\n while(in.hasNext()){\n int a = in.nextInt();\n int b = in.nextInt();\n System.out.println(gcd(a, b) + \" \" + a / gcd(a, b) * b);\n }\n }\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"class Main{\n public static int gcd(int a, int b){\n int t;\n if(a < b){\n t = a;\n a = b;\n b = t;\n }\n while(b > 0){\n t = b;\n b = a % b;\n a = t;\n }\n return a;\n }\n public static void main(String[] args){\n Scanner in = new Scanner(System.in);\n while(in.hasNext()){\n int a = in.nextInt();\n int b = in.nextInt();\n System.out.println(gcd(a, b) + \" \" + a / gcd(a, b) * b);\n }\n }\n}",
"Main",
"public static int gcd(int a, int b){\n int t;\n if(a < b){\n t = a;\n a = b;\n b = t;\n }\n while(b > 0){\n t = b;\n b = a % b;\n a = t;\n }\n return a;\n }",
"gcd",
"{\n int t;\n if(a < b){\n t = a;\n a = b;\n b = t;\n }\n while(b > 0){\n t = b;\n b = a % b;\n a = t;\n }\n return a;\n }",
"int t;",
"t",
"if(a < b){\n t = a;\n a = b;\n b = t;\n }",
"a < b",
"a",
"b",
"{\n t = a;\n a = b;\n b = t;\n }",
"t = a",
"t",
"a",
"a = b",
"a",
"b",
"b = t",
"b",
"t",
"while(b > 0){\n t = b;\n b = a % b;\n a = t;\n }",
"b > 0",
"b",
"0",
"{\n t = b;\n b = a % b;\n a = t;\n }",
"t = b",
"t",
"b",
"b = a % b",
"b",
"a % b",
"a",
"b",
"a = t",
"a",
"t",
"return a;",
"a",
"int a",
"a",
"int b",
"b",
"public static void main(String[] args){\n Scanner in = new Scanner(System.in);\n while(in.hasNext()){\n int a = in.nextInt();\n int b = in.nextInt();\n System.out.println(gcd(a, b) + \" \" + a / gcd(a, b) * b);\n }\n }",
"main",
"{\n Scanner in = new Scanner(System.in);\n while(in.hasNext()){\n int a = in.nextInt();\n int b = in.nextInt();\n System.out.println(gcd(a, b) + \" \" + a / gcd(a, b) * b);\n }\n }",
"Scanner in = new Scanner(System.in);",
"in",
"new Scanner(System.in)",
"while(in.hasNext()){\n int a = in.nextInt();\n int b = in.nextInt();\n System.out.println(gcd(a, b) + \" \" + a / gcd(a, b) * b);\n }",
"in.hasNext()",
"in.hasNext",
"in",
"{\n int a = in.nextInt();\n int b = in.nextInt();\n System.out.println(gcd(a, b) + \" \" + a / gcd(a, b) * b);\n }",
"int a = in.nextInt();",
"a",
"in.nextInt()",
"in.nextInt",
"in",
"int b = in.nextInt();",
"b",
"in.nextInt()",
"in.nextInt",
"in",
"System.out.println(gcd(a, b) + \" \" + a / gcd(a, b) * b)",
"System.out.println",
"System.out",
"System",
"System.out",
"gcd(a, b) + \" \" + a / gcd(a, b) * b",
"gcd(a, b) + \" \" + a / gcd(a, b) * b",
"gcd(a, b)",
"gcd",
"a",
"b",
"\" \"",
"a / gcd(a, b) * b",
"a / gcd(a, b)",
"a",
"gcd(a, b)",
"gcd",
"a",
"b",
"b",
"String[] args",
"args"
] | import java.util.Scanner;
class Main{
public static int gcd(int a, int b){
int t;
if(a < b){
t = a;
a = b;
b = t;
}
while(b > 0){
t = b;
b = a % b;
a = t;
}
return a;
}
public static void main(String[] args){
Scanner in = new Scanner(System.in);
while(in.hasNext()){
int a = in.nextInt();
int b = in.nextInt();
System.out.println(gcd(a, b) + " " + a / gcd(a, b) * b);
}
}
} |
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
41,
13,
41,
13,
12,
13,
30,
0,
13,
20,
0,
13,
20,
41,
13,
20,
4,
18,
13,
4,
18,
13,
23,
13,
6,
13,
12,
13,
30,
41,
13,
20,
42,
4,
18,
13,
30,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
4,
18,
13,
2,
2,
4,
13,
13,
13,
17,
4,
13,
13,
13,
12,
13,
30,
14,
2,
13,
13,
30,
41,
13,
13,
0,
13,
13,
0,
13,
13,
42,
2,
13,
17,
30,
41,
13,
2,
13,
13,
0,
13,
13,
0,
13,
13,
29,
13,
23,
13,
23,
13,
12,
13,
30,
14,
2,
2,
13,
17,
2,
13,
17,
30,
29,
17,
41,
13,
2,
13,
2,
13,
4,
13,
13,
13,
29,
13,
23,
13,
23,
13,
6,
13,
41,
13,
41,
13,
12,
13,
30,
0,
13,
20,
23,
13,
12,
13,
30,
42,
2,
2,
13,
17,
40,
4,
18,
13,
30,
0,
13,
20,
29,
4,
18,
13,
4,
18,
13,
12,
13,
30,
42,
2,
2,
13,
17,
40,
4,
18,
13,
30,
0,
13,
20,
29,
4,
18,
13,
4,
18,
13,
12,
13,
30,
42,
2,
2,
13,
17,
40,
4,
18,
13,
30,
0,
13,
20,
29,
4,
18,
13,
12,
13,
30,
42,
2,
2,
13,
17,
40,
4,
18,
13,
30,
0,
13,
20,
29,
4,
18,
13,
4,
18,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
10,
11
],
[
10,
12
],
[
0,
13
],
[
13,
14
],
[
13,
15
],
[
0,
16
],
[
16,
17
],
[
16,
18
],
[
0,
19
],
[
19,
20
],
[
19,
21
],
[
0,
22
],
[
22,
23
],
[
22,
24
],
[
0,
25
],
[
25,
26
],
[
25,
27
],
[
0,
28
],
[
28,
29
],
[
28,
30
],
[
0,
31
],
[
31,
32
],
[
31,
33
],
[
0,
34
],
[
34,
35
],
[
34,
36
],
[
0,
37
],
[
37,
38
],
[
37,
39
],
[
0,
40
],
[
40,
41
],
[
40,
42
],
[
0,
43
],
[
43,
44
],
[
43,
45
],
[
0,
46
],
[
46,
47
],
[
46,
48
],
[
0,
49
],
[
49,
50
],
[
49,
51
],
[
0,
52
],
[
52,
53
],
[
52,
54
],
[
0,
55
],
[
55,
56
],
[
55,
57
],
[
0,
58
],
[
294,
59
],
[
294,
60
],
[
60,
61
],
[
294,
62
],
[
62,
63
],
[
294,
64
],
[
64,
65
],
[
64,
66
],
[
66,
67
],
[
67,
68
],
[
67,
69
],
[
66,
70
],
[
70,
71
],
[
70,
72
],
[
66,
73
],
[
73,
74
],
[
73,
75
],
[
66,
76
],
[
76,
77
],
[
77,
78
],
[
66,
79
],
[
79,
80
],
[
80,
81
],
[
64,
82
],
[
82,
83
],
[
294,
84
],
[
84,
85
],
[
84,
86
],
[
86,
87
],
[
86,
88
],
[
88,
89
],
[
89,
90
],
[
89,
91
],
[
88,
92
],
[
92,
93
],
[
93,
94
],
[
94,
95
],
[
92,
96
],
[
96,
97
],
[
97,
98
],
[
97,
99
],
[
99,
100
],
[
100,
101
],
[
96,
102
],
[
102,
103
],
[
102,
104
],
[
104,
105
],
[
105,
106
],
[
96,
107
],
[
107,
108
],
[
108,
109
],
[
107,
110
],
[
111,
111
],
[
111,
112
],
[
112,
113
],
[
112,
114
],
[
112,
115
],
[
111,
116
],
[
111,
117
],
[
117,
118
],
[
117,
119
],
[
117,
120
],
[
84,
121
],
[
121,
122
],
[
121,
123
],
[
123,
124
],
[
124,
125
],
[
125,
126
],
[
125,
127
],
[
124,
128
],
[
128,
129
],
[
129,
130
],
[
129,
131
],
[
128,
132
],
[
132,
133
],
[
132,
134
],
[
128,
135
],
[
135,
136
],
[
135,
137
],
[
123,
138
],
[
138,
139
],
[
139,
140
],
[
139,
141
],
[
138,
142
],
[
142,
143
],
[
143,
144
],
[
143,
145
],
[
145,
146
],
[
145,
147
],
[
142,
148
],
[
148,
149
],
[
148,
150
],
[
142,
151
],
[
151,
152
],
[
151,
153
],
[
123,
154
],
[
154,
155
],
[
121,
156
],
[
156,
157
],
[
121,
158
],
[
158,
159
],
[
84,
160
],
[
160,
161
],
[
160,
162
],
[
162,
163
],
[
163,
164
],
[
164,
165
],
[
165,
166
],
[
165,
167
],
[
164,
168
],
[
168,
169
],
[
168,
170
],
[
163,
171
],
[
171,
172
],
[
172,
173
],
[
162,
174
],
[
174,
175
],
[
174,
176
],
[
176,
177
],
[
176,
178
],
[
178,
179
],
[
178,
180
],
[
180,
181
],
[
180,
182
],
[
180,
183
],
[
162,
184
],
[
184,
185
],
[
160,
186
],
[
186,
187
],
[
160,
188
],
[
188,
189
],
[
294,
190
],
[
190,
191
],
[
190,
192
],
[
192,
193
],
[
190,
194
],
[
194,
195
],
[
190,
196
],
[
196,
197
],
[
196,
198
],
[
198,
199
],
[
199,
200
],
[
199,
201
],
[
196,
202
],
[
202,
203
],
[
190,
204
],
[
204,
205
],
[
204,
206
],
[
206,
207
],
[
207,
208
],
[
208,
209
],
[
209,
210
],
[
209,
211
],
[
208,
212
],
[
212,
213
],
[
213,
214
],
[
214,
215
],
[
207,
216
],
[
216,
217
],
[
217,
218
],
[
217,
219
],
[
206,
220
],
[
220,
221
],
[
221,
222
],
[
222,
223
],
[
221,
224
],
[
224,
225
],
[
225,
226
],
[
190,
227
],
[
227,
228
],
[
227,
229
],
[
229,
230
],
[
230,
231
],
[
231,
232
],
[
232,
233
],
[
232,
234
],
[
231,
235
],
[
235,
236
],
[
236,
237
],
[
237,
238
],
[
230,
239
],
[
239,
240
],
[
240,
241
],
[
240,
242
],
[
229,
243
],
[
243,
244
],
[
244,
245
],
[
245,
246
],
[
244,
247
],
[
247,
248
],
[
248,
249
],
[
190,
250
],
[
250,
251
],
[
250,
252
],
[
252,
253
],
[
253,
254
],
[
254,
255
],
[
255,
256
],
[
255,
257
],
[
254,
258
],
[
258,
259
],
[
259,
260
],
[
260,
261
],
[
253,
262
],
[
262,
263
],
[
263,
264
],
[
263,
265
],
[
252,
266
],
[
266,
267
],
[
267,
268
],
[
268,
269
],
[
190,
270
],
[
270,
271
],
[
270,
272
],
[
272,
273
],
[
273,
274
],
[
274,
275
],
[
275,
276
],
[
275,
277
],
[
274,
278
],
[
278,
279
],
[
279,
280
],
[
280,
281
],
[
273,
282
],
[
282,
283
],
[
283,
284
],
[
283,
285
],
[
272,
286
],
[
286,
287
],
[
287,
288
],
[
288,
289
],
[
287,
290
],
[
290,
291
],
[
291,
292
],
[
0,
293
],
[
293,
294
],
[
293,
295
]
] | [
"import java.awt.Frame;\nimport java.awt.image.SinglePixelPackedSampleModel;\nimport java.io.BufferedReader;\nimport java.io.InputStreamReader;\nimport java.io.IOException;\nimport java.io.InputStream;\nimport java.io.OutputStream;\nimport java.io.PrintWriter;\nimport java.util.Arrays;\nimport java.util.StringTokenizer;\n\nimport javax.print.attribute.standard.Chromaticity;\nimport javax.sql.rowset.FilteredRowSet;\nimport javax.swing.BorderFactory;\nimport javax.xml.parsers.DocumentBuilder;\nimport javax.xml.stream.events.EndDocument;\nimport javax.xml.transform.Templates;\n\nimport java.math.BigInteger;\nimport java.time.chrono.MinguoChronology;\nimport java.util.Scanner;\n\npublic class Main {\n static InputReader in;\n static PrintWriter out;\n \n static class Solution {\n void solve() throws IOException {\n Scanner sc = new Scanner(System.in);\n while (sc.hasNext()) {\n int x = sc.nextInt();\n int y = sc.nextInt();\n \n out.println(gcd(x, y) + \" \" + lcm(x, y));\n }\n// End solve()\n }\n \n int gcd(int x, int y) {\n if (x < y) {\n int tmp = x;\n x = y;\n y = tmp;\n }\n \n while (y > 0) {\n int r = x % y;\n x = y;\n y = r;\n }\n return x;\n }\n \n long lcm(int x, int y) {\n if (x == 0 || y == 0) {\n return 0;\n }\n long lcm = x *( y / gcd(x, y));\n \n return lcm;\n }\n// End solution\n } \n \n\n public static void main(String[] args) throws IOException {\n in = new InputReader(System.in);\n out = new PrintWriter(System.out);\n Solution solver = new Solution();\n solver.solve();\n out.close();\n}\n\n static class InputReader {\n public BufferedReader br;\n public StringTokenizer st;\n \n public InputReader(InputStream stream) {\n br = new BufferedReader(new InputStreamReader(stream));\n }\n \n public int nextInt() throws IOException {\n while (st == null || !st.hasMoreTokens()) {\n st = new StringTokenizer(br.readLine());\n }\n return Integer.parseInt(st.nextToken());\n }\n \n public long nextLong() throws IOException {\n while (st == null || !st.hasMoreTokens()) {\n st = new StringTokenizer(br.readLine());\n }\n return Long.parseLong(st.nextToken()); \n }\n \n public String next() throws IOException {\n while (st == null || !st.hasMoreTokens()) {\n st = new StringTokenizer(br.readLine());\n }\n return st.nextToken();\n }\n \n public double nextDouble() throws IOException {\n while (st == null || !st.hasMoreTokens()) {\n st = new StringTokenizer(br.readLine());\n }\n return Double.parseDouble(st.nextToken());\n }\n \n }\n \n}",
"import java.awt.Frame;",
"Frame",
"java.awt",
"import java.awt.image.SinglePixelPackedSampleModel;",
"SinglePixelPackedSampleModel",
"java.awt.image",
"import java.io.BufferedReader;",
"BufferedReader",
"java.io",
"import java.io.InputStreamReader;",
"InputStreamReader",
"java.io",
"import java.io.IOException;",
"IOException",
"java.io",
"import java.io.InputStream;",
"InputStream",
"java.io",
"import java.io.OutputStream;",
"OutputStream",
"java.io",
"import java.io.PrintWriter;",
"PrintWriter",
"java.io",
"import java.util.Arrays;",
"Arrays",
"java.util",
"import java.util.StringTokenizer;",
"StringTokenizer",
"java.util",
"import javax.print.attribute.standard.Chromaticity;",
"Chromaticity",
"javax.print.attribute.standard",
"import javax.sql.rowset.FilteredRowSet;",
"FilteredRowSet",
"javax.sql.rowset",
"import javax.swing.BorderFactory;",
"BorderFactory",
"javax.swing",
"import javax.xml.parsers.DocumentBuilder;",
"DocumentBuilder",
"javax.xml.parsers",
"import javax.xml.stream.events.EndDocument;",
"EndDocument",
"javax.xml.stream.events",
"import javax.xml.transform.Templates;",
"Templates",
"javax.xml.transform",
"import java.math.BigInteger;",
"BigInteger",
"java.math",
"import java.time.chrono.MinguoChronology;",
"MinguoChronology",
"java.time.chrono",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n static InputReader in;\n static PrintWriter out;\n \n static class Solution {\n void solve() throws IOException {\n Scanner sc = new Scanner(System.in);\n while (sc.hasNext()) {\n int x = sc.nextInt();\n int y = sc.nextInt();\n \n out.println(gcd(x, y) + \" \" + lcm(x, y));\n }\n// End solve()\n }\n \n int gcd(int x, int y) {\n if (x < y) {\n int tmp = x;\n x = y;\n y = tmp;\n }\n \n while (y > 0) {\n int r = x % y;\n x = y;\n y = r;\n }\n return x;\n }\n \n long lcm(int x, int y) {\n if (x == 0 || y == 0) {\n return 0;\n }\n long lcm = x *( y / gcd(x, y));\n \n return lcm;\n }\n// End solution\n } \n \n\n public static void main(String[] args) throws IOException {\n in = new InputReader(System.in);\n out = new PrintWriter(System.out);\n Solution solver = new Solution();\n solver.solve();\n out.close();\n}\n\n static class InputReader {\n public BufferedReader br;\n public StringTokenizer st;\n \n public InputReader(InputStream stream) {\n br = new BufferedReader(new InputStreamReader(stream));\n }\n \n public int nextInt() throws IOException {\n while (st == null || !st.hasMoreTokens()) {\n st = new StringTokenizer(br.readLine());\n }\n return Integer.parseInt(st.nextToken());\n }\n \n public long nextLong() throws IOException {\n while (st == null || !st.hasMoreTokens()) {\n st = new StringTokenizer(br.readLine());\n }\n return Long.parseLong(st.nextToken()); \n }\n \n public String next() throws IOException {\n while (st == null || !st.hasMoreTokens()) {\n st = new StringTokenizer(br.readLine());\n }\n return st.nextToken();\n }\n \n public double nextDouble() throws IOException {\n while (st == null || !st.hasMoreTokens()) {\n st = new StringTokenizer(br.readLine());\n }\n return Double.parseDouble(st.nextToken());\n }\n \n }\n \n}",
"Main",
"static InputReader in;",
"in",
"static PrintWriter out;",
"out",
"public static void main(String[] args) throws IOException {\n in = new InputReader(System.in);\n out = new PrintWriter(System.out);\n Solution solver = new Solution();\n solver.solve();\n out.close();\n}",
"main",
"{\n in = new InputReader(System.in);\n out = new PrintWriter(System.out);\n Solution solver = new Solution();\n solver.solve();\n out.close();\n}",
"in = new InputReader(System.in)",
"in",
"new InputReader(System.in)",
"out = new PrintWriter(System.out)",
"out",
"new PrintWriter(System.out)",
"Solution solver = new Solution();",
"solver",
"new Solution()",
"solver.solve()",
"solver.solve",
"solver",
"out.close()",
"out.close",
"out",
"String[] args",
"args",
"static class Solution {\n void solve() throws IOException {\n Scanner sc = new Scanner(System.in);\n while (sc.hasNext()) {\n int x = sc.nextInt();\n int y = sc.nextInt();\n \n out.println(gcd(x, y) + \" \" + lcm(x, y));\n }\n// End solve()\n }\n \n int gcd(int x, int y) {\n if (x < y) {\n int tmp = x;\n x = y;\n y = tmp;\n }\n \n while (y > 0) {\n int r = x % y;\n x = y;\n y = r;\n }\n return x;\n }\n \n long lcm(int x, int y) {\n if (x == 0 || y == 0) {\n return 0;\n }\n long lcm = x *( y / gcd(x, y));\n \n return lcm;\n }\n// End solution\n }",
"Solution",
"void solve() throws IOException {\n Scanner sc = new Scanner(System.in);\n while (sc.hasNext()) {\n int x = sc.nextInt();\n int y = sc.nextInt();\n \n out.println(gcd(x, y) + \" \" + lcm(x, y));\n }\n// End solve()\n }",
"solve",
"{\n Scanner sc = new Scanner(System.in);\n while (sc.hasNext()) {\n int x = sc.nextInt();\n int y = sc.nextInt();\n \n out.println(gcd(x, y) + \" \" + lcm(x, y));\n }\n// End solve()\n }",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"while (sc.hasNext()) {\n int x = sc.nextInt();\n int y = sc.nextInt();\n \n out.println(gcd(x, y) + \" \" + lcm(x, y));\n }",
"sc.hasNext()",
"sc.hasNext",
"sc",
"{\n int x = sc.nextInt();\n int y = sc.nextInt();\n \n out.println(gcd(x, y) + \" \" + lcm(x, y));\n }",
"int x = sc.nextInt();",
"x",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int y = sc.nextInt();",
"y",
"sc.nextInt()",
"sc.nextInt",
"sc",
"out.println(gcd(x, y) + \" \" + lcm(x, y))",
"out.println",
"out",
"gcd(x, y) + \" \" + lcm(x, y)",
"gcd(x, y) + \" \" + lcm(x, y)",
"gcd(x, y)",
"gcd",
"x",
"y",
"\" \"",
"lcm(x, y)",
"lcm",
"x",
"y",
"int gcd(int x, int y) {\n if (x < y) {\n int tmp = x;\n x = y;\n y = tmp;\n }\n \n while (y > 0) {\n int r = x % y;\n x = y;\n y = r;\n }\n return x;\n }",
"gcd",
"{\n if (x < y) {\n int tmp = x;\n x = y;\n y = tmp;\n }\n \n while (y > 0) {\n int r = x % y;\n x = y;\n y = r;\n }\n return x;\n }",
"if (x < y) {\n int tmp = x;\n x = y;\n y = tmp;\n }",
"x < y",
"x",
"y",
"{\n int tmp = x;\n x = y;\n y = tmp;\n }",
"int tmp = x;",
"tmp",
"x",
"x = y",
"x",
"y",
"y = tmp",
"y",
"tmp",
"while (y > 0) {\n int r = x % y;\n x = y;\n y = r;\n }",
"y > 0",
"y",
"0",
"{\n int r = x % y;\n x = y;\n y = r;\n }",
"int r = x % y;",
"r",
"x % y",
"x",
"y",
"x = y",
"x",
"y",
"y = r",
"y",
"r",
"return x;",
"x",
"int x",
"x",
"int y",
"y",
"long lcm(int x, int y) {\n if (x == 0 || y == 0) {\n return 0;\n }\n long lcm = x *( y / gcd(x, y));\n \n return lcm;\n }",
"lcm",
"{\n if (x == 0 || y == 0) {\n return 0;\n }\n long lcm = x *( y / gcd(x, y));\n \n return lcm;\n }",
"if (x == 0 || y == 0) {\n return 0;\n }",
"x == 0 || y == 0",
"x == 0",
"x",
"0",
"y == 0",
"y",
"0",
"{\n return 0;\n }",
"return 0;",
"0",
"long lcm = x *( y / gcd(x, y));",
"lcm",
"x *( y / gcd(x, y))",
"x",
"( y / gcd(x, y))",
"y",
"gcd(x, y)",
"gcd",
"x",
"y",
"return lcm;",
"lcm",
"int x",
"x",
"int y",
"y",
"static class InputReader {\n public BufferedReader br;\n public StringTokenizer st;\n \n public InputReader(InputStream stream) {\n br = new BufferedReader(new InputStreamReader(stream));\n }\n \n public int nextInt() throws IOException {\n while (st == null || !st.hasMoreTokens()) {\n st = new StringTokenizer(br.readLine());\n }\n return Integer.parseInt(st.nextToken());\n }\n \n public long nextLong() throws IOException {\n while (st == null || !st.hasMoreTokens()) {\n st = new StringTokenizer(br.readLine());\n }\n return Long.parseLong(st.nextToken()); \n }\n \n public String next() throws IOException {\n while (st == null || !st.hasMoreTokens()) {\n st = new StringTokenizer(br.readLine());\n }\n return st.nextToken();\n }\n \n public double nextDouble() throws IOException {\n while (st == null || !st.hasMoreTokens()) {\n st = new StringTokenizer(br.readLine());\n }\n return Double.parseDouble(st.nextToken());\n }\n \n }",
"InputReader",
"public BufferedReader br;",
"br",
"public StringTokenizer st;",
"st",
"public InputReader(InputStream stream) {\n br = new BufferedReader(new InputStreamReader(stream));\n }",
"InputReader",
"{\n br = new BufferedReader(new InputStreamReader(stream));\n }",
"br = new BufferedReader(new InputStreamReader(stream))",
"br",
"new BufferedReader(new InputStreamReader(stream))",
"InputStream stream",
"stream",
"public int nextInt() throws IOException {\n while (st == null || !st.hasMoreTokens()) {\n st = new StringTokenizer(br.readLine());\n }\n return Integer.parseInt(st.nextToken());\n }",
"nextInt",
"{\n while (st == null || !st.hasMoreTokens()) {\n st = new StringTokenizer(br.readLine());\n }\n return Integer.parseInt(st.nextToken());\n }",
"while (st == null || !st.hasMoreTokens()) {\n st = new StringTokenizer(br.readLine());\n }",
"st == null || !st.hasMoreTokens()",
"st == null",
"st",
"null",
"!st.hasMoreTokens()",
"st.hasMoreTokens()",
"st.hasMoreTokens",
"st",
"{\n st = new StringTokenizer(br.readLine());\n }",
"st = new StringTokenizer(br.readLine())",
"st",
"new StringTokenizer(br.readLine())",
"return Integer.parseInt(st.nextToken());",
"Integer.parseInt(st.nextToken())",
"Integer.parseInt",
"Integer",
"st.nextToken()",
"st.nextToken",
"st",
"public long nextLong() throws IOException {\n while (st == null || !st.hasMoreTokens()) {\n st = new StringTokenizer(br.readLine());\n }\n return Long.parseLong(st.nextToken()); \n }",
"nextLong",
"{\n while (st == null || !st.hasMoreTokens()) {\n st = new StringTokenizer(br.readLine());\n }\n return Long.parseLong(st.nextToken()); \n }",
"while (st == null || !st.hasMoreTokens()) {\n st = new StringTokenizer(br.readLine());\n }",
"st == null || !st.hasMoreTokens()",
"st == null",
"st",
"null",
"!st.hasMoreTokens()",
"st.hasMoreTokens()",
"st.hasMoreTokens",
"st",
"{\n st = new StringTokenizer(br.readLine());\n }",
"st = new StringTokenizer(br.readLine())",
"st",
"new StringTokenizer(br.readLine())",
"return Long.parseLong(st.nextToken());",
"Long.parseLong(st.nextToken())",
"Long.parseLong",
"Long",
"st.nextToken()",
"st.nextToken",
"st",
"public String next() throws IOException {\n while (st == null || !st.hasMoreTokens()) {\n st = new StringTokenizer(br.readLine());\n }\n return st.nextToken();\n }",
"next",
"{\n while (st == null || !st.hasMoreTokens()) {\n st = new StringTokenizer(br.readLine());\n }\n return st.nextToken();\n }",
"while (st == null || !st.hasMoreTokens()) {\n st = new StringTokenizer(br.readLine());\n }",
"st == null || !st.hasMoreTokens()",
"st == null",
"st",
"null",
"!st.hasMoreTokens()",
"st.hasMoreTokens()",
"st.hasMoreTokens",
"st",
"{\n st = new StringTokenizer(br.readLine());\n }",
"st = new StringTokenizer(br.readLine())",
"st",
"new StringTokenizer(br.readLine())",
"return st.nextToken();",
"st.nextToken()",
"st.nextToken",
"st",
"public double nextDouble() throws IOException {\n while (st == null || !st.hasMoreTokens()) {\n st = new StringTokenizer(br.readLine());\n }\n return Double.parseDouble(st.nextToken());\n }",
"nextDouble",
"{\n while (st == null || !st.hasMoreTokens()) {\n st = new StringTokenizer(br.readLine());\n }\n return Double.parseDouble(st.nextToken());\n }",
"while (st == null || !st.hasMoreTokens()) {\n st = new StringTokenizer(br.readLine());\n }",
"st == null || !st.hasMoreTokens()",
"st == null",
"st",
"null",
"!st.hasMoreTokens()",
"st.hasMoreTokens()",
"st.hasMoreTokens",
"st",
"{\n st = new StringTokenizer(br.readLine());\n }",
"st = new StringTokenizer(br.readLine())",
"st",
"new StringTokenizer(br.readLine())",
"return Double.parseDouble(st.nextToken());",
"Double.parseDouble(st.nextToken())",
"Double.parseDouble",
"Double",
"st.nextToken()",
"st.nextToken",
"st",
"public class Main {\n static InputReader in;\n static PrintWriter out;\n \n static class Solution {\n void solve() throws IOException {\n Scanner sc = new Scanner(System.in);\n while (sc.hasNext()) {\n int x = sc.nextInt();\n int y = sc.nextInt();\n \n out.println(gcd(x, y) + \" \" + lcm(x, y));\n }\n// End solve()\n }\n \n int gcd(int x, int y) {\n if (x < y) {\n int tmp = x;\n x = y;\n y = tmp;\n }\n \n while (y > 0) {\n int r = x % y;\n x = y;\n y = r;\n }\n return x;\n }\n \n long lcm(int x, int y) {\n if (x == 0 || y == 0) {\n return 0;\n }\n long lcm = x *( y / gcd(x, y));\n \n return lcm;\n }\n// End solution\n } \n \n\n public static void main(String[] args) throws IOException {\n in = new InputReader(System.in);\n out = new PrintWriter(System.out);\n Solution solver = new Solution();\n solver.solve();\n out.close();\n}\n\n static class InputReader {\n public BufferedReader br;\n public StringTokenizer st;\n \n public InputReader(InputStream stream) {\n br = new BufferedReader(new InputStreamReader(stream));\n }\n \n public int nextInt() throws IOException {\n while (st == null || !st.hasMoreTokens()) {\n st = new StringTokenizer(br.readLine());\n }\n return Integer.parseInt(st.nextToken());\n }\n \n public long nextLong() throws IOException {\n while (st == null || !st.hasMoreTokens()) {\n st = new StringTokenizer(br.readLine());\n }\n return Long.parseLong(st.nextToken()); \n }\n \n public String next() throws IOException {\n while (st == null || !st.hasMoreTokens()) {\n st = new StringTokenizer(br.readLine());\n }\n return st.nextToken();\n }\n \n public double nextDouble() throws IOException {\n while (st == null || !st.hasMoreTokens()) {\n st = new StringTokenizer(br.readLine());\n }\n return Double.parseDouble(st.nextToken());\n }\n \n }\n \n}",
"public class Main {\n static InputReader in;\n static PrintWriter out;\n \n static class Solution {\n void solve() throws IOException {\n Scanner sc = new Scanner(System.in);\n while (sc.hasNext()) {\n int x = sc.nextInt();\n int y = sc.nextInt();\n \n out.println(gcd(x, y) + \" \" + lcm(x, y));\n }\n// End solve()\n }\n \n int gcd(int x, int y) {\n if (x < y) {\n int tmp = x;\n x = y;\n y = tmp;\n }\n \n while (y > 0) {\n int r = x % y;\n x = y;\n y = r;\n }\n return x;\n }\n \n long lcm(int x, int y) {\n if (x == 0 || y == 0) {\n return 0;\n }\n long lcm = x *( y / gcd(x, y));\n \n return lcm;\n }\n// End solution\n } \n \n\n public static void main(String[] args) throws IOException {\n in = new InputReader(System.in);\n out = new PrintWriter(System.out);\n Solution solver = new Solution();\n solver.solve();\n out.close();\n}\n\n static class InputReader {\n public BufferedReader br;\n public StringTokenizer st;\n \n public InputReader(InputStream stream) {\n br = new BufferedReader(new InputStreamReader(stream));\n }\n \n public int nextInt() throws IOException {\n while (st == null || !st.hasMoreTokens()) {\n st = new StringTokenizer(br.readLine());\n }\n return Integer.parseInt(st.nextToken());\n }\n \n public long nextLong() throws IOException {\n while (st == null || !st.hasMoreTokens()) {\n st = new StringTokenizer(br.readLine());\n }\n return Long.parseLong(st.nextToken()); \n }\n \n public String next() throws IOException {\n while (st == null || !st.hasMoreTokens()) {\n st = new StringTokenizer(br.readLine());\n }\n return st.nextToken();\n }\n \n public double nextDouble() throws IOException {\n while (st == null || !st.hasMoreTokens()) {\n st = new StringTokenizer(br.readLine());\n }\n return Double.parseDouble(st.nextToken());\n }\n \n }\n \n}",
"Main"
] | import java.awt.Frame;
import java.awt.image.SinglePixelPackedSampleModel;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.StringTokenizer;
import javax.print.attribute.standard.Chromaticity;
import javax.sql.rowset.FilteredRowSet;
import javax.swing.BorderFactory;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.stream.events.EndDocument;
import javax.xml.transform.Templates;
import java.math.BigInteger;
import java.time.chrono.MinguoChronology;
import java.util.Scanner;
public class Main {
static InputReader in;
static PrintWriter out;
static class Solution {
void solve() throws IOException {
Scanner sc = new Scanner(System.in);
while (sc.hasNext()) {
int x = sc.nextInt();
int y = sc.nextInt();
out.println(gcd(x, y) + " " + lcm(x, y));
}
// End solve()
}
int gcd(int x, int y) {
if (x < y) {
int tmp = x;
x = y;
y = tmp;
}
while (y > 0) {
int r = x % y;
x = y;
y = r;
}
return x;
}
long lcm(int x, int y) {
if (x == 0 || y == 0) {
return 0;
}
long lcm = x *( y / gcd(x, y));
return lcm;
}
// End solution
}
public static void main(String[] args) throws IOException {
in = new InputReader(System.in);
out = new PrintWriter(System.out);
Solution solver = new Solution();
solver.solve();
out.close();
}
static class InputReader {
public BufferedReader br;
public StringTokenizer st;
public InputReader(InputStream stream) {
br = new BufferedReader(new InputStreamReader(stream));
}
public int nextInt() throws IOException {
while (st == null || !st.hasMoreTokens()) {
st = new StringTokenizer(br.readLine());
}
return Integer.parseInt(st.nextToken());
}
public long nextLong() throws IOException {
while (st == null || !st.hasMoreTokens()) {
st = new StringTokenizer(br.readLine());
}
return Long.parseLong(st.nextToken());
}
public String next() throws IOException {
while (st == null || !st.hasMoreTokens()) {
st = new StringTokenizer(br.readLine());
}
return st.nextToken();
}
public double nextDouble() throws IOException {
while (st == null || !st.hasMoreTokens()) {
st = new StringTokenizer(br.readLine());
}
return Double.parseDouble(st.nextToken());
}
}
} |
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
42,
17,
30,
41,
13,
4,
18,
13,
14,
2,
2,
13,
17,
2,
13,
17,
30,
3,
41,
13,
4,
18,
13,
17,
41,
13,
4,
18,
13,
18,
13,
17,
41,
13,
4,
18,
13,
18,
13,
17,
4,
18,
18,
13,
13,
2,
2,
4,
13,
13,
13,
17,
4,
13,
13,
13,
23,
13,
12,
13,
30,
41,
13,
42,
2,
0,
13,
2,
13,
13,
17,
30,
0,
13,
13,
0,
13,
13,
29,
13,
23,
13,
23,
13,
12,
13,
30,
29,
2,
2,
13,
13,
4,
13,
13,
13,
23,
13,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
119,
11
],
[
119,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
15,
17
],
[
14,
18
],
[
18,
19
],
[
18,
20
],
[
20,
21
],
[
21,
22
],
[
21,
23
],
[
23,
24
],
[
24,
25
],
[
20,
26
],
[
26,
27
],
[
27,
28
],
[
28,
29
],
[
28,
30
],
[
27,
31
],
[
31,
32
],
[
31,
33
],
[
26,
34
],
[
34,
35
],
[
20,
36
],
[
36,
37
],
[
36,
38
],
[
38,
39
],
[
39,
40
],
[
38,
41
],
[
20,
42
],
[
42,
43
],
[
42,
44
],
[
44,
45
],
[
45,
46
],
[
44,
47
],
[
47,
48
],
[
47,
49
],
[
20,
50
],
[
50,
51
],
[
50,
52
],
[
52,
53
],
[
53,
54
],
[
52,
55
],
[
55,
56
],
[
55,
57
],
[
20,
58
],
[
58,
59
],
[
59,
60
],
[
60,
61
],
[
60,
62
],
[
58,
63
],
[
64,
64
],
[
64,
65
],
[
65,
66
],
[
65,
67
],
[
65,
68
],
[
64,
69
],
[
64,
70
],
[
70,
71
],
[
70,
72
],
[
70,
73
],
[
12,
74
],
[
74,
75
],
[
119,
76
],
[
76,
77
],
[
76,
78
],
[
78,
79
],
[
79,
80
],
[
78,
81
],
[
81,
82
],
[
82,
83
],
[
83,
84
],
[
83,
85
],
[
85,
86
],
[
85,
87
],
[
82,
88
],
[
81,
89
],
[
89,
90
],
[
90,
91
],
[
90,
92
],
[
89,
93
],
[
93,
94
],
[
93,
95
],
[
78,
96
],
[
96,
97
],
[
76,
98
],
[
98,
99
],
[
76,
100
],
[
100,
101
],
[
119,
102
],
[
102,
103
],
[
102,
104
],
[
104,
105
],
[
105,
106
],
[
106,
107
],
[
107,
108
],
[
107,
109
],
[
106,
110
],
[
110,
111
],
[
110,
112
],
[
110,
113
],
[
102,
114
],
[
114,
115
],
[
102,
116
],
[
116,
117
],
[
0,
118
],
[
118,
119
],
[
118,
120
]
] | [
"import java.io.BufferedReader;\nimport java.io.IOException;\nimport java.io.InputStreamReader;\n\npublic class Main {\n\n\tpublic static void main(String[] args) throws IOException{\n\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\t\t\n\t\twhile(true){\n\t\t\tString str = br.readLine();\n\t\t\tif(str == null || str == \"\"){\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tString[] str1Ary = str.split(\" \");\n\t\t\tlong a = Integer.parseInt(str1Ary[0]);\n\t\t\tlong b = Integer.parseInt(str1Ary[1]);\n\t\t\tSystem.out.println(getGCD(a, b) + \" \" + getLCM(a, b));\n\t\t}\n\t}\n\n\tprivate static long getGCD(long a, long b){\n\t\tlong r;\n\t\twhile ((r = a % b) != 0) {\n\t\t\ta = b;\n\t\t\tb = r;\n\t\t}\n\t\treturn b;\n\t}\n\n\tprivate static long getLCM(long a, long b) {\n\t\treturn a * b / getGCD(a, b);\n\t}\n}",
"import java.io.BufferedReader;",
"BufferedReader",
"java.io",
"import java.io.IOException;",
"IOException",
"java.io",
"import java.io.InputStreamReader;",
"InputStreamReader",
"java.io",
"public class Main {\n\n\tpublic static void main(String[] args) throws IOException{\n\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\t\t\n\t\twhile(true){\n\t\t\tString str = br.readLine();\n\t\t\tif(str == null || str == \"\"){\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tString[] str1Ary = str.split(\" \");\n\t\t\tlong a = Integer.parseInt(str1Ary[0]);\n\t\t\tlong b = Integer.parseInt(str1Ary[1]);\n\t\t\tSystem.out.println(getGCD(a, b) + \" \" + getLCM(a, b));\n\t\t}\n\t}\n\n\tprivate static long getGCD(long a, long b){\n\t\tlong r;\n\t\twhile ((r = a % b) != 0) {\n\t\t\ta = b;\n\t\t\tb = r;\n\t\t}\n\t\treturn b;\n\t}\n\n\tprivate static long getLCM(long a, long b) {\n\t\treturn a * b / getGCD(a, b);\n\t}\n}",
"Main",
"public static void main(String[] args) throws IOException{\n\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\t\t\n\t\twhile(true){\n\t\t\tString str = br.readLine();\n\t\t\tif(str == null || str == \"\"){\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tString[] str1Ary = str.split(\" \");\n\t\t\tlong a = Integer.parseInt(str1Ary[0]);\n\t\t\tlong b = Integer.parseInt(str1Ary[1]);\n\t\t\tSystem.out.println(getGCD(a, b) + \" \" + getLCM(a, b));\n\t\t}\n\t}",
"main",
"{\n\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\t\t\n\t\twhile(true){\n\t\t\tString str = br.readLine();\n\t\t\tif(str == null || str == \"\"){\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tString[] str1Ary = str.split(\" \");\n\t\t\tlong a = Integer.parseInt(str1Ary[0]);\n\t\t\tlong b = Integer.parseInt(str1Ary[1]);\n\t\t\tSystem.out.println(getGCD(a, b) + \" \" + getLCM(a, b));\n\t\t}\n\t}",
"BufferedReader br = new BufferedReader(new InputStreamReader(System.in));",
"br",
"new BufferedReader(new InputStreamReader(System.in))",
"while(true){\n\t\t\tString str = br.readLine();\n\t\t\tif(str == null || str == \"\"){\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tString[] str1Ary = str.split(\" \");\n\t\t\tlong a = Integer.parseInt(str1Ary[0]);\n\t\t\tlong b = Integer.parseInt(str1Ary[1]);\n\t\t\tSystem.out.println(getGCD(a, b) + \" \" + getLCM(a, b));\n\t\t}",
"true",
"{\n\t\t\tString str = br.readLine();\n\t\t\tif(str == null || str == \"\"){\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tString[] str1Ary = str.split(\" \");\n\t\t\tlong a = Integer.parseInt(str1Ary[0]);\n\t\t\tlong b = Integer.parseInt(str1Ary[1]);\n\t\t\tSystem.out.println(getGCD(a, b) + \" \" + getLCM(a, b));\n\t\t}",
"String str = br.readLine();",
"str",
"br.readLine()",
"br.readLine",
"br",
"if(str == null || str == \"\"){\n\t\t\t\tbreak;\n\t\t\t}",
"str == null || str == \"\"",
"str == null",
"str",
"null",
"str == \"\"",
"str",
"\"\"",
"{\n\t\t\t\tbreak;\n\t\t\t}",
"break;",
"String[] str1Ary = str.split(\" \");",
"str1Ary",
"str.split(\" \")",
"str.split",
"str",
"\" \"",
"long a = Integer.parseInt(str1Ary[0]);",
"a",
"Integer.parseInt(str1Ary[0])",
"Integer.parseInt",
"Integer",
"str1Ary[0]",
"str1Ary",
"0",
"long b = Integer.parseInt(str1Ary[1]);",
"b",
"Integer.parseInt(str1Ary[1])",
"Integer.parseInt",
"Integer",
"str1Ary[1]",
"str1Ary",
"1",
"System.out.println(getGCD(a, b) + \" \" + getLCM(a, b))",
"System.out.println",
"System.out",
"System",
"System.out",
"getGCD(a, b) + \" \" + getLCM(a, b)",
"getGCD(a, b) + \" \" + getLCM(a, b)",
"getGCD(a, b)",
"getGCD",
"a",
"b",
"\" \"",
"getLCM(a, b)",
"getLCM",
"a",
"b",
"String[] args",
"args",
"private static long getGCD(long a, long b){\n\t\tlong r;\n\t\twhile ((r = a % b) != 0) {\n\t\t\ta = b;\n\t\t\tb = r;\n\t\t}\n\t\treturn b;\n\t}",
"getGCD",
"{\n\t\tlong r;\n\t\twhile ((r = a % b) != 0) {\n\t\t\ta = b;\n\t\t\tb = r;\n\t\t}\n\t\treturn b;\n\t}",
"long r;",
"r",
"while ((r = a % b) != 0) {\n\t\t\ta = b;\n\t\t\tb = r;\n\t\t}",
"(r = a % b) != 0",
"(r = a % b)",
"r",
"a % b",
"a",
"b",
"0",
"{\n\t\t\ta = b;\n\t\t\tb = r;\n\t\t}",
"a = b",
"a",
"b",
"b = r",
"b",
"r",
"return b;",
"b",
"long a",
"a",
"long b",
"b",
"private static long getLCM(long a, long b) {\n\t\treturn a * b / getGCD(a, b);\n\t}",
"getLCM",
"{\n\t\treturn a * b / getGCD(a, b);\n\t}",
"return a * b / getGCD(a, b);",
"a * b / getGCD(a, b)",
"a * b",
"a",
"b",
"getGCD(a, b)",
"getGCD",
"a",
"b",
"long a",
"a",
"long b",
"b",
"public class Main {\n\n\tpublic static void main(String[] args) throws IOException{\n\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\t\t\n\t\twhile(true){\n\t\t\tString str = br.readLine();\n\t\t\tif(str == null || str == \"\"){\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tString[] str1Ary = str.split(\" \");\n\t\t\tlong a = Integer.parseInt(str1Ary[0]);\n\t\t\tlong b = Integer.parseInt(str1Ary[1]);\n\t\t\tSystem.out.println(getGCD(a, b) + \" \" + getLCM(a, b));\n\t\t}\n\t}\n\n\tprivate static long getGCD(long a, long b){\n\t\tlong r;\n\t\twhile ((r = a % b) != 0) {\n\t\t\ta = b;\n\t\t\tb = r;\n\t\t}\n\t\treturn b;\n\t}\n\n\tprivate static long getLCM(long a, long b) {\n\t\treturn a * b / getGCD(a, b);\n\t}\n}",
"public class Main {\n\n\tpublic static void main(String[] args) throws IOException{\n\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\t\t\n\t\twhile(true){\n\t\t\tString str = br.readLine();\n\t\t\tif(str == null || str == \"\"){\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tString[] str1Ary = str.split(\" \");\n\t\t\tlong a = Integer.parseInt(str1Ary[0]);\n\t\t\tlong b = Integer.parseInt(str1Ary[1]);\n\t\t\tSystem.out.println(getGCD(a, b) + \" \" + getLCM(a, b));\n\t\t}\n\t}\n\n\tprivate static long getGCD(long a, long b){\n\t\tlong r;\n\t\twhile ((r = a % b) != 0) {\n\t\t\ta = b;\n\t\t\tb = r;\n\t\t}\n\t\treturn b;\n\t}\n\n\tprivate static long getLCM(long a, long b) {\n\t\treturn a * b / getGCD(a, b);\n\t}\n}",
"Main"
] | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class Main {
public static void main(String[] args) throws IOException{
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
while(true){
String str = br.readLine();
if(str == null || str == ""){
break;
}
String[] str1Ary = str.split(" ");
long a = Integer.parseInt(str1Ary[0]);
long b = Integer.parseInt(str1Ary[1]);
System.out.println(getGCD(a, b) + " " + getLCM(a, b));
}
}
private static long getGCD(long a, long b){
long r;
while ((r = a % b) != 0) {
a = b;
b = r;
}
return b;
}
private static long getLCM(long a, long b) {
return a * b / getGCD(a, b);
}
} |
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
42,
2,
13,
13,
30,
14,
2,
13,
13,
30,
0,
13,
13,
30,
0,
13,
13,
29,
13,
23,
13,
23,
13,
12,
13,
30,
41,
13,
20,
42,
4,
18,
13,
30,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
41,
13,
4,
13,
13,
13,
4,
18,
18,
13,
13,
2,
2,
13,
17,
2,
2,
13,
13,
13,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
82,
11
],
[
82,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
16,
17
],
[
16,
18
],
[
15,
19
],
[
19,
20
],
[
20,
21
],
[
21,
22
],
[
21,
23
],
[
20,
24
],
[
24,
25
],
[
25,
26
],
[
25,
27
],
[
20,
28
],
[
28,
29
],
[
29,
30
],
[
29,
31
],
[
14,
32
],
[
32,
33
],
[
12,
34
],
[
34,
35
],
[
12,
36
],
[
36,
37
],
[
82,
38
],
[
38,
39
],
[
38,
40
],
[
40,
41
],
[
41,
42
],
[
41,
43
],
[
40,
44
],
[
44,
45
],
[
45,
46
],
[
46,
47
],
[
44,
48
],
[
48,
49
],
[
49,
50
],
[
49,
51
],
[
51,
52
],
[
52,
53
],
[
48,
54
],
[
54,
55
],
[
54,
56
],
[
56,
57
],
[
57,
58
],
[
48,
59
],
[
59,
60
],
[
59,
61
],
[
61,
62
],
[
61,
63
],
[
61,
64
],
[
48,
65
],
[
65,
66
],
[
66,
67
],
[
67,
68
],
[
67,
69
],
[
65,
70
],
[
71,
71
],
[
71,
72
],
[
71,
73
],
[
71,
74
],
[
74,
75
],
[
75,
76
],
[
75,
77
],
[
74,
78
],
[
38,
79
],
[
79,
80
],
[
0,
81
],
[
81,
82
],
[
81,
83
]
] | [
"import java.util.*;\nimport java.io.*;\nimport java.math.*;\n\n\n\npublic class Main {\n\t\n\tprivate static long gcd(long n, long m) {\n//\t\tint tmp = 0;\n\t\twhile(n != m) {\n\t\t\tif(n > m) {\n\t\t\t\tn -= m;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tm-= n;\n\t\t\t}\n\t\t}\n\t\t\n\t\t\n\t\treturn n;\n\t}\n\n//\tprivate static int lcm(int n, int m) {\n//\t\treturn n*m/gcd(n, m);\n//\t}\n\t\n\tpublic static void main(String[] args) throws IOException{\n Scanner scan = new Scanner(System.in);\n while(scan.hasNext()) {\n \tlong n = scan.nextInt();\n \tlong m = scan.nextInt();\n \tlong gcd = gcd(n, m);\n \tSystem.out.println(gcd + \" \" + n * m / gcd);\n \t\n }\n\n \n\t}\n}\n ",
"import java.util.*;",
"util.*",
"java",
"import java.io.*;",
"io.*",
"java",
"import java.math.*;",
"math.*",
"java",
"public class Main {\n\t\n\tprivate static long gcd(long n, long m) {\n//\t\tint tmp = 0;\n\t\twhile(n != m) {\n\t\t\tif(n > m) {\n\t\t\t\tn -= m;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tm-= n;\n\t\t\t}\n\t\t}\n\t\t\n\t\t\n\t\treturn n;\n\t}\n\n//\tprivate static int lcm(int n, int m) {\n//\t\treturn n*m/gcd(n, m);\n//\t}\n\t\n\tpublic static void main(String[] args) throws IOException{\n Scanner scan = new Scanner(System.in);\n while(scan.hasNext()) {\n \tlong n = scan.nextInt();\n \tlong m = scan.nextInt();\n \tlong gcd = gcd(n, m);\n \tSystem.out.println(gcd + \" \" + n * m / gcd);\n \t\n }\n\n \n\t}\n}",
"Main",
"private static long gcd(long n, long m) {\n//\t\tint tmp = 0;\n\t\twhile(n != m) {\n\t\t\tif(n > m) {\n\t\t\t\tn -= m;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tm-= n;\n\t\t\t}\n\t\t}\n\t\t\n\t\t\n\t\treturn n;\n\t}",
"gcd",
"{\n//\t\tint tmp = 0;\n\t\twhile(n != m) {\n\t\t\tif(n > m) {\n\t\t\t\tn -= m;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tm-= n;\n\t\t\t}\n\t\t}\n\t\t\n\t\t\n\t\treturn n;\n\t}",
"while(n != m) {\n\t\t\tif(n > m) {\n\t\t\t\tn -= m;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tm-= n;\n\t\t\t}\n\t\t}",
"n != m",
"n",
"m",
"{\n\t\t\tif(n > m) {\n\t\t\t\tn -= m;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tm-= n;\n\t\t\t}\n\t\t}",
"if(n > m) {\n\t\t\t\tn -= m;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tm-= n;\n\t\t\t}",
"n > m",
"n",
"m",
"{\n\t\t\t\tn -= m;\n\t\t\t}",
"n -= m",
"n",
"m",
"{\n\t\t\t\tm-= n;\n\t\t\t}",
"m-= n",
"m",
"n",
"return n;",
"n",
"long n",
"n",
"long m",
"m",
"public static void main(String[] args) throws IOException{\n Scanner scan = new Scanner(System.in);\n while(scan.hasNext()) {\n \tlong n = scan.nextInt();\n \tlong m = scan.nextInt();\n \tlong gcd = gcd(n, m);\n \tSystem.out.println(gcd + \" \" + n * m / gcd);\n \t\n }\n\n \n\t}",
"main",
"{\n Scanner scan = new Scanner(System.in);\n while(scan.hasNext()) {\n \tlong n = scan.nextInt();\n \tlong m = scan.nextInt();\n \tlong gcd = gcd(n, m);\n \tSystem.out.println(gcd + \" \" + n * m / gcd);\n \t\n }\n\n \n\t}",
"Scanner scan = new Scanner(System.in);",
"scan",
"new Scanner(System.in)",
"while(scan.hasNext()) {\n \tlong n = scan.nextInt();\n \tlong m = scan.nextInt();\n \tlong gcd = gcd(n, m);\n \tSystem.out.println(gcd + \" \" + n * m / gcd);\n \t\n }",
"scan.hasNext()",
"scan.hasNext",
"scan",
"{\n \tlong n = scan.nextInt();\n \tlong m = scan.nextInt();\n \tlong gcd = gcd(n, m);\n \tSystem.out.println(gcd + \" \" + n * m / gcd);\n \t\n }",
"long n = scan.nextInt();",
"n",
"scan.nextInt()",
"scan.nextInt",
"scan",
"long m = scan.nextInt();",
"m",
"scan.nextInt()",
"scan.nextInt",
"scan",
"long gcd = gcd(n, m);",
"gcd",
"gcd(n, m)",
"gcd",
"n",
"m",
"System.out.println(gcd + \" \" + n * m / gcd)",
"System.out.println",
"System.out",
"System",
"System.out",
"gcd + \" \" + n * m / gcd",
"gcd + \" \" + n * m / gcd",
"gcd",
"\" \"",
"n * m / gcd",
"n * m",
"n",
"m",
"gcd",
"String[] args",
"args",
"public class Main {\n\t\n\tprivate static long gcd(long n, long m) {\n//\t\tint tmp = 0;\n\t\twhile(n != m) {\n\t\t\tif(n > m) {\n\t\t\t\tn -= m;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tm-= n;\n\t\t\t}\n\t\t}\n\t\t\n\t\t\n\t\treturn n;\n\t}\n\n//\tprivate static int lcm(int n, int m) {\n//\t\treturn n*m/gcd(n, m);\n//\t}\n\t\n\tpublic static void main(String[] args) throws IOException{\n Scanner scan = new Scanner(System.in);\n while(scan.hasNext()) {\n \tlong n = scan.nextInt();\n \tlong m = scan.nextInt();\n \tlong gcd = gcd(n, m);\n \tSystem.out.println(gcd + \" \" + n * m / gcd);\n \t\n }\n\n \n\t}\n}",
"public class Main {\n\t\n\tprivate static long gcd(long n, long m) {\n//\t\tint tmp = 0;\n\t\twhile(n != m) {\n\t\t\tif(n > m) {\n\t\t\t\tn -= m;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tm-= n;\n\t\t\t}\n\t\t}\n\t\t\n\t\t\n\t\treturn n;\n\t}\n\n//\tprivate static int lcm(int n, int m) {\n//\t\treturn n*m/gcd(n, m);\n//\t}\n\t\n\tpublic static void main(String[] args) throws IOException{\n Scanner scan = new Scanner(System.in);\n while(scan.hasNext()) {\n \tlong n = scan.nextInt();\n \tlong m = scan.nextInt();\n \tlong gcd = gcd(n, m);\n \tSystem.out.println(gcd + \" \" + n * m / gcd);\n \t\n }\n\n \n\t}\n}",
"Main"
] | import java.util.*;
import java.io.*;
import java.math.*;
public class Main {
private static long gcd(long n, long m) {
// int tmp = 0;
while(n != m) {
if(n > m) {
n -= m;
}
else {
m-= n;
}
}
return n;
}
// private static int lcm(int n, int m) {
// return n*m/gcd(n, m);
// }
public static void main(String[] args) throws IOException{
Scanner scan = new Scanner(System.in);
while(scan.hasNext()) {
long n = scan.nextInt();
long m = scan.nextInt();
long gcd = gcd(n, m);
System.out.println(gcd + " " + n * m / gcd);
}
}
}
|
[
7,
15,
13,
17,
6,
13,
41,
13,
20,
12,
13,
30,
14,
2,
13,
17,
29,
4,
13,
13,
2,
13,
13,
29,
13,
23,
13,
23,
13,
12,
13,
30,
41,
13,
2,
13,
13,
41,
13,
2,
13,
13,
41,
13,
2,
2,
13,
13,
13,
29,
13,
23,
13,
23,
13,
23,
13,
12,
13,
30,
42,
4,
18,
13,
30,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
41,
13,
4,
13,
13,
13,
41,
13,
4,
13,
13,
13,
13,
4,
18,
18,
13,
13,
17,
13,
13,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
99,
5
],
[
99,
6
],
[
6,
7
],
[
6,
8
],
[
99,
9
],
[
9,
10
],
[
9,
11
],
[
11,
12
],
[
12,
13
],
[
13,
14
],
[
13,
15
],
[
12,
16
],
[
16,
17
],
[
17,
18
],
[
17,
19
],
[
17,
20
],
[
20,
21
],
[
20,
22
],
[
12,
23
],
[
23,
24
],
[
9,
25
],
[
25,
26
],
[
9,
27
],
[
27,
28
],
[
99,
29
],
[
29,
30
],
[
29,
31
],
[
31,
32
],
[
32,
33
],
[
32,
34
],
[
34,
35
],
[
34,
36
],
[
31,
37
],
[
37,
38
],
[
37,
39
],
[
39,
40
],
[
39,
41
],
[
31,
42
],
[
42,
43
],
[
42,
44
],
[
45,
45
],
[
45,
46
],
[
45,
47
],
[
45,
48
],
[
31,
49
],
[
49,
50
],
[
29,
51
],
[
51,
52
],
[
29,
53
],
[
53,
54
],
[
29,
55
],
[
55,
56
],
[
99,
57
],
[
57,
58
],
[
57,
59
],
[
59,
60
],
[
60,
61
],
[
61,
62
],
[
62,
63
],
[
60,
64
],
[
64,
65
],
[
65,
66
],
[
65,
67
],
[
67,
68
],
[
68,
69
],
[
64,
70
],
[
70,
71
],
[
70,
72
],
[
72,
73
],
[
73,
74
],
[
64,
75
],
[
75,
76
],
[
75,
77
],
[
77,
78
],
[
77,
79
],
[
77,
80
],
[
64,
81
],
[
81,
82
],
[
81,
83
],
[
83,
84
],
[
83,
85
],
[
83,
86
],
[
83,
87
],
[
64,
88
],
[
88,
89
],
[
89,
90
],
[
90,
91
],
[
90,
92
],
[
88,
93
],
[
88,
94
],
[
88,
95
],
[
57,
96
],
[
96,
97
],
[
0,
98
],
[
98,
99
],
[
98,
100
]
] | [
"import java.util.*;\n\npublic class Main{\n\tprivate static final Scanner scan = new Scanner(System.in);\n\n\tpublic static long gcd(long a, long b){\n\t\tif(b != 0) return gcd(b, a % b);\n\t\telse return a;\n\t}\n\n\tpublic static long lcm(long a, long b, long g){\n\t\tlong v = a / g;\n\t\tlong w = b / g;\n\t\tlong l = v * w * g;\n\t\treturn l;\n\t}\n\n\tpublic static void main(String[] args){\n\n\t\twhile(scan.hasNext()){\n\t\t\tlong a = scan.nextLong();\n\t\t\tlong b = scan.nextLong();\n\t\t\tlong g = gcd(a, b);\n\t\t\tlong l = lcm(a, b, g);\n\t\t\tSystem.out.printf(\"%d %d\\n\", g, l);\n\t\t}\n\t}\n}",
"import java.util.*;",
"util.*",
"java",
"public class Main{\n\tprivate static final Scanner scan = new Scanner(System.in);\n\n\tpublic static long gcd(long a, long b){\n\t\tif(b != 0) return gcd(b, a % b);\n\t\telse return a;\n\t}\n\n\tpublic static long lcm(long a, long b, long g){\n\t\tlong v = a / g;\n\t\tlong w = b / g;\n\t\tlong l = v * w * g;\n\t\treturn l;\n\t}\n\n\tpublic static void main(String[] args){\n\n\t\twhile(scan.hasNext()){\n\t\t\tlong a = scan.nextLong();\n\t\t\tlong b = scan.nextLong();\n\t\t\tlong g = gcd(a, b);\n\t\t\tlong l = lcm(a, b, g);\n\t\t\tSystem.out.printf(\"%d %d\\n\", g, l);\n\t\t}\n\t}\n}",
"Main",
"private static final Scanner scan = new Scanner(System.in);",
"scan",
"new Scanner(System.in)",
"public static long gcd(long a, long b){\n\t\tif(b != 0) return gcd(b, a % b);\n\t\telse return a;\n\t}",
"gcd",
"{\n\t\tif(b != 0) return gcd(b, a % b);\n\t\telse return a;\n\t}",
"if(b != 0) return gcd(b, a % b);\n\t\telse return a;",
"b != 0",
"b",
"0",
"return gcd(b, a % b);",
"gcd(b, a % b)",
"gcd",
"b",
"a % b",
"a",
"b",
"return a;",
"a",
"long a",
"a",
"long b",
"b",
"public static long lcm(long a, long b, long g){\n\t\tlong v = a / g;\n\t\tlong w = b / g;\n\t\tlong l = v * w * g;\n\t\treturn l;\n\t}",
"lcm",
"{\n\t\tlong v = a / g;\n\t\tlong w = b / g;\n\t\tlong l = v * w * g;\n\t\treturn l;\n\t}",
"long v = a / g;",
"v",
"a / g",
"a",
"g",
"long w = b / g;",
"w",
"b / g",
"b",
"g",
"long l = v * w * g;",
"l",
"v * w * g",
"v * w * g",
"v",
"w",
"g",
"return l;",
"l",
"long a",
"a",
"long b",
"b",
"long g",
"g",
"public static void main(String[] args){\n\n\t\twhile(scan.hasNext()){\n\t\t\tlong a = scan.nextLong();\n\t\t\tlong b = scan.nextLong();\n\t\t\tlong g = gcd(a, b);\n\t\t\tlong l = lcm(a, b, g);\n\t\t\tSystem.out.printf(\"%d %d\\n\", g, l);\n\t\t}\n\t}",
"main",
"{\n\n\t\twhile(scan.hasNext()){\n\t\t\tlong a = scan.nextLong();\n\t\t\tlong b = scan.nextLong();\n\t\t\tlong g = gcd(a, b);\n\t\t\tlong l = lcm(a, b, g);\n\t\t\tSystem.out.printf(\"%d %d\\n\", g, l);\n\t\t}\n\t}",
"while(scan.hasNext()){\n\t\t\tlong a = scan.nextLong();\n\t\t\tlong b = scan.nextLong();\n\t\t\tlong g = gcd(a, b);\n\t\t\tlong l = lcm(a, b, g);\n\t\t\tSystem.out.printf(\"%d %d\\n\", g, l);\n\t\t}",
"scan.hasNext()",
"scan.hasNext",
"scan",
"{\n\t\t\tlong a = scan.nextLong();\n\t\t\tlong b = scan.nextLong();\n\t\t\tlong g = gcd(a, b);\n\t\t\tlong l = lcm(a, b, g);\n\t\t\tSystem.out.printf(\"%d %d\\n\", g, l);\n\t\t}",
"long a = scan.nextLong();",
"a",
"scan.nextLong()",
"scan.nextLong",
"scan",
"long b = scan.nextLong();",
"b",
"scan.nextLong()",
"scan.nextLong",
"scan",
"long g = gcd(a, b);",
"g",
"gcd(a, b)",
"gcd",
"a",
"b",
"long l = lcm(a, b, g);",
"l",
"lcm(a, b, g)",
"lcm",
"a",
"b",
"g",
"System.out.printf(\"%d %d\\n\", g, l)",
"System.out.printf",
"System.out",
"System",
"System.out",
"\"%d %d\\n\"",
"g",
"l",
"String[] args",
"args",
"public class Main{\n\tprivate static final Scanner scan = new Scanner(System.in);\n\n\tpublic static long gcd(long a, long b){\n\t\tif(b != 0) return gcd(b, a % b);\n\t\telse return a;\n\t}\n\n\tpublic static long lcm(long a, long b, long g){\n\t\tlong v = a / g;\n\t\tlong w = b / g;\n\t\tlong l = v * w * g;\n\t\treturn l;\n\t}\n\n\tpublic static void main(String[] args){\n\n\t\twhile(scan.hasNext()){\n\t\t\tlong a = scan.nextLong();\n\t\t\tlong b = scan.nextLong();\n\t\t\tlong g = gcd(a, b);\n\t\t\tlong l = lcm(a, b, g);\n\t\t\tSystem.out.printf(\"%d %d\\n\", g, l);\n\t\t}\n\t}\n}",
"public class Main{\n\tprivate static final Scanner scan = new Scanner(System.in);\n\n\tpublic static long gcd(long a, long b){\n\t\tif(b != 0) return gcd(b, a % b);\n\t\telse return a;\n\t}\n\n\tpublic static long lcm(long a, long b, long g){\n\t\tlong v = a / g;\n\t\tlong w = b / g;\n\t\tlong l = v * w * g;\n\t\treturn l;\n\t}\n\n\tpublic static void main(String[] args){\n\n\t\twhile(scan.hasNext()){\n\t\t\tlong a = scan.nextLong();\n\t\t\tlong b = scan.nextLong();\n\t\t\tlong g = gcd(a, b);\n\t\t\tlong l = lcm(a, b, g);\n\t\t\tSystem.out.printf(\"%d %d\\n\", g, l);\n\t\t}\n\t}\n}",
"Main"
] | import java.util.*;
public class Main{
private static final Scanner scan = new Scanner(System.in);
public static long gcd(long a, long b){
if(b != 0) return gcd(b, a % b);
else return a;
}
public static long lcm(long a, long b, long g){
long v = a / g;
long w = b / g;
long l = v * w * g;
return l;
}
public static void main(String[] args){
while(scan.hasNext()){
long a = scan.nextLong();
long b = scan.nextLong();
long g = gcd(a, b);
long l = lcm(a, b, g);
System.out.printf("%d %d\n", g, l);
}
}
} |
[
7,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
4,
18,
13,
17,
41,
13,
17,
41,
13,
20,
42,
2,
0,
13,
4,
18,
13,
17,
30,
41,
13,
4,
18,
13,
13,
14,
40,
4,
18,
13,
3,
41,
13,
41,
13,
41,
13,
41,
13,
41,
13,
41,
13,
0,
13,
0,
13,
4,
18,
13,
4,
18,
13,
17,
0,
13,
0,
13,
4,
18,
13,
4,
18,
13,
17,
42,
2,
2,
13,
13,
17,
30,
14,
2,
13,
13,
0,
13,
13,
0,
13,
13,
0,
13,
2,
13,
13,
0,
13,
2,
2,
2,
2,
13,
13,
13,
13,
13,
4,
18,
18,
13,
13,
2,
2,
2,
17,
13,
17,
13,
4,
18,
13,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
130,
8
],
[
130,
9
],
[
9,
10
],
[
9,
11
],
[
11,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
14,
17
],
[
11,
18
],
[
18,
19
],
[
18,
20
],
[
11,
21
],
[
21,
22
],
[
21,
23
],
[
11,
24
],
[
24,
25
],
[
25,
26
],
[
26,
27
],
[
26,
28
],
[
28,
29
],
[
29,
30
],
[
25,
31
],
[
24,
32
],
[
32,
33
],
[
33,
34
],
[
33,
35
],
[
35,
36
],
[
36,
37
],
[
35,
38
],
[
32,
39
],
[
39,
40
],
[
40,
41
],
[
41,
42
],
[
42,
43
],
[
39,
44
],
[
32,
45
],
[
45,
46
],
[
32,
47
],
[
47,
48
],
[
32,
49
],
[
49,
50
],
[
32,
51
],
[
51,
52
],
[
32,
53
],
[
53,
54
],
[
32,
55
],
[
55,
56
],
[
32,
57
],
[
57,
58
],
[
57,
59
],
[
59,
60
],
[
59,
61
],
[
61,
62
],
[
62,
63
],
[
61,
64
],
[
64,
65
],
[
65,
66
],
[
64,
67
],
[
32,
68
],
[
68,
69
],
[
68,
70
],
[
70,
71
],
[
70,
72
],
[
72,
73
],
[
73,
74
],
[
72,
75
],
[
75,
76
],
[
76,
77
],
[
75,
78
],
[
32,
79
],
[
79,
80
],
[
80,
81
],
[
81,
82
],
[
81,
83
],
[
80,
84
],
[
79,
85
],
[
85,
86
],
[
86,
87
],
[
87,
88
],
[
87,
89
],
[
86,
90
],
[
90,
91
],
[
90,
92
],
[
86,
93
],
[
93,
94
],
[
93,
95
],
[
32,
96
],
[
96,
97
],
[
96,
98
],
[
98,
99
],
[
98,
100
],
[
32,
101
],
[
101,
102
],
[
101,
103
],
[
103,
104
],
[
104,
105
],
[
105,
106
],
[
106,
107
],
[
106,
108
],
[
105,
109
],
[
104,
110
],
[
103,
111
],
[
32,
112
],
[
112,
113
],
[
113,
114
],
[
114,
115
],
[
114,
116
],
[
112,
117
],
[
119,
118
],
[
118,
119
],
[
119,
120
],
[
119,
121
],
[
118,
122
],
[
119,
123
],
[
11,
124
],
[
124,
125
],
[
125,
126
],
[
9,
127
],
[
127,
128
],
[
0,
129
],
[
129,
130
],
[
129,
131
]
] | [
"import java.io.*;\nimport java.util.regex.*;\n\npublic class Main {\n\tpublic static void main(String[] args) throws IOException {\n\t\tPattern pattern = Pattern.compile(\"([0-9]+) *([0-9]+)\");\n\t\tString str = \"\";\n\t\tBufferedReader bf = new BufferedReader(new InputStreamReader(System.in));\n\t\twhile((str=bf.readLine())!=null){\n\t\t\tMatcher matcher = pattern.matcher(str);\n\t\t\tif(!matcher.matches())break;\n\t\t\tint a,b,c,d,e,f;\n\t\t\ta=c=Integer.parseInt(matcher.group(1));\n\t\t\tb=d=Integer.parseInt(matcher.group(2));\n\t\t\twhile((c*d)!=0){\n\t\t\t\tif(c>d)\n\t\t\t\t\tc%=d;\n\t\t\t\telse\n\t\t\t\t\td%=c;\n\t\t\t}\n\t\t\te=c+d;\n\t\t\tf=a/e*b/e*e;\n\t\t\tSystem.out.println(\"\"+e+\" \"+f);\n\t\t}\n\t\tbf.close();\n\t}\n}",
"import java.io.*;",
"io.*",
"java",
"import java.util.regex.*;",
"regex.*",
"java.util",
"public class Main {\n\tpublic static void main(String[] args) throws IOException {\n\t\tPattern pattern = Pattern.compile(\"([0-9]+) *([0-9]+)\");\n\t\tString str = \"\";\n\t\tBufferedReader bf = new BufferedReader(new InputStreamReader(System.in));\n\t\twhile((str=bf.readLine())!=null){\n\t\t\tMatcher matcher = pattern.matcher(str);\n\t\t\tif(!matcher.matches())break;\n\t\t\tint a,b,c,d,e,f;\n\t\t\ta=c=Integer.parseInt(matcher.group(1));\n\t\t\tb=d=Integer.parseInt(matcher.group(2));\n\t\t\twhile((c*d)!=0){\n\t\t\t\tif(c>d)\n\t\t\t\t\tc%=d;\n\t\t\t\telse\n\t\t\t\t\td%=c;\n\t\t\t}\n\t\t\te=c+d;\n\t\t\tf=a/e*b/e*e;\n\t\t\tSystem.out.println(\"\"+e+\" \"+f);\n\t\t}\n\t\tbf.close();\n\t}\n}",
"Main",
"public static void main(String[] args) throws IOException {\n\t\tPattern pattern = Pattern.compile(\"([0-9]+) *([0-9]+)\");\n\t\tString str = \"\";\n\t\tBufferedReader bf = new BufferedReader(new InputStreamReader(System.in));\n\t\twhile((str=bf.readLine())!=null){\n\t\t\tMatcher matcher = pattern.matcher(str);\n\t\t\tif(!matcher.matches())break;\n\t\t\tint a,b,c,d,e,f;\n\t\t\ta=c=Integer.parseInt(matcher.group(1));\n\t\t\tb=d=Integer.parseInt(matcher.group(2));\n\t\t\twhile((c*d)!=0){\n\t\t\t\tif(c>d)\n\t\t\t\t\tc%=d;\n\t\t\t\telse\n\t\t\t\t\td%=c;\n\t\t\t}\n\t\t\te=c+d;\n\t\t\tf=a/e*b/e*e;\n\t\t\tSystem.out.println(\"\"+e+\" \"+f);\n\t\t}\n\t\tbf.close();\n\t}",
"main",
"{\n\t\tPattern pattern = Pattern.compile(\"([0-9]+) *([0-9]+)\");\n\t\tString str = \"\";\n\t\tBufferedReader bf = new BufferedReader(new InputStreamReader(System.in));\n\t\twhile((str=bf.readLine())!=null){\n\t\t\tMatcher matcher = pattern.matcher(str);\n\t\t\tif(!matcher.matches())break;\n\t\t\tint a,b,c,d,e,f;\n\t\t\ta=c=Integer.parseInt(matcher.group(1));\n\t\t\tb=d=Integer.parseInt(matcher.group(2));\n\t\t\twhile((c*d)!=0){\n\t\t\t\tif(c>d)\n\t\t\t\t\tc%=d;\n\t\t\t\telse\n\t\t\t\t\td%=c;\n\t\t\t}\n\t\t\te=c+d;\n\t\t\tf=a/e*b/e*e;\n\t\t\tSystem.out.println(\"\"+e+\" \"+f);\n\t\t}\n\t\tbf.close();\n\t}",
"Pattern pattern = Pattern.compile(\"([0-9]+) *([0-9]+)\");",
"pattern",
"Pattern.compile(\"([0-9]+) *([0-9]+)\")",
"Pattern.compile",
"Pattern",
"\"([0-9]+) *([0-9]+)\"",
"String str = \"\";",
"str",
"\"\"",
"BufferedReader bf = new BufferedReader(new InputStreamReader(System.in));",
"bf",
"new BufferedReader(new InputStreamReader(System.in))",
"while((str=bf.readLine())!=null){\n\t\t\tMatcher matcher = pattern.matcher(str);\n\t\t\tif(!matcher.matches())break;\n\t\t\tint a,b,c,d,e,f;\n\t\t\ta=c=Integer.parseInt(matcher.group(1));\n\t\t\tb=d=Integer.parseInt(matcher.group(2));\n\t\t\twhile((c*d)!=0){\n\t\t\t\tif(c>d)\n\t\t\t\t\tc%=d;\n\t\t\t\telse\n\t\t\t\t\td%=c;\n\t\t\t}\n\t\t\te=c+d;\n\t\t\tf=a/e*b/e*e;\n\t\t\tSystem.out.println(\"\"+e+\" \"+f);\n\t\t}",
"(str=bf.readLine())!=null",
"(str=bf.readLine())",
"str",
"bf.readLine()",
"bf.readLine",
"bf",
"null",
"{\n\t\t\tMatcher matcher = pattern.matcher(str);\n\t\t\tif(!matcher.matches())break;\n\t\t\tint a,b,c,d,e,f;\n\t\t\ta=c=Integer.parseInt(matcher.group(1));\n\t\t\tb=d=Integer.parseInt(matcher.group(2));\n\t\t\twhile((c*d)!=0){\n\t\t\t\tif(c>d)\n\t\t\t\t\tc%=d;\n\t\t\t\telse\n\t\t\t\t\td%=c;\n\t\t\t}\n\t\t\te=c+d;\n\t\t\tf=a/e*b/e*e;\n\t\t\tSystem.out.println(\"\"+e+\" \"+f);\n\t\t}",
"Matcher matcher = pattern.matcher(str);",
"matcher",
"pattern.matcher(str)",
"pattern.matcher",
"pattern",
"str",
"if(!matcher.matches())break;",
"!matcher.matches()",
"matcher.matches()",
"matcher.matches",
"matcher",
"break;",
"int a",
"a",
"b",
"b",
"c",
"c",
"d",
"d",
"e",
"e",
"f;",
"f",
"a=c=Integer.parseInt(matcher.group(1))",
"a",
"c=Integer.parseInt(matcher.group(1))",
"c",
"Integer.parseInt(matcher.group(1))",
"Integer.parseInt",
"Integer",
"matcher.group(1)",
"matcher.group",
"matcher",
"1",
"b=d=Integer.parseInt(matcher.group(2))",
"b",
"d=Integer.parseInt(matcher.group(2))",
"d",
"Integer.parseInt(matcher.group(2))",
"Integer.parseInt",
"Integer",
"matcher.group(2)",
"matcher.group",
"matcher",
"2",
"while((c*d)!=0){\n\t\t\t\tif(c>d)\n\t\t\t\t\tc%=d;\n\t\t\t\telse\n\t\t\t\t\td%=c;\n\t\t\t}",
"(c*d)!=0",
"(c*d)",
"c",
"d",
"0",
"{\n\t\t\t\tif(c>d)\n\t\t\t\t\tc%=d;\n\t\t\t\telse\n\t\t\t\t\td%=c;\n\t\t\t}",
"if(c>d)\n\t\t\t\t\tc%=d;\n\t\t\t\telse\n\t\t\t\t\td%=c;",
"c>d",
"c",
"d",
"c%=d",
"c",
"d",
"d%=c",
"d",
"c",
"e=c+d",
"e",
"c+d",
"c",
"d",
"f=a/e*b/e*e",
"f",
"a/e*b/e*e",
"a/e*b/e",
"a/e*b",
"a/e",
"a",
"e",
"b",
"e",
"e",
"System.out.println(\"\"+e+\" \"+f)",
"System.out.println",
"System.out",
"System",
"System.out",
"\"\"+e+\" \"+f",
"\" \"",
"\"\"+e+\" \"+f",
"\"\"",
"e",
"\" \"",
"f",
"bf.close()",
"bf.close",
"bf",
"String[] args",
"args",
"public class Main {\n\tpublic static void main(String[] args) throws IOException {\n\t\tPattern pattern = Pattern.compile(\"([0-9]+) *([0-9]+)\");\n\t\tString str = \"\";\n\t\tBufferedReader bf = new BufferedReader(new InputStreamReader(System.in));\n\t\twhile((str=bf.readLine())!=null){\n\t\t\tMatcher matcher = pattern.matcher(str);\n\t\t\tif(!matcher.matches())break;\n\t\t\tint a,b,c,d,e,f;\n\t\t\ta=c=Integer.parseInt(matcher.group(1));\n\t\t\tb=d=Integer.parseInt(matcher.group(2));\n\t\t\twhile((c*d)!=0){\n\t\t\t\tif(c>d)\n\t\t\t\t\tc%=d;\n\t\t\t\telse\n\t\t\t\t\td%=c;\n\t\t\t}\n\t\t\te=c+d;\n\t\t\tf=a/e*b/e*e;\n\t\t\tSystem.out.println(\"\"+e+\" \"+f);\n\t\t}\n\t\tbf.close();\n\t}\n}",
"public class Main {\n\tpublic static void main(String[] args) throws IOException {\n\t\tPattern pattern = Pattern.compile(\"([0-9]+) *([0-9]+)\");\n\t\tString str = \"\";\n\t\tBufferedReader bf = new BufferedReader(new InputStreamReader(System.in));\n\t\twhile((str=bf.readLine())!=null){\n\t\t\tMatcher matcher = pattern.matcher(str);\n\t\t\tif(!matcher.matches())break;\n\t\t\tint a,b,c,d,e,f;\n\t\t\ta=c=Integer.parseInt(matcher.group(1));\n\t\t\tb=d=Integer.parseInt(matcher.group(2));\n\t\t\twhile((c*d)!=0){\n\t\t\t\tif(c>d)\n\t\t\t\t\tc%=d;\n\t\t\t\telse\n\t\t\t\t\td%=c;\n\t\t\t}\n\t\t\te=c+d;\n\t\t\tf=a/e*b/e*e;\n\t\t\tSystem.out.println(\"\"+e+\" \"+f);\n\t\t}\n\t\tbf.close();\n\t}\n}",
"Main"
] | import java.io.*;
import java.util.regex.*;
public class Main {
public static void main(String[] args) throws IOException {
Pattern pattern = Pattern.compile("([0-9]+) *([0-9]+)");
String str = "";
BufferedReader bf = new BufferedReader(new InputStreamReader(System.in));
while((str=bf.readLine())!=null){
Matcher matcher = pattern.matcher(str);
if(!matcher.matches())break;
int a,b,c,d,e,f;
a=c=Integer.parseInt(matcher.group(1));
b=d=Integer.parseInt(matcher.group(2));
while((c*d)!=0){
if(c>d)
c%=d;
else
d%=c;
}
e=c+d;
f=a/e*b/e*e;
System.out.println(""+e+" "+f);
}
bf.close();
}
} |
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
42,
4,
18,
13,
30,
41,
13,
4,
18,
13,
4,
18,
13,
41,
13,
4,
18,
13,
4,
18,
13,
41,
13,
4,
13,
13,
13,
4,
18,
18,
13,
13,
2,
2,
13,
17,
2,
2,
13,
13,
13,
23,
13,
12,
13,
30,
14,
2,
13,
13,
30,
0,
13,
13,
0,
13,
13,
0,
13,
13,
42,
2,
13,
17,
30,
41,
13,
2,
13,
13,
0,
13,
13,
0,
13,
13,
29,
13,
23,
13,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
95,
5
],
[
95,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
13,
14
],
[
14,
15
],
[
12,
16
],
[
16,
17
],
[
17,
18
],
[
17,
19
],
[
19,
20
],
[
20,
21
],
[
19,
22
],
[
22,
23
],
[
23,
24
],
[
16,
25
],
[
25,
26
],
[
25,
27
],
[
27,
28
],
[
28,
29
],
[
27,
30
],
[
30,
31
],
[
31,
32
],
[
16,
33
],
[
33,
34
],
[
33,
35
],
[
35,
36
],
[
35,
37
],
[
35,
38
],
[
16,
39
],
[
39,
40
],
[
40,
41
],
[
41,
42
],
[
41,
43
],
[
39,
44
],
[
45,
45
],
[
45,
46
],
[
45,
47
],
[
45,
48
],
[
48,
49
],
[
49,
50
],
[
49,
51
],
[
48,
52
],
[
6,
53
],
[
53,
54
],
[
95,
55
],
[
55,
56
],
[
55,
57
],
[
57,
58
],
[
58,
59
],
[
59,
60
],
[
59,
61
],
[
58,
62
],
[
62,
63
],
[
63,
64
],
[
63,
65
],
[
62,
66
],
[
66,
67
],
[
66,
68
],
[
62,
69
],
[
69,
70
],
[
69,
71
],
[
57,
72
],
[
72,
73
],
[
73,
74
],
[
73,
75
],
[
72,
76
],
[
76,
77
],
[
77,
78
],
[
77,
79
],
[
79,
80
],
[
79,
81
],
[
76,
82
],
[
82,
83
],
[
82,
84
],
[
76,
85
],
[
85,
86
],
[
85,
87
],
[
57,
88
],
[
88,
89
],
[
55,
90
],
[
90,
91
],
[
55,
92
],
[
92,
93
],
[
0,
94
],
[
94,
95
],
[
94,
96
]
] | [
"import java.util.Scanner;\n\npublic class Main {\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n\n while(sc.hasNext()) {\n long a = Long.parseLong(sc.next());\n long b = Long.parseLong(sc.next());\n long g = gcd(a, b);\n\n System.out.println(g + \" \" + (a / g * b));\n }\n }\n\n private static long gcd(long a, long b) {\n if (a < b) {\n a ^= b;\n b ^= a;\n a ^= b;\n }\n \n while (b != 0) {\n long r = a % b;\n a = b;\n b = r;\n }\n \n return a;\n }\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n\n while(sc.hasNext()) {\n long a = Long.parseLong(sc.next());\n long b = Long.parseLong(sc.next());\n long g = gcd(a, b);\n\n System.out.println(g + \" \" + (a / g * b));\n }\n }\n\n private static long gcd(long a, long b) {\n if (a < b) {\n a ^= b;\n b ^= a;\n a ^= b;\n }\n \n while (b != 0) {\n long r = a % b;\n a = b;\n b = r;\n }\n \n return a;\n }\n}",
"Main",
"public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n\n while(sc.hasNext()) {\n long a = Long.parseLong(sc.next());\n long b = Long.parseLong(sc.next());\n long g = gcd(a, b);\n\n System.out.println(g + \" \" + (a / g * b));\n }\n }",
"main",
"{\n Scanner sc = new Scanner(System.in);\n\n while(sc.hasNext()) {\n long a = Long.parseLong(sc.next());\n long b = Long.parseLong(sc.next());\n long g = gcd(a, b);\n\n System.out.println(g + \" \" + (a / g * b));\n }\n }",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"while(sc.hasNext()) {\n long a = Long.parseLong(sc.next());\n long b = Long.parseLong(sc.next());\n long g = gcd(a, b);\n\n System.out.println(g + \" \" + (a / g * b));\n }",
"sc.hasNext()",
"sc.hasNext",
"sc",
"{\n long a = Long.parseLong(sc.next());\n long b = Long.parseLong(sc.next());\n long g = gcd(a, b);\n\n System.out.println(g + \" \" + (a / g * b));\n }",
"long a = Long.parseLong(sc.next());",
"a",
"Long.parseLong(sc.next())",
"Long.parseLong",
"Long",
"sc.next()",
"sc.next",
"sc",
"long b = Long.parseLong(sc.next());",
"b",
"Long.parseLong(sc.next())",
"Long.parseLong",
"Long",
"sc.next()",
"sc.next",
"sc",
"long g = gcd(a, b);",
"g",
"gcd(a, b)",
"gcd",
"a",
"b",
"System.out.println(g + \" \" + (a / g * b))",
"System.out.println",
"System.out",
"System",
"System.out",
"g + \" \" + (a / g * b)",
"g + \" \" + (a / g * b)",
"g",
"\" \"",
"(a / g * b)",
"a / g",
"a",
"g",
"b",
"String[] args",
"args",
"private static long gcd(long a, long b) {\n if (a < b) {\n a ^= b;\n b ^= a;\n a ^= b;\n }\n \n while (b != 0) {\n long r = a % b;\n a = b;\n b = r;\n }\n \n return a;\n }",
"gcd",
"{\n if (a < b) {\n a ^= b;\n b ^= a;\n a ^= b;\n }\n \n while (b != 0) {\n long r = a % b;\n a = b;\n b = r;\n }\n \n return a;\n }",
"if (a < b) {\n a ^= b;\n b ^= a;\n a ^= b;\n }",
"a < b",
"a",
"b",
"{\n a ^= b;\n b ^= a;\n a ^= b;\n }",
"a ^= b",
"a",
"b",
"b ^= a",
"b",
"a",
"a ^= b",
"a",
"b",
"while (b != 0) {\n long r = a % b;\n a = b;\n b = r;\n }",
"b != 0",
"b",
"0",
"{\n long r = a % b;\n a = b;\n b = r;\n }",
"long r = a % b;",
"r",
"a % b",
"a",
"b",
"a = b",
"a",
"b",
"b = r",
"b",
"r",
"return a;",
"a",
"long a",
"a",
"long b",
"b",
"public class Main {\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n\n while(sc.hasNext()) {\n long a = Long.parseLong(sc.next());\n long b = Long.parseLong(sc.next());\n long g = gcd(a, b);\n\n System.out.println(g + \" \" + (a / g * b));\n }\n }\n\n private static long gcd(long a, long b) {\n if (a < b) {\n a ^= b;\n b ^= a;\n a ^= b;\n }\n \n while (b != 0) {\n long r = a % b;\n a = b;\n b = r;\n }\n \n return a;\n }\n}",
"public class Main {\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n\n while(sc.hasNext()) {\n long a = Long.parseLong(sc.next());\n long b = Long.parseLong(sc.next());\n long g = gcd(a, b);\n\n System.out.println(g + \" \" + (a / g * b));\n }\n }\n\n private static long gcd(long a, long b) {\n if (a < b) {\n a ^= b;\n b ^= a;\n a ^= b;\n }\n \n while (b != 0) {\n long r = a % b;\n a = b;\n b = r;\n }\n \n return a;\n }\n}",
"Main"
] | import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
while(sc.hasNext()) {
long a = Long.parseLong(sc.next());
long b = Long.parseLong(sc.next());
long g = gcd(a, b);
System.out.println(g + " " + (a / g * b));
}
}
private static long gcd(long a, long b) {
if (a < b) {
a ^= b;
b ^= a;
a ^= b;
}
while (b != 0) {
long r = a % b;
a = b;
b = r;
}
return a;
}
} |
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
42,
4,
18,
13,
30,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
41,
13,
4,
13,
13,
13,
41,
13,
2,
2,
13,
13,
13,
4,
18,
18,
13,
13,
2,
2,
13,
17,
13,
23,
13,
12,
13,
30,
14,
2,
13,
17,
30,
29,
13,
29,
4,
13,
13,
2,
13,
13,
23,
13,
23,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
13,
14
],
[
14,
15
],
[
12,
16
],
[
16,
17
],
[
17,
18
],
[
17,
19
],
[
19,
20
],
[
20,
21
],
[
16,
22
],
[
22,
23
],
[
22,
24
],
[
24,
25
],
[
25,
26
],
[
16,
27
],
[
27,
28
],
[
27,
29
],
[
29,
30
],
[
29,
31
],
[
29,
32
],
[
16,
33
],
[
33,
34
],
[
33,
35
],
[
35,
36
],
[
36,
37
],
[
36,
38
],
[
35,
39
],
[
16,
40
],
[
40,
41
],
[
41,
42
],
[
42,
43
],
[
42,
44
],
[
40,
45
],
[
46,
46
],
[
46,
47
],
[
46,
48
],
[
46,
49
],
[
6,
50
],
[
50,
51
],
[
4,
52
],
[
52,
53
],
[
52,
54
],
[
54,
55
],
[
55,
56
],
[
56,
57
],
[
56,
58
],
[
55,
59
],
[
59,
60
],
[
60,
61
],
[
54,
62
],
[
62,
63
],
[
63,
64
],
[
63,
65
],
[
63,
66
],
[
66,
67
],
[
66,
68
],
[
52,
69
],
[
69,
70
],
[
52,
71
],
[
71,
72
]
] | [
"import java.util.*;\n\nclass Main {\n public static void main(String[] args) {\n Scanner input = new Scanner(System.in);\n\n while (input.hasNext()) {\n int a = input.nextInt();\n int b = input.nextInt();\n int gcd = GCD(a, b);\n int lcm = a / gcd * b;\n\n System.out.println(gcd + \" \" + lcm);\n }\n }\n \n public static int GCD (int a, int b) {\n if (b == 0) {\n return a;\n }\n return GCD(b, a % b);\n }\n}",
"import java.util.*;",
"util.*",
"java",
"class Main {\n public static void main(String[] args) {\n Scanner input = new Scanner(System.in);\n\n while (input.hasNext()) {\n int a = input.nextInt();\n int b = input.nextInt();\n int gcd = GCD(a, b);\n int lcm = a / gcd * b;\n\n System.out.println(gcd + \" \" + lcm);\n }\n }\n \n public static int GCD (int a, int b) {\n if (b == 0) {\n return a;\n }\n return GCD(b, a % b);\n }\n}",
"Main",
"public static void main(String[] args) {\n Scanner input = new Scanner(System.in);\n\n while (input.hasNext()) {\n int a = input.nextInt();\n int b = input.nextInt();\n int gcd = GCD(a, b);\n int lcm = a / gcd * b;\n\n System.out.println(gcd + \" \" + lcm);\n }\n }",
"main",
"{\n Scanner input = new Scanner(System.in);\n\n while (input.hasNext()) {\n int a = input.nextInt();\n int b = input.nextInt();\n int gcd = GCD(a, b);\n int lcm = a / gcd * b;\n\n System.out.println(gcd + \" \" + lcm);\n }\n }",
"Scanner input = new Scanner(System.in);",
"input",
"new Scanner(System.in)",
"while (input.hasNext()) {\n int a = input.nextInt();\n int b = input.nextInt();\n int gcd = GCD(a, b);\n int lcm = a / gcd * b;\n\n System.out.println(gcd + \" \" + lcm);\n }",
"input.hasNext()",
"input.hasNext",
"input",
"{\n int a = input.nextInt();\n int b = input.nextInt();\n int gcd = GCD(a, b);\n int lcm = a / gcd * b;\n\n System.out.println(gcd + \" \" + lcm);\n }",
"int a = input.nextInt();",
"a",
"input.nextInt()",
"input.nextInt",
"input",
"int b = input.nextInt();",
"b",
"input.nextInt()",
"input.nextInt",
"input",
"int gcd = GCD(a, b);",
"gcd",
"GCD(a, b)",
"GCD",
"a",
"b",
"int lcm = a / gcd * b;",
"lcm",
"a / gcd * b",
"a / gcd",
"a",
"gcd",
"b",
"System.out.println(gcd + \" \" + lcm)",
"System.out.println",
"System.out",
"System",
"System.out",
"gcd + \" \" + lcm",
"gcd + \" \" + lcm",
"gcd",
"\" \"",
"lcm",
"String[] args",
"args",
"public static int GCD (int a, int b) {\n if (b == 0) {\n return a;\n }\n return GCD(b, a % b);\n }",
"GCD",
"{\n if (b == 0) {\n return a;\n }\n return GCD(b, a % b);\n }",
"if (b == 0) {\n return a;\n }",
"b == 0",
"b",
"0",
"{\n return a;\n }",
"return a;",
"a",
"return GCD(b, a % b);",
"GCD(b, a % b)",
"GCD",
"b",
"a % b",
"a",
"b",
"int a",
"a",
"int b",
"b"
] | import java.util.*;
class Main {
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
while (input.hasNext()) {
int a = input.nextInt();
int b = input.nextInt();
int gcd = GCD(a, b);
int lcm = a / gcd * b;
System.out.println(gcd + " " + lcm);
}
}
public static int GCD (int a, int b) {
if (b == 0) {
return a;
}
return GCD(b, a % b);
}
} |
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
20,
17,
42,
4,
18,
13,
30,
11,
1,
41,
13,
17,
2,
13,
17,
1,
40,
13,
30,
0,
18,
13,
13,
4,
18,
13,
41,
13,
17,
4,
18,
13,
13,
11,
1,
41,
13,
17,
2,
13,
18,
13,
17,
1,
40,
13,
30,
30,
14,
2,
2,
2,
18,
13,
17,
13,
17,
2,
2,
18,
13,
17,
13,
17,
0,
13,
13,
41,
13,
18,
13,
17,
41,
13,
17,
41,
13,
17,
42,
13,
30,
14,
2,
2,
2,
2,
13,
13,
18,
13,
17,
17,
2,
2,
2,
13,
13,
18,
13,
17,
17,
30,
0,
13,
2,
13,
13,
0,
13,
17,
40,
13,
4,
18,
18,
13,
13,
2,
2,
13,
17,
13,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
139,
5
],
[
139,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
8,
16
],
[
16,
17
],
[
17,
18
],
[
18,
19
],
[
16,
20
],
[
20,
21
],
[
21,
22
],
[
22,
23
],
[
23,
24
],
[
23,
25
],
[
21,
26
],
[
26,
27
],
[
26,
28
],
[
21,
29
],
[
29,
30
],
[
30,
31
],
[
21,
32
],
[
32,
33
],
[
33,
34
],
[
34,
35
],
[
34,
36
],
[
33,
37
],
[
37,
38
],
[
38,
39
],
[
20,
40
],
[
40,
41
],
[
40,
42
],
[
20,
43
],
[
43,
44
],
[
44,
45
],
[
43,
46
],
[
20,
47
],
[
47,
48
],
[
48,
49
],
[
49,
50
],
[
49,
51
],
[
47,
52
],
[
52,
53
],
[
52,
54
],
[
54,
55
],
[
54,
56
],
[
47,
57
],
[
57,
58
],
[
58,
59
],
[
47,
60
],
[
61,
61
],
[
61,
62
],
[
62,
63
],
[
63,
64
],
[
64,
65
],
[
65,
66
],
[
66,
67
],
[
66,
68
],
[
65,
69
],
[
64,
70
],
[
63,
71
],
[
71,
72
],
[
72,
73
],
[
73,
74
],
[
73,
75
],
[
72,
76
],
[
71,
77
],
[
62,
78
],
[
78,
79
],
[
78,
80
],
[
20,
81
],
[
81,
82
],
[
81,
83
],
[
83,
84
],
[
83,
85
],
[
20,
86
],
[
86,
87
],
[
86,
88
],
[
20,
89
],
[
89,
90
],
[
89,
91
],
[
20,
92
],
[
92,
93
],
[
92,
94
],
[
94,
95
],
[
95,
96
],
[
96,
97
],
[
97,
98
],
[
98,
99
],
[
99,
100
],
[
99,
101
],
[
98,
102
],
[
102,
103
],
[
102,
104
],
[
97,
105
],
[
96,
106
],
[
106,
107
],
[
107,
108
],
[
108,
109
],
[
108,
110
],
[
107,
111
],
[
111,
112
],
[
111,
113
],
[
106,
114
],
[
95,
115
],
[
115,
116
],
[
116,
117
],
[
116,
118
],
[
118,
119
],
[
118,
120
],
[
115,
121
],
[
121,
122
],
[
121,
123
],
[
94,
124
],
[
124,
125
],
[
20,
126
],
[
126,
127
],
[
127,
128
],
[
128,
129
],
[
128,
130
],
[
126,
131
],
[
132,
132
],
[
132,
133
],
[
132,
134
],
[
132,
135
],
[
6,
136
],
[
136,
137
],
[
0,
138
],
[
138,
139
],
[
138,
140
]
] | [
"import java.util.*;\npublic class Main {\n\n public static void main(String[] args) {\n Scanner s = new Scanner(System.in);\n int[] a = new int[2];\n while(s.hasNext()){\n for(int i=0; i < 2; i++)\n a[i] = s.nextInt();\n int gcd = 1;\n Arrays.sort(a);\n for(int j=2; j<=a[0];j++){\n if ((a[0]%j == 0) && (a[1]%j == 0))\n gcd = j; \n }\n int lcm =a[1];\n int k = 1;\n boolean b = true;\n \n while(b){\n if((gcd*k)%a[0]==0 && (gcd*k)%a[1]==0){\n lcm = gcd*k;\n b = false;\n }\n k++;\n }\n System.out.println(gcd + \" \" + lcm);\n }\n \n }\n}",
"import java.util.*;",
"util.*",
"java",
"public class Main {\n\n public static void main(String[] args) {\n Scanner s = new Scanner(System.in);\n int[] a = new int[2];\n while(s.hasNext()){\n for(int i=0; i < 2; i++)\n a[i] = s.nextInt();\n int gcd = 1;\n Arrays.sort(a);\n for(int j=2; j<=a[0];j++){\n if ((a[0]%j == 0) && (a[1]%j == 0))\n gcd = j; \n }\n int lcm =a[1];\n int k = 1;\n boolean b = true;\n \n while(b){\n if((gcd*k)%a[0]==0 && (gcd*k)%a[1]==0){\n lcm = gcd*k;\n b = false;\n }\n k++;\n }\n System.out.println(gcd + \" \" + lcm);\n }\n \n }\n}",
"Main",
"public static void main(String[] args) {\n Scanner s = new Scanner(System.in);\n int[] a = new int[2];\n while(s.hasNext()){\n for(int i=0; i < 2; i++)\n a[i] = s.nextInt();\n int gcd = 1;\n Arrays.sort(a);\n for(int j=2; j<=a[0];j++){\n if ((a[0]%j == 0) && (a[1]%j == 0))\n gcd = j; \n }\n int lcm =a[1];\n int k = 1;\n boolean b = true;\n \n while(b){\n if((gcd*k)%a[0]==0 && (gcd*k)%a[1]==0){\n lcm = gcd*k;\n b = false;\n }\n k++;\n }\n System.out.println(gcd + \" \" + lcm);\n }\n \n }",
"main",
"{\n Scanner s = new Scanner(System.in);\n int[] a = new int[2];\n while(s.hasNext()){\n for(int i=0; i < 2; i++)\n a[i] = s.nextInt();\n int gcd = 1;\n Arrays.sort(a);\n for(int j=2; j<=a[0];j++){\n if ((a[0]%j == 0) && (a[1]%j == 0))\n gcd = j; \n }\n int lcm =a[1];\n int k = 1;\n boolean b = true;\n \n while(b){\n if((gcd*k)%a[0]==0 && (gcd*k)%a[1]==0){\n lcm = gcd*k;\n b = false;\n }\n k++;\n }\n System.out.println(gcd + \" \" + lcm);\n }\n \n }",
"Scanner s = new Scanner(System.in);",
"s",
"new Scanner(System.in)",
"int[] a = new int[2];",
"a",
"new int[2]",
"2",
"while(s.hasNext()){\n for(int i=0; i < 2; i++)\n a[i] = s.nextInt();\n int gcd = 1;\n Arrays.sort(a);\n for(int j=2; j<=a[0];j++){\n if ((a[0]%j == 0) && (a[1]%j == 0))\n gcd = j; \n }\n int lcm =a[1];\n int k = 1;\n boolean b = true;\n \n while(b){\n if((gcd*k)%a[0]==0 && (gcd*k)%a[1]==0){\n lcm = gcd*k;\n b = false;\n }\n k++;\n }\n System.out.println(gcd + \" \" + lcm);\n }",
"s.hasNext()",
"s.hasNext",
"s",
"{\n for(int i=0; i < 2; i++)\n a[i] = s.nextInt();\n int gcd = 1;\n Arrays.sort(a);\n for(int j=2; j<=a[0];j++){\n if ((a[0]%j == 0) && (a[1]%j == 0))\n gcd = j; \n }\n int lcm =a[1];\n int k = 1;\n boolean b = true;\n \n while(b){\n if((gcd*k)%a[0]==0 && (gcd*k)%a[1]==0){\n lcm = gcd*k;\n b = false;\n }\n k++;\n }\n System.out.println(gcd + \" \" + lcm);\n }",
"for(int i=0; i < 2; i++)\n a[i] = s.nextInt();",
"int i=0;",
"int i=0;",
"i",
"0",
"i < 2",
"i",
"2",
"i++",
"i++",
"i",
"a[i] = s.nextInt();",
"a[i] = s.nextInt()",
"a[i]",
"a",
"i",
"s.nextInt()",
"s.nextInt",
"s",
"int gcd = 1;",
"gcd",
"1",
"Arrays.sort(a)",
"Arrays.sort",
"Arrays",
"a",
"for(int j=2; j<=a[0];j++){\n if ((a[0]%j == 0) && (a[1]%j == 0))\n gcd = j; \n }",
"int j=2;",
"int j=2;",
"j",
"2",
"j<=a[0]",
"j",
"a[0]",
"a",
"0",
"j++",
"j++",
"j",
"{\n if ((a[0]%j == 0) && (a[1]%j == 0))\n gcd = j; \n }",
"{\n if ((a[0]%j == 0) && (a[1]%j == 0))\n gcd = j; \n }",
"if ((a[0]%j == 0) && (a[1]%j == 0))\n gcd = j;",
"(a[0]%j == 0) && (a[1]%j == 0)",
"(a[0]%j == 0)",
"a[0]%j",
"a[0]",
"a",
"0",
"j",
"0",
"(a[1]%j == 0)",
"a[1]%j",
"a[1]",
"a",
"1",
"j",
"0",
"gcd = j",
"gcd",
"j",
"int lcm =a[1];",
"lcm",
"a[1]",
"a",
"1",
"int k = 1;",
"k",
"1",
"boolean b = true;",
"b",
"true",
"while(b){\n if((gcd*k)%a[0]==0 && (gcd*k)%a[1]==0){\n lcm = gcd*k;\n b = false;\n }\n k++;\n }",
"b",
"{\n if((gcd*k)%a[0]==0 && (gcd*k)%a[1]==0){\n lcm = gcd*k;\n b = false;\n }\n k++;\n }",
"if((gcd*k)%a[0]==0 && (gcd*k)%a[1]==0){\n lcm = gcd*k;\n b = false;\n }",
"(gcd*k)%a[0]==0 && (gcd*k)%a[1]==0",
"(gcd*k)%a[0]==0",
"(gcd*k)%a[0]",
"(gcd*k)",
"gcd",
"k",
"a[0]",
"a",
"0",
"0",
"(gcd*k)%a[1]==0",
"(gcd*k)%a[1]",
"(gcd*k)",
"gcd",
"k",
"a[1]",
"a",
"1",
"0",
"{\n lcm = gcd*k;\n b = false;\n }",
"lcm = gcd*k",
"lcm",
"gcd*k",
"gcd",
"k",
"b = false",
"b",
"false",
"k++",
"k",
"System.out.println(gcd + \" \" + lcm)",
"System.out.println",
"System.out",
"System",
"System.out",
"gcd + \" \" + lcm",
"gcd + \" \" + lcm",
"gcd",
"\" \"",
"lcm",
"String[] args",
"args",
"public class Main {\n\n public static void main(String[] args) {\n Scanner s = new Scanner(System.in);\n int[] a = new int[2];\n while(s.hasNext()){\n for(int i=0; i < 2; i++)\n a[i] = s.nextInt();\n int gcd = 1;\n Arrays.sort(a);\n for(int j=2; j<=a[0];j++){\n if ((a[0]%j == 0) && (a[1]%j == 0))\n gcd = j; \n }\n int lcm =a[1];\n int k = 1;\n boolean b = true;\n \n while(b){\n if((gcd*k)%a[0]==0 && (gcd*k)%a[1]==0){\n lcm = gcd*k;\n b = false;\n }\n k++;\n }\n System.out.println(gcd + \" \" + lcm);\n }\n \n }\n}",
"public class Main {\n\n public static void main(String[] args) {\n Scanner s = new Scanner(System.in);\n int[] a = new int[2];\n while(s.hasNext()){\n for(int i=0; i < 2; i++)\n a[i] = s.nextInt();\n int gcd = 1;\n Arrays.sort(a);\n for(int j=2; j<=a[0];j++){\n if ((a[0]%j == 0) && (a[1]%j == 0))\n gcd = j; \n }\n int lcm =a[1];\n int k = 1;\n boolean b = true;\n \n while(b){\n if((gcd*k)%a[0]==0 && (gcd*k)%a[1]==0){\n lcm = gcd*k;\n b = false;\n }\n k++;\n }\n System.out.println(gcd + \" \" + lcm);\n }\n \n }\n}",
"Main"
] | import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner s = new Scanner(System.in);
int[] a = new int[2];
while(s.hasNext()){
for(int i=0; i < 2; i++)
a[i] = s.nextInt();
int gcd = 1;
Arrays.sort(a);
for(int j=2; j<=a[0];j++){
if ((a[0]%j == 0) && (a[1]%j == 0))
gcd = j;
}
int lcm =a[1];
int k = 1;
boolean b = true;
while(b){
if((gcd*k)%a[0]==0 && (gcd*k)%a[1]==0){
lcm = gcd*k;
b = false;
}
k++;
}
System.out.println(gcd + " " + lcm);
}
}
} |
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
17,
41,
13,
17,
41,
13,
17,
41,
13,
17,
41,
13,
17,
42,
4,
18,
13,
30,
0,
13,
4,
18,
13,
0,
13,
4,
18,
13,
14,
2,
13,
13,
30,
0,
13,
13,
0,
13,
13,
30,
0,
13,
13,
0,
13,
13,
42,
17,
30,
14,
2,
0,
13,
2,
13,
13,
17,
30,
3,
0,
13,
13,
0,
13,
13,
4,
18,
18,
13,
13,
2,
2,
13,
17,
2,
2,
13,
13,
13,
23,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
8,
15
],
[
15,
16
],
[
15,
17
],
[
8,
18
],
[
18,
19
],
[
18,
20
],
[
8,
21
],
[
21,
22
],
[
21,
23
],
[
8,
24
],
[
24,
25
],
[
24,
26
],
[
8,
27
],
[
27,
28
],
[
28,
29
],
[
29,
30
],
[
27,
31
],
[
31,
32
],
[
32,
33
],
[
32,
34
],
[
34,
35
],
[
35,
36
],
[
31,
37
],
[
37,
38
],
[
37,
39
],
[
39,
40
],
[
40,
41
],
[
31,
42
],
[
42,
43
],
[
43,
44
],
[
43,
45
],
[
42,
46
],
[
46,
47
],
[
47,
48
],
[
47,
49
],
[
46,
50
],
[
50,
51
],
[
50,
52
],
[
42,
53
],
[
53,
54
],
[
54,
55
],
[
54,
56
],
[
53,
57
],
[
57,
58
],
[
57,
59
],
[
31,
60
],
[
60,
61
],
[
60,
62
],
[
62,
63
],
[
63,
64
],
[
64,
65
],
[
65,
66
],
[
65,
67
],
[
67,
68
],
[
67,
69
],
[
64,
70
],
[
63,
71
],
[
71,
72
],
[
62,
73
],
[
73,
74
],
[
73,
75
],
[
62,
76
],
[
76,
77
],
[
76,
78
],
[
31,
79
],
[
79,
80
],
[
80,
81
],
[
81,
82
],
[
81,
83
],
[
79,
84
],
[
85,
85
],
[
85,
86
],
[
85,
87
],
[
85,
88
],
[
88,
89
],
[
89,
90
],
[
89,
91
],
[
88,
92
],
[
6,
93
],
[
93,
94
]
] | [
"import java.util.Scanner;\nclass Main{\n\tpublic static void main(String[] args){\n\t\tScanner scan = new Scanner(System.in);\n\t\tint a=0,b=0,m=0,n=0,t=0;\n\t\twhile(scan.hasNext()){\n\t\t\ta = scan.nextInt();\n\t\t\tb = scan.nextInt();\n\t\t\tif(a < b){\n\t\t\t\tm = b;\n\t\t\t\tn = a;\n\t\t\t}else{\n\t\t\t\tm = a;\n\t\t\t\tn = b;\n\t\t\t}\n\t\t\twhile(true){\n\t\t\t\tif((t=m % n) == 0){\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tm = n;\n\t\t\t\tn = t;\n\t\t\t}\n\t\t\tSystem.out.println(n + \" \" + a/n*b);\n\t\t}\n\t}\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"class Main{\n\tpublic static void main(String[] args){\n\t\tScanner scan = new Scanner(System.in);\n\t\tint a=0,b=0,m=0,n=0,t=0;\n\t\twhile(scan.hasNext()){\n\t\t\ta = scan.nextInt();\n\t\t\tb = scan.nextInt();\n\t\t\tif(a < b){\n\t\t\t\tm = b;\n\t\t\t\tn = a;\n\t\t\t}else{\n\t\t\t\tm = a;\n\t\t\t\tn = b;\n\t\t\t}\n\t\t\twhile(true){\n\t\t\t\tif((t=m % n) == 0){\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tm = n;\n\t\t\t\tn = t;\n\t\t\t}\n\t\t\tSystem.out.println(n + \" \" + a/n*b);\n\t\t}\n\t}\n}",
"Main",
"public static void main(String[] args){\n\t\tScanner scan = new Scanner(System.in);\n\t\tint a=0,b=0,m=0,n=0,t=0;\n\t\twhile(scan.hasNext()){\n\t\t\ta = scan.nextInt();\n\t\t\tb = scan.nextInt();\n\t\t\tif(a < b){\n\t\t\t\tm = b;\n\t\t\t\tn = a;\n\t\t\t}else{\n\t\t\t\tm = a;\n\t\t\t\tn = b;\n\t\t\t}\n\t\t\twhile(true){\n\t\t\t\tif((t=m % n) == 0){\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tm = n;\n\t\t\t\tn = t;\n\t\t\t}\n\t\t\tSystem.out.println(n + \" \" + a/n*b);\n\t\t}\n\t}",
"main",
"{\n\t\tScanner scan = new Scanner(System.in);\n\t\tint a=0,b=0,m=0,n=0,t=0;\n\t\twhile(scan.hasNext()){\n\t\t\ta = scan.nextInt();\n\t\t\tb = scan.nextInt();\n\t\t\tif(a < b){\n\t\t\t\tm = b;\n\t\t\t\tn = a;\n\t\t\t}else{\n\t\t\t\tm = a;\n\t\t\t\tn = b;\n\t\t\t}\n\t\t\twhile(true){\n\t\t\t\tif((t=m % n) == 0){\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tm = n;\n\t\t\t\tn = t;\n\t\t\t}\n\t\t\tSystem.out.println(n + \" \" + a/n*b);\n\t\t}\n\t}",
"Scanner scan = new Scanner(System.in);",
"scan",
"new Scanner(System.in)",
"int a=0",
"a",
"0",
"b=0",
"b",
"0",
"m=0",
"m",
"0",
"n=0",
"n",
"0",
"t=0;",
"t",
"0",
"while(scan.hasNext()){\n\t\t\ta = scan.nextInt();\n\t\t\tb = scan.nextInt();\n\t\t\tif(a < b){\n\t\t\t\tm = b;\n\t\t\t\tn = a;\n\t\t\t}else{\n\t\t\t\tm = a;\n\t\t\t\tn = b;\n\t\t\t}\n\t\t\twhile(true){\n\t\t\t\tif((t=m % n) == 0){\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tm = n;\n\t\t\t\tn = t;\n\t\t\t}\n\t\t\tSystem.out.println(n + \" \" + a/n*b);\n\t\t}",
"scan.hasNext()",
"scan.hasNext",
"scan",
"{\n\t\t\ta = scan.nextInt();\n\t\t\tb = scan.nextInt();\n\t\t\tif(a < b){\n\t\t\t\tm = b;\n\t\t\t\tn = a;\n\t\t\t}else{\n\t\t\t\tm = a;\n\t\t\t\tn = b;\n\t\t\t}\n\t\t\twhile(true){\n\t\t\t\tif((t=m % n) == 0){\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tm = n;\n\t\t\t\tn = t;\n\t\t\t}\n\t\t\tSystem.out.println(n + \" \" + a/n*b);\n\t\t}",
"a = scan.nextInt()",
"a",
"scan.nextInt()",
"scan.nextInt",
"scan",
"b = scan.nextInt()",
"b",
"scan.nextInt()",
"scan.nextInt",
"scan",
"if(a < b){\n\t\t\t\tm = b;\n\t\t\t\tn = a;\n\t\t\t}else{\n\t\t\t\tm = a;\n\t\t\t\tn = b;\n\t\t\t}",
"a < b",
"a",
"b",
"{\n\t\t\t\tm = b;\n\t\t\t\tn = a;\n\t\t\t}",
"m = b",
"m",
"b",
"n = a",
"n",
"a",
"{\n\t\t\t\tm = a;\n\t\t\t\tn = b;\n\t\t\t}",
"m = a",
"m",
"a",
"n = b",
"n",
"b",
"while(true){\n\t\t\t\tif((t=m % n) == 0){\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tm = n;\n\t\t\t\tn = t;\n\t\t\t}",
"true",
"{\n\t\t\t\tif((t=m % n) == 0){\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tm = n;\n\t\t\t\tn = t;\n\t\t\t}",
"if((t=m % n) == 0){\n\t\t\t\t\tbreak;\n\t\t\t\t}",
"(t=m % n) == 0",
"(t=m % n)",
"t",
"m % n",
"m",
"n",
"0",
"{\n\t\t\t\t\tbreak;\n\t\t\t\t}",
"break;",
"m = n",
"m",
"n",
"n = t",
"n",
"t",
"System.out.println(n + \" \" + a/n*b)",
"System.out.println",
"System.out",
"System",
"System.out",
"n + \" \" + a/n*b",
"n + \" \" + a/n*b",
"n",
"\" \"",
"a/n*b",
"a/n",
"a",
"n",
"b",
"String[] args",
"args"
] | import java.util.Scanner;
class Main{
public static void main(String[] args){
Scanner scan = new Scanner(System.in);
int a=0,b=0,m=0,n=0,t=0;
while(scan.hasNext()){
a = scan.nextInt();
b = scan.nextInt();
if(a < b){
m = b;
n = a;
}else{
m = a;
n = b;
}
while(true){
if((t=m % n) == 0){
break;
}
m = n;
n = t;
}
System.out.println(n + " " + a/n*b);
}
}
} |
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
11,
1,
4,
18,
13,
30,
30,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
14,
2,
13,
13,
30,
41,
13,
13,
0,
13,
13,
0,
13,
13,
4,
18,
18,
13,
13,
2,
2,
4,
13,
13,
13,
17,
4,
13,
13,
13,
23,
13,
12,
13,
30,
11,
1,
30,
30,
14,
2,
13,
13,
30,
0,
13,
2,
13,
13,
14,
2,
13,
17,
29,
13,
30,
0,
13,
2,
13,
13,
14,
2,
13,
17,
29,
13,
23,
13,
23,
13,
12,
13,
30,
11,
1,
41,
13,
13,
1,
0,
13,
13,
30,
30,
14,
2,
2,
2,
13,
13,
17,
2,
2,
13,
13,
17,
30,
29,
13,
23,
13,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
134,
5
],
[
134,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
12,
17
],
[
18,
18
],
[
18,
19
],
[
19,
20
],
[
19,
21
],
[
21,
22
],
[
22,
23
],
[
18,
24
],
[
24,
25
],
[
24,
26
],
[
26,
27
],
[
27,
28
],
[
18,
29
],
[
29,
30
],
[
30,
31
],
[
30,
32
],
[
29,
33
],
[
33,
34
],
[
34,
35
],
[
34,
36
],
[
33,
37
],
[
37,
38
],
[
37,
39
],
[
33,
40
],
[
40,
41
],
[
40,
42
],
[
18,
43
],
[
43,
44
],
[
44,
45
],
[
45,
46
],
[
45,
47
],
[
43,
48
],
[
49,
49
],
[
49,
50
],
[
50,
51
],
[
50,
52
],
[
50,
53
],
[
49,
54
],
[
49,
55
],
[
55,
56
],
[
55,
57
],
[
55,
58
],
[
6,
59
],
[
59,
60
],
[
134,
61
],
[
61,
62
],
[
61,
63
],
[
63,
64
],
[
64,
65
],
[
64,
66
],
[
67,
67
],
[
67,
68
],
[
68,
69
],
[
69,
70
],
[
69,
71
],
[
68,
72
],
[
72,
73
],
[
73,
74
],
[
73,
75
],
[
75,
76
],
[
75,
77
],
[
72,
78
],
[
78,
79
],
[
79,
80
],
[
79,
81
],
[
78,
82
],
[
82,
83
],
[
68,
84
],
[
84,
85
],
[
85,
86
],
[
85,
87
],
[
87,
88
],
[
87,
89
],
[
84,
90
],
[
90,
91
],
[
91,
92
],
[
91,
93
],
[
90,
94
],
[
94,
95
],
[
61,
96
],
[
96,
97
],
[
61,
98
],
[
98,
99
],
[
134,
100
],
[
100,
101
],
[
100,
102
],
[
102,
103
],
[
103,
104
],
[
104,
105
],
[
105,
106
],
[
105,
107
],
[
103,
108
],
[
108,
109
],
[
109,
110
],
[
109,
111
],
[
103,
112
],
[
113,
113
],
[
113,
114
],
[
114,
115
],
[
115,
116
],
[
116,
117
],
[
117,
118
],
[
117,
119
],
[
116,
120
],
[
115,
121
],
[
121,
122
],
[
122,
123
],
[
122,
124
],
[
121,
125
],
[
114,
126
],
[
126,
127
],
[
127,
128
],
[
100,
129
],
[
129,
130
],
[
100,
131
],
[
131,
132
],
[
0,
133
],
[
133,
134
],
[
133,
135
]
] | [
"import java.util.Scanner;\n\n\npublic class Main\n{\n\tpublic static void main(String[] args)\n\t{\n\t\tScanner scanner = new Scanner(System.in);\n\t\tfor(; scanner.hasNext(); )\n\t\t{\n\t\t\tlong a = scanner.nextLong();\n\t\t\tlong b = scanner.nextLong();\n\t\t\tif(a < b)\n\t\t\t{\n\t\t\t\tlong buf = a;\n\t\t\t\ta = b;\n\t\t\t\tb = buf;\n\t\t\t}\n\t\t\t\n\t\t\tSystem.out.println(getGCD(a, b)+\" \"+getLCM(a, b));\n\t\t}\n\t}\n\t\n\tprivate static long getGCD(long a, long b)\n\t{\n\t\tfor(;;)\n\t\t{\n\t\t\tif(a > b)\n\t\t\t{\n\t\t\t\ta = a % b;\n\t\t\t\tif(a == 0)\n\t\t\t\t\treturn b;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tb = b % a;\n\t\t\t\tif(b == 0) \n\t\t\t\t\treturn a;\n\t\t\t}\n\t\t}\n\t}\n\t\n\tprivate static long getLCM(long a, long b)\n\t{\n\t\tfor(long n=b; ; n+=b)\n\t\t{\n\t\t\tif(n%a==0 && n%b==0)\n\t\t\t{\n\t\t\t\treturn n;\n\t\t\t}\n\t\t}\n\t}\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main\n{\n\tpublic static void main(String[] args)\n\t{\n\t\tScanner scanner = new Scanner(System.in);\n\t\tfor(; scanner.hasNext(); )\n\t\t{\n\t\t\tlong a = scanner.nextLong();\n\t\t\tlong b = scanner.nextLong();\n\t\t\tif(a < b)\n\t\t\t{\n\t\t\t\tlong buf = a;\n\t\t\t\ta = b;\n\t\t\t\tb = buf;\n\t\t\t}\n\t\t\t\n\t\t\tSystem.out.println(getGCD(a, b)+\" \"+getLCM(a, b));\n\t\t}\n\t}\n\t\n\tprivate static long getGCD(long a, long b)\n\t{\n\t\tfor(;;)\n\t\t{\n\t\t\tif(a > b)\n\t\t\t{\n\t\t\t\ta = a % b;\n\t\t\t\tif(a == 0)\n\t\t\t\t\treturn b;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tb = b % a;\n\t\t\t\tif(b == 0) \n\t\t\t\t\treturn a;\n\t\t\t}\n\t\t}\n\t}\n\t\n\tprivate static long getLCM(long a, long b)\n\t{\n\t\tfor(long n=b; ; n+=b)\n\t\t{\n\t\t\tif(n%a==0 && n%b==0)\n\t\t\t{\n\t\t\t\treturn n;\n\t\t\t}\n\t\t}\n\t}\n}",
"Main",
"public static void main(String[] args)\n\t{\n\t\tScanner scanner = new Scanner(System.in);\n\t\tfor(; scanner.hasNext(); )\n\t\t{\n\t\t\tlong a = scanner.nextLong();\n\t\t\tlong b = scanner.nextLong();\n\t\t\tif(a < b)\n\t\t\t{\n\t\t\t\tlong buf = a;\n\t\t\t\ta = b;\n\t\t\t\tb = buf;\n\t\t\t}\n\t\t\t\n\t\t\tSystem.out.println(getGCD(a, b)+\" \"+getLCM(a, b));\n\t\t}\n\t}",
"main",
"{\n\t\tScanner scanner = new Scanner(System.in);\n\t\tfor(; scanner.hasNext(); )\n\t\t{\n\t\t\tlong a = scanner.nextLong();\n\t\t\tlong b = scanner.nextLong();\n\t\t\tif(a < b)\n\t\t\t{\n\t\t\t\tlong buf = a;\n\t\t\t\ta = b;\n\t\t\t\tb = buf;\n\t\t\t}\n\t\t\t\n\t\t\tSystem.out.println(getGCD(a, b)+\" \"+getLCM(a, b));\n\t\t}\n\t}",
"Scanner scanner = new Scanner(System.in);",
"scanner",
"new Scanner(System.in)",
"for(; scanner.hasNext(); )\n\t\t{\n\t\t\tlong a = scanner.nextLong();\n\t\t\tlong b = scanner.nextLong();\n\t\t\tif(a < b)\n\t\t\t{\n\t\t\t\tlong buf = a;\n\t\t\t\ta = b;\n\t\t\t\tb = buf;\n\t\t\t}\n\t\t\t\n\t\t\tSystem.out.println(getGCD(a, b)+\" \"+getLCM(a, b));\n\t\t}",
";",
"scanner.hasNext()",
"scanner.hasNext",
"scanner",
"{\n\t\t\tlong a = scanner.nextLong();\n\t\t\tlong b = scanner.nextLong();\n\t\t\tif(a < b)\n\t\t\t{\n\t\t\t\tlong buf = a;\n\t\t\t\ta = b;\n\t\t\t\tb = buf;\n\t\t\t}\n\t\t\t\n\t\t\tSystem.out.println(getGCD(a, b)+\" \"+getLCM(a, b));\n\t\t}",
"{\n\t\t\tlong a = scanner.nextLong();\n\t\t\tlong b = scanner.nextLong();\n\t\t\tif(a < b)\n\t\t\t{\n\t\t\t\tlong buf = a;\n\t\t\t\ta = b;\n\t\t\t\tb = buf;\n\t\t\t}\n\t\t\t\n\t\t\tSystem.out.println(getGCD(a, b)+\" \"+getLCM(a, b));\n\t\t}",
"long a = scanner.nextLong();",
"a",
"scanner.nextLong()",
"scanner.nextLong",
"scanner",
"long b = scanner.nextLong();",
"b",
"scanner.nextLong()",
"scanner.nextLong",
"scanner",
"if(a < b)\n\t\t\t{\n\t\t\t\tlong buf = a;\n\t\t\t\ta = b;\n\t\t\t\tb = buf;\n\t\t\t}",
"a < b",
"a",
"b",
"{\n\t\t\t\tlong buf = a;\n\t\t\t\ta = b;\n\t\t\t\tb = buf;\n\t\t\t}",
"long buf = a;",
"buf",
"a",
"a = b",
"a",
"b",
"b = buf",
"b",
"buf",
"System.out.println(getGCD(a, b)+\" \"+getLCM(a, b))",
"System.out.println",
"System.out",
"System",
"System.out",
"getGCD(a, b)+\" \"+getLCM(a, b)",
"getGCD(a, b)+\" \"+getLCM(a, b)",
"getGCD(a, b)",
"getGCD",
"a",
"b",
"\" \"",
"getLCM(a, b)",
"getLCM",
"a",
"b",
"String[] args",
"args",
"private static long getGCD(long a, long b)\n\t{\n\t\tfor(;;)\n\t\t{\n\t\t\tif(a > b)\n\t\t\t{\n\t\t\t\ta = a % b;\n\t\t\t\tif(a == 0)\n\t\t\t\t\treturn b;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tb = b % a;\n\t\t\t\tif(b == 0) \n\t\t\t\t\treturn a;\n\t\t\t}\n\t\t}\n\t}",
"getGCD",
"{\n\t\tfor(;;)\n\t\t{\n\t\t\tif(a > b)\n\t\t\t{\n\t\t\t\ta = a % b;\n\t\t\t\tif(a == 0)\n\t\t\t\t\treturn b;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tb = b % a;\n\t\t\t\tif(b == 0) \n\t\t\t\t\treturn a;\n\t\t\t}\n\t\t}\n\t}",
"for(;;)\n\t\t{\n\t\t\tif(a > b)\n\t\t\t{\n\t\t\t\ta = a % b;\n\t\t\t\tif(a == 0)\n\t\t\t\t\treturn b;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tb = b % a;\n\t\t\t\tif(b == 0) \n\t\t\t\t\treturn a;\n\t\t\t}\n\t\t}",
";",
"{\n\t\t\tif(a > b)\n\t\t\t{\n\t\t\t\ta = a % b;\n\t\t\t\tif(a == 0)\n\t\t\t\t\treturn b;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tb = b % a;\n\t\t\t\tif(b == 0) \n\t\t\t\t\treturn a;\n\t\t\t}\n\t\t}",
"{\n\t\t\tif(a > b)\n\t\t\t{\n\t\t\t\ta = a % b;\n\t\t\t\tif(a == 0)\n\t\t\t\t\treturn b;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tb = b % a;\n\t\t\t\tif(b == 0) \n\t\t\t\t\treturn a;\n\t\t\t}\n\t\t}",
"if(a > b)\n\t\t\t{\n\t\t\t\ta = a % b;\n\t\t\t\tif(a == 0)\n\t\t\t\t\treturn b;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tb = b % a;\n\t\t\t\tif(b == 0) \n\t\t\t\t\treturn a;\n\t\t\t}",
"a > b",
"a",
"b",
"{\n\t\t\t\ta = a % b;\n\t\t\t\tif(a == 0)\n\t\t\t\t\treturn b;\n\t\t\t}",
"a = a % b",
"a",
"a % b",
"a",
"b",
"if(a == 0)\n\t\t\t\t\treturn b;",
"a == 0",
"a",
"0",
"return b;",
"b",
"{\n\t\t\t\tb = b % a;\n\t\t\t\tif(b == 0) \n\t\t\t\t\treturn a;\n\t\t\t}",
"b = b % a",
"b",
"b % a",
"b",
"a",
"if(b == 0) \n\t\t\t\t\treturn a;",
"b == 0",
"b",
"0",
"return a;",
"a",
"long a",
"a",
"long b",
"b",
"private static long getLCM(long a, long b)\n\t{\n\t\tfor(long n=b; ; n+=b)\n\t\t{\n\t\t\tif(n%a==0 && n%b==0)\n\t\t\t{\n\t\t\t\treturn n;\n\t\t\t}\n\t\t}\n\t}",
"getLCM",
"{\n\t\tfor(long n=b; ; n+=b)\n\t\t{\n\t\t\tif(n%a==0 && n%b==0)\n\t\t\t{\n\t\t\t\treturn n;\n\t\t\t}\n\t\t}\n\t}",
"for(long n=b; ; n+=b)\n\t\t{\n\t\t\tif(n%a==0 && n%b==0)\n\t\t\t{\n\t\t\t\treturn n;\n\t\t\t}\n\t\t}",
"long n=b;",
"long n=b;",
"n",
"b",
"n+=b",
"n+=b",
"n",
"b",
"{\n\t\t\tif(n%a==0 && n%b==0)\n\t\t\t{\n\t\t\t\treturn n;\n\t\t\t}\n\t\t}",
"{\n\t\t\tif(n%a==0 && n%b==0)\n\t\t\t{\n\t\t\t\treturn n;\n\t\t\t}\n\t\t}",
"if(n%a==0 && n%b==0)\n\t\t\t{\n\t\t\t\treturn n;\n\t\t\t}",
"n%a==0 && n%b==0",
"n%a==0",
"n%a",
"n",
"a",
"0",
"n%b==0",
"n%b",
"n",
"b",
"0",
"{\n\t\t\t\treturn n;\n\t\t\t}",
"return n;",
"n",
"long a",
"a",
"long b",
"b",
"public class Main\n{\n\tpublic static void main(String[] args)\n\t{\n\t\tScanner scanner = new Scanner(System.in);\n\t\tfor(; scanner.hasNext(); )\n\t\t{\n\t\t\tlong a = scanner.nextLong();\n\t\t\tlong b = scanner.nextLong();\n\t\t\tif(a < b)\n\t\t\t{\n\t\t\t\tlong buf = a;\n\t\t\t\ta = b;\n\t\t\t\tb = buf;\n\t\t\t}\n\t\t\t\n\t\t\tSystem.out.println(getGCD(a, b)+\" \"+getLCM(a, b));\n\t\t}\n\t}\n\t\n\tprivate static long getGCD(long a, long b)\n\t{\n\t\tfor(;;)\n\t\t{\n\t\t\tif(a > b)\n\t\t\t{\n\t\t\t\ta = a % b;\n\t\t\t\tif(a == 0)\n\t\t\t\t\treturn b;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tb = b % a;\n\t\t\t\tif(b == 0) \n\t\t\t\t\treturn a;\n\t\t\t}\n\t\t}\n\t}\n\t\n\tprivate static long getLCM(long a, long b)\n\t{\n\t\tfor(long n=b; ; n+=b)\n\t\t{\n\t\t\tif(n%a==0 && n%b==0)\n\t\t\t{\n\t\t\t\treturn n;\n\t\t\t}\n\t\t}\n\t}\n}",
"public class Main\n{\n\tpublic static void main(String[] args)\n\t{\n\t\tScanner scanner = new Scanner(System.in);\n\t\tfor(; scanner.hasNext(); )\n\t\t{\n\t\t\tlong a = scanner.nextLong();\n\t\t\tlong b = scanner.nextLong();\n\t\t\tif(a < b)\n\t\t\t{\n\t\t\t\tlong buf = a;\n\t\t\t\ta = b;\n\t\t\t\tb = buf;\n\t\t\t}\n\t\t\t\n\t\t\tSystem.out.println(getGCD(a, b)+\" \"+getLCM(a, b));\n\t\t}\n\t}\n\t\n\tprivate static long getGCD(long a, long b)\n\t{\n\t\tfor(;;)\n\t\t{\n\t\t\tif(a > b)\n\t\t\t{\n\t\t\t\ta = a % b;\n\t\t\t\tif(a == 0)\n\t\t\t\t\treturn b;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tb = b % a;\n\t\t\t\tif(b == 0) \n\t\t\t\t\treturn a;\n\t\t\t}\n\t\t}\n\t}\n\t\n\tprivate static long getLCM(long a, long b)\n\t{\n\t\tfor(long n=b; ; n+=b)\n\t\t{\n\t\t\tif(n%a==0 && n%b==0)\n\t\t\t{\n\t\t\t\treturn n;\n\t\t\t}\n\t\t}\n\t}\n}",
"Main"
] | import java.util.Scanner;
public class Main
{
public static void main(String[] args)
{
Scanner scanner = new Scanner(System.in);
for(; scanner.hasNext(); )
{
long a = scanner.nextLong();
long b = scanner.nextLong();
if(a < b)
{
long buf = a;
a = b;
b = buf;
}
System.out.println(getGCD(a, b)+" "+getLCM(a, b));
}
}
private static long getGCD(long a, long b)
{
for(;;)
{
if(a > b)
{
a = a % b;
if(a == 0)
return b;
}
else
{
b = b % a;
if(b == 0)
return a;
}
}
}
private static long getLCM(long a, long b)
{
for(long n=b; ; n+=b)
{
if(n%a==0 && n%b==0)
{
return n;
}
}
}
} |
[
7,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
41,
13,
41,
13,
41,
13,
42,
2,
0,
13,
4,
18,
13,
17,
30,
0,
13,
20,
41,
13,
4,
18,
13,
4,
18,
13,
41,
13,
4,
18,
13,
4,
18,
13,
41,
13,
4,
18,
20,
41,
13,
4,
18,
20,
41,
13,
42,
2,
13,
13,
30,
14,
2,
13,
13,
30,
0,
13,
2,
13,
13,
30,
0,
13,
2,
13,
13,
0,
13,
13,
0,
13,
2,
2,
13,
13,
13,
4,
18,
18,
13,
13,
2,
2,
13,
17,
13,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
107,
8
],
[
107,
9
],
[
9,
10
],
[
9,
11
],
[
11,
12
],
[
12,
13
],
[
12,
14
],
[
11,
15
],
[
15,
16
],
[
11,
17
],
[
17,
18
],
[
11,
19
],
[
19,
20
],
[
11,
21
],
[
21,
22
],
[
11,
23
],
[
23,
24
],
[
24,
25
],
[
25,
26
],
[
25,
27
],
[
27,
28
],
[
28,
29
],
[
24,
30
],
[
23,
31
],
[
31,
32
],
[
32,
33
],
[
32,
34
],
[
31,
35
],
[
35,
36
],
[
35,
37
],
[
37,
38
],
[
38,
39
],
[
37,
40
],
[
40,
41
],
[
41,
42
],
[
31,
43
],
[
43,
44
],
[
43,
45
],
[
45,
46
],
[
46,
47
],
[
45,
48
],
[
48,
49
],
[
49,
50
],
[
31,
51
],
[
51,
52
],
[
51,
53
],
[
53,
54
],
[
54,
55
],
[
31,
56
],
[
56,
57
],
[
56,
58
],
[
58,
59
],
[
59,
60
],
[
31,
61
],
[
61,
62
],
[
31,
63
],
[
63,
64
],
[
64,
65
],
[
64,
66
],
[
63,
67
],
[
67,
68
],
[
68,
69
],
[
69,
70
],
[
69,
71
],
[
68,
72
],
[
72,
73
],
[
73,
74
],
[
73,
75
],
[
75,
76
],
[
75,
77
],
[
68,
78
],
[
78,
79
],
[
79,
80
],
[
79,
81
],
[
81,
82
],
[
81,
83
],
[
31,
84
],
[
84,
85
],
[
84,
86
],
[
31,
87
],
[
87,
88
],
[
87,
89
],
[
89,
90
],
[
90,
91
],
[
90,
92
],
[
89,
93
],
[
31,
94
],
[
94,
95
],
[
95,
96
],
[
96,
97
],
[
96,
98
],
[
94,
99
],
[
100,
100
],
[
100,
101
],
[
100,
102
],
[
100,
103
],
[
9,
104
],
[
104,
105
],
[
0,
106
],
[
106,
107
],
[
106,
108
]
] | [
"import java.io.*;\nimport java.util.*;\n \npublic class Main {\n \n public static void main(String[] arg) throws NumberFormatException, IOException {\n BufferedReader in = new BufferedReader(new InputStreamReader(System.in));\n StringTokenizer strToke;\n String line;\n long gcd; // ?????§??¬?´???°\n long lcm; // ????°???¬?????°\n \n // ab = gcd * lcm\n while ((line = in.readLine()) != null) {\n strToke = new StringTokenizer(line);\n long a = Integer.parseInt(strToke.nextToken());\n long b = Integer.parseInt(strToke.nextToken());\n long aStock = new Long(a).longValue();\n long bStock = new Long(b).longValue();\n int c;\n while (a != b) {\n if (a > b) {\n a = a - b;\n } else {\n b = b - a;\n }\n }\n gcd = a;\n lcm = (aStock * bStock) / gcd;\n \n System.out.println(gcd + \" \" + lcm);\n }\n }\n}",
"import java.io.*;",
"io.*",
"java",
"import java.util.*;",
"util.*",
"java",
"public class Main {\n \n public static void main(String[] arg) throws NumberFormatException, IOException {\n BufferedReader in = new BufferedReader(new InputStreamReader(System.in));\n StringTokenizer strToke;\n String line;\n long gcd; // ?????§??¬?´???°\n long lcm; // ????°???¬?????°\n \n // ab = gcd * lcm\n while ((line = in.readLine()) != null) {\n strToke = new StringTokenizer(line);\n long a = Integer.parseInt(strToke.nextToken());\n long b = Integer.parseInt(strToke.nextToken());\n long aStock = new Long(a).longValue();\n long bStock = new Long(b).longValue();\n int c;\n while (a != b) {\n if (a > b) {\n a = a - b;\n } else {\n b = b - a;\n }\n }\n gcd = a;\n lcm = (aStock * bStock) / gcd;\n \n System.out.println(gcd + \" \" + lcm);\n }\n }\n}",
"Main",
"public static void main(String[] arg) throws NumberFormatException, IOException {\n BufferedReader in = new BufferedReader(new InputStreamReader(System.in));\n StringTokenizer strToke;\n String line;\n long gcd; // ?????§??¬?´???°\n long lcm; // ????°???¬?????°\n \n // ab = gcd * lcm\n while ((line = in.readLine()) != null) {\n strToke = new StringTokenizer(line);\n long a = Integer.parseInt(strToke.nextToken());\n long b = Integer.parseInt(strToke.nextToken());\n long aStock = new Long(a).longValue();\n long bStock = new Long(b).longValue();\n int c;\n while (a != b) {\n if (a > b) {\n a = a - b;\n } else {\n b = b - a;\n }\n }\n gcd = a;\n lcm = (aStock * bStock) / gcd;\n \n System.out.println(gcd + \" \" + lcm);\n }\n }",
"main",
"{\n BufferedReader in = new BufferedReader(new InputStreamReader(System.in));\n StringTokenizer strToke;\n String line;\n long gcd; // ?????§??¬?´???°\n long lcm; // ????°???¬?????°\n \n // ab = gcd * lcm\n while ((line = in.readLine()) != null) {\n strToke = new StringTokenizer(line);\n long a = Integer.parseInt(strToke.nextToken());\n long b = Integer.parseInt(strToke.nextToken());\n long aStock = new Long(a).longValue();\n long bStock = new Long(b).longValue();\n int c;\n while (a != b) {\n if (a > b) {\n a = a - b;\n } else {\n b = b - a;\n }\n }\n gcd = a;\n lcm = (aStock * bStock) / gcd;\n \n System.out.println(gcd + \" \" + lcm);\n }\n }",
"BufferedReader in = new BufferedReader(new InputStreamReader(System.in));",
"in",
"new BufferedReader(new InputStreamReader(System.in))",
"StringTokenizer strToke;",
"strToke",
"String line;",
"line",
"long gcd;",
"gcd",
"long lcm;",
"lcm",
"while ((line = in.readLine()) != null) {\n strToke = new StringTokenizer(line);\n long a = Integer.parseInt(strToke.nextToken());\n long b = Integer.parseInt(strToke.nextToken());\n long aStock = new Long(a).longValue();\n long bStock = new Long(b).longValue();\n int c;\n while (a != b) {\n if (a > b) {\n a = a - b;\n } else {\n b = b - a;\n }\n }\n gcd = a;\n lcm = (aStock * bStock) / gcd;\n \n System.out.println(gcd + \" \" + lcm);\n }",
"(line = in.readLine()) != null",
"(line = in.readLine())",
"line",
"in.readLine()",
"in.readLine",
"in",
"null",
"{\n strToke = new StringTokenizer(line);\n long a = Integer.parseInt(strToke.nextToken());\n long b = Integer.parseInt(strToke.nextToken());\n long aStock = new Long(a).longValue();\n long bStock = new Long(b).longValue();\n int c;\n while (a != b) {\n if (a > b) {\n a = a - b;\n } else {\n b = b - a;\n }\n }\n gcd = a;\n lcm = (aStock * bStock) / gcd;\n \n System.out.println(gcd + \" \" + lcm);\n }",
"strToke = new StringTokenizer(line)",
"strToke",
"new StringTokenizer(line)",
"long a = Integer.parseInt(strToke.nextToken());",
"a",
"Integer.parseInt(strToke.nextToken())",
"Integer.parseInt",
"Integer",
"strToke.nextToken()",
"strToke.nextToken",
"strToke",
"long b = Integer.parseInt(strToke.nextToken());",
"b",
"Integer.parseInt(strToke.nextToken())",
"Integer.parseInt",
"Integer",
"strToke.nextToken()",
"strToke.nextToken",
"strToke",
"long aStock = new Long(a).longValue();",
"aStock",
"new Long(a).longValue()",
"new Long(a).longValue",
"new Long(a)",
"long bStock = new Long(b).longValue();",
"bStock",
"new Long(b).longValue()",
"new Long(b).longValue",
"new Long(b)",
"int c;",
"c",
"while (a != b) {\n if (a > b) {\n a = a - b;\n } else {\n b = b - a;\n }\n }",
"a != b",
"a",
"b",
"{\n if (a > b) {\n a = a - b;\n } else {\n b = b - a;\n }\n }",
"if (a > b) {\n a = a - b;\n } else {\n b = b - a;\n }",
"a > b",
"a",
"b",
"{\n a = a - b;\n }",
"a = a - b",
"a",
"a - b",
"a",
"b",
"{\n b = b - a;\n }",
"b = b - a",
"b",
"b - a",
"b",
"a",
"gcd = a",
"gcd",
"a",
"lcm = (aStock * bStock) / gcd",
"lcm",
"(aStock * bStock) / gcd",
"(aStock * bStock)",
"aStock",
"bStock",
"gcd",
"System.out.println(gcd + \" \" + lcm)",
"System.out.println",
"System.out",
"System",
"System.out",
"gcd + \" \" + lcm",
"gcd + \" \" + lcm",
"gcd",
"\" \"",
"lcm",
"String[] arg",
"arg",
"public class Main {\n \n public static void main(String[] arg) throws NumberFormatException, IOException {\n BufferedReader in = new BufferedReader(new InputStreamReader(System.in));\n StringTokenizer strToke;\n String line;\n long gcd; // ?????§??¬?´???°\n long lcm; // ????°???¬?????°\n \n // ab = gcd * lcm\n while ((line = in.readLine()) != null) {\n strToke = new StringTokenizer(line);\n long a = Integer.parseInt(strToke.nextToken());\n long b = Integer.parseInt(strToke.nextToken());\n long aStock = new Long(a).longValue();\n long bStock = new Long(b).longValue();\n int c;\n while (a != b) {\n if (a > b) {\n a = a - b;\n } else {\n b = b - a;\n }\n }\n gcd = a;\n lcm = (aStock * bStock) / gcd;\n \n System.out.println(gcd + \" \" + lcm);\n }\n }\n}",
"public class Main {\n \n public static void main(String[] arg) throws NumberFormatException, IOException {\n BufferedReader in = new BufferedReader(new InputStreamReader(System.in));\n StringTokenizer strToke;\n String line;\n long gcd; // ?????§??¬?´???°\n long lcm; // ????°???¬?????°\n \n // ab = gcd * lcm\n while ((line = in.readLine()) != null) {\n strToke = new StringTokenizer(line);\n long a = Integer.parseInt(strToke.nextToken());\n long b = Integer.parseInt(strToke.nextToken());\n long aStock = new Long(a).longValue();\n long bStock = new Long(b).longValue();\n int c;\n while (a != b) {\n if (a > b) {\n a = a - b;\n } else {\n b = b - a;\n }\n }\n gcd = a;\n lcm = (aStock * bStock) / gcd;\n \n System.out.println(gcd + \" \" + lcm);\n }\n }\n}",
"Main"
] | import java.io.*;
import java.util.*;
public class Main {
public static void main(String[] arg) throws NumberFormatException, IOException {
BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
StringTokenizer strToke;
String line;
long gcd; // ?????§??¬?´???°
long lcm; // ????°???¬?????°
// ab = gcd * lcm
while ((line = in.readLine()) != null) {
strToke = new StringTokenizer(line);
long a = Integer.parseInt(strToke.nextToken());
long b = Integer.parseInt(strToke.nextToken());
long aStock = new Long(a).longValue();
long bStock = new Long(b).longValue();
int c;
while (a != b) {
if (a > b) {
a = a - b;
} else {
b = b - a;
}
}
gcd = a;
lcm = (aStock * bStock) / gcd;
System.out.println(gcd + " " + lcm);
}
}
} |
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
14,
2,
13,
13,
30,
41,
13,
13,
0,
13,
13,
0,
13,
13,
42,
2,
13,
17,
30,
41,
13,
13,
0,
13,
2,
13,
13,
0,
13,
13,
29,
13,
23,
13,
23,
13,
12,
13,
30,
0,
13,
4,
13,
13,
13,
29,
2,
13,
13,
23,
13,
23,
13,
12,
13,
30,
41,
13,
20,
42,
4,
18,
13,
30,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
4,
18,
18,
13,
13,
2,
2,
4,
13,
13,
13,
17,
4,
13,
13,
13,
23,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
10,
11
],
[
10,
12
],
[
9,
13
],
[
13,
14
],
[
14,
15
],
[
14,
16
],
[
13,
17
],
[
17,
18
],
[
17,
19
],
[
13,
20
],
[
20,
21
],
[
20,
22
],
[
8,
23
],
[
23,
24
],
[
24,
25
],
[
24,
26
],
[
23,
27
],
[
27,
28
],
[
28,
29
],
[
28,
30
],
[
27,
31
],
[
31,
32
],
[
31,
33
],
[
33,
34
],
[
33,
35
],
[
27,
36
],
[
36,
37
],
[
36,
38
],
[
8,
39
],
[
39,
40
],
[
6,
41
],
[
41,
42
],
[
6,
43
],
[
43,
44
],
[
4,
45
],
[
45,
46
],
[
45,
47
],
[
47,
48
],
[
48,
49
],
[
48,
50
],
[
50,
51
],
[
50,
52
],
[
50,
53
],
[
47,
54
],
[
54,
55
],
[
55,
56
],
[
55,
57
],
[
45,
58
],
[
58,
59
],
[
45,
60
],
[
60,
61
],
[
4,
62
],
[
62,
63
],
[
62,
64
],
[
64,
65
],
[
65,
66
],
[
65,
67
],
[
64,
68
],
[
68,
69
],
[
69,
70
],
[
70,
71
],
[
68,
72
],
[
72,
73
],
[
73,
74
],
[
73,
75
],
[
75,
76
],
[
76,
77
],
[
72,
78
],
[
78,
79
],
[
78,
80
],
[
80,
81
],
[
81,
82
],
[
72,
83
],
[
83,
84
],
[
84,
85
],
[
85,
86
],
[
85,
87
],
[
83,
88
],
[
89,
89
],
[
89,
90
],
[
90,
91
],
[
90,
92
],
[
90,
93
],
[
89,
94
],
[
89,
95
],
[
95,
96
],
[
95,
97
],
[
95,
98
],
[
62,
99
],
[
99,
100
]
] | [
"import java.util.Scanner;\n\nclass Main {\n\n static int gcd(int a, int b){\n\tif(a < b){\n\t int temp = a;\n\t a = b;\n\t b = temp;\n\t}\n\t\n\twhile(b != 0){\n\t int temp = b;\n\t b = a % b;\n\t a = temp;\n\t}\n\treturn a;\t \n }\n\n static int lcm(int a, int b){\n\ta /= gcd(a, b);\n\treturn a * b;\n }\n \n public static void main(String[] args){\n\tScanner stdin = new Scanner(System.in);\n\twhile(stdin.hasNextInt()){\n\t int a = stdin.nextInt();\n\t int b = stdin.nextInt();\n\t System.out.println(gcd(a, b) + \" \" + lcm(a, b));\n\t}\n }\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"class Main {\n\n static int gcd(int a, int b){\n\tif(a < b){\n\t int temp = a;\n\t a = b;\n\t b = temp;\n\t}\n\t\n\twhile(b != 0){\n\t int temp = b;\n\t b = a % b;\n\t a = temp;\n\t}\n\treturn a;\t \n }\n\n static int lcm(int a, int b){\n\ta /= gcd(a, b);\n\treturn a * b;\n }\n \n public static void main(String[] args){\n\tScanner stdin = new Scanner(System.in);\n\twhile(stdin.hasNextInt()){\n\t int a = stdin.nextInt();\n\t int b = stdin.nextInt();\n\t System.out.println(gcd(a, b) + \" \" + lcm(a, b));\n\t}\n }\n}",
"Main",
"static int gcd(int a, int b){\n\tif(a < b){\n\t int temp = a;\n\t a = b;\n\t b = temp;\n\t}\n\t\n\twhile(b != 0){\n\t int temp = b;\n\t b = a % b;\n\t a = temp;\n\t}\n\treturn a;\t \n }",
"gcd",
"{\n\tif(a < b){\n\t int temp = a;\n\t a = b;\n\t b = temp;\n\t}\n\t\n\twhile(b != 0){\n\t int temp = b;\n\t b = a % b;\n\t a = temp;\n\t}\n\treturn a;\t \n }",
"if(a < b){\n\t int temp = a;\n\t a = b;\n\t b = temp;\n\t}",
"a < b",
"a",
"b",
"{\n\t int temp = a;\n\t a = b;\n\t b = temp;\n\t}",
"int temp = a;",
"temp",
"a",
"a = b",
"a",
"b",
"b = temp",
"b",
"temp",
"while(b != 0){\n\t int temp = b;\n\t b = a % b;\n\t a = temp;\n\t}",
"b != 0",
"b",
"0",
"{\n\t int temp = b;\n\t b = a % b;\n\t a = temp;\n\t}",
"int temp = b;",
"temp",
"b",
"b = a % b",
"b",
"a % b",
"a",
"b",
"a = temp",
"a",
"temp",
"return a;",
"a",
"int a",
"a",
"int b",
"b",
"static int lcm(int a, int b){\n\ta /= gcd(a, b);\n\treturn a * b;\n }",
"lcm",
"{\n\ta /= gcd(a, b);\n\treturn a * b;\n }",
"a /= gcd(a, b)",
"a",
"gcd(a, b)",
"gcd",
"a",
"b",
"return a * b;",
"a * b",
"a",
"b",
"int a",
"a",
"int b",
"b",
"public static void main(String[] args){\n\tScanner stdin = new Scanner(System.in);\n\twhile(stdin.hasNextInt()){\n\t int a = stdin.nextInt();\n\t int b = stdin.nextInt();\n\t System.out.println(gcd(a, b) + \" \" + lcm(a, b));\n\t}\n }",
"main",
"{\n\tScanner stdin = new Scanner(System.in);\n\twhile(stdin.hasNextInt()){\n\t int a = stdin.nextInt();\n\t int b = stdin.nextInt();\n\t System.out.println(gcd(a, b) + \" \" + lcm(a, b));\n\t}\n }",
"Scanner stdin = new Scanner(System.in);",
"stdin",
"new Scanner(System.in)",
"while(stdin.hasNextInt()){\n\t int a = stdin.nextInt();\n\t int b = stdin.nextInt();\n\t System.out.println(gcd(a, b) + \" \" + lcm(a, b));\n\t}",
"stdin.hasNextInt()",
"stdin.hasNextInt",
"stdin",
"{\n\t int a = stdin.nextInt();\n\t int b = stdin.nextInt();\n\t System.out.println(gcd(a, b) + \" \" + lcm(a, b));\n\t}",
"int a = stdin.nextInt();",
"a",
"stdin.nextInt()",
"stdin.nextInt",
"stdin",
"int b = stdin.nextInt();",
"b",
"stdin.nextInt()",
"stdin.nextInt",
"stdin",
"System.out.println(gcd(a, b) + \" \" + lcm(a, b))",
"System.out.println",
"System.out",
"System",
"System.out",
"gcd(a, b) + \" \" + lcm(a, b)",
"gcd(a, b) + \" \" + lcm(a, b)",
"gcd(a, b)",
"gcd",
"a",
"b",
"\" \"",
"lcm(a, b)",
"lcm",
"a",
"b",
"String[] args",
"args"
] | import java.util.Scanner;
class Main {
static int gcd(int a, int b){
if(a < b){
int temp = a;
a = b;
b = temp;
}
while(b != 0){
int temp = b;
b = a % b;
a = temp;
}
return a;
}
static int lcm(int a, int b){
a /= gcd(a, b);
return a * b;
}
public static void main(String[] args){
Scanner stdin = new Scanner(System.in);
while(stdin.hasNextInt()){
int a = stdin.nextInt();
int b = stdin.nextInt();
System.out.println(gcd(a, b) + " " + lcm(a, b));
}
}
} |
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
14,
2,
13,
13,
30,
41,
13,
13,
0,
13,
13,
0,
13,
13,
42,
2,
13,
17,
30,
41,
13,
2,
13,
13,
0,
13,
13,
0,
13,
13,
29,
13,
23,
13,
23,
13,
12,
13,
30,
41,
13,
20,
42,
4,
18,
13,
30,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
41,
13,
4,
13,
13,
13,
4,
18,
18,
13,
13,
2,
2,
13,
17,
2,
2,
13,
13,
13,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
89,
5
],
[
89,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
10,
11
],
[
10,
12
],
[
9,
13
],
[
13,
14
],
[
14,
15
],
[
14,
16
],
[
13,
17
],
[
17,
18
],
[
17,
19
],
[
13,
20
],
[
20,
21
],
[
20,
22
],
[
8,
23
],
[
23,
24
],
[
24,
25
],
[
24,
26
],
[
23,
27
],
[
27,
28
],
[
28,
29
],
[
28,
30
],
[
30,
31
],
[
30,
32
],
[
27,
33
],
[
33,
34
],
[
33,
35
],
[
27,
36
],
[
36,
37
],
[
36,
38
],
[
8,
39
],
[
39,
40
],
[
6,
41
],
[
41,
42
],
[
6,
43
],
[
43,
44
],
[
89,
45
],
[
45,
46
],
[
45,
47
],
[
47,
48
],
[
48,
49
],
[
48,
50
],
[
47,
51
],
[
51,
52
],
[
52,
53
],
[
53,
54
],
[
51,
55
],
[
55,
56
],
[
56,
57
],
[
56,
58
],
[
58,
59
],
[
59,
60
],
[
55,
61
],
[
61,
62
],
[
61,
63
],
[
63,
64
],
[
64,
65
],
[
55,
66
],
[
66,
67
],
[
66,
68
],
[
68,
69
],
[
68,
70
],
[
68,
71
],
[
55,
72
],
[
72,
73
],
[
73,
74
],
[
74,
75
],
[
74,
76
],
[
72,
77
],
[
78,
78
],
[
78,
79
],
[
78,
80
],
[
78,
81
],
[
81,
82
],
[
82,
83
],
[
82,
84
],
[
81,
85
],
[
45,
86
],
[
86,
87
],
[
0,
88
],
[
88,
89
],
[
88,
90
]
] | [
"import java.util.Scanner;\n\n//GCD and LCM\npublic class Main{\n\n\tpublic static long gcd(long a, long b){\n\t\tif(a < b){\n\t\t\tlong tmp = a;\n\t\t\ta = b;\n\t\t\tb = tmp;\n\t\t}\n\t\twhile(b!=0){\n\t\t\tlong r = a%b;\n\t\t\ta = b;\n\t\t\tb = r;\n\t\t}\n\t\treturn a;\n\t}\n\n\tpublic static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\twhile(sc.hasNext()){\n\t\t\tint a = sc.nextInt();\n\t\t\tint b = sc.nextInt();\n\t\t\tlong g = gcd(a, b);\n\t\t\tSystem.out.println(g+\" \"+a/g*b);\n\t\t}\n\t}\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main{\n\n\tpublic static long gcd(long a, long b){\n\t\tif(a < b){\n\t\t\tlong tmp = a;\n\t\t\ta = b;\n\t\t\tb = tmp;\n\t\t}\n\t\twhile(b!=0){\n\t\t\tlong r = a%b;\n\t\t\ta = b;\n\t\t\tb = r;\n\t\t}\n\t\treturn a;\n\t}\n\n\tpublic static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\twhile(sc.hasNext()){\n\t\t\tint a = sc.nextInt();\n\t\t\tint b = sc.nextInt();\n\t\t\tlong g = gcd(a, b);\n\t\t\tSystem.out.println(g+\" \"+a/g*b);\n\t\t}\n\t}\n}",
"Main",
"public static long gcd(long a, long b){\n\t\tif(a < b){\n\t\t\tlong tmp = a;\n\t\t\ta = b;\n\t\t\tb = tmp;\n\t\t}\n\t\twhile(b!=0){\n\t\t\tlong r = a%b;\n\t\t\ta = b;\n\t\t\tb = r;\n\t\t}\n\t\treturn a;\n\t}",
"gcd",
"{\n\t\tif(a < b){\n\t\t\tlong tmp = a;\n\t\t\ta = b;\n\t\t\tb = tmp;\n\t\t}\n\t\twhile(b!=0){\n\t\t\tlong r = a%b;\n\t\t\ta = b;\n\t\t\tb = r;\n\t\t}\n\t\treturn a;\n\t}",
"if(a < b){\n\t\t\tlong tmp = a;\n\t\t\ta = b;\n\t\t\tb = tmp;\n\t\t}",
"a < b",
"a",
"b",
"{\n\t\t\tlong tmp = a;\n\t\t\ta = b;\n\t\t\tb = tmp;\n\t\t}",
"long tmp = a;",
"tmp",
"a",
"a = b",
"a",
"b",
"b = tmp",
"b",
"tmp",
"while(b!=0){\n\t\t\tlong r = a%b;\n\t\t\ta = b;\n\t\t\tb = r;\n\t\t}",
"b!=0",
"b",
"0",
"{\n\t\t\tlong r = a%b;\n\t\t\ta = b;\n\t\t\tb = r;\n\t\t}",
"long r = a%b;",
"r",
"a%b",
"a",
"b",
"a = b",
"a",
"b",
"b = r",
"b",
"r",
"return a;",
"a",
"long a",
"a",
"long b",
"b",
"public static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\twhile(sc.hasNext()){\n\t\t\tint a = sc.nextInt();\n\t\t\tint b = sc.nextInt();\n\t\t\tlong g = gcd(a, b);\n\t\t\tSystem.out.println(g+\" \"+a/g*b);\n\t\t}\n\t}",
"main",
"{\n\t\tScanner sc = new Scanner(System.in);\n\t\twhile(sc.hasNext()){\n\t\t\tint a = sc.nextInt();\n\t\t\tint b = sc.nextInt();\n\t\t\tlong g = gcd(a, b);\n\t\t\tSystem.out.println(g+\" \"+a/g*b);\n\t\t}\n\t}",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"while(sc.hasNext()){\n\t\t\tint a = sc.nextInt();\n\t\t\tint b = sc.nextInt();\n\t\t\tlong g = gcd(a, b);\n\t\t\tSystem.out.println(g+\" \"+a/g*b);\n\t\t}",
"sc.hasNext()",
"sc.hasNext",
"sc",
"{\n\t\t\tint a = sc.nextInt();\n\t\t\tint b = sc.nextInt();\n\t\t\tlong g = gcd(a, b);\n\t\t\tSystem.out.println(g+\" \"+a/g*b);\n\t\t}",
"int a = sc.nextInt();",
"a",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int b = sc.nextInt();",
"b",
"sc.nextInt()",
"sc.nextInt",
"sc",
"long g = gcd(a, b);",
"g",
"gcd(a, b)",
"gcd",
"a",
"b",
"System.out.println(g+\" \"+a/g*b)",
"System.out.println",
"System.out",
"System",
"System.out",
"g+\" \"+a/g*b",
"g+\" \"+a/g*b",
"g",
"\" \"",
"a/g*b",
"a/g",
"a",
"g",
"b",
"String[] args",
"args",
"public class Main{\n\n\tpublic static long gcd(long a, long b){\n\t\tif(a < b){\n\t\t\tlong tmp = a;\n\t\t\ta = b;\n\t\t\tb = tmp;\n\t\t}\n\t\twhile(b!=0){\n\t\t\tlong r = a%b;\n\t\t\ta = b;\n\t\t\tb = r;\n\t\t}\n\t\treturn a;\n\t}\n\n\tpublic static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\twhile(sc.hasNext()){\n\t\t\tint a = sc.nextInt();\n\t\t\tint b = sc.nextInt();\n\t\t\tlong g = gcd(a, b);\n\t\t\tSystem.out.println(g+\" \"+a/g*b);\n\t\t}\n\t}\n}",
"public class Main{\n\n\tpublic static long gcd(long a, long b){\n\t\tif(a < b){\n\t\t\tlong tmp = a;\n\t\t\ta = b;\n\t\t\tb = tmp;\n\t\t}\n\t\twhile(b!=0){\n\t\t\tlong r = a%b;\n\t\t\ta = b;\n\t\t\tb = r;\n\t\t}\n\t\treturn a;\n\t}\n\n\tpublic static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\twhile(sc.hasNext()){\n\t\t\tint a = sc.nextInt();\n\t\t\tint b = sc.nextInt();\n\t\t\tlong g = gcd(a, b);\n\t\t\tSystem.out.println(g+\" \"+a/g*b);\n\t\t}\n\t}\n}",
"Main"
] | import java.util.Scanner;
//GCD and LCM
public class Main{
public static long gcd(long a, long b){
if(a < b){
long tmp = a;
a = b;
b = tmp;
}
while(b!=0){
long r = a%b;
a = b;
b = r;
}
return a;
}
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
while(sc.hasNext()){
int a = sc.nextInt();
int b = sc.nextInt();
long g = gcd(a, b);
System.out.println(g+" "+a/g*b);
}
}
} |
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
42,
4,
18,
13,
30,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
4,
18,
18,
13,
13,
2,
2,
4,
13,
13,
13,
17,
2,
2,
2,
17,
13,
13,
4,
13,
13,
13,
4,
18,
13,
23,
13,
12,
13,
30,
41,
13,
42,
2,
0,
13,
2,
13,
13,
17,
30,
0,
13,
13,
0,
13,
13,
29,
13,
23,
13,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
81,
5
],
[
81,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
13,
14
],
[
14,
15
],
[
12,
16
],
[
16,
17
],
[
17,
18
],
[
17,
19
],
[
19,
20
],
[
20,
21
],
[
16,
22
],
[
22,
23
],
[
22,
24
],
[
24,
25
],
[
25,
26
],
[
16,
27
],
[
27,
28
],
[
28,
29
],
[
29,
30
],
[
29,
31
],
[
27,
32
],
[
33,
33
],
[
33,
34
],
[
34,
35
],
[
34,
36
],
[
34,
37
],
[
33,
38
],
[
33,
39
],
[
39,
40
],
[
41,
41
],
[
41,
42
],
[
41,
43
],
[
41,
44
],
[
39,
45
],
[
45,
46
],
[
45,
47
],
[
45,
48
],
[
8,
49
],
[
49,
50
],
[
50,
51
],
[
6,
52
],
[
52,
53
],
[
81,
54
],
[
54,
55
],
[
54,
56
],
[
56,
57
],
[
57,
58
],
[
56,
59
],
[
59,
60
],
[
60,
61
],
[
61,
62
],
[
61,
63
],
[
63,
64
],
[
63,
65
],
[
60,
66
],
[
59,
67
],
[
67,
68
],
[
68,
69
],
[
68,
70
],
[
67,
71
],
[
71,
72
],
[
71,
73
],
[
56,
74
],
[
74,
75
],
[
54,
76
],
[
76,
77
],
[
54,
78
],
[
78,
79
],
[
0,
80
],
[
80,
81
],
[
80,
82
]
] | [
"import java.util.Scanner;\n\npublic class Main {\n\tpublic static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\twhile (sc.hasNext()) {\n\t\t\tint a = sc.nextInt();\n\t\t\tint b = sc.nextInt();\n\t\t\tSystem.out.println(GCD(a, b) + \" \" + 1l * a * b / GCD(a, b));\n\t\t}\n\t\tsc.close();\n\t}\n\n\tpublic static int GCD(int x, int y) {\n\t\tint tmp;\n\t\twhile ((tmp = x % y) != 0) {\n\t\t\tx = y;\n\t\t\ty = tmp;\n\t\t}\n\t\treturn y;\n\t}\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n\tpublic static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\twhile (sc.hasNext()) {\n\t\t\tint a = sc.nextInt();\n\t\t\tint b = sc.nextInt();\n\t\t\tSystem.out.println(GCD(a, b) + \" \" + 1l * a * b / GCD(a, b));\n\t\t}\n\t\tsc.close();\n\t}\n\n\tpublic static int GCD(int x, int y) {\n\t\tint tmp;\n\t\twhile ((tmp = x % y) != 0) {\n\t\t\tx = y;\n\t\t\ty = tmp;\n\t\t}\n\t\treturn y;\n\t}\n}",
"Main",
"public static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\twhile (sc.hasNext()) {\n\t\t\tint a = sc.nextInt();\n\t\t\tint b = sc.nextInt();\n\t\t\tSystem.out.println(GCD(a, b) + \" \" + 1l * a * b / GCD(a, b));\n\t\t}\n\t\tsc.close();\n\t}",
"main",
"{\n\t\tScanner sc = new Scanner(System.in);\n\t\twhile (sc.hasNext()) {\n\t\t\tint a = sc.nextInt();\n\t\t\tint b = sc.nextInt();\n\t\t\tSystem.out.println(GCD(a, b) + \" \" + 1l * a * b / GCD(a, b));\n\t\t}\n\t\tsc.close();\n\t}",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"while (sc.hasNext()) {\n\t\t\tint a = sc.nextInt();\n\t\t\tint b = sc.nextInt();\n\t\t\tSystem.out.println(GCD(a, b) + \" \" + 1l * a * b / GCD(a, b));\n\t\t}",
"sc.hasNext()",
"sc.hasNext",
"sc",
"{\n\t\t\tint a = sc.nextInt();\n\t\t\tint b = sc.nextInt();\n\t\t\tSystem.out.println(GCD(a, b) + \" \" + 1l * a * b / GCD(a, b));\n\t\t}",
"int a = sc.nextInt();",
"a",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int b = sc.nextInt();",
"b",
"sc.nextInt()",
"sc.nextInt",
"sc",
"System.out.println(GCD(a, b) + \" \" + 1l * a * b / GCD(a, b))",
"System.out.println",
"System.out",
"System",
"System.out",
"GCD(a, b) + \" \" + 1l * a * b / GCD(a, b)",
"GCD(a, b) + \" \" + 1l * a * b / GCD(a, b)",
"GCD(a, b)",
"GCD",
"a",
"b",
"\" \"",
"1l * a * b / GCD(a, b)",
"1l * a * b",
"1l * a * b",
"1l",
"a",
"b",
"GCD(a, b)",
"GCD",
"a",
"b",
"sc.close()",
"sc.close",
"sc",
"String[] args",
"args",
"public static int GCD(int x, int y) {\n\t\tint tmp;\n\t\twhile ((tmp = x % y) != 0) {\n\t\t\tx = y;\n\t\t\ty = tmp;\n\t\t}\n\t\treturn y;\n\t}",
"GCD",
"{\n\t\tint tmp;\n\t\twhile ((tmp = x % y) != 0) {\n\t\t\tx = y;\n\t\t\ty = tmp;\n\t\t}\n\t\treturn y;\n\t}",
"int tmp;",
"tmp",
"while ((tmp = x % y) != 0) {\n\t\t\tx = y;\n\t\t\ty = tmp;\n\t\t}",
"(tmp = x % y) != 0",
"(tmp = x % y)",
"tmp",
"x % y",
"x",
"y",
"0",
"{\n\t\t\tx = y;\n\t\t\ty = tmp;\n\t\t}",
"x = y",
"x",
"y",
"y = tmp",
"y",
"tmp",
"return y;",
"y",
"int x",
"x",
"int y",
"y",
"public class Main {\n\tpublic static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\twhile (sc.hasNext()) {\n\t\t\tint a = sc.nextInt();\n\t\t\tint b = sc.nextInt();\n\t\t\tSystem.out.println(GCD(a, b) + \" \" + 1l * a * b / GCD(a, b));\n\t\t}\n\t\tsc.close();\n\t}\n\n\tpublic static int GCD(int x, int y) {\n\t\tint tmp;\n\t\twhile ((tmp = x % y) != 0) {\n\t\t\tx = y;\n\t\t\ty = tmp;\n\t\t}\n\t\treturn y;\n\t}\n}",
"public class Main {\n\tpublic static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\twhile (sc.hasNext()) {\n\t\t\tint a = sc.nextInt();\n\t\t\tint b = sc.nextInt();\n\t\t\tSystem.out.println(GCD(a, b) + \" \" + 1l * a * b / GCD(a, b));\n\t\t}\n\t\tsc.close();\n\t}\n\n\tpublic static int GCD(int x, int y) {\n\t\tint tmp;\n\t\twhile ((tmp = x % y) != 0) {\n\t\t\tx = y;\n\t\t\ty = tmp;\n\t\t}\n\t\treturn y;\n\t}\n}",
"Main"
] | import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
while (sc.hasNext()) {
int a = sc.nextInt();
int b = sc.nextInt();
System.out.println(GCD(a, b) + " " + 1l * a * b / GCD(a, b));
}
sc.close();
}
public static int GCD(int x, int y) {
int tmp;
while ((tmp = x % y) != 0) {
x = y;
y = tmp;
}
return y;
}
} |
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
41,
13,
20,
17,
42,
2,
0,
13,
4,
18,
13,
17,
30,
41,
13,
4,
18,
13,
17,
41,
13,
20,
18,
13,
13,
11,
1,
41,
13,
17,
2,
13,
18,
13,
13,
1,
40,
13,
30,
30,
0,
18,
13,
13,
4,
18,
13,
18,
13,
13,
0,
18,
13,
17,
4,
13,
18,
13,
17,
18,
13,
17,
0,
18,
13,
17,
2,
2,
18,
13,
17,
18,
13,
17,
18,
13,
17,
4,
18,
18,
13,
13,
17,
18,
13,
17,
18,
13,
17,
23,
13,
12,
13,
30,
14,
2,
13,
17,
30,
29,
4,
13,
13,
2,
13,
13,
30,
29,
13,
23,
13,
23,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
10,
11
],
[
10,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
15,
17
],
[
14,
18
],
[
18,
19
],
[
14,
20
],
[
20,
21
],
[
20,
22
],
[
14,
24
],
[
24,
25
],
[
25,
26
],
[
26,
27
],
[
26,
28
],
[
28,
29
],
[
29,
30
],
[
25,
31
],
[
24,
32
],
[
32,
33
],
[
33,
34
],
[
33,
35
],
[
35,
36
],
[
36,
37
],
[
35,
38
],
[
32,
39
],
[
39,
40
],
[
39,
41
],
[
42,
43
],
[
42,
44
],
[
32,
45
],
[
45,
46
],
[
46,
47
],
[
47,
48
],
[
47,
49
],
[
45,
50
],
[
50,
51
],
[
50,
52
],
[
52,
53
],
[
52,
54
],
[
45,
55
],
[
55,
56
],
[
56,
57
],
[
45,
58
],
[
59,
59
],
[
59,
60
],
[
60,
61
],
[
61,
62
],
[
61,
63
],
[
60,
64
],
[
64,
65
],
[
65,
66
],
[
64,
67
],
[
67,
68
],
[
67,
69
],
[
32,
70
],
[
70,
71
],
[
71,
72
],
[
71,
73
],
[
70,
74
],
[
74,
75
],
[
74,
76
],
[
76,
77
],
[
76,
78
],
[
74,
79
],
[
79,
80
],
[
79,
81
],
[
32,
82
],
[
82,
83
],
[
83,
84
],
[
83,
85
],
[
82,
86
],
[
86,
87
],
[
87,
88
],
[
88,
89
],
[
88,
90
],
[
87,
91
],
[
91,
92
],
[
91,
93
],
[
86,
94
],
[
94,
95
],
[
94,
96
],
[
32,
97
],
[
97,
98
],
[
98,
99
],
[
99,
100
],
[
99,
101
],
[
97,
102
],
[
97,
103
],
[
103,
104
],
[
103,
105
],
[
97,
106
],
[
106,
107
],
[
106,
108
],
[
12,
109
],
[
109,
110
],
[
10,
111
],
[
111,
112
],
[
111,
113
],
[
113,
114
],
[
114,
115
],
[
115,
116
],
[
115,
117
],
[
114,
118
],
[
118,
119
],
[
119,
120
],
[
120,
121
],
[
120,
122
],
[
120,
123
],
[
123,
124
],
[
123,
125
],
[
114,
126
],
[
126,
127
],
[
127,
128
],
[
111,
129
],
[
129,
130
],
[
111,
131
],
[
131,
132
]
] | [
"import java.io.BufferedReader;\nimport java.io.IOException;\nimport java.io.InputStreamReader;\n\nclass Main\n{\n\n\tpublic static void main(String[] args)throws IOException\n\t{\n\t\tBufferedReader br=new BufferedReader(new InputStreamReader(System.in));\n\t\tString str;\n\t\tlong[] ans=new long[2];\n\t\twhile((str=br.readLine())!=null)\n\t\t{\n\t\t\tString[] aa=str.split(\" \");\n\t\t\tlong[] a=new long[aa.length];\n\t\t\tfor(int i=0;i<aa.length;i++)\n\t\t\t{\n\t\t\t\ta[i]=Long.parseLong(aa[i]);\n\t\t\t}\n\t\t\tans[0]=gcd(a[0],a[1]);\n\t\t\tans[1]=(a[0]/ans[0])*a[1];\n\n\t\t\tSystem.out.printf(\"%d %d\\n\",ans[0],ans[1]);\n\n\n\t\t}\n\t}\n\n\tstatic long gcd(long a,long b)\n\t{\n\t\tif(b>0)\n\t\t{\n\t\t\treturn gcd(b,a%b);\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn a;\n\t\t}\n\t}\n}",
"import java.io.BufferedReader;",
"BufferedReader",
"java.io",
"import java.io.IOException;",
"IOException",
"java.io",
"import java.io.InputStreamReader;",
"InputStreamReader",
"java.io",
"class Main\n{\n\n\tpublic static void main(String[] args)throws IOException\n\t{\n\t\tBufferedReader br=new BufferedReader(new InputStreamReader(System.in));\n\t\tString str;\n\t\tlong[] ans=new long[2];\n\t\twhile((str=br.readLine())!=null)\n\t\t{\n\t\t\tString[] aa=str.split(\" \");\n\t\t\tlong[] a=new long[aa.length];\n\t\t\tfor(int i=0;i<aa.length;i++)\n\t\t\t{\n\t\t\t\ta[i]=Long.parseLong(aa[i]);\n\t\t\t}\n\t\t\tans[0]=gcd(a[0],a[1]);\n\t\t\tans[1]=(a[0]/ans[0])*a[1];\n\n\t\t\tSystem.out.printf(\"%d %d\\n\",ans[0],ans[1]);\n\n\n\t\t}\n\t}\n\n\tstatic long gcd(long a,long b)\n\t{\n\t\tif(b>0)\n\t\t{\n\t\t\treturn gcd(b,a%b);\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn a;\n\t\t}\n\t}\n}",
"Main",
"public static void main(String[] args)throws IOException\n\t{\n\t\tBufferedReader br=new BufferedReader(new InputStreamReader(System.in));\n\t\tString str;\n\t\tlong[] ans=new long[2];\n\t\twhile((str=br.readLine())!=null)\n\t\t{\n\t\t\tString[] aa=str.split(\" \");\n\t\t\tlong[] a=new long[aa.length];\n\t\t\tfor(int i=0;i<aa.length;i++)\n\t\t\t{\n\t\t\t\ta[i]=Long.parseLong(aa[i]);\n\t\t\t}\n\t\t\tans[0]=gcd(a[0],a[1]);\n\t\t\tans[1]=(a[0]/ans[0])*a[1];\n\n\t\t\tSystem.out.printf(\"%d %d\\n\",ans[0],ans[1]);\n\n\n\t\t}\n\t}",
"main",
"{\n\t\tBufferedReader br=new BufferedReader(new InputStreamReader(System.in));\n\t\tString str;\n\t\tlong[] ans=new long[2];\n\t\twhile((str=br.readLine())!=null)\n\t\t{\n\t\t\tString[] aa=str.split(\" \");\n\t\t\tlong[] a=new long[aa.length];\n\t\t\tfor(int i=0;i<aa.length;i++)\n\t\t\t{\n\t\t\t\ta[i]=Long.parseLong(aa[i]);\n\t\t\t}\n\t\t\tans[0]=gcd(a[0],a[1]);\n\t\t\tans[1]=(a[0]/ans[0])*a[1];\n\n\t\t\tSystem.out.printf(\"%d %d\\n\",ans[0],ans[1]);\n\n\n\t\t}\n\t}",
"BufferedReader br=new BufferedReader(new InputStreamReader(System.in));",
"br",
"new BufferedReader(new InputStreamReader(System.in))",
"String str;",
"str",
"long[] ans=new long[2];",
"ans",
"new long[2]",
"2",
"while((str=br.readLine())!=null)\n\t\t{\n\t\t\tString[] aa=str.split(\" \");\n\t\t\tlong[] a=new long[aa.length];\n\t\t\tfor(int i=0;i<aa.length;i++)\n\t\t\t{\n\t\t\t\ta[i]=Long.parseLong(aa[i]);\n\t\t\t}\n\t\t\tans[0]=gcd(a[0],a[1]);\n\t\t\tans[1]=(a[0]/ans[0])*a[1];\n\n\t\t\tSystem.out.printf(\"%d %d\\n\",ans[0],ans[1]);\n\n\n\t\t}",
"(str=br.readLine())!=null",
"(str=br.readLine())",
"str",
"br.readLine()",
"br.readLine",
"br",
"null",
"{\n\t\t\tString[] aa=str.split(\" \");\n\t\t\tlong[] a=new long[aa.length];\n\t\t\tfor(int i=0;i<aa.length;i++)\n\t\t\t{\n\t\t\t\ta[i]=Long.parseLong(aa[i]);\n\t\t\t}\n\t\t\tans[0]=gcd(a[0],a[1]);\n\t\t\tans[1]=(a[0]/ans[0])*a[1];\n\n\t\t\tSystem.out.printf(\"%d %d\\n\",ans[0],ans[1]);\n\n\n\t\t}",
"String[] aa=str.split(\" \");",
"aa",
"str.split(\" \")",
"str.split",
"str",
"\" \"",
"long[] a=new long[aa.length];",
"a",
"new long[aa.length]",
"aa.length",
"aa",
"aa.length",
"for(int i=0;i<aa.length;i++)\n\t\t\t{\n\t\t\t\ta[i]=Long.parseLong(aa[i]);\n\t\t\t}",
"int i=0;",
"int i=0;",
"i",
"0",
"i<aa.length",
"i",
"aa.length",
"aa",
"aa.length",
"i++",
"i++",
"i",
"{\n\t\t\t\ta[i]=Long.parseLong(aa[i]);\n\t\t\t}",
"{\n\t\t\t\ta[i]=Long.parseLong(aa[i]);\n\t\t\t}",
"a[i]=Long.parseLong(aa[i])",
"a[i]",
"a",
"i",
"Long.parseLong(aa[i])",
"Long.parseLong",
"Long",
"aa[i]",
"aa",
"i",
"ans[0]=gcd(a[0],a[1])",
"ans[0]",
"ans",
"0",
"gcd(a[0],a[1])",
"gcd",
"a[0]",
"a",
"0",
"a[1]",
"a",
"1",
"ans[1]=(a[0]/ans[0])*a[1]",
"ans[1]",
"ans",
"1",
"(a[0]/ans[0])*a[1]",
"(a[0]/ans[0])",
"a[0]",
"a",
"0",
"ans[0]",
"ans",
"0",
"a[1]",
"a",
"1",
"System.out.printf(\"%d %d\\n\",ans[0],ans[1])",
"System.out.printf",
"System.out",
"System",
"System.out",
"\"%d %d\\n\"",
"ans[0]",
"ans",
"0",
"ans[1]",
"ans",
"1",
"String[] args",
"args",
"static long gcd(long a,long b)\n\t{\n\t\tif(b>0)\n\t\t{\n\t\t\treturn gcd(b,a%b);\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn a;\n\t\t}\n\t}",
"gcd",
"{\n\t\tif(b>0)\n\t\t{\n\t\t\treturn gcd(b,a%b);\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn a;\n\t\t}\n\t}",
"if(b>0)\n\t\t{\n\t\t\treturn gcd(b,a%b);\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn a;\n\t\t}",
"b>0",
"b",
"0",
"{\n\t\t\treturn gcd(b,a%b);\n\t\t}",
"return gcd(b,a%b);",
"gcd(b,a%b)",
"gcd",
"b",
"a%b",
"a",
"b",
"{\n\t\t\treturn a;\n\t\t}",
"return a;",
"a",
"long a",
"a",
"long b",
"b"
] | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
class Main
{
public static void main(String[] args)throws IOException
{
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
String str;
long[] ans=new long[2];
while((str=br.readLine())!=null)
{
String[] aa=str.split(" ");
long[] a=new long[aa.length];
for(int i=0;i<aa.length;i++)
{
a[i]=Long.parseLong(aa[i]);
}
ans[0]=gcd(a[0],a[1]);
ans[1]=(a[0]/ans[0])*a[1];
System.out.printf("%d %d\n",ans[0],ans[1]);
}
}
static long gcd(long a,long b)
{
if(b>0)
{
return gcd(b,a%b);
}
else
{
return a;
}
}
} |
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
17,
42,
4,
18,
13,
30,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
41,
13,
17,
41,
13,
17,
0,
13,
4,
13,
13,
13,
0,
13,
4,
13,
13,
13,
4,
18,
18,
13,
13,
2,
2,
13,
17,
13,
23,
13,
12,
13,
30,
41,
13,
4,
18,
13,
13,
13,
11,
1,
41,
13,
13,
2,
13,
17,
1,
40,
13,
30,
30,
14,
2,
2,
2,
13,
13,
17,
2,
2,
13,
13,
17,
29,
13,
29,
17,
23,
13,
23,
13,
12,
13,
30,
41,
13,
13,
41,
13,
13,
42,
2,
13,
13,
30,
14,
2,
13,
13,
0,
13,
13,
0,
13,
13,
29,
13,
23,
13,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
140,
11
],
[
140,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
15,
17
],
[
14,
18
],
[
18,
19
],
[
18,
20
],
[
14,
21
],
[
21,
22
],
[
22,
23
],
[
23,
24
],
[
21,
25
],
[
25,
26
],
[
26,
27
],
[
26,
28
],
[
28,
29
],
[
29,
30
],
[
25,
31
],
[
31,
32
],
[
31,
33
],
[
33,
34
],
[
34,
35
],
[
25,
36
],
[
36,
37
],
[
36,
38
],
[
25,
39
],
[
39,
40
],
[
39,
41
],
[
25,
42
],
[
42,
43
],
[
42,
44
],
[
44,
45
],
[
44,
46
],
[
44,
47
],
[
25,
48
],
[
48,
49
],
[
48,
50
],
[
50,
51
],
[
50,
52
],
[
50,
53
],
[
25,
54
],
[
54,
55
],
[
55,
56
],
[
56,
57
],
[
56,
58
],
[
54,
59
],
[
60,
60
],
[
60,
61
],
[
60,
62
],
[
60,
63
],
[
12,
64
],
[
64,
65
],
[
140,
66
],
[
66,
67
],
[
66,
68
],
[
68,
69
],
[
69,
70
],
[
69,
71
],
[
71,
72
],
[
72,
73
],
[
71,
74
],
[
71,
75
],
[
68,
76
],
[
76,
77
],
[
77,
78
],
[
78,
79
],
[
78,
80
],
[
76,
81
],
[
81,
82
],
[
81,
83
],
[
76,
84
],
[
84,
85
],
[
85,
86
],
[
76,
87
],
[
88,
88
],
[
88,
89
],
[
89,
90
],
[
90,
91
],
[
91,
92
],
[
92,
93
],
[
92,
94
],
[
91,
95
],
[
90,
96
],
[
96,
97
],
[
97,
98
],
[
97,
99
],
[
96,
100
],
[
89,
101
],
[
101,
102
],
[
68,
103
],
[
103,
104
],
[
66,
105
],
[
105,
106
],
[
66,
107
],
[
107,
108
],
[
140,
109
],
[
109,
110
],
[
109,
111
],
[
111,
112
],
[
112,
113
],
[
112,
114
],
[
111,
115
],
[
115,
116
],
[
115,
117
],
[
111,
118
],
[
118,
119
],
[
119,
120
],
[
119,
121
],
[
118,
122
],
[
122,
123
],
[
123,
124
],
[
124,
125
],
[
124,
126
],
[
123,
127
],
[
127,
128
],
[
127,
129
],
[
123,
130
],
[
130,
131
],
[
130,
132
],
[
111,
133
],
[
133,
134
],
[
109,
135
],
[
135,
136
],
[
109,
137
],
[
137,
138
],
[
0,
139
],
[
139,
140
],
[
139,
141
]
] | [
"import java.util.ArrayList;\nimport java.util.HashMap;\nimport java.util.Scanner;\n\npublic class Main {\n\tpublic static void main(String[] args) {\n\t\tScanner scan = new Scanner(System.in);\n\t\t//int tc = scan.nextInt();\n\t\tint rd = 1;\n\t\twhile(scan.hasNextInt()) {\n\t\t\tint a = scan.nextInt();\n\t\t\tint b = scan.nextInt();\n\t\t\tint lcd = 0;\n\t\t\tint gcd = 0;\n\t\t\tlcd = LCD(a, b);\n\t\t\tgcd = GCD(a, b);\n\t\t\tSystem.out.println(lcd + \" \" + gcd);\n\t\t}\n\t}\n\tpublic static int LCD(int a, int b) {\n\t\tint z = Integer.min(a, b);\n\t\t\n\t\tfor(int i = z; i >= 1; i--) {\n\t\t\tif(a%i == 0 && b%i == 0)\n\t\t\t\treturn i;\n\t\t}\n\t\treturn 1;\n\t}\n\t\n\tpublic static int GCD(int a, int b) {\n\t\tint c = a;\n\t\tint d = b;\n\t\twhile(a != b) {\n\t\t\tif(a < b)\n\t\t\t\ta+=c;\n\t\t\telse\n\t\t\t\tb+=d;\n\t\t}\n\t\treturn a;\n\t}\n}",
"import java.util.ArrayList;",
"ArrayList",
"java.util",
"import java.util.HashMap;",
"HashMap",
"java.util",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n\tpublic static void main(String[] args) {\n\t\tScanner scan = new Scanner(System.in);\n\t\t//int tc = scan.nextInt();\n\t\tint rd = 1;\n\t\twhile(scan.hasNextInt()) {\n\t\t\tint a = scan.nextInt();\n\t\t\tint b = scan.nextInt();\n\t\t\tint lcd = 0;\n\t\t\tint gcd = 0;\n\t\t\tlcd = LCD(a, b);\n\t\t\tgcd = GCD(a, b);\n\t\t\tSystem.out.println(lcd + \" \" + gcd);\n\t\t}\n\t}\n\tpublic static int LCD(int a, int b) {\n\t\tint z = Integer.min(a, b);\n\t\t\n\t\tfor(int i = z; i >= 1; i--) {\n\t\t\tif(a%i == 0 && b%i == 0)\n\t\t\t\treturn i;\n\t\t}\n\t\treturn 1;\n\t}\n\t\n\tpublic static int GCD(int a, int b) {\n\t\tint c = a;\n\t\tint d = b;\n\t\twhile(a != b) {\n\t\t\tif(a < b)\n\t\t\t\ta+=c;\n\t\t\telse\n\t\t\t\tb+=d;\n\t\t}\n\t\treturn a;\n\t}\n}",
"Main",
"public static void main(String[] args) {\n\t\tScanner scan = new Scanner(System.in);\n\t\t//int tc = scan.nextInt();\n\t\tint rd = 1;\n\t\twhile(scan.hasNextInt()) {\n\t\t\tint a = scan.nextInt();\n\t\t\tint b = scan.nextInt();\n\t\t\tint lcd = 0;\n\t\t\tint gcd = 0;\n\t\t\tlcd = LCD(a, b);\n\t\t\tgcd = GCD(a, b);\n\t\t\tSystem.out.println(lcd + \" \" + gcd);\n\t\t}\n\t}",
"main",
"{\n\t\tScanner scan = new Scanner(System.in);\n\t\t//int tc = scan.nextInt();\n\t\tint rd = 1;\n\t\twhile(scan.hasNextInt()) {\n\t\t\tint a = scan.nextInt();\n\t\t\tint b = scan.nextInt();\n\t\t\tint lcd = 0;\n\t\t\tint gcd = 0;\n\t\t\tlcd = LCD(a, b);\n\t\t\tgcd = GCD(a, b);\n\t\t\tSystem.out.println(lcd + \" \" + gcd);\n\t\t}\n\t}",
"Scanner scan = new Scanner(System.in);",
"scan",
"new Scanner(System.in)",
"int rd = 1;",
"rd",
"1",
"while(scan.hasNextInt()) {\n\t\t\tint a = scan.nextInt();\n\t\t\tint b = scan.nextInt();\n\t\t\tint lcd = 0;\n\t\t\tint gcd = 0;\n\t\t\tlcd = LCD(a, b);\n\t\t\tgcd = GCD(a, b);\n\t\t\tSystem.out.println(lcd + \" \" + gcd);\n\t\t}",
"scan.hasNextInt()",
"scan.hasNextInt",
"scan",
"{\n\t\t\tint a = scan.nextInt();\n\t\t\tint b = scan.nextInt();\n\t\t\tint lcd = 0;\n\t\t\tint gcd = 0;\n\t\t\tlcd = LCD(a, b);\n\t\t\tgcd = GCD(a, b);\n\t\t\tSystem.out.println(lcd + \" \" + gcd);\n\t\t}",
"int a = scan.nextInt();",
"a",
"scan.nextInt()",
"scan.nextInt",
"scan",
"int b = scan.nextInt();",
"b",
"scan.nextInt()",
"scan.nextInt",
"scan",
"int lcd = 0;",
"lcd",
"0",
"int gcd = 0;",
"gcd",
"0",
"lcd = LCD(a, b)",
"lcd",
"LCD(a, b)",
"LCD",
"a",
"b",
"gcd = GCD(a, b)",
"gcd",
"GCD(a, b)",
"GCD",
"a",
"b",
"System.out.println(lcd + \" \" + gcd)",
"System.out.println",
"System.out",
"System",
"System.out",
"lcd + \" \" + gcd",
"lcd + \" \" + gcd",
"lcd",
"\" \"",
"gcd",
"String[] args",
"args",
"public static int LCD(int a, int b) {\n\t\tint z = Integer.min(a, b);\n\t\t\n\t\tfor(int i = z; i >= 1; i--) {\n\t\t\tif(a%i == 0 && b%i == 0)\n\t\t\t\treturn i;\n\t\t}\n\t\treturn 1;\n\t}",
"LCD",
"{\n\t\tint z = Integer.min(a, b);\n\t\t\n\t\tfor(int i = z; i >= 1; i--) {\n\t\t\tif(a%i == 0 && b%i == 0)\n\t\t\t\treturn i;\n\t\t}\n\t\treturn 1;\n\t}",
"int z = Integer.min(a, b);",
"z",
"Integer.min(a, b)",
"Integer.min",
"Integer",
"a",
"b",
"for(int i = z; i >= 1; i--) {\n\t\t\tif(a%i == 0 && b%i == 0)\n\t\t\t\treturn i;\n\t\t}",
"int i = z;",
"int i = z;",
"i",
"z",
"i >= 1",
"i",
"1",
"i--",
"i--",
"i",
"{\n\t\t\tif(a%i == 0 && b%i == 0)\n\t\t\t\treturn i;\n\t\t}",
"{\n\t\t\tif(a%i == 0 && b%i == 0)\n\t\t\t\treturn i;\n\t\t}",
"if(a%i == 0 && b%i == 0)\n\t\t\t\treturn i;",
"a%i == 0 && b%i == 0",
"a%i == 0",
"a%i",
"a",
"i",
"0",
"b%i == 0",
"b%i",
"b",
"i",
"0",
"return i;",
"i",
"return 1;",
"1",
"int a",
"a",
"int b",
"b",
"public static int GCD(int a, int b) {\n\t\tint c = a;\n\t\tint d = b;\n\t\twhile(a != b) {\n\t\t\tif(a < b)\n\t\t\t\ta+=c;\n\t\t\telse\n\t\t\t\tb+=d;\n\t\t}\n\t\treturn a;\n\t}",
"GCD",
"{\n\t\tint c = a;\n\t\tint d = b;\n\t\twhile(a != b) {\n\t\t\tif(a < b)\n\t\t\t\ta+=c;\n\t\t\telse\n\t\t\t\tb+=d;\n\t\t}\n\t\treturn a;\n\t}",
"int c = a;",
"c",
"a",
"int d = b;",
"d",
"b",
"while(a != b) {\n\t\t\tif(a < b)\n\t\t\t\ta+=c;\n\t\t\telse\n\t\t\t\tb+=d;\n\t\t}",
"a != b",
"a",
"b",
"{\n\t\t\tif(a < b)\n\t\t\t\ta+=c;\n\t\t\telse\n\t\t\t\tb+=d;\n\t\t}",
"if(a < b)\n\t\t\t\ta+=c;\n\t\t\telse\n\t\t\t\tb+=d;",
"a < b",
"a",
"b",
"a+=c",
"a",
"c",
"b+=d",
"b",
"d",
"return a;",
"a",
"int a",
"a",
"int b",
"b",
"public class Main {\n\tpublic static void main(String[] args) {\n\t\tScanner scan = new Scanner(System.in);\n\t\t//int tc = scan.nextInt();\n\t\tint rd = 1;\n\t\twhile(scan.hasNextInt()) {\n\t\t\tint a = scan.nextInt();\n\t\t\tint b = scan.nextInt();\n\t\t\tint lcd = 0;\n\t\t\tint gcd = 0;\n\t\t\tlcd = LCD(a, b);\n\t\t\tgcd = GCD(a, b);\n\t\t\tSystem.out.println(lcd + \" \" + gcd);\n\t\t}\n\t}\n\tpublic static int LCD(int a, int b) {\n\t\tint z = Integer.min(a, b);\n\t\t\n\t\tfor(int i = z; i >= 1; i--) {\n\t\t\tif(a%i == 0 && b%i == 0)\n\t\t\t\treturn i;\n\t\t}\n\t\treturn 1;\n\t}\n\t\n\tpublic static int GCD(int a, int b) {\n\t\tint c = a;\n\t\tint d = b;\n\t\twhile(a != b) {\n\t\t\tif(a < b)\n\t\t\t\ta+=c;\n\t\t\telse\n\t\t\t\tb+=d;\n\t\t}\n\t\treturn a;\n\t}\n}",
"public class Main {\n\tpublic static void main(String[] args) {\n\t\tScanner scan = new Scanner(System.in);\n\t\t//int tc = scan.nextInt();\n\t\tint rd = 1;\n\t\twhile(scan.hasNextInt()) {\n\t\t\tint a = scan.nextInt();\n\t\t\tint b = scan.nextInt();\n\t\t\tint lcd = 0;\n\t\t\tint gcd = 0;\n\t\t\tlcd = LCD(a, b);\n\t\t\tgcd = GCD(a, b);\n\t\t\tSystem.out.println(lcd + \" \" + gcd);\n\t\t}\n\t}\n\tpublic static int LCD(int a, int b) {\n\t\tint z = Integer.min(a, b);\n\t\t\n\t\tfor(int i = z; i >= 1; i--) {\n\t\t\tif(a%i == 0 && b%i == 0)\n\t\t\t\treturn i;\n\t\t}\n\t\treturn 1;\n\t}\n\t\n\tpublic static int GCD(int a, int b) {\n\t\tint c = a;\n\t\tint d = b;\n\t\twhile(a != b) {\n\t\t\tif(a < b)\n\t\t\t\ta+=c;\n\t\t\telse\n\t\t\t\tb+=d;\n\t\t}\n\t\treturn a;\n\t}\n}",
"Main"
] | import java.util.ArrayList;
import java.util.HashMap;
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
//int tc = scan.nextInt();
int rd = 1;
while(scan.hasNextInt()) {
int a = scan.nextInt();
int b = scan.nextInt();
int lcd = 0;
int gcd = 0;
lcd = LCD(a, b);
gcd = GCD(a, b);
System.out.println(lcd + " " + gcd);
}
}
public static int LCD(int a, int b) {
int z = Integer.min(a, b);
for(int i = z; i >= 1; i--) {
if(a%i == 0 && b%i == 0)
return i;
}
return 1;
}
public static int GCD(int a, int b) {
int c = a;
int d = b;
while(a != b) {
if(a < b)
a+=c;
else
b+=d;
}
return a;
}
} |
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
42,
4,
18,
13,
30,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
41,
13,
41,
13,
41,
13,
13,
41,
13,
13,
42,
2,
0,
13,
2,
13,
13,
17,
30,
0,
13,
13,
0,
13,
13,
0,
13,
2,
2,
13,
13,
13,
4,
18,
18,
13,
13,
2,
2,
13,
17,
13,
23,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
13,
14
],
[
14,
15
],
[
12,
16
],
[
16,
17
],
[
17,
18
],
[
17,
19
],
[
19,
20
],
[
20,
21
],
[
16,
22
],
[
22,
23
],
[
22,
24
],
[
24,
25
],
[
25,
26
],
[
16,
27
],
[
27,
28
],
[
16,
29
],
[
29,
30
],
[
16,
31
],
[
31,
32
],
[
31,
33
],
[
16,
34
],
[
34,
35
],
[
34,
36
],
[
16,
37
],
[
37,
38
],
[
38,
39
],
[
39,
40
],
[
39,
41
],
[
41,
42
],
[
41,
43
],
[
38,
44
],
[
37,
45
],
[
45,
46
],
[
46,
47
],
[
46,
48
],
[
45,
49
],
[
49,
50
],
[
49,
51
],
[
16,
52
],
[
52,
53
],
[
52,
54
],
[
54,
55
],
[
55,
56
],
[
55,
57
],
[
54,
58
],
[
16,
59
],
[
59,
60
],
[
60,
61
],
[
61,
62
],
[
61,
63
],
[
59,
64
],
[
65,
65
],
[
65,
66
],
[
65,
67
],
[
65,
68
],
[
6,
69
],
[
69,
70
]
] | [
"//import java.util.Arrays;\nimport java.util.Scanner;\nclass Main {\n\tpublic static void main(String[] args) {\n\t\tScanner scan = new Scanner(System.in);\n\t\t\n\t\twhile(scan.hasNext()){\n\t\t\tlong a = scan.nextLong();\n\t\t\tlong b = scan.nextLong();\n\t\t\tlong c;\n\t\t\tlong r;\n\t\t\tlong A = a;\n\t\t\tlong B = b;\n\t\t\t\twhile((r = a%b) != 0){\n\t\t\t\t\ta=b;\n\t\t\t\t\tb=r;\n\t\t\t\t}\n\t\t\n\t\t\t\tc = A*B/b;\n\t\t\n\t\t\t\tSystem.out.println(b + \" \" + c);\n\t\t}\n\t}\n} ",
"import java.util.Scanner;",
"Scanner",
"java.util",
"class Main {\n\tpublic static void main(String[] args) {\n\t\tScanner scan = new Scanner(System.in);\n\t\t\n\t\twhile(scan.hasNext()){\n\t\t\tlong a = scan.nextLong();\n\t\t\tlong b = scan.nextLong();\n\t\t\tlong c;\n\t\t\tlong r;\n\t\t\tlong A = a;\n\t\t\tlong B = b;\n\t\t\t\twhile((r = a%b) != 0){\n\t\t\t\t\ta=b;\n\t\t\t\t\tb=r;\n\t\t\t\t}\n\t\t\n\t\t\t\tc = A*B/b;\n\t\t\n\t\t\t\tSystem.out.println(b + \" \" + c);\n\t\t}\n\t}\n}",
"Main",
"public static void main(String[] args) {\n\t\tScanner scan = new Scanner(System.in);\n\t\t\n\t\twhile(scan.hasNext()){\n\t\t\tlong a = scan.nextLong();\n\t\t\tlong b = scan.nextLong();\n\t\t\tlong c;\n\t\t\tlong r;\n\t\t\tlong A = a;\n\t\t\tlong B = b;\n\t\t\t\twhile((r = a%b) != 0){\n\t\t\t\t\ta=b;\n\t\t\t\t\tb=r;\n\t\t\t\t}\n\t\t\n\t\t\t\tc = A*B/b;\n\t\t\n\t\t\t\tSystem.out.println(b + \" \" + c);\n\t\t}\n\t}",
"main",
"{\n\t\tScanner scan = new Scanner(System.in);\n\t\t\n\t\twhile(scan.hasNext()){\n\t\t\tlong a = scan.nextLong();\n\t\t\tlong b = scan.nextLong();\n\t\t\tlong c;\n\t\t\tlong r;\n\t\t\tlong A = a;\n\t\t\tlong B = b;\n\t\t\t\twhile((r = a%b) != 0){\n\t\t\t\t\ta=b;\n\t\t\t\t\tb=r;\n\t\t\t\t}\n\t\t\n\t\t\t\tc = A*B/b;\n\t\t\n\t\t\t\tSystem.out.println(b + \" \" + c);\n\t\t}\n\t}",
"Scanner scan = new Scanner(System.in);",
"scan",
"new Scanner(System.in)",
"while(scan.hasNext()){\n\t\t\tlong a = scan.nextLong();\n\t\t\tlong b = scan.nextLong();\n\t\t\tlong c;\n\t\t\tlong r;\n\t\t\tlong A = a;\n\t\t\tlong B = b;\n\t\t\t\twhile((r = a%b) != 0){\n\t\t\t\t\ta=b;\n\t\t\t\t\tb=r;\n\t\t\t\t}\n\t\t\n\t\t\t\tc = A*B/b;\n\t\t\n\t\t\t\tSystem.out.println(b + \" \" + c);\n\t\t}",
"scan.hasNext()",
"scan.hasNext",
"scan",
"{\n\t\t\tlong a = scan.nextLong();\n\t\t\tlong b = scan.nextLong();\n\t\t\tlong c;\n\t\t\tlong r;\n\t\t\tlong A = a;\n\t\t\tlong B = b;\n\t\t\t\twhile((r = a%b) != 0){\n\t\t\t\t\ta=b;\n\t\t\t\t\tb=r;\n\t\t\t\t}\n\t\t\n\t\t\t\tc = A*B/b;\n\t\t\n\t\t\t\tSystem.out.println(b + \" \" + c);\n\t\t}",
"long a = scan.nextLong();",
"a",
"scan.nextLong()",
"scan.nextLong",
"scan",
"long b = scan.nextLong();",
"b",
"scan.nextLong()",
"scan.nextLong",
"scan",
"long c;",
"c",
"long r;",
"r",
"long A = a;",
"A",
"a",
"long B = b;",
"B",
"b",
"while((r = a%b) != 0){\n\t\t\t\t\ta=b;\n\t\t\t\t\tb=r;\n\t\t\t\t}",
"(r = a%b) != 0",
"(r = a%b)",
"r",
"a%b",
"a",
"b",
"0",
"{\n\t\t\t\t\ta=b;\n\t\t\t\t\tb=r;\n\t\t\t\t}",
"a=b",
"a",
"b",
"b=r",
"b",
"r",
"c = A*B/b",
"c",
"A*B/b",
"A*B",
"A",
"B",
"b",
"System.out.println(b + \" \" + c)",
"System.out.println",
"System.out",
"System",
"System.out",
"b + \" \" + c",
"b + \" \" + c",
"b",
"\" \"",
"c",
"String[] args",
"args"
] | //import java.util.Arrays;
import java.util.Scanner;
class Main {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
while(scan.hasNext()){
long a = scan.nextLong();
long b = scan.nextLong();
long c;
long r;
long A = a;
long B = b;
while((r = a%b) != 0){
a=b;
b=r;
}
c = A*B/b;
System.out.println(b + " " + c);
}
}
} |
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
42,
4,
18,
13,
30,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
41,
13,
2,
13,
13,
41,
13,
14,
2,
13,
17,
30,
0,
13,
4,
13,
13,
13,
30,
0,
13,
4,
13,
13,
13,
41,
13,
2,
2,
13,
13,
13,
4,
18,
18,
13,
13,
2,
2,
13,
17,
13,
23,
13,
12,
13,
30,
41,
13,
2,
13,
13,
14,
2,
13,
17,
30,
29,
13,
30,
29,
4,
13,
13,
13,
23,
13,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
97,
5
],
[
97,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
13,
14
],
[
14,
15
],
[
12,
16
],
[
16,
17
],
[
17,
18
],
[
17,
19
],
[
19,
20
],
[
20,
21
],
[
16,
22
],
[
22,
23
],
[
22,
24
],
[
24,
25
],
[
25,
26
],
[
16,
27
],
[
27,
28
],
[
27,
29
],
[
29,
30
],
[
29,
31
],
[
16,
32
],
[
32,
33
],
[
16,
34
],
[
34,
35
],
[
35,
36
],
[
35,
37
],
[
34,
38
],
[
38,
39
],
[
39,
40
],
[
39,
41
],
[
41,
42
],
[
41,
43
],
[
41,
44
],
[
34,
45
],
[
45,
46
],
[
46,
47
],
[
46,
48
],
[
48,
49
],
[
48,
50
],
[
48,
51
],
[
16,
52
],
[
52,
53
],
[
52,
54
],
[
54,
55
],
[
55,
56
],
[
55,
57
],
[
54,
58
],
[
16,
59
],
[
59,
60
],
[
60,
61
],
[
61,
62
],
[
61,
63
],
[
59,
64
],
[
65,
65
],
[
65,
66
],
[
65,
67
],
[
65,
68
],
[
6,
69
],
[
69,
70
],
[
97,
71
],
[
71,
72
],
[
71,
73
],
[
73,
74
],
[
74,
75
],
[
74,
76
],
[
76,
77
],
[
76,
78
],
[
73,
79
],
[
79,
80
],
[
80,
81
],
[
80,
82
],
[
79,
83
],
[
83,
84
],
[
84,
85
],
[
79,
86
],
[
86,
87
],
[
87,
88
],
[
88,
89
],
[
88,
90
],
[
88,
91
],
[
71,
92
],
[
92,
93
],
[
71,
94
],
[
94,
95
],
[
0,
96
],
[
96,
97
],
[
96,
98
]
] | [
"import java.util.Scanner;\n\npublic class Main {\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n while (sc.hasNext()){\n long a = sc.nextLong();\n long b = sc.nextLong();\n long c = a - b;\n long gcd;\n if (c < 0){\n gcd = gcd(b, a);\n } else {\n gcd = gcd(a, b);\n }\n long lcm = a * b / gcd;\n System.out.println(gcd + \" \" + lcm);\n }\n }\n\n public static long gcd(long a, long b){\n long c = a % b;\n if (c == 0 ){\n return b;\n } else {\n return gcd(b, c);\n }\n }\n}\n",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n while (sc.hasNext()){\n long a = sc.nextLong();\n long b = sc.nextLong();\n long c = a - b;\n long gcd;\n if (c < 0){\n gcd = gcd(b, a);\n } else {\n gcd = gcd(a, b);\n }\n long lcm = a * b / gcd;\n System.out.println(gcd + \" \" + lcm);\n }\n }\n\n public static long gcd(long a, long b){\n long c = a % b;\n if (c == 0 ){\n return b;\n } else {\n return gcd(b, c);\n }\n }\n}",
"Main",
"public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n while (sc.hasNext()){\n long a = sc.nextLong();\n long b = sc.nextLong();\n long c = a - b;\n long gcd;\n if (c < 0){\n gcd = gcd(b, a);\n } else {\n gcd = gcd(a, b);\n }\n long lcm = a * b / gcd;\n System.out.println(gcd + \" \" + lcm);\n }\n }",
"main",
"{\n Scanner sc = new Scanner(System.in);\n while (sc.hasNext()){\n long a = sc.nextLong();\n long b = sc.nextLong();\n long c = a - b;\n long gcd;\n if (c < 0){\n gcd = gcd(b, a);\n } else {\n gcd = gcd(a, b);\n }\n long lcm = a * b / gcd;\n System.out.println(gcd + \" \" + lcm);\n }\n }",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"while (sc.hasNext()){\n long a = sc.nextLong();\n long b = sc.nextLong();\n long c = a - b;\n long gcd;\n if (c < 0){\n gcd = gcd(b, a);\n } else {\n gcd = gcd(a, b);\n }\n long lcm = a * b / gcd;\n System.out.println(gcd + \" \" + lcm);\n }",
"sc.hasNext()",
"sc.hasNext",
"sc",
"{\n long a = sc.nextLong();\n long b = sc.nextLong();\n long c = a - b;\n long gcd;\n if (c < 0){\n gcd = gcd(b, a);\n } else {\n gcd = gcd(a, b);\n }\n long lcm = a * b / gcd;\n System.out.println(gcd + \" \" + lcm);\n }",
"long a = sc.nextLong();",
"a",
"sc.nextLong()",
"sc.nextLong",
"sc",
"long b = sc.nextLong();",
"b",
"sc.nextLong()",
"sc.nextLong",
"sc",
"long c = a - b;",
"c",
"a - b",
"a",
"b",
"long gcd;",
"gcd",
"if (c < 0){\n gcd = gcd(b, a);\n } else {\n gcd = gcd(a, b);\n }",
"c < 0",
"c",
"0",
"{\n gcd = gcd(b, a);\n }",
"gcd = gcd(b, a)",
"gcd",
"gcd(b, a)",
"gcd",
"b",
"a",
"{\n gcd = gcd(a, b);\n }",
"gcd = gcd(a, b)",
"gcd",
"gcd(a, b)",
"gcd",
"a",
"b",
"long lcm = a * b / gcd;",
"lcm",
"a * b / gcd",
"a * b",
"a",
"b",
"gcd",
"System.out.println(gcd + \" \" + lcm)",
"System.out.println",
"System.out",
"System",
"System.out",
"gcd + \" \" + lcm",
"gcd + \" \" + lcm",
"gcd",
"\" \"",
"lcm",
"String[] args",
"args",
"public static long gcd(long a, long b){\n long c = a % b;\n if (c == 0 ){\n return b;\n } else {\n return gcd(b, c);\n }\n }",
"gcd",
"{\n long c = a % b;\n if (c == 0 ){\n return b;\n } else {\n return gcd(b, c);\n }\n }",
"long c = a % b;",
"c",
"a % b",
"a",
"b",
"if (c == 0 ){\n return b;\n } else {\n return gcd(b, c);\n }",
"c == 0",
"c",
"0",
"{\n return b;\n }",
"return b;",
"b",
"{\n return gcd(b, c);\n }",
"return gcd(b, c);",
"gcd(b, c)",
"gcd",
"b",
"c",
"long a",
"a",
"long b",
"b",
"public class Main {\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n while (sc.hasNext()){\n long a = sc.nextLong();\n long b = sc.nextLong();\n long c = a - b;\n long gcd;\n if (c < 0){\n gcd = gcd(b, a);\n } else {\n gcd = gcd(a, b);\n }\n long lcm = a * b / gcd;\n System.out.println(gcd + \" \" + lcm);\n }\n }\n\n public static long gcd(long a, long b){\n long c = a % b;\n if (c == 0 ){\n return b;\n } else {\n return gcd(b, c);\n }\n }\n}",
"public class Main {\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n while (sc.hasNext()){\n long a = sc.nextLong();\n long b = sc.nextLong();\n long c = a - b;\n long gcd;\n if (c < 0){\n gcd = gcd(b, a);\n } else {\n gcd = gcd(a, b);\n }\n long lcm = a * b / gcd;\n System.out.println(gcd + \" \" + lcm);\n }\n }\n\n public static long gcd(long a, long b){\n long c = a % b;\n if (c == 0 ){\n return b;\n } else {\n return gcd(b, c);\n }\n }\n}",
"Main"
] | import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
while (sc.hasNext()){
long a = sc.nextLong();
long b = sc.nextLong();
long c = a - b;
long gcd;
if (c < 0){
gcd = gcd(b, a);
} else {
gcd = gcd(a, b);
}
long lcm = a * b / gcd;
System.out.println(gcd + " " + lcm);
}
}
public static long gcd(long a, long b){
long c = a % b;
if (c == 0 ){
return b;
} else {
return gcd(b, c);
}
}
}
|
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
42,
2,
13,
17,
30,
41,
13,
4,
18,
13,
17,
41,
13,
4,
18,
13,
18,
13,
17,
41,
13,
4,
18,
13,
18,
13,
17,
41,
13,
13,
41,
13,
13,
14,
2,
13,
13,
30,
41,
13,
13,
0,
13,
13,
0,
13,
13,
41,
13,
2,
13,
13,
42,
2,
13,
17,
30,
0,
13,
13,
0,
13,
13,
0,
13,
2,
13,
13,
41,
13,
13,
4,
18,
18,
13,
13,
13,
4,
18,
18,
13,
13,
17,
4,
18,
18,
13,
13,
2,
2,
13,
13,
13,
0,
13,
4,
18,
13,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
124,
11
],
[
124,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
15,
17
],
[
14,
18
],
[
18,
19
],
[
18,
20
],
[
20,
21
],
[
21,
22
],
[
14,
23
],
[
23,
24
],
[
24,
25
],
[
24,
26
],
[
23,
27
],
[
27,
28
],
[
28,
29
],
[
28,
30
],
[
30,
31
],
[
31,
32
],
[
30,
33
],
[
27,
34
],
[
34,
35
],
[
34,
36
],
[
36,
37
],
[
37,
38
],
[
36,
39
],
[
39,
40
],
[
39,
41
],
[
27,
42
],
[
42,
43
],
[
42,
44
],
[
44,
45
],
[
45,
46
],
[
44,
47
],
[
47,
48
],
[
47,
49
],
[
27,
50
],
[
50,
51
],
[
50,
52
],
[
27,
53
],
[
53,
54
],
[
53,
55
],
[
27,
56
],
[
56,
57
],
[
57,
58
],
[
57,
59
],
[
56,
60
],
[
60,
61
],
[
61,
62
],
[
61,
63
],
[
60,
64
],
[
64,
65
],
[
64,
66
],
[
60,
67
],
[
67,
68
],
[
67,
69
],
[
27,
70
],
[
70,
71
],
[
70,
72
],
[
72,
73
],
[
72,
74
],
[
27,
75
],
[
75,
76
],
[
76,
77
],
[
76,
78
],
[
75,
79
],
[
79,
80
],
[
80,
81
],
[
80,
82
],
[
79,
83
],
[
83,
84
],
[
83,
85
],
[
79,
86
],
[
86,
87
],
[
86,
88
],
[
88,
89
],
[
88,
90
],
[
27,
91
],
[
91,
92
],
[
91,
93
],
[
27,
94
],
[
94,
95
],
[
95,
96
],
[
96,
97
],
[
96,
98
],
[
94,
99
],
[
27,
100
],
[
100,
101
],
[
101,
102
],
[
102,
103
],
[
102,
104
],
[
100,
105
],
[
27,
106
],
[
106,
107
],
[
107,
108
],
[
108,
109
],
[
108,
110
],
[
106,
111
],
[
111,
112
],
[
112,
113
],
[
112,
114
],
[
111,
115
],
[
27,
116
],
[
116,
117
],
[
116,
118
],
[
118,
119
],
[
119,
120
],
[
12,
121
],
[
121,
122
],
[
0,
123
],
[
123,
124
],
[
123,
125
]
] | [
"import java.util.*;\nimport java.lang.*;\nimport java.io.*;\n\npublic class Main{\n\tpublic static void main (String[] args) throws java.lang.Exception{\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\t\tString line = br.readLine();\n\t while(line!=null){\n\t String[] lines = line.split(\" \");\n \t long a = Integer.parseInt(lines[0]);\n \t long b = Integer.parseInt(lines[1]);\n \t long tmp_a = a;\n \t long tmp_b = b;\n \t \n \t if(a<b){\n \t long tmp = a;\n \t a = b;\n \t b = tmp;\n \t }\n \t long r=a%b;\n \t while(r!=0){\n \t a=b;\n \t b=r;\n \t r=a%b;\n \t }\n \t long GCD = b;\n \t System.out.print(GCD);\n \t System.out.print(\" \");\n \t System.out.println((tmp_a*tmp_b)/GCD);\n\t line = br.readLine();\n\t }\n\t}\n}",
"import java.util.*;",
"util.*",
"java",
"import java.lang.*;",
"lang.*",
"java",
"import java.io.*;",
"io.*",
"java",
"public class Main{\n\tpublic static void main (String[] args) throws java.lang.Exception{\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\t\tString line = br.readLine();\n\t while(line!=null){\n\t String[] lines = line.split(\" \");\n \t long a = Integer.parseInt(lines[0]);\n \t long b = Integer.parseInt(lines[1]);\n \t long tmp_a = a;\n \t long tmp_b = b;\n \t \n \t if(a<b){\n \t long tmp = a;\n \t a = b;\n \t b = tmp;\n \t }\n \t long r=a%b;\n \t while(r!=0){\n \t a=b;\n \t b=r;\n \t r=a%b;\n \t }\n \t long GCD = b;\n \t System.out.print(GCD);\n \t System.out.print(\" \");\n \t System.out.println((tmp_a*tmp_b)/GCD);\n\t line = br.readLine();\n\t }\n\t}\n}",
"Main",
"public static void main (String[] args) throws java.lang.Exception{\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\t\tString line = br.readLine();\n\t while(line!=null){\n\t String[] lines = line.split(\" \");\n \t long a = Integer.parseInt(lines[0]);\n \t long b = Integer.parseInt(lines[1]);\n \t long tmp_a = a;\n \t long tmp_b = b;\n \t \n \t if(a<b){\n \t long tmp = a;\n \t a = b;\n \t b = tmp;\n \t }\n \t long r=a%b;\n \t while(r!=0){\n \t a=b;\n \t b=r;\n \t r=a%b;\n \t }\n \t long GCD = b;\n \t System.out.print(GCD);\n \t System.out.print(\" \");\n \t System.out.println((tmp_a*tmp_b)/GCD);\n\t line = br.readLine();\n\t }\n\t}",
"main",
"{\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\t\tString line = br.readLine();\n\t while(line!=null){\n\t String[] lines = line.split(\" \");\n \t long a = Integer.parseInt(lines[0]);\n \t long b = Integer.parseInt(lines[1]);\n \t long tmp_a = a;\n \t long tmp_b = b;\n \t \n \t if(a<b){\n \t long tmp = a;\n \t a = b;\n \t b = tmp;\n \t }\n \t long r=a%b;\n \t while(r!=0){\n \t a=b;\n \t b=r;\n \t r=a%b;\n \t }\n \t long GCD = b;\n \t System.out.print(GCD);\n \t System.out.print(\" \");\n \t System.out.println((tmp_a*tmp_b)/GCD);\n\t line = br.readLine();\n\t }\n\t}",
"BufferedReader br = new BufferedReader(new InputStreamReader(System.in));",
"br",
"new BufferedReader(new InputStreamReader(System.in))",
"String line = br.readLine();",
"line",
"br.readLine()",
"br.readLine",
"br",
"while(line!=null){\n\t String[] lines = line.split(\" \");\n \t long a = Integer.parseInt(lines[0]);\n \t long b = Integer.parseInt(lines[1]);\n \t long tmp_a = a;\n \t long tmp_b = b;\n \t \n \t if(a<b){\n \t long tmp = a;\n \t a = b;\n \t b = tmp;\n \t }\n \t long r=a%b;\n \t while(r!=0){\n \t a=b;\n \t b=r;\n \t r=a%b;\n \t }\n \t long GCD = b;\n \t System.out.print(GCD);\n \t System.out.print(\" \");\n \t System.out.println((tmp_a*tmp_b)/GCD);\n\t line = br.readLine();\n\t }",
"line!=null",
"line",
"null",
"{\n\t String[] lines = line.split(\" \");\n \t long a = Integer.parseInt(lines[0]);\n \t long b = Integer.parseInt(lines[1]);\n \t long tmp_a = a;\n \t long tmp_b = b;\n \t \n \t if(a<b){\n \t long tmp = a;\n \t a = b;\n \t b = tmp;\n \t }\n \t long r=a%b;\n \t while(r!=0){\n \t a=b;\n \t b=r;\n \t r=a%b;\n \t }\n \t long GCD = b;\n \t System.out.print(GCD);\n \t System.out.print(\" \");\n \t System.out.println((tmp_a*tmp_b)/GCD);\n\t line = br.readLine();\n\t }",
"String[] lines = line.split(\" \");",
"lines",
"line.split(\" \")",
"line.split",
"line",
"\" \"",
"long a = Integer.parseInt(lines[0]);",
"a",
"Integer.parseInt(lines[0])",
"Integer.parseInt",
"Integer",
"lines[0]",
"lines",
"0",
"long b = Integer.parseInt(lines[1]);",
"b",
"Integer.parseInt(lines[1])",
"Integer.parseInt",
"Integer",
"lines[1]",
"lines",
"1",
"long tmp_a = a;",
"tmp_a",
"a",
"long tmp_b = b;",
"tmp_b",
"b",
"if(a<b){\n \t long tmp = a;\n \t a = b;\n \t b = tmp;\n \t }",
"a<b",
"a",
"b",
"{\n \t long tmp = a;\n \t a = b;\n \t b = tmp;\n \t }",
"long tmp = a;",
"tmp",
"a",
"a = b",
"a",
"b",
"b = tmp",
"b",
"tmp",
"long r=a%b;",
"r",
"a%b",
"a",
"b",
"while(r!=0){\n \t a=b;\n \t b=r;\n \t r=a%b;\n \t }",
"r!=0",
"r",
"0",
"{\n \t a=b;\n \t b=r;\n \t r=a%b;\n \t }",
"a=b",
"a",
"b",
"b=r",
"b",
"r",
"r=a%b",
"r",
"a%b",
"a",
"b",
"long GCD = b;",
"GCD",
"b",
"System.out.print(GCD)",
"System.out.print",
"System.out",
"System",
"System.out",
"GCD",
"System.out.print(\" \")",
"System.out.print",
"System.out",
"System",
"System.out",
"\" \"",
"System.out.println((tmp_a*tmp_b)/GCD)",
"System.out.println",
"System.out",
"System",
"System.out",
"(tmp_a*tmp_b)/GCD",
"(tmp_a*tmp_b)",
"tmp_a",
"tmp_b",
"GCD",
"line = br.readLine()",
"line",
"br.readLine()",
"br.readLine",
"br",
"String[] args",
"args",
"public class Main{\n\tpublic static void main (String[] args) throws java.lang.Exception{\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\t\tString line = br.readLine();\n\t while(line!=null){\n\t String[] lines = line.split(\" \");\n \t long a = Integer.parseInt(lines[0]);\n \t long b = Integer.parseInt(lines[1]);\n \t long tmp_a = a;\n \t long tmp_b = b;\n \t \n \t if(a<b){\n \t long tmp = a;\n \t a = b;\n \t b = tmp;\n \t }\n \t long r=a%b;\n \t while(r!=0){\n \t a=b;\n \t b=r;\n \t r=a%b;\n \t }\n \t long GCD = b;\n \t System.out.print(GCD);\n \t System.out.print(\" \");\n \t System.out.println((tmp_a*tmp_b)/GCD);\n\t line = br.readLine();\n\t }\n\t}\n}",
"public class Main{\n\tpublic static void main (String[] args) throws java.lang.Exception{\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\t\tString line = br.readLine();\n\t while(line!=null){\n\t String[] lines = line.split(\" \");\n \t long a = Integer.parseInt(lines[0]);\n \t long b = Integer.parseInt(lines[1]);\n \t long tmp_a = a;\n \t long tmp_b = b;\n \t \n \t if(a<b){\n \t long tmp = a;\n \t a = b;\n \t b = tmp;\n \t }\n \t long r=a%b;\n \t while(r!=0){\n \t a=b;\n \t b=r;\n \t r=a%b;\n \t }\n \t long GCD = b;\n \t System.out.print(GCD);\n \t System.out.print(\" \");\n \t System.out.println((tmp_a*tmp_b)/GCD);\n\t line = br.readLine();\n\t }\n\t}\n}",
"Main"
] | import java.util.*;
import java.lang.*;
import java.io.*;
public class Main{
public static void main (String[] args) throws java.lang.Exception{
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
String line = br.readLine();
while(line!=null){
String[] lines = line.split(" ");
long a = Integer.parseInt(lines[0]);
long b = Integer.parseInt(lines[1]);
long tmp_a = a;
long tmp_b = b;
if(a<b){
long tmp = a;
a = b;
b = tmp;
}
long r=a%b;
while(r!=0){
a=b;
b=r;
r=a%b;
}
long GCD = b;
System.out.print(GCD);
System.out.print(" ");
System.out.println((tmp_a*tmp_b)/GCD);
line = br.readLine();
}
}
} |
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
42,
4,
18,
13,
30,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
4,
18,
18,
13,
13,
17,
4,
13,
13,
13,
4,
13,
13,
13,
23,
13,
12,
13,
30,
14,
2,
13,
17,
30,
29,
13,
29,
4,
13,
13,
2,
13,
13,
23,
13,
23,
13,
12,
13,
30,
29,
2,
2,
13,
13,
4,
13,
13,
13,
23,
13,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
81,
5
],
[
81,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
13,
14
],
[
14,
15
],
[
12,
16
],
[
16,
17
],
[
17,
18
],
[
17,
19
],
[
19,
20
],
[
20,
21
],
[
16,
22
],
[
22,
23
],
[
22,
24
],
[
24,
25
],
[
25,
26
],
[
16,
27
],
[
27,
28
],
[
28,
29
],
[
29,
30
],
[
29,
31
],
[
27,
32
],
[
27,
33
],
[
33,
34
],
[
33,
35
],
[
33,
36
],
[
27,
37
],
[
37,
38
],
[
37,
39
],
[
37,
40
],
[
6,
41
],
[
41,
42
],
[
81,
43
],
[
43,
44
],
[
43,
45
],
[
45,
46
],
[
46,
47
],
[
47,
48
],
[
47,
49
],
[
46,
50
],
[
50,
51
],
[
51,
52
],
[
45,
53
],
[
53,
54
],
[
54,
55
],
[
54,
56
],
[
54,
57
],
[
57,
58
],
[
57,
59
],
[
43,
60
],
[
60,
61
],
[
43,
62
],
[
62,
63
],
[
81,
64
],
[
64,
65
],
[
64,
66
],
[
66,
67
],
[
67,
68
],
[
68,
69
],
[
69,
70
],
[
69,
71
],
[
68,
72
],
[
72,
73
],
[
72,
74
],
[
72,
75
],
[
64,
76
],
[
76,
77
],
[
64,
78
],
[
78,
79
],
[
0,
80
],
[
80,
81
],
[
80,
82
]
] | [
"import java.util.Scanner;\n\npublic class Main {\n public static void main(String[] args) {\n Scanner sn = new Scanner(System.in);\n while (sn.hasNext()) {\n long a = sn.nextLong();\n long b = sn.nextLong();\n System.out.printf(\"%d %d\\n\", gcd(a, b), lcm(a, b));\n }\n }\n\n public static long gcd(long a, long b) {\n if (b == 0) {\n return a;\n }\n return gcd(b, a % b);\n }\n\n public static long lcm(long a, long b) {\n return a * b / gcd(a, b);\n }\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n public static void main(String[] args) {\n Scanner sn = new Scanner(System.in);\n while (sn.hasNext()) {\n long a = sn.nextLong();\n long b = sn.nextLong();\n System.out.printf(\"%d %d\\n\", gcd(a, b), lcm(a, b));\n }\n }\n\n public static long gcd(long a, long b) {\n if (b == 0) {\n return a;\n }\n return gcd(b, a % b);\n }\n\n public static long lcm(long a, long b) {\n return a * b / gcd(a, b);\n }\n}",
"Main",
"public static void main(String[] args) {\n Scanner sn = new Scanner(System.in);\n while (sn.hasNext()) {\n long a = sn.nextLong();\n long b = sn.nextLong();\n System.out.printf(\"%d %d\\n\", gcd(a, b), lcm(a, b));\n }\n }",
"main",
"{\n Scanner sn = new Scanner(System.in);\n while (sn.hasNext()) {\n long a = sn.nextLong();\n long b = sn.nextLong();\n System.out.printf(\"%d %d\\n\", gcd(a, b), lcm(a, b));\n }\n }",
"Scanner sn = new Scanner(System.in);",
"sn",
"new Scanner(System.in)",
"while (sn.hasNext()) {\n long a = sn.nextLong();\n long b = sn.nextLong();\n System.out.printf(\"%d %d\\n\", gcd(a, b), lcm(a, b));\n }",
"sn.hasNext()",
"sn.hasNext",
"sn",
"{\n long a = sn.nextLong();\n long b = sn.nextLong();\n System.out.printf(\"%d %d\\n\", gcd(a, b), lcm(a, b));\n }",
"long a = sn.nextLong();",
"a",
"sn.nextLong()",
"sn.nextLong",
"sn",
"long b = sn.nextLong();",
"b",
"sn.nextLong()",
"sn.nextLong",
"sn",
"System.out.printf(\"%d %d\\n\", gcd(a, b), lcm(a, b))",
"System.out.printf",
"System.out",
"System",
"System.out",
"\"%d %d\\n\"",
"gcd(a, b)",
"gcd",
"a",
"b",
"lcm(a, b)",
"lcm",
"a",
"b",
"String[] args",
"args",
"public static long gcd(long a, long b) {\n if (b == 0) {\n return a;\n }\n return gcd(b, a % b);\n }",
"gcd",
"{\n if (b == 0) {\n return a;\n }\n return gcd(b, a % b);\n }",
"if (b == 0) {\n return a;\n }",
"b == 0",
"b",
"0",
"{\n return a;\n }",
"return a;",
"a",
"return gcd(b, a % b);",
"gcd(b, a % b)",
"gcd",
"b",
"a % b",
"a",
"b",
"long a",
"a",
"long b",
"b",
"public static long lcm(long a, long b) {\n return a * b / gcd(a, b);\n }",
"lcm",
"{\n return a * b / gcd(a, b);\n }",
"return a * b / gcd(a, b);",
"a * b / gcd(a, b)",
"a * b",
"a",
"b",
"gcd(a, b)",
"gcd",
"a",
"b",
"long a",
"a",
"long b",
"b",
"public class Main {\n public static void main(String[] args) {\n Scanner sn = new Scanner(System.in);\n while (sn.hasNext()) {\n long a = sn.nextLong();\n long b = sn.nextLong();\n System.out.printf(\"%d %d\\n\", gcd(a, b), lcm(a, b));\n }\n }\n\n public static long gcd(long a, long b) {\n if (b == 0) {\n return a;\n }\n return gcd(b, a % b);\n }\n\n public static long lcm(long a, long b) {\n return a * b / gcd(a, b);\n }\n}",
"public class Main {\n public static void main(String[] args) {\n Scanner sn = new Scanner(System.in);\n while (sn.hasNext()) {\n long a = sn.nextLong();\n long b = sn.nextLong();\n System.out.printf(\"%d %d\\n\", gcd(a, b), lcm(a, b));\n }\n }\n\n public static long gcd(long a, long b) {\n if (b == 0) {\n return a;\n }\n return gcd(b, a % b);\n }\n\n public static long lcm(long a, long b) {\n return a * b / gcd(a, b);\n }\n}",
"Main"
] | import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sn = new Scanner(System.in);
while (sn.hasNext()) {
long a = sn.nextLong();
long b = sn.nextLong();
System.out.printf("%d %d\n", gcd(a, b), lcm(a, b));
}
}
public static long gcd(long a, long b) {
if (b == 0) {
return a;
}
return gcd(b, a % b);
}
public static long lcm(long a, long b) {
return a * b / gcd(a, b);
}
} |
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
42,
4,
18,
13,
30,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
41,
13,
41,
13,
41,
13,
17,
14,
2,
13,
13,
30,
0,
13,
13,
0,
13,
13,
30,
0,
13,
13,
0,
13,
13,
42,
2,
13,
17,
30,
0,
13,
13,
0,
13,
2,
13,
13,
0,
13,
13,
4,
18,
18,
13,
13,
2,
2,
13,
17,
2,
13,
2,
13,
13,
23,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
13,
14
],
[
14,
15
],
[
12,
16
],
[
16,
17
],
[
17,
18
],
[
17,
19
],
[
19,
20
],
[
20,
21
],
[
16,
22
],
[
22,
23
],
[
22,
24
],
[
24,
25
],
[
25,
26
],
[
16,
27
],
[
27,
28
],
[
16,
29
],
[
29,
30
],
[
16,
31
],
[
31,
32
],
[
31,
33
],
[
16,
34
],
[
34,
35
],
[
35,
36
],
[
35,
37
],
[
34,
38
],
[
38,
39
],
[
39,
40
],
[
39,
41
],
[
38,
42
],
[
42,
43
],
[
42,
44
],
[
34,
45
],
[
45,
46
],
[
46,
47
],
[
46,
48
],
[
45,
49
],
[
49,
50
],
[
49,
51
],
[
16,
52
],
[
52,
53
],
[
53,
54
],
[
53,
55
],
[
52,
56
],
[
56,
57
],
[
57,
58
],
[
57,
59
],
[
56,
60
],
[
60,
61
],
[
60,
62
],
[
62,
63
],
[
62,
64
],
[
56,
65
],
[
65,
66
],
[
65,
67
],
[
16,
68
],
[
68,
69
],
[
69,
70
],
[
70,
71
],
[
70,
72
],
[
68,
73
],
[
74,
74
],
[
74,
75
],
[
74,
76
],
[
74,
77
],
[
77,
78
],
[
77,
79
],
[
79,
80
],
[
79,
81
],
[
6,
82
],
[
82,
83
]
] | [
"import java.util.Scanner;\n \nclass Main {\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n while(sc.hasNext()) {\n int a = sc.nextInt();\n int b = sc.nextInt();\n int x,y;\n int temp = 0;\n if (a < b) {\n x = b;\n y = a;\n } else {\n x = a;\n y = b;\n }\n while(b != 0) {\n temp = b;\n b = a % b;\n a = temp;\n }\n System.out.println(a + \" \" + (x * (y / a)));\n }\n }\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"class Main {\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n while(sc.hasNext()) {\n int a = sc.nextInt();\n int b = sc.nextInt();\n int x,y;\n int temp = 0;\n if (a < b) {\n x = b;\n y = a;\n } else {\n x = a;\n y = b;\n }\n while(b != 0) {\n temp = b;\n b = a % b;\n a = temp;\n }\n System.out.println(a + \" \" + (x * (y / a)));\n }\n }\n}",
"Main",
"public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n while(sc.hasNext()) {\n int a = sc.nextInt();\n int b = sc.nextInt();\n int x,y;\n int temp = 0;\n if (a < b) {\n x = b;\n y = a;\n } else {\n x = a;\n y = b;\n }\n while(b != 0) {\n temp = b;\n b = a % b;\n a = temp;\n }\n System.out.println(a + \" \" + (x * (y / a)));\n }\n }",
"main",
"{\n Scanner sc = new Scanner(System.in);\n while(sc.hasNext()) {\n int a = sc.nextInt();\n int b = sc.nextInt();\n int x,y;\n int temp = 0;\n if (a < b) {\n x = b;\n y = a;\n } else {\n x = a;\n y = b;\n }\n while(b != 0) {\n temp = b;\n b = a % b;\n a = temp;\n }\n System.out.println(a + \" \" + (x * (y / a)));\n }\n }",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"while(sc.hasNext()) {\n int a = sc.nextInt();\n int b = sc.nextInt();\n int x,y;\n int temp = 0;\n if (a < b) {\n x = b;\n y = a;\n } else {\n x = a;\n y = b;\n }\n while(b != 0) {\n temp = b;\n b = a % b;\n a = temp;\n }\n System.out.println(a + \" \" + (x * (y / a)));\n }",
"sc.hasNext()",
"sc.hasNext",
"sc",
"{\n int a = sc.nextInt();\n int b = sc.nextInt();\n int x,y;\n int temp = 0;\n if (a < b) {\n x = b;\n y = a;\n } else {\n x = a;\n y = b;\n }\n while(b != 0) {\n temp = b;\n b = a % b;\n a = temp;\n }\n System.out.println(a + \" \" + (x * (y / a)));\n }",
"int a = sc.nextInt();",
"a",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int b = sc.nextInt();",
"b",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int x",
"x",
"y;",
"y",
"int temp = 0;",
"temp",
"0",
"if (a < b) {\n x = b;\n y = a;\n } else {\n x = a;\n y = b;\n }",
"a < b",
"a",
"b",
"{\n x = b;\n y = a;\n }",
"x = b",
"x",
"b",
"y = a",
"y",
"a",
"{\n x = a;\n y = b;\n }",
"x = a",
"x",
"a",
"y = b",
"y",
"b",
"while(b != 0) {\n temp = b;\n b = a % b;\n a = temp;\n }",
"b != 0",
"b",
"0",
"{\n temp = b;\n b = a % b;\n a = temp;\n }",
"temp = b",
"temp",
"b",
"b = a % b",
"b",
"a % b",
"a",
"b",
"a = temp",
"a",
"temp",
"System.out.println(a + \" \" + (x * (y / a)))",
"System.out.println",
"System.out",
"System",
"System.out",
"a + \" \" + (x * (y / a))",
"a + \" \" + (x * (y / a))",
"a",
"\" \"",
"(x * (y / a))",
"x",
"(y / a)",
"y",
"a",
"String[] args",
"args"
] | import java.util.Scanner;
class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
while(sc.hasNext()) {
int a = sc.nextInt();
int b = sc.nextInt();
int x,y;
int temp = 0;
if (a < b) {
x = b;
y = a;
} else {
x = a;
y = b;
}
while(b != 0) {
temp = b;
b = a % b;
a = temp;
}
System.out.println(a + " " + (x * (y / a)));
}
}
} |
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
17,
38,
5,
13,
30,
4,
18,
13,
30,
42,
2,
0,
13,
4,
18,
13,
17,
30,
0,
13,
4,
18,
13,
41,
13,
4,
18,
13,
17,
14,
2,
18,
13,
13,
17,
4,
18,
13,
40,
17,
41,
13,
20,
17,
41,
13,
17,
28,
13,
13,
30,
30,
0,
18,
13,
13,
4,
18,
13,
13,
14,
2,
2,
18,
13,
13,
17,
2,
18,
13,
13,
17,
4,
18,
13,
40,
17,
40,
13,
41,
13,
18,
13,
17,
41,
13,
18,
13,
17,
41,
13,
4,
13,
13,
13,
4,
18,
18,
13,
13,
2,
2,
4,
13,
13,
13,
17,
2,
13,
2,
13,
13,
23,
13,
12,
13,
30,
41,
13,
13,
41,
13,
13,
42,
2,
13,
13,
30,
14,
2,
13,
13,
0,
13,
13,
0,
13,
13,
29,
13,
23,
13,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
165,
11
],
[
165,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
15,
17
],
[
14,
18
],
[
18,
19
],
[
18,
20
],
[
14,
21
],
[
21,
22
],
[
22,
23
],
[
22,
24
],
[
24,
25
],
[
25,
26
],
[
26,
27
],
[
21,
28
],
[
28,
29
],
[
29,
30
],
[
30,
31
],
[
31,
32
],
[
31,
33
],
[
33,
34
],
[
34,
35
],
[
30,
36
],
[
29,
37
],
[
37,
38
],
[
38,
39
],
[
38,
40
],
[
40,
41
],
[
41,
42
],
[
37,
43
],
[
43,
44
],
[
43,
45
],
[
45,
46
],
[
46,
47
],
[
45,
48
],
[
37,
49
],
[
49,
50
],
[
50,
51
],
[
51,
52
],
[
51,
53
],
[
50,
54
],
[
49,
55
],
[
55,
56
],
[
56,
57
],
[
55,
58
],
[
58,
59
],
[
37,
60
],
[
60,
61
],
[
60,
62
],
[
37,
64
],
[
64,
65
],
[
64,
66
],
[
37,
67
],
[
67,
68
],
[
67,
69
],
[
67,
70
],
[
71,
71
],
[
71,
72
],
[
72,
73
],
[
73,
74
],
[
73,
75
],
[
72,
76
],
[
76,
77
],
[
77,
78
],
[
76,
79
],
[
71,
80
],
[
80,
81
],
[
81,
82
],
[
82,
83
],
[
83,
84
],
[
83,
85
],
[
82,
86
],
[
81,
87
],
[
87,
88
],
[
88,
89
],
[
88,
90
],
[
87,
91
],
[
80,
92
],
[
92,
93
],
[
93,
94
],
[
92,
95
],
[
95,
96
],
[
71,
97
],
[
97,
98
],
[
37,
99
],
[
99,
100
],
[
99,
101
],
[
101,
102
],
[
101,
103
],
[
37,
104
],
[
104,
105
],
[
104,
106
],
[
106,
107
],
[
106,
108
],
[
37,
109
],
[
109,
110
],
[
109,
111
],
[
111,
112
],
[
111,
113
],
[
111,
114
],
[
37,
115
],
[
115,
116
],
[
116,
117
],
[
117,
118
],
[
117,
119
],
[
115,
120
],
[
121,
121
],
[
121,
122
],
[
122,
123
],
[
122,
124
],
[
122,
125
],
[
121,
126
],
[
121,
127
],
[
127,
128
],
[
127,
129
],
[
129,
130
],
[
129,
131
],
[
12,
132
],
[
132,
133
],
[
165,
134
],
[
134,
135
],
[
134,
136
],
[
136,
137
],
[
137,
138
],
[
137,
139
],
[
136,
140
],
[
140,
141
],
[
140,
142
],
[
136,
143
],
[
143,
144
],
[
144,
145
],
[
144,
146
],
[
143,
147
],
[
147,
148
],
[
148,
149
],
[
149,
150
],
[
149,
151
],
[
148,
152
],
[
152,
153
],
[
152,
154
],
[
148,
155
],
[
155,
156
],
[
155,
157
],
[
136,
158
],
[
158,
159
],
[
134,
160
],
[
160,
161
],
[
134,
162
],
[
162,
163
],
[
0,
164
],
[
164,
165
],
[
164,
166
]
] | [
"import java.io.BufferedReader;\nimport java.io.IOException;\nimport java.io.InputStreamReader;\n\npublic class Main {\n\tpublic static void main(String[] args) {\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\t\tString line = null;\n\t\t\n\t\ttry {\n\t\t\twhile((line = br.readLine()) != null) {\n\t\t\t\tline = line.trim();\n\t\t\t\tString[] values = line.split(\"\\\\s\");\n\t\t\t\tif(values.length != 2) System.exit(-1);\n\t\t\t\t\n\t\t\t\tint[] value = new int[2];\n\t\t\t\tint i = 0;\n\t\t\t\tfor(String s : values) {\n\t\t\t\t\tvalue[i] = Integer.parseInt(s);\n\t\t\t\t\tif(value[i] > 2000000000 || value[i] < 0) System.exit(-2);\n\t\t\t\t\ti++;\n\t\t\t\t}\n\t\t\t\tint a = value[0];\n\t\t\t\tint b = value[1];\n\n\t\t\t\tint lcm = getLCM(a, b);\n\t\t\t\t\n\t\t\t\tSystem.out.println(getLCM(a, b) + \" \" + a * (b / lcm));\n\t\t\t}\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}\n\t\n\tstatic int getLCM(int a, int b){\n\t\tint i = a;\n\t\tint j = b;\n\t\twhile(i != j) {\n\t\t\tif(i > j) i -= j;\n\t\t\telse j -= i;\n\t\t}\n\t\treturn i;\n\t}\n\n}",
"import java.io.BufferedReader;",
"BufferedReader",
"java.io",
"import java.io.IOException;",
"IOException",
"java.io",
"import java.io.InputStreamReader;",
"InputStreamReader",
"java.io",
"public class Main {\n\tpublic static void main(String[] args) {\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\t\tString line = null;\n\t\t\n\t\ttry {\n\t\t\twhile((line = br.readLine()) != null) {\n\t\t\t\tline = line.trim();\n\t\t\t\tString[] values = line.split(\"\\\\s\");\n\t\t\t\tif(values.length != 2) System.exit(-1);\n\t\t\t\t\n\t\t\t\tint[] value = new int[2];\n\t\t\t\tint i = 0;\n\t\t\t\tfor(String s : values) {\n\t\t\t\t\tvalue[i] = Integer.parseInt(s);\n\t\t\t\t\tif(value[i] > 2000000000 || value[i] < 0) System.exit(-2);\n\t\t\t\t\ti++;\n\t\t\t\t}\n\t\t\t\tint a = value[0];\n\t\t\t\tint b = value[1];\n\n\t\t\t\tint lcm = getLCM(a, b);\n\t\t\t\t\n\t\t\t\tSystem.out.println(getLCM(a, b) + \" \" + a * (b / lcm));\n\t\t\t}\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}\n\t\n\tstatic int getLCM(int a, int b){\n\t\tint i = a;\n\t\tint j = b;\n\t\twhile(i != j) {\n\t\t\tif(i > j) i -= j;\n\t\t\telse j -= i;\n\t\t}\n\t\treturn i;\n\t}\n\n}",
"Main",
"public static void main(String[] args) {\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\t\tString line = null;\n\t\t\n\t\ttry {\n\t\t\twhile((line = br.readLine()) != null) {\n\t\t\t\tline = line.trim();\n\t\t\t\tString[] values = line.split(\"\\\\s\");\n\t\t\t\tif(values.length != 2) System.exit(-1);\n\t\t\t\t\n\t\t\t\tint[] value = new int[2];\n\t\t\t\tint i = 0;\n\t\t\t\tfor(String s : values) {\n\t\t\t\t\tvalue[i] = Integer.parseInt(s);\n\t\t\t\t\tif(value[i] > 2000000000 || value[i] < 0) System.exit(-2);\n\t\t\t\t\ti++;\n\t\t\t\t}\n\t\t\t\tint a = value[0];\n\t\t\t\tint b = value[1];\n\n\t\t\t\tint lcm = getLCM(a, b);\n\t\t\t\t\n\t\t\t\tSystem.out.println(getLCM(a, b) + \" \" + a * (b / lcm));\n\t\t\t}\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}",
"main",
"{\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\t\tString line = null;\n\t\t\n\t\ttry {\n\t\t\twhile((line = br.readLine()) != null) {\n\t\t\t\tline = line.trim();\n\t\t\t\tString[] values = line.split(\"\\\\s\");\n\t\t\t\tif(values.length != 2) System.exit(-1);\n\t\t\t\t\n\t\t\t\tint[] value = new int[2];\n\t\t\t\tint i = 0;\n\t\t\t\tfor(String s : values) {\n\t\t\t\t\tvalue[i] = Integer.parseInt(s);\n\t\t\t\t\tif(value[i] > 2000000000 || value[i] < 0) System.exit(-2);\n\t\t\t\t\ti++;\n\t\t\t\t}\n\t\t\t\tint a = value[0];\n\t\t\t\tint b = value[1];\n\n\t\t\t\tint lcm = getLCM(a, b);\n\t\t\t\t\n\t\t\t\tSystem.out.println(getLCM(a, b) + \" \" + a * (b / lcm));\n\t\t\t}\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}",
"BufferedReader br = new BufferedReader(new InputStreamReader(System.in));",
"br",
"new BufferedReader(new InputStreamReader(System.in))",
"String line = null;",
"line",
"null",
"try {\n\t\t\twhile((line = br.readLine()) != null) {\n\t\t\t\tline = line.trim();\n\t\t\t\tString[] values = line.split(\"\\\\s\");\n\t\t\t\tif(values.length != 2) System.exit(-1);\n\t\t\t\t\n\t\t\t\tint[] value = new int[2];\n\t\t\t\tint i = 0;\n\t\t\t\tfor(String s : values) {\n\t\t\t\t\tvalue[i] = Integer.parseInt(s);\n\t\t\t\t\tif(value[i] > 2000000000 || value[i] < 0) System.exit(-2);\n\t\t\t\t\ti++;\n\t\t\t\t}\n\t\t\t\tint a = value[0];\n\t\t\t\tint b = value[1];\n\n\t\t\t\tint lcm = getLCM(a, b);\n\t\t\t\t\n\t\t\t\tSystem.out.println(getLCM(a, b) + \" \" + a * (b / lcm));\n\t\t\t}\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}",
"catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}",
"IOException e",
"{\n\t\t\te.printStackTrace();\n\t\t}",
"e.printStackTrace()",
"e.printStackTrace",
"e",
"{\n\t\t\twhile((line = br.readLine()) != null) {\n\t\t\t\tline = line.trim();\n\t\t\t\tString[] values = line.split(\"\\\\s\");\n\t\t\t\tif(values.length != 2) System.exit(-1);\n\t\t\t\t\n\t\t\t\tint[] value = new int[2];\n\t\t\t\tint i = 0;\n\t\t\t\tfor(String s : values) {\n\t\t\t\t\tvalue[i] = Integer.parseInt(s);\n\t\t\t\t\tif(value[i] > 2000000000 || value[i] < 0) System.exit(-2);\n\t\t\t\t\ti++;\n\t\t\t\t}\n\t\t\t\tint a = value[0];\n\t\t\t\tint b = value[1];\n\n\t\t\t\tint lcm = getLCM(a, b);\n\t\t\t\t\n\t\t\t\tSystem.out.println(getLCM(a, b) + \" \" + a * (b / lcm));\n\t\t\t}\n\t\t}",
"while((line = br.readLine()) != null) {\n\t\t\t\tline = line.trim();\n\t\t\t\tString[] values = line.split(\"\\\\s\");\n\t\t\t\tif(values.length != 2) System.exit(-1);\n\t\t\t\t\n\t\t\t\tint[] value = new int[2];\n\t\t\t\tint i = 0;\n\t\t\t\tfor(String s : values) {\n\t\t\t\t\tvalue[i] = Integer.parseInt(s);\n\t\t\t\t\tif(value[i] > 2000000000 || value[i] < 0) System.exit(-2);\n\t\t\t\t\ti++;\n\t\t\t\t}\n\t\t\t\tint a = value[0];\n\t\t\t\tint b = value[1];\n\n\t\t\t\tint lcm = getLCM(a, b);\n\t\t\t\t\n\t\t\t\tSystem.out.println(getLCM(a, b) + \" \" + a * (b / lcm));\n\t\t\t}",
"(line = br.readLine()) != null",
"(line = br.readLine())",
"line",
"br.readLine()",
"br.readLine",
"br",
"null",
"{\n\t\t\t\tline = line.trim();\n\t\t\t\tString[] values = line.split(\"\\\\s\");\n\t\t\t\tif(values.length != 2) System.exit(-1);\n\t\t\t\t\n\t\t\t\tint[] value = new int[2];\n\t\t\t\tint i = 0;\n\t\t\t\tfor(String s : values) {\n\t\t\t\t\tvalue[i] = Integer.parseInt(s);\n\t\t\t\t\tif(value[i] > 2000000000 || value[i] < 0) System.exit(-2);\n\t\t\t\t\ti++;\n\t\t\t\t}\n\t\t\t\tint a = value[0];\n\t\t\t\tint b = value[1];\n\n\t\t\t\tint lcm = getLCM(a, b);\n\t\t\t\t\n\t\t\t\tSystem.out.println(getLCM(a, b) + \" \" + a * (b / lcm));\n\t\t\t}",
"line = line.trim()",
"line",
"line.trim()",
"line.trim",
"line",
"String[] values = line.split(\"\\\\s\");",
"values",
"line.split(\"\\\\s\")",
"line.split",
"line",
"\"\\\\s\"",
"if(values.length != 2) System.exit(-1);",
"values.length != 2",
"values.length",
"values",
"values.length",
"2",
"System.exit(-1)",
"System.exit",
"System",
"-1",
"1",
"int[] value = new int[2];",
"value",
"new int[2]",
"2",
"int i = 0;",
"i",
"0",
"for(String s : values) {\n\t\t\t\t\tvalue[i] = Integer.parseInt(s);\n\t\t\t\t\tif(value[i] > 2000000000 || value[i] < 0) System.exit(-2);\n\t\t\t\t\ti++;\n\t\t\t\t}",
"String s",
"values",
"{\n\t\t\t\t\tvalue[i] = Integer.parseInt(s);\n\t\t\t\t\tif(value[i] > 2000000000 || value[i] < 0) System.exit(-2);\n\t\t\t\t\ti++;\n\t\t\t\t}",
"{\n\t\t\t\t\tvalue[i] = Integer.parseInt(s);\n\t\t\t\t\tif(value[i] > 2000000000 || value[i] < 0) System.exit(-2);\n\t\t\t\t\ti++;\n\t\t\t\t}",
"value[i] = Integer.parseInt(s)",
"value[i]",
"value",
"i",
"Integer.parseInt(s)",
"Integer.parseInt",
"Integer",
"s",
"if(value[i] > 2000000000 || value[i] < 0) System.exit(-2);",
"value[i] > 2000000000 || value[i] < 0",
"value[i] > 2000000000",
"value[i]",
"value",
"i",
"2000000000",
"value[i] < 0",
"value[i]",
"value",
"i",
"0",
"System.exit(-2)",
"System.exit",
"System",
"-2",
"2",
"i++",
"i",
"int a = value[0];",
"a",
"value[0]",
"value",
"0",
"int b = value[1];",
"b",
"value[1]",
"value",
"1",
"int lcm = getLCM(a, b);",
"lcm",
"getLCM(a, b)",
"getLCM",
"a",
"b",
"System.out.println(getLCM(a, b) + \" \" + a * (b / lcm))",
"System.out.println",
"System.out",
"System",
"System.out",
"getLCM(a, b) + \" \" + a * (b / lcm)",
"getLCM(a, b) + \" \" + a * (b / lcm)",
"getLCM(a, b)",
"getLCM",
"a",
"b",
"\" \"",
"a * (b / lcm)",
"a",
"(b / lcm)",
"b",
"lcm",
"String[] args",
"args",
"static int getLCM(int a, int b){\n\t\tint i = a;\n\t\tint j = b;\n\t\twhile(i != j) {\n\t\t\tif(i > j) i -= j;\n\t\t\telse j -= i;\n\t\t}\n\t\treturn i;\n\t}",
"getLCM",
"{\n\t\tint i = a;\n\t\tint j = b;\n\t\twhile(i != j) {\n\t\t\tif(i > j) i -= j;\n\t\t\telse j -= i;\n\t\t}\n\t\treturn i;\n\t}",
"int i = a;",
"i",
"a",
"int j = b;",
"j",
"b",
"while(i != j) {\n\t\t\tif(i > j) i -= j;\n\t\t\telse j -= i;\n\t\t}",
"i != j",
"i",
"j",
"{\n\t\t\tif(i > j) i -= j;\n\t\t\telse j -= i;\n\t\t}",
"if(i > j) i -= j;\n\t\t\telse j -= i;",
"i > j",
"i",
"j",
"i -= j",
"i",
"j",
"j -= i",
"j",
"i",
"return i;",
"i",
"int a",
"a",
"int b",
"b",
"public class Main {\n\tpublic static void main(String[] args) {\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\t\tString line = null;\n\t\t\n\t\ttry {\n\t\t\twhile((line = br.readLine()) != null) {\n\t\t\t\tline = line.trim();\n\t\t\t\tString[] values = line.split(\"\\\\s\");\n\t\t\t\tif(values.length != 2) System.exit(-1);\n\t\t\t\t\n\t\t\t\tint[] value = new int[2];\n\t\t\t\tint i = 0;\n\t\t\t\tfor(String s : values) {\n\t\t\t\t\tvalue[i] = Integer.parseInt(s);\n\t\t\t\t\tif(value[i] > 2000000000 || value[i] < 0) System.exit(-2);\n\t\t\t\t\ti++;\n\t\t\t\t}\n\t\t\t\tint a = value[0];\n\t\t\t\tint b = value[1];\n\n\t\t\t\tint lcm = getLCM(a, b);\n\t\t\t\t\n\t\t\t\tSystem.out.println(getLCM(a, b) + \" \" + a * (b / lcm));\n\t\t\t}\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}\n\t\n\tstatic int getLCM(int a, int b){\n\t\tint i = a;\n\t\tint j = b;\n\t\twhile(i != j) {\n\t\t\tif(i > j) i -= j;\n\t\t\telse j -= i;\n\t\t}\n\t\treturn i;\n\t}\n\n}",
"public class Main {\n\tpublic static void main(String[] args) {\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\t\tString line = null;\n\t\t\n\t\ttry {\n\t\t\twhile((line = br.readLine()) != null) {\n\t\t\t\tline = line.trim();\n\t\t\t\tString[] values = line.split(\"\\\\s\");\n\t\t\t\tif(values.length != 2) System.exit(-1);\n\t\t\t\t\n\t\t\t\tint[] value = new int[2];\n\t\t\t\tint i = 0;\n\t\t\t\tfor(String s : values) {\n\t\t\t\t\tvalue[i] = Integer.parseInt(s);\n\t\t\t\t\tif(value[i] > 2000000000 || value[i] < 0) System.exit(-2);\n\t\t\t\t\ti++;\n\t\t\t\t}\n\t\t\t\tint a = value[0];\n\t\t\t\tint b = value[1];\n\n\t\t\t\tint lcm = getLCM(a, b);\n\t\t\t\t\n\t\t\t\tSystem.out.println(getLCM(a, b) + \" \" + a * (b / lcm));\n\t\t\t}\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}\n\t\n\tstatic int getLCM(int a, int b){\n\t\tint i = a;\n\t\tint j = b;\n\t\twhile(i != j) {\n\t\t\tif(i > j) i -= j;\n\t\t\telse j -= i;\n\t\t}\n\t\treturn i;\n\t}\n\n}",
"Main"
] | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class Main {
public static void main(String[] args) {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
String line = null;
try {
while((line = br.readLine()) != null) {
line = line.trim();
String[] values = line.split("\\s");
if(values.length != 2) System.exit(-1);
int[] value = new int[2];
int i = 0;
for(String s : values) {
value[i] = Integer.parseInt(s);
if(value[i] > 2000000000 || value[i] < 0) System.exit(-2);
i++;
}
int a = value[0];
int b = value[1];
int lcm = getLCM(a, b);
System.out.println(getLCM(a, b) + " " + a * (b / lcm));
}
} catch (IOException e) {
e.printStackTrace();
}
}
static int getLCM(int a, int b){
int i = a;
int j = b;
while(i != j) {
if(i > j) i -= j;
else j -= i;
}
return i;
}
} |
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
17,
38,
30,
4,
18,
13,
30,
0,
13,
20,
42,
4,
18,
13,
30,
41,
13,
39,
4,
18,
13,
4,
18,
13,
4,
18,
18,
13,
13,
2,
2,
4,
13,
13,
17,
4,
13,
13,
23,
13,
12,
13,
30,
41,
13,
17,
41,
13,
18,
13,
17,
41,
13,
18,
13,
17,
42,
2,
13,
17,
30,
0,
13,
2,
13,
13,
0,
13,
13,
0,
13,
13,
29,
13,
23,
13,
12,
13,
30,
29,
2,
2,
18,
13,
17,
18,
13,
17,
4,
13,
13,
23,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
13,
14
],
[
14,
15
],
[
15,
16
],
[
12,
17
],
[
17,
18
],
[
18,
19
],
[
18,
20
],
[
17,
21
],
[
21,
22
],
[
22,
23
],
[
23,
24
],
[
21,
25
],
[
25,
26
],
[
26,
27
],
[
26,
28
],
[
28,
29
],
[
29,
30
],
[
30,
31
],
[
28,
32
],
[
32,
33
],
[
33,
34
],
[
25,
35
],
[
35,
36
],
[
36,
37
],
[
37,
38
],
[
37,
39
],
[
35,
40
],
[
41,
41
],
[
41,
42
],
[
42,
43
],
[
42,
44
],
[
41,
45
],
[
41,
46
],
[
46,
47
],
[
46,
48
],
[
6,
49
],
[
49,
50
],
[
4,
51
],
[
51,
52
],
[
51,
53
],
[
53,
54
],
[
54,
55
],
[
54,
56
],
[
53,
57
],
[
57,
58
],
[
57,
59
],
[
59,
60
],
[
59,
61
],
[
53,
62
],
[
62,
63
],
[
62,
64
],
[
64,
65
],
[
64,
66
],
[
53,
67
],
[
67,
68
],
[
68,
69
],
[
68,
70
],
[
67,
71
],
[
71,
72
],
[
72,
73
],
[
72,
74
],
[
74,
75
],
[
74,
76
],
[
71,
77
],
[
77,
78
],
[
77,
79
],
[
71,
80
],
[
80,
81
],
[
80,
82
],
[
53,
83
],
[
83,
84
],
[
51,
85
],
[
85,
86
],
[
4,
87
],
[
87,
88
],
[
87,
89
],
[
89,
90
],
[
90,
91
],
[
91,
92
],
[
92,
93
],
[
93,
94
],
[
93,
95
],
[
92,
96
],
[
96,
97
],
[
96,
98
],
[
91,
99
],
[
99,
100
],
[
99,
101
],
[
87,
102
],
[
102,
103
]
] | [
"import java.util.Scanner;\n\nclass Main {\n\n\tpublic static void main(String[] args) {\n\t\tScanner s = null;\n\t\ttry {\n\t\t\ts = new Scanner(System.in);\n\n\t\t\twhile (s.hasNextLong()) {\n\t\t\t\tlong[] num = { s.nextLong(), s.nextLong() };\n\t\t\t\tSystem.out.println(gcd(num) + \" \" + lcm(num));\n\t\t\t}\n\n\t\t} finally {\n\t\t\ts.close();\n\t\t}\n\n\t}\n\n\t// ?????????????????????????????????\n\t// ??§??????????????°??????????????????????????°?????§?????£?????????\n\t// ??°??????0????????£?????¨??????????????????????????°???????????§??¬?´???°\n\tprivate static long gcd(long[] num) {\n\n\t\tlong x = 0;\n\t\tlong a = num[0];\n\t\tlong b = num[1];\n\t\tdo {\n\t\t\tx = a % b;\n\t\t\ta = b;\n\t\t\tb = x;\n\t\t} while (x != 0);\n\n\t\treturn a;\n\n\t}\n\n\t //2????????°?????????????????????????????§??¬?´???°??§?????£?????°??????\n\t //????°???¬?????°\n\t private static long lcm(long[] num) {\n\t return (num[0] * num[1]) / gcd(num);\n\t }\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"class Main {\n\n\tpublic static void main(String[] args) {\n\t\tScanner s = null;\n\t\ttry {\n\t\t\ts = new Scanner(System.in);\n\n\t\t\twhile (s.hasNextLong()) {\n\t\t\t\tlong[] num = { s.nextLong(), s.nextLong() };\n\t\t\t\tSystem.out.println(gcd(num) + \" \" + lcm(num));\n\t\t\t}\n\n\t\t} finally {\n\t\t\ts.close();\n\t\t}\n\n\t}\n\n\t// ?????????????????????????????????\n\t// ??§??????????????°??????????????????????????°?????§?????£?????????\n\t// ??°??????0????????£?????¨??????????????????????????°???????????§??¬?´???°\n\tprivate static long gcd(long[] num) {\n\n\t\tlong x = 0;\n\t\tlong a = num[0];\n\t\tlong b = num[1];\n\t\tdo {\n\t\t\tx = a % b;\n\t\t\ta = b;\n\t\t\tb = x;\n\t\t} while (x != 0);\n\n\t\treturn a;\n\n\t}\n\n\t //2????????°?????????????????????????????§??¬?´???°??§?????£?????°??????\n\t //????°???¬?????°\n\t private static long lcm(long[] num) {\n\t return (num[0] * num[1]) / gcd(num);\n\t }\n}",
"Main",
"public static void main(String[] args) {\n\t\tScanner s = null;\n\t\ttry {\n\t\t\ts = new Scanner(System.in);\n\n\t\t\twhile (s.hasNextLong()) {\n\t\t\t\tlong[] num = { s.nextLong(), s.nextLong() };\n\t\t\t\tSystem.out.println(gcd(num) + \" \" + lcm(num));\n\t\t\t}\n\n\t\t} finally {\n\t\t\ts.close();\n\t\t}\n\n\t}",
"main",
"{\n\t\tScanner s = null;\n\t\ttry {\n\t\t\ts = new Scanner(System.in);\n\n\t\t\twhile (s.hasNextLong()) {\n\t\t\t\tlong[] num = { s.nextLong(), s.nextLong() };\n\t\t\t\tSystem.out.println(gcd(num) + \" \" + lcm(num));\n\t\t\t}\n\n\t\t} finally {\n\t\t\ts.close();\n\t\t}\n\n\t}",
"Scanner s = null;",
"s",
"null",
"try {\n\t\t\ts = new Scanner(System.in);\n\n\t\t\twhile (s.hasNextLong()) {\n\t\t\t\tlong[] num = { s.nextLong(), s.nextLong() };\n\t\t\t\tSystem.out.println(gcd(num) + \" \" + lcm(num));\n\t\t\t}\n\n\t\t} finally {\n\t\t\ts.close();\n\t\t}",
"{\n\t\t\ts.close();\n\t\t}",
"s.close()",
"s.close",
"s",
"{\n\t\t\ts = new Scanner(System.in);\n\n\t\t\twhile (s.hasNextLong()) {\n\t\t\t\tlong[] num = { s.nextLong(), s.nextLong() };\n\t\t\t\tSystem.out.println(gcd(num) + \" \" + lcm(num));\n\t\t\t}\n\n\t\t}",
"s = new Scanner(System.in)",
"s",
"new Scanner(System.in)",
"while (s.hasNextLong()) {\n\t\t\t\tlong[] num = { s.nextLong(), s.nextLong() };\n\t\t\t\tSystem.out.println(gcd(num) + \" \" + lcm(num));\n\t\t\t}",
"s.hasNextLong()",
"s.hasNextLong",
"s",
"{\n\t\t\t\tlong[] num = { s.nextLong(), s.nextLong() };\n\t\t\t\tSystem.out.println(gcd(num) + \" \" + lcm(num));\n\t\t\t}",
"long[] num = { s.nextLong(), s.nextLong() };",
"num",
"{ s.nextLong(), s.nextLong() }",
"s.nextLong()",
"s.nextLong",
"s",
"s.nextLong()",
"s.nextLong",
"s",
"System.out.println(gcd(num) + \" \" + lcm(num))",
"System.out.println",
"System.out",
"System",
"System.out",
"gcd(num) + \" \" + lcm(num)",
"gcd(num) + \" \" + lcm(num)",
"gcd(num)",
"gcd",
"num",
"\" \"",
"lcm(num)",
"lcm",
"num",
"String[] args",
"args",
"// ?????????????????????????????????\n\t// ??§??????????????°??????????????????????????°?????§?????£?????????\n\t// ??°??????0????????£?????¨??????????????????????????°???????????§??¬?´???°\n\tprivate static long gcd(long[] num) {\n\n\t\tlong x = 0;\n\t\tlong a = num[0];\n\t\tlong b = num[1];\n\t\tdo {\n\t\t\tx = a % b;\n\t\t\ta = b;\n\t\t\tb = x;\n\t\t} while (x != 0);\n\n\t\treturn a;\n\n\t}",
"gcd",
"{\n\n\t\tlong x = 0;\n\t\tlong a = num[0];\n\t\tlong b = num[1];\n\t\tdo {\n\t\t\tx = a % b;\n\t\t\ta = b;\n\t\t\tb = x;\n\t\t} while (x != 0);\n\n\t\treturn a;\n\n\t}",
"long x = 0;",
"x",
"0",
"long a = num[0];",
"a",
"num[0]",
"num",
"0",
"long b = num[1];",
"b",
"num[1]",
"num",
"1",
"do {\n\t\t\tx = a % b;\n\t\t\ta = b;\n\t\t\tb = x;\n\t\t} while (x != 0);",
"x != 0",
"x",
"0",
"{\n\t\t\tx = a % b;\n\t\t\ta = b;\n\t\t\tb = x;\n\t\t}",
"x = a % b",
"x",
"a % b",
"a",
"b",
"a = b",
"a",
"b",
"b = x",
"b",
"x",
"return a;",
"a",
"long[] num",
"num",
"//2????????°?????????????????????????????§??¬?´???°??§?????£?????°??????\n\t //????°???¬?????°\n\t private static long lcm(long[] num) {\n\t return (num[0] * num[1]) / gcd(num);\n\t }",
"lcm",
"{\n\t return (num[0] * num[1]) / gcd(num);\n\t }",
"return (num[0] * num[1]) / gcd(num);",
"(num[0] * num[1]) / gcd(num)",
"(num[0] * num[1])",
"num[0]",
"num",
"0",
"num[1]",
"num",
"1",
"gcd(num)",
"gcd",
"num",
"long[] num",
"num"
] | import java.util.Scanner;
class Main {
public static void main(String[] args) {
Scanner s = null;
try {
s = new Scanner(System.in);
while (s.hasNextLong()) {
long[] num = { s.nextLong(), s.nextLong() };
System.out.println(gcd(num) + " " + lcm(num));
}
} finally {
s.close();
}
}
// ?????????????????????????????????
// ??§??????????????°??????????????????????????°?????§?????£?????????
// ??°??????0????????£?????¨??????????????????????????°???????????§??¬?´???°
private static long gcd(long[] num) {
long x = 0;
long a = num[0];
long b = num[1];
do {
x = a % b;
a = b;
b = x;
} while (x != 0);
return a;
}
//2????????°?????????????????????????????§??¬?´???°??§?????£?????°??????
//????°???¬?????°
private static long lcm(long[] num) {
return (num[0] * num[1]) / gcd(num);
}
} |
Subsets and Splits
No saved queries yet
Save your SQL queries to embed, download, and access them later. Queries will appear here once saved.