node_ids listlengths 4 1.4k | edge_index listlengths 1 2.22k | text listlengths 4 1.4k | source stringlengths 14 427k |
|---|---|---|---|
[
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,
4,
18,
18,
13,
13,
17,
4,
13,
13,
13,
4,
13,
13,
13,
4,
18,
13,
23,
13,
12,
13,
30,
41,
13,
2,
2,
13,
4,
... | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
97,
5
],
[
97,
6
],
[
6,
7
],
[
6,
8
],
[
97,
9
],
[
9,
10
],
[
9,
11
],
[
11,
12
],
[
12,
13
],
[
13,
14
],... | [
"import java.util.Scanner;\n\npublic class Main {\n\n\tstatic Scanner sc = new Scanner(System.in);\n\tpublic static void main(String[] args) {\n\n\t\twhile(sc.hasNext()) {\n\t\t\tint a = sc.nextInt();\n\t\t\tint b = sc.nextInt();\n\n\t\t\tSystem.out.printf(\"%d %d\\n\",gcd(a, b) ,lcm(a, b));\n\t\t}\n\t\tsc.close();... | import java.util.Scanner;
public class Main {
static Scanner sc = new Scanner(System.in);
public static void main(String[] args) {
while(sc.hasNext()) {
int a = sc.nextInt();
int b = sc.nextInt();
System.out.printf("%d %d\n",gcd(a, b) ,lcm(a, b));
}
sc.close();
}
private static long lcm(int i, ... |
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
17,
42,
2,
0,
13,
4,
18,
13,
17,
30,
41,
13,
4,
18,
13,
17,
41,
13,
41,
13,
0,
13,
4,
18,
13,
18,
13,
17,
0,
13,
4,
18,
13,
18,
13... | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
115,
11
],
[
115,
12
],
[
12,
13
],
[
12,
14
],... | [
"import java.io.BufferedReader;\nimport java.io.IOException;\nimport java.io.InputStreamReader;\n\npublic class Main{\n\tpublic static void main(String[] args) throws IOException{\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\t\tString line = \"\";\n\t\twhile((line = br.readLine()... | 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 line = "";
while((line = br.readLine()) != null){
String[... |
[
7,
6,
13,
12,
13,
30,
14,
2,
13,
17,
29,
13,
29,
4,
13,
2,
13,
13,
13,
23,
13,
23,
13,
12,
13,
30,
41,
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,
... | [
[
0,
1
],
[
72,
2
],
[
72,
3
],
[
3,
4
],
[
3,
5
],
[
5,
6
],
[
6,
7
],
[
7,
8
],
[
7,
9
],
[
6,
10
],
[
10,
11
],
[
5,
12
],
[
12,
13
],
[
13,
14
],
... | [
"public class\nMain\n{\n public static int\n gcd (\n int a,\n int b\n )\n {\n if ( a == 0 ) return ( b );\n\n return\n gcd ( b % a, a );\n }\n\n public static void\n main (\n String[ ] args\n )\n {\n java.util.Scanner cin = new java.util.Scanner ( System.in );\n\n while ( cin.ha... | public class
Main
{
public static int
gcd (
int a,
int b
)
{
if ( a == 0 ) return ( b );
return
gcd ( b % a, a );
}
public static void
main (
String[ ] args
)
{
java.util.Scanner cin = new java.util.Scanner ( System.in );
while ( cin.hasNext ( ) )
{
int... |
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
20,
17,
41,
13,
20,
17,
41,
13,
17,
42,
4,
18,
13,
30,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
0,
18,
13,
13,
4,
13,
13,
13,
0,
18,
13,
13,
2,
2,
2,
13,
18,... | [
[
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
],
[... | [
"import java.util.Scanner;\n class Main {\n\tpublic static void main(String args[]){\n\t\tScanner sc = new Scanner(System.in);\n\t\tint GCD[] = new int[100];\n\t\tint LCM[] = new int[100];\n\t\tint i = 0;\n\t\twhile(sc.hasNext()){\n\t\t\tint a = sc.nextInt(), b =sc.nextInt();\n\t\t\tGCD[i] = GCD(a,b);\n\t\t\tLCM[i]... | import java.util.Scanner;
class Main {
public static void main(String args[]){
Scanner sc = new Scanner(System.in);
int GCD[] = new int[100];
int LCM[] = new int[100];
int i = 0;
while(sc.hasNext()){
int a = sc.nextInt(), b =sc.nextInt();
GCD[i] = GCD(a,b);
LCM[i] = (a/GCD[i])*(b/GCD[i])*GCD[i];
... |
[
7,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
41,
13,
41,
13,
0,
13,
13,
0,
13,
13,
42,
17,
30,
14,
2,
13,
13,
30,
0,
13,
13,
3,
14,
2,
13,
17,
30,
0,
13,
13,
3,
14,
2,
13,
17,
30,
0,
13,
13,
3,
14,
... | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
218,
8
],
[
218,
9
],
[
9,
10
],
[
9,
11
],
[
11,
12
],
[
12,
13
],
[
11,
14
]... | [
"import java.util.Scanner;\nimport java.math.BigDecimal;\n\npublic class Main{\n\n\n\t\tpublic static long saidai(long a , long b){\n\t\t\tlong c,s,t;\n\t\t\ts = a;\n\t\t\tt = b;\n\t\t\twhile(true){\n\t\t\t\tif(s == t){\n\t\t\t\t\tc = s;\n\t\t\t\t\tbreak;\n\t\t\t\t}else if(s == 0){\n\t\t\t\t\tc = t;\n\t\t\t\t\tbrea... | import java.util.Scanner;
import java.math.BigDecimal;
public class Main{
public static long saidai(long a , long b){
long c,s,t;
s = a;
t = b;
while(true){
if(s == t){
c = s;
break;
}else if(s == 0){
c = t;
break;
}else if(t == 0){
c = s;
break;
}else if(s... |
[
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,
29,
2,
2,
13,
13,
4,
13,
13,
13,
23,
13,
23,
13,
12,
13,
30,
41,
13,
20,
42,
4,
18... | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
100,
5
],
[
100,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
10,
11
],
[
11,
12
],
[
11,
13
],
[
10,
14
... | [
"import java.util.*;\n\npublic class Main \n{\n\tstatic long gcd(long a, long b)\n\t{\n\t\tif(a % b == 0)\n\t\t{\n\t\t\treturn(b);\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn(gcd(b, a % b));\n\t\t}\n\t}\n\t\n\tstatic long lcm(long a, long b)\n\t{\n\t\treturn(a * b / gcd(a, b));\n\t}\n\t\n\tpublic static void main(String[... | import java.util.*;
public class Main
{
static long gcd(long a, long b)
{
if(a % b == 0)
{
return(b);
}
else
{
return(gcd(b, a % b));
}
}
static long lcm(long a, long b)
{
return(a * b / gcd(a, b));
}
public static void main(String[] args)
{
Scanner stdIn = new Scanner(System.in);
... |
[
7,
15,
13,
17,
6,
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,
0,
13,
4,
13,
13,
13,
0,
13,
2,
2,
13,
13,
13,
4,
18,
18,
13,
13,
2,
2,
1... | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
87,
5
],
[
87,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
8,
14
],
... | [
"import java.util.Scanner;\n\npublic class Main\n{\n\tpublic static void main(String args[])\n\t{\n\t\tScanner sc = new Scanner(System.in);\n\t\tlong a,b,g,l;\n\t\twhile(sc.hasNext())\n\t\t{\n\t\t\ta = sc.nextLong();\n\t\t\tb = sc.nextLong();\n\t\t\tg = gcd(a,b);\n\t\t\tl = (a*b)/g;\n\t\t\tSystem.out.println(g + \"... | import java.util.Scanner;
public class Main
{
public static void main(String args[])
{
Scanner sc = new Scanner(System.in);
long a,b,g,l;
while(sc.hasNext())
{
a = sc.nextLong();
b = sc.nextLong();
g = gcd(a,b);
l = (a*b)/g;
System.out.println(g + " " + l);
}
}
private static long gcd(lon... |
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
42,
17,
30,
38,
5,
13,
30,
4,
18,
13,
17,
30,
41,
13,
20,
41,
13,
4,
18,
13,
4,
18,
13,
41,
13,
4,
18,
13,
4,
18,
13,
41,
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
],
... | [
"import java.io.BufferedReader;\nimport java.io.IOException;\nimport java.io.InputStreamReader;\nimport java.util.StringTokenizer;\nclass Main {\n \n public static void main(String[] args) throws IOException {\n BufferedReader br=new BufferedReader(new InputStreamReader(System.in));\n while(true... | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.StringTokenizer;
class Main {
public static void main(String[] args) throws IOException {
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
while(true){
... |
[
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,
13,
0,
13,
4,
18,
13,
0,
13,
4,
13,
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
],
[
8,
14
],
[
... | [
"import java.util.Scanner;\n\nclass Main {\n\tpublic static void main(String[] args){\n\n\t\tScanner cin = new Scanner(System.in);\n\t\tint a;\n\t\tint b;\n\t\tint g;\n\t\t\n\t\twhile (cin.hasNext()){\n\t\t\ta = cin.nextInt();\n\t\t\tb = cin.nextInt();\n\t\t\tg = GCD(a, b);\n\t\t\tSystem.out.println(g + \" \" + a *... | import java.util.Scanner;
class Main {
public static void main(String[] args){
Scanner cin = new Scanner(System.in);
int a;
int b;
int g;
while (cin.hasNext()){
a = cin.nextInt();
b = cin.nextInt();
g = GCD(a, b);
System.out.println(g + " " + a * (b / g));
}
}
private static int GCD (i... |
[
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,... | [
[
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
],
... | [
"import java.util.*;\n\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 a = in.nextLong();\n\t\t\tlong b = in.nextLong();\n\t\t\tlong c = LCM(a, b);\n\t\t\tlong d = a * b / c;\n\t\t\tSystem.out.println(c + \" \" + d);\... | import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
while (in.hasNext()) {
long a = in.nextLong();
long b = in.nextLong();
long c = LCM(a, b);
long d = a * b / c;
System.out.println(c + " " + d);
}
}
static long LCM(long a, lon... |
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
41,
13,
41,
13,
20,
17,
41,
13,
17,
41,
13,
41,
13,
41,
13,
42,
17,
30,
38,
5,
13,
30,
4,
18,
13,
17,... | [
[
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
],
... | [
"import java.io.BufferedReader;\nimport java.io.IOException;\nimport java.io.InputStreamReader;\nimport java.util.StringTokenizer;\n\n\nclass Main{\n\tpublic static void main(String[] args)throws IOException{\n\t\tBufferedReader br=new BufferedReader(new InputStreamReader(System.in));\n\t\tString name=br.readLine()... | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.StringTokenizer;
class Main{
public static void main(String[] args)throws IOException{
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
String name=br.readLine();
int num;
int ... |
[
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,
2,
13,
13,
17,
30,
29,
13... | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
84,
5
],
[
84,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
13,
14
],
... | [
"import 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 int m = sc.nextInt();\n int n = sc.nextInt();\n System.out.printf(\"%d %d\\n\", gcd(m, n), lcm(m, n));\n }... | import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
while (sc.hasNext()) {
int m = sc.nextInt();
int n = sc.nextInt();
System.out.printf("%d %d\n", gcd(m, n), lcm(m, n));
}
}
publi... |
[
7,
15,
13,
17,
6,
13,
41,
13,
20,
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,
2,
2,
4,
18,
13,
13,
13,
17,
4,
18,
13,
13,
13,
23,
13,
12,
... | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
91,
5
],
[
91,
6
],
[
6,
7
],
[
6,
8
],
[
91,
9
],
[
9,
10
],
[
9,
11
],
[
11,
12
],
[
12,
13
],
[
12,
14
],... | [
"import java.util.Scanner;\npublic class Main {\n\tstatic Scanner sc = new Scanner(System.in);\n\tpublic static void main (String[] args) {\n\t\tMain values = new Main(); \n\t\tlong a,b;\n\t\twhile (sc.hasNext()){\n\t\t\ta = sc.nextLong();\n\t\t\tb = sc.nextLong();\n\t\t\tSystem.out.println(values.GCF(a, b)+\" \"+v... | import java.util.Scanner;
public class Main {
static Scanner sc = new Scanner(System.in);
public static void main (String[] args) {
Main values = new Main();
long a,b;
while (sc.hasNext()){
a = sc.nextLong();
b = sc.nextLong();
System.out.println(values.GCF(a, b)+" "+values.LCM(a, b));}
}
public lon... |
[
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,
2,
17,
4,
13,
13,
13,
17,
4,
13,
13,
13,
23,
13,
12,
13,
30,
29,
8,
2,
13,
17,
... | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
83,
5
],
[
83,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
13,
14
],
... | [
"import java.util.Scanner;\n\npublic class Main {\n public static void main(String args[]){\n Scanner in = new Scanner(System.in);\n while(in.hasNext()){\n long a = in.nextLong();\n long b = in.nextLong();\n System.out.println(\"\" + gcd(a,b) + \" \" + lcm(a,b));\n ... | import java.util.Scanner;
public class Main {
public static void main(String args[]){
Scanner in = new Scanner(System.in);
while(in.hasNext()){
long a = in.nextLong();
long b = in.nextLong();
System.out.println("" + gcd(a,b) + " " + lcm(a,b));
}
}
... |
[
7,
15,
13,
17,
6,
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,
0,
13,
4,
13,
13,
13,
30,
0,
13,
4,
13,
13,
13,
0,
13,
... | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
93,
5
],
[
93,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
8,
14
],
... | [
"import java.util.Scanner;\n\npublic class Main {\n\n\tpublic static void main(String[] args) {\n\t\t// TODO ツ篠ゥツ督ョツ青カツ青ャツつウツづェツつスツδソツッツドツ・ツスツタツブ\n\t\tScanner sc=new Scanner(System.in);\n\t\tlong a,b,g,l;\n\t\twhile(sc.hasNext()){\n\t\t\ta=sc.nextLong();\n\t\t\tb=sc.nextLong();\n\t\t\tif(a<b){\n\t\t\t\tg=gcd(a,b);\... | import java.util.Scanner;
public class Main {
public static void main(String[] args) {
// TODO ツ篠ゥツ督ョツ青カツ青ャツつウツづェツつスツδソツッツドツ・ツスツタツブ
Scanner sc=new Scanner(System.in);
long a,b,g,l;
while(sc.hasNext()){
a=sc.nextLong();
b=sc.nextLong();
if(a<b){
g=gcd(a,b);
}
else{
g=gcd(b,a);
}
l... |
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
41,
13,
12,
13,
30,
41,
13,
20,
41,
13,
41,
13,
41,
13,
41,
13,
41,
13,
41,
13,
42,
4,
18,
13,
30,
0,
13,
4,
18,
13,
0,
13,
4,
18,
13,
0,
13,
4,
18,
13,
13,
0,
13... | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
87,
11
],
[
87,
12
],
[
12,
13
],
[
87,
14
],
... | [
"import java.math.BigInteger;\nimport java.util.ArrayList;\nimport java.util.Scanner;\n\npublic class Main {\n\tstatic ArrayList<String> allpermutations;\n\tpublic static void main(String[] args){\n\t\tScanner cin = new Scanner(System.in);\n\t\tlong a;\n\t\tlong b;\n\t\tBigInteger aVal;\n\t\tBigInteger bVal;\n\t\tB... | import java.math.BigInteger;
import java.util.ArrayList;
import java.util.Scanner;
public class Main {
static ArrayList<String> allpermutations;
public static void main(String[] args){
Scanner cin = new Scanner(System.in);
long a;
long b;
BigInteger aVal;
BigInteger bVal;
BigInteger gcd;
BigInteger lcm... |
[
7,
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,
17,
29,... | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
84,
5
],
[
84,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
8,
14
],
... | [
"import java.util.*;\npublic class Main{\n public static void main(String[] args){\n\tScanner stdIn = new Scanner(System.in);\n\tlong a,b;\n\twhile(stdIn.hasNextInt()){\n\t a = stdIn.nextInt();\n\t b = stdIn.nextInt();\n\t System.out.printf(\"%d %d\\n\",GCD(a , b),LCM(a , b));\n\t}\n }\n public st... | import java.util.*;
public class Main{
public static void main(String[] args){
Scanner stdIn = new Scanner(System.in);
long a,b;
while(stdIn.hasNextInt()){
a = stdIn.nextInt();
b = stdIn.nextInt();
System.out.printf("%d %d\n",GCD(a , b),LCM(a , b));
}
}
public static long GCD(long a,long ... |
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
41,
13,
42,
17,
30,
38,
5,
13,
30,
3,
30,
0,
13,
20,
0,
13,
20,
41,
13,
4,
18,
13,
13,
4,
18,
18,
13,
13,
17,
13,
4,
18,
4,
18,
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
],
... | [
"import java.util.*;\nimport java.lang.Math;\nimport java.math.BigInteger;\n\nclass Main {\n public static void main (String [] args) {\n\n Scanner sc = new Scanner(System.in);\n\n BigInteger a, b;\n\n while (true) {\n try {\n a = new BigInteger(sc.next());\n ... | import java.util.*;
import java.lang.Math;
import java.math.BigInteger;
class Main {
public static void main (String [] args) {
Scanner sc = new Scanner(System.in);
BigInteger a, b;
while (true) {
try {
a = new BigInteger(sc.next());
b = new BigI... |
[
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,
13,
41,
13,
13,
42,
2,
2,
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
],
[
8,
14
],
[
... | [
"import java.io.*;\n\nclass Main{\n public static void main(String[]args)throws IOException{\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n String str;\n\n while((str= br.readLine()) != null){\n\n //????¨??????\\??????????????????int????????????\n ... | import java.io.*;
class Main{
public static void main(String[]args)throws IOException{
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
String str;
while((str= br.readLine()) != null){
//????¨??????\??????????????????int????????????
String[... |
[
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,
14,
2,
13,
13,
30,
0,
13,
13,
0,
13,
13,
0,
13,
13,
... | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
92,
5
],
[
92,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
8,
14
],
... | [
"import 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 自動生成されたメソッド・スタブ\n\t\tScanner scanner = new Scanner(System.in);\n\n\t\tlong a, b, m, n,tmp;\n\n\t\twhile(scanner.hasNext()){\n\t\t\ta = m = scanner.nextInt();\n\t\t\tb = n = ... | import java.util.Scanner;
public class Main {
/**
* @param args
*/
public static void main(String[] args) {
// TODO 自動生成されたメソッド・スタブ
Scanner scanner = new Scanner(System.in);
long a, b, m, n,tmp;
while(scanner.hasNext()){
a = m = scanner.nextInt();
b = n = scanner.nextInt();
if(m < n){
tm... |
[
7,
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,
4,
18,
13,
30,
0,
13,
4,
18,
13,
0,
13,
4,
18,
13,
0,
13,
13,
0,
13,
13,
14,
2,
13,
13,
30,
0,
13,
13,
0,
... | [
[
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
],
... | [
"import java.util.Scanner;\nimport java.util.Date;\n\nclass Main{\n public static void main(String[] args){\n\tScanner sc = new Scanner(System.in);\n\tint a,b,c,m,n;\n\twhile(sc.hasNext()){\n\t a=sc.nextInt();\n\t b=sc.nextInt();\n\t m=a;n=b;\n\t if(m<n)\n\t\t{\n\t\t c=n;\n\t\t n=m;\n\t\t m=... | import java.util.Scanner;
import java.util.Date;
class Main{
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
int a,b,c,m,n;
while(sc.hasNext()){
a=sc.nextInt();
b=sc.nextInt();
m=a;n=b;
if(m<n)
{
c=n;
n=m;
m=c;
}
while(true)
{
i... |
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
42,
4,
18,
13,
30,
41,
13,
4,
18,
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... | [
[
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
],... | [
"import java.util.Scanner;\n\npublic class Main {\n\t@SuppressWarnings(\"resource\")\n\tpublic static void main(String[] args){\n\t\tScanner sc = new Scanner(System.in);\n\t\t\n\t\twhile(sc.hasNextLine()){\n\t\t\t//double preX,preY;\n\t\t\tString[] s = sc.nextLine().split(\"[\\\\s]+\");\n\t\t\tlong[] data = new lo... | import java.util.Scanner;
public class Main {
@SuppressWarnings("resource")
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
while(sc.hasNextLine()){
//double preX,preY;
String[] s = sc.nextLine().split("[\\s]+");
long[] data = new long[s.length];
for(int i=0;i<s.lengt... |
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
41,
13,
17,
12,
13,
30,
41,
13,
20,
41,
13,
17,
38,
5,
13,
30,
4,
18,
13,
30,
38,
5,
13,
30,
4,
18,
13,
30,
4,
18,
13,
30,
42,
2,
0,
13,
4,
18,
13,
17,
30,
41,
13... | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
125,
11
],
[
125,
12
],
[
12,
13
],
[
12,
14
],... | [
"import java.io.BufferedReader;\nimport java.io.IOException;\nimport java.io.InputStreamReader;\n\npublic class Main {\n\n private static final String blank = \" \";\n\n public static void main(String[] args) {\n\n BufferedReader in = new BufferedReader(new InputStreamReader(System.in));\n\n Str... | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class Main {
private static final String blank = " ";
public static void main(String[] args) {
BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
String input = null;
... |
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
41,
13,
20,
12,
13,
30,
11,
1,
30,
30,
14,
40,
4,
18,
13,
30,
3,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
41,
13,
13,
41,
13,
13,
11,
1,
30,
30,
14,
2,
13,
13,
3,
14... | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
98,
11
],
[
98,
12
],
[
12,
13
],
[
12,
14
],
... | [
"import java.util.*;\nimport java.lang.*;\nimport java.math.*;\n\npublic class Main {\n\tScanner sc = new Scanner(System.in);\n\tvoid run(){\n\t\tfor(;;){\n\t\t\tif(!sc.hasNextInt()){\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tint a = sc.nextInt();\n\t\t\tint b = sc.nextInt();\n\t\t\tint ta = a;\n\t\t\tint tb = b; \n\t\t\tfor... | import java.util.*;
import java.lang.*;
import java.math.*;
public class Main {
Scanner sc = new Scanner(System.in);
void run(){
for(;;){
if(!sc.hasNextInt()){
break;
}
int a = sc.nextInt();
int b = sc.nextInt();
int ta = a;
int tb = b;
for(;;){
if(a==b)break;
if(a>b){
a-=b;
... |
[
7,
15,
13,
17,
6,
13,
41,
13,
20,
12,
13,
30,
42,
4,
18,
13,
30,
41,
13,
4,
13,
41,
13,
4,
13,
41,
13,
41,
13,
41,
13,
41,
13,
14,
2,
13,
13,
30,
0,
13,
13,
0,
13,
13,
30,
0,
13,
13,
0,
13,
13,
42,
2,
0,
13,
... | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
114,
5
],
[
114,
6
],
[
6,
7
],
[
6,
8
],
[
114,
9
],
[
9,
10
],
[
9,
11
],
[
11,
12
],
[
12,
13
],
[
13,
14
... | [
"import java.util.Scanner;\n\npublic class Main {\n\n\tpublic static Scanner scanner = new Scanner(System.in);\n\n\tpublic static void main(String[] args) {\n\n\t\twhile (scanner.hasNext()) {\n\n\t\t\tlong tempA = input();\n\t\t\tlong tempB = input();\n\n\t\t\tlong a;\n\t\t\tlong b;\n\t\t\tlong r;\n\t\t\tlong lcm;\... | import java.util.Scanner;
public class Main {
public static Scanner scanner = new Scanner(System.in);
public static void main(String[] args) {
while (scanner.hasNext()) {
long tempA = input();
long tempB = input();
long a;
long b;
long r;
long lcm;
if (tempB <= tempA) {
a = tempA;
... |
[
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,
13,
4,
18,
18,
13,
13,
2,
2,
13,
17,
13,
23,
13,
12,
13,
30... | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
109,
5
],
[
109,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
13,
14
],... | [
"import java.util.Scanner;\n\npublic class Main {\n\n public static void main(String[] args) {\n Scanner scanner = new Scanner(System.in);\n\n while (scanner.hasNext()) {\n final int a = scanner.nextInt();\n final int b = scanner.nextInt();\n\n final int gcd = GetGc... | import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
while (scanner.hasNext()) {
final int a = scanner.nextInt();
final int b = scanner.nextInt();
final int gcd = GetGcd(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,
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,... | [
[
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
],
[... | [
"import java.util.*;\n\nclass Main{\npublic static void main(String[] args){\nScanner sc=new Scanner(System.in);\nwhile(sc.hasNextLong()){\nlong a=sc.nextLong();\nlong b=sc.nextLong();\nlong c=gcd(a,b);\nlong d=(a*b)/c;\nSystem.out.println(c+\" \"+d);\n}\n}\npublic static long gcd(long x,long y){\nlong max=Math.max... | import java.util.*;
class Main{
public static void main(String[] args){
Scanner sc=new Scanner(System.in);
while(sc.hasNextLong()){
long a=sc.nextLong();
long b=sc.nextLong();
long c=gcd(a,b);
long d=(a*b)/c;
System.out.println(c+" "+d);
}
}
public static long gcd(long x,long y){
long max=Math.max(x,y);
long min=Math.... |
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
41,
13,
41,
13,
42,
2,
13,
17,
30,
0,
13,
4,
18,
13,
17,
17,
0,
13,
4,
18,
13,
18,
13,
17,
0,
13,
4,
18,
13,
18... | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
173,
11
],
[
173,
12
],
[
12,
13
],
[
12,
14
],... | [
"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\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\t\tString str=br.readLine();\n\t\tString[] a;\n\t\tl... | 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=br.readLine();
String[] a;
long x,y;
while(str!... |
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
42,
4,
18,
13,
30,
41,
13,
4,
18,
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,
4,
18... | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
130,
5
],
[
130,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
13,
14
],... | [
"import java.util.Scanner;\n\n\npublic class Main{\n\tpublic static void main(String[] args)\n\t{\n\t\tScanner sc = new Scanner(System.in);\n\t\twhile(sc.hasNextLine())\n\t\t{\n\t\t\tString[] s = sc.nextLine().split(\"[\\\\s]+\");\n\n\t\t\tint a = Integer.parseInt(s[0]);\n\t\t\tint b = Integer.parseInt(s[1]);\n\n\t... | import java.util.Scanner;
public class Main{
public static void main(String[] args)
{
Scanner sc = new Scanner(System.in);
while(sc.hasNextLine())
{
String[] s = sc.nextLine().split("[\\s]+");
int a = Integer.parseInt(s[0]);
int b = Integer.parseInt(s[1]);
int x = gcd(a,b);
int y = lcm(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,
4,
13,
13,
13,
41,
13,
2,
2,
13,
13,
13,
4,
18,
18,
13,
13,
2,
2,
13,
17,
13,
12,
13,
30,
14,
2,
... | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
82,
5
],
[
82,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
13,
14
],
... | [
"import java.util.*;\npublic class Main {\n\n\tpublic void doIt(){\n\t\tScanner sc = new Scanner(System.in);\n\t\twhile(sc.hasNext()){\n\t\t\tint input1 = sc.nextInt();\n\t\t\tint input2 = sc.nextInt();\n\t\t\t//gcd\n\t\t\tint gcd = gcd(input1, input2);\n\t\t\t//lcm\n\t\t\tint lcm = input1 / gcd * input2;\n\t\t\tSy... | import java.util.*;
public class Main {
public void doIt(){
Scanner sc = new Scanner(System.in);
while(sc.hasNext()){
int input1 = sc.nextInt();
int input2 = sc.nextInt();
//gcd
int gcd = gcd(input1, input2);
//lcm
int lcm = input1 / gcd * input2;
System.out.println(gcd + " " + lcm);
}
}
... |
[
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,
41,
13,
4,
13,
8,
2,
13,
13,
13,
13,
8,
2,
13,
13,
13,
13,
4,
18,
18,
13,
13,
2,
2,
13,
17,
2,
2,
13,
1... | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
82,
5
],
[
82,
6
],
[
6,
7
],
[
6,
8
],
[
82,
9
],
[
9,
10
],
[
9,
11
],
[
11,
12
],
[
12,
13
],
[
13,
14
],... | [
"import java.util.*;\n\npublic class Main {\n private static final Scanner scn = new Scanner(System.in);\n \n public static void main(String[] args) {\n while(scn.hasNextInt()) {\n int a = scn.nextInt(), b = scn.nextInt();\n int c = euclid(a > b ? a : b, a < b ? a : b);\n ... | import java.util.*;
public class Main {
private static final Scanner scn = new Scanner(System.in);
public static void main(String[] args) {
while(scn.hasNextInt()) {
int a = scn.nextInt(), b = scn.nextInt();
int c = euclid(a > b ? a : b, a < b ? a : b);
System.o... |
[
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,... | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
78,
5
],
[
78,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
13,
14
],
... | [
"import java.util.Scanner;\n\npublic class Main {\n\n public static void main(String[] args) {\n Scanner scanner = new Scanner(System.in);\n\n while (scanner.hasNext()) {\n long a = scanner.nextLong();\n long b = scanner.nextLong();\n\n long gcd = gcd(a, b);\n long lcm = (a * b) / gcd;\n\... | 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.nextLong();
long b = scanner.nextLong();
long gcd = gcd(a, b);
long lcm = (a * b) / gcd;
System.out.p... |
[
7,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
20,
17,
41,
13,
20,
17,
41,
13,
17,
41,
13,
41,
13,
42,
4,
18,
13,
30,
11,
1,
41,
13,
17,
2,
13,
18,
13,
13,
1,
40,
13,
30,
30,
0,
18,
13,
13,
... | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
140,
8
],
[
140,
9
],
[
9,
10
],
[
9,
11
],
[
11,
12
],
[
12,
13
],
[
12,
14
]... | [
"import java.util.Arrays;\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\tint[] x = new int[2];\n\t\tint[] y = new int[2];\n\t\tint gcd = 1;\n\t\tint lcm;\n\t\tint temp;\n\t\twhile (scan.hasNext()) {\n\t\t\tfor (int i = 0;... | import java.util.Arrays;
import java.util.Scanner;
public class Main{
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
int[] x = new int[2];
int[] y = new int[2];
int gcd = 1;
int lcm;
int temp;
while (scan.hasNext()) {
for (int i = 0; i < x.length; i++) {
x[i] = sc... |
[
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,
29,
8,
2,
13,
17,
13,
4,
... | [
[
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
],
... | [
"import java.util.Scanner;\npublic class Main {\n\n\tpublic static void main(String[] args) {\n\t\tScanner in = new Scanner(System.in);\n\t\twhile(in.hasNextInt()){\n\t\t\tlong x=in.nextLong(), y = in.nextLong();\n\t\t\tSystem.out.println(gcd(x,y) + \" \" + lcm(x,y));\n\t\t}\n\t}\n\n\tprivate static long gcd(long a... | import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
while(in.hasNextInt()){
long x=in.nextLong(), y = in.nextLong();
System.out.println(gcd(x,y) + " " + lcm(x,y));
}
}
private static long gcd(long a, long b){
return (a==0)?b:gcd(... |
[
7,
15,
13,
17,
6,
13,
41,
13,
20,
12,
13,
30,
29,
8,
2,
13,
17,
13,
4,
13,
13,
2,
13,
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,
4,
13,
2,
... | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
6,
7
],
[
6,
8
],
[
4,
9
],
[
9,
10
],
[
9,
11
],
[
11,
12
],
[
12,
13
],
[
13,
14
],
... | [
"\nimport java.util.Scanner;\n\nclass Main {\n\tScanner sc = new Scanner(System.in);\n\n\tpublic long gcd(long a,long b){\n\t\treturn b==0?a:gcd(b,a%b);\n\t}\n\t\n\tpublic void run() {\n\t\twhile(sc.hasNext()){\n\t\t\tlong a=sc.nextInt(),b=sc.nextInt();\n\t\t\tlong g=gcd(a,b);\n\t\t\tln(g+\" \"+ a*b/g);\n\t\t}\n\t}... |
import java.util.Scanner;
class Main {
Scanner sc = new Scanner(System.in);
public long gcd(long a,long b){
return b==0?a:gcd(b,a%b);
}
public void run() {
while(sc.hasNext()){
long a=sc.nextInt(),b=sc.nextInt();
long g=gcd(a,b);
ln(g+" "+ a*b/g);
}
}
public static void main(String[] args) {
... |
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
4,
18,
20,
23,
13,
12,
13,
30,
38,
5,
13,
30,
4,
18,
13,
17,
30,
41,
13,
20,
4,
13,
13,
12,
13,
30,
38,
5,
13,
30,
4,
18,
13,
30,
41,
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
],
[
221,
14
],
... | [
"import static java.lang.System.out;\nimport static java.lang.Long.parseLong;\nimport java.io.File;\nimport java.util.Scanner;\n\npublic class Main {\n\n public static void main(String[] args) {\n new Main().printGCDLCM();\n }\n\n public void printGCDLCM() {\n try (Scanner scan = new Scanner(... | import static java.lang.System.out;
import static java.lang.Long.parseLong;
import java.io.File;
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
new Main().printGCDLCM();
}
public void printGCDLCM() {
try (Scanner scan = new Scanner(System.in)) {
... |
[
7,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
4,
18,
20,
23,
13,
12,
13,
30,
41,
13,
20,
41,
13,
42,
17,
30,
14,
40,
4,
18,
13,
30,
3,
0,
13,
4,
18,
13,
41,
13,
20,
41,
13,
13,
0,
13,
4,
18,
13,
41,
13,
20,
4... | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
134,
8
],
[
134,
9
],
[
9,
10
],
[
9,
11
],
[
11,
12
],
[
12,
13
],
[
13,
14
]... | [
"import java.math.BigInteger;\nimport java.util.Scanner;\n\n\npublic class Main{\n\tpublic static void main(String args[]){\n\t\tnew Main().run();\n\t}\n\n\tvoid run(){\n\t\tScanner sc = new Scanner(System.in);\n\t\tString a;\n\t\twhile(true){\n\t\t\tif(!sc.hasNext()){\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\ta = sc.next();... | import java.math.BigInteger;
import java.util.Scanner;
public class Main{
public static void main(String args[]){
new Main().run();
}
void run(){
Scanner sc = new Scanner(System.in);
String a;
while(true){
if(!sc.hasNext()){
break;
}
a = sc.next();
BigInteger bi1 = new BigInteger(a);
Bi... |
[
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,
41,
13,
4,
13,
13,
41,
13,
4,
13,
13,
13,
4,
18,
18,
13,
13,
2,
2,
4,
18,
... | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
333,
8
],
[
333,
9
],
[
9,
10
],
[
9,
11
],
[
11,
12
],
[
12,
13
],
[
12,
14
]... | [
"import java.util.Scanner;\nimport java.math.*;\npublic class Main {\n\tpublic static void main(String[]args){\n\t\tScanner s =new Scanner(System.in);\n\t\twhile(s.hasNext()){\n\t\t\tint a =s.nextInt();\n\t\t\tint b =s.nextInt();\n\t\t\tint[] y =yakusu(a);\n\t\t\tint[] z =yakusu(b);\n\t\t\tint n[]=kobaisu(z,y);\n\t... | import java.util.Scanner;
import java.math.*;
public class Main {
public static void main(String[]args){
Scanner s =new Scanner(System.in);
while(s.hasNext()){
int a =s.nextInt();
int b =s.nextInt();
int[] y =yakusu(a);
int[] z =yakusu(b);
int n[]=kobaisu(z,y);
System.out.println(Integer.toString... |
[
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,
2,
13,
13,
14,
2,
13,
13,
30,
0,
13,
13,
30,
0,
13,
13,
4,
18,
18,
13,
13,
2,
2,
13,
... | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
62,
5
],
[
62,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
13,
14
],
... | [
"import java.util.Scanner;\n\npublic class Main {\n\n\tpublic static void main(String[] args) {\n\t\tScanner stdIn = new Scanner(System.in);\n\t\twhile (stdIn.hasNext()) {\n\t\t\tlong a = stdIn.nextLong();\n\t\t\tlong b = stdIn.nextLong();\n\t\t\tlong c = 0;\n\t\t\tlong d = a * b;\n\t\t\tif (a < b) {\n\t\t\t\toutsi... | import java.util.Scanner;
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();
long c = 0;
long d = a * b;
if (a < b) {
outside: for (;;) {
c = b % a;
if (c... |
[
7,
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,
29,
2,
2,
13,
13,
4,
13,
13,
13,
23,
13,
23,
13,
12,
13,
30,
41,
13,
20,
... | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
88,
11
],
[
88,
12
],
[
12,
13
],
[
12,
14
],
... | [
"import java.io.*;\nimport java.util.*;\nimport java.math.*;\n\n\npublic class Main\n{\n\npublic static long GCD(long a, long b){\n\tif(b == 0) return a;\n\telse return GCD(b, a%b);\n}\n\npublic static long LCM(long a, long b){\n\treturn (a * b)/GCD(a, b);\n}\n\n\n\n\n public static void main(String args[]) throws ... | import java.io.*;
import java.util.*;
import java.math.*;
public class Main
{
public static long GCD(long a, long b){
if(b == 0) return a;
else return GCD(b, a%b);
}
public static long LCM(long a, long b){
return (a * b)/GCD(a, b);
}
public static void main(String args[]) throws Exception
{
S... |
[
7,
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,
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... | [
[
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
],
[
147,
14
],
... | [
"\nimport java.io.BufferedReader;\nimport java.io.IOException;\nimport java.io.InputStreamReader;\nimport java.util.StringTokenizer;\n\npublic class Main {\n\n\tpublic static void main(String[] args) throws NumberFormatException,\n\t\t\tIOException {\n\t\tBufferedReader reader = new BufferedReader(new InputStreamRe... |
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.StringTokenizer;
public class Main {
public static void main(String[] args) throws NumberFormatException,
IOException {
BufferedReader reader = new BufferedReader(new InputStreamReader(
System.in))... |
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
41,
13,
17,
38,
5,
13,
30,
4,
18,
4,
18,
13,
4,
18,
18,
13,
18,
13,
13,
17,
13,
30,
42,
2,
2,
13,
17,
2,
0,
13,
4,
18,
13,
17,
30,... | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
166,
11
],
[
166,
12
],
[
12,
13
],
[
12,
14
],... | [
"import java.io.*;\nimport java.util.logging.Level;\nimport java.util.logging.Logger;\n\npublic class Main {\n\n public static void main(String[] args) {\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n String str;\n int i = 0;\n try {\n while (... | import java.io.*;
import java.util.logging.Level;
import java.util.logging.Logger;
public class Main {
public static void main(String[] args) {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
String str;
int i = 0;
try {
while (i < 50 && (str =... |
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
38,
5,
13,
30,
4,
18,
13,
30,
42,
4,
18,
13,
30,
41,
13,
4,
18,
4,
18,
13,
17,
41,
13,
20,
18,
13,
13,
11,
1,
41,
13,
17,
2,
13,
18,
13,
1... | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
218,
11
],
[
218,
12
],
[
12,
13
],
[
12,
14
],... | [
"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 input = new BufferedReader(new InputStreamReader(System.in));\n\n\t\ttry {\n\t\t\twhile (input.ready()) {\n\t\t\t\tString[] dataStr =... | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class Main {
public static void main(String[] args) {
BufferedReader input = new BufferedReader(new InputStreamReader(System.in));
try {
while (input.ready()) {
String[] dataStr = input.readLine().split(" "... |
[
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,
4,
18,
13,
30,
42,
4,
18,
13,
30,
41,
13,
4,
18,
4,
18,
13,
17,
41,
13,
20,
18,
13,
13,
11,
1,
41,
13,
17,
2,
1... | [
[
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
],
[
197,
14
],
... | [
"import java.io.BufferedReader;\nimport java.io.IOException;\nimport java.io.InputStreamReader;\n\nimport javax.xml.crypto.KeySelector.Purpose;\n\npublic class Main {\n\tpublic static void main(String[] args) {\n\t\tBufferedReader input = new BufferedReader(new InputStreamReader(System.in));\n\n\t\ttry {\n\t\t\twhi... | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import javax.xml.crypto.KeySelector.Purpose;
public class Main {
public static void main(String[] args) {
BufferedReader input = new BufferedReader(new InputStreamReader(System.in));
try {
while (input.ready()) {
... |
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
29,
8,
2,
13,
17,
13,
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,
4,
18,
18,... | [
[
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
],
... | [
"import java.util.*;\n\nclass Main {\n\tpublic static int gcd(int a, int b) {\n\t\treturn b == 0 ? a : gcd(b, a % b);\n\t}\n\tpublic static void main(String[] args) {\n\t\tScanner scanner = new Scanner(System.in);\n\t\twhile (scanner.hasNext()) {\n\t\t\tint a = scanner.nextInt();\n\t\t\tint b = scanner.nextInt();\n... | import java.util.*;
class Main {
public static int gcd(int a, int b) {
return b == 0 ? a : gcd(b, a % b);
}
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
while (scanner.hasNext()) {
int a = scanner.nextInt();
int b = scanner.nextInt();
int g = gcd(a, b);
System... |
[
7,
15,
13,
17,
6,
13,
41,
13,
12,
13,
30,
0,
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,
29,
2,
2,
13,
13,
... | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
328,
5
],
[
328,
6
],
[
6,
7
],
[
328,
8
],
[
8,
9
],
[
8,
10
],
[
10,
11
],
[
11,
12
],
[
11,
13
],
[
10,
14
... | [
"import java.util.Scanner;\n\npublic class Main {\n public static Scanner sc;\n public static void main(String[] args) throws Exception {\n sc = new Scanner(System.in);\n while (sc.hasNext()) {\n long a = sc.nextLong();\n long b = sc.nextLong();\n System.out.prin... | import java.util.Scanner;
public class Main {
public static Scanner sc;
public static void main(String[] args) throws Exception {
sc = new Scanner(System.in);
while (sc.hasNext()) {
long a = sc.nextLong();
long b = sc.nextLong();
System.out.println(gcd(a, b) ... |
[
7,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
29,
8,
2,
13,
17,
13,
4,
13,
13,
2,
13,
13,
23,
13,
23,
13,
12,
13,
30,
41,
13,
20,
41,
13,
41,
13,
41,
13,
42,
4,
18,
13,
30,
0,
13,
4,
18,
13,
0,
13,
4,
18,
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
],
[
13,
14
],
... | [
"import java.util.*;\nimport java.io.*;\nclass Main{\n int gcd(int p, int q){\n\treturn q==0?p:gcd(q,p%q);\n }\n\n void ruun(){\n\tScanner sc = new Scanner(System.in);\n\tint x, y, z;\n\twhile(sc.hasNext()){\n\t x = sc.nextInt();\n\t y= sc.nextInt();\n\t z = gcd(Math.max(x,y), Math.min(x,y));\n\t ... | import java.util.*;
import java.io.*;
class Main{
int gcd(int p, int q){
return q==0?p:gcd(q,p%q);
}
void ruun(){
Scanner sc = new Scanner(System.in);
int x, y, z;
while(sc.hasNext()){
x = sc.nextInt();
y= sc.nextInt();
z = gcd(Math.max(x,y), Math.min(x,y));
System.out.println(z+" "... |
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
41,
13,
41,
13,
12,
13,
30,
41,
13,
20,
4,
18,
13,
4,
18,
13,
23,
13,
12,
13,
30,
0,
13,
20,
0,
13,
20,
12,
13,
30,
4,
18,
13,
4,
18,
13,
12,
13,
30,
42,
4,
18,
1... | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
115,
11
],
[
115,
12
],
[
12,
13
],
[
115,
14
]... | [
"import java.util.*;\nimport java.io.*;\nimport java.math.BigInteger;\npublic class Main {\n\tpublic static void main(String... args) {\n\t\tMain m = new Main();\n\t\tm.solve();\n\t\tm.close();\n\t}\n\n\tScanner sc;\n\tPrintWriter pw;\n\tpublic Main() {\n\t\tsc = new Scanner(System.in);\n\t\tpw = new PrintWriter(Sy... | import java.util.*;
import java.io.*;
import java.math.BigInteger;
public class Main {
public static void main(String... args) {
Main m = new Main();
m.solve();
m.close();
}
Scanner sc;
PrintWriter pw;
public Main() {
sc = new Scanner(System.in);
pw = new PrintWriter(System.out);
}
private void 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,
4,
18,
18,
13,
13,
2,
2,
13,
17,
2,
2,
13,
13,
13,
23,
13,
12,
13,
30,
29,
8,
2,
... | [
[
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
],
... | [
"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\twhile(scan.hasNext()){\n\t\t\tLong m = scan.nextLong();\n\t\t\tLong n = scan.nextLong();\n\t\t\tLong g = gcd(m, n);\n\t\t\tSystem.out.println(g+\" \"+(m*n/g));\n\t\t}\n\t}\n... | import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
while(scan.hasNext()){
Long m = scan.nextLong();
Long n = scan.nextLong();
Long g = gcd(m, n);
System.out.println(g+" "+(m*n/g));
}
}
private static Long gcd(Long a, Long... |
[
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,
41,
13,
17,
41,
13,
17,
42,
4,
18,
13,
30,
0,
13,
4,
18,
13,
0,
13,
4,
18,
13,
0,
13,
2,
13,
13,
14,
2... | [
[
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
],... | [
"import java.util.Scanner;\n\npublic class Main {\n\n\tpublic static void main(String[] args) {\n\n\t\t\n\n\t\tScanner stdin = new Scanner(System.in);\n\t\tlong a = 0;\n\t\tlong b = 0;\n\t\tlong ab = 0;\n\t\tlong r = 0;\n\t\tlong gcd = 0;\n\t\tlong lcm = 0;\n\t\tlong temp = 0;\n\t\twhile(stdin.hasNext()) {\n\t\t\ta... | import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner stdin = new Scanner(System.in);
long a = 0;
long b = 0;
long ab = 0;
long r = 0;
long gcd = 0;
long lcm = 0;
long temp = 0;
while(stdin.hasNext()) {
a = stdin.nextInt();
b = stdin.nextInt();
... |
[
7,
15,
13,
17,
15,
13,
17,
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,
41,
13,
13,
41,
13,
13,
41,
13,
41,
13,
17,
41,
13,
42,
13,
30,
0,
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
],
... | [
"import java.util.ArrayList;\nimport java.util.List;\nimport java.util.Scanner;\n\nclass Main {\n\tpublic static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\tList<String> ret = new ArrayList<String>();\n\t\twhile (sc.hasNext()) {\n\t\t\tlong A = sc.nextLong();\n\t\t\tlong B = sc.nextLon... | import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;
class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
List<String> ret = new ArrayList<String>();
while (sc.hasNext()) {
long A = sc.nextLong();
long B = sc.nextLong();
long a = A;
long... |
[
7,
15,
13,
17,
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,
17,
41,
13,
20,
41,
13,
20,
41,
13,
4,
18,
13,
13,
41,
13,
4,
18,
4,
18,
13,
13,
... | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
72,
11
],
[
72,
12
],
[
12,
13
],
[
12,
14
],
... | [
"import java.io.IOException;\nimport java.math.BigInteger;\nimport java.util.Scanner;\n\npublic class Main {\n\n public static void main(String[] args) throws IOException {\n Scanner scan = new Scanner(System.in);\n while (scan.hasNextLine()) {\n String line = scan.nextLine();\n String[] vals = lin... | import java.io.IOException;
import java.math.BigInteger;
import java.util.Scanner;
public class Main {
public static void main(String[] args) throws IOException {
Scanner scan = new Scanner(System.in);
while (scan.hasNextLine()) {
String line = scan.nextLine();
String[] vals = line.split(" ");
... |
[
7,
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,
13,
41,
13,
13,
... | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
132,
8
],
[
132,
9
],
[
9,
10
],
[
9,
11
],
[
11,
12
],
[
12,
13
],
[
12,
14
]... | [
"import java.io.*;\nimport java.util.ArrayList;\npublic class Main {\n\n\tpublic static void main (String[] args) throws IOException{\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\t\tString line;\n\t\t\n\t\twhile ((line = br.readLine()) != null) {\n\t\t\tString[] numbers = line.sp... | import java.io.*;
import java.util.ArrayList;
public class Main {
public static void main (String[] args) throws IOException{
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
String line;
while ((line = br.readLine()) != null) {
String[] numbers = line.split(" ");
int a = Integ... |
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
42,
2,
4,
18,
13,
17,
30,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
41,
13,
13,
41,
13,
13,
41,
13,
17,
14,
2,
13,
13,
30,
0,
13,
13,
0,
13,
13,
0,
13,
13,
42,
2,
13,... | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
92,
5
],
[
92,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
13,
14
],
... | [
"import java.util.Scanner;\n\npublic class Main {\n\n\t\n\tpublic static void main(String[] args) {\n\t\tScanner in = new Scanner(System.in);\n\t\t\n\t\twhile(in.hasNextInt()==true){\n\t\t\tint n = in.nextInt();\n\t\t\tint m = in.nextInt();\n\t\t\tint l=n;\n\t\t\tint k=m;\n\t\t\tint r=0;\n\t\t\tif(m>n){\n\t\t\t\tr=... | import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
while(in.hasNextInt()==true){
int n = in.nextInt();
int m = in.nextInt();
int l=n;
int k=m;
int r=0;
if(m>n){
r=n;
n=m;
m=r;
}
while(m!=0){
n=n%... |
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
38,
5,
13,
30,
29,
30,
42,
17,
30,
41,
13,
4,
18,
4,
18,
13,
17,
41,
13,
4,
18,
13,
18,
13,
17,
41,
13,
4,
18,
13,
18,
13,
17,
41,
13,
4,
... | [
[
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
],
... | [
"import java.io.BufferedReader;\nimport java.io.InputStreamReader;\nimport java.util.Formatter;\n\nclass 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\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\t\ttry... | import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.Formatter;
class Main{
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
try{
while(true){
Strin... |
[
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,
0,
13,
13,
42,
2,
13,
17,
30,
0,
13,
13,
0,
13,
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
],
[
8,
14
],
[
... | [
"import java.util.*;\n\nclass Main{\n\tpublic static void main(String[] args){\n\t\tScanner sc = new Scanner(System.in);\n\t\tint a, b, tmp, a2, b2;\n\t\twhile(sc.hasNext()){\n\t\t\ta2 = a = sc.nextInt();\n\t\t\tb2 = b = sc.nextInt();\n\t\t\t\n\t\t\ta %= b;\n\t\t\twhile(a != 0){\n\t\t\t\ttmp = a;\n\t\t\t\ta = b;\n\... | import java.util.*;
class Main{
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
int a, b, tmp, a2, b2;
while(sc.hasNext()){
a2 = a = sc.nextInt();
b2 = b = sc.nextInt();
a %= b;
while(a != 0){
tmp = a;
a = b;
b = tmp;
a %= b;
}
System.out.printl... |
[
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,
13,
4,
13,
13,
13,
23,
13,
12,
13,
30,
41,
13,
2,
... | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
73,
5
],
[
73,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
13,
14
],
... | [
"import java.util.*;\n\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 a = in.nextInt();\n\t\t\tlong b = in.nextInt();\n\t\t\tSystem.out.println(calc(a, b) + \" \" + a*b/calc(a, b));\n\t\t}\n\t}\n\tstatic long calc(lon... | import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
while(in.hasNext()) {
long a = in.nextInt();
long b = in.nextInt();
System.out.println(calc(a, b) + " " + a*b/calc(a, b));
}
}
static long calc(long a, long b) {
long r = a%b;
if(... |
[
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,... | [
[
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
],
... | [
"import java.util.Scanner;\npublic class Main {\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n while (sc.hasNext()) {\n long lar = sc.nextInt();\n long sma = sc.nextInt();\n long max = lar, min = sma;\n while (sma != 0... | import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
while (sc.hasNext()) {
long lar = sc.nextInt();
long sma = sc.nextInt();
long max = lar, min = sma;
while (sma != 0) {
... |
[
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,
17,
42,
2,
0,
13,
4,
18,
13,
17,
30,
41,
13,
4,
18,
13,
17,
41,
13,
4,
18,
13,
18,
13,
17,
41,
... | [
[
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
],
... | [
"import java.io.BufferedReader;\nimport java.io.IOException;\nimport java.io.InputStreamReader;\nimport java.util.Arrays;\nimport java.util.Collections;\nimport java.util.ArrayList;\n\npublic class Main {\n\tpublic static void main(String[] args) throws IOException {\n\t\tBufferedReader br = new BufferedReader(new ... | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.Collections;
import java.util.ArrayList;
public class Main {
public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader... |
[
7,
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,
1... | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
73,
5
],
[
73,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
10,
11
],
[
10,
12
],
[
9,
13
],
[
13,
14
],
... | [
"import java.util.Scanner;\n\npublic class Main {\n\n\tstatic int gcd(int a, int b){\n\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\tpublic static void main(String[] args) {\n\t\tScanner stdIn = new Scanner(System.in);\n\n\t\twhile(stdIn.hasNext()){\n\t\t\tint a = stdIn.nextInt();\n\t... | import java.util.Scanner;
public class Main {
static int gcd(int a, int b){
if(b==0)
return a;
else
return gcd(b,a%b);
}
public static void main(String[] args) {
Scanner stdIn = new Scanner(System.in);
while(stdIn.hasNext()){
int a = stdIn.nextInt();
int b = stdIn.nextInt();
int gcd_ans =... |
[
7,
15,
13,
17,
6,
13,
41,
13,
20,
12,
13,
30,
42,
4,
18,
13,
30,
41,
13,
41,
13,
41,
13,
41,
13,
41,
13,
41,
13,
0,
13,
0,
13,
4,
18,
13,
0,
13,
0,
13,
4,
18,
13,
0,
13,
0,
13,
17,
41,
13,
17,
42,
17,
30,
14,... | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
116,
5
],
[
116,
6
],
[
6,
7
],
[
6,
8
],
[
116,
9
],
[
9,
10
],
[
9,
11
],
[
11,
12
],
[
12,
13
],
[
13,
14
... | [
"import java.util.Scanner;\n\n\npublic class Main {\n\tScanner sc = new Scanner(System.in);\n\t\n\tvoid run(){\n\t\twhile(sc.hasNext()){\n\t\t\tlong a, ta, b, tb, gcd, lcm;\n\t\t\ta = ta = sc.nextLong();\n\t\t\tb = tb = sc.nextLong();\n\t\t\tgcd = lcm = 1;\n\t\t\t\n\t\t\tint d = 2;\n\t\t\t\n\t\t\t\n\t\t\twhile(true... | import java.util.Scanner;
public class Main {
Scanner sc = new Scanner(System.in);
void run(){
while(sc.hasNext()){
long a, ta, b, tb, gcd, lcm;
a = ta = sc.nextLong();
b = tb = sc.nextLong();
gcd = lcm = 1;
int d = 2;
while(true){
if(ta / d == 0 || tb / d == 0)
break;
... |
[
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,
4,
18,
18,
13,
13,
2,
2,
4,
13,
13,
13,
17,
4,
13,
13,
13,
12,
13,
30,
14,
2,
13,
17,
29,
13,
29,
... | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
90,
5
],
[
90,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
... | [
"import java.util.*;\npublic class Main{\n void run() {\n Scanner sc = new Scanner(System.in);\n for(;sc.hasNext();){\n long a = sc.nextLong();\n long b = sc.nextLong();\n System.out.println( gcd(a, b) + \" \" + lcm(a, b) );\n }\n }\n long gcd(long a, long b){\n if(b==0) return a;\n return gcd(b, a%b);\n... | import java.util.*;
public class Main{
void run() {
Scanner sc = new Scanner(System.in);
for(;sc.hasNext();){
long a = sc.nextLong();
long b = sc.nextLong();
System.out.println( gcd(a, b) + " " + lcm(a, b) );
}
}
long gcd(long a, long b){
if(b==0) return a;
return gcd(b, a%b);
}
long lcm(long a,... |
[
7,
15,
13,
17,
6,
13,
41,
13,
20,
41,
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,
41,
13,
42,
4,
18,
13,
30,
0,
13,
20,
0,
13,
4,
18,
13,
4,
18,
13,
0,... | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
89,
5
],
[
89,
6
],
[
6,
7
],
[
6,
8
],
[
89,
9
],
[
9,
10
],
[
89,
11
],
[
11,
12
],
[
11,
13
],
[
13,
14
]... | [
"import java.util.*;\n\npublic class Main {\n\n\t/**\n\t * @param args\n\t */\n\tScanner sc = new Scanner(System.in);\n\tStringTokenizer st;\n\t\n\tlong gcd(long a, long b) {\n\t\tif (b == 0) return a;\n\t\treturn gcd(b, a % b);\n\t}\n\t\n\t\n\tvoid run() {\n\t\tlong a, b;\n\t\twhile (sc.hasNextLine()) {\n\t\t\tst ... | import java.util.*;
public class Main {
/**
* @param args
*/
Scanner sc = new Scanner(System.in);
StringTokenizer st;
long gcd(long a, long b) {
if (b == 0) return a;
return gcd(b, a % b);
}
void run() {
long a, b;
while (sc.hasNextLine()) {
st = new StringTokenizer(sc.nextLine());
a = I... |
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
42,
2,
13,
17,
30,
0,
13,
4,
18,
13,
17,
41,
13,
4,
13,
13,
41,
13,
4,
13,
13,
41,
13,
4,
13,
13,
1... | [
[
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
],
[
200,
14
],
... | [
"import java.io.BufferedReader;\nimport java.io.IOException;\nimport java.io.InputStreamReader;\nimport java.util.Arrays;\n\npublic class Main {\n\n\t/**\n\t * AOJ 0005 GCD and LCM\n\t */\n\tpublic static void main(String[] args) throws IOException {\n\t\tBufferedReader bufferedReader = new BufferedReader(\n\t\t\t\... | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Arrays;
public class Main {
/**
* AOJ 0005 GCD and LCM
*/
public static void main(String[] args) throws IOException {
BufferedReader bufferedReader = new BufferedReader(
new InputStreamReader(Syst... |
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
42,
4,
18,
13,
30,
41,
13,
41,
13,
41,
13,
41,
13,
0,
13,
4,
18,
13,
0,
13,
4,
18,
13,
0,
13,
13,
0,
13,
13,
14,
2,
13,
13,
30,
41,
13,
13,
0,
13,
13,
0,
13,
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
],
[... | [
"import java.util.Scanner;\nclass Main\n{\n public static void main(String args[])\n {\nScanner scan=new Scanner(System.in);\n\n\twhile(scan.hasNext())\n\t {\n\t\n\tlong a,b,a1,b1;\n\ta=scan.nextInt();\n\tb=scan.nextInt();\n\ta1=a;\n\tb1=b;\n\tif(b>a)\n\t {\n\t\tlong tmp=b;\n\t\tb=a;\n\t\ta=tmp;\n\t ... | import java.util.Scanner;
class Main
{
public static void main(String args[])
{
Scanner scan=new Scanner(System.in);
while(scan.hasNext())
{
long a,b,a1,b1;
a=scan.nextInt();
b=scan.nextInt();
a1=a;
b1=b;
if(b>a)
{
long tmp=b;
b=a;
a=tmp;
}
while(a%b!=0)
{
long tmp=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,
13,
41,
13,
13,
14,
2,
13,
13,
30,
0,
13,
13,
0,
13,
13,
41,
13,
13,
41,
13,
13,
42,
2,
13,
17,
3... | [
[
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
],
[... | [
"import java.util.*;\n\nclass Main{\n public static void main(String[] args){\n\tScanner sc = new Scanner(System.in);\n\n\twhile(sc.hasNext()){\n\t long a = sc.nextInt();\n\t long b = sc.nextInt();\n\t \n\t long smaller = a;\n\t long larger = b;\n\t if(b<smaller){smaller = b; larger = a;}\n\t ... | import java.util.*;
class Main{
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
while(sc.hasNext()){
long a = sc.nextInt();
long b = sc.nextInt();
long smaller = a;
long larger = b;
if(b<smaller){smaller = b; larger = a;}
long aa = a;
l... |
[
7,
15,
13,
17,
6,
13,
41,
13,
12,
13,
30,
0,
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,
41,
13,
2,
2,
13,
13,
13,
4,
18,
18,
13,
13,
2,
2,
... | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
84,
5
],
[
84,
6
],
[
6,
7
],
[
84,
8
],
[
8,
9
],
[
8,
10
],
[
10,
11
],
[
11,
12
],
[
11,
13
],
[
10,
14
]... | [
"import java.util.Scanner;\n\npublic class Main {\n\tprivate static Scanner scan;\n\tpublic static void main(String[] args) {\n\t\tscan = new Scanner(System.in);\n\t\twhile(scan.hasNext()){\n\t\t\tlong a = Long.parseLong(scan.next());\n\t\t\tlong b = Long.parseLong(scan.next());\n\t\t\tlong c = gcd(a,b);\n\t\t\tlon... | import java.util.Scanner;
public class Main {
private static Scanner scan;
public static void main(String[] args) {
scan = new Scanner(System.in);
while(scan.hasNext()){
long a = Long.parseLong(scan.next());
long b = Long.parseLong(scan.next());
long c = gcd(a,b);
long d = a*b/c;
System.out.printl... |
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
42,
2,
13,
13,
30,
14,
2,
13,
13,
0,
13,
2,
13,
13,
0,
13,
2,
13,
13,
29,
13,
23,
13,
23,
13,
12,
13,
30,
4,
18,
18,
13,
13,
2,
2,
13,
17,
2,
2,
13,
13,
13,
23,
13,
23,
13,
... | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
98,
5
],
[
98,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
10,
11
],
[
10,
12
],
[
9,
13
],
[
13,
14
],
... | [
"import java.util.Scanner;\npublic class Main{\n\tstatic 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\telse\n\t\t\t\tb=b-a;\n\t\t}\n\t\treturn a;\n\t}\n\tstatic void lcm(long a,long b,long g){\n\t\tSystem.out.println(g+\" \"+(a*b/g));\n\t}\n\tpublic static void main(String[] args)... | import java.util.Scanner;
public class Main{
static long gcd(long a,long b){
while(a!=b){
if(a>b)
a=a-b;
else
b=b-a;
}
return a;
}
static void lcm(long a,long b,long g){
System.out.println(g+" "+(a*b/g));
}
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
wh... |
[
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,
14,
2,
2,
13,
13,
17,
30,
... | [
[
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
],
... | [
"import java.util.Scanner;\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.nextInt();\n\t\t\tlong b=sc.nextInt();\n\t\t\tSystem.out.println(gcd(a,b)+\" \"+lcm(a,b));\n\t\t}\n\t}\n\tstatic long gcd(long a,long b){\n\t\... | 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.nextInt();
long b=sc.nextInt();
System.out.println(gcd(a,b)+" "+lcm(a,b));
}
}
static long gcd(long a,long b){
if(a%b==0){
return b;
}else{
... |
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
4,
18,
20,
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,
2,
13,
13,
13,
4,
18,
18,
13,
13,
2,
2,
... | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
81,
5
],
[
81,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
10,
11
],
[
6,
12
],
[
12,
13
],
[
81,
14
],
... | [
"import java.util.*;\n\npublic class Main {\n\n\tpublic static void main(String[] args) {\n\t\tnew Main().run();\n\t}\n\t\n\tprivate void run() {\n\t\tScanner scan = new Scanner(System.in);\n\t\twhile (scan.hasNext()) {\n\t\t\tlong a = scan.nextInt();\n\t\t\tlong b = scan.nextInt();\n\t\t\t\n\t\t\tlong gcd = gcd(a,... | import java.util.*;
public class Main {
public static void main(String[] args) {
new Main().run();
}
private void run() {
Scanner scan = new Scanner(System.in);
while (scan.hasNext()) {
long a = scan.nextInt();
long b = scan.nextInt();
long gcd = gcd(a, b);
long lcm = a * b / gcd;
System... |
[
7,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
41,
13,
41,
13,
41,
13,
11,
1,
4,
18,
13,
30,
30,
0,
13,
4,
18,
13,
0,
13,
4,
18,
13,
0,
13,
4,
13,
13,
13,
0,
13,
2,
2,
13,
13,
13,
4,
18,
18,
13,
13,
2,
2,
13,
17... | [
[
0,
1
],
[
103,
2
],
[
103,
3
],
[
3,
4
],
[
3,
5
],
[
5,
6
],
[
6,
7
],
[
6,
8
],
[
5,
9
],
[
9,
10
],
[
5,
11
],
[
11,
12
],
[
5,
13
],
[
13,
14
],... | [
"public class Main{\n public void run(java.io.InputStream in, java.io.PrintStream out){\n java.util.Scanner sc = new java.util.Scanner(in);\n/*answer*/\n int a, b, g, l;\n\n for(;sc.hasNext();){\n a = sc.nextInt();\n b = sc.nextInt();\n\n g = gcd(a, b);\n l = (a / g) * b;\n\n Syst... | public class Main{
public void run(java.io.InputStream in, java.io.PrintStream out){
java.util.Scanner sc = new java.util.Scanner(in);
/*answer*/
int a, b, g, l;
for(;sc.hasNext();){
a = sc.nextInt();
b = sc.nextInt();
g = gcd(a, b);
l = (a / g) * b;
System.out.println(g +... |
[
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,
4,
18,
18,
13,
13,
2,
2,
4,
13,
13,
13,
17,
2,
2,
13,
13,
4,
13,
13,
13,
23,
13,
12,
13,
30,
... | [
[
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
],
... | [
"import java.io.*;\nimport java.util.*;\n\nclass Main{\n\npublic static void main(String args[]) throws java.io.IOException{\nScanner scan = new Scanner(System.in);\nwhile(scan.hasNext()){\nlong a =scan.nextLong();\nlong b = scan.nextLong();\nSystem.out.println(gcd(a,b)+\" \"+(a*b)/gcd(a,b));\n}\n\n\n}\npublic stat... | import java.io.*;
import java.util.*;
class Main{
public static void main(String args[]) throws java.io.IOException{
Scanner scan = new Scanner(System.in);
while(scan.hasNext()){
long a =scan.nextLong();
long b = scan.nextLong();
System.out.println(gcd(a,b)+" "+(a*b)/gcd(a,b));
}
}
public static long gcd(long a,lon... |
[
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,
11,
1,
30,
30,
0,
13,
2,
13,
13,
14,
2,
13,
17,
30,
4,
18,
18,
13,
13,
2,
2,
... | [
[
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
],
[... | [
"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\t\twhile(sc.hasNext())\n\t\t\t{\n\t\t\t\tlong a = sc.nextInt();\n\t\t\t\tlong b = sc.nextInt();\n\t\t\t\tlong d = a * b; \n\t\t\t\tlong r;\n\t\t\t\t\tfor(;;)\n\t\t\t\t\t{\n\t\t\t\... | import java.util.Scanner;
class Main
{
public static void main(String[] args)
{
Scanner sc = new Scanner(System.in);
while(sc.hasNext())
{
long a = sc.nextInt();
long b = sc.nextInt();
long d = a * b;
long r;
for(;;)
{
r = a % b;if(r==0){System.out.println(b +" "+ d/b);break;... |
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
41,
13,
41,
13,
41,
13,
41,
13,
41,
13,
42,
4,
18,
13,
30,
0,
13,
4,
18,
13,
0,
13,
4,
18,
13,
17,
4,
18,
13,
13,
0,
13,
4,
18,
13,
18,
13,
17,
0,
13,
4,
... | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
143,
5
],
[
143,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
8,
14
],
... | [
"import java.util.*;\n/*\nMain class for AOJ where there is no input.\n*/\npublic class Main{\n public static void main(String[] args){\n Scanner sc = new Scanner(System.in);\n String str;\n String[] arr;\n int a;\n int b;\n int gcd;\n int lcm;\n \n \n while... | import java.util.*;
/*
Main class for AOJ where there is no input.
*/
public class Main{
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
String str;
String[] arr;
int a;
int b;
int gcd;
int lcm;
while(sc.hasNext()){
... |
[
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,
13,
0,
13,
4,
18,
13,
4,
18,
18,
13,
13,
0,
13,
4,
13,
13,
13,
4,
18,
18,
13,
13,
17,
4,
18,
18,
13,
13,
... | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
83,
5
],
[
83,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
8,
14
],
... | [
"import java.util.Scanner;\n\npublic class Main {\n\tpublic static void main(String[] args) {\n\t\tScanner in = new Scanner(System.in);\n\t\tint a, b, goc;\n\t\twhile (in.hasNext()) {\n\t\t\ta = in.nextInt();\n\t\t\tb = in.nextInt();\n\t\t\tSystem.out.print(goc = goc(a, b));\n\t\t\tSystem.out.print(\" \");\n\t\t\tS... | import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
int a, b, goc;
while (in.hasNext()) {
a = in.nextInt();
b = in.nextInt();
System.out.print(goc = goc(a, b));
System.out.print(" ");
System.out.println(a / goc * b);
}
}
... |
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
41,
13,
41,
13,
17,
41,
13,
17,
41,
13,
20,
42,
4,
18,
13,
30,
0,
13,
4,
18,
13,
0,
13,
4,
18,
13,
0,
13,
17,
0,
13,
17,
11,
1,
41,
13,
17,
2,
13,
4,
18,
13,
13,
13,
... | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
121,
5
],
[
121,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
8,
11
],
[
11,
12
],
[
8,
13
],
[
13,
14
],... | [
"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\t// TODO 自動生成されたメソッド・スタブ\n\t\tint a, b;\n\t\tint GCD = 0, LCM = 0;\n\t\tScanner scan = new Scanner(System.in);\n\t\twhile (scan.hasNext()) {\n\t\t\ta = scan.nextInt();\n\t\t\tb = scan.... | import java.util.Scanner;
public class Main {
/**
* @param args
*/
public static void main(String[] args) {
// TODO 自動生成されたメソッド・スタブ
int a, b;
int GCD = 0, LCM = 0;
Scanner scan = new Scanner(System.in);
while (scan.hasNext()) {
a = scan.nextInt();
b = scan.nextInt();
GCD = 0;
LCM = 0;
/... |
[
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,
13,
17,
4,
13,
13,
13,
13,
23,
... | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
108,
8
],
[
108,
9
],
[
9,
10
],
[
9,
11
],
[
11,
12
],
[
12,
13
],
[
12,
14
]... | [
"import java.io.BufferedInputStream;\nimport java.util.Scanner;\n\npublic class Main {\n\tpublic static void main(String[] args) {\n\t\tScanner scanner = new Scanner(new BufferedInputStream(System.in));\n\t\tlong a, b;\n\t\twhile (scanner.hasNext()) {\n\t\t\ta = scanner.nextLong();\n\t\t\tb = scanner.nextLong();\n\... | import java.io.BufferedInputStream;
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner scanner = new Scanner(new BufferedInputStream(System.in));
long a, b;
while (scanner.hasNext()) {
a = scanner.nextLong();
b = scanner.nextLong();
long gcd = gcd(a, b);
S... |
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
20,
42,
17,
30,
41,
13,
17,
41,
13,
4,
18,
13,
14,
2,
13,
17,
3,
41,
13,
20,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
... | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
205,
11
],
[
205,
12
],
[
12,
13
],
[
12,
14
],... | [
"import java.io.BufferedReader;\nimport java.io.IOException;\nimport java.io.InputStreamReader;\n\n\npublic class Main {\n\n\tpublic static void main(String[] args) throws IOException {\n\t\t// System.out.println(\"Hello world\");\n\t\tInputStreamReader is = new InputStreamReader(System.in);\n\t\tBufferedReader br ... | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class Main {
public static void main(String[] args) throws IOException {
// System.out.println("Hello world");
InputStreamReader is = new InputStreamReader(System.in);
BufferedReader br = new BufferedReader(is)... |
[
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,
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,
... | [
[
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
],
[
8,
14
],
... | [
"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 num1, num2, dividend, divisor, surplus;\n\t\t\n\t\twhile(scan.hasNext()) {\n\t\t\tnum1 = scan.nextLong();\n\t\t\tnum2 = scan.nextLong();\n\t\t\t\n\t\t\tif(num1 < num2) ... | import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
long num1, num2, dividend, divisor, surplus;
while(scan.hasNext()) {
num1 = scan.nextLong();
num2 = scan.nextLong();
if(num1 < num2) {
dividend = num2;
divisor = ... |
[
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,
42,
2,
2,
13,
13,
2,
13,
13,
30,
42,
2,
2,
2,
13,
13,
17,
2,
2,
13,
13,
17,
30,
... | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
89,
5
],
[
89,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
13,
14
],
... | [
"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 a = in.nextLong();\n\t\t\tlong b = in.nextLong();\n\t\t\tint k = 2;\n\t\t\tlong lcm = 1;\n\t\t\twhile(k < a || k < b){\n\t\t\t\twhile(a%k == 0 && b%k =... | import java.util.*;
public class Main {
public static void main(String[] args){
Scanner in = new Scanner(System.in);
while(in.hasNext()){
long a = in.nextLong();
long b = in.nextLong();
int k = 2;
long lcm = 1;
while(k < a || k < b){
while(a%k == 0 && b%k == 0){
a = a/k;
b = b/k;
... |
[
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,
... | [
[
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
],
[... | [
"import java.util.Scanner;\nclass 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 a = in.nextLong();\n\t\t\tlong b = in.nextLong();\n\t\t\tSystem.out.println(GCD(a, b) + \" \" + LCM(a, b));\n\t\t}\n\t\tin.close();\n\t}\n\n\tstatic lo... | import java.util.Scanner;
class Main {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
while(in.hasNext()){
long a = in.nextLong();
long b = in.nextLong();
System.out.println(GCD(a, b) + " " + LCM(a, b));
}
in.close();
}
static long GCD(long a, long b) {//a>b
if (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,
4,
18,
18,
13,
13,
17,
4,
13,
13,
13,
4,
13,
13,
13,
23,
13,
12,
13,
30,
41,
13,
17,
14,
2,
13,
17,
30,
0... | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
89,
5
],
[
89,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
13,
14
],
... | [
"import java.util.*;\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\tdouble a=sc.nextDouble();\n\t\t\tdouble b=sc.nextDouble();\n\t\t\tSystem.out.printf(\"%.0f %.0f\\n\",GCD(a,b),LCM(a,b));\n\t\t}\n\t}\n\tstatic double GCD(do... | import java.util.*;
public class Main {
public static void main(String[] args){
Scanner sc=new Scanner(System.in);
while(sc.hasNext()){
double a=sc.nextDouble();
double b=sc.nextDouble();
System.out.printf("%.0f %.0f\n",GCD(a,b),LCM(a,b));
}
}
static double GCD(double x,double y){
double g=0;
if(... |
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
41,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
42,
2,
13,
17,
30,
41,
13,
4,
18,
13,
17,
17,
0,
13,
20,
17,
0,
18,
13,
17,
4,
18,
13,
18,
13,
17,
0,
18,
13,
1... | [
[
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
],
[
130,
14
]... | [
"import java.io.BufferedReader;\nimport java.io.IOException;\nimport java.io.InputStreamReader;\n\npublic class Main {\n\tpublic static long numlong[];\n\n\tpublic static void main(String[] args) throws IOException {\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\t\tString str = br... | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class Main {
public static long numlong[];
public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
String str = br.readLine();
while... |
[
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,
... | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
127,
11
],
[
127,
12
],
[
12,
13
],
[
12,
14
],... | [
"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// TODO ?????????????????????????????????????????????\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.... | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class Main {
public static void main(String[] args) throws IOException {
// TODO ?????????????????????????????????????????????
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
while(t... |
[
7,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
17,
41,
13,
41,
13,
41,
13,
41,
13,
41,
13,
41,
13,
41,
13,
41,
13,
38,
5,
13,
30,
4,
18,
13,
17,
30,
11,
1,
2,
13,
17,
30,
30,
0,
13,
4,
18,
... | [
[
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
],
... | [
"import java.io.*;\nimport java.util.*;\n\nclass Main{\n\tpublic static void main(String[] args) throws IOException{\n\t\tBufferedReader r = new BufferedReader(new InputStreamReader(System.in));\n\t\tString s=\" \";\n\t\tStringTokenizer st;\n\t\tint a,b,gcd,lcm,t,m,n;\n\t\ttry {\n\t\t\tfor(;s!=null;){\n\t\t\t\ts = ... | import java.io.*;
import java.util.*;
class Main{
public static void main(String[] args) throws IOException{
BufferedReader r = new BufferedReader(new InputStreamReader(System.in));
String s=" ";
StringTokenizer st;
int a,b,gcd,lcm,t,m,n;
try {
for(;s!=null;){
s = r.readLine();
st = new StringTok... |
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
2,
13,
13,
14,
2,
13,
17,
29,
13,
29,
4,
13,
4,
18,
13,
13,
13,
4,
18,
13,
13,
13,
23,
13,
23,
13,
12,
13,
30,
41,
13,
4,
18,
13,
13,
13,
41,
13,
4,
18,
13,
13,
13,
4... | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
141,
5
],
[
141,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
11,
12
],
[
11,
13
],
[
8,
14
],... | [
"import java.util.Scanner;\n\npublic class Main {\n\t\n\tprivate static long commonDivisor(long a, long b){\n\t\tlong r = a%b;\n\t\tif(r==0) return b;\n\t\telse return commonDivisor(Math.max(r, b), Math.min(r, b));\n\t}\n\n\tprivate static long commonMultiple(long a, long b){\n\t\tlong max = Math.max(a, b);\n\t\tlo... | import java.util.Scanner;
public class Main {
private static long commonDivisor(long a, long b){
long r = a%b;
if(r==0) return b;
else return commonDivisor(Math.max(r, b), Math.min(r, b));
}
private static long commonMultiple(long a, long b){
long max = Math.max(a, b);
long min = Math.min(a, b);
long... |
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
42,
4,
18,
13,
30,
41,
13,
41,
13,
41,
13,
41,
13,
41,
13,
0,
13,
4,
18,
13,
0,
13,
4,
18,
13,
0,
13,
13,
0,
13,
13,
14,
2,
13,
13,
30,
41,
13,
13,
0,
13,
13,
0,
... | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
98,
5
],
[
98,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
13,
14
],
... | [
"import java.util.*;\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,b,c,d,amari;\n\t\t\ta = sc.nextInt();\n\t\t\tb = sc.nextInt();\n\t\t\tc = a;\n\t\t\td = b;\n\t\t\tif(a<b){\n\t\t\t\tint x = a;\n\t\t\t\ta=b;\n\t\t\t\... | import java.util.*;
public class Main{
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
while(sc.hasNext()){
int a,b,c,d,amari;
a = sc.nextInt();
b = sc.nextInt();
c = a;
d = b;
if(a<b){
int x = a;
a=b;
b=x;
}
while(a%b != 0){
amari = 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,
4,
13,
13,
13,
41,
13,
2,
2,
13,
13,
13,
4,
18,
18,
13,
13,
2,
2,
13,
17,
13,
4,
18,
13,
12,
13,
... | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
84,
5
],
[
84,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
13,
14
],
... | [
"\n\nimport java.util.Scanner;\n\npublic class Main {\n\n\tpublic void run() {\n\t\tScanner sc = new Scanner(System.in);\n\n\t\twhile (sc.hasNext()) {\n\t\t\tlong a = sc.nextInt();\n\t\t\tlong b = sc.nextInt();\n\n\t\t\tlong c = gcd(a, b);\n\n\t\t\tlong d = a * b / c;\n\n\t\t\tSystem.out.println(c + \" \" + d);\n\t... |
import java.util.Scanner;
public class Main {
public void run() {
Scanner sc = new Scanner(System.in);
while (sc.hasNext()) {
long a = sc.nextInt();
long b = sc.nextInt();
long c = gcd(a, b);
long d = a * b / c;
System.out.println(c + " " + d);
}
sc.close();
}
// 最大公約数
// ユークリッドの互除法
... |
[
7,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
38,
5,
13,
30,
4,
18,
13,
17,
30,
41,
13,
42,
2,
0,
13,
4,
18,
13,
17,
30,
41,
13,
4,
18,
13,
17,
17,
41,
13,
4,
18,
13,
18,
13,
17,
41,
13,
4,
18,
13... | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
97,
8
],
[
97,
9
],
[
9,
10
],
[
9,
11
],
[
11,
12
],
[
12,
13
],
[
12,
14
],
... | [
"import java.io.*;\nimport java.util.*;\n\npublic class Main {\n public static void main(String[] args) throws IOException{\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n try{\n String st;\n while((st= br.readLine())!=null){\n Stri... | import java.io.*;
import java.util.*;
public class Main {
public static void main(String[] args) throws IOException{
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
try{
String st;
while((st= br.readLine())!=null){
String[] s = st.sp... |
[
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,
41,
13,
2,
13,
13,
41,
13,
41,
13,
41,
13,
41,
13,
41,
13,
14,
2,
13,
17,
30,
11,
1,
41,
13,
17,
2,
13,
1... | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
169,
5
],
[
169,
6
],
[
6,
7
],
[
6,
8
],
[
169,
9
],
[
9,
10
],
[
9,
11
],
[
11,
12
],
[
12,
13
],
[
13,
14
... | [
"import java.util.*;\npublic class Main {\n\tstatic final Scanner stdin = new Scanner(System.in);\n\tpublic static void main(String[] args) {\n\t\twhile(stdin.hasNext()){\n\t\t\t\n\t\t\tint a = stdin.nextInt();\n\t\t\tint b = stdin.nextInt();\n \n\t\t\tint comp_val = a - b;\n\t\t\tint num, aval,m,n,ans1;\n\t\t... | import java.util.*;
public class Main {
static final Scanner stdin = new Scanner(System.in);
public static void main(String[] args) {
while(stdin.hasNext()){
int a = stdin.nextInt();
int b = stdin.nextInt();
int comp_val = a - b;
int num, aval,m,n,ans1;
if(comp_val > 0){
for(int i ... |
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
41,
13,
41,
13,
41,
13,
41,
13,
41,
13,
41,
13,
42,
4,
18,
13,
30,
0,
13,
4,
18,
13,
0,
13,
4,
18,
13,
0,
13,
13,
0,
13,
13,
14,
2,
13,
13,
30,
0,
13,
13,... | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
102,
5
],
[
102,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
8,
14
],
... | [
"import java.util.Scanner;\n\npublic class Main {\n public static void main(String[] args) {\n\n Scanner scan = new Scanner(System.in);\n \n long a, b, r, tmp,a1,b1,bai;\n while(scan.hasNextLong()){\n\n a = scan.nextInt();\n b = scan.nextInt();\n a1 = a;\n b1 = b;\n \n //?????¶??° a > ... | import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
long a, b, r, tmp,a1,b1,bai;
while(scan.hasNextLong()){
a = scan.nextInt();
b = scan.nextInt();
a1 = a;
b1 = 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,
41,
13,
13,
41,
13,
13,
41,
13,
13,
42,
2,
2,
13,
13,
17,
30,
0,
13,
2,
13,
13,
0,
13,
13,
0,
13,
13,
41,... | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
74,
5
],
[
74,
6
],
[
6,
7
],
[
6,
8
],
[
74,
9
],
[
9,
10
],
[
9,
11
],
[
11,
12
],
[
12,
13
],
[
13,
14
],... | [
"import java.util.Scanner;\n\npublic class Main {\n\n\tstatic Scanner sc = new java.util.Scanner(System.in);\n\n\tpublic static void main(String[] args) {\n\t\twhile (sc.hasNext()) {\n\t\t\tlong a = sc.nextInt();\n\t\t\tlong b = sc.nextInt();\n\t\t\tlong x = a;\n\t\t\tlong y = b;\n\t\t\tlong max = y;\n\t\t\twhile (... | import java.util.Scanner;
public class Main {
static Scanner sc = new java.util.Scanner(System.in);
public static void main(String[] args) {
while (sc.hasNext()) {
long a = sc.nextInt();
long b = sc.nextInt();
long x = a;
long y = b;
long max = y;
while (x % y != 0) {
max = x % y;
x = y... |
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
42,
17,
30,
14,
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,
30,
3,
23,
13,
12,
13,
30,
41,
13,... | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
198,
5
],
[
198,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],... | [
"import java.util.Scanner;\n\n\npublic class Main {\n\tpublic static void main(String[] args){\n\t\tScanner sc = new Scanner(System.in);\n\t\twhile(true){\n\t\t\tif(sc.hasNextInt()){\t//EOFについたらifが成り立たずbreakする\n\t\t\t\tint a = sc.nextInt();\n\t\t\t\tint b = sc.nextInt();\n\t\t\t\tSystem.out.println(GCD(a,b)+\" \"+L... | import java.util.Scanner;
public class Main {
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
while(true){
if(sc.hasNextInt()){ //EOFについたらifが成り立たずbreakする
int a = sc.nextInt();
int b = sc.nextInt();
System.out.println(GCD(a,b)+" "+LCM(a,b)); //公約数と公倍数を求めるメソッドは別に用意する
... |
[
7,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
11,
1,
41,
13,
41,
13,
41,
13,
4,
18,
13,
1,
4,
18,
18,
13,
13,
2,
2,
13,
17,
4,
18,
4,
18,
13,
13,
13,
30,
30,
0,
13,
4,
18,
13,
0,
13,
4,
18,
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
],
... | [
"import java.util.*;import java.math.*;class Main{public static void main(String[]g){Scanner S=new Scanner(System.in);for(BigInteger a,b,c;S.hasNext();System.out.println(c+\" \"+a.multiply(b).divide(c))){a=S.nextBigInteger();b=S.nextBigInteger();c=a.gcd(b);}}}",
"import java.util.*;",
"util.*",
"java",
"imp... | import java.util.*;import java.math.*;class Main{public static void main(String[]g){Scanner S=new Scanner(System.in);for(BigInteger a,b,c;S.hasNext();System.out.println(c+" "+a.multiply(b).divide(c))){a=S.nextBigInteger();b=S.nextBigInteger();c=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,
4,
18,
18,
13,
13,
2,
2,
4,
13,
13,
13,
17,
4,
13,
13,
13,
4,
18,
13,
23,
13,
12,
13,
30,
41,
13,
4,
18,
... | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
122,
5
],
[
122,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
13,
14
],... | [
"import java.util.Scanner;\npublic class Main{\n\tpublic static void main(String[] args){\n\t\tScanner sc=new Scanner(System.in);\n\t\twhile(sc.hasNextInt()){\n\t\t\tint a=sc.nextInt();\n\t\t\tint b=sc.nextInt();\n\t\t\tSystem.out.println(gcd(a,b)+\" \"+lcm(a,b));\n\t\t}\n\t\tsc.close();\n\t}\n\tstatic int gcd(int ... | import java.util.Scanner;
public class Main{
public static void main(String[] args){
Scanner sc=new Scanner(System.in);
while(sc.hasNextInt()){
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){
int c=Math.max(a, b);
in... |
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
41,
13,
41,
13,
20,
41,
13,
42,
17,
30,
14,
2,
0,
13,
4,
18,
13,
17,
3,
14,
2,
4,
18,
13,
17,
3,
41,
13,
4,
18,
13,
17,
41,
13,
20,
17,
11,
1,
41,
13,
17,
2,
13,
17,
... | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
8,
11
],
[
11,
12
],
[
8,
13
],
[
13,
14
],
[... | [
"import java.io.*;\nclass Main{\n\n public static void main(String[] args) throws IOException{\n\tint gcd,lcm;\n\tBufferedReader br=\n\t new BufferedReader (new InputStreamReader(System.in));\n\tString buf;\n\twhile(true){\n\t if((buf=br.readLine())==null)break;\n\t if(buf.length()==0)break;\n\t Stri... | import java.io.*;
class Main{
public static void main(String[] args) throws IOException{
int gcd,lcm;
BufferedReader br=
new BufferedReader (new InputStreamReader(System.in));
String buf;
while(true){
if((buf=br.readLine())==null)break;
if(buf.length()==0)break;
String[] data=buf.split(" ")... |
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
17,
42,
2,
0,
13,
4,
18,
13,
17,
30,
41,
13,
41,
13,
41,
13,
0,
13,
4,
18,
13,
4,
18,
13,
17,
4,
18,
13,
17,
0,
13,
4,
18,
13,
4,
... | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
144,
11
],
[
144,
12
],
[
12,
13
],
[
12,
14
],... | [
"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\tString line = \"\";\n\t\twhile ((line = br.rea... | 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 line = "";
while ((line = br.readLine()) != null) {
i... |
[
7,
15,
13,
17,
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,
42,
4,
18,
13,
30,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
14,
2,
1... | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
109,
8
],
[
109,
9
],
[
9,
10
],
[
9,
11
],
[
11,
12
],
[
12,
13
],
[
13,
14
]... | [
"import java.io.IOException;\nimport java.util.Scanner;\n\npublic class Main {\n private static int gcd(int a, int b){ \n if (b==0){\n return a;\n }else{\n return gcd(b,a%b);\n }\n }\n \n public static void main(String[] args) throws IOException {\n Scan... | import java.io.IOException;
import java.util.Scanner;
public class Main {
private static int gcd(int a, int b){
if (b==0){
return a;
}else{
return gcd(b,a%b);
}
}
public static void main(String[] args) throws IOException {
Scanner sc = new Scann... |
[
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,
17,
30,
14,
2,
13,
13,
30,
41,
13,
13,
0,
13,
13,
0,
13,
13,
14,
2,
2,
13,
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
],
[
13,
14
],
... | [
"import java.util.Scanner;\n\npublic class Main {\n\tpublic static void main(String[] args) {\n\t\tScanner s = new Scanner(System.in);\n\t\twhile (s.hasNextInt()) {\n\t\t\tint a = s.nextInt();\n\t\t\tint b = s.nextInt();\n\t\t\tint aa = a;\n\t\t\tint bb = b;\n\t\t\twhile (true) {\n\t\t\t\tif (a < b) {\n\t\t\t\t\tin... | import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner s = new Scanner(System.in);
while (s.hasNextInt()) {
int a = s.nextInt();
int b = s.nextInt();
int aa = a;
int bb = b;
while (true) {
if (a < b) {
int t = a;
a = b;
b = t;
}
if(... |
[
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,
1... | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
106,
11
],
[
106,
12
],
[
12,
13
],
[
12,
14
],... | [
"import java.io.IOException;\nimport java.io.InputStreamReader;\nimport java.io.BufferedReader;\n\npublic class Main{\n public static void main(String[] args) throws IOException{\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n String line;\n\n while( (line = br.... | import java.io.IOException;
import java.io.InputStreamReader;
import java.io.BufferedReader;
public class Main{
public static void main(String[] args) throws IOException{
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
String line;
while( (line = br.readLine()) !=... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.