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,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
14,
2,
2,
13,
13,
17,
29,
13,
29,
4,
13,
13,
2,
13,
13,
23,
13,
23,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
4,
18,
13,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
41,
13,
4,
13,
13,
4,
13,
13,
13,
0,
13,
13,
4,
18,
18,
13,
13,
13,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
111,
11
],
[
111,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
16,
17
],
[
17,
18
],
[
17,
19
],
[
16,
20
],
[
15,
21
],
[
21,
22
],
[
14,
23
],
[
23,
24
],
[
24,
25
],
[
24,
26
],
[
24,
27
],
[
27,
28
],
[
27,
29
],
[
12,
30
],
[
30,
31
],
[
12,
32
],
[
32,
33
],
[
111,
34
],
[
34,
35
],
[
34,
36
],
[
36,
37
],
[
37,
38
],
[
37,
39
],
[
36,
40
],
[
40,
41
],
[
40,
42
],
[
42,
43
],
[
43,
44
],
[
42,
45
],
[
45,
46
],
[
46,
47
],
[
36,
48
],
[
48,
49
],
[
48,
50
],
[
36,
51
],
[
51,
52
],
[
52,
53
],
[
53,
54
],
[
53,
55
],
[
51,
56
],
[
56,
57
],
[
56,
58
],
[
51,
59
],
[
59,
60
],
[
60,
61
],
[
51,
62
],
[
63,
63
],
[
63,
64
],
[
64,
65
],
[
65,
66
],
[
66,
67
],
[
66,
68
],
[
64,
69
],
[
69,
70
],
[
69,
71
],
[
64,
72
],
[
72,
73
],
[
73,
74
],
[
64,
75
],
[
76,
76
],
[
76,
77
],
[
77,
78
],
[
78,
79
],
[
79,
80
],
[
79,
81
],
[
77,
82
],
[
82,
83
],
[
82,
84
],
[
77,
85
],
[
85,
86
],
[
86,
87
],
[
77,
88
],
[
89,
89
],
[
89,
90
],
[
90,
91
],
[
90,
92
],
[
92,
93
],
[
92,
94
],
[
92,
95
],
[
95,
96
],
[
95,
97
],
[
95,
98
],
[
89,
99
],
[
99,
100
],
[
99,
101
],
[
36,
102
],
[
102,
103
],
[
103,
104
],
[
104,
105
],
[
104,
106
],
[
102,
107
],
[
34,
108
],
[
108,
109
],
[
0,
110
],
[
110,
111
],
[
110,
112
]
] |
[
"import java.io.*;\nimport java.lang.*;\nimport java.util.*;\npublic class Main{\n public static int gcd(int a,int b){\n if(a%b==0) return b;\n return gcd(b,a%b);\n }\n public static void main(String[] args) throws IOException{\n BufferedReader br=new BufferedReader(new InputStreamReader(System.in));\n int N=Integer.parseInt(br.readLine());\n long sum=0;\n for(int i=1;i<=N;i++){\n for(int j=1;j<=N;j++){\n for(int k=1;k<=N;k++){\n int m=gcd(i,gcd(j,k));\n sum+=m;\n }\n }\n }\n System.out.println(sum);\n }\n}",
"import java.io.*;",
"io.*",
"java",
"import java.lang.*;",
"lang.*",
"java",
"import java.util.*;",
"util.*",
"java",
"public class Main{\n public static int gcd(int a,int b){\n if(a%b==0) return b;\n return gcd(b,a%b);\n }\n public static void main(String[] args) throws IOException{\n BufferedReader br=new BufferedReader(new InputStreamReader(System.in));\n int N=Integer.parseInt(br.readLine());\n long sum=0;\n for(int i=1;i<=N;i++){\n for(int j=1;j<=N;j++){\n for(int k=1;k<=N;k++){\n int m=gcd(i,gcd(j,k));\n sum+=m;\n }\n }\n }\n System.out.println(sum);\n }\n}",
"Main",
"public static int gcd(int a,int b){\n if(a%b==0) return b;\n return gcd(b,a%b);\n }",
"gcd",
"{\n if(a%b==0) return b;\n return gcd(b,a%b);\n }",
"if(a%b==0) return b;",
"a%b==0",
"a%b",
"a",
"b",
"0",
"return b;",
"b",
"return gcd(b,a%b);",
"gcd(b,a%b)",
"gcd",
"b",
"a%b",
"a",
"b",
"int a",
"a",
"int b",
"b",
"public static void main(String[] args) throws IOException{\n BufferedReader br=new BufferedReader(new InputStreamReader(System.in));\n int N=Integer.parseInt(br.readLine());\n long sum=0;\n for(int i=1;i<=N;i++){\n for(int j=1;j<=N;j++){\n for(int k=1;k<=N;k++){\n int m=gcd(i,gcd(j,k));\n sum+=m;\n }\n }\n }\n System.out.println(sum);\n }",
"main",
"{\n BufferedReader br=new BufferedReader(new InputStreamReader(System.in));\n int N=Integer.parseInt(br.readLine());\n long sum=0;\n for(int i=1;i<=N;i++){\n for(int j=1;j<=N;j++){\n for(int k=1;k<=N;k++){\n int m=gcd(i,gcd(j,k));\n sum+=m;\n }\n }\n }\n System.out.println(sum);\n }",
"BufferedReader br=new BufferedReader(new InputStreamReader(System.in));",
"br",
"new BufferedReader(new InputStreamReader(System.in))",
"int N=Integer.parseInt(br.readLine());",
"N",
"Integer.parseInt(br.readLine())",
"Integer.parseInt",
"Integer",
"br.readLine()",
"br.readLine",
"br",
"long sum=0;",
"sum",
"0",
"for(int i=1;i<=N;i++){\n for(int j=1;j<=N;j++){\n for(int k=1;k<=N;k++){\n int m=gcd(i,gcd(j,k));\n sum+=m;\n }\n }\n }",
"int i=1;",
"int i=1;",
"i",
"1",
"i<=N",
"i",
"N",
"i++",
"i++",
"i",
"{\n for(int j=1;j<=N;j++){\n for(int k=1;k<=N;k++){\n int m=gcd(i,gcd(j,k));\n sum+=m;\n }\n }\n }",
"{\n for(int j=1;j<=N;j++){\n for(int k=1;k<=N;k++){\n int m=gcd(i,gcd(j,k));\n sum+=m;\n }\n }\n }",
"for(int j=1;j<=N;j++){\n for(int k=1;k<=N;k++){\n int m=gcd(i,gcd(j,k));\n sum+=m;\n }\n }",
"int j=1;",
"int j=1;",
"j",
"1",
"j<=N",
"j",
"N",
"j++",
"j++",
"j",
"{\n for(int k=1;k<=N;k++){\n int m=gcd(i,gcd(j,k));\n sum+=m;\n }\n }",
"{\n for(int k=1;k<=N;k++){\n int m=gcd(i,gcd(j,k));\n sum+=m;\n }\n }",
"for(int k=1;k<=N;k++){\n int m=gcd(i,gcd(j,k));\n sum+=m;\n }",
"int k=1;",
"int k=1;",
"k",
"1",
"k<=N",
"k",
"N",
"k++",
"k++",
"k",
"{\n int m=gcd(i,gcd(j,k));\n sum+=m;\n }",
"{\n int m=gcd(i,gcd(j,k));\n sum+=m;\n }",
"int m=gcd(i,gcd(j,k));",
"m",
"gcd(i,gcd(j,k))",
"gcd",
"i",
"gcd(j,k)",
"gcd",
"j",
"k",
"sum+=m",
"sum",
"m",
"System.out.println(sum)",
"System.out.println",
"System.out",
"System",
"System.out",
"sum",
"String[] args",
"args",
"public class Main{\n public static int gcd(int a,int b){\n if(a%b==0) return b;\n return gcd(b,a%b);\n }\n public static void main(String[] args) throws IOException{\n BufferedReader br=new BufferedReader(new InputStreamReader(System.in));\n int N=Integer.parseInt(br.readLine());\n long sum=0;\n for(int i=1;i<=N;i++){\n for(int j=1;j<=N;j++){\n for(int k=1;k<=N;k++){\n int m=gcd(i,gcd(j,k));\n sum+=m;\n }\n }\n }\n System.out.println(sum);\n }\n}",
"public class Main{\n public static int gcd(int a,int b){\n if(a%b==0) return b;\n return gcd(b,a%b);\n }\n public static void main(String[] args) throws IOException{\n BufferedReader br=new BufferedReader(new InputStreamReader(System.in));\n int N=Integer.parseInt(br.readLine());\n long sum=0;\n for(int i=1;i<=N;i++){\n for(int j=1;j<=N;j++){\n for(int k=1;k<=N;k++){\n int m=gcd(i,gcd(j,k));\n sum+=m;\n }\n }\n }\n System.out.println(sum);\n }\n}",
"Main"
] |
import java.io.*;
import java.lang.*;
import java.util.*;
public class Main{
public static int gcd(int a,int b){
if(a%b==0) return b;
return gcd(b,a%b);
}
public static void main(String[] args) throws IOException{
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
int N=Integer.parseInt(br.readLine());
long sum=0;
for(int i=1;i<=N;i++){
for(int j=1;j<=N;j++){
for(int k=1;k<=N;k++){
int m=gcd(i,gcd(j,k));
sum+=m;
}
}
}
System.out.println(sum);
}
}
|
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
42,
2,
13,
17,
30,
41,
13,
2,
13,
13,
0,
13,
13,
0,
13,
13,
29,
13,
23,
13,
23,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
17,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
2,
13,
17,
1,
40,
13,
30,
30,
11,
1,
41,
13,
17,
2,
13,
2,
13,
17,
1,
40,
13,
30,
30,
0,
13,
4,
13,
13,
13,
11,
1,
41,
13,
17,
2,
13,
2,
13,
17,
1,
40,
13,
30,
30,
0,
13,
4,
13,
13,
13,
4,
18,
18,
13,
13,
13,
23,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
10,
11
],
[
10,
12
],
[
9,
13
],
[
13,
14
],
[
14,
15
],
[
14,
16
],
[
16,
17
],
[
16,
18
],
[
13,
19
],
[
19,
20
],
[
19,
21
],
[
13,
22
],
[
22,
23
],
[
22,
24
],
[
8,
25
],
[
25,
26
],
[
6,
27
],
[
27,
28
],
[
6,
29
],
[
29,
30
],
[
4,
31
],
[
31,
32
],
[
31,
33
],
[
33,
34
],
[
34,
35
],
[
34,
36
],
[
33,
37
],
[
37,
38
],
[
37,
39
],
[
39,
40
],
[
40,
41
],
[
33,
42
],
[
42,
43
],
[
42,
44
],
[
33,
45
],
[
45,
46
],
[
45,
47
],
[
33,
48
],
[
48,
49
],
[
49,
50
],
[
50,
51
],
[
50,
52
],
[
48,
53
],
[
53,
54
],
[
53,
55
],
[
55,
56
],
[
55,
57
],
[
48,
58
],
[
58,
59
],
[
59,
60
],
[
48,
61
],
[
62,
62
],
[
62,
63
],
[
63,
64
],
[
64,
65
],
[
65,
66
],
[
65,
67
],
[
63,
68
],
[
68,
69
],
[
68,
70
],
[
70,
71
],
[
70,
72
],
[
63,
73
],
[
73,
74
],
[
74,
75
],
[
63,
76
],
[
77,
77
],
[
77,
78
],
[
78,
79
],
[
78,
80
],
[
80,
81
],
[
80,
82
],
[
80,
83
],
[
77,
84
],
[
84,
85
],
[
85,
86
],
[
86,
87
],
[
86,
88
],
[
84,
89
],
[
89,
90
],
[
89,
91
],
[
91,
92
],
[
91,
93
],
[
84,
94
],
[
94,
95
],
[
95,
96
],
[
84,
97
],
[
98,
98
],
[
98,
99
],
[
99,
100
],
[
99,
101
],
[
101,
102
],
[
101,
103
],
[
101,
104
],
[
33,
105
],
[
105,
106
],
[
106,
107
],
[
107,
108
],
[
107,
109
],
[
105,
110
],
[
31,
111
],
[
111,
112
]
] |
[
"import java.util.Scanner;\n\nclass Main {\n\n private static int gcd(int a, int b) {\n while (b != 0) {\n int r = a % b;\n a = b;\n b = r;\n }\n return a;\n }\n\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n long N = sc.nextLong();\n\n int res = 0;\n int temp = 0;\n for (int i = 1; i < N + 1; i++) {\n for (int j = 1; j < N + 1; j++) {\n temp = gcd(i, j);\n for (int k = 1; k < N + 1; k++) {\n res += gcd(k, temp);\n }\n }\n }\n\n System.out.println(res);\n }\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"class Main {\n\n private static int gcd(int a, int b) {\n while (b != 0) {\n int r = a % b;\n a = b;\n b = r;\n }\n return a;\n }\n\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n long N = sc.nextLong();\n\n int res = 0;\n int temp = 0;\n for (int i = 1; i < N + 1; i++) {\n for (int j = 1; j < N + 1; j++) {\n temp = gcd(i, j);\n for (int k = 1; k < N + 1; k++) {\n res += gcd(k, temp);\n }\n }\n }\n\n System.out.println(res);\n }\n}",
"Main",
"private static int gcd(int a, int b) {\n while (b != 0) {\n int r = a % b;\n a = b;\n b = r;\n }\n return a;\n }",
"gcd",
"{\n while (b != 0) {\n int r = a % b;\n a = b;\n b = r;\n }\n return a;\n }",
"while (b != 0) {\n int r = a % b;\n a = b;\n b = r;\n }",
"b != 0",
"b",
"0",
"{\n int r = a % b;\n a = b;\n b = r;\n }",
"int r = a % b;",
"r",
"a % b",
"a",
"b",
"a = b",
"a",
"b",
"b = r",
"b",
"r",
"return a;",
"a",
"int a",
"a",
"int b",
"b",
"public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n long N = sc.nextLong();\n\n int res = 0;\n int temp = 0;\n for (int i = 1; i < N + 1; i++) {\n for (int j = 1; j < N + 1; j++) {\n temp = gcd(i, j);\n for (int k = 1; k < N + 1; k++) {\n res += gcd(k, temp);\n }\n }\n }\n\n System.out.println(res);\n }",
"main",
"{\n Scanner sc = new Scanner(System.in);\n long N = sc.nextLong();\n\n int res = 0;\n int temp = 0;\n for (int i = 1; i < N + 1; i++) {\n for (int j = 1; j < N + 1; j++) {\n temp = gcd(i, j);\n for (int k = 1; k < N + 1; k++) {\n res += gcd(k, temp);\n }\n }\n }\n\n System.out.println(res);\n }",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"long N = sc.nextLong();",
"N",
"sc.nextLong()",
"sc.nextLong",
"sc",
"int res = 0;",
"res",
"0",
"int temp = 0;",
"temp",
"0",
"for (int i = 1; i < N + 1; i++) {\n for (int j = 1; j < N + 1; j++) {\n temp = gcd(i, j);\n for (int k = 1; k < N + 1; k++) {\n res += gcd(k, temp);\n }\n }\n }",
"int i = 1;",
"int i = 1;",
"i",
"1",
"i < N + 1",
"i",
"N + 1",
"N",
"1",
"i++",
"i++",
"i",
"{\n for (int j = 1; j < N + 1; j++) {\n temp = gcd(i, j);\n for (int k = 1; k < N + 1; k++) {\n res += gcd(k, temp);\n }\n }\n }",
"{\n for (int j = 1; j < N + 1; j++) {\n temp = gcd(i, j);\n for (int k = 1; k < N + 1; k++) {\n res += gcd(k, temp);\n }\n }\n }",
"for (int j = 1; j < N + 1; j++) {\n temp = gcd(i, j);\n for (int k = 1; k < N + 1; k++) {\n res += gcd(k, temp);\n }\n }",
"int j = 1;",
"int j = 1;",
"j",
"1",
"j < N + 1",
"j",
"N + 1",
"N",
"1",
"j++",
"j++",
"j",
"{\n temp = gcd(i, j);\n for (int k = 1; k < N + 1; k++) {\n res += gcd(k, temp);\n }\n }",
"{\n temp = gcd(i, j);\n for (int k = 1; k < N + 1; k++) {\n res += gcd(k, temp);\n }\n }",
"temp = gcd(i, j)",
"temp",
"gcd(i, j)",
"gcd",
"i",
"j",
"for (int k = 1; k < N + 1; k++) {\n res += gcd(k, temp);\n }",
"int k = 1;",
"int k = 1;",
"k",
"1",
"k < N + 1",
"k",
"N + 1",
"N",
"1",
"k++",
"k++",
"k",
"{\n res += gcd(k, temp);\n }",
"{\n res += gcd(k, temp);\n }",
"res += gcd(k, temp)",
"res",
"gcd(k, temp)",
"gcd",
"k",
"temp",
"System.out.println(res)",
"System.out.println",
"System.out",
"System",
"System.out",
"res",
"String[] args",
"args"
] |
import java.util.Scanner;
class Main {
private static int gcd(int a, int b) {
while (b != 0) {
int r = a % b;
a = b;
b = r;
}
return a;
}
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
long N = sc.nextLong();
int res = 0;
int temp = 0;
for (int i = 1; i < N + 1; i++) {
for (int j = 1; j < N + 1; j++) {
temp = gcd(i, j);
for (int k = 1; k < N + 1; k++) {
res += gcd(k, temp);
}
}
}
System.out.println(res);
}
}
|
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
4,
18,
13,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
41,
13,
4,
13,
4,
13,
13,
13,
13,
0,
13,
13,
4,
18,
18,
13,
13,
17,
13,
23,
13,
12,
13,
30,
41,
13,
39,
13,
13,
41,
13,
41,
13,
14,
2,
18,
13,
17,
18,
13,
17,
30,
0,
13,
18,
13,
17,
0,
13,
18,
13,
17,
30,
0,
13,
18,
13,
17,
0,
13,
18,
13,
17,
41,
13,
42,
2,
0,
13,
2,
13,
13,
17,
30,
0,
13,
13,
0,
13,
13,
29,
13,
23,
13,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
149,
5
],
[
149,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
8,
17
],
[
17,
18
],
[
18,
19
],
[
8,
20
],
[
20,
21
],
[
20,
22
],
[
8,
23
],
[
23,
24
],
[
24,
25
],
[
25,
26
],
[
25,
27
],
[
23,
28
],
[
28,
29
],
[
28,
30
],
[
23,
31
],
[
31,
32
],
[
32,
33
],
[
23,
34
],
[
35,
35
],
[
35,
36
],
[
36,
37
],
[
37,
38
],
[
38,
39
],
[
38,
40
],
[
36,
41
],
[
41,
42
],
[
41,
43
],
[
36,
44
],
[
44,
45
],
[
45,
46
],
[
36,
47
],
[
48,
48
],
[
48,
49
],
[
49,
50
],
[
50,
51
],
[
51,
52
],
[
51,
53
],
[
49,
54
],
[
54,
55
],
[
54,
56
],
[
49,
57
],
[
57,
58
],
[
58,
59
],
[
49,
60
],
[
61,
61
],
[
61,
62
],
[
62,
63
],
[
62,
64
],
[
64,
65
],
[
64,
66
],
[
66,
67
],
[
66,
68
],
[
66,
69
],
[
64,
70
],
[
61,
71
],
[
71,
72
],
[
71,
73
],
[
8,
74
],
[
74,
75
],
[
75,
76
],
[
76,
77
],
[
76,
78
],
[
74,
79
],
[
74,
80
],
[
6,
81
],
[
81,
82
],
[
149,
83
],
[
83,
84
],
[
83,
85
],
[
85,
86
],
[
86,
87
],
[
86,
88
],
[
88,
89
],
[
88,
90
],
[
85,
91
],
[
91,
92
],
[
85,
93
],
[
93,
94
],
[
85,
95
],
[
95,
96
],
[
96,
97
],
[
97,
98
],
[
97,
99
],
[
96,
100
],
[
100,
101
],
[
100,
102
],
[
95,
103
],
[
103,
104
],
[
104,
105
],
[
104,
106
],
[
106,
107
],
[
106,
108
],
[
103,
109
],
[
109,
110
],
[
109,
111
],
[
111,
112
],
[
111,
113
],
[
95,
114
],
[
114,
115
],
[
115,
116
],
[
115,
117
],
[
117,
118
],
[
117,
119
],
[
114,
120
],
[
120,
121
],
[
120,
122
],
[
122,
123
],
[
122,
124
],
[
85,
125
],
[
125,
126
],
[
85,
127
],
[
127,
128
],
[
128,
129
],
[
129,
130
],
[
129,
131
],
[
131,
132
],
[
131,
133
],
[
128,
134
],
[
127,
135
],
[
135,
136
],
[
136,
137
],
[
136,
138
],
[
135,
139
],
[
139,
140
],
[
139,
141
],
[
85,
142
],
[
142,
143
],
[
83,
144
],
[
144,
145
],
[
83,
146
],
[
146,
147
],
[
0,
148
],
[
148,
149
],
[
148,
150
]
] |
[
"import java.util.Scanner;\n\npublic class Main{\n\tpublic static void main(String[] args){\n\t\tScanner sc = new Scanner(System.in);\n\t\tint K = sc.nextInt();\n\t\tsc.close();\n\n\t\tint sum = 0;\n\t\tfor(int a=1; a<=K; a++){\n\t\t\tfor(int b=1; b<=K; b++){\n\t\t\t\tfor(int c=1; c<=K; c++){\n\t\t\t\t\tint x = getGCD(getGCD(a, b), c);\n\t\t\t\t\t//System.out.printf(\"%d %d %d %d\\n\", a, b, c, x);\n\t\t\t\t\tsum += x;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tSystem.out.printf(\"%d\\n\", sum);\n\t}\n\n\tpublic static int getGCD(int a, int b){\n\t\tint[] numArray = {a, b};\n\t\tint x;\n int y;\n if (numArray[0] > numArray[1]) {\n x = numArray[0];\n y = numArray[1];\n } else {\n x = numArray[1];\n y = numArray[0];\n }\n\n // ここからがユークリッドの互除法を用いた最大公約数を\n // 求める為の式\n int tmp;\n while ((tmp = x % y) != 0) {\n x = y;\n y = tmp;\n\t\t}\n\n\t\treturn y;\n\t}\n\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main{\n\tpublic static void main(String[] args){\n\t\tScanner sc = new Scanner(System.in);\n\t\tint K = sc.nextInt();\n\t\tsc.close();\n\n\t\tint sum = 0;\n\t\tfor(int a=1; a<=K; a++){\n\t\t\tfor(int b=1; b<=K; b++){\n\t\t\t\tfor(int c=1; c<=K; c++){\n\t\t\t\t\tint x = getGCD(getGCD(a, b), c);\n\t\t\t\t\t//System.out.printf(\"%d %d %d %d\\n\", a, b, c, x);\n\t\t\t\t\tsum += x;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tSystem.out.printf(\"%d\\n\", sum);\n\t}\n\n\tpublic static int getGCD(int a, int b){\n\t\tint[] numArray = {a, b};\n\t\tint x;\n int y;\n if (numArray[0] > numArray[1]) {\n x = numArray[0];\n y = numArray[1];\n } else {\n x = numArray[1];\n y = numArray[0];\n }\n\n // ここからがユークリッドの互除法を用いた最大公約数を\n // 求める為の式\n int tmp;\n while ((tmp = x % y) != 0) {\n x = y;\n y = tmp;\n\t\t}\n\n\t\treturn y;\n\t}\n\n}",
"Main",
"public static void main(String[] args){\n\t\tScanner sc = new Scanner(System.in);\n\t\tint K = sc.nextInt();\n\t\tsc.close();\n\n\t\tint sum = 0;\n\t\tfor(int a=1; a<=K; a++){\n\t\t\tfor(int b=1; b<=K; b++){\n\t\t\t\tfor(int c=1; c<=K; c++){\n\t\t\t\t\tint x = getGCD(getGCD(a, b), c);\n\t\t\t\t\t//System.out.printf(\"%d %d %d %d\\n\", a, b, c, x);\n\t\t\t\t\tsum += x;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tSystem.out.printf(\"%d\\n\", sum);\n\t}",
"main",
"{\n\t\tScanner sc = new Scanner(System.in);\n\t\tint K = sc.nextInt();\n\t\tsc.close();\n\n\t\tint sum = 0;\n\t\tfor(int a=1; a<=K; a++){\n\t\t\tfor(int b=1; b<=K; b++){\n\t\t\t\tfor(int c=1; c<=K; c++){\n\t\t\t\t\tint x = getGCD(getGCD(a, b), c);\n\t\t\t\t\t//System.out.printf(\"%d %d %d %d\\n\", a, b, c, x);\n\t\t\t\t\tsum += x;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tSystem.out.printf(\"%d\\n\", sum);\n\t}",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"int K = sc.nextInt();",
"K",
"sc.nextInt()",
"sc.nextInt",
"sc",
"sc.close()",
"sc.close",
"sc",
"int sum = 0;",
"sum",
"0",
"for(int a=1; a<=K; a++){\n\t\t\tfor(int b=1; b<=K; b++){\n\t\t\t\tfor(int c=1; c<=K; c++){\n\t\t\t\t\tint x = getGCD(getGCD(a, b), c);\n\t\t\t\t\t//System.out.printf(\"%d %d %d %d\\n\", a, b, c, x);\n\t\t\t\t\tsum += x;\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"int a=1;",
"int a=1;",
"a",
"1",
"a<=K",
"a",
"K",
"a++",
"a++",
"a",
"{\n\t\t\tfor(int b=1; b<=K; b++){\n\t\t\t\tfor(int c=1; c<=K; c++){\n\t\t\t\t\tint x = getGCD(getGCD(a, b), c);\n\t\t\t\t\t//System.out.printf(\"%d %d %d %d\\n\", a, b, c, x);\n\t\t\t\t\tsum += x;\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"{\n\t\t\tfor(int b=1; b<=K; b++){\n\t\t\t\tfor(int c=1; c<=K; c++){\n\t\t\t\t\tint x = getGCD(getGCD(a, b), c);\n\t\t\t\t\t//System.out.printf(\"%d %d %d %d\\n\", a, b, c, x);\n\t\t\t\t\tsum += x;\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"for(int b=1; b<=K; b++){\n\t\t\t\tfor(int c=1; c<=K; c++){\n\t\t\t\t\tint x = getGCD(getGCD(a, b), c);\n\t\t\t\t\t//System.out.printf(\"%d %d %d %d\\n\", a, b, c, x);\n\t\t\t\t\tsum += x;\n\t\t\t\t}\n\t\t\t}",
"int b=1;",
"int b=1;",
"b",
"1",
"b<=K",
"b",
"K",
"b++",
"b++",
"b",
"{\n\t\t\t\tfor(int c=1; c<=K; c++){\n\t\t\t\t\tint x = getGCD(getGCD(a, b), c);\n\t\t\t\t\t//System.out.printf(\"%d %d %d %d\\n\", a, b, c, x);\n\t\t\t\t\tsum += x;\n\t\t\t\t}\n\t\t\t}",
"{\n\t\t\t\tfor(int c=1; c<=K; c++){\n\t\t\t\t\tint x = getGCD(getGCD(a, b), c);\n\t\t\t\t\t//System.out.printf(\"%d %d %d %d\\n\", a, b, c, x);\n\t\t\t\t\tsum += x;\n\t\t\t\t}\n\t\t\t}",
"for(int c=1; c<=K; c++){\n\t\t\t\t\tint x = getGCD(getGCD(a, b), c);\n\t\t\t\t\t//System.out.printf(\"%d %d %d %d\\n\", a, b, c, x);\n\t\t\t\t\tsum += x;\n\t\t\t\t}",
"int c=1;",
"int c=1;",
"c",
"1",
"c<=K",
"c",
"K",
"c++",
"c++",
"c",
"{\n\t\t\t\t\tint x = getGCD(getGCD(a, b), c);\n\t\t\t\t\t//System.out.printf(\"%d %d %d %d\\n\", a, b, c, x);\n\t\t\t\t\tsum += x;\n\t\t\t\t}",
"{\n\t\t\t\t\tint x = getGCD(getGCD(a, b), c);\n\t\t\t\t\t//System.out.printf(\"%d %d %d %d\\n\", a, b, c, x);\n\t\t\t\t\tsum += x;\n\t\t\t\t}",
"int x = getGCD(getGCD(a, b), c);",
"x",
"getGCD(getGCD(a, b), c)",
"getGCD",
"getGCD(a, b)",
"getGCD",
"a",
"b",
"c",
"sum += x",
"sum",
"x",
"System.out.printf(\"%d\\n\", sum)",
"System.out.printf",
"System.out",
"System",
"System.out",
"\"%d\\n\"",
"sum",
"String[] args",
"args",
"public static int getGCD(int a, int b){\n\t\tint[] numArray = {a, b};\n\t\tint x;\n int y;\n if (numArray[0] > numArray[1]) {\n x = numArray[0];\n y = numArray[1];\n } else {\n x = numArray[1];\n y = numArray[0];\n }\n\n // ここからがユークリッドの互除法を用いた最大公約数を\n // 求める為の式\n int tmp;\n while ((tmp = x % y) != 0) {\n x = y;\n y = tmp;\n\t\t}\n\n\t\treturn y;\n\t}",
"getGCD",
"{\n\t\tint[] numArray = {a, b};\n\t\tint x;\n int y;\n if (numArray[0] > numArray[1]) {\n x = numArray[0];\n y = numArray[1];\n } else {\n x = numArray[1];\n y = numArray[0];\n }\n\n // ここからがユークリッドの互除法を用いた最大公約数を\n // 求める為の式\n int tmp;\n while ((tmp = x % y) != 0) {\n x = y;\n y = tmp;\n\t\t}\n\n\t\treturn y;\n\t}",
"int[] numArray = {a, b};",
"numArray",
"{a, b}",
"a",
"b",
"int x;",
"x",
"int y;",
"y",
"if (numArray[0] > numArray[1]) {\n x = numArray[0];\n y = numArray[1];\n } else {\n x = numArray[1];\n y = numArray[0];\n }",
"numArray[0] > numArray[1]",
"numArray[0]",
"numArray",
"0",
"numArray[1]",
"numArray",
"1",
"{\n x = numArray[0];\n y = numArray[1];\n }",
"x = numArray[0]",
"x",
"numArray[0]",
"numArray",
"0",
"y = numArray[1]",
"y",
"numArray[1]",
"numArray",
"1",
"{\n x = numArray[1];\n y = numArray[0];\n }",
"x = numArray[1]",
"x",
"numArray[1]",
"numArray",
"1",
"y = numArray[0]",
"y",
"numArray[0]",
"numArray",
"0",
"int tmp;",
"tmp",
"while ((tmp = x % y) != 0) {\n x = y;\n y = tmp;\n\t\t}",
"(tmp = x % y) != 0",
"(tmp = x % y)",
"tmp",
"x % y",
"x",
"y",
"0",
"{\n x = y;\n y = tmp;\n\t\t}",
"x = y",
"x",
"y",
"y = tmp",
"y",
"tmp",
"return y;",
"y",
"int a",
"a",
"int b",
"b",
"public class Main{\n\tpublic static void main(String[] args){\n\t\tScanner sc = new Scanner(System.in);\n\t\tint K = sc.nextInt();\n\t\tsc.close();\n\n\t\tint sum = 0;\n\t\tfor(int a=1; a<=K; a++){\n\t\t\tfor(int b=1; b<=K; b++){\n\t\t\t\tfor(int c=1; c<=K; c++){\n\t\t\t\t\tint x = getGCD(getGCD(a, b), c);\n\t\t\t\t\t//System.out.printf(\"%d %d %d %d\\n\", a, b, c, x);\n\t\t\t\t\tsum += x;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tSystem.out.printf(\"%d\\n\", sum);\n\t}\n\n\tpublic static int getGCD(int a, int b){\n\t\tint[] numArray = {a, b};\n\t\tint x;\n int y;\n if (numArray[0] > numArray[1]) {\n x = numArray[0];\n y = numArray[1];\n } else {\n x = numArray[1];\n y = numArray[0];\n }\n\n // ここからがユークリッドの互除法を用いた最大公約数を\n // 求める為の式\n int tmp;\n while ((tmp = x % y) != 0) {\n x = y;\n y = tmp;\n\t\t}\n\n\t\treturn y;\n\t}\n\n}",
"public class Main{\n\tpublic static void main(String[] args){\n\t\tScanner sc = new Scanner(System.in);\n\t\tint K = sc.nextInt();\n\t\tsc.close();\n\n\t\tint sum = 0;\n\t\tfor(int a=1; a<=K; a++){\n\t\t\tfor(int b=1; b<=K; b++){\n\t\t\t\tfor(int c=1; c<=K; c++){\n\t\t\t\t\tint x = getGCD(getGCD(a, b), c);\n\t\t\t\t\t//System.out.printf(\"%d %d %d %d\\n\", a, b, c, x);\n\t\t\t\t\tsum += x;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tSystem.out.printf(\"%d\\n\", sum);\n\t}\n\n\tpublic static int getGCD(int a, int b){\n\t\tint[] numArray = {a, b};\n\t\tint x;\n int y;\n if (numArray[0] > numArray[1]) {\n x = numArray[0];\n y = numArray[1];\n } else {\n x = numArray[1];\n y = numArray[0];\n }\n\n // ここからがユークリッドの互除法を用いた最大公約数を\n // 求める為の式\n int tmp;\n while ((tmp = x % y) != 0) {\n x = y;\n y = tmp;\n\t\t}\n\n\t\treturn y;\n\t}\n\n}",
"Main"
] |
import java.util.Scanner;
public class Main{
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
int K = sc.nextInt();
sc.close();
int sum = 0;
for(int a=1; a<=K; a++){
for(int b=1; b<=K; b++){
for(int c=1; c<=K; c++){
int x = getGCD(getGCD(a, b), c);
//System.out.printf("%d %d %d %d\n", a, b, c, x);
sum += x;
}
}
}
System.out.printf("%d\n", sum);
}
public static int getGCD(int a, int b){
int[] numArray = {a, b};
int x;
int y;
if (numArray[0] > numArray[1]) {
x = numArray[0];
y = numArray[1];
} else {
x = numArray[1];
y = numArray[0];
}
// ここからがユークリッドの互除法を用いた最大公約数を
// 求める為の式
int tmp;
while ((tmp = x % y) != 0) {
x = y;
y = tmp;
}
return y;
}
}
|
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
4,
13,
13,
13,
13,
4,
18,
18,
13,
13,
13,
23,
13,
12,
13,
30,
29,
4,
13,
13,
4,
13,
13,
13,
23,
13,
23,
13,
23,
13,
12,
13,
30,
41,
13,
17,
14,
2,
2,
13,
13,
17,
29,
13,
30,
41,
13,
2,
13,
13,
0,
13,
4,
13,
13,
13,
29,
13,
23,
13,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
124,
5
],
[
124,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
8,
17
],
[
17,
18
],
[
17,
19
],
[
8,
20
],
[
20,
21
],
[
21,
22
],
[
22,
23
],
[
22,
24
],
[
20,
25
],
[
25,
26
],
[
25,
27
],
[
20,
28
],
[
28,
29
],
[
29,
30
],
[
20,
31
],
[
32,
32
],
[
32,
33
],
[
33,
34
],
[
34,
35
],
[
35,
36
],
[
35,
37
],
[
33,
38
],
[
38,
39
],
[
38,
40
],
[
33,
41
],
[
41,
42
],
[
42,
43
],
[
33,
44
],
[
45,
45
],
[
45,
46
],
[
46,
47
],
[
47,
48
],
[
48,
49
],
[
48,
50
],
[
46,
51
],
[
51,
52
],
[
51,
53
],
[
46,
54
],
[
54,
55
],
[
55,
56
],
[
46,
57
],
[
58,
58
],
[
58,
59
],
[
59,
60
],
[
59,
61
],
[
61,
62
],
[
61,
63
],
[
61,
64
],
[
61,
65
],
[
8,
66
],
[
66,
67
],
[
67,
68
],
[
68,
69
],
[
68,
70
],
[
66,
71
],
[
6,
72
],
[
72,
73
],
[
124,
74
],
[
74,
75
],
[
74,
76
],
[
76,
77
],
[
77,
78
],
[
78,
79
],
[
78,
80
],
[
78,
81
],
[
81,
82
],
[
81,
83
],
[
81,
84
],
[
74,
85
],
[
85,
86
],
[
74,
87
],
[
87,
88
],
[
74,
89
],
[
89,
90
],
[
124,
91
],
[
91,
92
],
[
91,
93
],
[
93,
94
],
[
94,
95
],
[
94,
96
],
[
93,
97
],
[
97,
98
],
[
98,
99
],
[
99,
100
],
[
99,
101
],
[
98,
102
],
[
97,
103
],
[
103,
104
],
[
97,
105
],
[
105,
106
],
[
106,
107
],
[
106,
108
],
[
108,
109
],
[
108,
110
],
[
105,
111
],
[
111,
112
],
[
111,
113
],
[
113,
114
],
[
113,
115
],
[
113,
116
],
[
93,
117
],
[
117,
118
],
[
91,
119
],
[
119,
120
],
[
91,
121
],
[
121,
122
],
[
0,
123
],
[
123,
124
],
[
123,
125
]
] |
[
"import java.util.Scanner;\n\npublic class Main {\n\n public static void main(String[] args) {\n\n Scanner sc = new Scanner(System.in);\n int k = sc.nextInt();\n\n int ans = 0;\n for (int a = 1; a <= k; a++) {\n for (int b = 1; b <= k; b++) {\n for (int c = 1; c <= k; c++) {\n ans += gcd(a, b, c);\n }\n }\n }\n\n System.out.println(ans);\n }\n\n public static int gcd(int a, int b, int c) {\n return gcd(a, gcd(b, c));\n }\n\n public static int gcd(int x, int y) {\n int ret = 0;\n if (x % y == 0) return y;\n else {\n int z = x % y;\n ret = gcd(y, z);\n }\n return ret;\n }\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n\n public static void main(String[] args) {\n\n Scanner sc = new Scanner(System.in);\n int k = sc.nextInt();\n\n int ans = 0;\n for (int a = 1; a <= k; a++) {\n for (int b = 1; b <= k; b++) {\n for (int c = 1; c <= k; c++) {\n ans += gcd(a, b, c);\n }\n }\n }\n\n System.out.println(ans);\n }\n\n public static int gcd(int a, int b, int c) {\n return gcd(a, gcd(b, c));\n }\n\n public static int gcd(int x, int y) {\n int ret = 0;\n if (x % y == 0) return y;\n else {\n int z = x % y;\n ret = gcd(y, z);\n }\n return ret;\n }\n}",
"Main",
"public static void main(String[] args) {\n\n Scanner sc = new Scanner(System.in);\n int k = sc.nextInt();\n\n int ans = 0;\n for (int a = 1; a <= k; a++) {\n for (int b = 1; b <= k; b++) {\n for (int c = 1; c <= k; c++) {\n ans += gcd(a, b, c);\n }\n }\n }\n\n System.out.println(ans);\n }",
"main",
"{\n\n Scanner sc = new Scanner(System.in);\n int k = sc.nextInt();\n\n int ans = 0;\n for (int a = 1; a <= k; a++) {\n for (int b = 1; b <= k; b++) {\n for (int c = 1; c <= k; c++) {\n ans += gcd(a, b, c);\n }\n }\n }\n\n System.out.println(ans);\n }",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"int k = sc.nextInt();",
"k",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int ans = 0;",
"ans",
"0",
"for (int a = 1; a <= k; a++) {\n for (int b = 1; b <= k; b++) {\n for (int c = 1; c <= k; c++) {\n ans += gcd(a, b, c);\n }\n }\n }",
"int a = 1;",
"int a = 1;",
"a",
"1",
"a <= k",
"a",
"k",
"a++",
"a++",
"a",
"{\n for (int b = 1; b <= k; b++) {\n for (int c = 1; c <= k; c++) {\n ans += gcd(a, b, c);\n }\n }\n }",
"{\n for (int b = 1; b <= k; b++) {\n for (int c = 1; c <= k; c++) {\n ans += gcd(a, b, c);\n }\n }\n }",
"for (int b = 1; b <= k; b++) {\n for (int c = 1; c <= k; c++) {\n ans += gcd(a, b, c);\n }\n }",
"int b = 1;",
"int b = 1;",
"b",
"1",
"b <= k",
"b",
"k",
"b++",
"b++",
"b",
"{\n for (int c = 1; c <= k; c++) {\n ans += gcd(a, b, c);\n }\n }",
"{\n for (int c = 1; c <= k; c++) {\n ans += gcd(a, b, c);\n }\n }",
"for (int c = 1; c <= k; c++) {\n ans += gcd(a, b, c);\n }",
"int c = 1;",
"int c = 1;",
"c",
"1",
"c <= k",
"c",
"k",
"c++",
"c++",
"c",
"{\n ans += gcd(a, b, c);\n }",
"{\n ans += gcd(a, b, c);\n }",
"ans += gcd(a, b, c)",
"ans",
"gcd(a, b, c)",
"gcd",
"a",
"b",
"c",
"System.out.println(ans)",
"System.out.println",
"System.out",
"System",
"System.out",
"ans",
"String[] args",
"args",
"public static int gcd(int a, int b, int c) {\n return gcd(a, gcd(b, c));\n }",
"gcd",
"{\n return gcd(a, gcd(b, c));\n }",
"return gcd(a, gcd(b, c));",
"gcd(a, gcd(b, c))",
"gcd",
"a",
"gcd(b, c)",
"gcd",
"b",
"c",
"int a",
"a",
"int b",
"b",
"int c",
"c",
"public static int gcd(int x, int y) {\n int ret = 0;\n if (x % y == 0) return y;\n else {\n int z = x % y;\n ret = gcd(y, z);\n }\n return ret;\n }",
"gcd",
"{\n int ret = 0;\n if (x % y == 0) return y;\n else {\n int z = x % y;\n ret = gcd(y, z);\n }\n return ret;\n }",
"int ret = 0;",
"ret",
"0",
"if (x % y == 0) return y;\n else {\n int z = x % y;\n ret = gcd(y, z);\n }",
"x % y == 0",
"x % y",
"x",
"y",
"0",
"return y;",
"y",
"{\n int z = x % y;\n ret = gcd(y, z);\n }",
"int z = x % y;",
"z",
"x % y",
"x",
"y",
"ret = gcd(y, z)",
"ret",
"gcd(y, z)",
"gcd",
"y",
"z",
"return ret;",
"ret",
"int x",
"x",
"int y",
"y",
"public class Main {\n\n public static void main(String[] args) {\n\n Scanner sc = new Scanner(System.in);\n int k = sc.nextInt();\n\n int ans = 0;\n for (int a = 1; a <= k; a++) {\n for (int b = 1; b <= k; b++) {\n for (int c = 1; c <= k; c++) {\n ans += gcd(a, b, c);\n }\n }\n }\n\n System.out.println(ans);\n }\n\n public static int gcd(int a, int b, int c) {\n return gcd(a, gcd(b, c));\n }\n\n public static int gcd(int x, int y) {\n int ret = 0;\n if (x % y == 0) return y;\n else {\n int z = x % y;\n ret = gcd(y, z);\n }\n return ret;\n }\n}",
"public class Main {\n\n public static void main(String[] args) {\n\n Scanner sc = new Scanner(System.in);\n int k = sc.nextInt();\n\n int ans = 0;\n for (int a = 1; a <= k; a++) {\n for (int b = 1; b <= k; b++) {\n for (int c = 1; c <= k; c++) {\n ans += gcd(a, b, c);\n }\n }\n }\n\n System.out.println(ans);\n }\n\n public static int gcd(int a, int b, int c) {\n return gcd(a, gcd(b, c));\n }\n\n public static int gcd(int x, int y) {\n int ret = 0;\n if (x % y == 0) return y;\n else {\n int z = x % y;\n ret = gcd(y, z);\n }\n return ret;\n }\n}",
"Main"
] |
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int k = sc.nextInt();
int ans = 0;
for (int a = 1; a <= k; a++) {
for (int b = 1; b <= k; b++) {
for (int c = 1; c <= k; c++) {
ans += gcd(a, b, c);
}
}
}
System.out.println(ans);
}
public static int gcd(int a, int b, int c) {
return gcd(a, gcd(b, c));
}
public static int gcd(int x, int y) {
int ret = 0;
if (x % y == 0) return y;
else {
int z = x % y;
ret = gcd(y, z);
}
return ret;
}
}
|
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
4,
18,
13,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
41,
13,
4,
13,
13,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
0,
13,
4,
13,
13,
13,
4,
18,
18,
13,
13,
13,
23,
13,
12,
13,
30,
42,
2,
13,
17,
30,
41,
13,
13,
0,
13,
2,
13,
13,
0,
13,
13,
29,
13,
23,
13,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
112,
11
],
[
112,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
15,
17
],
[
14,
18
],
[
18,
19
],
[
18,
20
],
[
20,
21
],
[
21,
22
],
[
20,
23
],
[
23,
24
],
[
24,
25
],
[
14,
26
],
[
26,
27
],
[
26,
28
],
[
14,
29
],
[
29,
30
],
[
30,
31
],
[
31,
32
],
[
31,
33
],
[
29,
34
],
[
34,
35
],
[
34,
36
],
[
29,
37
],
[
37,
38
],
[
38,
39
],
[
29,
40
],
[
40,
41
],
[
41,
42
],
[
42,
43
],
[
43,
44
],
[
43,
45
],
[
41,
46
],
[
46,
47
],
[
46,
48
],
[
41,
49
],
[
49,
50
],
[
50,
51
],
[
41,
52
],
[
53,
53
],
[
53,
54
],
[
54,
55
],
[
54,
56
],
[
56,
57
],
[
56,
58
],
[
56,
59
],
[
53,
60
],
[
60,
61
],
[
61,
62
],
[
62,
63
],
[
62,
64
],
[
60,
65
],
[
65,
66
],
[
65,
67
],
[
60,
68
],
[
68,
69
],
[
69,
70
],
[
60,
71
],
[
71,
72
],
[
72,
73
],
[
72,
74
],
[
74,
75
],
[
74,
76
],
[
74,
77
],
[
14,
78
],
[
78,
79
],
[
79,
80
],
[
80,
81
],
[
80,
82
],
[
78,
83
],
[
12,
84
],
[
84,
85
],
[
112,
86
],
[
86,
87
],
[
86,
88
],
[
88,
89
],
[
89,
90
],
[
90,
91
],
[
90,
92
],
[
89,
93
],
[
93,
94
],
[
94,
95
],
[
94,
96
],
[
93,
97
],
[
97,
98
],
[
97,
99
],
[
99,
100
],
[
99,
101
],
[
93,
102
],
[
102,
103
],
[
102,
104
],
[
88,
105
],
[
105,
106
],
[
86,
107
],
[
107,
108
],
[
86,
109
],
[
109,
110
],
[
0,
111
],
[
111,
112
],
[
111,
113
]
] |
[
"import java.io.BufferedReader;\nimport java.io.IOException;\nimport java.io.InputStreamReader;\n\npublic class Main {\n public static void main(String[] args) throws IOException {\n \tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n int k = Integer.parseInt(br.readLine());\n \n long sum = 0L;\n for (int i = 1; i <= k; i++)\n for (int j = 1; j <= k; j++) {\n int g = gcd(i, j);\n for (int s = 1; s <= k; s++)\n sum += gcd(g, s);\n }\n \n System.out.print(sum);\n }\n \n private static int gcd(int a, int b) {\n \twhile (b != 0) {\n int t = b;\n b = a % b;\n a = t;\n }\n \n return a;\n }\n}",
"import java.io.BufferedReader;",
"BufferedReader",
"java.io",
"import java.io.IOException;",
"IOException",
"java.io",
"import java.io.InputStreamReader;",
"InputStreamReader",
"java.io",
"public class Main {\n public static void main(String[] args) throws IOException {\n \tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n int k = Integer.parseInt(br.readLine());\n \n long sum = 0L;\n for (int i = 1; i <= k; i++)\n for (int j = 1; j <= k; j++) {\n int g = gcd(i, j);\n for (int s = 1; s <= k; s++)\n sum += gcd(g, s);\n }\n \n System.out.print(sum);\n }\n \n private static int gcd(int a, int b) {\n \twhile (b != 0) {\n int t = b;\n b = a % b;\n a = t;\n }\n \n return a;\n }\n}",
"Main",
"public static void main(String[] args) throws IOException {\n \tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n int k = Integer.parseInt(br.readLine());\n \n long sum = 0L;\n for (int i = 1; i <= k; i++)\n for (int j = 1; j <= k; j++) {\n int g = gcd(i, j);\n for (int s = 1; s <= k; s++)\n sum += gcd(g, s);\n }\n \n System.out.print(sum);\n }",
"main",
"{\n \tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n int k = Integer.parseInt(br.readLine());\n \n long sum = 0L;\n for (int i = 1; i <= k; i++)\n for (int j = 1; j <= k; j++) {\n int g = gcd(i, j);\n for (int s = 1; s <= k; s++)\n sum += gcd(g, s);\n }\n \n System.out.print(sum);\n }",
"BufferedReader br = new BufferedReader(new InputStreamReader(System.in));",
"br",
"new BufferedReader(new InputStreamReader(System.in))",
"int k = Integer.parseInt(br.readLine());",
"k",
"Integer.parseInt(br.readLine())",
"Integer.parseInt",
"Integer",
"br.readLine()",
"br.readLine",
"br",
"long sum = 0L;",
"sum",
"0L",
"for (int i = 1; i <= k; i++)\n for (int j = 1; j <= k; j++) {\n int g = gcd(i, j);\n for (int s = 1; s <= k; s++)\n sum += gcd(g, s);\n }",
"int i = 1;",
"int i = 1;",
"i",
"1",
"i <= k",
"i",
"k",
"i++",
"i++",
"i",
"for (int j = 1; j <= k; j++) {\n int g = gcd(i, j);\n for (int s = 1; s <= k; s++)\n sum += gcd(g, s);\n }",
"for (int j = 1; j <= k; j++) {\n int g = gcd(i, j);\n for (int s = 1; s <= k; s++)\n sum += gcd(g, s);\n }",
"int j = 1;",
"int j = 1;",
"j",
"1",
"j <= k",
"j",
"k",
"j++",
"j++",
"j",
"{\n int g = gcd(i, j);\n for (int s = 1; s <= k; s++)\n sum += gcd(g, s);\n }",
"{\n int g = gcd(i, j);\n for (int s = 1; s <= k; s++)\n sum += gcd(g, s);\n }",
"int g = gcd(i, j);",
"g",
"gcd(i, j)",
"gcd",
"i",
"j",
"for (int s = 1; s <= k; s++)\n sum += gcd(g, s);",
"int s = 1;",
"int s = 1;",
"s",
"1",
"s <= k",
"s",
"k",
"s++",
"s++",
"s",
"sum += gcd(g, s);",
"sum += gcd(g, s)",
"sum",
"gcd(g, s)",
"gcd",
"g",
"s",
"System.out.print(sum)",
"System.out.print",
"System.out",
"System",
"System.out",
"sum",
"String[] args",
"args",
"private static int gcd(int a, int b) {\n \twhile (b != 0) {\n int t = b;\n b = a % b;\n a = t;\n }\n \n return a;\n }",
"gcd",
"{\n \twhile (b != 0) {\n int t = b;\n b = a % b;\n a = t;\n }\n \n return a;\n }",
"while (b != 0) {\n int t = b;\n b = a % b;\n a = t;\n }",
"b != 0",
"b",
"0",
"{\n int t = b;\n b = a % b;\n a = t;\n }",
"int t = b;",
"t",
"b",
"b = a % b",
"b",
"a % b",
"a",
"b",
"a = t",
"a",
"t",
"return a;",
"a",
"int a",
"a",
"int b",
"b",
"public class Main {\n public static void main(String[] args) throws IOException {\n \tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n int k = Integer.parseInt(br.readLine());\n \n long sum = 0L;\n for (int i = 1; i <= k; i++)\n for (int j = 1; j <= k; j++) {\n int g = gcd(i, j);\n for (int s = 1; s <= k; s++)\n sum += gcd(g, s);\n }\n \n System.out.print(sum);\n }\n \n private static int gcd(int a, int b) {\n \twhile (b != 0) {\n int t = b;\n b = a % b;\n a = t;\n }\n \n return a;\n }\n}",
"public class Main {\n public static void main(String[] args) throws IOException {\n \tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n int k = Integer.parseInt(br.readLine());\n \n long sum = 0L;\n for (int i = 1; i <= k; i++)\n for (int j = 1; j <= k; j++) {\n int g = gcd(i, j);\n for (int s = 1; s <= k; s++)\n sum += gcd(g, s);\n }\n \n System.out.print(sum);\n }\n \n private static int gcd(int a, int b) {\n \twhile (b != 0) {\n int t = b;\n b = a % b;\n a = t;\n }\n \n return a;\n }\n}",
"Main"
] |
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class Main {
public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
int k = Integer.parseInt(br.readLine());
long sum = 0L;
for (int i = 1; i <= k; i++)
for (int j = 1; j <= k; j++) {
int g = gcd(i, j);
for (int s = 1; s <= k; s++)
sum += gcd(g, s);
}
System.out.print(sum);
}
private static int gcd(int a, int b) {
while (b != 0) {
int t = b;
b = a % b;
a = t;
}
return a;
}
}
|
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
4,
18,
13,
41,
13,
20,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
11,
1,
41,
13,
13,
2,
13,
13,
1,
40,
13,
30,
30,
11,
1,
41,
13,
13,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
2,
4,
13,
13,
13,
13,
4,
13,
13,
13,
13,
4,
18,
18,
13,
13,
13,
23,
13,
12,
13,
30,
14,
2,
13,
13,
29,
4,
13,
13,
13,
14,
2,
13,
17,
29,
13,
29,
4,
13,
13,
2,
13,
13,
23,
13,
23,
13,
12,
13,
30,
29,
4,
13,
13,
4,
13,
13,
13,
23,
13,
23,
13,
23,
13,
12,
13,
30,
14,
2,
2,
2,
13,
13,
2,
13,
13,
2,
13,
13,
30,
29,
17,
14,
2,
2,
2,
13,
13,
2,
13,
13,
2,
13,
13,
30,
29,
17,
30,
29,
17,
23,
13,
23,
13,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
172,
5
],
[
172,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
8,
17
],
[
17,
18
],
[
18,
19
],
[
8,
20
],
[
20,
21
],
[
20,
22
],
[
8,
23
],
[
23,
24
],
[
24,
25
],
[
25,
26
],
[
25,
27
],
[
23,
28
],
[
28,
29
],
[
28,
30
],
[
23,
31
],
[
31,
32
],
[
32,
33
],
[
23,
34
],
[
35,
35
],
[
35,
36
],
[
36,
37
],
[
37,
38
],
[
38,
39
],
[
38,
40
],
[
36,
41
],
[
41,
42
],
[
41,
43
],
[
36,
44
],
[
44,
45
],
[
45,
46
],
[
36,
47
],
[
48,
48
],
[
48,
49
],
[
49,
50
],
[
50,
51
],
[
51,
52
],
[
51,
53
],
[
49,
54
],
[
54,
55
],
[
54,
56
],
[
49,
57
],
[
57,
58
],
[
58,
59
],
[
49,
60
],
[
61,
61
],
[
61,
62
],
[
62,
63
],
[
62,
64
],
[
64,
65
],
[
65,
66
],
[
65,
67
],
[
65,
68
],
[
65,
69
],
[
64,
70
],
[
70,
71
],
[
70,
72
],
[
70,
73
],
[
70,
74
],
[
8,
75
],
[
75,
76
],
[
76,
77
],
[
77,
78
],
[
77,
79
],
[
75,
80
],
[
6,
81
],
[
81,
82
],
[
172,
83
],
[
83,
84
],
[
83,
85
],
[
85,
86
],
[
86,
87
],
[
87,
88
],
[
87,
89
],
[
86,
90
],
[
90,
91
],
[
91,
92
],
[
91,
93
],
[
91,
94
],
[
85,
95
],
[
95,
96
],
[
96,
97
],
[
96,
98
],
[
95,
99
],
[
99,
100
],
[
85,
101
],
[
101,
102
],
[
102,
103
],
[
102,
104
],
[
102,
105
],
[
105,
106
],
[
105,
107
],
[
83,
108
],
[
108,
109
],
[
83,
110
],
[
110,
111
],
[
172,
112
],
[
112,
113
],
[
112,
114
],
[
114,
115
],
[
115,
116
],
[
116,
117
],
[
116,
118
],
[
116,
119
],
[
119,
120
],
[
119,
121
],
[
119,
122
],
[
112,
123
],
[
123,
124
],
[
112,
125
],
[
125,
126
],
[
112,
127
],
[
127,
128
],
[
172,
129
],
[
129,
130
],
[
129,
131
],
[
131,
132
],
[
132,
133
],
[
134,
134
],
[
134,
135
],
[
135,
136
],
[
135,
137
],
[
134,
138
],
[
138,
139
],
[
138,
140
],
[
134,
141
],
[
141,
142
],
[
141,
143
],
[
132,
144
],
[
144,
145
],
[
145,
146
],
[
132,
147
],
[
147,
148
],
[
149,
149
],
[
149,
150
],
[
150,
151
],
[
150,
152
],
[
149,
153
],
[
153,
154
],
[
153,
155
],
[
149,
156
],
[
156,
157
],
[
156,
158
],
[
147,
159
],
[
159,
160
],
[
160,
161
],
[
147,
162
],
[
162,
163
],
[
163,
164
],
[
129,
165
],
[
165,
166
],
[
129,
167
],
[
167,
168
],
[
129,
169
],
[
169,
170
],
[
0,
171
],
[
171,
172
],
[
171,
173
]
] |
[
"import java.util.*;\n\npublic class Main {\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n \n long K = sc.nextLong(); \n sc.nextLine();\n long sum = new Long(0);\n\n for(int i = 1; i <= K; i++){\n for(int j = i; j <= K; j++){\n for(int k = j; k <= K; k++) {\n sum += gcdtrip(i, j, k)*check(i, j, k);\n }\n }\n }\n System.out.println(sum);\n }\n\n static long gcd(long m, long n) {\n if(m < n) return gcd(n, m);\n if(n == 0) return m;\n return gcd(n, m % n);\n }\n\n static long gcdtrip(long a, long b, long c) {\n return gcd(a,gcd(b,c)) ;\n }\n\n static int check(int a, int b, int c) {\n if (a == b && a == c && b == a) {\n return 1;\n } else if (a == b || b == c || a == c) {\n return 3;\n } else {\n return 6;\n }\n }\n}",
"import java.util.*;",
"util.*",
"java",
"public class Main {\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n \n long K = sc.nextLong(); \n sc.nextLine();\n long sum = new Long(0);\n\n for(int i = 1; i <= K; i++){\n for(int j = i; j <= K; j++){\n for(int k = j; k <= K; k++) {\n sum += gcdtrip(i, j, k)*check(i, j, k);\n }\n }\n }\n System.out.println(sum);\n }\n\n static long gcd(long m, long n) {\n if(m < n) return gcd(n, m);\n if(n == 0) return m;\n return gcd(n, m % n);\n }\n\n static long gcdtrip(long a, long b, long c) {\n return gcd(a,gcd(b,c)) ;\n }\n\n static int check(int a, int b, int c) {\n if (a == b && a == c && b == a) {\n return 1;\n } else if (a == b || b == c || a == c) {\n return 3;\n } else {\n return 6;\n }\n }\n}",
"Main",
"public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n \n long K = sc.nextLong(); \n sc.nextLine();\n long sum = new Long(0);\n\n for(int i = 1; i <= K; i++){\n for(int j = i; j <= K; j++){\n for(int k = j; k <= K; k++) {\n sum += gcdtrip(i, j, k)*check(i, j, k);\n }\n }\n }\n System.out.println(sum);\n }",
"main",
"{\n Scanner sc = new Scanner(System.in);\n \n long K = sc.nextLong(); \n sc.nextLine();\n long sum = new Long(0);\n\n for(int i = 1; i <= K; i++){\n for(int j = i; j <= K; j++){\n for(int k = j; k <= K; k++) {\n sum += gcdtrip(i, j, k)*check(i, j, k);\n }\n }\n }\n System.out.println(sum);\n }",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"long K = sc.nextLong();",
"K",
"sc.nextLong()",
"sc.nextLong",
"sc",
"sc.nextLine()",
"sc.nextLine",
"sc",
"long sum = new Long(0);",
"sum",
"new Long(0)",
"for(int i = 1; i <= K; i++){\n for(int j = i; j <= K; j++){\n for(int k = j; k <= K; k++) {\n sum += gcdtrip(i, j, k)*check(i, j, k);\n }\n }\n }",
"int i = 1;",
"int i = 1;",
"i",
"1",
"i <= K",
"i",
"K",
"i++",
"i++",
"i",
"{\n for(int j = i; j <= K; j++){\n for(int k = j; k <= K; k++) {\n sum += gcdtrip(i, j, k)*check(i, j, k);\n }\n }\n }",
"{\n for(int j = i; j <= K; j++){\n for(int k = j; k <= K; k++) {\n sum += gcdtrip(i, j, k)*check(i, j, k);\n }\n }\n }",
"for(int j = i; j <= K; j++){\n for(int k = j; k <= K; k++) {\n sum += gcdtrip(i, j, k)*check(i, j, k);\n }\n }",
"int j = i;",
"int j = i;",
"j",
"i",
"j <= K",
"j",
"K",
"j++",
"j++",
"j",
"{\n for(int k = j; k <= K; k++) {\n sum += gcdtrip(i, j, k)*check(i, j, k);\n }\n }",
"{\n for(int k = j; k <= K; k++) {\n sum += gcdtrip(i, j, k)*check(i, j, k);\n }\n }",
"for(int k = j; k <= K; k++) {\n sum += gcdtrip(i, j, k)*check(i, j, k);\n }",
"int k = j;",
"int k = j;",
"k",
"j",
"k <= K",
"k",
"K",
"k++",
"k++",
"k",
"{\n sum += gcdtrip(i, j, k)*check(i, j, k);\n }",
"{\n sum += gcdtrip(i, j, k)*check(i, j, k);\n }",
"sum += gcdtrip(i, j, k)*check(i, j, k)",
"sum",
"gcdtrip(i, j, k)*check(i, j, k)",
"gcdtrip(i, j, k)",
"gcdtrip",
"i",
"j",
"k",
"check(i, j, k)",
"check",
"i",
"j",
"k",
"System.out.println(sum)",
"System.out.println",
"System.out",
"System",
"System.out",
"sum",
"String[] args",
"args",
"static long gcd(long m, long n) {\n if(m < n) return gcd(n, m);\n if(n == 0) return m;\n return gcd(n, m % n);\n }",
"gcd",
"{\n if(m < n) return gcd(n, m);\n if(n == 0) return m;\n return gcd(n, m % n);\n }",
"if(m < n) return gcd(n, m);",
"m < n",
"m",
"n",
"return gcd(n, m);",
"gcd(n, m)",
"gcd",
"n",
"m",
"if(n == 0) return m;",
"n == 0",
"n",
"0",
"return m;",
"m",
"return gcd(n, m % n);",
"gcd(n, m % n)",
"gcd",
"n",
"m % n",
"m",
"n",
"long m",
"m",
"long n",
"n",
"static long gcdtrip(long a, long b, long c) {\n return gcd(a,gcd(b,c)) ;\n }",
"gcdtrip",
"{\n return gcd(a,gcd(b,c)) ;\n }",
"return gcd(a,gcd(b,c)) ;",
"gcd(a,gcd(b,c))",
"gcd",
"a",
"gcd(b,c)",
"gcd",
"b",
"c",
"long a",
"a",
"long b",
"b",
"long c",
"c",
"static int check(int a, int b, int c) {\n if (a == b && a == c && b == a) {\n return 1;\n } else if (a == b || b == c || a == c) {\n return 3;\n } else {\n return 6;\n }\n }",
"check",
"{\n if (a == b && a == c && b == a) {\n return 1;\n } else if (a == b || b == c || a == c) {\n return 3;\n } else {\n return 6;\n }\n }",
"if (a == b && a == c && b == a) {\n return 1;\n } else if (a == b || b == c || a == c) {\n return 3;\n } else {\n return 6;\n }",
"a == b && a == c && b == a",
"a == b && a == c && b == a",
"a == b",
"a",
"b",
"a == c",
"a",
"c",
"b == a",
"b",
"a",
"{\n return 1;\n }",
"return 1;",
"1",
"if (a == b || b == c || a == c) {\n return 3;\n } else {\n return 6;\n }",
"a == b || b == c || a == c",
"a == b || b == c || a == c",
"a == b",
"a",
"b",
"b == c",
"b",
"c",
"a == c",
"a",
"c",
"{\n return 3;\n }",
"return 3;",
"3",
"{\n return 6;\n }",
"return 6;",
"6",
"int a",
"a",
"int b",
"b",
"int c",
"c",
"public class Main {\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n \n long K = sc.nextLong(); \n sc.nextLine();\n long sum = new Long(0);\n\n for(int i = 1; i <= K; i++){\n for(int j = i; j <= K; j++){\n for(int k = j; k <= K; k++) {\n sum += gcdtrip(i, j, k)*check(i, j, k);\n }\n }\n }\n System.out.println(sum);\n }\n\n static long gcd(long m, long n) {\n if(m < n) return gcd(n, m);\n if(n == 0) return m;\n return gcd(n, m % n);\n }\n\n static long gcdtrip(long a, long b, long c) {\n return gcd(a,gcd(b,c)) ;\n }\n\n static int check(int a, int b, int c) {\n if (a == b && a == c && b == a) {\n return 1;\n } else if (a == b || b == c || a == c) {\n return 3;\n } else {\n return 6;\n }\n }\n}",
"public class Main {\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n \n long K = sc.nextLong(); \n sc.nextLine();\n long sum = new Long(0);\n\n for(int i = 1; i <= K; i++){\n for(int j = i; j <= K; j++){\n for(int k = j; k <= K; k++) {\n sum += gcdtrip(i, j, k)*check(i, j, k);\n }\n }\n }\n System.out.println(sum);\n }\n\n static long gcd(long m, long n) {\n if(m < n) return gcd(n, m);\n if(n == 0) return m;\n return gcd(n, m % n);\n }\n\n static long gcdtrip(long a, long b, long c) {\n return gcd(a,gcd(b,c)) ;\n }\n\n static int check(int a, int b, int c) {\n if (a == b && a == c && b == a) {\n return 1;\n } else if (a == b || b == c || a == c) {\n return 3;\n } else {\n return 6;\n }\n }\n}",
"Main"
] |
import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
long K = sc.nextLong();
sc.nextLine();
long sum = new Long(0);
for(int i = 1; i <= K; i++){
for(int j = i; j <= K; j++){
for(int k = j; k <= K; k++) {
sum += gcdtrip(i, j, k)*check(i, j, k);
}
}
}
System.out.println(sum);
}
static long gcd(long m, long n) {
if(m < n) return gcd(n, m);
if(n == 0) return m;
return gcd(n, m % n);
}
static long gcdtrip(long a, long b, long c) {
return gcd(a,gcd(b,c)) ;
}
static int check(int a, int b, int c) {
if (a == b && a == c && b == a) {
return 1;
} else if (a == b || b == c || a == c) {
return 3;
} else {
return 6;
}
}
}
|
[
7,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
20,
41,
13,
4,
18,
13,
4,
18,
13,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
4,
13,
4,
13,
13,
13,
13,
4,
18,
13,
13,
4,
18,
13,
23,
13,
12,
13,
30,
42,
2,
13,
17,
30,
41,
13,
13,
0,
13,
2,
13,
13,
0,
13,
13,
29,
13,
23,
13,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
112,
8
],
[
112,
9
],
[
9,
10
],
[
9,
11
],
[
11,
12
],
[
12,
13
],
[
12,
14
],
[
11,
15
],
[
15,
16
],
[
15,
17
],
[
11,
18
],
[
18,
19
],
[
18,
20
],
[
20,
21
],
[
21,
22
],
[
20,
23
],
[
23,
24
],
[
24,
25
],
[
11,
26
],
[
26,
27
],
[
26,
28
],
[
11,
29
],
[
29,
30
],
[
30,
31
],
[
31,
32
],
[
31,
33
],
[
29,
34
],
[
34,
35
],
[
34,
36
],
[
29,
37
],
[
37,
38
],
[
38,
39
],
[
29,
40
],
[
41,
41
],
[
41,
42
],
[
42,
43
],
[
43,
44
],
[
44,
45
],
[
44,
46
],
[
42,
47
],
[
47,
48
],
[
47,
49
],
[
42,
50
],
[
50,
51
],
[
51,
52
],
[
42,
53
],
[
54,
54
],
[
54,
55
],
[
55,
56
],
[
56,
57
],
[
57,
58
],
[
57,
59
],
[
55,
60
],
[
60,
61
],
[
60,
62
],
[
55,
63
],
[
63,
64
],
[
64,
65
],
[
55,
66
],
[
67,
67
],
[
67,
68
],
[
68,
69
],
[
68,
70
],
[
70,
71
],
[
70,
72
],
[
72,
73
],
[
72,
74
],
[
72,
75
],
[
70,
76
],
[
11,
77
],
[
77,
78
],
[
78,
79
],
[
77,
80
],
[
11,
81
],
[
81,
82
],
[
82,
83
],
[
9,
84
],
[
84,
85
],
[
112,
86
],
[
86,
87
],
[
86,
88
],
[
88,
89
],
[
89,
90
],
[
90,
91
],
[
90,
92
],
[
89,
93
],
[
93,
94
],
[
94,
95
],
[
94,
96
],
[
93,
97
],
[
97,
98
],
[
97,
99
],
[
99,
100
],
[
99,
101
],
[
93,
102
],
[
102,
103
],
[
102,
104
],
[
88,
105
],
[
105,
106
],
[
86,
107
],
[
107,
108
],
[
86,
109
],
[
109,
110
],
[
0,
111
],
[
111,
112
],
[
111,
113
]
] |
[
"import java.util.*;\nimport java.io.*;\n\npublic class Main {\n public static void main(String[] args) throws IOException{\n BufferedReader f = new BufferedReader(new InputStreamReader(System.in));\n PrintWriter out = new PrintWriter(new OutputStreamWriter(System.out));\n int k = Integer.parseInt(f.readLine());\n long sum = 0;\n for(int i = 1; i <= k; i++){\n for(int j = 1; j <= k; j++){\n for(int jj = 1; jj <= k; jj++){\n sum+=gcd(gcd(i, j), jj);\n }\n }\n }\n out.println(sum);\n out.close();\n }\n\n public static long gcd(long a, long b){\n while(b != 0){\n long t = b;\n b = a%b;\n a = t;\n }\n return a;\n }\n}",
"import java.util.*;",
"util.*",
"java",
"import java.io.*;",
"io.*",
"java",
"public class Main {\n public static void main(String[] args) throws IOException{\n BufferedReader f = new BufferedReader(new InputStreamReader(System.in));\n PrintWriter out = new PrintWriter(new OutputStreamWriter(System.out));\n int k = Integer.parseInt(f.readLine());\n long sum = 0;\n for(int i = 1; i <= k; i++){\n for(int j = 1; j <= k; j++){\n for(int jj = 1; jj <= k; jj++){\n sum+=gcd(gcd(i, j), jj);\n }\n }\n }\n out.println(sum);\n out.close();\n }\n\n public static long gcd(long a, long b){\n while(b != 0){\n long t = b;\n b = a%b;\n a = t;\n }\n return a;\n }\n}",
"Main",
"public static void main(String[] args) throws IOException{\n BufferedReader f = new BufferedReader(new InputStreamReader(System.in));\n PrintWriter out = new PrintWriter(new OutputStreamWriter(System.out));\n int k = Integer.parseInt(f.readLine());\n long sum = 0;\n for(int i = 1; i <= k; i++){\n for(int j = 1; j <= k; j++){\n for(int jj = 1; jj <= k; jj++){\n sum+=gcd(gcd(i, j), jj);\n }\n }\n }\n out.println(sum);\n out.close();\n }",
"main",
"{\n BufferedReader f = new BufferedReader(new InputStreamReader(System.in));\n PrintWriter out = new PrintWriter(new OutputStreamWriter(System.out));\n int k = Integer.parseInt(f.readLine());\n long sum = 0;\n for(int i = 1; i <= k; i++){\n for(int j = 1; j <= k; j++){\n for(int jj = 1; jj <= k; jj++){\n sum+=gcd(gcd(i, j), jj);\n }\n }\n }\n out.println(sum);\n out.close();\n }",
"BufferedReader f = new BufferedReader(new InputStreamReader(System.in));",
"f",
"new BufferedReader(new InputStreamReader(System.in))",
"PrintWriter out = new PrintWriter(new OutputStreamWriter(System.out));",
"out",
"new PrintWriter(new OutputStreamWriter(System.out))",
"int k = Integer.parseInt(f.readLine());",
"k",
"Integer.parseInt(f.readLine())",
"Integer.parseInt",
"Integer",
"f.readLine()",
"f.readLine",
"f",
"long sum = 0;",
"sum",
"0",
"for(int i = 1; i <= k; i++){\n for(int j = 1; j <= k; j++){\n for(int jj = 1; jj <= k; jj++){\n sum+=gcd(gcd(i, j), jj);\n }\n }\n }",
"int i = 1;",
"int i = 1;",
"i",
"1",
"i <= k",
"i",
"k",
"i++",
"i++",
"i",
"{\n for(int j = 1; j <= k; j++){\n for(int jj = 1; jj <= k; jj++){\n sum+=gcd(gcd(i, j), jj);\n }\n }\n }",
"{\n for(int j = 1; j <= k; j++){\n for(int jj = 1; jj <= k; jj++){\n sum+=gcd(gcd(i, j), jj);\n }\n }\n }",
"for(int j = 1; j <= k; j++){\n for(int jj = 1; jj <= k; jj++){\n sum+=gcd(gcd(i, j), jj);\n }\n }",
"int j = 1;",
"int j = 1;",
"j",
"1",
"j <= k",
"j",
"k",
"j++",
"j++",
"j",
"{\n for(int jj = 1; jj <= k; jj++){\n sum+=gcd(gcd(i, j), jj);\n }\n }",
"{\n for(int jj = 1; jj <= k; jj++){\n sum+=gcd(gcd(i, j), jj);\n }\n }",
"for(int jj = 1; jj <= k; jj++){\n sum+=gcd(gcd(i, j), jj);\n }",
"int jj = 1;",
"int jj = 1;",
"jj",
"1",
"jj <= k",
"jj",
"k",
"jj++",
"jj++",
"jj",
"{\n sum+=gcd(gcd(i, j), jj);\n }",
"{\n sum+=gcd(gcd(i, j), jj);\n }",
"sum+=gcd(gcd(i, j), jj)",
"sum",
"gcd(gcd(i, j), jj)",
"gcd",
"gcd(i, j)",
"gcd",
"i",
"j",
"jj",
"out.println(sum)",
"out.println",
"out",
"sum",
"out.close()",
"out.close",
"out",
"String[] args",
"args",
"public static long gcd(long a, long b){\n while(b != 0){\n long t = b;\n b = a%b;\n a = t;\n }\n return a;\n }",
"gcd",
"{\n while(b != 0){\n long t = b;\n b = a%b;\n a = t;\n }\n return a;\n }",
"while(b != 0){\n long t = b;\n b = a%b;\n a = t;\n }",
"b != 0",
"b",
"0",
"{\n long t = b;\n b = a%b;\n a = t;\n }",
"long t = b;",
"t",
"b",
"b = a%b",
"b",
"a%b",
"a",
"b",
"a = t",
"a",
"t",
"return a;",
"a",
"long a",
"a",
"long b",
"b",
"public class Main {\n public static void main(String[] args) throws IOException{\n BufferedReader f = new BufferedReader(new InputStreamReader(System.in));\n PrintWriter out = new PrintWriter(new OutputStreamWriter(System.out));\n int k = Integer.parseInt(f.readLine());\n long sum = 0;\n for(int i = 1; i <= k; i++){\n for(int j = 1; j <= k; j++){\n for(int jj = 1; jj <= k; jj++){\n sum+=gcd(gcd(i, j), jj);\n }\n }\n }\n out.println(sum);\n out.close();\n }\n\n public static long gcd(long a, long b){\n while(b != 0){\n long t = b;\n b = a%b;\n a = t;\n }\n return a;\n }\n}",
"public class Main {\n public static void main(String[] args) throws IOException{\n BufferedReader f = new BufferedReader(new InputStreamReader(System.in));\n PrintWriter out = new PrintWriter(new OutputStreamWriter(System.out));\n int k = Integer.parseInt(f.readLine());\n long sum = 0;\n for(int i = 1; i <= k; i++){\n for(int j = 1; j <= k; j++){\n for(int jj = 1; jj <= k; jj++){\n sum+=gcd(gcd(i, j), jj);\n }\n }\n }\n out.println(sum);\n out.close();\n }\n\n public static long gcd(long a, long b){\n while(b != 0){\n long t = b;\n b = a%b;\n a = t;\n }\n return a;\n }\n}",
"Main"
] |
import java.util.*;
import java.io.*;
public class Main {
public static void main(String[] args) throws IOException{
BufferedReader f = new BufferedReader(new InputStreamReader(System.in));
PrintWriter out = new PrintWriter(new OutputStreamWriter(System.out));
int k = Integer.parseInt(f.readLine());
long sum = 0;
for(int i = 1; i <= k; i++){
for(int j = 1; j <= k; j++){
for(int jj = 1; jj <= k; jj++){
sum+=gcd(gcd(i, j), jj);
}
}
}
out.println(sum);
out.close();
}
public static long gcd(long a, long b){
while(b != 0){
long t = b;
b = a%b;
a = t;
}
return a;
}
}
|
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
11,
1,
41,
13,
2,
13,
17,
2,
2,
13,
13,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
2,
4,
13,
13,
13,
13,
17,
0,
13,
2,
4,
13,
13,
13,
13,
17,
11,
1,
41,
13,
2,
13,
17,
2,
2,
2,
13,
13,
2,
13,
13,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
2,
4,
13,
13,
13,
13,
17,
4,
18,
18,
13,
13,
13,
23,
13,
12,
13,
30,
41,
13,
17,
41,
13,
4,
18,
13,
4,
18,
13,
13,
13,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
14,
2,
2,
2,
2,
13,
13,
17,
2,
2,
13,
13,
17,
2,
2,
13,
13,
17,
0,
13,
13,
29,
13,
23,
13,
23,
13,
23,
13,
12,
13,
30,
11,
1,
41,
13,
17,
2,
13,
4,
18,
13,
13,
1,
40,
13,
30,
30,
14,
2,
2,
13,
13,
17,
29,
17,
29,
17,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
217,
5
],
[
217,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
8,
17
],
[
17,
18
],
[
17,
19
],
[
8,
20
],
[
20,
21
],
[
21,
22
],
[
22,
23
],
[
22,
24
],
[
20,
25
],
[
25,
26
],
[
25,
27
],
[
20,
28
],
[
28,
29
],
[
29,
30
],
[
20,
31
],
[
32,
32
],
[
32,
33
],
[
33,
34
],
[
33,
35
],
[
8,
36
],
[
36,
37
],
[
37,
38
],
[
38,
39
],
[
38,
40
],
[
36,
41
],
[
41,
42
],
[
41,
43
],
[
36,
44
],
[
44,
45
],
[
45,
46
],
[
36,
47
],
[
48,
48
],
[
48,
49
],
[
49,
50
],
[
50,
51
],
[
51,
52
],
[
51,
53
],
[
53,
54
],
[
53,
55
],
[
49,
56
],
[
56,
57
],
[
57,
58
],
[
57,
59
],
[
56,
60
],
[
60,
61
],
[
60,
62
],
[
49,
63
],
[
63,
64
],
[
64,
65
],
[
49,
66
],
[
67,
67
],
[
67,
68
],
[
68,
69
],
[
68,
70
],
[
70,
71
],
[
71,
72
],
[
71,
73
],
[
71,
74
],
[
71,
75
],
[
70,
76
],
[
67,
77
],
[
77,
78
],
[
77,
79
],
[
79,
80
],
[
80,
81
],
[
80,
82
],
[
80,
83
],
[
80,
84
],
[
79,
85
],
[
67,
86
],
[
86,
87
],
[
87,
88
],
[
88,
89
],
[
88,
90
],
[
90,
91
],
[
90,
92
],
[
86,
93
],
[
94,
94
],
[
94,
95
],
[
95,
96
],
[
95,
97
],
[
94,
98
],
[
98,
99
],
[
98,
100
],
[
94,
101
],
[
101,
102
],
[
101,
103
],
[
86,
104
],
[
104,
105
],
[
105,
106
],
[
86,
107
],
[
108,
108
],
[
108,
109
],
[
109,
110
],
[
109,
111
],
[
111,
112
],
[
112,
113
],
[
112,
114
],
[
112,
115
],
[
112,
116
],
[
111,
117
],
[
8,
118
],
[
118,
119
],
[
119,
120
],
[
120,
121
],
[
120,
122
],
[
118,
123
],
[
6,
124
],
[
124,
125
],
[
217,
126
],
[
126,
127
],
[
126,
128
],
[
128,
129
],
[
129,
130
],
[
129,
131
],
[
128,
132
],
[
132,
133
],
[
132,
134
],
[
134,
135
],
[
135,
136
],
[
134,
137
],
[
137,
138
],
[
138,
139
],
[
137,
140
],
[
137,
141
],
[
134,
142
],
[
128,
143
],
[
143,
144
],
[
144,
145
],
[
145,
146
],
[
145,
147
],
[
143,
148
],
[
148,
149
],
[
148,
150
],
[
143,
151
],
[
151,
152
],
[
152,
153
],
[
143,
154
],
[
155,
155
],
[
155,
156
],
[
156,
157
],
[
158,
158
],
[
158,
159
],
[
159,
160
],
[
160,
161
],
[
160,
162
],
[
159,
163
],
[
158,
164
],
[
164,
165
],
[
165,
166
],
[
165,
167
],
[
164,
168
],
[
158,
169
],
[
169,
170
],
[
170,
171
],
[
170,
172
],
[
169,
173
],
[
156,
174
],
[
174,
175
],
[
174,
176
],
[
128,
177
],
[
177,
178
],
[
126,
179
],
[
179,
180
],
[
126,
181
],
[
181,
182
],
[
126,
183
],
[
183,
184
],
[
217,
185
],
[
185,
186
],
[
185,
187
],
[
187,
188
],
[
188,
189
],
[
189,
190
],
[
190,
191
],
[
190,
192
],
[
188,
193
],
[
193,
194
],
[
193,
195
],
[
195,
196
],
[
196,
197
],
[
195,
198
],
[
188,
199
],
[
199,
200
],
[
200,
201
],
[
188,
202
],
[
203,
203
],
[
203,
204
],
[
204,
205
],
[
205,
206
],
[
206,
207
],
[
206,
208
],
[
205,
209
],
[
204,
210
],
[
210,
211
],
[
187,
212
],
[
212,
213
],
[
185,
214
],
[
214,
215
],
[
0,
216
],
[
216,
217
],
[
216,
218
]
] |
[
"import java.util.Scanner;\n\npublic class Main {\n\n\tpublic static void main(String[] args) {\n\t\tScanner input = new Scanner(System.in);\n\t\tint K = input.nextInt();\n\t\tlong sum = 0;\n\t\tfor (int i = 1; i <= K; i++) {\n\t\t\tsum+=i;\n\t\t}\n\t\tfor (int a = 1; a <= K; a++) {\n\t\t\tfor (int b = a+1; b <= K&& b!=a; b++) {\n\t\t\t\tsum+=GCD(a,b,b)*3;\n\t\t\t\tsum+=GCD(a,a,b)*3;\n\t\t\t\tfor (int c = b+1; c <= K && c!=a&&c!=b; c++){\n\t\t\t\t\tsum+=GCD(a,b,c)*6;\n\t\t\t\t} \n\t\t\t}\n\t\t}\n\t\tSystem.out.println(sum);\n\t}\n\tpublic static long GCD(int a, int b, int c) {\n\t\tlong max = 1;\n\t\tint min = Math.min(Math.min(a, b),c);\n\t\tfor (long i = 2; i <= min; i++) {\n\t\t\tif (a%i==0&&b%i==0&&c%i==0) max=i;\n\t\t} \n\t\treturn max;\n\t}\n\tpublic static boolean Prime(int n) {\n\t\tfor (int i = 2; i <= Math.sqrt(n); i++) {\n\t\t\tif (n%i==0) return false;\n\t\t}\n\t\treturn true;\n\t}\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n\n\tpublic static void main(String[] args) {\n\t\tScanner input = new Scanner(System.in);\n\t\tint K = input.nextInt();\n\t\tlong sum = 0;\n\t\tfor (int i = 1; i <= K; i++) {\n\t\t\tsum+=i;\n\t\t}\n\t\tfor (int a = 1; a <= K; a++) {\n\t\t\tfor (int b = a+1; b <= K&& b!=a; b++) {\n\t\t\t\tsum+=GCD(a,b,b)*3;\n\t\t\t\tsum+=GCD(a,a,b)*3;\n\t\t\t\tfor (int c = b+1; c <= K && c!=a&&c!=b; c++){\n\t\t\t\t\tsum+=GCD(a,b,c)*6;\n\t\t\t\t} \n\t\t\t}\n\t\t}\n\t\tSystem.out.println(sum);\n\t}\n\tpublic static long GCD(int a, int b, int c) {\n\t\tlong max = 1;\n\t\tint min = Math.min(Math.min(a, b),c);\n\t\tfor (long i = 2; i <= min; i++) {\n\t\t\tif (a%i==0&&b%i==0&&c%i==0) max=i;\n\t\t} \n\t\treturn max;\n\t}\n\tpublic static boolean Prime(int n) {\n\t\tfor (int i = 2; i <= Math.sqrt(n); i++) {\n\t\t\tif (n%i==0) return false;\n\t\t}\n\t\treturn true;\n\t}\n}",
"Main",
"public static void main(String[] args) {\n\t\tScanner input = new Scanner(System.in);\n\t\tint K = input.nextInt();\n\t\tlong sum = 0;\n\t\tfor (int i = 1; i <= K; i++) {\n\t\t\tsum+=i;\n\t\t}\n\t\tfor (int a = 1; a <= K; a++) {\n\t\t\tfor (int b = a+1; b <= K&& b!=a; b++) {\n\t\t\t\tsum+=GCD(a,b,b)*3;\n\t\t\t\tsum+=GCD(a,a,b)*3;\n\t\t\t\tfor (int c = b+1; c <= K && c!=a&&c!=b; c++){\n\t\t\t\t\tsum+=GCD(a,b,c)*6;\n\t\t\t\t} \n\t\t\t}\n\t\t}\n\t\tSystem.out.println(sum);\n\t}",
"main",
"{\n\t\tScanner input = new Scanner(System.in);\n\t\tint K = input.nextInt();\n\t\tlong sum = 0;\n\t\tfor (int i = 1; i <= K; i++) {\n\t\t\tsum+=i;\n\t\t}\n\t\tfor (int a = 1; a <= K; a++) {\n\t\t\tfor (int b = a+1; b <= K&& b!=a; b++) {\n\t\t\t\tsum+=GCD(a,b,b)*3;\n\t\t\t\tsum+=GCD(a,a,b)*3;\n\t\t\t\tfor (int c = b+1; c <= K && c!=a&&c!=b; c++){\n\t\t\t\t\tsum+=GCD(a,b,c)*6;\n\t\t\t\t} \n\t\t\t}\n\t\t}\n\t\tSystem.out.println(sum);\n\t}",
"Scanner input = new Scanner(System.in);",
"input",
"new Scanner(System.in)",
"int K = input.nextInt();",
"K",
"input.nextInt()",
"input.nextInt",
"input",
"long sum = 0;",
"sum",
"0",
"for (int i = 1; i <= K; i++) {\n\t\t\tsum+=i;\n\t\t}",
"int i = 1;",
"int i = 1;",
"i",
"1",
"i <= K",
"i",
"K",
"i++",
"i++",
"i",
"{\n\t\t\tsum+=i;\n\t\t}",
"{\n\t\t\tsum+=i;\n\t\t}",
"sum+=i",
"sum",
"i",
"for (int a = 1; a <= K; a++) {\n\t\t\tfor (int b = a+1; b <= K&& b!=a; b++) {\n\t\t\t\tsum+=GCD(a,b,b)*3;\n\t\t\t\tsum+=GCD(a,a,b)*3;\n\t\t\t\tfor (int c = b+1; c <= K && c!=a&&c!=b; c++){\n\t\t\t\t\tsum+=GCD(a,b,c)*6;\n\t\t\t\t} \n\t\t\t}\n\t\t}",
"int a = 1;",
"int a = 1;",
"a",
"1",
"a <= K",
"a",
"K",
"a++",
"a++",
"a",
"{\n\t\t\tfor (int b = a+1; b <= K&& b!=a; b++) {\n\t\t\t\tsum+=GCD(a,b,b)*3;\n\t\t\t\tsum+=GCD(a,a,b)*3;\n\t\t\t\tfor (int c = b+1; c <= K && c!=a&&c!=b; c++){\n\t\t\t\t\tsum+=GCD(a,b,c)*6;\n\t\t\t\t} \n\t\t\t}\n\t\t}",
"{\n\t\t\tfor (int b = a+1; b <= K&& b!=a; b++) {\n\t\t\t\tsum+=GCD(a,b,b)*3;\n\t\t\t\tsum+=GCD(a,a,b)*3;\n\t\t\t\tfor (int c = b+1; c <= K && c!=a&&c!=b; c++){\n\t\t\t\t\tsum+=GCD(a,b,c)*6;\n\t\t\t\t} \n\t\t\t}\n\t\t}",
"for (int b = a+1; b <= K&& b!=a; b++) {\n\t\t\t\tsum+=GCD(a,b,b)*3;\n\t\t\t\tsum+=GCD(a,a,b)*3;\n\t\t\t\tfor (int c = b+1; c <= K && c!=a&&c!=b; c++){\n\t\t\t\t\tsum+=GCD(a,b,c)*6;\n\t\t\t\t} \n\t\t\t}",
"int b = a+1;",
"int b = a+1;",
"b",
"a+1",
"a",
"1",
"b <= K&& b!=a",
"b <= K",
"b",
"K",
"b!=a",
"b",
"a",
"b++",
"b++",
"b",
"{\n\t\t\t\tsum+=GCD(a,b,b)*3;\n\t\t\t\tsum+=GCD(a,a,b)*3;\n\t\t\t\tfor (int c = b+1; c <= K && c!=a&&c!=b; c++){\n\t\t\t\t\tsum+=GCD(a,b,c)*6;\n\t\t\t\t} \n\t\t\t}",
"{\n\t\t\t\tsum+=GCD(a,b,b)*3;\n\t\t\t\tsum+=GCD(a,a,b)*3;\n\t\t\t\tfor (int c = b+1; c <= K && c!=a&&c!=b; c++){\n\t\t\t\t\tsum+=GCD(a,b,c)*6;\n\t\t\t\t} \n\t\t\t}",
"sum+=GCD(a,b,b)*3",
"sum",
"GCD(a,b,b)*3",
"GCD(a,b,b)",
"GCD",
"a",
"b",
"b",
"3",
"sum+=GCD(a,a,b)*3",
"sum",
"GCD(a,a,b)*3",
"GCD(a,a,b)",
"GCD",
"a",
"a",
"b",
"3",
"for (int c = b+1; c <= K && c!=a&&c!=b; c++){\n\t\t\t\t\tsum+=GCD(a,b,c)*6;\n\t\t\t\t}",
"int c = b+1;",
"int c = b+1;",
"c",
"b+1",
"b",
"1",
"c <= K && c!=a&&c!=b",
"c <= K && c!=a&&c!=b",
"c <= K",
"c",
"K",
"c!=a",
"c",
"a",
"c!=b",
"c",
"b",
"c++",
"c++",
"c",
"{\n\t\t\t\t\tsum+=GCD(a,b,c)*6;\n\t\t\t\t}",
"{\n\t\t\t\t\tsum+=GCD(a,b,c)*6;\n\t\t\t\t}",
"sum+=GCD(a,b,c)*6",
"sum",
"GCD(a,b,c)*6",
"GCD(a,b,c)",
"GCD",
"a",
"b",
"c",
"6",
"System.out.println(sum)",
"System.out.println",
"System.out",
"System",
"System.out",
"sum",
"String[] args",
"args",
"public static long GCD(int a, int b, int c) {\n\t\tlong max = 1;\n\t\tint min = Math.min(Math.min(a, b),c);\n\t\tfor (long i = 2; i <= min; i++) {\n\t\t\tif (a%i==0&&b%i==0&&c%i==0) max=i;\n\t\t} \n\t\treturn max;\n\t}",
"GCD",
"{\n\t\tlong max = 1;\n\t\tint min = Math.min(Math.min(a, b),c);\n\t\tfor (long i = 2; i <= min; i++) {\n\t\t\tif (a%i==0&&b%i==0&&c%i==0) max=i;\n\t\t} \n\t\treturn max;\n\t}",
"long max = 1;",
"max",
"1",
"int min = Math.min(Math.min(a, b),c);",
"min",
"Math.min(Math.min(a, b),c)",
"Math.min",
"Math",
"Math.min(a, b)",
"Math.min",
"Math",
"a",
"b",
"c",
"for (long i = 2; i <= min; i++) {\n\t\t\tif (a%i==0&&b%i==0&&c%i==0) max=i;\n\t\t}",
"long i = 2;",
"long i = 2;",
"i",
"2",
"i <= min",
"i",
"min",
"i++",
"i++",
"i",
"{\n\t\t\tif (a%i==0&&b%i==0&&c%i==0) max=i;\n\t\t}",
"{\n\t\t\tif (a%i==0&&b%i==0&&c%i==0) max=i;\n\t\t}",
"if (a%i==0&&b%i==0&&c%i==0) max=i;",
"a%i==0&&b%i==0&&c%i==0",
"a%i==0&&b%i==0&&c%i==0",
"a%i==0",
"a%i",
"a",
"i",
"0",
"b%i==0",
"b%i",
"b",
"i",
"0",
"c%i==0",
"c%i",
"c",
"i",
"0",
"max=i",
"max",
"i",
"return max;",
"max",
"int a",
"a",
"int b",
"b",
"int c",
"c",
"public static boolean Prime(int n) {\n\t\tfor (int i = 2; i <= Math.sqrt(n); i++) {\n\t\t\tif (n%i==0) return false;\n\t\t}\n\t\treturn true;\n\t}",
"Prime",
"{\n\t\tfor (int i = 2; i <= Math.sqrt(n); i++) {\n\t\t\tif (n%i==0) return false;\n\t\t}\n\t\treturn true;\n\t}",
"for (int i = 2; i <= Math.sqrt(n); i++) {\n\t\t\tif (n%i==0) return false;\n\t\t}",
"int i = 2;",
"int i = 2;",
"i",
"2",
"i <= Math.sqrt(n)",
"i",
"Math.sqrt(n)",
"Math.sqrt",
"Math",
"n",
"i++",
"i++",
"i",
"{\n\t\t\tif (n%i==0) return false;\n\t\t}",
"{\n\t\t\tif (n%i==0) return false;\n\t\t}",
"if (n%i==0) return false;",
"n%i==0",
"n%i",
"n",
"i",
"0",
"return false;",
"false",
"return true;",
"true",
"int n",
"n",
"public class Main {\n\n\tpublic static void main(String[] args) {\n\t\tScanner input = new Scanner(System.in);\n\t\tint K = input.nextInt();\n\t\tlong sum = 0;\n\t\tfor (int i = 1; i <= K; i++) {\n\t\t\tsum+=i;\n\t\t}\n\t\tfor (int a = 1; a <= K; a++) {\n\t\t\tfor (int b = a+1; b <= K&& b!=a; b++) {\n\t\t\t\tsum+=GCD(a,b,b)*3;\n\t\t\t\tsum+=GCD(a,a,b)*3;\n\t\t\t\tfor (int c = b+1; c <= K && c!=a&&c!=b; c++){\n\t\t\t\t\tsum+=GCD(a,b,c)*6;\n\t\t\t\t} \n\t\t\t}\n\t\t}\n\t\tSystem.out.println(sum);\n\t}\n\tpublic static long GCD(int a, int b, int c) {\n\t\tlong max = 1;\n\t\tint min = Math.min(Math.min(a, b),c);\n\t\tfor (long i = 2; i <= min; i++) {\n\t\t\tif (a%i==0&&b%i==0&&c%i==0) max=i;\n\t\t} \n\t\treturn max;\n\t}\n\tpublic static boolean Prime(int n) {\n\t\tfor (int i = 2; i <= Math.sqrt(n); i++) {\n\t\t\tif (n%i==0) return false;\n\t\t}\n\t\treturn true;\n\t}\n}",
"public class Main {\n\n\tpublic static void main(String[] args) {\n\t\tScanner input = new Scanner(System.in);\n\t\tint K = input.nextInt();\n\t\tlong sum = 0;\n\t\tfor (int i = 1; i <= K; i++) {\n\t\t\tsum+=i;\n\t\t}\n\t\tfor (int a = 1; a <= K; a++) {\n\t\t\tfor (int b = a+1; b <= K&& b!=a; b++) {\n\t\t\t\tsum+=GCD(a,b,b)*3;\n\t\t\t\tsum+=GCD(a,a,b)*3;\n\t\t\t\tfor (int c = b+1; c <= K && c!=a&&c!=b; c++){\n\t\t\t\t\tsum+=GCD(a,b,c)*6;\n\t\t\t\t} \n\t\t\t}\n\t\t}\n\t\tSystem.out.println(sum);\n\t}\n\tpublic static long GCD(int a, int b, int c) {\n\t\tlong max = 1;\n\t\tint min = Math.min(Math.min(a, b),c);\n\t\tfor (long i = 2; i <= min; i++) {\n\t\t\tif (a%i==0&&b%i==0&&c%i==0) max=i;\n\t\t} \n\t\treturn max;\n\t}\n\tpublic static boolean Prime(int n) {\n\t\tfor (int i = 2; i <= Math.sqrt(n); i++) {\n\t\t\tif (n%i==0) return false;\n\t\t}\n\t\treturn true;\n\t}\n}",
"Main"
] |
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
int K = input.nextInt();
long sum = 0;
for (int i = 1; i <= K; i++) {
sum+=i;
}
for (int a = 1; a <= K; a++) {
for (int b = a+1; b <= K&& b!=a; b++) {
sum+=GCD(a,b,b)*3;
sum+=GCD(a,a,b)*3;
for (int c = b+1; c <= K && c!=a&&c!=b; c++){
sum+=GCD(a,b,c)*6;
}
}
}
System.out.println(sum);
}
public static long GCD(int a, int b, int c) {
long max = 1;
int min = Math.min(Math.min(a, b),c);
for (long i = 2; i <= min; i++) {
if (a%i==0&&b%i==0&&c%i==0) max=i;
}
return max;
}
public static boolean Prime(int n) {
for (int i = 2; i <= Math.sqrt(n); i++) {
if (n%i==0) return false;
}
return true;
}
}
|
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
4,
18,
13,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
41,
13,
4,
13,
13,
13,
13,
0,
13,
13,
4,
18,
18,
13,
13,
13,
23,
13,
12,
13,
30,
41,
13,
42,
2,
0,
13,
2,
13,
13,
17,
30,
0,
13,
13,
0,
13,
13,
29,
13,
23,
13,
23,
13,
12,
13,
30,
41,
13,
4,
13,
13,
13,
41,
13,
4,
13,
13,
13,
29,
13,
23,
13,
23,
13,
23,
13,
10,
6,
13
] |
[
[
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
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
8,
17
],
[
17,
18
],
[
18,
19
],
[
8,
20
],
[
20,
21
],
[
20,
22
],
[
8,
23
],
[
23,
24
],
[
24,
25
],
[
25,
26
],
[
25,
27
],
[
23,
28
],
[
28,
29
],
[
28,
30
],
[
23,
31
],
[
31,
32
],
[
32,
33
],
[
23,
34
],
[
35,
35
],
[
35,
36
],
[
36,
37
],
[
37,
38
],
[
38,
39
],
[
38,
40
],
[
36,
41
],
[
41,
42
],
[
41,
43
],
[
36,
44
],
[
44,
45
],
[
45,
46
],
[
36,
47
],
[
48,
48
],
[
48,
49
],
[
49,
50
],
[
50,
51
],
[
51,
52
],
[
51,
53
],
[
49,
54
],
[
54,
55
],
[
54,
56
],
[
49,
57
],
[
57,
58
],
[
58,
59
],
[
49,
60
],
[
61,
61
],
[
61,
62
],
[
62,
63
],
[
62,
64
],
[
64,
65
],
[
64,
66
],
[
64,
67
],
[
64,
68
],
[
61,
69
],
[
69,
70
],
[
69,
71
],
[
8,
72
],
[
72,
73
],
[
73,
74
],
[
74,
75
],
[
74,
76
],
[
72,
77
],
[
6,
78
],
[
78,
79
],
[
130,
80
],
[
80,
81
],
[
80,
82
],
[
82,
83
],
[
83,
84
],
[
82,
85
],
[
85,
86
],
[
86,
87
],
[
87,
88
],
[
87,
89
],
[
89,
90
],
[
89,
91
],
[
86,
92
],
[
85,
93
],
[
93,
94
],
[
94,
95
],
[
94,
96
],
[
93,
97
],
[
97,
98
],
[
97,
99
],
[
82,
100
],
[
100,
101
],
[
80,
102
],
[
102,
103
],
[
80,
104
],
[
104,
105
],
[
130,
106
],
[
106,
107
],
[
106,
108
],
[
108,
109
],
[
109,
110
],
[
109,
111
],
[
111,
112
],
[
111,
113
],
[
111,
114
],
[
108,
115
],
[
115,
116
],
[
115,
117
],
[
117,
118
],
[
117,
119
],
[
117,
120
],
[
108,
121
],
[
121,
122
],
[
106,
123
],
[
123,
124
],
[
106,
125
],
[
125,
126
],
[
106,
127
],
[
127,
128
],
[
0,
129
],
[
129,
130
],
[
129,
131
]
] |
[
"import java.util.Scanner;\n\npublic class Main {\n\n\tpublic static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\tint K = sc.nextInt();\n\t\tsc.close();\n\t\tint total = 0;\n\t\tfor(int a = 1; a <= K; a++) {\n\t\t\tfor(int b = 1; b <= K; b++) {\n\t\t\t\tfor(int c = 1; c <= K; c++) {\n\t\t\t\t\tint result = gcdThree(a , b, c);\n\t\t\t\t\ttotal += result;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(total);\n\t}\n\t\n\tstatic int gcd(int a, int b) {\n\t\tint temp;\n\t\twhile((temp = a % b) != 0) {\n\t\t\ta = b;\n\t\t\tb = temp;\n\t\t}\n\t\treturn b;\n\t}\n\t\n\tstatic int gcdThree(int a , int b, int c) {\n\t\tint gcdTwo = gcd(a, b);\n\t\tint result = gcd(gcdTwo , c);\n\t\treturn result;\n\t}\n\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n\n\tpublic static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\tint K = sc.nextInt();\n\t\tsc.close();\n\t\tint total = 0;\n\t\tfor(int a = 1; a <= K; a++) {\n\t\t\tfor(int b = 1; b <= K; b++) {\n\t\t\t\tfor(int c = 1; c <= K; c++) {\n\t\t\t\t\tint result = gcdThree(a , b, c);\n\t\t\t\t\ttotal += result;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(total);\n\t}\n\t\n\tstatic int gcd(int a, int b) {\n\t\tint temp;\n\t\twhile((temp = a % b) != 0) {\n\t\t\ta = b;\n\t\t\tb = temp;\n\t\t}\n\t\treturn b;\n\t}\n\t\n\tstatic int gcdThree(int a , int b, int c) {\n\t\tint gcdTwo = gcd(a, b);\n\t\tint result = gcd(gcdTwo , c);\n\t\treturn result;\n\t}\n\n}",
"Main",
"public static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\tint K = sc.nextInt();\n\t\tsc.close();\n\t\tint total = 0;\n\t\tfor(int a = 1; a <= K; a++) {\n\t\t\tfor(int b = 1; b <= K; b++) {\n\t\t\t\tfor(int c = 1; c <= K; c++) {\n\t\t\t\t\tint result = gcdThree(a , b, c);\n\t\t\t\t\ttotal += result;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(total);\n\t}",
"main",
"{\n\t\tScanner sc = new Scanner(System.in);\n\t\tint K = sc.nextInt();\n\t\tsc.close();\n\t\tint total = 0;\n\t\tfor(int a = 1; a <= K; a++) {\n\t\t\tfor(int b = 1; b <= K; b++) {\n\t\t\t\tfor(int c = 1; c <= K; c++) {\n\t\t\t\t\tint result = gcdThree(a , b, c);\n\t\t\t\t\ttotal += result;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(total);\n\t}",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"int K = sc.nextInt();",
"K",
"sc.nextInt()",
"sc.nextInt",
"sc",
"sc.close()",
"sc.close",
"sc",
"int total = 0;",
"total",
"0",
"for(int a = 1; a <= K; a++) {\n\t\t\tfor(int b = 1; b <= K; b++) {\n\t\t\t\tfor(int c = 1; c <= K; c++) {\n\t\t\t\t\tint result = gcdThree(a , b, c);\n\t\t\t\t\ttotal += result;\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"int a = 1;",
"int a = 1;",
"a",
"1",
"a <= K",
"a",
"K",
"a++",
"a++",
"a",
"{\n\t\t\tfor(int b = 1; b <= K; b++) {\n\t\t\t\tfor(int c = 1; c <= K; c++) {\n\t\t\t\t\tint result = gcdThree(a , b, c);\n\t\t\t\t\ttotal += result;\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"{\n\t\t\tfor(int b = 1; b <= K; b++) {\n\t\t\t\tfor(int c = 1; c <= K; c++) {\n\t\t\t\t\tint result = gcdThree(a , b, c);\n\t\t\t\t\ttotal += result;\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"for(int b = 1; b <= K; b++) {\n\t\t\t\tfor(int c = 1; c <= K; c++) {\n\t\t\t\t\tint result = gcdThree(a , b, c);\n\t\t\t\t\ttotal += result;\n\t\t\t\t}\n\t\t\t}",
"int b = 1;",
"int b = 1;",
"b",
"1",
"b <= K",
"b",
"K",
"b++",
"b++",
"b",
"{\n\t\t\t\tfor(int c = 1; c <= K; c++) {\n\t\t\t\t\tint result = gcdThree(a , b, c);\n\t\t\t\t\ttotal += result;\n\t\t\t\t}\n\t\t\t}",
"{\n\t\t\t\tfor(int c = 1; c <= K; c++) {\n\t\t\t\t\tint result = gcdThree(a , b, c);\n\t\t\t\t\ttotal += result;\n\t\t\t\t}\n\t\t\t}",
"for(int c = 1; c <= K; c++) {\n\t\t\t\t\tint result = gcdThree(a , b, c);\n\t\t\t\t\ttotal += result;\n\t\t\t\t}",
"int c = 1;",
"int c = 1;",
"c",
"1",
"c <= K",
"c",
"K",
"c++",
"c++",
"c",
"{\n\t\t\t\t\tint result = gcdThree(a , b, c);\n\t\t\t\t\ttotal += result;\n\t\t\t\t}",
"{\n\t\t\t\t\tint result = gcdThree(a , b, c);\n\t\t\t\t\ttotal += result;\n\t\t\t\t}",
"int result = gcdThree(a , b, c);",
"result",
"gcdThree(a , b, c)",
"gcdThree",
"a",
"b",
"c",
"total += result",
"total",
"result",
"System.out.println(total)",
"System.out.println",
"System.out",
"System",
"System.out",
"total",
"String[] args",
"args",
"static int gcd(int a, int b) {\n\t\tint temp;\n\t\twhile((temp = a % b) != 0) {\n\t\t\ta = b;\n\t\t\tb = temp;\n\t\t}\n\t\treturn b;\n\t}",
"gcd",
"{\n\t\tint temp;\n\t\twhile((temp = a % b) != 0) {\n\t\t\ta = b;\n\t\t\tb = temp;\n\t\t}\n\t\treturn b;\n\t}",
"int temp;",
"temp",
"while((temp = a % b) != 0) {\n\t\t\ta = b;\n\t\t\tb = temp;\n\t\t}",
"(temp = a % b) != 0",
"(temp = a % b)",
"temp",
"a % b",
"a",
"b",
"0",
"{\n\t\t\ta = b;\n\t\t\tb = temp;\n\t\t}",
"a = b",
"a",
"b",
"b = temp",
"b",
"temp",
"return b;",
"b",
"int a",
"a",
"int b",
"b",
"static int gcdThree(int a , int b, int c) {\n\t\tint gcdTwo = gcd(a, b);\n\t\tint result = gcd(gcdTwo , c);\n\t\treturn result;\n\t}",
"gcdThree",
"{\n\t\tint gcdTwo = gcd(a, b);\n\t\tint result = gcd(gcdTwo , c);\n\t\treturn result;\n\t}",
"int gcdTwo = gcd(a, b);",
"gcdTwo",
"gcd(a, b)",
"gcd",
"a",
"b",
"int result = gcd(gcdTwo , c);",
"result",
"gcd(gcdTwo , c)",
"gcd",
"gcdTwo",
"c",
"return result;",
"result",
"int a",
"a",
"int b",
"b",
"int c",
"c",
"public class Main {\n\n\tpublic static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\tint K = sc.nextInt();\n\t\tsc.close();\n\t\tint total = 0;\n\t\tfor(int a = 1; a <= K; a++) {\n\t\t\tfor(int b = 1; b <= K; b++) {\n\t\t\t\tfor(int c = 1; c <= K; c++) {\n\t\t\t\t\tint result = gcdThree(a , b, c);\n\t\t\t\t\ttotal += result;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(total);\n\t}\n\t\n\tstatic int gcd(int a, int b) {\n\t\tint temp;\n\t\twhile((temp = a % b) != 0) {\n\t\t\ta = b;\n\t\t\tb = temp;\n\t\t}\n\t\treturn b;\n\t}\n\t\n\tstatic int gcdThree(int a , int b, int c) {\n\t\tint gcdTwo = gcd(a, b);\n\t\tint result = gcd(gcdTwo , c);\n\t\treturn result;\n\t}\n\n}",
"public class Main {\n\n\tpublic static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\tint K = sc.nextInt();\n\t\tsc.close();\n\t\tint total = 0;\n\t\tfor(int a = 1; a <= K; a++) {\n\t\t\tfor(int b = 1; b <= K; b++) {\n\t\t\t\tfor(int c = 1; c <= K; c++) {\n\t\t\t\t\tint result = gcdThree(a , b, c);\n\t\t\t\t\ttotal += result;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(total);\n\t}\n\t\n\tstatic int gcd(int a, int b) {\n\t\tint temp;\n\t\twhile((temp = a % b) != 0) {\n\t\t\ta = b;\n\t\t\tb = temp;\n\t\t}\n\t\treturn b;\n\t}\n\t\n\tstatic int gcdThree(int a , int b, int c) {\n\t\tint gcdTwo = gcd(a, b);\n\t\tint result = gcd(gcdTwo , c);\n\t\treturn result;\n\t}\n\n}",
"Main"
] |
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int K = sc.nextInt();
sc.close();
int total = 0;
for(int a = 1; a <= K; a++) {
for(int b = 1; b <= K; b++) {
for(int c = 1; c <= K; c++) {
int result = gcdThree(a , b, c);
total += result;
}
}
}
System.out.println(total);
}
static int gcd(int a, int b) {
int temp;
while((temp = a % b) != 0) {
a = b;
b = temp;
}
return b;
}
static int gcdThree(int a , int b, int c) {
int gcdTwo = gcd(a, b);
int result = gcd(gcdTwo , c);
return result;
}
}
|
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
18,
13,
13,
41,
13,
18,
13,
13,
41,
13,
20,
41,
13,
20,
41,
13,
20,
4,
18,
13,
17,
13,
13,
4,
18,
13,
23,
13,
6,
13,
12,
13,
30,
41,
13,
4,
18,
13,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
4,
13,
4,
13,
13,
13,
13,
4,
18,
13,
13,
23,
13,
23,
13,
23,
13,
12,
13,
30,
14,
2,
13,
13,
29,
4,
13,
13,
13,
14,
2,
13,
17,
29,
13,
29,
4,
13,
13,
2,
13,
13,
23,
13,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
10,
11
],
[
10,
12
],
[
0,
13
],
[
13,
14
],
[
13,
15
],
[
0,
16
],
[
152,
17
],
[
152,
18
],
[
18,
19
],
[
18,
20
],
[
20,
21
],
[
21,
22
],
[
21,
23
],
[
23,
24
],
[
23,
25
],
[
20,
26
],
[
26,
27
],
[
26,
28
],
[
28,
29
],
[
28,
30
],
[
20,
31
],
[
31,
32
],
[
31,
33
],
[
20,
34
],
[
34,
35
],
[
34,
36
],
[
20,
37
],
[
37,
38
],
[
37,
39
],
[
20,
40
],
[
40,
41
],
[
41,
42
],
[
40,
43
],
[
40,
44
],
[
40,
45
],
[
20,
46
],
[
46,
47
],
[
47,
48
],
[
18,
49
],
[
49,
50
],
[
152,
51
],
[
51,
52
],
[
51,
53
],
[
53,
54
],
[
53,
55
],
[
55,
56
],
[
56,
57
],
[
56,
58
],
[
58,
59
],
[
59,
60
],
[
55,
61
],
[
61,
62
],
[
61,
63
],
[
55,
64
],
[
64,
65
],
[
65,
66
],
[
66,
67
],
[
66,
68
],
[
64,
69
],
[
69,
70
],
[
69,
71
],
[
64,
72
],
[
72,
73
],
[
73,
74
],
[
64,
75
],
[
76,
76
],
[
76,
77
],
[
77,
78
],
[
78,
79
],
[
79,
80
],
[
79,
81
],
[
77,
82
],
[
82,
83
],
[
82,
84
],
[
77,
85
],
[
85,
86
],
[
86,
87
],
[
77,
88
],
[
89,
89
],
[
89,
90
],
[
90,
91
],
[
91,
92
],
[
92,
93
],
[
92,
94
],
[
90,
95
],
[
95,
96
],
[
95,
97
],
[
90,
98
],
[
98,
99
],
[
99,
100
],
[
90,
101
],
[
102,
102
],
[
102,
103
],
[
103,
104
],
[
103,
105
],
[
105,
106
],
[
105,
107
],
[
107,
108
],
[
107,
109
],
[
107,
110
],
[
105,
111
],
[
55,
112
],
[
112,
113
],
[
113,
114
],
[
112,
115
],
[
53,
116
],
[
116,
117
],
[
53,
118
],
[
118,
119
],
[
53,
120
],
[
120,
121
],
[
51,
122
],
[
122,
123
],
[
122,
124
],
[
124,
125
],
[
125,
126
],
[
126,
127
],
[
126,
128
],
[
125,
129
],
[
129,
130
],
[
130,
131
],
[
130,
132
],
[
130,
133
],
[
124,
134
],
[
134,
135
],
[
135,
136
],
[
135,
137
],
[
134,
138
],
[
138,
139
],
[
124,
140
],
[
140,
141
],
[
141,
142
],
[
141,
143
],
[
141,
144
],
[
144,
145
],
[
144,
146
],
[
122,
147
],
[
147,
148
],
[
122,
149
],
[
149,
150
],
[
0,
151
],
[
151,
152
],
[
151,
153
]
] |
[
"import java.io.OutputStream;\nimport java.io.IOException;\nimport java.io.InputStream;\nimport java.io.PrintWriter;\nimport java.util.Scanner;\n\n/**\n * Built using CHelper plug-in\n * Actual solution is at the top\n */\npublic class Main {\n public static void main(String[] args) {\n InputStream inputStream = System.in;\n OutputStream outputStream = System.out;\n Scanner in = new Scanner(inputStream);\n PrintWriter out = new PrintWriter(outputStream);\n abc162_c solver = new abc162_c();\n solver.solve(1, in, out);\n out.close();\n }\n\n static class abc162_c {\n public void solve(int testNumber, Scanner in, PrintWriter out) {\n int K = in.nextInt();\n long ans = 0;\n for (int a = 1; a <= K; a++) {\n for (int b = 1; b <= K; b++) {\n for (int c = 1; c <= K; c++) {\n ans += gcd(gcd(a, b), c);\n }\n }\n\n }\n out.println(ans);\n }\n\n private long gcd(long m, long n) {\n if (m < n) return gcd(n, m);\n if (n == 0) return m;\n return gcd(n, m % n);\n }\n\n }\n}\n",
"import java.io.OutputStream;",
"OutputStream",
"java.io",
"import java.io.IOException;",
"IOException",
"java.io",
"import java.io.InputStream;",
"InputStream",
"java.io",
"import java.io.PrintWriter;",
"PrintWriter",
"java.io",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n public static void main(String[] args) {\n InputStream inputStream = System.in;\n OutputStream outputStream = System.out;\n Scanner in = new Scanner(inputStream);\n PrintWriter out = new PrintWriter(outputStream);\n abc162_c solver = new abc162_c();\n solver.solve(1, in, out);\n out.close();\n }\n\n static class abc162_c {\n public void solve(int testNumber, Scanner in, PrintWriter out) {\n int K = in.nextInt();\n long ans = 0;\n for (int a = 1; a <= K; a++) {\n for (int b = 1; b <= K; b++) {\n for (int c = 1; c <= K; c++) {\n ans += gcd(gcd(a, b), c);\n }\n }\n\n }\n out.println(ans);\n }\n\n private long gcd(long m, long n) {\n if (m < n) return gcd(n, m);\n if (n == 0) return m;\n return gcd(n, m % n);\n }\n\n }\n}",
"Main",
"public static void main(String[] args) {\n InputStream inputStream = System.in;\n OutputStream outputStream = System.out;\n Scanner in = new Scanner(inputStream);\n PrintWriter out = new PrintWriter(outputStream);\n abc162_c solver = new abc162_c();\n solver.solve(1, in, out);\n out.close();\n }",
"main",
"{\n InputStream inputStream = System.in;\n OutputStream outputStream = System.out;\n Scanner in = new Scanner(inputStream);\n PrintWriter out = new PrintWriter(outputStream);\n abc162_c solver = new abc162_c();\n solver.solve(1, in, out);\n out.close();\n }",
"InputStream inputStream = System.in;",
"inputStream",
"System.in",
"System",
"System.in",
"OutputStream outputStream = System.out;",
"outputStream",
"System.out",
"System",
"System.out",
"Scanner in = new Scanner(inputStream);",
"in",
"new Scanner(inputStream)",
"PrintWriter out = new PrintWriter(outputStream);",
"out",
"new PrintWriter(outputStream)",
"abc162_c solver = new abc162_c();",
"solver",
"new abc162_c()",
"solver.solve(1, in, out)",
"solver.solve",
"solver",
"1",
"in",
"out",
"out.close()",
"out.close",
"out",
"String[] args",
"args",
"static class abc162_c {\n public void solve(int testNumber, Scanner in, PrintWriter out) {\n int K = in.nextInt();\n long ans = 0;\n for (int a = 1; a <= K; a++) {\n for (int b = 1; b <= K; b++) {\n for (int c = 1; c <= K; c++) {\n ans += gcd(gcd(a, b), c);\n }\n }\n\n }\n out.println(ans);\n }\n\n private long gcd(long m, long n) {\n if (m < n) return gcd(n, m);\n if (n == 0) return m;\n return gcd(n, m % n);\n }\n\n }",
"abc162_c",
"public void solve(int testNumber, Scanner in, PrintWriter out) {\n int K = in.nextInt();\n long ans = 0;\n for (int a = 1; a <= K; a++) {\n for (int b = 1; b <= K; b++) {\n for (int c = 1; c <= K; c++) {\n ans += gcd(gcd(a, b), c);\n }\n }\n\n }\n out.println(ans);\n }",
"solve",
"{\n int K = in.nextInt();\n long ans = 0;\n for (int a = 1; a <= K; a++) {\n for (int b = 1; b <= K; b++) {\n for (int c = 1; c <= K; c++) {\n ans += gcd(gcd(a, b), c);\n }\n }\n\n }\n out.println(ans);\n }",
"int K = in.nextInt();",
"K",
"in.nextInt()",
"in.nextInt",
"in",
"long ans = 0;",
"ans",
"0",
"for (int a = 1; a <= K; a++) {\n for (int b = 1; b <= K; b++) {\n for (int c = 1; c <= K; c++) {\n ans += gcd(gcd(a, b), c);\n }\n }\n\n }",
"int a = 1;",
"int a = 1;",
"a",
"1",
"a <= K",
"a",
"K",
"a++",
"a++",
"a",
"{\n for (int b = 1; b <= K; b++) {\n for (int c = 1; c <= K; c++) {\n ans += gcd(gcd(a, b), c);\n }\n }\n\n }",
"{\n for (int b = 1; b <= K; b++) {\n for (int c = 1; c <= K; c++) {\n ans += gcd(gcd(a, b), c);\n }\n }\n\n }",
"for (int b = 1; b <= K; b++) {\n for (int c = 1; c <= K; c++) {\n ans += gcd(gcd(a, b), c);\n }\n }",
"int b = 1;",
"int b = 1;",
"b",
"1",
"b <= K",
"b",
"K",
"b++",
"b++",
"b",
"{\n for (int c = 1; c <= K; c++) {\n ans += gcd(gcd(a, b), c);\n }\n }",
"{\n for (int c = 1; c <= K; c++) {\n ans += gcd(gcd(a, b), c);\n }\n }",
"for (int c = 1; c <= K; c++) {\n ans += gcd(gcd(a, b), c);\n }",
"int c = 1;",
"int c = 1;",
"c",
"1",
"c <= K",
"c",
"K",
"c++",
"c++",
"c",
"{\n ans += gcd(gcd(a, b), c);\n }",
"{\n ans += gcd(gcd(a, b), c);\n }",
"ans += gcd(gcd(a, b), c)",
"ans",
"gcd(gcd(a, b), c)",
"gcd",
"gcd(a, b)",
"gcd",
"a",
"b",
"c",
"out.println(ans)",
"out.println",
"out",
"ans",
"int testNumber",
"testNumber",
"Scanner in",
"in",
"PrintWriter out",
"out",
"private long gcd(long m, long n) {\n if (m < n) return gcd(n, m);\n if (n == 0) return m;\n return gcd(n, m % n);\n }",
"gcd",
"{\n if (m < n) return gcd(n, m);\n if (n == 0) return m;\n return gcd(n, m % n);\n }",
"if (m < n) return gcd(n, m);",
"m < n",
"m",
"n",
"return gcd(n, m);",
"gcd(n, m)",
"gcd",
"n",
"m",
"if (n == 0) return m;",
"n == 0",
"n",
"0",
"return m;",
"m",
"return gcd(n, m % n);",
"gcd(n, m % n)",
"gcd",
"n",
"m % n",
"m",
"n",
"long m",
"m",
"long n",
"n",
"public class Main {\n public static void main(String[] args) {\n InputStream inputStream = System.in;\n OutputStream outputStream = System.out;\n Scanner in = new Scanner(inputStream);\n PrintWriter out = new PrintWriter(outputStream);\n abc162_c solver = new abc162_c();\n solver.solve(1, in, out);\n out.close();\n }\n\n static class abc162_c {\n public void solve(int testNumber, Scanner in, PrintWriter out) {\n int K = in.nextInt();\n long ans = 0;\n for (int a = 1; a <= K; a++) {\n for (int b = 1; b <= K; b++) {\n for (int c = 1; c <= K; c++) {\n ans += gcd(gcd(a, b), c);\n }\n }\n\n }\n out.println(ans);\n }\n\n private long gcd(long m, long n) {\n if (m < n) return gcd(n, m);\n if (n == 0) return m;\n return gcd(n, m % n);\n }\n\n }\n}",
"public class Main {\n public static void main(String[] args) {\n InputStream inputStream = System.in;\n OutputStream outputStream = System.out;\n Scanner in = new Scanner(inputStream);\n PrintWriter out = new PrintWriter(outputStream);\n abc162_c solver = new abc162_c();\n solver.solve(1, in, out);\n out.close();\n }\n\n static class abc162_c {\n public void solve(int testNumber, Scanner in, PrintWriter out) {\n int K = in.nextInt();\n long ans = 0;\n for (int a = 1; a <= K; a++) {\n for (int b = 1; b <= K; b++) {\n for (int c = 1; c <= K; c++) {\n ans += gcd(gcd(a, b), c);\n }\n }\n\n }\n out.println(ans);\n }\n\n private long gcd(long m, long n) {\n if (m < n) return gcd(n, m);\n if (n == 0) return m;\n return gcd(n, m % n);\n }\n\n }\n}",
"Main"
] |
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Scanner;
/**
* Built using CHelper plug-in
* Actual solution is at the top
*/
public class Main {
public static void main(String[] args) {
InputStream inputStream = System.in;
OutputStream outputStream = System.out;
Scanner in = new Scanner(inputStream);
PrintWriter out = new PrintWriter(outputStream);
abc162_c solver = new abc162_c();
solver.solve(1, in, out);
out.close();
}
static class abc162_c {
public void solve(int testNumber, Scanner in, PrintWriter out) {
int K = in.nextInt();
long ans = 0;
for (int a = 1; a <= K; a++) {
for (int b = 1; b <= K; b++) {
for (int c = 1; c <= K; c++) {
ans += gcd(gcd(a, b), c);
}
}
}
out.println(ans);
}
private long gcd(long m, long n) {
if (m < n) return gcd(n, m);
if (n == 0) return m;
return gcd(n, m % n);
}
}
}
|
[
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,
20,
41,
13,
4,
18,
13,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
4,
13,
13,
4,
13,
13,
13,
4,
18,
13,
13,
4,
18,
13,
23,
13,
12,
13,
30,
11,
1,
41,
13,
17,
2,
13,
18,
13,
13,
1,
40,
13,
30,
0,
18,
13,
13,
13,
23,
13,
23,
13,
12,
13,
30,
11,
1,
41,
13,
17,
2,
13,
18,
13,
13,
1,
40,
13,
30,
0,
18,
13,
13,
13,
23,
13,
23,
13,
6,
13,
41,
13,
41,
13,
12,
13,
30,
0,
13,
20,
23,
13,
12,
13,
30,
0,
13,
20,
23,
13,
12,
13,
30,
42,
2,
2,
13,
17,
40,
4,
18,
13,
0,
13,
20,
29,
4,
18,
13,
12,
13,
30,
41,
13,
20,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
0,
18,
13,
13,
4,
13,
29,
13,
23,
13,
12,
13,
30,
41,
13,
20,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
0,
18,
13,
13,
4,
13,
29,
13,
23,
13,
12,
13,
30,
41,
13,
20,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
0,
18,
13,
13,
4,
13,
4,
13,
13,
4,
18,
13,
13,
29,
13,
23,
13,
12,
13,
30,
41,
13,
20,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
0,
18,
13,
13,
4,
13,
4,
13,
13,
4,
18,
13,
13,
29,
13,
23,
13,
12,
13,
30,
11,
1,
41,
13,
17,
2,
13,
18,
13,
13,
1,
40,
13,
30,
30,
41,
13,
2,
4,
18,
13,
18,
13,
13,
41,
13,
18,
13,
13,
0,
18,
13,
13,
18,
13,
13,
0,
18,
13,
13,
13,
23,
13,
12,
13,
30,
11,
1,
41,
13,
17,
2,
13,
18,
13,
13,
1,
40,
13,
30,
30,
41,
13,
2,
4,
18,
13,
18,
13,
13,
41,
13,
18,
13,
13,
0,
18,
13,
13,
18,
13,
13,
0,
18,
13,
13,
13,
23,
13,
12,
13,
30,
41,
13,
20,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
0,
18,
13,
13,
4,
13,
29,
13,
23,
13,
12,
13,
30,
41,
13,
20,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
0,
18,
13,
13,
4,
13,
29,
13,
23,
13,
12,
13,
30,
29,
4,
18,
13,
12,
13,
30,
29,
4,
18,
13,
4,
13,
12,
13,
30,
29,
4,
18,
13,
4,
13,
12,
13,
30,
29,
4,
18,
4,
13,
17,
12,
13,
30,
29,
4,
18,
13,
4,
13,
12,
13,
30,
29,
4,
18,
13,
12,
13,
30,
4,
18,
13,
17,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
533,
8
],
[
533,
9
],
[
9,
10
],
[
9,
11
],
[
11,
12
],
[
12,
13
],
[
13,
14
],
[
14,
15
],
[
14,
16
],
[
13,
17
],
[
13,
18
],
[
18,
19
],
[
18,
20
],
[
18,
21
],
[
21,
22
],
[
21,
23
],
[
9,
24
],
[
24,
25
],
[
9,
26
],
[
26,
27
],
[
533,
28
],
[
28,
29
],
[
28,
30
],
[
30,
31
],
[
31,
32
],
[
31,
33
],
[
30,
34
],
[
34,
35
],
[
34,
36
],
[
30,
37
],
[
37,
38
],
[
37,
39
],
[
39,
40
],
[
40,
41
],
[
30,
42
],
[
42,
43
],
[
42,
44
],
[
30,
45
],
[
45,
46
],
[
46,
47
],
[
47,
48
],
[
47,
49
],
[
45,
50
],
[
50,
51
],
[
50,
52
],
[
45,
53
],
[
53,
54
],
[
54,
55
],
[
45,
56
],
[
57,
57
],
[
57,
58
],
[
58,
59
],
[
59,
60
],
[
60,
61
],
[
60,
62
],
[
58,
63
],
[
63,
64
],
[
63,
65
],
[
58,
66
],
[
66,
67
],
[
67,
68
],
[
58,
69
],
[
70,
70
],
[
70,
71
],
[
71,
72
],
[
72,
73
],
[
73,
74
],
[
73,
75
],
[
71,
76
],
[
76,
77
],
[
76,
78
],
[
71,
79
],
[
79,
80
],
[
80,
81
],
[
71,
82
],
[
83,
83
],
[
83,
84
],
[
84,
85
],
[
84,
86
],
[
86,
87
],
[
86,
88
],
[
86,
89
],
[
89,
90
],
[
89,
91
],
[
89,
92
],
[
30,
93
],
[
93,
94
],
[
94,
95
],
[
93,
96
],
[
30,
97
],
[
97,
98
],
[
98,
99
],
[
28,
100
],
[
100,
101
],
[
533,
102
],
[
102,
103
],
[
102,
104
],
[
104,
105
],
[
105,
106
],
[
106,
107
],
[
107,
108
],
[
107,
109
],
[
105,
110
],
[
110,
111
],
[
110,
112
],
[
112,
113
],
[
112,
114
],
[
105,
115
],
[
115,
116
],
[
116,
117
],
[
105,
118
],
[
118,
119
],
[
119,
120
],
[
120,
121
],
[
120,
122
],
[
119,
123
],
[
102,
124
],
[
124,
125
],
[
102,
126
],
[
126,
127
],
[
533,
128
],
[
128,
129
],
[
128,
130
],
[
130,
131
],
[
131,
132
],
[
132,
133
],
[
133,
134
],
[
133,
135
],
[
131,
136
],
[
136,
137
],
[
136,
138
],
[
138,
139
],
[
138,
140
],
[
131,
141
],
[
141,
142
],
[
142,
143
],
[
131,
144
],
[
144,
145
],
[
145,
146
],
[
146,
147
],
[
146,
148
],
[
145,
149
],
[
128,
150
],
[
150,
151
],
[
128,
152
],
[
152,
153
],
[
533,
154
],
[
154,
155
],
[
154,
156
],
[
156,
157
],
[
154,
158
],
[
158,
159
],
[
154,
160
],
[
160,
161
],
[
160,
162
],
[
162,
163
],
[
163,
164
],
[
163,
165
],
[
160,
166
],
[
166,
167
],
[
154,
168
],
[
168,
169
],
[
168,
170
],
[
170,
171
],
[
171,
172
],
[
171,
173
],
[
168,
174
],
[
174,
175
],
[
154,
176
],
[
176,
177
],
[
176,
178
],
[
178,
179
],
[
179,
180
],
[
180,
181
],
[
181,
182
],
[
181,
183
],
[
180,
184
],
[
184,
185
],
[
185,
186
],
[
186,
187
],
[
179,
188
],
[
188,
189
],
[
188,
190
],
[
178,
191
],
[
191,
192
],
[
192,
193
],
[
193,
194
],
[
154,
195
],
[
195,
196
],
[
195,
197
],
[
197,
198
],
[
198,
199
],
[
198,
200
],
[
197,
202
],
[
202,
203
],
[
203,
204
],
[
204,
205
],
[
204,
206
],
[
202,
207
],
[
207,
208
],
[
207,
209
],
[
202,
210
],
[
210,
211
],
[
211,
212
],
[
202,
213
],
[
213,
214
],
[
214,
215
],
[
215,
216
],
[
215,
217
],
[
214,
218
],
[
218,
219
],
[
197,
220
],
[
220,
221
],
[
195,
222
],
[
222,
223
],
[
154,
224
],
[
224,
225
],
[
224,
226
],
[
226,
227
],
[
227,
228
],
[
227,
229
],
[
226,
231
],
[
231,
232
],
[
232,
233
],
[
233,
234
],
[
233,
235
],
[
231,
236
],
[
236,
237
],
[
236,
238
],
[
231,
239
],
[
239,
240
],
[
240,
241
],
[
231,
242
],
[
242,
243
],
[
243,
244
],
[
244,
245
],
[
244,
246
],
[
243,
247
],
[
247,
248
],
[
226,
249
],
[
249,
250
],
[
224,
251
],
[
251,
252
],
[
154,
253
],
[
253,
254
],
[
253,
255
],
[
255,
256
],
[
256,
257
],
[
256,
258
],
[
255,
260
],
[
260,
261
],
[
261,
262
],
[
262,
263
],
[
262,
264
],
[
260,
265
],
[
265,
266
],
[
265,
267
],
[
260,
268
],
[
268,
269
],
[
269,
270
],
[
260,
271
],
[
271,
272
],
[
272,
273
],
[
273,
274
],
[
273,
275
],
[
272,
276
],
[
276,
277
],
[
255,
278
],
[
278,
279
],
[
278,
280
],
[
255,
281
],
[
281,
282
],
[
282,
283
],
[
281,
284
],
[
255,
285
],
[
285,
286
],
[
253,
287
],
[
287,
288
],
[
154,
289
],
[
289,
290
],
[
289,
291
],
[
291,
292
],
[
292,
293
],
[
292,
294
],
[
291,
296
],
[
296,
297
],
[
297,
298
],
[
298,
299
],
[
298,
300
],
[
296,
301
],
[
301,
302
],
[
301,
303
],
[
296,
304
],
[
304,
305
],
[
305,
306
],
[
296,
307
],
[
307,
308
],
[
308,
309
],
[
309,
310
],
[
309,
311
],
[
308,
312
],
[
312,
313
],
[
291,
314
],
[
314,
315
],
[
314,
316
],
[
291,
317
],
[
317,
318
],
[
318,
319
],
[
317,
320
],
[
291,
321
],
[
321,
322
],
[
289,
323
],
[
323,
324
],
[
154,
325
],
[
325,
326
],
[
325,
327
],
[
327,
328
],
[
328,
329
],
[
329,
330
],
[
330,
331
],
[
330,
332
],
[
328,
333
],
[
333,
334
],
[
333,
335
],
[
335,
336
],
[
335,
337
],
[
328,
338
],
[
338,
339
],
[
339,
340
],
[
328,
341
],
[
342,
342
],
[
342,
343
],
[
343,
344
],
[
343,
345
],
[
345,
346
],
[
346,
347
],
[
347,
348
],
[
345,
349
],
[
349,
350
],
[
349,
351
],
[
342,
352
],
[
352,
353
],
[
352,
354
],
[
354,
355
],
[
354,
356
],
[
342,
357
],
[
357,
358
],
[
358,
359
],
[
358,
360
],
[
357,
361
],
[
361,
362
],
[
361,
363
],
[
342,
364
],
[
364,
365
],
[
365,
366
],
[
365,
367
],
[
364,
368
],
[
325,
369
],
[
369,
370
],
[
154,
371
],
[
371,
372
],
[
371,
373
],
[
373,
374
],
[
374,
375
],
[
375,
376
],
[
376,
377
],
[
376,
378
],
[
374,
379
],
[
379,
380
],
[
379,
381
],
[
381,
382
],
[
381,
383
],
[
374,
384
],
[
384,
385
],
[
385,
386
],
[
374,
387
],
[
388,
388
],
[
388,
389
],
[
389,
390
],
[
389,
391
],
[
391,
392
],
[
392,
393
],
[
393,
394
],
[
391,
395
],
[
395,
396
],
[
395,
397
],
[
388,
398
],
[
398,
399
],
[
398,
400
],
[
400,
401
],
[
400,
402
],
[
388,
403
],
[
403,
404
],
[
404,
405
],
[
404,
406
],
[
403,
407
],
[
407,
408
],
[
407,
409
],
[
388,
410
],
[
410,
411
],
[
411,
412
],
[
411,
413
],
[
410,
414
],
[
371,
415
],
[
415,
416
],
[
154,
417
],
[
417,
418
],
[
417,
419
],
[
419,
420
],
[
420,
421
],
[
420,
422
],
[
419,
424
],
[
424,
425
],
[
425,
426
],
[
426,
427
],
[
426,
428
],
[
424,
429
],
[
429,
430
],
[
429,
431
],
[
424,
432
],
[
432,
433
],
[
433,
434
],
[
424,
435
],
[
435,
436
],
[
436,
437
],
[
437,
438
],
[
437,
439
],
[
436,
440
],
[
440,
441
],
[
419,
442
],
[
442,
443
],
[
417,
444
],
[
444,
445
],
[
154,
446
],
[
446,
447
],
[
446,
448
],
[
448,
449
],
[
449,
450
],
[
449,
451
],
[
448,
453
],
[
453,
454
],
[
454,
455
],
[
455,
456
],
[
455,
457
],
[
453,
458
],
[
458,
459
],
[
458,
460
],
[
453,
461
],
[
461,
462
],
[
462,
463
],
[
453,
464
],
[
464,
465
],
[
465,
466
],
[
466,
467
],
[
466,
468
],
[
465,
469
],
[
469,
470
],
[
448,
471
],
[
471,
472
],
[
446,
473
],
[
473,
474
],
[
154,
475
],
[
475,
476
],
[
475,
477
],
[
477,
478
],
[
478,
479
],
[
479,
480
],
[
480,
481
],
[
154,
482
],
[
482,
483
],
[
482,
484
],
[
484,
485
],
[
485,
486
],
[
486,
487
],
[
487,
488
],
[
486,
489
],
[
489,
490
],
[
154,
491
],
[
491,
492
],
[
491,
493
],
[
493,
494
],
[
494,
495
],
[
495,
496
],
[
496,
497
],
[
495,
498
],
[
498,
499
],
[
154,
500
],
[
500,
501
],
[
500,
502
],
[
502,
503
],
[
503,
504
],
[
504,
505
],
[
505,
506
],
[
506,
507
],
[
504,
508
],
[
154,
509
],
[
509,
510
],
[
509,
511
],
[
511,
512
],
[
512,
513
],
[
513,
514
],
[
514,
515
],
[
513,
516
],
[
516,
517
],
[
154,
518
],
[
518,
519
],
[
518,
520
],
[
520,
521
],
[
521,
522
],
[
522,
523
],
[
523,
524
],
[
154,
525
],
[
525,
526
],
[
525,
527
],
[
527,
528
],
[
528,
529
],
[
529,
530
],
[
528,
531
],
[
0,
532
],
[
532,
533
],
[
532,
534
]
] |
[
"import java.io.*;\nimport java.util.*;\n\npublic class Main{\n\tstatic 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) throws Exception{\n\t\tPrintWriter pw=new PrintWriter(System.out);\n\t\tMScanner sc = new MScanner(System.in);\n\t\tint n=sc.nextInt();\n\t\tlong ans=0;\n\t\t\n\t\tfor(int i=1;i<=n;i++) {\n\t\t\tfor(int j=1;j<=n;j++) {\n\t\t\t\tfor(int k=1;k<=n;k++) {\n\t\t\t\t\tans+=gcd(i, gcd(j, k));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tpw.println(ans);\n\t\tpw.flush();\n\t}\n\tstatic class MScanner {\n\t\tStringTokenizer st;\n\t\tBufferedReader br;\n\t\tpublic MScanner(InputStream system) {\n\t\t\tbr = new BufferedReader(new InputStreamReader(system));\n\t\t}\n \n\t\tpublic MScanner(String file) throws Exception {\n\t\t\tbr = new BufferedReader(new FileReader(file));\n\t\t}\n \n\t\tpublic String next() throws IOException {\n\t\t\twhile (st == null || !st.hasMoreTokens())\n\t\t\t\tst = new StringTokenizer(br.readLine());\n\t\t\treturn st.nextToken();\n\t\t}\n\t\tpublic int[] intArr(int n) throws IOException {\n\t int[]in=new int[n];for(int i=0;i<n;i++)in[i]=nextInt();\n\t return in;\n\t\t}\n\t\tpublic long[] longArr(int n) throws IOException {\n\t long[]in=new long[n];for(int i=0;i<n;i++)in[i]=nextLong();\n\t return in;\n\t\t}\n\t\tpublic int[] intSortedArr(int n) throws IOException {\n\t int[]in=new int[n];for(int i=0;i<n;i++)in[i]=nextInt();\n\t shuffle(in);\n\t Arrays.sort(in);\n\t return in;\n\t\t}\n\t\tpublic long[] longSortedArr(int n) throws IOException {\n\t long[]in=new long[n];for(int i=0;i<n;i++)in[i]=nextLong();\n\t shuffle(in);\n\t Arrays.sort(in);\n\t return in;\n\t\t}\n\t\tstatic void shuffle(int[]in) {\n\t\t\tfor(int i=0;i<in.length;i++) {\n\t\t\t\tint idx=(int)(Math.random()*in.length);\n\t\t\t\tint tmp=in[i];\n\t\t\t\tin[i]=in[idx];\n\t\t\t\tin[idx]=tmp;\n\t\t\t}\n\t\t}\n\t\tstatic void shuffle(long[]in) {\n\t\t\tfor(int i=0;i<in.length;i++) {\n\t\t\t\tint idx=(int)(Math.random()*in.length);\n\t\t\t\tlong tmp=in[i];\n\t\t\t\tin[i]=in[idx];\n\t\t\t\tin[idx]=tmp;\n\t\t\t}\n\t\t}\n\t\tpublic Integer[] IntegerArr(int n) throws IOException {\n\t Integer[]in=new Integer[n];for(int i=0;i<n;i++)in[i]=nextInt();\n\t return in;\n\t\t}\n\t\tpublic Long[] LongArr(int n) throws IOException {\n\t Long[]in=new Long[n];for(int i=0;i<n;i++)in[i]=nextLong();\n\t return in;\n\t\t}\n\t\tpublic String nextLine() throws IOException {\n\t\t\treturn br.readLine();\n\t\t}\n \n\t\tpublic int nextInt() throws IOException {\n\t\t\treturn Integer.parseInt(next());\n\t\t}\n \n\t\tpublic double nextDouble() throws IOException {\n\t\t\treturn Double.parseDouble(next());\n\t\t}\n \n\t\tpublic char nextChar() throws IOException {\n\t\t\treturn next().charAt(0);\n\t\t}\n \n\t\tpublic long nextLong() throws IOException {\n\t\t\treturn Long.parseLong(next());\n\t\t}\n \n\t\tpublic boolean ready() throws IOException {\n\t\t\treturn br.ready();\n\t\t}\n \n\t\tpublic void waitForInput() throws InterruptedException {\n\t\t\tThread.sleep(3000);\n\t\t}\n\t}\n\tstatic void addX(int[]in,int x) {\n\t\tfor(int i=0;i<in.length;i++)in[i]+=x;\n\t}\n\tstatic void addX(long[]in,int x) {\n\t\tfor(int i=0;i<in.length;i++)in[i]+=x;\n\t}\n}",
"import java.io.*;",
"io.*",
"java",
"import java.util.*;",
"util.*",
"java",
"public class Main{\n\tstatic 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) throws Exception{\n\t\tPrintWriter pw=new PrintWriter(System.out);\n\t\tMScanner sc = new MScanner(System.in);\n\t\tint n=sc.nextInt();\n\t\tlong ans=0;\n\t\t\n\t\tfor(int i=1;i<=n;i++) {\n\t\t\tfor(int j=1;j<=n;j++) {\n\t\t\t\tfor(int k=1;k<=n;k++) {\n\t\t\t\t\tans+=gcd(i, gcd(j, k));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tpw.println(ans);\n\t\tpw.flush();\n\t}\n\tstatic class MScanner {\n\t\tStringTokenizer st;\n\t\tBufferedReader br;\n\t\tpublic MScanner(InputStream system) {\n\t\t\tbr = new BufferedReader(new InputStreamReader(system));\n\t\t}\n \n\t\tpublic MScanner(String file) throws Exception {\n\t\t\tbr = new BufferedReader(new FileReader(file));\n\t\t}\n \n\t\tpublic String next() throws IOException {\n\t\t\twhile (st == null || !st.hasMoreTokens())\n\t\t\t\tst = new StringTokenizer(br.readLine());\n\t\t\treturn st.nextToken();\n\t\t}\n\t\tpublic int[] intArr(int n) throws IOException {\n\t int[]in=new int[n];for(int i=0;i<n;i++)in[i]=nextInt();\n\t return in;\n\t\t}\n\t\tpublic long[] longArr(int n) throws IOException {\n\t long[]in=new long[n];for(int i=0;i<n;i++)in[i]=nextLong();\n\t return in;\n\t\t}\n\t\tpublic int[] intSortedArr(int n) throws IOException {\n\t int[]in=new int[n];for(int i=0;i<n;i++)in[i]=nextInt();\n\t shuffle(in);\n\t Arrays.sort(in);\n\t return in;\n\t\t}\n\t\tpublic long[] longSortedArr(int n) throws IOException {\n\t long[]in=new long[n];for(int i=0;i<n;i++)in[i]=nextLong();\n\t shuffle(in);\n\t Arrays.sort(in);\n\t return in;\n\t\t}\n\t\tstatic void shuffle(int[]in) {\n\t\t\tfor(int i=0;i<in.length;i++) {\n\t\t\t\tint idx=(int)(Math.random()*in.length);\n\t\t\t\tint tmp=in[i];\n\t\t\t\tin[i]=in[idx];\n\t\t\t\tin[idx]=tmp;\n\t\t\t}\n\t\t}\n\t\tstatic void shuffle(long[]in) {\n\t\t\tfor(int i=0;i<in.length;i++) {\n\t\t\t\tint idx=(int)(Math.random()*in.length);\n\t\t\t\tlong tmp=in[i];\n\t\t\t\tin[i]=in[idx];\n\t\t\t\tin[idx]=tmp;\n\t\t\t}\n\t\t}\n\t\tpublic Integer[] IntegerArr(int n) throws IOException {\n\t Integer[]in=new Integer[n];for(int i=0;i<n;i++)in[i]=nextInt();\n\t return in;\n\t\t}\n\t\tpublic Long[] LongArr(int n) throws IOException {\n\t Long[]in=new Long[n];for(int i=0;i<n;i++)in[i]=nextLong();\n\t return in;\n\t\t}\n\t\tpublic String nextLine() throws IOException {\n\t\t\treturn br.readLine();\n\t\t}\n \n\t\tpublic int nextInt() throws IOException {\n\t\t\treturn Integer.parseInt(next());\n\t\t}\n \n\t\tpublic double nextDouble() throws IOException {\n\t\t\treturn Double.parseDouble(next());\n\t\t}\n \n\t\tpublic char nextChar() throws IOException {\n\t\t\treturn next().charAt(0);\n\t\t}\n \n\t\tpublic long nextLong() throws IOException {\n\t\t\treturn Long.parseLong(next());\n\t\t}\n \n\t\tpublic boolean ready() throws IOException {\n\t\t\treturn br.ready();\n\t\t}\n \n\t\tpublic void waitForInput() throws InterruptedException {\n\t\t\tThread.sleep(3000);\n\t\t}\n\t}\n\tstatic void addX(int[]in,int x) {\n\t\tfor(int i=0;i<in.length;i++)in[i]+=x;\n\t}\n\tstatic void addX(long[]in,int x) {\n\t\tfor(int i=0;i<in.length;i++)in[i]+=x;\n\t}\n}",
"Main",
"static int gcd(int a,int b) {\n\t\treturn b==0?a:gcd(b, a%b);\n\t}",
"gcd",
"{\n\t\treturn b==0?a:gcd(b, a%b);\n\t}",
"return b==0?a:gcd(b, a%b);",
"b==0?a:gcd(b, a%b)",
"b==0",
"b",
"0",
"a",
"gcd(b, a%b)",
"gcd",
"b",
"a%b",
"a",
"b",
"int a",
"a",
"int b",
"b",
"public static void main(String[] args) throws Exception{\n\t\tPrintWriter pw=new PrintWriter(System.out);\n\t\tMScanner sc = new MScanner(System.in);\n\t\tint n=sc.nextInt();\n\t\tlong ans=0;\n\t\t\n\t\tfor(int i=1;i<=n;i++) {\n\t\t\tfor(int j=1;j<=n;j++) {\n\t\t\t\tfor(int k=1;k<=n;k++) {\n\t\t\t\t\tans+=gcd(i, gcd(j, k));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tpw.println(ans);\n\t\tpw.flush();\n\t}",
"main",
"{\n\t\tPrintWriter pw=new PrintWriter(System.out);\n\t\tMScanner sc = new MScanner(System.in);\n\t\tint n=sc.nextInt();\n\t\tlong ans=0;\n\t\t\n\t\tfor(int i=1;i<=n;i++) {\n\t\t\tfor(int j=1;j<=n;j++) {\n\t\t\t\tfor(int k=1;k<=n;k++) {\n\t\t\t\t\tans+=gcd(i, gcd(j, k));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tpw.println(ans);\n\t\tpw.flush();\n\t}",
"PrintWriter pw=new PrintWriter(System.out);",
"pw",
"new PrintWriter(System.out)",
"MScanner sc = new MScanner(System.in);",
"sc",
"new MScanner(System.in)",
"int n=sc.nextInt();",
"n",
"sc.nextInt()",
"sc.nextInt",
"sc",
"long ans=0;",
"ans",
"0",
"for(int i=1;i<=n;i++) {\n\t\t\tfor(int j=1;j<=n;j++) {\n\t\t\t\tfor(int k=1;k<=n;k++) {\n\t\t\t\t\tans+=gcd(i, gcd(j, k));\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"int i=1;",
"int i=1;",
"i",
"1",
"i<=n",
"i",
"n",
"i++",
"i++",
"i",
"{\n\t\t\tfor(int j=1;j<=n;j++) {\n\t\t\t\tfor(int k=1;k<=n;k++) {\n\t\t\t\t\tans+=gcd(i, gcd(j, k));\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"{\n\t\t\tfor(int j=1;j<=n;j++) {\n\t\t\t\tfor(int k=1;k<=n;k++) {\n\t\t\t\t\tans+=gcd(i, gcd(j, k));\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"for(int j=1;j<=n;j++) {\n\t\t\t\tfor(int k=1;k<=n;k++) {\n\t\t\t\t\tans+=gcd(i, gcd(j, k));\n\t\t\t\t}\n\t\t\t}",
"int j=1;",
"int j=1;",
"j",
"1",
"j<=n",
"j",
"n",
"j++",
"j++",
"j",
"{\n\t\t\t\tfor(int k=1;k<=n;k++) {\n\t\t\t\t\tans+=gcd(i, gcd(j, k));\n\t\t\t\t}\n\t\t\t}",
"{\n\t\t\t\tfor(int k=1;k<=n;k++) {\n\t\t\t\t\tans+=gcd(i, gcd(j, k));\n\t\t\t\t}\n\t\t\t}",
"for(int k=1;k<=n;k++) {\n\t\t\t\t\tans+=gcd(i, gcd(j, k));\n\t\t\t\t}",
"int k=1;",
"int k=1;",
"k",
"1",
"k<=n",
"k",
"n",
"k++",
"k++",
"k",
"{\n\t\t\t\t\tans+=gcd(i, gcd(j, k));\n\t\t\t\t}",
"{\n\t\t\t\t\tans+=gcd(i, gcd(j, k));\n\t\t\t\t}",
"ans+=gcd(i, gcd(j, k))",
"ans",
"gcd(i, gcd(j, k))",
"gcd",
"i",
"gcd(j, k)",
"gcd",
"j",
"k",
"pw.println(ans)",
"pw.println",
"pw",
"ans",
"pw.flush()",
"pw.flush",
"pw",
"String[] args",
"args",
"static void addX(int[]in,int x) {\n\t\tfor(int i=0;i<in.length;i++)in[i]+=x;\n\t}",
"addX",
"{\n\t\tfor(int i=0;i<in.length;i++)in[i]+=x;\n\t}",
"for(int i=0;i<in.length;i++)in[i]+=x;",
"int i=0;",
"int i=0;",
"i",
"0",
"i<in.length",
"i",
"in.length",
"in",
"in.length",
"i++",
"i++",
"i",
"in[i]+=x;",
"in[i]+=x",
"in[i]",
"in",
"i",
"x",
"int[]in",
"in",
"int x",
"x",
"static void addX(long[]in,int x) {\n\t\tfor(int i=0;i<in.length;i++)in[i]+=x;\n\t}",
"addX",
"{\n\t\tfor(int i=0;i<in.length;i++)in[i]+=x;\n\t}",
"for(int i=0;i<in.length;i++)in[i]+=x;",
"int i=0;",
"int i=0;",
"i",
"0",
"i<in.length",
"i",
"in.length",
"in",
"in.length",
"i++",
"i++",
"i",
"in[i]+=x;",
"in[i]+=x",
"in[i]",
"in",
"i",
"x",
"long[]in",
"in",
"int x",
"x",
"static class MScanner {\n\t\tStringTokenizer st;\n\t\tBufferedReader br;\n\t\tpublic MScanner(InputStream system) {\n\t\t\tbr = new BufferedReader(new InputStreamReader(system));\n\t\t}\n \n\t\tpublic MScanner(String file) throws Exception {\n\t\t\tbr = new BufferedReader(new FileReader(file));\n\t\t}\n \n\t\tpublic String next() throws IOException {\n\t\t\twhile (st == null || !st.hasMoreTokens())\n\t\t\t\tst = new StringTokenizer(br.readLine());\n\t\t\treturn st.nextToken();\n\t\t}\n\t\tpublic int[] intArr(int n) throws IOException {\n\t int[]in=new int[n];for(int i=0;i<n;i++)in[i]=nextInt();\n\t return in;\n\t\t}\n\t\tpublic long[] longArr(int n) throws IOException {\n\t long[]in=new long[n];for(int i=0;i<n;i++)in[i]=nextLong();\n\t return in;\n\t\t}\n\t\tpublic int[] intSortedArr(int n) throws IOException {\n\t int[]in=new int[n];for(int i=0;i<n;i++)in[i]=nextInt();\n\t shuffle(in);\n\t Arrays.sort(in);\n\t return in;\n\t\t}\n\t\tpublic long[] longSortedArr(int n) throws IOException {\n\t long[]in=new long[n];for(int i=0;i<n;i++)in[i]=nextLong();\n\t shuffle(in);\n\t Arrays.sort(in);\n\t return in;\n\t\t}\n\t\tstatic void shuffle(int[]in) {\n\t\t\tfor(int i=0;i<in.length;i++) {\n\t\t\t\tint idx=(int)(Math.random()*in.length);\n\t\t\t\tint tmp=in[i];\n\t\t\t\tin[i]=in[idx];\n\t\t\t\tin[idx]=tmp;\n\t\t\t}\n\t\t}\n\t\tstatic void shuffle(long[]in) {\n\t\t\tfor(int i=0;i<in.length;i++) {\n\t\t\t\tint idx=(int)(Math.random()*in.length);\n\t\t\t\tlong tmp=in[i];\n\t\t\t\tin[i]=in[idx];\n\t\t\t\tin[idx]=tmp;\n\t\t\t}\n\t\t}\n\t\tpublic Integer[] IntegerArr(int n) throws IOException {\n\t Integer[]in=new Integer[n];for(int i=0;i<n;i++)in[i]=nextInt();\n\t return in;\n\t\t}\n\t\tpublic Long[] LongArr(int n) throws IOException {\n\t Long[]in=new Long[n];for(int i=0;i<n;i++)in[i]=nextLong();\n\t return in;\n\t\t}\n\t\tpublic String nextLine() throws IOException {\n\t\t\treturn br.readLine();\n\t\t}\n \n\t\tpublic int nextInt() throws IOException {\n\t\t\treturn Integer.parseInt(next());\n\t\t}\n \n\t\tpublic double nextDouble() throws IOException {\n\t\t\treturn Double.parseDouble(next());\n\t\t}\n \n\t\tpublic char nextChar() throws IOException {\n\t\t\treturn next().charAt(0);\n\t\t}\n \n\t\tpublic long nextLong() throws IOException {\n\t\t\treturn Long.parseLong(next());\n\t\t}\n \n\t\tpublic boolean ready() throws IOException {\n\t\t\treturn br.ready();\n\t\t}\n \n\t\tpublic void waitForInput() throws InterruptedException {\n\t\t\tThread.sleep(3000);\n\t\t}\n\t}",
"MScanner",
"StringTokenizer st;",
"st",
"BufferedReader br;",
"br",
"public MScanner(InputStream system) {\n\t\t\tbr = new BufferedReader(new InputStreamReader(system));\n\t\t}",
"MScanner",
"{\n\t\t\tbr = new BufferedReader(new InputStreamReader(system));\n\t\t}",
"br = new BufferedReader(new InputStreamReader(system))",
"br",
"new BufferedReader(new InputStreamReader(system))",
"InputStream system",
"system",
"public MScanner(String file) throws Exception {\n\t\t\tbr = new BufferedReader(new FileReader(file));\n\t\t}",
"MScanner",
"{\n\t\t\tbr = new BufferedReader(new FileReader(file));\n\t\t}",
"br = new BufferedReader(new FileReader(file))",
"br",
"new BufferedReader(new FileReader(file))",
"String file",
"file",
"public String next() throws IOException {\n\t\t\twhile (st == null || !st.hasMoreTokens())\n\t\t\t\tst = new StringTokenizer(br.readLine());\n\t\t\treturn st.nextToken();\n\t\t}",
"next",
"{\n\t\t\twhile (st == null || !st.hasMoreTokens())\n\t\t\t\tst = new StringTokenizer(br.readLine());\n\t\t\treturn st.nextToken();\n\t\t}",
"while (st == null || !st.hasMoreTokens())\n\t\t\t\tst = new StringTokenizer(br.readLine());",
"st == null || !st.hasMoreTokens()",
"st == null",
"st",
"null",
"!st.hasMoreTokens()",
"st.hasMoreTokens()",
"st.hasMoreTokens",
"st",
"st = new StringTokenizer(br.readLine())",
"st",
"new StringTokenizer(br.readLine())",
"return st.nextToken();",
"st.nextToken()",
"st.nextToken",
"st",
"public int[] intArr(int n) throws IOException {\n\t int[]in=new int[n];for(int i=0;i<n;i++)in[i]=nextInt();\n\t return in;\n\t\t}",
"intArr",
"{\n\t int[]in=new int[n];for(int i=0;i<n;i++)in[i]=nextInt();\n\t return in;\n\t\t}",
"int[]in=new int[n];",
"in",
"new int[n]",
"n",
"for(int i=0;i<n;i++)in[i]=nextInt();",
"int i=0;",
"int i=0;",
"i",
"0",
"i<n",
"i",
"n",
"i++",
"i++",
"i",
"in[i]=nextInt();",
"in[i]=nextInt()",
"in[i]",
"in",
"i",
"nextInt()",
"nextInt",
"return in;",
"in",
"int n",
"n",
"public long[] longArr(int n) throws IOException {\n\t long[]in=new long[n];for(int i=0;i<n;i++)in[i]=nextLong();\n\t return in;\n\t\t}",
"longArr",
"{\n\t long[]in=new long[n];for(int i=0;i<n;i++)in[i]=nextLong();\n\t return in;\n\t\t}",
"long[]in=new long[n];",
"in",
"new long[n]",
"n",
"for(int i=0;i<n;i++)in[i]=nextLong();",
"int i=0;",
"int i=0;",
"i",
"0",
"i<n",
"i",
"n",
"i++",
"i++",
"i",
"in[i]=nextLong();",
"in[i]=nextLong()",
"in[i]",
"in",
"i",
"nextLong()",
"nextLong",
"return in;",
"in",
"int n",
"n",
"public int[] intSortedArr(int n) throws IOException {\n\t int[]in=new int[n];for(int i=0;i<n;i++)in[i]=nextInt();\n\t shuffle(in);\n\t Arrays.sort(in);\n\t return in;\n\t\t}",
"intSortedArr",
"{\n\t int[]in=new int[n];for(int i=0;i<n;i++)in[i]=nextInt();\n\t shuffle(in);\n\t Arrays.sort(in);\n\t return in;\n\t\t}",
"int[]in=new int[n];",
"in",
"new int[n]",
"n",
"for(int i=0;i<n;i++)in[i]=nextInt();",
"int i=0;",
"int i=0;",
"i",
"0",
"i<n",
"i",
"n",
"i++",
"i++",
"i",
"in[i]=nextInt();",
"in[i]=nextInt()",
"in[i]",
"in",
"i",
"nextInt()",
"nextInt",
"shuffle(in)",
"shuffle",
"in",
"Arrays.sort(in)",
"Arrays.sort",
"Arrays",
"in",
"return in;",
"in",
"int n",
"n",
"public long[] longSortedArr(int n) throws IOException {\n\t long[]in=new long[n];for(int i=0;i<n;i++)in[i]=nextLong();\n\t shuffle(in);\n\t Arrays.sort(in);\n\t return in;\n\t\t}",
"longSortedArr",
"{\n\t long[]in=new long[n];for(int i=0;i<n;i++)in[i]=nextLong();\n\t shuffle(in);\n\t Arrays.sort(in);\n\t return in;\n\t\t}",
"long[]in=new long[n];",
"in",
"new long[n]",
"n",
"for(int i=0;i<n;i++)in[i]=nextLong();",
"int i=0;",
"int i=0;",
"i",
"0",
"i<n",
"i",
"n",
"i++",
"i++",
"i",
"in[i]=nextLong();",
"in[i]=nextLong()",
"in[i]",
"in",
"i",
"nextLong()",
"nextLong",
"shuffle(in)",
"shuffle",
"in",
"Arrays.sort(in)",
"Arrays.sort",
"Arrays",
"in",
"return in;",
"in",
"int n",
"n",
"static void shuffle(int[]in) {\n\t\t\tfor(int i=0;i<in.length;i++) {\n\t\t\t\tint idx=(int)(Math.random()*in.length);\n\t\t\t\tint tmp=in[i];\n\t\t\t\tin[i]=in[idx];\n\t\t\t\tin[idx]=tmp;\n\t\t\t}\n\t\t}",
"shuffle",
"{\n\t\t\tfor(int i=0;i<in.length;i++) {\n\t\t\t\tint idx=(int)(Math.random()*in.length);\n\t\t\t\tint tmp=in[i];\n\t\t\t\tin[i]=in[idx];\n\t\t\t\tin[idx]=tmp;\n\t\t\t}\n\t\t}",
"for(int i=0;i<in.length;i++) {\n\t\t\t\tint idx=(int)(Math.random()*in.length);\n\t\t\t\tint tmp=in[i];\n\t\t\t\tin[i]=in[idx];\n\t\t\t\tin[idx]=tmp;\n\t\t\t}",
"int i=0;",
"int i=0;",
"i",
"0",
"i<in.length",
"i",
"in.length",
"in",
"in.length",
"i++",
"i++",
"i",
"{\n\t\t\t\tint idx=(int)(Math.random()*in.length);\n\t\t\t\tint tmp=in[i];\n\t\t\t\tin[i]=in[idx];\n\t\t\t\tin[idx]=tmp;\n\t\t\t}",
"{\n\t\t\t\tint idx=(int)(Math.random()*in.length);\n\t\t\t\tint tmp=in[i];\n\t\t\t\tin[i]=in[idx];\n\t\t\t\tin[idx]=tmp;\n\t\t\t}",
"int idx=(int)(Math.random()*in.length);",
"idx",
"(int)(Math.random()*in.length)",
"Math.random()",
"Math.random",
"Math",
"in.length",
"in",
"in.length",
"int tmp=in[i];",
"tmp",
"in[i]",
"in",
"i",
"in[i]=in[idx]",
"in[i]",
"in",
"i",
"in[idx]",
"in",
"idx",
"in[idx]=tmp",
"in[idx]",
"in",
"idx",
"tmp",
"int[]in",
"in",
"static void shuffle(long[]in) {\n\t\t\tfor(int i=0;i<in.length;i++) {\n\t\t\t\tint idx=(int)(Math.random()*in.length);\n\t\t\t\tlong tmp=in[i];\n\t\t\t\tin[i]=in[idx];\n\t\t\t\tin[idx]=tmp;\n\t\t\t}\n\t\t}",
"shuffle",
"{\n\t\t\tfor(int i=0;i<in.length;i++) {\n\t\t\t\tint idx=(int)(Math.random()*in.length);\n\t\t\t\tlong tmp=in[i];\n\t\t\t\tin[i]=in[idx];\n\t\t\t\tin[idx]=tmp;\n\t\t\t}\n\t\t}",
"for(int i=0;i<in.length;i++) {\n\t\t\t\tint idx=(int)(Math.random()*in.length);\n\t\t\t\tlong tmp=in[i];\n\t\t\t\tin[i]=in[idx];\n\t\t\t\tin[idx]=tmp;\n\t\t\t}",
"int i=0;",
"int i=0;",
"i",
"0",
"i<in.length",
"i",
"in.length",
"in",
"in.length",
"i++",
"i++",
"i",
"{\n\t\t\t\tint idx=(int)(Math.random()*in.length);\n\t\t\t\tlong tmp=in[i];\n\t\t\t\tin[i]=in[idx];\n\t\t\t\tin[idx]=tmp;\n\t\t\t}",
"{\n\t\t\t\tint idx=(int)(Math.random()*in.length);\n\t\t\t\tlong tmp=in[i];\n\t\t\t\tin[i]=in[idx];\n\t\t\t\tin[idx]=tmp;\n\t\t\t}",
"int idx=(int)(Math.random()*in.length);",
"idx",
"(int)(Math.random()*in.length)",
"Math.random()",
"Math.random",
"Math",
"in.length",
"in",
"in.length",
"long tmp=in[i];",
"tmp",
"in[i]",
"in",
"i",
"in[i]=in[idx]",
"in[i]",
"in",
"i",
"in[idx]",
"in",
"idx",
"in[idx]=tmp",
"in[idx]",
"in",
"idx",
"tmp",
"long[]in",
"in",
"public Integer[] IntegerArr(int n) throws IOException {\n\t Integer[]in=new Integer[n];for(int i=0;i<n;i++)in[i]=nextInt();\n\t return in;\n\t\t}",
"IntegerArr",
"{\n\t Integer[]in=new Integer[n];for(int i=0;i<n;i++)in[i]=nextInt();\n\t return in;\n\t\t}",
"Integer[]in=new Integer[n];",
"in",
"new Integer[n]",
"n",
"for(int i=0;i<n;i++)in[i]=nextInt();",
"int i=0;",
"int i=0;",
"i",
"0",
"i<n",
"i",
"n",
"i++",
"i++",
"i",
"in[i]=nextInt();",
"in[i]=nextInt()",
"in[i]",
"in",
"i",
"nextInt()",
"nextInt",
"return in;",
"in",
"int n",
"n",
"public Long[] LongArr(int n) throws IOException {\n\t Long[]in=new Long[n];for(int i=0;i<n;i++)in[i]=nextLong();\n\t return in;\n\t\t}",
"LongArr",
"{\n\t Long[]in=new Long[n];for(int i=0;i<n;i++)in[i]=nextLong();\n\t return in;\n\t\t}",
"Long[]in=new Long[n];",
"in",
"new Long[n]",
"n",
"for(int i=0;i<n;i++)in[i]=nextLong();",
"int i=0;",
"int i=0;",
"i",
"0",
"i<n",
"i",
"n",
"i++",
"i++",
"i",
"in[i]=nextLong();",
"in[i]=nextLong()",
"in[i]",
"in",
"i",
"nextLong()",
"nextLong",
"return in;",
"in",
"int n",
"n",
"public String nextLine() throws IOException {\n\t\t\treturn br.readLine();\n\t\t}",
"nextLine",
"{\n\t\t\treturn br.readLine();\n\t\t}",
"return br.readLine();",
"br.readLine()",
"br.readLine",
"br",
"public int nextInt() throws IOException {\n\t\t\treturn Integer.parseInt(next());\n\t\t}",
"nextInt",
"{\n\t\t\treturn Integer.parseInt(next());\n\t\t}",
"return Integer.parseInt(next());",
"Integer.parseInt(next())",
"Integer.parseInt",
"Integer",
"next()",
"next",
"public double nextDouble() throws IOException {\n\t\t\treturn Double.parseDouble(next());\n\t\t}",
"nextDouble",
"{\n\t\t\treturn Double.parseDouble(next());\n\t\t}",
"return Double.parseDouble(next());",
"Double.parseDouble(next())",
"Double.parseDouble",
"Double",
"next()",
"next",
"public char nextChar() throws IOException {\n\t\t\treturn next().charAt(0);\n\t\t}",
"nextChar",
"{\n\t\t\treturn next().charAt(0);\n\t\t}",
"return next().charAt(0);",
"next().charAt(0)",
"next().charAt",
"next()",
"next",
"0",
"public long nextLong() throws IOException {\n\t\t\treturn Long.parseLong(next());\n\t\t}",
"nextLong",
"{\n\t\t\treturn Long.parseLong(next());\n\t\t}",
"return Long.parseLong(next());",
"Long.parseLong(next())",
"Long.parseLong",
"Long",
"next()",
"next",
"public boolean ready() throws IOException {\n\t\t\treturn br.ready();\n\t\t}",
"ready",
"{\n\t\t\treturn br.ready();\n\t\t}",
"return br.ready();",
"br.ready()",
"br.ready",
"br",
"public void waitForInput() throws InterruptedException {\n\t\t\tThread.sleep(3000);\n\t\t}",
"waitForInput",
"{\n\t\t\tThread.sleep(3000);\n\t\t}",
"Thread.sleep(3000)",
"Thread.sleep",
"Thread",
"3000",
"public class Main{\n\tstatic 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) throws Exception{\n\t\tPrintWriter pw=new PrintWriter(System.out);\n\t\tMScanner sc = new MScanner(System.in);\n\t\tint n=sc.nextInt();\n\t\tlong ans=0;\n\t\t\n\t\tfor(int i=1;i<=n;i++) {\n\t\t\tfor(int j=1;j<=n;j++) {\n\t\t\t\tfor(int k=1;k<=n;k++) {\n\t\t\t\t\tans+=gcd(i, gcd(j, k));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tpw.println(ans);\n\t\tpw.flush();\n\t}\n\tstatic class MScanner {\n\t\tStringTokenizer st;\n\t\tBufferedReader br;\n\t\tpublic MScanner(InputStream system) {\n\t\t\tbr = new BufferedReader(new InputStreamReader(system));\n\t\t}\n \n\t\tpublic MScanner(String file) throws Exception {\n\t\t\tbr = new BufferedReader(new FileReader(file));\n\t\t}\n \n\t\tpublic String next() throws IOException {\n\t\t\twhile (st == null || !st.hasMoreTokens())\n\t\t\t\tst = new StringTokenizer(br.readLine());\n\t\t\treturn st.nextToken();\n\t\t}\n\t\tpublic int[] intArr(int n) throws IOException {\n\t int[]in=new int[n];for(int i=0;i<n;i++)in[i]=nextInt();\n\t return in;\n\t\t}\n\t\tpublic long[] longArr(int n) throws IOException {\n\t long[]in=new long[n];for(int i=0;i<n;i++)in[i]=nextLong();\n\t return in;\n\t\t}\n\t\tpublic int[] intSortedArr(int n) throws IOException {\n\t int[]in=new int[n];for(int i=0;i<n;i++)in[i]=nextInt();\n\t shuffle(in);\n\t Arrays.sort(in);\n\t return in;\n\t\t}\n\t\tpublic long[] longSortedArr(int n) throws IOException {\n\t long[]in=new long[n];for(int i=0;i<n;i++)in[i]=nextLong();\n\t shuffle(in);\n\t Arrays.sort(in);\n\t return in;\n\t\t}\n\t\tstatic void shuffle(int[]in) {\n\t\t\tfor(int i=0;i<in.length;i++) {\n\t\t\t\tint idx=(int)(Math.random()*in.length);\n\t\t\t\tint tmp=in[i];\n\t\t\t\tin[i]=in[idx];\n\t\t\t\tin[idx]=tmp;\n\t\t\t}\n\t\t}\n\t\tstatic void shuffle(long[]in) {\n\t\t\tfor(int i=0;i<in.length;i++) {\n\t\t\t\tint idx=(int)(Math.random()*in.length);\n\t\t\t\tlong tmp=in[i];\n\t\t\t\tin[i]=in[idx];\n\t\t\t\tin[idx]=tmp;\n\t\t\t}\n\t\t}\n\t\tpublic Integer[] IntegerArr(int n) throws IOException {\n\t Integer[]in=new Integer[n];for(int i=0;i<n;i++)in[i]=nextInt();\n\t return in;\n\t\t}\n\t\tpublic Long[] LongArr(int n) throws IOException {\n\t Long[]in=new Long[n];for(int i=0;i<n;i++)in[i]=nextLong();\n\t return in;\n\t\t}\n\t\tpublic String nextLine() throws IOException {\n\t\t\treturn br.readLine();\n\t\t}\n \n\t\tpublic int nextInt() throws IOException {\n\t\t\treturn Integer.parseInt(next());\n\t\t}\n \n\t\tpublic double nextDouble() throws IOException {\n\t\t\treturn Double.parseDouble(next());\n\t\t}\n \n\t\tpublic char nextChar() throws IOException {\n\t\t\treturn next().charAt(0);\n\t\t}\n \n\t\tpublic long nextLong() throws IOException {\n\t\t\treturn Long.parseLong(next());\n\t\t}\n \n\t\tpublic boolean ready() throws IOException {\n\t\t\treturn br.ready();\n\t\t}\n \n\t\tpublic void waitForInput() throws InterruptedException {\n\t\t\tThread.sleep(3000);\n\t\t}\n\t}\n\tstatic void addX(int[]in,int x) {\n\t\tfor(int i=0;i<in.length;i++)in[i]+=x;\n\t}\n\tstatic void addX(long[]in,int x) {\n\t\tfor(int i=0;i<in.length;i++)in[i]+=x;\n\t}\n}",
"public class Main{\n\tstatic 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) throws Exception{\n\t\tPrintWriter pw=new PrintWriter(System.out);\n\t\tMScanner sc = new MScanner(System.in);\n\t\tint n=sc.nextInt();\n\t\tlong ans=0;\n\t\t\n\t\tfor(int i=1;i<=n;i++) {\n\t\t\tfor(int j=1;j<=n;j++) {\n\t\t\t\tfor(int k=1;k<=n;k++) {\n\t\t\t\t\tans+=gcd(i, gcd(j, k));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tpw.println(ans);\n\t\tpw.flush();\n\t}\n\tstatic class MScanner {\n\t\tStringTokenizer st;\n\t\tBufferedReader br;\n\t\tpublic MScanner(InputStream system) {\n\t\t\tbr = new BufferedReader(new InputStreamReader(system));\n\t\t}\n \n\t\tpublic MScanner(String file) throws Exception {\n\t\t\tbr = new BufferedReader(new FileReader(file));\n\t\t}\n \n\t\tpublic String next() throws IOException {\n\t\t\twhile (st == null || !st.hasMoreTokens())\n\t\t\t\tst = new StringTokenizer(br.readLine());\n\t\t\treturn st.nextToken();\n\t\t}\n\t\tpublic int[] intArr(int n) throws IOException {\n\t int[]in=new int[n];for(int i=0;i<n;i++)in[i]=nextInt();\n\t return in;\n\t\t}\n\t\tpublic long[] longArr(int n) throws IOException {\n\t long[]in=new long[n];for(int i=0;i<n;i++)in[i]=nextLong();\n\t return in;\n\t\t}\n\t\tpublic int[] intSortedArr(int n) throws IOException {\n\t int[]in=new int[n];for(int i=0;i<n;i++)in[i]=nextInt();\n\t shuffle(in);\n\t Arrays.sort(in);\n\t return in;\n\t\t}\n\t\tpublic long[] longSortedArr(int n) throws IOException {\n\t long[]in=new long[n];for(int i=0;i<n;i++)in[i]=nextLong();\n\t shuffle(in);\n\t Arrays.sort(in);\n\t return in;\n\t\t}\n\t\tstatic void shuffle(int[]in) {\n\t\t\tfor(int i=0;i<in.length;i++) {\n\t\t\t\tint idx=(int)(Math.random()*in.length);\n\t\t\t\tint tmp=in[i];\n\t\t\t\tin[i]=in[idx];\n\t\t\t\tin[idx]=tmp;\n\t\t\t}\n\t\t}\n\t\tstatic void shuffle(long[]in) {\n\t\t\tfor(int i=0;i<in.length;i++) {\n\t\t\t\tint idx=(int)(Math.random()*in.length);\n\t\t\t\tlong tmp=in[i];\n\t\t\t\tin[i]=in[idx];\n\t\t\t\tin[idx]=tmp;\n\t\t\t}\n\t\t}\n\t\tpublic Integer[] IntegerArr(int n) throws IOException {\n\t Integer[]in=new Integer[n];for(int i=0;i<n;i++)in[i]=nextInt();\n\t return in;\n\t\t}\n\t\tpublic Long[] LongArr(int n) throws IOException {\n\t Long[]in=new Long[n];for(int i=0;i<n;i++)in[i]=nextLong();\n\t return in;\n\t\t}\n\t\tpublic String nextLine() throws IOException {\n\t\t\treturn br.readLine();\n\t\t}\n \n\t\tpublic int nextInt() throws IOException {\n\t\t\treturn Integer.parseInt(next());\n\t\t}\n \n\t\tpublic double nextDouble() throws IOException {\n\t\t\treturn Double.parseDouble(next());\n\t\t}\n \n\t\tpublic char nextChar() throws IOException {\n\t\t\treturn next().charAt(0);\n\t\t}\n \n\t\tpublic long nextLong() throws IOException {\n\t\t\treturn Long.parseLong(next());\n\t\t}\n \n\t\tpublic boolean ready() throws IOException {\n\t\t\treturn br.ready();\n\t\t}\n \n\t\tpublic void waitForInput() throws InterruptedException {\n\t\t\tThread.sleep(3000);\n\t\t}\n\t}\n\tstatic void addX(int[]in,int x) {\n\t\tfor(int i=0;i<in.length;i++)in[i]+=x;\n\t}\n\tstatic void addX(long[]in,int x) {\n\t\tfor(int i=0;i<in.length;i++)in[i]+=x;\n\t}\n}",
"Main"
] |
import java.io.*;
import java.util.*;
public class Main{
static int gcd(int a,int b) {
return b==0?a:gcd(b, a%b);
}
public static void main(String[] args) throws Exception{
PrintWriter pw=new PrintWriter(System.out);
MScanner sc = new MScanner(System.in);
int n=sc.nextInt();
long ans=0;
for(int i=1;i<=n;i++) {
for(int j=1;j<=n;j++) {
for(int k=1;k<=n;k++) {
ans+=gcd(i, gcd(j, k));
}
}
}
pw.println(ans);
pw.flush();
}
static class MScanner {
StringTokenizer st;
BufferedReader br;
public MScanner(InputStream system) {
br = new BufferedReader(new InputStreamReader(system));
}
public MScanner(String file) throws Exception {
br = new BufferedReader(new FileReader(file));
}
public String next() throws IOException {
while (st == null || !st.hasMoreTokens())
st = new StringTokenizer(br.readLine());
return st.nextToken();
}
public int[] intArr(int n) throws IOException {
int[]in=new int[n];for(int i=0;i<n;i++)in[i]=nextInt();
return in;
}
public long[] longArr(int n) throws IOException {
long[]in=new long[n];for(int i=0;i<n;i++)in[i]=nextLong();
return in;
}
public int[] intSortedArr(int n) throws IOException {
int[]in=new int[n];for(int i=0;i<n;i++)in[i]=nextInt();
shuffle(in);
Arrays.sort(in);
return in;
}
public long[] longSortedArr(int n) throws IOException {
long[]in=new long[n];for(int i=0;i<n;i++)in[i]=nextLong();
shuffle(in);
Arrays.sort(in);
return in;
}
static void shuffle(int[]in) {
for(int i=0;i<in.length;i++) {
int idx=(int)(Math.random()*in.length);
int tmp=in[i];
in[i]=in[idx];
in[idx]=tmp;
}
}
static void shuffle(long[]in) {
for(int i=0;i<in.length;i++) {
int idx=(int)(Math.random()*in.length);
long tmp=in[i];
in[i]=in[idx];
in[idx]=tmp;
}
}
public Integer[] IntegerArr(int n) throws IOException {
Integer[]in=new Integer[n];for(int i=0;i<n;i++)in[i]=nextInt();
return in;
}
public Long[] LongArr(int n) throws IOException {
Long[]in=new Long[n];for(int i=0;i<n;i++)in[i]=nextLong();
return in;
}
public String nextLine() throws IOException {
return br.readLine();
}
public int nextInt() throws IOException {
return Integer.parseInt(next());
}
public double nextDouble() throws IOException {
return Double.parseDouble(next());
}
public char nextChar() throws IOException {
return next().charAt(0);
}
public long nextLong() throws IOException {
return Long.parseLong(next());
}
public boolean ready() throws IOException {
return br.ready();
}
public void waitForInput() throws InterruptedException {
Thread.sleep(3000);
}
}
static void addX(int[]in,int x) {
for(int i=0;i<in.length;i++)in[i]+=x;
}
static void addX(long[]in,int x) {
for(int i=0;i<in.length;i++)in[i]+=x;
}
}
|
[
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,
41,
13,
4,
18,
13,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
4,
13,
4,
13,
13,
13,
13,
4,
18,
18,
13,
13,
13,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
97,
5
],
[
97,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
10,
11
],
[
10,
12
],
[
9,
13
],
[
13,
14
],
[
8,
15
],
[
15,
16
],
[
16,
17
],
[
16,
18
],
[
16,
19
],
[
19,
20
],
[
19,
21
],
[
6,
22
],
[
22,
23
],
[
6,
24
],
[
24,
25
],
[
97,
26
],
[
26,
27
],
[
26,
28
],
[
28,
29
],
[
29,
30
],
[
29,
31
],
[
28,
32
],
[
32,
33
],
[
32,
34
],
[
34,
35
],
[
35,
36
],
[
28,
37
],
[
37,
38
],
[
37,
39
],
[
28,
40
],
[
40,
41
],
[
41,
42
],
[
42,
43
],
[
42,
44
],
[
40,
45
],
[
45,
46
],
[
45,
47
],
[
40,
48
],
[
48,
49
],
[
49,
50
],
[
40,
51
],
[
52,
52
],
[
52,
53
],
[
53,
54
],
[
54,
55
],
[
55,
56
],
[
55,
57
],
[
53,
58
],
[
58,
59
],
[
58,
60
],
[
53,
61
],
[
61,
62
],
[
62,
63
],
[
53,
64
],
[
65,
65
],
[
65,
66
],
[
66,
67
],
[
67,
68
],
[
68,
69
],
[
68,
70
],
[
66,
71
],
[
71,
72
],
[
71,
73
],
[
66,
74
],
[
74,
75
],
[
75,
76
],
[
66,
77
],
[
78,
78
],
[
78,
79
],
[
79,
80
],
[
79,
81
],
[
81,
82
],
[
81,
83
],
[
83,
84
],
[
83,
85
],
[
83,
86
],
[
81,
87
],
[
28,
88
],
[
88,
89
],
[
89,
90
],
[
90,
91
],
[
90,
92
],
[
88,
93
],
[
26,
94
],
[
94,
95
],
[
0,
96
],
[
96,
97
],
[
96,
98
]
] |
[
"import java.util.*;\n\npublic class Main{\n static int gcd(int a,int b){\n if(b == 0) return a;\n return gcd(b,a%b);\n }\n public static void main(String[]args){\n Scanner sc = new Scanner(System.in);\n int k=sc.nextInt();\n int sum=0;\n for(int i=1;i<=k;i++){\n for(int j=1;j<=k;j++){\n for(int m=1;m<=k;m++){\n sum+=gcd(gcd(i,j),m);\n }\n }\n }\n System.out.println(sum);\n }\n}\n\n\n \n ",
"import java.util.*;",
"util.*",
"java",
"public class Main{\n static int gcd(int a,int b){\n if(b == 0) return a;\n return gcd(b,a%b);\n }\n public static void main(String[]args){\n Scanner sc = new Scanner(System.in);\n int k=sc.nextInt();\n int sum=0;\n for(int i=1;i<=k;i++){\n for(int j=1;j<=k;j++){\n for(int m=1;m<=k;m++){\n sum+=gcd(gcd(i,j),m);\n }\n }\n }\n System.out.println(sum);\n }\n}",
"Main",
"static int gcd(int a,int b){\n if(b == 0) return a;\n return gcd(b,a%b);\n }",
"gcd",
"{\n if(b == 0) return a;\n return gcd(b,a%b);\n }",
"if(b == 0) return a;",
"b == 0",
"b",
"0",
"return a;",
"a",
"return gcd(b,a%b);",
"gcd(b,a%b)",
"gcd",
"b",
"a%b",
"a",
"b",
"int a",
"a",
"int b",
"b",
"public static void main(String[]args){\n Scanner sc = new Scanner(System.in);\n int k=sc.nextInt();\n int sum=0;\n for(int i=1;i<=k;i++){\n for(int j=1;j<=k;j++){\n for(int m=1;m<=k;m++){\n sum+=gcd(gcd(i,j),m);\n }\n }\n }\n System.out.println(sum);\n }",
"main",
"{\n Scanner sc = new Scanner(System.in);\n int k=sc.nextInt();\n int sum=0;\n for(int i=1;i<=k;i++){\n for(int j=1;j<=k;j++){\n for(int m=1;m<=k;m++){\n sum+=gcd(gcd(i,j),m);\n }\n }\n }\n System.out.println(sum);\n }",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"int k=sc.nextInt();",
"k",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int sum=0;",
"sum",
"0",
"for(int i=1;i<=k;i++){\n for(int j=1;j<=k;j++){\n for(int m=1;m<=k;m++){\n sum+=gcd(gcd(i,j),m);\n }\n }\n }",
"int i=1;",
"int i=1;",
"i",
"1",
"i<=k",
"i",
"k",
"i++",
"i++",
"i",
"{\n for(int j=1;j<=k;j++){\n for(int m=1;m<=k;m++){\n sum+=gcd(gcd(i,j),m);\n }\n }\n }",
"{\n for(int j=1;j<=k;j++){\n for(int m=1;m<=k;m++){\n sum+=gcd(gcd(i,j),m);\n }\n }\n }",
"for(int j=1;j<=k;j++){\n for(int m=1;m<=k;m++){\n sum+=gcd(gcd(i,j),m);\n }\n }",
"int j=1;",
"int j=1;",
"j",
"1",
"j<=k",
"j",
"k",
"j++",
"j++",
"j",
"{\n for(int m=1;m<=k;m++){\n sum+=gcd(gcd(i,j),m);\n }\n }",
"{\n for(int m=1;m<=k;m++){\n sum+=gcd(gcd(i,j),m);\n }\n }",
"for(int m=1;m<=k;m++){\n sum+=gcd(gcd(i,j),m);\n }",
"int m=1;",
"int m=1;",
"m",
"1",
"m<=k",
"m",
"k",
"m++",
"m++",
"m",
"{\n sum+=gcd(gcd(i,j),m);\n }",
"{\n sum+=gcd(gcd(i,j),m);\n }",
"sum+=gcd(gcd(i,j),m)",
"sum",
"gcd(gcd(i,j),m)",
"gcd",
"gcd(i,j)",
"gcd",
"i",
"j",
"m",
"System.out.println(sum)",
"System.out.println",
"System.out",
"System",
"System.out",
"sum",
"String[]args",
"args",
"public class Main{\n static int gcd(int a,int b){\n if(b == 0) return a;\n return gcd(b,a%b);\n }\n public static void main(String[]args){\n Scanner sc = new Scanner(System.in);\n int k=sc.nextInt();\n int sum=0;\n for(int i=1;i<=k;i++){\n for(int j=1;j<=k;j++){\n for(int m=1;m<=k;m++){\n sum+=gcd(gcd(i,j),m);\n }\n }\n }\n System.out.println(sum);\n }\n}",
"public class Main{\n static int gcd(int a,int b){\n if(b == 0) return a;\n return gcd(b,a%b);\n }\n public static void main(String[]args){\n Scanner sc = new Scanner(System.in);\n int k=sc.nextInt();\n int sum=0;\n for(int i=1;i<=k;i++){\n for(int j=1;j<=k;j++){\n for(int m=1;m<=k;m++){\n sum+=gcd(gcd(i,j),m);\n }\n }\n }\n System.out.println(sum);\n }\n}",
"Main"
] |
import java.util.*;
public class Main{
static int gcd(int a,int b){
if(b == 0) return a;
return gcd(b,a%b);
}
public static void main(String[]args){
Scanner sc = new Scanner(System.in);
int k=sc.nextInt();
int sum=0;
for(int i=1;i<=k;i++){
for(int j=1;j<=k;j++){
for(int m=1;m<=k;m++){
sum+=gcd(gcd(i,j),m);
}
}
}
System.out.println(sum);
}
}
|
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
4,
18,
13,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
4,
13,
13,
13,
13,
4,
18,
18,
13,
13,
13,
23,
13,
12,
13,
30,
14,
2,
13,
13,
30,
14,
2,
13,
17,
30,
29,
13,
29,
4,
13,
13,
2,
13,
13,
30,
29,
4,
13,
13,
13,
23,
13,
23,
13,
12,
13,
30,
29,
4,
13,
13,
4,
13,
13,
13,
23,
13,
23,
13,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
127,
5
],
[
127,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
14,
17
],
[
17,
18
],
[
18,
19
],
[
8,
20
],
[
20,
21
],
[
20,
22
],
[
8,
23
],
[
23,
24
],
[
24,
25
],
[
25,
26
],
[
25,
27
],
[
23,
28
],
[
28,
29
],
[
28,
30
],
[
23,
31
],
[
31,
32
],
[
32,
33
],
[
23,
34
],
[
35,
35
],
[
35,
36
],
[
36,
37
],
[
37,
38
],
[
38,
39
],
[
38,
40
],
[
36,
41
],
[
41,
42
],
[
41,
43
],
[
36,
44
],
[
44,
45
],
[
45,
46
],
[
36,
47
],
[
48,
48
],
[
48,
49
],
[
49,
50
],
[
50,
51
],
[
51,
52
],
[
51,
53
],
[
49,
54
],
[
54,
55
],
[
54,
56
],
[
49,
57
],
[
57,
58
],
[
58,
59
],
[
49,
60
],
[
61,
61
],
[
61,
62
],
[
62,
63
],
[
62,
64
],
[
64,
65
],
[
64,
66
],
[
64,
67
],
[
64,
68
],
[
8,
69
],
[
69,
70
],
[
70,
71
],
[
71,
72
],
[
71,
73
],
[
69,
74
],
[
6,
75
],
[
75,
76
],
[
127,
77
],
[
77,
78
],
[
77,
79
],
[
79,
80
],
[
80,
81
],
[
81,
82
],
[
81,
83
],
[
80,
84
],
[
84,
85
],
[
85,
86
],
[
86,
87
],
[
86,
88
],
[
85,
89
],
[
89,
90
],
[
90,
91
],
[
84,
92
],
[
92,
93
],
[
93,
94
],
[
93,
95
],
[
93,
96
],
[
96,
97
],
[
96,
98
],
[
80,
99
],
[
99,
100
],
[
100,
101
],
[
101,
102
],
[
101,
103
],
[
101,
104
],
[
77,
105
],
[
105,
106
],
[
77,
107
],
[
107,
108
],
[
127,
109
],
[
109,
110
],
[
109,
111
],
[
111,
112
],
[
112,
113
],
[
113,
114
],
[
113,
115
],
[
113,
116
],
[
116,
117
],
[
116,
118
],
[
116,
119
],
[
109,
120
],
[
120,
121
],
[
109,
122
],
[
122,
123
],
[
109,
124
],
[
124,
125
],
[
0,
126
],
[
126,
127
],
[
126,
128
]
] |
[
"import java.util.Scanner;\n\npublic class Main {\n public static void main(String[] args) {\n Scanner scanner = new Scanner(System.in);\n int K = Integer.parseInt(scanner.nextLine());\n long total = 0;\n for (int i = 1; i <= K; i++) {\n for (int j = 1; j <= K; j++) {\n for (int k = 1; k <= K; k++) {\n total += gcd(i, j, k);\n }\n }\n }\n System.out.println(total);\n }\n\n public static int gcd(int a, int b) {\n if (a >= b) {\n if (b == 0) {\n return a;\n }\n return gcd(b, a % b);\n } else {\n return gcd(b, a);\n }\n }\n\n public static int gcd(int a, int b, int c) {\n return gcd(a, gcd(b, c));\n }\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n public static void main(String[] args) {\n Scanner scanner = new Scanner(System.in);\n int K = Integer.parseInt(scanner.nextLine());\n long total = 0;\n for (int i = 1; i <= K; i++) {\n for (int j = 1; j <= K; j++) {\n for (int k = 1; k <= K; k++) {\n total += gcd(i, j, k);\n }\n }\n }\n System.out.println(total);\n }\n\n public static int gcd(int a, int b) {\n if (a >= b) {\n if (b == 0) {\n return a;\n }\n return gcd(b, a % b);\n } else {\n return gcd(b, a);\n }\n }\n\n public static int gcd(int a, int b, int c) {\n return gcd(a, gcd(b, c));\n }\n}",
"Main",
"public static void main(String[] args) {\n Scanner scanner = new Scanner(System.in);\n int K = Integer.parseInt(scanner.nextLine());\n long total = 0;\n for (int i = 1; i <= K; i++) {\n for (int j = 1; j <= K; j++) {\n for (int k = 1; k <= K; k++) {\n total += gcd(i, j, k);\n }\n }\n }\n System.out.println(total);\n }",
"main",
"{\n Scanner scanner = new Scanner(System.in);\n int K = Integer.parseInt(scanner.nextLine());\n long total = 0;\n for (int i = 1; i <= K; i++) {\n for (int j = 1; j <= K; j++) {\n for (int k = 1; k <= K; k++) {\n total += gcd(i, j, k);\n }\n }\n }\n System.out.println(total);\n }",
"Scanner scanner = new Scanner(System.in);",
"scanner",
"new Scanner(System.in)",
"int K = Integer.parseInt(scanner.nextLine());",
"K",
"Integer.parseInt(scanner.nextLine())",
"Integer.parseInt",
"Integer",
"scanner.nextLine()",
"scanner.nextLine",
"scanner",
"long total = 0;",
"total",
"0",
"for (int i = 1; i <= K; i++) {\n for (int j = 1; j <= K; j++) {\n for (int k = 1; k <= K; k++) {\n total += gcd(i, j, k);\n }\n }\n }",
"int i = 1;",
"int i = 1;",
"i",
"1",
"i <= K",
"i",
"K",
"i++",
"i++",
"i",
"{\n for (int j = 1; j <= K; j++) {\n for (int k = 1; k <= K; k++) {\n total += gcd(i, j, k);\n }\n }\n }",
"{\n for (int j = 1; j <= K; j++) {\n for (int k = 1; k <= K; k++) {\n total += gcd(i, j, k);\n }\n }\n }",
"for (int j = 1; j <= K; j++) {\n for (int k = 1; k <= K; k++) {\n total += gcd(i, j, k);\n }\n }",
"int j = 1;",
"int j = 1;",
"j",
"1",
"j <= K",
"j",
"K",
"j++",
"j++",
"j",
"{\n for (int k = 1; k <= K; k++) {\n total += gcd(i, j, k);\n }\n }",
"{\n for (int k = 1; k <= K; k++) {\n total += gcd(i, j, k);\n }\n }",
"for (int k = 1; k <= K; k++) {\n total += gcd(i, j, k);\n }",
"int k = 1;",
"int k = 1;",
"k",
"1",
"k <= K",
"k",
"K",
"k++",
"k++",
"k",
"{\n total += gcd(i, j, k);\n }",
"{\n total += gcd(i, j, k);\n }",
"total += gcd(i, j, k)",
"total",
"gcd(i, j, k)",
"gcd",
"i",
"j",
"k",
"System.out.println(total)",
"System.out.println",
"System.out",
"System",
"System.out",
"total",
"String[] args",
"args",
"public static int gcd(int a, int b) {\n if (a >= b) {\n if (b == 0) {\n return a;\n }\n return gcd(b, a % b);\n } else {\n return gcd(b, a);\n }\n }",
"gcd",
"{\n if (a >= b) {\n if (b == 0) {\n return a;\n }\n return gcd(b, a % b);\n } else {\n return gcd(b, a);\n }\n }",
"if (a >= b) {\n if (b == 0) {\n return a;\n }\n return gcd(b, a % b);\n } else {\n return gcd(b, a);\n }",
"a >= b",
"a",
"b",
"{\n if (b == 0) {\n return a;\n }\n return gcd(b, a % b);\n }",
"if (b == 0) {\n return a;\n }",
"b == 0",
"b",
"0",
"{\n return a;\n }",
"return a;",
"a",
"return gcd(b, a % b);",
"gcd(b, a % b)",
"gcd",
"b",
"a % b",
"a",
"b",
"{\n return gcd(b, a);\n }",
"return gcd(b, a);",
"gcd(b, a)",
"gcd",
"b",
"a",
"int a",
"a",
"int b",
"b",
"public static int gcd(int a, int b, int c) {\n return gcd(a, gcd(b, c));\n }",
"gcd",
"{\n return gcd(a, gcd(b, c));\n }",
"return gcd(a, gcd(b, c));",
"gcd(a, gcd(b, c))",
"gcd",
"a",
"gcd(b, c)",
"gcd",
"b",
"c",
"int a",
"a",
"int b",
"b",
"int c",
"c",
"public class Main {\n public static void main(String[] args) {\n Scanner scanner = new Scanner(System.in);\n int K = Integer.parseInt(scanner.nextLine());\n long total = 0;\n for (int i = 1; i <= K; i++) {\n for (int j = 1; j <= K; j++) {\n for (int k = 1; k <= K; k++) {\n total += gcd(i, j, k);\n }\n }\n }\n System.out.println(total);\n }\n\n public static int gcd(int a, int b) {\n if (a >= b) {\n if (b == 0) {\n return a;\n }\n return gcd(b, a % b);\n } else {\n return gcd(b, a);\n }\n }\n\n public static int gcd(int a, int b, int c) {\n return gcd(a, gcd(b, c));\n }\n}",
"public class Main {\n public static void main(String[] args) {\n Scanner scanner = new Scanner(System.in);\n int K = Integer.parseInt(scanner.nextLine());\n long total = 0;\n for (int i = 1; i <= K; i++) {\n for (int j = 1; j <= K; j++) {\n for (int k = 1; k <= K; k++) {\n total += gcd(i, j, k);\n }\n }\n }\n System.out.println(total);\n }\n\n public static int gcd(int a, int b) {\n if (a >= b) {\n if (b == 0) {\n return a;\n }\n return gcd(b, a % b);\n } else {\n return gcd(b, a);\n }\n }\n\n public static int gcd(int a, int b, int c) {\n return gcd(a, gcd(b, c));\n }\n}",
"Main"
] |
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
int K = Integer.parseInt(scanner.nextLine());
long total = 0;
for (int i = 1; i <= K; i++) {
for (int j = 1; j <= K; j++) {
for (int k = 1; k <= K; k++) {
total += gcd(i, j, k);
}
}
}
System.out.println(total);
}
public static int gcd(int a, int b) {
if (a >= b) {
if (b == 0) {
return a;
}
return gcd(b, a % b);
} else {
return gcd(b, a);
}
}
public static int gcd(int a, int b, int c) {
return gcd(a, gcd(b, c));
}
}
|
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
17,
41,
13,
17,
41,
13,
17,
41,
13,
41,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
14,
2,
13,
13,
30,
0,
13,
13,
0,
13,
13,
30,
0,
13,
13,
0,
13,
13,
42,
2,
0,
13,
2,
13,
13,
17,
30,
0,
13,
13,
0,
13,
13,
0,
13,
13,
14,
2,
13,
13,
30,
0,
13,
13,
0,
13,
13,
30,
0,
13,
13,
0,
13,
13,
42,
2,
0,
13,
2,
13,
13,
17,
30,
0,
13,
13,
0,
13,
13,
0,
13,
2,
13,
13,
4,
18,
18,
13,
13,
13,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
152,
5
],
[
152,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
8,
17
],
[
17,
18
],
[
17,
19
],
[
8,
20
],
[
20,
21
],
[
20,
22
],
[
8,
23
],
[
23,
24
],
[
23,
25
],
[
8,
26
],
[
26,
27
],
[
8,
28
],
[
28,
29
],
[
8,
30
],
[
30,
31
],
[
31,
32
],
[
32,
33
],
[
32,
34
],
[
30,
35
],
[
35,
36
],
[
35,
37
],
[
30,
38
],
[
38,
39
],
[
39,
40
],
[
30,
41
],
[
42,
42
],
[
42,
43
],
[
43,
44
],
[
44,
45
],
[
45,
46
],
[
45,
47
],
[
43,
48
],
[
48,
49
],
[
48,
50
],
[
43,
51
],
[
51,
52
],
[
52,
53
],
[
43,
54
],
[
55,
55
],
[
55,
56
],
[
56,
57
],
[
57,
58
],
[
58,
59
],
[
58,
60
],
[
56,
61
],
[
61,
62
],
[
61,
63
],
[
56,
64
],
[
64,
65
],
[
65,
66
],
[
56,
67
],
[
68,
68
],
[
68,
69
],
[
69,
70
],
[
70,
71
],
[
70,
72
],
[
69,
73
],
[
73,
74
],
[
74,
75
],
[
74,
76
],
[
73,
77
],
[
77,
78
],
[
77,
79
],
[
69,
80
],
[
80,
81
],
[
81,
82
],
[
81,
83
],
[
80,
84
],
[
84,
85
],
[
84,
86
],
[
68,
87
],
[
87,
88
],
[
88,
89
],
[
89,
90
],
[
89,
91
],
[
91,
92
],
[
91,
93
],
[
88,
94
],
[
87,
95
],
[
95,
96
],
[
96,
97
],
[
96,
98
],
[
95,
99
],
[
99,
100
],
[
99,
101
],
[
68,
102
],
[
102,
103
],
[
102,
104
],
[
68,
105
],
[
105,
106
],
[
106,
107
],
[
106,
108
],
[
105,
109
],
[
109,
110
],
[
110,
111
],
[
110,
112
],
[
109,
113
],
[
113,
114
],
[
113,
115
],
[
105,
116
],
[
116,
117
],
[
117,
118
],
[
117,
119
],
[
116,
120
],
[
120,
121
],
[
120,
122
],
[
68,
123
],
[
123,
124
],
[
124,
125
],
[
125,
126
],
[
125,
127
],
[
127,
128
],
[
127,
129
],
[
124,
130
],
[
123,
131
],
[
131,
132
],
[
132,
133
],
[
132,
134
],
[
131,
135
],
[
135,
136
],
[
135,
137
],
[
68,
138
],
[
138,
139
],
[
138,
140
],
[
140,
141
],
[
140,
142
],
[
8,
143
],
[
143,
144
],
[
144,
145
],
[
145,
146
],
[
145,
147
],
[
143,
148
],
[
6,
149
],
[
149,
150
],
[
0,
151
],
[
151,
152
],
[
151,
153
]
] |
[
"import java.util.Scanner;\n\npublic class Main {\n\tpublic static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\tint X = sc.nextInt();\n\t\tint ans = 0;\n\t\tint tmpRest = 0;\n\t\tint tmpMax = 0;\n\t\tint num1;\n\t\tint num2;\n\n\t\tfor (int c = 1; c <= X; c++) {\n\t\t\tfor (int d = 1; d <= X; d++) {\n\t\t\t\tfor (int e = 1; e <= X; e++) {\n\t\t\t\t\tif (c >= d) {\n\t\t\t\t\t\tnum1 = c;\n\t\t\t\t\t\tnum2 = d;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tnum1 = d;\n\t\t\t\t\t\tnum2 = c;\n\t\t\t\t\t}\n\t\t\t\t\twhile ((tmpRest = num1 % num2) != 0) {\n\t\t\t\t\t\tnum1 = num2;\n\t\t\t\t\t\tnum2 = tmpRest;\n\t\t\t\t\t}\n\t\t\t\t\ttmpMax = num2;\n\n\t\t\t\t\tif (tmpMax >= e) {\n\t\t\t\t\t\tnum1 = tmpMax;\n\t\t\t\t\t\tnum2 = e;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tnum1 = e;\n\t\t\t\t\t\tnum2 = tmpMax;\n\t\t\t\t\t}\n\t\t\t\t\twhile ((tmpRest = num1 % num2) != 0) {\n\t\t\t\t\t\tnum1 = num2;\n\t\t\t\t\t\tnum2 = tmpRest;\n\t\t\t\t\t}\n\t\t\t\t\tans = ans + num2;\n\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(ans);\n\t}\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n\tpublic static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\tint X = sc.nextInt();\n\t\tint ans = 0;\n\t\tint tmpRest = 0;\n\t\tint tmpMax = 0;\n\t\tint num1;\n\t\tint num2;\n\n\t\tfor (int c = 1; c <= X; c++) {\n\t\t\tfor (int d = 1; d <= X; d++) {\n\t\t\t\tfor (int e = 1; e <= X; e++) {\n\t\t\t\t\tif (c >= d) {\n\t\t\t\t\t\tnum1 = c;\n\t\t\t\t\t\tnum2 = d;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tnum1 = d;\n\t\t\t\t\t\tnum2 = c;\n\t\t\t\t\t}\n\t\t\t\t\twhile ((tmpRest = num1 % num2) != 0) {\n\t\t\t\t\t\tnum1 = num2;\n\t\t\t\t\t\tnum2 = tmpRest;\n\t\t\t\t\t}\n\t\t\t\t\ttmpMax = num2;\n\n\t\t\t\t\tif (tmpMax >= e) {\n\t\t\t\t\t\tnum1 = tmpMax;\n\t\t\t\t\t\tnum2 = e;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tnum1 = e;\n\t\t\t\t\t\tnum2 = tmpMax;\n\t\t\t\t\t}\n\t\t\t\t\twhile ((tmpRest = num1 % num2) != 0) {\n\t\t\t\t\t\tnum1 = num2;\n\t\t\t\t\t\tnum2 = tmpRest;\n\t\t\t\t\t}\n\t\t\t\t\tans = ans + num2;\n\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(ans);\n\t}\n}",
"Main",
"public static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\tint X = sc.nextInt();\n\t\tint ans = 0;\n\t\tint tmpRest = 0;\n\t\tint tmpMax = 0;\n\t\tint num1;\n\t\tint num2;\n\n\t\tfor (int c = 1; c <= X; c++) {\n\t\t\tfor (int d = 1; d <= X; d++) {\n\t\t\t\tfor (int e = 1; e <= X; e++) {\n\t\t\t\t\tif (c >= d) {\n\t\t\t\t\t\tnum1 = c;\n\t\t\t\t\t\tnum2 = d;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tnum1 = d;\n\t\t\t\t\t\tnum2 = c;\n\t\t\t\t\t}\n\t\t\t\t\twhile ((tmpRest = num1 % num2) != 0) {\n\t\t\t\t\t\tnum1 = num2;\n\t\t\t\t\t\tnum2 = tmpRest;\n\t\t\t\t\t}\n\t\t\t\t\ttmpMax = num2;\n\n\t\t\t\t\tif (tmpMax >= e) {\n\t\t\t\t\t\tnum1 = tmpMax;\n\t\t\t\t\t\tnum2 = e;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tnum1 = e;\n\t\t\t\t\t\tnum2 = tmpMax;\n\t\t\t\t\t}\n\t\t\t\t\twhile ((tmpRest = num1 % num2) != 0) {\n\t\t\t\t\t\tnum1 = num2;\n\t\t\t\t\t\tnum2 = tmpRest;\n\t\t\t\t\t}\n\t\t\t\t\tans = ans + num2;\n\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(ans);\n\t}",
"main",
"{\n\t\tScanner sc = new Scanner(System.in);\n\t\tint X = sc.nextInt();\n\t\tint ans = 0;\n\t\tint tmpRest = 0;\n\t\tint tmpMax = 0;\n\t\tint num1;\n\t\tint num2;\n\n\t\tfor (int c = 1; c <= X; c++) {\n\t\t\tfor (int d = 1; d <= X; d++) {\n\t\t\t\tfor (int e = 1; e <= X; e++) {\n\t\t\t\t\tif (c >= d) {\n\t\t\t\t\t\tnum1 = c;\n\t\t\t\t\t\tnum2 = d;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tnum1 = d;\n\t\t\t\t\t\tnum2 = c;\n\t\t\t\t\t}\n\t\t\t\t\twhile ((tmpRest = num1 % num2) != 0) {\n\t\t\t\t\t\tnum1 = num2;\n\t\t\t\t\t\tnum2 = tmpRest;\n\t\t\t\t\t}\n\t\t\t\t\ttmpMax = num2;\n\n\t\t\t\t\tif (tmpMax >= e) {\n\t\t\t\t\t\tnum1 = tmpMax;\n\t\t\t\t\t\tnum2 = e;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tnum1 = e;\n\t\t\t\t\t\tnum2 = tmpMax;\n\t\t\t\t\t}\n\t\t\t\t\twhile ((tmpRest = num1 % num2) != 0) {\n\t\t\t\t\t\tnum1 = num2;\n\t\t\t\t\t\tnum2 = tmpRest;\n\t\t\t\t\t}\n\t\t\t\t\tans = ans + num2;\n\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(ans);\n\t}",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"int X = sc.nextInt();",
"X",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int ans = 0;",
"ans",
"0",
"int tmpRest = 0;",
"tmpRest",
"0",
"int tmpMax = 0;",
"tmpMax",
"0",
"int num1;",
"num1",
"int num2;",
"num2",
"for (int c = 1; c <= X; c++) {\n\t\t\tfor (int d = 1; d <= X; d++) {\n\t\t\t\tfor (int e = 1; e <= X; e++) {\n\t\t\t\t\tif (c >= d) {\n\t\t\t\t\t\tnum1 = c;\n\t\t\t\t\t\tnum2 = d;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tnum1 = d;\n\t\t\t\t\t\tnum2 = c;\n\t\t\t\t\t}\n\t\t\t\t\twhile ((tmpRest = num1 % num2) != 0) {\n\t\t\t\t\t\tnum1 = num2;\n\t\t\t\t\t\tnum2 = tmpRest;\n\t\t\t\t\t}\n\t\t\t\t\ttmpMax = num2;\n\n\t\t\t\t\tif (tmpMax >= e) {\n\t\t\t\t\t\tnum1 = tmpMax;\n\t\t\t\t\t\tnum2 = e;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tnum1 = e;\n\t\t\t\t\t\tnum2 = tmpMax;\n\t\t\t\t\t}\n\t\t\t\t\twhile ((tmpRest = num1 % num2) != 0) {\n\t\t\t\t\t\tnum1 = num2;\n\t\t\t\t\t\tnum2 = tmpRest;\n\t\t\t\t\t}\n\t\t\t\t\tans = ans + num2;\n\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"int c = 1;",
"int c = 1;",
"c",
"1",
"c <= X",
"c",
"X",
"c++",
"c++",
"c",
"{\n\t\t\tfor (int d = 1; d <= X; d++) {\n\t\t\t\tfor (int e = 1; e <= X; e++) {\n\t\t\t\t\tif (c >= d) {\n\t\t\t\t\t\tnum1 = c;\n\t\t\t\t\t\tnum2 = d;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tnum1 = d;\n\t\t\t\t\t\tnum2 = c;\n\t\t\t\t\t}\n\t\t\t\t\twhile ((tmpRest = num1 % num2) != 0) {\n\t\t\t\t\t\tnum1 = num2;\n\t\t\t\t\t\tnum2 = tmpRest;\n\t\t\t\t\t}\n\t\t\t\t\ttmpMax = num2;\n\n\t\t\t\t\tif (tmpMax >= e) {\n\t\t\t\t\t\tnum1 = tmpMax;\n\t\t\t\t\t\tnum2 = e;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tnum1 = e;\n\t\t\t\t\t\tnum2 = tmpMax;\n\t\t\t\t\t}\n\t\t\t\t\twhile ((tmpRest = num1 % num2) != 0) {\n\t\t\t\t\t\tnum1 = num2;\n\t\t\t\t\t\tnum2 = tmpRest;\n\t\t\t\t\t}\n\t\t\t\t\tans = ans + num2;\n\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"{\n\t\t\tfor (int d = 1; d <= X; d++) {\n\t\t\t\tfor (int e = 1; e <= X; e++) {\n\t\t\t\t\tif (c >= d) {\n\t\t\t\t\t\tnum1 = c;\n\t\t\t\t\t\tnum2 = d;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tnum1 = d;\n\t\t\t\t\t\tnum2 = c;\n\t\t\t\t\t}\n\t\t\t\t\twhile ((tmpRest = num1 % num2) != 0) {\n\t\t\t\t\t\tnum1 = num2;\n\t\t\t\t\t\tnum2 = tmpRest;\n\t\t\t\t\t}\n\t\t\t\t\ttmpMax = num2;\n\n\t\t\t\t\tif (tmpMax >= e) {\n\t\t\t\t\t\tnum1 = tmpMax;\n\t\t\t\t\t\tnum2 = e;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tnum1 = e;\n\t\t\t\t\t\tnum2 = tmpMax;\n\t\t\t\t\t}\n\t\t\t\t\twhile ((tmpRest = num1 % num2) != 0) {\n\t\t\t\t\t\tnum1 = num2;\n\t\t\t\t\t\tnum2 = tmpRest;\n\t\t\t\t\t}\n\t\t\t\t\tans = ans + num2;\n\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"for (int d = 1; d <= X; d++) {\n\t\t\t\tfor (int e = 1; e <= X; e++) {\n\t\t\t\t\tif (c >= d) {\n\t\t\t\t\t\tnum1 = c;\n\t\t\t\t\t\tnum2 = d;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tnum1 = d;\n\t\t\t\t\t\tnum2 = c;\n\t\t\t\t\t}\n\t\t\t\t\twhile ((tmpRest = num1 % num2) != 0) {\n\t\t\t\t\t\tnum1 = num2;\n\t\t\t\t\t\tnum2 = tmpRest;\n\t\t\t\t\t}\n\t\t\t\t\ttmpMax = num2;\n\n\t\t\t\t\tif (tmpMax >= e) {\n\t\t\t\t\t\tnum1 = tmpMax;\n\t\t\t\t\t\tnum2 = e;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tnum1 = e;\n\t\t\t\t\t\tnum2 = tmpMax;\n\t\t\t\t\t}\n\t\t\t\t\twhile ((tmpRest = num1 % num2) != 0) {\n\t\t\t\t\t\tnum1 = num2;\n\t\t\t\t\t\tnum2 = tmpRest;\n\t\t\t\t\t}\n\t\t\t\t\tans = ans + num2;\n\n\t\t\t\t}\n\t\t\t}",
"int d = 1;",
"int d = 1;",
"d",
"1",
"d <= X",
"d",
"X",
"d++",
"d++",
"d",
"{\n\t\t\t\tfor (int e = 1; e <= X; e++) {\n\t\t\t\t\tif (c >= d) {\n\t\t\t\t\t\tnum1 = c;\n\t\t\t\t\t\tnum2 = d;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tnum1 = d;\n\t\t\t\t\t\tnum2 = c;\n\t\t\t\t\t}\n\t\t\t\t\twhile ((tmpRest = num1 % num2) != 0) {\n\t\t\t\t\t\tnum1 = num2;\n\t\t\t\t\t\tnum2 = tmpRest;\n\t\t\t\t\t}\n\t\t\t\t\ttmpMax = num2;\n\n\t\t\t\t\tif (tmpMax >= e) {\n\t\t\t\t\t\tnum1 = tmpMax;\n\t\t\t\t\t\tnum2 = e;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tnum1 = e;\n\t\t\t\t\t\tnum2 = tmpMax;\n\t\t\t\t\t}\n\t\t\t\t\twhile ((tmpRest = num1 % num2) != 0) {\n\t\t\t\t\t\tnum1 = num2;\n\t\t\t\t\t\tnum2 = tmpRest;\n\t\t\t\t\t}\n\t\t\t\t\tans = ans + num2;\n\n\t\t\t\t}\n\t\t\t}",
"{\n\t\t\t\tfor (int e = 1; e <= X; e++) {\n\t\t\t\t\tif (c >= d) {\n\t\t\t\t\t\tnum1 = c;\n\t\t\t\t\t\tnum2 = d;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tnum1 = d;\n\t\t\t\t\t\tnum2 = c;\n\t\t\t\t\t}\n\t\t\t\t\twhile ((tmpRest = num1 % num2) != 0) {\n\t\t\t\t\t\tnum1 = num2;\n\t\t\t\t\t\tnum2 = tmpRest;\n\t\t\t\t\t}\n\t\t\t\t\ttmpMax = num2;\n\n\t\t\t\t\tif (tmpMax >= e) {\n\t\t\t\t\t\tnum1 = tmpMax;\n\t\t\t\t\t\tnum2 = e;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tnum1 = e;\n\t\t\t\t\t\tnum2 = tmpMax;\n\t\t\t\t\t}\n\t\t\t\t\twhile ((tmpRest = num1 % num2) != 0) {\n\t\t\t\t\t\tnum1 = num2;\n\t\t\t\t\t\tnum2 = tmpRest;\n\t\t\t\t\t}\n\t\t\t\t\tans = ans + num2;\n\n\t\t\t\t}\n\t\t\t}",
"for (int e = 1; e <= X; e++) {\n\t\t\t\t\tif (c >= d) {\n\t\t\t\t\t\tnum1 = c;\n\t\t\t\t\t\tnum2 = d;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tnum1 = d;\n\t\t\t\t\t\tnum2 = c;\n\t\t\t\t\t}\n\t\t\t\t\twhile ((tmpRest = num1 % num2) != 0) {\n\t\t\t\t\t\tnum1 = num2;\n\t\t\t\t\t\tnum2 = tmpRest;\n\t\t\t\t\t}\n\t\t\t\t\ttmpMax = num2;\n\n\t\t\t\t\tif (tmpMax >= e) {\n\t\t\t\t\t\tnum1 = tmpMax;\n\t\t\t\t\t\tnum2 = e;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tnum1 = e;\n\t\t\t\t\t\tnum2 = tmpMax;\n\t\t\t\t\t}\n\t\t\t\t\twhile ((tmpRest = num1 % num2) != 0) {\n\t\t\t\t\t\tnum1 = num2;\n\t\t\t\t\t\tnum2 = tmpRest;\n\t\t\t\t\t}\n\t\t\t\t\tans = ans + num2;\n\n\t\t\t\t}",
"int e = 1;",
"int e = 1;",
"e",
"1",
"e <= X",
"e",
"X",
"e++",
"e++",
"e",
"{\n\t\t\t\t\tif (c >= d) {\n\t\t\t\t\t\tnum1 = c;\n\t\t\t\t\t\tnum2 = d;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tnum1 = d;\n\t\t\t\t\t\tnum2 = c;\n\t\t\t\t\t}\n\t\t\t\t\twhile ((tmpRest = num1 % num2) != 0) {\n\t\t\t\t\t\tnum1 = num2;\n\t\t\t\t\t\tnum2 = tmpRest;\n\t\t\t\t\t}\n\t\t\t\t\ttmpMax = num2;\n\n\t\t\t\t\tif (tmpMax >= e) {\n\t\t\t\t\t\tnum1 = tmpMax;\n\t\t\t\t\t\tnum2 = e;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tnum1 = e;\n\t\t\t\t\t\tnum2 = tmpMax;\n\t\t\t\t\t}\n\t\t\t\t\twhile ((tmpRest = num1 % num2) != 0) {\n\t\t\t\t\t\tnum1 = num2;\n\t\t\t\t\t\tnum2 = tmpRest;\n\t\t\t\t\t}\n\t\t\t\t\tans = ans + num2;\n\n\t\t\t\t}",
"{\n\t\t\t\t\tif (c >= d) {\n\t\t\t\t\t\tnum1 = c;\n\t\t\t\t\t\tnum2 = d;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tnum1 = d;\n\t\t\t\t\t\tnum2 = c;\n\t\t\t\t\t}\n\t\t\t\t\twhile ((tmpRest = num1 % num2) != 0) {\n\t\t\t\t\t\tnum1 = num2;\n\t\t\t\t\t\tnum2 = tmpRest;\n\t\t\t\t\t}\n\t\t\t\t\ttmpMax = num2;\n\n\t\t\t\t\tif (tmpMax >= e) {\n\t\t\t\t\t\tnum1 = tmpMax;\n\t\t\t\t\t\tnum2 = e;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tnum1 = e;\n\t\t\t\t\t\tnum2 = tmpMax;\n\t\t\t\t\t}\n\t\t\t\t\twhile ((tmpRest = num1 % num2) != 0) {\n\t\t\t\t\t\tnum1 = num2;\n\t\t\t\t\t\tnum2 = tmpRest;\n\t\t\t\t\t}\n\t\t\t\t\tans = ans + num2;\n\n\t\t\t\t}",
"if (c >= d) {\n\t\t\t\t\t\tnum1 = c;\n\t\t\t\t\t\tnum2 = d;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tnum1 = d;\n\t\t\t\t\t\tnum2 = c;\n\t\t\t\t\t}",
"c >= d",
"c",
"d",
"{\n\t\t\t\t\t\tnum1 = c;\n\t\t\t\t\t\tnum2 = d;\n\t\t\t\t\t}",
"num1 = c",
"num1",
"c",
"num2 = d",
"num2",
"d",
"{\n\t\t\t\t\t\tnum1 = d;\n\t\t\t\t\t\tnum2 = c;\n\t\t\t\t\t}",
"num1 = d",
"num1",
"d",
"num2 = c",
"num2",
"c",
"while ((tmpRest = num1 % num2) != 0) {\n\t\t\t\t\t\tnum1 = num2;\n\t\t\t\t\t\tnum2 = tmpRest;\n\t\t\t\t\t}",
"(tmpRest = num1 % num2) != 0",
"(tmpRest = num1 % num2)",
"tmpRest",
"num1 % num2",
"num1",
"num2",
"0",
"{\n\t\t\t\t\t\tnum1 = num2;\n\t\t\t\t\t\tnum2 = tmpRest;\n\t\t\t\t\t}",
"num1 = num2",
"num1",
"num2",
"num2 = tmpRest",
"num2",
"tmpRest",
"tmpMax = num2",
"tmpMax",
"num2",
"if (tmpMax >= e) {\n\t\t\t\t\t\tnum1 = tmpMax;\n\t\t\t\t\t\tnum2 = e;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tnum1 = e;\n\t\t\t\t\t\tnum2 = tmpMax;\n\t\t\t\t\t}",
"tmpMax >= e",
"tmpMax",
"e",
"{\n\t\t\t\t\t\tnum1 = tmpMax;\n\t\t\t\t\t\tnum2 = e;\n\t\t\t\t\t}",
"num1 = tmpMax",
"num1",
"tmpMax",
"num2 = e",
"num2",
"e",
"{\n\t\t\t\t\t\tnum1 = e;\n\t\t\t\t\t\tnum2 = tmpMax;\n\t\t\t\t\t}",
"num1 = e",
"num1",
"e",
"num2 = tmpMax",
"num2",
"tmpMax",
"while ((tmpRest = num1 % num2) != 0) {\n\t\t\t\t\t\tnum1 = num2;\n\t\t\t\t\t\tnum2 = tmpRest;\n\t\t\t\t\t}",
"(tmpRest = num1 % num2) != 0",
"(tmpRest = num1 % num2)",
"tmpRest",
"num1 % num2",
"num1",
"num2",
"0",
"{\n\t\t\t\t\t\tnum1 = num2;\n\t\t\t\t\t\tnum2 = tmpRest;\n\t\t\t\t\t}",
"num1 = num2",
"num1",
"num2",
"num2 = tmpRest",
"num2",
"tmpRest",
"ans = ans + num2",
"ans",
"ans + num2",
"ans",
"num2",
"System.out.println(ans)",
"System.out.println",
"System.out",
"System",
"System.out",
"ans",
"String[] args",
"args",
"public class Main {\n\tpublic static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\tint X = sc.nextInt();\n\t\tint ans = 0;\n\t\tint tmpRest = 0;\n\t\tint tmpMax = 0;\n\t\tint num1;\n\t\tint num2;\n\n\t\tfor (int c = 1; c <= X; c++) {\n\t\t\tfor (int d = 1; d <= X; d++) {\n\t\t\t\tfor (int e = 1; e <= X; e++) {\n\t\t\t\t\tif (c >= d) {\n\t\t\t\t\t\tnum1 = c;\n\t\t\t\t\t\tnum2 = d;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tnum1 = d;\n\t\t\t\t\t\tnum2 = c;\n\t\t\t\t\t}\n\t\t\t\t\twhile ((tmpRest = num1 % num2) != 0) {\n\t\t\t\t\t\tnum1 = num2;\n\t\t\t\t\t\tnum2 = tmpRest;\n\t\t\t\t\t}\n\t\t\t\t\ttmpMax = num2;\n\n\t\t\t\t\tif (tmpMax >= e) {\n\t\t\t\t\t\tnum1 = tmpMax;\n\t\t\t\t\t\tnum2 = e;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tnum1 = e;\n\t\t\t\t\t\tnum2 = tmpMax;\n\t\t\t\t\t}\n\t\t\t\t\twhile ((tmpRest = num1 % num2) != 0) {\n\t\t\t\t\t\tnum1 = num2;\n\t\t\t\t\t\tnum2 = tmpRest;\n\t\t\t\t\t}\n\t\t\t\t\tans = ans + num2;\n\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(ans);\n\t}\n}",
"public class Main {\n\tpublic static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\tint X = sc.nextInt();\n\t\tint ans = 0;\n\t\tint tmpRest = 0;\n\t\tint tmpMax = 0;\n\t\tint num1;\n\t\tint num2;\n\n\t\tfor (int c = 1; c <= X; c++) {\n\t\t\tfor (int d = 1; d <= X; d++) {\n\t\t\t\tfor (int e = 1; e <= X; e++) {\n\t\t\t\t\tif (c >= d) {\n\t\t\t\t\t\tnum1 = c;\n\t\t\t\t\t\tnum2 = d;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tnum1 = d;\n\t\t\t\t\t\tnum2 = c;\n\t\t\t\t\t}\n\t\t\t\t\twhile ((tmpRest = num1 % num2) != 0) {\n\t\t\t\t\t\tnum1 = num2;\n\t\t\t\t\t\tnum2 = tmpRest;\n\t\t\t\t\t}\n\t\t\t\t\ttmpMax = num2;\n\n\t\t\t\t\tif (tmpMax >= e) {\n\t\t\t\t\t\tnum1 = tmpMax;\n\t\t\t\t\t\tnum2 = e;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tnum1 = e;\n\t\t\t\t\t\tnum2 = tmpMax;\n\t\t\t\t\t}\n\t\t\t\t\twhile ((tmpRest = num1 % num2) != 0) {\n\t\t\t\t\t\tnum1 = num2;\n\t\t\t\t\t\tnum2 = tmpRest;\n\t\t\t\t\t}\n\t\t\t\t\tans = ans + num2;\n\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(ans);\n\t}\n}",
"Main"
] |
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int X = sc.nextInt();
int ans = 0;
int tmpRest = 0;
int tmpMax = 0;
int num1;
int num2;
for (int c = 1; c <= X; c++) {
for (int d = 1; d <= X; d++) {
for (int e = 1; e <= X; e++) {
if (c >= d) {
num1 = c;
num2 = d;
} else {
num1 = d;
num2 = c;
}
while ((tmpRest = num1 % num2) != 0) {
num1 = num2;
num2 = tmpRest;
}
tmpMax = num2;
if (tmpMax >= e) {
num1 = tmpMax;
num2 = e;
} else {
num1 = e;
num2 = tmpMax;
}
while ((tmpRest = num1 % num2) != 0) {
num1 = num2;
num2 = tmpRest;
}
ans = ans + num2;
}
}
}
System.out.println(ans);
}
}
|
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
41,
13,
2,
17,
17,
41,
13,
2,
17,
17,
41,
13,
41,
13,
41,
13,
12,
13,
30,
41,
13,
17,
41,
13,
18,
13,
13,
41,
13,
42,
2,
13,
13,
30,
0,
13,
2,
13,
2,
2,
13,
13,
17,
14,
2,
18,
13,
13,
13,
0,
13,
2,
13,
17,
0,
13,
13,
29,
13,
23,
13,
23,
13,
12,
13,
30,
14,
2,
13,
17,
29,
13,
29,
4,
13,
2,
13,
13,
13,
23,
13,
23,
13,
12,
13,
30,
14,
2,
13,
17,
30,
29,
17,
29,
17,
23,
13,
12,
13,
30,
0,
13,
20,
0,
13,
20,
0,
13,
20,
41,
13,
4,
18,
13,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
4,
13,
13,
4,
13,
13,
13,
4,
18,
13,
13,
4,
18,
13,
23,
13,
6,
13,
41,
13,
41,
13,
20,
17,
41,
13,
41,
13,
41,
13,
12,
13,
30,
0,
18,
36,
13,
13,
23,
13,
12,
13,
30,
14,
2,
13,
40,
17,
37,
20,
14,
2,
13,
13,
30,
0,
13,
17,
38,
5,
13,
30,
37,
20,
30,
0,
13,
4,
18,
13,
13,
14,
2,
13,
17,
29,
40,
17,
29,
18,
13,
40,
13,
12,
13,
30,
41,
13,
4,
13,
42,
4,
13,
13,
30,
0,
13,
4,
13,
41,
13,
17,
14,
2,
13,
17,
30,
0,
13,
40,
17,
0,
13,
4,
13,
41,
13,
17,
42,
40,
4,
13,
13,
30,
14,
2,
2,
13,
17,
2,
13,
17,
37,
20,
0,
13,
17,
0,
13,
2,
13,
17,
0,
13,
4,
13,
29,
2,
13,
13,
12,
13,
30,
41,
13,
4,
13,
42,
4,
13,
13,
30,
0,
13,
4,
13,
41,
13,
17,
14,
2,
13,
17,
30,
0,
13,
40,
17,
0,
13,
4,
13,
41,
13,
17,
42,
40,
4,
13,
13,
30,
14,
2,
2,
13,
17,
2,
13,
17,
37,
20,
0,
13,
17,
0,
13,
2,
13,
17,
0,
13,
4,
13,
29,
2,
13,
13,
12,
13,
30,
41,
13,
20,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
18,
13,
13,
4,
13,
29,
13,
23,
13,
12,
13,
30,
41,
13,
20,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
18,
13,
13,
4,
13,
29,
13,
23,
13,
12,
13,
30,
41,
13,
20,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
41,
13,
4,
18,
13,
4,
18,
13,
13,
29,
13,
23,
13,
12,
13,
30,
41,
13,
4,
13,
42,
4,
13,
13,
30,
0,
13,
4,
13,
41,
13,
20,
42,
40,
4,
13,
13,
30,
4,
18,
13,
13,
0,
13,
4,
13,
29,
4,
18,
13,
12,
13,
30,
41,
13,
4,
13,
42,
4,
13,
13,
0,
13,
4,
13,
41,
13,
20,
42,
40,
4,
13,
13,
30,
4,
18,
13,
13,
0,
13,
4,
13,
29,
4,
18,
13,
12,
13,
30,
14,
2,
13,
17,
29,
4,
18,
13,
13,
29,
2,
2,
2,
2,
2,
13,
17,
2,
13,
17,
2,
13,
17,
2,
13,
17,
2,
13,
40,
17,
23,
13,
12,
13,
30,
29,
2,
2,
2,
13,
17,
2,
13,
17,
2,
13,
40,
17,
23,
13,
6,
13,
12,
13,
23,
13,
6,
13,
12,
13,
30,
4,
18,
13,
13,
23,
13,
12,
13,
30,
41,
13,
20,
11,
1,
41,
13,
17,
2,
13,
18,
13,
13,
1,
40,
13,
30,
30,
4,
18,
13,
2,
18,
13,
13,
17,
4,
18,
13,
4,
18,
13,
23,
13,
6,
13,
41,
13,
41,
13,
12,
13,
30,
0,
18,
36,
13,
13,
0,
18,
36,
13,
13,
23,
13,
23,
13,
12,
13,
30,
14,
2,
36,
13,
29,
17,
14,
40,
2,
13,
13,
29,
17,
41,
13,
13,
29,
2,
13,
18,
13,
13,
23,
13,
12,
13,
30,
29,
2,
18,
18,
36,
13,
13,
18,
18,
13,
13,
13,
23,
13,
6,
13,
41,
13,
41,
13,
12,
13,
30,
0,
18,
36,
13,
13,
0,
18,
36,
13,
13,
23,
13,
23,
13,
12,
13,
30,
14,
2,
36,
13,
29,
17,
14,
40,
2,
13,
13,
29,
17,
41,
13,
13,
29,
2,
2,
13,
18,
13,
13,
2,
13,
18,
13,
13,
23,
13,
6,
13,
41,
13,
41,
13,
12,
13,
30,
0,
13,
13,
0,
13,
13,
23,
13,
23,
13,
12,
13,
30,
29,
2,
13,
18,
13,
13,
23,
13,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
10,
11
],
[
10,
12
],
[
0,
13
],
[
817,
14
],
[
817,
15
],
[
15,
16
],
[
15,
17
],
[
17,
18
],
[
17,
19
],
[
817,
20
],
[
20,
21
],
[
20,
22
],
[
22,
23
],
[
22,
24
],
[
817,
25
],
[
25,
26
],
[
817,
27
],
[
27,
28
],
[
817,
29
],
[
29,
30
],
[
817,
31
],
[
31,
32
],
[
31,
33
],
[
33,
34
],
[
34,
35
],
[
34,
36
],
[
33,
37
],
[
37,
38
],
[
37,
39
],
[
39,
40
],
[
39,
41
],
[
33,
42
],
[
42,
43
],
[
33,
44
],
[
44,
45
],
[
45,
46
],
[
45,
47
],
[
44,
48
],
[
48,
49
],
[
49,
50
],
[
49,
51
],
[
51,
52
],
[
51,
53
],
[
53,
54
],
[
54,
55
],
[
54,
56
],
[
53,
57
],
[
48,
58
],
[
58,
59
],
[
59,
60
],
[
60,
61
],
[
60,
62
],
[
59,
63
],
[
58,
64
],
[
64,
65
],
[
64,
66
],
[
66,
67
],
[
66,
68
],
[
58,
69
],
[
69,
70
],
[
69,
71
],
[
33,
72
],
[
72,
73
],
[
31,
74
],
[
74,
75
],
[
31,
76
],
[
76,
77
],
[
817,
78
],
[
78,
79
],
[
78,
80
],
[
80,
81
],
[
81,
82
],
[
82,
83
],
[
82,
84
],
[
81,
85
],
[
85,
86
],
[
80,
87
],
[
87,
88
],
[
88,
89
],
[
88,
90
],
[
90,
91
],
[
90,
92
],
[
88,
93
],
[
78,
94
],
[
94,
95
],
[
78,
96
],
[
96,
97
],
[
817,
98
],
[
98,
99
],
[
98,
100
],
[
100,
101
],
[
101,
102
],
[
102,
103
],
[
102,
104
],
[
101,
105
],
[
105,
106
],
[
106,
107
],
[
100,
108
],
[
108,
109
],
[
98,
110
],
[
110,
111
],
[
817,
112
],
[
112,
113
],
[
112,
114
],
[
114,
115
],
[
115,
116
],
[
115,
117
],
[
114,
118
],
[
118,
119
],
[
118,
120
],
[
114,
121
],
[
121,
122
],
[
121,
123
],
[
114,
124
],
[
124,
125
],
[
124,
126
],
[
126,
127
],
[
127,
128
],
[
114,
129
],
[
129,
130
],
[
129,
131
],
[
114,
132
],
[
132,
133
],
[
133,
134
],
[
134,
135
],
[
134,
136
],
[
132,
137
],
[
137,
138
],
[
137,
139
],
[
132,
140
],
[
140,
141
],
[
141,
142
],
[
132,
143
],
[
144,
144
],
[
144,
145
],
[
145,
146
],
[
146,
147
],
[
147,
148
],
[
147,
149
],
[
145,
150
],
[
150,
151
],
[
150,
152
],
[
145,
153
],
[
153,
154
],
[
154,
155
],
[
145,
156
],
[
157,
157
],
[
157,
158
],
[
158,
159
],
[
159,
160
],
[
160,
161
],
[
160,
162
],
[
158,
163
],
[
163,
164
],
[
163,
165
],
[
158,
166
],
[
166,
167
],
[
167,
168
],
[
158,
169
],
[
170,
170
],
[
170,
171
],
[
171,
172
],
[
171,
173
],
[
173,
174
],
[
173,
175
],
[
173,
176
],
[
176,
177
],
[
176,
178
],
[
176,
179
],
[
114,
180
],
[
180,
181
],
[
181,
182
],
[
180,
183
],
[
114,
184
],
[
184,
185
],
[
185,
186
],
[
112,
187
],
[
187,
188
],
[
817,
189
],
[
189,
190
],
[
189,
191
],
[
191,
192
],
[
189,
193
],
[
193,
194
],
[
193,
195
],
[
189,
197
],
[
197,
198
],
[
189,
199
],
[
199,
200
],
[
189,
201
],
[
201,
202
],
[
189,
203
],
[
203,
204
],
[
203,
205
],
[
205,
206
],
[
206,
207
],
[
207,
208
],
[
207,
209
],
[
206,
210
],
[
203,
211
],
[
211,
212
],
[
189,
213
],
[
213,
214
],
[
213,
215
],
[
215,
216
],
[
216,
217
],
[
217,
218
],
[
217,
219
],
[
219,
220
],
[
216,
221
],
[
221,
222
],
[
215,
223
],
[
223,
224
],
[
224,
225
],
[
224,
226
],
[
223,
227
],
[
227,
228
],
[
228,
229
],
[
228,
230
],
[
227,
231
],
[
231,
232
],
[
232,
233
],
[
232,
234
],
[
234,
235
],
[
235,
236
],
[
231,
237
],
[
237,
238
],
[
238,
239
],
[
238,
240
],
[
240,
241
],
[
241,
242
],
[
240,
243
],
[
227,
244
],
[
244,
245
],
[
245,
246
],
[
245,
247
],
[
244,
248
],
[
248,
249
],
[
249,
250
],
[
215,
251
],
[
251,
252
],
[
252,
253
],
[
252,
254
],
[
254,
255
],
[
189,
256
],
[
256,
257
],
[
256,
258
],
[
258,
259
],
[
259,
260
],
[
259,
261
],
[
261,
262
],
[
258,
263
],
[
263,
264
],
[
264,
265
],
[
264,
266
],
[
263,
267
],
[
267,
268
],
[
268,
269
],
[
268,
270
],
[
270,
271
],
[
258,
272
],
[
272,
273
],
[
272,
274
],
[
258,
275
],
[
275,
276
],
[
276,
277
],
[
276,
278
],
[
275,
279
],
[
279,
280
],
[
280,
281
],
[
280,
282
],
[
282,
283
],
[
279,
284
],
[
284,
285
],
[
284,
286
],
[
286,
287
],
[
258,
288
],
[
288,
289
],
[
288,
290
],
[
258,
291
],
[
291,
292
],
[
292,
293
],
[
293,
294
],
[
293,
295
],
[
291,
296
],
[
296,
297
],
[
297,
298
],
[
298,
299
],
[
299,
300
],
[
299,
301
],
[
298,
302
],
[
302,
303
],
[
302,
304
],
[
297,
305
],
[
305,
306
],
[
296,
307
],
[
307,
308
],
[
307,
309
],
[
296,
310
],
[
310,
311
],
[
310,
312
],
[
312,
313
],
[
312,
314
],
[
296,
315
],
[
315,
316
],
[
315,
317
],
[
317,
318
],
[
258,
319
],
[
319,
320
],
[
320,
321
],
[
320,
322
],
[
189,
323
],
[
323,
324
],
[
323,
325
],
[
325,
326
],
[
326,
327
],
[
326,
328
],
[
328,
329
],
[
325,
330
],
[
330,
331
],
[
331,
332
],
[
331,
333
],
[
330,
334
],
[
334,
335
],
[
335,
336
],
[
335,
337
],
[
337,
338
],
[
325,
339
],
[
339,
340
],
[
339,
341
],
[
325,
342
],
[
342,
343
],
[
343,
344
],
[
343,
345
],
[
342,
346
],
[
346,
347
],
[
347,
348
],
[
347,
349
],
[
349,
350
],
[
346,
351
],
[
351,
352
],
[
351,
353
],
[
353,
354
],
[
325,
355
],
[
355,
356
],
[
355,
357
],
[
325,
358
],
[
358,
359
],
[
359,
360
],
[
360,
361
],
[
360,
362
],
[
358,
363
],
[
363,
364
],
[
364,
365
],
[
365,
366
],
[
366,
367
],
[
366,
368
],
[
365,
369
],
[
369,
370
],
[
369,
371
],
[
364,
372
],
[
372,
373
],
[
363,
374
],
[
374,
375
],
[
374,
376
],
[
363,
377
],
[
377,
378
],
[
377,
379
],
[
379,
380
],
[
379,
381
],
[
363,
382
],
[
382,
383
],
[
382,
384
],
[
384,
385
],
[
325,
386
],
[
386,
387
],
[
387,
388
],
[
387,
389
],
[
189,
390
],
[
390,
391
],
[
390,
392
],
[
392,
393
],
[
393,
394
],
[
393,
395
],
[
392,
397
],
[
397,
398
],
[
398,
399
],
[
399,
400
],
[
399,
401
],
[
397,
402
],
[
402,
403
],
[
402,
404
],
[
397,
405
],
[
405,
406
],
[
406,
407
],
[
397,
408
],
[
409,
409
],
[
409,
410
],
[
410,
411
],
[
411,
412
],
[
411,
413
],
[
410,
414
],
[
414,
415
],
[
392,
416
],
[
416,
417
],
[
390,
418
],
[
418,
419
],
[
189,
420
],
[
420,
421
],
[
420,
422
],
[
422,
423
],
[
423,
424
],
[
423,
425
],
[
422,
427
],
[
427,
428
],
[
428,
429
],
[
429,
430
],
[
429,
431
],
[
427,
432
],
[
432,
433
],
[
432,
434
],
[
427,
435
],
[
435,
436
],
[
436,
437
],
[
427,
438
],
[
439,
439
],
[
439,
440
],
[
440,
441
],
[
441,
442
],
[
441,
443
],
[
440,
444
],
[
444,
445
],
[
422,
446
],
[
446,
447
],
[
420,
448
],
[
448,
449
],
[
189,
450
],
[
450,
451
],
[
450,
452
],
[
452,
453
],
[
453,
454
],
[
453,
455
],
[
452,
456
],
[
456,
457
],
[
457,
458
],
[
458,
459
],
[
458,
460
],
[
456,
461
],
[
461,
462
],
[
461,
463
],
[
456,
464
],
[
464,
465
],
[
465,
466
],
[
456,
467
],
[
468,
468
],
[
468,
469
],
[
469,
470
],
[
469,
471
],
[
471,
472
],
[
472,
473
],
[
468,
474
],
[
474,
475
],
[
475,
476
],
[
474,
477
],
[
452,
478
],
[
478,
479
],
[
450,
480
],
[
480,
481
],
[
189,
482
],
[
482,
483
],
[
482,
484
],
[
484,
485
],
[
485,
486
],
[
485,
487
],
[
487,
488
],
[
484,
489
],
[
489,
490
],
[
490,
491
],
[
490,
492
],
[
489,
493
],
[
493,
494
],
[
494,
495
],
[
494,
496
],
[
496,
497
],
[
484,
498
],
[
498,
499
],
[
498,
500
],
[
484,
501
],
[
501,
502
],
[
502,
503
],
[
503,
504
],
[
503,
505
],
[
501,
506
],
[
506,
507
],
[
507,
508
],
[
508,
509
],
[
507,
510
],
[
506,
511
],
[
511,
512
],
[
511,
513
],
[
513,
514
],
[
484,
515
],
[
515,
516
],
[
516,
517
],
[
517,
518
],
[
189,
519
],
[
519,
520
],
[
519,
521
],
[
521,
522
],
[
522,
523
],
[
522,
524
],
[
524,
525
],
[
521,
526
],
[
526,
527
],
[
527,
528
],
[
527,
529
],
[
526,
530
],
[
530,
531
],
[
530,
532
],
[
532,
533
],
[
521,
534
],
[
534,
535
],
[
534,
536
],
[
521,
537
],
[
537,
538
],
[
538,
539
],
[
539,
540
],
[
539,
541
],
[
537,
542
],
[
542,
543
],
[
543,
544
],
[
544,
545
],
[
543,
546
],
[
542,
547
],
[
547,
548
],
[
547,
549
],
[
549,
550
],
[
521,
551
],
[
551,
552
],
[
552,
553
],
[
553,
554
],
[
189,
555
],
[
555,
556
],
[
555,
557
],
[
557,
558
],
[
558,
559
],
[
559,
560
],
[
559,
561
],
[
558,
562
],
[
562,
563
],
[
563,
564
],
[
564,
565
],
[
563,
566
],
[
557,
567
],
[
567,
568
],
[
571,
569
],
[
581,
570
],
[
578,
571
],
[
571,
572
],
[
572,
573
],
[
572,
574
],
[
571,
575
],
[
575,
576
],
[
575,
577
],
[
578,
578
],
[
578,
579
],
[
578,
580
],
[
581,
581
],
[
581,
582
],
[
581,
583
],
[
571,
584
],
[
584,
585
],
[
584,
586
],
[
586,
587
],
[
555,
588
],
[
588,
589
],
[
189,
590
],
[
590,
591
],
[
590,
592
],
[
592,
593
],
[
593,
594
],
[
595,
595
],
[
595,
596
],
[
596,
597
],
[
596,
598
],
[
595,
599
],
[
599,
600
],
[
599,
601
],
[
595,
602
],
[
602,
603
],
[
602,
604
],
[
604,
605
],
[
590,
606
],
[
606,
607
],
[
189,
608
],
[
608,
609
],
[
608,
610
],
[
610,
611
],
[
610,
612
],
[
612,
613
],
[
817,
614
],
[
614,
615
],
[
614,
616
],
[
616,
617
],
[
616,
618
],
[
618,
619
],
[
619,
620
],
[
620,
621
],
[
619,
622
],
[
616,
623
],
[
623,
624
],
[
614,
625
],
[
625,
626
],
[
625,
627
],
[
627,
628
],
[
628,
629
],
[
628,
630
],
[
627,
631
],
[
631,
632
],
[
632,
633
],
[
633,
634
],
[
633,
635
],
[
631,
636
],
[
636,
637
],
[
636,
638
],
[
638,
639
],
[
638,
640
],
[
631,
641
],
[
641,
642
],
[
642,
643
],
[
631,
644
],
[
645,
645
],
[
645,
646
],
[
646,
647
],
[
647,
648
],
[
646,
649
],
[
649,
650
],
[
650,
651
],
[
650,
652
],
[
649,
653
],
[
627,
654
],
[
654,
655
],
[
655,
656
],
[
654,
657
],
[
657,
658
],
[
658,
659
],
[
625,
660
],
[
660,
661
],
[
0,
662
],
[
662,
663
],
[
662,
664
],
[
664,
665
],
[
662,
666
],
[
666,
667
],
[
662,
668
],
[
668,
669
],
[
668,
670
],
[
670,
671
],
[
671,
672
],
[
672,
673
],
[
672,
674
],
[
671,
675
],
[
670,
676
],
[
676,
677
],
[
677,
678
],
[
677,
679
],
[
676,
680
],
[
668,
681
],
[
681,
682
],
[
668,
683
],
[
683,
684
],
[
662,
685
],
[
685,
686
],
[
685,
687
],
[
687,
688
],
[
688,
689
],
[
689,
690
],
[
689,
691
],
[
688,
692
],
[
692,
693
],
[
687,
694
],
[
694,
695
],
[
695,
696
],
[
696,
697
],
[
696,
698
],
[
694,
699
],
[
699,
700
],
[
687,
701
],
[
701,
702
],
[
701,
703
],
[
687,
704
],
[
704,
705
],
[
705,
706
],
[
705,
707
],
[
707,
708
],
[
707,
709
],
[
685,
710
],
[
710,
711
],
[
662,
712
],
[
712,
713
],
[
712,
714
],
[
714,
715
],
[
715,
716
],
[
716,
717
],
[
717,
718
],
[
718,
719
],
[
718,
720
],
[
717,
721
],
[
716,
722
],
[
722,
723
],
[
723,
724
],
[
723,
725
],
[
722,
726
],
[
712,
727
],
[
727,
728
],
[
0,
729
],
[
729,
730
],
[
729,
731
],
[
731,
732
],
[
729,
733
],
[
733,
734
],
[
729,
735
],
[
735,
736
],
[
735,
737
],
[
737,
738
],
[
738,
739
],
[
739,
740
],
[
739,
741
],
[
738,
742
],
[
737,
743
],
[
743,
744
],
[
744,
745
],
[
744,
746
],
[
743,
747
],
[
735,
748
],
[
748,
749
],
[
735,
750
],
[
750,
751
],
[
729,
752
],
[
752,
753
],
[
752,
754
],
[
754,
755
],
[
755,
756
],
[
756,
757
],
[
756,
758
],
[
755,
759
],
[
759,
760
],
[
754,
761
],
[
761,
762
],
[
762,
763
],
[
763,
764
],
[
763,
765
],
[
761,
766
],
[
766,
767
],
[
754,
768
],
[
768,
769
],
[
768,
770
],
[
754,
771
],
[
771,
772
],
[
772,
773
],
[
773,
774
],
[
773,
775
],
[
775,
776
],
[
775,
777
],
[
772,
778
],
[
778,
779
],
[
778,
780
],
[
780,
781
],
[
780,
782
],
[
752,
783
],
[
783,
784
],
[
0,
785
],
[
785,
786
],
[
785,
787
],
[
787,
788
],
[
785,
789
],
[
789,
790
],
[
785,
791
],
[
791,
792
],
[
791,
793
],
[
793,
794
],
[
794,
795
],
[
794,
796
],
[
793,
797
],
[
797,
798
],
[
797,
799
],
[
791,
800
],
[
800,
801
],
[
791,
802
],
[
802,
803
],
[
785,
804
],
[
804,
805
],
[
804,
806
],
[
806,
807
],
[
807,
808
],
[
808,
809
],
[
808,
810
],
[
810,
811
],
[
810,
812
],
[
804,
813
],
[
813,
814
],
[
785,
815
],
[
0,
816
],
[
816,
817
],
[
816,
818
]
] |
[
"import java.io.*;\nimport java.math.BigInteger; \nimport java.util.*;\nimport java.math.*; \n\n//Mann Shah [ DAIICT ].\n//fast io\n\npublic class Main {\n\tstatic int mod = (int) (1e9+7);\n\tstatic long N = (long)(2*1e5);\n\tstatic InputReader in;\n static PrintWriter out;\n static Debugger deb;\n \n public static int lower_bound(int[] a,int k) { // no. of elements less than k in array.\n \t\tint first = 0,last = a.length,mid;\n while (first < last) {\n mid = first + ((last - first) >> 1); \n if (a[mid] < k) //lower bound. for upper use <= ( n - first)\n first = mid + 1; \n else \n last = mid;\n }\n \t\treturn first;\n }\n \n public static int gcd(int a, int b){ \n\t if (a == 0) \n\t return b; \n\t return gcd(b % a, a); \n } \n \n public static char chk(char n) {\n \t\t\n \t\tif(n=='1') {\n \t\t\treturn '2';\n \t\t}\n \t\treturn '1';\n }\n \n\tpublic static void main(String args[] ) throws NumberFormatException, IOException {\n\t\t\t\n\t\tin = new InputReader(System.in);\n\t out = new PrintWriter(System.out);\n\t deb = new Debugger();\n\t \n\t int k = in.nextInt();\n\t \n\t int gcd =0;\n\t for(int i=1;i<=k;i++) {\n\t \t\tfor(int j=1;j<=k;j++) {\n\t \t\t\tfor(int ll=1;ll<=k;ll++) {\n\t \t\t\t\tgcd += gcd(i,gcd(ll,j));\n\t \t\t\t}\n\t \t\t}\n\t }\n\t \n\t out.println(gcd);\n\t out.close();\n\t}\n\t\t\n/* TC space\n\n\n\n */\n\t\t\n\t\tstatic class InputReader\n\t {\n\t private final InputStream stream;\n\t private final byte[] buf = new byte[8192];\n\t private int curChar, snumChars;\n\t private SpaceCharFilter filter;\n\n\t public InputReader(InputStream stream)\n\t {\n\t this.stream = stream;\n\t }\n\n\t public int snext()\n\t {\n\t if (snumChars == -1)\n\t throw new InputMismatchException();\n\t if (curChar >= snumChars)\n\t {\n\t curChar = 0;\n\t try\n\t {\n\t snumChars = stream.read(buf);\n\t } catch (IOException e)\n\t {\n\t throw new InputMismatchException();\n\t }\n\t if (snumChars <= 0)\n\t return -1;\n\t }\n\t return buf[curChar++];\n\t }\n\n\t public int nextInt()\n\t {\n\t int c = snext();\n\t while (isSpaceChar(c))\n\t {\n\t c = snext();\n\t }\n\t int sgn = 1;\n\t if (c == '-')\n\t {\n\t sgn = -1;\n\t c = snext();\n\t }\n\t int res = 0;\n\t do\n\t {\n\t if (c < '0' || c > '9')\n\t throw new InputMismatchException();\n\t res *= 10;\n\t res += c - '0';\n\t c = snext();\n\t } while (!isSpaceChar(c));\n\t return res * sgn;\n\t }\n\n\t public long nextLong()\n\t {\n\t int c = snext();\n\t while (isSpaceChar(c))\n\t {\n\t c = snext();\n\t }\n\t int sgn = 1;\n\t if (c == '-')\n\t {\n\t sgn = -1;\n\t c = snext();\n\t }\n\t long res = 0;\n\t do\n\t {\n\t if (c < '0' || c > '9')\n\t throw new InputMismatchException();\n\t res *= 10;\n\t res += c - '0';\n\t c = snext();\n\t } while (!isSpaceChar(c));\n\t return res * sgn;\n\t }\n\n\t public int[] nextIntArray(int n)\n\t {\n\t int a[] = new int[n];\n\t for (int i = 0; i < n; i++)\n\t {\n\t a[i] = nextInt();\n\t }\n\t return a;\n\t }\n\n\t public long[] nextLongArray(int n)\n\t {\n\t long a[] = new long[n];\n\t for (int i = 0; i < n; i++)\n\t {\n\t a[i] = nextLong();\n\t }\n\t return a;\n\t }\n\t \n\t public ArrayList<Integer> nextArrayList(int n){\n\t \t\t\tArrayList<Integer> x = new ArrayList<Integer>();\n\t \t\t\tfor(int i=0;i<n;i++) {\n\t \t\t\t\tint v = in.nextInt();\n\t \t\t\t\tx.add(v);\n\t \t\t\t}\n\t \t\t\treturn x;\n\t }\n\n\t public String readString()\n\t {\n\t int c = snext();\n\t while (isSpaceChar(c))\n\t {\n\t c = snext();\n\t }\n\t StringBuilder res = new StringBuilder();\n\t do\n\t {\n\t res.appendCodePoint(c);\n\t c = snext();\n\t } while (!isSpaceChar(c));\n\t return res.toString();\n\t }\n\n\t public String nextLine()\n\t {\n\t int c = snext();\n\t while (isSpaceChar(c))\n\t c = snext();\n\t StringBuilder res = new StringBuilder();\n\t do\n\t {\n\t res.appendCodePoint(c);\n\t c = snext();\n\t } while (!isEndOfLine(c));\n\t return res.toString();\n\t }\n\n\t public boolean isSpaceChar(int c)\n\t {\n\t if (filter != null)\n\t return filter.isSpaceChar(c);\n\t return c == ' ' || c == '\\n' || c == '\\r' || c == '\\t' || c == -1;\n\t }\n\n\t private boolean isEndOfLine(int c)\n\t {\n\t return c == '\\n' || c == '\\r' || c == -1;\n\t }\n\n\t public interface SpaceCharFilter\n\t {\n\t public boolean isSpaceChar(int ch);\n\t }\n\n\t }\n\t\t\n\t\tstatic class Debugger{\n\t\t\tpublic void n(int x) {\n\t\t\t\tout.println(x);\n\t\t\t}\n\t\t\t\n\t\t\tpublic void a(int[] a) {\n\t\t StringBuilder sb = new StringBuilder();\n\t\t for(int i=0;i<a.length;i++) {\n\t\t \t\tsb.append(a[i]+\" \");\n\t\t }\n\t\t out.println(sb.toString());\n\t\t\t}\n\t\t}\n\t\t\n}\n\n\nclass Pairx {\n\tPair a;\n\tint b;\n\tpublic Pairx(Pair a,int b) {\n\t\tthis.a =a;\n\t\tthis.b =b;\n\t}\n\t@Override\n\tpublic boolean equals(Object o) {\n\t if (this == o) return true;\n\t if (!(o instanceof Pairx)) return false;\n\t Pairx p = (Pairx) o;\n\t return b == p.b;\n\t}\n\tpublic int compareTo(Pairx that) {\n\t\treturn (int)(this.a.x - that.a.x);\n\t}\n}\n\n\n//Pair arr[] = new Pair[n]; \n//arr[0] = new Pair(10, 20); \n class Pair { \n int x; \n int y; \n \n // Constructor \n public Pair(int x, int y) \n { \n this.x = x; \n this.y = y; \n } \n\t@Override\n\tpublic boolean equals(Object o) {\n\t if (this == o) return true;\n\t if (!(o instanceof Pair)) return false;\n\t Pair p = (Pair) o;\n\t return x == p.x && y == p.y;\n\t}\n} \n// class Compare { \n//\t //void return by default.\n// static Pair[] compare(Pair arr[], int n) \n// { \n \n \t\t// (p1,p2) -> p1.x-p2.x Using lembda function...\n \n// // Comparator to sort the pair according to first element.\n// Arrays.sort(arr, new Comparator<Pair>() { \n// @Override public int compare(Pair p1, Pair p2) \n// { \n// return p1.x - p2.x; \n// } \n// }); \n// \n// return arr;\n// } \n//} \n\n\n\n\nclass couple implements Comparable<couple>\n{ int x,y;\n public couple(int m,int f) {\n \t x=m;\n \t y=f;\n }\n\tpublic int compareTo(couple o) {\n\t\t\n\t\t \n\t\treturn x-o.x;\n\t} \n}",
"import java.io.*;",
"io.*",
"java",
"import java.math.BigInteger;",
"BigInteger",
"java.math",
"import java.util.*;",
"util.*",
"java",
"import java.math.*;",
"math.*",
"java",
"public class Main {\n\tstatic int mod = (int) (1e9+7);\n\tstatic long N = (long)(2*1e5);\n\tstatic InputReader in;\n static PrintWriter out;\n static Debugger deb;\n \n public static int lower_bound(int[] a,int k) { // no. of elements less than k in array.\n \t\tint first = 0,last = a.length,mid;\n while (first < last) {\n mid = first + ((last - first) >> 1); \n if (a[mid] < k) //lower bound. for upper use <= ( n - first)\n first = mid + 1; \n else \n last = mid;\n }\n \t\treturn first;\n }\n \n public static int gcd(int a, int b){ \n\t if (a == 0) \n\t return b; \n\t return gcd(b % a, a); \n } \n \n public static char chk(char n) {\n \t\t\n \t\tif(n=='1') {\n \t\t\treturn '2';\n \t\t}\n \t\treturn '1';\n }\n \n\tpublic static void main(String args[] ) throws NumberFormatException, IOException {\n\t\t\t\n\t\tin = new InputReader(System.in);\n\t out = new PrintWriter(System.out);\n\t deb = new Debugger();\n\t \n\t int k = in.nextInt();\n\t \n\t int gcd =0;\n\t for(int i=1;i<=k;i++) {\n\t \t\tfor(int j=1;j<=k;j++) {\n\t \t\t\tfor(int ll=1;ll<=k;ll++) {\n\t \t\t\t\tgcd += gcd(i,gcd(ll,j));\n\t \t\t\t}\n\t \t\t}\n\t }\n\t \n\t out.println(gcd);\n\t out.close();\n\t}\n\t\t\n/* TC space\n\n\n\n */\n\t\t\n\t\tstatic class InputReader\n\t {\n\t private final InputStream stream;\n\t private final byte[] buf = new byte[8192];\n\t private int curChar, snumChars;\n\t private SpaceCharFilter filter;\n\n\t public InputReader(InputStream stream)\n\t {\n\t this.stream = stream;\n\t }\n\n\t public int snext()\n\t {\n\t if (snumChars == -1)\n\t throw new InputMismatchException();\n\t if (curChar >= snumChars)\n\t {\n\t curChar = 0;\n\t try\n\t {\n\t snumChars = stream.read(buf);\n\t } catch (IOException e)\n\t {\n\t throw new InputMismatchException();\n\t }\n\t if (snumChars <= 0)\n\t return -1;\n\t }\n\t return buf[curChar++];\n\t }\n\n\t public int nextInt()\n\t {\n\t int c = snext();\n\t while (isSpaceChar(c))\n\t {\n\t c = snext();\n\t }\n\t int sgn = 1;\n\t if (c == '-')\n\t {\n\t sgn = -1;\n\t c = snext();\n\t }\n\t int res = 0;\n\t do\n\t {\n\t if (c < '0' || c > '9')\n\t throw new InputMismatchException();\n\t res *= 10;\n\t res += c - '0';\n\t c = snext();\n\t } while (!isSpaceChar(c));\n\t return res * sgn;\n\t }\n\n\t public long nextLong()\n\t {\n\t int c = snext();\n\t while (isSpaceChar(c))\n\t {\n\t c = snext();\n\t }\n\t int sgn = 1;\n\t if (c == '-')\n\t {\n\t sgn = -1;\n\t c = snext();\n\t }\n\t long res = 0;\n\t do\n\t {\n\t if (c < '0' || c > '9')\n\t throw new InputMismatchException();\n\t res *= 10;\n\t res += c - '0';\n\t c = snext();\n\t } while (!isSpaceChar(c));\n\t return res * sgn;\n\t }\n\n\t public int[] nextIntArray(int n)\n\t {\n\t int a[] = new int[n];\n\t for (int i = 0; i < n; i++)\n\t {\n\t a[i] = nextInt();\n\t }\n\t return a;\n\t }\n\n\t public long[] nextLongArray(int n)\n\t {\n\t long a[] = new long[n];\n\t for (int i = 0; i < n; i++)\n\t {\n\t a[i] = nextLong();\n\t }\n\t return a;\n\t }\n\t \n\t public ArrayList<Integer> nextArrayList(int n){\n\t \t\t\tArrayList<Integer> x = new ArrayList<Integer>();\n\t \t\t\tfor(int i=0;i<n;i++) {\n\t \t\t\t\tint v = in.nextInt();\n\t \t\t\t\tx.add(v);\n\t \t\t\t}\n\t \t\t\treturn x;\n\t }\n\n\t public String readString()\n\t {\n\t int c = snext();\n\t while (isSpaceChar(c))\n\t {\n\t c = snext();\n\t }\n\t StringBuilder res = new StringBuilder();\n\t do\n\t {\n\t res.appendCodePoint(c);\n\t c = snext();\n\t } while (!isSpaceChar(c));\n\t return res.toString();\n\t }\n\n\t public String nextLine()\n\t {\n\t int c = snext();\n\t while (isSpaceChar(c))\n\t c = snext();\n\t StringBuilder res = new StringBuilder();\n\t do\n\t {\n\t res.appendCodePoint(c);\n\t c = snext();\n\t } while (!isEndOfLine(c));\n\t return res.toString();\n\t }\n\n\t public boolean isSpaceChar(int c)\n\t {\n\t if (filter != null)\n\t return filter.isSpaceChar(c);\n\t return c == ' ' || c == '\\n' || c == '\\r' || c == '\\t' || c == -1;\n\t }\n\n\t private boolean isEndOfLine(int c)\n\t {\n\t return c == '\\n' || c == '\\r' || c == -1;\n\t }\n\n\t public interface SpaceCharFilter\n\t {\n\t public boolean isSpaceChar(int ch);\n\t }\n\n\t }\n\t\t\n\t\tstatic class Debugger{\n\t\t\tpublic void n(int x) {\n\t\t\t\tout.println(x);\n\t\t\t}\n\t\t\t\n\t\t\tpublic void a(int[] a) {\n\t\t StringBuilder sb = new StringBuilder();\n\t\t for(int i=0;i<a.length;i++) {\n\t\t \t\tsb.append(a[i]+\" \");\n\t\t }\n\t\t out.println(sb.toString());\n\t\t\t}\n\t\t}\n\t\t\n}",
"Main",
"static int mod = (int) (1e9+7);",
"mod",
"(int) (1e9+7)",
"1e9",
"7",
"static long N = (long)(2*1e5);",
"N",
"(long)(2*1e5)",
"2",
"1e5",
"static InputReader in;",
"in",
"static PrintWriter out;",
"out",
"static Debugger deb;",
"deb",
"public static int lower_bound(int[] a,int k) { // no. of elements less than k in array.\n \t\tint first = 0,last = a.length,mid;\n while (first < last) {\n mid = first + ((last - first) >> 1); \n if (a[mid] < k) //lower bound. for upper use <= ( n - first)\n first = mid + 1; \n else \n last = mid;\n }\n \t\treturn first;\n }",
"lower_bound",
"{ // no. of elements less than k in array.\n \t\tint first = 0,last = a.length,mid;\n while (first < last) {\n mid = first + ((last - first) >> 1); \n if (a[mid] < k) //lower bound. for upper use <= ( n - first)\n first = mid + 1; \n else \n last = mid;\n }\n \t\treturn first;\n }",
"int first = 0",
"first",
"0",
"last = a.length",
"last",
"a.length",
"a",
"a.length",
"mid;",
"mid",
"while (first < last) {\n mid = first + ((last - first) >> 1); \n if (a[mid] < k) //lower bound. for upper use <= ( n - first)\n first = mid + 1; \n else \n last = mid;\n }",
"first < last",
"first",
"last",
"{\n mid = first + ((last - first) >> 1); \n if (a[mid] < k) //lower bound. for upper use <= ( n - first)\n first = mid + 1; \n else \n last = mid;\n }",
"mid = first + ((last - first) >> 1)",
"mid",
"first + ((last - first) >> 1)",
"first",
"((last - first) >> 1)",
"(last - first)",
"last",
"first",
"1",
"if (a[mid] < k) //lower bound. for upper use <= ( n - first)\n first = mid + 1; \n else \n last = mid;",
"a[mid] < k",
"a[mid]",
"a",
"mid",
"k",
"first = mid + 1",
"first",
"mid + 1",
"mid",
"1",
"last = mid",
"last",
"mid",
"return first;",
"first",
"int[] a",
"a",
"int k",
"k",
"public static int gcd(int a, int b){ \n\t if (a == 0) \n\t return b; \n\t return gcd(b % a, a); \n }",
"gcd",
"{ \n\t if (a == 0) \n\t return b; \n\t return gcd(b % a, a); \n }",
"if (a == 0) \n\t return b;",
"a == 0",
"a",
"0",
"return b;",
"b",
"return gcd(b % a, a);",
"gcd(b % a, a)",
"gcd",
"b % a",
"b",
"a",
"a",
"int a",
"a",
"int b",
"b",
"public static char chk(char n) {\n \t\t\n \t\tif(n=='1') {\n \t\t\treturn '2';\n \t\t}\n \t\treturn '1';\n }",
"chk",
"{\n \t\t\n \t\tif(n=='1') {\n \t\t\treturn '2';\n \t\t}\n \t\treturn '1';\n }",
"if(n=='1') {\n \t\t\treturn '2';\n \t\t}",
"n=='1'",
"n",
"'1'",
"{\n \t\t\treturn '2';\n \t\t}",
"return '2';",
"'2'",
"return '1';",
"'1'",
"char n",
"n",
"public static void main(String args[] ) throws NumberFormatException, IOException {\n\t\t\t\n\t\tin = new InputReader(System.in);\n\t out = new PrintWriter(System.out);\n\t deb = new Debugger();\n\t \n\t int k = in.nextInt();\n\t \n\t int gcd =0;\n\t for(int i=1;i<=k;i++) {\n\t \t\tfor(int j=1;j<=k;j++) {\n\t \t\t\tfor(int ll=1;ll<=k;ll++) {\n\t \t\t\t\tgcd += gcd(i,gcd(ll,j));\n\t \t\t\t}\n\t \t\t}\n\t }\n\t \n\t out.println(gcd);\n\t out.close();\n\t}",
"main",
"{\n\t\t\t\n\t\tin = new InputReader(System.in);\n\t out = new PrintWriter(System.out);\n\t deb = new Debugger();\n\t \n\t int k = in.nextInt();\n\t \n\t int gcd =0;\n\t for(int i=1;i<=k;i++) {\n\t \t\tfor(int j=1;j<=k;j++) {\n\t \t\t\tfor(int ll=1;ll<=k;ll++) {\n\t \t\t\t\tgcd += gcd(i,gcd(ll,j));\n\t \t\t\t}\n\t \t\t}\n\t }\n\t \n\t out.println(gcd);\n\t out.close();\n\t}",
"in = new InputReader(System.in)",
"in",
"new InputReader(System.in)",
"out = new PrintWriter(System.out)",
"out",
"new PrintWriter(System.out)",
"deb = new Debugger()",
"deb",
"new Debugger()",
"int k = in.nextInt();",
"k",
"in.nextInt()",
"in.nextInt",
"in",
"int gcd =0;",
"gcd",
"0",
"for(int i=1;i<=k;i++) {\n\t \t\tfor(int j=1;j<=k;j++) {\n\t \t\t\tfor(int ll=1;ll<=k;ll++) {\n\t \t\t\t\tgcd += gcd(i,gcd(ll,j));\n\t \t\t\t}\n\t \t\t}\n\t }",
"int i=1;",
"int i=1;",
"i",
"1",
"i<=k",
"i",
"k",
"i++",
"i++",
"i",
"{\n\t \t\tfor(int j=1;j<=k;j++) {\n\t \t\t\tfor(int ll=1;ll<=k;ll++) {\n\t \t\t\t\tgcd += gcd(i,gcd(ll,j));\n\t \t\t\t}\n\t \t\t}\n\t }",
"{\n\t \t\tfor(int j=1;j<=k;j++) {\n\t \t\t\tfor(int ll=1;ll<=k;ll++) {\n\t \t\t\t\tgcd += gcd(i,gcd(ll,j));\n\t \t\t\t}\n\t \t\t}\n\t }",
"for(int j=1;j<=k;j++) {\n\t \t\t\tfor(int ll=1;ll<=k;ll++) {\n\t \t\t\t\tgcd += gcd(i,gcd(ll,j));\n\t \t\t\t}\n\t \t\t}",
"int j=1;",
"int j=1;",
"j",
"1",
"j<=k",
"j",
"k",
"j++",
"j++",
"j",
"{\n\t \t\t\tfor(int ll=1;ll<=k;ll++) {\n\t \t\t\t\tgcd += gcd(i,gcd(ll,j));\n\t \t\t\t}\n\t \t\t}",
"{\n\t \t\t\tfor(int ll=1;ll<=k;ll++) {\n\t \t\t\t\tgcd += gcd(i,gcd(ll,j));\n\t \t\t\t}\n\t \t\t}",
"for(int ll=1;ll<=k;ll++) {\n\t \t\t\t\tgcd += gcd(i,gcd(ll,j));\n\t \t\t\t}",
"int ll=1;",
"int ll=1;",
"ll",
"1",
"ll<=k",
"ll",
"k",
"ll++",
"ll++",
"ll",
"{\n\t \t\t\t\tgcd += gcd(i,gcd(ll,j));\n\t \t\t\t}",
"{\n\t \t\t\t\tgcd += gcd(i,gcd(ll,j));\n\t \t\t\t}",
"gcd += gcd(i,gcd(ll,j))",
"gcd",
"gcd(i,gcd(ll,j))",
"gcd",
"i",
"gcd(ll,j)",
"gcd",
"ll",
"j",
"out.println(gcd)",
"out.println",
"out",
"gcd",
"out.close()",
"out.close",
"out",
"String args[]",
"args",
"static class InputReader\n\t {\n\t private final InputStream stream;\n\t private final byte[] buf = new byte[8192];\n\t private int curChar, snumChars;\n\t private SpaceCharFilter filter;\n\n\t public InputReader(InputStream stream)\n\t {\n\t this.stream = stream;\n\t }\n\n\t public int snext()\n\t {\n\t if (snumChars == -1)\n\t throw new InputMismatchException();\n\t if (curChar >= snumChars)\n\t {\n\t curChar = 0;\n\t try\n\t {\n\t snumChars = stream.read(buf);\n\t } catch (IOException e)\n\t {\n\t throw new InputMismatchException();\n\t }\n\t if (snumChars <= 0)\n\t return -1;\n\t }\n\t return buf[curChar++];\n\t }\n\n\t public int nextInt()\n\t {\n\t int c = snext();\n\t while (isSpaceChar(c))\n\t {\n\t c = snext();\n\t }\n\t int sgn = 1;\n\t if (c == '-')\n\t {\n\t sgn = -1;\n\t c = snext();\n\t }\n\t int res = 0;\n\t do\n\t {\n\t if (c < '0' || c > '9')\n\t throw new InputMismatchException();\n\t res *= 10;\n\t res += c - '0';\n\t c = snext();\n\t } while (!isSpaceChar(c));\n\t return res * sgn;\n\t }\n\n\t public long nextLong()\n\t {\n\t int c = snext();\n\t while (isSpaceChar(c))\n\t {\n\t c = snext();\n\t }\n\t int sgn = 1;\n\t if (c == '-')\n\t {\n\t sgn = -1;\n\t c = snext();\n\t }\n\t long res = 0;\n\t do\n\t {\n\t if (c < '0' || c > '9')\n\t throw new InputMismatchException();\n\t res *= 10;\n\t res += c - '0';\n\t c = snext();\n\t } while (!isSpaceChar(c));\n\t return res * sgn;\n\t }\n\n\t public int[] nextIntArray(int n)\n\t {\n\t int a[] = new int[n];\n\t for (int i = 0; i < n; i++)\n\t {\n\t a[i] = nextInt();\n\t }\n\t return a;\n\t }\n\n\t public long[] nextLongArray(int n)\n\t {\n\t long a[] = new long[n];\n\t for (int i = 0; i < n; i++)\n\t {\n\t a[i] = nextLong();\n\t }\n\t return a;\n\t }\n\t \n\t public ArrayList<Integer> nextArrayList(int n){\n\t \t\t\tArrayList<Integer> x = new ArrayList<Integer>();\n\t \t\t\tfor(int i=0;i<n;i++) {\n\t \t\t\t\tint v = in.nextInt();\n\t \t\t\t\tx.add(v);\n\t \t\t\t}\n\t \t\t\treturn x;\n\t }\n\n\t public String readString()\n\t {\n\t int c = snext();\n\t while (isSpaceChar(c))\n\t {\n\t c = snext();\n\t }\n\t StringBuilder res = new StringBuilder();\n\t do\n\t {\n\t res.appendCodePoint(c);\n\t c = snext();\n\t } while (!isSpaceChar(c));\n\t return res.toString();\n\t }\n\n\t public String nextLine()\n\t {\n\t int c = snext();\n\t while (isSpaceChar(c))\n\t c = snext();\n\t StringBuilder res = new StringBuilder();\n\t do\n\t {\n\t res.appendCodePoint(c);\n\t c = snext();\n\t } while (!isEndOfLine(c));\n\t return res.toString();\n\t }\n\n\t public boolean isSpaceChar(int c)\n\t {\n\t if (filter != null)\n\t return filter.isSpaceChar(c);\n\t return c == ' ' || c == '\\n' || c == '\\r' || c == '\\t' || c == -1;\n\t }\n\n\t private boolean isEndOfLine(int c)\n\t {\n\t return c == '\\n' || c == '\\r' || c == -1;\n\t }\n\n\t public interface SpaceCharFilter\n\t {\n\t public boolean isSpaceChar(int ch);\n\t }\n\n\t }",
"InputReader",
"private final InputStream stream;",
"stream",
"private final byte[] buf = new byte[8192];",
"buf",
"new byte[8192]",
"8192",
"private int curChar",
"curChar",
"snumChars;",
"snumChars",
"private SpaceCharFilter filter;",
"filter",
"public InputReader(InputStream stream)\n\t {\n\t this.stream = stream;\n\t }",
"InputReader",
"{\n\t this.stream = stream;\n\t }",
"this.stream = stream",
"this.stream",
"this",
"this.stream",
"stream",
"InputStream stream",
"stream",
"public int snext()\n\t {\n\t if (snumChars == -1)\n\t throw new InputMismatchException();\n\t if (curChar >= snumChars)\n\t {\n\t curChar = 0;\n\t try\n\t {\n\t snumChars = stream.read(buf);\n\t } catch (IOException e)\n\t {\n\t throw new InputMismatchException();\n\t }\n\t if (snumChars <= 0)\n\t return -1;\n\t }\n\t return buf[curChar++];\n\t }",
"snext",
"{\n\t if (snumChars == -1)\n\t throw new InputMismatchException();\n\t if (curChar >= snumChars)\n\t {\n\t curChar = 0;\n\t try\n\t {\n\t snumChars = stream.read(buf);\n\t } catch (IOException e)\n\t {\n\t throw new InputMismatchException();\n\t }\n\t if (snumChars <= 0)\n\t return -1;\n\t }\n\t return buf[curChar++];\n\t }",
"if (snumChars == -1)\n\t throw new InputMismatchException();",
"snumChars == -1",
"snumChars",
"-1",
"1",
"throw new InputMismatchException();",
"new InputMismatchException()",
"if (curChar >= snumChars)\n\t {\n\t curChar = 0;\n\t try\n\t {\n\t snumChars = stream.read(buf);\n\t } catch (IOException e)\n\t {\n\t throw new InputMismatchException();\n\t }\n\t if (snumChars <= 0)\n\t return -1;\n\t }",
"curChar >= snumChars",
"curChar",
"snumChars",
"{\n\t curChar = 0;\n\t try\n\t {\n\t snumChars = stream.read(buf);\n\t } catch (IOException e)\n\t {\n\t throw new InputMismatchException();\n\t }\n\t if (snumChars <= 0)\n\t return -1;\n\t }",
"curChar = 0",
"curChar",
"0",
"try\n\t {\n\t snumChars = stream.read(buf);\n\t } catch (IOException e)\n\t {\n\t throw new InputMismatchException();\n\t }",
"catch (IOException e)\n\t {\n\t throw new InputMismatchException();\n\t }",
"IOException e",
"{\n\t throw new InputMismatchException();\n\t }",
"throw new InputMismatchException();",
"new InputMismatchException()",
"{\n\t snumChars = stream.read(buf);\n\t }",
"snumChars = stream.read(buf)",
"snumChars",
"stream.read(buf)",
"stream.read",
"stream",
"buf",
"if (snumChars <= 0)\n\t return -1;",
"snumChars <= 0",
"snumChars",
"0",
"return -1;",
"-1",
"1",
"return buf[curChar++];",
"buf[curChar++]",
"buf",
"curChar++",
"curChar",
"public int nextInt()\n\t {\n\t int c = snext();\n\t while (isSpaceChar(c))\n\t {\n\t c = snext();\n\t }\n\t int sgn = 1;\n\t if (c == '-')\n\t {\n\t sgn = -1;\n\t c = snext();\n\t }\n\t int res = 0;\n\t do\n\t {\n\t if (c < '0' || c > '9')\n\t throw new InputMismatchException();\n\t res *= 10;\n\t res += c - '0';\n\t c = snext();\n\t } while (!isSpaceChar(c));\n\t return res * sgn;\n\t }",
"nextInt",
"{\n\t int c = snext();\n\t while (isSpaceChar(c))\n\t {\n\t c = snext();\n\t }\n\t int sgn = 1;\n\t if (c == '-')\n\t {\n\t sgn = -1;\n\t c = snext();\n\t }\n\t int res = 0;\n\t do\n\t {\n\t if (c < '0' || c > '9')\n\t throw new InputMismatchException();\n\t res *= 10;\n\t res += c - '0';\n\t c = snext();\n\t } while (!isSpaceChar(c));\n\t return res * sgn;\n\t }",
"int c = snext();",
"c",
"snext()",
"snext",
"while (isSpaceChar(c))\n\t {\n\t c = snext();\n\t }",
"isSpaceChar(c)",
"isSpaceChar",
"c",
"{\n\t c = snext();\n\t }",
"c = snext()",
"c",
"snext()",
"snext",
"int sgn = 1;",
"sgn",
"1",
"if (c == '-')\n\t {\n\t sgn = -1;\n\t c = snext();\n\t }",
"c == '-'",
"c",
"'-'",
"{\n\t sgn = -1;\n\t c = snext();\n\t }",
"sgn = -1",
"sgn",
"-1",
"1",
"c = snext()",
"c",
"snext()",
"snext",
"int res = 0;",
"res",
"0",
"do\n\t {\n\t if (c < '0' || c > '9')\n\t throw new InputMismatchException();\n\t res *= 10;\n\t res += c - '0';\n\t c = snext();\n\t } while (!isSpaceChar(c));",
"!isSpaceChar(c)",
"isSpaceChar(c)",
"isSpaceChar",
"c",
"{\n\t if (c < '0' || c > '9')\n\t throw new InputMismatchException();\n\t res *= 10;\n\t res += c - '0';\n\t c = snext();\n\t }",
"if (c < '0' || c > '9')\n\t throw new InputMismatchException();",
"c < '0' || c > '9'",
"c < '0'",
"c",
"'0'",
"c > '9'",
"c",
"'9'",
"throw new InputMismatchException();",
"new InputMismatchException()",
"res *= 10",
"res",
"10",
"res += c - '0'",
"res",
"c - '0'",
"c",
"'0'",
"c = snext()",
"c",
"snext()",
"snext",
"return res * sgn;",
"res * sgn",
"res",
"sgn",
"public long nextLong()\n\t {\n\t int c = snext();\n\t while (isSpaceChar(c))\n\t {\n\t c = snext();\n\t }\n\t int sgn = 1;\n\t if (c == '-')\n\t {\n\t sgn = -1;\n\t c = snext();\n\t }\n\t long res = 0;\n\t do\n\t {\n\t if (c < '0' || c > '9')\n\t throw new InputMismatchException();\n\t res *= 10;\n\t res += c - '0';\n\t c = snext();\n\t } while (!isSpaceChar(c));\n\t return res * sgn;\n\t }",
"nextLong",
"{\n\t int c = snext();\n\t while (isSpaceChar(c))\n\t {\n\t c = snext();\n\t }\n\t int sgn = 1;\n\t if (c == '-')\n\t {\n\t sgn = -1;\n\t c = snext();\n\t }\n\t long res = 0;\n\t do\n\t {\n\t if (c < '0' || c > '9')\n\t throw new InputMismatchException();\n\t res *= 10;\n\t res += c - '0';\n\t c = snext();\n\t } while (!isSpaceChar(c));\n\t return res * sgn;\n\t }",
"int c = snext();",
"c",
"snext()",
"snext",
"while (isSpaceChar(c))\n\t {\n\t c = snext();\n\t }",
"isSpaceChar(c)",
"isSpaceChar",
"c",
"{\n\t c = snext();\n\t }",
"c = snext()",
"c",
"snext()",
"snext",
"int sgn = 1;",
"sgn",
"1",
"if (c == '-')\n\t {\n\t sgn = -1;\n\t c = snext();\n\t }",
"c == '-'",
"c",
"'-'",
"{\n\t sgn = -1;\n\t c = snext();\n\t }",
"sgn = -1",
"sgn",
"-1",
"1",
"c = snext()",
"c",
"snext()",
"snext",
"long res = 0;",
"res",
"0",
"do\n\t {\n\t if (c < '0' || c > '9')\n\t throw new InputMismatchException();\n\t res *= 10;\n\t res += c - '0';\n\t c = snext();\n\t } while (!isSpaceChar(c));",
"!isSpaceChar(c)",
"isSpaceChar(c)",
"isSpaceChar",
"c",
"{\n\t if (c < '0' || c > '9')\n\t throw new InputMismatchException();\n\t res *= 10;\n\t res += c - '0';\n\t c = snext();\n\t }",
"if (c < '0' || c > '9')\n\t throw new InputMismatchException();",
"c < '0' || c > '9'",
"c < '0'",
"c",
"'0'",
"c > '9'",
"c",
"'9'",
"throw new InputMismatchException();",
"new InputMismatchException()",
"res *= 10",
"res",
"10",
"res += c - '0'",
"res",
"c - '0'",
"c",
"'0'",
"c = snext()",
"c",
"snext()",
"snext",
"return res * sgn;",
"res * sgn",
"res",
"sgn",
"public int[] nextIntArray(int n)\n\t {\n\t int a[] = new int[n];\n\t for (int i = 0; i < n; i++)\n\t {\n\t a[i] = nextInt();\n\t }\n\t return a;\n\t }",
"nextIntArray",
"{\n\t int a[] = new int[n];\n\t for (int i = 0; i < n; i++)\n\t {\n\t a[i] = nextInt();\n\t }\n\t return a;\n\t }",
"int a[] = new int[n];",
"a",
"new int[n]",
"n",
"for (int i = 0; i < n; i++)\n\t {\n\t a[i] = nextInt();\n\t }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < n",
"i",
"n",
"i++",
"i++",
"i",
"{\n\t a[i] = nextInt();\n\t }",
"{\n\t a[i] = nextInt();\n\t }",
"a[i] = nextInt()",
"a[i]",
"a",
"i",
"nextInt()",
"nextInt",
"return a;",
"a",
"int n",
"n",
"public long[] nextLongArray(int n)\n\t {\n\t long a[] = new long[n];\n\t for (int i = 0; i < n; i++)\n\t {\n\t a[i] = nextLong();\n\t }\n\t return a;\n\t }",
"nextLongArray",
"{\n\t long a[] = new long[n];\n\t for (int i = 0; i < n; i++)\n\t {\n\t a[i] = nextLong();\n\t }\n\t return a;\n\t }",
"long a[] = new long[n];",
"a",
"new long[n]",
"n",
"for (int i = 0; i < n; i++)\n\t {\n\t a[i] = nextLong();\n\t }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < n",
"i",
"n",
"i++",
"i++",
"i",
"{\n\t a[i] = nextLong();\n\t }",
"{\n\t a[i] = nextLong();\n\t }",
"a[i] = nextLong()",
"a[i]",
"a",
"i",
"nextLong()",
"nextLong",
"return a;",
"a",
"int n",
"n",
"public ArrayList<Integer> nextArrayList(int n){\n\t \t\t\tArrayList<Integer> x = new ArrayList<Integer>();\n\t \t\t\tfor(int i=0;i<n;i++) {\n\t \t\t\t\tint v = in.nextInt();\n\t \t\t\t\tx.add(v);\n\t \t\t\t}\n\t \t\t\treturn x;\n\t }",
"nextArrayList",
"{\n\t \t\t\tArrayList<Integer> x = new ArrayList<Integer>();\n\t \t\t\tfor(int i=0;i<n;i++) {\n\t \t\t\t\tint v = in.nextInt();\n\t \t\t\t\tx.add(v);\n\t \t\t\t}\n\t \t\t\treturn x;\n\t }",
"ArrayList<Integer> x = new ArrayList<Integer>();",
"x",
"new ArrayList<Integer>()",
"for(int i=0;i<n;i++) {\n\t \t\t\t\tint v = in.nextInt();\n\t \t\t\t\tx.add(v);\n\t \t\t\t}",
"int i=0;",
"int i=0;",
"i",
"0",
"i<n",
"i",
"n",
"i++",
"i++",
"i",
"{\n\t \t\t\t\tint v = in.nextInt();\n\t \t\t\t\tx.add(v);\n\t \t\t\t}",
"{\n\t \t\t\t\tint v = in.nextInt();\n\t \t\t\t\tx.add(v);\n\t \t\t\t}",
"int v = in.nextInt();",
"v",
"in.nextInt()",
"in.nextInt",
"in",
"x.add(v)",
"x.add",
"x",
"v",
"return x;",
"x",
"int n",
"n",
"public String readString()\n\t {\n\t int c = snext();\n\t while (isSpaceChar(c))\n\t {\n\t c = snext();\n\t }\n\t StringBuilder res = new StringBuilder();\n\t do\n\t {\n\t res.appendCodePoint(c);\n\t c = snext();\n\t } while (!isSpaceChar(c));\n\t return res.toString();\n\t }",
"readString",
"{\n\t int c = snext();\n\t while (isSpaceChar(c))\n\t {\n\t c = snext();\n\t }\n\t StringBuilder res = new StringBuilder();\n\t do\n\t {\n\t res.appendCodePoint(c);\n\t c = snext();\n\t } while (!isSpaceChar(c));\n\t return res.toString();\n\t }",
"int c = snext();",
"c",
"snext()",
"snext",
"while (isSpaceChar(c))\n\t {\n\t c = snext();\n\t }",
"isSpaceChar(c)",
"isSpaceChar",
"c",
"{\n\t c = snext();\n\t }",
"c = snext()",
"c",
"snext()",
"snext",
"StringBuilder res = new StringBuilder();",
"res",
"new StringBuilder()",
"do\n\t {\n\t res.appendCodePoint(c);\n\t c = snext();\n\t } while (!isSpaceChar(c));",
"!isSpaceChar(c)",
"isSpaceChar(c)",
"isSpaceChar",
"c",
"{\n\t res.appendCodePoint(c);\n\t c = snext();\n\t }",
"res.appendCodePoint(c)",
"res.appendCodePoint",
"res",
"c",
"c = snext()",
"c",
"snext()",
"snext",
"return res.toString();",
"res.toString()",
"res.toString",
"res",
"public String nextLine()\n\t {\n\t int c = snext();\n\t while (isSpaceChar(c))\n\t c = snext();\n\t StringBuilder res = new StringBuilder();\n\t do\n\t {\n\t res.appendCodePoint(c);\n\t c = snext();\n\t } while (!isEndOfLine(c));\n\t return res.toString();\n\t }",
"nextLine",
"{\n\t int c = snext();\n\t while (isSpaceChar(c))\n\t c = snext();\n\t StringBuilder res = new StringBuilder();\n\t do\n\t {\n\t res.appendCodePoint(c);\n\t c = snext();\n\t } while (!isEndOfLine(c));\n\t return res.toString();\n\t }",
"int c = snext();",
"c",
"snext()",
"snext",
"while (isSpaceChar(c))\n\t c = snext();",
"isSpaceChar(c)",
"isSpaceChar",
"c",
"c = snext()",
"c",
"snext()",
"snext",
"StringBuilder res = new StringBuilder();",
"res",
"new StringBuilder()",
"do\n\t {\n\t res.appendCodePoint(c);\n\t c = snext();\n\t } while (!isEndOfLine(c));",
"!isEndOfLine(c)",
"isEndOfLine(c)",
"isEndOfLine",
"c",
"{\n\t res.appendCodePoint(c);\n\t c = snext();\n\t }",
"res.appendCodePoint(c)",
"res.appendCodePoint",
"res",
"c",
"c = snext()",
"c",
"snext()",
"snext",
"return res.toString();",
"res.toString()",
"res.toString",
"res",
"public boolean isSpaceChar(int c)\n\t {\n\t if (filter != null)\n\t return filter.isSpaceChar(c);\n\t return c == ' ' || c == '\\n' || c == '\\r' || c == '\\t' || c == -1;\n\t }",
"isSpaceChar",
"{\n\t if (filter != null)\n\t return filter.isSpaceChar(c);\n\t return c == ' ' || c == '\\n' || c == '\\r' || c == '\\t' || c == -1;\n\t }",
"if (filter != null)\n\t return filter.isSpaceChar(c);",
"filter != null",
"filter",
"null",
"return filter.isSpaceChar(c);",
"filter.isSpaceChar(c)",
"filter.isSpaceChar",
"filter",
"c",
"return c == ' ' || c == '\\n' || c == '\\r' || c == '\\t' || c == -1;",
"c == ' ' || c == '\\n' || c == '\\r' || c == '\\t' || c == -1",
"c == '\\t'",
"c == '\\r'",
"c == ' ' || c == '\\n' || c == '\\r' || c == '\\t' || c == -1",
"c == ' '",
"c",
"' '",
"c == '\\n'",
"c",
"'\\n'",
"c == '\\r'",
"c",
"'\\r'",
"c == '\\t'",
"c",
"'\\t'",
"c == -1",
"c",
"-1",
"1",
"int c",
"c",
"private boolean isEndOfLine(int c)\n\t {\n\t return c == '\\n' || c == '\\r' || c == -1;\n\t }",
"isEndOfLine",
"{\n\t return c == '\\n' || c == '\\r' || c == -1;\n\t }",
"return c == '\\n' || c == '\\r' || c == -1;",
"c == '\\n' || c == '\\r' || c == -1",
"c == '\\n' || c == '\\r' || c == -1",
"c == '\\n'",
"c",
"'\\n'",
"c == '\\r'",
"c",
"'\\r'",
"c == -1",
"c",
"-1",
"1",
"int c",
"c",
"public interface SpaceCharFilter\n\t {\n\t public boolean isSpaceChar(int ch);\n\t }",
"SpaceCharFilter",
"public boolean isSpaceChar(int ch);",
"isSpaceChar",
"int ch",
"ch",
"static class Debugger{\n\t\t\tpublic void n(int x) {\n\t\t\t\tout.println(x);\n\t\t\t}\n\t\t\t\n\t\t\tpublic void a(int[] a) {\n\t\t StringBuilder sb = new StringBuilder();\n\t\t for(int i=0;i<a.length;i++) {\n\t\t \t\tsb.append(a[i]+\" \");\n\t\t }\n\t\t out.println(sb.toString());\n\t\t\t}\n\t\t}",
"Debugger",
"public void n(int x) {\n\t\t\t\tout.println(x);\n\t\t\t}",
"n",
"{\n\t\t\t\tout.println(x);\n\t\t\t}",
"out.println(x)",
"out.println",
"out",
"x",
"int x",
"x",
"public void a(int[] a) {\n\t\t StringBuilder sb = new StringBuilder();\n\t\t for(int i=0;i<a.length;i++) {\n\t\t \t\tsb.append(a[i]+\" \");\n\t\t }\n\t\t out.println(sb.toString());\n\t\t\t}",
"a",
"{\n\t\t StringBuilder sb = new StringBuilder();\n\t\t for(int i=0;i<a.length;i++) {\n\t\t \t\tsb.append(a[i]+\" \");\n\t\t }\n\t\t out.println(sb.toString());\n\t\t\t}",
"StringBuilder sb = new StringBuilder();",
"sb",
"new StringBuilder()",
"for(int i=0;i<a.length;i++) {\n\t\t \t\tsb.append(a[i]+\" \");\n\t\t }",
"int i=0;",
"int i=0;",
"i",
"0",
"i<a.length",
"i",
"a.length",
"a",
"a.length",
"i++",
"i++",
"i",
"{\n\t\t \t\tsb.append(a[i]+\" \");\n\t\t }",
"{\n\t\t \t\tsb.append(a[i]+\" \");\n\t\t }",
"sb.append(a[i]+\" \")",
"sb.append",
"sb",
"a[i]+\" \"",
"a[i]",
"a",
"i",
"\" \"",
"out.println(sb.toString())",
"out.println",
"out",
"sb.toString()",
"sb.toString",
"sb",
"int[] a",
"a",
"class Pairx {\n\tPair a;\n\tint b;\n\tpublic Pairx(Pair a,int b) {\n\t\tthis.a =a;\n\t\tthis.b =b;\n\t}\n\t@Override\n\tpublic boolean equals(Object o) {\n\t if (this == o) return true;\n\t if (!(o instanceof Pairx)) return false;\n\t Pairx p = (Pairx) o;\n\t return b == p.b;\n\t}\n\tpublic int compareTo(Pairx that) {\n\t\treturn (int)(this.a.x - that.a.x);\n\t}\n}",
"Pairx",
"Pair a;",
"a",
"int b;",
"b",
"public Pairx(Pair a,int b) {\n\t\tthis.a =a;\n\t\tthis.b =b;\n\t}",
"Pairx",
"{\n\t\tthis.a =a;\n\t\tthis.b =b;\n\t}",
"this.a =a",
"this.a",
"this",
"this.a",
"a",
"this.b =b",
"this.b",
"this",
"this.b",
"b",
"Pair a",
"a",
"int b",
"b",
"@Override\n\tpublic boolean equals(Object o) {\n\t if (this == o) return true;\n\t if (!(o instanceof Pairx)) return false;\n\t Pairx p = (Pairx) o;\n\t return b == p.b;\n\t}",
"equals",
"{\n\t if (this == o) return true;\n\t if (!(o instanceof Pairx)) return false;\n\t Pairx p = (Pairx) o;\n\t return b == p.b;\n\t}",
"if (this == o) return true;",
"this == o",
"this",
"o",
"return true;",
"true",
"if (!(o instanceof Pairx)) return false;",
"!(o instanceof Pairx)",
"(o instanceof Pairx)",
"o",
"Pairx",
"return false;",
"false",
"Pairx p = (Pairx) o;",
"p",
"(Pairx) o",
"return b == p.b;",
"b == p.b",
"b",
"p.b",
"p",
"p.b",
"Object o",
"o",
"public int compareTo(Pairx that) {\n\t\treturn (int)(this.a.x - that.a.x);\n\t}",
"compareTo",
"{\n\t\treturn (int)(this.a.x - that.a.x);\n\t}",
"return (int)(this.a.x - that.a.x);",
"(int)(this.a.x - that.a.x)",
"this.a.x",
"this.a",
"this",
"this.a",
"this.a.x",
"that.a.x",
"that.a",
"that",
"that.a",
"that.a.x",
"Pairx that",
"that",
" class Pair { \n int x; \n int y; \n \n // Constructor \n public Pair(int x, int y) \n { \n this.x = x; \n this.y = y; \n } \n\t@Override\n\tpublic boolean equals(Object o) {\n\t if (this == o) return true;\n\t if (!(o instanceof Pair)) return false;\n\t Pair p = (Pair) o;\n\t return x == p.x && y == p.y;\n\t}\n}",
"Pair",
"int x;",
"x",
"int y;",
"y",
"// Constructor \n public Pair(int x, int y) \n { \n this.x = x; \n this.y = y; \n }",
"Pair",
"{ \n this.x = x; \n this.y = y; \n }",
"this.x = x",
"this.x",
"this",
"this.x",
"x",
"this.y = y",
"this.y",
"this",
"this.y",
"y",
"int x",
"x",
"int y",
"y",
"@Override\n\tpublic boolean equals(Object o) {\n\t if (this == o) return true;\n\t if (!(o instanceof Pair)) return false;\n\t Pair p = (Pair) o;\n\t return x == p.x && y == p.y;\n\t}",
"equals",
"{\n\t if (this == o) return true;\n\t if (!(o instanceof Pair)) return false;\n\t Pair p = (Pair) o;\n\t return x == p.x && y == p.y;\n\t}",
"if (this == o) return true;",
"this == o",
"this",
"o",
"return true;",
"true",
"if (!(o instanceof Pair)) return false;",
"!(o instanceof Pair)",
"(o instanceof Pair)",
"o",
"Pair",
"return false;",
"false",
"Pair p = (Pair) o;",
"p",
"(Pair) o",
"return x == p.x && y == p.y;",
"x == p.x && y == p.y",
"x == p.x",
"x",
"p.x",
"p",
"p.x",
"y == p.y",
"y",
"p.y",
"p",
"p.y",
"Object o",
"o",
"class couple implements Comparable<couple>\n{ int x,y;\n public couple(int m,int f) {\n \t x=m;\n \t y=f;\n }\n\tpublic int compareTo(couple o) {\n\t\t\n\t\t \n\t\treturn x-o.x;\n\t} \n}",
"couple",
"int x",
"x",
"y;",
"y",
"public couple(int m,int f) {\n \t x=m;\n \t y=f;\n }",
"couple",
"{\n \t x=m;\n \t y=f;\n }",
"x=m",
"x",
"m",
"y=f",
"y",
"f",
"int m",
"m",
"int f",
"f",
"public int compareTo(couple o) {\n\t\t\n\t\t \n\t\treturn x-o.x;\n\t}",
"compareTo",
"{\n\t\t\n\t\t \n\t\treturn x-o.x;\n\t}",
"return x-o.x;",
"x-o.x",
"x",
"o.x",
"o",
"o.x",
"couple o",
"o",
"Comparable",
"public class Main {\n\tstatic int mod = (int) (1e9+7);\n\tstatic long N = (long)(2*1e5);\n\tstatic InputReader in;\n static PrintWriter out;\n static Debugger deb;\n \n public static int lower_bound(int[] a,int k) { // no. of elements less than k in array.\n \t\tint first = 0,last = a.length,mid;\n while (first < last) {\n mid = first + ((last - first) >> 1); \n if (a[mid] < k) //lower bound. for upper use <= ( n - first)\n first = mid + 1; \n else \n last = mid;\n }\n \t\treturn first;\n }\n \n public static int gcd(int a, int b){ \n\t if (a == 0) \n\t return b; \n\t return gcd(b % a, a); \n } \n \n public static char chk(char n) {\n \t\t\n \t\tif(n=='1') {\n \t\t\treturn '2';\n \t\t}\n \t\treturn '1';\n }\n \n\tpublic static void main(String args[] ) throws NumberFormatException, IOException {\n\t\t\t\n\t\tin = new InputReader(System.in);\n\t out = new PrintWriter(System.out);\n\t deb = new Debugger();\n\t \n\t int k = in.nextInt();\n\t \n\t int gcd =0;\n\t for(int i=1;i<=k;i++) {\n\t \t\tfor(int j=1;j<=k;j++) {\n\t \t\t\tfor(int ll=1;ll<=k;ll++) {\n\t \t\t\t\tgcd += gcd(i,gcd(ll,j));\n\t \t\t\t}\n\t \t\t}\n\t }\n\t \n\t out.println(gcd);\n\t out.close();\n\t}\n\t\t\n/* TC space\n\n\n\n */\n\t\t\n\t\tstatic class InputReader\n\t {\n\t private final InputStream stream;\n\t private final byte[] buf = new byte[8192];\n\t private int curChar, snumChars;\n\t private SpaceCharFilter filter;\n\n\t public InputReader(InputStream stream)\n\t {\n\t this.stream = stream;\n\t }\n\n\t public int snext()\n\t {\n\t if (snumChars == -1)\n\t throw new InputMismatchException();\n\t if (curChar >= snumChars)\n\t {\n\t curChar = 0;\n\t try\n\t {\n\t snumChars = stream.read(buf);\n\t } catch (IOException e)\n\t {\n\t throw new InputMismatchException();\n\t }\n\t if (snumChars <= 0)\n\t return -1;\n\t }\n\t return buf[curChar++];\n\t }\n\n\t public int nextInt()\n\t {\n\t int c = snext();\n\t while (isSpaceChar(c))\n\t {\n\t c = snext();\n\t }\n\t int sgn = 1;\n\t if (c == '-')\n\t {\n\t sgn = -1;\n\t c = snext();\n\t }\n\t int res = 0;\n\t do\n\t {\n\t if (c < '0' || c > '9')\n\t throw new InputMismatchException();\n\t res *= 10;\n\t res += c - '0';\n\t c = snext();\n\t } while (!isSpaceChar(c));\n\t return res * sgn;\n\t }\n\n\t public long nextLong()\n\t {\n\t int c = snext();\n\t while (isSpaceChar(c))\n\t {\n\t c = snext();\n\t }\n\t int sgn = 1;\n\t if (c == '-')\n\t {\n\t sgn = -1;\n\t c = snext();\n\t }\n\t long res = 0;\n\t do\n\t {\n\t if (c < '0' || c > '9')\n\t throw new InputMismatchException();\n\t res *= 10;\n\t res += c - '0';\n\t c = snext();\n\t } while (!isSpaceChar(c));\n\t return res * sgn;\n\t }\n\n\t public int[] nextIntArray(int n)\n\t {\n\t int a[] = new int[n];\n\t for (int i = 0; i < n; i++)\n\t {\n\t a[i] = nextInt();\n\t }\n\t return a;\n\t }\n\n\t public long[] nextLongArray(int n)\n\t {\n\t long a[] = new long[n];\n\t for (int i = 0; i < n; i++)\n\t {\n\t a[i] = nextLong();\n\t }\n\t return a;\n\t }\n\t \n\t public ArrayList<Integer> nextArrayList(int n){\n\t \t\t\tArrayList<Integer> x = new ArrayList<Integer>();\n\t \t\t\tfor(int i=0;i<n;i++) {\n\t \t\t\t\tint v = in.nextInt();\n\t \t\t\t\tx.add(v);\n\t \t\t\t}\n\t \t\t\treturn x;\n\t }\n\n\t public String readString()\n\t {\n\t int c = snext();\n\t while (isSpaceChar(c))\n\t {\n\t c = snext();\n\t }\n\t StringBuilder res = new StringBuilder();\n\t do\n\t {\n\t res.appendCodePoint(c);\n\t c = snext();\n\t } while (!isSpaceChar(c));\n\t return res.toString();\n\t }\n\n\t public String nextLine()\n\t {\n\t int c = snext();\n\t while (isSpaceChar(c))\n\t c = snext();\n\t StringBuilder res = new StringBuilder();\n\t do\n\t {\n\t res.appendCodePoint(c);\n\t c = snext();\n\t } while (!isEndOfLine(c));\n\t return res.toString();\n\t }\n\n\t public boolean isSpaceChar(int c)\n\t {\n\t if (filter != null)\n\t return filter.isSpaceChar(c);\n\t return c == ' ' || c == '\\n' || c == '\\r' || c == '\\t' || c == -1;\n\t }\n\n\t private boolean isEndOfLine(int c)\n\t {\n\t return c == '\\n' || c == '\\r' || c == -1;\n\t }\n\n\t public interface SpaceCharFilter\n\t {\n\t public boolean isSpaceChar(int ch);\n\t }\n\n\t }\n\t\t\n\t\tstatic class Debugger{\n\t\t\tpublic void n(int x) {\n\t\t\t\tout.println(x);\n\t\t\t}\n\t\t\t\n\t\t\tpublic void a(int[] a) {\n\t\t StringBuilder sb = new StringBuilder();\n\t\t for(int i=0;i<a.length;i++) {\n\t\t \t\tsb.append(a[i]+\" \");\n\t\t }\n\t\t out.println(sb.toString());\n\t\t\t}\n\t\t}\n\t\t\n}",
"public class Main {\n\tstatic int mod = (int) (1e9+7);\n\tstatic long N = (long)(2*1e5);\n\tstatic InputReader in;\n static PrintWriter out;\n static Debugger deb;\n \n public static int lower_bound(int[] a,int k) { // no. of elements less than k in array.\n \t\tint first = 0,last = a.length,mid;\n while (first < last) {\n mid = first + ((last - first) >> 1); \n if (a[mid] < k) //lower bound. for upper use <= ( n - first)\n first = mid + 1; \n else \n last = mid;\n }\n \t\treturn first;\n }\n \n public static int gcd(int a, int b){ \n\t if (a == 0) \n\t return b; \n\t return gcd(b % a, a); \n } \n \n public static char chk(char n) {\n \t\t\n \t\tif(n=='1') {\n \t\t\treturn '2';\n \t\t}\n \t\treturn '1';\n }\n \n\tpublic static void main(String args[] ) throws NumberFormatException, IOException {\n\t\t\t\n\t\tin = new InputReader(System.in);\n\t out = new PrintWriter(System.out);\n\t deb = new Debugger();\n\t \n\t int k = in.nextInt();\n\t \n\t int gcd =0;\n\t for(int i=1;i<=k;i++) {\n\t \t\tfor(int j=1;j<=k;j++) {\n\t \t\t\tfor(int ll=1;ll<=k;ll++) {\n\t \t\t\t\tgcd += gcd(i,gcd(ll,j));\n\t \t\t\t}\n\t \t\t}\n\t }\n\t \n\t out.println(gcd);\n\t out.close();\n\t}\n\t\t\n/* TC space\n\n\n\n */\n\t\t\n\t\tstatic class InputReader\n\t {\n\t private final InputStream stream;\n\t private final byte[] buf = new byte[8192];\n\t private int curChar, snumChars;\n\t private SpaceCharFilter filter;\n\n\t public InputReader(InputStream stream)\n\t {\n\t this.stream = stream;\n\t }\n\n\t public int snext()\n\t {\n\t if (snumChars == -1)\n\t throw new InputMismatchException();\n\t if (curChar >= snumChars)\n\t {\n\t curChar = 0;\n\t try\n\t {\n\t snumChars = stream.read(buf);\n\t } catch (IOException e)\n\t {\n\t throw new InputMismatchException();\n\t }\n\t if (snumChars <= 0)\n\t return -1;\n\t }\n\t return buf[curChar++];\n\t }\n\n\t public int nextInt()\n\t {\n\t int c = snext();\n\t while (isSpaceChar(c))\n\t {\n\t c = snext();\n\t }\n\t int sgn = 1;\n\t if (c == '-')\n\t {\n\t sgn = -1;\n\t c = snext();\n\t }\n\t int res = 0;\n\t do\n\t {\n\t if (c < '0' || c > '9')\n\t throw new InputMismatchException();\n\t res *= 10;\n\t res += c - '0';\n\t c = snext();\n\t } while (!isSpaceChar(c));\n\t return res * sgn;\n\t }\n\n\t public long nextLong()\n\t {\n\t int c = snext();\n\t while (isSpaceChar(c))\n\t {\n\t c = snext();\n\t }\n\t int sgn = 1;\n\t if (c == '-')\n\t {\n\t sgn = -1;\n\t c = snext();\n\t }\n\t long res = 0;\n\t do\n\t {\n\t if (c < '0' || c > '9')\n\t throw new InputMismatchException();\n\t res *= 10;\n\t res += c - '0';\n\t c = snext();\n\t } while (!isSpaceChar(c));\n\t return res * sgn;\n\t }\n\n\t public int[] nextIntArray(int n)\n\t {\n\t int a[] = new int[n];\n\t for (int i = 0; i < n; i++)\n\t {\n\t a[i] = nextInt();\n\t }\n\t return a;\n\t }\n\n\t public long[] nextLongArray(int n)\n\t {\n\t long a[] = new long[n];\n\t for (int i = 0; i < n; i++)\n\t {\n\t a[i] = nextLong();\n\t }\n\t return a;\n\t }\n\t \n\t public ArrayList<Integer> nextArrayList(int n){\n\t \t\t\tArrayList<Integer> x = new ArrayList<Integer>();\n\t \t\t\tfor(int i=0;i<n;i++) {\n\t \t\t\t\tint v = in.nextInt();\n\t \t\t\t\tx.add(v);\n\t \t\t\t}\n\t \t\t\treturn x;\n\t }\n\n\t public String readString()\n\t {\n\t int c = snext();\n\t while (isSpaceChar(c))\n\t {\n\t c = snext();\n\t }\n\t StringBuilder res = new StringBuilder();\n\t do\n\t {\n\t res.appendCodePoint(c);\n\t c = snext();\n\t } while (!isSpaceChar(c));\n\t return res.toString();\n\t }\n\n\t public String nextLine()\n\t {\n\t int c = snext();\n\t while (isSpaceChar(c))\n\t c = snext();\n\t StringBuilder res = new StringBuilder();\n\t do\n\t {\n\t res.appendCodePoint(c);\n\t c = snext();\n\t } while (!isEndOfLine(c));\n\t return res.toString();\n\t }\n\n\t public boolean isSpaceChar(int c)\n\t {\n\t if (filter != null)\n\t return filter.isSpaceChar(c);\n\t return c == ' ' || c == '\\n' || c == '\\r' || c == '\\t' || c == -1;\n\t }\n\n\t private boolean isEndOfLine(int c)\n\t {\n\t return c == '\\n' || c == '\\r' || c == -1;\n\t }\n\n\t public interface SpaceCharFilter\n\t {\n\t public boolean isSpaceChar(int ch);\n\t }\n\n\t }\n\t\t\n\t\tstatic class Debugger{\n\t\t\tpublic void n(int x) {\n\t\t\t\tout.println(x);\n\t\t\t}\n\t\t\t\n\t\t\tpublic void a(int[] a) {\n\t\t StringBuilder sb = new StringBuilder();\n\t\t for(int i=0;i<a.length;i++) {\n\t\t \t\tsb.append(a[i]+\" \");\n\t\t }\n\t\t out.println(sb.toString());\n\t\t\t}\n\t\t}\n\t\t\n}",
"Main"
] |
import java.io.*;
import java.math.BigInteger;
import java.util.*;
import java.math.*;
//Mann Shah [ DAIICT ].
//fast io
public class Main {
static int mod = (int) (1e9+7);
static long N = (long)(2*1e5);
static InputReader in;
static PrintWriter out;
static Debugger deb;
public static int lower_bound(int[] a,int k) { // no. of elements less than k in array.
int first = 0,last = a.length,mid;
while (first < last) {
mid = first + ((last - first) >> 1);
if (a[mid] < k) //lower bound. for upper use <= ( n - first)
first = mid + 1;
else
last = mid;
}
return first;
}
public static int gcd(int a, int b){
if (a == 0)
return b;
return gcd(b % a, a);
}
public static char chk(char n) {
if(n=='1') {
return '2';
}
return '1';
}
public static void main(String args[] ) throws NumberFormatException, IOException {
in = new InputReader(System.in);
out = new PrintWriter(System.out);
deb = new Debugger();
int k = in.nextInt();
int gcd =0;
for(int i=1;i<=k;i++) {
for(int j=1;j<=k;j++) {
for(int ll=1;ll<=k;ll++) {
gcd += gcd(i,gcd(ll,j));
}
}
}
out.println(gcd);
out.close();
}
/* TC space
*/
static class InputReader
{
private final InputStream stream;
private final byte[] buf = new byte[8192];
private int curChar, snumChars;
private SpaceCharFilter filter;
public InputReader(InputStream stream)
{
this.stream = stream;
}
public int snext()
{
if (snumChars == -1)
throw new InputMismatchException();
if (curChar >= snumChars)
{
curChar = 0;
try
{
snumChars = stream.read(buf);
} catch (IOException e)
{
throw new InputMismatchException();
}
if (snumChars <= 0)
return -1;
}
return buf[curChar++];
}
public int nextInt()
{
int c = snext();
while (isSpaceChar(c))
{
c = snext();
}
int sgn = 1;
if (c == '-')
{
sgn = -1;
c = snext();
}
int res = 0;
do
{
if (c < '0' || c > '9')
throw new InputMismatchException();
res *= 10;
res += c - '0';
c = snext();
} while (!isSpaceChar(c));
return res * sgn;
}
public long nextLong()
{
int c = snext();
while (isSpaceChar(c))
{
c = snext();
}
int sgn = 1;
if (c == '-')
{
sgn = -1;
c = snext();
}
long res = 0;
do
{
if (c < '0' || c > '9')
throw new InputMismatchException();
res *= 10;
res += c - '0';
c = snext();
} while (!isSpaceChar(c));
return res * sgn;
}
public int[] nextIntArray(int n)
{
int a[] = new int[n];
for (int i = 0; i < n; i++)
{
a[i] = nextInt();
}
return a;
}
public long[] nextLongArray(int n)
{
long a[] = new long[n];
for (int i = 0; i < n; i++)
{
a[i] = nextLong();
}
return a;
}
public ArrayList<Integer> nextArrayList(int n){
ArrayList<Integer> x = new ArrayList<Integer>();
for(int i=0;i<n;i++) {
int v = in.nextInt();
x.add(v);
}
return x;
}
public String readString()
{
int c = snext();
while (isSpaceChar(c))
{
c = snext();
}
StringBuilder res = new StringBuilder();
do
{
res.appendCodePoint(c);
c = snext();
} while (!isSpaceChar(c));
return res.toString();
}
public String nextLine()
{
int c = snext();
while (isSpaceChar(c))
c = snext();
StringBuilder res = new StringBuilder();
do
{
res.appendCodePoint(c);
c = snext();
} while (!isEndOfLine(c));
return res.toString();
}
public boolean isSpaceChar(int c)
{
if (filter != null)
return filter.isSpaceChar(c);
return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
}
private boolean isEndOfLine(int c)
{
return c == '\n' || c == '\r' || c == -1;
}
public interface SpaceCharFilter
{
public boolean isSpaceChar(int ch);
}
}
static class Debugger{
public void n(int x) {
out.println(x);
}
public void a(int[] a) {
StringBuilder sb = new StringBuilder();
for(int i=0;i<a.length;i++) {
sb.append(a[i]+" ");
}
out.println(sb.toString());
}
}
}
class Pairx {
Pair a;
int b;
public Pairx(Pair a,int b) {
this.a =a;
this.b =b;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (!(o instanceof Pairx)) return false;
Pairx p = (Pairx) o;
return b == p.b;
}
public int compareTo(Pairx that) {
return (int)(this.a.x - that.a.x);
}
}
//Pair arr[] = new Pair[n];
//arr[0] = new Pair(10, 20);
class Pair {
int x;
int y;
// Constructor
public Pair(int x, int y)
{
this.x = x;
this.y = y;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (!(o instanceof Pair)) return false;
Pair p = (Pair) o;
return x == p.x && y == p.y;
}
}
// class Compare {
// //void return by default.
// static Pair[] compare(Pair arr[], int n)
// {
// (p1,p2) -> p1.x-p2.x Using lembda function...
// // Comparator to sort the pair according to first element.
// Arrays.sort(arr, new Comparator<Pair>() {
// @Override public int compare(Pair p1, Pair p2)
// {
// return p1.x - p2.x;
// }
// });
//
// return arr;
// }
//}
class couple implements Comparable<couple>
{ int x,y;
public couple(int m,int f) {
x=m;
y=f;
}
public int compareTo(couple o) {
return x-o.x;
}
}
|
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
14,
2,
2,
13,
13,
17,
29,
13,
29,
4,
13,
13,
2,
13,
13,
23,
13,
23,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
41,
13,
4,
13,
4,
18,
13,
13,
13,
4,
18,
13,
13,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
4,
13,
4,
18,
13,
13,
13,
4,
18,
13,
13,
13,
4,
18,
18,
13,
13,
13,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
118,
5
],
[
118,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
10,
11
],
[
11,
12
],
[
11,
13
],
[
10,
14
],
[
9,
15
],
[
15,
16
],
[
8,
17
],
[
17,
18
],
[
18,
19
],
[
18,
20
],
[
18,
21
],
[
21,
22
],
[
21,
23
],
[
6,
24
],
[
24,
25
],
[
6,
26
],
[
26,
27
],
[
118,
28
],
[
28,
29
],
[
28,
30
],
[
30,
31
],
[
31,
32
],
[
31,
33
],
[
30,
34
],
[
34,
35
],
[
34,
36
],
[
36,
37
],
[
37,
38
],
[
30,
39
],
[
39,
40
],
[
39,
41
],
[
30,
42
],
[
42,
43
],
[
43,
44
],
[
44,
45
],
[
44,
46
],
[
42,
47
],
[
47,
48
],
[
47,
49
],
[
42,
50
],
[
50,
51
],
[
51,
52
],
[
42,
53
],
[
54,
54
],
[
54,
55
],
[
55,
56
],
[
56,
57
],
[
57,
58
],
[
57,
59
],
[
55,
60
],
[
60,
61
],
[
60,
62
],
[
55,
63
],
[
63,
64
],
[
64,
65
],
[
55,
66
],
[
67,
67
],
[
67,
68
],
[
68,
69
],
[
68,
70
],
[
70,
71
],
[
70,
72
],
[
72,
73
],
[
73,
74
],
[
72,
75
],
[
72,
76
],
[
70,
77
],
[
77,
78
],
[
78,
79
],
[
77,
80
],
[
77,
81
],
[
67,
82
],
[
82,
83
],
[
83,
84
],
[
84,
85
],
[
84,
86
],
[
82,
87
],
[
87,
88
],
[
87,
89
],
[
82,
90
],
[
90,
91
],
[
91,
92
],
[
82,
93
],
[
94,
94
],
[
94,
95
],
[
95,
96
],
[
95,
97
],
[
97,
98
],
[
97,
99
],
[
99,
100
],
[
100,
101
],
[
99,
102
],
[
99,
103
],
[
97,
104
],
[
104,
105
],
[
105,
106
],
[
104,
107
],
[
104,
108
],
[
30,
109
],
[
109,
110
],
[
110,
111
],
[
111,
112
],
[
111,
113
],
[
109,
114
],
[
28,
115
],
[
115,
116
],
[
0,
117
],
[
117,
118
],
[
117,
119
]
] |
[
"import java.util.*;\n\npublic class Main{\n\n public static int gcd(int a,int b){\n if(a%b==0) return b;\n return gcd(b,a%b);\n }\n\n public static void main(String[] args)throws Exception{\n Scanner sc = new Scanner(System.in);\n int k=sc.nextInt();\n long total=0;\n for(int i=1;i<=k;i++){\n for(int j=1;j<=k;j++){\n int g=gcd((int)Math.max(i,j),(int)Math.min(i,j));\n for(int l=1;l<=k;l++){\n total+=gcd((int)Math.max(g,l),(int)Math.min(g,l));\n }\n }\n }\n System.out.println(total);\n }\n}",
"import java.util.*;",
"util.*",
"java",
"public class Main{\n\n public static int gcd(int a,int b){\n if(a%b==0) return b;\n return gcd(b,a%b);\n }\n\n public static void main(String[] args)throws Exception{\n Scanner sc = new Scanner(System.in);\n int k=sc.nextInt();\n long total=0;\n for(int i=1;i<=k;i++){\n for(int j=1;j<=k;j++){\n int g=gcd((int)Math.max(i,j),(int)Math.min(i,j));\n for(int l=1;l<=k;l++){\n total+=gcd((int)Math.max(g,l),(int)Math.min(g,l));\n }\n }\n }\n System.out.println(total);\n }\n}",
"Main",
"public static int gcd(int a,int b){\n if(a%b==0) return b;\n return gcd(b,a%b);\n }",
"gcd",
"{\n if(a%b==0) return b;\n return gcd(b,a%b);\n }",
"if(a%b==0) return b;",
"a%b==0",
"a%b",
"a",
"b",
"0",
"return b;",
"b",
"return gcd(b,a%b);",
"gcd(b,a%b)",
"gcd",
"b",
"a%b",
"a",
"b",
"int a",
"a",
"int b",
"b",
"public static void main(String[] args)throws Exception{\n Scanner sc = new Scanner(System.in);\n int k=sc.nextInt();\n long total=0;\n for(int i=1;i<=k;i++){\n for(int j=1;j<=k;j++){\n int g=gcd((int)Math.max(i,j),(int)Math.min(i,j));\n for(int l=1;l<=k;l++){\n total+=gcd((int)Math.max(g,l),(int)Math.min(g,l));\n }\n }\n }\n System.out.println(total);\n }",
"main",
"{\n Scanner sc = new Scanner(System.in);\n int k=sc.nextInt();\n long total=0;\n for(int i=1;i<=k;i++){\n for(int j=1;j<=k;j++){\n int g=gcd((int)Math.max(i,j),(int)Math.min(i,j));\n for(int l=1;l<=k;l++){\n total+=gcd((int)Math.max(g,l),(int)Math.min(g,l));\n }\n }\n }\n System.out.println(total);\n }",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"int k=sc.nextInt();",
"k",
"sc.nextInt()",
"sc.nextInt",
"sc",
"long total=0;",
"total",
"0",
"for(int i=1;i<=k;i++){\n for(int j=1;j<=k;j++){\n int g=gcd((int)Math.max(i,j),(int)Math.min(i,j));\n for(int l=1;l<=k;l++){\n total+=gcd((int)Math.max(g,l),(int)Math.min(g,l));\n }\n }\n }",
"int i=1;",
"int i=1;",
"i",
"1",
"i<=k",
"i",
"k",
"i++",
"i++",
"i",
"{\n for(int j=1;j<=k;j++){\n int g=gcd((int)Math.max(i,j),(int)Math.min(i,j));\n for(int l=1;l<=k;l++){\n total+=gcd((int)Math.max(g,l),(int)Math.min(g,l));\n }\n }\n }",
"{\n for(int j=1;j<=k;j++){\n int g=gcd((int)Math.max(i,j),(int)Math.min(i,j));\n for(int l=1;l<=k;l++){\n total+=gcd((int)Math.max(g,l),(int)Math.min(g,l));\n }\n }\n }",
"for(int j=1;j<=k;j++){\n int g=gcd((int)Math.max(i,j),(int)Math.min(i,j));\n for(int l=1;l<=k;l++){\n total+=gcd((int)Math.max(g,l),(int)Math.min(g,l));\n }\n }",
"int j=1;",
"int j=1;",
"j",
"1",
"j<=k",
"j",
"k",
"j++",
"j++",
"j",
"{\n int g=gcd((int)Math.max(i,j),(int)Math.min(i,j));\n for(int l=1;l<=k;l++){\n total+=gcd((int)Math.max(g,l),(int)Math.min(g,l));\n }\n }",
"{\n int g=gcd((int)Math.max(i,j),(int)Math.min(i,j));\n for(int l=1;l<=k;l++){\n total+=gcd((int)Math.max(g,l),(int)Math.min(g,l));\n }\n }",
"int g=gcd((int)Math.max(i,j),(int)Math.min(i,j));",
"g",
"gcd((int)Math.max(i,j),(int)Math.min(i,j))",
"gcd",
"(int)Math.max(i,j)",
"Math.max",
"Math",
"i",
"j",
"(int)Math.min(i,j)",
"Math.min",
"Math",
"i",
"j",
"for(int l=1;l<=k;l++){\n total+=gcd((int)Math.max(g,l),(int)Math.min(g,l));\n }",
"int l=1;",
"int l=1;",
"l",
"1",
"l<=k",
"l",
"k",
"l++",
"l++",
"l",
"{\n total+=gcd((int)Math.max(g,l),(int)Math.min(g,l));\n }",
"{\n total+=gcd((int)Math.max(g,l),(int)Math.min(g,l));\n }",
"total+=gcd((int)Math.max(g,l),(int)Math.min(g,l))",
"total",
"gcd((int)Math.max(g,l),(int)Math.min(g,l))",
"gcd",
"(int)Math.max(g,l)",
"Math.max",
"Math",
"g",
"l",
"(int)Math.min(g,l)",
"Math.min",
"Math",
"g",
"l",
"System.out.println(total)",
"System.out.println",
"System.out",
"System",
"System.out",
"total",
"String[] args",
"args",
"public class Main{\n\n public static int gcd(int a,int b){\n if(a%b==0) return b;\n return gcd(b,a%b);\n }\n\n public static void main(String[] args)throws Exception{\n Scanner sc = new Scanner(System.in);\n int k=sc.nextInt();\n long total=0;\n for(int i=1;i<=k;i++){\n for(int j=1;j<=k;j++){\n int g=gcd((int)Math.max(i,j),(int)Math.min(i,j));\n for(int l=1;l<=k;l++){\n total+=gcd((int)Math.max(g,l),(int)Math.min(g,l));\n }\n }\n }\n System.out.println(total);\n }\n}",
"public class Main{\n\n public static int gcd(int a,int b){\n if(a%b==0) return b;\n return gcd(b,a%b);\n }\n\n public static void main(String[] args)throws Exception{\n Scanner sc = new Scanner(System.in);\n int k=sc.nextInt();\n long total=0;\n for(int i=1;i<=k;i++){\n for(int j=1;j<=k;j++){\n int g=gcd((int)Math.max(i,j),(int)Math.min(i,j));\n for(int l=1;l<=k;l++){\n total+=gcd((int)Math.max(g,l),(int)Math.min(g,l));\n }\n }\n }\n System.out.println(total);\n }\n}",
"Main"
] |
import java.util.*;
public class Main{
public static int gcd(int a,int b){
if(a%b==0) return b;
return gcd(b,a%b);
}
public static void main(String[] args)throws Exception{
Scanner sc = new Scanner(System.in);
int k=sc.nextInt();
long total=0;
for(int i=1;i<=k;i++){
for(int j=1;j<=k;j++){
int g=gcd((int)Math.max(i,j),(int)Math.min(i,j));
for(int l=1;l<=k;l++){
total+=gcd((int)Math.max(g,l),(int)Math.min(g,l));
}
}
}
System.out.println(total);
}
}
|
[
7,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
4,
13,
13,
13,
13,
4,
18,
13,
13,
4,
18,
13,
4,
18,
13,
23,
13,
12,
13,
30,
29,
4,
13,
4,
13,
13,
13,
13,
23,
13,
23,
13,
23,
13,
12,
13,
30,
14,
2,
13,
17,
29,
13,
29,
4,
13,
13,
2,
13,
13,
23,
13,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
122,
8
],
[
122,
9
],
[
9,
10
],
[
9,
11
],
[
11,
12
],
[
12,
13
],
[
12,
14
],
[
11,
15
],
[
15,
16
],
[
15,
17
],
[
11,
18
],
[
18,
19
],
[
18,
20
],
[
20,
21
],
[
21,
22
],
[
11,
23
],
[
23,
24
],
[
23,
25
],
[
11,
26
],
[
26,
27
],
[
27,
28
],
[
28,
29
],
[
28,
30
],
[
26,
31
],
[
31,
32
],
[
31,
33
],
[
26,
34
],
[
34,
35
],
[
35,
36
],
[
26,
37
],
[
38,
38
],
[
38,
39
],
[
39,
40
],
[
40,
41
],
[
41,
42
],
[
41,
43
],
[
39,
44
],
[
44,
45
],
[
44,
46
],
[
39,
47
],
[
47,
48
],
[
48,
49
],
[
39,
50
],
[
51,
51
],
[
51,
52
],
[
52,
53
],
[
53,
54
],
[
54,
55
],
[
54,
56
],
[
52,
57
],
[
57,
58
],
[
57,
59
],
[
52,
60
],
[
60,
61
],
[
61,
62
],
[
52,
63
],
[
64,
64
],
[
64,
65
],
[
65,
66
],
[
65,
67
],
[
67,
68
],
[
67,
69
],
[
67,
70
],
[
67,
71
],
[
11,
72
],
[
72,
73
],
[
73,
74
],
[
72,
75
],
[
11,
76
],
[
76,
77
],
[
77,
78
],
[
11,
79
],
[
79,
80
],
[
80,
81
],
[
9,
82
],
[
82,
83
],
[
122,
84
],
[
84,
85
],
[
84,
86
],
[
86,
87
],
[
87,
88
],
[
88,
89
],
[
88,
90
],
[
90,
91
],
[
90,
92
],
[
90,
93
],
[
88,
94
],
[
84,
95
],
[
95,
96
],
[
84,
97
],
[
97,
98
],
[
84,
99
],
[
99,
100
],
[
122,
101
],
[
101,
102
],
[
101,
103
],
[
103,
104
],
[
104,
105
],
[
105,
106
],
[
105,
107
],
[
104,
108
],
[
108,
109
],
[
103,
110
],
[
110,
111
],
[
111,
112
],
[
111,
113
],
[
111,
114
],
[
114,
115
],
[
114,
116
],
[
101,
117
],
[
117,
118
],
[
101,
119
],
[
119,
120
],
[
0,
121
],
[
121,
122
],
[
121,
123
]
] |
[
"\nimport java.io.PrintWriter;\nimport java.util.Scanner;\n\npublic class Main {\n\n public static void main(String[] args) {\n // write your code here\n\n Scanner in = new Scanner(System.in);\n PrintWriter out = new PrintWriter(System.out);\n\n int K = in.nextInt();\n long ans = 0;\n\n// ans = gcd(1,2);\n\n for (int i = 1; i <= K; i++) {\n for (int j = 1 ; j <=K; j++) {\n for (int k = 1; k <= K; k++) {\n ans += gcd(i,j,k);\n }\n }\n }\n\n out.println(ans);\n\n in.close();\n out.close();\n }\n\n public static int gcd(int a, int b, int c){\n return gcd(gcd(a,b),c);\n }\n\n public static int gcd(int a, int b){\n if(b == 0) return a;\n return gcd(b,a%b);\n }\n}",
"import java.io.PrintWriter;",
"PrintWriter",
"java.io",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n\n public static void main(String[] args) {\n // write your code here\n\n Scanner in = new Scanner(System.in);\n PrintWriter out = new PrintWriter(System.out);\n\n int K = in.nextInt();\n long ans = 0;\n\n// ans = gcd(1,2);\n\n for (int i = 1; i <= K; i++) {\n for (int j = 1 ; j <=K; j++) {\n for (int k = 1; k <= K; k++) {\n ans += gcd(i,j,k);\n }\n }\n }\n\n out.println(ans);\n\n in.close();\n out.close();\n }\n\n public static int gcd(int a, int b, int c){\n return gcd(gcd(a,b),c);\n }\n\n public static int gcd(int a, int b){\n if(b == 0) return a;\n return gcd(b,a%b);\n }\n}",
"Main",
"public static void main(String[] args) {\n // write your code here\n\n Scanner in = new Scanner(System.in);\n PrintWriter out = new PrintWriter(System.out);\n\n int K = in.nextInt();\n long ans = 0;\n\n// ans = gcd(1,2);\n\n for (int i = 1; i <= K; i++) {\n for (int j = 1 ; j <=K; j++) {\n for (int k = 1; k <= K; k++) {\n ans += gcd(i,j,k);\n }\n }\n }\n\n out.println(ans);\n\n in.close();\n out.close();\n }",
"main",
"{\n // write your code here\n\n Scanner in = new Scanner(System.in);\n PrintWriter out = new PrintWriter(System.out);\n\n int K = in.nextInt();\n long ans = 0;\n\n// ans = gcd(1,2);\n\n for (int i = 1; i <= K; i++) {\n for (int j = 1 ; j <=K; j++) {\n for (int k = 1; k <= K; k++) {\n ans += gcd(i,j,k);\n }\n }\n }\n\n out.println(ans);\n\n in.close();\n out.close();\n }",
"Scanner in = new Scanner(System.in);",
"in",
"new Scanner(System.in)",
"PrintWriter out = new PrintWriter(System.out);",
"out",
"new PrintWriter(System.out)",
"int K = in.nextInt();",
"K",
"in.nextInt()",
"in.nextInt",
"in",
"long ans = 0;",
"ans",
"0",
"for (int i = 1; i <= K; i++) {\n for (int j = 1 ; j <=K; j++) {\n for (int k = 1; k <= K; k++) {\n ans += gcd(i,j,k);\n }\n }\n }",
"int i = 1;",
"int i = 1;",
"i",
"1",
"i <= K",
"i",
"K",
"i++",
"i++",
"i",
"{\n for (int j = 1 ; j <=K; j++) {\n for (int k = 1; k <= K; k++) {\n ans += gcd(i,j,k);\n }\n }\n }",
"{\n for (int j = 1 ; j <=K; j++) {\n for (int k = 1; k <= K; k++) {\n ans += gcd(i,j,k);\n }\n }\n }",
"for (int j = 1 ; j <=K; j++) {\n for (int k = 1; k <= K; k++) {\n ans += gcd(i,j,k);\n }\n }",
"int j = 1 ;",
"int j = 1 ;",
"j",
"1",
"j <=K",
"j",
"K",
"j++",
"j++",
"j",
"{\n for (int k = 1; k <= K; k++) {\n ans += gcd(i,j,k);\n }\n }",
"{\n for (int k = 1; k <= K; k++) {\n ans += gcd(i,j,k);\n }\n }",
"for (int k = 1; k <= K; k++) {\n ans += gcd(i,j,k);\n }",
"int k = 1;",
"int k = 1;",
"k",
"1",
"k <= K",
"k",
"K",
"k++",
"k++",
"k",
"{\n ans += gcd(i,j,k);\n }",
"{\n ans += gcd(i,j,k);\n }",
"ans += gcd(i,j,k)",
"ans",
"gcd(i,j,k)",
"gcd",
"i",
"j",
"k",
"out.println(ans)",
"out.println",
"out",
"ans",
"in.close()",
"in.close",
"in",
"out.close()",
"out.close",
"out",
"String[] args",
"args",
"public static int gcd(int a, int b, int c){\n return gcd(gcd(a,b),c);\n }",
"gcd",
"{\n return gcd(gcd(a,b),c);\n }",
"return gcd(gcd(a,b),c);",
"gcd(gcd(a,b),c)",
"gcd",
"gcd(a,b)",
"gcd",
"a",
"b",
"c",
"int a",
"a",
"int b",
"b",
"int c",
"c",
"public static int gcd(int a, int b){\n if(b == 0) return a;\n return gcd(b,a%b);\n }",
"gcd",
"{\n if(b == 0) return a;\n return gcd(b,a%b);\n }",
"if(b == 0) return a;",
"b == 0",
"b",
"0",
"return a;",
"a",
"return gcd(b,a%b);",
"gcd(b,a%b)",
"gcd",
"b",
"a%b",
"a",
"b",
"int a",
"a",
"int b",
"b",
"public class Main {\n\n public static void main(String[] args) {\n // write your code here\n\n Scanner in = new Scanner(System.in);\n PrintWriter out = new PrintWriter(System.out);\n\n int K = in.nextInt();\n long ans = 0;\n\n// ans = gcd(1,2);\n\n for (int i = 1; i <= K; i++) {\n for (int j = 1 ; j <=K; j++) {\n for (int k = 1; k <= K; k++) {\n ans += gcd(i,j,k);\n }\n }\n }\n\n out.println(ans);\n\n in.close();\n out.close();\n }\n\n public static int gcd(int a, int b, int c){\n return gcd(gcd(a,b),c);\n }\n\n public static int gcd(int a, int b){\n if(b == 0) return a;\n return gcd(b,a%b);\n }\n}",
"public class Main {\n\n public static void main(String[] args) {\n // write your code here\n\n Scanner in = new Scanner(System.in);\n PrintWriter out = new PrintWriter(System.out);\n\n int K = in.nextInt();\n long ans = 0;\n\n// ans = gcd(1,2);\n\n for (int i = 1; i <= K; i++) {\n for (int j = 1 ; j <=K; j++) {\n for (int k = 1; k <= K; k++) {\n ans += gcd(i,j,k);\n }\n }\n }\n\n out.println(ans);\n\n in.close();\n out.close();\n }\n\n public static int gcd(int a, int b, int c){\n return gcd(gcd(a,b),c);\n }\n\n public static int gcd(int a, int b){\n if(b == 0) return a;\n return gcd(b,a%b);\n }\n}",
"Main"
] |
import java.io.PrintWriter;
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
// write your code here
Scanner in = new Scanner(System.in);
PrintWriter out = new PrintWriter(System.out);
int K = in.nextInt();
long ans = 0;
// ans = gcd(1,2);
for (int i = 1; i <= K; i++) {
for (int j = 1 ; j <=K; j++) {
for (int k = 1; k <= K; k++) {
ans += gcd(i,j,k);
}
}
}
out.println(ans);
in.close();
out.close();
}
public static int gcd(int a, int b, int c){
return gcd(gcd(a,b),c);
}
public static int gcd(int a, int b){
if(b == 0) return a;
return gcd(b,a%b);
}
}
|
[
7,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
4,
13,
13,
4,
13,
13,
13,
41,
13,
20,
4,
18,
18,
13,
13,
4,
18,
13,
13,
23,
13,
12,
13,
30,
14,
2,
13,
17,
29,
13,
29,
4,
13,
2,
13,
13,
13,
23,
13,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
106,
8
],
[
106,
9
],
[
9,
10
],
[
9,
11
],
[
11,
12
],
[
12,
13
],
[
12,
14
],
[
11,
15
],
[
15,
16
],
[
15,
17
],
[
17,
18
],
[
18,
19
],
[
11,
20
],
[
20,
21
],
[
20,
22
],
[
11,
23
],
[
23,
24
],
[
24,
25
],
[
25,
26
],
[
25,
27
],
[
23,
28
],
[
28,
29
],
[
28,
30
],
[
23,
31
],
[
31,
32
],
[
32,
33
],
[
23,
34
],
[
35,
35
],
[
35,
36
],
[
36,
37
],
[
37,
38
],
[
38,
39
],
[
38,
40
],
[
36,
41
],
[
41,
42
],
[
41,
43
],
[
36,
44
],
[
44,
45
],
[
45,
46
],
[
36,
47
],
[
48,
48
],
[
48,
49
],
[
49,
50
],
[
50,
51
],
[
51,
52
],
[
51,
53
],
[
49,
54
],
[
54,
55
],
[
54,
56
],
[
49,
57
],
[
57,
58
],
[
58,
59
],
[
49,
60
],
[
61,
61
],
[
61,
62
],
[
62,
63
],
[
62,
64
],
[
64,
65
],
[
64,
66
],
[
64,
67
],
[
67,
68
],
[
67,
69
],
[
67,
70
],
[
11,
71
],
[
71,
72
],
[
71,
73
],
[
11,
74
],
[
74,
75
],
[
75,
76
],
[
76,
77
],
[
76,
78
],
[
74,
79
],
[
79,
80
],
[
80,
81
],
[
79,
82
],
[
9,
83
],
[
83,
84
],
[
106,
85
],
[
85,
86
],
[
85,
87
],
[
87,
88
],
[
88,
89
],
[
89,
90
],
[
89,
91
],
[
88,
92
],
[
92,
93
],
[
87,
94
],
[
94,
95
],
[
95,
96
],
[
95,
97
],
[
97,
98
],
[
97,
99
],
[
95,
100
],
[
85,
101
],
[
101,
102
],
[
85,
103
],
[
103,
104
],
[
0,
105
],
[
105,
106
],
[
105,
107
]
] |
[
"import java.text.DecimalFormat;\nimport java.util.Scanner;\n\npublic class Main {\n public static void main(String[] args) {\n Scanner scanner = new Scanner(System.in);\n int n = scanner.nextInt();\n double sum = 0;\n for (int i = 1; i <= n; ++i) {\n for (int j = 1; j <= n; ++j) {\n for (int k = 1; k <= n; ++k) {\n sum += gcd(i, gcd(j, k));\n }\n }\n }\n DecimalFormat ft = new DecimalFormat(\"####\");\n System.out.print(ft.format(sum));\n }\n\n static int gcd (int a, int b)\n {\n if (a == 0)\n return b;\n return gcd(b % a, a);\n }\n}",
"import java.text.DecimalFormat;",
"DecimalFormat",
"java.text",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n public static void main(String[] args) {\n Scanner scanner = new Scanner(System.in);\n int n = scanner.nextInt();\n double sum = 0;\n for (int i = 1; i <= n; ++i) {\n for (int j = 1; j <= n; ++j) {\n for (int k = 1; k <= n; ++k) {\n sum += gcd(i, gcd(j, k));\n }\n }\n }\n DecimalFormat ft = new DecimalFormat(\"####\");\n System.out.print(ft.format(sum));\n }\n\n static int gcd (int a, int b)\n {\n if (a == 0)\n return b;\n return gcd(b % a, a);\n }\n}",
"Main",
"public static void main(String[] args) {\n Scanner scanner = new Scanner(System.in);\n int n = scanner.nextInt();\n double sum = 0;\n for (int i = 1; i <= n; ++i) {\n for (int j = 1; j <= n; ++j) {\n for (int k = 1; k <= n; ++k) {\n sum += gcd(i, gcd(j, k));\n }\n }\n }\n DecimalFormat ft = new DecimalFormat(\"####\");\n System.out.print(ft.format(sum));\n }",
"main",
"{\n Scanner scanner = new Scanner(System.in);\n int n = scanner.nextInt();\n double sum = 0;\n for (int i = 1; i <= n; ++i) {\n for (int j = 1; j <= n; ++j) {\n for (int k = 1; k <= n; ++k) {\n sum += gcd(i, gcd(j, k));\n }\n }\n }\n DecimalFormat ft = new DecimalFormat(\"####\");\n System.out.print(ft.format(sum));\n }",
"Scanner scanner = new Scanner(System.in);",
"scanner",
"new Scanner(System.in)",
"int n = scanner.nextInt();",
"n",
"scanner.nextInt()",
"scanner.nextInt",
"scanner",
"double sum = 0;",
"sum",
"0",
"for (int i = 1; i <= n; ++i) {\n for (int j = 1; j <= n; ++j) {\n for (int k = 1; k <= n; ++k) {\n sum += gcd(i, gcd(j, k));\n }\n }\n }",
"int i = 1;",
"int i = 1;",
"i",
"1",
"i <= n",
"i",
"n",
"++i",
"++i",
"i",
"{\n for (int j = 1; j <= n; ++j) {\n for (int k = 1; k <= n; ++k) {\n sum += gcd(i, gcd(j, k));\n }\n }\n }",
"{\n for (int j = 1; j <= n; ++j) {\n for (int k = 1; k <= n; ++k) {\n sum += gcd(i, gcd(j, k));\n }\n }\n }",
"for (int j = 1; j <= n; ++j) {\n for (int k = 1; k <= n; ++k) {\n sum += gcd(i, gcd(j, k));\n }\n }",
"int j = 1;",
"int j = 1;",
"j",
"1",
"j <= n",
"j",
"n",
"++j",
"++j",
"j",
"{\n for (int k = 1; k <= n; ++k) {\n sum += gcd(i, gcd(j, k));\n }\n }",
"{\n for (int k = 1; k <= n; ++k) {\n sum += gcd(i, gcd(j, k));\n }\n }",
"for (int k = 1; k <= n; ++k) {\n sum += gcd(i, gcd(j, k));\n }",
"int k = 1;",
"int k = 1;",
"k",
"1",
"k <= n",
"k",
"n",
"++k",
"++k",
"k",
"{\n sum += gcd(i, gcd(j, k));\n }",
"{\n sum += gcd(i, gcd(j, k));\n }",
"sum += gcd(i, gcd(j, k))",
"sum",
"gcd(i, gcd(j, k))",
"gcd",
"i",
"gcd(j, k)",
"gcd",
"j",
"k",
"DecimalFormat ft = new DecimalFormat(\"####\");",
"ft",
"new DecimalFormat(\"####\")",
"System.out.print(ft.format(sum))",
"System.out.print",
"System.out",
"System",
"System.out",
"ft.format(sum)",
"ft.format",
"ft",
"sum",
"String[] args",
"args",
"static int gcd (int a, int b)\n {\n if (a == 0)\n return b;\n return gcd(b % a, a);\n }",
"gcd",
"{\n if (a == 0)\n return b;\n return gcd(b % a, a);\n }",
"if (a == 0)\n return b;",
"a == 0",
"a",
"0",
"return b;",
"b",
"return gcd(b % a, a);",
"gcd(b % a, a)",
"gcd",
"b % a",
"b",
"a",
"a",
"int a",
"a",
"int b",
"b",
"public class Main {\n public static void main(String[] args) {\n Scanner scanner = new Scanner(System.in);\n int n = scanner.nextInt();\n double sum = 0;\n for (int i = 1; i <= n; ++i) {\n for (int j = 1; j <= n; ++j) {\n for (int k = 1; k <= n; ++k) {\n sum += gcd(i, gcd(j, k));\n }\n }\n }\n DecimalFormat ft = new DecimalFormat(\"####\");\n System.out.print(ft.format(sum));\n }\n\n static int gcd (int a, int b)\n {\n if (a == 0)\n return b;\n return gcd(b % a, a);\n }\n}",
"public class Main {\n public static void main(String[] args) {\n Scanner scanner = new Scanner(System.in);\n int n = scanner.nextInt();\n double sum = 0;\n for (int i = 1; i <= n; ++i) {\n for (int j = 1; j <= n; ++j) {\n for (int k = 1; k <= n; ++k) {\n sum += gcd(i, gcd(j, k));\n }\n }\n }\n DecimalFormat ft = new DecimalFormat(\"####\");\n System.out.print(ft.format(sum));\n }\n\n static int gcd (int a, int b)\n {\n if (a == 0)\n return b;\n return gcd(b % a, a);\n }\n}",
"Main"
] |
import java.text.DecimalFormat;
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
int n = scanner.nextInt();
double sum = 0;
for (int i = 1; i <= n; ++i) {
for (int j = 1; j <= n; ++j) {
for (int k = 1; k <= n; ++k) {
sum += gcd(i, gcd(j, k));
}
}
}
DecimalFormat ft = new DecimalFormat("####");
System.out.print(ft.format(sum));
}
static int gcd (int a, int b)
{
if (a == 0)
return b;
return gcd(b % a, a);
}
}
|
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
41,
13,
17,
41,
13,
13,
41,
13,
13,
14,
2,
13,
13,
30,
0,
13,
13,
0,
13,
13,
0,
13,
13,
42,
2,
0,
13,
2,
13,
13,
17,
30,
0,
13,
13,
0,
13,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
41,
13,
17,
41,
13,
13,
41,
13,
13,
14,
2,
13,
13,
30,
0,
13,
13,
0,
13,
13,
0,
13,
13,
42,
2,
0,
13,
2,
13,
13,
17,
30,
0,
13,
13,
0,
13,
13,
0,
13,
13,
4,
18,
18,
13,
13,
13,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
147,
5
],
[
147,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
8,
17
],
[
17,
18
],
[
17,
19
],
[
8,
20
],
[
20,
21
],
[
21,
22
],
[
22,
23
],
[
22,
24
],
[
20,
25
],
[
25,
26
],
[
25,
27
],
[
20,
28
],
[
28,
29
],
[
29,
30
],
[
20,
31
],
[
32,
32
],
[
32,
33
],
[
33,
34
],
[
34,
35
],
[
35,
36
],
[
35,
37
],
[
33,
38
],
[
38,
39
],
[
38,
40
],
[
33,
41
],
[
41,
42
],
[
42,
43
],
[
33,
44
],
[
45,
45
],
[
45,
46
],
[
46,
47
],
[
46,
48
],
[
45,
49
],
[
49,
50
],
[
49,
51
],
[
45,
52
],
[
52,
53
],
[
52,
54
],
[
45,
55
],
[
55,
56
],
[
56,
57
],
[
56,
58
],
[
55,
59
],
[
59,
60
],
[
60,
61
],
[
60,
62
],
[
59,
63
],
[
63,
64
],
[
63,
65
],
[
59,
66
],
[
66,
67
],
[
66,
68
],
[
45,
69
],
[
69,
70
],
[
70,
71
],
[
71,
72
],
[
71,
73
],
[
73,
74
],
[
73,
75
],
[
70,
76
],
[
69,
77
],
[
77,
78
],
[
78,
79
],
[
78,
80
],
[
77,
81
],
[
81,
82
],
[
81,
83
],
[
45,
84
],
[
84,
85
],
[
85,
86
],
[
86,
87
],
[
86,
88
],
[
84,
89
],
[
89,
90
],
[
89,
91
],
[
84,
92
],
[
92,
93
],
[
93,
94
],
[
84,
95
],
[
96,
96
],
[
96,
97
],
[
97,
98
],
[
97,
99
],
[
96,
100
],
[
100,
101
],
[
100,
102
],
[
96,
103
],
[
103,
104
],
[
103,
105
],
[
96,
106
],
[
106,
107
],
[
107,
108
],
[
107,
109
],
[
106,
110
],
[
110,
111
],
[
111,
112
],
[
111,
113
],
[
110,
114
],
[
114,
115
],
[
114,
116
],
[
110,
117
],
[
117,
118
],
[
117,
119
],
[
96,
120
],
[
120,
121
],
[
121,
122
],
[
122,
123
],
[
122,
124
],
[
124,
125
],
[
124,
126
],
[
121,
127
],
[
120,
128
],
[
128,
129
],
[
129,
130
],
[
129,
131
],
[
128,
132
],
[
132,
133
],
[
132,
134
],
[
96,
135
],
[
135,
136
],
[
135,
137
],
[
8,
138
],
[
138,
139
],
[
139,
140
],
[
140,
141
],
[
140,
142
],
[
138,
143
],
[
6,
144
],
[
144,
145
],
[
0,
146
],
[
146,
147
],
[
146,
148
]
] |
[
"import java.util.*;\npublic class Main {\n public static void main(String[] args){\n Scanner sc = new Scanner(System.in);\n \n // 番号の取得\n int num = sc.nextInt();\n\n // 総和\n int sum = 0;\n\n for (int i=1; i <= num; i++) {\n for (int j=1; j <= num; j++) {\n // i,jの最大公約数を求める\n int temp1 = 0;\n int x = i;\n int y = j;\n if (x < y) {\n temp1 = x;\n x = y;\n y = temp1;\n }\n // ユークリッド\n while((temp1 = x % y) != 0) {\n x = y;\n y = temp1;\n }\n for (int k=1; k <= num; k++) {\n // y,kの最大公約数を求める\n int temp2 = 0;\n int w = y;\n int z = k;\n if (w < z) {\n temp2 = w;\n w = z;\n z = temp2;\n }\n // ユークリッド\n while((temp2 = w % z) != 0) {\n w = z;\n z = temp2;\n }\n sum += z;\n }\n }\n }\n System.out.println(sum);\n }\n}",
"import java.util.*;",
"util.*",
"java",
"public class Main {\n public static void main(String[] args){\n Scanner sc = new Scanner(System.in);\n \n // 番号の取得\n int num = sc.nextInt();\n\n // 総和\n int sum = 0;\n\n for (int i=1; i <= num; i++) {\n for (int j=1; j <= num; j++) {\n // i,jの最大公約数を求める\n int temp1 = 0;\n int x = i;\n int y = j;\n if (x < y) {\n temp1 = x;\n x = y;\n y = temp1;\n }\n // ユークリッド\n while((temp1 = x % y) != 0) {\n x = y;\n y = temp1;\n }\n for (int k=1; k <= num; k++) {\n // y,kの最大公約数を求める\n int temp2 = 0;\n int w = y;\n int z = k;\n if (w < z) {\n temp2 = w;\n w = z;\n z = temp2;\n }\n // ユークリッド\n while((temp2 = w % z) != 0) {\n w = z;\n z = temp2;\n }\n sum += z;\n }\n }\n }\n System.out.println(sum);\n }\n}",
"Main",
"public static void main(String[] args){\n Scanner sc = new Scanner(System.in);\n \n // 番号の取得\n int num = sc.nextInt();\n\n // 総和\n int sum = 0;\n\n for (int i=1; i <= num; i++) {\n for (int j=1; j <= num; j++) {\n // i,jの最大公約数を求める\n int temp1 = 0;\n int x = i;\n int y = j;\n if (x < y) {\n temp1 = x;\n x = y;\n y = temp1;\n }\n // ユークリッド\n while((temp1 = x % y) != 0) {\n x = y;\n y = temp1;\n }\n for (int k=1; k <= num; k++) {\n // y,kの最大公約数を求める\n int temp2 = 0;\n int w = y;\n int z = k;\n if (w < z) {\n temp2 = w;\n w = z;\n z = temp2;\n }\n // ユークリッド\n while((temp2 = w % z) != 0) {\n w = z;\n z = temp2;\n }\n sum += z;\n }\n }\n }\n System.out.println(sum);\n }",
"main",
"{\n Scanner sc = new Scanner(System.in);\n \n // 番号の取得\n int num = sc.nextInt();\n\n // 総和\n int sum = 0;\n\n for (int i=1; i <= num; i++) {\n for (int j=1; j <= num; j++) {\n // i,jの最大公約数を求める\n int temp1 = 0;\n int x = i;\n int y = j;\n if (x < y) {\n temp1 = x;\n x = y;\n y = temp1;\n }\n // ユークリッド\n while((temp1 = x % y) != 0) {\n x = y;\n y = temp1;\n }\n for (int k=1; k <= num; k++) {\n // y,kの最大公約数を求める\n int temp2 = 0;\n int w = y;\n int z = k;\n if (w < z) {\n temp2 = w;\n w = z;\n z = temp2;\n }\n // ユークリッド\n while((temp2 = w % z) != 0) {\n w = z;\n z = temp2;\n }\n sum += z;\n }\n }\n }\n System.out.println(sum);\n }",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"int num = sc.nextInt();",
"num",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int sum = 0;",
"sum",
"0",
"for (int i=1; i <= num; i++) {\n for (int j=1; j <= num; j++) {\n // i,jの最大公約数を求める\n int temp1 = 0;\n int x = i;\n int y = j;\n if (x < y) {\n temp1 = x;\n x = y;\n y = temp1;\n }\n // ユークリッド\n while((temp1 = x % y) != 0) {\n x = y;\n y = temp1;\n }\n for (int k=1; k <= num; k++) {\n // y,kの最大公約数を求める\n int temp2 = 0;\n int w = y;\n int z = k;\n if (w < z) {\n temp2 = w;\n w = z;\n z = temp2;\n }\n // ユークリッド\n while((temp2 = w % z) != 0) {\n w = z;\n z = temp2;\n }\n sum += z;\n }\n }\n }",
"int i=1;",
"int i=1;",
"i",
"1",
"i <= num",
"i",
"num",
"i++",
"i++",
"i",
"{\n for (int j=1; j <= num; j++) {\n // i,jの最大公約数を求める\n int temp1 = 0;\n int x = i;\n int y = j;\n if (x < y) {\n temp1 = x;\n x = y;\n y = temp1;\n }\n // ユークリッド\n while((temp1 = x % y) != 0) {\n x = y;\n y = temp1;\n }\n for (int k=1; k <= num; k++) {\n // y,kの最大公約数を求める\n int temp2 = 0;\n int w = y;\n int z = k;\n if (w < z) {\n temp2 = w;\n w = z;\n z = temp2;\n }\n // ユークリッド\n while((temp2 = w % z) != 0) {\n w = z;\n z = temp2;\n }\n sum += z;\n }\n }\n }",
"{\n for (int j=1; j <= num; j++) {\n // i,jの最大公約数を求める\n int temp1 = 0;\n int x = i;\n int y = j;\n if (x < y) {\n temp1 = x;\n x = y;\n y = temp1;\n }\n // ユークリッド\n while((temp1 = x % y) != 0) {\n x = y;\n y = temp1;\n }\n for (int k=1; k <= num; k++) {\n // y,kの最大公約数を求める\n int temp2 = 0;\n int w = y;\n int z = k;\n if (w < z) {\n temp2 = w;\n w = z;\n z = temp2;\n }\n // ユークリッド\n while((temp2 = w % z) != 0) {\n w = z;\n z = temp2;\n }\n sum += z;\n }\n }\n }",
"for (int j=1; j <= num; j++) {\n // i,jの最大公約数を求める\n int temp1 = 0;\n int x = i;\n int y = j;\n if (x < y) {\n temp1 = x;\n x = y;\n y = temp1;\n }\n // ユークリッド\n while((temp1 = x % y) != 0) {\n x = y;\n y = temp1;\n }\n for (int k=1; k <= num; k++) {\n // y,kの最大公約数を求める\n int temp2 = 0;\n int w = y;\n int z = k;\n if (w < z) {\n temp2 = w;\n w = z;\n z = temp2;\n }\n // ユークリッド\n while((temp2 = w % z) != 0) {\n w = z;\n z = temp2;\n }\n sum += z;\n }\n }",
"int j=1;",
"int j=1;",
"j",
"1",
"j <= num",
"j",
"num",
"j++",
"j++",
"j",
"{\n // i,jの最大公約数を求める\n int temp1 = 0;\n int x = i;\n int y = j;\n if (x < y) {\n temp1 = x;\n x = y;\n y = temp1;\n }\n // ユークリッド\n while((temp1 = x % y) != 0) {\n x = y;\n y = temp1;\n }\n for (int k=1; k <= num; k++) {\n // y,kの最大公約数を求める\n int temp2 = 0;\n int w = y;\n int z = k;\n if (w < z) {\n temp2 = w;\n w = z;\n z = temp2;\n }\n // ユークリッド\n while((temp2 = w % z) != 0) {\n w = z;\n z = temp2;\n }\n sum += z;\n }\n }",
"{\n // i,jの最大公約数を求める\n int temp1 = 0;\n int x = i;\n int y = j;\n if (x < y) {\n temp1 = x;\n x = y;\n y = temp1;\n }\n // ユークリッド\n while((temp1 = x % y) != 0) {\n x = y;\n y = temp1;\n }\n for (int k=1; k <= num; k++) {\n // y,kの最大公約数を求める\n int temp2 = 0;\n int w = y;\n int z = k;\n if (w < z) {\n temp2 = w;\n w = z;\n z = temp2;\n }\n // ユークリッド\n while((temp2 = w % z) != 0) {\n w = z;\n z = temp2;\n }\n sum += z;\n }\n }",
"int temp1 = 0;",
"temp1",
"0",
"int x = i;",
"x",
"i",
"int y = j;",
"y",
"j",
"if (x < y) {\n temp1 = x;\n x = y;\n y = temp1;\n }",
"x < y",
"x",
"y",
"{\n temp1 = x;\n x = y;\n y = temp1;\n }",
"temp1 = x",
"temp1",
"x",
"x = y",
"x",
"y",
"y = temp1",
"y",
"temp1",
"while((temp1 = x % y) != 0) {\n x = y;\n y = temp1;\n }",
"(temp1 = x % y) != 0",
"(temp1 = x % y)",
"temp1",
"x % y",
"x",
"y",
"0",
"{\n x = y;\n y = temp1;\n }",
"x = y",
"x",
"y",
"y = temp1",
"y",
"temp1",
"for (int k=1; k <= num; k++) {\n // y,kの最大公約数を求める\n int temp2 = 0;\n int w = y;\n int z = k;\n if (w < z) {\n temp2 = w;\n w = z;\n z = temp2;\n }\n // ユークリッド\n while((temp2 = w % z) != 0) {\n w = z;\n z = temp2;\n }\n sum += z;\n }",
"int k=1;",
"int k=1;",
"k",
"1",
"k <= num",
"k",
"num",
"k++",
"k++",
"k",
"{\n // y,kの最大公約数を求める\n int temp2 = 0;\n int w = y;\n int z = k;\n if (w < z) {\n temp2 = w;\n w = z;\n z = temp2;\n }\n // ユークリッド\n while((temp2 = w % z) != 0) {\n w = z;\n z = temp2;\n }\n sum += z;\n }",
"{\n // y,kの最大公約数を求める\n int temp2 = 0;\n int w = y;\n int z = k;\n if (w < z) {\n temp2 = w;\n w = z;\n z = temp2;\n }\n // ユークリッド\n while((temp2 = w % z) != 0) {\n w = z;\n z = temp2;\n }\n sum += z;\n }",
"int temp2 = 0;",
"temp2",
"0",
"int w = y;",
"w",
"y",
"int z = k;",
"z",
"k",
"if (w < z) {\n temp2 = w;\n w = z;\n z = temp2;\n }",
"w < z",
"w",
"z",
"{\n temp2 = w;\n w = z;\n z = temp2;\n }",
"temp2 = w",
"temp2",
"w",
"w = z",
"w",
"z",
"z = temp2",
"z",
"temp2",
"while((temp2 = w % z) != 0) {\n w = z;\n z = temp2;\n }",
"(temp2 = w % z) != 0",
"(temp2 = w % z)",
"temp2",
"w % z",
"w",
"z",
"0",
"{\n w = z;\n z = temp2;\n }",
"w = z",
"w",
"z",
"z = temp2",
"z",
"temp2",
"sum += z",
"sum",
"z",
"System.out.println(sum)",
"System.out.println",
"System.out",
"System",
"System.out",
"sum",
"String[] args",
"args",
"public class Main {\n public static void main(String[] args){\n Scanner sc = new Scanner(System.in);\n \n // 番号の取得\n int num = sc.nextInt();\n\n // 総和\n int sum = 0;\n\n for (int i=1; i <= num; i++) {\n for (int j=1; j <= num; j++) {\n // i,jの最大公約数を求める\n int temp1 = 0;\n int x = i;\n int y = j;\n if (x < y) {\n temp1 = x;\n x = y;\n y = temp1;\n }\n // ユークリッド\n while((temp1 = x % y) != 0) {\n x = y;\n y = temp1;\n }\n for (int k=1; k <= num; k++) {\n // y,kの最大公約数を求める\n int temp2 = 0;\n int w = y;\n int z = k;\n if (w < z) {\n temp2 = w;\n w = z;\n z = temp2;\n }\n // ユークリッド\n while((temp2 = w % z) != 0) {\n w = z;\n z = temp2;\n }\n sum += z;\n }\n }\n }\n System.out.println(sum);\n }\n}",
"public class Main {\n public static void main(String[] args){\n Scanner sc = new Scanner(System.in);\n \n // 番号の取得\n int num = sc.nextInt();\n\n // 総和\n int sum = 0;\n\n for (int i=1; i <= num; i++) {\n for (int j=1; j <= num; j++) {\n // i,jの最大公約数を求める\n int temp1 = 0;\n int x = i;\n int y = j;\n if (x < y) {\n temp1 = x;\n x = y;\n y = temp1;\n }\n // ユークリッド\n while((temp1 = x % y) != 0) {\n x = y;\n y = temp1;\n }\n for (int k=1; k <= num; k++) {\n // y,kの最大公約数を求める\n int temp2 = 0;\n int w = y;\n int z = k;\n if (w < z) {\n temp2 = w;\n w = z;\n z = temp2;\n }\n // ユークリッド\n while((temp2 = w % z) != 0) {\n w = z;\n z = temp2;\n }\n sum += z;\n }\n }\n }\n System.out.println(sum);\n }\n}",
"Main"
] |
import java.util.*;
public class Main {
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
// 番号の取得
int num = sc.nextInt();
// 総和
int sum = 0;
for (int i=1; i <= num; i++) {
for (int j=1; j <= num; j++) {
// i,jの最大公約数を求める
int temp1 = 0;
int x = i;
int y = j;
if (x < y) {
temp1 = x;
x = y;
y = temp1;
}
// ユークリッド
while((temp1 = x % y) != 0) {
x = y;
y = temp1;
}
for (int k=1; k <= num; k++) {
// y,kの最大公約数を求める
int temp2 = 0;
int w = y;
int z = k;
if (w < z) {
temp2 = w;
w = z;
z = temp2;
}
// ユークリッド
while((temp2 = w % z) != 0) {
w = z;
z = temp2;
}
sum += z;
}
}
}
System.out.println(sum);
}
}
|
[
7,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
13,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
4,
13,
13,
4,
13,
13,
13,
4,
18,
18,
13,
13,
13,
23,
13,
12,
13,
30,
14,
2,
13,
13,
29,
4,
13,
13,
13,
14,
2,
13,
17,
29,
13,
29,
4,
13,
13,
2,
13,
13,
23,
13,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
115,
8
],
[
115,
9
],
[
9,
10
],
[
9,
11
],
[
11,
12
],
[
12,
13
],
[
12,
14
],
[
11,
15
],
[
15,
16
],
[
15,
17
],
[
17,
18
],
[
18,
19
],
[
11,
20
],
[
20,
21
],
[
20,
22
],
[
22,
23
],
[
23,
24
],
[
22,
25
],
[
11,
26
],
[
26,
27
],
[
26,
28
],
[
11,
29
],
[
29,
30
],
[
30,
31
],
[
31,
32
],
[
31,
33
],
[
29,
34
],
[
34,
35
],
[
34,
36
],
[
29,
37
],
[
37,
38
],
[
38,
39
],
[
29,
40
],
[
41,
41
],
[
41,
42
],
[
42,
43
],
[
43,
44
],
[
44,
45
],
[
44,
46
],
[
42,
47
],
[
47,
48
],
[
47,
49
],
[
42,
50
],
[
50,
51
],
[
51,
52
],
[
42,
53
],
[
54,
54
],
[
54,
55
],
[
55,
56
],
[
56,
57
],
[
57,
58
],
[
57,
59
],
[
55,
60
],
[
60,
61
],
[
60,
62
],
[
55,
63
],
[
63,
64
],
[
64,
65
],
[
55,
66
],
[
67,
67
],
[
67,
68
],
[
68,
69
],
[
68,
70
],
[
70,
71
],
[
70,
72
],
[
70,
73
],
[
73,
74
],
[
73,
75
],
[
73,
76
],
[
11,
77
],
[
77,
78
],
[
78,
79
],
[
79,
80
],
[
79,
81
],
[
77,
82
],
[
9,
83
],
[
83,
84
],
[
115,
85
],
[
85,
86
],
[
85,
87
],
[
87,
88
],
[
88,
89
],
[
89,
90
],
[
89,
91
],
[
88,
92
],
[
92,
93
],
[
93,
94
],
[
93,
95
],
[
93,
96
],
[
87,
97
],
[
97,
98
],
[
98,
99
],
[
98,
100
],
[
97,
101
],
[
101,
102
],
[
87,
103
],
[
103,
104
],
[
104,
105
],
[
104,
106
],
[
104,
107
],
[
107,
108
],
[
107,
109
],
[
85,
110
],
[
110,
111
],
[
85,
112
],
[
112,
113
],
[
0,
114
],
[
114,
115
],
[
114,
116
]
] |
[
"import java.util.*;\nimport java.util.Scanner;\n\npublic class Main {\n public static void main(String[] args) throws Exception {\n // Your code here!\n Scanner scanner = new Scanner(System.in);\n String input = scanner.nextLine();\n int K = Integer.parseInt(input);\n long ans = 0;\n \n for(int a = 1; a <= K; a++){\n for(int b = 1; b <= K; b++){\n for(int c = 1; c <= K; c++){\n ans += gcd(a, gcd(b, c));\n }\n }\n }\n \n System.out.println(ans);\n }\n \n private static long gcd(long m, long n) {\n if(m < n) return gcd(n, m);\n if(n == 0) return m;\n return gcd(n, m % n);\n }\n}",
"import java.util.*;",
"util.*",
"java",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n public static void main(String[] args) throws Exception {\n // Your code here!\n Scanner scanner = new Scanner(System.in);\n String input = scanner.nextLine();\n int K = Integer.parseInt(input);\n long ans = 0;\n \n for(int a = 1; a <= K; a++){\n for(int b = 1; b <= K; b++){\n for(int c = 1; c <= K; c++){\n ans += gcd(a, gcd(b, c));\n }\n }\n }\n \n System.out.println(ans);\n }\n \n private static long gcd(long m, long n) {\n if(m < n) return gcd(n, m);\n if(n == 0) return m;\n return gcd(n, m % n);\n }\n}",
"Main",
"public static void main(String[] args) throws Exception {\n // Your code here!\n Scanner scanner = new Scanner(System.in);\n String input = scanner.nextLine();\n int K = Integer.parseInt(input);\n long ans = 0;\n \n for(int a = 1; a <= K; a++){\n for(int b = 1; b <= K; b++){\n for(int c = 1; c <= K; c++){\n ans += gcd(a, gcd(b, c));\n }\n }\n }\n \n System.out.println(ans);\n }",
"main",
"{\n // Your code here!\n Scanner scanner = new Scanner(System.in);\n String input = scanner.nextLine();\n int K = Integer.parseInt(input);\n long ans = 0;\n \n for(int a = 1; a <= K; a++){\n for(int b = 1; b <= K; b++){\n for(int c = 1; c <= K; c++){\n ans += gcd(a, gcd(b, c));\n }\n }\n }\n \n System.out.println(ans);\n }",
"Scanner scanner = new Scanner(System.in);",
"scanner",
"new Scanner(System.in)",
"String input = scanner.nextLine();",
"input",
"scanner.nextLine()",
"scanner.nextLine",
"scanner",
"int K = Integer.parseInt(input);",
"K",
"Integer.parseInt(input)",
"Integer.parseInt",
"Integer",
"input",
"long ans = 0;",
"ans",
"0",
"for(int a = 1; a <= K; a++){\n for(int b = 1; b <= K; b++){\n for(int c = 1; c <= K; c++){\n ans += gcd(a, gcd(b, c));\n }\n }\n }",
"int a = 1;",
"int a = 1;",
"a",
"1",
"a <= K",
"a",
"K",
"a++",
"a++",
"a",
"{\n for(int b = 1; b <= K; b++){\n for(int c = 1; c <= K; c++){\n ans += gcd(a, gcd(b, c));\n }\n }\n }",
"{\n for(int b = 1; b <= K; b++){\n for(int c = 1; c <= K; c++){\n ans += gcd(a, gcd(b, c));\n }\n }\n }",
"for(int b = 1; b <= K; b++){\n for(int c = 1; c <= K; c++){\n ans += gcd(a, gcd(b, c));\n }\n }",
"int b = 1;",
"int b = 1;",
"b",
"1",
"b <= K",
"b",
"K",
"b++",
"b++",
"b",
"{\n for(int c = 1; c <= K; c++){\n ans += gcd(a, gcd(b, c));\n }\n }",
"{\n for(int c = 1; c <= K; c++){\n ans += gcd(a, gcd(b, c));\n }\n }",
"for(int c = 1; c <= K; c++){\n ans += gcd(a, gcd(b, c));\n }",
"int c = 1;",
"int c = 1;",
"c",
"1",
"c <= K",
"c",
"K",
"c++",
"c++",
"c",
"{\n ans += gcd(a, gcd(b, c));\n }",
"{\n ans += gcd(a, gcd(b, c));\n }",
"ans += gcd(a, gcd(b, c))",
"ans",
"gcd(a, gcd(b, c))",
"gcd",
"a",
"gcd(b, c)",
"gcd",
"b",
"c",
"System.out.println(ans)",
"System.out.println",
"System.out",
"System",
"System.out",
"ans",
"String[] args",
"args",
"private static long gcd(long m, long n) {\n if(m < n) return gcd(n, m);\n if(n == 0) return m;\n return gcd(n, m % n);\n }",
"gcd",
"{\n if(m < n) return gcd(n, m);\n if(n == 0) return m;\n return gcd(n, m % n);\n }",
"if(m < n) return gcd(n, m);",
"m < n",
"m",
"n",
"return gcd(n, m);",
"gcd(n, m)",
"gcd",
"n",
"m",
"if(n == 0) return m;",
"n == 0",
"n",
"0",
"return m;",
"m",
"return gcd(n, m % n);",
"gcd(n, m % n)",
"gcd",
"n",
"m % n",
"m",
"n",
"long m",
"m",
"long n",
"n",
"public class Main {\n public static void main(String[] args) throws Exception {\n // Your code here!\n Scanner scanner = new Scanner(System.in);\n String input = scanner.nextLine();\n int K = Integer.parseInt(input);\n long ans = 0;\n \n for(int a = 1; a <= K; a++){\n for(int b = 1; b <= K; b++){\n for(int c = 1; c <= K; c++){\n ans += gcd(a, gcd(b, c));\n }\n }\n }\n \n System.out.println(ans);\n }\n \n private static long gcd(long m, long n) {\n if(m < n) return gcd(n, m);\n if(n == 0) return m;\n return gcd(n, m % n);\n }\n}",
"public class Main {\n public static void main(String[] args) throws Exception {\n // Your code here!\n Scanner scanner = new Scanner(System.in);\n String input = scanner.nextLine();\n int K = Integer.parseInt(input);\n long ans = 0;\n \n for(int a = 1; a <= K; a++){\n for(int b = 1; b <= K; b++){\n for(int c = 1; c <= K; c++){\n ans += gcd(a, gcd(b, c));\n }\n }\n }\n \n System.out.println(ans);\n }\n \n private static long gcd(long m, long n) {\n if(m < n) return gcd(n, m);\n if(n == 0) return m;\n return gcd(n, m % n);\n }\n}",
"Main"
] |
import java.util.*;
import java.util.Scanner;
public class Main {
public static void main(String[] args) throws Exception {
// Your code here!
Scanner scanner = new Scanner(System.in);
String input = scanner.nextLine();
int K = Integer.parseInt(input);
long ans = 0;
for(int a = 1; a <= K; a++){
for(int b = 1; b <= K; b++){
for(int c = 1; c <= K; c++){
ans += gcd(a, gcd(b, c));
}
}
}
System.out.println(ans);
}
private static long gcd(long m, long n) {
if(m < n) return gcd(n, m);
if(n == 0) return m;
return gcd(n, m % n);
}
}
|
[
7,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
41,
13,
4,
13,
13,
13,
0,
13,
4,
13,
13,
13,
4,
18,
18,
13,
13,
13,
23,
13,
12,
13,
30,
41,
13,
4,
18,
13,
13,
13,
41,
13,
4,
18,
13,
13,
13,
41,
13,
2,
13,
13,
14,
2,
13,
17,
29,
13,
29,
4,
13,
13,
13,
23,
13,
23,
13,
6,
13,
41,
13,
20,
41,
13,
12,
13,
30,
38,
5,
13,
30,
30,
42,
2,
2,
13,
17,
40,
4,
18,
13,
30,
0,
13,
20,
29,
4,
18,
13,
12,
13,
30,
29,
4,
18,
13,
4,
13,
12,
13,
30,
29,
4,
18,
13,
4,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
170,
8
],
[
170,
9
],
[
9,
10
],
[
9,
11
],
[
11,
12
],
[
12,
13
],
[
12,
14
],
[
11,
15
],
[
15,
16
],
[
15,
17
],
[
17,
18
],
[
18,
19
],
[
11,
20
],
[
20,
21
],
[
20,
22
],
[
11,
23
],
[
23,
24
],
[
24,
25
],
[
25,
26
],
[
25,
27
],
[
23,
28
],
[
28,
29
],
[
28,
30
],
[
23,
31
],
[
31,
32
],
[
32,
33
],
[
23,
34
],
[
35,
35
],
[
35,
36
],
[
36,
37
],
[
37,
38
],
[
38,
39
],
[
38,
40
],
[
36,
41
],
[
41,
42
],
[
41,
43
],
[
36,
44
],
[
44,
45
],
[
45,
46
],
[
36,
47
],
[
48,
48
],
[
48,
49
],
[
49,
50
],
[
50,
51
],
[
51,
52
],
[
51,
53
],
[
49,
54
],
[
54,
55
],
[
54,
56
],
[
49,
57
],
[
57,
58
],
[
58,
59
],
[
49,
60
],
[
61,
61
],
[
61,
62
],
[
62,
63
],
[
62,
64
],
[
64,
65
],
[
64,
66
],
[
64,
67
],
[
61,
68
],
[
68,
69
],
[
68,
70
],
[
70,
71
],
[
70,
72
],
[
70,
73
],
[
11,
74
],
[
74,
75
],
[
75,
76
],
[
76,
77
],
[
76,
78
],
[
74,
79
],
[
9,
80
],
[
80,
81
],
[
170,
82
],
[
82,
83
],
[
82,
84
],
[
84,
85
],
[
85,
86
],
[
85,
87
],
[
87,
88
],
[
88,
89
],
[
87,
90
],
[
87,
91
],
[
84,
92
],
[
92,
93
],
[
92,
94
],
[
94,
95
],
[
95,
96
],
[
94,
97
],
[
94,
98
],
[
84,
99
],
[
99,
100
],
[
99,
101
],
[
101,
102
],
[
101,
103
],
[
84,
104
],
[
104,
105
],
[
105,
106
],
[
105,
107
],
[
104,
108
],
[
108,
109
],
[
84,
110
],
[
110,
111
],
[
111,
112
],
[
111,
113
],
[
111,
114
],
[
82,
115
],
[
115,
116
],
[
82,
117
],
[
117,
118
],
[
170,
119
],
[
119,
120
],
[
119,
121
],
[
121,
122
],
[
121,
123
],
[
119,
124
],
[
124,
125
],
[
119,
126
],
[
126,
127
],
[
126,
128
],
[
128,
129
],
[
129,
130
],
[
130,
131
],
[
130,
132
],
[
129,
133
],
[
133,
134
],
[
134,
135
],
[
135,
136
],
[
136,
137
],
[
136,
138
],
[
135,
139
],
[
139,
140
],
[
140,
141
],
[
141,
142
],
[
134,
143
],
[
143,
144
],
[
144,
145
],
[
144,
146
],
[
128,
147
],
[
147,
148
],
[
148,
149
],
[
149,
150
],
[
119,
151
],
[
151,
152
],
[
151,
153
],
[
153,
154
],
[
154,
155
],
[
155,
156
],
[
156,
157
],
[
155,
158
],
[
158,
159
],
[
119,
160
],
[
160,
161
],
[
160,
162
],
[
162,
163
],
[
163,
164
],
[
164,
165
],
[
165,
166
],
[
164,
167
],
[
167,
168
],
[
0,
169
],
[
169,
170
],
[
169,
171
]
] |
[
"// 上限値を見ていなかった\nimport java.io.*;\nimport java.util.*;\n\npublic class Main {\n public static void main(String[] args) {\n MyScanner sc = new MyScanner();\n\n int k = sc.nextInt();\n\n long sum = 0;\n for (int i = 1; i <= k; i++) {\n for (int j = 1; j <= k; j++) {\n for (int l = 1; l <= k; l++) {\n long tmp = gcd(i, j);\n sum += gcd(l, tmp);\n }\n }\n }\n\n System.out.println(sum);\n }\n\n public static long gcd(long a, long b) {\n long max = Math.max(a, b);\n long min = Math.min(a, b);\n\n long re = max % min;\n if (re == 0)\n return min;\n return gcd(min, re);\n }\n\n static class MyScanner {\n BufferedReader reader = new BufferedReader(new InputStreamReader(System.in), 1 << 15);\n StringTokenizer tokenizer;\n\n String next() {\n try {\n while (tokenizer == null || !tokenizer.hasMoreTokens()) {\n tokenizer = new StringTokenizer(reader.readLine());\n }\n } catch (IOException ignored) {\n }\n return tokenizer.nextToken();\n }\n\n int nextInt() {\n return Integer.parseInt(next());\n }\n\n long nextLong() {\n return Long.parseLong(next());\n }\n }\n}",
"import java.io.*;",
"io.*",
"java",
"import java.util.*;",
"util.*",
"java",
"public class Main {\n public static void main(String[] args) {\n MyScanner sc = new MyScanner();\n\n int k = sc.nextInt();\n\n long sum = 0;\n for (int i = 1; i <= k; i++) {\n for (int j = 1; j <= k; j++) {\n for (int l = 1; l <= k; l++) {\n long tmp = gcd(i, j);\n sum += gcd(l, tmp);\n }\n }\n }\n\n System.out.println(sum);\n }\n\n public static long gcd(long a, long b) {\n long max = Math.max(a, b);\n long min = Math.min(a, b);\n\n long re = max % min;\n if (re == 0)\n return min;\n return gcd(min, re);\n }\n\n static class MyScanner {\n BufferedReader reader = new BufferedReader(new InputStreamReader(System.in), 1 << 15);\n StringTokenizer tokenizer;\n\n String next() {\n try {\n while (tokenizer == null || !tokenizer.hasMoreTokens()) {\n tokenizer = new StringTokenizer(reader.readLine());\n }\n } catch (IOException ignored) {\n }\n return tokenizer.nextToken();\n }\n\n int nextInt() {\n return Integer.parseInt(next());\n }\n\n long nextLong() {\n return Long.parseLong(next());\n }\n }\n}",
"Main",
"public static void main(String[] args) {\n MyScanner sc = new MyScanner();\n\n int k = sc.nextInt();\n\n long sum = 0;\n for (int i = 1; i <= k; i++) {\n for (int j = 1; j <= k; j++) {\n for (int l = 1; l <= k; l++) {\n long tmp = gcd(i, j);\n sum += gcd(l, tmp);\n }\n }\n }\n\n System.out.println(sum);\n }",
"main",
"{\n MyScanner sc = new MyScanner();\n\n int k = sc.nextInt();\n\n long sum = 0;\n for (int i = 1; i <= k; i++) {\n for (int j = 1; j <= k; j++) {\n for (int l = 1; l <= k; l++) {\n long tmp = gcd(i, j);\n sum += gcd(l, tmp);\n }\n }\n }\n\n System.out.println(sum);\n }",
"MyScanner sc = new MyScanner();",
"sc",
"new MyScanner()",
"int k = sc.nextInt();",
"k",
"sc.nextInt()",
"sc.nextInt",
"sc",
"long sum = 0;",
"sum",
"0",
"for (int i = 1; i <= k; i++) {\n for (int j = 1; j <= k; j++) {\n for (int l = 1; l <= k; l++) {\n long tmp = gcd(i, j);\n sum += gcd(l, tmp);\n }\n }\n }",
"int i = 1;",
"int i = 1;",
"i",
"1",
"i <= k",
"i",
"k",
"i++",
"i++",
"i",
"{\n for (int j = 1; j <= k; j++) {\n for (int l = 1; l <= k; l++) {\n long tmp = gcd(i, j);\n sum += gcd(l, tmp);\n }\n }\n }",
"{\n for (int j = 1; j <= k; j++) {\n for (int l = 1; l <= k; l++) {\n long tmp = gcd(i, j);\n sum += gcd(l, tmp);\n }\n }\n }",
"for (int j = 1; j <= k; j++) {\n for (int l = 1; l <= k; l++) {\n long tmp = gcd(i, j);\n sum += gcd(l, tmp);\n }\n }",
"int j = 1;",
"int j = 1;",
"j",
"1",
"j <= k",
"j",
"k",
"j++",
"j++",
"j",
"{\n for (int l = 1; l <= k; l++) {\n long tmp = gcd(i, j);\n sum += gcd(l, tmp);\n }\n }",
"{\n for (int l = 1; l <= k; l++) {\n long tmp = gcd(i, j);\n sum += gcd(l, tmp);\n }\n }",
"for (int l = 1; l <= k; l++) {\n long tmp = gcd(i, j);\n sum += gcd(l, tmp);\n }",
"int l = 1;",
"int l = 1;",
"l",
"1",
"l <= k",
"l",
"k",
"l++",
"l++",
"l",
"{\n long tmp = gcd(i, j);\n sum += gcd(l, tmp);\n }",
"{\n long tmp = gcd(i, j);\n sum += gcd(l, tmp);\n }",
"long tmp = gcd(i, j);",
"tmp",
"gcd(i, j)",
"gcd",
"i",
"j",
"sum += gcd(l, tmp)",
"sum",
"gcd(l, tmp)",
"gcd",
"l",
"tmp",
"System.out.println(sum)",
"System.out.println",
"System.out",
"System",
"System.out",
"sum",
"String[] args",
"args",
"public static long gcd(long a, long b) {\n long max = Math.max(a, b);\n long min = Math.min(a, b);\n\n long re = max % min;\n if (re == 0)\n return min;\n return gcd(min, re);\n }",
"gcd",
"{\n long max = Math.max(a, b);\n long min = Math.min(a, b);\n\n long re = max % min;\n if (re == 0)\n return min;\n return gcd(min, re);\n }",
"long max = Math.max(a, b);",
"max",
"Math.max(a, b)",
"Math.max",
"Math",
"a",
"b",
"long min = Math.min(a, b);",
"min",
"Math.min(a, b)",
"Math.min",
"Math",
"a",
"b",
"long re = max % min;",
"re",
"max % min",
"max",
"min",
"if (re == 0)\n return min;",
"re == 0",
"re",
"0",
"return min;",
"min",
"return gcd(min, re);",
"gcd(min, re)",
"gcd",
"min",
"re",
"long a",
"a",
"long b",
"b",
"static class MyScanner {\n BufferedReader reader = new BufferedReader(new InputStreamReader(System.in), 1 << 15);\n StringTokenizer tokenizer;\n\n String next() {\n try {\n while (tokenizer == null || !tokenizer.hasMoreTokens()) {\n tokenizer = new StringTokenizer(reader.readLine());\n }\n } catch (IOException ignored) {\n }\n return tokenizer.nextToken();\n }\n\n int nextInt() {\n return Integer.parseInt(next());\n }\n\n long nextLong() {\n return Long.parseLong(next());\n }\n }",
"MyScanner",
"BufferedReader reader = new BufferedReader(new InputStreamReader(System.in), 1 << 15);",
"reader",
"new BufferedReader(new InputStreamReader(System.in), 1 << 15)",
"StringTokenizer tokenizer;",
"tokenizer",
"String next() {\n try {\n while (tokenizer == null || !tokenizer.hasMoreTokens()) {\n tokenizer = new StringTokenizer(reader.readLine());\n }\n } catch (IOException ignored) {\n }\n return tokenizer.nextToken();\n }",
"next",
"{\n try {\n while (tokenizer == null || !tokenizer.hasMoreTokens()) {\n tokenizer = new StringTokenizer(reader.readLine());\n }\n } catch (IOException ignored) {\n }\n return tokenizer.nextToken();\n }",
"try {\n while (tokenizer == null || !tokenizer.hasMoreTokens()) {\n tokenizer = new StringTokenizer(reader.readLine());\n }\n } catch (IOException ignored) {\n }",
"catch (IOException ignored) {\n }",
"IOException ignored",
"{\n }",
"{\n while (tokenizer == null || !tokenizer.hasMoreTokens()) {\n tokenizer = new StringTokenizer(reader.readLine());\n }\n }",
"while (tokenizer == null || !tokenizer.hasMoreTokens()) {\n tokenizer = new StringTokenizer(reader.readLine());\n }",
"tokenizer == null || !tokenizer.hasMoreTokens()",
"tokenizer == null",
"tokenizer",
"null",
"!tokenizer.hasMoreTokens()",
"tokenizer.hasMoreTokens()",
"tokenizer.hasMoreTokens",
"tokenizer",
"{\n tokenizer = new StringTokenizer(reader.readLine());\n }",
"tokenizer = new StringTokenizer(reader.readLine())",
"tokenizer",
"new StringTokenizer(reader.readLine())",
"return tokenizer.nextToken();",
"tokenizer.nextToken()",
"tokenizer.nextToken",
"tokenizer",
"int nextInt() {\n return Integer.parseInt(next());\n }",
"nextInt",
"{\n return Integer.parseInt(next());\n }",
"return Integer.parseInt(next());",
"Integer.parseInt(next())",
"Integer.parseInt",
"Integer",
"next()",
"next",
"long nextLong() {\n return Long.parseLong(next());\n }",
"nextLong",
"{\n return Long.parseLong(next());\n }",
"return Long.parseLong(next());",
"Long.parseLong(next())",
"Long.parseLong",
"Long",
"next()",
"next",
"public class Main {\n public static void main(String[] args) {\n MyScanner sc = new MyScanner();\n\n int k = sc.nextInt();\n\n long sum = 0;\n for (int i = 1; i <= k; i++) {\n for (int j = 1; j <= k; j++) {\n for (int l = 1; l <= k; l++) {\n long tmp = gcd(i, j);\n sum += gcd(l, tmp);\n }\n }\n }\n\n System.out.println(sum);\n }\n\n public static long gcd(long a, long b) {\n long max = Math.max(a, b);\n long min = Math.min(a, b);\n\n long re = max % min;\n if (re == 0)\n return min;\n return gcd(min, re);\n }\n\n static class MyScanner {\n BufferedReader reader = new BufferedReader(new InputStreamReader(System.in), 1 << 15);\n StringTokenizer tokenizer;\n\n String next() {\n try {\n while (tokenizer == null || !tokenizer.hasMoreTokens()) {\n tokenizer = new StringTokenizer(reader.readLine());\n }\n } catch (IOException ignored) {\n }\n return tokenizer.nextToken();\n }\n\n int nextInt() {\n return Integer.parseInt(next());\n }\n\n long nextLong() {\n return Long.parseLong(next());\n }\n }\n}",
"public class Main {\n public static void main(String[] args) {\n MyScanner sc = new MyScanner();\n\n int k = sc.nextInt();\n\n long sum = 0;\n for (int i = 1; i <= k; i++) {\n for (int j = 1; j <= k; j++) {\n for (int l = 1; l <= k; l++) {\n long tmp = gcd(i, j);\n sum += gcd(l, tmp);\n }\n }\n }\n\n System.out.println(sum);\n }\n\n public static long gcd(long a, long b) {\n long max = Math.max(a, b);\n long min = Math.min(a, b);\n\n long re = max % min;\n if (re == 0)\n return min;\n return gcd(min, re);\n }\n\n static class MyScanner {\n BufferedReader reader = new BufferedReader(new InputStreamReader(System.in), 1 << 15);\n StringTokenizer tokenizer;\n\n String next() {\n try {\n while (tokenizer == null || !tokenizer.hasMoreTokens()) {\n tokenizer = new StringTokenizer(reader.readLine());\n }\n } catch (IOException ignored) {\n }\n return tokenizer.nextToken();\n }\n\n int nextInt() {\n return Integer.parseInt(next());\n }\n\n long nextLong() {\n return Long.parseLong(next());\n }\n }\n}",
"Main"
] |
// 上限値を見ていなかった
import java.io.*;
import java.util.*;
public class Main {
public static void main(String[] args) {
MyScanner sc = new MyScanner();
int k = sc.nextInt();
long sum = 0;
for (int i = 1; i <= k; i++) {
for (int j = 1; j <= k; j++) {
for (int l = 1; l <= k; l++) {
long tmp = gcd(i, j);
sum += gcd(l, tmp);
}
}
}
System.out.println(sum);
}
public static long gcd(long a, long b) {
long max = Math.max(a, b);
long min = Math.min(a, b);
long re = max % min;
if (re == 0)
return min;
return gcd(min, re);
}
static class MyScanner {
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in), 1 << 15);
StringTokenizer tokenizer;
String next() {
try {
while (tokenizer == null || !tokenizer.hasMoreTokens()) {
tokenizer = new StringTokenizer(reader.readLine());
}
} catch (IOException ignored) {
}
return tokenizer.nextToken();
}
int nextInt() {
return Integer.parseInt(next());
}
long nextLong() {
return Long.parseLong(next());
}
}
}
|
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
41,
13,
41,
13,
41,
13,
17,
11,
1,
0,
13,
17,
2,
13,
13,
1,
40,
13,
30,
11,
1,
0,
13,
17,
2,
13,
13,
1,
40,
13,
30,
11,
1,
0,
13,
17,
2,
13,
13,
1,
40,
13,
30,
0,
13,
4,
13,
4,
13,
13,
13,
13,
4,
18,
18,
13,
13,
13,
23,
13,
12,
13,
30,
14,
2,
13,
17,
30,
29,
13,
29,
4,
13,
13,
2,
13,
13,
23,
13,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
101,
5
],
[
101,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
8,
17
],
[
17,
18
],
[
8,
19
],
[
19,
20
],
[
8,
21
],
[
21,
22
],
[
8,
23
],
[
23,
24
],
[
23,
25
],
[
8,
26
],
[
26,
27
],
[
27,
28
],
[
28,
29
],
[
28,
30
],
[
26,
31
],
[
31,
32
],
[
31,
33
],
[
26,
34
],
[
34,
35
],
[
35,
36
],
[
26,
37
],
[
37,
38
],
[
38,
39
],
[
39,
40
],
[
40,
41
],
[
40,
42
],
[
38,
43
],
[
43,
44
],
[
43,
45
],
[
38,
46
],
[
46,
47
],
[
47,
48
],
[
38,
49
],
[
49,
50
],
[
50,
51
],
[
51,
52
],
[
52,
53
],
[
52,
54
],
[
50,
55
],
[
55,
56
],
[
55,
57
],
[
50,
58
],
[
58,
59
],
[
59,
60
],
[
50,
61
],
[
61,
62
],
[
62,
63
],
[
62,
64
],
[
64,
65
],
[
64,
66
],
[
66,
67
],
[
66,
68
],
[
66,
69
],
[
64,
70
],
[
8,
71
],
[
71,
72
],
[
72,
73
],
[
73,
74
],
[
73,
75
],
[
71,
76
],
[
6,
77
],
[
77,
78
],
[
101,
79
],
[
79,
80
],
[
79,
81
],
[
81,
82
],
[
82,
83
],
[
83,
84
],
[
83,
85
],
[
82,
86
],
[
86,
87
],
[
87,
88
],
[
81,
89
],
[
89,
90
],
[
90,
91
],
[
90,
92
],
[
90,
93
],
[
93,
94
],
[
93,
95
],
[
79,
96
],
[
96,
97
],
[
79,
98
],
[
98,
99
],
[
0,
100
],
[
100,
101
],
[
100,
102
]
] |
[
"import java.util.*;\npublic class Main{\n\tpublic static void main(String[] args)\n\t{\n\t\tScanner sc = new Scanner(System.in);\n\t\tint num = sc.nextInt();\n\t\tint a,b,c;\n\t\tint output = 0;\n\t\tfor(a = 1;a<=num;a++)\n\t\t\tfor(b = 1;b<=num;b++)\n\t\t\t\tfor(c = 1;c<=num;c++)\n\t\t\t\t\toutput += gcd(gcd(a,b),c);\n\t\tSystem.out.println(output);\n\t}\n\t\n\tpublic static int gcd(int p, int q)\n\t{\n\t\tif(q == 0)\n\t\t{\n\t\t\treturn p;\n\t\t}\n\t\treturn gcd(q,p%q);\n\t}\n\n}",
"import java.util.*;",
"util.*",
"java",
"public class Main{\n\tpublic static void main(String[] args)\n\t{\n\t\tScanner sc = new Scanner(System.in);\n\t\tint num = sc.nextInt();\n\t\tint a,b,c;\n\t\tint output = 0;\n\t\tfor(a = 1;a<=num;a++)\n\t\t\tfor(b = 1;b<=num;b++)\n\t\t\t\tfor(c = 1;c<=num;c++)\n\t\t\t\t\toutput += gcd(gcd(a,b),c);\n\t\tSystem.out.println(output);\n\t}\n\t\n\tpublic static int gcd(int p, int q)\n\t{\n\t\tif(q == 0)\n\t\t{\n\t\t\treturn p;\n\t\t}\n\t\treturn gcd(q,p%q);\n\t}\n\n}",
"Main",
"public static void main(String[] args)\n\t{\n\t\tScanner sc = new Scanner(System.in);\n\t\tint num = sc.nextInt();\n\t\tint a,b,c;\n\t\tint output = 0;\n\t\tfor(a = 1;a<=num;a++)\n\t\t\tfor(b = 1;b<=num;b++)\n\t\t\t\tfor(c = 1;c<=num;c++)\n\t\t\t\t\toutput += gcd(gcd(a,b),c);\n\t\tSystem.out.println(output);\n\t}",
"main",
"{\n\t\tScanner sc = new Scanner(System.in);\n\t\tint num = sc.nextInt();\n\t\tint a,b,c;\n\t\tint output = 0;\n\t\tfor(a = 1;a<=num;a++)\n\t\t\tfor(b = 1;b<=num;b++)\n\t\t\t\tfor(c = 1;c<=num;c++)\n\t\t\t\t\toutput += gcd(gcd(a,b),c);\n\t\tSystem.out.println(output);\n\t}",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"int num = sc.nextInt();",
"num",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int a",
"a",
"b",
"b",
"c;",
"c",
"int output = 0;",
"output",
"0",
"for(a = 1;a<=num;a++)\n\t\t\tfor(b = 1;b<=num;b++)\n\t\t\t\tfor(c = 1;c<=num;c++)\n\t\t\t\t\toutput += gcd(gcd(a,b),c);",
"a = 1;",
"a = 1",
"a",
"1",
"a<=num",
"a",
"num",
"a++",
"a++",
"a",
"for(b = 1;b<=num;b++)\n\t\t\t\tfor(c = 1;c<=num;c++)\n\t\t\t\t\toutput += gcd(gcd(a,b),c);",
"for(b = 1;b<=num;b++)\n\t\t\t\tfor(c = 1;c<=num;c++)\n\t\t\t\t\toutput += gcd(gcd(a,b),c);",
"b = 1;",
"b = 1",
"b",
"1",
"b<=num",
"b",
"num",
"b++",
"b++",
"b",
"for(c = 1;c<=num;c++)\n\t\t\t\t\toutput += gcd(gcd(a,b),c);",
"for(c = 1;c<=num;c++)\n\t\t\t\t\toutput += gcd(gcd(a,b),c);",
"c = 1;",
"c = 1",
"c",
"1",
"c<=num",
"c",
"num",
"c++",
"c++",
"c",
"output += gcd(gcd(a,b),c);",
"output += gcd(gcd(a,b),c)",
"output",
"gcd(gcd(a,b),c)",
"gcd",
"gcd(a,b)",
"gcd",
"a",
"b",
"c",
"System.out.println(output)",
"System.out.println",
"System.out",
"System",
"System.out",
"output",
"String[] args",
"args",
"public static int gcd(int p, int q)\n\t{\n\t\tif(q == 0)\n\t\t{\n\t\t\treturn p;\n\t\t}\n\t\treturn gcd(q,p%q);\n\t}",
"gcd",
"{\n\t\tif(q == 0)\n\t\t{\n\t\t\treturn p;\n\t\t}\n\t\treturn gcd(q,p%q);\n\t}",
"if(q == 0)\n\t\t{\n\t\t\treturn p;\n\t\t}",
"q == 0",
"q",
"0",
"{\n\t\t\treturn p;\n\t\t}",
"return p;",
"p",
"return gcd(q,p%q);",
"gcd(q,p%q)",
"gcd",
"q",
"p%q",
"p",
"q",
"int p",
"p",
"int q",
"q",
"public class Main{\n\tpublic static void main(String[] args)\n\t{\n\t\tScanner sc = new Scanner(System.in);\n\t\tint num = sc.nextInt();\n\t\tint a,b,c;\n\t\tint output = 0;\n\t\tfor(a = 1;a<=num;a++)\n\t\t\tfor(b = 1;b<=num;b++)\n\t\t\t\tfor(c = 1;c<=num;c++)\n\t\t\t\t\toutput += gcd(gcd(a,b),c);\n\t\tSystem.out.println(output);\n\t}\n\t\n\tpublic static int gcd(int p, int q)\n\t{\n\t\tif(q == 0)\n\t\t{\n\t\t\treturn p;\n\t\t}\n\t\treturn gcd(q,p%q);\n\t}\n\n}",
"public class Main{\n\tpublic static void main(String[] args)\n\t{\n\t\tScanner sc = new Scanner(System.in);\n\t\tint num = sc.nextInt();\n\t\tint a,b,c;\n\t\tint output = 0;\n\t\tfor(a = 1;a<=num;a++)\n\t\t\tfor(b = 1;b<=num;b++)\n\t\t\t\tfor(c = 1;c<=num;c++)\n\t\t\t\t\toutput += gcd(gcd(a,b),c);\n\t\tSystem.out.println(output);\n\t}\n\t\n\tpublic static int gcd(int p, int q)\n\t{\n\t\tif(q == 0)\n\t\t{\n\t\t\treturn p;\n\t\t}\n\t\treturn gcd(q,p%q);\n\t}\n\n}",
"Main"
] |
import java.util.*;
public class Main{
public static void main(String[] args)
{
Scanner sc = new Scanner(System.in);
int num = sc.nextInt();
int a,b,c;
int output = 0;
for(a = 1;a<=num;a++)
for(b = 1;b<=num;b++)
for(c = 1;c<=num;c++)
output += gcd(gcd(a,b),c);
System.out.println(output);
}
public static int gcd(int p, int q)
{
if(q == 0)
{
return p;
}
return gcd(q,p%q);
}
}
|
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
4,
13,
4,
13,
13,
13,
13,
4,
18,
18,
13,
13,
13,
23,
13,
12,
13,
30,
41,
13,
42,
2,
2,
13,
13,
17,
30,
0,
13,
13,
0,
13,
2,
13,
13,
0,
13,
13,
29,
13,
23,
13,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
106,
5
],
[
106,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
8,
17
],
[
17,
18
],
[
17,
19
],
[
8,
20
],
[
20,
21
],
[
21,
22
],
[
22,
23
],
[
22,
24
],
[
20,
25
],
[
25,
26
],
[
25,
27
],
[
20,
28
],
[
28,
29
],
[
29,
30
],
[
20,
31
],
[
32,
32
],
[
32,
33
],
[
33,
34
],
[
34,
35
],
[
35,
36
],
[
35,
37
],
[
33,
38
],
[
38,
39
],
[
38,
40
],
[
33,
41
],
[
41,
42
],
[
42,
43
],
[
33,
44
],
[
45,
45
],
[
45,
46
],
[
46,
47
],
[
47,
48
],
[
48,
49
],
[
48,
50
],
[
46,
51
],
[
51,
52
],
[
51,
53
],
[
46,
54
],
[
54,
55
],
[
55,
56
],
[
46,
57
],
[
58,
58
],
[
58,
59
],
[
59,
60
],
[
59,
61
],
[
61,
62
],
[
61,
63
],
[
63,
64
],
[
63,
65
],
[
63,
66
],
[
61,
67
],
[
8,
68
],
[
68,
69
],
[
69,
70
],
[
70,
71
],
[
70,
72
],
[
68,
73
],
[
6,
74
],
[
74,
75
],
[
106,
76
],
[
76,
77
],
[
76,
78
],
[
78,
79
],
[
79,
80
],
[
78,
81
],
[
81,
82
],
[
82,
83
],
[
83,
84
],
[
83,
85
],
[
82,
86
],
[
81,
87
],
[
87,
88
],
[
88,
89
],
[
88,
90
],
[
87,
91
],
[
91,
92
],
[
91,
93
],
[
93,
94
],
[
93,
95
],
[
87,
96
],
[
96,
97
],
[
96,
98
],
[
78,
99
],
[
99,
100
],
[
76,
101
],
[
101,
102
],
[
76,
103
],
[
103,
104
],
[
0,
105
],
[
105,
106
],
[
105,
107
]
] |
[
"\nimport 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\n\t\tint k = sc.nextInt();\n\t\tlong total = 0;\n\n\t\tfor(int i = 1; i <= k; i++) {\n\t\t\tfor(int j = 1; j <= k; j++) {\n\t\t\t\tfor(int l = 1; l <= k; l++) {\n\t\t\t\t\ttotal += gcd(gcd(i,j),l);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tSystem.out.println(total);\n\t}\n\n\tstatic int gcd(int a, int b){\n\t\tint tmp;\n\n\t\twhile (a % b != 0)\n\t\t{\n\t\t\ttmp = b;\n\t\t\tb = a % b;\n\t\t\ta = tmp;\n\t\t}\n\t\treturn b;\n\t}\n\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n\n\tpublic static void main(String[] args) {\n\t\t// TODO 自動生成されたメソッド・スタブ\n\t\tScanner sc = new Scanner(System.in);\n\n\t\tint k = sc.nextInt();\n\t\tlong total = 0;\n\n\t\tfor(int i = 1; i <= k; i++) {\n\t\t\tfor(int j = 1; j <= k; j++) {\n\t\t\t\tfor(int l = 1; l <= k; l++) {\n\t\t\t\t\ttotal += gcd(gcd(i,j),l);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tSystem.out.println(total);\n\t}\n\n\tstatic int gcd(int a, int b){\n\t\tint tmp;\n\n\t\twhile (a % b != 0)\n\t\t{\n\t\t\ttmp = b;\n\t\t\tb = a % b;\n\t\t\ta = tmp;\n\t\t}\n\t\treturn b;\n\t}\n\n}",
"Main",
"public static void main(String[] args) {\n\t\t// TODO 自動生成されたメソッド・スタブ\n\t\tScanner sc = new Scanner(System.in);\n\n\t\tint k = sc.nextInt();\n\t\tlong total = 0;\n\n\t\tfor(int i = 1; i <= k; i++) {\n\t\t\tfor(int j = 1; j <= k; j++) {\n\t\t\t\tfor(int l = 1; l <= k; l++) {\n\t\t\t\t\ttotal += gcd(gcd(i,j),l);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tSystem.out.println(total);\n\t}",
"main",
"{\n\t\t// TODO 自動生成されたメソッド・スタブ\n\t\tScanner sc = new Scanner(System.in);\n\n\t\tint k = sc.nextInt();\n\t\tlong total = 0;\n\n\t\tfor(int i = 1; i <= k; i++) {\n\t\t\tfor(int j = 1; j <= k; j++) {\n\t\t\t\tfor(int l = 1; l <= k; l++) {\n\t\t\t\t\ttotal += gcd(gcd(i,j),l);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tSystem.out.println(total);\n\t}",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"int k = sc.nextInt();",
"k",
"sc.nextInt()",
"sc.nextInt",
"sc",
"long total = 0;",
"total",
"0",
"for(int i = 1; i <= k; i++) {\n\t\t\tfor(int j = 1; j <= k; j++) {\n\t\t\t\tfor(int l = 1; l <= k; l++) {\n\t\t\t\t\ttotal += gcd(gcd(i,j),l);\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"int i = 1;",
"int i = 1;",
"i",
"1",
"i <= k",
"i",
"k",
"i++",
"i++",
"i",
"{\n\t\t\tfor(int j = 1; j <= k; j++) {\n\t\t\t\tfor(int l = 1; l <= k; l++) {\n\t\t\t\t\ttotal += gcd(gcd(i,j),l);\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"{\n\t\t\tfor(int j = 1; j <= k; j++) {\n\t\t\t\tfor(int l = 1; l <= k; l++) {\n\t\t\t\t\ttotal += gcd(gcd(i,j),l);\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"for(int j = 1; j <= k; j++) {\n\t\t\t\tfor(int l = 1; l <= k; l++) {\n\t\t\t\t\ttotal += gcd(gcd(i,j),l);\n\t\t\t\t}\n\t\t\t}",
"int j = 1;",
"int j = 1;",
"j",
"1",
"j <= k",
"j",
"k",
"j++",
"j++",
"j",
"{\n\t\t\t\tfor(int l = 1; l <= k; l++) {\n\t\t\t\t\ttotal += gcd(gcd(i,j),l);\n\t\t\t\t}\n\t\t\t}",
"{\n\t\t\t\tfor(int l = 1; l <= k; l++) {\n\t\t\t\t\ttotal += gcd(gcd(i,j),l);\n\t\t\t\t}\n\t\t\t}",
"for(int l = 1; l <= k; l++) {\n\t\t\t\t\ttotal += gcd(gcd(i,j),l);\n\t\t\t\t}",
"int l = 1;",
"int l = 1;",
"l",
"1",
"l <= k",
"l",
"k",
"l++",
"l++",
"l",
"{\n\t\t\t\t\ttotal += gcd(gcd(i,j),l);\n\t\t\t\t}",
"{\n\t\t\t\t\ttotal += gcd(gcd(i,j),l);\n\t\t\t\t}",
"total += gcd(gcd(i,j),l)",
"total",
"gcd(gcd(i,j),l)",
"gcd",
"gcd(i,j)",
"gcd",
"i",
"j",
"l",
"System.out.println(total)",
"System.out.println",
"System.out",
"System",
"System.out",
"total",
"String[] args",
"args",
"static int gcd(int a, int b){\n\t\tint tmp;\n\n\t\twhile (a % b != 0)\n\t\t{\n\t\t\ttmp = b;\n\t\t\tb = a % b;\n\t\t\ta = tmp;\n\t\t}\n\t\treturn b;\n\t}",
"gcd",
"{\n\t\tint tmp;\n\n\t\twhile (a % b != 0)\n\t\t{\n\t\t\ttmp = b;\n\t\t\tb = a % b;\n\t\t\ta = tmp;\n\t\t}\n\t\treturn b;\n\t}",
"int tmp;",
"tmp",
"while (a % b != 0)\n\t\t{\n\t\t\ttmp = b;\n\t\t\tb = a % b;\n\t\t\ta = tmp;\n\t\t}",
"a % b != 0",
"a % b",
"a",
"b",
"0",
"{\n\t\t\ttmp = b;\n\t\t\tb = a % b;\n\t\t\ta = tmp;\n\t\t}",
"tmp = b",
"tmp",
"b",
"b = a % b",
"b",
"a % b",
"a",
"b",
"a = tmp",
"a",
"tmp",
"return b;",
"b",
"int a",
"a",
"int b",
"b",
"public class Main {\n\n\tpublic static void main(String[] args) {\n\t\t// TODO 自動生成されたメソッド・スタブ\n\t\tScanner sc = new Scanner(System.in);\n\n\t\tint k = sc.nextInt();\n\t\tlong total = 0;\n\n\t\tfor(int i = 1; i <= k; i++) {\n\t\t\tfor(int j = 1; j <= k; j++) {\n\t\t\t\tfor(int l = 1; l <= k; l++) {\n\t\t\t\t\ttotal += gcd(gcd(i,j),l);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tSystem.out.println(total);\n\t}\n\n\tstatic int gcd(int a, int b){\n\t\tint tmp;\n\n\t\twhile (a % b != 0)\n\t\t{\n\t\t\ttmp = b;\n\t\t\tb = a % b;\n\t\t\ta = tmp;\n\t\t}\n\t\treturn b;\n\t}\n\n}",
"public class Main {\n\n\tpublic static void main(String[] args) {\n\t\t// TODO 自動生成されたメソッド・スタブ\n\t\tScanner sc = new Scanner(System.in);\n\n\t\tint k = sc.nextInt();\n\t\tlong total = 0;\n\n\t\tfor(int i = 1; i <= k; i++) {\n\t\t\tfor(int j = 1; j <= k; j++) {\n\t\t\t\tfor(int l = 1; l <= k; l++) {\n\t\t\t\t\ttotal += gcd(gcd(i,j),l);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tSystem.out.println(total);\n\t}\n\n\tstatic int gcd(int a, int b){\n\t\tint tmp;\n\n\t\twhile (a % b != 0)\n\t\t{\n\t\t\ttmp = b;\n\t\t\tb = a % b;\n\t\t\ta = tmp;\n\t\t}\n\t\treturn b;\n\t}\n\n}",
"Main"
] |
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
// TODO 自動生成されたメソッド・スタブ
Scanner sc = new Scanner(System.in);
int k = sc.nextInt();
long total = 0;
for(int i = 1; i <= k; i++) {
for(int j = 1; j <= k; j++) {
for(int l = 1; l <= k; l++) {
total += gcd(gcd(i,j),l);
}
}
}
System.out.println(total);
}
static int gcd(int a, int b){
int tmp;
while (a % b != 0)
{
tmp = b;
b = a % b;
a = tmp;
}
return b;
}
}
|
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
41,
13,
41,
13,
41,
13,
41,
13,
12,
13,
30,
41,
13,
18,
13,
13,
41,
13,
18,
13,
13,
41,
13,
20,
41,
13,
20,
4,
13,
13,
13,
4,
18,
13,
23,
13,
12,
13,
30,
41,
13,
17,
23,
13,
23,
13,
12,
13,
30,
41,
13,
20,
11,
1,
41,
13,
17,
2,
13,
18,
13,
13,
1,
40,
13,
30,
4,
18,
13,
18,
13,
13,
4,
18,
13,
13,
11,
1,
41,
13,
17,
2,
13,
18,
13,
13,
1,
40,
13,
30,
0,
18,
13,
13,
4,
18,
13,
13,
23,
13,
12,
13,
30,
41,
13,
18,
13,
13,
0,
18,
13,
13,
18,
13,
13,
0,
18,
13,
13,
13,
23,
13,
23,
13,
23,
13,
12,
13,
30,
41,
13,
17,
42,
2,
13,
17,
30,
0,
13,
2,
13,
17,
0,
13,
17,
29,
13,
23,
13,
12,
13,
30,
14,
2,
13,
17,
29,
17,
14,
2,
13,
17,
29,
17,
14,
2,
2,
2,
13,
17,
17,
2,
2,
13,
17,
17,
29,
17,
11,
1,
41,
13,
17,
2,
2,
13,
13,
13,
1,
0,
13,
2,
13,
17,
30,
14,
2,
2,
2,
13,
13,
17,
2,
2,
13,
2,
13,
17,
17,
29,
17,
29,
17,
23,
13,
12,
13,
30,
14,
2,
13,
17,
29,
13,
29,
8,
2,
13,
13,
4,
13,
13,
2,
13,
13,
4,
13,
13,
2,
13,
13,
23,
13,
23,
13,
12,
13,
30,
14,
2,
13,
17,
29,
17,
14,
2,
13,
17,
29,
13,
41,
13,
4,
13,
13,
2,
13,
17,
13,
14,
2,
2,
13,
17,
17,
29,
2,
2,
13,
13,
13,
29,
2,
2,
2,
2,
13,
13,
13,
13,
13,
23,
13,
23,
13,
23,
13,
12,
13,
30,
29,
4,
13,
13,
2,
13,
17,
13,
23,
13,
23,
13,
12,
13,
30,
11,
1,
41,
13,
17,
2,
13,
18,
13,
13,
1,
40,
13,
30,
0,
18,
13,
13,
4,
18,
13,
23,
13,
23,
13,
12,
13,
30,
11,
1,
41,
13,
17,
2,
13,
18,
13,
13,
1,
40,
13,
30,
0,
18,
13,
13,
4,
18,
13,
23,
13,
23,
13,
12,
13,
30,
11,
1,
41,
13,
17,
2,
13,
18,
13,
13,
1,
40,
13,
30,
0,
18,
13,
13,
4,
18,
13,
23,
13,
23,
13,
12,
13,
30,
11,
1,
41,
13,
17,
2,
13,
18,
13,
13,
1,
40,
13,
30,
0,
18,
13,
13,
4,
18,
13,
23,
13,
23,
13,
12,
13,
30,
41,
13,
20,
28,
13,
13,
30,
4,
18,
13,
2,
13,
17,
29,
4,
18,
13,
23,
13,
12,
13,
30,
41,
13,
20,
28,
13,
13,
30,
4,
18,
13,
2,
13,
17,
29,
4,
18,
13,
23,
13,
12,
13,
30,
41,
13,
20,
28,
13,
13,
30,
4,
18,
13,
2,
13,
17,
29,
4,
18,
13,
23,
13,
12,
13,
30,
41,
13,
20,
28,
13,
13,
30,
4,
18,
13,
2,
13,
17,
29,
4,
18,
13,
23,
13,
6,
13,
41,
13,
41,
13,
12,
13,
30,
0,
18,
36,
13,
13,
0,
18,
36,
13,
13,
23,
13,
23,
13,
6,
13,
41,
13,
41,
13,
12,
13,
30,
0,
13,
20,
0,
13,
17,
23,
13,
12,
13,
30,
42,
2,
2,
13,
17,
40,
4,
18,
13,
30,
38,
5,
13,
30,
37,
20,
30,
0,
13,
20,
29,
4,
18,
13,
12,
13,
30,
29,
4,
18,
13,
4,
13,
12,
13,
30,
29,
4,
18,
13,
4,
13,
12,
13,
30,
29,
4,
18,
13,
4,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
619,
11
],
[
619,
12
],
[
12,
13
],
[
619,
14
],
[
14,
15
],
[
619,
16
],
[
16,
17
],
[
619,
18
],
[
18,
19
],
[
619,
20
],
[
20,
21
],
[
20,
22
],
[
22,
23
],
[
23,
24
],
[
23,
25
],
[
25,
26
],
[
25,
27
],
[
22,
28
],
[
28,
29
],
[
28,
30
],
[
30,
31
],
[
30,
32
],
[
22,
33
],
[
33,
34
],
[
33,
35
],
[
22,
36
],
[
36,
37
],
[
36,
38
],
[
22,
39
],
[
39,
40
],
[
39,
41
],
[
39,
42
],
[
22,
43
],
[
43,
44
],
[
44,
45
],
[
20,
46
],
[
46,
47
],
[
619,
48
],
[
48,
49
],
[
48,
50
],
[
50,
51
],
[
51,
52
],
[
51,
53
],
[
48,
54
],
[
54,
55
],
[
48,
56
],
[
56,
57
],
[
619,
58
],
[
58,
59
],
[
58,
60
],
[
60,
61
],
[
61,
62
],
[
61,
63
],
[
60,
64
],
[
64,
65
],
[
65,
66
],
[
66,
67
],
[
66,
68
],
[
64,
69
],
[
69,
70
],
[
69,
71
],
[
71,
72
],
[
71,
73
],
[
64,
74
],
[
74,
75
],
[
75,
76
],
[
64,
77
],
[
77,
78
],
[
78,
79
],
[
79,
80
],
[
78,
81
],
[
81,
82
],
[
81,
83
],
[
60,
84
],
[
84,
85
],
[
85,
86
],
[
84,
87
],
[
60,
88
],
[
88,
89
],
[
89,
90
],
[
90,
91
],
[
90,
92
],
[
88,
93
],
[
93,
94
],
[
93,
95
],
[
95,
96
],
[
95,
97
],
[
88,
98
],
[
98,
99
],
[
99,
100
],
[
88,
101
],
[
101,
102
],
[
102,
103
],
[
103,
104
],
[
103,
105
],
[
102,
106
],
[
106,
107
],
[
107,
108
],
[
106,
109
],
[
58,
110
],
[
110,
111
],
[
619,
112
],
[
112,
113
],
[
112,
114
],
[
114,
115
],
[
115,
116
],
[
115,
117
],
[
117,
118
],
[
117,
119
],
[
114,
120
],
[
120,
121
],
[
121,
122
],
[
121,
123
],
[
120,
124
],
[
124,
125
],
[
124,
126
],
[
114,
127
],
[
127,
128
],
[
128,
129
],
[
128,
130
],
[
127,
131
],
[
112,
132
],
[
132,
133
],
[
112,
134
],
[
134,
135
],
[
112,
136
],
[
136,
137
],
[
619,
138
],
[
138,
139
],
[
138,
140
],
[
140,
141
],
[
141,
142
],
[
141,
143
],
[
140,
144
],
[
144,
145
],
[
145,
146
],
[
145,
147
],
[
144,
148
],
[
148,
149
],
[
149,
150
],
[
149,
151
],
[
151,
152
],
[
151,
153
],
[
148,
154
],
[
154,
155
],
[
154,
156
],
[
140,
157
],
[
157,
158
],
[
138,
159
],
[
159,
160
],
[
619,
161
],
[
161,
162
],
[
161,
163
],
[
163,
164
],
[
164,
165
],
[
165,
166
],
[
165,
167
],
[
164,
168
],
[
168,
169
],
[
163,
170
],
[
170,
171
],
[
171,
172
],
[
171,
173
],
[
170,
174
],
[
174,
175
],
[
163,
176
],
[
176,
177
],
[
177,
178
],
[
178,
179
],
[
179,
180
],
[
179,
181
],
[
178,
182
],
[
177,
183
],
[
183,
184
],
[
184,
185
],
[
184,
186
],
[
183,
187
],
[
176,
188
],
[
188,
189
],
[
163,
190
],
[
190,
191
],
[
191,
192
],
[
192,
193
],
[
192,
194
],
[
190,
195
],
[
195,
196
],
[
196,
197
],
[
196,
198
],
[
195,
199
],
[
190,
200
],
[
200,
201
],
[
201,
202
],
[
201,
203
],
[
203,
204
],
[
203,
205
],
[
190,
206
],
[
206,
207
],
[
207,
208
],
[
208,
209
],
[
209,
210
],
[
210,
211
],
[
210,
212
],
[
209,
213
],
[
208,
214
],
[
214,
215
],
[
215,
216
],
[
215,
217
],
[
217,
218
],
[
217,
219
],
[
214,
220
],
[
207,
221
],
[
221,
222
],
[
163,
223
],
[
223,
224
],
[
161,
225
],
[
225,
226
],
[
619,
227
],
[
227,
228
],
[
227,
229
],
[
229,
230
],
[
230,
231
],
[
231,
232
],
[
231,
233
],
[
230,
234
],
[
234,
235
],
[
229,
236
],
[
236,
237
],
[
237,
238
],
[
238,
239
],
[
238,
240
],
[
237,
241
],
[
241,
242
],
[
241,
243
],
[
241,
244
],
[
244,
245
],
[
244,
246
],
[
237,
247
],
[
247,
248
],
[
247,
249
],
[
247,
250
],
[
250,
251
],
[
250,
252
],
[
227,
253
],
[
253,
254
],
[
227,
255
],
[
255,
256
],
[
619,
257
],
[
257,
258
],
[
257,
259
],
[
259,
260
],
[
260,
261
],
[
261,
262
],
[
261,
263
],
[
260,
264
],
[
264,
265
],
[
259,
266
],
[
266,
267
],
[
267,
268
],
[
267,
269
],
[
266,
270
],
[
270,
271
],
[
259,
272
],
[
272,
273
],
[
272,
274
],
[
274,
275
],
[
274,
276
],
[
274,
277
],
[
277,
278
],
[
277,
279
],
[
274,
280
],
[
259,
281
],
[
281,
282
],
[
282,
283
],
[
283,
284
],
[
283,
285
],
[
282,
286
],
[
281,
287
],
[
287,
288
],
[
288,
289
],
[
289,
290
],
[
289,
291
],
[
288,
292
],
[
281,
293
],
[
293,
294
],
[
294,
295
],
[
295,
296
],
[
296,
297
],
[
297,
298
],
[
297,
299
],
[
296,
300
],
[
295,
301
],
[
294,
302
],
[
257,
303
],
[
303,
304
],
[
257,
305
],
[
305,
306
],
[
257,
307
],
[
307,
308
],
[
619,
309
],
[
309,
310
],
[
309,
311
],
[
311,
312
],
[
312,
313
],
[
313,
314
],
[
313,
315
],
[
313,
316
],
[
316,
317
],
[
316,
318
],
[
313,
319
],
[
309,
320
],
[
320,
321
],
[
309,
322
],
[
322,
323
],
[
619,
324
],
[
324,
325
],
[
324,
326
],
[
326,
327
],
[
327,
328
],
[
328,
329
],
[
329,
330
],
[
329,
331
],
[
327,
332
],
[
332,
333
],
[
332,
334
],
[
334,
335
],
[
334,
336
],
[
327,
337
],
[
337,
338
],
[
338,
339
],
[
327,
340
],
[
340,
341
],
[
341,
342
],
[
342,
343
],
[
342,
344
],
[
341,
345
],
[
345,
346
],
[
346,
347
],
[
324,
348
],
[
348,
349
],
[
324,
350
],
[
350,
351
],
[
619,
352
],
[
352,
353
],
[
352,
354
],
[
354,
355
],
[
355,
356
],
[
356,
357
],
[
357,
358
],
[
357,
359
],
[
355,
360
],
[
360,
361
],
[
360,
362
],
[
362,
363
],
[
362,
364
],
[
355,
365
],
[
365,
366
],
[
366,
367
],
[
355,
368
],
[
368,
369
],
[
369,
370
],
[
370,
371
],
[
370,
372
],
[
369,
373
],
[
373,
374
],
[
374,
375
],
[
352,
376
],
[
376,
377
],
[
352,
378
],
[
378,
379
],
[
619,
380
],
[
380,
381
],
[
380,
382
],
[
382,
383
],
[
383,
384
],
[
384,
385
],
[
385,
386
],
[
385,
387
],
[
383,
388
],
[
388,
389
],
[
388,
390
],
[
390,
391
],
[
390,
392
],
[
383,
393
],
[
393,
394
],
[
394,
395
],
[
383,
396
],
[
396,
397
],
[
397,
398
],
[
398,
399
],
[
398,
400
],
[
397,
401
],
[
401,
402
],
[
402,
403
],
[
380,
404
],
[
404,
405
],
[
380,
406
],
[
406,
407
],
[
619,
408
],
[
408,
409
],
[
408,
410
],
[
410,
411
],
[
411,
412
],
[
412,
413
],
[
413,
414
],
[
413,
415
],
[
411,
416
],
[
416,
417
],
[
416,
418
],
[
418,
419
],
[
418,
420
],
[
411,
421
],
[
421,
422
],
[
422,
423
],
[
411,
424
],
[
424,
425
],
[
425,
426
],
[
426,
427
],
[
426,
428
],
[
425,
429
],
[
429,
430
],
[
430,
431
],
[
408,
432
],
[
432,
433
],
[
408,
434
],
[
434,
435
],
[
619,
436
],
[
436,
437
],
[
436,
438
],
[
438,
439
],
[
439,
440
],
[
439,
441
],
[
438,
442
],
[
442,
443
],
[
442,
444
],
[
442,
445
],
[
445,
446
],
[
446,
447
],
[
447,
448
],
[
446,
449
],
[
449,
450
],
[
449,
451
],
[
438,
452
],
[
452,
453
],
[
453,
454
],
[
454,
455
],
[
436,
456
],
[
456,
457
],
[
619,
458
],
[
458,
459
],
[
458,
460
],
[
460,
461
],
[
461,
462
],
[
461,
463
],
[
460,
464
],
[
464,
465
],
[
464,
466
],
[
464,
467
],
[
467,
468
],
[
468,
469
],
[
469,
470
],
[
468,
471
],
[
471,
472
],
[
471,
473
],
[
460,
474
],
[
474,
475
],
[
475,
476
],
[
476,
477
],
[
458,
478
],
[
478,
479
],
[
619,
480
],
[
480,
481
],
[
480,
482
],
[
482,
483
],
[
483,
484
],
[
483,
485
],
[
482,
486
],
[
486,
487
],
[
486,
488
],
[
486,
489
],
[
489,
490
],
[
490,
491
],
[
491,
492
],
[
490,
493
],
[
493,
494
],
[
493,
495
],
[
482,
496
],
[
496,
497
],
[
497,
498
],
[
498,
499
],
[
480,
500
],
[
500,
501
],
[
619,
502
],
[
502,
503
],
[
502,
504
],
[
504,
505
],
[
505,
506
],
[
505,
507
],
[
504,
508
],
[
508,
509
],
[
508,
510
],
[
508,
511
],
[
511,
512
],
[
512,
513
],
[
513,
514
],
[
512,
515
],
[
515,
516
],
[
515,
517
],
[
504,
518
],
[
518,
519
],
[
519,
520
],
[
520,
521
],
[
502,
522
],
[
522,
523
],
[
619,
524
],
[
524,
525
],
[
524,
526
],
[
526,
527
],
[
524,
528
],
[
528,
529
],
[
524,
530
],
[
530,
531
],
[
530,
532
],
[
532,
533
],
[
533,
534
],
[
534,
535
],
[
534,
536
],
[
533,
537
],
[
532,
538
],
[
538,
539
],
[
539,
540
],
[
539,
541
],
[
538,
542
],
[
530,
543
],
[
543,
544
],
[
530,
545
],
[
545,
546
],
[
619,
547
],
[
547,
548
],
[
547,
549
],
[
549,
550
],
[
547,
551
],
[
551,
552
],
[
547,
553
],
[
553,
554
],
[
553,
555
],
[
555,
556
],
[
556,
557
],
[
556,
558
],
[
555,
559
],
[
559,
560
],
[
559,
561
],
[
553,
562
],
[
562,
563
],
[
547,
564
],
[
564,
565
],
[
564,
566
],
[
566,
567
],
[
567,
568
],
[
568,
569
],
[
569,
570
],
[
569,
571
],
[
568,
572
],
[
572,
573
],
[
573,
574
],
[
574,
575
],
[
567,
576
],
[
576,
577
],
[
577,
578
],
[
578,
579
],
[
578,
580
],
[
580,
581
],
[
581,
582
],
[
577,
583
],
[
583,
584
],
[
584,
585
],
[
584,
586
],
[
566,
587
],
[
587,
588
],
[
588,
589
],
[
589,
590
],
[
547,
591
],
[
591,
592
],
[
591,
593
],
[
593,
594
],
[
594,
595
],
[
595,
596
],
[
596,
597
],
[
595,
598
],
[
598,
599
],
[
547,
600
],
[
600,
601
],
[
600,
602
],
[
602,
603
],
[
603,
604
],
[
604,
605
],
[
605,
606
],
[
604,
607
],
[
607,
608
],
[
547,
609
],
[
609,
610
],
[
609,
611
],
[
611,
612
],
[
612,
613
],
[
613,
614
],
[
614,
615
],
[
613,
616
],
[
616,
617
],
[
0,
618
],
[
618,
619
],
[
618,
620
]
] |
[
"import java.io.*;\nimport java.util.*;\nimport java.lang.*;\npublic class Main{\n public static void main(String[] args) {\n InputStream inputStream = System.in;\n OutputStream outputStream = System.out;\n InputReader in = new InputReader(inputStream);\n PrintWriter out = new PrintWriter(outputStream);\n solve(in, out);\n out.close();\n }\n static int L,R,top,bottom;\n // static int ans;\n public static void solve(InputReader sc, PrintWriter pw) {\n // int t=sc.nextInt();\n int t=1;\n u:while(t-->0){\n int n=sc.nextInt();\n long ans=0;\n for(int i=1;i<=n;i++)\n for(int j=1;j<=n;j++)\n for(int k=1;k<=n;k++)\n ans+=gcd(k,gcd(j,i));\n pw.println(ans);\n }\n }\n public static void sort(long []arr){\n ArrayList<Long> list=new ArrayList<>();\n for(int i=0;i<arr.length;i++)\n list.add(arr[i]);\n Collections.sort(list);\n for(int i=0;i<arr.length;i++)\n arr[i]=list.get(i);\n }\n public static void swap(char []chrr, int i, int j){\n char temp=chrr[i];\n chrr[i]=chrr[j];\n chrr[j]=temp;\n }\n public static int num(int n){\n int a=0;\n while(n>0){\n a+=(n&1);\n n>>=1;\n }\n return a;\n }\n static class Pair{\n long u, v;\n Pair(long a,long b){\n this.u=a;\n this.v=b;\n } \n }\n // public int compareTo(Pair p){\n // return (b-p.b);\n // }\n // public int hashCode(){\n // int hashcode = (a+\" \"+b).hashCode();\n // return hashcode;\n // }\n \n // public boolean equals(Object obj){\n // if (obj instanceof Pair) {\n // Pair p = (Pair) obj;\n // return (p.a==this.a && p.b == this.b);\n // }\n // return false;\n // }\n \n static boolean isPrime(int n) { \n if (n <= 1) \n return false; \n if (n <= 3) \n return true; \n if (n % 2 == 0 || n % 3 == 0) \n return false; \n for (int i = 5; i * i <= n; i = i + 6) \n if (n % i == 0 || n % (i + 2) == 0) \n return false; \n return true; \n } \n static int gcd(int a, int b) { \n if (b == 0) \n return a; \n return a>b?gcd(b, a % b):gcd(a, b % a); \n } \n static long fast_pow(long base,long n,long M){\n if(n==0)\n return 1;\n if(n==1)\n return base;\n long halfn=fast_pow(base,n/2,M);\n if(n%2==0)\n return ( halfn * halfn ) % M;\n else\n return ( ( ( halfn * halfn ) % M ) * base ) % M;\n }\n static long modInverse(long n,long M){\n return fast_pow(n,M-2,M);\n }\n public static void feedArr(long []arr,InputReader sc){\n for(int i=0;i<arr.length;i++)\n arr[i]=sc.nextLong();\n }\n public static void feedArr(double []arr,InputReader sc){\n for(int i=0;i<arr.length;i++)\n arr[i]=sc.nextDouble();\n }\n public static void feedArr(int []arr,InputReader sc){\n for(int i=0;i<arr.length;i++)\n arr[i]=sc.nextInt();\n }\n public static void feedArr(String []arr,InputReader sc){\n for(int i=0;i<arr.length;i++)\n arr[i]=sc.next();\n }\n public static String printArr(int []arr){\n StringBuilder sbr=new StringBuilder();\n for(int i:arr)\n sbr.append(i+\" \");\n return sbr.toString();\n }\n public static String printArr(long []arr){\n StringBuilder sbr=new StringBuilder();\n for(long i:arr)\n sbr.append(i+\" \");\n return sbr.toString();\n }\n public static String printArr(String []arr){\n StringBuilder sbr=new StringBuilder();\n for(String i:arr)\n sbr.append(i+\" \");\n return sbr.toString();\n }\n public static String printArr(double []arr){\n StringBuilder sbr=new StringBuilder();\n for(double i:arr)\n sbr.append(i+\" \");\n return sbr.toString();\n }\n static class InputReader {\n public BufferedReader reader;\n public StringTokenizer tokenizer;\n \n public InputReader(InputStream stream) {\n reader = new BufferedReader(new InputStreamReader(stream), 32768);\n tokenizer = null;\n }\n \n public String next() {\n while (tokenizer == null || !tokenizer.hasMoreTokens()) {\n try {\n tokenizer = new StringTokenizer(reader.readLine());\n } catch (IOException e) {\n throw new RuntimeException(e);\n }\n }\n return tokenizer.nextToken();\n }\n public int nextInt() {\n return Integer.parseInt(next());\n }\n public long nextLong() {\n return Long.parseLong(next());\n }\n public double nextDouble() {\n return Double.parseDouble(next());\n }\n }\n} ",
"import java.io.*;",
"io.*",
"java",
"import java.util.*;",
"util.*",
"java",
"import java.lang.*;",
"lang.*",
"java",
"public class Main{\n public static void main(String[] args) {\n InputStream inputStream = System.in;\n OutputStream outputStream = System.out;\n InputReader in = new InputReader(inputStream);\n PrintWriter out = new PrintWriter(outputStream);\n solve(in, out);\n out.close();\n }\n static int L,R,top,bottom;\n // static int ans;\n public static void solve(InputReader sc, PrintWriter pw) {\n // int t=sc.nextInt();\n int t=1;\n u:while(t-->0){\n int n=sc.nextInt();\n long ans=0;\n for(int i=1;i<=n;i++)\n for(int j=1;j<=n;j++)\n for(int k=1;k<=n;k++)\n ans+=gcd(k,gcd(j,i));\n pw.println(ans);\n }\n }\n public static void sort(long []arr){\n ArrayList<Long> list=new ArrayList<>();\n for(int i=0;i<arr.length;i++)\n list.add(arr[i]);\n Collections.sort(list);\n for(int i=0;i<arr.length;i++)\n arr[i]=list.get(i);\n }\n public static void swap(char []chrr, int i, int j){\n char temp=chrr[i];\n chrr[i]=chrr[j];\n chrr[j]=temp;\n }\n public static int num(int n){\n int a=0;\n while(n>0){\n a+=(n&1);\n n>>=1;\n }\n return a;\n }\n static class Pair{\n long u, v;\n Pair(long a,long b){\n this.u=a;\n this.v=b;\n } \n }\n // public int compareTo(Pair p){\n // return (b-p.b);\n // }\n // public int hashCode(){\n // int hashcode = (a+\" \"+b).hashCode();\n // return hashcode;\n // }\n \n // public boolean equals(Object obj){\n // if (obj instanceof Pair) {\n // Pair p = (Pair) obj;\n // return (p.a==this.a && p.b == this.b);\n // }\n // return false;\n // }\n \n static boolean isPrime(int n) { \n if (n <= 1) \n return false; \n if (n <= 3) \n return true; \n if (n % 2 == 0 || n % 3 == 0) \n return false; \n for (int i = 5; i * i <= n; i = i + 6) \n if (n % i == 0 || n % (i + 2) == 0) \n return false; \n return true; \n } \n static int gcd(int a, int b) { \n if (b == 0) \n return a; \n return a>b?gcd(b, a % b):gcd(a, b % a); \n } \n static long fast_pow(long base,long n,long M){\n if(n==0)\n return 1;\n if(n==1)\n return base;\n long halfn=fast_pow(base,n/2,M);\n if(n%2==0)\n return ( halfn * halfn ) % M;\n else\n return ( ( ( halfn * halfn ) % M ) * base ) % M;\n }\n static long modInverse(long n,long M){\n return fast_pow(n,M-2,M);\n }\n public static void feedArr(long []arr,InputReader sc){\n for(int i=0;i<arr.length;i++)\n arr[i]=sc.nextLong();\n }\n public static void feedArr(double []arr,InputReader sc){\n for(int i=0;i<arr.length;i++)\n arr[i]=sc.nextDouble();\n }\n public static void feedArr(int []arr,InputReader sc){\n for(int i=0;i<arr.length;i++)\n arr[i]=sc.nextInt();\n }\n public static void feedArr(String []arr,InputReader sc){\n for(int i=0;i<arr.length;i++)\n arr[i]=sc.next();\n }\n public static String printArr(int []arr){\n StringBuilder sbr=new StringBuilder();\n for(int i:arr)\n sbr.append(i+\" \");\n return sbr.toString();\n }\n public static String printArr(long []arr){\n StringBuilder sbr=new StringBuilder();\n for(long i:arr)\n sbr.append(i+\" \");\n return sbr.toString();\n }\n public static String printArr(String []arr){\n StringBuilder sbr=new StringBuilder();\n for(String i:arr)\n sbr.append(i+\" \");\n return sbr.toString();\n }\n public static String printArr(double []arr){\n StringBuilder sbr=new StringBuilder();\n for(double i:arr)\n sbr.append(i+\" \");\n return sbr.toString();\n }\n static class InputReader {\n public BufferedReader reader;\n public StringTokenizer tokenizer;\n \n public InputReader(InputStream stream) {\n reader = new BufferedReader(new InputStreamReader(stream), 32768);\n tokenizer = null;\n }\n \n public String next() {\n while (tokenizer == null || !tokenizer.hasMoreTokens()) {\n try {\n tokenizer = new StringTokenizer(reader.readLine());\n } catch (IOException e) {\n throw new RuntimeException(e);\n }\n }\n return tokenizer.nextToken();\n }\n public int nextInt() {\n return Integer.parseInt(next());\n }\n public long nextLong() {\n return Long.parseLong(next());\n }\n public double nextDouble() {\n return Double.parseDouble(next());\n }\n }\n}",
"Main",
"static int L",
"L",
"R",
"R",
"top",
"top",
"bottom;",
"bottom",
"public static void main(String[] args) {\n InputStream inputStream = System.in;\n OutputStream outputStream = System.out;\n InputReader in = new InputReader(inputStream);\n PrintWriter out = new PrintWriter(outputStream);\n solve(in, out);\n out.close();\n }",
"main",
"{\n InputStream inputStream = System.in;\n OutputStream outputStream = System.out;\n InputReader in = new InputReader(inputStream);\n PrintWriter out = new PrintWriter(outputStream);\n solve(in, out);\n out.close();\n }",
"InputStream inputStream = System.in;",
"inputStream",
"System.in",
"System",
"System.in",
"OutputStream outputStream = System.out;",
"outputStream",
"System.out",
"System",
"System.out",
"InputReader in = new InputReader(inputStream);",
"in",
"new InputReader(inputStream)",
"PrintWriter out = new PrintWriter(outputStream);",
"out",
"new PrintWriter(outputStream)",
"solve(in, out)",
"solve",
"in",
"out",
"out.close()",
"out.close",
"out",
"String[] args",
"args",
"// static int ans;\n public static void solve(InputReader sc, PrintWriter pw) {\n // int t=sc.nextInt();\n int t=1;\n u:while(t-->0){\n int n=sc.nextInt();\n long ans=0;\n for(int i=1;i<=n;i++)\n for(int j=1;j<=n;j++)\n for(int k=1;k<=n;k++)\n ans+=gcd(k,gcd(j,i));\n pw.println(ans);\n }\n }",
"solve",
"{\n // int t=sc.nextInt();\n int t=1;\n u:while(t-->0){\n int n=sc.nextInt();\n long ans=0;\n for(int i=1;i<=n;i++)\n for(int j=1;j<=n;j++)\n for(int k=1;k<=n;k++)\n ans+=gcd(k,gcd(j,i));\n pw.println(ans);\n }\n }",
"int t=1;",
"t",
"1",
"InputReader sc",
"sc",
"PrintWriter pw",
"pw",
"public static void sort(long []arr){\n ArrayList<Long> list=new ArrayList<>();\n for(int i=0;i<arr.length;i++)\n list.add(arr[i]);\n Collections.sort(list);\n for(int i=0;i<arr.length;i++)\n arr[i]=list.get(i);\n }",
"sort",
"{\n ArrayList<Long> list=new ArrayList<>();\n for(int i=0;i<arr.length;i++)\n list.add(arr[i]);\n Collections.sort(list);\n for(int i=0;i<arr.length;i++)\n arr[i]=list.get(i);\n }",
"ArrayList<Long> list=new ArrayList<>();",
"list",
"new ArrayList<>()",
"for(int i=0;i<arr.length;i++)\n list.add(arr[i]);",
"int i=0;",
"int i=0;",
"i",
"0",
"i<arr.length",
"i",
"arr.length",
"arr",
"arr.length",
"i++",
"i++",
"i",
"list.add(arr[i]);",
"list.add(arr[i])",
"list.add",
"list",
"arr[i]",
"arr",
"i",
"Collections.sort(list)",
"Collections.sort",
"Collections",
"list",
"for(int i=0;i<arr.length;i++)\n arr[i]=list.get(i);",
"int i=0;",
"int i=0;",
"i",
"0",
"i<arr.length",
"i",
"arr.length",
"arr",
"arr.length",
"i++",
"i++",
"i",
"arr[i]=list.get(i);",
"arr[i]=list.get(i)",
"arr[i]",
"arr",
"i",
"list.get(i)",
"list.get",
"list",
"i",
"long []arr",
"arr",
"public static void swap(char []chrr, int i, int j){\n char temp=chrr[i];\n chrr[i]=chrr[j];\n chrr[j]=temp;\n }",
"swap",
"{\n char temp=chrr[i];\n chrr[i]=chrr[j];\n chrr[j]=temp;\n }",
"char temp=chrr[i];",
"temp",
"chrr[i]",
"chrr",
"i",
"chrr[i]=chrr[j]",
"chrr[i]",
"chrr",
"i",
"chrr[j]",
"chrr",
"j",
"chrr[j]=temp",
"chrr[j]",
"chrr",
"j",
"temp",
"char []chrr",
"chrr",
"int i",
"i",
"int j",
"j",
"public static int num(int n){\n int a=0;\n while(n>0){\n a+=(n&1);\n n>>=1;\n }\n return a;\n }",
"num",
"{\n int a=0;\n while(n>0){\n a+=(n&1);\n n>>=1;\n }\n return a;\n }",
"int a=0;",
"a",
"0",
"while(n>0){\n a+=(n&1);\n n>>=1;\n }",
"n>0",
"n",
"0",
"{\n a+=(n&1);\n n>>=1;\n }",
"a+=(n&1)",
"a",
"(n&1)",
"n",
"1",
"n>>=1",
"n",
"1",
"return a;",
"a",
"int n",
"n",
"static boolean isPrime(int n) { \n if (n <= 1) \n return false; \n if (n <= 3) \n return true; \n if (n % 2 == 0 || n % 3 == 0) \n return false; \n for (int i = 5; i * i <= n; i = i + 6) \n if (n % i == 0 || n % (i + 2) == 0) \n return false; \n return true; \n }",
"isPrime",
"{ \n if (n <= 1) \n return false; \n if (n <= 3) \n return true; \n if (n % 2 == 0 || n % 3 == 0) \n return false; \n for (int i = 5; i * i <= n; i = i + 6) \n if (n % i == 0 || n % (i + 2) == 0) \n return false; \n return true; \n }",
"if (n <= 1) \n return false;",
"n <= 1",
"n",
"1",
"return false;",
"false",
"if (n <= 3) \n return true;",
"n <= 3",
"n",
"3",
"return true;",
"true",
"if (n % 2 == 0 || n % 3 == 0) \n return false;",
"n % 2 == 0 || n % 3 == 0",
"n % 2 == 0",
"n % 2",
"n",
"2",
"0",
"n % 3 == 0",
"n % 3",
"n",
"3",
"0",
"return false;",
"false",
"for (int i = 5; i * i <= n; i = i + 6) \n if (n % i == 0 || n % (i + 2) == 0) \n return false;",
"int i = 5;",
"int i = 5;",
"i",
"5",
"i * i <= n",
"i * i",
"i",
"i",
"n",
"i = i + 6",
"i = i + 6",
"i",
"i + 6",
"i",
"6",
"if (n % i == 0 || n % (i + 2) == 0) \n return false;",
"if (n % i == 0 || n % (i + 2) == 0) \n return false;",
"n % i == 0 || n % (i + 2) == 0",
"n % i == 0",
"n % i",
"n",
"i",
"0",
"n % (i + 2) == 0",
"n % (i + 2)",
"n",
"(i + 2)",
"i",
"2",
"0",
"return false;",
"false",
"return true;",
"true",
"int n",
"n",
"static int gcd(int a, int b) { \n if (b == 0) \n return a; \n return a>b?gcd(b, a % b):gcd(a, b % a); \n }",
"gcd",
"{ \n if (b == 0) \n return a; \n return a>b?gcd(b, a % b):gcd(a, b % a); \n }",
"if (b == 0) \n return a;",
"b == 0",
"b",
"0",
"return a;",
"a",
"return a>b?gcd(b, a % b):gcd(a, b % a);",
"a>b?gcd(b, a % b):gcd(a, b % a)",
"a>b",
"a",
"b",
"gcd(b, a % b)",
"gcd",
"b",
"a % b",
"a",
"b",
"gcd(a, b % a)",
"gcd",
"a",
"b % a",
"b",
"a",
"int a",
"a",
"int b",
"b",
"static long fast_pow(long base,long n,long M){\n if(n==0)\n return 1;\n if(n==1)\n return base;\n long halfn=fast_pow(base,n/2,M);\n if(n%2==0)\n return ( halfn * halfn ) % M;\n else\n return ( ( ( halfn * halfn ) % M ) * base ) % M;\n }",
"fast_pow",
"{\n if(n==0)\n return 1;\n if(n==1)\n return base;\n long halfn=fast_pow(base,n/2,M);\n if(n%2==0)\n return ( halfn * halfn ) % M;\n else\n return ( ( ( halfn * halfn ) % M ) * base ) % M;\n }",
"if(n==0)\n return 1;",
"n==0",
"n",
"0",
"return 1;",
"1",
"if(n==1)\n return base;",
"n==1",
"n",
"1",
"return base;",
"base",
"long halfn=fast_pow(base,n/2,M);",
"halfn",
"fast_pow(base,n/2,M)",
"fast_pow",
"base",
"n/2",
"n",
"2",
"M",
"if(n%2==0)\n return ( halfn * halfn ) % M;\n else\n return ( ( ( halfn * halfn ) % M ) * base ) % M;",
"n%2==0",
"n%2",
"n",
"2",
"0",
"return ( halfn * halfn ) % M;",
"( halfn * halfn ) % M",
"( halfn * halfn )",
"halfn",
"halfn",
"M",
"return ( ( ( halfn * halfn ) % M ) * base ) % M;",
"( ( ( halfn * halfn ) % M ) * base ) % M",
"( ( ( halfn * halfn ) % M ) * base )",
"( ( halfn * halfn ) % M )",
"( halfn * halfn )",
"halfn",
"halfn",
"M",
"base",
"M",
"long base",
"base",
"long n",
"n",
"long M",
"M",
"static long modInverse(long n,long M){\n return fast_pow(n,M-2,M);\n }",
"modInverse",
"{\n return fast_pow(n,M-2,M);\n }",
"return fast_pow(n,M-2,M);",
"fast_pow(n,M-2,M)",
"fast_pow",
"n",
"M-2",
"M",
"2",
"M",
"long n",
"n",
"long M",
"M",
"public static void feedArr(long []arr,InputReader sc){\n for(int i=0;i<arr.length;i++)\n arr[i]=sc.nextLong();\n }",
"feedArr",
"{\n for(int i=0;i<arr.length;i++)\n arr[i]=sc.nextLong();\n }",
"for(int i=0;i<arr.length;i++)\n arr[i]=sc.nextLong();",
"int i=0;",
"int i=0;",
"i",
"0",
"i<arr.length",
"i",
"arr.length",
"arr",
"arr.length",
"i++",
"i++",
"i",
"arr[i]=sc.nextLong();",
"arr[i]=sc.nextLong()",
"arr[i]",
"arr",
"i",
"sc.nextLong()",
"sc.nextLong",
"sc",
"long []arr",
"arr",
"InputReader sc",
"sc",
"public static void feedArr(double []arr,InputReader sc){\n for(int i=0;i<arr.length;i++)\n arr[i]=sc.nextDouble();\n }",
"feedArr",
"{\n for(int i=0;i<arr.length;i++)\n arr[i]=sc.nextDouble();\n }",
"for(int i=0;i<arr.length;i++)\n arr[i]=sc.nextDouble();",
"int i=0;",
"int i=0;",
"i",
"0",
"i<arr.length",
"i",
"arr.length",
"arr",
"arr.length",
"i++",
"i++",
"i",
"arr[i]=sc.nextDouble();",
"arr[i]=sc.nextDouble()",
"arr[i]",
"arr",
"i",
"sc.nextDouble()",
"sc.nextDouble",
"sc",
"double []arr",
"arr",
"InputReader sc",
"sc",
"public static void feedArr(int []arr,InputReader sc){\n for(int i=0;i<arr.length;i++)\n arr[i]=sc.nextInt();\n }",
"feedArr",
"{\n for(int i=0;i<arr.length;i++)\n arr[i]=sc.nextInt();\n }",
"for(int i=0;i<arr.length;i++)\n arr[i]=sc.nextInt();",
"int i=0;",
"int i=0;",
"i",
"0",
"i<arr.length",
"i",
"arr.length",
"arr",
"arr.length",
"i++",
"i++",
"i",
"arr[i]=sc.nextInt();",
"arr[i]=sc.nextInt()",
"arr[i]",
"arr",
"i",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int []arr",
"arr",
"InputReader sc",
"sc",
"public static void feedArr(String []arr,InputReader sc){\n for(int i=0;i<arr.length;i++)\n arr[i]=sc.next();\n }",
"feedArr",
"{\n for(int i=0;i<arr.length;i++)\n arr[i]=sc.next();\n }",
"for(int i=0;i<arr.length;i++)\n arr[i]=sc.next();",
"int i=0;",
"int i=0;",
"i",
"0",
"i<arr.length",
"i",
"arr.length",
"arr",
"arr.length",
"i++",
"i++",
"i",
"arr[i]=sc.next();",
"arr[i]=sc.next()",
"arr[i]",
"arr",
"i",
"sc.next()",
"sc.next",
"sc",
"String []arr",
"arr",
"InputReader sc",
"sc",
"public static String printArr(int []arr){\n StringBuilder sbr=new StringBuilder();\n for(int i:arr)\n sbr.append(i+\" \");\n return sbr.toString();\n }",
"printArr",
"{\n StringBuilder sbr=new StringBuilder();\n for(int i:arr)\n sbr.append(i+\" \");\n return sbr.toString();\n }",
"StringBuilder sbr=new StringBuilder();",
"sbr",
"new StringBuilder()",
"for(int i:arr)\n sbr.append(i+\" \");",
"int i",
"arr",
"sbr.append(i+\" \");",
"sbr.append(i+\" \")",
"sbr.append",
"sbr",
"i+\" \"",
"i",
"\" \"",
"return sbr.toString();",
"sbr.toString()",
"sbr.toString",
"sbr",
"int []arr",
"arr",
"public static String printArr(long []arr){\n StringBuilder sbr=new StringBuilder();\n for(long i:arr)\n sbr.append(i+\" \");\n return sbr.toString();\n }",
"printArr",
"{\n StringBuilder sbr=new StringBuilder();\n for(long i:arr)\n sbr.append(i+\" \");\n return sbr.toString();\n }",
"StringBuilder sbr=new StringBuilder();",
"sbr",
"new StringBuilder()",
"for(long i:arr)\n sbr.append(i+\" \");",
"long i",
"arr",
"sbr.append(i+\" \");",
"sbr.append(i+\" \")",
"sbr.append",
"sbr",
"i+\" \"",
"i",
"\" \"",
"return sbr.toString();",
"sbr.toString()",
"sbr.toString",
"sbr",
"long []arr",
"arr",
"public static String printArr(String []arr){\n StringBuilder sbr=new StringBuilder();\n for(String i:arr)\n sbr.append(i+\" \");\n return sbr.toString();\n }",
"printArr",
"{\n StringBuilder sbr=new StringBuilder();\n for(String i:arr)\n sbr.append(i+\" \");\n return sbr.toString();\n }",
"StringBuilder sbr=new StringBuilder();",
"sbr",
"new StringBuilder()",
"for(String i:arr)\n sbr.append(i+\" \");",
"String i",
"arr",
"sbr.append(i+\" \");",
"sbr.append(i+\" \")",
"sbr.append",
"sbr",
"i+\" \"",
"i",
"\" \"",
"return sbr.toString();",
"sbr.toString()",
"sbr.toString",
"sbr",
"String []arr",
"arr",
"public static String printArr(double []arr){\n StringBuilder sbr=new StringBuilder();\n for(double i:arr)\n sbr.append(i+\" \");\n return sbr.toString();\n }",
"printArr",
"{\n StringBuilder sbr=new StringBuilder();\n for(double i:arr)\n sbr.append(i+\" \");\n return sbr.toString();\n }",
"StringBuilder sbr=new StringBuilder();",
"sbr",
"new StringBuilder()",
"for(double i:arr)\n sbr.append(i+\" \");",
"double i",
"arr",
"sbr.append(i+\" \");",
"sbr.append(i+\" \")",
"sbr.append",
"sbr",
"i+\" \"",
"i",
"\" \"",
"return sbr.toString();",
"sbr.toString()",
"sbr.toString",
"sbr",
"double []arr",
"arr",
"static class Pair{\n long u, v;\n Pair(long a,long b){\n this.u=a;\n this.v=b;\n } \n }",
"Pair",
"long u",
"u",
"v;",
"v",
"Pair(long a,long b){\n this.u=a;\n this.v=b;\n }",
"Pair",
"{\n this.u=a;\n this.v=b;\n }",
"this.u=a",
"this.u",
"this",
"this.u",
"a",
"this.v=b",
"this.v",
"this",
"this.v",
"b",
"long a",
"a",
"long b",
"b",
"static class InputReader {\n public BufferedReader reader;\n public StringTokenizer tokenizer;\n \n public InputReader(InputStream stream) {\n reader = new BufferedReader(new InputStreamReader(stream), 32768);\n tokenizer = null;\n }\n \n public String next() {\n while (tokenizer == null || !tokenizer.hasMoreTokens()) {\n try {\n tokenizer = new StringTokenizer(reader.readLine());\n } catch (IOException e) {\n throw new RuntimeException(e);\n }\n }\n return tokenizer.nextToken();\n }\n public int nextInt() {\n return Integer.parseInt(next());\n }\n public long nextLong() {\n return Long.parseLong(next());\n }\n public double nextDouble() {\n return Double.parseDouble(next());\n }\n }",
"InputReader",
"public BufferedReader reader;",
"reader",
"public StringTokenizer tokenizer;",
"tokenizer",
"public InputReader(InputStream stream) {\n reader = new BufferedReader(new InputStreamReader(stream), 32768);\n tokenizer = null;\n }",
"InputReader",
"{\n reader = new BufferedReader(new InputStreamReader(stream), 32768);\n tokenizer = null;\n }",
"reader = new BufferedReader(new InputStreamReader(stream), 32768)",
"reader",
"new BufferedReader(new InputStreamReader(stream), 32768)",
"tokenizer = null",
"tokenizer",
"null",
"InputStream stream",
"stream",
"public String next() {\n while (tokenizer == null || !tokenizer.hasMoreTokens()) {\n try {\n tokenizer = new StringTokenizer(reader.readLine());\n } catch (IOException e) {\n throw new RuntimeException(e);\n }\n }\n return tokenizer.nextToken();\n }",
"next",
"{\n while (tokenizer == null || !tokenizer.hasMoreTokens()) {\n try {\n tokenizer = new StringTokenizer(reader.readLine());\n } catch (IOException e) {\n throw new RuntimeException(e);\n }\n }\n return tokenizer.nextToken();\n }",
"while (tokenizer == null || !tokenizer.hasMoreTokens()) {\n try {\n tokenizer = new StringTokenizer(reader.readLine());\n } catch (IOException e) {\n throw new RuntimeException(e);\n }\n }",
"tokenizer == null || !tokenizer.hasMoreTokens()",
"tokenizer == null",
"tokenizer",
"null",
"!tokenizer.hasMoreTokens()",
"tokenizer.hasMoreTokens()",
"tokenizer.hasMoreTokens",
"tokenizer",
"{\n try {\n tokenizer = new StringTokenizer(reader.readLine());\n } catch (IOException e) {\n throw new RuntimeException(e);\n }\n }",
"try {\n tokenizer = new StringTokenizer(reader.readLine());\n } catch (IOException e) {\n throw new RuntimeException(e);\n }",
"catch (IOException e) {\n throw new RuntimeException(e);\n }",
"IOException e",
"{\n throw new RuntimeException(e);\n }",
"throw new RuntimeException(e);",
"new RuntimeException(e)",
"{\n tokenizer = new StringTokenizer(reader.readLine());\n }",
"tokenizer = new StringTokenizer(reader.readLine())",
"tokenizer",
"new StringTokenizer(reader.readLine())",
"return tokenizer.nextToken();",
"tokenizer.nextToken()",
"tokenizer.nextToken",
"tokenizer",
"public int nextInt() {\n return Integer.parseInt(next());\n }",
"nextInt",
"{\n return Integer.parseInt(next());\n }",
"return Integer.parseInt(next());",
"Integer.parseInt(next())",
"Integer.parseInt",
"Integer",
"next()",
"next",
"public long nextLong() {\n return Long.parseLong(next());\n }",
"nextLong",
"{\n return Long.parseLong(next());\n }",
"return Long.parseLong(next());",
"Long.parseLong(next())",
"Long.parseLong",
"Long",
"next()",
"next",
"public double nextDouble() {\n return Double.parseDouble(next());\n }",
"nextDouble",
"{\n return Double.parseDouble(next());\n }",
"return Double.parseDouble(next());",
"Double.parseDouble(next())",
"Double.parseDouble",
"Double",
"next()",
"next",
"public class Main{\n public static void main(String[] args) {\n InputStream inputStream = System.in;\n OutputStream outputStream = System.out;\n InputReader in = new InputReader(inputStream);\n PrintWriter out = new PrintWriter(outputStream);\n solve(in, out);\n out.close();\n }\n static int L,R,top,bottom;\n // static int ans;\n public static void solve(InputReader sc, PrintWriter pw) {\n // int t=sc.nextInt();\n int t=1;\n u:while(t-->0){\n int n=sc.nextInt();\n long ans=0;\n for(int i=1;i<=n;i++)\n for(int j=1;j<=n;j++)\n for(int k=1;k<=n;k++)\n ans+=gcd(k,gcd(j,i));\n pw.println(ans);\n }\n }\n public static void sort(long []arr){\n ArrayList<Long> list=new ArrayList<>();\n for(int i=0;i<arr.length;i++)\n list.add(arr[i]);\n Collections.sort(list);\n for(int i=0;i<arr.length;i++)\n arr[i]=list.get(i);\n }\n public static void swap(char []chrr, int i, int j){\n char temp=chrr[i];\n chrr[i]=chrr[j];\n chrr[j]=temp;\n }\n public static int num(int n){\n int a=0;\n while(n>0){\n a+=(n&1);\n n>>=1;\n }\n return a;\n }\n static class Pair{\n long u, v;\n Pair(long a,long b){\n this.u=a;\n this.v=b;\n } \n }\n // public int compareTo(Pair p){\n // return (b-p.b);\n // }\n // public int hashCode(){\n // int hashcode = (a+\" \"+b).hashCode();\n // return hashcode;\n // }\n \n // public boolean equals(Object obj){\n // if (obj instanceof Pair) {\n // Pair p = (Pair) obj;\n // return (p.a==this.a && p.b == this.b);\n // }\n // return false;\n // }\n \n static boolean isPrime(int n) { \n if (n <= 1) \n return false; \n if (n <= 3) \n return true; \n if (n % 2 == 0 || n % 3 == 0) \n return false; \n for (int i = 5; i * i <= n; i = i + 6) \n if (n % i == 0 || n % (i + 2) == 0) \n return false; \n return true; \n } \n static int gcd(int a, int b) { \n if (b == 0) \n return a; \n return a>b?gcd(b, a % b):gcd(a, b % a); \n } \n static long fast_pow(long base,long n,long M){\n if(n==0)\n return 1;\n if(n==1)\n return base;\n long halfn=fast_pow(base,n/2,M);\n if(n%2==0)\n return ( halfn * halfn ) % M;\n else\n return ( ( ( halfn * halfn ) % M ) * base ) % M;\n }\n static long modInverse(long n,long M){\n return fast_pow(n,M-2,M);\n }\n public static void feedArr(long []arr,InputReader sc){\n for(int i=0;i<arr.length;i++)\n arr[i]=sc.nextLong();\n }\n public static void feedArr(double []arr,InputReader sc){\n for(int i=0;i<arr.length;i++)\n arr[i]=sc.nextDouble();\n }\n public static void feedArr(int []arr,InputReader sc){\n for(int i=0;i<arr.length;i++)\n arr[i]=sc.nextInt();\n }\n public static void feedArr(String []arr,InputReader sc){\n for(int i=0;i<arr.length;i++)\n arr[i]=sc.next();\n }\n public static String printArr(int []arr){\n StringBuilder sbr=new StringBuilder();\n for(int i:arr)\n sbr.append(i+\" \");\n return sbr.toString();\n }\n public static String printArr(long []arr){\n StringBuilder sbr=new StringBuilder();\n for(long i:arr)\n sbr.append(i+\" \");\n return sbr.toString();\n }\n public static String printArr(String []arr){\n StringBuilder sbr=new StringBuilder();\n for(String i:arr)\n sbr.append(i+\" \");\n return sbr.toString();\n }\n public static String printArr(double []arr){\n StringBuilder sbr=new StringBuilder();\n for(double i:arr)\n sbr.append(i+\" \");\n return sbr.toString();\n }\n static class InputReader {\n public BufferedReader reader;\n public StringTokenizer tokenizer;\n \n public InputReader(InputStream stream) {\n reader = new BufferedReader(new InputStreamReader(stream), 32768);\n tokenizer = null;\n }\n \n public String next() {\n while (tokenizer == null || !tokenizer.hasMoreTokens()) {\n try {\n tokenizer = new StringTokenizer(reader.readLine());\n } catch (IOException e) {\n throw new RuntimeException(e);\n }\n }\n return tokenizer.nextToken();\n }\n public int nextInt() {\n return Integer.parseInt(next());\n }\n public long nextLong() {\n return Long.parseLong(next());\n }\n public double nextDouble() {\n return Double.parseDouble(next());\n }\n }\n}",
"public class Main{\n public static void main(String[] args) {\n InputStream inputStream = System.in;\n OutputStream outputStream = System.out;\n InputReader in = new InputReader(inputStream);\n PrintWriter out = new PrintWriter(outputStream);\n solve(in, out);\n out.close();\n }\n static int L,R,top,bottom;\n // static int ans;\n public static void solve(InputReader sc, PrintWriter pw) {\n // int t=sc.nextInt();\n int t=1;\n u:while(t-->0){\n int n=sc.nextInt();\n long ans=0;\n for(int i=1;i<=n;i++)\n for(int j=1;j<=n;j++)\n for(int k=1;k<=n;k++)\n ans+=gcd(k,gcd(j,i));\n pw.println(ans);\n }\n }\n public static void sort(long []arr){\n ArrayList<Long> list=new ArrayList<>();\n for(int i=0;i<arr.length;i++)\n list.add(arr[i]);\n Collections.sort(list);\n for(int i=0;i<arr.length;i++)\n arr[i]=list.get(i);\n }\n public static void swap(char []chrr, int i, int j){\n char temp=chrr[i];\n chrr[i]=chrr[j];\n chrr[j]=temp;\n }\n public static int num(int n){\n int a=0;\n while(n>0){\n a+=(n&1);\n n>>=1;\n }\n return a;\n }\n static class Pair{\n long u, v;\n Pair(long a,long b){\n this.u=a;\n this.v=b;\n } \n }\n // public int compareTo(Pair p){\n // return (b-p.b);\n // }\n // public int hashCode(){\n // int hashcode = (a+\" \"+b).hashCode();\n // return hashcode;\n // }\n \n // public boolean equals(Object obj){\n // if (obj instanceof Pair) {\n // Pair p = (Pair) obj;\n // return (p.a==this.a && p.b == this.b);\n // }\n // return false;\n // }\n \n static boolean isPrime(int n) { \n if (n <= 1) \n return false; \n if (n <= 3) \n return true; \n if (n % 2 == 0 || n % 3 == 0) \n return false; \n for (int i = 5; i * i <= n; i = i + 6) \n if (n % i == 0 || n % (i + 2) == 0) \n return false; \n return true; \n } \n static int gcd(int a, int b) { \n if (b == 0) \n return a; \n return a>b?gcd(b, a % b):gcd(a, b % a); \n } \n static long fast_pow(long base,long n,long M){\n if(n==0)\n return 1;\n if(n==1)\n return base;\n long halfn=fast_pow(base,n/2,M);\n if(n%2==0)\n return ( halfn * halfn ) % M;\n else\n return ( ( ( halfn * halfn ) % M ) * base ) % M;\n }\n static long modInverse(long n,long M){\n return fast_pow(n,M-2,M);\n }\n public static void feedArr(long []arr,InputReader sc){\n for(int i=0;i<arr.length;i++)\n arr[i]=sc.nextLong();\n }\n public static void feedArr(double []arr,InputReader sc){\n for(int i=0;i<arr.length;i++)\n arr[i]=sc.nextDouble();\n }\n public static void feedArr(int []arr,InputReader sc){\n for(int i=0;i<arr.length;i++)\n arr[i]=sc.nextInt();\n }\n public static void feedArr(String []arr,InputReader sc){\n for(int i=0;i<arr.length;i++)\n arr[i]=sc.next();\n }\n public static String printArr(int []arr){\n StringBuilder sbr=new StringBuilder();\n for(int i:arr)\n sbr.append(i+\" \");\n return sbr.toString();\n }\n public static String printArr(long []arr){\n StringBuilder sbr=new StringBuilder();\n for(long i:arr)\n sbr.append(i+\" \");\n return sbr.toString();\n }\n public static String printArr(String []arr){\n StringBuilder sbr=new StringBuilder();\n for(String i:arr)\n sbr.append(i+\" \");\n return sbr.toString();\n }\n public static String printArr(double []arr){\n StringBuilder sbr=new StringBuilder();\n for(double i:arr)\n sbr.append(i+\" \");\n return sbr.toString();\n }\n static class InputReader {\n public BufferedReader reader;\n public StringTokenizer tokenizer;\n \n public InputReader(InputStream stream) {\n reader = new BufferedReader(new InputStreamReader(stream), 32768);\n tokenizer = null;\n }\n \n public String next() {\n while (tokenizer == null || !tokenizer.hasMoreTokens()) {\n try {\n tokenizer = new StringTokenizer(reader.readLine());\n } catch (IOException e) {\n throw new RuntimeException(e);\n }\n }\n return tokenizer.nextToken();\n }\n public int nextInt() {\n return Integer.parseInt(next());\n }\n public long nextLong() {\n return Long.parseLong(next());\n }\n public double nextDouble() {\n return Double.parseDouble(next());\n }\n }\n}",
"Main"
] |
import java.io.*;
import java.util.*;
import java.lang.*;
public class Main{
public static void main(String[] args) {
InputStream inputStream = System.in;
OutputStream outputStream = System.out;
InputReader in = new InputReader(inputStream);
PrintWriter out = new PrintWriter(outputStream);
solve(in, out);
out.close();
}
static int L,R,top,bottom;
// static int ans;
public static void solve(InputReader sc, PrintWriter pw) {
// int t=sc.nextInt();
int t=1;
u:while(t-->0){
int n=sc.nextInt();
long ans=0;
for(int i=1;i<=n;i++)
for(int j=1;j<=n;j++)
for(int k=1;k<=n;k++)
ans+=gcd(k,gcd(j,i));
pw.println(ans);
}
}
public static void sort(long []arr){
ArrayList<Long> list=new ArrayList<>();
for(int i=0;i<arr.length;i++)
list.add(arr[i]);
Collections.sort(list);
for(int i=0;i<arr.length;i++)
arr[i]=list.get(i);
}
public static void swap(char []chrr, int i, int j){
char temp=chrr[i];
chrr[i]=chrr[j];
chrr[j]=temp;
}
public static int num(int n){
int a=0;
while(n>0){
a+=(n&1);
n>>=1;
}
return a;
}
static class Pair{
long u, v;
Pair(long a,long b){
this.u=a;
this.v=b;
}
}
// public int compareTo(Pair p){
// return (b-p.b);
// }
// public int hashCode(){
// int hashcode = (a+" "+b).hashCode();
// return hashcode;
// }
// public boolean equals(Object obj){
// if (obj instanceof Pair) {
// Pair p = (Pair) obj;
// return (p.a==this.a && p.b == this.b);
// }
// return false;
// }
static boolean isPrime(int n) {
if (n <= 1)
return false;
if (n <= 3)
return true;
if (n % 2 == 0 || n % 3 == 0)
return false;
for (int i = 5; i * i <= n; i = i + 6)
if (n % i == 0 || n % (i + 2) == 0)
return false;
return true;
}
static int gcd(int a, int b) {
if (b == 0)
return a;
return a>b?gcd(b, a % b):gcd(a, b % a);
}
static long fast_pow(long base,long n,long M){
if(n==0)
return 1;
if(n==1)
return base;
long halfn=fast_pow(base,n/2,M);
if(n%2==0)
return ( halfn * halfn ) % M;
else
return ( ( ( halfn * halfn ) % M ) * base ) % M;
}
static long modInverse(long n,long M){
return fast_pow(n,M-2,M);
}
public static void feedArr(long []arr,InputReader sc){
for(int i=0;i<arr.length;i++)
arr[i]=sc.nextLong();
}
public static void feedArr(double []arr,InputReader sc){
for(int i=0;i<arr.length;i++)
arr[i]=sc.nextDouble();
}
public static void feedArr(int []arr,InputReader sc){
for(int i=0;i<arr.length;i++)
arr[i]=sc.nextInt();
}
public static void feedArr(String []arr,InputReader sc){
for(int i=0;i<arr.length;i++)
arr[i]=sc.next();
}
public static String printArr(int []arr){
StringBuilder sbr=new StringBuilder();
for(int i:arr)
sbr.append(i+" ");
return sbr.toString();
}
public static String printArr(long []arr){
StringBuilder sbr=new StringBuilder();
for(long i:arr)
sbr.append(i+" ");
return sbr.toString();
}
public static String printArr(String []arr){
StringBuilder sbr=new StringBuilder();
for(String i:arr)
sbr.append(i+" ");
return sbr.toString();
}
public static String printArr(double []arr){
StringBuilder sbr=new StringBuilder();
for(double i:arr)
sbr.append(i+" ");
return sbr.toString();
}
static class InputReader {
public BufferedReader reader;
public StringTokenizer tokenizer;
public InputReader(InputStream stream) {
reader = new BufferedReader(new InputStreamReader(stream), 32768);
tokenizer = null;
}
public String next() {
while (tokenizer == null || !tokenizer.hasMoreTokens()) {
try {
tokenizer = new StringTokenizer(reader.readLine());
} catch (IOException e) {
throw new RuntimeException(e);
}
}
return tokenizer.nextToken();
}
public int nextInt() {
return Integer.parseInt(next());
}
public long nextLong() {
return Long.parseLong(next());
}
public double nextDouble() {
return Double.parseDouble(next());
}
}
}
|
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
42,
2,
0,
13,
2,
13,
13,
17,
30,
0,
13,
13,
0,
13,
13,
29,
13,
23,
13,
23,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
4,
13,
4,
13,
13,
13,
13,
4,
18,
18,
13,
13,
13,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
103,
5
],
[
103,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
8,
11
],
[
11,
12
],
[
12,
13
],
[
13,
14
],
[
13,
15
],
[
15,
16
],
[
15,
17
],
[
12,
18
],
[
11,
19
],
[
19,
20
],
[
20,
21
],
[
20,
22
],
[
19,
23
],
[
23,
24
],
[
23,
25
],
[
8,
26
],
[
26,
27
],
[
6,
28
],
[
28,
29
],
[
6,
30
],
[
30,
31
],
[
103,
32
],
[
32,
33
],
[
32,
34
],
[
34,
35
],
[
35,
36
],
[
35,
37
],
[
34,
38
],
[
38,
39
],
[
38,
40
],
[
40,
41
],
[
41,
42
],
[
34,
43
],
[
43,
44
],
[
43,
45
],
[
34,
46
],
[
46,
47
],
[
47,
48
],
[
48,
49
],
[
48,
50
],
[
46,
51
],
[
51,
52
],
[
51,
53
],
[
46,
54
],
[
54,
55
],
[
55,
56
],
[
46,
57
],
[
58,
58
],
[
58,
59
],
[
59,
60
],
[
60,
61
],
[
61,
62
],
[
61,
63
],
[
59,
64
],
[
64,
65
],
[
64,
66
],
[
59,
67
],
[
67,
68
],
[
68,
69
],
[
59,
70
],
[
71,
71
],
[
71,
72
],
[
72,
73
],
[
73,
74
],
[
74,
75
],
[
74,
76
],
[
72,
77
],
[
77,
78
],
[
77,
79
],
[
72,
80
],
[
80,
81
],
[
81,
82
],
[
72,
83
],
[
84,
84
],
[
84,
85
],
[
85,
86
],
[
85,
87
],
[
87,
88
],
[
87,
89
],
[
89,
90
],
[
89,
91
],
[
89,
92
],
[
87,
93
],
[
34,
94
],
[
94,
95
],
[
95,
96
],
[
96,
97
],
[
96,
98
],
[
94,
99
],
[
32,
100
],
[
100,
101
],
[
0,
102
],
[
102,
103
],
[
102,
104
]
] |
[
"import java.util.Scanner;\npublic class Main {\n\t//最大公約数gcd\n\tstatic int gcd (int a, int b) {\n\t\tint temp;\n\t\twhile((temp = a%b)!=0) {\n\t\t\ta = b;\n\t\t\tb = temp;\n\t\t}\n\t\treturn b;\n\t}\n\tpublic static void main(String[] args) {\n\t\tScanner stdIn = new Scanner(System.in);\n\t\t\n\t\tint k = stdIn.nextInt();\n\t\tlong cnt = 0;\n\t\tfor(int i = 1; i <=k; i++) {\n\t\t\tfor(int j =1; j <= k; j++) {\n\t\t\t\tfor(int m = 1; m <= k; m++) {\n\t\t\t\t\tcnt += gcd(gcd(i,j),m);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tSystem.out.println(cnt);\n\t}\n\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n\t//最大公約数gcd\n\tstatic int gcd (int a, int b) {\n\t\tint temp;\n\t\twhile((temp = a%b)!=0) {\n\t\t\ta = b;\n\t\t\tb = temp;\n\t\t}\n\t\treturn b;\n\t}\n\tpublic static void main(String[] args) {\n\t\tScanner stdIn = new Scanner(System.in);\n\t\t\n\t\tint k = stdIn.nextInt();\n\t\tlong cnt = 0;\n\t\tfor(int i = 1; i <=k; i++) {\n\t\t\tfor(int j =1; j <= k; j++) {\n\t\t\t\tfor(int m = 1; m <= k; m++) {\n\t\t\t\t\tcnt += gcd(gcd(i,j),m);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tSystem.out.println(cnt);\n\t}\n\n}",
"Main",
"//最大公約数gcd\n\tstatic int gcd (int a, int b) {\n\t\tint temp;\n\t\twhile((temp = a%b)!=0) {\n\t\t\ta = b;\n\t\t\tb = temp;\n\t\t}\n\t\treturn b;\n\t}",
"gcd",
"{\n\t\tint temp;\n\t\twhile((temp = a%b)!=0) {\n\t\t\ta = b;\n\t\t\tb = temp;\n\t\t}\n\t\treturn b;\n\t}",
"int temp;",
"temp",
"while((temp = a%b)!=0) {\n\t\t\ta = b;\n\t\t\tb = temp;\n\t\t}",
"(temp = a%b)!=0",
"(temp = a%b)",
"temp",
"a%b",
"a",
"b",
"0",
"{\n\t\t\ta = b;\n\t\t\tb = temp;\n\t\t}",
"a = b",
"a",
"b",
"b = temp",
"b",
"temp",
"return b;",
"b",
"int a",
"a",
"int b",
"b",
"public static void main(String[] args) {\n\t\tScanner stdIn = new Scanner(System.in);\n\t\t\n\t\tint k = stdIn.nextInt();\n\t\tlong cnt = 0;\n\t\tfor(int i = 1; i <=k; i++) {\n\t\t\tfor(int j =1; j <= k; j++) {\n\t\t\t\tfor(int m = 1; m <= k; m++) {\n\t\t\t\t\tcnt += gcd(gcd(i,j),m);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tSystem.out.println(cnt);\n\t}",
"main",
"{\n\t\tScanner stdIn = new Scanner(System.in);\n\t\t\n\t\tint k = stdIn.nextInt();\n\t\tlong cnt = 0;\n\t\tfor(int i = 1; i <=k; i++) {\n\t\t\tfor(int j =1; j <= k; j++) {\n\t\t\t\tfor(int m = 1; m <= k; m++) {\n\t\t\t\t\tcnt += gcd(gcd(i,j),m);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tSystem.out.println(cnt);\n\t}",
"Scanner stdIn = new Scanner(System.in);",
"stdIn",
"new Scanner(System.in)",
"int k = stdIn.nextInt();",
"k",
"stdIn.nextInt()",
"stdIn.nextInt",
"stdIn",
"long cnt = 0;",
"cnt",
"0",
"for(int i = 1; i <=k; i++) {\n\t\t\tfor(int j =1; j <= k; j++) {\n\t\t\t\tfor(int m = 1; m <= k; m++) {\n\t\t\t\t\tcnt += gcd(gcd(i,j),m);\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"int i = 1;",
"int i = 1;",
"i",
"1",
"i <=k",
"i",
"k",
"i++",
"i++",
"i",
"{\n\t\t\tfor(int j =1; j <= k; j++) {\n\t\t\t\tfor(int m = 1; m <= k; m++) {\n\t\t\t\t\tcnt += gcd(gcd(i,j),m);\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"{\n\t\t\tfor(int j =1; j <= k; j++) {\n\t\t\t\tfor(int m = 1; m <= k; m++) {\n\t\t\t\t\tcnt += gcd(gcd(i,j),m);\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"for(int j =1; j <= k; j++) {\n\t\t\t\tfor(int m = 1; m <= k; m++) {\n\t\t\t\t\tcnt += gcd(gcd(i,j),m);\n\t\t\t\t}\n\t\t\t}",
"int j =1;",
"int j =1;",
"j",
"1",
"j <= k",
"j",
"k",
"j++",
"j++",
"j",
"{\n\t\t\t\tfor(int m = 1; m <= k; m++) {\n\t\t\t\t\tcnt += gcd(gcd(i,j),m);\n\t\t\t\t}\n\t\t\t}",
"{\n\t\t\t\tfor(int m = 1; m <= k; m++) {\n\t\t\t\t\tcnt += gcd(gcd(i,j),m);\n\t\t\t\t}\n\t\t\t}",
"for(int m = 1; m <= k; m++) {\n\t\t\t\t\tcnt += gcd(gcd(i,j),m);\n\t\t\t\t}",
"int m = 1;",
"int m = 1;",
"m",
"1",
"m <= k",
"m",
"k",
"m++",
"m++",
"m",
"{\n\t\t\t\t\tcnt += gcd(gcd(i,j),m);\n\t\t\t\t}",
"{\n\t\t\t\t\tcnt += gcd(gcd(i,j),m);\n\t\t\t\t}",
"cnt += gcd(gcd(i,j),m)",
"cnt",
"gcd(gcd(i,j),m)",
"gcd",
"gcd(i,j)",
"gcd",
"i",
"j",
"m",
"System.out.println(cnt)",
"System.out.println",
"System.out",
"System",
"System.out",
"cnt",
"String[] args",
"args",
"public class Main {\n\t//最大公約数gcd\n\tstatic int gcd (int a, int b) {\n\t\tint temp;\n\t\twhile((temp = a%b)!=0) {\n\t\t\ta = b;\n\t\t\tb = temp;\n\t\t}\n\t\treturn b;\n\t}\n\tpublic static void main(String[] args) {\n\t\tScanner stdIn = new Scanner(System.in);\n\t\t\n\t\tint k = stdIn.nextInt();\n\t\tlong cnt = 0;\n\t\tfor(int i = 1; i <=k; i++) {\n\t\t\tfor(int j =1; j <= k; j++) {\n\t\t\t\tfor(int m = 1; m <= k; m++) {\n\t\t\t\t\tcnt += gcd(gcd(i,j),m);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tSystem.out.println(cnt);\n\t}\n\n}",
"public class Main {\n\t//最大公約数gcd\n\tstatic int gcd (int a, int b) {\n\t\tint temp;\n\t\twhile((temp = a%b)!=0) {\n\t\t\ta = b;\n\t\t\tb = temp;\n\t\t}\n\t\treturn b;\n\t}\n\tpublic static void main(String[] args) {\n\t\tScanner stdIn = new Scanner(System.in);\n\t\t\n\t\tint k = stdIn.nextInt();\n\t\tlong cnt = 0;\n\t\tfor(int i = 1; i <=k; i++) {\n\t\t\tfor(int j =1; j <= k; j++) {\n\t\t\t\tfor(int m = 1; m <= k; m++) {\n\t\t\t\t\tcnt += gcd(gcd(i,j),m);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tSystem.out.println(cnt);\n\t}\n\n}",
"Main"
] |
import java.util.Scanner;
public class Main {
//最大公約数gcd
static int gcd (int a, int b) {
int temp;
while((temp = a%b)!=0) {
a = b;
b = temp;
}
return b;
}
public static void main(String[] args) {
Scanner stdIn = new Scanner(System.in);
int k = stdIn.nextInt();
long cnt = 0;
for(int i = 1; i <=k; i++) {
for(int j =1; j <= k; j++) {
for(int m = 1; m <= k; m++) {
cnt += gcd(gcd(i,j),m);
}
}
}
System.out.println(cnt);
}
}
|
[
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,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
4,
13,
4,
13,
13,
13,
13,
4,
18,
18,
13,
13,
13,
23,
13,
12,
13,
30,
14,
2,
13,
17,
29,
13,
29,
4,
13,
13,
2,
13,
13,
23,
13,
23,
13,
12,
13,
30,
14,
2,
13,
17,
29,
17,
14,
2,
2,
2,
2,
13,
17,
17,
2,
13,
17,
2,
13,
17,
29,
17,
30,
11,
1,
41,
13,
17,
2,
13,
4,
18,
13,
13,
1,
0,
13,
17,
30,
30,
14,
2,
2,
13,
13,
17,
29,
17,
29,
17,
23,
13,
6,
13,
41,
13,
41,
13,
12,
13,
30,
0,
13,
20,
12,
13,
30,
42,
2,
2,
13,
17,
40,
4,
18,
13,
30,
38,
5,
13,
30,
4,
18,
13,
30,
0,
13,
20,
29,
4,
18,
13,
12,
13,
30,
29,
4,
18,
13,
4,
13,
12,
13,
30,
29,
4,
18,
13,
4,
13,
12,
13,
30,
29,
4,
18,
13,
4,
13,
12,
13,
30,
41,
13,
17,
38,
5,
13,
30,
4,
18,
13,
30,
0,
13,
4,
18,
13,
29,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
10,
11
],
[
10,
12
],
[
0,
13
],
[
249,
14
],
[
249,
15
],
[
15,
16
],
[
15,
17
],
[
17,
18
],
[
18,
19
],
[
18,
20
],
[
17,
21
],
[
21,
22
],
[
21,
23
],
[
23,
24
],
[
24,
25
],
[
17,
26
],
[
26,
27
],
[
26,
28
],
[
17,
29
],
[
29,
30
],
[
30,
31
],
[
31,
32
],
[
31,
33
],
[
29,
34
],
[
34,
35
],
[
34,
36
],
[
29,
37
],
[
37,
38
],
[
38,
39
],
[
29,
40
],
[
41,
41
],
[
41,
42
],
[
42,
43
],
[
43,
44
],
[
44,
45
],
[
44,
46
],
[
42,
47
],
[
47,
48
],
[
47,
49
],
[
42,
50
],
[
50,
51
],
[
51,
52
],
[
42,
53
],
[
54,
54
],
[
54,
55
],
[
55,
56
],
[
56,
57
],
[
57,
58
],
[
57,
59
],
[
55,
60
],
[
60,
61
],
[
60,
62
],
[
55,
63
],
[
63,
64
],
[
64,
65
],
[
55,
66
],
[
67,
67
],
[
67,
68
],
[
68,
69
],
[
68,
70
],
[
70,
71
],
[
70,
72
],
[
72,
73
],
[
72,
74
],
[
72,
75
],
[
70,
76
],
[
17,
77
],
[
77,
78
],
[
78,
79
],
[
79,
80
],
[
79,
81
],
[
77,
82
],
[
15,
83
],
[
83,
84
],
[
249,
85
],
[
85,
86
],
[
85,
87
],
[
87,
88
],
[
88,
89
],
[
89,
90
],
[
89,
91
],
[
88,
92
],
[
92,
93
],
[
87,
94
],
[
94,
95
],
[
95,
96
],
[
95,
97
],
[
95,
98
],
[
98,
99
],
[
98,
100
],
[
85,
101
],
[
101,
102
],
[
85,
103
],
[
103,
104
],
[
249,
105
],
[
105,
106
],
[
105,
107
],
[
107,
108
],
[
108,
109
],
[
109,
110
],
[
109,
111
],
[
108,
112
],
[
112,
113
],
[
108,
114
],
[
114,
115
],
[
115,
116
],
[
116,
117
],
[
117,
118
],
[
118,
119
],
[
118,
120
],
[
117,
121
],
[
116,
122
],
[
122,
123
],
[
122,
124
],
[
115,
125
],
[
125,
126
],
[
125,
127
],
[
114,
128
],
[
128,
129
],
[
114,
130
],
[
130,
131
],
[
131,
132
],
[
132,
133
],
[
133,
134
],
[
133,
135
],
[
131,
136
],
[
136,
137
],
[
136,
138
],
[
138,
139
],
[
139,
140
],
[
138,
141
],
[
131,
142
],
[
142,
143
],
[
143,
144
],
[
143,
145
],
[
131,
146
],
[
147,
147
],
[
147,
148
],
[
148,
149
],
[
149,
150
],
[
150,
151
],
[
150,
152
],
[
149,
153
],
[
148,
154
],
[
154,
155
],
[
130,
156
],
[
156,
157
],
[
105,
158
],
[
158,
159
],
[
249,
160
],
[
160,
161
],
[
160,
162
],
[
162,
163
],
[
160,
164
],
[
164,
165
],
[
160,
166
],
[
166,
167
],
[
166,
168
],
[
168,
169
],
[
169,
170
],
[
169,
171
],
[
160,
172
],
[
172,
173
],
[
172,
174
],
[
174,
175
],
[
175,
176
],
[
176,
177
],
[
177,
178
],
[
177,
179
],
[
176,
180
],
[
180,
181
],
[
181,
182
],
[
182,
183
],
[
175,
184
],
[
184,
185
],
[
185,
186
],
[
186,
187
],
[
186,
188
],
[
188,
189
],
[
189,
190
],
[
190,
191
],
[
185,
192
],
[
192,
193
],
[
193,
194
],
[
193,
195
],
[
174,
196
],
[
196,
197
],
[
197,
198
],
[
198,
199
],
[
160,
200
],
[
200,
201
],
[
200,
202
],
[
202,
203
],
[
203,
204
],
[
204,
205
],
[
205,
206
],
[
204,
207
],
[
207,
208
],
[
160,
209
],
[
209,
210
],
[
209,
211
],
[
211,
212
],
[
212,
213
],
[
213,
214
],
[
214,
215
],
[
213,
216
],
[
216,
217
],
[
160,
218
],
[
218,
219
],
[
218,
220
],
[
220,
221
],
[
221,
222
],
[
222,
223
],
[
223,
224
],
[
222,
225
],
[
225,
226
],
[
160,
227
],
[
227,
228
],
[
227,
229
],
[
229,
230
],
[
230,
231
],
[
230,
232
],
[
229,
233
],
[
233,
234
],
[
234,
235
],
[
234,
236
],
[
236,
237
],
[
237,
238
],
[
238,
239
],
[
233,
240
],
[
240,
241
],
[
241,
242
],
[
241,
243
],
[
243,
244
],
[
244,
245
],
[
229,
246
],
[
246,
247
],
[
0,
248
],
[
248,
249
],
[
248,
250
]
] |
[
"\n\nimport java.io.BufferedReader;\nimport java.io.IOException;\nimport java.io.InputStreamReader;\nimport java.util.StringTokenizer;\n\npublic class Main {\n public static void main(String[] args) {\n FastReader s = new FastReader();\n int K = s.nextInt();\n int sum=0;\n for(int i=1;i<=K;i++){\n for(int j=1;j<=K;j++){\n for(int k=1;k<=K;k++){\n sum+=gcd(gcd(i,j),k);\n }\n }\n }\n System.out.println(sum);\n }\n\n static int gcd(int a, int b)\n {\n if (b == 0)\n return a;\n return gcd(b, a % b);\n }\n\n private static boolean isPrime(int n) {\n if (n == 2)\n return true;\n else if ((n % 2 == 0 && n > 2) || n < 2)\n return false;\n else {\n for (int i = 3; i <= (int) Math.sqrt(n); i += 2) {\n if (n % i == 0)\n return false;\n }\n return true;\n }\n\n\n }\n\n static class FastReader {\n BufferedReader br;\n StringTokenizer st;\n\n public FastReader() {\n br = new BufferedReader(new\n InputStreamReader(System.in));\n }\n\n String next() {\n while (st == null || !st.hasMoreElements()) {\n try {\n st = new StringTokenizer(br.readLine());\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n return st.nextToken();\n }\n\n int nextInt() {\n return Integer.parseInt(next());\n }\n\n long nextLong() {\n return Long.parseLong(next());\n }\n\n double nextDouble() {\n return Double.parseDouble(next());\n }\n\n String nextLine() {\n String str = \"\";\n try {\n str = br.readLine();\n } catch (IOException e) {\n e.printStackTrace();\n }\n return str;\n }\n }\n\n}",
"import java.io.BufferedReader;",
"BufferedReader",
"java.io",
"import java.io.IOException;",
"IOException",
"java.io",
"import java.io.InputStreamReader;",
"InputStreamReader",
"java.io",
"import java.util.StringTokenizer;",
"StringTokenizer",
"java.util",
"public class Main {\n public static void main(String[] args) {\n FastReader s = new FastReader();\n int K = s.nextInt();\n int sum=0;\n for(int i=1;i<=K;i++){\n for(int j=1;j<=K;j++){\n for(int k=1;k<=K;k++){\n sum+=gcd(gcd(i,j),k);\n }\n }\n }\n System.out.println(sum);\n }\n\n static int gcd(int a, int b)\n {\n if (b == 0)\n return a;\n return gcd(b, a % b);\n }\n\n private static boolean isPrime(int n) {\n if (n == 2)\n return true;\n else if ((n % 2 == 0 && n > 2) || n < 2)\n return false;\n else {\n for (int i = 3; i <= (int) Math.sqrt(n); i += 2) {\n if (n % i == 0)\n return false;\n }\n return true;\n }\n\n\n }\n\n static class FastReader {\n BufferedReader br;\n StringTokenizer st;\n\n public FastReader() {\n br = new BufferedReader(new\n InputStreamReader(System.in));\n }\n\n String next() {\n while (st == null || !st.hasMoreElements()) {\n try {\n st = new StringTokenizer(br.readLine());\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n return st.nextToken();\n }\n\n int nextInt() {\n return Integer.parseInt(next());\n }\n\n long nextLong() {\n return Long.parseLong(next());\n }\n\n double nextDouble() {\n return Double.parseDouble(next());\n }\n\n String nextLine() {\n String str = \"\";\n try {\n str = br.readLine();\n } catch (IOException e) {\n e.printStackTrace();\n }\n return str;\n }\n }\n\n}",
"Main",
"public static void main(String[] args) {\n FastReader s = new FastReader();\n int K = s.nextInt();\n int sum=0;\n for(int i=1;i<=K;i++){\n for(int j=1;j<=K;j++){\n for(int k=1;k<=K;k++){\n sum+=gcd(gcd(i,j),k);\n }\n }\n }\n System.out.println(sum);\n }",
"main",
"{\n FastReader s = new FastReader();\n int K = s.nextInt();\n int sum=0;\n for(int i=1;i<=K;i++){\n for(int j=1;j<=K;j++){\n for(int k=1;k<=K;k++){\n sum+=gcd(gcd(i,j),k);\n }\n }\n }\n System.out.println(sum);\n }",
"FastReader s = new FastReader();",
"s",
"new FastReader()",
"int K = s.nextInt();",
"K",
"s.nextInt()",
"s.nextInt",
"s",
"int sum=0;",
"sum",
"0",
"for(int i=1;i<=K;i++){\n for(int j=1;j<=K;j++){\n for(int k=1;k<=K;k++){\n sum+=gcd(gcd(i,j),k);\n }\n }\n }",
"int i=1;",
"int i=1;",
"i",
"1",
"i<=K",
"i",
"K",
"i++",
"i++",
"i",
"{\n for(int j=1;j<=K;j++){\n for(int k=1;k<=K;k++){\n sum+=gcd(gcd(i,j),k);\n }\n }\n }",
"{\n for(int j=1;j<=K;j++){\n for(int k=1;k<=K;k++){\n sum+=gcd(gcd(i,j),k);\n }\n }\n }",
"for(int j=1;j<=K;j++){\n for(int k=1;k<=K;k++){\n sum+=gcd(gcd(i,j),k);\n }\n }",
"int j=1;",
"int j=1;",
"j",
"1",
"j<=K",
"j",
"K",
"j++",
"j++",
"j",
"{\n for(int k=1;k<=K;k++){\n sum+=gcd(gcd(i,j),k);\n }\n }",
"{\n for(int k=1;k<=K;k++){\n sum+=gcd(gcd(i,j),k);\n }\n }",
"for(int k=1;k<=K;k++){\n sum+=gcd(gcd(i,j),k);\n }",
"int k=1;",
"int k=1;",
"k",
"1",
"k<=K",
"k",
"K",
"k++",
"k++",
"k",
"{\n sum+=gcd(gcd(i,j),k);\n }",
"{\n sum+=gcd(gcd(i,j),k);\n }",
"sum+=gcd(gcd(i,j),k)",
"sum",
"gcd(gcd(i,j),k)",
"gcd",
"gcd(i,j)",
"gcd",
"i",
"j",
"k",
"System.out.println(sum)",
"System.out.println",
"System.out",
"System",
"System.out",
"sum",
"String[] args",
"args",
"static int gcd(int a, int b)\n {\n if (b == 0)\n return a;\n return gcd(b, a % b);\n }",
"gcd",
"{\n if (b == 0)\n return a;\n return gcd(b, a % b);\n }",
"if (b == 0)\n return a;",
"b == 0",
"b",
"0",
"return a;",
"a",
"return gcd(b, a % b);",
"gcd(b, a % b)",
"gcd",
"b",
"a % b",
"a",
"b",
"int a",
"a",
"int b",
"b",
"private static boolean isPrime(int n) {\n if (n == 2)\n return true;\n else if ((n % 2 == 0 && n > 2) || n < 2)\n return false;\n else {\n for (int i = 3; i <= (int) Math.sqrt(n); i += 2) {\n if (n % i == 0)\n return false;\n }\n return true;\n }\n\n\n }",
"isPrime",
"{\n if (n == 2)\n return true;\n else if ((n % 2 == 0 && n > 2) || n < 2)\n return false;\n else {\n for (int i = 3; i <= (int) Math.sqrt(n); i += 2) {\n if (n % i == 0)\n return false;\n }\n return true;\n }\n\n\n }",
"if (n == 2)\n return true;\n else if ((n % 2 == 0 && n > 2) || n < 2)\n return false;\n else {\n for (int i = 3; i <= (int) Math.sqrt(n); i += 2) {\n if (n % i == 0)\n return false;\n }\n return true;\n }",
"n == 2",
"n",
"2",
"return true;",
"true",
"if ((n % 2 == 0 && n > 2) || n < 2)\n return false;\n else {\n for (int i = 3; i <= (int) Math.sqrt(n); i += 2) {\n if (n % i == 0)\n return false;\n }\n return true;\n }",
"(n % 2 == 0 && n > 2) || n < 2",
"(n % 2 == 0 && n > 2)",
"n % 2 == 0",
"n % 2",
"n",
"2",
"0",
"n > 2",
"n",
"2",
"n < 2",
"n",
"2",
"return false;",
"false",
"{\n for (int i = 3; i <= (int) Math.sqrt(n); i += 2) {\n if (n % i == 0)\n return false;\n }\n return true;\n }",
"for (int i = 3; i <= (int) Math.sqrt(n); i += 2) {\n if (n % i == 0)\n return false;\n }",
"int i = 3;",
"int i = 3;",
"i",
"3",
"i <= (int) Math.sqrt(n)",
"i",
"(int) Math.sqrt(n)",
"Math.sqrt",
"Math",
"n",
"i += 2",
"i += 2",
"i",
"2",
"{\n if (n % i == 0)\n return false;\n }",
"{\n if (n % i == 0)\n return false;\n }",
"if (n % i == 0)\n return false;",
"n % i == 0",
"n % i",
"n",
"i",
"0",
"return false;",
"false",
"return true;",
"true",
"int n",
"n",
"static class FastReader {\n BufferedReader br;\n StringTokenizer st;\n\n public FastReader() {\n br = new BufferedReader(new\n InputStreamReader(System.in));\n }\n\n String next() {\n while (st == null || !st.hasMoreElements()) {\n try {\n st = new StringTokenizer(br.readLine());\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n return st.nextToken();\n }\n\n int nextInt() {\n return Integer.parseInt(next());\n }\n\n long nextLong() {\n return Long.parseLong(next());\n }\n\n double nextDouble() {\n return Double.parseDouble(next());\n }\n\n String nextLine() {\n String str = \"\";\n try {\n str = br.readLine();\n } catch (IOException e) {\n e.printStackTrace();\n }\n return str;\n }\n }",
"FastReader",
"BufferedReader br;",
"br",
"StringTokenizer st;",
"st",
"public FastReader() {\n br = new BufferedReader(new\n InputStreamReader(System.in));\n }",
"FastReader",
"{\n br = new BufferedReader(new\n InputStreamReader(System.in));\n }",
"br = new BufferedReader(new\n InputStreamReader(System.in))",
"br",
"new BufferedReader(new\n InputStreamReader(System.in))",
"String next() {\n while (st == null || !st.hasMoreElements()) {\n try {\n st = new StringTokenizer(br.readLine());\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n return st.nextToken();\n }",
"next",
"{\n while (st == null || !st.hasMoreElements()) {\n try {\n st = new StringTokenizer(br.readLine());\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n return st.nextToken();\n }",
"while (st == null || !st.hasMoreElements()) {\n try {\n st = new StringTokenizer(br.readLine());\n } catch (IOException e) {\n e.printStackTrace();\n }\n }",
"st == null || !st.hasMoreElements()",
"st == null",
"st",
"null",
"!st.hasMoreElements()",
"st.hasMoreElements()",
"st.hasMoreElements",
"st",
"{\n try {\n st = new StringTokenizer(br.readLine());\n } catch (IOException e) {\n e.printStackTrace();\n }\n }",
"try {\n st = new StringTokenizer(br.readLine());\n } catch (IOException e) {\n e.printStackTrace();\n }",
"catch (IOException e) {\n e.printStackTrace();\n }",
"IOException e",
"{\n e.printStackTrace();\n }",
"e.printStackTrace()",
"e.printStackTrace",
"e",
"{\n st = new StringTokenizer(br.readLine());\n }",
"st = new StringTokenizer(br.readLine())",
"st",
"new StringTokenizer(br.readLine())",
"return st.nextToken();",
"st.nextToken()",
"st.nextToken",
"st",
"int nextInt() {\n return Integer.parseInt(next());\n }",
"nextInt",
"{\n return Integer.parseInt(next());\n }",
"return Integer.parseInt(next());",
"Integer.parseInt(next())",
"Integer.parseInt",
"Integer",
"next()",
"next",
"long nextLong() {\n return Long.parseLong(next());\n }",
"nextLong",
"{\n return Long.parseLong(next());\n }",
"return Long.parseLong(next());",
"Long.parseLong(next())",
"Long.parseLong",
"Long",
"next()",
"next",
"double nextDouble() {\n return Double.parseDouble(next());\n }",
"nextDouble",
"{\n return Double.parseDouble(next());\n }",
"return Double.parseDouble(next());",
"Double.parseDouble(next())",
"Double.parseDouble",
"Double",
"next()",
"next",
"String nextLine() {\n String str = \"\";\n try {\n str = br.readLine();\n } catch (IOException e) {\n e.printStackTrace();\n }\n return str;\n }",
"nextLine",
"{\n String str = \"\";\n try {\n str = br.readLine();\n } catch (IOException e) {\n e.printStackTrace();\n }\n return str;\n }",
"String str = \"\";",
"str",
"\"\"",
"try {\n str = br.readLine();\n } catch (IOException e) {\n e.printStackTrace();\n }",
"catch (IOException e) {\n e.printStackTrace();\n }",
"IOException e",
"{\n e.printStackTrace();\n }",
"e.printStackTrace()",
"e.printStackTrace",
"e",
"{\n str = br.readLine();\n }",
"str = br.readLine()",
"str",
"br.readLine()",
"br.readLine",
"br",
"return str;",
"str",
"public class Main {\n public static void main(String[] args) {\n FastReader s = new FastReader();\n int K = s.nextInt();\n int sum=0;\n for(int i=1;i<=K;i++){\n for(int j=1;j<=K;j++){\n for(int k=1;k<=K;k++){\n sum+=gcd(gcd(i,j),k);\n }\n }\n }\n System.out.println(sum);\n }\n\n static int gcd(int a, int b)\n {\n if (b == 0)\n return a;\n return gcd(b, a % b);\n }\n\n private static boolean isPrime(int n) {\n if (n == 2)\n return true;\n else if ((n % 2 == 0 && n > 2) || n < 2)\n return false;\n else {\n for (int i = 3; i <= (int) Math.sqrt(n); i += 2) {\n if (n % i == 0)\n return false;\n }\n return true;\n }\n\n\n }\n\n static class FastReader {\n BufferedReader br;\n StringTokenizer st;\n\n public FastReader() {\n br = new BufferedReader(new\n InputStreamReader(System.in));\n }\n\n String next() {\n while (st == null || !st.hasMoreElements()) {\n try {\n st = new StringTokenizer(br.readLine());\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n return st.nextToken();\n }\n\n int nextInt() {\n return Integer.parseInt(next());\n }\n\n long nextLong() {\n return Long.parseLong(next());\n }\n\n double nextDouble() {\n return Double.parseDouble(next());\n }\n\n String nextLine() {\n String str = \"\";\n try {\n str = br.readLine();\n } catch (IOException e) {\n e.printStackTrace();\n }\n return str;\n }\n }\n\n}",
"public class Main {\n public static void main(String[] args) {\n FastReader s = new FastReader();\n int K = s.nextInt();\n int sum=0;\n for(int i=1;i<=K;i++){\n for(int j=1;j<=K;j++){\n for(int k=1;k<=K;k++){\n sum+=gcd(gcd(i,j),k);\n }\n }\n }\n System.out.println(sum);\n }\n\n static int gcd(int a, int b)\n {\n if (b == 0)\n return a;\n return gcd(b, a % b);\n }\n\n private static boolean isPrime(int n) {\n if (n == 2)\n return true;\n else if ((n % 2 == 0 && n > 2) || n < 2)\n return false;\n else {\n for (int i = 3; i <= (int) Math.sqrt(n); i += 2) {\n if (n % i == 0)\n return false;\n }\n return true;\n }\n\n\n }\n\n static class FastReader {\n BufferedReader br;\n StringTokenizer st;\n\n public FastReader() {\n br = new BufferedReader(new\n InputStreamReader(System.in));\n }\n\n String next() {\n while (st == null || !st.hasMoreElements()) {\n try {\n st = new StringTokenizer(br.readLine());\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n return st.nextToken();\n }\n\n int nextInt() {\n return Integer.parseInt(next());\n }\n\n long nextLong() {\n return Long.parseLong(next());\n }\n\n double nextDouble() {\n return Double.parseDouble(next());\n }\n\n String nextLine() {\n String str = \"\";\n try {\n str = br.readLine();\n } catch (IOException e) {\n e.printStackTrace();\n }\n return str;\n }\n }\n\n}",
"Main"
] |
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) {
FastReader s = new FastReader();
int K = s.nextInt();
int sum=0;
for(int i=1;i<=K;i++){
for(int j=1;j<=K;j++){
for(int k=1;k<=K;k++){
sum+=gcd(gcd(i,j),k);
}
}
}
System.out.println(sum);
}
static int gcd(int a, int b)
{
if (b == 0)
return a;
return gcd(b, a % b);
}
private static boolean isPrime(int n) {
if (n == 2)
return true;
else if ((n % 2 == 0 && n > 2) || n < 2)
return false;
else {
for (int i = 3; i <= (int) Math.sqrt(n); i += 2) {
if (n % i == 0)
return false;
}
return true;
}
}
static class FastReader {
BufferedReader br;
StringTokenizer st;
public FastReader() {
br = new BufferedReader(new
InputStreamReader(System.in));
}
String next() {
while (st == null || !st.hasMoreElements()) {
try {
st = new StringTokenizer(br.readLine());
} catch (IOException e) {
e.printStackTrace();
}
}
return st.nextToken();
}
int nextInt() {
return Integer.parseInt(next());
}
long nextLong() {
return Long.parseLong(next());
}
double nextDouble() {
return Double.parseDouble(next());
}
String nextLine() {
String str = "";
try {
str = br.readLine();
} catch (IOException e) {
e.printStackTrace();
}
return str;
}
}
}
|
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
41,
13,
12,
13,
30,
41,
13,
20,
4,
18,
13,
23,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
0,
13,
20,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
11,
1,
41,
13,
13,
2,
13,
13,
1,
40,
13,
30,
30,
11,
1,
41,
13,
13,
2,
13,
13,
1,
40,
13,
30,
30,
14,
2,
2,
13,
13,
2,
13,
13,
30,
0,
13,
4,
13,
13,
13,
13,
14,
2,
2,
2,
13,
13,
2,
13,
13,
2,
13,
13,
30,
0,
13,
2,
17,
4,
13,
13,
13,
13,
30,
0,
13,
2,
17,
4,
13,
13,
13,
13,
4,
18,
18,
13,
13,
13,
12,
13,
30,
41,
13,
4,
13,
13,
13,
41,
13,
4,
13,
13,
13,
29,
13,
23,
13,
23,
13,
23,
13,
12,
13,
30,
14,
2,
13,
13,
30,
41,
13,
13,
0,
13,
13,
0,
13,
13,
41,
13,
2,
2,
13,
17,
13,
14,
4,
18,
13,
13,
30,
29,
4,
18,
13,
13,
41,
13,
2,
13,
13,
42,
2,
13,
17,
30,
0,
13,
13,
0,
13,
13,
0,
13,
2,
13,
13,
4,
18,
13,
13,
13,
29,
13,
23,
13,
23,
13,
6,
13,
41,
13,
41,
13,
12,
13,
30,
0,
13,
17,
0,
13,
20,
12,
13,
30,
14,
2,
2,
13,
17,
40,
4,
18,
13,
30,
0,
13,
20,
29,
4,
18,
13,
12,
13,
30,
0,
13,
17,
41,
13,
17,
0,
13,
4,
18,
13,
29,
13,
12,
13,
30,
29,
4,
18,
13,
4,
13,
12,
13,
30,
29,
4,
18,
13,
4,
13,
12,
13,
30,
41,
13,
20,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
18,
13,
13,
4,
13,
29,
13,
23,
13,
12,
13,
30,
41,
13,
20,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
18,
13,
13,
4,
13,
29,
13,
23,
13,
12,
13,
30,
4,
18,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
10,
11
],
[
10,
12
],
[
0,
13
],
[
13,
14
],
[
13,
15
],
[
0,
16
],
[
367,
17
],
[
367,
18
],
[
18,
19
],
[
367,
20
],
[
20,
21
],
[
20,
22
],
[
22,
23
],
[
23,
24
],
[
23,
25
],
[
22,
26
],
[
26,
27
],
[
27,
28
],
[
20,
29
],
[
29,
30
],
[
367,
31
],
[
31,
32
],
[
31,
33
],
[
33,
34
],
[
34,
35
],
[
34,
36
],
[
33,
37
],
[
37,
38
],
[
37,
39
],
[
39,
40
],
[
40,
41
],
[
33,
42
],
[
42,
43
],
[
42,
44
],
[
33,
45
],
[
45,
46
],
[
45,
47
],
[
33,
48
],
[
48,
49
],
[
49,
50
],
[
50,
51
],
[
50,
52
],
[
48,
53
],
[
53,
54
],
[
53,
55
],
[
48,
56
],
[
56,
57
],
[
57,
58
],
[
48,
59
],
[
60,
60
],
[
60,
61
],
[
61,
62
],
[
62,
63
],
[
63,
64
],
[
63,
65
],
[
61,
66
],
[
66,
67
],
[
66,
68
],
[
61,
69
],
[
69,
70
],
[
70,
71
],
[
61,
72
],
[
73,
73
],
[
73,
74
],
[
74,
75
],
[
75,
76
],
[
76,
77
],
[
76,
78
],
[
74,
79
],
[
79,
80
],
[
79,
81
],
[
74,
82
],
[
82,
83
],
[
83,
84
],
[
74,
85
],
[
86,
86
],
[
86,
87
],
[
87,
88
],
[
88,
89
],
[
89,
90
],
[
89,
91
],
[
88,
92
],
[
92,
93
],
[
92,
94
],
[
87,
95
],
[
95,
96
],
[
96,
97
],
[
96,
98
],
[
98,
99
],
[
98,
100
],
[
98,
101
],
[
98,
102
],
[
87,
103
],
[
103,
104
],
[
105,
105
],
[
105,
106
],
[
106,
107
],
[
106,
108
],
[
105,
109
],
[
109,
110
],
[
109,
111
],
[
105,
112
],
[
112,
113
],
[
112,
114
],
[
103,
115
],
[
115,
116
],
[
116,
117
],
[
116,
118
],
[
118,
119
],
[
118,
120
],
[
120,
121
],
[
120,
122
],
[
120,
123
],
[
120,
124
],
[
103,
125
],
[
125,
126
],
[
126,
127
],
[
126,
128
],
[
128,
129
],
[
128,
130
],
[
130,
131
],
[
130,
132
],
[
130,
133
],
[
130,
134
],
[
33,
135
],
[
135,
136
],
[
136,
137
],
[
137,
138
],
[
137,
139
],
[
135,
140
],
[
367,
141
],
[
141,
142
],
[
141,
143
],
[
143,
144
],
[
144,
145
],
[
144,
146
],
[
146,
147
],
[
146,
148
],
[
146,
149
],
[
143,
150
],
[
150,
151
],
[
150,
152
],
[
152,
153
],
[
152,
154
],
[
152,
155
],
[
143,
156
],
[
156,
157
],
[
141,
158
],
[
158,
159
],
[
141,
160
],
[
160,
161
],
[
141,
162
],
[
162,
163
],
[
367,
164
],
[
164,
165
],
[
164,
166
],
[
166,
167
],
[
167,
168
],
[
168,
169
],
[
168,
170
],
[
167,
171
],
[
171,
172
],
[
172,
173
],
[
172,
174
],
[
171,
175
],
[
175,
176
],
[
175,
177
],
[
171,
178
],
[
178,
179
],
[
178,
180
],
[
166,
181
],
[
181,
182
],
[
181,
183
],
[
183,
184
],
[
184,
185
],
[
184,
186
],
[
183,
187
],
[
166,
188
],
[
188,
189
],
[
189,
190
],
[
190,
191
],
[
189,
192
],
[
188,
193
],
[
193,
194
],
[
194,
195
],
[
195,
196
],
[
196,
197
],
[
195,
198
],
[
166,
199
],
[
199,
200
],
[
199,
201
],
[
201,
202
],
[
201,
203
],
[
166,
204
],
[
204,
205
],
[
205,
206
],
[
205,
207
],
[
204,
208
],
[
208,
209
],
[
209,
210
],
[
209,
211
],
[
208,
212
],
[
212,
213
],
[
212,
214
],
[
208,
215
],
[
215,
216
],
[
215,
217
],
[
217,
218
],
[
217,
219
],
[
166,
220
],
[
220,
221
],
[
221,
222
],
[
220,
223
],
[
220,
224
],
[
166,
225
],
[
225,
226
],
[
164,
227
],
[
227,
228
],
[
164,
229
],
[
229,
230
],
[
367,
231
],
[
231,
232
],
[
231,
233
],
[
233,
234
],
[
231,
235
],
[
235,
236
],
[
231,
237
],
[
237,
238
],
[
237,
239
],
[
239,
240
],
[
240,
241
],
[
240,
242
],
[
239,
243
],
[
243,
244
],
[
243,
245
],
[
231,
246
],
[
246,
247
],
[
246,
248
],
[
248,
249
],
[
249,
250
],
[
250,
251
],
[
251,
252
],
[
251,
253
],
[
250,
254
],
[
254,
255
],
[
255,
256
],
[
256,
257
],
[
249,
258
],
[
258,
259
],
[
259,
260
],
[
259,
261
],
[
248,
262
],
[
262,
263
],
[
263,
264
],
[
264,
265
],
[
231,
266
],
[
266,
267
],
[
266,
268
],
[
268,
269
],
[
269,
270
],
[
269,
271
],
[
268,
272
],
[
272,
273
],
[
272,
274
],
[
268,
275
],
[
275,
276
],
[
275,
277
],
[
277,
278
],
[
278,
279
],
[
268,
280
],
[
280,
281
],
[
231,
282
],
[
282,
283
],
[
282,
284
],
[
284,
285
],
[
285,
286
],
[
286,
287
],
[
287,
288
],
[
286,
289
],
[
289,
290
],
[
231,
291
],
[
291,
292
],
[
291,
293
],
[
293,
294
],
[
294,
295
],
[
295,
296
],
[
296,
297
],
[
295,
298
],
[
298,
299
],
[
231,
300
],
[
300,
301
],
[
300,
302
],
[
302,
303
],
[
303,
304
],
[
303,
305
],
[
302,
307
],
[
307,
308
],
[
308,
309
],
[
309,
310
],
[
309,
311
],
[
307,
312
],
[
312,
313
],
[
312,
314
],
[
307,
315
],
[
315,
316
],
[
316,
317
],
[
307,
318
],
[
319,
319
],
[
319,
320
],
[
320,
321
],
[
321,
322
],
[
321,
323
],
[
320,
324
],
[
324,
325
],
[
302,
326
],
[
326,
327
],
[
300,
328
],
[
328,
329
],
[
231,
330
],
[
330,
331
],
[
330,
332
],
[
332,
333
],
[
333,
334
],
[
333,
335
],
[
332,
337
],
[
337,
338
],
[
338,
339
],
[
339,
340
],
[
339,
341
],
[
337,
342
],
[
342,
343
],
[
342,
344
],
[
337,
345
],
[
345,
346
],
[
346,
347
],
[
337,
348
],
[
349,
349
],
[
349,
350
],
[
350,
351
],
[
351,
352
],
[
351,
353
],
[
350,
354
],
[
354,
355
],
[
332,
356
],
[
356,
357
],
[
330,
358
],
[
358,
359
],
[
231,
360
],
[
360,
361
],
[
360,
362
],
[
362,
363
],
[
363,
364
],
[
364,
365
],
[
0,
366
],
[
366,
367
],
[
366,
368
]
] |
[
"import java.io.BufferedReader;\nimport java.io.IOException;\nimport java.io.InputStreamReader;\nimport java.util.HashMap;\nimport java.util.StringTokenizer;\n\npublic class Main {\n\n\tpublic static void main(String[] args) throws IOException {\n\t\tMain mainObj = new Main();\n\t\tmainObj.solve();\n\t}\n\t\n\tHashMap<Integer, Integer> gcdMap;\n\n\tpublic void solve() throws IOException {\n\t\tFastScanner fs = new FastScanner();\n\t\tint n = fs.nextInt();\n\t\t\n\t\tgcdMap = new HashMap<>();\n\t\t\n\t\tlong sum = 0;\n\t\t\n\t\tfor (int i = 1; i <= n; i++) {\n\t\t\tfor(int j = i; j <= n; j++) {\n\t\t\t\tfor(int k = j; k <= n; k++) {\n\t\t\t\t\tif(i == j && j == k) {\n\t\t\t\t\t\tsum += gcd3(i, j,k);\n\t\t\t\t\t}else if(i == j || j == k || k == i){\n\t\t\t\t\t\tsum += 3*gcd3(i, j,k);\n\t\t\t\t\t}else {\n\t\t\t\t\t\tsum += 6*gcd3(i, j,k);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tSystem.out.println(sum);\n\t}\n\t\n\tlong gcd3(int a , int b, int c) {\n\t\tint firstGCD = gcd(a,b);\n\t\tint secondGCD = gcd(firstGCD, c);\n\t\treturn (long)secondGCD;\n\t}\n\t\n\tint gcd(int a,int b) {\n\t\t\n\t\tif(a < b) {\n\t\t\tint temp = a;\n\t\t\ta = b;\n\t\t\tb = temp;\n\t\t}\n\t\t\n\t\tint key = b*1000+a;\n\t\tif(gcdMap.containsKey(key)) {\n\t\t\treturn gcdMap.get(key);\n\t\t}\n\t\t\n\t\tint r = a % b;\n\t\twhile(r != 0) {\n\t\t\ta = b;\n\t\t\tb = r;\n\t\t\tr = a % b;\n\t\t}\n\t\t\n\t\tgcdMap.put(key, b);\n\t\treturn b;\n\t}\n\n\t\n\n\tpublic class FastScanner {\n\n\t\tBufferedReader reader;\n\t\tprivate StringTokenizer st;\n\n\t\tpublic FastScanner() {\n\t\t\tst = null;\n\t\t\treader = new BufferedReader(new InputStreamReader(System.in));\n\t\t}\n\n\t\tpublic String next() throws IOException {\n\t\t\tif (st == null || !st.hasMoreElements()) {\n\t\t\t\tst = new StringTokenizer(reader.readLine());\n\t\t\t}\n\t\t\treturn st.nextToken();\n\t\t}\n\n\t\tpublic String nextLine() throws IOException {\n\t\t\tst = null;\n\t\t\tString readLine = null;\n\t\t\treadLine = reader.readLine();\n\t\t\treturn readLine;\n\t\t}\n\n\t\tpublic int nextInt() throws NumberFormatException, IOException {\n\t\t\treturn Integer.parseInt(next());\n\t\t}\n\n\t\tpublic long nextLong() throws NumberFormatException, IOException {\n\t\t\treturn Long.parseLong(next());\n\t\t}\n\n\t\tpublic int[] nextIntArr(int n) throws NumberFormatException, IOException {\n\t\t\tint[] retArr = new int[n];\n\t\t\tfor (int i = 0; i < n; i++) {\n\t\t\t\tretArr[i] = nextInt();\n\t\t\t}\n\t\t\treturn retArr;\n\t\t}\n\n\t\tpublic long[] nextLongArr(int n) throws NumberFormatException, IOException {\n\t\t\tlong[] retArr = new long[n];\n\t\t\tfor (int i = 0; i < n; i++) {\n\t\t\t\tretArr[i] = nextLong();\n\t\t\t}\n\t\t\treturn retArr;\n\t\t}\n\n\t\tpublic void close() throws IOException {\n\t\t\treader.close();\n\t\t}\n\t}\n\n}",
"import java.io.BufferedReader;",
"BufferedReader",
"java.io",
"import java.io.IOException;",
"IOException",
"java.io",
"import java.io.InputStreamReader;",
"InputStreamReader",
"java.io",
"import java.util.HashMap;",
"HashMap",
"java.util",
"import java.util.StringTokenizer;",
"StringTokenizer",
"java.util",
"public class Main {\n\n\tpublic static void main(String[] args) throws IOException {\n\t\tMain mainObj = new Main();\n\t\tmainObj.solve();\n\t}\n\t\n\tHashMap<Integer, Integer> gcdMap;\n\n\tpublic void solve() throws IOException {\n\t\tFastScanner fs = new FastScanner();\n\t\tint n = fs.nextInt();\n\t\t\n\t\tgcdMap = new HashMap<>();\n\t\t\n\t\tlong sum = 0;\n\t\t\n\t\tfor (int i = 1; i <= n; i++) {\n\t\t\tfor(int j = i; j <= n; j++) {\n\t\t\t\tfor(int k = j; k <= n; k++) {\n\t\t\t\t\tif(i == j && j == k) {\n\t\t\t\t\t\tsum += gcd3(i, j,k);\n\t\t\t\t\t}else if(i == j || j == k || k == i){\n\t\t\t\t\t\tsum += 3*gcd3(i, j,k);\n\t\t\t\t\t}else {\n\t\t\t\t\t\tsum += 6*gcd3(i, j,k);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tSystem.out.println(sum);\n\t}\n\t\n\tlong gcd3(int a , int b, int c) {\n\t\tint firstGCD = gcd(a,b);\n\t\tint secondGCD = gcd(firstGCD, c);\n\t\treturn (long)secondGCD;\n\t}\n\t\n\tint gcd(int a,int b) {\n\t\t\n\t\tif(a < b) {\n\t\t\tint temp = a;\n\t\t\ta = b;\n\t\t\tb = temp;\n\t\t}\n\t\t\n\t\tint key = b*1000+a;\n\t\tif(gcdMap.containsKey(key)) {\n\t\t\treturn gcdMap.get(key);\n\t\t}\n\t\t\n\t\tint r = a % b;\n\t\twhile(r != 0) {\n\t\t\ta = b;\n\t\t\tb = r;\n\t\t\tr = a % b;\n\t\t}\n\t\t\n\t\tgcdMap.put(key, b);\n\t\treturn b;\n\t}\n\n\t\n\n\tpublic class FastScanner {\n\n\t\tBufferedReader reader;\n\t\tprivate StringTokenizer st;\n\n\t\tpublic FastScanner() {\n\t\t\tst = null;\n\t\t\treader = new BufferedReader(new InputStreamReader(System.in));\n\t\t}\n\n\t\tpublic String next() throws IOException {\n\t\t\tif (st == null || !st.hasMoreElements()) {\n\t\t\t\tst = new StringTokenizer(reader.readLine());\n\t\t\t}\n\t\t\treturn st.nextToken();\n\t\t}\n\n\t\tpublic String nextLine() throws IOException {\n\t\t\tst = null;\n\t\t\tString readLine = null;\n\t\t\treadLine = reader.readLine();\n\t\t\treturn readLine;\n\t\t}\n\n\t\tpublic int nextInt() throws NumberFormatException, IOException {\n\t\t\treturn Integer.parseInt(next());\n\t\t}\n\n\t\tpublic long nextLong() throws NumberFormatException, IOException {\n\t\t\treturn Long.parseLong(next());\n\t\t}\n\n\t\tpublic int[] nextIntArr(int n) throws NumberFormatException, IOException {\n\t\t\tint[] retArr = new int[n];\n\t\t\tfor (int i = 0; i < n; i++) {\n\t\t\t\tretArr[i] = nextInt();\n\t\t\t}\n\t\t\treturn retArr;\n\t\t}\n\n\t\tpublic long[] nextLongArr(int n) throws NumberFormatException, IOException {\n\t\t\tlong[] retArr = new long[n];\n\t\t\tfor (int i = 0; i < n; i++) {\n\t\t\t\tretArr[i] = nextLong();\n\t\t\t}\n\t\t\treturn retArr;\n\t\t}\n\n\t\tpublic void close() throws IOException {\n\t\t\treader.close();\n\t\t}\n\t}\n\n}",
"Main",
"HashMap<Integer, Integer> gcdMap;",
"gcdMap",
"public static void main(String[] args) throws IOException {\n\t\tMain mainObj = new Main();\n\t\tmainObj.solve();\n\t}",
"main",
"{\n\t\tMain mainObj = new Main();\n\t\tmainObj.solve();\n\t}",
"Main mainObj = new Main();",
"mainObj",
"new Main()",
"mainObj.solve()",
"mainObj.solve",
"mainObj",
"String[] args",
"args",
"public void solve() throws IOException {\n\t\tFastScanner fs = new FastScanner();\n\t\tint n = fs.nextInt();\n\t\t\n\t\tgcdMap = new HashMap<>();\n\t\t\n\t\tlong sum = 0;\n\t\t\n\t\tfor (int i = 1; i <= n; i++) {\n\t\t\tfor(int j = i; j <= n; j++) {\n\t\t\t\tfor(int k = j; k <= n; k++) {\n\t\t\t\t\tif(i == j && j == k) {\n\t\t\t\t\t\tsum += gcd3(i, j,k);\n\t\t\t\t\t}else if(i == j || j == k || k == i){\n\t\t\t\t\t\tsum += 3*gcd3(i, j,k);\n\t\t\t\t\t}else {\n\t\t\t\t\t\tsum += 6*gcd3(i, j,k);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tSystem.out.println(sum);\n\t}",
"solve",
"{\n\t\tFastScanner fs = new FastScanner();\n\t\tint n = fs.nextInt();\n\t\t\n\t\tgcdMap = new HashMap<>();\n\t\t\n\t\tlong sum = 0;\n\t\t\n\t\tfor (int i = 1; i <= n; i++) {\n\t\t\tfor(int j = i; j <= n; j++) {\n\t\t\t\tfor(int k = j; k <= n; k++) {\n\t\t\t\t\tif(i == j && j == k) {\n\t\t\t\t\t\tsum += gcd3(i, j,k);\n\t\t\t\t\t}else if(i == j || j == k || k == i){\n\t\t\t\t\t\tsum += 3*gcd3(i, j,k);\n\t\t\t\t\t}else {\n\t\t\t\t\t\tsum += 6*gcd3(i, j,k);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tSystem.out.println(sum);\n\t}",
"FastScanner fs = new FastScanner();",
"fs",
"new FastScanner()",
"int n = fs.nextInt();",
"n",
"fs.nextInt()",
"fs.nextInt",
"fs",
"gcdMap = new HashMap<>()",
"gcdMap",
"new HashMap<>()",
"long sum = 0;",
"sum",
"0",
"for (int i = 1; i <= n; i++) {\n\t\t\tfor(int j = i; j <= n; j++) {\n\t\t\t\tfor(int k = j; k <= n; k++) {\n\t\t\t\t\tif(i == j && j == k) {\n\t\t\t\t\t\tsum += gcd3(i, j,k);\n\t\t\t\t\t}else if(i == j || j == k || k == i){\n\t\t\t\t\t\tsum += 3*gcd3(i, j,k);\n\t\t\t\t\t}else {\n\t\t\t\t\t\tsum += 6*gcd3(i, j,k);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"int i = 1;",
"int i = 1;",
"i",
"1",
"i <= n",
"i",
"n",
"i++",
"i++",
"i",
"{\n\t\t\tfor(int j = i; j <= n; j++) {\n\t\t\t\tfor(int k = j; k <= n; k++) {\n\t\t\t\t\tif(i == j && j == k) {\n\t\t\t\t\t\tsum += gcd3(i, j,k);\n\t\t\t\t\t}else if(i == j || j == k || k == i){\n\t\t\t\t\t\tsum += 3*gcd3(i, j,k);\n\t\t\t\t\t}else {\n\t\t\t\t\t\tsum += 6*gcd3(i, j,k);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"{\n\t\t\tfor(int j = i; j <= n; j++) {\n\t\t\t\tfor(int k = j; k <= n; k++) {\n\t\t\t\t\tif(i == j && j == k) {\n\t\t\t\t\t\tsum += gcd3(i, j,k);\n\t\t\t\t\t}else if(i == j || j == k || k == i){\n\t\t\t\t\t\tsum += 3*gcd3(i, j,k);\n\t\t\t\t\t}else {\n\t\t\t\t\t\tsum += 6*gcd3(i, j,k);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"for(int j = i; j <= n; j++) {\n\t\t\t\tfor(int k = j; k <= n; k++) {\n\t\t\t\t\tif(i == j && j == k) {\n\t\t\t\t\t\tsum += gcd3(i, j,k);\n\t\t\t\t\t}else if(i == j || j == k || k == i){\n\t\t\t\t\t\tsum += 3*gcd3(i, j,k);\n\t\t\t\t\t}else {\n\t\t\t\t\t\tsum += 6*gcd3(i, j,k);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}",
"int j = i;",
"int j = i;",
"j",
"i",
"j <= n",
"j",
"n",
"j++",
"j++",
"j",
"{\n\t\t\t\tfor(int k = j; k <= n; k++) {\n\t\t\t\t\tif(i == j && j == k) {\n\t\t\t\t\t\tsum += gcd3(i, j,k);\n\t\t\t\t\t}else if(i == j || j == k || k == i){\n\t\t\t\t\t\tsum += 3*gcd3(i, j,k);\n\t\t\t\t\t}else {\n\t\t\t\t\t\tsum += 6*gcd3(i, j,k);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}",
"{\n\t\t\t\tfor(int k = j; k <= n; k++) {\n\t\t\t\t\tif(i == j && j == k) {\n\t\t\t\t\t\tsum += gcd3(i, j,k);\n\t\t\t\t\t}else if(i == j || j == k || k == i){\n\t\t\t\t\t\tsum += 3*gcd3(i, j,k);\n\t\t\t\t\t}else {\n\t\t\t\t\t\tsum += 6*gcd3(i, j,k);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}",
"for(int k = j; k <= n; k++) {\n\t\t\t\t\tif(i == j && j == k) {\n\t\t\t\t\t\tsum += gcd3(i, j,k);\n\t\t\t\t\t}else if(i == j || j == k || k == i){\n\t\t\t\t\t\tsum += 3*gcd3(i, j,k);\n\t\t\t\t\t}else {\n\t\t\t\t\t\tsum += 6*gcd3(i, j,k);\n\t\t\t\t\t}\n\t\t\t\t}",
"int k = j;",
"int k = j;",
"k",
"j",
"k <= n",
"k",
"n",
"k++",
"k++",
"k",
"{\n\t\t\t\t\tif(i == j && j == k) {\n\t\t\t\t\t\tsum += gcd3(i, j,k);\n\t\t\t\t\t}else if(i == j || j == k || k == i){\n\t\t\t\t\t\tsum += 3*gcd3(i, j,k);\n\t\t\t\t\t}else {\n\t\t\t\t\t\tsum += 6*gcd3(i, j,k);\n\t\t\t\t\t}\n\t\t\t\t}",
"{\n\t\t\t\t\tif(i == j && j == k) {\n\t\t\t\t\t\tsum += gcd3(i, j,k);\n\t\t\t\t\t}else if(i == j || j == k || k == i){\n\t\t\t\t\t\tsum += 3*gcd3(i, j,k);\n\t\t\t\t\t}else {\n\t\t\t\t\t\tsum += 6*gcd3(i, j,k);\n\t\t\t\t\t}\n\t\t\t\t}",
"if(i == j && j == k) {\n\t\t\t\t\t\tsum += gcd3(i, j,k);\n\t\t\t\t\t}else if(i == j || j == k || k == i){\n\t\t\t\t\t\tsum += 3*gcd3(i, j,k);\n\t\t\t\t\t}else {\n\t\t\t\t\t\tsum += 6*gcd3(i, j,k);\n\t\t\t\t\t}",
"i == j && j == k",
"i == j",
"i",
"j",
"j == k",
"j",
"k",
"{\n\t\t\t\t\t\tsum += gcd3(i, j,k);\n\t\t\t\t\t}",
"sum += gcd3(i, j,k)",
"sum",
"gcd3(i, j,k)",
"gcd3",
"i",
"j",
"k",
"if(i == j || j == k || k == i){\n\t\t\t\t\t\tsum += 3*gcd3(i, j,k);\n\t\t\t\t\t}else {\n\t\t\t\t\t\tsum += 6*gcd3(i, j,k);\n\t\t\t\t\t}",
"i == j || j == k || k == i",
"i == j || j == k || k == i",
"i == j",
"i",
"j",
"j == k",
"j",
"k",
"k == i",
"k",
"i",
"{\n\t\t\t\t\t\tsum += 3*gcd3(i, j,k);\n\t\t\t\t\t}",
"sum += 3*gcd3(i, j,k)",
"sum",
"3*gcd3(i, j,k)",
"3",
"gcd3(i, j,k)",
"gcd3",
"i",
"j",
"k",
"{\n\t\t\t\t\t\tsum += 6*gcd3(i, j,k);\n\t\t\t\t\t}",
"sum += 6*gcd3(i, j,k)",
"sum",
"6*gcd3(i, j,k)",
"6",
"gcd3(i, j,k)",
"gcd3",
"i",
"j",
"k",
"System.out.println(sum)",
"System.out.println",
"System.out",
"System",
"System.out",
"sum",
"long gcd3(int a , int b, int c) {\n\t\tint firstGCD = gcd(a,b);\n\t\tint secondGCD = gcd(firstGCD, c);\n\t\treturn (long)secondGCD;\n\t}",
"gcd3",
"{\n\t\tint firstGCD = gcd(a,b);\n\t\tint secondGCD = gcd(firstGCD, c);\n\t\treturn (long)secondGCD;\n\t}",
"int firstGCD = gcd(a,b);",
"firstGCD",
"gcd(a,b)",
"gcd",
"a",
"b",
"int secondGCD = gcd(firstGCD, c);",
"secondGCD",
"gcd(firstGCD, c)",
"gcd",
"firstGCD",
"c",
"return (long)secondGCD;",
"(long)secondGCD",
"int a",
"a",
"int b",
"b",
"int c",
"c",
"int gcd(int a,int b) {\n\t\t\n\t\tif(a < b) {\n\t\t\tint temp = a;\n\t\t\ta = b;\n\t\t\tb = temp;\n\t\t}\n\t\t\n\t\tint key = b*1000+a;\n\t\tif(gcdMap.containsKey(key)) {\n\t\t\treturn gcdMap.get(key);\n\t\t}\n\t\t\n\t\tint r = a % b;\n\t\twhile(r != 0) {\n\t\t\ta = b;\n\t\t\tb = r;\n\t\t\tr = a % b;\n\t\t}\n\t\t\n\t\tgcdMap.put(key, b);\n\t\treturn b;\n\t}",
"gcd",
"{\n\t\t\n\t\tif(a < b) {\n\t\t\tint temp = a;\n\t\t\ta = b;\n\t\t\tb = temp;\n\t\t}\n\t\t\n\t\tint key = b*1000+a;\n\t\tif(gcdMap.containsKey(key)) {\n\t\t\treturn gcdMap.get(key);\n\t\t}\n\t\t\n\t\tint r = a % b;\n\t\twhile(r != 0) {\n\t\t\ta = b;\n\t\t\tb = r;\n\t\t\tr = a % b;\n\t\t}\n\t\t\n\t\tgcdMap.put(key, b);\n\t\treturn b;\n\t}",
"if(a < b) {\n\t\t\tint temp = a;\n\t\t\ta = b;\n\t\t\tb = temp;\n\t\t}",
"a < b",
"a",
"b",
"{\n\t\t\tint temp = a;\n\t\t\ta = b;\n\t\t\tb = temp;\n\t\t}",
"int temp = a;",
"temp",
"a",
"a = b",
"a",
"b",
"b = temp",
"b",
"temp",
"int key = b*1000+a;",
"key",
"b*1000+a",
"b*1000",
"b",
"1000",
"a",
"if(gcdMap.containsKey(key)) {\n\t\t\treturn gcdMap.get(key);\n\t\t}",
"gcdMap.containsKey(key)",
"gcdMap.containsKey",
"gcdMap",
"key",
"{\n\t\t\treturn gcdMap.get(key);\n\t\t}",
"return gcdMap.get(key);",
"gcdMap.get(key)",
"gcdMap.get",
"gcdMap",
"key",
"int r = a % b;",
"r",
"a % b",
"a",
"b",
"while(r != 0) {\n\t\t\ta = b;\n\t\t\tb = r;\n\t\t\tr = a % b;\n\t\t}",
"r != 0",
"r",
"0",
"{\n\t\t\ta = b;\n\t\t\tb = r;\n\t\t\tr = a % b;\n\t\t}",
"a = b",
"a",
"b",
"b = r",
"b",
"r",
"r = a % b",
"r",
"a % b",
"a",
"b",
"gcdMap.put(key, b)",
"gcdMap.put",
"gcdMap",
"key",
"b",
"return b;",
"b",
"int a",
"a",
"int b",
"b",
"public class FastScanner {\n\n\t\tBufferedReader reader;\n\t\tprivate StringTokenizer st;\n\n\t\tpublic FastScanner() {\n\t\t\tst = null;\n\t\t\treader = new BufferedReader(new InputStreamReader(System.in));\n\t\t}\n\n\t\tpublic String next() throws IOException {\n\t\t\tif (st == null || !st.hasMoreElements()) {\n\t\t\t\tst = new StringTokenizer(reader.readLine());\n\t\t\t}\n\t\t\treturn st.nextToken();\n\t\t}\n\n\t\tpublic String nextLine() throws IOException {\n\t\t\tst = null;\n\t\t\tString readLine = null;\n\t\t\treadLine = reader.readLine();\n\t\t\treturn readLine;\n\t\t}\n\n\t\tpublic int nextInt() throws NumberFormatException, IOException {\n\t\t\treturn Integer.parseInt(next());\n\t\t}\n\n\t\tpublic long nextLong() throws NumberFormatException, IOException {\n\t\t\treturn Long.parseLong(next());\n\t\t}\n\n\t\tpublic int[] nextIntArr(int n) throws NumberFormatException, IOException {\n\t\t\tint[] retArr = new int[n];\n\t\t\tfor (int i = 0; i < n; i++) {\n\t\t\t\tretArr[i] = nextInt();\n\t\t\t}\n\t\t\treturn retArr;\n\t\t}\n\n\t\tpublic long[] nextLongArr(int n) throws NumberFormatException, IOException {\n\t\t\tlong[] retArr = new long[n];\n\t\t\tfor (int i = 0; i < n; i++) {\n\t\t\t\tretArr[i] = nextLong();\n\t\t\t}\n\t\t\treturn retArr;\n\t\t}\n\n\t\tpublic void close() throws IOException {\n\t\t\treader.close();\n\t\t}\n\t}",
"FastScanner",
"BufferedReader reader;",
"reader",
"private StringTokenizer st;",
"st",
"public FastScanner() {\n\t\t\tst = null;\n\t\t\treader = new BufferedReader(new InputStreamReader(System.in));\n\t\t}",
"FastScanner",
"{\n\t\t\tst = null;\n\t\t\treader = new BufferedReader(new InputStreamReader(System.in));\n\t\t}",
"st = null",
"st",
"null",
"reader = new BufferedReader(new InputStreamReader(System.in))",
"reader",
"new BufferedReader(new InputStreamReader(System.in))",
"public String next() throws IOException {\n\t\t\tif (st == null || !st.hasMoreElements()) {\n\t\t\t\tst = new StringTokenizer(reader.readLine());\n\t\t\t}\n\t\t\treturn st.nextToken();\n\t\t}",
"next",
"{\n\t\t\tif (st == null || !st.hasMoreElements()) {\n\t\t\t\tst = new StringTokenizer(reader.readLine());\n\t\t\t}\n\t\t\treturn st.nextToken();\n\t\t}",
"if (st == null || !st.hasMoreElements()) {\n\t\t\t\tst = new StringTokenizer(reader.readLine());\n\t\t\t}",
"st == null || !st.hasMoreElements()",
"st == null",
"st",
"null",
"!st.hasMoreElements()",
"st.hasMoreElements()",
"st.hasMoreElements",
"st",
"{\n\t\t\t\tst = new StringTokenizer(reader.readLine());\n\t\t\t}",
"st = new StringTokenizer(reader.readLine())",
"st",
"new StringTokenizer(reader.readLine())",
"return st.nextToken();",
"st.nextToken()",
"st.nextToken",
"st",
"public String nextLine() throws IOException {\n\t\t\tst = null;\n\t\t\tString readLine = null;\n\t\t\treadLine = reader.readLine();\n\t\t\treturn readLine;\n\t\t}",
"nextLine",
"{\n\t\t\tst = null;\n\t\t\tString readLine = null;\n\t\t\treadLine = reader.readLine();\n\t\t\treturn readLine;\n\t\t}",
"st = null",
"st",
"null",
"String readLine = null;",
"readLine",
"null",
"readLine = reader.readLine()",
"readLine",
"reader.readLine()",
"reader.readLine",
"reader",
"return readLine;",
"readLine",
"public int nextInt() throws NumberFormatException, IOException {\n\t\t\treturn Integer.parseInt(next());\n\t\t}",
"nextInt",
"{\n\t\t\treturn Integer.parseInt(next());\n\t\t}",
"return Integer.parseInt(next());",
"Integer.parseInt(next())",
"Integer.parseInt",
"Integer",
"next()",
"next",
"public long nextLong() throws NumberFormatException, IOException {\n\t\t\treturn Long.parseLong(next());\n\t\t}",
"nextLong",
"{\n\t\t\treturn Long.parseLong(next());\n\t\t}",
"return Long.parseLong(next());",
"Long.parseLong(next())",
"Long.parseLong",
"Long",
"next()",
"next",
"public int[] nextIntArr(int n) throws NumberFormatException, IOException {\n\t\t\tint[] retArr = new int[n];\n\t\t\tfor (int i = 0; i < n; i++) {\n\t\t\t\tretArr[i] = nextInt();\n\t\t\t}\n\t\t\treturn retArr;\n\t\t}",
"nextIntArr",
"{\n\t\t\tint[] retArr = new int[n];\n\t\t\tfor (int i = 0; i < n; i++) {\n\t\t\t\tretArr[i] = nextInt();\n\t\t\t}\n\t\t\treturn retArr;\n\t\t}",
"int[] retArr = new int[n];",
"retArr",
"new int[n]",
"n",
"for (int i = 0; i < n; i++) {\n\t\t\t\tretArr[i] = nextInt();\n\t\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < n",
"i",
"n",
"i++",
"i++",
"i",
"{\n\t\t\t\tretArr[i] = nextInt();\n\t\t\t}",
"{\n\t\t\t\tretArr[i] = nextInt();\n\t\t\t}",
"retArr[i] = nextInt()",
"retArr[i]",
"retArr",
"i",
"nextInt()",
"nextInt",
"return retArr;",
"retArr",
"int n",
"n",
"public long[] nextLongArr(int n) throws NumberFormatException, IOException {\n\t\t\tlong[] retArr = new long[n];\n\t\t\tfor (int i = 0; i < n; i++) {\n\t\t\t\tretArr[i] = nextLong();\n\t\t\t}\n\t\t\treturn retArr;\n\t\t}",
"nextLongArr",
"{\n\t\t\tlong[] retArr = new long[n];\n\t\t\tfor (int i = 0; i < n; i++) {\n\t\t\t\tretArr[i] = nextLong();\n\t\t\t}\n\t\t\treturn retArr;\n\t\t}",
"long[] retArr = new long[n];",
"retArr",
"new long[n]",
"n",
"for (int i = 0; i < n; i++) {\n\t\t\t\tretArr[i] = nextLong();\n\t\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < n",
"i",
"n",
"i++",
"i++",
"i",
"{\n\t\t\t\tretArr[i] = nextLong();\n\t\t\t}",
"{\n\t\t\t\tretArr[i] = nextLong();\n\t\t\t}",
"retArr[i] = nextLong()",
"retArr[i]",
"retArr",
"i",
"nextLong()",
"nextLong",
"return retArr;",
"retArr",
"int n",
"n",
"public void close() throws IOException {\n\t\t\treader.close();\n\t\t}",
"close",
"{\n\t\t\treader.close();\n\t\t}",
"reader.close()",
"reader.close",
"reader",
"public class Main {\n\n\tpublic static void main(String[] args) throws IOException {\n\t\tMain mainObj = new Main();\n\t\tmainObj.solve();\n\t}\n\t\n\tHashMap<Integer, Integer> gcdMap;\n\n\tpublic void solve() throws IOException {\n\t\tFastScanner fs = new FastScanner();\n\t\tint n = fs.nextInt();\n\t\t\n\t\tgcdMap = new HashMap<>();\n\t\t\n\t\tlong sum = 0;\n\t\t\n\t\tfor (int i = 1; i <= n; i++) {\n\t\t\tfor(int j = i; j <= n; j++) {\n\t\t\t\tfor(int k = j; k <= n; k++) {\n\t\t\t\t\tif(i == j && j == k) {\n\t\t\t\t\t\tsum += gcd3(i, j,k);\n\t\t\t\t\t}else if(i == j || j == k || k == i){\n\t\t\t\t\t\tsum += 3*gcd3(i, j,k);\n\t\t\t\t\t}else {\n\t\t\t\t\t\tsum += 6*gcd3(i, j,k);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tSystem.out.println(sum);\n\t}\n\t\n\tlong gcd3(int a , int b, int c) {\n\t\tint firstGCD = gcd(a,b);\n\t\tint secondGCD = gcd(firstGCD, c);\n\t\treturn (long)secondGCD;\n\t}\n\t\n\tint gcd(int a,int b) {\n\t\t\n\t\tif(a < b) {\n\t\t\tint temp = a;\n\t\t\ta = b;\n\t\t\tb = temp;\n\t\t}\n\t\t\n\t\tint key = b*1000+a;\n\t\tif(gcdMap.containsKey(key)) {\n\t\t\treturn gcdMap.get(key);\n\t\t}\n\t\t\n\t\tint r = a % b;\n\t\twhile(r != 0) {\n\t\t\ta = b;\n\t\t\tb = r;\n\t\t\tr = a % b;\n\t\t}\n\t\t\n\t\tgcdMap.put(key, b);\n\t\treturn b;\n\t}\n\n\t\n\n\tpublic class FastScanner {\n\n\t\tBufferedReader reader;\n\t\tprivate StringTokenizer st;\n\n\t\tpublic FastScanner() {\n\t\t\tst = null;\n\t\t\treader = new BufferedReader(new InputStreamReader(System.in));\n\t\t}\n\n\t\tpublic String next() throws IOException {\n\t\t\tif (st == null || !st.hasMoreElements()) {\n\t\t\t\tst = new StringTokenizer(reader.readLine());\n\t\t\t}\n\t\t\treturn st.nextToken();\n\t\t}\n\n\t\tpublic String nextLine() throws IOException {\n\t\t\tst = null;\n\t\t\tString readLine = null;\n\t\t\treadLine = reader.readLine();\n\t\t\treturn readLine;\n\t\t}\n\n\t\tpublic int nextInt() throws NumberFormatException, IOException {\n\t\t\treturn Integer.parseInt(next());\n\t\t}\n\n\t\tpublic long nextLong() throws NumberFormatException, IOException {\n\t\t\treturn Long.parseLong(next());\n\t\t}\n\n\t\tpublic int[] nextIntArr(int n) throws NumberFormatException, IOException {\n\t\t\tint[] retArr = new int[n];\n\t\t\tfor (int i = 0; i < n; i++) {\n\t\t\t\tretArr[i] = nextInt();\n\t\t\t}\n\t\t\treturn retArr;\n\t\t}\n\n\t\tpublic long[] nextLongArr(int n) throws NumberFormatException, IOException {\n\t\t\tlong[] retArr = new long[n];\n\t\t\tfor (int i = 0; i < n; i++) {\n\t\t\t\tretArr[i] = nextLong();\n\t\t\t}\n\t\t\treturn retArr;\n\t\t}\n\n\t\tpublic void close() throws IOException {\n\t\t\treader.close();\n\t\t}\n\t}\n\n}",
"public class Main {\n\n\tpublic static void main(String[] args) throws IOException {\n\t\tMain mainObj = new Main();\n\t\tmainObj.solve();\n\t}\n\t\n\tHashMap<Integer, Integer> gcdMap;\n\n\tpublic void solve() throws IOException {\n\t\tFastScanner fs = new FastScanner();\n\t\tint n = fs.nextInt();\n\t\t\n\t\tgcdMap = new HashMap<>();\n\t\t\n\t\tlong sum = 0;\n\t\t\n\t\tfor (int i = 1; i <= n; i++) {\n\t\t\tfor(int j = i; j <= n; j++) {\n\t\t\t\tfor(int k = j; k <= n; k++) {\n\t\t\t\t\tif(i == j && j == k) {\n\t\t\t\t\t\tsum += gcd3(i, j,k);\n\t\t\t\t\t}else if(i == j || j == k || k == i){\n\t\t\t\t\t\tsum += 3*gcd3(i, j,k);\n\t\t\t\t\t}else {\n\t\t\t\t\t\tsum += 6*gcd3(i, j,k);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tSystem.out.println(sum);\n\t}\n\t\n\tlong gcd3(int a , int b, int c) {\n\t\tint firstGCD = gcd(a,b);\n\t\tint secondGCD = gcd(firstGCD, c);\n\t\treturn (long)secondGCD;\n\t}\n\t\n\tint gcd(int a,int b) {\n\t\t\n\t\tif(a < b) {\n\t\t\tint temp = a;\n\t\t\ta = b;\n\t\t\tb = temp;\n\t\t}\n\t\t\n\t\tint key = b*1000+a;\n\t\tif(gcdMap.containsKey(key)) {\n\t\t\treturn gcdMap.get(key);\n\t\t}\n\t\t\n\t\tint r = a % b;\n\t\twhile(r != 0) {\n\t\t\ta = b;\n\t\t\tb = r;\n\t\t\tr = a % b;\n\t\t}\n\t\t\n\t\tgcdMap.put(key, b);\n\t\treturn b;\n\t}\n\n\t\n\n\tpublic class FastScanner {\n\n\t\tBufferedReader reader;\n\t\tprivate StringTokenizer st;\n\n\t\tpublic FastScanner() {\n\t\t\tst = null;\n\t\t\treader = new BufferedReader(new InputStreamReader(System.in));\n\t\t}\n\n\t\tpublic String next() throws IOException {\n\t\t\tif (st == null || !st.hasMoreElements()) {\n\t\t\t\tst = new StringTokenizer(reader.readLine());\n\t\t\t}\n\t\t\treturn st.nextToken();\n\t\t}\n\n\t\tpublic String nextLine() throws IOException {\n\t\t\tst = null;\n\t\t\tString readLine = null;\n\t\t\treadLine = reader.readLine();\n\t\t\treturn readLine;\n\t\t}\n\n\t\tpublic int nextInt() throws NumberFormatException, IOException {\n\t\t\treturn Integer.parseInt(next());\n\t\t}\n\n\t\tpublic long nextLong() throws NumberFormatException, IOException {\n\t\t\treturn Long.parseLong(next());\n\t\t}\n\n\t\tpublic int[] nextIntArr(int n) throws NumberFormatException, IOException {\n\t\t\tint[] retArr = new int[n];\n\t\t\tfor (int i = 0; i < n; i++) {\n\t\t\t\tretArr[i] = nextInt();\n\t\t\t}\n\t\t\treturn retArr;\n\t\t}\n\n\t\tpublic long[] nextLongArr(int n) throws NumberFormatException, IOException {\n\t\t\tlong[] retArr = new long[n];\n\t\t\tfor (int i = 0; i < n; i++) {\n\t\t\t\tretArr[i] = nextLong();\n\t\t\t}\n\t\t\treturn retArr;\n\t\t}\n\n\t\tpublic void close() throws IOException {\n\t\t\treader.close();\n\t\t}\n\t}\n\n}",
"Main"
] |
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.HashMap;
import java.util.StringTokenizer;
public class Main {
public static void main(String[] args) throws IOException {
Main mainObj = new Main();
mainObj.solve();
}
HashMap<Integer, Integer> gcdMap;
public void solve() throws IOException {
FastScanner fs = new FastScanner();
int n = fs.nextInt();
gcdMap = new HashMap<>();
long sum = 0;
for (int i = 1; i <= n; i++) {
for(int j = i; j <= n; j++) {
for(int k = j; k <= n; k++) {
if(i == j && j == k) {
sum += gcd3(i, j,k);
}else if(i == j || j == k || k == i){
sum += 3*gcd3(i, j,k);
}else {
sum += 6*gcd3(i, j,k);
}
}
}
}
System.out.println(sum);
}
long gcd3(int a , int b, int c) {
int firstGCD = gcd(a,b);
int secondGCD = gcd(firstGCD, c);
return (long)secondGCD;
}
int gcd(int a,int b) {
if(a < b) {
int temp = a;
a = b;
b = temp;
}
int key = b*1000+a;
if(gcdMap.containsKey(key)) {
return gcdMap.get(key);
}
int r = a % b;
while(r != 0) {
a = b;
b = r;
r = a % b;
}
gcdMap.put(key, b);
return b;
}
public class FastScanner {
BufferedReader reader;
private StringTokenizer st;
public FastScanner() {
st = null;
reader = new BufferedReader(new InputStreamReader(System.in));
}
public String next() throws IOException {
if (st == null || !st.hasMoreElements()) {
st = new StringTokenizer(reader.readLine());
}
return st.nextToken();
}
public String nextLine() throws IOException {
st = null;
String readLine = null;
readLine = reader.readLine();
return readLine;
}
public int nextInt() throws NumberFormatException, IOException {
return Integer.parseInt(next());
}
public long nextLong() throws NumberFormatException, IOException {
return Long.parseLong(next());
}
public int[] nextIntArr(int n) throws NumberFormatException, IOException {
int[] retArr = new int[n];
for (int i = 0; i < n; i++) {
retArr[i] = nextInt();
}
return retArr;
}
public long[] nextLongArr(int n) throws NumberFormatException, IOException {
long[] retArr = new long[n];
for (int i = 0; i < n; i++) {
retArr[i] = nextLong();
}
return retArr;
}
public void close() throws IOException {
reader.close();
}
}
}
|
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
14,
2,
13,
13,
29,
4,
13,
13,
13,
14,
2,
13,
17,
29,
13,
29,
4,
13,
13,
2,
13,
13,
23,
13,
23,
13,
12,
13,
30,
14,
2,
13,
13,
29,
4,
13,
13,
13,
14,
2,
13,
17,
29,
13,
29,
4,
13,
13,
2,
13,
13,
23,
13,
23,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
17,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
4,
13,
2,
13,
17,
2,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
4,
13,
13,
2,
13,
17,
4,
18,
18,
13,
13,
13,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
146,
5
],
[
146,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
10,
11
],
[
10,
12
],
[
9,
13
],
[
13,
14
],
[
14,
15
],
[
14,
16
],
[
14,
17
],
[
8,
18
],
[
18,
19
],
[
19,
20
],
[
19,
21
],
[
18,
22
],
[
22,
23
],
[
8,
24
],
[
24,
25
],
[
25,
26
],
[
25,
27
],
[
25,
28
],
[
28,
29
],
[
28,
30
],
[
6,
31
],
[
31,
32
],
[
6,
33
],
[
33,
34
],
[
146,
35
],
[
35,
36
],
[
35,
37
],
[
37,
38
],
[
38,
39
],
[
39,
40
],
[
39,
41
],
[
38,
42
],
[
42,
43
],
[
43,
44
],
[
43,
45
],
[
43,
46
],
[
37,
47
],
[
47,
48
],
[
48,
49
],
[
48,
50
],
[
47,
51
],
[
51,
52
],
[
37,
53
],
[
53,
54
],
[
54,
55
],
[
54,
56
],
[
54,
57
],
[
57,
58
],
[
57,
59
],
[
35,
60
],
[
60,
61
],
[
35,
62
],
[
62,
63
],
[
146,
64
],
[
64,
65
],
[
64,
66
],
[
66,
67
],
[
67,
68
],
[
67,
69
],
[
66,
70
],
[
70,
71
],
[
70,
72
],
[
72,
73
],
[
73,
74
],
[
66,
75
],
[
75,
76
],
[
75,
77
],
[
66,
78
],
[
78,
79
],
[
78,
80
],
[
66,
81
],
[
81,
82
],
[
82,
83
],
[
83,
84
],
[
83,
85
],
[
81,
86
],
[
86,
87
],
[
86,
88
],
[
81,
89
],
[
89,
90
],
[
90,
91
],
[
81,
92
],
[
92,
93
],
[
93,
94
],
[
94,
95
],
[
95,
96
],
[
95,
97
],
[
93,
98
],
[
98,
99
],
[
98,
100
],
[
93,
101
],
[
101,
102
],
[
102,
103
],
[
93,
104
],
[
105,
105
],
[
105,
106
],
[
106,
107
],
[
106,
108
],
[
108,
109
],
[
108,
110
],
[
110,
111
],
[
110,
112
],
[
108,
113
],
[
113,
114
],
[
113,
115
],
[
105,
116
],
[
116,
117
],
[
117,
118
],
[
118,
119
],
[
118,
120
],
[
116,
121
],
[
121,
122
],
[
121,
123
],
[
116,
124
],
[
124,
125
],
[
125,
126
],
[
116,
127
],
[
128,
128
],
[
128,
129
],
[
129,
130
],
[
129,
131
],
[
131,
132
],
[
131,
133
],
[
131,
134
],
[
134,
135
],
[
134,
136
],
[
66,
137
],
[
137,
138
],
[
138,
139
],
[
139,
140
],
[
139,
141
],
[
137,
142
],
[
64,
143
],
[
143,
144
],
[
0,
145
],
[
145,
146
],
[
145,
147
]
] |
[
"import java.util.*;\npublic class Main {\n\n\tpublic static int gcd(int a,int b) {\n\t\t\n\t\tif(a<b) return gcd(b,a);\n\t\tif(b==0) return a;\n\t\t\n\t\treturn gcd(b,a%b);\n\t}\n\t\n\tpublic static int gcd2(int a,int c) {\n\t\tif(a<c) return gcd2(c,a);\n\t\tif(c==0) return a;\n\t\t\n\t\treturn gcd2(c,a%c);\n\t}\n\t\n\tpublic static void main(String[] args) {\n\t\t// TODO Auto-generated method stub\n\t\tScanner cin = new Scanner(System.in);\n\t\tint K = cin.nextInt();\n\t\t\n\t\tint sum = 0;\n\t\tint a = 0;;\n\t\tfor(int i = 0;i<K;i++)\n\t\t\tfor(int j = 0;j<K;j++) {\n\t\t\t\ta = gcd(i+1,j+1);\n\t\t\t\tfor(int n= 0;n<K;n++) {\n\t\t\t\t\tsum+=gcd(a,n+1);\n\t\t\t\t}\n\t\t\t}\n\t\tSystem.out.println(sum);\n\n\t}\n\n}",
"import java.util.*;",
"util.*",
"java",
"public class Main {\n\n\tpublic static int gcd(int a,int b) {\n\t\t\n\t\tif(a<b) return gcd(b,a);\n\t\tif(b==0) return a;\n\t\t\n\t\treturn gcd(b,a%b);\n\t}\n\t\n\tpublic static int gcd2(int a,int c) {\n\t\tif(a<c) return gcd2(c,a);\n\t\tif(c==0) return a;\n\t\t\n\t\treturn gcd2(c,a%c);\n\t}\n\t\n\tpublic static void main(String[] args) {\n\t\t// TODO Auto-generated method stub\n\t\tScanner cin = new Scanner(System.in);\n\t\tint K = cin.nextInt();\n\t\t\n\t\tint sum = 0;\n\t\tint a = 0;;\n\t\tfor(int i = 0;i<K;i++)\n\t\t\tfor(int j = 0;j<K;j++) {\n\t\t\t\ta = gcd(i+1,j+1);\n\t\t\t\tfor(int n= 0;n<K;n++) {\n\t\t\t\t\tsum+=gcd(a,n+1);\n\t\t\t\t}\n\t\t\t}\n\t\tSystem.out.println(sum);\n\n\t}\n\n}",
"Main",
"public static int gcd(int a,int b) {\n\t\t\n\t\tif(a<b) return gcd(b,a);\n\t\tif(b==0) return a;\n\t\t\n\t\treturn gcd(b,a%b);\n\t}",
"gcd",
"{\n\t\t\n\t\tif(a<b) return gcd(b,a);\n\t\tif(b==0) return a;\n\t\t\n\t\treturn gcd(b,a%b);\n\t}",
"if(a<b) return gcd(b,a);",
"a<b",
"a",
"b",
"return gcd(b,a);",
"gcd(b,a)",
"gcd",
"b",
"a",
"if(b==0) return a;",
"b==0",
"b",
"0",
"return a;",
"a",
"return gcd(b,a%b);",
"gcd(b,a%b)",
"gcd",
"b",
"a%b",
"a",
"b",
"int a",
"a",
"int b",
"b",
"public static int gcd2(int a,int c) {\n\t\tif(a<c) return gcd2(c,a);\n\t\tif(c==0) return a;\n\t\t\n\t\treturn gcd2(c,a%c);\n\t}",
"gcd2",
"{\n\t\tif(a<c) return gcd2(c,a);\n\t\tif(c==0) return a;\n\t\t\n\t\treturn gcd2(c,a%c);\n\t}",
"if(a<c) return gcd2(c,a);",
"a<c",
"a",
"c",
"return gcd2(c,a);",
"gcd2(c,a)",
"gcd2",
"c",
"a",
"if(c==0) return a;",
"c==0",
"c",
"0",
"return a;",
"a",
"return gcd2(c,a%c);",
"gcd2(c,a%c)",
"gcd2",
"c",
"a%c",
"a",
"c",
"int a",
"a",
"int c",
"c",
"public static void main(String[] args) {\n\t\t// TODO Auto-generated method stub\n\t\tScanner cin = new Scanner(System.in);\n\t\tint K = cin.nextInt();\n\t\t\n\t\tint sum = 0;\n\t\tint a = 0;;\n\t\tfor(int i = 0;i<K;i++)\n\t\t\tfor(int j = 0;j<K;j++) {\n\t\t\t\ta = gcd(i+1,j+1);\n\t\t\t\tfor(int n= 0;n<K;n++) {\n\t\t\t\t\tsum+=gcd(a,n+1);\n\t\t\t\t}\n\t\t\t}\n\t\tSystem.out.println(sum);\n\n\t}",
"main",
"{\n\t\t// TODO Auto-generated method stub\n\t\tScanner cin = new Scanner(System.in);\n\t\tint K = cin.nextInt();\n\t\t\n\t\tint sum = 0;\n\t\tint a = 0;;\n\t\tfor(int i = 0;i<K;i++)\n\t\t\tfor(int j = 0;j<K;j++) {\n\t\t\t\ta = gcd(i+1,j+1);\n\t\t\t\tfor(int n= 0;n<K;n++) {\n\t\t\t\t\tsum+=gcd(a,n+1);\n\t\t\t\t}\n\t\t\t}\n\t\tSystem.out.println(sum);\n\n\t}",
"Scanner cin = new Scanner(System.in);",
"cin",
"new Scanner(System.in)",
"int K = cin.nextInt();",
"K",
"cin.nextInt()",
"cin.nextInt",
"cin",
"int sum = 0;",
"sum",
"0",
"int a = 0;",
"a",
"0",
"for(int i = 0;i<K;i++)\n\t\t\tfor(int j = 0;j<K;j++) {\n\t\t\t\ta = gcd(i+1,j+1);\n\t\t\t\tfor(int n= 0;n<K;n++) {\n\t\t\t\t\tsum+=gcd(a,n+1);\n\t\t\t\t}\n\t\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i<K",
"i",
"K",
"i++",
"i++",
"i",
"for(int j = 0;j<K;j++) {\n\t\t\t\ta = gcd(i+1,j+1);\n\t\t\t\tfor(int n= 0;n<K;n++) {\n\t\t\t\t\tsum+=gcd(a,n+1);\n\t\t\t\t}\n\t\t\t}",
"for(int j = 0;j<K;j++) {\n\t\t\t\ta = gcd(i+1,j+1);\n\t\t\t\tfor(int n= 0;n<K;n++) {\n\t\t\t\t\tsum+=gcd(a,n+1);\n\t\t\t\t}\n\t\t\t}",
"int j = 0;",
"int j = 0;",
"j",
"0",
"j<K",
"j",
"K",
"j++",
"j++",
"j",
"{\n\t\t\t\ta = gcd(i+1,j+1);\n\t\t\t\tfor(int n= 0;n<K;n++) {\n\t\t\t\t\tsum+=gcd(a,n+1);\n\t\t\t\t}\n\t\t\t}",
"{\n\t\t\t\ta = gcd(i+1,j+1);\n\t\t\t\tfor(int n= 0;n<K;n++) {\n\t\t\t\t\tsum+=gcd(a,n+1);\n\t\t\t\t}\n\t\t\t}",
"a = gcd(i+1,j+1)",
"a",
"gcd(i+1,j+1)",
"gcd",
"i+1",
"i",
"1",
"j+1",
"j",
"1",
"for(int n= 0;n<K;n++) {\n\t\t\t\t\tsum+=gcd(a,n+1);\n\t\t\t\t}",
"int n= 0;",
"int n= 0;",
"n",
"0",
"n<K",
"n",
"K",
"n++",
"n++",
"n",
"{\n\t\t\t\t\tsum+=gcd(a,n+1);\n\t\t\t\t}",
"{\n\t\t\t\t\tsum+=gcd(a,n+1);\n\t\t\t\t}",
"sum+=gcd(a,n+1)",
"sum",
"gcd(a,n+1)",
"gcd",
"a",
"n+1",
"n",
"1",
"System.out.println(sum)",
"System.out.println",
"System.out",
"System",
"System.out",
"sum",
"String[] args",
"args",
"public class Main {\n\n\tpublic static int gcd(int a,int b) {\n\t\t\n\t\tif(a<b) return gcd(b,a);\n\t\tif(b==0) return a;\n\t\t\n\t\treturn gcd(b,a%b);\n\t}\n\t\n\tpublic static int gcd2(int a,int c) {\n\t\tif(a<c) return gcd2(c,a);\n\t\tif(c==0) return a;\n\t\t\n\t\treturn gcd2(c,a%c);\n\t}\n\t\n\tpublic static void main(String[] args) {\n\t\t// TODO Auto-generated method stub\n\t\tScanner cin = new Scanner(System.in);\n\t\tint K = cin.nextInt();\n\t\t\n\t\tint sum = 0;\n\t\tint a = 0;;\n\t\tfor(int i = 0;i<K;i++)\n\t\t\tfor(int j = 0;j<K;j++) {\n\t\t\t\ta = gcd(i+1,j+1);\n\t\t\t\tfor(int n= 0;n<K;n++) {\n\t\t\t\t\tsum+=gcd(a,n+1);\n\t\t\t\t}\n\t\t\t}\n\t\tSystem.out.println(sum);\n\n\t}\n\n}",
"public class Main {\n\n\tpublic static int gcd(int a,int b) {\n\t\t\n\t\tif(a<b) return gcd(b,a);\n\t\tif(b==0) return a;\n\t\t\n\t\treturn gcd(b,a%b);\n\t}\n\t\n\tpublic static int gcd2(int a,int c) {\n\t\tif(a<c) return gcd2(c,a);\n\t\tif(c==0) return a;\n\t\t\n\t\treturn gcd2(c,a%c);\n\t}\n\t\n\tpublic static void main(String[] args) {\n\t\t// TODO Auto-generated method stub\n\t\tScanner cin = new Scanner(System.in);\n\t\tint K = cin.nextInt();\n\t\t\n\t\tint sum = 0;\n\t\tint a = 0;;\n\t\tfor(int i = 0;i<K;i++)\n\t\t\tfor(int j = 0;j<K;j++) {\n\t\t\t\ta = gcd(i+1,j+1);\n\t\t\t\tfor(int n= 0;n<K;n++) {\n\t\t\t\t\tsum+=gcd(a,n+1);\n\t\t\t\t}\n\t\t\t}\n\t\tSystem.out.println(sum);\n\n\t}\n\n}",
"Main"
] |
import java.util.*;
public class Main {
public static int gcd(int a,int b) {
if(a<b) return gcd(b,a);
if(b==0) return a;
return gcd(b,a%b);
}
public static int gcd2(int a,int c) {
if(a<c) return gcd2(c,a);
if(c==0) return a;
return gcd2(c,a%c);
}
public static void main(String[] args) {
// TODO Auto-generated method stub
Scanner cin = new Scanner(System.in);
int K = cin.nextInt();
int sum = 0;
int a = 0;;
for(int i = 0;i<K;i++)
for(int j = 0;j<K;j++) {
a = gcd(i+1,j+1);
for(int n= 0;n<K;n++) {
sum+=gcd(a,n+1);
}
}
System.out.println(sum);
}
}
|
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
4,
13,
4,
13,
13,
13,
13,
4,
18,
18,
13,
13,
13,
23,
13,
12,
13,
30,
14,
2,
13,
17,
29,
17,
29,
2,
13,
4,
13,
2,
13,
17,
23,
13,
12,
13,
30,
41,
13,
17,
28,
13,
13,
30,
0,
13,
13,
29,
13,
23,
13,
12,
13,
30,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
2,
13,
13,
29,
2,
13,
4,
13,
13,
23,
13,
23,
13,
12,
13,
30,
29,
2,
4,
18,
13,
13,
4,
18,
13,
13,
23,
13,
23,
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,
4,
13,
13,
13,
13,
23,
13,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
200,
5
],
[
200,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
8,
17
],
[
17,
18
],
[
17,
19
],
[
8,
20
],
[
20,
21
],
[
21,
22
],
[
22,
23
],
[
22,
24
],
[
20,
25
],
[
25,
26
],
[
25,
27
],
[
20,
28
],
[
28,
29
],
[
29,
30
],
[
20,
31
],
[
32,
32
],
[
32,
33
],
[
33,
34
],
[
34,
35
],
[
35,
36
],
[
35,
37
],
[
33,
38
],
[
38,
39
],
[
38,
40
],
[
33,
41
],
[
41,
42
],
[
42,
43
],
[
33,
44
],
[
45,
45
],
[
45,
46
],
[
46,
47
],
[
47,
48
],
[
48,
49
],
[
48,
50
],
[
46,
51
],
[
51,
52
],
[
51,
53
],
[
46,
54
],
[
54,
55
],
[
55,
56
],
[
46,
57
],
[
58,
58
],
[
58,
59
],
[
59,
60
],
[
59,
61
],
[
61,
62
],
[
61,
63
],
[
63,
64
],
[
63,
65
],
[
63,
66
],
[
61,
67
],
[
8,
68
],
[
68,
69
],
[
69,
70
],
[
70,
71
],
[
70,
72
],
[
68,
73
],
[
6,
74
],
[
74,
75
],
[
200,
76
],
[
76,
77
],
[
76,
78
],
[
78,
79
],
[
79,
80
],
[
80,
81
],
[
80,
82
],
[
79,
83
],
[
83,
84
],
[
79,
85
],
[
85,
86
],
[
86,
87
],
[
86,
88
],
[
88,
89
],
[
88,
90
],
[
90,
91
],
[
90,
92
],
[
76,
93
],
[
93,
94
],
[
200,
95
],
[
95,
96
],
[
95,
97
],
[
97,
98
],
[
98,
99
],
[
98,
100
],
[
97,
101
],
[
101,
102
],
[
101,
103
],
[
101,
104
],
[
104,
105
],
[
105,
106
],
[
105,
107
],
[
97,
108
],
[
108,
109
],
[
95,
110
],
[
110,
111
],
[
200,
112
],
[
112,
113
],
[
112,
114
],
[
114,
115
],
[
115,
116
],
[
115,
117
],
[
114,
118
],
[
118,
119
],
[
119,
120
],
[
120,
121
],
[
120,
122
],
[
118,
123
],
[
123,
124
],
[
123,
125
],
[
118,
126
],
[
126,
127
],
[
127,
128
],
[
118,
129
],
[
130,
130
],
[
130,
131
],
[
131,
132
],
[
131,
133
],
[
133,
134
],
[
133,
135
],
[
114,
136
],
[
136,
137
],
[
137,
138
],
[
137,
139
],
[
139,
140
],
[
139,
141
],
[
112,
142
],
[
142,
143
],
[
112,
144
],
[
144,
145
],
[
200,
146
],
[
146,
147
],
[
146,
148
],
[
148,
149
],
[
149,
150
],
[
150,
151
],
[
151,
152
],
[
152,
153
],
[
151,
154
],
[
150,
155
],
[
155,
156
],
[
156,
157
],
[
155,
158
],
[
146,
159
],
[
159,
160
],
[
146,
161
],
[
161,
162
],
[
200,
163
],
[
163,
164
],
[
163,
165
],
[
165,
166
],
[
166,
167
],
[
167,
168
],
[
167,
169
],
[
166,
170
],
[
170,
171
],
[
166,
172
],
[
172,
173
],
[
173,
174
],
[
173,
175
],
[
173,
176
],
[
176,
177
],
[
176,
178
],
[
163,
179
],
[
179,
180
],
[
163,
181
],
[
181,
182
],
[
200,
183
],
[
183,
184
],
[
183,
185
],
[
185,
186
],
[
186,
187
],
[
187,
188
],
[
188,
189
],
[
188,
190
],
[
190,
191
],
[
190,
192
],
[
190,
193
],
[
187,
194
],
[
183,
195
],
[
195,
196
],
[
183,
197
],
[
197,
198
],
[
0,
199
],
[
199,
200
],
[
199,
201
]
] |
[
"import java.util.*;\n\npublic class Main {\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n int k = sc.nextInt();\n long ans = 0;\n for (int a=1;a<=k;a++){\n for (int b=1;b<=k;b++){\n for (int c=1;c<=k;c++){\n ans+=gcd(gcd(a,b),c);\n }\n }\n }\n System.out.println(ans);\n }\n static long factorial(long num){\n if (num<2)return 1;\n else return num*factorial(num-1);\n }\n static int arraySum(int[] array){\n int ans = 0;\n for (int value : array) ans += value;\n return ans;\n }\n static long combination(long a, long b){\n long data = 1;\n for (int i=0;i<b;i++){\n data*=a-i;\n }\n return data/factorial(b);\n }\n static double log(double base,double antilogarithm){\n return Math.log(antilogarithm)/Math.log(base);\n }\n\n static long gcd(long x,long y){\n if (y==0)return x;\n else return gcd(y,x%y);\n }\n static long lcm(long x,long y){\n return x/gcd(x,y)*y;\n }\n\n}",
"import java.util.*;",
"util.*",
"java",
"public class Main {\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n int k = sc.nextInt();\n long ans = 0;\n for (int a=1;a<=k;a++){\n for (int b=1;b<=k;b++){\n for (int c=1;c<=k;c++){\n ans+=gcd(gcd(a,b),c);\n }\n }\n }\n System.out.println(ans);\n }\n static long factorial(long num){\n if (num<2)return 1;\n else return num*factorial(num-1);\n }\n static int arraySum(int[] array){\n int ans = 0;\n for (int value : array) ans += value;\n return ans;\n }\n static long combination(long a, long b){\n long data = 1;\n for (int i=0;i<b;i++){\n data*=a-i;\n }\n return data/factorial(b);\n }\n static double log(double base,double antilogarithm){\n return Math.log(antilogarithm)/Math.log(base);\n }\n\n static long gcd(long x,long y){\n if (y==0)return x;\n else return gcd(y,x%y);\n }\n static long lcm(long x,long y){\n return x/gcd(x,y)*y;\n }\n\n}",
"Main",
"public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n int k = sc.nextInt();\n long ans = 0;\n for (int a=1;a<=k;a++){\n for (int b=1;b<=k;b++){\n for (int c=1;c<=k;c++){\n ans+=gcd(gcd(a,b),c);\n }\n }\n }\n System.out.println(ans);\n }",
"main",
"{\n Scanner sc = new Scanner(System.in);\n int k = sc.nextInt();\n long ans = 0;\n for (int a=1;a<=k;a++){\n for (int b=1;b<=k;b++){\n for (int c=1;c<=k;c++){\n ans+=gcd(gcd(a,b),c);\n }\n }\n }\n System.out.println(ans);\n }",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"int k = sc.nextInt();",
"k",
"sc.nextInt()",
"sc.nextInt",
"sc",
"long ans = 0;",
"ans",
"0",
"for (int a=1;a<=k;a++){\n for (int b=1;b<=k;b++){\n for (int c=1;c<=k;c++){\n ans+=gcd(gcd(a,b),c);\n }\n }\n }",
"int a=1;",
"int a=1;",
"a",
"1",
"a<=k",
"a",
"k",
"a++",
"a++",
"a",
"{\n for (int b=1;b<=k;b++){\n for (int c=1;c<=k;c++){\n ans+=gcd(gcd(a,b),c);\n }\n }\n }",
"{\n for (int b=1;b<=k;b++){\n for (int c=1;c<=k;c++){\n ans+=gcd(gcd(a,b),c);\n }\n }\n }",
"for (int b=1;b<=k;b++){\n for (int c=1;c<=k;c++){\n ans+=gcd(gcd(a,b),c);\n }\n }",
"int b=1;",
"int b=1;",
"b",
"1",
"b<=k",
"b",
"k",
"b++",
"b++",
"b",
"{\n for (int c=1;c<=k;c++){\n ans+=gcd(gcd(a,b),c);\n }\n }",
"{\n for (int c=1;c<=k;c++){\n ans+=gcd(gcd(a,b),c);\n }\n }",
"for (int c=1;c<=k;c++){\n ans+=gcd(gcd(a,b),c);\n }",
"int c=1;",
"int c=1;",
"c",
"1",
"c<=k",
"c",
"k",
"c++",
"c++",
"c",
"{\n ans+=gcd(gcd(a,b),c);\n }",
"{\n ans+=gcd(gcd(a,b),c);\n }",
"ans+=gcd(gcd(a,b),c)",
"ans",
"gcd(gcd(a,b),c)",
"gcd",
"gcd(a,b)",
"gcd",
"a",
"b",
"c",
"System.out.println(ans)",
"System.out.println",
"System.out",
"System",
"System.out",
"ans",
"String[] args",
"args",
"static long factorial(long num){\n if (num<2)return 1;\n else return num*factorial(num-1);\n }",
"factorial",
"{\n if (num<2)return 1;\n else return num*factorial(num-1);\n }",
"if (num<2)return 1;\n else return num*factorial(num-1);",
"num<2",
"num",
"2",
"return 1;",
"1",
"return num*factorial(num-1);",
"num*factorial(num-1)",
"num",
"factorial(num-1)",
"factorial",
"num-1",
"num",
"1",
"long num",
"num",
"static int arraySum(int[] array){\n int ans = 0;\n for (int value : array) ans += value;\n return ans;\n }",
"arraySum",
"{\n int ans = 0;\n for (int value : array) ans += value;\n return ans;\n }",
"int ans = 0;",
"ans",
"0",
"for (int value : array) ans += value;",
"int value",
"array",
"ans += value;",
"ans += value",
"ans",
"value",
"return ans;",
"ans",
"int[] array",
"array",
"static long combination(long a, long b){\n long data = 1;\n for (int i=0;i<b;i++){\n data*=a-i;\n }\n return data/factorial(b);\n }",
"combination",
"{\n long data = 1;\n for (int i=0;i<b;i++){\n data*=a-i;\n }\n return data/factorial(b);\n }",
"long data = 1;",
"data",
"1",
"for (int i=0;i<b;i++){\n data*=a-i;\n }",
"int i=0;",
"int i=0;",
"i",
"0",
"i<b",
"i",
"b",
"i++",
"i++",
"i",
"{\n data*=a-i;\n }",
"{\n data*=a-i;\n }",
"data*=a-i",
"data",
"a-i",
"a",
"i",
"return data/factorial(b);",
"data/factorial(b)",
"data",
"factorial(b)",
"factorial",
"b",
"long a",
"a",
"long b",
"b",
"static double log(double base,double antilogarithm){\n return Math.log(antilogarithm)/Math.log(base);\n }",
"log",
"{\n return Math.log(antilogarithm)/Math.log(base);\n }",
"return Math.log(antilogarithm)/Math.log(base);",
"Math.log(antilogarithm)/Math.log(base)",
"Math.log(antilogarithm)",
"Math.log",
"Math",
"antilogarithm",
"Math.log(base)",
"Math.log",
"Math",
"base",
"double base",
"base",
"double antilogarithm",
"antilogarithm",
"static long gcd(long x,long y){\n if (y==0)return x;\n else return gcd(y,x%y);\n }",
"gcd",
"{\n if (y==0)return x;\n else return gcd(y,x%y);\n }",
"if (y==0)return x;\n else return gcd(y,x%y);",
"y==0",
"y",
"0",
"return x;",
"x",
"return gcd(y,x%y);",
"gcd(y,x%y)",
"gcd",
"y",
"x%y",
"x",
"y",
"long x",
"x",
"long y",
"y",
"static long lcm(long x,long y){\n return x/gcd(x,y)*y;\n }",
"lcm",
"{\n return x/gcd(x,y)*y;\n }",
"return x/gcd(x,y)*y;",
"x/gcd(x,y)*y",
"x/gcd(x,y)",
"x",
"gcd(x,y)",
"gcd",
"x",
"y",
"y",
"long x",
"x",
"long y",
"y",
"public class Main {\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n int k = sc.nextInt();\n long ans = 0;\n for (int a=1;a<=k;a++){\n for (int b=1;b<=k;b++){\n for (int c=1;c<=k;c++){\n ans+=gcd(gcd(a,b),c);\n }\n }\n }\n System.out.println(ans);\n }\n static long factorial(long num){\n if (num<2)return 1;\n else return num*factorial(num-1);\n }\n static int arraySum(int[] array){\n int ans = 0;\n for (int value : array) ans += value;\n return ans;\n }\n static long combination(long a, long b){\n long data = 1;\n for (int i=0;i<b;i++){\n data*=a-i;\n }\n return data/factorial(b);\n }\n static double log(double base,double antilogarithm){\n return Math.log(antilogarithm)/Math.log(base);\n }\n\n static long gcd(long x,long y){\n if (y==0)return x;\n else return gcd(y,x%y);\n }\n static long lcm(long x,long y){\n return x/gcd(x,y)*y;\n }\n\n}",
"public class Main {\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n int k = sc.nextInt();\n long ans = 0;\n for (int a=1;a<=k;a++){\n for (int b=1;b<=k;b++){\n for (int c=1;c<=k;c++){\n ans+=gcd(gcd(a,b),c);\n }\n }\n }\n System.out.println(ans);\n }\n static long factorial(long num){\n if (num<2)return 1;\n else return num*factorial(num-1);\n }\n static int arraySum(int[] array){\n int ans = 0;\n for (int value : array) ans += value;\n return ans;\n }\n static long combination(long a, long b){\n long data = 1;\n for (int i=0;i<b;i++){\n data*=a-i;\n }\n return data/factorial(b);\n }\n static double log(double base,double antilogarithm){\n return Math.log(antilogarithm)/Math.log(base);\n }\n\n static long gcd(long x,long y){\n if (y==0)return x;\n else return gcd(y,x%y);\n }\n static long lcm(long x,long y){\n return x/gcd(x,y)*y;\n }\n\n}",
"Main"
] |
import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int k = sc.nextInt();
long ans = 0;
for (int a=1;a<=k;a++){
for (int b=1;b<=k;b++){
for (int c=1;c<=k;c++){
ans+=gcd(gcd(a,b),c);
}
}
}
System.out.println(ans);
}
static long factorial(long num){
if (num<2)return 1;
else return num*factorial(num-1);
}
static int arraySum(int[] array){
int ans = 0;
for (int value : array) ans += value;
return ans;
}
static long combination(long a, long b){
long data = 1;
for (int i=0;i<b;i++){
data*=a-i;
}
return data/factorial(b);
}
static double log(double base,double antilogarithm){
return Math.log(antilogarithm)/Math.log(base);
}
static long gcd(long x,long y){
if (y==0)return x;
else return gcd(y,x%y);
}
static long lcm(long x,long y){
return x/gcd(x,y)*y;
}
}
|
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
41,
13,
12,
13,
30,
41,
13,
20,
0,
13,
19,
18,
13,
4,
18,
13,
23,
13,
12,
13,
30,
38,
5,
13,
30,
4,
18,
13,
30,
41,
13,
4,
18,
13,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
2,
13,
17,
1,
40,
13,
30,
30,
11,
1,
41,
13,
17,
2,
13,
2,
13,
17,
1,
40,
13,
30,
30,
11,
1,
41,
13,
17,
2,
13,
2,
13,
17,
1,
40,
13,
30,
30,
0,
13,
4,
13,
4,
13,
13,
13,
13,
4,
18,
18,
13,
13,
13,
12,
13,
30,
41,
13,
42,
2,
13,
17,
30,
0,
13,
2,
13,
13,
0,
13,
13,
0,
13,
13,
29,
13,
23,
13,
23,
13,
6,
13,
41,
13,
41,
13,
41,
13,
41,
13,
17,
12,
13,
30,
0,
13,
20,
17,
0,
13,
17,
0,
13,
20,
12,
13,
30,
38,
30,
4,
13,
30,
4,
18,
33,
12,
13,
30,
14,
2,
13,
17,
4,
18,
13,
12,
13,
30,
14,
2,
13,
18,
13,
13,
29,
18,
13,
40,
13,
41,
13,
4,
18,
13,
42,
2,
13,
17,
0,
13,
4,
18,
13,
0,
13,
4,
18,
13,
13,
17,
0,
13,
17,
29,
18,
13,
40,
13,
12,
13,
30,
29,
4,
18,
13,
4,
13,
12,
13,
30,
29,
4,
18,
13,
4,
13,
12,
13,
30,
29,
4,
18,
13,
4,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
10,
11
],
[
10,
12
],
[
0,
13
],
[
13,
14
],
[
13,
15
],
[
0,
16
],
[
16,
17
],
[
16,
18
],
[
0,
19
],
[
261,
20
],
[
261,
21
],
[
21,
22
],
[
261,
23
],
[
23,
24
],
[
23,
25
],
[
25,
26
],
[
26,
27
],
[
26,
28
],
[
25,
29
],
[
29,
30
],
[
29,
31
],
[
31,
32
],
[
32,
33
],
[
25,
34
],
[
34,
35
],
[
35,
36
],
[
23,
37
],
[
37,
38
],
[
261,
39
],
[
39,
40
],
[
39,
41
],
[
41,
42
],
[
42,
43
],
[
43,
44
],
[
43,
45
],
[
45,
46
],
[
46,
47
],
[
47,
48
],
[
42,
49
],
[
49,
50
],
[
50,
51
],
[
50,
52
],
[
52,
53
],
[
53,
54
],
[
49,
55
],
[
55,
56
],
[
55,
57
],
[
49,
58
],
[
58,
59
],
[
59,
60
],
[
60,
61
],
[
60,
62
],
[
58,
63
],
[
63,
64
],
[
63,
65
],
[
65,
66
],
[
65,
67
],
[
58,
68
],
[
68,
69
],
[
69,
70
],
[
58,
71
],
[
72,
72
],
[
72,
73
],
[
73,
74
],
[
74,
75
],
[
75,
76
],
[
75,
77
],
[
73,
78
],
[
78,
79
],
[
78,
80
],
[
80,
81
],
[
80,
82
],
[
73,
83
],
[
83,
84
],
[
84,
85
],
[
73,
86
],
[
87,
87
],
[
87,
88
],
[
88,
89
],
[
89,
90
],
[
90,
91
],
[
90,
92
],
[
88,
93
],
[
93,
94
],
[
93,
95
],
[
95,
96
],
[
95,
97
],
[
88,
98
],
[
98,
99
],
[
99,
100
],
[
88,
101
],
[
102,
102
],
[
102,
103
],
[
103,
104
],
[
103,
105
],
[
105,
106
],
[
105,
107
],
[
107,
108
],
[
107,
109
],
[
107,
110
],
[
105,
111
],
[
49,
112
],
[
112,
113
],
[
113,
114
],
[
114,
115
],
[
114,
116
],
[
112,
117
],
[
261,
118
],
[
118,
119
],
[
118,
120
],
[
120,
121
],
[
121,
122
],
[
120,
123
],
[
123,
124
],
[
124,
125
],
[
124,
126
],
[
123,
127
],
[
127,
128
],
[
128,
129
],
[
128,
130
],
[
130,
131
],
[
130,
132
],
[
127,
133
],
[
133,
134
],
[
133,
135
],
[
127,
136
],
[
136,
137
],
[
136,
138
],
[
120,
139
],
[
139,
140
],
[
118,
141
],
[
141,
142
],
[
118,
143
],
[
143,
144
],
[
261,
145
],
[
145,
146
],
[
145,
147
],
[
147,
148
],
[
145,
149
],
[
149,
150
],
[
145,
151
],
[
151,
152
],
[
145,
153
],
[
153,
154
],
[
153,
155
],
[
145,
156
],
[
156,
157
],
[
156,
158
],
[
158,
159
],
[
159,
160
],
[
159,
161
],
[
158,
163
],
[
163,
164
],
[
163,
165
],
[
158,
166
],
[
166,
167
],
[
166,
168
],
[
145,
169
],
[
169,
170
],
[
169,
171
],
[
171,
172
],
[
172,
173
],
[
173,
174
],
[
174,
175
],
[
172,
176
],
[
176,
177
],
[
177,
178
],
[
178,
179
],
[
145,
180
],
[
180,
181
],
[
180,
182
],
[
182,
183
],
[
183,
184
],
[
184,
185
],
[
184,
186
],
[
183,
187
],
[
187,
188
],
[
188,
189
],
[
145,
190
],
[
190,
191
],
[
190,
192
],
[
192,
193
],
[
193,
194
],
[
194,
195
],
[
194,
196
],
[
196,
197
],
[
196,
198
],
[
193,
199
],
[
199,
200
],
[
200,
201
],
[
200,
202
],
[
202,
203
],
[
192,
204
],
[
204,
205
],
[
204,
206
],
[
206,
207
],
[
207,
208
],
[
192,
209
],
[
209,
210
],
[
210,
211
],
[
210,
212
],
[
209,
213
],
[
213,
214
],
[
213,
215
],
[
215,
216
],
[
216,
217
],
[
192,
218
],
[
218,
219
],
[
218,
220
],
[
220,
221
],
[
221,
222
],
[
220,
223
],
[
220,
224
],
[
192,
225
],
[
225,
226
],
[
225,
227
],
[
192,
228
],
[
228,
229
],
[
229,
230
],
[
229,
231
],
[
231,
232
],
[
145,
233
],
[
233,
234
],
[
233,
235
],
[
235,
236
],
[
236,
237
],
[
237,
238
],
[
238,
239
],
[
237,
240
],
[
240,
241
],
[
145,
242
],
[
242,
243
],
[
242,
244
],
[
244,
245
],
[
245,
246
],
[
246,
247
],
[
247,
248
],
[
246,
249
],
[
249,
250
],
[
145,
251
],
[
251,
252
],
[
251,
253
],
[
253,
254
],
[
254,
255
],
[
255,
256
],
[
256,
257
],
[
255,
258
],
[
258,
259
],
[
0,
260
],
[
260,
261
],
[
260,
262
]
] |
[
"import java.io.BufferedReader;\nimport java.io.IOException;\nimport java.io.InputStreamReader;\nimport java.util.ArrayList;\nimport java.util.Collections;\nimport java.util.List;\n\npublic class Main {\n\n private static Scanner sc;\n\n public static void main(String[] args) {\n Main instance = new Main();\n sc = instance.new Scanner();\n instance.solve();\n }\n\n private void solve() {\n try {\n int K = sc.nextInt();\n\n int sum = 0;\n\n for(int a=1; a<K+1; a++) {\n for(int b=1; b<K+1; b++) {\n for(int c=1; c<K+1; c++) {\n\n sum+=gcd(gcd(a,b),c);\n\n }\n }\n }\n\n System.out.println(sum);\n\n } catch (Exception e) {\n e.printStackTrace();\n }\n }\n\n private int gcd(int m, int n) {\n int r;\n while (n > 0) {\n r = m % n;\n m = n;\n n = r;\n }\n return m;\n }\n\n private class Scanner {\n String[] s;\n int i;\n BufferedReader br;\n String regex = \" \";\n\n public Scanner() {\n s = new String[0];\n i = 0;\n br = new BufferedReader(new InputStreamReader(System.in));\n }\n\n @Override\n protected void finalize() throws Throwable {\n try {\n super.finalize();\n } finally {\n destruction();\n }\n }\n\n private void destruction() throws IOException {\n if (br != null) br.close();\n }\n\n public String next() throws IOException {\n if (i < s.length) return s[i++];\n String st = br.readLine();\n while (st == \"\") st = br.readLine();\n s = st.split(regex, 0);\n i = 0;\n return s[i++];\n }\n\n public int nextInt() throws NumberFormatException, IOException {\n return Integer.parseInt(next());\n }\n\n public Long nextLong() throws NumberFormatException, IOException {\n return Long.parseLong(next());\n }\n\n public Double nextDouble() throws NumberFormatException, IOException {\n return Double.parseDouble(next());\n }\n }\n}",
"import java.io.BufferedReader;",
"BufferedReader",
"java.io",
"import java.io.IOException;",
"IOException",
"java.io",
"import java.io.InputStreamReader;",
"InputStreamReader",
"java.io",
"import java.util.ArrayList;",
"ArrayList",
"java.util",
"import java.util.Collections;",
"Collections",
"java.util",
"import java.util.List;",
"List",
"java.util",
"public class Main {\n\n private static Scanner sc;\n\n public static void main(String[] args) {\n Main instance = new Main();\n sc = instance.new Scanner();\n instance.solve();\n }\n\n private void solve() {\n try {\n int K = sc.nextInt();\n\n int sum = 0;\n\n for(int a=1; a<K+1; a++) {\n for(int b=1; b<K+1; b++) {\n for(int c=1; c<K+1; c++) {\n\n sum+=gcd(gcd(a,b),c);\n\n }\n }\n }\n\n System.out.println(sum);\n\n } catch (Exception e) {\n e.printStackTrace();\n }\n }\n\n private int gcd(int m, int n) {\n int r;\n while (n > 0) {\n r = m % n;\n m = n;\n n = r;\n }\n return m;\n }\n\n private class Scanner {\n String[] s;\n int i;\n BufferedReader br;\n String regex = \" \";\n\n public Scanner() {\n s = new String[0];\n i = 0;\n br = new BufferedReader(new InputStreamReader(System.in));\n }\n\n @Override\n protected void finalize() throws Throwable {\n try {\n super.finalize();\n } finally {\n destruction();\n }\n }\n\n private void destruction() throws IOException {\n if (br != null) br.close();\n }\n\n public String next() throws IOException {\n if (i < s.length) return s[i++];\n String st = br.readLine();\n while (st == \"\") st = br.readLine();\n s = st.split(regex, 0);\n i = 0;\n return s[i++];\n }\n\n public int nextInt() throws NumberFormatException, IOException {\n return Integer.parseInt(next());\n }\n\n public Long nextLong() throws NumberFormatException, IOException {\n return Long.parseLong(next());\n }\n\n public Double nextDouble() throws NumberFormatException, IOException {\n return Double.parseDouble(next());\n }\n }\n}",
"Main",
"private static Scanner sc;",
"sc",
"public static void main(String[] args) {\n Main instance = new Main();\n sc = instance.new Scanner();\n instance.solve();\n }",
"main",
"{\n Main instance = new Main();\n sc = instance.new Scanner();\n instance.solve();\n }",
"Main instance = new Main();",
"instance",
"new Main()",
"sc = instance.new Scanner()",
"sc",
"instance.new Scanner()",
"instance",
"instance",
"instance.solve()",
"instance.solve",
"instance",
"String[] args",
"args",
"private void solve() {\n try {\n int K = sc.nextInt();\n\n int sum = 0;\n\n for(int a=1; a<K+1; a++) {\n for(int b=1; b<K+1; b++) {\n for(int c=1; c<K+1; c++) {\n\n sum+=gcd(gcd(a,b),c);\n\n }\n }\n }\n\n System.out.println(sum);\n\n } catch (Exception e) {\n e.printStackTrace();\n }\n }",
"solve",
"{\n try {\n int K = sc.nextInt();\n\n int sum = 0;\n\n for(int a=1; a<K+1; a++) {\n for(int b=1; b<K+1; b++) {\n for(int c=1; c<K+1; c++) {\n\n sum+=gcd(gcd(a,b),c);\n\n }\n }\n }\n\n System.out.println(sum);\n\n } catch (Exception e) {\n e.printStackTrace();\n }\n }",
"try {\n int K = sc.nextInt();\n\n int sum = 0;\n\n for(int a=1; a<K+1; a++) {\n for(int b=1; b<K+1; b++) {\n for(int c=1; c<K+1; c++) {\n\n sum+=gcd(gcd(a,b),c);\n\n }\n }\n }\n\n System.out.println(sum);\n\n } catch (Exception e) {\n e.printStackTrace();\n }",
"catch (Exception e) {\n e.printStackTrace();\n }",
"Exception e",
"{\n e.printStackTrace();\n }",
"e.printStackTrace()",
"e.printStackTrace",
"e",
"{\n int K = sc.nextInt();\n\n int sum = 0;\n\n for(int a=1; a<K+1; a++) {\n for(int b=1; b<K+1; b++) {\n for(int c=1; c<K+1; c++) {\n\n sum+=gcd(gcd(a,b),c);\n\n }\n }\n }\n\n System.out.println(sum);\n\n }",
"int K = sc.nextInt();",
"K",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int sum = 0;",
"sum",
"0",
"for(int a=1; a<K+1; a++) {\n for(int b=1; b<K+1; b++) {\n for(int c=1; c<K+1; c++) {\n\n sum+=gcd(gcd(a,b),c);\n\n }\n }\n }",
"int a=1;",
"int a=1;",
"a",
"1",
"a<K+1",
"a",
"K+1",
"K",
"1",
"a++",
"a++",
"a",
"{\n for(int b=1; b<K+1; b++) {\n for(int c=1; c<K+1; c++) {\n\n sum+=gcd(gcd(a,b),c);\n\n }\n }\n }",
"{\n for(int b=1; b<K+1; b++) {\n for(int c=1; c<K+1; c++) {\n\n sum+=gcd(gcd(a,b),c);\n\n }\n }\n }",
"for(int b=1; b<K+1; b++) {\n for(int c=1; c<K+1; c++) {\n\n sum+=gcd(gcd(a,b),c);\n\n }\n }",
"int b=1;",
"int b=1;",
"b",
"1",
"b<K+1",
"b",
"K+1",
"K",
"1",
"b++",
"b++",
"b",
"{\n for(int c=1; c<K+1; c++) {\n\n sum+=gcd(gcd(a,b),c);\n\n }\n }",
"{\n for(int c=1; c<K+1; c++) {\n\n sum+=gcd(gcd(a,b),c);\n\n }\n }",
"for(int c=1; c<K+1; c++) {\n\n sum+=gcd(gcd(a,b),c);\n\n }",
"int c=1;",
"int c=1;",
"c",
"1",
"c<K+1",
"c",
"K+1",
"K",
"1",
"c++",
"c++",
"c",
"{\n\n sum+=gcd(gcd(a,b),c);\n\n }",
"{\n\n sum+=gcd(gcd(a,b),c);\n\n }",
"sum+=gcd(gcd(a,b),c)",
"sum",
"gcd(gcd(a,b),c)",
"gcd",
"gcd(a,b)",
"gcd",
"a",
"b",
"c",
"System.out.println(sum)",
"System.out.println",
"System.out",
"System",
"System.out",
"sum",
"private int gcd(int m, int n) {\n int r;\n while (n > 0) {\n r = m % n;\n m = n;\n n = r;\n }\n return m;\n }",
"gcd",
"{\n int r;\n while (n > 0) {\n r = m % n;\n m = n;\n n = r;\n }\n return m;\n }",
"int r;",
"r",
"while (n > 0) {\n r = m % n;\n m = n;\n n = r;\n }",
"n > 0",
"n",
"0",
"{\n r = m % n;\n m = n;\n n = r;\n }",
"r = m % n",
"r",
"m % n",
"m",
"n",
"m = n",
"m",
"n",
"n = r",
"n",
"r",
"return m;",
"m",
"int m",
"m",
"int n",
"n",
"private class Scanner {\n String[] s;\n int i;\n BufferedReader br;\n String regex = \" \";\n\n public Scanner() {\n s = new String[0];\n i = 0;\n br = new BufferedReader(new InputStreamReader(System.in));\n }\n\n @Override\n protected void finalize() throws Throwable {\n try {\n super.finalize();\n } finally {\n destruction();\n }\n }\n\n private void destruction() throws IOException {\n if (br != null) br.close();\n }\n\n public String next() throws IOException {\n if (i < s.length) return s[i++];\n String st = br.readLine();\n while (st == \"\") st = br.readLine();\n s = st.split(regex, 0);\n i = 0;\n return s[i++];\n }\n\n public int nextInt() throws NumberFormatException, IOException {\n return Integer.parseInt(next());\n }\n\n public Long nextLong() throws NumberFormatException, IOException {\n return Long.parseLong(next());\n }\n\n public Double nextDouble() throws NumberFormatException, IOException {\n return Double.parseDouble(next());\n }\n }",
"Scanner",
"String[] s;",
"s",
"int i;",
"i",
"BufferedReader br;",
"br",
"String regex = \" \";",
"regex",
"\" \"",
"public Scanner() {\n s = new String[0];\n i = 0;\n br = new BufferedReader(new InputStreamReader(System.in));\n }",
"Scanner",
"{\n s = new String[0];\n i = 0;\n br = new BufferedReader(new InputStreamReader(System.in));\n }",
"s = new String[0]",
"s",
"new String[0]",
"0",
"i = 0",
"i",
"0",
"br = new BufferedReader(new InputStreamReader(System.in))",
"br",
"new BufferedReader(new InputStreamReader(System.in))",
"@Override\n protected void finalize() throws Throwable {\n try {\n super.finalize();\n } finally {\n destruction();\n }\n }",
"finalize",
"{\n try {\n super.finalize();\n } finally {\n destruction();\n }\n }",
"try {\n super.finalize();\n } finally {\n destruction();\n }",
"{\n destruction();\n }",
"destruction()",
"destruction",
"{\n super.finalize();\n }",
"super.finalize()",
"super.finalize",
"super",
"private void destruction() throws IOException {\n if (br != null) br.close();\n }",
"destruction",
"{\n if (br != null) br.close();\n }",
"if (br != null) br.close();",
"br != null",
"br",
"null",
"br.close()",
"br.close",
"br",
"public String next() throws IOException {\n if (i < s.length) return s[i++];\n String st = br.readLine();\n while (st == \"\") st = br.readLine();\n s = st.split(regex, 0);\n i = 0;\n return s[i++];\n }",
"next",
"{\n if (i < s.length) return s[i++];\n String st = br.readLine();\n while (st == \"\") st = br.readLine();\n s = st.split(regex, 0);\n i = 0;\n return s[i++];\n }",
"if (i < s.length) return s[i++];",
"i < s.length",
"i",
"s.length",
"s",
"s.length",
"return s[i++];",
"s[i++]",
"s",
"i++",
"i",
"String st = br.readLine();",
"st",
"br.readLine()",
"br.readLine",
"br",
"while (st == \"\") st = br.readLine();",
"st == \"\"",
"st",
"\"\"",
"st = br.readLine()",
"st",
"br.readLine()",
"br.readLine",
"br",
"s = st.split(regex, 0)",
"s",
"st.split(regex, 0)",
"st.split",
"st",
"regex",
"0",
"i = 0",
"i",
"0",
"return s[i++];",
"s[i++]",
"s",
"i++",
"i",
"public int nextInt() throws NumberFormatException, IOException {\n return Integer.parseInt(next());\n }",
"nextInt",
"{\n return Integer.parseInt(next());\n }",
"return Integer.parseInt(next());",
"Integer.parseInt(next())",
"Integer.parseInt",
"Integer",
"next()",
"next",
"public Long nextLong() throws NumberFormatException, IOException {\n return Long.parseLong(next());\n }",
"nextLong",
"{\n return Long.parseLong(next());\n }",
"return Long.parseLong(next());",
"Long.parseLong(next())",
"Long.parseLong",
"Long",
"next()",
"next",
"public Double nextDouble() throws NumberFormatException, IOException {\n return Double.parseDouble(next());\n }",
"nextDouble",
"{\n return Double.parseDouble(next());\n }",
"return Double.parseDouble(next());",
"Double.parseDouble(next())",
"Double.parseDouble",
"Double",
"next()",
"next",
"public class Main {\n\n private static Scanner sc;\n\n public static void main(String[] args) {\n Main instance = new Main();\n sc = instance.new Scanner();\n instance.solve();\n }\n\n private void solve() {\n try {\n int K = sc.nextInt();\n\n int sum = 0;\n\n for(int a=1; a<K+1; a++) {\n for(int b=1; b<K+1; b++) {\n for(int c=1; c<K+1; c++) {\n\n sum+=gcd(gcd(a,b),c);\n\n }\n }\n }\n\n System.out.println(sum);\n\n } catch (Exception e) {\n e.printStackTrace();\n }\n }\n\n private int gcd(int m, int n) {\n int r;\n while (n > 0) {\n r = m % n;\n m = n;\n n = r;\n }\n return m;\n }\n\n private class Scanner {\n String[] s;\n int i;\n BufferedReader br;\n String regex = \" \";\n\n public Scanner() {\n s = new String[0];\n i = 0;\n br = new BufferedReader(new InputStreamReader(System.in));\n }\n\n @Override\n protected void finalize() throws Throwable {\n try {\n super.finalize();\n } finally {\n destruction();\n }\n }\n\n private void destruction() throws IOException {\n if (br != null) br.close();\n }\n\n public String next() throws IOException {\n if (i < s.length) return s[i++];\n String st = br.readLine();\n while (st == \"\") st = br.readLine();\n s = st.split(regex, 0);\n i = 0;\n return s[i++];\n }\n\n public int nextInt() throws NumberFormatException, IOException {\n return Integer.parseInt(next());\n }\n\n public Long nextLong() throws NumberFormatException, IOException {\n return Long.parseLong(next());\n }\n\n public Double nextDouble() throws NumberFormatException, IOException {\n return Double.parseDouble(next());\n }\n }\n}",
"public class Main {\n\n private static Scanner sc;\n\n public static void main(String[] args) {\n Main instance = new Main();\n sc = instance.new Scanner();\n instance.solve();\n }\n\n private void solve() {\n try {\n int K = sc.nextInt();\n\n int sum = 0;\n\n for(int a=1; a<K+1; a++) {\n for(int b=1; b<K+1; b++) {\n for(int c=1; c<K+1; c++) {\n\n sum+=gcd(gcd(a,b),c);\n\n }\n }\n }\n\n System.out.println(sum);\n\n } catch (Exception e) {\n e.printStackTrace();\n }\n }\n\n private int gcd(int m, int n) {\n int r;\n while (n > 0) {\n r = m % n;\n m = n;\n n = r;\n }\n return m;\n }\n\n private class Scanner {\n String[] s;\n int i;\n BufferedReader br;\n String regex = \" \";\n\n public Scanner() {\n s = new String[0];\n i = 0;\n br = new BufferedReader(new InputStreamReader(System.in));\n }\n\n @Override\n protected void finalize() throws Throwable {\n try {\n super.finalize();\n } finally {\n destruction();\n }\n }\n\n private void destruction() throws IOException {\n if (br != null) br.close();\n }\n\n public String next() throws IOException {\n if (i < s.length) return s[i++];\n String st = br.readLine();\n while (st == \"\") st = br.readLine();\n s = st.split(regex, 0);\n i = 0;\n return s[i++];\n }\n\n public int nextInt() throws NumberFormatException, IOException {\n return Integer.parseInt(next());\n }\n\n public Long nextLong() throws NumberFormatException, IOException {\n return Long.parseLong(next());\n }\n\n public Double nextDouble() throws NumberFormatException, IOException {\n return Double.parseDouble(next());\n }\n }\n}",
"Main"
] |
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
public class Main {
private static Scanner sc;
public static void main(String[] args) {
Main instance = new Main();
sc = instance.new Scanner();
instance.solve();
}
private void solve() {
try {
int K = sc.nextInt();
int sum = 0;
for(int a=1; a<K+1; a++) {
for(int b=1; b<K+1; b++) {
for(int c=1; c<K+1; c++) {
sum+=gcd(gcd(a,b),c);
}
}
}
System.out.println(sum);
} catch (Exception e) {
e.printStackTrace();
}
}
private int gcd(int m, int n) {
int r;
while (n > 0) {
r = m % n;
m = n;
n = r;
}
return m;
}
private class Scanner {
String[] s;
int i;
BufferedReader br;
String regex = " ";
public Scanner() {
s = new String[0];
i = 0;
br = new BufferedReader(new InputStreamReader(System.in));
}
@Override
protected void finalize() throws Throwable {
try {
super.finalize();
} finally {
destruction();
}
}
private void destruction() throws IOException {
if (br != null) br.close();
}
public String next() throws IOException {
if (i < s.length) return s[i++];
String st = br.readLine();
while (st == "") st = br.readLine();
s = st.split(regex, 0);
i = 0;
return s[i++];
}
public int nextInt() throws NumberFormatException, IOException {
return Integer.parseInt(next());
}
public Long nextLong() throws NumberFormatException, IOException {
return Long.parseLong(next());
}
public Double nextDouble() throws NumberFormatException, IOException {
return Double.parseDouble(next());
}
}
}
|
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
2,
13,
17,
1,
40,
13,
30,
30,
11,
1,
41,
13,
17,
2,
13,
2,
13,
17,
1,
40,
13,
30,
30,
11,
1,
41,
13,
17,
2,
13,
2,
13,
17,
1,
40,
13,
30,
30,
0,
13,
4,
13,
4,
13,
13,
13,
13,
4,
18,
18,
13,
13,
13,
23,
13,
12,
13,
30,
14,
2,
13,
13,
29,
4,
13,
13,
13,
14,
2,
13,
17,
29,
13,
29,
4,
13,
13,
2,
13,
13,
23,
13,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
112,
5
],
[
112,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
8,
17
],
[
17,
18
],
[
17,
19
],
[
8,
20
],
[
20,
21
],
[
21,
22
],
[
22,
23
],
[
22,
24
],
[
20,
25
],
[
25,
26
],
[
25,
27
],
[
27,
28
],
[
27,
29
],
[
20,
30
],
[
30,
31
],
[
31,
32
],
[
20,
33
],
[
34,
34
],
[
34,
35
],
[
35,
36
],
[
36,
37
],
[
37,
38
],
[
37,
39
],
[
35,
40
],
[
40,
41
],
[
40,
42
],
[
42,
43
],
[
42,
44
],
[
35,
45
],
[
45,
46
],
[
46,
47
],
[
35,
48
],
[
49,
49
],
[
49,
50
],
[
50,
51
],
[
51,
52
],
[
52,
53
],
[
52,
54
],
[
50,
55
],
[
55,
56
],
[
55,
57
],
[
57,
58
],
[
57,
59
],
[
50,
60
],
[
60,
61
],
[
61,
62
],
[
50,
63
],
[
64,
64
],
[
64,
65
],
[
65,
66
],
[
65,
67
],
[
67,
68
],
[
67,
69
],
[
69,
70
],
[
69,
71
],
[
69,
72
],
[
67,
73
],
[
8,
74
],
[
74,
75
],
[
75,
76
],
[
76,
77
],
[
76,
78
],
[
74,
79
],
[
6,
80
],
[
80,
81
],
[
112,
82
],
[
82,
83
],
[
82,
84
],
[
84,
85
],
[
85,
86
],
[
86,
87
],
[
86,
88
],
[
85,
89
],
[
89,
90
],
[
90,
91
],
[
90,
92
],
[
90,
93
],
[
84,
94
],
[
94,
95
],
[
95,
96
],
[
95,
97
],
[
94,
98
],
[
98,
99
],
[
84,
100
],
[
100,
101
],
[
101,
102
],
[
101,
103
],
[
101,
104
],
[
104,
105
],
[
104,
106
],
[
82,
107
],
[
107,
108
],
[
82,
109
],
[
109,
110
],
[
0,
111
],
[
111,
112
],
[
111,
113
]
] |
[
"//package atcoder;\n \nimport java.util.*;\n \npublic class Main{\n\tpublic static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\tint K = sc.nextInt();\n\t\tlong sum = 0;\n\t\tfor(int a=1;a<K+1;a++) {\n\t\t\tfor(int b=1;b<K+1;b++) {\n\t\t\t\tfor(int c=1;c<K+1;c++) {\n\t\t\t\t\tsum += gcd(gcd(a,b),c);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(sum);\n\t\n\t}\n\tprivate static long gcd(long m,long n) {\n\t\tif(m<n) return gcd(n,m);\n\t\tif(n==0) return m;\n\t\treturn gcd(n,m%n);\n\t}\n\t\n}",
"import java.util.*;",
"util.*",
"java",
"public class Main{\n\tpublic static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\tint K = sc.nextInt();\n\t\tlong sum = 0;\n\t\tfor(int a=1;a<K+1;a++) {\n\t\t\tfor(int b=1;b<K+1;b++) {\n\t\t\t\tfor(int c=1;c<K+1;c++) {\n\t\t\t\t\tsum += gcd(gcd(a,b),c);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(sum);\n\t\n\t}\n\tprivate static long gcd(long m,long n) {\n\t\tif(m<n) return gcd(n,m);\n\t\tif(n==0) return m;\n\t\treturn gcd(n,m%n);\n\t}\n\t\n}",
"Main",
"public static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\tint K = sc.nextInt();\n\t\tlong sum = 0;\n\t\tfor(int a=1;a<K+1;a++) {\n\t\t\tfor(int b=1;b<K+1;b++) {\n\t\t\t\tfor(int c=1;c<K+1;c++) {\n\t\t\t\t\tsum += gcd(gcd(a,b),c);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(sum);\n\t\n\t}",
"main",
"{\n\t\tScanner sc = new Scanner(System.in);\n\t\tint K = sc.nextInt();\n\t\tlong sum = 0;\n\t\tfor(int a=1;a<K+1;a++) {\n\t\t\tfor(int b=1;b<K+1;b++) {\n\t\t\t\tfor(int c=1;c<K+1;c++) {\n\t\t\t\t\tsum += gcd(gcd(a,b),c);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(sum);\n\t\n\t}",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"int K = sc.nextInt();",
"K",
"sc.nextInt()",
"sc.nextInt",
"sc",
"long sum = 0;",
"sum",
"0",
"for(int a=1;a<K+1;a++) {\n\t\t\tfor(int b=1;b<K+1;b++) {\n\t\t\t\tfor(int c=1;c<K+1;c++) {\n\t\t\t\t\tsum += gcd(gcd(a,b),c);\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"int a=1;",
"int a=1;",
"a",
"1",
"a<K+1",
"a",
"K+1",
"K",
"1",
"a++",
"a++",
"a",
"{\n\t\t\tfor(int b=1;b<K+1;b++) {\n\t\t\t\tfor(int c=1;c<K+1;c++) {\n\t\t\t\t\tsum += gcd(gcd(a,b),c);\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"{\n\t\t\tfor(int b=1;b<K+1;b++) {\n\t\t\t\tfor(int c=1;c<K+1;c++) {\n\t\t\t\t\tsum += gcd(gcd(a,b),c);\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"for(int b=1;b<K+1;b++) {\n\t\t\t\tfor(int c=1;c<K+1;c++) {\n\t\t\t\t\tsum += gcd(gcd(a,b),c);\n\t\t\t\t}\n\t\t\t}",
"int b=1;",
"int b=1;",
"b",
"1",
"b<K+1",
"b",
"K+1",
"K",
"1",
"b++",
"b++",
"b",
"{\n\t\t\t\tfor(int c=1;c<K+1;c++) {\n\t\t\t\t\tsum += gcd(gcd(a,b),c);\n\t\t\t\t}\n\t\t\t}",
"{\n\t\t\t\tfor(int c=1;c<K+1;c++) {\n\t\t\t\t\tsum += gcd(gcd(a,b),c);\n\t\t\t\t}\n\t\t\t}",
"for(int c=1;c<K+1;c++) {\n\t\t\t\t\tsum += gcd(gcd(a,b),c);\n\t\t\t\t}",
"int c=1;",
"int c=1;",
"c",
"1",
"c<K+1",
"c",
"K+1",
"K",
"1",
"c++",
"c++",
"c",
"{\n\t\t\t\t\tsum += gcd(gcd(a,b),c);\n\t\t\t\t}",
"{\n\t\t\t\t\tsum += gcd(gcd(a,b),c);\n\t\t\t\t}",
"sum += gcd(gcd(a,b),c)",
"sum",
"gcd(gcd(a,b),c)",
"gcd",
"gcd(a,b)",
"gcd",
"a",
"b",
"c",
"System.out.println(sum)",
"System.out.println",
"System.out",
"System",
"System.out",
"sum",
"String[] args",
"args",
"private static long gcd(long m,long n) {\n\t\tif(m<n) return gcd(n,m);\n\t\tif(n==0) return m;\n\t\treturn gcd(n,m%n);\n\t}",
"gcd",
"{\n\t\tif(m<n) return gcd(n,m);\n\t\tif(n==0) return m;\n\t\treturn gcd(n,m%n);\n\t}",
"if(m<n) return gcd(n,m);",
"m<n",
"m",
"n",
"return gcd(n,m);",
"gcd(n,m)",
"gcd",
"n",
"m",
"if(n==0) return m;",
"n==0",
"n",
"0",
"return m;",
"m",
"return gcd(n,m%n);",
"gcd(n,m%n)",
"gcd",
"n",
"m%n",
"m",
"n",
"long m",
"m",
"long n",
"n",
"public class Main{\n\tpublic static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\tint K = sc.nextInt();\n\t\tlong sum = 0;\n\t\tfor(int a=1;a<K+1;a++) {\n\t\t\tfor(int b=1;b<K+1;b++) {\n\t\t\t\tfor(int c=1;c<K+1;c++) {\n\t\t\t\t\tsum += gcd(gcd(a,b),c);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(sum);\n\t\n\t}\n\tprivate static long gcd(long m,long n) {\n\t\tif(m<n) return gcd(n,m);\n\t\tif(n==0) return m;\n\t\treturn gcd(n,m%n);\n\t}\n\t\n}",
"public class Main{\n\tpublic static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\tint K = sc.nextInt();\n\t\tlong sum = 0;\n\t\tfor(int a=1;a<K+1;a++) {\n\t\t\tfor(int b=1;b<K+1;b++) {\n\t\t\t\tfor(int c=1;c<K+1;c++) {\n\t\t\t\t\tsum += gcd(gcd(a,b),c);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(sum);\n\t\n\t}\n\tprivate static long gcd(long m,long n) {\n\t\tif(m<n) return gcd(n,m);\n\t\tif(n==0) return m;\n\t\treturn gcd(n,m%n);\n\t}\n\t\n}",
"Main"
] |
//package atcoder;
import java.util.*;
public class Main{
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int K = sc.nextInt();
long sum = 0;
for(int a=1;a<K+1;a++) {
for(int b=1;b<K+1;b++) {
for(int c=1;c<K+1;c++) {
sum += gcd(gcd(a,b),c);
}
}
}
System.out.println(sum);
}
private static long gcd(long m,long n) {
if(m<n) return gcd(n,m);
if(n==0) return m;
return gcd(n,m%n);
}
}
|
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
41,
13,
4,
13,
4,
18,
13,
13,
13,
4,
18,
13,
13,
13,
41,
13,
4,
13,
4,
18,
13,
13,
13,
4,
18,
13,
13,
13,
0,
13,
13,
4,
18,
18,
13,
13,
13,
23,
13,
12,
13,
30,
41,
13,
2,
13,
13,
14,
2,
13,
17,
30,
29,
13,
30,
29,
4,
13,
13,
13,
23,
13,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
124,
5
],
[
124,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
8,
17
],
[
17,
18
],
[
17,
19
],
[
8,
20
],
[
20,
21
],
[
21,
22
],
[
22,
23
],
[
22,
24
],
[
20,
25
],
[
25,
26
],
[
25,
27
],
[
20,
28
],
[
28,
29
],
[
29,
30
],
[
20,
31
],
[
32,
32
],
[
32,
33
],
[
33,
34
],
[
34,
35
],
[
35,
36
],
[
35,
37
],
[
33,
38
],
[
38,
39
],
[
38,
40
],
[
33,
41
],
[
41,
42
],
[
42,
43
],
[
33,
44
],
[
45,
45
],
[
45,
46
],
[
46,
47
],
[
47,
48
],
[
48,
49
],
[
48,
50
],
[
46,
51
],
[
51,
52
],
[
51,
53
],
[
46,
54
],
[
54,
55
],
[
55,
56
],
[
46,
57
],
[
58,
58
],
[
58,
59
],
[
59,
60
],
[
59,
61
],
[
61,
62
],
[
61,
63
],
[
63,
64
],
[
64,
65
],
[
63,
66
],
[
63,
67
],
[
61,
68
],
[
68,
69
],
[
69,
70
],
[
68,
71
],
[
68,
72
],
[
58,
73
],
[
73,
74
],
[
73,
75
],
[
75,
76
],
[
75,
77
],
[
77,
78
],
[
78,
79
],
[
77,
80
],
[
77,
81
],
[
75,
82
],
[
82,
83
],
[
83,
84
],
[
82,
85
],
[
82,
86
],
[
58,
87
],
[
87,
88
],
[
87,
89
],
[
8,
90
],
[
90,
91
],
[
91,
92
],
[
92,
93
],
[
92,
94
],
[
90,
95
],
[
6,
96
],
[
96,
97
],
[
124,
98
],
[
98,
99
],
[
98,
100
],
[
100,
101
],
[
101,
102
],
[
101,
103
],
[
103,
104
],
[
103,
105
],
[
100,
106
],
[
106,
107
],
[
107,
108
],
[
107,
109
],
[
106,
110
],
[
110,
111
],
[
111,
112
],
[
106,
113
],
[
113,
114
],
[
114,
115
],
[
115,
116
],
[
115,
117
],
[
115,
118
],
[
98,
119
],
[
119,
120
],
[
98,
121
],
[
121,
122
],
[
0,
123
],
[
123,
124
],
[
123,
125
]
] |
[
"import java.util.Scanner;\n\npublic class Main {\n\n public static void main(String[] args) {\n\n Scanner scan = new Scanner(System.in);\n\n int k = scan.nextInt();\n long sum = 0;\n\n for (int i = 1; i <= k; i++) {\n for (int j = 1; j <= k; j++) {\n for (int l = 1; l <= k; l++) {\n int first = gcd(Math.max(i, j), Math.min(i, j));\n int res = gcd(Math.max(first, l), Math.min(first, l));\n sum += res;\n }\n }\n }\n\n System.out.println(sum);\n\n }\n\n private static int gcd(int a, int b) {\n int r = a % b;\n if (r == 0) {\n return b;\n } else {\n return gcd(b, r);\n }\n }\n\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n\n public static void main(String[] args) {\n\n Scanner scan = new Scanner(System.in);\n\n int k = scan.nextInt();\n long sum = 0;\n\n for (int i = 1; i <= k; i++) {\n for (int j = 1; j <= k; j++) {\n for (int l = 1; l <= k; l++) {\n int first = gcd(Math.max(i, j), Math.min(i, j));\n int res = gcd(Math.max(first, l), Math.min(first, l));\n sum += res;\n }\n }\n }\n\n System.out.println(sum);\n\n }\n\n private static int gcd(int a, int b) {\n int r = a % b;\n if (r == 0) {\n return b;\n } else {\n return gcd(b, r);\n }\n }\n\n}",
"Main",
"public static void main(String[] args) {\n\n Scanner scan = new Scanner(System.in);\n\n int k = scan.nextInt();\n long sum = 0;\n\n for (int i = 1; i <= k; i++) {\n for (int j = 1; j <= k; j++) {\n for (int l = 1; l <= k; l++) {\n int first = gcd(Math.max(i, j), Math.min(i, j));\n int res = gcd(Math.max(first, l), Math.min(first, l));\n sum += res;\n }\n }\n }\n\n System.out.println(sum);\n\n }",
"main",
"{\n\n Scanner scan = new Scanner(System.in);\n\n int k = scan.nextInt();\n long sum = 0;\n\n for (int i = 1; i <= k; i++) {\n for (int j = 1; j <= k; j++) {\n for (int l = 1; l <= k; l++) {\n int first = gcd(Math.max(i, j), Math.min(i, j));\n int res = gcd(Math.max(first, l), Math.min(first, l));\n sum += res;\n }\n }\n }\n\n System.out.println(sum);\n\n }",
"Scanner scan = new Scanner(System.in);",
"scan",
"new Scanner(System.in)",
"int k = scan.nextInt();",
"k",
"scan.nextInt()",
"scan.nextInt",
"scan",
"long sum = 0;",
"sum",
"0",
"for (int i = 1; i <= k; i++) {\n for (int j = 1; j <= k; j++) {\n for (int l = 1; l <= k; l++) {\n int first = gcd(Math.max(i, j), Math.min(i, j));\n int res = gcd(Math.max(first, l), Math.min(first, l));\n sum += res;\n }\n }\n }",
"int i = 1;",
"int i = 1;",
"i",
"1",
"i <= k",
"i",
"k",
"i++",
"i++",
"i",
"{\n for (int j = 1; j <= k; j++) {\n for (int l = 1; l <= k; l++) {\n int first = gcd(Math.max(i, j), Math.min(i, j));\n int res = gcd(Math.max(first, l), Math.min(first, l));\n sum += res;\n }\n }\n }",
"{\n for (int j = 1; j <= k; j++) {\n for (int l = 1; l <= k; l++) {\n int first = gcd(Math.max(i, j), Math.min(i, j));\n int res = gcd(Math.max(first, l), Math.min(first, l));\n sum += res;\n }\n }\n }",
"for (int j = 1; j <= k; j++) {\n for (int l = 1; l <= k; l++) {\n int first = gcd(Math.max(i, j), Math.min(i, j));\n int res = gcd(Math.max(first, l), Math.min(first, l));\n sum += res;\n }\n }",
"int j = 1;",
"int j = 1;",
"j",
"1",
"j <= k",
"j",
"k",
"j++",
"j++",
"j",
"{\n for (int l = 1; l <= k; l++) {\n int first = gcd(Math.max(i, j), Math.min(i, j));\n int res = gcd(Math.max(first, l), Math.min(first, l));\n sum += res;\n }\n }",
"{\n for (int l = 1; l <= k; l++) {\n int first = gcd(Math.max(i, j), Math.min(i, j));\n int res = gcd(Math.max(first, l), Math.min(first, l));\n sum += res;\n }\n }",
"for (int l = 1; l <= k; l++) {\n int first = gcd(Math.max(i, j), Math.min(i, j));\n int res = gcd(Math.max(first, l), Math.min(first, l));\n sum += res;\n }",
"int l = 1;",
"int l = 1;",
"l",
"1",
"l <= k",
"l",
"k",
"l++",
"l++",
"l",
"{\n int first = gcd(Math.max(i, j), Math.min(i, j));\n int res = gcd(Math.max(first, l), Math.min(first, l));\n sum += res;\n }",
"{\n int first = gcd(Math.max(i, j), Math.min(i, j));\n int res = gcd(Math.max(first, l), Math.min(first, l));\n sum += res;\n }",
"int first = gcd(Math.max(i, j), Math.min(i, j));",
"first",
"gcd(Math.max(i, j), Math.min(i, j))",
"gcd",
"Math.max(i, j)",
"Math.max",
"Math",
"i",
"j",
"Math.min(i, j)",
"Math.min",
"Math",
"i",
"j",
"int res = gcd(Math.max(first, l), Math.min(first, l));",
"res",
"gcd(Math.max(first, l), Math.min(first, l))",
"gcd",
"Math.max(first, l)",
"Math.max",
"Math",
"first",
"l",
"Math.min(first, l)",
"Math.min",
"Math",
"first",
"l",
"sum += res",
"sum",
"res",
"System.out.println(sum)",
"System.out.println",
"System.out",
"System",
"System.out",
"sum",
"String[] args",
"args",
"private static int gcd(int a, int b) {\n int r = a % b;\n if (r == 0) {\n return b;\n } else {\n return gcd(b, r);\n }\n }",
"gcd",
"{\n int r = a % b;\n if (r == 0) {\n return b;\n } else {\n return gcd(b, r);\n }\n }",
"int r = a % b;",
"r",
"a % b",
"a",
"b",
"if (r == 0) {\n return b;\n } else {\n return gcd(b, r);\n }",
"r == 0",
"r",
"0",
"{\n return b;\n }",
"return b;",
"b",
"{\n return gcd(b, r);\n }",
"return gcd(b, r);",
"gcd(b, r)",
"gcd",
"b",
"r",
"int a",
"a",
"int b",
"b",
"public class Main {\n\n public static void main(String[] args) {\n\n Scanner scan = new Scanner(System.in);\n\n int k = scan.nextInt();\n long sum = 0;\n\n for (int i = 1; i <= k; i++) {\n for (int j = 1; j <= k; j++) {\n for (int l = 1; l <= k; l++) {\n int first = gcd(Math.max(i, j), Math.min(i, j));\n int res = gcd(Math.max(first, l), Math.min(first, l));\n sum += res;\n }\n }\n }\n\n System.out.println(sum);\n\n }\n\n private static int gcd(int a, int b) {\n int r = a % b;\n if (r == 0) {\n return b;\n } else {\n return gcd(b, r);\n }\n }\n\n}",
"public class Main {\n\n public static void main(String[] args) {\n\n Scanner scan = new Scanner(System.in);\n\n int k = scan.nextInt();\n long sum = 0;\n\n for (int i = 1; i <= k; i++) {\n for (int j = 1; j <= k; j++) {\n for (int l = 1; l <= k; l++) {\n int first = gcd(Math.max(i, j), Math.min(i, j));\n int res = gcd(Math.max(first, l), Math.min(first, l));\n sum += res;\n }\n }\n }\n\n System.out.println(sum);\n\n }\n\n private static int gcd(int a, int b) {\n int r = a % b;\n if (r == 0) {\n return b;\n } else {\n return gcd(b, r);\n }\n }\n\n}",
"Main"
] |
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
int k = scan.nextInt();
long sum = 0;
for (int i = 1; i <= k; i++) {
for (int j = 1; j <= k; j++) {
for (int l = 1; l <= k; l++) {
int first = gcd(Math.max(i, j), Math.min(i, j));
int res = gcd(Math.max(first, l), Math.min(first, l));
sum += res;
}
}
}
System.out.println(sum);
}
private static int gcd(int a, int b) {
int r = a % b;
if (r == 0) {
return b;
} else {
return gcd(b, r);
}
}
}
|
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
38,
30,
41,
13,
20,
4,
13,
13,
23,
13,
12,
13,
30,
41,
13,
4,
18,
13,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
4,
18,
13,
13,
13,
13,
4,
18,
13,
13,
23,
13,
6,
13,
12,
13,
30,
41,
13,
42,
2,
13,
17,
30,
0,
13,
13,
0,
13,
13,
0,
13,
2,
13,
13,
29,
13,
23,
13,
23,
13,
12,
13,
30,
29,
4,
13,
4,
13,
13,
13,
13,
23,
13,
23,
13,
23,
13,
12,
13,
30,
29,
8,
2,
13,
13,
13,
13,
23,
13,
23,
13,
12,
13,
30,
29,
4,
13,
4,
13,
13,
13,
4,
13,
13,
13,
23,
13,
23,
13,
23,
13,
6,
13,
41,
13,
41,
13,
41,
13,
2,
17,
17,
41,
13,
20,
13,
41,
13,
17,
41,
13,
17,
41,
13,
20,
41,
13,
4,
18,
4,
18,
13,
12,
13,
30,
0,
18,
36,
13,
13,
0,
18,
36,
13,
20,
23,
13,
23,
13,
12,
13,
30,
4,
18,
13,
4,
18,
13,
12,
13,
30,
14,
2,
13,
13,
30,
0,
13,
17,
0,
13,
4,
18,
13,
13,
14,
2,
13,
17,
29,
40,
17,
29,
18,
13,
40,
13,
12,
13,
30,
41,
13,
11,
1,
0,
13,
4,
13,
2,
13,
17,
1,
0,
13,
4,
13,
30,
41,
13,
20,
11,
1,
2,
13,
17,
1,
0,
13,
4,
13,
30,
4,
18,
13,
13,
29,
4,
18,
13,
12,
13,
30,
41,
13,
41,
13,
17,
11,
1,
0,
13,
4,
13,
2,
13,
17,
1,
0,
13,
4,
13,
30,
41,
13,
2,
13,
17,
14,
2,
2,
13,
17,
2,
13,
17,
0,
13,
4,
13,
11,
1,
2,
2,
13,
17,
2,
13,
17,
1,
0,
13,
4,
13,
30,
0,
13,
2,
2,
2,
13,
17,
2,
13,
17,
2,
13,
17,
29,
8,
13,
40,
13,
13,
12,
13,
30,
41,
13,
20,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
18,
13,
13,
4,
13,
29,
13,
23,
13,
12,
13,
30,
41,
13,
41,
13,
17,
11,
1,
0,
13,
4,
13,
2,
13,
17,
1,
0,
13,
4,
13,
30,
41,
13,
2,
13,
17,
14,
2,
2,
13,
17,
2,
13,
17,
0,
13,
4,
13,
11,
1,
2,
2,
13,
17,
2,
13,
17,
1,
0,
13,
4,
13,
30,
0,
13,
2,
2,
2,
13,
17,
2,
13,
17,
2,
13,
17,
29,
8,
13,
40,
13,
13,
12,
13,
30,
41,
13,
20,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
18,
13,
13,
4,
13,
29,
13,
23,
13,
12,
13,
30,
4,
18,
13,
4,
18,
4,
18,
13,
23,
13,
12,
13,
30,
4,
18,
13,
4,
18,
4,
18,
13,
4,
18,
13,
13,
23,
13,
12,
13,
30,
4,
18,
13,
13,
12,
13,
30,
4,
18,
13,
4,
18,
4,
18,
13,
4,
18,
13,
13,
23,
13,
12,
13,
30,
4,
18,
13,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
10,
11
],
[
10,
12
],
[
0,
13
],
[
570,
14
],
[
570,
15
],
[
15,
16
],
[
15,
17
],
[
17,
18
],
[
18,
19
],
[
19,
20
],
[
20,
21
],
[
20,
22
],
[
19,
23
],
[
23,
24
],
[
23,
25
],
[
15,
26
],
[
26,
27
],
[
570,
28
],
[
28,
29
],
[
28,
30
],
[
30,
31
],
[
31,
32
],
[
31,
33
],
[
33,
34
],
[
34,
35
],
[
30,
36
],
[
36,
37
],
[
36,
38
],
[
30,
39
],
[
39,
40
],
[
40,
41
],
[
41,
42
],
[
41,
43
],
[
39,
44
],
[
44,
45
],
[
44,
46
],
[
39,
47
],
[
47,
48
],
[
48,
49
],
[
39,
50
],
[
51,
51
],
[
51,
52
],
[
52,
53
],
[
53,
54
],
[
54,
55
],
[
54,
56
],
[
52,
57
],
[
57,
58
],
[
57,
59
],
[
52,
60
],
[
60,
61
],
[
61,
62
],
[
52,
63
],
[
64,
64
],
[
64,
65
],
[
65,
66
],
[
66,
67
],
[
67,
68
],
[
67,
69
],
[
65,
70
],
[
70,
71
],
[
70,
72
],
[
65,
73
],
[
73,
74
],
[
74,
75
],
[
65,
76
],
[
77,
77
],
[
77,
78
],
[
78,
79
],
[
78,
80
],
[
80,
81
],
[
81,
82
],
[
80,
83
],
[
80,
84
],
[
80,
85
],
[
30,
86
],
[
86,
87
],
[
87,
88
],
[
86,
89
],
[
28,
90
],
[
90,
91
],
[
570,
92
],
[
92,
93
],
[
92,
94
],
[
94,
95
],
[
94,
96
],
[
96,
97
],
[
97,
98
],
[
96,
99
],
[
99,
100
],
[
100,
101
],
[
100,
102
],
[
99,
103
],
[
103,
104
],
[
104,
105
],
[
104,
106
],
[
103,
107
],
[
107,
108
],
[
107,
109
],
[
103,
110
],
[
110,
111
],
[
110,
112
],
[
112,
113
],
[
112,
114
],
[
96,
115
],
[
115,
116
],
[
94,
117
],
[
117,
118
],
[
94,
119
],
[
119,
120
],
[
92,
121
],
[
121,
122
],
[
121,
123
],
[
123,
124
],
[
124,
125
],
[
125,
126
],
[
125,
127
],
[
127,
128
],
[
127,
129
],
[
127,
130
],
[
125,
131
],
[
121,
132
],
[
132,
133
],
[
121,
134
],
[
134,
135
],
[
121,
136
],
[
136,
137
],
[
92,
138
],
[
138,
139
],
[
138,
140
],
[
140,
141
],
[
141,
142
],
[
142,
143
],
[
143,
144
],
[
143,
145
],
[
142,
146
],
[
142,
147
],
[
138,
148
],
[
148,
149
],
[
138,
150
],
[
150,
151
],
[
92,
152
],
[
152,
153
],
[
152,
154
],
[
154,
155
],
[
155,
156
],
[
156,
157
],
[
156,
158
],
[
158,
159
],
[
158,
160
],
[
158,
161
],
[
156,
162
],
[
162,
163
],
[
162,
164
],
[
162,
165
],
[
152,
166
],
[
166,
167
],
[
152,
168
],
[
168,
169
],
[
152,
170
],
[
170,
171
],
[
570,
172
],
[
172,
173
],
[
172,
174
],
[
174,
175
],
[
172,
176
],
[
176,
177
],
[
172,
178
],
[
178,
179
],
[
178,
180
],
[
180,
181
],
[
180,
182
],
[
172,
183
],
[
183,
184
],
[
183,
185
],
[
172,
187
],
[
187,
188
],
[
187,
189
],
[
172,
190
],
[
190,
191
],
[
190,
192
],
[
172,
193
],
[
193,
194
],
[
193,
195
],
[
172,
196
],
[
196,
197
],
[
196,
198
],
[
198,
199
],
[
199,
200
],
[
200,
201
],
[
201,
202
],
[
172,
203
],
[
203,
204
],
[
203,
205
],
[
205,
206
],
[
206,
207
],
[
207,
208
],
[
207,
209
],
[
206,
210
],
[
205,
211
],
[
211,
212
],
[
212,
213
],
[
212,
214
],
[
211,
215
],
[
203,
216
],
[
216,
217
],
[
203,
218
],
[
218,
219
],
[
172,
220
],
[
220,
221
],
[
220,
222
],
[
222,
223
],
[
223,
224
],
[
224,
225
],
[
222,
226
],
[
226,
227
],
[
227,
228
],
[
172,
229
],
[
229,
230
],
[
229,
231
],
[
231,
232
],
[
232,
233
],
[
233,
234
],
[
233,
235
],
[
232,
236
],
[
236,
237
],
[
237,
238
],
[
237,
239
],
[
236,
240
],
[
240,
241
],
[
240,
242
],
[
242,
243
],
[
243,
244
],
[
242,
245
],
[
236,
246
],
[
246,
247
],
[
247,
248
],
[
247,
249
],
[
246,
250
],
[
250,
251
],
[
251,
252
],
[
231,
253
],
[
253,
254
],
[
254,
255
],
[
254,
256
],
[
256,
257
],
[
172,
258
],
[
258,
259
],
[
258,
260
],
[
260,
261
],
[
261,
262
],
[
260,
263
],
[
263,
264
],
[
264,
265
],
[
265,
266
],
[
265,
267
],
[
267,
268
],
[
263,
269
],
[
269,
270
],
[
269,
271
],
[
263,
272
],
[
272,
273
],
[
273,
274
],
[
273,
275
],
[
275,
276
],
[
263,
277
],
[
260,
278
],
[
278,
279
],
[
278,
280
],
[
260,
281
],
[
281,
282
],
[
281,
283
],
[
283,
284
],
[
283,
285
],
[
281,
286
],
[
286,
287
],
[
287,
288
],
[
287,
289
],
[
289,
290
],
[
281,
291
],
[
291,
292
],
[
292,
293
],
[
293,
294
],
[
292,
295
],
[
260,
296
],
[
296,
297
],
[
297,
298
],
[
298,
299
],
[
172,
300
],
[
300,
301
],
[
300,
302
],
[
302,
303
],
[
303,
304
],
[
302,
305
],
[
305,
306
],
[
305,
307
],
[
302,
308
],
[
308,
309
],
[
309,
310
],
[
310,
311
],
[
310,
312
],
[
312,
313
],
[
308,
314
],
[
314,
315
],
[
314,
316
],
[
308,
317
],
[
317,
318
],
[
318,
319
],
[
318,
320
],
[
320,
321
],
[
308,
322
],
[
302,
323
],
[
323,
324
],
[
323,
325
],
[
325,
326
],
[
325,
327
],
[
302,
328
],
[
328,
329
],
[
329,
330
],
[
330,
331
],
[
330,
332
],
[
329,
333
],
[
333,
334
],
[
333,
335
],
[
328,
336
],
[
336,
337
],
[
336,
338
],
[
338,
339
],
[
302,
340
],
[
340,
341
],
[
340,
342
],
[
342,
343
],
[
343,
344
],
[
343,
345
],
[
342,
346
],
[
346,
347
],
[
346,
348
],
[
340,
349
],
[
349,
350
],
[
350,
351
],
[
350,
352
],
[
352,
353
],
[
340,
354
],
[
354,
355
],
[
355,
356
],
[
355,
357
],
[
358,
358
],
[
358,
359
],
[
359,
360
],
[
359,
361
],
[
358,
362
],
[
362,
363
],
[
362,
364
],
[
358,
365
],
[
365,
366
],
[
365,
367
],
[
302,
368
],
[
368,
369
],
[
369,
370
],
[
369,
371
],
[
371,
372
],
[
369,
373
],
[
172,
374
],
[
374,
375
],
[
374,
376
],
[
376,
377
],
[
377,
378
],
[
377,
379
],
[
376,
381
],
[
381,
382
],
[
382,
383
],
[
383,
384
],
[
383,
385
],
[
381,
386
],
[
386,
387
],
[
386,
388
],
[
381,
389
],
[
389,
390
],
[
390,
391
],
[
381,
392
],
[
393,
393
],
[
393,
394
],
[
394,
395
],
[
395,
396
],
[
395,
397
],
[
394,
398
],
[
398,
399
],
[
376,
400
],
[
400,
401
],
[
374,
402
],
[
402,
403
],
[
172,
404
],
[
404,
405
],
[
404,
406
],
[
406,
407
],
[
407,
408
],
[
406,
409
],
[
409,
410
],
[
409,
411
],
[
406,
412
],
[
412,
413
],
[
413,
414
],
[
414,
415
],
[
414,
416
],
[
416,
417
],
[
412,
418
],
[
418,
419
],
[
418,
420
],
[
412,
421
],
[
421,
422
],
[
422,
423
],
[
422,
424
],
[
424,
425
],
[
412,
426
],
[
406,
427
],
[
427,
428
],
[
427,
429
],
[
429,
430
],
[
429,
431
],
[
406,
432
],
[
432,
433
],
[
433,
434
],
[
434,
435
],
[
434,
436
],
[
433,
437
],
[
437,
438
],
[
437,
439
],
[
432,
440
],
[
440,
441
],
[
440,
442
],
[
442,
443
],
[
406,
444
],
[
444,
445
],
[
444,
446
],
[
446,
447
],
[
447,
448
],
[
447,
449
],
[
446,
450
],
[
450,
451
],
[
450,
452
],
[
444,
453
],
[
453,
454
],
[
454,
455
],
[
454,
456
],
[
456,
457
],
[
444,
458
],
[
458,
459
],
[
459,
460
],
[
459,
461
],
[
462,
462
],
[
462,
463
],
[
463,
464
],
[
463,
465
],
[
462,
466
],
[
466,
467
],
[
466,
468
],
[
462,
469
],
[
469,
470
],
[
469,
471
],
[
406,
472
],
[
472,
473
],
[
473,
474
],
[
473,
475
],
[
475,
476
],
[
473,
477
],
[
172,
478
],
[
478,
479
],
[
478,
480
],
[
480,
481
],
[
481,
482
],
[
481,
483
],
[
480,
485
],
[
485,
486
],
[
486,
487
],
[
487,
488
],
[
487,
489
],
[
485,
490
],
[
490,
491
],
[
490,
492
],
[
485,
493
],
[
493,
494
],
[
494,
495
],
[
485,
496
],
[
497,
497
],
[
497,
498
],
[
498,
499
],
[
499,
500
],
[
499,
501
],
[
498,
502
],
[
502,
503
],
[
480,
504
],
[
504,
505
],
[
478,
506
],
[
506,
507
],
[
172,
508
],
[
508,
509
],
[
508,
510
],
[
510,
511
],
[
511,
512
],
[
512,
513
],
[
511,
514
],
[
514,
515
],
[
515,
516
],
[
516,
517
],
[
517,
518
],
[
508,
519
],
[
519,
520
],
[
172,
521
],
[
521,
522
],
[
521,
523
],
[
523,
524
],
[
524,
525
],
[
525,
526
],
[
524,
527
],
[
527,
528
],
[
528,
529
],
[
529,
530
],
[
530,
531
],
[
523,
532
],
[
532,
533
],
[
533,
534
],
[
532,
535
],
[
521,
536
],
[
536,
537
],
[
172,
538
],
[
538,
539
],
[
538,
540
],
[
540,
541
],
[
541,
542
],
[
542,
543
],
[
541,
544
],
[
172,
545
],
[
545,
546
],
[
545,
547
],
[
547,
548
],
[
548,
549
],
[
549,
550
],
[
548,
551
],
[
551,
552
],
[
552,
553
],
[
553,
554
],
[
554,
555
],
[
547,
556
],
[
556,
557
],
[
557,
558
],
[
556,
559
],
[
545,
560
],
[
560,
561
],
[
172,
562
],
[
562,
563
],
[
562,
564
],
[
564,
565
],
[
565,
566
],
[
566,
567
],
[
172,
568
],
[
0,
569
],
[
569,
570
],
[
569,
571
]
] |
[
"import java.io.BufferedOutputStream;\nimport java.io.IOException;\nimport java.io.InputStream;\nimport java.io.PrintStream;\n\npublic final class Main {\n public static void main(final String[] args) throws Exception {\n try (IO io = new IO(System.in, System.out)) {\n execute(io);\n }\n }\n\n private static void execute(final IO io) throws Exception {\n final int n = io.nextInt();\n int result = 0;\n for (int i = 1; i <= n; i++) {\n for (int j = 1; j <= n; j++) {\n for (int k = 1; k <= n; k++) {\n result += M.gcd(i, j, k);\n }\n }\n }\n io.println(result);\n }\n\n public static final class M {\n public static int gcd(int a, int b) {\n int tmp;\n while (b != 0) {\n tmp = a;\n a = b;\n b = tmp % b;\n }\n return a;\n }\n\n public static int gcd(final int a, final int b, final int c) {\n return gcd(gcd(a, b), c);\n }\n\n public static int min(final int a, final int b) {\n return a > b ? b : a;\n }\n\n public static int min(final int a, final int b, final int c) {\n return min(min(a, b), min(b, c));\n }\n }\n\n public static final class IO implements AutoCloseable {\n private final InputStream in;\n private final BufferedOutputStream out;\n private static final int BUFSIZE = 1 << 20;\n private final byte[] buf = new byte[BUFSIZE];\n private int index = 0;\n private int total = 0;\n public IO(final InputStream in, final PrintStream out) throws IOException {\n this.in = in;\n this.out = new BufferedOutputStream(out);\n }\n\n @Override\n public void close() throws IOException {\n in.close();\n out.close();\n }\n\n private int scan() throws IOException {\n if (index >= total) {\n index = 0;\n total = in.read(buf);\n if (total <= 0)\n return -1;\n }\n return buf[index++];\n }\n\n public String next() throws IOException {\n int c;\n for (c = scan(); c <= 32; c = scan());\n StringBuilder sb = new StringBuilder();\n for (; c > 32; c = scan())\n sb.append((char) c);\n return sb.toString();\n }\n\n public int nextInt() throws IOException {\n int c, val = 0;\n for (c = scan(); c <= 32; c = scan());\n boolean neg = c == '-';\n if (c == '-' || c == '+')\n c = scan();\n for (; c >= '0' && c <= '9'; c = scan())\n val = (val << 3) + (val << 1) + (c & 15);\n return neg ? -val : val;\n }\n\n public int[] nextInt(final int n) throws IOException {\n final int[] result = new int[n];\n for (int i = 0; i < n; i++) {\n result[i] = nextInt();\n }\n return result;\n }\n\n public long nextLong() throws IOException {\n int c;\n long val = 0;\n for (c = scan(); c <= 32; c = scan());\n boolean neg = c == '-';\n if (c == '-' || c == '+')\n c = scan();\n for (; c >= '0' && c <= '9'; c = scan())\n val = (val << 3) + (val << 1) + (c & 15);\n return neg ? -val : val;\n }\n\n public long[] nextLong(final int n) throws IOException {\n final long[] result = new long[n];\n for (int i = 0; i < n; i++) {\n result[i] = nextLong();\n }\n return result;\n }\n\n public void print(final Object a) throws IOException {\n out.write(a.toString().getBytes());\n }\n\n private static final byte[] SP = new byte[] { 0x20 };\n public void printsp(final Object a) throws IOException {\n out.write(a.toString().getBytes());\n out.write(SP);\n }\n\n private static final byte[] CRLF = System.lineSeparator().getBytes();\n public void println() throws IOException {\n out.write(CRLF);\n }\n\n public void println(final Object a) throws IOException {\n out.write(a.toString().getBytes());\n out.write(CRLF);\n }\n\n public void flush() throws IOException {\n out.flush();\n }\n }\n}",
"import java.io.BufferedOutputStream;",
"BufferedOutputStream",
"java.io",
"import java.io.IOException;",
"IOException",
"java.io",
"import java.io.InputStream;",
"InputStream",
"java.io",
"import java.io.PrintStream;",
"PrintStream",
"java.io",
"public final class Main {\n public static void main(final String[] args) throws Exception {\n try (IO io = new IO(System.in, System.out)) {\n execute(io);\n }\n }\n\n private static void execute(final IO io) throws Exception {\n final int n = io.nextInt();\n int result = 0;\n for (int i = 1; i <= n; i++) {\n for (int j = 1; j <= n; j++) {\n for (int k = 1; k <= n; k++) {\n result += M.gcd(i, j, k);\n }\n }\n }\n io.println(result);\n }\n\n public static final class M {\n public static int gcd(int a, int b) {\n int tmp;\n while (b != 0) {\n tmp = a;\n a = b;\n b = tmp % b;\n }\n return a;\n }\n\n public static int gcd(final int a, final int b, final int c) {\n return gcd(gcd(a, b), c);\n }\n\n public static int min(final int a, final int b) {\n return a > b ? b : a;\n }\n\n public static int min(final int a, final int b, final int c) {\n return min(min(a, b), min(b, c));\n }\n }\n\n public static final class IO implements AutoCloseable {\n private final InputStream in;\n private final BufferedOutputStream out;\n private static final int BUFSIZE = 1 << 20;\n private final byte[] buf = new byte[BUFSIZE];\n private int index = 0;\n private int total = 0;\n public IO(final InputStream in, final PrintStream out) throws IOException {\n this.in = in;\n this.out = new BufferedOutputStream(out);\n }\n\n @Override\n public void close() throws IOException {\n in.close();\n out.close();\n }\n\n private int scan() throws IOException {\n if (index >= total) {\n index = 0;\n total = in.read(buf);\n if (total <= 0)\n return -1;\n }\n return buf[index++];\n }\n\n public String next() throws IOException {\n int c;\n for (c = scan(); c <= 32; c = scan());\n StringBuilder sb = new StringBuilder();\n for (; c > 32; c = scan())\n sb.append((char) c);\n return sb.toString();\n }\n\n public int nextInt() throws IOException {\n int c, val = 0;\n for (c = scan(); c <= 32; c = scan());\n boolean neg = c == '-';\n if (c == '-' || c == '+')\n c = scan();\n for (; c >= '0' && c <= '9'; c = scan())\n val = (val << 3) + (val << 1) + (c & 15);\n return neg ? -val : val;\n }\n\n public int[] nextInt(final int n) throws IOException {\n final int[] result = new int[n];\n for (int i = 0; i < n; i++) {\n result[i] = nextInt();\n }\n return result;\n }\n\n public long nextLong() throws IOException {\n int c;\n long val = 0;\n for (c = scan(); c <= 32; c = scan());\n boolean neg = c == '-';\n if (c == '-' || c == '+')\n c = scan();\n for (; c >= '0' && c <= '9'; c = scan())\n val = (val << 3) + (val << 1) + (c & 15);\n return neg ? -val : val;\n }\n\n public long[] nextLong(final int n) throws IOException {\n final long[] result = new long[n];\n for (int i = 0; i < n; i++) {\n result[i] = nextLong();\n }\n return result;\n }\n\n public void print(final Object a) throws IOException {\n out.write(a.toString().getBytes());\n }\n\n private static final byte[] SP = new byte[] { 0x20 };\n public void printsp(final Object a) throws IOException {\n out.write(a.toString().getBytes());\n out.write(SP);\n }\n\n private static final byte[] CRLF = System.lineSeparator().getBytes();\n public void println() throws IOException {\n out.write(CRLF);\n }\n\n public void println(final Object a) throws IOException {\n out.write(a.toString().getBytes());\n out.write(CRLF);\n }\n\n public void flush() throws IOException {\n out.flush();\n }\n }\n}",
"Main",
"public static void main(final String[] args) throws Exception {\n try (IO io = new IO(System.in, System.out)) {\n execute(io);\n }\n }",
"main",
"{\n try (IO io = new IO(System.in, System.out)) {\n execute(io);\n }\n }",
"try (IO io = new IO(System.in, System.out)) {\n execute(io);\n }",
"{\n execute(io);\n }",
"IO io = new IO(System.in, System.out)",
"IO io = new IO(System.in, System.out)",
"new IO(System.in, System.out)",
"execute(io)",
"execute",
"io",
"final String[] args",
"args",
"private static void execute(final IO io) throws Exception {\n final int n = io.nextInt();\n int result = 0;\n for (int i = 1; i <= n; i++) {\n for (int j = 1; j <= n; j++) {\n for (int k = 1; k <= n; k++) {\n result += M.gcd(i, j, k);\n }\n }\n }\n io.println(result);\n }",
"execute",
"{\n final int n = io.nextInt();\n int result = 0;\n for (int i = 1; i <= n; i++) {\n for (int j = 1; j <= n; j++) {\n for (int k = 1; k <= n; k++) {\n result += M.gcd(i, j, k);\n }\n }\n }\n io.println(result);\n }",
"final int n = io.nextInt();",
"n",
"io.nextInt()",
"io.nextInt",
"io",
"int result = 0;",
"result",
"0",
"for (int i = 1; i <= n; i++) {\n for (int j = 1; j <= n; j++) {\n for (int k = 1; k <= n; k++) {\n result += M.gcd(i, j, k);\n }\n }\n }",
"int i = 1;",
"int i = 1;",
"i",
"1",
"i <= n",
"i",
"n",
"i++",
"i++",
"i",
"{\n for (int j = 1; j <= n; j++) {\n for (int k = 1; k <= n; k++) {\n result += M.gcd(i, j, k);\n }\n }\n }",
"{\n for (int j = 1; j <= n; j++) {\n for (int k = 1; k <= n; k++) {\n result += M.gcd(i, j, k);\n }\n }\n }",
"for (int j = 1; j <= n; j++) {\n for (int k = 1; k <= n; k++) {\n result += M.gcd(i, j, k);\n }\n }",
"int j = 1;",
"int j = 1;",
"j",
"1",
"j <= n",
"j",
"n",
"j++",
"j++",
"j",
"{\n for (int k = 1; k <= n; k++) {\n result += M.gcd(i, j, k);\n }\n }",
"{\n for (int k = 1; k <= n; k++) {\n result += M.gcd(i, j, k);\n }\n }",
"for (int k = 1; k <= n; k++) {\n result += M.gcd(i, j, k);\n }",
"int k = 1;",
"int k = 1;",
"k",
"1",
"k <= n",
"k",
"n",
"k++",
"k++",
"k",
"{\n result += M.gcd(i, j, k);\n }",
"{\n result += M.gcd(i, j, k);\n }",
"result += M.gcd(i, j, k)",
"result",
"M.gcd(i, j, k)",
"M.gcd",
"M",
"i",
"j",
"k",
"io.println(result)",
"io.println",
"io",
"result",
"final IO io",
"io",
"public static final class M {\n public static int gcd(int a, int b) {\n int tmp;\n while (b != 0) {\n tmp = a;\n a = b;\n b = tmp % b;\n }\n return a;\n }\n\n public static int gcd(final int a, final int b, final int c) {\n return gcd(gcd(a, b), c);\n }\n\n public static int min(final int a, final int b) {\n return a > b ? b : a;\n }\n\n public static int min(final int a, final int b, final int c) {\n return min(min(a, b), min(b, c));\n }\n }",
"M",
"public static int gcd(int a, int b) {\n int tmp;\n while (b != 0) {\n tmp = a;\n a = b;\n b = tmp % b;\n }\n return a;\n }",
"gcd",
"{\n int tmp;\n while (b != 0) {\n tmp = a;\n a = b;\n b = tmp % b;\n }\n return a;\n }",
"int tmp;",
"tmp",
"while (b != 0) {\n tmp = a;\n a = b;\n b = tmp % b;\n }",
"b != 0",
"b",
"0",
"{\n tmp = a;\n a = b;\n b = tmp % b;\n }",
"tmp = a",
"tmp",
"a",
"a = b",
"a",
"b",
"b = tmp % b",
"b",
"tmp % b",
"tmp",
"b",
"return a;",
"a",
"int a",
"a",
"int b",
"b",
"public static int gcd(final int a, final int b, final int c) {\n return gcd(gcd(a, b), c);\n }",
"gcd",
"{\n return gcd(gcd(a, b), c);\n }",
"return gcd(gcd(a, b), c);",
"gcd(gcd(a, b), c)",
"gcd",
"gcd(a, b)",
"gcd",
"a",
"b",
"c",
"final int a",
"a",
"final int b",
"b",
"final int c",
"c",
"public static int min(final int a, final int b) {\n return a > b ? b : a;\n }",
"min",
"{\n return a > b ? b : a;\n }",
"return a > b ? b : a;",
"a > b ? b : a",
"a > b",
"a",
"b",
"b",
"a",
"final int a",
"a",
"final int b",
"b",
"public static int min(final int a, final int b, final int c) {\n return min(min(a, b), min(b, c));\n }",
"min",
"{\n return min(min(a, b), min(b, c));\n }",
"return min(min(a, b), min(b, c));",
"min(min(a, b), min(b, c))",
"min",
"min(a, b)",
"min",
"a",
"b",
"min(b, c)",
"min",
"b",
"c",
"final int a",
"a",
"final int b",
"b",
"final int c",
"c",
"public static final class IO implements AutoCloseable {\n private final InputStream in;\n private final BufferedOutputStream out;\n private static final int BUFSIZE = 1 << 20;\n private final byte[] buf = new byte[BUFSIZE];\n private int index = 0;\n private int total = 0;\n public IO(final InputStream in, final PrintStream out) throws IOException {\n this.in = in;\n this.out = new BufferedOutputStream(out);\n }\n\n @Override\n public void close() throws IOException {\n in.close();\n out.close();\n }\n\n private int scan() throws IOException {\n if (index >= total) {\n index = 0;\n total = in.read(buf);\n if (total <= 0)\n return -1;\n }\n return buf[index++];\n }\n\n public String next() throws IOException {\n int c;\n for (c = scan(); c <= 32; c = scan());\n StringBuilder sb = new StringBuilder();\n for (; c > 32; c = scan())\n sb.append((char) c);\n return sb.toString();\n }\n\n public int nextInt() throws IOException {\n int c, val = 0;\n for (c = scan(); c <= 32; c = scan());\n boolean neg = c == '-';\n if (c == '-' || c == '+')\n c = scan();\n for (; c >= '0' && c <= '9'; c = scan())\n val = (val << 3) + (val << 1) + (c & 15);\n return neg ? -val : val;\n }\n\n public int[] nextInt(final int n) throws IOException {\n final int[] result = new int[n];\n for (int i = 0; i < n; i++) {\n result[i] = nextInt();\n }\n return result;\n }\n\n public long nextLong() throws IOException {\n int c;\n long val = 0;\n for (c = scan(); c <= 32; c = scan());\n boolean neg = c == '-';\n if (c == '-' || c == '+')\n c = scan();\n for (; c >= '0' && c <= '9'; c = scan())\n val = (val << 3) + (val << 1) + (c & 15);\n return neg ? -val : val;\n }\n\n public long[] nextLong(final int n) throws IOException {\n final long[] result = new long[n];\n for (int i = 0; i < n; i++) {\n result[i] = nextLong();\n }\n return result;\n }\n\n public void print(final Object a) throws IOException {\n out.write(a.toString().getBytes());\n }\n\n private static final byte[] SP = new byte[] { 0x20 };\n public void printsp(final Object a) throws IOException {\n out.write(a.toString().getBytes());\n out.write(SP);\n }\n\n private static final byte[] CRLF = System.lineSeparator().getBytes();\n public void println() throws IOException {\n out.write(CRLF);\n }\n\n public void println(final Object a) throws IOException {\n out.write(a.toString().getBytes());\n out.write(CRLF);\n }\n\n public void flush() throws IOException {\n out.flush();\n }\n }",
"IO",
"private final InputStream in;",
"in",
"private final BufferedOutputStream out;",
"out",
"private static final int BUFSIZE = 1 << 20;",
"BUFSIZE",
"1 << 20",
"1",
"20",
"private final byte[] buf = new byte[BUFSIZE];",
"buf",
"new byte[BUFSIZE]",
"BUFSIZE",
"private int index = 0;",
"index",
"0",
"private int total = 0;",
"total",
"0",
"private static final byte[] SP = new byte[] { 0x20 };",
"SP",
"new byte[] { 0x20 }",
"private static final byte[] CRLF = System.lineSeparator().getBytes();",
"CRLF",
"System.lineSeparator().getBytes()",
"System.lineSeparator().getBytes",
"System.lineSeparator()",
"System.lineSeparator",
"System",
"public IO(final InputStream in, final PrintStream out) throws IOException {\n this.in = in;\n this.out = new BufferedOutputStream(out);\n }",
"IO",
"{\n this.in = in;\n this.out = new BufferedOutputStream(out);\n }",
"this.in = in",
"this.in",
"this",
"this.in",
"in",
"this.out = new BufferedOutputStream(out)",
"this.out",
"this",
"this.out",
"new BufferedOutputStream(out)",
"final InputStream in",
"in",
"final PrintStream out",
"out",
"@Override\n public void close() throws IOException {\n in.close();\n out.close();\n }",
"close",
"{\n in.close();\n out.close();\n }",
"in.close()",
"in.close",
"in",
"out.close()",
"out.close",
"out",
"private int scan() throws IOException {\n if (index >= total) {\n index = 0;\n total = in.read(buf);\n if (total <= 0)\n return -1;\n }\n return buf[index++];\n }",
"scan",
"{\n if (index >= total) {\n index = 0;\n total = in.read(buf);\n if (total <= 0)\n return -1;\n }\n return buf[index++];\n }",
"if (index >= total) {\n index = 0;\n total = in.read(buf);\n if (total <= 0)\n return -1;\n }",
"index >= total",
"index",
"total",
"{\n index = 0;\n total = in.read(buf);\n if (total <= 0)\n return -1;\n }",
"index = 0",
"index",
"0",
"total = in.read(buf)",
"total",
"in.read(buf)",
"in.read",
"in",
"buf",
"if (total <= 0)\n return -1;",
"total <= 0",
"total",
"0",
"return -1;",
"-1",
"1",
"return buf[index++];",
"buf[index++]",
"buf",
"index++",
"index",
"public String next() throws IOException {\n int c;\n for (c = scan(); c <= 32; c = scan());\n StringBuilder sb = new StringBuilder();\n for (; c > 32; c = scan())\n sb.append((char) c);\n return sb.toString();\n }",
"next",
"{\n int c;\n for (c = scan(); c <= 32; c = scan());\n StringBuilder sb = new StringBuilder();\n for (; c > 32; c = scan())\n sb.append((char) c);\n return sb.toString();\n }",
"int c;",
"c",
"for (c = scan(); c <= 32; c = scan());",
"c = scan();",
"c = scan()",
"c",
"scan()",
"scan",
"c <= 32",
"c",
"32",
"c = scan()",
"c = scan()",
"c",
"scan()",
"scan",
";",
"StringBuilder sb = new StringBuilder();",
"sb",
"new StringBuilder()",
"for (; c > 32; c = scan())\n sb.append((char) c);",
";",
"c > 32",
"c",
"32",
"c = scan()",
"c = scan()",
"c",
"scan()",
"scan",
"sb.append((char) c);",
"sb.append((char) c)",
"sb.append",
"sb",
"(char) c",
"return sb.toString();",
"sb.toString()",
"sb.toString",
"sb",
"public int nextInt() throws IOException {\n int c, val = 0;\n for (c = scan(); c <= 32; c = scan());\n boolean neg = c == '-';\n if (c == '-' || c == '+')\n c = scan();\n for (; c >= '0' && c <= '9'; c = scan())\n val = (val << 3) + (val << 1) + (c & 15);\n return neg ? -val : val;\n }",
"nextInt",
"{\n int c, val = 0;\n for (c = scan(); c <= 32; c = scan());\n boolean neg = c == '-';\n if (c == '-' || c == '+')\n c = scan();\n for (; c >= '0' && c <= '9'; c = scan())\n val = (val << 3) + (val << 1) + (c & 15);\n return neg ? -val : val;\n }",
"int c",
"c",
"val = 0;",
"val",
"0",
"for (c = scan(); c <= 32; c = scan());",
"c = scan();",
"c = scan()",
"c",
"scan()",
"scan",
"c <= 32",
"c",
"32",
"c = scan()",
"c = scan()",
"c",
"scan()",
"scan",
";",
"boolean neg = c == '-';",
"neg",
"c == '-'",
"c",
"'-'",
"if (c == '-' || c == '+')\n c = scan();",
"c == '-' || c == '+'",
"c == '-'",
"c",
"'-'",
"c == '+'",
"c",
"'+'",
"c = scan()",
"c",
"scan()",
"scan",
"for (; c >= '0' && c <= '9'; c = scan())\n val = (val << 3) + (val << 1) + (c & 15);",
";",
"c >= '0' && c <= '9'",
"c >= '0'",
"c",
"'0'",
"c <= '9'",
"c",
"'9'",
"c = scan()",
"c = scan()",
"c",
"scan()",
"scan",
"val = (val << 3) + (val << 1) + (c & 15);",
"val = (val << 3) + (val << 1) + (c & 15)",
"val",
"(val << 3) + (val << 1) + (c & 15)",
"(val << 3) + (val << 1) + (c & 15)",
"(val << 3)",
"val",
"3",
"(val << 1)",
"val",
"1",
"(c & 15)",
"c",
"15",
"return neg ? -val : val;",
"neg ? -val : val",
"neg",
"-val",
"val",
"val",
"public int[] nextInt(final int n) throws IOException {\n final int[] result = new int[n];\n for (int i = 0; i < n; i++) {\n result[i] = nextInt();\n }\n return result;\n }",
"nextInt",
"{\n final int[] result = new int[n];\n for (int i = 0; i < n; i++) {\n result[i] = nextInt();\n }\n return result;\n }",
"final int[] result = new int[n];",
"result",
"new int[n]",
"n",
"for (int i = 0; i < n; i++) {\n result[i] = nextInt();\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < n",
"i",
"n",
"i++",
"i++",
"i",
"{\n result[i] = nextInt();\n }",
"{\n result[i] = nextInt();\n }",
"result[i] = nextInt()",
"result[i]",
"result",
"i",
"nextInt()",
"nextInt",
"return result;",
"result",
"final int n",
"n",
"public long nextLong() throws IOException {\n int c;\n long val = 0;\n for (c = scan(); c <= 32; c = scan());\n boolean neg = c == '-';\n if (c == '-' || c == '+')\n c = scan();\n for (; c >= '0' && c <= '9'; c = scan())\n val = (val << 3) + (val << 1) + (c & 15);\n return neg ? -val : val;\n }",
"nextLong",
"{\n int c;\n long val = 0;\n for (c = scan(); c <= 32; c = scan());\n boolean neg = c == '-';\n if (c == '-' || c == '+')\n c = scan();\n for (; c >= '0' && c <= '9'; c = scan())\n val = (val << 3) + (val << 1) + (c & 15);\n return neg ? -val : val;\n }",
"int c;",
"c",
"long val = 0;",
"val",
"0",
"for (c = scan(); c <= 32; c = scan());",
"c = scan();",
"c = scan()",
"c",
"scan()",
"scan",
"c <= 32",
"c",
"32",
"c = scan()",
"c = scan()",
"c",
"scan()",
"scan",
";",
"boolean neg = c == '-';",
"neg",
"c == '-'",
"c",
"'-'",
"if (c == '-' || c == '+')\n c = scan();",
"c == '-' || c == '+'",
"c == '-'",
"c",
"'-'",
"c == '+'",
"c",
"'+'",
"c = scan()",
"c",
"scan()",
"scan",
"for (; c >= '0' && c <= '9'; c = scan())\n val = (val << 3) + (val << 1) + (c & 15);",
";",
"c >= '0' && c <= '9'",
"c >= '0'",
"c",
"'0'",
"c <= '9'",
"c",
"'9'",
"c = scan()",
"c = scan()",
"c",
"scan()",
"scan",
"val = (val << 3) + (val << 1) + (c & 15);",
"val = (val << 3) + (val << 1) + (c & 15)",
"val",
"(val << 3) + (val << 1) + (c & 15)",
"(val << 3) + (val << 1) + (c & 15)",
"(val << 3)",
"val",
"3",
"(val << 1)",
"val",
"1",
"(c & 15)",
"c",
"15",
"return neg ? -val : val;",
"neg ? -val : val",
"neg",
"-val",
"val",
"val",
"public long[] nextLong(final int n) throws IOException {\n final long[] result = new long[n];\n for (int i = 0; i < n; i++) {\n result[i] = nextLong();\n }\n return result;\n }",
"nextLong",
"{\n final long[] result = new long[n];\n for (int i = 0; i < n; i++) {\n result[i] = nextLong();\n }\n return result;\n }",
"final long[] result = new long[n];",
"result",
"new long[n]",
"n",
"for (int i = 0; i < n; i++) {\n result[i] = nextLong();\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < n",
"i",
"n",
"i++",
"i++",
"i",
"{\n result[i] = nextLong();\n }",
"{\n result[i] = nextLong();\n }",
"result[i] = nextLong()",
"result[i]",
"result",
"i",
"nextLong()",
"nextLong",
"return result;",
"result",
"final int n",
"n",
"public void print(final Object a) throws IOException {\n out.write(a.toString().getBytes());\n }",
"print",
"{\n out.write(a.toString().getBytes());\n }",
"out.write(a.toString().getBytes())",
"out.write",
"out",
"a.toString().getBytes()",
"a.toString().getBytes",
"a.toString()",
"a.toString",
"a",
"final Object a",
"a",
"public void printsp(final Object a) throws IOException {\n out.write(a.toString().getBytes());\n out.write(SP);\n }",
"printsp",
"{\n out.write(a.toString().getBytes());\n out.write(SP);\n }",
"out.write(a.toString().getBytes())",
"out.write",
"out",
"a.toString().getBytes()",
"a.toString().getBytes",
"a.toString()",
"a.toString",
"a",
"out.write(SP)",
"out.write",
"out",
"SP",
"final Object a",
"a",
"public void println() throws IOException {\n out.write(CRLF);\n }",
"println",
"{\n out.write(CRLF);\n }",
"out.write(CRLF)",
"out.write",
"out",
"CRLF",
"public void println(final Object a) throws IOException {\n out.write(a.toString().getBytes());\n out.write(CRLF);\n }",
"println",
"{\n out.write(a.toString().getBytes());\n out.write(CRLF);\n }",
"out.write(a.toString().getBytes())",
"out.write",
"out",
"a.toString().getBytes()",
"a.toString().getBytes",
"a.toString()",
"a.toString",
"a",
"out.write(CRLF)",
"out.write",
"out",
"CRLF",
"final Object a",
"a",
"public void flush() throws IOException {\n out.flush();\n }",
"flush",
"{\n out.flush();\n }",
"out.flush()",
"out.flush",
"out",
"AutoCloseable",
"public final class Main {\n public static void main(final String[] args) throws Exception {\n try (IO io = new IO(System.in, System.out)) {\n execute(io);\n }\n }\n\n private static void execute(final IO io) throws Exception {\n final int n = io.nextInt();\n int result = 0;\n for (int i = 1; i <= n; i++) {\n for (int j = 1; j <= n; j++) {\n for (int k = 1; k <= n; k++) {\n result += M.gcd(i, j, k);\n }\n }\n }\n io.println(result);\n }\n\n public static final class M {\n public static int gcd(int a, int b) {\n int tmp;\n while (b != 0) {\n tmp = a;\n a = b;\n b = tmp % b;\n }\n return a;\n }\n\n public static int gcd(final int a, final int b, final int c) {\n return gcd(gcd(a, b), c);\n }\n\n public static int min(final int a, final int b) {\n return a > b ? b : a;\n }\n\n public static int min(final int a, final int b, final int c) {\n return min(min(a, b), min(b, c));\n }\n }\n\n public static final class IO implements AutoCloseable {\n private final InputStream in;\n private final BufferedOutputStream out;\n private static final int BUFSIZE = 1 << 20;\n private final byte[] buf = new byte[BUFSIZE];\n private int index = 0;\n private int total = 0;\n public IO(final InputStream in, final PrintStream out) throws IOException {\n this.in = in;\n this.out = new BufferedOutputStream(out);\n }\n\n @Override\n public void close() throws IOException {\n in.close();\n out.close();\n }\n\n private int scan() throws IOException {\n if (index >= total) {\n index = 0;\n total = in.read(buf);\n if (total <= 0)\n return -1;\n }\n return buf[index++];\n }\n\n public String next() throws IOException {\n int c;\n for (c = scan(); c <= 32; c = scan());\n StringBuilder sb = new StringBuilder();\n for (; c > 32; c = scan())\n sb.append((char) c);\n return sb.toString();\n }\n\n public int nextInt() throws IOException {\n int c, val = 0;\n for (c = scan(); c <= 32; c = scan());\n boolean neg = c == '-';\n if (c == '-' || c == '+')\n c = scan();\n for (; c >= '0' && c <= '9'; c = scan())\n val = (val << 3) + (val << 1) + (c & 15);\n return neg ? -val : val;\n }\n\n public int[] nextInt(final int n) throws IOException {\n final int[] result = new int[n];\n for (int i = 0; i < n; i++) {\n result[i] = nextInt();\n }\n return result;\n }\n\n public long nextLong() throws IOException {\n int c;\n long val = 0;\n for (c = scan(); c <= 32; c = scan());\n boolean neg = c == '-';\n if (c == '-' || c == '+')\n c = scan();\n for (; c >= '0' && c <= '9'; c = scan())\n val = (val << 3) + (val << 1) + (c & 15);\n return neg ? -val : val;\n }\n\n public long[] nextLong(final int n) throws IOException {\n final long[] result = new long[n];\n for (int i = 0; i < n; i++) {\n result[i] = nextLong();\n }\n return result;\n }\n\n public void print(final Object a) throws IOException {\n out.write(a.toString().getBytes());\n }\n\n private static final byte[] SP = new byte[] { 0x20 };\n public void printsp(final Object a) throws IOException {\n out.write(a.toString().getBytes());\n out.write(SP);\n }\n\n private static final byte[] CRLF = System.lineSeparator().getBytes();\n public void println() throws IOException {\n out.write(CRLF);\n }\n\n public void println(final Object a) throws IOException {\n out.write(a.toString().getBytes());\n out.write(CRLF);\n }\n\n public void flush() throws IOException {\n out.flush();\n }\n }\n}",
"public final class Main {\n public static void main(final String[] args) throws Exception {\n try (IO io = new IO(System.in, System.out)) {\n execute(io);\n }\n }\n\n private static void execute(final IO io) throws Exception {\n final int n = io.nextInt();\n int result = 0;\n for (int i = 1; i <= n; i++) {\n for (int j = 1; j <= n; j++) {\n for (int k = 1; k <= n; k++) {\n result += M.gcd(i, j, k);\n }\n }\n }\n io.println(result);\n }\n\n public static final class M {\n public static int gcd(int a, int b) {\n int tmp;\n while (b != 0) {\n tmp = a;\n a = b;\n b = tmp % b;\n }\n return a;\n }\n\n public static int gcd(final int a, final int b, final int c) {\n return gcd(gcd(a, b), c);\n }\n\n public static int min(final int a, final int b) {\n return a > b ? b : a;\n }\n\n public static int min(final int a, final int b, final int c) {\n return min(min(a, b), min(b, c));\n }\n }\n\n public static final class IO implements AutoCloseable {\n private final InputStream in;\n private final BufferedOutputStream out;\n private static final int BUFSIZE = 1 << 20;\n private final byte[] buf = new byte[BUFSIZE];\n private int index = 0;\n private int total = 0;\n public IO(final InputStream in, final PrintStream out) throws IOException {\n this.in = in;\n this.out = new BufferedOutputStream(out);\n }\n\n @Override\n public void close() throws IOException {\n in.close();\n out.close();\n }\n\n private int scan() throws IOException {\n if (index >= total) {\n index = 0;\n total = in.read(buf);\n if (total <= 0)\n return -1;\n }\n return buf[index++];\n }\n\n public String next() throws IOException {\n int c;\n for (c = scan(); c <= 32; c = scan());\n StringBuilder sb = new StringBuilder();\n for (; c > 32; c = scan())\n sb.append((char) c);\n return sb.toString();\n }\n\n public int nextInt() throws IOException {\n int c, val = 0;\n for (c = scan(); c <= 32; c = scan());\n boolean neg = c == '-';\n if (c == '-' || c == '+')\n c = scan();\n for (; c >= '0' && c <= '9'; c = scan())\n val = (val << 3) + (val << 1) + (c & 15);\n return neg ? -val : val;\n }\n\n public int[] nextInt(final int n) throws IOException {\n final int[] result = new int[n];\n for (int i = 0; i < n; i++) {\n result[i] = nextInt();\n }\n return result;\n }\n\n public long nextLong() throws IOException {\n int c;\n long val = 0;\n for (c = scan(); c <= 32; c = scan());\n boolean neg = c == '-';\n if (c == '-' || c == '+')\n c = scan();\n for (; c >= '0' && c <= '9'; c = scan())\n val = (val << 3) + (val << 1) + (c & 15);\n return neg ? -val : val;\n }\n\n public long[] nextLong(final int n) throws IOException {\n final long[] result = new long[n];\n for (int i = 0; i < n; i++) {\n result[i] = nextLong();\n }\n return result;\n }\n\n public void print(final Object a) throws IOException {\n out.write(a.toString().getBytes());\n }\n\n private static final byte[] SP = new byte[] { 0x20 };\n public void printsp(final Object a) throws IOException {\n out.write(a.toString().getBytes());\n out.write(SP);\n }\n\n private static final byte[] CRLF = System.lineSeparator().getBytes();\n public void println() throws IOException {\n out.write(CRLF);\n }\n\n public void println(final Object a) throws IOException {\n out.write(a.toString().getBytes());\n out.write(CRLF);\n }\n\n public void flush() throws IOException {\n out.flush();\n }\n }\n}",
"Main"
] |
import java.io.BufferedOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintStream;
public final class Main {
public static void main(final String[] args) throws Exception {
try (IO io = new IO(System.in, System.out)) {
execute(io);
}
}
private static void execute(final IO io) throws Exception {
final int n = io.nextInt();
int result = 0;
for (int i = 1; i <= n; i++) {
for (int j = 1; j <= n; j++) {
for (int k = 1; k <= n; k++) {
result += M.gcd(i, j, k);
}
}
}
io.println(result);
}
public static final class M {
public static int gcd(int a, int b) {
int tmp;
while (b != 0) {
tmp = a;
a = b;
b = tmp % b;
}
return a;
}
public static int gcd(final int a, final int b, final int c) {
return gcd(gcd(a, b), c);
}
public static int min(final int a, final int b) {
return a > b ? b : a;
}
public static int min(final int a, final int b, final int c) {
return min(min(a, b), min(b, c));
}
}
public static final class IO implements AutoCloseable {
private final InputStream in;
private final BufferedOutputStream out;
private static final int BUFSIZE = 1 << 20;
private final byte[] buf = new byte[BUFSIZE];
private int index = 0;
private int total = 0;
public IO(final InputStream in, final PrintStream out) throws IOException {
this.in = in;
this.out = new BufferedOutputStream(out);
}
@Override
public void close() throws IOException {
in.close();
out.close();
}
private int scan() throws IOException {
if (index >= total) {
index = 0;
total = in.read(buf);
if (total <= 0)
return -1;
}
return buf[index++];
}
public String next() throws IOException {
int c;
for (c = scan(); c <= 32; c = scan());
StringBuilder sb = new StringBuilder();
for (; c > 32; c = scan())
sb.append((char) c);
return sb.toString();
}
public int nextInt() throws IOException {
int c, val = 0;
for (c = scan(); c <= 32; c = scan());
boolean neg = c == '-';
if (c == '-' || c == '+')
c = scan();
for (; c >= '0' && c <= '9'; c = scan())
val = (val << 3) + (val << 1) + (c & 15);
return neg ? -val : val;
}
public int[] nextInt(final int n) throws IOException {
final int[] result = new int[n];
for (int i = 0; i < n; i++) {
result[i] = nextInt();
}
return result;
}
public long nextLong() throws IOException {
int c;
long val = 0;
for (c = scan(); c <= 32; c = scan());
boolean neg = c == '-';
if (c == '-' || c == '+')
c = scan();
for (; c >= '0' && c <= '9'; c = scan())
val = (val << 3) + (val << 1) + (c & 15);
return neg ? -val : val;
}
public long[] nextLong(final int n) throws IOException {
final long[] result = new long[n];
for (int i = 0; i < n; i++) {
result[i] = nextLong();
}
return result;
}
public void print(final Object a) throws IOException {
out.write(a.toString().getBytes());
}
private static final byte[] SP = new byte[] { 0x20 };
public void printsp(final Object a) throws IOException {
out.write(a.toString().getBytes());
out.write(SP);
}
private static final byte[] CRLF = System.lineSeparator().getBytes();
public void println() throws IOException {
out.write(CRLF);
}
public void println(final Object a) throws IOException {
out.write(a.toString().getBytes());
out.write(CRLF);
}
public void flush() throws IOException {
out.flush();
}
}
}
|
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
17,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
4,
13,
13,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
4,
13,
13,
13,
4,
18,
18,
13,
13,
13,
23,
13,
12,
13,
30,
14,
2,
2,
13,
13,
17,
30,
29,
13,
29,
4,
13,
13,
2,
13,
13,
23,
13,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
106,
5
],
[
106,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
8,
17
],
[
17,
18
],
[
17,
19
],
[
8,
20
],
[
20,
21
],
[
20,
22
],
[
8,
23
],
[
23,
24
],
[
24,
25
],
[
25,
26
],
[
25,
27
],
[
23,
28
],
[
28,
29
],
[
28,
30
],
[
23,
31
],
[
31,
32
],
[
32,
33
],
[
23,
34
],
[
35,
35
],
[
35,
36
],
[
36,
37
],
[
37,
38
],
[
38,
39
],
[
38,
40
],
[
36,
41
],
[
41,
42
],
[
41,
43
],
[
36,
44
],
[
44,
45
],
[
45,
46
],
[
36,
47
],
[
48,
48
],
[
48,
49
],
[
49,
50
],
[
49,
51
],
[
51,
52
],
[
51,
53
],
[
51,
54
],
[
48,
55
],
[
55,
56
],
[
56,
57
],
[
57,
58
],
[
57,
59
],
[
55,
60
],
[
60,
61
],
[
60,
62
],
[
55,
63
],
[
63,
64
],
[
64,
65
],
[
55,
66
],
[
67,
67
],
[
67,
68
],
[
68,
69
],
[
68,
70
],
[
70,
71
],
[
70,
72
],
[
70,
73
],
[
8,
74
],
[
74,
75
],
[
75,
76
],
[
76,
77
],
[
76,
78
],
[
74,
79
],
[
6,
80
],
[
80,
81
],
[
106,
82
],
[
82,
83
],
[
82,
84
],
[
84,
85
],
[
85,
86
],
[
86,
87
],
[
87,
88
],
[
87,
89
],
[
86,
90
],
[
85,
91
],
[
91,
92
],
[
92,
93
],
[
84,
94
],
[
94,
95
],
[
95,
96
],
[
95,
97
],
[
95,
98
],
[
98,
99
],
[
98,
100
],
[
82,
101
],
[
101,
102
],
[
82,
103
],
[
103,
104
],
[
0,
105
],
[
105,
106
],
[
105,
107
]
] |
[
"import java.util.*;\n\npublic class Main{\n public static void main(String args[]){\n Scanner sn = new Scanner(System.in);\n int N = sn.nextInt();\n int result = 0;\n int a = 0;\n\n for(int i=1; i<=N; i++){\n for(int j=1; j<=N; j++){\n a =gcd(i, j);\n for(int k=1; k<=N; k++){\n result += gcd(a, k);\n }\n }\n }\n System.out.println(result);\n }\n\n public static int gcd(int p, int q){\n if(p % q == 0){\n return q;\n }\n return gcd(q, p%q);\n }\n}",
"import java.util.*;",
"util.*",
"java",
"public class Main{\n public static void main(String args[]){\n Scanner sn = new Scanner(System.in);\n int N = sn.nextInt();\n int result = 0;\n int a = 0;\n\n for(int i=1; i<=N; i++){\n for(int j=1; j<=N; j++){\n a =gcd(i, j);\n for(int k=1; k<=N; k++){\n result += gcd(a, k);\n }\n }\n }\n System.out.println(result);\n }\n\n public static int gcd(int p, int q){\n if(p % q == 0){\n return q;\n }\n return gcd(q, p%q);\n }\n}",
"Main",
"public static void main(String args[]){\n Scanner sn = new Scanner(System.in);\n int N = sn.nextInt();\n int result = 0;\n int a = 0;\n\n for(int i=1; i<=N; i++){\n for(int j=1; j<=N; j++){\n a =gcd(i, j);\n for(int k=1; k<=N; k++){\n result += gcd(a, k);\n }\n }\n }\n System.out.println(result);\n }",
"main",
"{\n Scanner sn = new Scanner(System.in);\n int N = sn.nextInt();\n int result = 0;\n int a = 0;\n\n for(int i=1; i<=N; i++){\n for(int j=1; j<=N; j++){\n a =gcd(i, j);\n for(int k=1; k<=N; k++){\n result += gcd(a, k);\n }\n }\n }\n System.out.println(result);\n }",
"Scanner sn = new Scanner(System.in);",
"sn",
"new Scanner(System.in)",
"int N = sn.nextInt();",
"N",
"sn.nextInt()",
"sn.nextInt",
"sn",
"int result = 0;",
"result",
"0",
"int a = 0;",
"a",
"0",
"for(int i=1; i<=N; i++){\n for(int j=1; j<=N; j++){\n a =gcd(i, j);\n for(int k=1; k<=N; k++){\n result += gcd(a, k);\n }\n }\n }",
"int i=1;",
"int i=1;",
"i",
"1",
"i<=N",
"i",
"N",
"i++",
"i++",
"i",
"{\n for(int j=1; j<=N; j++){\n a =gcd(i, j);\n for(int k=1; k<=N; k++){\n result += gcd(a, k);\n }\n }\n }",
"{\n for(int j=1; j<=N; j++){\n a =gcd(i, j);\n for(int k=1; k<=N; k++){\n result += gcd(a, k);\n }\n }\n }",
"for(int j=1; j<=N; j++){\n a =gcd(i, j);\n for(int k=1; k<=N; k++){\n result += gcd(a, k);\n }\n }",
"int j=1;",
"int j=1;",
"j",
"1",
"j<=N",
"j",
"N",
"j++",
"j++",
"j",
"{\n a =gcd(i, j);\n for(int k=1; k<=N; k++){\n result += gcd(a, k);\n }\n }",
"{\n a =gcd(i, j);\n for(int k=1; k<=N; k++){\n result += gcd(a, k);\n }\n }",
"a =gcd(i, j)",
"a",
"gcd(i, j)",
"gcd",
"i",
"j",
"for(int k=1; k<=N; k++){\n result += gcd(a, k);\n }",
"int k=1;",
"int k=1;",
"k",
"1",
"k<=N",
"k",
"N",
"k++",
"k++",
"k",
"{\n result += gcd(a, k);\n }",
"{\n result += gcd(a, k);\n }",
"result += gcd(a, k)",
"result",
"gcd(a, k)",
"gcd",
"a",
"k",
"System.out.println(result)",
"System.out.println",
"System.out",
"System",
"System.out",
"result",
"String args[]",
"args",
"public static int gcd(int p, int q){\n if(p % q == 0){\n return q;\n }\n return gcd(q, p%q);\n }",
"gcd",
"{\n if(p % q == 0){\n return q;\n }\n return gcd(q, p%q);\n }",
"if(p % q == 0){\n return q;\n }",
"p % q == 0",
"p % q",
"p",
"q",
"0",
"{\n return q;\n }",
"return q;",
"q",
"return gcd(q, p%q);",
"gcd(q, p%q)",
"gcd",
"q",
"p%q",
"p",
"q",
"int p",
"p",
"int q",
"q",
"public class Main{\n public static void main(String args[]){\n Scanner sn = new Scanner(System.in);\n int N = sn.nextInt();\n int result = 0;\n int a = 0;\n\n for(int i=1; i<=N; i++){\n for(int j=1; j<=N; j++){\n a =gcd(i, j);\n for(int k=1; k<=N; k++){\n result += gcd(a, k);\n }\n }\n }\n System.out.println(result);\n }\n\n public static int gcd(int p, int q){\n if(p % q == 0){\n return q;\n }\n return gcd(q, p%q);\n }\n}",
"public class Main{\n public static void main(String args[]){\n Scanner sn = new Scanner(System.in);\n int N = sn.nextInt();\n int result = 0;\n int a = 0;\n\n for(int i=1; i<=N; i++){\n for(int j=1; j<=N; j++){\n a =gcd(i, j);\n for(int k=1; k<=N; k++){\n result += gcd(a, k);\n }\n }\n }\n System.out.println(result);\n }\n\n public static int gcd(int p, int q){\n if(p % q == 0){\n return q;\n }\n return gcd(q, p%q);\n }\n}",
"Main"
] |
import java.util.*;
public class Main{
public static void main(String args[]){
Scanner sn = new Scanner(System.in);
int N = sn.nextInt();
int result = 0;
int a = 0;
for(int i=1; i<=N; i++){
for(int j=1; j<=N; j++){
a =gcd(i, j);
for(int k=1; k<=N; k++){
result += gcd(a, k);
}
}
}
System.out.println(result);
}
public static int gcd(int p, int q){
if(p % q == 0){
return q;
}
return gcd(q, p%q);
}
}
|
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
20,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
4,
18,
13,
13,
13,
13,
4,
18,
18,
13,
13,
13,
23,
13,
12,
13,
30,
14,
2,
2,
13,
13,
17,
30,
29,
4,
13,
13,
2,
13,
13,
29,
13,
23,
13,
23,
13,
12,
13,
30,
29,
4,
13,
4,
13,
13,
13,
13,
23,
13,
23,
13,
23,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
8,
17
],
[
17,
18
],
[
17,
19
],
[
8,
20
],
[
20,
21
],
[
20,
22
],
[
8,
23
],
[
23,
24
],
[
24,
25
],
[
25,
26
],
[
25,
27
],
[
23,
28
],
[
28,
29
],
[
28,
30
],
[
23,
31
],
[
31,
32
],
[
32,
33
],
[
23,
34
],
[
35,
35
],
[
35,
36
],
[
36,
37
],
[
37,
38
],
[
38,
39
],
[
38,
40
],
[
36,
41
],
[
41,
42
],
[
41,
43
],
[
36,
44
],
[
44,
45
],
[
45,
46
],
[
36,
47
],
[
48,
48
],
[
48,
49
],
[
49,
50
],
[
50,
51
],
[
51,
52
],
[
51,
53
],
[
49,
54
],
[
54,
55
],
[
54,
56
],
[
49,
57
],
[
57,
58
],
[
58,
59
],
[
49,
60
],
[
61,
61
],
[
61,
62
],
[
62,
63
],
[
62,
64
],
[
64,
65
],
[
65,
66
],
[
64,
67
],
[
64,
68
],
[
64,
69
],
[
8,
70
],
[
70,
71
],
[
71,
72
],
[
72,
73
],
[
72,
74
],
[
70,
75
],
[
6,
76
],
[
76,
77
],
[
4,
78
],
[
78,
79
],
[
78,
80
],
[
80,
81
],
[
81,
82
],
[
82,
83
],
[
83,
84
],
[
83,
85
],
[
82,
86
],
[
81,
87
],
[
87,
88
],
[
88,
89
],
[
89,
90
],
[
89,
91
],
[
89,
92
],
[
92,
93
],
[
92,
94
],
[
80,
95
],
[
95,
96
],
[
78,
97
],
[
97,
98
],
[
78,
99
],
[
99,
100
],
[
4,
101
],
[
101,
102
],
[
101,
103
],
[
103,
104
],
[
104,
105
],
[
105,
106
],
[
105,
107
],
[
107,
108
],
[
107,
109
],
[
107,
110
],
[
105,
111
],
[
101,
112
],
[
112,
113
],
[
101,
114
],
[
114,
115
],
[
101,
116
],
[
116,
117
]
] |
[
"import java.util.Scanner;\n \nclass Main {\n\tpublic static void main(String[] args){\n\t\tScanner sc = new Scanner(System.in);\n\t\tint k = sc.nextInt();\n\t\tMain m = new Main();\n\t\tlong sum = 0;\n\t\tfor(int i = 1;i <= k;i++){\n\t\t\tfor(int j = 1;j <= k;j++){\n\t\t\t\tfor(int l = 1;l <= k;l++){\n\t\t\t\t\tsum += m.gcd(i,j,l);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n \n\t\tSystem.out.println(sum);\n\t}\n\tint gcd(int a, int b){\n\t\tif((a%b!=0)){\n\t\t\treturn gcd(b,a%b);\n\t\t}\n\t\treturn b;\n\t}\n\tint gcd(int a,int b,int c){\n\t\treturn gcd(gcd(a,b),c);\n\t}\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"class Main {\n\tpublic static void main(String[] args){\n\t\tScanner sc = new Scanner(System.in);\n\t\tint k = sc.nextInt();\n\t\tMain m = new Main();\n\t\tlong sum = 0;\n\t\tfor(int i = 1;i <= k;i++){\n\t\t\tfor(int j = 1;j <= k;j++){\n\t\t\t\tfor(int l = 1;l <= k;l++){\n\t\t\t\t\tsum += m.gcd(i,j,l);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n \n\t\tSystem.out.println(sum);\n\t}\n\tint gcd(int a, int b){\n\t\tif((a%b!=0)){\n\t\t\treturn gcd(b,a%b);\n\t\t}\n\t\treturn b;\n\t}\n\tint gcd(int a,int b,int c){\n\t\treturn gcd(gcd(a,b),c);\n\t}\n}",
"Main",
"public static void main(String[] args){\n\t\tScanner sc = new Scanner(System.in);\n\t\tint k = sc.nextInt();\n\t\tMain m = new Main();\n\t\tlong sum = 0;\n\t\tfor(int i = 1;i <= k;i++){\n\t\t\tfor(int j = 1;j <= k;j++){\n\t\t\t\tfor(int l = 1;l <= k;l++){\n\t\t\t\t\tsum += m.gcd(i,j,l);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n \n\t\tSystem.out.println(sum);\n\t}",
"main",
"{\n\t\tScanner sc = new Scanner(System.in);\n\t\tint k = sc.nextInt();\n\t\tMain m = new Main();\n\t\tlong sum = 0;\n\t\tfor(int i = 1;i <= k;i++){\n\t\t\tfor(int j = 1;j <= k;j++){\n\t\t\t\tfor(int l = 1;l <= k;l++){\n\t\t\t\t\tsum += m.gcd(i,j,l);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n \n\t\tSystem.out.println(sum);\n\t}",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"int k = sc.nextInt();",
"k",
"sc.nextInt()",
"sc.nextInt",
"sc",
"Main m = new Main();",
"m",
"new Main()",
"long sum = 0;",
"sum",
"0",
"for(int i = 1;i <= k;i++){\n\t\t\tfor(int j = 1;j <= k;j++){\n\t\t\t\tfor(int l = 1;l <= k;l++){\n\t\t\t\t\tsum += m.gcd(i,j,l);\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"int i = 1;",
"int i = 1;",
"i",
"1",
"i <= k",
"i",
"k",
"i++",
"i++",
"i",
"{\n\t\t\tfor(int j = 1;j <= k;j++){\n\t\t\t\tfor(int l = 1;l <= k;l++){\n\t\t\t\t\tsum += m.gcd(i,j,l);\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"{\n\t\t\tfor(int j = 1;j <= k;j++){\n\t\t\t\tfor(int l = 1;l <= k;l++){\n\t\t\t\t\tsum += m.gcd(i,j,l);\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"for(int j = 1;j <= k;j++){\n\t\t\t\tfor(int l = 1;l <= k;l++){\n\t\t\t\t\tsum += m.gcd(i,j,l);\n\t\t\t\t}\n\t\t\t}",
"int j = 1;",
"int j = 1;",
"j",
"1",
"j <= k",
"j",
"k",
"j++",
"j++",
"j",
"{\n\t\t\t\tfor(int l = 1;l <= k;l++){\n\t\t\t\t\tsum += m.gcd(i,j,l);\n\t\t\t\t}\n\t\t\t}",
"{\n\t\t\t\tfor(int l = 1;l <= k;l++){\n\t\t\t\t\tsum += m.gcd(i,j,l);\n\t\t\t\t}\n\t\t\t}",
"for(int l = 1;l <= k;l++){\n\t\t\t\t\tsum += m.gcd(i,j,l);\n\t\t\t\t}",
"int l = 1;",
"int l = 1;",
"l",
"1",
"l <= k",
"l",
"k",
"l++",
"l++",
"l",
"{\n\t\t\t\t\tsum += m.gcd(i,j,l);\n\t\t\t\t}",
"{\n\t\t\t\t\tsum += m.gcd(i,j,l);\n\t\t\t\t}",
"sum += m.gcd(i,j,l)",
"sum",
"m.gcd(i,j,l)",
"m.gcd",
"m",
"i",
"j",
"l",
"System.out.println(sum)",
"System.out.println",
"System.out",
"System",
"System.out",
"sum",
"String[] args",
"args",
"int gcd(int a, int b){\n\t\tif((a%b!=0)){\n\t\t\treturn gcd(b,a%b);\n\t\t}\n\t\treturn b;\n\t}",
"gcd",
"{\n\t\tif((a%b!=0)){\n\t\t\treturn gcd(b,a%b);\n\t\t}\n\t\treturn b;\n\t}",
"if((a%b!=0)){\n\t\t\treturn gcd(b,a%b);\n\t\t}",
"(a%b!=0)",
"a%b",
"a",
"b",
"0",
"{\n\t\t\treturn gcd(b,a%b);\n\t\t}",
"return gcd(b,a%b);",
"gcd(b,a%b)",
"gcd",
"b",
"a%b",
"a",
"b",
"return b;",
"b",
"int a",
"a",
"int b",
"b",
"int gcd(int a,int b,int c){\n\t\treturn gcd(gcd(a,b),c);\n\t}",
"gcd",
"{\n\t\treturn gcd(gcd(a,b),c);\n\t}",
"return gcd(gcd(a,b),c);",
"gcd(gcd(a,b),c)",
"gcd",
"gcd(a,b)",
"gcd",
"a",
"b",
"c",
"int a",
"a",
"int b",
"b",
"int c",
"c"
] |
import java.util.Scanner;
class Main {
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
int k = sc.nextInt();
Main m = new Main();
long sum = 0;
for(int i = 1;i <= k;i++){
for(int j = 1;j <= k;j++){
for(int l = 1;l <= k;l++){
sum += m.gcd(i,j,l);
}
}
}
System.out.println(sum);
}
int gcd(int a, int b){
if((a%b!=0)){
return gcd(b,a%b);
}
return b;
}
int gcd(int a,int b,int c){
return gcd(gcd(a,b),c);
}
}
|
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
11,
1,
41,
13,
13,
2,
13,
13,
1,
40,
13,
30,
30,
11,
1,
41,
13,
13,
2,
13,
13,
1,
40,
13,
30,
30,
41,
13,
17,
11,
1,
41,
13,
13,
2,
2,
13,
17,
13,
1,
40,
13,
30,
30,
14,
2,
2,
2,
2,
13,
13,
17,
2,
2,
13,
13,
17,
2,
2,
13,
13,
17,
30,
0,
13,
17,
14,
2,
2,
13,
13,
2,
13,
13,
30,
0,
13,
13,
14,
2,
2,
2,
13,
13,
2,
13,
13,
2,
13,
13,
30,
0,
13,
2,
13,
17,
30,
0,
13,
2,
13,
17,
4,
18,
18,
13,
13,
13,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
144,
5
],
[
144,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
8,
17
],
[
17,
18
],
[
17,
19
],
[
8,
20
],
[
20,
21
],
[
21,
22
],
[
22,
23
],
[
22,
24
],
[
20,
25
],
[
25,
26
],
[
25,
27
],
[
20,
28
],
[
28,
29
],
[
29,
30
],
[
20,
31
],
[
32,
32
],
[
32,
33
],
[
33,
34
],
[
34,
35
],
[
35,
36
],
[
35,
37
],
[
33,
38
],
[
38,
39
],
[
38,
40
],
[
33,
41
],
[
41,
42
],
[
42,
43
],
[
33,
44
],
[
45,
45
],
[
45,
46
],
[
46,
47
],
[
47,
48
],
[
48,
49
],
[
48,
50
],
[
46,
51
],
[
51,
52
],
[
51,
53
],
[
46,
54
],
[
54,
55
],
[
55,
56
],
[
46,
57
],
[
58,
58
],
[
58,
59
],
[
59,
60
],
[
59,
61
],
[
58,
62
],
[
62,
63
],
[
63,
64
],
[
64,
65
],
[
64,
66
],
[
62,
67
],
[
67,
68
],
[
68,
69
],
[
68,
70
],
[
67,
71
],
[
62,
72
],
[
72,
73
],
[
73,
74
],
[
62,
75
],
[
76,
76
],
[
76,
77
],
[
77,
78
],
[
79,
79
],
[
79,
80
],
[
80,
81
],
[
81,
82
],
[
81,
83
],
[
80,
84
],
[
79,
85
],
[
85,
86
],
[
86,
87
],
[
86,
88
],
[
85,
89
],
[
79,
90
],
[
90,
91
],
[
91,
92
],
[
91,
93
],
[
90,
94
],
[
77,
95
],
[
95,
96
],
[
96,
97
],
[
96,
98
],
[
95,
99
],
[
99,
100
],
[
100,
101
],
[
101,
102
],
[
101,
103
],
[
100,
104
],
[
104,
105
],
[
104,
106
],
[
99,
107
],
[
107,
108
],
[
108,
109
],
[
108,
110
],
[
99,
111
],
[
111,
112
],
[
113,
113
],
[
113,
114
],
[
114,
115
],
[
114,
116
],
[
113,
117
],
[
117,
118
],
[
117,
119
],
[
113,
120
],
[
120,
121
],
[
120,
122
],
[
111,
123
],
[
123,
124
],
[
124,
125
],
[
124,
126
],
[
126,
127
],
[
126,
128
],
[
111,
129
],
[
129,
130
],
[
130,
131
],
[
130,
132
],
[
132,
133
],
[
132,
134
],
[
8,
135
],
[
135,
136
],
[
136,
137
],
[
137,
138
],
[
137,
139
],
[
135,
140
],
[
6,
141
],
[
141,
142
],
[
0,
143
],
[
143,
144
],
[
143,
145
]
] |
[
"import java.util.Scanner;\npublic class Main\n{\n \tpublic static void main(String[] args)\n {\n \tScanner sc = new Scanner(System.in);\n \tint a = sc.nextInt();\n \tlong result = 0;\n \tfor(int i = 1; i <= a; i++)\n \t{\n \t\tfor(int j = i; j <= a; j++)\n \t\t{\n \t\t\tfor(int k = j; k <= a; k++)\n \t\t\t{\n \t\t\t\tboolean judge = true;\n \t\t\t\tfor(int l = i; l > 0 && judge; l--)\n \t\t\t\t{\n \t\t\t\t\tif(i % l == 0 && j % l == 0 && k % l == 0)\n \t\t\t\t\t{\n \t\t\t\t\t\tjudge = false;\n \t\t\t\t\t\tif(i == j && j == k)\n {\n \tresult += l; \n }else if(i != j && j != k && i != k){\n \tresult += (l * 6);\n }else{\n \tresult += (l * 3);\n }\n \n \t\t\t\t\t}\n \t\t\t\t}\n \t\t\t}\n \t\t}\n \t}\n \t\n \tSystem.out.println(result);\n }\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main\n{\n \tpublic static void main(String[] args)\n {\n \tScanner sc = new Scanner(System.in);\n \tint a = sc.nextInt();\n \tlong result = 0;\n \tfor(int i = 1; i <= a; i++)\n \t{\n \t\tfor(int j = i; j <= a; j++)\n \t\t{\n \t\t\tfor(int k = j; k <= a; k++)\n \t\t\t{\n \t\t\t\tboolean judge = true;\n \t\t\t\tfor(int l = i; l > 0 && judge; l--)\n \t\t\t\t{\n \t\t\t\t\tif(i % l == 0 && j % l == 0 && k % l == 0)\n \t\t\t\t\t{\n \t\t\t\t\t\tjudge = false;\n \t\t\t\t\t\tif(i == j && j == k)\n {\n \tresult += l; \n }else if(i != j && j != k && i != k){\n \tresult += (l * 6);\n }else{\n \tresult += (l * 3);\n }\n \n \t\t\t\t\t}\n \t\t\t\t}\n \t\t\t}\n \t\t}\n \t}\n \t\n \tSystem.out.println(result);\n }\n}",
"Main",
"public static void main(String[] args)\n {\n \tScanner sc = new Scanner(System.in);\n \tint a = sc.nextInt();\n \tlong result = 0;\n \tfor(int i = 1; i <= a; i++)\n \t{\n \t\tfor(int j = i; j <= a; j++)\n \t\t{\n \t\t\tfor(int k = j; k <= a; k++)\n \t\t\t{\n \t\t\t\tboolean judge = true;\n \t\t\t\tfor(int l = i; l > 0 && judge; l--)\n \t\t\t\t{\n \t\t\t\t\tif(i % l == 0 && j % l == 0 && k % l == 0)\n \t\t\t\t\t{\n \t\t\t\t\t\tjudge = false;\n \t\t\t\t\t\tif(i == j && j == k)\n {\n \tresult += l; \n }else if(i != j && j != k && i != k){\n \tresult += (l * 6);\n }else{\n \tresult += (l * 3);\n }\n \n \t\t\t\t\t}\n \t\t\t\t}\n \t\t\t}\n \t\t}\n \t}\n \t\n \tSystem.out.println(result);\n }",
"main",
"{\n \tScanner sc = new Scanner(System.in);\n \tint a = sc.nextInt();\n \tlong result = 0;\n \tfor(int i = 1; i <= a; i++)\n \t{\n \t\tfor(int j = i; j <= a; j++)\n \t\t{\n \t\t\tfor(int k = j; k <= a; k++)\n \t\t\t{\n \t\t\t\tboolean judge = true;\n \t\t\t\tfor(int l = i; l > 0 && judge; l--)\n \t\t\t\t{\n \t\t\t\t\tif(i % l == 0 && j % l == 0 && k % l == 0)\n \t\t\t\t\t{\n \t\t\t\t\t\tjudge = false;\n \t\t\t\t\t\tif(i == j && j == k)\n {\n \tresult += l; \n }else if(i != j && j != k && i != k){\n \tresult += (l * 6);\n }else{\n \tresult += (l * 3);\n }\n \n \t\t\t\t\t}\n \t\t\t\t}\n \t\t\t}\n \t\t}\n \t}\n \t\n \tSystem.out.println(result);\n }",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"int a = sc.nextInt();",
"a",
"sc.nextInt()",
"sc.nextInt",
"sc",
"long result = 0;",
"result",
"0",
"for(int i = 1; i <= a; i++)\n \t{\n \t\tfor(int j = i; j <= a; j++)\n \t\t{\n \t\t\tfor(int k = j; k <= a; k++)\n \t\t\t{\n \t\t\t\tboolean judge = true;\n \t\t\t\tfor(int l = i; l > 0 && judge; l--)\n \t\t\t\t{\n \t\t\t\t\tif(i % l == 0 && j % l == 0 && k % l == 0)\n \t\t\t\t\t{\n \t\t\t\t\t\tjudge = false;\n \t\t\t\t\t\tif(i == j && j == k)\n {\n \tresult += l; \n }else if(i != j && j != k && i != k){\n \tresult += (l * 6);\n }else{\n \tresult += (l * 3);\n }\n \n \t\t\t\t\t}\n \t\t\t\t}\n \t\t\t}\n \t\t}\n \t}",
"int i = 1;",
"int i = 1;",
"i",
"1",
"i <= a",
"i",
"a",
"i++",
"i++",
"i",
"{\n \t\tfor(int j = i; j <= a; j++)\n \t\t{\n \t\t\tfor(int k = j; k <= a; k++)\n \t\t\t{\n \t\t\t\tboolean judge = true;\n \t\t\t\tfor(int l = i; l > 0 && judge; l--)\n \t\t\t\t{\n \t\t\t\t\tif(i % l == 0 && j % l == 0 && k % l == 0)\n \t\t\t\t\t{\n \t\t\t\t\t\tjudge = false;\n \t\t\t\t\t\tif(i == j && j == k)\n {\n \tresult += l; \n }else if(i != j && j != k && i != k){\n \tresult += (l * 6);\n }else{\n \tresult += (l * 3);\n }\n \n \t\t\t\t\t}\n \t\t\t\t}\n \t\t\t}\n \t\t}\n \t}",
"{\n \t\tfor(int j = i; j <= a; j++)\n \t\t{\n \t\t\tfor(int k = j; k <= a; k++)\n \t\t\t{\n \t\t\t\tboolean judge = true;\n \t\t\t\tfor(int l = i; l > 0 && judge; l--)\n \t\t\t\t{\n \t\t\t\t\tif(i % l == 0 && j % l == 0 && k % l == 0)\n \t\t\t\t\t{\n \t\t\t\t\t\tjudge = false;\n \t\t\t\t\t\tif(i == j && j == k)\n {\n \tresult += l; \n }else if(i != j && j != k && i != k){\n \tresult += (l * 6);\n }else{\n \tresult += (l * 3);\n }\n \n \t\t\t\t\t}\n \t\t\t\t}\n \t\t\t}\n \t\t}\n \t}",
"for(int j = i; j <= a; j++)\n \t\t{\n \t\t\tfor(int k = j; k <= a; k++)\n \t\t\t{\n \t\t\t\tboolean judge = true;\n \t\t\t\tfor(int l = i; l > 0 && judge; l--)\n \t\t\t\t{\n \t\t\t\t\tif(i % l == 0 && j % l == 0 && k % l == 0)\n \t\t\t\t\t{\n \t\t\t\t\t\tjudge = false;\n \t\t\t\t\t\tif(i == j && j == k)\n {\n \tresult += l; \n }else if(i != j && j != k && i != k){\n \tresult += (l * 6);\n }else{\n \tresult += (l * 3);\n }\n \n \t\t\t\t\t}\n \t\t\t\t}\n \t\t\t}\n \t\t}",
"int j = i;",
"int j = i;",
"j",
"i",
"j <= a",
"j",
"a",
"j++",
"j++",
"j",
"{\n \t\t\tfor(int k = j; k <= a; k++)\n \t\t\t{\n \t\t\t\tboolean judge = true;\n \t\t\t\tfor(int l = i; l > 0 && judge; l--)\n \t\t\t\t{\n \t\t\t\t\tif(i % l == 0 && j % l == 0 && k % l == 0)\n \t\t\t\t\t{\n \t\t\t\t\t\tjudge = false;\n \t\t\t\t\t\tif(i == j && j == k)\n {\n \tresult += l; \n }else if(i != j && j != k && i != k){\n \tresult += (l * 6);\n }else{\n \tresult += (l * 3);\n }\n \n \t\t\t\t\t}\n \t\t\t\t}\n \t\t\t}\n \t\t}",
"{\n \t\t\tfor(int k = j; k <= a; k++)\n \t\t\t{\n \t\t\t\tboolean judge = true;\n \t\t\t\tfor(int l = i; l > 0 && judge; l--)\n \t\t\t\t{\n \t\t\t\t\tif(i % l == 0 && j % l == 0 && k % l == 0)\n \t\t\t\t\t{\n \t\t\t\t\t\tjudge = false;\n \t\t\t\t\t\tif(i == j && j == k)\n {\n \tresult += l; \n }else if(i != j && j != k && i != k){\n \tresult += (l * 6);\n }else{\n \tresult += (l * 3);\n }\n \n \t\t\t\t\t}\n \t\t\t\t}\n \t\t\t}\n \t\t}",
"for(int k = j; k <= a; k++)\n \t\t\t{\n \t\t\t\tboolean judge = true;\n \t\t\t\tfor(int l = i; l > 0 && judge; l--)\n \t\t\t\t{\n \t\t\t\t\tif(i % l == 0 && j % l == 0 && k % l == 0)\n \t\t\t\t\t{\n \t\t\t\t\t\tjudge = false;\n \t\t\t\t\t\tif(i == j && j == k)\n {\n \tresult += l; \n }else if(i != j && j != k && i != k){\n \tresult += (l * 6);\n }else{\n \tresult += (l * 3);\n }\n \n \t\t\t\t\t}\n \t\t\t\t}\n \t\t\t}",
"int k = j;",
"int k = j;",
"k",
"j",
"k <= a",
"k",
"a",
"k++",
"k++",
"k",
"{\n \t\t\t\tboolean judge = true;\n \t\t\t\tfor(int l = i; l > 0 && judge; l--)\n \t\t\t\t{\n \t\t\t\t\tif(i % l == 0 && j % l == 0 && k % l == 0)\n \t\t\t\t\t{\n \t\t\t\t\t\tjudge = false;\n \t\t\t\t\t\tif(i == j && j == k)\n {\n \tresult += l; \n }else if(i != j && j != k && i != k){\n \tresult += (l * 6);\n }else{\n \tresult += (l * 3);\n }\n \n \t\t\t\t\t}\n \t\t\t\t}\n \t\t\t}",
"{\n \t\t\t\tboolean judge = true;\n \t\t\t\tfor(int l = i; l > 0 && judge; l--)\n \t\t\t\t{\n \t\t\t\t\tif(i % l == 0 && j % l == 0 && k % l == 0)\n \t\t\t\t\t{\n \t\t\t\t\t\tjudge = false;\n \t\t\t\t\t\tif(i == j && j == k)\n {\n \tresult += l; \n }else if(i != j && j != k && i != k){\n \tresult += (l * 6);\n }else{\n \tresult += (l * 3);\n }\n \n \t\t\t\t\t}\n \t\t\t\t}\n \t\t\t}",
"boolean judge = true;",
"judge",
"true",
"for(int l = i; l > 0 && judge; l--)\n \t\t\t\t{\n \t\t\t\t\tif(i % l == 0 && j % l == 0 && k % l == 0)\n \t\t\t\t\t{\n \t\t\t\t\t\tjudge = false;\n \t\t\t\t\t\tif(i == j && j == k)\n {\n \tresult += l; \n }else if(i != j && j != k && i != k){\n \tresult += (l * 6);\n }else{\n \tresult += (l * 3);\n }\n \n \t\t\t\t\t}\n \t\t\t\t}",
"int l = i;",
"int l = i;",
"l",
"i",
"l > 0 && judge",
"l > 0",
"l",
"0",
"judge",
"l--",
"l--",
"l",
"{\n \t\t\t\t\tif(i % l == 0 && j % l == 0 && k % l == 0)\n \t\t\t\t\t{\n \t\t\t\t\t\tjudge = false;\n \t\t\t\t\t\tif(i == j && j == k)\n {\n \tresult += l; \n }else if(i != j && j != k && i != k){\n \tresult += (l * 6);\n }else{\n \tresult += (l * 3);\n }\n \n \t\t\t\t\t}\n \t\t\t\t}",
"{\n \t\t\t\t\tif(i % l == 0 && j % l == 0 && k % l == 0)\n \t\t\t\t\t{\n \t\t\t\t\t\tjudge = false;\n \t\t\t\t\t\tif(i == j && j == k)\n {\n \tresult += l; \n }else if(i != j && j != k && i != k){\n \tresult += (l * 6);\n }else{\n \tresult += (l * 3);\n }\n \n \t\t\t\t\t}\n \t\t\t\t}",
"if(i % l == 0 && j % l == 0 && k % l == 0)\n \t\t\t\t\t{\n \t\t\t\t\t\tjudge = false;\n \t\t\t\t\t\tif(i == j && j == k)\n {\n \tresult += l; \n }else if(i != j && j != k && i != k){\n \tresult += (l * 6);\n }else{\n \tresult += (l * 3);\n }\n \n \t\t\t\t\t}",
"i % l == 0 && j % l == 0 && k % l == 0",
"i % l == 0 && j % l == 0 && k % l == 0",
"i % l == 0",
"i % l",
"i",
"l",
"0",
"j % l == 0",
"j % l",
"j",
"l",
"0",
"k % l == 0",
"k % l",
"k",
"l",
"0",
"{\n \t\t\t\t\t\tjudge = false;\n \t\t\t\t\t\tif(i == j && j == k)\n {\n \tresult += l; \n }else if(i != j && j != k && i != k){\n \tresult += (l * 6);\n }else{\n \tresult += (l * 3);\n }\n \n \t\t\t\t\t}",
"judge = false",
"judge",
"false",
"if(i == j && j == k)\n {\n \tresult += l; \n }else if(i != j && j != k && i != k){\n \tresult += (l * 6);\n }else{\n \tresult += (l * 3);\n }",
"i == j && j == k",
"i == j",
"i",
"j",
"j == k",
"j",
"k",
"{\n \tresult += l; \n }",
"result += l",
"result",
"l",
"if(i != j && j != k && i != k){\n \tresult += (l * 6);\n }else{\n \tresult += (l * 3);\n }",
"i != j && j != k && i != k",
"i != j && j != k && i != k",
"i != j",
"i",
"j",
"j != k",
"j",
"k",
"i != k",
"i",
"k",
"{\n \tresult += (l * 6);\n }",
"result += (l * 6)",
"result",
"(l * 6)",
"l",
"6",
"{\n \tresult += (l * 3);\n }",
"result += (l * 3)",
"result",
"(l * 3)",
"l",
"3",
"System.out.println(result)",
"System.out.println",
"System.out",
"System",
"System.out",
"result",
"String[] args",
"args",
"public class Main\n{\n \tpublic static void main(String[] args)\n {\n \tScanner sc = new Scanner(System.in);\n \tint a = sc.nextInt();\n \tlong result = 0;\n \tfor(int i = 1; i <= a; i++)\n \t{\n \t\tfor(int j = i; j <= a; j++)\n \t\t{\n \t\t\tfor(int k = j; k <= a; k++)\n \t\t\t{\n \t\t\t\tboolean judge = true;\n \t\t\t\tfor(int l = i; l > 0 && judge; l--)\n \t\t\t\t{\n \t\t\t\t\tif(i % l == 0 && j % l == 0 && k % l == 0)\n \t\t\t\t\t{\n \t\t\t\t\t\tjudge = false;\n \t\t\t\t\t\tif(i == j && j == k)\n {\n \tresult += l; \n }else if(i != j && j != k && i != k){\n \tresult += (l * 6);\n }else{\n \tresult += (l * 3);\n }\n \n \t\t\t\t\t}\n \t\t\t\t}\n \t\t\t}\n \t\t}\n \t}\n \t\n \tSystem.out.println(result);\n }\n}",
"public class Main\n{\n \tpublic static void main(String[] args)\n {\n \tScanner sc = new Scanner(System.in);\n \tint a = sc.nextInt();\n \tlong result = 0;\n \tfor(int i = 1; i <= a; i++)\n \t{\n \t\tfor(int j = i; j <= a; j++)\n \t\t{\n \t\t\tfor(int k = j; k <= a; k++)\n \t\t\t{\n \t\t\t\tboolean judge = true;\n \t\t\t\tfor(int l = i; l > 0 && judge; l--)\n \t\t\t\t{\n \t\t\t\t\tif(i % l == 0 && j % l == 0 && k % l == 0)\n \t\t\t\t\t{\n \t\t\t\t\t\tjudge = false;\n \t\t\t\t\t\tif(i == j && j == k)\n {\n \tresult += l; \n }else if(i != j && j != k && i != k){\n \tresult += (l * 6);\n }else{\n \tresult += (l * 3);\n }\n \n \t\t\t\t\t}\n \t\t\t\t}\n \t\t\t}\n \t\t}\n \t}\n \t\n \tSystem.out.println(result);\n }\n}",
"Main"
] |
import java.util.Scanner;
public class Main
{
public static void main(String[] args)
{
Scanner sc = new Scanner(System.in);
int a = sc.nextInt();
long result = 0;
for(int i = 1; i <= a; i++)
{
for(int j = i; j <= a; j++)
{
for(int k = j; k <= a; k++)
{
boolean judge = true;
for(int l = i; l > 0 && judge; l--)
{
if(i % l == 0 && j % l == 0 && k % l == 0)
{
judge = false;
if(i == j && j == k)
{
result += l;
}else if(i != j && j != k && i != k){
result += (l * 6);
}else{
result += (l * 3);
}
}
}
}
}
}
System.out.println(result);
}
}
|
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
14,
2,
2,
13,
13,
17,
30,
29,
13,
29,
4,
13,
13,
2,
13,
13,
23,
13,
23,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
4,
18,
13,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
4,
13,
4,
13,
13,
13,
13,
4,
18,
18,
13,
13,
13,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
103,
5
],
[
103,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
10,
11
],
[
11,
12
],
[
11,
13
],
[
10,
14
],
[
9,
15
],
[
15,
16
],
[
16,
17
],
[
8,
18
],
[
18,
19
],
[
19,
20
],
[
19,
21
],
[
19,
22
],
[
22,
23
],
[
22,
24
],
[
6,
25
],
[
25,
26
],
[
6,
27
],
[
27,
28
],
[
103,
29
],
[
29,
30
],
[
29,
31
],
[
31,
32
],
[
32,
33
],
[
32,
34
],
[
31,
35
],
[
35,
36
],
[
35,
37
],
[
37,
38
],
[
38,
39
],
[
37,
40
],
[
40,
41
],
[
41,
42
],
[
31,
43
],
[
43,
44
],
[
43,
45
],
[
31,
46
],
[
46,
47
],
[
47,
48
],
[
48,
49
],
[
48,
50
],
[
46,
51
],
[
51,
52
],
[
51,
53
],
[
46,
54
],
[
54,
55
],
[
55,
56
],
[
46,
57
],
[
58,
58
],
[
58,
59
],
[
59,
60
],
[
60,
61
],
[
61,
62
],
[
61,
63
],
[
59,
64
],
[
64,
65
],
[
64,
66
],
[
59,
67
],
[
67,
68
],
[
68,
69
],
[
59,
70
],
[
71,
71
],
[
71,
72
],
[
72,
73
],
[
73,
74
],
[
74,
75
],
[
74,
76
],
[
72,
77
],
[
77,
78
],
[
77,
79
],
[
72,
80
],
[
80,
81
],
[
81,
82
],
[
72,
83
],
[
84,
84
],
[
84,
85
],
[
85,
86
],
[
85,
87
],
[
87,
88
],
[
87,
89
],
[
89,
90
],
[
89,
91
],
[
89,
92
],
[
87,
93
],
[
31,
94
],
[
94,
95
],
[
95,
96
],
[
96,
97
],
[
96,
98
],
[
94,
99
],
[
29,
100
],
[
100,
101
],
[
0,
102
],
[
102,
103
],
[
102,
104
]
] |
[
"import java.util.Scanner;\n\npublic class Main {\n public static int gcd(int x, int y) {\n \tif (x % y == 0) {\n return y;\n }\n return gcd(y, x % y);\n }\n \n public static void main(String[] args) {\n Scanner input = new Scanner(System.in);\n int num = Integer.parseInt(input.nextLine());\n long sum = 0;\n \n // System.out.println(gcd(390, 273));\n \n for (int i = 1; i <= num; i++) {\n for (int j = 1; j <= num; j++) {\n for (int k = 1; k <= num; k++) {\n sum += gcd(gcd(i,j),k);\n }\n }\n }\n \n System.out.print(sum);\n }\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n public static int gcd(int x, int y) {\n \tif (x % y == 0) {\n return y;\n }\n return gcd(y, x % y);\n }\n \n public static void main(String[] args) {\n Scanner input = new Scanner(System.in);\n int num = Integer.parseInt(input.nextLine());\n long sum = 0;\n \n // System.out.println(gcd(390, 273));\n \n for (int i = 1; i <= num; i++) {\n for (int j = 1; j <= num; j++) {\n for (int k = 1; k <= num; k++) {\n sum += gcd(gcd(i,j),k);\n }\n }\n }\n \n System.out.print(sum);\n }\n}",
"Main",
"public static int gcd(int x, int y) {\n \tif (x % y == 0) {\n return y;\n }\n return gcd(y, x % y);\n }",
"gcd",
"{\n \tif (x % y == 0) {\n return y;\n }\n return gcd(y, x % y);\n }",
"if (x % y == 0) {\n return y;\n }",
"x % y == 0",
"x % y",
"x",
"y",
"0",
"{\n return y;\n }",
"return y;",
"y",
"return gcd(y, x % y);",
"gcd(y, x % y)",
"gcd",
"y",
"x % y",
"x",
"y",
"int x",
"x",
"int y",
"y",
"public static void main(String[] args) {\n Scanner input = new Scanner(System.in);\n int num = Integer.parseInt(input.nextLine());\n long sum = 0;\n \n // System.out.println(gcd(390, 273));\n \n for (int i = 1; i <= num; i++) {\n for (int j = 1; j <= num; j++) {\n for (int k = 1; k <= num; k++) {\n sum += gcd(gcd(i,j),k);\n }\n }\n }\n \n System.out.print(sum);\n }",
"main",
"{\n Scanner input = new Scanner(System.in);\n int num = Integer.parseInt(input.nextLine());\n long sum = 0;\n \n // System.out.println(gcd(390, 273));\n \n for (int i = 1; i <= num; i++) {\n for (int j = 1; j <= num; j++) {\n for (int k = 1; k <= num; k++) {\n sum += gcd(gcd(i,j),k);\n }\n }\n }\n \n System.out.print(sum);\n }",
"Scanner input = new Scanner(System.in);",
"input",
"new Scanner(System.in)",
"int num = Integer.parseInt(input.nextLine());",
"num",
"Integer.parseInt(input.nextLine())",
"Integer.parseInt",
"Integer",
"input.nextLine()",
"input.nextLine",
"input",
"long sum = 0;",
"sum",
"0",
"for (int i = 1; i <= num; i++) {\n for (int j = 1; j <= num; j++) {\n for (int k = 1; k <= num; k++) {\n sum += gcd(gcd(i,j),k);\n }\n }\n }",
"int i = 1;",
"int i = 1;",
"i",
"1",
"i <= num",
"i",
"num",
"i++",
"i++",
"i",
"{\n for (int j = 1; j <= num; j++) {\n for (int k = 1; k <= num; k++) {\n sum += gcd(gcd(i,j),k);\n }\n }\n }",
"{\n for (int j = 1; j <= num; j++) {\n for (int k = 1; k <= num; k++) {\n sum += gcd(gcd(i,j),k);\n }\n }\n }",
"for (int j = 1; j <= num; j++) {\n for (int k = 1; k <= num; k++) {\n sum += gcd(gcd(i,j),k);\n }\n }",
"int j = 1;",
"int j = 1;",
"j",
"1",
"j <= num",
"j",
"num",
"j++",
"j++",
"j",
"{\n for (int k = 1; k <= num; k++) {\n sum += gcd(gcd(i,j),k);\n }\n }",
"{\n for (int k = 1; k <= num; k++) {\n sum += gcd(gcd(i,j),k);\n }\n }",
"for (int k = 1; k <= num; k++) {\n sum += gcd(gcd(i,j),k);\n }",
"int k = 1;",
"int k = 1;",
"k",
"1",
"k <= num",
"k",
"num",
"k++",
"k++",
"k",
"{\n sum += gcd(gcd(i,j),k);\n }",
"{\n sum += gcd(gcd(i,j),k);\n }",
"sum += gcd(gcd(i,j),k)",
"sum",
"gcd(gcd(i,j),k)",
"gcd",
"gcd(i,j)",
"gcd",
"i",
"j",
"k",
"System.out.print(sum)",
"System.out.print",
"System.out",
"System",
"System.out",
"sum",
"String[] args",
"args",
"public class Main {\n public static int gcd(int x, int y) {\n \tif (x % y == 0) {\n return y;\n }\n return gcd(y, x % y);\n }\n \n public static void main(String[] args) {\n Scanner input = new Scanner(System.in);\n int num = Integer.parseInt(input.nextLine());\n long sum = 0;\n \n // System.out.println(gcd(390, 273));\n \n for (int i = 1; i <= num; i++) {\n for (int j = 1; j <= num; j++) {\n for (int k = 1; k <= num; k++) {\n sum += gcd(gcd(i,j),k);\n }\n }\n }\n \n System.out.print(sum);\n }\n}",
"public class Main {\n public static int gcd(int x, int y) {\n \tif (x % y == 0) {\n return y;\n }\n return gcd(y, x % y);\n }\n \n public static void main(String[] args) {\n Scanner input = new Scanner(System.in);\n int num = Integer.parseInt(input.nextLine());\n long sum = 0;\n \n // System.out.println(gcd(390, 273));\n \n for (int i = 1; i <= num; i++) {\n for (int j = 1; j <= num; j++) {\n for (int k = 1; k <= num; k++) {\n sum += gcd(gcd(i,j),k);\n }\n }\n }\n \n System.out.print(sum);\n }\n}",
"Main"
] |
import java.util.Scanner;
public class Main {
public static int gcd(int x, int y) {
if (x % y == 0) {
return y;
}
return gcd(y, x % y);
}
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
int num = Integer.parseInt(input.nextLine());
long sum = 0;
// System.out.println(gcd(390, 273));
for (int i = 1; i <= num; i++) {
for (int j = 1; j <= num; j++) {
for (int k = 1; k <= num; k++) {
sum += gcd(gcd(i,j),k);
}
}
}
System.out.print(sum);
}
}
|
[
7,
15,
13,
17,
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,
18,
13,
13,
41,
13,
18,
13,
13,
41,
13,
20,
41,
13,
20,
4,
18,
20,
13,
13,
4,
18,
13,
23,
13,
6,
13,
12,
13,
30,
41,
13,
4,
18,
13,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
0,
13,
4,
13,
4,
13,
13,
13,
13,
4,
18,
13,
13,
23,
13,
23,
13,
12,
13,
30,
42,
2,
13,
17,
30,
41,
13,
2,
13,
13,
0,
13,
13,
0,
13,
13,
29,
13,
23,
13,
23,
13,
6,
13,
41,
13,
41,
13,
12,
13,
30,
0,
13,
20,
0,
13,
17,
23,
13,
12,
13,
30,
42,
2,
2,
13,
17,
40,
4,
18,
13,
30,
38,
5,
13,
30,
37,
20,
30,
0,
13,
20,
29,
4,
18,
13,
12,
13,
30,
29,
4,
18,
13,
4,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
10,
11
],
[
10,
12
],
[
0,
13
],
[
13,
14
],
[
13,
15
],
[
0,
16
],
[
16,
17
],
[
16,
18
],
[
0,
19
],
[
19,
20
],
[
19,
21
],
[
0,
22
],
[
198,
23
],
[
198,
24
],
[
24,
25
],
[
24,
26
],
[
26,
27
],
[
27,
28
],
[
27,
29
],
[
29,
30
],
[
29,
31
],
[
26,
32
],
[
32,
33
],
[
32,
34
],
[
34,
35
],
[
34,
36
],
[
26,
37
],
[
37,
38
],
[
37,
39
],
[
26,
40
],
[
40,
41
],
[
40,
42
],
[
26,
43
],
[
43,
44
],
[
44,
45
],
[
43,
46
],
[
43,
47
],
[
26,
48
],
[
48,
49
],
[
49,
50
],
[
24,
51
],
[
51,
52
],
[
198,
53
],
[
53,
54
],
[
53,
55
],
[
55,
56
],
[
55,
57
],
[
57,
58
],
[
58,
59
],
[
58,
60
],
[
60,
61
],
[
61,
62
],
[
57,
63
],
[
63,
64
],
[
63,
65
],
[
57,
66
],
[
66,
67
],
[
67,
68
],
[
68,
69
],
[
68,
70
],
[
66,
71
],
[
71,
72
],
[
71,
73
],
[
66,
74
],
[
74,
75
],
[
75,
76
],
[
66,
77
],
[
77,
78
],
[
78,
79
],
[
79,
80
],
[
80,
81
],
[
80,
82
],
[
78,
83
],
[
83,
84
],
[
83,
85
],
[
78,
86
],
[
86,
87
],
[
87,
88
],
[
78,
89
],
[
89,
90
],
[
90,
91
],
[
91,
92
],
[
92,
93
],
[
92,
94
],
[
90,
95
],
[
95,
96
],
[
95,
97
],
[
90,
98
],
[
98,
99
],
[
99,
100
],
[
90,
101
],
[
101,
102
],
[
102,
103
],
[
102,
104
],
[
104,
105
],
[
104,
106
],
[
106,
107
],
[
106,
108
],
[
106,
109
],
[
104,
110
],
[
57,
111
],
[
111,
112
],
[
112,
113
],
[
111,
114
],
[
55,
115
],
[
115,
116
],
[
55,
117
],
[
117,
118
],
[
53,
119
],
[
119,
120
],
[
119,
121
],
[
121,
122
],
[
122,
123
],
[
123,
124
],
[
123,
125
],
[
122,
126
],
[
126,
127
],
[
127,
128
],
[
127,
129
],
[
129,
130
],
[
129,
131
],
[
126,
132
],
[
132,
133
],
[
132,
134
],
[
126,
135
],
[
135,
136
],
[
135,
137
],
[
121,
138
],
[
138,
139
],
[
119,
140
],
[
140,
141
],
[
119,
142
],
[
142,
143
],
[
198,
144
],
[
144,
145
],
[
144,
146
],
[
146,
147
],
[
144,
148
],
[
148,
149
],
[
144,
150
],
[
150,
151
],
[
150,
152
],
[
152,
153
],
[
153,
154
],
[
153,
155
],
[
152,
156
],
[
156,
157
],
[
156,
158
],
[
150,
159
],
[
159,
160
],
[
144,
161
],
[
161,
162
],
[
161,
163
],
[
163,
164
],
[
164,
165
],
[
165,
166
],
[
166,
167
],
[
166,
168
],
[
165,
169
],
[
169,
170
],
[
170,
171
],
[
171,
172
],
[
164,
173
],
[
173,
174
],
[
174,
175
],
[
175,
176
],
[
175,
177
],
[
177,
178
],
[
178,
179
],
[
174,
180
],
[
180,
181
],
[
181,
182
],
[
181,
183
],
[
163,
184
],
[
184,
185
],
[
185,
186
],
[
186,
187
],
[
144,
188
],
[
188,
189
],
[
188,
190
],
[
190,
191
],
[
191,
192
],
[
192,
193
],
[
193,
194
],
[
192,
195
],
[
195,
196
],
[
0,
197
],
[
197,
198
],
[
197,
199
]
] |
[
"import java.io.BufferedReader;\nimport java.io.IOException;\nimport java.io.InputStream;\nimport java.io.InputStreamReader;\nimport java.io.OutputStream;\nimport java.io.PrintWriter;\nimport java.util.StringTokenizer;\n\npublic class Main {\n\t\n\tpublic static void main(String[] args) {\n\t\tInputStream inputStream = System.in;\n\t\tOutputStream outputStream = System.out;\n\t\tInputReader in = new InputReader(inputStream);\n\t\tPrintWriter out = new PrintWriter(outputStream);\n\t\tnew Solution().solve(in, out);\n\t\tout.close();\n\t}\n\n\tprivate static class Solution {\n\t\tprivate void solve(InputReader in, PrintWriter out) {\n\t\t\tint k = in.nextInt();\n\t\t\tlong ans = 0;\n\t\t\tfor (int a = 1; a <= k; ++a)\n\t\t\t\tfor (int b = 1; b <= k; ++b)\n\t\t\t\t\tfor (int c = 1; c <= k; ++c)\n\t\t\t\t\t\tans += gcd(gcd(a, b), c);\n\t\t\tout.println(ans);\n\t\t}\n\t\t\n\t\tprivate long gcd(long a, long b) {\n\t\t\twhile (b != 0) {\n\t\t\t\tlong m = a % b;\n\t\t\t\ta = b;\n\t\t\t\tb = m;\n\t\t\t}\n\t\t\treturn a;\n\t\t}\n\t}\n\t\n\n\tprivate static class InputReader {\n\t\tpublic BufferedReader reader;\n\t\tpublic StringTokenizer tokenizer;\n\n\t\tpublic InputReader(InputStream stream) {\n\t\t\treader = new BufferedReader(new InputStreamReader(stream), 32678);\n\t\t\ttokenizer = null;\n\t\t}\n\n\t\tpublic String next() {\n\t\t\twhile (tokenizer == null || !tokenizer.hasMoreTokens()) {\n\t\t\t\ttry {\n\t\t\t\t\ttokenizer = new StringTokenizer(reader.readLine());\n\t\t\t\t} catch (IOException e) {\n\t\t\t\t\tthrow new RuntimeException(e);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn tokenizer.nextToken();\n\t\t}\n\t\t\n\t\tprivate int nextInt() {\n\t\t\treturn Integer.parseInt(next());\n\t\t}\n\t}\n\n}",
"import java.io.BufferedReader;",
"BufferedReader",
"java.io",
"import java.io.IOException;",
"IOException",
"java.io",
"import java.io.InputStream;",
"InputStream",
"java.io",
"import java.io.InputStreamReader;",
"InputStreamReader",
"java.io",
"import java.io.OutputStream;",
"OutputStream",
"java.io",
"import java.io.PrintWriter;",
"PrintWriter",
"java.io",
"import java.util.StringTokenizer;",
"StringTokenizer",
"java.util",
"public class Main {\n\t\n\tpublic static void main(String[] args) {\n\t\tInputStream inputStream = System.in;\n\t\tOutputStream outputStream = System.out;\n\t\tInputReader in = new InputReader(inputStream);\n\t\tPrintWriter out = new PrintWriter(outputStream);\n\t\tnew Solution().solve(in, out);\n\t\tout.close();\n\t}\n\n\tprivate static class Solution {\n\t\tprivate void solve(InputReader in, PrintWriter out) {\n\t\t\tint k = in.nextInt();\n\t\t\tlong ans = 0;\n\t\t\tfor (int a = 1; a <= k; ++a)\n\t\t\t\tfor (int b = 1; b <= k; ++b)\n\t\t\t\t\tfor (int c = 1; c <= k; ++c)\n\t\t\t\t\t\tans += gcd(gcd(a, b), c);\n\t\t\tout.println(ans);\n\t\t}\n\t\t\n\t\tprivate long gcd(long a, long b) {\n\t\t\twhile (b != 0) {\n\t\t\t\tlong m = a % b;\n\t\t\t\ta = b;\n\t\t\t\tb = m;\n\t\t\t}\n\t\t\treturn a;\n\t\t}\n\t}\n\t\n\n\tprivate static class InputReader {\n\t\tpublic BufferedReader reader;\n\t\tpublic StringTokenizer tokenizer;\n\n\t\tpublic InputReader(InputStream stream) {\n\t\t\treader = new BufferedReader(new InputStreamReader(stream), 32678);\n\t\t\ttokenizer = null;\n\t\t}\n\n\t\tpublic String next() {\n\t\t\twhile (tokenizer == null || !tokenizer.hasMoreTokens()) {\n\t\t\t\ttry {\n\t\t\t\t\ttokenizer = new StringTokenizer(reader.readLine());\n\t\t\t\t} catch (IOException e) {\n\t\t\t\t\tthrow new RuntimeException(e);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn tokenizer.nextToken();\n\t\t}\n\t\t\n\t\tprivate int nextInt() {\n\t\t\treturn Integer.parseInt(next());\n\t\t}\n\t}\n\n}",
"Main",
"public static void main(String[] args) {\n\t\tInputStream inputStream = System.in;\n\t\tOutputStream outputStream = System.out;\n\t\tInputReader in = new InputReader(inputStream);\n\t\tPrintWriter out = new PrintWriter(outputStream);\n\t\tnew Solution().solve(in, out);\n\t\tout.close();\n\t}",
"main",
"{\n\t\tInputStream inputStream = System.in;\n\t\tOutputStream outputStream = System.out;\n\t\tInputReader in = new InputReader(inputStream);\n\t\tPrintWriter out = new PrintWriter(outputStream);\n\t\tnew Solution().solve(in, out);\n\t\tout.close();\n\t}",
"InputStream inputStream = System.in;",
"inputStream",
"System.in",
"System",
"System.in",
"OutputStream outputStream = System.out;",
"outputStream",
"System.out",
"System",
"System.out",
"InputReader in = new InputReader(inputStream);",
"in",
"new InputReader(inputStream)",
"PrintWriter out = new PrintWriter(outputStream);",
"out",
"new PrintWriter(outputStream)",
"new Solution().solve(in, out)",
"new Solution().solve",
"new Solution()",
"in",
"out",
"out.close()",
"out.close",
"out",
"String[] args",
"args",
"private static class Solution {\n\t\tprivate void solve(InputReader in, PrintWriter out) {\n\t\t\tint k = in.nextInt();\n\t\t\tlong ans = 0;\n\t\t\tfor (int a = 1; a <= k; ++a)\n\t\t\t\tfor (int b = 1; b <= k; ++b)\n\t\t\t\t\tfor (int c = 1; c <= k; ++c)\n\t\t\t\t\t\tans += gcd(gcd(a, b), c);\n\t\t\tout.println(ans);\n\t\t}\n\t\t\n\t\tprivate long gcd(long a, long b) {\n\t\t\twhile (b != 0) {\n\t\t\t\tlong m = a % b;\n\t\t\t\ta = b;\n\t\t\t\tb = m;\n\t\t\t}\n\t\t\treturn a;\n\t\t}\n\t}",
"Solution",
"private void solve(InputReader in, PrintWriter out) {\n\t\t\tint k = in.nextInt();\n\t\t\tlong ans = 0;\n\t\t\tfor (int a = 1; a <= k; ++a)\n\t\t\t\tfor (int b = 1; b <= k; ++b)\n\t\t\t\t\tfor (int c = 1; c <= k; ++c)\n\t\t\t\t\t\tans += gcd(gcd(a, b), c);\n\t\t\tout.println(ans);\n\t\t}",
"solve",
"{\n\t\t\tint k = in.nextInt();\n\t\t\tlong ans = 0;\n\t\t\tfor (int a = 1; a <= k; ++a)\n\t\t\t\tfor (int b = 1; b <= k; ++b)\n\t\t\t\t\tfor (int c = 1; c <= k; ++c)\n\t\t\t\t\t\tans += gcd(gcd(a, b), c);\n\t\t\tout.println(ans);\n\t\t}",
"int k = in.nextInt();",
"k",
"in.nextInt()",
"in.nextInt",
"in",
"long ans = 0;",
"ans",
"0",
"for (int a = 1; a <= k; ++a)\n\t\t\t\tfor (int b = 1; b <= k; ++b)\n\t\t\t\t\tfor (int c = 1; c <= k; ++c)\n\t\t\t\t\t\tans += gcd(gcd(a, b), c);",
"int a = 1;",
"int a = 1;",
"a",
"1",
"a <= k",
"a",
"k",
"++a",
"++a",
"a",
"for (int b = 1; b <= k; ++b)\n\t\t\t\t\tfor (int c = 1; c <= k; ++c)\n\t\t\t\t\t\tans += gcd(gcd(a, b), c);",
"for (int b = 1; b <= k; ++b)\n\t\t\t\t\tfor (int c = 1; c <= k; ++c)\n\t\t\t\t\t\tans += gcd(gcd(a, b), c);",
"int b = 1;",
"int b = 1;",
"b",
"1",
"b <= k",
"b",
"k",
"++b",
"++b",
"b",
"for (int c = 1; c <= k; ++c)\n\t\t\t\t\t\tans += gcd(gcd(a, b), c);",
"for (int c = 1; c <= k; ++c)\n\t\t\t\t\t\tans += gcd(gcd(a, b), c);",
"int c = 1;",
"int c = 1;",
"c",
"1",
"c <= k",
"c",
"k",
"++c",
"++c",
"c",
"ans += gcd(gcd(a, b), c);",
"ans += gcd(gcd(a, b), c)",
"ans",
"gcd(gcd(a, b), c)",
"gcd",
"gcd(a, b)",
"gcd",
"a",
"b",
"c",
"out.println(ans)",
"out.println",
"out",
"ans",
"InputReader in",
"in",
"PrintWriter out",
"out",
"private long gcd(long a, long b) {\n\t\t\twhile (b != 0) {\n\t\t\t\tlong m = a % b;\n\t\t\t\ta = b;\n\t\t\t\tb = m;\n\t\t\t}\n\t\t\treturn a;\n\t\t}",
"gcd",
"{\n\t\t\twhile (b != 0) {\n\t\t\t\tlong m = a % b;\n\t\t\t\ta = b;\n\t\t\t\tb = m;\n\t\t\t}\n\t\t\treturn a;\n\t\t}",
"while (b != 0) {\n\t\t\t\tlong m = a % b;\n\t\t\t\ta = b;\n\t\t\t\tb = m;\n\t\t\t}",
"b != 0",
"b",
"0",
"{\n\t\t\t\tlong m = a % b;\n\t\t\t\ta = b;\n\t\t\t\tb = m;\n\t\t\t}",
"long m = a % b;",
"m",
"a % b",
"a",
"b",
"a = b",
"a",
"b",
"b = m",
"b",
"m",
"return a;",
"a",
"long a",
"a",
"long b",
"b",
"private static class InputReader {\n\t\tpublic BufferedReader reader;\n\t\tpublic StringTokenizer tokenizer;\n\n\t\tpublic InputReader(InputStream stream) {\n\t\t\treader = new BufferedReader(new InputStreamReader(stream), 32678);\n\t\t\ttokenizer = null;\n\t\t}\n\n\t\tpublic String next() {\n\t\t\twhile (tokenizer == null || !tokenizer.hasMoreTokens()) {\n\t\t\t\ttry {\n\t\t\t\t\ttokenizer = new StringTokenizer(reader.readLine());\n\t\t\t\t} catch (IOException e) {\n\t\t\t\t\tthrow new RuntimeException(e);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn tokenizer.nextToken();\n\t\t}\n\t\t\n\t\tprivate int nextInt() {\n\t\t\treturn Integer.parseInt(next());\n\t\t}\n\t}",
"InputReader",
"public BufferedReader reader;",
"reader",
"public StringTokenizer tokenizer;",
"tokenizer",
"public InputReader(InputStream stream) {\n\t\t\treader = new BufferedReader(new InputStreamReader(stream), 32678);\n\t\t\ttokenizer = null;\n\t\t}",
"InputReader",
"{\n\t\t\treader = new BufferedReader(new InputStreamReader(stream), 32678);\n\t\t\ttokenizer = null;\n\t\t}",
"reader = new BufferedReader(new InputStreamReader(stream), 32678)",
"reader",
"new BufferedReader(new InputStreamReader(stream), 32678)",
"tokenizer = null",
"tokenizer",
"null",
"InputStream stream",
"stream",
"public String next() {\n\t\t\twhile (tokenizer == null || !tokenizer.hasMoreTokens()) {\n\t\t\t\ttry {\n\t\t\t\t\ttokenizer = new StringTokenizer(reader.readLine());\n\t\t\t\t} catch (IOException e) {\n\t\t\t\t\tthrow new RuntimeException(e);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn tokenizer.nextToken();\n\t\t}",
"next",
"{\n\t\t\twhile (tokenizer == null || !tokenizer.hasMoreTokens()) {\n\t\t\t\ttry {\n\t\t\t\t\ttokenizer = new StringTokenizer(reader.readLine());\n\t\t\t\t} catch (IOException e) {\n\t\t\t\t\tthrow new RuntimeException(e);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn tokenizer.nextToken();\n\t\t}",
"while (tokenizer == null || !tokenizer.hasMoreTokens()) {\n\t\t\t\ttry {\n\t\t\t\t\ttokenizer = new StringTokenizer(reader.readLine());\n\t\t\t\t} catch (IOException e) {\n\t\t\t\t\tthrow new RuntimeException(e);\n\t\t\t\t}\n\t\t\t}",
"tokenizer == null || !tokenizer.hasMoreTokens()",
"tokenizer == null",
"tokenizer",
"null",
"!tokenizer.hasMoreTokens()",
"tokenizer.hasMoreTokens()",
"tokenizer.hasMoreTokens",
"tokenizer",
"{\n\t\t\t\ttry {\n\t\t\t\t\ttokenizer = new StringTokenizer(reader.readLine());\n\t\t\t\t} catch (IOException e) {\n\t\t\t\t\tthrow new RuntimeException(e);\n\t\t\t\t}\n\t\t\t}",
"try {\n\t\t\t\t\ttokenizer = new StringTokenizer(reader.readLine());\n\t\t\t\t} catch (IOException e) {\n\t\t\t\t\tthrow new RuntimeException(e);\n\t\t\t\t}",
"catch (IOException e) {\n\t\t\t\t\tthrow new RuntimeException(e);\n\t\t\t\t}",
"IOException e",
"{\n\t\t\t\t\tthrow new RuntimeException(e);\n\t\t\t\t}",
"throw new RuntimeException(e);",
"new RuntimeException(e)",
"{\n\t\t\t\t\ttokenizer = new StringTokenizer(reader.readLine());\n\t\t\t\t}",
"tokenizer = new StringTokenizer(reader.readLine())",
"tokenizer",
"new StringTokenizer(reader.readLine())",
"return tokenizer.nextToken();",
"tokenizer.nextToken()",
"tokenizer.nextToken",
"tokenizer",
"private int nextInt() {\n\t\t\treturn Integer.parseInt(next());\n\t\t}",
"nextInt",
"{\n\t\t\treturn Integer.parseInt(next());\n\t\t}",
"return Integer.parseInt(next());",
"Integer.parseInt(next())",
"Integer.parseInt",
"Integer",
"next()",
"next",
"public class Main {\n\t\n\tpublic static void main(String[] args) {\n\t\tInputStream inputStream = System.in;\n\t\tOutputStream outputStream = System.out;\n\t\tInputReader in = new InputReader(inputStream);\n\t\tPrintWriter out = new PrintWriter(outputStream);\n\t\tnew Solution().solve(in, out);\n\t\tout.close();\n\t}\n\n\tprivate static class Solution {\n\t\tprivate void solve(InputReader in, PrintWriter out) {\n\t\t\tint k = in.nextInt();\n\t\t\tlong ans = 0;\n\t\t\tfor (int a = 1; a <= k; ++a)\n\t\t\t\tfor (int b = 1; b <= k; ++b)\n\t\t\t\t\tfor (int c = 1; c <= k; ++c)\n\t\t\t\t\t\tans += gcd(gcd(a, b), c);\n\t\t\tout.println(ans);\n\t\t}\n\t\t\n\t\tprivate long gcd(long a, long b) {\n\t\t\twhile (b != 0) {\n\t\t\t\tlong m = a % b;\n\t\t\t\ta = b;\n\t\t\t\tb = m;\n\t\t\t}\n\t\t\treturn a;\n\t\t}\n\t}\n\t\n\n\tprivate static class InputReader {\n\t\tpublic BufferedReader reader;\n\t\tpublic StringTokenizer tokenizer;\n\n\t\tpublic InputReader(InputStream stream) {\n\t\t\treader = new BufferedReader(new InputStreamReader(stream), 32678);\n\t\t\ttokenizer = null;\n\t\t}\n\n\t\tpublic String next() {\n\t\t\twhile (tokenizer == null || !tokenizer.hasMoreTokens()) {\n\t\t\t\ttry {\n\t\t\t\t\ttokenizer = new StringTokenizer(reader.readLine());\n\t\t\t\t} catch (IOException e) {\n\t\t\t\t\tthrow new RuntimeException(e);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn tokenizer.nextToken();\n\t\t}\n\t\t\n\t\tprivate int nextInt() {\n\t\t\treturn Integer.parseInt(next());\n\t\t}\n\t}\n\n}",
"public class Main {\n\t\n\tpublic static void main(String[] args) {\n\t\tInputStream inputStream = System.in;\n\t\tOutputStream outputStream = System.out;\n\t\tInputReader in = new InputReader(inputStream);\n\t\tPrintWriter out = new PrintWriter(outputStream);\n\t\tnew Solution().solve(in, out);\n\t\tout.close();\n\t}\n\n\tprivate static class Solution {\n\t\tprivate void solve(InputReader in, PrintWriter out) {\n\t\t\tint k = in.nextInt();\n\t\t\tlong ans = 0;\n\t\t\tfor (int a = 1; a <= k; ++a)\n\t\t\t\tfor (int b = 1; b <= k; ++b)\n\t\t\t\t\tfor (int c = 1; c <= k; ++c)\n\t\t\t\t\t\tans += gcd(gcd(a, b), c);\n\t\t\tout.println(ans);\n\t\t}\n\t\t\n\t\tprivate long gcd(long a, long b) {\n\t\t\twhile (b != 0) {\n\t\t\t\tlong m = a % b;\n\t\t\t\ta = b;\n\t\t\t\tb = m;\n\t\t\t}\n\t\t\treturn a;\n\t\t}\n\t}\n\t\n\n\tprivate static class InputReader {\n\t\tpublic BufferedReader reader;\n\t\tpublic StringTokenizer tokenizer;\n\n\t\tpublic InputReader(InputStream stream) {\n\t\t\treader = new BufferedReader(new InputStreamReader(stream), 32678);\n\t\t\ttokenizer = null;\n\t\t}\n\n\t\tpublic String next() {\n\t\t\twhile (tokenizer == null || !tokenizer.hasMoreTokens()) {\n\t\t\t\ttry {\n\t\t\t\t\ttokenizer = new StringTokenizer(reader.readLine());\n\t\t\t\t} catch (IOException e) {\n\t\t\t\t\tthrow new RuntimeException(e);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn tokenizer.nextToken();\n\t\t}\n\t\t\n\t\tprivate int nextInt() {\n\t\t\treturn Integer.parseInt(next());\n\t\t}\n\t}\n\n}",
"Main"
] |
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.util.StringTokenizer;
public class Main {
public static void main(String[] args) {
InputStream inputStream = System.in;
OutputStream outputStream = System.out;
InputReader in = new InputReader(inputStream);
PrintWriter out = new PrintWriter(outputStream);
new Solution().solve(in, out);
out.close();
}
private static class Solution {
private void solve(InputReader in, PrintWriter out) {
int k = in.nextInt();
long ans = 0;
for (int a = 1; a <= k; ++a)
for (int b = 1; b <= k; ++b)
for (int c = 1; c <= k; ++c)
ans += gcd(gcd(a, b), c);
out.println(ans);
}
private long gcd(long a, long b) {
while (b != 0) {
long m = a % b;
a = b;
b = m;
}
return a;
}
}
private static class InputReader {
public BufferedReader reader;
public StringTokenizer tokenizer;
public InputReader(InputStream stream) {
reader = new BufferedReader(new InputStreamReader(stream), 32678);
tokenizer = null;
}
public String next() {
while (tokenizer == null || !tokenizer.hasMoreTokens()) {
try {
tokenizer = new StringTokenizer(reader.readLine());
} catch (IOException e) {
throw new RuntimeException(e);
}
}
return tokenizer.nextToken();
}
private int nextInt() {
return Integer.parseInt(next());
}
}
}
|
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
41,
13,
13,
41,
13,
13,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
17,
1,
40,
13,
30,
30,
41,
13,
4,
18,
13,
13,
13,
41,
13,
4,
18,
13,
13,
13,
14,
2,
2,
2,
13,
13,
17,
2,
13,
17,
30,
0,
13,
13,
3,
0,
13,
13,
0,
13,
2,
13,
13,
14,
2,
2,
13,
13,
17,
30,
0,
13,
13,
3,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
41,
13,
13,
41,
13,
13,
11,
1,
41,
13,
17,
2,
13,
17,
1,
40,
13,
30,
30,
41,
13,
4,
18,
13,
13,
13,
41,
13,
4,
18,
13,
13,
13,
14,
2,
2,
2,
13,
13,
17,
2,
13,
17,
30,
0,
13,
13,
0,
13,
13,
3,
0,
13,
13,
0,
13,
2,
13,
13,
14,
2,
2,
13,
13,
17,
30,
0,
13,
13,
3,
4,
18,
18,
13,
13,
13,
23,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
8,
17
],
[
17,
18
],
[
17,
19
],
[
8,
20
],
[
20,
21
],
[
21,
22
],
[
22,
23
],
[
22,
24
],
[
20,
25
],
[
25,
26
],
[
25,
27
],
[
20,
28
],
[
28,
29
],
[
29,
30
],
[
20,
31
],
[
32,
32
],
[
32,
33
],
[
33,
34
],
[
34,
35
],
[
35,
36
],
[
35,
37
],
[
33,
38
],
[
38,
39
],
[
38,
40
],
[
33,
41
],
[
41,
42
],
[
42,
43
],
[
33,
44
],
[
45,
45
],
[
45,
46
],
[
46,
47
],
[
46,
48
],
[
45,
49
],
[
49,
50
],
[
49,
51
],
[
45,
52
],
[
52,
53
],
[
52,
54
],
[
45,
55
],
[
55,
56
],
[
56,
57
],
[
57,
58
],
[
57,
59
],
[
55,
60
],
[
60,
61
],
[
60,
62
],
[
55,
63
],
[
63,
64
],
[
64,
65
],
[
55,
66
],
[
67,
67
],
[
67,
68
],
[
68,
69
],
[
68,
70
],
[
70,
71
],
[
71,
72
],
[
70,
73
],
[
70,
74
],
[
67,
75
],
[
75,
76
],
[
75,
77
],
[
77,
78
],
[
78,
79
],
[
77,
80
],
[
77,
81
],
[
67,
82
],
[
82,
83
],
[
83,
84
],
[
84,
85
],
[
85,
86
],
[
85,
87
],
[
84,
88
],
[
83,
89
],
[
89,
90
],
[
89,
91
],
[
82,
92
],
[
92,
93
],
[
93,
94
],
[
93,
95
],
[
92,
96
],
[
67,
97
],
[
97,
98
],
[
97,
99
],
[
67,
100
],
[
100,
101
],
[
100,
102
],
[
102,
103
],
[
102,
104
],
[
67,
105
],
[
105,
106
],
[
106,
107
],
[
107,
108
],
[
107,
109
],
[
106,
110
],
[
105,
111
],
[
111,
112
],
[
112,
113
],
[
112,
114
],
[
111,
115
],
[
45,
116
],
[
116,
117
],
[
117,
118
],
[
118,
119
],
[
118,
120
],
[
116,
121
],
[
121,
122
],
[
121,
123
],
[
116,
124
],
[
124,
125
],
[
125,
126
],
[
116,
127
],
[
128,
128
],
[
128,
129
],
[
129,
130
],
[
129,
131
],
[
128,
132
],
[
132,
133
],
[
132,
134
],
[
128,
135
],
[
135,
136
],
[
136,
137
],
[
137,
138
],
[
137,
139
],
[
135,
140
],
[
140,
141
],
[
140,
142
],
[
135,
143
],
[
143,
144
],
[
144,
145
],
[
135,
146
],
[
147,
147
],
[
147,
148
],
[
148,
149
],
[
148,
150
],
[
150,
151
],
[
151,
152
],
[
150,
153
],
[
150,
154
],
[
147,
155
],
[
155,
156
],
[
155,
157
],
[
157,
158
],
[
158,
159
],
[
157,
160
],
[
157,
161
],
[
147,
162
],
[
162,
163
],
[
163,
164
],
[
164,
165
],
[
165,
166
],
[
165,
167
],
[
164,
168
],
[
163,
169
],
[
169,
170
],
[
169,
171
],
[
162,
172
],
[
172,
173
],
[
173,
174
],
[
173,
175
],
[
172,
176
],
[
176,
177
],
[
176,
178
],
[
172,
179
],
[
147,
180
],
[
180,
181
],
[
180,
182
],
[
147,
183
],
[
183,
184
],
[
183,
185
],
[
185,
186
],
[
185,
187
],
[
147,
188
],
[
188,
189
],
[
189,
190
],
[
190,
191
],
[
190,
192
],
[
189,
193
],
[
188,
194
],
[
194,
195
],
[
195,
196
],
[
195,
197
],
[
194,
198
],
[
8,
199
],
[
199,
200
],
[
200,
201
],
[
201,
202
],
[
201,
203
],
[
199,
204
],
[
6,
205
],
[
205,
206
]
] |
[
"import java.util.*;\n\nclass Main{\n public static void main(String[] args){\n \n Scanner sc = new Scanner(System.in);\n\n int K = sc.nextInt();\n int sum = 0;\n\n for(int i=1; i<=K; i++){\n for(int j=1; j<=K; j++){\n int a = i;\n int b = j;\n int kou = 0;\n for(int x=0; x<10; x++){\n int max = Math.max(a, b);\n int min = Math.min(a, b);\n if(max%min==0 && x==0){\n kou = min;\n break;\n }\n a = min;\n b = max % min;\n if(a%b==0){\n kou = b;\n break;\n }\n }\n for(int k=1; k<=K; k++){\n int c = k;\n int d = kou;\n for(int x=0; x<10; x++){\n int max = Math.max(c, d);\n int min = Math.min(c, d);\n if(max%min==0 && x==0){\n d = min;\n sum += d;\n break;\n }\n c = min;\n d = max % min;\n if(c%d==0){\n sum += d;\n break;\n }\n }\n }\n }\n }\n System.out.println(sum);\n }\n}",
"import java.util.*;",
"util.*",
"java",
"class Main{\n public static void main(String[] args){\n \n Scanner sc = new Scanner(System.in);\n\n int K = sc.nextInt();\n int sum = 0;\n\n for(int i=1; i<=K; i++){\n for(int j=1; j<=K; j++){\n int a = i;\n int b = j;\n int kou = 0;\n for(int x=0; x<10; x++){\n int max = Math.max(a, b);\n int min = Math.min(a, b);\n if(max%min==0 && x==0){\n kou = min;\n break;\n }\n a = min;\n b = max % min;\n if(a%b==0){\n kou = b;\n break;\n }\n }\n for(int k=1; k<=K; k++){\n int c = k;\n int d = kou;\n for(int x=0; x<10; x++){\n int max = Math.max(c, d);\n int min = Math.min(c, d);\n if(max%min==0 && x==0){\n d = min;\n sum += d;\n break;\n }\n c = min;\n d = max % min;\n if(c%d==0){\n sum += d;\n break;\n }\n }\n }\n }\n }\n System.out.println(sum);\n }\n}",
"Main",
"public static void main(String[] args){\n \n Scanner sc = new Scanner(System.in);\n\n int K = sc.nextInt();\n int sum = 0;\n\n for(int i=1; i<=K; i++){\n for(int j=1; j<=K; j++){\n int a = i;\n int b = j;\n int kou = 0;\n for(int x=0; x<10; x++){\n int max = Math.max(a, b);\n int min = Math.min(a, b);\n if(max%min==0 && x==0){\n kou = min;\n break;\n }\n a = min;\n b = max % min;\n if(a%b==0){\n kou = b;\n break;\n }\n }\n for(int k=1; k<=K; k++){\n int c = k;\n int d = kou;\n for(int x=0; x<10; x++){\n int max = Math.max(c, d);\n int min = Math.min(c, d);\n if(max%min==0 && x==0){\n d = min;\n sum += d;\n break;\n }\n c = min;\n d = max % min;\n if(c%d==0){\n sum += d;\n break;\n }\n }\n }\n }\n }\n System.out.println(sum);\n }",
"main",
"{\n \n Scanner sc = new Scanner(System.in);\n\n int K = sc.nextInt();\n int sum = 0;\n\n for(int i=1; i<=K; i++){\n for(int j=1; j<=K; j++){\n int a = i;\n int b = j;\n int kou = 0;\n for(int x=0; x<10; x++){\n int max = Math.max(a, b);\n int min = Math.min(a, b);\n if(max%min==0 && x==0){\n kou = min;\n break;\n }\n a = min;\n b = max % min;\n if(a%b==0){\n kou = b;\n break;\n }\n }\n for(int k=1; k<=K; k++){\n int c = k;\n int d = kou;\n for(int x=0; x<10; x++){\n int max = Math.max(c, d);\n int min = Math.min(c, d);\n if(max%min==0 && x==0){\n d = min;\n sum += d;\n break;\n }\n c = min;\n d = max % min;\n if(c%d==0){\n sum += d;\n break;\n }\n }\n }\n }\n }\n System.out.println(sum);\n }",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"int K = sc.nextInt();",
"K",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int sum = 0;",
"sum",
"0",
"for(int i=1; i<=K; i++){\n for(int j=1; j<=K; j++){\n int a = i;\n int b = j;\n int kou = 0;\n for(int x=0; x<10; x++){\n int max = Math.max(a, b);\n int min = Math.min(a, b);\n if(max%min==0 && x==0){\n kou = min;\n break;\n }\n a = min;\n b = max % min;\n if(a%b==0){\n kou = b;\n break;\n }\n }\n for(int k=1; k<=K; k++){\n int c = k;\n int d = kou;\n for(int x=0; x<10; x++){\n int max = Math.max(c, d);\n int min = Math.min(c, d);\n if(max%min==0 && x==0){\n d = min;\n sum += d;\n break;\n }\n c = min;\n d = max % min;\n if(c%d==0){\n sum += d;\n break;\n }\n }\n }\n }\n }",
"int i=1;",
"int i=1;",
"i",
"1",
"i<=K",
"i",
"K",
"i++",
"i++",
"i",
"{\n for(int j=1; j<=K; j++){\n int a = i;\n int b = j;\n int kou = 0;\n for(int x=0; x<10; x++){\n int max = Math.max(a, b);\n int min = Math.min(a, b);\n if(max%min==0 && x==0){\n kou = min;\n break;\n }\n a = min;\n b = max % min;\n if(a%b==0){\n kou = b;\n break;\n }\n }\n for(int k=1; k<=K; k++){\n int c = k;\n int d = kou;\n for(int x=0; x<10; x++){\n int max = Math.max(c, d);\n int min = Math.min(c, d);\n if(max%min==0 && x==0){\n d = min;\n sum += d;\n break;\n }\n c = min;\n d = max % min;\n if(c%d==0){\n sum += d;\n break;\n }\n }\n }\n }\n }",
"{\n for(int j=1; j<=K; j++){\n int a = i;\n int b = j;\n int kou = 0;\n for(int x=0; x<10; x++){\n int max = Math.max(a, b);\n int min = Math.min(a, b);\n if(max%min==0 && x==0){\n kou = min;\n break;\n }\n a = min;\n b = max % min;\n if(a%b==0){\n kou = b;\n break;\n }\n }\n for(int k=1; k<=K; k++){\n int c = k;\n int d = kou;\n for(int x=0; x<10; x++){\n int max = Math.max(c, d);\n int min = Math.min(c, d);\n if(max%min==0 && x==0){\n d = min;\n sum += d;\n break;\n }\n c = min;\n d = max % min;\n if(c%d==0){\n sum += d;\n break;\n }\n }\n }\n }\n }",
"for(int j=1; j<=K; j++){\n int a = i;\n int b = j;\n int kou = 0;\n for(int x=0; x<10; x++){\n int max = Math.max(a, b);\n int min = Math.min(a, b);\n if(max%min==0 && x==0){\n kou = min;\n break;\n }\n a = min;\n b = max % min;\n if(a%b==0){\n kou = b;\n break;\n }\n }\n for(int k=1; k<=K; k++){\n int c = k;\n int d = kou;\n for(int x=0; x<10; x++){\n int max = Math.max(c, d);\n int min = Math.min(c, d);\n if(max%min==0 && x==0){\n d = min;\n sum += d;\n break;\n }\n c = min;\n d = max % min;\n if(c%d==0){\n sum += d;\n break;\n }\n }\n }\n }",
"int j=1;",
"int j=1;",
"j",
"1",
"j<=K",
"j",
"K",
"j++",
"j++",
"j",
"{\n int a = i;\n int b = j;\n int kou = 0;\n for(int x=0; x<10; x++){\n int max = Math.max(a, b);\n int min = Math.min(a, b);\n if(max%min==0 && x==0){\n kou = min;\n break;\n }\n a = min;\n b = max % min;\n if(a%b==0){\n kou = b;\n break;\n }\n }\n for(int k=1; k<=K; k++){\n int c = k;\n int d = kou;\n for(int x=0; x<10; x++){\n int max = Math.max(c, d);\n int min = Math.min(c, d);\n if(max%min==0 && x==0){\n d = min;\n sum += d;\n break;\n }\n c = min;\n d = max % min;\n if(c%d==0){\n sum += d;\n break;\n }\n }\n }\n }",
"{\n int a = i;\n int b = j;\n int kou = 0;\n for(int x=0; x<10; x++){\n int max = Math.max(a, b);\n int min = Math.min(a, b);\n if(max%min==0 && x==0){\n kou = min;\n break;\n }\n a = min;\n b = max % min;\n if(a%b==0){\n kou = b;\n break;\n }\n }\n for(int k=1; k<=K; k++){\n int c = k;\n int d = kou;\n for(int x=0; x<10; x++){\n int max = Math.max(c, d);\n int min = Math.min(c, d);\n if(max%min==0 && x==0){\n d = min;\n sum += d;\n break;\n }\n c = min;\n d = max % min;\n if(c%d==0){\n sum += d;\n break;\n }\n }\n }\n }",
"int a = i;",
"a",
"i",
"int b = j;",
"b",
"j",
"int kou = 0;",
"kou",
"0",
"for(int x=0; x<10; x++){\n int max = Math.max(a, b);\n int min = Math.min(a, b);\n if(max%min==0 && x==0){\n kou = min;\n break;\n }\n a = min;\n b = max % min;\n if(a%b==0){\n kou = b;\n break;\n }\n }",
"int x=0;",
"int x=0;",
"x",
"0",
"x<10",
"x",
"10",
"x++",
"x++",
"x",
"{\n int max = Math.max(a, b);\n int min = Math.min(a, b);\n if(max%min==0 && x==0){\n kou = min;\n break;\n }\n a = min;\n b = max % min;\n if(a%b==0){\n kou = b;\n break;\n }\n }",
"{\n int max = Math.max(a, b);\n int min = Math.min(a, b);\n if(max%min==0 && x==0){\n kou = min;\n break;\n }\n a = min;\n b = max % min;\n if(a%b==0){\n kou = b;\n break;\n }\n }",
"int max = Math.max(a, b);",
"max",
"Math.max(a, b)",
"Math.max",
"Math",
"a",
"b",
"int min = Math.min(a, b);",
"min",
"Math.min(a, b)",
"Math.min",
"Math",
"a",
"b",
"if(max%min==0 && x==0){\n kou = min;\n break;\n }",
"max%min==0 && x==0",
"max%min==0",
"max%min",
"max",
"min",
"0",
"x==0",
"x",
"0",
"{\n kou = min;\n break;\n }",
"kou = min",
"kou",
"min",
"break;",
"a = min",
"a",
"min",
"b = max % min",
"b",
"max % min",
"max",
"min",
"if(a%b==0){\n kou = b;\n break;\n }",
"a%b==0",
"a%b",
"a",
"b",
"0",
"{\n kou = b;\n break;\n }",
"kou = b",
"kou",
"b",
"break;",
"for(int k=1; k<=K; k++){\n int c = k;\n int d = kou;\n for(int x=0; x<10; x++){\n int max = Math.max(c, d);\n int min = Math.min(c, d);\n if(max%min==0 && x==0){\n d = min;\n sum += d;\n break;\n }\n c = min;\n d = max % min;\n if(c%d==0){\n sum += d;\n break;\n }\n }\n }",
"int k=1;",
"int k=1;",
"k",
"1",
"k<=K",
"k",
"K",
"k++",
"k++",
"k",
"{\n int c = k;\n int d = kou;\n for(int x=0; x<10; x++){\n int max = Math.max(c, d);\n int min = Math.min(c, d);\n if(max%min==0 && x==0){\n d = min;\n sum += d;\n break;\n }\n c = min;\n d = max % min;\n if(c%d==0){\n sum += d;\n break;\n }\n }\n }",
"{\n int c = k;\n int d = kou;\n for(int x=0; x<10; x++){\n int max = Math.max(c, d);\n int min = Math.min(c, d);\n if(max%min==0 && x==0){\n d = min;\n sum += d;\n break;\n }\n c = min;\n d = max % min;\n if(c%d==0){\n sum += d;\n break;\n }\n }\n }",
"int c = k;",
"c",
"k",
"int d = kou;",
"d",
"kou",
"for(int x=0; x<10; x++){\n int max = Math.max(c, d);\n int min = Math.min(c, d);\n if(max%min==0 && x==0){\n d = min;\n sum += d;\n break;\n }\n c = min;\n d = max % min;\n if(c%d==0){\n sum += d;\n break;\n }\n }",
"int x=0;",
"int x=0;",
"x",
"0",
"x<10",
"x",
"10",
"x++",
"x++",
"x",
"{\n int max = Math.max(c, d);\n int min = Math.min(c, d);\n if(max%min==0 && x==0){\n d = min;\n sum += d;\n break;\n }\n c = min;\n d = max % min;\n if(c%d==0){\n sum += d;\n break;\n }\n }",
"{\n int max = Math.max(c, d);\n int min = Math.min(c, d);\n if(max%min==0 && x==0){\n d = min;\n sum += d;\n break;\n }\n c = min;\n d = max % min;\n if(c%d==0){\n sum += d;\n break;\n }\n }",
"int max = Math.max(c, d);",
"max",
"Math.max(c, d)",
"Math.max",
"Math",
"c",
"d",
"int min = Math.min(c, d);",
"min",
"Math.min(c, d)",
"Math.min",
"Math",
"c",
"d",
"if(max%min==0 && x==0){\n d = min;\n sum += d;\n break;\n }",
"max%min==0 && x==0",
"max%min==0",
"max%min",
"max",
"min",
"0",
"x==0",
"x",
"0",
"{\n d = min;\n sum += d;\n break;\n }",
"d = min",
"d",
"min",
"sum += d",
"sum",
"d",
"break;",
"c = min",
"c",
"min",
"d = max % min",
"d",
"max % min",
"max",
"min",
"if(c%d==0){\n sum += d;\n break;\n }",
"c%d==0",
"c%d",
"c",
"d",
"0",
"{\n sum += d;\n break;\n }",
"sum += d",
"sum",
"d",
"break;",
"System.out.println(sum)",
"System.out.println",
"System.out",
"System",
"System.out",
"sum",
"String[] args",
"args"
] |
import java.util.*;
class Main{
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
int K = sc.nextInt();
int sum = 0;
for(int i=1; i<=K; i++){
for(int j=1; j<=K; j++){
int a = i;
int b = j;
int kou = 0;
for(int x=0; x<10; x++){
int max = Math.max(a, b);
int min = Math.min(a, b);
if(max%min==0 && x==0){
kou = min;
break;
}
a = min;
b = max % min;
if(a%b==0){
kou = b;
break;
}
}
for(int k=1; k<=K; k++){
int c = k;
int d = kou;
for(int x=0; x<10; x++){
int max = Math.max(c, d);
int min = Math.min(c, d);
if(max%min==0 && x==0){
d = min;
sum += d;
break;
}
c = min;
d = max % min;
if(c%d==0){
sum += d;
break;
}
}
}
}
}
System.out.println(sum);
}
}
|
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
20,
41,
13,
17,
41,
13,
4,
18,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
4,
13,
4,
13,
13,
13,
13,
4,
18,
18,
13,
13,
13,
23,
13,
12,
13,
30,
14,
2,
13,
17,
30,
29,
13,
29,
4,
13,
13,
2,
13,
13,
23,
13,
23,
13,
6,
13,
41,
13,
41,
13,
20,
17,
41,
13,
41,
13,
12,
13,
30,
0,
18,
36,
13,
13,
0,
18,
36,
13,
0,
18,
36,
13,
17,
23,
13,
12,
13,
30,
14,
2,
13,
13,
30,
0,
13,
17,
38,
5,
13,
30,
37,
20,
30,
0,
13,
4,
18,
13,
13,
14,
2,
13,
17,
29,
17,
29,
17,
12,
13,
30,
14,
4,
13,
29,
18,
13,
40,
13,
29,
40,
17,
12,
13,
30,
29,
40,
2,
2,
13,
17,
2,
13,
17,
23,
13,
12,
13,
30,
42,
2,
4,
13,
4,
13,
18,
13,
13,
40,
13,
12,
13,
30,
4,
13,
29,
4,
13,
12,
13,
30,
14,
40,
4,
13,
37,
20,
41,
13,
20,
41,
13,
4,
13,
42,
40,
4,
13,
13,
30,
4,
18,
13,
13,
0,
13,
4,
13,
29,
4,
18,
13,
12,
13,
30,
14,
40,
4,
13,
37,
20,
41,
13,
4,
13,
42,
4,
13,
13,
0,
13,
4,
13,
41,
13,
17,
14,
2,
13,
17,
30,
0,
13,
17,
0,
13,
4,
13,
41,
13,
17,
42,
40,
4,
13,
13,
30,
14,
2,
2,
13,
17,
2,
13,
17,
37,
20,
0,
13,
2,
2,
2,
13,
17,
13,
17,
0,
13,
4,
13,
29,
8,
13,
40,
13,
13,
12,
13,
30,
14,
40,
4,
13,
37,
20,
41,
13,
4,
13,
42,
4,
13,
13,
0,
13,
4,
13,
41,
13,
17,
14,
2,
13,
17,
30,
0,
13,
17,
0,
13,
4,
13,
41,
13,
17,
42,
40,
4,
13,
13,
30,
14,
2,
2,
13,
17,
2,
13,
17,
37,
20,
0,
13,
2,
2,
2,
13,
17,
13,
17,
0,
13,
4,
13,
29,
8,
13,
40,
13,
13,
12,
13,
30,
29,
4,
18,
13,
4,
13,
12,
13,
30,
41,
13,
20,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
0,
18,
13,
13,
4,
13,
29,
13,
23,
13,
12,
13,
30,
41,
13,
20,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
0,
18,
13,
13,
4,
13,
29,
13,
23,
13,
12,
13,
30,
41,
13,
20,
13,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
0,
18,
13,
13,
4,
18,
4,
13,
29,
13,
23,
13,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
10,
11
],
[
10,
12
],
[
0,
13
],
[
13,
14
],
[
13,
15
],
[
0,
16
],
[
16,
17
],
[
16,
18
],
[
0,
19
],
[
19,
20
],
[
19,
21
],
[
0,
22
],
[
515,
23
],
[
515,
24
],
[
24,
25
],
[
24,
26
],
[
26,
27
],
[
27,
28
],
[
27,
29
],
[
26,
30
],
[
30,
31
],
[
30,
32
],
[
26,
33
],
[
33,
34
],
[
33,
35
],
[
26,
36
],
[
36,
37
],
[
36,
38
],
[
38,
39
],
[
39,
40
],
[
26,
41
],
[
41,
42
],
[
42,
43
],
[
43,
44
],
[
43,
45
],
[
41,
46
],
[
46,
47
],
[
46,
48
],
[
41,
49
],
[
49,
50
],
[
50,
51
],
[
41,
52
],
[
53,
53
],
[
53,
54
],
[
54,
55
],
[
55,
56
],
[
56,
57
],
[
56,
58
],
[
54,
59
],
[
59,
60
],
[
59,
61
],
[
54,
62
],
[
62,
63
],
[
63,
64
],
[
54,
65
],
[
66,
66
],
[
66,
67
],
[
67,
68
],
[
68,
69
],
[
69,
70
],
[
69,
71
],
[
67,
72
],
[
72,
73
],
[
72,
74
],
[
67,
75
],
[
75,
76
],
[
76,
77
],
[
67,
78
],
[
79,
79
],
[
79,
80
],
[
80,
81
],
[
80,
82
],
[
82,
83
],
[
82,
84
],
[
84,
85
],
[
84,
86
],
[
84,
87
],
[
82,
88
],
[
26,
89
],
[
89,
90
],
[
90,
91
],
[
91,
92
],
[
91,
93
],
[
89,
94
],
[
24,
95
],
[
95,
96
],
[
515,
97
],
[
97,
98
],
[
97,
99
],
[
99,
100
],
[
100,
101
],
[
101,
102
],
[
101,
103
],
[
100,
104
],
[
104,
105
],
[
105,
106
],
[
99,
107
],
[
107,
108
],
[
108,
109
],
[
108,
110
],
[
108,
111
],
[
111,
112
],
[
111,
113
],
[
97,
114
],
[
114,
115
],
[
97,
116
],
[
116,
117
],
[
515,
118
],
[
118,
119
],
[
118,
120
],
[
120,
121
],
[
118,
122
],
[
122,
123
],
[
122,
124
],
[
118,
126
],
[
126,
127
],
[
118,
128
],
[
128,
129
],
[
118,
130
],
[
130,
131
],
[
130,
132
],
[
132,
133
],
[
133,
134
],
[
134,
135
],
[
134,
136
],
[
133,
137
],
[
132,
138
],
[
138,
139
],
[
139,
140
],
[
139,
141
],
[
138,
142
],
[
142,
143
],
[
143,
144
],
[
143,
145
],
[
142,
146
],
[
130,
147
],
[
147,
148
],
[
118,
149
],
[
149,
150
],
[
149,
151
],
[
151,
152
],
[
152,
153
],
[
153,
154
],
[
153,
155
],
[
152,
156
],
[
156,
157
],
[
157,
158
],
[
157,
159
],
[
156,
160
],
[
160,
161
],
[
161,
162
],
[
161,
163
],
[
163,
164
],
[
164,
165
],
[
160,
166
],
[
166,
167
],
[
167,
168
],
[
167,
169
],
[
169,
170
],
[
170,
171
],
[
169,
172
],
[
156,
173
],
[
173,
174
],
[
174,
175
],
[
174,
176
],
[
173,
177
],
[
177,
178
],
[
151,
179
],
[
179,
180
],
[
118,
181
],
[
181,
182
],
[
181,
183
],
[
183,
184
],
[
184,
185
],
[
185,
186
],
[
184,
187
],
[
187,
188
],
[
188,
189
],
[
188,
190
],
[
190,
191
],
[
184,
192
],
[
192,
193
],
[
193,
194
],
[
118,
195
],
[
195,
196
],
[
195,
197
],
[
197,
198
],
[
198,
199
],
[
199,
200
],
[
200,
201
],
[
201,
202
],
[
201,
203
],
[
200,
204
],
[
204,
205
],
[
204,
206
],
[
195,
207
],
[
207,
208
],
[
118,
209
],
[
209,
210
],
[
209,
211
],
[
211,
212
],
[
212,
213
],
[
213,
214
],
[
214,
215
],
[
213,
216
],
[
216,
217
],
[
216,
218
],
[
218,
219
],
[
218,
220
],
[
212,
221
],
[
221,
222
],
[
118,
223
],
[
223,
224
],
[
223,
225
],
[
225,
226
],
[
226,
227
],
[
225,
228
],
[
228,
229
],
[
229,
230
],
[
118,
231
],
[
231,
232
],
[
231,
233
],
[
233,
234
],
[
234,
235
],
[
235,
236
],
[
236,
237
],
[
234,
238
],
[
238,
239
],
[
233,
240
],
[
240,
241
],
[
240,
242
],
[
233,
243
],
[
243,
244
],
[
243,
245
],
[
245,
246
],
[
233,
247
],
[
247,
248
],
[
248,
249
],
[
249,
250
],
[
249,
251
],
[
247,
252
],
[
252,
253
],
[
253,
254
],
[
254,
255
],
[
253,
256
],
[
252,
257
],
[
257,
258
],
[
257,
259
],
[
259,
260
],
[
233,
261
],
[
261,
262
],
[
262,
263
],
[
263,
264
],
[
118,
265
],
[
265,
266
],
[
265,
267
],
[
267,
268
],
[
268,
269
],
[
269,
270
],
[
270,
271
],
[
268,
272
],
[
272,
273
],
[
267,
274
],
[
274,
275
],
[
274,
276
],
[
276,
277
],
[
267,
278
],
[
278,
279
],
[
279,
280
],
[
279,
281
],
[
278,
282
],
[
282,
283
],
[
282,
284
],
[
284,
285
],
[
267,
286
],
[
286,
287
],
[
286,
288
],
[
267,
289
],
[
289,
290
],
[
290,
291
],
[
290,
292
],
[
289,
293
],
[
293,
294
],
[
294,
295
],
[
294,
296
],
[
293,
297
],
[
297,
298
],
[
297,
299
],
[
299,
300
],
[
267,
301
],
[
301,
302
],
[
301,
303
],
[
267,
304
],
[
304,
305
],
[
305,
306
],
[
306,
307
],
[
306,
308
],
[
304,
309
],
[
309,
310
],
[
310,
311
],
[
311,
312
],
[
312,
313
],
[
312,
314
],
[
311,
315
],
[
315,
316
],
[
315,
317
],
[
310,
318
],
[
318,
319
],
[
309,
320
],
[
320,
321
],
[
320,
322
],
[
322,
323
],
[
323,
324
],
[
324,
325
],
[
324,
326
],
[
323,
327
],
[
322,
328
],
[
309,
329
],
[
329,
330
],
[
329,
331
],
[
331,
332
],
[
267,
333
],
[
333,
334
],
[
334,
335
],
[
334,
336
],
[
336,
337
],
[
334,
338
],
[
118,
339
],
[
339,
340
],
[
339,
341
],
[
341,
342
],
[
342,
343
],
[
343,
344
],
[
344,
345
],
[
342,
346
],
[
346,
347
],
[
341,
348
],
[
348,
349
],
[
348,
350
],
[
350,
351
],
[
341,
352
],
[
352,
353
],
[
353,
354
],
[
353,
355
],
[
352,
356
],
[
356,
357
],
[
356,
358
],
[
358,
359
],
[
341,
360
],
[
360,
361
],
[
360,
362
],
[
341,
363
],
[
363,
364
],
[
364,
365
],
[
364,
366
],
[
363,
367
],
[
367,
368
],
[
368,
369
],
[
368,
370
],
[
367,
371
],
[
371,
372
],
[
371,
373
],
[
373,
374
],
[
341,
375
],
[
375,
376
],
[
375,
377
],
[
341,
378
],
[
378,
379
],
[
379,
380
],
[
380,
381
],
[
380,
382
],
[
378,
383
],
[
383,
384
],
[
384,
385
],
[
385,
386
],
[
386,
387
],
[
386,
388
],
[
385,
389
],
[
389,
390
],
[
389,
391
],
[
384,
392
],
[
392,
393
],
[
383,
394
],
[
394,
395
],
[
394,
396
],
[
396,
397
],
[
397,
398
],
[
398,
399
],
[
398,
400
],
[
397,
401
],
[
396,
402
],
[
383,
403
],
[
403,
404
],
[
403,
405
],
[
405,
406
],
[
341,
407
],
[
407,
408
],
[
408,
409
],
[
408,
410
],
[
410,
411
],
[
408,
412
],
[
118,
413
],
[
413,
414
],
[
413,
415
],
[
415,
416
],
[
416,
417
],
[
417,
418
],
[
418,
419
],
[
417,
420
],
[
420,
421
],
[
118,
422
],
[
422,
423
],
[
422,
424
],
[
424,
425
],
[
425,
426
],
[
425,
427
],
[
424,
429
],
[
429,
430
],
[
430,
431
],
[
431,
432
],
[
431,
433
],
[
429,
434
],
[
434,
435
],
[
434,
436
],
[
429,
437
],
[
437,
438
],
[
438,
439
],
[
429,
440
],
[
440,
441
],
[
441,
442
],
[
442,
443
],
[
442,
444
],
[
441,
445
],
[
445,
446
],
[
424,
447
],
[
447,
448
],
[
422,
449
],
[
449,
450
],
[
118,
451
],
[
451,
452
],
[
451,
453
],
[
453,
454
],
[
454,
455
],
[
454,
456
],
[
453,
458
],
[
458,
459
],
[
459,
460
],
[
460,
461
],
[
460,
462
],
[
458,
463
],
[
463,
464
],
[
463,
465
],
[
458,
466
],
[
466,
467
],
[
467,
468
],
[
458,
469
],
[
469,
470
],
[
470,
471
],
[
471,
472
],
[
471,
473
],
[
470,
474
],
[
474,
475
],
[
453,
476
],
[
476,
477
],
[
451,
478
],
[
478,
479
],
[
118,
480
],
[
480,
481
],
[
480,
482
],
[
482,
483
],
[
483,
484
],
[
483,
485
],
[
482,
488
],
[
488,
489
],
[
489,
490
],
[
490,
491
],
[
490,
492
],
[
488,
493
],
[
493,
494
],
[
493,
495
],
[
488,
496
],
[
496,
497
],
[
497,
498
],
[
488,
499
],
[
499,
500
],
[
500,
501
],
[
501,
502
],
[
501,
503
],
[
500,
504
],
[
504,
505
],
[
505,
506
],
[
506,
507
],
[
482,
508
],
[
508,
509
],
[
480,
510
],
[
510,
511
],
[
480,
512
],
[
512,
513
],
[
0,
514
],
[
514,
515
],
[
514,
516
]
] |
[
"import java.io.IOException;\nimport java.io.InputStream;\nimport java.io.PrintWriter;\nimport java.math.BigDecimal;\nimport java.math.RoundingMode;\nimport java.util.*;\nimport java.util.logging.Logger;\n\n\npublic class Main {\n\tpublic static void main(String[] args){\n\t\tPrintWriter out = new PrintWriter(System.out);\n\t\tInputReader sc=new InputReader(System.in);\n\t\tlong sum=0;\n\t\tint K=sc.nextInt();\n\t\tfor (int i = 1; i <= K; i++) {\n\t\t\tfor (int j = 1; j <= K; j++) {\n\t\t\t\tfor (int j2 = 1; j2 <= K; j2++) {\n\t\t\t\t\tsum+=gcd(gcd(i, j), j2);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(sum);\n\t}\n\tstatic int gcd(int a,int b) {\n\t\tif (b==0) {\n\t\t\treturn a;\n\t\t}\n\t\treturn gcd(b,a%b);\n\t}\n\tstatic class InputReader { \n\t\tprivate InputStream in;\n\t\tprivate byte[] buffer = new byte[1024];\n\t\tprivate int curbuf;\n\t\tprivate int lenbuf;\n\t\tpublic InputReader(InputStream in) {\n\t\t\tthis.in = in;\n\t\t\tthis.curbuf = this.lenbuf = 0;\n\t\t}\n \n\t\tpublic boolean hasNextByte() {\n\t\t\tif (curbuf >= lenbuf) {\n\t\t\t\tcurbuf = 0;\n\t\t\t\ttry {\n\t\t\t\t\tlenbuf = in.read(buffer);\n\t\t\t\t} catch (IOException e) {\n\t\t\t\t\tthrow new InputMismatchException();\n\t\t\t\t}\n\t\t\t\tif (lenbuf <= 0)\n\t\t\t\t\treturn false;\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n \n\t\tprivate int readByte() {\n\t\t\tif (hasNextByte())\n\t\t\t\treturn buffer[curbuf++];\n\t\t\telse\n\t\t\t\treturn -1;\n\t\t}\n \n\t\tprivate boolean isSpaceChar(int c) {\n\t\t\treturn !(c >= 33 && c <= 126);\n\t\t}\n \n\t\tprivate void skip() {\n\t\t\twhile (hasNextByte() && isSpaceChar(buffer[curbuf]))\n\t\t\t\tcurbuf++;\n\t\t}\n \n\t\tpublic boolean hasNext() {\n\t\t\tskip();\n\t\t\treturn hasNextByte();\n\t\t}\n \n\t\tpublic String next() {\n\t\t\tif (!hasNext())\n\t\t\t\tthrow new NoSuchElementException();\n\t\t\tStringBuilder sb = new StringBuilder();\n\t\t\tint b = readByte();\n\t\t\twhile (!isSpaceChar(b)) {\n\t\t\t\tsb.appendCodePoint(b);\n\t\t\t\tb = readByte();\n\t\t\t}\n\t\t\treturn sb.toString();\n\t\t}\n \n\t\tpublic int nextInt() {\n\t\t\tif (!hasNext())\n\t\t\t\tthrow new NoSuchElementException();\n\t\t\tint c = readByte();\n\t\t\twhile (isSpaceChar(c))\n\t\t\t\tc = readByte();\n\t\t\tboolean minus = false;\n\t\t\tif (c == '-') {\n\t\t\t\tminus = true;\n\t\t\t\tc = readByte();\n\t\t\t}\n\t\t\tint res = 0;\n\t\t\tdo {\n\t\t\t\tif (c < '0' || c > '9')\n\t\t\t\t\tthrow new InputMismatchException();\n\t\t\t\tres = res * 10 + c - '0';\n\t\t\t\tc = readByte();\n\t\t\t} while (!isSpaceChar(c));\n\t\t\treturn (minus) ? -res : res;\n\t\t}\n \n\t\tpublic long nextLong() {\n\t\t\tif (!hasNext())\n\t\t\t\tthrow new NoSuchElementException();\n\t\t\tint c = readByte();\n\t\t\twhile (isSpaceChar(c))\n\t\t\t\tc = readByte();\n\t\t\tboolean minus = false;\n\t\t\tif (c == '-') {\n\t\t\t\tminus = true;\n\t\t\t\tc = readByte();\n\t\t\t}\n\t\t\tlong res = 0;\n\t\t\tdo {\n\t\t\t\tif (c < '0' || c > '9')\n\t\t\t\t\tthrow new InputMismatchException();\n\t\t\t\tres = res * 10 + c - '0';\n\t\t\t\tc = readByte();\n\t\t\t} while (!isSpaceChar(c));\n\t\t\treturn (minus) ? -res : res;\n\t\t}\n \n\t\tpublic double nextDouble() {\n\t\t\treturn Double.parseDouble(next());\n\t\t}\n \n\t\tpublic int[] nextIntArray(int n) {\n\t\t\tint[] a = new int[n];\n\t\t\tfor (int i = 0; i < n; i++)\n\t\t\t\ta[i] = nextInt();\n\t\t\treturn a;\n\t\t}\n \n\t\tpublic long[] nextLongArray(int n) {\n\t\t\tlong[] a = new long[n];\n\t\t\tfor (int i = 0; i < n; i++)\n\t\t\t\ta[i] = nextLong();\n\t\t\treturn a;\n\t\t}\n \n\t\tpublic char[][] nextCharMap(int n, int m) {\n\t\t\tchar[][] map = new char[n][m];\n\t\t\tfor (int i = 0; i < n; i++)\n\t\t\t\tmap[i] = next().toCharArray();\n\t\t\treturn map;\n\t\t}\n\t}\n}",
"import java.io.IOException;",
"IOException",
"java.io",
"import java.io.InputStream;",
"InputStream",
"java.io",
"import java.io.PrintWriter;",
"PrintWriter",
"java.io",
"import java.math.BigDecimal;",
"BigDecimal",
"java.math",
"import java.math.RoundingMode;",
"RoundingMode",
"java.math",
"import java.util.*;",
"util.*",
"java",
"import java.util.logging.Logger;",
"Logger",
"java.util.logging",
"public class Main {\n\tpublic static void main(String[] args){\n\t\tPrintWriter out = new PrintWriter(System.out);\n\t\tInputReader sc=new InputReader(System.in);\n\t\tlong sum=0;\n\t\tint K=sc.nextInt();\n\t\tfor (int i = 1; i <= K; i++) {\n\t\t\tfor (int j = 1; j <= K; j++) {\n\t\t\t\tfor (int j2 = 1; j2 <= K; j2++) {\n\t\t\t\t\tsum+=gcd(gcd(i, j), j2);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(sum);\n\t}\n\tstatic int gcd(int a,int b) {\n\t\tif (b==0) {\n\t\t\treturn a;\n\t\t}\n\t\treturn gcd(b,a%b);\n\t}\n\tstatic class InputReader { \n\t\tprivate InputStream in;\n\t\tprivate byte[] buffer = new byte[1024];\n\t\tprivate int curbuf;\n\t\tprivate int lenbuf;\n\t\tpublic InputReader(InputStream in) {\n\t\t\tthis.in = in;\n\t\t\tthis.curbuf = this.lenbuf = 0;\n\t\t}\n \n\t\tpublic boolean hasNextByte() {\n\t\t\tif (curbuf >= lenbuf) {\n\t\t\t\tcurbuf = 0;\n\t\t\t\ttry {\n\t\t\t\t\tlenbuf = in.read(buffer);\n\t\t\t\t} catch (IOException e) {\n\t\t\t\t\tthrow new InputMismatchException();\n\t\t\t\t}\n\t\t\t\tif (lenbuf <= 0)\n\t\t\t\t\treturn false;\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n \n\t\tprivate int readByte() {\n\t\t\tif (hasNextByte())\n\t\t\t\treturn buffer[curbuf++];\n\t\t\telse\n\t\t\t\treturn -1;\n\t\t}\n \n\t\tprivate boolean isSpaceChar(int c) {\n\t\t\treturn !(c >= 33 && c <= 126);\n\t\t}\n \n\t\tprivate void skip() {\n\t\t\twhile (hasNextByte() && isSpaceChar(buffer[curbuf]))\n\t\t\t\tcurbuf++;\n\t\t}\n \n\t\tpublic boolean hasNext() {\n\t\t\tskip();\n\t\t\treturn hasNextByte();\n\t\t}\n \n\t\tpublic String next() {\n\t\t\tif (!hasNext())\n\t\t\t\tthrow new NoSuchElementException();\n\t\t\tStringBuilder sb = new StringBuilder();\n\t\t\tint b = readByte();\n\t\t\twhile (!isSpaceChar(b)) {\n\t\t\t\tsb.appendCodePoint(b);\n\t\t\t\tb = readByte();\n\t\t\t}\n\t\t\treturn sb.toString();\n\t\t}\n \n\t\tpublic int nextInt() {\n\t\t\tif (!hasNext())\n\t\t\t\tthrow new NoSuchElementException();\n\t\t\tint c = readByte();\n\t\t\twhile (isSpaceChar(c))\n\t\t\t\tc = readByte();\n\t\t\tboolean minus = false;\n\t\t\tif (c == '-') {\n\t\t\t\tminus = true;\n\t\t\t\tc = readByte();\n\t\t\t}\n\t\t\tint res = 0;\n\t\t\tdo {\n\t\t\t\tif (c < '0' || c > '9')\n\t\t\t\t\tthrow new InputMismatchException();\n\t\t\t\tres = res * 10 + c - '0';\n\t\t\t\tc = readByte();\n\t\t\t} while (!isSpaceChar(c));\n\t\t\treturn (minus) ? -res : res;\n\t\t}\n \n\t\tpublic long nextLong() {\n\t\t\tif (!hasNext())\n\t\t\t\tthrow new NoSuchElementException();\n\t\t\tint c = readByte();\n\t\t\twhile (isSpaceChar(c))\n\t\t\t\tc = readByte();\n\t\t\tboolean minus = false;\n\t\t\tif (c == '-') {\n\t\t\t\tminus = true;\n\t\t\t\tc = readByte();\n\t\t\t}\n\t\t\tlong res = 0;\n\t\t\tdo {\n\t\t\t\tif (c < '0' || c > '9')\n\t\t\t\t\tthrow new InputMismatchException();\n\t\t\t\tres = res * 10 + c - '0';\n\t\t\t\tc = readByte();\n\t\t\t} while (!isSpaceChar(c));\n\t\t\treturn (minus) ? -res : res;\n\t\t}\n \n\t\tpublic double nextDouble() {\n\t\t\treturn Double.parseDouble(next());\n\t\t}\n \n\t\tpublic int[] nextIntArray(int n) {\n\t\t\tint[] a = new int[n];\n\t\t\tfor (int i = 0; i < n; i++)\n\t\t\t\ta[i] = nextInt();\n\t\t\treturn a;\n\t\t}\n \n\t\tpublic long[] nextLongArray(int n) {\n\t\t\tlong[] a = new long[n];\n\t\t\tfor (int i = 0; i < n; i++)\n\t\t\t\ta[i] = nextLong();\n\t\t\treturn a;\n\t\t}\n \n\t\tpublic char[][] nextCharMap(int n, int m) {\n\t\t\tchar[][] map = new char[n][m];\n\t\t\tfor (int i = 0; i < n; i++)\n\t\t\t\tmap[i] = next().toCharArray();\n\t\t\treturn map;\n\t\t}\n\t}\n}",
"Main",
"public static void main(String[] args){\n\t\tPrintWriter out = new PrintWriter(System.out);\n\t\tInputReader sc=new InputReader(System.in);\n\t\tlong sum=0;\n\t\tint K=sc.nextInt();\n\t\tfor (int i = 1; i <= K; i++) {\n\t\t\tfor (int j = 1; j <= K; j++) {\n\t\t\t\tfor (int j2 = 1; j2 <= K; j2++) {\n\t\t\t\t\tsum+=gcd(gcd(i, j), j2);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(sum);\n\t}",
"main",
"{\n\t\tPrintWriter out = new PrintWriter(System.out);\n\t\tInputReader sc=new InputReader(System.in);\n\t\tlong sum=0;\n\t\tint K=sc.nextInt();\n\t\tfor (int i = 1; i <= K; i++) {\n\t\t\tfor (int j = 1; j <= K; j++) {\n\t\t\t\tfor (int j2 = 1; j2 <= K; j2++) {\n\t\t\t\t\tsum+=gcd(gcd(i, j), j2);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(sum);\n\t}",
"PrintWriter out = new PrintWriter(System.out);",
"out",
"new PrintWriter(System.out)",
"InputReader sc=new InputReader(System.in);",
"sc",
"new InputReader(System.in)",
"long sum=0;",
"sum",
"0",
"int K=sc.nextInt();",
"K",
"sc.nextInt()",
"sc.nextInt",
"sc",
"for (int i = 1; i <= K; i++) {\n\t\t\tfor (int j = 1; j <= K; j++) {\n\t\t\t\tfor (int j2 = 1; j2 <= K; j2++) {\n\t\t\t\t\tsum+=gcd(gcd(i, j), j2);\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"int i = 1;",
"int i = 1;",
"i",
"1",
"i <= K",
"i",
"K",
"i++",
"i++",
"i",
"{\n\t\t\tfor (int j = 1; j <= K; j++) {\n\t\t\t\tfor (int j2 = 1; j2 <= K; j2++) {\n\t\t\t\t\tsum+=gcd(gcd(i, j), j2);\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"{\n\t\t\tfor (int j = 1; j <= K; j++) {\n\t\t\t\tfor (int j2 = 1; j2 <= K; j2++) {\n\t\t\t\t\tsum+=gcd(gcd(i, j), j2);\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"for (int j = 1; j <= K; j++) {\n\t\t\t\tfor (int j2 = 1; j2 <= K; j2++) {\n\t\t\t\t\tsum+=gcd(gcd(i, j), j2);\n\t\t\t\t}\n\t\t\t}",
"int j = 1;",
"int j = 1;",
"j",
"1",
"j <= K",
"j",
"K",
"j++",
"j++",
"j",
"{\n\t\t\t\tfor (int j2 = 1; j2 <= K; j2++) {\n\t\t\t\t\tsum+=gcd(gcd(i, j), j2);\n\t\t\t\t}\n\t\t\t}",
"{\n\t\t\t\tfor (int j2 = 1; j2 <= K; j2++) {\n\t\t\t\t\tsum+=gcd(gcd(i, j), j2);\n\t\t\t\t}\n\t\t\t}",
"for (int j2 = 1; j2 <= K; j2++) {\n\t\t\t\t\tsum+=gcd(gcd(i, j), j2);\n\t\t\t\t}",
"int j2 = 1;",
"int j2 = 1;",
"j2",
"1",
"j2 <= K",
"j2",
"K",
"j2++",
"j2++",
"j2",
"{\n\t\t\t\t\tsum+=gcd(gcd(i, j), j2);\n\t\t\t\t}",
"{\n\t\t\t\t\tsum+=gcd(gcd(i, j), j2);\n\t\t\t\t}",
"sum+=gcd(gcd(i, j), j2)",
"sum",
"gcd(gcd(i, j), j2)",
"gcd",
"gcd(i, j)",
"gcd",
"i",
"j",
"j2",
"System.out.println(sum)",
"System.out.println",
"System.out",
"System",
"System.out",
"sum",
"String[] args",
"args",
"static int gcd(int a,int b) {\n\t\tif (b==0) {\n\t\t\treturn a;\n\t\t}\n\t\treturn gcd(b,a%b);\n\t}",
"gcd",
"{\n\t\tif (b==0) {\n\t\t\treturn a;\n\t\t}\n\t\treturn gcd(b,a%b);\n\t}",
"if (b==0) {\n\t\t\treturn a;\n\t\t}",
"b==0",
"b",
"0",
"{\n\t\t\treturn a;\n\t\t}",
"return a;",
"a",
"return gcd(b,a%b);",
"gcd(b,a%b)",
"gcd",
"b",
"a%b",
"a",
"b",
"int a",
"a",
"int b",
"b",
"static class InputReader { \n\t\tprivate InputStream in;\n\t\tprivate byte[] buffer = new byte[1024];\n\t\tprivate int curbuf;\n\t\tprivate int lenbuf;\n\t\tpublic InputReader(InputStream in) {\n\t\t\tthis.in = in;\n\t\t\tthis.curbuf = this.lenbuf = 0;\n\t\t}\n \n\t\tpublic boolean hasNextByte() {\n\t\t\tif (curbuf >= lenbuf) {\n\t\t\t\tcurbuf = 0;\n\t\t\t\ttry {\n\t\t\t\t\tlenbuf = in.read(buffer);\n\t\t\t\t} catch (IOException e) {\n\t\t\t\t\tthrow new InputMismatchException();\n\t\t\t\t}\n\t\t\t\tif (lenbuf <= 0)\n\t\t\t\t\treturn false;\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n \n\t\tprivate int readByte() {\n\t\t\tif (hasNextByte())\n\t\t\t\treturn buffer[curbuf++];\n\t\t\telse\n\t\t\t\treturn -1;\n\t\t}\n \n\t\tprivate boolean isSpaceChar(int c) {\n\t\t\treturn !(c >= 33 && c <= 126);\n\t\t}\n \n\t\tprivate void skip() {\n\t\t\twhile (hasNextByte() && isSpaceChar(buffer[curbuf]))\n\t\t\t\tcurbuf++;\n\t\t}\n \n\t\tpublic boolean hasNext() {\n\t\t\tskip();\n\t\t\treturn hasNextByte();\n\t\t}\n \n\t\tpublic String next() {\n\t\t\tif (!hasNext())\n\t\t\t\tthrow new NoSuchElementException();\n\t\t\tStringBuilder sb = new StringBuilder();\n\t\t\tint b = readByte();\n\t\t\twhile (!isSpaceChar(b)) {\n\t\t\t\tsb.appendCodePoint(b);\n\t\t\t\tb = readByte();\n\t\t\t}\n\t\t\treturn sb.toString();\n\t\t}\n \n\t\tpublic int nextInt() {\n\t\t\tif (!hasNext())\n\t\t\t\tthrow new NoSuchElementException();\n\t\t\tint c = readByte();\n\t\t\twhile (isSpaceChar(c))\n\t\t\t\tc = readByte();\n\t\t\tboolean minus = false;\n\t\t\tif (c == '-') {\n\t\t\t\tminus = true;\n\t\t\t\tc = readByte();\n\t\t\t}\n\t\t\tint res = 0;\n\t\t\tdo {\n\t\t\t\tif (c < '0' || c > '9')\n\t\t\t\t\tthrow new InputMismatchException();\n\t\t\t\tres = res * 10 + c - '0';\n\t\t\t\tc = readByte();\n\t\t\t} while (!isSpaceChar(c));\n\t\t\treturn (minus) ? -res : res;\n\t\t}\n \n\t\tpublic long nextLong() {\n\t\t\tif (!hasNext())\n\t\t\t\tthrow new NoSuchElementException();\n\t\t\tint c = readByte();\n\t\t\twhile (isSpaceChar(c))\n\t\t\t\tc = readByte();\n\t\t\tboolean minus = false;\n\t\t\tif (c == '-') {\n\t\t\t\tminus = true;\n\t\t\t\tc = readByte();\n\t\t\t}\n\t\t\tlong res = 0;\n\t\t\tdo {\n\t\t\t\tif (c < '0' || c > '9')\n\t\t\t\t\tthrow new InputMismatchException();\n\t\t\t\tres = res * 10 + c - '0';\n\t\t\t\tc = readByte();\n\t\t\t} while (!isSpaceChar(c));\n\t\t\treturn (minus) ? -res : res;\n\t\t}\n \n\t\tpublic double nextDouble() {\n\t\t\treturn Double.parseDouble(next());\n\t\t}\n \n\t\tpublic int[] nextIntArray(int n) {\n\t\t\tint[] a = new int[n];\n\t\t\tfor (int i = 0; i < n; i++)\n\t\t\t\ta[i] = nextInt();\n\t\t\treturn a;\n\t\t}\n \n\t\tpublic long[] nextLongArray(int n) {\n\t\t\tlong[] a = new long[n];\n\t\t\tfor (int i = 0; i < n; i++)\n\t\t\t\ta[i] = nextLong();\n\t\t\treturn a;\n\t\t}\n \n\t\tpublic char[][] nextCharMap(int n, int m) {\n\t\t\tchar[][] map = new char[n][m];\n\t\t\tfor (int i = 0; i < n; i++)\n\t\t\t\tmap[i] = next().toCharArray();\n\t\t\treturn map;\n\t\t}\n\t}",
"InputReader",
"private InputStream in;",
"in",
"private byte[] buffer = new byte[1024];",
"buffer",
"new byte[1024]",
"1024",
"private int curbuf;",
"curbuf",
"private int lenbuf;",
"lenbuf",
"public InputReader(InputStream in) {\n\t\t\tthis.in = in;\n\t\t\tthis.curbuf = this.lenbuf = 0;\n\t\t}",
"InputReader",
"{\n\t\t\tthis.in = in;\n\t\t\tthis.curbuf = this.lenbuf = 0;\n\t\t}",
"this.in = in",
"this.in",
"this",
"this.in",
"in",
"this.curbuf = this.lenbuf = 0",
"this.curbuf",
"this",
"this.curbuf",
"this.lenbuf = 0",
"this.lenbuf",
"this",
"this.lenbuf",
"0",
"InputStream in",
"in",
"public boolean hasNextByte() {\n\t\t\tif (curbuf >= lenbuf) {\n\t\t\t\tcurbuf = 0;\n\t\t\t\ttry {\n\t\t\t\t\tlenbuf = in.read(buffer);\n\t\t\t\t} catch (IOException e) {\n\t\t\t\t\tthrow new InputMismatchException();\n\t\t\t\t}\n\t\t\t\tif (lenbuf <= 0)\n\t\t\t\t\treturn false;\n\t\t\t}\n\t\t\treturn true;\n\t\t}",
"hasNextByte",
"{\n\t\t\tif (curbuf >= lenbuf) {\n\t\t\t\tcurbuf = 0;\n\t\t\t\ttry {\n\t\t\t\t\tlenbuf = in.read(buffer);\n\t\t\t\t} catch (IOException e) {\n\t\t\t\t\tthrow new InputMismatchException();\n\t\t\t\t}\n\t\t\t\tif (lenbuf <= 0)\n\t\t\t\t\treturn false;\n\t\t\t}\n\t\t\treturn true;\n\t\t}",
"if (curbuf >= lenbuf) {\n\t\t\t\tcurbuf = 0;\n\t\t\t\ttry {\n\t\t\t\t\tlenbuf = in.read(buffer);\n\t\t\t\t} catch (IOException e) {\n\t\t\t\t\tthrow new InputMismatchException();\n\t\t\t\t}\n\t\t\t\tif (lenbuf <= 0)\n\t\t\t\t\treturn false;\n\t\t\t}",
"curbuf >= lenbuf",
"curbuf",
"lenbuf",
"{\n\t\t\t\tcurbuf = 0;\n\t\t\t\ttry {\n\t\t\t\t\tlenbuf = in.read(buffer);\n\t\t\t\t} catch (IOException e) {\n\t\t\t\t\tthrow new InputMismatchException();\n\t\t\t\t}\n\t\t\t\tif (lenbuf <= 0)\n\t\t\t\t\treturn false;\n\t\t\t}",
"curbuf = 0",
"curbuf",
"0",
"try {\n\t\t\t\t\tlenbuf = in.read(buffer);\n\t\t\t\t} catch (IOException e) {\n\t\t\t\t\tthrow new InputMismatchException();\n\t\t\t\t}",
"catch (IOException e) {\n\t\t\t\t\tthrow new InputMismatchException();\n\t\t\t\t}",
"IOException e",
"{\n\t\t\t\t\tthrow new InputMismatchException();\n\t\t\t\t}",
"throw new InputMismatchException();",
"new InputMismatchException()",
"{\n\t\t\t\t\tlenbuf = in.read(buffer);\n\t\t\t\t}",
"lenbuf = in.read(buffer)",
"lenbuf",
"in.read(buffer)",
"in.read",
"in",
"buffer",
"if (lenbuf <= 0)\n\t\t\t\t\treturn false;",
"lenbuf <= 0",
"lenbuf",
"0",
"return false;",
"false",
"return true;",
"true",
"private int readByte() {\n\t\t\tif (hasNextByte())\n\t\t\t\treturn buffer[curbuf++];\n\t\t\telse\n\t\t\t\treturn -1;\n\t\t}",
"readByte",
"{\n\t\t\tif (hasNextByte())\n\t\t\t\treturn buffer[curbuf++];\n\t\t\telse\n\t\t\t\treturn -1;\n\t\t}",
"if (hasNextByte())\n\t\t\t\treturn buffer[curbuf++];\n\t\t\telse\n\t\t\t\treturn -1;",
"hasNextByte()",
"hasNextByte",
"return buffer[curbuf++];",
"buffer[curbuf++]",
"buffer",
"curbuf++",
"curbuf",
"return -1;",
"-1",
"1",
"private boolean isSpaceChar(int c) {\n\t\t\treturn !(c >= 33 && c <= 126);\n\t\t}",
"isSpaceChar",
"{\n\t\t\treturn !(c >= 33 && c <= 126);\n\t\t}",
"return !(c >= 33 && c <= 126);",
"!(c >= 33 && c <= 126)",
"(c >= 33 && c <= 126)",
"c >= 33",
"c",
"33",
"c <= 126",
"c",
"126",
"int c",
"c",
"private void skip() {\n\t\t\twhile (hasNextByte() && isSpaceChar(buffer[curbuf]))\n\t\t\t\tcurbuf++;\n\t\t}",
"skip",
"{\n\t\t\twhile (hasNextByte() && isSpaceChar(buffer[curbuf]))\n\t\t\t\tcurbuf++;\n\t\t}",
"while (hasNextByte() && isSpaceChar(buffer[curbuf]))\n\t\t\t\tcurbuf++;",
"hasNextByte() && isSpaceChar(buffer[curbuf])",
"hasNextByte()",
"hasNextByte",
"isSpaceChar(buffer[curbuf])",
"isSpaceChar",
"buffer[curbuf]",
"buffer",
"curbuf",
"curbuf++",
"curbuf",
"public boolean hasNext() {\n\t\t\tskip();\n\t\t\treturn hasNextByte();\n\t\t}",
"hasNext",
"{\n\t\t\tskip();\n\t\t\treturn hasNextByte();\n\t\t}",
"skip()",
"skip",
"return hasNextByte();",
"hasNextByte()",
"hasNextByte",
"public String next() {\n\t\t\tif (!hasNext())\n\t\t\t\tthrow new NoSuchElementException();\n\t\t\tStringBuilder sb = new StringBuilder();\n\t\t\tint b = readByte();\n\t\t\twhile (!isSpaceChar(b)) {\n\t\t\t\tsb.appendCodePoint(b);\n\t\t\t\tb = readByte();\n\t\t\t}\n\t\t\treturn sb.toString();\n\t\t}",
"next",
"{\n\t\t\tif (!hasNext())\n\t\t\t\tthrow new NoSuchElementException();\n\t\t\tStringBuilder sb = new StringBuilder();\n\t\t\tint b = readByte();\n\t\t\twhile (!isSpaceChar(b)) {\n\t\t\t\tsb.appendCodePoint(b);\n\t\t\t\tb = readByte();\n\t\t\t}\n\t\t\treturn sb.toString();\n\t\t}",
"if (!hasNext())\n\t\t\t\tthrow new NoSuchElementException();",
"!hasNext()",
"hasNext()",
"hasNext",
"throw new NoSuchElementException();",
"new NoSuchElementException()",
"StringBuilder sb = new StringBuilder();",
"sb",
"new StringBuilder()",
"int b = readByte();",
"b",
"readByte()",
"readByte",
"while (!isSpaceChar(b)) {\n\t\t\t\tsb.appendCodePoint(b);\n\t\t\t\tb = readByte();\n\t\t\t}",
"!isSpaceChar(b)",
"isSpaceChar(b)",
"isSpaceChar",
"b",
"{\n\t\t\t\tsb.appendCodePoint(b);\n\t\t\t\tb = readByte();\n\t\t\t}",
"sb.appendCodePoint(b)",
"sb.appendCodePoint",
"sb",
"b",
"b = readByte()",
"b",
"readByte()",
"readByte",
"return sb.toString();",
"sb.toString()",
"sb.toString",
"sb",
"public int nextInt() {\n\t\t\tif (!hasNext())\n\t\t\t\tthrow new NoSuchElementException();\n\t\t\tint c = readByte();\n\t\t\twhile (isSpaceChar(c))\n\t\t\t\tc = readByte();\n\t\t\tboolean minus = false;\n\t\t\tif (c == '-') {\n\t\t\t\tminus = true;\n\t\t\t\tc = readByte();\n\t\t\t}\n\t\t\tint res = 0;\n\t\t\tdo {\n\t\t\t\tif (c < '0' || c > '9')\n\t\t\t\t\tthrow new InputMismatchException();\n\t\t\t\tres = res * 10 + c - '0';\n\t\t\t\tc = readByte();\n\t\t\t} while (!isSpaceChar(c));\n\t\t\treturn (minus) ? -res : res;\n\t\t}",
"nextInt",
"{\n\t\t\tif (!hasNext())\n\t\t\t\tthrow new NoSuchElementException();\n\t\t\tint c = readByte();\n\t\t\twhile (isSpaceChar(c))\n\t\t\t\tc = readByte();\n\t\t\tboolean minus = false;\n\t\t\tif (c == '-') {\n\t\t\t\tminus = true;\n\t\t\t\tc = readByte();\n\t\t\t}\n\t\t\tint res = 0;\n\t\t\tdo {\n\t\t\t\tif (c < '0' || c > '9')\n\t\t\t\t\tthrow new InputMismatchException();\n\t\t\t\tres = res * 10 + c - '0';\n\t\t\t\tc = readByte();\n\t\t\t} while (!isSpaceChar(c));\n\t\t\treturn (minus) ? -res : res;\n\t\t}",
"if (!hasNext())\n\t\t\t\tthrow new NoSuchElementException();",
"!hasNext()",
"hasNext()",
"hasNext",
"throw new NoSuchElementException();",
"new NoSuchElementException()",
"int c = readByte();",
"c",
"readByte()",
"readByte",
"while (isSpaceChar(c))\n\t\t\t\tc = readByte();",
"isSpaceChar(c)",
"isSpaceChar",
"c",
"c = readByte()",
"c",
"readByte()",
"readByte",
"boolean minus = false;",
"minus",
"false",
"if (c == '-') {\n\t\t\t\tminus = true;\n\t\t\t\tc = readByte();\n\t\t\t}",
"c == '-'",
"c",
"'-'",
"{\n\t\t\t\tminus = true;\n\t\t\t\tc = readByte();\n\t\t\t}",
"minus = true",
"minus",
"true",
"c = readByte()",
"c",
"readByte()",
"readByte",
"int res = 0;",
"res",
"0",
"do {\n\t\t\t\tif (c < '0' || c > '9')\n\t\t\t\t\tthrow new InputMismatchException();\n\t\t\t\tres = res * 10 + c - '0';\n\t\t\t\tc = readByte();\n\t\t\t} while (!isSpaceChar(c));",
"!isSpaceChar(c)",
"isSpaceChar(c)",
"isSpaceChar",
"c",
"{\n\t\t\t\tif (c < '0' || c > '9')\n\t\t\t\t\tthrow new InputMismatchException();\n\t\t\t\tres = res * 10 + c - '0';\n\t\t\t\tc = readByte();\n\t\t\t}",
"if (c < '0' || c > '9')\n\t\t\t\t\tthrow new InputMismatchException();",
"c < '0' || c > '9'",
"c < '0'",
"c",
"'0'",
"c > '9'",
"c",
"'9'",
"throw new InputMismatchException();",
"new InputMismatchException()",
"res = res * 10 + c - '0'",
"res",
"res * 10 + c - '0'",
"res * 10 + c",
"res * 10",
"res",
"10",
"c",
"'0'",
"c = readByte()",
"c",
"readByte()",
"readByte",
"return (minus) ? -res : res;",
"(minus) ? -res : res",
"(minus)",
"-res",
"res",
"res",
"public long nextLong() {\n\t\t\tif (!hasNext())\n\t\t\t\tthrow new NoSuchElementException();\n\t\t\tint c = readByte();\n\t\t\twhile (isSpaceChar(c))\n\t\t\t\tc = readByte();\n\t\t\tboolean minus = false;\n\t\t\tif (c == '-') {\n\t\t\t\tminus = true;\n\t\t\t\tc = readByte();\n\t\t\t}\n\t\t\tlong res = 0;\n\t\t\tdo {\n\t\t\t\tif (c < '0' || c > '9')\n\t\t\t\t\tthrow new InputMismatchException();\n\t\t\t\tres = res * 10 + c - '0';\n\t\t\t\tc = readByte();\n\t\t\t} while (!isSpaceChar(c));\n\t\t\treturn (minus) ? -res : res;\n\t\t}",
"nextLong",
"{\n\t\t\tif (!hasNext())\n\t\t\t\tthrow new NoSuchElementException();\n\t\t\tint c = readByte();\n\t\t\twhile (isSpaceChar(c))\n\t\t\t\tc = readByte();\n\t\t\tboolean minus = false;\n\t\t\tif (c == '-') {\n\t\t\t\tminus = true;\n\t\t\t\tc = readByte();\n\t\t\t}\n\t\t\tlong res = 0;\n\t\t\tdo {\n\t\t\t\tif (c < '0' || c > '9')\n\t\t\t\t\tthrow new InputMismatchException();\n\t\t\t\tres = res * 10 + c - '0';\n\t\t\t\tc = readByte();\n\t\t\t} while (!isSpaceChar(c));\n\t\t\treturn (minus) ? -res : res;\n\t\t}",
"if (!hasNext())\n\t\t\t\tthrow new NoSuchElementException();",
"!hasNext()",
"hasNext()",
"hasNext",
"throw new NoSuchElementException();",
"new NoSuchElementException()",
"int c = readByte();",
"c",
"readByte()",
"readByte",
"while (isSpaceChar(c))\n\t\t\t\tc = readByte();",
"isSpaceChar(c)",
"isSpaceChar",
"c",
"c = readByte()",
"c",
"readByte()",
"readByte",
"boolean minus = false;",
"minus",
"false",
"if (c == '-') {\n\t\t\t\tminus = true;\n\t\t\t\tc = readByte();\n\t\t\t}",
"c == '-'",
"c",
"'-'",
"{\n\t\t\t\tminus = true;\n\t\t\t\tc = readByte();\n\t\t\t}",
"minus = true",
"minus",
"true",
"c = readByte()",
"c",
"readByte()",
"readByte",
"long res = 0;",
"res",
"0",
"do {\n\t\t\t\tif (c < '0' || c > '9')\n\t\t\t\t\tthrow new InputMismatchException();\n\t\t\t\tres = res * 10 + c - '0';\n\t\t\t\tc = readByte();\n\t\t\t} while (!isSpaceChar(c));",
"!isSpaceChar(c)",
"isSpaceChar(c)",
"isSpaceChar",
"c",
"{\n\t\t\t\tif (c < '0' || c > '9')\n\t\t\t\t\tthrow new InputMismatchException();\n\t\t\t\tres = res * 10 + c - '0';\n\t\t\t\tc = readByte();\n\t\t\t}",
"if (c < '0' || c > '9')\n\t\t\t\t\tthrow new InputMismatchException();",
"c < '0' || c > '9'",
"c < '0'",
"c",
"'0'",
"c > '9'",
"c",
"'9'",
"throw new InputMismatchException();",
"new InputMismatchException()",
"res = res * 10 + c - '0'",
"res",
"res * 10 + c - '0'",
"res * 10 + c",
"res * 10",
"res",
"10",
"c",
"'0'",
"c = readByte()",
"c",
"readByte()",
"readByte",
"return (minus) ? -res : res;",
"(minus) ? -res : res",
"(minus)",
"-res",
"res",
"res",
"public double nextDouble() {\n\t\t\treturn Double.parseDouble(next());\n\t\t}",
"nextDouble",
"{\n\t\t\treturn Double.parseDouble(next());\n\t\t}",
"return Double.parseDouble(next());",
"Double.parseDouble(next())",
"Double.parseDouble",
"Double",
"next()",
"next",
"public int[] nextIntArray(int n) {\n\t\t\tint[] a = new int[n];\n\t\t\tfor (int i = 0; i < n; i++)\n\t\t\t\ta[i] = nextInt();\n\t\t\treturn a;\n\t\t}",
"nextIntArray",
"{\n\t\t\tint[] a = new int[n];\n\t\t\tfor (int i = 0; i < n; i++)\n\t\t\t\ta[i] = nextInt();\n\t\t\treturn a;\n\t\t}",
"int[] a = new int[n];",
"a",
"new int[n]",
"n",
"for (int i = 0; i < n; i++)\n\t\t\t\ta[i] = nextInt();",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < n",
"i",
"n",
"i++",
"i++",
"i",
"a[i] = nextInt();",
"a[i] = nextInt()",
"a[i]",
"a",
"i",
"nextInt()",
"nextInt",
"return a;",
"a",
"int n",
"n",
"public long[] nextLongArray(int n) {\n\t\t\tlong[] a = new long[n];\n\t\t\tfor (int i = 0; i < n; i++)\n\t\t\t\ta[i] = nextLong();\n\t\t\treturn a;\n\t\t}",
"nextLongArray",
"{\n\t\t\tlong[] a = new long[n];\n\t\t\tfor (int i = 0; i < n; i++)\n\t\t\t\ta[i] = nextLong();\n\t\t\treturn a;\n\t\t}",
"long[] a = new long[n];",
"a",
"new long[n]",
"n",
"for (int i = 0; i < n; i++)\n\t\t\t\ta[i] = nextLong();",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < n",
"i",
"n",
"i++",
"i++",
"i",
"a[i] = nextLong();",
"a[i] = nextLong()",
"a[i]",
"a",
"i",
"nextLong()",
"nextLong",
"return a;",
"a",
"int n",
"n",
"public char[][] nextCharMap(int n, int m) {\n\t\t\tchar[][] map = new char[n][m];\n\t\t\tfor (int i = 0; i < n; i++)\n\t\t\t\tmap[i] = next().toCharArray();\n\t\t\treturn map;\n\t\t}",
"nextCharMap",
"{\n\t\t\tchar[][] map = new char[n][m];\n\t\t\tfor (int i = 0; i < n; i++)\n\t\t\t\tmap[i] = next().toCharArray();\n\t\t\treturn map;\n\t\t}",
"char[][] map = new char[n][m];",
"map",
"new char[n][m]",
"n",
"m",
"for (int i = 0; i < n; i++)\n\t\t\t\tmap[i] = next().toCharArray();",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < n",
"i",
"n",
"i++",
"i++",
"i",
"map[i] = next().toCharArray();",
"map[i] = next().toCharArray()",
"map[i]",
"map",
"i",
"next().toCharArray()",
"next().toCharArray",
"next()",
"next",
"return map;",
"map",
"int n",
"n",
"int m",
"m",
"public class Main {\n\tpublic static void main(String[] args){\n\t\tPrintWriter out = new PrintWriter(System.out);\n\t\tInputReader sc=new InputReader(System.in);\n\t\tlong sum=0;\n\t\tint K=sc.nextInt();\n\t\tfor (int i = 1; i <= K; i++) {\n\t\t\tfor (int j = 1; j <= K; j++) {\n\t\t\t\tfor (int j2 = 1; j2 <= K; j2++) {\n\t\t\t\t\tsum+=gcd(gcd(i, j), j2);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(sum);\n\t}\n\tstatic int gcd(int a,int b) {\n\t\tif (b==0) {\n\t\t\treturn a;\n\t\t}\n\t\treturn gcd(b,a%b);\n\t}\n\tstatic class InputReader { \n\t\tprivate InputStream in;\n\t\tprivate byte[] buffer = new byte[1024];\n\t\tprivate int curbuf;\n\t\tprivate int lenbuf;\n\t\tpublic InputReader(InputStream in) {\n\t\t\tthis.in = in;\n\t\t\tthis.curbuf = this.lenbuf = 0;\n\t\t}\n \n\t\tpublic boolean hasNextByte() {\n\t\t\tif (curbuf >= lenbuf) {\n\t\t\t\tcurbuf = 0;\n\t\t\t\ttry {\n\t\t\t\t\tlenbuf = in.read(buffer);\n\t\t\t\t} catch (IOException e) {\n\t\t\t\t\tthrow new InputMismatchException();\n\t\t\t\t}\n\t\t\t\tif (lenbuf <= 0)\n\t\t\t\t\treturn false;\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n \n\t\tprivate int readByte() {\n\t\t\tif (hasNextByte())\n\t\t\t\treturn buffer[curbuf++];\n\t\t\telse\n\t\t\t\treturn -1;\n\t\t}\n \n\t\tprivate boolean isSpaceChar(int c) {\n\t\t\treturn !(c >= 33 && c <= 126);\n\t\t}\n \n\t\tprivate void skip() {\n\t\t\twhile (hasNextByte() && isSpaceChar(buffer[curbuf]))\n\t\t\t\tcurbuf++;\n\t\t}\n \n\t\tpublic boolean hasNext() {\n\t\t\tskip();\n\t\t\treturn hasNextByte();\n\t\t}\n \n\t\tpublic String next() {\n\t\t\tif (!hasNext())\n\t\t\t\tthrow new NoSuchElementException();\n\t\t\tStringBuilder sb = new StringBuilder();\n\t\t\tint b = readByte();\n\t\t\twhile (!isSpaceChar(b)) {\n\t\t\t\tsb.appendCodePoint(b);\n\t\t\t\tb = readByte();\n\t\t\t}\n\t\t\treturn sb.toString();\n\t\t}\n \n\t\tpublic int nextInt() {\n\t\t\tif (!hasNext())\n\t\t\t\tthrow new NoSuchElementException();\n\t\t\tint c = readByte();\n\t\t\twhile (isSpaceChar(c))\n\t\t\t\tc = readByte();\n\t\t\tboolean minus = false;\n\t\t\tif (c == '-') {\n\t\t\t\tminus = true;\n\t\t\t\tc = readByte();\n\t\t\t}\n\t\t\tint res = 0;\n\t\t\tdo {\n\t\t\t\tif (c < '0' || c > '9')\n\t\t\t\t\tthrow new InputMismatchException();\n\t\t\t\tres = res * 10 + c - '0';\n\t\t\t\tc = readByte();\n\t\t\t} while (!isSpaceChar(c));\n\t\t\treturn (minus) ? -res : res;\n\t\t}\n \n\t\tpublic long nextLong() {\n\t\t\tif (!hasNext())\n\t\t\t\tthrow new NoSuchElementException();\n\t\t\tint c = readByte();\n\t\t\twhile (isSpaceChar(c))\n\t\t\t\tc = readByte();\n\t\t\tboolean minus = false;\n\t\t\tif (c == '-') {\n\t\t\t\tminus = true;\n\t\t\t\tc = readByte();\n\t\t\t}\n\t\t\tlong res = 0;\n\t\t\tdo {\n\t\t\t\tif (c < '0' || c > '9')\n\t\t\t\t\tthrow new InputMismatchException();\n\t\t\t\tres = res * 10 + c - '0';\n\t\t\t\tc = readByte();\n\t\t\t} while (!isSpaceChar(c));\n\t\t\treturn (minus) ? -res : res;\n\t\t}\n \n\t\tpublic double nextDouble() {\n\t\t\treturn Double.parseDouble(next());\n\t\t}\n \n\t\tpublic int[] nextIntArray(int n) {\n\t\t\tint[] a = new int[n];\n\t\t\tfor (int i = 0; i < n; i++)\n\t\t\t\ta[i] = nextInt();\n\t\t\treturn a;\n\t\t}\n \n\t\tpublic long[] nextLongArray(int n) {\n\t\t\tlong[] a = new long[n];\n\t\t\tfor (int i = 0; i < n; i++)\n\t\t\t\ta[i] = nextLong();\n\t\t\treturn a;\n\t\t}\n \n\t\tpublic char[][] nextCharMap(int n, int m) {\n\t\t\tchar[][] map = new char[n][m];\n\t\t\tfor (int i = 0; i < n; i++)\n\t\t\t\tmap[i] = next().toCharArray();\n\t\t\treturn map;\n\t\t}\n\t}\n}",
"public class Main {\n\tpublic static void main(String[] args){\n\t\tPrintWriter out = new PrintWriter(System.out);\n\t\tInputReader sc=new InputReader(System.in);\n\t\tlong sum=0;\n\t\tint K=sc.nextInt();\n\t\tfor (int i = 1; i <= K; i++) {\n\t\t\tfor (int j = 1; j <= K; j++) {\n\t\t\t\tfor (int j2 = 1; j2 <= K; j2++) {\n\t\t\t\t\tsum+=gcd(gcd(i, j), j2);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(sum);\n\t}\n\tstatic int gcd(int a,int b) {\n\t\tif (b==0) {\n\t\t\treturn a;\n\t\t}\n\t\treturn gcd(b,a%b);\n\t}\n\tstatic class InputReader { \n\t\tprivate InputStream in;\n\t\tprivate byte[] buffer = new byte[1024];\n\t\tprivate int curbuf;\n\t\tprivate int lenbuf;\n\t\tpublic InputReader(InputStream in) {\n\t\t\tthis.in = in;\n\t\t\tthis.curbuf = this.lenbuf = 0;\n\t\t}\n \n\t\tpublic boolean hasNextByte() {\n\t\t\tif (curbuf >= lenbuf) {\n\t\t\t\tcurbuf = 0;\n\t\t\t\ttry {\n\t\t\t\t\tlenbuf = in.read(buffer);\n\t\t\t\t} catch (IOException e) {\n\t\t\t\t\tthrow new InputMismatchException();\n\t\t\t\t}\n\t\t\t\tif (lenbuf <= 0)\n\t\t\t\t\treturn false;\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n \n\t\tprivate int readByte() {\n\t\t\tif (hasNextByte())\n\t\t\t\treturn buffer[curbuf++];\n\t\t\telse\n\t\t\t\treturn -1;\n\t\t}\n \n\t\tprivate boolean isSpaceChar(int c) {\n\t\t\treturn !(c >= 33 && c <= 126);\n\t\t}\n \n\t\tprivate void skip() {\n\t\t\twhile (hasNextByte() && isSpaceChar(buffer[curbuf]))\n\t\t\t\tcurbuf++;\n\t\t}\n \n\t\tpublic boolean hasNext() {\n\t\t\tskip();\n\t\t\treturn hasNextByte();\n\t\t}\n \n\t\tpublic String next() {\n\t\t\tif (!hasNext())\n\t\t\t\tthrow new NoSuchElementException();\n\t\t\tStringBuilder sb = new StringBuilder();\n\t\t\tint b = readByte();\n\t\t\twhile (!isSpaceChar(b)) {\n\t\t\t\tsb.appendCodePoint(b);\n\t\t\t\tb = readByte();\n\t\t\t}\n\t\t\treturn sb.toString();\n\t\t}\n \n\t\tpublic int nextInt() {\n\t\t\tif (!hasNext())\n\t\t\t\tthrow new NoSuchElementException();\n\t\t\tint c = readByte();\n\t\t\twhile (isSpaceChar(c))\n\t\t\t\tc = readByte();\n\t\t\tboolean minus = false;\n\t\t\tif (c == '-') {\n\t\t\t\tminus = true;\n\t\t\t\tc = readByte();\n\t\t\t}\n\t\t\tint res = 0;\n\t\t\tdo {\n\t\t\t\tif (c < '0' || c > '9')\n\t\t\t\t\tthrow new InputMismatchException();\n\t\t\t\tres = res * 10 + c - '0';\n\t\t\t\tc = readByte();\n\t\t\t} while (!isSpaceChar(c));\n\t\t\treturn (minus) ? -res : res;\n\t\t}\n \n\t\tpublic long nextLong() {\n\t\t\tif (!hasNext())\n\t\t\t\tthrow new NoSuchElementException();\n\t\t\tint c = readByte();\n\t\t\twhile (isSpaceChar(c))\n\t\t\t\tc = readByte();\n\t\t\tboolean minus = false;\n\t\t\tif (c == '-') {\n\t\t\t\tminus = true;\n\t\t\t\tc = readByte();\n\t\t\t}\n\t\t\tlong res = 0;\n\t\t\tdo {\n\t\t\t\tif (c < '0' || c > '9')\n\t\t\t\t\tthrow new InputMismatchException();\n\t\t\t\tres = res * 10 + c - '0';\n\t\t\t\tc = readByte();\n\t\t\t} while (!isSpaceChar(c));\n\t\t\treturn (minus) ? -res : res;\n\t\t}\n \n\t\tpublic double nextDouble() {\n\t\t\treturn Double.parseDouble(next());\n\t\t}\n \n\t\tpublic int[] nextIntArray(int n) {\n\t\t\tint[] a = new int[n];\n\t\t\tfor (int i = 0; i < n; i++)\n\t\t\t\ta[i] = nextInt();\n\t\t\treturn a;\n\t\t}\n \n\t\tpublic long[] nextLongArray(int n) {\n\t\t\tlong[] a = new long[n];\n\t\t\tfor (int i = 0; i < n; i++)\n\t\t\t\ta[i] = nextLong();\n\t\t\treturn a;\n\t\t}\n \n\t\tpublic char[][] nextCharMap(int n, int m) {\n\t\t\tchar[][] map = new char[n][m];\n\t\t\tfor (int i = 0; i < n; i++)\n\t\t\t\tmap[i] = next().toCharArray();\n\t\t\treturn map;\n\t\t}\n\t}\n}",
"Main"
] |
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.util.*;
import java.util.logging.Logger;
public class Main {
public static void main(String[] args){
PrintWriter out = new PrintWriter(System.out);
InputReader sc=new InputReader(System.in);
long sum=0;
int K=sc.nextInt();
for (int i = 1; i <= K; i++) {
for (int j = 1; j <= K; j++) {
for (int j2 = 1; j2 <= K; j2++) {
sum+=gcd(gcd(i, j), j2);
}
}
}
System.out.println(sum);
}
static int gcd(int a,int b) {
if (b==0) {
return a;
}
return gcd(b,a%b);
}
static class InputReader {
private InputStream in;
private byte[] buffer = new byte[1024];
private int curbuf;
private int lenbuf;
public InputReader(InputStream in) {
this.in = in;
this.curbuf = this.lenbuf = 0;
}
public boolean hasNextByte() {
if (curbuf >= lenbuf) {
curbuf = 0;
try {
lenbuf = in.read(buffer);
} catch (IOException e) {
throw new InputMismatchException();
}
if (lenbuf <= 0)
return false;
}
return true;
}
private int readByte() {
if (hasNextByte())
return buffer[curbuf++];
else
return -1;
}
private boolean isSpaceChar(int c) {
return !(c >= 33 && c <= 126);
}
private void skip() {
while (hasNextByte() && isSpaceChar(buffer[curbuf]))
curbuf++;
}
public boolean hasNext() {
skip();
return hasNextByte();
}
public String next() {
if (!hasNext())
throw new NoSuchElementException();
StringBuilder sb = new StringBuilder();
int b = readByte();
while (!isSpaceChar(b)) {
sb.appendCodePoint(b);
b = readByte();
}
return sb.toString();
}
public int nextInt() {
if (!hasNext())
throw new NoSuchElementException();
int c = readByte();
while (isSpaceChar(c))
c = readByte();
boolean minus = false;
if (c == '-') {
minus = true;
c = readByte();
}
int res = 0;
do {
if (c < '0' || c > '9')
throw new InputMismatchException();
res = res * 10 + c - '0';
c = readByte();
} while (!isSpaceChar(c));
return (minus) ? -res : res;
}
public long nextLong() {
if (!hasNext())
throw new NoSuchElementException();
int c = readByte();
while (isSpaceChar(c))
c = readByte();
boolean minus = false;
if (c == '-') {
minus = true;
c = readByte();
}
long res = 0;
do {
if (c < '0' || c > '9')
throw new InputMismatchException();
res = res * 10 + c - '0';
c = readByte();
} while (!isSpaceChar(c));
return (minus) ? -res : res;
}
public double nextDouble() {
return Double.parseDouble(next());
}
public int[] nextIntArray(int n) {
int[] a = new int[n];
for (int i = 0; i < n; i++)
a[i] = nextInt();
return a;
}
public long[] nextLongArray(int n) {
long[] a = new long[n];
for (int i = 0; i < n; i++)
a[i] = nextLong();
return a;
}
public char[][] nextCharMap(int n, int m) {
char[][] map = new char[n][m];
for (int i = 0; i < n; i++)
map[i] = next().toCharArray();
return map;
}
}
}
|
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
4,
13,
4,
13,
13,
13,
13,
4,
18,
18,
13,
13,
13,
23,
13,
12,
13,
30,
41,
13,
2,
13,
13,
14,
2,
13,
17,
30,
29,
13,
30,
29,
4,
13,
13,
13,
23,
13,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
102,
5
],
[
102,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
8,
17
],
[
17,
18
],
[
17,
19
],
[
8,
20
],
[
20,
21
],
[
21,
22
],
[
22,
23
],
[
22,
24
],
[
20,
25
],
[
25,
26
],
[
25,
27
],
[
20,
28
],
[
28,
29
],
[
29,
30
],
[
20,
31
],
[
32,
32
],
[
32,
33
],
[
33,
34
],
[
34,
35
],
[
35,
36
],
[
35,
37
],
[
33,
38
],
[
38,
39
],
[
38,
40
],
[
33,
41
],
[
41,
42
],
[
42,
43
],
[
33,
44
],
[
45,
45
],
[
45,
46
],
[
46,
47
],
[
47,
48
],
[
48,
49
],
[
48,
50
],
[
46,
51
],
[
51,
52
],
[
51,
53
],
[
46,
54
],
[
54,
55
],
[
55,
56
],
[
46,
57
],
[
58,
58
],
[
58,
59
],
[
59,
60
],
[
59,
61
],
[
61,
62
],
[
61,
63
],
[
63,
64
],
[
63,
65
],
[
63,
66
],
[
61,
67
],
[
8,
68
],
[
68,
69
],
[
69,
70
],
[
70,
71
],
[
70,
72
],
[
68,
73
],
[
6,
74
],
[
74,
75
],
[
102,
76
],
[
76,
77
],
[
76,
78
],
[
78,
79
],
[
79,
80
],
[
79,
81
],
[
81,
82
],
[
81,
83
],
[
78,
84
],
[
84,
85
],
[
85,
86
],
[
85,
87
],
[
84,
88
],
[
88,
89
],
[
89,
90
],
[
84,
91
],
[
91,
92
],
[
92,
93
],
[
93,
94
],
[
93,
95
],
[
93,
96
],
[
76,
97
],
[
97,
98
],
[
76,
99
],
[
99,
100
],
[
0,
101
],
[
101,
102
],
[
101,
103
]
] |
[
"import java.util.Scanner;\n\n/**\n * Main\n */\npublic class Main {\n\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n\n int K = sc.nextInt();\n long total=0;\n\n for(int i=1; i<=K; i++){\n for(int j = 1; j<=K; j++){\n for(int l=1; l<=K; l++){\n total += gcd(gcd(i, j),l);\n // System.out.println(gcd(gcd(i, j),l));\n }\n }\n }\n System.out.println(total);\n }\n\n public static int gcd(int a, int b) {\n int r = a % b;\n if(r==0){\n return b;\n }else{\n return gcd(b,r);\n }\n }\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n\n int K = sc.nextInt();\n long total=0;\n\n for(int i=1; i<=K; i++){\n for(int j = 1; j<=K; j++){\n for(int l=1; l<=K; l++){\n total += gcd(gcd(i, j),l);\n // System.out.println(gcd(gcd(i, j),l));\n }\n }\n }\n System.out.println(total);\n }\n\n public static int gcd(int a, int b) {\n int r = a % b;\n if(r==0){\n return b;\n }else{\n return gcd(b,r);\n }\n }\n}",
"Main",
"public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n\n int K = sc.nextInt();\n long total=0;\n\n for(int i=1; i<=K; i++){\n for(int j = 1; j<=K; j++){\n for(int l=1; l<=K; l++){\n total += gcd(gcd(i, j),l);\n // System.out.println(gcd(gcd(i, j),l));\n }\n }\n }\n System.out.println(total);\n }",
"main",
"{\n Scanner sc = new Scanner(System.in);\n\n int K = sc.nextInt();\n long total=0;\n\n for(int i=1; i<=K; i++){\n for(int j = 1; j<=K; j++){\n for(int l=1; l<=K; l++){\n total += gcd(gcd(i, j),l);\n // System.out.println(gcd(gcd(i, j),l));\n }\n }\n }\n System.out.println(total);\n }",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"int K = sc.nextInt();",
"K",
"sc.nextInt()",
"sc.nextInt",
"sc",
"long total=0;",
"total",
"0",
"for(int i=1; i<=K; i++){\n for(int j = 1; j<=K; j++){\n for(int l=1; l<=K; l++){\n total += gcd(gcd(i, j),l);\n // System.out.println(gcd(gcd(i, j),l));\n }\n }\n }",
"int i=1;",
"int i=1;",
"i",
"1",
"i<=K",
"i",
"K",
"i++",
"i++",
"i",
"{\n for(int j = 1; j<=K; j++){\n for(int l=1; l<=K; l++){\n total += gcd(gcd(i, j),l);\n // System.out.println(gcd(gcd(i, j),l));\n }\n }\n }",
"{\n for(int j = 1; j<=K; j++){\n for(int l=1; l<=K; l++){\n total += gcd(gcd(i, j),l);\n // System.out.println(gcd(gcd(i, j),l));\n }\n }\n }",
"for(int j = 1; j<=K; j++){\n for(int l=1; l<=K; l++){\n total += gcd(gcd(i, j),l);\n // System.out.println(gcd(gcd(i, j),l));\n }\n }",
"int j = 1;",
"int j = 1;",
"j",
"1",
"j<=K",
"j",
"K",
"j++",
"j++",
"j",
"{\n for(int l=1; l<=K; l++){\n total += gcd(gcd(i, j),l);\n // System.out.println(gcd(gcd(i, j),l));\n }\n }",
"{\n for(int l=1; l<=K; l++){\n total += gcd(gcd(i, j),l);\n // System.out.println(gcd(gcd(i, j),l));\n }\n }",
"for(int l=1; l<=K; l++){\n total += gcd(gcd(i, j),l);\n // System.out.println(gcd(gcd(i, j),l));\n }",
"int l=1;",
"int l=1;",
"l",
"1",
"l<=K",
"l",
"K",
"l++",
"l++",
"l",
"{\n total += gcd(gcd(i, j),l);\n // System.out.println(gcd(gcd(i, j),l));\n }",
"{\n total += gcd(gcd(i, j),l);\n // System.out.println(gcd(gcd(i, j),l));\n }",
"total += gcd(gcd(i, j),l)",
"total",
"gcd(gcd(i, j),l)",
"gcd",
"gcd(i, j)",
"gcd",
"i",
"j",
"l",
"System.out.println(total)",
"System.out.println",
"System.out",
"System",
"System.out",
"total",
"String[] args",
"args",
"public static int gcd(int a, int b) {\n int r = a % b;\n if(r==0){\n return b;\n }else{\n return gcd(b,r);\n }\n }",
"gcd",
"{\n int r = a % b;\n if(r==0){\n return b;\n }else{\n return gcd(b,r);\n }\n }",
"int r = a % b;",
"r",
"a % b",
"a",
"b",
"if(r==0){\n return b;\n }else{\n return gcd(b,r);\n }",
"r==0",
"r",
"0",
"{\n return b;\n }",
"return b;",
"b",
"{\n return gcd(b,r);\n }",
"return gcd(b,r);",
"gcd(b,r)",
"gcd",
"b",
"r",
"int a",
"a",
"int b",
"b",
"public class Main {\n\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n\n int K = sc.nextInt();\n long total=0;\n\n for(int i=1; i<=K; i++){\n for(int j = 1; j<=K; j++){\n for(int l=1; l<=K; l++){\n total += gcd(gcd(i, j),l);\n // System.out.println(gcd(gcd(i, j),l));\n }\n }\n }\n System.out.println(total);\n }\n\n public static int gcd(int a, int b) {\n int r = a % b;\n if(r==0){\n return b;\n }else{\n return gcd(b,r);\n }\n }\n}",
"public class Main {\n\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n\n int K = sc.nextInt();\n long total=0;\n\n for(int i=1; i<=K; i++){\n for(int j = 1; j<=K; j++){\n for(int l=1; l<=K; l++){\n total += gcd(gcd(i, j),l);\n // System.out.println(gcd(gcd(i, j),l));\n }\n }\n }\n System.out.println(total);\n }\n\n public static int gcd(int a, int b) {\n int r = a % b;\n if(r==0){\n return b;\n }else{\n return gcd(b,r);\n }\n }\n}",
"Main"
] |
import java.util.Scanner;
/**
* Main
*/
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int K = sc.nextInt();
long total=0;
for(int i=1; i<=K; i++){
for(int j = 1; j<=K; j++){
for(int l=1; l<=K; l++){
total += gcd(gcd(i, j),l);
// System.out.println(gcd(gcd(i, j),l));
}
}
}
System.out.println(total);
}
public static int gcd(int a, int b) {
int r = a % b;
if(r==0){
return b;
}else{
return gcd(b,r);
}
}
}
|
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
4,
13,
13,
13,
4,
13,
4,
13,
13,
13,
13,
0,
13,
2,
13,
4,
13,
4,
13,
13,
13,
13,
4,
18,
18,
13,
13,
13,
23,
13,
12,
13,
30,
14,
2,
13,
13,
29,
4,
13,
13,
13,
14,
2,
13,
17,
29,
13,
29,
4,
13,
13,
2,
13,
13,
23,
13,
23,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
8,
17
],
[
17,
18
],
[
17,
19
],
[
8,
20
],
[
20,
21
],
[
21,
22
],
[
22,
23
],
[
22,
24
],
[
20,
25
],
[
25,
26
],
[
25,
27
],
[
20,
28
],
[
28,
29
],
[
29,
30
],
[
20,
31
],
[
32,
32
],
[
32,
33
],
[
33,
34
],
[
34,
35
],
[
35,
36
],
[
35,
37
],
[
33,
38
],
[
38,
39
],
[
38,
40
],
[
33,
41
],
[
41,
42
],
[
42,
43
],
[
33,
44
],
[
45,
45
],
[
45,
46
],
[
46,
47
],
[
47,
48
],
[
48,
49
],
[
48,
50
],
[
46,
51
],
[
51,
52
],
[
51,
53
],
[
46,
54
],
[
54,
55
],
[
55,
56
],
[
46,
57
],
[
58,
58
],
[
58,
59
],
[
59,
60
],
[
59,
61
],
[
59,
62
],
[
58,
63
],
[
63,
64
],
[
63,
65
],
[
65,
66
],
[
65,
67
],
[
65,
68
],
[
63,
69
],
[
58,
70
],
[
70,
71
],
[
70,
72
],
[
72,
73
],
[
72,
74
],
[
74,
75
],
[
74,
76
],
[
76,
77
],
[
76,
78
],
[
76,
79
],
[
74,
80
],
[
8,
81
],
[
81,
82
],
[
82,
83
],
[
83,
84
],
[
83,
85
],
[
81,
86
],
[
6,
87
],
[
87,
88
],
[
4,
89
],
[
89,
90
],
[
89,
91
],
[
91,
92
],
[
92,
93
],
[
93,
94
],
[
93,
95
],
[
92,
96
],
[
96,
97
],
[
97,
98
],
[
97,
99
],
[
97,
100
],
[
91,
101
],
[
101,
102
],
[
102,
103
],
[
102,
104
],
[
101,
105
],
[
105,
106
],
[
91,
107
],
[
107,
108
],
[
108,
109
],
[
108,
110
],
[
108,
111
],
[
111,
112
],
[
111,
113
],
[
89,
114
],
[
114,
115
],
[
89,
116
],
[
116,
117
]
] |
[
"import java.util.*;\n\nclass Main {\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n long N = sc.nextLong();\n long ans = 0;\n\n for (int a = 1; a <= N; a++) {\n for (int b = 1; b <= N; b++) {\n for (int c = 1; c <= N; c++) {\n gcd(a, b);\n gcd(gcd(a, b), c);\n ans = ans + gcd(gcd(a, b), c);\n }\n }\n }\n System.out.println(ans);\n }\n\n private static int gcd(int i, int j) {\n if(i < j) return gcd(j, i);\n if(j == 0) return i;\n return gcd(j, i % j);\n }\n}",
"import java.util.*;",
"util.*",
"java",
"class Main {\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n long N = sc.nextLong();\n long ans = 0;\n\n for (int a = 1; a <= N; a++) {\n for (int b = 1; b <= N; b++) {\n for (int c = 1; c <= N; c++) {\n gcd(a, b);\n gcd(gcd(a, b), c);\n ans = ans + gcd(gcd(a, b), c);\n }\n }\n }\n System.out.println(ans);\n }\n\n private static int gcd(int i, int j) {\n if(i < j) return gcd(j, i);\n if(j == 0) return i;\n return gcd(j, i % j);\n }\n}",
"Main",
"public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n long N = sc.nextLong();\n long ans = 0;\n\n for (int a = 1; a <= N; a++) {\n for (int b = 1; b <= N; b++) {\n for (int c = 1; c <= N; c++) {\n gcd(a, b);\n gcd(gcd(a, b), c);\n ans = ans + gcd(gcd(a, b), c);\n }\n }\n }\n System.out.println(ans);\n }",
"main",
"{\n Scanner sc = new Scanner(System.in);\n long N = sc.nextLong();\n long ans = 0;\n\n for (int a = 1; a <= N; a++) {\n for (int b = 1; b <= N; b++) {\n for (int c = 1; c <= N; c++) {\n gcd(a, b);\n gcd(gcd(a, b), c);\n ans = ans + gcd(gcd(a, b), c);\n }\n }\n }\n System.out.println(ans);\n }",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"long N = sc.nextLong();",
"N",
"sc.nextLong()",
"sc.nextLong",
"sc",
"long ans = 0;",
"ans",
"0",
"for (int a = 1; a <= N; a++) {\n for (int b = 1; b <= N; b++) {\n for (int c = 1; c <= N; c++) {\n gcd(a, b);\n gcd(gcd(a, b), c);\n ans = ans + gcd(gcd(a, b), c);\n }\n }\n }",
"int a = 1;",
"int a = 1;",
"a",
"1",
"a <= N",
"a",
"N",
"a++",
"a++",
"a",
"{\n for (int b = 1; b <= N; b++) {\n for (int c = 1; c <= N; c++) {\n gcd(a, b);\n gcd(gcd(a, b), c);\n ans = ans + gcd(gcd(a, b), c);\n }\n }\n }",
"{\n for (int b = 1; b <= N; b++) {\n for (int c = 1; c <= N; c++) {\n gcd(a, b);\n gcd(gcd(a, b), c);\n ans = ans + gcd(gcd(a, b), c);\n }\n }\n }",
"for (int b = 1; b <= N; b++) {\n for (int c = 1; c <= N; c++) {\n gcd(a, b);\n gcd(gcd(a, b), c);\n ans = ans + gcd(gcd(a, b), c);\n }\n }",
"int b = 1;",
"int b = 1;",
"b",
"1",
"b <= N",
"b",
"N",
"b++",
"b++",
"b",
"{\n for (int c = 1; c <= N; c++) {\n gcd(a, b);\n gcd(gcd(a, b), c);\n ans = ans + gcd(gcd(a, b), c);\n }\n }",
"{\n for (int c = 1; c <= N; c++) {\n gcd(a, b);\n gcd(gcd(a, b), c);\n ans = ans + gcd(gcd(a, b), c);\n }\n }",
"for (int c = 1; c <= N; c++) {\n gcd(a, b);\n gcd(gcd(a, b), c);\n ans = ans + gcd(gcd(a, b), c);\n }",
"int c = 1;",
"int c = 1;",
"c",
"1",
"c <= N",
"c",
"N",
"c++",
"c++",
"c",
"{\n gcd(a, b);\n gcd(gcd(a, b), c);\n ans = ans + gcd(gcd(a, b), c);\n }",
"{\n gcd(a, b);\n gcd(gcd(a, b), c);\n ans = ans + gcd(gcd(a, b), c);\n }",
"gcd(a, b)",
"gcd",
"a",
"b",
"gcd(gcd(a, b), c)",
"gcd",
"gcd(a, b)",
"gcd",
"a",
"b",
"c",
"ans = ans + gcd(gcd(a, b), c)",
"ans",
"ans + gcd(gcd(a, b), c)",
"ans",
"gcd(gcd(a, b), c)",
"gcd",
"gcd(a, b)",
"gcd",
"a",
"b",
"c",
"System.out.println(ans)",
"System.out.println",
"System.out",
"System",
"System.out",
"ans",
"String[] args",
"args",
"private static int gcd(int i, int j) {\n if(i < j) return gcd(j, i);\n if(j == 0) return i;\n return gcd(j, i % j);\n }",
"gcd",
"{\n if(i < j) return gcd(j, i);\n if(j == 0) return i;\n return gcd(j, i % j);\n }",
"if(i < j) return gcd(j, i);",
"i < j",
"i",
"j",
"return gcd(j, i);",
"gcd(j, i)",
"gcd",
"j",
"i",
"if(j == 0) return i;",
"j == 0",
"j",
"0",
"return i;",
"i",
"return gcd(j, i % j);",
"gcd(j, i % j)",
"gcd",
"j",
"i % j",
"i",
"j",
"int i",
"i",
"int j",
"j"
] |
import java.util.*;
class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
long N = sc.nextLong();
long ans = 0;
for (int a = 1; a <= N; a++) {
for (int b = 1; b <= N; b++) {
for (int c = 1; c <= N; c++) {
gcd(a, b);
gcd(gcd(a, b), c);
ans = ans + gcd(gcd(a, b), c);
}
}
}
System.out.println(ans);
}
private static int gcd(int i, int j) {
if(i < j) return gcd(j, i);
if(j == 0) return i;
return gcd(j, i % j);
}
}
|
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
4,
18,
13,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
4,
13,
4,
13,
13,
13,
13,
4,
18,
18,
13,
13,
13,
29,
23,
13,
12,
13,
30,
41,
13,
4,
18,
13,
13,
13,
41,
13,
4,
18,
13,
13,
13,
14,
2,
2,
13,
13,
17,
30,
29,
13,
30,
29,
4,
13,
2,
13,
13,
13,
23,
13,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
119,
5
],
[
119,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
14,
17
],
[
17,
18
],
[
18,
19
],
[
8,
20
],
[
20,
21
],
[
20,
22
],
[
8,
23
],
[
23,
24
],
[
24,
25
],
[
25,
26
],
[
25,
27
],
[
23,
28
],
[
28,
29
],
[
28,
30
],
[
23,
31
],
[
31,
32
],
[
32,
33
],
[
23,
34
],
[
35,
35
],
[
35,
36
],
[
36,
37
],
[
37,
38
],
[
38,
39
],
[
38,
40
],
[
36,
41
],
[
41,
42
],
[
41,
43
],
[
36,
44
],
[
44,
45
],
[
45,
46
],
[
36,
47
],
[
48,
48
],
[
48,
49
],
[
49,
50
],
[
50,
51
],
[
51,
52
],
[
51,
53
],
[
49,
54
],
[
54,
55
],
[
54,
56
],
[
49,
57
],
[
57,
58
],
[
58,
59
],
[
49,
60
],
[
61,
61
],
[
61,
62
],
[
62,
63
],
[
62,
64
],
[
64,
65
],
[
64,
66
],
[
66,
67
],
[
66,
68
],
[
66,
69
],
[
64,
70
],
[
8,
71
],
[
71,
72
],
[
72,
73
],
[
73,
74
],
[
73,
75
],
[
71,
76
],
[
8,
77
],
[
6,
78
],
[
78,
79
],
[
119,
80
],
[
80,
81
],
[
80,
82
],
[
82,
83
],
[
83,
84
],
[
83,
85
],
[
85,
86
],
[
86,
87
],
[
85,
88
],
[
85,
89
],
[
82,
90
],
[
90,
91
],
[
90,
92
],
[
92,
93
],
[
93,
94
],
[
92,
95
],
[
92,
96
],
[
82,
97
],
[
97,
98
],
[
98,
99
],
[
99,
100
],
[
99,
101
],
[
98,
102
],
[
97,
103
],
[
103,
104
],
[
104,
105
],
[
97,
106
],
[
106,
107
],
[
107,
108
],
[
108,
109
],
[
108,
110
],
[
110,
111
],
[
110,
112
],
[
108,
113
],
[
80,
114
],
[
114,
115
],
[
80,
116
],
[
116,
117
],
[
0,
118
],
[
118,
119
],
[
118,
120
]
] |
[
"import java.util.Scanner;\npublic class Main{\n public static void main(String[] args){\n Scanner sc = new Scanner(System.in);\n\tint K = Integer.parseInt(sc.next());\n\tint ans = 0;\n\tfor(int i = 1; i<=K ;i++){\n\t\tfor(int j = 1; j<=K ;j++){\n\t\t\tfor(int l = 1; l<=K ;l++){\n\t\t\t\tans +=gcd(gcd(i,j),l);\n\t\t\t}\n\t\t}\n\t}\n System.out.print(ans);\n return;\n }\n\n static int gcd(int a, int b){\n int max= Math.max(a,b);\n int min= Math.min(a,b);\n if(max%min==0){\n return min;\n }else{\n return gcd(max%min, min);\n }\n } \n \n}\n\n",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main{\n public static void main(String[] args){\n Scanner sc = new Scanner(System.in);\n\tint K = Integer.parseInt(sc.next());\n\tint ans = 0;\n\tfor(int i = 1; i<=K ;i++){\n\t\tfor(int j = 1; j<=K ;j++){\n\t\t\tfor(int l = 1; l<=K ;l++){\n\t\t\t\tans +=gcd(gcd(i,j),l);\n\t\t\t}\n\t\t}\n\t}\n System.out.print(ans);\n return;\n }\n\n static int gcd(int a, int b){\n int max= Math.max(a,b);\n int min= Math.min(a,b);\n if(max%min==0){\n return min;\n }else{\n return gcd(max%min, min);\n }\n } \n \n}",
"Main",
"public static void main(String[] args){\n Scanner sc = new Scanner(System.in);\n\tint K = Integer.parseInt(sc.next());\n\tint ans = 0;\n\tfor(int i = 1; i<=K ;i++){\n\t\tfor(int j = 1; j<=K ;j++){\n\t\t\tfor(int l = 1; l<=K ;l++){\n\t\t\t\tans +=gcd(gcd(i,j),l);\n\t\t\t}\n\t\t}\n\t}\n System.out.print(ans);\n return;\n }",
"main",
"{\n Scanner sc = new Scanner(System.in);\n\tint K = Integer.parseInt(sc.next());\n\tint ans = 0;\n\tfor(int i = 1; i<=K ;i++){\n\t\tfor(int j = 1; j<=K ;j++){\n\t\t\tfor(int l = 1; l<=K ;l++){\n\t\t\t\tans +=gcd(gcd(i,j),l);\n\t\t\t}\n\t\t}\n\t}\n System.out.print(ans);\n return;\n }",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"int K = Integer.parseInt(sc.next());",
"K",
"Integer.parseInt(sc.next())",
"Integer.parseInt",
"Integer",
"sc.next()",
"sc.next",
"sc",
"int ans = 0;",
"ans",
"0",
"for(int i = 1; i<=K ;i++){\n\t\tfor(int j = 1; j<=K ;j++){\n\t\t\tfor(int l = 1; l<=K ;l++){\n\t\t\t\tans +=gcd(gcd(i,j),l);\n\t\t\t}\n\t\t}\n\t}",
"int i = 1;",
"int i = 1;",
"i",
"1",
"i<=K",
"i",
"K",
"i++",
"i++",
"i",
"{\n\t\tfor(int j = 1; j<=K ;j++){\n\t\t\tfor(int l = 1; l<=K ;l++){\n\t\t\t\tans +=gcd(gcd(i,j),l);\n\t\t\t}\n\t\t}\n\t}",
"{\n\t\tfor(int j = 1; j<=K ;j++){\n\t\t\tfor(int l = 1; l<=K ;l++){\n\t\t\t\tans +=gcd(gcd(i,j),l);\n\t\t\t}\n\t\t}\n\t}",
"for(int j = 1; j<=K ;j++){\n\t\t\tfor(int l = 1; l<=K ;l++){\n\t\t\t\tans +=gcd(gcd(i,j),l);\n\t\t\t}\n\t\t}",
"int j = 1;",
"int j = 1;",
"j",
"1",
"j<=K",
"j",
"K",
"j++",
"j++",
"j",
"{\n\t\t\tfor(int l = 1; l<=K ;l++){\n\t\t\t\tans +=gcd(gcd(i,j),l);\n\t\t\t}\n\t\t}",
"{\n\t\t\tfor(int l = 1; l<=K ;l++){\n\t\t\t\tans +=gcd(gcd(i,j),l);\n\t\t\t}\n\t\t}",
"for(int l = 1; l<=K ;l++){\n\t\t\t\tans +=gcd(gcd(i,j),l);\n\t\t\t}",
"int l = 1;",
"int l = 1;",
"l",
"1",
"l<=K",
"l",
"K",
"l++",
"l++",
"l",
"{\n\t\t\t\tans +=gcd(gcd(i,j),l);\n\t\t\t}",
"{\n\t\t\t\tans +=gcd(gcd(i,j),l);\n\t\t\t}",
"ans +=gcd(gcd(i,j),l)",
"ans",
"gcd(gcd(i,j),l)",
"gcd",
"gcd(i,j)",
"gcd",
"i",
"j",
"l",
"System.out.print(ans)",
"System.out.print",
"System.out",
"System",
"System.out",
"ans",
"return;",
"String[] args",
"args",
"static int gcd(int a, int b){\n int max= Math.max(a,b);\n int min= Math.min(a,b);\n if(max%min==0){\n return min;\n }else{\n return gcd(max%min, min);\n }\n }",
"gcd",
"{\n int max= Math.max(a,b);\n int min= Math.min(a,b);\n if(max%min==0){\n return min;\n }else{\n return gcd(max%min, min);\n }\n }",
"int max= Math.max(a,b);",
"max",
"Math.max(a,b)",
"Math.max",
"Math",
"a",
"b",
"int min= Math.min(a,b);",
"min",
"Math.min(a,b)",
"Math.min",
"Math",
"a",
"b",
"if(max%min==0){\n return min;\n }else{\n return gcd(max%min, min);\n }",
"max%min==0",
"max%min",
"max",
"min",
"0",
"{\n return min;\n }",
"return min;",
"min",
"{\n return gcd(max%min, min);\n }",
"return gcd(max%min, min);",
"gcd(max%min, min)",
"gcd",
"max%min",
"max",
"min",
"min",
"int a",
"a",
"int b",
"b",
"public class Main{\n public static void main(String[] args){\n Scanner sc = new Scanner(System.in);\n\tint K = Integer.parseInt(sc.next());\n\tint ans = 0;\n\tfor(int i = 1; i<=K ;i++){\n\t\tfor(int j = 1; j<=K ;j++){\n\t\t\tfor(int l = 1; l<=K ;l++){\n\t\t\t\tans +=gcd(gcd(i,j),l);\n\t\t\t}\n\t\t}\n\t}\n System.out.print(ans);\n return;\n }\n\n static int gcd(int a, int b){\n int max= Math.max(a,b);\n int min= Math.min(a,b);\n if(max%min==0){\n return min;\n }else{\n return gcd(max%min, min);\n }\n } \n \n}",
"public class Main{\n public static void main(String[] args){\n Scanner sc = new Scanner(System.in);\n\tint K = Integer.parseInt(sc.next());\n\tint ans = 0;\n\tfor(int i = 1; i<=K ;i++){\n\t\tfor(int j = 1; j<=K ;j++){\n\t\t\tfor(int l = 1; l<=K ;l++){\n\t\t\t\tans +=gcd(gcd(i,j),l);\n\t\t\t}\n\t\t}\n\t}\n System.out.print(ans);\n return;\n }\n\n static int gcd(int a, int b){\n int max= Math.max(a,b);\n int min= Math.min(a,b);\n if(max%min==0){\n return min;\n }else{\n return gcd(max%min, min);\n }\n } \n \n}",
"Main"
] |
import java.util.Scanner;
public class Main{
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
int K = Integer.parseInt(sc.next());
int ans = 0;
for(int i = 1; i<=K ;i++){
for(int j = 1; j<=K ;j++){
for(int l = 1; l<=K ;l++){
ans +=gcd(gcd(i,j),l);
}
}
}
System.out.print(ans);
return;
}
static int gcd(int a, int b){
int max= Math.max(a,b);
int min= Math.min(a,b);
if(max%min==0){
return min;
}else{
return gcd(max%min, min);
}
}
}
|
[
7,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
14,
2,
13,
17,
29,
13,
29,
4,
13,
13,
2,
13,
13,
23,
13,
23,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
41,
13,
4,
13,
13,
13,
0,
13,
4,
13,
13,
13,
0,
13,
13,
4,
18,
18,
13,
13,
13,
23,
13,
6,
13,
41,
13,
2,
17,
17,
41,
13,
41,
13,
41,
13,
41,
13,
12,
13,
30,
0,
13,
20,
0,
13,
20,
13,
0,
13,
0,
13,
17,
12,
13,
30,
0,
13,
20,
0,
13,
20,
13,
0,
13,
0,
13,
17,
23,
13,
12,
13,
30,
41,
13,
20,
17,
41,
13,
17,
41,
13,
42,
2,
0,
13,
4,
13,
40,
17,
30,
14,
2,
13,
17,
3,
0,
18,
13,
40,
13,
13,
29,
20,
12,
13,
30,
41,
13,
4,
13,
42,
4,
18,
13,
13,
30,
0,
13,
4,
13,
41,
13,
20,
4,
18,
13,
13,
0,
13,
4,
13,
42,
40,
4,
18,
13,
13,
30,
4,
18,
13,
13,
0,
13,
4,
13,
29,
4,
18,
13,
12,
13,
30,
41,
13,
17,
41,
13,
4,
13,
42,
2,
13,
17,
0,
13,
4,
13,
41,
13,
2,
13,
17,
14,
13,
0,
13,
4,
13,
42,
2,
2,
0,
13,
4,
13,
17,
2,
13,
17,
30,
0,
13,
2,
2,
2,
13,
17,
13,
17,
14,
13,
29,
40,
13,
29,
13,
12,
13,
30,
41,
13,
20,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
18,
13,
13,
4,
13,
29,
13,
23,
13,
12,
13,
30,
41,
13,
17,
41,
13,
4,
13,
42,
2,
13,
17,
0,
13,
4,
13,
41,
13,
2,
13,
17,
14,
13,
0,
13,
4,
13,
42,
2,
2,
0,
13,
4,
13,
17,
2,
13,
17,
30,
0,
13,
2,
2,
2,
13,
17,
13,
17,
14,
13,
29,
40,
13,
29,
13,
12,
13,
30,
41,
13,
20,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
18,
13,
13,
4,
13,
29,
13,
23,
13,
12,
13,
30,
41,
13,
4,
13,
42,
4,
18,
13,
13,
30,
0,
13,
4,
13,
29,
13,
12,
13,
30,
41,
13,
17,
41,
13,
17,
41,
13,
4,
13,
42,
2,
13,
17,
0,
13,
4,
13,
41,
13,
2,
13,
17,
14,
13,
0,
13,
4,
13,
42,
2,
2,
0,
13,
4,
13,
17,
2,
13,
17,
30,
0,
13,
2,
2,
2,
13,
17,
13,
17,
14,
2,
13,
17,
30,
42,
2,
2,
0,
13,
4,
13,
17,
2,
13,
17,
30,
0,
13,
2,
2,
13,
17,
0,
13,
17,
14,
13,
29,
40,
13,
29,
13,
12,
13,
30,
41,
13,
20,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
18,
13,
13,
4,
13,
29,
13,
23,
13,
12,
13,
30,
0,
13,
4,
18,
13,
13,
0,
13,
17,
13,
14,
2,
13,
40,
17,
0,
18,
13,
17,
40,
17,
12,
13,
30,
14,
2,
13,
13,
4,
13,
29,
18,
13,
40,
13,
12,
13,
30,
14,
2,
13,
17,
29,
4,
18,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
592,
8
],
[
592,
9
],
[
9,
10
],
[
9,
11
],
[
11,
12
],
[
12,
13
],
[
13,
14
],
[
13,
15
],
[
12,
16
],
[
16,
17
],
[
11,
18
],
[
18,
19
],
[
19,
20
],
[
19,
21
],
[
19,
22
],
[
22,
23
],
[
22,
24
],
[
9,
25
],
[
25,
26
],
[
9,
27
],
[
27,
28
],
[
592,
29
],
[
29,
30
],
[
29,
31
],
[
31,
32
],
[
32,
33
],
[
32,
34
],
[
31,
35
],
[
35,
36
],
[
35,
37
],
[
37,
38
],
[
38,
39
],
[
31,
40
],
[
40,
41
],
[
40,
42
],
[
31,
43
],
[
43,
44
],
[
44,
45
],
[
45,
46
],
[
45,
47
],
[
43,
48
],
[
48,
49
],
[
48,
50
],
[
43,
51
],
[
51,
52
],
[
52,
53
],
[
43,
54
],
[
55,
55
],
[
55,
56
],
[
56,
57
],
[
57,
58
],
[
58,
59
],
[
58,
60
],
[
56,
61
],
[
61,
62
],
[
61,
63
],
[
56,
64
],
[
64,
65
],
[
65,
66
],
[
56,
67
],
[
68,
68
],
[
68,
69
],
[
69,
70
],
[
70,
71
],
[
71,
72
],
[
71,
73
],
[
69,
74
],
[
74,
75
],
[
74,
76
],
[
69,
77
],
[
77,
78
],
[
78,
79
],
[
69,
80
],
[
81,
81
],
[
81,
82
],
[
82,
83
],
[
82,
84
],
[
84,
85
],
[
84,
86
],
[
84,
87
],
[
81,
88
],
[
88,
89
],
[
88,
90
],
[
90,
91
],
[
90,
92
],
[
90,
93
],
[
81,
94
],
[
94,
95
],
[
94,
96
],
[
31,
97
],
[
97,
98
],
[
98,
99
],
[
99,
100
],
[
99,
101
],
[
97,
102
],
[
29,
103
],
[
103,
104
],
[
0,
105
],
[
105,
106
],
[
105,
107
],
[
107,
108
],
[
107,
109
],
[
109,
110
],
[
109,
111
],
[
105,
112
],
[
112,
113
],
[
105,
114
],
[
114,
115
],
[
105,
116
],
[
116,
117
],
[
105,
118
],
[
118,
119
],
[
105,
120
],
[
120,
121
],
[
120,
122
],
[
122,
123
],
[
123,
124
],
[
123,
125
],
[
122,
126
],
[
126,
127
],
[
126,
128
],
[
122,
130
],
[
130,
131
],
[
130,
132
],
[
132,
133
],
[
132,
134
],
[
105,
135
],
[
135,
136
],
[
135,
137
],
[
137,
138
],
[
138,
139
],
[
138,
140
],
[
137,
141
],
[
141,
142
],
[
141,
143
],
[
137,
145
],
[
145,
146
],
[
145,
147
],
[
147,
148
],
[
147,
149
],
[
135,
150
],
[
150,
151
],
[
105,
152
],
[
152,
153
],
[
152,
154
],
[
154,
155
],
[
155,
156
],
[
155,
157
],
[
154,
159
],
[
159,
160
],
[
159,
161
],
[
154,
162
],
[
162,
163
],
[
154,
164
],
[
164,
165
],
[
165,
166
],
[
166,
167
],
[
166,
168
],
[
168,
169
],
[
165,
170
],
[
170,
171
],
[
164,
172
],
[
172,
173
],
[
173,
174
],
[
174,
175
],
[
174,
176
],
[
173,
177
],
[
172,
178
],
[
178,
179
],
[
179,
180
],
[
179,
181
],
[
181,
182
],
[
178,
183
],
[
154,
184
],
[
184,
185
],
[
105,
186
],
[
186,
187
],
[
186,
188
],
[
188,
189
],
[
189,
190
],
[
189,
191
],
[
191,
192
],
[
188,
193
],
[
193,
194
],
[
194,
195
],
[
195,
196
],
[
194,
197
],
[
193,
198
],
[
198,
199
],
[
199,
200
],
[
199,
201
],
[
201,
202
],
[
188,
203
],
[
203,
204
],
[
203,
205
],
[
188,
206
],
[
206,
207
],
[
207,
208
],
[
206,
209
],
[
188,
210
],
[
210,
211
],
[
210,
212
],
[
212,
213
],
[
188,
214
],
[
214,
215
],
[
215,
216
],
[
216,
217
],
[
217,
218
],
[
216,
219
],
[
214,
220
],
[
220,
221
],
[
221,
222
],
[
222,
223
],
[
221,
224
],
[
220,
225
],
[
225,
226
],
[
225,
227
],
[
227,
228
],
[
188,
229
],
[
229,
230
],
[
230,
231
],
[
231,
232
],
[
105,
233
],
[
233,
234
],
[
233,
235
],
[
235,
236
],
[
236,
237
],
[
236,
238
],
[
235,
239
],
[
239,
240
],
[
239,
241
],
[
241,
242
],
[
235,
243
],
[
243,
244
],
[
244,
245
],
[
244,
246
],
[
243,
247
],
[
247,
248
],
[
247,
249
],
[
249,
250
],
[
235,
251
],
[
251,
252
],
[
251,
253
],
[
253,
254
],
[
253,
255
],
[
235,
256
],
[
256,
257
],
[
256,
258
],
[
258,
259
],
[
258,
260
],
[
260,
261
],
[
235,
262
],
[
262,
263
],
[
263,
264
],
[
264,
265
],
[
265,
266
],
[
265,
267
],
[
267,
268
],
[
264,
269
],
[
263,
270
],
[
270,
271
],
[
270,
272
],
[
262,
273
],
[
273,
274
],
[
274,
275
],
[
274,
276
],
[
276,
277
],
[
277,
278
],
[
278,
279
],
[
278,
280
],
[
277,
281
],
[
276,
282
],
[
235,
283
],
[
283,
284
],
[
283,
285
],
[
285,
286
],
[
286,
287
],
[
235,
288
],
[
288,
289
],
[
105,
290
],
[
290,
291
],
[
290,
292
],
[
292,
293
],
[
293,
294
],
[
293,
295
],
[
292,
297
],
[
297,
298
],
[
298,
299
],
[
299,
300
],
[
299,
301
],
[
297,
302
],
[
302,
303
],
[
302,
304
],
[
297,
305
],
[
305,
306
],
[
306,
307
],
[
297,
308
],
[
309,
309
],
[
309,
310
],
[
310,
311
],
[
311,
312
],
[
311,
313
],
[
310,
314
],
[
314,
315
],
[
292,
316
],
[
316,
317
],
[
290,
318
],
[
318,
319
],
[
105,
320
],
[
320,
321
],
[
320,
322
],
[
322,
323
],
[
323,
324
],
[
323,
325
],
[
322,
326
],
[
326,
327
],
[
326,
328
],
[
328,
329
],
[
322,
330
],
[
330,
331
],
[
331,
332
],
[
331,
333
],
[
330,
334
],
[
334,
335
],
[
334,
336
],
[
336,
337
],
[
322,
338
],
[
338,
339
],
[
338,
340
],
[
340,
341
],
[
340,
342
],
[
322,
343
],
[
343,
344
],
[
343,
345
],
[
345,
346
],
[
345,
347
],
[
347,
348
],
[
322,
349
],
[
349,
350
],
[
350,
351
],
[
351,
352
],
[
352,
353
],
[
352,
354
],
[
354,
355
],
[
351,
356
],
[
350,
357
],
[
357,
358
],
[
357,
359
],
[
349,
360
],
[
360,
361
],
[
361,
362
],
[
361,
363
],
[
363,
364
],
[
364,
365
],
[
365,
366
],
[
365,
367
],
[
364,
368
],
[
363,
369
],
[
322,
370
],
[
370,
371
],
[
370,
372
],
[
372,
373
],
[
373,
374
],
[
322,
375
],
[
375,
376
],
[
105,
377
],
[
377,
378
],
[
377,
379
],
[
379,
380
],
[
380,
381
],
[
380,
382
],
[
379,
384
],
[
384,
385
],
[
385,
386
],
[
386,
387
],
[
386,
388
],
[
384,
389
],
[
389,
390
],
[
389,
391
],
[
384,
392
],
[
392,
393
],
[
393,
394
],
[
384,
395
],
[
396,
396
],
[
396,
397
],
[
397,
398
],
[
398,
399
],
[
398,
400
],
[
397,
401
],
[
401,
402
],
[
379,
403
],
[
403,
404
],
[
377,
405
],
[
405,
406
],
[
105,
407
],
[
407,
408
],
[
407,
409
],
[
409,
410
],
[
410,
411
],
[
410,
412
],
[
412,
413
],
[
409,
414
],
[
414,
415
],
[
415,
416
],
[
416,
417
],
[
415,
418
],
[
414,
419
],
[
419,
420
],
[
420,
421
],
[
420,
422
],
[
422,
423
],
[
409,
424
],
[
424,
425
],
[
105,
426
],
[
426,
427
],
[
426,
428
],
[
428,
429
],
[
429,
430
],
[
429,
431
],
[
428,
432
],
[
432,
433
],
[
432,
434
],
[
428,
435
],
[
435,
436
],
[
435,
437
],
[
437,
438
],
[
428,
439
],
[
439,
440
],
[
440,
441
],
[
440,
442
],
[
439,
443
],
[
443,
444
],
[
443,
445
],
[
445,
446
],
[
428,
447
],
[
447,
448
],
[
447,
449
],
[
449,
450
],
[
449,
451
],
[
428,
452
],
[
452,
453
],
[
452,
454
],
[
454,
455
],
[
454,
456
],
[
456,
457
],
[
428,
458
],
[
458,
459
],
[
459,
460
],
[
460,
461
],
[
461,
462
],
[
461,
463
],
[
463,
464
],
[
460,
465
],
[
459,
466
],
[
466,
467
],
[
466,
468
],
[
458,
469
],
[
469,
470
],
[
470,
471
],
[
470,
472
],
[
472,
473
],
[
473,
474
],
[
474,
475
],
[
474,
476
],
[
473,
477
],
[
472,
478
],
[
428,
479
],
[
479,
480
],
[
480,
481
],
[
480,
482
],
[
479,
483
],
[
483,
484
],
[
484,
485
],
[
485,
486
],
[
486,
487
],
[
487,
488
],
[
487,
489
],
[
489,
490
],
[
486,
491
],
[
485,
492
],
[
492,
493
],
[
492,
494
],
[
484,
495
],
[
495,
496
],
[
496,
497
],
[
496,
498
],
[
498,
499
],
[
499,
500
],
[
499,
501
],
[
498,
502
],
[
502,
503
],
[
502,
504
],
[
428,
505
],
[
505,
506
],
[
505,
507
],
[
507,
508
],
[
508,
509
],
[
428,
510
],
[
510,
511
],
[
105,
512
],
[
512,
513
],
[
512,
514
],
[
514,
515
],
[
515,
516
],
[
515,
517
],
[
514,
519
],
[
519,
520
],
[
520,
521
],
[
521,
522
],
[
521,
523
],
[
519,
524
],
[
524,
525
],
[
524,
526
],
[
519,
527
],
[
527,
528
],
[
528,
529
],
[
519,
530
],
[
531,
531
],
[
531,
532
],
[
532,
533
],
[
533,
534
],
[
533,
535
],
[
532,
536
],
[
536,
537
],
[
514,
538
],
[
538,
539
],
[
512,
540
],
[
540,
541
],
[
105,
542
],
[
542,
543
],
[
542,
544
],
[
544,
545
],
[
545,
546
],
[
545,
547
],
[
547,
548
],
[
548,
549
],
[
547,
550
],
[
547,
551
],
[
551,
552
],
[
551,
553
],
[
547,
554
],
[
544,
555
],
[
555,
556
],
[
556,
557
],
[
556,
558
],
[
558,
559
],
[
555,
560
],
[
560,
561
],
[
561,
562
],
[
561,
563
],
[
560,
564
],
[
564,
565
],
[
105,
566
],
[
566,
567
],
[
566,
568
],
[
568,
569
],
[
569,
570
],
[
570,
571
],
[
570,
572
],
[
569,
573
],
[
573,
574
],
[
568,
575
],
[
575,
576
],
[
576,
577
],
[
576,
578
],
[
578,
579
],
[
105,
580
],
[
580,
581
],
[
580,
582
],
[
582,
583
],
[
583,
584
],
[
584,
585
],
[
584,
586
],
[
583,
587
],
[
582,
588
],
[
588,
589
],
[
589,
590
],
[
0,
591
],
[
591,
592
],
[
591,
593
]
] |
[
"import java.util.*;\nimport java.io.*;\n\npublic class Main {\n static int gcd(int a,int b){\n if(b==0)return a;\n return gcd(b,a%b);\n }\n public static void main(String [] args) throws IOException{\n FastScanner sc=new FastScanner();\n int k=sc.nextInt();\n long sum=0;\n for(int a=1;a<=k;a++){\n for(int b=1;b<=k;b++){\n for(int c=1;c<=k;c++){\n int g=gcd(a,b);\n g=gcd(g,c);\n sum+=(long)g;\n }\n }\n }\n\n System.out.println(sum);\n\n }\n\n}\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nclass FastScanner{\t\n private int BUFFER_SIZE = 1 << 16;\n \n private DataInputStream din;\n \n private byte[] buffer;\n \n private int bufferPointer, bytesRead;\n \n public FastScanner() {\n din = new DataInputStream(System.in);\n buffer = new byte[BUFFER_SIZE];\n bufferPointer = bytesRead = 0;\n }\n\n public FastScanner( String file_name) throws IOException {\n din = new DataInputStream(new FileInputStream(file_name));\n buffer = new byte[BUFFER_SIZE];\n bufferPointer = bytesRead = 0;\n }\n \n public String readLine() throws IOException {\n byte[] buf = new byte[64];\n int cnt = 0, c;\n while ((c = read()) != -1) {\n if (c == '\\n')\n break;\n buf[cnt++] = (byte) c;\n }\n return new String(buf, 0, cnt);\n }\n \n public String next() throws IOException{\n\n byte c = read();\n while(Character.isWhitespace(c)){\n c = read();\n }\n \n StringBuilder builder = new StringBuilder();\n builder.append((char)c);\n c = read();\n while(!Character.isWhitespace(c)){\n builder.append((char)c);\n c = read();\n }\n \n return builder.toString();\n }\n\n public int nextInt() throws IOException {\n int ret = 0;\n byte c = read();\n while (c <= ' ')\n c = read();\n boolean neg = (c == '-');\n if (neg)\n c = read();\n do {\n ret = ret * 10 + c - '0';\n } while ((c = read()) >= '0' && c <= '9');\n\n if (neg)\n return -ret;\n return ret;\n }\n \n public int[] nextIntArray( int n) throws IOException {\n int arr[] = new int[n];\n for(int i = 0; i < n; i++){\n arr[i] = nextInt();\n }\n return arr;\n }\n\n public long nextLong() throws IOException {\n long ret = 0;\n byte c = read();\n while (c <= ' ')\n c = read();\n boolean neg = (c == '-');\n if (neg)\n c = read();\n do {\n ret = ret * 10 + c - '0';\n } while ((c = read()) >= '0' && c <= '9');\n if (neg)\n return -ret;\n return ret;\n }\n \n public long[] nextLongArray( int n) throws IOException {\n long arr[] = new long[n];\n for(int i = 0; i < n; i++){\n arr[i] = nextLong();\n }\n return arr;\n }\n\n public char nextChar() throws IOException{\n byte c = read();\n while(Character.isWhitespace(c)){\n c = read();\n }\n return (char) c;\t\n }\n \n public double nextDouble() throws IOException {\n double ret = 0, div = 1;\n byte c = read();\n while (c <= ' ')\n c = read();\n boolean neg = (c == '-');\n if (neg)\n c = read();\n\n do {\n ret = ret * 10 + c - '0';\n } while ((c = read()) >= '0' && c <= '9');\n\n if (c == '.') {\n while ((c = read()) >= '0' && c <= '9') {\n ret += (c - '0') / (div *= 10);\n }\n }\n\n if (neg)\n return -ret;\n return ret;\n }\n \n public double[] nextDoubleArray( int n) throws IOException {\n double arr[] = new double[n];\n for(int i = 0; i < n; i++){\n arr[i] = nextDouble();\n }\n return arr;\n }\n\n private void fillBuffer() throws IOException {\n bytesRead = din.read(buffer, bufferPointer = 0, BUFFER_SIZE);\n if (bytesRead == -1)\n buffer[0] = -1;\n }\n\n private byte read() throws IOException {\n if (bufferPointer == bytesRead)\n fillBuffer();\n return buffer[bufferPointer++];\n }\n\n public void close() throws IOException {\n if (din == null)\n return;\n din.close();\n }\n\n}\n ",
"import java.util.*;",
"util.*",
"java",
"import java.io.*;",
"io.*",
"java",
"public class Main {\n static int gcd(int a,int b){\n if(b==0)return a;\n return gcd(b,a%b);\n }\n public static void main(String [] args) throws IOException{\n FastScanner sc=new FastScanner();\n int k=sc.nextInt();\n long sum=0;\n for(int a=1;a<=k;a++){\n for(int b=1;b<=k;b++){\n for(int c=1;c<=k;c++){\n int g=gcd(a,b);\n g=gcd(g,c);\n sum+=(long)g;\n }\n }\n }\n\n System.out.println(sum);\n\n }\n\n}",
"Main",
"static int gcd(int a,int b){\n if(b==0)return a;\n return gcd(b,a%b);\n }",
"gcd",
"{\n if(b==0)return a;\n return gcd(b,a%b);\n }",
"if(b==0)return a;",
"b==0",
"b",
"0",
"return a;",
"a",
"return gcd(b,a%b);",
"gcd(b,a%b)",
"gcd",
"b",
"a%b",
"a",
"b",
"int a",
"a",
"int b",
"b",
"public static void main(String [] args) throws IOException{\n FastScanner sc=new FastScanner();\n int k=sc.nextInt();\n long sum=0;\n for(int a=1;a<=k;a++){\n for(int b=1;b<=k;b++){\n for(int c=1;c<=k;c++){\n int g=gcd(a,b);\n g=gcd(g,c);\n sum+=(long)g;\n }\n }\n }\n\n System.out.println(sum);\n\n }",
"main",
"{\n FastScanner sc=new FastScanner();\n int k=sc.nextInt();\n long sum=0;\n for(int a=1;a<=k;a++){\n for(int b=1;b<=k;b++){\n for(int c=1;c<=k;c++){\n int g=gcd(a,b);\n g=gcd(g,c);\n sum+=(long)g;\n }\n }\n }\n\n System.out.println(sum);\n\n }",
"FastScanner sc=new FastScanner();",
"sc",
"new FastScanner()",
"int k=sc.nextInt();",
"k",
"sc.nextInt()",
"sc.nextInt",
"sc",
"long sum=0;",
"sum",
"0",
"for(int a=1;a<=k;a++){\n for(int b=1;b<=k;b++){\n for(int c=1;c<=k;c++){\n int g=gcd(a,b);\n g=gcd(g,c);\n sum+=(long)g;\n }\n }\n }",
"int a=1;",
"int a=1;",
"a",
"1",
"a<=k",
"a",
"k",
"a++",
"a++",
"a",
"{\n for(int b=1;b<=k;b++){\n for(int c=1;c<=k;c++){\n int g=gcd(a,b);\n g=gcd(g,c);\n sum+=(long)g;\n }\n }\n }",
"{\n for(int b=1;b<=k;b++){\n for(int c=1;c<=k;c++){\n int g=gcd(a,b);\n g=gcd(g,c);\n sum+=(long)g;\n }\n }\n }",
"for(int b=1;b<=k;b++){\n for(int c=1;c<=k;c++){\n int g=gcd(a,b);\n g=gcd(g,c);\n sum+=(long)g;\n }\n }",
"int b=1;",
"int b=1;",
"b",
"1",
"b<=k",
"b",
"k",
"b++",
"b++",
"b",
"{\n for(int c=1;c<=k;c++){\n int g=gcd(a,b);\n g=gcd(g,c);\n sum+=(long)g;\n }\n }",
"{\n for(int c=1;c<=k;c++){\n int g=gcd(a,b);\n g=gcd(g,c);\n sum+=(long)g;\n }\n }",
"for(int c=1;c<=k;c++){\n int g=gcd(a,b);\n g=gcd(g,c);\n sum+=(long)g;\n }",
"int c=1;",
"int c=1;",
"c",
"1",
"c<=k",
"c",
"k",
"c++",
"c++",
"c",
"{\n int g=gcd(a,b);\n g=gcd(g,c);\n sum+=(long)g;\n }",
"{\n int g=gcd(a,b);\n g=gcd(g,c);\n sum+=(long)g;\n }",
"int g=gcd(a,b);",
"g",
"gcd(a,b)",
"gcd",
"a",
"b",
"g=gcd(g,c)",
"g",
"gcd(g,c)",
"gcd",
"g",
"c",
"sum+=(long)g",
"sum",
"(long)g",
"System.out.println(sum)",
"System.out.println",
"System.out",
"System",
"System.out",
"sum",
"String [] args",
"args",
"class FastScanner{\t\n private int BUFFER_SIZE = 1 << 16;\n \n private DataInputStream din;\n \n private byte[] buffer;\n \n private int bufferPointer, bytesRead;\n \n public FastScanner() {\n din = new DataInputStream(System.in);\n buffer = new byte[BUFFER_SIZE];\n bufferPointer = bytesRead = 0;\n }\n\n public FastScanner( String file_name) throws IOException {\n din = new DataInputStream(new FileInputStream(file_name));\n buffer = new byte[BUFFER_SIZE];\n bufferPointer = bytesRead = 0;\n }\n \n public String readLine() throws IOException {\n byte[] buf = new byte[64];\n int cnt = 0, c;\n while ((c = read()) != -1) {\n if (c == '\\n')\n break;\n buf[cnt++] = (byte) c;\n }\n return new String(buf, 0, cnt);\n }\n \n public String next() throws IOException{\n\n byte c = read();\n while(Character.isWhitespace(c)){\n c = read();\n }\n \n StringBuilder builder = new StringBuilder();\n builder.append((char)c);\n c = read();\n while(!Character.isWhitespace(c)){\n builder.append((char)c);\n c = read();\n }\n \n return builder.toString();\n }\n\n public int nextInt() throws IOException {\n int ret = 0;\n byte c = read();\n while (c <= ' ')\n c = read();\n boolean neg = (c == '-');\n if (neg)\n c = read();\n do {\n ret = ret * 10 + c - '0';\n } while ((c = read()) >= '0' && c <= '9');\n\n if (neg)\n return -ret;\n return ret;\n }\n \n public int[] nextIntArray( int n) throws IOException {\n int arr[] = new int[n];\n for(int i = 0; i < n; i++){\n arr[i] = nextInt();\n }\n return arr;\n }\n\n public long nextLong() throws IOException {\n long ret = 0;\n byte c = read();\n while (c <= ' ')\n c = read();\n boolean neg = (c == '-');\n if (neg)\n c = read();\n do {\n ret = ret * 10 + c - '0';\n } while ((c = read()) >= '0' && c <= '9');\n if (neg)\n return -ret;\n return ret;\n }\n \n public long[] nextLongArray( int n) throws IOException {\n long arr[] = new long[n];\n for(int i = 0; i < n; i++){\n arr[i] = nextLong();\n }\n return arr;\n }\n\n public char nextChar() throws IOException{\n byte c = read();\n while(Character.isWhitespace(c)){\n c = read();\n }\n return (char) c;\t\n }\n \n public double nextDouble() throws IOException {\n double ret = 0, div = 1;\n byte c = read();\n while (c <= ' ')\n c = read();\n boolean neg = (c == '-');\n if (neg)\n c = read();\n\n do {\n ret = ret * 10 + c - '0';\n } while ((c = read()) >= '0' && c <= '9');\n\n if (c == '.') {\n while ((c = read()) >= '0' && c <= '9') {\n ret += (c - '0') / (div *= 10);\n }\n }\n\n if (neg)\n return -ret;\n return ret;\n }\n \n public double[] nextDoubleArray( int n) throws IOException {\n double arr[] = new double[n];\n for(int i = 0; i < n; i++){\n arr[i] = nextDouble();\n }\n return arr;\n }\n\n private void fillBuffer() throws IOException {\n bytesRead = din.read(buffer, bufferPointer = 0, BUFFER_SIZE);\n if (bytesRead == -1)\n buffer[0] = -1;\n }\n\n private byte read() throws IOException {\n if (bufferPointer == bytesRead)\n fillBuffer();\n return buffer[bufferPointer++];\n }\n\n public void close() throws IOException {\n if (din == null)\n return;\n din.close();\n }\n\n}",
"FastScanner",
"private int BUFFER_SIZE = 1 << 16;",
"BUFFER_SIZE",
"1 << 16",
"1",
"16",
"private DataInputStream din;",
"din",
"private byte[] buffer;",
"buffer",
"private int bufferPointer",
"bufferPointer",
"bytesRead;",
"bytesRead",
"public FastScanner() {\n din = new DataInputStream(System.in);\n buffer = new byte[BUFFER_SIZE];\n bufferPointer = bytesRead = 0;\n }",
"FastScanner",
"{\n din = new DataInputStream(System.in);\n buffer = new byte[BUFFER_SIZE];\n bufferPointer = bytesRead = 0;\n }",
"din = new DataInputStream(System.in)",
"din",
"new DataInputStream(System.in)",
"buffer = new byte[BUFFER_SIZE]",
"buffer",
"new byte[BUFFER_SIZE]",
"BUFFER_SIZE",
"bufferPointer = bytesRead = 0",
"bufferPointer",
"bytesRead = 0",
"bytesRead",
"0",
"public FastScanner( String file_name) throws IOException {\n din = new DataInputStream(new FileInputStream(file_name));\n buffer = new byte[BUFFER_SIZE];\n bufferPointer = bytesRead = 0;\n }",
"FastScanner",
"{\n din = new DataInputStream(new FileInputStream(file_name));\n buffer = new byte[BUFFER_SIZE];\n bufferPointer = bytesRead = 0;\n }",
"din = new DataInputStream(new FileInputStream(file_name))",
"din",
"new DataInputStream(new FileInputStream(file_name))",
"buffer = new byte[BUFFER_SIZE]",
"buffer",
"new byte[BUFFER_SIZE]",
"BUFFER_SIZE",
"bufferPointer = bytesRead = 0",
"bufferPointer",
"bytesRead = 0",
"bytesRead",
"0",
"String file_name",
"file_name",
"public String readLine() throws IOException {\n byte[] buf = new byte[64];\n int cnt = 0, c;\n while ((c = read()) != -1) {\n if (c == '\\n')\n break;\n buf[cnt++] = (byte) c;\n }\n return new String(buf, 0, cnt);\n }",
"readLine",
"{\n byte[] buf = new byte[64];\n int cnt = 0, c;\n while ((c = read()) != -1) {\n if (c == '\\n')\n break;\n buf[cnt++] = (byte) c;\n }\n return new String(buf, 0, cnt);\n }",
"byte[] buf = new byte[64];",
"buf",
"new byte[64]",
"64",
"int cnt = 0",
"cnt",
"0",
"c;",
"c",
"while ((c = read()) != -1) {\n if (c == '\\n')\n break;\n buf[cnt++] = (byte) c;\n }",
"(c = read()) != -1",
"(c = read())",
"c",
"read()",
"read",
"-1",
"1",
"{\n if (c == '\\n')\n break;\n buf[cnt++] = (byte) c;\n }",
"if (c == '\\n')\n break;",
"c == '\\n'",
"c",
"'\\n'",
"break;",
"buf[cnt++] = (byte) c",
"buf[cnt++]",
"buf",
"cnt++",
"cnt",
"(byte) c",
"return new String(buf, 0, cnt);",
"new String(buf, 0, cnt)",
"public String next() throws IOException{\n\n byte c = read();\n while(Character.isWhitespace(c)){\n c = read();\n }\n \n StringBuilder builder = new StringBuilder();\n builder.append((char)c);\n c = read();\n while(!Character.isWhitespace(c)){\n builder.append((char)c);\n c = read();\n }\n \n return builder.toString();\n }",
"next",
"{\n\n byte c = read();\n while(Character.isWhitespace(c)){\n c = read();\n }\n \n StringBuilder builder = new StringBuilder();\n builder.append((char)c);\n c = read();\n while(!Character.isWhitespace(c)){\n builder.append((char)c);\n c = read();\n }\n \n return builder.toString();\n }",
"byte c = read();",
"c",
"read()",
"read",
"while(Character.isWhitespace(c)){\n c = read();\n }",
"Character.isWhitespace(c)",
"Character.isWhitespace",
"Character",
"c",
"{\n c = read();\n }",
"c = read()",
"c",
"read()",
"read",
"StringBuilder builder = new StringBuilder();",
"builder",
"new StringBuilder()",
"builder.append((char)c)",
"builder.append",
"builder",
"(char)c",
"c = read()",
"c",
"read()",
"read",
"while(!Character.isWhitespace(c)){\n builder.append((char)c);\n c = read();\n }",
"!Character.isWhitespace(c)",
"Character.isWhitespace(c)",
"Character.isWhitespace",
"Character",
"c",
"{\n builder.append((char)c);\n c = read();\n }",
"builder.append((char)c)",
"builder.append",
"builder",
"(char)c",
"c = read()",
"c",
"read()",
"read",
"return builder.toString();",
"builder.toString()",
"builder.toString",
"builder",
"public int nextInt() throws IOException {\n int ret = 0;\n byte c = read();\n while (c <= ' ')\n c = read();\n boolean neg = (c == '-');\n if (neg)\n c = read();\n do {\n ret = ret * 10 + c - '0';\n } while ((c = read()) >= '0' && c <= '9');\n\n if (neg)\n return -ret;\n return ret;\n }",
"nextInt",
"{\n int ret = 0;\n byte c = read();\n while (c <= ' ')\n c = read();\n boolean neg = (c == '-');\n if (neg)\n c = read();\n do {\n ret = ret * 10 + c - '0';\n } while ((c = read()) >= '0' && c <= '9');\n\n if (neg)\n return -ret;\n return ret;\n }",
"int ret = 0;",
"ret",
"0",
"byte c = read();",
"c",
"read()",
"read",
"while (c <= ' ')\n c = read();",
"c <= ' '",
"c",
"' '",
"c = read()",
"c",
"read()",
"read",
"boolean neg = (c == '-');",
"neg",
"(c == '-')",
"c",
"'-'",
"if (neg)\n c = read();",
"neg",
"c = read()",
"c",
"read()",
"read",
"do {\n ret = ret * 10 + c - '0';\n } while ((c = read()) >= '0' && c <= '9');",
"(c = read()) >= '0' && c <= '9'",
"(c = read()) >= '0'",
"(c = read())",
"c",
"read()",
"read",
"'0'",
"c <= '9'",
"c",
"'9'",
"{\n ret = ret * 10 + c - '0';\n }",
"ret = ret * 10 + c - '0'",
"ret",
"ret * 10 + c - '0'",
"ret * 10 + c",
"ret * 10",
"ret",
"10",
"c",
"'0'",
"if (neg)\n return -ret;",
"neg",
"return -ret;",
"-ret",
"ret",
"return ret;",
"ret",
"public int[] nextIntArray( int n) throws IOException {\n int arr[] = new int[n];\n for(int i = 0; i < n; i++){\n arr[i] = nextInt();\n }\n return arr;\n }",
"nextIntArray",
"{\n int arr[] = new int[n];\n for(int i = 0; i < n; i++){\n arr[i] = nextInt();\n }\n return arr;\n }",
"int arr[] = new int[n];",
"arr",
"new int[n]",
"n",
"for(int i = 0; i < n; i++){\n arr[i] = nextInt();\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < n",
"i",
"n",
"i++",
"i++",
"i",
"{\n arr[i] = nextInt();\n }",
"{\n arr[i] = nextInt();\n }",
"arr[i] = nextInt()",
"arr[i]",
"arr",
"i",
"nextInt()",
"nextInt",
"return arr;",
"arr",
"int n",
"n",
"public long nextLong() throws IOException {\n long ret = 0;\n byte c = read();\n while (c <= ' ')\n c = read();\n boolean neg = (c == '-');\n if (neg)\n c = read();\n do {\n ret = ret * 10 + c - '0';\n } while ((c = read()) >= '0' && c <= '9');\n if (neg)\n return -ret;\n return ret;\n }",
"nextLong",
"{\n long ret = 0;\n byte c = read();\n while (c <= ' ')\n c = read();\n boolean neg = (c == '-');\n if (neg)\n c = read();\n do {\n ret = ret * 10 + c - '0';\n } while ((c = read()) >= '0' && c <= '9');\n if (neg)\n return -ret;\n return ret;\n }",
"long ret = 0;",
"ret",
"0",
"byte c = read();",
"c",
"read()",
"read",
"while (c <= ' ')\n c = read();",
"c <= ' '",
"c",
"' '",
"c = read()",
"c",
"read()",
"read",
"boolean neg = (c == '-');",
"neg",
"(c == '-')",
"c",
"'-'",
"if (neg)\n c = read();",
"neg",
"c = read()",
"c",
"read()",
"read",
"do {\n ret = ret * 10 + c - '0';\n } while ((c = read()) >= '0' && c <= '9');",
"(c = read()) >= '0' && c <= '9'",
"(c = read()) >= '0'",
"(c = read())",
"c",
"read()",
"read",
"'0'",
"c <= '9'",
"c",
"'9'",
"{\n ret = ret * 10 + c - '0';\n }",
"ret = ret * 10 + c - '0'",
"ret",
"ret * 10 + c - '0'",
"ret * 10 + c",
"ret * 10",
"ret",
"10",
"c",
"'0'",
"if (neg)\n return -ret;",
"neg",
"return -ret;",
"-ret",
"ret",
"return ret;",
"ret",
"public long[] nextLongArray( int n) throws IOException {\n long arr[] = new long[n];\n for(int i = 0; i < n; i++){\n arr[i] = nextLong();\n }\n return arr;\n }",
"nextLongArray",
"{\n long arr[] = new long[n];\n for(int i = 0; i < n; i++){\n arr[i] = nextLong();\n }\n return arr;\n }",
"long arr[] = new long[n];",
"arr",
"new long[n]",
"n",
"for(int i = 0; i < n; i++){\n arr[i] = nextLong();\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < n",
"i",
"n",
"i++",
"i++",
"i",
"{\n arr[i] = nextLong();\n }",
"{\n arr[i] = nextLong();\n }",
"arr[i] = nextLong()",
"arr[i]",
"arr",
"i",
"nextLong()",
"nextLong",
"return arr;",
"arr",
"int n",
"n",
"public char nextChar() throws IOException{\n byte c = read();\n while(Character.isWhitespace(c)){\n c = read();\n }\n return (char) c;\t\n }",
"nextChar",
"{\n byte c = read();\n while(Character.isWhitespace(c)){\n c = read();\n }\n return (char) c;\t\n }",
"byte c = read();",
"c",
"read()",
"read",
"while(Character.isWhitespace(c)){\n c = read();\n }",
"Character.isWhitespace(c)",
"Character.isWhitespace",
"Character",
"c",
"{\n c = read();\n }",
"c = read()",
"c",
"read()",
"read",
"return (char) c;",
"(char) c",
"public double nextDouble() throws IOException {\n double ret = 0, div = 1;\n byte c = read();\n while (c <= ' ')\n c = read();\n boolean neg = (c == '-');\n if (neg)\n c = read();\n\n do {\n ret = ret * 10 + c - '0';\n } while ((c = read()) >= '0' && c <= '9');\n\n if (c == '.') {\n while ((c = read()) >= '0' && c <= '9') {\n ret += (c - '0') / (div *= 10);\n }\n }\n\n if (neg)\n return -ret;\n return ret;\n }",
"nextDouble",
"{\n double ret = 0, div = 1;\n byte c = read();\n while (c <= ' ')\n c = read();\n boolean neg = (c == '-');\n if (neg)\n c = read();\n\n do {\n ret = ret * 10 + c - '0';\n } while ((c = read()) >= '0' && c <= '9');\n\n if (c == '.') {\n while ((c = read()) >= '0' && c <= '9') {\n ret += (c - '0') / (div *= 10);\n }\n }\n\n if (neg)\n return -ret;\n return ret;\n }",
"double ret = 0",
"ret",
"0",
"div = 1;",
"div",
"1",
"byte c = read();",
"c",
"read()",
"read",
"while (c <= ' ')\n c = read();",
"c <= ' '",
"c",
"' '",
"c = read()",
"c",
"read()",
"read",
"boolean neg = (c == '-');",
"neg",
"(c == '-')",
"c",
"'-'",
"if (neg)\n c = read();",
"neg",
"c = read()",
"c",
"read()",
"read",
"do {\n ret = ret * 10 + c - '0';\n } while ((c = read()) >= '0' && c <= '9');",
"(c = read()) >= '0' && c <= '9'",
"(c = read()) >= '0'",
"(c = read())",
"c",
"read()",
"read",
"'0'",
"c <= '9'",
"c",
"'9'",
"{\n ret = ret * 10 + c - '0';\n }",
"ret = ret * 10 + c - '0'",
"ret",
"ret * 10 + c - '0'",
"ret * 10 + c",
"ret * 10",
"ret",
"10",
"c",
"'0'",
"if (c == '.') {\n while ((c = read()) >= '0' && c <= '9') {\n ret += (c - '0') / (div *= 10);\n }\n }",
"c == '.'",
"c",
"'.'",
"{\n while ((c = read()) >= '0' && c <= '9') {\n ret += (c - '0') / (div *= 10);\n }\n }",
"while ((c = read()) >= '0' && c <= '9') {\n ret += (c - '0') / (div *= 10);\n }",
"(c = read()) >= '0' && c <= '9'",
"(c = read()) >= '0'",
"(c = read())",
"c",
"read()",
"read",
"'0'",
"c <= '9'",
"c",
"'9'",
"{\n ret += (c - '0') / (div *= 10);\n }",
"ret += (c - '0') / (div *= 10)",
"ret",
"(c - '0') / (div *= 10)",
"(c - '0')",
"c",
"'0'",
"(div *= 10)",
"div",
"10",
"if (neg)\n return -ret;",
"neg",
"return -ret;",
"-ret",
"ret",
"return ret;",
"ret",
"public double[] nextDoubleArray( int n) throws IOException {\n double arr[] = new double[n];\n for(int i = 0; i < n; i++){\n arr[i] = nextDouble();\n }\n return arr;\n }",
"nextDoubleArray",
"{\n double arr[] = new double[n];\n for(int i = 0; i < n; i++){\n arr[i] = nextDouble();\n }\n return arr;\n }",
"double arr[] = new double[n];",
"arr",
"new double[n]",
"n",
"for(int i = 0; i < n; i++){\n arr[i] = nextDouble();\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < n",
"i",
"n",
"i++",
"i++",
"i",
"{\n arr[i] = nextDouble();\n }",
"{\n arr[i] = nextDouble();\n }",
"arr[i] = nextDouble()",
"arr[i]",
"arr",
"i",
"nextDouble()",
"nextDouble",
"return arr;",
"arr",
"int n",
"n",
"private void fillBuffer() throws IOException {\n bytesRead = din.read(buffer, bufferPointer = 0, BUFFER_SIZE);\n if (bytesRead == -1)\n buffer[0] = -1;\n }",
"fillBuffer",
"{\n bytesRead = din.read(buffer, bufferPointer = 0, BUFFER_SIZE);\n if (bytesRead == -1)\n buffer[0] = -1;\n }",
"bytesRead = din.read(buffer, bufferPointer = 0, BUFFER_SIZE)",
"bytesRead",
"din.read(buffer, bufferPointer = 0, BUFFER_SIZE)",
"din.read",
"din",
"buffer",
"bufferPointer = 0",
"bufferPointer",
"0",
"BUFFER_SIZE",
"if (bytesRead == -1)\n buffer[0] = -1;",
"bytesRead == -1",
"bytesRead",
"-1",
"1",
"buffer[0] = -1",
"buffer[0]",
"buffer",
"0",
"-1",
"1",
"private byte read() throws IOException {\n if (bufferPointer == bytesRead)\n fillBuffer();\n return buffer[bufferPointer++];\n }",
"read",
"{\n if (bufferPointer == bytesRead)\n fillBuffer();\n return buffer[bufferPointer++];\n }",
"if (bufferPointer == bytesRead)\n fillBuffer();",
"bufferPointer == bytesRead",
"bufferPointer",
"bytesRead",
"fillBuffer()",
"fillBuffer",
"return buffer[bufferPointer++];",
"buffer[bufferPointer++]",
"buffer",
"bufferPointer++",
"bufferPointer",
"public void close() throws IOException {\n if (din == null)\n return;\n din.close();\n }",
"close",
"{\n if (din == null)\n return;\n din.close();\n }",
"if (din == null)\n return;",
"din == null",
"din",
"null",
"return;",
"din.close()",
"din.close",
"din",
"public class Main {\n static int gcd(int a,int b){\n if(b==0)return a;\n return gcd(b,a%b);\n }\n public static void main(String [] args) throws IOException{\n FastScanner sc=new FastScanner();\n int k=sc.nextInt();\n long sum=0;\n for(int a=1;a<=k;a++){\n for(int b=1;b<=k;b++){\n for(int c=1;c<=k;c++){\n int g=gcd(a,b);\n g=gcd(g,c);\n sum+=(long)g;\n }\n }\n }\n\n System.out.println(sum);\n\n }\n\n}",
"public class Main {\n static int gcd(int a,int b){\n if(b==0)return a;\n return gcd(b,a%b);\n }\n public static void main(String [] args) throws IOException{\n FastScanner sc=new FastScanner();\n int k=sc.nextInt();\n long sum=0;\n for(int a=1;a<=k;a++){\n for(int b=1;b<=k;b++){\n for(int c=1;c<=k;c++){\n int g=gcd(a,b);\n g=gcd(g,c);\n sum+=(long)g;\n }\n }\n }\n\n System.out.println(sum);\n\n }\n\n}",
"Main"
] |
import java.util.*;
import java.io.*;
public class Main {
static int gcd(int a,int b){
if(b==0)return a;
return gcd(b,a%b);
}
public static void main(String [] args) throws IOException{
FastScanner sc=new FastScanner();
int k=sc.nextInt();
long sum=0;
for(int a=1;a<=k;a++){
for(int b=1;b<=k;b++){
for(int c=1;c<=k;c++){
int g=gcd(a,b);
g=gcd(g,c);
sum+=(long)g;
}
}
}
System.out.println(sum);
}
}
class FastScanner{
private int BUFFER_SIZE = 1 << 16;
private DataInputStream din;
private byte[] buffer;
private int bufferPointer, bytesRead;
public FastScanner() {
din = new DataInputStream(System.in);
buffer = new byte[BUFFER_SIZE];
bufferPointer = bytesRead = 0;
}
public FastScanner( String file_name) throws IOException {
din = new DataInputStream(new FileInputStream(file_name));
buffer = new byte[BUFFER_SIZE];
bufferPointer = bytesRead = 0;
}
public String readLine() throws IOException {
byte[] buf = new byte[64];
int cnt = 0, c;
while ((c = read()) != -1) {
if (c == '\n')
break;
buf[cnt++] = (byte) c;
}
return new String(buf, 0, cnt);
}
public String next() throws IOException{
byte c = read();
while(Character.isWhitespace(c)){
c = read();
}
StringBuilder builder = new StringBuilder();
builder.append((char)c);
c = read();
while(!Character.isWhitespace(c)){
builder.append((char)c);
c = read();
}
return builder.toString();
}
public int nextInt() throws IOException {
int ret = 0;
byte c = read();
while (c <= ' ')
c = read();
boolean neg = (c == '-');
if (neg)
c = read();
do {
ret = ret * 10 + c - '0';
} while ((c = read()) >= '0' && c <= '9');
if (neg)
return -ret;
return ret;
}
public int[] nextIntArray( int n) throws IOException {
int arr[] = new int[n];
for(int i = 0; i < n; i++){
arr[i] = nextInt();
}
return arr;
}
public long nextLong() throws IOException {
long ret = 0;
byte c = read();
while (c <= ' ')
c = read();
boolean neg = (c == '-');
if (neg)
c = read();
do {
ret = ret * 10 + c - '0';
} while ((c = read()) >= '0' && c <= '9');
if (neg)
return -ret;
return ret;
}
public long[] nextLongArray( int n) throws IOException {
long arr[] = new long[n];
for(int i = 0; i < n; i++){
arr[i] = nextLong();
}
return arr;
}
public char nextChar() throws IOException{
byte c = read();
while(Character.isWhitespace(c)){
c = read();
}
return (char) c;
}
public double nextDouble() throws IOException {
double ret = 0, div = 1;
byte c = read();
while (c <= ' ')
c = read();
boolean neg = (c == '-');
if (neg)
c = read();
do {
ret = ret * 10 + c - '0';
} while ((c = read()) >= '0' && c <= '9');
if (c == '.') {
while ((c = read()) >= '0' && c <= '9') {
ret += (c - '0') / (div *= 10);
}
}
if (neg)
return -ret;
return ret;
}
public double[] nextDoubleArray( int n) throws IOException {
double arr[] = new double[n];
for(int i = 0; i < n; i++){
arr[i] = nextDouble();
}
return arr;
}
private void fillBuffer() throws IOException {
bytesRead = din.read(buffer, bufferPointer = 0, BUFFER_SIZE);
if (bytesRead == -1)
buffer[0] = -1;
}
private byte read() throws IOException {
if (bufferPointer == bytesRead)
fillBuffer();
return buffer[bufferPointer++];
}
public void close() throws IOException {
if (din == null)
return;
din.close();
}
}
|
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
41,
13,
4,
13,
13,
13,
0,
13,
4,
13,
13,
13,
0,
13,
13,
4,
18,
18,
13,
13,
13,
23,
13,
12,
13,
30,
29,
8,
2,
13,
17,
4,
13,
13,
2,
13,
13,
13,
23,
13,
23,
13,
10,
6,
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
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
8,
17
],
[
17,
18
],
[
17,
19
],
[
8,
20
],
[
20,
21
],
[
21,
22
],
[
22,
23
],
[
22,
24
],
[
20,
25
],
[
25,
26
],
[
25,
27
],
[
20,
28
],
[
28,
29
],
[
29,
30
],
[
20,
31
],
[
32,
32
],
[
32,
33
],
[
33,
34
],
[
34,
35
],
[
35,
36
],
[
35,
37
],
[
33,
38
],
[
38,
39
],
[
38,
40
],
[
33,
41
],
[
41,
42
],
[
42,
43
],
[
33,
44
],
[
45,
45
],
[
45,
46
],
[
46,
47
],
[
47,
48
],
[
48,
49
],
[
48,
50
],
[
46,
51
],
[
51,
52
],
[
51,
53
],
[
46,
54
],
[
54,
55
],
[
55,
56
],
[
46,
57
],
[
58,
58
],
[
58,
59
],
[
59,
60
],
[
59,
61
],
[
61,
62
],
[
61,
63
],
[
61,
64
],
[
58,
65
],
[
65,
66
],
[
65,
67
],
[
67,
68
],
[
67,
69
],
[
67,
70
],
[
58,
71
],
[
71,
72
],
[
71,
73
],
[
8,
74
],
[
74,
75
],
[
75,
76
],
[
76,
77
],
[
76,
78
],
[
74,
79
],
[
6,
80
],
[
80,
81
],
[
102,
82
],
[
82,
83
],
[
82,
84
],
[
84,
85
],
[
85,
86
],
[
86,
87
],
[
87,
88
],
[
87,
89
],
[
86,
90
],
[
90,
91
],
[
90,
92
],
[
90,
93
],
[
93,
94
],
[
93,
95
],
[
86,
96
],
[
82,
97
],
[
97,
98
],
[
82,
99
],
[
99,
100
],
[
0,
101
],
[
101,
102
],
[
101,
103
]
] |
[
"import java.util.Scanner;\n\npublic class Main {\n public static void main(String[] args) {\n Scanner in = new Scanner(System.in);\n int K = in.nextInt();\n long sum = 0;\n for(int i = 1; i<=K; i++){\n for(int j = 1; j<=K; j++){\n for(int k = 1; k<=K; k++){\n int d = gcd(i,j);\n d = gcd(k,d);\n sum+=d;\n }\n }\n }\n System.out.print(sum);\n }\n\n public static int gcd(int a, int b){\n return (b>0)?gcd(b, a%b):a;\n }\n\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n public static void main(String[] args) {\n Scanner in = new Scanner(System.in);\n int K = in.nextInt();\n long sum = 0;\n for(int i = 1; i<=K; i++){\n for(int j = 1; j<=K; j++){\n for(int k = 1; k<=K; k++){\n int d = gcd(i,j);\n d = gcd(k,d);\n sum+=d;\n }\n }\n }\n System.out.print(sum);\n }\n\n public static int gcd(int a, int b){\n return (b>0)?gcd(b, a%b):a;\n }\n\n}",
"Main",
"public static void main(String[] args) {\n Scanner in = new Scanner(System.in);\n int K = in.nextInt();\n long sum = 0;\n for(int i = 1; i<=K; i++){\n for(int j = 1; j<=K; j++){\n for(int k = 1; k<=K; k++){\n int d = gcd(i,j);\n d = gcd(k,d);\n sum+=d;\n }\n }\n }\n System.out.print(sum);\n }",
"main",
"{\n Scanner in = new Scanner(System.in);\n int K = in.nextInt();\n long sum = 0;\n for(int i = 1; i<=K; i++){\n for(int j = 1; j<=K; j++){\n for(int k = 1; k<=K; k++){\n int d = gcd(i,j);\n d = gcd(k,d);\n sum+=d;\n }\n }\n }\n System.out.print(sum);\n }",
"Scanner in = new Scanner(System.in);",
"in",
"new Scanner(System.in)",
"int K = in.nextInt();",
"K",
"in.nextInt()",
"in.nextInt",
"in",
"long sum = 0;",
"sum",
"0",
"for(int i = 1; i<=K; i++){\n for(int j = 1; j<=K; j++){\n for(int k = 1; k<=K; k++){\n int d = gcd(i,j);\n d = gcd(k,d);\n sum+=d;\n }\n }\n }",
"int i = 1;",
"int i = 1;",
"i",
"1",
"i<=K",
"i",
"K",
"i++",
"i++",
"i",
"{\n for(int j = 1; j<=K; j++){\n for(int k = 1; k<=K; k++){\n int d = gcd(i,j);\n d = gcd(k,d);\n sum+=d;\n }\n }\n }",
"{\n for(int j = 1; j<=K; j++){\n for(int k = 1; k<=K; k++){\n int d = gcd(i,j);\n d = gcd(k,d);\n sum+=d;\n }\n }\n }",
"for(int j = 1; j<=K; j++){\n for(int k = 1; k<=K; k++){\n int d = gcd(i,j);\n d = gcd(k,d);\n sum+=d;\n }\n }",
"int j = 1;",
"int j = 1;",
"j",
"1",
"j<=K",
"j",
"K",
"j++",
"j++",
"j",
"{\n for(int k = 1; k<=K; k++){\n int d = gcd(i,j);\n d = gcd(k,d);\n sum+=d;\n }\n }",
"{\n for(int k = 1; k<=K; k++){\n int d = gcd(i,j);\n d = gcd(k,d);\n sum+=d;\n }\n }",
"for(int k = 1; k<=K; k++){\n int d = gcd(i,j);\n d = gcd(k,d);\n sum+=d;\n }",
"int k = 1;",
"int k = 1;",
"k",
"1",
"k<=K",
"k",
"K",
"k++",
"k++",
"k",
"{\n int d = gcd(i,j);\n d = gcd(k,d);\n sum+=d;\n }",
"{\n int d = gcd(i,j);\n d = gcd(k,d);\n sum+=d;\n }",
"int d = gcd(i,j);",
"d",
"gcd(i,j)",
"gcd",
"i",
"j",
"d = gcd(k,d)",
"d",
"gcd(k,d)",
"gcd",
"k",
"d",
"sum+=d",
"sum",
"d",
"System.out.print(sum)",
"System.out.print",
"System.out",
"System",
"System.out",
"sum",
"String[] args",
"args",
"public static int gcd(int a, int b){\n return (b>0)?gcd(b, a%b):a;\n }",
"gcd",
"{\n return (b>0)?gcd(b, a%b):a;\n }",
"return (b>0)?gcd(b, a%b):a;",
"(b>0)?gcd(b, a%b):a",
"(b>0)",
"b",
"0",
"gcd(b, a%b)",
"gcd",
"b",
"a%b",
"a",
"b",
"a",
"int a",
"a",
"int b",
"b",
"public class Main {\n public static void main(String[] args) {\n Scanner in = new Scanner(System.in);\n int K = in.nextInt();\n long sum = 0;\n for(int i = 1; i<=K; i++){\n for(int j = 1; j<=K; j++){\n for(int k = 1; k<=K; k++){\n int d = gcd(i,j);\n d = gcd(k,d);\n sum+=d;\n }\n }\n }\n System.out.print(sum);\n }\n\n public static int gcd(int a, int b){\n return (b>0)?gcd(b, a%b):a;\n }\n\n}",
"public class Main {\n public static void main(String[] args) {\n Scanner in = new Scanner(System.in);\n int K = in.nextInt();\n long sum = 0;\n for(int i = 1; i<=K; i++){\n for(int j = 1; j<=K; j++){\n for(int k = 1; k<=K; k++){\n int d = gcd(i,j);\n d = gcd(k,d);\n sum+=d;\n }\n }\n }\n System.out.print(sum);\n }\n\n public static int gcd(int a, int b){\n return (b>0)?gcd(b, a%b):a;\n }\n\n}",
"Main"
] |
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
int K = in.nextInt();
long sum = 0;
for(int i = 1; i<=K; i++){
for(int j = 1; j<=K; j++){
for(int k = 1; k<=K; k++){
int d = gcd(i,j);
d = gcd(k,d);
sum+=d;
}
}
}
System.out.print(sum);
}
public static int gcd(int a, int b){
return (b>0)?gcd(b, a%b):a;
}
}
|
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
18,
13,
13,
41,
13,
18,
13,
13,
41,
13,
20,
41,
13,
20,
41,
13,
20,
4,
18,
13,
17,
13,
13,
4,
18,
13,
23,
13,
6,
13,
12,
13,
30,
41,
13,
4,
18,
13,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
11,
1,
41,
13,
13,
2,
13,
13,
1,
40,
13,
30,
30,
41,
13,
4,
13,
13,
13,
13,
14,
2,
4,
13,
13,
13,
13,
17,
30,
0,
13,
13,
14,
2,
4,
13,
13,
13,
13,
17,
30,
0,
13,
2,
13,
17,
14,
2,
4,
13,
13,
13,
13,
17,
30,
0,
13,
2,
13,
17,
4,
18,
13,
13,
23,
13,
23,
13,
23,
13,
12,
13,
30,
41,
13,
20,
4,
18,
13,
13,
4,
18,
13,
13,
4,
18,
13,
13,
29,
4,
18,
13,
23,
13,
23,
13,
23,
13,
12,
13,
30,
14,
2,
13,
17,
30,
29,
13,
29,
4,
13,
13,
2,
13,
13,
23,
13,
23,
13,
12,
13,
30,
29,
4,
13,
4,
13,
13,
13,
13,
23,
13,
23,
13,
23,
13,
6,
13,
41,
13,
41,
13,
12,
13,
30,
0,
13,
20,
0,
13,
17,
23,
13,
12,
13,
30,
42,
2,
2,
13,
17,
40,
4,
18,
13,
30,
38,
5,
13,
30,
37,
20,
30,
0,
13,
20,
29,
4,
18,
13,
12,
13,
30,
29,
4,
18,
13,
4,
13,
12,
13,
30,
29,
4,
18,
13,
4,
13,
12,
13,
30,
29,
4,
18,
13,
4,
13,
12,
13,
30,
29,
4,
18,
4,
13,
17,
12,
13,
30,
29,
4,
18,
4,
18,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
10,
11
],
[
10,
12
],
[
0,
13
],
[
313,
14
],
[
313,
15
],
[
15,
16
],
[
15,
17
],
[
17,
18
],
[
18,
19
],
[
18,
20
],
[
20,
21
],
[
20,
22
],
[
17,
23
],
[
23,
24
],
[
23,
25
],
[
25,
26
],
[
25,
27
],
[
17,
28
],
[
28,
29
],
[
28,
30
],
[
17,
31
],
[
31,
32
],
[
31,
33
],
[
17,
34
],
[
34,
35
],
[
34,
36
],
[
17,
37
],
[
37,
38
],
[
38,
39
],
[
37,
40
],
[
37,
41
],
[
37,
42
],
[
17,
43
],
[
43,
44
],
[
44,
45
],
[
15,
46
],
[
46,
47
],
[
313,
48
],
[
48,
49
],
[
48,
50
],
[
50,
51
],
[
50,
52
],
[
52,
53
],
[
53,
54
],
[
53,
55
],
[
55,
56
],
[
56,
57
],
[
52,
58
],
[
58,
59
],
[
58,
60
],
[
52,
61
],
[
61,
62
],
[
62,
63
],
[
63,
64
],
[
63,
65
],
[
61,
66
],
[
66,
67
],
[
66,
68
],
[
61,
69
],
[
69,
70
],
[
70,
71
],
[
61,
72
],
[
73,
73
],
[
73,
74
],
[
74,
75
],
[
75,
76
],
[
76,
77
],
[
76,
78
],
[
74,
79
],
[
79,
80
],
[
79,
81
],
[
74,
82
],
[
82,
83
],
[
83,
84
],
[
74,
85
],
[
86,
86
],
[
86,
87
],
[
87,
88
],
[
88,
89
],
[
89,
90
],
[
89,
91
],
[
87,
92
],
[
92,
93
],
[
92,
94
],
[
87,
95
],
[
95,
96
],
[
96,
97
],
[
87,
98
],
[
99,
99
],
[
99,
100
],
[
100,
101
],
[
100,
102
],
[
102,
103
],
[
102,
104
],
[
102,
105
],
[
102,
106
],
[
99,
107
],
[
107,
108
],
[
108,
109
],
[
109,
110
],
[
109,
111
],
[
109,
112
],
[
109,
113
],
[
108,
114
],
[
107,
115
],
[
115,
116
],
[
116,
117
],
[
116,
118
],
[
99,
119
],
[
119,
120
],
[
120,
121
],
[
121,
122
],
[
121,
123
],
[
121,
124
],
[
121,
125
],
[
120,
126
],
[
119,
127
],
[
127,
128
],
[
128,
129
],
[
128,
130
],
[
130,
131
],
[
130,
132
],
[
99,
133
],
[
133,
134
],
[
134,
135
],
[
135,
136
],
[
135,
137
],
[
135,
138
],
[
135,
139
],
[
134,
140
],
[
133,
141
],
[
141,
142
],
[
142,
143
],
[
142,
144
],
[
144,
145
],
[
144,
146
],
[
52,
147
],
[
147,
148
],
[
148,
149
],
[
147,
150
],
[
50,
151
],
[
151,
152
],
[
50,
153
],
[
153,
154
],
[
50,
155
],
[
155,
156
],
[
48,
157
],
[
157,
158
],
[
157,
159
],
[
159,
160
],
[
160,
161
],
[
160,
162
],
[
159,
163
],
[
163,
164
],
[
164,
165
],
[
163,
166
],
[
159,
167
],
[
167,
168
],
[
168,
169
],
[
167,
170
],
[
159,
171
],
[
171,
172
],
[
172,
173
],
[
171,
174
],
[
159,
175
],
[
175,
176
],
[
176,
177
],
[
177,
178
],
[
157,
179
],
[
179,
180
],
[
157,
181
],
[
181,
182
],
[
157,
183
],
[
183,
184
],
[
48,
185
],
[
185,
186
],
[
185,
187
],
[
187,
188
],
[
188,
189
],
[
189,
190
],
[
189,
191
],
[
188,
192
],
[
192,
193
],
[
193,
194
],
[
187,
195
],
[
195,
196
],
[
196,
197
],
[
196,
198
],
[
196,
199
],
[
199,
200
],
[
199,
201
],
[
185,
202
],
[
202,
203
],
[
185,
204
],
[
204,
205
],
[
48,
206
],
[
206,
207
],
[
206,
208
],
[
208,
209
],
[
209,
210
],
[
210,
211
],
[
210,
212
],
[
212,
213
],
[
212,
214
],
[
212,
215
],
[
210,
216
],
[
206,
217
],
[
217,
218
],
[
206,
219
],
[
219,
220
],
[
206,
221
],
[
221,
222
],
[
313,
223
],
[
223,
224
],
[
223,
225
],
[
225,
226
],
[
223,
227
],
[
227,
228
],
[
223,
229
],
[
229,
230
],
[
229,
231
],
[
231,
232
],
[
232,
233
],
[
232,
234
],
[
231,
235
],
[
235,
236
],
[
235,
237
],
[
229,
238
],
[
238,
239
],
[
223,
240
],
[
240,
241
],
[
240,
242
],
[
242,
243
],
[
243,
244
],
[
244,
245
],
[
245,
246
],
[
245,
247
],
[
244,
248
],
[
248,
249
],
[
249,
250
],
[
250,
251
],
[
243,
252
],
[
252,
253
],
[
253,
254
],
[
254,
255
],
[
254,
256
],
[
256,
257
],
[
257,
258
],
[
253,
259
],
[
259,
260
],
[
260,
261
],
[
260,
262
],
[
242,
263
],
[
263,
264
],
[
264,
265
],
[
265,
266
],
[
223,
267
],
[
267,
268
],
[
267,
269
],
[
269,
270
],
[
270,
271
],
[
271,
272
],
[
272,
273
],
[
271,
274
],
[
274,
275
],
[
223,
276
],
[
276,
277
],
[
276,
278
],
[
278,
279
],
[
279,
280
],
[
280,
281
],
[
281,
282
],
[
280,
283
],
[
283,
284
],
[
223,
285
],
[
285,
286
],
[
285,
287
],
[
287,
288
],
[
288,
289
],
[
289,
290
],
[
290,
291
],
[
289,
292
],
[
292,
293
],
[
223,
294
],
[
294,
295
],
[
294,
296
],
[
296,
297
],
[
297,
298
],
[
298,
299
],
[
299,
300
],
[
300,
301
],
[
298,
302
],
[
223,
303
],
[
303,
304
],
[
303,
305
],
[
305,
306
],
[
306,
307
],
[
307,
308
],
[
308,
309
],
[
309,
310
],
[
310,
311
],
[
0,
312
],
[
312,
313
],
[
312,
314
]
] |
[
"import java.io.*;\nimport java.util.HashSet;\nimport java.util.Set;\nimport java.util.StringTokenizer;\n\npublic class Main {\n public static void main(String[] args) throws IOException {\n InputStream inputStream = System.in;\n OutputStream outputStream = System.out;\n InputReader in = new InputReader(inputStream);\n PrintWriter out = new PrintWriter(outputStream);\n Task solver = new Task();\n// int t = in.nextInt();\n solver.solve(1, in, out);\n out.close();\n }\n\n static class Task {\n public void solve(int testNumber, InputReader in, PrintWriter out) throws IOException {\n int k = in.nextInt();\n long ans = 0;\n for (int i = 1; i <=k; i++) {\n for (int j = 1; j <= i; j++) {\n for (int l = j; l <= i ; l++) {\n long g = gcdMultiple(i,j,l);\n if (findUnique(i,j,l) == 1) {\n ans += g;\n }\n if (findUnique(i,j,l) == 2) {\n ans += g*3;\n }\n if (findUnique(i,j,l) == 3) {\n ans += g*6;\n }\n }\n }\n }\n out.println(ans);\n }\n private static int findUnique(int a, int b, int c) {\n Set<Integer> set = new HashSet<>();\n set.add(a);\n set.add(b);\n set.add(c);\n return set.size();\n }\n private static int gcd(int a, int b) {\n if (b == 0){\n return a;\n }\n return gcd(b, a % b);\n }\n\n static int gcdMultiple(int a, int b, int c) {\n return gcd(gcd(a,b), c);\n }\n }\n\n static class InputReader {\n public BufferedReader reader;\n public StringTokenizer tokenizer;\n\n public InputReader(InputStream stream) {\n reader = new BufferedReader(new InputStreamReader(stream), 32768);\n tokenizer = null;\n }\n\n public String next() {\n while (tokenizer == null || !tokenizer.hasMoreTokens()) {\n try {\n tokenizer = new StringTokenizer(reader.readLine());\n } catch (IOException e) {\n throw new RuntimeException(e);\n }\n }\n return tokenizer.nextToken();\n }\n\n public long nextLong() {\n return Long.parseLong(next());\n }\n\n public double nextDouble() {\n return Double.parseDouble(next());\n }\n\n public int nextInt() {\n return Integer.parseInt(next());\n }\n\n public char nextChar() {\n return next().charAt(0);\n }\n\n public String nextLine() throws IOException {\n return reader.readLine().trim();\n }\n }\n}",
"import java.io.*;",
"io.*",
"java",
"import java.util.HashSet;",
"HashSet",
"java.util",
"import java.util.Set;",
"Set",
"java.util",
"import java.util.StringTokenizer;",
"StringTokenizer",
"java.util",
"public class Main {\n public static void main(String[] args) throws IOException {\n InputStream inputStream = System.in;\n OutputStream outputStream = System.out;\n InputReader in = new InputReader(inputStream);\n PrintWriter out = new PrintWriter(outputStream);\n Task solver = new Task();\n// int t = in.nextInt();\n solver.solve(1, in, out);\n out.close();\n }\n\n static class Task {\n public void solve(int testNumber, InputReader in, PrintWriter out) throws IOException {\n int k = in.nextInt();\n long ans = 0;\n for (int i = 1; i <=k; i++) {\n for (int j = 1; j <= i; j++) {\n for (int l = j; l <= i ; l++) {\n long g = gcdMultiple(i,j,l);\n if (findUnique(i,j,l) == 1) {\n ans += g;\n }\n if (findUnique(i,j,l) == 2) {\n ans += g*3;\n }\n if (findUnique(i,j,l) == 3) {\n ans += g*6;\n }\n }\n }\n }\n out.println(ans);\n }\n private static int findUnique(int a, int b, int c) {\n Set<Integer> set = new HashSet<>();\n set.add(a);\n set.add(b);\n set.add(c);\n return set.size();\n }\n private static int gcd(int a, int b) {\n if (b == 0){\n return a;\n }\n return gcd(b, a % b);\n }\n\n static int gcdMultiple(int a, int b, int c) {\n return gcd(gcd(a,b), c);\n }\n }\n\n static class InputReader {\n public BufferedReader reader;\n public StringTokenizer tokenizer;\n\n public InputReader(InputStream stream) {\n reader = new BufferedReader(new InputStreamReader(stream), 32768);\n tokenizer = null;\n }\n\n public String next() {\n while (tokenizer == null || !tokenizer.hasMoreTokens()) {\n try {\n tokenizer = new StringTokenizer(reader.readLine());\n } catch (IOException e) {\n throw new RuntimeException(e);\n }\n }\n return tokenizer.nextToken();\n }\n\n public long nextLong() {\n return Long.parseLong(next());\n }\n\n public double nextDouble() {\n return Double.parseDouble(next());\n }\n\n public int nextInt() {\n return Integer.parseInt(next());\n }\n\n public char nextChar() {\n return next().charAt(0);\n }\n\n public String nextLine() throws IOException {\n return reader.readLine().trim();\n }\n }\n}",
"Main",
"public static void main(String[] args) throws IOException {\n InputStream inputStream = System.in;\n OutputStream outputStream = System.out;\n InputReader in = new InputReader(inputStream);\n PrintWriter out = new PrintWriter(outputStream);\n Task solver = new Task();\n// int t = in.nextInt();\n solver.solve(1, in, out);\n out.close();\n }",
"main",
"{\n InputStream inputStream = System.in;\n OutputStream outputStream = System.out;\n InputReader in = new InputReader(inputStream);\n PrintWriter out = new PrintWriter(outputStream);\n Task solver = new Task();\n// int t = in.nextInt();\n solver.solve(1, in, out);\n out.close();\n }",
"InputStream inputStream = System.in;",
"inputStream",
"System.in",
"System",
"System.in",
"OutputStream outputStream = System.out;",
"outputStream",
"System.out",
"System",
"System.out",
"InputReader in = new InputReader(inputStream);",
"in",
"new InputReader(inputStream)",
"PrintWriter out = new PrintWriter(outputStream);",
"out",
"new PrintWriter(outputStream)",
"Task solver = new Task();",
"solver",
"new Task()",
"solver.solve(1, in, out)",
"solver.solve",
"solver",
"1",
"in",
"out",
"out.close()",
"out.close",
"out",
"String[] args",
"args",
"static class Task {\n public void solve(int testNumber, InputReader in, PrintWriter out) throws IOException {\n int k = in.nextInt();\n long ans = 0;\n for (int i = 1; i <=k; i++) {\n for (int j = 1; j <= i; j++) {\n for (int l = j; l <= i ; l++) {\n long g = gcdMultiple(i,j,l);\n if (findUnique(i,j,l) == 1) {\n ans += g;\n }\n if (findUnique(i,j,l) == 2) {\n ans += g*3;\n }\n if (findUnique(i,j,l) == 3) {\n ans += g*6;\n }\n }\n }\n }\n out.println(ans);\n }\n private static int findUnique(int a, int b, int c) {\n Set<Integer> set = new HashSet<>();\n set.add(a);\n set.add(b);\n set.add(c);\n return set.size();\n }\n private static int gcd(int a, int b) {\n if (b == 0){\n return a;\n }\n return gcd(b, a % b);\n }\n\n static int gcdMultiple(int a, int b, int c) {\n return gcd(gcd(a,b), c);\n }\n }",
"Task",
"public void solve(int testNumber, InputReader in, PrintWriter out) throws IOException {\n int k = in.nextInt();\n long ans = 0;\n for (int i = 1; i <=k; i++) {\n for (int j = 1; j <= i; j++) {\n for (int l = j; l <= i ; l++) {\n long g = gcdMultiple(i,j,l);\n if (findUnique(i,j,l) == 1) {\n ans += g;\n }\n if (findUnique(i,j,l) == 2) {\n ans += g*3;\n }\n if (findUnique(i,j,l) == 3) {\n ans += g*6;\n }\n }\n }\n }\n out.println(ans);\n }",
"solve",
"{\n int k = in.nextInt();\n long ans = 0;\n for (int i = 1; i <=k; i++) {\n for (int j = 1; j <= i; j++) {\n for (int l = j; l <= i ; l++) {\n long g = gcdMultiple(i,j,l);\n if (findUnique(i,j,l) == 1) {\n ans += g;\n }\n if (findUnique(i,j,l) == 2) {\n ans += g*3;\n }\n if (findUnique(i,j,l) == 3) {\n ans += g*6;\n }\n }\n }\n }\n out.println(ans);\n }",
"int k = in.nextInt();",
"k",
"in.nextInt()",
"in.nextInt",
"in",
"long ans = 0;",
"ans",
"0",
"for (int i = 1; i <=k; i++) {\n for (int j = 1; j <= i; j++) {\n for (int l = j; l <= i ; l++) {\n long g = gcdMultiple(i,j,l);\n if (findUnique(i,j,l) == 1) {\n ans += g;\n }\n if (findUnique(i,j,l) == 2) {\n ans += g*3;\n }\n if (findUnique(i,j,l) == 3) {\n ans += g*6;\n }\n }\n }\n }",
"int i = 1;",
"int i = 1;",
"i",
"1",
"i <=k",
"i",
"k",
"i++",
"i++",
"i",
"{\n for (int j = 1; j <= i; j++) {\n for (int l = j; l <= i ; l++) {\n long g = gcdMultiple(i,j,l);\n if (findUnique(i,j,l) == 1) {\n ans += g;\n }\n if (findUnique(i,j,l) == 2) {\n ans += g*3;\n }\n if (findUnique(i,j,l) == 3) {\n ans += g*6;\n }\n }\n }\n }",
"{\n for (int j = 1; j <= i; j++) {\n for (int l = j; l <= i ; l++) {\n long g = gcdMultiple(i,j,l);\n if (findUnique(i,j,l) == 1) {\n ans += g;\n }\n if (findUnique(i,j,l) == 2) {\n ans += g*3;\n }\n if (findUnique(i,j,l) == 3) {\n ans += g*6;\n }\n }\n }\n }",
"for (int j = 1; j <= i; j++) {\n for (int l = j; l <= i ; l++) {\n long g = gcdMultiple(i,j,l);\n if (findUnique(i,j,l) == 1) {\n ans += g;\n }\n if (findUnique(i,j,l) == 2) {\n ans += g*3;\n }\n if (findUnique(i,j,l) == 3) {\n ans += g*6;\n }\n }\n }",
"int j = 1;",
"int j = 1;",
"j",
"1",
"j <= i",
"j",
"i",
"j++",
"j++",
"j",
"{\n for (int l = j; l <= i ; l++) {\n long g = gcdMultiple(i,j,l);\n if (findUnique(i,j,l) == 1) {\n ans += g;\n }\n if (findUnique(i,j,l) == 2) {\n ans += g*3;\n }\n if (findUnique(i,j,l) == 3) {\n ans += g*6;\n }\n }\n }",
"{\n for (int l = j; l <= i ; l++) {\n long g = gcdMultiple(i,j,l);\n if (findUnique(i,j,l) == 1) {\n ans += g;\n }\n if (findUnique(i,j,l) == 2) {\n ans += g*3;\n }\n if (findUnique(i,j,l) == 3) {\n ans += g*6;\n }\n }\n }",
"for (int l = j; l <= i ; l++) {\n long g = gcdMultiple(i,j,l);\n if (findUnique(i,j,l) == 1) {\n ans += g;\n }\n if (findUnique(i,j,l) == 2) {\n ans += g*3;\n }\n if (findUnique(i,j,l) == 3) {\n ans += g*6;\n }\n }",
"int l = j;",
"int l = j;",
"l",
"j",
"l <= i",
"l",
"i",
"l++",
"l++",
"l",
"{\n long g = gcdMultiple(i,j,l);\n if (findUnique(i,j,l) == 1) {\n ans += g;\n }\n if (findUnique(i,j,l) == 2) {\n ans += g*3;\n }\n if (findUnique(i,j,l) == 3) {\n ans += g*6;\n }\n }",
"{\n long g = gcdMultiple(i,j,l);\n if (findUnique(i,j,l) == 1) {\n ans += g;\n }\n if (findUnique(i,j,l) == 2) {\n ans += g*3;\n }\n if (findUnique(i,j,l) == 3) {\n ans += g*6;\n }\n }",
"long g = gcdMultiple(i,j,l);",
"g",
"gcdMultiple(i,j,l)",
"gcdMultiple",
"i",
"j",
"l",
"if (findUnique(i,j,l) == 1) {\n ans += g;\n }",
"findUnique(i,j,l) == 1",
"findUnique(i,j,l)",
"findUnique",
"i",
"j",
"l",
"1",
"{\n ans += g;\n }",
"ans += g",
"ans",
"g",
"if (findUnique(i,j,l) == 2) {\n ans += g*3;\n }",
"findUnique(i,j,l) == 2",
"findUnique(i,j,l)",
"findUnique",
"i",
"j",
"l",
"2",
"{\n ans += g*3;\n }",
"ans += g*3",
"ans",
"g*3",
"g",
"3",
"if (findUnique(i,j,l) == 3) {\n ans += g*6;\n }",
"findUnique(i,j,l) == 3",
"findUnique(i,j,l)",
"findUnique",
"i",
"j",
"l",
"3",
"{\n ans += g*6;\n }",
"ans += g*6",
"ans",
"g*6",
"g",
"6",
"out.println(ans)",
"out.println",
"out",
"ans",
"int testNumber",
"testNumber",
"InputReader in",
"in",
"PrintWriter out",
"out",
"private static int findUnique(int a, int b, int c) {\n Set<Integer> set = new HashSet<>();\n set.add(a);\n set.add(b);\n set.add(c);\n return set.size();\n }",
"findUnique",
"{\n Set<Integer> set = new HashSet<>();\n set.add(a);\n set.add(b);\n set.add(c);\n return set.size();\n }",
"Set<Integer> set = new HashSet<>();",
"set",
"new HashSet<>()",
"set.add(a)",
"set.add",
"set",
"a",
"set.add(b)",
"set.add",
"set",
"b",
"set.add(c)",
"set.add",
"set",
"c",
"return set.size();",
"set.size()",
"set.size",
"set",
"int a",
"a",
"int b",
"b",
"int c",
"c",
"private static int gcd(int a, int b) {\n if (b == 0){\n return a;\n }\n return gcd(b, a % b);\n }",
"gcd",
"{\n if (b == 0){\n return a;\n }\n return gcd(b, a % b);\n }",
"if (b == 0){\n return a;\n }",
"b == 0",
"b",
"0",
"{\n return a;\n }",
"return a;",
"a",
"return gcd(b, a % b);",
"gcd(b, a % b)",
"gcd",
"b",
"a % b",
"a",
"b",
"int a",
"a",
"int b",
"b",
"static int gcdMultiple(int a, int b, int c) {\n return gcd(gcd(a,b), c);\n }",
"gcdMultiple",
"{\n return gcd(gcd(a,b), c);\n }",
"return gcd(gcd(a,b), c);",
"gcd(gcd(a,b), c)",
"gcd",
"gcd(a,b)",
"gcd",
"a",
"b",
"c",
"int a",
"a",
"int b",
"b",
"int c",
"c",
"static class InputReader {\n public BufferedReader reader;\n public StringTokenizer tokenizer;\n\n public InputReader(InputStream stream) {\n reader = new BufferedReader(new InputStreamReader(stream), 32768);\n tokenizer = null;\n }\n\n public String next() {\n while (tokenizer == null || !tokenizer.hasMoreTokens()) {\n try {\n tokenizer = new StringTokenizer(reader.readLine());\n } catch (IOException e) {\n throw new RuntimeException(e);\n }\n }\n return tokenizer.nextToken();\n }\n\n public long nextLong() {\n return Long.parseLong(next());\n }\n\n public double nextDouble() {\n return Double.parseDouble(next());\n }\n\n public int nextInt() {\n return Integer.parseInt(next());\n }\n\n public char nextChar() {\n return next().charAt(0);\n }\n\n public String nextLine() throws IOException {\n return reader.readLine().trim();\n }\n }",
"InputReader",
"public BufferedReader reader;",
"reader",
"public StringTokenizer tokenizer;",
"tokenizer",
"public InputReader(InputStream stream) {\n reader = new BufferedReader(new InputStreamReader(stream), 32768);\n tokenizer = null;\n }",
"InputReader",
"{\n reader = new BufferedReader(new InputStreamReader(stream), 32768);\n tokenizer = null;\n }",
"reader = new BufferedReader(new InputStreamReader(stream), 32768)",
"reader",
"new BufferedReader(new InputStreamReader(stream), 32768)",
"tokenizer = null",
"tokenizer",
"null",
"InputStream stream",
"stream",
"public String next() {\n while (tokenizer == null || !tokenizer.hasMoreTokens()) {\n try {\n tokenizer = new StringTokenizer(reader.readLine());\n } catch (IOException e) {\n throw new RuntimeException(e);\n }\n }\n return tokenizer.nextToken();\n }",
"next",
"{\n while (tokenizer == null || !tokenizer.hasMoreTokens()) {\n try {\n tokenizer = new StringTokenizer(reader.readLine());\n } catch (IOException e) {\n throw new RuntimeException(e);\n }\n }\n return tokenizer.nextToken();\n }",
"while (tokenizer == null || !tokenizer.hasMoreTokens()) {\n try {\n tokenizer = new StringTokenizer(reader.readLine());\n } catch (IOException e) {\n throw new RuntimeException(e);\n }\n }",
"tokenizer == null || !tokenizer.hasMoreTokens()",
"tokenizer == null",
"tokenizer",
"null",
"!tokenizer.hasMoreTokens()",
"tokenizer.hasMoreTokens()",
"tokenizer.hasMoreTokens",
"tokenizer",
"{\n try {\n tokenizer = new StringTokenizer(reader.readLine());\n } catch (IOException e) {\n throw new RuntimeException(e);\n }\n }",
"try {\n tokenizer = new StringTokenizer(reader.readLine());\n } catch (IOException e) {\n throw new RuntimeException(e);\n }",
"catch (IOException e) {\n throw new RuntimeException(e);\n }",
"IOException e",
"{\n throw new RuntimeException(e);\n }",
"throw new RuntimeException(e);",
"new RuntimeException(e)",
"{\n tokenizer = new StringTokenizer(reader.readLine());\n }",
"tokenizer = new StringTokenizer(reader.readLine())",
"tokenizer",
"new StringTokenizer(reader.readLine())",
"return tokenizer.nextToken();",
"tokenizer.nextToken()",
"tokenizer.nextToken",
"tokenizer",
"public long nextLong() {\n return Long.parseLong(next());\n }",
"nextLong",
"{\n return Long.parseLong(next());\n }",
"return Long.parseLong(next());",
"Long.parseLong(next())",
"Long.parseLong",
"Long",
"next()",
"next",
"public double nextDouble() {\n return Double.parseDouble(next());\n }",
"nextDouble",
"{\n return Double.parseDouble(next());\n }",
"return Double.parseDouble(next());",
"Double.parseDouble(next())",
"Double.parseDouble",
"Double",
"next()",
"next",
"public int nextInt() {\n return Integer.parseInt(next());\n }",
"nextInt",
"{\n return Integer.parseInt(next());\n }",
"return Integer.parseInt(next());",
"Integer.parseInt(next())",
"Integer.parseInt",
"Integer",
"next()",
"next",
"public char nextChar() {\n return next().charAt(0);\n }",
"nextChar",
"{\n return next().charAt(0);\n }",
"return next().charAt(0);",
"next().charAt(0)",
"next().charAt",
"next()",
"next",
"0",
"public String nextLine() throws IOException {\n return reader.readLine().trim();\n }",
"nextLine",
"{\n return reader.readLine().trim();\n }",
"return reader.readLine().trim();",
"reader.readLine().trim()",
"reader.readLine().trim",
"reader.readLine()",
"reader.readLine",
"reader",
"public class Main {\n public static void main(String[] args) throws IOException {\n InputStream inputStream = System.in;\n OutputStream outputStream = System.out;\n InputReader in = new InputReader(inputStream);\n PrintWriter out = new PrintWriter(outputStream);\n Task solver = new Task();\n// int t = in.nextInt();\n solver.solve(1, in, out);\n out.close();\n }\n\n static class Task {\n public void solve(int testNumber, InputReader in, PrintWriter out) throws IOException {\n int k = in.nextInt();\n long ans = 0;\n for (int i = 1; i <=k; i++) {\n for (int j = 1; j <= i; j++) {\n for (int l = j; l <= i ; l++) {\n long g = gcdMultiple(i,j,l);\n if (findUnique(i,j,l) == 1) {\n ans += g;\n }\n if (findUnique(i,j,l) == 2) {\n ans += g*3;\n }\n if (findUnique(i,j,l) == 3) {\n ans += g*6;\n }\n }\n }\n }\n out.println(ans);\n }\n private static int findUnique(int a, int b, int c) {\n Set<Integer> set = new HashSet<>();\n set.add(a);\n set.add(b);\n set.add(c);\n return set.size();\n }\n private static int gcd(int a, int b) {\n if (b == 0){\n return a;\n }\n return gcd(b, a % b);\n }\n\n static int gcdMultiple(int a, int b, int c) {\n return gcd(gcd(a,b), c);\n }\n }\n\n static class InputReader {\n public BufferedReader reader;\n public StringTokenizer tokenizer;\n\n public InputReader(InputStream stream) {\n reader = new BufferedReader(new InputStreamReader(stream), 32768);\n tokenizer = null;\n }\n\n public String next() {\n while (tokenizer == null || !tokenizer.hasMoreTokens()) {\n try {\n tokenizer = new StringTokenizer(reader.readLine());\n } catch (IOException e) {\n throw new RuntimeException(e);\n }\n }\n return tokenizer.nextToken();\n }\n\n public long nextLong() {\n return Long.parseLong(next());\n }\n\n public double nextDouble() {\n return Double.parseDouble(next());\n }\n\n public int nextInt() {\n return Integer.parseInt(next());\n }\n\n public char nextChar() {\n return next().charAt(0);\n }\n\n public String nextLine() throws IOException {\n return reader.readLine().trim();\n }\n }\n}",
"public class Main {\n public static void main(String[] args) throws IOException {\n InputStream inputStream = System.in;\n OutputStream outputStream = System.out;\n InputReader in = new InputReader(inputStream);\n PrintWriter out = new PrintWriter(outputStream);\n Task solver = new Task();\n// int t = in.nextInt();\n solver.solve(1, in, out);\n out.close();\n }\n\n static class Task {\n public void solve(int testNumber, InputReader in, PrintWriter out) throws IOException {\n int k = in.nextInt();\n long ans = 0;\n for (int i = 1; i <=k; i++) {\n for (int j = 1; j <= i; j++) {\n for (int l = j; l <= i ; l++) {\n long g = gcdMultiple(i,j,l);\n if (findUnique(i,j,l) == 1) {\n ans += g;\n }\n if (findUnique(i,j,l) == 2) {\n ans += g*3;\n }\n if (findUnique(i,j,l) == 3) {\n ans += g*6;\n }\n }\n }\n }\n out.println(ans);\n }\n private static int findUnique(int a, int b, int c) {\n Set<Integer> set = new HashSet<>();\n set.add(a);\n set.add(b);\n set.add(c);\n return set.size();\n }\n private static int gcd(int a, int b) {\n if (b == 0){\n return a;\n }\n return gcd(b, a % b);\n }\n\n static int gcdMultiple(int a, int b, int c) {\n return gcd(gcd(a,b), c);\n }\n }\n\n static class InputReader {\n public BufferedReader reader;\n public StringTokenizer tokenizer;\n\n public InputReader(InputStream stream) {\n reader = new BufferedReader(new InputStreamReader(stream), 32768);\n tokenizer = null;\n }\n\n public String next() {\n while (tokenizer == null || !tokenizer.hasMoreTokens()) {\n try {\n tokenizer = new StringTokenizer(reader.readLine());\n } catch (IOException e) {\n throw new RuntimeException(e);\n }\n }\n return tokenizer.nextToken();\n }\n\n public long nextLong() {\n return Long.parseLong(next());\n }\n\n public double nextDouble() {\n return Double.parseDouble(next());\n }\n\n public int nextInt() {\n return Integer.parseInt(next());\n }\n\n public char nextChar() {\n return next().charAt(0);\n }\n\n public String nextLine() throws IOException {\n return reader.readLine().trim();\n }\n }\n}",
"Main"
] |
import java.io.*;
import java.util.HashSet;
import java.util.Set;
import java.util.StringTokenizer;
public class Main {
public static void main(String[] args) throws IOException {
InputStream inputStream = System.in;
OutputStream outputStream = System.out;
InputReader in = new InputReader(inputStream);
PrintWriter out = new PrintWriter(outputStream);
Task solver = new Task();
// int t = in.nextInt();
solver.solve(1, in, out);
out.close();
}
static class Task {
public void solve(int testNumber, InputReader in, PrintWriter out) throws IOException {
int k = in.nextInt();
long ans = 0;
for (int i = 1; i <=k; i++) {
for (int j = 1; j <= i; j++) {
for (int l = j; l <= i ; l++) {
long g = gcdMultiple(i,j,l);
if (findUnique(i,j,l) == 1) {
ans += g;
}
if (findUnique(i,j,l) == 2) {
ans += g*3;
}
if (findUnique(i,j,l) == 3) {
ans += g*6;
}
}
}
}
out.println(ans);
}
private static int findUnique(int a, int b, int c) {
Set<Integer> set = new HashSet<>();
set.add(a);
set.add(b);
set.add(c);
return set.size();
}
private static int gcd(int a, int b) {
if (b == 0){
return a;
}
return gcd(b, a % b);
}
static int gcdMultiple(int a, int b, int c) {
return gcd(gcd(a,b), c);
}
}
static class InputReader {
public BufferedReader reader;
public StringTokenizer tokenizer;
public InputReader(InputStream stream) {
reader = new BufferedReader(new InputStreamReader(stream), 32768);
tokenizer = null;
}
public String next() {
while (tokenizer == null || !tokenizer.hasMoreTokens()) {
try {
tokenizer = new StringTokenizer(reader.readLine());
} catch (IOException e) {
throw new RuntimeException(e);
}
}
return tokenizer.nextToken();
}
public long nextLong() {
return Long.parseLong(next());
}
public double nextDouble() {
return Double.parseDouble(next());
}
public int nextInt() {
return Integer.parseInt(next());
}
public char nextChar() {
return next().charAt(0);
}
public String nextLine() throws IOException {
return reader.readLine().trim();
}
}
}
|
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
14,
2,
13,
17,
30,
29,
13,
30,
29,
4,
13,
2,
13,
13,
13,
23,
13,
23,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
11,
1,
41,
13,
2,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
41,
13,
4,
13,
13,
13,
11,
1,
41,
13,
2,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
2,
4,
13,
13,
13,
17,
0,
13,
2,
13,
17,
0,
13,
13,
4,
18,
18,
13,
13,
13,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
116,
5
],
[
116,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
10,
11
],
[
10,
12
],
[
9,
13
],
[
13,
14
],
[
14,
15
],
[
9,
16
],
[
16,
17
],
[
17,
18
],
[
18,
19
],
[
18,
20
],
[
20,
21
],
[
20,
22
],
[
18,
23
],
[
6,
24
],
[
24,
25
],
[
6,
26
],
[
26,
27
],
[
116,
28
],
[
28,
29
],
[
28,
30
],
[
30,
31
],
[
31,
32
],
[
31,
33
],
[
30,
34
],
[
34,
35
],
[
34,
36
],
[
36,
37
],
[
37,
38
],
[
30,
39
],
[
39,
40
],
[
39,
41
],
[
30,
42
],
[
42,
43
],
[
43,
44
],
[
44,
45
],
[
44,
46
],
[
42,
47
],
[
47,
48
],
[
47,
49
],
[
42,
50
],
[
50,
51
],
[
51,
52
],
[
42,
53
],
[
54,
54
],
[
54,
55
],
[
55,
56
],
[
56,
57
],
[
57,
58
],
[
57,
59
],
[
59,
60
],
[
59,
61
],
[
55,
62
],
[
62,
63
],
[
62,
64
],
[
55,
65
],
[
65,
66
],
[
66,
67
],
[
55,
68
],
[
69,
69
],
[
69,
70
],
[
70,
71
],
[
70,
72
],
[
72,
73
],
[
72,
74
],
[
72,
75
],
[
69,
76
],
[
76,
77
],
[
77,
78
],
[
78,
79
],
[
78,
80
],
[
80,
81
],
[
80,
82
],
[
76,
83
],
[
83,
84
],
[
83,
85
],
[
76,
86
],
[
86,
87
],
[
87,
88
],
[
76,
89
],
[
90,
90
],
[
90,
91
],
[
91,
92
],
[
91,
93
],
[
93,
94
],
[
94,
95
],
[
94,
96
],
[
94,
97
],
[
93,
98
],
[
69,
99
],
[
99,
100
],
[
99,
101
],
[
101,
102
],
[
101,
103
],
[
54,
104
],
[
104,
105
],
[
104,
106
],
[
30,
107
],
[
107,
108
],
[
108,
109
],
[
109,
110
],
[
109,
111
],
[
107,
112
],
[
28,
113
],
[
113,
114
],
[
0,
115
],
[
115,
116
],
[
115,
117
]
] |
[
"import java.util.*;\npublic class Main {\n \n public static int gcd2(int i, int j){\n if(i == 0){\n return j;\n }\n else\n {\n return gcd2(j%i, i);\n }\n }\n \n public static void main(String[] args){\n Scanner sc = new Scanner(System.in);\n\tint n = sc.nextInt();\n int sum = 0;\n for(int i = 1; i <= n; i++){\n \tfor(int j = i+1; j <= n; j++){\n \tint gcd2tmp = gcd2(i, j);\n \tfor(int k = j+1; k <= n; k++){\n \t//3 items\n \t\t\tsum += gcd2(gcd2tmp, k) * 6;\n \t}\n \t//2 items\n \tsum += gcd2tmp * 6;\n \t//System.out.println(gcd2tmp);\n \t}\n //1 item\n sum += i;\n }\n \n System.out.println(sum);\n }\n}",
"import java.util.*;",
"util.*",
"java",
"public class Main {\n \n public static int gcd2(int i, int j){\n if(i == 0){\n return j;\n }\n else\n {\n return gcd2(j%i, i);\n }\n }\n \n public static void main(String[] args){\n Scanner sc = new Scanner(System.in);\n\tint n = sc.nextInt();\n int sum = 0;\n for(int i = 1; i <= n; i++){\n \tfor(int j = i+1; j <= n; j++){\n \tint gcd2tmp = gcd2(i, j);\n \tfor(int k = j+1; k <= n; k++){\n \t//3 items\n \t\t\tsum += gcd2(gcd2tmp, k) * 6;\n \t}\n \t//2 items\n \tsum += gcd2tmp * 6;\n \t//System.out.println(gcd2tmp);\n \t}\n //1 item\n sum += i;\n }\n \n System.out.println(sum);\n }\n}",
"Main",
"public static int gcd2(int i, int j){\n if(i == 0){\n return j;\n }\n else\n {\n return gcd2(j%i, i);\n }\n }",
"gcd2",
"{\n if(i == 0){\n return j;\n }\n else\n {\n return gcd2(j%i, i);\n }\n }",
"if(i == 0){\n return j;\n }\n else\n {\n return gcd2(j%i, i);\n }",
"i == 0",
"i",
"0",
"{\n return j;\n }",
"return j;",
"j",
"{\n return gcd2(j%i, i);\n }",
"return gcd2(j%i, i);",
"gcd2(j%i, i)",
"gcd2",
"j%i",
"j",
"i",
"i",
"int i",
"i",
"int j",
"j",
"public static void main(String[] args){\n Scanner sc = new Scanner(System.in);\n\tint n = sc.nextInt();\n int sum = 0;\n for(int i = 1; i <= n; i++){\n \tfor(int j = i+1; j <= n; j++){\n \tint gcd2tmp = gcd2(i, j);\n \tfor(int k = j+1; k <= n; k++){\n \t//3 items\n \t\t\tsum += gcd2(gcd2tmp, k) * 6;\n \t}\n \t//2 items\n \tsum += gcd2tmp * 6;\n \t//System.out.println(gcd2tmp);\n \t}\n //1 item\n sum += i;\n }\n \n System.out.println(sum);\n }",
"main",
"{\n Scanner sc = new Scanner(System.in);\n\tint n = sc.nextInt();\n int sum = 0;\n for(int i = 1; i <= n; i++){\n \tfor(int j = i+1; j <= n; j++){\n \tint gcd2tmp = gcd2(i, j);\n \tfor(int k = j+1; k <= n; k++){\n \t//3 items\n \t\t\tsum += gcd2(gcd2tmp, k) * 6;\n \t}\n \t//2 items\n \tsum += gcd2tmp * 6;\n \t//System.out.println(gcd2tmp);\n \t}\n //1 item\n sum += i;\n }\n \n System.out.println(sum);\n }",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"int n = sc.nextInt();",
"n",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int sum = 0;",
"sum",
"0",
"for(int i = 1; i <= n; i++){\n \tfor(int j = i+1; j <= n; j++){\n \tint gcd2tmp = gcd2(i, j);\n \tfor(int k = j+1; k <= n; k++){\n \t//3 items\n \t\t\tsum += gcd2(gcd2tmp, k) * 6;\n \t}\n \t//2 items\n \tsum += gcd2tmp * 6;\n \t//System.out.println(gcd2tmp);\n \t}\n //1 item\n sum += i;\n }",
"int i = 1;",
"int i = 1;",
"i",
"1",
"i <= n",
"i",
"n",
"i++",
"i++",
"i",
"{\n \tfor(int j = i+1; j <= n; j++){\n \tint gcd2tmp = gcd2(i, j);\n \tfor(int k = j+1; k <= n; k++){\n \t//3 items\n \t\t\tsum += gcd2(gcd2tmp, k) * 6;\n \t}\n \t//2 items\n \tsum += gcd2tmp * 6;\n \t//System.out.println(gcd2tmp);\n \t}\n //1 item\n sum += i;\n }",
"{\n \tfor(int j = i+1; j <= n; j++){\n \tint gcd2tmp = gcd2(i, j);\n \tfor(int k = j+1; k <= n; k++){\n \t//3 items\n \t\t\tsum += gcd2(gcd2tmp, k) * 6;\n \t}\n \t//2 items\n \tsum += gcd2tmp * 6;\n \t//System.out.println(gcd2tmp);\n \t}\n //1 item\n sum += i;\n }",
"for(int j = i+1; j <= n; j++){\n \tint gcd2tmp = gcd2(i, j);\n \tfor(int k = j+1; k <= n; k++){\n \t//3 items\n \t\t\tsum += gcd2(gcd2tmp, k) * 6;\n \t}\n \t//2 items\n \tsum += gcd2tmp * 6;\n \t//System.out.println(gcd2tmp);\n \t}",
"int j = i+1;",
"int j = i+1;",
"j",
"i+1",
"i",
"1",
"j <= n",
"j",
"n",
"j++",
"j++",
"j",
"{\n \tint gcd2tmp = gcd2(i, j);\n \tfor(int k = j+1; k <= n; k++){\n \t//3 items\n \t\t\tsum += gcd2(gcd2tmp, k) * 6;\n \t}\n \t//2 items\n \tsum += gcd2tmp * 6;\n \t//System.out.println(gcd2tmp);\n \t}",
"{\n \tint gcd2tmp = gcd2(i, j);\n \tfor(int k = j+1; k <= n; k++){\n \t//3 items\n \t\t\tsum += gcd2(gcd2tmp, k) * 6;\n \t}\n \t//2 items\n \tsum += gcd2tmp * 6;\n \t//System.out.println(gcd2tmp);\n \t}",
"int gcd2tmp = gcd2(i, j);",
"gcd2tmp",
"gcd2(i, j)",
"gcd2",
"i",
"j",
"for(int k = j+1; k <= n; k++){\n \t//3 items\n \t\t\tsum += gcd2(gcd2tmp, k) * 6;\n \t}",
"int k = j+1;",
"int k = j+1;",
"k",
"j+1",
"j",
"1",
"k <= n",
"k",
"n",
"k++",
"k++",
"k",
"{\n \t//3 items\n \t\t\tsum += gcd2(gcd2tmp, k) * 6;\n \t}",
"{\n \t//3 items\n \t\t\tsum += gcd2(gcd2tmp, k) * 6;\n \t}",
"sum += gcd2(gcd2tmp, k) * 6",
"sum",
"gcd2(gcd2tmp, k) * 6",
"gcd2(gcd2tmp, k)",
"gcd2",
"gcd2tmp",
"k",
"6",
"sum += gcd2tmp * 6",
"sum",
"gcd2tmp * 6",
"gcd2tmp",
"6",
"sum += i",
"sum",
"i",
"System.out.println(sum)",
"System.out.println",
"System.out",
"System",
"System.out",
"sum",
"String[] args",
"args",
"public class Main {\n \n public static int gcd2(int i, int j){\n if(i == 0){\n return j;\n }\n else\n {\n return gcd2(j%i, i);\n }\n }\n \n public static void main(String[] args){\n Scanner sc = new Scanner(System.in);\n\tint n = sc.nextInt();\n int sum = 0;\n for(int i = 1; i <= n; i++){\n \tfor(int j = i+1; j <= n; j++){\n \tint gcd2tmp = gcd2(i, j);\n \tfor(int k = j+1; k <= n; k++){\n \t//3 items\n \t\t\tsum += gcd2(gcd2tmp, k) * 6;\n \t}\n \t//2 items\n \tsum += gcd2tmp * 6;\n \t//System.out.println(gcd2tmp);\n \t}\n //1 item\n sum += i;\n }\n \n System.out.println(sum);\n }\n}",
"public class Main {\n \n public static int gcd2(int i, int j){\n if(i == 0){\n return j;\n }\n else\n {\n return gcd2(j%i, i);\n }\n }\n \n public static void main(String[] args){\n Scanner sc = new Scanner(System.in);\n\tint n = sc.nextInt();\n int sum = 0;\n for(int i = 1; i <= n; i++){\n \tfor(int j = i+1; j <= n; j++){\n \tint gcd2tmp = gcd2(i, j);\n \tfor(int k = j+1; k <= n; k++){\n \t//3 items\n \t\t\tsum += gcd2(gcd2tmp, k) * 6;\n \t}\n \t//2 items\n \tsum += gcd2tmp * 6;\n \t//System.out.println(gcd2tmp);\n \t}\n //1 item\n sum += i;\n }\n \n System.out.println(sum);\n }\n}",
"Main"
] |
import java.util.*;
public class Main {
public static int gcd2(int i, int j){
if(i == 0){
return j;
}
else
{
return gcd2(j%i, i);
}
}
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
int sum = 0;
for(int i = 1; i <= n; i++){
for(int j = i+1; j <= n; j++){
int gcd2tmp = gcd2(i, j);
for(int k = j+1; k <= n; k++){
//3 items
sum += gcd2(gcd2tmp, k) * 6;
}
//2 items
sum += gcd2tmp * 6;
//System.out.println(gcd2tmp);
}
//1 item
sum += i;
}
System.out.println(sum);
}
}
|
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
2,
13,
17,
1,
40,
13,
30,
30,
11,
1,
41,
13,
17,
2,
13,
2,
13,
17,
1,
40,
13,
30,
30,
11,
1,
41,
13,
17,
2,
13,
2,
13,
17,
1,
40,
13,
30,
30,
41,
13,
4,
13,
13,
13,
0,
13,
4,
13,
13,
13,
0,
13,
13,
4,
18,
18,
13,
13,
13,
23,
13,
12,
13,
30,
14,
2,
13,
17,
29,
13,
29,
4,
13,
13,
2,
13,
13,
23,
13,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
109,
5
],
[
109,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
8,
17
],
[
17,
18
],
[
17,
19
],
[
8,
20
],
[
20,
21
],
[
21,
22
],
[
22,
23
],
[
22,
24
],
[
20,
25
],
[
25,
26
],
[
25,
27
],
[
27,
28
],
[
27,
29
],
[
20,
30
],
[
30,
31
],
[
31,
32
],
[
20,
33
],
[
34,
34
],
[
34,
35
],
[
35,
36
],
[
36,
37
],
[
37,
38
],
[
37,
39
],
[
35,
40
],
[
40,
41
],
[
40,
42
],
[
42,
43
],
[
42,
44
],
[
35,
45
],
[
45,
46
],
[
46,
47
],
[
35,
48
],
[
49,
49
],
[
49,
50
],
[
50,
51
],
[
51,
52
],
[
52,
53
],
[
52,
54
],
[
50,
55
],
[
55,
56
],
[
55,
57
],
[
57,
58
],
[
57,
59
],
[
50,
60
],
[
60,
61
],
[
61,
62
],
[
50,
63
],
[
64,
64
],
[
64,
65
],
[
65,
66
],
[
65,
67
],
[
67,
68
],
[
67,
69
],
[
67,
70
],
[
64,
71
],
[
71,
72
],
[
71,
73
],
[
73,
74
],
[
73,
75
],
[
73,
76
],
[
64,
77
],
[
77,
78
],
[
77,
79
],
[
8,
80
],
[
80,
81
],
[
81,
82
],
[
82,
83
],
[
82,
84
],
[
80,
85
],
[
6,
86
],
[
86,
87
],
[
109,
88
],
[
88,
89
],
[
88,
90
],
[
90,
91
],
[
91,
92
],
[
92,
93
],
[
92,
94
],
[
91,
95
],
[
95,
96
],
[
91,
97
],
[
97,
98
],
[
98,
99
],
[
98,
100
],
[
98,
101
],
[
101,
102
],
[
101,
103
],
[
88,
104
],
[
104,
105
],
[
88,
106
],
[
106,
107
],
[
0,
108
],
[
108,
109
],
[
108,
110
]
] |
[
"import java.util.Scanner;\n\npublic class Main {\n\tpublic static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\tlong N = sc.nextLong();\n\t\tlong ans = 0;\n\t\tfor(int i=1;i<N+1;i++) {\n\t\t\tfor(int j=1;j<N+1;j++) {\n\t\t\t\tfor(int k=1;k<N+1;k++) {\n\t\t\t\t\tint gcd = gcd(i,j);\n\t\t\t\t\tgcd = gcd(gcd,k);\n\t\t\t\t\tans += gcd;\n//\t\t\t\t\tSystem.out.println(i);\n//\t\t\t\t\tSystem.out.println(j);\n//\t\t\t\t\tSystem.out.println(k);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(ans);\n\t}\n\tpublic static int gcd(int num1,int num2) {\n if(num2==0) return num1;\n else return gcd(num2,num1%num2);\n }\n\n}\n",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n\tpublic static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\tlong N = sc.nextLong();\n\t\tlong ans = 0;\n\t\tfor(int i=1;i<N+1;i++) {\n\t\t\tfor(int j=1;j<N+1;j++) {\n\t\t\t\tfor(int k=1;k<N+1;k++) {\n\t\t\t\t\tint gcd = gcd(i,j);\n\t\t\t\t\tgcd = gcd(gcd,k);\n\t\t\t\t\tans += gcd;\n//\t\t\t\t\tSystem.out.println(i);\n//\t\t\t\t\tSystem.out.println(j);\n//\t\t\t\t\tSystem.out.println(k);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(ans);\n\t}\n\tpublic static int gcd(int num1,int num2) {\n if(num2==0) return num1;\n else return gcd(num2,num1%num2);\n }\n\n}",
"Main",
"public static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\tlong N = sc.nextLong();\n\t\tlong ans = 0;\n\t\tfor(int i=1;i<N+1;i++) {\n\t\t\tfor(int j=1;j<N+1;j++) {\n\t\t\t\tfor(int k=1;k<N+1;k++) {\n\t\t\t\t\tint gcd = gcd(i,j);\n\t\t\t\t\tgcd = gcd(gcd,k);\n\t\t\t\t\tans += gcd;\n//\t\t\t\t\tSystem.out.println(i);\n//\t\t\t\t\tSystem.out.println(j);\n//\t\t\t\t\tSystem.out.println(k);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(ans);\n\t}",
"main",
"{\n\t\tScanner sc = new Scanner(System.in);\n\t\tlong N = sc.nextLong();\n\t\tlong ans = 0;\n\t\tfor(int i=1;i<N+1;i++) {\n\t\t\tfor(int j=1;j<N+1;j++) {\n\t\t\t\tfor(int k=1;k<N+1;k++) {\n\t\t\t\t\tint gcd = gcd(i,j);\n\t\t\t\t\tgcd = gcd(gcd,k);\n\t\t\t\t\tans += gcd;\n//\t\t\t\t\tSystem.out.println(i);\n//\t\t\t\t\tSystem.out.println(j);\n//\t\t\t\t\tSystem.out.println(k);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(ans);\n\t}",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"long N = sc.nextLong();",
"N",
"sc.nextLong()",
"sc.nextLong",
"sc",
"long ans = 0;",
"ans",
"0",
"for(int i=1;i<N+1;i++) {\n\t\t\tfor(int j=1;j<N+1;j++) {\n\t\t\t\tfor(int k=1;k<N+1;k++) {\n\t\t\t\t\tint gcd = gcd(i,j);\n\t\t\t\t\tgcd = gcd(gcd,k);\n\t\t\t\t\tans += gcd;\n//\t\t\t\t\tSystem.out.println(i);\n//\t\t\t\t\tSystem.out.println(j);\n//\t\t\t\t\tSystem.out.println(k);\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"int i=1;",
"int i=1;",
"i",
"1",
"i<N+1",
"i",
"N+1",
"N",
"1",
"i++",
"i++",
"i",
"{\n\t\t\tfor(int j=1;j<N+1;j++) {\n\t\t\t\tfor(int k=1;k<N+1;k++) {\n\t\t\t\t\tint gcd = gcd(i,j);\n\t\t\t\t\tgcd = gcd(gcd,k);\n\t\t\t\t\tans += gcd;\n//\t\t\t\t\tSystem.out.println(i);\n//\t\t\t\t\tSystem.out.println(j);\n//\t\t\t\t\tSystem.out.println(k);\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"{\n\t\t\tfor(int j=1;j<N+1;j++) {\n\t\t\t\tfor(int k=1;k<N+1;k++) {\n\t\t\t\t\tint gcd = gcd(i,j);\n\t\t\t\t\tgcd = gcd(gcd,k);\n\t\t\t\t\tans += gcd;\n//\t\t\t\t\tSystem.out.println(i);\n//\t\t\t\t\tSystem.out.println(j);\n//\t\t\t\t\tSystem.out.println(k);\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"for(int j=1;j<N+1;j++) {\n\t\t\t\tfor(int k=1;k<N+1;k++) {\n\t\t\t\t\tint gcd = gcd(i,j);\n\t\t\t\t\tgcd = gcd(gcd,k);\n\t\t\t\t\tans += gcd;\n//\t\t\t\t\tSystem.out.println(i);\n//\t\t\t\t\tSystem.out.println(j);\n//\t\t\t\t\tSystem.out.println(k);\n\t\t\t\t}\n\t\t\t}",
"int j=1;",
"int j=1;",
"j",
"1",
"j<N+1",
"j",
"N+1",
"N",
"1",
"j++",
"j++",
"j",
"{\n\t\t\t\tfor(int k=1;k<N+1;k++) {\n\t\t\t\t\tint gcd = gcd(i,j);\n\t\t\t\t\tgcd = gcd(gcd,k);\n\t\t\t\t\tans += gcd;\n//\t\t\t\t\tSystem.out.println(i);\n//\t\t\t\t\tSystem.out.println(j);\n//\t\t\t\t\tSystem.out.println(k);\n\t\t\t\t}\n\t\t\t}",
"{\n\t\t\t\tfor(int k=1;k<N+1;k++) {\n\t\t\t\t\tint gcd = gcd(i,j);\n\t\t\t\t\tgcd = gcd(gcd,k);\n\t\t\t\t\tans += gcd;\n//\t\t\t\t\tSystem.out.println(i);\n//\t\t\t\t\tSystem.out.println(j);\n//\t\t\t\t\tSystem.out.println(k);\n\t\t\t\t}\n\t\t\t}",
"for(int k=1;k<N+1;k++) {\n\t\t\t\t\tint gcd = gcd(i,j);\n\t\t\t\t\tgcd = gcd(gcd,k);\n\t\t\t\t\tans += gcd;\n//\t\t\t\t\tSystem.out.println(i);\n//\t\t\t\t\tSystem.out.println(j);\n//\t\t\t\t\tSystem.out.println(k);\n\t\t\t\t}",
"int k=1;",
"int k=1;",
"k",
"1",
"k<N+1",
"k",
"N+1",
"N",
"1",
"k++",
"k++",
"k",
"{\n\t\t\t\t\tint gcd = gcd(i,j);\n\t\t\t\t\tgcd = gcd(gcd,k);\n\t\t\t\t\tans += gcd;\n//\t\t\t\t\tSystem.out.println(i);\n//\t\t\t\t\tSystem.out.println(j);\n//\t\t\t\t\tSystem.out.println(k);\n\t\t\t\t}",
"{\n\t\t\t\t\tint gcd = gcd(i,j);\n\t\t\t\t\tgcd = gcd(gcd,k);\n\t\t\t\t\tans += gcd;\n//\t\t\t\t\tSystem.out.println(i);\n//\t\t\t\t\tSystem.out.println(j);\n//\t\t\t\t\tSystem.out.println(k);\n\t\t\t\t}",
"int gcd = gcd(i,j);",
"gcd",
"gcd(i,j)",
"gcd",
"i",
"j",
"gcd = gcd(gcd,k)",
"gcd",
"gcd(gcd,k)",
"gcd",
"gcd",
"k",
"ans += gcd",
"ans",
"gcd",
"System.out.println(ans)",
"System.out.println",
"System.out",
"System",
"System.out",
"ans",
"String[] args",
"args",
"public static int gcd(int num1,int num2) {\n if(num2==0) return num1;\n else return gcd(num2,num1%num2);\n }",
"gcd",
"{\n if(num2==0) return num1;\n else return gcd(num2,num1%num2);\n }",
"if(num2==0) return num1;\n else return gcd(num2,num1%num2);",
"num2==0",
"num2",
"0",
"return num1;",
"num1",
"return gcd(num2,num1%num2);",
"gcd(num2,num1%num2)",
"gcd",
"num2",
"num1%num2",
"num1",
"num2",
"int num1",
"num1",
"int num2",
"num2",
"public class Main {\n\tpublic static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\tlong N = sc.nextLong();\n\t\tlong ans = 0;\n\t\tfor(int i=1;i<N+1;i++) {\n\t\t\tfor(int j=1;j<N+1;j++) {\n\t\t\t\tfor(int k=1;k<N+1;k++) {\n\t\t\t\t\tint gcd = gcd(i,j);\n\t\t\t\t\tgcd = gcd(gcd,k);\n\t\t\t\t\tans += gcd;\n//\t\t\t\t\tSystem.out.println(i);\n//\t\t\t\t\tSystem.out.println(j);\n//\t\t\t\t\tSystem.out.println(k);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(ans);\n\t}\n\tpublic static int gcd(int num1,int num2) {\n if(num2==0) return num1;\n else return gcd(num2,num1%num2);\n }\n\n}",
"public class Main {\n\tpublic static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\tlong N = sc.nextLong();\n\t\tlong ans = 0;\n\t\tfor(int i=1;i<N+1;i++) {\n\t\t\tfor(int j=1;j<N+1;j++) {\n\t\t\t\tfor(int k=1;k<N+1;k++) {\n\t\t\t\t\tint gcd = gcd(i,j);\n\t\t\t\t\tgcd = gcd(gcd,k);\n\t\t\t\t\tans += gcd;\n//\t\t\t\t\tSystem.out.println(i);\n//\t\t\t\t\tSystem.out.println(j);\n//\t\t\t\t\tSystem.out.println(k);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(ans);\n\t}\n\tpublic static int gcd(int num1,int num2) {\n if(num2==0) return num1;\n else return gcd(num2,num1%num2);\n }\n\n}",
"Main"
] |
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
long N = sc.nextLong();
long ans = 0;
for(int i=1;i<N+1;i++) {
for(int j=1;j<N+1;j++) {
for(int k=1;k<N+1;k++) {
int gcd = gcd(i,j);
gcd = gcd(gcd,k);
ans += gcd;
// System.out.println(i);
// System.out.println(j);
// System.out.println(k);
}
}
}
System.out.println(ans);
}
public static int gcd(int num1,int num2) {
if(num2==0) return num1;
else return gcd(num2,num1%num2);
}
}
|
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
4,
13,
4,
13,
13,
13,
13,
4,
18,
18,
13,
13,
13,
23,
13,
12,
13,
30,
14,
2,
13,
17,
30,
29,
13,
0,
13,
2,
13,
13,
29,
4,
13,
13,
13,
23,
13,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
101,
5
],
[
101,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
8,
17
],
[
17,
18
],
[
17,
19
],
[
8,
20
],
[
20,
21
],
[
21,
22
],
[
22,
23
],
[
22,
24
],
[
20,
25
],
[
25,
26
],
[
25,
27
],
[
20,
28
],
[
28,
29
],
[
29,
30
],
[
20,
31
],
[
32,
32
],
[
32,
33
],
[
33,
34
],
[
34,
35
],
[
35,
36
],
[
35,
37
],
[
33,
38
],
[
38,
39
],
[
38,
40
],
[
33,
41
],
[
41,
42
],
[
42,
43
],
[
33,
44
],
[
45,
45
],
[
45,
46
],
[
46,
47
],
[
47,
48
],
[
48,
49
],
[
48,
50
],
[
46,
51
],
[
51,
52
],
[
51,
53
],
[
46,
54
],
[
54,
55
],
[
55,
56
],
[
46,
57
],
[
58,
58
],
[
58,
59
],
[
59,
60
],
[
59,
61
],
[
61,
62
],
[
61,
63
],
[
63,
64
],
[
63,
65
],
[
63,
66
],
[
61,
67
],
[
8,
68
],
[
68,
69
],
[
69,
70
],
[
70,
71
],
[
70,
72
],
[
68,
73
],
[
6,
74
],
[
74,
75
],
[
101,
76
],
[
76,
77
],
[
76,
78
],
[
78,
79
],
[
79,
80
],
[
80,
81
],
[
80,
82
],
[
79,
83
],
[
83,
84
],
[
84,
85
],
[
78,
86
],
[
86,
87
],
[
86,
88
],
[
88,
89
],
[
88,
90
],
[
78,
91
],
[
91,
92
],
[
92,
93
],
[
92,
94
],
[
92,
95
],
[
76,
96
],
[
96,
97
],
[
76,
98
],
[
98,
99
],
[
0,
100
],
[
100,
101
],
[
100,
102
]
] |
[
"import java.util.Scanner;\n\npublic class Main {\n\n\tpublic static void main(String[] args) {\n\n\t\tScanner sc = new Scanner(System.in);\n\n\t\tint first = sc.nextInt();\n\t\tint sum = 0;\n\t\t//ユークリッドの互除法\n\t\tfor(int a =1; a<=first ; a++) { //(a,b,c)のAが増える\n\t\t\tfor(int b = 1; b<=first; b++) { //(a,b,c)のBが増える\n\t\t\t\tfor(int c = 1; c<=first; c++) { //(a,b,c)のCが増える\n\t\t\t\t\tsum += gcd(gcd(a,b),c);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(sum);\n\t}\n\n\tprivate static int gcd(int a, int b) {\n\t\tif(b==0) {\n\t\t\treturn a;\n\t\t}\n\t\ta = a%b;\n\t\t//割られた数に余りを入れる。a=390 ,b=273の場合\n\t\t//a=117(あまりの数),b=273 割られた側が上書きされるイメージ\n\t\treturn gcd(b,a); //ここで反転して余りがなくなるまで繰り返す。\n\n\t}\n\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n\n\tpublic static void main(String[] args) {\n\n\t\tScanner sc = new Scanner(System.in);\n\n\t\tint first = sc.nextInt();\n\t\tint sum = 0;\n\t\t//ユークリッドの互除法\n\t\tfor(int a =1; a<=first ; a++) { //(a,b,c)のAが増える\n\t\t\tfor(int b = 1; b<=first; b++) { //(a,b,c)のBが増える\n\t\t\t\tfor(int c = 1; c<=first; c++) { //(a,b,c)のCが増える\n\t\t\t\t\tsum += gcd(gcd(a,b),c);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(sum);\n\t}\n\n\tprivate static int gcd(int a, int b) {\n\t\tif(b==0) {\n\t\t\treturn a;\n\t\t}\n\t\ta = a%b;\n\t\t//割られた数に余りを入れる。a=390 ,b=273の場合\n\t\t//a=117(あまりの数),b=273 割られた側が上書きされるイメージ\n\t\treturn gcd(b,a); //ここで反転して余りがなくなるまで繰り返す。\n\n\t}\n\n}",
"Main",
"public static void main(String[] args) {\n\n\t\tScanner sc = new Scanner(System.in);\n\n\t\tint first = sc.nextInt();\n\t\tint sum = 0;\n\t\t//ユークリッドの互除法\n\t\tfor(int a =1; a<=first ; a++) { //(a,b,c)のAが増える\n\t\t\tfor(int b = 1; b<=first; b++) { //(a,b,c)のBが増える\n\t\t\t\tfor(int c = 1; c<=first; c++) { //(a,b,c)のCが増える\n\t\t\t\t\tsum += gcd(gcd(a,b),c);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(sum);\n\t}",
"main",
"{\n\n\t\tScanner sc = new Scanner(System.in);\n\n\t\tint first = sc.nextInt();\n\t\tint sum = 0;\n\t\t//ユークリッドの互除法\n\t\tfor(int a =1; a<=first ; a++) { //(a,b,c)のAが増える\n\t\t\tfor(int b = 1; b<=first; b++) { //(a,b,c)のBが増える\n\t\t\t\tfor(int c = 1; c<=first; c++) { //(a,b,c)のCが増える\n\t\t\t\t\tsum += gcd(gcd(a,b),c);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(sum);\n\t}",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"int first = sc.nextInt();",
"first",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int sum = 0;",
"sum",
"0",
"for(int a =1; a<=first ; a++) { //(a,b,c)のAが増える\n\t\t\tfor(int b = 1; b<=first; b++) { //(a,b,c)のBが増える\n\t\t\t\tfor(int c = 1; c<=first; c++) { //(a,b,c)のCが増える\n\t\t\t\t\tsum += gcd(gcd(a,b),c);\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"int a =1;",
"int a =1;",
"a",
"1",
"a<=first",
"a",
"first",
"a++",
"a++",
"a",
"{ //(a,b,c)のAが増える\n\t\t\tfor(int b = 1; b<=first; b++) { //(a,b,c)のBが増える\n\t\t\t\tfor(int c = 1; c<=first; c++) { //(a,b,c)のCが増える\n\t\t\t\t\tsum += gcd(gcd(a,b),c);\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"{ //(a,b,c)のAが増える\n\t\t\tfor(int b = 1; b<=first; b++) { //(a,b,c)のBが増える\n\t\t\t\tfor(int c = 1; c<=first; c++) { //(a,b,c)のCが増える\n\t\t\t\t\tsum += gcd(gcd(a,b),c);\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"for(int b = 1; b<=first; b++) { //(a,b,c)のBが増える\n\t\t\t\tfor(int c = 1; c<=first; c++) { //(a,b,c)のCが増える\n\t\t\t\t\tsum += gcd(gcd(a,b),c);\n\t\t\t\t}\n\t\t\t}",
"int b = 1;",
"int b = 1;",
"b",
"1",
"b<=first",
"b",
"first",
"b++",
"b++",
"b",
"{ //(a,b,c)のBが増える\n\t\t\t\tfor(int c = 1; c<=first; c++) { //(a,b,c)のCが増える\n\t\t\t\t\tsum += gcd(gcd(a,b),c);\n\t\t\t\t}\n\t\t\t}",
"{ //(a,b,c)のBが増える\n\t\t\t\tfor(int c = 1; c<=first; c++) { //(a,b,c)のCが増える\n\t\t\t\t\tsum += gcd(gcd(a,b),c);\n\t\t\t\t}\n\t\t\t}",
"for(int c = 1; c<=first; c++) { //(a,b,c)のCが増える\n\t\t\t\t\tsum += gcd(gcd(a,b),c);\n\t\t\t\t}",
"int c = 1;",
"int c = 1;",
"c",
"1",
"c<=first",
"c",
"first",
"c++",
"c++",
"c",
"{ //(a,b,c)のCが増える\n\t\t\t\t\tsum += gcd(gcd(a,b),c);\n\t\t\t\t}",
"{ //(a,b,c)のCが増える\n\t\t\t\t\tsum += gcd(gcd(a,b),c);\n\t\t\t\t}",
"sum += gcd(gcd(a,b),c)",
"sum",
"gcd(gcd(a,b),c)",
"gcd",
"gcd(a,b)",
"gcd",
"a",
"b",
"c",
"System.out.println(sum)",
"System.out.println",
"System.out",
"System",
"System.out",
"sum",
"String[] args",
"args",
"private static int gcd(int a, int b) {\n\t\tif(b==0) {\n\t\t\treturn a;\n\t\t}\n\t\ta = a%b;\n\t\t//割られた数に余りを入れる。a=390 ,b=273の場合\n\t\t//a=117(あまりの数),b=273 割られた側が上書きされるイメージ\n\t\treturn gcd(b,a); //ここで反転して余りがなくなるまで繰り返す。\n\n\t}",
"gcd",
"{\n\t\tif(b==0) {\n\t\t\treturn a;\n\t\t}\n\t\ta = a%b;\n\t\t//割られた数に余りを入れる。a=390 ,b=273の場合\n\t\t//a=117(あまりの数),b=273 割られた側が上書きされるイメージ\n\t\treturn gcd(b,a); //ここで反転して余りがなくなるまで繰り返す。\n\n\t}",
"if(b==0) {\n\t\t\treturn a;\n\t\t}",
"b==0",
"b",
"0",
"{\n\t\t\treturn a;\n\t\t}",
"return a;",
"a",
"a = a%b",
"a",
"a%b",
"a",
"b",
"return gcd(b,a); //ここで反転して余りがなくなるまで繰り返す。",
"gcd(b,a)",
"gcd",
"b",
"a",
"int a",
"a",
"int b",
"b",
"public class Main {\n\n\tpublic static void main(String[] args) {\n\n\t\tScanner sc = new Scanner(System.in);\n\n\t\tint first = sc.nextInt();\n\t\tint sum = 0;\n\t\t//ユークリッドの互除法\n\t\tfor(int a =1; a<=first ; a++) { //(a,b,c)のAが増える\n\t\t\tfor(int b = 1; b<=first; b++) { //(a,b,c)のBが増える\n\t\t\t\tfor(int c = 1; c<=first; c++) { //(a,b,c)のCが増える\n\t\t\t\t\tsum += gcd(gcd(a,b),c);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(sum);\n\t}\n\n\tprivate static int gcd(int a, int b) {\n\t\tif(b==0) {\n\t\t\treturn a;\n\t\t}\n\t\ta = a%b;\n\t\t//割られた数に余りを入れる。a=390 ,b=273の場合\n\t\t//a=117(あまりの数),b=273 割られた側が上書きされるイメージ\n\t\treturn gcd(b,a); //ここで反転して余りがなくなるまで繰り返す。\n\n\t}\n\n}",
"public class Main {\n\n\tpublic static void main(String[] args) {\n\n\t\tScanner sc = new Scanner(System.in);\n\n\t\tint first = sc.nextInt();\n\t\tint sum = 0;\n\t\t//ユークリッドの互除法\n\t\tfor(int a =1; a<=first ; a++) { //(a,b,c)のAが増える\n\t\t\tfor(int b = 1; b<=first; b++) { //(a,b,c)のBが増える\n\t\t\t\tfor(int c = 1; c<=first; c++) { //(a,b,c)のCが増える\n\t\t\t\t\tsum += gcd(gcd(a,b),c);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(sum);\n\t}\n\n\tprivate static int gcd(int a, int b) {\n\t\tif(b==0) {\n\t\t\treturn a;\n\t\t}\n\t\ta = a%b;\n\t\t//割られた数に余りを入れる。a=390 ,b=273の場合\n\t\t//a=117(あまりの数),b=273 割られた側が上書きされるイメージ\n\t\treturn gcd(b,a); //ここで反転して余りがなくなるまで繰り返す。\n\n\t}\n\n}",
"Main"
] |
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int first = sc.nextInt();
int sum = 0;
//ユークリッドの互除法
for(int a =1; a<=first ; a++) { //(a,b,c)のAが増える
for(int b = 1; b<=first; b++) { //(a,b,c)のBが増える
for(int c = 1; c<=first; c++) { //(a,b,c)のCが増える
sum += gcd(gcd(a,b),c);
}
}
}
System.out.println(sum);
}
private static int gcd(int a, int b) {
if(b==0) {
return a;
}
a = a%b;
//割られた数に余りを入れる。a=390 ,b=273の場合
//a=117(あまりの数),b=273 割られた側が上書きされるイメージ
return gcd(b,a); //ここで反転して余りがなくなるまで繰り返す。
}
}
|
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
4,
13,
13,
13,
13,
4,
18,
18,
13,
13,
13,
23,
13,
12,
13,
30,
41,
13,
13,
14,
2,
13,
13,
30,
0,
13,
13,
14,
2,
13,
13,
30,
0,
13,
13,
41,
13,
13,
42,
2,
13,
17,
30,
14,
2,
2,
2,
2,
13,
13,
17,
2,
2,
13,
13,
17,
2,
2,
13,
13,
17,
30,
29,
13,
0,
13,
17,
29,
13,
23,
13,
23,
13,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
137,
5
],
[
137,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
8,
17
],
[
17,
18
],
[
17,
19
],
[
8,
20
],
[
20,
21
],
[
21,
22
],
[
22,
23
],
[
22,
24
],
[
20,
25
],
[
25,
26
],
[
25,
27
],
[
20,
28
],
[
28,
29
],
[
29,
30
],
[
20,
31
],
[
32,
32
],
[
32,
33
],
[
33,
34
],
[
34,
35
],
[
35,
36
],
[
35,
37
],
[
33,
38
],
[
38,
39
],
[
38,
40
],
[
33,
41
],
[
41,
42
],
[
42,
43
],
[
33,
44
],
[
45,
45
],
[
45,
46
],
[
46,
47
],
[
47,
48
],
[
48,
49
],
[
48,
50
],
[
46,
51
],
[
51,
52
],
[
51,
53
],
[
46,
54
],
[
54,
55
],
[
55,
56
],
[
46,
57
],
[
58,
58
],
[
58,
59
],
[
59,
60
],
[
59,
61
],
[
61,
62
],
[
61,
63
],
[
61,
64
],
[
61,
65
],
[
8,
66
],
[
66,
67
],
[
67,
68
],
[
68,
69
],
[
68,
70
],
[
66,
71
],
[
6,
72
],
[
72,
73
],
[
137,
74
],
[
74,
75
],
[
74,
76
],
[
76,
77
],
[
77,
78
],
[
77,
79
],
[
76,
80
],
[
80,
81
],
[
81,
82
],
[
81,
83
],
[
80,
84
],
[
84,
85
],
[
85,
86
],
[
85,
87
],
[
76,
88
],
[
88,
89
],
[
89,
90
],
[
89,
91
],
[
88,
92
],
[
92,
93
],
[
93,
94
],
[
93,
95
],
[
76,
96
],
[
96,
97
],
[
96,
98
],
[
76,
99
],
[
99,
100
],
[
100,
101
],
[
100,
102
],
[
99,
103
],
[
103,
104
],
[
104,
105
],
[
106,
106
],
[
106,
107
],
[
107,
108
],
[
108,
109
],
[
108,
110
],
[
107,
111
],
[
106,
112
],
[
112,
113
],
[
113,
114
],
[
113,
115
],
[
112,
116
],
[
106,
117
],
[
117,
118
],
[
118,
119
],
[
118,
120
],
[
117,
121
],
[
104,
122
],
[
122,
123
],
[
123,
124
],
[
103,
125
],
[
125,
126
],
[
125,
127
],
[
76,
128
],
[
128,
129
],
[
74,
130
],
[
130,
131
],
[
74,
132
],
[
132,
133
],
[
74,
134
],
[
134,
135
],
[
0,
136
],
[
136,
137
],
[
136,
138
]
] |
[
"import java.util.*;\n\npublic class Main{\n public static void main(String[] args){\n Scanner scan = new Scanner(System.in);\n int n = scan.nextInt();\n int sum = 0;\n for (int i=1;i<=n;i++){\n for (int j=1;j<=n;j++){\n for (int k=1;k<=n;k++){\n sum += find(i,j,k);\n }\n }\n }\n System.out.println(sum);\n }\n\n public static int find(int a,int b,int c){\n int min = a;\n if (a>b){\n min = b;\n }\n if (min>c){\n min = c;\n }\n\n int l = min;\n while (l>1){\n if ((a%l == 0) && (b%l == 0) && (c%l == 0)){\n return l;\n }\n l -= 1;\n }\n return l;\n }\n\n}",
"import java.util.*;",
"util.*",
"java",
"public class Main{\n public static void main(String[] args){\n Scanner scan = new Scanner(System.in);\n int n = scan.nextInt();\n int sum = 0;\n for (int i=1;i<=n;i++){\n for (int j=1;j<=n;j++){\n for (int k=1;k<=n;k++){\n sum += find(i,j,k);\n }\n }\n }\n System.out.println(sum);\n }\n\n public static int find(int a,int b,int c){\n int min = a;\n if (a>b){\n min = b;\n }\n if (min>c){\n min = c;\n }\n\n int l = min;\n while (l>1){\n if ((a%l == 0) && (b%l == 0) && (c%l == 0)){\n return l;\n }\n l -= 1;\n }\n return l;\n }\n\n}",
"Main",
"public static void main(String[] args){\n Scanner scan = new Scanner(System.in);\n int n = scan.nextInt();\n int sum = 0;\n for (int i=1;i<=n;i++){\n for (int j=1;j<=n;j++){\n for (int k=1;k<=n;k++){\n sum += find(i,j,k);\n }\n }\n }\n System.out.println(sum);\n }",
"main",
"{\n Scanner scan = new Scanner(System.in);\n int n = scan.nextInt();\n int sum = 0;\n for (int i=1;i<=n;i++){\n for (int j=1;j<=n;j++){\n for (int k=1;k<=n;k++){\n sum += find(i,j,k);\n }\n }\n }\n System.out.println(sum);\n }",
"Scanner scan = new Scanner(System.in);",
"scan",
"new Scanner(System.in)",
"int n = scan.nextInt();",
"n",
"scan.nextInt()",
"scan.nextInt",
"scan",
"int sum = 0;",
"sum",
"0",
"for (int i=1;i<=n;i++){\n for (int j=1;j<=n;j++){\n for (int k=1;k<=n;k++){\n sum += find(i,j,k);\n }\n }\n }",
"int i=1;",
"int i=1;",
"i",
"1",
"i<=n",
"i",
"n",
"i++",
"i++",
"i",
"{\n for (int j=1;j<=n;j++){\n for (int k=1;k<=n;k++){\n sum += find(i,j,k);\n }\n }\n }",
"{\n for (int j=1;j<=n;j++){\n for (int k=1;k<=n;k++){\n sum += find(i,j,k);\n }\n }\n }",
"for (int j=1;j<=n;j++){\n for (int k=1;k<=n;k++){\n sum += find(i,j,k);\n }\n }",
"int j=1;",
"int j=1;",
"j",
"1",
"j<=n",
"j",
"n",
"j++",
"j++",
"j",
"{\n for (int k=1;k<=n;k++){\n sum += find(i,j,k);\n }\n }",
"{\n for (int k=1;k<=n;k++){\n sum += find(i,j,k);\n }\n }",
"for (int k=1;k<=n;k++){\n sum += find(i,j,k);\n }",
"int k=1;",
"int k=1;",
"k",
"1",
"k<=n",
"k",
"n",
"k++",
"k++",
"k",
"{\n sum += find(i,j,k);\n }",
"{\n sum += find(i,j,k);\n }",
"sum += find(i,j,k)",
"sum",
"find(i,j,k)",
"find",
"i",
"j",
"k",
"System.out.println(sum)",
"System.out.println",
"System.out",
"System",
"System.out",
"sum",
"String[] args",
"args",
"public static int find(int a,int b,int c){\n int min = a;\n if (a>b){\n min = b;\n }\n if (min>c){\n min = c;\n }\n\n int l = min;\n while (l>1){\n if ((a%l == 0) && (b%l == 0) && (c%l == 0)){\n return l;\n }\n l -= 1;\n }\n return l;\n }",
"find",
"{\n int min = a;\n if (a>b){\n min = b;\n }\n if (min>c){\n min = c;\n }\n\n int l = min;\n while (l>1){\n if ((a%l == 0) && (b%l == 0) && (c%l == 0)){\n return l;\n }\n l -= 1;\n }\n return l;\n }",
"int min = a;",
"min",
"a",
"if (a>b){\n min = b;\n }",
"a>b",
"a",
"b",
"{\n min = b;\n }",
"min = b",
"min",
"b",
"if (min>c){\n min = c;\n }",
"min>c",
"min",
"c",
"{\n min = c;\n }",
"min = c",
"min",
"c",
"int l = min;",
"l",
"min",
"while (l>1){\n if ((a%l == 0) && (b%l == 0) && (c%l == 0)){\n return l;\n }\n l -= 1;\n }",
"l>1",
"l",
"1",
"{\n if ((a%l == 0) && (b%l == 0) && (c%l == 0)){\n return l;\n }\n l -= 1;\n }",
"if ((a%l == 0) && (b%l == 0) && (c%l == 0)){\n return l;\n }",
"(a%l == 0) && (b%l == 0) && (c%l == 0)",
"(a%l == 0) && (b%l == 0) && (c%l == 0)",
"(a%l == 0)",
"a%l",
"a",
"l",
"0",
"(b%l == 0)",
"b%l",
"b",
"l",
"0",
"(c%l == 0)",
"c%l",
"c",
"l",
"0",
"{\n return l;\n }",
"return l;",
"l",
"l -= 1",
"l",
"1",
"return l;",
"l",
"int a",
"a",
"int b",
"b",
"int c",
"c",
"public class Main{\n public static void main(String[] args){\n Scanner scan = new Scanner(System.in);\n int n = scan.nextInt();\n int sum = 0;\n for (int i=1;i<=n;i++){\n for (int j=1;j<=n;j++){\n for (int k=1;k<=n;k++){\n sum += find(i,j,k);\n }\n }\n }\n System.out.println(sum);\n }\n\n public static int find(int a,int b,int c){\n int min = a;\n if (a>b){\n min = b;\n }\n if (min>c){\n min = c;\n }\n\n int l = min;\n while (l>1){\n if ((a%l == 0) && (b%l == 0) && (c%l == 0)){\n return l;\n }\n l -= 1;\n }\n return l;\n }\n\n}",
"public class Main{\n public static void main(String[] args){\n Scanner scan = new Scanner(System.in);\n int n = scan.nextInt();\n int sum = 0;\n for (int i=1;i<=n;i++){\n for (int j=1;j<=n;j++){\n for (int k=1;k<=n;k++){\n sum += find(i,j,k);\n }\n }\n }\n System.out.println(sum);\n }\n\n public static int find(int a,int b,int c){\n int min = a;\n if (a>b){\n min = b;\n }\n if (min>c){\n min = c;\n }\n\n int l = min;\n while (l>1){\n if ((a%l == 0) && (b%l == 0) && (c%l == 0)){\n return l;\n }\n l -= 1;\n }\n return l;\n }\n\n}",
"Main"
] |
import java.util.*;
public class Main{
public static void main(String[] args){
Scanner scan = new Scanner(System.in);
int n = scan.nextInt();
int sum = 0;
for (int i=1;i<=n;i++){
for (int j=1;j<=n;j++){
for (int k=1;k<=n;k++){
sum += find(i,j,k);
}
}
}
System.out.println(sum);
}
public static int find(int a,int b,int c){
int min = a;
if (a>b){
min = b;
}
if (min>c){
min = c;
}
int l = min;
while (l>1){
if ((a%l == 0) && (b%l == 0) && (c%l == 0)){
return l;
}
l -= 1;
}
return l;
}
}
|
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
41,
13,
4,
13,
13,
13,
0,
13,
4,
13,
13,
13,
4,
18,
18,
13,
13,
13,
23,
13,
12,
13,
30,
14,
2,
13,
13,
30,
29,
4,
13,
13,
13,
14,
2,
13,
17,
30,
29,
13,
29,
4,
13,
13,
2,
13,
13,
23,
13,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
111,
5
],
[
111,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
8,
17
],
[
17,
18
],
[
17,
19
],
[
8,
20
],
[
20,
21
],
[
21,
22
],
[
22,
23
],
[
22,
24
],
[
20,
25
],
[
25,
26
],
[
25,
27
],
[
20,
28
],
[
28,
29
],
[
29,
30
],
[
20,
31
],
[
32,
32
],
[
32,
33
],
[
33,
34
],
[
34,
35
],
[
35,
36
],
[
35,
37
],
[
33,
38
],
[
38,
39
],
[
38,
40
],
[
33,
41
],
[
41,
42
],
[
42,
43
],
[
33,
44
],
[
45,
45
],
[
45,
46
],
[
46,
47
],
[
47,
48
],
[
48,
49
],
[
48,
50
],
[
46,
51
],
[
51,
52
],
[
51,
53
],
[
46,
54
],
[
54,
55
],
[
55,
56
],
[
46,
57
],
[
58,
58
],
[
58,
59
],
[
59,
60
],
[
59,
61
],
[
61,
62
],
[
61,
63
],
[
61,
64
],
[
58,
65
],
[
65,
66
],
[
65,
67
],
[
67,
68
],
[
67,
69
],
[
67,
70
],
[
8,
71
],
[
71,
72
],
[
72,
73
],
[
73,
74
],
[
73,
75
],
[
71,
76
],
[
6,
77
],
[
77,
78
],
[
111,
79
],
[
79,
80
],
[
79,
81
],
[
81,
82
],
[
82,
83
],
[
83,
84
],
[
83,
85
],
[
82,
86
],
[
86,
87
],
[
87,
88
],
[
88,
89
],
[
88,
90
],
[
88,
91
],
[
81,
92
],
[
92,
93
],
[
93,
94
],
[
93,
95
],
[
92,
96
],
[
96,
97
],
[
97,
98
],
[
81,
99
],
[
99,
100
],
[
100,
101
],
[
100,
102
],
[
100,
103
],
[
103,
104
],
[
103,
105
],
[
79,
106
],
[
106,
107
],
[
79,
108
],
[
108,
109
],
[
0,
110
],
[
110,
111
],
[
110,
112
]
] |
[
"import java.util.Scanner;\n\npublic class Main {\n\tpublic static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\tint K=sc.nextInt();\n\t\tlong ans=0L;\n\n\t\tfor(int i=1;i<=K;i++) {\n\t\t\tfor(int j=1;j<=K;j++) {\n\t\t\t\tfor(int k=1;k<=K;k++) {\n\t\t\t\t\tlong res= gcd(i,j);\n\t\t\t\t\tans+=gcd(res,k);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(ans);\n\t}\n\tpublic static long gcd(long a, long b) {\n\t\tif(a<b) {\n\t\t\treturn gcd(b,a);\n\t\t}\n\t\tif(b==0) {\n\t\t\treturn a;\n\t\t}\n\t\treturn gcd(b,a%b);\n\t}\n\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n\tpublic static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\tint K=sc.nextInt();\n\t\tlong ans=0L;\n\n\t\tfor(int i=1;i<=K;i++) {\n\t\t\tfor(int j=1;j<=K;j++) {\n\t\t\t\tfor(int k=1;k<=K;k++) {\n\t\t\t\t\tlong res= gcd(i,j);\n\t\t\t\t\tans+=gcd(res,k);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(ans);\n\t}\n\tpublic static long gcd(long a, long b) {\n\t\tif(a<b) {\n\t\t\treturn gcd(b,a);\n\t\t}\n\t\tif(b==0) {\n\t\t\treturn a;\n\t\t}\n\t\treturn gcd(b,a%b);\n\t}\n\n}",
"Main",
"public static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\tint K=sc.nextInt();\n\t\tlong ans=0L;\n\n\t\tfor(int i=1;i<=K;i++) {\n\t\t\tfor(int j=1;j<=K;j++) {\n\t\t\t\tfor(int k=1;k<=K;k++) {\n\t\t\t\t\tlong res= gcd(i,j);\n\t\t\t\t\tans+=gcd(res,k);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(ans);\n\t}",
"main",
"{\n\t\tScanner sc = new Scanner(System.in);\n\t\tint K=sc.nextInt();\n\t\tlong ans=0L;\n\n\t\tfor(int i=1;i<=K;i++) {\n\t\t\tfor(int j=1;j<=K;j++) {\n\t\t\t\tfor(int k=1;k<=K;k++) {\n\t\t\t\t\tlong res= gcd(i,j);\n\t\t\t\t\tans+=gcd(res,k);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(ans);\n\t}",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"int K=sc.nextInt();",
"K",
"sc.nextInt()",
"sc.nextInt",
"sc",
"long ans=0L;",
"ans",
"0L",
"for(int i=1;i<=K;i++) {\n\t\t\tfor(int j=1;j<=K;j++) {\n\t\t\t\tfor(int k=1;k<=K;k++) {\n\t\t\t\t\tlong res= gcd(i,j);\n\t\t\t\t\tans+=gcd(res,k);\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"int i=1;",
"int i=1;",
"i",
"1",
"i<=K",
"i",
"K",
"i++",
"i++",
"i",
"{\n\t\t\tfor(int j=1;j<=K;j++) {\n\t\t\t\tfor(int k=1;k<=K;k++) {\n\t\t\t\t\tlong res= gcd(i,j);\n\t\t\t\t\tans+=gcd(res,k);\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"{\n\t\t\tfor(int j=1;j<=K;j++) {\n\t\t\t\tfor(int k=1;k<=K;k++) {\n\t\t\t\t\tlong res= gcd(i,j);\n\t\t\t\t\tans+=gcd(res,k);\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"for(int j=1;j<=K;j++) {\n\t\t\t\tfor(int k=1;k<=K;k++) {\n\t\t\t\t\tlong res= gcd(i,j);\n\t\t\t\t\tans+=gcd(res,k);\n\t\t\t\t}\n\t\t\t}",
"int j=1;",
"int j=1;",
"j",
"1",
"j<=K",
"j",
"K",
"j++",
"j++",
"j",
"{\n\t\t\t\tfor(int k=1;k<=K;k++) {\n\t\t\t\t\tlong res= gcd(i,j);\n\t\t\t\t\tans+=gcd(res,k);\n\t\t\t\t}\n\t\t\t}",
"{\n\t\t\t\tfor(int k=1;k<=K;k++) {\n\t\t\t\t\tlong res= gcd(i,j);\n\t\t\t\t\tans+=gcd(res,k);\n\t\t\t\t}\n\t\t\t}",
"for(int k=1;k<=K;k++) {\n\t\t\t\t\tlong res= gcd(i,j);\n\t\t\t\t\tans+=gcd(res,k);\n\t\t\t\t}",
"int k=1;",
"int k=1;",
"k",
"1",
"k<=K",
"k",
"K",
"k++",
"k++",
"k",
"{\n\t\t\t\t\tlong res= gcd(i,j);\n\t\t\t\t\tans+=gcd(res,k);\n\t\t\t\t}",
"{\n\t\t\t\t\tlong res= gcd(i,j);\n\t\t\t\t\tans+=gcd(res,k);\n\t\t\t\t}",
"long res= gcd(i,j);",
"res",
"gcd(i,j)",
"gcd",
"i",
"j",
"ans+=gcd(res,k)",
"ans",
"gcd(res,k)",
"gcd",
"res",
"k",
"System.out.println(ans)",
"System.out.println",
"System.out",
"System",
"System.out",
"ans",
"String[] args",
"args",
"public static long gcd(long a, long b) {\n\t\tif(a<b) {\n\t\t\treturn gcd(b,a);\n\t\t}\n\t\tif(b==0) {\n\t\t\treturn a;\n\t\t}\n\t\treturn gcd(b,a%b);\n\t}",
"gcd",
"{\n\t\tif(a<b) {\n\t\t\treturn gcd(b,a);\n\t\t}\n\t\tif(b==0) {\n\t\t\treturn a;\n\t\t}\n\t\treturn gcd(b,a%b);\n\t}",
"if(a<b) {\n\t\t\treturn gcd(b,a);\n\t\t}",
"a<b",
"a",
"b",
"{\n\t\t\treturn gcd(b,a);\n\t\t}",
"return gcd(b,a);",
"gcd(b,a)",
"gcd",
"b",
"a",
"if(b==0) {\n\t\t\treturn a;\n\t\t}",
"b==0",
"b",
"0",
"{\n\t\t\treturn a;\n\t\t}",
"return a;",
"a",
"return gcd(b,a%b);",
"gcd(b,a%b)",
"gcd",
"b",
"a%b",
"a",
"b",
"long a",
"a",
"long b",
"b",
"public class Main {\n\tpublic static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\tint K=sc.nextInt();\n\t\tlong ans=0L;\n\n\t\tfor(int i=1;i<=K;i++) {\n\t\t\tfor(int j=1;j<=K;j++) {\n\t\t\t\tfor(int k=1;k<=K;k++) {\n\t\t\t\t\tlong res= gcd(i,j);\n\t\t\t\t\tans+=gcd(res,k);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(ans);\n\t}\n\tpublic static long gcd(long a, long b) {\n\t\tif(a<b) {\n\t\t\treturn gcd(b,a);\n\t\t}\n\t\tif(b==0) {\n\t\t\treturn a;\n\t\t}\n\t\treturn gcd(b,a%b);\n\t}\n\n}",
"public class Main {\n\tpublic static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\tint K=sc.nextInt();\n\t\tlong ans=0L;\n\n\t\tfor(int i=1;i<=K;i++) {\n\t\t\tfor(int j=1;j<=K;j++) {\n\t\t\t\tfor(int k=1;k<=K;k++) {\n\t\t\t\t\tlong res= gcd(i,j);\n\t\t\t\t\tans+=gcd(res,k);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(ans);\n\t}\n\tpublic static long gcd(long a, long b) {\n\t\tif(a<b) {\n\t\t\treturn gcd(b,a);\n\t\t}\n\t\tif(b==0) {\n\t\t\treturn a;\n\t\t}\n\t\treturn gcd(b,a%b);\n\t}\n\n}",
"Main"
] |
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int K=sc.nextInt();
long ans=0L;
for(int i=1;i<=K;i++) {
for(int j=1;j<=K;j++) {
for(int k=1;k<=K;k++) {
long res= gcd(i,j);
ans+=gcd(res,k);
}
}
}
System.out.println(ans);
}
public static long gcd(long a, long b) {
if(a<b) {
return gcd(b,a);
}
if(b==0) {
return a;
}
return gcd(b,a%b);
}
}
|
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
18,
13,
13,
41,
13,
18,
13,
13,
41,
13,
20,
41,
13,
20,
41,
13,
20,
4,
18,
13,
17,
13,
13,
4,
18,
13,
23,
13,
6,
13,
12,
13,
30,
41,
13,
4,
18,
13,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
4,
18,
13,
13,
13,
13,
4,
18,
4,
18,
13,
13,
23,
13,
23,
13,
23,
13,
6,
13,
12,
13,
30,
12,
13,
30,
41,
13,
14,
2,
13,
17,
29,
13,
14,
2,
13,
17,
29,
13,
42,
2,
2,
13,
13,
17,
30,
0,
13,
13,
0,
13,
2,
13,
13,
0,
13,
13,
29,
13,
23,
13,
23,
13,
12,
13,
30,
41,
13,
18,
13,
17,
11,
1,
41,
13,
17,
2,
13,
18,
13,
13,
1,
40,
13,
30,
30,
0,
13,
4,
13,
13,
18,
13,
13,
29,
13,
23,
13,
6,
13,
41,
13,
41,
13,
17,
41,
13,
17,
12,
13,
30,
0,
18,
36,
13,
13,
23,
13,
12,
13,
30,
4,
13,
20,
23,
13,
12,
13,
30,
38,
5,
13,
30,
37,
20,
30,
4,
18,
13,
13,
0,
13,
17,
29,
36,
23,
13,
12,
13,
30,
38,
5,
13,
30,
37,
20,
30,
4,
18,
13,
13,
17,
4,
18,
13,
0,
13,
17,
29,
36,
23,
13,
12,
13,
30,
14,
40,
13,
30,
4,
13,
17,
29,
4,
13,
13,
23,
13,
12,
13,
30,
29,
4,
13,
4,
18,
13,
13,
23,
13,
12,
13,
30,
4,
13,
4,
18,
13,
0,
13,
17,
14,
13,
30,
38,
5,
13,
30,
37,
20,
30,
4,
18,
13,
29,
36,
12,
13,
30,
38,
5,
13,
30,
37,
20,
30,
4,
18,
13,
13,
6,
13,
41,
13,
17,
41,
13,
17,
12,
13,
30,
0,
13,
20,
23,
13,
12,
13,
30,
42,
2,
2,
13,
17,
40,
4,
18,
13,
30,
38,
5,
13,
30,
37,
20,
30,
0,
13,
20,
29,
4,
18,
13,
12,
13,
30,
29,
4,
18,
13,
4,
13,
12,
13,
30,
38,
5,
13,
30,
37,
20,
30,
4,
18,
18,
36,
13,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
10,
11
],
[
10,
12
],
[
0,
13
],
[
13,
14
],
[
13,
15
],
[
0,
16
],
[
16,
17
],
[
16,
18
],
[
0,
19
],
[
19,
20
],
[
19,
21
],
[
0,
22
],
[
22,
23
],
[
22,
24
],
[
0,
25
],
[
25,
26
],
[
25,
27
],
[
0,
28
],
[
28,
29
],
[
28,
30
],
[
0,
31
],
[
31,
32
],
[
31,
33
],
[
0,
34
],
[
34,
35
],
[
34,
36
],
[
0,
37
],
[
37,
38
],
[
37,
39
],
[
0,
40
],
[
40,
41
],
[
40,
42
],
[
0,
43
],
[
442,
44
],
[
442,
45
],
[
45,
46
],
[
45,
47
],
[
47,
48
],
[
48,
49
],
[
48,
50
],
[
50,
51
],
[
50,
52
],
[
47,
53
],
[
53,
54
],
[
53,
55
],
[
55,
56
],
[
55,
57
],
[
47,
58
],
[
58,
59
],
[
58,
60
],
[
47,
61
],
[
61,
62
],
[
61,
63
],
[
47,
64
],
[
64,
65
],
[
64,
66
],
[
47,
67
],
[
67,
68
],
[
68,
69
],
[
67,
70
],
[
67,
71
],
[
67,
72
],
[
47,
73
],
[
73,
74
],
[
74,
75
],
[
45,
76
],
[
76,
77
],
[
442,
78
],
[
78,
79
],
[
78,
80
],
[
80,
81
],
[
80,
82
],
[
82,
83
],
[
83,
84
],
[
83,
85
],
[
85,
86
],
[
86,
87
],
[
82,
88
],
[
88,
89
],
[
88,
90
],
[
82,
91
],
[
91,
92
],
[
92,
93
],
[
93,
94
],
[
93,
95
],
[
91,
96
],
[
96,
97
],
[
96,
98
],
[
91,
99
],
[
99,
100
],
[
100,
101
],
[
91,
102
],
[
103,
103
],
[
103,
104
],
[
104,
105
],
[
105,
106
],
[
106,
107
],
[
106,
108
],
[
104,
109
],
[
109,
110
],
[
109,
111
],
[
104,
112
],
[
112,
113
],
[
113,
114
],
[
104,
115
],
[
116,
116
],
[
116,
117
],
[
117,
118
],
[
118,
119
],
[
119,
120
],
[
119,
121
],
[
117,
122
],
[
122,
123
],
[
122,
124
],
[
117,
125
],
[
125,
126
],
[
126,
127
],
[
117,
128
],
[
129,
129
],
[
129,
130
],
[
130,
131
],
[
130,
132
],
[
132,
133
],
[
133,
134
],
[
132,
135
],
[
132,
136
],
[
132,
137
],
[
82,
138
],
[
138,
139
],
[
139,
140
],
[
140,
141
],
[
141,
142
],
[
140,
143
],
[
80,
144
],
[
144,
145
],
[
80,
146
],
[
146,
147
],
[
80,
148
],
[
148,
149
],
[
442,
150
],
[
150,
151
],
[
150,
152
],
[
152,
153
],
[
152,
154
],
[
150,
155
],
[
155,
156
],
[
155,
157
],
[
157,
158
],
[
158,
159
],
[
157,
160
],
[
160,
161
],
[
161,
162
],
[
161,
163
],
[
160,
164
],
[
164,
165
],
[
157,
166
],
[
166,
167
],
[
167,
168
],
[
167,
169
],
[
166,
170
],
[
170,
171
],
[
157,
172
],
[
172,
173
],
[
173,
174
],
[
174,
175
],
[
174,
176
],
[
173,
177
],
[
172,
178
],
[
178,
179
],
[
179,
180
],
[
179,
181
],
[
178,
182
],
[
182,
183
],
[
182,
184
],
[
184,
185
],
[
184,
186
],
[
178,
187
],
[
187,
188
],
[
187,
189
],
[
157,
190
],
[
190,
191
],
[
155,
192
],
[
192,
193
],
[
155,
194
],
[
194,
195
],
[
150,
196
],
[
196,
197
],
[
196,
198
],
[
198,
199
],
[
199,
200
],
[
199,
201
],
[
201,
202
],
[
201,
203
],
[
198,
204
],
[
204,
205
],
[
205,
206
],
[
206,
207
],
[
206,
208
],
[
204,
209
],
[
209,
210
],
[
209,
211
],
[
211,
212
],
[
211,
213
],
[
204,
214
],
[
214,
215
],
[
215,
216
],
[
204,
217
],
[
218,
218
],
[
218,
219
],
[
219,
220
],
[
219,
221
],
[
221,
222
],
[
221,
223
],
[
221,
224
],
[
224,
225
],
[
224,
226
],
[
198,
227
],
[
227,
228
],
[
196,
229
],
[
229,
230
],
[
442,
231
],
[
231,
232
],
[
231,
233
],
[
233,
234
],
[
231,
235
],
[
235,
236
],
[
235,
237
],
[
231,
238
],
[
238,
239
],
[
238,
240
],
[
231,
241
],
[
241,
242
],
[
241,
243
],
[
243,
244
],
[
244,
245
],
[
245,
246
],
[
245,
247
],
[
244,
248
],
[
241,
249
],
[
249,
250
],
[
231,
251
],
[
251,
252
],
[
251,
253
],
[
253,
254
],
[
254,
255
],
[
254,
256
],
[
251,
257
],
[
257,
258
],
[
231,
259
],
[
259,
260
],
[
259,
261
],
[
261,
262
],
[
262,
263
],
[
263,
264
],
[
263,
265
],
[
265,
266
],
[
266,
267
],
[
262,
268
],
[
268,
269
],
[
269,
270
],
[
270,
271
],
[
269,
272
],
[
268,
273
],
[
273,
274
],
[
273,
275
],
[
261,
276
],
[
276,
277
],
[
259,
278
],
[
278,
279
],
[
231,
280
],
[
280,
281
],
[
280,
282
],
[
282,
283
],
[
283,
284
],
[
284,
285
],
[
284,
286
],
[
286,
287
],
[
287,
288
],
[
283,
289
],
[
289,
290
],
[
290,
291
],
[
291,
292
],
[
290,
293
],
[
290,
294
],
[
290,
295
],
[
295,
296
],
[
296,
297
],
[
289,
298
],
[
298,
299
],
[
298,
300
],
[
282,
301
],
[
301,
302
],
[
280,
303
],
[
303,
304
],
[
231,
305
],
[
305,
306
],
[
305,
307
],
[
307,
308
],
[
308,
309
],
[
309,
310
],
[
308,
311
],
[
311,
312
],
[
312,
313
],
[
312,
314
],
[
307,
315
],
[
315,
316
],
[
316,
317
],
[
316,
318
],
[
305,
319
],
[
319,
320
],
[
231,
321
],
[
321,
322
],
[
321,
323
],
[
323,
324
],
[
324,
325
],
[
325,
326
],
[
325,
327
],
[
327,
328
],
[
328,
329
],
[
327,
330
],
[
321,
331
],
[
331,
332
],
[
231,
333
],
[
333,
334
],
[
333,
335
],
[
335,
336
],
[
336,
337
],
[
336,
338
],
[
338,
339
],
[
339,
340
],
[
335,
341
],
[
341,
342
],
[
341,
343
],
[
335,
344
],
[
344,
345
],
[
344,
346
],
[
346,
347
],
[
347,
348
],
[
348,
349
],
[
348,
350
],
[
350,
351
],
[
351,
352
],
[
347,
353
],
[
353,
354
],
[
354,
355
],
[
355,
356
],
[
335,
357
],
[
357,
358
],
[
231,
359
],
[
359,
360
],
[
359,
361
],
[
361,
362
],
[
362,
363
],
[
363,
364
],
[
363,
365
],
[
365,
366
],
[
366,
367
],
[
362,
368
],
[
368,
369
],
[
369,
370
],
[
370,
371
],
[
231,
372
],
[
442,
373
],
[
373,
374
],
[
373,
375
],
[
375,
376
],
[
375,
377
],
[
373,
378
],
[
378,
379
],
[
378,
380
],
[
373,
381
],
[
381,
382
],
[
381,
383
],
[
383,
384
],
[
384,
385
],
[
384,
386
],
[
381,
387
],
[
387,
388
],
[
373,
389
],
[
389,
390
],
[
389,
391
],
[
391,
392
],
[
392,
393
],
[
393,
394
],
[
394,
395
],
[
394,
396
],
[
393,
397
],
[
397,
398
],
[
398,
399
],
[
399,
400
],
[
392,
401
],
[
401,
402
],
[
402,
403
],
[
403,
404
],
[
403,
405
],
[
405,
406
],
[
406,
407
],
[
402,
408
],
[
408,
409
],
[
409,
410
],
[
409,
411
],
[
391,
412
],
[
412,
413
],
[
413,
414
],
[
414,
415
],
[
373,
416
],
[
416,
417
],
[
416,
418
],
[
418,
419
],
[
419,
420
],
[
420,
421
],
[
421,
422
],
[
420,
423
],
[
423,
424
],
[
373,
425
],
[
425,
426
],
[
425,
427
],
[
427,
428
],
[
428,
429
],
[
429,
430
],
[
429,
431
],
[
431,
432
],
[
432,
433
],
[
428,
434
],
[
434,
435
],
[
435,
436
],
[
436,
437
],
[
437,
438
],
[
437,
439
],
[
373,
440
],
[
0,
441
],
[
441,
442
],
[
441,
443
]
] |
[
"import java.io.OutputStream;\nimport java.io.IOException;\nimport java.io.InputStream;\nimport java.io.OutputStream;\nimport java.io.IOException;\nimport java.io.InputStreamReader;\nimport java.io.BufferedOutputStream;\nimport java.io.UncheckedIOException;\nimport java.nio.charset.Charset;\nimport java.util.StringTokenizer;\nimport java.io.Writer;\nimport java.io.OutputStreamWriter;\nimport java.io.BufferedReader;\nimport java.io.InputStream;\n\n/**\n * Built using CHelper plug-in\n * Actual solution is at the top\n *\n * @author mikit\n */\npublic class Main {\n public static void main(String[] args) {\n InputStream inputStream = System.in;\n OutputStream outputStream = System.out;\n LightScanner in = new LightScanner(inputStream);\n LightWriter out = new LightWriter(outputStream);\n CSumOfGcdOfTuplesEasy solver = new CSumOfGcdOfTuplesEasy();\n solver.solve(1, in, out);\n out.close();\n }\n\n static class CSumOfGcdOfTuplesEasy {\n public void solve(int testNumber, LightScanner in, LightWriter out) {\n int k = in.ints();\n long ans = 0;\n for (int i = 1; i <= k; i++) {\n for (int j = 1; j <= k; j++) {\n for (int l = 1; l <= k; l++) {\n ans += IntMath.gcd(i, j, l);\n }\n }\n }\n out.ans(ans).ln();\n }\n\n }\n\n static final class IntMath {\n private IntMath() {\n }\n\n public static int gcd(int a, int b) {\n int t;\n if (a == 0) return b;\n if (b == 0) return a;\n while (a % b > 0) {\n t = b;\n b = a % b;\n a = t;\n }\n return b;\n }\n\n public static int gcd(int... a) {\n int t = a[0];\n for (int i = 1; i < a.length; i++) {\n t = gcd(t, a[i]);\n }\n return t;\n }\n\n }\n\n static class LightWriter implements AutoCloseable {\n private final Writer out;\n private boolean autoflush = false;\n private boolean breaked = true;\n\n public LightWriter(Writer out) {\n this.out = out;\n }\n\n public LightWriter(OutputStream out) {\n this(new OutputStreamWriter(new BufferedOutputStream(out), Charset.defaultCharset()));\n }\n\n public LightWriter print(char c) {\n try {\n out.write(c);\n breaked = false;\n } catch (IOException ex) {\n throw new UncheckedIOException(ex);\n }\n return this;\n }\n\n public LightWriter print(String s) {\n try {\n out.write(s, 0, s.length());\n breaked = false;\n } catch (IOException ex) {\n throw new UncheckedIOException(ex);\n }\n return this;\n }\n\n public LightWriter ans(String s) {\n if (!breaked) {\n print(' ');\n }\n return print(s);\n }\n\n public LightWriter ans(long l) {\n return ans(Long.toString(l));\n }\n\n public LightWriter ln() {\n print(System.lineSeparator());\n breaked = true;\n if (autoflush) {\n try {\n out.flush();\n } catch (IOException ex) {\n throw new UncheckedIOException(ex);\n }\n }\n return this;\n }\n\n public void close() {\n try {\n out.close();\n } catch (IOException ex) {\n throw new UncheckedIOException(ex);\n }\n }\n\n }\n\n static class LightScanner implements AutoCloseable {\n private BufferedReader reader = null;\n private StringTokenizer tokenizer = null;\n\n public LightScanner(InputStream in) {\n reader = new BufferedReader(new InputStreamReader(in));\n }\n\n public String string() {\n while (tokenizer == null || !tokenizer.hasMoreTokens()) {\n try {\n tokenizer = new StringTokenizer(reader.readLine());\n } catch (IOException e) {\n throw new UncheckedIOException(e);\n }\n }\n return tokenizer.nextToken();\n }\n\n public int ints() {\n return Integer.parseInt(string());\n }\n\n public void close() {\n try {\n this.reader.close();\n } catch (IOException ex) {\n throw new UncheckedIOException(ex);\n }\n }\n\n }\n}\n",
"import java.io.OutputStream;",
"OutputStream",
"java.io",
"import java.io.IOException;",
"IOException",
"java.io",
"import java.io.InputStream;",
"InputStream",
"java.io",
"import java.io.OutputStream;",
"OutputStream",
"java.io",
"import java.io.IOException;",
"IOException",
"java.io",
"import java.io.InputStreamReader;",
"InputStreamReader",
"java.io",
"import java.io.BufferedOutputStream;",
"BufferedOutputStream",
"java.io",
"import java.io.UncheckedIOException;",
"UncheckedIOException",
"java.io",
"import java.nio.charset.Charset;",
"Charset",
"java.nio.charset",
"import java.util.StringTokenizer;",
"StringTokenizer",
"java.util",
"import java.io.Writer;",
"Writer",
"java.io",
"import java.io.OutputStreamWriter;",
"OutputStreamWriter",
"java.io",
"import java.io.BufferedReader;",
"BufferedReader",
"java.io",
"import java.io.InputStream;",
"InputStream",
"java.io",
"public class Main {\n public static void main(String[] args) {\n InputStream inputStream = System.in;\n OutputStream outputStream = System.out;\n LightScanner in = new LightScanner(inputStream);\n LightWriter out = new LightWriter(outputStream);\n CSumOfGcdOfTuplesEasy solver = new CSumOfGcdOfTuplesEasy();\n solver.solve(1, in, out);\n out.close();\n }\n\n static class CSumOfGcdOfTuplesEasy {\n public void solve(int testNumber, LightScanner in, LightWriter out) {\n int k = in.ints();\n long ans = 0;\n for (int i = 1; i <= k; i++) {\n for (int j = 1; j <= k; j++) {\n for (int l = 1; l <= k; l++) {\n ans += IntMath.gcd(i, j, l);\n }\n }\n }\n out.ans(ans).ln();\n }\n\n }\n\n static final class IntMath {\n private IntMath() {\n }\n\n public static int gcd(int a, int b) {\n int t;\n if (a == 0) return b;\n if (b == 0) return a;\n while (a % b > 0) {\n t = b;\n b = a % b;\n a = t;\n }\n return b;\n }\n\n public static int gcd(int... a) {\n int t = a[0];\n for (int i = 1; i < a.length; i++) {\n t = gcd(t, a[i]);\n }\n return t;\n }\n\n }\n\n static class LightWriter implements AutoCloseable {\n private final Writer out;\n private boolean autoflush = false;\n private boolean breaked = true;\n\n public LightWriter(Writer out) {\n this.out = out;\n }\n\n public LightWriter(OutputStream out) {\n this(new OutputStreamWriter(new BufferedOutputStream(out), Charset.defaultCharset()));\n }\n\n public LightWriter print(char c) {\n try {\n out.write(c);\n breaked = false;\n } catch (IOException ex) {\n throw new UncheckedIOException(ex);\n }\n return this;\n }\n\n public LightWriter print(String s) {\n try {\n out.write(s, 0, s.length());\n breaked = false;\n } catch (IOException ex) {\n throw new UncheckedIOException(ex);\n }\n return this;\n }\n\n public LightWriter ans(String s) {\n if (!breaked) {\n print(' ');\n }\n return print(s);\n }\n\n public LightWriter ans(long l) {\n return ans(Long.toString(l));\n }\n\n public LightWriter ln() {\n print(System.lineSeparator());\n breaked = true;\n if (autoflush) {\n try {\n out.flush();\n } catch (IOException ex) {\n throw new UncheckedIOException(ex);\n }\n }\n return this;\n }\n\n public void close() {\n try {\n out.close();\n } catch (IOException ex) {\n throw new UncheckedIOException(ex);\n }\n }\n\n }\n\n static class LightScanner implements AutoCloseable {\n private BufferedReader reader = null;\n private StringTokenizer tokenizer = null;\n\n public LightScanner(InputStream in) {\n reader = new BufferedReader(new InputStreamReader(in));\n }\n\n public String string() {\n while (tokenizer == null || !tokenizer.hasMoreTokens()) {\n try {\n tokenizer = new StringTokenizer(reader.readLine());\n } catch (IOException e) {\n throw new UncheckedIOException(e);\n }\n }\n return tokenizer.nextToken();\n }\n\n public int ints() {\n return Integer.parseInt(string());\n }\n\n public void close() {\n try {\n this.reader.close();\n } catch (IOException ex) {\n throw new UncheckedIOException(ex);\n }\n }\n\n }\n}",
"Main",
"public static void main(String[] args) {\n InputStream inputStream = System.in;\n OutputStream outputStream = System.out;\n LightScanner in = new LightScanner(inputStream);\n LightWriter out = new LightWriter(outputStream);\n CSumOfGcdOfTuplesEasy solver = new CSumOfGcdOfTuplesEasy();\n solver.solve(1, in, out);\n out.close();\n }",
"main",
"{\n InputStream inputStream = System.in;\n OutputStream outputStream = System.out;\n LightScanner in = new LightScanner(inputStream);\n LightWriter out = new LightWriter(outputStream);\n CSumOfGcdOfTuplesEasy solver = new CSumOfGcdOfTuplesEasy();\n solver.solve(1, in, out);\n out.close();\n }",
"InputStream inputStream = System.in;",
"inputStream",
"System.in",
"System",
"System.in",
"OutputStream outputStream = System.out;",
"outputStream",
"System.out",
"System",
"System.out",
"LightScanner in = new LightScanner(inputStream);",
"in",
"new LightScanner(inputStream)",
"LightWriter out = new LightWriter(outputStream);",
"out",
"new LightWriter(outputStream)",
"CSumOfGcdOfTuplesEasy solver = new CSumOfGcdOfTuplesEasy();",
"solver",
"new CSumOfGcdOfTuplesEasy()",
"solver.solve(1, in, out)",
"solver.solve",
"solver",
"1",
"in",
"out",
"out.close()",
"out.close",
"out",
"String[] args",
"args",
"static class CSumOfGcdOfTuplesEasy {\n public void solve(int testNumber, LightScanner in, LightWriter out) {\n int k = in.ints();\n long ans = 0;\n for (int i = 1; i <= k; i++) {\n for (int j = 1; j <= k; j++) {\n for (int l = 1; l <= k; l++) {\n ans += IntMath.gcd(i, j, l);\n }\n }\n }\n out.ans(ans).ln();\n }\n\n }",
"CSumOfGcdOfTuplesEasy",
"public void solve(int testNumber, LightScanner in, LightWriter out) {\n int k = in.ints();\n long ans = 0;\n for (int i = 1; i <= k; i++) {\n for (int j = 1; j <= k; j++) {\n for (int l = 1; l <= k; l++) {\n ans += IntMath.gcd(i, j, l);\n }\n }\n }\n out.ans(ans).ln();\n }",
"solve",
"{\n int k = in.ints();\n long ans = 0;\n for (int i = 1; i <= k; i++) {\n for (int j = 1; j <= k; j++) {\n for (int l = 1; l <= k; l++) {\n ans += IntMath.gcd(i, j, l);\n }\n }\n }\n out.ans(ans).ln();\n }",
"int k = in.ints();",
"k",
"in.ints()",
"in.ints",
"in",
"long ans = 0;",
"ans",
"0",
"for (int i = 1; i <= k; i++) {\n for (int j = 1; j <= k; j++) {\n for (int l = 1; l <= k; l++) {\n ans += IntMath.gcd(i, j, l);\n }\n }\n }",
"int i = 1;",
"int i = 1;",
"i",
"1",
"i <= k",
"i",
"k",
"i++",
"i++",
"i",
"{\n for (int j = 1; j <= k; j++) {\n for (int l = 1; l <= k; l++) {\n ans += IntMath.gcd(i, j, l);\n }\n }\n }",
"{\n for (int j = 1; j <= k; j++) {\n for (int l = 1; l <= k; l++) {\n ans += IntMath.gcd(i, j, l);\n }\n }\n }",
"for (int j = 1; j <= k; j++) {\n for (int l = 1; l <= k; l++) {\n ans += IntMath.gcd(i, j, l);\n }\n }",
"int j = 1;",
"int j = 1;",
"j",
"1",
"j <= k",
"j",
"k",
"j++",
"j++",
"j",
"{\n for (int l = 1; l <= k; l++) {\n ans += IntMath.gcd(i, j, l);\n }\n }",
"{\n for (int l = 1; l <= k; l++) {\n ans += IntMath.gcd(i, j, l);\n }\n }",
"for (int l = 1; l <= k; l++) {\n ans += IntMath.gcd(i, j, l);\n }",
"int l = 1;",
"int l = 1;",
"l",
"1",
"l <= k",
"l",
"k",
"l++",
"l++",
"l",
"{\n ans += IntMath.gcd(i, j, l);\n }",
"{\n ans += IntMath.gcd(i, j, l);\n }",
"ans += IntMath.gcd(i, j, l)",
"ans",
"IntMath.gcd(i, j, l)",
"IntMath.gcd",
"IntMath",
"i",
"j",
"l",
"out.ans(ans).ln()",
"out.ans(ans).ln",
"out.ans(ans)",
"out.ans",
"out",
"ans",
"int testNumber",
"testNumber",
"LightScanner in",
"in",
"LightWriter out",
"out",
"static final class IntMath {\n private IntMath() {\n }\n\n public static int gcd(int a, int b) {\n int t;\n if (a == 0) return b;\n if (b == 0) return a;\n while (a % b > 0) {\n t = b;\n b = a % b;\n a = t;\n }\n return b;\n }\n\n public static int gcd(int... a) {\n int t = a[0];\n for (int i = 1; i < a.length; i++) {\n t = gcd(t, a[i]);\n }\n return t;\n }\n\n }",
"IntMath",
"private IntMath() {\n }",
"IntMath",
"{\n }",
"public static int gcd(int a, int b) {\n int t;\n if (a == 0) return b;\n if (b == 0) return a;\n while (a % b > 0) {\n t = b;\n b = a % b;\n a = t;\n }\n return b;\n }",
"gcd",
"{\n int t;\n if (a == 0) return b;\n if (b == 0) return a;\n while (a % b > 0) {\n t = b;\n b = a % b;\n a = t;\n }\n return b;\n }",
"int t;",
"t",
"if (a == 0) return b;",
"a == 0",
"a",
"0",
"return b;",
"b",
"if (b == 0) return a;",
"b == 0",
"b",
"0",
"return a;",
"a",
"while (a % b > 0) {\n t = b;\n b = a % b;\n a = t;\n }",
"a % b > 0",
"a % b",
"a",
"b",
"0",
"{\n t = b;\n b = a % b;\n a = t;\n }",
"t = b",
"t",
"b",
"b = a % b",
"b",
"a % b",
"a",
"b",
"a = t",
"a",
"t",
"return b;",
"b",
"int a",
"a",
"int b",
"b",
"public static int gcd(int... a) {\n int t = a[0];\n for (int i = 1; i < a.length; i++) {\n t = gcd(t, a[i]);\n }\n return t;\n }",
"gcd",
"{\n int t = a[0];\n for (int i = 1; i < a.length; i++) {\n t = gcd(t, a[i]);\n }\n return t;\n }",
"int t = a[0];",
"t",
"a[0]",
"a",
"0",
"for (int i = 1; i < a.length; i++) {\n t = gcd(t, a[i]);\n }",
"int i = 1;",
"int i = 1;",
"i",
"1",
"i < a.length",
"i",
"a.length",
"a",
"a.length",
"i++",
"i++",
"i",
"{\n t = gcd(t, a[i]);\n }",
"{\n t = gcd(t, a[i]);\n }",
"t = gcd(t, a[i])",
"t",
"gcd(t, a[i])",
"gcd",
"t",
"a[i]",
"a",
"i",
"return t;",
"t",
"int... a",
"a",
"static class LightWriter implements AutoCloseable {\n private final Writer out;\n private boolean autoflush = false;\n private boolean breaked = true;\n\n public LightWriter(Writer out) {\n this.out = out;\n }\n\n public LightWriter(OutputStream out) {\n this(new OutputStreamWriter(new BufferedOutputStream(out), Charset.defaultCharset()));\n }\n\n public LightWriter print(char c) {\n try {\n out.write(c);\n breaked = false;\n } catch (IOException ex) {\n throw new UncheckedIOException(ex);\n }\n return this;\n }\n\n public LightWriter print(String s) {\n try {\n out.write(s, 0, s.length());\n breaked = false;\n } catch (IOException ex) {\n throw new UncheckedIOException(ex);\n }\n return this;\n }\n\n public LightWriter ans(String s) {\n if (!breaked) {\n print(' ');\n }\n return print(s);\n }\n\n public LightWriter ans(long l) {\n return ans(Long.toString(l));\n }\n\n public LightWriter ln() {\n print(System.lineSeparator());\n breaked = true;\n if (autoflush) {\n try {\n out.flush();\n } catch (IOException ex) {\n throw new UncheckedIOException(ex);\n }\n }\n return this;\n }\n\n public void close() {\n try {\n out.close();\n } catch (IOException ex) {\n throw new UncheckedIOException(ex);\n }\n }\n\n }",
"LightWriter",
"private final Writer out;",
"out",
"private boolean autoflush = false;",
"autoflush",
"false",
"private boolean breaked = true;",
"breaked",
"true",
"public LightWriter(Writer out) {\n this.out = out;\n }",
"LightWriter",
"{\n this.out = out;\n }",
"this.out = out",
"this.out",
"this",
"this.out",
"out",
"Writer out",
"out",
"public LightWriter(OutputStream out) {\n this(new OutputStreamWriter(new BufferedOutputStream(out), Charset.defaultCharset()));\n }",
"LightWriter",
"{\n this(new OutputStreamWriter(new BufferedOutputStream(out), Charset.defaultCharset()));\n }",
"this(new OutputStreamWriter(new BufferedOutputStream(out), Charset.defaultCharset()))",
"this",
"new OutputStreamWriter(new BufferedOutputStream(out), Charset.defaultCharset())",
"OutputStream out",
"out",
"public LightWriter print(char c) {\n try {\n out.write(c);\n breaked = false;\n } catch (IOException ex) {\n throw new UncheckedIOException(ex);\n }\n return this;\n }",
"print",
"{\n try {\n out.write(c);\n breaked = false;\n } catch (IOException ex) {\n throw new UncheckedIOException(ex);\n }\n return this;\n }",
"try {\n out.write(c);\n breaked = false;\n } catch (IOException ex) {\n throw new UncheckedIOException(ex);\n }",
"catch (IOException ex) {\n throw new UncheckedIOException(ex);\n }",
"IOException ex",
"{\n throw new UncheckedIOException(ex);\n }",
"throw new UncheckedIOException(ex);",
"new UncheckedIOException(ex)",
"{\n out.write(c);\n breaked = false;\n }",
"out.write(c)",
"out.write",
"out",
"c",
"breaked = false",
"breaked",
"false",
"return this;",
"this",
"char c",
"c",
"public LightWriter print(String s) {\n try {\n out.write(s, 0, s.length());\n breaked = false;\n } catch (IOException ex) {\n throw new UncheckedIOException(ex);\n }\n return this;\n }",
"print",
"{\n try {\n out.write(s, 0, s.length());\n breaked = false;\n } catch (IOException ex) {\n throw new UncheckedIOException(ex);\n }\n return this;\n }",
"try {\n out.write(s, 0, s.length());\n breaked = false;\n } catch (IOException ex) {\n throw new UncheckedIOException(ex);\n }",
"catch (IOException ex) {\n throw new UncheckedIOException(ex);\n }",
"IOException ex",
"{\n throw new UncheckedIOException(ex);\n }",
"throw new UncheckedIOException(ex);",
"new UncheckedIOException(ex)",
"{\n out.write(s, 0, s.length());\n breaked = false;\n }",
"out.write(s, 0, s.length())",
"out.write",
"out",
"s",
"0",
"s.length()",
"s.length",
"s",
"breaked = false",
"breaked",
"false",
"return this;",
"this",
"String s",
"s",
"public LightWriter ans(String s) {\n if (!breaked) {\n print(' ');\n }\n return print(s);\n }",
"ans",
"{\n if (!breaked) {\n print(' ');\n }\n return print(s);\n }",
"if (!breaked) {\n print(' ');\n }",
"!breaked",
"breaked",
"{\n print(' ');\n }",
"print(' ')",
"print",
"' '",
"return print(s);",
"print(s)",
"print",
"s",
"String s",
"s",
"public LightWriter ans(long l) {\n return ans(Long.toString(l));\n }",
"ans",
"{\n return ans(Long.toString(l));\n }",
"return ans(Long.toString(l));",
"ans(Long.toString(l))",
"ans",
"Long.toString(l)",
"Long.toString",
"Long",
"l",
"long l",
"l",
"public LightWriter ln() {\n print(System.lineSeparator());\n breaked = true;\n if (autoflush) {\n try {\n out.flush();\n } catch (IOException ex) {\n throw new UncheckedIOException(ex);\n }\n }\n return this;\n }",
"ln",
"{\n print(System.lineSeparator());\n breaked = true;\n if (autoflush) {\n try {\n out.flush();\n } catch (IOException ex) {\n throw new UncheckedIOException(ex);\n }\n }\n return this;\n }",
"print(System.lineSeparator())",
"print",
"System.lineSeparator()",
"System.lineSeparator",
"System",
"breaked = true",
"breaked",
"true",
"if (autoflush) {\n try {\n out.flush();\n } catch (IOException ex) {\n throw new UncheckedIOException(ex);\n }\n }",
"autoflush",
"{\n try {\n out.flush();\n } catch (IOException ex) {\n throw new UncheckedIOException(ex);\n }\n }",
"try {\n out.flush();\n } catch (IOException ex) {\n throw new UncheckedIOException(ex);\n }",
"catch (IOException ex) {\n throw new UncheckedIOException(ex);\n }",
"IOException ex",
"{\n throw new UncheckedIOException(ex);\n }",
"throw new UncheckedIOException(ex);",
"new UncheckedIOException(ex)",
"{\n out.flush();\n }",
"out.flush()",
"out.flush",
"out",
"return this;",
"this",
"public void close() {\n try {\n out.close();\n } catch (IOException ex) {\n throw new UncheckedIOException(ex);\n }\n }",
"close",
"{\n try {\n out.close();\n } catch (IOException ex) {\n throw new UncheckedIOException(ex);\n }\n }",
"try {\n out.close();\n } catch (IOException ex) {\n throw new UncheckedIOException(ex);\n }",
"catch (IOException ex) {\n throw new UncheckedIOException(ex);\n }",
"IOException ex",
"{\n throw new UncheckedIOException(ex);\n }",
"throw new UncheckedIOException(ex);",
"new UncheckedIOException(ex)",
"{\n out.close();\n }",
"out.close()",
"out.close",
"out",
"AutoCloseable",
"static class LightScanner implements AutoCloseable {\n private BufferedReader reader = null;\n private StringTokenizer tokenizer = null;\n\n public LightScanner(InputStream in) {\n reader = new BufferedReader(new InputStreamReader(in));\n }\n\n public String string() {\n while (tokenizer == null || !tokenizer.hasMoreTokens()) {\n try {\n tokenizer = new StringTokenizer(reader.readLine());\n } catch (IOException e) {\n throw new UncheckedIOException(e);\n }\n }\n return tokenizer.nextToken();\n }\n\n public int ints() {\n return Integer.parseInt(string());\n }\n\n public void close() {\n try {\n this.reader.close();\n } catch (IOException ex) {\n throw new UncheckedIOException(ex);\n }\n }\n\n }",
"LightScanner",
"private BufferedReader reader = null;",
"reader",
"null",
"private StringTokenizer tokenizer = null;",
"tokenizer",
"null",
"public LightScanner(InputStream in) {\n reader = new BufferedReader(new InputStreamReader(in));\n }",
"LightScanner",
"{\n reader = new BufferedReader(new InputStreamReader(in));\n }",
"reader = new BufferedReader(new InputStreamReader(in))",
"reader",
"new BufferedReader(new InputStreamReader(in))",
"InputStream in",
"in",
"public String string() {\n while (tokenizer == null || !tokenizer.hasMoreTokens()) {\n try {\n tokenizer = new StringTokenizer(reader.readLine());\n } catch (IOException e) {\n throw new UncheckedIOException(e);\n }\n }\n return tokenizer.nextToken();\n }",
"string",
"{\n while (tokenizer == null || !tokenizer.hasMoreTokens()) {\n try {\n tokenizer = new StringTokenizer(reader.readLine());\n } catch (IOException e) {\n throw new UncheckedIOException(e);\n }\n }\n return tokenizer.nextToken();\n }",
"while (tokenizer == null || !tokenizer.hasMoreTokens()) {\n try {\n tokenizer = new StringTokenizer(reader.readLine());\n } catch (IOException e) {\n throw new UncheckedIOException(e);\n }\n }",
"tokenizer == null || !tokenizer.hasMoreTokens()",
"tokenizer == null",
"tokenizer",
"null",
"!tokenizer.hasMoreTokens()",
"tokenizer.hasMoreTokens()",
"tokenizer.hasMoreTokens",
"tokenizer",
"{\n try {\n tokenizer = new StringTokenizer(reader.readLine());\n } catch (IOException e) {\n throw new UncheckedIOException(e);\n }\n }",
"try {\n tokenizer = new StringTokenizer(reader.readLine());\n } catch (IOException e) {\n throw new UncheckedIOException(e);\n }",
"catch (IOException e) {\n throw new UncheckedIOException(e);\n }",
"IOException e",
"{\n throw new UncheckedIOException(e);\n }",
"throw new UncheckedIOException(e);",
"new UncheckedIOException(e)",
"{\n tokenizer = new StringTokenizer(reader.readLine());\n }",
"tokenizer = new StringTokenizer(reader.readLine())",
"tokenizer",
"new StringTokenizer(reader.readLine())",
"return tokenizer.nextToken();",
"tokenizer.nextToken()",
"tokenizer.nextToken",
"tokenizer",
"public int ints() {\n return Integer.parseInt(string());\n }",
"ints",
"{\n return Integer.parseInt(string());\n }",
"return Integer.parseInt(string());",
"Integer.parseInt(string())",
"Integer.parseInt",
"Integer",
"string()",
"string",
"public void close() {\n try {\n this.reader.close();\n } catch (IOException ex) {\n throw new UncheckedIOException(ex);\n }\n }",
"close",
"{\n try {\n this.reader.close();\n } catch (IOException ex) {\n throw new UncheckedIOException(ex);\n }\n }",
"try {\n this.reader.close();\n } catch (IOException ex) {\n throw new UncheckedIOException(ex);\n }",
"catch (IOException ex) {\n throw new UncheckedIOException(ex);\n }",
"IOException ex",
"{\n throw new UncheckedIOException(ex);\n }",
"throw new UncheckedIOException(ex);",
"new UncheckedIOException(ex)",
"{\n this.reader.close();\n }",
"this.reader.close()",
"this.reader.close",
"this.reader",
"this",
"this.reader",
"AutoCloseable",
"public class Main {\n public static void main(String[] args) {\n InputStream inputStream = System.in;\n OutputStream outputStream = System.out;\n LightScanner in = new LightScanner(inputStream);\n LightWriter out = new LightWriter(outputStream);\n CSumOfGcdOfTuplesEasy solver = new CSumOfGcdOfTuplesEasy();\n solver.solve(1, in, out);\n out.close();\n }\n\n static class CSumOfGcdOfTuplesEasy {\n public void solve(int testNumber, LightScanner in, LightWriter out) {\n int k = in.ints();\n long ans = 0;\n for (int i = 1; i <= k; i++) {\n for (int j = 1; j <= k; j++) {\n for (int l = 1; l <= k; l++) {\n ans += IntMath.gcd(i, j, l);\n }\n }\n }\n out.ans(ans).ln();\n }\n\n }\n\n static final class IntMath {\n private IntMath() {\n }\n\n public static int gcd(int a, int b) {\n int t;\n if (a == 0) return b;\n if (b == 0) return a;\n while (a % b > 0) {\n t = b;\n b = a % b;\n a = t;\n }\n return b;\n }\n\n public static int gcd(int... a) {\n int t = a[0];\n for (int i = 1; i < a.length; i++) {\n t = gcd(t, a[i]);\n }\n return t;\n }\n\n }\n\n static class LightWriter implements AutoCloseable {\n private final Writer out;\n private boolean autoflush = false;\n private boolean breaked = true;\n\n public LightWriter(Writer out) {\n this.out = out;\n }\n\n public LightWriter(OutputStream out) {\n this(new OutputStreamWriter(new BufferedOutputStream(out), Charset.defaultCharset()));\n }\n\n public LightWriter print(char c) {\n try {\n out.write(c);\n breaked = false;\n } catch (IOException ex) {\n throw new UncheckedIOException(ex);\n }\n return this;\n }\n\n public LightWriter print(String s) {\n try {\n out.write(s, 0, s.length());\n breaked = false;\n } catch (IOException ex) {\n throw new UncheckedIOException(ex);\n }\n return this;\n }\n\n public LightWriter ans(String s) {\n if (!breaked) {\n print(' ');\n }\n return print(s);\n }\n\n public LightWriter ans(long l) {\n return ans(Long.toString(l));\n }\n\n public LightWriter ln() {\n print(System.lineSeparator());\n breaked = true;\n if (autoflush) {\n try {\n out.flush();\n } catch (IOException ex) {\n throw new UncheckedIOException(ex);\n }\n }\n return this;\n }\n\n public void close() {\n try {\n out.close();\n } catch (IOException ex) {\n throw new UncheckedIOException(ex);\n }\n }\n\n }\n\n static class LightScanner implements AutoCloseable {\n private BufferedReader reader = null;\n private StringTokenizer tokenizer = null;\n\n public LightScanner(InputStream in) {\n reader = new BufferedReader(new InputStreamReader(in));\n }\n\n public String string() {\n while (tokenizer == null || !tokenizer.hasMoreTokens()) {\n try {\n tokenizer = new StringTokenizer(reader.readLine());\n } catch (IOException e) {\n throw new UncheckedIOException(e);\n }\n }\n return tokenizer.nextToken();\n }\n\n public int ints() {\n return Integer.parseInt(string());\n }\n\n public void close() {\n try {\n this.reader.close();\n } catch (IOException ex) {\n throw new UncheckedIOException(ex);\n }\n }\n\n }\n}",
"public class Main {\n public static void main(String[] args) {\n InputStream inputStream = System.in;\n OutputStream outputStream = System.out;\n LightScanner in = new LightScanner(inputStream);\n LightWriter out = new LightWriter(outputStream);\n CSumOfGcdOfTuplesEasy solver = new CSumOfGcdOfTuplesEasy();\n solver.solve(1, in, out);\n out.close();\n }\n\n static class CSumOfGcdOfTuplesEasy {\n public void solve(int testNumber, LightScanner in, LightWriter out) {\n int k = in.ints();\n long ans = 0;\n for (int i = 1; i <= k; i++) {\n for (int j = 1; j <= k; j++) {\n for (int l = 1; l <= k; l++) {\n ans += IntMath.gcd(i, j, l);\n }\n }\n }\n out.ans(ans).ln();\n }\n\n }\n\n static final class IntMath {\n private IntMath() {\n }\n\n public static int gcd(int a, int b) {\n int t;\n if (a == 0) return b;\n if (b == 0) return a;\n while (a % b > 0) {\n t = b;\n b = a % b;\n a = t;\n }\n return b;\n }\n\n public static int gcd(int... a) {\n int t = a[0];\n for (int i = 1; i < a.length; i++) {\n t = gcd(t, a[i]);\n }\n return t;\n }\n\n }\n\n static class LightWriter implements AutoCloseable {\n private final Writer out;\n private boolean autoflush = false;\n private boolean breaked = true;\n\n public LightWriter(Writer out) {\n this.out = out;\n }\n\n public LightWriter(OutputStream out) {\n this(new OutputStreamWriter(new BufferedOutputStream(out), Charset.defaultCharset()));\n }\n\n public LightWriter print(char c) {\n try {\n out.write(c);\n breaked = false;\n } catch (IOException ex) {\n throw new UncheckedIOException(ex);\n }\n return this;\n }\n\n public LightWriter print(String s) {\n try {\n out.write(s, 0, s.length());\n breaked = false;\n } catch (IOException ex) {\n throw new UncheckedIOException(ex);\n }\n return this;\n }\n\n public LightWriter ans(String s) {\n if (!breaked) {\n print(' ');\n }\n return print(s);\n }\n\n public LightWriter ans(long l) {\n return ans(Long.toString(l));\n }\n\n public LightWriter ln() {\n print(System.lineSeparator());\n breaked = true;\n if (autoflush) {\n try {\n out.flush();\n } catch (IOException ex) {\n throw new UncheckedIOException(ex);\n }\n }\n return this;\n }\n\n public void close() {\n try {\n out.close();\n } catch (IOException ex) {\n throw new UncheckedIOException(ex);\n }\n }\n\n }\n\n static class LightScanner implements AutoCloseable {\n private BufferedReader reader = null;\n private StringTokenizer tokenizer = null;\n\n public LightScanner(InputStream in) {\n reader = new BufferedReader(new InputStreamReader(in));\n }\n\n public String string() {\n while (tokenizer == null || !tokenizer.hasMoreTokens()) {\n try {\n tokenizer = new StringTokenizer(reader.readLine());\n } catch (IOException e) {\n throw new UncheckedIOException(e);\n }\n }\n return tokenizer.nextToken();\n }\n\n public int ints() {\n return Integer.parseInt(string());\n }\n\n public void close() {\n try {\n this.reader.close();\n } catch (IOException ex) {\n throw new UncheckedIOException(ex);\n }\n }\n\n }\n}",
"Main"
] |
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.BufferedOutputStream;
import java.io.UncheckedIOException;
import java.nio.charset.Charset;
import java.util.StringTokenizer;
import java.io.Writer;
import java.io.OutputStreamWriter;
import java.io.BufferedReader;
import java.io.InputStream;
/**
* Built using CHelper plug-in
* Actual solution is at the top
*
* @author mikit
*/
public class Main {
public static void main(String[] args) {
InputStream inputStream = System.in;
OutputStream outputStream = System.out;
LightScanner in = new LightScanner(inputStream);
LightWriter out = new LightWriter(outputStream);
CSumOfGcdOfTuplesEasy solver = new CSumOfGcdOfTuplesEasy();
solver.solve(1, in, out);
out.close();
}
static class CSumOfGcdOfTuplesEasy {
public void solve(int testNumber, LightScanner in, LightWriter out) {
int k = in.ints();
long ans = 0;
for (int i = 1; i <= k; i++) {
for (int j = 1; j <= k; j++) {
for (int l = 1; l <= k; l++) {
ans += IntMath.gcd(i, j, l);
}
}
}
out.ans(ans).ln();
}
}
static final class IntMath {
private IntMath() {
}
public static int gcd(int a, int b) {
int t;
if (a == 0) return b;
if (b == 0) return a;
while (a % b > 0) {
t = b;
b = a % b;
a = t;
}
return b;
}
public static int gcd(int... a) {
int t = a[0];
for (int i = 1; i < a.length; i++) {
t = gcd(t, a[i]);
}
return t;
}
}
static class LightWriter implements AutoCloseable {
private final Writer out;
private boolean autoflush = false;
private boolean breaked = true;
public LightWriter(Writer out) {
this.out = out;
}
public LightWriter(OutputStream out) {
this(new OutputStreamWriter(new BufferedOutputStream(out), Charset.defaultCharset()));
}
public LightWriter print(char c) {
try {
out.write(c);
breaked = false;
} catch (IOException ex) {
throw new UncheckedIOException(ex);
}
return this;
}
public LightWriter print(String s) {
try {
out.write(s, 0, s.length());
breaked = false;
} catch (IOException ex) {
throw new UncheckedIOException(ex);
}
return this;
}
public LightWriter ans(String s) {
if (!breaked) {
print(' ');
}
return print(s);
}
public LightWriter ans(long l) {
return ans(Long.toString(l));
}
public LightWriter ln() {
print(System.lineSeparator());
breaked = true;
if (autoflush) {
try {
out.flush();
} catch (IOException ex) {
throw new UncheckedIOException(ex);
}
}
return this;
}
public void close() {
try {
out.close();
} catch (IOException ex) {
throw new UncheckedIOException(ex);
}
}
}
static class LightScanner implements AutoCloseable {
private BufferedReader reader = null;
private StringTokenizer tokenizer = null;
public LightScanner(InputStream in) {
reader = new BufferedReader(new InputStreamReader(in));
}
public String string() {
while (tokenizer == null || !tokenizer.hasMoreTokens()) {
try {
tokenizer = new StringTokenizer(reader.readLine());
} catch (IOException e) {
throw new UncheckedIOException(e);
}
}
return tokenizer.nextToken();
}
public int ints() {
return Integer.parseInt(string());
}
public void close() {
try {
this.reader.close();
} catch (IOException ex) {
throw new UncheckedIOException(ex);
}
}
}
}
|
[
7,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
17,
41,
13,
20,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
14,
2,
13,
13,
30,
4,
18,
13,
4,
13,
13,
13,
30,
4,
18,
13,
4,
13,
13,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
11,
1,
41,
13,
17,
2,
13,
4,
18,
13,
1,
40,
13,
30,
30,
14,
2,
13,
4,
18,
13,
13,
30,
0,
13,
4,
13,
4,
18,
13,
13,
13,
30,
0,
13,
4,
13,
13,
4,
18,
13,
13,
4,
18,
18,
13,
13,
13,
23,
13,
12,
13,
30,
41,
13,
2,
13,
13,
14,
2,
13,
17,
30,
29,
4,
13,
13,
13,
29,
13,
23,
13,
23,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
9,
10
],
[
9,
11
],
[
11,
12
],
[
12,
13
],
[
12,
14
],
[
11,
15
],
[
15,
16
],
[
15,
17
],
[
17,
18
],
[
18,
19
],
[
11,
20
],
[
20,
21
],
[
20,
22
],
[
11,
23
],
[
23,
24
],
[
23,
25
],
[
11,
26
],
[
26,
27
],
[
27,
28
],
[
28,
29
],
[
28,
30
],
[
26,
31
],
[
31,
32
],
[
31,
33
],
[
26,
34
],
[
34,
35
],
[
35,
36
],
[
26,
37
],
[
38,
38
],
[
38,
39
],
[
39,
40
],
[
40,
41
],
[
41,
42
],
[
41,
43
],
[
39,
44
],
[
44,
45
],
[
44,
46
],
[
39,
47
],
[
47,
48
],
[
48,
49
],
[
39,
50
],
[
51,
51
],
[
51,
52
],
[
52,
53
],
[
53,
54
],
[
53,
55
],
[
52,
56
],
[
56,
57
],
[
57,
58
],
[
58,
59
],
[
57,
60
],
[
60,
61
],
[
60,
62
],
[
60,
63
],
[
52,
64
],
[
64,
65
],
[
65,
66
],
[
66,
67
],
[
65,
68
],
[
68,
69
],
[
68,
70
],
[
68,
71
],
[
11,
72
],
[
72,
73
],
[
73,
74
],
[
74,
75
],
[
74,
76
],
[
72,
77
],
[
77,
78
],
[
77,
79
],
[
72,
80
],
[
80,
81
],
[
81,
82
],
[
72,
83
],
[
84,
84
],
[
84,
85
],
[
85,
86
],
[
86,
87
],
[
87,
88
],
[
87,
89
],
[
85,
90
],
[
90,
91
],
[
90,
92
],
[
92,
93
],
[
93,
94
],
[
85,
95
],
[
95,
96
],
[
96,
97
],
[
85,
98
],
[
99,
99
],
[
99,
100
],
[
100,
101
],
[
101,
102
],
[
101,
103
],
[
103,
104
],
[
104,
105
],
[
103,
106
],
[
100,
107
],
[
107,
108
],
[
108,
109
],
[
108,
110
],
[
110,
111
],
[
110,
112
],
[
112,
113
],
[
113,
114
],
[
112,
115
],
[
110,
116
],
[
100,
117
],
[
117,
118
],
[
118,
119
],
[
118,
120
],
[
120,
121
],
[
120,
122
],
[
120,
123
],
[
123,
124
],
[
124,
125
],
[
123,
126
],
[
11,
127
],
[
127,
128
],
[
128,
129
],
[
129,
130
],
[
129,
131
],
[
127,
132
],
[
9,
133
],
[
133,
134
],
[
7,
135
],
[
135,
136
],
[
135,
137
],
[
137,
138
],
[
138,
139
],
[
138,
140
],
[
140,
141
],
[
140,
142
],
[
137,
143
],
[
143,
144
],
[
144,
145
],
[
144,
146
],
[
143,
147
],
[
147,
148
],
[
148,
149
],
[
149,
150
],
[
149,
151
],
[
149,
152
],
[
137,
153
],
[
153,
154
],
[
135,
155
],
[
155,
156
],
[
135,
157
],
[
157,
158
]
] |
[
"\nimport java.io.*;\nimport java.util.*;\n\nclass Main{\n\tpublic static void main(String[] args){\n\t\tScanner sc = new Scanner(System.in);\n\t\tint k = sc.nextInt();\n\t\tint sum = 0;\n\t\tArrayList<Integer> list = new ArrayList<Integer>();\n\t\tfor(int i=1;i<=k;i++){\n\t\t\tfor(int j=1;j<=k;j++){\n\t\t\t\tif (i < j){\n\t\t\t\t\tlist.add(gcd(j,i));\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tlist.add(gcd(i,j));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tfor(int i=1;i<=k;i++){\n\t\t\tfor(int j=0;j<list.size();j++){\n\t\t\t\tif (i < list.get(j)){\n\t\t\t\t\tsum += gcd(list.get(j), i);\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tsum += gcd(i, list.get(j));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(sum);\n\t}\n\n\tpublic static int gcd(int x, int y){\n\t\tint z = x%y;\n\t\tif(z!=0){\n\t\t\treturn gcd(y, z);\n\t\t}\n\t\treturn y;\n\t}\n}",
"import java.io.*;",
"io.*",
"java",
"import java.util.*;",
"util.*",
"java",
"class Main{\n\tpublic static void main(String[] args){\n\t\tScanner sc = new Scanner(System.in);\n\t\tint k = sc.nextInt();\n\t\tint sum = 0;\n\t\tArrayList<Integer> list = new ArrayList<Integer>();\n\t\tfor(int i=1;i<=k;i++){\n\t\t\tfor(int j=1;j<=k;j++){\n\t\t\t\tif (i < j){\n\t\t\t\t\tlist.add(gcd(j,i));\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tlist.add(gcd(i,j));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tfor(int i=1;i<=k;i++){\n\t\t\tfor(int j=0;j<list.size();j++){\n\t\t\t\tif (i < list.get(j)){\n\t\t\t\t\tsum += gcd(list.get(j), i);\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tsum += gcd(i, list.get(j));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(sum);\n\t}\n\n\tpublic static int gcd(int x, int y){\n\t\tint z = x%y;\n\t\tif(z!=0){\n\t\t\treturn gcd(y, z);\n\t\t}\n\t\treturn y;\n\t}\n}",
"Main",
"public static void main(String[] args){\n\t\tScanner sc = new Scanner(System.in);\n\t\tint k = sc.nextInt();\n\t\tint sum = 0;\n\t\tArrayList<Integer> list = new ArrayList<Integer>();\n\t\tfor(int i=1;i<=k;i++){\n\t\t\tfor(int j=1;j<=k;j++){\n\t\t\t\tif (i < j){\n\t\t\t\t\tlist.add(gcd(j,i));\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tlist.add(gcd(i,j));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tfor(int i=1;i<=k;i++){\n\t\t\tfor(int j=0;j<list.size();j++){\n\t\t\t\tif (i < list.get(j)){\n\t\t\t\t\tsum += gcd(list.get(j), i);\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tsum += gcd(i, list.get(j));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(sum);\n\t}",
"main",
"{\n\t\tScanner sc = new Scanner(System.in);\n\t\tint k = sc.nextInt();\n\t\tint sum = 0;\n\t\tArrayList<Integer> list = new ArrayList<Integer>();\n\t\tfor(int i=1;i<=k;i++){\n\t\t\tfor(int j=1;j<=k;j++){\n\t\t\t\tif (i < j){\n\t\t\t\t\tlist.add(gcd(j,i));\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tlist.add(gcd(i,j));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tfor(int i=1;i<=k;i++){\n\t\t\tfor(int j=0;j<list.size();j++){\n\t\t\t\tif (i < list.get(j)){\n\t\t\t\t\tsum += gcd(list.get(j), i);\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tsum += gcd(i, list.get(j));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(sum);\n\t}",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"int k = sc.nextInt();",
"k",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int sum = 0;",
"sum",
"0",
"ArrayList<Integer> list = new ArrayList<Integer>();",
"list",
"new ArrayList<Integer>()",
"for(int i=1;i<=k;i++){\n\t\t\tfor(int j=1;j<=k;j++){\n\t\t\t\tif (i < j){\n\t\t\t\t\tlist.add(gcd(j,i));\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tlist.add(gcd(i,j));\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"int i=1;",
"int i=1;",
"i",
"1",
"i<=k",
"i",
"k",
"i++",
"i++",
"i",
"{\n\t\t\tfor(int j=1;j<=k;j++){\n\t\t\t\tif (i < j){\n\t\t\t\t\tlist.add(gcd(j,i));\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tlist.add(gcd(i,j));\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"{\n\t\t\tfor(int j=1;j<=k;j++){\n\t\t\t\tif (i < j){\n\t\t\t\t\tlist.add(gcd(j,i));\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tlist.add(gcd(i,j));\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"for(int j=1;j<=k;j++){\n\t\t\t\tif (i < j){\n\t\t\t\t\tlist.add(gcd(j,i));\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tlist.add(gcd(i,j));\n\t\t\t\t}\n\t\t\t}",
"int j=1;",
"int j=1;",
"j",
"1",
"j<=k",
"j",
"k",
"j++",
"j++",
"j",
"{\n\t\t\t\tif (i < j){\n\t\t\t\t\tlist.add(gcd(j,i));\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tlist.add(gcd(i,j));\n\t\t\t\t}\n\t\t\t}",
"{\n\t\t\t\tif (i < j){\n\t\t\t\t\tlist.add(gcd(j,i));\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tlist.add(gcd(i,j));\n\t\t\t\t}\n\t\t\t}",
"if (i < j){\n\t\t\t\t\tlist.add(gcd(j,i));\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tlist.add(gcd(i,j));\n\t\t\t\t}",
"i < j",
"i",
"j",
"{\n\t\t\t\t\tlist.add(gcd(j,i));\n\t\t\t\t}",
"list.add(gcd(j,i))",
"list.add",
"list",
"gcd(j,i)",
"gcd",
"j",
"i",
"{\n\t\t\t\t\tlist.add(gcd(i,j));\n\t\t\t\t}",
"list.add(gcd(i,j))",
"list.add",
"list",
"gcd(i,j)",
"gcd",
"i",
"j",
"for(int i=1;i<=k;i++){\n\t\t\tfor(int j=0;j<list.size();j++){\n\t\t\t\tif (i < list.get(j)){\n\t\t\t\t\tsum += gcd(list.get(j), i);\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tsum += gcd(i, list.get(j));\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"int i=1;",
"int i=1;",
"i",
"1",
"i<=k",
"i",
"k",
"i++",
"i++",
"i",
"{\n\t\t\tfor(int j=0;j<list.size();j++){\n\t\t\t\tif (i < list.get(j)){\n\t\t\t\t\tsum += gcd(list.get(j), i);\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tsum += gcd(i, list.get(j));\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"{\n\t\t\tfor(int j=0;j<list.size();j++){\n\t\t\t\tif (i < list.get(j)){\n\t\t\t\t\tsum += gcd(list.get(j), i);\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tsum += gcd(i, list.get(j));\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"for(int j=0;j<list.size();j++){\n\t\t\t\tif (i < list.get(j)){\n\t\t\t\t\tsum += gcd(list.get(j), i);\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tsum += gcd(i, list.get(j));\n\t\t\t\t}\n\t\t\t}",
"int j=0;",
"int j=0;",
"j",
"0",
"j<list.size()",
"j",
"list.size()",
"list.size",
"list",
"j++",
"j++",
"j",
"{\n\t\t\t\tif (i < list.get(j)){\n\t\t\t\t\tsum += gcd(list.get(j), i);\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tsum += gcd(i, list.get(j));\n\t\t\t\t}\n\t\t\t}",
"{\n\t\t\t\tif (i < list.get(j)){\n\t\t\t\t\tsum += gcd(list.get(j), i);\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tsum += gcd(i, list.get(j));\n\t\t\t\t}\n\t\t\t}",
"if (i < list.get(j)){\n\t\t\t\t\tsum += gcd(list.get(j), i);\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tsum += gcd(i, list.get(j));\n\t\t\t\t}",
"i < list.get(j)",
"i",
"list.get(j)",
"list.get",
"list",
"j",
"{\n\t\t\t\t\tsum += gcd(list.get(j), i);\n\t\t\t\t}",
"sum += gcd(list.get(j), i)",
"sum",
"gcd(list.get(j), i)",
"gcd",
"list.get(j)",
"list.get",
"list",
"j",
"i",
"{\n\t\t\t\t\tsum += gcd(i, list.get(j));\n\t\t\t\t}",
"sum += gcd(i, list.get(j))",
"sum",
"gcd(i, list.get(j))",
"gcd",
"i",
"list.get(j)",
"list.get",
"list",
"j",
"System.out.println(sum)",
"System.out.println",
"System.out",
"System",
"System.out",
"sum",
"String[] args",
"args",
"public static int gcd(int x, int y){\n\t\tint z = x%y;\n\t\tif(z!=0){\n\t\t\treturn gcd(y, z);\n\t\t}\n\t\treturn y;\n\t}",
"gcd",
"{\n\t\tint z = x%y;\n\t\tif(z!=0){\n\t\t\treturn gcd(y, z);\n\t\t}\n\t\treturn y;\n\t}",
"int z = x%y;",
"z",
"x%y",
"x",
"y",
"if(z!=0){\n\t\t\treturn gcd(y, z);\n\t\t}",
"z!=0",
"z",
"0",
"{\n\t\t\treturn gcd(y, z);\n\t\t}",
"return gcd(y, z);",
"gcd(y, z)",
"gcd",
"y",
"z",
"return y;",
"y",
"int x",
"x",
"int y",
"y"
] |
import java.io.*;
import java.util.*;
class Main{
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
int k = sc.nextInt();
int sum = 0;
ArrayList<Integer> list = new ArrayList<Integer>();
for(int i=1;i<=k;i++){
for(int j=1;j<=k;j++){
if (i < j){
list.add(gcd(j,i));
}
else{
list.add(gcd(i,j));
}
}
}
for(int i=1;i<=k;i++){
for(int j=0;j<list.size();j++){
if (i < list.get(j)){
sum += gcd(list.get(j), i);
}
else{
sum += gcd(i, list.get(j));
}
}
}
System.out.println(sum);
}
public static int gcd(int x, int y){
int z = x%y;
if(z!=0){
return gcd(y, z);
}
return y;
}
}
|
[
7,
15,
13,
17,
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,
18,
13,
13,
41,
13,
18,
13,
13,
41,
13,
20,
41,
13,
20,
41,
13,
20,
4,
18,
13,
17,
13,
13,
4,
18,
13,
23,
13,
6,
13,
12,
13,
30,
41,
13,
4,
18,
13,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
41,
13,
4,
18,
18,
13,
13,
13,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
4,
18,
18,
13,
13,
13,
13,
4,
18,
13,
13,
23,
13,
23,
13,
23,
13,
6,
13,
12,
13,
30,
14,
2,
13,
17,
30,
29,
13,
29,
4,
13,
13,
2,
13,
13,
23,
13,
23,
13,
6,
13,
41,
13,
41,
13,
20,
17,
41,
13,
41,
13,
41,
13,
12,
13,
30,
0,
18,
36,
13,
13,
23,
13,
12,
13,
30,
14,
2,
13,
40,
17,
30,
37,
20,
14,
2,
13,
13,
30,
0,
13,
17,
38,
5,
13,
30,
37,
20,
30,
0,
13,
4,
18,
13,
13,
14,
2,
13,
17,
30,
29,
40,
17,
29,
18,
13,
40,
13,
12,
13,
30,
41,
13,
4,
13,
42,
4,
13,
13,
30,
0,
13,
4,
13,
41,
13,
17,
14,
2,
13,
17,
30,
0,
13,
40,
17,
0,
13,
4,
13,
41,
13,
17,
42,
40,
4,
13,
13,
30,
14,
2,
2,
13,
17,
2,
13,
17,
30,
37,
20,
0,
13,
17,
0,
13,
2,
13,
17,
0,
13,
4,
13,
29,
2,
13,
13,
12,
13,
30,
14,
2,
13,
17,
30,
29,
4,
18,
13,
13,
29,
4,
13,
13,
23,
13,
12,
13,
30,
29,
2,
2,
2,
2,
2,
13,
17,
2,
13,
17,
2,
13,
17,
2,
13,
17,
2,
13,
40,
17,
23,
13,
6,
13,
12,
13,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
10,
11
],
[
10,
12
],
[
0,
13
],
[
13,
14
],
[
13,
15
],
[
0,
16
],
[
16,
17
],
[
16,
18
],
[
0,
19
],
[
19,
20
],
[
19,
21
],
[
0,
22
],
[
349,
23
],
[
349,
24
],
[
24,
25
],
[
24,
26
],
[
26,
27
],
[
27,
28
],
[
27,
29
],
[
29,
30
],
[
29,
31
],
[
26,
32
],
[
32,
33
],
[
32,
34
],
[
34,
35
],
[
34,
36
],
[
26,
37
],
[
37,
38
],
[
37,
39
],
[
26,
40
],
[
40,
41
],
[
40,
42
],
[
26,
43
],
[
43,
44
],
[
43,
45
],
[
26,
46
],
[
46,
47
],
[
47,
48
],
[
46,
49
],
[
46,
50
],
[
46,
51
],
[
26,
52
],
[
52,
53
],
[
53,
54
],
[
24,
55
],
[
55,
56
],
[
349,
57
],
[
57,
58
],
[
57,
59
],
[
59,
60
],
[
59,
61
],
[
61,
62
],
[
62,
63
],
[
62,
64
],
[
64,
65
],
[
65,
66
],
[
61,
67
],
[
67,
68
],
[
67,
69
],
[
61,
70
],
[
70,
71
],
[
71,
72
],
[
72,
73
],
[
72,
74
],
[
70,
75
],
[
75,
76
],
[
75,
77
],
[
70,
78
],
[
78,
79
],
[
79,
80
],
[
70,
81
],
[
82,
82
],
[
82,
83
],
[
83,
84
],
[
84,
85
],
[
85,
86
],
[
85,
87
],
[
83,
88
],
[
88,
89
],
[
88,
90
],
[
83,
91
],
[
91,
92
],
[
92,
93
],
[
83,
94
],
[
95,
95
],
[
95,
96
],
[
96,
97
],
[
96,
98
],
[
98,
99
],
[
99,
100
],
[
100,
101
],
[
100,
102
],
[
98,
103
],
[
98,
104
],
[
95,
105
],
[
105,
106
],
[
106,
107
],
[
107,
108
],
[
107,
109
],
[
105,
110
],
[
110,
111
],
[
110,
112
],
[
105,
113
],
[
113,
114
],
[
114,
115
],
[
105,
116
],
[
117,
117
],
[
117,
118
],
[
118,
119
],
[
118,
120
],
[
120,
121
],
[
121,
122
],
[
122,
123
],
[
122,
124
],
[
120,
125
],
[
120,
126
],
[
61,
127
],
[
127,
128
],
[
128,
129
],
[
127,
130
],
[
59,
131
],
[
131,
132
],
[
59,
133
],
[
133,
134
],
[
59,
135
],
[
135,
136
],
[
57,
137
],
[
137,
138
],
[
137,
139
],
[
139,
140
],
[
139,
141
],
[
141,
142
],
[
142,
143
],
[
143,
144
],
[
143,
145
],
[
142,
146
],
[
146,
147
],
[
147,
148
],
[
141,
149
],
[
149,
150
],
[
150,
151
],
[
150,
152
],
[
150,
153
],
[
153,
154
],
[
153,
155
],
[
139,
156
],
[
156,
157
],
[
139,
158
],
[
158,
159
],
[
349,
160
],
[
160,
161
],
[
160,
162
],
[
162,
163
],
[
160,
164
],
[
164,
165
],
[
164,
166
],
[
160,
168
],
[
168,
169
],
[
160,
170
],
[
170,
171
],
[
160,
172
],
[
172,
173
],
[
160,
174
],
[
174,
175
],
[
174,
176
],
[
176,
177
],
[
177,
178
],
[
178,
179
],
[
178,
180
],
[
177,
181
],
[
174,
182
],
[
182,
183
],
[
160,
184
],
[
184,
185
],
[
184,
186
],
[
186,
187
],
[
187,
188
],
[
188,
189
],
[
188,
190
],
[
190,
191
],
[
187,
192
],
[
192,
193
],
[
193,
194
],
[
186,
195
],
[
195,
196
],
[
196,
197
],
[
196,
198
],
[
195,
199
],
[
199,
200
],
[
200,
201
],
[
200,
202
],
[
199,
203
],
[
203,
204
],
[
204,
205
],
[
204,
206
],
[
206,
207
],
[
207,
208
],
[
203,
209
],
[
209,
210
],
[
210,
211
],
[
210,
212
],
[
212,
213
],
[
213,
214
],
[
212,
215
],
[
199,
216
],
[
216,
217
],
[
217,
218
],
[
217,
219
],
[
216,
220
],
[
220,
221
],
[
221,
222
],
[
222,
223
],
[
186,
224
],
[
224,
225
],
[
225,
226
],
[
225,
227
],
[
227,
228
],
[
160,
229
],
[
229,
230
],
[
229,
231
],
[
231,
232
],
[
232,
233
],
[
232,
234
],
[
234,
235
],
[
231,
236
],
[
236,
237
],
[
237,
238
],
[
237,
239
],
[
236,
240
],
[
240,
241
],
[
241,
242
],
[
241,
243
],
[
243,
244
],
[
231,
245
],
[
245,
246
],
[
245,
247
],
[
231,
248
],
[
248,
249
],
[
249,
250
],
[
249,
251
],
[
248,
252
],
[
252,
253
],
[
253,
254
],
[
253,
255
],
[
255,
256
],
[
252,
257
],
[
257,
258
],
[
257,
259
],
[
259,
260
],
[
231,
261
],
[
261,
262
],
[
261,
263
],
[
231,
264
],
[
264,
265
],
[
265,
266
],
[
266,
267
],
[
266,
268
],
[
264,
269
],
[
269,
270
],
[
270,
271
],
[
271,
272
],
[
272,
273
],
[
272,
274
],
[
271,
275
],
[
275,
276
],
[
275,
277
],
[
270,
278
],
[
278,
279
],
[
279,
280
],
[
269,
281
],
[
281,
282
],
[
281,
283
],
[
269,
284
],
[
284,
285
],
[
284,
286
],
[
286,
287
],
[
286,
288
],
[
269,
289
],
[
289,
290
],
[
289,
291
],
[
291,
292
],
[
231,
293
],
[
293,
294
],
[
294,
295
],
[
294,
296
],
[
160,
297
],
[
297,
298
],
[
297,
299
],
[
299,
300
],
[
300,
301
],
[
301,
302
],
[
301,
303
],
[
300,
304
],
[
304,
305
],
[
305,
306
],
[
306,
307
],
[
307,
308
],
[
306,
309
],
[
299,
310
],
[
310,
311
],
[
311,
312
],
[
311,
313
],
[
297,
314
],
[
314,
315
],
[
160,
316
],
[
316,
317
],
[
316,
318
],
[
318,
319
],
[
319,
320
],
[
323,
321
],
[
333,
322
],
[
330,
323
],
[
323,
324
],
[
324,
325
],
[
324,
326
],
[
323,
327
],
[
327,
328
],
[
327,
329
],
[
330,
330
],
[
330,
331
],
[
330,
332
],
[
333,
333
],
[
333,
334
],
[
333,
335
],
[
323,
336
],
[
336,
337
],
[
336,
338
],
[
338,
339
],
[
316,
340
],
[
340,
341
],
[
160,
342
],
[
342,
343
],
[
342,
344
],
[
344,
345
],
[
344,
346
],
[
346,
347
],
[
0,
348
],
[
348,
349
],
[
348,
350
]
] |
[
"import java.io.OutputStream;\nimport java.io.IOException;\nimport java.io.InputStream;\nimport java.io.PrintWriter;\nimport java.util.InputMismatchException;\nimport java.io.IOException;\nimport java.io.InputStream;\n\n/**\n * Built using CHelper plug-in\n * Actual solution is at the top\n */\npublic class Main {\n public static void main(String[] args) {\n InputStream inputStream = System.in;\n OutputStream outputStream = System.out;\n FastReader in = new FastReader(inputStream);\n PrintWriter out = new PrintWriter(outputStream);\n CSumOfGcdOfTuplesEasy solver = new CSumOfGcdOfTuplesEasy();\n solver.solve(1, in, out);\n out.close();\n }\n\n static class CSumOfGcdOfTuplesEasy {\n public void solve(int testNumber, FastReader s, PrintWriter out) {\n int k = s.nextInt();\n long ans = 0l;\n for (int i = 1; i <= k; i++) {\n for (int j = 1; j <= k; j++) {\n long gcd1 = CSumOfGcdOfTuplesEasy.Maths.gcd(i, j);\n for (int l = 1; l <= k; l++) {\n ans += CSumOfGcdOfTuplesEasy.Maths.gcd(gcd1, l);\n }\n }\n }\n\n out.println(ans);\n }\n\n private static class Maths {\n private static long gcd(long a, long b) {\n if (b == 0) {\n return a;\n }\n\n return gcd(b, a % b);\n }\n\n }\n\n }\n\n static class FastReader {\n private InputStream stream;\n private byte[] buf = new byte[1024];\n private int curChar;\n private int numChars;\n private FastReader.SpaceCharFilter filter;\n\n public FastReader(InputStream stream) {\n this.stream = stream;\n }\n\n public int read() {\n if (numChars == -1) {\n throw new InputMismatchException();\n }\n if (curChar >= numChars) {\n curChar = 0;\n try {\n numChars = stream.read(buf);\n } catch (IOException e) {\n throw new InputMismatchException();\n }\n if (numChars <= 0) {\n return -1;\n }\n }\n return buf[curChar++];\n }\n\n public int nextInt() {\n int c = read();\n while (isSpaceChar(c)) {\n c = read();\n }\n int sgn = 1;\n if (c == '-') {\n sgn = -1;\n c = read();\n }\n int res = 0;\n do {\n if (c < '0' || c > '9') {\n throw new InputMismatchException();\n }\n res *= 10;\n res += c - '0';\n c = read();\n } while (!isSpaceChar(c));\n return res * sgn;\n }\n\n public boolean isSpaceChar(int c) {\n if (filter != null) {\n return filter.isSpaceChar(c);\n }\n return isWhitespace(c);\n }\n\n public static boolean isWhitespace(int c) {\n return c == ' ' || c == '\\n' || c == '\\r' || c == '\\t' || c == -1;\n }\n\n public interface SpaceCharFilter {\n public boolean isSpaceChar(int ch);\n\n }\n\n }\n}\n",
"import java.io.OutputStream;",
"OutputStream",
"java.io",
"import java.io.IOException;",
"IOException",
"java.io",
"import java.io.InputStream;",
"InputStream",
"java.io",
"import java.io.PrintWriter;",
"PrintWriter",
"java.io",
"import java.util.InputMismatchException;",
"InputMismatchException",
"java.util",
"import java.io.IOException;",
"IOException",
"java.io",
"import java.io.InputStream;",
"InputStream",
"java.io",
"public class Main {\n public static void main(String[] args) {\n InputStream inputStream = System.in;\n OutputStream outputStream = System.out;\n FastReader in = new FastReader(inputStream);\n PrintWriter out = new PrintWriter(outputStream);\n CSumOfGcdOfTuplesEasy solver = new CSumOfGcdOfTuplesEasy();\n solver.solve(1, in, out);\n out.close();\n }\n\n static class CSumOfGcdOfTuplesEasy {\n public void solve(int testNumber, FastReader s, PrintWriter out) {\n int k = s.nextInt();\n long ans = 0l;\n for (int i = 1; i <= k; i++) {\n for (int j = 1; j <= k; j++) {\n long gcd1 = CSumOfGcdOfTuplesEasy.Maths.gcd(i, j);\n for (int l = 1; l <= k; l++) {\n ans += CSumOfGcdOfTuplesEasy.Maths.gcd(gcd1, l);\n }\n }\n }\n\n out.println(ans);\n }\n\n private static class Maths {\n private static long gcd(long a, long b) {\n if (b == 0) {\n return a;\n }\n\n return gcd(b, a % b);\n }\n\n }\n\n }\n\n static class FastReader {\n private InputStream stream;\n private byte[] buf = new byte[1024];\n private int curChar;\n private int numChars;\n private FastReader.SpaceCharFilter filter;\n\n public FastReader(InputStream stream) {\n this.stream = stream;\n }\n\n public int read() {\n if (numChars == -1) {\n throw new InputMismatchException();\n }\n if (curChar >= numChars) {\n curChar = 0;\n try {\n numChars = stream.read(buf);\n } catch (IOException e) {\n throw new InputMismatchException();\n }\n if (numChars <= 0) {\n return -1;\n }\n }\n return buf[curChar++];\n }\n\n public int nextInt() {\n int c = read();\n while (isSpaceChar(c)) {\n c = read();\n }\n int sgn = 1;\n if (c == '-') {\n sgn = -1;\n c = read();\n }\n int res = 0;\n do {\n if (c < '0' || c > '9') {\n throw new InputMismatchException();\n }\n res *= 10;\n res += c - '0';\n c = read();\n } while (!isSpaceChar(c));\n return res * sgn;\n }\n\n public boolean isSpaceChar(int c) {\n if (filter != null) {\n return filter.isSpaceChar(c);\n }\n return isWhitespace(c);\n }\n\n public static boolean isWhitespace(int c) {\n return c == ' ' || c == '\\n' || c == '\\r' || c == '\\t' || c == -1;\n }\n\n public interface SpaceCharFilter {\n public boolean isSpaceChar(int ch);\n\n }\n\n }\n}",
"Main",
"public static void main(String[] args) {\n InputStream inputStream = System.in;\n OutputStream outputStream = System.out;\n FastReader in = new FastReader(inputStream);\n PrintWriter out = new PrintWriter(outputStream);\n CSumOfGcdOfTuplesEasy solver = new CSumOfGcdOfTuplesEasy();\n solver.solve(1, in, out);\n out.close();\n }",
"main",
"{\n InputStream inputStream = System.in;\n OutputStream outputStream = System.out;\n FastReader in = new FastReader(inputStream);\n PrintWriter out = new PrintWriter(outputStream);\n CSumOfGcdOfTuplesEasy solver = new CSumOfGcdOfTuplesEasy();\n solver.solve(1, in, out);\n out.close();\n }",
"InputStream inputStream = System.in;",
"inputStream",
"System.in",
"System",
"System.in",
"OutputStream outputStream = System.out;",
"outputStream",
"System.out",
"System",
"System.out",
"FastReader in = new FastReader(inputStream);",
"in",
"new FastReader(inputStream)",
"PrintWriter out = new PrintWriter(outputStream);",
"out",
"new PrintWriter(outputStream)",
"CSumOfGcdOfTuplesEasy solver = new CSumOfGcdOfTuplesEasy();",
"solver",
"new CSumOfGcdOfTuplesEasy()",
"solver.solve(1, in, out)",
"solver.solve",
"solver",
"1",
"in",
"out",
"out.close()",
"out.close",
"out",
"String[] args",
"args",
"static class CSumOfGcdOfTuplesEasy {\n public void solve(int testNumber, FastReader s, PrintWriter out) {\n int k = s.nextInt();\n long ans = 0l;\n for (int i = 1; i <= k; i++) {\n for (int j = 1; j <= k; j++) {\n long gcd1 = CSumOfGcdOfTuplesEasy.Maths.gcd(i, j);\n for (int l = 1; l <= k; l++) {\n ans += CSumOfGcdOfTuplesEasy.Maths.gcd(gcd1, l);\n }\n }\n }\n\n out.println(ans);\n }\n\n private static class Maths {\n private static long gcd(long a, long b) {\n if (b == 0) {\n return a;\n }\n\n return gcd(b, a % b);\n }\n\n }\n\n }",
"CSumOfGcdOfTuplesEasy",
"public void solve(int testNumber, FastReader s, PrintWriter out) {\n int k = s.nextInt();\n long ans = 0l;\n for (int i = 1; i <= k; i++) {\n for (int j = 1; j <= k; j++) {\n long gcd1 = CSumOfGcdOfTuplesEasy.Maths.gcd(i, j);\n for (int l = 1; l <= k; l++) {\n ans += CSumOfGcdOfTuplesEasy.Maths.gcd(gcd1, l);\n }\n }\n }\n\n out.println(ans);\n }",
"solve",
"{\n int k = s.nextInt();\n long ans = 0l;\n for (int i = 1; i <= k; i++) {\n for (int j = 1; j <= k; j++) {\n long gcd1 = CSumOfGcdOfTuplesEasy.Maths.gcd(i, j);\n for (int l = 1; l <= k; l++) {\n ans += CSumOfGcdOfTuplesEasy.Maths.gcd(gcd1, l);\n }\n }\n }\n\n out.println(ans);\n }",
"int k = s.nextInt();",
"k",
"s.nextInt()",
"s.nextInt",
"s",
"long ans = 0l;",
"ans",
"0l",
"for (int i = 1; i <= k; i++) {\n for (int j = 1; j <= k; j++) {\n long gcd1 = CSumOfGcdOfTuplesEasy.Maths.gcd(i, j);\n for (int l = 1; l <= k; l++) {\n ans += CSumOfGcdOfTuplesEasy.Maths.gcd(gcd1, l);\n }\n }\n }",
"int i = 1;",
"int i = 1;",
"i",
"1",
"i <= k",
"i",
"k",
"i++",
"i++",
"i",
"{\n for (int j = 1; j <= k; j++) {\n long gcd1 = CSumOfGcdOfTuplesEasy.Maths.gcd(i, j);\n for (int l = 1; l <= k; l++) {\n ans += CSumOfGcdOfTuplesEasy.Maths.gcd(gcd1, l);\n }\n }\n }",
"{\n for (int j = 1; j <= k; j++) {\n long gcd1 = CSumOfGcdOfTuplesEasy.Maths.gcd(i, j);\n for (int l = 1; l <= k; l++) {\n ans += CSumOfGcdOfTuplesEasy.Maths.gcd(gcd1, l);\n }\n }\n }",
"for (int j = 1; j <= k; j++) {\n long gcd1 = CSumOfGcdOfTuplesEasy.Maths.gcd(i, j);\n for (int l = 1; l <= k; l++) {\n ans += CSumOfGcdOfTuplesEasy.Maths.gcd(gcd1, l);\n }\n }",
"int j = 1;",
"int j = 1;",
"j",
"1",
"j <= k",
"j",
"k",
"j++",
"j++",
"j",
"{\n long gcd1 = CSumOfGcdOfTuplesEasy.Maths.gcd(i, j);\n for (int l = 1; l <= k; l++) {\n ans += CSumOfGcdOfTuplesEasy.Maths.gcd(gcd1, l);\n }\n }",
"{\n long gcd1 = CSumOfGcdOfTuplesEasy.Maths.gcd(i, j);\n for (int l = 1; l <= k; l++) {\n ans += CSumOfGcdOfTuplesEasy.Maths.gcd(gcd1, l);\n }\n }",
"long gcd1 = CSumOfGcdOfTuplesEasy.Maths.gcd(i, j);",
"gcd1",
"CSumOfGcdOfTuplesEasy.Maths.gcd(i, j)",
"CSumOfGcdOfTuplesEasy.Maths.gcd",
"CSumOfGcdOfTuplesEasy.Maths",
"CSumOfGcdOfTuplesEasy",
"CSumOfGcdOfTuplesEasy.Maths",
"i",
"j",
"for (int l = 1; l <= k; l++) {\n ans += CSumOfGcdOfTuplesEasy.Maths.gcd(gcd1, l);\n }",
"int l = 1;",
"int l = 1;",
"l",
"1",
"l <= k",
"l",
"k",
"l++",
"l++",
"l",
"{\n ans += CSumOfGcdOfTuplesEasy.Maths.gcd(gcd1, l);\n }",
"{\n ans += CSumOfGcdOfTuplesEasy.Maths.gcd(gcd1, l);\n }",
"ans += CSumOfGcdOfTuplesEasy.Maths.gcd(gcd1, l)",
"ans",
"CSumOfGcdOfTuplesEasy.Maths.gcd(gcd1, l)",
"CSumOfGcdOfTuplesEasy.Maths.gcd",
"CSumOfGcdOfTuplesEasy.Maths",
"CSumOfGcdOfTuplesEasy",
"CSumOfGcdOfTuplesEasy.Maths",
"gcd1",
"l",
"out.println(ans)",
"out.println",
"out",
"ans",
"int testNumber",
"testNumber",
"FastReader s",
"s",
"PrintWriter out",
"out",
"private static class Maths {\n private static long gcd(long a, long b) {\n if (b == 0) {\n return a;\n }\n\n return gcd(b, a % b);\n }\n\n }",
"Maths",
"private static long gcd(long a, long b) {\n if (b == 0) {\n return a;\n }\n\n return gcd(b, a % b);\n }",
"gcd",
"{\n if (b == 0) {\n return a;\n }\n\n return gcd(b, a % b);\n }",
"if (b == 0) {\n return a;\n }",
"b == 0",
"b",
"0",
"{\n return a;\n }",
"return a;",
"a",
"return gcd(b, a % b);",
"gcd(b, a % b)",
"gcd",
"b",
"a % b",
"a",
"b",
"long a",
"a",
"long b",
"b",
"static class FastReader {\n private InputStream stream;\n private byte[] buf = new byte[1024];\n private int curChar;\n private int numChars;\n private FastReader.SpaceCharFilter filter;\n\n public FastReader(InputStream stream) {\n this.stream = stream;\n }\n\n public int read() {\n if (numChars == -1) {\n throw new InputMismatchException();\n }\n if (curChar >= numChars) {\n curChar = 0;\n try {\n numChars = stream.read(buf);\n } catch (IOException e) {\n throw new InputMismatchException();\n }\n if (numChars <= 0) {\n return -1;\n }\n }\n return buf[curChar++];\n }\n\n public int nextInt() {\n int c = read();\n while (isSpaceChar(c)) {\n c = read();\n }\n int sgn = 1;\n if (c == '-') {\n sgn = -1;\n c = read();\n }\n int res = 0;\n do {\n if (c < '0' || c > '9') {\n throw new InputMismatchException();\n }\n res *= 10;\n res += c - '0';\n c = read();\n } while (!isSpaceChar(c));\n return res * sgn;\n }\n\n public boolean isSpaceChar(int c) {\n if (filter != null) {\n return filter.isSpaceChar(c);\n }\n return isWhitespace(c);\n }\n\n public static boolean isWhitespace(int c) {\n return c == ' ' || c == '\\n' || c == '\\r' || c == '\\t' || c == -1;\n }\n\n public interface SpaceCharFilter {\n public boolean isSpaceChar(int ch);\n\n }\n\n }",
"FastReader",
"private InputStream stream;",
"stream",
"private byte[] buf = new byte[1024];",
"buf",
"new byte[1024]",
"1024",
"private int curChar;",
"curChar",
"private int numChars;",
"numChars",
"private FastReader.SpaceCharFilter filter;",
"filter",
"public FastReader(InputStream stream) {\n this.stream = stream;\n }",
"FastReader",
"{\n this.stream = stream;\n }",
"this.stream = stream",
"this.stream",
"this",
"this.stream",
"stream",
"InputStream stream",
"stream",
"public int read() {\n if (numChars == -1) {\n throw new InputMismatchException();\n }\n if (curChar >= numChars) {\n curChar = 0;\n try {\n numChars = stream.read(buf);\n } catch (IOException e) {\n throw new InputMismatchException();\n }\n if (numChars <= 0) {\n return -1;\n }\n }\n return buf[curChar++];\n }",
"read",
"{\n if (numChars == -1) {\n throw new InputMismatchException();\n }\n if (curChar >= numChars) {\n curChar = 0;\n try {\n numChars = stream.read(buf);\n } catch (IOException e) {\n throw new InputMismatchException();\n }\n if (numChars <= 0) {\n return -1;\n }\n }\n return buf[curChar++];\n }",
"if (numChars == -1) {\n throw new InputMismatchException();\n }",
"numChars == -1",
"numChars",
"-1",
"1",
"{\n throw new InputMismatchException();\n }",
"throw new InputMismatchException();",
"new InputMismatchException()",
"if (curChar >= numChars) {\n curChar = 0;\n try {\n numChars = stream.read(buf);\n } catch (IOException e) {\n throw new InputMismatchException();\n }\n if (numChars <= 0) {\n return -1;\n }\n }",
"curChar >= numChars",
"curChar",
"numChars",
"{\n curChar = 0;\n try {\n numChars = stream.read(buf);\n } catch (IOException e) {\n throw new InputMismatchException();\n }\n if (numChars <= 0) {\n return -1;\n }\n }",
"curChar = 0",
"curChar",
"0",
"try {\n numChars = stream.read(buf);\n } catch (IOException e) {\n throw new InputMismatchException();\n }",
"catch (IOException e) {\n throw new InputMismatchException();\n }",
"IOException e",
"{\n throw new InputMismatchException();\n }",
"throw new InputMismatchException();",
"new InputMismatchException()",
"{\n numChars = stream.read(buf);\n }",
"numChars = stream.read(buf)",
"numChars",
"stream.read(buf)",
"stream.read",
"stream",
"buf",
"if (numChars <= 0) {\n return -1;\n }",
"numChars <= 0",
"numChars",
"0",
"{\n return -1;\n }",
"return -1;",
"-1",
"1",
"return buf[curChar++];",
"buf[curChar++]",
"buf",
"curChar++",
"curChar",
"public int nextInt() {\n int c = read();\n while (isSpaceChar(c)) {\n c = read();\n }\n int sgn = 1;\n if (c == '-') {\n sgn = -1;\n c = read();\n }\n int res = 0;\n do {\n if (c < '0' || c > '9') {\n throw new InputMismatchException();\n }\n res *= 10;\n res += c - '0';\n c = read();\n } while (!isSpaceChar(c));\n return res * sgn;\n }",
"nextInt",
"{\n int c = read();\n while (isSpaceChar(c)) {\n c = read();\n }\n int sgn = 1;\n if (c == '-') {\n sgn = -1;\n c = read();\n }\n int res = 0;\n do {\n if (c < '0' || c > '9') {\n throw new InputMismatchException();\n }\n res *= 10;\n res += c - '0';\n c = read();\n } while (!isSpaceChar(c));\n return res * sgn;\n }",
"int c = read();",
"c",
"read()",
"read",
"while (isSpaceChar(c)) {\n c = read();\n }",
"isSpaceChar(c)",
"isSpaceChar",
"c",
"{\n c = read();\n }",
"c = read()",
"c",
"read()",
"read",
"int sgn = 1;",
"sgn",
"1",
"if (c == '-') {\n sgn = -1;\n c = read();\n }",
"c == '-'",
"c",
"'-'",
"{\n sgn = -1;\n c = read();\n }",
"sgn = -1",
"sgn",
"-1",
"1",
"c = read()",
"c",
"read()",
"read",
"int res = 0;",
"res",
"0",
"do {\n if (c < '0' || c > '9') {\n throw new InputMismatchException();\n }\n res *= 10;\n res += c - '0';\n c = read();\n } while (!isSpaceChar(c));",
"!isSpaceChar(c)",
"isSpaceChar(c)",
"isSpaceChar",
"c",
"{\n if (c < '0' || c > '9') {\n throw new InputMismatchException();\n }\n res *= 10;\n res += c - '0';\n c = read();\n }",
"if (c < '0' || c > '9') {\n throw new InputMismatchException();\n }",
"c < '0' || c > '9'",
"c < '0'",
"c",
"'0'",
"c > '9'",
"c",
"'9'",
"{\n throw new InputMismatchException();\n }",
"throw new InputMismatchException();",
"new InputMismatchException()",
"res *= 10",
"res",
"10",
"res += c - '0'",
"res",
"c - '0'",
"c",
"'0'",
"c = read()",
"c",
"read()",
"read",
"return res * sgn;",
"res * sgn",
"res",
"sgn",
"public boolean isSpaceChar(int c) {\n if (filter != null) {\n return filter.isSpaceChar(c);\n }\n return isWhitespace(c);\n }",
"isSpaceChar",
"{\n if (filter != null) {\n return filter.isSpaceChar(c);\n }\n return isWhitespace(c);\n }",
"if (filter != null) {\n return filter.isSpaceChar(c);\n }",
"filter != null",
"filter",
"null",
"{\n return filter.isSpaceChar(c);\n }",
"return filter.isSpaceChar(c);",
"filter.isSpaceChar(c)",
"filter.isSpaceChar",
"filter",
"c",
"return isWhitespace(c);",
"isWhitespace(c)",
"isWhitespace",
"c",
"int c",
"c",
"public static boolean isWhitespace(int c) {\n return c == ' ' || c == '\\n' || c == '\\r' || c == '\\t' || c == -1;\n }",
"isWhitespace",
"{\n return c == ' ' || c == '\\n' || c == '\\r' || c == '\\t' || c == -1;\n }",
"return c == ' ' || c == '\\n' || c == '\\r' || c == '\\t' || c == -1;",
"c == ' ' || c == '\\n' || c == '\\r' || c == '\\t' || c == -1",
"c == '\\t'",
"c == '\\r'",
"c == ' ' || c == '\\n' || c == '\\r' || c == '\\t' || c == -1",
"c == ' '",
"c",
"' '",
"c == '\\n'",
"c",
"'\\n'",
"c == '\\r'",
"c",
"'\\r'",
"c == '\\t'",
"c",
"'\\t'",
"c == -1",
"c",
"-1",
"1",
"int c",
"c",
"public interface SpaceCharFilter {\n public boolean isSpaceChar(int ch);\n\n }",
"SpaceCharFilter",
"public boolean isSpaceChar(int ch);",
"isSpaceChar",
"int ch",
"ch",
"public class Main {\n public static void main(String[] args) {\n InputStream inputStream = System.in;\n OutputStream outputStream = System.out;\n FastReader in = new FastReader(inputStream);\n PrintWriter out = new PrintWriter(outputStream);\n CSumOfGcdOfTuplesEasy solver = new CSumOfGcdOfTuplesEasy();\n solver.solve(1, in, out);\n out.close();\n }\n\n static class CSumOfGcdOfTuplesEasy {\n public void solve(int testNumber, FastReader s, PrintWriter out) {\n int k = s.nextInt();\n long ans = 0l;\n for (int i = 1; i <= k; i++) {\n for (int j = 1; j <= k; j++) {\n long gcd1 = CSumOfGcdOfTuplesEasy.Maths.gcd(i, j);\n for (int l = 1; l <= k; l++) {\n ans += CSumOfGcdOfTuplesEasy.Maths.gcd(gcd1, l);\n }\n }\n }\n\n out.println(ans);\n }\n\n private static class Maths {\n private static long gcd(long a, long b) {\n if (b == 0) {\n return a;\n }\n\n return gcd(b, a % b);\n }\n\n }\n\n }\n\n static class FastReader {\n private InputStream stream;\n private byte[] buf = new byte[1024];\n private int curChar;\n private int numChars;\n private FastReader.SpaceCharFilter filter;\n\n public FastReader(InputStream stream) {\n this.stream = stream;\n }\n\n public int read() {\n if (numChars == -1) {\n throw new InputMismatchException();\n }\n if (curChar >= numChars) {\n curChar = 0;\n try {\n numChars = stream.read(buf);\n } catch (IOException e) {\n throw new InputMismatchException();\n }\n if (numChars <= 0) {\n return -1;\n }\n }\n return buf[curChar++];\n }\n\n public int nextInt() {\n int c = read();\n while (isSpaceChar(c)) {\n c = read();\n }\n int sgn = 1;\n if (c == '-') {\n sgn = -1;\n c = read();\n }\n int res = 0;\n do {\n if (c < '0' || c > '9') {\n throw new InputMismatchException();\n }\n res *= 10;\n res += c - '0';\n c = read();\n } while (!isSpaceChar(c));\n return res * sgn;\n }\n\n public boolean isSpaceChar(int c) {\n if (filter != null) {\n return filter.isSpaceChar(c);\n }\n return isWhitespace(c);\n }\n\n public static boolean isWhitespace(int c) {\n return c == ' ' || c == '\\n' || c == '\\r' || c == '\\t' || c == -1;\n }\n\n public interface SpaceCharFilter {\n public boolean isSpaceChar(int ch);\n\n }\n\n }\n}",
"public class Main {\n public static void main(String[] args) {\n InputStream inputStream = System.in;\n OutputStream outputStream = System.out;\n FastReader in = new FastReader(inputStream);\n PrintWriter out = new PrintWriter(outputStream);\n CSumOfGcdOfTuplesEasy solver = new CSumOfGcdOfTuplesEasy();\n solver.solve(1, in, out);\n out.close();\n }\n\n static class CSumOfGcdOfTuplesEasy {\n public void solve(int testNumber, FastReader s, PrintWriter out) {\n int k = s.nextInt();\n long ans = 0l;\n for (int i = 1; i <= k; i++) {\n for (int j = 1; j <= k; j++) {\n long gcd1 = CSumOfGcdOfTuplesEasy.Maths.gcd(i, j);\n for (int l = 1; l <= k; l++) {\n ans += CSumOfGcdOfTuplesEasy.Maths.gcd(gcd1, l);\n }\n }\n }\n\n out.println(ans);\n }\n\n private static class Maths {\n private static long gcd(long a, long b) {\n if (b == 0) {\n return a;\n }\n\n return gcd(b, a % b);\n }\n\n }\n\n }\n\n static class FastReader {\n private InputStream stream;\n private byte[] buf = new byte[1024];\n private int curChar;\n private int numChars;\n private FastReader.SpaceCharFilter filter;\n\n public FastReader(InputStream stream) {\n this.stream = stream;\n }\n\n public int read() {\n if (numChars == -1) {\n throw new InputMismatchException();\n }\n if (curChar >= numChars) {\n curChar = 0;\n try {\n numChars = stream.read(buf);\n } catch (IOException e) {\n throw new InputMismatchException();\n }\n if (numChars <= 0) {\n return -1;\n }\n }\n return buf[curChar++];\n }\n\n public int nextInt() {\n int c = read();\n while (isSpaceChar(c)) {\n c = read();\n }\n int sgn = 1;\n if (c == '-') {\n sgn = -1;\n c = read();\n }\n int res = 0;\n do {\n if (c < '0' || c > '9') {\n throw new InputMismatchException();\n }\n res *= 10;\n res += c - '0';\n c = read();\n } while (!isSpaceChar(c));\n return res * sgn;\n }\n\n public boolean isSpaceChar(int c) {\n if (filter != null) {\n return filter.isSpaceChar(c);\n }\n return isWhitespace(c);\n }\n\n public static boolean isWhitespace(int c) {\n return c == ' ' || c == '\\n' || c == '\\r' || c == '\\t' || c == -1;\n }\n\n public interface SpaceCharFilter {\n public boolean isSpaceChar(int ch);\n\n }\n\n }\n}",
"Main"
] |
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.InputMismatchException;
import java.io.IOException;
import java.io.InputStream;
/**
* Built using CHelper plug-in
* Actual solution is at the top
*/
public class Main {
public static void main(String[] args) {
InputStream inputStream = System.in;
OutputStream outputStream = System.out;
FastReader in = new FastReader(inputStream);
PrintWriter out = new PrintWriter(outputStream);
CSumOfGcdOfTuplesEasy solver = new CSumOfGcdOfTuplesEasy();
solver.solve(1, in, out);
out.close();
}
static class CSumOfGcdOfTuplesEasy {
public void solve(int testNumber, FastReader s, PrintWriter out) {
int k = s.nextInt();
long ans = 0l;
for (int i = 1; i <= k; i++) {
for (int j = 1; j <= k; j++) {
long gcd1 = CSumOfGcdOfTuplesEasy.Maths.gcd(i, j);
for (int l = 1; l <= k; l++) {
ans += CSumOfGcdOfTuplesEasy.Maths.gcd(gcd1, l);
}
}
}
out.println(ans);
}
private static class Maths {
private static long gcd(long a, long b) {
if (b == 0) {
return a;
}
return gcd(b, a % b);
}
}
}
static class FastReader {
private InputStream stream;
private byte[] buf = new byte[1024];
private int curChar;
private int numChars;
private FastReader.SpaceCharFilter filter;
public FastReader(InputStream stream) {
this.stream = stream;
}
public int read() {
if (numChars == -1) {
throw new InputMismatchException();
}
if (curChar >= numChars) {
curChar = 0;
try {
numChars = stream.read(buf);
} catch (IOException e) {
throw new InputMismatchException();
}
if (numChars <= 0) {
return -1;
}
}
return buf[curChar++];
}
public int nextInt() {
int c = read();
while (isSpaceChar(c)) {
c = read();
}
int sgn = 1;
if (c == '-') {
sgn = -1;
c = read();
}
int res = 0;
do {
if (c < '0' || c > '9') {
throw new InputMismatchException();
}
res *= 10;
res += c - '0';
c = read();
} while (!isSpaceChar(c));
return res * sgn;
}
public boolean isSpaceChar(int c) {
if (filter != null) {
return filter.isSpaceChar(c);
}
return isWhitespace(c);
}
public static boolean isWhitespace(int c) {
return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
}
public interface SpaceCharFilter {
public boolean isSpaceChar(int ch);
}
}
}
|
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
41,
13,
4,
13,
13,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
4,
13,
13,
13,
4,
18,
18,
13,
13,
13,
23,
13,
12,
13,
30,
14,
2,
13,
13,
29,
4,
13,
13,
13,
42,
2,
13,
17,
30,
41,
13,
2,
13,
13,
0,
13,
13,
0,
13,
13,
29,
13,
23,
13,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
114,
5
],
[
114,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
8,
17
],
[
17,
18
],
[
17,
19
],
[
8,
20
],
[
20,
21
],
[
21,
22
],
[
22,
23
],
[
22,
24
],
[
20,
25
],
[
25,
26
],
[
25,
27
],
[
20,
28
],
[
28,
29
],
[
29,
30
],
[
20,
31
],
[
32,
32
],
[
32,
33
],
[
33,
34
],
[
34,
35
],
[
35,
36
],
[
35,
37
],
[
33,
38
],
[
38,
39
],
[
38,
40
],
[
33,
41
],
[
41,
42
],
[
42,
43
],
[
33,
44
],
[
45,
45
],
[
45,
46
],
[
46,
47
],
[
46,
48
],
[
48,
49
],
[
48,
50
],
[
48,
51
],
[
45,
52
],
[
52,
53
],
[
53,
54
],
[
54,
55
],
[
54,
56
],
[
52,
57
],
[
57,
58
],
[
57,
59
],
[
52,
60
],
[
60,
61
],
[
61,
62
],
[
52,
63
],
[
64,
64
],
[
64,
65
],
[
65,
66
],
[
65,
67
],
[
67,
68
],
[
67,
69
],
[
67,
70
],
[
8,
71
],
[
71,
72
],
[
72,
73
],
[
73,
74
],
[
73,
75
],
[
71,
76
],
[
6,
77
],
[
77,
78
],
[
114,
79
],
[
79,
80
],
[
79,
81
],
[
81,
82
],
[
82,
83
],
[
83,
84
],
[
83,
85
],
[
82,
86
],
[
86,
87
],
[
87,
88
],
[
87,
89
],
[
87,
90
],
[
81,
91
],
[
91,
92
],
[
92,
93
],
[
92,
94
],
[
91,
95
],
[
95,
96
],
[
96,
97
],
[
96,
98
],
[
98,
99
],
[
98,
100
],
[
95,
101
],
[
101,
102
],
[
101,
103
],
[
95,
104
],
[
104,
105
],
[
104,
106
],
[
81,
107
],
[
107,
108
],
[
79,
109
],
[
109,
110
],
[
79,
111
],
[
111,
112
],
[
0,
113
],
[
113,
114
],
[
113,
115
]
] |
[
"import java.util.Scanner;\n\npublic class Main {\n public static void main(String[] args) {\n Scanner scanner = new Scanner(System.in);\n\n int K = scanner.nextInt();\n long sum = 0;\n for (int a = 1; a <= K; a++) {\n for (int b = 1; b <= K; b++) {\n long d = gcd(a, b);\n for (int c = 1; c <= K; c++) {\n sum += gcd(d, c);\n }\n }\n }\n System.out.println(sum);\n }\n\n static long gcd(long i, long j) {\n if (i > j) return gcd(j, i);\n while (i > 0) {\n long r = j % i;\n j = i;\n i = r;\n }\n return j;\n }\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n public static void main(String[] args) {\n Scanner scanner = new Scanner(System.in);\n\n int K = scanner.nextInt();\n long sum = 0;\n for (int a = 1; a <= K; a++) {\n for (int b = 1; b <= K; b++) {\n long d = gcd(a, b);\n for (int c = 1; c <= K; c++) {\n sum += gcd(d, c);\n }\n }\n }\n System.out.println(sum);\n }\n\n static long gcd(long i, long j) {\n if (i > j) return gcd(j, i);\n while (i > 0) {\n long r = j % i;\n j = i;\n i = r;\n }\n return j;\n }\n}",
"Main",
"public static void main(String[] args) {\n Scanner scanner = new Scanner(System.in);\n\n int K = scanner.nextInt();\n long sum = 0;\n for (int a = 1; a <= K; a++) {\n for (int b = 1; b <= K; b++) {\n long d = gcd(a, b);\n for (int c = 1; c <= K; c++) {\n sum += gcd(d, c);\n }\n }\n }\n System.out.println(sum);\n }",
"main",
"{\n Scanner scanner = new Scanner(System.in);\n\n int K = scanner.nextInt();\n long sum = 0;\n for (int a = 1; a <= K; a++) {\n for (int b = 1; b <= K; b++) {\n long d = gcd(a, b);\n for (int c = 1; c <= K; c++) {\n sum += gcd(d, c);\n }\n }\n }\n System.out.println(sum);\n }",
"Scanner scanner = new Scanner(System.in);",
"scanner",
"new Scanner(System.in)",
"int K = scanner.nextInt();",
"K",
"scanner.nextInt()",
"scanner.nextInt",
"scanner",
"long sum = 0;",
"sum",
"0",
"for (int a = 1; a <= K; a++) {\n for (int b = 1; b <= K; b++) {\n long d = gcd(a, b);\n for (int c = 1; c <= K; c++) {\n sum += gcd(d, c);\n }\n }\n }",
"int a = 1;",
"int a = 1;",
"a",
"1",
"a <= K",
"a",
"K",
"a++",
"a++",
"a",
"{\n for (int b = 1; b <= K; b++) {\n long d = gcd(a, b);\n for (int c = 1; c <= K; c++) {\n sum += gcd(d, c);\n }\n }\n }",
"{\n for (int b = 1; b <= K; b++) {\n long d = gcd(a, b);\n for (int c = 1; c <= K; c++) {\n sum += gcd(d, c);\n }\n }\n }",
"for (int b = 1; b <= K; b++) {\n long d = gcd(a, b);\n for (int c = 1; c <= K; c++) {\n sum += gcd(d, c);\n }\n }",
"int b = 1;",
"int b = 1;",
"b",
"1",
"b <= K",
"b",
"K",
"b++",
"b++",
"b",
"{\n long d = gcd(a, b);\n for (int c = 1; c <= K; c++) {\n sum += gcd(d, c);\n }\n }",
"{\n long d = gcd(a, b);\n for (int c = 1; c <= K; c++) {\n sum += gcd(d, c);\n }\n }",
"long d = gcd(a, b);",
"d",
"gcd(a, b)",
"gcd",
"a",
"b",
"for (int c = 1; c <= K; c++) {\n sum += gcd(d, c);\n }",
"int c = 1;",
"int c = 1;",
"c",
"1",
"c <= K",
"c",
"K",
"c++",
"c++",
"c",
"{\n sum += gcd(d, c);\n }",
"{\n sum += gcd(d, c);\n }",
"sum += gcd(d, c)",
"sum",
"gcd(d, c)",
"gcd",
"d",
"c",
"System.out.println(sum)",
"System.out.println",
"System.out",
"System",
"System.out",
"sum",
"String[] args",
"args",
"static long gcd(long i, long j) {\n if (i > j) return gcd(j, i);\n while (i > 0) {\n long r = j % i;\n j = i;\n i = r;\n }\n return j;\n }",
"gcd",
"{\n if (i > j) return gcd(j, i);\n while (i > 0) {\n long r = j % i;\n j = i;\n i = r;\n }\n return j;\n }",
"if (i > j) return gcd(j, i);",
"i > j",
"i",
"j",
"return gcd(j, i);",
"gcd(j, i)",
"gcd",
"j",
"i",
"while (i > 0) {\n long r = j % i;\n j = i;\n i = r;\n }",
"i > 0",
"i",
"0",
"{\n long r = j % i;\n j = i;\n i = r;\n }",
"long r = j % i;",
"r",
"j % i",
"j",
"i",
"j = i",
"j",
"i",
"i = r",
"i",
"r",
"return j;",
"j",
"long i",
"i",
"long j",
"j",
"public class Main {\n public static void main(String[] args) {\n Scanner scanner = new Scanner(System.in);\n\n int K = scanner.nextInt();\n long sum = 0;\n for (int a = 1; a <= K; a++) {\n for (int b = 1; b <= K; b++) {\n long d = gcd(a, b);\n for (int c = 1; c <= K; c++) {\n sum += gcd(d, c);\n }\n }\n }\n System.out.println(sum);\n }\n\n static long gcd(long i, long j) {\n if (i > j) return gcd(j, i);\n while (i > 0) {\n long r = j % i;\n j = i;\n i = r;\n }\n return j;\n }\n}",
"public class Main {\n public static void main(String[] args) {\n Scanner scanner = new Scanner(System.in);\n\n int K = scanner.nextInt();\n long sum = 0;\n for (int a = 1; a <= K; a++) {\n for (int b = 1; b <= K; b++) {\n long d = gcd(a, b);\n for (int c = 1; c <= K; c++) {\n sum += gcd(d, c);\n }\n }\n }\n System.out.println(sum);\n }\n\n static long gcd(long i, long j) {\n if (i > j) return gcd(j, i);\n while (i > 0) {\n long r = j % i;\n j = i;\n i = r;\n }\n return j;\n }\n}",
"Main"
] |
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
int K = scanner.nextInt();
long sum = 0;
for (int a = 1; a <= K; a++) {
for (int b = 1; b <= K; b++) {
long d = gcd(a, b);
for (int c = 1; c <= K; c++) {
sum += gcd(d, c);
}
}
}
System.out.println(sum);
}
static long gcd(long i, long j) {
if (i > j) return gcd(j, i);
while (i > 0) {
long r = j % i;
j = i;
i = r;
}
return j;
}
}
|
[
7,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
38,
5,
13,
30,
30,
41,
13,
4,
18,
13,
4,
18,
13,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
4,
13,
13,
4,
13,
13,
13,
4,
18,
18,
13,
13,
13,
23,
13,
12,
13,
30,
14,
2,
13,
13,
30,
29,
4,
13,
13,
13,
14,
2,
13,
17,
30,
29,
13,
29,
4,
13,
2,
13,
13,
13,
23,
13,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
119,
8
],
[
119,
9
],
[
9,
10
],
[
9,
11
],
[
11,
12
],
[
12,
13
],
[
12,
14
],
[
11,
15
],
[
15,
16
],
[
16,
17
],
[
16,
18
],
[
15,
19
],
[
19,
20
],
[
20,
21
],
[
20,
22
],
[
22,
23
],
[
23,
24
],
[
22,
25
],
[
25,
26
],
[
26,
27
],
[
19,
28
],
[
28,
29
],
[
28,
30
],
[
19,
31
],
[
31,
32
],
[
32,
33
],
[
33,
34
],
[
33,
35
],
[
31,
36
],
[
36,
37
],
[
36,
38
],
[
31,
39
],
[
39,
40
],
[
40,
41
],
[
31,
42
],
[
43,
43
],
[
43,
44
],
[
44,
45
],
[
45,
46
],
[
46,
47
],
[
46,
48
],
[
44,
49
],
[
49,
50
],
[
49,
51
],
[
44,
52
],
[
52,
53
],
[
53,
54
],
[
44,
55
],
[
56,
56
],
[
56,
57
],
[
57,
58
],
[
58,
59
],
[
59,
60
],
[
59,
61
],
[
57,
62
],
[
62,
63
],
[
62,
64
],
[
57,
65
],
[
65,
66
],
[
66,
67
],
[
57,
68
],
[
69,
69
],
[
69,
70
],
[
70,
71
],
[
70,
72
],
[
72,
73
],
[
72,
74
],
[
72,
75
],
[
75,
76
],
[
75,
77
],
[
75,
78
],
[
19,
79
],
[
79,
80
],
[
80,
81
],
[
81,
82
],
[
81,
83
],
[
79,
84
],
[
9,
85
],
[
85,
86
],
[
119,
87
],
[
87,
88
],
[
87,
89
],
[
89,
90
],
[
90,
91
],
[
91,
92
],
[
91,
93
],
[
90,
94
],
[
94,
95
],
[
95,
96
],
[
96,
97
],
[
96,
98
],
[
96,
99
],
[
89,
100
],
[
100,
101
],
[
101,
102
],
[
101,
103
],
[
100,
104
],
[
104,
105
],
[
105,
106
],
[
89,
107
],
[
107,
108
],
[
108,
109
],
[
108,
110
],
[
110,
111
],
[
110,
112
],
[
108,
113
],
[
87,
114
],
[
114,
115
],
[
87,
116
],
[
116,
117
],
[
0,
118
],
[
118,
119
],
[
118,
120
]
] |
[
"import java.util.*;\nimport java.io.*;\n\npublic class Main{\n public static void main(String[] args)throws Exception{\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n try{\n int N = Integer.parseInt(br.readLine());\n long ans = 0;\n for(int i = 1; i <= N; i++){\n for(int j = 1; j <= N; j++){\n for(int k = 1; k <= N; k++){\n ans += gcd(i, gcd(j, k));\n }\n }\n }\n System.out.println(ans);\n }catch(Exception e){\n }\n }\n \n static long gcd(long a, long b){\n if(a > b){\n return gcd(b, a);\n }\n \n if(a == 0){\n return b;\n }\n \n return gcd(b%a, a);\n }\n}",
"import java.util.*;",
"util.*",
"java",
"import java.io.*;",
"io.*",
"java",
"public class Main{\n public static void main(String[] args)throws Exception{\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n try{\n int N = Integer.parseInt(br.readLine());\n long ans = 0;\n for(int i = 1; i <= N; i++){\n for(int j = 1; j <= N; j++){\n for(int k = 1; k <= N; k++){\n ans += gcd(i, gcd(j, k));\n }\n }\n }\n System.out.println(ans);\n }catch(Exception e){\n }\n }\n \n static long gcd(long a, long b){\n if(a > b){\n return gcd(b, a);\n }\n \n if(a == 0){\n return b;\n }\n \n return gcd(b%a, a);\n }\n}",
"Main",
"public static void main(String[] args)throws Exception{\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n try{\n int N = Integer.parseInt(br.readLine());\n long ans = 0;\n for(int i = 1; i <= N; i++){\n for(int j = 1; j <= N; j++){\n for(int k = 1; k <= N; k++){\n ans += gcd(i, gcd(j, k));\n }\n }\n }\n System.out.println(ans);\n }catch(Exception e){\n }\n }",
"main",
"{\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n try{\n int N = Integer.parseInt(br.readLine());\n long ans = 0;\n for(int i = 1; i <= N; i++){\n for(int j = 1; j <= N; j++){\n for(int k = 1; k <= N; k++){\n ans += gcd(i, gcd(j, k));\n }\n }\n }\n System.out.println(ans);\n }catch(Exception e){\n }\n }",
"BufferedReader br = new BufferedReader(new InputStreamReader(System.in));",
"br",
"new BufferedReader(new InputStreamReader(System.in))",
"try{\n int N = Integer.parseInt(br.readLine());\n long ans = 0;\n for(int i = 1; i <= N; i++){\n for(int j = 1; j <= N; j++){\n for(int k = 1; k <= N; k++){\n ans += gcd(i, gcd(j, k));\n }\n }\n }\n System.out.println(ans);\n }catch(Exception e){\n }",
"catch(Exception e){\n }",
"Exception e",
"{\n }",
"{\n int N = Integer.parseInt(br.readLine());\n long ans = 0;\n for(int i = 1; i <= N; i++){\n for(int j = 1; j <= N; j++){\n for(int k = 1; k <= N; k++){\n ans += gcd(i, gcd(j, k));\n }\n }\n }\n System.out.println(ans);\n }",
"int N = Integer.parseInt(br.readLine());",
"N",
"Integer.parseInt(br.readLine())",
"Integer.parseInt",
"Integer",
"br.readLine()",
"br.readLine",
"br",
"long ans = 0;",
"ans",
"0",
"for(int i = 1; i <= N; i++){\n for(int j = 1; j <= N; j++){\n for(int k = 1; k <= N; k++){\n ans += gcd(i, gcd(j, k));\n }\n }\n }",
"int i = 1;",
"int i = 1;",
"i",
"1",
"i <= N",
"i",
"N",
"i++",
"i++",
"i",
"{\n for(int j = 1; j <= N; j++){\n for(int k = 1; k <= N; k++){\n ans += gcd(i, gcd(j, k));\n }\n }\n }",
"{\n for(int j = 1; j <= N; j++){\n for(int k = 1; k <= N; k++){\n ans += gcd(i, gcd(j, k));\n }\n }\n }",
"for(int j = 1; j <= N; j++){\n for(int k = 1; k <= N; k++){\n ans += gcd(i, gcd(j, k));\n }\n }",
"int j = 1;",
"int j = 1;",
"j",
"1",
"j <= N",
"j",
"N",
"j++",
"j++",
"j",
"{\n for(int k = 1; k <= N; k++){\n ans += gcd(i, gcd(j, k));\n }\n }",
"{\n for(int k = 1; k <= N; k++){\n ans += gcd(i, gcd(j, k));\n }\n }",
"for(int k = 1; k <= N; k++){\n ans += gcd(i, gcd(j, k));\n }",
"int k = 1;",
"int k = 1;",
"k",
"1",
"k <= N",
"k",
"N",
"k++",
"k++",
"k",
"{\n ans += gcd(i, gcd(j, k));\n }",
"{\n ans += gcd(i, gcd(j, k));\n }",
"ans += gcd(i, gcd(j, k))",
"ans",
"gcd(i, gcd(j, k))",
"gcd",
"i",
"gcd(j, k)",
"gcd",
"j",
"k",
"System.out.println(ans)",
"System.out.println",
"System.out",
"System",
"System.out",
"ans",
"String[] args",
"args",
"static long gcd(long a, long b){\n if(a > b){\n return gcd(b, a);\n }\n \n if(a == 0){\n return b;\n }\n \n return gcd(b%a, a);\n }",
"gcd",
"{\n if(a > b){\n return gcd(b, a);\n }\n \n if(a == 0){\n return b;\n }\n \n return gcd(b%a, a);\n }",
"if(a > b){\n return gcd(b, a);\n }",
"a > b",
"a",
"b",
"{\n return gcd(b, a);\n }",
"return gcd(b, a);",
"gcd(b, a)",
"gcd",
"b",
"a",
"if(a == 0){\n return b;\n }",
"a == 0",
"a",
"0",
"{\n return b;\n }",
"return b;",
"b",
"return gcd(b%a, a);",
"gcd(b%a, a)",
"gcd",
"b%a",
"b",
"a",
"a",
"long a",
"a",
"long b",
"b",
"public class Main{\n public static void main(String[] args)throws Exception{\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n try{\n int N = Integer.parseInt(br.readLine());\n long ans = 0;\n for(int i = 1; i <= N; i++){\n for(int j = 1; j <= N; j++){\n for(int k = 1; k <= N; k++){\n ans += gcd(i, gcd(j, k));\n }\n }\n }\n System.out.println(ans);\n }catch(Exception e){\n }\n }\n \n static long gcd(long a, long b){\n if(a > b){\n return gcd(b, a);\n }\n \n if(a == 0){\n return b;\n }\n \n return gcd(b%a, a);\n }\n}",
"public class Main{\n public static void main(String[] args)throws Exception{\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n try{\n int N = Integer.parseInt(br.readLine());\n long ans = 0;\n for(int i = 1; i <= N; i++){\n for(int j = 1; j <= N; j++){\n for(int k = 1; k <= N; k++){\n ans += gcd(i, gcd(j, k));\n }\n }\n }\n System.out.println(ans);\n }catch(Exception e){\n }\n }\n \n static long gcd(long a, long b){\n if(a > b){\n return gcd(b, a);\n }\n \n if(a == 0){\n return b;\n }\n \n return gcd(b%a, a);\n }\n}",
"Main"
] |
import java.util.*;
import java.io.*;
public class Main{
public static void main(String[] args)throws Exception{
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
try{
int N = Integer.parseInt(br.readLine());
long ans = 0;
for(int i = 1; i <= N; i++){
for(int j = 1; j <= N; j++){
for(int k = 1; k <= N; k++){
ans += gcd(i, gcd(j, k));
}
}
}
System.out.println(ans);
}catch(Exception e){
}
}
static long gcd(long a, long b){
if(a > b){
return gcd(b, a);
}
if(a == 0){
return b;
}
return gcd(b%a, a);
}
}
|
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
14,
2,
13,
13,
4,
13,
13,
13,
14,
2,
13,
17,
29,
13,
29,
4,
13,
13,
2,
13,
13,
23,
13,
23,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
4,
18,
13,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
4,
13,
13,
4,
13,
13,
13,
4,
18,
18,
13,
13,
13,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
108,
5
],
[
108,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
10,
11
],
[
10,
12
],
[
9,
13
],
[
13,
14
],
[
13,
15
],
[
13,
16
],
[
8,
17
],
[
17,
18
],
[
18,
19
],
[
18,
20
],
[
17,
21
],
[
21,
22
],
[
8,
23
],
[
23,
24
],
[
24,
25
],
[
24,
26
],
[
24,
27
],
[
27,
28
],
[
27,
29
],
[
6,
30
],
[
30,
31
],
[
6,
32
],
[
32,
33
],
[
108,
34
],
[
34,
35
],
[
34,
36
],
[
36,
37
],
[
37,
38
],
[
37,
39
],
[
36,
40
],
[
40,
41
],
[
40,
42
],
[
42,
43
],
[
43,
44
],
[
42,
45
],
[
45,
46
],
[
46,
47
],
[
36,
48
],
[
48,
49
],
[
48,
50
],
[
36,
51
],
[
51,
52
],
[
52,
53
],
[
53,
54
],
[
53,
55
],
[
51,
56
],
[
56,
57
],
[
56,
58
],
[
51,
59
],
[
59,
60
],
[
60,
61
],
[
51,
62
],
[
63,
63
],
[
63,
64
],
[
64,
65
],
[
65,
66
],
[
66,
67
],
[
66,
68
],
[
64,
69
],
[
69,
70
],
[
69,
71
],
[
64,
72
],
[
72,
73
],
[
73,
74
],
[
64,
75
],
[
76,
76
],
[
76,
77
],
[
77,
78
],
[
78,
79
],
[
79,
80
],
[
79,
81
],
[
77,
82
],
[
82,
83
],
[
82,
84
],
[
77,
85
],
[
85,
86
],
[
86,
87
],
[
77,
88
],
[
89,
89
],
[
89,
90
],
[
90,
91
],
[
90,
92
],
[
92,
93
],
[
92,
94
],
[
92,
95
],
[
95,
96
],
[
95,
97
],
[
95,
98
],
[
36,
99
],
[
99,
100
],
[
100,
101
],
[
101,
102
],
[
101,
103
],
[
99,
104
],
[
34,
105
],
[
105,
106
],
[
0,
107
],
[
107,
108
],
[
107,
109
]
] |
[
"import java.util.*;\n\npublic class Main {\n public static int gcd(int a, int b) {\n if(a < b) gcd(b, a);\n if(b == 0) return a;\n return gcd(b,a%b);\n }\n\n public static void main(String[] args) {\n //コード\n Scanner scanner = new Scanner(System.in);\n Integer K = Integer.parseInt(scanner.next());\n Integer total = 0;\n\n for (int i = 1; i <= K; i++) {\n for (int j = 1; j <= K; j++) {\n for (int k = 1; k <= K; k++) {\n total += gcd(i, gcd(j,k));\n }\n }\n }\n System.out.println(total);\n }\n}",
"import java.util.*;",
"util.*",
"java",
"public class Main {\n public static int gcd(int a, int b) {\n if(a < b) gcd(b, a);\n if(b == 0) return a;\n return gcd(b,a%b);\n }\n\n public static void main(String[] args) {\n //コード\n Scanner scanner = new Scanner(System.in);\n Integer K = Integer.parseInt(scanner.next());\n Integer total = 0;\n\n for (int i = 1; i <= K; i++) {\n for (int j = 1; j <= K; j++) {\n for (int k = 1; k <= K; k++) {\n total += gcd(i, gcd(j,k));\n }\n }\n }\n System.out.println(total);\n }\n}",
"Main",
"public static int gcd(int a, int b) {\n if(a < b) gcd(b, a);\n if(b == 0) return a;\n return gcd(b,a%b);\n }",
"gcd",
"{\n if(a < b) gcd(b, a);\n if(b == 0) return a;\n return gcd(b,a%b);\n }",
"if(a < b) gcd(b, a);",
"a < b",
"a",
"b",
"gcd(b, a)",
"gcd",
"b",
"a",
"if(b == 0) return a;",
"b == 0",
"b",
"0",
"return a;",
"a",
"return gcd(b,a%b);",
"gcd(b,a%b)",
"gcd",
"b",
"a%b",
"a",
"b",
"int a",
"a",
"int b",
"b",
"public static void main(String[] args) {\n //コード\n Scanner scanner = new Scanner(System.in);\n Integer K = Integer.parseInt(scanner.next());\n Integer total = 0;\n\n for (int i = 1; i <= K; i++) {\n for (int j = 1; j <= K; j++) {\n for (int k = 1; k <= K; k++) {\n total += gcd(i, gcd(j,k));\n }\n }\n }\n System.out.println(total);\n }",
"main",
"{\n //コード\n Scanner scanner = new Scanner(System.in);\n Integer K = Integer.parseInt(scanner.next());\n Integer total = 0;\n\n for (int i = 1; i <= K; i++) {\n for (int j = 1; j <= K; j++) {\n for (int k = 1; k <= K; k++) {\n total += gcd(i, gcd(j,k));\n }\n }\n }\n System.out.println(total);\n }",
"Scanner scanner = new Scanner(System.in);",
"scanner",
"new Scanner(System.in)",
"Integer K = Integer.parseInt(scanner.next());",
"K",
"Integer.parseInt(scanner.next())",
"Integer.parseInt",
"Integer",
"scanner.next()",
"scanner.next",
"scanner",
"Integer total = 0;",
"total",
"0",
"for (int i = 1; i <= K; i++) {\n for (int j = 1; j <= K; j++) {\n for (int k = 1; k <= K; k++) {\n total += gcd(i, gcd(j,k));\n }\n }\n }",
"int i = 1;",
"int i = 1;",
"i",
"1",
"i <= K",
"i",
"K",
"i++",
"i++",
"i",
"{\n for (int j = 1; j <= K; j++) {\n for (int k = 1; k <= K; k++) {\n total += gcd(i, gcd(j,k));\n }\n }\n }",
"{\n for (int j = 1; j <= K; j++) {\n for (int k = 1; k <= K; k++) {\n total += gcd(i, gcd(j,k));\n }\n }\n }",
"for (int j = 1; j <= K; j++) {\n for (int k = 1; k <= K; k++) {\n total += gcd(i, gcd(j,k));\n }\n }",
"int j = 1;",
"int j = 1;",
"j",
"1",
"j <= K",
"j",
"K",
"j++",
"j++",
"j",
"{\n for (int k = 1; k <= K; k++) {\n total += gcd(i, gcd(j,k));\n }\n }",
"{\n for (int k = 1; k <= K; k++) {\n total += gcd(i, gcd(j,k));\n }\n }",
"for (int k = 1; k <= K; k++) {\n total += gcd(i, gcd(j,k));\n }",
"int k = 1;",
"int k = 1;",
"k",
"1",
"k <= K",
"k",
"K",
"k++",
"k++",
"k",
"{\n total += gcd(i, gcd(j,k));\n }",
"{\n total += gcd(i, gcd(j,k));\n }",
"total += gcd(i, gcd(j,k))",
"total",
"gcd(i, gcd(j,k))",
"gcd",
"i",
"gcd(j,k)",
"gcd",
"j",
"k",
"System.out.println(total)",
"System.out.println",
"System.out",
"System",
"System.out",
"total",
"String[] args",
"args",
"public class Main {\n public static int gcd(int a, int b) {\n if(a < b) gcd(b, a);\n if(b == 0) return a;\n return gcd(b,a%b);\n }\n\n public static void main(String[] args) {\n //コード\n Scanner scanner = new Scanner(System.in);\n Integer K = Integer.parseInt(scanner.next());\n Integer total = 0;\n\n for (int i = 1; i <= K; i++) {\n for (int j = 1; j <= K; j++) {\n for (int k = 1; k <= K; k++) {\n total += gcd(i, gcd(j,k));\n }\n }\n }\n System.out.println(total);\n }\n}",
"public class Main {\n public static int gcd(int a, int b) {\n if(a < b) gcd(b, a);\n if(b == 0) return a;\n return gcd(b,a%b);\n }\n\n public static void main(String[] args) {\n //コード\n Scanner scanner = new Scanner(System.in);\n Integer K = Integer.parseInt(scanner.next());\n Integer total = 0;\n\n for (int i = 1; i <= K; i++) {\n for (int j = 1; j <= K; j++) {\n for (int k = 1; k <= K; k++) {\n total += gcd(i, gcd(j,k));\n }\n }\n }\n System.out.println(total);\n }\n}",
"Main"
] |
import java.util.*;
public class Main {
public static int gcd(int a, int b) {
if(a < b) gcd(b, a);
if(b == 0) return a;
return gcd(b,a%b);
}
public static void main(String[] args) {
//コード
Scanner scanner = new Scanner(System.in);
Integer K = Integer.parseInt(scanner.next());
Integer total = 0;
for (int i = 1; i <= K; i++) {
for (int j = 1; j <= K; j++) {
for (int k = 1; k <= K; k++) {
total += gcd(i, gcd(j,k));
}
}
}
System.out.println(total);
}
}
|
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
4,
18,
13,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
4,
13,
4,
13,
13,
13,
13,
4,
18,
18,
13,
13,
13,
23,
13,
12,
13,
30,
41,
13,
42,
2,
0,
13,
2,
13,
13,
17,
30,
0,
13,
13,
0,
13,
13,
29,
13,
23,
13,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
106,
5
],
[
106,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
8,
17
],
[
17,
18
],
[
18,
19
],
[
8,
20
],
[
20,
21
],
[
20,
22
],
[
8,
23
],
[
23,
24
],
[
24,
25
],
[
25,
26
],
[
25,
27
],
[
23,
28
],
[
28,
29
],
[
28,
30
],
[
23,
31
],
[
31,
32
],
[
32,
33
],
[
23,
34
],
[
35,
35
],
[
35,
36
],
[
36,
37
],
[
37,
38
],
[
38,
39
],
[
38,
40
],
[
36,
41
],
[
41,
42
],
[
41,
43
],
[
36,
44
],
[
44,
45
],
[
45,
46
],
[
36,
47
],
[
48,
48
],
[
48,
49
],
[
49,
50
],
[
50,
51
],
[
51,
52
],
[
51,
53
],
[
49,
54
],
[
54,
55
],
[
54,
56
],
[
49,
57
],
[
57,
58
],
[
58,
59
],
[
49,
60
],
[
61,
61
],
[
61,
62
],
[
62,
63
],
[
62,
64
],
[
64,
65
],
[
64,
66
],
[
66,
67
],
[
66,
68
],
[
66,
69
],
[
64,
70
],
[
8,
71
],
[
71,
72
],
[
72,
73
],
[
73,
74
],
[
73,
75
],
[
71,
76
],
[
6,
77
],
[
77,
78
],
[
106,
79
],
[
79,
80
],
[
79,
81
],
[
81,
82
],
[
82,
83
],
[
81,
84
],
[
84,
85
],
[
85,
86
],
[
86,
87
],
[
86,
88
],
[
88,
89
],
[
88,
90
],
[
85,
91
],
[
84,
92
],
[
92,
93
],
[
93,
94
],
[
93,
95
],
[
92,
96
],
[
96,
97
],
[
96,
98
],
[
81,
99
],
[
99,
100
],
[
79,
101
],
[
101,
102
],
[
79,
103
],
[
103,
104
],
[
0,
105
],
[
105,
106
],
[
105,
107
]
] |
[
"import java.util.Scanner;\n\npublic class Main {\n\n\tpublic static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\tint K = sc.nextInt();\n\t\tsc.close();\n\t\tint s=0;\n\t\tfor(int i=1; i<=K; i++) {\n\t\t\tfor(int j=1; j<=K; j++) {\n\t\t\t\tfor(int k=1; k<=K; k++) {\n\t\t\t\t\ts+=gcd(gcd(i,j),k);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(s);\n\t}\n\n\tpublic static int gcd(int a, int b) {\n\t\tint r;\n\t\twhile((r = a%b) != 0) {\n\t\t\ta=b;\n\t\t\tb=r;\n\t\t}\n\t\treturn b;\n\t}\n\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n\n\tpublic static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\tint K = sc.nextInt();\n\t\tsc.close();\n\t\tint s=0;\n\t\tfor(int i=1; i<=K; i++) {\n\t\t\tfor(int j=1; j<=K; j++) {\n\t\t\t\tfor(int k=1; k<=K; k++) {\n\t\t\t\t\ts+=gcd(gcd(i,j),k);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(s);\n\t}\n\n\tpublic static int gcd(int a, int b) {\n\t\tint r;\n\t\twhile((r = a%b) != 0) {\n\t\t\ta=b;\n\t\t\tb=r;\n\t\t}\n\t\treturn b;\n\t}\n\n}",
"Main",
"public static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\tint K = sc.nextInt();\n\t\tsc.close();\n\t\tint s=0;\n\t\tfor(int i=1; i<=K; i++) {\n\t\t\tfor(int j=1; j<=K; j++) {\n\t\t\t\tfor(int k=1; k<=K; k++) {\n\t\t\t\t\ts+=gcd(gcd(i,j),k);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(s);\n\t}",
"main",
"{\n\t\tScanner sc = new Scanner(System.in);\n\t\tint K = sc.nextInt();\n\t\tsc.close();\n\t\tint s=0;\n\t\tfor(int i=1; i<=K; i++) {\n\t\t\tfor(int j=1; j<=K; j++) {\n\t\t\t\tfor(int k=1; k<=K; k++) {\n\t\t\t\t\ts+=gcd(gcd(i,j),k);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(s);\n\t}",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"int K = sc.nextInt();",
"K",
"sc.nextInt()",
"sc.nextInt",
"sc",
"sc.close()",
"sc.close",
"sc",
"int s=0;",
"s",
"0",
"for(int i=1; i<=K; i++) {\n\t\t\tfor(int j=1; j<=K; j++) {\n\t\t\t\tfor(int k=1; k<=K; k++) {\n\t\t\t\t\ts+=gcd(gcd(i,j),k);\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"int i=1;",
"int i=1;",
"i",
"1",
"i<=K",
"i",
"K",
"i++",
"i++",
"i",
"{\n\t\t\tfor(int j=1; j<=K; j++) {\n\t\t\t\tfor(int k=1; k<=K; k++) {\n\t\t\t\t\ts+=gcd(gcd(i,j),k);\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"{\n\t\t\tfor(int j=1; j<=K; j++) {\n\t\t\t\tfor(int k=1; k<=K; k++) {\n\t\t\t\t\ts+=gcd(gcd(i,j),k);\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"for(int j=1; j<=K; j++) {\n\t\t\t\tfor(int k=1; k<=K; k++) {\n\t\t\t\t\ts+=gcd(gcd(i,j),k);\n\t\t\t\t}\n\t\t\t}",
"int j=1;",
"int j=1;",
"j",
"1",
"j<=K",
"j",
"K",
"j++",
"j++",
"j",
"{\n\t\t\t\tfor(int k=1; k<=K; k++) {\n\t\t\t\t\ts+=gcd(gcd(i,j),k);\n\t\t\t\t}\n\t\t\t}",
"{\n\t\t\t\tfor(int k=1; k<=K; k++) {\n\t\t\t\t\ts+=gcd(gcd(i,j),k);\n\t\t\t\t}\n\t\t\t}",
"for(int k=1; k<=K; k++) {\n\t\t\t\t\ts+=gcd(gcd(i,j),k);\n\t\t\t\t}",
"int k=1;",
"int k=1;",
"k",
"1",
"k<=K",
"k",
"K",
"k++",
"k++",
"k",
"{\n\t\t\t\t\ts+=gcd(gcd(i,j),k);\n\t\t\t\t}",
"{\n\t\t\t\t\ts+=gcd(gcd(i,j),k);\n\t\t\t\t}",
"s+=gcd(gcd(i,j),k)",
"s",
"gcd(gcd(i,j),k)",
"gcd",
"gcd(i,j)",
"gcd",
"i",
"j",
"k",
"System.out.println(s)",
"System.out.println",
"System.out",
"System",
"System.out",
"s",
"String[] args",
"args",
"public static int gcd(int a, int b) {\n\t\tint r;\n\t\twhile((r = a%b) != 0) {\n\t\t\ta=b;\n\t\t\tb=r;\n\t\t}\n\t\treturn b;\n\t}",
"gcd",
"{\n\t\tint r;\n\t\twhile((r = a%b) != 0) {\n\t\t\ta=b;\n\t\t\tb=r;\n\t\t}\n\t\treturn b;\n\t}",
"int r;",
"r",
"while((r = a%b) != 0) {\n\t\t\ta=b;\n\t\t\tb=r;\n\t\t}",
"(r = a%b) != 0",
"(r = a%b)",
"r",
"a%b",
"a",
"b",
"0",
"{\n\t\t\ta=b;\n\t\t\tb=r;\n\t\t}",
"a=b",
"a",
"b",
"b=r",
"b",
"r",
"return b;",
"b",
"int a",
"a",
"int b",
"b",
"public class Main {\n\n\tpublic static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\tint K = sc.nextInt();\n\t\tsc.close();\n\t\tint s=0;\n\t\tfor(int i=1; i<=K; i++) {\n\t\t\tfor(int j=1; j<=K; j++) {\n\t\t\t\tfor(int k=1; k<=K; k++) {\n\t\t\t\t\ts+=gcd(gcd(i,j),k);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(s);\n\t}\n\n\tpublic static int gcd(int a, int b) {\n\t\tint r;\n\t\twhile((r = a%b) != 0) {\n\t\t\ta=b;\n\t\t\tb=r;\n\t\t}\n\t\treturn b;\n\t}\n\n}",
"public class Main {\n\n\tpublic static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\tint K = sc.nextInt();\n\t\tsc.close();\n\t\tint s=0;\n\t\tfor(int i=1; i<=K; i++) {\n\t\t\tfor(int j=1; j<=K; j++) {\n\t\t\t\tfor(int k=1; k<=K; k++) {\n\t\t\t\t\ts+=gcd(gcd(i,j),k);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(s);\n\t}\n\n\tpublic static int gcd(int a, int b) {\n\t\tint r;\n\t\twhile((r = a%b) != 0) {\n\t\t\ta=b;\n\t\t\tb=r;\n\t\t}\n\t\treturn b;\n\t}\n\n}",
"Main"
] |
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int K = sc.nextInt();
sc.close();
int s=0;
for(int i=1; i<=K; i++) {
for(int j=1; j<=K; j++) {
for(int k=1; k<=K; k++) {
s+=gcd(gcd(i,j),k);
}
}
}
System.out.println(s);
}
public static int gcd(int a, int b) {
int r;
while((r = a%b) != 0) {
a=b;
b=r;
}
return b;
}
}
|
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
2,
13,
17,
1,
40,
13,
30,
30,
11,
1,
41,
13,
17,
2,
13,
2,
13,
17,
1,
40,
13,
30,
30,
11,
1,
41,
13,
17,
2,
13,
2,
13,
17,
1,
40,
13,
30,
30,
41,
13,
4,
13,
13,
13,
41,
13,
4,
13,
13,
13,
0,
13,
2,
13,
13,
4,
18,
18,
13,
13,
13,
23,
13,
12,
13,
30,
14,
2,
13,
13,
29,
4,
13,
13,
13,
14,
2,
13,
17,
29,
13,
29,
4,
13,
13,
2,
13,
13,
23,
13,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
120,
5
],
[
120,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
8,
17
],
[
17,
18
],
[
17,
19
],
[
8,
20
],
[
20,
21
],
[
21,
22
],
[
22,
23
],
[
22,
24
],
[
20,
25
],
[
25,
26
],
[
25,
27
],
[
27,
28
],
[
27,
29
],
[
20,
30
],
[
30,
31
],
[
31,
32
],
[
20,
33
],
[
34,
34
],
[
34,
35
],
[
35,
36
],
[
36,
37
],
[
37,
38
],
[
37,
39
],
[
35,
40
],
[
40,
41
],
[
40,
42
],
[
42,
43
],
[
42,
44
],
[
35,
45
],
[
45,
46
],
[
46,
47
],
[
35,
48
],
[
49,
49
],
[
49,
50
],
[
50,
51
],
[
51,
52
],
[
52,
53
],
[
52,
54
],
[
50,
55
],
[
55,
56
],
[
55,
57
],
[
57,
58
],
[
57,
59
],
[
50,
60
],
[
60,
61
],
[
61,
62
],
[
50,
63
],
[
64,
64
],
[
64,
65
],
[
65,
66
],
[
65,
67
],
[
67,
68
],
[
67,
69
],
[
67,
70
],
[
64,
71
],
[
71,
72
],
[
71,
73
],
[
73,
74
],
[
73,
75
],
[
73,
76
],
[
64,
77
],
[
77,
78
],
[
77,
79
],
[
79,
80
],
[
79,
81
],
[
8,
82
],
[
82,
83
],
[
83,
84
],
[
84,
85
],
[
84,
86
],
[
82,
87
],
[
6,
88
],
[
88,
89
],
[
120,
90
],
[
90,
91
],
[
90,
92
],
[
92,
93
],
[
93,
94
],
[
94,
95
],
[
94,
96
],
[
93,
97
],
[
97,
98
],
[
98,
99
],
[
98,
100
],
[
98,
101
],
[
92,
102
],
[
102,
103
],
[
103,
104
],
[
103,
105
],
[
102,
106
],
[
106,
107
],
[
92,
108
],
[
108,
109
],
[
109,
110
],
[
109,
111
],
[
109,
112
],
[
112,
113
],
[
112,
114
],
[
90,
115
],
[
115,
116
],
[
90,
117
],
[
117,
118
],
[
0,
119
],
[
119,
120
],
[
119,
121
]
] |
[
"import java.util.*;\n\npublic class Main {\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n\n int k = sc.nextInt();\n\n long sum = 0;\n\n for (int j = 1; j < k + 1; j++) {\n for (int i = 1; i < k + 1; i++) {\n for (int h = 1; h < k + 1; h++) {\n int s = gcd(j, i);\n int t = gcd(s, h);\n sum = sum + t;\n }\n }\n }\n System.out.println(sum);\n\n }\n \n private static int gcd(int m, int n) {\n if (m < n)\n return gcd(n, m);\n if (n == 0)\n return m;\n return gcd(n, m % n);\n }\n\n}",
"import java.util.*;",
"util.*",
"java",
"public class Main {\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n\n int k = sc.nextInt();\n\n long sum = 0;\n\n for (int j = 1; j < k + 1; j++) {\n for (int i = 1; i < k + 1; i++) {\n for (int h = 1; h < k + 1; h++) {\n int s = gcd(j, i);\n int t = gcd(s, h);\n sum = sum + t;\n }\n }\n }\n System.out.println(sum);\n\n }\n \n private static int gcd(int m, int n) {\n if (m < n)\n return gcd(n, m);\n if (n == 0)\n return m;\n return gcd(n, m % n);\n }\n\n}",
"Main",
"public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n\n int k = sc.nextInt();\n\n long sum = 0;\n\n for (int j = 1; j < k + 1; j++) {\n for (int i = 1; i < k + 1; i++) {\n for (int h = 1; h < k + 1; h++) {\n int s = gcd(j, i);\n int t = gcd(s, h);\n sum = sum + t;\n }\n }\n }\n System.out.println(sum);\n\n }",
"main",
"{\n Scanner sc = new Scanner(System.in);\n\n int k = sc.nextInt();\n\n long sum = 0;\n\n for (int j = 1; j < k + 1; j++) {\n for (int i = 1; i < k + 1; i++) {\n for (int h = 1; h < k + 1; h++) {\n int s = gcd(j, i);\n int t = gcd(s, h);\n sum = sum + t;\n }\n }\n }\n System.out.println(sum);\n\n }",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"int k = sc.nextInt();",
"k",
"sc.nextInt()",
"sc.nextInt",
"sc",
"long sum = 0;",
"sum",
"0",
"for (int j = 1; j < k + 1; j++) {\n for (int i = 1; i < k + 1; i++) {\n for (int h = 1; h < k + 1; h++) {\n int s = gcd(j, i);\n int t = gcd(s, h);\n sum = sum + t;\n }\n }\n }",
"int j = 1;",
"int j = 1;",
"j",
"1",
"j < k + 1",
"j",
"k + 1",
"k",
"1",
"j++",
"j++",
"j",
"{\n for (int i = 1; i < k + 1; i++) {\n for (int h = 1; h < k + 1; h++) {\n int s = gcd(j, i);\n int t = gcd(s, h);\n sum = sum + t;\n }\n }\n }",
"{\n for (int i = 1; i < k + 1; i++) {\n for (int h = 1; h < k + 1; h++) {\n int s = gcd(j, i);\n int t = gcd(s, h);\n sum = sum + t;\n }\n }\n }",
"for (int i = 1; i < k + 1; i++) {\n for (int h = 1; h < k + 1; h++) {\n int s = gcd(j, i);\n int t = gcd(s, h);\n sum = sum + t;\n }\n }",
"int i = 1;",
"int i = 1;",
"i",
"1",
"i < k + 1",
"i",
"k + 1",
"k",
"1",
"i++",
"i++",
"i",
"{\n for (int h = 1; h < k + 1; h++) {\n int s = gcd(j, i);\n int t = gcd(s, h);\n sum = sum + t;\n }\n }",
"{\n for (int h = 1; h < k + 1; h++) {\n int s = gcd(j, i);\n int t = gcd(s, h);\n sum = sum + t;\n }\n }",
"for (int h = 1; h < k + 1; h++) {\n int s = gcd(j, i);\n int t = gcd(s, h);\n sum = sum + t;\n }",
"int h = 1;",
"int h = 1;",
"h",
"1",
"h < k + 1",
"h",
"k + 1",
"k",
"1",
"h++",
"h++",
"h",
"{\n int s = gcd(j, i);\n int t = gcd(s, h);\n sum = sum + t;\n }",
"{\n int s = gcd(j, i);\n int t = gcd(s, h);\n sum = sum + t;\n }",
"int s = gcd(j, i);",
"s",
"gcd(j, i)",
"gcd",
"j",
"i",
"int t = gcd(s, h);",
"t",
"gcd(s, h)",
"gcd",
"s",
"h",
"sum = sum + t",
"sum",
"sum + t",
"sum",
"t",
"System.out.println(sum)",
"System.out.println",
"System.out",
"System",
"System.out",
"sum",
"String[] args",
"args",
"private static int gcd(int m, int n) {\n if (m < n)\n return gcd(n, m);\n if (n == 0)\n return m;\n return gcd(n, m % n);\n }",
"gcd",
"{\n if (m < n)\n return gcd(n, m);\n if (n == 0)\n return m;\n return gcd(n, m % n);\n }",
"if (m < n)\n return gcd(n, m);",
"m < n",
"m",
"n",
"return gcd(n, m);",
"gcd(n, m)",
"gcd",
"n",
"m",
"if (n == 0)\n return m;",
"n == 0",
"n",
"0",
"return m;",
"m",
"return gcd(n, m % n);",
"gcd(n, m % n)",
"gcd",
"n",
"m % n",
"m",
"n",
"int m",
"m",
"int n",
"n",
"public class Main {\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n\n int k = sc.nextInt();\n\n long sum = 0;\n\n for (int j = 1; j < k + 1; j++) {\n for (int i = 1; i < k + 1; i++) {\n for (int h = 1; h < k + 1; h++) {\n int s = gcd(j, i);\n int t = gcd(s, h);\n sum = sum + t;\n }\n }\n }\n System.out.println(sum);\n\n }\n \n private static int gcd(int m, int n) {\n if (m < n)\n return gcd(n, m);\n if (n == 0)\n return m;\n return gcd(n, m % n);\n }\n\n}",
"public class Main {\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n\n int k = sc.nextInt();\n\n long sum = 0;\n\n for (int j = 1; j < k + 1; j++) {\n for (int i = 1; i < k + 1; i++) {\n for (int h = 1; h < k + 1; h++) {\n int s = gcd(j, i);\n int t = gcd(s, h);\n sum = sum + t;\n }\n }\n }\n System.out.println(sum);\n\n }\n \n private static int gcd(int m, int n) {\n if (m < n)\n return gcd(n, m);\n if (n == 0)\n return m;\n return gcd(n, m % n);\n }\n\n}",
"Main"
] |
import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int k = sc.nextInt();
long sum = 0;
for (int j = 1; j < k + 1; j++) {
for (int i = 1; i < k + 1; i++) {
for (int h = 1; h < k + 1; h++) {
int s = gcd(j, i);
int t = gcd(s, h);
sum = sum + t;
}
}
}
System.out.println(sum);
}
private static int gcd(int m, int n) {
if (m < n)
return gcd(n, m);
if (n == 0)
return m;
return gcd(n, m % n);
}
}
|
[
7,
15,
13,
17,
6,
13,
41,
13,
12,
13,
30,
41,
13,
20,
4,
18,
13,
23,
13,
12,
13,
30,
41,
13,
20,
0,
13,
4,
18,
13,
4,
18,
13,
4,
13,
12,
13,
30,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
4,
13,
13,
4,
13,
13,
13,
4,
18,
18,
13,
13,
13,
12,
13,
30,
41,
13,
17,
14,
2,
13,
13,
30,
41,
13,
0,
13,
13,
0,
13,
13,
0,
13,
13,
0,
13,
2,
13,
13,
42,
2,
13,
17,
30,
0,
13,
13,
0,
13,
13,
0,
13,
2,
13,
13,
29,
13,
23,
13,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
145,
5
],
[
145,
6
],
[
6,
7
],
[
145,
8
],
[
8,
9
],
[
8,
10
],
[
10,
11
],
[
11,
12
],
[
11,
13
],
[
10,
14
],
[
14,
15
],
[
15,
16
],
[
8,
17
],
[
17,
18
],
[
145,
19
],
[
19,
20
],
[
19,
21
],
[
21,
22
],
[
22,
23
],
[
22,
24
],
[
21,
25
],
[
25,
26
],
[
25,
27
],
[
27,
28
],
[
28,
29
],
[
21,
30
],
[
30,
31
],
[
31,
32
],
[
21,
33
],
[
33,
34
],
[
145,
35
],
[
35,
36
],
[
35,
37
],
[
37,
38
],
[
38,
39
],
[
38,
40
],
[
37,
41
],
[
41,
42
],
[
42,
43
],
[
43,
44
],
[
43,
45
],
[
41,
46
],
[
46,
47
],
[
46,
48
],
[
41,
49
],
[
49,
50
],
[
50,
51
],
[
41,
52
],
[
53,
53
],
[
53,
54
],
[
54,
55
],
[
55,
56
],
[
56,
57
],
[
56,
58
],
[
54,
59
],
[
59,
60
],
[
59,
61
],
[
54,
62
],
[
62,
63
],
[
63,
64
],
[
54,
65
],
[
66,
66
],
[
66,
67
],
[
67,
68
],
[
68,
69
],
[
69,
70
],
[
69,
71
],
[
67,
72
],
[
72,
73
],
[
72,
74
],
[
67,
75
],
[
75,
76
],
[
76,
77
],
[
67,
78
],
[
79,
79
],
[
79,
80
],
[
80,
81
],
[
80,
82
],
[
82,
83
],
[
82,
84
],
[
82,
85
],
[
85,
86
],
[
85,
87
],
[
85,
88
],
[
37,
89
],
[
89,
90
],
[
90,
91
],
[
91,
92
],
[
91,
93
],
[
89,
94
],
[
145,
95
],
[
95,
96
],
[
95,
97
],
[
97,
98
],
[
98,
99
],
[
98,
100
],
[
97,
101
],
[
101,
102
],
[
102,
103
],
[
102,
104
],
[
101,
105
],
[
105,
106
],
[
106,
107
],
[
105,
108
],
[
108,
109
],
[
108,
110
],
[
105,
111
],
[
111,
112
],
[
111,
113
],
[
105,
114
],
[
114,
115
],
[
114,
116
],
[
97,
117
],
[
117,
118
],
[
117,
119
],
[
119,
120
],
[
119,
121
],
[
97,
122
],
[
122,
123
],
[
123,
124
],
[
123,
125
],
[
122,
126
],
[
126,
127
],
[
127,
128
],
[
127,
129
],
[
126,
130
],
[
130,
131
],
[
130,
132
],
[
126,
133
],
[
133,
134
],
[
133,
135
],
[
135,
136
],
[
135,
137
],
[
97,
138
],
[
138,
139
],
[
95,
140
],
[
140,
141
],
[
95,
142
],
[
142,
143
],
[
0,
144
],
[
144,
145
],
[
144,
146
]
] |
[
"import java.util.*;\n\npublic class Main {\n public static void main(String[] args) {\n Main main = new Main();\n main.run();\n }\n \n // 変数一覧\n int k;\n\n public void run() {\n // 入力情報取得\n Scanner sc = new Scanner(System.in);\n k = sc.nextInt();\n sc.close();\n\n // 解答処理\n solve();\n }\n \n private void solve() {\n int ans = 0;\n for (int i = 1; i <= k; i++) {\n for (int j = 1; j <= k; j++) {\n for (int l = 1; l <= k; l++) {\n ans += gcd(i, gcd(j, l));\n }\n } \n }\n System.out.println(ans);\n }\n \n private int gcd(int a, int b) {\n int r = 0;\n if (a < b) {\n int tmp;\n tmp = a;\n a = b;\n b = tmp;\n }\n r = a % b;\n while (r != 0) {\n a = b;\n b = r;\n r = a % b;\n }\n return b;\n }\n}",
"import java.util.*;",
"util.*",
"java",
"public class Main {\n public static void main(String[] args) {\n Main main = new Main();\n main.run();\n }\n \n // 変数一覧\n int k;\n\n public void run() {\n // 入力情報取得\n Scanner sc = new Scanner(System.in);\n k = sc.nextInt();\n sc.close();\n\n // 解答処理\n solve();\n }\n \n private void solve() {\n int ans = 0;\n for (int i = 1; i <= k; i++) {\n for (int j = 1; j <= k; j++) {\n for (int l = 1; l <= k; l++) {\n ans += gcd(i, gcd(j, l));\n }\n } \n }\n System.out.println(ans);\n }\n \n private int gcd(int a, int b) {\n int r = 0;\n if (a < b) {\n int tmp;\n tmp = a;\n a = b;\n b = tmp;\n }\n r = a % b;\n while (r != 0) {\n a = b;\n b = r;\n r = a % b;\n }\n return b;\n }\n}",
"Main",
"// 変数一覧\n int k;",
"k",
"public static void main(String[] args) {\n Main main = new Main();\n main.run();\n }",
"main",
"{\n Main main = new Main();\n main.run();\n }",
"Main main = new Main();",
"main",
"new Main()",
"main.run()",
"main.run",
"main",
"String[] args",
"args",
"public void run() {\n // 入力情報取得\n Scanner sc = new Scanner(System.in);\n k = sc.nextInt();\n sc.close();\n\n // 解答処理\n solve();\n }",
"run",
"{\n // 入力情報取得\n Scanner sc = new Scanner(System.in);\n k = sc.nextInt();\n sc.close();\n\n // 解答処理\n solve();\n }",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"k = sc.nextInt()",
"k",
"sc.nextInt()",
"sc.nextInt",
"sc",
"sc.close()",
"sc.close",
"sc",
"solve()",
"solve",
"private void solve() {\n int ans = 0;\n for (int i = 1; i <= k; i++) {\n for (int j = 1; j <= k; j++) {\n for (int l = 1; l <= k; l++) {\n ans += gcd(i, gcd(j, l));\n }\n } \n }\n System.out.println(ans);\n }",
"solve",
"{\n int ans = 0;\n for (int i = 1; i <= k; i++) {\n for (int j = 1; j <= k; j++) {\n for (int l = 1; l <= k; l++) {\n ans += gcd(i, gcd(j, l));\n }\n } \n }\n System.out.println(ans);\n }",
"int ans = 0;",
"ans",
"0",
"for (int i = 1; i <= k; i++) {\n for (int j = 1; j <= k; j++) {\n for (int l = 1; l <= k; l++) {\n ans += gcd(i, gcd(j, l));\n }\n } \n }",
"int i = 1;",
"int i = 1;",
"i",
"1",
"i <= k",
"i",
"k",
"i++",
"i++",
"i",
"{\n for (int j = 1; j <= k; j++) {\n for (int l = 1; l <= k; l++) {\n ans += gcd(i, gcd(j, l));\n }\n } \n }",
"{\n for (int j = 1; j <= k; j++) {\n for (int l = 1; l <= k; l++) {\n ans += gcd(i, gcd(j, l));\n }\n } \n }",
"for (int j = 1; j <= k; j++) {\n for (int l = 1; l <= k; l++) {\n ans += gcd(i, gcd(j, l));\n }\n }",
"int j = 1;",
"int j = 1;",
"j",
"1",
"j <= k",
"j",
"k",
"j++",
"j++",
"j",
"{\n for (int l = 1; l <= k; l++) {\n ans += gcd(i, gcd(j, l));\n }\n }",
"{\n for (int l = 1; l <= k; l++) {\n ans += gcd(i, gcd(j, l));\n }\n }",
"for (int l = 1; l <= k; l++) {\n ans += gcd(i, gcd(j, l));\n }",
"int l = 1;",
"int l = 1;",
"l",
"1",
"l <= k",
"l",
"k",
"l++",
"l++",
"l",
"{\n ans += gcd(i, gcd(j, l));\n }",
"{\n ans += gcd(i, gcd(j, l));\n }",
"ans += gcd(i, gcd(j, l))",
"ans",
"gcd(i, gcd(j, l))",
"gcd",
"i",
"gcd(j, l)",
"gcd",
"j",
"l",
"System.out.println(ans)",
"System.out.println",
"System.out",
"System",
"System.out",
"ans",
"private int gcd(int a, int b) {\n int r = 0;\n if (a < b) {\n int tmp;\n tmp = a;\n a = b;\n b = tmp;\n }\n r = a % b;\n while (r != 0) {\n a = b;\n b = r;\n r = a % b;\n }\n return b;\n }",
"gcd",
"{\n int r = 0;\n if (a < b) {\n int tmp;\n tmp = a;\n a = b;\n b = tmp;\n }\n r = a % b;\n while (r != 0) {\n a = b;\n b = r;\n r = a % b;\n }\n return b;\n }",
"int r = 0;",
"r",
"0",
"if (a < b) {\n int tmp;\n tmp = a;\n a = b;\n b = tmp;\n }",
"a < b",
"a",
"b",
"{\n int tmp;\n tmp = a;\n a = b;\n b = tmp;\n }",
"int tmp;",
"tmp",
"tmp = a",
"tmp",
"a",
"a = b",
"a",
"b",
"b = tmp",
"b",
"tmp",
"r = a % b",
"r",
"a % b",
"a",
"b",
"while (r != 0) {\n a = b;\n b = r;\n r = a % b;\n }",
"r != 0",
"r",
"0",
"{\n a = b;\n b = r;\n r = a % b;\n }",
"a = b",
"a",
"b",
"b = r",
"b",
"r",
"r = a % b",
"r",
"a % b",
"a",
"b",
"return b;",
"b",
"int a",
"a",
"int b",
"b",
"public class Main {\n public static void main(String[] args) {\n Main main = new Main();\n main.run();\n }\n \n // 変数一覧\n int k;\n\n public void run() {\n // 入力情報取得\n Scanner sc = new Scanner(System.in);\n k = sc.nextInt();\n sc.close();\n\n // 解答処理\n solve();\n }\n \n private void solve() {\n int ans = 0;\n for (int i = 1; i <= k; i++) {\n for (int j = 1; j <= k; j++) {\n for (int l = 1; l <= k; l++) {\n ans += gcd(i, gcd(j, l));\n }\n } \n }\n System.out.println(ans);\n }\n \n private int gcd(int a, int b) {\n int r = 0;\n if (a < b) {\n int tmp;\n tmp = a;\n a = b;\n b = tmp;\n }\n r = a % b;\n while (r != 0) {\n a = b;\n b = r;\n r = a % b;\n }\n return b;\n }\n}",
"public class Main {\n public static void main(String[] args) {\n Main main = new Main();\n main.run();\n }\n \n // 変数一覧\n int k;\n\n public void run() {\n // 入力情報取得\n Scanner sc = new Scanner(System.in);\n k = sc.nextInt();\n sc.close();\n\n // 解答処理\n solve();\n }\n \n private void solve() {\n int ans = 0;\n for (int i = 1; i <= k; i++) {\n for (int j = 1; j <= k; j++) {\n for (int l = 1; l <= k; l++) {\n ans += gcd(i, gcd(j, l));\n }\n } \n }\n System.out.println(ans);\n }\n \n private int gcd(int a, int b) {\n int r = 0;\n if (a < b) {\n int tmp;\n tmp = a;\n a = b;\n b = tmp;\n }\n r = a % b;\n while (r != 0) {\n a = b;\n b = r;\n r = a % b;\n }\n return b;\n }\n}",
"Main"
] |
import java.util.*;
public class Main {
public static void main(String[] args) {
Main main = new Main();
main.run();
}
// 変数一覧
int k;
public void run() {
// 入力情報取得
Scanner sc = new Scanner(System.in);
k = sc.nextInt();
sc.close();
// 解答処理
solve();
}
private void solve() {
int ans = 0;
for (int i = 1; i <= k; i++) {
for (int j = 1; j <= k; j++) {
for (int l = 1; l <= k; l++) {
ans += gcd(i, gcd(j, l));
}
}
}
System.out.println(ans);
}
private int gcd(int a, int b) {
int r = 0;
if (a < b) {
int tmp;
tmp = a;
a = b;
b = tmp;
}
r = a % b;
while (r != 0) {
a = b;
b = r;
r = a % b;
}
return b;
}
}
|
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
4,
18,
13,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
4,
13,
13,
13,
13,
4,
18,
18,
13,
13,
13,
23,
13,
12,
13,
30,
14,
2,
13,
17,
30,
29,
13,
29,
4,
13,
13,
2,
13,
13,
23,
13,
23,
13,
12,
13,
30,
41,
13,
4,
13,
13,
13,
29,
4,
13,
13,
13,
23,
13,
23,
13,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
119,
5
],
[
119,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
8,
17
],
[
17,
18
],
[
18,
19
],
[
8,
20
],
[
20,
21
],
[
20,
22
],
[
8,
23
],
[
23,
24
],
[
24,
25
],
[
25,
26
],
[
25,
27
],
[
23,
28
],
[
28,
29
],
[
28,
30
],
[
23,
31
],
[
31,
32
],
[
32,
33
],
[
23,
34
],
[
35,
35
],
[
35,
36
],
[
36,
37
],
[
37,
38
],
[
38,
39
],
[
38,
40
],
[
36,
41
],
[
41,
42
],
[
41,
43
],
[
36,
44
],
[
44,
45
],
[
45,
46
],
[
36,
47
],
[
48,
48
],
[
48,
49
],
[
49,
50
],
[
50,
51
],
[
51,
52
],
[
51,
53
],
[
49,
54
],
[
54,
55
],
[
54,
56
],
[
49,
57
],
[
57,
58
],
[
58,
59
],
[
49,
60
],
[
61,
61
],
[
61,
62
],
[
62,
63
],
[
62,
64
],
[
64,
65
],
[
64,
66
],
[
64,
67
],
[
64,
68
],
[
8,
69
],
[
69,
70
],
[
70,
71
],
[
71,
72
],
[
71,
73
],
[
69,
74
],
[
6,
75
],
[
75,
76
],
[
119,
77
],
[
77,
78
],
[
77,
79
],
[
79,
80
],
[
80,
81
],
[
81,
82
],
[
81,
83
],
[
80,
84
],
[
84,
85
],
[
85,
86
],
[
79,
87
],
[
87,
88
],
[
88,
89
],
[
88,
90
],
[
88,
91
],
[
91,
92
],
[
91,
93
],
[
77,
94
],
[
94,
95
],
[
77,
96
],
[
96,
97
],
[
119,
98
],
[
98,
99
],
[
98,
100
],
[
100,
101
],
[
101,
102
],
[
101,
103
],
[
103,
104
],
[
103,
105
],
[
103,
106
],
[
100,
107
],
[
107,
108
],
[
108,
109
],
[
108,
110
],
[
108,
111
],
[
98,
112
],
[
112,
113
],
[
98,
114
],
[
114,
115
],
[
98,
116
],
[
116,
117
],
[
0,
118
],
[
118,
119
],
[
118,
120
]
] |
[
"import java.util.*;\n\npublic class Main {\n\n\tpublic static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\tint K = sc.nextInt();\n\t\tsc.close();\n\n\t\tlong ans = 0;\n\n\t\tfor (int i = 1; i <= K; i++) {\n\t\t\tfor (int j = 1; j <= K; j++) {\n\t\t\t\tfor (int k = 1; k <= K; k++) {\n\t\t\t\t\tans += threeGCD(i, j, k);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tSystem.out.println(ans);\n\t}\n\n\tpublic static long GCD(long a, long b) {\n\t\tif (b == 0) {\n\t\t\treturn a;\n\t\t}\n\t\treturn GCD(b, a % b);\n\t}\n\n\tpublic static long threeGCD(long a, long b, long c) {\n\t\tlong d = GCD(a, b);\n\t\treturn GCD(c, d);\n\t}\n}",
"import java.util.*;",
"util.*",
"java",
"public class Main {\n\n\tpublic static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\tint K = sc.nextInt();\n\t\tsc.close();\n\n\t\tlong ans = 0;\n\n\t\tfor (int i = 1; i <= K; i++) {\n\t\t\tfor (int j = 1; j <= K; j++) {\n\t\t\t\tfor (int k = 1; k <= K; k++) {\n\t\t\t\t\tans += threeGCD(i, j, k);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tSystem.out.println(ans);\n\t}\n\n\tpublic static long GCD(long a, long b) {\n\t\tif (b == 0) {\n\t\t\treturn a;\n\t\t}\n\t\treturn GCD(b, a % b);\n\t}\n\n\tpublic static long threeGCD(long a, long b, long c) {\n\t\tlong d = GCD(a, b);\n\t\treturn GCD(c, d);\n\t}\n}",
"Main",
"public static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\tint K = sc.nextInt();\n\t\tsc.close();\n\n\t\tlong ans = 0;\n\n\t\tfor (int i = 1; i <= K; i++) {\n\t\t\tfor (int j = 1; j <= K; j++) {\n\t\t\t\tfor (int k = 1; k <= K; k++) {\n\t\t\t\t\tans += threeGCD(i, j, k);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tSystem.out.println(ans);\n\t}",
"main",
"{\n\t\tScanner sc = new Scanner(System.in);\n\t\tint K = sc.nextInt();\n\t\tsc.close();\n\n\t\tlong ans = 0;\n\n\t\tfor (int i = 1; i <= K; i++) {\n\t\t\tfor (int j = 1; j <= K; j++) {\n\t\t\t\tfor (int k = 1; k <= K; k++) {\n\t\t\t\t\tans += threeGCD(i, j, k);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tSystem.out.println(ans);\n\t}",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"int K = sc.nextInt();",
"K",
"sc.nextInt()",
"sc.nextInt",
"sc",
"sc.close()",
"sc.close",
"sc",
"long ans = 0;",
"ans",
"0",
"for (int i = 1; i <= K; i++) {\n\t\t\tfor (int j = 1; j <= K; j++) {\n\t\t\t\tfor (int k = 1; k <= K; k++) {\n\t\t\t\t\tans += threeGCD(i, j, k);\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"int i = 1;",
"int i = 1;",
"i",
"1",
"i <= K",
"i",
"K",
"i++",
"i++",
"i",
"{\n\t\t\tfor (int j = 1; j <= K; j++) {\n\t\t\t\tfor (int k = 1; k <= K; k++) {\n\t\t\t\t\tans += threeGCD(i, j, k);\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"{\n\t\t\tfor (int j = 1; j <= K; j++) {\n\t\t\t\tfor (int k = 1; k <= K; k++) {\n\t\t\t\t\tans += threeGCD(i, j, k);\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"for (int j = 1; j <= K; j++) {\n\t\t\t\tfor (int k = 1; k <= K; k++) {\n\t\t\t\t\tans += threeGCD(i, j, k);\n\t\t\t\t}\n\t\t\t}",
"int j = 1;",
"int j = 1;",
"j",
"1",
"j <= K",
"j",
"K",
"j++",
"j++",
"j",
"{\n\t\t\t\tfor (int k = 1; k <= K; k++) {\n\t\t\t\t\tans += threeGCD(i, j, k);\n\t\t\t\t}\n\t\t\t}",
"{\n\t\t\t\tfor (int k = 1; k <= K; k++) {\n\t\t\t\t\tans += threeGCD(i, j, k);\n\t\t\t\t}\n\t\t\t}",
"for (int k = 1; k <= K; k++) {\n\t\t\t\t\tans += threeGCD(i, j, k);\n\t\t\t\t}",
"int k = 1;",
"int k = 1;",
"k",
"1",
"k <= K",
"k",
"K",
"k++",
"k++",
"k",
"{\n\t\t\t\t\tans += threeGCD(i, j, k);\n\t\t\t\t}",
"{\n\t\t\t\t\tans += threeGCD(i, j, k);\n\t\t\t\t}",
"ans += threeGCD(i, j, k)",
"ans",
"threeGCD(i, j, k)",
"threeGCD",
"i",
"j",
"k",
"System.out.println(ans)",
"System.out.println",
"System.out",
"System",
"System.out",
"ans",
"String[] args",
"args",
"public static long GCD(long a, long b) {\n\t\tif (b == 0) {\n\t\t\treturn a;\n\t\t}\n\t\treturn GCD(b, a % b);\n\t}",
"GCD",
"{\n\t\tif (b == 0) {\n\t\t\treturn a;\n\t\t}\n\t\treturn GCD(b, a % b);\n\t}",
"if (b == 0) {\n\t\t\treturn a;\n\t\t}",
"b == 0",
"b",
"0",
"{\n\t\t\treturn a;\n\t\t}",
"return a;",
"a",
"return GCD(b, a % b);",
"GCD(b, a % b)",
"GCD",
"b",
"a % b",
"a",
"b",
"long a",
"a",
"long b",
"b",
"public static long threeGCD(long a, long b, long c) {\n\t\tlong d = GCD(a, b);\n\t\treturn GCD(c, d);\n\t}",
"threeGCD",
"{\n\t\tlong d = GCD(a, b);\n\t\treturn GCD(c, d);\n\t}",
"long d = GCD(a, b);",
"d",
"GCD(a, b)",
"GCD",
"a",
"b",
"return GCD(c, d);",
"GCD(c, d)",
"GCD",
"c",
"d",
"long a",
"a",
"long b",
"b",
"long c",
"c",
"public class Main {\n\n\tpublic static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\tint K = sc.nextInt();\n\t\tsc.close();\n\n\t\tlong ans = 0;\n\n\t\tfor (int i = 1; i <= K; i++) {\n\t\t\tfor (int j = 1; j <= K; j++) {\n\t\t\t\tfor (int k = 1; k <= K; k++) {\n\t\t\t\t\tans += threeGCD(i, j, k);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tSystem.out.println(ans);\n\t}\n\n\tpublic static long GCD(long a, long b) {\n\t\tif (b == 0) {\n\t\t\treturn a;\n\t\t}\n\t\treturn GCD(b, a % b);\n\t}\n\n\tpublic static long threeGCD(long a, long b, long c) {\n\t\tlong d = GCD(a, b);\n\t\treturn GCD(c, d);\n\t}\n}",
"public class Main {\n\n\tpublic static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\tint K = sc.nextInt();\n\t\tsc.close();\n\n\t\tlong ans = 0;\n\n\t\tfor (int i = 1; i <= K; i++) {\n\t\t\tfor (int j = 1; j <= K; j++) {\n\t\t\t\tfor (int k = 1; k <= K; k++) {\n\t\t\t\t\tans += threeGCD(i, j, k);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tSystem.out.println(ans);\n\t}\n\n\tpublic static long GCD(long a, long b) {\n\t\tif (b == 0) {\n\t\t\treturn a;\n\t\t}\n\t\treturn GCD(b, a % b);\n\t}\n\n\tpublic static long threeGCD(long a, long b, long c) {\n\t\tlong d = GCD(a, b);\n\t\treturn GCD(c, d);\n\t}\n}",
"Main"
] |
import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int K = sc.nextInt();
sc.close();
long ans = 0;
for (int i = 1; i <= K; i++) {
for (int j = 1; j <= K; j++) {
for (int k = 1; k <= K; k++) {
ans += threeGCD(i, j, k);
}
}
}
System.out.println(ans);
}
public static long GCD(long a, long b) {
if (b == 0) {
return a;
}
return GCD(b, a % b);
}
public static long threeGCD(long a, long b, long c) {
long d = GCD(a, b);
return GCD(c, d);
}
}
|
[
7,
15,
13,
17,
6,
13,
41,
13,
20,
12,
13,
30,
41,
13,
42,
2,
0,
13,
2,
13,
13,
17,
30,
0,
13,
13,
0,
13,
13,
29,
13,
23,
13,
23,
13,
12,
13,
30,
41,
13,
4,
18,
13,
41,
13,
17,
41,
13,
17,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
4,
13,
13,
13,
0,
13,
4,
13,
13,
13,
0,
13,
13,
4,
18,
18,
13,
13,
13,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
115,
5
],
[
115,
6
],
[
6,
7
],
[
6,
8
],
[
115,
9
],
[
9,
10
],
[
9,
11
],
[
11,
12
],
[
12,
13
],
[
11,
14
],
[
14,
15
],
[
15,
16
],
[
16,
17
],
[
16,
18
],
[
18,
19
],
[
18,
20
],
[
15,
21
],
[
14,
22
],
[
22,
23
],
[
23,
24
],
[
23,
25
],
[
22,
26
],
[
26,
27
],
[
26,
28
],
[
11,
29
],
[
29,
30
],
[
9,
31
],
[
31,
32
],
[
9,
33
],
[
33,
34
],
[
115,
35
],
[
35,
36
],
[
35,
37
],
[
37,
38
],
[
38,
39
],
[
38,
40
],
[
40,
41
],
[
41,
42
],
[
37,
43
],
[
43,
44
],
[
43,
45
],
[
37,
46
],
[
46,
47
],
[
46,
48
],
[
37,
49
],
[
49,
50
],
[
49,
51
],
[
37,
52
],
[
52,
53
],
[
53,
54
],
[
54,
55
],
[
54,
56
],
[
52,
57
],
[
57,
58
],
[
57,
59
],
[
52,
60
],
[
60,
61
],
[
61,
62
],
[
52,
63
],
[
64,
64
],
[
64,
65
],
[
65,
66
],
[
66,
67
],
[
67,
68
],
[
67,
69
],
[
65,
70
],
[
70,
71
],
[
70,
72
],
[
65,
73
],
[
73,
74
],
[
74,
75
],
[
65,
76
],
[
77,
77
],
[
77,
78
],
[
78,
79
],
[
79,
80
],
[
80,
81
],
[
80,
82
],
[
78,
83
],
[
83,
84
],
[
83,
85
],
[
78,
86
],
[
86,
87
],
[
87,
88
],
[
78,
89
],
[
90,
90
],
[
90,
91
],
[
91,
92
],
[
91,
93
],
[
93,
94
],
[
93,
95
],
[
93,
96
],
[
90,
97
],
[
97,
98
],
[
97,
99
],
[
99,
100
],
[
99,
101
],
[
99,
102
],
[
90,
103
],
[
103,
104
],
[
103,
105
],
[
37,
106
],
[
106,
107
],
[
107,
108
],
[
108,
109
],
[
108,
110
],
[
106,
111
],
[
35,
112
],
[
112,
113
],
[
0,
114
],
[
114,
115
],
[
114,
116
]
] |
[
"import java.util.Scanner;\npublic class Main {\n static Scanner sc = new Scanner(System.in);\n public static int gcd (int a, int b) {\n int temp;\n while((temp = a%b)!=0) {\n a = b;\n b = temp;\n }\n return b;\n }\n public static void main(String[] args) {\n int N = sc.nextInt();\n int answer = 0;\n int x = 0; int y = 0;\n for(int i = 1; i <= N; i++){\n for(int j = 1; j <= N; j++){\n for(int k = 1; k <= N; k++){\n x = gcd(i,j);\n y = gcd(x,k);\n answer += y;\n }\n }\n }\n System.out.println(answer);\n }\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n static Scanner sc = new Scanner(System.in);\n public static int gcd (int a, int b) {\n int temp;\n while((temp = a%b)!=0) {\n a = b;\n b = temp;\n }\n return b;\n }\n public static void main(String[] args) {\n int N = sc.nextInt();\n int answer = 0;\n int x = 0; int y = 0;\n for(int i = 1; i <= N; i++){\n for(int j = 1; j <= N; j++){\n for(int k = 1; k <= N; k++){\n x = gcd(i,j);\n y = gcd(x,k);\n answer += y;\n }\n }\n }\n System.out.println(answer);\n }\n}",
"Main",
"static Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"public static int gcd (int a, int b) {\n int temp;\n while((temp = a%b)!=0) {\n a = b;\n b = temp;\n }\n return b;\n }",
"gcd",
"{\n int temp;\n while((temp = a%b)!=0) {\n a = b;\n b = temp;\n }\n return b;\n }",
"int temp;",
"temp",
"while((temp = a%b)!=0) {\n a = b;\n b = temp;\n }",
"(temp = a%b)!=0",
"(temp = a%b)",
"temp",
"a%b",
"a",
"b",
"0",
"{\n a = b;\n b = temp;\n }",
"a = b",
"a",
"b",
"b = temp",
"b",
"temp",
"return b;",
"b",
"int a",
"a",
"int b",
"b",
"public static void main(String[] args) {\n int N = sc.nextInt();\n int answer = 0;\n int x = 0; int y = 0;\n for(int i = 1; i <= N; i++){\n for(int j = 1; j <= N; j++){\n for(int k = 1; k <= N; k++){\n x = gcd(i,j);\n y = gcd(x,k);\n answer += y;\n }\n }\n }\n System.out.println(answer);\n }",
"main",
"{\n int N = sc.nextInt();\n int answer = 0;\n int x = 0; int y = 0;\n for(int i = 1; i <= N; i++){\n for(int j = 1; j <= N; j++){\n for(int k = 1; k <= N; k++){\n x = gcd(i,j);\n y = gcd(x,k);\n answer += y;\n }\n }\n }\n System.out.println(answer);\n }",
"int N = sc.nextInt();",
"N",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int answer = 0;",
"answer",
"0",
"int x = 0;",
"x",
"0",
"int y = 0;",
"y",
"0",
"for(int i = 1; i <= N; i++){\n for(int j = 1; j <= N; j++){\n for(int k = 1; k <= N; k++){\n x = gcd(i,j);\n y = gcd(x,k);\n answer += y;\n }\n }\n }",
"int i = 1;",
"int i = 1;",
"i",
"1",
"i <= N",
"i",
"N",
"i++",
"i++",
"i",
"{\n for(int j = 1; j <= N; j++){\n for(int k = 1; k <= N; k++){\n x = gcd(i,j);\n y = gcd(x,k);\n answer += y;\n }\n }\n }",
"{\n for(int j = 1; j <= N; j++){\n for(int k = 1; k <= N; k++){\n x = gcd(i,j);\n y = gcd(x,k);\n answer += y;\n }\n }\n }",
"for(int j = 1; j <= N; j++){\n for(int k = 1; k <= N; k++){\n x = gcd(i,j);\n y = gcd(x,k);\n answer += y;\n }\n }",
"int j = 1;",
"int j = 1;",
"j",
"1",
"j <= N",
"j",
"N",
"j++",
"j++",
"j",
"{\n for(int k = 1; k <= N; k++){\n x = gcd(i,j);\n y = gcd(x,k);\n answer += y;\n }\n }",
"{\n for(int k = 1; k <= N; k++){\n x = gcd(i,j);\n y = gcd(x,k);\n answer += y;\n }\n }",
"for(int k = 1; k <= N; k++){\n x = gcd(i,j);\n y = gcd(x,k);\n answer += y;\n }",
"int k = 1;",
"int k = 1;",
"k",
"1",
"k <= N",
"k",
"N",
"k++",
"k++",
"k",
"{\n x = gcd(i,j);\n y = gcd(x,k);\n answer += y;\n }",
"{\n x = gcd(i,j);\n y = gcd(x,k);\n answer += y;\n }",
"x = gcd(i,j)",
"x",
"gcd(i,j)",
"gcd",
"i",
"j",
"y = gcd(x,k)",
"y",
"gcd(x,k)",
"gcd",
"x",
"k",
"answer += y",
"answer",
"y",
"System.out.println(answer)",
"System.out.println",
"System.out",
"System",
"System.out",
"answer",
"String[] args",
"args",
"public class Main {\n static Scanner sc = new Scanner(System.in);\n public static int gcd (int a, int b) {\n int temp;\n while((temp = a%b)!=0) {\n a = b;\n b = temp;\n }\n return b;\n }\n public static void main(String[] args) {\n int N = sc.nextInt();\n int answer = 0;\n int x = 0; int y = 0;\n for(int i = 1; i <= N; i++){\n for(int j = 1; j <= N; j++){\n for(int k = 1; k <= N; k++){\n x = gcd(i,j);\n y = gcd(x,k);\n answer += y;\n }\n }\n }\n System.out.println(answer);\n }\n}",
"public class Main {\n static Scanner sc = new Scanner(System.in);\n public static int gcd (int a, int b) {\n int temp;\n while((temp = a%b)!=0) {\n a = b;\n b = temp;\n }\n return b;\n }\n public static void main(String[] args) {\n int N = sc.nextInt();\n int answer = 0;\n int x = 0; int y = 0;\n for(int i = 1; i <= N; i++){\n for(int j = 1; j <= N; j++){\n for(int k = 1; k <= N; k++){\n x = gcd(i,j);\n y = gcd(x,k);\n answer += y;\n }\n }\n }\n System.out.println(answer);\n }\n}",
"Main"
] |
import java.util.Scanner;
public class Main {
static Scanner sc = new Scanner(System.in);
public static int gcd (int a, int b) {
int temp;
while((temp = a%b)!=0) {
a = b;
b = temp;
}
return b;
}
public static void main(String[] args) {
int N = sc.nextInt();
int answer = 0;
int x = 0; int y = 0;
for(int i = 1; i <= N; i++){
for(int j = 1; j <= N; j++){
for(int k = 1; k <= N; k++){
x = gcd(i,j);
y = gcd(x,k);
answer += y;
}
}
}
System.out.println(answer);
}
}
|
[
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,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
4,
13,
4,
13,
13,
13,
13,
4,
18,
18,
13,
13,
13,
23,
13,
12,
13,
30,
14,
2,
13,
17,
29,
13,
29,
4,
13,
13,
2,
13,
13,
23,
13,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
10,
11
],
[
10,
12
],
[
0,
13
],
[
106,
14
],
[
106,
15
],
[
15,
16
],
[
15,
17
],
[
17,
18
],
[
18,
19
],
[
18,
20
],
[
17,
21
],
[
21,
22
],
[
21,
23
],
[
23,
24
],
[
24,
25
],
[
17,
26
],
[
26,
27
],
[
26,
28
],
[
17,
29
],
[
29,
30
],
[
30,
31
],
[
31,
32
],
[
31,
33
],
[
29,
34
],
[
34,
35
],
[
34,
36
],
[
29,
37
],
[
37,
38
],
[
38,
39
],
[
29,
40
],
[
41,
41
],
[
41,
42
],
[
42,
43
],
[
43,
44
],
[
44,
45
],
[
44,
46
],
[
42,
47
],
[
47,
48
],
[
47,
49
],
[
42,
50
],
[
50,
51
],
[
51,
52
],
[
42,
53
],
[
54,
54
],
[
54,
55
],
[
55,
56
],
[
56,
57
],
[
57,
58
],
[
57,
59
],
[
55,
60
],
[
60,
61
],
[
60,
62
],
[
55,
63
],
[
63,
64
],
[
64,
65
],
[
55,
66
],
[
67,
67
],
[
67,
68
],
[
68,
69
],
[
68,
70
],
[
70,
71
],
[
70,
72
],
[
72,
73
],
[
72,
74
],
[
72,
75
],
[
70,
76
],
[
17,
77
],
[
77,
78
],
[
78,
79
],
[
79,
80
],
[
79,
81
],
[
77,
82
],
[
15,
83
],
[
83,
84
],
[
106,
85
],
[
85,
86
],
[
85,
87
],
[
87,
88
],
[
88,
89
],
[
89,
90
],
[
89,
91
],
[
88,
92
],
[
92,
93
],
[
87,
94
],
[
94,
95
],
[
95,
96
],
[
95,
97
],
[
95,
98
],
[
98,
99
],
[
98,
100
],
[
85,
101
],
[
101,
102
],
[
85,
103
],
[
103,
104
],
[
0,
105
],
[
105,
106
],
[
105,
107
]
] |
[
"import java.io.File;\nimport java.io.FileInputStream;\nimport java.io.FileNotFoundException;\nimport java.util.*;\n\npublic class Main {\n public static void main(String[] args) throws Exception {\n Scanner sc = new Scanner(System.in);\n int k = sc.nextInt();\n int sum = 0;\n\n for (int i=1; i<=k; i++) {\n for (int j=1; j<=k; j++) {\n for (int l=1; l<=k; l++) {\n sum += gcd(gcd(i, j), l);\n }\n }\n }\n\n System.out.println(sum);\n }\n\n public static int gcd(int num1, int num2) {\n if (num2 == 0) return num1;\n return gcd(num2, num1 % num2);\n }\n}",
"import java.io.File;",
"File",
"java.io",
"import java.io.FileInputStream;",
"FileInputStream",
"java.io",
"import java.io.FileNotFoundException;",
"FileNotFoundException",
"java.io",
"import java.util.*;",
"util.*",
"java",
"public class Main {\n public static void main(String[] args) throws Exception {\n Scanner sc = new Scanner(System.in);\n int k = sc.nextInt();\n int sum = 0;\n\n for (int i=1; i<=k; i++) {\n for (int j=1; j<=k; j++) {\n for (int l=1; l<=k; l++) {\n sum += gcd(gcd(i, j), l);\n }\n }\n }\n\n System.out.println(sum);\n }\n\n public static int gcd(int num1, int num2) {\n if (num2 == 0) return num1;\n return gcd(num2, num1 % num2);\n }\n}",
"Main",
"public static void main(String[] args) throws Exception {\n Scanner sc = new Scanner(System.in);\n int k = sc.nextInt();\n int sum = 0;\n\n for (int i=1; i<=k; i++) {\n for (int j=1; j<=k; j++) {\n for (int l=1; l<=k; l++) {\n sum += gcd(gcd(i, j), l);\n }\n }\n }\n\n System.out.println(sum);\n }",
"main",
"{\n Scanner sc = new Scanner(System.in);\n int k = sc.nextInt();\n int sum = 0;\n\n for (int i=1; i<=k; i++) {\n for (int j=1; j<=k; j++) {\n for (int l=1; l<=k; l++) {\n sum += gcd(gcd(i, j), l);\n }\n }\n }\n\n System.out.println(sum);\n }",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"int k = sc.nextInt();",
"k",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int sum = 0;",
"sum",
"0",
"for (int i=1; i<=k; i++) {\n for (int j=1; j<=k; j++) {\n for (int l=1; l<=k; l++) {\n sum += gcd(gcd(i, j), l);\n }\n }\n }",
"int i=1;",
"int i=1;",
"i",
"1",
"i<=k",
"i",
"k",
"i++",
"i++",
"i",
"{\n for (int j=1; j<=k; j++) {\n for (int l=1; l<=k; l++) {\n sum += gcd(gcd(i, j), l);\n }\n }\n }",
"{\n for (int j=1; j<=k; j++) {\n for (int l=1; l<=k; l++) {\n sum += gcd(gcd(i, j), l);\n }\n }\n }",
"for (int j=1; j<=k; j++) {\n for (int l=1; l<=k; l++) {\n sum += gcd(gcd(i, j), l);\n }\n }",
"int j=1;",
"int j=1;",
"j",
"1",
"j<=k",
"j",
"k",
"j++",
"j++",
"j",
"{\n for (int l=1; l<=k; l++) {\n sum += gcd(gcd(i, j), l);\n }\n }",
"{\n for (int l=1; l<=k; l++) {\n sum += gcd(gcd(i, j), l);\n }\n }",
"for (int l=1; l<=k; l++) {\n sum += gcd(gcd(i, j), l);\n }",
"int l=1;",
"int l=1;",
"l",
"1",
"l<=k",
"l",
"k",
"l++",
"l++",
"l",
"{\n sum += gcd(gcd(i, j), l);\n }",
"{\n sum += gcd(gcd(i, j), l);\n }",
"sum += gcd(gcd(i, j), l)",
"sum",
"gcd(gcd(i, j), l)",
"gcd",
"gcd(i, j)",
"gcd",
"i",
"j",
"l",
"System.out.println(sum)",
"System.out.println",
"System.out",
"System",
"System.out",
"sum",
"String[] args",
"args",
"public static int gcd(int num1, int num2) {\n if (num2 == 0) return num1;\n return gcd(num2, num1 % num2);\n }",
"gcd",
"{\n if (num2 == 0) return num1;\n return gcd(num2, num1 % num2);\n }",
"if (num2 == 0) return num1;",
"num2 == 0",
"num2",
"0",
"return num1;",
"num1",
"return gcd(num2, num1 % num2);",
"gcd(num2, num1 % num2)",
"gcd",
"num2",
"num1 % num2",
"num1",
"num2",
"int num1",
"num1",
"int num2",
"num2",
"public class Main {\n public static void main(String[] args) throws Exception {\n Scanner sc = new Scanner(System.in);\n int k = sc.nextInt();\n int sum = 0;\n\n for (int i=1; i<=k; i++) {\n for (int j=1; j<=k; j++) {\n for (int l=1; l<=k; l++) {\n sum += gcd(gcd(i, j), l);\n }\n }\n }\n\n System.out.println(sum);\n }\n\n public static int gcd(int num1, int num2) {\n if (num2 == 0) return num1;\n return gcd(num2, num1 % num2);\n }\n}",
"public class Main {\n public static void main(String[] args) throws Exception {\n Scanner sc = new Scanner(System.in);\n int k = sc.nextInt();\n int sum = 0;\n\n for (int i=1; i<=k; i++) {\n for (int j=1; j<=k; j++) {\n for (int l=1; l<=k; l++) {\n sum += gcd(gcd(i, j), l);\n }\n }\n }\n\n System.out.println(sum);\n }\n\n public static int gcd(int num1, int num2) {\n if (num2 == 0) return num1;\n return gcd(num2, num1 % num2);\n }\n}",
"Main"
] |
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.util.*;
public class Main {
public static void main(String[] args) throws Exception {
Scanner sc = new Scanner(System.in);
int k = sc.nextInt();
int sum = 0;
for (int i=1; i<=k; i++) {
for (int j=1; j<=k; j++) {
for (int l=1; l<=k; l++) {
sum += gcd(gcd(i, j), l);
}
}
}
System.out.println(sum);
}
public static int gcd(int num1, int num2) {
if (num2 == 0) return num1;
return gcd(num2, num1 % num2);
}
}
|
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
4,
13,
13,
4,
13,
13,
13,
4,
18,
18,
13,
13,
13,
23,
13,
12,
13,
30,
41,
13,
42,
2,
13,
17,
30,
0,
13,
2,
13,
13,
0,
13,
13,
0,
13,
13,
29,
13,
23,
13,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
104,
5
],
[
104,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
8,
17
],
[
17,
18
],
[
17,
19
],
[
8,
20
],
[
20,
21
],
[
21,
22
],
[
22,
23
],
[
22,
24
],
[
20,
25
],
[
25,
26
],
[
25,
27
],
[
20,
28
],
[
28,
29
],
[
29,
30
],
[
20,
31
],
[
32,
32
],
[
32,
33
],
[
33,
34
],
[
34,
35
],
[
35,
36
],
[
35,
37
],
[
33,
38
],
[
38,
39
],
[
38,
40
],
[
33,
41
],
[
41,
42
],
[
42,
43
],
[
33,
44
],
[
45,
45
],
[
45,
46
],
[
46,
47
],
[
47,
48
],
[
48,
49
],
[
48,
50
],
[
46,
51
],
[
51,
52
],
[
51,
53
],
[
46,
54
],
[
54,
55
],
[
55,
56
],
[
46,
57
],
[
58,
58
],
[
58,
59
],
[
59,
60
],
[
59,
61
],
[
61,
62
],
[
61,
63
],
[
61,
64
],
[
64,
65
],
[
64,
66
],
[
64,
67
],
[
8,
68
],
[
68,
69
],
[
69,
70
],
[
70,
71
],
[
70,
72
],
[
68,
73
],
[
6,
74
],
[
74,
75
],
[
104,
76
],
[
76,
77
],
[
76,
78
],
[
78,
79
],
[
79,
80
],
[
78,
81
],
[
81,
82
],
[
82,
83
],
[
82,
84
],
[
81,
85
],
[
85,
86
],
[
86,
87
],
[
86,
88
],
[
88,
89
],
[
88,
90
],
[
85,
91
],
[
91,
92
],
[
91,
93
],
[
85,
94
],
[
94,
95
],
[
94,
96
],
[
78,
97
],
[
97,
98
],
[
76,
99
],
[
99,
100
],
[
76,
101
],
[
101,
102
],
[
0,
103
],
[
103,
104
],
[
103,
105
]
] |
[
"import java.util.*;\n\npublic class Main {\n static public void main(String args[]) {\n Scanner sc = new Scanner(System.in);\n int k = sc.nextInt(), ret = 0;\n\n for (int i = 1; i <= k; i++) {\n for (int j = 1; j <= k; j++) {\n for (int h = 1; h <= k; h++) {\n ret += gcd(i, gcd(j, h));\n }\n }\n }\n\n System.out.println(ret);\n }\n\n private static int gcd(int n, int m) {\n int r;\n while (n > 0) {\n r = m % n;\n m = n;\n n = r;\n }\n return m;\n }\n}",
"import java.util.*;",
"util.*",
"java",
"public class Main {\n static public void main(String args[]) {\n Scanner sc = new Scanner(System.in);\n int k = sc.nextInt(), ret = 0;\n\n for (int i = 1; i <= k; i++) {\n for (int j = 1; j <= k; j++) {\n for (int h = 1; h <= k; h++) {\n ret += gcd(i, gcd(j, h));\n }\n }\n }\n\n System.out.println(ret);\n }\n\n private static int gcd(int n, int m) {\n int r;\n while (n > 0) {\n r = m % n;\n m = n;\n n = r;\n }\n return m;\n }\n}",
"Main",
"static public void main(String args[]) {\n Scanner sc = new Scanner(System.in);\n int k = sc.nextInt(), ret = 0;\n\n for (int i = 1; i <= k; i++) {\n for (int j = 1; j <= k; j++) {\n for (int h = 1; h <= k; h++) {\n ret += gcd(i, gcd(j, h));\n }\n }\n }\n\n System.out.println(ret);\n }",
"main",
"{\n Scanner sc = new Scanner(System.in);\n int k = sc.nextInt(), ret = 0;\n\n for (int i = 1; i <= k; i++) {\n for (int j = 1; j <= k; j++) {\n for (int h = 1; h <= k; h++) {\n ret += gcd(i, gcd(j, h));\n }\n }\n }\n\n System.out.println(ret);\n }",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"int k = sc.nextInt()",
"k",
"sc.nextInt()",
"sc.nextInt",
"sc",
"ret = 0;",
"ret",
"0",
"for (int i = 1; i <= k; i++) {\n for (int j = 1; j <= k; j++) {\n for (int h = 1; h <= k; h++) {\n ret += gcd(i, gcd(j, h));\n }\n }\n }",
"int i = 1;",
"int i = 1;",
"i",
"1",
"i <= k",
"i",
"k",
"i++",
"i++",
"i",
"{\n for (int j = 1; j <= k; j++) {\n for (int h = 1; h <= k; h++) {\n ret += gcd(i, gcd(j, h));\n }\n }\n }",
"{\n for (int j = 1; j <= k; j++) {\n for (int h = 1; h <= k; h++) {\n ret += gcd(i, gcd(j, h));\n }\n }\n }",
"for (int j = 1; j <= k; j++) {\n for (int h = 1; h <= k; h++) {\n ret += gcd(i, gcd(j, h));\n }\n }",
"int j = 1;",
"int j = 1;",
"j",
"1",
"j <= k",
"j",
"k",
"j++",
"j++",
"j",
"{\n for (int h = 1; h <= k; h++) {\n ret += gcd(i, gcd(j, h));\n }\n }",
"{\n for (int h = 1; h <= k; h++) {\n ret += gcd(i, gcd(j, h));\n }\n }",
"for (int h = 1; h <= k; h++) {\n ret += gcd(i, gcd(j, h));\n }",
"int h = 1;",
"int h = 1;",
"h",
"1",
"h <= k",
"h",
"k",
"h++",
"h++",
"h",
"{\n ret += gcd(i, gcd(j, h));\n }",
"{\n ret += gcd(i, gcd(j, h));\n }",
"ret += gcd(i, gcd(j, h))",
"ret",
"gcd(i, gcd(j, h))",
"gcd",
"i",
"gcd(j, h)",
"gcd",
"j",
"h",
"System.out.println(ret)",
"System.out.println",
"System.out",
"System",
"System.out",
"ret",
"String args[]",
"args",
"private static int gcd(int n, int m) {\n int r;\n while (n > 0) {\n r = m % n;\n m = n;\n n = r;\n }\n return m;\n }",
"gcd",
"{\n int r;\n while (n > 0) {\n r = m % n;\n m = n;\n n = r;\n }\n return m;\n }",
"int r;",
"r",
"while (n > 0) {\n r = m % n;\n m = n;\n n = r;\n }",
"n > 0",
"n",
"0",
"{\n r = m % n;\n m = n;\n n = r;\n }",
"r = m % n",
"r",
"m % n",
"m",
"n",
"m = n",
"m",
"n",
"n = r",
"n",
"r",
"return m;",
"m",
"int n",
"n",
"int m",
"m",
"public class Main {\n static public void main(String args[]) {\n Scanner sc = new Scanner(System.in);\n int k = sc.nextInt(), ret = 0;\n\n for (int i = 1; i <= k; i++) {\n for (int j = 1; j <= k; j++) {\n for (int h = 1; h <= k; h++) {\n ret += gcd(i, gcd(j, h));\n }\n }\n }\n\n System.out.println(ret);\n }\n\n private static int gcd(int n, int m) {\n int r;\n while (n > 0) {\n r = m % n;\n m = n;\n n = r;\n }\n return m;\n }\n}",
"public class Main {\n static public void main(String args[]) {\n Scanner sc = new Scanner(System.in);\n int k = sc.nextInt(), ret = 0;\n\n for (int i = 1; i <= k; i++) {\n for (int j = 1; j <= k; j++) {\n for (int h = 1; h <= k; h++) {\n ret += gcd(i, gcd(j, h));\n }\n }\n }\n\n System.out.println(ret);\n }\n\n private static int gcd(int n, int m) {\n int r;\n while (n > 0) {\n r = m % n;\n m = n;\n n = r;\n }\n return m;\n }\n}",
"Main"
] |
import java.util.*;
public class Main {
static public void main(String args[]) {
Scanner sc = new Scanner(System.in);
int k = sc.nextInt(), ret = 0;
for (int i = 1; i <= k; i++) {
for (int j = 1; j <= k; j++) {
for (int h = 1; h <= k; h++) {
ret += gcd(i, gcd(j, h));
}
}
}
System.out.println(ret);
}
private static int gcd(int n, int m) {
int r;
while (n > 0) {
r = m % n;
m = n;
n = r;
}
return m;
}
}
|
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
13,
41,
13,
13,
41,
13,
13,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
41,
13,
4,
13,
13,
13,
41,
13,
4,
13,
13,
13,
0,
13,
13,
4,
18,
18,
13,
13,
13,
23,
13,
12,
13,
30,
42,
2,
13,
17,
30,
41,
13,
13,
0,
13,
2,
13,
13,
0,
13,
13,
29,
13,
23,
13,
23,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
8,
17
],
[
17,
18
],
[
17,
19
],
[
8,
20
],
[
20,
21
],
[
20,
22
],
[
8,
23
],
[
23,
24
],
[
23,
25
],
[
8,
26
],
[
26,
27
],
[
26,
28
],
[
8,
29
],
[
29,
30
],
[
30,
31
],
[
31,
32
],
[
31,
33
],
[
29,
34
],
[
34,
35
],
[
34,
36
],
[
29,
37
],
[
37,
38
],
[
38,
39
],
[
29,
40
],
[
41,
41
],
[
41,
42
],
[
42,
43
],
[
43,
44
],
[
44,
45
],
[
44,
46
],
[
42,
47
],
[
47,
48
],
[
47,
49
],
[
42,
50
],
[
50,
51
],
[
51,
52
],
[
42,
53
],
[
54,
54
],
[
54,
55
],
[
55,
56
],
[
56,
57
],
[
57,
58
],
[
57,
59
],
[
55,
60
],
[
60,
61
],
[
60,
62
],
[
55,
63
],
[
63,
64
],
[
64,
65
],
[
55,
66
],
[
67,
67
],
[
67,
68
],
[
68,
69
],
[
68,
70
],
[
70,
71
],
[
70,
72
],
[
70,
73
],
[
67,
74
],
[
74,
75
],
[
74,
76
],
[
76,
77
],
[
76,
78
],
[
76,
79
],
[
67,
80
],
[
80,
81
],
[
80,
82
],
[
8,
83
],
[
83,
84
],
[
84,
85
],
[
85,
86
],
[
85,
87
],
[
83,
88
],
[
6,
89
],
[
89,
90
],
[
4,
91
],
[
91,
92
],
[
91,
93
],
[
93,
94
],
[
94,
95
],
[
95,
96
],
[
95,
97
],
[
94,
98
],
[
98,
99
],
[
99,
100
],
[
99,
101
],
[
98,
102
],
[
102,
103
],
[
102,
104
],
[
104,
105
],
[
104,
106
],
[
98,
107
],
[
107,
108
],
[
107,
109
],
[
93,
110
],
[
110,
111
],
[
91,
112
],
[
112,
113
],
[
91,
114
],
[
114,
115
]
] |
[
"import java.util.*;\n\nclass Main {\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n int K = sc.nextInt();\n int a = K;\n int b = K;\n int c = K;\n \tint sum = 0;\n \n for (int A=1; A<=a; A++) {\n\t\t\tfor (int B=1; B<=b; B++) {\n\t\t\t\tfor (int C=1; C<=c; C++) {\n\t\t\t\t\tint t1 = gcd(A,B);\n \tint t2 = gcd(t1,C);\n \tsum += t2;\n\t\t\t\t}\n\t\t\t}\n } \n System.out.println(sum);\n }\n \nprivate static int gcd(int m, int n) {\n while (n > 0)\n {\n int temp = n;\n n = m % n; // % is remainder\n m = temp;\n }\n \treturn m;\n}\n}\n",
"import java.util.*;",
"util.*",
"java",
"class Main {\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n int K = sc.nextInt();\n int a = K;\n int b = K;\n int c = K;\n \tint sum = 0;\n \n for (int A=1; A<=a; A++) {\n\t\t\tfor (int B=1; B<=b; B++) {\n\t\t\t\tfor (int C=1; C<=c; C++) {\n\t\t\t\t\tint t1 = gcd(A,B);\n \tint t2 = gcd(t1,C);\n \tsum += t2;\n\t\t\t\t}\n\t\t\t}\n } \n System.out.println(sum);\n }\n \nprivate static int gcd(int m, int n) {\n while (n > 0)\n {\n int temp = n;\n n = m % n; // % is remainder\n m = temp;\n }\n \treturn m;\n}\n}",
"Main",
"public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n int K = sc.nextInt();\n int a = K;\n int b = K;\n int c = K;\n \tint sum = 0;\n \n for (int A=1; A<=a; A++) {\n\t\t\tfor (int B=1; B<=b; B++) {\n\t\t\t\tfor (int C=1; C<=c; C++) {\n\t\t\t\t\tint t1 = gcd(A,B);\n \tint t2 = gcd(t1,C);\n \tsum += t2;\n\t\t\t\t}\n\t\t\t}\n } \n System.out.println(sum);\n }",
"main",
"{\n Scanner sc = new Scanner(System.in);\n int K = sc.nextInt();\n int a = K;\n int b = K;\n int c = K;\n \tint sum = 0;\n \n for (int A=1; A<=a; A++) {\n\t\t\tfor (int B=1; B<=b; B++) {\n\t\t\t\tfor (int C=1; C<=c; C++) {\n\t\t\t\t\tint t1 = gcd(A,B);\n \tint t2 = gcd(t1,C);\n \tsum += t2;\n\t\t\t\t}\n\t\t\t}\n } \n System.out.println(sum);\n }",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"int K = sc.nextInt();",
"K",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int a = K;",
"a",
"K",
"int b = K;",
"b",
"K",
"int c = K;",
"c",
"K",
"int sum = 0;",
"sum",
"0",
"for (int A=1; A<=a; A++) {\n\t\t\tfor (int B=1; B<=b; B++) {\n\t\t\t\tfor (int C=1; C<=c; C++) {\n\t\t\t\t\tint t1 = gcd(A,B);\n \tint t2 = gcd(t1,C);\n \tsum += t2;\n\t\t\t\t}\n\t\t\t}\n }",
"int A=1;",
"int A=1;",
"A",
"1",
"A<=a",
"A",
"a",
"A++",
"A++",
"A",
"{\n\t\t\tfor (int B=1; B<=b; B++) {\n\t\t\t\tfor (int C=1; C<=c; C++) {\n\t\t\t\t\tint t1 = gcd(A,B);\n \tint t2 = gcd(t1,C);\n \tsum += t2;\n\t\t\t\t}\n\t\t\t}\n }",
"{\n\t\t\tfor (int B=1; B<=b; B++) {\n\t\t\t\tfor (int C=1; C<=c; C++) {\n\t\t\t\t\tint t1 = gcd(A,B);\n \tint t2 = gcd(t1,C);\n \tsum += t2;\n\t\t\t\t}\n\t\t\t}\n }",
"for (int B=1; B<=b; B++) {\n\t\t\t\tfor (int C=1; C<=c; C++) {\n\t\t\t\t\tint t1 = gcd(A,B);\n \tint t2 = gcd(t1,C);\n \tsum += t2;\n\t\t\t\t}\n\t\t\t}",
"int B=1;",
"int B=1;",
"B",
"1",
"B<=b",
"B",
"b",
"B++",
"B++",
"B",
"{\n\t\t\t\tfor (int C=1; C<=c; C++) {\n\t\t\t\t\tint t1 = gcd(A,B);\n \tint t2 = gcd(t1,C);\n \tsum += t2;\n\t\t\t\t}\n\t\t\t}",
"{\n\t\t\t\tfor (int C=1; C<=c; C++) {\n\t\t\t\t\tint t1 = gcd(A,B);\n \tint t2 = gcd(t1,C);\n \tsum += t2;\n\t\t\t\t}\n\t\t\t}",
"for (int C=1; C<=c; C++) {\n\t\t\t\t\tint t1 = gcd(A,B);\n \tint t2 = gcd(t1,C);\n \tsum += t2;\n\t\t\t\t}",
"int C=1;",
"int C=1;",
"C",
"1",
"C<=c",
"C",
"c",
"C++",
"C++",
"C",
"{\n\t\t\t\t\tint t1 = gcd(A,B);\n \tint t2 = gcd(t1,C);\n \tsum += t2;\n\t\t\t\t}",
"{\n\t\t\t\t\tint t1 = gcd(A,B);\n \tint t2 = gcd(t1,C);\n \tsum += t2;\n\t\t\t\t}",
"int t1 = gcd(A,B);",
"t1",
"gcd(A,B)",
"gcd",
"A",
"B",
"int t2 = gcd(t1,C);",
"t2",
"gcd(t1,C)",
"gcd",
"t1",
"C",
"sum += t2",
"sum",
"t2",
"System.out.println(sum)",
"System.out.println",
"System.out",
"System",
"System.out",
"sum",
"String[] args",
"args",
"private static int gcd(int m, int n) {\n while (n > 0)\n {\n int temp = n;\n n = m % n; // % is remainder\n m = temp;\n }\n \treturn m;\n}",
"gcd",
"{\n while (n > 0)\n {\n int temp = n;\n n = m % n; // % is remainder\n m = temp;\n }\n \treturn m;\n}",
"while (n > 0)\n {\n int temp = n;\n n = m % n; // % is remainder\n m = temp;\n }",
"n > 0",
"n",
"0",
"{\n int temp = n;\n n = m % n; // % is remainder\n m = temp;\n }",
"int temp = n;",
"temp",
"n",
"n = m % n",
"n",
"m % n",
"m",
"n",
"m = temp",
"m",
"temp",
"return m;",
"m",
"int m",
"m",
"int n",
"n"
] |
import java.util.*;
class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int K = sc.nextInt();
int a = K;
int b = K;
int c = K;
int sum = 0;
for (int A=1; A<=a; A++) {
for (int B=1; B<=b; B++) {
for (int C=1; C<=c; C++) {
int t1 = gcd(A,B);
int t2 = gcd(t1,C);
sum += t2;
}
}
}
System.out.println(sum);
}
private static int gcd(int m, int n) {
while (n > 0)
{
int temp = n;
n = m % n; // % is remainder
m = temp;
}
return m;
}
}
|
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
41,
13,
41,
13,
17,
12,
13,
30,
41,
13,
20,
41,
13,
20,
41,
13,
20,
4,
18,
13,
4,
18,
13,
23,
13,
12,
13,
30,
41,
13,
4,
18,
4,
18,
13,
17,
0,
13,
4,
18,
13,
18,
13,
17,
23,
13,
12,
13,
30,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
41,
13,
4,
13,
13,
13,
41,
13,
4,
13,
13,
13,
0,
13,
13,
12,
13,
30,
4,
18,
18,
13,
13,
13,
12,
13,
30,
14,
2,
13,
13,
30,
29,
4,
13,
13,
13,
14,
2,
2,
13,
13,
17,
30,
29,
13,
29,
4,
13,
13,
2,
13,
13,
23,
13,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
10,
11
],
[
10,
12
],
[
0,
13
],
[
161,
14
],
[
161,
15
],
[
15,
16
],
[
161,
17
],
[
17,
18
],
[
17,
19
],
[
161,
20
],
[
20,
21
],
[
20,
22
],
[
22,
23
],
[
23,
24
],
[
23,
25
],
[
22,
26
],
[
26,
27
],
[
26,
28
],
[
22,
29
],
[
29,
30
],
[
29,
31
],
[
22,
32
],
[
32,
33
],
[
33,
34
],
[
22,
35
],
[
35,
36
],
[
36,
37
],
[
20,
38
],
[
38,
39
],
[
161,
40
],
[
40,
41
],
[
40,
42
],
[
42,
43
],
[
43,
44
],
[
43,
45
],
[
45,
46
],
[
46,
47
],
[
47,
48
],
[
48,
49
],
[
45,
50
],
[
42,
51
],
[
51,
52
],
[
51,
53
],
[
53,
54
],
[
54,
55
],
[
53,
56
],
[
56,
57
],
[
56,
58
],
[
40,
59
],
[
59,
60
],
[
161,
61
],
[
61,
62
],
[
61,
63
],
[
63,
64
],
[
64,
65
],
[
65,
66
],
[
66,
67
],
[
66,
68
],
[
64,
69
],
[
69,
70
],
[
69,
71
],
[
64,
72
],
[
72,
73
],
[
73,
74
],
[
64,
75
],
[
76,
76
],
[
76,
77
],
[
77,
78
],
[
78,
79
],
[
79,
80
],
[
79,
81
],
[
77,
82
],
[
82,
83
],
[
82,
84
],
[
77,
85
],
[
85,
86
],
[
86,
87
],
[
77,
88
],
[
89,
89
],
[
89,
90
],
[
90,
91
],
[
91,
92
],
[
92,
93
],
[
92,
94
],
[
90,
95
],
[
95,
96
],
[
95,
97
],
[
90,
98
],
[
98,
99
],
[
99,
100
],
[
90,
101
],
[
102,
102
],
[
102,
103
],
[
103,
104
],
[
103,
105
],
[
105,
106
],
[
105,
107
],
[
105,
108
],
[
102,
109
],
[
109,
110
],
[
109,
111
],
[
111,
112
],
[
111,
113
],
[
111,
114
],
[
102,
115
],
[
115,
116
],
[
115,
117
],
[
161,
118
],
[
118,
119
],
[
118,
120
],
[
120,
121
],
[
121,
122
],
[
122,
123
],
[
123,
124
],
[
123,
125
],
[
121,
126
],
[
161,
127
],
[
127,
128
],
[
127,
129
],
[
129,
130
],
[
130,
131
],
[
131,
132
],
[
131,
133
],
[
130,
134
],
[
134,
135
],
[
135,
136
],
[
136,
137
],
[
136,
138
],
[
136,
139
],
[
129,
140
],
[
140,
141
],
[
141,
142
],
[
142,
143
],
[
142,
144
],
[
141,
145
],
[
140,
146
],
[
146,
147
],
[
147,
148
],
[
129,
149
],
[
149,
150
],
[
150,
151
],
[
150,
152
],
[
150,
153
],
[
153,
154
],
[
153,
155
],
[
127,
156
],
[
156,
157
],
[
127,
158
],
[
158,
159
],
[
0,
160
],
[
160,
161
],
[
160,
162
]
] |
[
"\nimport java.util.*;\nimport java.util.stream.Collectors;\nimport java.io.*;\nimport java.nio.charset.StandardCharsets;\n\npublic class Main {\n\tint K;\n\tlong sum = 0L;\n\n\tpublic static void main(String[] args) throws IOException {\n\t\tInputStreamReader reader = new InputStreamReader(System.in, StandardCharsets.UTF_8);\n\t\tBufferedReader in = new BufferedReader(reader);\n\t\tMain ins = new Main(in);\n\t\tins.calc();\n\t\tins.showResult();\n\t}\n\n\tMain(BufferedReader in) throws IOException {\n\t\tString[] tokens = in.readLine().split(\" \");\n\t\tK = Integer.parseInt(tokens[0]);\n\t}\n\n\tvoid calc() {\n\t\tfor (int a = 1; a <= K; ++a) {\n\t\t\tfor (int b = 1; b <= K; ++b) {\n\t\t\t\tfor (int c = 1; c <= K; ++c) {\n\t\t\t\t\tint temp = gcd(a, b);\n\t\t\t\t\tint gcd = gcd(c, temp);\n\t\t\t\t\tsum += gcd;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tvoid showResult() {\n\t\tSystem.out.println(sum);\n\t}\n\n\tint gcd(int large, int small) {\n\t\tif (large < small) {\n\t\t\treturn gcd(small, large);\n\t\t}\n\t\tif (large % small == 0) {\n\t\t\treturn small;\n\t\t}\n\t\treturn gcd(small, large % small);\n\t}\n}",
"import java.util.*;",
"util.*",
"java",
"import java.util.stream.Collectors;",
"Collectors",
"java.util.stream",
"import java.io.*;",
"io.*",
"java",
"import java.nio.charset.StandardCharsets;",
"StandardCharsets",
"java.nio.charset",
"public class Main {\n\tint K;\n\tlong sum = 0L;\n\n\tpublic static void main(String[] args) throws IOException {\n\t\tInputStreamReader reader = new InputStreamReader(System.in, StandardCharsets.UTF_8);\n\t\tBufferedReader in = new BufferedReader(reader);\n\t\tMain ins = new Main(in);\n\t\tins.calc();\n\t\tins.showResult();\n\t}\n\n\tMain(BufferedReader in) throws IOException {\n\t\tString[] tokens = in.readLine().split(\" \");\n\t\tK = Integer.parseInt(tokens[0]);\n\t}\n\n\tvoid calc() {\n\t\tfor (int a = 1; a <= K; ++a) {\n\t\t\tfor (int b = 1; b <= K; ++b) {\n\t\t\t\tfor (int c = 1; c <= K; ++c) {\n\t\t\t\t\tint temp = gcd(a, b);\n\t\t\t\t\tint gcd = gcd(c, temp);\n\t\t\t\t\tsum += gcd;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tvoid showResult() {\n\t\tSystem.out.println(sum);\n\t}\n\n\tint gcd(int large, int small) {\n\t\tif (large < small) {\n\t\t\treturn gcd(small, large);\n\t\t}\n\t\tif (large % small == 0) {\n\t\t\treturn small;\n\t\t}\n\t\treturn gcd(small, large % small);\n\t}\n}",
"Main",
"int K;",
"K",
"long sum = 0L;",
"sum",
"0L",
"public static void main(String[] args) throws IOException {\n\t\tInputStreamReader reader = new InputStreamReader(System.in, StandardCharsets.UTF_8);\n\t\tBufferedReader in = new BufferedReader(reader);\n\t\tMain ins = new Main(in);\n\t\tins.calc();\n\t\tins.showResult();\n\t}",
"main",
"{\n\t\tInputStreamReader reader = new InputStreamReader(System.in, StandardCharsets.UTF_8);\n\t\tBufferedReader in = new BufferedReader(reader);\n\t\tMain ins = new Main(in);\n\t\tins.calc();\n\t\tins.showResult();\n\t}",
"InputStreamReader reader = new InputStreamReader(System.in, StandardCharsets.UTF_8);",
"reader",
"new InputStreamReader(System.in, StandardCharsets.UTF_8)",
"BufferedReader in = new BufferedReader(reader);",
"in",
"new BufferedReader(reader)",
"Main ins = new Main(in);",
"ins",
"new Main(in)",
"ins.calc()",
"ins.calc",
"ins",
"ins.showResult()",
"ins.showResult",
"ins",
"String[] args",
"args",
"Main(BufferedReader in) throws IOException {\n\t\tString[] tokens = in.readLine().split(\" \");\n\t\tK = Integer.parseInt(tokens[0]);\n\t}",
"Main",
"{\n\t\tString[] tokens = in.readLine().split(\" \");\n\t\tK = Integer.parseInt(tokens[0]);\n\t}",
"String[] tokens = in.readLine().split(\" \");",
"tokens",
"in.readLine().split(\" \")",
"in.readLine().split",
"in.readLine()",
"in.readLine",
"in",
"\" \"",
"K = Integer.parseInt(tokens[0])",
"K",
"Integer.parseInt(tokens[0])",
"Integer.parseInt",
"Integer",
"tokens[0]",
"tokens",
"0",
"BufferedReader in",
"in",
"void calc() {\n\t\tfor (int a = 1; a <= K; ++a) {\n\t\t\tfor (int b = 1; b <= K; ++b) {\n\t\t\t\tfor (int c = 1; c <= K; ++c) {\n\t\t\t\t\tint temp = gcd(a, b);\n\t\t\t\t\tint gcd = gcd(c, temp);\n\t\t\t\t\tsum += gcd;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"calc",
"{\n\t\tfor (int a = 1; a <= K; ++a) {\n\t\t\tfor (int b = 1; b <= K; ++b) {\n\t\t\t\tfor (int c = 1; c <= K; ++c) {\n\t\t\t\t\tint temp = gcd(a, b);\n\t\t\t\t\tint gcd = gcd(c, temp);\n\t\t\t\t\tsum += gcd;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"for (int a = 1; a <= K; ++a) {\n\t\t\tfor (int b = 1; b <= K; ++b) {\n\t\t\t\tfor (int c = 1; c <= K; ++c) {\n\t\t\t\t\tint temp = gcd(a, b);\n\t\t\t\t\tint gcd = gcd(c, temp);\n\t\t\t\t\tsum += gcd;\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"int a = 1;",
"int a = 1;",
"a",
"1",
"a <= K",
"a",
"K",
"++a",
"++a",
"a",
"{\n\t\t\tfor (int b = 1; b <= K; ++b) {\n\t\t\t\tfor (int c = 1; c <= K; ++c) {\n\t\t\t\t\tint temp = gcd(a, b);\n\t\t\t\t\tint gcd = gcd(c, temp);\n\t\t\t\t\tsum += gcd;\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"{\n\t\t\tfor (int b = 1; b <= K; ++b) {\n\t\t\t\tfor (int c = 1; c <= K; ++c) {\n\t\t\t\t\tint temp = gcd(a, b);\n\t\t\t\t\tint gcd = gcd(c, temp);\n\t\t\t\t\tsum += gcd;\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"for (int b = 1; b <= K; ++b) {\n\t\t\t\tfor (int c = 1; c <= K; ++c) {\n\t\t\t\t\tint temp = gcd(a, b);\n\t\t\t\t\tint gcd = gcd(c, temp);\n\t\t\t\t\tsum += gcd;\n\t\t\t\t}\n\t\t\t}",
"int b = 1;",
"int b = 1;",
"b",
"1",
"b <= K",
"b",
"K",
"++b",
"++b",
"b",
"{\n\t\t\t\tfor (int c = 1; c <= K; ++c) {\n\t\t\t\t\tint temp = gcd(a, b);\n\t\t\t\t\tint gcd = gcd(c, temp);\n\t\t\t\t\tsum += gcd;\n\t\t\t\t}\n\t\t\t}",
"{\n\t\t\t\tfor (int c = 1; c <= K; ++c) {\n\t\t\t\t\tint temp = gcd(a, b);\n\t\t\t\t\tint gcd = gcd(c, temp);\n\t\t\t\t\tsum += gcd;\n\t\t\t\t}\n\t\t\t}",
"for (int c = 1; c <= K; ++c) {\n\t\t\t\t\tint temp = gcd(a, b);\n\t\t\t\t\tint gcd = gcd(c, temp);\n\t\t\t\t\tsum += gcd;\n\t\t\t\t}",
"int c = 1;",
"int c = 1;",
"c",
"1",
"c <= K",
"c",
"K",
"++c",
"++c",
"c",
"{\n\t\t\t\t\tint temp = gcd(a, b);\n\t\t\t\t\tint gcd = gcd(c, temp);\n\t\t\t\t\tsum += gcd;\n\t\t\t\t}",
"{\n\t\t\t\t\tint temp = gcd(a, b);\n\t\t\t\t\tint gcd = gcd(c, temp);\n\t\t\t\t\tsum += gcd;\n\t\t\t\t}",
"int temp = gcd(a, b);",
"temp",
"gcd(a, b)",
"gcd",
"a",
"b",
"int gcd = gcd(c, temp);",
"gcd",
"gcd(c, temp)",
"gcd",
"c",
"temp",
"sum += gcd",
"sum",
"gcd",
"void showResult() {\n\t\tSystem.out.println(sum);\n\t}",
"showResult",
"{\n\t\tSystem.out.println(sum);\n\t}",
"System.out.println(sum)",
"System.out.println",
"System.out",
"System",
"System.out",
"sum",
"int gcd(int large, int small) {\n\t\tif (large < small) {\n\t\t\treturn gcd(small, large);\n\t\t}\n\t\tif (large % small == 0) {\n\t\t\treturn small;\n\t\t}\n\t\treturn gcd(small, large % small);\n\t}",
"gcd",
"{\n\t\tif (large < small) {\n\t\t\treturn gcd(small, large);\n\t\t}\n\t\tif (large % small == 0) {\n\t\t\treturn small;\n\t\t}\n\t\treturn gcd(small, large % small);\n\t}",
"if (large < small) {\n\t\t\treturn gcd(small, large);\n\t\t}",
"large < small",
"large",
"small",
"{\n\t\t\treturn gcd(small, large);\n\t\t}",
"return gcd(small, large);",
"gcd(small, large)",
"gcd",
"small",
"large",
"if (large % small == 0) {\n\t\t\treturn small;\n\t\t}",
"large % small == 0",
"large % small",
"large",
"small",
"0",
"{\n\t\t\treturn small;\n\t\t}",
"return small;",
"small",
"return gcd(small, large % small);",
"gcd(small, large % small)",
"gcd",
"small",
"large % small",
"large",
"small",
"int large",
"large",
"int small",
"small",
"public class Main {\n\tint K;\n\tlong sum = 0L;\n\n\tpublic static void main(String[] args) throws IOException {\n\t\tInputStreamReader reader = new InputStreamReader(System.in, StandardCharsets.UTF_8);\n\t\tBufferedReader in = new BufferedReader(reader);\n\t\tMain ins = new Main(in);\n\t\tins.calc();\n\t\tins.showResult();\n\t}\n\n\tMain(BufferedReader in) throws IOException {\n\t\tString[] tokens = in.readLine().split(\" \");\n\t\tK = Integer.parseInt(tokens[0]);\n\t}\n\n\tvoid calc() {\n\t\tfor (int a = 1; a <= K; ++a) {\n\t\t\tfor (int b = 1; b <= K; ++b) {\n\t\t\t\tfor (int c = 1; c <= K; ++c) {\n\t\t\t\t\tint temp = gcd(a, b);\n\t\t\t\t\tint gcd = gcd(c, temp);\n\t\t\t\t\tsum += gcd;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tvoid showResult() {\n\t\tSystem.out.println(sum);\n\t}\n\n\tint gcd(int large, int small) {\n\t\tif (large < small) {\n\t\t\treturn gcd(small, large);\n\t\t}\n\t\tif (large % small == 0) {\n\t\t\treturn small;\n\t\t}\n\t\treturn gcd(small, large % small);\n\t}\n}",
"public class Main {\n\tint K;\n\tlong sum = 0L;\n\n\tpublic static void main(String[] args) throws IOException {\n\t\tInputStreamReader reader = new InputStreamReader(System.in, StandardCharsets.UTF_8);\n\t\tBufferedReader in = new BufferedReader(reader);\n\t\tMain ins = new Main(in);\n\t\tins.calc();\n\t\tins.showResult();\n\t}\n\n\tMain(BufferedReader in) throws IOException {\n\t\tString[] tokens = in.readLine().split(\" \");\n\t\tK = Integer.parseInt(tokens[0]);\n\t}\n\n\tvoid calc() {\n\t\tfor (int a = 1; a <= K; ++a) {\n\t\t\tfor (int b = 1; b <= K; ++b) {\n\t\t\t\tfor (int c = 1; c <= K; ++c) {\n\t\t\t\t\tint temp = gcd(a, b);\n\t\t\t\t\tint gcd = gcd(c, temp);\n\t\t\t\t\tsum += gcd;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tvoid showResult() {\n\t\tSystem.out.println(sum);\n\t}\n\n\tint gcd(int large, int small) {\n\t\tif (large < small) {\n\t\t\treturn gcd(small, large);\n\t\t}\n\t\tif (large % small == 0) {\n\t\t\treturn small;\n\t\t}\n\t\treturn gcd(small, large % small);\n\t}\n}",
"Main"
] |
import java.util.*;
import java.util.stream.Collectors;
import java.io.*;
import java.nio.charset.StandardCharsets;
public class Main {
int K;
long sum = 0L;
public static void main(String[] args) throws IOException {
InputStreamReader reader = new InputStreamReader(System.in, StandardCharsets.UTF_8);
BufferedReader in = new BufferedReader(reader);
Main ins = new Main(in);
ins.calc();
ins.showResult();
}
Main(BufferedReader in) throws IOException {
String[] tokens = in.readLine().split(" ");
K = Integer.parseInt(tokens[0]);
}
void calc() {
for (int a = 1; a <= K; ++a) {
for (int b = 1; b <= K; ++b) {
for (int c = 1; c <= K; ++c) {
int temp = gcd(a, b);
int gcd = gcd(c, temp);
sum += gcd;
}
}
}
}
void showResult() {
System.out.println(sum);
}
int gcd(int large, int small) {
if (large < small) {
return gcd(small, large);
}
if (large % small == 0) {
return small;
}
return gcd(small, large % small);
}
}
|
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
41,
13,
4,
13,
13,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
4,
13,
13,
13,
4,
18,
18,
13,
13,
13,
4,
18,
13,
23,
13,
12,
13,
30,
14,
2,
13,
13,
30,
41,
13,
13,
0,
13,
13,
0,
13,
13,
41,
13,
2,
13,
13,
14,
2,
13,
17,
30,
29,
13,
29,
4,
13,
13,
13,
23,
13,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
121,
5
],
[
121,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
8,
17
],
[
17,
18
],
[
17,
19
],
[
8,
20
],
[
20,
21
],
[
21,
22
],
[
22,
23
],
[
22,
24
],
[
20,
25
],
[
25,
26
],
[
25,
27
],
[
20,
28
],
[
28,
29
],
[
29,
30
],
[
20,
31
],
[
32,
32
],
[
32,
33
],
[
33,
34
],
[
34,
35
],
[
35,
36
],
[
35,
37
],
[
33,
38
],
[
38,
39
],
[
38,
40
],
[
33,
41
],
[
41,
42
],
[
42,
43
],
[
33,
44
],
[
45,
45
],
[
45,
46
],
[
46,
47
],
[
46,
48
],
[
48,
49
],
[
48,
50
],
[
48,
51
],
[
45,
52
],
[
52,
53
],
[
53,
54
],
[
54,
55
],
[
54,
56
],
[
52,
57
],
[
57,
58
],
[
57,
59
],
[
52,
60
],
[
60,
61
],
[
61,
62
],
[
52,
63
],
[
64,
64
],
[
64,
65
],
[
65,
66
],
[
65,
67
],
[
67,
68
],
[
67,
69
],
[
67,
70
],
[
8,
71
],
[
71,
72
],
[
72,
73
],
[
73,
74
],
[
73,
75
],
[
71,
76
],
[
8,
77
],
[
77,
78
],
[
78,
79
],
[
6,
80
],
[
80,
81
],
[
121,
82
],
[
82,
83
],
[
82,
84
],
[
84,
85
],
[
85,
86
],
[
86,
87
],
[
86,
88
],
[
85,
89
],
[
89,
90
],
[
90,
91
],
[
90,
92
],
[
89,
93
],
[
93,
94
],
[
93,
95
],
[
89,
96
],
[
96,
97
],
[
96,
98
],
[
84,
99
],
[
99,
100
],
[
99,
101
],
[
101,
102
],
[
101,
103
],
[
84,
104
],
[
104,
105
],
[
105,
106
],
[
105,
107
],
[
104,
108
],
[
108,
109
],
[
109,
110
],
[
84,
111
],
[
111,
112
],
[
112,
113
],
[
112,
114
],
[
112,
115
],
[
82,
116
],
[
116,
117
],
[
82,
118
],
[
118,
119
],
[
0,
120
],
[
120,
121
],
[
120,
122
]
] |
[
"import java.util.Scanner;\n\npublic class Main {\n\tpublic static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\n\t\t// 入力値の取得\n\t\tint K = sc.nextInt();\n\t\t\n\t\t// 結果の出力\n\t\tlong sum = 0;\n\t\tfor (int i = 1; i <= K; i++) {\n\t\t\tfor (int j = 1; j <= K; j++) {\n\t\t\t\tint r = euclid(i, j);\n\t\t\t\tfor (int k = 1; k <= K; k++) {\n\t\t\t\t\tsum += euclid(r, k);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(sum);\n\n\t\tsc.close();\n\t}\n\t\n\t// ユークリッドの互除法で最大公約数を求める\n\tstatic int euclid( int a, int b ) {\n\t\t//引数の大小入替\n\t\tif (a < b) {\n\t\t\tint temp = a;\n\t\t\ta = b;\n\t\t\tb = temp;\n\t\t}\n\t\t\n\t\tint r = a % b;\n\t\tif (r == 0) {\n\t\t\treturn b;\n\t\t}\n\t\treturn euclid(b, r);\n\t}\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n\tpublic static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\n\t\t// 入力値の取得\n\t\tint K = sc.nextInt();\n\t\t\n\t\t// 結果の出力\n\t\tlong sum = 0;\n\t\tfor (int i = 1; i <= K; i++) {\n\t\t\tfor (int j = 1; j <= K; j++) {\n\t\t\t\tint r = euclid(i, j);\n\t\t\t\tfor (int k = 1; k <= K; k++) {\n\t\t\t\t\tsum += euclid(r, k);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(sum);\n\n\t\tsc.close();\n\t}\n\t\n\t// ユークリッドの互除法で最大公約数を求める\n\tstatic int euclid( int a, int b ) {\n\t\t//引数の大小入替\n\t\tif (a < b) {\n\t\t\tint temp = a;\n\t\t\ta = b;\n\t\t\tb = temp;\n\t\t}\n\t\t\n\t\tint r = a % b;\n\t\tif (r == 0) {\n\t\t\treturn b;\n\t\t}\n\t\treturn euclid(b, r);\n\t}\n}",
"Main",
"public static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\n\t\t// 入力値の取得\n\t\tint K = sc.nextInt();\n\t\t\n\t\t// 結果の出力\n\t\tlong sum = 0;\n\t\tfor (int i = 1; i <= K; i++) {\n\t\t\tfor (int j = 1; j <= K; j++) {\n\t\t\t\tint r = euclid(i, j);\n\t\t\t\tfor (int k = 1; k <= K; k++) {\n\t\t\t\t\tsum += euclid(r, k);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(sum);\n\n\t\tsc.close();\n\t}",
"main",
"{\n\t\tScanner sc = new Scanner(System.in);\n\n\t\t// 入力値の取得\n\t\tint K = sc.nextInt();\n\t\t\n\t\t// 結果の出力\n\t\tlong sum = 0;\n\t\tfor (int i = 1; i <= K; i++) {\n\t\t\tfor (int j = 1; j <= K; j++) {\n\t\t\t\tint r = euclid(i, j);\n\t\t\t\tfor (int k = 1; k <= K; k++) {\n\t\t\t\t\tsum += euclid(r, k);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(sum);\n\n\t\tsc.close();\n\t}",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"int K = sc.nextInt();",
"K",
"sc.nextInt()",
"sc.nextInt",
"sc",
"long sum = 0;",
"sum",
"0",
"for (int i = 1; i <= K; i++) {\n\t\t\tfor (int j = 1; j <= K; j++) {\n\t\t\t\tint r = euclid(i, j);\n\t\t\t\tfor (int k = 1; k <= K; k++) {\n\t\t\t\t\tsum += euclid(r, k);\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"int i = 1;",
"int i = 1;",
"i",
"1",
"i <= K",
"i",
"K",
"i++",
"i++",
"i",
"{\n\t\t\tfor (int j = 1; j <= K; j++) {\n\t\t\t\tint r = euclid(i, j);\n\t\t\t\tfor (int k = 1; k <= K; k++) {\n\t\t\t\t\tsum += euclid(r, k);\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"{\n\t\t\tfor (int j = 1; j <= K; j++) {\n\t\t\t\tint r = euclid(i, j);\n\t\t\t\tfor (int k = 1; k <= K; k++) {\n\t\t\t\t\tsum += euclid(r, k);\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"for (int j = 1; j <= K; j++) {\n\t\t\t\tint r = euclid(i, j);\n\t\t\t\tfor (int k = 1; k <= K; k++) {\n\t\t\t\t\tsum += euclid(r, k);\n\t\t\t\t}\n\t\t\t}",
"int j = 1;",
"int j = 1;",
"j",
"1",
"j <= K",
"j",
"K",
"j++",
"j++",
"j",
"{\n\t\t\t\tint r = euclid(i, j);\n\t\t\t\tfor (int k = 1; k <= K; k++) {\n\t\t\t\t\tsum += euclid(r, k);\n\t\t\t\t}\n\t\t\t}",
"{\n\t\t\t\tint r = euclid(i, j);\n\t\t\t\tfor (int k = 1; k <= K; k++) {\n\t\t\t\t\tsum += euclid(r, k);\n\t\t\t\t}\n\t\t\t}",
"int r = euclid(i, j);",
"r",
"euclid(i, j)",
"euclid",
"i",
"j",
"for (int k = 1; k <= K; k++) {\n\t\t\t\t\tsum += euclid(r, k);\n\t\t\t\t}",
"int k = 1;",
"int k = 1;",
"k",
"1",
"k <= K",
"k",
"K",
"k++",
"k++",
"k",
"{\n\t\t\t\t\tsum += euclid(r, k);\n\t\t\t\t}",
"{\n\t\t\t\t\tsum += euclid(r, k);\n\t\t\t\t}",
"sum += euclid(r, k)",
"sum",
"euclid(r, k)",
"euclid",
"r",
"k",
"System.out.println(sum)",
"System.out.println",
"System.out",
"System",
"System.out",
"sum",
"sc.close()",
"sc.close",
"sc",
"String[] args",
"args",
"// ユークリッドの互除法で最大公約数を求める\n\tstatic int euclid( int a, int b ) {\n\t\t//引数の大小入替\n\t\tif (a < b) {\n\t\t\tint temp = a;\n\t\t\ta = b;\n\t\t\tb = temp;\n\t\t}\n\t\t\n\t\tint r = a % b;\n\t\tif (r == 0) {\n\t\t\treturn b;\n\t\t}\n\t\treturn euclid(b, r);\n\t}",
"euclid",
"{\n\t\t//引数の大小入替\n\t\tif (a < b) {\n\t\t\tint temp = a;\n\t\t\ta = b;\n\t\t\tb = temp;\n\t\t}\n\t\t\n\t\tint r = a % b;\n\t\tif (r == 0) {\n\t\t\treturn b;\n\t\t}\n\t\treturn euclid(b, r);\n\t}",
"if (a < b) {\n\t\t\tint temp = a;\n\t\t\ta = b;\n\t\t\tb = temp;\n\t\t}",
"a < b",
"a",
"b",
"{\n\t\t\tint temp = a;\n\t\t\ta = b;\n\t\t\tb = temp;\n\t\t}",
"int temp = a;",
"temp",
"a",
"a = b",
"a",
"b",
"b = temp",
"b",
"temp",
"int r = a % b;",
"r",
"a % b",
"a",
"b",
"if (r == 0) {\n\t\t\treturn b;\n\t\t}",
"r == 0",
"r",
"0",
"{\n\t\t\treturn b;\n\t\t}",
"return b;",
"b",
"return euclid(b, r);",
"euclid(b, r)",
"euclid",
"b",
"r",
"int a",
"a",
"int b",
"b",
"public class Main {\n\tpublic static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\n\t\t// 入力値の取得\n\t\tint K = sc.nextInt();\n\t\t\n\t\t// 結果の出力\n\t\tlong sum = 0;\n\t\tfor (int i = 1; i <= K; i++) {\n\t\t\tfor (int j = 1; j <= K; j++) {\n\t\t\t\tint r = euclid(i, j);\n\t\t\t\tfor (int k = 1; k <= K; k++) {\n\t\t\t\t\tsum += euclid(r, k);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(sum);\n\n\t\tsc.close();\n\t}\n\t\n\t// ユークリッドの互除法で最大公約数を求める\n\tstatic int euclid( int a, int b ) {\n\t\t//引数の大小入替\n\t\tif (a < b) {\n\t\t\tint temp = a;\n\t\t\ta = b;\n\t\t\tb = temp;\n\t\t}\n\t\t\n\t\tint r = a % b;\n\t\tif (r == 0) {\n\t\t\treturn b;\n\t\t}\n\t\treturn euclid(b, r);\n\t}\n}",
"public class Main {\n\tpublic static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\n\t\t// 入力値の取得\n\t\tint K = sc.nextInt();\n\t\t\n\t\t// 結果の出力\n\t\tlong sum = 0;\n\t\tfor (int i = 1; i <= K; i++) {\n\t\t\tfor (int j = 1; j <= K; j++) {\n\t\t\t\tint r = euclid(i, j);\n\t\t\t\tfor (int k = 1; k <= K; k++) {\n\t\t\t\t\tsum += euclid(r, k);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(sum);\n\n\t\tsc.close();\n\t}\n\t\n\t// ユークリッドの互除法で最大公約数を求める\n\tstatic int euclid( int a, int b ) {\n\t\t//引数の大小入替\n\t\tif (a < b) {\n\t\t\tint temp = a;\n\t\t\ta = b;\n\t\t\tb = temp;\n\t\t}\n\t\t\n\t\tint r = a % b;\n\t\tif (r == 0) {\n\t\t\treturn b;\n\t\t}\n\t\treturn euclid(b, r);\n\t}\n}",
"Main"
] |
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
// 入力値の取得
int K = sc.nextInt();
// 結果の出力
long sum = 0;
for (int i = 1; i <= K; i++) {
for (int j = 1; j <= K; j++) {
int r = euclid(i, j);
for (int k = 1; k <= K; k++) {
sum += euclid(r, k);
}
}
}
System.out.println(sum);
sc.close();
}
// ユークリッドの互除法で最大公約数を求める
static int euclid( int a, int b ) {
//引数の大小入替
if (a < b) {
int temp = a;
a = b;
b = temp;
}
int r = a % b;
if (r == 0) {
return b;
}
return euclid(b, r);
}
}
|
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
14,
2,
13,
13,
4,
13,
13,
13,
14,
2,
13,
17,
29,
13,
29,
4,
13,
13,
2,
13,
13,
23,
13,
23,
13,
12,
13,
30,
41,
13,
4,
13,
13,
13,
29,
4,
13,
13,
13,
23,
13,
23,
13,
23,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
2,
13,
4,
13,
13,
13,
13,
4,
18,
18,
13,
13,
13,
23,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
10,
11
],
[
10,
12
],
[
9,
13
],
[
13,
14
],
[
13,
15
],
[
13,
16
],
[
8,
17
],
[
17,
18
],
[
18,
19
],
[
18,
20
],
[
17,
21
],
[
21,
22
],
[
17,
23
],
[
23,
24
],
[
24,
25
],
[
24,
26
],
[
24,
27
],
[
27,
28
],
[
27,
29
],
[
6,
30
],
[
30,
31
],
[
6,
32
],
[
32,
33
],
[
4,
34
],
[
34,
35
],
[
34,
36
],
[
36,
37
],
[
37,
38
],
[
37,
39
],
[
39,
40
],
[
39,
41
],
[
39,
42
],
[
36,
43
],
[
43,
44
],
[
44,
45
],
[
44,
46
],
[
44,
47
],
[
34,
48
],
[
48,
49
],
[
34,
50
],
[
50,
51
],
[
34,
52
],
[
52,
53
],
[
4,
54
],
[
54,
55
],
[
54,
56
],
[
56,
57
],
[
57,
58
],
[
57,
59
],
[
56,
60
],
[
60,
61
],
[
60,
62
],
[
62,
63
],
[
63,
64
],
[
56,
65
],
[
65,
66
],
[
65,
67
],
[
56,
68
],
[
68,
69
],
[
69,
70
],
[
70,
71
],
[
70,
72
],
[
68,
73
],
[
73,
74
],
[
73,
75
],
[
68,
76
],
[
76,
77
],
[
77,
78
],
[
68,
79
],
[
80,
80
],
[
80,
81
],
[
81,
82
],
[
82,
83
],
[
83,
84
],
[
83,
85
],
[
81,
86
],
[
86,
87
],
[
86,
88
],
[
81,
89
],
[
89,
90
],
[
90,
91
],
[
81,
92
],
[
93,
93
],
[
93,
94
],
[
94,
95
],
[
95,
96
],
[
96,
97
],
[
96,
98
],
[
94,
99
],
[
99,
100
],
[
99,
101
],
[
94,
102
],
[
102,
103
],
[
103,
104
],
[
94,
105
],
[
106,
106
],
[
106,
107
],
[
107,
108
],
[
107,
109
],
[
109,
110
],
[
109,
111
],
[
111,
112
],
[
111,
113
],
[
111,
114
],
[
111,
115
],
[
56,
116
],
[
116,
117
],
[
117,
118
],
[
118,
119
],
[
118,
120
],
[
116,
121
],
[
54,
122
],
[
122,
123
]
] |
[
"import java.util.*;\n\nclass Main{\n \n static int gcd(int a, int b){\n if ( a < b )\n gcd(b,a);\n if ( b == 0)\n return a;\n else\n return gcd(b, a % b);\n }\n \n static int gcd_3(int a, int b, int c){\n int X = gcd(a,b);\n return gcd(X,c);\n }\n \n \n public static void main(String[] args){\n Scanner sc = new Scanner(System.in);\n int K = sc.nextInt();\n int sum = 0;\n \n for (int i = 1; i <= K; i++){\n for (int j = 1; j <= K; j++){\n for (int k = 1; k <= K; k++){\n sum = sum + gcd_3(i,j,k);\n }\n }\n }\n \n System.out.println(sum);\n }\n \n}",
"import java.util.*;",
"util.*",
"java",
"class Main{\n \n static int gcd(int a, int b){\n if ( a < b )\n gcd(b,a);\n if ( b == 0)\n return a;\n else\n return gcd(b, a % b);\n }\n \n static int gcd_3(int a, int b, int c){\n int X = gcd(a,b);\n return gcd(X,c);\n }\n \n \n public static void main(String[] args){\n Scanner sc = new Scanner(System.in);\n int K = sc.nextInt();\n int sum = 0;\n \n for (int i = 1; i <= K; i++){\n for (int j = 1; j <= K; j++){\n for (int k = 1; k <= K; k++){\n sum = sum + gcd_3(i,j,k);\n }\n }\n }\n \n System.out.println(sum);\n }\n \n}",
"Main",
"static int gcd(int a, int b){\n if ( a < b )\n gcd(b,a);\n if ( b == 0)\n return a;\n else\n return gcd(b, a % b);\n }",
"gcd",
"{\n if ( a < b )\n gcd(b,a);\n if ( b == 0)\n return a;\n else\n return gcd(b, a % b);\n }",
"if ( a < b )\n gcd(b,a);",
"a < b",
"a",
"b",
"gcd(b,a)",
"gcd",
"b",
"a",
"if ( b == 0)\n return a;\n else\n return gcd(b, a % b);",
"b == 0",
"b",
"0",
"return a;",
"a",
"return gcd(b, a % b);",
"gcd(b, a % b)",
"gcd",
"b",
"a % b",
"a",
"b",
"int a",
"a",
"int b",
"b",
"static int gcd_3(int a, int b, int c){\n int X = gcd(a,b);\n return gcd(X,c);\n }",
"gcd_3",
"{\n int X = gcd(a,b);\n return gcd(X,c);\n }",
"int X = gcd(a,b);",
"X",
"gcd(a,b)",
"gcd",
"a",
"b",
"return gcd(X,c);",
"gcd(X,c)",
"gcd",
"X",
"c",
"int a",
"a",
"int b",
"b",
"int c",
"c",
"public static void main(String[] args){\n Scanner sc = new Scanner(System.in);\n int K = sc.nextInt();\n int sum = 0;\n \n for (int i = 1; i <= K; i++){\n for (int j = 1; j <= K; j++){\n for (int k = 1; k <= K; k++){\n sum = sum + gcd_3(i,j,k);\n }\n }\n }\n \n System.out.println(sum);\n }",
"main",
"{\n Scanner sc = new Scanner(System.in);\n int K = sc.nextInt();\n int sum = 0;\n \n for (int i = 1; i <= K; i++){\n for (int j = 1; j <= K; j++){\n for (int k = 1; k <= K; k++){\n sum = sum + gcd_3(i,j,k);\n }\n }\n }\n \n System.out.println(sum);\n }",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"int K = sc.nextInt();",
"K",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int sum = 0;",
"sum",
"0",
"for (int i = 1; i <= K; i++){\n for (int j = 1; j <= K; j++){\n for (int k = 1; k <= K; k++){\n sum = sum + gcd_3(i,j,k);\n }\n }\n }",
"int i = 1;",
"int i = 1;",
"i",
"1",
"i <= K",
"i",
"K",
"i++",
"i++",
"i",
"{\n for (int j = 1; j <= K; j++){\n for (int k = 1; k <= K; k++){\n sum = sum + gcd_3(i,j,k);\n }\n }\n }",
"{\n for (int j = 1; j <= K; j++){\n for (int k = 1; k <= K; k++){\n sum = sum + gcd_3(i,j,k);\n }\n }\n }",
"for (int j = 1; j <= K; j++){\n for (int k = 1; k <= K; k++){\n sum = sum + gcd_3(i,j,k);\n }\n }",
"int j = 1;",
"int j = 1;",
"j",
"1",
"j <= K",
"j",
"K",
"j++",
"j++",
"j",
"{\n for (int k = 1; k <= K; k++){\n sum = sum + gcd_3(i,j,k);\n }\n }",
"{\n for (int k = 1; k <= K; k++){\n sum = sum + gcd_3(i,j,k);\n }\n }",
"for (int k = 1; k <= K; k++){\n sum = sum + gcd_3(i,j,k);\n }",
"int k = 1;",
"int k = 1;",
"k",
"1",
"k <= K",
"k",
"K",
"k++",
"k++",
"k",
"{\n sum = sum + gcd_3(i,j,k);\n }",
"{\n sum = sum + gcd_3(i,j,k);\n }",
"sum = sum + gcd_3(i,j,k)",
"sum",
"sum + gcd_3(i,j,k)",
"sum",
"gcd_3(i,j,k)",
"gcd_3",
"i",
"j",
"k",
"System.out.println(sum)",
"System.out.println",
"System.out",
"System",
"System.out",
"sum",
"String[] args",
"args"
] |
import java.util.*;
class Main{
static int gcd(int a, int b){
if ( a < b )
gcd(b,a);
if ( b == 0)
return a;
else
return gcd(b, a % b);
}
static int gcd_3(int a, int b, int c){
int X = gcd(a,b);
return gcd(X,c);
}
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
int K = sc.nextInt();
int sum = 0;
for (int i = 1; i <= K; i++){
for (int j = 1; j <= K; j++){
for (int k = 1; k <= K; k++){
sum = sum + gcd_3(i,j,k);
}
}
}
System.out.println(sum);
}
}
|
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
4,
18,
13,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
4,
13,
13,
13,
13,
4,
18,
18,
13,
13,
13,
23,
13,
12,
13,
30,
14,
2,
13,
17,
29,
13,
29,
4,
13,
13,
2,
13,
13,
23,
13,
23,
13,
12,
13,
30,
29,
4,
13,
4,
13,
13,
13,
13,
23,
13,
23,
13,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
121,
11
],
[
121,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
15,
17
],
[
14,
18
],
[
18,
19
],
[
18,
20
],
[
20,
21
],
[
21,
22
],
[
20,
23
],
[
23,
24
],
[
24,
25
],
[
14,
26
],
[
26,
27
],
[
26,
28
],
[
14,
29
],
[
29,
30
],
[
30,
31
],
[
31,
32
],
[
31,
33
],
[
29,
34
],
[
34,
35
],
[
34,
36
],
[
29,
37
],
[
37,
38
],
[
38,
39
],
[
29,
40
],
[
41,
41
],
[
41,
42
],
[
42,
43
],
[
43,
44
],
[
44,
45
],
[
44,
46
],
[
42,
47
],
[
47,
48
],
[
47,
49
],
[
42,
50
],
[
50,
51
],
[
51,
52
],
[
42,
53
],
[
54,
54
],
[
54,
55
],
[
55,
56
],
[
56,
57
],
[
57,
58
],
[
57,
59
],
[
55,
60
],
[
60,
61
],
[
60,
62
],
[
55,
63
],
[
63,
64
],
[
64,
65
],
[
55,
66
],
[
67,
67
],
[
67,
68
],
[
68,
69
],
[
68,
70
],
[
70,
71
],
[
70,
72
],
[
70,
73
],
[
70,
74
],
[
14,
75
],
[
75,
76
],
[
76,
77
],
[
77,
78
],
[
77,
79
],
[
75,
80
],
[
12,
81
],
[
81,
82
],
[
121,
83
],
[
83,
84
],
[
83,
85
],
[
85,
86
],
[
86,
87
],
[
87,
88
],
[
87,
89
],
[
86,
90
],
[
90,
91
],
[
86,
92
],
[
92,
93
],
[
93,
94
],
[
93,
95
],
[
93,
96
],
[
96,
97
],
[
96,
98
],
[
83,
99
],
[
99,
100
],
[
83,
101
],
[
101,
102
],
[
121,
103
],
[
103,
104
],
[
103,
105
],
[
105,
106
],
[
106,
107
],
[
107,
108
],
[
107,
109
],
[
109,
110
],
[
109,
111
],
[
109,
112
],
[
107,
113
],
[
103,
114
],
[
114,
115
],
[
103,
116
],
[
116,
117
],
[
103,
118
],
[
118,
119
],
[
0,
120
],
[
120,
121
],
[
120,
122
]
] |
[
"import java.io.BufferedReader;\nimport java.io.IOException;\nimport java.io.InputStreamReader;\n\n\npublic class Main {\n public static void main(String[] args) throws IOException {\n BufferedReader reader=new BufferedReader(new InputStreamReader(System.in));\n long n=Long.parseLong(reader.readLine());\n long count=0;\n for (long i = 1; i <= n; i++) {\n for (long j = 1; j <=n ; j++) {\n for (long k = 1; k <=n ; k++) {\n count+=gcd3(i,j,k);\n }\n }\n }\n System.out.println(count);\n }\n static long gcd(long a,long b){\n if (b==0)\n return a;\n else\n return gcd(b,a%b);\n }\n static long gcd3(long a,long b,long c){\n return gcd(gcd(a,b),c);\n }\n}",
"import java.io.BufferedReader;",
"BufferedReader",
"java.io",
"import java.io.IOException;",
"IOException",
"java.io",
"import java.io.InputStreamReader;",
"InputStreamReader",
"java.io",
"public class Main {\n public static void main(String[] args) throws IOException {\n BufferedReader reader=new BufferedReader(new InputStreamReader(System.in));\n long n=Long.parseLong(reader.readLine());\n long count=0;\n for (long i = 1; i <= n; i++) {\n for (long j = 1; j <=n ; j++) {\n for (long k = 1; k <=n ; k++) {\n count+=gcd3(i,j,k);\n }\n }\n }\n System.out.println(count);\n }\n static long gcd(long a,long b){\n if (b==0)\n return a;\n else\n return gcd(b,a%b);\n }\n static long gcd3(long a,long b,long c){\n return gcd(gcd(a,b),c);\n }\n}",
"Main",
"public static void main(String[] args) throws IOException {\n BufferedReader reader=new BufferedReader(new InputStreamReader(System.in));\n long n=Long.parseLong(reader.readLine());\n long count=0;\n for (long i = 1; i <= n; i++) {\n for (long j = 1; j <=n ; j++) {\n for (long k = 1; k <=n ; k++) {\n count+=gcd3(i,j,k);\n }\n }\n }\n System.out.println(count);\n }",
"main",
"{\n BufferedReader reader=new BufferedReader(new InputStreamReader(System.in));\n long n=Long.parseLong(reader.readLine());\n long count=0;\n for (long i = 1; i <= n; i++) {\n for (long j = 1; j <=n ; j++) {\n for (long k = 1; k <=n ; k++) {\n count+=gcd3(i,j,k);\n }\n }\n }\n System.out.println(count);\n }",
"BufferedReader reader=new BufferedReader(new InputStreamReader(System.in));",
"reader",
"new BufferedReader(new InputStreamReader(System.in))",
"long n=Long.parseLong(reader.readLine());",
"n",
"Long.parseLong(reader.readLine())",
"Long.parseLong",
"Long",
"reader.readLine()",
"reader.readLine",
"reader",
"long count=0;",
"count",
"0",
"for (long i = 1; i <= n; i++) {\n for (long j = 1; j <=n ; j++) {\n for (long k = 1; k <=n ; k++) {\n count+=gcd3(i,j,k);\n }\n }\n }",
"long i = 1;",
"long i = 1;",
"i",
"1",
"i <= n",
"i",
"n",
"i++",
"i++",
"i",
"{\n for (long j = 1; j <=n ; j++) {\n for (long k = 1; k <=n ; k++) {\n count+=gcd3(i,j,k);\n }\n }\n }",
"{\n for (long j = 1; j <=n ; j++) {\n for (long k = 1; k <=n ; k++) {\n count+=gcd3(i,j,k);\n }\n }\n }",
"for (long j = 1; j <=n ; j++) {\n for (long k = 1; k <=n ; k++) {\n count+=gcd3(i,j,k);\n }\n }",
"long j = 1;",
"long j = 1;",
"j",
"1",
"j <=n",
"j",
"n",
"j++",
"j++",
"j",
"{\n for (long k = 1; k <=n ; k++) {\n count+=gcd3(i,j,k);\n }\n }",
"{\n for (long k = 1; k <=n ; k++) {\n count+=gcd3(i,j,k);\n }\n }",
"for (long k = 1; k <=n ; k++) {\n count+=gcd3(i,j,k);\n }",
"long k = 1;",
"long k = 1;",
"k",
"1",
"k <=n",
"k",
"n",
"k++",
"k++",
"k",
"{\n count+=gcd3(i,j,k);\n }",
"{\n count+=gcd3(i,j,k);\n }",
"count+=gcd3(i,j,k)",
"count",
"gcd3(i,j,k)",
"gcd3",
"i",
"j",
"k",
"System.out.println(count)",
"System.out.println",
"System.out",
"System",
"System.out",
"count",
"String[] args",
"args",
"static long gcd(long a,long b){\n if (b==0)\n return a;\n else\n return gcd(b,a%b);\n }",
"gcd",
"{\n if (b==0)\n return a;\n else\n return gcd(b,a%b);\n }",
"if (b==0)\n return a;\n else\n return gcd(b,a%b);",
"b==0",
"b",
"0",
"return a;",
"a",
"return gcd(b,a%b);",
"gcd(b,a%b)",
"gcd",
"b",
"a%b",
"a",
"b",
"long a",
"a",
"long b",
"b",
"static long gcd3(long a,long b,long c){\n return gcd(gcd(a,b),c);\n }",
"gcd3",
"{\n return gcd(gcd(a,b),c);\n }",
"return gcd(gcd(a,b),c);",
"gcd(gcd(a,b),c)",
"gcd",
"gcd(a,b)",
"gcd",
"a",
"b",
"c",
"long a",
"a",
"long b",
"b",
"long c",
"c",
"public class Main {\n public static void main(String[] args) throws IOException {\n BufferedReader reader=new BufferedReader(new InputStreamReader(System.in));\n long n=Long.parseLong(reader.readLine());\n long count=0;\n for (long i = 1; i <= n; i++) {\n for (long j = 1; j <=n ; j++) {\n for (long k = 1; k <=n ; k++) {\n count+=gcd3(i,j,k);\n }\n }\n }\n System.out.println(count);\n }\n static long gcd(long a,long b){\n if (b==0)\n return a;\n else\n return gcd(b,a%b);\n }\n static long gcd3(long a,long b,long c){\n return gcd(gcd(a,b),c);\n }\n}",
"public class Main {\n public static void main(String[] args) throws IOException {\n BufferedReader reader=new BufferedReader(new InputStreamReader(System.in));\n long n=Long.parseLong(reader.readLine());\n long count=0;\n for (long i = 1; i <= n; i++) {\n for (long j = 1; j <=n ; j++) {\n for (long k = 1; k <=n ; k++) {\n count+=gcd3(i,j,k);\n }\n }\n }\n System.out.println(count);\n }\n static long gcd(long a,long b){\n if (b==0)\n return a;\n else\n return gcd(b,a%b);\n }\n static long gcd3(long a,long b,long c){\n return gcd(gcd(a,b),c);\n }\n}",
"Main"
] |
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class Main {
public static void main(String[] args) throws IOException {
BufferedReader reader=new BufferedReader(new InputStreamReader(System.in));
long n=Long.parseLong(reader.readLine());
long count=0;
for (long i = 1; i <= n; i++) {
for (long j = 1; j <=n ; j++) {
for (long k = 1; k <=n ; k++) {
count+=gcd3(i,j,k);
}
}
}
System.out.println(count);
}
static long gcd(long a,long b){
if (b==0)
return a;
else
return gcd(b,a%b);
}
static long gcd3(long a,long b,long c){
return gcd(gcd(a,b),c);
}
}
|
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
41,
13,
4,
13,
13,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
4,
13,
13,
13,
4,
18,
18,
13,
13,
13,
23,
13,
12,
13,
30,
14,
2,
13,
13,
30,
41,
13,
13,
0,
13,
13,
0,
13,
13,
14,
2,
2,
13,
13,
17,
30,
29,
13,
30,
29,
4,
13,
13,
2,
13,
13,
23,
13,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
118,
5
],
[
118,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
8,
17
],
[
17,
18
],
[
17,
19
],
[
8,
20
],
[
20,
21
],
[
21,
22
],
[
22,
23
],
[
22,
24
],
[
20,
25
],
[
25,
26
],
[
25,
27
],
[
20,
28
],
[
28,
29
],
[
29,
30
],
[
20,
31
],
[
32,
32
],
[
32,
33
],
[
33,
34
],
[
34,
35
],
[
35,
36
],
[
35,
37
],
[
33,
38
],
[
38,
39
],
[
38,
40
],
[
33,
41
],
[
41,
42
],
[
42,
43
],
[
33,
44
],
[
45,
45
],
[
45,
46
],
[
46,
47
],
[
46,
48
],
[
48,
49
],
[
48,
50
],
[
48,
51
],
[
45,
52
],
[
52,
53
],
[
53,
54
],
[
54,
55
],
[
54,
56
],
[
52,
57
],
[
57,
58
],
[
57,
59
],
[
52,
60
],
[
60,
61
],
[
61,
62
],
[
52,
63
],
[
64,
64
],
[
64,
65
],
[
65,
66
],
[
65,
67
],
[
67,
68
],
[
67,
69
],
[
67,
70
],
[
8,
71
],
[
71,
72
],
[
72,
73
],
[
73,
74
],
[
73,
75
],
[
71,
76
],
[
6,
77
],
[
77,
78
],
[
118,
79
],
[
79,
80
],
[
79,
81
],
[
81,
82
],
[
82,
83
],
[
83,
84
],
[
83,
85
],
[
82,
86
],
[
86,
87
],
[
87,
88
],
[
87,
89
],
[
86,
90
],
[
90,
91
],
[
90,
92
],
[
86,
93
],
[
93,
94
],
[
93,
95
],
[
81,
96
],
[
96,
97
],
[
97,
98
],
[
98,
99
],
[
98,
100
],
[
97,
101
],
[
96,
102
],
[
102,
103
],
[
103,
104
],
[
96,
105
],
[
105,
106
],
[
106,
107
],
[
107,
108
],
[
107,
109
],
[
107,
110
],
[
110,
111
],
[
110,
112
],
[
79,
113
],
[
113,
114
],
[
79,
115
],
[
115,
116
],
[
0,
117
],
[
117,
118
],
[
117,
119
]
] |
[
"import java.util.Scanner;\n\npublic class Main {\n\n\tpublic static void main(String[] args) {\n\t\tScanner scan = new Scanner(System.in);\n\t\tint k = scan.nextInt();\n\t\tlong sum = 0;\n\t\tfor (int a = 1; a <= k; a++) {\n\t\t\tfor (int b = 1; b <= k; b++) {\n\t\t\t\tint r = gcd(a, b);\n\t\t\t\tfor (int c = 1; c <= k; c++) {\n\t\t\t\t\tsum += gcd(r, c);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(sum);\n\t}\n\t\n\tpublic static int gcd(int a, int b) {\n\t\tif (a < b) {\n\t\t\tint tmp = a;\n\t\t\ta = b;\n\t\t\tb = tmp;\n\t\t}\n\t\tif (a % b == 0) {\n\t\t\treturn b;\n\t\t} else {\n\t\t\treturn gcd(b, a % b);\n\t\t}\n\t}\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n\n\tpublic static void main(String[] args) {\n\t\tScanner scan = new Scanner(System.in);\n\t\tint k = scan.nextInt();\n\t\tlong sum = 0;\n\t\tfor (int a = 1; a <= k; a++) {\n\t\t\tfor (int b = 1; b <= k; b++) {\n\t\t\t\tint r = gcd(a, b);\n\t\t\t\tfor (int c = 1; c <= k; c++) {\n\t\t\t\t\tsum += gcd(r, c);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(sum);\n\t}\n\t\n\tpublic static int gcd(int a, int b) {\n\t\tif (a < b) {\n\t\t\tint tmp = a;\n\t\t\ta = b;\n\t\t\tb = tmp;\n\t\t}\n\t\tif (a % b == 0) {\n\t\t\treturn b;\n\t\t} else {\n\t\t\treturn gcd(b, a % b);\n\t\t}\n\t}\n}",
"Main",
"public static void main(String[] args) {\n\t\tScanner scan = new Scanner(System.in);\n\t\tint k = scan.nextInt();\n\t\tlong sum = 0;\n\t\tfor (int a = 1; a <= k; a++) {\n\t\t\tfor (int b = 1; b <= k; b++) {\n\t\t\t\tint r = gcd(a, b);\n\t\t\t\tfor (int c = 1; c <= k; c++) {\n\t\t\t\t\tsum += gcd(r, c);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(sum);\n\t}",
"main",
"{\n\t\tScanner scan = new Scanner(System.in);\n\t\tint k = scan.nextInt();\n\t\tlong sum = 0;\n\t\tfor (int a = 1; a <= k; a++) {\n\t\t\tfor (int b = 1; b <= k; b++) {\n\t\t\t\tint r = gcd(a, b);\n\t\t\t\tfor (int c = 1; c <= k; c++) {\n\t\t\t\t\tsum += gcd(r, c);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(sum);\n\t}",
"Scanner scan = new Scanner(System.in);",
"scan",
"new Scanner(System.in)",
"int k = scan.nextInt();",
"k",
"scan.nextInt()",
"scan.nextInt",
"scan",
"long sum = 0;",
"sum",
"0",
"for (int a = 1; a <= k; a++) {\n\t\t\tfor (int b = 1; b <= k; b++) {\n\t\t\t\tint r = gcd(a, b);\n\t\t\t\tfor (int c = 1; c <= k; c++) {\n\t\t\t\t\tsum += gcd(r, c);\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"int a = 1;",
"int a = 1;",
"a",
"1",
"a <= k",
"a",
"k",
"a++",
"a++",
"a",
"{\n\t\t\tfor (int b = 1; b <= k; b++) {\n\t\t\t\tint r = gcd(a, b);\n\t\t\t\tfor (int c = 1; c <= k; c++) {\n\t\t\t\t\tsum += gcd(r, c);\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"{\n\t\t\tfor (int b = 1; b <= k; b++) {\n\t\t\t\tint r = gcd(a, b);\n\t\t\t\tfor (int c = 1; c <= k; c++) {\n\t\t\t\t\tsum += gcd(r, c);\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"for (int b = 1; b <= k; b++) {\n\t\t\t\tint r = gcd(a, b);\n\t\t\t\tfor (int c = 1; c <= k; c++) {\n\t\t\t\t\tsum += gcd(r, c);\n\t\t\t\t}\n\t\t\t}",
"int b = 1;",
"int b = 1;",
"b",
"1",
"b <= k",
"b",
"k",
"b++",
"b++",
"b",
"{\n\t\t\t\tint r = gcd(a, b);\n\t\t\t\tfor (int c = 1; c <= k; c++) {\n\t\t\t\t\tsum += gcd(r, c);\n\t\t\t\t}\n\t\t\t}",
"{\n\t\t\t\tint r = gcd(a, b);\n\t\t\t\tfor (int c = 1; c <= k; c++) {\n\t\t\t\t\tsum += gcd(r, c);\n\t\t\t\t}\n\t\t\t}",
"int r = gcd(a, b);",
"r",
"gcd(a, b)",
"gcd",
"a",
"b",
"for (int c = 1; c <= k; c++) {\n\t\t\t\t\tsum += gcd(r, c);\n\t\t\t\t}",
"int c = 1;",
"int c = 1;",
"c",
"1",
"c <= k",
"c",
"k",
"c++",
"c++",
"c",
"{\n\t\t\t\t\tsum += gcd(r, c);\n\t\t\t\t}",
"{\n\t\t\t\t\tsum += gcd(r, c);\n\t\t\t\t}",
"sum += gcd(r, c)",
"sum",
"gcd(r, c)",
"gcd",
"r",
"c",
"System.out.println(sum)",
"System.out.println",
"System.out",
"System",
"System.out",
"sum",
"String[] args",
"args",
"public static int gcd(int a, int b) {\n\t\tif (a < b) {\n\t\t\tint tmp = a;\n\t\t\ta = b;\n\t\t\tb = tmp;\n\t\t}\n\t\tif (a % b == 0) {\n\t\t\treturn b;\n\t\t} else {\n\t\t\treturn gcd(b, a % b);\n\t\t}\n\t}",
"gcd",
"{\n\t\tif (a < b) {\n\t\t\tint tmp = a;\n\t\t\ta = b;\n\t\t\tb = tmp;\n\t\t}\n\t\tif (a % b == 0) {\n\t\t\treturn b;\n\t\t} else {\n\t\t\treturn gcd(b, a % b);\n\t\t}\n\t}",
"if (a < b) {\n\t\t\tint tmp = a;\n\t\t\ta = b;\n\t\t\tb = tmp;\n\t\t}",
"a < b",
"a",
"b",
"{\n\t\t\tint tmp = a;\n\t\t\ta = b;\n\t\t\tb = tmp;\n\t\t}",
"int tmp = a;",
"tmp",
"a",
"a = b",
"a",
"b",
"b = tmp",
"b",
"tmp",
"if (a % b == 0) {\n\t\t\treturn b;\n\t\t} else {\n\t\t\treturn gcd(b, a % b);\n\t\t}",
"a % b == 0",
"a % b",
"a",
"b",
"0",
"{\n\t\t\treturn b;\n\t\t}",
"return b;",
"b",
"{\n\t\t\treturn gcd(b, a % b);\n\t\t}",
"return gcd(b, a % b);",
"gcd(b, a % b)",
"gcd",
"b",
"a % b",
"a",
"b",
"int a",
"a",
"int b",
"b",
"public class Main {\n\n\tpublic static void main(String[] args) {\n\t\tScanner scan = new Scanner(System.in);\n\t\tint k = scan.nextInt();\n\t\tlong sum = 0;\n\t\tfor (int a = 1; a <= k; a++) {\n\t\t\tfor (int b = 1; b <= k; b++) {\n\t\t\t\tint r = gcd(a, b);\n\t\t\t\tfor (int c = 1; c <= k; c++) {\n\t\t\t\t\tsum += gcd(r, c);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(sum);\n\t}\n\t\n\tpublic static int gcd(int a, int b) {\n\t\tif (a < b) {\n\t\t\tint tmp = a;\n\t\t\ta = b;\n\t\t\tb = tmp;\n\t\t}\n\t\tif (a % b == 0) {\n\t\t\treturn b;\n\t\t} else {\n\t\t\treturn gcd(b, a % b);\n\t\t}\n\t}\n}",
"public class Main {\n\n\tpublic static void main(String[] args) {\n\t\tScanner scan = new Scanner(System.in);\n\t\tint k = scan.nextInt();\n\t\tlong sum = 0;\n\t\tfor (int a = 1; a <= k; a++) {\n\t\t\tfor (int b = 1; b <= k; b++) {\n\t\t\t\tint r = gcd(a, b);\n\t\t\t\tfor (int c = 1; c <= k; c++) {\n\t\t\t\t\tsum += gcd(r, c);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(sum);\n\t}\n\t\n\tpublic static int gcd(int a, int b) {\n\t\tif (a < b) {\n\t\t\tint tmp = a;\n\t\t\ta = b;\n\t\t\tb = tmp;\n\t\t}\n\t\tif (a % b == 0) {\n\t\t\treturn b;\n\t\t} else {\n\t\t\treturn gcd(b, a % b);\n\t\t}\n\t}\n}",
"Main"
] |
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
int k = scan.nextInt();
long sum = 0;
for (int a = 1; a <= k; a++) {
for (int b = 1; b <= k; b++) {
int r = gcd(a, b);
for (int c = 1; c <= k; c++) {
sum += gcd(r, c);
}
}
}
System.out.println(sum);
}
public static int gcd(int a, int b) {
if (a < b) {
int tmp = a;
a = b;
b = tmp;
}
if (a % b == 0) {
return b;
} else {
return gcd(b, a % b);
}
}
}
|
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
41,
13,
13,
14,
2,
13,
13,
0,
13,
13,
14,
2,
13,
13,
0,
13,
13,
41,
13,
17,
11,
1,
41,
13,
13,
2,
17,
13,
1,
40,
13,
30,
30,
14,
2,
2,
2,
2,
13,
13,
17,
2,
2,
13,
13,
17,
2,
2,
13,
13,
17,
30,
0,
13,
13,
3,
0,
13,
13,
4,
18,
18,
13,
13,
13,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
127,
5
],
[
127,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
8,
17
],
[
17,
18
],
[
17,
19
],
[
8,
20
],
[
20,
21
],
[
21,
22
],
[
22,
23
],
[
22,
24
],
[
20,
25
],
[
25,
26
],
[
25,
27
],
[
20,
28
],
[
28,
29
],
[
29,
30
],
[
20,
31
],
[
32,
32
],
[
32,
33
],
[
33,
34
],
[
34,
35
],
[
35,
36
],
[
35,
37
],
[
33,
38
],
[
38,
39
],
[
38,
40
],
[
33,
41
],
[
41,
42
],
[
42,
43
],
[
33,
44
],
[
45,
45
],
[
45,
46
],
[
46,
47
],
[
47,
48
],
[
48,
49
],
[
48,
50
],
[
46,
51
],
[
51,
52
],
[
51,
53
],
[
46,
54
],
[
54,
55
],
[
55,
56
],
[
46,
57
],
[
58,
58
],
[
58,
59
],
[
59,
60
],
[
59,
61
],
[
58,
62
],
[
62,
63
],
[
63,
64
],
[
63,
65
],
[
62,
66
],
[
66,
67
],
[
66,
68
],
[
58,
69
],
[
69,
70
],
[
70,
71
],
[
70,
72
],
[
69,
73
],
[
73,
74
],
[
73,
75
],
[
58,
76
],
[
76,
77
],
[
76,
78
],
[
58,
79
],
[
79,
80
],
[
80,
81
],
[
81,
82
],
[
81,
83
],
[
79,
84
],
[
84,
85
],
[
84,
86
],
[
79,
87
],
[
87,
88
],
[
88,
89
],
[
79,
90
],
[
91,
91
],
[
91,
92
],
[
92,
93
],
[
94,
94
],
[
94,
95
],
[
95,
96
],
[
96,
97
],
[
96,
98
],
[
95,
99
],
[
94,
100
],
[
100,
101
],
[
101,
102
],
[
101,
103
],
[
100,
104
],
[
94,
105
],
[
105,
106
],
[
106,
107
],
[
106,
108
],
[
105,
109
],
[
92,
110
],
[
110,
111
],
[
111,
112
],
[
111,
113
],
[
110,
114
],
[
58,
115
],
[
115,
116
],
[
115,
117
],
[
8,
118
],
[
118,
119
],
[
119,
120
],
[
120,
121
],
[
120,
122
],
[
118,
123
],
[
6,
124
],
[
124,
125
],
[
0,
126
],
[
126,
127
],
[
126,
128
]
] |
[
"import java.util.*;\npublic class Main{\n\tpublic static void main(String[] args){\n\t\tScanner sc = new Scanner(System.in);\n\t\tint K = sc.nextInt();\n\t\tint count = 0;\n\t\tfor (int a = 1; a <= K; a++) {\n\t\t\tfor (int b = 1; b <= K; b++) {\n\t\t\t\t for (int c = 1; c <= K; c++) {\n\t\t\t\t\t int min = c;\n\t\t\t\t\t if (b < c) min = b;\n\t\t\t\t\t if (a < b) min = a;\n\t\t\t\t\t int com = 0;\n\t\t\t\t\t for (int i = min; 1 <= i ; i--) {\n\t\t\t\t\t\t if (a%i == 0 && b%i == 0 && c%i == 0) {\n\t\t\t\t\t\t\t com = i;\n\t\t\t\t\t\t\t break;\n\t\t\t\t\t\t }\n\t\t\t\t\t }\n\t\t\t\t\t count += com;\n\t\t\t\t }\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(count);\n\t}\n}",
"import java.util.*;",
"util.*",
"java",
"public class Main{\n\tpublic static void main(String[] args){\n\t\tScanner sc = new Scanner(System.in);\n\t\tint K = sc.nextInt();\n\t\tint count = 0;\n\t\tfor (int a = 1; a <= K; a++) {\n\t\t\tfor (int b = 1; b <= K; b++) {\n\t\t\t\t for (int c = 1; c <= K; c++) {\n\t\t\t\t\t int min = c;\n\t\t\t\t\t if (b < c) min = b;\n\t\t\t\t\t if (a < b) min = a;\n\t\t\t\t\t int com = 0;\n\t\t\t\t\t for (int i = min; 1 <= i ; i--) {\n\t\t\t\t\t\t if (a%i == 0 && b%i == 0 && c%i == 0) {\n\t\t\t\t\t\t\t com = i;\n\t\t\t\t\t\t\t break;\n\t\t\t\t\t\t }\n\t\t\t\t\t }\n\t\t\t\t\t count += com;\n\t\t\t\t }\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(count);\n\t}\n}",
"Main",
"public static void main(String[] args){\n\t\tScanner sc = new Scanner(System.in);\n\t\tint K = sc.nextInt();\n\t\tint count = 0;\n\t\tfor (int a = 1; a <= K; a++) {\n\t\t\tfor (int b = 1; b <= K; b++) {\n\t\t\t\t for (int c = 1; c <= K; c++) {\n\t\t\t\t\t int min = c;\n\t\t\t\t\t if (b < c) min = b;\n\t\t\t\t\t if (a < b) min = a;\n\t\t\t\t\t int com = 0;\n\t\t\t\t\t for (int i = min; 1 <= i ; i--) {\n\t\t\t\t\t\t if (a%i == 0 && b%i == 0 && c%i == 0) {\n\t\t\t\t\t\t\t com = i;\n\t\t\t\t\t\t\t break;\n\t\t\t\t\t\t }\n\t\t\t\t\t }\n\t\t\t\t\t count += com;\n\t\t\t\t }\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(count);\n\t}",
"main",
"{\n\t\tScanner sc = new Scanner(System.in);\n\t\tint K = sc.nextInt();\n\t\tint count = 0;\n\t\tfor (int a = 1; a <= K; a++) {\n\t\t\tfor (int b = 1; b <= K; b++) {\n\t\t\t\t for (int c = 1; c <= K; c++) {\n\t\t\t\t\t int min = c;\n\t\t\t\t\t if (b < c) min = b;\n\t\t\t\t\t if (a < b) min = a;\n\t\t\t\t\t int com = 0;\n\t\t\t\t\t for (int i = min; 1 <= i ; i--) {\n\t\t\t\t\t\t if (a%i == 0 && b%i == 0 && c%i == 0) {\n\t\t\t\t\t\t\t com = i;\n\t\t\t\t\t\t\t break;\n\t\t\t\t\t\t }\n\t\t\t\t\t }\n\t\t\t\t\t count += com;\n\t\t\t\t }\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(count);\n\t}",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"int K = sc.nextInt();",
"K",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int count = 0;",
"count",
"0",
"for (int a = 1; a <= K; a++) {\n\t\t\tfor (int b = 1; b <= K; b++) {\n\t\t\t\t for (int c = 1; c <= K; c++) {\n\t\t\t\t\t int min = c;\n\t\t\t\t\t if (b < c) min = b;\n\t\t\t\t\t if (a < b) min = a;\n\t\t\t\t\t int com = 0;\n\t\t\t\t\t for (int i = min; 1 <= i ; i--) {\n\t\t\t\t\t\t if (a%i == 0 && b%i == 0 && c%i == 0) {\n\t\t\t\t\t\t\t com = i;\n\t\t\t\t\t\t\t break;\n\t\t\t\t\t\t }\n\t\t\t\t\t }\n\t\t\t\t\t count += com;\n\t\t\t\t }\n\t\t\t}\n\t\t}",
"int a = 1;",
"int a = 1;",
"a",
"1",
"a <= K",
"a",
"K",
"a++",
"a++",
"a",
"{\n\t\t\tfor (int b = 1; b <= K; b++) {\n\t\t\t\t for (int c = 1; c <= K; c++) {\n\t\t\t\t\t int min = c;\n\t\t\t\t\t if (b < c) min = b;\n\t\t\t\t\t if (a < b) min = a;\n\t\t\t\t\t int com = 0;\n\t\t\t\t\t for (int i = min; 1 <= i ; i--) {\n\t\t\t\t\t\t if (a%i == 0 && b%i == 0 && c%i == 0) {\n\t\t\t\t\t\t\t com = i;\n\t\t\t\t\t\t\t break;\n\t\t\t\t\t\t }\n\t\t\t\t\t }\n\t\t\t\t\t count += com;\n\t\t\t\t }\n\t\t\t}\n\t\t}",
"{\n\t\t\tfor (int b = 1; b <= K; b++) {\n\t\t\t\t for (int c = 1; c <= K; c++) {\n\t\t\t\t\t int min = c;\n\t\t\t\t\t if (b < c) min = b;\n\t\t\t\t\t if (a < b) min = a;\n\t\t\t\t\t int com = 0;\n\t\t\t\t\t for (int i = min; 1 <= i ; i--) {\n\t\t\t\t\t\t if (a%i == 0 && b%i == 0 && c%i == 0) {\n\t\t\t\t\t\t\t com = i;\n\t\t\t\t\t\t\t break;\n\t\t\t\t\t\t }\n\t\t\t\t\t }\n\t\t\t\t\t count += com;\n\t\t\t\t }\n\t\t\t}\n\t\t}",
"for (int b = 1; b <= K; b++) {\n\t\t\t\t for (int c = 1; c <= K; c++) {\n\t\t\t\t\t int min = c;\n\t\t\t\t\t if (b < c) min = b;\n\t\t\t\t\t if (a < b) min = a;\n\t\t\t\t\t int com = 0;\n\t\t\t\t\t for (int i = min; 1 <= i ; i--) {\n\t\t\t\t\t\t if (a%i == 0 && b%i == 0 && c%i == 0) {\n\t\t\t\t\t\t\t com = i;\n\t\t\t\t\t\t\t break;\n\t\t\t\t\t\t }\n\t\t\t\t\t }\n\t\t\t\t\t count += com;\n\t\t\t\t }\n\t\t\t}",
"int b = 1;",
"int b = 1;",
"b",
"1",
"b <= K",
"b",
"K",
"b++",
"b++",
"b",
"{\n\t\t\t\t for (int c = 1; c <= K; c++) {\n\t\t\t\t\t int min = c;\n\t\t\t\t\t if (b < c) min = b;\n\t\t\t\t\t if (a < b) min = a;\n\t\t\t\t\t int com = 0;\n\t\t\t\t\t for (int i = min; 1 <= i ; i--) {\n\t\t\t\t\t\t if (a%i == 0 && b%i == 0 && c%i == 0) {\n\t\t\t\t\t\t\t com = i;\n\t\t\t\t\t\t\t break;\n\t\t\t\t\t\t }\n\t\t\t\t\t }\n\t\t\t\t\t count += com;\n\t\t\t\t }\n\t\t\t}",
"{\n\t\t\t\t for (int c = 1; c <= K; c++) {\n\t\t\t\t\t int min = c;\n\t\t\t\t\t if (b < c) min = b;\n\t\t\t\t\t if (a < b) min = a;\n\t\t\t\t\t int com = 0;\n\t\t\t\t\t for (int i = min; 1 <= i ; i--) {\n\t\t\t\t\t\t if (a%i == 0 && b%i == 0 && c%i == 0) {\n\t\t\t\t\t\t\t com = i;\n\t\t\t\t\t\t\t break;\n\t\t\t\t\t\t }\n\t\t\t\t\t }\n\t\t\t\t\t count += com;\n\t\t\t\t }\n\t\t\t}",
"for (int c = 1; c <= K; c++) {\n\t\t\t\t\t int min = c;\n\t\t\t\t\t if (b < c) min = b;\n\t\t\t\t\t if (a < b) min = a;\n\t\t\t\t\t int com = 0;\n\t\t\t\t\t for (int i = min; 1 <= i ; i--) {\n\t\t\t\t\t\t if (a%i == 0 && b%i == 0 && c%i == 0) {\n\t\t\t\t\t\t\t com = i;\n\t\t\t\t\t\t\t break;\n\t\t\t\t\t\t }\n\t\t\t\t\t }\n\t\t\t\t\t count += com;\n\t\t\t\t }",
"int c = 1;",
"int c = 1;",
"c",
"1",
"c <= K",
"c",
"K",
"c++",
"c++",
"c",
"{\n\t\t\t\t\t int min = c;\n\t\t\t\t\t if (b < c) min = b;\n\t\t\t\t\t if (a < b) min = a;\n\t\t\t\t\t int com = 0;\n\t\t\t\t\t for (int i = min; 1 <= i ; i--) {\n\t\t\t\t\t\t if (a%i == 0 && b%i == 0 && c%i == 0) {\n\t\t\t\t\t\t\t com = i;\n\t\t\t\t\t\t\t break;\n\t\t\t\t\t\t }\n\t\t\t\t\t }\n\t\t\t\t\t count += com;\n\t\t\t\t }",
"{\n\t\t\t\t\t int min = c;\n\t\t\t\t\t if (b < c) min = b;\n\t\t\t\t\t if (a < b) min = a;\n\t\t\t\t\t int com = 0;\n\t\t\t\t\t for (int i = min; 1 <= i ; i--) {\n\t\t\t\t\t\t if (a%i == 0 && b%i == 0 && c%i == 0) {\n\t\t\t\t\t\t\t com = i;\n\t\t\t\t\t\t\t break;\n\t\t\t\t\t\t }\n\t\t\t\t\t }\n\t\t\t\t\t count += com;\n\t\t\t\t }",
"int min = c;",
"min",
"c",
"if (b < c) min = b;",
"b < c",
"b",
"c",
"min = b",
"min",
"b",
"if (a < b) min = a;",
"a < b",
"a",
"b",
"min = a",
"min",
"a",
"int com = 0;",
"com",
"0",
"for (int i = min; 1 <= i ; i--) {\n\t\t\t\t\t\t if (a%i == 0 && b%i == 0 && c%i == 0) {\n\t\t\t\t\t\t\t com = i;\n\t\t\t\t\t\t\t break;\n\t\t\t\t\t\t }\n\t\t\t\t\t }",
"int i = min;",
"int i = min;",
"i",
"min",
"1 <= i",
"1",
"i",
"i--",
"i--",
"i",
"{\n\t\t\t\t\t\t if (a%i == 0 && b%i == 0 && c%i == 0) {\n\t\t\t\t\t\t\t com = i;\n\t\t\t\t\t\t\t break;\n\t\t\t\t\t\t }\n\t\t\t\t\t }",
"{\n\t\t\t\t\t\t if (a%i == 0 && b%i == 0 && c%i == 0) {\n\t\t\t\t\t\t\t com = i;\n\t\t\t\t\t\t\t break;\n\t\t\t\t\t\t }\n\t\t\t\t\t }",
"if (a%i == 0 && b%i == 0 && c%i == 0) {\n\t\t\t\t\t\t\t com = i;\n\t\t\t\t\t\t\t break;\n\t\t\t\t\t\t }",
"a%i == 0 && b%i == 0 && c%i == 0",
"a%i == 0 && b%i == 0 && c%i == 0",
"a%i == 0",
"a%i",
"a",
"i",
"0",
"b%i == 0",
"b%i",
"b",
"i",
"0",
"c%i == 0",
"c%i",
"c",
"i",
"0",
"{\n\t\t\t\t\t\t\t com = i;\n\t\t\t\t\t\t\t break;\n\t\t\t\t\t\t }",
"com = i",
"com",
"i",
"break;",
"count += com",
"count",
"com",
"System.out.println(count)",
"System.out.println",
"System.out",
"System",
"System.out",
"count",
"String[] args",
"args",
"public class Main{\n\tpublic static void main(String[] args){\n\t\tScanner sc = new Scanner(System.in);\n\t\tint K = sc.nextInt();\n\t\tint count = 0;\n\t\tfor (int a = 1; a <= K; a++) {\n\t\t\tfor (int b = 1; b <= K; b++) {\n\t\t\t\t for (int c = 1; c <= K; c++) {\n\t\t\t\t\t int min = c;\n\t\t\t\t\t if (b < c) min = b;\n\t\t\t\t\t if (a < b) min = a;\n\t\t\t\t\t int com = 0;\n\t\t\t\t\t for (int i = min; 1 <= i ; i--) {\n\t\t\t\t\t\t if (a%i == 0 && b%i == 0 && c%i == 0) {\n\t\t\t\t\t\t\t com = i;\n\t\t\t\t\t\t\t break;\n\t\t\t\t\t\t }\n\t\t\t\t\t }\n\t\t\t\t\t count += com;\n\t\t\t\t }\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(count);\n\t}\n}",
"public class Main{\n\tpublic static void main(String[] args){\n\t\tScanner sc = new Scanner(System.in);\n\t\tint K = sc.nextInt();\n\t\tint count = 0;\n\t\tfor (int a = 1; a <= K; a++) {\n\t\t\tfor (int b = 1; b <= K; b++) {\n\t\t\t\t for (int c = 1; c <= K; c++) {\n\t\t\t\t\t int min = c;\n\t\t\t\t\t if (b < c) min = b;\n\t\t\t\t\t if (a < b) min = a;\n\t\t\t\t\t int com = 0;\n\t\t\t\t\t for (int i = min; 1 <= i ; i--) {\n\t\t\t\t\t\t if (a%i == 0 && b%i == 0 && c%i == 0) {\n\t\t\t\t\t\t\t com = i;\n\t\t\t\t\t\t\t break;\n\t\t\t\t\t\t }\n\t\t\t\t\t }\n\t\t\t\t\t count += com;\n\t\t\t\t }\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(count);\n\t}\n}",
"Main"
] |
import java.util.*;
public class Main{
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
int K = sc.nextInt();
int count = 0;
for (int a = 1; a <= K; a++) {
for (int b = 1; b <= K; b++) {
for (int c = 1; c <= K; c++) {
int min = c;
if (b < c) min = b;
if (a < b) min = a;
int com = 0;
for (int i = min; 1 <= i ; i--) {
if (a%i == 0 && b%i == 0 && c%i == 0) {
com = i;
break;
}
}
count += com;
}
}
}
System.out.println(count);
}
}
|
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
41,
13,
20,
41,
13,
20,
41,
13,
2,
17,
17,
12,
13,
30,
4,
13,
4,
18,
13,
23,
13,
12,
13,
30,
41,
13,
4,
18,
13,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
4,
13,
13,
13,
13,
4,
18,
13,
13,
12,
13,
30,
14,
2,
18,
13,
13,
17,
29,
17,
41,
13,
18,
13,
17,
11,
1,
41,
13,
17,
2,
13,
18,
13,
13,
1,
40,
13,
30,
30,
0,
13,
4,
13,
13,
18,
13,
13,
29,
13,
23,
13,
12,
13,
30,
14,
2,
13,
17,
30,
29,
13,
29,
4,
13,
13,
2,
13,
13,
23,
13,
23,
13,
6,
13,
41,
13,
41,
13,
12,
13,
30,
0,
13,
20,
23,
13,
12,
13,
30,
42,
2,
2,
13,
17,
40,
4,
18,
13,
30,
38,
5,
13,
30,
4,
18,
13,
30,
0,
13,
20,
29,
4,
18,
13,
12,
13,
30,
29,
4,
18,
13,
4,
13,
12,
13,
30,
29,
4,
18,
13,
4,
13,
12,
13,
30,
29,
4,
18,
13,
4,
13,
12,
13,
30,
41,
13,
17,
38,
5,
13,
30,
4,
18,
13,
30,
0,
13,
4,
18,
13,
29,
13,
12,
13,
30,
41,
13,
20,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
0,
18,
13,
13,
4,
13,
29,
13,
23,
13,
12,
13,
30,
41,
13,
20,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
0,
18,
13,
13,
4,
13,
29,
13,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
307,
11
],
[
307,
12
],
[
12,
13
],
[
12,
14
],
[
307,
15
],
[
15,
16
],
[
15,
17
],
[
307,
18
],
[
18,
19
],
[
18,
20
],
[
20,
21
],
[
20,
22
],
[
307,
23
],
[
23,
24
],
[
23,
25
],
[
25,
26
],
[
26,
27
],
[
25,
28
],
[
28,
29
],
[
29,
30
],
[
23,
31
],
[
31,
32
],
[
307,
33
],
[
33,
34
],
[
33,
35
],
[
35,
36
],
[
36,
37
],
[
36,
38
],
[
38,
39
],
[
39,
40
],
[
35,
41
],
[
41,
42
],
[
41,
43
],
[
35,
44
],
[
44,
45
],
[
45,
46
],
[
46,
47
],
[
46,
48
],
[
44,
49
],
[
49,
50
],
[
49,
51
],
[
44,
52
],
[
52,
53
],
[
53,
54
],
[
44,
55
],
[
56,
56
],
[
56,
57
],
[
57,
58
],
[
58,
59
],
[
59,
60
],
[
59,
61
],
[
57,
62
],
[
62,
63
],
[
62,
64
],
[
57,
65
],
[
65,
66
],
[
66,
67
],
[
57,
68
],
[
69,
69
],
[
69,
70
],
[
70,
71
],
[
71,
72
],
[
72,
73
],
[
72,
74
],
[
70,
75
],
[
75,
76
],
[
75,
77
],
[
70,
78
],
[
78,
79
],
[
79,
80
],
[
70,
81
],
[
82,
82
],
[
82,
83
],
[
83,
84
],
[
83,
85
],
[
85,
86
],
[
85,
87
],
[
85,
88
],
[
85,
89
],
[
35,
90
],
[
90,
91
],
[
91,
92
],
[
90,
93
],
[
307,
94
],
[
94,
95
],
[
94,
96
],
[
96,
97
],
[
97,
98
],
[
98,
99
],
[
99,
100
],
[
99,
101
],
[
98,
102
],
[
97,
103
],
[
103,
104
],
[
96,
105
],
[
105,
106
],
[
105,
107
],
[
107,
108
],
[
107,
109
],
[
96,
110
],
[
110,
111
],
[
111,
112
],
[
112,
113
],
[
112,
114
],
[
110,
115
],
[
115,
116
],
[
115,
117
],
[
117,
118
],
[
117,
119
],
[
110,
120
],
[
120,
121
],
[
121,
122
],
[
110,
123
],
[
124,
124
],
[
124,
125
],
[
125,
126
],
[
125,
127
],
[
127,
128
],
[
127,
129
],
[
127,
130
],
[
130,
131
],
[
130,
132
],
[
96,
133
],
[
133,
134
],
[
94,
135
],
[
135,
136
],
[
307,
137
],
[
137,
138
],
[
137,
139
],
[
139,
140
],
[
140,
141
],
[
141,
142
],
[
141,
143
],
[
140,
144
],
[
144,
145
],
[
145,
146
],
[
139,
147
],
[
147,
148
],
[
148,
149
],
[
148,
150
],
[
148,
151
],
[
151,
152
],
[
151,
153
],
[
137,
154
],
[
154,
155
],
[
137,
156
],
[
156,
157
],
[
307,
158
],
[
158,
159
],
[
158,
160
],
[
160,
161
],
[
158,
162
],
[
162,
163
],
[
158,
164
],
[
164,
165
],
[
164,
166
],
[
166,
167
],
[
167,
168
],
[
167,
169
],
[
164,
170
],
[
170,
171
],
[
158,
172
],
[
172,
173
],
[
172,
174
],
[
174,
175
],
[
175,
176
],
[
176,
177
],
[
177,
178
],
[
177,
179
],
[
176,
180
],
[
180,
181
],
[
181,
182
],
[
182,
183
],
[
175,
184
],
[
184,
185
],
[
185,
186
],
[
186,
187
],
[
186,
188
],
[
188,
189
],
[
189,
190
],
[
190,
191
],
[
185,
192
],
[
192,
193
],
[
193,
194
],
[
193,
195
],
[
174,
196
],
[
196,
197
],
[
197,
198
],
[
198,
199
],
[
158,
200
],
[
200,
201
],
[
200,
202
],
[
202,
203
],
[
203,
204
],
[
204,
205
],
[
205,
206
],
[
204,
207
],
[
207,
208
],
[
158,
209
],
[
209,
210
],
[
209,
211
],
[
211,
212
],
[
212,
213
],
[
213,
214
],
[
214,
215
],
[
213,
216
],
[
216,
217
],
[
158,
218
],
[
218,
219
],
[
218,
220
],
[
220,
221
],
[
221,
222
],
[
222,
223
],
[
223,
224
],
[
222,
225
],
[
225,
226
],
[
158,
227
],
[
227,
228
],
[
227,
229
],
[
229,
230
],
[
230,
231
],
[
230,
232
],
[
229,
233
],
[
233,
234
],
[
234,
235
],
[
234,
236
],
[
236,
237
],
[
237,
238
],
[
238,
239
],
[
233,
240
],
[
240,
241
],
[
241,
242
],
[
241,
243
],
[
243,
244
],
[
244,
245
],
[
229,
246
],
[
246,
247
],
[
158,
248
],
[
248,
249
],
[
248,
250
],
[
250,
251
],
[
251,
252
],
[
251,
253
],
[
250,
255
],
[
255,
256
],
[
256,
257
],
[
257,
258
],
[
257,
259
],
[
255,
260
],
[
260,
261
],
[
260,
262
],
[
255,
263
],
[
263,
264
],
[
264,
265
],
[
255,
266
],
[
266,
267
],
[
267,
268
],
[
268,
269
],
[
268,
270
],
[
267,
271
],
[
271,
272
],
[
250,
273
],
[
273,
274
],
[
248,
275
],
[
275,
276
],
[
158,
277
],
[
277,
278
],
[
277,
279
],
[
279,
280
],
[
280,
281
],
[
280,
282
],
[
279,
284
],
[
284,
285
],
[
285,
286
],
[
286,
287
],
[
286,
288
],
[
284,
289
],
[
289,
290
],
[
289,
291
],
[
284,
292
],
[
292,
293
],
[
293,
294
],
[
284,
295
],
[
295,
296
],
[
296,
297
],
[
297,
298
],
[
297,
299
],
[
296,
300
],
[
300,
301
],
[
279,
302
],
[
302,
303
],
[
277,
304
],
[
304,
305
],
[
0,
306
],
[
306,
307
],
[
306,
308
]
] |
[
"import java.awt.*;\nimport java.io.*;\nimport java.util.*;\n\npublic class Main {\n\n private static FastReader in = new FastReader(System.in);\n private static PrintWriter out = new PrintWriter(System.out);\n\n private static final long MOD = (long) 1e9 + 7;\n\n public static void main(String[] args) {\n solve();\n out.flush();\n }\n\n private static void solve() {\n int n = in.nextInt();\n long ans = 0;\n for (int i = 1; i <= n; i++) {\n for (int j = 1; j <= n; j++) {\n for (int k = 1; k <= n; k++) {\n ans += gcd(i, j, k);\n }\n }\n }\n out.println(ans);\n }\n\n static long gcd(long... a) {\n if (a.length == 0) return 1;\n long ret = a[0];\n for (int i = 1; i < a.length; i++) {\n ret = gcd(ret, a[i]);\n }\n return ret;\n }\n\n static long gcd(long a, long b) {\n if (b == 0) {\n return a;\n }\n return gcd(b, a % b);\n }\n\n // https://www.geeksforgeeks.org/fast-io-in-java-in-competitive-programming/\n static class FastReader {\n BufferedReader br;\n StringTokenizer st;\n\n FastReader(InputStream inputStream) {\n br = new BufferedReader(new\n InputStreamReader(inputStream));\n }\n\n String next() {\n while (st == null || !st.hasMoreElements()) {\n try {\n st = new StringTokenizer(br.readLine());\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n return st.nextToken();\n }\n\n int nextInt() {\n return Integer.parseInt(next());\n }\n\n long nextLong() {\n return Long.parseLong(next());\n }\n\n double nextDouble() {\n return Double.parseDouble(next());\n }\n\n String nextLine() {\n String str = \"\";\n try {\n str = br.readLine();\n } catch (IOException e) {\n e.printStackTrace();\n }\n return str;\n }\n\n // https://qiita.com/masakinpo/items/5f77f2a879578a85a0bb\n public int[] nextIntArray(int n) {\n int[] a = new int[n];\n for (int i = 0; i < n; i++)\n a[i] = nextInt();\n return a;\n }\n\n public long[] nextLongArray(int n) {\n long[] a = new long[n];\n for (int i = 0; i < n; i++)\n a[i] = nextLong();\n return a;\n }\n }\n}",
"import java.awt.*;",
"awt.*",
"java",
"import java.io.*;",
"io.*",
"java",
"import java.util.*;",
"util.*",
"java",
"public class Main {\n\n private static FastReader in = new FastReader(System.in);\n private static PrintWriter out = new PrintWriter(System.out);\n\n private static final long MOD = (long) 1e9 + 7;\n\n public static void main(String[] args) {\n solve();\n out.flush();\n }\n\n private static void solve() {\n int n = in.nextInt();\n long ans = 0;\n for (int i = 1; i <= n; i++) {\n for (int j = 1; j <= n; j++) {\n for (int k = 1; k <= n; k++) {\n ans += gcd(i, j, k);\n }\n }\n }\n out.println(ans);\n }\n\n static long gcd(long... a) {\n if (a.length == 0) return 1;\n long ret = a[0];\n for (int i = 1; i < a.length; i++) {\n ret = gcd(ret, a[i]);\n }\n return ret;\n }\n\n static long gcd(long a, long b) {\n if (b == 0) {\n return a;\n }\n return gcd(b, a % b);\n }\n\n // https://www.geeksforgeeks.org/fast-io-in-java-in-competitive-programming/\n static class FastReader {\n BufferedReader br;\n StringTokenizer st;\n\n FastReader(InputStream inputStream) {\n br = new BufferedReader(new\n InputStreamReader(inputStream));\n }\n\n String next() {\n while (st == null || !st.hasMoreElements()) {\n try {\n st = new StringTokenizer(br.readLine());\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n return st.nextToken();\n }\n\n int nextInt() {\n return Integer.parseInt(next());\n }\n\n long nextLong() {\n return Long.parseLong(next());\n }\n\n double nextDouble() {\n return Double.parseDouble(next());\n }\n\n String nextLine() {\n String str = \"\";\n try {\n str = br.readLine();\n } catch (IOException e) {\n e.printStackTrace();\n }\n return str;\n }\n\n // https://qiita.com/masakinpo/items/5f77f2a879578a85a0bb\n public int[] nextIntArray(int n) {\n int[] a = new int[n];\n for (int i = 0; i < n; i++)\n a[i] = nextInt();\n return a;\n }\n\n public long[] nextLongArray(int n) {\n long[] a = new long[n];\n for (int i = 0; i < n; i++)\n a[i] = nextLong();\n return a;\n }\n }\n}",
"Main",
"private static FastReader in = new FastReader(System.in);",
"in",
"new FastReader(System.in)",
"private static PrintWriter out = new PrintWriter(System.out);",
"out",
"new PrintWriter(System.out)",
"private static final long MOD = (long) 1e9 + 7;",
"MOD",
"(long) 1e9 + 7",
"(long) 1e9",
"7",
"public static void main(String[] args) {\n solve();\n out.flush();\n }",
"main",
"{\n solve();\n out.flush();\n }",
"solve()",
"solve",
"out.flush()",
"out.flush",
"out",
"String[] args",
"args",
"private static void solve() {\n int n = in.nextInt();\n long ans = 0;\n for (int i = 1; i <= n; i++) {\n for (int j = 1; j <= n; j++) {\n for (int k = 1; k <= n; k++) {\n ans += gcd(i, j, k);\n }\n }\n }\n out.println(ans);\n }",
"solve",
"{\n int n = in.nextInt();\n long ans = 0;\n for (int i = 1; i <= n; i++) {\n for (int j = 1; j <= n; j++) {\n for (int k = 1; k <= n; k++) {\n ans += gcd(i, j, k);\n }\n }\n }\n out.println(ans);\n }",
"int n = in.nextInt();",
"n",
"in.nextInt()",
"in.nextInt",
"in",
"long ans = 0;",
"ans",
"0",
"for (int i = 1; i <= n; i++) {\n for (int j = 1; j <= n; j++) {\n for (int k = 1; k <= n; k++) {\n ans += gcd(i, j, k);\n }\n }\n }",
"int i = 1;",
"int i = 1;",
"i",
"1",
"i <= n",
"i",
"n",
"i++",
"i++",
"i",
"{\n for (int j = 1; j <= n; j++) {\n for (int k = 1; k <= n; k++) {\n ans += gcd(i, j, k);\n }\n }\n }",
"{\n for (int j = 1; j <= n; j++) {\n for (int k = 1; k <= n; k++) {\n ans += gcd(i, j, k);\n }\n }\n }",
"for (int j = 1; j <= n; j++) {\n for (int k = 1; k <= n; k++) {\n ans += gcd(i, j, k);\n }\n }",
"int j = 1;",
"int j = 1;",
"j",
"1",
"j <= n",
"j",
"n",
"j++",
"j++",
"j",
"{\n for (int k = 1; k <= n; k++) {\n ans += gcd(i, j, k);\n }\n }",
"{\n for (int k = 1; k <= n; k++) {\n ans += gcd(i, j, k);\n }\n }",
"for (int k = 1; k <= n; k++) {\n ans += gcd(i, j, k);\n }",
"int k = 1;",
"int k = 1;",
"k",
"1",
"k <= n",
"k",
"n",
"k++",
"k++",
"k",
"{\n ans += gcd(i, j, k);\n }",
"{\n ans += gcd(i, j, k);\n }",
"ans += gcd(i, j, k)",
"ans",
"gcd(i, j, k)",
"gcd",
"i",
"j",
"k",
"out.println(ans)",
"out.println",
"out",
"ans",
"static long gcd(long... a) {\n if (a.length == 0) return 1;\n long ret = a[0];\n for (int i = 1; i < a.length; i++) {\n ret = gcd(ret, a[i]);\n }\n return ret;\n }",
"gcd",
"{\n if (a.length == 0) return 1;\n long ret = a[0];\n for (int i = 1; i < a.length; i++) {\n ret = gcd(ret, a[i]);\n }\n return ret;\n }",
"if (a.length == 0) return 1;",
"a.length == 0",
"a.length",
"a",
"a.length",
"0",
"return 1;",
"1",
"long ret = a[0];",
"ret",
"a[0]",
"a",
"0",
"for (int i = 1; i < a.length; i++) {\n ret = gcd(ret, a[i]);\n }",
"int i = 1;",
"int i = 1;",
"i",
"1",
"i < a.length",
"i",
"a.length",
"a",
"a.length",
"i++",
"i++",
"i",
"{\n ret = gcd(ret, a[i]);\n }",
"{\n ret = gcd(ret, a[i]);\n }",
"ret = gcd(ret, a[i])",
"ret",
"gcd(ret, a[i])",
"gcd",
"ret",
"a[i]",
"a",
"i",
"return ret;",
"ret",
"long... a",
"a",
"static long gcd(long a, long b) {\n if (b == 0) {\n return a;\n }\n return gcd(b, a % b);\n }",
"gcd",
"{\n if (b == 0) {\n return a;\n }\n return gcd(b, a % b);\n }",
"if (b == 0) {\n return a;\n }",
"b == 0",
"b",
"0",
"{\n return a;\n }",
"return a;",
"a",
"return gcd(b, a % b);",
"gcd(b, a % b)",
"gcd",
"b",
"a % b",
"a",
"b",
"long a",
"a",
"long b",
"b",
"static class FastReader {\n BufferedReader br;\n StringTokenizer st;\n\n FastReader(InputStream inputStream) {\n br = new BufferedReader(new\n InputStreamReader(inputStream));\n }\n\n String next() {\n while (st == null || !st.hasMoreElements()) {\n try {\n st = new StringTokenizer(br.readLine());\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n return st.nextToken();\n }\n\n int nextInt() {\n return Integer.parseInt(next());\n }\n\n long nextLong() {\n return Long.parseLong(next());\n }\n\n double nextDouble() {\n return Double.parseDouble(next());\n }\n\n String nextLine() {\n String str = \"\";\n try {\n str = br.readLine();\n } catch (IOException e) {\n e.printStackTrace();\n }\n return str;\n }\n\n // https://qiita.com/masakinpo/items/5f77f2a879578a85a0bb\n public int[] nextIntArray(int n) {\n int[] a = new int[n];\n for (int i = 0; i < n; i++)\n a[i] = nextInt();\n return a;\n }\n\n public long[] nextLongArray(int n) {\n long[] a = new long[n];\n for (int i = 0; i < n; i++)\n a[i] = nextLong();\n return a;\n }\n }",
"FastReader",
"BufferedReader br;",
"br",
"StringTokenizer st;",
"st",
"FastReader(InputStream inputStream) {\n br = new BufferedReader(new\n InputStreamReader(inputStream));\n }",
"FastReader",
"{\n br = new BufferedReader(new\n InputStreamReader(inputStream));\n }",
"br = new BufferedReader(new\n InputStreamReader(inputStream))",
"br",
"new BufferedReader(new\n InputStreamReader(inputStream))",
"InputStream inputStream",
"inputStream",
"String next() {\n while (st == null || !st.hasMoreElements()) {\n try {\n st = new StringTokenizer(br.readLine());\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n return st.nextToken();\n }",
"next",
"{\n while (st == null || !st.hasMoreElements()) {\n try {\n st = new StringTokenizer(br.readLine());\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n return st.nextToken();\n }",
"while (st == null || !st.hasMoreElements()) {\n try {\n st = new StringTokenizer(br.readLine());\n } catch (IOException e) {\n e.printStackTrace();\n }\n }",
"st == null || !st.hasMoreElements()",
"st == null",
"st",
"null",
"!st.hasMoreElements()",
"st.hasMoreElements()",
"st.hasMoreElements",
"st",
"{\n try {\n st = new StringTokenizer(br.readLine());\n } catch (IOException e) {\n e.printStackTrace();\n }\n }",
"try {\n st = new StringTokenizer(br.readLine());\n } catch (IOException e) {\n e.printStackTrace();\n }",
"catch (IOException e) {\n e.printStackTrace();\n }",
"IOException e",
"{\n e.printStackTrace();\n }",
"e.printStackTrace()",
"e.printStackTrace",
"e",
"{\n st = new StringTokenizer(br.readLine());\n }",
"st = new StringTokenizer(br.readLine())",
"st",
"new StringTokenizer(br.readLine())",
"return st.nextToken();",
"st.nextToken()",
"st.nextToken",
"st",
"int nextInt() {\n return Integer.parseInt(next());\n }",
"nextInt",
"{\n return Integer.parseInt(next());\n }",
"return Integer.parseInt(next());",
"Integer.parseInt(next())",
"Integer.parseInt",
"Integer",
"next()",
"next",
"long nextLong() {\n return Long.parseLong(next());\n }",
"nextLong",
"{\n return Long.parseLong(next());\n }",
"return Long.parseLong(next());",
"Long.parseLong(next())",
"Long.parseLong",
"Long",
"next()",
"next",
"double nextDouble() {\n return Double.parseDouble(next());\n }",
"nextDouble",
"{\n return Double.parseDouble(next());\n }",
"return Double.parseDouble(next());",
"Double.parseDouble(next())",
"Double.parseDouble",
"Double",
"next()",
"next",
"String nextLine() {\n String str = \"\";\n try {\n str = br.readLine();\n } catch (IOException e) {\n e.printStackTrace();\n }\n return str;\n }",
"nextLine",
"{\n String str = \"\";\n try {\n str = br.readLine();\n } catch (IOException e) {\n e.printStackTrace();\n }\n return str;\n }",
"String str = \"\";",
"str",
"\"\"",
"try {\n str = br.readLine();\n } catch (IOException e) {\n e.printStackTrace();\n }",
"catch (IOException e) {\n e.printStackTrace();\n }",
"IOException e",
"{\n e.printStackTrace();\n }",
"e.printStackTrace()",
"e.printStackTrace",
"e",
"{\n str = br.readLine();\n }",
"str = br.readLine()",
"str",
"br.readLine()",
"br.readLine",
"br",
"return str;",
"str",
"// https://qiita.com/masakinpo/items/5f77f2a879578a85a0bb\n public int[] nextIntArray(int n) {\n int[] a = new int[n];\n for (int i = 0; i < n; i++)\n a[i] = nextInt();\n return a;\n }",
"nextIntArray",
"{\n int[] a = new int[n];\n for (int i = 0; i < n; i++)\n a[i] = nextInt();\n return a;\n }",
"int[] a = new int[n];",
"a",
"new int[n]",
"n",
"for (int i = 0; i < n; i++)\n a[i] = nextInt();",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < n",
"i",
"n",
"i++",
"i++",
"i",
"a[i] = nextInt();",
"a[i] = nextInt()",
"a[i]",
"a",
"i",
"nextInt()",
"nextInt",
"return a;",
"a",
"int n",
"n",
"public long[] nextLongArray(int n) {\n long[] a = new long[n];\n for (int i = 0; i < n; i++)\n a[i] = nextLong();\n return a;\n }",
"nextLongArray",
"{\n long[] a = new long[n];\n for (int i = 0; i < n; i++)\n a[i] = nextLong();\n return a;\n }",
"long[] a = new long[n];",
"a",
"new long[n]",
"n",
"for (int i = 0; i < n; i++)\n a[i] = nextLong();",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < n",
"i",
"n",
"i++",
"i++",
"i",
"a[i] = nextLong();",
"a[i] = nextLong()",
"a[i]",
"a",
"i",
"nextLong()",
"nextLong",
"return a;",
"a",
"int n",
"n",
"public class Main {\n\n private static FastReader in = new FastReader(System.in);\n private static PrintWriter out = new PrintWriter(System.out);\n\n private static final long MOD = (long) 1e9 + 7;\n\n public static void main(String[] args) {\n solve();\n out.flush();\n }\n\n private static void solve() {\n int n = in.nextInt();\n long ans = 0;\n for (int i = 1; i <= n; i++) {\n for (int j = 1; j <= n; j++) {\n for (int k = 1; k <= n; k++) {\n ans += gcd(i, j, k);\n }\n }\n }\n out.println(ans);\n }\n\n static long gcd(long... a) {\n if (a.length == 0) return 1;\n long ret = a[0];\n for (int i = 1; i < a.length; i++) {\n ret = gcd(ret, a[i]);\n }\n return ret;\n }\n\n static long gcd(long a, long b) {\n if (b == 0) {\n return a;\n }\n return gcd(b, a % b);\n }\n\n // https://www.geeksforgeeks.org/fast-io-in-java-in-competitive-programming/\n static class FastReader {\n BufferedReader br;\n StringTokenizer st;\n\n FastReader(InputStream inputStream) {\n br = new BufferedReader(new\n InputStreamReader(inputStream));\n }\n\n String next() {\n while (st == null || !st.hasMoreElements()) {\n try {\n st = new StringTokenizer(br.readLine());\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n return st.nextToken();\n }\n\n int nextInt() {\n return Integer.parseInt(next());\n }\n\n long nextLong() {\n return Long.parseLong(next());\n }\n\n double nextDouble() {\n return Double.parseDouble(next());\n }\n\n String nextLine() {\n String str = \"\";\n try {\n str = br.readLine();\n } catch (IOException e) {\n e.printStackTrace();\n }\n return str;\n }\n\n // https://qiita.com/masakinpo/items/5f77f2a879578a85a0bb\n public int[] nextIntArray(int n) {\n int[] a = new int[n];\n for (int i = 0; i < n; i++)\n a[i] = nextInt();\n return a;\n }\n\n public long[] nextLongArray(int n) {\n long[] a = new long[n];\n for (int i = 0; i < n; i++)\n a[i] = nextLong();\n return a;\n }\n }\n}",
"public class Main {\n\n private static FastReader in = new FastReader(System.in);\n private static PrintWriter out = new PrintWriter(System.out);\n\n private static final long MOD = (long) 1e9 + 7;\n\n public static void main(String[] args) {\n solve();\n out.flush();\n }\n\n private static void solve() {\n int n = in.nextInt();\n long ans = 0;\n for (int i = 1; i <= n; i++) {\n for (int j = 1; j <= n; j++) {\n for (int k = 1; k <= n; k++) {\n ans += gcd(i, j, k);\n }\n }\n }\n out.println(ans);\n }\n\n static long gcd(long... a) {\n if (a.length == 0) return 1;\n long ret = a[0];\n for (int i = 1; i < a.length; i++) {\n ret = gcd(ret, a[i]);\n }\n return ret;\n }\n\n static long gcd(long a, long b) {\n if (b == 0) {\n return a;\n }\n return gcd(b, a % b);\n }\n\n // https://www.geeksforgeeks.org/fast-io-in-java-in-competitive-programming/\n static class FastReader {\n BufferedReader br;\n StringTokenizer st;\n\n FastReader(InputStream inputStream) {\n br = new BufferedReader(new\n InputStreamReader(inputStream));\n }\n\n String next() {\n while (st == null || !st.hasMoreElements()) {\n try {\n st = new StringTokenizer(br.readLine());\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n return st.nextToken();\n }\n\n int nextInt() {\n return Integer.parseInt(next());\n }\n\n long nextLong() {\n return Long.parseLong(next());\n }\n\n double nextDouble() {\n return Double.parseDouble(next());\n }\n\n String nextLine() {\n String str = \"\";\n try {\n str = br.readLine();\n } catch (IOException e) {\n e.printStackTrace();\n }\n return str;\n }\n\n // https://qiita.com/masakinpo/items/5f77f2a879578a85a0bb\n public int[] nextIntArray(int n) {\n int[] a = new int[n];\n for (int i = 0; i < n; i++)\n a[i] = nextInt();\n return a;\n }\n\n public long[] nextLongArray(int n) {\n long[] a = new long[n];\n for (int i = 0; i < n; i++)\n a[i] = nextLong();\n return a;\n }\n }\n}",
"Main"
] |
import java.awt.*;
import java.io.*;
import java.util.*;
public class Main {
private static FastReader in = new FastReader(System.in);
private static PrintWriter out = new PrintWriter(System.out);
private static final long MOD = (long) 1e9 + 7;
public static void main(String[] args) {
solve();
out.flush();
}
private static void solve() {
int n = in.nextInt();
long ans = 0;
for (int i = 1; i <= n; i++) {
for (int j = 1; j <= n; j++) {
for (int k = 1; k <= n; k++) {
ans += gcd(i, j, k);
}
}
}
out.println(ans);
}
static long gcd(long... a) {
if (a.length == 0) return 1;
long ret = a[0];
for (int i = 1; i < a.length; i++) {
ret = gcd(ret, a[i]);
}
return ret;
}
static long gcd(long a, long b) {
if (b == 0) {
return a;
}
return gcd(b, a % b);
}
// https://www.geeksforgeeks.org/fast-io-in-java-in-competitive-programming/
static class FastReader {
BufferedReader br;
StringTokenizer st;
FastReader(InputStream inputStream) {
br = new BufferedReader(new
InputStreamReader(inputStream));
}
String next() {
while (st == null || !st.hasMoreElements()) {
try {
st = new StringTokenizer(br.readLine());
} catch (IOException e) {
e.printStackTrace();
}
}
return st.nextToken();
}
int nextInt() {
return Integer.parseInt(next());
}
long nextLong() {
return Long.parseLong(next());
}
double nextDouble() {
return Double.parseDouble(next());
}
String nextLine() {
String str = "";
try {
str = br.readLine();
} catch (IOException e) {
e.printStackTrace();
}
return str;
}
// https://qiita.com/masakinpo/items/5f77f2a879578a85a0bb
public int[] nextIntArray(int n) {
int[] a = new int[n];
for (int i = 0; i < n; i++)
a[i] = nextInt();
return a;
}
public long[] nextLongArray(int n) {
long[] a = new long[n];
for (int i = 0; i < n; i++)
a[i] = nextLong();
return a;
}
}
}
|
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
2,
13,
17,
1,
40,
13,
30,
30,
11,
1,
41,
13,
17,
2,
13,
2,
13,
17,
1,
40,
13,
30,
30,
11,
1,
41,
13,
17,
2,
13,
2,
13,
17,
1,
40,
13,
30,
30,
0,
13,
4,
13,
4,
13,
13,
13,
13,
4,
18,
18,
13,
13,
13,
23,
13,
12,
13,
30,
41,
13,
42,
17,
30,
14,
2,
13,
17,
30,
0,
13,
17,
3,
0,
13,
2,
13,
13,
0,
13,
13,
0,
13,
13,
14,
2,
13,
17,
30,
3,
29,
13,
23,
13,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
123,
5
],
[
123,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
8,
17
],
[
17,
18
],
[
17,
19
],
[
8,
20
],
[
20,
21
],
[
21,
22
],
[
22,
23
],
[
22,
24
],
[
20,
25
],
[
25,
26
],
[
25,
27
],
[
27,
28
],
[
27,
29
],
[
20,
30
],
[
30,
31
],
[
31,
32
],
[
20,
33
],
[
34,
34
],
[
34,
35
],
[
35,
36
],
[
36,
37
],
[
37,
38
],
[
37,
39
],
[
35,
40
],
[
40,
41
],
[
40,
42
],
[
42,
43
],
[
42,
44
],
[
35,
45
],
[
45,
46
],
[
46,
47
],
[
35,
48
],
[
49,
49
],
[
49,
50
],
[
50,
51
],
[
51,
52
],
[
52,
53
],
[
52,
54
],
[
50,
55
],
[
55,
56
],
[
55,
57
],
[
57,
58
],
[
57,
59
],
[
50,
60
],
[
60,
61
],
[
61,
62
],
[
50,
63
],
[
64,
64
],
[
64,
65
],
[
65,
66
],
[
65,
67
],
[
67,
68
],
[
67,
69
],
[
69,
70
],
[
69,
71
],
[
69,
72
],
[
67,
73
],
[
8,
74
],
[
74,
75
],
[
75,
76
],
[
76,
77
],
[
76,
78
],
[
74,
79
],
[
6,
80
],
[
80,
81
],
[
123,
82
],
[
82,
83
],
[
82,
84
],
[
84,
85
],
[
85,
86
],
[
84,
87
],
[
87,
88
],
[
87,
89
],
[
89,
90
],
[
90,
91
],
[
91,
92
],
[
91,
93
],
[
90,
94
],
[
94,
95
],
[
95,
96
],
[
95,
97
],
[
94,
98
],
[
89,
99
],
[
99,
100
],
[
99,
101
],
[
101,
102
],
[
101,
103
],
[
89,
104
],
[
104,
105
],
[
104,
106
],
[
89,
107
],
[
107,
108
],
[
107,
109
],
[
89,
110
],
[
110,
111
],
[
111,
112
],
[
111,
113
],
[
110,
114
],
[
114,
115
],
[
84,
116
],
[
116,
117
],
[
82,
118
],
[
118,
119
],
[
82,
120
],
[
120,
121
],
[
0,
122
],
[
122,
123
],
[
122,
124
]
] |
[
"import java.util.Scanner;\n\npublic class Main {\n\tpublic static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\t\n\t\tint k = sc.nextInt();\n\t\tlong sum = 0;\n\t\tfor(int i = 1; i < k+1; i++) {\n\t\t\tfor (int m = 1; m < k+1; m++) {\n\t\t\t\tfor(int l = 1; l <k+1; l++) {\n\t\t\t\t\tsum +=yu(yu(i,m),l);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(sum);\n\t\t\n\t}\n\tstatic int yu(int a, int b) {\n\t\tint c;\n\t\twhile(true) {\n\t\t\tif(b==0) {\n\t\t\t\ta =0;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tc = a%b;\n\t\t\ta = b;\n\t\t\tb = c;\n\t\t\tif(c == 0) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t\n\t\t\n\t\t}\n\t\treturn a;\n\t}\n\t\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n\tpublic static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\t\n\t\tint k = sc.nextInt();\n\t\tlong sum = 0;\n\t\tfor(int i = 1; i < k+1; i++) {\n\t\t\tfor (int m = 1; m < k+1; m++) {\n\t\t\t\tfor(int l = 1; l <k+1; l++) {\n\t\t\t\t\tsum +=yu(yu(i,m),l);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(sum);\n\t\t\n\t}\n\tstatic int yu(int a, int b) {\n\t\tint c;\n\t\twhile(true) {\n\t\t\tif(b==0) {\n\t\t\t\ta =0;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tc = a%b;\n\t\t\ta = b;\n\t\t\tb = c;\n\t\t\tif(c == 0) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t\n\t\t\n\t\t}\n\t\treturn a;\n\t}\n\t\n}",
"Main",
"public static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\t\n\t\tint k = sc.nextInt();\n\t\tlong sum = 0;\n\t\tfor(int i = 1; i < k+1; i++) {\n\t\t\tfor (int m = 1; m < k+1; m++) {\n\t\t\t\tfor(int l = 1; l <k+1; l++) {\n\t\t\t\t\tsum +=yu(yu(i,m),l);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(sum);\n\t\t\n\t}",
"main",
"{\n\t\tScanner sc = new Scanner(System.in);\n\t\t\n\t\tint k = sc.nextInt();\n\t\tlong sum = 0;\n\t\tfor(int i = 1; i < k+1; i++) {\n\t\t\tfor (int m = 1; m < k+1; m++) {\n\t\t\t\tfor(int l = 1; l <k+1; l++) {\n\t\t\t\t\tsum +=yu(yu(i,m),l);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(sum);\n\t\t\n\t}",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"int k = sc.nextInt();",
"k",
"sc.nextInt()",
"sc.nextInt",
"sc",
"long sum = 0;",
"sum",
"0",
"for(int i = 1; i < k+1; i++) {\n\t\t\tfor (int m = 1; m < k+1; m++) {\n\t\t\t\tfor(int l = 1; l <k+1; l++) {\n\t\t\t\t\tsum +=yu(yu(i,m),l);\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"int i = 1;",
"int i = 1;",
"i",
"1",
"i < k+1",
"i",
"k+1",
"k",
"1",
"i++",
"i++",
"i",
"{\n\t\t\tfor (int m = 1; m < k+1; m++) {\n\t\t\t\tfor(int l = 1; l <k+1; l++) {\n\t\t\t\t\tsum +=yu(yu(i,m),l);\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"{\n\t\t\tfor (int m = 1; m < k+1; m++) {\n\t\t\t\tfor(int l = 1; l <k+1; l++) {\n\t\t\t\t\tsum +=yu(yu(i,m),l);\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"for (int m = 1; m < k+1; m++) {\n\t\t\t\tfor(int l = 1; l <k+1; l++) {\n\t\t\t\t\tsum +=yu(yu(i,m),l);\n\t\t\t\t}\n\t\t\t}",
"int m = 1;",
"int m = 1;",
"m",
"1",
"m < k+1",
"m",
"k+1",
"k",
"1",
"m++",
"m++",
"m",
"{\n\t\t\t\tfor(int l = 1; l <k+1; l++) {\n\t\t\t\t\tsum +=yu(yu(i,m),l);\n\t\t\t\t}\n\t\t\t}",
"{\n\t\t\t\tfor(int l = 1; l <k+1; l++) {\n\t\t\t\t\tsum +=yu(yu(i,m),l);\n\t\t\t\t}\n\t\t\t}",
"for(int l = 1; l <k+1; l++) {\n\t\t\t\t\tsum +=yu(yu(i,m),l);\n\t\t\t\t}",
"int l = 1;",
"int l = 1;",
"l",
"1",
"l <k+1",
"l",
"k+1",
"k",
"1",
"l++",
"l++",
"l",
"{\n\t\t\t\t\tsum +=yu(yu(i,m),l);\n\t\t\t\t}",
"{\n\t\t\t\t\tsum +=yu(yu(i,m),l);\n\t\t\t\t}",
"sum +=yu(yu(i,m),l)",
"sum",
"yu(yu(i,m),l)",
"yu",
"yu(i,m)",
"yu",
"i",
"m",
"l",
"System.out.println(sum)",
"System.out.println",
"System.out",
"System",
"System.out",
"sum",
"String[] args",
"args",
"static int yu(int a, int b) {\n\t\tint c;\n\t\twhile(true) {\n\t\t\tif(b==0) {\n\t\t\t\ta =0;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tc = a%b;\n\t\t\ta = b;\n\t\t\tb = c;\n\t\t\tif(c == 0) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t\n\t\t\n\t\t}\n\t\treturn a;\n\t}",
"yu",
"{\n\t\tint c;\n\t\twhile(true) {\n\t\t\tif(b==0) {\n\t\t\t\ta =0;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tc = a%b;\n\t\t\ta = b;\n\t\t\tb = c;\n\t\t\tif(c == 0) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t\n\t\t\n\t\t}\n\t\treturn a;\n\t}",
"int c;",
"c",
"while(true) {\n\t\t\tif(b==0) {\n\t\t\t\ta =0;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tc = a%b;\n\t\t\ta = b;\n\t\t\tb = c;\n\t\t\tif(c == 0) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t\n\t\t\n\t\t}",
"true",
"{\n\t\t\tif(b==0) {\n\t\t\t\ta =0;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tc = a%b;\n\t\t\ta = b;\n\t\t\tb = c;\n\t\t\tif(c == 0) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t\n\t\t\n\t\t}",
"if(b==0) {\n\t\t\t\ta =0;\n\t\t\t\tbreak;\n\t\t\t}",
"b==0",
"b",
"0",
"{\n\t\t\t\ta =0;\n\t\t\t\tbreak;\n\t\t\t}",
"a =0",
"a",
"0",
"break;",
"c = a%b",
"c",
"a%b",
"a",
"b",
"a = b",
"a",
"b",
"b = c",
"b",
"c",
"if(c == 0) {\n\t\t\t\tbreak;\n\t\t\t}",
"c == 0",
"c",
"0",
"{\n\t\t\t\tbreak;\n\t\t\t}",
"break;",
"return a;",
"a",
"int a",
"a",
"int b",
"b",
"public class Main {\n\tpublic static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\t\n\t\tint k = sc.nextInt();\n\t\tlong sum = 0;\n\t\tfor(int i = 1; i < k+1; i++) {\n\t\t\tfor (int m = 1; m < k+1; m++) {\n\t\t\t\tfor(int l = 1; l <k+1; l++) {\n\t\t\t\t\tsum +=yu(yu(i,m),l);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(sum);\n\t\t\n\t}\n\tstatic int yu(int a, int b) {\n\t\tint c;\n\t\twhile(true) {\n\t\t\tif(b==0) {\n\t\t\t\ta =0;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tc = a%b;\n\t\t\ta = b;\n\t\t\tb = c;\n\t\t\tif(c == 0) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t\n\t\t\n\t\t}\n\t\treturn a;\n\t}\n\t\n}",
"public class Main {\n\tpublic static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\t\n\t\tint k = sc.nextInt();\n\t\tlong sum = 0;\n\t\tfor(int i = 1; i < k+1; i++) {\n\t\t\tfor (int m = 1; m < k+1; m++) {\n\t\t\t\tfor(int l = 1; l <k+1; l++) {\n\t\t\t\t\tsum +=yu(yu(i,m),l);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(sum);\n\t\t\n\t}\n\tstatic int yu(int a, int b) {\n\t\tint c;\n\t\twhile(true) {\n\t\t\tif(b==0) {\n\t\t\t\ta =0;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tc = a%b;\n\t\t\ta = b;\n\t\t\tb = c;\n\t\t\tif(c == 0) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t\n\t\t\n\t\t}\n\t\treturn a;\n\t}\n\t\n}",
"Main"
] |
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int k = sc.nextInt();
long sum = 0;
for(int i = 1; i < k+1; i++) {
for (int m = 1; m < k+1; m++) {
for(int l = 1; l <k+1; l++) {
sum +=yu(yu(i,m),l);
}
}
}
System.out.println(sum);
}
static int yu(int a, int b) {
int c;
while(true) {
if(b==0) {
a =0;
break;
}
c = a%b;
a = b;
b = c;
if(c == 0) {
break;
}
}
return a;
}
}
|
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
41,
13,
4,
13,
13,
13,
0,
13,
4,
13,
13,
13,
4,
18,
18,
13,
13,
13,
4,
18,
13,
23,
13,
12,
13,
30,
42,
2,
13,
17,
30,
41,
13,
2,
13,
13,
0,
13,
13,
0,
13,
13,
29,
13,
23,
13,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
108,
5
],
[
108,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
8,
17
],
[
17,
18
],
[
17,
19
],
[
8,
20
],
[
20,
21
],
[
21,
22
],
[
22,
23
],
[
22,
24
],
[
20,
25
],
[
25,
26
],
[
25,
27
],
[
20,
28
],
[
28,
29
],
[
29,
30
],
[
20,
31
],
[
32,
32
],
[
32,
33
],
[
33,
34
],
[
34,
35
],
[
35,
36
],
[
35,
37
],
[
33,
38
],
[
38,
39
],
[
38,
40
],
[
33,
41
],
[
41,
42
],
[
42,
43
],
[
33,
44
],
[
45,
45
],
[
45,
46
],
[
46,
47
],
[
47,
48
],
[
48,
49
],
[
48,
50
],
[
46,
51
],
[
51,
52
],
[
51,
53
],
[
46,
54
],
[
54,
55
],
[
55,
56
],
[
46,
57
],
[
58,
58
],
[
58,
59
],
[
59,
60
],
[
59,
61
],
[
61,
62
],
[
61,
63
],
[
61,
64
],
[
58,
65
],
[
65,
66
],
[
65,
67
],
[
67,
68
],
[
67,
69
],
[
67,
70
],
[
8,
71
],
[
71,
72
],
[
72,
73
],
[
73,
74
],
[
73,
75
],
[
71,
76
],
[
8,
77
],
[
77,
78
],
[
78,
79
],
[
6,
80
],
[
80,
81
],
[
108,
82
],
[
82,
83
],
[
82,
84
],
[
84,
85
],
[
85,
86
],
[
86,
87
],
[
86,
88
],
[
85,
89
],
[
89,
90
],
[
90,
91
],
[
90,
92
],
[
92,
93
],
[
92,
94
],
[
89,
95
],
[
95,
96
],
[
95,
97
],
[
89,
98
],
[
98,
99
],
[
98,
100
],
[
84,
101
],
[
101,
102
],
[
82,
103
],
[
103,
104
],
[
82,
105
],
[
105,
106
],
[
0,
107
],
[
107,
108
],
[
107,
109
]
] |
[
"import java.util.Scanner;\n\n\npublic class Main {\n\n\tpublic static void main(String[] args) {\n\n\t\tScanner sc = new Scanner(System.in);\n\t\tint k = sc.nextInt();\n\t\tlong ans = 0;\n\n\t\tfor(int i = 1; i <= k; i++) {\n\t\t\tfor(int j = 1; j <= k; j++) {\n\t\t\t\tfor(int a = 1; a <= k; a++) {\n\t\t\t\t\tint temp = getGcd(i, j);\n\t\t\t\t\tans += getGcd(a, temp);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tSystem.out.println(ans);\n\t\tsc.close();\n\t}\n\n\tprivate static int getGcd(int p, int q){\n\t\twhile(q != 0){\n\t\t\tint r = p % q;\n\t\t\tp = q;\n\t\t\tq = r;\n\t\t}\n\t\treturn p;\n\t}\n\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n\n\tpublic static void main(String[] args) {\n\n\t\tScanner sc = new Scanner(System.in);\n\t\tint k = sc.nextInt();\n\t\tlong ans = 0;\n\n\t\tfor(int i = 1; i <= k; i++) {\n\t\t\tfor(int j = 1; j <= k; j++) {\n\t\t\t\tfor(int a = 1; a <= k; a++) {\n\t\t\t\t\tint temp = getGcd(i, j);\n\t\t\t\t\tans += getGcd(a, temp);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tSystem.out.println(ans);\n\t\tsc.close();\n\t}\n\n\tprivate static int getGcd(int p, int q){\n\t\twhile(q != 0){\n\t\t\tint r = p % q;\n\t\t\tp = q;\n\t\t\tq = r;\n\t\t}\n\t\treturn p;\n\t}\n\n}",
"Main",
"public static void main(String[] args) {\n\n\t\tScanner sc = new Scanner(System.in);\n\t\tint k = sc.nextInt();\n\t\tlong ans = 0;\n\n\t\tfor(int i = 1; i <= k; i++) {\n\t\t\tfor(int j = 1; j <= k; j++) {\n\t\t\t\tfor(int a = 1; a <= k; a++) {\n\t\t\t\t\tint temp = getGcd(i, j);\n\t\t\t\t\tans += getGcd(a, temp);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tSystem.out.println(ans);\n\t\tsc.close();\n\t}",
"main",
"{\n\n\t\tScanner sc = new Scanner(System.in);\n\t\tint k = sc.nextInt();\n\t\tlong ans = 0;\n\n\t\tfor(int i = 1; i <= k; i++) {\n\t\t\tfor(int j = 1; j <= k; j++) {\n\t\t\t\tfor(int a = 1; a <= k; a++) {\n\t\t\t\t\tint temp = getGcd(i, j);\n\t\t\t\t\tans += getGcd(a, temp);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tSystem.out.println(ans);\n\t\tsc.close();\n\t}",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"int k = sc.nextInt();",
"k",
"sc.nextInt()",
"sc.nextInt",
"sc",
"long ans = 0;",
"ans",
"0",
"for(int i = 1; i <= k; i++) {\n\t\t\tfor(int j = 1; j <= k; j++) {\n\t\t\t\tfor(int a = 1; a <= k; a++) {\n\t\t\t\t\tint temp = getGcd(i, j);\n\t\t\t\t\tans += getGcd(a, temp);\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"int i = 1;",
"int i = 1;",
"i",
"1",
"i <= k",
"i",
"k",
"i++",
"i++",
"i",
"{\n\t\t\tfor(int j = 1; j <= k; j++) {\n\t\t\t\tfor(int a = 1; a <= k; a++) {\n\t\t\t\t\tint temp = getGcd(i, j);\n\t\t\t\t\tans += getGcd(a, temp);\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"{\n\t\t\tfor(int j = 1; j <= k; j++) {\n\t\t\t\tfor(int a = 1; a <= k; a++) {\n\t\t\t\t\tint temp = getGcd(i, j);\n\t\t\t\t\tans += getGcd(a, temp);\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"for(int j = 1; j <= k; j++) {\n\t\t\t\tfor(int a = 1; a <= k; a++) {\n\t\t\t\t\tint temp = getGcd(i, j);\n\t\t\t\t\tans += getGcd(a, temp);\n\t\t\t\t}\n\t\t\t}",
"int j = 1;",
"int j = 1;",
"j",
"1",
"j <= k",
"j",
"k",
"j++",
"j++",
"j",
"{\n\t\t\t\tfor(int a = 1; a <= k; a++) {\n\t\t\t\t\tint temp = getGcd(i, j);\n\t\t\t\t\tans += getGcd(a, temp);\n\t\t\t\t}\n\t\t\t}",
"{\n\t\t\t\tfor(int a = 1; a <= k; a++) {\n\t\t\t\t\tint temp = getGcd(i, j);\n\t\t\t\t\tans += getGcd(a, temp);\n\t\t\t\t}\n\t\t\t}",
"for(int a = 1; a <= k; a++) {\n\t\t\t\t\tint temp = getGcd(i, j);\n\t\t\t\t\tans += getGcd(a, temp);\n\t\t\t\t}",
"int a = 1;",
"int a = 1;",
"a",
"1",
"a <= k",
"a",
"k",
"a++",
"a++",
"a",
"{\n\t\t\t\t\tint temp = getGcd(i, j);\n\t\t\t\t\tans += getGcd(a, temp);\n\t\t\t\t}",
"{\n\t\t\t\t\tint temp = getGcd(i, j);\n\t\t\t\t\tans += getGcd(a, temp);\n\t\t\t\t}",
"int temp = getGcd(i, j);",
"temp",
"getGcd(i, j)",
"getGcd",
"i",
"j",
"ans += getGcd(a, temp)",
"ans",
"getGcd(a, temp)",
"getGcd",
"a",
"temp",
"System.out.println(ans)",
"System.out.println",
"System.out",
"System",
"System.out",
"ans",
"sc.close()",
"sc.close",
"sc",
"String[] args",
"args",
"private static int getGcd(int p, int q){\n\t\twhile(q != 0){\n\t\t\tint r = p % q;\n\t\t\tp = q;\n\t\t\tq = r;\n\t\t}\n\t\treturn p;\n\t}",
"getGcd",
"{\n\t\twhile(q != 0){\n\t\t\tint r = p % q;\n\t\t\tp = q;\n\t\t\tq = r;\n\t\t}\n\t\treturn p;\n\t}",
"while(q != 0){\n\t\t\tint r = p % q;\n\t\t\tp = q;\n\t\t\tq = r;\n\t\t}",
"q != 0",
"q",
"0",
"{\n\t\t\tint r = p % q;\n\t\t\tp = q;\n\t\t\tq = r;\n\t\t}",
"int r = p % q;",
"r",
"p % q",
"p",
"q",
"p = q",
"p",
"q",
"q = r",
"q",
"r",
"return p;",
"p",
"int p",
"p",
"int q",
"q",
"public class Main {\n\n\tpublic static void main(String[] args) {\n\n\t\tScanner sc = new Scanner(System.in);\n\t\tint k = sc.nextInt();\n\t\tlong ans = 0;\n\n\t\tfor(int i = 1; i <= k; i++) {\n\t\t\tfor(int j = 1; j <= k; j++) {\n\t\t\t\tfor(int a = 1; a <= k; a++) {\n\t\t\t\t\tint temp = getGcd(i, j);\n\t\t\t\t\tans += getGcd(a, temp);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tSystem.out.println(ans);\n\t\tsc.close();\n\t}\n\n\tprivate static int getGcd(int p, int q){\n\t\twhile(q != 0){\n\t\t\tint r = p % q;\n\t\t\tp = q;\n\t\t\tq = r;\n\t\t}\n\t\treturn p;\n\t}\n\n}",
"public class Main {\n\n\tpublic static void main(String[] args) {\n\n\t\tScanner sc = new Scanner(System.in);\n\t\tint k = sc.nextInt();\n\t\tlong ans = 0;\n\n\t\tfor(int i = 1; i <= k; i++) {\n\t\t\tfor(int j = 1; j <= k; j++) {\n\t\t\t\tfor(int a = 1; a <= k; a++) {\n\t\t\t\t\tint temp = getGcd(i, j);\n\t\t\t\t\tans += getGcd(a, temp);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tSystem.out.println(ans);\n\t\tsc.close();\n\t}\n\n\tprivate static int getGcd(int p, int q){\n\t\twhile(q != 0){\n\t\t\tint r = p % q;\n\t\t\tp = q;\n\t\t\tq = r;\n\t\t}\n\t\treturn p;\n\t}\n\n}",
"Main"
] |
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int k = sc.nextInt();
long ans = 0;
for(int i = 1; i <= k; i++) {
for(int j = 1; j <= k; j++) {
for(int a = 1; a <= k; a++) {
int temp = getGcd(i, j);
ans += getGcd(a, temp);
}
}
}
System.out.println(ans);
sc.close();
}
private static int getGcd(int p, int q){
while(q != 0){
int r = p % q;
p = q;
q = r;
}
return p;
}
}
|
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
41,
13,
41,
13,
41,
13,
0,
13,
4,
18,
13,
13,
0,
13,
4,
18,
13,
13,
0,
13,
4,
18,
13,
13,
0,
13,
4,
18,
13,
13,
0,
13,
4,
18,
13,
13,
29,
4,
18,
13,
23,
13,
23,
13,
23,
13,
12,
13,
30,
41,
13,
17,
41,
13,
20,
41,
13,
4,
18,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
4,
18,
13,
4,
13,
13,
13,
13,
4,
18,
18,
13,
13,
13,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
10,
11
],
[
10,
12
],
[
0,
13
],
[
138,
14
],
[
138,
15
],
[
15,
16
],
[
15,
17
],
[
17,
18
],
[
18,
19
],
[
17,
20
],
[
20,
21
],
[
17,
22
],
[
22,
23
],
[
17,
24
],
[
24,
25
],
[
17,
26
],
[
26,
27
],
[
26,
28
],
[
28,
29
],
[
29,
30
],
[
28,
31
],
[
17,
32
],
[
32,
33
],
[
32,
34
],
[
34,
35
],
[
35,
36
],
[
34,
37
],
[
17,
38
],
[
38,
39
],
[
38,
40
],
[
40,
41
],
[
41,
42
],
[
40,
43
],
[
17,
44
],
[
44,
45
],
[
44,
46
],
[
46,
47
],
[
47,
48
],
[
46,
49
],
[
17,
50
],
[
50,
51
],
[
50,
52
],
[
52,
53
],
[
53,
54
],
[
52,
55
],
[
17,
56
],
[
56,
57
],
[
57,
58
],
[
58,
59
],
[
15,
60
],
[
60,
61
],
[
15,
62
],
[
62,
63
],
[
15,
64
],
[
64,
65
],
[
138,
66
],
[
66,
67
],
[
66,
68
],
[
68,
69
],
[
69,
70
],
[
69,
71
],
[
68,
72
],
[
72,
73
],
[
72,
74
],
[
68,
75
],
[
75,
76
],
[
75,
77
],
[
77,
78
],
[
78,
79
],
[
68,
80
],
[
80,
81
],
[
81,
82
],
[
82,
83
],
[
82,
84
],
[
80,
85
],
[
85,
86
],
[
85,
87
],
[
80,
88
],
[
88,
89
],
[
89,
90
],
[
80,
91
],
[
92,
92
],
[
92,
93
],
[
93,
94
],
[
94,
95
],
[
95,
96
],
[
95,
97
],
[
93,
98
],
[
98,
99
],
[
98,
100
],
[
93,
101
],
[
101,
102
],
[
102,
103
],
[
93,
104
],
[
105,
105
],
[
105,
106
],
[
106,
107
],
[
107,
108
],
[
108,
109
],
[
108,
110
],
[
106,
111
],
[
111,
112
],
[
111,
113
],
[
106,
114
],
[
114,
115
],
[
115,
116
],
[
106,
117
],
[
118,
118
],
[
118,
119
],
[
119,
120
],
[
119,
121
],
[
121,
122
],
[
122,
123
],
[
121,
124
],
[
124,
125
],
[
124,
126
],
[
124,
127
],
[
124,
128
],
[
68,
129
],
[
129,
130
],
[
130,
131
],
[
131,
132
],
[
131,
133
],
[
129,
134
],
[
66,
135
],
[
135,
136
],
[
0,
137
],
[
137,
138
],
[
137,
139
]
] |
[
"/* package codechef; // don't place package name! */\n\nimport java.util.*;\nimport java.lang.*;\nimport java.io.*;\nimport java.math.*;\n\n/* Name of the class has to be \"Main\" only if the class is public. */\npublic class Main\n{\n \n public static int printgcd(int i,int j,int k){\n BigInteger b1,b2,b3,b4;\n b1 = BigInteger.valueOf(i);\n b2 = BigInteger.valueOf(j);\n b3 = BigInteger.valueOf(k);\n b4=b1.gcd(b2);\n b4=b4.gcd(b3);\n return b4.intValue();\n \n }\n\tpublic static void main (String[] args) throws java.lang.Exception\n\t{\n\t long sum = 0;\n\t\tScanner input = new Scanner(System.in);\n\t\tint n = input.nextInt();\n\t\tfor(int i=1;i<=n;i++){\n\t\t \tfor(int j=1;j<=n;j++){\n\t\t \t \tfor(int k=1;k<=n;k++){\n\t\t \t \t sum+=Long.valueOf(printgcd(i,j,k)); \n\t\t \t \t}\n\t\t \t}\n\t\t}\n\t\tSystem.out.println(sum);\n\t\t\n\t\t\n\t}\n\t\n\t\n}",
"import java.util.*;",
"util.*",
"java",
"import java.lang.*;",
"lang.*",
"java",
"import java.io.*;",
"io.*",
"java",
"import java.math.*;",
"math.*",
"java",
"public class Main\n{\n \n public static int printgcd(int i,int j,int k){\n BigInteger b1,b2,b3,b4;\n b1 = BigInteger.valueOf(i);\n b2 = BigInteger.valueOf(j);\n b3 = BigInteger.valueOf(k);\n b4=b1.gcd(b2);\n b4=b4.gcd(b3);\n return b4.intValue();\n \n }\n\tpublic static void main (String[] args) throws java.lang.Exception\n\t{\n\t long sum = 0;\n\t\tScanner input = new Scanner(System.in);\n\t\tint n = input.nextInt();\n\t\tfor(int i=1;i<=n;i++){\n\t\t \tfor(int j=1;j<=n;j++){\n\t\t \t \tfor(int k=1;k<=n;k++){\n\t\t \t \t sum+=Long.valueOf(printgcd(i,j,k)); \n\t\t \t \t}\n\t\t \t}\n\t\t}\n\t\tSystem.out.println(sum);\n\t\t\n\t\t\n\t}\n\t\n\t\n}",
"Main",
"public static int printgcd(int i,int j,int k){\n BigInteger b1,b2,b3,b4;\n b1 = BigInteger.valueOf(i);\n b2 = BigInteger.valueOf(j);\n b3 = BigInteger.valueOf(k);\n b4=b1.gcd(b2);\n b4=b4.gcd(b3);\n return b4.intValue();\n \n }",
"printgcd",
"{\n BigInteger b1,b2,b3,b4;\n b1 = BigInteger.valueOf(i);\n b2 = BigInteger.valueOf(j);\n b3 = BigInteger.valueOf(k);\n b4=b1.gcd(b2);\n b4=b4.gcd(b3);\n return b4.intValue();\n \n }",
"BigInteger b1",
"b1",
"b2",
"b2",
"b3",
"b3",
"b4;",
"b4",
"b1 = BigInteger.valueOf(i)",
"b1",
"BigInteger.valueOf(i)",
"BigInteger.valueOf",
"BigInteger",
"i",
"b2 = BigInteger.valueOf(j)",
"b2",
"BigInteger.valueOf(j)",
"BigInteger.valueOf",
"BigInteger",
"j",
"b3 = BigInteger.valueOf(k)",
"b3",
"BigInteger.valueOf(k)",
"BigInteger.valueOf",
"BigInteger",
"k",
"b4=b1.gcd(b2)",
"b4",
"b1.gcd(b2)",
"b1.gcd",
"b1",
"b2",
"b4=b4.gcd(b3)",
"b4",
"b4.gcd(b3)",
"b4.gcd",
"b4",
"b3",
"return b4.intValue();",
"b4.intValue()",
"b4.intValue",
"b4",
"int i",
"i",
"int j",
"j",
"int k",
"k",
"public static void main (String[] args) throws java.lang.Exception\n\t{\n\t long sum = 0;\n\t\tScanner input = new Scanner(System.in);\n\t\tint n = input.nextInt();\n\t\tfor(int i=1;i<=n;i++){\n\t\t \tfor(int j=1;j<=n;j++){\n\t\t \t \tfor(int k=1;k<=n;k++){\n\t\t \t \t sum+=Long.valueOf(printgcd(i,j,k)); \n\t\t \t \t}\n\t\t \t}\n\t\t}\n\t\tSystem.out.println(sum);\n\t\t\n\t\t\n\t}",
"main",
"{\n\t long sum = 0;\n\t\tScanner input = new Scanner(System.in);\n\t\tint n = input.nextInt();\n\t\tfor(int i=1;i<=n;i++){\n\t\t \tfor(int j=1;j<=n;j++){\n\t\t \t \tfor(int k=1;k<=n;k++){\n\t\t \t \t sum+=Long.valueOf(printgcd(i,j,k)); \n\t\t \t \t}\n\t\t \t}\n\t\t}\n\t\tSystem.out.println(sum);\n\t\t\n\t\t\n\t}",
"long sum = 0;",
"sum",
"0",
"Scanner input = new Scanner(System.in);",
"input",
"new Scanner(System.in)",
"int n = input.nextInt();",
"n",
"input.nextInt()",
"input.nextInt",
"input",
"for(int i=1;i<=n;i++){\n\t\t \tfor(int j=1;j<=n;j++){\n\t\t \t \tfor(int k=1;k<=n;k++){\n\t\t \t \t sum+=Long.valueOf(printgcd(i,j,k)); \n\t\t \t \t}\n\t\t \t}\n\t\t}",
"int i=1;",
"int i=1;",
"i",
"1",
"i<=n",
"i",
"n",
"i++",
"i++",
"i",
"{\n\t\t \tfor(int j=1;j<=n;j++){\n\t\t \t \tfor(int k=1;k<=n;k++){\n\t\t \t \t sum+=Long.valueOf(printgcd(i,j,k)); \n\t\t \t \t}\n\t\t \t}\n\t\t}",
"{\n\t\t \tfor(int j=1;j<=n;j++){\n\t\t \t \tfor(int k=1;k<=n;k++){\n\t\t \t \t sum+=Long.valueOf(printgcd(i,j,k)); \n\t\t \t \t}\n\t\t \t}\n\t\t}",
"for(int j=1;j<=n;j++){\n\t\t \t \tfor(int k=1;k<=n;k++){\n\t\t \t \t sum+=Long.valueOf(printgcd(i,j,k)); \n\t\t \t \t}\n\t\t \t}",
"int j=1;",
"int j=1;",
"j",
"1",
"j<=n",
"j",
"n",
"j++",
"j++",
"j",
"{\n\t\t \t \tfor(int k=1;k<=n;k++){\n\t\t \t \t sum+=Long.valueOf(printgcd(i,j,k)); \n\t\t \t \t}\n\t\t \t}",
"{\n\t\t \t \tfor(int k=1;k<=n;k++){\n\t\t \t \t sum+=Long.valueOf(printgcd(i,j,k)); \n\t\t \t \t}\n\t\t \t}",
"for(int k=1;k<=n;k++){\n\t\t \t \t sum+=Long.valueOf(printgcd(i,j,k)); \n\t\t \t \t}",
"int k=1;",
"int k=1;",
"k",
"1",
"k<=n",
"k",
"n",
"k++",
"k++",
"k",
"{\n\t\t \t \t sum+=Long.valueOf(printgcd(i,j,k)); \n\t\t \t \t}",
"{\n\t\t \t \t sum+=Long.valueOf(printgcd(i,j,k)); \n\t\t \t \t}",
"sum+=Long.valueOf(printgcd(i,j,k))",
"sum",
"Long.valueOf(printgcd(i,j,k))",
"Long.valueOf",
"Long",
"printgcd(i,j,k)",
"printgcd",
"i",
"j",
"k",
"System.out.println(sum)",
"System.out.println",
"System.out",
"System",
"System.out",
"sum",
"String[] args",
"args",
"public class Main\n{\n \n public static int printgcd(int i,int j,int k){\n BigInteger b1,b2,b3,b4;\n b1 = BigInteger.valueOf(i);\n b2 = BigInteger.valueOf(j);\n b3 = BigInteger.valueOf(k);\n b4=b1.gcd(b2);\n b4=b4.gcd(b3);\n return b4.intValue();\n \n }\n\tpublic static void main (String[] args) throws java.lang.Exception\n\t{\n\t long sum = 0;\n\t\tScanner input = new Scanner(System.in);\n\t\tint n = input.nextInt();\n\t\tfor(int i=1;i<=n;i++){\n\t\t \tfor(int j=1;j<=n;j++){\n\t\t \t \tfor(int k=1;k<=n;k++){\n\t\t \t \t sum+=Long.valueOf(printgcd(i,j,k)); \n\t\t \t \t}\n\t\t \t}\n\t\t}\n\t\tSystem.out.println(sum);\n\t\t\n\t\t\n\t}\n\t\n\t\n}",
"public class Main\n{\n \n public static int printgcd(int i,int j,int k){\n BigInteger b1,b2,b3,b4;\n b1 = BigInteger.valueOf(i);\n b2 = BigInteger.valueOf(j);\n b3 = BigInteger.valueOf(k);\n b4=b1.gcd(b2);\n b4=b4.gcd(b3);\n return b4.intValue();\n \n }\n\tpublic static void main (String[] args) throws java.lang.Exception\n\t{\n\t long sum = 0;\n\t\tScanner input = new Scanner(System.in);\n\t\tint n = input.nextInt();\n\t\tfor(int i=1;i<=n;i++){\n\t\t \tfor(int j=1;j<=n;j++){\n\t\t \t \tfor(int k=1;k<=n;k++){\n\t\t \t \t sum+=Long.valueOf(printgcd(i,j,k)); \n\t\t \t \t}\n\t\t \t}\n\t\t}\n\t\tSystem.out.println(sum);\n\t\t\n\t\t\n\t}\n\t\n\t\n}",
"Main"
] |
/* package codechef; // don't place package name! */
import java.util.*;
import java.lang.*;
import java.io.*;
import java.math.*;
/* Name of the class has to be "Main" only if the class is public. */
public class Main
{
public static int printgcd(int i,int j,int k){
BigInteger b1,b2,b3,b4;
b1 = BigInteger.valueOf(i);
b2 = BigInteger.valueOf(j);
b3 = BigInteger.valueOf(k);
b4=b1.gcd(b2);
b4=b4.gcd(b3);
return b4.intValue();
}
public static void main (String[] args) throws java.lang.Exception
{
long sum = 0;
Scanner input = new Scanner(System.in);
int n = input.nextInt();
for(int i=1;i<=n;i++){
for(int j=1;j<=n;j++){
for(int k=1;k<=n;k++){
sum+=Long.valueOf(printgcd(i,j,k));
}
}
}
System.out.println(sum);
}
}
|
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
4,
13,
13,
13,
13,
4,
18,
18,
13,
13,
13,
23,
13,
12,
13,
30,
14,
2,
13,
17,
29,
13,
29,
4,
13,
13,
2,
13,
13,
23,
13,
23,
13,
12,
13,
30,
29,
4,
13,
4,
13,
13,
13,
13,
23,
13,
23,
13,
23,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
8,
17
],
[
17,
18
],
[
17,
19
],
[
8,
20
],
[
20,
21
],
[
21,
22
],
[
22,
23
],
[
22,
24
],
[
20,
25
],
[
25,
26
],
[
25,
27
],
[
20,
28
],
[
28,
29
],
[
29,
30
],
[
20,
31
],
[
32,
32
],
[
32,
33
],
[
33,
34
],
[
34,
35
],
[
35,
36
],
[
35,
37
],
[
33,
38
],
[
38,
39
],
[
38,
40
],
[
33,
41
],
[
41,
42
],
[
42,
43
],
[
33,
44
],
[
45,
45
],
[
45,
46
],
[
46,
47
],
[
47,
48
],
[
48,
49
],
[
48,
50
],
[
46,
51
],
[
51,
52
],
[
51,
53
],
[
46,
54
],
[
54,
55
],
[
55,
56
],
[
46,
57
],
[
58,
58
],
[
58,
59
],
[
59,
60
],
[
59,
61
],
[
61,
62
],
[
61,
63
],
[
61,
64
],
[
61,
65
],
[
8,
66
],
[
66,
67
],
[
67,
68
],
[
68,
69
],
[
68,
70
],
[
66,
71
],
[
6,
72
],
[
72,
73
],
[
4,
74
],
[
74,
75
],
[
74,
76
],
[
76,
77
],
[
77,
78
],
[
78,
79
],
[
78,
80
],
[
77,
81
],
[
81,
82
],
[
76,
83
],
[
83,
84
],
[
84,
85
],
[
84,
86
],
[
84,
87
],
[
87,
88
],
[
87,
89
],
[
74,
90
],
[
90,
91
],
[
74,
92
],
[
92,
93
],
[
4,
94
],
[
94,
95
],
[
94,
96
],
[
96,
97
],
[
97,
98
],
[
98,
99
],
[
98,
100
],
[
100,
101
],
[
100,
102
],
[
100,
103
],
[
98,
104
],
[
94,
105
],
[
105,
106
],
[
94,
107
],
[
107,
108
],
[
94,
109
],
[
109,
110
]
] |
[
"import java.util.Scanner;\n\nclass Main {\n\tpublic static void main(String[] args) {\n\t\tScanner scanner = new Scanner(System.in);\n\t\tint K = scanner.nextInt();\n\n\t\tint sum = 0;\n\t\tfor (int i = 1; i <= K; i++) {\n\t\t\tfor (int j = 1; j <= K; j++) {\n\t\t\t\tfor (int k = 1; k <= K; k++) {\n\t\t\t\t\tsum += gcd(i, j, k);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tSystem.out.println(sum);\n\t}\n\n\tpublic static int gcd(int x, int y) {\n\t\tif (y == 0)\n\t\t\treturn x;\n\n\t\treturn gcd(y, x % y);\n\t}\n\n\tpublic static int gcd(int x, int y, int z) {\n\t\treturn gcd(gcd(x, y), z);\n\t}\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"class Main {\n\tpublic static void main(String[] args) {\n\t\tScanner scanner = new Scanner(System.in);\n\t\tint K = scanner.nextInt();\n\n\t\tint sum = 0;\n\t\tfor (int i = 1; i <= K; i++) {\n\t\t\tfor (int j = 1; j <= K; j++) {\n\t\t\t\tfor (int k = 1; k <= K; k++) {\n\t\t\t\t\tsum += gcd(i, j, k);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tSystem.out.println(sum);\n\t}\n\n\tpublic static int gcd(int x, int y) {\n\t\tif (y == 0)\n\t\t\treturn x;\n\n\t\treturn gcd(y, x % y);\n\t}\n\n\tpublic static int gcd(int x, int y, int z) {\n\t\treturn gcd(gcd(x, y), z);\n\t}\n}",
"Main",
"public static void main(String[] args) {\n\t\tScanner scanner = new Scanner(System.in);\n\t\tint K = scanner.nextInt();\n\n\t\tint sum = 0;\n\t\tfor (int i = 1; i <= K; i++) {\n\t\t\tfor (int j = 1; j <= K; j++) {\n\t\t\t\tfor (int k = 1; k <= K; k++) {\n\t\t\t\t\tsum += gcd(i, j, k);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tSystem.out.println(sum);\n\t}",
"main",
"{\n\t\tScanner scanner = new Scanner(System.in);\n\t\tint K = scanner.nextInt();\n\n\t\tint sum = 0;\n\t\tfor (int i = 1; i <= K; i++) {\n\t\t\tfor (int j = 1; j <= K; j++) {\n\t\t\t\tfor (int k = 1; k <= K; k++) {\n\t\t\t\t\tsum += gcd(i, j, k);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tSystem.out.println(sum);\n\t}",
"Scanner scanner = new Scanner(System.in);",
"scanner",
"new Scanner(System.in)",
"int K = scanner.nextInt();",
"K",
"scanner.nextInt()",
"scanner.nextInt",
"scanner",
"int sum = 0;",
"sum",
"0",
"for (int i = 1; i <= K; i++) {\n\t\t\tfor (int j = 1; j <= K; j++) {\n\t\t\t\tfor (int k = 1; k <= K; k++) {\n\t\t\t\t\tsum += gcd(i, j, k);\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"int i = 1;",
"int i = 1;",
"i",
"1",
"i <= K",
"i",
"K",
"i++",
"i++",
"i",
"{\n\t\t\tfor (int j = 1; j <= K; j++) {\n\t\t\t\tfor (int k = 1; k <= K; k++) {\n\t\t\t\t\tsum += gcd(i, j, k);\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"{\n\t\t\tfor (int j = 1; j <= K; j++) {\n\t\t\t\tfor (int k = 1; k <= K; k++) {\n\t\t\t\t\tsum += gcd(i, j, k);\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"for (int j = 1; j <= K; j++) {\n\t\t\t\tfor (int k = 1; k <= K; k++) {\n\t\t\t\t\tsum += gcd(i, j, k);\n\t\t\t\t}\n\t\t\t}",
"int j = 1;",
"int j = 1;",
"j",
"1",
"j <= K",
"j",
"K",
"j++",
"j++",
"j",
"{\n\t\t\t\tfor (int k = 1; k <= K; k++) {\n\t\t\t\t\tsum += gcd(i, j, k);\n\t\t\t\t}\n\t\t\t}",
"{\n\t\t\t\tfor (int k = 1; k <= K; k++) {\n\t\t\t\t\tsum += gcd(i, j, k);\n\t\t\t\t}\n\t\t\t}",
"for (int k = 1; k <= K; k++) {\n\t\t\t\t\tsum += gcd(i, j, k);\n\t\t\t\t}",
"int k = 1;",
"int k = 1;",
"k",
"1",
"k <= K",
"k",
"K",
"k++",
"k++",
"k",
"{\n\t\t\t\t\tsum += gcd(i, j, k);\n\t\t\t\t}",
"{\n\t\t\t\t\tsum += gcd(i, j, k);\n\t\t\t\t}",
"sum += gcd(i, j, k)",
"sum",
"gcd(i, j, k)",
"gcd",
"i",
"j",
"k",
"System.out.println(sum)",
"System.out.println",
"System.out",
"System",
"System.out",
"sum",
"String[] args",
"args",
"public static int gcd(int x, int y) {\n\t\tif (y == 0)\n\t\t\treturn x;\n\n\t\treturn gcd(y, x % y);\n\t}",
"gcd",
"{\n\t\tif (y == 0)\n\t\t\treturn x;\n\n\t\treturn gcd(y, x % y);\n\t}",
"if (y == 0)\n\t\t\treturn x;",
"y == 0",
"y",
"0",
"return x;",
"x",
"return gcd(y, x % y);",
"gcd(y, x % y)",
"gcd",
"y",
"x % y",
"x",
"y",
"int x",
"x",
"int y",
"y",
"public static int gcd(int x, int y, int z) {\n\t\treturn gcd(gcd(x, y), z);\n\t}",
"gcd",
"{\n\t\treturn gcd(gcd(x, y), z);\n\t}",
"return gcd(gcd(x, y), z);",
"gcd(gcd(x, y), z)",
"gcd",
"gcd(x, y)",
"gcd",
"x",
"y",
"z",
"int x",
"x",
"int y",
"y",
"int z",
"z"
] |
import java.util.Scanner;
class Main {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
int K = scanner.nextInt();
int sum = 0;
for (int i = 1; i <= K; i++) {
for (int j = 1; j <= K; j++) {
for (int k = 1; k <= K; k++) {
sum += gcd(i, j, k);
}
}
}
System.out.println(sum);
}
public static int gcd(int x, int y) {
if (y == 0)
return x;
return gcd(y, x % y);
}
public static int gcd(int x, int y, int z) {
return gcd(gcd(x, y), z);
}
}
|
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
41,
13,
20,
41,
13,
20,
12,
13,
30,
41,
13,
4,
13,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
41,
13,
4,
13,
13,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
4,
13,
13,
13,
4,
13,
2,
13,
17,
4,
18,
13,
4,
18,
13,
23,
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,
4,
18,
13,
12,
13,
30,
29,
4,
18,
13,
12,
13,
30,
29,
4,
18,
13,
12,
13,
30,
29,
4,
18,
13,
12,
13,
30,
4,
18,
13,
13,
23,
13,
12,
13,
30,
4,
18,
13,
2,
13,
17,
23,
13,
12,
13,
30,
4,
18,
13,
2,
13,
17,
23,
13,
6,
13,
41,
13,
2,
17,
17,
41,
13,
41,
13,
41,
13,
41,
13,
12,
13,
30,
0,
13,
20,
0,
13,
20,
13,
0,
13,
0,
13,
17,
12,
13,
30,
0,
13,
20,
0,
13,
20,
13,
0,
13,
0,
13,
17,
23,
13,
12,
13,
30,
41,
13,
20,
17,
41,
13,
17,
41,
13,
42,
2,
0,
13,
4,
13,
40,
17,
30,
14,
2,
13,
17,
3,
0,
18,
13,
40,
13,
13,
29,
20,
12,
13,
30,
41,
13,
17,
41,
13,
4,
13,
42,
2,
13,
17,
0,
13,
4,
13,
41,
13,
2,
13,
17,
14,
13,
0,
13,
4,
13,
42,
2,
2,
0,
13,
4,
13,
17,
2,
13,
17,
30,
0,
13,
2,
2,
2,
13,
17,
13,
17,
14,
13,
29,
40,
13,
29,
13,
12,
13,
30,
41,
13,
17,
41,
13,
4,
13,
42,
2,
13,
17,
0,
13,
4,
13,
41,
13,
2,
13,
17,
14,
13,
0,
13,
4,
13,
42,
2,
2,
0,
13,
4,
13,
17,
2,
13,
17,
30,
0,
13,
2,
2,
2,
13,
17,
13,
17,
14,
13,
29,
40,
13,
29,
13,
12,
13,
30,
41,
13,
17,
41,
13,
17,
41,
13,
4,
13,
42,
2,
13,
17,
0,
13,
4,
13,
41,
13,
2,
13,
17,
14,
13,
0,
13,
4,
13,
42,
2,
2,
0,
13,
4,
13,
17,
2,
13,
17,
30,
0,
13,
2,
2,
2,
13,
17,
13,
17,
14,
2,
13,
17,
30,
42,
2,
2,
0,
13,
4,
13,
17,
2,
13,
17,
30,
0,
13,
2,
2,
13,
17,
0,
13,
17,
14,
13,
29,
40,
13,
29,
13,
12,
13,
30,
0,
13,
4,
18,
13,
13,
0,
13,
17,
13,
14,
2,
13,
40,
17,
0,
18,
13,
17,
40,
17,
12,
13,
30,
14,
2,
13,
13,
4,
13,
29,
18,
13,
40,
13,
12,
13,
30,
14,
2,
13,
17,
29,
4,
18,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
502,
11
],
[
502,
12
],
[
12,
13
],
[
12,
14
],
[
502,
15
],
[
15,
16
],
[
15,
17
],
[
502,
18
],
[
18,
19
],
[
18,
20
],
[
20,
21
],
[
21,
22
],
[
21,
23
],
[
23,
24
],
[
20,
25
],
[
25,
26
],
[
25,
27
],
[
20,
28
],
[
28,
29
],
[
29,
30
],
[
30,
31
],
[
30,
32
],
[
28,
33
],
[
33,
34
],
[
33,
35
],
[
28,
36
],
[
36,
37
],
[
37,
38
],
[
28,
39
],
[
40,
40
],
[
40,
41
],
[
41,
42
],
[
42,
43
],
[
43,
44
],
[
43,
45
],
[
41,
46
],
[
46,
47
],
[
46,
48
],
[
41,
49
],
[
49,
50
],
[
50,
51
],
[
41,
52
],
[
53,
53
],
[
53,
54
],
[
54,
55
],
[
54,
56
],
[
56,
57
],
[
56,
58
],
[
56,
59
],
[
53,
60
],
[
60,
61
],
[
61,
62
],
[
62,
63
],
[
62,
64
],
[
60,
65
],
[
65,
66
],
[
65,
67
],
[
60,
68
],
[
68,
69
],
[
69,
70
],
[
60,
71
],
[
72,
72
],
[
72,
73
],
[
73,
74
],
[
73,
75
],
[
75,
76
],
[
75,
77
],
[
75,
78
],
[
20,
79
],
[
79,
80
],
[
79,
81
],
[
81,
82
],
[
81,
83
],
[
20,
84
],
[
84,
85
],
[
85,
86
],
[
20,
87
],
[
87,
88
],
[
88,
89
],
[
18,
90
],
[
90,
91
],
[
502,
92
],
[
92,
93
],
[
92,
94
],
[
94,
95
],
[
95,
96
],
[
96,
97
],
[
96,
98
],
[
95,
99
],
[
99,
100
],
[
94,
101
],
[
101,
102
],
[
102,
103
],
[
102,
104
],
[
102,
105
],
[
105,
106
],
[
105,
107
],
[
92,
108
],
[
108,
109
],
[
92,
110
],
[
110,
111
],
[
502,
112
],
[
112,
113
],
[
112,
114
],
[
114,
115
],
[
115,
116
],
[
116,
117
],
[
117,
118
],
[
502,
119
],
[
119,
120
],
[
119,
121
],
[
121,
122
],
[
122,
123
],
[
123,
124
],
[
124,
125
],
[
502,
126
],
[
126,
127
],
[
126,
128
],
[
128,
129
],
[
129,
130
],
[
130,
131
],
[
131,
132
],
[
502,
133
],
[
133,
134
],
[
133,
135
],
[
135,
136
],
[
136,
137
],
[
137,
138
],
[
138,
139
],
[
502,
140
],
[
140,
141
],
[
140,
142
],
[
142,
143
],
[
143,
144
],
[
144,
145
],
[
143,
146
],
[
140,
147
],
[
147,
148
],
[
502,
149
],
[
149,
150
],
[
149,
151
],
[
151,
152
],
[
152,
153
],
[
153,
154
],
[
152,
155
],
[
155,
156
],
[
155,
157
],
[
149,
158
],
[
158,
159
],
[
502,
160
],
[
160,
161
],
[
160,
162
],
[
162,
163
],
[
163,
164
],
[
164,
165
],
[
163,
166
],
[
166,
167
],
[
166,
168
],
[
160,
169
],
[
169,
170
],
[
502,
171
],
[
171,
172
],
[
171,
173
],
[
173,
174
],
[
173,
175
],
[
175,
176
],
[
175,
177
],
[
171,
178
],
[
178,
179
],
[
171,
180
],
[
180,
181
],
[
171,
182
],
[
182,
183
],
[
171,
184
],
[
184,
185
],
[
171,
186
],
[
186,
187
],
[
186,
188
],
[
188,
189
],
[
189,
190
],
[
189,
191
],
[
188,
192
],
[
192,
193
],
[
192,
194
],
[
188,
196
],
[
196,
197
],
[
196,
198
],
[
198,
199
],
[
198,
200
],
[
171,
201
],
[
201,
202
],
[
201,
203
],
[
203,
204
],
[
204,
205
],
[
204,
206
],
[
203,
207
],
[
207,
208
],
[
207,
209
],
[
203,
211
],
[
211,
212
],
[
211,
213
],
[
213,
214
],
[
213,
215
],
[
201,
216
],
[
216,
217
],
[
171,
218
],
[
218,
219
],
[
218,
220
],
[
220,
221
],
[
221,
222
],
[
221,
223
],
[
220,
225
],
[
225,
226
],
[
225,
227
],
[
220,
228
],
[
228,
229
],
[
220,
230
],
[
230,
231
],
[
231,
232
],
[
232,
233
],
[
232,
234
],
[
234,
235
],
[
231,
236
],
[
236,
237
],
[
230,
238
],
[
238,
239
],
[
239,
240
],
[
240,
241
],
[
240,
242
],
[
239,
243
],
[
238,
244
],
[
244,
245
],
[
245,
246
],
[
245,
247
],
[
247,
248
],
[
244,
249
],
[
220,
250
],
[
250,
251
],
[
171,
252
],
[
252,
253
],
[
252,
254
],
[
254,
255
],
[
255,
256
],
[
255,
257
],
[
254,
258
],
[
258,
259
],
[
258,
260
],
[
260,
261
],
[
254,
262
],
[
262,
263
],
[
263,
264
],
[
263,
265
],
[
262,
266
],
[
266,
267
],
[
266,
268
],
[
268,
269
],
[
254,
270
],
[
270,
271
],
[
270,
272
],
[
272,
273
],
[
272,
274
],
[
254,
275
],
[
275,
276
],
[
275,
277
],
[
277,
278
],
[
277,
279
],
[
279,
280
],
[
254,
281
],
[
281,
282
],
[
282,
283
],
[
283,
284
],
[
284,
285
],
[
284,
286
],
[
286,
287
],
[
283,
288
],
[
282,
289
],
[
289,
290
],
[
289,
291
],
[
281,
292
],
[
292,
293
],
[
293,
294
],
[
293,
295
],
[
295,
296
],
[
296,
297
],
[
297,
298
],
[
297,
299
],
[
296,
300
],
[
295,
301
],
[
254,
302
],
[
302,
303
],
[
302,
304
],
[
304,
305
],
[
305,
306
],
[
254,
307
],
[
307,
308
],
[
171,
309
],
[
309,
310
],
[
309,
311
],
[
311,
312
],
[
312,
313
],
[
312,
314
],
[
311,
315
],
[
315,
316
],
[
315,
317
],
[
317,
318
],
[
311,
319
],
[
319,
320
],
[
320,
321
],
[
320,
322
],
[
319,
323
],
[
323,
324
],
[
323,
325
],
[
325,
326
],
[
311,
327
],
[
327,
328
],
[
327,
329
],
[
329,
330
],
[
329,
331
],
[
311,
332
],
[
332,
333
],
[
332,
334
],
[
334,
335
],
[
334,
336
],
[
336,
337
],
[
311,
338
],
[
338,
339
],
[
339,
340
],
[
340,
341
],
[
341,
342
],
[
341,
343
],
[
343,
344
],
[
340,
345
],
[
339,
346
],
[
346,
347
],
[
346,
348
],
[
338,
349
],
[
349,
350
],
[
350,
351
],
[
350,
352
],
[
352,
353
],
[
353,
354
],
[
354,
355
],
[
354,
356
],
[
353,
357
],
[
352,
358
],
[
311,
359
],
[
359,
360
],
[
359,
361
],
[
361,
362
],
[
362,
363
],
[
311,
364
],
[
364,
365
],
[
171,
366
],
[
366,
367
],
[
366,
368
],
[
368,
369
],
[
369,
370
],
[
369,
371
],
[
368,
372
],
[
372,
373
],
[
372,
374
],
[
368,
375
],
[
375,
376
],
[
375,
377
],
[
377,
378
],
[
368,
379
],
[
379,
380
],
[
380,
381
],
[
380,
382
],
[
379,
383
],
[
383,
384
],
[
383,
385
],
[
385,
386
],
[
368,
387
],
[
387,
388
],
[
387,
389
],
[
389,
390
],
[
389,
391
],
[
368,
392
],
[
392,
393
],
[
392,
394
],
[
394,
395
],
[
394,
396
],
[
396,
397
],
[
368,
398
],
[
398,
399
],
[
399,
400
],
[
400,
401
],
[
401,
402
],
[
401,
403
],
[
403,
404
],
[
400,
405
],
[
399,
406
],
[
406,
407
],
[
406,
408
],
[
398,
409
],
[
409,
410
],
[
410,
411
],
[
410,
412
],
[
412,
413
],
[
413,
414
],
[
414,
415
],
[
414,
416
],
[
413,
417
],
[
412,
418
],
[
368,
419
],
[
419,
420
],
[
420,
421
],
[
420,
422
],
[
419,
423
],
[
423,
424
],
[
424,
425
],
[
425,
426
],
[
426,
427
],
[
427,
428
],
[
427,
429
],
[
429,
430
],
[
426,
431
],
[
425,
432
],
[
432,
433
],
[
432,
434
],
[
424,
435
],
[
435,
436
],
[
436,
437
],
[
436,
438
],
[
438,
439
],
[
439,
440
],
[
439,
441
],
[
438,
442
],
[
442,
443
],
[
442,
444
],
[
368,
445
],
[
445,
446
],
[
445,
447
],
[
447,
448
],
[
448,
449
],
[
368,
450
],
[
450,
451
],
[
171,
452
],
[
452,
453
],
[
452,
454
],
[
454,
455
],
[
455,
456
],
[
455,
457
],
[
457,
458
],
[
458,
459
],
[
457,
460
],
[
457,
461
],
[
461,
462
],
[
461,
463
],
[
457,
464
],
[
454,
465
],
[
465,
466
],
[
466,
467
],
[
466,
468
],
[
468,
469
],
[
465,
470
],
[
470,
471
],
[
471,
472
],
[
471,
473
],
[
470,
474
],
[
474,
475
],
[
171,
476
],
[
476,
477
],
[
476,
478
],
[
478,
479
],
[
479,
480
],
[
480,
481
],
[
480,
482
],
[
479,
483
],
[
483,
484
],
[
478,
485
],
[
485,
486
],
[
486,
487
],
[
486,
488
],
[
488,
489
],
[
171,
490
],
[
490,
491
],
[
490,
492
],
[
492,
493
],
[
493,
494
],
[
494,
495
],
[
494,
496
],
[
493,
497
],
[
492,
498
],
[
498,
499
],
[
499,
500
],
[
0,
501
],
[
501,
502
],
[
501,
503
]
] |
[
"/*input\n200\n*/\n\n\n\n\nimport java.math.*;\nimport java.io.*;\nimport java.util.*;\npublic class Main\n{\n static class Reader \n { \n final private int BUFFER_SIZE = 1 << 16; \n private DataInputStream din; \n private byte[] buffer; \n private int bufferPointer, bytesRead;\npublic Reader() \n { \n din = new DataInputStream(System.in); \n buffer = new byte[BUFFER_SIZE]; \n bufferPointer = bytesRead = 0; \n }\npublic Reader(String file_name) throws IOException \n { \n din = new DataInputStream(new FileInputStream(file_name)); \n buffer = new byte[BUFFER_SIZE]; \n bufferPointer = bytesRead = 0; \n }\npublic String readLine() throws IOException \n { \n byte[] buf = new byte[64]; // line length \n int cnt = 0, c; \n while ((c = read()) != -1) \n { \n if (c == '\\n') \n break; \n buf[cnt++] = (byte) c; \n } \n return new String(buf, 0, cnt); \n }\npublic int nextInt() throws IOException \n { \n int ret = 0; \n byte c = read(); \n while (c <= ' ') \n c = read(); \n boolean neg = (c == '-'); \n if (neg) \n c = read(); \n do\n { \n ret = ret * 10 + c - '0'; \n } while ((c = read()) >= '0' && c <= '9');\nif (neg) \n return -ret; \n return ret; \n }\npublic long nextLong() throws IOException \n { \n long ret = 0; \n byte c = read(); \n while (c <= ' ') \n c = read(); \n boolean neg = (c == '-'); \n if (neg) \n c = read(); \n do { \n ret = ret * 10 + c - '0'; \n } \n while ((c = read()) >= '0' && c <= '9'); \n if (neg) \n return -ret; \n return ret; \n }\npublic double nextDouble() throws IOException \n { \n double ret = 0, div = 1; \n byte c = read(); \n while (c <= ' ') \n c = read(); \n boolean neg = (c == '-'); \n if (neg) \n c = read();\ndo { \n ret = ret * 10 + c - '0'; \n } \n while ((c = read()) >= '0' && c <= '9');\nif (c == '.') \n { \n while ((c = read()) >= '0' && c <= '9') \n { \n ret += (c - '0') / (div *= 10); \n } \n }\nif (neg) \n return -ret; \n return ret; \n }\nprivate void fillBuffer() throws IOException \n { \n bytesRead = din.read(buffer, bufferPointer = 0, BUFFER_SIZE); \n if (bytesRead == -1) \n buffer[0] = -1; \n }\nprivate byte read() throws IOException \n { \n if (bufferPointer == bytesRead) \n fillBuffer(); \n return buffer[bufferPointer++]; \n }\npublic void close() throws IOException \n { \n if (din == null) \n return; \n din.close(); \n } \n } \n\n\n\n\n\n static Reader sc=new Reader();\n static BufferedWriter bw=new BufferedWriter(new OutputStreamWriter(System.out));\n\n public static void main(String args[])throws IOException\n {\n /*\n * For integer input: int n=inputInt();\n * For long input: long n=inputLong();\n * For double input: double n=inputDouble();\n * For String input: String s=inputString();\n * Logic goes here\n * For printing without space: print(a+\"\"); where a is a variable of any datatype\n * For printing with space: printSp(a+\"\"); where a is a variable of any datatype\n * For printing with new line: println(a+\"\"); where a is a variable of any datatype\n */\n\n\nint n=inputInt();\nlong sum=0;\n//println(n+\"\");\nfor(int i=1;i<=n;i++)\n{\n\tfor(int j=1;j<=n;j++)\n\t{\n\t\tint x=gcd(i,j);\n\n\t\tfor(int k=1;k<=n;k++)\n\t\t{\n\t\t\tsum+=gcd(x,k);\n\t\t}\n\t}\n} \nprintln(sum+\"\");\n bw.flush();\n bw.close();\n\n\t}\n public static int gcd(int a,int b)\n {\n \tif(b==0)\n \t\treturn a;\n \treturn gcd(b,a%b);\n }\n\n public static int inputInt()throws IOException\n {\n return sc.nextInt();\n }\n public static long inputLong()throws IOException\n {\n return sc.nextLong();\n }\n public static double inputDouble()throws IOException\n {\n return sc.nextDouble();\n }\n public static String inputString()throws IOException\n {\n return sc.readLine();\n }\n public static void print(String a)throws IOException\n {\n bw.write(a);\n }\n public static void printSp(String a)throws IOException\n {\n bw.write(a+\" \");\n }\n public static void println(String a)throws IOException\n {\n bw.write(a+\"\\n\");\n }\n}",
"import java.math.*;",
"math.*",
"java",
"import java.io.*;",
"io.*",
"java",
"import java.util.*;",
"util.*",
"java",
"public class Main\n{\n static class Reader \n { \n final private int BUFFER_SIZE = 1 << 16; \n private DataInputStream din; \n private byte[] buffer; \n private int bufferPointer, bytesRead;\npublic Reader() \n { \n din = new DataInputStream(System.in); \n buffer = new byte[BUFFER_SIZE]; \n bufferPointer = bytesRead = 0; \n }\npublic Reader(String file_name) throws IOException \n { \n din = new DataInputStream(new FileInputStream(file_name)); \n buffer = new byte[BUFFER_SIZE]; \n bufferPointer = bytesRead = 0; \n }\npublic String readLine() throws IOException \n { \n byte[] buf = new byte[64]; // line length \n int cnt = 0, c; \n while ((c = read()) != -1) \n { \n if (c == '\\n') \n break; \n buf[cnt++] = (byte) c; \n } \n return new String(buf, 0, cnt); \n }\npublic int nextInt() throws IOException \n { \n int ret = 0; \n byte c = read(); \n while (c <= ' ') \n c = read(); \n boolean neg = (c == '-'); \n if (neg) \n c = read(); \n do\n { \n ret = ret * 10 + c - '0'; \n } while ((c = read()) >= '0' && c <= '9');\nif (neg) \n return -ret; \n return ret; \n }\npublic long nextLong() throws IOException \n { \n long ret = 0; \n byte c = read(); \n while (c <= ' ') \n c = read(); \n boolean neg = (c == '-'); \n if (neg) \n c = read(); \n do { \n ret = ret * 10 + c - '0'; \n } \n while ((c = read()) >= '0' && c <= '9'); \n if (neg) \n return -ret; \n return ret; \n }\npublic double nextDouble() throws IOException \n { \n double ret = 0, div = 1; \n byte c = read(); \n while (c <= ' ') \n c = read(); \n boolean neg = (c == '-'); \n if (neg) \n c = read();\ndo { \n ret = ret * 10 + c - '0'; \n } \n while ((c = read()) >= '0' && c <= '9');\nif (c == '.') \n { \n while ((c = read()) >= '0' && c <= '9') \n { \n ret += (c - '0') / (div *= 10); \n } \n }\nif (neg) \n return -ret; \n return ret; \n }\nprivate void fillBuffer() throws IOException \n { \n bytesRead = din.read(buffer, bufferPointer = 0, BUFFER_SIZE); \n if (bytesRead == -1) \n buffer[0] = -1; \n }\nprivate byte read() throws IOException \n { \n if (bufferPointer == bytesRead) \n fillBuffer(); \n return buffer[bufferPointer++]; \n }\npublic void close() throws IOException \n { \n if (din == null) \n return; \n din.close(); \n } \n } \n\n\n\n\n\n static Reader sc=new Reader();\n static BufferedWriter bw=new BufferedWriter(new OutputStreamWriter(System.out));\n\n public static void main(String args[])throws IOException\n {\n /*\n * For integer input: int n=inputInt();\n * For long input: long n=inputLong();\n * For double input: double n=inputDouble();\n * For String input: String s=inputString();\n * Logic goes here\n * For printing without space: print(a+\"\"); where a is a variable of any datatype\n * For printing with space: printSp(a+\"\"); where a is a variable of any datatype\n * For printing with new line: println(a+\"\"); where a is a variable of any datatype\n */\n\n\nint n=inputInt();\nlong sum=0;\n//println(n+\"\");\nfor(int i=1;i<=n;i++)\n{\n\tfor(int j=1;j<=n;j++)\n\t{\n\t\tint x=gcd(i,j);\n\n\t\tfor(int k=1;k<=n;k++)\n\t\t{\n\t\t\tsum+=gcd(x,k);\n\t\t}\n\t}\n} \nprintln(sum+\"\");\n bw.flush();\n bw.close();\n\n\t}\n public static int gcd(int a,int b)\n {\n \tif(b==0)\n \t\treturn a;\n \treturn gcd(b,a%b);\n }\n\n public static int inputInt()throws IOException\n {\n return sc.nextInt();\n }\n public static long inputLong()throws IOException\n {\n return sc.nextLong();\n }\n public static double inputDouble()throws IOException\n {\n return sc.nextDouble();\n }\n public static String inputString()throws IOException\n {\n return sc.readLine();\n }\n public static void print(String a)throws IOException\n {\n bw.write(a);\n }\n public static void printSp(String a)throws IOException\n {\n bw.write(a+\" \");\n }\n public static void println(String a)throws IOException\n {\n bw.write(a+\"\\n\");\n }\n}",
"Main",
"static Reader sc=new Reader();",
"sc",
"new Reader()",
"static BufferedWriter bw=new BufferedWriter(new OutputStreamWriter(System.out));",
"bw",
"new BufferedWriter(new OutputStreamWriter(System.out))",
"public static void main(String args[])throws IOException\n {\n /*\n * For integer input: int n=inputInt();\n * For long input: long n=inputLong();\n * For double input: double n=inputDouble();\n * For String input: String s=inputString();\n * Logic goes here\n * For printing without space: print(a+\"\"); where a is a variable of any datatype\n * For printing with space: printSp(a+\"\"); where a is a variable of any datatype\n * For printing with new line: println(a+\"\"); where a is a variable of any datatype\n */\n\n\nint n=inputInt();\nlong sum=0;\n//println(n+\"\");\nfor(int i=1;i<=n;i++)\n{\n\tfor(int j=1;j<=n;j++)\n\t{\n\t\tint x=gcd(i,j);\n\n\t\tfor(int k=1;k<=n;k++)\n\t\t{\n\t\t\tsum+=gcd(x,k);\n\t\t}\n\t}\n} \nprintln(sum+\"\");\n bw.flush();\n bw.close();\n\n\t}",
"main",
"{\n /*\n * For integer input: int n=inputInt();\n * For long input: long n=inputLong();\n * For double input: double n=inputDouble();\n * For String input: String s=inputString();\n * Logic goes here\n * For printing without space: print(a+\"\"); where a is a variable of any datatype\n * For printing with space: printSp(a+\"\"); where a is a variable of any datatype\n * For printing with new line: println(a+\"\"); where a is a variable of any datatype\n */\n\n\nint n=inputInt();\nlong sum=0;\n//println(n+\"\");\nfor(int i=1;i<=n;i++)\n{\n\tfor(int j=1;j<=n;j++)\n\t{\n\t\tint x=gcd(i,j);\n\n\t\tfor(int k=1;k<=n;k++)\n\t\t{\n\t\t\tsum+=gcd(x,k);\n\t\t}\n\t}\n} \nprintln(sum+\"\");\n bw.flush();\n bw.close();\n\n\t}",
"int n=inputInt();",
"n",
"inputInt()",
"inputInt",
"long sum=0;",
"sum",
"0",
"for(int i=1;i<=n;i++)\n{\n\tfor(int j=1;j<=n;j++)\n\t{\n\t\tint x=gcd(i,j);\n\n\t\tfor(int k=1;k<=n;k++)\n\t\t{\n\t\t\tsum+=gcd(x,k);\n\t\t}\n\t}\n}",
"int i=1;",
"int i=1;",
"i",
"1",
"i<=n",
"i",
"n",
"i++",
"i++",
"i",
"{\n\tfor(int j=1;j<=n;j++)\n\t{\n\t\tint x=gcd(i,j);\n\n\t\tfor(int k=1;k<=n;k++)\n\t\t{\n\t\t\tsum+=gcd(x,k);\n\t\t}\n\t}\n}",
"{\n\tfor(int j=1;j<=n;j++)\n\t{\n\t\tint x=gcd(i,j);\n\n\t\tfor(int k=1;k<=n;k++)\n\t\t{\n\t\t\tsum+=gcd(x,k);\n\t\t}\n\t}\n}",
"for(int j=1;j<=n;j++)\n\t{\n\t\tint x=gcd(i,j);\n\n\t\tfor(int k=1;k<=n;k++)\n\t\t{\n\t\t\tsum+=gcd(x,k);\n\t\t}\n\t}",
"int j=1;",
"int j=1;",
"j",
"1",
"j<=n",
"j",
"n",
"j++",
"j++",
"j",
"{\n\t\tint x=gcd(i,j);\n\n\t\tfor(int k=1;k<=n;k++)\n\t\t{\n\t\t\tsum+=gcd(x,k);\n\t\t}\n\t}",
"{\n\t\tint x=gcd(i,j);\n\n\t\tfor(int k=1;k<=n;k++)\n\t\t{\n\t\t\tsum+=gcd(x,k);\n\t\t}\n\t}",
"int x=gcd(i,j);",
"x",
"gcd(i,j)",
"gcd",
"i",
"j",
"for(int k=1;k<=n;k++)\n\t\t{\n\t\t\tsum+=gcd(x,k);\n\t\t}",
"int k=1;",
"int k=1;",
"k",
"1",
"k<=n",
"k",
"n",
"k++",
"k++",
"k",
"{\n\t\t\tsum+=gcd(x,k);\n\t\t}",
"{\n\t\t\tsum+=gcd(x,k);\n\t\t}",
"sum+=gcd(x,k)",
"sum",
"gcd(x,k)",
"gcd",
"x",
"k",
"println(sum+\"\")",
"println",
"sum+\"\"",
"sum",
"\"\"",
"bw.flush()",
"bw.flush",
"bw",
"bw.close()",
"bw.close",
"bw",
"String args[]",
"args",
"public static int gcd(int a,int b)\n {\n \tif(b==0)\n \t\treturn a;\n \treturn gcd(b,a%b);\n }",
"gcd",
"{\n \tif(b==0)\n \t\treturn a;\n \treturn gcd(b,a%b);\n }",
"if(b==0)\n \t\treturn a;",
"b==0",
"b",
"0",
"return a;",
"a",
"return gcd(b,a%b);",
"gcd(b,a%b)",
"gcd",
"b",
"a%b",
"a",
"b",
"int a",
"a",
"int b",
"b",
"public static int inputInt()throws IOException\n {\n return sc.nextInt();\n }",
"inputInt",
"{\n return sc.nextInt();\n }",
"return sc.nextInt();",
"sc.nextInt()",
"sc.nextInt",
"sc",
"public static long inputLong()throws IOException\n {\n return sc.nextLong();\n }",
"inputLong",
"{\n return sc.nextLong();\n }",
"return sc.nextLong();",
"sc.nextLong()",
"sc.nextLong",
"sc",
"public static double inputDouble()throws IOException\n {\n return sc.nextDouble();\n }",
"inputDouble",
"{\n return sc.nextDouble();\n }",
"return sc.nextDouble();",
"sc.nextDouble()",
"sc.nextDouble",
"sc",
"public static String inputString()throws IOException\n {\n return sc.readLine();\n }",
"inputString",
"{\n return sc.readLine();\n }",
"return sc.readLine();",
"sc.readLine()",
"sc.readLine",
"sc",
"public static void print(String a)throws IOException\n {\n bw.write(a);\n }",
"print",
"{\n bw.write(a);\n }",
"bw.write(a)",
"bw.write",
"bw",
"a",
"String a",
"a",
"public static void printSp(String a)throws IOException\n {\n bw.write(a+\" \");\n }",
"printSp",
"{\n bw.write(a+\" \");\n }",
"bw.write(a+\" \")",
"bw.write",
"bw",
"a+\" \"",
"a",
"\" \"",
"String a",
"a",
"public static void println(String a)throws IOException\n {\n bw.write(a+\"\\n\");\n }",
"println",
"{\n bw.write(a+\"\\n\");\n }",
"bw.write(a+\"\\n\")",
"bw.write",
"bw",
"a+\"\\n\"",
"a",
"\"\\n\"",
"String a",
"a",
"static class Reader \n { \n final private int BUFFER_SIZE = 1 << 16; \n private DataInputStream din; \n private byte[] buffer; \n private int bufferPointer, bytesRead;\npublic Reader() \n { \n din = new DataInputStream(System.in); \n buffer = new byte[BUFFER_SIZE]; \n bufferPointer = bytesRead = 0; \n }\npublic Reader(String file_name) throws IOException \n { \n din = new DataInputStream(new FileInputStream(file_name)); \n buffer = new byte[BUFFER_SIZE]; \n bufferPointer = bytesRead = 0; \n }\npublic String readLine() throws IOException \n { \n byte[] buf = new byte[64]; // line length \n int cnt = 0, c; \n while ((c = read()) != -1) \n { \n if (c == '\\n') \n break; \n buf[cnt++] = (byte) c; \n } \n return new String(buf, 0, cnt); \n }\npublic int nextInt() throws IOException \n { \n int ret = 0; \n byte c = read(); \n while (c <= ' ') \n c = read(); \n boolean neg = (c == '-'); \n if (neg) \n c = read(); \n do\n { \n ret = ret * 10 + c - '0'; \n } while ((c = read()) >= '0' && c <= '9');\nif (neg) \n return -ret; \n return ret; \n }\npublic long nextLong() throws IOException \n { \n long ret = 0; \n byte c = read(); \n while (c <= ' ') \n c = read(); \n boolean neg = (c == '-'); \n if (neg) \n c = read(); \n do { \n ret = ret * 10 + c - '0'; \n } \n while ((c = read()) >= '0' && c <= '9'); \n if (neg) \n return -ret; \n return ret; \n }\npublic double nextDouble() throws IOException \n { \n double ret = 0, div = 1; \n byte c = read(); \n while (c <= ' ') \n c = read(); \n boolean neg = (c == '-'); \n if (neg) \n c = read();\ndo { \n ret = ret * 10 + c - '0'; \n } \n while ((c = read()) >= '0' && c <= '9');\nif (c == '.') \n { \n while ((c = read()) >= '0' && c <= '9') \n { \n ret += (c - '0') / (div *= 10); \n } \n }\nif (neg) \n return -ret; \n return ret; \n }\nprivate void fillBuffer() throws IOException \n { \n bytesRead = din.read(buffer, bufferPointer = 0, BUFFER_SIZE); \n if (bytesRead == -1) \n buffer[0] = -1; \n }\nprivate byte read() throws IOException \n { \n if (bufferPointer == bytesRead) \n fillBuffer(); \n return buffer[bufferPointer++]; \n }\npublic void close() throws IOException \n { \n if (din == null) \n return; \n din.close(); \n } \n }",
"Reader",
"final private int BUFFER_SIZE = 1 << 16;",
"BUFFER_SIZE",
"1 << 16",
"1",
"16",
"private DataInputStream din;",
"din",
"private byte[] buffer;",
"buffer",
"private int bufferPointer",
"bufferPointer",
"bytesRead;",
"bytesRead",
"public Reader() \n { \n din = new DataInputStream(System.in); \n buffer = new byte[BUFFER_SIZE]; \n bufferPointer = bytesRead = 0; \n }",
"Reader",
"{ \n din = new DataInputStream(System.in); \n buffer = new byte[BUFFER_SIZE]; \n bufferPointer = bytesRead = 0; \n }",
"din = new DataInputStream(System.in)",
"din",
"new DataInputStream(System.in)",
"buffer = new byte[BUFFER_SIZE]",
"buffer",
"new byte[BUFFER_SIZE]",
"BUFFER_SIZE",
"bufferPointer = bytesRead = 0",
"bufferPointer",
"bytesRead = 0",
"bytesRead",
"0",
"public Reader(String file_name) throws IOException \n { \n din = new DataInputStream(new FileInputStream(file_name)); \n buffer = new byte[BUFFER_SIZE]; \n bufferPointer = bytesRead = 0; \n }",
"Reader",
"{ \n din = new DataInputStream(new FileInputStream(file_name)); \n buffer = new byte[BUFFER_SIZE]; \n bufferPointer = bytesRead = 0; \n }",
"din = new DataInputStream(new FileInputStream(file_name))",
"din",
"new DataInputStream(new FileInputStream(file_name))",
"buffer = new byte[BUFFER_SIZE]",
"buffer",
"new byte[BUFFER_SIZE]",
"BUFFER_SIZE",
"bufferPointer = bytesRead = 0",
"bufferPointer",
"bytesRead = 0",
"bytesRead",
"0",
"String file_name",
"file_name",
"public String readLine() throws IOException \n { \n byte[] buf = new byte[64]; // line length \n int cnt = 0, c; \n while ((c = read()) != -1) \n { \n if (c == '\\n') \n break; \n buf[cnt++] = (byte) c; \n } \n return new String(buf, 0, cnt); \n }",
"readLine",
"{ \n byte[] buf = new byte[64]; // line length \n int cnt = 0, c; \n while ((c = read()) != -1) \n { \n if (c == '\\n') \n break; \n buf[cnt++] = (byte) c; \n } \n return new String(buf, 0, cnt); \n }",
"byte[] buf = new byte[64];",
"buf",
"new byte[64]",
"64",
"int cnt = 0",
"cnt",
"0",
"c;",
"c",
"while ((c = read()) != -1) \n { \n if (c == '\\n') \n break; \n buf[cnt++] = (byte) c; \n }",
"(c = read()) != -1",
"(c = read())",
"c",
"read()",
"read",
"-1",
"1",
"{ \n if (c == '\\n') \n break; \n buf[cnt++] = (byte) c; \n }",
"if (c == '\\n') \n break;",
"c == '\\n'",
"c",
"'\\n'",
"break;",
"buf[cnt++] = (byte) c",
"buf[cnt++]",
"buf",
"cnt++",
"cnt",
"(byte) c",
"return new String(buf, 0, cnt);",
"new String(buf, 0, cnt)",
"public int nextInt() throws IOException \n { \n int ret = 0; \n byte c = read(); \n while (c <= ' ') \n c = read(); \n boolean neg = (c == '-'); \n if (neg) \n c = read(); \n do\n { \n ret = ret * 10 + c - '0'; \n } while ((c = read()) >= '0' && c <= '9');\nif (neg) \n return -ret; \n return ret; \n }",
"nextInt",
"{ \n int ret = 0; \n byte c = read(); \n while (c <= ' ') \n c = read(); \n boolean neg = (c == '-'); \n if (neg) \n c = read(); \n do\n { \n ret = ret * 10 + c - '0'; \n } while ((c = read()) >= '0' && c <= '9');\nif (neg) \n return -ret; \n return ret; \n }",
"int ret = 0;",
"ret",
"0",
"byte c = read();",
"c",
"read()",
"read",
"while (c <= ' ') \n c = read();",
"c <= ' '",
"c",
"' '",
"c = read()",
"c",
"read()",
"read",
"boolean neg = (c == '-');",
"neg",
"(c == '-')",
"c",
"'-'",
"if (neg) \n c = read();",
"neg",
"c = read()",
"c",
"read()",
"read",
"do\n { \n ret = ret * 10 + c - '0'; \n } while ((c = read()) >= '0' && c <= '9');",
"(c = read()) >= '0' && c <= '9'",
"(c = read()) >= '0'",
"(c = read())",
"c",
"read()",
"read",
"'0'",
"c <= '9'",
"c",
"'9'",
"{ \n ret = ret * 10 + c - '0'; \n }",
"ret = ret * 10 + c - '0'",
"ret",
"ret * 10 + c - '0'",
"ret * 10 + c",
"ret * 10",
"ret",
"10",
"c",
"'0'",
"if (neg) \n return -ret;",
"neg",
"return -ret;",
"-ret",
"ret",
"return ret;",
"ret",
"public long nextLong() throws IOException \n { \n long ret = 0; \n byte c = read(); \n while (c <= ' ') \n c = read(); \n boolean neg = (c == '-'); \n if (neg) \n c = read(); \n do { \n ret = ret * 10 + c - '0'; \n } \n while ((c = read()) >= '0' && c <= '9'); \n if (neg) \n return -ret; \n return ret; \n }",
"nextLong",
"{ \n long ret = 0; \n byte c = read(); \n while (c <= ' ') \n c = read(); \n boolean neg = (c == '-'); \n if (neg) \n c = read(); \n do { \n ret = ret * 10 + c - '0'; \n } \n while ((c = read()) >= '0' && c <= '9'); \n if (neg) \n return -ret; \n return ret; \n }",
"long ret = 0;",
"ret",
"0",
"byte c = read();",
"c",
"read()",
"read",
"while (c <= ' ') \n c = read();",
"c <= ' '",
"c",
"' '",
"c = read()",
"c",
"read()",
"read",
"boolean neg = (c == '-');",
"neg",
"(c == '-')",
"c",
"'-'",
"if (neg) \n c = read();",
"neg",
"c = read()",
"c",
"read()",
"read",
"do { \n ret = ret * 10 + c - '0'; \n } \n while ((c = read()) >= '0' && c <= '9');",
"(c = read()) >= '0' && c <= '9'",
"(c = read()) >= '0'",
"(c = read())",
"c",
"read()",
"read",
"'0'",
"c <= '9'",
"c",
"'9'",
"{ \n ret = ret * 10 + c - '0'; \n }",
"ret = ret * 10 + c - '0'",
"ret",
"ret * 10 + c - '0'",
"ret * 10 + c",
"ret * 10",
"ret",
"10",
"c",
"'0'",
"if (neg) \n return -ret;",
"neg",
"return -ret;",
"-ret",
"ret",
"return ret;",
"ret",
"public double nextDouble() throws IOException \n { \n double ret = 0, div = 1; \n byte c = read(); \n while (c <= ' ') \n c = read(); \n boolean neg = (c == '-'); \n if (neg) \n c = read();\ndo { \n ret = ret * 10 + c - '0'; \n } \n while ((c = read()) >= '0' && c <= '9');\nif (c == '.') \n { \n while ((c = read()) >= '0' && c <= '9') \n { \n ret += (c - '0') / (div *= 10); \n } \n }\nif (neg) \n return -ret; \n return ret; \n }",
"nextDouble",
"{ \n double ret = 0, div = 1; \n byte c = read(); \n while (c <= ' ') \n c = read(); \n boolean neg = (c == '-'); \n if (neg) \n c = read();\ndo { \n ret = ret * 10 + c - '0'; \n } \n while ((c = read()) >= '0' && c <= '9');\nif (c == '.') \n { \n while ((c = read()) >= '0' && c <= '9') \n { \n ret += (c - '0') / (div *= 10); \n } \n }\nif (neg) \n return -ret; \n return ret; \n }",
"double ret = 0",
"ret",
"0",
"div = 1;",
"div",
"1",
"byte c = read();",
"c",
"read()",
"read",
"while (c <= ' ') \n c = read();",
"c <= ' '",
"c",
"' '",
"c = read()",
"c",
"read()",
"read",
"boolean neg = (c == '-');",
"neg",
"(c == '-')",
"c",
"'-'",
"if (neg) \n c = read();",
"neg",
"c = read()",
"c",
"read()",
"read",
"do { \n ret = ret * 10 + c - '0'; \n } \n while ((c = read()) >= '0' && c <= '9');",
"(c = read()) >= '0' && c <= '9'",
"(c = read()) >= '0'",
"(c = read())",
"c",
"read()",
"read",
"'0'",
"c <= '9'",
"c",
"'9'",
"{ \n ret = ret * 10 + c - '0'; \n }",
"ret = ret * 10 + c - '0'",
"ret",
"ret * 10 + c - '0'",
"ret * 10 + c",
"ret * 10",
"ret",
"10",
"c",
"'0'",
"if (c == '.') \n { \n while ((c = read()) >= '0' && c <= '9') \n { \n ret += (c - '0') / (div *= 10); \n } \n }",
"c == '.'",
"c",
"'.'",
"{ \n while ((c = read()) >= '0' && c <= '9') \n { \n ret += (c - '0') / (div *= 10); \n } \n }",
"while ((c = read()) >= '0' && c <= '9') \n { \n ret += (c - '0') / (div *= 10); \n }",
"(c = read()) >= '0' && c <= '9'",
"(c = read()) >= '0'",
"(c = read())",
"c",
"read()",
"read",
"'0'",
"c <= '9'",
"c",
"'9'",
"{ \n ret += (c - '0') / (div *= 10); \n }",
"ret += (c - '0') / (div *= 10)",
"ret",
"(c - '0') / (div *= 10)",
"(c - '0')",
"c",
"'0'",
"(div *= 10)",
"div",
"10",
"if (neg) \n return -ret;",
"neg",
"return -ret;",
"-ret",
"ret",
"return ret;",
"ret",
"private void fillBuffer() throws IOException \n { \n bytesRead = din.read(buffer, bufferPointer = 0, BUFFER_SIZE); \n if (bytesRead == -1) \n buffer[0] = -1; \n }",
"fillBuffer",
"{ \n bytesRead = din.read(buffer, bufferPointer = 0, BUFFER_SIZE); \n if (bytesRead == -1) \n buffer[0] = -1; \n }",
"bytesRead = din.read(buffer, bufferPointer = 0, BUFFER_SIZE)",
"bytesRead",
"din.read(buffer, bufferPointer = 0, BUFFER_SIZE)",
"din.read",
"din",
"buffer",
"bufferPointer = 0",
"bufferPointer",
"0",
"BUFFER_SIZE",
"if (bytesRead == -1) \n buffer[0] = -1;",
"bytesRead == -1",
"bytesRead",
"-1",
"1",
"buffer[0] = -1",
"buffer[0]",
"buffer",
"0",
"-1",
"1",
"private byte read() throws IOException \n { \n if (bufferPointer == bytesRead) \n fillBuffer(); \n return buffer[bufferPointer++]; \n }",
"read",
"{ \n if (bufferPointer == bytesRead) \n fillBuffer(); \n return buffer[bufferPointer++]; \n }",
"if (bufferPointer == bytesRead) \n fillBuffer();",
"bufferPointer == bytesRead",
"bufferPointer",
"bytesRead",
"fillBuffer()",
"fillBuffer",
"return buffer[bufferPointer++];",
"buffer[bufferPointer++]",
"buffer",
"bufferPointer++",
"bufferPointer",
"public void close() throws IOException \n { \n if (din == null) \n return; \n din.close(); \n }",
"close",
"{ \n if (din == null) \n return; \n din.close(); \n }",
"if (din == null) \n return;",
"din == null",
"din",
"null",
"return;",
"din.close()",
"din.close",
"din",
"public class Main\n{\n static class Reader \n { \n final private int BUFFER_SIZE = 1 << 16; \n private DataInputStream din; \n private byte[] buffer; \n private int bufferPointer, bytesRead;\npublic Reader() \n { \n din = new DataInputStream(System.in); \n buffer = new byte[BUFFER_SIZE]; \n bufferPointer = bytesRead = 0; \n }\npublic Reader(String file_name) throws IOException \n { \n din = new DataInputStream(new FileInputStream(file_name)); \n buffer = new byte[BUFFER_SIZE]; \n bufferPointer = bytesRead = 0; \n }\npublic String readLine() throws IOException \n { \n byte[] buf = new byte[64]; // line length \n int cnt = 0, c; \n while ((c = read()) != -1) \n { \n if (c == '\\n') \n break; \n buf[cnt++] = (byte) c; \n } \n return new String(buf, 0, cnt); \n }\npublic int nextInt() throws IOException \n { \n int ret = 0; \n byte c = read(); \n while (c <= ' ') \n c = read(); \n boolean neg = (c == '-'); \n if (neg) \n c = read(); \n do\n { \n ret = ret * 10 + c - '0'; \n } while ((c = read()) >= '0' && c <= '9');\nif (neg) \n return -ret; \n return ret; \n }\npublic long nextLong() throws IOException \n { \n long ret = 0; \n byte c = read(); \n while (c <= ' ') \n c = read(); \n boolean neg = (c == '-'); \n if (neg) \n c = read(); \n do { \n ret = ret * 10 + c - '0'; \n } \n while ((c = read()) >= '0' && c <= '9'); \n if (neg) \n return -ret; \n return ret; \n }\npublic double nextDouble() throws IOException \n { \n double ret = 0, div = 1; \n byte c = read(); \n while (c <= ' ') \n c = read(); \n boolean neg = (c == '-'); \n if (neg) \n c = read();\ndo { \n ret = ret * 10 + c - '0'; \n } \n while ((c = read()) >= '0' && c <= '9');\nif (c == '.') \n { \n while ((c = read()) >= '0' && c <= '9') \n { \n ret += (c - '0') / (div *= 10); \n } \n }\nif (neg) \n return -ret; \n return ret; \n }\nprivate void fillBuffer() throws IOException \n { \n bytesRead = din.read(buffer, bufferPointer = 0, BUFFER_SIZE); \n if (bytesRead == -1) \n buffer[0] = -1; \n }\nprivate byte read() throws IOException \n { \n if (bufferPointer == bytesRead) \n fillBuffer(); \n return buffer[bufferPointer++]; \n }\npublic void close() throws IOException \n { \n if (din == null) \n return; \n din.close(); \n } \n } \n\n\n\n\n\n static Reader sc=new Reader();\n static BufferedWriter bw=new BufferedWriter(new OutputStreamWriter(System.out));\n\n public static void main(String args[])throws IOException\n {\n /*\n * For integer input: int n=inputInt();\n * For long input: long n=inputLong();\n * For double input: double n=inputDouble();\n * For String input: String s=inputString();\n * Logic goes here\n * For printing without space: print(a+\"\"); where a is a variable of any datatype\n * For printing with space: printSp(a+\"\"); where a is a variable of any datatype\n * For printing with new line: println(a+\"\"); where a is a variable of any datatype\n */\n\n\nint n=inputInt();\nlong sum=0;\n//println(n+\"\");\nfor(int i=1;i<=n;i++)\n{\n\tfor(int j=1;j<=n;j++)\n\t{\n\t\tint x=gcd(i,j);\n\n\t\tfor(int k=1;k<=n;k++)\n\t\t{\n\t\t\tsum+=gcd(x,k);\n\t\t}\n\t}\n} \nprintln(sum+\"\");\n bw.flush();\n bw.close();\n\n\t}\n public static int gcd(int a,int b)\n {\n \tif(b==0)\n \t\treturn a;\n \treturn gcd(b,a%b);\n }\n\n public static int inputInt()throws IOException\n {\n return sc.nextInt();\n }\n public static long inputLong()throws IOException\n {\n return sc.nextLong();\n }\n public static double inputDouble()throws IOException\n {\n return sc.nextDouble();\n }\n public static String inputString()throws IOException\n {\n return sc.readLine();\n }\n public static void print(String a)throws IOException\n {\n bw.write(a);\n }\n public static void printSp(String a)throws IOException\n {\n bw.write(a+\" \");\n }\n public static void println(String a)throws IOException\n {\n bw.write(a+\"\\n\");\n }\n}",
"public class Main\n{\n static class Reader \n { \n final private int BUFFER_SIZE = 1 << 16; \n private DataInputStream din; \n private byte[] buffer; \n private int bufferPointer, bytesRead;\npublic Reader() \n { \n din = new DataInputStream(System.in); \n buffer = new byte[BUFFER_SIZE]; \n bufferPointer = bytesRead = 0; \n }\npublic Reader(String file_name) throws IOException \n { \n din = new DataInputStream(new FileInputStream(file_name)); \n buffer = new byte[BUFFER_SIZE]; \n bufferPointer = bytesRead = 0; \n }\npublic String readLine() throws IOException \n { \n byte[] buf = new byte[64]; // line length \n int cnt = 0, c; \n while ((c = read()) != -1) \n { \n if (c == '\\n') \n break; \n buf[cnt++] = (byte) c; \n } \n return new String(buf, 0, cnt); \n }\npublic int nextInt() throws IOException \n { \n int ret = 0; \n byte c = read(); \n while (c <= ' ') \n c = read(); \n boolean neg = (c == '-'); \n if (neg) \n c = read(); \n do\n { \n ret = ret * 10 + c - '0'; \n } while ((c = read()) >= '0' && c <= '9');\nif (neg) \n return -ret; \n return ret; \n }\npublic long nextLong() throws IOException \n { \n long ret = 0; \n byte c = read(); \n while (c <= ' ') \n c = read(); \n boolean neg = (c == '-'); \n if (neg) \n c = read(); \n do { \n ret = ret * 10 + c - '0'; \n } \n while ((c = read()) >= '0' && c <= '9'); \n if (neg) \n return -ret; \n return ret; \n }\npublic double nextDouble() throws IOException \n { \n double ret = 0, div = 1; \n byte c = read(); \n while (c <= ' ') \n c = read(); \n boolean neg = (c == '-'); \n if (neg) \n c = read();\ndo { \n ret = ret * 10 + c - '0'; \n } \n while ((c = read()) >= '0' && c <= '9');\nif (c == '.') \n { \n while ((c = read()) >= '0' && c <= '9') \n { \n ret += (c - '0') / (div *= 10); \n } \n }\nif (neg) \n return -ret; \n return ret; \n }\nprivate void fillBuffer() throws IOException \n { \n bytesRead = din.read(buffer, bufferPointer = 0, BUFFER_SIZE); \n if (bytesRead == -1) \n buffer[0] = -1; \n }\nprivate byte read() throws IOException \n { \n if (bufferPointer == bytesRead) \n fillBuffer(); \n return buffer[bufferPointer++]; \n }\npublic void close() throws IOException \n { \n if (din == null) \n return; \n din.close(); \n } \n } \n\n\n\n\n\n static Reader sc=new Reader();\n static BufferedWriter bw=new BufferedWriter(new OutputStreamWriter(System.out));\n\n public static void main(String args[])throws IOException\n {\n /*\n * For integer input: int n=inputInt();\n * For long input: long n=inputLong();\n * For double input: double n=inputDouble();\n * For String input: String s=inputString();\n * Logic goes here\n * For printing without space: print(a+\"\"); where a is a variable of any datatype\n * For printing with space: printSp(a+\"\"); where a is a variable of any datatype\n * For printing with new line: println(a+\"\"); where a is a variable of any datatype\n */\n\n\nint n=inputInt();\nlong sum=0;\n//println(n+\"\");\nfor(int i=1;i<=n;i++)\n{\n\tfor(int j=1;j<=n;j++)\n\t{\n\t\tint x=gcd(i,j);\n\n\t\tfor(int k=1;k<=n;k++)\n\t\t{\n\t\t\tsum+=gcd(x,k);\n\t\t}\n\t}\n} \nprintln(sum+\"\");\n bw.flush();\n bw.close();\n\n\t}\n public static int gcd(int a,int b)\n {\n \tif(b==0)\n \t\treturn a;\n \treturn gcd(b,a%b);\n }\n\n public static int inputInt()throws IOException\n {\n return sc.nextInt();\n }\n public static long inputLong()throws IOException\n {\n return sc.nextLong();\n }\n public static double inputDouble()throws IOException\n {\n return sc.nextDouble();\n }\n public static String inputString()throws IOException\n {\n return sc.readLine();\n }\n public static void print(String a)throws IOException\n {\n bw.write(a);\n }\n public static void printSp(String a)throws IOException\n {\n bw.write(a+\" \");\n }\n public static void println(String a)throws IOException\n {\n bw.write(a+\"\\n\");\n }\n}",
"Main"
] |
/*input
200
*/
import java.math.*;
import java.io.*;
import java.util.*;
public class Main
{
static class Reader
{
final private int BUFFER_SIZE = 1 << 16;
private DataInputStream din;
private byte[] buffer;
private int bufferPointer, bytesRead;
public Reader()
{
din = new DataInputStream(System.in);
buffer = new byte[BUFFER_SIZE];
bufferPointer = bytesRead = 0;
}
public Reader(String file_name) throws IOException
{
din = new DataInputStream(new FileInputStream(file_name));
buffer = new byte[BUFFER_SIZE];
bufferPointer = bytesRead = 0;
}
public String readLine() throws IOException
{
byte[] buf = new byte[64]; // line length
int cnt = 0, c;
while ((c = read()) != -1)
{
if (c == '\n')
break;
buf[cnt++] = (byte) c;
}
return new String(buf, 0, cnt);
}
public int nextInt() throws IOException
{
int ret = 0;
byte c = read();
while (c <= ' ')
c = read();
boolean neg = (c == '-');
if (neg)
c = read();
do
{
ret = ret * 10 + c - '0';
} while ((c = read()) >= '0' && c <= '9');
if (neg)
return -ret;
return ret;
}
public long nextLong() throws IOException
{
long ret = 0;
byte c = read();
while (c <= ' ')
c = read();
boolean neg = (c == '-');
if (neg)
c = read();
do {
ret = ret * 10 + c - '0';
}
while ((c = read()) >= '0' && c <= '9');
if (neg)
return -ret;
return ret;
}
public double nextDouble() throws IOException
{
double ret = 0, div = 1;
byte c = read();
while (c <= ' ')
c = read();
boolean neg = (c == '-');
if (neg)
c = read();
do {
ret = ret * 10 + c - '0';
}
while ((c = read()) >= '0' && c <= '9');
if (c == '.')
{
while ((c = read()) >= '0' && c <= '9')
{
ret += (c - '0') / (div *= 10);
}
}
if (neg)
return -ret;
return ret;
}
private void fillBuffer() throws IOException
{
bytesRead = din.read(buffer, bufferPointer = 0, BUFFER_SIZE);
if (bytesRead == -1)
buffer[0] = -1;
}
private byte read() throws IOException
{
if (bufferPointer == bytesRead)
fillBuffer();
return buffer[bufferPointer++];
}
public void close() throws IOException
{
if (din == null)
return;
din.close();
}
}
static Reader sc=new Reader();
static BufferedWriter bw=new BufferedWriter(new OutputStreamWriter(System.out));
public static void main(String args[])throws IOException
{
/*
* For integer input: int n=inputInt();
* For long input: long n=inputLong();
* For double input: double n=inputDouble();
* For String input: String s=inputString();
* Logic goes here
* For printing without space: print(a+""); where a is a variable of any datatype
* For printing with space: printSp(a+""); where a is a variable of any datatype
* For printing with new line: println(a+""); where a is a variable of any datatype
*/
int n=inputInt();
long sum=0;
//println(n+"");
for(int i=1;i<=n;i++)
{
for(int j=1;j<=n;j++)
{
int x=gcd(i,j);
for(int k=1;k<=n;k++)
{
sum+=gcd(x,k);
}
}
}
println(sum+"");
bw.flush();
bw.close();
}
public static int gcd(int a,int b)
{
if(b==0)
return a;
return gcd(b,a%b);
}
public static int inputInt()throws IOException
{
return sc.nextInt();
}
public static long inputLong()throws IOException
{
return sc.nextLong();
}
public static double inputDouble()throws IOException
{
return sc.nextDouble();
}
public static String inputString()throws IOException
{
return sc.readLine();
}
public static void print(String a)throws IOException
{
bw.write(a);
}
public static void printSp(String a)throws IOException
{
bw.write(a+" ");
}
public static void println(String a)throws IOException
{
bw.write(a+"\n");
}
}
|
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
41,
13,
41,
13,
17,
41,
13,
17,
41,
13,
13,
41,
13,
17,
41,
13,
41,
13,
12,
13,
30,
41,
13,
4,
18,
13,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
4,
18,
13,
13,
4,
18,
13,
13,
13,
4,
18,
18,
13,
13,
13,
12,
13,
30,
14,
2,
13,
13,
30,
38,
5,
13,
30,
4,
18,
13,
30,
0,
13,
20,
4,
18,
18,
13,
13,
17,
30,
0,
13,
18,
13,
13,
0,
13,
20,
0,
13,
20,
4,
13,
12,
13,
30,
4,
18,
20,
23,
13,
6,
13,
12,
13,
30,
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,
6,
13,
41,
13,
41,
13,
20,
17,
41,
13,
41,
13,
12,
13,
30,
0,
18,
36,
13,
13,
23,
13,
12,
13,
30,
14,
2,
13,
40,
17,
37,
20,
14,
2,
13,
13,
30,
0,
13,
17,
38,
5,
13,
30,
37,
20,
30,
0,
13,
4,
18,
13,
13,
14,
2,
13,
17,
29,
40,
17,
29,
18,
13,
40,
13,
12,
13,
30,
29,
2,
2,
2,
2,
2,
13,
17,
2,
13,
17,
2,
13,
17,
2,
13,
17,
2,
13,
40,
17,
23,
13,
12,
13,
30,
29,
2,
2,
2,
13,
17,
2,
13,
17,
2,
13,
40,
17,
23,
13,
12,
13,
30,
29,
4,
18,
13,
4,
13,
12,
13,
30,
41,
13,
20,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
0,
18,
13,
13,
4,
13,
29,
13,
23,
13,
12,
13,
30,
41,
13,
20,
13,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
18,
13,
13,
4,
13,
13,
29,
13,
23,
13,
23,
13,
12,
13,
30,
29,
4,
18,
13,
4,
13,
12,
13,
30,
41,
13,
20,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
0,
18,
13,
13,
4,
13,
29,
13,
23,
13,
12,
13,
30,
41,
13,
20,
13,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
18,
13,
13,
4,
13,
13,
29,
13,
23,
13,
23,
13,
12,
13,
30,
29,
4,
18,
13,
4,
13,
12,
13,
30,
41,
13,
20,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
0,
18,
13,
13,
4,
13,
29,
13,
23,
13,
12,
13,
30,
41,
13,
20,
13,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
18,
13,
13,
4,
13,
13,
29,
13,
23,
13,
23,
13,
12,
13,
30,
41,
13,
4,
13,
42,
4,
13,
13,
0,
13,
4,
13,
41,
13,
20,
42,
40,
4,
13,
13,
30,
4,
18,
13,
13,
0,
13,
4,
13,
29,
4,
18,
13,
12,
13,
30,
41,
13,
20,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
0,
18,
13,
13,
4,
13,
29,
13,
23,
13,
12,
13,
30,
41,
13,
4,
13,
42,
4,
13,
13,
0,
13,
4,
13,
41,
13,
20,
42,
40,
4,
13,
13,
30,
4,
18,
13,
13,
0,
13,
4,
13,
29,
4,
18,
13,
12,
13,
30,
41,
13,
20,
13,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
18,
18,
13,
13,
13,
4,
13,
29,
13,
23,
13,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
10,
11
],
[
10,
12
],
[
0,
13
],
[
13,
14
],
[
13,
15
],
[
0,
16
],
[
16,
17
],
[
16,
18
],
[
0,
19
],
[
19,
20
],
[
19,
21
],
[
0,
22
],
[
672,
23
],
[
672,
24
],
[
24,
25
],
[
672,
26
],
[
26,
27
],
[
26,
28
],
[
672,
29
],
[
29,
30
],
[
29,
31
],
[
672,
32
],
[
32,
33
],
[
32,
34
],
[
672,
35
],
[
35,
36
],
[
35,
37
],
[
672,
38
],
[
38,
39
],
[
672,
40
],
[
40,
41
],
[
672,
42
],
[
42,
43
],
[
42,
44
],
[
44,
45
],
[
45,
46
],
[
45,
47
],
[
47,
48
],
[
48,
49
],
[
44,
50
],
[
50,
51
],
[
50,
52
],
[
44,
53
],
[
53,
54
],
[
54,
55
],
[
55,
56
],
[
55,
57
],
[
53,
58
],
[
58,
59
],
[
58,
60
],
[
53,
61
],
[
61,
62
],
[
62,
63
],
[
53,
64
],
[
65,
65
],
[
65,
66
],
[
66,
67
],
[
67,
68
],
[
68,
69
],
[
68,
70
],
[
66,
71
],
[
71,
72
],
[
71,
73
],
[
66,
74
],
[
74,
75
],
[
75,
76
],
[
66,
77
],
[
78,
78
],
[
78,
79
],
[
79,
80
],
[
80,
81
],
[
81,
82
],
[
81,
83
],
[
79,
84
],
[
84,
85
],
[
84,
86
],
[
79,
87
],
[
87,
88
],
[
88,
89
],
[
79,
90
],
[
91,
91
],
[
91,
92
],
[
92,
93
],
[
92,
94
],
[
94,
95
],
[
95,
96
],
[
94,
97
],
[
94,
98
],
[
98,
99
],
[
99,
100
],
[
98,
101
],
[
98,
102
],
[
44,
103
],
[
103,
104
],
[
104,
105
],
[
105,
106
],
[
105,
107
],
[
103,
108
],
[
672,
109
],
[
109,
110
],
[
109,
111
],
[
111,
112
],
[
112,
113
],
[
113,
114
],
[
113,
115
],
[
112,
116
],
[
116,
117
],
[
117,
118
],
[
118,
119
],
[
118,
120
],
[
120,
121
],
[
121,
122
],
[
122,
123
],
[
117,
124
],
[
124,
125
],
[
125,
126
],
[
125,
127
],
[
116,
128
],
[
128,
129
],
[
129,
130
],
[
130,
131
],
[
130,
132
],
[
128,
133
],
[
112,
134
],
[
134,
135
],
[
135,
136
],
[
135,
137
],
[
137,
138
],
[
137,
139
],
[
111,
140
],
[
140,
141
],
[
140,
142
],
[
111,
143
],
[
143,
144
],
[
143,
145
],
[
111,
146
],
[
146,
147
],
[
672,
148
],
[
148,
149
],
[
148,
150
],
[
150,
151
],
[
151,
152
],
[
152,
153
],
[
148,
154
],
[
154,
155
],
[
0,
156
],
[
156,
157
],
[
156,
158
],
[
158,
159
],
[
158,
160
],
[
156,
161
],
[
161,
162
],
[
161,
163
],
[
163,
164
],
[
164,
165
],
[
165,
166
],
[
165,
167
],
[
164,
168
],
[
168,
169
],
[
163,
170
],
[
170,
171
],
[
171,
172
],
[
171,
173
],
[
171,
174
],
[
174,
175
],
[
174,
176
],
[
161,
177
],
[
177,
178
],
[
161,
179
],
[
179,
180
],
[
156,
181
],
[
181,
182
],
[
181,
183
],
[
183,
184
],
[
184,
185
],
[
185,
186
],
[
186,
187
],
[
186,
188
],
[
185,
189
],
[
189,
190
],
[
189,
191
],
[
189,
192
],
[
181,
193
],
[
193,
194
],
[
181,
195
],
[
195,
196
],
[
0,
197
],
[
197,
198
],
[
197,
199
],
[
199,
200
],
[
197,
201
],
[
201,
202
],
[
201,
203
],
[
197,
205
],
[
205,
206
],
[
197,
207
],
[
207,
208
],
[
197,
209
],
[
209,
210
],
[
209,
211
],
[
211,
212
],
[
212,
213
],
[
213,
214
],
[
213,
215
],
[
212,
216
],
[
209,
217
],
[
217,
218
],
[
197,
219
],
[
219,
220
],
[
219,
221
],
[
221,
222
],
[
222,
223
],
[
223,
224
],
[
223,
225
],
[
225,
226
],
[
222,
227
],
[
227,
228
],
[
221,
229
],
[
229,
230
],
[
230,
231
],
[
230,
232
],
[
229,
233
],
[
233,
234
],
[
234,
235
],
[
234,
236
],
[
233,
237
],
[
237,
238
],
[
238,
239
],
[
238,
240
],
[
240,
241
],
[
241,
242
],
[
237,
243
],
[
243,
244
],
[
244,
245
],
[
244,
246
],
[
246,
247
],
[
247,
248
],
[
246,
249
],
[
233,
250
],
[
250,
251
],
[
251,
252
],
[
251,
253
],
[
250,
254
],
[
254,
255
],
[
255,
256
],
[
221,
257
],
[
257,
258
],
[
258,
259
],
[
258,
260
],
[
260,
261
],
[
197,
262
],
[
262,
263
],
[
262,
264
],
[
264,
265
],
[
265,
266
],
[
269,
267
],
[
279,
268
],
[
276,
269
],
[
269,
270
],
[
270,
271
],
[
270,
272
],
[
269,
273
],
[
273,
274
],
[
273,
275
],
[
276,
276
],
[
276,
277
],
[
276,
278
],
[
279,
279
],
[
279,
280
],
[
279,
281
],
[
269,
282
],
[
282,
283
],
[
282,
284
],
[
284,
285
],
[
262,
286
],
[
286,
287
],
[
197,
288
],
[
288,
289
],
[
288,
290
],
[
290,
291
],
[
291,
292
],
[
293,
293
],
[
293,
294
],
[
294,
295
],
[
294,
296
],
[
293,
297
],
[
297,
298
],
[
297,
299
],
[
293,
300
],
[
300,
301
],
[
300,
302
],
[
302,
303
],
[
288,
304
],
[
304,
305
],
[
197,
306
],
[
306,
307
],
[
306,
308
],
[
308,
309
],
[
309,
310
],
[
310,
311
],
[
311,
312
],
[
310,
313
],
[
313,
314
],
[
197,
315
],
[
315,
316
],
[
315,
317
],
[
317,
318
],
[
318,
319
],
[
318,
320
],
[
317,
322
],
[
322,
323
],
[
323,
324
],
[
324,
325
],
[
324,
326
],
[
322,
327
],
[
327,
328
],
[
327,
329
],
[
322,
330
],
[
330,
331
],
[
331,
332
],
[
322,
333
],
[
333,
334
],
[
334,
335
],
[
335,
336
],
[
335,
337
],
[
334,
338
],
[
338,
339
],
[
317,
340
],
[
340,
341
],
[
315,
342
],
[
342,
343
],
[
197,
344
],
[
344,
345
],
[
344,
346
],
[
346,
347
],
[
347,
348
],
[
347,
349
],
[
346,
352
],
[
352,
353
],
[
353,
354
],
[
354,
355
],
[
354,
356
],
[
352,
357
],
[
357,
358
],
[
357,
359
],
[
352,
360
],
[
360,
361
],
[
361,
362
],
[
352,
363
],
[
364,
364
],
[
364,
365
],
[
365,
366
],
[
366,
367
],
[
366,
368
],
[
365,
369
],
[
369,
370
],
[
369,
371
],
[
346,
372
],
[
372,
373
],
[
344,
374
],
[
374,
375
],
[
344,
376
],
[
376,
377
],
[
197,
378
],
[
378,
379
],
[
378,
380
],
[
380,
381
],
[
381,
382
],
[
382,
383
],
[
383,
384
],
[
382,
385
],
[
385,
386
],
[
197,
387
],
[
387,
388
],
[
387,
389
],
[
389,
390
],
[
390,
391
],
[
390,
392
],
[
389,
394
],
[
394,
395
],
[
395,
396
],
[
396,
397
],
[
396,
398
],
[
394,
399
],
[
399,
400
],
[
399,
401
],
[
394,
402
],
[
402,
403
],
[
403,
404
],
[
394,
405
],
[
405,
406
],
[
406,
407
],
[
407,
408
],
[
407,
409
],
[
406,
410
],
[
410,
411
],
[
389,
412
],
[
412,
413
],
[
387,
414
],
[
414,
415
],
[
197,
416
],
[
416,
417
],
[
416,
418
],
[
418,
419
],
[
419,
420
],
[
419,
421
],
[
418,
424
],
[
424,
425
],
[
425,
426
],
[
426,
427
],
[
426,
428
],
[
424,
429
],
[
429,
430
],
[
429,
431
],
[
424,
432
],
[
432,
433
],
[
433,
434
],
[
424,
435
],
[
436,
436
],
[
436,
437
],
[
437,
438
],
[
438,
439
],
[
438,
440
],
[
437,
441
],
[
441,
442
],
[
441,
443
],
[
418,
444
],
[
444,
445
],
[
416,
446
],
[
446,
447
],
[
416,
448
],
[
448,
449
],
[
197,
450
],
[
450,
451
],
[
450,
452
],
[
452,
453
],
[
453,
454
],
[
454,
455
],
[
455,
456
],
[
454,
457
],
[
457,
458
],
[
197,
459
],
[
459,
460
],
[
459,
461
],
[
461,
462
],
[
462,
463
],
[
462,
464
],
[
461,
466
],
[
466,
467
],
[
467,
468
],
[
468,
469
],
[
468,
470
],
[
466,
471
],
[
471,
472
],
[
471,
473
],
[
466,
474
],
[
474,
475
],
[
475,
476
],
[
466,
477
],
[
477,
478
],
[
478,
479
],
[
479,
480
],
[
479,
481
],
[
478,
482
],
[
482,
483
],
[
461,
484
],
[
484,
485
],
[
459,
486
],
[
486,
487
],
[
197,
488
],
[
488,
489
],
[
488,
490
],
[
490,
491
],
[
491,
492
],
[
491,
493
],
[
490,
496
],
[
496,
497
],
[
497,
498
],
[
498,
499
],
[
498,
500
],
[
496,
501
],
[
501,
502
],
[
501,
503
],
[
496,
504
],
[
504,
505
],
[
505,
506
],
[
496,
507
],
[
508,
508
],
[
508,
509
],
[
509,
510
],
[
510,
511
],
[
510,
512
],
[
509,
513
],
[
513,
514
],
[
513,
515
],
[
490,
516
],
[
516,
517
],
[
488,
518
],
[
518,
519
],
[
488,
520
],
[
520,
521
],
[
197,
522
],
[
522,
523
],
[
522,
524
],
[
524,
525
],
[
525,
526
],
[
525,
527
],
[
527,
528
],
[
524,
529
],
[
529,
530
],
[
530,
531
],
[
530,
532
],
[
529,
533
],
[
533,
534
],
[
533,
535
],
[
535,
536
],
[
524,
537
],
[
537,
538
],
[
537,
539
],
[
524,
540
],
[
540,
541
],
[
541,
542
],
[
542,
543
],
[
542,
544
],
[
540,
545
],
[
545,
546
],
[
546,
547
],
[
547,
548
],
[
546,
549
],
[
545,
550
],
[
550,
551
],
[
550,
552
],
[
552,
553
],
[
524,
554
],
[
554,
555
],
[
555,
556
],
[
556,
557
],
[
197,
558
],
[
558,
559
],
[
558,
560
],
[
560,
561
],
[
561,
562
],
[
561,
563
],
[
560,
565
],
[
565,
566
],
[
566,
567
],
[
567,
568
],
[
567,
569
],
[
565,
570
],
[
570,
571
],
[
570,
572
],
[
565,
573
],
[
573,
574
],
[
574,
575
],
[
565,
576
],
[
576,
577
],
[
577,
578
],
[
578,
579
],
[
578,
580
],
[
577,
581
],
[
581,
582
],
[
560,
583
],
[
583,
584
],
[
558,
585
],
[
585,
586
],
[
197,
587
],
[
587,
588
],
[
587,
589
],
[
589,
590
],
[
590,
591
],
[
590,
592
],
[
592,
593
],
[
589,
594
],
[
594,
595
],
[
595,
596
],
[
595,
597
],
[
594,
598
],
[
598,
599
],
[
598,
600
],
[
600,
601
],
[
589,
602
],
[
602,
603
],
[
602,
604
],
[
589,
605
],
[
605,
606
],
[
606,
607
],
[
607,
608
],
[
607,
609
],
[
605,
610
],
[
610,
611
],
[
611,
612
],
[
612,
613
],
[
611,
614
],
[
610,
615
],
[
615,
616
],
[
615,
617
],
[
617,
618
],
[
589,
619
],
[
619,
620
],
[
620,
621
],
[
621,
622
],
[
197,
623
],
[
623,
624
],
[
623,
625
],
[
625,
626
],
[
626,
627
],
[
626,
628
],
[
625,
631
],
[
631,
632
],
[
632,
633
],
[
633,
634
],
[
633,
635
],
[
631,
636
],
[
636,
637
],
[
636,
638
],
[
631,
639
],
[
639,
640
],
[
640,
641
],
[
631,
642
],
[
643,
643
],
[
643,
644
],
[
644,
645
],
[
645,
646
],
[
646,
647
],
[
646,
648
],
[
644,
649
],
[
649,
650
],
[
649,
651
],
[
644,
652
],
[
652,
653
],
[
653,
654
],
[
644,
655
],
[
656,
656
],
[
656,
657
],
[
657,
658
],
[
658,
659
],
[
659,
660
],
[
659,
661
],
[
658,
662
],
[
657,
663
],
[
663,
664
],
[
625,
665
],
[
665,
666
],
[
623,
667
],
[
667,
668
],
[
623,
669
],
[
669,
670
],
[
0,
671
],
[
671,
672
],
[
671,
673
]
] |
[
"import java.io.InputStream;\nimport java.io.FileNotFoundException;\nimport java.util.InputMismatchException;\nimport java.io.IOException;\nimport java.io.FileInputStream;\nimport java.util.Arrays;\nimport java.io.PrintWriter;\n\npublic class Main {\n InputStream is;\n\n int __t__ = 1;\n int __f__ = 0;\n int __FILE_DEBUG_FLAG__ = __f__;\n String __DEBUG_FILE_NAME__ = \"src/F5\";\n\n FastScanner in;\n PrintWriter out;\n\n public void solve() {\n int n = in.nextInt();\n long res = 0;\n for (int i = 1; i <= n; i++) {\n for (int j = 1; j <= n; j++) {\n for (int k = 1; k <= n; k++) {\n res += MathUtil.gcd(i, MathUtil.gcd(j, k));\n }\n }\n }\n System.out.println(res);\n }\n\n public void run() {\n if (__FILE_DEBUG_FLAG__ == __t__) {\n try {\n is = new FileInputStream(__DEBUG_FILE_NAME__);\n } catch (FileNotFoundException e) {\n e.printStackTrace();\n }\n System.out.println(\"FILE_INPUT!\");\n } else {\n is = System.in;\n }\n in = new FastScanner(is);\n out = new PrintWriter(System.out);\n\n solve();\n }\n\n public static void main(final String[] args) {\n new Main().run();\n }\n}\n\nclass MathUtil {\n private MathUtil() {\n }\n\n public static long gcd(long a, long b) {\n if (b == 0) return a;\n return gcd(b, a % b);\n }\n\n public static long lcm(long a, long b) {\n return a * b / gcd(a, b);\n }\n}\n\n\nclass FastScanner {\n private InputStream stream;\n private byte[] buf = new byte[1024];\n private int curChar;\n private int numChars;\n\n public FastScanner(InputStream stream) {\n this.stream = stream;\n // stream = new FileInputStream(new File(\"dec.in\"));\n }\n\n int read() {\n if (numChars == -1)\n throw new InputMismatchException();\n if (curChar >= numChars) {\n curChar = 0;\n try {\n numChars = stream.read(buf);\n } catch (IOException e) {\n throw new InputMismatchException();\n }\n if (numChars <= 0)\n return -1;\n }\n return buf[curChar++];\n }\n\n public boolean isSpaceChar(int c) {\n return c == ' ' || c == '\\n' || c == '\\r' || c == '\\t' || c == -1;\n }\n\n public boolean isEndline(int c) {\n return c == '\\n' || c == '\\r' || c == -1;\n }\n\n public int nextInt() {\n return Integer.parseInt(next());\n }\n\n public int[] nextIntArray(int n) {\n int[] array = new int[n];\n for (int i = 0; i < n; i++)\n array[i] = nextInt();\n\n return array;\n }\n\n public int[][] nextIntMap(int n, int m) {\n int[][] map = new int[n][m];\n for (int i = 0; i < n; i++) {\n map[i] = nextIntArray(m);\n }\n return map;\n }\n\n public long nextLong() {\n return Long.parseLong(next());\n }\n\n public long[] nextLongArray(int n) {\n long[] array = new long[n];\n for (int i = 0; i < n; i++)\n array[i] = nextLong();\n\n return array;\n }\n\n public long[][] nextLongMap(int n, int m) {\n long[][] map = new long[n][m];\n for (int i = 0; i < n; i++) {\n map[i] = nextLongArray(m);\n }\n return map;\n }\n\n public double nextDouble() {\n return Double.parseDouble(next());\n }\n\n public double[] nextDoubleArray(int n) {\n double[] array = new double[n];\n for (int i = 0; i < n; i++)\n array[i] = nextDouble();\n\n return array;\n }\n\n public double[][] nextDoubleMap(int n, int m) {\n double[][] map = new double[n][m];\n for (int i = 0; i < n; i++) {\n map[i] = nextDoubleArray(m);\n }\n return map;\n }\n\n public String next() {\n int c = read();\n while (isSpaceChar(c))\n c = read();\n StringBuilder res = new StringBuilder();\n do {\n res.appendCodePoint(c);\n c = read();\n } while (!isSpaceChar(c));\n return res.toString();\n }\n\n public String[] nextStringArray(int n) {\n String[] array = new String[n];\n for (int i = 0; i < n; i++)\n array[i] = next();\n\n return array;\n }\n\n public String nextLine() {\n int c = read();\n while (isEndline(c))\n c = read();\n StringBuilder res = new StringBuilder();\n do {\n res.appendCodePoint(c);\n c = read();\n } while (!isEndline(c));\n return res.toString();\n }\n\n public int[][] nextPackedIntArrays(int packN, int size) {\n int[][] res = new int[packN][size];\n for (int i = 0; i < size; i++) {\n for (int j = 0; j < packN; j++) {\n res[j][i] = nextInt();\n }\n }\n return res;\n }\n}",
"import java.io.InputStream;",
"InputStream",
"java.io",
"import java.io.FileNotFoundException;",
"FileNotFoundException",
"java.io",
"import java.util.InputMismatchException;",
"InputMismatchException",
"java.util",
"import java.io.IOException;",
"IOException",
"java.io",
"import java.io.FileInputStream;",
"FileInputStream",
"java.io",
"import java.util.Arrays;",
"Arrays",
"java.util",
"import java.io.PrintWriter;",
"PrintWriter",
"java.io",
"public class Main {\n InputStream is;\n\n int __t__ = 1;\n int __f__ = 0;\n int __FILE_DEBUG_FLAG__ = __f__;\n String __DEBUG_FILE_NAME__ = \"src/F5\";\n\n FastScanner in;\n PrintWriter out;\n\n public void solve() {\n int n = in.nextInt();\n long res = 0;\n for (int i = 1; i <= n; i++) {\n for (int j = 1; j <= n; j++) {\n for (int k = 1; k <= n; k++) {\n res += MathUtil.gcd(i, MathUtil.gcd(j, k));\n }\n }\n }\n System.out.println(res);\n }\n\n public void run() {\n if (__FILE_DEBUG_FLAG__ == __t__) {\n try {\n is = new FileInputStream(__DEBUG_FILE_NAME__);\n } catch (FileNotFoundException e) {\n e.printStackTrace();\n }\n System.out.println(\"FILE_INPUT!\");\n } else {\n is = System.in;\n }\n in = new FastScanner(is);\n out = new PrintWriter(System.out);\n\n solve();\n }\n\n public static void main(final String[] args) {\n new Main().run();\n }\n}",
"Main",
"InputStream is;",
"is",
"int __t__ = 1;",
"__t__",
"1",
"int __f__ = 0;",
"__f__",
"0",
"int __FILE_DEBUG_FLAG__ = __f__;",
"__FILE_DEBUG_FLAG__",
"__f__",
"String __DEBUG_FILE_NAME__ = \"src/F5\";",
"__DEBUG_FILE_NAME__",
"\"src/F5\"",
"FastScanner in;",
"in",
"PrintWriter out;",
"out",
"public void solve() {\n int n = in.nextInt();\n long res = 0;\n for (int i = 1; i <= n; i++) {\n for (int j = 1; j <= n; j++) {\n for (int k = 1; k <= n; k++) {\n res += MathUtil.gcd(i, MathUtil.gcd(j, k));\n }\n }\n }\n System.out.println(res);\n }",
"solve",
"{\n int n = in.nextInt();\n long res = 0;\n for (int i = 1; i <= n; i++) {\n for (int j = 1; j <= n; j++) {\n for (int k = 1; k <= n; k++) {\n res += MathUtil.gcd(i, MathUtil.gcd(j, k));\n }\n }\n }\n System.out.println(res);\n }",
"int n = in.nextInt();",
"n",
"in.nextInt()",
"in.nextInt",
"in",
"long res = 0;",
"res",
"0",
"for (int i = 1; i <= n; i++) {\n for (int j = 1; j <= n; j++) {\n for (int k = 1; k <= n; k++) {\n res += MathUtil.gcd(i, MathUtil.gcd(j, k));\n }\n }\n }",
"int i = 1;",
"int i = 1;",
"i",
"1",
"i <= n",
"i",
"n",
"i++",
"i++",
"i",
"{\n for (int j = 1; j <= n; j++) {\n for (int k = 1; k <= n; k++) {\n res += MathUtil.gcd(i, MathUtil.gcd(j, k));\n }\n }\n }",
"{\n for (int j = 1; j <= n; j++) {\n for (int k = 1; k <= n; k++) {\n res += MathUtil.gcd(i, MathUtil.gcd(j, k));\n }\n }\n }",
"for (int j = 1; j <= n; j++) {\n for (int k = 1; k <= n; k++) {\n res += MathUtil.gcd(i, MathUtil.gcd(j, k));\n }\n }",
"int j = 1;",
"int j = 1;",
"j",
"1",
"j <= n",
"j",
"n",
"j++",
"j++",
"j",
"{\n for (int k = 1; k <= n; k++) {\n res += MathUtil.gcd(i, MathUtil.gcd(j, k));\n }\n }",
"{\n for (int k = 1; k <= n; k++) {\n res += MathUtil.gcd(i, MathUtil.gcd(j, k));\n }\n }",
"for (int k = 1; k <= n; k++) {\n res += MathUtil.gcd(i, MathUtil.gcd(j, k));\n }",
"int k = 1;",
"int k = 1;",
"k",
"1",
"k <= n",
"k",
"n",
"k++",
"k++",
"k",
"{\n res += MathUtil.gcd(i, MathUtil.gcd(j, k));\n }",
"{\n res += MathUtil.gcd(i, MathUtil.gcd(j, k));\n }",
"res += MathUtil.gcd(i, MathUtil.gcd(j, k))",
"res",
"MathUtil.gcd(i, MathUtil.gcd(j, k))",
"MathUtil.gcd",
"MathUtil",
"i",
"MathUtil.gcd(j, k)",
"MathUtil.gcd",
"MathUtil",
"j",
"k",
"System.out.println(res)",
"System.out.println",
"System.out",
"System",
"System.out",
"res",
"public void run() {\n if (__FILE_DEBUG_FLAG__ == __t__) {\n try {\n is = new FileInputStream(__DEBUG_FILE_NAME__);\n } catch (FileNotFoundException e) {\n e.printStackTrace();\n }\n System.out.println(\"FILE_INPUT!\");\n } else {\n is = System.in;\n }\n in = new FastScanner(is);\n out = new PrintWriter(System.out);\n\n solve();\n }",
"run",
"{\n if (__FILE_DEBUG_FLAG__ == __t__) {\n try {\n is = new FileInputStream(__DEBUG_FILE_NAME__);\n } catch (FileNotFoundException e) {\n e.printStackTrace();\n }\n System.out.println(\"FILE_INPUT!\");\n } else {\n is = System.in;\n }\n in = new FastScanner(is);\n out = new PrintWriter(System.out);\n\n solve();\n }",
"if (__FILE_DEBUG_FLAG__ == __t__) {\n try {\n is = new FileInputStream(__DEBUG_FILE_NAME__);\n } catch (FileNotFoundException e) {\n e.printStackTrace();\n }\n System.out.println(\"FILE_INPUT!\");\n } else {\n is = System.in;\n }",
"__FILE_DEBUG_FLAG__ == __t__",
"__FILE_DEBUG_FLAG__",
"__t__",
"{\n try {\n is = new FileInputStream(__DEBUG_FILE_NAME__);\n } catch (FileNotFoundException e) {\n e.printStackTrace();\n }\n System.out.println(\"FILE_INPUT!\");\n }",
"try {\n is = new FileInputStream(__DEBUG_FILE_NAME__);\n } catch (FileNotFoundException e) {\n e.printStackTrace();\n }",
"catch (FileNotFoundException e) {\n e.printStackTrace();\n }",
"FileNotFoundException e",
"{\n e.printStackTrace();\n }",
"e.printStackTrace()",
"e.printStackTrace",
"e",
"{\n is = new FileInputStream(__DEBUG_FILE_NAME__);\n }",
"is = new FileInputStream(__DEBUG_FILE_NAME__)",
"is",
"new FileInputStream(__DEBUG_FILE_NAME__)",
"System.out.println(\"FILE_INPUT!\")",
"System.out.println",
"System.out",
"System",
"System.out",
"\"FILE_INPUT!\"",
"{\n is = System.in;\n }",
"is = System.in",
"is",
"System.in",
"System",
"System.in",
"in = new FastScanner(is)",
"in",
"new FastScanner(is)",
"out = new PrintWriter(System.out)",
"out",
"new PrintWriter(System.out)",
"solve()",
"solve",
"public static void main(final String[] args) {\n new Main().run();\n }",
"main",
"{\n new Main().run();\n }",
"new Main().run()",
"new Main().run",
"new Main()",
"final String[] args",
"args",
"class MathUtil {\n private MathUtil() {\n }\n\n public static long gcd(long a, long b) {\n if (b == 0) return a;\n return gcd(b, a % b);\n }\n\n public static long lcm(long a, long b) {\n return a * b / gcd(a, b);\n }\n}",
"MathUtil",
"private MathUtil() {\n }",
"MathUtil",
"{\n }",
"public static long gcd(long a, long b) {\n if (b == 0) return a;\n return gcd(b, a % b);\n }",
"gcd",
"{\n if (b == 0) return a;\n return gcd(b, a % b);\n }",
"if (b == 0) return a;",
"b == 0",
"b",
"0",
"return a;",
"a",
"return gcd(b, a % b);",
"gcd(b, a % b)",
"gcd",
"b",
"a % b",
"a",
"b",
"long a",
"a",
"long b",
"b",
"public static long lcm(long a, long b) {\n return a * b / gcd(a, b);\n }",
"lcm",
"{\n return a * b / gcd(a, b);\n }",
"return a * b / gcd(a, b);",
"a * b / gcd(a, b)",
"a * b",
"a",
"b",
"gcd(a, b)",
"gcd",
"a",
"b",
"long a",
"a",
"long b",
"b",
"class FastScanner {\n private InputStream stream;\n private byte[] buf = new byte[1024];\n private int curChar;\n private int numChars;\n\n public FastScanner(InputStream stream) {\n this.stream = stream;\n // stream = new FileInputStream(new File(\"dec.in\"));\n }\n\n int read() {\n if (numChars == -1)\n throw new InputMismatchException();\n if (curChar >= numChars) {\n curChar = 0;\n try {\n numChars = stream.read(buf);\n } catch (IOException e) {\n throw new InputMismatchException();\n }\n if (numChars <= 0)\n return -1;\n }\n return buf[curChar++];\n }\n\n public boolean isSpaceChar(int c) {\n return c == ' ' || c == '\\n' || c == '\\r' || c == '\\t' || c == -1;\n }\n\n public boolean isEndline(int c) {\n return c == '\\n' || c == '\\r' || c == -1;\n }\n\n public int nextInt() {\n return Integer.parseInt(next());\n }\n\n public int[] nextIntArray(int n) {\n int[] array = new int[n];\n for (int i = 0; i < n; i++)\n array[i] = nextInt();\n\n return array;\n }\n\n public int[][] nextIntMap(int n, int m) {\n int[][] map = new int[n][m];\n for (int i = 0; i < n; i++) {\n map[i] = nextIntArray(m);\n }\n return map;\n }\n\n public long nextLong() {\n return Long.parseLong(next());\n }\n\n public long[] nextLongArray(int n) {\n long[] array = new long[n];\n for (int i = 0; i < n; i++)\n array[i] = nextLong();\n\n return array;\n }\n\n public long[][] nextLongMap(int n, int m) {\n long[][] map = new long[n][m];\n for (int i = 0; i < n; i++) {\n map[i] = nextLongArray(m);\n }\n return map;\n }\n\n public double nextDouble() {\n return Double.parseDouble(next());\n }\n\n public double[] nextDoubleArray(int n) {\n double[] array = new double[n];\n for (int i = 0; i < n; i++)\n array[i] = nextDouble();\n\n return array;\n }\n\n public double[][] nextDoubleMap(int n, int m) {\n double[][] map = new double[n][m];\n for (int i = 0; i < n; i++) {\n map[i] = nextDoubleArray(m);\n }\n return map;\n }\n\n public String next() {\n int c = read();\n while (isSpaceChar(c))\n c = read();\n StringBuilder res = new StringBuilder();\n do {\n res.appendCodePoint(c);\n c = read();\n } while (!isSpaceChar(c));\n return res.toString();\n }\n\n public String[] nextStringArray(int n) {\n String[] array = new String[n];\n for (int i = 0; i < n; i++)\n array[i] = next();\n\n return array;\n }\n\n public String nextLine() {\n int c = read();\n while (isEndline(c))\n c = read();\n StringBuilder res = new StringBuilder();\n do {\n res.appendCodePoint(c);\n c = read();\n } while (!isEndline(c));\n return res.toString();\n }\n\n public int[][] nextPackedIntArrays(int packN, int size) {\n int[][] res = new int[packN][size];\n for (int i = 0; i < size; i++) {\n for (int j = 0; j < packN; j++) {\n res[j][i] = nextInt();\n }\n }\n return res;\n }\n}",
"FastScanner",
"private InputStream stream;",
"stream",
"private byte[] buf = new byte[1024];",
"buf",
"new byte[1024]",
"1024",
"private int curChar;",
"curChar",
"private int numChars;",
"numChars",
"public FastScanner(InputStream stream) {\n this.stream = stream;\n // stream = new FileInputStream(new File(\"dec.in\"));\n }",
"FastScanner",
"{\n this.stream = stream;\n // stream = new FileInputStream(new File(\"dec.in\"));\n }",
"this.stream = stream",
"this.stream",
"this",
"this.stream",
"stream",
"InputStream stream",
"stream",
"int read() {\n if (numChars == -1)\n throw new InputMismatchException();\n if (curChar >= numChars) {\n curChar = 0;\n try {\n numChars = stream.read(buf);\n } catch (IOException e) {\n throw new InputMismatchException();\n }\n if (numChars <= 0)\n return -1;\n }\n return buf[curChar++];\n }",
"read",
"{\n if (numChars == -1)\n throw new InputMismatchException();\n if (curChar >= numChars) {\n curChar = 0;\n try {\n numChars = stream.read(buf);\n } catch (IOException e) {\n throw new InputMismatchException();\n }\n if (numChars <= 0)\n return -1;\n }\n return buf[curChar++];\n }",
"if (numChars == -1)\n throw new InputMismatchException();",
"numChars == -1",
"numChars",
"-1",
"1",
"throw new InputMismatchException();",
"new InputMismatchException()",
"if (curChar >= numChars) {\n curChar = 0;\n try {\n numChars = stream.read(buf);\n } catch (IOException e) {\n throw new InputMismatchException();\n }\n if (numChars <= 0)\n return -1;\n }",
"curChar >= numChars",
"curChar",
"numChars",
"{\n curChar = 0;\n try {\n numChars = stream.read(buf);\n } catch (IOException e) {\n throw new InputMismatchException();\n }\n if (numChars <= 0)\n return -1;\n }",
"curChar = 0",
"curChar",
"0",
"try {\n numChars = stream.read(buf);\n } catch (IOException e) {\n throw new InputMismatchException();\n }",
"catch (IOException e) {\n throw new InputMismatchException();\n }",
"IOException e",
"{\n throw new InputMismatchException();\n }",
"throw new InputMismatchException();",
"new InputMismatchException()",
"{\n numChars = stream.read(buf);\n }",
"numChars = stream.read(buf)",
"numChars",
"stream.read(buf)",
"stream.read",
"stream",
"buf",
"if (numChars <= 0)\n return -1;",
"numChars <= 0",
"numChars",
"0",
"return -1;",
"-1",
"1",
"return buf[curChar++];",
"buf[curChar++]",
"buf",
"curChar++",
"curChar",
"public boolean isSpaceChar(int c) {\n return c == ' ' || c == '\\n' || c == '\\r' || c == '\\t' || c == -1;\n }",
"isSpaceChar",
"{\n return c == ' ' || c == '\\n' || c == '\\r' || c == '\\t' || c == -1;\n }",
"return c == ' ' || c == '\\n' || c == '\\r' || c == '\\t' || c == -1;",
"c == ' ' || c == '\\n' || c == '\\r' || c == '\\t' || c == -1",
"c == '\\t'",
"c == '\\r'",
"c == ' ' || c == '\\n' || c == '\\r' || c == '\\t' || c == -1",
"c == ' '",
"c",
"' '",
"c == '\\n'",
"c",
"'\\n'",
"c == '\\r'",
"c",
"'\\r'",
"c == '\\t'",
"c",
"'\\t'",
"c == -1",
"c",
"-1",
"1",
"int c",
"c",
"public boolean isEndline(int c) {\n return c == '\\n' || c == '\\r' || c == -1;\n }",
"isEndline",
"{\n return c == '\\n' || c == '\\r' || c == -1;\n }",
"return c == '\\n' || c == '\\r' || c == -1;",
"c == '\\n' || c == '\\r' || c == -1",
"c == '\\n' || c == '\\r' || c == -1",
"c == '\\n'",
"c",
"'\\n'",
"c == '\\r'",
"c",
"'\\r'",
"c == -1",
"c",
"-1",
"1",
"int c",
"c",
"public int nextInt() {\n return Integer.parseInt(next());\n }",
"nextInt",
"{\n return Integer.parseInt(next());\n }",
"return Integer.parseInt(next());",
"Integer.parseInt(next())",
"Integer.parseInt",
"Integer",
"next()",
"next",
"public int[] nextIntArray(int n) {\n int[] array = new int[n];\n for (int i = 0; i < n; i++)\n array[i] = nextInt();\n\n return array;\n }",
"nextIntArray",
"{\n int[] array = new int[n];\n for (int i = 0; i < n; i++)\n array[i] = nextInt();\n\n return array;\n }",
"int[] array = new int[n];",
"array",
"new int[n]",
"n",
"for (int i = 0; i < n; i++)\n array[i] = nextInt();",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < n",
"i",
"n",
"i++",
"i++",
"i",
"array[i] = nextInt();",
"array[i] = nextInt()",
"array[i]",
"array",
"i",
"nextInt()",
"nextInt",
"return array;",
"array",
"int n",
"n",
"public int[][] nextIntMap(int n, int m) {\n int[][] map = new int[n][m];\n for (int i = 0; i < n; i++) {\n map[i] = nextIntArray(m);\n }\n return map;\n }",
"nextIntMap",
"{\n int[][] map = new int[n][m];\n for (int i = 0; i < n; i++) {\n map[i] = nextIntArray(m);\n }\n return map;\n }",
"int[][] map = new int[n][m];",
"map",
"new int[n][m]",
"n",
"m",
"for (int i = 0; i < n; i++) {\n map[i] = nextIntArray(m);\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < n",
"i",
"n",
"i++",
"i++",
"i",
"{\n map[i] = nextIntArray(m);\n }",
"{\n map[i] = nextIntArray(m);\n }",
"map[i] = nextIntArray(m)",
"map[i]",
"map",
"i",
"nextIntArray(m)",
"nextIntArray",
"m",
"return map;",
"map",
"int n",
"n",
"int m",
"m",
"public long nextLong() {\n return Long.parseLong(next());\n }",
"nextLong",
"{\n return Long.parseLong(next());\n }",
"return Long.parseLong(next());",
"Long.parseLong(next())",
"Long.parseLong",
"Long",
"next()",
"next",
"public long[] nextLongArray(int n) {\n long[] array = new long[n];\n for (int i = 0; i < n; i++)\n array[i] = nextLong();\n\n return array;\n }",
"nextLongArray",
"{\n long[] array = new long[n];\n for (int i = 0; i < n; i++)\n array[i] = nextLong();\n\n return array;\n }",
"long[] array = new long[n];",
"array",
"new long[n]",
"n",
"for (int i = 0; i < n; i++)\n array[i] = nextLong();",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < n",
"i",
"n",
"i++",
"i++",
"i",
"array[i] = nextLong();",
"array[i] = nextLong()",
"array[i]",
"array",
"i",
"nextLong()",
"nextLong",
"return array;",
"array",
"int n",
"n",
"public long[][] nextLongMap(int n, int m) {\n long[][] map = new long[n][m];\n for (int i = 0; i < n; i++) {\n map[i] = nextLongArray(m);\n }\n return map;\n }",
"nextLongMap",
"{\n long[][] map = new long[n][m];\n for (int i = 0; i < n; i++) {\n map[i] = nextLongArray(m);\n }\n return map;\n }",
"long[][] map = new long[n][m];",
"map",
"new long[n][m]",
"n",
"m",
"for (int i = 0; i < n; i++) {\n map[i] = nextLongArray(m);\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < n",
"i",
"n",
"i++",
"i++",
"i",
"{\n map[i] = nextLongArray(m);\n }",
"{\n map[i] = nextLongArray(m);\n }",
"map[i] = nextLongArray(m)",
"map[i]",
"map",
"i",
"nextLongArray(m)",
"nextLongArray",
"m",
"return map;",
"map",
"int n",
"n",
"int m",
"m",
"public double nextDouble() {\n return Double.parseDouble(next());\n }",
"nextDouble",
"{\n return Double.parseDouble(next());\n }",
"return Double.parseDouble(next());",
"Double.parseDouble(next())",
"Double.parseDouble",
"Double",
"next()",
"next",
"public double[] nextDoubleArray(int n) {\n double[] array = new double[n];\n for (int i = 0; i < n; i++)\n array[i] = nextDouble();\n\n return array;\n }",
"nextDoubleArray",
"{\n double[] array = new double[n];\n for (int i = 0; i < n; i++)\n array[i] = nextDouble();\n\n return array;\n }",
"double[] array = new double[n];",
"array",
"new double[n]",
"n",
"for (int i = 0; i < n; i++)\n array[i] = nextDouble();",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < n",
"i",
"n",
"i++",
"i++",
"i",
"array[i] = nextDouble();",
"array[i] = nextDouble()",
"array[i]",
"array",
"i",
"nextDouble()",
"nextDouble",
"return array;",
"array",
"int n",
"n",
"public double[][] nextDoubleMap(int n, int m) {\n double[][] map = new double[n][m];\n for (int i = 0; i < n; i++) {\n map[i] = nextDoubleArray(m);\n }\n return map;\n }",
"nextDoubleMap",
"{\n double[][] map = new double[n][m];\n for (int i = 0; i < n; i++) {\n map[i] = nextDoubleArray(m);\n }\n return map;\n }",
"double[][] map = new double[n][m];",
"map",
"new double[n][m]",
"n",
"m",
"for (int i = 0; i < n; i++) {\n map[i] = nextDoubleArray(m);\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < n",
"i",
"n",
"i++",
"i++",
"i",
"{\n map[i] = nextDoubleArray(m);\n }",
"{\n map[i] = nextDoubleArray(m);\n }",
"map[i] = nextDoubleArray(m)",
"map[i]",
"map",
"i",
"nextDoubleArray(m)",
"nextDoubleArray",
"m",
"return map;",
"map",
"int n",
"n",
"int m",
"m",
"public String next() {\n int c = read();\n while (isSpaceChar(c))\n c = read();\n StringBuilder res = new StringBuilder();\n do {\n res.appendCodePoint(c);\n c = read();\n } while (!isSpaceChar(c));\n return res.toString();\n }",
"next",
"{\n int c = read();\n while (isSpaceChar(c))\n c = read();\n StringBuilder res = new StringBuilder();\n do {\n res.appendCodePoint(c);\n c = read();\n } while (!isSpaceChar(c));\n return res.toString();\n }",
"int c = read();",
"c",
"read()",
"read",
"while (isSpaceChar(c))\n c = read();",
"isSpaceChar(c)",
"isSpaceChar",
"c",
"c = read()",
"c",
"read()",
"read",
"StringBuilder res = new StringBuilder();",
"res",
"new StringBuilder()",
"do {\n res.appendCodePoint(c);\n c = read();\n } while (!isSpaceChar(c));",
"!isSpaceChar(c)",
"isSpaceChar(c)",
"isSpaceChar",
"c",
"{\n res.appendCodePoint(c);\n c = read();\n }",
"res.appendCodePoint(c)",
"res.appendCodePoint",
"res",
"c",
"c = read()",
"c",
"read()",
"read",
"return res.toString();",
"res.toString()",
"res.toString",
"res",
"public String[] nextStringArray(int n) {\n String[] array = new String[n];\n for (int i = 0; i < n; i++)\n array[i] = next();\n\n return array;\n }",
"nextStringArray",
"{\n String[] array = new String[n];\n for (int i = 0; i < n; i++)\n array[i] = next();\n\n return array;\n }",
"String[] array = new String[n];",
"array",
"new String[n]",
"n",
"for (int i = 0; i < n; i++)\n array[i] = next();",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < n",
"i",
"n",
"i++",
"i++",
"i",
"array[i] = next();",
"array[i] = next()",
"array[i]",
"array",
"i",
"next()",
"next",
"return array;",
"array",
"int n",
"n",
"public String nextLine() {\n int c = read();\n while (isEndline(c))\n c = read();\n StringBuilder res = new StringBuilder();\n do {\n res.appendCodePoint(c);\n c = read();\n } while (!isEndline(c));\n return res.toString();\n }",
"nextLine",
"{\n int c = read();\n while (isEndline(c))\n c = read();\n StringBuilder res = new StringBuilder();\n do {\n res.appendCodePoint(c);\n c = read();\n } while (!isEndline(c));\n return res.toString();\n }",
"int c = read();",
"c",
"read()",
"read",
"while (isEndline(c))\n c = read();",
"isEndline(c)",
"isEndline",
"c",
"c = read()",
"c",
"read()",
"read",
"StringBuilder res = new StringBuilder();",
"res",
"new StringBuilder()",
"do {\n res.appendCodePoint(c);\n c = read();\n } while (!isEndline(c));",
"!isEndline(c)",
"isEndline(c)",
"isEndline",
"c",
"{\n res.appendCodePoint(c);\n c = read();\n }",
"res.appendCodePoint(c)",
"res.appendCodePoint",
"res",
"c",
"c = read()",
"c",
"read()",
"read",
"return res.toString();",
"res.toString()",
"res.toString",
"res",
"public int[][] nextPackedIntArrays(int packN, int size) {\n int[][] res = new int[packN][size];\n for (int i = 0; i < size; i++) {\n for (int j = 0; j < packN; j++) {\n res[j][i] = nextInt();\n }\n }\n return res;\n }",
"nextPackedIntArrays",
"{\n int[][] res = new int[packN][size];\n for (int i = 0; i < size; i++) {\n for (int j = 0; j < packN; j++) {\n res[j][i] = nextInt();\n }\n }\n return res;\n }",
"int[][] res = new int[packN][size];",
"res",
"new int[packN][size]",
"packN",
"size",
"for (int i = 0; i < size; i++) {\n for (int j = 0; j < packN; j++) {\n res[j][i] = nextInt();\n }\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < size",
"i",
"size",
"i++",
"i++",
"i",
"{\n for (int j = 0; j < packN; j++) {\n res[j][i] = nextInt();\n }\n }",
"{\n for (int j = 0; j < packN; j++) {\n res[j][i] = nextInt();\n }\n }",
"for (int j = 0; j < packN; j++) {\n res[j][i] = nextInt();\n }",
"int j = 0;",
"int j = 0;",
"j",
"0",
"j < packN",
"j",
"packN",
"j++",
"j++",
"j",
"{\n res[j][i] = nextInt();\n }",
"{\n res[j][i] = nextInt();\n }",
"res[j][i] = nextInt()",
"res[j][i]",
"res[j]",
"res",
"j",
"i",
"nextInt()",
"nextInt",
"return res;",
"res",
"int packN",
"packN",
"int size",
"size",
"public class Main {\n InputStream is;\n\n int __t__ = 1;\n int __f__ = 0;\n int __FILE_DEBUG_FLAG__ = __f__;\n String __DEBUG_FILE_NAME__ = \"src/F5\";\n\n FastScanner in;\n PrintWriter out;\n\n public void solve() {\n int n = in.nextInt();\n long res = 0;\n for (int i = 1; i <= n; i++) {\n for (int j = 1; j <= n; j++) {\n for (int k = 1; k <= n; k++) {\n res += MathUtil.gcd(i, MathUtil.gcd(j, k));\n }\n }\n }\n System.out.println(res);\n }\n\n public void run() {\n if (__FILE_DEBUG_FLAG__ == __t__) {\n try {\n is = new FileInputStream(__DEBUG_FILE_NAME__);\n } catch (FileNotFoundException e) {\n e.printStackTrace();\n }\n System.out.println(\"FILE_INPUT!\");\n } else {\n is = System.in;\n }\n in = new FastScanner(is);\n out = new PrintWriter(System.out);\n\n solve();\n }\n\n public static void main(final String[] args) {\n new Main().run();\n }\n}",
"public class Main {\n InputStream is;\n\n int __t__ = 1;\n int __f__ = 0;\n int __FILE_DEBUG_FLAG__ = __f__;\n String __DEBUG_FILE_NAME__ = \"src/F5\";\n\n FastScanner in;\n PrintWriter out;\n\n public void solve() {\n int n = in.nextInt();\n long res = 0;\n for (int i = 1; i <= n; i++) {\n for (int j = 1; j <= n; j++) {\n for (int k = 1; k <= n; k++) {\n res += MathUtil.gcd(i, MathUtil.gcd(j, k));\n }\n }\n }\n System.out.println(res);\n }\n\n public void run() {\n if (__FILE_DEBUG_FLAG__ == __t__) {\n try {\n is = new FileInputStream(__DEBUG_FILE_NAME__);\n } catch (FileNotFoundException e) {\n e.printStackTrace();\n }\n System.out.println(\"FILE_INPUT!\");\n } else {\n is = System.in;\n }\n in = new FastScanner(is);\n out = new PrintWriter(System.out);\n\n solve();\n }\n\n public static void main(final String[] args) {\n new Main().run();\n }\n}",
"Main"
] |
import java.io.InputStream;
import java.io.FileNotFoundException;
import java.util.InputMismatchException;
import java.io.IOException;
import java.io.FileInputStream;
import java.util.Arrays;
import java.io.PrintWriter;
public class Main {
InputStream is;
int __t__ = 1;
int __f__ = 0;
int __FILE_DEBUG_FLAG__ = __f__;
String __DEBUG_FILE_NAME__ = "src/F5";
FastScanner in;
PrintWriter out;
public void solve() {
int n = in.nextInt();
long res = 0;
for (int i = 1; i <= n; i++) {
for (int j = 1; j <= n; j++) {
for (int k = 1; k <= n; k++) {
res += MathUtil.gcd(i, MathUtil.gcd(j, k));
}
}
}
System.out.println(res);
}
public void run() {
if (__FILE_DEBUG_FLAG__ == __t__) {
try {
is = new FileInputStream(__DEBUG_FILE_NAME__);
} catch (FileNotFoundException e) {
e.printStackTrace();
}
System.out.println("FILE_INPUT!");
} else {
is = System.in;
}
in = new FastScanner(is);
out = new PrintWriter(System.out);
solve();
}
public static void main(final String[] args) {
new Main().run();
}
}
class MathUtil {
private MathUtil() {
}
public static long gcd(long a, long b) {
if (b == 0) return a;
return gcd(b, a % b);
}
public static long lcm(long a, long b) {
return a * b / gcd(a, b);
}
}
class FastScanner {
private InputStream stream;
private byte[] buf = new byte[1024];
private int curChar;
private int numChars;
public FastScanner(InputStream stream) {
this.stream = stream;
// stream = new FileInputStream(new File("dec.in"));
}
int read() {
if (numChars == -1)
throw new InputMismatchException();
if (curChar >= numChars) {
curChar = 0;
try {
numChars = stream.read(buf);
} catch (IOException e) {
throw new InputMismatchException();
}
if (numChars <= 0)
return -1;
}
return buf[curChar++];
}
public boolean isSpaceChar(int c) {
return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
}
public boolean isEndline(int c) {
return c == '\n' || c == '\r' || c == -1;
}
public int nextInt() {
return Integer.parseInt(next());
}
public int[] nextIntArray(int n) {
int[] array = new int[n];
for (int i = 0; i < n; i++)
array[i] = nextInt();
return array;
}
public int[][] nextIntMap(int n, int m) {
int[][] map = new int[n][m];
for (int i = 0; i < n; i++) {
map[i] = nextIntArray(m);
}
return map;
}
public long nextLong() {
return Long.parseLong(next());
}
public long[] nextLongArray(int n) {
long[] array = new long[n];
for (int i = 0; i < n; i++)
array[i] = nextLong();
return array;
}
public long[][] nextLongMap(int n, int m) {
long[][] map = new long[n][m];
for (int i = 0; i < n; i++) {
map[i] = nextLongArray(m);
}
return map;
}
public double nextDouble() {
return Double.parseDouble(next());
}
public double[] nextDoubleArray(int n) {
double[] array = new double[n];
for (int i = 0; i < n; i++)
array[i] = nextDouble();
return array;
}
public double[][] nextDoubleMap(int n, int m) {
double[][] map = new double[n][m];
for (int i = 0; i < n; i++) {
map[i] = nextDoubleArray(m);
}
return map;
}
public String next() {
int c = read();
while (isSpaceChar(c))
c = read();
StringBuilder res = new StringBuilder();
do {
res.appendCodePoint(c);
c = read();
} while (!isSpaceChar(c));
return res.toString();
}
public String[] nextStringArray(int n) {
String[] array = new String[n];
for (int i = 0; i < n; i++)
array[i] = next();
return array;
}
public String nextLine() {
int c = read();
while (isEndline(c))
c = read();
StringBuilder res = new StringBuilder();
do {
res.appendCodePoint(c);
c = read();
} while (!isEndline(c));
return res.toString();
}
public int[][] nextPackedIntArrays(int packN, int size) {
int[][] res = new int[packN][size];
for (int i = 0; i < size; i++) {
for (int j = 0; j < packN; j++) {
res[j][i] = nextInt();
}
}
return res;
}
}
|
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
20,
13,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
18,
18,
13,
13,
13,
4,
13,
2,
13,
17,
2,
13,
17,
41,
13,
20,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
41,
13,
4,
13,
13,
13,
40,
18,
13,
2,
13,
17,
41,
13,
20,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
41,
13,
4,
13,
13,
13,
0,
18,
13,
2,
13,
17,
2,
4,
13,
13,
13,
18,
13,
2,
13,
17,
4,
18,
18,
13,
13,
4,
18,
4,
18,
13,
13,
23,
13,
12,
13,
30,
14,
2,
13,
13,
29,
4,
13,
13,
13,
14,
2,
13,
17,
29,
13,
29,
4,
13,
13,
2,
13,
13,
23,
13,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
199,
5
],
[
199,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
8,
17
],
[
17,
18
],
[
17,
19
],
[
8,
22
],
[
22,
23
],
[
23,
24
],
[
24,
25
],
[
24,
26
],
[
22,
27
],
[
27,
28
],
[
27,
29
],
[
22,
30
],
[
30,
31
],
[
31,
32
],
[
22,
33
],
[
34,
34
],
[
34,
35
],
[
35,
36
],
[
36,
37
],
[
37,
38
],
[
37,
39
],
[
35,
40
],
[
40,
41
],
[
40,
42
],
[
35,
43
],
[
43,
44
],
[
44,
45
],
[
35,
46
],
[
47,
47
],
[
47,
48
],
[
48,
49
],
[
49,
50
],
[
50,
51
],
[
50,
52
],
[
49,
53
],
[
48,
54
],
[
54,
55
],
[
54,
56
],
[
56,
57
],
[
56,
58
],
[
54,
59
],
[
59,
60
],
[
59,
61
],
[
8,
62
],
[
62,
63
],
[
62,
64
],
[
8,
66
],
[
66,
67
],
[
67,
68
],
[
68,
69
],
[
68,
70
],
[
66,
71
],
[
71,
72
],
[
71,
73
],
[
66,
74
],
[
74,
75
],
[
75,
76
],
[
66,
77
],
[
78,
78
],
[
78,
79
],
[
79,
80
],
[
80,
81
],
[
81,
82
],
[
81,
83
],
[
79,
84
],
[
84,
85
],
[
84,
86
],
[
79,
87
],
[
87,
88
],
[
88,
89
],
[
79,
90
],
[
91,
91
],
[
91,
92
],
[
92,
93
],
[
92,
94
],
[
94,
95
],
[
94,
96
],
[
94,
97
],
[
91,
98
],
[
98,
99
],
[
99,
100
],
[
99,
101
],
[
101,
102
],
[
101,
103
],
[
8,
104
],
[
104,
105
],
[
104,
106
],
[
8,
108
],
[
108,
109
],
[
109,
110
],
[
110,
111
],
[
110,
112
],
[
108,
113
],
[
113,
114
],
[
113,
115
],
[
108,
116
],
[
116,
117
],
[
117,
118
],
[
108,
119
],
[
120,
120
],
[
120,
121
],
[
121,
122
],
[
122,
123
],
[
123,
124
],
[
123,
125
],
[
121,
126
],
[
126,
127
],
[
126,
128
],
[
121,
129
],
[
129,
130
],
[
130,
131
],
[
121,
132
],
[
133,
133
],
[
133,
134
],
[
134,
135
],
[
134,
136
],
[
136,
137
],
[
136,
138
],
[
136,
139
],
[
133,
140
],
[
140,
141
],
[
141,
142
],
[
141,
143
],
[
143,
144
],
[
143,
145
],
[
140,
146
],
[
146,
147
],
[
147,
148
],
[
147,
149
],
[
147,
150
],
[
146,
151
],
[
151,
152
],
[
151,
153
],
[
153,
154
],
[
153,
155
],
[
8,
156
],
[
156,
157
],
[
157,
158
],
[
158,
159
],
[
158,
160
],
[
156,
161
],
[
161,
162
],
[
162,
163
],
[
163,
164
],
[
164,
165
],
[
163,
166
],
[
6,
167
],
[
167,
168
],
[
199,
169
],
[
169,
170
],
[
169,
171
],
[
171,
172
],
[
172,
173
],
[
173,
174
],
[
173,
175
],
[
172,
176
],
[
176,
177
],
[
177,
178
],
[
177,
179
],
[
177,
180
],
[
171,
181
],
[
181,
182
],
[
182,
183
],
[
182,
184
],
[
181,
185
],
[
185,
186
],
[
171,
187
],
[
187,
188
],
[
188,
189
],
[
188,
190
],
[
188,
191
],
[
191,
192
],
[
191,
193
],
[
169,
194
],
[
194,
195
],
[
169,
196
],
[
196,
197
],
[
0,
198
],
[
198,
199
],
[
198,
200
]
] |
[
"import java.util.*;\n\npublic class Main {\n public static void main(String... args) {\n Scanner scanner = new Scanner(System.in);\n int K = scanner.nextInt();\n\n // K * Kの最大公約数を出しておくマップ\n int[][] gmap = new int[K][K];\n\n for (int i = 0; i < K; i++) {\n for (int j = 0; j < K; j++) {\n gmap[i][j] = gcd(i + 1, j + 1);\n }\n }\n\n // GCD, 個数\n int[] rightGcdMap = new int[K];\n\n for (int i = 1; i <= K; i++) {\n for (int j = 1; j <= K; j++) {\n int gcd = gcd(i, j);\n\n rightGcdMap[gcd - 1]++;\n }\n }\n\n int[] leftGcdMap = new int[K];\n for (int i = 1; i <= K; i++) {\n for (int j = 1; j <= K; j++) {\n int gcd = gcd(i, j);\n\n leftGcdMap[gcd - 1] += gcd(i, j) * rightGcdMap[j - 1];\n }\n }\n\n\n System.out.println(Arrays.stream(leftGcdMap).sum());\n }\n\n private static int gcd(int m, int n) {\n if(m < n) return gcd(n, m);\n if(n == 0) return m;\n return gcd(n, m % n);\n }\n}",
"import java.util.*;",
"util.*",
"java",
"public class Main {\n public static void main(String... args) {\n Scanner scanner = new Scanner(System.in);\n int K = scanner.nextInt();\n\n // K * Kの最大公約数を出しておくマップ\n int[][] gmap = new int[K][K];\n\n for (int i = 0; i < K; i++) {\n for (int j = 0; j < K; j++) {\n gmap[i][j] = gcd(i + 1, j + 1);\n }\n }\n\n // GCD, 個数\n int[] rightGcdMap = new int[K];\n\n for (int i = 1; i <= K; i++) {\n for (int j = 1; j <= K; j++) {\n int gcd = gcd(i, j);\n\n rightGcdMap[gcd - 1]++;\n }\n }\n\n int[] leftGcdMap = new int[K];\n for (int i = 1; i <= K; i++) {\n for (int j = 1; j <= K; j++) {\n int gcd = gcd(i, j);\n\n leftGcdMap[gcd - 1] += gcd(i, j) * rightGcdMap[j - 1];\n }\n }\n\n\n System.out.println(Arrays.stream(leftGcdMap).sum());\n }\n\n private static int gcd(int m, int n) {\n if(m < n) return gcd(n, m);\n if(n == 0) return m;\n return gcd(n, m % n);\n }\n}",
"Main",
"public static void main(String... args) {\n Scanner scanner = new Scanner(System.in);\n int K = scanner.nextInt();\n\n // K * Kの最大公約数を出しておくマップ\n int[][] gmap = new int[K][K];\n\n for (int i = 0; i < K; i++) {\n for (int j = 0; j < K; j++) {\n gmap[i][j] = gcd(i + 1, j + 1);\n }\n }\n\n // GCD, 個数\n int[] rightGcdMap = new int[K];\n\n for (int i = 1; i <= K; i++) {\n for (int j = 1; j <= K; j++) {\n int gcd = gcd(i, j);\n\n rightGcdMap[gcd - 1]++;\n }\n }\n\n int[] leftGcdMap = new int[K];\n for (int i = 1; i <= K; i++) {\n for (int j = 1; j <= K; j++) {\n int gcd = gcd(i, j);\n\n leftGcdMap[gcd - 1] += gcd(i, j) * rightGcdMap[j - 1];\n }\n }\n\n\n System.out.println(Arrays.stream(leftGcdMap).sum());\n }",
"main",
"{\n Scanner scanner = new Scanner(System.in);\n int K = scanner.nextInt();\n\n // K * Kの最大公約数を出しておくマップ\n int[][] gmap = new int[K][K];\n\n for (int i = 0; i < K; i++) {\n for (int j = 0; j < K; j++) {\n gmap[i][j] = gcd(i + 1, j + 1);\n }\n }\n\n // GCD, 個数\n int[] rightGcdMap = new int[K];\n\n for (int i = 1; i <= K; i++) {\n for (int j = 1; j <= K; j++) {\n int gcd = gcd(i, j);\n\n rightGcdMap[gcd - 1]++;\n }\n }\n\n int[] leftGcdMap = new int[K];\n for (int i = 1; i <= K; i++) {\n for (int j = 1; j <= K; j++) {\n int gcd = gcd(i, j);\n\n leftGcdMap[gcd - 1] += gcd(i, j) * rightGcdMap[j - 1];\n }\n }\n\n\n System.out.println(Arrays.stream(leftGcdMap).sum());\n }",
"Scanner scanner = new Scanner(System.in);",
"scanner",
"new Scanner(System.in)",
"int K = scanner.nextInt();",
"K",
"scanner.nextInt()",
"scanner.nextInt",
"scanner",
"int[][] gmap = new int[K][K];",
"gmap",
"new int[K][K]",
"K",
"K",
"for (int i = 0; i < K; i++) {\n for (int j = 0; j < K; j++) {\n gmap[i][j] = gcd(i + 1, j + 1);\n }\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < K",
"i",
"K",
"i++",
"i++",
"i",
"{\n for (int j = 0; j < K; j++) {\n gmap[i][j] = gcd(i + 1, j + 1);\n }\n }",
"{\n for (int j = 0; j < K; j++) {\n gmap[i][j] = gcd(i + 1, j + 1);\n }\n }",
"for (int j = 0; j < K; j++) {\n gmap[i][j] = gcd(i + 1, j + 1);\n }",
"int j = 0;",
"int j = 0;",
"j",
"0",
"j < K",
"j",
"K",
"j++",
"j++",
"j",
"{\n gmap[i][j] = gcd(i + 1, j + 1);\n }",
"{\n gmap[i][j] = gcd(i + 1, j + 1);\n }",
"gmap[i][j] = gcd(i + 1, j + 1)",
"gmap[i][j]",
"gmap[i]",
"gmap",
"i",
"j",
"gcd(i + 1, j + 1)",
"gcd",
"i + 1",
"i",
"1",
"j + 1",
"j",
"1",
"int[] rightGcdMap = new int[K];",
"rightGcdMap",
"new int[K]",
"K",
"for (int i = 1; i <= K; i++) {\n for (int j = 1; j <= K; j++) {\n int gcd = gcd(i, j);\n\n rightGcdMap[gcd - 1]++;\n }\n }",
"int i = 1;",
"int i = 1;",
"i",
"1",
"i <= K",
"i",
"K",
"i++",
"i++",
"i",
"{\n for (int j = 1; j <= K; j++) {\n int gcd = gcd(i, j);\n\n rightGcdMap[gcd - 1]++;\n }\n }",
"{\n for (int j = 1; j <= K; j++) {\n int gcd = gcd(i, j);\n\n rightGcdMap[gcd - 1]++;\n }\n }",
"for (int j = 1; j <= K; j++) {\n int gcd = gcd(i, j);\n\n rightGcdMap[gcd - 1]++;\n }",
"int j = 1;",
"int j = 1;",
"j",
"1",
"j <= K",
"j",
"K",
"j++",
"j++",
"j",
"{\n int gcd = gcd(i, j);\n\n rightGcdMap[gcd - 1]++;\n }",
"{\n int gcd = gcd(i, j);\n\n rightGcdMap[gcd - 1]++;\n }",
"int gcd = gcd(i, j);",
"gcd",
"gcd(i, j)",
"gcd",
"i",
"j",
"rightGcdMap[gcd - 1]++",
"rightGcdMap[gcd - 1]",
"rightGcdMap",
"gcd - 1",
"gcd",
"1",
"int[] leftGcdMap = new int[K];",
"leftGcdMap",
"new int[K]",
"K",
"for (int i = 1; i <= K; i++) {\n for (int j = 1; j <= K; j++) {\n int gcd = gcd(i, j);\n\n leftGcdMap[gcd - 1] += gcd(i, j) * rightGcdMap[j - 1];\n }\n }",
"int i = 1;",
"int i = 1;",
"i",
"1",
"i <= K",
"i",
"K",
"i++",
"i++",
"i",
"{\n for (int j = 1; j <= K; j++) {\n int gcd = gcd(i, j);\n\n leftGcdMap[gcd - 1] += gcd(i, j) * rightGcdMap[j - 1];\n }\n }",
"{\n for (int j = 1; j <= K; j++) {\n int gcd = gcd(i, j);\n\n leftGcdMap[gcd - 1] += gcd(i, j) * rightGcdMap[j - 1];\n }\n }",
"for (int j = 1; j <= K; j++) {\n int gcd = gcd(i, j);\n\n leftGcdMap[gcd - 1] += gcd(i, j) * rightGcdMap[j - 1];\n }",
"int j = 1;",
"int j = 1;",
"j",
"1",
"j <= K",
"j",
"K",
"j++",
"j++",
"j",
"{\n int gcd = gcd(i, j);\n\n leftGcdMap[gcd - 1] += gcd(i, j) * rightGcdMap[j - 1];\n }",
"{\n int gcd = gcd(i, j);\n\n leftGcdMap[gcd - 1] += gcd(i, j) * rightGcdMap[j - 1];\n }",
"int gcd = gcd(i, j);",
"gcd",
"gcd(i, j)",
"gcd",
"i",
"j",
"leftGcdMap[gcd - 1] += gcd(i, j) * rightGcdMap[j - 1]",
"leftGcdMap[gcd - 1]",
"leftGcdMap",
"gcd - 1",
"gcd",
"1",
"gcd(i, j) * rightGcdMap[j - 1]",
"gcd(i, j)",
"gcd",
"i",
"j",
"rightGcdMap[j - 1]",
"rightGcdMap",
"j - 1",
"j",
"1",
"System.out.println(Arrays.stream(leftGcdMap).sum())",
"System.out.println",
"System.out",
"System",
"System.out",
"Arrays.stream(leftGcdMap).sum()",
"Arrays.stream(leftGcdMap).sum",
"Arrays.stream(leftGcdMap)",
"Arrays.stream",
"Arrays",
"leftGcdMap",
"String... args",
"args",
"private static int gcd(int m, int n) {\n if(m < n) return gcd(n, m);\n if(n == 0) return m;\n return gcd(n, m % n);\n }",
"gcd",
"{\n if(m < n) return gcd(n, m);\n if(n == 0) return m;\n return gcd(n, m % n);\n }",
"if(m < n) return gcd(n, m);",
"m < n",
"m",
"n",
"return gcd(n, m);",
"gcd(n, m)",
"gcd",
"n",
"m",
"if(n == 0) return m;",
"n == 0",
"n",
"0",
"return m;",
"m",
"return gcd(n, m % n);",
"gcd(n, m % n)",
"gcd",
"n",
"m % n",
"m",
"n",
"int m",
"m",
"int n",
"n",
"public class Main {\n public static void main(String... args) {\n Scanner scanner = new Scanner(System.in);\n int K = scanner.nextInt();\n\n // K * Kの最大公約数を出しておくマップ\n int[][] gmap = new int[K][K];\n\n for (int i = 0; i < K; i++) {\n for (int j = 0; j < K; j++) {\n gmap[i][j] = gcd(i + 1, j + 1);\n }\n }\n\n // GCD, 個数\n int[] rightGcdMap = new int[K];\n\n for (int i = 1; i <= K; i++) {\n for (int j = 1; j <= K; j++) {\n int gcd = gcd(i, j);\n\n rightGcdMap[gcd - 1]++;\n }\n }\n\n int[] leftGcdMap = new int[K];\n for (int i = 1; i <= K; i++) {\n for (int j = 1; j <= K; j++) {\n int gcd = gcd(i, j);\n\n leftGcdMap[gcd - 1] += gcd(i, j) * rightGcdMap[j - 1];\n }\n }\n\n\n System.out.println(Arrays.stream(leftGcdMap).sum());\n }\n\n private static int gcd(int m, int n) {\n if(m < n) return gcd(n, m);\n if(n == 0) return m;\n return gcd(n, m % n);\n }\n}",
"public class Main {\n public static void main(String... args) {\n Scanner scanner = new Scanner(System.in);\n int K = scanner.nextInt();\n\n // K * Kの最大公約数を出しておくマップ\n int[][] gmap = new int[K][K];\n\n for (int i = 0; i < K; i++) {\n for (int j = 0; j < K; j++) {\n gmap[i][j] = gcd(i + 1, j + 1);\n }\n }\n\n // GCD, 個数\n int[] rightGcdMap = new int[K];\n\n for (int i = 1; i <= K; i++) {\n for (int j = 1; j <= K; j++) {\n int gcd = gcd(i, j);\n\n rightGcdMap[gcd - 1]++;\n }\n }\n\n int[] leftGcdMap = new int[K];\n for (int i = 1; i <= K; i++) {\n for (int j = 1; j <= K; j++) {\n int gcd = gcd(i, j);\n\n leftGcdMap[gcd - 1] += gcd(i, j) * rightGcdMap[j - 1];\n }\n }\n\n\n System.out.println(Arrays.stream(leftGcdMap).sum());\n }\n\n private static int gcd(int m, int n) {\n if(m < n) return gcd(n, m);\n if(n == 0) return m;\n return gcd(n, m % n);\n }\n}",
"Main"
] |
import java.util.*;
public class Main {
public static void main(String... args) {
Scanner scanner = new Scanner(System.in);
int K = scanner.nextInt();
// K * Kの最大公約数を出しておくマップ
int[][] gmap = new int[K][K];
for (int i = 0; i < K; i++) {
for (int j = 0; j < K; j++) {
gmap[i][j] = gcd(i + 1, j + 1);
}
}
// GCD, 個数
int[] rightGcdMap = new int[K];
for (int i = 1; i <= K; i++) {
for (int j = 1; j <= K; j++) {
int gcd = gcd(i, j);
rightGcdMap[gcd - 1]++;
}
}
int[] leftGcdMap = new int[K];
for (int i = 1; i <= K; i++) {
for (int j = 1; j <= K; j++) {
int gcd = gcd(i, j);
leftGcdMap[gcd - 1] += gcd(i, j) * rightGcdMap[j - 1];
}
}
System.out.println(Arrays.stream(leftGcdMap).sum());
}
private static int gcd(int m, int n) {
if(m < n) return gcd(n, m);
if(n == 0) return m;
return gcd(n, m % n);
}
}
|
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
17,
41,
13,
17,
42,
2,
13,
17,
30,
14,
2,
13,
13,
30,
0,
13,
2,
13,
13,
14,
2,
13,
13,
30,
0,
13,
2,
13,
13,
30,
0,
13,
13,
42,
2,
13,
17,
30,
14,
2,
13,
13,
30,
0,
13,
2,
13,
13,
14,
2,
13,
13,
30,
0,
13,
2,
13,
13,
30,
0,
13,
13,
29,
13,
23,
13,
23,
13,
23,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
2,
13,
17,
1,
40,
13,
30,
30,
11,
1,
41,
13,
17,
2,
13,
2,
13,
17,
1,
40,
13,
30,
30,
11,
1,
41,
13,
17,
2,
13,
2,
13,
17,
1,
40,
13,
30,
30,
0,
13,
4,
13,
13,
13,
13,
4,
18,
18,
13,
13,
13,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
156,
5
],
[
156,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
8,
15
],
[
15,
16
],
[
16,
17
],
[
16,
18
],
[
15,
19
],
[
19,
20
],
[
20,
21
],
[
21,
22
],
[
21,
23
],
[
20,
24
],
[
24,
25
],
[
25,
26
],
[
25,
27
],
[
27,
28
],
[
27,
29
],
[
20,
30
],
[
30,
31
],
[
31,
32
],
[
31,
33
],
[
30,
34
],
[
34,
35
],
[
35,
36
],
[
35,
37
],
[
37,
38
],
[
37,
39
],
[
30,
40
],
[
40,
41
],
[
41,
42
],
[
41,
43
],
[
8,
44
],
[
44,
45
],
[
45,
46
],
[
45,
47
],
[
44,
48
],
[
48,
49
],
[
49,
50
],
[
50,
51
],
[
50,
52
],
[
49,
53
],
[
53,
54
],
[
54,
55
],
[
54,
56
],
[
56,
57
],
[
56,
58
],
[
49,
59
],
[
59,
60
],
[
60,
61
],
[
60,
62
],
[
59,
63
],
[
63,
64
],
[
64,
65
],
[
64,
66
],
[
66,
67
],
[
66,
68
],
[
59,
69
],
[
69,
70
],
[
70,
71
],
[
70,
72
],
[
8,
73
],
[
73,
74
],
[
6,
75
],
[
75,
76
],
[
6,
77
],
[
77,
78
],
[
6,
79
],
[
79,
80
],
[
156,
81
],
[
81,
82
],
[
81,
83
],
[
83,
84
],
[
84,
85
],
[
84,
86
],
[
83,
87
],
[
87,
88
],
[
87,
89
],
[
89,
90
],
[
90,
91
],
[
83,
92
],
[
92,
93
],
[
92,
94
],
[
83,
95
],
[
95,
96
],
[
96,
97
],
[
97,
98
],
[
97,
99
],
[
95,
100
],
[
100,
101
],
[
100,
102
],
[
102,
103
],
[
102,
104
],
[
95,
105
],
[
105,
106
],
[
106,
107
],
[
95,
108
],
[
109,
109
],
[
109,
110
],
[
110,
111
],
[
111,
112
],
[
112,
113
],
[
112,
114
],
[
110,
115
],
[
115,
116
],
[
115,
117
],
[
117,
118
],
[
117,
119
],
[
110,
120
],
[
120,
121
],
[
121,
122
],
[
110,
123
],
[
124,
124
],
[
124,
125
],
[
125,
126
],
[
126,
127
],
[
127,
128
],
[
127,
129
],
[
125,
130
],
[
130,
131
],
[
130,
132
],
[
132,
133
],
[
132,
134
],
[
125,
135
],
[
135,
136
],
[
136,
137
],
[
125,
138
],
[
139,
139
],
[
139,
140
],
[
140,
141
],
[
140,
142
],
[
142,
143
],
[
142,
144
],
[
142,
145
],
[
142,
146
],
[
83,
147
],
[
147,
148
],
[
148,
149
],
[
149,
150
],
[
149,
151
],
[
147,
152
],
[
81,
153
],
[
153,
154
],
[
0,
155
],
[
155,
156
],
[
155,
157
]
] |
[
"import java.util.Scanner;\npublic class Main {\n\tpublic static int gcd(int a,int b,int c) {\n\t\tint d=0;\n\t\tint ans=0;\n\t\twhile(d==0) {\n\t\tif(a>b) {\n\t\t\ta=a-b;\n\t\t}\n\t\telse if(a<b) {\n\t\t\tb=b-a;\n\t\t}\n\t\telse {\n\t\t\td=a;\n\t\t}\n\t\t}\n\t\twhile(ans==0) {\n\t\tif(d<c) {\n\t\t\tc=c-d;\n\t\t}\n\t\telse if(d>c) {\n\t\t\td=d-c;\n\t\t}\n\t\telse {\n\t\t\tans=d;\n\t\t}\n\t\t}\n\t\treturn ans;\n\t}\n\tpublic static void main(String args[]) {\n\t\tScanner sc=new Scanner(System.in);\n\t\tint K=sc.nextInt();\n\t\tint A=0;\n\t\tfor(int i=1;i<K+1;i++) {\n\t\t\tfor(int j=1;j<K+1;j++) {\n\t\t\t\tfor(int k=1;k<K+1;k++) {\n\t\t\t\t\tA+=gcd(i,j,k);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(A);\n\t}\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n\tpublic static int gcd(int a,int b,int c) {\n\t\tint d=0;\n\t\tint ans=0;\n\t\twhile(d==0) {\n\t\tif(a>b) {\n\t\t\ta=a-b;\n\t\t}\n\t\telse if(a<b) {\n\t\t\tb=b-a;\n\t\t}\n\t\telse {\n\t\t\td=a;\n\t\t}\n\t\t}\n\t\twhile(ans==0) {\n\t\tif(d<c) {\n\t\t\tc=c-d;\n\t\t}\n\t\telse if(d>c) {\n\t\t\td=d-c;\n\t\t}\n\t\telse {\n\t\t\tans=d;\n\t\t}\n\t\t}\n\t\treturn ans;\n\t}\n\tpublic static void main(String args[]) {\n\t\tScanner sc=new Scanner(System.in);\n\t\tint K=sc.nextInt();\n\t\tint A=0;\n\t\tfor(int i=1;i<K+1;i++) {\n\t\t\tfor(int j=1;j<K+1;j++) {\n\t\t\t\tfor(int k=1;k<K+1;k++) {\n\t\t\t\t\tA+=gcd(i,j,k);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(A);\n\t}\n}",
"Main",
"public static int gcd(int a,int b,int c) {\n\t\tint d=0;\n\t\tint ans=0;\n\t\twhile(d==0) {\n\t\tif(a>b) {\n\t\t\ta=a-b;\n\t\t}\n\t\telse if(a<b) {\n\t\t\tb=b-a;\n\t\t}\n\t\telse {\n\t\t\td=a;\n\t\t}\n\t\t}\n\t\twhile(ans==0) {\n\t\tif(d<c) {\n\t\t\tc=c-d;\n\t\t}\n\t\telse if(d>c) {\n\t\t\td=d-c;\n\t\t}\n\t\telse {\n\t\t\tans=d;\n\t\t}\n\t\t}\n\t\treturn ans;\n\t}",
"gcd",
"{\n\t\tint d=0;\n\t\tint ans=0;\n\t\twhile(d==0) {\n\t\tif(a>b) {\n\t\t\ta=a-b;\n\t\t}\n\t\telse if(a<b) {\n\t\t\tb=b-a;\n\t\t}\n\t\telse {\n\t\t\td=a;\n\t\t}\n\t\t}\n\t\twhile(ans==0) {\n\t\tif(d<c) {\n\t\t\tc=c-d;\n\t\t}\n\t\telse if(d>c) {\n\t\t\td=d-c;\n\t\t}\n\t\telse {\n\t\t\tans=d;\n\t\t}\n\t\t}\n\t\treturn ans;\n\t}",
"int d=0;",
"d",
"0",
"int ans=0;",
"ans",
"0",
"while(d==0) {\n\t\tif(a>b) {\n\t\t\ta=a-b;\n\t\t}\n\t\telse if(a<b) {\n\t\t\tb=b-a;\n\t\t}\n\t\telse {\n\t\t\td=a;\n\t\t}\n\t\t}",
"d==0",
"d",
"0",
"{\n\t\tif(a>b) {\n\t\t\ta=a-b;\n\t\t}\n\t\telse if(a<b) {\n\t\t\tb=b-a;\n\t\t}\n\t\telse {\n\t\t\td=a;\n\t\t}\n\t\t}",
"if(a>b) {\n\t\t\ta=a-b;\n\t\t}\n\t\telse if(a<b) {\n\t\t\tb=b-a;\n\t\t}\n\t\telse {\n\t\t\td=a;\n\t\t}",
"a>b",
"a",
"b",
"{\n\t\t\ta=a-b;\n\t\t}",
"a=a-b",
"a",
"a-b",
"a",
"b",
"if(a<b) {\n\t\t\tb=b-a;\n\t\t}\n\t\telse {\n\t\t\td=a;\n\t\t}",
"a<b",
"a",
"b",
"{\n\t\t\tb=b-a;\n\t\t}",
"b=b-a",
"b",
"b-a",
"b",
"a",
"{\n\t\t\td=a;\n\t\t}",
"d=a",
"d",
"a",
"while(ans==0) {\n\t\tif(d<c) {\n\t\t\tc=c-d;\n\t\t}\n\t\telse if(d>c) {\n\t\t\td=d-c;\n\t\t}\n\t\telse {\n\t\t\tans=d;\n\t\t}\n\t\t}",
"ans==0",
"ans",
"0",
"{\n\t\tif(d<c) {\n\t\t\tc=c-d;\n\t\t}\n\t\telse if(d>c) {\n\t\t\td=d-c;\n\t\t}\n\t\telse {\n\t\t\tans=d;\n\t\t}\n\t\t}",
"if(d<c) {\n\t\t\tc=c-d;\n\t\t}\n\t\telse if(d>c) {\n\t\t\td=d-c;\n\t\t}\n\t\telse {\n\t\t\tans=d;\n\t\t}",
"d<c",
"d",
"c",
"{\n\t\t\tc=c-d;\n\t\t}",
"c=c-d",
"c",
"c-d",
"c",
"d",
"if(d>c) {\n\t\t\td=d-c;\n\t\t}\n\t\telse {\n\t\t\tans=d;\n\t\t}",
"d>c",
"d",
"c",
"{\n\t\t\td=d-c;\n\t\t}",
"d=d-c",
"d",
"d-c",
"d",
"c",
"{\n\t\t\tans=d;\n\t\t}",
"ans=d",
"ans",
"d",
"return ans;",
"ans",
"int a",
"a",
"int b",
"b",
"int c",
"c",
"public static void main(String args[]) {\n\t\tScanner sc=new Scanner(System.in);\n\t\tint K=sc.nextInt();\n\t\tint A=0;\n\t\tfor(int i=1;i<K+1;i++) {\n\t\t\tfor(int j=1;j<K+1;j++) {\n\t\t\t\tfor(int k=1;k<K+1;k++) {\n\t\t\t\t\tA+=gcd(i,j,k);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(A);\n\t}",
"main",
"{\n\t\tScanner sc=new Scanner(System.in);\n\t\tint K=sc.nextInt();\n\t\tint A=0;\n\t\tfor(int i=1;i<K+1;i++) {\n\t\t\tfor(int j=1;j<K+1;j++) {\n\t\t\t\tfor(int k=1;k<K+1;k++) {\n\t\t\t\t\tA+=gcd(i,j,k);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(A);\n\t}",
"Scanner sc=new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"int K=sc.nextInt();",
"K",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int A=0;",
"A",
"0",
"for(int i=1;i<K+1;i++) {\n\t\t\tfor(int j=1;j<K+1;j++) {\n\t\t\t\tfor(int k=1;k<K+1;k++) {\n\t\t\t\t\tA+=gcd(i,j,k);\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"int i=1;",
"int i=1;",
"i",
"1",
"i<K+1",
"i",
"K+1",
"K",
"1",
"i++",
"i++",
"i",
"{\n\t\t\tfor(int j=1;j<K+1;j++) {\n\t\t\t\tfor(int k=1;k<K+1;k++) {\n\t\t\t\t\tA+=gcd(i,j,k);\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"{\n\t\t\tfor(int j=1;j<K+1;j++) {\n\t\t\t\tfor(int k=1;k<K+1;k++) {\n\t\t\t\t\tA+=gcd(i,j,k);\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"for(int j=1;j<K+1;j++) {\n\t\t\t\tfor(int k=1;k<K+1;k++) {\n\t\t\t\t\tA+=gcd(i,j,k);\n\t\t\t\t}\n\t\t\t}",
"int j=1;",
"int j=1;",
"j",
"1",
"j<K+1",
"j",
"K+1",
"K",
"1",
"j++",
"j++",
"j",
"{\n\t\t\t\tfor(int k=1;k<K+1;k++) {\n\t\t\t\t\tA+=gcd(i,j,k);\n\t\t\t\t}\n\t\t\t}",
"{\n\t\t\t\tfor(int k=1;k<K+1;k++) {\n\t\t\t\t\tA+=gcd(i,j,k);\n\t\t\t\t}\n\t\t\t}",
"for(int k=1;k<K+1;k++) {\n\t\t\t\t\tA+=gcd(i,j,k);\n\t\t\t\t}",
"int k=1;",
"int k=1;",
"k",
"1",
"k<K+1",
"k",
"K+1",
"K",
"1",
"k++",
"k++",
"k",
"{\n\t\t\t\t\tA+=gcd(i,j,k);\n\t\t\t\t}",
"{\n\t\t\t\t\tA+=gcd(i,j,k);\n\t\t\t\t}",
"A+=gcd(i,j,k)",
"A",
"gcd(i,j,k)",
"gcd",
"i",
"j",
"k",
"System.out.println(A)",
"System.out.println",
"System.out",
"System",
"System.out",
"A",
"String args[]",
"args",
"public class Main {\n\tpublic static int gcd(int a,int b,int c) {\n\t\tint d=0;\n\t\tint ans=0;\n\t\twhile(d==0) {\n\t\tif(a>b) {\n\t\t\ta=a-b;\n\t\t}\n\t\telse if(a<b) {\n\t\t\tb=b-a;\n\t\t}\n\t\telse {\n\t\t\td=a;\n\t\t}\n\t\t}\n\t\twhile(ans==0) {\n\t\tif(d<c) {\n\t\t\tc=c-d;\n\t\t}\n\t\telse if(d>c) {\n\t\t\td=d-c;\n\t\t}\n\t\telse {\n\t\t\tans=d;\n\t\t}\n\t\t}\n\t\treturn ans;\n\t}\n\tpublic static void main(String args[]) {\n\t\tScanner sc=new Scanner(System.in);\n\t\tint K=sc.nextInt();\n\t\tint A=0;\n\t\tfor(int i=1;i<K+1;i++) {\n\t\t\tfor(int j=1;j<K+1;j++) {\n\t\t\t\tfor(int k=1;k<K+1;k++) {\n\t\t\t\t\tA+=gcd(i,j,k);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(A);\n\t}\n}",
"public class Main {\n\tpublic static int gcd(int a,int b,int c) {\n\t\tint d=0;\n\t\tint ans=0;\n\t\twhile(d==0) {\n\t\tif(a>b) {\n\t\t\ta=a-b;\n\t\t}\n\t\telse if(a<b) {\n\t\t\tb=b-a;\n\t\t}\n\t\telse {\n\t\t\td=a;\n\t\t}\n\t\t}\n\t\twhile(ans==0) {\n\t\tif(d<c) {\n\t\t\tc=c-d;\n\t\t}\n\t\telse if(d>c) {\n\t\t\td=d-c;\n\t\t}\n\t\telse {\n\t\t\tans=d;\n\t\t}\n\t\t}\n\t\treturn ans;\n\t}\n\tpublic static void main(String args[]) {\n\t\tScanner sc=new Scanner(System.in);\n\t\tint K=sc.nextInt();\n\t\tint A=0;\n\t\tfor(int i=1;i<K+1;i++) {\n\t\t\tfor(int j=1;j<K+1;j++) {\n\t\t\t\tfor(int k=1;k<K+1;k++) {\n\t\t\t\t\tA+=gcd(i,j,k);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(A);\n\t}\n}",
"Main"
] |
import java.util.Scanner;
public class Main {
public static int gcd(int a,int b,int c) {
int d=0;
int ans=0;
while(d==0) {
if(a>b) {
a=a-b;
}
else if(a<b) {
b=b-a;
}
else {
d=a;
}
}
while(ans==0) {
if(d<c) {
c=c-d;
}
else if(d>c) {
d=d-c;
}
else {
ans=d;
}
}
return ans;
}
public static void main(String args[]) {
Scanner sc=new Scanner(System.in);
int K=sc.nextInt();
int A=0;
for(int i=1;i<K+1;i++) {
for(int j=1;j<K+1;j++) {
for(int k=1;k<K+1;k++) {
A+=gcd(i,j,k);
}
}
}
System.out.println(A);
}
}
|
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
18,
13,
13,
41,
13,
18,
13,
13,
41,
13,
20,
41,
13,
20,
41,
13,
20,
4,
18,
13,
17,
13,
13,
4,
18,
13,
23,
13,
6,
13,
12,
13,
30,
41,
13,
4,
18,
13,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
0,
13,
4,
13,
13,
4,
13,
13,
13,
4,
18,
13,
13,
23,
13,
23,
13,
23,
13,
12,
13,
30,
14,
2,
13,
17,
29,
13,
29,
4,
13,
13,
2,
13,
13,
23,
13,
23,
13,
6,
13,
41,
13,
41,
13,
12,
13,
30,
0,
13,
20,
0,
13,
17,
23,
13,
12,
13,
30,
42,
2,
2,
13,
17,
40,
4,
18,
13,
30,
38,
5,
13,
30,
37,
20,
30,
0,
13,
20,
29,
4,
18,
13,
12,
13,
30,
29,
4,
18,
13,
4,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
10,
11
],
[
10,
12
],
[
0,
13
],
[
13,
14
],
[
13,
15
],
[
0,
16
],
[
16,
17
],
[
16,
18
],
[
0,
19
],
[
19,
20
],
[
19,
21
],
[
0,
22
],
[
22,
23
],
[
22,
24
],
[
0,
25
],
[
25,
26
],
[
25,
27
],
[
0,
28
],
[
205,
29
],
[
205,
30
],
[
30,
31
],
[
30,
32
],
[
32,
33
],
[
33,
34
],
[
33,
35
],
[
35,
36
],
[
35,
37
],
[
32,
38
],
[
38,
39
],
[
38,
40
],
[
40,
41
],
[
40,
42
],
[
32,
43
],
[
43,
44
],
[
43,
45
],
[
32,
46
],
[
46,
47
],
[
46,
48
],
[
32,
49
],
[
49,
50
],
[
49,
51
],
[
32,
52
],
[
52,
53
],
[
53,
54
],
[
52,
55
],
[
52,
56
],
[
52,
57
],
[
32,
58
],
[
58,
59
],
[
59,
60
],
[
30,
61
],
[
61,
62
],
[
205,
63
],
[
63,
64
],
[
63,
65
],
[
65,
66
],
[
65,
67
],
[
67,
68
],
[
68,
69
],
[
68,
70
],
[
70,
71
],
[
71,
72
],
[
67,
73
],
[
73,
74
],
[
73,
75
],
[
67,
76
],
[
76,
77
],
[
77,
78
],
[
78,
79
],
[
78,
80
],
[
76,
81
],
[
81,
82
],
[
81,
83
],
[
76,
84
],
[
84,
85
],
[
85,
86
],
[
76,
87
],
[
87,
88
],
[
88,
89
],
[
89,
90
],
[
90,
91
],
[
90,
92
],
[
88,
93
],
[
93,
94
],
[
93,
95
],
[
88,
96
],
[
96,
97
],
[
97,
98
],
[
88,
99
],
[
99,
100
],
[
100,
101
],
[
101,
102
],
[
102,
103
],
[
102,
104
],
[
100,
105
],
[
105,
106
],
[
105,
107
],
[
100,
108
],
[
108,
109
],
[
109,
110
],
[
100,
111
],
[
111,
112
],
[
112,
113
],
[
112,
114
],
[
114,
115
],
[
114,
116
],
[
114,
117
],
[
117,
118
],
[
117,
119
],
[
117,
120
],
[
67,
121
],
[
121,
122
],
[
122,
123
],
[
121,
124
],
[
65,
125
],
[
125,
126
],
[
65,
127
],
[
127,
128
],
[
65,
129
],
[
129,
130
],
[
63,
131
],
[
131,
132
],
[
131,
133
],
[
133,
134
],
[
134,
135
],
[
135,
136
],
[
135,
137
],
[
134,
138
],
[
138,
139
],
[
134,
140
],
[
140,
141
],
[
141,
142
],
[
141,
143
],
[
141,
144
],
[
144,
145
],
[
144,
146
],
[
131,
147
],
[
147,
148
],
[
131,
149
],
[
149,
150
],
[
205,
151
],
[
151,
152
],
[
151,
153
],
[
153,
154
],
[
151,
155
],
[
155,
156
],
[
151,
157
],
[
157,
158
],
[
157,
159
],
[
159,
160
],
[
160,
161
],
[
160,
162
],
[
159,
163
],
[
163,
164
],
[
163,
165
],
[
157,
166
],
[
166,
167
],
[
151,
168
],
[
168,
169
],
[
168,
170
],
[
170,
171
],
[
171,
172
],
[
172,
173
],
[
173,
174
],
[
173,
175
],
[
172,
176
],
[
176,
177
],
[
177,
178
],
[
178,
179
],
[
171,
180
],
[
180,
181
],
[
181,
182
],
[
182,
183
],
[
182,
184
],
[
184,
185
],
[
185,
186
],
[
181,
187
],
[
187,
188
],
[
188,
189
],
[
188,
190
],
[
170,
191
],
[
191,
192
],
[
192,
193
],
[
193,
194
],
[
151,
195
],
[
195,
196
],
[
195,
197
],
[
197,
198
],
[
198,
199
],
[
199,
200
],
[
200,
201
],
[
199,
202
],
[
202,
203
],
[
0,
204
],
[
204,
205
],
[
204,
206
]
] |
[
"import java.io.OutputStream;\nimport java.io.IOException;\nimport java.io.InputStream;\nimport java.io.PrintWriter;\nimport java.util.StringTokenizer;\nimport java.io.IOException;\nimport java.io.BufferedReader;\nimport java.io.InputStreamReader;\nimport java.io.InputStream;\n\n/**\n * Built using CHelper plug-in\n * Actual solution is at the top\n */\npublic class Main {\n public static void main(String[] args) {\n InputStream inputStream = System.in;\n OutputStream outputStream = System.out;\n InputReader in = new InputReader(inputStream);\n PrintWriter out = new PrintWriter(outputStream);\n TaskC solver = new TaskC();\n solver.solve(1, in, out);\n out.close();\n }\n\n static class TaskC {\n public void solve(int testNumber, InputReader in, PrintWriter out) {\n int k = in.nextInt();\n long ans = 0;\n for (int a = 1; a <= k; a++)\n for (int b = 1; b <= k; b++)\n for (int c = 1; c <= k; c++)\n ans += gcd(a, gcd(b, c));\n out.println(ans);\n }\n\n 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\n static class InputReader {\n public BufferedReader reader;\n public StringTokenizer tokenizer;\n\n public InputReader(InputStream stream) {\n reader = new BufferedReader(new InputStreamReader(stream), 32768);\n tokenizer = null;\n }\n\n public String next() {\n while (tokenizer == null || !tokenizer.hasMoreTokens()) {\n try {\n tokenizer = new StringTokenizer(reader.readLine());\n } catch (IOException e) {\n throw new RuntimeException(e);\n }\n }\n return tokenizer.nextToken();\n }\n\n public int nextInt() {\n return Integer.parseInt(next());\n }\n\n }\n}\n",
"import java.io.OutputStream;",
"OutputStream",
"java.io",
"import java.io.IOException;",
"IOException",
"java.io",
"import java.io.InputStream;",
"InputStream",
"java.io",
"import java.io.PrintWriter;",
"PrintWriter",
"java.io",
"import java.util.StringTokenizer;",
"StringTokenizer",
"java.util",
"import java.io.IOException;",
"IOException",
"java.io",
"import java.io.BufferedReader;",
"BufferedReader",
"java.io",
"import java.io.InputStreamReader;",
"InputStreamReader",
"java.io",
"import java.io.InputStream;",
"InputStream",
"java.io",
"public class Main {\n public static void main(String[] args) {\n InputStream inputStream = System.in;\n OutputStream outputStream = System.out;\n InputReader in = new InputReader(inputStream);\n PrintWriter out = new PrintWriter(outputStream);\n TaskC solver = new TaskC();\n solver.solve(1, in, out);\n out.close();\n }\n\n static class TaskC {\n public void solve(int testNumber, InputReader in, PrintWriter out) {\n int k = in.nextInt();\n long ans = 0;\n for (int a = 1; a <= k; a++)\n for (int b = 1; b <= k; b++)\n for (int c = 1; c <= k; c++)\n ans += gcd(a, gcd(b, c));\n out.println(ans);\n }\n\n 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\n static class InputReader {\n public BufferedReader reader;\n public StringTokenizer tokenizer;\n\n public InputReader(InputStream stream) {\n reader = new BufferedReader(new InputStreamReader(stream), 32768);\n tokenizer = null;\n }\n\n public String next() {\n while (tokenizer == null || !tokenizer.hasMoreTokens()) {\n try {\n tokenizer = new StringTokenizer(reader.readLine());\n } catch (IOException e) {\n throw new RuntimeException(e);\n }\n }\n return tokenizer.nextToken();\n }\n\n public int nextInt() {\n return Integer.parseInt(next());\n }\n\n }\n}",
"Main",
"public static void main(String[] args) {\n InputStream inputStream = System.in;\n OutputStream outputStream = System.out;\n InputReader in = new InputReader(inputStream);\n PrintWriter out = new PrintWriter(outputStream);\n TaskC solver = new TaskC();\n solver.solve(1, in, out);\n out.close();\n }",
"main",
"{\n InputStream inputStream = System.in;\n OutputStream outputStream = System.out;\n InputReader in = new InputReader(inputStream);\n PrintWriter out = new PrintWriter(outputStream);\n TaskC solver = new TaskC();\n solver.solve(1, in, out);\n out.close();\n }",
"InputStream inputStream = System.in;",
"inputStream",
"System.in",
"System",
"System.in",
"OutputStream outputStream = System.out;",
"outputStream",
"System.out",
"System",
"System.out",
"InputReader in = new InputReader(inputStream);",
"in",
"new InputReader(inputStream)",
"PrintWriter out = new PrintWriter(outputStream);",
"out",
"new PrintWriter(outputStream)",
"TaskC solver = new TaskC();",
"solver",
"new TaskC()",
"solver.solve(1, in, out)",
"solver.solve",
"solver",
"1",
"in",
"out",
"out.close()",
"out.close",
"out",
"String[] args",
"args",
"static class TaskC {\n public void solve(int testNumber, InputReader in, PrintWriter out) {\n int k = in.nextInt();\n long ans = 0;\n for (int a = 1; a <= k; a++)\n for (int b = 1; b <= k; b++)\n for (int c = 1; c <= k; c++)\n ans += gcd(a, gcd(b, c));\n out.println(ans);\n }\n\n int gcd(int a, int b) {\n if (b == 0)\n return a;\n else\n return gcd(b, a % b);\n }\n\n }",
"TaskC",
"public void solve(int testNumber, InputReader in, PrintWriter out) {\n int k = in.nextInt();\n long ans = 0;\n for (int a = 1; a <= k; a++)\n for (int b = 1; b <= k; b++)\n for (int c = 1; c <= k; c++)\n ans += gcd(a, gcd(b, c));\n out.println(ans);\n }",
"solve",
"{\n int k = in.nextInt();\n long ans = 0;\n for (int a = 1; a <= k; a++)\n for (int b = 1; b <= k; b++)\n for (int c = 1; c <= k; c++)\n ans += gcd(a, gcd(b, c));\n out.println(ans);\n }",
"int k = in.nextInt();",
"k",
"in.nextInt()",
"in.nextInt",
"in",
"long ans = 0;",
"ans",
"0",
"for (int a = 1; a <= k; a++)\n for (int b = 1; b <= k; b++)\n for (int c = 1; c <= k; c++)\n ans += gcd(a, gcd(b, c));",
"int a = 1;",
"int a = 1;",
"a",
"1",
"a <= k",
"a",
"k",
"a++",
"a++",
"a",
"for (int b = 1; b <= k; b++)\n for (int c = 1; c <= k; c++)\n ans += gcd(a, gcd(b, c));",
"for (int b = 1; b <= k; b++)\n for (int c = 1; c <= k; c++)\n ans += gcd(a, gcd(b, c));",
"int b = 1;",
"int b = 1;",
"b",
"1",
"b <= k",
"b",
"k",
"b++",
"b++",
"b",
"for (int c = 1; c <= k; c++)\n ans += gcd(a, gcd(b, c));",
"for (int c = 1; c <= k; c++)\n ans += gcd(a, gcd(b, c));",
"int c = 1;",
"int c = 1;",
"c",
"1",
"c <= k",
"c",
"k",
"c++",
"c++",
"c",
"ans += gcd(a, gcd(b, c));",
"ans += gcd(a, gcd(b, c))",
"ans",
"gcd(a, gcd(b, c))",
"gcd",
"a",
"gcd(b, c)",
"gcd",
"b",
"c",
"out.println(ans)",
"out.println",
"out",
"ans",
"int testNumber",
"testNumber",
"InputReader in",
"in",
"PrintWriter out",
"out",
"int gcd(int a, int b) {\n if (b == 0)\n return a;\n else\n return gcd(b, a % b);\n }",
"gcd",
"{\n if (b == 0)\n return a;\n else\n return gcd(b, a % b);\n }",
"if (b == 0)\n return a;\n else\n return gcd(b, a % b);",
"b == 0",
"b",
"0",
"return a;",
"a",
"return gcd(b, a % b);",
"gcd(b, a % b)",
"gcd",
"b",
"a % b",
"a",
"b",
"int a",
"a",
"int b",
"b",
"static class InputReader {\n public BufferedReader reader;\n public StringTokenizer tokenizer;\n\n public InputReader(InputStream stream) {\n reader = new BufferedReader(new InputStreamReader(stream), 32768);\n tokenizer = null;\n }\n\n public String next() {\n while (tokenizer == null || !tokenizer.hasMoreTokens()) {\n try {\n tokenizer = new StringTokenizer(reader.readLine());\n } catch (IOException e) {\n throw new RuntimeException(e);\n }\n }\n return tokenizer.nextToken();\n }\n\n public int nextInt() {\n return Integer.parseInt(next());\n }\n\n }",
"InputReader",
"public BufferedReader reader;",
"reader",
"public StringTokenizer tokenizer;",
"tokenizer",
"public InputReader(InputStream stream) {\n reader = new BufferedReader(new InputStreamReader(stream), 32768);\n tokenizer = null;\n }",
"InputReader",
"{\n reader = new BufferedReader(new InputStreamReader(stream), 32768);\n tokenizer = null;\n }",
"reader = new BufferedReader(new InputStreamReader(stream), 32768)",
"reader",
"new BufferedReader(new InputStreamReader(stream), 32768)",
"tokenizer = null",
"tokenizer",
"null",
"InputStream stream",
"stream",
"public String next() {\n while (tokenizer == null || !tokenizer.hasMoreTokens()) {\n try {\n tokenizer = new StringTokenizer(reader.readLine());\n } catch (IOException e) {\n throw new RuntimeException(e);\n }\n }\n return tokenizer.nextToken();\n }",
"next",
"{\n while (tokenizer == null || !tokenizer.hasMoreTokens()) {\n try {\n tokenizer = new StringTokenizer(reader.readLine());\n } catch (IOException e) {\n throw new RuntimeException(e);\n }\n }\n return tokenizer.nextToken();\n }",
"while (tokenizer == null || !tokenizer.hasMoreTokens()) {\n try {\n tokenizer = new StringTokenizer(reader.readLine());\n } catch (IOException e) {\n throw new RuntimeException(e);\n }\n }",
"tokenizer == null || !tokenizer.hasMoreTokens()",
"tokenizer == null",
"tokenizer",
"null",
"!tokenizer.hasMoreTokens()",
"tokenizer.hasMoreTokens()",
"tokenizer.hasMoreTokens",
"tokenizer",
"{\n try {\n tokenizer = new StringTokenizer(reader.readLine());\n } catch (IOException e) {\n throw new RuntimeException(e);\n }\n }",
"try {\n tokenizer = new StringTokenizer(reader.readLine());\n } catch (IOException e) {\n throw new RuntimeException(e);\n }",
"catch (IOException e) {\n throw new RuntimeException(e);\n }",
"IOException e",
"{\n throw new RuntimeException(e);\n }",
"throw new RuntimeException(e);",
"new RuntimeException(e)",
"{\n tokenizer = new StringTokenizer(reader.readLine());\n }",
"tokenizer = new StringTokenizer(reader.readLine())",
"tokenizer",
"new StringTokenizer(reader.readLine())",
"return tokenizer.nextToken();",
"tokenizer.nextToken()",
"tokenizer.nextToken",
"tokenizer",
"public int nextInt() {\n return Integer.parseInt(next());\n }",
"nextInt",
"{\n return Integer.parseInt(next());\n }",
"return Integer.parseInt(next());",
"Integer.parseInt(next())",
"Integer.parseInt",
"Integer",
"next()",
"next",
"public class Main {\n public static void main(String[] args) {\n InputStream inputStream = System.in;\n OutputStream outputStream = System.out;\n InputReader in = new InputReader(inputStream);\n PrintWriter out = new PrintWriter(outputStream);\n TaskC solver = new TaskC();\n solver.solve(1, in, out);\n out.close();\n }\n\n static class TaskC {\n public void solve(int testNumber, InputReader in, PrintWriter out) {\n int k = in.nextInt();\n long ans = 0;\n for (int a = 1; a <= k; a++)\n for (int b = 1; b <= k; b++)\n for (int c = 1; c <= k; c++)\n ans += gcd(a, gcd(b, c));\n out.println(ans);\n }\n\n 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\n static class InputReader {\n public BufferedReader reader;\n public StringTokenizer tokenizer;\n\n public InputReader(InputStream stream) {\n reader = new BufferedReader(new InputStreamReader(stream), 32768);\n tokenizer = null;\n }\n\n public String next() {\n while (tokenizer == null || !tokenizer.hasMoreTokens()) {\n try {\n tokenizer = new StringTokenizer(reader.readLine());\n } catch (IOException e) {\n throw new RuntimeException(e);\n }\n }\n return tokenizer.nextToken();\n }\n\n public int nextInt() {\n return Integer.parseInt(next());\n }\n\n }\n}",
"public class Main {\n public static void main(String[] args) {\n InputStream inputStream = System.in;\n OutputStream outputStream = System.out;\n InputReader in = new InputReader(inputStream);\n PrintWriter out = new PrintWriter(outputStream);\n TaskC solver = new TaskC();\n solver.solve(1, in, out);\n out.close();\n }\n\n static class TaskC {\n public void solve(int testNumber, InputReader in, PrintWriter out) {\n int k = in.nextInt();\n long ans = 0;\n for (int a = 1; a <= k; a++)\n for (int b = 1; b <= k; b++)\n for (int c = 1; c <= k; c++)\n ans += gcd(a, gcd(b, c));\n out.println(ans);\n }\n\n 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\n static class InputReader {\n public BufferedReader reader;\n public StringTokenizer tokenizer;\n\n public InputReader(InputStream stream) {\n reader = new BufferedReader(new InputStreamReader(stream), 32768);\n tokenizer = null;\n }\n\n public String next() {\n while (tokenizer == null || !tokenizer.hasMoreTokens()) {\n try {\n tokenizer = new StringTokenizer(reader.readLine());\n } catch (IOException e) {\n throw new RuntimeException(e);\n }\n }\n return tokenizer.nextToken();\n }\n\n public int nextInt() {\n return Integer.parseInt(next());\n }\n\n }\n}",
"Main"
] |
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.StringTokenizer;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.InputStream;
/**
* Built using CHelper plug-in
* Actual solution is at the top
*/
public class Main {
public static void main(String[] args) {
InputStream inputStream = System.in;
OutputStream outputStream = System.out;
InputReader in = new InputReader(inputStream);
PrintWriter out = new PrintWriter(outputStream);
TaskC solver = new TaskC();
solver.solve(1, in, out);
out.close();
}
static class TaskC {
public void solve(int testNumber, InputReader in, PrintWriter out) {
int k = in.nextInt();
long ans = 0;
for (int a = 1; a <= k; a++)
for (int b = 1; b <= k; b++)
for (int c = 1; c <= k; c++)
ans += gcd(a, gcd(b, c));
out.println(ans);
}
int gcd(int a, int b) {
if (b == 0)
return a;
else
return gcd(b, a % b);
}
}
static class InputReader {
public BufferedReader reader;
public StringTokenizer tokenizer;
public InputReader(InputStream stream) {
reader = new BufferedReader(new InputStreamReader(stream), 32768);
tokenizer = null;
}
public String next() {
while (tokenizer == null || !tokenizer.hasMoreTokens()) {
try {
tokenizer = new StringTokenizer(reader.readLine());
} catch (IOException e) {
throw new RuntimeException(e);
}
}
return tokenizer.nextToken();
}
public int nextInt() {
return Integer.parseInt(next());
}
}
}
|
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
14,
2,
13,
17,
30,
29,
13,
29,
4,
13,
13,
2,
13,
13,
23,
13,
23,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
4,
13,
13,
4,
13,
13,
13,
4,
18,
18,
13,
13,
13,
23,
13,
6,
13,
41,
13,
41,
13,
12,
13,
30,
0,
13,
20,
12,
13,
30,
42,
2,
2,
13,
17,
40,
4,
18,
13,
30,
38,
5,
13,
30,
4,
18,
13,
30,
0,
13,
20,
29,
4,
18,
13,
12,
13,
30,
29,
4,
18,
13,
4,
13,
12,
13,
30,
29,
4,
18,
13,
4,
13,
12,
13,
30,
29,
4,
18,
13,
4,
13,
12,
13,
30,
41,
13,
17,
38,
5,
13,
30,
4,
18,
13,
30,
0,
13,
4,
18,
13,
29,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
192,
11
],
[
192,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
16,
17
],
[
16,
18
],
[
15,
19
],
[
19,
20
],
[
20,
21
],
[
14,
22
],
[
22,
23
],
[
23,
24
],
[
23,
25
],
[
23,
26
],
[
26,
27
],
[
26,
28
],
[
12,
29
],
[
29,
30
],
[
12,
31
],
[
31,
32
],
[
192,
33
],
[
33,
34
],
[
33,
35
],
[
35,
36
],
[
36,
37
],
[
36,
38
],
[
35,
39
],
[
39,
40
],
[
39,
41
],
[
41,
42
],
[
42,
43
],
[
35,
44
],
[
44,
45
],
[
44,
46
],
[
35,
47
],
[
47,
48
],
[
48,
49
],
[
49,
50
],
[
49,
51
],
[
47,
52
],
[
52,
53
],
[
52,
54
],
[
47,
55
],
[
55,
56
],
[
56,
57
],
[
47,
58
],
[
59,
59
],
[
59,
60
],
[
60,
61
],
[
61,
62
],
[
62,
63
],
[
62,
64
],
[
60,
65
],
[
65,
66
],
[
65,
67
],
[
60,
68
],
[
68,
69
],
[
69,
70
],
[
60,
71
],
[
72,
72
],
[
72,
73
],
[
73,
74
],
[
74,
75
],
[
75,
76
],
[
75,
77
],
[
73,
78
],
[
78,
79
],
[
78,
80
],
[
73,
81
],
[
81,
82
],
[
82,
83
],
[
73,
84
],
[
85,
85
],
[
85,
86
],
[
86,
87
],
[
86,
88
],
[
88,
89
],
[
88,
90
],
[
88,
91
],
[
91,
92
],
[
91,
93
],
[
91,
94
],
[
35,
95
],
[
95,
96
],
[
96,
97
],
[
97,
98
],
[
97,
99
],
[
95,
100
],
[
33,
101
],
[
101,
102
],
[
192,
103
],
[
103,
104
],
[
103,
105
],
[
105,
106
],
[
103,
107
],
[
107,
108
],
[
103,
109
],
[
109,
110
],
[
109,
111
],
[
111,
112
],
[
112,
113
],
[
112,
114
],
[
103,
115
],
[
115,
116
],
[
115,
117
],
[
117,
118
],
[
118,
119
],
[
119,
120
],
[
120,
121
],
[
120,
122
],
[
119,
123
],
[
123,
124
],
[
124,
125
],
[
125,
126
],
[
118,
127
],
[
127,
128
],
[
128,
129
],
[
129,
130
],
[
129,
131
],
[
131,
132
],
[
132,
133
],
[
133,
134
],
[
128,
135
],
[
135,
136
],
[
136,
137
],
[
136,
138
],
[
117,
139
],
[
139,
140
],
[
140,
141
],
[
141,
142
],
[
103,
143
],
[
143,
144
],
[
143,
145
],
[
145,
146
],
[
146,
147
],
[
147,
148
],
[
148,
149
],
[
147,
150
],
[
150,
151
],
[
103,
152
],
[
152,
153
],
[
152,
154
],
[
154,
155
],
[
155,
156
],
[
156,
157
],
[
157,
158
],
[
156,
159
],
[
159,
160
],
[
103,
161
],
[
161,
162
],
[
161,
163
],
[
163,
164
],
[
164,
165
],
[
165,
166
],
[
166,
167
],
[
165,
168
],
[
168,
169
],
[
103,
170
],
[
170,
171
],
[
170,
172
],
[
172,
173
],
[
173,
174
],
[
173,
175
],
[
172,
176
],
[
176,
177
],
[
177,
178
],
[
177,
179
],
[
179,
180
],
[
180,
181
],
[
181,
182
],
[
176,
183
],
[
183,
184
],
[
184,
185
],
[
184,
186
],
[
186,
187
],
[
187,
188
],
[
172,
189
],
[
189,
190
],
[
0,
191
],
[
191,
192
],
[
191,
193
]
] |
[
"import java.io.*;\nimport java.util.*;\nimport java.lang.*;\n\npublic class Main {\n static class FastReader {\n BufferedReader br;\n StringTokenizer st;\n\n public FastReader() {\n br = new BufferedReader(new\n InputStreamReader(System.in));\n }\n\n String next() {\n while (st == null || !st.hasMoreElements()) {\n try {\n st = new StringTokenizer(br.readLine());\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n return st.nextToken();\n }\n\n int nextInt() {\n return Integer.parseInt(next());\n }\n\n long nextLong() {\n return Long.parseLong(next());\n }\n\n double nextDouble() {\n return Double.parseDouble(next());\n }\n\n String nextLine() {\n String str = \"\";\n try {\n str = br.readLine();\n } catch (IOException e) {\n e.printStackTrace();\n }\n return str;\n }\n }\n public static int gcd(int a, int b){\n if(b==0){\n return a;\n }\n return gcd(b,a%b);\n }\n public static void main(String[] args) {\n FastReader ob = new FastReader();\n int t = ob.nextInt();\n long sum=0;\n for (int i = 1; i <=t ; i++) {\n for (int j = 1; j <=t ; j++) {\n for (int k = 1; k <=t ; k++) {\n sum+=gcd(i,gcd(j,k));\n }\n }\n\n }\n System.out.println(sum);\n }\n}",
"import java.io.*;",
"io.*",
"java",
"import java.util.*;",
"util.*",
"java",
"import java.lang.*;",
"lang.*",
"java",
"public class Main {\n static class FastReader {\n BufferedReader br;\n StringTokenizer st;\n\n public FastReader() {\n br = new BufferedReader(new\n InputStreamReader(System.in));\n }\n\n String next() {\n while (st == null || !st.hasMoreElements()) {\n try {\n st = new StringTokenizer(br.readLine());\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n return st.nextToken();\n }\n\n int nextInt() {\n return Integer.parseInt(next());\n }\n\n long nextLong() {\n return Long.parseLong(next());\n }\n\n double nextDouble() {\n return Double.parseDouble(next());\n }\n\n String nextLine() {\n String str = \"\";\n try {\n str = br.readLine();\n } catch (IOException e) {\n e.printStackTrace();\n }\n return str;\n }\n }\n public static int gcd(int a, int b){\n if(b==0){\n return a;\n }\n return gcd(b,a%b);\n }\n public static void main(String[] args) {\n FastReader ob = new FastReader();\n int t = ob.nextInt();\n long sum=0;\n for (int i = 1; i <=t ; i++) {\n for (int j = 1; j <=t ; j++) {\n for (int k = 1; k <=t ; k++) {\n sum+=gcd(i,gcd(j,k));\n }\n }\n\n }\n System.out.println(sum);\n }\n}",
"Main",
"public static int gcd(int a, int b){\n if(b==0){\n return a;\n }\n return gcd(b,a%b);\n }",
"gcd",
"{\n if(b==0){\n return a;\n }\n return gcd(b,a%b);\n }",
"if(b==0){\n return a;\n }",
"b==0",
"b",
"0",
"{\n return a;\n }",
"return a;",
"a",
"return gcd(b,a%b);",
"gcd(b,a%b)",
"gcd",
"b",
"a%b",
"a",
"b",
"int a",
"a",
"int b",
"b",
"public static void main(String[] args) {\n FastReader ob = new FastReader();\n int t = ob.nextInt();\n long sum=0;\n for (int i = 1; i <=t ; i++) {\n for (int j = 1; j <=t ; j++) {\n for (int k = 1; k <=t ; k++) {\n sum+=gcd(i,gcd(j,k));\n }\n }\n\n }\n System.out.println(sum);\n }",
"main",
"{\n FastReader ob = new FastReader();\n int t = ob.nextInt();\n long sum=0;\n for (int i = 1; i <=t ; i++) {\n for (int j = 1; j <=t ; j++) {\n for (int k = 1; k <=t ; k++) {\n sum+=gcd(i,gcd(j,k));\n }\n }\n\n }\n System.out.println(sum);\n }",
"FastReader ob = new FastReader();",
"ob",
"new FastReader()",
"int t = ob.nextInt();",
"t",
"ob.nextInt()",
"ob.nextInt",
"ob",
"long sum=0;",
"sum",
"0",
"for (int i = 1; i <=t ; i++) {\n for (int j = 1; j <=t ; j++) {\n for (int k = 1; k <=t ; k++) {\n sum+=gcd(i,gcd(j,k));\n }\n }\n\n }",
"int i = 1;",
"int i = 1;",
"i",
"1",
"i <=t",
"i",
"t",
"i++",
"i++",
"i",
"{\n for (int j = 1; j <=t ; j++) {\n for (int k = 1; k <=t ; k++) {\n sum+=gcd(i,gcd(j,k));\n }\n }\n\n }",
"{\n for (int j = 1; j <=t ; j++) {\n for (int k = 1; k <=t ; k++) {\n sum+=gcd(i,gcd(j,k));\n }\n }\n\n }",
"for (int j = 1; j <=t ; j++) {\n for (int k = 1; k <=t ; k++) {\n sum+=gcd(i,gcd(j,k));\n }\n }",
"int j = 1;",
"int j = 1;",
"j",
"1",
"j <=t",
"j",
"t",
"j++",
"j++",
"j",
"{\n for (int k = 1; k <=t ; k++) {\n sum+=gcd(i,gcd(j,k));\n }\n }",
"{\n for (int k = 1; k <=t ; k++) {\n sum+=gcd(i,gcd(j,k));\n }\n }",
"for (int k = 1; k <=t ; k++) {\n sum+=gcd(i,gcd(j,k));\n }",
"int k = 1;",
"int k = 1;",
"k",
"1",
"k <=t",
"k",
"t",
"k++",
"k++",
"k",
"{\n sum+=gcd(i,gcd(j,k));\n }",
"{\n sum+=gcd(i,gcd(j,k));\n }",
"sum+=gcd(i,gcd(j,k))",
"sum",
"gcd(i,gcd(j,k))",
"gcd",
"i",
"gcd(j,k)",
"gcd",
"j",
"k",
"System.out.println(sum)",
"System.out.println",
"System.out",
"System",
"System.out",
"sum",
"String[] args",
"args",
"static class FastReader {\n BufferedReader br;\n StringTokenizer st;\n\n public FastReader() {\n br = new BufferedReader(new\n InputStreamReader(System.in));\n }\n\n String next() {\n while (st == null || !st.hasMoreElements()) {\n try {\n st = new StringTokenizer(br.readLine());\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n return st.nextToken();\n }\n\n int nextInt() {\n return Integer.parseInt(next());\n }\n\n long nextLong() {\n return Long.parseLong(next());\n }\n\n double nextDouble() {\n return Double.parseDouble(next());\n }\n\n String nextLine() {\n String str = \"\";\n try {\n str = br.readLine();\n } catch (IOException e) {\n e.printStackTrace();\n }\n return str;\n }\n }",
"FastReader",
"BufferedReader br;",
"br",
"StringTokenizer st;",
"st",
"public FastReader() {\n br = new BufferedReader(new\n InputStreamReader(System.in));\n }",
"FastReader",
"{\n br = new BufferedReader(new\n InputStreamReader(System.in));\n }",
"br = new BufferedReader(new\n InputStreamReader(System.in))",
"br",
"new BufferedReader(new\n InputStreamReader(System.in))",
"String next() {\n while (st == null || !st.hasMoreElements()) {\n try {\n st = new StringTokenizer(br.readLine());\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n return st.nextToken();\n }",
"next",
"{\n while (st == null || !st.hasMoreElements()) {\n try {\n st = new StringTokenizer(br.readLine());\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n return st.nextToken();\n }",
"while (st == null || !st.hasMoreElements()) {\n try {\n st = new StringTokenizer(br.readLine());\n } catch (IOException e) {\n e.printStackTrace();\n }\n }",
"st == null || !st.hasMoreElements()",
"st == null",
"st",
"null",
"!st.hasMoreElements()",
"st.hasMoreElements()",
"st.hasMoreElements",
"st",
"{\n try {\n st = new StringTokenizer(br.readLine());\n } catch (IOException e) {\n e.printStackTrace();\n }\n }",
"try {\n st = new StringTokenizer(br.readLine());\n } catch (IOException e) {\n e.printStackTrace();\n }",
"catch (IOException e) {\n e.printStackTrace();\n }",
"IOException e",
"{\n e.printStackTrace();\n }",
"e.printStackTrace()",
"e.printStackTrace",
"e",
"{\n st = new StringTokenizer(br.readLine());\n }",
"st = new StringTokenizer(br.readLine())",
"st",
"new StringTokenizer(br.readLine())",
"return st.nextToken();",
"st.nextToken()",
"st.nextToken",
"st",
"int nextInt() {\n return Integer.parseInt(next());\n }",
"nextInt",
"{\n return Integer.parseInt(next());\n }",
"return Integer.parseInt(next());",
"Integer.parseInt(next())",
"Integer.parseInt",
"Integer",
"next()",
"next",
"long nextLong() {\n return Long.parseLong(next());\n }",
"nextLong",
"{\n return Long.parseLong(next());\n }",
"return Long.parseLong(next());",
"Long.parseLong(next())",
"Long.parseLong",
"Long",
"next()",
"next",
"double nextDouble() {\n return Double.parseDouble(next());\n }",
"nextDouble",
"{\n return Double.parseDouble(next());\n }",
"return Double.parseDouble(next());",
"Double.parseDouble(next())",
"Double.parseDouble",
"Double",
"next()",
"next",
"String nextLine() {\n String str = \"\";\n try {\n str = br.readLine();\n } catch (IOException e) {\n e.printStackTrace();\n }\n return str;\n }",
"nextLine",
"{\n String str = \"\";\n try {\n str = br.readLine();\n } catch (IOException e) {\n e.printStackTrace();\n }\n return str;\n }",
"String str = \"\";",
"str",
"\"\"",
"try {\n str = br.readLine();\n } catch (IOException e) {\n e.printStackTrace();\n }",
"catch (IOException e) {\n e.printStackTrace();\n }",
"IOException e",
"{\n e.printStackTrace();\n }",
"e.printStackTrace()",
"e.printStackTrace",
"e",
"{\n str = br.readLine();\n }",
"str = br.readLine()",
"str",
"br.readLine()",
"br.readLine",
"br",
"return str;",
"str",
"public class Main {\n static class FastReader {\n BufferedReader br;\n StringTokenizer st;\n\n public FastReader() {\n br = new BufferedReader(new\n InputStreamReader(System.in));\n }\n\n String next() {\n while (st == null || !st.hasMoreElements()) {\n try {\n st = new StringTokenizer(br.readLine());\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n return st.nextToken();\n }\n\n int nextInt() {\n return Integer.parseInt(next());\n }\n\n long nextLong() {\n return Long.parseLong(next());\n }\n\n double nextDouble() {\n return Double.parseDouble(next());\n }\n\n String nextLine() {\n String str = \"\";\n try {\n str = br.readLine();\n } catch (IOException e) {\n e.printStackTrace();\n }\n return str;\n }\n }\n public static int gcd(int a, int b){\n if(b==0){\n return a;\n }\n return gcd(b,a%b);\n }\n public static void main(String[] args) {\n FastReader ob = new FastReader();\n int t = ob.nextInt();\n long sum=0;\n for (int i = 1; i <=t ; i++) {\n for (int j = 1; j <=t ; j++) {\n for (int k = 1; k <=t ; k++) {\n sum+=gcd(i,gcd(j,k));\n }\n }\n\n }\n System.out.println(sum);\n }\n}",
"public class Main {\n static class FastReader {\n BufferedReader br;\n StringTokenizer st;\n\n public FastReader() {\n br = new BufferedReader(new\n InputStreamReader(System.in));\n }\n\n String next() {\n while (st == null || !st.hasMoreElements()) {\n try {\n st = new StringTokenizer(br.readLine());\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n return st.nextToken();\n }\n\n int nextInt() {\n return Integer.parseInt(next());\n }\n\n long nextLong() {\n return Long.parseLong(next());\n }\n\n double nextDouble() {\n return Double.parseDouble(next());\n }\n\n String nextLine() {\n String str = \"\";\n try {\n str = br.readLine();\n } catch (IOException e) {\n e.printStackTrace();\n }\n return str;\n }\n }\n public static int gcd(int a, int b){\n if(b==0){\n return a;\n }\n return gcd(b,a%b);\n }\n public static void main(String[] args) {\n FastReader ob = new FastReader();\n int t = ob.nextInt();\n long sum=0;\n for (int i = 1; i <=t ; i++) {\n for (int j = 1; j <=t ; j++) {\n for (int k = 1; k <=t ; k++) {\n sum+=gcd(i,gcd(j,k));\n }\n }\n\n }\n System.out.println(sum);\n }\n}",
"Main"
] |
import java.io.*;
import java.util.*;
import java.lang.*;
public class Main {
static class FastReader {
BufferedReader br;
StringTokenizer st;
public FastReader() {
br = new BufferedReader(new
InputStreamReader(System.in));
}
String next() {
while (st == null || !st.hasMoreElements()) {
try {
st = new StringTokenizer(br.readLine());
} catch (IOException e) {
e.printStackTrace();
}
}
return st.nextToken();
}
int nextInt() {
return Integer.parseInt(next());
}
long nextLong() {
return Long.parseLong(next());
}
double nextDouble() {
return Double.parseDouble(next());
}
String nextLine() {
String str = "";
try {
str = br.readLine();
} catch (IOException e) {
e.printStackTrace();
}
return str;
}
}
public static int gcd(int a, int b){
if(b==0){
return a;
}
return gcd(b,a%b);
}
public static void main(String[] args) {
FastReader ob = new FastReader();
int t = ob.nextInt();
long sum=0;
for (int i = 1; i <=t ; i++) {
for (int j = 1; j <=t ; j++) {
for (int k = 1; k <=t ; k++) {
sum+=gcd(i,gcd(j,k));
}
}
}
System.out.println(sum);
}
}
|
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
17,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
11,
1,
41,
13,
13,
2,
13,
13,
1,
40,
13,
30,
30,
11,
1,
41,
13,
13,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
4,
13,
13,
13,
13,
4,
18,
18,
13,
13,
13,
4,
18,
13,
23,
13,
12,
13,
30,
41,
13,
13,
41,
13,
13,
41,
13,
41,
13,
17,
14,
2,
2,
13,
13,
2,
13,
13,
30,
0,
13,
17,
14,
2,
2,
13,
13,
2,
13,
13,
30,
0,
13,
17,
42,
2,
2,
13,
13,
17,
30,
0,
13,
2,
13,
13,
0,
13,
13,
0,
13,
13,
14,
2,
13,
13,
30,
0,
13,
13,
0,
13,
13,
30,
0,
13,
13,
42,
2,
2,
13,
13,
17,
30,
0,
13,
2,
13,
13,
0,
13,
13,
0,
13,
13,
29,
2,
13,
13,
23,
13,
23,
13,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
183,
5
],
[
183,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
8,
15
],
[
15,
16
],
[
15,
17
],
[
17,
18
],
[
18,
19
],
[
8,
20
],
[
20,
21
],
[
20,
22
],
[
22,
23
],
[
23,
24
],
[
22,
25
],
[
8,
26
],
[
26,
27
],
[
27,
28
],
[
28,
29
],
[
28,
30
],
[
26,
31
],
[
31,
32
],
[
31,
33
],
[
26,
34
],
[
34,
35
],
[
35,
36
],
[
26,
37
],
[
38,
38
],
[
38,
39
],
[
39,
40
],
[
40,
41
],
[
41,
42
],
[
41,
43
],
[
39,
44
],
[
44,
45
],
[
44,
46
],
[
39,
47
],
[
47,
48
],
[
48,
49
],
[
39,
50
],
[
51,
51
],
[
51,
52
],
[
52,
53
],
[
53,
54
],
[
54,
55
],
[
54,
56
],
[
52,
57
],
[
57,
58
],
[
57,
59
],
[
52,
60
],
[
60,
61
],
[
61,
62
],
[
52,
63
],
[
64,
64
],
[
64,
65
],
[
65,
66
],
[
65,
67
],
[
67,
68
],
[
67,
69
],
[
67,
70
],
[
67,
71
],
[
8,
72
],
[
72,
73
],
[
73,
74
],
[
74,
75
],
[
74,
76
],
[
72,
77
],
[
8,
78
],
[
78,
79
],
[
79,
80
],
[
6,
81
],
[
81,
82
],
[
183,
83
],
[
83,
84
],
[
83,
85
],
[
85,
86
],
[
86,
87
],
[
86,
88
],
[
85,
89
],
[
89,
90
],
[
89,
91
],
[
85,
92
],
[
92,
93
],
[
85,
94
],
[
94,
95
],
[
94,
96
],
[
85,
97
],
[
97,
98
],
[
98,
99
],
[
99,
100
],
[
99,
101
],
[
98,
102
],
[
102,
103
],
[
102,
104
],
[
97,
105
],
[
105,
106
],
[
106,
107
],
[
106,
108
],
[
97,
109
],
[
109,
110
],
[
110,
111
],
[
111,
112
],
[
111,
113
],
[
110,
114
],
[
114,
115
],
[
114,
116
],
[
109,
117
],
[
117,
118
],
[
118,
119
],
[
118,
120
],
[
85,
121
],
[
121,
122
],
[
122,
123
],
[
123,
124
],
[
123,
125
],
[
122,
126
],
[
121,
127
],
[
127,
128
],
[
128,
129
],
[
128,
130
],
[
130,
131
],
[
130,
132
],
[
127,
133
],
[
133,
134
],
[
133,
135
],
[
127,
136
],
[
136,
137
],
[
136,
138
],
[
85,
139
],
[
139,
140
],
[
140,
141
],
[
140,
142
],
[
139,
143
],
[
143,
144
],
[
144,
145
],
[
144,
146
],
[
143,
147
],
[
147,
148
],
[
147,
149
],
[
139,
150
],
[
150,
151
],
[
151,
152
],
[
151,
153
],
[
85,
154
],
[
154,
155
],
[
155,
156
],
[
156,
157
],
[
156,
158
],
[
155,
159
],
[
154,
160
],
[
160,
161
],
[
161,
162
],
[
161,
163
],
[
163,
164
],
[
163,
165
],
[
160,
166
],
[
166,
167
],
[
166,
168
],
[
160,
169
],
[
169,
170
],
[
169,
171
],
[
85,
172
],
[
172,
173
],
[
173,
174
],
[
173,
175
],
[
83,
176
],
[
176,
177
],
[
83,
178
],
[
178,
179
],
[
83,
180
],
[
180,
181
],
[
0,
182
],
[
182,
183
],
[
182,
184
]
] |
[
"import java.util.Scanner;\n\npublic class Main {\n\tpublic static void main(String[] args) {\n\t\tint ans = 0;\n\t\tScanner in = new Scanner(System.in);\n\t\tString str = in.next();\n\t\tint K = Integer.parseInt(str);\n\n\t\tfor (int i = 1; i <= K; i++) {\n\t\t\tfor (int j = i; j <= K; j++) {\n\t\t\t\tfor (int k = j; k <= K; k++) {\n\t\t\t\t\tans += calcGcd(i, j, k);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(ans);\n\t\tin.close();\n\t}\n\n\tpublic static int calcGcd(int i, int j, int k) {// i<j<k\n\t\tint p = k, q = j, temp, num = 6;\n\t\tif (i == j && j == k) {\n\t\t\tnum = 1;\n\t\t} else if (i == j || j == k) {\n\t\t\tnum = 3;\n\t\t}\n\t\twhile (p % q != 0) {\n\t\t\ttemp = p % q;\n\t\t\tp = q;\n\t\t\tq = temp;\n\t\t}\n\t\tif (i < q) {\n\t\t\tp = q;\n\t\t\tq = i;\n\t\t} else {\n\t\t\tp = i;\n\t\t}\n\t\twhile (p % q != 0) {\n\t\t\ttemp = p % q;\n\t\t\tp = q;\n\t\t\tq = temp;\n\t\t}\n\t\treturn q * num;\n\t}\n\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n\tpublic static void main(String[] args) {\n\t\tint ans = 0;\n\t\tScanner in = new Scanner(System.in);\n\t\tString str = in.next();\n\t\tint K = Integer.parseInt(str);\n\n\t\tfor (int i = 1; i <= K; i++) {\n\t\t\tfor (int j = i; j <= K; j++) {\n\t\t\t\tfor (int k = j; k <= K; k++) {\n\t\t\t\t\tans += calcGcd(i, j, k);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(ans);\n\t\tin.close();\n\t}\n\n\tpublic static int calcGcd(int i, int j, int k) {// i<j<k\n\t\tint p = k, q = j, temp, num = 6;\n\t\tif (i == j && j == k) {\n\t\t\tnum = 1;\n\t\t} else if (i == j || j == k) {\n\t\t\tnum = 3;\n\t\t}\n\t\twhile (p % q != 0) {\n\t\t\ttemp = p % q;\n\t\t\tp = q;\n\t\t\tq = temp;\n\t\t}\n\t\tif (i < q) {\n\t\t\tp = q;\n\t\t\tq = i;\n\t\t} else {\n\t\t\tp = i;\n\t\t}\n\t\twhile (p % q != 0) {\n\t\t\ttemp = p % q;\n\t\t\tp = q;\n\t\t\tq = temp;\n\t\t}\n\t\treturn q * num;\n\t}\n\n}",
"Main",
"public static void main(String[] args) {\n\t\tint ans = 0;\n\t\tScanner in = new Scanner(System.in);\n\t\tString str = in.next();\n\t\tint K = Integer.parseInt(str);\n\n\t\tfor (int i = 1; i <= K; i++) {\n\t\t\tfor (int j = i; j <= K; j++) {\n\t\t\t\tfor (int k = j; k <= K; k++) {\n\t\t\t\t\tans += calcGcd(i, j, k);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(ans);\n\t\tin.close();\n\t}",
"main",
"{\n\t\tint ans = 0;\n\t\tScanner in = new Scanner(System.in);\n\t\tString str = in.next();\n\t\tint K = Integer.parseInt(str);\n\n\t\tfor (int i = 1; i <= K; i++) {\n\t\t\tfor (int j = i; j <= K; j++) {\n\t\t\t\tfor (int k = j; k <= K; k++) {\n\t\t\t\t\tans += calcGcd(i, j, k);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(ans);\n\t\tin.close();\n\t}",
"int ans = 0;",
"ans",
"0",
"Scanner in = new Scanner(System.in);",
"in",
"new Scanner(System.in)",
"String str = in.next();",
"str",
"in.next()",
"in.next",
"in",
"int K = Integer.parseInt(str);",
"K",
"Integer.parseInt(str)",
"Integer.parseInt",
"Integer",
"str",
"for (int i = 1; i <= K; i++) {\n\t\t\tfor (int j = i; j <= K; j++) {\n\t\t\t\tfor (int k = j; k <= K; k++) {\n\t\t\t\t\tans += calcGcd(i, j, k);\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"int i = 1;",
"int i = 1;",
"i",
"1",
"i <= K",
"i",
"K",
"i++",
"i++",
"i",
"{\n\t\t\tfor (int j = i; j <= K; j++) {\n\t\t\t\tfor (int k = j; k <= K; k++) {\n\t\t\t\t\tans += calcGcd(i, j, k);\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"{\n\t\t\tfor (int j = i; j <= K; j++) {\n\t\t\t\tfor (int k = j; k <= K; k++) {\n\t\t\t\t\tans += calcGcd(i, j, k);\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"for (int j = i; j <= K; j++) {\n\t\t\t\tfor (int k = j; k <= K; k++) {\n\t\t\t\t\tans += calcGcd(i, j, k);\n\t\t\t\t}\n\t\t\t}",
"int j = i;",
"int j = i;",
"j",
"i",
"j <= K",
"j",
"K",
"j++",
"j++",
"j",
"{\n\t\t\t\tfor (int k = j; k <= K; k++) {\n\t\t\t\t\tans += calcGcd(i, j, k);\n\t\t\t\t}\n\t\t\t}",
"{\n\t\t\t\tfor (int k = j; k <= K; k++) {\n\t\t\t\t\tans += calcGcd(i, j, k);\n\t\t\t\t}\n\t\t\t}",
"for (int k = j; k <= K; k++) {\n\t\t\t\t\tans += calcGcd(i, j, k);\n\t\t\t\t}",
"int k = j;",
"int k = j;",
"k",
"j",
"k <= K",
"k",
"K",
"k++",
"k++",
"k",
"{\n\t\t\t\t\tans += calcGcd(i, j, k);\n\t\t\t\t}",
"{\n\t\t\t\t\tans += calcGcd(i, j, k);\n\t\t\t\t}",
"ans += calcGcd(i, j, k)",
"ans",
"calcGcd(i, j, k)",
"calcGcd",
"i",
"j",
"k",
"System.out.println(ans)",
"System.out.println",
"System.out",
"System",
"System.out",
"ans",
"in.close()",
"in.close",
"in",
"String[] args",
"args",
"public static int calcGcd(int i, int j, int k) {// i<j<k\n\t\tint p = k, q = j, temp, num = 6;\n\t\tif (i == j && j == k) {\n\t\t\tnum = 1;\n\t\t} else if (i == j || j == k) {\n\t\t\tnum = 3;\n\t\t}\n\t\twhile (p % q != 0) {\n\t\t\ttemp = p % q;\n\t\t\tp = q;\n\t\t\tq = temp;\n\t\t}\n\t\tif (i < q) {\n\t\t\tp = q;\n\t\t\tq = i;\n\t\t} else {\n\t\t\tp = i;\n\t\t}\n\t\twhile (p % q != 0) {\n\t\t\ttemp = p % q;\n\t\t\tp = q;\n\t\t\tq = temp;\n\t\t}\n\t\treturn q * num;\n\t}",
"calcGcd",
"{// i<j<k\n\t\tint p = k, q = j, temp, num = 6;\n\t\tif (i == j && j == k) {\n\t\t\tnum = 1;\n\t\t} else if (i == j || j == k) {\n\t\t\tnum = 3;\n\t\t}\n\t\twhile (p % q != 0) {\n\t\t\ttemp = p % q;\n\t\t\tp = q;\n\t\t\tq = temp;\n\t\t}\n\t\tif (i < q) {\n\t\t\tp = q;\n\t\t\tq = i;\n\t\t} else {\n\t\t\tp = i;\n\t\t}\n\t\twhile (p % q != 0) {\n\t\t\ttemp = p % q;\n\t\t\tp = q;\n\t\t\tq = temp;\n\t\t}\n\t\treturn q * num;\n\t}",
"int p = k",
"p",
"k",
"q = j",
"q",
"j",
"temp",
"temp",
"num = 6;",
"num",
"6",
"if (i == j && j == k) {\n\t\t\tnum = 1;\n\t\t} else if (i == j || j == k) {\n\t\t\tnum = 3;\n\t\t}",
"i == j && j == k",
"i == j",
"i",
"j",
"j == k",
"j",
"k",
"{\n\t\t\tnum = 1;\n\t\t}",
"num = 1",
"num",
"1",
"if (i == j || j == k) {\n\t\t\tnum = 3;\n\t\t}",
"i == j || j == k",
"i == j",
"i",
"j",
"j == k",
"j",
"k",
"{\n\t\t\tnum = 3;\n\t\t}",
"num = 3",
"num",
"3",
"while (p % q != 0) {\n\t\t\ttemp = p % q;\n\t\t\tp = q;\n\t\t\tq = temp;\n\t\t}",
"p % q != 0",
"p % q",
"p",
"q",
"0",
"{\n\t\t\ttemp = p % q;\n\t\t\tp = q;\n\t\t\tq = temp;\n\t\t}",
"temp = p % q",
"temp",
"p % q",
"p",
"q",
"p = q",
"p",
"q",
"q = temp",
"q",
"temp",
"if (i < q) {\n\t\t\tp = q;\n\t\t\tq = i;\n\t\t} else {\n\t\t\tp = i;\n\t\t}",
"i < q",
"i",
"q",
"{\n\t\t\tp = q;\n\t\t\tq = i;\n\t\t}",
"p = q",
"p",
"q",
"q = i",
"q",
"i",
"{\n\t\t\tp = i;\n\t\t}",
"p = i",
"p",
"i",
"while (p % q != 0) {\n\t\t\ttemp = p % q;\n\t\t\tp = q;\n\t\t\tq = temp;\n\t\t}",
"p % q != 0",
"p % q",
"p",
"q",
"0",
"{\n\t\t\ttemp = p % q;\n\t\t\tp = q;\n\t\t\tq = temp;\n\t\t}",
"temp = p % q",
"temp",
"p % q",
"p",
"q",
"p = q",
"p",
"q",
"q = temp",
"q",
"temp",
"return q * num;",
"q * num",
"q",
"num",
"int i",
"i",
"int j",
"j",
"int k",
"k",
"public class Main {\n\tpublic static void main(String[] args) {\n\t\tint ans = 0;\n\t\tScanner in = new Scanner(System.in);\n\t\tString str = in.next();\n\t\tint K = Integer.parseInt(str);\n\n\t\tfor (int i = 1; i <= K; i++) {\n\t\t\tfor (int j = i; j <= K; j++) {\n\t\t\t\tfor (int k = j; k <= K; k++) {\n\t\t\t\t\tans += calcGcd(i, j, k);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(ans);\n\t\tin.close();\n\t}\n\n\tpublic static int calcGcd(int i, int j, int k) {// i<j<k\n\t\tint p = k, q = j, temp, num = 6;\n\t\tif (i == j && j == k) {\n\t\t\tnum = 1;\n\t\t} else if (i == j || j == k) {\n\t\t\tnum = 3;\n\t\t}\n\t\twhile (p % q != 0) {\n\t\t\ttemp = p % q;\n\t\t\tp = q;\n\t\t\tq = temp;\n\t\t}\n\t\tif (i < q) {\n\t\t\tp = q;\n\t\t\tq = i;\n\t\t} else {\n\t\t\tp = i;\n\t\t}\n\t\twhile (p % q != 0) {\n\t\t\ttemp = p % q;\n\t\t\tp = q;\n\t\t\tq = temp;\n\t\t}\n\t\treturn q * num;\n\t}\n\n}",
"public class Main {\n\tpublic static void main(String[] args) {\n\t\tint ans = 0;\n\t\tScanner in = new Scanner(System.in);\n\t\tString str = in.next();\n\t\tint K = Integer.parseInt(str);\n\n\t\tfor (int i = 1; i <= K; i++) {\n\t\t\tfor (int j = i; j <= K; j++) {\n\t\t\t\tfor (int k = j; k <= K; k++) {\n\t\t\t\t\tans += calcGcd(i, j, k);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(ans);\n\t\tin.close();\n\t}\n\n\tpublic static int calcGcd(int i, int j, int k) {// i<j<k\n\t\tint p = k, q = j, temp, num = 6;\n\t\tif (i == j && j == k) {\n\t\t\tnum = 1;\n\t\t} else if (i == j || j == k) {\n\t\t\tnum = 3;\n\t\t}\n\t\twhile (p % q != 0) {\n\t\t\ttemp = p % q;\n\t\t\tp = q;\n\t\t\tq = temp;\n\t\t}\n\t\tif (i < q) {\n\t\t\tp = q;\n\t\t\tq = i;\n\t\t} else {\n\t\t\tp = i;\n\t\t}\n\t\twhile (p % q != 0) {\n\t\t\ttemp = p % q;\n\t\t\tp = q;\n\t\t\tq = temp;\n\t\t}\n\t\treturn q * num;\n\t}\n\n}",
"Main"
] |
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
int ans = 0;
Scanner in = new Scanner(System.in);
String str = in.next();
int K = Integer.parseInt(str);
for (int i = 1; i <= K; i++) {
for (int j = i; j <= K; j++) {
for (int k = j; k <= K; k++) {
ans += calcGcd(i, j, k);
}
}
}
System.out.println(ans);
in.close();
}
public static int calcGcd(int i, int j, int k) {// i<j<k
int p = k, q = j, temp, num = 6;
if (i == j && j == k) {
num = 1;
} else if (i == j || j == k) {
num = 3;
}
while (p % q != 0) {
temp = p % q;
p = q;
q = temp;
}
if (i < q) {
p = q;
q = i;
} else {
p = i;
}
while (p % q != 0) {
temp = p % q;
p = q;
q = temp;
}
return q * num;
}
}
|
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
42,
2,
0,
13,
2,
13,
13,
17,
30,
0,
13,
13,
0,
13,
13,
29,
13,
23,
13,
23,
13,
12,
13,
30,
41,
13,
41,
13,
4,
13,
13,
13,
42,
2,
0,
13,
2,
13,
13,
17,
30,
0,
13,
13,
0,
13,
13,
29,
13,
23,
13,
23,
13,
23,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
4,
13,
13,
13,
13,
4,
18,
18,
13,
13,
13,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
10,
11
],
[
10,
12
],
[
0,
13
],
[
144,
14
],
[
144,
15
],
[
15,
16
],
[
15,
17
],
[
17,
18
],
[
18,
19
],
[
17,
20
],
[
20,
21
],
[
21,
22
],
[
22,
23
],
[
22,
24
],
[
24,
25
],
[
24,
26
],
[
21,
27
],
[
20,
28
],
[
28,
29
],
[
29,
30
],
[
29,
31
],
[
28,
32
],
[
32,
33
],
[
32,
34
],
[
17,
35
],
[
35,
36
],
[
15,
37
],
[
37,
38
],
[
15,
39
],
[
39,
40
],
[
144,
41
],
[
41,
42
],
[
41,
43
],
[
43,
44
],
[
44,
45
],
[
43,
46
],
[
46,
47
],
[
46,
48
],
[
48,
49
],
[
48,
50
],
[
48,
51
],
[
43,
52
],
[
52,
53
],
[
53,
54
],
[
54,
55
],
[
54,
56
],
[
56,
57
],
[
56,
58
],
[
53,
59
],
[
52,
60
],
[
60,
61
],
[
61,
62
],
[
61,
63
],
[
60,
64
],
[
64,
65
],
[
64,
66
],
[
43,
67
],
[
67,
68
],
[
41,
69
],
[
69,
70
],
[
41,
71
],
[
71,
72
],
[
41,
73
],
[
73,
74
],
[
144,
75
],
[
75,
76
],
[
75,
77
],
[
77,
78
],
[
78,
79
],
[
78,
80
],
[
77,
81
],
[
81,
82
],
[
81,
83
],
[
83,
84
],
[
84,
85
],
[
77,
86
],
[
86,
87
],
[
86,
88
],
[
77,
89
],
[
89,
90
],
[
90,
91
],
[
91,
92
],
[
91,
93
],
[
89,
94
],
[
94,
95
],
[
94,
96
],
[
89,
97
],
[
97,
98
],
[
98,
99
],
[
89,
100
],
[
101,
101
],
[
101,
102
],
[
102,
103
],
[
103,
104
],
[
104,
105
],
[
104,
106
],
[
102,
107
],
[
107,
108
],
[
107,
109
],
[
102,
110
],
[
110,
111
],
[
111,
112
],
[
102,
113
],
[
114,
114
],
[
114,
115
],
[
115,
116
],
[
116,
117
],
[
117,
118
],
[
117,
119
],
[
115,
120
],
[
120,
121
],
[
120,
122
],
[
115,
123
],
[
123,
124
],
[
124,
125
],
[
115,
126
],
[
127,
127
],
[
127,
128
],
[
128,
129
],
[
128,
130
],
[
130,
131
],
[
130,
132
],
[
130,
133
],
[
130,
134
],
[
77,
135
],
[
135,
136
],
[
136,
137
],
[
137,
138
],
[
137,
139
],
[
135,
140
],
[
75,
141
],
[
141,
142
],
[
0,
143
],
[
143,
144
],
[
143,
145
]
] |
[
"import java.util.Scanner;\nimport java.util.LinkedList;\nimport java.util.PriorityQueue;\nimport java.util.Queue;\n\npublic class Main {\t\n\t\n\tstatic int GCD(int A, int B) {\n\t\tint temp;\n\t\twhile((temp = A%B) != 0) {\n\t\t\tA = B;\n\t\t\tB = temp;\n\t\t}\n\t\treturn B;\n\t}\n\t\n\tstatic int gcd(int a, int b, int c) {\n\t\tint temp;\n\t\tint d = GCD(a,b);\n\t\twhile((temp = c%d) != 0){\n\t\t\tc = d;\n\t\t\t\n\t\t\td = temp;\n\t\t}\n\t\treturn d;\n\t}\n\t\n\tpublic static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\tint K = sc.nextInt();\n\t\t\n\t\tint sum = 0;\n\t\t\n\t\tfor(int i = 1; i <= K; i++) {\n\t\t\tfor(int j = 1; j <= K; j++) {\n\t\t\t\tfor(int k = 1; k <= K; k++) {\n\t\t\t\t\tsum += gcd(i,j,k);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tSystem.out.println(sum);\n\t}\n\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"import java.util.LinkedList;",
"LinkedList",
"java.util",
"import java.util.PriorityQueue;",
"PriorityQueue",
"java.util",
"import java.util.Queue;",
"Queue",
"java.util",
"public class Main {\t\n\t\n\tstatic int GCD(int A, int B) {\n\t\tint temp;\n\t\twhile((temp = A%B) != 0) {\n\t\t\tA = B;\n\t\t\tB = temp;\n\t\t}\n\t\treturn B;\n\t}\n\t\n\tstatic int gcd(int a, int b, int c) {\n\t\tint temp;\n\t\tint d = GCD(a,b);\n\t\twhile((temp = c%d) != 0){\n\t\t\tc = d;\n\t\t\t\n\t\t\td = temp;\n\t\t}\n\t\treturn d;\n\t}\n\t\n\tpublic static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\tint K = sc.nextInt();\n\t\t\n\t\tint sum = 0;\n\t\t\n\t\tfor(int i = 1; i <= K; i++) {\n\t\t\tfor(int j = 1; j <= K; j++) {\n\t\t\t\tfor(int k = 1; k <= K; k++) {\n\t\t\t\t\tsum += gcd(i,j,k);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tSystem.out.println(sum);\n\t}\n\n}",
"Main",
"static int GCD(int A, int B) {\n\t\tint temp;\n\t\twhile((temp = A%B) != 0) {\n\t\t\tA = B;\n\t\t\tB = temp;\n\t\t}\n\t\treturn B;\n\t}",
"GCD",
"{\n\t\tint temp;\n\t\twhile((temp = A%B) != 0) {\n\t\t\tA = B;\n\t\t\tB = temp;\n\t\t}\n\t\treturn B;\n\t}",
"int temp;",
"temp",
"while((temp = A%B) != 0) {\n\t\t\tA = B;\n\t\t\tB = temp;\n\t\t}",
"(temp = A%B) != 0",
"(temp = A%B)",
"temp",
"A%B",
"A",
"B",
"0",
"{\n\t\t\tA = B;\n\t\t\tB = temp;\n\t\t}",
"A = B",
"A",
"B",
"B = temp",
"B",
"temp",
"return B;",
"B",
"int A",
"A",
"int B",
"B",
"static int gcd(int a, int b, int c) {\n\t\tint temp;\n\t\tint d = GCD(a,b);\n\t\twhile((temp = c%d) != 0){\n\t\t\tc = d;\n\t\t\t\n\t\t\td = temp;\n\t\t}\n\t\treturn d;\n\t}",
"gcd",
"{\n\t\tint temp;\n\t\tint d = GCD(a,b);\n\t\twhile((temp = c%d) != 0){\n\t\t\tc = d;\n\t\t\t\n\t\t\td = temp;\n\t\t}\n\t\treturn d;\n\t}",
"int temp;",
"temp",
"int d = GCD(a,b);",
"d",
"GCD(a,b)",
"GCD",
"a",
"b",
"while((temp = c%d) != 0){\n\t\t\tc = d;\n\t\t\t\n\t\t\td = temp;\n\t\t}",
"(temp = c%d) != 0",
"(temp = c%d)",
"temp",
"c%d",
"c",
"d",
"0",
"{\n\t\t\tc = d;\n\t\t\t\n\t\t\td = temp;\n\t\t}",
"c = d",
"c",
"d",
"d = temp",
"d",
"temp",
"return d;",
"d",
"int a",
"a",
"int b",
"b",
"int c",
"c",
"public static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\tint K = sc.nextInt();\n\t\t\n\t\tint sum = 0;\n\t\t\n\t\tfor(int i = 1; i <= K; i++) {\n\t\t\tfor(int j = 1; j <= K; j++) {\n\t\t\t\tfor(int k = 1; k <= K; k++) {\n\t\t\t\t\tsum += gcd(i,j,k);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tSystem.out.println(sum);\n\t}",
"main",
"{\n\t\tScanner sc = new Scanner(System.in);\n\t\tint K = sc.nextInt();\n\t\t\n\t\tint sum = 0;\n\t\t\n\t\tfor(int i = 1; i <= K; i++) {\n\t\t\tfor(int j = 1; j <= K; j++) {\n\t\t\t\tfor(int k = 1; k <= K; k++) {\n\t\t\t\t\tsum += gcd(i,j,k);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tSystem.out.println(sum);\n\t}",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"int K = sc.nextInt();",
"K",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int sum = 0;",
"sum",
"0",
"for(int i = 1; i <= K; i++) {\n\t\t\tfor(int j = 1; j <= K; j++) {\n\t\t\t\tfor(int k = 1; k <= K; k++) {\n\t\t\t\t\tsum += gcd(i,j,k);\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"int i = 1;",
"int i = 1;",
"i",
"1",
"i <= K",
"i",
"K",
"i++",
"i++",
"i",
"{\n\t\t\tfor(int j = 1; j <= K; j++) {\n\t\t\t\tfor(int k = 1; k <= K; k++) {\n\t\t\t\t\tsum += gcd(i,j,k);\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"{\n\t\t\tfor(int j = 1; j <= K; j++) {\n\t\t\t\tfor(int k = 1; k <= K; k++) {\n\t\t\t\t\tsum += gcd(i,j,k);\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"for(int j = 1; j <= K; j++) {\n\t\t\t\tfor(int k = 1; k <= K; k++) {\n\t\t\t\t\tsum += gcd(i,j,k);\n\t\t\t\t}\n\t\t\t}",
"int j = 1;",
"int j = 1;",
"j",
"1",
"j <= K",
"j",
"K",
"j++",
"j++",
"j",
"{\n\t\t\t\tfor(int k = 1; k <= K; k++) {\n\t\t\t\t\tsum += gcd(i,j,k);\n\t\t\t\t}\n\t\t\t}",
"{\n\t\t\t\tfor(int k = 1; k <= K; k++) {\n\t\t\t\t\tsum += gcd(i,j,k);\n\t\t\t\t}\n\t\t\t}",
"for(int k = 1; k <= K; k++) {\n\t\t\t\t\tsum += gcd(i,j,k);\n\t\t\t\t}",
"int k = 1;",
"int k = 1;",
"k",
"1",
"k <= K",
"k",
"K",
"k++",
"k++",
"k",
"{\n\t\t\t\t\tsum += gcd(i,j,k);\n\t\t\t\t}",
"{\n\t\t\t\t\tsum += gcd(i,j,k);\n\t\t\t\t}",
"sum += gcd(i,j,k)",
"sum",
"gcd(i,j,k)",
"gcd",
"i",
"j",
"k",
"System.out.println(sum)",
"System.out.println",
"System.out",
"System",
"System.out",
"sum",
"String[] args",
"args",
"public class Main {\t\n\t\n\tstatic int GCD(int A, int B) {\n\t\tint temp;\n\t\twhile((temp = A%B) != 0) {\n\t\t\tA = B;\n\t\t\tB = temp;\n\t\t}\n\t\treturn B;\n\t}\n\t\n\tstatic int gcd(int a, int b, int c) {\n\t\tint temp;\n\t\tint d = GCD(a,b);\n\t\twhile((temp = c%d) != 0){\n\t\t\tc = d;\n\t\t\t\n\t\t\td = temp;\n\t\t}\n\t\treturn d;\n\t}\n\t\n\tpublic static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\tint K = sc.nextInt();\n\t\t\n\t\tint sum = 0;\n\t\t\n\t\tfor(int i = 1; i <= K; i++) {\n\t\t\tfor(int j = 1; j <= K; j++) {\n\t\t\t\tfor(int k = 1; k <= K; k++) {\n\t\t\t\t\tsum += gcd(i,j,k);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tSystem.out.println(sum);\n\t}\n\n}",
"public class Main {\t\n\t\n\tstatic int GCD(int A, int B) {\n\t\tint temp;\n\t\twhile((temp = A%B) != 0) {\n\t\t\tA = B;\n\t\t\tB = temp;\n\t\t}\n\t\treturn B;\n\t}\n\t\n\tstatic int gcd(int a, int b, int c) {\n\t\tint temp;\n\t\tint d = GCD(a,b);\n\t\twhile((temp = c%d) != 0){\n\t\t\tc = d;\n\t\t\t\n\t\t\td = temp;\n\t\t}\n\t\treturn d;\n\t}\n\t\n\tpublic static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\tint K = sc.nextInt();\n\t\t\n\t\tint sum = 0;\n\t\t\n\t\tfor(int i = 1; i <= K; i++) {\n\t\t\tfor(int j = 1; j <= K; j++) {\n\t\t\t\tfor(int k = 1; k <= K; k++) {\n\t\t\t\t\tsum += gcd(i,j,k);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tSystem.out.println(sum);\n\t}\n\n}",
"Main"
] |
import java.util.Scanner;
import java.util.LinkedList;
import java.util.PriorityQueue;
import java.util.Queue;
public class Main {
static int GCD(int A, int B) {
int temp;
while((temp = A%B) != 0) {
A = B;
B = temp;
}
return B;
}
static int gcd(int a, int b, int c) {
int temp;
int d = GCD(a,b);
while((temp = c%d) != 0){
c = d;
d = temp;
}
return d;
}
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int K = sc.nextInt();
int sum = 0;
for(int i = 1; i <= K; i++) {
for(int j = 1; j <= K; j++) {
for(int k = 1; k <= K; k++) {
sum += gcd(i,j,k);
}
}
}
System.out.println(sum);
}
}
|
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
41,
13,
14,
2,
13,
13,
30,
0,
13,
13,
0,
13,
13,
30,
0,
13,
13,
0,
13,
13,
41,
13,
42,
2,
0,
13,
2,
13,
13,
17,
30,
0,
13,
13,
0,
13,
13,
29,
13,
23,
13,
23,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
2,
13,
4,
13,
13,
4,
13,
13,
13,
4,
18,
18,
13,
13,
13,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
127,
5
],
[
127,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
8,
11
],
[
11,
12
],
[
8,
13
],
[
13,
14
],
[
14,
15
],
[
14,
16
],
[
13,
17
],
[
17,
18
],
[
18,
19
],
[
18,
20
],
[
17,
21
],
[
21,
22
],
[
21,
23
],
[
13,
24
],
[
24,
25
],
[
25,
26
],
[
25,
27
],
[
24,
28
],
[
28,
29
],
[
28,
30
],
[
8,
31
],
[
31,
32
],
[
8,
33
],
[
33,
34
],
[
34,
35
],
[
35,
36
],
[
35,
37
],
[
37,
38
],
[
37,
39
],
[
34,
40
],
[
33,
41
],
[
41,
42
],
[
42,
43
],
[
42,
44
],
[
41,
45
],
[
45,
46
],
[
45,
47
],
[
8,
48
],
[
48,
49
],
[
6,
50
],
[
50,
51
],
[
6,
52
],
[
52,
53
],
[
127,
54
],
[
54,
55
],
[
54,
56
],
[
56,
57
],
[
57,
58
],
[
57,
59
],
[
56,
60
],
[
60,
61
],
[
60,
62
],
[
62,
63
],
[
63,
64
],
[
56,
65
],
[
65,
66
],
[
65,
67
],
[
56,
68
],
[
68,
69
],
[
69,
70
],
[
70,
71
],
[
70,
72
],
[
68,
73
],
[
73,
74
],
[
73,
75
],
[
68,
76
],
[
76,
77
],
[
77,
78
],
[
68,
79
],
[
80,
80
],
[
80,
81
],
[
81,
82
],
[
82,
83
],
[
83,
84
],
[
83,
85
],
[
81,
86
],
[
86,
87
],
[
86,
88
],
[
81,
89
],
[
89,
90
],
[
90,
91
],
[
81,
92
],
[
93,
93
],
[
93,
94
],
[
94,
95
],
[
95,
96
],
[
96,
97
],
[
96,
98
],
[
94,
99
],
[
99,
100
],
[
99,
101
],
[
94,
102
],
[
102,
103
],
[
103,
104
],
[
94,
105
],
[
106,
106
],
[
106,
107
],
[
107,
108
],
[
107,
109
],
[
109,
110
],
[
109,
111
],
[
111,
112
],
[
111,
113
],
[
111,
114
],
[
114,
115
],
[
114,
116
],
[
114,
117
],
[
56,
118
],
[
118,
119
],
[
119,
120
],
[
120,
121
],
[
120,
122
],
[
118,
123
],
[
54,
124
],
[
124,
125
],
[
0,
126
],
[
126,
127
],
[
126,
128
]
] |
[
"import java.util.*;\n\npublic class Main {\n public static long gcd(long a, long b){\n long x;\n long y;\n if(b > a){\n x = b;\n y = a;\n }else{\n x = a;\n y = b;\n }\n long lm;\n while((lm = x%y) != 0){\n x = y;\n y = lm;\n }\n return y;\n }\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n long N = sc.nextLong();\n long sum = 0;\n for(long a = 1; a <= N; a++){\n for(long b = 1; b <= N; b++){\n for(long c = 1; c <= N; c++){\n sum = sum + gcd(a, gcd(b, c));\n }\n }\n }\n System.out.println(sum);\n }\n} ",
"import java.util.*;",
"util.*",
"java",
"public class Main {\n public static long gcd(long a, long b){\n long x;\n long y;\n if(b > a){\n x = b;\n y = a;\n }else{\n x = a;\n y = b;\n }\n long lm;\n while((lm = x%y) != 0){\n x = y;\n y = lm;\n }\n return y;\n }\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n long N = sc.nextLong();\n long sum = 0;\n for(long a = 1; a <= N; a++){\n for(long b = 1; b <= N; b++){\n for(long c = 1; c <= N; c++){\n sum = sum + gcd(a, gcd(b, c));\n }\n }\n }\n System.out.println(sum);\n }\n}",
"Main",
"public static long gcd(long a, long b){\n long x;\n long y;\n if(b > a){\n x = b;\n y = a;\n }else{\n x = a;\n y = b;\n }\n long lm;\n while((lm = x%y) != 0){\n x = y;\n y = lm;\n }\n return y;\n }",
"gcd",
"{\n long x;\n long y;\n if(b > a){\n x = b;\n y = a;\n }else{\n x = a;\n y = b;\n }\n long lm;\n while((lm = x%y) != 0){\n x = y;\n y = lm;\n }\n return y;\n }",
"long x;",
"x",
"long y;",
"y",
"if(b > a){\n x = b;\n y = a;\n }else{\n x = a;\n y = b;\n }",
"b > a",
"b",
"a",
"{\n x = b;\n y = a;\n }",
"x = b",
"x",
"b",
"y = a",
"y",
"a",
"{\n x = a;\n y = b;\n }",
"x = a",
"x",
"a",
"y = b",
"y",
"b",
"long lm;",
"lm",
"while((lm = x%y) != 0){\n x = y;\n y = lm;\n }",
"(lm = x%y) != 0",
"(lm = x%y)",
"lm",
"x%y",
"x",
"y",
"0",
"{\n x = y;\n y = lm;\n }",
"x = y",
"x",
"y",
"y = lm",
"y",
"lm",
"return y;",
"y",
"long a",
"a",
"long b",
"b",
"public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n long N = sc.nextLong();\n long sum = 0;\n for(long a = 1; a <= N; a++){\n for(long b = 1; b <= N; b++){\n for(long c = 1; c <= N; c++){\n sum = sum + gcd(a, gcd(b, c));\n }\n }\n }\n System.out.println(sum);\n }",
"main",
"{\n Scanner sc = new Scanner(System.in);\n long N = sc.nextLong();\n long sum = 0;\n for(long a = 1; a <= N; a++){\n for(long b = 1; b <= N; b++){\n for(long c = 1; c <= N; c++){\n sum = sum + gcd(a, gcd(b, c));\n }\n }\n }\n System.out.println(sum);\n }",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"long N = sc.nextLong();",
"N",
"sc.nextLong()",
"sc.nextLong",
"sc",
"long sum = 0;",
"sum",
"0",
"for(long a = 1; a <= N; a++){\n for(long b = 1; b <= N; b++){\n for(long c = 1; c <= N; c++){\n sum = sum + gcd(a, gcd(b, c));\n }\n }\n }",
"long a = 1;",
"long a = 1;",
"a",
"1",
"a <= N",
"a",
"N",
"a++",
"a++",
"a",
"{\n for(long b = 1; b <= N; b++){\n for(long c = 1; c <= N; c++){\n sum = sum + gcd(a, gcd(b, c));\n }\n }\n }",
"{\n for(long b = 1; b <= N; b++){\n for(long c = 1; c <= N; c++){\n sum = sum + gcd(a, gcd(b, c));\n }\n }\n }",
"for(long b = 1; b <= N; b++){\n for(long c = 1; c <= N; c++){\n sum = sum + gcd(a, gcd(b, c));\n }\n }",
"long b = 1;",
"long b = 1;",
"b",
"1",
"b <= N",
"b",
"N",
"b++",
"b++",
"b",
"{\n for(long c = 1; c <= N; c++){\n sum = sum + gcd(a, gcd(b, c));\n }\n }",
"{\n for(long c = 1; c <= N; c++){\n sum = sum + gcd(a, gcd(b, c));\n }\n }",
"for(long c = 1; c <= N; c++){\n sum = sum + gcd(a, gcd(b, c));\n }",
"long c = 1;",
"long c = 1;",
"c",
"1",
"c <= N",
"c",
"N",
"c++",
"c++",
"c",
"{\n sum = sum + gcd(a, gcd(b, c));\n }",
"{\n sum = sum + gcd(a, gcd(b, c));\n }",
"sum = sum + gcd(a, gcd(b, c))",
"sum",
"sum + gcd(a, gcd(b, c))",
"sum",
"gcd(a, gcd(b, c))",
"gcd",
"a",
"gcd(b, c)",
"gcd",
"b",
"c",
"System.out.println(sum)",
"System.out.println",
"System.out",
"System",
"System.out",
"sum",
"String[] args",
"args",
"public class Main {\n public static long gcd(long a, long b){\n long x;\n long y;\n if(b > a){\n x = b;\n y = a;\n }else{\n x = a;\n y = b;\n }\n long lm;\n while((lm = x%y) != 0){\n x = y;\n y = lm;\n }\n return y;\n }\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n long N = sc.nextLong();\n long sum = 0;\n for(long a = 1; a <= N; a++){\n for(long b = 1; b <= N; b++){\n for(long c = 1; c <= N; c++){\n sum = sum + gcd(a, gcd(b, c));\n }\n }\n }\n System.out.println(sum);\n }\n}",
"public class Main {\n public static long gcd(long a, long b){\n long x;\n long y;\n if(b > a){\n x = b;\n y = a;\n }else{\n x = a;\n y = b;\n }\n long lm;\n while((lm = x%y) != 0){\n x = y;\n y = lm;\n }\n return y;\n }\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n long N = sc.nextLong();\n long sum = 0;\n for(long a = 1; a <= N; a++){\n for(long b = 1; b <= N; b++){\n for(long c = 1; c <= N; c++){\n sum = sum + gcd(a, gcd(b, c));\n }\n }\n }\n System.out.println(sum);\n }\n}",
"Main"
] |
import java.util.*;
public class Main {
public static long gcd(long a, long b){
long x;
long y;
if(b > a){
x = b;
y = a;
}else{
x = a;
y = b;
}
long lm;
while((lm = x%y) != 0){
x = y;
y = lm;
}
return y;
}
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
long N = sc.nextLong();
long sum = 0;
for(long a = 1; a <= N; a++){
for(long b = 1; b <= N; b++){
for(long c = 1; c <= N; c++){
sum = sum + gcd(a, gcd(b, c));
}
}
}
System.out.println(sum);
}
}
|
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
4,
13,
13,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
4,
13,
13,
13,
4,
18,
18,
13,
13,
13,
4,
18,
13,
23,
13,
12,
13,
30,
14,
2,
13,
13,
29,
4,
13,
13,
13,
14,
2,
13,
17,
29,
13,
29,
4,
13,
13,
2,
13,
13,
23,
13,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
115,
5
],
[
115,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
8,
17
],
[
17,
18
],
[
17,
19
],
[
8,
20
],
[
20,
21
],
[
21,
22
],
[
22,
23
],
[
22,
24
],
[
20,
25
],
[
25,
26
],
[
25,
27
],
[
20,
28
],
[
28,
29
],
[
29,
30
],
[
20,
31
],
[
32,
32
],
[
32,
33
],
[
33,
34
],
[
33,
35
],
[
32,
36
],
[
36,
37
],
[
37,
38
],
[
38,
39
],
[
38,
40
],
[
36,
41
],
[
41,
42
],
[
41,
43
],
[
36,
44
],
[
44,
45
],
[
45,
46
],
[
36,
47
],
[
48,
48
],
[
48,
49
],
[
49,
50
],
[
49,
51
],
[
51,
52
],
[
51,
53
],
[
51,
54
],
[
48,
55
],
[
55,
56
],
[
56,
57
],
[
57,
58
],
[
57,
59
],
[
55,
60
],
[
60,
61
],
[
60,
62
],
[
55,
63
],
[
63,
64
],
[
64,
65
],
[
55,
66
],
[
67,
67
],
[
67,
68
],
[
68,
69
],
[
68,
70
],
[
70,
71
],
[
70,
72
],
[
70,
73
],
[
8,
74
],
[
74,
75
],
[
75,
76
],
[
76,
77
],
[
76,
78
],
[
74,
79
],
[
8,
80
],
[
80,
81
],
[
81,
82
],
[
6,
83
],
[
83,
84
],
[
115,
85
],
[
85,
86
],
[
85,
87
],
[
87,
88
],
[
88,
89
],
[
89,
90
],
[
89,
91
],
[
88,
92
],
[
92,
93
],
[
93,
94
],
[
93,
95
],
[
93,
96
],
[
87,
97
],
[
97,
98
],
[
98,
99
],
[
98,
100
],
[
97,
101
],
[
101,
102
],
[
87,
103
],
[
103,
104
],
[
104,
105
],
[
104,
106
],
[
104,
107
],
[
107,
108
],
[
107,
109
],
[
85,
110
],
[
110,
111
],
[
85,
112
],
[
112,
113
],
[
0,
114
],
[
114,
115
],
[
114,
116
]
] |
[
"import java.util.Scanner;\n\n/**\n * C - Sum of gcd of Tuples (Easy)\n * K∑a=1 K∑b=1 K∑c=1 gcd(a,b,c) を求めてください。\n * ただし、gcd(a,b,c) は a,b,c の最大公約数を表します。\n */\npublic class Main {\n\n public static void main(String[] args) {\n\n Scanner sc = new Scanner( System.in );\n // 入力値\n long n = sc.nextLong();\n\n long sum = 0;\n for( int i = 1; i <= n; i++ ) {\n long gcd1 = 0;\n for( int j = 1; j <= n; j++ ) {\n gcd1 = gcd( i, j );\n for( int k = 1; k <= n; k++ ) {\n sum += gcd( gcd1, k );\n }\n }\n }\n\n System.out.println( sum );\n\n sc.close();\n }\n\n /*\n * 最大公約数を求める\n */\n private static long gcd( long m, long n ) {\n if( m < n ) return gcd(n, m);\n if( n == 0 ) return m;\n return gcd( n, m % n );\n }\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n\n public static void main(String[] args) {\n\n Scanner sc = new Scanner( System.in );\n // 入力値\n long n = sc.nextLong();\n\n long sum = 0;\n for( int i = 1; i <= n; i++ ) {\n long gcd1 = 0;\n for( int j = 1; j <= n; j++ ) {\n gcd1 = gcd( i, j );\n for( int k = 1; k <= n; k++ ) {\n sum += gcd( gcd1, k );\n }\n }\n }\n\n System.out.println( sum );\n\n sc.close();\n }\n\n /*\n * 最大公約数を求める\n */\n private static long gcd( long m, long n ) {\n if( m < n ) return gcd(n, m);\n if( n == 0 ) return m;\n return gcd( n, m % n );\n }\n}",
"Main",
"public static void main(String[] args) {\n\n Scanner sc = new Scanner( System.in );\n // 入力値\n long n = sc.nextLong();\n\n long sum = 0;\n for( int i = 1; i <= n; i++ ) {\n long gcd1 = 0;\n for( int j = 1; j <= n; j++ ) {\n gcd1 = gcd( i, j );\n for( int k = 1; k <= n; k++ ) {\n sum += gcd( gcd1, k );\n }\n }\n }\n\n System.out.println( sum );\n\n sc.close();\n }",
"main",
"{\n\n Scanner sc = new Scanner( System.in );\n // 入力値\n long n = sc.nextLong();\n\n long sum = 0;\n for( int i = 1; i <= n; i++ ) {\n long gcd1 = 0;\n for( int j = 1; j <= n; j++ ) {\n gcd1 = gcd( i, j );\n for( int k = 1; k <= n; k++ ) {\n sum += gcd( gcd1, k );\n }\n }\n }\n\n System.out.println( sum );\n\n sc.close();\n }",
"Scanner sc = new Scanner( System.in );",
"sc",
"new Scanner( System.in )",
"long n = sc.nextLong();",
"n",
"sc.nextLong()",
"sc.nextLong",
"sc",
"long sum = 0;",
"sum",
"0",
"for( int i = 1; i <= n; i++ ) {\n long gcd1 = 0;\n for( int j = 1; j <= n; j++ ) {\n gcd1 = gcd( i, j );\n for( int k = 1; k <= n; k++ ) {\n sum += gcd( gcd1, k );\n }\n }\n }",
"int i = 1;",
"int i = 1;",
"i",
"1",
"i <= n",
"i",
"n",
"i++",
"i++",
"i",
"{\n long gcd1 = 0;\n for( int j = 1; j <= n; j++ ) {\n gcd1 = gcd( i, j );\n for( int k = 1; k <= n; k++ ) {\n sum += gcd( gcd1, k );\n }\n }\n }",
"{\n long gcd1 = 0;\n for( int j = 1; j <= n; j++ ) {\n gcd1 = gcd( i, j );\n for( int k = 1; k <= n; k++ ) {\n sum += gcd( gcd1, k );\n }\n }\n }",
"long gcd1 = 0;",
"gcd1",
"0",
"for( int j = 1; j <= n; j++ ) {\n gcd1 = gcd( i, j );\n for( int k = 1; k <= n; k++ ) {\n sum += gcd( gcd1, k );\n }\n }",
"int j = 1;",
"int j = 1;",
"j",
"1",
"j <= n",
"j",
"n",
"j++",
"j++",
"j",
"{\n gcd1 = gcd( i, j );\n for( int k = 1; k <= n; k++ ) {\n sum += gcd( gcd1, k );\n }\n }",
"{\n gcd1 = gcd( i, j );\n for( int k = 1; k <= n; k++ ) {\n sum += gcd( gcd1, k );\n }\n }",
"gcd1 = gcd( i, j )",
"gcd1",
"gcd( i, j )",
"gcd",
"i",
"j",
"for( int k = 1; k <= n; k++ ) {\n sum += gcd( gcd1, k );\n }",
"int k = 1;",
"int k = 1;",
"k",
"1",
"k <= n",
"k",
"n",
"k++",
"k++",
"k",
"{\n sum += gcd( gcd1, k );\n }",
"{\n sum += gcd( gcd1, k );\n }",
"sum += gcd( gcd1, k )",
"sum",
"gcd( gcd1, k )",
"gcd",
"gcd1",
"k",
"System.out.println( sum )",
"System.out.println",
"System.out",
"System",
"System.out",
"sum",
"sc.close()",
"sc.close",
"sc",
"String[] args",
"args",
"/*\n * 最大公約数を求める\n */\n private static long gcd( long m, long n ) {\n if( m < n ) return gcd(n, m);\n if( n == 0 ) return m;\n return gcd( n, m % n );\n }",
"gcd",
"{\n if( m < n ) return gcd(n, m);\n if( n == 0 ) return m;\n return gcd( n, m % n );\n }",
"if( m < n ) return gcd(n, m);",
"m < n",
"m",
"n",
"return gcd(n, m);",
"gcd(n, m)",
"gcd",
"n",
"m",
"if( n == 0 ) return m;",
"n == 0",
"n",
"0",
"return m;",
"m",
"return gcd( n, m % n );",
"gcd( n, m % n )",
"gcd",
"n",
"m % n",
"m",
"n",
"long m",
"m",
"long n",
"n",
"public class Main {\n\n public static void main(String[] args) {\n\n Scanner sc = new Scanner( System.in );\n // 入力値\n long n = sc.nextLong();\n\n long sum = 0;\n for( int i = 1; i <= n; i++ ) {\n long gcd1 = 0;\n for( int j = 1; j <= n; j++ ) {\n gcd1 = gcd( i, j );\n for( int k = 1; k <= n; k++ ) {\n sum += gcd( gcd1, k );\n }\n }\n }\n\n System.out.println( sum );\n\n sc.close();\n }\n\n /*\n * 最大公約数を求める\n */\n private static long gcd( long m, long n ) {\n if( m < n ) return gcd(n, m);\n if( n == 0 ) return m;\n return gcd( n, m % n );\n }\n}",
"public class Main {\n\n public static void main(String[] args) {\n\n Scanner sc = new Scanner( System.in );\n // 入力値\n long n = sc.nextLong();\n\n long sum = 0;\n for( int i = 1; i <= n; i++ ) {\n long gcd1 = 0;\n for( int j = 1; j <= n; j++ ) {\n gcd1 = gcd( i, j );\n for( int k = 1; k <= n; k++ ) {\n sum += gcd( gcd1, k );\n }\n }\n }\n\n System.out.println( sum );\n\n sc.close();\n }\n\n /*\n * 最大公約数を求める\n */\n private static long gcd( long m, long n ) {\n if( m < n ) return gcd(n, m);\n if( n == 0 ) return m;\n return gcd( n, m % n );\n }\n}",
"Main"
] |
import java.util.Scanner;
/**
* C - Sum of gcd of Tuples (Easy)
* K∑a=1 K∑b=1 K∑c=1 gcd(a,b,c) を求めてください。
* ただし、gcd(a,b,c) は a,b,c の最大公約数を表します。
*/
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner( System.in );
// 入力値
long n = sc.nextLong();
long sum = 0;
for( int i = 1; i <= n; i++ ) {
long gcd1 = 0;
for( int j = 1; j <= n; j++ ) {
gcd1 = gcd( i, j );
for( int k = 1; k <= n; k++ ) {
sum += gcd( gcd1, k );
}
}
}
System.out.println( sum );
sc.close();
}
/*
* 最大公約数を求める
*/
private static long gcd( long m, long n ) {
if( m < n ) return gcd(n, m);
if( n == 0 ) return m;
return gcd( n, m % n );
}
}
|
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
17,
41,
13,
4,
18,
13,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
4,
13,
4,
13,
13,
13,
13,
4,
18,
18,
13,
13,
13,
23,
13,
12,
13,
30,
14,
2,
13,
17,
29,
13,
29,
4,
13,
2,
13,
13,
13,
23,
13,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
103,
5
],
[
103,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
8,
17
],
[
17,
18
],
[
17,
19
],
[
8,
20
],
[
20,
21
],
[
20,
22
],
[
22,
23
],
[
23,
24
],
[
22,
25
],
[
8,
26
],
[
26,
27
],
[
27,
28
],
[
28,
29
],
[
28,
30
],
[
26,
31
],
[
31,
32
],
[
31,
33
],
[
26,
34
],
[
34,
35
],
[
35,
36
],
[
26,
37
],
[
38,
38
],
[
38,
39
],
[
39,
40
],
[
40,
41
],
[
41,
42
],
[
41,
43
],
[
39,
44
],
[
44,
45
],
[
44,
46
],
[
39,
47
],
[
47,
48
],
[
48,
49
],
[
39,
50
],
[
51,
51
],
[
51,
52
],
[
52,
53
],
[
53,
54
],
[
54,
55
],
[
54,
56
],
[
52,
57
],
[
57,
58
],
[
57,
59
],
[
52,
60
],
[
60,
61
],
[
61,
62
],
[
52,
63
],
[
64,
64
],
[
64,
65
],
[
65,
66
],
[
65,
67
],
[
67,
68
],
[
67,
69
],
[
69,
70
],
[
69,
71
],
[
69,
72
],
[
67,
73
],
[
8,
74
],
[
74,
75
],
[
75,
76
],
[
76,
77
],
[
76,
78
],
[
74,
79
],
[
6,
80
],
[
80,
81
],
[
103,
82
],
[
82,
83
],
[
82,
84
],
[
84,
85
],
[
85,
86
],
[
86,
87
],
[
86,
88
],
[
85,
89
],
[
89,
90
],
[
84,
91
],
[
91,
92
],
[
92,
93
],
[
92,
94
],
[
94,
95
],
[
94,
96
],
[
92,
97
],
[
82,
98
],
[
98,
99
],
[
82,
100
],
[
100,
101
],
[
0,
102
],
[
102,
103
],
[
102,
104
]
] |
[
"import java.util.Scanner;\n\npublic class Main {\n\n\tpublic static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\tString s = sc.nextLine();\n\t\tlong sum = 0;\n\t\tint K = Integer.valueOf(s);\n\t\t\n\t\tfor (int i = 1; i <= K; i++) {\n\t\t\tfor (int j = 1; j <= K; j++) {\n\t\t\t\tfor (int k = 1; k <= K; k++) {\n\t\t\t\t\tsum += gcd(gcd(i, j), k);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(sum);\n\t}\n\n\tstatic int gcd(int a, int b) {\n\t\tif (a == 0)\n\t\t\treturn b;\n\t\treturn gcd(b % a, a);\n\t}\n\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n\n\tpublic static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\tString s = sc.nextLine();\n\t\tlong sum = 0;\n\t\tint K = Integer.valueOf(s);\n\t\t\n\t\tfor (int i = 1; i <= K; i++) {\n\t\t\tfor (int j = 1; j <= K; j++) {\n\t\t\t\tfor (int k = 1; k <= K; k++) {\n\t\t\t\t\tsum += gcd(gcd(i, j), k);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(sum);\n\t}\n\n\tstatic int gcd(int a, int b) {\n\t\tif (a == 0)\n\t\t\treturn b;\n\t\treturn gcd(b % a, a);\n\t}\n\n}",
"Main",
"public static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\tString s = sc.nextLine();\n\t\tlong sum = 0;\n\t\tint K = Integer.valueOf(s);\n\t\t\n\t\tfor (int i = 1; i <= K; i++) {\n\t\t\tfor (int j = 1; j <= K; j++) {\n\t\t\t\tfor (int k = 1; k <= K; k++) {\n\t\t\t\t\tsum += gcd(gcd(i, j), k);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(sum);\n\t}",
"main",
"{\n\t\tScanner sc = new Scanner(System.in);\n\t\tString s = sc.nextLine();\n\t\tlong sum = 0;\n\t\tint K = Integer.valueOf(s);\n\t\t\n\t\tfor (int i = 1; i <= K; i++) {\n\t\t\tfor (int j = 1; j <= K; j++) {\n\t\t\t\tfor (int k = 1; k <= K; k++) {\n\t\t\t\t\tsum += gcd(gcd(i, j), k);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(sum);\n\t}",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"String s = sc.nextLine();",
"s",
"sc.nextLine()",
"sc.nextLine",
"sc",
"long sum = 0;",
"sum",
"0",
"int K = Integer.valueOf(s);",
"K",
"Integer.valueOf(s)",
"Integer.valueOf",
"Integer",
"s",
"for (int i = 1; i <= K; i++) {\n\t\t\tfor (int j = 1; j <= K; j++) {\n\t\t\t\tfor (int k = 1; k <= K; k++) {\n\t\t\t\t\tsum += gcd(gcd(i, j), k);\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"int i = 1;",
"int i = 1;",
"i",
"1",
"i <= K",
"i",
"K",
"i++",
"i++",
"i",
"{\n\t\t\tfor (int j = 1; j <= K; j++) {\n\t\t\t\tfor (int k = 1; k <= K; k++) {\n\t\t\t\t\tsum += gcd(gcd(i, j), k);\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"{\n\t\t\tfor (int j = 1; j <= K; j++) {\n\t\t\t\tfor (int k = 1; k <= K; k++) {\n\t\t\t\t\tsum += gcd(gcd(i, j), k);\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"for (int j = 1; j <= K; j++) {\n\t\t\t\tfor (int k = 1; k <= K; k++) {\n\t\t\t\t\tsum += gcd(gcd(i, j), k);\n\t\t\t\t}\n\t\t\t}",
"int j = 1;",
"int j = 1;",
"j",
"1",
"j <= K",
"j",
"K",
"j++",
"j++",
"j",
"{\n\t\t\t\tfor (int k = 1; k <= K; k++) {\n\t\t\t\t\tsum += gcd(gcd(i, j), k);\n\t\t\t\t}\n\t\t\t}",
"{\n\t\t\t\tfor (int k = 1; k <= K; k++) {\n\t\t\t\t\tsum += gcd(gcd(i, j), k);\n\t\t\t\t}\n\t\t\t}",
"for (int k = 1; k <= K; k++) {\n\t\t\t\t\tsum += gcd(gcd(i, j), k);\n\t\t\t\t}",
"int k = 1;",
"int k = 1;",
"k",
"1",
"k <= K",
"k",
"K",
"k++",
"k++",
"k",
"{\n\t\t\t\t\tsum += gcd(gcd(i, j), k);\n\t\t\t\t}",
"{\n\t\t\t\t\tsum += gcd(gcd(i, j), k);\n\t\t\t\t}",
"sum += gcd(gcd(i, j), k)",
"sum",
"gcd(gcd(i, j), k)",
"gcd",
"gcd(i, j)",
"gcd",
"i",
"j",
"k",
"System.out.println(sum)",
"System.out.println",
"System.out",
"System",
"System.out",
"sum",
"String[] args",
"args",
"static int gcd(int a, int b) {\n\t\tif (a == 0)\n\t\t\treturn b;\n\t\treturn gcd(b % a, a);\n\t}",
"gcd",
"{\n\t\tif (a == 0)\n\t\t\treturn b;\n\t\treturn gcd(b % a, a);\n\t}",
"if (a == 0)\n\t\t\treturn b;",
"a == 0",
"a",
"0",
"return b;",
"b",
"return gcd(b % a, a);",
"gcd(b % a, a)",
"gcd",
"b % a",
"b",
"a",
"a",
"int a",
"a",
"int b",
"b",
"public class Main {\n\n\tpublic static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\tString s = sc.nextLine();\n\t\tlong sum = 0;\n\t\tint K = Integer.valueOf(s);\n\t\t\n\t\tfor (int i = 1; i <= K; i++) {\n\t\t\tfor (int j = 1; j <= K; j++) {\n\t\t\t\tfor (int k = 1; k <= K; k++) {\n\t\t\t\t\tsum += gcd(gcd(i, j), k);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(sum);\n\t}\n\n\tstatic int gcd(int a, int b) {\n\t\tif (a == 0)\n\t\t\treturn b;\n\t\treturn gcd(b % a, a);\n\t}\n\n}",
"public class Main {\n\n\tpublic static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\tString s = sc.nextLine();\n\t\tlong sum = 0;\n\t\tint K = Integer.valueOf(s);\n\t\t\n\t\tfor (int i = 1; i <= K; i++) {\n\t\t\tfor (int j = 1; j <= K; j++) {\n\t\t\t\tfor (int k = 1; k <= K; k++) {\n\t\t\t\t\tsum += gcd(gcd(i, j), k);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(sum);\n\t}\n\n\tstatic int gcd(int a, int b) {\n\t\tif (a == 0)\n\t\t\treturn b;\n\t\treturn gcd(b % a, a);\n\t}\n\n}",
"Main"
] |
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
String s = sc.nextLine();
long sum = 0;
int K = Integer.valueOf(s);
for (int i = 1; i <= K; i++) {
for (int j = 1; j <= K; j++) {
for (int k = 1; k <= K; k++) {
sum += gcd(gcd(i, j), k);
}
}
}
System.out.println(sum);
}
static int gcd(int a, int b) {
if (a == 0)
return b;
return gcd(b % a, a);
}
}
|
[
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,
41,
13,
4,
18,
13,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
4,
13,
13,
4,
13,
13,
13,
4,
18,
18,
13,
13,
13,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
102,
8
],
[
102,
9
],
[
9,
10
],
[
9,
11
],
[
11,
12
],
[
12,
13
],
[
13,
14
],
[
13,
15
],
[
12,
16
],
[
16,
17
],
[
17,
18
],
[
12,
19
],
[
19,
20
],
[
20,
21
],
[
21,
22
],
[
21,
23
],
[
21,
24
],
[
24,
25
],
[
24,
26
],
[
9,
27
],
[
27,
28
],
[
9,
29
],
[
29,
30
],
[
102,
31
],
[
31,
32
],
[
31,
33
],
[
33,
34
],
[
34,
35
],
[
34,
36
],
[
33,
37
],
[
37,
38
],
[
37,
39
],
[
39,
40
],
[
40,
41
],
[
33,
42
],
[
42,
43
],
[
42,
44
],
[
33,
45
],
[
45,
46
],
[
46,
47
],
[
47,
48
],
[
47,
49
],
[
45,
50
],
[
50,
51
],
[
50,
52
],
[
45,
53
],
[
53,
54
],
[
54,
55
],
[
45,
56
],
[
57,
57
],
[
57,
58
],
[
58,
59
],
[
59,
60
],
[
60,
61
],
[
60,
62
],
[
58,
63
],
[
63,
64
],
[
63,
65
],
[
58,
66
],
[
66,
67
],
[
67,
68
],
[
58,
69
],
[
70,
70
],
[
70,
71
],
[
71,
72
],
[
72,
73
],
[
73,
74
],
[
73,
75
],
[
71,
76
],
[
76,
77
],
[
76,
78
],
[
71,
79
],
[
79,
80
],
[
80,
81
],
[
71,
82
],
[
83,
83
],
[
83,
84
],
[
84,
85
],
[
84,
86
],
[
86,
87
],
[
86,
88
],
[
86,
89
],
[
89,
90
],
[
89,
91
],
[
89,
92
],
[
33,
93
],
[
93,
94
],
[
94,
95
],
[
95,
96
],
[
95,
97
],
[
93,
98
],
[
31,
99
],
[
99,
100
],
[
0,
101
],
[
101,
102
],
[
101,
103
]
] |
[
"import java.util.*;\nimport java.util.Arrays;\npublic class Main{\n private static int euclid(int m, int n) {\n if(n==0){\n return m;\n }\n else{\n return euclid(n, m%n);\n }\n }\n public static void main(String[] args){\n Scanner sc = new Scanner(System.in);\n int n = sc.nextInt();\n int result = 0;\n \n for(int i = 1; i <= n; i++) {\n for(int j = 1; j <= n; j++) {\n for(int k = 1; k <= n; k++) {\n result += euclid(j,euclid(k,i));\n }\n }\n }\n System.out.println(result);\n \n\n\n }\n}",
"import java.util.*;",
"util.*",
"java",
"import java.util.Arrays;",
"Arrays",
"java.util",
"public class Main{\n private static int euclid(int m, int n) {\n if(n==0){\n return m;\n }\n else{\n return euclid(n, m%n);\n }\n }\n public static void main(String[] args){\n Scanner sc = new Scanner(System.in);\n int n = sc.nextInt();\n int result = 0;\n \n for(int i = 1; i <= n; i++) {\n for(int j = 1; j <= n; j++) {\n for(int k = 1; k <= n; k++) {\n result += euclid(j,euclid(k,i));\n }\n }\n }\n System.out.println(result);\n \n\n\n }\n}",
"Main",
"private static int euclid(int m, int n) {\n if(n==0){\n return m;\n }\n else{\n return euclid(n, m%n);\n }\n }",
"euclid",
"{\n if(n==0){\n return m;\n }\n else{\n return euclid(n, m%n);\n }\n }",
"if(n==0){\n return m;\n }\n else{\n return euclid(n, m%n);\n }",
"n==0",
"n",
"0",
"{\n return m;\n }",
"return m;",
"m",
"{\n return euclid(n, m%n);\n }",
"return euclid(n, m%n);",
"euclid(n, m%n)",
"euclid",
"n",
"m%n",
"m",
"n",
"int m",
"m",
"int n",
"n",
"public static void main(String[] args){\n Scanner sc = new Scanner(System.in);\n int n = sc.nextInt();\n int result = 0;\n \n for(int i = 1; i <= n; i++) {\n for(int j = 1; j <= n; j++) {\n for(int k = 1; k <= n; k++) {\n result += euclid(j,euclid(k,i));\n }\n }\n }\n System.out.println(result);\n \n\n\n }",
"main",
"{\n Scanner sc = new Scanner(System.in);\n int n = sc.nextInt();\n int result = 0;\n \n for(int i = 1; i <= n; i++) {\n for(int j = 1; j <= n; j++) {\n for(int k = 1; k <= n; k++) {\n result += euclid(j,euclid(k,i));\n }\n }\n }\n System.out.println(result);\n \n\n\n }",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"int n = sc.nextInt();",
"n",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int result = 0;",
"result",
"0",
"for(int i = 1; i <= n; i++) {\n for(int j = 1; j <= n; j++) {\n for(int k = 1; k <= n; k++) {\n result += euclid(j,euclid(k,i));\n }\n }\n }",
"int i = 1;",
"int i = 1;",
"i",
"1",
"i <= n",
"i",
"n",
"i++",
"i++",
"i",
"{\n for(int j = 1; j <= n; j++) {\n for(int k = 1; k <= n; k++) {\n result += euclid(j,euclid(k,i));\n }\n }\n }",
"{\n for(int j = 1; j <= n; j++) {\n for(int k = 1; k <= n; k++) {\n result += euclid(j,euclid(k,i));\n }\n }\n }",
"for(int j = 1; j <= n; j++) {\n for(int k = 1; k <= n; k++) {\n result += euclid(j,euclid(k,i));\n }\n }",
"int j = 1;",
"int j = 1;",
"j",
"1",
"j <= n",
"j",
"n",
"j++",
"j++",
"j",
"{\n for(int k = 1; k <= n; k++) {\n result += euclid(j,euclid(k,i));\n }\n }",
"{\n for(int k = 1; k <= n; k++) {\n result += euclid(j,euclid(k,i));\n }\n }",
"for(int k = 1; k <= n; k++) {\n result += euclid(j,euclid(k,i));\n }",
"int k = 1;",
"int k = 1;",
"k",
"1",
"k <= n",
"k",
"n",
"k++",
"k++",
"k",
"{\n result += euclid(j,euclid(k,i));\n }",
"{\n result += euclid(j,euclid(k,i));\n }",
"result += euclid(j,euclid(k,i))",
"result",
"euclid(j,euclid(k,i))",
"euclid",
"j",
"euclid(k,i)",
"euclid",
"k",
"i",
"System.out.println(result)",
"System.out.println",
"System.out",
"System",
"System.out",
"result",
"String[] args",
"args",
"public class Main{\n private static int euclid(int m, int n) {\n if(n==0){\n return m;\n }\n else{\n return euclid(n, m%n);\n }\n }\n public static void main(String[] args){\n Scanner sc = new Scanner(System.in);\n int n = sc.nextInt();\n int result = 0;\n \n for(int i = 1; i <= n; i++) {\n for(int j = 1; j <= n; j++) {\n for(int k = 1; k <= n; k++) {\n result += euclid(j,euclid(k,i));\n }\n }\n }\n System.out.println(result);\n \n\n\n }\n}",
"public class Main{\n private static int euclid(int m, int n) {\n if(n==0){\n return m;\n }\n else{\n return euclid(n, m%n);\n }\n }\n public static void main(String[] args){\n Scanner sc = new Scanner(System.in);\n int n = sc.nextInt();\n int result = 0;\n \n for(int i = 1; i <= n; i++) {\n for(int j = 1; j <= n; j++) {\n for(int k = 1; k <= n; k++) {\n result += euclid(j,euclid(k,i));\n }\n }\n }\n System.out.println(result);\n \n\n\n }\n}",
"Main"
] |
import java.util.*;
import java.util.Arrays;
public class Main{
private static int euclid(int m, int n) {
if(n==0){
return m;
}
else{
return euclid(n, m%n);
}
}
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
int result = 0;
for(int i = 1; i <= n; i++) {
for(int j = 1; j <= n; j++) {
for(int k = 1; k <= n; k++) {
result += euclid(j,euclid(k,i));
}
}
}
System.out.println(result);
}
}
|
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
42,
2,
13,
17,
30,
0,
13,
2,
13,
13,
0,
13,
13,
0,
13,
13,
42,
2,
13,
17,
30,
0,
13,
2,
13,
13,
0,
13,
13,
0,
13,
13,
29,
13,
23,
13,
23,
13,
23,
13,
6,
13,
12,
13,
30,
41,
13,
41,
13,
41,
13,
38,
5,
13,
30,
30,
41,
13,
20,
0,
13,
4,
18,
13,
0,
13,
4,
18,
13,
13,
0,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
4,
18,
13,
13,
13,
13,
4,
18,
18,
13,
13,
4,
18,
13,
13,
23,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
8,
11
],
[
11,
12
],
[
12,
13
],
[
12,
14
],
[
11,
15
],
[
15,
16
],
[
16,
17
],
[
16,
18
],
[
18,
19
],
[
18,
20
],
[
15,
21
],
[
21,
22
],
[
21,
23
],
[
15,
24
],
[
24,
25
],
[
24,
26
],
[
8,
27
],
[
27,
28
],
[
28,
29
],
[
28,
30
],
[
27,
31
],
[
31,
32
],
[
32,
33
],
[
32,
34
],
[
34,
35
],
[
34,
36
],
[
31,
37
],
[
37,
38
],
[
37,
39
],
[
31,
40
],
[
40,
41
],
[
40,
42
],
[
8,
43
],
[
43,
44
],
[
6,
45
],
[
45,
46
],
[
6,
47
],
[
47,
48
],
[
6,
49
],
[
49,
50
],
[
0,
51
],
[
51,
52
],
[
51,
53
],
[
53,
54
],
[
53,
55
],
[
55,
56
],
[
56,
57
],
[
55,
58
],
[
58,
59
],
[
55,
60
],
[
60,
61
],
[
55,
62
],
[
62,
63
],
[
63,
64
],
[
63,
65
],
[
62,
66
],
[
66,
67
],
[
67,
68
],
[
67,
69
],
[
66,
70
],
[
70,
71
],
[
70,
72
],
[
72,
73
],
[
73,
74
],
[
66,
75
],
[
75,
76
],
[
75,
77
],
[
77,
78
],
[
78,
79
],
[
77,
80
],
[
66,
81
],
[
81,
82
],
[
81,
83
],
[
66,
84
],
[
84,
85
],
[
85,
86
],
[
86,
87
],
[
86,
88
],
[
84,
89
],
[
89,
90
],
[
89,
91
],
[
84,
92
],
[
92,
93
],
[
93,
94
],
[
84,
95
],
[
96,
96
],
[
96,
97
],
[
97,
98
],
[
98,
99
],
[
99,
100
],
[
99,
101
],
[
97,
102
],
[
102,
103
],
[
102,
104
],
[
97,
105
],
[
105,
106
],
[
106,
107
],
[
97,
108
],
[
109,
109
],
[
109,
110
],
[
110,
111
],
[
111,
112
],
[
112,
113
],
[
112,
114
],
[
110,
115
],
[
115,
116
],
[
115,
117
],
[
110,
118
],
[
118,
119
],
[
119,
120
],
[
110,
121
],
[
122,
122
],
[
122,
123
],
[
123,
124
],
[
123,
125
],
[
125,
126
],
[
126,
127
],
[
125,
128
],
[
125,
129
],
[
125,
130
],
[
66,
131
],
[
131,
132
],
[
132,
133
],
[
133,
134
],
[
133,
135
],
[
131,
136
],
[
136,
137
],
[
137,
138
],
[
136,
139
],
[
53,
140
],
[
140,
141
]
] |
[
"import java.io.*;\n\nclass Calc{\n public static int gcd(int a, int b, int c) {\n int r;\n while (b > 0) {\n r = a % b;\n a = b;\n b = r;\n }\n while (c > 0) {\n r = a % c;\n a = c;\n c = r;\n }\n return a;\n }\n}\n\nclass Main{\n\n public static void main(String args[])\n {\n String buf;\n int num;\n int ans;\n try {\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n buf = br.readLine();\n num = Integer.parseInt(buf);\n ans = 0;\n for(int i = 1; i <= num; i++){\n for(int j = 1; j <= num; j++){\n for(int k = 1; k <= num; k++){ \n ans += Calc.gcd(i,j,k);\n }\n }\n }\n \n System.out.println(Integer.toString(ans));\n } catch(Exception e) {}\n }\n}",
"import java.io.*;",
"io.*",
"java",
"class Calc{\n public static int gcd(int a, int b, int c) {\n int r;\n while (b > 0) {\n r = a % b;\n a = b;\n b = r;\n }\n while (c > 0) {\n r = a % c;\n a = c;\n c = r;\n }\n return a;\n }\n}",
"Calc",
"public static int gcd(int a, int b, int c) {\n int r;\n while (b > 0) {\n r = a % b;\n a = b;\n b = r;\n }\n while (c > 0) {\n r = a % c;\n a = c;\n c = r;\n }\n return a;\n }",
"gcd",
"{\n int r;\n while (b > 0) {\n r = a % b;\n a = b;\n b = r;\n }\n while (c > 0) {\n r = a % c;\n a = c;\n c = r;\n }\n return a;\n }",
"int r;",
"r",
"while (b > 0) {\n r = a % b;\n a = b;\n b = r;\n }",
"b > 0",
"b",
"0",
"{\n r = a % b;\n a = b;\n b = r;\n }",
"r = a % b",
"r",
"a % b",
"a",
"b",
"a = b",
"a",
"b",
"b = r",
"b",
"r",
"while (c > 0) {\n r = a % c;\n a = c;\n c = r;\n }",
"c > 0",
"c",
"0",
"{\n r = a % c;\n a = c;\n c = r;\n }",
"r = a % c",
"r",
"a % c",
"a",
"c",
"a = c",
"a",
"c",
"c = r",
"c",
"r",
"return a;",
"a",
"int a",
"a",
"int b",
"b",
"int c",
"c",
"class Main{\n\n public static void main(String args[])\n {\n String buf;\n int num;\n int ans;\n try {\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n buf = br.readLine();\n num = Integer.parseInt(buf);\n ans = 0;\n for(int i = 1; i <= num; i++){\n for(int j = 1; j <= num; j++){\n for(int k = 1; k <= num; k++){ \n ans += Calc.gcd(i,j,k);\n }\n }\n }\n \n System.out.println(Integer.toString(ans));\n } catch(Exception e) {}\n }\n}",
"Main",
"public static void main(String args[])\n {\n String buf;\n int num;\n int ans;\n try {\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n buf = br.readLine();\n num = Integer.parseInt(buf);\n ans = 0;\n for(int i = 1; i <= num; i++){\n for(int j = 1; j <= num; j++){\n for(int k = 1; k <= num; k++){ \n ans += Calc.gcd(i,j,k);\n }\n }\n }\n \n System.out.println(Integer.toString(ans));\n } catch(Exception e) {}\n }",
"main",
"{\n String buf;\n int num;\n int ans;\n try {\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n buf = br.readLine();\n num = Integer.parseInt(buf);\n ans = 0;\n for(int i = 1; i <= num; i++){\n for(int j = 1; j <= num; j++){\n for(int k = 1; k <= num; k++){ \n ans += Calc.gcd(i,j,k);\n }\n }\n }\n \n System.out.println(Integer.toString(ans));\n } catch(Exception e) {}\n }",
"String buf;",
"buf",
"int num;",
"num",
"int ans;",
"ans",
"try {\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n buf = br.readLine();\n num = Integer.parseInt(buf);\n ans = 0;\n for(int i = 1; i <= num; i++){\n for(int j = 1; j <= num; j++){\n for(int k = 1; k <= num; k++){ \n ans += Calc.gcd(i,j,k);\n }\n }\n }\n \n System.out.println(Integer.toString(ans));\n } catch(Exception e) {}",
"catch(Exception e) {}",
"Exception e",
"{}",
"{\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n buf = br.readLine();\n num = Integer.parseInt(buf);\n ans = 0;\n for(int i = 1; i <= num; i++){\n for(int j = 1; j <= num; j++){\n for(int k = 1; k <= num; k++){ \n ans += Calc.gcd(i,j,k);\n }\n }\n }\n \n System.out.println(Integer.toString(ans));\n }",
"BufferedReader br = new BufferedReader(new InputStreamReader(System.in));",
"br",
"new BufferedReader(new InputStreamReader(System.in))",
"buf = br.readLine()",
"buf",
"br.readLine()",
"br.readLine",
"br",
"num = Integer.parseInt(buf)",
"num",
"Integer.parseInt(buf)",
"Integer.parseInt",
"Integer",
"buf",
"ans = 0",
"ans",
"0",
"for(int i = 1; i <= num; i++){\n for(int j = 1; j <= num; j++){\n for(int k = 1; k <= num; k++){ \n ans += Calc.gcd(i,j,k);\n }\n }\n }",
"int i = 1;",
"int i = 1;",
"i",
"1",
"i <= num",
"i",
"num",
"i++",
"i++",
"i",
"{\n for(int j = 1; j <= num; j++){\n for(int k = 1; k <= num; k++){ \n ans += Calc.gcd(i,j,k);\n }\n }\n }",
"{\n for(int j = 1; j <= num; j++){\n for(int k = 1; k <= num; k++){ \n ans += Calc.gcd(i,j,k);\n }\n }\n }",
"for(int j = 1; j <= num; j++){\n for(int k = 1; k <= num; k++){ \n ans += Calc.gcd(i,j,k);\n }\n }",
"int j = 1;",
"int j = 1;",
"j",
"1",
"j <= num",
"j",
"num",
"j++",
"j++",
"j",
"{\n for(int k = 1; k <= num; k++){ \n ans += Calc.gcd(i,j,k);\n }\n }",
"{\n for(int k = 1; k <= num; k++){ \n ans += Calc.gcd(i,j,k);\n }\n }",
"for(int k = 1; k <= num; k++){ \n ans += Calc.gcd(i,j,k);\n }",
"int k = 1;",
"int k = 1;",
"k",
"1",
"k <= num",
"k",
"num",
"k++",
"k++",
"k",
"{ \n ans += Calc.gcd(i,j,k);\n }",
"{ \n ans += Calc.gcd(i,j,k);\n }",
"ans += Calc.gcd(i,j,k)",
"ans",
"Calc.gcd(i,j,k)",
"Calc.gcd",
"Calc",
"i",
"j",
"k",
"System.out.println(Integer.toString(ans))",
"System.out.println",
"System.out",
"System",
"System.out",
"Integer.toString(ans)",
"Integer.toString",
"Integer",
"ans",
"String args[]",
"args"
] |
import java.io.*;
class Calc{
public static int gcd(int a, int b, int c) {
int r;
while (b > 0) {
r = a % b;
a = b;
b = r;
}
while (c > 0) {
r = a % c;
a = c;
c = r;
}
return a;
}
}
class Main{
public static void main(String args[])
{
String buf;
int num;
int ans;
try {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
buf = br.readLine();
num = Integer.parseInt(buf);
ans = 0;
for(int i = 1; i <= num; i++){
for(int j = 1; j <= num; j++){
for(int k = 1; k <= num; k++){
ans += Calc.gcd(i,j,k);
}
}
}
System.out.println(Integer.toString(ans));
} catch(Exception e) {}
}
}
|
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
11,
1,
41,
13,
13,
2,
13,
13,
1,
40,
13,
30,
30,
11,
1,
41,
13,
13,
2,
13,
13,
1,
40,
13,
30,
30,
14,
2,
2,
13,
13,
2,
13,
13,
30,
0,
13,
4,
13,
13,
13,
13,
14,
2,
2,
2,
13,
13,
2,
13,
13,
2,
13,
13,
30,
0,
13,
2,
4,
13,
13,
13,
13,
17,
30,
0,
13,
2,
4,
13,
13,
13,
13,
17,
4,
18,
18,
13,
13,
13,
23,
13,
12,
13,
30,
41,
13,
41,
13,
13,
41,
13,
13,
41,
13,
42,
2,
0,
13,
2,
13,
13,
17,
30,
0,
13,
13,
0,
13,
13,
0,
13,
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,
2,
13,
13,
17,
30,
0,
13,
13,
0,
13,
13,
29,
13,
23,
13,
23,
13,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
10,
11
],
[
10,
12
],
[
0,
13
],
[
13,
14
],
[
13,
15
],
[
0,
16
],
[
202,
17
],
[
202,
18
],
[
18,
19
],
[
18,
20
],
[
20,
21
],
[
21,
22
],
[
21,
23
],
[
20,
24
],
[
24,
25
],
[
24,
26
],
[
26,
27
],
[
27,
28
],
[
20,
29
],
[
29,
30
],
[
29,
31
],
[
20,
32
],
[
32,
33
],
[
33,
34
],
[
34,
35
],
[
34,
36
],
[
32,
37
],
[
37,
38
],
[
37,
39
],
[
32,
40
],
[
40,
41
],
[
41,
42
],
[
32,
43
],
[
44,
44
],
[
44,
45
],
[
45,
46
],
[
46,
47
],
[
47,
48
],
[
47,
49
],
[
45,
50
],
[
50,
51
],
[
50,
52
],
[
45,
53
],
[
53,
54
],
[
54,
55
],
[
45,
56
],
[
57,
57
],
[
57,
58
],
[
58,
59
],
[
59,
60
],
[
60,
61
],
[
60,
62
],
[
58,
63
],
[
63,
64
],
[
63,
65
],
[
58,
66
],
[
66,
67
],
[
67,
68
],
[
58,
69
],
[
70,
70
],
[
70,
71
],
[
71,
72
],
[
72,
73
],
[
73,
74
],
[
73,
75
],
[
72,
76
],
[
76,
77
],
[
76,
78
],
[
71,
79
],
[
79,
80
],
[
80,
81
],
[
80,
82
],
[
82,
83
],
[
82,
84
],
[
82,
85
],
[
82,
86
],
[
71,
87
],
[
87,
88
],
[
89,
89
],
[
89,
90
],
[
90,
91
],
[
90,
92
],
[
89,
93
],
[
93,
94
],
[
93,
95
],
[
89,
96
],
[
96,
97
],
[
96,
98
],
[
87,
99
],
[
99,
100
],
[
100,
101
],
[
100,
102
],
[
102,
103
],
[
103,
104
],
[
103,
105
],
[
103,
106
],
[
103,
107
],
[
102,
108
],
[
87,
109
],
[
109,
110
],
[
110,
111
],
[
110,
112
],
[
112,
113
],
[
113,
114
],
[
113,
115
],
[
113,
116
],
[
113,
117
],
[
112,
118
],
[
20,
119
],
[
119,
120
],
[
120,
121
],
[
121,
122
],
[
121,
123
],
[
119,
124
],
[
18,
125
],
[
125,
126
],
[
202,
127
],
[
127,
128
],
[
127,
129
],
[
129,
130
],
[
130,
131
],
[
129,
132
],
[
132,
133
],
[
132,
134
],
[
129,
135
],
[
135,
136
],
[
135,
137
],
[
129,
138
],
[
138,
139
],
[
129,
140
],
[
140,
141
],
[
141,
142
],
[
142,
143
],
[
142,
144
],
[
144,
145
],
[
144,
146
],
[
141,
147
],
[
140,
148
],
[
148,
149
],
[
149,
150
],
[
149,
151
],
[
148,
152
],
[
152,
153
],
[
152,
154
],
[
129,
155
],
[
155,
156
],
[
155,
157
],
[
129,
158
],
[
158,
159
],
[
129,
160
],
[
160,
161
],
[
161,
162
],
[
161,
163
],
[
160,
164
],
[
164,
165
],
[
165,
166
],
[
165,
167
],
[
164,
168
],
[
168,
169
],
[
168,
170
],
[
160,
171
],
[
171,
172
],
[
172,
173
],
[
172,
174
],
[
171,
175
],
[
175,
176
],
[
175,
177
],
[
129,
178
],
[
178,
179
],
[
179,
180
],
[
180,
181
],
[
180,
182
],
[
182,
183
],
[
182,
184
],
[
179,
185
],
[
178,
186
],
[
186,
187
],
[
187,
188
],
[
187,
189
],
[
186,
190
],
[
190,
191
],
[
190,
192
],
[
129,
193
],
[
193,
194
],
[
127,
195
],
[
195,
196
],
[
127,
197
],
[
197,
198
],
[
127,
199
],
[
199,
200
],
[
0,
201
],
[
201,
202
],
[
201,
203
]
] |
[
"import java.util.*;\nimport java.util.ArrayDeque;\nimport java.util.Queue;\nimport java.math.RoundingMode;\nimport java.math.BigDecimal;\n\n\npublic class Main{\n\tpublic static void main(String[] args){\n\t\tScanner sc = new Scanner(System.in);\n\t\tlong k = sc.nextLong();\n\t\tlong sum = 0;\n\t\tfor(int i = 1; i <= k; i++) {\n\t\t\tfor(int j = i; j <= k; j++) {\n\t\t\t\tfor(int n = j; n <= k; n++) {\n\t\t\t\t\t//System.out.println(\"Debug\");\n\t\t\t\t\tif(i==j&&j==n) {\n\t\t\t\t\t\tsum+=solve(i,j,n);\n\t\t\t\t\t}\n\t\t\t\t\telse if(i!=j&&j!=n&&n!=i) {\n\t\t\t\t\t\tsum+=solve(i,j,n)*6;\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\t\tsum+=solve(i,j,n)*3;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(sum);\n\t}\n\tprivate static long solve(long i, long j, long n) {\n\t\tlong tmp;\n\t\tlong a = i;\n\t\tlong b = j;\n\t\tlong gcd;\n\t\twhile((tmp = b % a) != 0) {\n\t\t\tb=a;\n\t\t\ta=tmp;\n\t\t}\n\t\tgcd = a;\n\t\tlong c;\n\t\tif(n<gcd) {\n\t\t\ta = n;\n\t\t\tc = gcd;\n\t\t}\n\t\telse {\n\t\t\ta = gcd;\n\t\t\tc = n;\n\t\t}\n\t\twhile((tmp = c % a) != 0) {\n\t\t\tc=a;\n\t\t\ta=tmp;\n\t\t}\n\t\t//System.out.println(a);\n\t\treturn a;\n\t}\n}",
"import java.util.*;",
"util.*",
"java",
"import java.util.ArrayDeque;",
"ArrayDeque",
"java.util",
"import java.util.Queue;",
"Queue",
"java.util",
"import java.math.RoundingMode;",
"RoundingMode",
"java.math",
"import java.math.BigDecimal;",
"BigDecimal",
"java.math",
"public class Main{\n\tpublic static void main(String[] args){\n\t\tScanner sc = new Scanner(System.in);\n\t\tlong k = sc.nextLong();\n\t\tlong sum = 0;\n\t\tfor(int i = 1; i <= k; i++) {\n\t\t\tfor(int j = i; j <= k; j++) {\n\t\t\t\tfor(int n = j; n <= k; n++) {\n\t\t\t\t\t//System.out.println(\"Debug\");\n\t\t\t\t\tif(i==j&&j==n) {\n\t\t\t\t\t\tsum+=solve(i,j,n);\n\t\t\t\t\t}\n\t\t\t\t\telse if(i!=j&&j!=n&&n!=i) {\n\t\t\t\t\t\tsum+=solve(i,j,n)*6;\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\t\tsum+=solve(i,j,n)*3;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(sum);\n\t}\n\tprivate static long solve(long i, long j, long n) {\n\t\tlong tmp;\n\t\tlong a = i;\n\t\tlong b = j;\n\t\tlong gcd;\n\t\twhile((tmp = b % a) != 0) {\n\t\t\tb=a;\n\t\t\ta=tmp;\n\t\t}\n\t\tgcd = a;\n\t\tlong c;\n\t\tif(n<gcd) {\n\t\t\ta = n;\n\t\t\tc = gcd;\n\t\t}\n\t\telse {\n\t\t\ta = gcd;\n\t\t\tc = n;\n\t\t}\n\t\twhile((tmp = c % a) != 0) {\n\t\t\tc=a;\n\t\t\ta=tmp;\n\t\t}\n\t\t//System.out.println(a);\n\t\treturn a;\n\t}\n}",
"Main",
"public static void main(String[] args){\n\t\tScanner sc = new Scanner(System.in);\n\t\tlong k = sc.nextLong();\n\t\tlong sum = 0;\n\t\tfor(int i = 1; i <= k; i++) {\n\t\t\tfor(int j = i; j <= k; j++) {\n\t\t\t\tfor(int n = j; n <= k; n++) {\n\t\t\t\t\t//System.out.println(\"Debug\");\n\t\t\t\t\tif(i==j&&j==n) {\n\t\t\t\t\t\tsum+=solve(i,j,n);\n\t\t\t\t\t}\n\t\t\t\t\telse if(i!=j&&j!=n&&n!=i) {\n\t\t\t\t\t\tsum+=solve(i,j,n)*6;\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\t\tsum+=solve(i,j,n)*3;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(sum);\n\t}",
"main",
"{\n\t\tScanner sc = new Scanner(System.in);\n\t\tlong k = sc.nextLong();\n\t\tlong sum = 0;\n\t\tfor(int i = 1; i <= k; i++) {\n\t\t\tfor(int j = i; j <= k; j++) {\n\t\t\t\tfor(int n = j; n <= k; n++) {\n\t\t\t\t\t//System.out.println(\"Debug\");\n\t\t\t\t\tif(i==j&&j==n) {\n\t\t\t\t\t\tsum+=solve(i,j,n);\n\t\t\t\t\t}\n\t\t\t\t\telse if(i!=j&&j!=n&&n!=i) {\n\t\t\t\t\t\tsum+=solve(i,j,n)*6;\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\t\tsum+=solve(i,j,n)*3;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(sum);\n\t}",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"long k = sc.nextLong();",
"k",
"sc.nextLong()",
"sc.nextLong",
"sc",
"long sum = 0;",
"sum",
"0",
"for(int i = 1; i <= k; i++) {\n\t\t\tfor(int j = i; j <= k; j++) {\n\t\t\t\tfor(int n = j; n <= k; n++) {\n\t\t\t\t\t//System.out.println(\"Debug\");\n\t\t\t\t\tif(i==j&&j==n) {\n\t\t\t\t\t\tsum+=solve(i,j,n);\n\t\t\t\t\t}\n\t\t\t\t\telse if(i!=j&&j!=n&&n!=i) {\n\t\t\t\t\t\tsum+=solve(i,j,n)*6;\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\t\tsum+=solve(i,j,n)*3;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"int i = 1;",
"int i = 1;",
"i",
"1",
"i <= k",
"i",
"k",
"i++",
"i++",
"i",
"{\n\t\t\tfor(int j = i; j <= k; j++) {\n\t\t\t\tfor(int n = j; n <= k; n++) {\n\t\t\t\t\t//System.out.println(\"Debug\");\n\t\t\t\t\tif(i==j&&j==n) {\n\t\t\t\t\t\tsum+=solve(i,j,n);\n\t\t\t\t\t}\n\t\t\t\t\telse if(i!=j&&j!=n&&n!=i) {\n\t\t\t\t\t\tsum+=solve(i,j,n)*6;\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\t\tsum+=solve(i,j,n)*3;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"{\n\t\t\tfor(int j = i; j <= k; j++) {\n\t\t\t\tfor(int n = j; n <= k; n++) {\n\t\t\t\t\t//System.out.println(\"Debug\");\n\t\t\t\t\tif(i==j&&j==n) {\n\t\t\t\t\t\tsum+=solve(i,j,n);\n\t\t\t\t\t}\n\t\t\t\t\telse if(i!=j&&j!=n&&n!=i) {\n\t\t\t\t\t\tsum+=solve(i,j,n)*6;\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\t\tsum+=solve(i,j,n)*3;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"for(int j = i; j <= k; j++) {\n\t\t\t\tfor(int n = j; n <= k; n++) {\n\t\t\t\t\t//System.out.println(\"Debug\");\n\t\t\t\t\tif(i==j&&j==n) {\n\t\t\t\t\t\tsum+=solve(i,j,n);\n\t\t\t\t\t}\n\t\t\t\t\telse if(i!=j&&j!=n&&n!=i) {\n\t\t\t\t\t\tsum+=solve(i,j,n)*6;\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\t\tsum+=solve(i,j,n)*3;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}",
"int j = i;",
"int j = i;",
"j",
"i",
"j <= k",
"j",
"k",
"j++",
"j++",
"j",
"{\n\t\t\t\tfor(int n = j; n <= k; n++) {\n\t\t\t\t\t//System.out.println(\"Debug\");\n\t\t\t\t\tif(i==j&&j==n) {\n\t\t\t\t\t\tsum+=solve(i,j,n);\n\t\t\t\t\t}\n\t\t\t\t\telse if(i!=j&&j!=n&&n!=i) {\n\t\t\t\t\t\tsum+=solve(i,j,n)*6;\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\t\tsum+=solve(i,j,n)*3;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}",
"{\n\t\t\t\tfor(int n = j; n <= k; n++) {\n\t\t\t\t\t//System.out.println(\"Debug\");\n\t\t\t\t\tif(i==j&&j==n) {\n\t\t\t\t\t\tsum+=solve(i,j,n);\n\t\t\t\t\t}\n\t\t\t\t\telse if(i!=j&&j!=n&&n!=i) {\n\t\t\t\t\t\tsum+=solve(i,j,n)*6;\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\t\tsum+=solve(i,j,n)*3;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}",
"for(int n = j; n <= k; n++) {\n\t\t\t\t\t//System.out.println(\"Debug\");\n\t\t\t\t\tif(i==j&&j==n) {\n\t\t\t\t\t\tsum+=solve(i,j,n);\n\t\t\t\t\t}\n\t\t\t\t\telse if(i!=j&&j!=n&&n!=i) {\n\t\t\t\t\t\tsum+=solve(i,j,n)*6;\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\t\tsum+=solve(i,j,n)*3;\n\t\t\t\t\t}\n\t\t\t\t}",
"int n = j;",
"int n = j;",
"n",
"j",
"n <= k",
"n",
"k",
"n++",
"n++",
"n",
"{\n\t\t\t\t\t//System.out.println(\"Debug\");\n\t\t\t\t\tif(i==j&&j==n) {\n\t\t\t\t\t\tsum+=solve(i,j,n);\n\t\t\t\t\t}\n\t\t\t\t\telse if(i!=j&&j!=n&&n!=i) {\n\t\t\t\t\t\tsum+=solve(i,j,n)*6;\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\t\tsum+=solve(i,j,n)*3;\n\t\t\t\t\t}\n\t\t\t\t}",
"{\n\t\t\t\t\t//System.out.println(\"Debug\");\n\t\t\t\t\tif(i==j&&j==n) {\n\t\t\t\t\t\tsum+=solve(i,j,n);\n\t\t\t\t\t}\n\t\t\t\t\telse if(i!=j&&j!=n&&n!=i) {\n\t\t\t\t\t\tsum+=solve(i,j,n)*6;\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\t\tsum+=solve(i,j,n)*3;\n\t\t\t\t\t}\n\t\t\t\t}",
"if(i==j&&j==n) {\n\t\t\t\t\t\tsum+=solve(i,j,n);\n\t\t\t\t\t}\n\t\t\t\t\telse if(i!=j&&j!=n&&n!=i) {\n\t\t\t\t\t\tsum+=solve(i,j,n)*6;\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\t\tsum+=solve(i,j,n)*3;\n\t\t\t\t\t}",
"i==j&&j==n",
"i==j",
"i",
"j",
"j==n",
"j",
"n",
"{\n\t\t\t\t\t\tsum+=solve(i,j,n);\n\t\t\t\t\t}",
"sum+=solve(i,j,n)",
"sum",
"solve(i,j,n)",
"solve",
"i",
"j",
"n",
"if(i!=j&&j!=n&&n!=i) {\n\t\t\t\t\t\tsum+=solve(i,j,n)*6;\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\t\tsum+=solve(i,j,n)*3;\n\t\t\t\t\t}",
"i!=j&&j!=n&&n!=i",
"i!=j&&j!=n&&n!=i",
"i!=j",
"i",
"j",
"j!=n",
"j",
"n",
"n!=i",
"n",
"i",
"{\n\t\t\t\t\t\tsum+=solve(i,j,n)*6;\n\t\t\t\t\t}",
"sum+=solve(i,j,n)*6",
"sum",
"solve(i,j,n)*6",
"solve(i,j,n)",
"solve",
"i",
"j",
"n",
"6",
"{\n\t\t\t\t\t\tsum+=solve(i,j,n)*3;\n\t\t\t\t\t}",
"sum+=solve(i,j,n)*3",
"sum",
"solve(i,j,n)*3",
"solve(i,j,n)",
"solve",
"i",
"j",
"n",
"3",
"System.out.println(sum)",
"System.out.println",
"System.out",
"System",
"System.out",
"sum",
"String[] args",
"args",
"private static long solve(long i, long j, long n) {\n\t\tlong tmp;\n\t\tlong a = i;\n\t\tlong b = j;\n\t\tlong gcd;\n\t\twhile((tmp = b % a) != 0) {\n\t\t\tb=a;\n\t\t\ta=tmp;\n\t\t}\n\t\tgcd = a;\n\t\tlong c;\n\t\tif(n<gcd) {\n\t\t\ta = n;\n\t\t\tc = gcd;\n\t\t}\n\t\telse {\n\t\t\ta = gcd;\n\t\t\tc = n;\n\t\t}\n\t\twhile((tmp = c % a) != 0) {\n\t\t\tc=a;\n\t\t\ta=tmp;\n\t\t}\n\t\t//System.out.println(a);\n\t\treturn a;\n\t}",
"solve",
"{\n\t\tlong tmp;\n\t\tlong a = i;\n\t\tlong b = j;\n\t\tlong gcd;\n\t\twhile((tmp = b % a) != 0) {\n\t\t\tb=a;\n\t\t\ta=tmp;\n\t\t}\n\t\tgcd = a;\n\t\tlong c;\n\t\tif(n<gcd) {\n\t\t\ta = n;\n\t\t\tc = gcd;\n\t\t}\n\t\telse {\n\t\t\ta = gcd;\n\t\t\tc = n;\n\t\t}\n\t\twhile((tmp = c % a) != 0) {\n\t\t\tc=a;\n\t\t\ta=tmp;\n\t\t}\n\t\t//System.out.println(a);\n\t\treturn a;\n\t}",
"long tmp;",
"tmp",
"long a = i;",
"a",
"i",
"long b = j;",
"b",
"j",
"long gcd;",
"gcd",
"while((tmp = b % a) != 0) {\n\t\t\tb=a;\n\t\t\ta=tmp;\n\t\t}",
"(tmp = b % a) != 0",
"(tmp = b % a)",
"tmp",
"b % a",
"b",
"a",
"0",
"{\n\t\t\tb=a;\n\t\t\ta=tmp;\n\t\t}",
"b=a",
"b",
"a",
"a=tmp",
"a",
"tmp",
"gcd = a",
"gcd",
"a",
"long c;",
"c",
"if(n<gcd) {\n\t\t\ta = n;\n\t\t\tc = gcd;\n\t\t}\n\t\telse {\n\t\t\ta = gcd;\n\t\t\tc = n;\n\t\t}",
"n<gcd",
"n",
"gcd",
"{\n\t\t\ta = n;\n\t\t\tc = gcd;\n\t\t}",
"a = n",
"a",
"n",
"c = gcd",
"c",
"gcd",
"{\n\t\t\ta = gcd;\n\t\t\tc = n;\n\t\t}",
"a = gcd",
"a",
"gcd",
"c = n",
"c",
"n",
"while((tmp = c % a) != 0) {\n\t\t\tc=a;\n\t\t\ta=tmp;\n\t\t}",
"(tmp = c % a) != 0",
"(tmp = c % a)",
"tmp",
"c % a",
"c",
"a",
"0",
"{\n\t\t\tc=a;\n\t\t\ta=tmp;\n\t\t}",
"c=a",
"c",
"a",
"a=tmp",
"a",
"tmp",
"return a;",
"a",
"long i",
"i",
"long j",
"j",
"long n",
"n",
"public class Main{\n\tpublic static void main(String[] args){\n\t\tScanner sc = new Scanner(System.in);\n\t\tlong k = sc.nextLong();\n\t\tlong sum = 0;\n\t\tfor(int i = 1; i <= k; i++) {\n\t\t\tfor(int j = i; j <= k; j++) {\n\t\t\t\tfor(int n = j; n <= k; n++) {\n\t\t\t\t\t//System.out.println(\"Debug\");\n\t\t\t\t\tif(i==j&&j==n) {\n\t\t\t\t\t\tsum+=solve(i,j,n);\n\t\t\t\t\t}\n\t\t\t\t\telse if(i!=j&&j!=n&&n!=i) {\n\t\t\t\t\t\tsum+=solve(i,j,n)*6;\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\t\tsum+=solve(i,j,n)*3;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(sum);\n\t}\n\tprivate static long solve(long i, long j, long n) {\n\t\tlong tmp;\n\t\tlong a = i;\n\t\tlong b = j;\n\t\tlong gcd;\n\t\twhile((tmp = b % a) != 0) {\n\t\t\tb=a;\n\t\t\ta=tmp;\n\t\t}\n\t\tgcd = a;\n\t\tlong c;\n\t\tif(n<gcd) {\n\t\t\ta = n;\n\t\t\tc = gcd;\n\t\t}\n\t\telse {\n\t\t\ta = gcd;\n\t\t\tc = n;\n\t\t}\n\t\twhile((tmp = c % a) != 0) {\n\t\t\tc=a;\n\t\t\ta=tmp;\n\t\t}\n\t\t//System.out.println(a);\n\t\treturn a;\n\t}\n}",
"public class Main{\n\tpublic static void main(String[] args){\n\t\tScanner sc = new Scanner(System.in);\n\t\tlong k = sc.nextLong();\n\t\tlong sum = 0;\n\t\tfor(int i = 1; i <= k; i++) {\n\t\t\tfor(int j = i; j <= k; j++) {\n\t\t\t\tfor(int n = j; n <= k; n++) {\n\t\t\t\t\t//System.out.println(\"Debug\");\n\t\t\t\t\tif(i==j&&j==n) {\n\t\t\t\t\t\tsum+=solve(i,j,n);\n\t\t\t\t\t}\n\t\t\t\t\telse if(i!=j&&j!=n&&n!=i) {\n\t\t\t\t\t\tsum+=solve(i,j,n)*6;\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\t\tsum+=solve(i,j,n)*3;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(sum);\n\t}\n\tprivate static long solve(long i, long j, long n) {\n\t\tlong tmp;\n\t\tlong a = i;\n\t\tlong b = j;\n\t\tlong gcd;\n\t\twhile((tmp = b % a) != 0) {\n\t\t\tb=a;\n\t\t\ta=tmp;\n\t\t}\n\t\tgcd = a;\n\t\tlong c;\n\t\tif(n<gcd) {\n\t\t\ta = n;\n\t\t\tc = gcd;\n\t\t}\n\t\telse {\n\t\t\ta = gcd;\n\t\t\tc = n;\n\t\t}\n\t\twhile((tmp = c % a) != 0) {\n\t\t\tc=a;\n\t\t\ta=tmp;\n\t\t}\n\t\t//System.out.println(a);\n\t\treturn a;\n\t}\n}",
"Main"
] |
import java.util.*;
import java.util.ArrayDeque;
import java.util.Queue;
import java.math.RoundingMode;
import java.math.BigDecimal;
public class Main{
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
long k = sc.nextLong();
long sum = 0;
for(int i = 1; i <= k; i++) {
for(int j = i; j <= k; j++) {
for(int n = j; n <= k; n++) {
//System.out.println("Debug");
if(i==j&&j==n) {
sum+=solve(i,j,n);
}
else if(i!=j&&j!=n&&n!=i) {
sum+=solve(i,j,n)*6;
}
else{
sum+=solve(i,j,n)*3;
}
}
}
}
System.out.println(sum);
}
private static long solve(long i, long j, long n) {
long tmp;
long a = i;
long b = j;
long gcd;
while((tmp = b % a) != 0) {
b=a;
a=tmp;
}
gcd = a;
long c;
if(n<gcd) {
a = n;
c = gcd;
}
else {
a = gcd;
c = n;
}
while((tmp = c % a) != 0) {
c=a;
a=tmp;
}
//System.out.println(a);
return a;
}
}
|
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
41,
13,
4,
13,
13,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
41,
13,
4,
13,
13,
13,
0,
13,
13,
4,
18,
18,
13,
13,
13,
23,
13,
12,
13,
30,
14,
2,
13,
17,
30,
29,
13,
29,
4,
13,
13,
2,
13,
13,
23,
13,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
104,
5
],
[
104,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
8,
17
],
[
17,
18
],
[
17,
19
],
[
8,
20
],
[
20,
21
],
[
21,
22
],
[
22,
23
],
[
22,
24
],
[
20,
25
],
[
25,
26
],
[
25,
27
],
[
20,
28
],
[
28,
29
],
[
29,
30
],
[
20,
31
],
[
32,
32
],
[
32,
33
],
[
33,
34
],
[
34,
35
],
[
35,
36
],
[
35,
37
],
[
33,
38
],
[
38,
39
],
[
38,
40
],
[
33,
41
],
[
41,
42
],
[
42,
43
],
[
33,
44
],
[
45,
45
],
[
45,
46
],
[
46,
47
],
[
46,
48
],
[
48,
49
],
[
48,
50
],
[
48,
51
],
[
45,
52
],
[
52,
53
],
[
53,
54
],
[
54,
55
],
[
54,
56
],
[
52,
57
],
[
57,
58
],
[
57,
59
],
[
52,
60
],
[
60,
61
],
[
61,
62
],
[
52,
63
],
[
64,
64
],
[
64,
65
],
[
65,
66
],
[
65,
67
],
[
67,
68
],
[
67,
69
],
[
67,
70
],
[
64,
71
],
[
71,
72
],
[
71,
73
],
[
8,
74
],
[
74,
75
],
[
75,
76
],
[
76,
77
],
[
76,
78
],
[
74,
79
],
[
6,
80
],
[
80,
81
],
[
104,
82
],
[
82,
83
],
[
82,
84
],
[
84,
85
],
[
85,
86
],
[
86,
87
],
[
86,
88
],
[
85,
89
],
[
89,
90
],
[
90,
91
],
[
84,
92
],
[
92,
93
],
[
93,
94
],
[
93,
95
],
[
93,
96
],
[
96,
97
],
[
96,
98
],
[
82,
99
],
[
99,
100
],
[
82,
101
],
[
101,
102
],
[
0,
103
],
[
103,
104
],
[
103,
105
]
] |
[
"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 k = sc.nextLong();\n\t\tlong sum = 0;\n\t\tfor (int a = 1; a <= k; ++a) {\n\t\t\tfor (int b = 1; b <= k; ++b) {\n\t\t\t\tlong g1 = findGcd(a, b);\n\t\t\t\tfor (int c = 1; c <= k; ++c) {\n\t\t\t\t\tlong g2 = findGcd(g1, c);\n\t\t\t\t\tsum += g2;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tSystem.out.println(sum);\n\t}\n\n\tpublic static long findGcd(long a, long b) {\n\t\tif (b == 0L) {\n\t\t\treturn a;\n\t\t}\n\t\treturn findGcd(b, a % b);\n\t}\n\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public 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 k = sc.nextLong();\n\t\tlong sum = 0;\n\t\tfor (int a = 1; a <= k; ++a) {\n\t\t\tfor (int b = 1; b <= k; ++b) {\n\t\t\t\tlong g1 = findGcd(a, b);\n\t\t\t\tfor (int c = 1; c <= k; ++c) {\n\t\t\t\t\tlong g2 = findGcd(g1, c);\n\t\t\t\t\tsum += g2;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tSystem.out.println(sum);\n\t}\n\n\tpublic static long findGcd(long a, long b) {\n\t\tif (b == 0L) {\n\t\t\treturn a;\n\t\t}\n\t\treturn findGcd(b, a % b);\n\t}\n\n}",
"Main",
"public static void main(String[] args) {\n\t\t// TODO 自動生成されたメソッド・スタブ\n\t\tScanner sc = new Scanner(System.in);\n\t\tlong k = sc.nextLong();\n\t\tlong sum = 0;\n\t\tfor (int a = 1; a <= k; ++a) {\n\t\t\tfor (int b = 1; b <= k; ++b) {\n\t\t\t\tlong g1 = findGcd(a, b);\n\t\t\t\tfor (int c = 1; c <= k; ++c) {\n\t\t\t\t\tlong g2 = findGcd(g1, c);\n\t\t\t\t\tsum += g2;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tSystem.out.println(sum);\n\t}",
"main",
"{\n\t\t// TODO 自動生成されたメソッド・スタブ\n\t\tScanner sc = new Scanner(System.in);\n\t\tlong k = sc.nextLong();\n\t\tlong sum = 0;\n\t\tfor (int a = 1; a <= k; ++a) {\n\t\t\tfor (int b = 1; b <= k; ++b) {\n\t\t\t\tlong g1 = findGcd(a, b);\n\t\t\t\tfor (int c = 1; c <= k; ++c) {\n\t\t\t\t\tlong g2 = findGcd(g1, c);\n\t\t\t\t\tsum += g2;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tSystem.out.println(sum);\n\t}",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"long k = sc.nextLong();",
"k",
"sc.nextLong()",
"sc.nextLong",
"sc",
"long sum = 0;",
"sum",
"0",
"for (int a = 1; a <= k; ++a) {\n\t\t\tfor (int b = 1; b <= k; ++b) {\n\t\t\t\tlong g1 = findGcd(a, b);\n\t\t\t\tfor (int c = 1; c <= k; ++c) {\n\t\t\t\t\tlong g2 = findGcd(g1, c);\n\t\t\t\t\tsum += g2;\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"int a = 1;",
"int a = 1;",
"a",
"1",
"a <= k",
"a",
"k",
"++a",
"++a",
"a",
"{\n\t\t\tfor (int b = 1; b <= k; ++b) {\n\t\t\t\tlong g1 = findGcd(a, b);\n\t\t\t\tfor (int c = 1; c <= k; ++c) {\n\t\t\t\t\tlong g2 = findGcd(g1, c);\n\t\t\t\t\tsum += g2;\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"{\n\t\t\tfor (int b = 1; b <= k; ++b) {\n\t\t\t\tlong g1 = findGcd(a, b);\n\t\t\t\tfor (int c = 1; c <= k; ++c) {\n\t\t\t\t\tlong g2 = findGcd(g1, c);\n\t\t\t\t\tsum += g2;\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"for (int b = 1; b <= k; ++b) {\n\t\t\t\tlong g1 = findGcd(a, b);\n\t\t\t\tfor (int c = 1; c <= k; ++c) {\n\t\t\t\t\tlong g2 = findGcd(g1, c);\n\t\t\t\t\tsum += g2;\n\t\t\t\t}\n\t\t\t}",
"int b = 1;",
"int b = 1;",
"b",
"1",
"b <= k",
"b",
"k",
"++b",
"++b",
"b",
"{\n\t\t\t\tlong g1 = findGcd(a, b);\n\t\t\t\tfor (int c = 1; c <= k; ++c) {\n\t\t\t\t\tlong g2 = findGcd(g1, c);\n\t\t\t\t\tsum += g2;\n\t\t\t\t}\n\t\t\t}",
"{\n\t\t\t\tlong g1 = findGcd(a, b);\n\t\t\t\tfor (int c = 1; c <= k; ++c) {\n\t\t\t\t\tlong g2 = findGcd(g1, c);\n\t\t\t\t\tsum += g2;\n\t\t\t\t}\n\t\t\t}",
"long g1 = findGcd(a, b);",
"g1",
"findGcd(a, b)",
"findGcd",
"a",
"b",
"for (int c = 1; c <= k; ++c) {\n\t\t\t\t\tlong g2 = findGcd(g1, c);\n\t\t\t\t\tsum += g2;\n\t\t\t\t}",
"int c = 1;",
"int c = 1;",
"c",
"1",
"c <= k",
"c",
"k",
"++c",
"++c",
"c",
"{\n\t\t\t\t\tlong g2 = findGcd(g1, c);\n\t\t\t\t\tsum += g2;\n\t\t\t\t}",
"{\n\t\t\t\t\tlong g2 = findGcd(g1, c);\n\t\t\t\t\tsum += g2;\n\t\t\t\t}",
"long g2 = findGcd(g1, c);",
"g2",
"findGcd(g1, c)",
"findGcd",
"g1",
"c",
"sum += g2",
"sum",
"g2",
"System.out.println(sum)",
"System.out.println",
"System.out",
"System",
"System.out",
"sum",
"String[] args",
"args",
"public static long findGcd(long a, long b) {\n\t\tif (b == 0L) {\n\t\t\treturn a;\n\t\t}\n\t\treturn findGcd(b, a % b);\n\t}",
"findGcd",
"{\n\t\tif (b == 0L) {\n\t\t\treturn a;\n\t\t}\n\t\treturn findGcd(b, a % b);\n\t}",
"if (b == 0L) {\n\t\t\treturn a;\n\t\t}",
"b == 0L",
"b",
"0L",
"{\n\t\t\treturn a;\n\t\t}",
"return a;",
"a",
"return findGcd(b, a % b);",
"findGcd(b, a % b)",
"findGcd",
"b",
"a % b",
"a",
"b",
"long a",
"a",
"long b",
"b",
"public 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 k = sc.nextLong();\n\t\tlong sum = 0;\n\t\tfor (int a = 1; a <= k; ++a) {\n\t\t\tfor (int b = 1; b <= k; ++b) {\n\t\t\t\tlong g1 = findGcd(a, b);\n\t\t\t\tfor (int c = 1; c <= k; ++c) {\n\t\t\t\t\tlong g2 = findGcd(g1, c);\n\t\t\t\t\tsum += g2;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tSystem.out.println(sum);\n\t}\n\n\tpublic static long findGcd(long a, long b) {\n\t\tif (b == 0L) {\n\t\t\treturn a;\n\t\t}\n\t\treturn findGcd(b, a % b);\n\t}\n\n}",
"public 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 k = sc.nextLong();\n\t\tlong sum = 0;\n\t\tfor (int a = 1; a <= k; ++a) {\n\t\t\tfor (int b = 1; b <= k; ++b) {\n\t\t\t\tlong g1 = findGcd(a, b);\n\t\t\t\tfor (int c = 1; c <= k; ++c) {\n\t\t\t\t\tlong g2 = findGcd(g1, c);\n\t\t\t\t\tsum += g2;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tSystem.out.println(sum);\n\t}\n\n\tpublic static long findGcd(long a, long b) {\n\t\tif (b == 0L) {\n\t\t\treturn a;\n\t\t}\n\t\treturn findGcd(b, a % b);\n\t}\n\n}",
"Main"
] |
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
// TODO 自動生成されたメソッド・スタブ
Scanner sc = new Scanner(System.in);
long k = sc.nextLong();
long sum = 0;
for (int a = 1; a <= k; ++a) {
for (int b = 1; b <= k; ++b) {
long g1 = findGcd(a, b);
for (int c = 1; c <= k; ++c) {
long g2 = findGcd(g1, c);
sum += g2;
}
}
}
System.out.println(sum);
}
public static long findGcd(long a, long b) {
if (b == 0L) {
return a;
}
return findGcd(b, a % b);
}
}
|
[
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,
41,
13,
4,
18,
13,
41,
13,
17,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
4,
13,
4,
13,
13,
13,
13,
4,
18,
18,
13,
13,
13,
23,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
9,
10
],
[
9,
11
],
[
11,
12
],
[
12,
13
],
[
13,
14
],
[
13,
15
],
[
12,
16
],
[
16,
17
],
[
17,
18
],
[
12,
19
],
[
19,
20
],
[
20,
21
],
[
21,
22
],
[
21,
23
],
[
21,
24
],
[
24,
25
],
[
24,
26
],
[
9,
27
],
[
27,
28
],
[
9,
29
],
[
29,
30
],
[
7,
31
],
[
31,
32
],
[
31,
33
],
[
33,
34
],
[
34,
35
],
[
34,
36
],
[
33,
37
],
[
37,
38
],
[
37,
39
],
[
39,
40
],
[
40,
41
],
[
33,
42
],
[
42,
43
],
[
42,
44
],
[
33,
45
],
[
45,
46
],
[
45,
47
],
[
33,
48
],
[
48,
49
],
[
49,
50
],
[
50,
51
],
[
50,
52
],
[
48,
53
],
[
53,
54
],
[
53,
55
],
[
48,
56
],
[
56,
57
],
[
57,
58
],
[
48,
59
],
[
60,
60
],
[
60,
61
],
[
61,
62
],
[
62,
63
],
[
63,
64
],
[
63,
65
],
[
61,
66
],
[
66,
67
],
[
66,
68
],
[
61,
69
],
[
69,
70
],
[
70,
71
],
[
61,
72
],
[
73,
73
],
[
73,
74
],
[
74,
75
],
[
75,
76
],
[
76,
77
],
[
76,
78
],
[
74,
79
],
[
79,
80
],
[
79,
81
],
[
74,
82
],
[
82,
83
],
[
83,
84
],
[
74,
85
],
[
86,
86
],
[
86,
87
],
[
87,
88
],
[
87,
89
],
[
89,
90
],
[
89,
91
],
[
91,
92
],
[
91,
93
],
[
91,
94
],
[
89,
95
],
[
33,
96
],
[
96,
97
],
[
97,
98
],
[
98,
99
],
[
98,
100
],
[
96,
101
],
[
31,
102
],
[
102,
103
]
] |
[
"import java.util.Scanner;\nimport java.util.Arrays;\nclass Main {\n public static long GCD(long x,long y){\n if (y == 0){return x;\n } else{\n return GCD(y, x % y);\n }\n }\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n long N=sc.nextLong();\n long Sum=0;\n long temp=0;\n for(long a=1;a<=N;a++){\n for (long b=1;b<=N ;b++) {\n for(long c=1;c<=N;c++){\n\n Sum+=GCD(GCD(a,b),c);\n }\n }\n }\n\n\n\n\n\n System.out.println(Sum);\n\n }\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"import java.util.Arrays;",
"Arrays",
"java.util",
"class Main {\n public static long GCD(long x,long y){\n if (y == 0){return x;\n } else{\n return GCD(y, x % y);\n }\n }\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n long N=sc.nextLong();\n long Sum=0;\n long temp=0;\n for(long a=1;a<=N;a++){\n for (long b=1;b<=N ;b++) {\n for(long c=1;c<=N;c++){\n\n Sum+=GCD(GCD(a,b),c);\n }\n }\n }\n\n\n\n\n\n System.out.println(Sum);\n\n }\n}",
"Main",
"public static long GCD(long x,long y){\n if (y == 0){return x;\n } else{\n return GCD(y, x % y);\n }\n }",
"GCD",
"{\n if (y == 0){return x;\n } else{\n return GCD(y, x % y);\n }\n }",
"if (y == 0){return x;\n } else{\n return GCD(y, x % y);\n }",
"y == 0",
"y",
"0",
"{return x;\n }",
"return x;",
"x",
"{\n return GCD(y, x % y);\n }",
"return GCD(y, x % y);",
"GCD(y, x % y)",
"GCD",
"y",
"x % y",
"x",
"y",
"long x",
"x",
"long y",
"y",
"public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n long N=sc.nextLong();\n long Sum=0;\n long temp=0;\n for(long a=1;a<=N;a++){\n for (long b=1;b<=N ;b++) {\n for(long c=1;c<=N;c++){\n\n Sum+=GCD(GCD(a,b),c);\n }\n }\n }\n\n\n\n\n\n System.out.println(Sum);\n\n }",
"main",
"{\n Scanner sc = new Scanner(System.in);\n long N=sc.nextLong();\n long Sum=0;\n long temp=0;\n for(long a=1;a<=N;a++){\n for (long b=1;b<=N ;b++) {\n for(long c=1;c<=N;c++){\n\n Sum+=GCD(GCD(a,b),c);\n }\n }\n }\n\n\n\n\n\n System.out.println(Sum);\n\n }",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"long N=sc.nextLong();",
"N",
"sc.nextLong()",
"sc.nextLong",
"sc",
"long Sum=0;",
"Sum",
"0",
"long temp=0;",
"temp",
"0",
"for(long a=1;a<=N;a++){\n for (long b=1;b<=N ;b++) {\n for(long c=1;c<=N;c++){\n\n Sum+=GCD(GCD(a,b),c);\n }\n }\n }",
"long a=1;",
"long a=1;",
"a",
"1",
"a<=N",
"a",
"N",
"a++",
"a++",
"a",
"{\n for (long b=1;b<=N ;b++) {\n for(long c=1;c<=N;c++){\n\n Sum+=GCD(GCD(a,b),c);\n }\n }\n }",
"{\n for (long b=1;b<=N ;b++) {\n for(long c=1;c<=N;c++){\n\n Sum+=GCD(GCD(a,b),c);\n }\n }\n }",
"for (long b=1;b<=N ;b++) {\n for(long c=1;c<=N;c++){\n\n Sum+=GCD(GCD(a,b),c);\n }\n }",
"long b=1;",
"long b=1;",
"b",
"1",
"b<=N",
"b",
"N",
"b++",
"b++",
"b",
"{\n for(long c=1;c<=N;c++){\n\n Sum+=GCD(GCD(a,b),c);\n }\n }",
"{\n for(long c=1;c<=N;c++){\n\n Sum+=GCD(GCD(a,b),c);\n }\n }",
"for(long c=1;c<=N;c++){\n\n Sum+=GCD(GCD(a,b),c);\n }",
"long c=1;",
"long c=1;",
"c",
"1",
"c<=N",
"c",
"N",
"c++",
"c++",
"c",
"{\n\n Sum+=GCD(GCD(a,b),c);\n }",
"{\n\n Sum+=GCD(GCD(a,b),c);\n }",
"Sum+=GCD(GCD(a,b),c)",
"Sum",
"GCD(GCD(a,b),c)",
"GCD",
"GCD(a,b)",
"GCD",
"a",
"b",
"c",
"System.out.println(Sum)",
"System.out.println",
"System.out",
"System",
"System.out",
"Sum",
"String[] args",
"args"
] |
import java.util.Scanner;
import java.util.Arrays;
class Main {
public static long GCD(long x,long y){
if (y == 0){return x;
} else{
return GCD(y, x % y);
}
}
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
long N=sc.nextLong();
long Sum=0;
long temp=0;
for(long a=1;a<=N;a++){
for (long b=1;b<=N ;b++) {
for(long c=1;c<=N;c++){
Sum+=GCD(GCD(a,b),c);
}
}
}
System.out.println(Sum);
}
}
|
[
7,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
4,
13,
4,
13,
13,
13,
13,
4,
18,
18,
13,
13,
13,
23,
13,
12,
13,
30,
14,
2,
13,
13,
29,
4,
13,
13,
13,
42,
2,
13,
17,
30,
41,
13,
13,
0,
13,
13,
0,
13,
2,
13,
13,
29,
13,
23,
13,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
114,
8
],
[
114,
9
],
[
9,
10
],
[
9,
11
],
[
11,
12
],
[
12,
13
],
[
12,
14
],
[
11,
15
],
[
15,
16
],
[
15,
17
],
[
17,
18
],
[
18,
19
],
[
11,
20
],
[
20,
21
],
[
20,
22
],
[
11,
23
],
[
23,
24
],
[
24,
25
],
[
25,
26
],
[
25,
27
],
[
23,
28
],
[
28,
29
],
[
28,
30
],
[
23,
31
],
[
31,
32
],
[
32,
33
],
[
23,
34
],
[
35,
35
],
[
35,
36
],
[
36,
37
],
[
37,
38
],
[
38,
39
],
[
38,
40
],
[
36,
41
],
[
41,
42
],
[
41,
43
],
[
36,
44
],
[
44,
45
],
[
45,
46
],
[
36,
47
],
[
48,
48
],
[
48,
49
],
[
49,
50
],
[
50,
51
],
[
51,
52
],
[
51,
53
],
[
49,
54
],
[
54,
55
],
[
54,
56
],
[
49,
57
],
[
57,
58
],
[
58,
59
],
[
49,
60
],
[
61,
61
],
[
61,
62
],
[
62,
63
],
[
62,
64
],
[
64,
65
],
[
64,
66
],
[
66,
67
],
[
66,
68
],
[
66,
69
],
[
64,
70
],
[
11,
71
],
[
71,
72
],
[
72,
73
],
[
73,
74
],
[
73,
75
],
[
71,
76
],
[
9,
77
],
[
77,
78
],
[
114,
79
],
[
79,
80
],
[
79,
81
],
[
81,
82
],
[
82,
83
],
[
83,
84
],
[
83,
85
],
[
82,
86
],
[
86,
87
],
[
87,
88
],
[
87,
89
],
[
87,
90
],
[
81,
91
],
[
91,
92
],
[
92,
93
],
[
92,
94
],
[
91,
95
],
[
95,
96
],
[
96,
97
],
[
96,
98
],
[
95,
99
],
[
99,
100
],
[
99,
101
],
[
95,
102
],
[
102,
103
],
[
102,
104
],
[
104,
105
],
[
104,
106
],
[
81,
107
],
[
107,
108
],
[
79,
109
],
[
109,
110
],
[
79,
111
],
[
111,
112
],
[
0,
113
],
[
113,
114
],
[
113,
115
]
] |
[
"import java.util.*;\nimport java.io.PrintWriter;\npublic class Main{\n\tpublic static void main(String[] args){\n\t\tScanner sc=new Scanner(System.in);\n\t\tint k=sc.nextInt();\n\t\tlong ans=0;\n\t\tfor(int i=1; i<=k; i++){\n\t\t\tfor(int j=1; j<=k; j++){\n\t\t\t\tfor(int t=1; t<=k; t++){\n\t\t\t\t\tans+=gcd(gcd(i,j),t);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(ans);\n\t}\n\tprivate static long gcd(long m, long n) {\n if(m < n) return gcd(n, m);\n\t\twhile(n!=0){\n\t\t\tlong tmp=m;\n\t\t\tm=n;\n\t\t\tn=tmp%n;\n\t\t}\n return m;\n}\n}",
"import java.util.*;",
"util.*",
"java",
"import java.io.PrintWriter;",
"PrintWriter",
"java.io",
"public class Main{\n\tpublic static void main(String[] args){\n\t\tScanner sc=new Scanner(System.in);\n\t\tint k=sc.nextInt();\n\t\tlong ans=0;\n\t\tfor(int i=1; i<=k; i++){\n\t\t\tfor(int j=1; j<=k; j++){\n\t\t\t\tfor(int t=1; t<=k; t++){\n\t\t\t\t\tans+=gcd(gcd(i,j),t);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(ans);\n\t}\n\tprivate static long gcd(long m, long n) {\n if(m < n) return gcd(n, m);\n\t\twhile(n!=0){\n\t\t\tlong tmp=m;\n\t\t\tm=n;\n\t\t\tn=tmp%n;\n\t\t}\n return m;\n}\n}",
"Main",
"public static void main(String[] args){\n\t\tScanner sc=new Scanner(System.in);\n\t\tint k=sc.nextInt();\n\t\tlong ans=0;\n\t\tfor(int i=1; i<=k; i++){\n\t\t\tfor(int j=1; j<=k; j++){\n\t\t\t\tfor(int t=1; t<=k; t++){\n\t\t\t\t\tans+=gcd(gcd(i,j),t);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(ans);\n\t}",
"main",
"{\n\t\tScanner sc=new Scanner(System.in);\n\t\tint k=sc.nextInt();\n\t\tlong ans=0;\n\t\tfor(int i=1; i<=k; i++){\n\t\t\tfor(int j=1; j<=k; j++){\n\t\t\t\tfor(int t=1; t<=k; t++){\n\t\t\t\t\tans+=gcd(gcd(i,j),t);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(ans);\n\t}",
"Scanner sc=new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"int k=sc.nextInt();",
"k",
"sc.nextInt()",
"sc.nextInt",
"sc",
"long ans=0;",
"ans",
"0",
"for(int i=1; i<=k; i++){\n\t\t\tfor(int j=1; j<=k; j++){\n\t\t\t\tfor(int t=1; t<=k; t++){\n\t\t\t\t\tans+=gcd(gcd(i,j),t);\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"int i=1;",
"int i=1;",
"i",
"1",
"i<=k",
"i",
"k",
"i++",
"i++",
"i",
"{\n\t\t\tfor(int j=1; j<=k; j++){\n\t\t\t\tfor(int t=1; t<=k; t++){\n\t\t\t\t\tans+=gcd(gcd(i,j),t);\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"{\n\t\t\tfor(int j=1; j<=k; j++){\n\t\t\t\tfor(int t=1; t<=k; t++){\n\t\t\t\t\tans+=gcd(gcd(i,j),t);\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"for(int j=1; j<=k; j++){\n\t\t\t\tfor(int t=1; t<=k; t++){\n\t\t\t\t\tans+=gcd(gcd(i,j),t);\n\t\t\t\t}\n\t\t\t}",
"int j=1;",
"int j=1;",
"j",
"1",
"j<=k",
"j",
"k",
"j++",
"j++",
"j",
"{\n\t\t\t\tfor(int t=1; t<=k; t++){\n\t\t\t\t\tans+=gcd(gcd(i,j),t);\n\t\t\t\t}\n\t\t\t}",
"{\n\t\t\t\tfor(int t=1; t<=k; t++){\n\t\t\t\t\tans+=gcd(gcd(i,j),t);\n\t\t\t\t}\n\t\t\t}",
"for(int t=1; t<=k; t++){\n\t\t\t\t\tans+=gcd(gcd(i,j),t);\n\t\t\t\t}",
"int t=1;",
"int t=1;",
"t",
"1",
"t<=k",
"t",
"k",
"t++",
"t++",
"t",
"{\n\t\t\t\t\tans+=gcd(gcd(i,j),t);\n\t\t\t\t}",
"{\n\t\t\t\t\tans+=gcd(gcd(i,j),t);\n\t\t\t\t}",
"ans+=gcd(gcd(i,j),t)",
"ans",
"gcd(gcd(i,j),t)",
"gcd",
"gcd(i,j)",
"gcd",
"i",
"j",
"t",
"System.out.println(ans)",
"System.out.println",
"System.out",
"System",
"System.out",
"ans",
"String[] args",
"args",
"private static long gcd(long m, long n) {\n if(m < n) return gcd(n, m);\n\t\twhile(n!=0){\n\t\t\tlong tmp=m;\n\t\t\tm=n;\n\t\t\tn=tmp%n;\n\t\t}\n return m;\n}",
"gcd",
"{\n if(m < n) return gcd(n, m);\n\t\twhile(n!=0){\n\t\t\tlong tmp=m;\n\t\t\tm=n;\n\t\t\tn=tmp%n;\n\t\t}\n return m;\n}",
"if(m < n) return gcd(n, m);",
"m < n",
"m",
"n",
"return gcd(n, m);",
"gcd(n, m)",
"gcd",
"n",
"m",
"while(n!=0){\n\t\t\tlong tmp=m;\n\t\t\tm=n;\n\t\t\tn=tmp%n;\n\t\t}",
"n!=0",
"n",
"0",
"{\n\t\t\tlong tmp=m;\n\t\t\tm=n;\n\t\t\tn=tmp%n;\n\t\t}",
"long tmp=m;",
"tmp",
"m",
"m=n",
"m",
"n",
"n=tmp%n",
"n",
"tmp%n",
"tmp",
"n",
"return m;",
"m",
"long m",
"m",
"long n",
"n",
"public class Main{\n\tpublic static void main(String[] args){\n\t\tScanner sc=new Scanner(System.in);\n\t\tint k=sc.nextInt();\n\t\tlong ans=0;\n\t\tfor(int i=1; i<=k; i++){\n\t\t\tfor(int j=1; j<=k; j++){\n\t\t\t\tfor(int t=1; t<=k; t++){\n\t\t\t\t\tans+=gcd(gcd(i,j),t);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(ans);\n\t}\n\tprivate static long gcd(long m, long n) {\n if(m < n) return gcd(n, m);\n\t\twhile(n!=0){\n\t\t\tlong tmp=m;\n\t\t\tm=n;\n\t\t\tn=tmp%n;\n\t\t}\n return m;\n}\n}",
"public class Main{\n\tpublic static void main(String[] args){\n\t\tScanner sc=new Scanner(System.in);\n\t\tint k=sc.nextInt();\n\t\tlong ans=0;\n\t\tfor(int i=1; i<=k; i++){\n\t\t\tfor(int j=1; j<=k; j++){\n\t\t\t\tfor(int t=1; t<=k; t++){\n\t\t\t\t\tans+=gcd(gcd(i,j),t);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(ans);\n\t}\n\tprivate static long gcd(long m, long n) {\n if(m < n) return gcd(n, m);\n\t\twhile(n!=0){\n\t\t\tlong tmp=m;\n\t\t\tm=n;\n\t\t\tn=tmp%n;\n\t\t}\n return m;\n}\n}",
"Main"
] |
import java.util.*;
import java.io.PrintWriter;
public class Main{
public static void main(String[] args){
Scanner sc=new Scanner(System.in);
int k=sc.nextInt();
long ans=0;
for(int i=1; i<=k; i++){
for(int j=1; j<=k; j++){
for(int t=1; t<=k; t++){
ans+=gcd(gcd(i,j),t);
}
}
}
System.out.println(ans);
}
private static long gcd(long m, long n) {
if(m < n) return gcd(n, m);
while(n!=0){
long tmp=m;
m=n;
n=tmp%n;
}
return m;
}
}
|
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
14,
2,
2,
13,
13,
2,
13,
13,
30,
0,
13,
13,
30,
41,
13,
4,
13,
13,
13,
13,
0,
13,
13,
4,
18,
18,
13,
13,
13,
23,
13,
12,
13,
30,
14,
2,
13,
13,
30,
41,
13,
13,
0,
13,
13,
0,
13,
13,
41,
13,
17,
42,
2,
0,
13,
2,
13,
13,
17,
30,
0,
13,
13,
0,
13,
13,
14,
2,
13,
13,
30,
41,
13,
13,
0,
13,
13,
0,
13,
13,
42,
2,
0,
13,
2,
13,
13,
17,
30,
0,
13,
13,
0,
13,
13,
29,
13,
23,
13,
23,
13,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
163,
5
],
[
163,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
8,
17
],
[
17,
18
],
[
17,
19
],
[
8,
20
],
[
20,
21
],
[
21,
22
],
[
22,
23
],
[
22,
24
],
[
20,
25
],
[
25,
26
],
[
25,
27
],
[
20,
28
],
[
28,
29
],
[
29,
30
],
[
20,
31
],
[
32,
32
],
[
32,
33
],
[
33,
34
],
[
34,
35
],
[
35,
36
],
[
35,
37
],
[
33,
38
],
[
38,
39
],
[
38,
40
],
[
33,
41
],
[
41,
42
],
[
42,
43
],
[
33,
44
],
[
45,
45
],
[
45,
46
],
[
46,
47
],
[
47,
48
],
[
48,
49
],
[
48,
50
],
[
46,
51
],
[
51,
52
],
[
51,
53
],
[
46,
54
],
[
54,
55
],
[
55,
56
],
[
46,
57
],
[
58,
58
],
[
58,
59
],
[
59,
60
],
[
60,
61
],
[
61,
62
],
[
61,
63
],
[
60,
64
],
[
64,
65
],
[
64,
66
],
[
59,
67
],
[
67,
68
],
[
68,
69
],
[
68,
70
],
[
59,
71
],
[
71,
72
],
[
72,
73
],
[
72,
74
],
[
74,
75
],
[
74,
76
],
[
74,
77
],
[
74,
78
],
[
71,
79
],
[
79,
80
],
[
79,
81
],
[
8,
82
],
[
82,
83
],
[
83,
84
],
[
84,
85
],
[
84,
86
],
[
82,
87
],
[
6,
88
],
[
88,
89
],
[
163,
90
],
[
90,
91
],
[
90,
92
],
[
92,
93
],
[
93,
94
],
[
94,
95
],
[
94,
96
],
[
93,
97
],
[
97,
98
],
[
98,
99
],
[
98,
100
],
[
97,
101
],
[
101,
102
],
[
101,
103
],
[
97,
104
],
[
104,
105
],
[
104,
106
],
[
92,
107
],
[
107,
108
],
[
107,
109
],
[
92,
110
],
[
110,
111
],
[
111,
112
],
[
112,
113
],
[
112,
114
],
[
114,
115
],
[
114,
116
],
[
111,
117
],
[
110,
118
],
[
118,
119
],
[
119,
120
],
[
119,
121
],
[
118,
122
],
[
122,
123
],
[
122,
124
],
[
92,
125
],
[
125,
126
],
[
126,
127
],
[
126,
128
],
[
125,
129
],
[
129,
130
],
[
130,
131
],
[
130,
132
],
[
129,
133
],
[
133,
134
],
[
133,
135
],
[
129,
136
],
[
136,
137
],
[
136,
138
],
[
92,
139
],
[
139,
140
],
[
140,
141
],
[
141,
142
],
[
141,
143
],
[
143,
144
],
[
143,
145
],
[
140,
146
],
[
139,
147
],
[
147,
148
],
[
148,
149
],
[
148,
150
],
[
147,
151
],
[
151,
152
],
[
151,
153
],
[
92,
154
],
[
154,
155
],
[
90,
156
],
[
156,
157
],
[
90,
158
],
[
158,
159
],
[
90,
160
],
[
160,
161
],
[
0,
162
],
[
162,
163
],
[
162,
164
]
] |
[
"import java.util.*;\n\npublic class Main {\n public static void main(String[] args) throws Exception {\n Scanner sc = new Scanner(System.in);\n int k = sc.nextInt();\n long sum = 0;\n \n for(int a = 1; a <= k; a++)\n {\n for(int b = 1; b <= k; b++)\n {\n for(int c = 1; c <= k; c++)\n {\n if(a == b && b ==c)\n {\n sum += a;\n }\n else\n {\n //最大公約数を求める\n int buf = gcd(a,b,c);\n sum += buf;\n }\n }\n }\n }\n System.out.println(sum);\n }\n \n public static int gcd(int x,int y, int z) {\n if(x < y)\n {\n int buf = x;\n x = y;\n y = buf;\n }\n int r = 0;\n while(( r = x % y) != 0)\n {\n x = y;\n y = r;\n }\n \n if(y < z)\n {\n int buf = y;\n y = z;\n z = buf;\n }\n while((r = y % z) != 0)\n {\n y = z;\n z = r;\n }\n return z;\n }\n}",
"import java.util.*;",
"util.*",
"java",
"public class Main {\n public static void main(String[] args) throws Exception {\n Scanner sc = new Scanner(System.in);\n int k = sc.nextInt();\n long sum = 0;\n \n for(int a = 1; a <= k; a++)\n {\n for(int b = 1; b <= k; b++)\n {\n for(int c = 1; c <= k; c++)\n {\n if(a == b && b ==c)\n {\n sum += a;\n }\n else\n {\n //最大公約数を求める\n int buf = gcd(a,b,c);\n sum += buf;\n }\n }\n }\n }\n System.out.println(sum);\n }\n \n public static int gcd(int x,int y, int z) {\n if(x < y)\n {\n int buf = x;\n x = y;\n y = buf;\n }\n int r = 0;\n while(( r = x % y) != 0)\n {\n x = y;\n y = r;\n }\n \n if(y < z)\n {\n int buf = y;\n y = z;\n z = buf;\n }\n while((r = y % z) != 0)\n {\n y = z;\n z = r;\n }\n return z;\n }\n}",
"Main",
"public static void main(String[] args) throws Exception {\n Scanner sc = new Scanner(System.in);\n int k = sc.nextInt();\n long sum = 0;\n \n for(int a = 1; a <= k; a++)\n {\n for(int b = 1; b <= k; b++)\n {\n for(int c = 1; c <= k; c++)\n {\n if(a == b && b ==c)\n {\n sum += a;\n }\n else\n {\n //最大公約数を求める\n int buf = gcd(a,b,c);\n sum += buf;\n }\n }\n }\n }\n System.out.println(sum);\n }",
"main",
"{\n Scanner sc = new Scanner(System.in);\n int k = sc.nextInt();\n long sum = 0;\n \n for(int a = 1; a <= k; a++)\n {\n for(int b = 1; b <= k; b++)\n {\n for(int c = 1; c <= k; c++)\n {\n if(a == b && b ==c)\n {\n sum += a;\n }\n else\n {\n //最大公約数を求める\n int buf = gcd(a,b,c);\n sum += buf;\n }\n }\n }\n }\n System.out.println(sum);\n }",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"int k = sc.nextInt();",
"k",
"sc.nextInt()",
"sc.nextInt",
"sc",
"long sum = 0;",
"sum",
"0",
"for(int a = 1; a <= k; a++)\n {\n for(int b = 1; b <= k; b++)\n {\n for(int c = 1; c <= k; c++)\n {\n if(a == b && b ==c)\n {\n sum += a;\n }\n else\n {\n //最大公約数を求める\n int buf = gcd(a,b,c);\n sum += buf;\n }\n }\n }\n }",
"int a = 1;",
"int a = 1;",
"a",
"1",
"a <= k",
"a",
"k",
"a++",
"a++",
"a",
"{\n for(int b = 1; b <= k; b++)\n {\n for(int c = 1; c <= k; c++)\n {\n if(a == b && b ==c)\n {\n sum += a;\n }\n else\n {\n //最大公約数を求める\n int buf = gcd(a,b,c);\n sum += buf;\n }\n }\n }\n }",
"{\n for(int b = 1; b <= k; b++)\n {\n for(int c = 1; c <= k; c++)\n {\n if(a == b && b ==c)\n {\n sum += a;\n }\n else\n {\n //最大公約数を求める\n int buf = gcd(a,b,c);\n sum += buf;\n }\n }\n }\n }",
"for(int b = 1; b <= k; b++)\n {\n for(int c = 1; c <= k; c++)\n {\n if(a == b && b ==c)\n {\n sum += a;\n }\n else\n {\n //最大公約数を求める\n int buf = gcd(a,b,c);\n sum += buf;\n }\n }\n }",
"int b = 1;",
"int b = 1;",
"b",
"1",
"b <= k",
"b",
"k",
"b++",
"b++",
"b",
"{\n for(int c = 1; c <= k; c++)\n {\n if(a == b && b ==c)\n {\n sum += a;\n }\n else\n {\n //最大公約数を求める\n int buf = gcd(a,b,c);\n sum += buf;\n }\n }\n }",
"{\n for(int c = 1; c <= k; c++)\n {\n if(a == b && b ==c)\n {\n sum += a;\n }\n else\n {\n //最大公約数を求める\n int buf = gcd(a,b,c);\n sum += buf;\n }\n }\n }",
"for(int c = 1; c <= k; c++)\n {\n if(a == b && b ==c)\n {\n sum += a;\n }\n else\n {\n //最大公約数を求める\n int buf = gcd(a,b,c);\n sum += buf;\n }\n }",
"int c = 1;",
"int c = 1;",
"c",
"1",
"c <= k",
"c",
"k",
"c++",
"c++",
"c",
"{\n if(a == b && b ==c)\n {\n sum += a;\n }\n else\n {\n //最大公約数を求める\n int buf = gcd(a,b,c);\n sum += buf;\n }\n }",
"{\n if(a == b && b ==c)\n {\n sum += a;\n }\n else\n {\n //最大公約数を求める\n int buf = gcd(a,b,c);\n sum += buf;\n }\n }",
"if(a == b && b ==c)\n {\n sum += a;\n }\n else\n {\n //最大公約数を求める\n int buf = gcd(a,b,c);\n sum += buf;\n }",
"a == b && b ==c",
"a == b",
"a",
"b",
"b ==c",
"b",
"c",
"{\n sum += a;\n }",
"sum += a",
"sum",
"a",
"{\n //最大公約数を求める\n int buf = gcd(a,b,c);\n sum += buf;\n }",
"int buf = gcd(a,b,c);",
"buf",
"gcd(a,b,c)",
"gcd",
"a",
"b",
"c",
"sum += buf",
"sum",
"buf",
"System.out.println(sum)",
"System.out.println",
"System.out",
"System",
"System.out",
"sum",
"String[] args",
"args",
"public static int gcd(int x,int y, int z) {\n if(x < y)\n {\n int buf = x;\n x = y;\n y = buf;\n }\n int r = 0;\n while(( r = x % y) != 0)\n {\n x = y;\n y = r;\n }\n \n if(y < z)\n {\n int buf = y;\n y = z;\n z = buf;\n }\n while((r = y % z) != 0)\n {\n y = z;\n z = r;\n }\n return z;\n }",
"gcd",
"{\n if(x < y)\n {\n int buf = x;\n x = y;\n y = buf;\n }\n int r = 0;\n while(( r = x % y) != 0)\n {\n x = y;\n y = r;\n }\n \n if(y < z)\n {\n int buf = y;\n y = z;\n z = buf;\n }\n while((r = y % z) != 0)\n {\n y = z;\n z = r;\n }\n return z;\n }",
"if(x < y)\n {\n int buf = x;\n x = y;\n y = buf;\n }",
"x < y",
"x",
"y",
"{\n int buf = x;\n x = y;\n y = buf;\n }",
"int buf = x;",
"buf",
"x",
"x = y",
"x",
"y",
"y = buf",
"y",
"buf",
"int r = 0;",
"r",
"0",
"while(( r = x % y) != 0)\n {\n x = y;\n y = r;\n }",
"( r = x % y) != 0",
"( r = x % y)",
"r",
"x % y",
"x",
"y",
"0",
"{\n x = y;\n y = r;\n }",
"x = y",
"x",
"y",
"y = r",
"y",
"r",
"if(y < z)\n {\n int buf = y;\n y = z;\n z = buf;\n }",
"y < z",
"y",
"z",
"{\n int buf = y;\n y = z;\n z = buf;\n }",
"int buf = y;",
"buf",
"y",
"y = z",
"y",
"z",
"z = buf",
"z",
"buf",
"while((r = y % z) != 0)\n {\n y = z;\n z = r;\n }",
"(r = y % z) != 0",
"(r = y % z)",
"r",
"y % z",
"y",
"z",
"0",
"{\n y = z;\n z = r;\n }",
"y = z",
"y",
"z",
"z = r",
"z",
"r",
"return z;",
"z",
"int x",
"x",
"int y",
"y",
"int z",
"z",
"public class Main {\n public static void main(String[] args) throws Exception {\n Scanner sc = new Scanner(System.in);\n int k = sc.nextInt();\n long sum = 0;\n \n for(int a = 1; a <= k; a++)\n {\n for(int b = 1; b <= k; b++)\n {\n for(int c = 1; c <= k; c++)\n {\n if(a == b && b ==c)\n {\n sum += a;\n }\n else\n {\n //最大公約数を求める\n int buf = gcd(a,b,c);\n sum += buf;\n }\n }\n }\n }\n System.out.println(sum);\n }\n \n public static int gcd(int x,int y, int z) {\n if(x < y)\n {\n int buf = x;\n x = y;\n y = buf;\n }\n int r = 0;\n while(( r = x % y) != 0)\n {\n x = y;\n y = r;\n }\n \n if(y < z)\n {\n int buf = y;\n y = z;\n z = buf;\n }\n while((r = y % z) != 0)\n {\n y = z;\n z = r;\n }\n return z;\n }\n}",
"public class Main {\n public static void main(String[] args) throws Exception {\n Scanner sc = new Scanner(System.in);\n int k = sc.nextInt();\n long sum = 0;\n \n for(int a = 1; a <= k; a++)\n {\n for(int b = 1; b <= k; b++)\n {\n for(int c = 1; c <= k; c++)\n {\n if(a == b && b ==c)\n {\n sum += a;\n }\n else\n {\n //最大公約数を求める\n int buf = gcd(a,b,c);\n sum += buf;\n }\n }\n }\n }\n System.out.println(sum);\n }\n \n public static int gcd(int x,int y, int z) {\n if(x < y)\n {\n int buf = x;\n x = y;\n y = buf;\n }\n int r = 0;\n while(( r = x % y) != 0)\n {\n x = y;\n y = r;\n }\n \n if(y < z)\n {\n int buf = y;\n y = z;\n z = buf;\n }\n while((r = y % z) != 0)\n {\n y = z;\n z = r;\n }\n return z;\n }\n}",
"Main"
] |
import java.util.*;
public class Main {
public static void main(String[] args) throws Exception {
Scanner sc = new Scanner(System.in);
int k = sc.nextInt();
long sum = 0;
for(int a = 1; a <= k; a++)
{
for(int b = 1; b <= k; b++)
{
for(int c = 1; c <= k; c++)
{
if(a == b && b ==c)
{
sum += a;
}
else
{
//最大公約数を求める
int buf = gcd(a,b,c);
sum += buf;
}
}
}
}
System.out.println(sum);
}
public static int gcd(int x,int y, int z) {
if(x < y)
{
int buf = x;
x = y;
y = buf;
}
int r = 0;
while(( r = x % y) != 0)
{
x = y;
y = r;
}
if(y < z)
{
int buf = y;
y = z;
z = buf;
}
while((r = y % z) != 0)
{
y = z;
z = r;
}
return z;
}
}
|
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
41,
13,
4,
13,
13,
13,
0,
13,
4,
13,
13,
13,
4,
18,
18,
13,
13,
13,
23,
13,
12,
13,
30,
14,
2,
13,
17,
29,
13,
30,
29,
4,
13,
13,
2,
13,
13,
23,
13,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
101,
5
],
[
101,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
8,
17
],
[
17,
18
],
[
17,
19
],
[
8,
20
],
[
20,
21
],
[
21,
22
],
[
22,
23
],
[
22,
24
],
[
20,
25
],
[
25,
26
],
[
25,
27
],
[
20,
28
],
[
28,
29
],
[
29,
30
],
[
20,
31
],
[
32,
32
],
[
32,
33
],
[
33,
34
],
[
34,
35
],
[
35,
36
],
[
35,
37
],
[
33,
38
],
[
38,
39
],
[
38,
40
],
[
33,
41
],
[
41,
42
],
[
42,
43
],
[
33,
44
],
[
45,
45
],
[
45,
46
],
[
46,
47
],
[
47,
48
],
[
48,
49
],
[
48,
50
],
[
46,
51
],
[
51,
52
],
[
51,
53
],
[
46,
54
],
[
54,
55
],
[
55,
56
],
[
46,
57
],
[
58,
58
],
[
58,
59
],
[
59,
60
],
[
59,
61
],
[
61,
62
],
[
61,
63
],
[
61,
64
],
[
58,
65
],
[
65,
66
],
[
65,
67
],
[
67,
68
],
[
67,
69
],
[
67,
70
],
[
8,
71
],
[
71,
72
],
[
72,
73
],
[
73,
74
],
[
73,
75
],
[
71,
76
],
[
6,
77
],
[
77,
78
],
[
101,
79
],
[
79,
80
],
[
79,
81
],
[
81,
82
],
[
82,
83
],
[
83,
84
],
[
83,
85
],
[
82,
86
],
[
86,
87
],
[
82,
88
],
[
88,
89
],
[
89,
90
],
[
90,
91
],
[
90,
92
],
[
90,
93
],
[
93,
94
],
[
93,
95
],
[
79,
96
],
[
96,
97
],
[
79,
98
],
[
98,
99
],
[
0,
100
],
[
100,
101
],
[
100,
102
]
] |
[
"import java.util.Scanner;\n\npublic class Main{\n public static void main(String[] args){\n Scanner a = new Scanner(System.in);\n int h = a.nextInt();\n int ans = 0;\n for(int i = 1; i <= h; i++){\n for(int j = 1; j <= h; j++){\n for(int k = 1; k <= h; k++){\n int temp = gcd(i,j);\n ans+=gcd(temp,k);\n }\n }\n }\n \n System.out.println(ans);\n }\n \n static int gcd(int x, int y){\n if(y == 0)return x;\n else{\n return gcd(y, x%y);\n }\n }\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main{\n public static void main(String[] args){\n Scanner a = new Scanner(System.in);\n int h = a.nextInt();\n int ans = 0;\n for(int i = 1; i <= h; i++){\n for(int j = 1; j <= h; j++){\n for(int k = 1; k <= h; k++){\n int temp = gcd(i,j);\n ans+=gcd(temp,k);\n }\n }\n }\n \n System.out.println(ans);\n }\n \n static int gcd(int x, int y){\n if(y == 0)return x;\n else{\n return gcd(y, x%y);\n }\n }\n}",
"Main",
"public static void main(String[] args){\n Scanner a = new Scanner(System.in);\n int h = a.nextInt();\n int ans = 0;\n for(int i = 1; i <= h; i++){\n for(int j = 1; j <= h; j++){\n for(int k = 1; k <= h; k++){\n int temp = gcd(i,j);\n ans+=gcd(temp,k);\n }\n }\n }\n \n System.out.println(ans);\n }",
"main",
"{\n Scanner a = new Scanner(System.in);\n int h = a.nextInt();\n int ans = 0;\n for(int i = 1; i <= h; i++){\n for(int j = 1; j <= h; j++){\n for(int k = 1; k <= h; k++){\n int temp = gcd(i,j);\n ans+=gcd(temp,k);\n }\n }\n }\n \n System.out.println(ans);\n }",
"Scanner a = new Scanner(System.in);",
"a",
"new Scanner(System.in)",
"int h = a.nextInt();",
"h",
"a.nextInt()",
"a.nextInt",
"a",
"int ans = 0;",
"ans",
"0",
"for(int i = 1; i <= h; i++){\n for(int j = 1; j <= h; j++){\n for(int k = 1; k <= h; k++){\n int temp = gcd(i,j);\n ans+=gcd(temp,k);\n }\n }\n }",
"int i = 1;",
"int i = 1;",
"i",
"1",
"i <= h",
"i",
"h",
"i++",
"i++",
"i",
"{\n for(int j = 1; j <= h; j++){\n for(int k = 1; k <= h; k++){\n int temp = gcd(i,j);\n ans+=gcd(temp,k);\n }\n }\n }",
"{\n for(int j = 1; j <= h; j++){\n for(int k = 1; k <= h; k++){\n int temp = gcd(i,j);\n ans+=gcd(temp,k);\n }\n }\n }",
"for(int j = 1; j <= h; j++){\n for(int k = 1; k <= h; k++){\n int temp = gcd(i,j);\n ans+=gcd(temp,k);\n }\n }",
"int j = 1;",
"int j = 1;",
"j",
"1",
"j <= h",
"j",
"h",
"j++",
"j++",
"j",
"{\n for(int k = 1; k <= h; k++){\n int temp = gcd(i,j);\n ans+=gcd(temp,k);\n }\n }",
"{\n for(int k = 1; k <= h; k++){\n int temp = gcd(i,j);\n ans+=gcd(temp,k);\n }\n }",
"for(int k = 1; k <= h; k++){\n int temp = gcd(i,j);\n ans+=gcd(temp,k);\n }",
"int k = 1;",
"int k = 1;",
"k",
"1",
"k <= h",
"k",
"h",
"k++",
"k++",
"k",
"{\n int temp = gcd(i,j);\n ans+=gcd(temp,k);\n }",
"{\n int temp = gcd(i,j);\n ans+=gcd(temp,k);\n }",
"int temp = gcd(i,j);",
"temp",
"gcd(i,j)",
"gcd",
"i",
"j",
"ans+=gcd(temp,k)",
"ans",
"gcd(temp,k)",
"gcd",
"temp",
"k",
"System.out.println(ans)",
"System.out.println",
"System.out",
"System",
"System.out",
"ans",
"String[] args",
"args",
"static int gcd(int x, int y){\n if(y == 0)return x;\n else{\n return gcd(y, x%y);\n }\n }",
"gcd",
"{\n if(y == 0)return x;\n else{\n return gcd(y, x%y);\n }\n }",
"if(y == 0)return x;\n else{\n return gcd(y, x%y);\n }",
"y == 0",
"y",
"0",
"return x;",
"x",
"{\n return gcd(y, x%y);\n }",
"return gcd(y, x%y);",
"gcd(y, x%y)",
"gcd",
"y",
"x%y",
"x",
"y",
"int x",
"x",
"int y",
"y",
"public class Main{\n public static void main(String[] args){\n Scanner a = new Scanner(System.in);\n int h = a.nextInt();\n int ans = 0;\n for(int i = 1; i <= h; i++){\n for(int j = 1; j <= h; j++){\n for(int k = 1; k <= h; k++){\n int temp = gcd(i,j);\n ans+=gcd(temp,k);\n }\n }\n }\n \n System.out.println(ans);\n }\n \n static int gcd(int x, int y){\n if(y == 0)return x;\n else{\n return gcd(y, x%y);\n }\n }\n}",
"public class Main{\n public static void main(String[] args){\n Scanner a = new Scanner(System.in);\n int h = a.nextInt();\n int ans = 0;\n for(int i = 1; i <= h; i++){\n for(int j = 1; j <= h; j++){\n for(int k = 1; k <= h; k++){\n int temp = gcd(i,j);\n ans+=gcd(temp,k);\n }\n }\n }\n \n System.out.println(ans);\n }\n \n static int gcd(int x, int y){\n if(y == 0)return x;\n else{\n return gcd(y, x%y);\n }\n }\n}",
"Main"
] |
import java.util.Scanner;
public class Main{
public static void main(String[] args){
Scanner a = new Scanner(System.in);
int h = a.nextInt();
int ans = 0;
for(int i = 1; i <= h; i++){
for(int j = 1; j <= h; j++){
for(int k = 1; k <= h; k++){
int temp = gcd(i,j);
ans+=gcd(temp,k);
}
}
}
System.out.println(ans);
}
static int gcd(int x, int y){
if(y == 0)return x;
else{
return gcd(y, x%y);
}
}
}
|
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
2,
13,
17,
1,
40,
13,
30,
30,
11,
1,
41,
13,
17,
2,
13,
2,
13,
17,
1,
40,
13,
30,
30,
11,
1,
41,
13,
17,
2,
13,
2,
13,
17,
1,
40,
13,
30,
0,
13,
4,
13,
13,
13,
13,
4,
18,
18,
13,
13,
13,
23,
13,
12,
13,
30,
14,
2,
13,
13,
30,
41,
13,
13,
0,
13,
13,
0,
13,
13,
41,
13,
40,
17,
42,
2,
13,
17,
30,
0,
13,
2,
13,
13,
0,
13,
13,
0,
13,
13,
29,
13,
23,
13,
23,
13,
12,
13,
30,
29,
4,
13,
4,
13,
13,
13,
13,
23,
13,
23,
13,
23,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
8,
17
],
[
17,
18
],
[
17,
19
],
[
8,
20
],
[
20,
21
],
[
21,
22
],
[
22,
23
],
[
22,
24
],
[
20,
25
],
[
25,
26
],
[
25,
27
],
[
27,
28
],
[
27,
29
],
[
20,
30
],
[
30,
31
],
[
31,
32
],
[
20,
33
],
[
34,
34
],
[
34,
35
],
[
35,
36
],
[
36,
37
],
[
37,
38
],
[
37,
39
],
[
35,
40
],
[
40,
41
],
[
40,
42
],
[
42,
43
],
[
42,
44
],
[
35,
45
],
[
45,
46
],
[
46,
47
],
[
35,
48
],
[
49,
49
],
[
49,
50
],
[
50,
51
],
[
51,
52
],
[
52,
53
],
[
52,
54
],
[
50,
55
],
[
55,
56
],
[
55,
57
],
[
57,
58
],
[
57,
59
],
[
50,
60
],
[
60,
61
],
[
61,
62
],
[
50,
63
],
[
63,
64
],
[
64,
65
],
[
64,
66
],
[
66,
67
],
[
66,
68
],
[
66,
69
],
[
66,
70
],
[
8,
71
],
[
71,
72
],
[
72,
73
],
[
73,
74
],
[
73,
75
],
[
71,
76
],
[
6,
77
],
[
77,
78
],
[
4,
79
],
[
79,
80
],
[
79,
81
],
[
81,
82
],
[
82,
83
],
[
83,
84
],
[
83,
85
],
[
82,
86
],
[
86,
87
],
[
87,
88
],
[
87,
89
],
[
86,
90
],
[
90,
91
],
[
90,
92
],
[
86,
93
],
[
93,
94
],
[
93,
95
],
[
81,
96
],
[
96,
97
],
[
96,
98
],
[
98,
99
],
[
81,
100
],
[
100,
101
],
[
101,
102
],
[
101,
103
],
[
100,
104
],
[
104,
105
],
[
105,
106
],
[
105,
107
],
[
107,
108
],
[
107,
109
],
[
104,
110
],
[
110,
111
],
[
110,
112
],
[
104,
113
],
[
113,
114
],
[
113,
115
],
[
81,
116
],
[
116,
117
],
[
79,
118
],
[
118,
119
],
[
79,
120
],
[
120,
121
],
[
4,
122
],
[
122,
123
],
[
122,
124
],
[
124,
125
],
[
125,
126
],
[
126,
127
],
[
126,
128
],
[
128,
129
],
[
128,
130
],
[
128,
131
],
[
126,
132
],
[
122,
133
],
[
133,
134
],
[
122,
135
],
[
135,
136
],
[
122,
137
],
[
137,
138
]
] |
[
"import java.util.*;\n\nclass Main {\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n int K = sc.nextInt();\n \n int sum = 0;\n \n for(int i=1;i<K+1;i++) {\n for(int j=1;j<K+1;j++){\n for(int k=1;k<K+1;k++) sum += gcd(i, j, k);\n }\n }\n \n System.out.println(sum);\n }\n public static int gcd(int a, int b) {\n if (a < b) {\n int tmp = a;\n a = b;\n b = tmp;\n }\n int r = -1;\n while (r != 0) {\n r = a % b;\n a = b;\n b = r;\n }\n return a;\n }\n public static int gcd(int a, int b, int c) {\n return gcd(gcd(a, b), c);\n }\n}",
"import java.util.*;",
"util.*",
"java",
"class Main {\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n int K = sc.nextInt();\n \n int sum = 0;\n \n for(int i=1;i<K+1;i++) {\n for(int j=1;j<K+1;j++){\n for(int k=1;k<K+1;k++) sum += gcd(i, j, k);\n }\n }\n \n System.out.println(sum);\n }\n public static int gcd(int a, int b) {\n if (a < b) {\n int tmp = a;\n a = b;\n b = tmp;\n }\n int r = -1;\n while (r != 0) {\n r = a % b;\n a = b;\n b = r;\n }\n return a;\n }\n public static int gcd(int a, int b, int c) {\n return gcd(gcd(a, b), c);\n }\n}",
"Main",
"public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n int K = sc.nextInt();\n \n int sum = 0;\n \n for(int i=1;i<K+1;i++) {\n for(int j=1;j<K+1;j++){\n for(int k=1;k<K+1;k++) sum += gcd(i, j, k);\n }\n }\n \n System.out.println(sum);\n }",
"main",
"{\n Scanner sc = new Scanner(System.in);\n int K = sc.nextInt();\n \n int sum = 0;\n \n for(int i=1;i<K+1;i++) {\n for(int j=1;j<K+1;j++){\n for(int k=1;k<K+1;k++) sum += gcd(i, j, k);\n }\n }\n \n System.out.println(sum);\n }",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"int K = sc.nextInt();",
"K",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int sum = 0;",
"sum",
"0",
"for(int i=1;i<K+1;i++) {\n for(int j=1;j<K+1;j++){\n for(int k=1;k<K+1;k++) sum += gcd(i, j, k);\n }\n }",
"int i=1;",
"int i=1;",
"i",
"1",
"i<K+1",
"i",
"K+1",
"K",
"1",
"i++",
"i++",
"i",
"{\n for(int j=1;j<K+1;j++){\n for(int k=1;k<K+1;k++) sum += gcd(i, j, k);\n }\n }",
"{\n for(int j=1;j<K+1;j++){\n for(int k=1;k<K+1;k++) sum += gcd(i, j, k);\n }\n }",
"for(int j=1;j<K+1;j++){\n for(int k=1;k<K+1;k++) sum += gcd(i, j, k);\n }",
"int j=1;",
"int j=1;",
"j",
"1",
"j<K+1",
"j",
"K+1",
"K",
"1",
"j++",
"j++",
"j",
"{\n for(int k=1;k<K+1;k++) sum += gcd(i, j, k);\n }",
"{\n for(int k=1;k<K+1;k++) sum += gcd(i, j, k);\n }",
"for(int k=1;k<K+1;k++) sum += gcd(i, j, k);",
"int k=1;",
"int k=1;",
"k",
"1",
"k<K+1",
"k",
"K+1",
"K",
"1",
"k++",
"k++",
"k",
"sum += gcd(i, j, k);",
"sum += gcd(i, j, k)",
"sum",
"gcd(i, j, k)",
"gcd",
"i",
"j",
"k",
"System.out.println(sum)",
"System.out.println",
"System.out",
"System",
"System.out",
"sum",
"String[] args",
"args",
"public static int gcd(int a, int b) {\n if (a < b) {\n int tmp = a;\n a = b;\n b = tmp;\n }\n int r = -1;\n while (r != 0) {\n r = a % b;\n a = b;\n b = r;\n }\n return a;\n }",
"gcd",
"{\n if (a < b) {\n int tmp = a;\n a = b;\n b = tmp;\n }\n int r = -1;\n while (r != 0) {\n r = a % b;\n a = b;\n b = r;\n }\n return a;\n }",
"if (a < b) {\n int tmp = a;\n a = b;\n b = tmp;\n }",
"a < b",
"a",
"b",
"{\n int tmp = a;\n a = b;\n b = tmp;\n }",
"int tmp = a;",
"tmp",
"a",
"a = b",
"a",
"b",
"b = tmp",
"b",
"tmp",
"int r = -1;",
"r",
"-1",
"1",
"while (r != 0) {\n r = a % b;\n a = b;\n b = r;\n }",
"r != 0",
"r",
"0",
"{\n r = a % b;\n a = b;\n b = r;\n }",
"r = a % b",
"r",
"a % b",
"a",
"b",
"a = b",
"a",
"b",
"b = r",
"b",
"r",
"return a;",
"a",
"int a",
"a",
"int b",
"b",
"public static int gcd(int a, int b, int c) {\n return gcd(gcd(a, b), c);\n }",
"gcd",
"{\n return gcd(gcd(a, b), c);\n }",
"return gcd(gcd(a, b), c);",
"gcd(gcd(a, b), c)",
"gcd",
"gcd(a, b)",
"gcd",
"a",
"b",
"c",
"int a",
"a",
"int b",
"b",
"int c",
"c"
] |
import java.util.*;
class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int K = sc.nextInt();
int sum = 0;
for(int i=1;i<K+1;i++) {
for(int j=1;j<K+1;j++){
for(int k=1;k<K+1;k++) sum += gcd(i, j, k);
}
}
System.out.println(sum);
}
public static int gcd(int a, int b) {
if (a < b) {
int tmp = a;
a = b;
b = tmp;
}
int r = -1;
while (r != 0) {
r = a % b;
a = b;
b = r;
}
return a;
}
public static int gcd(int a, int b, int c) {
return gcd(gcd(a, b), c);
}
}
|
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
41,
13,
4,
18,
13,
13,
13,
0,
13,
4,
18,
13,
13,
13,
4,
18,
18,
13,
13,
13,
23,
13,
12,
13,
30,
14,
2,
13,
13,
30,
41,
13,
13,
0,
13,
13,
0,
13,
13,
41,
13,
42,
2,
0,
13,
2,
13,
13,
17,
30,
0,
13,
13,
0,
13,
13,
29,
13,
23,
13,
23,
13,
10,
6,
13
] |
[
[
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
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
8,
17
],
[
17,
18
],
[
17,
19
],
[
8,
20
],
[
20,
21
],
[
21,
22
],
[
22,
23
],
[
22,
24
],
[
20,
25
],
[
25,
26
],
[
25,
27
],
[
20,
28
],
[
28,
29
],
[
29,
30
],
[
20,
31
],
[
32,
32
],
[
32,
33
],
[
33,
34
],
[
34,
35
],
[
35,
36
],
[
35,
37
],
[
33,
38
],
[
38,
39
],
[
38,
40
],
[
33,
41
],
[
41,
42
],
[
42,
43
],
[
33,
44
],
[
45,
45
],
[
45,
46
],
[
46,
47
],
[
47,
48
],
[
48,
49
],
[
48,
50
],
[
46,
51
],
[
51,
52
],
[
51,
53
],
[
46,
54
],
[
54,
55
],
[
55,
56
],
[
46,
57
],
[
58,
58
],
[
58,
59
],
[
59,
60
],
[
59,
61
],
[
61,
62
],
[
62,
63
],
[
61,
64
],
[
61,
65
],
[
58,
66
],
[
66,
67
],
[
66,
68
],
[
68,
69
],
[
69,
70
],
[
68,
71
],
[
68,
72
],
[
8,
73
],
[
73,
74
],
[
74,
75
],
[
75,
76
],
[
75,
77
],
[
73,
78
],
[
6,
79
],
[
79,
80
],
[
122,
81
],
[
81,
82
],
[
81,
83
],
[
83,
84
],
[
84,
85
],
[
85,
86
],
[
85,
87
],
[
84,
88
],
[
88,
89
],
[
89,
90
],
[
89,
91
],
[
88,
92
],
[
92,
93
],
[
92,
94
],
[
88,
95
],
[
95,
96
],
[
95,
97
],
[
83,
98
],
[
98,
99
],
[
83,
100
],
[
100,
101
],
[
101,
102
],
[
102,
103
],
[
102,
104
],
[
104,
105
],
[
104,
106
],
[
101,
107
],
[
100,
108
],
[
108,
109
],
[
109,
110
],
[
109,
111
],
[
108,
112
],
[
112,
113
],
[
112,
114
],
[
83,
115
],
[
115,
116
],
[
81,
117
],
[
117,
118
],
[
81,
119
],
[
119,
120
],
[
0,
121
],
[
121,
122
],
[
121,
123
]
] |
[
"import java.util.*;\npublic class Main {\n public static void main(String[] args){\n Scanner sc = new Scanner(System.in);\n int k = sc.nextInt();\n long ans = 0;\n for (int a = 1; a <= k; a++) {\n for (int b = 1; b <= k; b++) {\n for (int c= 1; c <= k; c++) {\n int temp = Main.gcd(a, b);\n ans += Main.gcd(temp, c);\n }\n }\n }\n \n System.out.println(ans);\n }\n\n private static int gcd (int a, int b) {\n if (b > a) {\n int x = a;\n a = b;\n b = x;\n }\n \n int temp;\n while((temp = a%b)!=0) {\n\t\ta = b;\n\t\tb = temp;\n\t}\n\treturn b;\n }\n\n}",
"import java.util.*;",
"util.*",
"java",
"public class Main {\n public static void main(String[] args){\n Scanner sc = new Scanner(System.in);\n int k = sc.nextInt();\n long ans = 0;\n for (int a = 1; a <= k; a++) {\n for (int b = 1; b <= k; b++) {\n for (int c= 1; c <= k; c++) {\n int temp = Main.gcd(a, b);\n ans += Main.gcd(temp, c);\n }\n }\n }\n \n System.out.println(ans);\n }\n\n private static int gcd (int a, int b) {\n if (b > a) {\n int x = a;\n a = b;\n b = x;\n }\n \n int temp;\n while((temp = a%b)!=0) {\n\t\ta = b;\n\t\tb = temp;\n\t}\n\treturn b;\n }\n\n}",
"Main",
"public static void main(String[] args){\n Scanner sc = new Scanner(System.in);\n int k = sc.nextInt();\n long ans = 0;\n for (int a = 1; a <= k; a++) {\n for (int b = 1; b <= k; b++) {\n for (int c= 1; c <= k; c++) {\n int temp = Main.gcd(a, b);\n ans += Main.gcd(temp, c);\n }\n }\n }\n \n System.out.println(ans);\n }",
"main",
"{\n Scanner sc = new Scanner(System.in);\n int k = sc.nextInt();\n long ans = 0;\n for (int a = 1; a <= k; a++) {\n for (int b = 1; b <= k; b++) {\n for (int c= 1; c <= k; c++) {\n int temp = Main.gcd(a, b);\n ans += Main.gcd(temp, c);\n }\n }\n }\n \n System.out.println(ans);\n }",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"int k = sc.nextInt();",
"k",
"sc.nextInt()",
"sc.nextInt",
"sc",
"long ans = 0;",
"ans",
"0",
"for (int a = 1; a <= k; a++) {\n for (int b = 1; b <= k; b++) {\n for (int c= 1; c <= k; c++) {\n int temp = Main.gcd(a, b);\n ans += Main.gcd(temp, c);\n }\n }\n }",
"int a = 1;",
"int a = 1;",
"a",
"1",
"a <= k",
"a",
"k",
"a++",
"a++",
"a",
"{\n for (int b = 1; b <= k; b++) {\n for (int c= 1; c <= k; c++) {\n int temp = Main.gcd(a, b);\n ans += Main.gcd(temp, c);\n }\n }\n }",
"{\n for (int b = 1; b <= k; b++) {\n for (int c= 1; c <= k; c++) {\n int temp = Main.gcd(a, b);\n ans += Main.gcd(temp, c);\n }\n }\n }",
"for (int b = 1; b <= k; b++) {\n for (int c= 1; c <= k; c++) {\n int temp = Main.gcd(a, b);\n ans += Main.gcd(temp, c);\n }\n }",
"int b = 1;",
"int b = 1;",
"b",
"1",
"b <= k",
"b",
"k",
"b++",
"b++",
"b",
"{\n for (int c= 1; c <= k; c++) {\n int temp = Main.gcd(a, b);\n ans += Main.gcd(temp, c);\n }\n }",
"{\n for (int c= 1; c <= k; c++) {\n int temp = Main.gcd(a, b);\n ans += Main.gcd(temp, c);\n }\n }",
"for (int c= 1; c <= k; c++) {\n int temp = Main.gcd(a, b);\n ans += Main.gcd(temp, c);\n }",
"int c= 1;",
"int c= 1;",
"c",
"1",
"c <= k",
"c",
"k",
"c++",
"c++",
"c",
"{\n int temp = Main.gcd(a, b);\n ans += Main.gcd(temp, c);\n }",
"{\n int temp = Main.gcd(a, b);\n ans += Main.gcd(temp, c);\n }",
"int temp = Main.gcd(a, b);",
"temp",
"Main.gcd(a, b)",
"Main.gcd",
"Main",
"a",
"b",
"ans += Main.gcd(temp, c)",
"ans",
"Main.gcd(temp, c)",
"Main.gcd",
"Main",
"temp",
"c",
"System.out.println(ans)",
"System.out.println",
"System.out",
"System",
"System.out",
"ans",
"String[] args",
"args",
"private static int gcd (int a, int b) {\n if (b > a) {\n int x = a;\n a = b;\n b = x;\n }\n \n int temp;\n while((temp = a%b)!=0) {\n\t\ta = b;\n\t\tb = temp;\n\t}\n\treturn b;\n }",
"gcd",
"{\n if (b > a) {\n int x = a;\n a = b;\n b = x;\n }\n \n int temp;\n while((temp = a%b)!=0) {\n\t\ta = b;\n\t\tb = temp;\n\t}\n\treturn b;\n }",
"if (b > a) {\n int x = a;\n a = b;\n b = x;\n }",
"b > a",
"b",
"a",
"{\n int x = a;\n a = b;\n b = x;\n }",
"int x = a;",
"x",
"a",
"a = b",
"a",
"b",
"b = x",
"b",
"x",
"int temp;",
"temp",
"while((temp = a%b)!=0) {\n\t\ta = b;\n\t\tb = temp;\n\t}",
"(temp = a%b)!=0",
"(temp = a%b)",
"temp",
"a%b",
"a",
"b",
"0",
"{\n\t\ta = b;\n\t\tb = temp;\n\t}",
"a = b",
"a",
"b",
"b = temp",
"b",
"temp",
"return b;",
"b",
"int a",
"a",
"int b",
"b",
"public class Main {\n public static void main(String[] args){\n Scanner sc = new Scanner(System.in);\n int k = sc.nextInt();\n long ans = 0;\n for (int a = 1; a <= k; a++) {\n for (int b = 1; b <= k; b++) {\n for (int c= 1; c <= k; c++) {\n int temp = Main.gcd(a, b);\n ans += Main.gcd(temp, c);\n }\n }\n }\n \n System.out.println(ans);\n }\n\n private static int gcd (int a, int b) {\n if (b > a) {\n int x = a;\n a = b;\n b = x;\n }\n \n int temp;\n while((temp = a%b)!=0) {\n\t\ta = b;\n\t\tb = temp;\n\t}\n\treturn b;\n }\n\n}",
"public class Main {\n public static void main(String[] args){\n Scanner sc = new Scanner(System.in);\n int k = sc.nextInt();\n long ans = 0;\n for (int a = 1; a <= k; a++) {\n for (int b = 1; b <= k; b++) {\n for (int c= 1; c <= k; c++) {\n int temp = Main.gcd(a, b);\n ans += Main.gcd(temp, c);\n }\n }\n }\n \n System.out.println(ans);\n }\n\n private static int gcd (int a, int b) {\n if (b > a) {\n int x = a;\n a = b;\n b = x;\n }\n \n int temp;\n while((temp = a%b)!=0) {\n\t\ta = b;\n\t\tb = temp;\n\t}\n\treturn b;\n }\n\n}",
"Main"
] |
import java.util.*;
public class Main {
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
int k = sc.nextInt();
long ans = 0;
for (int a = 1; a <= k; a++) {
for (int b = 1; b <= k; b++) {
for (int c= 1; c <= k; c++) {
int temp = Main.gcd(a, b);
ans += Main.gcd(temp, c);
}
}
}
System.out.println(ans);
}
private static int gcd (int a, int b) {
if (b > a) {
int x = a;
a = b;
b = x;
}
int temp;
while((temp = a%b)!=0) {
a = b;
b = temp;
}
return b;
}
}
|
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
38,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
4,
13,
13,
4,
13,
13,
13,
4,
18,
18,
13,
13,
13,
23,
13,
12,
13,
30,
14,
2,
13,
17,
30,
29,
13,
29,
4,
13,
13,
2,
13,
13,
23,
13,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
100,
5
],
[
100,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
10,
11
],
[
11,
12
],
[
11,
13
],
[
10,
14
],
[
14,
15
],
[
14,
16
],
[
16,
17
],
[
17,
18
],
[
10,
19
],
[
19,
20
],
[
19,
21
],
[
10,
22
],
[
22,
23
],
[
23,
24
],
[
24,
25
],
[
24,
26
],
[
22,
27
],
[
27,
28
],
[
27,
29
],
[
22,
30
],
[
30,
31
],
[
31,
32
],
[
22,
33
],
[
34,
34
],
[
34,
35
],
[
35,
36
],
[
36,
37
],
[
37,
38
],
[
37,
39
],
[
35,
40
],
[
40,
41
],
[
40,
42
],
[
35,
43
],
[
43,
44
],
[
44,
45
],
[
35,
46
],
[
47,
47
],
[
47,
48
],
[
48,
49
],
[
49,
50
],
[
50,
51
],
[
50,
52
],
[
48,
53
],
[
53,
54
],
[
53,
55
],
[
48,
56
],
[
56,
57
],
[
57,
58
],
[
48,
59
],
[
60,
60
],
[
60,
61
],
[
61,
62
],
[
61,
63
],
[
63,
64
],
[
63,
65
],
[
63,
66
],
[
66,
67
],
[
66,
68
],
[
66,
69
],
[
10,
70
],
[
70,
71
],
[
71,
72
],
[
72,
73
],
[
72,
74
],
[
70,
75
],
[
6,
76
],
[
76,
77
],
[
100,
78
],
[
78,
79
],
[
78,
80
],
[
80,
81
],
[
81,
82
],
[
82,
83
],
[
82,
84
],
[
81,
85
],
[
85,
86
],
[
86,
87
],
[
80,
88
],
[
88,
89
],
[
89,
90
],
[
89,
91
],
[
89,
92
],
[
92,
93
],
[
92,
94
],
[
78,
95
],
[
95,
96
],
[
78,
97
],
[
97,
98
],
[
0,
99
],
[
99,
100
],
[
99,
101
]
] |
[
"import java.util.Scanner;\n\npublic class Main {\n public static void main(String[] args) {\n try (Scanner sc = new Scanner(System.in)) {\n int K = sc.nextInt();\n\n int sum = 0;\n for (int i = 1; i <= K; i++) {\n for (int j = 1; j <= K; j++) {\n for (int k = 1; k <= K; k++) {\n sum += gcd(i, gcd(j, k));\n }\n }\n }\n\n System.out.println(sum);\n }\n }\n\n public static final int gcd(int a, int b) {\n if (b == 0) {\n return a;\n }\n return gcd(b, a % b);\n }\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n public static void main(String[] args) {\n try (Scanner sc = new Scanner(System.in)) {\n int K = sc.nextInt();\n\n int sum = 0;\n for (int i = 1; i <= K; i++) {\n for (int j = 1; j <= K; j++) {\n for (int k = 1; k <= K; k++) {\n sum += gcd(i, gcd(j, k));\n }\n }\n }\n\n System.out.println(sum);\n }\n }\n\n public static final int gcd(int a, int b) {\n if (b == 0) {\n return a;\n }\n return gcd(b, a % b);\n }\n}",
"Main",
"public static void main(String[] args) {\n try (Scanner sc = new Scanner(System.in)) {\n int K = sc.nextInt();\n\n int sum = 0;\n for (int i = 1; i <= K; i++) {\n for (int j = 1; j <= K; j++) {\n for (int k = 1; k <= K; k++) {\n sum += gcd(i, gcd(j, k));\n }\n }\n }\n\n System.out.println(sum);\n }\n }",
"main",
"{\n try (Scanner sc = new Scanner(System.in)) {\n int K = sc.nextInt();\n\n int sum = 0;\n for (int i = 1; i <= K; i++) {\n for (int j = 1; j <= K; j++) {\n for (int k = 1; k <= K; k++) {\n sum += gcd(i, gcd(j, k));\n }\n }\n }\n\n System.out.println(sum);\n }\n }",
"try (Scanner sc = new Scanner(System.in)) {\n int K = sc.nextInt();\n\n int sum = 0;\n for (int i = 1; i <= K; i++) {\n for (int j = 1; j <= K; j++) {\n for (int k = 1; k <= K; k++) {\n sum += gcd(i, gcd(j, k));\n }\n }\n }\n\n System.out.println(sum);\n }",
"{\n int K = sc.nextInt();\n\n int sum = 0;\n for (int i = 1; i <= K; i++) {\n for (int j = 1; j <= K; j++) {\n for (int k = 1; k <= K; k++) {\n sum += gcd(i, gcd(j, k));\n }\n }\n }\n\n System.out.println(sum);\n }",
"Scanner sc = new Scanner(System.in)",
"Scanner sc = new Scanner(System.in)",
"new Scanner(System.in)",
"int K = sc.nextInt();",
"K",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int sum = 0;",
"sum",
"0",
"for (int i = 1; i <= K; i++) {\n for (int j = 1; j <= K; j++) {\n for (int k = 1; k <= K; k++) {\n sum += gcd(i, gcd(j, k));\n }\n }\n }",
"int i = 1;",
"int i = 1;",
"i",
"1",
"i <= K",
"i",
"K",
"i++",
"i++",
"i",
"{\n for (int j = 1; j <= K; j++) {\n for (int k = 1; k <= K; k++) {\n sum += gcd(i, gcd(j, k));\n }\n }\n }",
"{\n for (int j = 1; j <= K; j++) {\n for (int k = 1; k <= K; k++) {\n sum += gcd(i, gcd(j, k));\n }\n }\n }",
"for (int j = 1; j <= K; j++) {\n for (int k = 1; k <= K; k++) {\n sum += gcd(i, gcd(j, k));\n }\n }",
"int j = 1;",
"int j = 1;",
"j",
"1",
"j <= K",
"j",
"K",
"j++",
"j++",
"j",
"{\n for (int k = 1; k <= K; k++) {\n sum += gcd(i, gcd(j, k));\n }\n }",
"{\n for (int k = 1; k <= K; k++) {\n sum += gcd(i, gcd(j, k));\n }\n }",
"for (int k = 1; k <= K; k++) {\n sum += gcd(i, gcd(j, k));\n }",
"int k = 1;",
"int k = 1;",
"k",
"1",
"k <= K",
"k",
"K",
"k++",
"k++",
"k",
"{\n sum += gcd(i, gcd(j, k));\n }",
"{\n sum += gcd(i, gcd(j, k));\n }",
"sum += gcd(i, gcd(j, k))",
"sum",
"gcd(i, gcd(j, k))",
"gcd",
"i",
"gcd(j, k)",
"gcd",
"j",
"k",
"System.out.println(sum)",
"System.out.println",
"System.out",
"System",
"System.out",
"sum",
"String[] args",
"args",
"public static final int gcd(int a, int b) {\n if (b == 0) {\n return a;\n }\n return gcd(b, a % b);\n }",
"gcd",
"{\n if (b == 0) {\n return a;\n }\n return gcd(b, a % b);\n }",
"if (b == 0) {\n return a;\n }",
"b == 0",
"b",
"0",
"{\n return a;\n }",
"return a;",
"a",
"return gcd(b, a % b);",
"gcd(b, a % b)",
"gcd",
"b",
"a % b",
"a",
"b",
"int a",
"a",
"int b",
"b",
"public class Main {\n public static void main(String[] args) {\n try (Scanner sc = new Scanner(System.in)) {\n int K = sc.nextInt();\n\n int sum = 0;\n for (int i = 1; i <= K; i++) {\n for (int j = 1; j <= K; j++) {\n for (int k = 1; k <= K; k++) {\n sum += gcd(i, gcd(j, k));\n }\n }\n }\n\n System.out.println(sum);\n }\n }\n\n public static final int gcd(int a, int b) {\n if (b == 0) {\n return a;\n }\n return gcd(b, a % b);\n }\n}",
"public class Main {\n public static void main(String[] args) {\n try (Scanner sc = new Scanner(System.in)) {\n int K = sc.nextInt();\n\n int sum = 0;\n for (int i = 1; i <= K; i++) {\n for (int j = 1; j <= K; j++) {\n for (int k = 1; k <= K; k++) {\n sum += gcd(i, gcd(j, k));\n }\n }\n }\n\n System.out.println(sum);\n }\n }\n\n public static final int gcd(int a, int b) {\n if (b == 0) {\n return a;\n }\n return gcd(b, a % b);\n }\n}",
"Main"
] |
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
try (Scanner sc = new Scanner(System.in)) {
int K = sc.nextInt();
int sum = 0;
for (int i = 1; i <= K; i++) {
for (int j = 1; j <= K; j++) {
for (int k = 1; k <= K; k++) {
sum += gcd(i, gcd(j, k));
}
}
}
System.out.println(sum);
}
}
public static final int gcd(int a, int b) {
if (b == 0) {
return a;
}
return gcd(b, a % b);
}
}
|
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
17,
41,
13,
41,
13,
4,
18,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
14,
2,
13,
13,
30,
0,
13,
4,
13,
13,
13,
30,
0,
13,
4,
13,
13,
13,
14,
2,
13,
13,
30,
0,
13,
4,
13,
13,
13,
30,
0,
13,
4,
13,
13,
13,
0,
13,
2,
13,
13,
4,
18,
18,
13,
13,
13,
23,
13,
12,
13,
30,
41,
13,
42,
2,
0,
13,
2,
13,
13,
17,
30,
0,
13,
13,
0,
13,
13,
29,
13,
23,
13,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
137,
5
],
[
137,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
8,
15
],
[
15,
16
],
[
8,
17
],
[
17,
18
],
[
17,
19
],
[
19,
20
],
[
20,
21
],
[
8,
22
],
[
22,
23
],
[
23,
24
],
[
24,
25
],
[
24,
26
],
[
22,
27
],
[
27,
28
],
[
27,
29
],
[
22,
30
],
[
30,
31
],
[
31,
32
],
[
22,
33
],
[
34,
34
],
[
34,
35
],
[
35,
36
],
[
36,
37
],
[
37,
38
],
[
37,
39
],
[
35,
40
],
[
40,
41
],
[
40,
42
],
[
35,
43
],
[
43,
44
],
[
44,
45
],
[
35,
46
],
[
47,
47
],
[
47,
48
],
[
48,
49
],
[
49,
50
],
[
50,
51
],
[
50,
52
],
[
48,
53
],
[
53,
54
],
[
53,
55
],
[
48,
56
],
[
56,
57
],
[
57,
58
],
[
48,
59
],
[
60,
60
],
[
60,
61
],
[
61,
62
],
[
62,
63
],
[
62,
64
],
[
61,
65
],
[
65,
66
],
[
66,
67
],
[
66,
68
],
[
68,
69
],
[
68,
70
],
[
68,
71
],
[
61,
72
],
[
72,
73
],
[
73,
74
],
[
73,
75
],
[
75,
76
],
[
75,
77
],
[
75,
78
],
[
60,
79
],
[
79,
80
],
[
80,
81
],
[
80,
82
],
[
79,
83
],
[
83,
84
],
[
84,
85
],
[
84,
86
],
[
86,
87
],
[
86,
88
],
[
86,
89
],
[
79,
90
],
[
90,
91
],
[
91,
92
],
[
91,
93
],
[
93,
94
],
[
93,
95
],
[
93,
96
],
[
60,
97
],
[
97,
98
],
[
97,
99
],
[
99,
100
],
[
99,
101
],
[
8,
102
],
[
102,
103
],
[
103,
104
],
[
104,
105
],
[
104,
106
],
[
102,
107
],
[
6,
108
],
[
108,
109
],
[
137,
110
],
[
110,
111
],
[
110,
112
],
[
112,
113
],
[
113,
114
],
[
112,
115
],
[
115,
116
],
[
116,
117
],
[
117,
118
],
[
117,
119
],
[
119,
120
],
[
119,
121
],
[
116,
122
],
[
115,
123
],
[
123,
124
],
[
124,
125
],
[
124,
126
],
[
123,
127
],
[
127,
128
],
[
127,
129
],
[
112,
130
],
[
130,
131
],
[
110,
132
],
[
132,
133
],
[
110,
134
],
[
134,
135
],
[
0,
136
],
[
136,
137
],
[
136,
138
]
] |
[
"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 sum = 0;\n\t\tlong n;\n\t\tlong num = scan.nextLong();\n\t\tfor(long a = 1; a<=num; a++) {\n\t\t\tfor(long b = 1; b<=num; b++) {\n\t\t\t\tfor(long c = 1; c<=num; c++) {\n\t\t\t\t\tif(a>=b) {\n\t\t\t\t\t\tn = gcd(a,b);\n\t\t\t\t\t}else {\n\t\t\t\t\t\tn = gcd(b,a);\n\t\t\t\t\t}\n\n\t\t\t\t\tif(a>=c) {\n\t\t\t\t\t\tn = gcd(n,c);\n\t\t\t\t\t}else {\n\t\t\t\t\t\tn = gcd(c,n);\n\t\t\t\t\t}\n\n\t\t\t\t\tsum = sum+n;\n\t\t\t\t}\n\t\t\t}\n\t\t}System.out.println(sum);\n\n\t}\n\n\tpublic static long gcd(long x, long y) {\n long tmp;\n while ((tmp = x % y) != 0) {\n x = y;\n y = tmp;\n }\n\n return y;\n}\n\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n\tpublic static void main(String[] args) {\n\t\tScanner scan = new Scanner(System.in);\n\t\tlong sum = 0;\n\t\tlong n;\n\t\tlong num = scan.nextLong();\n\t\tfor(long a = 1; a<=num; a++) {\n\t\t\tfor(long b = 1; b<=num; b++) {\n\t\t\t\tfor(long c = 1; c<=num; c++) {\n\t\t\t\t\tif(a>=b) {\n\t\t\t\t\t\tn = gcd(a,b);\n\t\t\t\t\t}else {\n\t\t\t\t\t\tn = gcd(b,a);\n\t\t\t\t\t}\n\n\t\t\t\t\tif(a>=c) {\n\t\t\t\t\t\tn = gcd(n,c);\n\t\t\t\t\t}else {\n\t\t\t\t\t\tn = gcd(c,n);\n\t\t\t\t\t}\n\n\t\t\t\t\tsum = sum+n;\n\t\t\t\t}\n\t\t\t}\n\t\t}System.out.println(sum);\n\n\t}\n\n\tpublic static long gcd(long x, long y) {\n long tmp;\n while ((tmp = x % y) != 0) {\n x = y;\n y = tmp;\n }\n\n return y;\n}\n\n}",
"Main",
"public static void main(String[] args) {\n\t\tScanner scan = new Scanner(System.in);\n\t\tlong sum = 0;\n\t\tlong n;\n\t\tlong num = scan.nextLong();\n\t\tfor(long a = 1; a<=num; a++) {\n\t\t\tfor(long b = 1; b<=num; b++) {\n\t\t\t\tfor(long c = 1; c<=num; c++) {\n\t\t\t\t\tif(a>=b) {\n\t\t\t\t\t\tn = gcd(a,b);\n\t\t\t\t\t}else {\n\t\t\t\t\t\tn = gcd(b,a);\n\t\t\t\t\t}\n\n\t\t\t\t\tif(a>=c) {\n\t\t\t\t\t\tn = gcd(n,c);\n\t\t\t\t\t}else {\n\t\t\t\t\t\tn = gcd(c,n);\n\t\t\t\t\t}\n\n\t\t\t\t\tsum = sum+n;\n\t\t\t\t}\n\t\t\t}\n\t\t}System.out.println(sum);\n\n\t}",
"main",
"{\n\t\tScanner scan = new Scanner(System.in);\n\t\tlong sum = 0;\n\t\tlong n;\n\t\tlong num = scan.nextLong();\n\t\tfor(long a = 1; a<=num; a++) {\n\t\t\tfor(long b = 1; b<=num; b++) {\n\t\t\t\tfor(long c = 1; c<=num; c++) {\n\t\t\t\t\tif(a>=b) {\n\t\t\t\t\t\tn = gcd(a,b);\n\t\t\t\t\t}else {\n\t\t\t\t\t\tn = gcd(b,a);\n\t\t\t\t\t}\n\n\t\t\t\t\tif(a>=c) {\n\t\t\t\t\t\tn = gcd(n,c);\n\t\t\t\t\t}else {\n\t\t\t\t\t\tn = gcd(c,n);\n\t\t\t\t\t}\n\n\t\t\t\t\tsum = sum+n;\n\t\t\t\t}\n\t\t\t}\n\t\t}System.out.println(sum);\n\n\t}",
"Scanner scan = new Scanner(System.in);",
"scan",
"new Scanner(System.in)",
"long sum = 0;",
"sum",
"0",
"long n;",
"n",
"long num = scan.nextLong();",
"num",
"scan.nextLong()",
"scan.nextLong",
"scan",
"for(long a = 1; a<=num; a++) {\n\t\t\tfor(long b = 1; b<=num; b++) {\n\t\t\t\tfor(long c = 1; c<=num; c++) {\n\t\t\t\t\tif(a>=b) {\n\t\t\t\t\t\tn = gcd(a,b);\n\t\t\t\t\t}else {\n\t\t\t\t\t\tn = gcd(b,a);\n\t\t\t\t\t}\n\n\t\t\t\t\tif(a>=c) {\n\t\t\t\t\t\tn = gcd(n,c);\n\t\t\t\t\t}else {\n\t\t\t\t\t\tn = gcd(c,n);\n\t\t\t\t\t}\n\n\t\t\t\t\tsum = sum+n;\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"long a = 1;",
"long a = 1;",
"a",
"1",
"a<=num",
"a",
"num",
"a++",
"a++",
"a",
"{\n\t\t\tfor(long b = 1; b<=num; b++) {\n\t\t\t\tfor(long c = 1; c<=num; c++) {\n\t\t\t\t\tif(a>=b) {\n\t\t\t\t\t\tn = gcd(a,b);\n\t\t\t\t\t}else {\n\t\t\t\t\t\tn = gcd(b,a);\n\t\t\t\t\t}\n\n\t\t\t\t\tif(a>=c) {\n\t\t\t\t\t\tn = gcd(n,c);\n\t\t\t\t\t}else {\n\t\t\t\t\t\tn = gcd(c,n);\n\t\t\t\t\t}\n\n\t\t\t\t\tsum = sum+n;\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"{\n\t\t\tfor(long b = 1; b<=num; b++) {\n\t\t\t\tfor(long c = 1; c<=num; c++) {\n\t\t\t\t\tif(a>=b) {\n\t\t\t\t\t\tn = gcd(a,b);\n\t\t\t\t\t}else {\n\t\t\t\t\t\tn = gcd(b,a);\n\t\t\t\t\t}\n\n\t\t\t\t\tif(a>=c) {\n\t\t\t\t\t\tn = gcd(n,c);\n\t\t\t\t\t}else {\n\t\t\t\t\t\tn = gcd(c,n);\n\t\t\t\t\t}\n\n\t\t\t\t\tsum = sum+n;\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"for(long b = 1; b<=num; b++) {\n\t\t\t\tfor(long c = 1; c<=num; c++) {\n\t\t\t\t\tif(a>=b) {\n\t\t\t\t\t\tn = gcd(a,b);\n\t\t\t\t\t}else {\n\t\t\t\t\t\tn = gcd(b,a);\n\t\t\t\t\t}\n\n\t\t\t\t\tif(a>=c) {\n\t\t\t\t\t\tn = gcd(n,c);\n\t\t\t\t\t}else {\n\t\t\t\t\t\tn = gcd(c,n);\n\t\t\t\t\t}\n\n\t\t\t\t\tsum = sum+n;\n\t\t\t\t}\n\t\t\t}",
"long b = 1;",
"long b = 1;",
"b",
"1",
"b<=num",
"b",
"num",
"b++",
"b++",
"b",
"{\n\t\t\t\tfor(long c = 1; c<=num; c++) {\n\t\t\t\t\tif(a>=b) {\n\t\t\t\t\t\tn = gcd(a,b);\n\t\t\t\t\t}else {\n\t\t\t\t\t\tn = gcd(b,a);\n\t\t\t\t\t}\n\n\t\t\t\t\tif(a>=c) {\n\t\t\t\t\t\tn = gcd(n,c);\n\t\t\t\t\t}else {\n\t\t\t\t\t\tn = gcd(c,n);\n\t\t\t\t\t}\n\n\t\t\t\t\tsum = sum+n;\n\t\t\t\t}\n\t\t\t}",
"{\n\t\t\t\tfor(long c = 1; c<=num; c++) {\n\t\t\t\t\tif(a>=b) {\n\t\t\t\t\t\tn = gcd(a,b);\n\t\t\t\t\t}else {\n\t\t\t\t\t\tn = gcd(b,a);\n\t\t\t\t\t}\n\n\t\t\t\t\tif(a>=c) {\n\t\t\t\t\t\tn = gcd(n,c);\n\t\t\t\t\t}else {\n\t\t\t\t\t\tn = gcd(c,n);\n\t\t\t\t\t}\n\n\t\t\t\t\tsum = sum+n;\n\t\t\t\t}\n\t\t\t}",
"for(long c = 1; c<=num; c++) {\n\t\t\t\t\tif(a>=b) {\n\t\t\t\t\t\tn = gcd(a,b);\n\t\t\t\t\t}else {\n\t\t\t\t\t\tn = gcd(b,a);\n\t\t\t\t\t}\n\n\t\t\t\t\tif(a>=c) {\n\t\t\t\t\t\tn = gcd(n,c);\n\t\t\t\t\t}else {\n\t\t\t\t\t\tn = gcd(c,n);\n\t\t\t\t\t}\n\n\t\t\t\t\tsum = sum+n;\n\t\t\t\t}",
"long c = 1;",
"long c = 1;",
"c",
"1",
"c<=num",
"c",
"num",
"c++",
"c++",
"c",
"{\n\t\t\t\t\tif(a>=b) {\n\t\t\t\t\t\tn = gcd(a,b);\n\t\t\t\t\t}else {\n\t\t\t\t\t\tn = gcd(b,a);\n\t\t\t\t\t}\n\n\t\t\t\t\tif(a>=c) {\n\t\t\t\t\t\tn = gcd(n,c);\n\t\t\t\t\t}else {\n\t\t\t\t\t\tn = gcd(c,n);\n\t\t\t\t\t}\n\n\t\t\t\t\tsum = sum+n;\n\t\t\t\t}",
"{\n\t\t\t\t\tif(a>=b) {\n\t\t\t\t\t\tn = gcd(a,b);\n\t\t\t\t\t}else {\n\t\t\t\t\t\tn = gcd(b,a);\n\t\t\t\t\t}\n\n\t\t\t\t\tif(a>=c) {\n\t\t\t\t\t\tn = gcd(n,c);\n\t\t\t\t\t}else {\n\t\t\t\t\t\tn = gcd(c,n);\n\t\t\t\t\t}\n\n\t\t\t\t\tsum = sum+n;\n\t\t\t\t}",
"if(a>=b) {\n\t\t\t\t\t\tn = gcd(a,b);\n\t\t\t\t\t}else {\n\t\t\t\t\t\tn = gcd(b,a);\n\t\t\t\t\t}",
"a>=b",
"a",
"b",
"{\n\t\t\t\t\t\tn = gcd(a,b);\n\t\t\t\t\t}",
"n = gcd(a,b)",
"n",
"gcd(a,b)",
"gcd",
"a",
"b",
"{\n\t\t\t\t\t\tn = gcd(b,a);\n\t\t\t\t\t}",
"n = gcd(b,a)",
"n",
"gcd(b,a)",
"gcd",
"b",
"a",
"if(a>=c) {\n\t\t\t\t\t\tn = gcd(n,c);\n\t\t\t\t\t}else {\n\t\t\t\t\t\tn = gcd(c,n);\n\t\t\t\t\t}",
"a>=c",
"a",
"c",
"{\n\t\t\t\t\t\tn = gcd(n,c);\n\t\t\t\t\t}",
"n = gcd(n,c)",
"n",
"gcd(n,c)",
"gcd",
"n",
"c",
"{\n\t\t\t\t\t\tn = gcd(c,n);\n\t\t\t\t\t}",
"n = gcd(c,n)",
"n",
"gcd(c,n)",
"gcd",
"c",
"n",
"sum = sum+n",
"sum",
"sum+n",
"sum",
"n",
"System.out.println(sum)",
"System.out.println",
"System.out",
"System",
"System.out",
"sum",
"String[] args",
"args",
"public static long gcd(long x, long y) {\n long tmp;\n while ((tmp = x % y) != 0) {\n x = y;\n y = tmp;\n }\n\n return y;\n}",
"gcd",
"{\n long tmp;\n while ((tmp = x % y) != 0) {\n x = y;\n y = tmp;\n }\n\n return y;\n}",
"long tmp;",
"tmp",
"while ((tmp = x % y) != 0) {\n x = y;\n y = tmp;\n }",
"(tmp = x % y) != 0",
"(tmp = x % y)",
"tmp",
"x % y",
"x",
"y",
"0",
"{\n x = y;\n y = tmp;\n }",
"x = y",
"x",
"y",
"y = tmp",
"y",
"tmp",
"return y;",
"y",
"long x",
"x",
"long y",
"y",
"public class Main {\n\tpublic static void main(String[] args) {\n\t\tScanner scan = new Scanner(System.in);\n\t\tlong sum = 0;\n\t\tlong n;\n\t\tlong num = scan.nextLong();\n\t\tfor(long a = 1; a<=num; a++) {\n\t\t\tfor(long b = 1; b<=num; b++) {\n\t\t\t\tfor(long c = 1; c<=num; c++) {\n\t\t\t\t\tif(a>=b) {\n\t\t\t\t\t\tn = gcd(a,b);\n\t\t\t\t\t}else {\n\t\t\t\t\t\tn = gcd(b,a);\n\t\t\t\t\t}\n\n\t\t\t\t\tif(a>=c) {\n\t\t\t\t\t\tn = gcd(n,c);\n\t\t\t\t\t}else {\n\t\t\t\t\t\tn = gcd(c,n);\n\t\t\t\t\t}\n\n\t\t\t\t\tsum = sum+n;\n\t\t\t\t}\n\t\t\t}\n\t\t}System.out.println(sum);\n\n\t}\n\n\tpublic static long gcd(long x, long y) {\n long tmp;\n while ((tmp = x % y) != 0) {\n x = y;\n y = tmp;\n }\n\n return y;\n}\n\n}",
"public class Main {\n\tpublic static void main(String[] args) {\n\t\tScanner scan = new Scanner(System.in);\n\t\tlong sum = 0;\n\t\tlong n;\n\t\tlong num = scan.nextLong();\n\t\tfor(long a = 1; a<=num; a++) {\n\t\t\tfor(long b = 1; b<=num; b++) {\n\t\t\t\tfor(long c = 1; c<=num; c++) {\n\t\t\t\t\tif(a>=b) {\n\t\t\t\t\t\tn = gcd(a,b);\n\t\t\t\t\t}else {\n\t\t\t\t\t\tn = gcd(b,a);\n\t\t\t\t\t}\n\n\t\t\t\t\tif(a>=c) {\n\t\t\t\t\t\tn = gcd(n,c);\n\t\t\t\t\t}else {\n\t\t\t\t\t\tn = gcd(c,n);\n\t\t\t\t\t}\n\n\t\t\t\t\tsum = sum+n;\n\t\t\t\t}\n\t\t\t}\n\t\t}System.out.println(sum);\n\n\t}\n\n\tpublic static long gcd(long x, long y) {\n long tmp;\n while ((tmp = x % y) != 0) {\n x = y;\n y = tmp;\n }\n\n return y;\n}\n\n}",
"Main"
] |
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
long sum = 0;
long n;
long num = scan.nextLong();
for(long a = 1; a<=num; a++) {
for(long b = 1; b<=num; b++) {
for(long c = 1; c<=num; c++) {
if(a>=b) {
n = gcd(a,b);
}else {
n = gcd(b,a);
}
if(a>=c) {
n = gcd(n,c);
}else {
n = gcd(c,n);
}
sum = sum+n;
}
}
}System.out.println(sum);
}
public static long gcd(long x, long y) {
long tmp;
while ((tmp = x % y) != 0) {
x = y;
y = tmp;
}
return y;
}
}
|
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
41,
13,
13,
41,
13,
13,
41,
13,
13,
41,
13,
42,
2,
2,
13,
13,
17,
30,
0,
13,
2,
13,
13,
0,
13,
13,
0,
13,
13,
42,
2,
2,
13,
13,
17,
30,
0,
13,
2,
13,
13,
0,
13,
13,
0,
13,
13,
0,
13,
13,
4,
18,
18,
13,
13,
13,
29,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
119,
5
],
[
119,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
8,
17
],
[
17,
18
],
[
17,
19
],
[
8,
20
],
[
20,
21
],
[
21,
22
],
[
22,
23
],
[
22,
24
],
[
20,
25
],
[
25,
26
],
[
25,
27
],
[
20,
28
],
[
28,
29
],
[
29,
30
],
[
20,
31
],
[
32,
32
],
[
32,
33
],
[
33,
34
],
[
34,
35
],
[
35,
36
],
[
35,
37
],
[
33,
38
],
[
38,
39
],
[
38,
40
],
[
33,
41
],
[
41,
42
],
[
42,
43
],
[
33,
44
],
[
45,
45
],
[
45,
46
],
[
46,
47
],
[
47,
48
],
[
48,
49
],
[
48,
50
],
[
46,
51
],
[
51,
52
],
[
51,
53
],
[
46,
54
],
[
54,
55
],
[
55,
56
],
[
46,
57
],
[
58,
58
],
[
58,
59
],
[
59,
60
],
[
59,
61
],
[
58,
62
],
[
62,
63
],
[
62,
64
],
[
58,
65
],
[
65,
66
],
[
65,
67
],
[
58,
68
],
[
68,
69
],
[
58,
70
],
[
70,
71
],
[
71,
72
],
[
72,
73
],
[
72,
74
],
[
71,
75
],
[
70,
76
],
[
76,
77
],
[
77,
78
],
[
77,
79
],
[
79,
80
],
[
79,
81
],
[
76,
82
],
[
82,
83
],
[
82,
84
],
[
76,
85
],
[
85,
86
],
[
85,
87
],
[
58,
88
],
[
88,
89
],
[
89,
90
],
[
90,
91
],
[
90,
92
],
[
89,
93
],
[
88,
94
],
[
94,
95
],
[
95,
96
],
[
95,
97
],
[
97,
98
],
[
97,
99
],
[
94,
100
],
[
100,
101
],
[
100,
102
],
[
94,
103
],
[
103,
104
],
[
103,
105
],
[
58,
106
],
[
106,
107
],
[
106,
108
],
[
8,
109
],
[
109,
110
],
[
110,
111
],
[
111,
112
],
[
111,
113
],
[
109,
114
],
[
8,
115
],
[
6,
116
],
[
116,
117
],
[
0,
118
],
[
118,
119
],
[
118,
120
]
] |
[
"import java.util.Scanner;\npublic class Main {\n\tpublic static void main(String[] args){\n\n\t\tScanner sc = new Scanner(System.in);\n\n\t\tint N = sc.nextInt();\n\n\t\tlong sum = 0;\n\n\n\n\t\tfor(int i = 1; i <= N; i++){\n\t\t\tfor (int k = 1; k <= N; k++){\n\t\t\t\tfor (int l = 1; l <= N; l++){\n\n\t\t\t\t\tint x = i;\n\t\t\t\t\tint y = k;\n\t\t\t\t\tint z = l;\n\t\t\t\t\tint tmp;\n\n\t\t\t\t\twhile (x % y != 0){\n\t\t\t\t\t\ttmp = (x % y);\n\t\t\t\t\t\tx = y;\n\t\t\t\t\t\ty = tmp;\n\t\t\t\t\t}\n\n\t\t\t\t\twhile (y % z != 0){\n\t\t\t\t\t\ttmp = (y % z);\n\t\t\t\t\t\ty = z;\n\t\t\t\t\t\tz = tmp;\n\t\t\t\t\t}\n\n\t\t\t\t\tsum += z;\n\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tSystem.out.print(sum);\n\n\treturn;\n\n\t}\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n\tpublic static void main(String[] args){\n\n\t\tScanner sc = new Scanner(System.in);\n\n\t\tint N = sc.nextInt();\n\n\t\tlong sum = 0;\n\n\n\n\t\tfor(int i = 1; i <= N; i++){\n\t\t\tfor (int k = 1; k <= N; k++){\n\t\t\t\tfor (int l = 1; l <= N; l++){\n\n\t\t\t\t\tint x = i;\n\t\t\t\t\tint y = k;\n\t\t\t\t\tint z = l;\n\t\t\t\t\tint tmp;\n\n\t\t\t\t\twhile (x % y != 0){\n\t\t\t\t\t\ttmp = (x % y);\n\t\t\t\t\t\tx = y;\n\t\t\t\t\t\ty = tmp;\n\t\t\t\t\t}\n\n\t\t\t\t\twhile (y % z != 0){\n\t\t\t\t\t\ttmp = (y % z);\n\t\t\t\t\t\ty = z;\n\t\t\t\t\t\tz = tmp;\n\t\t\t\t\t}\n\n\t\t\t\t\tsum += z;\n\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tSystem.out.print(sum);\n\n\treturn;\n\n\t}\n}",
"Main",
"public static void main(String[] args){\n\n\t\tScanner sc = new Scanner(System.in);\n\n\t\tint N = sc.nextInt();\n\n\t\tlong sum = 0;\n\n\n\n\t\tfor(int i = 1; i <= N; i++){\n\t\t\tfor (int k = 1; k <= N; k++){\n\t\t\t\tfor (int l = 1; l <= N; l++){\n\n\t\t\t\t\tint x = i;\n\t\t\t\t\tint y = k;\n\t\t\t\t\tint z = l;\n\t\t\t\t\tint tmp;\n\n\t\t\t\t\twhile (x % y != 0){\n\t\t\t\t\t\ttmp = (x % y);\n\t\t\t\t\t\tx = y;\n\t\t\t\t\t\ty = tmp;\n\t\t\t\t\t}\n\n\t\t\t\t\twhile (y % z != 0){\n\t\t\t\t\t\ttmp = (y % z);\n\t\t\t\t\t\ty = z;\n\t\t\t\t\t\tz = tmp;\n\t\t\t\t\t}\n\n\t\t\t\t\tsum += z;\n\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tSystem.out.print(sum);\n\n\treturn;\n\n\t}",
"main",
"{\n\n\t\tScanner sc = new Scanner(System.in);\n\n\t\tint N = sc.nextInt();\n\n\t\tlong sum = 0;\n\n\n\n\t\tfor(int i = 1; i <= N; i++){\n\t\t\tfor (int k = 1; k <= N; k++){\n\t\t\t\tfor (int l = 1; l <= N; l++){\n\n\t\t\t\t\tint x = i;\n\t\t\t\t\tint y = k;\n\t\t\t\t\tint z = l;\n\t\t\t\t\tint tmp;\n\n\t\t\t\t\twhile (x % y != 0){\n\t\t\t\t\t\ttmp = (x % y);\n\t\t\t\t\t\tx = y;\n\t\t\t\t\t\ty = tmp;\n\t\t\t\t\t}\n\n\t\t\t\t\twhile (y % z != 0){\n\t\t\t\t\t\ttmp = (y % z);\n\t\t\t\t\t\ty = z;\n\t\t\t\t\t\tz = tmp;\n\t\t\t\t\t}\n\n\t\t\t\t\tsum += z;\n\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tSystem.out.print(sum);\n\n\treturn;\n\n\t}",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"int N = sc.nextInt();",
"N",
"sc.nextInt()",
"sc.nextInt",
"sc",
"long sum = 0;",
"sum",
"0",
"for(int i = 1; i <= N; i++){\n\t\t\tfor (int k = 1; k <= N; k++){\n\t\t\t\tfor (int l = 1; l <= N; l++){\n\n\t\t\t\t\tint x = i;\n\t\t\t\t\tint y = k;\n\t\t\t\t\tint z = l;\n\t\t\t\t\tint tmp;\n\n\t\t\t\t\twhile (x % y != 0){\n\t\t\t\t\t\ttmp = (x % y);\n\t\t\t\t\t\tx = y;\n\t\t\t\t\t\ty = tmp;\n\t\t\t\t\t}\n\n\t\t\t\t\twhile (y % z != 0){\n\t\t\t\t\t\ttmp = (y % z);\n\t\t\t\t\t\ty = z;\n\t\t\t\t\t\tz = tmp;\n\t\t\t\t\t}\n\n\t\t\t\t\tsum += z;\n\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"int i = 1;",
"int i = 1;",
"i",
"1",
"i <= N",
"i",
"N",
"i++",
"i++",
"i",
"{\n\t\t\tfor (int k = 1; k <= N; k++){\n\t\t\t\tfor (int l = 1; l <= N; l++){\n\n\t\t\t\t\tint x = i;\n\t\t\t\t\tint y = k;\n\t\t\t\t\tint z = l;\n\t\t\t\t\tint tmp;\n\n\t\t\t\t\twhile (x % y != 0){\n\t\t\t\t\t\ttmp = (x % y);\n\t\t\t\t\t\tx = y;\n\t\t\t\t\t\ty = tmp;\n\t\t\t\t\t}\n\n\t\t\t\t\twhile (y % z != 0){\n\t\t\t\t\t\ttmp = (y % z);\n\t\t\t\t\t\ty = z;\n\t\t\t\t\t\tz = tmp;\n\t\t\t\t\t}\n\n\t\t\t\t\tsum += z;\n\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"{\n\t\t\tfor (int k = 1; k <= N; k++){\n\t\t\t\tfor (int l = 1; l <= N; l++){\n\n\t\t\t\t\tint x = i;\n\t\t\t\t\tint y = k;\n\t\t\t\t\tint z = l;\n\t\t\t\t\tint tmp;\n\n\t\t\t\t\twhile (x % y != 0){\n\t\t\t\t\t\ttmp = (x % y);\n\t\t\t\t\t\tx = y;\n\t\t\t\t\t\ty = tmp;\n\t\t\t\t\t}\n\n\t\t\t\t\twhile (y % z != 0){\n\t\t\t\t\t\ttmp = (y % z);\n\t\t\t\t\t\ty = z;\n\t\t\t\t\t\tz = tmp;\n\t\t\t\t\t}\n\n\t\t\t\t\tsum += z;\n\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"for (int k = 1; k <= N; k++){\n\t\t\t\tfor (int l = 1; l <= N; l++){\n\n\t\t\t\t\tint x = i;\n\t\t\t\t\tint y = k;\n\t\t\t\t\tint z = l;\n\t\t\t\t\tint tmp;\n\n\t\t\t\t\twhile (x % y != 0){\n\t\t\t\t\t\ttmp = (x % y);\n\t\t\t\t\t\tx = y;\n\t\t\t\t\t\ty = tmp;\n\t\t\t\t\t}\n\n\t\t\t\t\twhile (y % z != 0){\n\t\t\t\t\t\ttmp = (y % z);\n\t\t\t\t\t\ty = z;\n\t\t\t\t\t\tz = tmp;\n\t\t\t\t\t}\n\n\t\t\t\t\tsum += z;\n\n\t\t\t\t}\n\t\t\t}",
"int k = 1;",
"int k = 1;",
"k",
"1",
"k <= N",
"k",
"N",
"k++",
"k++",
"k",
"{\n\t\t\t\tfor (int l = 1; l <= N; l++){\n\n\t\t\t\t\tint x = i;\n\t\t\t\t\tint y = k;\n\t\t\t\t\tint z = l;\n\t\t\t\t\tint tmp;\n\n\t\t\t\t\twhile (x % y != 0){\n\t\t\t\t\t\ttmp = (x % y);\n\t\t\t\t\t\tx = y;\n\t\t\t\t\t\ty = tmp;\n\t\t\t\t\t}\n\n\t\t\t\t\twhile (y % z != 0){\n\t\t\t\t\t\ttmp = (y % z);\n\t\t\t\t\t\ty = z;\n\t\t\t\t\t\tz = tmp;\n\t\t\t\t\t}\n\n\t\t\t\t\tsum += z;\n\n\t\t\t\t}\n\t\t\t}",
"{\n\t\t\t\tfor (int l = 1; l <= N; l++){\n\n\t\t\t\t\tint x = i;\n\t\t\t\t\tint y = k;\n\t\t\t\t\tint z = l;\n\t\t\t\t\tint tmp;\n\n\t\t\t\t\twhile (x % y != 0){\n\t\t\t\t\t\ttmp = (x % y);\n\t\t\t\t\t\tx = y;\n\t\t\t\t\t\ty = tmp;\n\t\t\t\t\t}\n\n\t\t\t\t\twhile (y % z != 0){\n\t\t\t\t\t\ttmp = (y % z);\n\t\t\t\t\t\ty = z;\n\t\t\t\t\t\tz = tmp;\n\t\t\t\t\t}\n\n\t\t\t\t\tsum += z;\n\n\t\t\t\t}\n\t\t\t}",
"for (int l = 1; l <= N; l++){\n\n\t\t\t\t\tint x = i;\n\t\t\t\t\tint y = k;\n\t\t\t\t\tint z = l;\n\t\t\t\t\tint tmp;\n\n\t\t\t\t\twhile (x % y != 0){\n\t\t\t\t\t\ttmp = (x % y);\n\t\t\t\t\t\tx = y;\n\t\t\t\t\t\ty = tmp;\n\t\t\t\t\t}\n\n\t\t\t\t\twhile (y % z != 0){\n\t\t\t\t\t\ttmp = (y % z);\n\t\t\t\t\t\ty = z;\n\t\t\t\t\t\tz = tmp;\n\t\t\t\t\t}\n\n\t\t\t\t\tsum += z;\n\n\t\t\t\t}",
"int l = 1;",
"int l = 1;",
"l",
"1",
"l <= N",
"l",
"N",
"l++",
"l++",
"l",
"{\n\n\t\t\t\t\tint x = i;\n\t\t\t\t\tint y = k;\n\t\t\t\t\tint z = l;\n\t\t\t\t\tint tmp;\n\n\t\t\t\t\twhile (x % y != 0){\n\t\t\t\t\t\ttmp = (x % y);\n\t\t\t\t\t\tx = y;\n\t\t\t\t\t\ty = tmp;\n\t\t\t\t\t}\n\n\t\t\t\t\twhile (y % z != 0){\n\t\t\t\t\t\ttmp = (y % z);\n\t\t\t\t\t\ty = z;\n\t\t\t\t\t\tz = tmp;\n\t\t\t\t\t}\n\n\t\t\t\t\tsum += z;\n\n\t\t\t\t}",
"{\n\n\t\t\t\t\tint x = i;\n\t\t\t\t\tint y = k;\n\t\t\t\t\tint z = l;\n\t\t\t\t\tint tmp;\n\n\t\t\t\t\twhile (x % y != 0){\n\t\t\t\t\t\ttmp = (x % y);\n\t\t\t\t\t\tx = y;\n\t\t\t\t\t\ty = tmp;\n\t\t\t\t\t}\n\n\t\t\t\t\twhile (y % z != 0){\n\t\t\t\t\t\ttmp = (y % z);\n\t\t\t\t\t\ty = z;\n\t\t\t\t\t\tz = tmp;\n\t\t\t\t\t}\n\n\t\t\t\t\tsum += z;\n\n\t\t\t\t}",
"int x = i;",
"x",
"i",
"int y = k;",
"y",
"k",
"int z = l;",
"z",
"l",
"int tmp;",
"tmp",
"while (x % y != 0){\n\t\t\t\t\t\ttmp = (x % y);\n\t\t\t\t\t\tx = y;\n\t\t\t\t\t\ty = tmp;\n\t\t\t\t\t}",
"x % y != 0",
"x % y",
"x",
"y",
"0",
"{\n\t\t\t\t\t\ttmp = (x % y);\n\t\t\t\t\t\tx = y;\n\t\t\t\t\t\ty = tmp;\n\t\t\t\t\t}",
"tmp = (x % y)",
"tmp",
"(x % y)",
"x",
"y",
"x = y",
"x",
"y",
"y = tmp",
"y",
"tmp",
"while (y % z != 0){\n\t\t\t\t\t\ttmp = (y % z);\n\t\t\t\t\t\ty = z;\n\t\t\t\t\t\tz = tmp;\n\t\t\t\t\t}",
"y % z != 0",
"y % z",
"y",
"z",
"0",
"{\n\t\t\t\t\t\ttmp = (y % z);\n\t\t\t\t\t\ty = z;\n\t\t\t\t\t\tz = tmp;\n\t\t\t\t\t}",
"tmp = (y % z)",
"tmp",
"(y % z)",
"y",
"z",
"y = z",
"y",
"z",
"z = tmp",
"z",
"tmp",
"sum += z",
"sum",
"z",
"System.out.print(sum)",
"System.out.print",
"System.out",
"System",
"System.out",
"sum",
"return;",
"String[] args",
"args",
"public class Main {\n\tpublic static void main(String[] args){\n\n\t\tScanner sc = new Scanner(System.in);\n\n\t\tint N = sc.nextInt();\n\n\t\tlong sum = 0;\n\n\n\n\t\tfor(int i = 1; i <= N; i++){\n\t\t\tfor (int k = 1; k <= N; k++){\n\t\t\t\tfor (int l = 1; l <= N; l++){\n\n\t\t\t\t\tint x = i;\n\t\t\t\t\tint y = k;\n\t\t\t\t\tint z = l;\n\t\t\t\t\tint tmp;\n\n\t\t\t\t\twhile (x % y != 0){\n\t\t\t\t\t\ttmp = (x % y);\n\t\t\t\t\t\tx = y;\n\t\t\t\t\t\ty = tmp;\n\t\t\t\t\t}\n\n\t\t\t\t\twhile (y % z != 0){\n\t\t\t\t\t\ttmp = (y % z);\n\t\t\t\t\t\ty = z;\n\t\t\t\t\t\tz = tmp;\n\t\t\t\t\t}\n\n\t\t\t\t\tsum += z;\n\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tSystem.out.print(sum);\n\n\treturn;\n\n\t}\n}",
"public class Main {\n\tpublic static void main(String[] args){\n\n\t\tScanner sc = new Scanner(System.in);\n\n\t\tint N = sc.nextInt();\n\n\t\tlong sum = 0;\n\n\n\n\t\tfor(int i = 1; i <= N; i++){\n\t\t\tfor (int k = 1; k <= N; k++){\n\t\t\t\tfor (int l = 1; l <= N; l++){\n\n\t\t\t\t\tint x = i;\n\t\t\t\t\tint y = k;\n\t\t\t\t\tint z = l;\n\t\t\t\t\tint tmp;\n\n\t\t\t\t\twhile (x % y != 0){\n\t\t\t\t\t\ttmp = (x % y);\n\t\t\t\t\t\tx = y;\n\t\t\t\t\t\ty = tmp;\n\t\t\t\t\t}\n\n\t\t\t\t\twhile (y % z != 0){\n\t\t\t\t\t\ttmp = (y % z);\n\t\t\t\t\t\ty = z;\n\t\t\t\t\t\tz = tmp;\n\t\t\t\t\t}\n\n\t\t\t\t\tsum += z;\n\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tSystem.out.print(sum);\n\n\treturn;\n\n\t}\n}",
"Main"
] |
import java.util.Scanner;
public class Main {
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
int N = sc.nextInt();
long sum = 0;
for(int i = 1; i <= N; i++){
for (int k = 1; k <= N; k++){
for (int l = 1; l <= N; l++){
int x = i;
int y = k;
int z = l;
int tmp;
while (x % y != 0){
tmp = (x % y);
x = y;
y = tmp;
}
while (y % z != 0){
tmp = (y % z);
y = z;
z = tmp;
}
sum += z;
}
}
}
System.out.print(sum);
return;
}
}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.