node_ids
listlengths 4
1.4k
| edge_index
listlengths 1
2.22k
| text
listlengths 4
1.4k
| source
stringlengths 14
427k
|
---|---|---|---|
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
41,
13,
20,
2,
13,
17,
2,
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,
18,
18,
13,
13,
13,
4,
18,
13,
0,
18,
18,
13,
13,
13,
18,
18,
13,
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,
18,
18,
13,
13,
13,
4,
13,
13,
23,
13,
12,
13,
30,
11,
1,
41,
13,
17,
2,
13,
18,
13,
13,
1,
40,
13,
30,
30,
11,
1,
41,
13,
17,
2,
13,
2,
18,
18,
13,
17,
13,
17,
1,
40,
13,
30,
30,
4,
18,
18,
13,
13,
2,
18,
18,
13,
13,
13,
17,
4,
18,
18,
13,
13,
18,
18,
13,
13,
2,
18,
18,
13,
17,
13,
17,
4,
18,
18,
13,
13,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
192,
5
],
[
192,
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
],
[
19,
20
],
[
20,
21
],
[
8,
22
],
[
22,
23
],
[
22,
24
],
[
25,
26
],
[
25,
27
],
[
28,
29
],
[
28,
30
],
[
8,
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
],
[
58,
62
],
[
57,
63
],
[
63,
64
],
[
64,
65
],
[
56,
66
],
[
66,
67
],
[
67,
68
],
[
68,
69
],
[
68,
70
],
[
67,
71
],
[
66,
72
],
[
72,
73
],
[
73,
74
],
[
73,
75
],
[
72,
76
],
[
8,
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
],
[
104,
105
],
[
105,
106
],
[
105,
107
],
[
104,
108
],
[
103,
109
],
[
109,
110
],
[
110,
111
],
[
110,
112
],
[
109,
113
],
[
8,
114
],
[
114,
115
],
[
114,
116
],
[
6,
117
],
[
117,
118
],
[
192,
119
],
[
119,
120
],
[
119,
121
],
[
121,
122
],
[
122,
123
],
[
123,
124
],
[
124,
125
],
[
124,
126
],
[
122,
127
],
[
127,
128
],
[
127,
129
],
[
129,
130
],
[
129,
131
],
[
122,
132
],
[
132,
133
],
[
133,
134
],
[
122,
135
],
[
136,
136
],
[
136,
137
],
[
137,
138
],
[
138,
139
],
[
139,
140
],
[
139,
141
],
[
137,
142
],
[
142,
143
],
[
142,
144
],
[
144,
145
],
[
145,
146
],
[
146,
147
],
[
146,
148
],
[
145,
149
],
[
144,
150
],
[
137,
151
],
[
151,
152
],
[
152,
153
],
[
137,
154
],
[
155,
155
],
[
155,
156
],
[
156,
157
],
[
157,
158
],
[
158,
159
],
[
158,
160
],
[
156,
161
],
[
161,
162
],
[
162,
163
],
[
163,
164
],
[
163,
165
],
[
162,
166
],
[
161,
167
],
[
136,
168
],
[
168,
169
],
[
169,
170
],
[
170,
171
],
[
170,
172
],
[
168,
173
],
[
173,
174
],
[
174,
175
],
[
174,
176
],
[
173,
177
],
[
177,
178
],
[
178,
179
],
[
179,
180
],
[
179,
181
],
[
178,
182
],
[
177,
183
],
[
136,
184
],
[
184,
185
],
[
185,
186
],
[
186,
187
],
[
186,
188
],
[
119,
189
],
[
189,
190
],
[
0,
191
],
[
191,
192
],
[
191,
193
]
] | [
"\nimport 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 m=sc.nextInt();\n\t\tint n=sc.nextInt();\n\t\tint[][] a=new int[m+1][n+1];\n\t\tfor(int i=0; i<m; i++){\n\t\t\tfor(int j=0; j<n; j++){\n\t\t\t\ta[i][j]=sc.nextInt();\n\t\t\t\ta[i][n]+=a[i][j];\n\n\t\t\t}\n\t\t}\n\t\tfor(int j=0; j<=n; j++){\n\t\t\tfor(int i=0; i<m; i++){\n\t\t\t\ta[m][j]+=a[i][j];\n\t\t\t}\n\t\t}\n\t\tprintintMat(a);\n\n\n\n\t}\n\tpublic static void printintMat(int A[][]){\n\t\t//行列のプリントアウト\n\t\tfor(int i=0; i<A.length; i++){\n\t\t\tfor(int j=0; j<A[0].length-1; j++){\n\t\t\t\tSystem.out.print(A[i][j]+\" \");\n\t\t\t}\n\t\t\tSystem.out.print(A[i][A[0].length-1]);\n\t\t\tSystem.out.println();\n\t}\n\n\t\t}\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\tint m=sc.nextInt();\n\t\tint n=sc.nextInt();\n\t\tint[][] a=new int[m+1][n+1];\n\t\tfor(int i=0; i<m; i++){\n\t\t\tfor(int j=0; j<n; j++){\n\t\t\t\ta[i][j]=sc.nextInt();\n\t\t\t\ta[i][n]+=a[i][j];\n\n\t\t\t}\n\t\t}\n\t\tfor(int j=0; j<=n; j++){\n\t\t\tfor(int i=0; i<m; i++){\n\t\t\t\ta[m][j]+=a[i][j];\n\t\t\t}\n\t\t}\n\t\tprintintMat(a);\n\n\n\n\t}\n\tpublic static void printintMat(int A[][]){\n\t\t//行列のプリントアウト\n\t\tfor(int i=0; i<A.length; i++){\n\t\t\tfor(int j=0; j<A[0].length-1; j++){\n\t\t\t\tSystem.out.print(A[i][j]+\" \");\n\t\t\t}\n\t\t\tSystem.out.print(A[i][A[0].length-1]);\n\t\t\tSystem.out.println();\n\t}\n\n\t\t}\n\n\n}",
"Main",
"public static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\tint m=sc.nextInt();\n\t\tint n=sc.nextInt();\n\t\tint[][] a=new int[m+1][n+1];\n\t\tfor(int i=0; i<m; i++){\n\t\t\tfor(int j=0; j<n; j++){\n\t\t\t\ta[i][j]=sc.nextInt();\n\t\t\t\ta[i][n]+=a[i][j];\n\n\t\t\t}\n\t\t}\n\t\tfor(int j=0; j<=n; j++){\n\t\t\tfor(int i=0; i<m; i++){\n\t\t\t\ta[m][j]+=a[i][j];\n\t\t\t}\n\t\t}\n\t\tprintintMat(a);\n\n\n\n\t}",
"main",
"{\n\t\tScanner sc = new Scanner(System.in);\n\t\tint m=sc.nextInt();\n\t\tint n=sc.nextInt();\n\t\tint[][] a=new int[m+1][n+1];\n\t\tfor(int i=0; i<m; i++){\n\t\t\tfor(int j=0; j<n; j++){\n\t\t\t\ta[i][j]=sc.nextInt();\n\t\t\t\ta[i][n]+=a[i][j];\n\n\t\t\t}\n\t\t}\n\t\tfor(int j=0; j<=n; j++){\n\t\t\tfor(int i=0; i<m; i++){\n\t\t\t\ta[m][j]+=a[i][j];\n\t\t\t}\n\t\t}\n\t\tprintintMat(a);\n\n\n\n\t}",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"int m=sc.nextInt();",
"m",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int n=sc.nextInt();",
"n",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int[][] a=new int[m+1][n+1];",
"a",
"new int[m+1][n+1]",
"m+1",
"m",
"1",
"n+1",
"n",
"1",
"for(int i=0; i<m; i++){\n\t\t\tfor(int j=0; j<n; j++){\n\t\t\t\ta[i][j]=sc.nextInt();\n\t\t\t\ta[i][n]+=a[i][j];\n\n\t\t\t}\n\t\t}",
"int i=0;",
"int i=0;",
"i",
"0",
"i<m",
"i",
"m",
"i++",
"i++",
"i",
"{\n\t\t\tfor(int j=0; j<n; j++){\n\t\t\t\ta[i][j]=sc.nextInt();\n\t\t\t\ta[i][n]+=a[i][j];\n\n\t\t\t}\n\t\t}",
"{\n\t\t\tfor(int j=0; j<n; j++){\n\t\t\t\ta[i][j]=sc.nextInt();\n\t\t\t\ta[i][n]+=a[i][j];\n\n\t\t\t}\n\t\t}",
"for(int j=0; j<n; j++){\n\t\t\t\ta[i][j]=sc.nextInt();\n\t\t\t\ta[i][n]+=a[i][j];\n\n\t\t\t}",
"int j=0;",
"int j=0;",
"j",
"0",
"j<n",
"j",
"n",
"j++",
"j++",
"j",
"{\n\t\t\t\ta[i][j]=sc.nextInt();\n\t\t\t\ta[i][n]+=a[i][j];\n\n\t\t\t}",
"{\n\t\t\t\ta[i][j]=sc.nextInt();\n\t\t\t\ta[i][n]+=a[i][j];\n\n\t\t\t}",
"a[i][j]=sc.nextInt()",
"a[i][j]",
"a[i]",
"a",
"i",
"j",
"sc.nextInt()",
"sc.nextInt",
"sc",
"a[i][n]+=a[i][j]",
"a[i][n]",
"a[i]",
"a",
"i",
"n",
"a[i][j]",
"a[i]",
"a",
"i",
"j",
"for(int j=0; j<=n; j++){\n\t\t\tfor(int i=0; i<m; i++){\n\t\t\t\ta[m][j]+=a[i][j];\n\t\t\t}\n\t\t}",
"int j=0;",
"int j=0;",
"j",
"0",
"j<=n",
"j",
"n",
"j++",
"j++",
"j",
"{\n\t\t\tfor(int i=0; i<m; i++){\n\t\t\t\ta[m][j]+=a[i][j];\n\t\t\t}\n\t\t}",
"{\n\t\t\tfor(int i=0; i<m; i++){\n\t\t\t\ta[m][j]+=a[i][j];\n\t\t\t}\n\t\t}",
"for(int i=0; i<m; i++){\n\t\t\t\ta[m][j]+=a[i][j];\n\t\t\t}",
"int i=0;",
"int i=0;",
"i",
"0",
"i<m",
"i",
"m",
"i++",
"i++",
"i",
"{\n\t\t\t\ta[m][j]+=a[i][j];\n\t\t\t}",
"{\n\t\t\t\ta[m][j]+=a[i][j];\n\t\t\t}",
"a[m][j]+=a[i][j]",
"a[m][j]",
"a[m]",
"a",
"m",
"j",
"a[i][j]",
"a[i]",
"a",
"i",
"j",
"printintMat(a)",
"printintMat",
"a",
"String[] args",
"args",
"public static void printintMat(int A[][]){\n\t\t//行列のプリントアウト\n\t\tfor(int i=0; i<A.length; i++){\n\t\t\tfor(int j=0; j<A[0].length-1; j++){\n\t\t\t\tSystem.out.print(A[i][j]+\" \");\n\t\t\t}\n\t\t\tSystem.out.print(A[i][A[0].length-1]);\n\t\t\tSystem.out.println();\n\t}\n\n\t\t}",
"printintMat",
"{\n\t\t//行列のプリントアウト\n\t\tfor(int i=0; i<A.length; i++){\n\t\t\tfor(int j=0; j<A[0].length-1; j++){\n\t\t\t\tSystem.out.print(A[i][j]+\" \");\n\t\t\t}\n\t\t\tSystem.out.print(A[i][A[0].length-1]);\n\t\t\tSystem.out.println();\n\t}\n\n\t\t}",
"for(int i=0; i<A.length; i++){\n\t\t\tfor(int j=0; j<A[0].length-1; j++){\n\t\t\t\tSystem.out.print(A[i][j]+\" \");\n\t\t\t}\n\t\t\tSystem.out.print(A[i][A[0].length-1]);\n\t\t\tSystem.out.println();\n\t}",
"int i=0;",
"int i=0;",
"i",
"0",
"i<A.length",
"i",
"A.length",
"A",
"A.length",
"i++",
"i++",
"i",
"{\n\t\t\tfor(int j=0; j<A[0].length-1; j++){\n\t\t\t\tSystem.out.print(A[i][j]+\" \");\n\t\t\t}\n\t\t\tSystem.out.print(A[i][A[0].length-1]);\n\t\t\tSystem.out.println();\n\t}",
"{\n\t\t\tfor(int j=0; j<A[0].length-1; j++){\n\t\t\t\tSystem.out.print(A[i][j]+\" \");\n\t\t\t}\n\t\t\tSystem.out.print(A[i][A[0].length-1]);\n\t\t\tSystem.out.println();\n\t}",
"for(int j=0; j<A[0].length-1; j++){\n\t\t\t\tSystem.out.print(A[i][j]+\" \");\n\t\t\t}",
"int j=0;",
"int j=0;",
"j",
"0",
"j<A[0].length-1",
"j",
"A[0].length-1",
"A[0].length",
"A[0]",
"A",
"0",
"A[0].length",
"1",
"j++",
"j++",
"j",
"{\n\t\t\t\tSystem.out.print(A[i][j]+\" \");\n\t\t\t}",
"{\n\t\t\t\tSystem.out.print(A[i][j]+\" \");\n\t\t\t}",
"System.out.print(A[i][j]+\" \")",
"System.out.print",
"System.out",
"System",
"System.out",
"A[i][j]+\" \"",
"A[i][j]",
"A[i]",
"A",
"i",
"j",
"\" \"",
"System.out.print(A[i][A[0].length-1])",
"System.out.print",
"System.out",
"System",
"System.out",
"A[i][A[0].length-1]",
"A[i]",
"A",
"i",
"A[0].length-1",
"A[0].length",
"A[0]",
"A",
"0",
"A[0].length",
"1",
"System.out.println()",
"System.out.println",
"System.out",
"System",
"System.out",
"int A[][]",
"A",
"public class Main {\n\tpublic static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\tint m=sc.nextInt();\n\t\tint n=sc.nextInt();\n\t\tint[][] a=new int[m+1][n+1];\n\t\tfor(int i=0; i<m; i++){\n\t\t\tfor(int j=0; j<n; j++){\n\t\t\t\ta[i][j]=sc.nextInt();\n\t\t\t\ta[i][n]+=a[i][j];\n\n\t\t\t}\n\t\t}\n\t\tfor(int j=0; j<=n; j++){\n\t\t\tfor(int i=0; i<m; i++){\n\t\t\t\ta[m][j]+=a[i][j];\n\t\t\t}\n\t\t}\n\t\tprintintMat(a);\n\n\n\n\t}\n\tpublic static void printintMat(int A[][]){\n\t\t//行列のプリントアウト\n\t\tfor(int i=0; i<A.length; i++){\n\t\t\tfor(int j=0; j<A[0].length-1; j++){\n\t\t\t\tSystem.out.print(A[i][j]+\" \");\n\t\t\t}\n\t\t\tSystem.out.print(A[i][A[0].length-1]);\n\t\t\tSystem.out.println();\n\t}\n\n\t\t}\n\n\n}",
"public class Main {\n\tpublic static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\tint m=sc.nextInt();\n\t\tint n=sc.nextInt();\n\t\tint[][] a=new int[m+1][n+1];\n\t\tfor(int i=0; i<m; i++){\n\t\t\tfor(int j=0; j<n; j++){\n\t\t\t\ta[i][j]=sc.nextInt();\n\t\t\t\ta[i][n]+=a[i][j];\n\n\t\t\t}\n\t\t}\n\t\tfor(int j=0; j<=n; j++){\n\t\t\tfor(int i=0; i<m; i++){\n\t\t\t\ta[m][j]+=a[i][j];\n\t\t\t}\n\t\t}\n\t\tprintintMat(a);\n\n\n\n\t}\n\tpublic static void printintMat(int A[][]){\n\t\t//行列のプリントアウト\n\t\tfor(int i=0; i<A.length; i++){\n\t\t\tfor(int j=0; j<A[0].length-1; j++){\n\t\t\t\tSystem.out.print(A[i][j]+\" \");\n\t\t\t}\n\t\t\tSystem.out.print(A[i][A[0].length-1]);\n\t\t\tSystem.out.println();\n\t}\n\n\t\t}\n\n\n}",
"Main"
] |
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int m=sc.nextInt();
int n=sc.nextInt();
int[][] a=new int[m+1][n+1];
for(int i=0; i<m; i++){
for(int j=0; j<n; j++){
a[i][j]=sc.nextInt();
a[i][n]+=a[i][j];
}
}
for(int j=0; j<=n; j++){
for(int i=0; i<m; i++){
a[m][j]+=a[i][j];
}
}
printintMat(a);
}
public static void printintMat(int A[][]){
//行列のプリントアウト
for(int i=0; i<A.length; i++){
for(int j=0; j<A[0].length-1; j++){
System.out.print(A[i][j]+" ");
}
System.out.print(A[i][A[0].length-1]);
System.out.println();
}
}
}
|
[
7,
15,
13,
17,
6,
13,
41,
13,
20,
12,
13,
30,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
41,
13,
20,
2,
13,
17,
2,
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,
18,
18,
13,
13,
13,
4,
18,
13,
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,
18,
18,
13,
13,
13,
0,
18,
18,
13,
13,
13,
13,
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,
18,
18,
13,
13,
13,
0,
18,
18,
13,
13,
13,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
4,
13,
4,
13,
18,
13,
13,
17,
12,
13,
30,
4,
18,
20,
23,
13,
12,
13,
30,
4,
18,
18,
13,
13,
13,
23,
13,
12,
13,
30,
4,
18,
18,
13,
13,
13,
23,
13,
12,
13,
30,
4,
18,
18,
13,
13,
12,
13,
30,
41,
13,
20,
11,
1,
41,
13,
17,
2,
13,
18,
13,
13,
1,
40,
13,
30,
30,
4,
18,
4,
18,
13,
13,
2,
18,
13,
13,
17,
29,
4,
18,
13,
23,
13,
23,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
6,
7
],
[
6,
8
],
[
4,
9
],
[
9,
10
],
[
9,
11
],
[
11,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
11,
17
],
[
17,
18
],
[
17,
19
],
[
19,
20
],
[
20,
21
],
[
11,
22
],
[
22,
23
],
[
22,
24
],
[
25,
26
],
[
25,
27
],
[
28,
29
],
[
28,
30
],
[
11,
31
],
[
31,
32
],
[
32,
33
],
[
33,
34
],
[
33,
35
],
[
31,
36
],
[
36,
37
],
[
36,
38
],
[
31,
39
],
[
39,
40
],
[
40,
41
],
[
31,
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
],
[
57,
61
],
[
56,
62
],
[
62,
63
],
[
63,
64
],
[
11,
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
],
[
77,
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
],
[
94,
96
],
[
96,
97
],
[
97,
98
],
[
97,
99
],
[
96,
100
],
[
77,
101
],
[
101,
102
],
[
102,
103
],
[
103,
104
],
[
103,
105
],
[
102,
106
],
[
101,
107
],
[
11,
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
],
[
121,
123
],
[
120,
124
],
[
124,
125
],
[
125,
126
],
[
126,
127
],
[
126,
128
],
[
124,
129
],
[
129,
130
],
[
129,
131
],
[
124,
132
],
[
132,
133
],
[
133,
134
],
[
124,
135
],
[
136,
136
],
[
136,
137
],
[
137,
138
],
[
137,
139
],
[
139,
140
],
[
140,
141
],
[
140,
142
],
[
139,
143
],
[
120,
144
],
[
144,
145
],
[
145,
146
],
[
146,
147
],
[
146,
148
],
[
145,
149
],
[
144,
150
],
[
11,
151
],
[
151,
152
],
[
152,
153
],
[
153,
154
],
[
153,
155
],
[
151,
156
],
[
156,
157
],
[
156,
158
],
[
151,
159
],
[
159,
160
],
[
160,
161
],
[
151,
162
],
[
162,
163
],
[
163,
164
],
[
163,
165
],
[
165,
166
],
[
165,
167
],
[
167,
168
],
[
167,
169
],
[
165,
170
],
[
4,
171
],
[
171,
172
],
[
171,
173
],
[
173,
174
],
[
174,
175
],
[
175,
176
],
[
171,
177
],
[
177,
178
],
[
4,
179
],
[
179,
180
],
[
179,
181
],
[
181,
182
],
[
182,
183
],
[
183,
184
],
[
184,
185
],
[
184,
186
],
[
182,
187
],
[
179,
188
],
[
188,
189
],
[
4,
190
],
[
190,
191
],
[
190,
192
],
[
192,
193
],
[
193,
194
],
[
194,
195
],
[
195,
196
],
[
195,
197
],
[
193,
198
],
[
190,
199
],
[
199,
200
],
[
4,
201
],
[
201,
202
],
[
201,
203
],
[
203,
204
],
[
204,
205
],
[
205,
206
],
[
206,
207
],
[
206,
208
],
[
4,
209
],
[
209,
210
],
[
209,
211
],
[
211,
212
],
[
212,
213
],
[
212,
214
],
[
211,
215
],
[
215,
216
],
[
216,
217
],
[
217,
218
],
[
217,
219
],
[
215,
220
],
[
220,
221
],
[
220,
222
],
[
222,
223
],
[
222,
224
],
[
215,
225
],
[
225,
226
],
[
226,
227
],
[
215,
228
],
[
229,
229
],
[
229,
230
],
[
230,
231
],
[
231,
232
],
[
232,
233
],
[
233,
234
],
[
232,
235
],
[
230,
236
],
[
236,
237
],
[
237,
238
],
[
237,
239
],
[
236,
240
],
[
211,
241
],
[
241,
242
],
[
242,
243
],
[
243,
244
],
[
209,
245
],
[
245,
246
],
[
209,
247
],
[
247,
248
]
] | [
"import java.util.Scanner;\n \nclass Main {\n Scanner sc = new Scanner(System.in);\n \n public void run() {\n int r = sc.nextInt(), c = sc.nextInt();\n \n int[][] A = new int[r + 1][c + 1];\n \n for (int i = 0; i < r; i++)\n for (int j = 0; j < c; j++) {\n A[i][j] = sc.nextInt();\n }\n \n for (int i = 0; i < r; i++) {\n int sum = 0;\n for (int j = 0; j < c; j++) {\n sum += A[i][j];\n }\n A[i][c] = sum;\n }\n for (int j = 0; j <= c; j++) {\n int sum = 0;\n for (int i = 0; i < r; i++) {\n sum += A[i][j];\n }\n A[r][j] = sum;\n }\n \n for (int i = 0; i <= r; i++)\n ln(join(A[i], \" \"));\n }\n \n public static void main(String[] args) {\n new Main().run();\n }\n \n public static void pr(Object o) {\n System.out.print(o);\n }\n \n public static void ln(Object o) {\n System.out.println(o);\n }\n \n public static void ln() {\n System.out.println();\n }\n \n public static String join(int[] array, String separator) {\n StringBuilder str = new StringBuilder(array[0] + \"\");\n for (int i = 1; i < array.length; i++) {\n str.append(separator).append(array[i] + \"\");\n }\n return str.toString();\n }\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"class Main {\n Scanner sc = new Scanner(System.in);\n \n public void run() {\n int r = sc.nextInt(), c = sc.nextInt();\n \n int[][] A = new int[r + 1][c + 1];\n \n for (int i = 0; i < r; i++)\n for (int j = 0; j < c; j++) {\n A[i][j] = sc.nextInt();\n }\n \n for (int i = 0; i < r; i++) {\n int sum = 0;\n for (int j = 0; j < c; j++) {\n sum += A[i][j];\n }\n A[i][c] = sum;\n }\n for (int j = 0; j <= c; j++) {\n int sum = 0;\n for (int i = 0; i < r; i++) {\n sum += A[i][j];\n }\n A[r][j] = sum;\n }\n \n for (int i = 0; i <= r; i++)\n ln(join(A[i], \" \"));\n }\n \n public static void main(String[] args) {\n new Main().run();\n }\n \n public static void pr(Object o) {\n System.out.print(o);\n }\n \n public static void ln(Object o) {\n System.out.println(o);\n }\n \n public static void ln() {\n System.out.println();\n }\n \n public static String join(int[] array, String separator) {\n StringBuilder str = new StringBuilder(array[0] + \"\");\n for (int i = 1; i < array.length; i++) {\n str.append(separator).append(array[i] + \"\");\n }\n return str.toString();\n }\n}",
"Main",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"public void run() {\n int r = sc.nextInt(), c = sc.nextInt();\n \n int[][] A = new int[r + 1][c + 1];\n \n for (int i = 0; i < r; i++)\n for (int j = 0; j < c; j++) {\n A[i][j] = sc.nextInt();\n }\n \n for (int i = 0; i < r; i++) {\n int sum = 0;\n for (int j = 0; j < c; j++) {\n sum += A[i][j];\n }\n A[i][c] = sum;\n }\n for (int j = 0; j <= c; j++) {\n int sum = 0;\n for (int i = 0; i < r; i++) {\n sum += A[i][j];\n }\n A[r][j] = sum;\n }\n \n for (int i = 0; i <= r; i++)\n ln(join(A[i], \" \"));\n }",
"run",
"{\n int r = sc.nextInt(), c = sc.nextInt();\n \n int[][] A = new int[r + 1][c + 1];\n \n for (int i = 0; i < r; i++)\n for (int j = 0; j < c; j++) {\n A[i][j] = sc.nextInt();\n }\n \n for (int i = 0; i < r; i++) {\n int sum = 0;\n for (int j = 0; j < c; j++) {\n sum += A[i][j];\n }\n A[i][c] = sum;\n }\n for (int j = 0; j <= c; j++) {\n int sum = 0;\n for (int i = 0; i < r; i++) {\n sum += A[i][j];\n }\n A[r][j] = sum;\n }\n \n for (int i = 0; i <= r; i++)\n ln(join(A[i], \" \"));\n }",
"int r = sc.nextInt()",
"r",
"sc.nextInt()",
"sc.nextInt",
"sc",
"c = sc.nextInt();",
"c",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int[][] A = new int[r + 1][c + 1];",
"A",
"new int[r + 1][c + 1]",
"r + 1",
"r",
"1",
"c + 1",
"c",
"1",
"for (int i = 0; i < r; i++)\n for (int j = 0; j < c; j++) {\n A[i][j] = sc.nextInt();\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < r",
"i",
"r",
"i++",
"i++",
"i",
"for (int j = 0; j < c; j++) {\n A[i][j] = sc.nextInt();\n }",
"for (int j = 0; j < c; j++) {\n A[i][j] = sc.nextInt();\n }",
"int j = 0;",
"int j = 0;",
"j",
"0",
"j < c",
"j",
"c",
"j++",
"j++",
"j",
"{\n A[i][j] = sc.nextInt();\n }",
"{\n A[i][j] = sc.nextInt();\n }",
"A[i][j] = sc.nextInt()",
"A[i][j]",
"A[i]",
"A",
"i",
"j",
"sc.nextInt()",
"sc.nextInt",
"sc",
"for (int i = 0; i < r; i++) {\n int sum = 0;\n for (int j = 0; j < c; j++) {\n sum += A[i][j];\n }\n A[i][c] = sum;\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < r",
"i",
"r",
"i++",
"i++",
"i",
"{\n int sum = 0;\n for (int j = 0; j < c; j++) {\n sum += A[i][j];\n }\n A[i][c] = sum;\n }",
"{\n int sum = 0;\n for (int j = 0; j < c; j++) {\n sum += A[i][j];\n }\n A[i][c] = sum;\n }",
"int sum = 0;",
"sum",
"0",
"for (int j = 0; j < c; j++) {\n sum += A[i][j];\n }",
"int j = 0;",
"int j = 0;",
"j",
"0",
"j < c",
"j",
"c",
"j++",
"j++",
"j",
"{\n sum += A[i][j];\n }",
"{\n sum += A[i][j];\n }",
"sum += A[i][j]",
"sum",
"A[i][j]",
"A[i]",
"A",
"i",
"j",
"A[i][c] = sum",
"A[i][c]",
"A[i]",
"A",
"i",
"c",
"sum",
"for (int j = 0; j <= c; j++) {\n int sum = 0;\n for (int i = 0; i < r; i++) {\n sum += A[i][j];\n }\n A[r][j] = sum;\n }",
"int j = 0;",
"int j = 0;",
"j",
"0",
"j <= c",
"j",
"c",
"j++",
"j++",
"j",
"{\n int sum = 0;\n for (int i = 0; i < r; i++) {\n sum += A[i][j];\n }\n A[r][j] = sum;\n }",
"{\n int sum = 0;\n for (int i = 0; i < r; i++) {\n sum += A[i][j];\n }\n A[r][j] = sum;\n }",
"int sum = 0;",
"sum",
"0",
"for (int i = 0; i < r; i++) {\n sum += A[i][j];\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < r",
"i",
"r",
"i++",
"i++",
"i",
"{\n sum += A[i][j];\n }",
"{\n sum += A[i][j];\n }",
"sum += A[i][j]",
"sum",
"A[i][j]",
"A[i]",
"A",
"i",
"j",
"A[r][j] = sum",
"A[r][j]",
"A[r]",
"A",
"r",
"j",
"sum",
"for (int i = 0; i <= r; i++)\n ln(join(A[i], \" \"));",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i <= r",
"i",
"r",
"i++",
"i++",
"i",
"ln(join(A[i], \" \"));",
"ln(join(A[i], \" \"))",
"ln",
"join(A[i], \" \")",
"join",
"A[i]",
"A",
"i",
"\" \"",
"public static void main(String[] args) {\n new Main().run();\n }",
"main",
"{\n new Main().run();\n }",
"new Main().run()",
"new Main().run",
"new Main()",
"String[] args",
"args",
"public static void pr(Object o) {\n System.out.print(o);\n }",
"pr",
"{\n System.out.print(o);\n }",
"System.out.print(o)",
"System.out.print",
"System.out",
"System",
"System.out",
"o",
"Object o",
"o",
"public static void ln(Object o) {\n System.out.println(o);\n }",
"ln",
"{\n System.out.println(o);\n }",
"System.out.println(o)",
"System.out.println",
"System.out",
"System",
"System.out",
"o",
"Object o",
"o",
"public static void ln() {\n System.out.println();\n }",
"ln",
"{\n System.out.println();\n }",
"System.out.println()",
"System.out.println",
"System.out",
"System",
"System.out",
"public static String join(int[] array, String separator) {\n StringBuilder str = new StringBuilder(array[0] + \"\");\n for (int i = 1; i < array.length; i++) {\n str.append(separator).append(array[i] + \"\");\n }\n return str.toString();\n }",
"join",
"{\n StringBuilder str = new StringBuilder(array[0] + \"\");\n for (int i = 1; i < array.length; i++) {\n str.append(separator).append(array[i] + \"\");\n }\n return str.toString();\n }",
"StringBuilder str = new StringBuilder(array[0] + \"\");",
"str",
"new StringBuilder(array[0] + \"\")",
"for (int i = 1; i < array.length; i++) {\n str.append(separator).append(array[i] + \"\");\n }",
"int i = 1;",
"int i = 1;",
"i",
"1",
"i < array.length",
"i",
"array.length",
"array",
"array.length",
"i++",
"i++",
"i",
"{\n str.append(separator).append(array[i] + \"\");\n }",
"{\n str.append(separator).append(array[i] + \"\");\n }",
"str.append(separator).append(array[i] + \"\")",
"str.append(separator).append",
"str.append(separator)",
"str.append",
"str",
"separator",
"array[i] + \"\"",
"array[i]",
"array",
"i",
"\"\"",
"return str.toString();",
"str.toString()",
"str.toString",
"str",
"int[] array",
"array",
"String separator",
"separator"
] | import java.util.Scanner;
class Main {
Scanner sc = new Scanner(System.in);
public void run() {
int r = sc.nextInt(), c = sc.nextInt();
int[][] A = new int[r + 1][c + 1];
for (int i = 0; i < r; i++)
for (int j = 0; j < c; j++) {
A[i][j] = sc.nextInt();
}
for (int i = 0; i < r; i++) {
int sum = 0;
for (int j = 0; j < c; j++) {
sum += A[i][j];
}
A[i][c] = sum;
}
for (int j = 0; j <= c; j++) {
int sum = 0;
for (int i = 0; i < r; i++) {
sum += A[i][j];
}
A[r][j] = sum;
}
for (int i = 0; i <= r; i++)
ln(join(A[i], " "));
}
public static void main(String[] args) {
new Main().run();
}
public static void pr(Object o) {
System.out.print(o);
}
public static void ln(Object o) {
System.out.println(o);
}
public static void ln() {
System.out.println();
}
public static String join(int[] array, String separator) {
StringBuilder str = new StringBuilder(array[0] + "");
for (int i = 1; i < array.length; i++) {
str.append(separator).append(array[i] + "");
}
return str.toString();
}
}
|
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
4,
18,
13,
41,
13,
4,
18,
13,
4,
18,
13,
41,
13,
20,
2,
13,
17,
2,
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,
18,
18,
13,
13,
13,
4,
18,
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,
0,
18,
18,
13,
13,
13,
2,
18,
18,
13,
13,
13,
18,
18,
13,
13,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
11,
1,
41,
13,
17,
2,
13,
2,
13,
17,
1,
40,
13,
30,
30,
0,
18,
18,
13,
13,
13,
2,
18,
18,
13,
13,
13,
18,
18,
13,
13,
13,
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,
14,
2,
13,
13,
4,
18,
18,
13,
13,
18,
18,
13,
13,
13,
4,
18,
18,
13,
13,
2,
18,
18,
13,
13,
13,
17,
23,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
14,
17
],
[
17,
18
],
[
18,
19
],
[
8,
20
],
[
20,
21
],
[
20,
22
],
[
22,
23
],
[
23,
24
],
[
22,
25
],
[
25,
26
],
[
26,
27
],
[
8,
28
],
[
28,
29
],
[
28,
30
],
[
31,
32
],
[
31,
33
],
[
34,
35
],
[
34,
36
],
[
8,
37
],
[
37,
38
],
[
38,
39
],
[
39,
40
],
[
39,
41
],
[
37,
42
],
[
42,
43
],
[
42,
44
],
[
37,
45
],
[
45,
46
],
[
46,
47
],
[
37,
48
],
[
49,
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
],
[
62,
62
],
[
62,
63
],
[
63,
64
],
[
64,
65
],
[
65,
66
],
[
65,
67
],
[
64,
68
],
[
63,
69
],
[
69,
70
],
[
70,
71
],
[
69,
72
],
[
72,
73
],
[
73,
74
],
[
8,
75
],
[
75,
76
],
[
76,
77
],
[
77,
78
],
[
77,
79
],
[
75,
80
],
[
80,
81
],
[
80,
82
],
[
75,
83
],
[
83,
84
],
[
84,
85
],
[
75,
86
],
[
87,
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
],
[
100,
100
],
[
100,
101
],
[
101,
102
],
[
102,
103
],
[
103,
104
],
[
103,
105
],
[
102,
106
],
[
101,
107
],
[
107,
108
],
[
108,
109
],
[
109,
110
],
[
109,
111
],
[
108,
112
],
[
107,
113
],
[
113,
114
],
[
114,
115
],
[
114,
116
],
[
113,
117
],
[
8,
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
],
[
132,
133
],
[
133,
134
],
[
133,
135
],
[
131,
136
],
[
136,
137
],
[
136,
138
],
[
138,
139
],
[
138,
140
],
[
131,
141
],
[
141,
142
],
[
142,
143
],
[
131,
144
],
[
145,
145
],
[
145,
146
],
[
146,
147
],
[
147,
148
],
[
148,
149
],
[
148,
150
],
[
147,
151
],
[
146,
152
],
[
152,
153
],
[
153,
154
],
[
154,
155
],
[
154,
156
],
[
153,
157
],
[
152,
158
],
[
158,
159
],
[
159,
160
],
[
159,
161
],
[
158,
162
],
[
8,
163
],
[
163,
164
],
[
164,
165
],
[
165,
166
],
[
165,
167
],
[
163,
168
],
[
168,
169
],
[
168,
170
],
[
170,
171
],
[
170,
172
],
[
163,
173
],
[
173,
174
],
[
174,
175
],
[
163,
176
],
[
177,
177
],
[
177,
178
],
[
178,
179
],
[
179,
180
],
[
180,
181
],
[
180,
182
],
[
178,
183
],
[
183,
184
],
[
183,
185
],
[
185,
186
],
[
185,
187
],
[
178,
188
],
[
188,
189
],
[
189,
190
],
[
178,
191
],
[
192,
192
],
[
192,
193
],
[
193,
194
],
[
194,
195
],
[
194,
196
],
[
193,
197
],
[
197,
198
],
[
198,
199
],
[
199,
200
],
[
199,
201
],
[
197,
202
],
[
202,
203
],
[
203,
204
],
[
203,
205
],
[
202,
206
],
[
193,
207
],
[
207,
208
],
[
208,
209
],
[
209,
210
],
[
209,
211
],
[
207,
212
],
[
212,
213
],
[
213,
214
],
[
214,
215
],
[
214,
216
],
[
213,
217
],
[
212,
218
],
[
6,
219
],
[
219,
220
]
] | [
"import java.util.*;\n\nclass Main {\n\tpublic static void main(String[] arg){\n\t\tScanner in = new Scanner(System.in);\n\t\tint r = Integer.parseInt(in.next());\n\t\tint c = Integer.parseInt(in.next());\n\t\tint[][] table = new int[r+1][c+1];\n\n\t\tfor(int i=0;i<r;i++){\n\t\t\tfor(int j=0;j<c;j++){\n\t\t\t\ttable[i][j] = Integer.parseInt(in.next());\n\t\t\t}\n\t\t}\n\t\t\n\t\tfor(int i=0;i<r;i++){\n\t\t\tfor(int j=0;j<c;j++){\n\t\t\t\ttable[i][c] = table[i][c] + table[i][j];\n\t\t\t}\n\t\t}\n\n\t\tfor(int i=0;i<r;i++){\n\t\t\tfor(int j=0;j<c+1;j++){\n\t\t\t\ttable[r][j] = table[r][j] + table[i][j];\n\t\t\t}\n\t\t}\n\t\t\n\t\t\n\t\tfor(int i=0;i<r+1;i++){\n\t\t\tfor(int j=0;j<c+1;j++){\n\t\t\t\tif(c==j) System.out.println(table[i][j]);\n\t\t\t\telse System.out.print(table[i][j]+\" \");\n\t\t\t}\n\t\t}\n\n\n\t}\t\n}",
"import java.util.*;",
"util.*",
"java",
"class Main {\n\tpublic static void main(String[] arg){\n\t\tScanner in = new Scanner(System.in);\n\t\tint r = Integer.parseInt(in.next());\n\t\tint c = Integer.parseInt(in.next());\n\t\tint[][] table = new int[r+1][c+1];\n\n\t\tfor(int i=0;i<r;i++){\n\t\t\tfor(int j=0;j<c;j++){\n\t\t\t\ttable[i][j] = Integer.parseInt(in.next());\n\t\t\t}\n\t\t}\n\t\t\n\t\tfor(int i=0;i<r;i++){\n\t\t\tfor(int j=0;j<c;j++){\n\t\t\t\ttable[i][c] = table[i][c] + table[i][j];\n\t\t\t}\n\t\t}\n\n\t\tfor(int i=0;i<r;i++){\n\t\t\tfor(int j=0;j<c+1;j++){\n\t\t\t\ttable[r][j] = table[r][j] + table[i][j];\n\t\t\t}\n\t\t}\n\t\t\n\t\t\n\t\tfor(int i=0;i<r+1;i++){\n\t\t\tfor(int j=0;j<c+1;j++){\n\t\t\t\tif(c==j) System.out.println(table[i][j]);\n\t\t\t\telse System.out.print(table[i][j]+\" \");\n\t\t\t}\n\t\t}\n\n\n\t}\t\n}",
"Main",
"public static void main(String[] arg){\n\t\tScanner in = new Scanner(System.in);\n\t\tint r = Integer.parseInt(in.next());\n\t\tint c = Integer.parseInt(in.next());\n\t\tint[][] table = new int[r+1][c+1];\n\n\t\tfor(int i=0;i<r;i++){\n\t\t\tfor(int j=0;j<c;j++){\n\t\t\t\ttable[i][j] = Integer.parseInt(in.next());\n\t\t\t}\n\t\t}\n\t\t\n\t\tfor(int i=0;i<r;i++){\n\t\t\tfor(int j=0;j<c;j++){\n\t\t\t\ttable[i][c] = table[i][c] + table[i][j];\n\t\t\t}\n\t\t}\n\n\t\tfor(int i=0;i<r;i++){\n\t\t\tfor(int j=0;j<c+1;j++){\n\t\t\t\ttable[r][j] = table[r][j] + table[i][j];\n\t\t\t}\n\t\t}\n\t\t\n\t\t\n\t\tfor(int i=0;i<r+1;i++){\n\t\t\tfor(int j=0;j<c+1;j++){\n\t\t\t\tif(c==j) System.out.println(table[i][j]);\n\t\t\t\telse System.out.print(table[i][j]+\" \");\n\t\t\t}\n\t\t}\n\n\n\t}",
"main",
"{\n\t\tScanner in = new Scanner(System.in);\n\t\tint r = Integer.parseInt(in.next());\n\t\tint c = Integer.parseInt(in.next());\n\t\tint[][] table = new int[r+1][c+1];\n\n\t\tfor(int i=0;i<r;i++){\n\t\t\tfor(int j=0;j<c;j++){\n\t\t\t\ttable[i][j] = Integer.parseInt(in.next());\n\t\t\t}\n\t\t}\n\t\t\n\t\tfor(int i=0;i<r;i++){\n\t\t\tfor(int j=0;j<c;j++){\n\t\t\t\ttable[i][c] = table[i][c] + table[i][j];\n\t\t\t}\n\t\t}\n\n\t\tfor(int i=0;i<r;i++){\n\t\t\tfor(int j=0;j<c+1;j++){\n\t\t\t\ttable[r][j] = table[r][j] + table[i][j];\n\t\t\t}\n\t\t}\n\t\t\n\t\t\n\t\tfor(int i=0;i<r+1;i++){\n\t\t\tfor(int j=0;j<c+1;j++){\n\t\t\t\tif(c==j) System.out.println(table[i][j]);\n\t\t\t\telse System.out.print(table[i][j]+\" \");\n\t\t\t}\n\t\t}\n\n\n\t}",
"Scanner in = new Scanner(System.in);",
"in",
"new Scanner(System.in)",
"int r = Integer.parseInt(in.next());",
"r",
"Integer.parseInt(in.next())",
"Integer.parseInt",
"Integer",
"in.next()",
"in.next",
"in",
"int c = Integer.parseInt(in.next());",
"c",
"Integer.parseInt(in.next())",
"Integer.parseInt",
"Integer",
"in.next()",
"in.next",
"in",
"int[][] table = new int[r+1][c+1];",
"table",
"new int[r+1][c+1]",
"r+1",
"r",
"1",
"c+1",
"c",
"1",
"for(int i=0;i<r;i++){\n\t\t\tfor(int j=0;j<c;j++){\n\t\t\t\ttable[i][j] = Integer.parseInt(in.next());\n\t\t\t}\n\t\t}",
"int i=0;",
"int i=0;",
"i",
"0",
"i<r",
"i",
"r",
"i++",
"i++",
"i",
"{\n\t\t\tfor(int j=0;j<c;j++){\n\t\t\t\ttable[i][j] = Integer.parseInt(in.next());\n\t\t\t}\n\t\t}",
"{\n\t\t\tfor(int j=0;j<c;j++){\n\t\t\t\ttable[i][j] = Integer.parseInt(in.next());\n\t\t\t}\n\t\t}",
"for(int j=0;j<c;j++){\n\t\t\t\ttable[i][j] = Integer.parseInt(in.next());\n\t\t\t}",
"int j=0;",
"int j=0;",
"j",
"0",
"j<c",
"j",
"c",
"j++",
"j++",
"j",
"{\n\t\t\t\ttable[i][j] = Integer.parseInt(in.next());\n\t\t\t}",
"{\n\t\t\t\ttable[i][j] = Integer.parseInt(in.next());\n\t\t\t}",
"table[i][j] = Integer.parseInt(in.next())",
"table[i][j]",
"table[i]",
"table",
"i",
"j",
"Integer.parseInt(in.next())",
"Integer.parseInt",
"Integer",
"in.next()",
"in.next",
"in",
"for(int i=0;i<r;i++){\n\t\t\tfor(int j=0;j<c;j++){\n\t\t\t\ttable[i][c] = table[i][c] + table[i][j];\n\t\t\t}\n\t\t}",
"int i=0;",
"int i=0;",
"i",
"0",
"i<r",
"i",
"r",
"i++",
"i++",
"i",
"{\n\t\t\tfor(int j=0;j<c;j++){\n\t\t\t\ttable[i][c] = table[i][c] + table[i][j];\n\t\t\t}\n\t\t}",
"{\n\t\t\tfor(int j=0;j<c;j++){\n\t\t\t\ttable[i][c] = table[i][c] + table[i][j];\n\t\t\t}\n\t\t}",
"for(int j=0;j<c;j++){\n\t\t\t\ttable[i][c] = table[i][c] + table[i][j];\n\t\t\t}",
"int j=0;",
"int j=0;",
"j",
"0",
"j<c",
"j",
"c",
"j++",
"j++",
"j",
"{\n\t\t\t\ttable[i][c] = table[i][c] + table[i][j];\n\t\t\t}",
"{\n\t\t\t\ttable[i][c] = table[i][c] + table[i][j];\n\t\t\t}",
"table[i][c] = table[i][c] + table[i][j]",
"table[i][c]",
"table[i]",
"table",
"i",
"c",
"table[i][c] + table[i][j]",
"table[i][c]",
"table[i]",
"table",
"i",
"c",
"table[i][j]",
"table[i]",
"table",
"i",
"j",
"for(int i=0;i<r;i++){\n\t\t\tfor(int j=0;j<c+1;j++){\n\t\t\t\ttable[r][j] = table[r][j] + table[i][j];\n\t\t\t}\n\t\t}",
"int i=0;",
"int i=0;",
"i",
"0",
"i<r",
"i",
"r",
"i++",
"i++",
"i",
"{\n\t\t\tfor(int j=0;j<c+1;j++){\n\t\t\t\ttable[r][j] = table[r][j] + table[i][j];\n\t\t\t}\n\t\t}",
"{\n\t\t\tfor(int j=0;j<c+1;j++){\n\t\t\t\ttable[r][j] = table[r][j] + table[i][j];\n\t\t\t}\n\t\t}",
"for(int j=0;j<c+1;j++){\n\t\t\t\ttable[r][j] = table[r][j] + table[i][j];\n\t\t\t}",
"int j=0;",
"int j=0;",
"j",
"0",
"j<c+1",
"j",
"c+1",
"c",
"1",
"j++",
"j++",
"j",
"{\n\t\t\t\ttable[r][j] = table[r][j] + table[i][j];\n\t\t\t}",
"{\n\t\t\t\ttable[r][j] = table[r][j] + table[i][j];\n\t\t\t}",
"table[r][j] = table[r][j] + table[i][j]",
"table[r][j]",
"table[r]",
"table",
"r",
"j",
"table[r][j] + table[i][j]",
"table[r][j]",
"table[r]",
"table",
"r",
"j",
"table[i][j]",
"table[i]",
"table",
"i",
"j",
"for(int i=0;i<r+1;i++){\n\t\t\tfor(int j=0;j<c+1;j++){\n\t\t\t\tif(c==j) System.out.println(table[i][j]);\n\t\t\t\telse System.out.print(table[i][j]+\" \");\n\t\t\t}\n\t\t}",
"int i=0;",
"int i=0;",
"i",
"0",
"i<r+1",
"i",
"r+1",
"r",
"1",
"i++",
"i++",
"i",
"{\n\t\t\tfor(int j=0;j<c+1;j++){\n\t\t\t\tif(c==j) System.out.println(table[i][j]);\n\t\t\t\telse System.out.print(table[i][j]+\" \");\n\t\t\t}\n\t\t}",
"{\n\t\t\tfor(int j=0;j<c+1;j++){\n\t\t\t\tif(c==j) System.out.println(table[i][j]);\n\t\t\t\telse System.out.print(table[i][j]+\" \");\n\t\t\t}\n\t\t}",
"for(int j=0;j<c+1;j++){\n\t\t\t\tif(c==j) System.out.println(table[i][j]);\n\t\t\t\telse System.out.print(table[i][j]+\" \");\n\t\t\t}",
"int j=0;",
"int j=0;",
"j",
"0",
"j<c+1",
"j",
"c+1",
"c",
"1",
"j++",
"j++",
"j",
"{\n\t\t\t\tif(c==j) System.out.println(table[i][j]);\n\t\t\t\telse System.out.print(table[i][j]+\" \");\n\t\t\t}",
"{\n\t\t\t\tif(c==j) System.out.println(table[i][j]);\n\t\t\t\telse System.out.print(table[i][j]+\" \");\n\t\t\t}",
"if(c==j) System.out.println(table[i][j]);\n\t\t\t\telse System.out.print(table[i][j]+\" \");",
"c==j",
"c",
"j",
"System.out.println(table[i][j])",
"System.out.println",
"System.out",
"System",
"System.out",
"table[i][j]",
"table[i]",
"table",
"i",
"j",
"System.out.print(table[i][j]+\" \")",
"System.out.print",
"System.out",
"System",
"System.out",
"table[i][j]+\" \"",
"table[i][j]",
"table[i]",
"table",
"i",
"j",
"\" \"",
"String[] arg",
"arg"
] | import java.util.*;
class Main {
public static void main(String[] arg){
Scanner in = new Scanner(System.in);
int r = Integer.parseInt(in.next());
int c = Integer.parseInt(in.next());
int[][] table = new int[r+1][c+1];
for(int i=0;i<r;i++){
for(int j=0;j<c;j++){
table[i][j] = Integer.parseInt(in.next());
}
}
for(int i=0;i<r;i++){
for(int j=0;j<c;j++){
table[i][c] = table[i][c] + table[i][j];
}
}
for(int i=0;i<r;i++){
for(int j=0;j<c+1;j++){
table[r][j] = table[r][j] + table[i][j];
}
}
for(int i=0;i<r+1;i++){
for(int j=0;j<c+1;j++){
if(c==j) System.out.println(table[i][j]);
else System.out.print(table[i][j]+" ");
}
}
}
} |
[
7,
15,
13,
17,
6,
13,
41,
13,
17,
41,
13,
17,
12,
13,
30,
41,
13,
20,
41,
13,
41,
13,
0,
13,
4,
18,
13,
0,
13,
4,
18,
13,
41,
13,
20,
2,
13,
17,
2,
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,
18,
18,
13,
13,
13,
4,
18,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
18,
18,
13,
13,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
18,
18,
13,
13,
13,
18,
18,
13,
13,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
18,
18,
13,
13,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
18,
18,
13,
13,
13,
18,
18,
13,
13,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
4,
18,
18,
13,
13,
17,
18,
18,
13,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
4,
18,
18,
13,
13,
17,
18,
18,
13,
13,
13,
4,
18,
18,
13,
13,
17,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
221,
5
],
[
221,
6
],
[
6,
7
],
[
6,
8
],
[
221,
9
],
[
9,
10
],
[
9,
11
],
[
221,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
15,
17
],
[
14,
18
],
[
18,
19
],
[
14,
20
],
[
20,
21
],
[
14,
22
],
[
22,
23
],
[
22,
24
],
[
24,
25
],
[
25,
26
],
[
14,
27
],
[
27,
28
],
[
27,
29
],
[
29,
30
],
[
30,
31
],
[
14,
32
],
[
32,
33
],
[
32,
34
],
[
35,
36
],
[
35,
37
],
[
38,
39
],
[
38,
40
],
[
14,
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
],
[
68,
72
],
[
67,
73
],
[
73,
74
],
[
74,
75
],
[
14,
76
],
[
76,
77
],
[
77,
78
],
[
78,
79
],
[
78,
80
],
[
76,
81
],
[
81,
82
],
[
81,
83
],
[
76,
84
],
[
84,
85
],
[
85,
86
],
[
76,
87
],
[
88,
88
],
[
88,
89
],
[
89,
90
],
[
90,
91
],
[
91,
92
],
[
91,
93
],
[
90,
94
],
[
89,
95
],
[
88,
96
],
[
96,
97
],
[
97,
98
],
[
98,
99
],
[
98,
100
],
[
96,
101
],
[
101,
102
],
[
101,
103
],
[
96,
104
],
[
104,
105
],
[
105,
106
],
[
96,
107
],
[
108,
108
],
[
108,
109
],
[
109,
110
],
[
110,
111
],
[
111,
112
],
[
111,
113
],
[
110,
114
],
[
109,
115
],
[
115,
116
],
[
116,
117
],
[
116,
118
],
[
115,
119
],
[
14,
120
],
[
120,
121
],
[
121,
122
],
[
122,
123
],
[
122,
124
],
[
120,
125
],
[
125,
126
],
[
125,
127
],
[
120,
128
],
[
128,
129
],
[
129,
130
],
[
120,
131
],
[
132,
132
],
[
132,
133
],
[
133,
134
],
[
134,
135
],
[
135,
136
],
[
135,
137
],
[
134,
138
],
[
133,
139
],
[
132,
140
],
[
140,
141
],
[
141,
142
],
[
142,
143
],
[
142,
144
],
[
140,
145
],
[
145,
146
],
[
145,
147
],
[
140,
148
],
[
148,
149
],
[
149,
150
],
[
140,
151
],
[
152,
152
],
[
152,
153
],
[
153,
154
],
[
154,
155
],
[
155,
156
],
[
155,
157
],
[
154,
158
],
[
153,
159
],
[
159,
160
],
[
160,
161
],
[
160,
162
],
[
159,
163
],
[
14,
164
],
[
164,
165
],
[
165,
166
],
[
166,
167
],
[
166,
168
],
[
164,
169
],
[
169,
170
],
[
169,
171
],
[
164,
172
],
[
172,
173
],
[
173,
174
],
[
164,
175
],
[
176,
176
],
[
176,
177
],
[
177,
178
],
[
178,
179
],
[
179,
180
],
[
179,
181
],
[
177,
182
],
[
177,
183
],
[
183,
184
],
[
184,
185
],
[
184,
186
],
[
183,
187
],
[
176,
188
],
[
188,
189
],
[
189,
190
],
[
190,
191
],
[
190,
192
],
[
188,
193
],
[
193,
194
],
[
193,
195
],
[
188,
196
],
[
196,
197
],
[
197,
198
],
[
188,
199
],
[
200,
200
],
[
200,
201
],
[
201,
202
],
[
202,
203
],
[
203,
204
],
[
203,
205
],
[
201,
206
],
[
201,
207
],
[
207,
208
],
[
208,
209
],
[
208,
210
],
[
207,
211
],
[
176,
212
],
[
212,
213
],
[
213,
214
],
[
214,
215
],
[
214,
216
],
[
212,
217
],
[
12,
218
],
[
218,
219
],
[
0,
220
],
[
220,
221
],
[
220,
222
]
] | [
"import java.util.Scanner;\n\npublic class Main {\n\n\tpublic static final int BIG_NUM = 2000000000;\n\tpublic static final int MOD = 1000000007;\n\n\tpublic static void main(String[] args) {\n\n\t\tScanner sc = new Scanner(System.in);\n\t\tint H,W;\n\n\t\tH = sc.nextInt();\n\t\tW = sc.nextInt();\n\n\t\tint table[][] = new int[H+1][W+1];\n\n\t\tfor(int row = 0; row < H; row++){\n\t\t\tfor(int col = 0; col < W; col++){\n\t\t\t\ttable[row][col] = sc.nextInt();\n\t\t\t}\n\t\t}\n\n\t\tfor(int row = 0; row < H; row++){\n\t\t\ttable[row][W] = 0;\n\t\t\tfor(int col = 0; col < W; col++){\n\t\t\t\ttable[row][W] += table[row][col];\n\t\t\t}\n\t\t}\n\n\t\tfor(int col = 0; col <= W; col++){\n\t\t\ttable[H][col] = 0;\n\t\t\tfor(int row = 0; row < H; row++){\n\t\t\t\ttable[H][col] += table[row][col];\n\t\t\t}\n\t\t}\n\n\t\tfor(int row = 0; row <= H; row++){\n\t\t\tSystem.out.printf(\"%d\", table[row][0]);\n\t\t\tfor(int col = 1; col <= W; col++){\n\t\t\t\tSystem.out.printf(\" %d\", table[row][col]);\n\t\t\t}\n\t\t\tSystem.out.printf(\"\\n\");\n\t\t}\n\t}\n}\n\n",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n\n\tpublic static final int BIG_NUM = 2000000000;\n\tpublic static final int MOD = 1000000007;\n\n\tpublic static void main(String[] args) {\n\n\t\tScanner sc = new Scanner(System.in);\n\t\tint H,W;\n\n\t\tH = sc.nextInt();\n\t\tW = sc.nextInt();\n\n\t\tint table[][] = new int[H+1][W+1];\n\n\t\tfor(int row = 0; row < H; row++){\n\t\t\tfor(int col = 0; col < W; col++){\n\t\t\t\ttable[row][col] = sc.nextInt();\n\t\t\t}\n\t\t}\n\n\t\tfor(int row = 0; row < H; row++){\n\t\t\ttable[row][W] = 0;\n\t\t\tfor(int col = 0; col < W; col++){\n\t\t\t\ttable[row][W] += table[row][col];\n\t\t\t}\n\t\t}\n\n\t\tfor(int col = 0; col <= W; col++){\n\t\t\ttable[H][col] = 0;\n\t\t\tfor(int row = 0; row < H; row++){\n\t\t\t\ttable[H][col] += table[row][col];\n\t\t\t}\n\t\t}\n\n\t\tfor(int row = 0; row <= H; row++){\n\t\t\tSystem.out.printf(\"%d\", table[row][0]);\n\t\t\tfor(int col = 1; col <= W; col++){\n\t\t\t\tSystem.out.printf(\" %d\", table[row][col]);\n\t\t\t}\n\t\t\tSystem.out.printf(\"\\n\");\n\t\t}\n\t}\n}",
"Main",
"public static final int BIG_NUM = 2000000000;",
"BIG_NUM",
"2000000000",
"public static final int MOD = 1000000007;",
"MOD",
"1000000007",
"public static void main(String[] args) {\n\n\t\tScanner sc = new Scanner(System.in);\n\t\tint H,W;\n\n\t\tH = sc.nextInt();\n\t\tW = sc.nextInt();\n\n\t\tint table[][] = new int[H+1][W+1];\n\n\t\tfor(int row = 0; row < H; row++){\n\t\t\tfor(int col = 0; col < W; col++){\n\t\t\t\ttable[row][col] = sc.nextInt();\n\t\t\t}\n\t\t}\n\n\t\tfor(int row = 0; row < H; row++){\n\t\t\ttable[row][W] = 0;\n\t\t\tfor(int col = 0; col < W; col++){\n\t\t\t\ttable[row][W] += table[row][col];\n\t\t\t}\n\t\t}\n\n\t\tfor(int col = 0; col <= W; col++){\n\t\t\ttable[H][col] = 0;\n\t\t\tfor(int row = 0; row < H; row++){\n\t\t\t\ttable[H][col] += table[row][col];\n\t\t\t}\n\t\t}\n\n\t\tfor(int row = 0; row <= H; row++){\n\t\t\tSystem.out.printf(\"%d\", table[row][0]);\n\t\t\tfor(int col = 1; col <= W; col++){\n\t\t\t\tSystem.out.printf(\" %d\", table[row][col]);\n\t\t\t}\n\t\t\tSystem.out.printf(\"\\n\");\n\t\t}\n\t}",
"main",
"{\n\n\t\tScanner sc = new Scanner(System.in);\n\t\tint H,W;\n\n\t\tH = sc.nextInt();\n\t\tW = sc.nextInt();\n\n\t\tint table[][] = new int[H+1][W+1];\n\n\t\tfor(int row = 0; row < H; row++){\n\t\t\tfor(int col = 0; col < W; col++){\n\t\t\t\ttable[row][col] = sc.nextInt();\n\t\t\t}\n\t\t}\n\n\t\tfor(int row = 0; row < H; row++){\n\t\t\ttable[row][W] = 0;\n\t\t\tfor(int col = 0; col < W; col++){\n\t\t\t\ttable[row][W] += table[row][col];\n\t\t\t}\n\t\t}\n\n\t\tfor(int col = 0; col <= W; col++){\n\t\t\ttable[H][col] = 0;\n\t\t\tfor(int row = 0; row < H; row++){\n\t\t\t\ttable[H][col] += table[row][col];\n\t\t\t}\n\t\t}\n\n\t\tfor(int row = 0; row <= H; row++){\n\t\t\tSystem.out.printf(\"%d\", table[row][0]);\n\t\t\tfor(int col = 1; col <= W; col++){\n\t\t\t\tSystem.out.printf(\" %d\", table[row][col]);\n\t\t\t}\n\t\t\tSystem.out.printf(\"\\n\");\n\t\t}\n\t}",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"int H",
"H",
"W;",
"W",
"H = sc.nextInt()",
"H",
"sc.nextInt()",
"sc.nextInt",
"sc",
"W = sc.nextInt()",
"W",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int table[][] = new int[H+1][W+1];",
"table",
"new int[H+1][W+1]",
"H+1",
"H",
"1",
"W+1",
"W",
"1",
"for(int row = 0; row < H; row++){\n\t\t\tfor(int col = 0; col < W; col++){\n\t\t\t\ttable[row][col] = sc.nextInt();\n\t\t\t}\n\t\t}",
"int row = 0;",
"int row = 0;",
"row",
"0",
"row < H",
"row",
"H",
"row++",
"row++",
"row",
"{\n\t\t\tfor(int col = 0; col < W; col++){\n\t\t\t\ttable[row][col] = sc.nextInt();\n\t\t\t}\n\t\t}",
"{\n\t\t\tfor(int col = 0; col < W; col++){\n\t\t\t\ttable[row][col] = sc.nextInt();\n\t\t\t}\n\t\t}",
"for(int col = 0; col < W; col++){\n\t\t\t\ttable[row][col] = sc.nextInt();\n\t\t\t}",
"int col = 0;",
"int col = 0;",
"col",
"0",
"col < W",
"col",
"W",
"col++",
"col++",
"col",
"{\n\t\t\t\ttable[row][col] = sc.nextInt();\n\t\t\t}",
"{\n\t\t\t\ttable[row][col] = sc.nextInt();\n\t\t\t}",
"table[row][col] = sc.nextInt()",
"table[row][col]",
"table[row]",
"table",
"row",
"col",
"sc.nextInt()",
"sc.nextInt",
"sc",
"for(int row = 0; row < H; row++){\n\t\t\ttable[row][W] = 0;\n\t\t\tfor(int col = 0; col < W; col++){\n\t\t\t\ttable[row][W] += table[row][col];\n\t\t\t}\n\t\t}",
"int row = 0;",
"int row = 0;",
"row",
"0",
"row < H",
"row",
"H",
"row++",
"row++",
"row",
"{\n\t\t\ttable[row][W] = 0;\n\t\t\tfor(int col = 0; col < W; col++){\n\t\t\t\ttable[row][W] += table[row][col];\n\t\t\t}\n\t\t}",
"{\n\t\t\ttable[row][W] = 0;\n\t\t\tfor(int col = 0; col < W; col++){\n\t\t\t\ttable[row][W] += table[row][col];\n\t\t\t}\n\t\t}",
"table[row][W] = 0",
"table[row][W]",
"table[row]",
"table",
"row",
"W",
"0",
"for(int col = 0; col < W; col++){\n\t\t\t\ttable[row][W] += table[row][col];\n\t\t\t}",
"int col = 0;",
"int col = 0;",
"col",
"0",
"col < W",
"col",
"W",
"col++",
"col++",
"col",
"{\n\t\t\t\ttable[row][W] += table[row][col];\n\t\t\t}",
"{\n\t\t\t\ttable[row][W] += table[row][col];\n\t\t\t}",
"table[row][W] += table[row][col]",
"table[row][W]",
"table[row]",
"table",
"row",
"W",
"table[row][col]",
"table[row]",
"table",
"row",
"col",
"for(int col = 0; col <= W; col++){\n\t\t\ttable[H][col] = 0;\n\t\t\tfor(int row = 0; row < H; row++){\n\t\t\t\ttable[H][col] += table[row][col];\n\t\t\t}\n\t\t}",
"int col = 0;",
"int col = 0;",
"col",
"0",
"col <= W",
"col",
"W",
"col++",
"col++",
"col",
"{\n\t\t\ttable[H][col] = 0;\n\t\t\tfor(int row = 0; row < H; row++){\n\t\t\t\ttable[H][col] += table[row][col];\n\t\t\t}\n\t\t}",
"{\n\t\t\ttable[H][col] = 0;\n\t\t\tfor(int row = 0; row < H; row++){\n\t\t\t\ttable[H][col] += table[row][col];\n\t\t\t}\n\t\t}",
"table[H][col] = 0",
"table[H][col]",
"table[H]",
"table",
"H",
"col",
"0",
"for(int row = 0; row < H; row++){\n\t\t\t\ttable[H][col] += table[row][col];\n\t\t\t}",
"int row = 0;",
"int row = 0;",
"row",
"0",
"row < H",
"row",
"H",
"row++",
"row++",
"row",
"{\n\t\t\t\ttable[H][col] += table[row][col];\n\t\t\t}",
"{\n\t\t\t\ttable[H][col] += table[row][col];\n\t\t\t}",
"table[H][col] += table[row][col]",
"table[H][col]",
"table[H]",
"table",
"H",
"col",
"table[row][col]",
"table[row]",
"table",
"row",
"col",
"for(int row = 0; row <= H; row++){\n\t\t\tSystem.out.printf(\"%d\", table[row][0]);\n\t\t\tfor(int col = 1; col <= W; col++){\n\t\t\t\tSystem.out.printf(\" %d\", table[row][col]);\n\t\t\t}\n\t\t\tSystem.out.printf(\"\\n\");\n\t\t}",
"int row = 0;",
"int row = 0;",
"row",
"0",
"row <= H",
"row",
"H",
"row++",
"row++",
"row",
"{\n\t\t\tSystem.out.printf(\"%d\", table[row][0]);\n\t\t\tfor(int col = 1; col <= W; col++){\n\t\t\t\tSystem.out.printf(\" %d\", table[row][col]);\n\t\t\t}\n\t\t\tSystem.out.printf(\"\\n\");\n\t\t}",
"{\n\t\t\tSystem.out.printf(\"%d\", table[row][0]);\n\t\t\tfor(int col = 1; col <= W; col++){\n\t\t\t\tSystem.out.printf(\" %d\", table[row][col]);\n\t\t\t}\n\t\t\tSystem.out.printf(\"\\n\");\n\t\t}",
"System.out.printf(\"%d\", table[row][0])",
"System.out.printf",
"System.out",
"System",
"System.out",
"\"%d\"",
"table[row][0]",
"table[row]",
"table",
"row",
"0",
"for(int col = 1; col <= W; col++){\n\t\t\t\tSystem.out.printf(\" %d\", table[row][col]);\n\t\t\t}",
"int col = 1;",
"int col = 1;",
"col",
"1",
"col <= W",
"col",
"W",
"col++",
"col++",
"col",
"{\n\t\t\t\tSystem.out.printf(\" %d\", table[row][col]);\n\t\t\t}",
"{\n\t\t\t\tSystem.out.printf(\" %d\", table[row][col]);\n\t\t\t}",
"System.out.printf(\" %d\", table[row][col])",
"System.out.printf",
"System.out",
"System",
"System.out",
"\" %d\"",
"table[row][col]",
"table[row]",
"table",
"row",
"col",
"System.out.printf(\"\\n\")",
"System.out.printf",
"System.out",
"System",
"System.out",
"\"\\n\"",
"String[] args",
"args",
"public class Main {\n\n\tpublic static final int BIG_NUM = 2000000000;\n\tpublic static final int MOD = 1000000007;\n\n\tpublic static void main(String[] args) {\n\n\t\tScanner sc = new Scanner(System.in);\n\t\tint H,W;\n\n\t\tH = sc.nextInt();\n\t\tW = sc.nextInt();\n\n\t\tint table[][] = new int[H+1][W+1];\n\n\t\tfor(int row = 0; row < H; row++){\n\t\t\tfor(int col = 0; col < W; col++){\n\t\t\t\ttable[row][col] = sc.nextInt();\n\t\t\t}\n\t\t}\n\n\t\tfor(int row = 0; row < H; row++){\n\t\t\ttable[row][W] = 0;\n\t\t\tfor(int col = 0; col < W; col++){\n\t\t\t\ttable[row][W] += table[row][col];\n\t\t\t}\n\t\t}\n\n\t\tfor(int col = 0; col <= W; col++){\n\t\t\ttable[H][col] = 0;\n\t\t\tfor(int row = 0; row < H; row++){\n\t\t\t\ttable[H][col] += table[row][col];\n\t\t\t}\n\t\t}\n\n\t\tfor(int row = 0; row <= H; row++){\n\t\t\tSystem.out.printf(\"%d\", table[row][0]);\n\t\t\tfor(int col = 1; col <= W; col++){\n\t\t\t\tSystem.out.printf(\" %d\", table[row][col]);\n\t\t\t}\n\t\t\tSystem.out.printf(\"\\n\");\n\t\t}\n\t}\n}",
"public class Main {\n\n\tpublic static final int BIG_NUM = 2000000000;\n\tpublic static final int MOD = 1000000007;\n\n\tpublic static void main(String[] args) {\n\n\t\tScanner sc = new Scanner(System.in);\n\t\tint H,W;\n\n\t\tH = sc.nextInt();\n\t\tW = sc.nextInt();\n\n\t\tint table[][] = new int[H+1][W+1];\n\n\t\tfor(int row = 0; row < H; row++){\n\t\t\tfor(int col = 0; col < W; col++){\n\t\t\t\ttable[row][col] = sc.nextInt();\n\t\t\t}\n\t\t}\n\n\t\tfor(int row = 0; row < H; row++){\n\t\t\ttable[row][W] = 0;\n\t\t\tfor(int col = 0; col < W; col++){\n\t\t\t\ttable[row][W] += table[row][col];\n\t\t\t}\n\t\t}\n\n\t\tfor(int col = 0; col <= W; col++){\n\t\t\ttable[H][col] = 0;\n\t\t\tfor(int row = 0; row < H; row++){\n\t\t\t\ttable[H][col] += table[row][col];\n\t\t\t}\n\t\t}\n\n\t\tfor(int row = 0; row <= H; row++){\n\t\t\tSystem.out.printf(\"%d\", table[row][0]);\n\t\t\tfor(int col = 1; col <= W; col++){\n\t\t\t\tSystem.out.printf(\" %d\", table[row][col]);\n\t\t\t}\n\t\t\tSystem.out.printf(\"\\n\");\n\t\t}\n\t}\n}",
"Main"
] | import java.util.Scanner;
public class Main {
public static final int BIG_NUM = 2000000000;
public static final int MOD = 1000000007;
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int H,W;
H = sc.nextInt();
W = sc.nextInt();
int table[][] = new int[H+1][W+1];
for(int row = 0; row < H; row++){
for(int col = 0; col < W; col++){
table[row][col] = sc.nextInt();
}
}
for(int row = 0; row < H; row++){
table[row][W] = 0;
for(int col = 0; col < W; col++){
table[row][W] += table[row][col];
}
}
for(int col = 0; col <= W; col++){
table[H][col] = 0;
for(int row = 0; row < H; row++){
table[H][col] += table[row][col];
}
}
for(int row = 0; row <= H; row++){
System.out.printf("%d", table[row][0]);
for(int col = 1; col <= W; col++){
System.out.printf(" %d", table[row][col]);
}
System.out.printf("\n");
}
}
}
|
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
0,
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,
18,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
41,
13,
17,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
18,
18,
13,
13,
13,
0,
13,
2,
18,
18,
13,
13,
13,
17,
4,
18,
18,
13,
13,
2,
13,
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,
18,
18,
13,
13,
13,
4,
18,
18,
13,
13,
2,
13,
17,
0,
13,
13,
4,
18,
18,
13,
13,
13,
4,
18,
13,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
182,
5
],
[
182,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
8,
14
],
[
14,
15
],
[
14,
16
],
[
16,
17
],
[
17,
18
],
[
8,
19
],
[
19,
20
],
[
19,
21
],
[
21,
22
],
[
22,
23
],
[
8,
24
],
[
24,
25
],
[
24,
26
],
[
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
],
[
56,
60
],
[
55,
61
],
[
61,
62
],
[
62,
63
],
[
8,
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
],
[
77,
79
],
[
76,
80
],
[
80,
81
],
[
80,
82
],
[
76,
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
],
[
99,
101
],
[
98,
102
],
[
95,
103
],
[
103,
104
],
[
103,
105
],
[
105,
106
],
[
106,
107
],
[
107,
108
],
[
107,
109
],
[
106,
110
],
[
105,
111
],
[
76,
112
],
[
112,
113
],
[
113,
114
],
[
114,
115
],
[
114,
116
],
[
112,
117
],
[
117,
118
],
[
117,
119
],
[
8,
120
],
[
120,
121
],
[
120,
122
],
[
8,
123
],
[
123,
124
],
[
124,
125
],
[
125,
126
],
[
125,
127
],
[
123,
128
],
[
128,
129
],
[
128,
130
],
[
123,
131
],
[
131,
132
],
[
132,
133
],
[
123,
134
],
[
135,
135
],
[
135,
136
],
[
136,
137
],
[
136,
138
],
[
135,
139
],
[
139,
140
],
[
140,
141
],
[
141,
142
],
[
141,
143
],
[
139,
144
],
[
144,
145
],
[
144,
146
],
[
139,
147
],
[
147,
148
],
[
148,
149
],
[
139,
150
],
[
151,
151
],
[
151,
152
],
[
152,
153
],
[
152,
154
],
[
154,
155
],
[
155,
156
],
[
155,
157
],
[
154,
158
],
[
135,
159
],
[
159,
160
],
[
160,
161
],
[
161,
162
],
[
161,
163
],
[
159,
164
],
[
164,
165
],
[
164,
166
],
[
135,
167
],
[
167,
168
],
[
167,
169
],
[
8,
170
],
[
170,
171
],
[
171,
172
],
[
172,
173
],
[
172,
174
],
[
170,
175
],
[
8,
176
],
[
176,
177
],
[
177,
178
],
[
6,
179
],
[
179,
180
],
[
0,
181
],
[
181,
182
],
[
181,
183
]
] | [
"\nimport java.util.Scanner;\n\npublic class Main{\n\tpublic static void main(String args[]){\n\n\t\t//??????????????¨???????????????\n\t\tScanner sc = new Scanner(System.in);\n\t\tint list [][];\n\n\t\t//????????????????????¨??¨?????????????????????????????????\n\t\tint r = sc.nextInt();\n\t\tint c = sc.nextInt();\n\t\tlist = new int[r][c];\n\n\n\t\t//2?¬???????????????°?????????????????????\n\t\tfor(int i = 0; i < r; i++){\n\t\t\tfor(int j = 0; j < c; j++){\n\t\t\t\tlist[i][j] = sc.nextInt();\n\t\t\t}\n\t\t}\n\n\t\t//??????????????¨???\n\n\t\t//???????????¨r???????¨??????¨???\n\t\tfor(int i = 0; i < r; i++){\n\t\t\tint rsum = 0;\n\t\t\tString a = \"\";\n\t\t\tfor(int j = 0; j < c; j++){\n\t\t\t\trsum += list[i][j];\n\t\t\t\ta += (list[i][j] +\" \");\n\t\t\t}\n\t\t\tSystem.out.println(a + (rsum));\n\t\t}\n\n\t\t//c??¨????¨??????¨???\n\n\t\tint sum = 0;\n\t\tfor(int i = 0 ; i < c; i++){\n\t\t\tint csum = 0;\n\t\t\tfor(int j = 0 ; j < r; j++){\n\t\t\t\tcsum += list[j][i];\n\t\t\t}\n\t\t\tSystem.out.print(csum + \" \");\n\t\t\tsum += csum;\n\t\t}\n\n\t\tSystem.out.println(sum);\n\t\tsc.close();\n\t}\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main{\n\tpublic static void main(String args[]){\n\n\t\t//??????????????¨???????????????\n\t\tScanner sc = new Scanner(System.in);\n\t\tint list [][];\n\n\t\t//????????????????????¨??¨?????????????????????????????????\n\t\tint r = sc.nextInt();\n\t\tint c = sc.nextInt();\n\t\tlist = new int[r][c];\n\n\n\t\t//2?¬???????????????°?????????????????????\n\t\tfor(int i = 0; i < r; i++){\n\t\t\tfor(int j = 0; j < c; j++){\n\t\t\t\tlist[i][j] = sc.nextInt();\n\t\t\t}\n\t\t}\n\n\t\t//??????????????¨???\n\n\t\t//???????????¨r???????¨??????¨???\n\t\tfor(int i = 0; i < r; i++){\n\t\t\tint rsum = 0;\n\t\t\tString a = \"\";\n\t\t\tfor(int j = 0; j < c; j++){\n\t\t\t\trsum += list[i][j];\n\t\t\t\ta += (list[i][j] +\" \");\n\t\t\t}\n\t\t\tSystem.out.println(a + (rsum));\n\t\t}\n\n\t\t//c??¨????¨??????¨???\n\n\t\tint sum = 0;\n\t\tfor(int i = 0 ; i < c; i++){\n\t\t\tint csum = 0;\n\t\t\tfor(int j = 0 ; j < r; j++){\n\t\t\t\tcsum += list[j][i];\n\t\t\t}\n\t\t\tSystem.out.print(csum + \" \");\n\t\t\tsum += csum;\n\t\t}\n\n\t\tSystem.out.println(sum);\n\t\tsc.close();\n\t}\n}",
"Main",
"public static void main(String args[]){\n\n\t\t//??????????????¨???????????????\n\t\tScanner sc = new Scanner(System.in);\n\t\tint list [][];\n\n\t\t//????????????????????¨??¨?????????????????????????????????\n\t\tint r = sc.nextInt();\n\t\tint c = sc.nextInt();\n\t\tlist = new int[r][c];\n\n\n\t\t//2?¬???????????????°?????????????????????\n\t\tfor(int i = 0; i < r; i++){\n\t\t\tfor(int j = 0; j < c; j++){\n\t\t\t\tlist[i][j] = sc.nextInt();\n\t\t\t}\n\t\t}\n\n\t\t//??????????????¨???\n\n\t\t//???????????¨r???????¨??????¨???\n\t\tfor(int i = 0; i < r; i++){\n\t\t\tint rsum = 0;\n\t\t\tString a = \"\";\n\t\t\tfor(int j = 0; j < c; j++){\n\t\t\t\trsum += list[i][j];\n\t\t\t\ta += (list[i][j] +\" \");\n\t\t\t}\n\t\t\tSystem.out.println(a + (rsum));\n\t\t}\n\n\t\t//c??¨????¨??????¨???\n\n\t\tint sum = 0;\n\t\tfor(int i = 0 ; i < c; i++){\n\t\t\tint csum = 0;\n\t\t\tfor(int j = 0 ; j < r; j++){\n\t\t\t\tcsum += list[j][i];\n\t\t\t}\n\t\t\tSystem.out.print(csum + \" \");\n\t\t\tsum += csum;\n\t\t}\n\n\t\tSystem.out.println(sum);\n\t\tsc.close();\n\t}",
"main",
"{\n\n\t\t//??????????????¨???????????????\n\t\tScanner sc = new Scanner(System.in);\n\t\tint list [][];\n\n\t\t//????????????????????¨??¨?????????????????????????????????\n\t\tint r = sc.nextInt();\n\t\tint c = sc.nextInt();\n\t\tlist = new int[r][c];\n\n\n\t\t//2?¬???????????????°?????????????????????\n\t\tfor(int i = 0; i < r; i++){\n\t\t\tfor(int j = 0; j < c; j++){\n\t\t\t\tlist[i][j] = sc.nextInt();\n\t\t\t}\n\t\t}\n\n\t\t//??????????????¨???\n\n\t\t//???????????¨r???????¨??????¨???\n\t\tfor(int i = 0; i < r; i++){\n\t\t\tint rsum = 0;\n\t\t\tString a = \"\";\n\t\t\tfor(int j = 0; j < c; j++){\n\t\t\t\trsum += list[i][j];\n\t\t\t\ta += (list[i][j] +\" \");\n\t\t\t}\n\t\t\tSystem.out.println(a + (rsum));\n\t\t}\n\n\t\t//c??¨????¨??????¨???\n\n\t\tint sum = 0;\n\t\tfor(int i = 0 ; i < c; i++){\n\t\t\tint csum = 0;\n\t\t\tfor(int j = 0 ; j < r; j++){\n\t\t\t\tcsum += list[j][i];\n\t\t\t}\n\t\t\tSystem.out.print(csum + \" \");\n\t\t\tsum += csum;\n\t\t}\n\n\t\tSystem.out.println(sum);\n\t\tsc.close();\n\t}",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"int list [][];",
"list",
"int r = sc.nextInt();",
"r",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int c = sc.nextInt();",
"c",
"sc.nextInt()",
"sc.nextInt",
"sc",
"list = new int[r][c]",
"list",
"new int[r][c]",
"r",
"c",
"for(int i = 0; i < r; i++){\n\t\t\tfor(int j = 0; j < c; j++){\n\t\t\t\tlist[i][j] = sc.nextInt();\n\t\t\t}\n\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < r",
"i",
"r",
"i++",
"i++",
"i",
"{\n\t\t\tfor(int j = 0; j < c; j++){\n\t\t\t\tlist[i][j] = sc.nextInt();\n\t\t\t}\n\t\t}",
"{\n\t\t\tfor(int j = 0; j < c; j++){\n\t\t\t\tlist[i][j] = sc.nextInt();\n\t\t\t}\n\t\t}",
"for(int j = 0; j < c; j++){\n\t\t\t\tlist[i][j] = sc.nextInt();\n\t\t\t}",
"int j = 0;",
"int j = 0;",
"j",
"0",
"j < c",
"j",
"c",
"j++",
"j++",
"j",
"{\n\t\t\t\tlist[i][j] = sc.nextInt();\n\t\t\t}",
"{\n\t\t\t\tlist[i][j] = sc.nextInt();\n\t\t\t}",
"list[i][j] = sc.nextInt()",
"list[i][j]",
"list[i]",
"list",
"i",
"j",
"sc.nextInt()",
"sc.nextInt",
"sc",
"for(int i = 0; i < r; i++){\n\t\t\tint rsum = 0;\n\t\t\tString a = \"\";\n\t\t\tfor(int j = 0; j < c; j++){\n\t\t\t\trsum += list[i][j];\n\t\t\t\ta += (list[i][j] +\" \");\n\t\t\t}\n\t\t\tSystem.out.println(a + (rsum));\n\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < r",
"i",
"r",
"i++",
"i++",
"i",
"{\n\t\t\tint rsum = 0;\n\t\t\tString a = \"\";\n\t\t\tfor(int j = 0; j < c; j++){\n\t\t\t\trsum += list[i][j];\n\t\t\t\ta += (list[i][j] +\" \");\n\t\t\t}\n\t\t\tSystem.out.println(a + (rsum));\n\t\t}",
"{\n\t\t\tint rsum = 0;\n\t\t\tString a = \"\";\n\t\t\tfor(int j = 0; j < c; j++){\n\t\t\t\trsum += list[i][j];\n\t\t\t\ta += (list[i][j] +\" \");\n\t\t\t}\n\t\t\tSystem.out.println(a + (rsum));\n\t\t}",
"int rsum = 0;",
"rsum",
"0",
"String a = \"\";",
"a",
"\"\"",
"for(int j = 0; j < c; j++){\n\t\t\t\trsum += list[i][j];\n\t\t\t\ta += (list[i][j] +\" \");\n\t\t\t}",
"int j = 0;",
"int j = 0;",
"j",
"0",
"j < c",
"j",
"c",
"j++",
"j++",
"j",
"{\n\t\t\t\trsum += list[i][j];\n\t\t\t\ta += (list[i][j] +\" \");\n\t\t\t}",
"{\n\t\t\t\trsum += list[i][j];\n\t\t\t\ta += (list[i][j] +\" \");\n\t\t\t}",
"rsum += list[i][j]",
"rsum",
"list[i][j]",
"list[i]",
"list",
"i",
"j",
"a += (list[i][j] +\" \")",
"a",
"(list[i][j] +\" \")",
"list[i][j]",
"list[i]",
"list",
"i",
"j",
"\" \"",
"System.out.println(a + (rsum))",
"System.out.println",
"System.out",
"System",
"System.out",
"a + (rsum)",
"a",
"(rsum)",
"int sum = 0;",
"sum",
"0",
"for(int i = 0 ; i < c; i++){\n\t\t\tint csum = 0;\n\t\t\tfor(int j = 0 ; j < r; j++){\n\t\t\t\tcsum += list[j][i];\n\t\t\t}\n\t\t\tSystem.out.print(csum + \" \");\n\t\t\tsum += csum;\n\t\t}",
"int i = 0 ;",
"int i = 0 ;",
"i",
"0",
"i < c",
"i",
"c",
"i++",
"i++",
"i",
"{\n\t\t\tint csum = 0;\n\t\t\tfor(int j = 0 ; j < r; j++){\n\t\t\t\tcsum += list[j][i];\n\t\t\t}\n\t\t\tSystem.out.print(csum + \" \");\n\t\t\tsum += csum;\n\t\t}",
"{\n\t\t\tint csum = 0;\n\t\t\tfor(int j = 0 ; j < r; j++){\n\t\t\t\tcsum += list[j][i];\n\t\t\t}\n\t\t\tSystem.out.print(csum + \" \");\n\t\t\tsum += csum;\n\t\t}",
"int csum = 0;",
"csum",
"0",
"for(int j = 0 ; j < r; j++){\n\t\t\t\tcsum += list[j][i];\n\t\t\t}",
"int j = 0 ;",
"int j = 0 ;",
"j",
"0",
"j < r",
"j",
"r",
"j++",
"j++",
"j",
"{\n\t\t\t\tcsum += list[j][i];\n\t\t\t}",
"{\n\t\t\t\tcsum += list[j][i];\n\t\t\t}",
"csum += list[j][i]",
"csum",
"list[j][i]",
"list[j]",
"list",
"j",
"i",
"System.out.print(csum + \" \")",
"System.out.print",
"System.out",
"System",
"System.out",
"csum + \" \"",
"csum",
"\" \"",
"sum += csum",
"sum",
"csum",
"System.out.println(sum)",
"System.out.println",
"System.out",
"System",
"System.out",
"sum",
"sc.close()",
"sc.close",
"sc",
"String args[]",
"args",
"public class Main{\n\tpublic static void main(String args[]){\n\n\t\t//??????????????¨???????????????\n\t\tScanner sc = new Scanner(System.in);\n\t\tint list [][];\n\n\t\t//????????????????????¨??¨?????????????????????????????????\n\t\tint r = sc.nextInt();\n\t\tint c = sc.nextInt();\n\t\tlist = new int[r][c];\n\n\n\t\t//2?¬???????????????°?????????????????????\n\t\tfor(int i = 0; i < r; i++){\n\t\t\tfor(int j = 0; j < c; j++){\n\t\t\t\tlist[i][j] = sc.nextInt();\n\t\t\t}\n\t\t}\n\n\t\t//??????????????¨???\n\n\t\t//???????????¨r???????¨??????¨???\n\t\tfor(int i = 0; i < r; i++){\n\t\t\tint rsum = 0;\n\t\t\tString a = \"\";\n\t\t\tfor(int j = 0; j < c; j++){\n\t\t\t\trsum += list[i][j];\n\t\t\t\ta += (list[i][j] +\" \");\n\t\t\t}\n\t\t\tSystem.out.println(a + (rsum));\n\t\t}\n\n\t\t//c??¨????¨??????¨???\n\n\t\tint sum = 0;\n\t\tfor(int i = 0 ; i < c; i++){\n\t\t\tint csum = 0;\n\t\t\tfor(int j = 0 ; j < r; j++){\n\t\t\t\tcsum += list[j][i];\n\t\t\t}\n\t\t\tSystem.out.print(csum + \" \");\n\t\t\tsum += csum;\n\t\t}\n\n\t\tSystem.out.println(sum);\n\t\tsc.close();\n\t}\n}",
"public class Main{\n\tpublic static void main(String args[]){\n\n\t\t//??????????????¨???????????????\n\t\tScanner sc = new Scanner(System.in);\n\t\tint list [][];\n\n\t\t//????????????????????¨??¨?????????????????????????????????\n\t\tint r = sc.nextInt();\n\t\tint c = sc.nextInt();\n\t\tlist = new int[r][c];\n\n\n\t\t//2?¬???????????????°?????????????????????\n\t\tfor(int i = 0; i < r; i++){\n\t\t\tfor(int j = 0; j < c; j++){\n\t\t\t\tlist[i][j] = sc.nextInt();\n\t\t\t}\n\t\t}\n\n\t\t//??????????????¨???\n\n\t\t//???????????¨r???????¨??????¨???\n\t\tfor(int i = 0; i < r; i++){\n\t\t\tint rsum = 0;\n\t\t\tString a = \"\";\n\t\t\tfor(int j = 0; j < c; j++){\n\t\t\t\trsum += list[i][j];\n\t\t\t\ta += (list[i][j] +\" \");\n\t\t\t}\n\t\t\tSystem.out.println(a + (rsum));\n\t\t}\n\n\t\t//c??¨????¨??????¨???\n\n\t\tint sum = 0;\n\t\tfor(int i = 0 ; i < c; i++){\n\t\t\tint csum = 0;\n\t\t\tfor(int j = 0 ; j < r; j++){\n\t\t\t\tcsum += list[j][i];\n\t\t\t}\n\t\t\tSystem.out.print(csum + \" \");\n\t\t\tsum += csum;\n\t\t}\n\n\t\tSystem.out.println(sum);\n\t\tsc.close();\n\t}\n}",
"Main"
] |
import java.util.Scanner;
public class Main{
public static void main(String args[]){
//??????????????¨???????????????
Scanner sc = new Scanner(System.in);
int list [][];
//????????????????????¨??¨?????????????????????????????????
int r = sc.nextInt();
int c = sc.nextInt();
list = new int[r][c];
//2?¬???????????????°?????????????????????
for(int i = 0; i < r; i++){
for(int j = 0; j < c; j++){
list[i][j] = sc.nextInt();
}
}
//??????????????¨???
//???????????¨r???????¨??????¨???
for(int i = 0; i < r; i++){
int rsum = 0;
String a = "";
for(int j = 0; j < c; j++){
rsum += list[i][j];
a += (list[i][j] +" ");
}
System.out.println(a + (rsum));
}
//c??¨????¨??????¨???
int sum = 0;
for(int i = 0 ; i < c; i++){
int csum = 0;
for(int j = 0 ; j < r; j++){
csum += list[j][i];
}
System.out.print(csum + " ");
sum += csum;
}
System.out.println(sum);
sc.close();
}
} |
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
41,
13,
41,
13,
12,
13,
30,
0,
13,
20,
0,
13,
20,
41,
13,
20,
4,
18,
13,
4,
18,
13,
23,
13,
6,
13,
12,
13,
30,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
41,
13,
17,
41,
13,
20,
13,
13,
41,
13,
20,
13,
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,
0,
18,
18,
13,
13,
13,
4,
18,
13,
0,
13,
18,
18,
13,
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,
13,
13,
18,
18,
13,
13,
13,
0,
18,
13,
13,
18,
18,
13,
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,
4,
18,
13,
2,
18,
18,
13,
13,
13,
17,
4,
18,
13,
18,
13,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
4,
18,
13,
2,
18,
13,
13,
17,
4,
18,
13,
13,
6,
13,
41,
13,
41,
13,
12,
13,
30,
0,
13,
20,
23,
13,
12,
13,
30,
42,
2,
2,
13,
17,
40,
4,
18,
13,
30,
0,
13,
20,
29,
4,
18,
13,
4,
18,
13,
12,
13,
30,
42,
2,
2,
13,
17,
40,
4,
18,
13,
30,
0,
13,
20,
29,
4,
18,
13,
4,
18,
13,
12,
13,
30,
42,
2,
2,
13,
17,
40,
4,
18,
13,
30,
0,
13,
20,
29,
4,
18,
13,
12,
13,
30,
42,
2,
2,
13,
17,
40,
4,
18,
13,
30,
0,
13,
20,
29,
4,
18,
13,
4,
18,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
10,
11
],
[
10,
12
],
[
0,
13
],
[
13,
14
],
[
13,
15
],
[
0,
16
],
[
16,
17
],
[
16,
18
],
[
0,
19
],
[
333,
20
],
[
333,
21
],
[
21,
22
],
[
333,
23
],
[
23,
24
],
[
333,
25
],
[
25,
26
],
[
25,
27
],
[
27,
28
],
[
28,
29
],
[
28,
30
],
[
27,
31
],
[
31,
32
],
[
31,
33
],
[
27,
34
],
[
34,
35
],
[
34,
36
],
[
27,
37
],
[
37,
38
],
[
38,
39
],
[
27,
40
],
[
40,
41
],
[
41,
42
],
[
25,
43
],
[
43,
44
],
[
333,
45
],
[
45,
46
],
[
45,
47
],
[
47,
48
],
[
47,
49
],
[
49,
50
],
[
50,
51
],
[
50,
52
],
[
52,
53
],
[
53,
54
],
[
49,
55
],
[
55,
56
],
[
55,
57
],
[
57,
58
],
[
58,
59
],
[
49,
60
],
[
60,
61
],
[
60,
62
],
[
49,
63
],
[
63,
64
],
[
63,
65
],
[
49,
68
],
[
68,
69
],
[
68,
70
],
[
49,
72
],
[
72,
73
],
[
72,
74
],
[
49,
76
],
[
76,
77
],
[
77,
78
],
[
78,
79
],
[
78,
80
],
[
76,
81
],
[
81,
82
],
[
81,
83
],
[
76,
84
],
[
84,
85
],
[
85,
86
],
[
76,
87
],
[
88,
88
],
[
88,
89
],
[
89,
90
],
[
90,
91
],
[
91,
92
],
[
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
],
[
103,
107
],
[
102,
108
],
[
108,
109
],
[
109,
110
],
[
101,
111
],
[
111,
112
],
[
111,
113
],
[
113,
114
],
[
114,
115
],
[
114,
116
],
[
113,
117
],
[
49,
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
],
[
132,
133
],
[
133,
134
],
[
133,
135
],
[
131,
136
],
[
136,
137
],
[
136,
138
],
[
131,
139
],
[
139,
140
],
[
140,
141
],
[
131,
142
],
[
143,
143
],
[
143,
144
],
[
144,
145
],
[
145,
146
],
[
145,
147
],
[
144,
148
],
[
148,
149
],
[
149,
150
],
[
149,
151
],
[
148,
152
],
[
143,
153
],
[
153,
154
],
[
154,
155
],
[
154,
156
],
[
153,
157
],
[
157,
158
],
[
158,
159
],
[
158,
160
],
[
157,
161
],
[
49,
162
],
[
162,
163
],
[
163,
164
],
[
164,
165
],
[
164,
166
],
[
162,
167
],
[
167,
168
],
[
167,
169
],
[
162,
170
],
[
170,
171
],
[
171,
172
],
[
162,
173
],
[
174,
174
],
[
174,
175
],
[
175,
176
],
[
176,
177
],
[
177,
178
],
[
177,
179
],
[
175,
180
],
[
180,
181
],
[
180,
182
],
[
175,
183
],
[
183,
184
],
[
184,
185
],
[
175,
186
],
[
187,
187
],
[
187,
188
],
[
188,
189
],
[
189,
190
],
[
188,
191
],
[
191,
192
],
[
192,
193
],
[
193,
194
],
[
193,
195
],
[
192,
196
],
[
191,
197
],
[
174,
198
],
[
198,
199
],
[
199,
200
],
[
198,
201
],
[
201,
202
],
[
201,
203
],
[
49,
204
],
[
204,
205
],
[
205,
206
],
[
206,
207
],
[
206,
208
],
[
204,
209
],
[
209,
210
],
[
209,
211
],
[
204,
212
],
[
212,
213
],
[
213,
214
],
[
204,
215
],
[
216,
216
],
[
216,
217
],
[
217,
218
],
[
218,
219
],
[
217,
220
],
[
220,
221
],
[
221,
222
],
[
221,
223
],
[
220,
224
],
[
49,
225
],
[
225,
226
],
[
226,
227
],
[
225,
228
],
[
333,
229
],
[
229,
230
],
[
229,
231
],
[
231,
232
],
[
229,
233
],
[
233,
234
],
[
229,
235
],
[
235,
236
],
[
235,
237
],
[
237,
238
],
[
238,
239
],
[
238,
240
],
[
235,
241
],
[
241,
242
],
[
229,
243
],
[
243,
244
],
[
243,
245
],
[
245,
246
],
[
246,
247
],
[
247,
248
],
[
248,
249
],
[
248,
250
],
[
247,
251
],
[
251,
252
],
[
252,
253
],
[
253,
254
],
[
246,
255
],
[
255,
256
],
[
256,
257
],
[
256,
258
],
[
245,
259
],
[
259,
260
],
[
260,
261
],
[
261,
262
],
[
260,
263
],
[
263,
264
],
[
264,
265
],
[
229,
266
],
[
266,
267
],
[
266,
268
],
[
268,
269
],
[
269,
270
],
[
270,
271
],
[
271,
272
],
[
271,
273
],
[
270,
274
],
[
274,
275
],
[
275,
276
],
[
276,
277
],
[
269,
278
],
[
278,
279
],
[
279,
280
],
[
279,
281
],
[
268,
282
],
[
282,
283
],
[
283,
284
],
[
284,
285
],
[
283,
286
],
[
286,
287
],
[
287,
288
],
[
229,
289
],
[
289,
290
],
[
289,
291
],
[
291,
292
],
[
292,
293
],
[
293,
294
],
[
294,
295
],
[
294,
296
],
[
293,
297
],
[
297,
298
],
[
298,
299
],
[
299,
300
],
[
292,
301
],
[
301,
302
],
[
302,
303
],
[
302,
304
],
[
291,
305
],
[
305,
306
],
[
306,
307
],
[
307,
308
],
[
229,
309
],
[
309,
310
],
[
309,
311
],
[
311,
312
],
[
312,
313
],
[
313,
314
],
[
314,
315
],
[
314,
316
],
[
313,
317
],
[
317,
318
],
[
318,
319
],
[
319,
320
],
[
312,
321
],
[
321,
322
],
[
322,
323
],
[
322,
324
],
[
311,
325
],
[
325,
326
],
[
326,
327
],
[
327,
328
],
[
326,
329
],
[
329,
330
],
[
330,
331
],
[
0,
332
],
[
332,
333
],
[
332,
334
]
] | [
"import java.io.BufferedReader;\nimport java.io.IOException;\nimport java.io.InputStream;\nimport java.io.InputStreamReader;\nimport java.io.PrintWriter;\nimport java.util.StringTokenizer;\n\npublic class Main {\n static InputReader in;\n static PrintWriter out;\n\n static class Solution {\n void solve() throws IOException {\n int r = in.nextInt();\n int c = in.nextInt();\n int sum = 0;\n int[][] sheet = new int[r][c]; \n int[] sumofrow = new int[r];\n int[] sumofcolumn = new int[c];\n \n for (int i = 0; i < r; i++) {\n for (int j = 0; j < c; j++) {\n sheet[i][j] = in.nextInt();\n sum += sheet[i][j];\n }\n }\n \n for (int i = 0; i < r; i++) {\n for (int j = 0; j < c; j++) {\n sumofrow[i] += sheet[i][j];\n sumofcolumn[j] += sheet[i][j];\n }\n }\n \n for (int i = 0; i < r; i++) {\n for (int j = 0; j < c; j++) {\n out.print(sheet[i][j] + \" \");\n }\n out.println(sumofrow[i]);\n }\n \n for (int i = 0; i < c; i++) {\n out.print(sumofcolumn[i] + \" \");\n }\n \n out.println(sum);\n \n// End solve()\n }\n// End Solution\n}\n\n public static void main(String[] args) throws IOException {\n in = new InputReader(System.in);\n out = new PrintWriter(System.out);\n Solution solver = new Solution();\n solver.solve();\n out.close();\n}\n\n static class InputReader {\n public BufferedReader br;\n public StringTokenizer st;\n\n public InputReader(InputStream stream) {\n br = new BufferedReader(new InputStreamReader(stream));\n }\n\n public int nextInt() throws IOException {\n while (st == null || !st.hasMoreTokens()) {\n st = new StringTokenizer(br.readLine());\n }\n return Integer.parseInt(st.nextToken());\n }\n\n public long nextLong() throws IOException {\n while (st == null || !st.hasMoreTokens()) {\n st = new StringTokenizer(br.readLine());\n }\n return Long.parseLong(st.nextToken());\n }\n\n public String next() throws IOException {\n while (st == null || !st.hasMoreTokens()) {\n st = new StringTokenizer(br.readLine());\n }\n return st.nextToken();\n }\n\n public double nextDouble() throws IOException {\n while (st == null || !st.hasMoreTokens()) {\n st = new StringTokenizer(br.readLine());\n }\n return Double.parseDouble(st.nextToken());\n }\n\n\n }\n\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.PrintWriter;",
"PrintWriter",
"java.io",
"import java.util.StringTokenizer;",
"StringTokenizer",
"java.util",
"public class Main {\n static InputReader in;\n static PrintWriter out;\n\n static class Solution {\n void solve() throws IOException {\n int r = in.nextInt();\n int c = in.nextInt();\n int sum = 0;\n int[][] sheet = new int[r][c]; \n int[] sumofrow = new int[r];\n int[] sumofcolumn = new int[c];\n \n for (int i = 0; i < r; i++) {\n for (int j = 0; j < c; j++) {\n sheet[i][j] = in.nextInt();\n sum += sheet[i][j];\n }\n }\n \n for (int i = 0; i < r; i++) {\n for (int j = 0; j < c; j++) {\n sumofrow[i] += sheet[i][j];\n sumofcolumn[j] += sheet[i][j];\n }\n }\n \n for (int i = 0; i < r; i++) {\n for (int j = 0; j < c; j++) {\n out.print(sheet[i][j] + \" \");\n }\n out.println(sumofrow[i]);\n }\n \n for (int i = 0; i < c; i++) {\n out.print(sumofcolumn[i] + \" \");\n }\n \n out.println(sum);\n \n// End solve()\n }\n// End Solution\n}\n\n public static void main(String[] args) throws IOException {\n in = new InputReader(System.in);\n out = new PrintWriter(System.out);\n Solution solver = new Solution();\n solver.solve();\n out.close();\n}\n\n static class InputReader {\n public BufferedReader br;\n public StringTokenizer st;\n\n public InputReader(InputStream stream) {\n br = new BufferedReader(new InputStreamReader(stream));\n }\n\n public int nextInt() throws IOException {\n while (st == null || !st.hasMoreTokens()) {\n st = new StringTokenizer(br.readLine());\n }\n return Integer.parseInt(st.nextToken());\n }\n\n public long nextLong() throws IOException {\n while (st == null || !st.hasMoreTokens()) {\n st = new StringTokenizer(br.readLine());\n }\n return Long.parseLong(st.nextToken());\n }\n\n public String next() throws IOException {\n while (st == null || !st.hasMoreTokens()) {\n st = new StringTokenizer(br.readLine());\n }\n return st.nextToken();\n }\n\n public double nextDouble() throws IOException {\n while (st == null || !st.hasMoreTokens()) {\n st = new StringTokenizer(br.readLine());\n }\n return Double.parseDouble(st.nextToken());\n }\n\n\n }\n\n}",
"Main",
"static InputReader in;",
"in",
"static PrintWriter out;",
"out",
"public static void main(String[] args) throws IOException {\n in = new InputReader(System.in);\n out = new PrintWriter(System.out);\n Solution solver = new Solution();\n solver.solve();\n out.close();\n}",
"main",
"{\n in = new InputReader(System.in);\n out = new PrintWriter(System.out);\n Solution solver = new Solution();\n solver.solve();\n out.close();\n}",
"in = new InputReader(System.in)",
"in",
"new InputReader(System.in)",
"out = new PrintWriter(System.out)",
"out",
"new PrintWriter(System.out)",
"Solution solver = new Solution();",
"solver",
"new Solution()",
"solver.solve()",
"solver.solve",
"solver",
"out.close()",
"out.close",
"out",
"String[] args",
"args",
"static class Solution {\n void solve() throws IOException {\n int r = in.nextInt();\n int c = in.nextInt();\n int sum = 0;\n int[][] sheet = new int[r][c]; \n int[] sumofrow = new int[r];\n int[] sumofcolumn = new int[c];\n \n for (int i = 0; i < r; i++) {\n for (int j = 0; j < c; j++) {\n sheet[i][j] = in.nextInt();\n sum += sheet[i][j];\n }\n }\n \n for (int i = 0; i < r; i++) {\n for (int j = 0; j < c; j++) {\n sumofrow[i] += sheet[i][j];\n sumofcolumn[j] += sheet[i][j];\n }\n }\n \n for (int i = 0; i < r; i++) {\n for (int j = 0; j < c; j++) {\n out.print(sheet[i][j] + \" \");\n }\n out.println(sumofrow[i]);\n }\n \n for (int i = 0; i < c; i++) {\n out.print(sumofcolumn[i] + \" \");\n }\n \n out.println(sum);\n \n// End solve()\n }\n// End Solution\n}",
"Solution",
"void solve() throws IOException {\n int r = in.nextInt();\n int c = in.nextInt();\n int sum = 0;\n int[][] sheet = new int[r][c]; \n int[] sumofrow = new int[r];\n int[] sumofcolumn = new int[c];\n \n for (int i = 0; i < r; i++) {\n for (int j = 0; j < c; j++) {\n sheet[i][j] = in.nextInt();\n sum += sheet[i][j];\n }\n }\n \n for (int i = 0; i < r; i++) {\n for (int j = 0; j < c; j++) {\n sumofrow[i] += sheet[i][j];\n sumofcolumn[j] += sheet[i][j];\n }\n }\n \n for (int i = 0; i < r; i++) {\n for (int j = 0; j < c; j++) {\n out.print(sheet[i][j] + \" \");\n }\n out.println(sumofrow[i]);\n }\n \n for (int i = 0; i < c; i++) {\n out.print(sumofcolumn[i] + \" \");\n }\n \n out.println(sum);\n \n// End solve()\n }",
"solve",
"{\n int r = in.nextInt();\n int c = in.nextInt();\n int sum = 0;\n int[][] sheet = new int[r][c]; \n int[] sumofrow = new int[r];\n int[] sumofcolumn = new int[c];\n \n for (int i = 0; i < r; i++) {\n for (int j = 0; j < c; j++) {\n sheet[i][j] = in.nextInt();\n sum += sheet[i][j];\n }\n }\n \n for (int i = 0; i < r; i++) {\n for (int j = 0; j < c; j++) {\n sumofrow[i] += sheet[i][j];\n sumofcolumn[j] += sheet[i][j];\n }\n }\n \n for (int i = 0; i < r; i++) {\n for (int j = 0; j < c; j++) {\n out.print(sheet[i][j] + \" \");\n }\n out.println(sumofrow[i]);\n }\n \n for (int i = 0; i < c; i++) {\n out.print(sumofcolumn[i] + \" \");\n }\n \n out.println(sum);\n \n// End solve()\n }",
"int r = in.nextInt();",
"r",
"in.nextInt()",
"in.nextInt",
"in",
"int c = in.nextInt();",
"c",
"in.nextInt()",
"in.nextInt",
"in",
"int sum = 0;",
"sum",
"0",
"int[][] sheet = new int[r][c];",
"sheet",
"new int[r][c]",
"r",
"c",
"int[] sumofrow = new int[r];",
"sumofrow",
"new int[r]",
"r",
"int[] sumofcolumn = new int[c];",
"sumofcolumn",
"new int[c]",
"c",
"for (int i = 0; i < r; i++) {\n for (int j = 0; j < c; j++) {\n sheet[i][j] = in.nextInt();\n sum += sheet[i][j];\n }\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < r",
"i",
"r",
"i++",
"i++",
"i",
"{\n for (int j = 0; j < c; j++) {\n sheet[i][j] = in.nextInt();\n sum += sheet[i][j];\n }\n }",
"{\n for (int j = 0; j < c; j++) {\n sheet[i][j] = in.nextInt();\n sum += sheet[i][j];\n }\n }",
"for (int j = 0; j < c; j++) {\n sheet[i][j] = in.nextInt();\n sum += sheet[i][j];\n }",
"int j = 0;",
"int j = 0;",
"j",
"0",
"j < c",
"j",
"c",
"j++",
"j++",
"j",
"{\n sheet[i][j] = in.nextInt();\n sum += sheet[i][j];\n }",
"{\n sheet[i][j] = in.nextInt();\n sum += sheet[i][j];\n }",
"sheet[i][j] = in.nextInt()",
"sheet[i][j]",
"sheet[i]",
"sheet",
"i",
"j",
"in.nextInt()",
"in.nextInt",
"in",
"sum += sheet[i][j]",
"sum",
"sheet[i][j]",
"sheet[i]",
"sheet",
"i",
"j",
"for (int i = 0; i < r; i++) {\n for (int j = 0; j < c; j++) {\n sumofrow[i] += sheet[i][j];\n sumofcolumn[j] += sheet[i][j];\n }\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < r",
"i",
"r",
"i++",
"i++",
"i",
"{\n for (int j = 0; j < c; j++) {\n sumofrow[i] += sheet[i][j];\n sumofcolumn[j] += sheet[i][j];\n }\n }",
"{\n for (int j = 0; j < c; j++) {\n sumofrow[i] += sheet[i][j];\n sumofcolumn[j] += sheet[i][j];\n }\n }",
"for (int j = 0; j < c; j++) {\n sumofrow[i] += sheet[i][j];\n sumofcolumn[j] += sheet[i][j];\n }",
"int j = 0;",
"int j = 0;",
"j",
"0",
"j < c",
"j",
"c",
"j++",
"j++",
"j",
"{\n sumofrow[i] += sheet[i][j];\n sumofcolumn[j] += sheet[i][j];\n }",
"{\n sumofrow[i] += sheet[i][j];\n sumofcolumn[j] += sheet[i][j];\n }",
"sumofrow[i] += sheet[i][j]",
"sumofrow[i]",
"sumofrow",
"i",
"sheet[i][j]",
"sheet[i]",
"sheet",
"i",
"j",
"sumofcolumn[j] += sheet[i][j]",
"sumofcolumn[j]",
"sumofcolumn",
"j",
"sheet[i][j]",
"sheet[i]",
"sheet",
"i",
"j",
"for (int i = 0; i < r; i++) {\n for (int j = 0; j < c; j++) {\n out.print(sheet[i][j] + \" \");\n }\n out.println(sumofrow[i]);\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < r",
"i",
"r",
"i++",
"i++",
"i",
"{\n for (int j = 0; j < c; j++) {\n out.print(sheet[i][j] + \" \");\n }\n out.println(sumofrow[i]);\n }",
"{\n for (int j = 0; j < c; j++) {\n out.print(sheet[i][j] + \" \");\n }\n out.println(sumofrow[i]);\n }",
"for (int j = 0; j < c; j++) {\n out.print(sheet[i][j] + \" \");\n }",
"int j = 0;",
"int j = 0;",
"j",
"0",
"j < c",
"j",
"c",
"j++",
"j++",
"j",
"{\n out.print(sheet[i][j] + \" \");\n }",
"{\n out.print(sheet[i][j] + \" \");\n }",
"out.print(sheet[i][j] + \" \")",
"out.print",
"out",
"sheet[i][j] + \" \"",
"sheet[i][j]",
"sheet[i]",
"sheet",
"i",
"j",
"\" \"",
"out.println(sumofrow[i])",
"out.println",
"out",
"sumofrow[i]",
"sumofrow",
"i",
"for (int i = 0; i < c; i++) {\n out.print(sumofcolumn[i] + \" \");\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < c",
"i",
"c",
"i++",
"i++",
"i",
"{\n out.print(sumofcolumn[i] + \" \");\n }",
"{\n out.print(sumofcolumn[i] + \" \");\n }",
"out.print(sumofcolumn[i] + \" \")",
"out.print",
"out",
"sumofcolumn[i] + \" \"",
"sumofcolumn[i]",
"sumofcolumn",
"i",
"\" \"",
"out.println(sum)",
"out.println",
"out",
"sum",
"static class InputReader {\n public BufferedReader br;\n public StringTokenizer st;\n\n public InputReader(InputStream stream) {\n br = new BufferedReader(new InputStreamReader(stream));\n }\n\n public int nextInt() throws IOException {\n while (st == null || !st.hasMoreTokens()) {\n st = new StringTokenizer(br.readLine());\n }\n return Integer.parseInt(st.nextToken());\n }\n\n public long nextLong() throws IOException {\n while (st == null || !st.hasMoreTokens()) {\n st = new StringTokenizer(br.readLine());\n }\n return Long.parseLong(st.nextToken());\n }\n\n public String next() throws IOException {\n while (st == null || !st.hasMoreTokens()) {\n st = new StringTokenizer(br.readLine());\n }\n return st.nextToken();\n }\n\n public double nextDouble() throws IOException {\n while (st == null || !st.hasMoreTokens()) {\n st = new StringTokenizer(br.readLine());\n }\n return Double.parseDouble(st.nextToken());\n }\n\n\n }",
"InputReader",
"public BufferedReader br;",
"br",
"public StringTokenizer st;",
"st",
"public InputReader(InputStream stream) {\n br = new BufferedReader(new InputStreamReader(stream));\n }",
"InputReader",
"{\n br = new BufferedReader(new InputStreamReader(stream));\n }",
"br = new BufferedReader(new InputStreamReader(stream))",
"br",
"new BufferedReader(new InputStreamReader(stream))",
"InputStream stream",
"stream",
"public int nextInt() throws IOException {\n while (st == null || !st.hasMoreTokens()) {\n st = new StringTokenizer(br.readLine());\n }\n return Integer.parseInt(st.nextToken());\n }",
"nextInt",
"{\n while (st == null || !st.hasMoreTokens()) {\n st = new StringTokenizer(br.readLine());\n }\n return Integer.parseInt(st.nextToken());\n }",
"while (st == null || !st.hasMoreTokens()) {\n st = new StringTokenizer(br.readLine());\n }",
"st == null || !st.hasMoreTokens()",
"st == null",
"st",
"null",
"!st.hasMoreTokens()",
"st.hasMoreTokens()",
"st.hasMoreTokens",
"st",
"{\n st = new StringTokenizer(br.readLine());\n }",
"st = new StringTokenizer(br.readLine())",
"st",
"new StringTokenizer(br.readLine())",
"return Integer.parseInt(st.nextToken());",
"Integer.parseInt(st.nextToken())",
"Integer.parseInt",
"Integer",
"st.nextToken()",
"st.nextToken",
"st",
"public long nextLong() throws IOException {\n while (st == null || !st.hasMoreTokens()) {\n st = new StringTokenizer(br.readLine());\n }\n return Long.parseLong(st.nextToken());\n }",
"nextLong",
"{\n while (st == null || !st.hasMoreTokens()) {\n st = new StringTokenizer(br.readLine());\n }\n return Long.parseLong(st.nextToken());\n }",
"while (st == null || !st.hasMoreTokens()) {\n st = new StringTokenizer(br.readLine());\n }",
"st == null || !st.hasMoreTokens()",
"st == null",
"st",
"null",
"!st.hasMoreTokens()",
"st.hasMoreTokens()",
"st.hasMoreTokens",
"st",
"{\n st = new StringTokenizer(br.readLine());\n }",
"st = new StringTokenizer(br.readLine())",
"st",
"new StringTokenizer(br.readLine())",
"return Long.parseLong(st.nextToken());",
"Long.parseLong(st.nextToken())",
"Long.parseLong",
"Long",
"st.nextToken()",
"st.nextToken",
"st",
"public String next() throws IOException {\n while (st == null || !st.hasMoreTokens()) {\n st = new StringTokenizer(br.readLine());\n }\n return st.nextToken();\n }",
"next",
"{\n while (st == null || !st.hasMoreTokens()) {\n st = new StringTokenizer(br.readLine());\n }\n return st.nextToken();\n }",
"while (st == null || !st.hasMoreTokens()) {\n st = new StringTokenizer(br.readLine());\n }",
"st == null || !st.hasMoreTokens()",
"st == null",
"st",
"null",
"!st.hasMoreTokens()",
"st.hasMoreTokens()",
"st.hasMoreTokens",
"st",
"{\n st = new StringTokenizer(br.readLine());\n }",
"st = new StringTokenizer(br.readLine())",
"st",
"new StringTokenizer(br.readLine())",
"return st.nextToken();",
"st.nextToken()",
"st.nextToken",
"st",
"public double nextDouble() throws IOException {\n while (st == null || !st.hasMoreTokens()) {\n st = new StringTokenizer(br.readLine());\n }\n return Double.parseDouble(st.nextToken());\n }",
"nextDouble",
"{\n while (st == null || !st.hasMoreTokens()) {\n st = new StringTokenizer(br.readLine());\n }\n return Double.parseDouble(st.nextToken());\n }",
"while (st == null || !st.hasMoreTokens()) {\n st = new StringTokenizer(br.readLine());\n }",
"st == null || !st.hasMoreTokens()",
"st == null",
"st",
"null",
"!st.hasMoreTokens()",
"st.hasMoreTokens()",
"st.hasMoreTokens",
"st",
"{\n st = new StringTokenizer(br.readLine());\n }",
"st = new StringTokenizer(br.readLine())",
"st",
"new StringTokenizer(br.readLine())",
"return Double.parseDouble(st.nextToken());",
"Double.parseDouble(st.nextToken())",
"Double.parseDouble",
"Double",
"st.nextToken()",
"st.nextToken",
"st",
"public class Main {\n static InputReader in;\n static PrintWriter out;\n\n static class Solution {\n void solve() throws IOException {\n int r = in.nextInt();\n int c = in.nextInt();\n int sum = 0;\n int[][] sheet = new int[r][c]; \n int[] sumofrow = new int[r];\n int[] sumofcolumn = new int[c];\n \n for (int i = 0; i < r; i++) {\n for (int j = 0; j < c; j++) {\n sheet[i][j] = in.nextInt();\n sum += sheet[i][j];\n }\n }\n \n for (int i = 0; i < r; i++) {\n for (int j = 0; j < c; j++) {\n sumofrow[i] += sheet[i][j];\n sumofcolumn[j] += sheet[i][j];\n }\n }\n \n for (int i = 0; i < r; i++) {\n for (int j = 0; j < c; j++) {\n out.print(sheet[i][j] + \" \");\n }\n out.println(sumofrow[i]);\n }\n \n for (int i = 0; i < c; i++) {\n out.print(sumofcolumn[i] + \" \");\n }\n \n out.println(sum);\n \n// End solve()\n }\n// End Solution\n}\n\n public static void main(String[] args) throws IOException {\n in = new InputReader(System.in);\n out = new PrintWriter(System.out);\n Solution solver = new Solution();\n solver.solve();\n out.close();\n}\n\n static class InputReader {\n public BufferedReader br;\n public StringTokenizer st;\n\n public InputReader(InputStream stream) {\n br = new BufferedReader(new InputStreamReader(stream));\n }\n\n public int nextInt() throws IOException {\n while (st == null || !st.hasMoreTokens()) {\n st = new StringTokenizer(br.readLine());\n }\n return Integer.parseInt(st.nextToken());\n }\n\n public long nextLong() throws IOException {\n while (st == null || !st.hasMoreTokens()) {\n st = new StringTokenizer(br.readLine());\n }\n return Long.parseLong(st.nextToken());\n }\n\n public String next() throws IOException {\n while (st == null || !st.hasMoreTokens()) {\n st = new StringTokenizer(br.readLine());\n }\n return st.nextToken();\n }\n\n public double nextDouble() throws IOException {\n while (st == null || !st.hasMoreTokens()) {\n st = new StringTokenizer(br.readLine());\n }\n return Double.parseDouble(st.nextToken());\n }\n\n\n }\n\n}",
"public class Main {\n static InputReader in;\n static PrintWriter out;\n\n static class Solution {\n void solve() throws IOException {\n int r = in.nextInt();\n int c = in.nextInt();\n int sum = 0;\n int[][] sheet = new int[r][c]; \n int[] sumofrow = new int[r];\n int[] sumofcolumn = new int[c];\n \n for (int i = 0; i < r; i++) {\n for (int j = 0; j < c; j++) {\n sheet[i][j] = in.nextInt();\n sum += sheet[i][j];\n }\n }\n \n for (int i = 0; i < r; i++) {\n for (int j = 0; j < c; j++) {\n sumofrow[i] += sheet[i][j];\n sumofcolumn[j] += sheet[i][j];\n }\n }\n \n for (int i = 0; i < r; i++) {\n for (int j = 0; j < c; j++) {\n out.print(sheet[i][j] + \" \");\n }\n out.println(sumofrow[i]);\n }\n \n for (int i = 0; i < c; i++) {\n out.print(sumofcolumn[i] + \" \");\n }\n \n out.println(sum);\n \n// End solve()\n }\n// End Solution\n}\n\n public static void main(String[] args) throws IOException {\n in = new InputReader(System.in);\n out = new PrintWriter(System.out);\n Solution solver = new Solution();\n solver.solve();\n out.close();\n}\n\n static class InputReader {\n public BufferedReader br;\n public StringTokenizer st;\n\n public InputReader(InputStream stream) {\n br = new BufferedReader(new InputStreamReader(stream));\n }\n\n public int nextInt() throws IOException {\n while (st == null || !st.hasMoreTokens()) {\n st = new StringTokenizer(br.readLine());\n }\n return Integer.parseInt(st.nextToken());\n }\n\n public long nextLong() throws IOException {\n while (st == null || !st.hasMoreTokens()) {\n st = new StringTokenizer(br.readLine());\n }\n return Long.parseLong(st.nextToken());\n }\n\n public String next() throws IOException {\n while (st == null || !st.hasMoreTokens()) {\n st = new StringTokenizer(br.readLine());\n }\n return st.nextToken();\n }\n\n public double nextDouble() throws IOException {\n while (st == null || !st.hasMoreTokens()) {\n st = new StringTokenizer(br.readLine());\n }\n return Double.parseDouble(st.nextToken());\n }\n\n\n }\n\n}",
"Main"
] | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.StringTokenizer;
public class Main {
static InputReader in;
static PrintWriter out;
static class Solution {
void solve() throws IOException {
int r = in.nextInt();
int c = in.nextInt();
int sum = 0;
int[][] sheet = new int[r][c];
int[] sumofrow = new int[r];
int[] sumofcolumn = new int[c];
for (int i = 0; i < r; i++) {
for (int j = 0; j < c; j++) {
sheet[i][j] = in.nextInt();
sum += sheet[i][j];
}
}
for (int i = 0; i < r; i++) {
for (int j = 0; j < c; j++) {
sumofrow[i] += sheet[i][j];
sumofcolumn[j] += sheet[i][j];
}
}
for (int i = 0; i < r; i++) {
for (int j = 0; j < c; j++) {
out.print(sheet[i][j] + " ");
}
out.println(sumofrow[i]);
}
for (int i = 0; i < c; i++) {
out.print(sumofcolumn[i] + " ");
}
out.println(sum);
// End solve()
}
// End Solution
}
public static void main(String[] args) throws IOException {
in = new InputReader(System.in);
out = new PrintWriter(System.out);
Solution solver = new Solution();
solver.solve();
out.close();
}
static class InputReader {
public BufferedReader br;
public StringTokenizer st;
public InputReader(InputStream stream) {
br = new BufferedReader(new InputStreamReader(stream));
}
public int nextInt() throws IOException {
while (st == null || !st.hasMoreTokens()) {
st = new StringTokenizer(br.readLine());
}
return Integer.parseInt(st.nextToken());
}
public long nextLong() throws IOException {
while (st == null || !st.hasMoreTokens()) {
st = new StringTokenizer(br.readLine());
}
return Long.parseLong(st.nextToken());
}
public String next() throws IOException {
while (st == null || !st.hasMoreTokens()) {
st = new StringTokenizer(br.readLine());
}
return st.nextToken();
}
public double nextDouble() throws IOException {
while (st == null || !st.hasMoreTokens()) {
st = new StringTokenizer(br.readLine());
}
return Double.parseDouble(st.nextToken());
}
}
} |
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
41,
13,
20,
2,
13,
17,
2,
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,
18,
18,
13,
13,
13,
4,
18,
13,
0,
13,
18,
18,
13,
13,
13,
0,
18,
18,
13,
13,
13,
13,
11,
1,
41,
13,
17,
2,
13,
2,
13,
17,
1,
40,
13,
30,
30,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
2,
13,
17,
1,
40,
13,
30,
30,
0,
13,
18,
18,
13,
13,
13,
0,
18,
18,
13,
13,
13,
13,
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,
14,
2,
13,
13,
30,
4,
18,
18,
13,
13,
2,
18,
18,
13,
13,
13,
17,
30,
4,
18,
18,
13,
13,
18,
18,
13,
13,
13,
4,
18,
18,
13,
13,
4,
18,
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
],
[
19,
20
],
[
20,
21
],
[
8,
22
],
[
22,
23
],
[
22,
24
],
[
25,
26
],
[
25,
27
],
[
28,
29
],
[
28,
30
],
[
8,
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
],
[
44,
46
],
[
43,
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
],
[
61,
65
],
[
60,
66
],
[
66,
67
],
[
67,
68
],
[
59,
69
],
[
69,
70
],
[
69,
71
],
[
71,
72
],
[
72,
73
],
[
72,
74
],
[
71,
75
],
[
43,
76
],
[
76,
77
],
[
77,
78
],
[
78,
79
],
[
78,
80
],
[
77,
81
],
[
76,
82
],
[
8,
83
],
[
83,
84
],
[
84,
85
],
[
85,
86
],
[
85,
87
],
[
83,
88
],
[
88,
89
],
[
88,
90
],
[
90,
91
],
[
90,
92
],
[
83,
93
],
[
93,
94
],
[
94,
95
],
[
83,
96
],
[
97,
97
],
[
97,
98
],
[
98,
99
],
[
98,
100
],
[
97,
101
],
[
101,
102
],
[
102,
103
],
[
103,
104
],
[
103,
105
],
[
101,
106
],
[
106,
107
],
[
106,
108
],
[
108,
109
],
[
108,
110
],
[
101,
111
],
[
111,
112
],
[
112,
113
],
[
101,
114
],
[
115,
115
],
[
115,
116
],
[
116,
117
],
[
116,
118
],
[
118,
119
],
[
119,
120
],
[
119,
121
],
[
118,
122
],
[
97,
123
],
[
123,
124
],
[
124,
125
],
[
125,
126
],
[
125,
127
],
[
124,
128
],
[
123,
129
],
[
8,
130
],
[
130,
131
],
[
131,
132
],
[
132,
133
],
[
132,
134
],
[
130,
135
],
[
135,
136
],
[
135,
137
],
[
137,
138
],
[
137,
139
],
[
130,
140
],
[
140,
141
],
[
141,
142
],
[
130,
143
],
[
144,
144
],
[
144,
145
],
[
145,
146
],
[
146,
147
],
[
147,
148
],
[
147,
149
],
[
145,
150
],
[
150,
151
],
[
150,
152
],
[
152,
153
],
[
152,
154
],
[
145,
155
],
[
155,
156
],
[
156,
157
],
[
145,
158
],
[
159,
159
],
[
159,
160
],
[
160,
161
],
[
161,
162
],
[
161,
163
],
[
160,
164
],
[
164,
165
],
[
165,
166
],
[
166,
167
],
[
167,
168
],
[
167,
169
],
[
165,
170
],
[
170,
171
],
[
171,
172
],
[
172,
173
],
[
172,
174
],
[
171,
175
],
[
170,
176
],
[
160,
177
],
[
177,
178
],
[
178,
179
],
[
179,
180
],
[
180,
181
],
[
180,
182
],
[
178,
183
],
[
183,
184
],
[
184,
185
],
[
184,
186
],
[
183,
187
],
[
144,
188
],
[
188,
189
],
[
189,
190
],
[
190,
191
],
[
190,
192
],
[
8,
193
],
[
193,
194
],
[
194,
195
],
[
6,
196
],
[
196,
197
],
[
0,
198
],
[
198,
199
],
[
198,
200
]
] | [
"import java.util.Scanner;\n\npublic class Main {\n\n\tpublic static void main(String[] args) {\n\t\tScanner scanner = new Scanner(System.in);\n\t\tint r = scanner.nextInt();\n\t\tint c = scanner.nextInt();\n\t\tint[][] arr = new int[r+1][c+1];\n\t\tfor(int i=0;i<r;i++) {\n\t\t\tint sumX = 0;\n\t\t\tfor(int j=0;j<c;j++) {\n\t\t\t\tarr[i][j] = scanner.nextInt();\n\t\t\t\tsumX += arr[i][j];\n\t\t\t}\n\t\t\tarr[i][c] = sumX;\n\t\t}\n\t\tfor(int i=0;i<c+1;i++) {\n\t\t\tint sumY = 0;\n\t\t\tfor(int j=0;j<r+1;j++) {\n\t\t\t\tsumY += arr[j][i];\n\t\t\t}\n\t\t\tarr[r][i] = sumY;\n\t\t}\n\t\t\n\t\tfor(int i=0;i<r+1;i++) {\n\t\t\tfor(int j=0;j<c+1;j++) {\n\t\t\t\tif (j!=c) {\n\t\t\t\t\tSystem.out.print(arr[i][j] + \" \");\n\t\t\t\t}else {\n\t\t\t\t\tSystem.out.print(arr[i][j]);\n\t\t\t\t}\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}\n\t\tscanner.close();\n\t}\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n\n\tpublic static void main(String[] args) {\n\t\tScanner scanner = new Scanner(System.in);\n\t\tint r = scanner.nextInt();\n\t\tint c = scanner.nextInt();\n\t\tint[][] arr = new int[r+1][c+1];\n\t\tfor(int i=0;i<r;i++) {\n\t\t\tint sumX = 0;\n\t\t\tfor(int j=0;j<c;j++) {\n\t\t\t\tarr[i][j] = scanner.nextInt();\n\t\t\t\tsumX += arr[i][j];\n\t\t\t}\n\t\t\tarr[i][c] = sumX;\n\t\t}\n\t\tfor(int i=0;i<c+1;i++) {\n\t\t\tint sumY = 0;\n\t\t\tfor(int j=0;j<r+1;j++) {\n\t\t\t\tsumY += arr[j][i];\n\t\t\t}\n\t\t\tarr[r][i] = sumY;\n\t\t}\n\t\t\n\t\tfor(int i=0;i<r+1;i++) {\n\t\t\tfor(int j=0;j<c+1;j++) {\n\t\t\t\tif (j!=c) {\n\t\t\t\t\tSystem.out.print(arr[i][j] + \" \");\n\t\t\t\t}else {\n\t\t\t\t\tSystem.out.print(arr[i][j]);\n\t\t\t\t}\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}\n\t\tscanner.close();\n\t}\n}",
"Main",
"public static void main(String[] args) {\n\t\tScanner scanner = new Scanner(System.in);\n\t\tint r = scanner.nextInt();\n\t\tint c = scanner.nextInt();\n\t\tint[][] arr = new int[r+1][c+1];\n\t\tfor(int i=0;i<r;i++) {\n\t\t\tint sumX = 0;\n\t\t\tfor(int j=0;j<c;j++) {\n\t\t\t\tarr[i][j] = scanner.nextInt();\n\t\t\t\tsumX += arr[i][j];\n\t\t\t}\n\t\t\tarr[i][c] = sumX;\n\t\t}\n\t\tfor(int i=0;i<c+1;i++) {\n\t\t\tint sumY = 0;\n\t\t\tfor(int j=0;j<r+1;j++) {\n\t\t\t\tsumY += arr[j][i];\n\t\t\t}\n\t\t\tarr[r][i] = sumY;\n\t\t}\n\t\t\n\t\tfor(int i=0;i<r+1;i++) {\n\t\t\tfor(int j=0;j<c+1;j++) {\n\t\t\t\tif (j!=c) {\n\t\t\t\t\tSystem.out.print(arr[i][j] + \" \");\n\t\t\t\t}else {\n\t\t\t\t\tSystem.out.print(arr[i][j]);\n\t\t\t\t}\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}\n\t\tscanner.close();\n\t}",
"main",
"{\n\t\tScanner scanner = new Scanner(System.in);\n\t\tint r = scanner.nextInt();\n\t\tint c = scanner.nextInt();\n\t\tint[][] arr = new int[r+1][c+1];\n\t\tfor(int i=0;i<r;i++) {\n\t\t\tint sumX = 0;\n\t\t\tfor(int j=0;j<c;j++) {\n\t\t\t\tarr[i][j] = scanner.nextInt();\n\t\t\t\tsumX += arr[i][j];\n\t\t\t}\n\t\t\tarr[i][c] = sumX;\n\t\t}\n\t\tfor(int i=0;i<c+1;i++) {\n\t\t\tint sumY = 0;\n\t\t\tfor(int j=0;j<r+1;j++) {\n\t\t\t\tsumY += arr[j][i];\n\t\t\t}\n\t\t\tarr[r][i] = sumY;\n\t\t}\n\t\t\n\t\tfor(int i=0;i<r+1;i++) {\n\t\t\tfor(int j=0;j<c+1;j++) {\n\t\t\t\tif (j!=c) {\n\t\t\t\t\tSystem.out.print(arr[i][j] + \" \");\n\t\t\t\t}else {\n\t\t\t\t\tSystem.out.print(arr[i][j]);\n\t\t\t\t}\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}\n\t\tscanner.close();\n\t}",
"Scanner scanner = new Scanner(System.in);",
"scanner",
"new Scanner(System.in)",
"int r = scanner.nextInt();",
"r",
"scanner.nextInt()",
"scanner.nextInt",
"scanner",
"int c = scanner.nextInt();",
"c",
"scanner.nextInt()",
"scanner.nextInt",
"scanner",
"int[][] arr = new int[r+1][c+1];",
"arr",
"new int[r+1][c+1]",
"r+1",
"r",
"1",
"c+1",
"c",
"1",
"for(int i=0;i<r;i++) {\n\t\t\tint sumX = 0;\n\t\t\tfor(int j=0;j<c;j++) {\n\t\t\t\tarr[i][j] = scanner.nextInt();\n\t\t\t\tsumX += arr[i][j];\n\t\t\t}\n\t\t\tarr[i][c] = sumX;\n\t\t}",
"int i=0;",
"int i=0;",
"i",
"0",
"i<r",
"i",
"r",
"i++",
"i++",
"i",
"{\n\t\t\tint sumX = 0;\n\t\t\tfor(int j=0;j<c;j++) {\n\t\t\t\tarr[i][j] = scanner.nextInt();\n\t\t\t\tsumX += arr[i][j];\n\t\t\t}\n\t\t\tarr[i][c] = sumX;\n\t\t}",
"{\n\t\t\tint sumX = 0;\n\t\t\tfor(int j=0;j<c;j++) {\n\t\t\t\tarr[i][j] = scanner.nextInt();\n\t\t\t\tsumX += arr[i][j];\n\t\t\t}\n\t\t\tarr[i][c] = sumX;\n\t\t}",
"int sumX = 0;",
"sumX",
"0",
"for(int j=0;j<c;j++) {\n\t\t\t\tarr[i][j] = scanner.nextInt();\n\t\t\t\tsumX += arr[i][j];\n\t\t\t}",
"int j=0;",
"int j=0;",
"j",
"0",
"j<c",
"j",
"c",
"j++",
"j++",
"j",
"{\n\t\t\t\tarr[i][j] = scanner.nextInt();\n\t\t\t\tsumX += arr[i][j];\n\t\t\t}",
"{\n\t\t\t\tarr[i][j] = scanner.nextInt();\n\t\t\t\tsumX += arr[i][j];\n\t\t\t}",
"arr[i][j] = scanner.nextInt()",
"arr[i][j]",
"arr[i]",
"arr",
"i",
"j",
"scanner.nextInt()",
"scanner.nextInt",
"scanner",
"sumX += arr[i][j]",
"sumX",
"arr[i][j]",
"arr[i]",
"arr",
"i",
"j",
"arr[i][c] = sumX",
"arr[i][c]",
"arr[i]",
"arr",
"i",
"c",
"sumX",
"for(int i=0;i<c+1;i++) {\n\t\t\tint sumY = 0;\n\t\t\tfor(int j=0;j<r+1;j++) {\n\t\t\t\tsumY += arr[j][i];\n\t\t\t}\n\t\t\tarr[r][i] = sumY;\n\t\t}",
"int i=0;",
"int i=0;",
"i",
"0",
"i<c+1",
"i",
"c+1",
"c",
"1",
"i++",
"i++",
"i",
"{\n\t\t\tint sumY = 0;\n\t\t\tfor(int j=0;j<r+1;j++) {\n\t\t\t\tsumY += arr[j][i];\n\t\t\t}\n\t\t\tarr[r][i] = sumY;\n\t\t}",
"{\n\t\t\tint sumY = 0;\n\t\t\tfor(int j=0;j<r+1;j++) {\n\t\t\t\tsumY += arr[j][i];\n\t\t\t}\n\t\t\tarr[r][i] = sumY;\n\t\t}",
"int sumY = 0;",
"sumY",
"0",
"for(int j=0;j<r+1;j++) {\n\t\t\t\tsumY += arr[j][i];\n\t\t\t}",
"int j=0;",
"int j=0;",
"j",
"0",
"j<r+1",
"j",
"r+1",
"r",
"1",
"j++",
"j++",
"j",
"{\n\t\t\t\tsumY += arr[j][i];\n\t\t\t}",
"{\n\t\t\t\tsumY += arr[j][i];\n\t\t\t}",
"sumY += arr[j][i]",
"sumY",
"arr[j][i]",
"arr[j]",
"arr",
"j",
"i",
"arr[r][i] = sumY",
"arr[r][i]",
"arr[r]",
"arr",
"r",
"i",
"sumY",
"for(int i=0;i<r+1;i++) {\n\t\t\tfor(int j=0;j<c+1;j++) {\n\t\t\t\tif (j!=c) {\n\t\t\t\t\tSystem.out.print(arr[i][j] + \" \");\n\t\t\t\t}else {\n\t\t\t\t\tSystem.out.print(arr[i][j]);\n\t\t\t\t}\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}",
"int i=0;",
"int i=0;",
"i",
"0",
"i<r+1",
"i",
"r+1",
"r",
"1",
"i++",
"i++",
"i",
"{\n\t\t\tfor(int j=0;j<c+1;j++) {\n\t\t\t\tif (j!=c) {\n\t\t\t\t\tSystem.out.print(arr[i][j] + \" \");\n\t\t\t\t}else {\n\t\t\t\t\tSystem.out.print(arr[i][j]);\n\t\t\t\t}\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}",
"{\n\t\t\tfor(int j=0;j<c+1;j++) {\n\t\t\t\tif (j!=c) {\n\t\t\t\t\tSystem.out.print(arr[i][j] + \" \");\n\t\t\t\t}else {\n\t\t\t\t\tSystem.out.print(arr[i][j]);\n\t\t\t\t}\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}",
"for(int j=0;j<c+1;j++) {\n\t\t\t\tif (j!=c) {\n\t\t\t\t\tSystem.out.print(arr[i][j] + \" \");\n\t\t\t\t}else {\n\t\t\t\t\tSystem.out.print(arr[i][j]);\n\t\t\t\t}\n\t\t\t}",
"int j=0;",
"int j=0;",
"j",
"0",
"j<c+1",
"j",
"c+1",
"c",
"1",
"j++",
"j++",
"j",
"{\n\t\t\t\tif (j!=c) {\n\t\t\t\t\tSystem.out.print(arr[i][j] + \" \");\n\t\t\t\t}else {\n\t\t\t\t\tSystem.out.print(arr[i][j]);\n\t\t\t\t}\n\t\t\t}",
"{\n\t\t\t\tif (j!=c) {\n\t\t\t\t\tSystem.out.print(arr[i][j] + \" \");\n\t\t\t\t}else {\n\t\t\t\t\tSystem.out.print(arr[i][j]);\n\t\t\t\t}\n\t\t\t}",
"if (j!=c) {\n\t\t\t\t\tSystem.out.print(arr[i][j] + \" \");\n\t\t\t\t}else {\n\t\t\t\t\tSystem.out.print(arr[i][j]);\n\t\t\t\t}",
"j!=c",
"j",
"c",
"{\n\t\t\t\t\tSystem.out.print(arr[i][j] + \" \");\n\t\t\t\t}",
"System.out.print(arr[i][j] + \" \")",
"System.out.print",
"System.out",
"System",
"System.out",
"arr[i][j] + \" \"",
"arr[i][j]",
"arr[i]",
"arr",
"i",
"j",
"\" \"",
"{\n\t\t\t\t\tSystem.out.print(arr[i][j]);\n\t\t\t\t}",
"System.out.print(arr[i][j])",
"System.out.print",
"System.out",
"System",
"System.out",
"arr[i][j]",
"arr[i]",
"arr",
"i",
"j",
"System.out.println()",
"System.out.println",
"System.out",
"System",
"System.out",
"scanner.close()",
"scanner.close",
"scanner",
"String[] args",
"args",
"public class Main {\n\n\tpublic static void main(String[] args) {\n\t\tScanner scanner = new Scanner(System.in);\n\t\tint r = scanner.nextInt();\n\t\tint c = scanner.nextInt();\n\t\tint[][] arr = new int[r+1][c+1];\n\t\tfor(int i=0;i<r;i++) {\n\t\t\tint sumX = 0;\n\t\t\tfor(int j=0;j<c;j++) {\n\t\t\t\tarr[i][j] = scanner.nextInt();\n\t\t\t\tsumX += arr[i][j];\n\t\t\t}\n\t\t\tarr[i][c] = sumX;\n\t\t}\n\t\tfor(int i=0;i<c+1;i++) {\n\t\t\tint sumY = 0;\n\t\t\tfor(int j=0;j<r+1;j++) {\n\t\t\t\tsumY += arr[j][i];\n\t\t\t}\n\t\t\tarr[r][i] = sumY;\n\t\t}\n\t\t\n\t\tfor(int i=0;i<r+1;i++) {\n\t\t\tfor(int j=0;j<c+1;j++) {\n\t\t\t\tif (j!=c) {\n\t\t\t\t\tSystem.out.print(arr[i][j] + \" \");\n\t\t\t\t}else {\n\t\t\t\t\tSystem.out.print(arr[i][j]);\n\t\t\t\t}\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}\n\t\tscanner.close();\n\t}\n}",
"public class Main {\n\n\tpublic static void main(String[] args) {\n\t\tScanner scanner = new Scanner(System.in);\n\t\tint r = scanner.nextInt();\n\t\tint c = scanner.nextInt();\n\t\tint[][] arr = new int[r+1][c+1];\n\t\tfor(int i=0;i<r;i++) {\n\t\t\tint sumX = 0;\n\t\t\tfor(int j=0;j<c;j++) {\n\t\t\t\tarr[i][j] = scanner.nextInt();\n\t\t\t\tsumX += arr[i][j];\n\t\t\t}\n\t\t\tarr[i][c] = sumX;\n\t\t}\n\t\tfor(int i=0;i<c+1;i++) {\n\t\t\tint sumY = 0;\n\t\t\tfor(int j=0;j<r+1;j++) {\n\t\t\t\tsumY += arr[j][i];\n\t\t\t}\n\t\t\tarr[r][i] = sumY;\n\t\t}\n\t\t\n\t\tfor(int i=0;i<r+1;i++) {\n\t\t\tfor(int j=0;j<c+1;j++) {\n\t\t\t\tif (j!=c) {\n\t\t\t\t\tSystem.out.print(arr[i][j] + \" \");\n\t\t\t\t}else {\n\t\t\t\t\tSystem.out.print(arr[i][j]);\n\t\t\t\t}\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}\n\t\tscanner.close();\n\t}\n}",
"Main"
] | import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
int r = scanner.nextInt();
int c = scanner.nextInt();
int[][] arr = new int[r+1][c+1];
for(int i=0;i<r;i++) {
int sumX = 0;
for(int j=0;j<c;j++) {
arr[i][j] = scanner.nextInt();
sumX += arr[i][j];
}
arr[i][c] = sumX;
}
for(int i=0;i<c+1;i++) {
int sumY = 0;
for(int j=0;j<r+1;j++) {
sumY += arr[j][i];
}
arr[r][i] = sumY;
}
for(int i=0;i<r+1;i++) {
for(int j=0;j<c+1;j++) {
if (j!=c) {
System.out.print(arr[i][j] + " ");
}else {
System.out.print(arr[i][j]);
}
}
System.out.println();
}
scanner.close();
}
}
|
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
41,
13,
20,
13,
13,
41,
13,
20,
13,
41,
13,
41,
13,
41,
13,
11,
1,
0,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
11,
1,
0,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
18,
18,
13,
13,
13,
4,
18,
13,
11,
1,
0,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
18,
13,
13,
17,
11,
1,
0,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
11,
1,
0,
13,
17,
0,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
4,
18,
18,
13,
13,
2,
18,
18,
13,
13,
13,
17,
0,
18,
13,
13,
18,
18,
13,
13,
13,
0,
13,
18,
18,
13,
13,
13,
4,
18,
18,
13,
13,
13,
11,
1,
0,
13,
17,
0,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
4,
18,
18,
13,
13,
2,
18,
13,
13,
17,
0,
13,
18,
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
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
8,
17
],
[
17,
18
],
[
17,
19
],
[
19,
20
],
[
20,
21
],
[
8,
22
],
[
22,
23
],
[
22,
24
],
[
8,
27
],
[
27,
28
],
[
27,
29
],
[
8,
31
],
[
31,
32
],
[
8,
33
],
[
33,
34
],
[
8,
35
],
[
35,
36
],
[
8,
37
],
[
37,
38
],
[
38,
39
],
[
39,
40
],
[
39,
41
],
[
37,
42
],
[
42,
43
],
[
42,
44
],
[
37,
45
],
[
45,
46
],
[
46,
47
],
[
37,
48
],
[
49,
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
],
[
62,
62
],
[
62,
63
],
[
63,
64
],
[
64,
65
],
[
65,
66
],
[
65,
67
],
[
64,
68
],
[
63,
69
],
[
69,
70
],
[
70,
71
],
[
8,
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
],
[
86,
88
],
[
85,
89
],
[
8,
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
],
[
104,
105
],
[
105,
106
],
[
105,
107
],
[
104,
108
],
[
108,
109
],
[
108,
110
],
[
103,
111
],
[
111,
112
],
[
111,
113
],
[
103,
114
],
[
114,
115
],
[
115,
116
],
[
103,
117
],
[
118,
118
],
[
118,
119
],
[
119,
120
],
[
120,
121
],
[
121,
122
],
[
121,
123
],
[
119,
124
],
[
124,
125
],
[
125,
126
],
[
126,
127
],
[
126,
128
],
[
125,
129
],
[
124,
130
],
[
118,
131
],
[
131,
132
],
[
132,
133
],
[
132,
134
],
[
131,
135
],
[
135,
136
],
[
136,
137
],
[
136,
138
],
[
135,
139
],
[
118,
140
],
[
140,
141
],
[
140,
142
],
[
142,
143
],
[
143,
144
],
[
143,
145
],
[
142,
146
],
[
102,
147
],
[
147,
148
],
[
148,
149
],
[
149,
150
],
[
149,
151
],
[
147,
152
],
[
8,
153
],
[
153,
154
],
[
154,
155
],
[
155,
156
],
[
155,
157
],
[
154,
158
],
[
158,
159
],
[
158,
160
],
[
153,
161
],
[
161,
162
],
[
161,
163
],
[
153,
164
],
[
164,
165
],
[
165,
166
],
[
153,
167
],
[
168,
168
],
[
168,
169
],
[
169,
170
],
[
170,
171
],
[
171,
172
],
[
171,
173
],
[
169,
174
],
[
174,
175
],
[
175,
176
],
[
175,
177
],
[
174,
178
],
[
168,
179
],
[
179,
180
],
[
179,
181
],
[
181,
182
],
[
181,
183
],
[
8,
184
],
[
184,
185
],
[
185,
186
],
[
186,
187
],
[
186,
188
],
[
184,
189
],
[
6,
190
],
[
190,
191
]
] | [
"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 r = sc.nextInt();\n\t\tint c = sc.nextInt();\n\t\tint s[][] = new int[r][c];\n\t\tint cg[] = new int[c];\n\t\tint rg;\n\t\tint i,j;\n\t\tfor( i=0; i<r; i++ ){\n\t\t\tfor( j=0; j<c; j++ ){\n\t\t\t\ts[i][j] = sc.nextInt();\n\t\t\t}\n\t\t}\n\t\tfor( j=0; j<c; j++ ){\n\t\t\tcg[j] = 0;\n\t\t}\n\t\tfor( i=0; i<r; i++ ){\n\t\t\tfor( j=0, rg=0; j<c; j++ ){\n\t\t\t\tSystem.out.print( s[i][j] + \" \" );\n\t\t\t\tcg[j] += s[i][j];\n\t\t\t\trg += s[i][j];\n\t\t\t}\n\t\t\tSystem.out.println( rg );\n\t\t}\n\t\tfor( j=0, rg=0; j<c; j++ ){\n\t\t\tSystem.out.print( cg[j] + \" \" );\n\t\t\trg += cg[j];\n\t\t}\n\t\tSystem.out.println( rg );\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 r = sc.nextInt();\n\t\tint c = sc.nextInt();\n\t\tint s[][] = new int[r][c];\n\t\tint cg[] = new int[c];\n\t\tint rg;\n\t\tint i,j;\n\t\tfor( i=0; i<r; i++ ){\n\t\t\tfor( j=0; j<c; j++ ){\n\t\t\t\ts[i][j] = sc.nextInt();\n\t\t\t}\n\t\t}\n\t\tfor( j=0; j<c; j++ ){\n\t\t\tcg[j] = 0;\n\t\t}\n\t\tfor( i=0; i<r; i++ ){\n\t\t\tfor( j=0, rg=0; j<c; j++ ){\n\t\t\t\tSystem.out.print( s[i][j] + \" \" );\n\t\t\t\tcg[j] += s[i][j];\n\t\t\t\trg += s[i][j];\n\t\t\t}\n\t\t\tSystem.out.println( rg );\n\t\t}\n\t\tfor( j=0, rg=0; j<c; j++ ){\n\t\t\tSystem.out.print( cg[j] + \" \" );\n\t\t\trg += cg[j];\n\t\t}\n\t\tSystem.out.println( rg );\n\t}\n}",
"Main",
"public static void main(String[] args){\n\t\tScanner sc = new Scanner(System.in);\n\t\tint r = sc.nextInt();\n\t\tint c = sc.nextInt();\n\t\tint s[][] = new int[r][c];\n\t\tint cg[] = new int[c];\n\t\tint rg;\n\t\tint i,j;\n\t\tfor( i=0; i<r; i++ ){\n\t\t\tfor( j=0; j<c; j++ ){\n\t\t\t\ts[i][j] = sc.nextInt();\n\t\t\t}\n\t\t}\n\t\tfor( j=0; j<c; j++ ){\n\t\t\tcg[j] = 0;\n\t\t}\n\t\tfor( i=0; i<r; i++ ){\n\t\t\tfor( j=0, rg=0; j<c; j++ ){\n\t\t\t\tSystem.out.print( s[i][j] + \" \" );\n\t\t\t\tcg[j] += s[i][j];\n\t\t\t\trg += s[i][j];\n\t\t\t}\n\t\t\tSystem.out.println( rg );\n\t\t}\n\t\tfor( j=0, rg=0; j<c; j++ ){\n\t\t\tSystem.out.print( cg[j] + \" \" );\n\t\t\trg += cg[j];\n\t\t}\n\t\tSystem.out.println( rg );\n\t}",
"main",
"{\n\t\tScanner sc = new Scanner(System.in);\n\t\tint r = sc.nextInt();\n\t\tint c = sc.nextInt();\n\t\tint s[][] = new int[r][c];\n\t\tint cg[] = new int[c];\n\t\tint rg;\n\t\tint i,j;\n\t\tfor( i=0; i<r; i++ ){\n\t\t\tfor( j=0; j<c; j++ ){\n\t\t\t\ts[i][j] = sc.nextInt();\n\t\t\t}\n\t\t}\n\t\tfor( j=0; j<c; j++ ){\n\t\t\tcg[j] = 0;\n\t\t}\n\t\tfor( i=0; i<r; i++ ){\n\t\t\tfor( j=0, rg=0; j<c; j++ ){\n\t\t\t\tSystem.out.print( s[i][j] + \" \" );\n\t\t\t\tcg[j] += s[i][j];\n\t\t\t\trg += s[i][j];\n\t\t\t}\n\t\t\tSystem.out.println( rg );\n\t\t}\n\t\tfor( j=0, rg=0; j<c; j++ ){\n\t\t\tSystem.out.print( cg[j] + \" \" );\n\t\t\trg += cg[j];\n\t\t}\n\t\tSystem.out.println( rg );\n\t}",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"int r = sc.nextInt();",
"r",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int c = sc.nextInt();",
"c",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int s[][] = new int[r][c];",
"s",
"new int[r][c]",
"r",
"c",
"int cg[] = new int[c];",
"cg",
"new int[c]",
"c",
"int rg;",
"rg",
"int i",
"i",
"j;",
"j",
"for( i=0; i<r; i++ ){\n\t\t\tfor( j=0; j<c; j++ ){\n\t\t\t\ts[i][j] = sc.nextInt();\n\t\t\t}\n\t\t}",
"i=0;",
"i=0",
"i",
"0",
"i<r",
"i",
"r",
"i++",
"i++",
"i",
"{\n\t\t\tfor( j=0; j<c; j++ ){\n\t\t\t\ts[i][j] = sc.nextInt();\n\t\t\t}\n\t\t}",
"{\n\t\t\tfor( j=0; j<c; j++ ){\n\t\t\t\ts[i][j] = sc.nextInt();\n\t\t\t}\n\t\t}",
"for( j=0; j<c; j++ ){\n\t\t\t\ts[i][j] = sc.nextInt();\n\t\t\t}",
"j=0;",
"j=0",
"j",
"0",
"j<c",
"j",
"c",
"j++",
"j++",
"j",
"{\n\t\t\t\ts[i][j] = sc.nextInt();\n\t\t\t}",
"{\n\t\t\t\ts[i][j] = sc.nextInt();\n\t\t\t}",
"s[i][j] = sc.nextInt()",
"s[i][j]",
"s[i]",
"s",
"i",
"j",
"sc.nextInt()",
"sc.nextInt",
"sc",
"for( j=0; j<c; j++ ){\n\t\t\tcg[j] = 0;\n\t\t}",
"j=0;",
"j=0",
"j",
"0",
"j<c",
"j",
"c",
"j++",
"j++",
"j",
"{\n\t\t\tcg[j] = 0;\n\t\t}",
"{\n\t\t\tcg[j] = 0;\n\t\t}",
"cg[j] = 0",
"cg[j]",
"cg",
"j",
"0",
"for( i=0; i<r; i++ ){\n\t\t\tfor( j=0, rg=0; j<c; j++ ){\n\t\t\t\tSystem.out.print( s[i][j] + \" \" );\n\t\t\t\tcg[j] += s[i][j];\n\t\t\t\trg += s[i][j];\n\t\t\t}\n\t\t\tSystem.out.println( rg );\n\t\t}",
"i=0;",
"i=0",
"i",
"0",
"i<r",
"i",
"r",
"i++",
"i++",
"i",
"{\n\t\t\tfor( j=0, rg=0; j<c; j++ ){\n\t\t\t\tSystem.out.print( s[i][j] + \" \" );\n\t\t\t\tcg[j] += s[i][j];\n\t\t\t\trg += s[i][j];\n\t\t\t}\n\t\t\tSystem.out.println( rg );\n\t\t}",
"{\n\t\t\tfor( j=0, rg=0; j<c; j++ ){\n\t\t\t\tSystem.out.print( s[i][j] + \" \" );\n\t\t\t\tcg[j] += s[i][j];\n\t\t\t\trg += s[i][j];\n\t\t\t}\n\t\t\tSystem.out.println( rg );\n\t\t}",
"for( j=0, rg=0; j<c; j++ ){\n\t\t\t\tSystem.out.print( s[i][j] + \" \" );\n\t\t\t\tcg[j] += s[i][j];\n\t\t\t\trg += s[i][j];\n\t\t\t}",
"j=0, rg=0;",
"j=0",
"j",
"0",
"rg=0",
"rg",
"0",
"j<c",
"j",
"c",
"j++",
"j++",
"j",
"{\n\t\t\t\tSystem.out.print( s[i][j] + \" \" );\n\t\t\t\tcg[j] += s[i][j];\n\t\t\t\trg += s[i][j];\n\t\t\t}",
"{\n\t\t\t\tSystem.out.print( s[i][j] + \" \" );\n\t\t\t\tcg[j] += s[i][j];\n\t\t\t\trg += s[i][j];\n\t\t\t}",
"System.out.print( s[i][j] + \" \" )",
"System.out.print",
"System.out",
"System",
"System.out",
"s[i][j] + \" \"",
"s[i][j]",
"s[i]",
"s",
"i",
"j",
"\" \"",
"cg[j] += s[i][j]",
"cg[j]",
"cg",
"j",
"s[i][j]",
"s[i]",
"s",
"i",
"j",
"rg += s[i][j]",
"rg",
"s[i][j]",
"s[i]",
"s",
"i",
"j",
"System.out.println( rg )",
"System.out.println",
"System.out",
"System",
"System.out",
"rg",
"for( j=0, rg=0; j<c; j++ ){\n\t\t\tSystem.out.print( cg[j] + \" \" );\n\t\t\trg += cg[j];\n\t\t}",
"j=0, rg=0;",
"j=0",
"j",
"0",
"rg=0",
"rg",
"0",
"j<c",
"j",
"c",
"j++",
"j++",
"j",
"{\n\t\t\tSystem.out.print( cg[j] + \" \" );\n\t\t\trg += cg[j];\n\t\t}",
"{\n\t\t\tSystem.out.print( cg[j] + \" \" );\n\t\t\trg += cg[j];\n\t\t}",
"System.out.print( cg[j] + \" \" )",
"System.out.print",
"System.out",
"System",
"System.out",
"cg[j] + \" \"",
"cg[j]",
"cg",
"j",
"\" \"",
"rg += cg[j]",
"rg",
"cg[j]",
"cg",
"j",
"System.out.println( rg )",
"System.out.println",
"System.out",
"System",
"System.out",
"rg",
"String[] args",
"args"
] | import java.util.Scanner;
class Main{
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
int r = sc.nextInt();
int c = sc.nextInt();
int s[][] = new int[r][c];
int cg[] = new int[c];
int rg;
int i,j;
for( i=0; i<r; i++ ){
for( j=0; j<c; j++ ){
s[i][j] = sc.nextInt();
}
}
for( j=0; j<c; j++ ){
cg[j] = 0;
}
for( i=0; i<r; i++ ){
for( j=0, rg=0; j<c; j++ ){
System.out.print( s[i][j] + " " );
cg[j] += s[i][j];
rg += s[i][j];
}
System.out.println( rg );
}
for( j=0, rg=0; j<c; j++ ){
System.out.print( cg[j] + " " );
rg += cg[j];
}
System.out.println( rg );
}
} |
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
20,
41,
13,
4,
18,
4,
18,
13,
17,
41,
13,
4,
18,
13,
18,
13,
17,
41,
13,
4,
18,
13,
18,
13,
17,
41,
13,
20,
2,
13,
17,
2,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
4,
18,
4,
18,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
41,
13,
4,
18,
13,
18,
13,
13,
0,
18,
18,
13,
13,
13,
13,
0,
18,
18,
13,
13,
13,
13,
0,
18,
18,
13,
13,
13,
13,
0,
18,
18,
13,
13,
13,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
4,
18,
13,
2,
17,
18,
18,
13,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
4,
18,
13,
2,
17,
18,
18,
13,
13,
13,
4,
18,
13,
4,
18,
13,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
10,
11
],
[
10,
12
],
[
0,
13
],
[
13,
14
],
[
13,
15
],
[
0,
16
],
[
185,
17
],
[
185,
18
],
[
18,
19
],
[
18,
20
],
[
20,
21
],
[
21,
22
],
[
21,
23
],
[
20,
24
],
[
24,
25
],
[
24,
26
],
[
20,
27
],
[
27,
28
],
[
27,
29
],
[
29,
30
],
[
30,
31
],
[
31,
32
],
[
32,
33
],
[
29,
34
],
[
20,
35
],
[
35,
36
],
[
35,
37
],
[
37,
38
],
[
38,
39
],
[
37,
40
],
[
40,
41
],
[
40,
42
],
[
20,
43
],
[
43,
44
],
[
43,
45
],
[
45,
46
],
[
46,
47
],
[
45,
48
],
[
48,
49
],
[
48,
50
],
[
20,
51
],
[
51,
52
],
[
51,
53
],
[
54,
55
],
[
54,
56
],
[
57,
58
],
[
57,
59
],
[
20,
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
],
[
76,
77
],
[
77,
78
],
[
78,
79
],
[
75,
80
],
[
72,
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
],
[
94,
96
],
[
96,
97
],
[
97,
98
],
[
96,
99
],
[
99,
100
],
[
99,
101
],
[
93,
102
],
[
102,
103
],
[
103,
104
],
[
104,
105
],
[
104,
106
],
[
103,
107
],
[
102,
108
],
[
93,
109
],
[
109,
110
],
[
110,
111
],
[
111,
112
],
[
111,
113
],
[
110,
114
],
[
109,
115
],
[
93,
116
],
[
116,
117
],
[
117,
118
],
[
118,
119
],
[
118,
120
],
[
117,
121
],
[
116,
122
],
[
93,
123
],
[
123,
124
],
[
124,
125
],
[
125,
126
],
[
125,
127
],
[
124,
128
],
[
123,
129
],
[
20,
130
],
[
130,
131
],
[
131,
132
],
[
132,
133
],
[
132,
134
],
[
130,
135
],
[
135,
136
],
[
135,
137
],
[
130,
138
],
[
138,
139
],
[
139,
140
],
[
130,
141
],
[
142,
142
],
[
142,
143
],
[
143,
144
],
[
144,
145
],
[
143,
146
],
[
146,
147
],
[
146,
148
],
[
148,
149
],
[
149,
150
],
[
149,
151
],
[
148,
152
],
[
142,
153
],
[
153,
154
],
[
154,
155
],
[
155,
156
],
[
155,
157
],
[
153,
158
],
[
158,
159
],
[
158,
160
],
[
153,
161
],
[
161,
162
],
[
162,
163
],
[
153,
164
],
[
165,
165
],
[
165,
166
],
[
166,
167
],
[
167,
168
],
[
166,
169
],
[
169,
170
],
[
169,
171
],
[
171,
172
],
[
172,
173
],
[
172,
174
],
[
171,
175
],
[
142,
176
],
[
176,
177
],
[
177,
178
],
[
20,
179
],
[
179,
180
],
[
180,
181
],
[
18,
182
],
[
182,
183
],
[
0,
184
],
[
184,
185
],
[
184,
186
]
] | [
"import java.io.BufferedReader;\nimport java.io.BufferedWriter;\nimport java.io.InputStreamReader;\nimport java.io.OutputStreamWriter;\nimport java.io.IOException;\n\npublic class Main {\n\n public static void main(String args[]) throws IOException {\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out));\n String[] st = br.readLine().split(\" \");\n int n = Integer.parseInt(st[0]);\n int m = Integer.parseInt(st[1]);\n int[][] arr = new int[n + 1][m + 1];\n for (int i = 0; i < n; i++) {\n st = br.readLine().split(\" \");\n for (int j = 0; j < m; j++) {\n int now = Integer.parseInt(st[j]);\n arr[i][j] = now;\n arr[i][m] += now;\n arr[n][j] += now;\n arr[n][m] += now;\n }\n }\n\n for (int i = 0; i <= n; i++) {\n bw.append(\"\" + arr[i][0]);\n for (int j = 1; j <= m; j++) {\n bw.append(\" \" + arr[i][j]);\n }\n bw.newLine();\n }\n bw.flush();\n }\n\n\n}",
"import java.io.BufferedReader;",
"BufferedReader",
"java.io",
"import java.io.BufferedWriter;",
"BufferedWriter",
"java.io",
"import java.io.InputStreamReader;",
"InputStreamReader",
"java.io",
"import java.io.OutputStreamWriter;",
"OutputStreamWriter",
"java.io",
"import java.io.IOException;",
"IOException",
"java.io",
"public class Main {\n\n public static void main(String args[]) throws IOException {\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out));\n String[] st = br.readLine().split(\" \");\n int n = Integer.parseInt(st[0]);\n int m = Integer.parseInt(st[1]);\n int[][] arr = new int[n + 1][m + 1];\n for (int i = 0; i < n; i++) {\n st = br.readLine().split(\" \");\n for (int j = 0; j < m; j++) {\n int now = Integer.parseInt(st[j]);\n arr[i][j] = now;\n arr[i][m] += now;\n arr[n][j] += now;\n arr[n][m] += now;\n }\n }\n\n for (int i = 0; i <= n; i++) {\n bw.append(\"\" + arr[i][0]);\n for (int j = 1; j <= m; j++) {\n bw.append(\" \" + arr[i][j]);\n }\n bw.newLine();\n }\n bw.flush();\n }\n\n\n}",
"Main",
"public static void main(String args[]) throws IOException {\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out));\n String[] st = br.readLine().split(\" \");\n int n = Integer.parseInt(st[0]);\n int m = Integer.parseInt(st[1]);\n int[][] arr = new int[n + 1][m + 1];\n for (int i = 0; i < n; i++) {\n st = br.readLine().split(\" \");\n for (int j = 0; j < m; j++) {\n int now = Integer.parseInt(st[j]);\n arr[i][j] = now;\n arr[i][m] += now;\n arr[n][j] += now;\n arr[n][m] += now;\n }\n }\n\n for (int i = 0; i <= n; i++) {\n bw.append(\"\" + arr[i][0]);\n for (int j = 1; j <= m; j++) {\n bw.append(\" \" + arr[i][j]);\n }\n bw.newLine();\n }\n bw.flush();\n }",
"main",
"{\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out));\n String[] st = br.readLine().split(\" \");\n int n = Integer.parseInt(st[0]);\n int m = Integer.parseInt(st[1]);\n int[][] arr = new int[n + 1][m + 1];\n for (int i = 0; i < n; i++) {\n st = br.readLine().split(\" \");\n for (int j = 0; j < m; j++) {\n int now = Integer.parseInt(st[j]);\n arr[i][j] = now;\n arr[i][m] += now;\n arr[n][j] += now;\n arr[n][m] += now;\n }\n }\n\n for (int i = 0; i <= n; i++) {\n bw.append(\"\" + arr[i][0]);\n for (int j = 1; j <= m; j++) {\n bw.append(\" \" + arr[i][j]);\n }\n bw.newLine();\n }\n bw.flush();\n }",
"BufferedReader br = new BufferedReader(new InputStreamReader(System.in));",
"br",
"new BufferedReader(new InputStreamReader(System.in))",
"BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out));",
"bw",
"new BufferedWriter(new OutputStreamWriter(System.out))",
"String[] st = br.readLine().split(\" \");",
"st",
"br.readLine().split(\" \")",
"br.readLine().split",
"br.readLine()",
"br.readLine",
"br",
"\" \"",
"int n = Integer.parseInt(st[0]);",
"n",
"Integer.parseInt(st[0])",
"Integer.parseInt",
"Integer",
"st[0]",
"st",
"0",
"int m = Integer.parseInt(st[1]);",
"m",
"Integer.parseInt(st[1])",
"Integer.parseInt",
"Integer",
"st[1]",
"st",
"1",
"int[][] arr = new int[n + 1][m + 1];",
"arr",
"new int[n + 1][m + 1]",
"n + 1",
"n",
"1",
"m + 1",
"m",
"1",
"for (int i = 0; i < n; i++) {\n st = br.readLine().split(\" \");\n for (int j = 0; j < m; j++) {\n int now = Integer.parseInt(st[j]);\n arr[i][j] = now;\n arr[i][m] += now;\n arr[n][j] += now;\n arr[n][m] += now;\n }\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < n",
"i",
"n",
"i++",
"i++",
"i",
"{\n st = br.readLine().split(\" \");\n for (int j = 0; j < m; j++) {\n int now = Integer.parseInt(st[j]);\n arr[i][j] = now;\n arr[i][m] += now;\n arr[n][j] += now;\n arr[n][m] += now;\n }\n }",
"{\n st = br.readLine().split(\" \");\n for (int j = 0; j < m; j++) {\n int now = Integer.parseInt(st[j]);\n arr[i][j] = now;\n arr[i][m] += now;\n arr[n][j] += now;\n arr[n][m] += now;\n }\n }",
"st = br.readLine().split(\" \")",
"st",
"br.readLine().split(\" \")",
"br.readLine().split",
"br.readLine()",
"br.readLine",
"br",
"\" \"",
"for (int j = 0; j < m; j++) {\n int now = Integer.parseInt(st[j]);\n arr[i][j] = now;\n arr[i][m] += now;\n arr[n][j] += now;\n arr[n][m] += now;\n }",
"int j = 0;",
"int j = 0;",
"j",
"0",
"j < m",
"j",
"m",
"j++",
"j++",
"j",
"{\n int now = Integer.parseInt(st[j]);\n arr[i][j] = now;\n arr[i][m] += now;\n arr[n][j] += now;\n arr[n][m] += now;\n }",
"{\n int now = Integer.parseInt(st[j]);\n arr[i][j] = now;\n arr[i][m] += now;\n arr[n][j] += now;\n arr[n][m] += now;\n }",
"int now = Integer.parseInt(st[j]);",
"now",
"Integer.parseInt(st[j])",
"Integer.parseInt",
"Integer",
"st[j]",
"st",
"j",
"arr[i][j] = now",
"arr[i][j]",
"arr[i]",
"arr",
"i",
"j",
"now",
"arr[i][m] += now",
"arr[i][m]",
"arr[i]",
"arr",
"i",
"m",
"now",
"arr[n][j] += now",
"arr[n][j]",
"arr[n]",
"arr",
"n",
"j",
"now",
"arr[n][m] += now",
"arr[n][m]",
"arr[n]",
"arr",
"n",
"m",
"now",
"for (int i = 0; i <= n; i++) {\n bw.append(\"\" + arr[i][0]);\n for (int j = 1; j <= m; j++) {\n bw.append(\" \" + arr[i][j]);\n }\n bw.newLine();\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i <= n",
"i",
"n",
"i++",
"i++",
"i",
"{\n bw.append(\"\" + arr[i][0]);\n for (int j = 1; j <= m; j++) {\n bw.append(\" \" + arr[i][j]);\n }\n bw.newLine();\n }",
"{\n bw.append(\"\" + arr[i][0]);\n for (int j = 1; j <= m; j++) {\n bw.append(\" \" + arr[i][j]);\n }\n bw.newLine();\n }",
"bw.append(\"\" + arr[i][0])",
"bw.append",
"bw",
"\"\" + arr[i][0]",
"\"\"",
"arr[i][0]",
"arr[i]",
"arr",
"i",
"0",
"for (int j = 1; j <= m; j++) {\n bw.append(\" \" + arr[i][j]);\n }",
"int j = 1;",
"int j = 1;",
"j",
"1",
"j <= m",
"j",
"m",
"j++",
"j++",
"j",
"{\n bw.append(\" \" + arr[i][j]);\n }",
"{\n bw.append(\" \" + arr[i][j]);\n }",
"bw.append(\" \" + arr[i][j])",
"bw.append",
"bw",
"\" \" + arr[i][j]",
"\" \"",
"arr[i][j]",
"arr[i]",
"arr",
"i",
"j",
"bw.newLine()",
"bw.newLine",
"bw",
"bw.flush()",
"bw.flush",
"bw",
"String args[]",
"args",
"public class Main {\n\n public static void main(String args[]) throws IOException {\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out));\n String[] st = br.readLine().split(\" \");\n int n = Integer.parseInt(st[0]);\n int m = Integer.parseInt(st[1]);\n int[][] arr = new int[n + 1][m + 1];\n for (int i = 0; i < n; i++) {\n st = br.readLine().split(\" \");\n for (int j = 0; j < m; j++) {\n int now = Integer.parseInt(st[j]);\n arr[i][j] = now;\n arr[i][m] += now;\n arr[n][j] += now;\n arr[n][m] += now;\n }\n }\n\n for (int i = 0; i <= n; i++) {\n bw.append(\"\" + arr[i][0]);\n for (int j = 1; j <= m; j++) {\n bw.append(\" \" + arr[i][j]);\n }\n bw.newLine();\n }\n bw.flush();\n }\n\n\n}",
"public class Main {\n\n public static void main(String args[]) throws IOException {\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out));\n String[] st = br.readLine().split(\" \");\n int n = Integer.parseInt(st[0]);\n int m = Integer.parseInt(st[1]);\n int[][] arr = new int[n + 1][m + 1];\n for (int i = 0; i < n; i++) {\n st = br.readLine().split(\" \");\n for (int j = 0; j < m; j++) {\n int now = Integer.parseInt(st[j]);\n arr[i][j] = now;\n arr[i][m] += now;\n arr[n][j] += now;\n arr[n][m] += now;\n }\n }\n\n for (int i = 0; i <= n; i++) {\n bw.append(\"\" + arr[i][0]);\n for (int j = 1; j <= m; j++) {\n bw.append(\" \" + arr[i][j]);\n }\n bw.newLine();\n }\n bw.flush();\n }\n\n\n}",
"Main"
] | import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.io.IOException;
public class Main {
public static void main(String args[]) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out));
String[] st = br.readLine().split(" ");
int n = Integer.parseInt(st[0]);
int m = Integer.parseInt(st[1]);
int[][] arr = new int[n + 1][m + 1];
for (int i = 0; i < n; i++) {
st = br.readLine().split(" ");
for (int j = 0; j < m; j++) {
int now = Integer.parseInt(st[j]);
arr[i][j] = now;
arr[i][m] += now;
arr[n][j] += now;
arr[n][m] += now;
}
}
for (int i = 0; i <= n; i++) {
bw.append("" + arr[i][0]);
for (int j = 1; j <= m; j++) {
bw.append(" " + arr[i][j]);
}
bw.newLine();
}
bw.flush();
}
}
|
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
41,
13,
41,
13,
17,
41,
13,
20,
0,
13,
4,
18,
13,
0,
13,
4,
18,
13,
41,
13,
20,
2,
13,
17,
2,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
11,
1,
41,
13,
17,
2,
13,
2,
13,
17,
1,
40,
13,
30,
30,
14,
2,
13,
13,
30,
0,
18,
18,
13,
13,
13,
4,
18,
13,
0,
18,
18,
13,
13,
13,
18,
18,
13,
13,
13,
4,
18,
18,
13,
13,
2,
18,
18,
13,
13,
13,
17,
0,
13,
18,
18,
13,
13,
13,
30,
0,
18,
18,
13,
13,
13,
13,
4,
18,
18,
13,
13,
18,
18,
13,
13,
13,
0,
18,
18,
13,
13,
13,
18,
18,
13,
13,
13,
0,
13,
17,
4,
18,
13,
11,
1,
41,
13,
17,
2,
13,
2,
13,
17,
1,
40,
13,
30,
30,
14,
2,
13,
13,
30,
4,
18,
18,
13,
13,
2,
18,
18,
13,
13,
13,
17,
30,
4,
18,
18,
13,
13,
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
],
[
8,
11
],
[
11,
12
],
[
8,
13
],
[
13,
14
],
[
13,
15
],
[
8,
16
],
[
16,
17
],
[
16,
18
],
[
8,
19
],
[
19,
20
],
[
19,
21
],
[
21,
22
],
[
22,
23
],
[
8,
24
],
[
24,
25
],
[
24,
26
],
[
26,
27
],
[
27,
28
],
[
8,
29
],
[
29,
30
],
[
29,
31
],
[
32,
33
],
[
32,
34
],
[
35,
36
],
[
35,
37
],
[
8,
38
],
[
38,
39
],
[
39,
40
],
[
40,
41
],
[
40,
42
],
[
38,
43
],
[
43,
44
],
[
43,
45
],
[
38,
46
],
[
46,
47
],
[
47,
48
],
[
38,
49
],
[
50,
50
],
[
50,
51
],
[
51,
52
],
[
52,
53
],
[
53,
54
],
[
53,
55
],
[
51,
56
],
[
56,
57
],
[
56,
58
],
[
58,
59
],
[
58,
60
],
[
51,
61
],
[
61,
62
],
[
62,
63
],
[
51,
64
],
[
65,
65
],
[
65,
66
],
[
66,
67
],
[
67,
68
],
[
67,
69
],
[
66,
70
],
[
70,
71
],
[
71,
72
],
[
72,
73
],
[
73,
74
],
[
73,
75
],
[
72,
76
],
[
71,
77
],
[
77,
78
],
[
78,
79
],
[
70,
80
],
[
80,
81
],
[
81,
82
],
[
82,
83
],
[
82,
84
],
[
81,
85
],
[
80,
86
],
[
86,
87
],
[
87,
88
],
[
87,
89
],
[
86,
90
],
[
70,
91
],
[
91,
92
],
[
92,
93
],
[
93,
94
],
[
93,
95
],
[
91,
96
],
[
96,
97
],
[
97,
98
],
[
98,
99
],
[
98,
100
],
[
97,
101
],
[
96,
102
],
[
70,
103
],
[
103,
104
],
[
103,
105
],
[
105,
106
],
[
106,
107
],
[
106,
108
],
[
105,
109
],
[
66,
110
],
[
110,
111
],
[
111,
112
],
[
112,
113
],
[
113,
114
],
[
113,
115
],
[
112,
116
],
[
111,
117
],
[
110,
118
],
[
118,
119
],
[
119,
120
],
[
120,
121
],
[
120,
122
],
[
118,
123
],
[
123,
124
],
[
124,
125
],
[
124,
126
],
[
123,
127
],
[
110,
128
],
[
128,
129
],
[
129,
130
],
[
130,
131
],
[
130,
132
],
[
129,
133
],
[
128,
134
],
[
134,
135
],
[
135,
136
],
[
135,
137
],
[
134,
138
],
[
50,
139
],
[
139,
140
],
[
139,
141
],
[
8,
142
],
[
142,
143
],
[
143,
144
],
[
8,
145
],
[
145,
146
],
[
146,
147
],
[
147,
148
],
[
147,
149
],
[
145,
150
],
[
150,
151
],
[
150,
152
],
[
152,
153
],
[
152,
154
],
[
145,
155
],
[
155,
156
],
[
156,
157
],
[
145,
158
],
[
159,
159
],
[
159,
160
],
[
160,
161
],
[
161,
162
],
[
161,
163
],
[
160,
164
],
[
164,
165
],
[
165,
166
],
[
166,
167
],
[
167,
168
],
[
167,
169
],
[
165,
170
],
[
170,
171
],
[
171,
172
],
[
172,
173
],
[
172,
174
],
[
171,
175
],
[
170,
176
],
[
160,
177
],
[
177,
178
],
[
178,
179
],
[
179,
180
],
[
180,
181
],
[
180,
182
],
[
178,
183
],
[
183,
184
],
[
184,
185
],
[
184,
186
],
[
183,
187
],
[
6,
188
],
[
188,
189
]
] | [
"import java.util.Scanner;\n\nclass Main{\n\tpublic static void main(String[] args){\n \tint r,c;\n \tint total= 0;\n \tScanner sc = new Scanner(System.in);\n \tr = sc.nextInt();\n c = sc.nextInt();\n int [][] a = new int [r+1][c+1];\n\n \tfor(int i = 0; i < r; i++){\n\t\t\tfor(int j = 0; j < c+1; j++){\n\t\t\t\tif(j != c){\n\t\t\t\t\ta[i][j] = sc.nextInt();\n\t\t\t\t\ta[r][j] += a[i][j];\n\t \t\t\tSystem.out.print(a[i][j]+\" \");\n\t \t\t\ttotal += a[i][j];\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\ta[i][j] = total;\n\t\t\t\t\tSystem.out.println(a[i][j]);\n\t\t\t\t\ta[r][j] += a[i][j];\n\t\t\t\t}\n\t\t\t}\n\t\t\ttotal = 0;\n \t}\n \tsc.close();\n\n \tfor(int i = 0; i < c+1; i++){\n \t\tif(i != c){\n \t\t\tSystem.out.print(a[r][i]+\" \");\n \t\t}\n \t\telse{\n \t\t\tSystem.out.println(a[r][i]);\n \t\t}\n \t}\n }\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"class Main{\n\tpublic static void main(String[] args){\n \tint r,c;\n \tint total= 0;\n \tScanner sc = new Scanner(System.in);\n \tr = sc.nextInt();\n c = sc.nextInt();\n int [][] a = new int [r+1][c+1];\n\n \tfor(int i = 0; i < r; i++){\n\t\t\tfor(int j = 0; j < c+1; j++){\n\t\t\t\tif(j != c){\n\t\t\t\t\ta[i][j] = sc.nextInt();\n\t\t\t\t\ta[r][j] += a[i][j];\n\t \t\t\tSystem.out.print(a[i][j]+\" \");\n\t \t\t\ttotal += a[i][j];\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\ta[i][j] = total;\n\t\t\t\t\tSystem.out.println(a[i][j]);\n\t\t\t\t\ta[r][j] += a[i][j];\n\t\t\t\t}\n\t\t\t}\n\t\t\ttotal = 0;\n \t}\n \tsc.close();\n\n \tfor(int i = 0; i < c+1; i++){\n \t\tif(i != c){\n \t\t\tSystem.out.print(a[r][i]+\" \");\n \t\t}\n \t\telse{\n \t\t\tSystem.out.println(a[r][i]);\n \t\t}\n \t}\n }\n}",
"Main",
"public static void main(String[] args){\n \tint r,c;\n \tint total= 0;\n \tScanner sc = new Scanner(System.in);\n \tr = sc.nextInt();\n c = sc.nextInt();\n int [][] a = new int [r+1][c+1];\n\n \tfor(int i = 0; i < r; i++){\n\t\t\tfor(int j = 0; j < c+1; j++){\n\t\t\t\tif(j != c){\n\t\t\t\t\ta[i][j] = sc.nextInt();\n\t\t\t\t\ta[r][j] += a[i][j];\n\t \t\t\tSystem.out.print(a[i][j]+\" \");\n\t \t\t\ttotal += a[i][j];\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\ta[i][j] = total;\n\t\t\t\t\tSystem.out.println(a[i][j]);\n\t\t\t\t\ta[r][j] += a[i][j];\n\t\t\t\t}\n\t\t\t}\n\t\t\ttotal = 0;\n \t}\n \tsc.close();\n\n \tfor(int i = 0; i < c+1; i++){\n \t\tif(i != c){\n \t\t\tSystem.out.print(a[r][i]+\" \");\n \t\t}\n \t\telse{\n \t\t\tSystem.out.println(a[r][i]);\n \t\t}\n \t}\n }",
"main",
"{\n \tint r,c;\n \tint total= 0;\n \tScanner sc = new Scanner(System.in);\n \tr = sc.nextInt();\n c = sc.nextInt();\n int [][] a = new int [r+1][c+1];\n\n \tfor(int i = 0; i < r; i++){\n\t\t\tfor(int j = 0; j < c+1; j++){\n\t\t\t\tif(j != c){\n\t\t\t\t\ta[i][j] = sc.nextInt();\n\t\t\t\t\ta[r][j] += a[i][j];\n\t \t\t\tSystem.out.print(a[i][j]+\" \");\n\t \t\t\ttotal += a[i][j];\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\ta[i][j] = total;\n\t\t\t\t\tSystem.out.println(a[i][j]);\n\t\t\t\t\ta[r][j] += a[i][j];\n\t\t\t\t}\n\t\t\t}\n\t\t\ttotal = 0;\n \t}\n \tsc.close();\n\n \tfor(int i = 0; i < c+1; i++){\n \t\tif(i != c){\n \t\t\tSystem.out.print(a[r][i]+\" \");\n \t\t}\n \t\telse{\n \t\t\tSystem.out.println(a[r][i]);\n \t\t}\n \t}\n }",
"int r",
"r",
"c;",
"c",
"int total= 0;",
"total",
"0",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"r = sc.nextInt()",
"r",
"sc.nextInt()",
"sc.nextInt",
"sc",
"c = sc.nextInt()",
"c",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int [][] a = new int [r+1][c+1];",
"a",
"new int [r+1][c+1]",
"r+1",
"r",
"1",
"c+1",
"c",
"1",
"for(int i = 0; i < r; i++){\n\t\t\tfor(int j = 0; j < c+1; j++){\n\t\t\t\tif(j != c){\n\t\t\t\t\ta[i][j] = sc.nextInt();\n\t\t\t\t\ta[r][j] += a[i][j];\n\t \t\t\tSystem.out.print(a[i][j]+\" \");\n\t \t\t\ttotal += a[i][j];\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\ta[i][j] = total;\n\t\t\t\t\tSystem.out.println(a[i][j]);\n\t\t\t\t\ta[r][j] += a[i][j];\n\t\t\t\t}\n\t\t\t}\n\t\t\ttotal = 0;\n \t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < r",
"i",
"r",
"i++",
"i++",
"i",
"{\n\t\t\tfor(int j = 0; j < c+1; j++){\n\t\t\t\tif(j != c){\n\t\t\t\t\ta[i][j] = sc.nextInt();\n\t\t\t\t\ta[r][j] += a[i][j];\n\t \t\t\tSystem.out.print(a[i][j]+\" \");\n\t \t\t\ttotal += a[i][j];\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\ta[i][j] = total;\n\t\t\t\t\tSystem.out.println(a[i][j]);\n\t\t\t\t\ta[r][j] += a[i][j];\n\t\t\t\t}\n\t\t\t}\n\t\t\ttotal = 0;\n \t}",
"{\n\t\t\tfor(int j = 0; j < c+1; j++){\n\t\t\t\tif(j != c){\n\t\t\t\t\ta[i][j] = sc.nextInt();\n\t\t\t\t\ta[r][j] += a[i][j];\n\t \t\t\tSystem.out.print(a[i][j]+\" \");\n\t \t\t\ttotal += a[i][j];\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\ta[i][j] = total;\n\t\t\t\t\tSystem.out.println(a[i][j]);\n\t\t\t\t\ta[r][j] += a[i][j];\n\t\t\t\t}\n\t\t\t}\n\t\t\ttotal = 0;\n \t}",
"for(int j = 0; j < c+1; j++){\n\t\t\t\tif(j != c){\n\t\t\t\t\ta[i][j] = sc.nextInt();\n\t\t\t\t\ta[r][j] += a[i][j];\n\t \t\t\tSystem.out.print(a[i][j]+\" \");\n\t \t\t\ttotal += a[i][j];\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\ta[i][j] = total;\n\t\t\t\t\tSystem.out.println(a[i][j]);\n\t\t\t\t\ta[r][j] += a[i][j];\n\t\t\t\t}\n\t\t\t}",
"int j = 0;",
"int j = 0;",
"j",
"0",
"j < c+1",
"j",
"c+1",
"c",
"1",
"j++",
"j++",
"j",
"{\n\t\t\t\tif(j != c){\n\t\t\t\t\ta[i][j] = sc.nextInt();\n\t\t\t\t\ta[r][j] += a[i][j];\n\t \t\t\tSystem.out.print(a[i][j]+\" \");\n\t \t\t\ttotal += a[i][j];\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\ta[i][j] = total;\n\t\t\t\t\tSystem.out.println(a[i][j]);\n\t\t\t\t\ta[r][j] += a[i][j];\n\t\t\t\t}\n\t\t\t}",
"{\n\t\t\t\tif(j != c){\n\t\t\t\t\ta[i][j] = sc.nextInt();\n\t\t\t\t\ta[r][j] += a[i][j];\n\t \t\t\tSystem.out.print(a[i][j]+\" \");\n\t \t\t\ttotal += a[i][j];\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\ta[i][j] = total;\n\t\t\t\t\tSystem.out.println(a[i][j]);\n\t\t\t\t\ta[r][j] += a[i][j];\n\t\t\t\t}\n\t\t\t}",
"if(j != c){\n\t\t\t\t\ta[i][j] = sc.nextInt();\n\t\t\t\t\ta[r][j] += a[i][j];\n\t \t\t\tSystem.out.print(a[i][j]+\" \");\n\t \t\t\ttotal += a[i][j];\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\ta[i][j] = total;\n\t\t\t\t\tSystem.out.println(a[i][j]);\n\t\t\t\t\ta[r][j] += a[i][j];\n\t\t\t\t}",
"j != c",
"j",
"c",
"{\n\t\t\t\t\ta[i][j] = sc.nextInt();\n\t\t\t\t\ta[r][j] += a[i][j];\n\t \t\t\tSystem.out.print(a[i][j]+\" \");\n\t \t\t\ttotal += a[i][j];\n\t\t\t\t}",
"a[i][j] = sc.nextInt()",
"a[i][j]",
"a[i]",
"a",
"i",
"j",
"sc.nextInt()",
"sc.nextInt",
"sc",
"a[r][j] += a[i][j]",
"a[r][j]",
"a[r]",
"a",
"r",
"j",
"a[i][j]",
"a[i]",
"a",
"i",
"j",
"System.out.print(a[i][j]+\" \")",
"System.out.print",
"System.out",
"System",
"System.out",
"a[i][j]+\" \"",
"a[i][j]",
"a[i]",
"a",
"i",
"j",
"\" \"",
"total += a[i][j]",
"total",
"a[i][j]",
"a[i]",
"a",
"i",
"j",
"{\n\t\t\t\t\ta[i][j] = total;\n\t\t\t\t\tSystem.out.println(a[i][j]);\n\t\t\t\t\ta[r][j] += a[i][j];\n\t\t\t\t}",
"a[i][j] = total",
"a[i][j]",
"a[i]",
"a",
"i",
"j",
"total",
"System.out.println(a[i][j])",
"System.out.println",
"System.out",
"System",
"System.out",
"a[i][j]",
"a[i]",
"a",
"i",
"j",
"a[r][j] += a[i][j]",
"a[r][j]",
"a[r]",
"a",
"r",
"j",
"a[i][j]",
"a[i]",
"a",
"i",
"j",
"total = 0",
"total",
"0",
"sc.close()",
"sc.close",
"sc",
"for(int i = 0; i < c+1; i++){\n \t\tif(i != c){\n \t\t\tSystem.out.print(a[r][i]+\" \");\n \t\t}\n \t\telse{\n \t\t\tSystem.out.println(a[r][i]);\n \t\t}\n \t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < c+1",
"i",
"c+1",
"c",
"1",
"i++",
"i++",
"i",
"{\n \t\tif(i != c){\n \t\t\tSystem.out.print(a[r][i]+\" \");\n \t\t}\n \t\telse{\n \t\t\tSystem.out.println(a[r][i]);\n \t\t}\n \t}",
"{\n \t\tif(i != c){\n \t\t\tSystem.out.print(a[r][i]+\" \");\n \t\t}\n \t\telse{\n \t\t\tSystem.out.println(a[r][i]);\n \t\t}\n \t}",
"if(i != c){\n \t\t\tSystem.out.print(a[r][i]+\" \");\n \t\t}\n \t\telse{\n \t\t\tSystem.out.println(a[r][i]);\n \t\t}",
"i != c",
"i",
"c",
"{\n \t\t\tSystem.out.print(a[r][i]+\" \");\n \t\t}",
"System.out.print(a[r][i]+\" \")",
"System.out.print",
"System.out",
"System",
"System.out",
"a[r][i]+\" \"",
"a[r][i]",
"a[r]",
"a",
"r",
"i",
"\" \"",
"{\n \t\t\tSystem.out.println(a[r][i]);\n \t\t}",
"System.out.println(a[r][i])",
"System.out.println",
"System.out",
"System",
"System.out",
"a[r][i]",
"a[r]",
"a",
"r",
"i",
"String[] args",
"args"
] | import java.util.Scanner;
class Main{
public static void main(String[] args){
int r,c;
int total= 0;
Scanner sc = new Scanner(System.in);
r = sc.nextInt();
c = sc.nextInt();
int [][] a = new int [r+1][c+1];
for(int i = 0; i < r; i++){
for(int j = 0; j < c+1; j++){
if(j != c){
a[i][j] = sc.nextInt();
a[r][j] += a[i][j];
System.out.print(a[i][j]+" ");
total += a[i][j];
}
else{
a[i][j] = total;
System.out.println(a[i][j]);
a[r][j] += a[i][j];
}
}
total = 0;
}
sc.close();
for(int i = 0; i < c+1; i++){
if(i != c){
System.out.print(a[r][i]+" ");
}
else{
System.out.println(a[r][i]);
}
}
}
} |
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
17,
41,
13,
4,
18,
13,
18,
13,
17,
41,
13,
4,
18,
13,
18,
13,
17,
41,
13,
20,
2,
13,
17,
2,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
4,
18,
13,
0,
13,
4,
18,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
18,
18,
13,
13,
2,
13,
17,
4,
18,
13,
18,
13,
13,
0,
18,
18,
13,
13,
2,
13,
17,
4,
18,
13,
18,
13,
13,
0,
18,
18,
13,
2,
13,
17,
2,
13,
17,
4,
18,
13,
18,
13,
13,
0,
18,
18,
13,
2,
13,
17,
2,
13,
17,
18,
18,
13,
13,
2,
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,
4,
18,
18,
13,
13,
18,
18,
13,
13,
13,
14,
2,
13,
2,
13,
17,
30,
4,
18,
18,
13,
13,
17,
4,
18,
18,
13,
13,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
207,
5
],
[
207,
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
],
[
19,
20
],
[
20,
21
],
[
19,
22
],
[
8,
23
],
[
23,
24
],
[
23,
25
],
[
25,
26
],
[
26,
27
],
[
25,
28
],
[
28,
29
],
[
28,
30
],
[
8,
31
],
[
31,
32
],
[
31,
33
],
[
33,
34
],
[
34,
35
],
[
33,
36
],
[
36,
37
],
[
36,
38
],
[
8,
39
],
[
39,
40
],
[
39,
41
],
[
42,
43
],
[
42,
44
],
[
45,
46
],
[
45,
47
],
[
8,
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
],
[
64,
65
],
[
60,
66
],
[
66,
67
],
[
66,
68
],
[
68,
69
],
[
69,
70
],
[
68,
71
],
[
60,
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
],
[
86,
90
],
[
90,
91
],
[
90,
92
],
[
85,
93
],
[
93,
94
],
[
94,
95
],
[
93,
96
],
[
96,
97
],
[
96,
98
],
[
84,
99
],
[
99,
100
],
[
100,
101
],
[
101,
102
],
[
101,
103
],
[
100,
104
],
[
104,
105
],
[
104,
106
],
[
99,
107
],
[
107,
108
],
[
108,
109
],
[
107,
110
],
[
110,
111
],
[
110,
112
],
[
84,
113
],
[
113,
114
],
[
114,
115
],
[
115,
116
],
[
115,
117
],
[
117,
118
],
[
117,
119
],
[
114,
120
],
[
120,
121
],
[
120,
122
],
[
113,
123
],
[
123,
124
],
[
124,
125
],
[
123,
126
],
[
126,
127
],
[
126,
128
],
[
60,
129
],
[
129,
130
],
[
130,
131
],
[
131,
132
],
[
131,
133
],
[
133,
134
],
[
133,
135
],
[
130,
136
],
[
136,
137
],
[
136,
138
],
[
129,
139
],
[
139,
140
],
[
140,
141
],
[
140,
142
],
[
139,
143
],
[
143,
144
],
[
143,
145
],
[
8,
146
],
[
146,
147
],
[
147,
148
],
[
148,
149
],
[
148,
150
],
[
146,
151
],
[
151,
152
],
[
151,
153
],
[
153,
154
],
[
153,
155
],
[
146,
156
],
[
156,
157
],
[
157,
158
],
[
146,
159
],
[
160,
160
],
[
160,
161
],
[
161,
162
],
[
162,
163
],
[
163,
164
],
[
163,
165
],
[
161,
166
],
[
166,
167
],
[
166,
168
],
[
168,
169
],
[
168,
170
],
[
161,
171
],
[
171,
172
],
[
172,
173
],
[
161,
174
],
[
175,
175
],
[
175,
176
],
[
176,
177
],
[
177,
178
],
[
178,
179
],
[
178,
180
],
[
176,
181
],
[
181,
182
],
[
182,
183
],
[
182,
184
],
[
181,
185
],
[
175,
186
],
[
186,
187
],
[
187,
188
],
[
187,
189
],
[
189,
190
],
[
189,
191
],
[
186,
192
],
[
192,
193
],
[
193,
194
],
[
194,
195
],
[
195,
196
],
[
195,
197
],
[
193,
198
],
[
160,
199
],
[
199,
200
],
[
200,
201
],
[
201,
202
],
[
201,
203
],
[
6,
204
],
[
204,
205
],
[
0,
206
],
[
206,
207
],
[
206,
208
]
] | [
"import java.io.*;\npublic class Main {\n\tpublic static void main(String[] args)throws IOException {\n\t\tBufferedReader br=new BufferedReader(new InputStreamReader(System.in));\n\t\tString str = br.readLine();\n\t\tString[] i=str.split(\" \");\n\t\tint r=Integer.parseInt(i[0]),c=Integer.parseInt(i[1]);\n\t\tint [][]hyo=new int[r+2][c+2];\n\t\tfor (int x=1;x<=r;x++){\n\t\t\t str = br.readLine();\n\t\t\t i=str.split(\" \");\n\t\t\t for(int y=0;y<c;y++){\n\t\t\thyo[x][y+1]=Integer.parseInt(i[y]);\n\t\t\thyo[x][c+1]+=Integer.parseInt(i[y]);\n\t\t\thyo[r+1][y+1]+=Integer.parseInt(i[y]);}\n\t\t\thyo[r+1][c+1]+=hyo[x][c+1];\n\t\t}\n\t\tfor (int x=1;x<=r+1;x++){\n\t\t\tfor(int y=1;y<=c+1;y++){System.out.print(hyo[x][y]);\n\t\t\tif(y!=c+1){System.out.print(\" \");}}\n\t\t\tSystem.out.println();\n\t\t}\n\t\t}}",
"import java.io.*;",
"io.*",
"java",
"public class Main {\n\tpublic static void main(String[] args)throws IOException {\n\t\tBufferedReader br=new BufferedReader(new InputStreamReader(System.in));\n\t\tString str = br.readLine();\n\t\tString[] i=str.split(\" \");\n\t\tint r=Integer.parseInt(i[0]),c=Integer.parseInt(i[1]);\n\t\tint [][]hyo=new int[r+2][c+2];\n\t\tfor (int x=1;x<=r;x++){\n\t\t\t str = br.readLine();\n\t\t\t i=str.split(\" \");\n\t\t\t for(int y=0;y<c;y++){\n\t\t\thyo[x][y+1]=Integer.parseInt(i[y]);\n\t\t\thyo[x][c+1]+=Integer.parseInt(i[y]);\n\t\t\thyo[r+1][y+1]+=Integer.parseInt(i[y]);}\n\t\t\thyo[r+1][c+1]+=hyo[x][c+1];\n\t\t}\n\t\tfor (int x=1;x<=r+1;x++){\n\t\t\tfor(int y=1;y<=c+1;y++){System.out.print(hyo[x][y]);\n\t\t\tif(y!=c+1){System.out.print(\" \");}}\n\t\t\tSystem.out.println();\n\t\t}\n\t\t}}",
"Main",
"public static void main(String[] args)throws IOException {\n\t\tBufferedReader br=new BufferedReader(new InputStreamReader(System.in));\n\t\tString str = br.readLine();\n\t\tString[] i=str.split(\" \");\n\t\tint r=Integer.parseInt(i[0]),c=Integer.parseInt(i[1]);\n\t\tint [][]hyo=new int[r+2][c+2];\n\t\tfor (int x=1;x<=r;x++){\n\t\t\t str = br.readLine();\n\t\t\t i=str.split(\" \");\n\t\t\t for(int y=0;y<c;y++){\n\t\t\thyo[x][y+1]=Integer.parseInt(i[y]);\n\t\t\thyo[x][c+1]+=Integer.parseInt(i[y]);\n\t\t\thyo[r+1][y+1]+=Integer.parseInt(i[y]);}\n\t\t\thyo[r+1][c+1]+=hyo[x][c+1];\n\t\t}\n\t\tfor (int x=1;x<=r+1;x++){\n\t\t\tfor(int y=1;y<=c+1;y++){System.out.print(hyo[x][y]);\n\t\t\tif(y!=c+1){System.out.print(\" \");}}\n\t\t\tSystem.out.println();\n\t\t}\n\t\t}",
"main",
"{\n\t\tBufferedReader br=new BufferedReader(new InputStreamReader(System.in));\n\t\tString str = br.readLine();\n\t\tString[] i=str.split(\" \");\n\t\tint r=Integer.parseInt(i[0]),c=Integer.parseInt(i[1]);\n\t\tint [][]hyo=new int[r+2][c+2];\n\t\tfor (int x=1;x<=r;x++){\n\t\t\t str = br.readLine();\n\t\t\t i=str.split(\" \");\n\t\t\t for(int y=0;y<c;y++){\n\t\t\thyo[x][y+1]=Integer.parseInt(i[y]);\n\t\t\thyo[x][c+1]+=Integer.parseInt(i[y]);\n\t\t\thyo[r+1][y+1]+=Integer.parseInt(i[y]);}\n\t\t\thyo[r+1][c+1]+=hyo[x][c+1];\n\t\t}\n\t\tfor (int x=1;x<=r+1;x++){\n\t\t\tfor(int y=1;y<=c+1;y++){System.out.print(hyo[x][y]);\n\t\t\tif(y!=c+1){System.out.print(\" \");}}\n\t\t\tSystem.out.println();\n\t\t}\n\t\t}",
"BufferedReader br=new BufferedReader(new InputStreamReader(System.in));",
"br",
"new BufferedReader(new InputStreamReader(System.in))",
"String str = br.readLine();",
"str",
"br.readLine()",
"br.readLine",
"br",
"String[] i=str.split(\" \");",
"i",
"str.split(\" \")",
"str.split",
"str",
"\" \"",
"int r=Integer.parseInt(i[0])",
"r",
"Integer.parseInt(i[0])",
"Integer.parseInt",
"Integer",
"i[0]",
"i",
"0",
"c=Integer.parseInt(i[1]);",
"c",
"Integer.parseInt(i[1])",
"Integer.parseInt",
"Integer",
"i[1]",
"i",
"1",
"int [][]hyo=new int[r+2][c+2];",
"hyo",
"new int[r+2][c+2]",
"r+2",
"r",
"2",
"c+2",
"c",
"2",
"for (int x=1;x<=r;x++){\n\t\t\t str = br.readLine();\n\t\t\t i=str.split(\" \");\n\t\t\t for(int y=0;y<c;y++){\n\t\t\thyo[x][y+1]=Integer.parseInt(i[y]);\n\t\t\thyo[x][c+1]+=Integer.parseInt(i[y]);\n\t\t\thyo[r+1][y+1]+=Integer.parseInt(i[y]);}\n\t\t\thyo[r+1][c+1]+=hyo[x][c+1];\n\t\t}",
"int x=1;",
"int x=1;",
"x",
"1",
"x<=r",
"x",
"r",
"x++",
"x++",
"x",
"{\n\t\t\t str = br.readLine();\n\t\t\t i=str.split(\" \");\n\t\t\t for(int y=0;y<c;y++){\n\t\t\thyo[x][y+1]=Integer.parseInt(i[y]);\n\t\t\thyo[x][c+1]+=Integer.parseInt(i[y]);\n\t\t\thyo[r+1][y+1]+=Integer.parseInt(i[y]);}\n\t\t\thyo[r+1][c+1]+=hyo[x][c+1];\n\t\t}",
"{\n\t\t\t str = br.readLine();\n\t\t\t i=str.split(\" \");\n\t\t\t for(int y=0;y<c;y++){\n\t\t\thyo[x][y+1]=Integer.parseInt(i[y]);\n\t\t\thyo[x][c+1]+=Integer.parseInt(i[y]);\n\t\t\thyo[r+1][y+1]+=Integer.parseInt(i[y]);}\n\t\t\thyo[r+1][c+1]+=hyo[x][c+1];\n\t\t}",
"str = br.readLine()",
"str",
"br.readLine()",
"br.readLine",
"br",
"i=str.split(\" \")",
"i",
"str.split(\" \")",
"str.split",
"str",
"\" \"",
"for(int y=0;y<c;y++){\n\t\t\thyo[x][y+1]=Integer.parseInt(i[y]);\n\t\t\thyo[x][c+1]+=Integer.parseInt(i[y]);\n\t\t\thyo[r+1][y+1]+=Integer.parseInt(i[y]);}",
"int y=0;",
"int y=0;",
"y",
"0",
"y<c",
"y",
"c",
"y++",
"y++",
"y",
"{\n\t\t\thyo[x][y+1]=Integer.parseInt(i[y]);\n\t\t\thyo[x][c+1]+=Integer.parseInt(i[y]);\n\t\t\thyo[r+1][y+1]+=Integer.parseInt(i[y]);}",
"{\n\t\t\thyo[x][y+1]=Integer.parseInt(i[y]);\n\t\t\thyo[x][c+1]+=Integer.parseInt(i[y]);\n\t\t\thyo[r+1][y+1]+=Integer.parseInt(i[y]);}",
"hyo[x][y+1]=Integer.parseInt(i[y])",
"hyo[x][y+1]",
"hyo[x]",
"hyo",
"x",
"y+1",
"y",
"1",
"Integer.parseInt(i[y])",
"Integer.parseInt",
"Integer",
"i[y]",
"i",
"y",
"hyo[x][c+1]+=Integer.parseInt(i[y])",
"hyo[x][c+1]",
"hyo[x]",
"hyo",
"x",
"c+1",
"c",
"1",
"Integer.parseInt(i[y])",
"Integer.parseInt",
"Integer",
"i[y]",
"i",
"y",
"hyo[r+1][y+1]+=Integer.parseInt(i[y])",
"hyo[r+1][y+1]",
"hyo[r+1]",
"hyo",
"r+1",
"r",
"1",
"y+1",
"y",
"1",
"Integer.parseInt(i[y])",
"Integer.parseInt",
"Integer",
"i[y]",
"i",
"y",
"hyo[r+1][c+1]+=hyo[x][c+1]",
"hyo[r+1][c+1]",
"hyo[r+1]",
"hyo",
"r+1",
"r",
"1",
"c+1",
"c",
"1",
"hyo[x][c+1]",
"hyo[x]",
"hyo",
"x",
"c+1",
"c",
"1",
"for (int x=1;x<=r+1;x++){\n\t\t\tfor(int y=1;y<=c+1;y++){System.out.print(hyo[x][y]);\n\t\t\tif(y!=c+1){System.out.print(\" \");}}\n\t\t\tSystem.out.println();\n\t\t}",
"int x=1;",
"int x=1;",
"x",
"1",
"x<=r+1",
"x",
"r+1",
"r",
"1",
"x++",
"x++",
"x",
"{\n\t\t\tfor(int y=1;y<=c+1;y++){System.out.print(hyo[x][y]);\n\t\t\tif(y!=c+1){System.out.print(\" \");}}\n\t\t\tSystem.out.println();\n\t\t}",
"{\n\t\t\tfor(int y=1;y<=c+1;y++){System.out.print(hyo[x][y]);\n\t\t\tif(y!=c+1){System.out.print(\" \");}}\n\t\t\tSystem.out.println();\n\t\t}",
"for(int y=1;y<=c+1;y++){System.out.print(hyo[x][y]);\n\t\t\tif(y!=c+1){System.out.print(\" \");}}",
"int y=1;",
"int y=1;",
"y",
"1",
"y<=c+1",
"y",
"c+1",
"c",
"1",
"y++",
"y++",
"y",
"{System.out.print(hyo[x][y]);\n\t\t\tif(y!=c+1){System.out.print(\" \");}}",
"{System.out.print(hyo[x][y]);\n\t\t\tif(y!=c+1){System.out.print(\" \");}}",
"System.out.print(hyo[x][y])",
"System.out.print",
"System.out",
"System",
"System.out",
"hyo[x][y]",
"hyo[x]",
"hyo",
"x",
"y",
"if(y!=c+1){System.out.print(\" \");}",
"y!=c+1",
"y",
"c+1",
"c",
"1",
"{System.out.print(\" \");}",
"System.out.print(\" \")",
"System.out.print",
"System.out",
"System",
"System.out",
"\" \"",
"System.out.println()",
"System.out.println",
"System.out",
"System",
"System.out",
"String[] args",
"args",
"public class Main {\n\tpublic static void main(String[] args)throws IOException {\n\t\tBufferedReader br=new BufferedReader(new InputStreamReader(System.in));\n\t\tString str = br.readLine();\n\t\tString[] i=str.split(\" \");\n\t\tint r=Integer.parseInt(i[0]),c=Integer.parseInt(i[1]);\n\t\tint [][]hyo=new int[r+2][c+2];\n\t\tfor (int x=1;x<=r;x++){\n\t\t\t str = br.readLine();\n\t\t\t i=str.split(\" \");\n\t\t\t for(int y=0;y<c;y++){\n\t\t\thyo[x][y+1]=Integer.parseInt(i[y]);\n\t\t\thyo[x][c+1]+=Integer.parseInt(i[y]);\n\t\t\thyo[r+1][y+1]+=Integer.parseInt(i[y]);}\n\t\t\thyo[r+1][c+1]+=hyo[x][c+1];\n\t\t}\n\t\tfor (int x=1;x<=r+1;x++){\n\t\t\tfor(int y=1;y<=c+1;y++){System.out.print(hyo[x][y]);\n\t\t\tif(y!=c+1){System.out.print(\" \");}}\n\t\t\tSystem.out.println();\n\t\t}\n\t\t}}",
"public class Main {\n\tpublic static void main(String[] args)throws IOException {\n\t\tBufferedReader br=new BufferedReader(new InputStreamReader(System.in));\n\t\tString str = br.readLine();\n\t\tString[] i=str.split(\" \");\n\t\tint r=Integer.parseInt(i[0]),c=Integer.parseInt(i[1]);\n\t\tint [][]hyo=new int[r+2][c+2];\n\t\tfor (int x=1;x<=r;x++){\n\t\t\t str = br.readLine();\n\t\t\t i=str.split(\" \");\n\t\t\t for(int y=0;y<c;y++){\n\t\t\thyo[x][y+1]=Integer.parseInt(i[y]);\n\t\t\thyo[x][c+1]+=Integer.parseInt(i[y]);\n\t\t\thyo[r+1][y+1]+=Integer.parseInt(i[y]);}\n\t\t\thyo[r+1][c+1]+=hyo[x][c+1];\n\t\t}\n\t\tfor (int x=1;x<=r+1;x++){\n\t\t\tfor(int y=1;y<=c+1;y++){System.out.print(hyo[x][y]);\n\t\t\tif(y!=c+1){System.out.print(\" \");}}\n\t\t\tSystem.out.println();\n\t\t}\n\t\t}}",
"Main"
] | import java.io.*;
public class Main {
public static void main(String[] args)throws IOException {
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
String str = br.readLine();
String[] i=str.split(" ");
int r=Integer.parseInt(i[0]),c=Integer.parseInt(i[1]);
int [][]hyo=new int[r+2][c+2];
for (int x=1;x<=r;x++){
str = br.readLine();
i=str.split(" ");
for(int y=0;y<c;y++){
hyo[x][y+1]=Integer.parseInt(i[y]);
hyo[x][c+1]+=Integer.parseInt(i[y]);
hyo[r+1][y+1]+=Integer.parseInt(i[y]);}
hyo[r+1][c+1]+=hyo[x][c+1];
}
for (int x=1;x<=r+1;x++){
for(int y=1;y<=c+1;y++){System.out.print(hyo[x][y]);
if(y!=c+1){System.out.print(" ");}}
System.out.println();
}
}} |
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
4,
18,
13,
17,
41,
13,
4,
18,
13,
18,
13,
17,
41,
13,
4,
18,
13,
18,
13,
17,
41,
13,
20,
41,
13,
4,
18,
13,
17,
41,
13,
20,
2,
13,
17,
2,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
41,
13,
4,
18,
4,
18,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
18,
18,
13,
13,
13,
4,
18,
13,
18,
13,
13,
0,
18,
18,
13,
13,
13,
18,
18,
13,
13,
13,
0,
18,
18,
13,
13,
13,
18,
18,
13,
13,
13,
4,
18,
4,
18,
13,
18,
13,
13,
17,
4,
18,
4,
18,
13,
18,
18,
13,
13,
13,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
4,
18,
4,
18,
13,
18,
18,
13,
13,
13,
17,
0,
18,
18,
13,
13,
13,
18,
18,
13,
13,
13,
4,
18,
4,
18,
13,
18,
18,
13,
13,
13,
13,
4,
18,
18,
13,
13,
4,
18,
13,
23,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
16,
17
],
[
17,
18
],
[
14,
19
],
[
8,
20
],
[
20,
21
],
[
20,
22
],
[
22,
23
],
[
23,
24
],
[
22,
25
],
[
25,
26
],
[
25,
27
],
[
8,
28
],
[
28,
29
],
[
28,
30
],
[
30,
31
],
[
31,
32
],
[
30,
33
],
[
33,
34
],
[
33,
35
],
[
8,
36
],
[
36,
37
],
[
36,
38
],
[
8,
39
],
[
39,
40
],
[
39,
41
],
[
41,
42
],
[
42,
43
],
[
41,
44
],
[
8,
45
],
[
45,
46
],
[
45,
47
],
[
48,
49
],
[
48,
50
],
[
51,
52
],
[
51,
53
],
[
8,
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
],
[
67,
69
],
[
69,
70
],
[
70,
71
],
[
71,
72
],
[
72,
73
],
[
69,
74
],
[
66,
75
],
[
75,
76
],
[
76,
77
],
[
77,
78
],
[
77,
79
],
[
75,
80
],
[
80,
81
],
[
80,
82
],
[
75,
83
],
[
83,
84
],
[
84,
85
],
[
75,
86
],
[
87,
87
],
[
87,
88
],
[
88,
89
],
[
89,
90
],
[
90,
91
],
[
90,
92
],
[
89,
93
],
[
88,
94
],
[
94,
95
],
[
95,
96
],
[
94,
97
],
[
97,
98
],
[
97,
99
],
[
87,
100
],
[
100,
101
],
[
101,
102
],
[
102,
103
],
[
102,
104
],
[
101,
105
],
[
100,
106
],
[
106,
107
],
[
107,
108
],
[
107,
109
],
[
106,
110
],
[
87,
111
],
[
111,
112
],
[
112,
113
],
[
113,
114
],
[
113,
115
],
[
112,
116
],
[
111,
117
],
[
117,
118
],
[
118,
119
],
[
118,
120
],
[
117,
121
],
[
87,
122
],
[
122,
123
],
[
123,
124
],
[
124,
125
],
[
125,
126
],
[
124,
127
],
[
127,
128
],
[
127,
129
],
[
122,
130
],
[
66,
131
],
[
131,
132
],
[
132,
133
],
[
133,
134
],
[
134,
135
],
[
133,
136
],
[
136,
137
],
[
137,
138
],
[
137,
139
],
[
136,
140
],
[
131,
141
],
[
8,
142
],
[
142,
143
],
[
143,
144
],
[
144,
145
],
[
144,
146
],
[
142,
147
],
[
147,
148
],
[
147,
149
],
[
142,
150
],
[
150,
151
],
[
151,
152
],
[
142,
153
],
[
154,
154
],
[
154,
155
],
[
155,
156
],
[
156,
157
],
[
157,
158
],
[
158,
159
],
[
157,
160
],
[
160,
161
],
[
161,
162
],
[
161,
163
],
[
160,
164
],
[
155,
165
],
[
154,
166
],
[
166,
167
],
[
167,
168
],
[
168,
169
],
[
168,
170
],
[
167,
171
],
[
166,
172
],
[
172,
173
],
[
173,
174
],
[
173,
175
],
[
172,
176
],
[
8,
177
],
[
177,
178
],
[
178,
179
],
[
179,
180
],
[
180,
181
],
[
179,
182
],
[
182,
183
],
[
183,
184
],
[
183,
185
],
[
182,
186
],
[
177,
187
],
[
8,
188
],
[
188,
189
],
[
189,
190
],
[
190,
191
],
[
190,
192
],
[
188,
193
],
[
193,
194
],
[
194,
195
],
[
6,
196
],
[
196,
197
]
] | [
"import java.util.*;\n\nclass Main {\n\tpublic static void main(String[] args){\n\t\t\n\t\tScanner sc = new Scanner(System.in);\n\t\t\n\t\tfinal String[] len = sc.nextLine().split(\" \");\n\t\tfinal int r = Integer.parseInt(len[0]);\n\t\tfinal int c = Integer.parseInt(len[1]);\n\t\tStringBuilder sb = new StringBuilder();\n\t\tfinal String lb = System.getProperty(\"line.separator\");\n\t\tint[][] mat = new int[r + 1][c + 1];\n\t\t\n\t\tfor(int i = 0; i < r; i++){\n\t\t\tfinal String[] col = sc.nextLine().split(\" \");\n\t\t\tfor(int j = 0; j < c; j++){\n\t\t\t\tmat[i][j] = Integer.parseInt(col[j]);\n\t\t\t\tmat[i][c] += mat[i][j];\n\t\t\t\tmat[r][j] += mat[i][j];\n\t\t\t\tsb.append(col[j]).append(\" \");\n\t\t\t}\n\t\t\tsb.append(mat[i][c]).append(lb);\n\t\t}\n\t\tfor(int i = 0; i < c; i++){\n\t\t\tsb.append(mat[r][i]).append(\" \");\n\t\t\tmat[r][c] += mat[r][i];\n\t\t}\n\t\tsb.append(mat[r][c]).append(lb);\n\t\tSystem.out.print(sb.toString());\n\t}\n}",
"import java.util.*;",
"util.*",
"java",
"class Main {\n\tpublic static void main(String[] args){\n\t\t\n\t\tScanner sc = new Scanner(System.in);\n\t\t\n\t\tfinal String[] len = sc.nextLine().split(\" \");\n\t\tfinal int r = Integer.parseInt(len[0]);\n\t\tfinal int c = Integer.parseInt(len[1]);\n\t\tStringBuilder sb = new StringBuilder();\n\t\tfinal String lb = System.getProperty(\"line.separator\");\n\t\tint[][] mat = new int[r + 1][c + 1];\n\t\t\n\t\tfor(int i = 0; i < r; i++){\n\t\t\tfinal String[] col = sc.nextLine().split(\" \");\n\t\t\tfor(int j = 0; j < c; j++){\n\t\t\t\tmat[i][j] = Integer.parseInt(col[j]);\n\t\t\t\tmat[i][c] += mat[i][j];\n\t\t\t\tmat[r][j] += mat[i][j];\n\t\t\t\tsb.append(col[j]).append(\" \");\n\t\t\t}\n\t\t\tsb.append(mat[i][c]).append(lb);\n\t\t}\n\t\tfor(int i = 0; i < c; i++){\n\t\t\tsb.append(mat[r][i]).append(\" \");\n\t\t\tmat[r][c] += mat[r][i];\n\t\t}\n\t\tsb.append(mat[r][c]).append(lb);\n\t\tSystem.out.print(sb.toString());\n\t}\n}",
"Main",
"public static void main(String[] args){\n\t\t\n\t\tScanner sc = new Scanner(System.in);\n\t\t\n\t\tfinal String[] len = sc.nextLine().split(\" \");\n\t\tfinal int r = Integer.parseInt(len[0]);\n\t\tfinal int c = Integer.parseInt(len[1]);\n\t\tStringBuilder sb = new StringBuilder();\n\t\tfinal String lb = System.getProperty(\"line.separator\");\n\t\tint[][] mat = new int[r + 1][c + 1];\n\t\t\n\t\tfor(int i = 0; i < r; i++){\n\t\t\tfinal String[] col = sc.nextLine().split(\" \");\n\t\t\tfor(int j = 0; j < c; j++){\n\t\t\t\tmat[i][j] = Integer.parseInt(col[j]);\n\t\t\t\tmat[i][c] += mat[i][j];\n\t\t\t\tmat[r][j] += mat[i][j];\n\t\t\t\tsb.append(col[j]).append(\" \");\n\t\t\t}\n\t\t\tsb.append(mat[i][c]).append(lb);\n\t\t}\n\t\tfor(int i = 0; i < c; i++){\n\t\t\tsb.append(mat[r][i]).append(\" \");\n\t\t\tmat[r][c] += mat[r][i];\n\t\t}\n\t\tsb.append(mat[r][c]).append(lb);\n\t\tSystem.out.print(sb.toString());\n\t}",
"main",
"{\n\t\t\n\t\tScanner sc = new Scanner(System.in);\n\t\t\n\t\tfinal String[] len = sc.nextLine().split(\" \");\n\t\tfinal int r = Integer.parseInt(len[0]);\n\t\tfinal int c = Integer.parseInt(len[1]);\n\t\tStringBuilder sb = new StringBuilder();\n\t\tfinal String lb = System.getProperty(\"line.separator\");\n\t\tint[][] mat = new int[r + 1][c + 1];\n\t\t\n\t\tfor(int i = 0; i < r; i++){\n\t\t\tfinal String[] col = sc.nextLine().split(\" \");\n\t\t\tfor(int j = 0; j < c; j++){\n\t\t\t\tmat[i][j] = Integer.parseInt(col[j]);\n\t\t\t\tmat[i][c] += mat[i][j];\n\t\t\t\tmat[r][j] += mat[i][j];\n\t\t\t\tsb.append(col[j]).append(\" \");\n\t\t\t}\n\t\t\tsb.append(mat[i][c]).append(lb);\n\t\t}\n\t\tfor(int i = 0; i < c; i++){\n\t\t\tsb.append(mat[r][i]).append(\" \");\n\t\t\tmat[r][c] += mat[r][i];\n\t\t}\n\t\tsb.append(mat[r][c]).append(lb);\n\t\tSystem.out.print(sb.toString());\n\t}",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"final String[] len = sc.nextLine().split(\" \");",
"len",
"sc.nextLine().split(\" \")",
"sc.nextLine().split",
"sc.nextLine()",
"sc.nextLine",
"sc",
"\" \"",
"final int r = Integer.parseInt(len[0]);",
"r",
"Integer.parseInt(len[0])",
"Integer.parseInt",
"Integer",
"len[0]",
"len",
"0",
"final int c = Integer.parseInt(len[1]);",
"c",
"Integer.parseInt(len[1])",
"Integer.parseInt",
"Integer",
"len[1]",
"len",
"1",
"StringBuilder sb = new StringBuilder();",
"sb",
"new StringBuilder()",
"final String lb = System.getProperty(\"line.separator\");",
"lb",
"System.getProperty(\"line.separator\")",
"System.getProperty",
"System",
"\"line.separator\"",
"int[][] mat = new int[r + 1][c + 1];",
"mat",
"new int[r + 1][c + 1]",
"r + 1",
"r",
"1",
"c + 1",
"c",
"1",
"for(int i = 0; i < r; i++){\n\t\t\tfinal String[] col = sc.nextLine().split(\" \");\n\t\t\tfor(int j = 0; j < c; j++){\n\t\t\t\tmat[i][j] = Integer.parseInt(col[j]);\n\t\t\t\tmat[i][c] += mat[i][j];\n\t\t\t\tmat[r][j] += mat[i][j];\n\t\t\t\tsb.append(col[j]).append(\" \");\n\t\t\t}\n\t\t\tsb.append(mat[i][c]).append(lb);\n\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < r",
"i",
"r",
"i++",
"i++",
"i",
"{\n\t\t\tfinal String[] col = sc.nextLine().split(\" \");\n\t\t\tfor(int j = 0; j < c; j++){\n\t\t\t\tmat[i][j] = Integer.parseInt(col[j]);\n\t\t\t\tmat[i][c] += mat[i][j];\n\t\t\t\tmat[r][j] += mat[i][j];\n\t\t\t\tsb.append(col[j]).append(\" \");\n\t\t\t}\n\t\t\tsb.append(mat[i][c]).append(lb);\n\t\t}",
"{\n\t\t\tfinal String[] col = sc.nextLine().split(\" \");\n\t\t\tfor(int j = 0; j < c; j++){\n\t\t\t\tmat[i][j] = Integer.parseInt(col[j]);\n\t\t\t\tmat[i][c] += mat[i][j];\n\t\t\t\tmat[r][j] += mat[i][j];\n\t\t\t\tsb.append(col[j]).append(\" \");\n\t\t\t}\n\t\t\tsb.append(mat[i][c]).append(lb);\n\t\t}",
"final String[] col = sc.nextLine().split(\" \");",
"col",
"sc.nextLine().split(\" \")",
"sc.nextLine().split",
"sc.nextLine()",
"sc.nextLine",
"sc",
"\" \"",
"for(int j = 0; j < c; j++){\n\t\t\t\tmat[i][j] = Integer.parseInt(col[j]);\n\t\t\t\tmat[i][c] += mat[i][j];\n\t\t\t\tmat[r][j] += mat[i][j];\n\t\t\t\tsb.append(col[j]).append(\" \");\n\t\t\t}",
"int j = 0;",
"int j = 0;",
"j",
"0",
"j < c",
"j",
"c",
"j++",
"j++",
"j",
"{\n\t\t\t\tmat[i][j] = Integer.parseInt(col[j]);\n\t\t\t\tmat[i][c] += mat[i][j];\n\t\t\t\tmat[r][j] += mat[i][j];\n\t\t\t\tsb.append(col[j]).append(\" \");\n\t\t\t}",
"{\n\t\t\t\tmat[i][j] = Integer.parseInt(col[j]);\n\t\t\t\tmat[i][c] += mat[i][j];\n\t\t\t\tmat[r][j] += mat[i][j];\n\t\t\t\tsb.append(col[j]).append(\" \");\n\t\t\t}",
"mat[i][j] = Integer.parseInt(col[j])",
"mat[i][j]",
"mat[i]",
"mat",
"i",
"j",
"Integer.parseInt(col[j])",
"Integer.parseInt",
"Integer",
"col[j]",
"col",
"j",
"mat[i][c] += mat[i][j]",
"mat[i][c]",
"mat[i]",
"mat",
"i",
"c",
"mat[i][j]",
"mat[i]",
"mat",
"i",
"j",
"mat[r][j] += mat[i][j]",
"mat[r][j]",
"mat[r]",
"mat",
"r",
"j",
"mat[i][j]",
"mat[i]",
"mat",
"i",
"j",
"sb.append(col[j]).append(\" \")",
"sb.append(col[j]).append",
"sb.append(col[j])",
"sb.append",
"sb",
"col[j]",
"col",
"j",
"\" \"",
"sb.append(mat[i][c]).append(lb)",
"sb.append(mat[i][c]).append",
"sb.append(mat[i][c])",
"sb.append",
"sb",
"mat[i][c]",
"mat[i]",
"mat",
"i",
"c",
"lb",
"for(int i = 0; i < c; i++){\n\t\t\tsb.append(mat[r][i]).append(\" \");\n\t\t\tmat[r][c] += mat[r][i];\n\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < c",
"i",
"c",
"i++",
"i++",
"i",
"{\n\t\t\tsb.append(mat[r][i]).append(\" \");\n\t\t\tmat[r][c] += mat[r][i];\n\t\t}",
"{\n\t\t\tsb.append(mat[r][i]).append(\" \");\n\t\t\tmat[r][c] += mat[r][i];\n\t\t}",
"sb.append(mat[r][i]).append(\" \")",
"sb.append(mat[r][i]).append",
"sb.append(mat[r][i])",
"sb.append",
"sb",
"mat[r][i]",
"mat[r]",
"mat",
"r",
"i",
"\" \"",
"mat[r][c] += mat[r][i]",
"mat[r][c]",
"mat[r]",
"mat",
"r",
"c",
"mat[r][i]",
"mat[r]",
"mat",
"r",
"i",
"sb.append(mat[r][c]).append(lb)",
"sb.append(mat[r][c]).append",
"sb.append(mat[r][c])",
"sb.append",
"sb",
"mat[r][c]",
"mat[r]",
"mat",
"r",
"c",
"lb",
"System.out.print(sb.toString())",
"System.out.print",
"System.out",
"System",
"System.out",
"sb.toString()",
"sb.toString",
"sb",
"String[] args",
"args"
] | import java.util.*;
class Main {
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
final String[] len = sc.nextLine().split(" ");
final int r = Integer.parseInt(len[0]);
final int c = Integer.parseInt(len[1]);
StringBuilder sb = new StringBuilder();
final String lb = System.getProperty("line.separator");
int[][] mat = new int[r + 1][c + 1];
for(int i = 0; i < r; i++){
final String[] col = sc.nextLine().split(" ");
for(int j = 0; j < c; j++){
mat[i][j] = Integer.parseInt(col[j]);
mat[i][c] += mat[i][j];
mat[r][j] += mat[i][j];
sb.append(col[j]).append(" ");
}
sb.append(mat[i][c]).append(lb);
}
for(int i = 0; i < c; i++){
sb.append(mat[r][i]).append(" ");
mat[r][c] += mat[r][i];
}
sb.append(mat[r][c]).append(lb);
System.out.print(sb.toString());
}
} |
[
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,
41,
13,
41,
13,
41,
13,
41,
13,
17,
0,
13,
20,
13,
0,
13,
20,
13,
0,
13,
20,
13,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
0,
18,
13,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
0,
18,
13,
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,
18,
18,
13,
13,
13,
4,
18,
13,
0,
18,
13,
13,
18,
18,
13,
13,
13,
0,
18,
13,
13,
18,
18,
13,
13,
13,
0,
13,
18,
18,
13,
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,
4,
18,
18,
13,
13,
2,
18,
18,
13,
13,
13,
17,
4,
18,
18,
13,
13,
18,
13,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
4,
18,
18,
13,
13,
2,
18,
13,
13,
17,
4,
18,
18,
13,
13,
13,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
219,
8
],
[
219,
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
],
[
11,
25
],
[
25,
26
],
[
11,
27
],
[
27,
28
],
[
11,
29
],
[
29,
30
],
[
11,
31
],
[
31,
32
],
[
31,
33
],
[
11,
34
],
[
34,
35
],
[
34,
36
],
[
11,
38
],
[
38,
39
],
[
38,
40
],
[
11,
42
],
[
42,
43
],
[
42,
44
],
[
11,
47
],
[
47,
48
],
[
48,
49
],
[
49,
50
],
[
49,
51
],
[
47,
52
],
[
52,
53
],
[
52,
54
],
[
47,
55
],
[
55,
56
],
[
56,
57
],
[
47,
58
],
[
58,
59
],
[
59,
60
],
[
60,
61
],
[
60,
62
],
[
59,
63
],
[
11,
64
],
[
64,
65
],
[
65,
66
],
[
66,
67
],
[
66,
68
],
[
64,
69
],
[
69,
70
],
[
69,
71
],
[
64,
72
],
[
72,
73
],
[
73,
74
],
[
64,
75
],
[
75,
76
],
[
76,
77
],
[
77,
78
],
[
77,
79
],
[
76,
80
],
[
11,
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
],
[
108,
109
],
[
109,
110
],
[
109,
111
],
[
108,
112
],
[
107,
113
],
[
113,
114
],
[
114,
115
],
[
106,
116
],
[
116,
117
],
[
117,
118
],
[
117,
119
],
[
116,
120
],
[
120,
121
],
[
121,
122
],
[
121,
123
],
[
120,
124
],
[
106,
125
],
[
125,
126
],
[
126,
127
],
[
126,
128
],
[
125,
129
],
[
129,
130
],
[
130,
131
],
[
130,
132
],
[
129,
133
],
[
106,
134
],
[
134,
135
],
[
134,
136
],
[
136,
137
],
[
137,
138
],
[
137,
139
],
[
136,
140
],
[
11,
141
],
[
141,
142
],
[
142,
143
],
[
143,
144
],
[
143,
145
],
[
141,
146
],
[
146,
147
],
[
146,
148
],
[
141,
149
],
[
149,
150
],
[
150,
151
],
[
141,
152
],
[
153,
153
],
[
153,
154
],
[
154,
155
],
[
155,
156
],
[
156,
157
],
[
156,
158
],
[
154,
159
],
[
159,
160
],
[
159,
161
],
[
154,
162
],
[
162,
163
],
[
163,
164
],
[
154,
165
],
[
166,
166
],
[
166,
167
],
[
167,
168
],
[
168,
169
],
[
169,
170
],
[
169,
171
],
[
167,
172
],
[
172,
173
],
[
173,
174
],
[
174,
175
],
[
174,
176
],
[
173,
177
],
[
172,
178
],
[
153,
179
],
[
179,
180
],
[
180,
181
],
[
181,
182
],
[
181,
183
],
[
179,
184
],
[
184,
185
],
[
184,
186
],
[
11,
187
],
[
187,
188
],
[
188,
189
],
[
189,
190
],
[
189,
191
],
[
187,
192
],
[
192,
193
],
[
192,
194
],
[
187,
195
],
[
195,
196
],
[
196,
197
],
[
187,
198
],
[
199,
199
],
[
199,
200
],
[
200,
201
],
[
201,
202
],
[
202,
203
],
[
202,
204
],
[
200,
205
],
[
205,
206
],
[
206,
207
],
[
206,
208
],
[
205,
209
],
[
11,
210
],
[
210,
211
],
[
211,
212
],
[
212,
213
],
[
212,
214
],
[
210,
215
],
[
9,
216
],
[
216,
217
],
[
0,
218
],
[
218,
219
],
[
218,
220
]
] | [
"import java.io.*;\nimport java.util.*;\n\npublic class Main{\n public static void main(String[] args){\n Scanner sc=new Scanner(System.in);\n int r=sc.nextInt();\n int c=sc.nextInt();\n int sumr[];\n int sumc[];\n int a[][];\n int sum=0;\n sumr=new int[r];\n sumc=new int[c];\n a=new int[r][c];\n for(int i=0;i<r;i++) sumr[i]=0;\n for(int j=0;j<c;j++) sumc[j]=0;\n for(int i=0;i<r;i++){\n for(int j=0;j<c;j++){\n a[i][j]=sc.nextInt();\n sumr[i]+=a[i][j];\n sumc[j]+=a[i][j];\n sum+=a[i][j];\n }\n }\n for(int i=0;i<r;i++){\n for(int j=0;j<c;j++){\n System.out.print(a[i][j]+\" \");\n }\n System.out.println(sumr[i]);\n }\n for(int j=0;j<c;j++){\n System.out.print(sumc[j]+\" \");\n }\n System.out.println(sum);\n }\n}\n",
"import java.io.*;",
"io.*",
"java",
"import java.util.*;",
"util.*",
"java",
"public class Main{\n public static void main(String[] args){\n Scanner sc=new Scanner(System.in);\n int r=sc.nextInt();\n int c=sc.nextInt();\n int sumr[];\n int sumc[];\n int a[][];\n int sum=0;\n sumr=new int[r];\n sumc=new int[c];\n a=new int[r][c];\n for(int i=0;i<r;i++) sumr[i]=0;\n for(int j=0;j<c;j++) sumc[j]=0;\n for(int i=0;i<r;i++){\n for(int j=0;j<c;j++){\n a[i][j]=sc.nextInt();\n sumr[i]+=a[i][j];\n sumc[j]+=a[i][j];\n sum+=a[i][j];\n }\n }\n for(int i=0;i<r;i++){\n for(int j=0;j<c;j++){\n System.out.print(a[i][j]+\" \");\n }\n System.out.println(sumr[i]);\n }\n for(int j=0;j<c;j++){\n System.out.print(sumc[j]+\" \");\n }\n System.out.println(sum);\n }\n}",
"Main",
"public static void main(String[] args){\n Scanner sc=new Scanner(System.in);\n int r=sc.nextInt();\n int c=sc.nextInt();\n int sumr[];\n int sumc[];\n int a[][];\n int sum=0;\n sumr=new int[r];\n sumc=new int[c];\n a=new int[r][c];\n for(int i=0;i<r;i++) sumr[i]=0;\n for(int j=0;j<c;j++) sumc[j]=0;\n for(int i=0;i<r;i++){\n for(int j=0;j<c;j++){\n a[i][j]=sc.nextInt();\n sumr[i]+=a[i][j];\n sumc[j]+=a[i][j];\n sum+=a[i][j];\n }\n }\n for(int i=0;i<r;i++){\n for(int j=0;j<c;j++){\n System.out.print(a[i][j]+\" \");\n }\n System.out.println(sumr[i]);\n }\n for(int j=0;j<c;j++){\n System.out.print(sumc[j]+\" \");\n }\n System.out.println(sum);\n }",
"main",
"{\n Scanner sc=new Scanner(System.in);\n int r=sc.nextInt();\n int c=sc.nextInt();\n int sumr[];\n int sumc[];\n int a[][];\n int sum=0;\n sumr=new int[r];\n sumc=new int[c];\n a=new int[r][c];\n for(int i=0;i<r;i++) sumr[i]=0;\n for(int j=0;j<c;j++) sumc[j]=0;\n for(int i=0;i<r;i++){\n for(int j=0;j<c;j++){\n a[i][j]=sc.nextInt();\n sumr[i]+=a[i][j];\n sumc[j]+=a[i][j];\n sum+=a[i][j];\n }\n }\n for(int i=0;i<r;i++){\n for(int j=0;j<c;j++){\n System.out.print(a[i][j]+\" \");\n }\n System.out.println(sumr[i]);\n }\n for(int j=0;j<c;j++){\n System.out.print(sumc[j]+\" \");\n }\n System.out.println(sum);\n }",
"Scanner sc=new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"int r=sc.nextInt();",
"r",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int c=sc.nextInt();",
"c",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int sumr[];",
"sumr",
"int sumc[];",
"sumc",
"int a[][];",
"a",
"int sum=0;",
"sum",
"0",
"sumr=new int[r]",
"sumr",
"new int[r]",
"r",
"sumc=new int[c]",
"sumc",
"new int[c]",
"c",
"a=new int[r][c]",
"a",
"new int[r][c]",
"r",
"c",
"for(int i=0;i<r;i++) sumr[i]=0;",
"int i=0;",
"int i=0;",
"i",
"0",
"i<r",
"i",
"r",
"i++",
"i++",
"i",
"sumr[i]=0;",
"sumr[i]=0",
"sumr[i]",
"sumr",
"i",
"0",
"for(int j=0;j<c;j++) sumc[j]=0;",
"int j=0;",
"int j=0;",
"j",
"0",
"j<c",
"j",
"c",
"j++",
"j++",
"j",
"sumc[j]=0;",
"sumc[j]=0",
"sumc[j]",
"sumc",
"j",
"0",
"for(int i=0;i<r;i++){\n for(int j=0;j<c;j++){\n a[i][j]=sc.nextInt();\n sumr[i]+=a[i][j];\n sumc[j]+=a[i][j];\n sum+=a[i][j];\n }\n }",
"int i=0;",
"int i=0;",
"i",
"0",
"i<r",
"i",
"r",
"i++",
"i++",
"i",
"{\n for(int j=0;j<c;j++){\n a[i][j]=sc.nextInt();\n sumr[i]+=a[i][j];\n sumc[j]+=a[i][j];\n sum+=a[i][j];\n }\n }",
"{\n for(int j=0;j<c;j++){\n a[i][j]=sc.nextInt();\n sumr[i]+=a[i][j];\n sumc[j]+=a[i][j];\n sum+=a[i][j];\n }\n }",
"for(int j=0;j<c;j++){\n a[i][j]=sc.nextInt();\n sumr[i]+=a[i][j];\n sumc[j]+=a[i][j];\n sum+=a[i][j];\n }",
"int j=0;",
"int j=0;",
"j",
"0",
"j<c",
"j",
"c",
"j++",
"j++",
"j",
"{\n a[i][j]=sc.nextInt();\n sumr[i]+=a[i][j];\n sumc[j]+=a[i][j];\n sum+=a[i][j];\n }",
"{\n a[i][j]=sc.nextInt();\n sumr[i]+=a[i][j];\n sumc[j]+=a[i][j];\n sum+=a[i][j];\n }",
"a[i][j]=sc.nextInt()",
"a[i][j]",
"a[i]",
"a",
"i",
"j",
"sc.nextInt()",
"sc.nextInt",
"sc",
"sumr[i]+=a[i][j]",
"sumr[i]",
"sumr",
"i",
"a[i][j]",
"a[i]",
"a",
"i",
"j",
"sumc[j]+=a[i][j]",
"sumc[j]",
"sumc",
"j",
"a[i][j]",
"a[i]",
"a",
"i",
"j",
"sum+=a[i][j]",
"sum",
"a[i][j]",
"a[i]",
"a",
"i",
"j",
"for(int i=0;i<r;i++){\n for(int j=0;j<c;j++){\n System.out.print(a[i][j]+\" \");\n }\n System.out.println(sumr[i]);\n }",
"int i=0;",
"int i=0;",
"i",
"0",
"i<r",
"i",
"r",
"i++",
"i++",
"i",
"{\n for(int j=0;j<c;j++){\n System.out.print(a[i][j]+\" \");\n }\n System.out.println(sumr[i]);\n }",
"{\n for(int j=0;j<c;j++){\n System.out.print(a[i][j]+\" \");\n }\n System.out.println(sumr[i]);\n }",
"for(int j=0;j<c;j++){\n System.out.print(a[i][j]+\" \");\n }",
"int j=0;",
"int j=0;",
"j",
"0",
"j<c",
"j",
"c",
"j++",
"j++",
"j",
"{\n System.out.print(a[i][j]+\" \");\n }",
"{\n System.out.print(a[i][j]+\" \");\n }",
"System.out.print(a[i][j]+\" \")",
"System.out.print",
"System.out",
"System",
"System.out",
"a[i][j]+\" \"",
"a[i][j]",
"a[i]",
"a",
"i",
"j",
"\" \"",
"System.out.println(sumr[i])",
"System.out.println",
"System.out",
"System",
"System.out",
"sumr[i]",
"sumr",
"i",
"for(int j=0;j<c;j++){\n System.out.print(sumc[j]+\" \");\n }",
"int j=0;",
"int j=0;",
"j",
"0",
"j<c",
"j",
"c",
"j++",
"j++",
"j",
"{\n System.out.print(sumc[j]+\" \");\n }",
"{\n System.out.print(sumc[j]+\" \");\n }",
"System.out.print(sumc[j]+\" \")",
"System.out.print",
"System.out",
"System",
"System.out",
"sumc[j]+\" \"",
"sumc[j]",
"sumc",
"j",
"\" \"",
"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 int r=sc.nextInt();\n int c=sc.nextInt();\n int sumr[];\n int sumc[];\n int a[][];\n int sum=0;\n sumr=new int[r];\n sumc=new int[c];\n a=new int[r][c];\n for(int i=0;i<r;i++) sumr[i]=0;\n for(int j=0;j<c;j++) sumc[j]=0;\n for(int i=0;i<r;i++){\n for(int j=0;j<c;j++){\n a[i][j]=sc.nextInt();\n sumr[i]+=a[i][j];\n sumc[j]+=a[i][j];\n sum+=a[i][j];\n }\n }\n for(int i=0;i<r;i++){\n for(int j=0;j<c;j++){\n System.out.print(a[i][j]+\" \");\n }\n System.out.println(sumr[i]);\n }\n for(int j=0;j<c;j++){\n System.out.print(sumc[j]+\" \");\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 int r=sc.nextInt();\n int c=sc.nextInt();\n int sumr[];\n int sumc[];\n int a[][];\n int sum=0;\n sumr=new int[r];\n sumc=new int[c];\n a=new int[r][c];\n for(int i=0;i<r;i++) sumr[i]=0;\n for(int j=0;j<c;j++) sumc[j]=0;\n for(int i=0;i<r;i++){\n for(int j=0;j<c;j++){\n a[i][j]=sc.nextInt();\n sumr[i]+=a[i][j];\n sumc[j]+=a[i][j];\n sum+=a[i][j];\n }\n }\n for(int i=0;i<r;i++){\n for(int j=0;j<c;j++){\n System.out.print(a[i][j]+\" \");\n }\n System.out.println(sumr[i]);\n }\n for(int j=0;j<c;j++){\n System.out.print(sumc[j]+\" \");\n }\n System.out.println(sum);\n }\n}",
"Main"
] | import java.io.*;
import java.util.*;
public class Main{
public static void main(String[] args){
Scanner sc=new Scanner(System.in);
int r=sc.nextInt();
int c=sc.nextInt();
int sumr[];
int sumc[];
int a[][];
int sum=0;
sumr=new int[r];
sumc=new int[c];
a=new int[r][c];
for(int i=0;i<r;i++) sumr[i]=0;
for(int j=0;j<c;j++) sumc[j]=0;
for(int i=0;i<r;i++){
for(int j=0;j<c;j++){
a[i][j]=sc.nextInt();
sumr[i]+=a[i][j];
sumc[j]+=a[i][j];
sum+=a[i][j];
}
}
for(int i=0;i<r;i++){
for(int j=0;j<c;j++){
System.out.print(a[i][j]+" ");
}
System.out.println(sumr[i]);
}
for(int j=0;j<c;j++){
System.out.print(sumc[j]+" ");
}
System.out.println(sum);
}
}
|
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
41,
13,
20,
2,
13,
17,
2,
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,
18,
18,
13,
13,
13,
4,
18,
13,
0,
18,
18,
13,
13,
13,
4,
13,
18,
13,
13,
11,
1,
41,
13,
17,
2,
13,
2,
13,
17,
1,
40,
13,
30,
30,
0,
18,
18,
13,
13,
13,
4,
13,
13,
13,
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,
14,
2,
13,
17,
4,
18,
18,
13,
13,
17,
4,
18,
18,
13,
13,
18,
18,
13,
13,
13,
4,
18,
18,
13,
13,
23,
13,
12,
13,
30,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
2,
18,
13,
13,
17,
1,
40,
13,
30,
30,
0,
13,
18,
13,
13,
29,
13,
23,
13,
12,
13,
30,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
2,
18,
13,
13,
17,
1,
40,
13,
30,
30,
0,
13,
18,
18,
13,
13,
13,
29,
13,
23,
13,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
228,
5
],
[
228,
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
],
[
19,
20
],
[
20,
21
],
[
8,
22
],
[
22,
23
],
[
22,
24
],
[
25,
26
],
[
25,
27
],
[
28,
29
],
[
28,
30
],
[
8,
31
],
[
31,
32
],
[
32,
33
],
[
33,
34
],
[
33,
35
],
[
31,
36
],
[
36,
37
],
[
36,
38
],
[
31,
39
],
[
39,
40
],
[
40,
41
],
[
31,
42
],
[
42,
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
],
[
55,
56
],
[
56,
57
],
[
57,
58
],
[
58,
59
],
[
59,
60
],
[
59,
61
],
[
58,
62
],
[
57,
63
],
[
63,
64
],
[
64,
65
],
[
43,
66
],
[
66,
67
],
[
67,
68
],
[
68,
69
],
[
68,
70
],
[
67,
71
],
[
66,
72
],
[
72,
73
],
[
72,
74
],
[
74,
75
],
[
74,
76
],
[
8,
77
],
[
77,
78
],
[
78,
79
],
[
79,
80
],
[
79,
81
],
[
77,
82
],
[
82,
83
],
[
82,
84
],
[
84,
85
],
[
84,
86
],
[
77,
87
],
[
87,
88
],
[
88,
89
],
[
77,
90
],
[
91,
91
],
[
91,
92
],
[
92,
93
],
[
93,
94
],
[
94,
95
],
[
94,
96
],
[
93,
97
],
[
92,
98
],
[
98,
99
],
[
98,
100
],
[
98,
101
],
[
8,
102
],
[
102,
103
],
[
103,
104
],
[
104,
105
],
[
104,
106
],
[
102,
107
],
[
107,
108
],
[
107,
109
],
[
109,
110
],
[
109,
111
],
[
102,
112
],
[
112,
113
],
[
113,
114
],
[
102,
115
],
[
115,
116
],
[
116,
117
],
[
117,
118
],
[
118,
119
],
[
119,
120
],
[
119,
121
],
[
117,
122
],
[
122,
123
],
[
122,
124
],
[
124,
125
],
[
124,
126
],
[
117,
127
],
[
127,
128
],
[
128,
129
],
[
117,
130
],
[
130,
131
],
[
131,
132
],
[
132,
133
],
[
133,
134
],
[
133,
135
],
[
132,
136
],
[
136,
137
],
[
137,
138
],
[
138,
139
],
[
138,
140
],
[
136,
141
],
[
131,
142
],
[
142,
143
],
[
143,
144
],
[
144,
145
],
[
144,
146
],
[
142,
147
],
[
147,
148
],
[
148,
149
],
[
148,
150
],
[
147,
151
],
[
116,
152
],
[
152,
153
],
[
153,
154
],
[
154,
155
],
[
154,
156
],
[
6,
157
],
[
157,
158
],
[
228,
159
],
[
159,
160
],
[
159,
161
],
[
161,
162
],
[
162,
163
],
[
162,
164
],
[
161,
165
],
[
165,
166
],
[
166,
167
],
[
167,
168
],
[
167,
169
],
[
165,
170
],
[
170,
171
],
[
170,
172
],
[
172,
173
],
[
173,
174
],
[
173,
175
],
[
172,
176
],
[
165,
177
],
[
177,
178
],
[
178,
179
],
[
165,
180
],
[
181,
181
],
[
181,
182
],
[
182,
183
],
[
182,
184
],
[
184,
185
],
[
184,
186
],
[
161,
187
],
[
187,
188
],
[
159,
189
],
[
189,
190
],
[
228,
191
],
[
191,
192
],
[
191,
193
],
[
193,
194
],
[
194,
195
],
[
194,
196
],
[
193,
197
],
[
197,
198
],
[
198,
199
],
[
199,
200
],
[
199,
201
],
[
197,
202
],
[
202,
203
],
[
202,
204
],
[
204,
205
],
[
205,
206
],
[
205,
207
],
[
204,
208
],
[
197,
209
],
[
209,
210
],
[
210,
211
],
[
197,
212
],
[
213,
213
],
[
213,
214
],
[
214,
215
],
[
214,
216
],
[
216,
217
],
[
217,
218
],
[
217,
219
],
[
216,
220
],
[
193,
221
],
[
221,
222
],
[
191,
223
],
[
223,
224
],
[
191,
225
],
[
225,
226
],
[
0,
227
],
[
227,
228
],
[
227,
229
]
] | [
"import java.util.Scanner;\npublic class Main {\n\tpublic static void main(String[] args) {\n\t\tScanner scan = new Scanner(System.in);\n\t\tint r = scan.nextInt();\t//行数\n\t\tint c = scan.nextInt();\t//列数\n\t\tint[][] array = new int[r + 1][c + 1];\n\t\tfor(int i = 0; i < r; i++){\n\t\t\tfor(int l = 0; l < c; l++){\n\t\t\t\t\tarray[i][l] = scan.nextInt();\n\t\t\t}//for\n\t\t\tarray[i][c] = sum(array[i]);\n\t\t}//for\n\t\tfor(int i = 0; i < c + 1; i++){\n\t\t\tarray[r][i] = sum(array, i);\n\t\t}\n\t\tfor(int i = 0; i < r + 1; i++){\n\t\t\tfor(int l = 0; l < c + 1; l++){\n\t\t\t\tif(l != 0) System.out.print(\" \");\n\t\t\t\tSystem.out.print(array[i][l]);\n\t\t\t}//for\n\t\t\tSystem.out.println();\n\t\t}//for\n\t}\n\tpublic static int sum (int[] array){\n\t\tint n = 0;\n\t\tfor(int i = 0; i < array.length - 1; i++){\n\t\t\tn += array[i];\n\t\t}\n\t\treturn n;\n\t}\n\tpublic static int sum (int[][] array, int col){\n\t\tint n = 0;\n\t\tfor(int i = 0; i < array.length - 1; i++){\n\t\t\tn += array[i][col];\n\t\t}\n\t\treturn n;\n\t}\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n\tpublic static void main(String[] args) {\n\t\tScanner scan = new Scanner(System.in);\n\t\tint r = scan.nextInt();\t//行数\n\t\tint c = scan.nextInt();\t//列数\n\t\tint[][] array = new int[r + 1][c + 1];\n\t\tfor(int i = 0; i < r; i++){\n\t\t\tfor(int l = 0; l < c; l++){\n\t\t\t\t\tarray[i][l] = scan.nextInt();\n\t\t\t}//for\n\t\t\tarray[i][c] = sum(array[i]);\n\t\t}//for\n\t\tfor(int i = 0; i < c + 1; i++){\n\t\t\tarray[r][i] = sum(array, i);\n\t\t}\n\t\tfor(int i = 0; i < r + 1; i++){\n\t\t\tfor(int l = 0; l < c + 1; l++){\n\t\t\t\tif(l != 0) System.out.print(\" \");\n\t\t\t\tSystem.out.print(array[i][l]);\n\t\t\t}//for\n\t\t\tSystem.out.println();\n\t\t}//for\n\t}\n\tpublic static int sum (int[] array){\n\t\tint n = 0;\n\t\tfor(int i = 0; i < array.length - 1; i++){\n\t\t\tn += array[i];\n\t\t}\n\t\treturn n;\n\t}\n\tpublic static int sum (int[][] array, int col){\n\t\tint n = 0;\n\t\tfor(int i = 0; i < array.length - 1; i++){\n\t\t\tn += array[i][col];\n\t\t}\n\t\treturn n;\n\t}\n}",
"Main",
"public static void main(String[] args) {\n\t\tScanner scan = new Scanner(System.in);\n\t\tint r = scan.nextInt();\t//行数\n\t\tint c = scan.nextInt();\t//列数\n\t\tint[][] array = new int[r + 1][c + 1];\n\t\tfor(int i = 0; i < r; i++){\n\t\t\tfor(int l = 0; l < c; l++){\n\t\t\t\t\tarray[i][l] = scan.nextInt();\n\t\t\t}//for\n\t\t\tarray[i][c] = sum(array[i]);\n\t\t}//for\n\t\tfor(int i = 0; i < c + 1; i++){\n\t\t\tarray[r][i] = sum(array, i);\n\t\t}\n\t\tfor(int i = 0; i < r + 1; i++){\n\t\t\tfor(int l = 0; l < c + 1; l++){\n\t\t\t\tif(l != 0) System.out.print(\" \");\n\t\t\t\tSystem.out.print(array[i][l]);\n\t\t\t}//for\n\t\t\tSystem.out.println();\n\t\t}//for\n\t}",
"main",
"{\n\t\tScanner scan = new Scanner(System.in);\n\t\tint r = scan.nextInt();\t//行数\n\t\tint c = scan.nextInt();\t//列数\n\t\tint[][] array = new int[r + 1][c + 1];\n\t\tfor(int i = 0; i < r; i++){\n\t\t\tfor(int l = 0; l < c; l++){\n\t\t\t\t\tarray[i][l] = scan.nextInt();\n\t\t\t}//for\n\t\t\tarray[i][c] = sum(array[i]);\n\t\t}//for\n\t\tfor(int i = 0; i < c + 1; i++){\n\t\t\tarray[r][i] = sum(array, i);\n\t\t}\n\t\tfor(int i = 0; i < r + 1; i++){\n\t\t\tfor(int l = 0; l < c + 1; l++){\n\t\t\t\tif(l != 0) System.out.print(\" \");\n\t\t\t\tSystem.out.print(array[i][l]);\n\t\t\t}//for\n\t\t\tSystem.out.println();\n\t\t}//for\n\t}",
"Scanner scan = new Scanner(System.in);",
"scan",
"new Scanner(System.in)",
"int r = scan.nextInt();",
"r",
"scan.nextInt()",
"scan.nextInt",
"scan",
"int c = scan.nextInt();",
"c",
"scan.nextInt()",
"scan.nextInt",
"scan",
"int[][] array = new int[r + 1][c + 1];",
"array",
"new int[r + 1][c + 1]",
"r + 1",
"r",
"1",
"c + 1",
"c",
"1",
"for(int i = 0; i < r; i++){\n\t\t\tfor(int l = 0; l < c; l++){\n\t\t\t\t\tarray[i][l] = scan.nextInt();\n\t\t\t}//for\n\t\t\tarray[i][c] = sum(array[i]);\n\t\t}//for",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < r",
"i",
"r",
"i++",
"i++",
"i",
"{\n\t\t\tfor(int l = 0; l < c; l++){\n\t\t\t\t\tarray[i][l] = scan.nextInt();\n\t\t\t}//for\n\t\t\tarray[i][c] = sum(array[i]);\n\t\t}//for",
"{\n\t\t\tfor(int l = 0; l < c; l++){\n\t\t\t\t\tarray[i][l] = scan.nextInt();\n\t\t\t}//for\n\t\t\tarray[i][c] = sum(array[i]);\n\t\t}",
"for(int l = 0; l < c; l++){\n\t\t\t\t\tarray[i][l] = scan.nextInt();\n\t\t\t}//for",
"int l = 0;",
"int l = 0;",
"l",
"0",
"l < c",
"l",
"c",
"l++",
"l++",
"l",
"{\n\t\t\t\t\tarray[i][l] = scan.nextInt();\n\t\t\t}//for",
"{\n\t\t\t\t\tarray[i][l] = scan.nextInt();\n\t\t\t}",
"array[i][l] = scan.nextInt()",
"array[i][l]",
"array[i]",
"array",
"i",
"l",
"scan.nextInt()",
"scan.nextInt",
"scan",
"array[i][c] = sum(array[i])",
"array[i][c]",
"array[i]",
"array",
"i",
"c",
"sum(array[i])",
"sum",
"array[i]",
"array",
"i",
"for(int i = 0; i < c + 1; i++){\n\t\t\tarray[r][i] = sum(array, i);\n\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < c + 1",
"i",
"c + 1",
"c",
"1",
"i++",
"i++",
"i",
"{\n\t\t\tarray[r][i] = sum(array, i);\n\t\t}",
"{\n\t\t\tarray[r][i] = sum(array, i);\n\t\t}",
"array[r][i] = sum(array, i)",
"array[r][i]",
"array[r]",
"array",
"r",
"i",
"sum(array, i)",
"sum",
"array",
"i",
"for(int i = 0; i < r + 1; i++){\n\t\t\tfor(int l = 0; l < c + 1; l++){\n\t\t\t\tif(l != 0) System.out.print(\" \");\n\t\t\t\tSystem.out.print(array[i][l]);\n\t\t\t}//for\n\t\t\tSystem.out.println();\n\t\t}//for",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < r + 1",
"i",
"r + 1",
"r",
"1",
"i++",
"i++",
"i",
"{\n\t\t\tfor(int l = 0; l < c + 1; l++){\n\t\t\t\tif(l != 0) System.out.print(\" \");\n\t\t\t\tSystem.out.print(array[i][l]);\n\t\t\t}//for\n\t\t\tSystem.out.println();\n\t\t}//for",
"{\n\t\t\tfor(int l = 0; l < c + 1; l++){\n\t\t\t\tif(l != 0) System.out.print(\" \");\n\t\t\t\tSystem.out.print(array[i][l]);\n\t\t\t}//for\n\t\t\tSystem.out.println();\n\t\t}",
"for(int l = 0; l < c + 1; l++){\n\t\t\t\tif(l != 0) System.out.print(\" \");\n\t\t\t\tSystem.out.print(array[i][l]);\n\t\t\t}//for",
"int l = 0;",
"int l = 0;",
"l",
"0",
"l < c + 1",
"l",
"c + 1",
"c",
"1",
"l++",
"l++",
"l",
"{\n\t\t\t\tif(l != 0) System.out.print(\" \");\n\t\t\t\tSystem.out.print(array[i][l]);\n\t\t\t}//for",
"{\n\t\t\t\tif(l != 0) System.out.print(\" \");\n\t\t\t\tSystem.out.print(array[i][l]);\n\t\t\t}",
"if(l != 0) System.out.print(\" \");",
"l != 0",
"l",
"0",
"System.out.print(\" \")",
"System.out.print",
"System.out",
"System",
"System.out",
"\" \"",
"System.out.print(array[i][l])",
"System.out.print",
"System.out",
"System",
"System.out",
"array[i][l]",
"array[i]",
"array",
"i",
"l",
"System.out.println()",
"System.out.println",
"System.out",
"System",
"System.out",
"String[] args",
"args",
"public static int sum (int[] array){\n\t\tint n = 0;\n\t\tfor(int i = 0; i < array.length - 1; i++){\n\t\t\tn += array[i];\n\t\t}\n\t\treturn n;\n\t}",
"sum",
"{\n\t\tint n = 0;\n\t\tfor(int i = 0; i < array.length - 1; i++){\n\t\t\tn += array[i];\n\t\t}\n\t\treturn n;\n\t}",
"int n = 0;",
"n",
"0",
"for(int i = 0; i < array.length - 1; i++){\n\t\t\tn += array[i];\n\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < array.length - 1",
"i",
"array.length - 1",
"array.length",
"array",
"array.length",
"1",
"i++",
"i++",
"i",
"{\n\t\t\tn += array[i];\n\t\t}",
"{\n\t\t\tn += array[i];\n\t\t}",
"n += array[i]",
"n",
"array[i]",
"array",
"i",
"return n;",
"n",
"int[] array",
"array",
"public static int sum (int[][] array, int col){\n\t\tint n = 0;\n\t\tfor(int i = 0; i < array.length - 1; i++){\n\t\t\tn += array[i][col];\n\t\t}\n\t\treturn n;\n\t}",
"sum",
"{\n\t\tint n = 0;\n\t\tfor(int i = 0; i < array.length - 1; i++){\n\t\t\tn += array[i][col];\n\t\t}\n\t\treturn n;\n\t}",
"int n = 0;",
"n",
"0",
"for(int i = 0; i < array.length - 1; i++){\n\t\t\tn += array[i][col];\n\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < array.length - 1",
"i",
"array.length - 1",
"array.length",
"array",
"array.length",
"1",
"i++",
"i++",
"i",
"{\n\t\t\tn += array[i][col];\n\t\t}",
"{\n\t\t\tn += array[i][col];\n\t\t}",
"n += array[i][col]",
"n",
"array[i][col]",
"array[i]",
"array",
"i",
"col",
"return n;",
"n",
"int[][] array",
"array",
"int col",
"col",
"public class Main {\n\tpublic static void main(String[] args) {\n\t\tScanner scan = new Scanner(System.in);\n\t\tint r = scan.nextInt();\t//行数\n\t\tint c = scan.nextInt();\t//列数\n\t\tint[][] array = new int[r + 1][c + 1];\n\t\tfor(int i = 0; i < r; i++){\n\t\t\tfor(int l = 0; l < c; l++){\n\t\t\t\t\tarray[i][l] = scan.nextInt();\n\t\t\t}//for\n\t\t\tarray[i][c] = sum(array[i]);\n\t\t}//for\n\t\tfor(int i = 0; i < c + 1; i++){\n\t\t\tarray[r][i] = sum(array, i);\n\t\t}\n\t\tfor(int i = 0; i < r + 1; i++){\n\t\t\tfor(int l = 0; l < c + 1; l++){\n\t\t\t\tif(l != 0) System.out.print(\" \");\n\t\t\t\tSystem.out.print(array[i][l]);\n\t\t\t}//for\n\t\t\tSystem.out.println();\n\t\t}//for\n\t}\n\tpublic static int sum (int[] array){\n\t\tint n = 0;\n\t\tfor(int i = 0; i < array.length - 1; i++){\n\t\t\tn += array[i];\n\t\t}\n\t\treturn n;\n\t}\n\tpublic static int sum (int[][] array, int col){\n\t\tint n = 0;\n\t\tfor(int i = 0; i < array.length - 1; i++){\n\t\t\tn += array[i][col];\n\t\t}\n\t\treturn n;\n\t}\n}",
"public class Main {\n\tpublic static void main(String[] args) {\n\t\tScanner scan = new Scanner(System.in);\n\t\tint r = scan.nextInt();\t//行数\n\t\tint c = scan.nextInt();\t//列数\n\t\tint[][] array = new int[r + 1][c + 1];\n\t\tfor(int i = 0; i < r; i++){\n\t\t\tfor(int l = 0; l < c; l++){\n\t\t\t\t\tarray[i][l] = scan.nextInt();\n\t\t\t}//for\n\t\t\tarray[i][c] = sum(array[i]);\n\t\t}//for\n\t\tfor(int i = 0; i < c + 1; i++){\n\t\t\tarray[r][i] = sum(array, i);\n\t\t}\n\t\tfor(int i = 0; i < r + 1; i++){\n\t\t\tfor(int l = 0; l < c + 1; l++){\n\t\t\t\tif(l != 0) System.out.print(\" \");\n\t\t\t\tSystem.out.print(array[i][l]);\n\t\t\t}//for\n\t\t\tSystem.out.println();\n\t\t}//for\n\t}\n\tpublic static int sum (int[] array){\n\t\tint n = 0;\n\t\tfor(int i = 0; i < array.length - 1; i++){\n\t\t\tn += array[i];\n\t\t}\n\t\treturn n;\n\t}\n\tpublic static int sum (int[][] array, int col){\n\t\tint n = 0;\n\t\tfor(int i = 0; i < array.length - 1; i++){\n\t\t\tn += array[i][col];\n\t\t}\n\t\treturn n;\n\t}\n}",
"Main"
] | import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
int r = scan.nextInt(); //行数
int c = scan.nextInt(); //列数
int[][] array = new int[r + 1][c + 1];
for(int i = 0; i < r; i++){
for(int l = 0; l < c; l++){
array[i][l] = scan.nextInt();
}//for
array[i][c] = sum(array[i]);
}//for
for(int i = 0; i < c + 1; i++){
array[r][i] = sum(array, i);
}
for(int i = 0; i < r + 1; i++){
for(int l = 0; l < c + 1; l++){
if(l != 0) System.out.print(" ");
System.out.print(array[i][l]);
}//for
System.out.println();
}//for
}
public static int sum (int[] array){
int n = 0;
for(int i = 0; i < array.length - 1; i++){
n += array[i];
}
return n;
}
public static int sum (int[][] array, int col){
int n = 0;
for(int i = 0; i < array.length - 1; i++){
n += array[i][col];
}
return n;
}
} |
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
41,
13,
41,
13,
41,
13,
41,
13,
41,
13,
41,
13,
41,
13,
0,
13,
4,
18,
13,
0,
13,
4,
18,
13,
0,
13,
20,
2,
13,
17,
2,
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,
18,
13,
0,
18,
18,
13,
13,
13,
13,
0,
18,
18,
13,
13,
13,
13,
0,
18,
18,
13,
13,
13,
13,
0,
18,
18,
13,
13,
13,
18,
18,
13,
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,
4,
18,
18,
13,
13,
18,
18,
13,
13,
13,
14,
2,
13,
13,
30,
4,
18,
18,
13,
13,
17,
4,
18,
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
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
8,
14
],
[
14,
15
],
[
8,
16
],
[
16,
17
],
[
8,
18
],
[
18,
19
],
[
8,
20
],
[
20,
21
],
[
8,
22
],
[
22,
23
],
[
8,
24
],
[
24,
25
],
[
8,
26
],
[
26,
27
],
[
8,
28
],
[
28,
29
],
[
28,
30
],
[
30,
31
],
[
31,
32
],
[
8,
33
],
[
33,
34
],
[
33,
35
],
[
35,
36
],
[
36,
37
],
[
8,
38
],
[
38,
39
],
[
38,
40
],
[
41,
42
],
[
41,
43
],
[
44,
45
],
[
44,
46
],
[
8,
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
],
[
73,
75
],
[
75,
76
],
[
76,
77
],
[
72,
78
],
[
78,
79
],
[
79,
80
],
[
80,
81
],
[
80,
82
],
[
79,
83
],
[
78,
84
],
[
72,
85
],
[
85,
86
],
[
86,
87
],
[
87,
88
],
[
87,
89
],
[
86,
90
],
[
85,
91
],
[
72,
92
],
[
92,
93
],
[
93,
94
],
[
94,
95
],
[
94,
96
],
[
93,
97
],
[
92,
98
],
[
59,
99
],
[
99,
100
],
[
100,
101
],
[
101,
102
],
[
101,
103
],
[
100,
104
],
[
99,
105
],
[
105,
106
],
[
106,
107
],
[
106,
108
],
[
105,
109
],
[
8,
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
],
[
124,
125
],
[
125,
126
],
[
125,
127
],
[
123,
128
],
[
128,
129
],
[
128,
130
],
[
123,
131
],
[
131,
132
],
[
132,
133
],
[
123,
134
],
[
135,
135
],
[
135,
136
],
[
136,
137
],
[
137,
138
],
[
138,
139
],
[
138,
140
],
[
136,
141
],
[
141,
142
],
[
142,
143
],
[
142,
144
],
[
141,
145
],
[
135,
146
],
[
146,
147
],
[
147,
148
],
[
147,
149
],
[
146,
150
],
[
150,
151
],
[
151,
152
],
[
152,
153
],
[
153,
154
],
[
153,
155
],
[
151,
156
],
[
122,
157
],
[
157,
158
],
[
158,
159
],
[
159,
160
],
[
159,
161
],
[
6,
162
],
[
162,
163
]
] | [
"import java.util.Scanner;\n\nclass Main {\n\n\tpublic static void main(String args[]){\t\n\t\tScanner scan = new Scanner(System.in);\n\n\t\tint m, n;\n\t\tint a1, a2, a3, a4;\n\t\tint c;\n\t\tint a[][];\n\t\t\n\t\tn = scan.nextInt();\n\t\tm = scan.nextInt();\n\t\ta = new int[n + 1][m + 1];\n\t\t\n\t\tfor(int i = 0; i < n; i++){\n\t\t\tfor(int j = 0; j < m; j++){\n\t\t\t\ta1 = scan.nextInt();\n\t\t\t\ta[i][j] = a1;\n\t\t\t\ta[n][j] += a1;\n\t\t\t\ta[i][m] += a1;\n\t\t\t}\n\t\t\ta[n][m] += a[i][m];\n\t\t}\n\t\t\n\t\tfor(int i = 0; i <= n; i++){\n\t\t\tfor(int j = 0; j <= m; j++){\n\t\t\t\tSystem.out.print(a[i][j]);\n\t\t\t\tif(j != m){\n\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t}\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}\n\t\t\t\n\t}\n}\t",
"import java.util.Scanner;",
"Scanner",
"java.util",
"class Main {\n\n\tpublic static void main(String args[]){\t\n\t\tScanner scan = new Scanner(System.in);\n\n\t\tint m, n;\n\t\tint a1, a2, a3, a4;\n\t\tint c;\n\t\tint a[][];\n\t\t\n\t\tn = scan.nextInt();\n\t\tm = scan.nextInt();\n\t\ta = new int[n + 1][m + 1];\n\t\t\n\t\tfor(int i = 0; i < n; i++){\n\t\t\tfor(int j = 0; j < m; j++){\n\t\t\t\ta1 = scan.nextInt();\n\t\t\t\ta[i][j] = a1;\n\t\t\t\ta[n][j] += a1;\n\t\t\t\ta[i][m] += a1;\n\t\t\t}\n\t\t\ta[n][m] += a[i][m];\n\t\t}\n\t\t\n\t\tfor(int i = 0; i <= n; i++){\n\t\t\tfor(int j = 0; j <= m; j++){\n\t\t\t\tSystem.out.print(a[i][j]);\n\t\t\t\tif(j != m){\n\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t}\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}\n\t\t\t\n\t}\n}",
"Main",
"public static void main(String args[]){\t\n\t\tScanner scan = new Scanner(System.in);\n\n\t\tint m, n;\n\t\tint a1, a2, a3, a4;\n\t\tint c;\n\t\tint a[][];\n\t\t\n\t\tn = scan.nextInt();\n\t\tm = scan.nextInt();\n\t\ta = new int[n + 1][m + 1];\n\t\t\n\t\tfor(int i = 0; i < n; i++){\n\t\t\tfor(int j = 0; j < m; j++){\n\t\t\t\ta1 = scan.nextInt();\n\t\t\t\ta[i][j] = a1;\n\t\t\t\ta[n][j] += a1;\n\t\t\t\ta[i][m] += a1;\n\t\t\t}\n\t\t\ta[n][m] += a[i][m];\n\t\t}\n\t\t\n\t\tfor(int i = 0; i <= n; i++){\n\t\t\tfor(int j = 0; j <= m; j++){\n\t\t\t\tSystem.out.print(a[i][j]);\n\t\t\t\tif(j != m){\n\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t}\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}\n\t\t\t\n\t}",
"main",
"{\t\n\t\tScanner scan = new Scanner(System.in);\n\n\t\tint m, n;\n\t\tint a1, a2, a3, a4;\n\t\tint c;\n\t\tint a[][];\n\t\t\n\t\tn = scan.nextInt();\n\t\tm = scan.nextInt();\n\t\ta = new int[n + 1][m + 1];\n\t\t\n\t\tfor(int i = 0; i < n; i++){\n\t\t\tfor(int j = 0; j < m; j++){\n\t\t\t\ta1 = scan.nextInt();\n\t\t\t\ta[i][j] = a1;\n\t\t\t\ta[n][j] += a1;\n\t\t\t\ta[i][m] += a1;\n\t\t\t}\n\t\t\ta[n][m] += a[i][m];\n\t\t}\n\t\t\n\t\tfor(int i = 0; i <= n; i++){\n\t\t\tfor(int j = 0; j <= m; j++){\n\t\t\t\tSystem.out.print(a[i][j]);\n\t\t\t\tif(j != m){\n\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t}\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}\n\t\t\t\n\t}",
"Scanner scan = new Scanner(System.in);",
"scan",
"new Scanner(System.in)",
"int m",
"m",
"n;",
"n",
"int a1",
"a1",
"a2",
"a2",
"a3",
"a3",
"a4;",
"a4",
"int c;",
"c",
"int a[][];",
"a",
"n = scan.nextInt()",
"n",
"scan.nextInt()",
"scan.nextInt",
"scan",
"m = scan.nextInt()",
"m",
"scan.nextInt()",
"scan.nextInt",
"scan",
"a = new int[n + 1][m + 1]",
"a",
"new int[n + 1][m + 1]",
"n + 1",
"n",
"1",
"m + 1",
"m",
"1",
"for(int i = 0; i < n; i++){\n\t\t\tfor(int j = 0; j < m; j++){\n\t\t\t\ta1 = scan.nextInt();\n\t\t\t\ta[i][j] = a1;\n\t\t\t\ta[n][j] += a1;\n\t\t\t\ta[i][m] += a1;\n\t\t\t}\n\t\t\ta[n][m] += a[i][m];\n\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < n",
"i",
"n",
"i++",
"i++",
"i",
"{\n\t\t\tfor(int j = 0; j < m; j++){\n\t\t\t\ta1 = scan.nextInt();\n\t\t\t\ta[i][j] = a1;\n\t\t\t\ta[n][j] += a1;\n\t\t\t\ta[i][m] += a1;\n\t\t\t}\n\t\t\ta[n][m] += a[i][m];\n\t\t}",
"{\n\t\t\tfor(int j = 0; j < m; j++){\n\t\t\t\ta1 = scan.nextInt();\n\t\t\t\ta[i][j] = a1;\n\t\t\t\ta[n][j] += a1;\n\t\t\t\ta[i][m] += a1;\n\t\t\t}\n\t\t\ta[n][m] += a[i][m];\n\t\t}",
"for(int j = 0; j < m; j++){\n\t\t\t\ta1 = scan.nextInt();\n\t\t\t\ta[i][j] = a1;\n\t\t\t\ta[n][j] += a1;\n\t\t\t\ta[i][m] += a1;\n\t\t\t}",
"int j = 0;",
"int j = 0;",
"j",
"0",
"j < m",
"j",
"m",
"j++",
"j++",
"j",
"{\n\t\t\t\ta1 = scan.nextInt();\n\t\t\t\ta[i][j] = a1;\n\t\t\t\ta[n][j] += a1;\n\t\t\t\ta[i][m] += a1;\n\t\t\t}",
"{\n\t\t\t\ta1 = scan.nextInt();\n\t\t\t\ta[i][j] = a1;\n\t\t\t\ta[n][j] += a1;\n\t\t\t\ta[i][m] += a1;\n\t\t\t}",
"a1 = scan.nextInt()",
"a1",
"scan.nextInt()",
"scan.nextInt",
"scan",
"a[i][j] = a1",
"a[i][j]",
"a[i]",
"a",
"i",
"j",
"a1",
"a[n][j] += a1",
"a[n][j]",
"a[n]",
"a",
"n",
"j",
"a1",
"a[i][m] += a1",
"a[i][m]",
"a[i]",
"a",
"i",
"m",
"a1",
"a[n][m] += a[i][m]",
"a[n][m]",
"a[n]",
"a",
"n",
"m",
"a[i][m]",
"a[i]",
"a",
"i",
"m",
"for(int i = 0; i <= n; i++){\n\t\t\tfor(int j = 0; j <= m; j++){\n\t\t\t\tSystem.out.print(a[i][j]);\n\t\t\t\tif(j != m){\n\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t}\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i <= n",
"i",
"n",
"i++",
"i++",
"i",
"{\n\t\t\tfor(int j = 0; j <= m; j++){\n\t\t\t\tSystem.out.print(a[i][j]);\n\t\t\t\tif(j != m){\n\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t}\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}",
"{\n\t\t\tfor(int j = 0; j <= m; j++){\n\t\t\t\tSystem.out.print(a[i][j]);\n\t\t\t\tif(j != m){\n\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t}\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}",
"for(int j = 0; j <= m; j++){\n\t\t\t\tSystem.out.print(a[i][j]);\n\t\t\t\tif(j != m){\n\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t}\n\t\t\t}",
"int j = 0;",
"int j = 0;",
"j",
"0",
"j <= m",
"j",
"m",
"j++",
"j++",
"j",
"{\n\t\t\t\tSystem.out.print(a[i][j]);\n\t\t\t\tif(j != m){\n\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t}\n\t\t\t}",
"{\n\t\t\t\tSystem.out.print(a[i][j]);\n\t\t\t\tif(j != m){\n\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t}\n\t\t\t}",
"System.out.print(a[i][j])",
"System.out.print",
"System.out",
"System",
"System.out",
"a[i][j]",
"a[i]",
"a",
"i",
"j",
"if(j != m){\n\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t}",
"j != m",
"j",
"m",
"{\n\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t}",
"System.out.print(\" \")",
"System.out.print",
"System.out",
"System",
"System.out",
"\" \"",
"System.out.println()",
"System.out.println",
"System.out",
"System",
"System.out",
"String args[]",
"args"
] | import java.util.Scanner;
class Main {
public static void main(String args[]){
Scanner scan = new Scanner(System.in);
int m, n;
int a1, a2, a3, a4;
int c;
int a[][];
n = scan.nextInt();
m = scan.nextInt();
a = new int[n + 1][m + 1];
for(int i = 0; i < n; i++){
for(int j = 0; j < m; j++){
a1 = scan.nextInt();
a[i][j] = a1;
a[n][j] += a1;
a[i][m] += a1;
}
a[n][m] += a[i][m];
}
for(int i = 0; i <= n; i++){
for(int j = 0; j <= m; j++){
System.out.print(a[i][j]);
if(j != m){
System.out.print(" ");
}
}
System.out.println();
}
}
} |
[
7,
15,
13,
17,
6,
13,
41,
13,
20,
12,
13,
30,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
41,
13,
20,
2,
13,
17,
2,
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,
18,
18,
13,
13,
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,
0,
18,
18,
13,
13,
13,
18,
18,
13,
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,
0,
18,
18,
13,
13,
13,
18,
18,
13,
13,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
0,
18,
18,
13,
13,
13,
18,
18,
13,
13,
13,
11,
1,
41,
13,
17,
2,
13,
2,
13,
17,
1,
40,
13,
30,
30,
41,
13,
20,
11,
1,
41,
13,
17,
2,
13,
2,
13,
17,
1,
40,
13,
30,
30,
4,
18,
4,
18,
13,
18,
18,
13,
13,
13,
17,
4,
18,
18,
13,
13,
4,
18,
13,
17,
2,
4,
18,
13,
17,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
222,
5
],
[
222,
6
],
[
6,
7
],
[
6,
8
],
[
222,
9
],
[
9,
10
],
[
9,
11
],
[
11,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
11,
17
],
[
17,
18
],
[
17,
19
],
[
19,
20
],
[
20,
21
],
[
11,
22
],
[
22,
23
],
[
22,
24
],
[
25,
26
],
[
25,
27
],
[
28,
29
],
[
28,
30
],
[
11,
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
],
[
58,
62
],
[
57,
63
],
[
63,
64
],
[
64,
65
],
[
11,
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
],
[
90,
91
],
[
91,
92
],
[
92,
93
],
[
93,
94
],
[
93,
95
],
[
92,
96
],
[
91,
97
],
[
97,
98
],
[
98,
99
],
[
98,
100
],
[
97,
101
],
[
11,
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
],
[
126,
127
],
[
127,
128
],
[
128,
129
],
[
129,
130
],
[
129,
131
],
[
128,
132
],
[
127,
133
],
[
133,
134
],
[
134,
135
],
[
134,
136
],
[
133,
137
],
[
11,
138
],
[
138,
139
],
[
139,
140
],
[
140,
141
],
[
140,
142
],
[
138,
143
],
[
143,
144
],
[
143,
145
],
[
138,
146
],
[
146,
147
],
[
147,
148
],
[
138,
149
],
[
149,
150
],
[
150,
151
],
[
151,
152
],
[
152,
153
],
[
152,
154
],
[
151,
155
],
[
150,
156
],
[
156,
157
],
[
157,
158
],
[
157,
159
],
[
156,
160
],
[
11,
161
],
[
161,
162
],
[
162,
163
],
[
163,
164
],
[
163,
165
],
[
161,
166
],
[
166,
167
],
[
166,
168
],
[
168,
169
],
[
168,
170
],
[
161,
171
],
[
171,
172
],
[
172,
173
],
[
161,
174
],
[
175,
175
],
[
175,
176
],
[
176,
177
],
[
176,
178
],
[
175,
179
],
[
179,
180
],
[
180,
181
],
[
181,
182
],
[
181,
183
],
[
179,
184
],
[
184,
185
],
[
184,
186
],
[
186,
187
],
[
186,
188
],
[
179,
189
],
[
189,
190
],
[
190,
191
],
[
179,
192
],
[
193,
193
],
[
193,
194
],
[
194,
195
],
[
195,
196
],
[
196,
197
],
[
197,
198
],
[
196,
199
],
[
199,
200
],
[
200,
201
],
[
200,
202
],
[
199,
203
],
[
194,
204
],
[
175,
205
],
[
205,
206
],
[
206,
207
],
[
207,
208
],
[
207,
209
],
[
205,
210
],
[
210,
211
],
[
211,
212
],
[
210,
213
],
[
210,
214
],
[
214,
215
],
[
215,
216
],
[
216,
217
],
[
214,
218
],
[
9,
219
],
[
219,
220
],
[
0,
221
],
[
221,
222
],
[
221,
223
]
] | [
"import java.util.*;\n\npublic class Main {\n private static Scanner sc = new Scanner(System.in);\n public static void main(String[] args) throws Exception {\n int r = sc.nextInt();\n int c = sc.nextInt();\n int[][] ary = new int[r+1][c+1];\n for (int i = 0;i < r;i++) {\n for (int j = 0;j < c;j++) {\n ary[i][j] = sc.nextInt();\n }\n }\n \n for (int i = 0;i < c;i++) {\n for (int j = 0;j < r;j++) ary[r][i] += ary[j][i];\n }\n\n for (int i = 0;i < r;i++) {\n for (int j = 0;j < c;j++) ary[i][c] += ary[i][j];\n }\n \n for (int i = 0;i < r;i++) ary[r][c] += ary[i][c];\n \n for (int i = 0;i < r+1;i++) {\n StringBuilder sb = new StringBuilder();\n for (int j = 0;j < c+1;j++) {\n sb.append(ary[i][j]).append(\" \");\n }\n System.out.println(sb.substring(0, sb.length()-1));\n }\n }\n}\n",
"import java.util.*;",
"util.*",
"java",
"public class Main {\n private static Scanner sc = new Scanner(System.in);\n public static void main(String[] args) throws Exception {\n int r = sc.nextInt();\n int c = sc.nextInt();\n int[][] ary = new int[r+1][c+1];\n for (int i = 0;i < r;i++) {\n for (int j = 0;j < c;j++) {\n ary[i][j] = sc.nextInt();\n }\n }\n \n for (int i = 0;i < c;i++) {\n for (int j = 0;j < r;j++) ary[r][i] += ary[j][i];\n }\n\n for (int i = 0;i < r;i++) {\n for (int j = 0;j < c;j++) ary[i][c] += ary[i][j];\n }\n \n for (int i = 0;i < r;i++) ary[r][c] += ary[i][c];\n \n for (int i = 0;i < r+1;i++) {\n StringBuilder sb = new StringBuilder();\n for (int j = 0;j < c+1;j++) {\n sb.append(ary[i][j]).append(\" \");\n }\n System.out.println(sb.substring(0, sb.length()-1));\n }\n }\n}",
"Main",
"private static Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"public static void main(String[] args) throws Exception {\n int r = sc.nextInt();\n int c = sc.nextInt();\n int[][] ary = new int[r+1][c+1];\n for (int i = 0;i < r;i++) {\n for (int j = 0;j < c;j++) {\n ary[i][j] = sc.nextInt();\n }\n }\n \n for (int i = 0;i < c;i++) {\n for (int j = 0;j < r;j++) ary[r][i] += ary[j][i];\n }\n\n for (int i = 0;i < r;i++) {\n for (int j = 0;j < c;j++) ary[i][c] += ary[i][j];\n }\n \n for (int i = 0;i < r;i++) ary[r][c] += ary[i][c];\n \n for (int i = 0;i < r+1;i++) {\n StringBuilder sb = new StringBuilder();\n for (int j = 0;j < c+1;j++) {\n sb.append(ary[i][j]).append(\" \");\n }\n System.out.println(sb.substring(0, sb.length()-1));\n }\n }",
"main",
"{\n int r = sc.nextInt();\n int c = sc.nextInt();\n int[][] ary = new int[r+1][c+1];\n for (int i = 0;i < r;i++) {\n for (int j = 0;j < c;j++) {\n ary[i][j] = sc.nextInt();\n }\n }\n \n for (int i = 0;i < c;i++) {\n for (int j = 0;j < r;j++) ary[r][i] += ary[j][i];\n }\n\n for (int i = 0;i < r;i++) {\n for (int j = 0;j < c;j++) ary[i][c] += ary[i][j];\n }\n \n for (int i = 0;i < r;i++) ary[r][c] += ary[i][c];\n \n for (int i = 0;i < r+1;i++) {\n StringBuilder sb = new StringBuilder();\n for (int j = 0;j < c+1;j++) {\n sb.append(ary[i][j]).append(\" \");\n }\n System.out.println(sb.substring(0, sb.length()-1));\n }\n }",
"int r = sc.nextInt();",
"r",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int c = sc.nextInt();",
"c",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int[][] ary = new int[r+1][c+1];",
"ary",
"new int[r+1][c+1]",
"r+1",
"r",
"1",
"c+1",
"c",
"1",
"for (int i = 0;i < r;i++) {\n for (int j = 0;j < c;j++) {\n ary[i][j] = sc.nextInt();\n }\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < r",
"i",
"r",
"i++",
"i++",
"i",
"{\n for (int j = 0;j < c;j++) {\n ary[i][j] = sc.nextInt();\n }\n }",
"{\n for (int j = 0;j < c;j++) {\n ary[i][j] = sc.nextInt();\n }\n }",
"for (int j = 0;j < c;j++) {\n ary[i][j] = sc.nextInt();\n }",
"int j = 0;",
"int j = 0;",
"j",
"0",
"j < c",
"j",
"c",
"j++",
"j++",
"j",
"{\n ary[i][j] = sc.nextInt();\n }",
"{\n ary[i][j] = sc.nextInt();\n }",
"ary[i][j] = sc.nextInt()",
"ary[i][j]",
"ary[i]",
"ary",
"i",
"j",
"sc.nextInt()",
"sc.nextInt",
"sc",
"for (int i = 0;i < c;i++) {\n for (int j = 0;j < r;j++) ary[r][i] += ary[j][i];\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < c",
"i",
"c",
"i++",
"i++",
"i",
"{\n for (int j = 0;j < r;j++) ary[r][i] += ary[j][i];\n }",
"{\n for (int j = 0;j < r;j++) ary[r][i] += ary[j][i];\n }",
"for (int j = 0;j < r;j++) ary[r][i] += ary[j][i];",
"int j = 0;",
"int j = 0;",
"j",
"0",
"j < r",
"j",
"r",
"j++",
"j++",
"j",
"ary[r][i] += ary[j][i];",
"ary[r][i] += ary[j][i]",
"ary[r][i]",
"ary[r]",
"ary",
"r",
"i",
"ary[j][i]",
"ary[j]",
"ary",
"j",
"i",
"for (int i = 0;i < r;i++) {\n for (int j = 0;j < c;j++) ary[i][c] += ary[i][j];\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < r",
"i",
"r",
"i++",
"i++",
"i",
"{\n for (int j = 0;j < c;j++) ary[i][c] += ary[i][j];\n }",
"{\n for (int j = 0;j < c;j++) ary[i][c] += ary[i][j];\n }",
"for (int j = 0;j < c;j++) ary[i][c] += ary[i][j];",
"int j = 0;",
"int j = 0;",
"j",
"0",
"j < c",
"j",
"c",
"j++",
"j++",
"j",
"ary[i][c] += ary[i][j];",
"ary[i][c] += ary[i][j]",
"ary[i][c]",
"ary[i]",
"ary",
"i",
"c",
"ary[i][j]",
"ary[i]",
"ary",
"i",
"j",
"for (int i = 0;i < r;i++) ary[r][c] += ary[i][c];",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < r",
"i",
"r",
"i++",
"i++",
"i",
"ary[r][c] += ary[i][c];",
"ary[r][c] += ary[i][c]",
"ary[r][c]",
"ary[r]",
"ary",
"r",
"c",
"ary[i][c]",
"ary[i]",
"ary",
"i",
"c",
"for (int i = 0;i < r+1;i++) {\n StringBuilder sb = new StringBuilder();\n for (int j = 0;j < c+1;j++) {\n sb.append(ary[i][j]).append(\" \");\n }\n System.out.println(sb.substring(0, sb.length()-1));\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < r+1",
"i",
"r+1",
"r",
"1",
"i++",
"i++",
"i",
"{\n StringBuilder sb = new StringBuilder();\n for (int j = 0;j < c+1;j++) {\n sb.append(ary[i][j]).append(\" \");\n }\n System.out.println(sb.substring(0, sb.length()-1));\n }",
"{\n StringBuilder sb = new StringBuilder();\n for (int j = 0;j < c+1;j++) {\n sb.append(ary[i][j]).append(\" \");\n }\n System.out.println(sb.substring(0, sb.length()-1));\n }",
"StringBuilder sb = new StringBuilder();",
"sb",
"new StringBuilder()",
"for (int j = 0;j < c+1;j++) {\n sb.append(ary[i][j]).append(\" \");\n }",
"int j = 0;",
"int j = 0;",
"j",
"0",
"j < c+1",
"j",
"c+1",
"c",
"1",
"j++",
"j++",
"j",
"{\n sb.append(ary[i][j]).append(\" \");\n }",
"{\n sb.append(ary[i][j]).append(\" \");\n }",
"sb.append(ary[i][j]).append(\" \")",
"sb.append(ary[i][j]).append",
"sb.append(ary[i][j])",
"sb.append",
"sb",
"ary[i][j]",
"ary[i]",
"ary",
"i",
"j",
"\" \"",
"System.out.println(sb.substring(0, sb.length()-1))",
"System.out.println",
"System.out",
"System",
"System.out",
"sb.substring(0, sb.length()-1)",
"sb.substring",
"sb",
"0",
"sb.length()-1",
"sb.length()",
"sb.length",
"sb",
"1",
"String[] args",
"args",
"public class Main {\n private static Scanner sc = new Scanner(System.in);\n public static void main(String[] args) throws Exception {\n int r = sc.nextInt();\n int c = sc.nextInt();\n int[][] ary = new int[r+1][c+1];\n for (int i = 0;i < r;i++) {\n for (int j = 0;j < c;j++) {\n ary[i][j] = sc.nextInt();\n }\n }\n \n for (int i = 0;i < c;i++) {\n for (int j = 0;j < r;j++) ary[r][i] += ary[j][i];\n }\n\n for (int i = 0;i < r;i++) {\n for (int j = 0;j < c;j++) ary[i][c] += ary[i][j];\n }\n \n for (int i = 0;i < r;i++) ary[r][c] += ary[i][c];\n \n for (int i = 0;i < r+1;i++) {\n StringBuilder sb = new StringBuilder();\n for (int j = 0;j < c+1;j++) {\n sb.append(ary[i][j]).append(\" \");\n }\n System.out.println(sb.substring(0, sb.length()-1));\n }\n }\n}",
"public class Main {\n private static Scanner sc = new Scanner(System.in);\n public static void main(String[] args) throws Exception {\n int r = sc.nextInt();\n int c = sc.nextInt();\n int[][] ary = new int[r+1][c+1];\n for (int i = 0;i < r;i++) {\n for (int j = 0;j < c;j++) {\n ary[i][j] = sc.nextInt();\n }\n }\n \n for (int i = 0;i < c;i++) {\n for (int j = 0;j < r;j++) ary[r][i] += ary[j][i];\n }\n\n for (int i = 0;i < r;i++) {\n for (int j = 0;j < c;j++) ary[i][c] += ary[i][j];\n }\n \n for (int i = 0;i < r;i++) ary[r][c] += ary[i][c];\n \n for (int i = 0;i < r+1;i++) {\n StringBuilder sb = new StringBuilder();\n for (int j = 0;j < c+1;j++) {\n sb.append(ary[i][j]).append(\" \");\n }\n System.out.println(sb.substring(0, sb.length()-1));\n }\n }\n}",
"Main"
] | import java.util.*;
public class Main {
private static Scanner sc = new Scanner(System.in);
public static void main(String[] args) throws Exception {
int r = sc.nextInt();
int c = sc.nextInt();
int[][] ary = new int[r+1][c+1];
for (int i = 0;i < r;i++) {
for (int j = 0;j < c;j++) {
ary[i][j] = sc.nextInt();
}
}
for (int i = 0;i < c;i++) {
for (int j = 0;j < r;j++) ary[r][i] += ary[j][i];
}
for (int i = 0;i < r;i++) {
for (int j = 0;j < c;j++) ary[i][c] += ary[i][j];
}
for (int i = 0;i < r;i++) ary[r][c] += ary[i][c];
for (int i = 0;i < r+1;i++) {
StringBuilder sb = new StringBuilder();
for (int j = 0;j < c+1;j++) {
sb.append(ary[i][j]).append(" ");
}
System.out.println(sb.substring(0, sb.length()-1));
}
}
}
|
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
20,
41,
13,
4,
13,
13,
41,
13,
18,
13,
17,
41,
13,
18,
13,
17,
41,
13,
20,
2,
13,
17,
2,
13,
17,
41,
13,
41,
13,
11,
1,
0,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
4,
13,
13,
0,
18,
18,
13,
13,
13,
17,
11,
1,
0,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
18,
18,
13,
13,
13,
18,
13,
13,
0,
18,
18,
13,
13,
13,
18,
13,
13,
11,
1,
0,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
18,
18,
13,
13,
13,
17,
11,
1,
0,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
18,
18,
13,
13,
13,
18,
18,
13,
13,
13,
11,
1,
0,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
4,
13,
18,
13,
13,
23,
13,
12,
13,
30,
41,
13,
18,
13,
13,
11,
1,
41,
13,
17,
2,
13,
2,
13,
17,
1,
40,
13,
30,
30,
4,
18,
18,
13,
13,
2,
18,
13,
13,
17,
4,
18,
18,
13,
13,
18,
13,
2,
13,
17,
23,
13,
12,
13,
30,
41,
13,
4,
18,
4,
18,
13,
17,
41,
13,
18,
13,
13,
41,
13,
20,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
18,
13,
13,
4,
18,
13,
18,
13,
13,
29,
13,
23,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
8,
15
],
[
15,
16
],
[
15,
17
],
[
17,
18
],
[
17,
19
],
[
8,
20
],
[
20,
21
],
[
20,
22
],
[
22,
23
],
[
22,
24
],
[
8,
25
],
[
25,
26
],
[
25,
27
],
[
27,
28
],
[
27,
29
],
[
8,
30
],
[
30,
31
],
[
30,
32
],
[
33,
34
],
[
33,
35
],
[
36,
37
],
[
36,
38
],
[
8,
39
],
[
39,
40
],
[
8,
41
],
[
41,
42
],
[
8,
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
],
[
56,
58
],
[
58,
59
],
[
58,
60
],
[
55,
61
],
[
61,
62
],
[
62,
63
],
[
63,
64
],
[
63,
65
],
[
62,
66
],
[
61,
67
],
[
55,
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
],
[
82,
86
],
[
81,
87
],
[
87,
88
],
[
87,
89
],
[
80,
90
],
[
90,
91
],
[
91,
92
],
[
92,
93
],
[
92,
94
],
[
91,
95
],
[
90,
96
],
[
96,
97
],
[
96,
98
],
[
8,
99
],
[
99,
100
],
[
100,
101
],
[
101,
102
],
[
101,
103
],
[
99,
104
],
[
104,
105
],
[
104,
106
],
[
99,
107
],
[
107,
108
],
[
108,
109
],
[
99,
110
],
[
111,
111
],
[
111,
112
],
[
112,
113
],
[
113,
114
],
[
114,
115
],
[
114,
116
],
[
113,
117
],
[
112,
118
],
[
111,
119
],
[
119,
120
],
[
120,
121
],
[
121,
122
],
[
121,
123
],
[
119,
124
],
[
124,
125
],
[
124,
126
],
[
119,
127
],
[
127,
128
],
[
128,
129
],
[
119,
130
],
[
131,
131
],
[
131,
132
],
[
132,
133
],
[
133,
134
],
[
134,
135
],
[
134,
136
],
[
133,
137
],
[
132,
138
],
[
138,
139
],
[
139,
140
],
[
139,
141
],
[
138,
142
],
[
8,
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
],
[
156,
158
],
[
158,
159
],
[
158,
160
],
[
6,
161
],
[
161,
162
],
[
4,
163
],
[
163,
164
],
[
163,
165
],
[
165,
166
],
[
166,
167
],
[
166,
168
],
[
168,
169
],
[
168,
170
],
[
165,
171
],
[
171,
172
],
[
172,
173
],
[
173,
174
],
[
173,
175
],
[
171,
176
],
[
176,
177
],
[
176,
178
],
[
178,
179
],
[
178,
180
],
[
171,
181
],
[
181,
182
],
[
182,
183
],
[
171,
184
],
[
185,
185
],
[
185,
186
],
[
186,
187
],
[
187,
188
],
[
188,
189
],
[
188,
190
],
[
186,
191
],
[
191,
192
],
[
192,
193
],
[
192,
194
],
[
191,
195
],
[
165,
196
],
[
196,
197
],
[
197,
198
],
[
198,
199
],
[
198,
200
],
[
196,
201
],
[
201,
202
],
[
201,
203
],
[
203,
204
],
[
203,
205
],
[
163,
206
],
[
206,
207
],
[
4,
208
],
[
208,
209
],
[
208,
210
],
[
210,
211
],
[
211,
212
],
[
211,
213
],
[
213,
214
],
[
214,
215
],
[
215,
216
],
[
216,
217
],
[
213,
218
],
[
210,
219
],
[
219,
220
],
[
219,
221
],
[
221,
222
],
[
221,
223
],
[
210,
224
],
[
224,
225
],
[
224,
226
],
[
210,
228
],
[
228,
229
],
[
229,
230
],
[
230,
231
],
[
230,
232
],
[
228,
233
],
[
233,
234
],
[
233,
235
],
[
228,
236
],
[
236,
237
],
[
237,
238
],
[
228,
239
],
[
240,
240
],
[
240,
241
],
[
241,
242
],
[
242,
243
],
[
242,
244
],
[
241,
245
],
[
245,
246
],
[
246,
247
],
[
245,
248
],
[
248,
249
],
[
248,
250
],
[
210,
251
],
[
251,
252
],
[
208,
253
],
[
253,
254
]
] | [
"import java.io.*;\n\nclass Main{\n public static void main(String[] args) throws IOException\n {\n InputStreamReader is = new InputStreamReader(System.in);\n BufferedReader br = new BufferedReader(is);\n int[] data = makeIntArray(br);\n int r = data[0], c = data[1];\n int[][] exl = new int[r + 1][c + 1];\n int i, j;\n for(i = 0; i < r; i++){\n data = makeIntArray(br);\n exl[i][c] = 0;\n for(j = 0; j < c; j++){\n exl[i][j] = data[j];\n exl[i][c] += data[j];\n }\n }\n for(j = 0; j <= c; j++){\n exl[r][j] = 0;\n for(i = 0; i < r; i++){ exl[r][j] += exl[i][j]; }\n }\n for(i = 0; i <= r; i++){ show(exl[i]); }\n }\n public static void show(int[] a){\n int n = a.length;\n for(int i = 0; i < n - 1; i++){ System.out.print(a[i] + \" \"); }\n System.out.println(a[n - 1]);\n }\n public static int[] makeIntArray(BufferedReader br) throws IOException\n {\n String[] str = br.readLine().split(\" \");\n int n = str.length;\n int[] a = new int[n];\n for(int i = 0; i < n; i++){ a[i] = Integer.parseInt(str[i]); }\n return a;\n }\n}",
"import java.io.*;",
"io.*",
"java",
"class Main{\n public static void main(String[] args) throws IOException\n {\n InputStreamReader is = new InputStreamReader(System.in);\n BufferedReader br = new BufferedReader(is);\n int[] data = makeIntArray(br);\n int r = data[0], c = data[1];\n int[][] exl = new int[r + 1][c + 1];\n int i, j;\n for(i = 0; i < r; i++){\n data = makeIntArray(br);\n exl[i][c] = 0;\n for(j = 0; j < c; j++){\n exl[i][j] = data[j];\n exl[i][c] += data[j];\n }\n }\n for(j = 0; j <= c; j++){\n exl[r][j] = 0;\n for(i = 0; i < r; i++){ exl[r][j] += exl[i][j]; }\n }\n for(i = 0; i <= r; i++){ show(exl[i]); }\n }\n public static void show(int[] a){\n int n = a.length;\n for(int i = 0; i < n - 1; i++){ System.out.print(a[i] + \" \"); }\n System.out.println(a[n - 1]);\n }\n public static int[] makeIntArray(BufferedReader br) throws IOException\n {\n String[] str = br.readLine().split(\" \");\n int n = str.length;\n int[] a = new int[n];\n for(int i = 0; i < n; i++){ a[i] = Integer.parseInt(str[i]); }\n return a;\n }\n}",
"Main",
"public static void main(String[] args) throws IOException\n {\n InputStreamReader is = new InputStreamReader(System.in);\n BufferedReader br = new BufferedReader(is);\n int[] data = makeIntArray(br);\n int r = data[0], c = data[1];\n int[][] exl = new int[r + 1][c + 1];\n int i, j;\n for(i = 0; i < r; i++){\n data = makeIntArray(br);\n exl[i][c] = 0;\n for(j = 0; j < c; j++){\n exl[i][j] = data[j];\n exl[i][c] += data[j];\n }\n }\n for(j = 0; j <= c; j++){\n exl[r][j] = 0;\n for(i = 0; i < r; i++){ exl[r][j] += exl[i][j]; }\n }\n for(i = 0; i <= r; i++){ show(exl[i]); }\n }",
"main",
"{\n InputStreamReader is = new InputStreamReader(System.in);\n BufferedReader br = new BufferedReader(is);\n int[] data = makeIntArray(br);\n int r = data[0], c = data[1];\n int[][] exl = new int[r + 1][c + 1];\n int i, j;\n for(i = 0; i < r; i++){\n data = makeIntArray(br);\n exl[i][c] = 0;\n for(j = 0; j < c; j++){\n exl[i][j] = data[j];\n exl[i][c] += data[j];\n }\n }\n for(j = 0; j <= c; j++){\n exl[r][j] = 0;\n for(i = 0; i < r; i++){ exl[r][j] += exl[i][j]; }\n }\n for(i = 0; i <= r; i++){ show(exl[i]); }\n }",
"InputStreamReader is = new InputStreamReader(System.in);",
"is",
"new InputStreamReader(System.in)",
"BufferedReader br = new BufferedReader(is);",
"br",
"new BufferedReader(is)",
"int[] data = makeIntArray(br);",
"data",
"makeIntArray(br)",
"makeIntArray",
"br",
"int r = data[0]",
"r",
"data[0]",
"data",
"0",
"c = data[1];",
"c",
"data[1]",
"data",
"1",
"int[][] exl = new int[r + 1][c + 1];",
"exl",
"new int[r + 1][c + 1]",
"r + 1",
"r",
"1",
"c + 1",
"c",
"1",
"int i",
"i",
"j;",
"j",
"for(i = 0; i < r; i++){\n data = makeIntArray(br);\n exl[i][c] = 0;\n for(j = 0; j < c; j++){\n exl[i][j] = data[j];\n exl[i][c] += data[j];\n }\n }",
"i = 0;",
"i = 0",
"i",
"0",
"i < r",
"i",
"r",
"i++",
"i++",
"i",
"{\n data = makeIntArray(br);\n exl[i][c] = 0;\n for(j = 0; j < c; j++){\n exl[i][j] = data[j];\n exl[i][c] += data[j];\n }\n }",
"{\n data = makeIntArray(br);\n exl[i][c] = 0;\n for(j = 0; j < c; j++){\n exl[i][j] = data[j];\n exl[i][c] += data[j];\n }\n }",
"data = makeIntArray(br)",
"data",
"makeIntArray(br)",
"makeIntArray",
"br",
"exl[i][c] = 0",
"exl[i][c]",
"exl[i]",
"exl",
"i",
"c",
"0",
"for(j = 0; j < c; j++){\n exl[i][j] = data[j];\n exl[i][c] += data[j];\n }",
"j = 0;",
"j = 0",
"j",
"0",
"j < c",
"j",
"c",
"j++",
"j++",
"j",
"{\n exl[i][j] = data[j];\n exl[i][c] += data[j];\n }",
"{\n exl[i][j] = data[j];\n exl[i][c] += data[j];\n }",
"exl[i][j] = data[j]",
"exl[i][j]",
"exl[i]",
"exl",
"i",
"j",
"data[j]",
"data",
"j",
"exl[i][c] += data[j]",
"exl[i][c]",
"exl[i]",
"exl",
"i",
"c",
"data[j]",
"data",
"j",
"for(j = 0; j <= c; j++){\n exl[r][j] = 0;\n for(i = 0; i < r; i++){ exl[r][j] += exl[i][j]; }\n }",
"j = 0;",
"j = 0",
"j",
"0",
"j <= c",
"j",
"c",
"j++",
"j++",
"j",
"{\n exl[r][j] = 0;\n for(i = 0; i < r; i++){ exl[r][j] += exl[i][j]; }\n }",
"{\n exl[r][j] = 0;\n for(i = 0; i < r; i++){ exl[r][j] += exl[i][j]; }\n }",
"exl[r][j] = 0",
"exl[r][j]",
"exl[r]",
"exl",
"r",
"j",
"0",
"for(i = 0; i < r; i++){ exl[r][j] += exl[i][j]; }",
"i = 0;",
"i = 0",
"i",
"0",
"i < r",
"i",
"r",
"i++",
"i++",
"i",
"{ exl[r][j] += exl[i][j]; }",
"{ exl[r][j] += exl[i][j]; }",
"exl[r][j] += exl[i][j]",
"exl[r][j]",
"exl[r]",
"exl",
"r",
"j",
"exl[i][j]",
"exl[i]",
"exl",
"i",
"j",
"for(i = 0; i <= r; i++){ show(exl[i]); }",
"i = 0;",
"i = 0",
"i",
"0",
"i <= r",
"i",
"r",
"i++",
"i++",
"i",
"{ show(exl[i]); }",
"{ show(exl[i]); }",
"show(exl[i])",
"show",
"exl[i]",
"exl",
"i",
"String[] args",
"args",
"public static void show(int[] a){\n int n = a.length;\n for(int i = 0; i < n - 1; i++){ System.out.print(a[i] + \" \"); }\n System.out.println(a[n - 1]);\n }",
"show",
"{\n int n = a.length;\n for(int i = 0; i < n - 1; i++){ System.out.print(a[i] + \" \"); }\n System.out.println(a[n - 1]);\n }",
"int n = a.length;",
"n",
"a.length",
"a",
"a.length",
"for(int i = 0; i < n - 1; i++){ System.out.print(a[i] + \" \"); }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < n - 1",
"i",
"n - 1",
"n",
"1",
"i++",
"i++",
"i",
"{ System.out.print(a[i] + \" \"); }",
"{ System.out.print(a[i] + \" \"); }",
"System.out.print(a[i] + \" \")",
"System.out.print",
"System.out",
"System",
"System.out",
"a[i] + \" \"",
"a[i]",
"a",
"i",
"\" \"",
"System.out.println(a[n - 1])",
"System.out.println",
"System.out",
"System",
"System.out",
"a[n - 1]",
"a",
"n - 1",
"n",
"1",
"int[] a",
"a",
"public static int[] makeIntArray(BufferedReader br) throws IOException\n {\n String[] str = br.readLine().split(\" \");\n int n = str.length;\n int[] a = new int[n];\n for(int i = 0; i < n; i++){ a[i] = Integer.parseInt(str[i]); }\n return a;\n }",
"makeIntArray",
"{\n String[] str = br.readLine().split(\" \");\n int n = str.length;\n int[] a = new int[n];\n for(int i = 0; i < n; i++){ a[i] = Integer.parseInt(str[i]); }\n return a;\n }",
"String[] str = br.readLine().split(\" \");",
"str",
"br.readLine().split(\" \")",
"br.readLine().split",
"br.readLine()",
"br.readLine",
"br",
"\" \"",
"int n = str.length;",
"n",
"str.length",
"str",
"str.length",
"int[] a = new int[n];",
"a",
"new int[n]",
"n",
"for(int i = 0; i < n; i++){ a[i] = Integer.parseInt(str[i]); }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < n",
"i",
"n",
"i++",
"i++",
"i",
"{ a[i] = Integer.parseInt(str[i]); }",
"{ a[i] = Integer.parseInt(str[i]); }",
"a[i] = Integer.parseInt(str[i])",
"a[i]",
"a",
"i",
"Integer.parseInt(str[i])",
"Integer.parseInt",
"Integer",
"str[i]",
"str",
"i",
"return a;",
"a",
"BufferedReader br",
"br"
] | import java.io.*;
class Main{
public static void main(String[] args) throws IOException
{
InputStreamReader is = new InputStreamReader(System.in);
BufferedReader br = new BufferedReader(is);
int[] data = makeIntArray(br);
int r = data[0], c = data[1];
int[][] exl = new int[r + 1][c + 1];
int i, j;
for(i = 0; i < r; i++){
data = makeIntArray(br);
exl[i][c] = 0;
for(j = 0; j < c; j++){
exl[i][j] = data[j];
exl[i][c] += data[j];
}
}
for(j = 0; j <= c; j++){
exl[r][j] = 0;
for(i = 0; i < r; i++){ exl[r][j] += exl[i][j]; }
}
for(i = 0; i <= r; i++){ show(exl[i]); }
}
public static void show(int[] a){
int n = a.length;
for(int i = 0; i < n - 1; i++){ System.out.print(a[i] + " "); }
System.out.println(a[n - 1]);
}
public static int[] makeIntArray(BufferedReader br) throws IOException
{
String[] str = br.readLine().split(" ");
int n = str.length;
int[] a = new int[n];
for(int i = 0; i < n; i++){ a[i] = Integer.parseInt(str[i]); }
return a;
}
}
|
[
7,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
4,
18,
13,
17,
41,
13,
4,
18,
13,
18,
13,
17,
41,
13,
4,
18,
13,
18,
13,
17,
41,
13,
20,
2,
13,
17,
2,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
4,
18,
4,
18,
13,
17,
11,
1,
41,
13,
17,
2,
13,
18,
13,
13,
1,
40,
13,
30,
30,
0,
18,
18,
13,
13,
13,
4,
18,
13,
18,
13,
13,
0,
18,
18,
13,
13,
13,
18,
18,
13,
13,
13,
0,
18,
18,
13,
13,
13,
18,
18,
13,
13,
13,
14,
2,
13,
2,
18,
13,
13,
17,
30,
0,
18,
18,
13,
13,
13,
18,
18,
13,
13,
13,
11,
1,
41,
13,
17,
2,
13,
2,
13,
17,
1,
40,
13,
30,
30,
41,
13,
20,
11,
1,
41,
13,
17,
2,
13,
2,
13,
17,
1,
40,
13,
30,
30,
4,
18,
13,
18,
18,
13,
13,
13,
4,
18,
13,
17,
4,
18,
18,
13,
13,
4,
18,
4,
18,
13,
17,
2,
4,
18,
4,
18,
13,
17,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
204,
8
],
[
204,
9
],
[
9,
10
],
[
9,
11
],
[
11,
12
],
[
12,
13
],
[
12,
14
],
[
11,
15
],
[
15,
16
],
[
15,
17
],
[
17,
18
],
[
18,
19
],
[
19,
20
],
[
20,
21
],
[
17,
22
],
[
11,
23
],
[
23,
24
],
[
23,
25
],
[
25,
26
],
[
26,
27
],
[
25,
28
],
[
28,
29
],
[
28,
30
],
[
11,
31
],
[
31,
32
],
[
31,
33
],
[
33,
34
],
[
34,
35
],
[
33,
36
],
[
36,
37
],
[
36,
38
],
[
11,
39
],
[
39,
40
],
[
39,
41
],
[
42,
43
],
[
42,
44
],
[
45,
46
],
[
45,
47
],
[
11,
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
],
[
64,
65
],
[
65,
66
],
[
66,
67
],
[
63,
68
],
[
60,
69
],
[
69,
70
],
[
70,
71
],
[
71,
72
],
[
71,
73
],
[
69,
74
],
[
74,
75
],
[
74,
76
],
[
76,
77
],
[
76,
78
],
[
69,
79
],
[
79,
80
],
[
80,
81
],
[
69,
82
],
[
83,
83
],
[
83,
84
],
[
84,
85
],
[
85,
86
],
[
86,
87
],
[
86,
88
],
[
85,
89
],
[
84,
90
],
[
90,
91
],
[
91,
92
],
[
90,
93
],
[
93,
94
],
[
93,
95
],
[
83,
96
],
[
96,
97
],
[
97,
98
],
[
98,
99
],
[
98,
100
],
[
97,
101
],
[
96,
102
],
[
102,
103
],
[
103,
104
],
[
103,
105
],
[
102,
106
],
[
83,
107
],
[
107,
108
],
[
108,
109
],
[
109,
110
],
[
109,
111
],
[
108,
112
],
[
107,
113
],
[
113,
114
],
[
114,
115
],
[
114,
116
],
[
113,
117
],
[
83,
118
],
[
118,
119
],
[
119,
120
],
[
119,
121
],
[
121,
122
],
[
122,
123
],
[
122,
124
],
[
121,
125
],
[
118,
126
],
[
126,
127
],
[
127,
128
],
[
128,
129
],
[
129,
130
],
[
129,
131
],
[
128,
132
],
[
127,
133
],
[
133,
134
],
[
134,
135
],
[
134,
136
],
[
133,
137
],
[
11,
138
],
[
138,
139
],
[
139,
140
],
[
140,
141
],
[
140,
142
],
[
138,
143
],
[
143,
144
],
[
143,
145
],
[
145,
146
],
[
145,
147
],
[
138,
148
],
[
148,
149
],
[
149,
150
],
[
138,
151
],
[
152,
152
],
[
152,
153
],
[
153,
154
],
[
153,
155
],
[
152,
156
],
[
156,
157
],
[
157,
158
],
[
158,
159
],
[
158,
160
],
[
156,
161
],
[
161,
162
],
[
161,
163
],
[
163,
164
],
[
163,
165
],
[
156,
166
],
[
166,
167
],
[
167,
168
],
[
156,
169
],
[
170,
170
],
[
170,
171
],
[
171,
172
],
[
172,
173
],
[
171,
174
],
[
174,
175
],
[
175,
176
],
[
175,
177
],
[
174,
178
],
[
170,
179
],
[
179,
180
],
[
180,
181
],
[
179,
182
],
[
152,
183
],
[
183,
184
],
[
184,
185
],
[
185,
186
],
[
185,
187
],
[
183,
188
],
[
188,
189
],
[
189,
190
],
[
190,
191
],
[
191,
192
],
[
188,
193
],
[
188,
194
],
[
194,
195
],
[
195,
196
],
[
196,
197
],
[
197,
198
],
[
198,
199
],
[
194,
200
],
[
9,
201
],
[
201,
202
],
[
0,
203
],
[
203,
204
],
[
203,
205
]
] | [
"import java.io.BufferedReader;\nimport java.io.InputStreamReader;\n\npublic class Main {\n\tpublic static void main(String[] args) throws Exception {\n\t BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\n\t String[] line = br.readLine().split(\" \");\n\n\t int r = Integer.parseInt(line[0]);\n\t int c = Integer.parseInt(line[1]);\n\n\t int[][] matrix = new int[r + 1][c + 1];\n\n\t for (int i = 0; i < r; i++) {\n\t \tline = br.readLine().split(\" \");\n\n\t \tfor (int j = 0; j < line.length; j++) {\n\t\t \tmatrix[i][j] = Integer.parseInt(line[j]);\n\n\t\t \t// row sum\n\t\t \tmatrix[i][c] += matrix[i][j];\n\t\t \t// col sum\n\t\t \tmatrix[r][j] += matrix[i][j];\n\n\t\t \tif (j == line.length - 1) {\n\t\t\t \t// all sum\n\t\t\t \tmatrix[r][c] += matrix[i][c];\n\t\t \t}\n\t \t}\n\t }\n\n\t for (int i = 0; i < r + 1; i++) {\n\t\t StringBuilder sb = new StringBuilder();\n\t \tfor (int j = 0; j < c + 1; j++) {\n\t \t\tsb.append(matrix[i][j]);\n\t \t\tsb.append(\" \");\n\t \t}\n\t \tSystem.out.println(sb.toString().substring(0, sb.toString().length() - 1));\n\t }\n\t}\n}",
"import java.io.BufferedReader;",
"BufferedReader",
"java.io",
"import java.io.InputStreamReader;",
"InputStreamReader",
"java.io",
"public class Main {\n\tpublic static void main(String[] args) throws Exception {\n\t BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\n\t String[] line = br.readLine().split(\" \");\n\n\t int r = Integer.parseInt(line[0]);\n\t int c = Integer.parseInt(line[1]);\n\n\t int[][] matrix = new int[r + 1][c + 1];\n\n\t for (int i = 0; i < r; i++) {\n\t \tline = br.readLine().split(\" \");\n\n\t \tfor (int j = 0; j < line.length; j++) {\n\t\t \tmatrix[i][j] = Integer.parseInt(line[j]);\n\n\t\t \t// row sum\n\t\t \tmatrix[i][c] += matrix[i][j];\n\t\t \t// col sum\n\t\t \tmatrix[r][j] += matrix[i][j];\n\n\t\t \tif (j == line.length - 1) {\n\t\t\t \t// all sum\n\t\t\t \tmatrix[r][c] += matrix[i][c];\n\t\t \t}\n\t \t}\n\t }\n\n\t for (int i = 0; i < r + 1; i++) {\n\t\t StringBuilder sb = new StringBuilder();\n\t \tfor (int j = 0; j < c + 1; j++) {\n\t \t\tsb.append(matrix[i][j]);\n\t \t\tsb.append(\" \");\n\t \t}\n\t \tSystem.out.println(sb.toString().substring(0, sb.toString().length() - 1));\n\t }\n\t}\n}",
"Main",
"public static void main(String[] args) throws Exception {\n\t BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\n\t String[] line = br.readLine().split(\" \");\n\n\t int r = Integer.parseInt(line[0]);\n\t int c = Integer.parseInt(line[1]);\n\n\t int[][] matrix = new int[r + 1][c + 1];\n\n\t for (int i = 0; i < r; i++) {\n\t \tline = br.readLine().split(\" \");\n\n\t \tfor (int j = 0; j < line.length; j++) {\n\t\t \tmatrix[i][j] = Integer.parseInt(line[j]);\n\n\t\t \t// row sum\n\t\t \tmatrix[i][c] += matrix[i][j];\n\t\t \t// col sum\n\t\t \tmatrix[r][j] += matrix[i][j];\n\n\t\t \tif (j == line.length - 1) {\n\t\t\t \t// all sum\n\t\t\t \tmatrix[r][c] += matrix[i][c];\n\t\t \t}\n\t \t}\n\t }\n\n\t for (int i = 0; i < r + 1; i++) {\n\t\t StringBuilder sb = new StringBuilder();\n\t \tfor (int j = 0; j < c + 1; j++) {\n\t \t\tsb.append(matrix[i][j]);\n\t \t\tsb.append(\" \");\n\t \t}\n\t \tSystem.out.println(sb.toString().substring(0, sb.toString().length() - 1));\n\t }\n\t}",
"main",
"{\n\t BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\n\t String[] line = br.readLine().split(\" \");\n\n\t int r = Integer.parseInt(line[0]);\n\t int c = Integer.parseInt(line[1]);\n\n\t int[][] matrix = new int[r + 1][c + 1];\n\n\t for (int i = 0; i < r; i++) {\n\t \tline = br.readLine().split(\" \");\n\n\t \tfor (int j = 0; j < line.length; j++) {\n\t\t \tmatrix[i][j] = Integer.parseInt(line[j]);\n\n\t\t \t// row sum\n\t\t \tmatrix[i][c] += matrix[i][j];\n\t\t \t// col sum\n\t\t \tmatrix[r][j] += matrix[i][j];\n\n\t\t \tif (j == line.length - 1) {\n\t\t\t \t// all sum\n\t\t\t \tmatrix[r][c] += matrix[i][c];\n\t\t \t}\n\t \t}\n\t }\n\n\t for (int i = 0; i < r + 1; i++) {\n\t\t StringBuilder sb = new StringBuilder();\n\t \tfor (int j = 0; j < c + 1; j++) {\n\t \t\tsb.append(matrix[i][j]);\n\t \t\tsb.append(\" \");\n\t \t}\n\t \tSystem.out.println(sb.toString().substring(0, sb.toString().length() - 1));\n\t }\n\t}",
"BufferedReader br = new BufferedReader(new InputStreamReader(System.in));",
"br",
"new BufferedReader(new InputStreamReader(System.in))",
"String[] line = br.readLine().split(\" \");",
"line",
"br.readLine().split(\" \")",
"br.readLine().split",
"br.readLine()",
"br.readLine",
"br",
"\" \"",
"int r = Integer.parseInt(line[0]);",
"r",
"Integer.parseInt(line[0])",
"Integer.parseInt",
"Integer",
"line[0]",
"line",
"0",
"int c = Integer.parseInt(line[1]);",
"c",
"Integer.parseInt(line[1])",
"Integer.parseInt",
"Integer",
"line[1]",
"line",
"1",
"int[][] matrix = new int[r + 1][c + 1];",
"matrix",
"new int[r + 1][c + 1]",
"r + 1",
"r",
"1",
"c + 1",
"c",
"1",
"for (int i = 0; i < r; i++) {\n\t \tline = br.readLine().split(\" \");\n\n\t \tfor (int j = 0; j < line.length; j++) {\n\t\t \tmatrix[i][j] = Integer.parseInt(line[j]);\n\n\t\t \t// row sum\n\t\t \tmatrix[i][c] += matrix[i][j];\n\t\t \t// col sum\n\t\t \tmatrix[r][j] += matrix[i][j];\n\n\t\t \tif (j == line.length - 1) {\n\t\t\t \t// all sum\n\t\t\t \tmatrix[r][c] += matrix[i][c];\n\t\t \t}\n\t \t}\n\t }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < r",
"i",
"r",
"i++",
"i++",
"i",
"{\n\t \tline = br.readLine().split(\" \");\n\n\t \tfor (int j = 0; j < line.length; j++) {\n\t\t \tmatrix[i][j] = Integer.parseInt(line[j]);\n\n\t\t \t// row sum\n\t\t \tmatrix[i][c] += matrix[i][j];\n\t\t \t// col sum\n\t\t \tmatrix[r][j] += matrix[i][j];\n\n\t\t \tif (j == line.length - 1) {\n\t\t\t \t// all sum\n\t\t\t \tmatrix[r][c] += matrix[i][c];\n\t\t \t}\n\t \t}\n\t }",
"{\n\t \tline = br.readLine().split(\" \");\n\n\t \tfor (int j = 0; j < line.length; j++) {\n\t\t \tmatrix[i][j] = Integer.parseInt(line[j]);\n\n\t\t \t// row sum\n\t\t \tmatrix[i][c] += matrix[i][j];\n\t\t \t// col sum\n\t\t \tmatrix[r][j] += matrix[i][j];\n\n\t\t \tif (j == line.length - 1) {\n\t\t\t \t// all sum\n\t\t\t \tmatrix[r][c] += matrix[i][c];\n\t\t \t}\n\t \t}\n\t }",
"line = br.readLine().split(\" \")",
"line",
"br.readLine().split(\" \")",
"br.readLine().split",
"br.readLine()",
"br.readLine",
"br",
"\" \"",
"for (int j = 0; j < line.length; j++) {\n\t\t \tmatrix[i][j] = Integer.parseInt(line[j]);\n\n\t\t \t// row sum\n\t\t \tmatrix[i][c] += matrix[i][j];\n\t\t \t// col sum\n\t\t \tmatrix[r][j] += matrix[i][j];\n\n\t\t \tif (j == line.length - 1) {\n\t\t\t \t// all sum\n\t\t\t \tmatrix[r][c] += matrix[i][c];\n\t\t \t}\n\t \t}",
"int j = 0;",
"int j = 0;",
"j",
"0",
"j < line.length",
"j",
"line.length",
"line",
"line.length",
"j++",
"j++",
"j",
"{\n\t\t \tmatrix[i][j] = Integer.parseInt(line[j]);\n\n\t\t \t// row sum\n\t\t \tmatrix[i][c] += matrix[i][j];\n\t\t \t// col sum\n\t\t \tmatrix[r][j] += matrix[i][j];\n\n\t\t \tif (j == line.length - 1) {\n\t\t\t \t// all sum\n\t\t\t \tmatrix[r][c] += matrix[i][c];\n\t\t \t}\n\t \t}",
"{\n\t\t \tmatrix[i][j] = Integer.parseInt(line[j]);\n\n\t\t \t// row sum\n\t\t \tmatrix[i][c] += matrix[i][j];\n\t\t \t// col sum\n\t\t \tmatrix[r][j] += matrix[i][j];\n\n\t\t \tif (j == line.length - 1) {\n\t\t\t \t// all sum\n\t\t\t \tmatrix[r][c] += matrix[i][c];\n\t\t \t}\n\t \t}",
"matrix[i][j] = Integer.parseInt(line[j])",
"matrix[i][j]",
"matrix[i]",
"matrix",
"i",
"j",
"Integer.parseInt(line[j])",
"Integer.parseInt",
"Integer",
"line[j]",
"line",
"j",
"matrix[i][c] += matrix[i][j]",
"matrix[i][c]",
"matrix[i]",
"matrix",
"i",
"c",
"matrix[i][j]",
"matrix[i]",
"matrix",
"i",
"j",
"matrix[r][j] += matrix[i][j]",
"matrix[r][j]",
"matrix[r]",
"matrix",
"r",
"j",
"matrix[i][j]",
"matrix[i]",
"matrix",
"i",
"j",
"if (j == line.length - 1) {\n\t\t\t \t// all sum\n\t\t\t \tmatrix[r][c] += matrix[i][c];\n\t\t \t}",
"j == line.length - 1",
"j",
"line.length - 1",
"line.length",
"line",
"line.length",
"1",
"{\n\t\t\t \t// all sum\n\t\t\t \tmatrix[r][c] += matrix[i][c];\n\t\t \t}",
"matrix[r][c] += matrix[i][c]",
"matrix[r][c]",
"matrix[r]",
"matrix",
"r",
"c",
"matrix[i][c]",
"matrix[i]",
"matrix",
"i",
"c",
"for (int i = 0; i < r + 1; i++) {\n\t\t StringBuilder sb = new StringBuilder();\n\t \tfor (int j = 0; j < c + 1; j++) {\n\t \t\tsb.append(matrix[i][j]);\n\t \t\tsb.append(\" \");\n\t \t}\n\t \tSystem.out.println(sb.toString().substring(0, sb.toString().length() - 1));\n\t }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < r + 1",
"i",
"r + 1",
"r",
"1",
"i++",
"i++",
"i",
"{\n\t\t StringBuilder sb = new StringBuilder();\n\t \tfor (int j = 0; j < c + 1; j++) {\n\t \t\tsb.append(matrix[i][j]);\n\t \t\tsb.append(\" \");\n\t \t}\n\t \tSystem.out.println(sb.toString().substring(0, sb.toString().length() - 1));\n\t }",
"{\n\t\t StringBuilder sb = new StringBuilder();\n\t \tfor (int j = 0; j < c + 1; j++) {\n\t \t\tsb.append(matrix[i][j]);\n\t \t\tsb.append(\" \");\n\t \t}\n\t \tSystem.out.println(sb.toString().substring(0, sb.toString().length() - 1));\n\t }",
"StringBuilder sb = new StringBuilder();",
"sb",
"new StringBuilder()",
"for (int j = 0; j < c + 1; j++) {\n\t \t\tsb.append(matrix[i][j]);\n\t \t\tsb.append(\" \");\n\t \t}",
"int j = 0;",
"int j = 0;",
"j",
"0",
"j < c + 1",
"j",
"c + 1",
"c",
"1",
"j++",
"j++",
"j",
"{\n\t \t\tsb.append(matrix[i][j]);\n\t \t\tsb.append(\" \");\n\t \t}",
"{\n\t \t\tsb.append(matrix[i][j]);\n\t \t\tsb.append(\" \");\n\t \t}",
"sb.append(matrix[i][j])",
"sb.append",
"sb",
"matrix[i][j]",
"matrix[i]",
"matrix",
"i",
"j",
"sb.append(\" \")",
"sb.append",
"sb",
"\" \"",
"System.out.println(sb.toString().substring(0, sb.toString().length() - 1))",
"System.out.println",
"System.out",
"System",
"System.out",
"sb.toString().substring(0, sb.toString().length() - 1)",
"sb.toString().substring",
"sb.toString()",
"sb.toString",
"sb",
"0",
"sb.toString().length() - 1",
"sb.toString().length()",
"sb.toString().length",
"sb.toString()",
"sb.toString",
"sb",
"1",
"String[] args",
"args",
"public class Main {\n\tpublic static void main(String[] args) throws Exception {\n\t BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\n\t String[] line = br.readLine().split(\" \");\n\n\t int r = Integer.parseInt(line[0]);\n\t int c = Integer.parseInt(line[1]);\n\n\t int[][] matrix = new int[r + 1][c + 1];\n\n\t for (int i = 0; i < r; i++) {\n\t \tline = br.readLine().split(\" \");\n\n\t \tfor (int j = 0; j < line.length; j++) {\n\t\t \tmatrix[i][j] = Integer.parseInt(line[j]);\n\n\t\t \t// row sum\n\t\t \tmatrix[i][c] += matrix[i][j];\n\t\t \t// col sum\n\t\t \tmatrix[r][j] += matrix[i][j];\n\n\t\t \tif (j == line.length - 1) {\n\t\t\t \t// all sum\n\t\t\t \tmatrix[r][c] += matrix[i][c];\n\t\t \t}\n\t \t}\n\t }\n\n\t for (int i = 0; i < r + 1; i++) {\n\t\t StringBuilder sb = new StringBuilder();\n\t \tfor (int j = 0; j < c + 1; j++) {\n\t \t\tsb.append(matrix[i][j]);\n\t \t\tsb.append(\" \");\n\t \t}\n\t \tSystem.out.println(sb.toString().substring(0, sb.toString().length() - 1));\n\t }\n\t}\n}",
"public class Main {\n\tpublic static void main(String[] args) throws Exception {\n\t BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\n\t String[] line = br.readLine().split(\" \");\n\n\t int r = Integer.parseInt(line[0]);\n\t int c = Integer.parseInt(line[1]);\n\n\t int[][] matrix = new int[r + 1][c + 1];\n\n\t for (int i = 0; i < r; i++) {\n\t \tline = br.readLine().split(\" \");\n\n\t \tfor (int j = 0; j < line.length; j++) {\n\t\t \tmatrix[i][j] = Integer.parseInt(line[j]);\n\n\t\t \t// row sum\n\t\t \tmatrix[i][c] += matrix[i][j];\n\t\t \t// col sum\n\t\t \tmatrix[r][j] += matrix[i][j];\n\n\t\t \tif (j == line.length - 1) {\n\t\t\t \t// all sum\n\t\t\t \tmatrix[r][c] += matrix[i][c];\n\t\t \t}\n\t \t}\n\t }\n\n\t for (int i = 0; i < r + 1; i++) {\n\t\t StringBuilder sb = new StringBuilder();\n\t \tfor (int j = 0; j < c + 1; j++) {\n\t \t\tsb.append(matrix[i][j]);\n\t \t\tsb.append(\" \");\n\t \t}\n\t \tSystem.out.println(sb.toString().substring(0, sb.toString().length() - 1));\n\t }\n\t}\n}",
"Main"
] | import java.io.BufferedReader;
import java.io.InputStreamReader;
public class Main {
public static void main(String[] args) throws Exception {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
String[] line = br.readLine().split(" ");
int r = Integer.parseInt(line[0]);
int c = Integer.parseInt(line[1]);
int[][] matrix = new int[r + 1][c + 1];
for (int i = 0; i < r; i++) {
line = br.readLine().split(" ");
for (int j = 0; j < line.length; j++) {
matrix[i][j] = Integer.parseInt(line[j]);
// row sum
matrix[i][c] += matrix[i][j];
// col sum
matrix[r][j] += matrix[i][j];
if (j == line.length - 1) {
// all sum
matrix[r][c] += matrix[i][c];
}
}
}
for (int i = 0; i < r + 1; i++) {
StringBuilder sb = new StringBuilder();
for (int j = 0; j < c + 1; j++) {
sb.append(matrix[i][j]);
sb.append(" ");
}
System.out.println(sb.toString().substring(0, sb.toString().length() - 1));
}
}
} |
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
41,
13,
20,
13,
13,
11,
1,
41,
13,
17,
2,
13,
18,
13,
13,
1,
40,
13,
30,
30,
11,
1,
41,
13,
17,
2,
13,
18,
18,
13,
13,
13,
1,
40,
13,
30,
30,
0,
18,
18,
13,
13,
13,
4,
18,
13,
41,
13,
20,
13,
41,
13,
20,
13,
11,
1,
41,
13,
17,
2,
13,
18,
13,
13,
1,
40,
13,
30,
30,
11,
1,
41,
13,
17,
2,
13,
18,
18,
13,
13,
13,
1,
40,
13,
30,
30,
0,
18,
13,
13,
18,
18,
13,
13,
13,
0,
18,
13,
13,
18,
18,
13,
13,
13,
11,
1,
41,
13,
17,
2,
13,
18,
13,
13,
1,
40,
13,
30,
30,
11,
1,
41,
13,
17,
2,
13,
18,
18,
13,
13,
13,
1,
40,
13,
30,
30,
4,
18,
18,
13,
13,
2,
18,
18,
13,
13,
13,
17,
4,
18,
18,
13,
13,
18,
13,
13,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
18,
13,
13,
1,
40,
13,
30,
30,
4,
18,
18,
13,
13,
2,
18,
13,
13,
17,
0,
13,
18,
13,
13,
4,
18,
18,
13,
13,
13,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
220,
5
],
[
220,
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
],
[
19,
20
],
[
20,
21
],
[
8,
22
],
[
22,
23
],
[
22,
24
],
[
8,
27
],
[
27,
28
],
[
28,
29
],
[
29,
30
],
[
29,
31
],
[
27,
32
],
[
32,
33
],
[
32,
34
],
[
34,
35
],
[
34,
36
],
[
27,
37
],
[
37,
38
],
[
38,
39
],
[
27,
40
],
[
41,
41
],
[
41,
42
],
[
42,
43
],
[
43,
44
],
[
44,
45
],
[
44,
46
],
[
42,
47
],
[
47,
48
],
[
47,
49
],
[
49,
50
],
[
50,
51
],
[
50,
52
],
[
49,
53
],
[
42,
54
],
[
54,
55
],
[
55,
56
],
[
42,
57
],
[
58,
58
],
[
58,
59
],
[
59,
60
],
[
60,
61
],
[
61,
62
],
[
61,
63
],
[
60,
64
],
[
59,
65
],
[
65,
66
],
[
66,
67
],
[
8,
68
],
[
68,
69
],
[
68,
70
],
[
8,
72
],
[
72,
73
],
[
72,
74
],
[
8,
76
],
[
76,
77
],
[
77,
78
],
[
78,
79
],
[
78,
80
],
[
76,
81
],
[
81,
82
],
[
81,
83
],
[
83,
84
],
[
83,
85
],
[
76,
86
],
[
86,
87
],
[
87,
88
],
[
76,
89
],
[
90,
90
],
[
90,
91
],
[
91,
92
],
[
92,
93
],
[
93,
94
],
[
93,
95
],
[
91,
96
],
[
96,
97
],
[
96,
98
],
[
98,
99
],
[
99,
100
],
[
99,
101
],
[
98,
102
],
[
91,
103
],
[
103,
104
],
[
104,
105
],
[
91,
106
],
[
107,
107
],
[
107,
108
],
[
108,
109
],
[
109,
110
],
[
109,
111
],
[
108,
112
],
[
112,
113
],
[
113,
114
],
[
113,
115
],
[
112,
116
],
[
107,
117
],
[
117,
118
],
[
118,
119
],
[
118,
120
],
[
117,
121
],
[
121,
122
],
[
122,
123
],
[
122,
124
],
[
121,
125
],
[
8,
126
],
[
126,
127
],
[
127,
128
],
[
128,
129
],
[
128,
130
],
[
126,
131
],
[
131,
132
],
[
131,
133
],
[
133,
134
],
[
133,
135
],
[
126,
136
],
[
136,
137
],
[
137,
138
],
[
126,
139
],
[
140,
140
],
[
140,
141
],
[
141,
142
],
[
142,
143
],
[
143,
144
],
[
143,
145
],
[
141,
146
],
[
146,
147
],
[
146,
148
],
[
148,
149
],
[
149,
150
],
[
149,
151
],
[
148,
152
],
[
141,
153
],
[
153,
154
],
[
154,
155
],
[
141,
156
],
[
157,
157
],
[
157,
158
],
[
158,
159
],
[
159,
160
],
[
160,
161
],
[
160,
162
],
[
158,
163
],
[
163,
164
],
[
164,
165
],
[
165,
166
],
[
165,
167
],
[
164,
168
],
[
163,
169
],
[
140,
170
],
[
170,
171
],
[
171,
172
],
[
172,
173
],
[
172,
174
],
[
170,
175
],
[
175,
176
],
[
175,
177
],
[
8,
178
],
[
178,
179
],
[
178,
180
],
[
8,
181
],
[
181,
182
],
[
182,
183
],
[
183,
184
],
[
183,
185
],
[
181,
186
],
[
186,
187
],
[
186,
188
],
[
188,
189
],
[
188,
190
],
[
181,
191
],
[
191,
192
],
[
192,
193
],
[
181,
194
],
[
195,
195
],
[
195,
196
],
[
196,
197
],
[
197,
198
],
[
198,
199
],
[
198,
200
],
[
196,
201
],
[
201,
202
],
[
202,
203
],
[
202,
204
],
[
201,
205
],
[
195,
206
],
[
206,
207
],
[
206,
208
],
[
208,
209
],
[
208,
210
],
[
8,
211
],
[
211,
212
],
[
212,
213
],
[
213,
214
],
[
213,
215
],
[
211,
216
],
[
6,
217
],
[
217,
218
],
[
0,
219
],
[
219,
220
],
[
219,
221
]
] | [
"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 gyou = sc.nextInt();\n\t\tint retu = sc.nextInt();\n\n\t\tint[][] hyou = new int[gyou][retu];\n\n\t\tfor(int i = 0;i < hyou.length;i++) {\n\t\t\tfor(int j = 0;j < hyou[i].length;j++) {\n\t\t\t\thyou[i][j] = sc.nextInt();\n\t\t\t}\n\t\t}\n\n\t\tint[] gyousum = new int[gyou];\n\t\tint[] retusum = new int[retu];\n\t\tfor(int i = 0;i < hyou.length;i++ ){\n\t\t\tfor(int j = 0;j < hyou[i].length;j++) {\n\t\t\t\tgyousum[i] += hyou[i][j];\n\t\t\t\tretusum[j] += hyou[i][j];\n\t\t\t}\n\t\t}\n\t\tfor(int i = 0;i < hyou.length;i++) {\n\t\t\tfor(int j = 0;j < hyou[i].length; j++) {\n\t\t\t\tSystem.out.print(hyou[i][j] + \" \");\n\t\t\t}\n\t\t\tSystem.out.println(gyousum[i]);\n\t\t}\n\t\tint sum = 0;\n\t\tfor(int i = 0;i < retusum.length;i++) {\n\t\t\tSystem.out.print(retusum[i] + \" \");\n\t\t\tsum += retusum[i];\n\t\t}\n\t\tSystem.out.println(sum);\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 gyou = sc.nextInt();\n\t\tint retu = sc.nextInt();\n\n\t\tint[][] hyou = new int[gyou][retu];\n\n\t\tfor(int i = 0;i < hyou.length;i++) {\n\t\t\tfor(int j = 0;j < hyou[i].length;j++) {\n\t\t\t\thyou[i][j] = sc.nextInt();\n\t\t\t}\n\t\t}\n\n\t\tint[] gyousum = new int[gyou];\n\t\tint[] retusum = new int[retu];\n\t\tfor(int i = 0;i < hyou.length;i++ ){\n\t\t\tfor(int j = 0;j < hyou[i].length;j++) {\n\t\t\t\tgyousum[i] += hyou[i][j];\n\t\t\t\tretusum[j] += hyou[i][j];\n\t\t\t}\n\t\t}\n\t\tfor(int i = 0;i < hyou.length;i++) {\n\t\t\tfor(int j = 0;j < hyou[i].length; j++) {\n\t\t\t\tSystem.out.print(hyou[i][j] + \" \");\n\t\t\t}\n\t\t\tSystem.out.println(gyousum[i]);\n\t\t}\n\t\tint sum = 0;\n\t\tfor(int i = 0;i < retusum.length;i++) {\n\t\t\tSystem.out.print(retusum[i] + \" \");\n\t\t\tsum += retusum[i];\n\t\t}\n\t\tSystem.out.println(sum);\n\t}\n}",
"Main",
"public static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\tint gyou = sc.nextInt();\n\t\tint retu = sc.nextInt();\n\n\t\tint[][] hyou = new int[gyou][retu];\n\n\t\tfor(int i = 0;i < hyou.length;i++) {\n\t\t\tfor(int j = 0;j < hyou[i].length;j++) {\n\t\t\t\thyou[i][j] = sc.nextInt();\n\t\t\t}\n\t\t}\n\n\t\tint[] gyousum = new int[gyou];\n\t\tint[] retusum = new int[retu];\n\t\tfor(int i = 0;i < hyou.length;i++ ){\n\t\t\tfor(int j = 0;j < hyou[i].length;j++) {\n\t\t\t\tgyousum[i] += hyou[i][j];\n\t\t\t\tretusum[j] += hyou[i][j];\n\t\t\t}\n\t\t}\n\t\tfor(int i = 0;i < hyou.length;i++) {\n\t\t\tfor(int j = 0;j < hyou[i].length; j++) {\n\t\t\t\tSystem.out.print(hyou[i][j] + \" \");\n\t\t\t}\n\t\t\tSystem.out.println(gyousum[i]);\n\t\t}\n\t\tint sum = 0;\n\t\tfor(int i = 0;i < retusum.length;i++) {\n\t\t\tSystem.out.print(retusum[i] + \" \");\n\t\t\tsum += retusum[i];\n\t\t}\n\t\tSystem.out.println(sum);\n\t}",
"main",
"{\n\t\tScanner sc = new Scanner(System.in);\n\t\tint gyou = sc.nextInt();\n\t\tint retu = sc.nextInt();\n\n\t\tint[][] hyou = new int[gyou][retu];\n\n\t\tfor(int i = 0;i < hyou.length;i++) {\n\t\t\tfor(int j = 0;j < hyou[i].length;j++) {\n\t\t\t\thyou[i][j] = sc.nextInt();\n\t\t\t}\n\t\t}\n\n\t\tint[] gyousum = new int[gyou];\n\t\tint[] retusum = new int[retu];\n\t\tfor(int i = 0;i < hyou.length;i++ ){\n\t\t\tfor(int j = 0;j < hyou[i].length;j++) {\n\t\t\t\tgyousum[i] += hyou[i][j];\n\t\t\t\tretusum[j] += hyou[i][j];\n\t\t\t}\n\t\t}\n\t\tfor(int i = 0;i < hyou.length;i++) {\n\t\t\tfor(int j = 0;j < hyou[i].length; j++) {\n\t\t\t\tSystem.out.print(hyou[i][j] + \" \");\n\t\t\t}\n\t\t\tSystem.out.println(gyousum[i]);\n\t\t}\n\t\tint sum = 0;\n\t\tfor(int i = 0;i < retusum.length;i++) {\n\t\t\tSystem.out.print(retusum[i] + \" \");\n\t\t\tsum += retusum[i];\n\t\t}\n\t\tSystem.out.println(sum);\n\t}",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"int gyou = sc.nextInt();",
"gyou",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int retu = sc.nextInt();",
"retu",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int[][] hyou = new int[gyou][retu];",
"hyou",
"new int[gyou][retu]",
"gyou",
"retu",
"for(int i = 0;i < hyou.length;i++) {\n\t\t\tfor(int j = 0;j < hyou[i].length;j++) {\n\t\t\t\thyou[i][j] = sc.nextInt();\n\t\t\t}\n\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < hyou.length",
"i",
"hyou.length",
"hyou",
"hyou.length",
"i++",
"i++",
"i",
"{\n\t\t\tfor(int j = 0;j < hyou[i].length;j++) {\n\t\t\t\thyou[i][j] = sc.nextInt();\n\t\t\t}\n\t\t}",
"{\n\t\t\tfor(int j = 0;j < hyou[i].length;j++) {\n\t\t\t\thyou[i][j] = sc.nextInt();\n\t\t\t}\n\t\t}",
"for(int j = 0;j < hyou[i].length;j++) {\n\t\t\t\thyou[i][j] = sc.nextInt();\n\t\t\t}",
"int j = 0;",
"int j = 0;",
"j",
"0",
"j < hyou[i].length",
"j",
"hyou[i].length",
"hyou[i]",
"hyou",
"i",
"hyou[i].length",
"j++",
"j++",
"j",
"{\n\t\t\t\thyou[i][j] = sc.nextInt();\n\t\t\t}",
"{\n\t\t\t\thyou[i][j] = sc.nextInt();\n\t\t\t}",
"hyou[i][j] = sc.nextInt()",
"hyou[i][j]",
"hyou[i]",
"hyou",
"i",
"j",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int[] gyousum = new int[gyou];",
"gyousum",
"new int[gyou]",
"gyou",
"int[] retusum = new int[retu];",
"retusum",
"new int[retu]",
"retu",
"for(int i = 0;i < hyou.length;i++ ){\n\t\t\tfor(int j = 0;j < hyou[i].length;j++) {\n\t\t\t\tgyousum[i] += hyou[i][j];\n\t\t\t\tretusum[j] += hyou[i][j];\n\t\t\t}\n\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < hyou.length",
"i",
"hyou.length",
"hyou",
"hyou.length",
"i++",
"i++",
"i",
"{\n\t\t\tfor(int j = 0;j < hyou[i].length;j++) {\n\t\t\t\tgyousum[i] += hyou[i][j];\n\t\t\t\tretusum[j] += hyou[i][j];\n\t\t\t}\n\t\t}",
"{\n\t\t\tfor(int j = 0;j < hyou[i].length;j++) {\n\t\t\t\tgyousum[i] += hyou[i][j];\n\t\t\t\tretusum[j] += hyou[i][j];\n\t\t\t}\n\t\t}",
"for(int j = 0;j < hyou[i].length;j++) {\n\t\t\t\tgyousum[i] += hyou[i][j];\n\t\t\t\tretusum[j] += hyou[i][j];\n\t\t\t}",
"int j = 0;",
"int j = 0;",
"j",
"0",
"j < hyou[i].length",
"j",
"hyou[i].length",
"hyou[i]",
"hyou",
"i",
"hyou[i].length",
"j++",
"j++",
"j",
"{\n\t\t\t\tgyousum[i] += hyou[i][j];\n\t\t\t\tretusum[j] += hyou[i][j];\n\t\t\t}",
"{\n\t\t\t\tgyousum[i] += hyou[i][j];\n\t\t\t\tretusum[j] += hyou[i][j];\n\t\t\t}",
"gyousum[i] += hyou[i][j]",
"gyousum[i]",
"gyousum",
"i",
"hyou[i][j]",
"hyou[i]",
"hyou",
"i",
"j",
"retusum[j] += hyou[i][j]",
"retusum[j]",
"retusum",
"j",
"hyou[i][j]",
"hyou[i]",
"hyou",
"i",
"j",
"for(int i = 0;i < hyou.length;i++) {\n\t\t\tfor(int j = 0;j < hyou[i].length; j++) {\n\t\t\t\tSystem.out.print(hyou[i][j] + \" \");\n\t\t\t}\n\t\t\tSystem.out.println(gyousum[i]);\n\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < hyou.length",
"i",
"hyou.length",
"hyou",
"hyou.length",
"i++",
"i++",
"i",
"{\n\t\t\tfor(int j = 0;j < hyou[i].length; j++) {\n\t\t\t\tSystem.out.print(hyou[i][j] + \" \");\n\t\t\t}\n\t\t\tSystem.out.println(gyousum[i]);\n\t\t}",
"{\n\t\t\tfor(int j = 0;j < hyou[i].length; j++) {\n\t\t\t\tSystem.out.print(hyou[i][j] + \" \");\n\t\t\t}\n\t\t\tSystem.out.println(gyousum[i]);\n\t\t}",
"for(int j = 0;j < hyou[i].length; j++) {\n\t\t\t\tSystem.out.print(hyou[i][j] + \" \");\n\t\t\t}",
"int j = 0;",
"int j = 0;",
"j",
"0",
"j < hyou[i].length",
"j",
"hyou[i].length",
"hyou[i]",
"hyou",
"i",
"hyou[i].length",
"j++",
"j++",
"j",
"{\n\t\t\t\tSystem.out.print(hyou[i][j] + \" \");\n\t\t\t}",
"{\n\t\t\t\tSystem.out.print(hyou[i][j] + \" \");\n\t\t\t}",
"System.out.print(hyou[i][j] + \" \")",
"System.out.print",
"System.out",
"System",
"System.out",
"hyou[i][j] + \" \"",
"hyou[i][j]",
"hyou[i]",
"hyou",
"i",
"j",
"\" \"",
"System.out.println(gyousum[i])",
"System.out.println",
"System.out",
"System",
"System.out",
"gyousum[i]",
"gyousum",
"i",
"int sum = 0;",
"sum",
"0",
"for(int i = 0;i < retusum.length;i++) {\n\t\t\tSystem.out.print(retusum[i] + \" \");\n\t\t\tsum += retusum[i];\n\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < retusum.length",
"i",
"retusum.length",
"retusum",
"retusum.length",
"i++",
"i++",
"i",
"{\n\t\t\tSystem.out.print(retusum[i] + \" \");\n\t\t\tsum += retusum[i];\n\t\t}",
"{\n\t\t\tSystem.out.print(retusum[i] + \" \");\n\t\t\tsum += retusum[i];\n\t\t}",
"System.out.print(retusum[i] + \" \")",
"System.out.print",
"System.out",
"System",
"System.out",
"retusum[i] + \" \"",
"retusum[i]",
"retusum",
"i",
"\" \"",
"sum += retusum[i]",
"sum",
"retusum[i]",
"retusum",
"i",
"System.out.println(sum)",
"System.out.println",
"System.out",
"System",
"System.out",
"sum",
"String[] args",
"args",
"public class Main {\n\tpublic static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\tint gyou = sc.nextInt();\n\t\tint retu = sc.nextInt();\n\n\t\tint[][] hyou = new int[gyou][retu];\n\n\t\tfor(int i = 0;i < hyou.length;i++) {\n\t\t\tfor(int j = 0;j < hyou[i].length;j++) {\n\t\t\t\thyou[i][j] = sc.nextInt();\n\t\t\t}\n\t\t}\n\n\t\tint[] gyousum = new int[gyou];\n\t\tint[] retusum = new int[retu];\n\t\tfor(int i = 0;i < hyou.length;i++ ){\n\t\t\tfor(int j = 0;j < hyou[i].length;j++) {\n\t\t\t\tgyousum[i] += hyou[i][j];\n\t\t\t\tretusum[j] += hyou[i][j];\n\t\t\t}\n\t\t}\n\t\tfor(int i = 0;i < hyou.length;i++) {\n\t\t\tfor(int j = 0;j < hyou[i].length; j++) {\n\t\t\t\tSystem.out.print(hyou[i][j] + \" \");\n\t\t\t}\n\t\t\tSystem.out.println(gyousum[i]);\n\t\t}\n\t\tint sum = 0;\n\t\tfor(int i = 0;i < retusum.length;i++) {\n\t\t\tSystem.out.print(retusum[i] + \" \");\n\t\t\tsum += retusum[i];\n\t\t}\n\t\tSystem.out.println(sum);\n\t}\n}",
"public class Main {\n\tpublic static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\tint gyou = sc.nextInt();\n\t\tint retu = sc.nextInt();\n\n\t\tint[][] hyou = new int[gyou][retu];\n\n\t\tfor(int i = 0;i < hyou.length;i++) {\n\t\t\tfor(int j = 0;j < hyou[i].length;j++) {\n\t\t\t\thyou[i][j] = sc.nextInt();\n\t\t\t}\n\t\t}\n\n\t\tint[] gyousum = new int[gyou];\n\t\tint[] retusum = new int[retu];\n\t\tfor(int i = 0;i < hyou.length;i++ ){\n\t\t\tfor(int j = 0;j < hyou[i].length;j++) {\n\t\t\t\tgyousum[i] += hyou[i][j];\n\t\t\t\tretusum[j] += hyou[i][j];\n\t\t\t}\n\t\t}\n\t\tfor(int i = 0;i < hyou.length;i++) {\n\t\t\tfor(int j = 0;j < hyou[i].length; j++) {\n\t\t\t\tSystem.out.print(hyou[i][j] + \" \");\n\t\t\t}\n\t\t\tSystem.out.println(gyousum[i]);\n\t\t}\n\t\tint sum = 0;\n\t\tfor(int i = 0;i < retusum.length;i++) {\n\t\t\tSystem.out.print(retusum[i] + \" \");\n\t\t\tsum += retusum[i];\n\t\t}\n\t\tSystem.out.println(sum);\n\t}\n}",
"Main"
] | import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int gyou = sc.nextInt();
int retu = sc.nextInt();
int[][] hyou = new int[gyou][retu];
for(int i = 0;i < hyou.length;i++) {
for(int j = 0;j < hyou[i].length;j++) {
hyou[i][j] = sc.nextInt();
}
}
int[] gyousum = new int[gyou];
int[] retusum = new int[retu];
for(int i = 0;i < hyou.length;i++ ){
for(int j = 0;j < hyou[i].length;j++) {
gyousum[i] += hyou[i][j];
retusum[j] += hyou[i][j];
}
}
for(int i = 0;i < hyou.length;i++) {
for(int j = 0;j < hyou[i].length; j++) {
System.out.print(hyou[i][j] + " ");
}
System.out.println(gyousum[i]);
}
int sum = 0;
for(int i = 0;i < retusum.length;i++) {
System.out.print(retusum[i] + " ");
sum += retusum[i];
}
System.out.println(sum);
}
} |
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
41,
13,
20,
2,
17,
17,
2,
17,
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,
18,
18,
13,
13,
13,
4,
18,
13,
0,
13,
18,
18,
13,
13,
13,
0,
18,
18,
13,
13,
13,
18,
18,
13,
13,
13,
0,
18,
18,
13,
13,
13,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
18,
18,
13,
13,
13,
18,
18,
13,
13,
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,
4,
18,
18,
13,
13,
17,
18,
18,
13,
13,
13,
4,
18,
18,
13,
13,
18,
18,
13,
13,
13,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
171,
5
],
[
171,
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
],
[
19,
20
],
[
20,
21
],
[
8,
22
],
[
22,
23
],
[
22,
24
],
[
25,
26
],
[
25,
27
],
[
28,
29
],
[
28,
30
],
[
8,
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
],
[
44,
46
],
[
43,
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
],
[
61,
65
],
[
60,
66
],
[
66,
67
],
[
67,
68
],
[
59,
69
],
[
69,
70
],
[
69,
71
],
[
71,
72
],
[
72,
73
],
[
72,
74
],
[
71,
75
],
[
59,
76
],
[
76,
77
],
[
77,
78
],
[
78,
79
],
[
78,
80
],
[
77,
81
],
[
76,
82
],
[
82,
83
],
[
83,
84
],
[
83,
85
],
[
82,
86
],
[
43,
87
],
[
87,
88
],
[
88,
89
],
[
89,
90
],
[
89,
91
],
[
88,
92
],
[
87,
93
],
[
8,
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
],
[
108,
109
],
[
109,
110
],
[
109,
111
],
[
108,
112
],
[
107,
113
],
[
113,
114
],
[
114,
115
],
[
114,
116
],
[
113,
117
],
[
8,
118
],
[
118,
119
],
[
119,
120
],
[
8,
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
],
[
135,
136
],
[
136,
137
],
[
136,
138
],
[
134,
139
],
[
139,
140
],
[
139,
141
],
[
134,
142
],
[
142,
143
],
[
143,
144
],
[
134,
145
],
[
146,
146
],
[
146,
147
],
[
147,
148
],
[
148,
149
],
[
149,
150
],
[
149,
151
],
[
147,
152
],
[
147,
153
],
[
153,
154
],
[
154,
155
],
[
154,
156
],
[
153,
157
],
[
133,
158
],
[
158,
159
],
[
159,
160
],
[
160,
161
],
[
160,
162
],
[
158,
163
],
[
163,
164
],
[
164,
165
],
[
164,
166
],
[
163,
167
],
[
6,
168
],
[
168,
169
],
[
0,
170
],
[
170,
171
],
[
170,
172
]
] | [
"import java.util.Scanner;\n\n//20180510\n//01\n\npublic class Main {\n public static void main(String[] args){\n\t\tScanner scanner = new Scanner(System.in);\n\t\tint r = scanner.nextInt();\n\t\tint c = scanner.nextInt();\n\t\tint[][] output = new int[100+1][100+1];\n\n\t\tfor(int i = 0;i < r;i++) {\n\t\t\tint ans_r = 0;\n\t\t\tfor(int j = 0;j < c;j++) {\n\t\t\t\toutput[i][j] = scanner.nextInt();\n\t\t\t\tans_r += output[i][j];\n\t\t\t\toutput[r][j] += output[i][j];\n\t\t\t}\n\t\t\toutput[i][c] += ans_r;\n\t\t}\n\n\t\tfor(int y = 0;y < c;y++) {\n\t\t\toutput[r][c] += output[r][y];\n\t\t}\n\n\t\tscanner.close();\n\n\t\tfor(int i = 0;i <= r;i++) {\n\t\t\tfor(int j = 0;j < c;j++) {\n\t\t\t\t\tSystem.out.printf(\"%d \",output[i][j]);\n\t\t\t}\n\t\t\tSystem.out.println(output[i][c]);\n\t\t}\n }\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n public static void main(String[] args){\n\t\tScanner scanner = new Scanner(System.in);\n\t\tint r = scanner.nextInt();\n\t\tint c = scanner.nextInt();\n\t\tint[][] output = new int[100+1][100+1];\n\n\t\tfor(int i = 0;i < r;i++) {\n\t\t\tint ans_r = 0;\n\t\t\tfor(int j = 0;j < c;j++) {\n\t\t\t\toutput[i][j] = scanner.nextInt();\n\t\t\t\tans_r += output[i][j];\n\t\t\t\toutput[r][j] += output[i][j];\n\t\t\t}\n\t\t\toutput[i][c] += ans_r;\n\t\t}\n\n\t\tfor(int y = 0;y < c;y++) {\n\t\t\toutput[r][c] += output[r][y];\n\t\t}\n\n\t\tscanner.close();\n\n\t\tfor(int i = 0;i <= r;i++) {\n\t\t\tfor(int j = 0;j < c;j++) {\n\t\t\t\t\tSystem.out.printf(\"%d \",output[i][j]);\n\t\t\t}\n\t\t\tSystem.out.println(output[i][c]);\n\t\t}\n }\n}",
"Main",
"public static void main(String[] args){\n\t\tScanner scanner = new Scanner(System.in);\n\t\tint r = scanner.nextInt();\n\t\tint c = scanner.nextInt();\n\t\tint[][] output = new int[100+1][100+1];\n\n\t\tfor(int i = 0;i < r;i++) {\n\t\t\tint ans_r = 0;\n\t\t\tfor(int j = 0;j < c;j++) {\n\t\t\t\toutput[i][j] = scanner.nextInt();\n\t\t\t\tans_r += output[i][j];\n\t\t\t\toutput[r][j] += output[i][j];\n\t\t\t}\n\t\t\toutput[i][c] += ans_r;\n\t\t}\n\n\t\tfor(int y = 0;y < c;y++) {\n\t\t\toutput[r][c] += output[r][y];\n\t\t}\n\n\t\tscanner.close();\n\n\t\tfor(int i = 0;i <= r;i++) {\n\t\t\tfor(int j = 0;j < c;j++) {\n\t\t\t\t\tSystem.out.printf(\"%d \",output[i][j]);\n\t\t\t}\n\t\t\tSystem.out.println(output[i][c]);\n\t\t}\n }",
"main",
"{\n\t\tScanner scanner = new Scanner(System.in);\n\t\tint r = scanner.nextInt();\n\t\tint c = scanner.nextInt();\n\t\tint[][] output = new int[100+1][100+1];\n\n\t\tfor(int i = 0;i < r;i++) {\n\t\t\tint ans_r = 0;\n\t\t\tfor(int j = 0;j < c;j++) {\n\t\t\t\toutput[i][j] = scanner.nextInt();\n\t\t\t\tans_r += output[i][j];\n\t\t\t\toutput[r][j] += output[i][j];\n\t\t\t}\n\t\t\toutput[i][c] += ans_r;\n\t\t}\n\n\t\tfor(int y = 0;y < c;y++) {\n\t\t\toutput[r][c] += output[r][y];\n\t\t}\n\n\t\tscanner.close();\n\n\t\tfor(int i = 0;i <= r;i++) {\n\t\t\tfor(int j = 0;j < c;j++) {\n\t\t\t\t\tSystem.out.printf(\"%d \",output[i][j]);\n\t\t\t}\n\t\t\tSystem.out.println(output[i][c]);\n\t\t}\n }",
"Scanner scanner = new Scanner(System.in);",
"scanner",
"new Scanner(System.in)",
"int r = scanner.nextInt();",
"r",
"scanner.nextInt()",
"scanner.nextInt",
"scanner",
"int c = scanner.nextInt();",
"c",
"scanner.nextInt()",
"scanner.nextInt",
"scanner",
"int[][] output = new int[100+1][100+1];",
"output",
"new int[100+1][100+1]",
"100+1",
"100",
"1",
"100+1",
"100",
"1",
"for(int i = 0;i < r;i++) {\n\t\t\tint ans_r = 0;\n\t\t\tfor(int j = 0;j < c;j++) {\n\t\t\t\toutput[i][j] = scanner.nextInt();\n\t\t\t\tans_r += output[i][j];\n\t\t\t\toutput[r][j] += output[i][j];\n\t\t\t}\n\t\t\toutput[i][c] += ans_r;\n\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < r",
"i",
"r",
"i++",
"i++",
"i",
"{\n\t\t\tint ans_r = 0;\n\t\t\tfor(int j = 0;j < c;j++) {\n\t\t\t\toutput[i][j] = scanner.nextInt();\n\t\t\t\tans_r += output[i][j];\n\t\t\t\toutput[r][j] += output[i][j];\n\t\t\t}\n\t\t\toutput[i][c] += ans_r;\n\t\t}",
"{\n\t\t\tint ans_r = 0;\n\t\t\tfor(int j = 0;j < c;j++) {\n\t\t\t\toutput[i][j] = scanner.nextInt();\n\t\t\t\tans_r += output[i][j];\n\t\t\t\toutput[r][j] += output[i][j];\n\t\t\t}\n\t\t\toutput[i][c] += ans_r;\n\t\t}",
"int ans_r = 0;",
"ans_r",
"0",
"for(int j = 0;j < c;j++) {\n\t\t\t\toutput[i][j] = scanner.nextInt();\n\t\t\t\tans_r += output[i][j];\n\t\t\t\toutput[r][j] += output[i][j];\n\t\t\t}",
"int j = 0;",
"int j = 0;",
"j",
"0",
"j < c",
"j",
"c",
"j++",
"j++",
"j",
"{\n\t\t\t\toutput[i][j] = scanner.nextInt();\n\t\t\t\tans_r += output[i][j];\n\t\t\t\toutput[r][j] += output[i][j];\n\t\t\t}",
"{\n\t\t\t\toutput[i][j] = scanner.nextInt();\n\t\t\t\tans_r += output[i][j];\n\t\t\t\toutput[r][j] += output[i][j];\n\t\t\t}",
"output[i][j] = scanner.nextInt()",
"output[i][j]",
"output[i]",
"output",
"i",
"j",
"scanner.nextInt()",
"scanner.nextInt",
"scanner",
"ans_r += output[i][j]",
"ans_r",
"output[i][j]",
"output[i]",
"output",
"i",
"j",
"output[r][j] += output[i][j]",
"output[r][j]",
"output[r]",
"output",
"r",
"j",
"output[i][j]",
"output[i]",
"output",
"i",
"j",
"output[i][c] += ans_r",
"output[i][c]",
"output[i]",
"output",
"i",
"c",
"ans_r",
"for(int y = 0;y < c;y++) {\n\t\t\toutput[r][c] += output[r][y];\n\t\t}",
"int y = 0;",
"int y = 0;",
"y",
"0",
"y < c",
"y",
"c",
"y++",
"y++",
"y",
"{\n\t\t\toutput[r][c] += output[r][y];\n\t\t}",
"{\n\t\t\toutput[r][c] += output[r][y];\n\t\t}",
"output[r][c] += output[r][y]",
"output[r][c]",
"output[r]",
"output",
"r",
"c",
"output[r][y]",
"output[r]",
"output",
"r",
"y",
"scanner.close()",
"scanner.close",
"scanner",
"for(int i = 0;i <= r;i++) {\n\t\t\tfor(int j = 0;j < c;j++) {\n\t\t\t\t\tSystem.out.printf(\"%d \",output[i][j]);\n\t\t\t}\n\t\t\tSystem.out.println(output[i][c]);\n\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i <= r",
"i",
"r",
"i++",
"i++",
"i",
"{\n\t\t\tfor(int j = 0;j < c;j++) {\n\t\t\t\t\tSystem.out.printf(\"%d \",output[i][j]);\n\t\t\t}\n\t\t\tSystem.out.println(output[i][c]);\n\t\t}",
"{\n\t\t\tfor(int j = 0;j < c;j++) {\n\t\t\t\t\tSystem.out.printf(\"%d \",output[i][j]);\n\t\t\t}\n\t\t\tSystem.out.println(output[i][c]);\n\t\t}",
"for(int j = 0;j < c;j++) {\n\t\t\t\t\tSystem.out.printf(\"%d \",output[i][j]);\n\t\t\t}",
"int j = 0;",
"int j = 0;",
"j",
"0",
"j < c",
"j",
"c",
"j++",
"j++",
"j",
"{\n\t\t\t\t\tSystem.out.printf(\"%d \",output[i][j]);\n\t\t\t}",
"{\n\t\t\t\t\tSystem.out.printf(\"%d \",output[i][j]);\n\t\t\t}",
"System.out.printf(\"%d \",output[i][j])",
"System.out.printf",
"System.out",
"System",
"System.out",
"\"%d \"",
"output[i][j]",
"output[i]",
"output",
"i",
"j",
"System.out.println(output[i][c])",
"System.out.println",
"System.out",
"System",
"System.out",
"output[i][c]",
"output[i]",
"output",
"i",
"c",
"String[] args",
"args",
"public class Main {\n public static void main(String[] args){\n\t\tScanner scanner = new Scanner(System.in);\n\t\tint r = scanner.nextInt();\n\t\tint c = scanner.nextInt();\n\t\tint[][] output = new int[100+1][100+1];\n\n\t\tfor(int i = 0;i < r;i++) {\n\t\t\tint ans_r = 0;\n\t\t\tfor(int j = 0;j < c;j++) {\n\t\t\t\toutput[i][j] = scanner.nextInt();\n\t\t\t\tans_r += output[i][j];\n\t\t\t\toutput[r][j] += output[i][j];\n\t\t\t}\n\t\t\toutput[i][c] += ans_r;\n\t\t}\n\n\t\tfor(int y = 0;y < c;y++) {\n\t\t\toutput[r][c] += output[r][y];\n\t\t}\n\n\t\tscanner.close();\n\n\t\tfor(int i = 0;i <= r;i++) {\n\t\t\tfor(int j = 0;j < c;j++) {\n\t\t\t\t\tSystem.out.printf(\"%d \",output[i][j]);\n\t\t\t}\n\t\t\tSystem.out.println(output[i][c]);\n\t\t}\n }\n}",
"public class Main {\n public static void main(String[] args){\n\t\tScanner scanner = new Scanner(System.in);\n\t\tint r = scanner.nextInt();\n\t\tint c = scanner.nextInt();\n\t\tint[][] output = new int[100+1][100+1];\n\n\t\tfor(int i = 0;i < r;i++) {\n\t\t\tint ans_r = 0;\n\t\t\tfor(int j = 0;j < c;j++) {\n\t\t\t\toutput[i][j] = scanner.nextInt();\n\t\t\t\tans_r += output[i][j];\n\t\t\t\toutput[r][j] += output[i][j];\n\t\t\t}\n\t\t\toutput[i][c] += ans_r;\n\t\t}\n\n\t\tfor(int y = 0;y < c;y++) {\n\t\t\toutput[r][c] += output[r][y];\n\t\t}\n\n\t\tscanner.close();\n\n\t\tfor(int i = 0;i <= r;i++) {\n\t\t\tfor(int j = 0;j < c;j++) {\n\t\t\t\t\tSystem.out.printf(\"%d \",output[i][j]);\n\t\t\t}\n\t\t\tSystem.out.println(output[i][c]);\n\t\t}\n }\n}",
"Main"
] | import java.util.Scanner;
//20180510
//01
public class Main {
public static void main(String[] args){
Scanner scanner = new Scanner(System.in);
int r = scanner.nextInt();
int c = scanner.nextInt();
int[][] output = new int[100+1][100+1];
for(int i = 0;i < r;i++) {
int ans_r = 0;
for(int j = 0;j < c;j++) {
output[i][j] = scanner.nextInt();
ans_r += output[i][j];
output[r][j] += output[i][j];
}
output[i][c] += ans_r;
}
for(int y = 0;y < c;y++) {
output[r][c] += output[r][y];
}
scanner.close();
for(int i = 0;i <= r;i++) {
for(int j = 0;j < c;j++) {
System.out.printf("%d ",output[i][j]);
}
System.out.println(output[i][c]);
}
}
}
|
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
17,
41,
13,
17,
41,
13,
17,
41,
13,
20,
17,
17,
41,
13,
20,
41,
13,
42,
2,
0,
13,
4,
18,
13,
17,
30,
41,
13,
20,
42,
4,
18,
13,
30,
14,
2,
2,
13,
17,
2,
13,
17,
30,
0,
13,
4,
18,
13,
4,
18,
13,
0,
13,
4,
18,
13,
4,
18,
13,
30,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
18,
18,
13,
13,
13,
4,
18,
13,
4,
18,
13,
40,
13,
14,
2,
13,
13,
30,
3,
41,
13,
17,
41,
13,
20,
2,
13,
17,
2,
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,
18,
18,
13,
13,
13,
18,
18,
13,
13,
13,
0,
18,
18,
13,
13,
13,
18,
18,
13,
13,
13,
0,
13,
18,
18,
13,
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,
18,
18,
13,
13,
13,
0,
18,
18,
13,
13,
13,
13,
11,
1,
41,
13,
17,
2,
13,
18,
13,
13,
1,
40,
13,
30,
30,
11,
1,
41,
13,
17,
2,
13,
18,
18,
13,
13,
13,
1,
40,
13,
30,
30,
4,
18,
18,
13,
13,
18,
18,
13,
13,
13,
14,
40,
2,
13,
13,
30,
4,
18,
18,
13,
13,
17,
4,
18,
18,
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
],
[
286,
14
],
[
286,
15
],
[
15,
16
],
[
15,
17
],
[
17,
18
],
[
18,
19
],
[
18,
20
],
[
17,
21
],
[
21,
22
],
[
21,
23
],
[
17,
24
],
[
24,
25
],
[
24,
26
],
[
17,
27
],
[
27,
28
],
[
27,
29
],
[
17,
32
],
[
32,
33
],
[
32,
34
],
[
17,
35
],
[
35,
36
],
[
17,
37
],
[
37,
38
],
[
38,
39
],
[
39,
40
],
[
39,
41
],
[
41,
42
],
[
42,
43
],
[
38,
44
],
[
37,
45
],
[
45,
46
],
[
46,
47
],
[
46,
48
],
[
45,
49
],
[
49,
50
],
[
50,
51
],
[
51,
52
],
[
49,
53
],
[
53,
54
],
[
54,
55
],
[
55,
56
],
[
56,
57
],
[
56,
58
],
[
55,
59
],
[
59,
60
],
[
59,
61
],
[
54,
62
],
[
62,
63
],
[
63,
64
],
[
63,
65
],
[
65,
66
],
[
66,
67
],
[
65,
68
],
[
68,
69
],
[
69,
70
],
[
62,
71
],
[
71,
72
],
[
71,
73
],
[
73,
74
],
[
74,
75
],
[
73,
76
],
[
76,
77
],
[
77,
78
],
[
54,
79
],
[
79,
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
],
[
94,
98
],
[
93,
99
],
[
99,
100
],
[
100,
101
],
[
99,
102
],
[
102,
103
],
[
103,
104
],
[
79,
105
],
[
105,
106
],
[
45,
107
],
[
107,
108
],
[
108,
109
],
[
108,
110
],
[
107,
111
],
[
111,
112
],
[
17,
113
],
[
113,
114
],
[
113,
115
],
[
17,
116
],
[
116,
117
],
[
116,
118
],
[
119,
120
],
[
119,
121
],
[
122,
123
],
[
122,
124
],
[
17,
125
],
[
125,
126
],
[
126,
127
],
[
127,
128
],
[
127,
129
],
[
125,
130
],
[
130,
131
],
[
130,
132
],
[
125,
133
],
[
133,
134
],
[
134,
135
],
[
125,
136
],
[
137,
137
],
[
137,
138
],
[
138,
139
],
[
139,
140
],
[
140,
141
],
[
140,
142
],
[
138,
143
],
[
143,
144
],
[
143,
145
],
[
138,
146
],
[
146,
147
],
[
147,
148
],
[
138,
149
],
[
150,
150
],
[
150,
151
],
[
151,
152
],
[
152,
153
],
[
153,
154
],
[
153,
155
],
[
152,
156
],
[
151,
157
],
[
157,
158
],
[
158,
159
],
[
158,
160
],
[
157,
161
],
[
150,
162
],
[
162,
163
],
[
163,
164
],
[
164,
165
],
[
164,
166
],
[
163,
167
],
[
162,
168
],
[
168,
169
],
[
169,
170
],
[
169,
171
],
[
168,
172
],
[
137,
173
],
[
173,
174
],
[
173,
175
],
[
175,
176
],
[
176,
177
],
[
176,
178
],
[
175,
179
],
[
17,
180
],
[
180,
181
],
[
181,
182
],
[
182,
183
],
[
182,
184
],
[
180,
185
],
[
185,
186
],
[
185,
187
],
[
180,
188
],
[
188,
189
],
[
189,
190
],
[
180,
191
],
[
192,
192
],
[
192,
193
],
[
193,
194
],
[
194,
195
],
[
195,
196
],
[
195,
197
],
[
193,
198
],
[
198,
199
],
[
198,
200
],
[
193,
201
],
[
201,
202
],
[
202,
203
],
[
193,
204
],
[
205,
205
],
[
205,
206
],
[
206,
207
],
[
207,
208
],
[
208,
209
],
[
208,
210
],
[
207,
211
],
[
206,
212
],
[
212,
213
],
[
213,
214
],
[
213,
215
],
[
212,
216
],
[
17,
217
],
[
217,
218
],
[
218,
219
],
[
219,
220
],
[
219,
221
],
[
218,
222
],
[
217,
223
],
[
17,
224
],
[
224,
225
],
[
225,
226
],
[
226,
227
],
[
226,
228
],
[
224,
229
],
[
229,
230
],
[
229,
231
],
[
231,
232
],
[
231,
233
],
[
224,
234
],
[
234,
235
],
[
235,
236
],
[
224,
237
],
[
238,
238
],
[
238,
239
],
[
239,
240
],
[
240,
241
],
[
241,
242
],
[
241,
243
],
[
239,
244
],
[
244,
245
],
[
244,
246
],
[
246,
247
],
[
247,
248
],
[
247,
249
],
[
246,
250
],
[
239,
251
],
[
251,
252
],
[
252,
253
],
[
239,
254
],
[
255,
255
],
[
255,
256
],
[
256,
257
],
[
257,
258
],
[
258,
259
],
[
258,
260
],
[
256,
261
],
[
261,
262
],
[
262,
263
],
[
262,
264
],
[
261,
265
],
[
255,
266
],
[
266,
267
],
[
267,
268
],
[
268,
269
],
[
268,
270
],
[
266,
271
],
[
271,
272
],
[
272,
273
],
[
273,
274
],
[
274,
275
],
[
274,
276
],
[
272,
277
],
[
238,
278
],
[
278,
279
],
[
279,
280
],
[
280,
281
],
[
280,
282
],
[
15,
283
],
[
283,
284
],
[
0,
285
],
[
285,
286
],
[
285,
287
]
] | [
"\nimport java.io.BufferedReader;\nimport java.io.IOException;\nimport java.io.InputStreamReader;\nimport java.util.StringTokenizer;\n\n/**\n *\n * @author k16069kk\n */\npublic class Main {\n\n /**\n * @param args the command line arguments\n */\n public static void main(String[] args) throws IOException {\n\n int r = 0;\n int c = 0;\n\n int l = 0;\n int matrix[][] = new int[100][100];\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n String line;\n while ((line = br.readLine()) != null) {\n java.util.StringTokenizer st = new StringTokenizer(line, \" \");\n while (st.hasMoreTokens()) {\n if (r == 0 && c == 0) {\n r = Integer.parseInt(st.nextToken());\n c = Integer.parseInt(st.nextToken());\n } else {\n for (int i = 0; i < c; i++) {\n matrix[l][i] = Integer.parseInt(st.nextToken());\n }\n l++;\n }\n }\n if (l == r) {\n break;\n\n }\n\n }\n int sum = 0;\n int ans_matrix[][] = new int[r + 1][c + 1];\n for (int i = 0; i < r; i++) {\n for (int j = 0; j < c; j++) {\n ans_matrix[i][j] = matrix[i][j];\n ans_matrix[i][c] += matrix[i][j];\n }\n sum += ans_matrix[i][c];\n }\n for (int i = 0; i < r; i++) {\n for (int j = 0; j < c; j++) {\n ans_matrix[r][j] += matrix[i][j];\n }\n }\n ans_matrix[r][c] = sum;\n\n for (int i = 0; i < ans_matrix.length; i++) {\n for (int j = 0; j < ans_matrix[i].length; j++) {\n System.out.print(ans_matrix[i][j]);\n if (!(j == c)) {\n System.out.print(\" \");\n }\n }\n System.out.println();\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\n /**\n * @param args the command line arguments\n */\n public static void main(String[] args) throws IOException {\n\n int r = 0;\n int c = 0;\n\n int l = 0;\n int matrix[][] = new int[100][100];\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n String line;\n while ((line = br.readLine()) != null) {\n java.util.StringTokenizer st = new StringTokenizer(line, \" \");\n while (st.hasMoreTokens()) {\n if (r == 0 && c == 0) {\n r = Integer.parseInt(st.nextToken());\n c = Integer.parseInt(st.nextToken());\n } else {\n for (int i = 0; i < c; i++) {\n matrix[l][i] = Integer.parseInt(st.nextToken());\n }\n l++;\n }\n }\n if (l == r) {\n break;\n\n }\n\n }\n int sum = 0;\n int ans_matrix[][] = new int[r + 1][c + 1];\n for (int i = 0; i < r; i++) {\n for (int j = 0; j < c; j++) {\n ans_matrix[i][j] = matrix[i][j];\n ans_matrix[i][c] += matrix[i][j];\n }\n sum += ans_matrix[i][c];\n }\n for (int i = 0; i < r; i++) {\n for (int j = 0; j < c; j++) {\n ans_matrix[r][j] += matrix[i][j];\n }\n }\n ans_matrix[r][c] = sum;\n\n for (int i = 0; i < ans_matrix.length; i++) {\n for (int j = 0; j < ans_matrix[i].length; j++) {\n System.out.print(ans_matrix[i][j]);\n if (!(j == c)) {\n System.out.print(\" \");\n }\n }\n System.out.println();\n }\n }\n}",
"Main",
"/**\n * @param args the command line arguments\n */\n public static void main(String[] args) throws IOException {\n\n int r = 0;\n int c = 0;\n\n int l = 0;\n int matrix[][] = new int[100][100];\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n String line;\n while ((line = br.readLine()) != null) {\n java.util.StringTokenizer st = new StringTokenizer(line, \" \");\n while (st.hasMoreTokens()) {\n if (r == 0 && c == 0) {\n r = Integer.parseInt(st.nextToken());\n c = Integer.parseInt(st.nextToken());\n } else {\n for (int i = 0; i < c; i++) {\n matrix[l][i] = Integer.parseInt(st.nextToken());\n }\n l++;\n }\n }\n if (l == r) {\n break;\n\n }\n\n }\n int sum = 0;\n int ans_matrix[][] = new int[r + 1][c + 1];\n for (int i = 0; i < r; i++) {\n for (int j = 0; j < c; j++) {\n ans_matrix[i][j] = matrix[i][j];\n ans_matrix[i][c] += matrix[i][j];\n }\n sum += ans_matrix[i][c];\n }\n for (int i = 0; i < r; i++) {\n for (int j = 0; j < c; j++) {\n ans_matrix[r][j] += matrix[i][j];\n }\n }\n ans_matrix[r][c] = sum;\n\n for (int i = 0; i < ans_matrix.length; i++) {\n for (int j = 0; j < ans_matrix[i].length; j++) {\n System.out.print(ans_matrix[i][j]);\n if (!(j == c)) {\n System.out.print(\" \");\n }\n }\n System.out.println();\n }\n }",
"main",
"{\n\n int r = 0;\n int c = 0;\n\n int l = 0;\n int matrix[][] = new int[100][100];\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n String line;\n while ((line = br.readLine()) != null) {\n java.util.StringTokenizer st = new StringTokenizer(line, \" \");\n while (st.hasMoreTokens()) {\n if (r == 0 && c == 0) {\n r = Integer.parseInt(st.nextToken());\n c = Integer.parseInt(st.nextToken());\n } else {\n for (int i = 0; i < c; i++) {\n matrix[l][i] = Integer.parseInt(st.nextToken());\n }\n l++;\n }\n }\n if (l == r) {\n break;\n\n }\n\n }\n int sum = 0;\n int ans_matrix[][] = new int[r + 1][c + 1];\n for (int i = 0; i < r; i++) {\n for (int j = 0; j < c; j++) {\n ans_matrix[i][j] = matrix[i][j];\n ans_matrix[i][c] += matrix[i][j];\n }\n sum += ans_matrix[i][c];\n }\n for (int i = 0; i < r; i++) {\n for (int j = 0; j < c; j++) {\n ans_matrix[r][j] += matrix[i][j];\n }\n }\n ans_matrix[r][c] = sum;\n\n for (int i = 0; i < ans_matrix.length; i++) {\n for (int j = 0; j < ans_matrix[i].length; j++) {\n System.out.print(ans_matrix[i][j]);\n if (!(j == c)) {\n System.out.print(\" \");\n }\n }\n System.out.println();\n }\n }",
"int r = 0;",
"r",
"0",
"int c = 0;",
"c",
"0",
"int l = 0;",
"l",
"0",
"int matrix[][] = new int[100][100];",
"matrix",
"new int[100][100]",
"100",
"100",
"BufferedReader br = new BufferedReader(new InputStreamReader(System.in));",
"br",
"new BufferedReader(new InputStreamReader(System.in))",
"String line;",
"line",
"while ((line = br.readLine()) != null) {\n java.util.StringTokenizer st = new StringTokenizer(line, \" \");\n while (st.hasMoreTokens()) {\n if (r == 0 && c == 0) {\n r = Integer.parseInt(st.nextToken());\n c = Integer.parseInt(st.nextToken());\n } else {\n for (int i = 0; i < c; i++) {\n matrix[l][i] = Integer.parseInt(st.nextToken());\n }\n l++;\n }\n }\n if (l == r) {\n break;\n\n }\n\n }",
"(line = br.readLine()) != null",
"(line = br.readLine())",
"line",
"br.readLine()",
"br.readLine",
"br",
"null",
"{\n java.util.StringTokenizer st = new StringTokenizer(line, \" \");\n while (st.hasMoreTokens()) {\n if (r == 0 && c == 0) {\n r = Integer.parseInt(st.nextToken());\n c = Integer.parseInt(st.nextToken());\n } else {\n for (int i = 0; i < c; i++) {\n matrix[l][i] = Integer.parseInt(st.nextToken());\n }\n l++;\n }\n }\n if (l == r) {\n break;\n\n }\n\n }",
"java.util.StringTokenizer st = new StringTokenizer(line, \" \");",
"st",
"new StringTokenizer(line, \" \")",
"while (st.hasMoreTokens()) {\n if (r == 0 && c == 0) {\n r = Integer.parseInt(st.nextToken());\n c = Integer.parseInt(st.nextToken());\n } else {\n for (int i = 0; i < c; i++) {\n matrix[l][i] = Integer.parseInt(st.nextToken());\n }\n l++;\n }\n }",
"st.hasMoreTokens()",
"st.hasMoreTokens",
"st",
"{\n if (r == 0 && c == 0) {\n r = Integer.parseInt(st.nextToken());\n c = Integer.parseInt(st.nextToken());\n } else {\n for (int i = 0; i < c; i++) {\n matrix[l][i] = Integer.parseInt(st.nextToken());\n }\n l++;\n }\n }",
"if (r == 0 && c == 0) {\n r = Integer.parseInt(st.nextToken());\n c = Integer.parseInt(st.nextToken());\n } else {\n for (int i = 0; i < c; i++) {\n matrix[l][i] = Integer.parseInt(st.nextToken());\n }\n l++;\n }",
"r == 0 && c == 0",
"r == 0",
"r",
"0",
"c == 0",
"c",
"0",
"{\n r = Integer.parseInt(st.nextToken());\n c = Integer.parseInt(st.nextToken());\n }",
"r = Integer.parseInt(st.nextToken())",
"r",
"Integer.parseInt(st.nextToken())",
"Integer.parseInt",
"Integer",
"st.nextToken()",
"st.nextToken",
"st",
"c = Integer.parseInt(st.nextToken())",
"c",
"Integer.parseInt(st.nextToken())",
"Integer.parseInt",
"Integer",
"st.nextToken()",
"st.nextToken",
"st",
"{\n for (int i = 0; i < c; i++) {\n matrix[l][i] = Integer.parseInt(st.nextToken());\n }\n l++;\n }",
"for (int i = 0; i < c; i++) {\n matrix[l][i] = Integer.parseInt(st.nextToken());\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < c",
"i",
"c",
"i++",
"i++",
"i",
"{\n matrix[l][i] = Integer.parseInt(st.nextToken());\n }",
"{\n matrix[l][i] = Integer.parseInt(st.nextToken());\n }",
"matrix[l][i] = Integer.parseInt(st.nextToken())",
"matrix[l][i]",
"matrix[l]",
"matrix",
"l",
"i",
"Integer.parseInt(st.nextToken())",
"Integer.parseInt",
"Integer",
"st.nextToken()",
"st.nextToken",
"st",
"l++",
"l",
"if (l == r) {\n break;\n\n }",
"l == r",
"l",
"r",
"{\n break;\n\n }",
"break;",
"int sum = 0;",
"sum",
"0",
"int ans_matrix[][] = new int[r + 1][c + 1];",
"ans_matrix",
"new int[r + 1][c + 1]",
"r + 1",
"r",
"1",
"c + 1",
"c",
"1",
"for (int i = 0; i < r; i++) {\n for (int j = 0; j < c; j++) {\n ans_matrix[i][j] = matrix[i][j];\n ans_matrix[i][c] += matrix[i][j];\n }\n sum += ans_matrix[i][c];\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < r",
"i",
"r",
"i++",
"i++",
"i",
"{\n for (int j = 0; j < c; j++) {\n ans_matrix[i][j] = matrix[i][j];\n ans_matrix[i][c] += matrix[i][j];\n }\n sum += ans_matrix[i][c];\n }",
"{\n for (int j = 0; j < c; j++) {\n ans_matrix[i][j] = matrix[i][j];\n ans_matrix[i][c] += matrix[i][j];\n }\n sum += ans_matrix[i][c];\n }",
"for (int j = 0; j < c; j++) {\n ans_matrix[i][j] = matrix[i][j];\n ans_matrix[i][c] += matrix[i][j];\n }",
"int j = 0;",
"int j = 0;",
"j",
"0",
"j < c",
"j",
"c",
"j++",
"j++",
"j",
"{\n ans_matrix[i][j] = matrix[i][j];\n ans_matrix[i][c] += matrix[i][j];\n }",
"{\n ans_matrix[i][j] = matrix[i][j];\n ans_matrix[i][c] += matrix[i][j];\n }",
"ans_matrix[i][j] = matrix[i][j]",
"ans_matrix[i][j]",
"ans_matrix[i]",
"ans_matrix",
"i",
"j",
"matrix[i][j]",
"matrix[i]",
"matrix",
"i",
"j",
"ans_matrix[i][c] += matrix[i][j]",
"ans_matrix[i][c]",
"ans_matrix[i]",
"ans_matrix",
"i",
"c",
"matrix[i][j]",
"matrix[i]",
"matrix",
"i",
"j",
"sum += ans_matrix[i][c]",
"sum",
"ans_matrix[i][c]",
"ans_matrix[i]",
"ans_matrix",
"i",
"c",
"for (int i = 0; i < r; i++) {\n for (int j = 0; j < c; j++) {\n ans_matrix[r][j] += matrix[i][j];\n }\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < r",
"i",
"r",
"i++",
"i++",
"i",
"{\n for (int j = 0; j < c; j++) {\n ans_matrix[r][j] += matrix[i][j];\n }\n }",
"{\n for (int j = 0; j < c; j++) {\n ans_matrix[r][j] += matrix[i][j];\n }\n }",
"for (int j = 0; j < c; j++) {\n ans_matrix[r][j] += matrix[i][j];\n }",
"int j = 0;",
"int j = 0;",
"j",
"0",
"j < c",
"j",
"c",
"j++",
"j++",
"j",
"{\n ans_matrix[r][j] += matrix[i][j];\n }",
"{\n ans_matrix[r][j] += matrix[i][j];\n }",
"ans_matrix[r][j] += matrix[i][j]",
"ans_matrix[r][j]",
"ans_matrix[r]",
"ans_matrix",
"r",
"j",
"matrix[i][j]",
"matrix[i]",
"matrix",
"i",
"j",
"ans_matrix[r][c] = sum",
"ans_matrix[r][c]",
"ans_matrix[r]",
"ans_matrix",
"r",
"c",
"sum",
"for (int i = 0; i < ans_matrix.length; i++) {\n for (int j = 0; j < ans_matrix[i].length; j++) {\n System.out.print(ans_matrix[i][j]);\n if (!(j == c)) {\n System.out.print(\" \");\n }\n }\n System.out.println();\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < ans_matrix.length",
"i",
"ans_matrix.length",
"ans_matrix",
"ans_matrix.length",
"i++",
"i++",
"i",
"{\n for (int j = 0; j < ans_matrix[i].length; j++) {\n System.out.print(ans_matrix[i][j]);\n if (!(j == c)) {\n System.out.print(\" \");\n }\n }\n System.out.println();\n }",
"{\n for (int j = 0; j < ans_matrix[i].length; j++) {\n System.out.print(ans_matrix[i][j]);\n if (!(j == c)) {\n System.out.print(\" \");\n }\n }\n System.out.println();\n }",
"for (int j = 0; j < ans_matrix[i].length; j++) {\n System.out.print(ans_matrix[i][j]);\n if (!(j == c)) {\n System.out.print(\" \");\n }\n }",
"int j = 0;",
"int j = 0;",
"j",
"0",
"j < ans_matrix[i].length",
"j",
"ans_matrix[i].length",
"ans_matrix[i]",
"ans_matrix",
"i",
"ans_matrix[i].length",
"j++",
"j++",
"j",
"{\n System.out.print(ans_matrix[i][j]);\n if (!(j == c)) {\n System.out.print(\" \");\n }\n }",
"{\n System.out.print(ans_matrix[i][j]);\n if (!(j == c)) {\n System.out.print(\" \");\n }\n }",
"System.out.print(ans_matrix[i][j])",
"System.out.print",
"System.out",
"System",
"System.out",
"ans_matrix[i][j]",
"ans_matrix[i]",
"ans_matrix",
"i",
"j",
"if (!(j == c)) {\n System.out.print(\" \");\n }",
"!(j == c)",
"(j == c)",
"j",
"c",
"{\n System.out.print(\" \");\n }",
"System.out.print(\" \")",
"System.out.print",
"System.out",
"System",
"System.out",
"\" \"",
"System.out.println()",
"System.out.println",
"System.out",
"System",
"System.out",
"String[] args",
"args",
"public class Main {\n\n /**\n * @param args the command line arguments\n */\n public static void main(String[] args) throws IOException {\n\n int r = 0;\n int c = 0;\n\n int l = 0;\n int matrix[][] = new int[100][100];\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n String line;\n while ((line = br.readLine()) != null) {\n java.util.StringTokenizer st = new StringTokenizer(line, \" \");\n while (st.hasMoreTokens()) {\n if (r == 0 && c == 0) {\n r = Integer.parseInt(st.nextToken());\n c = Integer.parseInt(st.nextToken());\n } else {\n for (int i = 0; i < c; i++) {\n matrix[l][i] = Integer.parseInt(st.nextToken());\n }\n l++;\n }\n }\n if (l == r) {\n break;\n\n }\n\n }\n int sum = 0;\n int ans_matrix[][] = new int[r + 1][c + 1];\n for (int i = 0; i < r; i++) {\n for (int j = 0; j < c; j++) {\n ans_matrix[i][j] = matrix[i][j];\n ans_matrix[i][c] += matrix[i][j];\n }\n sum += ans_matrix[i][c];\n }\n for (int i = 0; i < r; i++) {\n for (int j = 0; j < c; j++) {\n ans_matrix[r][j] += matrix[i][j];\n }\n }\n ans_matrix[r][c] = sum;\n\n for (int i = 0; i < ans_matrix.length; i++) {\n for (int j = 0; j < ans_matrix[i].length; j++) {\n System.out.print(ans_matrix[i][j]);\n if (!(j == c)) {\n System.out.print(\" \");\n }\n }\n System.out.println();\n }\n }\n}",
"public class Main {\n\n /**\n * @param args the command line arguments\n */\n public static void main(String[] args) throws IOException {\n\n int r = 0;\n int c = 0;\n\n int l = 0;\n int matrix[][] = new int[100][100];\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n String line;\n while ((line = br.readLine()) != null) {\n java.util.StringTokenizer st = new StringTokenizer(line, \" \");\n while (st.hasMoreTokens()) {\n if (r == 0 && c == 0) {\n r = Integer.parseInt(st.nextToken());\n c = Integer.parseInt(st.nextToken());\n } else {\n for (int i = 0; i < c; i++) {\n matrix[l][i] = Integer.parseInt(st.nextToken());\n }\n l++;\n }\n }\n if (l == r) {\n break;\n\n }\n\n }\n int sum = 0;\n int ans_matrix[][] = new int[r + 1][c + 1];\n for (int i = 0; i < r; i++) {\n for (int j = 0; j < c; j++) {\n ans_matrix[i][j] = matrix[i][j];\n ans_matrix[i][c] += matrix[i][j];\n }\n sum += ans_matrix[i][c];\n }\n for (int i = 0; i < r; i++) {\n for (int j = 0; j < c; j++) {\n ans_matrix[r][j] += matrix[i][j];\n }\n }\n ans_matrix[r][c] = sum;\n\n for (int i = 0; i < ans_matrix.length; i++) {\n for (int j = 0; j < ans_matrix[i].length; j++) {\n System.out.print(ans_matrix[i][j]);\n if (!(j == c)) {\n System.out.print(\" \");\n }\n }\n System.out.println();\n }\n }\n}",
"Main"
] |
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.StringTokenizer;
/**
*
* @author k16069kk
*/
public class Main {
/**
* @param args the command line arguments
*/
public static void main(String[] args) throws IOException {
int r = 0;
int c = 0;
int l = 0;
int matrix[][] = new int[100][100];
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
String line;
while ((line = br.readLine()) != null) {
java.util.StringTokenizer st = new StringTokenizer(line, " ");
while (st.hasMoreTokens()) {
if (r == 0 && c == 0) {
r = Integer.parseInt(st.nextToken());
c = Integer.parseInt(st.nextToken());
} else {
for (int i = 0; i < c; i++) {
matrix[l][i] = Integer.parseInt(st.nextToken());
}
l++;
}
}
if (l == r) {
break;
}
}
int sum = 0;
int ans_matrix[][] = new int[r + 1][c + 1];
for (int i = 0; i < r; i++) {
for (int j = 0; j < c; j++) {
ans_matrix[i][j] = matrix[i][j];
ans_matrix[i][c] += matrix[i][j];
}
sum += ans_matrix[i][c];
}
for (int i = 0; i < r; i++) {
for (int j = 0; j < c; j++) {
ans_matrix[r][j] += matrix[i][j];
}
}
ans_matrix[r][c] = sum;
for (int i = 0; i < ans_matrix.length; i++) {
for (int j = 0; j < ans_matrix[i].length; j++) {
System.out.print(ans_matrix[i][j]);
if (!(j == c)) {
System.out.print(" ");
}
}
System.out.println();
}
}
}
|
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
4,
18,
13,
41,
13,
4,
18,
13,
4,
18,
13,
41,
13,
20,
2,
13,
17,
2,
13,
17,
11,
1,
41,
13,
17,
2,
13,
2,
13,
17,
1,
40,
13,
30,
30,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
14,
2,
13,
13,
30,
0,
18,
18,
13,
13,
13,
4,
18,
13,
4,
18,
13,
0,
13,
18,
18,
13,
13,
13,
30,
0,
18,
18,
13,
13,
13,
13,
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,
14,
2,
13,
13,
30,
0,
13,
18,
18,
13,
13,
13,
30,
0,
18,
18,
13,
13,
13,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
41,
13,
4,
18,
13,
18,
18,
13,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
2,
17,
4,
18,
13,
18,
18,
13,
13,
13,
4,
18,
18,
13,
13,
13,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
206,
5
],
[
206,
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
],
[
22,
23
],
[
23,
24
],
[
22,
25
],
[
25,
26
],
[
26,
27
],
[
8,
28
],
[
28,
29
],
[
28,
30
],
[
31,
32
],
[
31,
33
],
[
34,
35
],
[
34,
36
],
[
8,
37
],
[
37,
38
],
[
38,
39
],
[
39,
40
],
[
39,
41
],
[
37,
42
],
[
42,
43
],
[
42,
44
],
[
44,
45
],
[
44,
46
],
[
37,
47
],
[
47,
48
],
[
48,
49
],
[
37,
50
],
[
51,
51
],
[
51,
52
],
[
52,
53
],
[
52,
54
],
[
51,
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
],
[
69,
70
],
[
69,
71
],
[
68,
72
],
[
72,
73
],
[
73,
74
],
[
74,
75
],
[
75,
76
],
[
75,
77
],
[
74,
78
],
[
73,
79
],
[
79,
80
],
[
80,
81
],
[
79,
82
],
[
82,
83
],
[
83,
84
],
[
72,
85
],
[
85,
86
],
[
85,
87
],
[
87,
88
],
[
88,
89
],
[
88,
90
],
[
87,
91
],
[
68,
92
],
[
92,
93
],
[
93,
94
],
[
94,
95
],
[
95,
96
],
[
95,
97
],
[
94,
98
],
[
93,
99
],
[
8,
100
],
[
100,
101
],
[
101,
102
],
[
102,
103
],
[
102,
104
],
[
100,
105
],
[
105,
106
],
[
105,
107
],
[
100,
108
],
[
108,
109
],
[
109,
110
],
[
100,
111
],
[
112,
112
],
[
112,
113
],
[
113,
114
],
[
113,
115
],
[
112,
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
],
[
130,
131
],
[
130,
132
],
[
129,
133
],
[
133,
134
],
[
134,
135
],
[
134,
136
],
[
136,
137
],
[
137,
138
],
[
137,
139
],
[
136,
140
],
[
129,
141
],
[
141,
142
],
[
142,
143
],
[
143,
144
],
[
144,
145
],
[
144,
146
],
[
143,
147
],
[
142,
148
],
[
8,
149
],
[
149,
150
],
[
150,
151
],
[
151,
152
],
[
151,
153
],
[
149,
154
],
[
154,
155
],
[
154,
156
],
[
149,
157
],
[
157,
158
],
[
158,
159
],
[
149,
160
],
[
161,
161
],
[
161,
162
],
[
162,
163
],
[
162,
164
],
[
164,
165
],
[
165,
166
],
[
164,
167
],
[
167,
168
],
[
168,
169
],
[
168,
170
],
[
167,
171
],
[
161,
172
],
[
172,
173
],
[
173,
174
],
[
174,
175
],
[
174,
176
],
[
172,
177
],
[
177,
178
],
[
177,
179
],
[
172,
180
],
[
180,
181
],
[
181,
182
],
[
172,
183
],
[
184,
184
],
[
184,
185
],
[
185,
186
],
[
185,
187
],
[
187,
188
],
[
187,
189
],
[
189,
190
],
[
190,
191
],
[
189,
192
],
[
192,
193
],
[
193,
194
],
[
193,
195
],
[
192,
196
],
[
161,
197
],
[
197,
198
],
[
198,
199
],
[
199,
200
],
[
199,
201
],
[
197,
202
],
[
6,
203
],
[
203,
204
],
[
0,
205
],
[
205,
206
],
[
205,
207
]
] | [
"import java.util.Scanner;\n\npublic class Main {\n\tpublic static void main(String[] args){\n\t\tScanner std = new Scanner(System.in);\n\t\tint r = Integer.parseInt(std.next());\n\t\tint c = Integer.parseInt(std.next());\n\t\tint table[][] = new int[r+1][c+1];\n\t\tfor(int i=0; i<=r-1; i++){\n\t\t\tint rsum = 0;\n\t\t\tfor(int j=0; j<=c; j++){\n\t\t\t\tif(j<c){\n\t\t\t\t\ttable[i][j] = Integer.parseInt(std.next());\n\t\t\t\t\trsum += table[i][j];\n\t\t\t\t}else{\n\t\t\t\t\ttable[i][j] = rsum;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tfor(int j=0; j<=c; j++){\n\t\t\tint csum = 0;\n\t\t\tfor(int i=0; i<=r; i++){\n\t\t\t\tif(i<r){\n\t\t\t\t\tcsum += table[i][j];\n\t\t\t\t}else{\n\t\t\t\t\ttable[i][j] = csum;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tfor(int i=0; i<=r; i++){\n\t\t\tString line = String.valueOf(table[i][0]);\n\t\t\tfor(int j=1; j<=c; j++){\n\t\t\t\tline += ( \" \"+ String.valueOf(table[i][j]));\n\t\t\t}\n\t\t\tSystem.out.println(line);\n\t\t}\n\t}\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n\tpublic static void main(String[] args){\n\t\tScanner std = new Scanner(System.in);\n\t\tint r = Integer.parseInt(std.next());\n\t\tint c = Integer.parseInt(std.next());\n\t\tint table[][] = new int[r+1][c+1];\n\t\tfor(int i=0; i<=r-1; i++){\n\t\t\tint rsum = 0;\n\t\t\tfor(int j=0; j<=c; j++){\n\t\t\t\tif(j<c){\n\t\t\t\t\ttable[i][j] = Integer.parseInt(std.next());\n\t\t\t\t\trsum += table[i][j];\n\t\t\t\t}else{\n\t\t\t\t\ttable[i][j] = rsum;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tfor(int j=0; j<=c; j++){\n\t\t\tint csum = 0;\n\t\t\tfor(int i=0; i<=r; i++){\n\t\t\t\tif(i<r){\n\t\t\t\t\tcsum += table[i][j];\n\t\t\t\t}else{\n\t\t\t\t\ttable[i][j] = csum;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tfor(int i=0; i<=r; i++){\n\t\t\tString line = String.valueOf(table[i][0]);\n\t\t\tfor(int j=1; j<=c; j++){\n\t\t\t\tline += ( \" \"+ String.valueOf(table[i][j]));\n\t\t\t}\n\t\t\tSystem.out.println(line);\n\t\t}\n\t}\n}",
"Main",
"public static void main(String[] args){\n\t\tScanner std = new Scanner(System.in);\n\t\tint r = Integer.parseInt(std.next());\n\t\tint c = Integer.parseInt(std.next());\n\t\tint table[][] = new int[r+1][c+1];\n\t\tfor(int i=0; i<=r-1; i++){\n\t\t\tint rsum = 0;\n\t\t\tfor(int j=0; j<=c; j++){\n\t\t\t\tif(j<c){\n\t\t\t\t\ttable[i][j] = Integer.parseInt(std.next());\n\t\t\t\t\trsum += table[i][j];\n\t\t\t\t}else{\n\t\t\t\t\ttable[i][j] = rsum;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tfor(int j=0; j<=c; j++){\n\t\t\tint csum = 0;\n\t\t\tfor(int i=0; i<=r; i++){\n\t\t\t\tif(i<r){\n\t\t\t\t\tcsum += table[i][j];\n\t\t\t\t}else{\n\t\t\t\t\ttable[i][j] = csum;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tfor(int i=0; i<=r; i++){\n\t\t\tString line = String.valueOf(table[i][0]);\n\t\t\tfor(int j=1; j<=c; j++){\n\t\t\t\tline += ( \" \"+ String.valueOf(table[i][j]));\n\t\t\t}\n\t\t\tSystem.out.println(line);\n\t\t}\n\t}",
"main",
"{\n\t\tScanner std = new Scanner(System.in);\n\t\tint r = Integer.parseInt(std.next());\n\t\tint c = Integer.parseInt(std.next());\n\t\tint table[][] = new int[r+1][c+1];\n\t\tfor(int i=0; i<=r-1; i++){\n\t\t\tint rsum = 0;\n\t\t\tfor(int j=0; j<=c; j++){\n\t\t\t\tif(j<c){\n\t\t\t\t\ttable[i][j] = Integer.parseInt(std.next());\n\t\t\t\t\trsum += table[i][j];\n\t\t\t\t}else{\n\t\t\t\t\ttable[i][j] = rsum;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tfor(int j=0; j<=c; j++){\n\t\t\tint csum = 0;\n\t\t\tfor(int i=0; i<=r; i++){\n\t\t\t\tif(i<r){\n\t\t\t\t\tcsum += table[i][j];\n\t\t\t\t}else{\n\t\t\t\t\ttable[i][j] = csum;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tfor(int i=0; i<=r; i++){\n\t\t\tString line = String.valueOf(table[i][0]);\n\t\t\tfor(int j=1; j<=c; j++){\n\t\t\t\tline += ( \" \"+ String.valueOf(table[i][j]));\n\t\t\t}\n\t\t\tSystem.out.println(line);\n\t\t}\n\t}",
"Scanner std = new Scanner(System.in);",
"std",
"new Scanner(System.in)",
"int r = Integer.parseInt(std.next());",
"r",
"Integer.parseInt(std.next())",
"Integer.parseInt",
"Integer",
"std.next()",
"std.next",
"std",
"int c = Integer.parseInt(std.next());",
"c",
"Integer.parseInt(std.next())",
"Integer.parseInt",
"Integer",
"std.next()",
"std.next",
"std",
"int table[][] = new int[r+1][c+1];",
"table",
"new int[r+1][c+1]",
"r+1",
"r",
"1",
"c+1",
"c",
"1",
"for(int i=0; i<=r-1; i++){\n\t\t\tint rsum = 0;\n\t\t\tfor(int j=0; j<=c; j++){\n\t\t\t\tif(j<c){\n\t\t\t\t\ttable[i][j] = Integer.parseInt(std.next());\n\t\t\t\t\trsum += table[i][j];\n\t\t\t\t}else{\n\t\t\t\t\ttable[i][j] = rsum;\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"int i=0;",
"int i=0;",
"i",
"0",
"i<=r-1",
"i",
"r-1",
"r",
"1",
"i++",
"i++",
"i",
"{\n\t\t\tint rsum = 0;\n\t\t\tfor(int j=0; j<=c; j++){\n\t\t\t\tif(j<c){\n\t\t\t\t\ttable[i][j] = Integer.parseInt(std.next());\n\t\t\t\t\trsum += table[i][j];\n\t\t\t\t}else{\n\t\t\t\t\ttable[i][j] = rsum;\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"{\n\t\t\tint rsum = 0;\n\t\t\tfor(int j=0; j<=c; j++){\n\t\t\t\tif(j<c){\n\t\t\t\t\ttable[i][j] = Integer.parseInt(std.next());\n\t\t\t\t\trsum += table[i][j];\n\t\t\t\t}else{\n\t\t\t\t\ttable[i][j] = rsum;\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"int rsum = 0;",
"rsum",
"0",
"for(int j=0; j<=c; j++){\n\t\t\t\tif(j<c){\n\t\t\t\t\ttable[i][j] = Integer.parseInt(std.next());\n\t\t\t\t\trsum += table[i][j];\n\t\t\t\t}else{\n\t\t\t\t\ttable[i][j] = rsum;\n\t\t\t\t}\n\t\t\t}",
"int j=0;",
"int j=0;",
"j",
"0",
"j<=c",
"j",
"c",
"j++",
"j++",
"j",
"{\n\t\t\t\tif(j<c){\n\t\t\t\t\ttable[i][j] = Integer.parseInt(std.next());\n\t\t\t\t\trsum += table[i][j];\n\t\t\t\t}else{\n\t\t\t\t\ttable[i][j] = rsum;\n\t\t\t\t}\n\t\t\t}",
"{\n\t\t\t\tif(j<c){\n\t\t\t\t\ttable[i][j] = Integer.parseInt(std.next());\n\t\t\t\t\trsum += table[i][j];\n\t\t\t\t}else{\n\t\t\t\t\ttable[i][j] = rsum;\n\t\t\t\t}\n\t\t\t}",
"if(j<c){\n\t\t\t\t\ttable[i][j] = Integer.parseInt(std.next());\n\t\t\t\t\trsum += table[i][j];\n\t\t\t\t}else{\n\t\t\t\t\ttable[i][j] = rsum;\n\t\t\t\t}",
"j<c",
"j",
"c",
"{\n\t\t\t\t\ttable[i][j] = Integer.parseInt(std.next());\n\t\t\t\t\trsum += table[i][j];\n\t\t\t\t}",
"table[i][j] = Integer.parseInt(std.next())",
"table[i][j]",
"table[i]",
"table",
"i",
"j",
"Integer.parseInt(std.next())",
"Integer.parseInt",
"Integer",
"std.next()",
"std.next",
"std",
"rsum += table[i][j]",
"rsum",
"table[i][j]",
"table[i]",
"table",
"i",
"j",
"{\n\t\t\t\t\ttable[i][j] = rsum;\n\t\t\t\t}",
"table[i][j] = rsum",
"table[i][j]",
"table[i]",
"table",
"i",
"j",
"rsum",
"for(int j=0; j<=c; j++){\n\t\t\tint csum = 0;\n\t\t\tfor(int i=0; i<=r; i++){\n\t\t\t\tif(i<r){\n\t\t\t\t\tcsum += table[i][j];\n\t\t\t\t}else{\n\t\t\t\t\ttable[i][j] = csum;\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"int j=0;",
"int j=0;",
"j",
"0",
"j<=c",
"j",
"c",
"j++",
"j++",
"j",
"{\n\t\t\tint csum = 0;\n\t\t\tfor(int i=0; i<=r; i++){\n\t\t\t\tif(i<r){\n\t\t\t\t\tcsum += table[i][j];\n\t\t\t\t}else{\n\t\t\t\t\ttable[i][j] = csum;\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"{\n\t\t\tint csum = 0;\n\t\t\tfor(int i=0; i<=r; i++){\n\t\t\t\tif(i<r){\n\t\t\t\t\tcsum += table[i][j];\n\t\t\t\t}else{\n\t\t\t\t\ttable[i][j] = csum;\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"int csum = 0;",
"csum",
"0",
"for(int i=0; i<=r; i++){\n\t\t\t\tif(i<r){\n\t\t\t\t\tcsum += table[i][j];\n\t\t\t\t}else{\n\t\t\t\t\ttable[i][j] = csum;\n\t\t\t\t}\n\t\t\t}",
"int i=0;",
"int i=0;",
"i",
"0",
"i<=r",
"i",
"r",
"i++",
"i++",
"i",
"{\n\t\t\t\tif(i<r){\n\t\t\t\t\tcsum += table[i][j];\n\t\t\t\t}else{\n\t\t\t\t\ttable[i][j] = csum;\n\t\t\t\t}\n\t\t\t}",
"{\n\t\t\t\tif(i<r){\n\t\t\t\t\tcsum += table[i][j];\n\t\t\t\t}else{\n\t\t\t\t\ttable[i][j] = csum;\n\t\t\t\t}\n\t\t\t}",
"if(i<r){\n\t\t\t\t\tcsum += table[i][j];\n\t\t\t\t}else{\n\t\t\t\t\ttable[i][j] = csum;\n\t\t\t\t}",
"i<r",
"i",
"r",
"{\n\t\t\t\t\tcsum += table[i][j];\n\t\t\t\t}",
"csum += table[i][j]",
"csum",
"table[i][j]",
"table[i]",
"table",
"i",
"j",
"{\n\t\t\t\t\ttable[i][j] = csum;\n\t\t\t\t}",
"table[i][j] = csum",
"table[i][j]",
"table[i]",
"table",
"i",
"j",
"csum",
"for(int i=0; i<=r; i++){\n\t\t\tString line = String.valueOf(table[i][0]);\n\t\t\tfor(int j=1; j<=c; j++){\n\t\t\t\tline += ( \" \"+ String.valueOf(table[i][j]));\n\t\t\t}\n\t\t\tSystem.out.println(line);\n\t\t}",
"int i=0;",
"int i=0;",
"i",
"0",
"i<=r",
"i",
"r",
"i++",
"i++",
"i",
"{\n\t\t\tString line = String.valueOf(table[i][0]);\n\t\t\tfor(int j=1; j<=c; j++){\n\t\t\t\tline += ( \" \"+ String.valueOf(table[i][j]));\n\t\t\t}\n\t\t\tSystem.out.println(line);\n\t\t}",
"{\n\t\t\tString line = String.valueOf(table[i][0]);\n\t\t\tfor(int j=1; j<=c; j++){\n\t\t\t\tline += ( \" \"+ String.valueOf(table[i][j]));\n\t\t\t}\n\t\t\tSystem.out.println(line);\n\t\t}",
"String line = String.valueOf(table[i][0]);",
"line",
"String.valueOf(table[i][0])",
"String.valueOf",
"String",
"table[i][0]",
"table[i]",
"table",
"i",
"0",
"for(int j=1; j<=c; j++){\n\t\t\t\tline += ( \" \"+ String.valueOf(table[i][j]));\n\t\t\t}",
"int j=1;",
"int j=1;",
"j",
"1",
"j<=c",
"j",
"c",
"j++",
"j++",
"j",
"{\n\t\t\t\tline += ( \" \"+ String.valueOf(table[i][j]));\n\t\t\t}",
"{\n\t\t\t\tline += ( \" \"+ String.valueOf(table[i][j]));\n\t\t\t}",
"line += ( \" \"+ String.valueOf(table[i][j]))",
"line",
"( \" \"+ String.valueOf(table[i][j]))",
"\" \"",
"String.valueOf(table[i][j])",
"String.valueOf",
"String",
"table[i][j]",
"table[i]",
"table",
"i",
"j",
"System.out.println(line)",
"System.out.println",
"System.out",
"System",
"System.out",
"line",
"String[] args",
"args",
"public class Main {\n\tpublic static void main(String[] args){\n\t\tScanner std = new Scanner(System.in);\n\t\tint r = Integer.parseInt(std.next());\n\t\tint c = Integer.parseInt(std.next());\n\t\tint table[][] = new int[r+1][c+1];\n\t\tfor(int i=0; i<=r-1; i++){\n\t\t\tint rsum = 0;\n\t\t\tfor(int j=0; j<=c; j++){\n\t\t\t\tif(j<c){\n\t\t\t\t\ttable[i][j] = Integer.parseInt(std.next());\n\t\t\t\t\trsum += table[i][j];\n\t\t\t\t}else{\n\t\t\t\t\ttable[i][j] = rsum;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tfor(int j=0; j<=c; j++){\n\t\t\tint csum = 0;\n\t\t\tfor(int i=0; i<=r; i++){\n\t\t\t\tif(i<r){\n\t\t\t\t\tcsum += table[i][j];\n\t\t\t\t}else{\n\t\t\t\t\ttable[i][j] = csum;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tfor(int i=0; i<=r; i++){\n\t\t\tString line = String.valueOf(table[i][0]);\n\t\t\tfor(int j=1; j<=c; j++){\n\t\t\t\tline += ( \" \"+ String.valueOf(table[i][j]));\n\t\t\t}\n\t\t\tSystem.out.println(line);\n\t\t}\n\t}\n}",
"public class Main {\n\tpublic static void main(String[] args){\n\t\tScanner std = new Scanner(System.in);\n\t\tint r = Integer.parseInt(std.next());\n\t\tint c = Integer.parseInt(std.next());\n\t\tint table[][] = new int[r+1][c+1];\n\t\tfor(int i=0; i<=r-1; i++){\n\t\t\tint rsum = 0;\n\t\t\tfor(int j=0; j<=c; j++){\n\t\t\t\tif(j<c){\n\t\t\t\t\ttable[i][j] = Integer.parseInt(std.next());\n\t\t\t\t\trsum += table[i][j];\n\t\t\t\t}else{\n\t\t\t\t\ttable[i][j] = rsum;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tfor(int j=0; j<=c; j++){\n\t\t\tint csum = 0;\n\t\t\tfor(int i=0; i<=r; i++){\n\t\t\t\tif(i<r){\n\t\t\t\t\tcsum += table[i][j];\n\t\t\t\t}else{\n\t\t\t\t\ttable[i][j] = csum;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tfor(int i=0; i<=r; i++){\n\t\t\tString line = String.valueOf(table[i][0]);\n\t\t\tfor(int j=1; j<=c; j++){\n\t\t\t\tline += ( \" \"+ String.valueOf(table[i][j]));\n\t\t\t}\n\t\t\tSystem.out.println(line);\n\t\t}\n\t}\n}",
"Main"
] | import java.util.Scanner;
public class Main {
public static void main(String[] args){
Scanner std = new Scanner(System.in);
int r = Integer.parseInt(std.next());
int c = Integer.parseInt(std.next());
int table[][] = new int[r+1][c+1];
for(int i=0; i<=r-1; i++){
int rsum = 0;
for(int j=0; j<=c; j++){
if(j<c){
table[i][j] = Integer.parseInt(std.next());
rsum += table[i][j];
}else{
table[i][j] = rsum;
}
}
}
for(int j=0; j<=c; j++){
int csum = 0;
for(int i=0; i<=r; i++){
if(i<r){
csum += table[i][j];
}else{
table[i][j] = csum;
}
}
}
for(int i=0; i<=r; i++){
String line = String.valueOf(table[i][0]);
for(int j=1; j<=c; j++){
line += ( " "+ String.valueOf(table[i][j]));
}
System.out.println(line);
}
}
} |
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
41,
13,
20,
2,
13,
17,
2,
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,
18,
18,
13,
13,
13,
4,
18,
13,
0,
18,
18,
13,
13,
13,
18,
18,
13,
13,
13,
0,
18,
18,
13,
13,
13,
18,
18,
13,
13,
13,
0,
18,
18,
13,
13,
13,
18,
18,
13,
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,
4,
18,
18,
13,
13,
18,
18,
13,
13,
13,
14,
2,
13,
13,
4,
18,
18,
13,
13,
17,
4,
18,
18,
13,
13,
17,
23,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
8,
17
],
[
17,
18
],
[
17,
19
],
[
19,
20
],
[
20,
21
],
[
8,
22
],
[
22,
23
],
[
22,
24
],
[
25,
26
],
[
25,
27
],
[
28,
29
],
[
28,
30
],
[
8,
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
],
[
58,
62
],
[
57,
63
],
[
63,
64
],
[
64,
65
],
[
56,
66
],
[
66,
67
],
[
67,
68
],
[
68,
69
],
[
68,
70
],
[
67,
71
],
[
66,
72
],
[
72,
73
],
[
73,
74
],
[
73,
75
],
[
72,
76
],
[
56,
77
],
[
77,
78
],
[
78,
79
],
[
79,
80
],
[
79,
81
],
[
78,
82
],
[
77,
83
],
[
83,
84
],
[
84,
85
],
[
84,
86
],
[
83,
87
],
[
56,
88
],
[
88,
89
],
[
89,
90
],
[
90,
91
],
[
90,
92
],
[
89,
93
],
[
88,
94
],
[
94,
95
],
[
95,
96
],
[
95,
97
],
[
94,
98
],
[
8,
99
],
[
99,
100
],
[
100,
101
],
[
101,
102
],
[
101,
103
],
[
99,
104
],
[
104,
105
],
[
104,
106
],
[
99,
107
],
[
107,
108
],
[
108,
109
],
[
99,
110
],
[
111,
111
],
[
111,
112
],
[
112,
113
],
[
113,
114
],
[
114,
115
],
[
114,
116
],
[
112,
117
],
[
117,
118
],
[
117,
119
],
[
112,
120
],
[
120,
121
],
[
121,
122
],
[
112,
123
],
[
124,
124
],
[
124,
125
],
[
125,
126
],
[
126,
127
],
[
127,
128
],
[
127,
129
],
[
125,
130
],
[
130,
131
],
[
131,
132
],
[
131,
133
],
[
130,
134
],
[
124,
135
],
[
135,
136
],
[
136,
137
],
[
136,
138
],
[
135,
139
],
[
139,
140
],
[
140,
141
],
[
141,
142
],
[
141,
143
],
[
139,
144
],
[
111,
145
],
[
145,
146
],
[
146,
147
],
[
147,
148
],
[
147,
149
],
[
145,
150
],
[
6,
151
],
[
151,
152
]
] | [
"import java.util.Scanner;\n\nclass Main{\n public static void main(String[] args){\n\tfinal Scanner sc = new Scanner(System.in);\n\tint r=sc.nextInt();\n\tint c=sc.nextInt();\n\tint[][] Ar=new int[r+1][c+1];\n\tfor(int i=0;i<r;i++){\n\t for(int j=0;j<c;j++){\n\t\tAr[i][j]=sc.nextInt();\n\t\tAr[i][c]+=Ar[i][j];\n\t\tAr[r][j]+=Ar[i][j];\n\t\tAr[r][c]+=Ar[i][j];\n\t }\n\t}\n\tfor(int i=0;i<=r;i++){\n\t for(int j=0;j<=c;j++){\n\t\tSystem.out.print(Ar[i][j]);\n\t\tif(j!=c) System.out.print(\" \");\n\t }\n\t System.out.println(\"\");\n\t}\n }\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"class Main{\n public static void main(String[] args){\n\tfinal Scanner sc = new Scanner(System.in);\n\tint r=sc.nextInt();\n\tint c=sc.nextInt();\n\tint[][] Ar=new int[r+1][c+1];\n\tfor(int i=0;i<r;i++){\n\t for(int j=0;j<c;j++){\n\t\tAr[i][j]=sc.nextInt();\n\t\tAr[i][c]+=Ar[i][j];\n\t\tAr[r][j]+=Ar[i][j];\n\t\tAr[r][c]+=Ar[i][j];\n\t }\n\t}\n\tfor(int i=0;i<=r;i++){\n\t for(int j=0;j<=c;j++){\n\t\tSystem.out.print(Ar[i][j]);\n\t\tif(j!=c) System.out.print(\" \");\n\t }\n\t System.out.println(\"\");\n\t}\n }\n}",
"Main",
"public static void main(String[] args){\n\tfinal Scanner sc = new Scanner(System.in);\n\tint r=sc.nextInt();\n\tint c=sc.nextInt();\n\tint[][] Ar=new int[r+1][c+1];\n\tfor(int i=0;i<r;i++){\n\t for(int j=0;j<c;j++){\n\t\tAr[i][j]=sc.nextInt();\n\t\tAr[i][c]+=Ar[i][j];\n\t\tAr[r][j]+=Ar[i][j];\n\t\tAr[r][c]+=Ar[i][j];\n\t }\n\t}\n\tfor(int i=0;i<=r;i++){\n\t for(int j=0;j<=c;j++){\n\t\tSystem.out.print(Ar[i][j]);\n\t\tif(j!=c) System.out.print(\" \");\n\t }\n\t System.out.println(\"\");\n\t}\n }",
"main",
"{\n\tfinal Scanner sc = new Scanner(System.in);\n\tint r=sc.nextInt();\n\tint c=sc.nextInt();\n\tint[][] Ar=new int[r+1][c+1];\n\tfor(int i=0;i<r;i++){\n\t for(int j=0;j<c;j++){\n\t\tAr[i][j]=sc.nextInt();\n\t\tAr[i][c]+=Ar[i][j];\n\t\tAr[r][j]+=Ar[i][j];\n\t\tAr[r][c]+=Ar[i][j];\n\t }\n\t}\n\tfor(int i=0;i<=r;i++){\n\t for(int j=0;j<=c;j++){\n\t\tSystem.out.print(Ar[i][j]);\n\t\tif(j!=c) System.out.print(\" \");\n\t }\n\t System.out.println(\"\");\n\t}\n }",
"final Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"int r=sc.nextInt();",
"r",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int c=sc.nextInt();",
"c",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int[][] Ar=new int[r+1][c+1];",
"Ar",
"new int[r+1][c+1]",
"r+1",
"r",
"1",
"c+1",
"c",
"1",
"for(int i=0;i<r;i++){\n\t for(int j=0;j<c;j++){\n\t\tAr[i][j]=sc.nextInt();\n\t\tAr[i][c]+=Ar[i][j];\n\t\tAr[r][j]+=Ar[i][j];\n\t\tAr[r][c]+=Ar[i][j];\n\t }\n\t}",
"int i=0;",
"int i=0;",
"i",
"0",
"i<r",
"i",
"r",
"i++",
"i++",
"i",
"{\n\t for(int j=0;j<c;j++){\n\t\tAr[i][j]=sc.nextInt();\n\t\tAr[i][c]+=Ar[i][j];\n\t\tAr[r][j]+=Ar[i][j];\n\t\tAr[r][c]+=Ar[i][j];\n\t }\n\t}",
"{\n\t for(int j=0;j<c;j++){\n\t\tAr[i][j]=sc.nextInt();\n\t\tAr[i][c]+=Ar[i][j];\n\t\tAr[r][j]+=Ar[i][j];\n\t\tAr[r][c]+=Ar[i][j];\n\t }\n\t}",
"for(int j=0;j<c;j++){\n\t\tAr[i][j]=sc.nextInt();\n\t\tAr[i][c]+=Ar[i][j];\n\t\tAr[r][j]+=Ar[i][j];\n\t\tAr[r][c]+=Ar[i][j];\n\t }",
"int j=0;",
"int j=0;",
"j",
"0",
"j<c",
"j",
"c",
"j++",
"j++",
"j",
"{\n\t\tAr[i][j]=sc.nextInt();\n\t\tAr[i][c]+=Ar[i][j];\n\t\tAr[r][j]+=Ar[i][j];\n\t\tAr[r][c]+=Ar[i][j];\n\t }",
"{\n\t\tAr[i][j]=sc.nextInt();\n\t\tAr[i][c]+=Ar[i][j];\n\t\tAr[r][j]+=Ar[i][j];\n\t\tAr[r][c]+=Ar[i][j];\n\t }",
"Ar[i][j]=sc.nextInt()",
"Ar[i][j]",
"Ar[i]",
"Ar",
"i",
"j",
"sc.nextInt()",
"sc.nextInt",
"sc",
"Ar[i][c]+=Ar[i][j]",
"Ar[i][c]",
"Ar[i]",
"Ar",
"i",
"c",
"Ar[i][j]",
"Ar[i]",
"Ar",
"i",
"j",
"Ar[r][j]+=Ar[i][j]",
"Ar[r][j]",
"Ar[r]",
"Ar",
"r",
"j",
"Ar[i][j]",
"Ar[i]",
"Ar",
"i",
"j",
"Ar[r][c]+=Ar[i][j]",
"Ar[r][c]",
"Ar[r]",
"Ar",
"r",
"c",
"Ar[i][j]",
"Ar[i]",
"Ar",
"i",
"j",
"for(int i=0;i<=r;i++){\n\t for(int j=0;j<=c;j++){\n\t\tSystem.out.print(Ar[i][j]);\n\t\tif(j!=c) System.out.print(\" \");\n\t }\n\t System.out.println(\"\");\n\t}",
"int i=0;",
"int i=0;",
"i",
"0",
"i<=r",
"i",
"r",
"i++",
"i++",
"i",
"{\n\t for(int j=0;j<=c;j++){\n\t\tSystem.out.print(Ar[i][j]);\n\t\tif(j!=c) System.out.print(\" \");\n\t }\n\t System.out.println(\"\");\n\t}",
"{\n\t for(int j=0;j<=c;j++){\n\t\tSystem.out.print(Ar[i][j]);\n\t\tif(j!=c) System.out.print(\" \");\n\t }\n\t System.out.println(\"\");\n\t}",
"for(int j=0;j<=c;j++){\n\t\tSystem.out.print(Ar[i][j]);\n\t\tif(j!=c) System.out.print(\" \");\n\t }",
"int j=0;",
"int j=0;",
"j",
"0",
"j<=c",
"j",
"c",
"j++",
"j++",
"j",
"{\n\t\tSystem.out.print(Ar[i][j]);\n\t\tif(j!=c) System.out.print(\" \");\n\t }",
"{\n\t\tSystem.out.print(Ar[i][j]);\n\t\tif(j!=c) System.out.print(\" \");\n\t }",
"System.out.print(Ar[i][j])",
"System.out.print",
"System.out",
"System",
"System.out",
"Ar[i][j]",
"Ar[i]",
"Ar",
"i",
"j",
"if(j!=c) System.out.print(\" \");",
"j!=c",
"j",
"c",
"System.out.print(\" \")",
"System.out.print",
"System.out",
"System",
"System.out",
"\" \"",
"System.out.println(\"\")",
"System.out.println",
"System.out",
"System",
"System.out",
"\"\"",
"String[] args",
"args"
] | import java.util.Scanner;
class Main{
public static void main(String[] args){
final Scanner sc = new Scanner(System.in);
int r=sc.nextInt();
int c=sc.nextInt();
int[][] Ar=new int[r+1][c+1];
for(int i=0;i<r;i++){
for(int j=0;j<c;j++){
Ar[i][j]=sc.nextInt();
Ar[i][c]+=Ar[i][j];
Ar[r][j]+=Ar[i][j];
Ar[r][c]+=Ar[i][j];
}
}
for(int i=0;i<=r;i++){
for(int j=0;j<=c;j++){
System.out.print(Ar[i][j]);
if(j!=c) System.out.print(" ");
}
System.out.println("");
}
}
} |
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
41,
13,
20,
2,
13,
17,
2,
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,
18,
18,
13,
13,
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,
0,
18,
18,
13,
13,
13,
18,
18,
13,
13,
13,
0,
18,
18,
13,
13,
13,
18,
18,
13,
13,
13,
0,
18,
18,
13,
13,
13,
18,
18,
13,
13,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
4,
18,
18,
13,
13,
18,
18,
13,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
4,
18,
18,
13,
13,
2,
17,
18,
18,
13,
13,
13,
4,
18,
18,
13,
13,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
181,
5
],
[
181,
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
],
[
19,
20
],
[
20,
21
],
[
8,
22
],
[
22,
23
],
[
22,
24
],
[
25,
26
],
[
25,
27
],
[
28,
29
],
[
28,
30
],
[
8,
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
],
[
58,
62
],
[
57,
63
],
[
63,
64
],
[
64,
65
],
[
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
],
[
93,
94
],
[
94,
95
],
[
94,
96
],
[
93,
97
],
[
92,
98
],
[
98,
99
],
[
99,
100
],
[
99,
101
],
[
98,
102
],
[
91,
103
],
[
103,
104
],
[
104,
105
],
[
105,
106
],
[
105,
107
],
[
104,
108
],
[
103,
109
],
[
109,
110
],
[
110,
111
],
[
110,
112
],
[
109,
113
],
[
91,
114
],
[
114,
115
],
[
115,
116
],
[
116,
117
],
[
116,
118
],
[
115,
119
],
[
114,
120
],
[
120,
121
],
[
121,
122
],
[
121,
123
],
[
120,
124
],
[
8,
125
],
[
125,
126
],
[
126,
127
],
[
127,
128
],
[
127,
129
],
[
125,
130
],
[
130,
131
],
[
130,
132
],
[
125,
133
],
[
133,
134
],
[
134,
135
],
[
125,
136
],
[
137,
137
],
[
137,
138
],
[
138,
139
],
[
139,
140
],
[
140,
141
],
[
140,
142
],
[
138,
143
],
[
143,
144
],
[
144,
145
],
[
144,
146
],
[
143,
147
],
[
137,
148
],
[
148,
149
],
[
149,
150
],
[
150,
151
],
[
150,
152
],
[
148,
153
],
[
153,
154
],
[
153,
155
],
[
148,
156
],
[
156,
157
],
[
157,
158
],
[
148,
159
],
[
160,
160
],
[
160,
161
],
[
161,
162
],
[
162,
163
],
[
163,
164
],
[
163,
165
],
[
161,
166
],
[
166,
167
],
[
166,
168
],
[
168,
169
],
[
169,
170
],
[
169,
171
],
[
168,
172
],
[
137,
173
],
[
173,
174
],
[
174,
175
],
[
175,
176
],
[
175,
177
],
[
6,
178
],
[
178,
179
],
[
0,
180
],
[
180,
181
],
[
180,
182
]
] | [
"import java.util.Scanner;\npublic class Main{\n\tpublic static void main(String[] args) {\n\t\tScanner scan = new Scanner(System.in);\n\t\tint r = scan.nextInt();\n\t\tint c = scan.nextInt();\n\t\tint[][] table = new int[r+1][c+1];\n\t\tfor(int i = 0;i<r;i++){\n\t\t\tfor(int j=0;j<c;j++){\n\t\t\t\ttable[i][j] = scan.nextInt();\n\t\t\t}\n\t\t}\n\n\t\tfor(int i=0; i<r;i++){\n\t\t\tfor(int j=0; j<c;j++){\n\t\t\t\ttable[i][c] += table[i][j]; \n\t\t\t\ttable[r][j] += table[i][j];\n\t\t\t\ttable[r][c] += table[i][j];\n\t\t\t}\n\t\t}\n\n\t\tfor(int i = 0; i<=r; i++){\n\t\t\tSystem.out.print(table[i][0]);\n\t\t\tfor(int j=1;j<=c;j++){\n\t\t\t\tSystem.out.print(\" \"+table[i][j]);\t\n\t\t}\n\t\tSystem.out.println();\n\t}\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\tint r = scan.nextInt();\n\t\tint c = scan.nextInt();\n\t\tint[][] table = new int[r+1][c+1];\n\t\tfor(int i = 0;i<r;i++){\n\t\t\tfor(int j=0;j<c;j++){\n\t\t\t\ttable[i][j] = scan.nextInt();\n\t\t\t}\n\t\t}\n\n\t\tfor(int i=0; i<r;i++){\n\t\t\tfor(int j=0; j<c;j++){\n\t\t\t\ttable[i][c] += table[i][j]; \n\t\t\t\ttable[r][j] += table[i][j];\n\t\t\t\ttable[r][c] += table[i][j];\n\t\t\t}\n\t\t}\n\n\t\tfor(int i = 0; i<=r; i++){\n\t\t\tSystem.out.print(table[i][0]);\n\t\t\tfor(int j=1;j<=c;j++){\n\t\t\t\tSystem.out.print(\" \"+table[i][j]);\t\n\t\t}\n\t\tSystem.out.println();\n\t}\n}\n}",
"Main",
"public static void main(String[] args) {\n\t\tScanner scan = new Scanner(System.in);\n\t\tint r = scan.nextInt();\n\t\tint c = scan.nextInt();\n\t\tint[][] table = new int[r+1][c+1];\n\t\tfor(int i = 0;i<r;i++){\n\t\t\tfor(int j=0;j<c;j++){\n\t\t\t\ttable[i][j] = scan.nextInt();\n\t\t\t}\n\t\t}\n\n\t\tfor(int i=0; i<r;i++){\n\t\t\tfor(int j=0; j<c;j++){\n\t\t\t\ttable[i][c] += table[i][j]; \n\t\t\t\ttable[r][j] += table[i][j];\n\t\t\t\ttable[r][c] += table[i][j];\n\t\t\t}\n\t\t}\n\n\t\tfor(int i = 0; i<=r; i++){\n\t\t\tSystem.out.print(table[i][0]);\n\t\t\tfor(int j=1;j<=c;j++){\n\t\t\t\tSystem.out.print(\" \"+table[i][j]);\t\n\t\t}\n\t\tSystem.out.println();\n\t}\n}",
"main",
"{\n\t\tScanner scan = new Scanner(System.in);\n\t\tint r = scan.nextInt();\n\t\tint c = scan.nextInt();\n\t\tint[][] table = new int[r+1][c+1];\n\t\tfor(int i = 0;i<r;i++){\n\t\t\tfor(int j=0;j<c;j++){\n\t\t\t\ttable[i][j] = scan.nextInt();\n\t\t\t}\n\t\t}\n\n\t\tfor(int i=0; i<r;i++){\n\t\t\tfor(int j=0; j<c;j++){\n\t\t\t\ttable[i][c] += table[i][j]; \n\t\t\t\ttable[r][j] += table[i][j];\n\t\t\t\ttable[r][c] += table[i][j];\n\t\t\t}\n\t\t}\n\n\t\tfor(int i = 0; i<=r; i++){\n\t\t\tSystem.out.print(table[i][0]);\n\t\t\tfor(int j=1;j<=c;j++){\n\t\t\t\tSystem.out.print(\" \"+table[i][j]);\t\n\t\t}\n\t\tSystem.out.println();\n\t}\n}",
"Scanner scan = new Scanner(System.in);",
"scan",
"new Scanner(System.in)",
"int r = scan.nextInt();",
"r",
"scan.nextInt()",
"scan.nextInt",
"scan",
"int c = scan.nextInt();",
"c",
"scan.nextInt()",
"scan.nextInt",
"scan",
"int[][] table = new int[r+1][c+1];",
"table",
"new int[r+1][c+1]",
"r+1",
"r",
"1",
"c+1",
"c",
"1",
"for(int i = 0;i<r;i++){\n\t\t\tfor(int j=0;j<c;j++){\n\t\t\t\ttable[i][j] = scan.nextInt();\n\t\t\t}\n\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i<r",
"i",
"r",
"i++",
"i++",
"i",
"{\n\t\t\tfor(int j=0;j<c;j++){\n\t\t\t\ttable[i][j] = scan.nextInt();\n\t\t\t}\n\t\t}",
"{\n\t\t\tfor(int j=0;j<c;j++){\n\t\t\t\ttable[i][j] = scan.nextInt();\n\t\t\t}\n\t\t}",
"for(int j=0;j<c;j++){\n\t\t\t\ttable[i][j] = scan.nextInt();\n\t\t\t}",
"int j=0;",
"int j=0;",
"j",
"0",
"j<c",
"j",
"c",
"j++",
"j++",
"j",
"{\n\t\t\t\ttable[i][j] = scan.nextInt();\n\t\t\t}",
"{\n\t\t\t\ttable[i][j] = scan.nextInt();\n\t\t\t}",
"table[i][j] = scan.nextInt()",
"table[i][j]",
"table[i]",
"table",
"i",
"j",
"scan.nextInt()",
"scan.nextInt",
"scan",
"for(int i=0; i<r;i++){\n\t\t\tfor(int j=0; j<c;j++){\n\t\t\t\ttable[i][c] += table[i][j]; \n\t\t\t\ttable[r][j] += table[i][j];\n\t\t\t\ttable[r][c] += table[i][j];\n\t\t\t}\n\t\t}",
"int i=0;",
"int i=0;",
"i",
"0",
"i<r",
"i",
"r",
"i++",
"i++",
"i",
"{\n\t\t\tfor(int j=0; j<c;j++){\n\t\t\t\ttable[i][c] += table[i][j]; \n\t\t\t\ttable[r][j] += table[i][j];\n\t\t\t\ttable[r][c] += table[i][j];\n\t\t\t}\n\t\t}",
"{\n\t\t\tfor(int j=0; j<c;j++){\n\t\t\t\ttable[i][c] += table[i][j]; \n\t\t\t\ttable[r][j] += table[i][j];\n\t\t\t\ttable[r][c] += table[i][j];\n\t\t\t}\n\t\t}",
"for(int j=0; j<c;j++){\n\t\t\t\ttable[i][c] += table[i][j]; \n\t\t\t\ttable[r][j] += table[i][j];\n\t\t\t\ttable[r][c] += table[i][j];\n\t\t\t}",
"int j=0;",
"int j=0;",
"j",
"0",
"j<c",
"j",
"c",
"j++",
"j++",
"j",
"{\n\t\t\t\ttable[i][c] += table[i][j]; \n\t\t\t\ttable[r][j] += table[i][j];\n\t\t\t\ttable[r][c] += table[i][j];\n\t\t\t}",
"{\n\t\t\t\ttable[i][c] += table[i][j]; \n\t\t\t\ttable[r][j] += table[i][j];\n\t\t\t\ttable[r][c] += table[i][j];\n\t\t\t}",
"table[i][c] += table[i][j]",
"table[i][c]",
"table[i]",
"table",
"i",
"c",
"table[i][j]",
"table[i]",
"table",
"i",
"j",
"table[r][j] += table[i][j]",
"table[r][j]",
"table[r]",
"table",
"r",
"j",
"table[i][j]",
"table[i]",
"table",
"i",
"j",
"table[r][c] += table[i][j]",
"table[r][c]",
"table[r]",
"table",
"r",
"c",
"table[i][j]",
"table[i]",
"table",
"i",
"j",
"for(int i = 0; i<=r; i++){\n\t\t\tSystem.out.print(table[i][0]);\n\t\t\tfor(int j=1;j<=c;j++){\n\t\t\t\tSystem.out.print(\" \"+table[i][j]);\t\n\t\t}\n\t\tSystem.out.println();\n\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i<=r",
"i",
"r",
"i++",
"i++",
"i",
"{\n\t\t\tSystem.out.print(table[i][0]);\n\t\t\tfor(int j=1;j<=c;j++){\n\t\t\t\tSystem.out.print(\" \"+table[i][j]);\t\n\t\t}\n\t\tSystem.out.println();\n\t}",
"{\n\t\t\tSystem.out.print(table[i][0]);\n\t\t\tfor(int j=1;j<=c;j++){\n\t\t\t\tSystem.out.print(\" \"+table[i][j]);\t\n\t\t}\n\t\tSystem.out.println();\n\t}",
"System.out.print(table[i][0])",
"System.out.print",
"System.out",
"System",
"System.out",
"table[i][0]",
"table[i]",
"table",
"i",
"0",
"for(int j=1;j<=c;j++){\n\t\t\t\tSystem.out.print(\" \"+table[i][j]);\t\n\t\t}",
"int j=1;",
"int j=1;",
"j",
"1",
"j<=c",
"j",
"c",
"j++",
"j++",
"j",
"{\n\t\t\t\tSystem.out.print(\" \"+table[i][j]);\t\n\t\t}",
"{\n\t\t\t\tSystem.out.print(\" \"+table[i][j]);\t\n\t\t}",
"System.out.print(\" \"+table[i][j])",
"System.out.print",
"System.out",
"System",
"System.out",
"\" \"+table[i][j]",
"\" \"",
"table[i][j]",
"table[i]",
"table",
"i",
"j",
"System.out.println()",
"System.out.println",
"System.out",
"System",
"System.out",
"String[] args",
"args",
"public class Main{\n\tpublic static void main(String[] args) {\n\t\tScanner scan = new Scanner(System.in);\n\t\tint r = scan.nextInt();\n\t\tint c = scan.nextInt();\n\t\tint[][] table = new int[r+1][c+1];\n\t\tfor(int i = 0;i<r;i++){\n\t\t\tfor(int j=0;j<c;j++){\n\t\t\t\ttable[i][j] = scan.nextInt();\n\t\t\t}\n\t\t}\n\n\t\tfor(int i=0; i<r;i++){\n\t\t\tfor(int j=0; j<c;j++){\n\t\t\t\ttable[i][c] += table[i][j]; \n\t\t\t\ttable[r][j] += table[i][j];\n\t\t\t\ttable[r][c] += table[i][j];\n\t\t\t}\n\t\t}\n\n\t\tfor(int i = 0; i<=r; i++){\n\t\t\tSystem.out.print(table[i][0]);\n\t\t\tfor(int j=1;j<=c;j++){\n\t\t\t\tSystem.out.print(\" \"+table[i][j]);\t\n\t\t}\n\t\tSystem.out.println();\n\t}\n}\n}",
"public class Main{\n\tpublic static void main(String[] args) {\n\t\tScanner scan = new Scanner(System.in);\n\t\tint r = scan.nextInt();\n\t\tint c = scan.nextInt();\n\t\tint[][] table = new int[r+1][c+1];\n\t\tfor(int i = 0;i<r;i++){\n\t\t\tfor(int j=0;j<c;j++){\n\t\t\t\ttable[i][j] = scan.nextInt();\n\t\t\t}\n\t\t}\n\n\t\tfor(int i=0; i<r;i++){\n\t\t\tfor(int j=0; j<c;j++){\n\t\t\t\ttable[i][c] += table[i][j]; \n\t\t\t\ttable[r][j] += table[i][j];\n\t\t\t\ttable[r][c] += table[i][j];\n\t\t\t}\n\t\t}\n\n\t\tfor(int i = 0; i<=r; i++){\n\t\t\tSystem.out.print(table[i][0]);\n\t\t\tfor(int j=1;j<=c;j++){\n\t\t\t\tSystem.out.print(\" \"+table[i][j]);\t\n\t\t}\n\t\tSystem.out.println();\n\t}\n}\n}",
"Main"
] | import java.util.Scanner;
public class Main{
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
int r = scan.nextInt();
int c = scan.nextInt();
int[][] table = new int[r+1][c+1];
for(int i = 0;i<r;i++){
for(int j=0;j<c;j++){
table[i][j] = scan.nextInt();
}
}
for(int i=0; i<r;i++){
for(int j=0; j<c;j++){
table[i][c] += table[i][j];
table[r][j] += table[i][j];
table[r][c] += table[i][j];
}
}
for(int i = 0; i<=r; i++){
System.out.print(table[i][0]);
for(int j=1;j<=c;j++){
System.out.print(" "+table[i][j]);
}
System.out.println();
}
}
} |
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
20,
41,
13,
4,
18,
4,
18,
13,
17,
41,
13,
4,
18,
13,
18,
13,
17,
41,
13,
4,
18,
13,
18,
13,
17,
41,
13,
20,
2,
13,
17,
2,
13,
17,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
41,
13,
4,
18,
4,
18,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
18,
18,
13,
13,
13,
4,
18,
13,
18,
13,
13,
0,
18,
18,
13,
13,
13,
2,
18,
18,
13,
13,
13,
18,
18,
13,
13,
13,
4,
18,
13,
2,
18,
18,
13,
13,
13,
17,
4,
18,
13,
2,
18,
18,
13,
13,
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,
18,
18,
13,
13,
13,
2,
18,
18,
13,
13,
13,
18,
18,
13,
13,
13,
4,
18,
13,
2,
18,
18,
13,
13,
13,
17,
0,
13,
2,
13,
18,
18,
13,
13,
13,
4,
18,
13,
2,
13,
17,
4,
18,
18,
13,
13,
4,
18,
13,
23,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
10,
11
],
[
10,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
15,
17
],
[
14,
18
],
[
18,
19
],
[
18,
20
],
[
14,
21
],
[
21,
22
],
[
21,
23
],
[
23,
24
],
[
24,
25
],
[
25,
26
],
[
26,
27
],
[
23,
28
],
[
14,
29
],
[
29,
30
],
[
29,
31
],
[
31,
32
],
[
32,
33
],
[
31,
34
],
[
34,
35
],
[
34,
36
],
[
14,
37
],
[
37,
38
],
[
37,
39
],
[
39,
40
],
[
40,
41
],
[
39,
42
],
[
42,
43
],
[
42,
44
],
[
14,
45
],
[
45,
46
],
[
45,
47
],
[
48,
49
],
[
48,
50
],
[
51,
52
],
[
51,
53
],
[
14,
54
],
[
54,
55
],
[
54,
56
],
[
14,
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
],
[
73,
74
],
[
74,
75
],
[
75,
76
],
[
72,
77
],
[
69,
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
],
[
92,
93
],
[
93,
94
],
[
93,
95
],
[
92,
96
],
[
91,
97
],
[
97,
98
],
[
98,
99
],
[
97,
100
],
[
100,
101
],
[
100,
102
],
[
90,
103
],
[
103,
104
],
[
104,
105
],
[
105,
106
],
[
105,
107
],
[
104,
108
],
[
103,
109
],
[
109,
110
],
[
110,
111
],
[
111,
112
],
[
111,
113
],
[
110,
114
],
[
109,
115
],
[
115,
116
],
[
116,
117
],
[
116,
118
],
[
115,
119
],
[
90,
120
],
[
120,
121
],
[
121,
122
],
[
120,
123
],
[
123,
124
],
[
124,
125
],
[
125,
126
],
[
125,
127
],
[
124,
128
],
[
123,
129
],
[
69,
130
],
[
130,
131
],
[
131,
132
],
[
130,
133
],
[
133,
134
],
[
134,
135
],
[
135,
136
],
[
135,
137
],
[
134,
138
],
[
133,
139
],
[
14,
140
],
[
140,
141
],
[
141,
142
],
[
142,
143
],
[
142,
144
],
[
140,
145
],
[
145,
146
],
[
145,
147
],
[
140,
148
],
[
148,
149
],
[
149,
150
],
[
140,
151
],
[
152,
152
],
[
152,
153
],
[
153,
154
],
[
154,
155
],
[
155,
156
],
[
155,
157
],
[
153,
158
],
[
158,
159
],
[
158,
160
],
[
153,
161
],
[
161,
162
],
[
162,
163
],
[
153,
164
],
[
165,
165
],
[
165,
166
],
[
166,
167
],
[
167,
168
],
[
168,
169
],
[
168,
170
],
[
167,
171
],
[
166,
172
],
[
172,
173
],
[
173,
174
],
[
174,
175
],
[
174,
176
],
[
173,
177
],
[
172,
178
],
[
178,
179
],
[
179,
180
],
[
179,
181
],
[
178,
182
],
[
152,
183
],
[
183,
184
],
[
184,
185
],
[
183,
186
],
[
186,
187
],
[
187,
188
],
[
188,
189
],
[
188,
190
],
[
187,
191
],
[
186,
192
],
[
152,
193
],
[
193,
194
],
[
193,
195
],
[
195,
196
],
[
195,
197
],
[
197,
198
],
[
198,
199
],
[
198,
200
],
[
197,
201
],
[
14,
202
],
[
202,
203
],
[
203,
204
],
[
202,
205
],
[
205,
206
],
[
205,
207
],
[
14,
208
],
[
208,
209
],
[
209,
210
],
[
210,
211
],
[
210,
212
],
[
208,
213
],
[
213,
214
],
[
214,
215
],
[
12,
216
],
[
216,
217
]
] | [
"//??¨?¨????????????°??????\nimport java.io.BufferedReader;\nimport java.io.IOException;\nimport java.io.InputStreamReader;\n\nclass Main {\n\tpublic static void main(String[] args) throws IOException{\n\t\tBufferedReader br =\n\t\t\t\tnew BufferedReader(new InputStreamReader(System.in));\n\t\tStringBuilder sb = new StringBuilder();\n\n\t\t\n\t\t//???????????????????????????????????°??¨?????°?????\\???\n\t\tString[] matrixStr = br.readLine().split(\" \");\t\t//??????????????°??¨?????°?????\\??????matrixStr\n\t\tint rowNum = Integer.parseInt(matrixStr[0]);\t\t//?????°rowNum\n\t\tint colNum = Integer.parseInt(matrixStr[1]);\t\t//?????°colNum\n\t\tint[][] resultArray = new int[rowNum+1][colNum+1];\n\t\tint lastNum = 0;\n\t\t\n\t\t//?????????????´??????????\n\t\tfor(int i=0; i<rowNum; i++) {\t\t\t\t\t\t//?????°rowNum?????°??????\n\t\t\tString[] inputStr = br.readLine().split(\" \");\t//????´?????????????inputStr\n\t\t\n\t\t\tfor(int j=0; j<colNum; j++) {\t\t\t\t\t//??????????´???????\n\t\t\t\tresultArray[i][j] = Integer.parseInt(inputStr[j]);\n\t\t\t\tresultArray[i][colNum] = resultArray[i][colNum] + resultArray[i][j];\n\t\t\t\t\tsb.append(resultArray[i][j] + \" \");\t\t//\n\t\t\t}\n\t\t\tsb.append(resultArray[i][colNum] + \"\\n\");\n\t\t}\n\t\t\n\t\tfor(int j=0; j<colNum; j++) {\n\t\t\tfor(int i=0; i<rowNum; i++) {\n\t\t\t\tresultArray[rowNum][j] = resultArray[rowNum][j] + resultArray[i][j];\n\t\t\t}\n\n\t\t\t\tsb.append(resultArray[rowNum][j] + \" \");\n\n\t\t\tlastNum = lastNum + resultArray[rowNum][j];\n\t\t}\n\t\t\tsb.append(lastNum + \"\\n\");\n\t\t\tSystem.out.print(sb.toString());\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",
"class Main {\n\tpublic static void main(String[] args) throws IOException{\n\t\tBufferedReader br =\n\t\t\t\tnew BufferedReader(new InputStreamReader(System.in));\n\t\tStringBuilder sb = new StringBuilder();\n\n\t\t\n\t\t//???????????????????????????????????°??¨?????°?????\\???\n\t\tString[] matrixStr = br.readLine().split(\" \");\t\t//??????????????°??¨?????°?????\\??????matrixStr\n\t\tint rowNum = Integer.parseInt(matrixStr[0]);\t\t//?????°rowNum\n\t\tint colNum = Integer.parseInt(matrixStr[1]);\t\t//?????°colNum\n\t\tint[][] resultArray = new int[rowNum+1][colNum+1];\n\t\tint lastNum = 0;\n\t\t\n\t\t//?????????????´??????????\n\t\tfor(int i=0; i<rowNum; i++) {\t\t\t\t\t\t//?????°rowNum?????°??????\n\t\t\tString[] inputStr = br.readLine().split(\" \");\t//????´?????????????inputStr\n\t\t\n\t\t\tfor(int j=0; j<colNum; j++) {\t\t\t\t\t//??????????´???????\n\t\t\t\tresultArray[i][j] = Integer.parseInt(inputStr[j]);\n\t\t\t\tresultArray[i][colNum] = resultArray[i][colNum] + resultArray[i][j];\n\t\t\t\t\tsb.append(resultArray[i][j] + \" \");\t\t//\n\t\t\t}\n\t\t\tsb.append(resultArray[i][colNum] + \"\\n\");\n\t\t}\n\t\t\n\t\tfor(int j=0; j<colNum; j++) {\n\t\t\tfor(int i=0; i<rowNum; i++) {\n\t\t\t\tresultArray[rowNum][j] = resultArray[rowNum][j] + resultArray[i][j];\n\t\t\t}\n\n\t\t\t\tsb.append(resultArray[rowNum][j] + \" \");\n\n\t\t\tlastNum = lastNum + resultArray[rowNum][j];\n\t\t}\n\t\t\tsb.append(lastNum + \"\\n\");\n\t\t\tSystem.out.print(sb.toString());\n\t}\n\n}",
"Main",
"public static void main(String[] args) throws IOException{\n\t\tBufferedReader br =\n\t\t\t\tnew BufferedReader(new InputStreamReader(System.in));\n\t\tStringBuilder sb = new StringBuilder();\n\n\t\t\n\t\t//???????????????????????????????????°??¨?????°?????\\???\n\t\tString[] matrixStr = br.readLine().split(\" \");\t\t//??????????????°??¨?????°?????\\??????matrixStr\n\t\tint rowNum = Integer.parseInt(matrixStr[0]);\t\t//?????°rowNum\n\t\tint colNum = Integer.parseInt(matrixStr[1]);\t\t//?????°colNum\n\t\tint[][] resultArray = new int[rowNum+1][colNum+1];\n\t\tint lastNum = 0;\n\t\t\n\t\t//?????????????´??????????\n\t\tfor(int i=0; i<rowNum; i++) {\t\t\t\t\t\t//?????°rowNum?????°??????\n\t\t\tString[] inputStr = br.readLine().split(\" \");\t//????´?????????????inputStr\n\t\t\n\t\t\tfor(int j=0; j<colNum; j++) {\t\t\t\t\t//??????????´???????\n\t\t\t\tresultArray[i][j] = Integer.parseInt(inputStr[j]);\n\t\t\t\tresultArray[i][colNum] = resultArray[i][colNum] + resultArray[i][j];\n\t\t\t\t\tsb.append(resultArray[i][j] + \" \");\t\t//\n\t\t\t}\n\t\t\tsb.append(resultArray[i][colNum] + \"\\n\");\n\t\t}\n\t\t\n\t\tfor(int j=0; j<colNum; j++) {\n\t\t\tfor(int i=0; i<rowNum; i++) {\n\t\t\t\tresultArray[rowNum][j] = resultArray[rowNum][j] + resultArray[i][j];\n\t\t\t}\n\n\t\t\t\tsb.append(resultArray[rowNum][j] + \" \");\n\n\t\t\tlastNum = lastNum + resultArray[rowNum][j];\n\t\t}\n\t\t\tsb.append(lastNum + \"\\n\");\n\t\t\tSystem.out.print(sb.toString());\n\t}",
"main",
"{\n\t\tBufferedReader br =\n\t\t\t\tnew BufferedReader(new InputStreamReader(System.in));\n\t\tStringBuilder sb = new StringBuilder();\n\n\t\t\n\t\t//???????????????????????????????????°??¨?????°?????\\???\n\t\tString[] matrixStr = br.readLine().split(\" \");\t\t//??????????????°??¨?????°?????\\??????matrixStr\n\t\tint rowNum = Integer.parseInt(matrixStr[0]);\t\t//?????°rowNum\n\t\tint colNum = Integer.parseInt(matrixStr[1]);\t\t//?????°colNum\n\t\tint[][] resultArray = new int[rowNum+1][colNum+1];\n\t\tint lastNum = 0;\n\t\t\n\t\t//?????????????´??????????\n\t\tfor(int i=0; i<rowNum; i++) {\t\t\t\t\t\t//?????°rowNum?????°??????\n\t\t\tString[] inputStr = br.readLine().split(\" \");\t//????´?????????????inputStr\n\t\t\n\t\t\tfor(int j=0; j<colNum; j++) {\t\t\t\t\t//??????????´???????\n\t\t\t\tresultArray[i][j] = Integer.parseInt(inputStr[j]);\n\t\t\t\tresultArray[i][colNum] = resultArray[i][colNum] + resultArray[i][j];\n\t\t\t\t\tsb.append(resultArray[i][j] + \" \");\t\t//\n\t\t\t}\n\t\t\tsb.append(resultArray[i][colNum] + \"\\n\");\n\t\t}\n\t\t\n\t\tfor(int j=0; j<colNum; j++) {\n\t\t\tfor(int i=0; i<rowNum; i++) {\n\t\t\t\tresultArray[rowNum][j] = resultArray[rowNum][j] + resultArray[i][j];\n\t\t\t}\n\n\t\t\t\tsb.append(resultArray[rowNum][j] + \" \");\n\n\t\t\tlastNum = lastNum + resultArray[rowNum][j];\n\t\t}\n\t\t\tsb.append(lastNum + \"\\n\");\n\t\t\tSystem.out.print(sb.toString());\n\t}",
"BufferedReader br =\n\t\t\t\tnew BufferedReader(new InputStreamReader(System.in));",
"br",
"new BufferedReader(new InputStreamReader(System.in))",
"StringBuilder sb = new StringBuilder();",
"sb",
"new StringBuilder()",
"String[] matrixStr = br.readLine().split(\" \");",
"matrixStr",
"br.readLine().split(\" \")",
"br.readLine().split",
"br.readLine()",
"br.readLine",
"br",
"\" \"",
"int rowNum = Integer.parseInt(matrixStr[0]);",
"rowNum",
"Integer.parseInt(matrixStr[0])",
"Integer.parseInt",
"Integer",
"matrixStr[0]",
"matrixStr",
"0",
"int colNum = Integer.parseInt(matrixStr[1]);",
"colNum",
"Integer.parseInt(matrixStr[1])",
"Integer.parseInt",
"Integer",
"matrixStr[1]",
"matrixStr",
"1",
"int[][] resultArray = new int[rowNum+1][colNum+1];",
"resultArray",
"new int[rowNum+1][colNum+1]",
"rowNum+1",
"rowNum",
"1",
"colNum+1",
"colNum",
"1",
"int lastNum = 0;",
"lastNum",
"0",
"for(int i=0; i<rowNum; i++) {\t\t\t\t\t\t//?????°rowNum?????°??????\n\t\t\tString[] inputStr = br.readLine().split(\" \");\t//????´?????????????inputStr\n\t\t\n\t\t\tfor(int j=0; j<colNum; j++) {\t\t\t\t\t//??????????´???????\n\t\t\t\tresultArray[i][j] = Integer.parseInt(inputStr[j]);\n\t\t\t\tresultArray[i][colNum] = resultArray[i][colNum] + resultArray[i][j];\n\t\t\t\t\tsb.append(resultArray[i][j] + \" \");\t\t//\n\t\t\t}\n\t\t\tsb.append(resultArray[i][colNum] + \"\\n\");\n\t\t}",
"int i=0;",
"int i=0;",
"i",
"0",
"i<rowNum",
"i",
"rowNum",
"i++",
"i++",
"i",
"{\t\t\t\t\t\t//?????°rowNum?????°??????\n\t\t\tString[] inputStr = br.readLine().split(\" \");\t//????´?????????????inputStr\n\t\t\n\t\t\tfor(int j=0; j<colNum; j++) {\t\t\t\t\t//??????????´???????\n\t\t\t\tresultArray[i][j] = Integer.parseInt(inputStr[j]);\n\t\t\t\tresultArray[i][colNum] = resultArray[i][colNum] + resultArray[i][j];\n\t\t\t\t\tsb.append(resultArray[i][j] + \" \");\t\t//\n\t\t\t}\n\t\t\tsb.append(resultArray[i][colNum] + \"\\n\");\n\t\t}",
"{\t\t\t\t\t\t//?????°rowNum?????°??????\n\t\t\tString[] inputStr = br.readLine().split(\" \");\t//????´?????????????inputStr\n\t\t\n\t\t\tfor(int j=0; j<colNum; j++) {\t\t\t\t\t//??????????´???????\n\t\t\t\tresultArray[i][j] = Integer.parseInt(inputStr[j]);\n\t\t\t\tresultArray[i][colNum] = resultArray[i][colNum] + resultArray[i][j];\n\t\t\t\t\tsb.append(resultArray[i][j] + \" \");\t\t//\n\t\t\t}\n\t\t\tsb.append(resultArray[i][colNum] + \"\\n\");\n\t\t}",
"String[] inputStr = br.readLine().split(\" \");",
"inputStr",
"br.readLine().split(\" \")",
"br.readLine().split",
"br.readLine()",
"br.readLine",
"br",
"\" \"",
"for(int j=0; j<colNum; j++) {\t\t\t\t\t//??????????´???????\n\t\t\t\tresultArray[i][j] = Integer.parseInt(inputStr[j]);\n\t\t\t\tresultArray[i][colNum] = resultArray[i][colNum] + resultArray[i][j];\n\t\t\t\t\tsb.append(resultArray[i][j] + \" \");\t\t//\n\t\t\t}",
"int j=0;",
"int j=0;",
"j",
"0",
"j<colNum",
"j",
"colNum",
"j++",
"j++",
"j",
"{\t\t\t\t\t//??????????´???????\n\t\t\t\tresultArray[i][j] = Integer.parseInt(inputStr[j]);\n\t\t\t\tresultArray[i][colNum] = resultArray[i][colNum] + resultArray[i][j];\n\t\t\t\t\tsb.append(resultArray[i][j] + \" \");\t\t//\n\t\t\t}",
"{\t\t\t\t\t//??????????´???????\n\t\t\t\tresultArray[i][j] = Integer.parseInt(inputStr[j]);\n\t\t\t\tresultArray[i][colNum] = resultArray[i][colNum] + resultArray[i][j];\n\t\t\t\t\tsb.append(resultArray[i][j] + \" \");\t\t//\n\t\t\t}",
"resultArray[i][j] = Integer.parseInt(inputStr[j])",
"resultArray[i][j]",
"resultArray[i]",
"resultArray",
"i",
"j",
"Integer.parseInt(inputStr[j])",
"Integer.parseInt",
"Integer",
"inputStr[j]",
"inputStr",
"j",
"resultArray[i][colNum] = resultArray[i][colNum] + resultArray[i][j]",
"resultArray[i][colNum]",
"resultArray[i]",
"resultArray",
"i",
"colNum",
"resultArray[i][colNum] + resultArray[i][j]",
"resultArray[i][colNum]",
"resultArray[i]",
"resultArray",
"i",
"colNum",
"resultArray[i][j]",
"resultArray[i]",
"resultArray",
"i",
"j",
"sb.append(resultArray[i][j] + \" \")",
"sb.append",
"sb",
"resultArray[i][j] + \" \"",
"resultArray[i][j]",
"resultArray[i]",
"resultArray",
"i",
"j",
"\" \"",
"sb.append(resultArray[i][colNum] + \"\\n\")",
"sb.append",
"sb",
"resultArray[i][colNum] + \"\\n\"",
"resultArray[i][colNum]",
"resultArray[i]",
"resultArray",
"i",
"colNum",
"\"\\n\"",
"for(int j=0; j<colNum; j++) {\n\t\t\tfor(int i=0; i<rowNum; i++) {\n\t\t\t\tresultArray[rowNum][j] = resultArray[rowNum][j] + resultArray[i][j];\n\t\t\t}\n\n\t\t\t\tsb.append(resultArray[rowNum][j] + \" \");\n\n\t\t\tlastNum = lastNum + resultArray[rowNum][j];\n\t\t}",
"int j=0;",
"int j=0;",
"j",
"0",
"j<colNum",
"j",
"colNum",
"j++",
"j++",
"j",
"{\n\t\t\tfor(int i=0; i<rowNum; i++) {\n\t\t\t\tresultArray[rowNum][j] = resultArray[rowNum][j] + resultArray[i][j];\n\t\t\t}\n\n\t\t\t\tsb.append(resultArray[rowNum][j] + \" \");\n\n\t\t\tlastNum = lastNum + resultArray[rowNum][j];\n\t\t}",
"{\n\t\t\tfor(int i=0; i<rowNum; i++) {\n\t\t\t\tresultArray[rowNum][j] = resultArray[rowNum][j] + resultArray[i][j];\n\t\t\t}\n\n\t\t\t\tsb.append(resultArray[rowNum][j] + \" \");\n\n\t\t\tlastNum = lastNum + resultArray[rowNum][j];\n\t\t}",
"for(int i=0; i<rowNum; i++) {\n\t\t\t\tresultArray[rowNum][j] = resultArray[rowNum][j] + resultArray[i][j];\n\t\t\t}",
"int i=0;",
"int i=0;",
"i",
"0",
"i<rowNum",
"i",
"rowNum",
"i++",
"i++",
"i",
"{\n\t\t\t\tresultArray[rowNum][j] = resultArray[rowNum][j] + resultArray[i][j];\n\t\t\t}",
"{\n\t\t\t\tresultArray[rowNum][j] = resultArray[rowNum][j] + resultArray[i][j];\n\t\t\t}",
"resultArray[rowNum][j] = resultArray[rowNum][j] + resultArray[i][j]",
"resultArray[rowNum][j]",
"resultArray[rowNum]",
"resultArray",
"rowNum",
"j",
"resultArray[rowNum][j] + resultArray[i][j]",
"resultArray[rowNum][j]",
"resultArray[rowNum]",
"resultArray",
"rowNum",
"j",
"resultArray[i][j]",
"resultArray[i]",
"resultArray",
"i",
"j",
"sb.append(resultArray[rowNum][j] + \" \")",
"sb.append",
"sb",
"resultArray[rowNum][j] + \" \"",
"resultArray[rowNum][j]",
"resultArray[rowNum]",
"resultArray",
"rowNum",
"j",
"\" \"",
"lastNum = lastNum + resultArray[rowNum][j]",
"lastNum",
"lastNum + resultArray[rowNum][j]",
"lastNum",
"resultArray[rowNum][j]",
"resultArray[rowNum]",
"resultArray",
"rowNum",
"j",
"sb.append(lastNum + \"\\n\")",
"sb.append",
"sb",
"lastNum + \"\\n\"",
"lastNum",
"\"\\n\"",
"System.out.print(sb.toString())",
"System.out.print",
"System.out",
"System",
"System.out",
"sb.toString()",
"sb.toString",
"sb",
"String[] args",
"args"
] | //??¨?¨????????????°??????
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
class Main {
public static void main(String[] args) throws IOException{
BufferedReader br =
new BufferedReader(new InputStreamReader(System.in));
StringBuilder sb = new StringBuilder();
//???????????????????????????????????°??¨?????°?????\???
String[] matrixStr = br.readLine().split(" "); //??????????????°??¨?????°?????\??????matrixStr
int rowNum = Integer.parseInt(matrixStr[0]); //?????°rowNum
int colNum = Integer.parseInt(matrixStr[1]); //?????°colNum
int[][] resultArray = new int[rowNum+1][colNum+1];
int lastNum = 0;
//?????????????´??????????
for(int i=0; i<rowNum; i++) { //?????°rowNum?????°??????
String[] inputStr = br.readLine().split(" "); //????´?????????????inputStr
for(int j=0; j<colNum; j++) { //??????????´???????
resultArray[i][j] = Integer.parseInt(inputStr[j]);
resultArray[i][colNum] = resultArray[i][colNum] + resultArray[i][j];
sb.append(resultArray[i][j] + " "); //
}
sb.append(resultArray[i][colNum] + "\n");
}
for(int j=0; j<colNum; j++) {
for(int i=0; i<rowNum; i++) {
resultArray[rowNum][j] = resultArray[rowNum][j] + resultArray[i][j];
}
sb.append(resultArray[rowNum][j] + " ");
lastNum = lastNum + resultArray[rowNum][j];
}
sb.append(lastNum + "\n");
System.out.print(sb.toString());
}
} |
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
41,
13,
4,
18,
13,
17,
12,
13,
30,
41,
13,
20,
41,
13,
20,
41,
13,
4,
18,
4,
18,
13,
17,
41,
13,
41,
13,
4,
18,
13,
18,
13,
17,
41,
13,
4,
18,
13,
18,
13,
17,
41,
13,
20,
13,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
4,
18,
13,
0,
13,
4,
18,
13,
17,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
41,
13,
4,
18,
13,
18,
13,
13,
0,
13,
13,
0,
18,
13,
13,
13,
4,
18,
13,
13,
4,
18,
13,
17,
4,
18,
13,
13,
0,
13,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
14,
2,
13,
17,
30,
4,
18,
13,
17,
4,
18,
13,
18,
13,
13,
4,
18,
13,
17,
4,
18,
13,
13,
4,
18,
13,
12,
13,
30,
4,
18,
20,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
10,
11
],
[
10,
12
],
[
0,
13
],
[
182,
14
],
[
182,
15
],
[
15,
16
],
[
15,
17
],
[
17,
18
],
[
18,
19
],
[
17,
20
],
[
182,
21
],
[
21,
22
],
[
21,
23
],
[
23,
24
],
[
24,
25
],
[
24,
26
],
[
23,
27
],
[
27,
28
],
[
27,
29
],
[
23,
30
],
[
30,
31
],
[
30,
32
],
[
32,
33
],
[
33,
34
],
[
34,
35
],
[
35,
36
],
[
32,
37
],
[
23,
38
],
[
38,
39
],
[
23,
40
],
[
40,
41
],
[
40,
42
],
[
42,
43
],
[
43,
44
],
[
42,
45
],
[
45,
46
],
[
45,
47
],
[
23,
48
],
[
48,
49
],
[
48,
50
],
[
50,
51
],
[
51,
52
],
[
50,
53
],
[
53,
54
],
[
53,
55
],
[
23,
56
],
[
56,
57
],
[
56,
58
],
[
23,
60
],
[
60,
61
],
[
60,
62
],
[
23,
63
],
[
63,
64
],
[
64,
65
],
[
65,
66
],
[
65,
67
],
[
63,
68
],
[
68,
69
],
[
68,
70
],
[
63,
71
],
[
71,
72
],
[
72,
73
],
[
63,
74
],
[
75,
75
],
[
75,
76
],
[
76,
77
],
[
76,
78
],
[
78,
79
],
[
79,
80
],
[
75,
81
],
[
81,
82
],
[
81,
83
],
[
83,
84
],
[
84,
85
],
[
83,
86
],
[
75,
87
],
[
87,
88
],
[
87,
89
],
[
75,
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
],
[
106,
107
],
[
105,
108
],
[
108,
109
],
[
108,
110
],
[
102,
111
],
[
111,
112
],
[
111,
113
],
[
102,
114
],
[
114,
115
],
[
115,
116
],
[
115,
117
],
[
114,
118
],
[
75,
119
],
[
119,
120
],
[
120,
121
],
[
119,
122
],
[
75,
123
],
[
123,
124
],
[
124,
125
],
[
123,
126
],
[
75,
127
],
[
127,
128
],
[
128,
129
],
[
127,
130
],
[
75,
131
],
[
131,
132
],
[
131,
133
],
[
23,
134
],
[
134,
135
],
[
135,
136
],
[
136,
137
],
[
136,
138
],
[
134,
139
],
[
139,
140
],
[
139,
141
],
[
134,
142
],
[
142,
143
],
[
143,
144
],
[
134,
145
],
[
146,
146
],
[
146,
147
],
[
147,
148
],
[
148,
149
],
[
148,
150
],
[
147,
151
],
[
151,
152
],
[
152,
153
],
[
153,
154
],
[
152,
155
],
[
146,
156
],
[
156,
157
],
[
157,
158
],
[
156,
159
],
[
159,
160
],
[
159,
161
],
[
23,
162
],
[
162,
163
],
[
163,
164
],
[
162,
165
],
[
23,
166
],
[
166,
167
],
[
167,
168
],
[
166,
169
],
[
23,
170
],
[
170,
171
],
[
171,
172
],
[
182,
173
],
[
173,
174
],
[
173,
175
],
[
175,
176
],
[
176,
177
],
[
177,
178
],
[
173,
179
],
[
179,
180
],
[
0,
181
],
[
181,
182
],
[
181,
183
]
] | [
"import java.io.BufferedReader;\nimport java.io.IOException;\nimport java.io.InputStreamReader;\nimport java.io.PrintWriter;\n\npublic class Main {\n\tpublic static final String EOL = System.getProperty(\"line.separator\");\n public void exec() throws IOException {\n \tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n \tPrintWriter out = new PrintWriter(System.out);\n \tString[] sar = br.readLine().split(\" \");\n \tString l;\n \tint r = Integer.parseInt(sar[0]);\n \tint c = Integer.parseInt(sar[1]);\n \tint[] csum = new int[c];\n \tint asum = 0;\n \tfor(int i=0; i<r; i++) {\n \t\tl = br.readLine();\n \t\tsar = l.split(\" \");\n \t\tint rsum = 0;\n \t\tfor (int j=0; j<c; j++) {\n \t\t\tint v = Integer.parseInt(sar[j]);\n \t\t\trsum += v;\n \t\t\tcsum[j] += v;\n \t\t}\n \t\tout.print(l);\n \t\tout.print(\" \");\n \t\tout.println(rsum);\n \t\tasum += rsum;\n \t}\n for(int i=0; i<c; i++) {\n \tif(i > 0){\n \t\tout.print(\" \");\n \t}\n \tout.print(csum[i]);\n }\n out.print(\" \");\n out.println(asum);\n out.flush();\n }\n \n public static void main(String[] args) throws IOException {\n \tnew Main().exec();\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.io.PrintWriter;",
"PrintWriter",
"java.io",
"public class Main {\n\tpublic static final String EOL = System.getProperty(\"line.separator\");\n public void exec() throws IOException {\n \tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n \tPrintWriter out = new PrintWriter(System.out);\n \tString[] sar = br.readLine().split(\" \");\n \tString l;\n \tint r = Integer.parseInt(sar[0]);\n \tint c = Integer.parseInt(sar[1]);\n \tint[] csum = new int[c];\n \tint asum = 0;\n \tfor(int i=0; i<r; i++) {\n \t\tl = br.readLine();\n \t\tsar = l.split(\" \");\n \t\tint rsum = 0;\n \t\tfor (int j=0; j<c; j++) {\n \t\t\tint v = Integer.parseInt(sar[j]);\n \t\t\trsum += v;\n \t\t\tcsum[j] += v;\n \t\t}\n \t\tout.print(l);\n \t\tout.print(\" \");\n \t\tout.println(rsum);\n \t\tasum += rsum;\n \t}\n for(int i=0; i<c; i++) {\n \tif(i > 0){\n \t\tout.print(\" \");\n \t}\n \tout.print(csum[i]);\n }\n out.print(\" \");\n out.println(asum);\n out.flush();\n }\n \n public static void main(String[] args) throws IOException {\n \tnew Main().exec();\n }\n}",
"Main",
"public static final String EOL = System.getProperty(\"line.separator\");",
"EOL",
"System.getProperty(\"line.separator\")",
"System.getProperty",
"System",
"\"line.separator\"",
"public void exec() throws IOException {\n \tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n \tPrintWriter out = new PrintWriter(System.out);\n \tString[] sar = br.readLine().split(\" \");\n \tString l;\n \tint r = Integer.parseInt(sar[0]);\n \tint c = Integer.parseInt(sar[1]);\n \tint[] csum = new int[c];\n \tint asum = 0;\n \tfor(int i=0; i<r; i++) {\n \t\tl = br.readLine();\n \t\tsar = l.split(\" \");\n \t\tint rsum = 0;\n \t\tfor (int j=0; j<c; j++) {\n \t\t\tint v = Integer.parseInt(sar[j]);\n \t\t\trsum += v;\n \t\t\tcsum[j] += v;\n \t\t}\n \t\tout.print(l);\n \t\tout.print(\" \");\n \t\tout.println(rsum);\n \t\tasum += rsum;\n \t}\n for(int i=0; i<c; i++) {\n \tif(i > 0){\n \t\tout.print(\" \");\n \t}\n \tout.print(csum[i]);\n }\n out.print(\" \");\n out.println(asum);\n out.flush();\n }",
"exec",
"{\n \tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n \tPrintWriter out = new PrintWriter(System.out);\n \tString[] sar = br.readLine().split(\" \");\n \tString l;\n \tint r = Integer.parseInt(sar[0]);\n \tint c = Integer.parseInt(sar[1]);\n \tint[] csum = new int[c];\n \tint asum = 0;\n \tfor(int i=0; i<r; i++) {\n \t\tl = br.readLine();\n \t\tsar = l.split(\" \");\n \t\tint rsum = 0;\n \t\tfor (int j=0; j<c; j++) {\n \t\t\tint v = Integer.parseInt(sar[j]);\n \t\t\trsum += v;\n \t\t\tcsum[j] += v;\n \t\t}\n \t\tout.print(l);\n \t\tout.print(\" \");\n \t\tout.println(rsum);\n \t\tasum += rsum;\n \t}\n for(int i=0; i<c; i++) {\n \tif(i > 0){\n \t\tout.print(\" \");\n \t}\n \tout.print(csum[i]);\n }\n out.print(\" \");\n out.println(asum);\n out.flush();\n }",
"BufferedReader br = new BufferedReader(new InputStreamReader(System.in));",
"br",
"new BufferedReader(new InputStreamReader(System.in))",
"PrintWriter out = new PrintWriter(System.out);",
"out",
"new PrintWriter(System.out)",
"String[] sar = br.readLine().split(\" \");",
"sar",
"br.readLine().split(\" \")",
"br.readLine().split",
"br.readLine()",
"br.readLine",
"br",
"\" \"",
"String l;",
"l",
"int r = Integer.parseInt(sar[0]);",
"r",
"Integer.parseInt(sar[0])",
"Integer.parseInt",
"Integer",
"sar[0]",
"sar",
"0",
"int c = Integer.parseInt(sar[1]);",
"c",
"Integer.parseInt(sar[1])",
"Integer.parseInt",
"Integer",
"sar[1]",
"sar",
"1",
"int[] csum = new int[c];",
"csum",
"new int[c]",
"c",
"int asum = 0;",
"asum",
"0",
"for(int i=0; i<r; i++) {\n \t\tl = br.readLine();\n \t\tsar = l.split(\" \");\n \t\tint rsum = 0;\n \t\tfor (int j=0; j<c; j++) {\n \t\t\tint v = Integer.parseInt(sar[j]);\n \t\t\trsum += v;\n \t\t\tcsum[j] += v;\n \t\t}\n \t\tout.print(l);\n \t\tout.print(\" \");\n \t\tout.println(rsum);\n \t\tasum += rsum;\n \t}",
"int i=0;",
"int i=0;",
"i",
"0",
"i<r",
"i",
"r",
"i++",
"i++",
"i",
"{\n \t\tl = br.readLine();\n \t\tsar = l.split(\" \");\n \t\tint rsum = 0;\n \t\tfor (int j=0; j<c; j++) {\n \t\t\tint v = Integer.parseInt(sar[j]);\n \t\t\trsum += v;\n \t\t\tcsum[j] += v;\n \t\t}\n \t\tout.print(l);\n \t\tout.print(\" \");\n \t\tout.println(rsum);\n \t\tasum += rsum;\n \t}",
"{\n \t\tl = br.readLine();\n \t\tsar = l.split(\" \");\n \t\tint rsum = 0;\n \t\tfor (int j=0; j<c; j++) {\n \t\t\tint v = Integer.parseInt(sar[j]);\n \t\t\trsum += v;\n \t\t\tcsum[j] += v;\n \t\t}\n \t\tout.print(l);\n \t\tout.print(\" \");\n \t\tout.println(rsum);\n \t\tasum += rsum;\n \t}",
"l = br.readLine()",
"l",
"br.readLine()",
"br.readLine",
"br",
"sar = l.split(\" \")",
"sar",
"l.split(\" \")",
"l.split",
"l",
"\" \"",
"int rsum = 0;",
"rsum",
"0",
"for (int j=0; j<c; j++) {\n \t\t\tint v = Integer.parseInt(sar[j]);\n \t\t\trsum += v;\n \t\t\tcsum[j] += v;\n \t\t}",
"int j=0;",
"int j=0;",
"j",
"0",
"j<c",
"j",
"c",
"j++",
"j++",
"j",
"{\n \t\t\tint v = Integer.parseInt(sar[j]);\n \t\t\trsum += v;\n \t\t\tcsum[j] += v;\n \t\t}",
"{\n \t\t\tint v = Integer.parseInt(sar[j]);\n \t\t\trsum += v;\n \t\t\tcsum[j] += v;\n \t\t}",
"int v = Integer.parseInt(sar[j]);",
"v",
"Integer.parseInt(sar[j])",
"Integer.parseInt",
"Integer",
"sar[j]",
"sar",
"j",
"rsum += v",
"rsum",
"v",
"csum[j] += v",
"csum[j]",
"csum",
"j",
"v",
"out.print(l)",
"out.print",
"out",
"l",
"out.print(\" \")",
"out.print",
"out",
"\" \"",
"out.println(rsum)",
"out.println",
"out",
"rsum",
"asum += rsum",
"asum",
"rsum",
"for(int i=0; i<c; i++) {\n \tif(i > 0){\n \t\tout.print(\" \");\n \t}\n \tout.print(csum[i]);\n }",
"int i=0;",
"int i=0;",
"i",
"0",
"i<c",
"i",
"c",
"i++",
"i++",
"i",
"{\n \tif(i > 0){\n \t\tout.print(\" \");\n \t}\n \tout.print(csum[i]);\n }",
"{\n \tif(i > 0){\n \t\tout.print(\" \");\n \t}\n \tout.print(csum[i]);\n }",
"if(i > 0){\n \t\tout.print(\" \");\n \t}",
"i > 0",
"i",
"0",
"{\n \t\tout.print(\" \");\n \t}",
"out.print(\" \")",
"out.print",
"out",
"\" \"",
"out.print(csum[i])",
"out.print",
"out",
"csum[i]",
"csum",
"i",
"out.print(\" \")",
"out.print",
"out",
"\" \"",
"out.println(asum)",
"out.println",
"out",
"asum",
"out.flush()",
"out.flush",
"out",
"public static void main(String[] args) throws IOException {\n \tnew Main().exec();\n }",
"main",
"{\n \tnew Main().exec();\n }",
"new Main().exec()",
"new Main().exec",
"new Main()",
"String[] args",
"args",
"public class Main {\n\tpublic static final String EOL = System.getProperty(\"line.separator\");\n public void exec() throws IOException {\n \tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n \tPrintWriter out = new PrintWriter(System.out);\n \tString[] sar = br.readLine().split(\" \");\n \tString l;\n \tint r = Integer.parseInt(sar[0]);\n \tint c = Integer.parseInt(sar[1]);\n \tint[] csum = new int[c];\n \tint asum = 0;\n \tfor(int i=0; i<r; i++) {\n \t\tl = br.readLine();\n \t\tsar = l.split(\" \");\n \t\tint rsum = 0;\n \t\tfor (int j=0; j<c; j++) {\n \t\t\tint v = Integer.parseInt(sar[j]);\n \t\t\trsum += v;\n \t\t\tcsum[j] += v;\n \t\t}\n \t\tout.print(l);\n \t\tout.print(\" \");\n \t\tout.println(rsum);\n \t\tasum += rsum;\n \t}\n for(int i=0; i<c; i++) {\n \tif(i > 0){\n \t\tout.print(\" \");\n \t}\n \tout.print(csum[i]);\n }\n out.print(\" \");\n out.println(asum);\n out.flush();\n }\n \n public static void main(String[] args) throws IOException {\n \tnew Main().exec();\n }\n}",
"public class Main {\n\tpublic static final String EOL = System.getProperty(\"line.separator\");\n public void exec() throws IOException {\n \tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n \tPrintWriter out = new PrintWriter(System.out);\n \tString[] sar = br.readLine().split(\" \");\n \tString l;\n \tint r = Integer.parseInt(sar[0]);\n \tint c = Integer.parseInt(sar[1]);\n \tint[] csum = new int[c];\n \tint asum = 0;\n \tfor(int i=0; i<r; i++) {\n \t\tl = br.readLine();\n \t\tsar = l.split(\" \");\n \t\tint rsum = 0;\n \t\tfor (int j=0; j<c; j++) {\n \t\t\tint v = Integer.parseInt(sar[j]);\n \t\t\trsum += v;\n \t\t\tcsum[j] += v;\n \t\t}\n \t\tout.print(l);\n \t\tout.print(\" \");\n \t\tout.println(rsum);\n \t\tasum += rsum;\n \t}\n for(int i=0; i<c; i++) {\n \tif(i > 0){\n \t\tout.print(\" \");\n \t}\n \tout.print(csum[i]);\n }\n out.print(\" \");\n out.println(asum);\n out.flush();\n }\n \n public static void main(String[] args) throws IOException {\n \tnew Main().exec();\n }\n}",
"Main"
] | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
public class Main {
public static final String EOL = System.getProperty("line.separator");
public void exec() throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
PrintWriter out = new PrintWriter(System.out);
String[] sar = br.readLine().split(" ");
String l;
int r = Integer.parseInt(sar[0]);
int c = Integer.parseInt(sar[1]);
int[] csum = new int[c];
int asum = 0;
for(int i=0; i<r; i++) {
l = br.readLine();
sar = l.split(" ");
int rsum = 0;
for (int j=0; j<c; j++) {
int v = Integer.parseInt(sar[j]);
rsum += v;
csum[j] += v;
}
out.print(l);
out.print(" ");
out.println(rsum);
asum += rsum;
}
for(int i=0; i<c; i++) {
if(i > 0){
out.print(" ");
}
out.print(csum[i]);
}
out.print(" ");
out.println(asum);
out.flush();
}
public static void main(String[] args) throws IOException {
new Main().exec();
}
} |
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
41,
13,
41,
13,
41,
13,
17,
41,
13,
18,
13,
13,
41,
13,
18,
13,
13,
41,
13,
20,
17,
41,
13,
17,
41,
13,
17,
12,
13,
30,
41,
13,
4,
13,
41,
13,
4,
13,
41,
13,
20,
2,
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,
41,
13,
4,
13,
4,
18,
18,
13,
13,
2,
13,
17,
0,
13,
13,
0,
18,
13,
13,
13,
0,
18,
13,
13,
13,
4,
18,
18,
13,
13,
13,
11,
1,
41,
13,
17,
41,
13,
18,
13,
13,
2,
13,
13,
1,
40,
13,
30,
30,
4,
18,
18,
13,
13,
18,
13,
13,
14,
2,
13,
2,
13,
17,
30,
4,
18,
18,
13,
13,
17,
4,
18,
18,
13,
13,
12,
13,
30,
41,
13,
4,
18,
13,
0,
13,
8,
4,
18,
13,
18,
13,
13,
20,
0,
13,
20,
4,
13,
4,
18,
13,
41,
13,
4,
18,
13,
4,
13,
2,
2,
13,
13,
17,
23,
13,
12,
13,
30,
14,
2,
13,
40,
17,
29,
17,
41,
13,
13,
42,
2,
13,
13,
14,
40,
4,
13,
18,
13,
40,
13,
29,
17,
38,
5,
13,
30,
29,
17,
30,
4,
18,
13,
17,
42,
17,
30,
41,
13,
4,
18,
13,
14,
2,
13,
40,
17,
30,
4,
18,
13,
29,
17,
14,
40,
4,
13,
13,
30,
4,
18,
13,
29,
17,
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,
40,
2,
2,
13,
17,
2,
13,
17,
23,
13,
12,
13,
30,
41,
13,
42,
2,
2,
0,
13,
4,
13,
40,
17,
4,
13,
13,
29,
13,
12,
13,
30,
29,
4,
18,
13,
4,
13,
12,
13,
30,
29,
4,
13,
12,
13,
30,
41,
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,
41,
13,
4,
13,
41,
13,
17,
42,
2,
2,
13,
13,
40,
4,
13,
13,
30,
0,
18,
13,
40,
13,
13,
0,
13,
4,
13,
29,
8,
2,
13,
13,
13,
4,
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,
13,
29,
13,
23,
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,
17,
41,
13,
41,
13,
17,
42,
2,
2,
0,
13,
4,
13,
40,
17,
40,
2,
2,
2,
13,
17,
2,
13,
17,
2,
13,
17,
14,
2,
13,
17,
30,
0,
13,
17,
0,
13,
4,
13,
42,
17,
30,
14,
2,
2,
13,
17,
2,
13,
17,
30,
0,
13,
2,
2,
13,
17,
2,
13,
17,
30,
29,
8,
13,
40,
13,
13,
0,
13,
4,
13,
12,
13,
30,
41,
13,
17,
41,
13,
41,
13,
17,
42,
2,
2,
0,
13,
4,
13,
40,
17,
40,
2,
2,
2,
13,
17,
2,
13,
17,
2,
13,
17,
14,
2,
13,
17,
30,
0,
13,
17,
0,
13,
4,
13,
42,
17,
30,
14,
2,
2,
13,
17,
2,
13,
17,
30,
0,
13,
2,
2,
13,
17,
2,
13,
17,
30,
29,
8,
13,
40,
13,
13,
0,
13,
4,
13,
12,
13,
30,
14,
2,
4,
18,
13,
17,
4,
18,
18,
13,
13,
4,
18,
13,
13,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
10,
11
],
[
10,
12
],
[
0,
13
],
[
13,
14
],
[
13,
15
],
[
0,
16
],
[
674,
17
],
[
674,
18
],
[
18,
19
],
[
674,
20
],
[
20,
21
],
[
674,
22
],
[
22,
23
],
[
22,
24
],
[
674,
25
],
[
25,
26
],
[
25,
27
],
[
27,
28
],
[
27,
29
],
[
674,
30
],
[
30,
31
],
[
30,
32
],
[
32,
33
],
[
32,
34
],
[
674,
35
],
[
35,
36
],
[
35,
37
],
[
674,
39
],
[
39,
40
],
[
39,
41
],
[
674,
42
],
[
42,
43
],
[
42,
44
],
[
674,
45
],
[
45,
46
],
[
45,
47
],
[
47,
48
],
[
48,
49
],
[
48,
50
],
[
50,
51
],
[
47,
52
],
[
52,
53
],
[
52,
54
],
[
54,
55
],
[
47,
56
],
[
56,
57
],
[
56,
58
],
[
59,
60
],
[
59,
61
],
[
47,
62
],
[
62,
63
],
[
63,
64
],
[
64,
65
],
[
64,
66
],
[
62,
67
],
[
67,
68
],
[
67,
69
],
[
62,
70
],
[
70,
71
],
[
71,
72
],
[
62,
73
],
[
74,
74
],
[
74,
75
],
[
75,
76
],
[
75,
77
],
[
74,
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
],
[
90,
95
],
[
95,
96
],
[
96,
97
],
[
97,
98
],
[
97,
99
],
[
95,
100
],
[
100,
101
],
[
100,
102
],
[
90,
103
],
[
103,
104
],
[
103,
105
],
[
90,
106
],
[
106,
107
],
[
107,
108
],
[
107,
109
],
[
106,
110
],
[
74,
111
],
[
111,
112
],
[
112,
113
],
[
112,
114
],
[
111,
115
],
[
74,
116
],
[
116,
117
],
[
117,
118
],
[
118,
119
],
[
118,
120
],
[
116,
121
],
[
47,
122
],
[
122,
123
],
[
123,
124
],
[
124,
125
],
[
124,
126
],
[
123,
127
],
[
127,
128
],
[
127,
129
],
[
129,
130
],
[
129,
131
],
[
122,
132
],
[
132,
133
],
[
132,
134
],
[
122,
135
],
[
135,
136
],
[
136,
137
],
[
122,
138
],
[
139,
139
],
[
139,
140
],
[
140,
141
],
[
141,
142
],
[
142,
143
],
[
142,
144
],
[
140,
145
],
[
145,
146
],
[
145,
147
],
[
139,
148
],
[
148,
149
],
[
149,
150
],
[
149,
151
],
[
151,
152
],
[
151,
153
],
[
148,
154
],
[
154,
155
],
[
155,
156
],
[
156,
157
],
[
157,
158
],
[
157,
159
],
[
155,
160
],
[
47,
161
],
[
161,
162
],
[
162,
163
],
[
163,
164
],
[
163,
165
],
[
674,
166
],
[
166,
167
],
[
166,
168
],
[
168,
169
],
[
169,
170
],
[
169,
171
],
[
171,
172
],
[
172,
173
],
[
168,
174
],
[
174,
175
],
[
174,
176
],
[
176,
177
],
[
177,
178
],
[
178,
179
],
[
176,
180
],
[
180,
181
],
[
180,
182
],
[
176,
183
],
[
168,
184
],
[
184,
185
],
[
184,
186
],
[
168,
187
],
[
187,
188
],
[
168,
189
],
[
189,
190
],
[
190,
191
],
[
168,
192
],
[
192,
193
],
[
192,
194
],
[
194,
195
],
[
195,
196
],
[
168,
197
],
[
197,
198
],
[
197,
199
],
[
199,
200
],
[
200,
201
],
[
200,
202
],
[
199,
203
],
[
166,
204
],
[
204,
205
],
[
674,
206
],
[
206,
207
],
[
206,
208
],
[
208,
209
],
[
209,
210
],
[
210,
211
],
[
210,
212
],
[
212,
213
],
[
209,
214
],
[
214,
215
],
[
208,
216
],
[
216,
217
],
[
216,
218
],
[
208,
219
],
[
219,
220
],
[
220,
221
],
[
220,
222
],
[
219,
223
],
[
223,
224
],
[
224,
225
],
[
225,
226
],
[
225,
227
],
[
227,
228
],
[
227,
229
],
[
229,
230
],
[
223,
231
],
[
231,
232
],
[
208,
233
],
[
233,
234
],
[
234,
235
],
[
234,
236
],
[
236,
237
],
[
237,
238
],
[
233,
239
],
[
239,
240
],
[
240,
241
],
[
241,
242
],
[
240,
243
],
[
239,
244
],
[
244,
245
],
[
244,
246
],
[
246,
247
],
[
247,
248
],
[
247,
249
],
[
249,
250
],
[
250,
251
],
[
246,
252
],
[
252,
253
],
[
253,
254
],
[
253,
255
],
[
255,
256
],
[
252,
257
],
[
257,
258
],
[
258,
259
],
[
259,
260
],
[
257,
261
],
[
261,
262
],
[
252,
263
],
[
263,
264
],
[
264,
265
],
[
265,
266
],
[
265,
267
],
[
263,
268
],
[
268,
269
],
[
269,
270
],
[
270,
271
],
[
268,
272
],
[
272,
273
],
[
674,
274
],
[
274,
275
],
[
274,
276
],
[
276,
277
],
[
277,
278
],
[
278,
279
],
[
278,
280
],
[
280,
281
],
[
277,
282
],
[
282,
283
],
[
276,
284
],
[
284,
285
],
[
285,
286
],
[
285,
287
],
[
284,
288
],
[
288,
289
],
[
289,
290
],
[
289,
291
],
[
288,
292
],
[
292,
293
],
[
293,
294
],
[
293,
295
],
[
295,
296
],
[
296,
297
],
[
292,
298
],
[
298,
299
],
[
299,
300
],
[
299,
301
],
[
301,
302
],
[
302,
303
],
[
301,
304
],
[
288,
305
],
[
305,
306
],
[
306,
307
],
[
306,
308
],
[
305,
309
],
[
309,
310
],
[
310,
311
],
[
276,
312
],
[
312,
313
],
[
313,
314
],
[
313,
315
],
[
315,
316
],
[
674,
317
],
[
317,
318
],
[
317,
319
],
[
319,
320
],
[
320,
321
],
[
321,
322
],
[
322,
323
],
[
323,
324
],
[
323,
325
],
[
322,
326
],
[
326,
327
],
[
326,
328
],
[
317,
329
],
[
329,
330
],
[
674,
331
],
[
331,
332
],
[
331,
333
],
[
333,
334
],
[
334,
335
],
[
333,
336
],
[
336,
337
],
[
337,
338
],
[
338,
339
],
[
339,
340
],
[
339,
341
],
[
341,
342
],
[
338,
343
],
[
343,
344
],
[
337,
345
],
[
345,
346
],
[
345,
347
],
[
333,
348
],
[
348,
349
],
[
674,
350
],
[
350,
351
],
[
350,
352
],
[
352,
353
],
[
353,
354
],
[
354,
355
],
[
355,
356
],
[
354,
357
],
[
357,
358
],
[
674,
359
],
[
359,
360
],
[
359,
361
],
[
361,
362
],
[
362,
363
],
[
363,
364
],
[
674,
365
],
[
365,
366
],
[
365,
367
],
[
367,
368
],
[
368,
369
],
[
368,
370
],
[
370,
371
],
[
367,
372
],
[
372,
373
],
[
372,
374
],
[
367,
375
],
[
375,
376
],
[
376,
377
],
[
377,
378
],
[
377,
379
],
[
375,
380
],
[
380,
381
],
[
381,
382
],
[
382,
383
],
[
381,
384
],
[
380,
385
],
[
385,
386
],
[
385,
387
],
[
387,
388
],
[
367,
389
],
[
389,
390
],
[
390,
391
],
[
391,
392
],
[
674,
393
],
[
393,
394
],
[
393,
395
],
[
395,
396
],
[
396,
397
],
[
396,
398
],
[
395,
400
],
[
400,
401
],
[
400,
402
],
[
402,
403
],
[
395,
404
],
[
404,
405
],
[
404,
406
],
[
395,
407
],
[
407,
408
],
[
408,
409
],
[
409,
410
],
[
409,
411
],
[
408,
412
],
[
412,
413
],
[
413,
414
],
[
413,
415
],
[
407,
416
],
[
416,
417
],
[
417,
418
],
[
418,
419
],
[
418,
420
],
[
420,
421
],
[
417,
422
],
[
416,
423
],
[
423,
424
],
[
423,
425
],
[
425,
426
],
[
395,
427
],
[
427,
428
],
[
428,
429
],
[
429,
430
],
[
429,
431
],
[
428,
432
],
[
428,
433
],
[
433,
434
],
[
434,
435
],
[
433,
436
],
[
433,
437
],
[
393,
438
],
[
438,
439
],
[
674,
440
],
[
440,
441
],
[
440,
442
],
[
442,
443
],
[
443,
444
],
[
443,
445
],
[
442,
447
],
[
447,
448
],
[
448,
449
],
[
449,
450
],
[
449,
451
],
[
447,
452
],
[
452,
453
],
[
452,
454
],
[
447,
455
],
[
455,
456
],
[
456,
457
],
[
447,
458
],
[
458,
459
],
[
459,
460
],
[
460,
461
],
[
460,
462
],
[
459,
463
],
[
463,
464
],
[
463,
465
],
[
442,
466
],
[
466,
467
],
[
440,
468
],
[
468,
469
],
[
440,
470
],
[
470,
471
],
[
674,
472
],
[
472,
473
],
[
472,
474
],
[
474,
475
],
[
475,
476
],
[
475,
477
],
[
474,
479
],
[
479,
480
],
[
480,
481
],
[
481,
482
],
[
481,
483
],
[
479,
484
],
[
484,
485
],
[
484,
486
],
[
479,
487
],
[
487,
488
],
[
488,
489
],
[
479,
490
],
[
490,
491
],
[
491,
492
],
[
492,
493
],
[
492,
494
],
[
491,
495
],
[
495,
496
],
[
474,
497
],
[
497,
498
],
[
472,
499
],
[
499,
500
],
[
674,
501
],
[
501,
502
],
[
501,
503
],
[
503,
504
],
[
504,
505
],
[
504,
506
],
[
503,
507
],
[
507,
508
],
[
503,
509
],
[
509,
510
],
[
509,
511
],
[
503,
512
],
[
512,
513
],
[
513,
514
],
[
514,
515
],
[
515,
516
],
[
515,
517
],
[
517,
518
],
[
514,
519
],
[
519,
520
],
[
513,
521
],
[
521,
522
],
[
522,
523
],
[
523,
524
],
[
524,
525
],
[
524,
526
],
[
523,
527
],
[
527,
528
],
[
527,
529
],
[
522,
530
],
[
530,
531
],
[
530,
532
],
[
503,
533
],
[
533,
534
],
[
534,
535
],
[
534,
536
],
[
533,
537
],
[
537,
538
],
[
538,
539
],
[
538,
540
],
[
537,
541
],
[
541,
542
],
[
541,
543
],
[
543,
544
],
[
503,
545
],
[
545,
546
],
[
545,
547
],
[
547,
548
],
[
548,
549
],
[
549,
550
],
[
550,
551
],
[
550,
552
],
[
549,
553
],
[
553,
554
],
[
553,
555
],
[
548,
556
],
[
556,
557
],
[
557,
558
],
[
557,
559
],
[
559,
560
],
[
560,
561
],
[
560,
562
],
[
559,
563
],
[
563,
564
],
[
563,
565
],
[
548,
566
],
[
566,
567
],
[
567,
568
],
[
568,
569
],
[
568,
570
],
[
570,
571
],
[
568,
572
],
[
547,
573
],
[
573,
574
],
[
573,
575
],
[
575,
576
],
[
674,
577
],
[
577,
578
],
[
577,
579
],
[
579,
580
],
[
580,
581
],
[
580,
582
],
[
579,
583
],
[
583,
584
],
[
579,
585
],
[
585,
586
],
[
585,
587
],
[
579,
588
],
[
588,
589
],
[
589,
590
],
[
590,
591
],
[
591,
592
],
[
591,
593
],
[
593,
594
],
[
590,
595
],
[
595,
596
],
[
589,
597
],
[
597,
598
],
[
598,
599
],
[
599,
600
],
[
600,
601
],
[
600,
602
],
[
599,
603
],
[
603,
604
],
[
603,
605
],
[
598,
606
],
[
606,
607
],
[
606,
608
],
[
579,
609
],
[
609,
610
],
[
610,
611
],
[
610,
612
],
[
609,
613
],
[
613,
614
],
[
614,
615
],
[
614,
616
],
[
613,
617
],
[
617,
618
],
[
617,
619
],
[
619,
620
],
[
579,
621
],
[
621,
622
],
[
621,
623
],
[
623,
624
],
[
624,
625
],
[
625,
626
],
[
626,
627
],
[
626,
628
],
[
625,
629
],
[
629,
630
],
[
629,
631
],
[
624,
632
],
[
632,
633
],
[
633,
634
],
[
633,
635
],
[
635,
636
],
[
636,
637
],
[
636,
638
],
[
635,
639
],
[
639,
640
],
[
639,
641
],
[
624,
642
],
[
642,
643
],
[
643,
644
],
[
644,
645
],
[
644,
646
],
[
646,
647
],
[
644,
648
],
[
623,
649
],
[
649,
650
],
[
649,
651
],
[
651,
652
],
[
674,
653
],
[
653,
654
],
[
653,
655
],
[
655,
656
],
[
656,
657
],
[
657,
658
],
[
658,
659
],
[
659,
660
],
[
657,
661
],
[
656,
662
],
[
662,
663
],
[
663,
664
],
[
664,
665
],
[
664,
666
],
[
662,
667
],
[
667,
668
],
[
668,
669
],
[
667,
670
],
[
653,
671
],
[
671,
672
],
[
0,
673
],
[
673,
674
],
[
673,
675
]
] | [
"import java.io.ByteArrayInputStream;\nimport java.io.IOException;\nimport java.io.InputStream;\nimport java.io.PrintWriter;\nimport java.util.*;\n\npublic class Main {\n\n static InputStream is;\n static PrintWriter out;\n static String INPUT = \"\";\n\n final int INF = Integer.MAX_VALUE;\n final int MIN = Integer.MIN_VALUE;\n\n static void solve() {\n int r = ni();\n int c = ni();\n int[] sums = new int[c + 1];\n for (int i = 0; i < r; i++) {\n int sum = 0;\n for (int j = 0; j < c; j++) {\n int n = ni();\n System.out.print(n + \" \");\n sum += n;\n sums[j] += n;\n }\n sums[c] += sum;\n System.out.println(sum);\n }\n for (int i = 0, l = sums.length; i < l; i++) {\n System.out.print(sums[i]);\n if (i != l - 1) {\n System.out.print(\" \");\n }\n }\n System.out.println();\n }\n\n public static void main(String[] args) throws Exception {\n long S = System.currentTimeMillis();\n is = INPUT.isEmpty() ? System.in : new ByteArrayInputStream(INPUT.getBytes());\n out = new PrintWriter(System.out);\n\n solve();\n out.flush();\n long G = System.currentTimeMillis();\n tr(G - S + \"ms\");\n }\n\n private static boolean eof() {\n if (lenbuf == -1) return true;\n int lptr = ptrbuf;\n while (lptr < lenbuf) if (!isSpaceChar(inbuf[lptr++])) return false;\n\n try {\n is.mark(1000);\n while (true) {\n int b = is.read();\n if (b == -1) {\n is.reset();\n return true;\n } else if (!isSpaceChar(b)) {\n is.reset();\n return false;\n }\n }\n } catch (IOException e) {\n return true;\n }\n }\n\n private static byte[] inbuf = new byte[1024];\n static int lenbuf = 0, ptrbuf = 0;\n\n private static int readByte() {\n if (lenbuf == -1) throw new InputMismatchException();\n if (ptrbuf >= lenbuf) {\n ptrbuf = 0;\n try {\n lenbuf = is.read(inbuf);\n } catch (IOException e) {\n throw new InputMismatchException();\n }\n if (lenbuf <= 0) return -1;\n }\n return inbuf[ptrbuf++];\n }\n\n private static boolean isSpaceChar(int c) {\n return !(c >= 33 && c <= 126);\n }\n\n //\tprivate static boolean isSpaceChar(int c) { return !(c >= 32 && c <= 126); }\n private static int skip() {\n int b;\n while ((b = readByte()) != -1 && isSpaceChar(b)) ;\n return b;\n }\n\n private static double nd() {\n return Double.parseDouble(ns());\n }\n\n private static char nc() {\n return (char) skip();\n }\n\n private static String ns() {\n int b = skip();\n StringBuilder sb = new StringBuilder();\n while (!(isSpaceChar(b))) {\n sb.appendCodePoint(b);\n b = readByte();\n }\n return sb.toString();\n }\n\n private static char[] ns(int n) {\n char[] buf = new char[n];\n int b = skip(), p = 0;\n while (p < n && !(isSpaceChar(b))) {\n buf[p++] = (char) b;\n b = readByte();\n }\n return n == p ? buf : Arrays.copyOf(buf, p);\n }\n\n private static char[][] nm(int n, int m) {\n char[][] map = new char[n][];\n for (int i = 0; i < n; i++) map[i] = ns(m);\n return map;\n }\n\n private static int[] na(int n) {\n int[] a = new int[n];\n for (int i = 0; i < n; i++) a[i] = ni();\n return a;\n }\n\n private static int ni() {\n int num = 0, b;\n boolean minus = false;\n while ((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-')) ;\n if (b == '-') {\n minus = true;\n b = readByte();\n }\n\n while (true) {\n if (b >= '0' && b <= '9') {\n num = num * 10 + (b - '0');\n } else {\n return minus ? -num : num;\n }\n b = readByte();\n }\n }\n\n private static long nl() {\n long num = 0;\n int b;\n boolean minus = false;\n while ((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-')) ;\n if (b == '-') {\n minus = true;\n b = readByte();\n }\n\n while (true) {\n if (b >= '0' && b <= '9') {\n num = num * 10 + (b - '0');\n } else {\n return minus ? -num : num;\n }\n b = readByte();\n }\n }\n\n private static void tr(Object... o) {\n if (INPUT.length() != 0) System.out.println(Arrays.deepToString(o));\n }\n}",
"import java.io.ByteArrayInputStream;",
"ByteArrayInputStream",
"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.*;",
"util.*",
"java",
"public class Main {\n\n static InputStream is;\n static PrintWriter out;\n static String INPUT = \"\";\n\n final int INF = Integer.MAX_VALUE;\n final int MIN = Integer.MIN_VALUE;\n\n static void solve() {\n int r = ni();\n int c = ni();\n int[] sums = new int[c + 1];\n for (int i = 0; i < r; i++) {\n int sum = 0;\n for (int j = 0; j < c; j++) {\n int n = ni();\n System.out.print(n + \" \");\n sum += n;\n sums[j] += n;\n }\n sums[c] += sum;\n System.out.println(sum);\n }\n for (int i = 0, l = sums.length; i < l; i++) {\n System.out.print(sums[i]);\n if (i != l - 1) {\n System.out.print(\" \");\n }\n }\n System.out.println();\n }\n\n public static void main(String[] args) throws Exception {\n long S = System.currentTimeMillis();\n is = INPUT.isEmpty() ? System.in : new ByteArrayInputStream(INPUT.getBytes());\n out = new PrintWriter(System.out);\n\n solve();\n out.flush();\n long G = System.currentTimeMillis();\n tr(G - S + \"ms\");\n }\n\n private static boolean eof() {\n if (lenbuf == -1) return true;\n int lptr = ptrbuf;\n while (lptr < lenbuf) if (!isSpaceChar(inbuf[lptr++])) return false;\n\n try {\n is.mark(1000);\n while (true) {\n int b = is.read();\n if (b == -1) {\n is.reset();\n return true;\n } else if (!isSpaceChar(b)) {\n is.reset();\n return false;\n }\n }\n } catch (IOException e) {\n return true;\n }\n }\n\n private static byte[] inbuf = new byte[1024];\n static int lenbuf = 0, ptrbuf = 0;\n\n private static int readByte() {\n if (lenbuf == -1) throw new InputMismatchException();\n if (ptrbuf >= lenbuf) {\n ptrbuf = 0;\n try {\n lenbuf = is.read(inbuf);\n } catch (IOException e) {\n throw new InputMismatchException();\n }\n if (lenbuf <= 0) return -1;\n }\n return inbuf[ptrbuf++];\n }\n\n private static boolean isSpaceChar(int c) {\n return !(c >= 33 && c <= 126);\n }\n\n //\tprivate static boolean isSpaceChar(int c) { return !(c >= 32 && c <= 126); }\n private static int skip() {\n int b;\n while ((b = readByte()) != -1 && isSpaceChar(b)) ;\n return b;\n }\n\n private static double nd() {\n return Double.parseDouble(ns());\n }\n\n private static char nc() {\n return (char) skip();\n }\n\n private static String ns() {\n int b = skip();\n StringBuilder sb = new StringBuilder();\n while (!(isSpaceChar(b))) {\n sb.appendCodePoint(b);\n b = readByte();\n }\n return sb.toString();\n }\n\n private static char[] ns(int n) {\n char[] buf = new char[n];\n int b = skip(), p = 0;\n while (p < n && !(isSpaceChar(b))) {\n buf[p++] = (char) b;\n b = readByte();\n }\n return n == p ? buf : Arrays.copyOf(buf, p);\n }\n\n private static char[][] nm(int n, int m) {\n char[][] map = new char[n][];\n for (int i = 0; i < n; i++) map[i] = ns(m);\n return map;\n }\n\n private static int[] na(int n) {\n int[] a = new int[n];\n for (int i = 0; i < n; i++) a[i] = ni();\n return a;\n }\n\n private static int ni() {\n int num = 0, b;\n boolean minus = false;\n while ((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-')) ;\n if (b == '-') {\n minus = true;\n b = readByte();\n }\n\n while (true) {\n if (b >= '0' && b <= '9') {\n num = num * 10 + (b - '0');\n } else {\n return minus ? -num : num;\n }\n b = readByte();\n }\n }\n\n private static long nl() {\n long num = 0;\n int b;\n boolean minus = false;\n while ((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-')) ;\n if (b == '-') {\n minus = true;\n b = readByte();\n }\n\n while (true) {\n if (b >= '0' && b <= '9') {\n num = num * 10 + (b - '0');\n } else {\n return minus ? -num : num;\n }\n b = readByte();\n }\n }\n\n private static void tr(Object... o) {\n if (INPUT.length() != 0) System.out.println(Arrays.deepToString(o));\n }\n}",
"Main",
"static InputStream is;",
"is",
"static PrintWriter out;",
"out",
"static String INPUT = \"\";",
"INPUT",
"\"\"",
"final int INF = Integer.MAX_VALUE;",
"INF",
"Integer.MAX_VALUE",
"Integer",
"Integer.MAX_VALUE",
"final int MIN = Integer.MIN_VALUE;",
"MIN",
"Integer.MIN_VALUE",
"Integer",
"Integer.MIN_VALUE",
"private static byte[] inbuf = new byte[1024];",
"inbuf",
"new byte[1024]",
"1024",
"static int lenbuf = 0",
"lenbuf",
"0",
"ptrbuf = 0;",
"ptrbuf",
"0",
"static void solve() {\n int r = ni();\n int c = ni();\n int[] sums = new int[c + 1];\n for (int i = 0; i < r; i++) {\n int sum = 0;\n for (int j = 0; j < c; j++) {\n int n = ni();\n System.out.print(n + \" \");\n sum += n;\n sums[j] += n;\n }\n sums[c] += sum;\n System.out.println(sum);\n }\n for (int i = 0, l = sums.length; i < l; i++) {\n System.out.print(sums[i]);\n if (i != l - 1) {\n System.out.print(\" \");\n }\n }\n System.out.println();\n }",
"solve",
"{\n int r = ni();\n int c = ni();\n int[] sums = new int[c + 1];\n for (int i = 0; i < r; i++) {\n int sum = 0;\n for (int j = 0; j < c; j++) {\n int n = ni();\n System.out.print(n + \" \");\n sum += n;\n sums[j] += n;\n }\n sums[c] += sum;\n System.out.println(sum);\n }\n for (int i = 0, l = sums.length; i < l; i++) {\n System.out.print(sums[i]);\n if (i != l - 1) {\n System.out.print(\" \");\n }\n }\n System.out.println();\n }",
"int r = ni();",
"r",
"ni()",
"ni",
"int c = ni();",
"c",
"ni()",
"ni",
"int[] sums = new int[c + 1];",
"sums",
"new int[c + 1]",
"c + 1",
"c",
"1",
"for (int i = 0; i < r; i++) {\n int sum = 0;\n for (int j = 0; j < c; j++) {\n int n = ni();\n System.out.print(n + \" \");\n sum += n;\n sums[j] += n;\n }\n sums[c] += sum;\n System.out.println(sum);\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < r",
"i",
"r",
"i++",
"i++",
"i",
"{\n int sum = 0;\n for (int j = 0; j < c; j++) {\n int n = ni();\n System.out.print(n + \" \");\n sum += n;\n sums[j] += n;\n }\n sums[c] += sum;\n System.out.println(sum);\n }",
"{\n int sum = 0;\n for (int j = 0; j < c; j++) {\n int n = ni();\n System.out.print(n + \" \");\n sum += n;\n sums[j] += n;\n }\n sums[c] += sum;\n System.out.println(sum);\n }",
"int sum = 0;",
"sum",
"0",
"for (int j = 0; j < c; j++) {\n int n = ni();\n System.out.print(n + \" \");\n sum += n;\n sums[j] += n;\n }",
"int j = 0;",
"int j = 0;",
"j",
"0",
"j < c",
"j",
"c",
"j++",
"j++",
"j",
"{\n int n = ni();\n System.out.print(n + \" \");\n sum += n;\n sums[j] += n;\n }",
"{\n int n = ni();\n System.out.print(n + \" \");\n sum += n;\n sums[j] += n;\n }",
"int n = ni();",
"n",
"ni()",
"ni",
"System.out.print(n + \" \")",
"System.out.print",
"System.out",
"System",
"System.out",
"n + \" \"",
"n",
"\" \"",
"sum += n",
"sum",
"n",
"sums[j] += n",
"sums[j]",
"sums",
"j",
"n",
"sums[c] += sum",
"sums[c]",
"sums",
"c",
"sum",
"System.out.println(sum)",
"System.out.println",
"System.out",
"System",
"System.out",
"sum",
"for (int i = 0, l = sums.length; i < l; i++) {\n System.out.print(sums[i]);\n if (i != l - 1) {\n System.out.print(\" \");\n }\n }",
"int i = 0, l = sums.length;",
"int i = 0",
"i",
"0",
"l = sums.length;",
"l",
"sums.length",
"sums",
"sums.length",
"i < l",
"i",
"l",
"i++",
"i++",
"i",
"{\n System.out.print(sums[i]);\n if (i != l - 1) {\n System.out.print(\" \");\n }\n }",
"{\n System.out.print(sums[i]);\n if (i != l - 1) {\n System.out.print(\" \");\n }\n }",
"System.out.print(sums[i])",
"System.out.print",
"System.out",
"System",
"System.out",
"sums[i]",
"sums",
"i",
"if (i != l - 1) {\n System.out.print(\" \");\n }",
"i != l - 1",
"i",
"l - 1",
"l",
"1",
"{\n System.out.print(\" \");\n }",
"System.out.print(\" \")",
"System.out.print",
"System.out",
"System",
"System.out",
"\" \"",
"System.out.println()",
"System.out.println",
"System.out",
"System",
"System.out",
"public static void main(String[] args) throws Exception {\n long S = System.currentTimeMillis();\n is = INPUT.isEmpty() ? System.in : new ByteArrayInputStream(INPUT.getBytes());\n out = new PrintWriter(System.out);\n\n solve();\n out.flush();\n long G = System.currentTimeMillis();\n tr(G - S + \"ms\");\n }",
"main",
"{\n long S = System.currentTimeMillis();\n is = INPUT.isEmpty() ? System.in : new ByteArrayInputStream(INPUT.getBytes());\n out = new PrintWriter(System.out);\n\n solve();\n out.flush();\n long G = System.currentTimeMillis();\n tr(G - S + \"ms\");\n }",
"long S = System.currentTimeMillis();",
"S",
"System.currentTimeMillis()",
"System.currentTimeMillis",
"System",
"is = INPUT.isEmpty() ? System.in : new ByteArrayInputStream(INPUT.getBytes())",
"is",
"INPUT.isEmpty() ? System.in : new ByteArrayInputStream(INPUT.getBytes())",
"INPUT.isEmpty()",
"INPUT.isEmpty",
"INPUT",
"System.in",
"System",
"System.in",
"new ByteArrayInputStream(INPUT.getBytes())",
"out = new PrintWriter(System.out)",
"out",
"new PrintWriter(System.out)",
"solve()",
"solve",
"out.flush()",
"out.flush",
"out",
"long G = System.currentTimeMillis();",
"G",
"System.currentTimeMillis()",
"System.currentTimeMillis",
"System",
"tr(G - S + \"ms\")",
"tr",
"G - S + \"ms\"",
"G - S",
"G",
"S",
"\"ms\"",
"String[] args",
"args",
"private static boolean eof() {\n if (lenbuf == -1) return true;\n int lptr = ptrbuf;\n while (lptr < lenbuf) if (!isSpaceChar(inbuf[lptr++])) return false;\n\n try {\n is.mark(1000);\n while (true) {\n int b = is.read();\n if (b == -1) {\n is.reset();\n return true;\n } else if (!isSpaceChar(b)) {\n is.reset();\n return false;\n }\n }\n } catch (IOException e) {\n return true;\n }\n }",
"eof",
"{\n if (lenbuf == -1) return true;\n int lptr = ptrbuf;\n while (lptr < lenbuf) if (!isSpaceChar(inbuf[lptr++])) return false;\n\n try {\n is.mark(1000);\n while (true) {\n int b = is.read();\n if (b == -1) {\n is.reset();\n return true;\n } else if (!isSpaceChar(b)) {\n is.reset();\n return false;\n }\n }\n } catch (IOException e) {\n return true;\n }\n }",
"if (lenbuf == -1) return true;",
"lenbuf == -1",
"lenbuf",
"-1",
"1",
"return true;",
"true",
"int lptr = ptrbuf;",
"lptr",
"ptrbuf",
"while (lptr < lenbuf) if (!isSpaceChar(inbuf[lptr++])) return false;",
"lptr < lenbuf",
"lptr",
"lenbuf",
"if (!isSpaceChar(inbuf[lptr++])) return false;",
"!isSpaceChar(inbuf[lptr++])",
"isSpaceChar(inbuf[lptr++])",
"isSpaceChar",
"inbuf[lptr++]",
"inbuf",
"lptr++",
"lptr",
"return false;",
"false",
"try {\n is.mark(1000);\n while (true) {\n int b = is.read();\n if (b == -1) {\n is.reset();\n return true;\n } else if (!isSpaceChar(b)) {\n is.reset();\n return false;\n }\n }\n } catch (IOException e) {\n return true;\n }",
"catch (IOException e) {\n return true;\n }",
"IOException e",
"{\n return true;\n }",
"return true;",
"true",
"{\n is.mark(1000);\n while (true) {\n int b = is.read();\n if (b == -1) {\n is.reset();\n return true;\n } else if (!isSpaceChar(b)) {\n is.reset();\n return false;\n }\n }\n }",
"is.mark(1000)",
"is.mark",
"is",
"1000",
"while (true) {\n int b = is.read();\n if (b == -1) {\n is.reset();\n return true;\n } else if (!isSpaceChar(b)) {\n is.reset();\n return false;\n }\n }",
"true",
"{\n int b = is.read();\n if (b == -1) {\n is.reset();\n return true;\n } else if (!isSpaceChar(b)) {\n is.reset();\n return false;\n }\n }",
"int b = is.read();",
"b",
"is.read()",
"is.read",
"is",
"if (b == -1) {\n is.reset();\n return true;\n } else if (!isSpaceChar(b)) {\n is.reset();\n return false;\n }",
"b == -1",
"b",
"-1",
"1",
"{\n is.reset();\n return true;\n }",
"is.reset()",
"is.reset",
"is",
"return true;",
"true",
"if (!isSpaceChar(b)) {\n is.reset();\n return false;\n }",
"!isSpaceChar(b)",
"isSpaceChar(b)",
"isSpaceChar",
"b",
"{\n is.reset();\n return false;\n }",
"is.reset()",
"is.reset",
"is",
"return false;",
"false",
"private static int readByte() {\n if (lenbuf == -1) throw new InputMismatchException();\n if (ptrbuf >= lenbuf) {\n ptrbuf = 0;\n try {\n lenbuf = is.read(inbuf);\n } catch (IOException e) {\n throw new InputMismatchException();\n }\n if (lenbuf <= 0) return -1;\n }\n return inbuf[ptrbuf++];\n }",
"readByte",
"{\n if (lenbuf == -1) throw new InputMismatchException();\n if (ptrbuf >= lenbuf) {\n ptrbuf = 0;\n try {\n lenbuf = is.read(inbuf);\n } catch (IOException e) {\n throw new InputMismatchException();\n }\n if (lenbuf <= 0) return -1;\n }\n return inbuf[ptrbuf++];\n }",
"if (lenbuf == -1) throw new InputMismatchException();",
"lenbuf == -1",
"lenbuf",
"-1",
"1",
"throw new InputMismatchException();",
"new InputMismatchException()",
"if (ptrbuf >= lenbuf) {\n ptrbuf = 0;\n try {\n lenbuf = is.read(inbuf);\n } catch (IOException e) {\n throw new InputMismatchException();\n }\n if (lenbuf <= 0) return -1;\n }",
"ptrbuf >= lenbuf",
"ptrbuf",
"lenbuf",
"{\n ptrbuf = 0;\n try {\n lenbuf = is.read(inbuf);\n } catch (IOException e) {\n throw new InputMismatchException();\n }\n if (lenbuf <= 0) return -1;\n }",
"ptrbuf = 0",
"ptrbuf",
"0",
"try {\n lenbuf = is.read(inbuf);\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 lenbuf = is.read(inbuf);\n }",
"lenbuf = is.read(inbuf)",
"lenbuf",
"is.read(inbuf)",
"is.read",
"is",
"inbuf",
"if (lenbuf <= 0) return -1;",
"lenbuf <= 0",
"lenbuf",
"0",
"return -1;",
"-1",
"1",
"return inbuf[ptrbuf++];",
"inbuf[ptrbuf++]",
"inbuf",
"ptrbuf++",
"ptrbuf",
"private static boolean isSpaceChar(int c) {\n return !(c >= 33 && c <= 126);\n }",
"isSpaceChar",
"{\n return !(c >= 33 && c <= 126);\n }",
"return !(c >= 33 && c <= 126);",
"!(c >= 33 && c <= 126)",
"(c >= 33 && c <= 126)",
"c >= 33",
"c",
"33",
"c <= 126",
"c",
"126",
"int c",
"c",
"//\tprivate static boolean isSpaceChar(int c) { return !(c >= 32 && c <= 126); }\n private static int skip() {\n int b;\n while ((b = readByte()) != -1 && isSpaceChar(b)) ;\n return b;\n }",
"skip",
"{\n int b;\n while ((b = readByte()) != -1 && isSpaceChar(b)) ;\n return b;\n }",
"int b;",
"b",
"while ((b = readByte()) != -1 && isSpaceChar(b)) ;",
"(b = readByte()) != -1 && isSpaceChar(b)",
"(b = readByte()) != -1",
"(b = readByte())",
"b",
"readByte()",
"readByte",
"-1",
"1",
"isSpaceChar(b)",
"isSpaceChar",
"b",
"return b;",
"b",
"private static double nd() {\n return Double.parseDouble(ns());\n }",
"nd",
"{\n return Double.parseDouble(ns());\n }",
"return Double.parseDouble(ns());",
"Double.parseDouble(ns())",
"Double.parseDouble",
"Double",
"ns()",
"ns",
"private static char nc() {\n return (char) skip();\n }",
"nc",
"{\n return (char) skip();\n }",
"return (char) skip();",
"(char) skip()",
"skip",
"private static String ns() {\n int b = skip();\n StringBuilder sb = new StringBuilder();\n while (!(isSpaceChar(b))) {\n sb.appendCodePoint(b);\n b = readByte();\n }\n return sb.toString();\n }",
"ns",
"{\n int b = skip();\n StringBuilder sb = new StringBuilder();\n while (!(isSpaceChar(b))) {\n sb.appendCodePoint(b);\n b = readByte();\n }\n return sb.toString();\n }",
"int b = skip();",
"b",
"skip()",
"skip",
"StringBuilder sb = new StringBuilder();",
"sb",
"new StringBuilder()",
"while (!(isSpaceChar(b))) {\n sb.appendCodePoint(b);\n b = readByte();\n }",
"!(isSpaceChar(b))",
"(isSpaceChar(b))",
"isSpaceChar",
"b",
"{\n sb.appendCodePoint(b);\n b = readByte();\n }",
"sb.appendCodePoint(b)",
"sb.appendCodePoint",
"sb",
"b",
"b = readByte()",
"b",
"readByte()",
"readByte",
"return sb.toString();",
"sb.toString()",
"sb.toString",
"sb",
"private static char[] ns(int n) {\n char[] buf = new char[n];\n int b = skip(), p = 0;\n while (p < n && !(isSpaceChar(b))) {\n buf[p++] = (char) b;\n b = readByte();\n }\n return n == p ? buf : Arrays.copyOf(buf, p);\n }",
"ns",
"{\n char[] buf = new char[n];\n int b = skip(), p = 0;\n while (p < n && !(isSpaceChar(b))) {\n buf[p++] = (char) b;\n b = readByte();\n }\n return n == p ? buf : Arrays.copyOf(buf, p);\n }",
"char[] buf = new char[n];",
"buf",
"new char[n]",
"n",
"int b = skip()",
"b",
"skip()",
"skip",
"p = 0;",
"p",
"0",
"while (p < n && !(isSpaceChar(b))) {\n buf[p++] = (char) b;\n b = readByte();\n }",
"p < n && !(isSpaceChar(b))",
"p < n",
"p",
"n",
"!(isSpaceChar(b))",
"(isSpaceChar(b))",
"isSpaceChar",
"b",
"{\n buf[p++] = (char) b;\n b = readByte();\n }",
"buf[p++] = (char) b",
"buf[p++]",
"buf",
"p++",
"p",
"(char) b",
"b = readByte()",
"b",
"readByte()",
"readByte",
"return n == p ? buf : Arrays.copyOf(buf, p);",
"n == p ? buf : Arrays.copyOf(buf, p)",
"n == p",
"n",
"p",
"buf",
"Arrays.copyOf(buf, p)",
"Arrays.copyOf",
"Arrays",
"buf",
"p",
"int n",
"n",
"private static char[][] nm(int n, int m) {\n char[][] map = new char[n][];\n for (int i = 0; i < n; i++) map[i] = ns(m);\n return map;\n }",
"nm",
"{\n char[][] map = new char[n][];\n for (int i = 0; i < n; i++) map[i] = ns(m);\n return map;\n }",
"char[][] map = new char[n][];",
"map",
"new char[n][]",
"n",
"for (int i = 0; i < n; i++) map[i] = ns(m);",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < n",
"i",
"n",
"i++",
"i++",
"i",
"map[i] = ns(m);",
"map[i] = ns(m)",
"map[i]",
"map",
"i",
"ns(m)",
"ns",
"m",
"return map;",
"map",
"int n",
"n",
"int m",
"m",
"private static int[] na(int n) {\n int[] a = new int[n];\n for (int i = 0; i < n; i++) a[i] = ni();\n return a;\n }",
"na",
"{\n int[] a = new int[n];\n for (int i = 0; i < n; i++) a[i] = ni();\n return a;\n }",
"int[] a = new int[n];",
"a",
"new int[n]",
"n",
"for (int i = 0; i < n; i++) a[i] = ni();",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < n",
"i",
"n",
"i++",
"i++",
"i",
"a[i] = ni();",
"a[i] = ni()",
"a[i]",
"a",
"i",
"ni()",
"ni",
"return a;",
"a",
"int n",
"n",
"private static int ni() {\n int num = 0, b;\n boolean minus = false;\n while ((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-')) ;\n if (b == '-') {\n minus = true;\n b = readByte();\n }\n\n while (true) {\n if (b >= '0' && b <= '9') {\n num = num * 10 + (b - '0');\n } else {\n return minus ? -num : num;\n }\n b = readByte();\n }\n }",
"ni",
"{\n int num = 0, b;\n boolean minus = false;\n while ((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-')) ;\n if (b == '-') {\n minus = true;\n b = readByte();\n }\n\n while (true) {\n if (b >= '0' && b <= '9') {\n num = num * 10 + (b - '0');\n } else {\n return minus ? -num : num;\n }\n b = readByte();\n }\n }",
"int num = 0",
"num",
"0",
"b;",
"b",
"boolean minus = false;",
"minus",
"false",
"while ((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-')) ;",
"(b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-')",
"(b = readByte()) != -1",
"(b = readByte())",
"b",
"readByte()",
"readByte",
"-1",
"1",
"!((b >= '0' && b <= '9') || b == '-')",
"((b >= '0' && b <= '9') || b == '-')",
"(b >= '0' && b <= '9')",
"b >= '0'",
"b",
"'0'",
"b <= '9'",
"b",
"'9'",
"b == '-'",
"b",
"'-'",
"if (b == '-') {\n minus = true;\n b = readByte();\n }",
"b == '-'",
"b",
"'-'",
"{\n minus = true;\n b = readByte();\n }",
"minus = true",
"minus",
"true",
"b = readByte()",
"b",
"readByte()",
"readByte",
"while (true) {\n if (b >= '0' && b <= '9') {\n num = num * 10 + (b - '0');\n } else {\n return minus ? -num : num;\n }\n b = readByte();\n }",
"true",
"{\n if (b >= '0' && b <= '9') {\n num = num * 10 + (b - '0');\n } else {\n return minus ? -num : num;\n }\n b = readByte();\n }",
"if (b >= '0' && b <= '9') {\n num = num * 10 + (b - '0');\n } else {\n return minus ? -num : num;\n }",
"b >= '0' && b <= '9'",
"b >= '0'",
"b",
"'0'",
"b <= '9'",
"b",
"'9'",
"{\n num = num * 10 + (b - '0');\n }",
"num = num * 10 + (b - '0')",
"num",
"num * 10 + (b - '0')",
"num * 10",
"num",
"10",
"(b - '0')",
"b",
"'0'",
"{\n return minus ? -num : num;\n }",
"return minus ? -num : num;",
"minus ? -num : num",
"minus",
"-num",
"num",
"num",
"b = readByte()",
"b",
"readByte()",
"readByte",
"private static long nl() {\n long num = 0;\n int b;\n boolean minus = false;\n while ((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-')) ;\n if (b == '-') {\n minus = true;\n b = readByte();\n }\n\n while (true) {\n if (b >= '0' && b <= '9') {\n num = num * 10 + (b - '0');\n } else {\n return minus ? -num : num;\n }\n b = readByte();\n }\n }",
"nl",
"{\n long num = 0;\n int b;\n boolean minus = false;\n while ((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-')) ;\n if (b == '-') {\n minus = true;\n b = readByte();\n }\n\n while (true) {\n if (b >= '0' && b <= '9') {\n num = num * 10 + (b - '0');\n } else {\n return minus ? -num : num;\n }\n b = readByte();\n }\n }",
"long num = 0;",
"num",
"0",
"int b;",
"b",
"boolean minus = false;",
"minus",
"false",
"while ((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-')) ;",
"(b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-')",
"(b = readByte()) != -1",
"(b = readByte())",
"b",
"readByte()",
"readByte",
"-1",
"1",
"!((b >= '0' && b <= '9') || b == '-')",
"((b >= '0' && b <= '9') || b == '-')",
"(b >= '0' && b <= '9')",
"b >= '0'",
"b",
"'0'",
"b <= '9'",
"b",
"'9'",
"b == '-'",
"b",
"'-'",
"if (b == '-') {\n minus = true;\n b = readByte();\n }",
"b == '-'",
"b",
"'-'",
"{\n minus = true;\n b = readByte();\n }",
"minus = true",
"minus",
"true",
"b = readByte()",
"b",
"readByte()",
"readByte",
"while (true) {\n if (b >= '0' && b <= '9') {\n num = num * 10 + (b - '0');\n } else {\n return minus ? -num : num;\n }\n b = readByte();\n }",
"true",
"{\n if (b >= '0' && b <= '9') {\n num = num * 10 + (b - '0');\n } else {\n return minus ? -num : num;\n }\n b = readByte();\n }",
"if (b >= '0' && b <= '9') {\n num = num * 10 + (b - '0');\n } else {\n return minus ? -num : num;\n }",
"b >= '0' && b <= '9'",
"b >= '0'",
"b",
"'0'",
"b <= '9'",
"b",
"'9'",
"{\n num = num * 10 + (b - '0');\n }",
"num = num * 10 + (b - '0')",
"num",
"num * 10 + (b - '0')",
"num * 10",
"num",
"10",
"(b - '0')",
"b",
"'0'",
"{\n return minus ? -num : num;\n }",
"return minus ? -num : num;",
"minus ? -num : num",
"minus",
"-num",
"num",
"num",
"b = readByte()",
"b",
"readByte()",
"readByte",
"private static void tr(Object... o) {\n if (INPUT.length() != 0) System.out.println(Arrays.deepToString(o));\n }",
"tr",
"{\n if (INPUT.length() != 0) System.out.println(Arrays.deepToString(o));\n }",
"if (INPUT.length() != 0) System.out.println(Arrays.deepToString(o));",
"INPUT.length() != 0",
"INPUT.length()",
"INPUT.length",
"INPUT",
"0",
"System.out.println(Arrays.deepToString(o))",
"System.out.println",
"System.out",
"System",
"System.out",
"Arrays.deepToString(o)",
"Arrays.deepToString",
"Arrays",
"o",
"Object... o",
"o",
"public class Main {\n\n static InputStream is;\n static PrintWriter out;\n static String INPUT = \"\";\n\n final int INF = Integer.MAX_VALUE;\n final int MIN = Integer.MIN_VALUE;\n\n static void solve() {\n int r = ni();\n int c = ni();\n int[] sums = new int[c + 1];\n for (int i = 0; i < r; i++) {\n int sum = 0;\n for (int j = 0; j < c; j++) {\n int n = ni();\n System.out.print(n + \" \");\n sum += n;\n sums[j] += n;\n }\n sums[c] += sum;\n System.out.println(sum);\n }\n for (int i = 0, l = sums.length; i < l; i++) {\n System.out.print(sums[i]);\n if (i != l - 1) {\n System.out.print(\" \");\n }\n }\n System.out.println();\n }\n\n public static void main(String[] args) throws Exception {\n long S = System.currentTimeMillis();\n is = INPUT.isEmpty() ? System.in : new ByteArrayInputStream(INPUT.getBytes());\n out = new PrintWriter(System.out);\n\n solve();\n out.flush();\n long G = System.currentTimeMillis();\n tr(G - S + \"ms\");\n }\n\n private static boolean eof() {\n if (lenbuf == -1) return true;\n int lptr = ptrbuf;\n while (lptr < lenbuf) if (!isSpaceChar(inbuf[lptr++])) return false;\n\n try {\n is.mark(1000);\n while (true) {\n int b = is.read();\n if (b == -1) {\n is.reset();\n return true;\n } else if (!isSpaceChar(b)) {\n is.reset();\n return false;\n }\n }\n } catch (IOException e) {\n return true;\n }\n }\n\n private static byte[] inbuf = new byte[1024];\n static int lenbuf = 0, ptrbuf = 0;\n\n private static int readByte() {\n if (lenbuf == -1) throw new InputMismatchException();\n if (ptrbuf >= lenbuf) {\n ptrbuf = 0;\n try {\n lenbuf = is.read(inbuf);\n } catch (IOException e) {\n throw new InputMismatchException();\n }\n if (lenbuf <= 0) return -1;\n }\n return inbuf[ptrbuf++];\n }\n\n private static boolean isSpaceChar(int c) {\n return !(c >= 33 && c <= 126);\n }\n\n //\tprivate static boolean isSpaceChar(int c) { return !(c >= 32 && c <= 126); }\n private static int skip() {\n int b;\n while ((b = readByte()) != -1 && isSpaceChar(b)) ;\n return b;\n }\n\n private static double nd() {\n return Double.parseDouble(ns());\n }\n\n private static char nc() {\n return (char) skip();\n }\n\n private static String ns() {\n int b = skip();\n StringBuilder sb = new StringBuilder();\n while (!(isSpaceChar(b))) {\n sb.appendCodePoint(b);\n b = readByte();\n }\n return sb.toString();\n }\n\n private static char[] ns(int n) {\n char[] buf = new char[n];\n int b = skip(), p = 0;\n while (p < n && !(isSpaceChar(b))) {\n buf[p++] = (char) b;\n b = readByte();\n }\n return n == p ? buf : Arrays.copyOf(buf, p);\n }\n\n private static char[][] nm(int n, int m) {\n char[][] map = new char[n][];\n for (int i = 0; i < n; i++) map[i] = ns(m);\n return map;\n }\n\n private static int[] na(int n) {\n int[] a = new int[n];\n for (int i = 0; i < n; i++) a[i] = ni();\n return a;\n }\n\n private static int ni() {\n int num = 0, b;\n boolean minus = false;\n while ((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-')) ;\n if (b == '-') {\n minus = true;\n b = readByte();\n }\n\n while (true) {\n if (b >= '0' && b <= '9') {\n num = num * 10 + (b - '0');\n } else {\n return minus ? -num : num;\n }\n b = readByte();\n }\n }\n\n private static long nl() {\n long num = 0;\n int b;\n boolean minus = false;\n while ((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-')) ;\n if (b == '-') {\n minus = true;\n b = readByte();\n }\n\n while (true) {\n if (b >= '0' && b <= '9') {\n num = num * 10 + (b - '0');\n } else {\n return minus ? -num : num;\n }\n b = readByte();\n }\n }\n\n private static void tr(Object... o) {\n if (INPUT.length() != 0) System.out.println(Arrays.deepToString(o));\n }\n}",
"public class Main {\n\n static InputStream is;\n static PrintWriter out;\n static String INPUT = \"\";\n\n final int INF = Integer.MAX_VALUE;\n final int MIN = Integer.MIN_VALUE;\n\n static void solve() {\n int r = ni();\n int c = ni();\n int[] sums = new int[c + 1];\n for (int i = 0; i < r; i++) {\n int sum = 0;\n for (int j = 0; j < c; j++) {\n int n = ni();\n System.out.print(n + \" \");\n sum += n;\n sums[j] += n;\n }\n sums[c] += sum;\n System.out.println(sum);\n }\n for (int i = 0, l = sums.length; i < l; i++) {\n System.out.print(sums[i]);\n if (i != l - 1) {\n System.out.print(\" \");\n }\n }\n System.out.println();\n }\n\n public static void main(String[] args) throws Exception {\n long S = System.currentTimeMillis();\n is = INPUT.isEmpty() ? System.in : new ByteArrayInputStream(INPUT.getBytes());\n out = new PrintWriter(System.out);\n\n solve();\n out.flush();\n long G = System.currentTimeMillis();\n tr(G - S + \"ms\");\n }\n\n private static boolean eof() {\n if (lenbuf == -1) return true;\n int lptr = ptrbuf;\n while (lptr < lenbuf) if (!isSpaceChar(inbuf[lptr++])) return false;\n\n try {\n is.mark(1000);\n while (true) {\n int b = is.read();\n if (b == -1) {\n is.reset();\n return true;\n } else if (!isSpaceChar(b)) {\n is.reset();\n return false;\n }\n }\n } catch (IOException e) {\n return true;\n }\n }\n\n private static byte[] inbuf = new byte[1024];\n static int lenbuf = 0, ptrbuf = 0;\n\n private static int readByte() {\n if (lenbuf == -1) throw new InputMismatchException();\n if (ptrbuf >= lenbuf) {\n ptrbuf = 0;\n try {\n lenbuf = is.read(inbuf);\n } catch (IOException e) {\n throw new InputMismatchException();\n }\n if (lenbuf <= 0) return -1;\n }\n return inbuf[ptrbuf++];\n }\n\n private static boolean isSpaceChar(int c) {\n return !(c >= 33 && c <= 126);\n }\n\n //\tprivate static boolean isSpaceChar(int c) { return !(c >= 32 && c <= 126); }\n private static int skip() {\n int b;\n while ((b = readByte()) != -1 && isSpaceChar(b)) ;\n return b;\n }\n\n private static double nd() {\n return Double.parseDouble(ns());\n }\n\n private static char nc() {\n return (char) skip();\n }\n\n private static String ns() {\n int b = skip();\n StringBuilder sb = new StringBuilder();\n while (!(isSpaceChar(b))) {\n sb.appendCodePoint(b);\n b = readByte();\n }\n return sb.toString();\n }\n\n private static char[] ns(int n) {\n char[] buf = new char[n];\n int b = skip(), p = 0;\n while (p < n && !(isSpaceChar(b))) {\n buf[p++] = (char) b;\n b = readByte();\n }\n return n == p ? buf : Arrays.copyOf(buf, p);\n }\n\n private static char[][] nm(int n, int m) {\n char[][] map = new char[n][];\n for (int i = 0; i < n; i++) map[i] = ns(m);\n return map;\n }\n\n private static int[] na(int n) {\n int[] a = new int[n];\n for (int i = 0; i < n; i++) a[i] = ni();\n return a;\n }\n\n private static int ni() {\n int num = 0, b;\n boolean minus = false;\n while ((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-')) ;\n if (b == '-') {\n minus = true;\n b = readByte();\n }\n\n while (true) {\n if (b >= '0' && b <= '9') {\n num = num * 10 + (b - '0');\n } else {\n return minus ? -num : num;\n }\n b = readByte();\n }\n }\n\n private static long nl() {\n long num = 0;\n int b;\n boolean minus = false;\n while ((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-')) ;\n if (b == '-') {\n minus = true;\n b = readByte();\n }\n\n while (true) {\n if (b >= '0' && b <= '9') {\n num = num * 10 + (b - '0');\n } else {\n return minus ? -num : num;\n }\n b = readByte();\n }\n }\n\n private static void tr(Object... o) {\n if (INPUT.length() != 0) System.out.println(Arrays.deepToString(o));\n }\n}",
"Main"
] | import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.*;
public class Main {
static InputStream is;
static PrintWriter out;
static String INPUT = "";
final int INF = Integer.MAX_VALUE;
final int MIN = Integer.MIN_VALUE;
static void solve() {
int r = ni();
int c = ni();
int[] sums = new int[c + 1];
for (int i = 0; i < r; i++) {
int sum = 0;
for (int j = 0; j < c; j++) {
int n = ni();
System.out.print(n + " ");
sum += n;
sums[j] += n;
}
sums[c] += sum;
System.out.println(sum);
}
for (int i = 0, l = sums.length; i < l; i++) {
System.out.print(sums[i]);
if (i != l - 1) {
System.out.print(" ");
}
}
System.out.println();
}
public static void main(String[] args) throws Exception {
long S = System.currentTimeMillis();
is = INPUT.isEmpty() ? System.in : new ByteArrayInputStream(INPUT.getBytes());
out = new PrintWriter(System.out);
solve();
out.flush();
long G = System.currentTimeMillis();
tr(G - S + "ms");
}
private static boolean eof() {
if (lenbuf == -1) return true;
int lptr = ptrbuf;
while (lptr < lenbuf) if (!isSpaceChar(inbuf[lptr++])) return false;
try {
is.mark(1000);
while (true) {
int b = is.read();
if (b == -1) {
is.reset();
return true;
} else if (!isSpaceChar(b)) {
is.reset();
return false;
}
}
} catch (IOException e) {
return true;
}
}
private static byte[] inbuf = new byte[1024];
static int lenbuf = 0, ptrbuf = 0;
private static int readByte() {
if (lenbuf == -1) throw new InputMismatchException();
if (ptrbuf >= lenbuf) {
ptrbuf = 0;
try {
lenbuf = is.read(inbuf);
} catch (IOException e) {
throw new InputMismatchException();
}
if (lenbuf <= 0) return -1;
}
return inbuf[ptrbuf++];
}
private static boolean isSpaceChar(int c) {
return !(c >= 33 && c <= 126);
}
// private static boolean isSpaceChar(int c) { return !(c >= 32 && c <= 126); }
private static int skip() {
int b;
while ((b = readByte()) != -1 && isSpaceChar(b)) ;
return b;
}
private static double nd() {
return Double.parseDouble(ns());
}
private static char nc() {
return (char) skip();
}
private static String ns() {
int b = skip();
StringBuilder sb = new StringBuilder();
while (!(isSpaceChar(b))) {
sb.appendCodePoint(b);
b = readByte();
}
return sb.toString();
}
private static char[] ns(int n) {
char[] buf = new char[n];
int b = skip(), p = 0;
while (p < n && !(isSpaceChar(b))) {
buf[p++] = (char) b;
b = readByte();
}
return n == p ? buf : Arrays.copyOf(buf, p);
}
private static char[][] nm(int n, int m) {
char[][] map = new char[n][];
for (int i = 0; i < n; i++) map[i] = ns(m);
return map;
}
private static int[] na(int n) {
int[] a = new int[n];
for (int i = 0; i < n; i++) a[i] = ni();
return a;
}
private static int ni() {
int num = 0, b;
boolean minus = false;
while ((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-')) ;
if (b == '-') {
minus = true;
b = readByte();
}
while (true) {
if (b >= '0' && b <= '9') {
num = num * 10 + (b - '0');
} else {
return minus ? -num : num;
}
b = readByte();
}
}
private static long nl() {
long num = 0;
int b;
boolean minus = false;
while ((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-')) ;
if (b == '-') {
minus = true;
b = readByte();
}
while (true) {
if (b >= '0' && b <= '9') {
num = num * 10 + (b - '0');
} else {
return minus ? -num : num;
}
b = readByte();
}
}
private static void tr(Object... o) {
if (INPUT.length() != 0) System.out.println(Arrays.deepToString(o));
}
} |
[
7,
15,
13,
17,
6,
13,
41,
13,
20,
41,
13,
41,
13,
41,
13,
12,
13,
30,
4,
13,
4,
13,
23,
13,
12,
13,
30,
0,
13,
4,
18,
13,
0,
13,
4,
18,
13,
0,
13,
20,
2,
13,
17,
2,
13,
17,
12,
13,
30,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
41,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
4,
18,
13,
0,
18,
18,
13,
13,
13,
13,
0,
18,
18,
13,
13,
13,
13,
4,
18,
18,
13,
13,
17,
13,
4,
18,
18,
13,
13,
18,
18,
13,
13,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
18,
18,
13,
13,
13,
18,
18,
13,
13,
13,
4,
18,
18,
13,
13,
17,
18,
18,
13,
13,
13,
4,
18,
18,
13,
13,
18,
18,
13,
13,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
159,
5
],
[
159,
6
],
[
6,
7
],
[
6,
8
],
[
159,
9
],
[
9,
10
],
[
159,
11
],
[
11,
12
],
[
159,
13
],
[
13,
14
],
[
159,
15
],
[
15,
16
],
[
15,
17
],
[
17,
18
],
[
18,
19
],
[
17,
20
],
[
20,
21
],
[
15,
22
],
[
22,
23
],
[
159,
24
],
[
24,
25
],
[
24,
26
],
[
26,
27
],
[
27,
28
],
[
27,
29
],
[
29,
30
],
[
30,
31
],
[
26,
32
],
[
32,
33
],
[
32,
34
],
[
34,
35
],
[
35,
36
],
[
26,
37
],
[
37,
38
],
[
37,
39
],
[
40,
41
],
[
40,
42
],
[
43,
44
],
[
43,
45
],
[
159,
46
],
[
46,
47
],
[
46,
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
],
[
61,
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
],
[
77,
79
],
[
79,
80
],
[
80,
81
],
[
76,
82
],
[
82,
83
],
[
83,
84
],
[
84,
85
],
[
84,
86
],
[
83,
87
],
[
82,
88
],
[
76,
89
],
[
89,
90
],
[
90,
91
],
[
91,
92
],
[
91,
93
],
[
90,
94
],
[
89,
95
],
[
76,
96
],
[
96,
97
],
[
97,
98
],
[
98,
99
],
[
98,
100
],
[
96,
101
],
[
96,
102
],
[
61,
103
],
[
103,
104
],
[
104,
105
],
[
105,
106
],
[
105,
107
],
[
103,
108
],
[
108,
109
],
[
109,
110
],
[
109,
111
],
[
108,
112
],
[
48,
113
],
[
113,
114
],
[
114,
115
],
[
115,
116
],
[
115,
117
],
[
113,
118
],
[
118,
119
],
[
118,
120
],
[
113,
121
],
[
121,
122
],
[
122,
123
],
[
113,
124
],
[
125,
125
],
[
125,
126
],
[
126,
127
],
[
127,
128
],
[
128,
129
],
[
128,
130
],
[
127,
131
],
[
126,
132
],
[
132,
133
],
[
133,
134
],
[
133,
135
],
[
132,
136
],
[
125,
137
],
[
137,
138
],
[
138,
139
],
[
139,
140
],
[
139,
141
],
[
137,
142
],
[
137,
143
],
[
143,
144
],
[
144,
145
],
[
144,
146
],
[
143,
147
],
[
48,
148
],
[
148,
149
],
[
149,
150
],
[
150,
151
],
[
150,
152
],
[
148,
153
],
[
153,
154
],
[
154,
155
],
[
154,
156
],
[
153,
157
],
[
0,
158
],
[
158,
159
],
[
158,
160
]
] | [
"import java.util.Scanner;\n\npublic class Main{\n\n\tstatic Scanner s=new Scanner(System.in);\n\n\tpublic static void main(String __[]){\n\t\tinput();\n\t\tsolve();\n\t}\n\n\tstatic int r, c, sheet[][];\n\n\tprivate static void input(){\n\t\tr=s.nextInt();\n\t\tc=s.nextInt();\n\t\tsheet=new int[r+1][c+1];\n\t}\n\n\tprivate static void solve(){\n\t\tfor(int i=0; i<r; i++){\n\t\t\tint buf;\n\t\t\tfor(int j=0; j<c; j++){\n\t\t\t\tbuf=s.nextInt();\n\t\t\t\tsheet[i][c]+=buf;\n\t\t\t\tsheet[r][j]+=buf;\n\t\t\t\tSystem.out.printf(\"%d \",buf);\n\t\t\t}\n\t\t\tSystem.out.println(sheet[i][c]);\n\t\t}\n\t\tfor(int j=0; j<c; j++){\n\t\t\tsheet[r][c]+=sheet[r][j];\n\t\t\tSystem.out.printf(\"%d \",sheet[r][j]);\n\t\t}\n\t\tSystem.out.println(sheet[r][c]);\n\t}\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main{\n\n\tstatic Scanner s=new Scanner(System.in);\n\n\tpublic static void main(String __[]){\n\t\tinput();\n\t\tsolve();\n\t}\n\n\tstatic int r, c, sheet[][];\n\n\tprivate static void input(){\n\t\tr=s.nextInt();\n\t\tc=s.nextInt();\n\t\tsheet=new int[r+1][c+1];\n\t}\n\n\tprivate static void solve(){\n\t\tfor(int i=0; i<r; i++){\n\t\t\tint buf;\n\t\t\tfor(int j=0; j<c; j++){\n\t\t\t\tbuf=s.nextInt();\n\t\t\t\tsheet[i][c]+=buf;\n\t\t\t\tsheet[r][j]+=buf;\n\t\t\t\tSystem.out.printf(\"%d \",buf);\n\t\t\t}\n\t\t\tSystem.out.println(sheet[i][c]);\n\t\t}\n\t\tfor(int j=0; j<c; j++){\n\t\t\tsheet[r][c]+=sheet[r][j];\n\t\t\tSystem.out.printf(\"%d \",sheet[r][j]);\n\t\t}\n\t\tSystem.out.println(sheet[r][c]);\n\t}\n}",
"Main",
"static Scanner s=new Scanner(System.in);",
"s",
"new Scanner(System.in)",
"static int r",
"r",
"c",
"c",
"sheet[][];",
"sheet",
"public static void main(String __[]){\n\t\tinput();\n\t\tsolve();\n\t}",
"main",
"{\n\t\tinput();\n\t\tsolve();\n\t}",
"input()",
"input",
"solve()",
"solve",
"String __[]",
"__",
"private static void input(){\n\t\tr=s.nextInt();\n\t\tc=s.nextInt();\n\t\tsheet=new int[r+1][c+1];\n\t}",
"input",
"{\n\t\tr=s.nextInt();\n\t\tc=s.nextInt();\n\t\tsheet=new int[r+1][c+1];\n\t}",
"r=s.nextInt()",
"r",
"s.nextInt()",
"s.nextInt",
"s",
"c=s.nextInt()",
"c",
"s.nextInt()",
"s.nextInt",
"s",
"sheet=new int[r+1][c+1]",
"sheet",
"new int[r+1][c+1]",
"r+1",
"r",
"1",
"c+1",
"c",
"1",
"private static void solve(){\n\t\tfor(int i=0; i<r; i++){\n\t\t\tint buf;\n\t\t\tfor(int j=0; j<c; j++){\n\t\t\t\tbuf=s.nextInt();\n\t\t\t\tsheet[i][c]+=buf;\n\t\t\t\tsheet[r][j]+=buf;\n\t\t\t\tSystem.out.printf(\"%d \",buf);\n\t\t\t}\n\t\t\tSystem.out.println(sheet[i][c]);\n\t\t}\n\t\tfor(int j=0; j<c; j++){\n\t\t\tsheet[r][c]+=sheet[r][j];\n\t\t\tSystem.out.printf(\"%d \",sheet[r][j]);\n\t\t}\n\t\tSystem.out.println(sheet[r][c]);\n\t}",
"solve",
"{\n\t\tfor(int i=0; i<r; i++){\n\t\t\tint buf;\n\t\t\tfor(int j=0; j<c; j++){\n\t\t\t\tbuf=s.nextInt();\n\t\t\t\tsheet[i][c]+=buf;\n\t\t\t\tsheet[r][j]+=buf;\n\t\t\t\tSystem.out.printf(\"%d \",buf);\n\t\t\t}\n\t\t\tSystem.out.println(sheet[i][c]);\n\t\t}\n\t\tfor(int j=0; j<c; j++){\n\t\t\tsheet[r][c]+=sheet[r][j];\n\t\t\tSystem.out.printf(\"%d \",sheet[r][j]);\n\t\t}\n\t\tSystem.out.println(sheet[r][c]);\n\t}",
"for(int i=0; i<r; i++){\n\t\t\tint buf;\n\t\t\tfor(int j=0; j<c; j++){\n\t\t\t\tbuf=s.nextInt();\n\t\t\t\tsheet[i][c]+=buf;\n\t\t\t\tsheet[r][j]+=buf;\n\t\t\t\tSystem.out.printf(\"%d \",buf);\n\t\t\t}\n\t\t\tSystem.out.println(sheet[i][c]);\n\t\t}",
"int i=0;",
"int i=0;",
"i",
"0",
"i<r",
"i",
"r",
"i++",
"i++",
"i",
"{\n\t\t\tint buf;\n\t\t\tfor(int j=0; j<c; j++){\n\t\t\t\tbuf=s.nextInt();\n\t\t\t\tsheet[i][c]+=buf;\n\t\t\t\tsheet[r][j]+=buf;\n\t\t\t\tSystem.out.printf(\"%d \",buf);\n\t\t\t}\n\t\t\tSystem.out.println(sheet[i][c]);\n\t\t}",
"{\n\t\t\tint buf;\n\t\t\tfor(int j=0; j<c; j++){\n\t\t\t\tbuf=s.nextInt();\n\t\t\t\tsheet[i][c]+=buf;\n\t\t\t\tsheet[r][j]+=buf;\n\t\t\t\tSystem.out.printf(\"%d \",buf);\n\t\t\t}\n\t\t\tSystem.out.println(sheet[i][c]);\n\t\t}",
"int buf;",
"buf",
"for(int j=0; j<c; j++){\n\t\t\t\tbuf=s.nextInt();\n\t\t\t\tsheet[i][c]+=buf;\n\t\t\t\tsheet[r][j]+=buf;\n\t\t\t\tSystem.out.printf(\"%d \",buf);\n\t\t\t}",
"int j=0;",
"int j=0;",
"j",
"0",
"j<c",
"j",
"c",
"j++",
"j++",
"j",
"{\n\t\t\t\tbuf=s.nextInt();\n\t\t\t\tsheet[i][c]+=buf;\n\t\t\t\tsheet[r][j]+=buf;\n\t\t\t\tSystem.out.printf(\"%d \",buf);\n\t\t\t}",
"{\n\t\t\t\tbuf=s.nextInt();\n\t\t\t\tsheet[i][c]+=buf;\n\t\t\t\tsheet[r][j]+=buf;\n\t\t\t\tSystem.out.printf(\"%d \",buf);\n\t\t\t}",
"buf=s.nextInt()",
"buf",
"s.nextInt()",
"s.nextInt",
"s",
"sheet[i][c]+=buf",
"sheet[i][c]",
"sheet[i]",
"sheet",
"i",
"c",
"buf",
"sheet[r][j]+=buf",
"sheet[r][j]",
"sheet[r]",
"sheet",
"r",
"j",
"buf",
"System.out.printf(\"%d \",buf)",
"System.out.printf",
"System.out",
"System",
"System.out",
"\"%d \"",
"buf",
"System.out.println(sheet[i][c])",
"System.out.println",
"System.out",
"System",
"System.out",
"sheet[i][c]",
"sheet[i]",
"sheet",
"i",
"c",
"for(int j=0; j<c; j++){\n\t\t\tsheet[r][c]+=sheet[r][j];\n\t\t\tSystem.out.printf(\"%d \",sheet[r][j]);\n\t\t}",
"int j=0;",
"int j=0;",
"j",
"0",
"j<c",
"j",
"c",
"j++",
"j++",
"j",
"{\n\t\t\tsheet[r][c]+=sheet[r][j];\n\t\t\tSystem.out.printf(\"%d \",sheet[r][j]);\n\t\t}",
"{\n\t\t\tsheet[r][c]+=sheet[r][j];\n\t\t\tSystem.out.printf(\"%d \",sheet[r][j]);\n\t\t}",
"sheet[r][c]+=sheet[r][j]",
"sheet[r][c]",
"sheet[r]",
"sheet",
"r",
"c",
"sheet[r][j]",
"sheet[r]",
"sheet",
"r",
"j",
"System.out.printf(\"%d \",sheet[r][j])",
"System.out.printf",
"System.out",
"System",
"System.out",
"\"%d \"",
"sheet[r][j]",
"sheet[r]",
"sheet",
"r",
"j",
"System.out.println(sheet[r][c])",
"System.out.println",
"System.out",
"System",
"System.out",
"sheet[r][c]",
"sheet[r]",
"sheet",
"r",
"c",
"public class Main{\n\n\tstatic Scanner s=new Scanner(System.in);\n\n\tpublic static void main(String __[]){\n\t\tinput();\n\t\tsolve();\n\t}\n\n\tstatic int r, c, sheet[][];\n\n\tprivate static void input(){\n\t\tr=s.nextInt();\n\t\tc=s.nextInt();\n\t\tsheet=new int[r+1][c+1];\n\t}\n\n\tprivate static void solve(){\n\t\tfor(int i=0; i<r; i++){\n\t\t\tint buf;\n\t\t\tfor(int j=0; j<c; j++){\n\t\t\t\tbuf=s.nextInt();\n\t\t\t\tsheet[i][c]+=buf;\n\t\t\t\tsheet[r][j]+=buf;\n\t\t\t\tSystem.out.printf(\"%d \",buf);\n\t\t\t}\n\t\t\tSystem.out.println(sheet[i][c]);\n\t\t}\n\t\tfor(int j=0; j<c; j++){\n\t\t\tsheet[r][c]+=sheet[r][j];\n\t\t\tSystem.out.printf(\"%d \",sheet[r][j]);\n\t\t}\n\t\tSystem.out.println(sheet[r][c]);\n\t}\n}",
"public class Main{\n\n\tstatic Scanner s=new Scanner(System.in);\n\n\tpublic static void main(String __[]){\n\t\tinput();\n\t\tsolve();\n\t}\n\n\tstatic int r, c, sheet[][];\n\n\tprivate static void input(){\n\t\tr=s.nextInt();\n\t\tc=s.nextInt();\n\t\tsheet=new int[r+1][c+1];\n\t}\n\n\tprivate static void solve(){\n\t\tfor(int i=0; i<r; i++){\n\t\t\tint buf;\n\t\t\tfor(int j=0; j<c; j++){\n\t\t\t\tbuf=s.nextInt();\n\t\t\t\tsheet[i][c]+=buf;\n\t\t\t\tsheet[r][j]+=buf;\n\t\t\t\tSystem.out.printf(\"%d \",buf);\n\t\t\t}\n\t\t\tSystem.out.println(sheet[i][c]);\n\t\t}\n\t\tfor(int j=0; j<c; j++){\n\t\t\tsheet[r][c]+=sheet[r][j];\n\t\t\tSystem.out.printf(\"%d \",sheet[r][j]);\n\t\t}\n\t\tSystem.out.println(sheet[r][c]);\n\t}\n}",
"Main"
] | import java.util.Scanner;
public class Main{
static Scanner s=new Scanner(System.in);
public static void main(String __[]){
input();
solve();
}
static int r, c, sheet[][];
private static void input(){
r=s.nextInt();
c=s.nextInt();
sheet=new int[r+1][c+1];
}
private static void solve(){
for(int i=0; i<r; i++){
int buf;
for(int j=0; j<c; j++){
buf=s.nextInt();
sheet[i][c]+=buf;
sheet[r][j]+=buf;
System.out.printf("%d ",buf);
}
System.out.println(sheet[i][c]);
}
for(int j=0; j<c; j++){
sheet[r][c]+=sheet[r][j];
System.out.printf("%d ",sheet[r][j]);
}
System.out.println(sheet[r][c]);
}
} |
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
4,
18,
13,
17,
41,
13,
4,
18,
13,
18,
13,
17,
41,
13,
4,
18,
13,
18,
13,
17,
41,
13,
20,
2,
13,
17,
2,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
4,
18,
4,
18,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
18,
18,
13,
13,
13,
4,
18,
13,
18,
13,
13,
0,
18,
18,
13,
13,
13,
18,
18,
13,
13,
13,
0,
18,
18,
13,
13,
13,
18,
18,
13,
13,
13,
0,
18,
18,
13,
13,
13,
18,
18,
13,
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,
14,
2,
13,
17,
30,
4,
18,
18,
13,
13,
17,
4,
18,
18,
13,
13,
18,
18,
13,
13,
13,
4,
18,
18,
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
],
[
185,
11
],
[
185,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
15,
17
],
[
14,
18
],
[
18,
19
],
[
18,
20
],
[
20,
21
],
[
21,
22
],
[
22,
23
],
[
23,
24
],
[
20,
25
],
[
14,
26
],
[
26,
27
],
[
26,
28
],
[
28,
29
],
[
29,
30
],
[
28,
31
],
[
31,
32
],
[
31,
33
],
[
14,
34
],
[
34,
35
],
[
34,
36
],
[
36,
37
],
[
37,
38
],
[
36,
39
],
[
39,
40
],
[
39,
41
],
[
14,
42
],
[
42,
43
],
[
42,
44
],
[
45,
46
],
[
45,
47
],
[
48,
49
],
[
48,
50
],
[
14,
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
],
[
64,
66
],
[
66,
67
],
[
67,
68
],
[
68,
69
],
[
69,
70
],
[
66,
71
],
[
63,
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
],
[
86,
90
],
[
85,
91
],
[
91,
92
],
[
92,
93
],
[
91,
94
],
[
94,
95
],
[
94,
96
],
[
84,
97
],
[
97,
98
],
[
98,
99
],
[
99,
100
],
[
99,
101
],
[
98,
102
],
[
97,
103
],
[
103,
104
],
[
104,
105
],
[
104,
106
],
[
103,
107
],
[
84,
108
],
[
108,
109
],
[
109,
110
],
[
110,
111
],
[
110,
112
],
[
109,
113
],
[
108,
114
],
[
114,
115
],
[
115,
116
],
[
115,
117
],
[
114,
118
],
[
84,
119
],
[
119,
120
],
[
120,
121
],
[
121,
122
],
[
121,
123
],
[
120,
124
],
[
119,
125
],
[
125,
126
],
[
126,
127
],
[
126,
128
],
[
125,
129
],
[
14,
130
],
[
130,
131
],
[
131,
132
],
[
132,
133
],
[
132,
134
],
[
130,
135
],
[
135,
136
],
[
135,
137
],
[
130,
138
],
[
138,
139
],
[
139,
140
],
[
130,
141
],
[
142,
142
],
[
142,
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
],
[
157,
158
],
[
157,
159
],
[
156,
160
],
[
160,
161
],
[
161,
162
],
[
162,
163
],
[
163,
164
],
[
163,
165
],
[
161,
166
],
[
155,
167
],
[
167,
168
],
[
168,
169
],
[
169,
170
],
[
169,
171
],
[
167,
172
],
[
172,
173
],
[
173,
174
],
[
173,
175
],
[
172,
176
],
[
142,
177
],
[
177,
178
],
[
178,
179
],
[
179,
180
],
[
179,
181
],
[
12,
182
],
[
182,
183
],
[
0,
184
],
[
184,
185
],
[
184,
186
]
] | [
"import java.io.BufferedReader;\nimport java.io.IOException;\nimport java.io.InputStreamReader;\n\npublic class Main {\n\n\tpublic static void main(String[] args) throws IOException {\n\t\t// TODO ?????????????????????????????????????????????\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\t\t\n\t\tString[] tmpArray = br.readLine().split(\" \");\n\t\tint r = Integer.parseInt(tmpArray[0]);\n\t\tint c = Integer.parseInt(tmpArray[1]);\n\t\t\n\t\tint[][] result = new int[r+1][c+1];\n\t\t\n\t\tfor(int i = 0; i < r ; i++){\n\t\t\ttmpArray = br.readLine().split(\" \");\n\t\t\tfor(int j = 0; j < c ; j++){\n\t\t\t\tresult[i][j] = Integer.parseInt(tmpArray[j]);\n\t\t\t\tresult[i][c] += result[i][j];\n\t\t\t\tresult[r][c] += result[i][j];\n\t\t\t\tresult[r][j] += result[i][j];\n\t\t\t}\n\t\t}\n\t\t\n\t\t\n\t\tfor(int i = 0; i <= r ; i++){\n\t\t\tfor(int j = 0; j <= c ; j++){\n\t\t\t\tif(j != 0){\n\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t}\n\t\t\t\tSystem.out.print(result[i][j]);\n\t\t\t}\n\t\t\tSystem.out.println();\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",
"public class Main {\n\n\tpublic static void main(String[] args) throws IOException {\n\t\t// TODO ?????????????????????????????????????????????\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\t\t\n\t\tString[] tmpArray = br.readLine().split(\" \");\n\t\tint r = Integer.parseInt(tmpArray[0]);\n\t\tint c = Integer.parseInt(tmpArray[1]);\n\t\t\n\t\tint[][] result = new int[r+1][c+1];\n\t\t\n\t\tfor(int i = 0; i < r ; i++){\n\t\t\ttmpArray = br.readLine().split(\" \");\n\t\t\tfor(int j = 0; j < c ; j++){\n\t\t\t\tresult[i][j] = Integer.parseInt(tmpArray[j]);\n\t\t\t\tresult[i][c] += result[i][j];\n\t\t\t\tresult[r][c] += result[i][j];\n\t\t\t\tresult[r][j] += result[i][j];\n\t\t\t}\n\t\t}\n\t\t\n\t\t\n\t\tfor(int i = 0; i <= r ; i++){\n\t\t\tfor(int j = 0; j <= c ; j++){\n\t\t\t\tif(j != 0){\n\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t}\n\t\t\t\tSystem.out.print(result[i][j]);\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}\n\t}\n\n}",
"Main",
"public static void main(String[] args) throws IOException {\n\t\t// TODO ?????????????????????????????????????????????\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\t\t\n\t\tString[] tmpArray = br.readLine().split(\" \");\n\t\tint r = Integer.parseInt(tmpArray[0]);\n\t\tint c = Integer.parseInt(tmpArray[1]);\n\t\t\n\t\tint[][] result = new int[r+1][c+1];\n\t\t\n\t\tfor(int i = 0; i < r ; i++){\n\t\t\ttmpArray = br.readLine().split(\" \");\n\t\t\tfor(int j = 0; j < c ; j++){\n\t\t\t\tresult[i][j] = Integer.parseInt(tmpArray[j]);\n\t\t\t\tresult[i][c] += result[i][j];\n\t\t\t\tresult[r][c] += result[i][j];\n\t\t\t\tresult[r][j] += result[i][j];\n\t\t\t}\n\t\t}\n\t\t\n\t\t\n\t\tfor(int i = 0; i <= r ; i++){\n\t\t\tfor(int j = 0; j <= c ; j++){\n\t\t\t\tif(j != 0){\n\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t}\n\t\t\t\tSystem.out.print(result[i][j]);\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}\n\t}",
"main",
"{\n\t\t// TODO ?????????????????????????????????????????????\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\t\t\n\t\tString[] tmpArray = br.readLine().split(\" \");\n\t\tint r = Integer.parseInt(tmpArray[0]);\n\t\tint c = Integer.parseInt(tmpArray[1]);\n\t\t\n\t\tint[][] result = new int[r+1][c+1];\n\t\t\n\t\tfor(int i = 0; i < r ; i++){\n\t\t\ttmpArray = br.readLine().split(\" \");\n\t\t\tfor(int j = 0; j < c ; j++){\n\t\t\t\tresult[i][j] = Integer.parseInt(tmpArray[j]);\n\t\t\t\tresult[i][c] += result[i][j];\n\t\t\t\tresult[r][c] += result[i][j];\n\t\t\t\tresult[r][j] += result[i][j];\n\t\t\t}\n\t\t}\n\t\t\n\t\t\n\t\tfor(int i = 0; i <= r ; i++){\n\t\t\tfor(int j = 0; j <= c ; j++){\n\t\t\t\tif(j != 0){\n\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t}\n\t\t\t\tSystem.out.print(result[i][j]);\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}\n\t}",
"BufferedReader br = new BufferedReader(new InputStreamReader(System.in));",
"br",
"new BufferedReader(new InputStreamReader(System.in))",
"String[] tmpArray = br.readLine().split(\" \");",
"tmpArray",
"br.readLine().split(\" \")",
"br.readLine().split",
"br.readLine()",
"br.readLine",
"br",
"\" \"",
"int r = Integer.parseInt(tmpArray[0]);",
"r",
"Integer.parseInt(tmpArray[0])",
"Integer.parseInt",
"Integer",
"tmpArray[0]",
"tmpArray",
"0",
"int c = Integer.parseInt(tmpArray[1]);",
"c",
"Integer.parseInt(tmpArray[1])",
"Integer.parseInt",
"Integer",
"tmpArray[1]",
"tmpArray",
"1",
"int[][] result = new int[r+1][c+1];",
"result",
"new int[r+1][c+1]",
"r+1",
"r",
"1",
"c+1",
"c",
"1",
"for(int i = 0; i < r ; i++){\n\t\t\ttmpArray = br.readLine().split(\" \");\n\t\t\tfor(int j = 0; j < c ; j++){\n\t\t\t\tresult[i][j] = Integer.parseInt(tmpArray[j]);\n\t\t\t\tresult[i][c] += result[i][j];\n\t\t\t\tresult[r][c] += result[i][j];\n\t\t\t\tresult[r][j] += result[i][j];\n\t\t\t}\n\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < r",
"i",
"r",
"i++",
"i++",
"i",
"{\n\t\t\ttmpArray = br.readLine().split(\" \");\n\t\t\tfor(int j = 0; j < c ; j++){\n\t\t\t\tresult[i][j] = Integer.parseInt(tmpArray[j]);\n\t\t\t\tresult[i][c] += result[i][j];\n\t\t\t\tresult[r][c] += result[i][j];\n\t\t\t\tresult[r][j] += result[i][j];\n\t\t\t}\n\t\t}",
"{\n\t\t\ttmpArray = br.readLine().split(\" \");\n\t\t\tfor(int j = 0; j < c ; j++){\n\t\t\t\tresult[i][j] = Integer.parseInt(tmpArray[j]);\n\t\t\t\tresult[i][c] += result[i][j];\n\t\t\t\tresult[r][c] += result[i][j];\n\t\t\t\tresult[r][j] += result[i][j];\n\t\t\t}\n\t\t}",
"tmpArray = br.readLine().split(\" \")",
"tmpArray",
"br.readLine().split(\" \")",
"br.readLine().split",
"br.readLine()",
"br.readLine",
"br",
"\" \"",
"for(int j = 0; j < c ; j++){\n\t\t\t\tresult[i][j] = Integer.parseInt(tmpArray[j]);\n\t\t\t\tresult[i][c] += result[i][j];\n\t\t\t\tresult[r][c] += result[i][j];\n\t\t\t\tresult[r][j] += result[i][j];\n\t\t\t}",
"int j = 0;",
"int j = 0;",
"j",
"0",
"j < c",
"j",
"c",
"j++",
"j++",
"j",
"{\n\t\t\t\tresult[i][j] = Integer.parseInt(tmpArray[j]);\n\t\t\t\tresult[i][c] += result[i][j];\n\t\t\t\tresult[r][c] += result[i][j];\n\t\t\t\tresult[r][j] += result[i][j];\n\t\t\t}",
"{\n\t\t\t\tresult[i][j] = Integer.parseInt(tmpArray[j]);\n\t\t\t\tresult[i][c] += result[i][j];\n\t\t\t\tresult[r][c] += result[i][j];\n\t\t\t\tresult[r][j] += result[i][j];\n\t\t\t}",
"result[i][j] = Integer.parseInt(tmpArray[j])",
"result[i][j]",
"result[i]",
"result",
"i",
"j",
"Integer.parseInt(tmpArray[j])",
"Integer.parseInt",
"Integer",
"tmpArray[j]",
"tmpArray",
"j",
"result[i][c] += result[i][j]",
"result[i][c]",
"result[i]",
"result",
"i",
"c",
"result[i][j]",
"result[i]",
"result",
"i",
"j",
"result[r][c] += result[i][j]",
"result[r][c]",
"result[r]",
"result",
"r",
"c",
"result[i][j]",
"result[i]",
"result",
"i",
"j",
"result[r][j] += result[i][j]",
"result[r][j]",
"result[r]",
"result",
"r",
"j",
"result[i][j]",
"result[i]",
"result",
"i",
"j",
"for(int i = 0; i <= r ; i++){\n\t\t\tfor(int j = 0; j <= c ; j++){\n\t\t\t\tif(j != 0){\n\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t}\n\t\t\t\tSystem.out.print(result[i][j]);\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i <= r",
"i",
"r",
"i++",
"i++",
"i",
"{\n\t\t\tfor(int j = 0; j <= c ; j++){\n\t\t\t\tif(j != 0){\n\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t}\n\t\t\t\tSystem.out.print(result[i][j]);\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}",
"{\n\t\t\tfor(int j = 0; j <= c ; j++){\n\t\t\t\tif(j != 0){\n\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t}\n\t\t\t\tSystem.out.print(result[i][j]);\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}",
"for(int j = 0; j <= c ; j++){\n\t\t\t\tif(j != 0){\n\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t}\n\t\t\t\tSystem.out.print(result[i][j]);\n\t\t\t}",
"int j = 0;",
"int j = 0;",
"j",
"0",
"j <= c",
"j",
"c",
"j++",
"j++",
"j",
"{\n\t\t\t\tif(j != 0){\n\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t}\n\t\t\t\tSystem.out.print(result[i][j]);\n\t\t\t}",
"{\n\t\t\t\tif(j != 0){\n\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t}\n\t\t\t\tSystem.out.print(result[i][j]);\n\t\t\t}",
"if(j != 0){\n\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t}",
"j != 0",
"j",
"0",
"{\n\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t}",
"System.out.print(\" \")",
"System.out.print",
"System.out",
"System",
"System.out",
"\" \"",
"System.out.print(result[i][j])",
"System.out.print",
"System.out",
"System",
"System.out",
"result[i][j]",
"result[i]",
"result",
"i",
"j",
"System.out.println()",
"System.out.println",
"System.out",
"System",
"System.out",
"String[] args",
"args",
"public class Main {\n\n\tpublic static void main(String[] args) throws IOException {\n\t\t// TODO ?????????????????????????????????????????????\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\t\t\n\t\tString[] tmpArray = br.readLine().split(\" \");\n\t\tint r = Integer.parseInt(tmpArray[0]);\n\t\tint c = Integer.parseInt(tmpArray[1]);\n\t\t\n\t\tint[][] result = new int[r+1][c+1];\n\t\t\n\t\tfor(int i = 0; i < r ; i++){\n\t\t\ttmpArray = br.readLine().split(\" \");\n\t\t\tfor(int j = 0; j < c ; j++){\n\t\t\t\tresult[i][j] = Integer.parseInt(tmpArray[j]);\n\t\t\t\tresult[i][c] += result[i][j];\n\t\t\t\tresult[r][c] += result[i][j];\n\t\t\t\tresult[r][j] += result[i][j];\n\t\t\t}\n\t\t}\n\t\t\n\t\t\n\t\tfor(int i = 0; i <= r ; i++){\n\t\t\tfor(int j = 0; j <= c ; j++){\n\t\t\t\tif(j != 0){\n\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t}\n\t\t\t\tSystem.out.print(result[i][j]);\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}\n\t}\n\n}",
"public class Main {\n\n\tpublic static void main(String[] args) throws IOException {\n\t\t// TODO ?????????????????????????????????????????????\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\t\t\n\t\tString[] tmpArray = br.readLine().split(\" \");\n\t\tint r = Integer.parseInt(tmpArray[0]);\n\t\tint c = Integer.parseInt(tmpArray[1]);\n\t\t\n\t\tint[][] result = new int[r+1][c+1];\n\t\t\n\t\tfor(int i = 0; i < r ; i++){\n\t\t\ttmpArray = br.readLine().split(\" \");\n\t\t\tfor(int j = 0; j < c ; j++){\n\t\t\t\tresult[i][j] = Integer.parseInt(tmpArray[j]);\n\t\t\t\tresult[i][c] += result[i][j];\n\t\t\t\tresult[r][c] += result[i][j];\n\t\t\t\tresult[r][j] += result[i][j];\n\t\t\t}\n\t\t}\n\t\t\n\t\t\n\t\tfor(int i = 0; i <= r ; i++){\n\t\t\tfor(int j = 0; j <= c ; j++){\n\t\t\t\tif(j != 0){\n\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t}\n\t\t\t\tSystem.out.print(result[i][j]);\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}\n\t}\n\n}",
"Main"
] | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class Main {
public static void main(String[] args) throws IOException {
// TODO ?????????????????????????????????????????????
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
String[] tmpArray = br.readLine().split(" ");
int r = Integer.parseInt(tmpArray[0]);
int c = Integer.parseInt(tmpArray[1]);
int[][] result = new int[r+1][c+1];
for(int i = 0; i < r ; i++){
tmpArray = br.readLine().split(" ");
for(int j = 0; j < c ; j++){
result[i][j] = Integer.parseInt(tmpArray[j]);
result[i][c] += result[i][j];
result[r][c] += result[i][j];
result[r][j] += result[i][j];
}
}
for(int i = 0; i <= r ; i++){
for(int j = 0; j <= c ; j++){
if(j != 0){
System.out.print(" ");
}
System.out.print(result[i][j]);
}
System.out.println();
}
}
} |
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
41,
13,
20,
2,
13,
17,
2,
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,
18,
18,
13,
13,
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,
0,
18,
18,
13,
13,
13,
2,
18,
18,
13,
13,
13,
18,
18,
13,
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,
2,
18,
18,
13,
13,
13,
18,
18,
13,
13,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
18,
18,
13,
13,
13,
2,
18,
18,
13,
13,
13,
18,
18,
13,
13,
13,
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,
14,
2,
13,
13,
30,
4,
18,
18,
13,
13,
17,
18,
18,
13,
13,
13,
14,
2,
13,
13,
30,
4,
18,
18,
13,
13,
17,
18,
18,
13,
13,
13,
4,
18,
18,
13,
13,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
252,
5
],
[
252,
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
],
[
19,
20
],
[
20,
21
],
[
8,
22
],
[
22,
23
],
[
22,
24
],
[
25,
26
],
[
25,
27
],
[
28,
29
],
[
28,
30
],
[
8,
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
],
[
58,
62
],
[
57,
63
],
[
63,
64
],
[
64,
65
],
[
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
],
[
93,
94
],
[
94,
95
],
[
94,
96
],
[
93,
97
],
[
92,
98
],
[
98,
99
],
[
99,
100
],
[
100,
101
],
[
100,
102
],
[
99,
103
],
[
98,
104
],
[
104,
105
],
[
105,
106
],
[
105,
107
],
[
104,
108
],
[
8,
109
],
[
109,
110
],
[
110,
111
],
[
111,
112
],
[
111,
113
],
[
109,
114
],
[
114,
115
],
[
114,
116
],
[
109,
117
],
[
117,
118
],
[
118,
119
],
[
109,
120
],
[
121,
121
],
[
121,
122
],
[
122,
123
],
[
123,
124
],
[
124,
125
],
[
124,
126
],
[
122,
127
],
[
127,
128
],
[
127,
129
],
[
122,
130
],
[
130,
131
],
[
131,
132
],
[
122,
133
],
[
134,
134
],
[
134,
135
],
[
135,
136
],
[
136,
137
],
[
137,
138
],
[
137,
139
],
[
136,
140
],
[
135,
141
],
[
141,
142
],
[
142,
143
],
[
143,
144
],
[
143,
145
],
[
142,
146
],
[
141,
147
],
[
147,
148
],
[
148,
149
],
[
148,
150
],
[
147,
151
],
[
8,
152
],
[
152,
153
],
[
153,
154
],
[
154,
155
],
[
154,
156
],
[
152,
157
],
[
157,
158
],
[
157,
159
],
[
152,
160
],
[
160,
161
],
[
161,
162
],
[
152,
163
],
[
164,
164
],
[
164,
165
],
[
165,
166
],
[
166,
167
],
[
167,
168
],
[
167,
169
],
[
166,
170
],
[
165,
171
],
[
171,
172
],
[
172,
173
],
[
173,
174
],
[
173,
175
],
[
172,
176
],
[
171,
177
],
[
177,
178
],
[
178,
179
],
[
178,
180
],
[
177,
181
],
[
8,
182
],
[
182,
183
],
[
183,
184
],
[
184,
185
],
[
184,
186
],
[
182,
187
],
[
187,
188
],
[
187,
189
],
[
189,
190
],
[
189,
191
],
[
182,
192
],
[
192,
193
],
[
193,
194
],
[
182,
195
],
[
196,
196
],
[
196,
197
],
[
197,
198
],
[
198,
199
],
[
199,
200
],
[
199,
201
],
[
197,
202
],
[
202,
203
],
[
202,
204
],
[
204,
205
],
[
204,
206
],
[
197,
207
],
[
207,
208
],
[
208,
209
],
[
197,
210
],
[
211,
211
],
[
211,
212
],
[
212,
213
],
[
213,
214
],
[
213,
215
],
[
212,
216
],
[
216,
217
],
[
217,
218
],
[
218,
219
],
[
219,
220
],
[
219,
221
],
[
217,
222
],
[
217,
223
],
[
223,
224
],
[
224,
225
],
[
224,
226
],
[
223,
227
],
[
212,
228
],
[
228,
229
],
[
229,
230
],
[
229,
231
],
[
228,
232
],
[
232,
233
],
[
233,
234
],
[
234,
235
],
[
235,
236
],
[
235,
237
],
[
233,
238
],
[
233,
239
],
[
239,
240
],
[
240,
241
],
[
240,
242
],
[
239,
243
],
[
196,
244
],
[
244,
245
],
[
245,
246
],
[
246,
247
],
[
246,
248
],
[
6,
249
],
[
249,
250
],
[
0,
251
],
[
251,
252
],
[
251,
253
]
] | [
"import java.util.*;\n\npublic class Main {\n\tpublic static void main(String[] args) {\n\t\t\n\t\tScanner sc = new Scanner(System.in);\n\n\t\tint r = sc.nextInt();\n\t\tint c = sc.nextInt();\n\t\tint tblData[][] = new int[c+1][r+1];\n\t\t\n\t\t//???????????\\???\n\t\tfor(int i = 0; i < r; i++) {\n\t\t\tfor(int j = 0; j < c; j++) {\n\t\t\t\ttblData[j][i] = sc.nextInt();\n\t\t\t}\n\t\t}\n\t\t\n\t\t//????????????????¨?\n\t\tfor(int i = 0; i < r; i++) {\n\t\t\tfor(int j = 0; j < c; j++) {\n\t\t\t\ttblData[c][i] = tblData[c][i] + tblData[j][i];\n\t\t\t}\n\t\t}\n\t\t\n\t\t//????????????????¨?\n\t\tfor(int j = 0; j < c; j++) {\n\t\t\tfor(int i = 0; i < r; i++) {\n\t\t\t\ttblData[j][r] = tblData[j][r] + tblData[j][i];\n\t\t\t}\n\t\t}\n\t\t\n\t\t//???????¨?\n\t\tfor(int i = 0; i < r; i++) {\n\t\t\ttblData[c][r] = tblData[c][r] + tblData[c][i];\n\t\t}\n\t\t\n\t\tfor(int i = 0; i < r + 1; i++) {\n\t\t\tfor(int j = 0; j < c + 1; j++) {\n\t\t\t\tif(j != c) {\n\t\t\t\t\tSystem.out.printf(\"%d \", tblData[j][i]);\n\t\t\t\t} else if(j == c) {\n\t\t\t\t\tSystem.out.printf(\"%d\", tblData[j][i]);\n\t\t\t\t}\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}\n\t}\n}",
"import java.util.*;",
"util.*",
"java",
"public class Main {\n\tpublic static void main(String[] args) {\n\t\t\n\t\tScanner sc = new Scanner(System.in);\n\n\t\tint r = sc.nextInt();\n\t\tint c = sc.nextInt();\n\t\tint tblData[][] = new int[c+1][r+1];\n\t\t\n\t\t//???????????\\???\n\t\tfor(int i = 0; i < r; i++) {\n\t\t\tfor(int j = 0; j < c; j++) {\n\t\t\t\ttblData[j][i] = sc.nextInt();\n\t\t\t}\n\t\t}\n\t\t\n\t\t//????????????????¨?\n\t\tfor(int i = 0; i < r; i++) {\n\t\t\tfor(int j = 0; j < c; j++) {\n\t\t\t\ttblData[c][i] = tblData[c][i] + tblData[j][i];\n\t\t\t}\n\t\t}\n\t\t\n\t\t//????????????????¨?\n\t\tfor(int j = 0; j < c; j++) {\n\t\t\tfor(int i = 0; i < r; i++) {\n\t\t\t\ttblData[j][r] = tblData[j][r] + tblData[j][i];\n\t\t\t}\n\t\t}\n\t\t\n\t\t//???????¨?\n\t\tfor(int i = 0; i < r; i++) {\n\t\t\ttblData[c][r] = tblData[c][r] + tblData[c][i];\n\t\t}\n\t\t\n\t\tfor(int i = 0; i < r + 1; i++) {\n\t\t\tfor(int j = 0; j < c + 1; j++) {\n\t\t\t\tif(j != c) {\n\t\t\t\t\tSystem.out.printf(\"%d \", tblData[j][i]);\n\t\t\t\t} else if(j == c) {\n\t\t\t\t\tSystem.out.printf(\"%d\", tblData[j][i]);\n\t\t\t\t}\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}\n\t}\n}",
"Main",
"public static void main(String[] args) {\n\t\t\n\t\tScanner sc = new Scanner(System.in);\n\n\t\tint r = sc.nextInt();\n\t\tint c = sc.nextInt();\n\t\tint tblData[][] = new int[c+1][r+1];\n\t\t\n\t\t//???????????\\???\n\t\tfor(int i = 0; i < r; i++) {\n\t\t\tfor(int j = 0; j < c; j++) {\n\t\t\t\ttblData[j][i] = sc.nextInt();\n\t\t\t}\n\t\t}\n\t\t\n\t\t//????????????????¨?\n\t\tfor(int i = 0; i < r; i++) {\n\t\t\tfor(int j = 0; j < c; j++) {\n\t\t\t\ttblData[c][i] = tblData[c][i] + tblData[j][i];\n\t\t\t}\n\t\t}\n\t\t\n\t\t//????????????????¨?\n\t\tfor(int j = 0; j < c; j++) {\n\t\t\tfor(int i = 0; i < r; i++) {\n\t\t\t\ttblData[j][r] = tblData[j][r] + tblData[j][i];\n\t\t\t}\n\t\t}\n\t\t\n\t\t//???????¨?\n\t\tfor(int i = 0; i < r; i++) {\n\t\t\ttblData[c][r] = tblData[c][r] + tblData[c][i];\n\t\t}\n\t\t\n\t\tfor(int i = 0; i < r + 1; i++) {\n\t\t\tfor(int j = 0; j < c + 1; j++) {\n\t\t\t\tif(j != c) {\n\t\t\t\t\tSystem.out.printf(\"%d \", tblData[j][i]);\n\t\t\t\t} else if(j == c) {\n\t\t\t\t\tSystem.out.printf(\"%d\", tblData[j][i]);\n\t\t\t\t}\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}\n\t}",
"main",
"{\n\t\t\n\t\tScanner sc = new Scanner(System.in);\n\n\t\tint r = sc.nextInt();\n\t\tint c = sc.nextInt();\n\t\tint tblData[][] = new int[c+1][r+1];\n\t\t\n\t\t//???????????\\???\n\t\tfor(int i = 0; i < r; i++) {\n\t\t\tfor(int j = 0; j < c; j++) {\n\t\t\t\ttblData[j][i] = sc.nextInt();\n\t\t\t}\n\t\t}\n\t\t\n\t\t//????????????????¨?\n\t\tfor(int i = 0; i < r; i++) {\n\t\t\tfor(int j = 0; j < c; j++) {\n\t\t\t\ttblData[c][i] = tblData[c][i] + tblData[j][i];\n\t\t\t}\n\t\t}\n\t\t\n\t\t//????????????????¨?\n\t\tfor(int j = 0; j < c; j++) {\n\t\t\tfor(int i = 0; i < r; i++) {\n\t\t\t\ttblData[j][r] = tblData[j][r] + tblData[j][i];\n\t\t\t}\n\t\t}\n\t\t\n\t\t//???????¨?\n\t\tfor(int i = 0; i < r; i++) {\n\t\t\ttblData[c][r] = tblData[c][r] + tblData[c][i];\n\t\t}\n\t\t\n\t\tfor(int i = 0; i < r + 1; i++) {\n\t\t\tfor(int j = 0; j < c + 1; j++) {\n\t\t\t\tif(j != c) {\n\t\t\t\t\tSystem.out.printf(\"%d \", tblData[j][i]);\n\t\t\t\t} else if(j == c) {\n\t\t\t\t\tSystem.out.printf(\"%d\", tblData[j][i]);\n\t\t\t\t}\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}\n\t}",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"int r = sc.nextInt();",
"r",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int c = sc.nextInt();",
"c",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int tblData[][] = new int[c+1][r+1];",
"tblData",
"new int[c+1][r+1]",
"c+1",
"c",
"1",
"r+1",
"r",
"1",
"for(int i = 0; i < r; i++) {\n\t\t\tfor(int j = 0; j < c; j++) {\n\t\t\t\ttblData[j][i] = sc.nextInt();\n\t\t\t}\n\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < r",
"i",
"r",
"i++",
"i++",
"i",
"{\n\t\t\tfor(int j = 0; j < c; j++) {\n\t\t\t\ttblData[j][i] = sc.nextInt();\n\t\t\t}\n\t\t}",
"{\n\t\t\tfor(int j = 0; j < c; j++) {\n\t\t\t\ttblData[j][i] = sc.nextInt();\n\t\t\t}\n\t\t}",
"for(int j = 0; j < c; j++) {\n\t\t\t\ttblData[j][i] = sc.nextInt();\n\t\t\t}",
"int j = 0;",
"int j = 0;",
"j",
"0",
"j < c",
"j",
"c",
"j++",
"j++",
"j",
"{\n\t\t\t\ttblData[j][i] = sc.nextInt();\n\t\t\t}",
"{\n\t\t\t\ttblData[j][i] = sc.nextInt();\n\t\t\t}",
"tblData[j][i] = sc.nextInt()",
"tblData[j][i]",
"tblData[j]",
"tblData",
"j",
"i",
"sc.nextInt()",
"sc.nextInt",
"sc",
"for(int i = 0; i < r; i++) {\n\t\t\tfor(int j = 0; j < c; j++) {\n\t\t\t\ttblData[c][i] = tblData[c][i] + tblData[j][i];\n\t\t\t}\n\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < r",
"i",
"r",
"i++",
"i++",
"i",
"{\n\t\t\tfor(int j = 0; j < c; j++) {\n\t\t\t\ttblData[c][i] = tblData[c][i] + tblData[j][i];\n\t\t\t}\n\t\t}",
"{\n\t\t\tfor(int j = 0; j < c; j++) {\n\t\t\t\ttblData[c][i] = tblData[c][i] + tblData[j][i];\n\t\t\t}\n\t\t}",
"for(int j = 0; j < c; j++) {\n\t\t\t\ttblData[c][i] = tblData[c][i] + tblData[j][i];\n\t\t\t}",
"int j = 0;",
"int j = 0;",
"j",
"0",
"j < c",
"j",
"c",
"j++",
"j++",
"j",
"{\n\t\t\t\ttblData[c][i] = tblData[c][i] + tblData[j][i];\n\t\t\t}",
"{\n\t\t\t\ttblData[c][i] = tblData[c][i] + tblData[j][i];\n\t\t\t}",
"tblData[c][i] = tblData[c][i] + tblData[j][i]",
"tblData[c][i]",
"tblData[c]",
"tblData",
"c",
"i",
"tblData[c][i] + tblData[j][i]",
"tblData[c][i]",
"tblData[c]",
"tblData",
"c",
"i",
"tblData[j][i]",
"tblData[j]",
"tblData",
"j",
"i",
"for(int j = 0; j < c; j++) {\n\t\t\tfor(int i = 0; i < r; i++) {\n\t\t\t\ttblData[j][r] = tblData[j][r] + tblData[j][i];\n\t\t\t}\n\t\t}",
"int j = 0;",
"int j = 0;",
"j",
"0",
"j < c",
"j",
"c",
"j++",
"j++",
"j",
"{\n\t\t\tfor(int i = 0; i < r; i++) {\n\t\t\t\ttblData[j][r] = tblData[j][r] + tblData[j][i];\n\t\t\t}\n\t\t}",
"{\n\t\t\tfor(int i = 0; i < r; i++) {\n\t\t\t\ttblData[j][r] = tblData[j][r] + tblData[j][i];\n\t\t\t}\n\t\t}",
"for(int i = 0; i < r; i++) {\n\t\t\t\ttblData[j][r] = tblData[j][r] + tblData[j][i];\n\t\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < r",
"i",
"r",
"i++",
"i++",
"i",
"{\n\t\t\t\ttblData[j][r] = tblData[j][r] + tblData[j][i];\n\t\t\t}",
"{\n\t\t\t\ttblData[j][r] = tblData[j][r] + tblData[j][i];\n\t\t\t}",
"tblData[j][r] = tblData[j][r] + tblData[j][i]",
"tblData[j][r]",
"tblData[j]",
"tblData",
"j",
"r",
"tblData[j][r] + tblData[j][i]",
"tblData[j][r]",
"tblData[j]",
"tblData",
"j",
"r",
"tblData[j][i]",
"tblData[j]",
"tblData",
"j",
"i",
"for(int i = 0; i < r; i++) {\n\t\t\ttblData[c][r] = tblData[c][r] + tblData[c][i];\n\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < r",
"i",
"r",
"i++",
"i++",
"i",
"{\n\t\t\ttblData[c][r] = tblData[c][r] + tblData[c][i];\n\t\t}",
"{\n\t\t\ttblData[c][r] = tblData[c][r] + tblData[c][i];\n\t\t}",
"tblData[c][r] = tblData[c][r] + tblData[c][i]",
"tblData[c][r]",
"tblData[c]",
"tblData",
"c",
"r",
"tblData[c][r] + tblData[c][i]",
"tblData[c][r]",
"tblData[c]",
"tblData",
"c",
"r",
"tblData[c][i]",
"tblData[c]",
"tblData",
"c",
"i",
"for(int i = 0; i < r + 1; i++) {\n\t\t\tfor(int j = 0; j < c + 1; j++) {\n\t\t\t\tif(j != c) {\n\t\t\t\t\tSystem.out.printf(\"%d \", tblData[j][i]);\n\t\t\t\t} else if(j == c) {\n\t\t\t\t\tSystem.out.printf(\"%d\", tblData[j][i]);\n\t\t\t\t}\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < r + 1",
"i",
"r + 1",
"r",
"1",
"i++",
"i++",
"i",
"{\n\t\t\tfor(int j = 0; j < c + 1; j++) {\n\t\t\t\tif(j != c) {\n\t\t\t\t\tSystem.out.printf(\"%d \", tblData[j][i]);\n\t\t\t\t} else if(j == c) {\n\t\t\t\t\tSystem.out.printf(\"%d\", tblData[j][i]);\n\t\t\t\t}\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}",
"{\n\t\t\tfor(int j = 0; j < c + 1; j++) {\n\t\t\t\tif(j != c) {\n\t\t\t\t\tSystem.out.printf(\"%d \", tblData[j][i]);\n\t\t\t\t} else if(j == c) {\n\t\t\t\t\tSystem.out.printf(\"%d\", tblData[j][i]);\n\t\t\t\t}\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}",
"for(int j = 0; j < c + 1; j++) {\n\t\t\t\tif(j != c) {\n\t\t\t\t\tSystem.out.printf(\"%d \", tblData[j][i]);\n\t\t\t\t} else if(j == c) {\n\t\t\t\t\tSystem.out.printf(\"%d\", tblData[j][i]);\n\t\t\t\t}\n\t\t\t}",
"int j = 0;",
"int j = 0;",
"j",
"0",
"j < c + 1",
"j",
"c + 1",
"c",
"1",
"j++",
"j++",
"j",
"{\n\t\t\t\tif(j != c) {\n\t\t\t\t\tSystem.out.printf(\"%d \", tblData[j][i]);\n\t\t\t\t} else if(j == c) {\n\t\t\t\t\tSystem.out.printf(\"%d\", tblData[j][i]);\n\t\t\t\t}\n\t\t\t}",
"{\n\t\t\t\tif(j != c) {\n\t\t\t\t\tSystem.out.printf(\"%d \", tblData[j][i]);\n\t\t\t\t} else if(j == c) {\n\t\t\t\t\tSystem.out.printf(\"%d\", tblData[j][i]);\n\t\t\t\t}\n\t\t\t}",
"if(j != c) {\n\t\t\t\t\tSystem.out.printf(\"%d \", tblData[j][i]);\n\t\t\t\t} else if(j == c) {\n\t\t\t\t\tSystem.out.printf(\"%d\", tblData[j][i]);\n\t\t\t\t}",
"j != c",
"j",
"c",
"{\n\t\t\t\t\tSystem.out.printf(\"%d \", tblData[j][i]);\n\t\t\t\t}",
"System.out.printf(\"%d \", tblData[j][i])",
"System.out.printf",
"System.out",
"System",
"System.out",
"\"%d \"",
"tblData[j][i]",
"tblData[j]",
"tblData",
"j",
"i",
"if(j == c) {\n\t\t\t\t\tSystem.out.printf(\"%d\", tblData[j][i]);\n\t\t\t\t}",
"j == c",
"j",
"c",
"{\n\t\t\t\t\tSystem.out.printf(\"%d\", tblData[j][i]);\n\t\t\t\t}",
"System.out.printf(\"%d\", tblData[j][i])",
"System.out.printf",
"System.out",
"System",
"System.out",
"\"%d\"",
"tblData[j][i]",
"tblData[j]",
"tblData",
"j",
"i",
"System.out.println()",
"System.out.println",
"System.out",
"System",
"System.out",
"String[] args",
"args",
"public class Main {\n\tpublic static void main(String[] args) {\n\t\t\n\t\tScanner sc = new Scanner(System.in);\n\n\t\tint r = sc.nextInt();\n\t\tint c = sc.nextInt();\n\t\tint tblData[][] = new int[c+1][r+1];\n\t\t\n\t\t//???????????\\???\n\t\tfor(int i = 0; i < r; i++) {\n\t\t\tfor(int j = 0; j < c; j++) {\n\t\t\t\ttblData[j][i] = sc.nextInt();\n\t\t\t}\n\t\t}\n\t\t\n\t\t//????????????????¨?\n\t\tfor(int i = 0; i < r; i++) {\n\t\t\tfor(int j = 0; j < c; j++) {\n\t\t\t\ttblData[c][i] = tblData[c][i] + tblData[j][i];\n\t\t\t}\n\t\t}\n\t\t\n\t\t//????????????????¨?\n\t\tfor(int j = 0; j < c; j++) {\n\t\t\tfor(int i = 0; i < r; i++) {\n\t\t\t\ttblData[j][r] = tblData[j][r] + tblData[j][i];\n\t\t\t}\n\t\t}\n\t\t\n\t\t//???????¨?\n\t\tfor(int i = 0; i < r; i++) {\n\t\t\ttblData[c][r] = tblData[c][r] + tblData[c][i];\n\t\t}\n\t\t\n\t\tfor(int i = 0; i < r + 1; i++) {\n\t\t\tfor(int j = 0; j < c + 1; j++) {\n\t\t\t\tif(j != c) {\n\t\t\t\t\tSystem.out.printf(\"%d \", tblData[j][i]);\n\t\t\t\t} else if(j == c) {\n\t\t\t\t\tSystem.out.printf(\"%d\", tblData[j][i]);\n\t\t\t\t}\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}\n\t}\n}",
"public class Main {\n\tpublic static void main(String[] args) {\n\t\t\n\t\tScanner sc = new Scanner(System.in);\n\n\t\tint r = sc.nextInt();\n\t\tint c = sc.nextInt();\n\t\tint tblData[][] = new int[c+1][r+1];\n\t\t\n\t\t//???????????\\???\n\t\tfor(int i = 0; i < r; i++) {\n\t\t\tfor(int j = 0; j < c; j++) {\n\t\t\t\ttblData[j][i] = sc.nextInt();\n\t\t\t}\n\t\t}\n\t\t\n\t\t//????????????????¨?\n\t\tfor(int i = 0; i < r; i++) {\n\t\t\tfor(int j = 0; j < c; j++) {\n\t\t\t\ttblData[c][i] = tblData[c][i] + tblData[j][i];\n\t\t\t}\n\t\t}\n\t\t\n\t\t//????????????????¨?\n\t\tfor(int j = 0; j < c; j++) {\n\t\t\tfor(int i = 0; i < r; i++) {\n\t\t\t\ttblData[j][r] = tblData[j][r] + tblData[j][i];\n\t\t\t}\n\t\t}\n\t\t\n\t\t//???????¨?\n\t\tfor(int i = 0; i < r; i++) {\n\t\t\ttblData[c][r] = tblData[c][r] + tblData[c][i];\n\t\t}\n\t\t\n\t\tfor(int i = 0; i < r + 1; i++) {\n\t\t\tfor(int j = 0; j < c + 1; j++) {\n\t\t\t\tif(j != c) {\n\t\t\t\t\tSystem.out.printf(\"%d \", tblData[j][i]);\n\t\t\t\t} else if(j == c) {\n\t\t\t\t\tSystem.out.printf(\"%d\", tblData[j][i]);\n\t\t\t\t}\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}\n\t}\n}",
"Main"
] | import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int r = sc.nextInt();
int c = sc.nextInt();
int tblData[][] = new int[c+1][r+1];
//???????????\???
for(int i = 0; i < r; i++) {
for(int j = 0; j < c; j++) {
tblData[j][i] = sc.nextInt();
}
}
//????????????????¨?
for(int i = 0; i < r; i++) {
for(int j = 0; j < c; j++) {
tblData[c][i] = tblData[c][i] + tblData[j][i];
}
}
//????????????????¨?
for(int j = 0; j < c; j++) {
for(int i = 0; i < r; i++) {
tblData[j][r] = tblData[j][r] + tblData[j][i];
}
}
//???????¨?
for(int i = 0; i < r; i++) {
tblData[c][r] = tblData[c][r] + tblData[c][i];
}
for(int i = 0; i < r + 1; i++) {
for(int j = 0; j < c + 1; j++) {
if(j != c) {
System.out.printf("%d ", tblData[j][i]);
} else if(j == c) {
System.out.printf("%d", tblData[j][i]);
}
}
System.out.println();
}
}
} |
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
4,
18,
13,
17,
41,
13,
4,
18,
13,
18,
13,
17,
41,
13,
4,
18,
13,
18,
13,
17,
41,
13,
20,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
4,
18,
4,
18,
13,
17,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
41,
13,
4,
18,
13,
18,
13,
13,
0,
13,
13,
0,
18,
13,
13,
13,
4,
18,
18,
13,
13,
2,
13,
17,
4,
18,
18,
13,
13,
13,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
18,
13,
13,
4,
18,
18,
13,
13,
2,
18,
13,
13,
17,
4,
18,
18,
13,
13,
13,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
153,
11
],
[
153,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
15,
17
],
[
14,
18
],
[
18,
19
],
[
18,
20
],
[
20,
21
],
[
21,
22
],
[
22,
23
],
[
23,
24
],
[
20,
25
],
[
14,
26
],
[
26,
27
],
[
26,
28
],
[
28,
29
],
[
29,
30
],
[
28,
31
],
[
31,
32
],
[
31,
33
],
[
14,
34
],
[
34,
35
],
[
34,
36
],
[
36,
37
],
[
37,
38
],
[
36,
39
],
[
39,
40
],
[
39,
41
],
[
14,
42
],
[
42,
43
],
[
42,
44
],
[
14,
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
],
[
63,
64
],
[
64,
65
],
[
61,
66
],
[
58,
67
],
[
67,
68
],
[
67,
69
],
[
58,
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
],
[
86,
87
],
[
85,
88
],
[
88,
89
],
[
88,
90
],
[
82,
91
],
[
91,
92
],
[
91,
93
],
[
82,
94
],
[
94,
95
],
[
95,
96
],
[
95,
97
],
[
94,
98
],
[
82,
99
],
[
99,
100
],
[
100,
101
],
[
101,
102
],
[
101,
103
],
[
99,
104
],
[
104,
105
],
[
104,
106
],
[
58,
107
],
[
107,
108
],
[
108,
109
],
[
109,
110
],
[
109,
111
],
[
107,
112
],
[
14,
113
],
[
113,
114
],
[
113,
115
],
[
14,
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
],
[
128,
134
],
[
134,
135
],
[
135,
136
],
[
136,
137
],
[
136,
138
],
[
134,
139
],
[
139,
140
],
[
140,
141
],
[
140,
142
],
[
139,
143
],
[
14,
144
],
[
144,
145
],
[
145,
146
],
[
146,
147
],
[
146,
148
],
[
144,
149
],
[
12,
150
],
[
150,
151
],
[
0,
152
],
[
152,
153
],
[
152,
154
]
] | [
"import java.io.BufferedReader;\nimport java.io.IOException;\nimport java.io.InputStreamReader;\n\npublic class Main {\n\n public static void main(String[] args) throws IOException {\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n String[] lines = br.readLine().split(\" \");\n int n = Integer.parseInt(lines[0]);\n int m = Integer.parseInt(lines[1]);\n int[] rowSum = new int[m];\n for (int i = 0; i < n; i++) {\n lines = br.readLine().split(\" \");\n int columnSum=0;\n for (int j = 0; j < m; j++) {\n int e= Integer.parseInt(lines[j]);\n columnSum+=e;\n rowSum[j]+=e;\n System.out.print(e+\" \");\n }\n System.out.println(columnSum);\n }\n int totalSum=0;\n for(int i=0;i<m;i++){\n totalSum+=rowSum[i];\n System.out.print(rowSum[i]+\" \");\n }\n System.out.println(totalSum);\n\n }\n}",
"import java.io.BufferedReader;",
"BufferedReader",
"java.io",
"import java.io.IOException;",
"IOException",
"java.io",
"import java.io.InputStreamReader;",
"InputStreamReader",
"java.io",
"public class Main {\n\n public static void main(String[] args) throws IOException {\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n String[] lines = br.readLine().split(\" \");\n int n = Integer.parseInt(lines[0]);\n int m = Integer.parseInt(lines[1]);\n int[] rowSum = new int[m];\n for (int i = 0; i < n; i++) {\n lines = br.readLine().split(\" \");\n int columnSum=0;\n for (int j = 0; j < m; j++) {\n int e= Integer.parseInt(lines[j]);\n columnSum+=e;\n rowSum[j]+=e;\n System.out.print(e+\" \");\n }\n System.out.println(columnSum);\n }\n int totalSum=0;\n for(int i=0;i<m;i++){\n totalSum+=rowSum[i];\n System.out.print(rowSum[i]+\" \");\n }\n System.out.println(totalSum);\n\n }\n}",
"Main",
"public static void main(String[] args) throws IOException {\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n String[] lines = br.readLine().split(\" \");\n int n = Integer.parseInt(lines[0]);\n int m = Integer.parseInt(lines[1]);\n int[] rowSum = new int[m];\n for (int i = 0; i < n; i++) {\n lines = br.readLine().split(\" \");\n int columnSum=0;\n for (int j = 0; j < m; j++) {\n int e= Integer.parseInt(lines[j]);\n columnSum+=e;\n rowSum[j]+=e;\n System.out.print(e+\" \");\n }\n System.out.println(columnSum);\n }\n int totalSum=0;\n for(int i=0;i<m;i++){\n totalSum+=rowSum[i];\n System.out.print(rowSum[i]+\" \");\n }\n System.out.println(totalSum);\n\n }",
"main",
"{\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n String[] lines = br.readLine().split(\" \");\n int n = Integer.parseInt(lines[0]);\n int m = Integer.parseInt(lines[1]);\n int[] rowSum = new int[m];\n for (int i = 0; i < n; i++) {\n lines = br.readLine().split(\" \");\n int columnSum=0;\n for (int j = 0; j < m; j++) {\n int e= Integer.parseInt(lines[j]);\n columnSum+=e;\n rowSum[j]+=e;\n System.out.print(e+\" \");\n }\n System.out.println(columnSum);\n }\n int totalSum=0;\n for(int i=0;i<m;i++){\n totalSum+=rowSum[i];\n System.out.print(rowSum[i]+\" \");\n }\n System.out.println(totalSum);\n\n }",
"BufferedReader br = new BufferedReader(new InputStreamReader(System.in));",
"br",
"new BufferedReader(new InputStreamReader(System.in))",
"String[] lines = br.readLine().split(\" \");",
"lines",
"br.readLine().split(\" \")",
"br.readLine().split",
"br.readLine()",
"br.readLine",
"br",
"\" \"",
"int n = Integer.parseInt(lines[0]);",
"n",
"Integer.parseInt(lines[0])",
"Integer.parseInt",
"Integer",
"lines[0]",
"lines",
"0",
"int m = Integer.parseInt(lines[1]);",
"m",
"Integer.parseInt(lines[1])",
"Integer.parseInt",
"Integer",
"lines[1]",
"lines",
"1",
"int[] rowSum = new int[m];",
"rowSum",
"new int[m]",
"m",
"for (int i = 0; i < n; i++) {\n lines = br.readLine().split(\" \");\n int columnSum=0;\n for (int j = 0; j < m; j++) {\n int e= Integer.parseInt(lines[j]);\n columnSum+=e;\n rowSum[j]+=e;\n System.out.print(e+\" \");\n }\n System.out.println(columnSum);\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < n",
"i",
"n",
"i++",
"i++",
"i",
"{\n lines = br.readLine().split(\" \");\n int columnSum=0;\n for (int j = 0; j < m; j++) {\n int e= Integer.parseInt(lines[j]);\n columnSum+=e;\n rowSum[j]+=e;\n System.out.print(e+\" \");\n }\n System.out.println(columnSum);\n }",
"{\n lines = br.readLine().split(\" \");\n int columnSum=0;\n for (int j = 0; j < m; j++) {\n int e= Integer.parseInt(lines[j]);\n columnSum+=e;\n rowSum[j]+=e;\n System.out.print(e+\" \");\n }\n System.out.println(columnSum);\n }",
"lines = br.readLine().split(\" \")",
"lines",
"br.readLine().split(\" \")",
"br.readLine().split",
"br.readLine()",
"br.readLine",
"br",
"\" \"",
"int columnSum=0;",
"columnSum",
"0",
"for (int j = 0; j < m; j++) {\n int e= Integer.parseInt(lines[j]);\n columnSum+=e;\n rowSum[j]+=e;\n System.out.print(e+\" \");\n }",
"int j = 0;",
"int j = 0;",
"j",
"0",
"j < m",
"j",
"m",
"j++",
"j++",
"j",
"{\n int e= Integer.parseInt(lines[j]);\n columnSum+=e;\n rowSum[j]+=e;\n System.out.print(e+\" \");\n }",
"{\n int e= Integer.parseInt(lines[j]);\n columnSum+=e;\n rowSum[j]+=e;\n System.out.print(e+\" \");\n }",
"int e= Integer.parseInt(lines[j]);",
"e",
"Integer.parseInt(lines[j])",
"Integer.parseInt",
"Integer",
"lines[j]",
"lines",
"j",
"columnSum+=e",
"columnSum",
"e",
"rowSum[j]+=e",
"rowSum[j]",
"rowSum",
"j",
"e",
"System.out.print(e+\" \")",
"System.out.print",
"System.out",
"System",
"System.out",
"e+\" \"",
"e",
"\" \"",
"System.out.println(columnSum)",
"System.out.println",
"System.out",
"System",
"System.out",
"columnSum",
"int totalSum=0;",
"totalSum",
"0",
"for(int i=0;i<m;i++){\n totalSum+=rowSum[i];\n System.out.print(rowSum[i]+\" \");\n }",
"int i=0;",
"int i=0;",
"i",
"0",
"i<m",
"i",
"m",
"i++",
"i++",
"i",
"{\n totalSum+=rowSum[i];\n System.out.print(rowSum[i]+\" \");\n }",
"{\n totalSum+=rowSum[i];\n System.out.print(rowSum[i]+\" \");\n }",
"totalSum+=rowSum[i]",
"totalSum",
"rowSum[i]",
"rowSum",
"i",
"System.out.print(rowSum[i]+\" \")",
"System.out.print",
"System.out",
"System",
"System.out",
"rowSum[i]+\" \"",
"rowSum[i]",
"rowSum",
"i",
"\" \"",
"System.out.println(totalSum)",
"System.out.println",
"System.out",
"System",
"System.out",
"totalSum",
"String[] args",
"args",
"public class Main {\n\n public static void main(String[] args) throws IOException {\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n String[] lines = br.readLine().split(\" \");\n int n = Integer.parseInt(lines[0]);\n int m = Integer.parseInt(lines[1]);\n int[] rowSum = new int[m];\n for (int i = 0; i < n; i++) {\n lines = br.readLine().split(\" \");\n int columnSum=0;\n for (int j = 0; j < m; j++) {\n int e= Integer.parseInt(lines[j]);\n columnSum+=e;\n rowSum[j]+=e;\n System.out.print(e+\" \");\n }\n System.out.println(columnSum);\n }\n int totalSum=0;\n for(int i=0;i<m;i++){\n totalSum+=rowSum[i];\n System.out.print(rowSum[i]+\" \");\n }\n System.out.println(totalSum);\n\n }\n}",
"public class Main {\n\n public static void main(String[] args) throws IOException {\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n String[] lines = br.readLine().split(\" \");\n int n = Integer.parseInt(lines[0]);\n int m = Integer.parseInt(lines[1]);\n int[] rowSum = new int[m];\n for (int i = 0; i < n; i++) {\n lines = br.readLine().split(\" \");\n int columnSum=0;\n for (int j = 0; j < m; j++) {\n int e= Integer.parseInt(lines[j]);\n columnSum+=e;\n rowSum[j]+=e;\n System.out.print(e+\" \");\n }\n System.out.println(columnSum);\n }\n int totalSum=0;\n for(int i=0;i<m;i++){\n totalSum+=rowSum[i];\n System.out.print(rowSum[i]+\" \");\n }\n System.out.println(totalSum);\n\n }\n}",
"Main"
] | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class Main {
public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
String[] lines = br.readLine().split(" ");
int n = Integer.parseInt(lines[0]);
int m = Integer.parseInt(lines[1]);
int[] rowSum = new int[m];
for (int i = 0; i < n; i++) {
lines = br.readLine().split(" ");
int columnSum=0;
for (int j = 0; j < m; j++) {
int e= Integer.parseInt(lines[j]);
columnSum+=e;
rowSum[j]+=e;
System.out.print(e+" ");
}
System.out.println(columnSum);
}
int totalSum=0;
for(int i=0;i<m;i++){
totalSum+=rowSum[i];
System.out.print(rowSum[i]+" ");
}
System.out.println(totalSum);
}
} |
[
7,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
17,
41,
13,
17,
41,
13,
20,
17,
41,
13,
20,
11,
1,
41,
13,
17,
2,
13,
17,
1,
40,
13,
30,
30,
0,
18,
13,
13,
4,
18,
13,
0,
13,
18,
13,
17,
0,
13,
18,
13,
17,
41,
13,
20,
2,
13,
17,
2,
13,
17,
14,
2,
2,
2,
2,
13,
17,
2,
13,
17,
2,
13,
17,
2,
13,
17,
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,
18,
18,
13,
13,
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,
18,
18,
13,
13,
13,
4,
18,
13,
0,
18,
18,
13,
13,
13,
18,
18,
13,
13,
13,
0,
18,
18,
13,
13,
13,
18,
18,
13,
13,
13,
0,
18,
18,
13,
13,
13,
18,
18,
13,
13,
13,
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,
4,
18,
18,
13,
13,
18,
18,
13,
13,
13,
14,
2,
13,
13,
30,
4,
18,
18,
13,
13,
17,
4,
18,
18,
13,
13,
17,
4,
18,
13,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
249,
8
],
[
249,
9
],
[
9,
10
],
[
9,
11
],
[
11,
12
],
[
12,
13
],
[
12,
14
],
[
11,
15
],
[
15,
16
],
[
15,
17
],
[
11,
18
],
[
18,
19
],
[
18,
20
],
[
11,
22
],
[
22,
23
],
[
22,
24
],
[
11,
25
],
[
25,
26
],
[
26,
27
],
[
27,
28
],
[
27,
29
],
[
25,
30
],
[
30,
31
],
[
30,
32
],
[
25,
33
],
[
33,
34
],
[
34,
35
],
[
25,
36
],
[
37,
37
],
[
37,
38
],
[
38,
39
],
[
39,
40
],
[
39,
41
],
[
38,
42
],
[
42,
43
],
[
43,
44
],
[
11,
45
],
[
45,
46
],
[
45,
47
],
[
47,
48
],
[
47,
49
],
[
11,
50
],
[
50,
51
],
[
50,
52
],
[
52,
53
],
[
52,
54
],
[
11,
55
],
[
55,
56
],
[
55,
57
],
[
58,
59
],
[
58,
60
],
[
61,
62
],
[
61,
63
],
[
11,
64
],
[
64,
65
],
[
67,
66
],
[
74,
67
],
[
67,
68
],
[
68,
69
],
[
68,
70
],
[
67,
71
],
[
71,
72
],
[
71,
73
],
[
74,
74
],
[
74,
75
],
[
74,
76
],
[
67,
77
],
[
77,
78
],
[
77,
79
],
[
64,
80
],
[
80,
81
],
[
81,
82
],
[
82,
83
],
[
83,
84
],
[
83,
85
],
[
81,
86
],
[
86,
87
],
[
86,
88
],
[
88,
89
],
[
88,
90
],
[
81,
91
],
[
91,
92
],
[
92,
93
],
[
81,
94
],
[
95,
95
],
[
95,
96
],
[
96,
97
],
[
97,
98
],
[
98,
99
],
[
98,
100
],
[
96,
101
],
[
101,
102
],
[
101,
103
],
[
103,
104
],
[
103,
105
],
[
96,
106
],
[
106,
107
],
[
107,
108
],
[
96,
109
],
[
110,
110
],
[
110,
111
],
[
111,
112
],
[
112,
113
],
[
113,
114
],
[
113,
115
],
[
112,
116
],
[
111,
117
],
[
80,
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
],
[
132,
133
],
[
133,
134
],
[
133,
135
],
[
131,
136
],
[
136,
137
],
[
136,
138
],
[
131,
139
],
[
139,
140
],
[
140,
141
],
[
131,
142
],
[
143,
143
],
[
143,
144
],
[
144,
145
],
[
145,
146
],
[
146,
147
],
[
146,
148
],
[
145,
149
],
[
144,
150
],
[
150,
151
],
[
151,
152
],
[
143,
153
],
[
153,
154
],
[
154,
155
],
[
155,
156
],
[
155,
157
],
[
154,
158
],
[
153,
159
],
[
159,
160
],
[
160,
161
],
[
160,
162
],
[
159,
163
],
[
143,
164
],
[
164,
165
],
[
165,
166
],
[
166,
167
],
[
166,
168
],
[
165,
169
],
[
164,
170
],
[
170,
171
],
[
171,
172
],
[
171,
173
],
[
170,
174
],
[
143,
175
],
[
175,
176
],
[
176,
177
],
[
177,
178
],
[
177,
179
],
[
176,
180
],
[
175,
181
],
[
181,
182
],
[
182,
183
],
[
182,
184
],
[
181,
185
],
[
80,
186
],
[
186,
187
],
[
187,
188
],
[
188,
189
],
[
188,
190
],
[
186,
191
],
[
191,
192
],
[
191,
193
],
[
193,
194
],
[
193,
195
],
[
186,
196
],
[
196,
197
],
[
197,
198
],
[
186,
199
],
[
200,
200
],
[
200,
201
],
[
201,
202
],
[
202,
203
],
[
203,
204
],
[
203,
205
],
[
201,
206
],
[
206,
207
],
[
206,
208
],
[
208,
209
],
[
208,
210
],
[
201,
211
],
[
211,
212
],
[
212,
213
],
[
201,
214
],
[
215,
215
],
[
215,
216
],
[
216,
217
],
[
217,
218
],
[
218,
219
],
[
218,
220
],
[
216,
221
],
[
221,
222
],
[
222,
223
],
[
222,
224
],
[
221,
225
],
[
215,
226
],
[
226,
227
],
[
227,
228
],
[
227,
229
],
[
226,
230
],
[
230,
231
],
[
231,
232
],
[
232,
233
],
[
233,
234
],
[
233,
235
],
[
231,
236
],
[
200,
237
],
[
237,
238
],
[
238,
239
],
[
239,
240
],
[
239,
241
],
[
237,
242
],
[
80,
243
],
[
243,
244
],
[
244,
245
],
[
9,
246
],
[
246,
247
],
[
0,
248
],
[
248,
249
],
[
248,
250
]
] | [
"import java.io.IOException;\nimport java.util.Scanner;\n\npublic class Main {\n\n\tpublic static void main(String[] args) throws IOException {\n\t\tint r = 0, c = 0;\n\t\tint[] a = new int[2];\n\t\tScanner sc = new Scanner(System.in);\n\t\tfor(int i = 0; i < 2; ++i){ // ?????????????´???°????±????(????¬????)\n\t\t\ta[i] = sc.nextInt();\n\t\t\t}\n\t\tr = a[0]; c = a[1];\n\t\tint[][] mat = new int[r+1][c+1];\n\t\tif(r >= 1 || c >= 1 || r >= 100 || c >= 100){\n\t\tfor(int k = 0; k < r+1; ++k){ //???????????????\n\t\t\tfor(int l = 0; l < c+1; ++l){\n\t\t\t\tmat[r][c] = 0;\n\t\t\t}\n\t\t}\n\t\tfor(int k = 0; k < r; ++k){ //?????????????????\\???\n\t\t\tfor(int l = 0; l < c; ++l){\n\t\t\t\tmat[k][l] = sc.nextInt();\n\t\t\t\tmat[k][c] += mat[k][l]; //??????????????????????????????????¶???????\n\t\t\t\tmat[r][l] += mat[k][l]; //???????????????????????????????¶???????\n\t\t\t\tmat[r][c] += mat[k][l]; //???????????????????¶???????\n\t\t\t}\n\t\t}\n\t\tfor(int k = 0; k < r+1; ++k){ //?????????????????\\???\n\t\t\tfor(int l = 0; l < c+1; ++l){\n\t\t\t\tSystem.out.print(mat[k][l]);\n\t\t\t\tif(l != c){ //?????¬?????????????????§?????¨???????????????\n\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t}\n\t\t\t}\n\t\t\tSystem.out.println(\"\");\n\t\t}\n\t\tsc.close();\n\t}\n\t}\n}",
"import java.io.IOException;",
"IOException",
"java.io",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n\n\tpublic static void main(String[] args) throws IOException {\n\t\tint r = 0, c = 0;\n\t\tint[] a = new int[2];\n\t\tScanner sc = new Scanner(System.in);\n\t\tfor(int i = 0; i < 2; ++i){ // ?????????????´???°????±????(????¬????)\n\t\t\ta[i] = sc.nextInt();\n\t\t\t}\n\t\tr = a[0]; c = a[1];\n\t\tint[][] mat = new int[r+1][c+1];\n\t\tif(r >= 1 || c >= 1 || r >= 100 || c >= 100){\n\t\tfor(int k = 0; k < r+1; ++k){ //???????????????\n\t\t\tfor(int l = 0; l < c+1; ++l){\n\t\t\t\tmat[r][c] = 0;\n\t\t\t}\n\t\t}\n\t\tfor(int k = 0; k < r; ++k){ //?????????????????\\???\n\t\t\tfor(int l = 0; l < c; ++l){\n\t\t\t\tmat[k][l] = sc.nextInt();\n\t\t\t\tmat[k][c] += mat[k][l]; //??????????????????????????????????¶???????\n\t\t\t\tmat[r][l] += mat[k][l]; //???????????????????????????????¶???????\n\t\t\t\tmat[r][c] += mat[k][l]; //???????????????????¶???????\n\t\t\t}\n\t\t}\n\t\tfor(int k = 0; k < r+1; ++k){ //?????????????????\\???\n\t\t\tfor(int l = 0; l < c+1; ++l){\n\t\t\t\tSystem.out.print(mat[k][l]);\n\t\t\t\tif(l != c){ //?????¬?????????????????§?????¨???????????????\n\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t}\n\t\t\t}\n\t\t\tSystem.out.println(\"\");\n\t\t}\n\t\tsc.close();\n\t}\n\t}\n}",
"Main",
"public static void main(String[] args) throws IOException {\n\t\tint r = 0, c = 0;\n\t\tint[] a = new int[2];\n\t\tScanner sc = new Scanner(System.in);\n\t\tfor(int i = 0; i < 2; ++i){ // ?????????????´???°????±????(????¬????)\n\t\t\ta[i] = sc.nextInt();\n\t\t\t}\n\t\tr = a[0]; c = a[1];\n\t\tint[][] mat = new int[r+1][c+1];\n\t\tif(r >= 1 || c >= 1 || r >= 100 || c >= 100){\n\t\tfor(int k = 0; k < r+1; ++k){ //???????????????\n\t\t\tfor(int l = 0; l < c+1; ++l){\n\t\t\t\tmat[r][c] = 0;\n\t\t\t}\n\t\t}\n\t\tfor(int k = 0; k < r; ++k){ //?????????????????\\???\n\t\t\tfor(int l = 0; l < c; ++l){\n\t\t\t\tmat[k][l] = sc.nextInt();\n\t\t\t\tmat[k][c] += mat[k][l]; //??????????????????????????????????¶???????\n\t\t\t\tmat[r][l] += mat[k][l]; //???????????????????????????????¶???????\n\t\t\t\tmat[r][c] += mat[k][l]; //???????????????????¶???????\n\t\t\t}\n\t\t}\n\t\tfor(int k = 0; k < r+1; ++k){ //?????????????????\\???\n\t\t\tfor(int l = 0; l < c+1; ++l){\n\t\t\t\tSystem.out.print(mat[k][l]);\n\t\t\t\tif(l != c){ //?????¬?????????????????§?????¨???????????????\n\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t}\n\t\t\t}\n\t\t\tSystem.out.println(\"\");\n\t\t}\n\t\tsc.close();\n\t}\n\t}",
"main",
"{\n\t\tint r = 0, c = 0;\n\t\tint[] a = new int[2];\n\t\tScanner sc = new Scanner(System.in);\n\t\tfor(int i = 0; i < 2; ++i){ // ?????????????´???°????±????(????¬????)\n\t\t\ta[i] = sc.nextInt();\n\t\t\t}\n\t\tr = a[0]; c = a[1];\n\t\tint[][] mat = new int[r+1][c+1];\n\t\tif(r >= 1 || c >= 1 || r >= 100 || c >= 100){\n\t\tfor(int k = 0; k < r+1; ++k){ //???????????????\n\t\t\tfor(int l = 0; l < c+1; ++l){\n\t\t\t\tmat[r][c] = 0;\n\t\t\t}\n\t\t}\n\t\tfor(int k = 0; k < r; ++k){ //?????????????????\\???\n\t\t\tfor(int l = 0; l < c; ++l){\n\t\t\t\tmat[k][l] = sc.nextInt();\n\t\t\t\tmat[k][c] += mat[k][l]; //??????????????????????????????????¶???????\n\t\t\t\tmat[r][l] += mat[k][l]; //???????????????????????????????¶???????\n\t\t\t\tmat[r][c] += mat[k][l]; //???????????????????¶???????\n\t\t\t}\n\t\t}\n\t\tfor(int k = 0; k < r+1; ++k){ //?????????????????\\???\n\t\t\tfor(int l = 0; l < c+1; ++l){\n\t\t\t\tSystem.out.print(mat[k][l]);\n\t\t\t\tif(l != c){ //?????¬?????????????????§?????¨???????????????\n\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t}\n\t\t\t}\n\t\t\tSystem.out.println(\"\");\n\t\t}\n\t\tsc.close();\n\t}\n\t}",
"int r = 0",
"r",
"0",
"c = 0;",
"c",
"0",
"int[] a = new int[2];",
"a",
"new int[2]",
"2",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"for(int i = 0; i < 2; ++i){ // ?????????????´???°????±????(????¬????)\n\t\t\ta[i] = sc.nextInt();\n\t\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < 2",
"i",
"2",
"++i",
"++i",
"i",
"{ // ?????????????´???°????±????(????¬????)\n\t\t\ta[i] = sc.nextInt();\n\t\t\t}",
"{ // ?????????????´???°????±????(????¬????)\n\t\t\ta[i] = sc.nextInt();\n\t\t\t}",
"a[i] = sc.nextInt()",
"a[i]",
"a",
"i",
"sc.nextInt()",
"sc.nextInt",
"sc",
"r = a[0]",
"r",
"a[0]",
"a",
"0",
"c = a[1]",
"c",
"a[1]",
"a",
"1",
"int[][] mat = new int[r+1][c+1];",
"mat",
"new int[r+1][c+1]",
"r+1",
"r",
"1",
"c+1",
"c",
"1",
"if(r >= 1 || c >= 1 || r >= 100 || c >= 100){\n\t\tfor(int k = 0; k < r+1; ++k){ //???????????????\n\t\t\tfor(int l = 0; l < c+1; ++l){\n\t\t\t\tmat[r][c] = 0;\n\t\t\t}\n\t\t}\n\t\tfor(int k = 0; k < r; ++k){ //?????????????????\\???\n\t\t\tfor(int l = 0; l < c; ++l){\n\t\t\t\tmat[k][l] = sc.nextInt();\n\t\t\t\tmat[k][c] += mat[k][l]; //??????????????????????????????????¶???????\n\t\t\t\tmat[r][l] += mat[k][l]; //???????????????????????????????¶???????\n\t\t\t\tmat[r][c] += mat[k][l]; //???????????????????¶???????\n\t\t\t}\n\t\t}\n\t\tfor(int k = 0; k < r+1; ++k){ //?????????????????\\???\n\t\t\tfor(int l = 0; l < c+1; ++l){\n\t\t\t\tSystem.out.print(mat[k][l]);\n\t\t\t\tif(l != c){ //?????¬?????????????????§?????¨???????????????\n\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t}\n\t\t\t}\n\t\t\tSystem.out.println(\"\");\n\t\t}\n\t\tsc.close();\n\t}",
"r >= 1 || c >= 1 || r >= 100 || c >= 100",
"r >= 100",
"r >= 1 || c >= 1 || r >= 100 || c >= 100",
"r >= 1",
"r",
"1",
"c >= 1",
"c",
"1",
"r >= 100",
"r",
"100",
"c >= 100",
"c",
"100",
"{\n\t\tfor(int k = 0; k < r+1; ++k){ //???????????????\n\t\t\tfor(int l = 0; l < c+1; ++l){\n\t\t\t\tmat[r][c] = 0;\n\t\t\t}\n\t\t}\n\t\tfor(int k = 0; k < r; ++k){ //?????????????????\\???\n\t\t\tfor(int l = 0; l < c; ++l){\n\t\t\t\tmat[k][l] = sc.nextInt();\n\t\t\t\tmat[k][c] += mat[k][l]; //??????????????????????????????????¶???????\n\t\t\t\tmat[r][l] += mat[k][l]; //???????????????????????????????¶???????\n\t\t\t\tmat[r][c] += mat[k][l]; //???????????????????¶???????\n\t\t\t}\n\t\t}\n\t\tfor(int k = 0; k < r+1; ++k){ //?????????????????\\???\n\t\t\tfor(int l = 0; l < c+1; ++l){\n\t\t\t\tSystem.out.print(mat[k][l]);\n\t\t\t\tif(l != c){ //?????¬?????????????????§?????¨???????????????\n\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t}\n\t\t\t}\n\t\t\tSystem.out.println(\"\");\n\t\t}\n\t\tsc.close();\n\t}",
"for(int k = 0; k < r+1; ++k){ //???????????????\n\t\t\tfor(int l = 0; l < c+1; ++l){\n\t\t\t\tmat[r][c] = 0;\n\t\t\t}\n\t\t}",
"int k = 0;",
"int k = 0;",
"k",
"0",
"k < r+1",
"k",
"r+1",
"r",
"1",
"++k",
"++k",
"k",
"{ //???????????????\n\t\t\tfor(int l = 0; l < c+1; ++l){\n\t\t\t\tmat[r][c] = 0;\n\t\t\t}\n\t\t}",
"{ //???????????????\n\t\t\tfor(int l = 0; l < c+1; ++l){\n\t\t\t\tmat[r][c] = 0;\n\t\t\t}\n\t\t}",
"for(int l = 0; l < c+1; ++l){\n\t\t\t\tmat[r][c] = 0;\n\t\t\t}",
"int l = 0;",
"int l = 0;",
"l",
"0",
"l < c+1",
"l",
"c+1",
"c",
"1",
"++l",
"++l",
"l",
"{\n\t\t\t\tmat[r][c] = 0;\n\t\t\t}",
"{\n\t\t\t\tmat[r][c] = 0;\n\t\t\t}",
"mat[r][c] = 0",
"mat[r][c]",
"mat[r]",
"mat",
"r",
"c",
"0",
"for(int k = 0; k < r; ++k){ //?????????????????\\???\n\t\t\tfor(int l = 0; l < c; ++l){\n\t\t\t\tmat[k][l] = sc.nextInt();\n\t\t\t\tmat[k][c] += mat[k][l]; //??????????????????????????????????¶???????\n\t\t\t\tmat[r][l] += mat[k][l]; //???????????????????????????????¶???????\n\t\t\t\tmat[r][c] += mat[k][l]; //???????????????????¶???????\n\t\t\t}\n\t\t}",
"int k = 0;",
"int k = 0;",
"k",
"0",
"k < r",
"k",
"r",
"++k",
"++k",
"k",
"{ //?????????????????\\???\n\t\t\tfor(int l = 0; l < c; ++l){\n\t\t\t\tmat[k][l] = sc.nextInt();\n\t\t\t\tmat[k][c] += mat[k][l]; //??????????????????????????????????¶???????\n\t\t\t\tmat[r][l] += mat[k][l]; //???????????????????????????????¶???????\n\t\t\t\tmat[r][c] += mat[k][l]; //???????????????????¶???????\n\t\t\t}\n\t\t}",
"{ //?????????????????\\???\n\t\t\tfor(int l = 0; l < c; ++l){\n\t\t\t\tmat[k][l] = sc.nextInt();\n\t\t\t\tmat[k][c] += mat[k][l]; //??????????????????????????????????¶???????\n\t\t\t\tmat[r][l] += mat[k][l]; //???????????????????????????????¶???????\n\t\t\t\tmat[r][c] += mat[k][l]; //???????????????????¶???????\n\t\t\t}\n\t\t}",
"for(int l = 0; l < c; ++l){\n\t\t\t\tmat[k][l] = sc.nextInt();\n\t\t\t\tmat[k][c] += mat[k][l]; //??????????????????????????????????¶???????\n\t\t\t\tmat[r][l] += mat[k][l]; //???????????????????????????????¶???????\n\t\t\t\tmat[r][c] += mat[k][l]; //???????????????????¶???????\n\t\t\t}",
"int l = 0;",
"int l = 0;",
"l",
"0",
"l < c",
"l",
"c",
"++l",
"++l",
"l",
"{\n\t\t\t\tmat[k][l] = sc.nextInt();\n\t\t\t\tmat[k][c] += mat[k][l]; //??????????????????????????????????¶???????\n\t\t\t\tmat[r][l] += mat[k][l]; //???????????????????????????????¶???????\n\t\t\t\tmat[r][c] += mat[k][l]; //???????????????????¶???????\n\t\t\t}",
"{\n\t\t\t\tmat[k][l] = sc.nextInt();\n\t\t\t\tmat[k][c] += mat[k][l]; //??????????????????????????????????¶???????\n\t\t\t\tmat[r][l] += mat[k][l]; //???????????????????????????????¶???????\n\t\t\t\tmat[r][c] += mat[k][l]; //???????????????????¶???????\n\t\t\t}",
"mat[k][l] = sc.nextInt()",
"mat[k][l]",
"mat[k]",
"mat",
"k",
"l",
"sc.nextInt()",
"sc.nextInt",
"sc",
"mat[k][c] += mat[k][l]",
"mat[k][c]",
"mat[k]",
"mat",
"k",
"c",
"mat[k][l]",
"mat[k]",
"mat",
"k",
"l",
"mat[r][l] += mat[k][l]",
"mat[r][l]",
"mat[r]",
"mat",
"r",
"l",
"mat[k][l]",
"mat[k]",
"mat",
"k",
"l",
"mat[r][c] += mat[k][l]",
"mat[r][c]",
"mat[r]",
"mat",
"r",
"c",
"mat[k][l]",
"mat[k]",
"mat",
"k",
"l",
"for(int k = 0; k < r+1; ++k){ //?????????????????\\???\n\t\t\tfor(int l = 0; l < c+1; ++l){\n\t\t\t\tSystem.out.print(mat[k][l]);\n\t\t\t\tif(l != c){ //?????¬?????????????????§?????¨???????????????\n\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t}\n\t\t\t}\n\t\t\tSystem.out.println(\"\");\n\t\t}",
"int k = 0;",
"int k = 0;",
"k",
"0",
"k < r+1",
"k",
"r+1",
"r",
"1",
"++k",
"++k",
"k",
"{ //?????????????????\\???\n\t\t\tfor(int l = 0; l < c+1; ++l){\n\t\t\t\tSystem.out.print(mat[k][l]);\n\t\t\t\tif(l != c){ //?????¬?????????????????§?????¨???????????????\n\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t}\n\t\t\t}\n\t\t\tSystem.out.println(\"\");\n\t\t}",
"{ //?????????????????\\???\n\t\t\tfor(int l = 0; l < c+1; ++l){\n\t\t\t\tSystem.out.print(mat[k][l]);\n\t\t\t\tif(l != c){ //?????¬?????????????????§?????¨???????????????\n\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t}\n\t\t\t}\n\t\t\tSystem.out.println(\"\");\n\t\t}",
"for(int l = 0; l < c+1; ++l){\n\t\t\t\tSystem.out.print(mat[k][l]);\n\t\t\t\tif(l != c){ //?????¬?????????????????§?????¨???????????????\n\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t}\n\t\t\t}",
"int l = 0;",
"int l = 0;",
"l",
"0",
"l < c+1",
"l",
"c+1",
"c",
"1",
"++l",
"++l",
"l",
"{\n\t\t\t\tSystem.out.print(mat[k][l]);\n\t\t\t\tif(l != c){ //?????¬?????????????????§?????¨???????????????\n\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t}\n\t\t\t}",
"{\n\t\t\t\tSystem.out.print(mat[k][l]);\n\t\t\t\tif(l != c){ //?????¬?????????????????§?????¨???????????????\n\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t}\n\t\t\t}",
"System.out.print(mat[k][l])",
"System.out.print",
"System.out",
"System",
"System.out",
"mat[k][l]",
"mat[k]",
"mat",
"k",
"l",
"if(l != c){ //?????¬?????????????????§?????¨???????????????\n\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t}",
"l != c",
"l",
"c",
"{ //?????¬?????????????????§?????¨???????????????\n\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t}",
"System.out.print(\" \")",
"System.out.print",
"System.out",
"System",
"System.out",
"\" \"",
"System.out.println(\"\")",
"System.out.println",
"System.out",
"System",
"System.out",
"\"\"",
"sc.close()",
"sc.close",
"sc",
"String[] args",
"args",
"public class Main {\n\n\tpublic static void main(String[] args) throws IOException {\n\t\tint r = 0, c = 0;\n\t\tint[] a = new int[2];\n\t\tScanner sc = new Scanner(System.in);\n\t\tfor(int i = 0; i < 2; ++i){ // ?????????????´???°????±????(????¬????)\n\t\t\ta[i] = sc.nextInt();\n\t\t\t}\n\t\tr = a[0]; c = a[1];\n\t\tint[][] mat = new int[r+1][c+1];\n\t\tif(r >= 1 || c >= 1 || r >= 100 || c >= 100){\n\t\tfor(int k = 0; k < r+1; ++k){ //???????????????\n\t\t\tfor(int l = 0; l < c+1; ++l){\n\t\t\t\tmat[r][c] = 0;\n\t\t\t}\n\t\t}\n\t\tfor(int k = 0; k < r; ++k){ //?????????????????\\???\n\t\t\tfor(int l = 0; l < c; ++l){\n\t\t\t\tmat[k][l] = sc.nextInt();\n\t\t\t\tmat[k][c] += mat[k][l]; //??????????????????????????????????¶???????\n\t\t\t\tmat[r][l] += mat[k][l]; //???????????????????????????????¶???????\n\t\t\t\tmat[r][c] += mat[k][l]; //???????????????????¶???????\n\t\t\t}\n\t\t}\n\t\tfor(int k = 0; k < r+1; ++k){ //?????????????????\\???\n\t\t\tfor(int l = 0; l < c+1; ++l){\n\t\t\t\tSystem.out.print(mat[k][l]);\n\t\t\t\tif(l != c){ //?????¬?????????????????§?????¨???????????????\n\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t}\n\t\t\t}\n\t\t\tSystem.out.println(\"\");\n\t\t}\n\t\tsc.close();\n\t}\n\t}\n}",
"public class Main {\n\n\tpublic static void main(String[] args) throws IOException {\n\t\tint r = 0, c = 0;\n\t\tint[] a = new int[2];\n\t\tScanner sc = new Scanner(System.in);\n\t\tfor(int i = 0; i < 2; ++i){ // ?????????????´???°????±????(????¬????)\n\t\t\ta[i] = sc.nextInt();\n\t\t\t}\n\t\tr = a[0]; c = a[1];\n\t\tint[][] mat = new int[r+1][c+1];\n\t\tif(r >= 1 || c >= 1 || r >= 100 || c >= 100){\n\t\tfor(int k = 0; k < r+1; ++k){ //???????????????\n\t\t\tfor(int l = 0; l < c+1; ++l){\n\t\t\t\tmat[r][c] = 0;\n\t\t\t}\n\t\t}\n\t\tfor(int k = 0; k < r; ++k){ //?????????????????\\???\n\t\t\tfor(int l = 0; l < c; ++l){\n\t\t\t\tmat[k][l] = sc.nextInt();\n\t\t\t\tmat[k][c] += mat[k][l]; //??????????????????????????????????¶???????\n\t\t\t\tmat[r][l] += mat[k][l]; //???????????????????????????????¶???????\n\t\t\t\tmat[r][c] += mat[k][l]; //???????????????????¶???????\n\t\t\t}\n\t\t}\n\t\tfor(int k = 0; k < r+1; ++k){ //?????????????????\\???\n\t\t\tfor(int l = 0; l < c+1; ++l){\n\t\t\t\tSystem.out.print(mat[k][l]);\n\t\t\t\tif(l != c){ //?????¬?????????????????§?????¨???????????????\n\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t}\n\t\t\t}\n\t\t\tSystem.out.println(\"\");\n\t\t}\n\t\tsc.close();\n\t}\n\t}\n}",
"Main"
] | import java.io.IOException;
import java.util.Scanner;
public class Main {
public static void main(String[] args) throws IOException {
int r = 0, c = 0;
int[] a = new int[2];
Scanner sc = new Scanner(System.in);
for(int i = 0; i < 2; ++i){ // ?????????????´???°????±????(????¬????)
a[i] = sc.nextInt();
}
r = a[0]; c = a[1];
int[][] mat = new int[r+1][c+1];
if(r >= 1 || c >= 1 || r >= 100 || c >= 100){
for(int k = 0; k < r+1; ++k){ //???????????????
for(int l = 0; l < c+1; ++l){
mat[r][c] = 0;
}
}
for(int k = 0; k < r; ++k){ //?????????????????\???
for(int l = 0; l < c; ++l){
mat[k][l] = sc.nextInt();
mat[k][c] += mat[k][l]; //??????????????????????????????????¶???????
mat[r][l] += mat[k][l]; //???????????????????????????????¶???????
mat[r][c] += mat[k][l]; //???????????????????¶???????
}
}
for(int k = 0; k < r+1; ++k){ //?????????????????\???
for(int l = 0; l < c+1; ++l){
System.out.print(mat[k][l]);
if(l != c){ //?????¬?????????????????§?????¨???????????????
System.out.print(" ");
}
}
System.out.println("");
}
sc.close();
}
}
} |
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
41,
13,
20,
2,
13,
17,
2,
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,
18,
18,
13,
13,
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,
0,
18,
18,
13,
13,
13,
18,
18,
13,
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,
18,
18,
13,
13,
13,
0,
13,
18,
18,
13,
13,
13,
0,
18,
18,
13,
13,
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,
14,
2,
13,
13,
30,
4,
18,
18,
13,
13,
2,
18,
18,
13,
13,
13,
17,
30,
4,
18,
18,
13,
13,
2,
18,
18,
13,
13,
13,
17,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
216,
5
],
[
216,
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
],
[
19,
20
],
[
20,
21
],
[
8,
22
],
[
22,
23
],
[
22,
24
],
[
25,
26
],
[
25,
27
],
[
28,
29
],
[
28,
30
],
[
8,
31
],
[
31,
32
],
[
31,
33
],
[
8,
34
],
[
34,
35
],
[
35,
36
],
[
36,
37
],
[
36,
38
],
[
34,
39
],
[
39,
40
],
[
39,
41
],
[
34,
42
],
[
42,
43
],
[
43,
44
],
[
34,
45
],
[
46,
46
],
[
46,
47
],
[
47,
48
],
[
48,
49
],
[
49,
50
],
[
49,
51
],
[
47,
52
],
[
52,
53
],
[
52,
54
],
[
47,
55
],
[
55,
56
],
[
56,
57
],
[
47,
58
],
[
59,
59
],
[
59,
60
],
[
60,
61
],
[
61,
62
],
[
62,
63
],
[
62,
64
],
[
61,
65
],
[
60,
66
],
[
66,
67
],
[
67,
68
],
[
8,
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
],
[
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
],
[
96,
97
],
[
97,
98
],
[
97,
99
],
[
96,
100
],
[
95,
101
],
[
101,
102
],
[
102,
103
],
[
102,
104
],
[
101,
105
],
[
8,
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
],
[
120,
121
],
[
121,
122
],
[
121,
123
],
[
119,
124
],
[
124,
125
],
[
124,
126
],
[
119,
127
],
[
127,
128
],
[
128,
129
],
[
119,
130
],
[
131,
131
],
[
131,
132
],
[
132,
133
],
[
133,
134
],
[
134,
135
],
[
134,
136
],
[
133,
137
],
[
132,
138
],
[
138,
139
],
[
139,
140
],
[
139,
141
],
[
138,
142
],
[
131,
143
],
[
143,
144
],
[
143,
145
],
[
145,
146
],
[
146,
147
],
[
146,
148
],
[
145,
149
],
[
8,
150
],
[
150,
151
],
[
151,
152
],
[
152,
153
],
[
152,
154
],
[
151,
155
],
[
150,
156
],
[
8,
157
],
[
157,
158
],
[
158,
159
],
[
159,
160
],
[
159,
161
],
[
157,
162
],
[
162,
163
],
[
162,
164
],
[
157,
165
],
[
165,
166
],
[
166,
167
],
[
157,
168
],
[
169,
169
],
[
169,
170
],
[
170,
171
],
[
171,
172
],
[
172,
173
],
[
172,
174
],
[
170,
175
],
[
175,
176
],
[
175,
177
],
[
170,
178
],
[
178,
179
],
[
179,
180
],
[
170,
181
],
[
182,
182
],
[
182,
183
],
[
183,
184
],
[
184,
185
],
[
184,
186
],
[
183,
187
],
[
187,
188
],
[
188,
189
],
[
189,
190
],
[
190,
191
],
[
190,
192
],
[
188,
193
],
[
193,
194
],
[
194,
195
],
[
195,
196
],
[
195,
197
],
[
194,
198
],
[
193,
199
],
[
183,
200
],
[
200,
201
],
[
201,
202
],
[
202,
203
],
[
203,
204
],
[
203,
205
],
[
201,
206
],
[
206,
207
],
[
207,
208
],
[
208,
209
],
[
208,
210
],
[
207,
211
],
[
206,
212
],
[
6,
213
],
[
213,
214
],
[
0,
215
],
[
215,
216
],
[
215,
217
]
] | [
"import java.util.Scanner;\n\npublic class Main{\n public static void main(String[]args){\n Scanner scn = new Scanner(System.in);\n \n int r = scn.nextInt();\n int c = scn.nextInt();\n int [][]rc = new int[r+1][c+1];\n int sum =0;\n \n for(int i=0;i<r;i++){\n for(int j=0;j<c;j++){\n rc[i][j]=scn.nextInt();\n }\n }\n \n for(int i=0;i<r;i++){\n for(int j=0;j<c;j++){\n rc[i][c]+=rc[i][j];\n }\n }\n \n\n for(int i=0;i<r;i++){\n for(int j=0;j<c;j++){\n rc[r][j]+=rc[i][j];\n sum+=rc[i][j];\n }\n }\n \n rc[r][c]=sum;\n\n for(int i=0;i<=r;i++){\n for(int j=0;j<=c;j++){\n if(j==c){\n System.out.print(rc[i][j]+\"\\n\");\n }else{\n System.out.print(rc[i][j]+\" \");\n } \n }\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 scn = new Scanner(System.in);\n \n int r = scn.nextInt();\n int c = scn.nextInt();\n int [][]rc = new int[r+1][c+1];\n int sum =0;\n \n for(int i=0;i<r;i++){\n for(int j=0;j<c;j++){\n rc[i][j]=scn.nextInt();\n }\n }\n \n for(int i=0;i<r;i++){\n for(int j=0;j<c;j++){\n rc[i][c]+=rc[i][j];\n }\n }\n \n\n for(int i=0;i<r;i++){\n for(int j=0;j<c;j++){\n rc[r][j]+=rc[i][j];\n sum+=rc[i][j];\n }\n }\n \n rc[r][c]=sum;\n\n for(int i=0;i<=r;i++){\n for(int j=0;j<=c;j++){\n if(j==c){\n System.out.print(rc[i][j]+\"\\n\");\n }else{\n System.out.print(rc[i][j]+\" \");\n } \n }\n } \n \n \n \n }\n}",
"Main",
"public static void main(String[]args){\n Scanner scn = new Scanner(System.in);\n \n int r = scn.nextInt();\n int c = scn.nextInt();\n int [][]rc = new int[r+1][c+1];\n int sum =0;\n \n for(int i=0;i<r;i++){\n for(int j=0;j<c;j++){\n rc[i][j]=scn.nextInt();\n }\n }\n \n for(int i=0;i<r;i++){\n for(int j=0;j<c;j++){\n rc[i][c]+=rc[i][j];\n }\n }\n \n\n for(int i=0;i<r;i++){\n for(int j=0;j<c;j++){\n rc[r][j]+=rc[i][j];\n sum+=rc[i][j];\n }\n }\n \n rc[r][c]=sum;\n\n for(int i=0;i<=r;i++){\n for(int j=0;j<=c;j++){\n if(j==c){\n System.out.print(rc[i][j]+\"\\n\");\n }else{\n System.out.print(rc[i][j]+\" \");\n } \n }\n } \n \n \n \n }",
"main",
"{\n Scanner scn = new Scanner(System.in);\n \n int r = scn.nextInt();\n int c = scn.nextInt();\n int [][]rc = new int[r+1][c+1];\n int sum =0;\n \n for(int i=0;i<r;i++){\n for(int j=0;j<c;j++){\n rc[i][j]=scn.nextInt();\n }\n }\n \n for(int i=0;i<r;i++){\n for(int j=0;j<c;j++){\n rc[i][c]+=rc[i][j];\n }\n }\n \n\n for(int i=0;i<r;i++){\n for(int j=0;j<c;j++){\n rc[r][j]+=rc[i][j];\n sum+=rc[i][j];\n }\n }\n \n rc[r][c]=sum;\n\n for(int i=0;i<=r;i++){\n for(int j=0;j<=c;j++){\n if(j==c){\n System.out.print(rc[i][j]+\"\\n\");\n }else{\n System.out.print(rc[i][j]+\" \");\n } \n }\n } \n \n \n \n }",
"Scanner scn = new Scanner(System.in);",
"scn",
"new Scanner(System.in)",
"int r = scn.nextInt();",
"r",
"scn.nextInt()",
"scn.nextInt",
"scn",
"int c = scn.nextInt();",
"c",
"scn.nextInt()",
"scn.nextInt",
"scn",
"int [][]rc = new int[r+1][c+1];",
"rc",
"new int[r+1][c+1]",
"r+1",
"r",
"1",
"c+1",
"c",
"1",
"int sum =0;",
"sum",
"0",
"for(int i=0;i<r;i++){\n for(int j=0;j<c;j++){\n rc[i][j]=scn.nextInt();\n }\n }",
"int i=0;",
"int i=0;",
"i",
"0",
"i<r",
"i",
"r",
"i++",
"i++",
"i",
"{\n for(int j=0;j<c;j++){\n rc[i][j]=scn.nextInt();\n }\n }",
"{\n for(int j=0;j<c;j++){\n rc[i][j]=scn.nextInt();\n }\n }",
"for(int j=0;j<c;j++){\n rc[i][j]=scn.nextInt();\n }",
"int j=0;",
"int j=0;",
"j",
"0",
"j<c",
"j",
"c",
"j++",
"j++",
"j",
"{\n rc[i][j]=scn.nextInt();\n }",
"{\n rc[i][j]=scn.nextInt();\n }",
"rc[i][j]=scn.nextInt()",
"rc[i][j]",
"rc[i]",
"rc",
"i",
"j",
"scn.nextInt()",
"scn.nextInt",
"scn",
"for(int i=0;i<r;i++){\n for(int j=0;j<c;j++){\n rc[i][c]+=rc[i][j];\n }\n }",
"int i=0;",
"int i=0;",
"i",
"0",
"i<r",
"i",
"r",
"i++",
"i++",
"i",
"{\n for(int j=0;j<c;j++){\n rc[i][c]+=rc[i][j];\n }\n }",
"{\n for(int j=0;j<c;j++){\n rc[i][c]+=rc[i][j];\n }\n }",
"for(int j=0;j<c;j++){\n rc[i][c]+=rc[i][j];\n }",
"int j=0;",
"int j=0;",
"j",
"0",
"j<c",
"j",
"c",
"j++",
"j++",
"j",
"{\n rc[i][c]+=rc[i][j];\n }",
"{\n rc[i][c]+=rc[i][j];\n }",
"rc[i][c]+=rc[i][j]",
"rc[i][c]",
"rc[i]",
"rc",
"i",
"c",
"rc[i][j]",
"rc[i]",
"rc",
"i",
"j",
"for(int i=0;i<r;i++){\n for(int j=0;j<c;j++){\n rc[r][j]+=rc[i][j];\n sum+=rc[i][j];\n }\n }",
"int i=0;",
"int i=0;",
"i",
"0",
"i<r",
"i",
"r",
"i++",
"i++",
"i",
"{\n for(int j=0;j<c;j++){\n rc[r][j]+=rc[i][j];\n sum+=rc[i][j];\n }\n }",
"{\n for(int j=0;j<c;j++){\n rc[r][j]+=rc[i][j];\n sum+=rc[i][j];\n }\n }",
"for(int j=0;j<c;j++){\n rc[r][j]+=rc[i][j];\n sum+=rc[i][j];\n }",
"int j=0;",
"int j=0;",
"j",
"0",
"j<c",
"j",
"c",
"j++",
"j++",
"j",
"{\n rc[r][j]+=rc[i][j];\n sum+=rc[i][j];\n }",
"{\n rc[r][j]+=rc[i][j];\n sum+=rc[i][j];\n }",
"rc[r][j]+=rc[i][j]",
"rc[r][j]",
"rc[r]",
"rc",
"r",
"j",
"rc[i][j]",
"rc[i]",
"rc",
"i",
"j",
"sum+=rc[i][j]",
"sum",
"rc[i][j]",
"rc[i]",
"rc",
"i",
"j",
"rc[r][c]=sum",
"rc[r][c]",
"rc[r]",
"rc",
"r",
"c",
"sum",
"for(int i=0;i<=r;i++){\n for(int j=0;j<=c;j++){\n if(j==c){\n System.out.print(rc[i][j]+\"\\n\");\n }else{\n System.out.print(rc[i][j]+\" \");\n } \n }\n }",
"int i=0;",
"int i=0;",
"i",
"0",
"i<=r",
"i",
"r",
"i++",
"i++",
"i",
"{\n for(int j=0;j<=c;j++){\n if(j==c){\n System.out.print(rc[i][j]+\"\\n\");\n }else{\n System.out.print(rc[i][j]+\" \");\n } \n }\n }",
"{\n for(int j=0;j<=c;j++){\n if(j==c){\n System.out.print(rc[i][j]+\"\\n\");\n }else{\n System.out.print(rc[i][j]+\" \");\n } \n }\n }",
"for(int j=0;j<=c;j++){\n if(j==c){\n System.out.print(rc[i][j]+\"\\n\");\n }else{\n System.out.print(rc[i][j]+\" \");\n } \n }",
"int j=0;",
"int j=0;",
"j",
"0",
"j<=c",
"j",
"c",
"j++",
"j++",
"j",
"{\n if(j==c){\n System.out.print(rc[i][j]+\"\\n\");\n }else{\n System.out.print(rc[i][j]+\" \");\n } \n }",
"{\n if(j==c){\n System.out.print(rc[i][j]+\"\\n\");\n }else{\n System.out.print(rc[i][j]+\" \");\n } \n }",
"if(j==c){\n System.out.print(rc[i][j]+\"\\n\");\n }else{\n System.out.print(rc[i][j]+\" \");\n }",
"j==c",
"j",
"c",
"{\n System.out.print(rc[i][j]+\"\\n\");\n }",
"System.out.print(rc[i][j]+\"\\n\")",
"System.out.print",
"System.out",
"System",
"System.out",
"rc[i][j]+\"\\n\"",
"rc[i][j]",
"rc[i]",
"rc",
"i",
"j",
"\"\\n\"",
"{\n System.out.print(rc[i][j]+\" \");\n }",
"System.out.print(rc[i][j]+\" \")",
"System.out.print",
"System.out",
"System",
"System.out",
"rc[i][j]+\" \"",
"rc[i][j]",
"rc[i]",
"rc",
"i",
"j",
"\" \"",
"String[]args",
"args",
"public class Main{\n public static void main(String[]args){\n Scanner scn = new Scanner(System.in);\n \n int r = scn.nextInt();\n int c = scn.nextInt();\n int [][]rc = new int[r+1][c+1];\n int sum =0;\n \n for(int i=0;i<r;i++){\n for(int j=0;j<c;j++){\n rc[i][j]=scn.nextInt();\n }\n }\n \n for(int i=0;i<r;i++){\n for(int j=0;j<c;j++){\n rc[i][c]+=rc[i][j];\n }\n }\n \n\n for(int i=0;i<r;i++){\n for(int j=0;j<c;j++){\n rc[r][j]+=rc[i][j];\n sum+=rc[i][j];\n }\n }\n \n rc[r][c]=sum;\n\n for(int i=0;i<=r;i++){\n for(int j=0;j<=c;j++){\n if(j==c){\n System.out.print(rc[i][j]+\"\\n\");\n }else{\n System.out.print(rc[i][j]+\" \");\n } \n }\n } \n \n \n \n }\n}",
"public class Main{\n public static void main(String[]args){\n Scanner scn = new Scanner(System.in);\n \n int r = scn.nextInt();\n int c = scn.nextInt();\n int [][]rc = new int[r+1][c+1];\n int sum =0;\n \n for(int i=0;i<r;i++){\n for(int j=0;j<c;j++){\n rc[i][j]=scn.nextInt();\n }\n }\n \n for(int i=0;i<r;i++){\n for(int j=0;j<c;j++){\n rc[i][c]+=rc[i][j];\n }\n }\n \n\n for(int i=0;i<r;i++){\n for(int j=0;j<c;j++){\n rc[r][j]+=rc[i][j];\n sum+=rc[i][j];\n }\n }\n \n rc[r][c]=sum;\n\n for(int i=0;i<=r;i++){\n for(int j=0;j<=c;j++){\n if(j==c){\n System.out.print(rc[i][j]+\"\\n\");\n }else{\n System.out.print(rc[i][j]+\" \");\n } \n }\n } \n \n \n \n }\n}",
"Main"
] | import java.util.Scanner;
public class Main{
public static void main(String[]args){
Scanner scn = new Scanner(System.in);
int r = scn.nextInt();
int c = scn.nextInt();
int [][]rc = new int[r+1][c+1];
int sum =0;
for(int i=0;i<r;i++){
for(int j=0;j<c;j++){
rc[i][j]=scn.nextInt();
}
}
for(int i=0;i<r;i++){
for(int j=0;j<c;j++){
rc[i][c]+=rc[i][j];
}
}
for(int i=0;i<r;i++){
for(int j=0;j<c;j++){
rc[r][j]+=rc[i][j];
sum+=rc[i][j];
}
}
rc[r][c]=sum;
for(int i=0;i<=r;i++){
for(int j=0;j<=c;j++){
if(j==c){
System.out.print(rc[i][j]+"\n");
}else{
System.out.print(rc[i][j]+" ");
}
}
}
}
} |
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
41,
13,
20,
2,
13,
17,
2,
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,
18,
18,
13,
13,
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,
0,
13,
2,
13,
18,
18,
13,
13,
13,
0,
18,
18,
13,
13,
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,
0,
13,
2,
13,
18,
18,
13,
13,
13,
0,
18,
18,
13,
13,
13,
13,
0,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
2,
13,
18,
18,
13,
13,
13,
0,
18,
18,
13,
13,
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,
14,
2,
13,
13,
30,
4,
18,
18,
13,
13,
18,
18,
13,
13,
13,
30,
4,
18,
18,
13,
13,
2,
18,
18,
13,
13,
13,
17,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
245,
5
],
[
245,
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
],
[
19,
20
],
[
20,
21
],
[
8,
22
],
[
22,
23
],
[
22,
24
],
[
25,
26
],
[
25,
27
],
[
28,
29
],
[
28,
30
],
[
8,
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
],
[
58,
62
],
[
57,
63
],
[
63,
64
],
[
64,
65
],
[
8,
66
],
[
66,
67
],
[
66,
68
],
[
8,
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
],
[
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
],
[
100,
102
],
[
99,
103
],
[
81,
104
],
[
104,
105
],
[
105,
106
],
[
106,
107
],
[
106,
108
],
[
105,
109
],
[
104,
110
],
[
81,
111
],
[
111,
112
],
[
111,
113
],
[
8,
114
],
[
114,
115
],
[
115,
116
],
[
116,
117
],
[
116,
118
],
[
114,
119
],
[
119,
120
],
[
119,
121
],
[
114,
122
],
[
122,
123
],
[
123,
124
],
[
114,
125
],
[
126,
126
],
[
126,
127
],
[
127,
128
],
[
128,
129
],
[
129,
130
],
[
129,
131
],
[
127,
132
],
[
132,
133
],
[
132,
134
],
[
127,
135
],
[
135,
136
],
[
136,
137
],
[
127,
138
],
[
139,
139
],
[
139,
140
],
[
140,
141
],
[
140,
142
],
[
142,
143
],
[
142,
144
],
[
144,
145
],
[
145,
146
],
[
145,
147
],
[
144,
148
],
[
126,
149
],
[
149,
150
],
[
150,
151
],
[
151,
152
],
[
151,
153
],
[
150,
154
],
[
149,
155
],
[
126,
156
],
[
156,
157
],
[
156,
158
],
[
8,
159
],
[
159,
160
],
[
160,
161
],
[
161,
162
],
[
161,
163
],
[
159,
164
],
[
164,
165
],
[
164,
166
],
[
159,
167
],
[
167,
168
],
[
168,
169
],
[
159,
170
],
[
171,
171
],
[
171,
172
],
[
172,
173
],
[
172,
174
],
[
174,
175
],
[
174,
176
],
[
176,
177
],
[
177,
178
],
[
177,
179
],
[
176,
180
],
[
8,
181
],
[
181,
182
],
[
182,
183
],
[
183,
184
],
[
183,
185
],
[
182,
186
],
[
181,
187
],
[
8,
188
],
[
188,
189
],
[
189,
190
],
[
190,
191
],
[
190,
192
],
[
188,
193
],
[
193,
194
],
[
193,
195
],
[
188,
196
],
[
196,
197
],
[
197,
198
],
[
188,
199
],
[
200,
200
],
[
200,
201
],
[
201,
202
],
[
202,
203
],
[
203,
204
],
[
203,
205
],
[
201,
206
],
[
206,
207
],
[
206,
208
],
[
201,
209
],
[
209,
210
],
[
210,
211
],
[
201,
212
],
[
213,
213
],
[
213,
214
],
[
214,
215
],
[
215,
216
],
[
215,
217
],
[
214,
218
],
[
218,
219
],
[
219,
220
],
[
220,
221
],
[
221,
222
],
[
221,
223
],
[
219,
224
],
[
224,
225
],
[
225,
226
],
[
225,
227
],
[
224,
228
],
[
214,
229
],
[
229,
230
],
[
230,
231
],
[
231,
232
],
[
232,
233
],
[
232,
234
],
[
230,
235
],
[
235,
236
],
[
236,
237
],
[
237,
238
],
[
237,
239
],
[
236,
240
],
[
235,
241
],
[
6,
242
],
[
242,
243
],
[
0,
244
],
[
244,
245
],
[
244,
246
]
] | [
"import java.util.Scanner;\npublic class Main {\n public static void main(String[] args){\n Scanner scan = new Scanner(System.in);\n int n = scan.nextInt();\n int m = scan.nextInt();\n int [] [] a = new int[n + 1][m + 1];\n for (int x = 0; x < n; x++){\n for(int y = 0; y < m;y++){\n a[x][y] = scan.nextInt();\n }\n\n }\n int sum = 0;\n for (int x = 0; x < n; x++){\n for(int y = 0; y < m;y++){\n sum = sum + a[x][y];\n }\n a[x] [m] = sum;\n sum = 0;\n }\n for (int x = 0; x < m; x++){\n for(int y = 0; y < n;y++){\n sum = sum + a[y] [x];\n }\n a[n] [x] = sum;\n sum = 0;\n }\n for(int x = 0; x < m; x++){\n sum = sum + a[n] [x];\n }\n a[n] [m] = sum;\n for (int x = 0; x <= n; x++){\n for(int y = 0; y <= m;y++){\n if(y == m){\n System.out.println(a[x] [m]);\n }\n else{\n System.out.print(a[x] [y] + \" \");\n }\n }\n }\n }\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n public static void main(String[] args){\n Scanner scan = new Scanner(System.in);\n int n = scan.nextInt();\n int m = scan.nextInt();\n int [] [] a = new int[n + 1][m + 1];\n for (int x = 0; x < n; x++){\n for(int y = 0; y < m;y++){\n a[x][y] = scan.nextInt();\n }\n\n }\n int sum = 0;\n for (int x = 0; x < n; x++){\n for(int y = 0; y < m;y++){\n sum = sum + a[x][y];\n }\n a[x] [m] = sum;\n sum = 0;\n }\n for (int x = 0; x < m; x++){\n for(int y = 0; y < n;y++){\n sum = sum + a[y] [x];\n }\n a[n] [x] = sum;\n sum = 0;\n }\n for(int x = 0; x < m; x++){\n sum = sum + a[n] [x];\n }\n a[n] [m] = sum;\n for (int x = 0; x <= n; x++){\n for(int y = 0; y <= m;y++){\n if(y == m){\n System.out.println(a[x] [m]);\n }\n else{\n System.out.print(a[x] [y] + \" \");\n }\n }\n }\n }\n}",
"Main",
"public static void main(String[] args){\n Scanner scan = new Scanner(System.in);\n int n = scan.nextInt();\n int m = scan.nextInt();\n int [] [] a = new int[n + 1][m + 1];\n for (int x = 0; x < n; x++){\n for(int y = 0; y < m;y++){\n a[x][y] = scan.nextInt();\n }\n\n }\n int sum = 0;\n for (int x = 0; x < n; x++){\n for(int y = 0; y < m;y++){\n sum = sum + a[x][y];\n }\n a[x] [m] = sum;\n sum = 0;\n }\n for (int x = 0; x < m; x++){\n for(int y = 0; y < n;y++){\n sum = sum + a[y] [x];\n }\n a[n] [x] = sum;\n sum = 0;\n }\n for(int x = 0; x < m; x++){\n sum = sum + a[n] [x];\n }\n a[n] [m] = sum;\n for (int x = 0; x <= n; x++){\n for(int y = 0; y <= m;y++){\n if(y == m){\n System.out.println(a[x] [m]);\n }\n else{\n System.out.print(a[x] [y] + \" \");\n }\n }\n }\n }",
"main",
"{\n Scanner scan = new Scanner(System.in);\n int n = scan.nextInt();\n int m = scan.nextInt();\n int [] [] a = new int[n + 1][m + 1];\n for (int x = 0; x < n; x++){\n for(int y = 0; y < m;y++){\n a[x][y] = scan.nextInt();\n }\n\n }\n int sum = 0;\n for (int x = 0; x < n; x++){\n for(int y = 0; y < m;y++){\n sum = sum + a[x][y];\n }\n a[x] [m] = sum;\n sum = 0;\n }\n for (int x = 0; x < m; x++){\n for(int y = 0; y < n;y++){\n sum = sum + a[y] [x];\n }\n a[n] [x] = sum;\n sum = 0;\n }\n for(int x = 0; x < m; x++){\n sum = sum + a[n] [x];\n }\n a[n] [m] = sum;\n for (int x = 0; x <= n; x++){\n for(int y = 0; y <= m;y++){\n if(y == m){\n System.out.println(a[x] [m]);\n }\n else{\n System.out.print(a[x] [y] + \" \");\n }\n }\n }\n }",
"Scanner scan = new Scanner(System.in);",
"scan",
"new Scanner(System.in)",
"int n = scan.nextInt();",
"n",
"scan.nextInt()",
"scan.nextInt",
"scan",
"int m = scan.nextInt();",
"m",
"scan.nextInt()",
"scan.nextInt",
"scan",
"int [] [] a = new int[n + 1][m + 1];",
"a",
"new int[n + 1][m + 1]",
"n + 1",
"n",
"1",
"m + 1",
"m",
"1",
"for (int x = 0; x < n; x++){\n for(int y = 0; y < m;y++){\n a[x][y] = scan.nextInt();\n }\n\n }",
"int x = 0;",
"int x = 0;",
"x",
"0",
"x < n",
"x",
"n",
"x++",
"x++",
"x",
"{\n for(int y = 0; y < m;y++){\n a[x][y] = scan.nextInt();\n }\n\n }",
"{\n for(int y = 0; y < m;y++){\n a[x][y] = scan.nextInt();\n }\n\n }",
"for(int y = 0; y < m;y++){\n a[x][y] = scan.nextInt();\n }",
"int y = 0;",
"int y = 0;",
"y",
"0",
"y < m",
"y",
"m",
"y++",
"y++",
"y",
"{\n a[x][y] = scan.nextInt();\n }",
"{\n a[x][y] = scan.nextInt();\n }",
"a[x][y] = scan.nextInt()",
"a[x][y]",
"a[x]",
"a",
"x",
"y",
"scan.nextInt()",
"scan.nextInt",
"scan",
"int sum = 0;",
"sum",
"0",
"for (int x = 0; x < n; x++){\n for(int y = 0; y < m;y++){\n sum = sum + a[x][y];\n }\n a[x] [m] = sum;\n sum = 0;\n }",
"int x = 0;",
"int x = 0;",
"x",
"0",
"x < n",
"x",
"n",
"x++",
"x++",
"x",
"{\n for(int y = 0; y < m;y++){\n sum = sum + a[x][y];\n }\n a[x] [m] = sum;\n sum = 0;\n }",
"{\n for(int y = 0; y < m;y++){\n sum = sum + a[x][y];\n }\n a[x] [m] = sum;\n sum = 0;\n }",
"for(int y = 0; y < m;y++){\n sum = sum + a[x][y];\n }",
"int y = 0;",
"int y = 0;",
"y",
"0",
"y < m",
"y",
"m",
"y++",
"y++",
"y",
"{\n sum = sum + a[x][y];\n }",
"{\n sum = sum + a[x][y];\n }",
"sum = sum + a[x][y]",
"sum",
"sum + a[x][y]",
"sum",
"a[x][y]",
"a[x]",
"a",
"x",
"y",
"a[x] [m] = sum",
"a[x] [m]",
"a[x]",
"a",
"x",
"m",
"sum",
"sum = 0",
"sum",
"0",
"for (int x = 0; x < m; x++){\n for(int y = 0; y < n;y++){\n sum = sum + a[y] [x];\n }\n a[n] [x] = sum;\n sum = 0;\n }",
"int x = 0;",
"int x = 0;",
"x",
"0",
"x < m",
"x",
"m",
"x++",
"x++",
"x",
"{\n for(int y = 0; y < n;y++){\n sum = sum + a[y] [x];\n }\n a[n] [x] = sum;\n sum = 0;\n }",
"{\n for(int y = 0; y < n;y++){\n sum = sum + a[y] [x];\n }\n a[n] [x] = sum;\n sum = 0;\n }",
"for(int y = 0; y < n;y++){\n sum = sum + a[y] [x];\n }",
"int y = 0;",
"int y = 0;",
"y",
"0",
"y < n",
"y",
"n",
"y++",
"y++",
"y",
"{\n sum = sum + a[y] [x];\n }",
"{\n sum = sum + a[y] [x];\n }",
"sum = sum + a[y] [x]",
"sum",
"sum + a[y] [x]",
"sum",
"a[y] [x]",
"a[y]",
"a",
"y",
"x",
"a[n] [x] = sum",
"a[n] [x]",
"a[n]",
"a",
"n",
"x",
"sum",
"sum = 0",
"sum",
"0",
"for(int x = 0; x < m; x++){\n sum = sum + a[n] [x];\n }",
"int x = 0;",
"int x = 0;",
"x",
"0",
"x < m",
"x",
"m",
"x++",
"x++",
"x",
"{\n sum = sum + a[n] [x];\n }",
"{\n sum = sum + a[n] [x];\n }",
"sum = sum + a[n] [x]",
"sum",
"sum + a[n] [x]",
"sum",
"a[n] [x]",
"a[n]",
"a",
"n",
"x",
"a[n] [m] = sum",
"a[n] [m]",
"a[n]",
"a",
"n",
"m",
"sum",
"for (int x = 0; x <= n; x++){\n for(int y = 0; y <= m;y++){\n if(y == m){\n System.out.println(a[x] [m]);\n }\n else{\n System.out.print(a[x] [y] + \" \");\n }\n }\n }",
"int x = 0;",
"int x = 0;",
"x",
"0",
"x <= n",
"x",
"n",
"x++",
"x++",
"x",
"{\n for(int y = 0; y <= m;y++){\n if(y == m){\n System.out.println(a[x] [m]);\n }\n else{\n System.out.print(a[x] [y] + \" \");\n }\n }\n }",
"{\n for(int y = 0; y <= m;y++){\n if(y == m){\n System.out.println(a[x] [m]);\n }\n else{\n System.out.print(a[x] [y] + \" \");\n }\n }\n }",
"for(int y = 0; y <= m;y++){\n if(y == m){\n System.out.println(a[x] [m]);\n }\n else{\n System.out.print(a[x] [y] + \" \");\n }\n }",
"int y = 0;",
"int y = 0;",
"y",
"0",
"y <= m",
"y",
"m",
"y++",
"y++",
"y",
"{\n if(y == m){\n System.out.println(a[x] [m]);\n }\n else{\n System.out.print(a[x] [y] + \" \");\n }\n }",
"{\n if(y == m){\n System.out.println(a[x] [m]);\n }\n else{\n System.out.print(a[x] [y] + \" \");\n }\n }",
"if(y == m){\n System.out.println(a[x] [m]);\n }\n else{\n System.out.print(a[x] [y] + \" \");\n }",
"y == m",
"y",
"m",
"{\n System.out.println(a[x] [m]);\n }",
"System.out.println(a[x] [m])",
"System.out.println",
"System.out",
"System",
"System.out",
"a[x] [m]",
"a[x]",
"a",
"x",
"m",
"{\n System.out.print(a[x] [y] + \" \");\n }",
"System.out.print(a[x] [y] + \" \")",
"System.out.print",
"System.out",
"System",
"System.out",
"a[x] [y] + \" \"",
"a[x] [y]",
"a[x]",
"a",
"x",
"y",
"\" \"",
"String[] args",
"args",
"public class Main {\n public static void main(String[] args){\n Scanner scan = new Scanner(System.in);\n int n = scan.nextInt();\n int m = scan.nextInt();\n int [] [] a = new int[n + 1][m + 1];\n for (int x = 0; x < n; x++){\n for(int y = 0; y < m;y++){\n a[x][y] = scan.nextInt();\n }\n\n }\n int sum = 0;\n for (int x = 0; x < n; x++){\n for(int y = 0; y < m;y++){\n sum = sum + a[x][y];\n }\n a[x] [m] = sum;\n sum = 0;\n }\n for (int x = 0; x < m; x++){\n for(int y = 0; y < n;y++){\n sum = sum + a[y] [x];\n }\n a[n] [x] = sum;\n sum = 0;\n }\n for(int x = 0; x < m; x++){\n sum = sum + a[n] [x];\n }\n a[n] [m] = sum;\n for (int x = 0; x <= n; x++){\n for(int y = 0; y <= m;y++){\n if(y == m){\n System.out.println(a[x] [m]);\n }\n else{\n System.out.print(a[x] [y] + \" \");\n }\n }\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 m = scan.nextInt();\n int [] [] a = new int[n + 1][m + 1];\n for (int x = 0; x < n; x++){\n for(int y = 0; y < m;y++){\n a[x][y] = scan.nextInt();\n }\n\n }\n int sum = 0;\n for (int x = 0; x < n; x++){\n for(int y = 0; y < m;y++){\n sum = sum + a[x][y];\n }\n a[x] [m] = sum;\n sum = 0;\n }\n for (int x = 0; x < m; x++){\n for(int y = 0; y < n;y++){\n sum = sum + a[y] [x];\n }\n a[n] [x] = sum;\n sum = 0;\n }\n for(int x = 0; x < m; x++){\n sum = sum + a[n] [x];\n }\n a[n] [m] = sum;\n for (int x = 0; x <= n; x++){\n for(int y = 0; y <= m;y++){\n if(y == m){\n System.out.println(a[x] [m]);\n }\n else{\n System.out.print(a[x] [y] + \" \");\n }\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 n = scan.nextInt();
int m = scan.nextInt();
int [] [] a = new int[n + 1][m + 1];
for (int x = 0; x < n; x++){
for(int y = 0; y < m;y++){
a[x][y] = scan.nextInt();
}
}
int sum = 0;
for (int x = 0; x < n; x++){
for(int y = 0; y < m;y++){
sum = sum + a[x][y];
}
a[x] [m] = sum;
sum = 0;
}
for (int x = 0; x < m; x++){
for(int y = 0; y < n;y++){
sum = sum + a[y] [x];
}
a[n] [x] = sum;
sum = 0;
}
for(int x = 0; x < m; x++){
sum = sum + a[n] [x];
}
a[n] [m] = sum;
for (int x = 0; x <= n; x++){
for(int y = 0; y <= m;y++){
if(y == m){
System.out.println(a[x] [m]);
}
else{
System.out.print(a[x] [y] + " ");
}
}
}
}
}
|
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
20,
41,
13,
4,
18,
4,
18,
13,
17,
41,
13,
4,
18,
13,
18,
13,
17,
41,
13,
4,
18,
13,
18,
13,
17,
41,
13,
20,
2,
13,
17,
2,
13,
17,
41,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
4,
18,
4,
18,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
0,
18,
18,
13,
13,
13,
4,
18,
13,
18,
13,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
0,
13,
18,
18,
13,
13,
13,
0,
18,
18,
13,
13,
13,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
0,
13,
18,
18,
13,
13,
13,
0,
18,
18,
13,
13,
13,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
4,
18,
18,
13,
13,
18,
18,
13,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
4,
18,
18,
13,
13,
2,
17,
18,
18,
13,
13,
13,
4,
18,
18,
13,
13,
17,
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
],
[
244,
14
],
[
244,
15
],
[
15,
16
],
[
15,
17
],
[
17,
18
],
[
18,
19
],
[
18,
20
],
[
17,
21
],
[
21,
22
],
[
21,
23
],
[
17,
24
],
[
24,
25
],
[
24,
26
],
[
26,
27
],
[
27,
28
],
[
28,
29
],
[
29,
30
],
[
26,
31
],
[
17,
32
],
[
32,
33
],
[
32,
34
],
[
34,
35
],
[
35,
36
],
[
34,
37
],
[
37,
38
],
[
37,
39
],
[
17,
40
],
[
40,
41
],
[
40,
42
],
[
42,
43
],
[
43,
44
],
[
42,
45
],
[
45,
46
],
[
45,
47
],
[
17,
48
],
[
48,
49
],
[
48,
50
],
[
51,
52
],
[
51,
53
],
[
54,
55
],
[
54,
56
],
[
17,
57
],
[
57,
58
],
[
17,
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
],
[
72,
74
],
[
74,
75
],
[
75,
76
],
[
76,
77
],
[
77,
78
],
[
74,
79
],
[
71,
80
],
[
80,
81
],
[
81,
82
],
[
82,
83
],
[
82,
84
],
[
80,
85
],
[
85,
86
],
[
85,
87
],
[
80,
88
],
[
88,
89
],
[
89,
90
],
[
80,
91
],
[
91,
92
],
[
92,
93
],
[
93,
94
],
[
94,
95
],
[
94,
96
],
[
93,
97
],
[
92,
98
],
[
98,
99
],
[
99,
100
],
[
98,
101
],
[
101,
102
],
[
101,
103
],
[
17,
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
],
[
117,
119
],
[
116,
120
],
[
120,
121
],
[
121,
122
],
[
122,
123
],
[
122,
124
],
[
120,
125
],
[
125,
126
],
[
125,
127
],
[
120,
128
],
[
128,
129
],
[
129,
130
],
[
120,
131
],
[
131,
132
],
[
132,
133
],
[
132,
134
],
[
134,
135
],
[
135,
136
],
[
135,
137
],
[
134,
138
],
[
116,
139
],
[
139,
140
],
[
140,
141
],
[
141,
142
],
[
141,
143
],
[
140,
144
],
[
139,
145
],
[
17,
146
],
[
146,
147
],
[
147,
148
],
[
148,
149
],
[
148,
150
],
[
146,
151
],
[
151,
152
],
[
151,
153
],
[
146,
154
],
[
154,
155
],
[
155,
156
],
[
146,
157
],
[
158,
158
],
[
158,
159
],
[
159,
160
],
[
159,
161
],
[
158,
162
],
[
162,
163
],
[
163,
164
],
[
164,
165
],
[
164,
166
],
[
162,
167
],
[
167,
168
],
[
167,
169
],
[
162,
170
],
[
170,
171
],
[
171,
172
],
[
162,
173
],
[
173,
174
],
[
174,
175
],
[
174,
176
],
[
176,
177
],
[
177,
178
],
[
177,
179
],
[
176,
180
],
[
158,
181
],
[
181,
182
],
[
182,
183
],
[
183,
184
],
[
183,
185
],
[
182,
186
],
[
181,
187
],
[
17,
188
],
[
188,
189
],
[
189,
190
],
[
190,
191
],
[
190,
192
],
[
188,
193
],
[
193,
194
],
[
193,
195
],
[
188,
196
],
[
196,
197
],
[
197,
198
],
[
188,
199
],
[
200,
200
],
[
200,
201
],
[
201,
202
],
[
202,
203
],
[
203,
204
],
[
203,
205
],
[
201,
206
],
[
206,
207
],
[
207,
208
],
[
207,
209
],
[
206,
210
],
[
200,
211
],
[
211,
212
],
[
212,
213
],
[
213,
214
],
[
213,
215
],
[
211,
216
],
[
216,
217
],
[
216,
218
],
[
211,
219
],
[
219,
220
],
[
220,
221
],
[
211,
222
],
[
222,
223
],
[
223,
224
],
[
224,
225
],
[
225,
226
],
[
225,
227
],
[
223,
228
],
[
228,
229
],
[
228,
230
],
[
230,
231
],
[
231,
232
],
[
231,
233
],
[
230,
234
],
[
200,
235
],
[
235,
236
],
[
236,
237
],
[
237,
238
],
[
237,
239
],
[
235,
240
],
[
15,
241
],
[
241,
242
],
[
0,
243
],
[
243,
244
],
[
243,
245
]
] | [
"import java.util.*;\nimport java.io.*;\nimport java.lang.*;\nimport java.math.*;\npublic class Main{\n\tpublic static void main(String[] args) throws IOException{\n\t\tScanner stdIn=new Scanner(System.in);\n\t\tBufferedReader br=new BufferedReader(new InputStreamReader(System.in));\n\t\tString[] in=br.readLine().split(\" \");\n\t\tint r=Integer.parseInt(in[0]);\n\t\tint c=Integer.parseInt(in[1]);\n\t\tint array[][]=new int[r+1][c+1];\n\t\tint sum;\n\t\tfor(int i=0;i<r;i++){\n\t\t\tin=br.readLine().split(\" \");\n\t\t\tfor(int j=0;j<c;j++)\n\t\t\t\tarray[i][j]=Integer.parseInt(in[j]);\n\t\t}\n\t\tfor(int i=0;i<r;i++){\n\t\t\tsum=0;\n\t\t\tfor(int j=0;j<c;j++)\n\t\t\t\tsum+=array[i][j];\n\t\t\tarray[i][c]=sum;\n\t\t}\n\t\tfor(int i=0;i<=c;i++){\n\t\t\tsum=0;\n\t\t\tfor(int j=0;j<r;j++)\n\t\t\t\tsum+=array[j][i];\n\t\t\tarray[r][i]=sum;\n\t\t}\n\t\tfor(int i=0;i<=r;i++){\n\t\t\tSystem.out.print(array[i][0]);\n\t\t\tfor(int j=1;j<=c;j++)\n\t\t\t\tSystem.out.print(\" \"+array[i][j]);\n\t\t\tSystem.out.println(\"\");\n\t\t}\n\t}\n}",
"import java.util.*;",
"util.*",
"java",
"import java.io.*;",
"io.*",
"java",
"import java.lang.*;",
"lang.*",
"java",
"import java.math.*;",
"math.*",
"java",
"public class Main{\n\tpublic static void main(String[] args) throws IOException{\n\t\tScanner stdIn=new Scanner(System.in);\n\t\tBufferedReader br=new BufferedReader(new InputStreamReader(System.in));\n\t\tString[] in=br.readLine().split(\" \");\n\t\tint r=Integer.parseInt(in[0]);\n\t\tint c=Integer.parseInt(in[1]);\n\t\tint array[][]=new int[r+1][c+1];\n\t\tint sum;\n\t\tfor(int i=0;i<r;i++){\n\t\t\tin=br.readLine().split(\" \");\n\t\t\tfor(int j=0;j<c;j++)\n\t\t\t\tarray[i][j]=Integer.parseInt(in[j]);\n\t\t}\n\t\tfor(int i=0;i<r;i++){\n\t\t\tsum=0;\n\t\t\tfor(int j=0;j<c;j++)\n\t\t\t\tsum+=array[i][j];\n\t\t\tarray[i][c]=sum;\n\t\t}\n\t\tfor(int i=0;i<=c;i++){\n\t\t\tsum=0;\n\t\t\tfor(int j=0;j<r;j++)\n\t\t\t\tsum+=array[j][i];\n\t\t\tarray[r][i]=sum;\n\t\t}\n\t\tfor(int i=0;i<=r;i++){\n\t\t\tSystem.out.print(array[i][0]);\n\t\t\tfor(int j=1;j<=c;j++)\n\t\t\t\tSystem.out.print(\" \"+array[i][j]);\n\t\t\tSystem.out.println(\"\");\n\t\t}\n\t}\n}",
"Main",
"public static void main(String[] args) throws IOException{\n\t\tScanner stdIn=new Scanner(System.in);\n\t\tBufferedReader br=new BufferedReader(new InputStreamReader(System.in));\n\t\tString[] in=br.readLine().split(\" \");\n\t\tint r=Integer.parseInt(in[0]);\n\t\tint c=Integer.parseInt(in[1]);\n\t\tint array[][]=new int[r+1][c+1];\n\t\tint sum;\n\t\tfor(int i=0;i<r;i++){\n\t\t\tin=br.readLine().split(\" \");\n\t\t\tfor(int j=0;j<c;j++)\n\t\t\t\tarray[i][j]=Integer.parseInt(in[j]);\n\t\t}\n\t\tfor(int i=0;i<r;i++){\n\t\t\tsum=0;\n\t\t\tfor(int j=0;j<c;j++)\n\t\t\t\tsum+=array[i][j];\n\t\t\tarray[i][c]=sum;\n\t\t}\n\t\tfor(int i=0;i<=c;i++){\n\t\t\tsum=0;\n\t\t\tfor(int j=0;j<r;j++)\n\t\t\t\tsum+=array[j][i];\n\t\t\tarray[r][i]=sum;\n\t\t}\n\t\tfor(int i=0;i<=r;i++){\n\t\t\tSystem.out.print(array[i][0]);\n\t\t\tfor(int j=1;j<=c;j++)\n\t\t\t\tSystem.out.print(\" \"+array[i][j]);\n\t\t\tSystem.out.println(\"\");\n\t\t}\n\t}",
"main",
"{\n\t\tScanner stdIn=new Scanner(System.in);\n\t\tBufferedReader br=new BufferedReader(new InputStreamReader(System.in));\n\t\tString[] in=br.readLine().split(\" \");\n\t\tint r=Integer.parseInt(in[0]);\n\t\tint c=Integer.parseInt(in[1]);\n\t\tint array[][]=new int[r+1][c+1];\n\t\tint sum;\n\t\tfor(int i=0;i<r;i++){\n\t\t\tin=br.readLine().split(\" \");\n\t\t\tfor(int j=0;j<c;j++)\n\t\t\t\tarray[i][j]=Integer.parseInt(in[j]);\n\t\t}\n\t\tfor(int i=0;i<r;i++){\n\t\t\tsum=0;\n\t\t\tfor(int j=0;j<c;j++)\n\t\t\t\tsum+=array[i][j];\n\t\t\tarray[i][c]=sum;\n\t\t}\n\t\tfor(int i=0;i<=c;i++){\n\t\t\tsum=0;\n\t\t\tfor(int j=0;j<r;j++)\n\t\t\t\tsum+=array[j][i];\n\t\t\tarray[r][i]=sum;\n\t\t}\n\t\tfor(int i=0;i<=r;i++){\n\t\t\tSystem.out.print(array[i][0]);\n\t\t\tfor(int j=1;j<=c;j++)\n\t\t\t\tSystem.out.print(\" \"+array[i][j]);\n\t\t\tSystem.out.println(\"\");\n\t\t}\n\t}",
"Scanner stdIn=new Scanner(System.in);",
"stdIn",
"new Scanner(System.in)",
"BufferedReader br=new BufferedReader(new InputStreamReader(System.in));",
"br",
"new BufferedReader(new InputStreamReader(System.in))",
"String[] in=br.readLine().split(\" \");",
"in",
"br.readLine().split(\" \")",
"br.readLine().split",
"br.readLine()",
"br.readLine",
"br",
"\" \"",
"int r=Integer.parseInt(in[0]);",
"r",
"Integer.parseInt(in[0])",
"Integer.parseInt",
"Integer",
"in[0]",
"in",
"0",
"int c=Integer.parseInt(in[1]);",
"c",
"Integer.parseInt(in[1])",
"Integer.parseInt",
"Integer",
"in[1]",
"in",
"1",
"int array[][]=new int[r+1][c+1];",
"array",
"new int[r+1][c+1]",
"r+1",
"r",
"1",
"c+1",
"c",
"1",
"int sum;",
"sum",
"for(int i=0;i<r;i++){\n\t\t\tin=br.readLine().split(\" \");\n\t\t\tfor(int j=0;j<c;j++)\n\t\t\t\tarray[i][j]=Integer.parseInt(in[j]);\n\t\t}",
"int i=0;",
"int i=0;",
"i",
"0",
"i<r",
"i",
"r",
"i++",
"i++",
"i",
"{\n\t\t\tin=br.readLine().split(\" \");\n\t\t\tfor(int j=0;j<c;j++)\n\t\t\t\tarray[i][j]=Integer.parseInt(in[j]);\n\t\t}",
"{\n\t\t\tin=br.readLine().split(\" \");\n\t\t\tfor(int j=0;j<c;j++)\n\t\t\t\tarray[i][j]=Integer.parseInt(in[j]);\n\t\t}",
"in=br.readLine().split(\" \")",
"in",
"br.readLine().split(\" \")",
"br.readLine().split",
"br.readLine()",
"br.readLine",
"br",
"\" \"",
"for(int j=0;j<c;j++)\n\t\t\t\tarray[i][j]=Integer.parseInt(in[j]);",
"int j=0;",
"int j=0;",
"j",
"0",
"j<c",
"j",
"c",
"j++",
"j++",
"j",
"array[i][j]=Integer.parseInt(in[j]);",
"array[i][j]=Integer.parseInt(in[j])",
"array[i][j]",
"array[i]",
"array",
"i",
"j",
"Integer.parseInt(in[j])",
"Integer.parseInt",
"Integer",
"in[j]",
"in",
"j",
"for(int i=0;i<r;i++){\n\t\t\tsum=0;\n\t\t\tfor(int j=0;j<c;j++)\n\t\t\t\tsum+=array[i][j];\n\t\t\tarray[i][c]=sum;\n\t\t}",
"int i=0;",
"int i=0;",
"i",
"0",
"i<r",
"i",
"r",
"i++",
"i++",
"i",
"{\n\t\t\tsum=0;\n\t\t\tfor(int j=0;j<c;j++)\n\t\t\t\tsum+=array[i][j];\n\t\t\tarray[i][c]=sum;\n\t\t}",
"{\n\t\t\tsum=0;\n\t\t\tfor(int j=0;j<c;j++)\n\t\t\t\tsum+=array[i][j];\n\t\t\tarray[i][c]=sum;\n\t\t}",
"sum=0",
"sum",
"0",
"for(int j=0;j<c;j++)\n\t\t\t\tsum+=array[i][j];",
"int j=0;",
"int j=0;",
"j",
"0",
"j<c",
"j",
"c",
"j++",
"j++",
"j",
"sum+=array[i][j];",
"sum+=array[i][j]",
"sum",
"array[i][j]",
"array[i]",
"array",
"i",
"j",
"array[i][c]=sum",
"array[i][c]",
"array[i]",
"array",
"i",
"c",
"sum",
"for(int i=0;i<=c;i++){\n\t\t\tsum=0;\n\t\t\tfor(int j=0;j<r;j++)\n\t\t\t\tsum+=array[j][i];\n\t\t\tarray[r][i]=sum;\n\t\t}",
"int i=0;",
"int i=0;",
"i",
"0",
"i<=c",
"i",
"c",
"i++",
"i++",
"i",
"{\n\t\t\tsum=0;\n\t\t\tfor(int j=0;j<r;j++)\n\t\t\t\tsum+=array[j][i];\n\t\t\tarray[r][i]=sum;\n\t\t}",
"{\n\t\t\tsum=0;\n\t\t\tfor(int j=0;j<r;j++)\n\t\t\t\tsum+=array[j][i];\n\t\t\tarray[r][i]=sum;\n\t\t}",
"sum=0",
"sum",
"0",
"for(int j=0;j<r;j++)\n\t\t\t\tsum+=array[j][i];",
"int j=0;",
"int j=0;",
"j",
"0",
"j<r",
"j",
"r",
"j++",
"j++",
"j",
"sum+=array[j][i];",
"sum+=array[j][i]",
"sum",
"array[j][i]",
"array[j]",
"array",
"j",
"i",
"array[r][i]=sum",
"array[r][i]",
"array[r]",
"array",
"r",
"i",
"sum",
"for(int i=0;i<=r;i++){\n\t\t\tSystem.out.print(array[i][0]);\n\t\t\tfor(int j=1;j<=c;j++)\n\t\t\t\tSystem.out.print(\" \"+array[i][j]);\n\t\t\tSystem.out.println(\"\");\n\t\t}",
"int i=0;",
"int i=0;",
"i",
"0",
"i<=r",
"i",
"r",
"i++",
"i++",
"i",
"{\n\t\t\tSystem.out.print(array[i][0]);\n\t\t\tfor(int j=1;j<=c;j++)\n\t\t\t\tSystem.out.print(\" \"+array[i][j]);\n\t\t\tSystem.out.println(\"\");\n\t\t}",
"{\n\t\t\tSystem.out.print(array[i][0]);\n\t\t\tfor(int j=1;j<=c;j++)\n\t\t\t\tSystem.out.print(\" \"+array[i][j]);\n\t\t\tSystem.out.println(\"\");\n\t\t}",
"System.out.print(array[i][0])",
"System.out.print",
"System.out",
"System",
"System.out",
"array[i][0]",
"array[i]",
"array",
"i",
"0",
"for(int j=1;j<=c;j++)\n\t\t\t\tSystem.out.print(\" \"+array[i][j]);",
"int j=1;",
"int j=1;",
"j",
"1",
"j<=c",
"j",
"c",
"j++",
"j++",
"j",
"System.out.print(\" \"+array[i][j]);",
"System.out.print(\" \"+array[i][j])",
"System.out.print",
"System.out",
"System",
"System.out",
"\" \"+array[i][j]",
"\" \"",
"array[i][j]",
"array[i]",
"array",
"i",
"j",
"System.out.println(\"\")",
"System.out.println",
"System.out",
"System",
"System.out",
"\"\"",
"String[] args",
"args",
"public class Main{\n\tpublic static void main(String[] args) throws IOException{\n\t\tScanner stdIn=new Scanner(System.in);\n\t\tBufferedReader br=new BufferedReader(new InputStreamReader(System.in));\n\t\tString[] in=br.readLine().split(\" \");\n\t\tint r=Integer.parseInt(in[0]);\n\t\tint c=Integer.parseInt(in[1]);\n\t\tint array[][]=new int[r+1][c+1];\n\t\tint sum;\n\t\tfor(int i=0;i<r;i++){\n\t\t\tin=br.readLine().split(\" \");\n\t\t\tfor(int j=0;j<c;j++)\n\t\t\t\tarray[i][j]=Integer.parseInt(in[j]);\n\t\t}\n\t\tfor(int i=0;i<r;i++){\n\t\t\tsum=0;\n\t\t\tfor(int j=0;j<c;j++)\n\t\t\t\tsum+=array[i][j];\n\t\t\tarray[i][c]=sum;\n\t\t}\n\t\tfor(int i=0;i<=c;i++){\n\t\t\tsum=0;\n\t\t\tfor(int j=0;j<r;j++)\n\t\t\t\tsum+=array[j][i];\n\t\t\tarray[r][i]=sum;\n\t\t}\n\t\tfor(int i=0;i<=r;i++){\n\t\t\tSystem.out.print(array[i][0]);\n\t\t\tfor(int j=1;j<=c;j++)\n\t\t\t\tSystem.out.print(\" \"+array[i][j]);\n\t\t\tSystem.out.println(\"\");\n\t\t}\n\t}\n}",
"public class Main{\n\tpublic static void main(String[] args) throws IOException{\n\t\tScanner stdIn=new Scanner(System.in);\n\t\tBufferedReader br=new BufferedReader(new InputStreamReader(System.in));\n\t\tString[] in=br.readLine().split(\" \");\n\t\tint r=Integer.parseInt(in[0]);\n\t\tint c=Integer.parseInt(in[1]);\n\t\tint array[][]=new int[r+1][c+1];\n\t\tint sum;\n\t\tfor(int i=0;i<r;i++){\n\t\t\tin=br.readLine().split(\" \");\n\t\t\tfor(int j=0;j<c;j++)\n\t\t\t\tarray[i][j]=Integer.parseInt(in[j]);\n\t\t}\n\t\tfor(int i=0;i<r;i++){\n\t\t\tsum=0;\n\t\t\tfor(int j=0;j<c;j++)\n\t\t\t\tsum+=array[i][j];\n\t\t\tarray[i][c]=sum;\n\t\t}\n\t\tfor(int i=0;i<=c;i++){\n\t\t\tsum=0;\n\t\t\tfor(int j=0;j<r;j++)\n\t\t\t\tsum+=array[j][i];\n\t\t\tarray[r][i]=sum;\n\t\t}\n\t\tfor(int i=0;i<=r;i++){\n\t\t\tSystem.out.print(array[i][0]);\n\t\t\tfor(int j=1;j<=c;j++)\n\t\t\t\tSystem.out.print(\" \"+array[i][j]);\n\t\t\tSystem.out.println(\"\");\n\t\t}\n\t}\n}",
"Main"
] | import java.util.*;
import java.io.*;
import java.lang.*;
import java.math.*;
public class Main{
public static void main(String[] args) throws IOException{
Scanner stdIn=new Scanner(System.in);
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
String[] in=br.readLine().split(" ");
int r=Integer.parseInt(in[0]);
int c=Integer.parseInt(in[1]);
int array[][]=new int[r+1][c+1];
int sum;
for(int i=0;i<r;i++){
in=br.readLine().split(" ");
for(int j=0;j<c;j++)
array[i][j]=Integer.parseInt(in[j]);
}
for(int i=0;i<r;i++){
sum=0;
for(int j=0;j<c;j++)
sum+=array[i][j];
array[i][c]=sum;
}
for(int i=0;i<=c;i++){
sum=0;
for(int j=0;j<r;j++)
sum+=array[j][i];
array[r][i]=sum;
}
for(int i=0;i<=r;i++){
System.out.print(array[i][0]);
for(int j=1;j<=c;j++)
System.out.print(" "+array[i][j]);
System.out.println("");
}
}
} |
[
7,
15,
13,
17,
6,
13,
41,
13,
12,
13,
30,
0,
13,
20,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
41,
13,
20,
2,
13,
17,
2,
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,
18,
18,
13,
13,
13,
4,
18,
13,
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,
14,
2,
13,
13,
30,
4,
18,
18,
13,
13,
18,
18,
13,
13,
13,
30,
4,
18,
18,
13,
13,
2,
18,
18,
13,
13,
13,
17,
0,
18,
18,
13,
13,
13,
18,
18,
13,
13,
13,
0,
18,
18,
13,
13,
13,
18,
18,
13,
13,
13,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
151,
5
],
[
151,
6
],
[
6,
7
],
[
151,
8
],
[
8,
9
],
[
8,
10
],
[
10,
11
],
[
11,
12
],
[
11,
13
],
[
10,
14
],
[
14,
15
],
[
14,
16
],
[
16,
17
],
[
17,
18
],
[
10,
19
],
[
19,
20
],
[
19,
21
],
[
21,
22
],
[
22,
23
],
[
10,
24
],
[
24,
25
],
[
24,
26
],
[
27,
28
],
[
27,
29
],
[
30,
31
],
[
30,
32
],
[
10,
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
],
[
59,
65
],
[
65,
66
],
[
66,
67
],
[
10,
68
],
[
68,
69
],
[
69,
70
],
[
70,
71
],
[
70,
72
],
[
68,
73
],
[
73,
74
],
[
73,
75
],
[
75,
76
],
[
75,
77
],
[
68,
78
],
[
78,
79
],
[
79,
80
],
[
68,
81
],
[
82,
82
],
[
82,
83
],
[
83,
84
],
[
84,
85
],
[
85,
86
],
[
85,
87
],
[
83,
88
],
[
88,
89
],
[
88,
90
],
[
90,
91
],
[
90,
92
],
[
83,
93
],
[
93,
94
],
[
94,
95
],
[
83,
96
],
[
97,
97
],
[
97,
98
],
[
98,
99
],
[
99,
100
],
[
99,
101
],
[
98,
102
],
[
102,
103
],
[
103,
104
],
[
104,
105
],
[
105,
106
],
[
105,
107
],
[
103,
108
],
[
108,
109
],
[
109,
110
],
[
109,
111
],
[
108,
112
],
[
98,
113
],
[
113,
114
],
[
114,
115
],
[
115,
116
],
[
116,
117
],
[
116,
118
],
[
114,
119
],
[
119,
120
],
[
120,
121
],
[
121,
122
],
[
121,
123
],
[
120,
124
],
[
119,
125
],
[
113,
126
],
[
126,
127
],
[
127,
128
],
[
128,
129
],
[
128,
130
],
[
127,
131
],
[
126,
132
],
[
132,
133
],
[
133,
134
],
[
133,
135
],
[
132,
136
],
[
113,
137
],
[
137,
138
],
[
138,
139
],
[
139,
140
],
[
139,
141
],
[
138,
142
],
[
137,
143
],
[
143,
144
],
[
144,
145
],
[
144,
146
],
[
143,
147
],
[
8,
148
],
[
148,
149
],
[
0,
150
],
[
150,
151
],
[
150,
152
]
] | [
"import java.util.Scanner;\n\npublic class Main {\n private static Scanner scan;\n\n public static void main(String[] args) {\n scan = new Scanner(System.in);\n\n // 表の行数rと列数c、r × c の要素を持つ表\n int r = scan.nextInt();\n int c = scan.nextInt();\n int[][] hyou = new int[r+1][c+1];\n\n for (int i = 0; i < r; i++) {\n for (int j = 0; j < c; j++) {\n hyou[i][j] = scan.nextInt();\n }\n }\n for (int i = 0; i < r +1; i++) {\n for (int j = 0; j < c + 1; j++) {\n if (j == c) {\n System.out.println(hyou[i][c]);\n } else {\n System.out.print(hyou[i][j] + \" \");\n hyou[i][c] += hyou[i][j];\n hyou[r][j] += hyou[i][j];\n }\n }\n }\n }\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n private static Scanner scan;\n\n public static void main(String[] args) {\n scan = new Scanner(System.in);\n\n // 表の行数rと列数c、r × c の要素を持つ表\n int r = scan.nextInt();\n int c = scan.nextInt();\n int[][] hyou = new int[r+1][c+1];\n\n for (int i = 0; i < r; i++) {\n for (int j = 0; j < c; j++) {\n hyou[i][j] = scan.nextInt();\n }\n }\n for (int i = 0; i < r +1; i++) {\n for (int j = 0; j < c + 1; j++) {\n if (j == c) {\n System.out.println(hyou[i][c]);\n } else {\n System.out.print(hyou[i][j] + \" \");\n hyou[i][c] += hyou[i][j];\n hyou[r][j] += hyou[i][j];\n }\n }\n }\n }\n}",
"Main",
"private static Scanner scan;",
"scan",
"public static void main(String[] args) {\n scan = new Scanner(System.in);\n\n // 表の行数rと列数c、r × c の要素を持つ表\n int r = scan.nextInt();\n int c = scan.nextInt();\n int[][] hyou = new int[r+1][c+1];\n\n for (int i = 0; i < r; i++) {\n for (int j = 0; j < c; j++) {\n hyou[i][j] = scan.nextInt();\n }\n }\n for (int i = 0; i < r +1; i++) {\n for (int j = 0; j < c + 1; j++) {\n if (j == c) {\n System.out.println(hyou[i][c]);\n } else {\n System.out.print(hyou[i][j] + \" \");\n hyou[i][c] += hyou[i][j];\n hyou[r][j] += hyou[i][j];\n }\n }\n }\n }",
"main",
"{\n scan = new Scanner(System.in);\n\n // 表の行数rと列数c、r × c の要素を持つ表\n int r = scan.nextInt();\n int c = scan.nextInt();\n int[][] hyou = new int[r+1][c+1];\n\n for (int i = 0; i < r; i++) {\n for (int j = 0; j < c; j++) {\n hyou[i][j] = scan.nextInt();\n }\n }\n for (int i = 0; i < r +1; i++) {\n for (int j = 0; j < c + 1; j++) {\n if (j == c) {\n System.out.println(hyou[i][c]);\n } else {\n System.out.print(hyou[i][j] + \" \");\n hyou[i][c] += hyou[i][j];\n hyou[r][j] += hyou[i][j];\n }\n }\n }\n }",
"scan = new Scanner(System.in)",
"scan",
"new Scanner(System.in)",
"int r = scan.nextInt();",
"r",
"scan.nextInt()",
"scan.nextInt",
"scan",
"int c = scan.nextInt();",
"c",
"scan.nextInt()",
"scan.nextInt",
"scan",
"int[][] hyou = new int[r+1][c+1];",
"hyou",
"new int[r+1][c+1]",
"r+1",
"r",
"1",
"c+1",
"c",
"1",
"for (int i = 0; i < r; i++) {\n for (int j = 0; j < c; j++) {\n hyou[i][j] = scan.nextInt();\n }\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < r",
"i",
"r",
"i++",
"i++",
"i",
"{\n for (int j = 0; j < c; j++) {\n hyou[i][j] = scan.nextInt();\n }\n }",
"{\n for (int j = 0; j < c; j++) {\n hyou[i][j] = scan.nextInt();\n }\n }",
"for (int j = 0; j < c; j++) {\n hyou[i][j] = scan.nextInt();\n }",
"int j = 0;",
"int j = 0;",
"j",
"0",
"j < c",
"j",
"c",
"j++",
"j++",
"j",
"{\n hyou[i][j] = scan.nextInt();\n }",
"{\n hyou[i][j] = scan.nextInt();\n }",
"hyou[i][j] = scan.nextInt()",
"hyou[i][j]",
"hyou[i]",
"hyou",
"i",
"j",
"scan.nextInt()",
"scan.nextInt",
"scan",
"for (int i = 0; i < r +1; i++) {\n for (int j = 0; j < c + 1; j++) {\n if (j == c) {\n System.out.println(hyou[i][c]);\n } else {\n System.out.print(hyou[i][j] + \" \");\n hyou[i][c] += hyou[i][j];\n hyou[r][j] += hyou[i][j];\n }\n }\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < r +1",
"i",
"r +1",
"r",
"1",
"i++",
"i++",
"i",
"{\n for (int j = 0; j < c + 1; j++) {\n if (j == c) {\n System.out.println(hyou[i][c]);\n } else {\n System.out.print(hyou[i][j] + \" \");\n hyou[i][c] += hyou[i][j];\n hyou[r][j] += hyou[i][j];\n }\n }\n }",
"{\n for (int j = 0; j < c + 1; j++) {\n if (j == c) {\n System.out.println(hyou[i][c]);\n } else {\n System.out.print(hyou[i][j] + \" \");\n hyou[i][c] += hyou[i][j];\n hyou[r][j] += hyou[i][j];\n }\n }\n }",
"for (int j = 0; j < c + 1; j++) {\n if (j == c) {\n System.out.println(hyou[i][c]);\n } else {\n System.out.print(hyou[i][j] + \" \");\n hyou[i][c] += hyou[i][j];\n hyou[r][j] += hyou[i][j];\n }\n }",
"int j = 0;",
"int j = 0;",
"j",
"0",
"j < c + 1",
"j",
"c + 1",
"c",
"1",
"j++",
"j++",
"j",
"{\n if (j == c) {\n System.out.println(hyou[i][c]);\n } else {\n System.out.print(hyou[i][j] + \" \");\n hyou[i][c] += hyou[i][j];\n hyou[r][j] += hyou[i][j];\n }\n }",
"{\n if (j == c) {\n System.out.println(hyou[i][c]);\n } else {\n System.out.print(hyou[i][j] + \" \");\n hyou[i][c] += hyou[i][j];\n hyou[r][j] += hyou[i][j];\n }\n }",
"if (j == c) {\n System.out.println(hyou[i][c]);\n } else {\n System.out.print(hyou[i][j] + \" \");\n hyou[i][c] += hyou[i][j];\n hyou[r][j] += hyou[i][j];\n }",
"j == c",
"j",
"c",
"{\n System.out.println(hyou[i][c]);\n }",
"System.out.println(hyou[i][c])",
"System.out.println",
"System.out",
"System",
"System.out",
"hyou[i][c]",
"hyou[i]",
"hyou",
"i",
"c",
"{\n System.out.print(hyou[i][j] + \" \");\n hyou[i][c] += hyou[i][j];\n hyou[r][j] += hyou[i][j];\n }",
"System.out.print(hyou[i][j] + \" \")",
"System.out.print",
"System.out",
"System",
"System.out",
"hyou[i][j] + \" \"",
"hyou[i][j]",
"hyou[i]",
"hyou",
"i",
"j",
"\" \"",
"hyou[i][c] += hyou[i][j]",
"hyou[i][c]",
"hyou[i]",
"hyou",
"i",
"c",
"hyou[i][j]",
"hyou[i]",
"hyou",
"i",
"j",
"hyou[r][j] += hyou[i][j]",
"hyou[r][j]",
"hyou[r]",
"hyou",
"r",
"j",
"hyou[i][j]",
"hyou[i]",
"hyou",
"i",
"j",
"String[] args",
"args",
"public class Main {\n private static Scanner scan;\n\n public static void main(String[] args) {\n scan = new Scanner(System.in);\n\n // 表の行数rと列数c、r × c の要素を持つ表\n int r = scan.nextInt();\n int c = scan.nextInt();\n int[][] hyou = new int[r+1][c+1];\n\n for (int i = 0; i < r; i++) {\n for (int j = 0; j < c; j++) {\n hyou[i][j] = scan.nextInt();\n }\n }\n for (int i = 0; i < r +1; i++) {\n for (int j = 0; j < c + 1; j++) {\n if (j == c) {\n System.out.println(hyou[i][c]);\n } else {\n System.out.print(hyou[i][j] + \" \");\n hyou[i][c] += hyou[i][j];\n hyou[r][j] += hyou[i][j];\n }\n }\n }\n }\n}",
"public class Main {\n private static Scanner scan;\n\n public static void main(String[] args) {\n scan = new Scanner(System.in);\n\n // 表の行数rと列数c、r × c の要素を持つ表\n int r = scan.nextInt();\n int c = scan.nextInt();\n int[][] hyou = new int[r+1][c+1];\n\n for (int i = 0; i < r; i++) {\n for (int j = 0; j < c; j++) {\n hyou[i][j] = scan.nextInt();\n }\n }\n for (int i = 0; i < r +1; i++) {\n for (int j = 0; j < c + 1; j++) {\n if (j == c) {\n System.out.println(hyou[i][c]);\n } else {\n System.out.print(hyou[i][j] + \" \");\n hyou[i][c] += hyou[i][j];\n hyou[r][j] += hyou[i][j];\n }\n }\n }\n }\n}",
"Main"
] | import java.util.Scanner;
public class Main {
private static Scanner scan;
public static void main(String[] args) {
scan = new Scanner(System.in);
// 表の行数rと列数c、r × c の要素を持つ表
int r = scan.nextInt();
int c = scan.nextInt();
int[][] hyou = new int[r+1][c+1];
for (int i = 0; i < r; i++) {
for (int j = 0; j < c; j++) {
hyou[i][j] = scan.nextInt();
}
}
for (int i = 0; i < r +1; i++) {
for (int j = 0; j < c + 1; j++) {
if (j == c) {
System.out.println(hyou[i][c]);
} else {
System.out.print(hyou[i][j] + " ");
hyou[i][c] += hyou[i][j];
hyou[r][j] += hyou[i][j];
}
}
}
}
} |
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
41,
13,
20,
2,
13,
17,
2,
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,
18,
18,
13,
13,
13,
4,
18,
13,
0,
18,
18,
13,
13,
13,
18,
18,
13,
13,
13,
0,
18,
18,
13,
13,
13,
18,
18,
13,
13,
13,
0,
18,
18,
13,
13,
13,
18,
18,
13,
13,
13,
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,
4,
18,
18,
13,
13,
18,
18,
13,
13,
13,
14,
2,
13,
13,
9,
4,
18,
18,
13,
13,
17,
4,
18,
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
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
8,
17
],
[
17,
18
],
[
17,
19
],
[
19,
20
],
[
20,
21
],
[
8,
22
],
[
22,
23
],
[
22,
24
],
[
25,
26
],
[
25,
27
],
[
28,
29
],
[
28,
30
],
[
8,
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
],
[
58,
62
],
[
57,
63
],
[
63,
64
],
[
64,
65
],
[
56,
66
],
[
66,
67
],
[
67,
68
],
[
68,
69
],
[
68,
70
],
[
67,
71
],
[
66,
72
],
[
72,
73
],
[
73,
74
],
[
73,
75
],
[
72,
76
],
[
56,
77
],
[
77,
78
],
[
78,
79
],
[
79,
80
],
[
79,
81
],
[
78,
82
],
[
77,
83
],
[
83,
84
],
[
84,
85
],
[
84,
86
],
[
83,
87
],
[
43,
88
],
[
88,
89
],
[
89,
90
],
[
90,
91
],
[
90,
92
],
[
89,
93
],
[
88,
94
],
[
94,
95
],
[
95,
96
],
[
95,
97
],
[
94,
98
],
[
8,
99
],
[
99,
100
],
[
100,
101
],
[
101,
102
],
[
101,
103
],
[
99,
104
],
[
104,
105
],
[
104,
106
],
[
106,
107
],
[
106,
108
],
[
99,
109
],
[
109,
110
],
[
110,
111
],
[
99,
112
],
[
113,
113
],
[
113,
114
],
[
114,
115
],
[
115,
116
],
[
116,
117
],
[
116,
118
],
[
114,
119
],
[
119,
120
],
[
119,
121
],
[
121,
122
],
[
121,
123
],
[
114,
124
],
[
124,
125
],
[
125,
126
],
[
114,
127
],
[
128,
128
],
[
128,
129
],
[
129,
130
],
[
130,
131
],
[
131,
132
],
[
131,
133
],
[
129,
134
],
[
134,
135
],
[
135,
136
],
[
135,
137
],
[
134,
138
],
[
128,
139
],
[
139,
140
],
[
140,
141
],
[
140,
142
],
[
139,
143
],
[
128,
144
],
[
144,
145
],
[
145,
146
],
[
146,
147
],
[
146,
148
],
[
144,
149
],
[
113,
150
],
[
150,
151
],
[
151,
152
],
[
152,
153
],
[
152,
154
],
[
6,
155
],
[
155,
156
]
] | [
"import java.util.Scanner;\n\nclass Main {\n public static void main(String[] args) {\n Scanner scan = new Scanner(System.in);\n\n int r = scan.nextInt();\n int c = scan.nextInt();\n\n int[][] det = new int[r + 1][c + 1];\n\n for (int i = 0; i < r; i++) {\n for (int j = 0; j < c; j++) {\n det[i][j] = scan.nextInt();\n det[i][c] += det[i][j];\n det[r][j] += det[i][j];\n }\n det[r][c] += det[i][c];\n }\n\n for (int i = 0; i < r + 1; i++) {\n for (int j = 0; j < c + 1; j++) {\n System.out.print(det[i][j]);\n if(j==c) continue;\n System.out.print(\" \");\n }\n System.out.println();\n }\n\n }\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"class Main {\n public static void main(String[] args) {\n Scanner scan = new Scanner(System.in);\n\n int r = scan.nextInt();\n int c = scan.nextInt();\n\n int[][] det = new int[r + 1][c + 1];\n\n for (int i = 0; i < r; i++) {\n for (int j = 0; j < c; j++) {\n det[i][j] = scan.nextInt();\n det[i][c] += det[i][j];\n det[r][j] += det[i][j];\n }\n det[r][c] += det[i][c];\n }\n\n for (int i = 0; i < r + 1; i++) {\n for (int j = 0; j < c + 1; j++) {\n System.out.print(det[i][j]);\n if(j==c) continue;\n System.out.print(\" \");\n }\n System.out.println();\n }\n\n }\n}",
"Main",
"public static void main(String[] args) {\n Scanner scan = new Scanner(System.in);\n\n int r = scan.nextInt();\n int c = scan.nextInt();\n\n int[][] det = new int[r + 1][c + 1];\n\n for (int i = 0; i < r; i++) {\n for (int j = 0; j < c; j++) {\n det[i][j] = scan.nextInt();\n det[i][c] += det[i][j];\n det[r][j] += det[i][j];\n }\n det[r][c] += det[i][c];\n }\n\n for (int i = 0; i < r + 1; i++) {\n for (int j = 0; j < c + 1; j++) {\n System.out.print(det[i][j]);\n if(j==c) continue;\n System.out.print(\" \");\n }\n System.out.println();\n }\n\n }",
"main",
"{\n Scanner scan = new Scanner(System.in);\n\n int r = scan.nextInt();\n int c = scan.nextInt();\n\n int[][] det = new int[r + 1][c + 1];\n\n for (int i = 0; i < r; i++) {\n for (int j = 0; j < c; j++) {\n det[i][j] = scan.nextInt();\n det[i][c] += det[i][j];\n det[r][j] += det[i][j];\n }\n det[r][c] += det[i][c];\n }\n\n for (int i = 0; i < r + 1; i++) {\n for (int j = 0; j < c + 1; j++) {\n System.out.print(det[i][j]);\n if(j==c) continue;\n System.out.print(\" \");\n }\n System.out.println();\n }\n\n }",
"Scanner scan = new Scanner(System.in);",
"scan",
"new Scanner(System.in)",
"int r = scan.nextInt();",
"r",
"scan.nextInt()",
"scan.nextInt",
"scan",
"int c = scan.nextInt();",
"c",
"scan.nextInt()",
"scan.nextInt",
"scan",
"int[][] det = new int[r + 1][c + 1];",
"det",
"new int[r + 1][c + 1]",
"r + 1",
"r",
"1",
"c + 1",
"c",
"1",
"for (int i = 0; i < r; i++) {\n for (int j = 0; j < c; j++) {\n det[i][j] = scan.nextInt();\n det[i][c] += det[i][j];\n det[r][j] += det[i][j];\n }\n det[r][c] += det[i][c];\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < r",
"i",
"r",
"i++",
"i++",
"i",
"{\n for (int j = 0; j < c; j++) {\n det[i][j] = scan.nextInt();\n det[i][c] += det[i][j];\n det[r][j] += det[i][j];\n }\n det[r][c] += det[i][c];\n }",
"{\n for (int j = 0; j < c; j++) {\n det[i][j] = scan.nextInt();\n det[i][c] += det[i][j];\n det[r][j] += det[i][j];\n }\n det[r][c] += det[i][c];\n }",
"for (int j = 0; j < c; j++) {\n det[i][j] = scan.nextInt();\n det[i][c] += det[i][j];\n det[r][j] += det[i][j];\n }",
"int j = 0;",
"int j = 0;",
"j",
"0",
"j < c",
"j",
"c",
"j++",
"j++",
"j",
"{\n det[i][j] = scan.nextInt();\n det[i][c] += det[i][j];\n det[r][j] += det[i][j];\n }",
"{\n det[i][j] = scan.nextInt();\n det[i][c] += det[i][j];\n det[r][j] += det[i][j];\n }",
"det[i][j] = scan.nextInt()",
"det[i][j]",
"det[i]",
"det",
"i",
"j",
"scan.nextInt()",
"scan.nextInt",
"scan",
"det[i][c] += det[i][j]",
"det[i][c]",
"det[i]",
"det",
"i",
"c",
"det[i][j]",
"det[i]",
"det",
"i",
"j",
"det[r][j] += det[i][j]",
"det[r][j]",
"det[r]",
"det",
"r",
"j",
"det[i][j]",
"det[i]",
"det",
"i",
"j",
"det[r][c] += det[i][c]",
"det[r][c]",
"det[r]",
"det",
"r",
"c",
"det[i][c]",
"det[i]",
"det",
"i",
"c",
"for (int i = 0; i < r + 1; i++) {\n for (int j = 0; j < c + 1; j++) {\n System.out.print(det[i][j]);\n if(j==c) continue;\n System.out.print(\" \");\n }\n System.out.println();\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < r + 1",
"i",
"r + 1",
"r",
"1",
"i++",
"i++",
"i",
"{\n for (int j = 0; j < c + 1; j++) {\n System.out.print(det[i][j]);\n if(j==c) continue;\n System.out.print(\" \");\n }\n System.out.println();\n }",
"{\n for (int j = 0; j < c + 1; j++) {\n System.out.print(det[i][j]);\n if(j==c) continue;\n System.out.print(\" \");\n }\n System.out.println();\n }",
"for (int j = 0; j < c + 1; j++) {\n System.out.print(det[i][j]);\n if(j==c) continue;\n System.out.print(\" \");\n }",
"int j = 0;",
"int j = 0;",
"j",
"0",
"j < c + 1",
"j",
"c + 1",
"c",
"1",
"j++",
"j++",
"j",
"{\n System.out.print(det[i][j]);\n if(j==c) continue;\n System.out.print(\" \");\n }",
"{\n System.out.print(det[i][j]);\n if(j==c) continue;\n System.out.print(\" \");\n }",
"System.out.print(det[i][j])",
"System.out.print",
"System.out",
"System",
"System.out",
"det[i][j]",
"det[i]",
"det",
"i",
"j",
"if(j==c) continue;",
"j==c",
"j",
"c",
"continue;",
"System.out.print(\" \")",
"System.out.print",
"System.out",
"System",
"System.out",
"\" \"",
"System.out.println()",
"System.out.println",
"System.out",
"System",
"System.out",
"String[] args",
"args"
] | import java.util.Scanner;
class Main {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
int r = scan.nextInt();
int c = scan.nextInt();
int[][] det = new int[r + 1][c + 1];
for (int i = 0; i < r; i++) {
for (int j = 0; j < c; j++) {
det[i][j] = scan.nextInt();
det[i][c] += det[i][j];
det[r][j] += det[i][j];
}
det[r][c] += det[i][c];
}
for (int i = 0; i < r + 1; i++) {
for (int j = 0; j < c + 1; j++) {
System.out.print(det[i][j]);
if(j==c) continue;
System.out.print(" ");
}
System.out.println();
}
}
} |
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
41,
13,
20,
2,
13,
17,
2,
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,
41,
13,
4,
18,
13,
0,
18,
18,
13,
13,
13,
13,
0,
18,
18,
13,
13,
13,
13,
0,
18,
18,
13,
13,
13,
13,
0,
13,
13,
0,
18,
18,
13,
13,
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,
4,
18,
18,
13,
13,
8,
2,
13,
13,
17,
17,
18,
18,
13,
13,
13,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
141,
5
],
[
141,
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
],
[
19,
20
],
[
20,
21
],
[
8,
22
],
[
22,
23
],
[
22,
24
],
[
25,
26
],
[
25,
27
],
[
28,
29
],
[
28,
30
],
[
8,
31
],
[
31,
32
],
[
31,
33
],
[
8,
34
],
[
34,
35
],
[
35,
36
],
[
36,
37
],
[
36,
38
],
[
34,
39
],
[
39,
40
],
[
39,
41
],
[
34,
42
],
[
42,
43
],
[
43,
44
],
[
34,
45
],
[
46,
46
],
[
46,
47
],
[
47,
48
],
[
48,
49
],
[
49,
50
],
[
49,
51
],
[
47,
52
],
[
52,
53
],
[
52,
54
],
[
47,
55
],
[
55,
56
],
[
56,
57
],
[
47,
58
],
[
59,
59
],
[
59,
60
],
[
60,
61
],
[
60,
62
],
[
62,
63
],
[
63,
64
],
[
59,
65
],
[
65,
66
],
[
66,
67
],
[
67,
68
],
[
67,
69
],
[
66,
70
],
[
65,
71
],
[
59,
72
],
[
72,
73
],
[
73,
74
],
[
74,
75
],
[
74,
76
],
[
73,
77
],
[
72,
78
],
[
59,
79
],
[
79,
80
],
[
80,
81
],
[
81,
82
],
[
81,
83
],
[
80,
84
],
[
79,
85
],
[
59,
86
],
[
86,
87
],
[
86,
88
],
[
8,
89
],
[
89,
90
],
[
90,
91
],
[
91,
92
],
[
91,
93
],
[
90,
94
],
[
89,
95
],
[
8,
96
],
[
96,
97
],
[
97,
98
],
[
98,
99
],
[
98,
100
],
[
96,
101
],
[
101,
102
],
[
101,
103
],
[
96,
104
],
[
104,
105
],
[
105,
106
],
[
96,
107
],
[
108,
108
],
[
108,
109
],
[
109,
110
],
[
110,
111
],
[
111,
112
],
[
111,
113
],
[
109,
114
],
[
114,
115
],
[
114,
116
],
[
109,
117
],
[
117,
118
],
[
118,
119
],
[
109,
120
],
[
121,
121
],
[
121,
122
],
[
122,
123
],
[
123,
124
],
[
124,
125
],
[
124,
126
],
[
122,
127
],
[
127,
128
],
[
128,
129
],
[
128,
130
],
[
127,
131
],
[
127,
132
],
[
122,
133
],
[
133,
134
],
[
134,
135
],
[
134,
136
],
[
133,
137
],
[
6,
138
],
[
138,
139
],
[
0,
140
],
[
140,
141
],
[
140,
142
]
] | [
"import java.util.Scanner;\n\npublic class Main {\n\n public static void main(String[] args) {\n Scanner stdin = new Scanner(System.in);\n int r = stdin.nextInt();\n int c = stdin.nextInt();\n int[][] sheet = new int[r + 1][c + 1];\n\n int sum = 0;\n for (int i = 0; i < r; i++) {\n for (int j = 0; j < c; j++) {\n int n = stdin.nextInt();\n sheet[i][j] = n;\n sheet[r][j] += n;\n sheet[i][c] += n;\n sum += n;\n }\n }\n\n sheet[r][c] = sum;\n for (int i = 0; i <= r; i++) {\n for (int j = 0; j <= c; j++) {\n System.out.printf(j < c ? \"%d \" : \"%d%n\", sheet[i][j]);\n }\n }\n }\n\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n\n public static void main(String[] args) {\n Scanner stdin = new Scanner(System.in);\n int r = stdin.nextInt();\n int c = stdin.nextInt();\n int[][] sheet = new int[r + 1][c + 1];\n\n int sum = 0;\n for (int i = 0; i < r; i++) {\n for (int j = 0; j < c; j++) {\n int n = stdin.nextInt();\n sheet[i][j] = n;\n sheet[r][j] += n;\n sheet[i][c] += n;\n sum += n;\n }\n }\n\n sheet[r][c] = sum;\n for (int i = 0; i <= r; i++) {\n for (int j = 0; j <= c; j++) {\n System.out.printf(j < c ? \"%d \" : \"%d%n\", sheet[i][j]);\n }\n }\n }\n\n}",
"Main",
"public static void main(String[] args) {\n Scanner stdin = new Scanner(System.in);\n int r = stdin.nextInt();\n int c = stdin.nextInt();\n int[][] sheet = new int[r + 1][c + 1];\n\n int sum = 0;\n for (int i = 0; i < r; i++) {\n for (int j = 0; j < c; j++) {\n int n = stdin.nextInt();\n sheet[i][j] = n;\n sheet[r][j] += n;\n sheet[i][c] += n;\n sum += n;\n }\n }\n\n sheet[r][c] = sum;\n for (int i = 0; i <= r; i++) {\n for (int j = 0; j <= c; j++) {\n System.out.printf(j < c ? \"%d \" : \"%d%n\", sheet[i][j]);\n }\n }\n }",
"main",
"{\n Scanner stdin = new Scanner(System.in);\n int r = stdin.nextInt();\n int c = stdin.nextInt();\n int[][] sheet = new int[r + 1][c + 1];\n\n int sum = 0;\n for (int i = 0; i < r; i++) {\n for (int j = 0; j < c; j++) {\n int n = stdin.nextInt();\n sheet[i][j] = n;\n sheet[r][j] += n;\n sheet[i][c] += n;\n sum += n;\n }\n }\n\n sheet[r][c] = sum;\n for (int i = 0; i <= r; i++) {\n for (int j = 0; j <= c; j++) {\n System.out.printf(j < c ? \"%d \" : \"%d%n\", sheet[i][j]);\n }\n }\n }",
"Scanner stdin = new Scanner(System.in);",
"stdin",
"new Scanner(System.in)",
"int r = stdin.nextInt();",
"r",
"stdin.nextInt()",
"stdin.nextInt",
"stdin",
"int c = stdin.nextInt();",
"c",
"stdin.nextInt()",
"stdin.nextInt",
"stdin",
"int[][] sheet = new int[r + 1][c + 1];",
"sheet",
"new int[r + 1][c + 1]",
"r + 1",
"r",
"1",
"c + 1",
"c",
"1",
"int sum = 0;",
"sum",
"0",
"for (int i = 0; i < r; i++) {\n for (int j = 0; j < c; j++) {\n int n = stdin.nextInt();\n sheet[i][j] = n;\n sheet[r][j] += n;\n sheet[i][c] += n;\n sum += n;\n }\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < r",
"i",
"r",
"i++",
"i++",
"i",
"{\n for (int j = 0; j < c; j++) {\n int n = stdin.nextInt();\n sheet[i][j] = n;\n sheet[r][j] += n;\n sheet[i][c] += n;\n sum += n;\n }\n }",
"{\n for (int j = 0; j < c; j++) {\n int n = stdin.nextInt();\n sheet[i][j] = n;\n sheet[r][j] += n;\n sheet[i][c] += n;\n sum += n;\n }\n }",
"for (int j = 0; j < c; j++) {\n int n = stdin.nextInt();\n sheet[i][j] = n;\n sheet[r][j] += n;\n sheet[i][c] += n;\n sum += n;\n }",
"int j = 0;",
"int j = 0;",
"j",
"0",
"j < c",
"j",
"c",
"j++",
"j++",
"j",
"{\n int n = stdin.nextInt();\n sheet[i][j] = n;\n sheet[r][j] += n;\n sheet[i][c] += n;\n sum += n;\n }",
"{\n int n = stdin.nextInt();\n sheet[i][j] = n;\n sheet[r][j] += n;\n sheet[i][c] += n;\n sum += n;\n }",
"int n = stdin.nextInt();",
"n",
"stdin.nextInt()",
"stdin.nextInt",
"stdin",
"sheet[i][j] = n",
"sheet[i][j]",
"sheet[i]",
"sheet",
"i",
"j",
"n",
"sheet[r][j] += n",
"sheet[r][j]",
"sheet[r]",
"sheet",
"r",
"j",
"n",
"sheet[i][c] += n",
"sheet[i][c]",
"sheet[i]",
"sheet",
"i",
"c",
"n",
"sum += n",
"sum",
"n",
"sheet[r][c] = sum",
"sheet[r][c]",
"sheet[r]",
"sheet",
"r",
"c",
"sum",
"for (int i = 0; i <= r; i++) {\n for (int j = 0; j <= c; j++) {\n System.out.printf(j < c ? \"%d \" : \"%d%n\", sheet[i][j]);\n }\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i <= r",
"i",
"r",
"i++",
"i++",
"i",
"{\n for (int j = 0; j <= c; j++) {\n System.out.printf(j < c ? \"%d \" : \"%d%n\", sheet[i][j]);\n }\n }",
"{\n for (int j = 0; j <= c; j++) {\n System.out.printf(j < c ? \"%d \" : \"%d%n\", sheet[i][j]);\n }\n }",
"for (int j = 0; j <= c; j++) {\n System.out.printf(j < c ? \"%d \" : \"%d%n\", sheet[i][j]);\n }",
"int j = 0;",
"int j = 0;",
"j",
"0",
"j <= c",
"j",
"c",
"j++",
"j++",
"j",
"{\n System.out.printf(j < c ? \"%d \" : \"%d%n\", sheet[i][j]);\n }",
"{\n System.out.printf(j < c ? \"%d \" : \"%d%n\", sheet[i][j]);\n }",
"System.out.printf(j < c ? \"%d \" : \"%d%n\", sheet[i][j])",
"System.out.printf",
"System.out",
"System",
"System.out",
"j < c ? \"%d \" : \"%d%n\"",
"j < c",
"j",
"c",
"\"%d \"",
"\"%d%n\"",
"sheet[i][j]",
"sheet[i]",
"sheet",
"i",
"j",
"String[] args",
"args",
"public class Main {\n\n public static void main(String[] args) {\n Scanner stdin = new Scanner(System.in);\n int r = stdin.nextInt();\n int c = stdin.nextInt();\n int[][] sheet = new int[r + 1][c + 1];\n\n int sum = 0;\n for (int i = 0; i < r; i++) {\n for (int j = 0; j < c; j++) {\n int n = stdin.nextInt();\n sheet[i][j] = n;\n sheet[r][j] += n;\n sheet[i][c] += n;\n sum += n;\n }\n }\n\n sheet[r][c] = sum;\n for (int i = 0; i <= r; i++) {\n for (int j = 0; j <= c; j++) {\n System.out.printf(j < c ? \"%d \" : \"%d%n\", sheet[i][j]);\n }\n }\n }\n\n}",
"public class Main {\n\n public static void main(String[] args) {\n Scanner stdin = new Scanner(System.in);\n int r = stdin.nextInt();\n int c = stdin.nextInt();\n int[][] sheet = new int[r + 1][c + 1];\n\n int sum = 0;\n for (int i = 0; i < r; i++) {\n for (int j = 0; j < c; j++) {\n int n = stdin.nextInt();\n sheet[i][j] = n;\n sheet[r][j] += n;\n sheet[i][c] += n;\n sum += n;\n }\n }\n\n sheet[r][c] = sum;\n for (int i = 0; i <= r; i++) {\n for (int j = 0; j <= c; j++) {\n System.out.printf(j < c ? \"%d \" : \"%d%n\", sheet[i][j]);\n }\n }\n }\n\n}",
"Main"
] | import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner stdin = new Scanner(System.in);
int r = stdin.nextInt();
int c = stdin.nextInt();
int[][] sheet = new int[r + 1][c + 1];
int sum = 0;
for (int i = 0; i < r; i++) {
for (int j = 0; j < c; j++) {
int n = stdin.nextInt();
sheet[i][j] = n;
sheet[r][j] += n;
sheet[i][c] += n;
sum += n;
}
}
sheet[r][c] = sum;
for (int i = 0; i <= r; i++) {
for (int j = 0; j <= c; j++) {
System.out.printf(j < c ? "%d " : "%d%n", sheet[i][j]);
}
}
}
} |
[
7,
15,
13,
17,
6,
13,
41,
13,
12,
13,
30,
41,
13,
41,
13,
41,
13,
20,
0,
13,
4,
18,
13,
4,
18,
13,
0,
13,
4,
18,
13,
4,
18,
13,
0,
13,
17,
0,
13,
17,
0,
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,
14,
2,
13,
2,
13,
17,
30,
0,
18,
18,
13,
13,
13,
4,
13,
13,
13,
14,
2,
13,
2,
13,
17,
30,
0,
18,
18,
13,
13,
13,
4,
13,
13,
13,
30,
0,
18,
18,
13,
13,
13,
4,
18,
13,
4,
18,
13,
4,
18,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
41,
13,
20,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
4,
18,
4,
18,
13,
18,
18,
13,
13,
13,
17,
4,
18,
13,
2,
4,
18,
13,
17,
4,
18,
18,
13,
13,
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,
18,
18,
13,
13,
13,
29,
13,
23,
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,
18,
18,
13,
13,
13,
29,
13,
23,
13,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
246,
5
],
[
246,
6
],
[
6,
7
],
[
246,
8
],
[
8,
9
],
[
8,
10
],
[
10,
11
],
[
11,
12
],
[
10,
13
],
[
13,
14
],
[
10,
15
],
[
15,
16
],
[
15,
17
],
[
10,
18
],
[
18,
19
],
[
18,
20
],
[
20,
21
],
[
21,
22
],
[
20,
23
],
[
23,
24
],
[
24,
25
],
[
10,
26
],
[
26,
27
],
[
26,
28
],
[
28,
29
],
[
29,
30
],
[
28,
31
],
[
31,
32
],
[
32,
33
],
[
10,
34
],
[
34,
35
],
[
34,
36
],
[
10,
37
],
[
37,
38
],
[
37,
39
],
[
10,
40
],
[
40,
41
],
[
40,
42
],
[
10,
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
],
[
72,
74
],
[
74,
75
],
[
74,
76
],
[
71,
77
],
[
77,
78
],
[
78,
79
],
[
79,
80
],
[
80,
81
],
[
80,
82
],
[
79,
83
],
[
78,
84
],
[
84,
85
],
[
84,
86
],
[
84,
87
],
[
71,
88
],
[
88,
89
],
[
89,
90
],
[
89,
91
],
[
91,
92
],
[
91,
93
],
[
88,
94
],
[
94,
95
],
[
95,
96
],
[
96,
97
],
[
97,
98
],
[
97,
99
],
[
96,
100
],
[
95,
101
],
[
101,
102
],
[
101,
103
],
[
101,
104
],
[
88,
105
],
[
105,
106
],
[
106,
107
],
[
107,
108
],
[
108,
109
],
[
108,
110
],
[
107,
111
],
[
106,
112
],
[
112,
113
],
[
113,
114
],
[
112,
115
],
[
115,
116
],
[
116,
117
],
[
10,
118
],
[
118,
119
],
[
119,
120
],
[
10,
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
],
[
133,
137
],
[
137,
138
],
[
138,
139
],
[
139,
140
],
[
139,
141
],
[
137,
142
],
[
142,
143
],
[
142,
144
],
[
137,
145
],
[
145,
146
],
[
146,
147
],
[
137,
148
],
[
149,
149
],
[
149,
150
],
[
150,
151
],
[
151,
152
],
[
152,
153
],
[
153,
154
],
[
152,
155
],
[
155,
156
],
[
156,
157
],
[
156,
158
],
[
155,
159
],
[
150,
160
],
[
133,
161
],
[
161,
162
],
[
162,
163
],
[
161,
164
],
[
164,
165
],
[
165,
166
],
[
166,
167
],
[
164,
168
],
[
133,
169
],
[
169,
170
],
[
170,
171
],
[
171,
172
],
[
171,
173
],
[
169,
174
],
[
8,
175
],
[
175,
176
],
[
246,
177
],
[
177,
178
],
[
177,
179
],
[
179,
180
],
[
180,
181
],
[
180,
182
],
[
179,
183
],
[
183,
184
],
[
184,
185
],
[
185,
186
],
[
185,
187
],
[
183,
188
],
[
188,
189
],
[
188,
190
],
[
183,
191
],
[
191,
192
],
[
192,
193
],
[
183,
194
],
[
195,
195
],
[
195,
196
],
[
196,
197
],
[
196,
198
],
[
198,
199
],
[
198,
200
],
[
200,
201
],
[
201,
202
],
[
201,
203
],
[
200,
204
],
[
179,
205
],
[
205,
206
],
[
177,
207
],
[
207,
208
],
[
177,
209
],
[
209,
210
],
[
246,
211
],
[
211,
212
],
[
211,
213
],
[
213,
214
],
[
214,
215
],
[
214,
216
],
[
213,
217
],
[
217,
218
],
[
218,
219
],
[
219,
220
],
[
219,
221
],
[
217,
222
],
[
222,
223
],
[
222,
224
],
[
217,
225
],
[
225,
226
],
[
226,
227
],
[
217,
228
],
[
229,
229
],
[
229,
230
],
[
230,
231
],
[
230,
232
],
[
232,
233
],
[
232,
234
],
[
234,
235
],
[
235,
236
],
[
235,
237
],
[
234,
238
],
[
213,
239
],
[
239,
240
],
[
211,
241
],
[
241,
242
],
[
211,
243
],
[
243,
244
],
[
0,
245
],
[
245,
246
],
[
245,
247
]
] | [
"import java.util.Scanner;\n\npublic class Main {\n\tstatic int[][] array;\n\tpublic static void main(String[] args) {\n\t\t// r = ???, c = ?即?\n\t\tint r, c;\n\t\tScanner sc = new Scanner(System.in);\n\t\tr = Integer.parseInt(sc.next());\n\t\tc = Integer.parseInt(sc.next());\n\t\tr += 1;\n\t\tc += 1;\n\t\tarray = new int[r][c];\n\t\tfor (int i=0; i < r; i++) {\n\t\t\tfor (int j=0; j < c; j++) {\n\t\t\t\tif (i == r-1) {\n\t\t\t\t\tarray[i][j] = getCsum(j, i);\n\t\t\t\t} else if (j == c-1) {\n\t\t\t\t\tarray[i][j] = getRsum(i, j);\n\t\t\t\t} else {\n\t\t\t\t\tarray[i][j] = Integer.parseInt(sc.next());\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tsc.close();\n\t\tfor (int i=0; i < r; i++) {\n\t\t\tStringBuilder sb = new StringBuilder();\n\t\t\tfor (int j=0; j < c; j++) {\n\t\t\t\tsb.append(array[i][j]).append(' ');\n\t\t\t}\n\t\t\tsb.deleteCharAt(sb.length()-1);\n\t\t\tSystem.out.println(sb);\n\t\t}\n\t}\n\tstatic final int getRsum(int num, int cSize) {\n\t\tint sum = 0;\n\t\tfor (int i=0; i < cSize; i++) {\n\t\t\tsum = sum + array[num][i];\n\t\t}\n\t\treturn sum;\n\t}\n\tstatic final int getCsum(int num, int rSize) {\n\t\tint sum = 0;\n\t\tfor (int i=0; i < rSize; i++){\n\t\t\tsum = sum + array[i][num];\n\t\t}\n\t\treturn sum;\n\t}\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n\tstatic int[][] array;\n\tpublic static void main(String[] args) {\n\t\t// r = ???, c = ?即?\n\t\tint r, c;\n\t\tScanner sc = new Scanner(System.in);\n\t\tr = Integer.parseInt(sc.next());\n\t\tc = Integer.parseInt(sc.next());\n\t\tr += 1;\n\t\tc += 1;\n\t\tarray = new int[r][c];\n\t\tfor (int i=0; i < r; i++) {\n\t\t\tfor (int j=0; j < c; j++) {\n\t\t\t\tif (i == r-1) {\n\t\t\t\t\tarray[i][j] = getCsum(j, i);\n\t\t\t\t} else if (j == c-1) {\n\t\t\t\t\tarray[i][j] = getRsum(i, j);\n\t\t\t\t} else {\n\t\t\t\t\tarray[i][j] = Integer.parseInt(sc.next());\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tsc.close();\n\t\tfor (int i=0; i < r; i++) {\n\t\t\tStringBuilder sb = new StringBuilder();\n\t\t\tfor (int j=0; j < c; j++) {\n\t\t\t\tsb.append(array[i][j]).append(' ');\n\t\t\t}\n\t\t\tsb.deleteCharAt(sb.length()-1);\n\t\t\tSystem.out.println(sb);\n\t\t}\n\t}\n\tstatic final int getRsum(int num, int cSize) {\n\t\tint sum = 0;\n\t\tfor (int i=0; i < cSize; i++) {\n\t\t\tsum = sum + array[num][i];\n\t\t}\n\t\treturn sum;\n\t}\n\tstatic final int getCsum(int num, int rSize) {\n\t\tint sum = 0;\n\t\tfor (int i=0; i < rSize; i++){\n\t\t\tsum = sum + array[i][num];\n\t\t}\n\t\treturn sum;\n\t}\n}",
"Main",
"static int[][] array;",
"array",
"public static void main(String[] args) {\n\t\t// r = ???, c = ?即?\n\t\tint r, c;\n\t\tScanner sc = new Scanner(System.in);\n\t\tr = Integer.parseInt(sc.next());\n\t\tc = Integer.parseInt(sc.next());\n\t\tr += 1;\n\t\tc += 1;\n\t\tarray = new int[r][c];\n\t\tfor (int i=0; i < r; i++) {\n\t\t\tfor (int j=0; j < c; j++) {\n\t\t\t\tif (i == r-1) {\n\t\t\t\t\tarray[i][j] = getCsum(j, i);\n\t\t\t\t} else if (j == c-1) {\n\t\t\t\t\tarray[i][j] = getRsum(i, j);\n\t\t\t\t} else {\n\t\t\t\t\tarray[i][j] = Integer.parseInt(sc.next());\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tsc.close();\n\t\tfor (int i=0; i < r; i++) {\n\t\t\tStringBuilder sb = new StringBuilder();\n\t\t\tfor (int j=0; j < c; j++) {\n\t\t\t\tsb.append(array[i][j]).append(' ');\n\t\t\t}\n\t\t\tsb.deleteCharAt(sb.length()-1);\n\t\t\tSystem.out.println(sb);\n\t\t}\n\t}",
"main",
"{\n\t\t// r = ???, c = ?即?\n\t\tint r, c;\n\t\tScanner sc = new Scanner(System.in);\n\t\tr = Integer.parseInt(sc.next());\n\t\tc = Integer.parseInt(sc.next());\n\t\tr += 1;\n\t\tc += 1;\n\t\tarray = new int[r][c];\n\t\tfor (int i=0; i < r; i++) {\n\t\t\tfor (int j=0; j < c; j++) {\n\t\t\t\tif (i == r-1) {\n\t\t\t\t\tarray[i][j] = getCsum(j, i);\n\t\t\t\t} else if (j == c-1) {\n\t\t\t\t\tarray[i][j] = getRsum(i, j);\n\t\t\t\t} else {\n\t\t\t\t\tarray[i][j] = Integer.parseInt(sc.next());\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tsc.close();\n\t\tfor (int i=0; i < r; i++) {\n\t\t\tStringBuilder sb = new StringBuilder();\n\t\t\tfor (int j=0; j < c; j++) {\n\t\t\t\tsb.append(array[i][j]).append(' ');\n\t\t\t}\n\t\t\tsb.deleteCharAt(sb.length()-1);\n\t\t\tSystem.out.println(sb);\n\t\t}\n\t}",
"int r",
"r",
"c;",
"c",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"r = Integer.parseInt(sc.next())",
"r",
"Integer.parseInt(sc.next())",
"Integer.parseInt",
"Integer",
"sc.next()",
"sc.next",
"sc",
"c = Integer.parseInt(sc.next())",
"c",
"Integer.parseInt(sc.next())",
"Integer.parseInt",
"Integer",
"sc.next()",
"sc.next",
"sc",
"r += 1",
"r",
"1",
"c += 1",
"c",
"1",
"array = new int[r][c]",
"array",
"new int[r][c]",
"r",
"c",
"for (int i=0; i < r; i++) {\n\t\t\tfor (int j=0; j < c; j++) {\n\t\t\t\tif (i == r-1) {\n\t\t\t\t\tarray[i][j] = getCsum(j, i);\n\t\t\t\t} else if (j == c-1) {\n\t\t\t\t\tarray[i][j] = getRsum(i, j);\n\t\t\t\t} else {\n\t\t\t\t\tarray[i][j] = Integer.parseInt(sc.next());\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"int i=0;",
"int i=0;",
"i",
"0",
"i < r",
"i",
"r",
"i++",
"i++",
"i",
"{\n\t\t\tfor (int j=0; j < c; j++) {\n\t\t\t\tif (i == r-1) {\n\t\t\t\t\tarray[i][j] = getCsum(j, i);\n\t\t\t\t} else if (j == c-1) {\n\t\t\t\t\tarray[i][j] = getRsum(i, j);\n\t\t\t\t} else {\n\t\t\t\t\tarray[i][j] = Integer.parseInt(sc.next());\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"{\n\t\t\tfor (int j=0; j < c; j++) {\n\t\t\t\tif (i == r-1) {\n\t\t\t\t\tarray[i][j] = getCsum(j, i);\n\t\t\t\t} else if (j == c-1) {\n\t\t\t\t\tarray[i][j] = getRsum(i, j);\n\t\t\t\t} else {\n\t\t\t\t\tarray[i][j] = Integer.parseInt(sc.next());\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"for (int j=0; j < c; j++) {\n\t\t\t\tif (i == r-1) {\n\t\t\t\t\tarray[i][j] = getCsum(j, i);\n\t\t\t\t} else if (j == c-1) {\n\t\t\t\t\tarray[i][j] = getRsum(i, j);\n\t\t\t\t} else {\n\t\t\t\t\tarray[i][j] = Integer.parseInt(sc.next());\n\t\t\t\t}\n\t\t\t}",
"int j=0;",
"int j=0;",
"j",
"0",
"j < c",
"j",
"c",
"j++",
"j++",
"j",
"{\n\t\t\t\tif (i == r-1) {\n\t\t\t\t\tarray[i][j] = getCsum(j, i);\n\t\t\t\t} else if (j == c-1) {\n\t\t\t\t\tarray[i][j] = getRsum(i, j);\n\t\t\t\t} else {\n\t\t\t\t\tarray[i][j] = Integer.parseInt(sc.next());\n\t\t\t\t}\n\t\t\t}",
"{\n\t\t\t\tif (i == r-1) {\n\t\t\t\t\tarray[i][j] = getCsum(j, i);\n\t\t\t\t} else if (j == c-1) {\n\t\t\t\t\tarray[i][j] = getRsum(i, j);\n\t\t\t\t} else {\n\t\t\t\t\tarray[i][j] = Integer.parseInt(sc.next());\n\t\t\t\t}\n\t\t\t}",
"if (i == r-1) {\n\t\t\t\t\tarray[i][j] = getCsum(j, i);\n\t\t\t\t} else if (j == c-1) {\n\t\t\t\t\tarray[i][j] = getRsum(i, j);\n\t\t\t\t} else {\n\t\t\t\t\tarray[i][j] = Integer.parseInt(sc.next());\n\t\t\t\t}",
"i == r-1",
"i",
"r-1",
"r",
"1",
"{\n\t\t\t\t\tarray[i][j] = getCsum(j, i);\n\t\t\t\t}",
"array[i][j] = getCsum(j, i)",
"array[i][j]",
"array[i]",
"array",
"i",
"j",
"getCsum(j, i)",
"getCsum",
"j",
"i",
"if (j == c-1) {\n\t\t\t\t\tarray[i][j] = getRsum(i, j);\n\t\t\t\t} else {\n\t\t\t\t\tarray[i][j] = Integer.parseInt(sc.next());\n\t\t\t\t}",
"j == c-1",
"j",
"c-1",
"c",
"1",
"{\n\t\t\t\t\tarray[i][j] = getRsum(i, j);\n\t\t\t\t}",
"array[i][j] = getRsum(i, j)",
"array[i][j]",
"array[i]",
"array",
"i",
"j",
"getRsum(i, j)",
"getRsum",
"i",
"j",
"{\n\t\t\t\t\tarray[i][j] = Integer.parseInt(sc.next());\n\t\t\t\t}",
"array[i][j] = Integer.parseInt(sc.next())",
"array[i][j]",
"array[i]",
"array",
"i",
"j",
"Integer.parseInt(sc.next())",
"Integer.parseInt",
"Integer",
"sc.next()",
"sc.next",
"sc",
"sc.close()",
"sc.close",
"sc",
"for (int i=0; i < r; i++) {\n\t\t\tStringBuilder sb = new StringBuilder();\n\t\t\tfor (int j=0; j < c; j++) {\n\t\t\t\tsb.append(array[i][j]).append(' ');\n\t\t\t}\n\t\t\tsb.deleteCharAt(sb.length()-1);\n\t\t\tSystem.out.println(sb);\n\t\t}",
"int i=0;",
"int i=0;",
"i",
"0",
"i < r",
"i",
"r",
"i++",
"i++",
"i",
"{\n\t\t\tStringBuilder sb = new StringBuilder();\n\t\t\tfor (int j=0; j < c; j++) {\n\t\t\t\tsb.append(array[i][j]).append(' ');\n\t\t\t}\n\t\t\tsb.deleteCharAt(sb.length()-1);\n\t\t\tSystem.out.println(sb);\n\t\t}",
"{\n\t\t\tStringBuilder sb = new StringBuilder();\n\t\t\tfor (int j=0; j < c; j++) {\n\t\t\t\tsb.append(array[i][j]).append(' ');\n\t\t\t}\n\t\t\tsb.deleteCharAt(sb.length()-1);\n\t\t\tSystem.out.println(sb);\n\t\t}",
"StringBuilder sb = new StringBuilder();",
"sb",
"new StringBuilder()",
"for (int j=0; j < c; j++) {\n\t\t\t\tsb.append(array[i][j]).append(' ');\n\t\t\t}",
"int j=0;",
"int j=0;",
"j",
"0",
"j < c",
"j",
"c",
"j++",
"j++",
"j",
"{\n\t\t\t\tsb.append(array[i][j]).append(' ');\n\t\t\t}",
"{\n\t\t\t\tsb.append(array[i][j]).append(' ');\n\t\t\t}",
"sb.append(array[i][j]).append(' ')",
"sb.append(array[i][j]).append",
"sb.append(array[i][j])",
"sb.append",
"sb",
"array[i][j]",
"array[i]",
"array",
"i",
"j",
"' '",
"sb.deleteCharAt(sb.length()-1)",
"sb.deleteCharAt",
"sb",
"sb.length()-1",
"sb.length()",
"sb.length",
"sb",
"1",
"System.out.println(sb)",
"System.out.println",
"System.out",
"System",
"System.out",
"sb",
"String[] args",
"args",
"static final int getRsum(int num, int cSize) {\n\t\tint sum = 0;\n\t\tfor (int i=0; i < cSize; i++) {\n\t\t\tsum = sum + array[num][i];\n\t\t}\n\t\treturn sum;\n\t}",
"getRsum",
"{\n\t\tint sum = 0;\n\t\tfor (int i=0; i < cSize; i++) {\n\t\t\tsum = sum + array[num][i];\n\t\t}\n\t\treturn sum;\n\t}",
"int sum = 0;",
"sum",
"0",
"for (int i=0; i < cSize; i++) {\n\t\t\tsum = sum + array[num][i];\n\t\t}",
"int i=0;",
"int i=0;",
"i",
"0",
"i < cSize",
"i",
"cSize",
"i++",
"i++",
"i",
"{\n\t\t\tsum = sum + array[num][i];\n\t\t}",
"{\n\t\t\tsum = sum + array[num][i];\n\t\t}",
"sum = sum + array[num][i]",
"sum",
"sum + array[num][i]",
"sum",
"array[num][i]",
"array[num]",
"array",
"num",
"i",
"return sum;",
"sum",
"int num",
"num",
"int cSize",
"cSize",
"static final int getCsum(int num, int rSize) {\n\t\tint sum = 0;\n\t\tfor (int i=0; i < rSize; i++){\n\t\t\tsum = sum + array[i][num];\n\t\t}\n\t\treturn sum;\n\t}",
"getCsum",
"{\n\t\tint sum = 0;\n\t\tfor (int i=0; i < rSize; i++){\n\t\t\tsum = sum + array[i][num];\n\t\t}\n\t\treturn sum;\n\t}",
"int sum = 0;",
"sum",
"0",
"for (int i=0; i < rSize; i++){\n\t\t\tsum = sum + array[i][num];\n\t\t}",
"int i=0;",
"int i=0;",
"i",
"0",
"i < rSize",
"i",
"rSize",
"i++",
"i++",
"i",
"{\n\t\t\tsum = sum + array[i][num];\n\t\t}",
"{\n\t\t\tsum = sum + array[i][num];\n\t\t}",
"sum = sum + array[i][num]",
"sum",
"sum + array[i][num]",
"sum",
"array[i][num]",
"array[i]",
"array",
"i",
"num",
"return sum;",
"sum",
"int num",
"num",
"int rSize",
"rSize",
"public class Main {\n\tstatic int[][] array;\n\tpublic static void main(String[] args) {\n\t\t// r = ???, c = ?即?\n\t\tint r, c;\n\t\tScanner sc = new Scanner(System.in);\n\t\tr = Integer.parseInt(sc.next());\n\t\tc = Integer.parseInt(sc.next());\n\t\tr += 1;\n\t\tc += 1;\n\t\tarray = new int[r][c];\n\t\tfor (int i=0; i < r; i++) {\n\t\t\tfor (int j=0; j < c; j++) {\n\t\t\t\tif (i == r-1) {\n\t\t\t\t\tarray[i][j] = getCsum(j, i);\n\t\t\t\t} else if (j == c-1) {\n\t\t\t\t\tarray[i][j] = getRsum(i, j);\n\t\t\t\t} else {\n\t\t\t\t\tarray[i][j] = Integer.parseInt(sc.next());\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tsc.close();\n\t\tfor (int i=0; i < r; i++) {\n\t\t\tStringBuilder sb = new StringBuilder();\n\t\t\tfor (int j=0; j < c; j++) {\n\t\t\t\tsb.append(array[i][j]).append(' ');\n\t\t\t}\n\t\t\tsb.deleteCharAt(sb.length()-1);\n\t\t\tSystem.out.println(sb);\n\t\t}\n\t}\n\tstatic final int getRsum(int num, int cSize) {\n\t\tint sum = 0;\n\t\tfor (int i=0; i < cSize; i++) {\n\t\t\tsum = sum + array[num][i];\n\t\t}\n\t\treturn sum;\n\t}\n\tstatic final int getCsum(int num, int rSize) {\n\t\tint sum = 0;\n\t\tfor (int i=0; i < rSize; i++){\n\t\t\tsum = sum + array[i][num];\n\t\t}\n\t\treturn sum;\n\t}\n}",
"public class Main {\n\tstatic int[][] array;\n\tpublic static void main(String[] args) {\n\t\t// r = ???, c = ?即?\n\t\tint r, c;\n\t\tScanner sc = new Scanner(System.in);\n\t\tr = Integer.parseInt(sc.next());\n\t\tc = Integer.parseInt(sc.next());\n\t\tr += 1;\n\t\tc += 1;\n\t\tarray = new int[r][c];\n\t\tfor (int i=0; i < r; i++) {\n\t\t\tfor (int j=0; j < c; j++) {\n\t\t\t\tif (i == r-1) {\n\t\t\t\t\tarray[i][j] = getCsum(j, i);\n\t\t\t\t} else if (j == c-1) {\n\t\t\t\t\tarray[i][j] = getRsum(i, j);\n\t\t\t\t} else {\n\t\t\t\t\tarray[i][j] = Integer.parseInt(sc.next());\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tsc.close();\n\t\tfor (int i=0; i < r; i++) {\n\t\t\tStringBuilder sb = new StringBuilder();\n\t\t\tfor (int j=0; j < c; j++) {\n\t\t\t\tsb.append(array[i][j]).append(' ');\n\t\t\t}\n\t\t\tsb.deleteCharAt(sb.length()-1);\n\t\t\tSystem.out.println(sb);\n\t\t}\n\t}\n\tstatic final int getRsum(int num, int cSize) {\n\t\tint sum = 0;\n\t\tfor (int i=0; i < cSize; i++) {\n\t\t\tsum = sum + array[num][i];\n\t\t}\n\t\treturn sum;\n\t}\n\tstatic final int getCsum(int num, int rSize) {\n\t\tint sum = 0;\n\t\tfor (int i=0; i < rSize; i++){\n\t\t\tsum = sum + array[i][num];\n\t\t}\n\t\treturn sum;\n\t}\n}",
"Main"
] | import java.util.Scanner;
public class Main {
static int[][] array;
public static void main(String[] args) {
// r = ???, c = ?即?
int r, c;
Scanner sc = new Scanner(System.in);
r = Integer.parseInt(sc.next());
c = Integer.parseInt(sc.next());
r += 1;
c += 1;
array = new int[r][c];
for (int i=0; i < r; i++) {
for (int j=0; j < c; j++) {
if (i == r-1) {
array[i][j] = getCsum(j, i);
} else if (j == c-1) {
array[i][j] = getRsum(i, j);
} else {
array[i][j] = Integer.parseInt(sc.next());
}
}
}
sc.close();
for (int i=0; i < r; i++) {
StringBuilder sb = new StringBuilder();
for (int j=0; j < c; j++) {
sb.append(array[i][j]).append(' ');
}
sb.deleteCharAt(sb.length()-1);
System.out.println(sb);
}
}
static final int getRsum(int num, int cSize) {
int sum = 0;
for (int i=0; i < cSize; i++) {
sum = sum + array[num][i];
}
return sum;
}
static final int getCsum(int num, int rSize) {
int sum = 0;
for (int i=0; i < rSize; i++){
sum = sum + array[i][num];
}
return sum;
}
} |
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
41,
13,
17,
41,
13,
17,
41,
13,
20,
2,
13,
17,
2,
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,
18,
18,
13,
13,
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,
0,
13,
18,
18,
13,
13,
13,
0,
18,
18,
13,
13,
13,
13,
0,
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,
18,
18,
13,
13,
13,
0,
18,
18,
13,
13,
13,
13,
0,
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,
14,
2,
13,
13,
30,
4,
18,
18,
13,
13,
18,
18,
13,
13,
13,
30,
4,
18,
18,
13,
13,
2,
18,
18,
13,
13,
13,
17,
4,
18,
18,
13,
13,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
228,
5
],
[
228,
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
],
[
19,
20
],
[
20,
21
],
[
8,
22
],
[
22,
23
],
[
22,
24
],
[
8,
25
],
[
25,
26
],
[
25,
27
],
[
8,
28
],
[
28,
29
],
[
28,
30
],
[
31,
32
],
[
31,
33
],
[
34,
35
],
[
34,
36
],
[
8,
37
],
[
37,
38
],
[
38,
39
],
[
39,
40
],
[
39,
41
],
[
37,
42
],
[
42,
43
],
[
42,
44
],
[
37,
45
],
[
45,
46
],
[
46,
47
],
[
37,
48
],
[
49,
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
],
[
62,
62
],
[
62,
63
],
[
63,
64
],
[
64,
65
],
[
65,
66
],
[
65,
67
],
[
64,
68
],
[
63,
69
],
[
69,
70
],
[
70,
71
],
[
8,
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
],
[
85,
93
],
[
93,
94
],
[
94,
95
],
[
85,
96
],
[
97,
97
],
[
97,
98
],
[
98,
99
],
[
98,
100
],
[
100,
101
],
[
101,
102
],
[
101,
103
],
[
100,
104
],
[
84,
105
],
[
105,
106
],
[
106,
107
],
[
107,
108
],
[
107,
109
],
[
106,
110
],
[
105,
111
],
[
84,
112
],
[
112,
113
],
[
112,
114
],
[
8,
115
],
[
115,
116
],
[
116,
117
],
[
117,
118
],
[
117,
119
],
[
115,
120
],
[
120,
121
],
[
120,
122
],
[
122,
123
],
[
122,
124
],
[
115,
125
],
[
125,
126
],
[
126,
127
],
[
115,
128
],
[
129,
129
],
[
129,
130
],
[
130,
131
],
[
131,
132
],
[
132,
133
],
[
132,
134
],
[
130,
135
],
[
135,
136
],
[
135,
137
],
[
137,
138
],
[
137,
139
],
[
130,
140
],
[
140,
141
],
[
141,
142
],
[
130,
143
],
[
144,
144
],
[
144,
145
],
[
145,
146
],
[
145,
147
],
[
147,
148
],
[
148,
149
],
[
148,
150
],
[
147,
151
],
[
129,
152
],
[
152,
153
],
[
153,
154
],
[
154,
155
],
[
154,
156
],
[
153,
157
],
[
152,
158
],
[
129,
159
],
[
159,
160
],
[
159,
161
],
[
8,
162
],
[
162,
163
],
[
163,
164
],
[
164,
165
],
[
164,
166
],
[
162,
167
],
[
167,
168
],
[
167,
169
],
[
169,
170
],
[
169,
171
],
[
162,
172
],
[
172,
173
],
[
173,
174
],
[
162,
175
],
[
176,
176
],
[
176,
177
],
[
177,
178
],
[
178,
179
],
[
179,
180
],
[
179,
181
],
[
177,
182
],
[
182,
183
],
[
182,
184
],
[
184,
185
],
[
184,
186
],
[
177,
187
],
[
187,
188
],
[
188,
189
],
[
177,
190
],
[
191,
191
],
[
191,
192
],
[
192,
193
],
[
193,
194
],
[
193,
195
],
[
192,
196
],
[
196,
197
],
[
197,
198
],
[
198,
199
],
[
199,
200
],
[
199,
201
],
[
197,
202
],
[
202,
203
],
[
203,
204
],
[
203,
205
],
[
202,
206
],
[
192,
207
],
[
207,
208
],
[
208,
209
],
[
209,
210
],
[
210,
211
],
[
210,
212
],
[
208,
213
],
[
213,
214
],
[
214,
215
],
[
215,
216
],
[
215,
217
],
[
214,
218
],
[
213,
219
],
[
176,
220
],
[
220,
221
],
[
221,
222
],
[
222,
223
],
[
222,
224
],
[
6,
225
],
[
225,
226
],
[
0,
227
],
[
227,
228
],
[
227,
229
]
] | [
"import java.util.*;\n\npublic class Main {\n public static void main(String[] args) {\n Scanner scan = new Scanner(System.in);\n int r = scan.nextInt();\n int c = scan.nextInt();\n int sumH = 0;\n int sumV = 0;\n int[][] l = new int[r + 1][c + 1];\n\n for (int v = 0; v < r; v++) {\n for (int h = 0; h < c; h++) {\n l[v][h] = scan.nextInt();\n }\n }\n\n for (int v = 0; v < r; v++) {\n for (int h = 0; h < c; h++) {\n sumH += l[v][h];\n }\n l[v][c] = sumH;\n sumH = 0;\n }\n\n\n for (int h = 0; h < c +1; h++) {\n for (int v = 0; v < r +1; v++) {\n sumV += l[v][h];\n }\n l[r][h] = sumV;\n sumV = 0;\n }\n\n for (int v = 0; v < r + 1; v++) {\n for (int h = 0; h < c + 1; h++) {\n if (h == c) {\n System.out.print(l[v][h]);\n } else {\n System.out.print(l[v][h] + \" \");\n }\n }\n System.out.println();\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 r = scan.nextInt();\n int c = scan.nextInt();\n int sumH = 0;\n int sumV = 0;\n int[][] l = new int[r + 1][c + 1];\n\n for (int v = 0; v < r; v++) {\n for (int h = 0; h < c; h++) {\n l[v][h] = scan.nextInt();\n }\n }\n\n for (int v = 0; v < r; v++) {\n for (int h = 0; h < c; h++) {\n sumH += l[v][h];\n }\n l[v][c] = sumH;\n sumH = 0;\n }\n\n\n for (int h = 0; h < c +1; h++) {\n for (int v = 0; v < r +1; v++) {\n sumV += l[v][h];\n }\n l[r][h] = sumV;\n sumV = 0;\n }\n\n for (int v = 0; v < r + 1; v++) {\n for (int h = 0; h < c + 1; h++) {\n if (h == c) {\n System.out.print(l[v][h]);\n } else {\n System.out.print(l[v][h] + \" \");\n }\n }\n System.out.println();\n }\n }\n}",
"Main",
"public static void main(String[] args) {\n Scanner scan = new Scanner(System.in);\n int r = scan.nextInt();\n int c = scan.nextInt();\n int sumH = 0;\n int sumV = 0;\n int[][] l = new int[r + 1][c + 1];\n\n for (int v = 0; v < r; v++) {\n for (int h = 0; h < c; h++) {\n l[v][h] = scan.nextInt();\n }\n }\n\n for (int v = 0; v < r; v++) {\n for (int h = 0; h < c; h++) {\n sumH += l[v][h];\n }\n l[v][c] = sumH;\n sumH = 0;\n }\n\n\n for (int h = 0; h < c +1; h++) {\n for (int v = 0; v < r +1; v++) {\n sumV += l[v][h];\n }\n l[r][h] = sumV;\n sumV = 0;\n }\n\n for (int v = 0; v < r + 1; v++) {\n for (int h = 0; h < c + 1; h++) {\n if (h == c) {\n System.out.print(l[v][h]);\n } else {\n System.out.print(l[v][h] + \" \");\n }\n }\n System.out.println();\n }\n }",
"main",
"{\n Scanner scan = new Scanner(System.in);\n int r = scan.nextInt();\n int c = scan.nextInt();\n int sumH = 0;\n int sumV = 0;\n int[][] l = new int[r + 1][c + 1];\n\n for (int v = 0; v < r; v++) {\n for (int h = 0; h < c; h++) {\n l[v][h] = scan.nextInt();\n }\n }\n\n for (int v = 0; v < r; v++) {\n for (int h = 0; h < c; h++) {\n sumH += l[v][h];\n }\n l[v][c] = sumH;\n sumH = 0;\n }\n\n\n for (int h = 0; h < c +1; h++) {\n for (int v = 0; v < r +1; v++) {\n sumV += l[v][h];\n }\n l[r][h] = sumV;\n sumV = 0;\n }\n\n for (int v = 0; v < r + 1; v++) {\n for (int h = 0; h < c + 1; h++) {\n if (h == c) {\n System.out.print(l[v][h]);\n } else {\n System.out.print(l[v][h] + \" \");\n }\n }\n System.out.println();\n }\n }",
"Scanner scan = new Scanner(System.in);",
"scan",
"new Scanner(System.in)",
"int r = scan.nextInt();",
"r",
"scan.nextInt()",
"scan.nextInt",
"scan",
"int c = scan.nextInt();",
"c",
"scan.nextInt()",
"scan.nextInt",
"scan",
"int sumH = 0;",
"sumH",
"0",
"int sumV = 0;",
"sumV",
"0",
"int[][] l = new int[r + 1][c + 1];",
"l",
"new int[r + 1][c + 1]",
"r + 1",
"r",
"1",
"c + 1",
"c",
"1",
"for (int v = 0; v < r; v++) {\n for (int h = 0; h < c; h++) {\n l[v][h] = scan.nextInt();\n }\n }",
"int v = 0;",
"int v = 0;",
"v",
"0",
"v < r",
"v",
"r",
"v++",
"v++",
"v",
"{\n for (int h = 0; h < c; h++) {\n l[v][h] = scan.nextInt();\n }\n }",
"{\n for (int h = 0; h < c; h++) {\n l[v][h] = scan.nextInt();\n }\n }",
"for (int h = 0; h < c; h++) {\n l[v][h] = scan.nextInt();\n }",
"int h = 0;",
"int h = 0;",
"h",
"0",
"h < c",
"h",
"c",
"h++",
"h++",
"h",
"{\n l[v][h] = scan.nextInt();\n }",
"{\n l[v][h] = scan.nextInt();\n }",
"l[v][h] = scan.nextInt()",
"l[v][h]",
"l[v]",
"l",
"v",
"h",
"scan.nextInt()",
"scan.nextInt",
"scan",
"for (int v = 0; v < r; v++) {\n for (int h = 0; h < c; h++) {\n sumH += l[v][h];\n }\n l[v][c] = sumH;\n sumH = 0;\n }",
"int v = 0;",
"int v = 0;",
"v",
"0",
"v < r",
"v",
"r",
"v++",
"v++",
"v",
"{\n for (int h = 0; h < c; h++) {\n sumH += l[v][h];\n }\n l[v][c] = sumH;\n sumH = 0;\n }",
"{\n for (int h = 0; h < c; h++) {\n sumH += l[v][h];\n }\n l[v][c] = sumH;\n sumH = 0;\n }",
"for (int h = 0; h < c; h++) {\n sumH += l[v][h];\n }",
"int h = 0;",
"int h = 0;",
"h",
"0",
"h < c",
"h",
"c",
"h++",
"h++",
"h",
"{\n sumH += l[v][h];\n }",
"{\n sumH += l[v][h];\n }",
"sumH += l[v][h]",
"sumH",
"l[v][h]",
"l[v]",
"l",
"v",
"h",
"l[v][c] = sumH",
"l[v][c]",
"l[v]",
"l",
"v",
"c",
"sumH",
"sumH = 0",
"sumH",
"0",
"for (int h = 0; h < c +1; h++) {\n for (int v = 0; v < r +1; v++) {\n sumV += l[v][h];\n }\n l[r][h] = sumV;\n sumV = 0;\n }",
"int h = 0;",
"int h = 0;",
"h",
"0",
"h < c +1",
"h",
"c +1",
"c",
"1",
"h++",
"h++",
"h",
"{\n for (int v = 0; v < r +1; v++) {\n sumV += l[v][h];\n }\n l[r][h] = sumV;\n sumV = 0;\n }",
"{\n for (int v = 0; v < r +1; v++) {\n sumV += l[v][h];\n }\n l[r][h] = sumV;\n sumV = 0;\n }",
"for (int v = 0; v < r +1; v++) {\n sumV += l[v][h];\n }",
"int v = 0;",
"int v = 0;",
"v",
"0",
"v < r +1",
"v",
"r +1",
"r",
"1",
"v++",
"v++",
"v",
"{\n sumV += l[v][h];\n }",
"{\n sumV += l[v][h];\n }",
"sumV += l[v][h]",
"sumV",
"l[v][h]",
"l[v]",
"l",
"v",
"h",
"l[r][h] = sumV",
"l[r][h]",
"l[r]",
"l",
"r",
"h",
"sumV",
"sumV = 0",
"sumV",
"0",
"for (int v = 0; v < r + 1; v++) {\n for (int h = 0; h < c + 1; h++) {\n if (h == c) {\n System.out.print(l[v][h]);\n } else {\n System.out.print(l[v][h] + \" \");\n }\n }\n System.out.println();\n }",
"int v = 0;",
"int v = 0;",
"v",
"0",
"v < r + 1",
"v",
"r + 1",
"r",
"1",
"v++",
"v++",
"v",
"{\n for (int h = 0; h < c + 1; h++) {\n if (h == c) {\n System.out.print(l[v][h]);\n } else {\n System.out.print(l[v][h] + \" \");\n }\n }\n System.out.println();\n }",
"{\n for (int h = 0; h < c + 1; h++) {\n if (h == c) {\n System.out.print(l[v][h]);\n } else {\n System.out.print(l[v][h] + \" \");\n }\n }\n System.out.println();\n }",
"for (int h = 0; h < c + 1; h++) {\n if (h == c) {\n System.out.print(l[v][h]);\n } else {\n System.out.print(l[v][h] + \" \");\n }\n }",
"int h = 0;",
"int h = 0;",
"h",
"0",
"h < c + 1",
"h",
"c + 1",
"c",
"1",
"h++",
"h++",
"h",
"{\n if (h == c) {\n System.out.print(l[v][h]);\n } else {\n System.out.print(l[v][h] + \" \");\n }\n }",
"{\n if (h == c) {\n System.out.print(l[v][h]);\n } else {\n System.out.print(l[v][h] + \" \");\n }\n }",
"if (h == c) {\n System.out.print(l[v][h]);\n } else {\n System.out.print(l[v][h] + \" \");\n }",
"h == c",
"h",
"c",
"{\n System.out.print(l[v][h]);\n }",
"System.out.print(l[v][h])",
"System.out.print",
"System.out",
"System",
"System.out",
"l[v][h]",
"l[v]",
"l",
"v",
"h",
"{\n System.out.print(l[v][h] + \" \");\n }",
"System.out.print(l[v][h] + \" \")",
"System.out.print",
"System.out",
"System",
"System.out",
"l[v][h] + \" \"",
"l[v][h]",
"l[v]",
"l",
"v",
"h",
"\" \"",
"System.out.println()",
"System.out.println",
"System.out",
"System",
"System.out",
"String[] args",
"args",
"public class Main {\n public static void main(String[] args) {\n Scanner scan = new Scanner(System.in);\n int r = scan.nextInt();\n int c = scan.nextInt();\n int sumH = 0;\n int sumV = 0;\n int[][] l = new int[r + 1][c + 1];\n\n for (int v = 0; v < r; v++) {\n for (int h = 0; h < c; h++) {\n l[v][h] = scan.nextInt();\n }\n }\n\n for (int v = 0; v < r; v++) {\n for (int h = 0; h < c; h++) {\n sumH += l[v][h];\n }\n l[v][c] = sumH;\n sumH = 0;\n }\n\n\n for (int h = 0; h < c +1; h++) {\n for (int v = 0; v < r +1; v++) {\n sumV += l[v][h];\n }\n l[r][h] = sumV;\n sumV = 0;\n }\n\n for (int v = 0; v < r + 1; v++) {\n for (int h = 0; h < c + 1; h++) {\n if (h == c) {\n System.out.print(l[v][h]);\n } else {\n System.out.print(l[v][h] + \" \");\n }\n }\n System.out.println();\n }\n }\n}",
"public class Main {\n public static void main(String[] args) {\n Scanner scan = new Scanner(System.in);\n int r = scan.nextInt();\n int c = scan.nextInt();\n int sumH = 0;\n int sumV = 0;\n int[][] l = new int[r + 1][c + 1];\n\n for (int v = 0; v < r; v++) {\n for (int h = 0; h < c; h++) {\n l[v][h] = scan.nextInt();\n }\n }\n\n for (int v = 0; v < r; v++) {\n for (int h = 0; h < c; h++) {\n sumH += l[v][h];\n }\n l[v][c] = sumH;\n sumH = 0;\n }\n\n\n for (int h = 0; h < c +1; h++) {\n for (int v = 0; v < r +1; v++) {\n sumV += l[v][h];\n }\n l[r][h] = sumV;\n sumV = 0;\n }\n\n for (int v = 0; v < r + 1; v++) {\n for (int h = 0; h < c + 1; h++) {\n if (h == c) {\n System.out.print(l[v][h]);\n } else {\n System.out.print(l[v][h] + \" \");\n }\n }\n System.out.println();\n }\n }\n}",
"Main"
] | import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
int r = scan.nextInt();
int c = scan.nextInt();
int sumH = 0;
int sumV = 0;
int[][] l = new int[r + 1][c + 1];
for (int v = 0; v < r; v++) {
for (int h = 0; h < c; h++) {
l[v][h] = scan.nextInt();
}
}
for (int v = 0; v < r; v++) {
for (int h = 0; h < c; h++) {
sumH += l[v][h];
}
l[v][c] = sumH;
sumH = 0;
}
for (int h = 0; h < c +1; h++) {
for (int v = 0; v < r +1; v++) {
sumV += l[v][h];
}
l[r][h] = sumV;
sumV = 0;
}
for (int v = 0; v < r + 1; v++) {
for (int h = 0; h < c + 1; h++) {
if (h == c) {
System.out.print(l[v][h]);
} else {
System.out.print(l[v][h] + " ");
}
}
System.out.println();
}
}
} |
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
41,
13,
20,
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,
41,
13,
4,
18,
13,
0,
13,
13,
0,
18,
13,
13,
13,
4,
18,
18,
13,
13,
2,
13,
17,
0,
13,
13,
4,
18,
18,
13,
13,
13,
0,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
4,
18,
18,
13,
13,
2,
18,
13,
13,
17,
4,
18,
18,
13,
13,
13,
4,
18,
13,
17,
23,
13,
12,
13,
30,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
11,
1,
41,
13,
2,
13,
17,
2,
13,
13,
1,
40,
13,
30,
11,
1,
41,
13,
2,
13,
17,
2,
13,
13,
1,
40,
13,
30,
14,
2,
2,
2,
13,
13,
13,
13,
40,
13,
29,
13,
23,
13,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
188,
5
],
[
188,
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
],
[
19,
20
],
[
20,
21
],
[
8,
22
],
[
22,
23
],
[
22,
24
],
[
8,
26
],
[
26,
27
],
[
26,
28
],
[
8,
29
],
[
29,
30
],
[
29,
31
],
[
8,
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
],
[
58,
60
],
[
60,
61
],
[
61,
62
],
[
57,
63
],
[
63,
64
],
[
63,
65
],
[
57,
66
],
[
66,
67
],
[
67,
68
],
[
67,
69
],
[
66,
70
],
[
57,
71
],
[
71,
72
],
[
72,
73
],
[
73,
74
],
[
73,
75
],
[
71,
76
],
[
76,
77
],
[
76,
78
],
[
44,
79
],
[
79,
80
],
[
79,
81
],
[
44,
82
],
[
82,
83
],
[
83,
84
],
[
84,
85
],
[
84,
86
],
[
82,
87
],
[
44,
88
],
[
88,
89
],
[
88,
90
],
[
8,
91
],
[
91,
92
],
[
92,
93
],
[
93,
94
],
[
93,
95
],
[
91,
96
],
[
96,
97
],
[
96,
98
],
[
91,
99
],
[
99,
100
],
[
100,
101
],
[
91,
102
],
[
102,
103
],
[
103,
104
],
[
104,
105
],
[
105,
106
],
[
105,
107
],
[
103,
108
],
[
108,
109
],
[
109,
110
],
[
109,
111
],
[
108,
112
],
[
8,
113
],
[
113,
114
],
[
114,
115
],
[
115,
116
],
[
115,
117
],
[
113,
118
],
[
8,
119
],
[
119,
120
],
[
120,
121
],
[
119,
122
],
[
6,
123
],
[
123,
124
],
[
188,
125
],
[
125,
126
],
[
125,
127
],
[
127,
128
],
[
128,
129
],
[
128,
130
],
[
127,
131
],
[
131,
132
],
[
132,
133
],
[
133,
134
],
[
133,
135
],
[
131,
136
],
[
136,
137
],
[
136,
138
],
[
131,
139
],
[
139,
140
],
[
140,
141
],
[
131,
142
],
[
142,
143
],
[
143,
144
],
[
144,
145
],
[
145,
146
],
[
145,
147
],
[
147,
148
],
[
147,
149
],
[
143,
150
],
[
150,
151
],
[
150,
152
],
[
143,
153
],
[
153,
154
],
[
154,
155
],
[
143,
156
],
[
156,
157
],
[
157,
158
],
[
158,
159
],
[
159,
160
],
[
159,
161
],
[
161,
162
],
[
161,
163
],
[
157,
164
],
[
164,
165
],
[
164,
166
],
[
157,
167
],
[
167,
168
],
[
168,
169
],
[
157,
170
],
[
170,
171
],
[
171,
172
],
[
172,
173
],
[
174,
174
],
[
174,
175
],
[
174,
176
],
[
174,
177
],
[
172,
178
],
[
171,
179
],
[
179,
180
],
[
127,
181
],
[
181,
182
],
[
125,
183
],
[
183,
184
],
[
125,
185
],
[
185,
186
],
[
0,
187
],
[
187,
188
],
[
187,
189
]
] | [
"import java.util.Scanner;\n\npublic class Main {\n\n\tpublic static void main(String[] args) {\n\t\t@SuppressWarnings(\"resource\")\n\t\tScanner scan = new Scanner(System.in);\n\t\tint r = scan.nextInt();\n\t\tint c = scan.nextInt();\n\n\t\tint[] rSum = new int[c];\n\t\tint cSum = 0, gSum = 0;\n\t\tfor (int i = 0; i < r; i++) {\n\t\t\tfor (int j = 0; j < c; j++) {\n\t\t\t\tint cell = scan.nextInt();\n\t\t\t\tcSum += cell;\n\t\t\t\trSum[j] += cell;\n\t\t\t\tSystem.out.print(cell + \" \");\n\t\t\t}\n\t\t\tgSum += cSum;\n\t\t\tSystem.out.println(cSum);\n\t\t\tcSum = 0;\n\t\t}\n\t\tfor (int i = 0; i < c; i++)\n\t\t\tSystem.out.print(rSum[i] + \" \");\n\t\tSystem.out.println(gSum);\n\n\t\tSystem.exit(0);\n\t}\n\n\tprivate static int run(int n, int x) {\n\t\tint result = 0;\n\t\tfor (int a = 1; a <= n; a++)\n\t\t\tfor (int b = a + 1; b <= n; b++)\n\t\t\t\tfor (int c = b + 1; c <= n; c++)\n\t\t\t\t\tif (a + b + c == x)\n\t\t\t\t\t\t++result;\n\t\treturn (result);\n\n\t}\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n\n\tpublic static void main(String[] args) {\n\t\t@SuppressWarnings(\"resource\")\n\t\tScanner scan = new Scanner(System.in);\n\t\tint r = scan.nextInt();\n\t\tint c = scan.nextInt();\n\n\t\tint[] rSum = new int[c];\n\t\tint cSum = 0, gSum = 0;\n\t\tfor (int i = 0; i < r; i++) {\n\t\t\tfor (int j = 0; j < c; j++) {\n\t\t\t\tint cell = scan.nextInt();\n\t\t\t\tcSum += cell;\n\t\t\t\trSum[j] += cell;\n\t\t\t\tSystem.out.print(cell + \" \");\n\t\t\t}\n\t\t\tgSum += cSum;\n\t\t\tSystem.out.println(cSum);\n\t\t\tcSum = 0;\n\t\t}\n\t\tfor (int i = 0; i < c; i++)\n\t\t\tSystem.out.print(rSum[i] + \" \");\n\t\tSystem.out.println(gSum);\n\n\t\tSystem.exit(0);\n\t}\n\n\tprivate static int run(int n, int x) {\n\t\tint result = 0;\n\t\tfor (int a = 1; a <= n; a++)\n\t\t\tfor (int b = a + 1; b <= n; b++)\n\t\t\t\tfor (int c = b + 1; c <= n; c++)\n\t\t\t\t\tif (a + b + c == x)\n\t\t\t\t\t\t++result;\n\t\treturn (result);\n\n\t}\n}",
"Main",
"public static void main(String[] args) {\n\t\t@SuppressWarnings(\"resource\")\n\t\tScanner scan = new Scanner(System.in);\n\t\tint r = scan.nextInt();\n\t\tint c = scan.nextInt();\n\n\t\tint[] rSum = new int[c];\n\t\tint cSum = 0, gSum = 0;\n\t\tfor (int i = 0; i < r; i++) {\n\t\t\tfor (int j = 0; j < c; j++) {\n\t\t\t\tint cell = scan.nextInt();\n\t\t\t\tcSum += cell;\n\t\t\t\trSum[j] += cell;\n\t\t\t\tSystem.out.print(cell + \" \");\n\t\t\t}\n\t\t\tgSum += cSum;\n\t\t\tSystem.out.println(cSum);\n\t\t\tcSum = 0;\n\t\t}\n\t\tfor (int i = 0; i < c; i++)\n\t\t\tSystem.out.print(rSum[i] + \" \");\n\t\tSystem.out.println(gSum);\n\n\t\tSystem.exit(0);\n\t}",
"main",
"{\n\t\t@SuppressWarnings(\"resource\")\n\t\tScanner scan = new Scanner(System.in);\n\t\tint r = scan.nextInt();\n\t\tint c = scan.nextInt();\n\n\t\tint[] rSum = new int[c];\n\t\tint cSum = 0, gSum = 0;\n\t\tfor (int i = 0; i < r; i++) {\n\t\t\tfor (int j = 0; j < c; j++) {\n\t\t\t\tint cell = scan.nextInt();\n\t\t\t\tcSum += cell;\n\t\t\t\trSum[j] += cell;\n\t\t\t\tSystem.out.print(cell + \" \");\n\t\t\t}\n\t\t\tgSum += cSum;\n\t\t\tSystem.out.println(cSum);\n\t\t\tcSum = 0;\n\t\t}\n\t\tfor (int i = 0; i < c; i++)\n\t\t\tSystem.out.print(rSum[i] + \" \");\n\t\tSystem.out.println(gSum);\n\n\t\tSystem.exit(0);\n\t}",
"@SuppressWarnings(\"resource\")\n\t\tScanner scan = new Scanner(System.in);",
"scan",
"new Scanner(System.in)",
"int r = scan.nextInt();",
"r",
"scan.nextInt()",
"scan.nextInt",
"scan",
"int c = scan.nextInt();",
"c",
"scan.nextInt()",
"scan.nextInt",
"scan",
"int[] rSum = new int[c];",
"rSum",
"new int[c]",
"c",
"int cSum = 0",
"cSum",
"0",
"gSum = 0;",
"gSum",
"0",
"for (int i = 0; i < r; i++) {\n\t\t\tfor (int j = 0; j < c; j++) {\n\t\t\t\tint cell = scan.nextInt();\n\t\t\t\tcSum += cell;\n\t\t\t\trSum[j] += cell;\n\t\t\t\tSystem.out.print(cell + \" \");\n\t\t\t}\n\t\t\tgSum += cSum;\n\t\t\tSystem.out.println(cSum);\n\t\t\tcSum = 0;\n\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < r",
"i",
"r",
"i++",
"i++",
"i",
"{\n\t\t\tfor (int j = 0; j < c; j++) {\n\t\t\t\tint cell = scan.nextInt();\n\t\t\t\tcSum += cell;\n\t\t\t\trSum[j] += cell;\n\t\t\t\tSystem.out.print(cell + \" \");\n\t\t\t}\n\t\t\tgSum += cSum;\n\t\t\tSystem.out.println(cSum);\n\t\t\tcSum = 0;\n\t\t}",
"{\n\t\t\tfor (int j = 0; j < c; j++) {\n\t\t\t\tint cell = scan.nextInt();\n\t\t\t\tcSum += cell;\n\t\t\t\trSum[j] += cell;\n\t\t\t\tSystem.out.print(cell + \" \");\n\t\t\t}\n\t\t\tgSum += cSum;\n\t\t\tSystem.out.println(cSum);\n\t\t\tcSum = 0;\n\t\t}",
"for (int j = 0; j < c; j++) {\n\t\t\t\tint cell = scan.nextInt();\n\t\t\t\tcSum += cell;\n\t\t\t\trSum[j] += cell;\n\t\t\t\tSystem.out.print(cell + \" \");\n\t\t\t}",
"int j = 0;",
"int j = 0;",
"j",
"0",
"j < c",
"j",
"c",
"j++",
"j++",
"j",
"{\n\t\t\t\tint cell = scan.nextInt();\n\t\t\t\tcSum += cell;\n\t\t\t\trSum[j] += cell;\n\t\t\t\tSystem.out.print(cell + \" \");\n\t\t\t}",
"{\n\t\t\t\tint cell = scan.nextInt();\n\t\t\t\tcSum += cell;\n\t\t\t\trSum[j] += cell;\n\t\t\t\tSystem.out.print(cell + \" \");\n\t\t\t}",
"int cell = scan.nextInt();",
"cell",
"scan.nextInt()",
"scan.nextInt",
"scan",
"cSum += cell",
"cSum",
"cell",
"rSum[j] += cell",
"rSum[j]",
"rSum",
"j",
"cell",
"System.out.print(cell + \" \")",
"System.out.print",
"System.out",
"System",
"System.out",
"cell + \" \"",
"cell",
"\" \"",
"gSum += cSum",
"gSum",
"cSum",
"System.out.println(cSum)",
"System.out.println",
"System.out",
"System",
"System.out",
"cSum",
"cSum = 0",
"cSum",
"0",
"for (int i = 0; i < c; i++)\n\t\t\tSystem.out.print(rSum[i] + \" \");",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < c",
"i",
"c",
"i++",
"i++",
"i",
"System.out.print(rSum[i] + \" \");",
"System.out.print(rSum[i] + \" \")",
"System.out.print",
"System.out",
"System",
"System.out",
"rSum[i] + \" \"",
"rSum[i]",
"rSum",
"i",
"\" \"",
"System.out.println(gSum)",
"System.out.println",
"System.out",
"System",
"System.out",
"gSum",
"System.exit(0)",
"System.exit",
"System",
"0",
"String[] args",
"args",
"private static int run(int n, int x) {\n\t\tint result = 0;\n\t\tfor (int a = 1; a <= n; a++)\n\t\t\tfor (int b = a + 1; b <= n; b++)\n\t\t\t\tfor (int c = b + 1; c <= n; c++)\n\t\t\t\t\tif (a + b + c == x)\n\t\t\t\t\t\t++result;\n\t\treturn (result);\n\n\t}",
"run",
"{\n\t\tint result = 0;\n\t\tfor (int a = 1; a <= n; a++)\n\t\t\tfor (int b = a + 1; b <= n; b++)\n\t\t\t\tfor (int c = b + 1; c <= n; c++)\n\t\t\t\t\tif (a + b + c == x)\n\t\t\t\t\t\t++result;\n\t\treturn (result);\n\n\t}",
"int result = 0;",
"result",
"0",
"for (int a = 1; a <= n; a++)\n\t\t\tfor (int b = a + 1; b <= n; b++)\n\t\t\t\tfor (int c = b + 1; c <= n; c++)\n\t\t\t\t\tif (a + b + c == x)\n\t\t\t\t\t\t++result;",
"int a = 1;",
"int a = 1;",
"a",
"1",
"a <= n",
"a",
"n",
"a++",
"a++",
"a",
"for (int b = a + 1; b <= n; b++)\n\t\t\t\tfor (int c = b + 1; c <= n; c++)\n\t\t\t\t\tif (a + b + c == x)\n\t\t\t\t\t\t++result;",
"for (int b = a + 1; b <= n; b++)\n\t\t\t\tfor (int c = b + 1; c <= n; c++)\n\t\t\t\t\tif (a + b + c == x)\n\t\t\t\t\t\t++result;",
"int b = a + 1;",
"int b = a + 1;",
"b",
"a + 1",
"a",
"1",
"b <= n",
"b",
"n",
"b++",
"b++",
"b",
"for (int c = b + 1; c <= n; c++)\n\t\t\t\t\tif (a + b + c == x)\n\t\t\t\t\t\t++result;",
"for (int c = b + 1; c <= n; c++)\n\t\t\t\t\tif (a + b + c == x)\n\t\t\t\t\t\t++result;",
"int c = b + 1;",
"int c = b + 1;",
"c",
"b + 1",
"b",
"1",
"c <= n",
"c",
"n",
"c++",
"c++",
"c",
"if (a + b + c == x)\n\t\t\t\t\t\t++result;",
"if (a + b + c == x)\n\t\t\t\t\t\t++result;",
"a + b + c == x",
"a + b + c",
"a + b + c",
"a",
"b",
"c",
"x",
"++result",
"result",
"return (result);",
"(result)",
"int n",
"n",
"int x",
"x",
"public class Main {\n\n\tpublic static void main(String[] args) {\n\t\t@SuppressWarnings(\"resource\")\n\t\tScanner scan = new Scanner(System.in);\n\t\tint r = scan.nextInt();\n\t\tint c = scan.nextInt();\n\n\t\tint[] rSum = new int[c];\n\t\tint cSum = 0, gSum = 0;\n\t\tfor (int i = 0; i < r; i++) {\n\t\t\tfor (int j = 0; j < c; j++) {\n\t\t\t\tint cell = scan.nextInt();\n\t\t\t\tcSum += cell;\n\t\t\t\trSum[j] += cell;\n\t\t\t\tSystem.out.print(cell + \" \");\n\t\t\t}\n\t\t\tgSum += cSum;\n\t\t\tSystem.out.println(cSum);\n\t\t\tcSum = 0;\n\t\t}\n\t\tfor (int i = 0; i < c; i++)\n\t\t\tSystem.out.print(rSum[i] + \" \");\n\t\tSystem.out.println(gSum);\n\n\t\tSystem.exit(0);\n\t}\n\n\tprivate static int run(int n, int x) {\n\t\tint result = 0;\n\t\tfor (int a = 1; a <= n; a++)\n\t\t\tfor (int b = a + 1; b <= n; b++)\n\t\t\t\tfor (int c = b + 1; c <= n; c++)\n\t\t\t\t\tif (a + b + c == x)\n\t\t\t\t\t\t++result;\n\t\treturn (result);\n\n\t}\n}",
"public class Main {\n\n\tpublic static void main(String[] args) {\n\t\t@SuppressWarnings(\"resource\")\n\t\tScanner scan = new Scanner(System.in);\n\t\tint r = scan.nextInt();\n\t\tint c = scan.nextInt();\n\n\t\tint[] rSum = new int[c];\n\t\tint cSum = 0, gSum = 0;\n\t\tfor (int i = 0; i < r; i++) {\n\t\t\tfor (int j = 0; j < c; j++) {\n\t\t\t\tint cell = scan.nextInt();\n\t\t\t\tcSum += cell;\n\t\t\t\trSum[j] += cell;\n\t\t\t\tSystem.out.print(cell + \" \");\n\t\t\t}\n\t\t\tgSum += cSum;\n\t\t\tSystem.out.println(cSum);\n\t\t\tcSum = 0;\n\t\t}\n\t\tfor (int i = 0; i < c; i++)\n\t\t\tSystem.out.print(rSum[i] + \" \");\n\t\tSystem.out.println(gSum);\n\n\t\tSystem.exit(0);\n\t}\n\n\tprivate static int run(int n, int x) {\n\t\tint result = 0;\n\t\tfor (int a = 1; a <= n; a++)\n\t\t\tfor (int b = a + 1; b <= n; b++)\n\t\t\t\tfor (int c = b + 1; c <= n; c++)\n\t\t\t\t\tif (a + b + c == x)\n\t\t\t\t\t\t++result;\n\t\treturn (result);\n\n\t}\n}",
"Main"
] | import java.util.Scanner;
public class Main {
public static void main(String[] args) {
@SuppressWarnings("resource")
Scanner scan = new Scanner(System.in);
int r = scan.nextInt();
int c = scan.nextInt();
int[] rSum = new int[c];
int cSum = 0, gSum = 0;
for (int i = 0; i < r; i++) {
for (int j = 0; j < c; j++) {
int cell = scan.nextInt();
cSum += cell;
rSum[j] += cell;
System.out.print(cell + " ");
}
gSum += cSum;
System.out.println(cSum);
cSum = 0;
}
for (int i = 0; i < c; i++)
System.out.print(rSum[i] + " ");
System.out.println(gSum);
System.exit(0);
}
private static int run(int n, int x) {
int result = 0;
for (int a = 1; a <= n; a++)
for (int b = a + 1; b <= n; b++)
for (int c = b + 1; c <= n; c++)
if (a + b + c == x)
++result;
return (result);
}
} |
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
17,
41,
13,
20,
17,
0,
18,
13,
17,
4,
18,
13,
18,
13,
17,
0,
18,
13,
17,
4,
18,
13,
18,
13,
17,
41,
13,
20,
2,
18,
13,
17,
17,
11,
1,
41,
13,
17,
2,
13,
18,
13,
17,
1,
40,
13,
30,
30,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
17,
41,
13,
20,
18,
13,
17,
11,
1,
41,
13,
17,
2,
13,
18,
13,
13,
1,
40,
13,
30,
30,
0,
18,
13,
13,
4,
18,
13,
18,
13,
13,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
18,
13,
13,
1,
40,
13,
30,
30,
0,
13,
18,
13,
13,
11,
1,
41,
13,
17,
2,
13,
18,
13,
13,
1,
40,
13,
30,
30,
0,
18,
13,
13,
18,
13,
13,
4,
18,
18,
13,
13,
2,
2,
13,
17,
13,
0,
18,
13,
18,
13,
17,
13,
11,
1,
41,
13,
17,
2,
13,
2,
18,
13,
13,
17,
1,
40,
13,
30,
30,
4,
18,
18,
13,
13,
2,
18,
13,
13,
17,
4,
18,
18,
13,
13,
18,
13,
18,
13,
17,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
214,
5
],
[
214,
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
],
[
19,
20
],
[
20,
21
],
[
19,
22
],
[
8,
23
],
[
23,
24
],
[
23,
25
],
[
8,
27
],
[
27,
28
],
[
28,
29
],
[
28,
30
],
[
27,
31
],
[
31,
32
],
[
32,
33
],
[
31,
34
],
[
34,
35
],
[
34,
36
],
[
8,
37
],
[
37,
38
],
[
38,
39
],
[
38,
40
],
[
37,
41
],
[
41,
42
],
[
42,
43
],
[
41,
44
],
[
44,
45
],
[
44,
46
],
[
8,
47
],
[
47,
48
],
[
47,
49
],
[
50,
51
],
[
51,
52
],
[
51,
53
],
[
50,
54
],
[
8,
55
],
[
55,
56
],
[
56,
57
],
[
57,
58
],
[
57,
59
],
[
55,
60
],
[
60,
61
],
[
60,
62
],
[
62,
63
],
[
62,
64
],
[
55,
65
],
[
65,
66
],
[
66,
67
],
[
55,
68
],
[
69,
69
],
[
69,
70
],
[
70,
71
],
[
70,
72
],
[
72,
73
],
[
73,
74
],
[
69,
75
],
[
75,
76
],
[
75,
77
],
[
77,
78
],
[
78,
79
],
[
77,
80
],
[
69,
81
],
[
81,
82
],
[
81,
83
],
[
84,
85
],
[
84,
86
],
[
69,
87
],
[
87,
88
],
[
88,
89
],
[
89,
90
],
[
89,
91
],
[
87,
92
],
[
92,
93
],
[
92,
94
],
[
94,
95
],
[
94,
96
],
[
87,
97
],
[
97,
98
],
[
98,
99
],
[
87,
100
],
[
101,
101
],
[
101,
102
],
[
102,
103
],
[
103,
104
],
[
103,
105
],
[
102,
106
],
[
106,
107
],
[
107,
108
],
[
106,
109
],
[
109,
110
],
[
109,
111
],
[
69,
112
],
[
112,
113
],
[
112,
114
],
[
69,
115
],
[
115,
116
],
[
116,
117
],
[
117,
118
],
[
117,
119
],
[
115,
120
],
[
120,
121
],
[
120,
122
],
[
122,
123
],
[
122,
124
],
[
115,
125
],
[
125,
126
],
[
126,
127
],
[
115,
128
],
[
129,
129
],
[
129,
130
],
[
130,
131
],
[
130,
132
],
[
132,
133
],
[
132,
134
],
[
69,
135
],
[
135,
136
],
[
136,
137
],
[
137,
138
],
[
137,
139
],
[
135,
140
],
[
140,
141
],
[
140,
142
],
[
142,
143
],
[
142,
144
],
[
135,
145
],
[
145,
146
],
[
146,
147
],
[
135,
148
],
[
149,
149
],
[
149,
150
],
[
150,
151
],
[
151,
152
],
[
151,
153
],
[
150,
154
],
[
154,
155
],
[
154,
156
],
[
69,
157
],
[
157,
158
],
[
158,
159
],
[
159,
160
],
[
159,
161
],
[
157,
162
],
[
163,
163
],
[
163,
164
],
[
163,
165
],
[
163,
166
],
[
69,
167
],
[
167,
168
],
[
168,
169
],
[
168,
170
],
[
170,
171
],
[
170,
172
],
[
167,
173
],
[
8,
174
],
[
174,
175
],
[
175,
176
],
[
176,
177
],
[
176,
178
],
[
174,
179
],
[
179,
180
],
[
179,
181
],
[
181,
182
],
[
182,
183
],
[
182,
184
],
[
181,
185
],
[
174,
186
],
[
186,
187
],
[
187,
188
],
[
174,
189
],
[
190,
190
],
[
190,
191
],
[
191,
192
],
[
192,
193
],
[
193,
194
],
[
193,
195
],
[
191,
196
],
[
196,
197
],
[
197,
198
],
[
197,
199
],
[
196,
200
],
[
8,
201
],
[
201,
202
],
[
202,
203
],
[
203,
204
],
[
203,
205
],
[
201,
206
],
[
206,
207
],
[
206,
208
],
[
208,
209
],
[
208,
210
],
[
6,
211
],
[
211,
212
],
[
0,
213
],
[
213,
214
],
[
213,
215
]
] | [
"import java.util.Scanner;\n\npublic class Main {\n\tpublic static void main(String[] arges) {\n\n\t\tScanner sc = new Scanner(System.in);\n\t\tString line = sc.nextLine();\n\t\tString[] k = line.split(\" \");\n\t\tint[] v = new int[2];\n\t\tv[0] = Integer.parseInt(k[0]);\n\t\tv[1] = Integer.parseInt(k[1]);\n\t\tint[] tatesum = new int[v[1] + 1];\n\t\tfor (int i = 0; i < v[0]; i++) {\n\t\t\tString linek = sc.nextLine();\n\t\t\tString[] suuzi = linek.split(\" \");\n\t\t\tint[] kazu = new int[v[1]];\n\t\t\tfor (int j = 0; j < kazu.length; j++) {\n\t\t\t\tkazu[j] = Integer.parseInt(suuzi[j]);\n\t\t\t}\n\t\t\tint sum = 0;\n\t\t\tfor (int j = 0; j < kazu.length; j++) {\n\t\t\t\tsum += kazu[j];\n\t\t\t}\n\t\t\tfor (int j = 0; j < kazu.length; j++) {\n\t\t\t\ttatesum[j] += kazu[j];\n\t\t\t}\n\t\t\tSystem.out.println(linek + \" \" + sum);\n\t\t\ttatesum[v[1] ] += sum;\n\t\t}\n\t\tfor (int i = 0; i < tatesum.length - 1; i++) {\n\t\t\tSystem.out.print(tatesum[i] + \" \");\n\t\t}\n\t\tSystem.out.println(tatesum[v[1] ]);\n\n\t}\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n\tpublic static void main(String[] arges) {\n\n\t\tScanner sc = new Scanner(System.in);\n\t\tString line = sc.nextLine();\n\t\tString[] k = line.split(\" \");\n\t\tint[] v = new int[2];\n\t\tv[0] = Integer.parseInt(k[0]);\n\t\tv[1] = Integer.parseInt(k[1]);\n\t\tint[] tatesum = new int[v[1] + 1];\n\t\tfor (int i = 0; i < v[0]; i++) {\n\t\t\tString linek = sc.nextLine();\n\t\t\tString[] suuzi = linek.split(\" \");\n\t\t\tint[] kazu = new int[v[1]];\n\t\t\tfor (int j = 0; j < kazu.length; j++) {\n\t\t\t\tkazu[j] = Integer.parseInt(suuzi[j]);\n\t\t\t}\n\t\t\tint sum = 0;\n\t\t\tfor (int j = 0; j < kazu.length; j++) {\n\t\t\t\tsum += kazu[j];\n\t\t\t}\n\t\t\tfor (int j = 0; j < kazu.length; j++) {\n\t\t\t\ttatesum[j] += kazu[j];\n\t\t\t}\n\t\t\tSystem.out.println(linek + \" \" + sum);\n\t\t\ttatesum[v[1] ] += sum;\n\t\t}\n\t\tfor (int i = 0; i < tatesum.length - 1; i++) {\n\t\t\tSystem.out.print(tatesum[i] + \" \");\n\t\t}\n\t\tSystem.out.println(tatesum[v[1] ]);\n\n\t}\n}",
"Main",
"public static void main(String[] arges) {\n\n\t\tScanner sc = new Scanner(System.in);\n\t\tString line = sc.nextLine();\n\t\tString[] k = line.split(\" \");\n\t\tint[] v = new int[2];\n\t\tv[0] = Integer.parseInt(k[0]);\n\t\tv[1] = Integer.parseInt(k[1]);\n\t\tint[] tatesum = new int[v[1] + 1];\n\t\tfor (int i = 0; i < v[0]; i++) {\n\t\t\tString linek = sc.nextLine();\n\t\t\tString[] suuzi = linek.split(\" \");\n\t\t\tint[] kazu = new int[v[1]];\n\t\t\tfor (int j = 0; j < kazu.length; j++) {\n\t\t\t\tkazu[j] = Integer.parseInt(suuzi[j]);\n\t\t\t}\n\t\t\tint sum = 0;\n\t\t\tfor (int j = 0; j < kazu.length; j++) {\n\t\t\t\tsum += kazu[j];\n\t\t\t}\n\t\t\tfor (int j = 0; j < kazu.length; j++) {\n\t\t\t\ttatesum[j] += kazu[j];\n\t\t\t}\n\t\t\tSystem.out.println(linek + \" \" + sum);\n\t\t\ttatesum[v[1] ] += sum;\n\t\t}\n\t\tfor (int i = 0; i < tatesum.length - 1; i++) {\n\t\t\tSystem.out.print(tatesum[i] + \" \");\n\t\t}\n\t\tSystem.out.println(tatesum[v[1] ]);\n\n\t}",
"main",
"{\n\n\t\tScanner sc = new Scanner(System.in);\n\t\tString line = sc.nextLine();\n\t\tString[] k = line.split(\" \");\n\t\tint[] v = new int[2];\n\t\tv[0] = Integer.parseInt(k[0]);\n\t\tv[1] = Integer.parseInt(k[1]);\n\t\tint[] tatesum = new int[v[1] + 1];\n\t\tfor (int i = 0; i < v[0]; i++) {\n\t\t\tString linek = sc.nextLine();\n\t\t\tString[] suuzi = linek.split(\" \");\n\t\t\tint[] kazu = new int[v[1]];\n\t\t\tfor (int j = 0; j < kazu.length; j++) {\n\t\t\t\tkazu[j] = Integer.parseInt(suuzi[j]);\n\t\t\t}\n\t\t\tint sum = 0;\n\t\t\tfor (int j = 0; j < kazu.length; j++) {\n\t\t\t\tsum += kazu[j];\n\t\t\t}\n\t\t\tfor (int j = 0; j < kazu.length; j++) {\n\t\t\t\ttatesum[j] += kazu[j];\n\t\t\t}\n\t\t\tSystem.out.println(linek + \" \" + sum);\n\t\t\ttatesum[v[1] ] += sum;\n\t\t}\n\t\tfor (int i = 0; i < tatesum.length - 1; i++) {\n\t\t\tSystem.out.print(tatesum[i] + \" \");\n\t\t}\n\t\tSystem.out.println(tatesum[v[1] ]);\n\n\t}",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"String line = sc.nextLine();",
"line",
"sc.nextLine()",
"sc.nextLine",
"sc",
"String[] k = line.split(\" \");",
"k",
"line.split(\" \")",
"line.split",
"line",
"\" \"",
"int[] v = new int[2];",
"v",
"new int[2]",
"2",
"v[0] = Integer.parseInt(k[0])",
"v[0]",
"v",
"0",
"Integer.parseInt(k[0])",
"Integer.parseInt",
"Integer",
"k[0]",
"k",
"0",
"v[1] = Integer.parseInt(k[1])",
"v[1]",
"v",
"1",
"Integer.parseInt(k[1])",
"Integer.parseInt",
"Integer",
"k[1]",
"k",
"1",
"int[] tatesum = new int[v[1] + 1];",
"tatesum",
"new int[v[1] + 1]",
"v[1] + 1",
"v[1]",
"v",
"1",
"1",
"for (int i = 0; i < v[0]; i++) {\n\t\t\tString linek = sc.nextLine();\n\t\t\tString[] suuzi = linek.split(\" \");\n\t\t\tint[] kazu = new int[v[1]];\n\t\t\tfor (int j = 0; j < kazu.length; j++) {\n\t\t\t\tkazu[j] = Integer.parseInt(suuzi[j]);\n\t\t\t}\n\t\t\tint sum = 0;\n\t\t\tfor (int j = 0; j < kazu.length; j++) {\n\t\t\t\tsum += kazu[j];\n\t\t\t}\n\t\t\tfor (int j = 0; j < kazu.length; j++) {\n\t\t\t\ttatesum[j] += kazu[j];\n\t\t\t}\n\t\t\tSystem.out.println(linek + \" \" + sum);\n\t\t\ttatesum[v[1] ] += sum;\n\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < v[0]",
"i",
"v[0]",
"v",
"0",
"i++",
"i++",
"i",
"{\n\t\t\tString linek = sc.nextLine();\n\t\t\tString[] suuzi = linek.split(\" \");\n\t\t\tint[] kazu = new int[v[1]];\n\t\t\tfor (int j = 0; j < kazu.length; j++) {\n\t\t\t\tkazu[j] = Integer.parseInt(suuzi[j]);\n\t\t\t}\n\t\t\tint sum = 0;\n\t\t\tfor (int j = 0; j < kazu.length; j++) {\n\t\t\t\tsum += kazu[j];\n\t\t\t}\n\t\t\tfor (int j = 0; j < kazu.length; j++) {\n\t\t\t\ttatesum[j] += kazu[j];\n\t\t\t}\n\t\t\tSystem.out.println(linek + \" \" + sum);\n\t\t\ttatesum[v[1] ] += sum;\n\t\t}",
"{\n\t\t\tString linek = sc.nextLine();\n\t\t\tString[] suuzi = linek.split(\" \");\n\t\t\tint[] kazu = new int[v[1]];\n\t\t\tfor (int j = 0; j < kazu.length; j++) {\n\t\t\t\tkazu[j] = Integer.parseInt(suuzi[j]);\n\t\t\t}\n\t\t\tint sum = 0;\n\t\t\tfor (int j = 0; j < kazu.length; j++) {\n\t\t\t\tsum += kazu[j];\n\t\t\t}\n\t\t\tfor (int j = 0; j < kazu.length; j++) {\n\t\t\t\ttatesum[j] += kazu[j];\n\t\t\t}\n\t\t\tSystem.out.println(linek + \" \" + sum);\n\t\t\ttatesum[v[1] ] += sum;\n\t\t}",
"String linek = sc.nextLine();",
"linek",
"sc.nextLine()",
"sc.nextLine",
"sc",
"String[] suuzi = linek.split(\" \");",
"suuzi",
"linek.split(\" \")",
"linek.split",
"linek",
"\" \"",
"int[] kazu = new int[v[1]];",
"kazu",
"new int[v[1]]",
"v[1]",
"v",
"1",
"for (int j = 0; j < kazu.length; j++) {\n\t\t\t\tkazu[j] = Integer.parseInt(suuzi[j]);\n\t\t\t}",
"int j = 0;",
"int j = 0;",
"j",
"0",
"j < kazu.length",
"j",
"kazu.length",
"kazu",
"kazu.length",
"j++",
"j++",
"j",
"{\n\t\t\t\tkazu[j] = Integer.parseInt(suuzi[j]);\n\t\t\t}",
"{\n\t\t\t\tkazu[j] = Integer.parseInt(suuzi[j]);\n\t\t\t}",
"kazu[j] = Integer.parseInt(suuzi[j])",
"kazu[j]",
"kazu",
"j",
"Integer.parseInt(suuzi[j])",
"Integer.parseInt",
"Integer",
"suuzi[j]",
"suuzi",
"j",
"int sum = 0;",
"sum",
"0",
"for (int j = 0; j < kazu.length; j++) {\n\t\t\t\tsum += kazu[j];\n\t\t\t}",
"int j = 0;",
"int j = 0;",
"j",
"0",
"j < kazu.length",
"j",
"kazu.length",
"kazu",
"kazu.length",
"j++",
"j++",
"j",
"{\n\t\t\t\tsum += kazu[j];\n\t\t\t}",
"{\n\t\t\t\tsum += kazu[j];\n\t\t\t}",
"sum += kazu[j]",
"sum",
"kazu[j]",
"kazu",
"j",
"for (int j = 0; j < kazu.length; j++) {\n\t\t\t\ttatesum[j] += kazu[j];\n\t\t\t}",
"int j = 0;",
"int j = 0;",
"j",
"0",
"j < kazu.length",
"j",
"kazu.length",
"kazu",
"kazu.length",
"j++",
"j++",
"j",
"{\n\t\t\t\ttatesum[j] += kazu[j];\n\t\t\t}",
"{\n\t\t\t\ttatesum[j] += kazu[j];\n\t\t\t}",
"tatesum[j] += kazu[j]",
"tatesum[j]",
"tatesum",
"j",
"kazu[j]",
"kazu",
"j",
"System.out.println(linek + \" \" + sum)",
"System.out.println",
"System.out",
"System",
"System.out",
"linek + \" \" + sum",
"linek + \" \" + sum",
"linek",
"\" \"",
"sum",
"tatesum[v[1] ] += sum",
"tatesum[v[1] ]",
"tatesum",
"v[1]",
"v",
"1",
"sum",
"for (int i = 0; i < tatesum.length - 1; i++) {\n\t\t\tSystem.out.print(tatesum[i] + \" \");\n\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < tatesum.length - 1",
"i",
"tatesum.length - 1",
"tatesum.length",
"tatesum",
"tatesum.length",
"1",
"i++",
"i++",
"i",
"{\n\t\t\tSystem.out.print(tatesum[i] + \" \");\n\t\t}",
"{\n\t\t\tSystem.out.print(tatesum[i] + \" \");\n\t\t}",
"System.out.print(tatesum[i] + \" \")",
"System.out.print",
"System.out",
"System",
"System.out",
"tatesum[i] + \" \"",
"tatesum[i]",
"tatesum",
"i",
"\" \"",
"System.out.println(tatesum[v[1] ])",
"System.out.println",
"System.out",
"System",
"System.out",
"tatesum[v[1] ]",
"tatesum",
"v[1]",
"v",
"1",
"String[] arges",
"arges",
"public class Main {\n\tpublic static void main(String[] arges) {\n\n\t\tScanner sc = new Scanner(System.in);\n\t\tString line = sc.nextLine();\n\t\tString[] k = line.split(\" \");\n\t\tint[] v = new int[2];\n\t\tv[0] = Integer.parseInt(k[0]);\n\t\tv[1] = Integer.parseInt(k[1]);\n\t\tint[] tatesum = new int[v[1] + 1];\n\t\tfor (int i = 0; i < v[0]; i++) {\n\t\t\tString linek = sc.nextLine();\n\t\t\tString[] suuzi = linek.split(\" \");\n\t\t\tint[] kazu = new int[v[1]];\n\t\t\tfor (int j = 0; j < kazu.length; j++) {\n\t\t\t\tkazu[j] = Integer.parseInt(suuzi[j]);\n\t\t\t}\n\t\t\tint sum = 0;\n\t\t\tfor (int j = 0; j < kazu.length; j++) {\n\t\t\t\tsum += kazu[j];\n\t\t\t}\n\t\t\tfor (int j = 0; j < kazu.length; j++) {\n\t\t\t\ttatesum[j] += kazu[j];\n\t\t\t}\n\t\t\tSystem.out.println(linek + \" \" + sum);\n\t\t\ttatesum[v[1] ] += sum;\n\t\t}\n\t\tfor (int i = 0; i < tatesum.length - 1; i++) {\n\t\t\tSystem.out.print(tatesum[i] + \" \");\n\t\t}\n\t\tSystem.out.println(tatesum[v[1] ]);\n\n\t}\n}",
"public class Main {\n\tpublic static void main(String[] arges) {\n\n\t\tScanner sc = new Scanner(System.in);\n\t\tString line = sc.nextLine();\n\t\tString[] k = line.split(\" \");\n\t\tint[] v = new int[2];\n\t\tv[0] = Integer.parseInt(k[0]);\n\t\tv[1] = Integer.parseInt(k[1]);\n\t\tint[] tatesum = new int[v[1] + 1];\n\t\tfor (int i = 0; i < v[0]; i++) {\n\t\t\tString linek = sc.nextLine();\n\t\t\tString[] suuzi = linek.split(\" \");\n\t\t\tint[] kazu = new int[v[1]];\n\t\t\tfor (int j = 0; j < kazu.length; j++) {\n\t\t\t\tkazu[j] = Integer.parseInt(suuzi[j]);\n\t\t\t}\n\t\t\tint sum = 0;\n\t\t\tfor (int j = 0; j < kazu.length; j++) {\n\t\t\t\tsum += kazu[j];\n\t\t\t}\n\t\t\tfor (int j = 0; j < kazu.length; j++) {\n\t\t\t\ttatesum[j] += kazu[j];\n\t\t\t}\n\t\t\tSystem.out.println(linek + \" \" + sum);\n\t\t\ttatesum[v[1] ] += sum;\n\t\t}\n\t\tfor (int i = 0; i < tatesum.length - 1; i++) {\n\t\t\tSystem.out.print(tatesum[i] + \" \");\n\t\t}\n\t\tSystem.out.println(tatesum[v[1] ]);\n\n\t}\n}",
"Main"
] | import java.util.Scanner;
public class Main {
public static void main(String[] arges) {
Scanner sc = new Scanner(System.in);
String line = sc.nextLine();
String[] k = line.split(" ");
int[] v = new int[2];
v[0] = Integer.parseInt(k[0]);
v[1] = Integer.parseInt(k[1]);
int[] tatesum = new int[v[1] + 1];
for (int i = 0; i < v[0]; i++) {
String linek = sc.nextLine();
String[] suuzi = linek.split(" ");
int[] kazu = new int[v[1]];
for (int j = 0; j < kazu.length; j++) {
kazu[j] = Integer.parseInt(suuzi[j]);
}
int sum = 0;
for (int j = 0; j < kazu.length; j++) {
sum += kazu[j];
}
for (int j = 0; j < kazu.length; j++) {
tatesum[j] += kazu[j];
}
System.out.println(linek + " " + sum);
tatesum[v[1] ] += sum;
}
for (int i = 0; i < tatesum.length - 1; i++) {
System.out.print(tatesum[i] + " ");
}
System.out.println(tatesum[v[1] ]);
}
} |
[
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,
4,
18,
13,
13,
41,
13,
20,
18,
13,
17,
41,
13,
4,
18,
13,
13,
18,
13,
17,
11,
1,
41,
13,
17,
2,
13,
18,
13,
17,
1,
40,
13,
30,
30,
41,
13,
4,
18,
13,
4,
18,
13,
13,
4,
13,
13,
13,
4,
18,
18,
13,
13,
2,
2,
4,
18,
13,
13,
17,
4,
13,
13,
4,
18,
18,
13,
13,
2,
4,
13,
13,
4,
13,
13,
23,
13,
12,
13,
30,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
18,
13,
13,
1,
40,
13,
30,
0,
13,
18,
13,
13,
29,
13,
23,
13,
12,
13,
30,
11,
1,
41,
13,
17,
2,
13,
18,
13,
13,
1,
40,
13,
30,
0,
18,
13,
13,
18,
13,
13,
23,
13,
23,
13,
12,
13,
30,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
18,
13,
13,
1,
40,
13,
30,
0,
13,
2,
2,
13,
4,
18,
13,
18,
13,
13,
17,
29,
13,
23,
13,
6,
13,
12,
13,
30,
41,
13,
20,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
4,
18,
13,
4,
18,
13,
29,
13,
23,
13,
23,
13,
12,
13,
30,
29,
4,
18,
13,
23,
13,
12,
13,
30,
41,
13,
4,
18,
13,
17,
41,
13,
20,
18,
13,
13,
11,
1,
41,
13,
17,
2,
13,
18,
13,
13,
1,
40,
13,
30,
30,
0,
18,
13,
13,
4,
18,
13,
18,
13,
13,
29,
13,
23,
13,
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
],
[
281,
14
],
[
281,
15
],
[
15,
16
],
[
15,
17
],
[
17,
18
],
[
18,
19
],
[
18,
20
],
[
17,
21
],
[
21,
22
],
[
21,
23
],
[
23,
24
],
[
24,
25
],
[
23,
26
],
[
26,
27
],
[
27,
28
],
[
26,
29
],
[
17,
30
],
[
30,
31
],
[
30,
32
],
[
33,
34
],
[
33,
35
],
[
17,
36
],
[
36,
37
],
[
36,
38
],
[
38,
39
],
[
39,
40
],
[
38,
41
],
[
38,
42
],
[
42,
43
],
[
42,
44
],
[
17,
45
],
[
45,
46
],
[
46,
47
],
[
47,
48
],
[
47,
49
],
[
45,
50
],
[
50,
51
],
[
50,
52
],
[
52,
53
],
[
52,
54
],
[
45,
55
],
[
55,
56
],
[
56,
57
],
[
45,
58
],
[
59,
59
],
[
59,
60
],
[
60,
61
],
[
60,
62
],
[
62,
63
],
[
63,
64
],
[
62,
65
],
[
65,
66
],
[
66,
67
],
[
65,
68
],
[
59,
69
],
[
69,
70
],
[
69,
71
],
[
69,
72
],
[
59,
73
],
[
73,
74
],
[
74,
75
],
[
75,
76
],
[
75,
77
],
[
73,
78
],
[
79,
79
],
[
79,
80
],
[
80,
81
],
[
81,
82
],
[
80,
83
],
[
79,
84
],
[
79,
85
],
[
85,
86
],
[
85,
87
],
[
17,
88
],
[
88,
89
],
[
89,
90
],
[
90,
91
],
[
90,
92
],
[
88,
93
],
[
93,
94
],
[
94,
95
],
[
94,
96
],
[
93,
97
],
[
97,
98
],
[
97,
99
],
[
15,
100
],
[
100,
101
],
[
281,
102
],
[
102,
103
],
[
102,
104
],
[
104,
105
],
[
105,
106
],
[
105,
107
],
[
104,
108
],
[
108,
109
],
[
109,
110
],
[
110,
111
],
[
110,
112
],
[
108,
113
],
[
113,
114
],
[
113,
115
],
[
115,
116
],
[
115,
117
],
[
108,
118
],
[
118,
119
],
[
119,
120
],
[
108,
121
],
[
121,
122
],
[
122,
123
],
[
122,
124
],
[
124,
125
],
[
124,
126
],
[
104,
127
],
[
127,
128
],
[
102,
129
],
[
129,
130
],
[
281,
131
],
[
131,
132
],
[
131,
133
],
[
133,
134
],
[
134,
135
],
[
135,
136
],
[
136,
137
],
[
136,
138
],
[
134,
139
],
[
139,
140
],
[
139,
141
],
[
141,
142
],
[
141,
143
],
[
134,
144
],
[
144,
145
],
[
145,
146
],
[
134,
147
],
[
147,
148
],
[
148,
149
],
[
149,
150
],
[
149,
151
],
[
148,
152
],
[
152,
153
],
[
152,
154
],
[
131,
155
],
[
155,
156
],
[
131,
157
],
[
157,
158
],
[
281,
159
],
[
159,
160
],
[
159,
161
],
[
161,
162
],
[
162,
163
],
[
162,
164
],
[
161,
165
],
[
165,
166
],
[
166,
167
],
[
167,
168
],
[
167,
169
],
[
165,
170
],
[
170,
171
],
[
170,
172
],
[
172,
173
],
[
172,
174
],
[
165,
175
],
[
175,
176
],
[
176,
177
],
[
165,
178
],
[
178,
179
],
[
179,
180
],
[
179,
181
],
[
182,
182
],
[
182,
183
],
[
182,
184
],
[
184,
185
],
[
185,
186
],
[
184,
187
],
[
187,
188
],
[
187,
189
],
[
182,
190
],
[
161,
191
],
[
191,
192
],
[
159,
193
],
[
193,
194
],
[
0,
195
],
[
195,
196
],
[
195,
197
],
[
197,
198
],
[
197,
199
],
[
199,
200
],
[
200,
201
],
[
200,
202
],
[
199,
203
],
[
203,
204
],
[
204,
205
],
[
205,
206
],
[
205,
207
],
[
203,
208
],
[
208,
209
],
[
208,
210
],
[
203,
211
],
[
211,
212
],
[
212,
213
],
[
203,
214
],
[
214,
215
],
[
215,
216
],
[
216,
217
],
[
215,
218
],
[
218,
219
],
[
219,
220
],
[
199,
221
],
[
221,
222
],
[
197,
223
],
[
223,
224
],
[
197,
225
],
[
225,
226
],
[
195,
227
],
[
227,
228
],
[
227,
229
],
[
229,
230
],
[
230,
231
],
[
231,
232
],
[
232,
233
],
[
227,
234
],
[
234,
235
],
[
195,
236
],
[
236,
237
],
[
236,
238
],
[
238,
239
],
[
239,
240
],
[
239,
241
],
[
241,
242
],
[
242,
243
],
[
241,
244
],
[
238,
245
],
[
245,
246
],
[
245,
247
],
[
248,
249
],
[
248,
250
],
[
238,
251
],
[
251,
252
],
[
252,
253
],
[
253,
254
],
[
253,
255
],
[
251,
256
],
[
256,
257
],
[
256,
258
],
[
258,
259
],
[
258,
260
],
[
251,
261
],
[
261,
262
],
[
262,
263
],
[
251,
264
],
[
265,
265
],
[
265,
266
],
[
266,
267
],
[
267,
268
],
[
267,
269
],
[
266,
270
],
[
270,
271
],
[
271,
272
],
[
270,
273
],
[
273,
274
],
[
273,
275
],
[
238,
276
],
[
276,
277
],
[
236,
278
],
[
278,
279
],
[
0,
280
],
[
280,
281
],
[
280,
282
]
] | [
"import java.util.ArrayList;\nimport java.io.InputStreamReader;\nimport java.io.IOException;\nimport java.io.BufferedReader;\n\npublic final class Main {\n\n\tpublic static void main(String[] args) \n\tthrows IOException {\n\t\t// TODO Auto-generated method stub\n\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\t\tint[] arraysize = TempReaderCall.splitIntArrayFromString(TempReaderCall.getStdInRead(br));\n\t\t\n\t\tint[] ctotal = new int[arraysize[1]];\n\t\tArrayList<String> list = TempReaderCall.getStdInReadlines(br, arraysize[0]);\n\t\t\n\t\tfor (int i=0; i<arraysize[0]; i++){\n\t\t\tint[] rowdata = TempReaderCall.splitIntArrayFromString(list.get(i));\n\t\t\taddColumnData(ctotal, rowdata);\n\t\t\tSystem.out.println(list.get(i) + \" \" + sum(rowdata));\n\t\t}\n\t\t\n\t\tSystem.out.println(printRow(ctotal) + sum(ctotal));\n\t\t\n\t}\n\t\n\tstatic int sum (int[] data){\n\t\tint total = 0;\n\t\tfor(int i=0; i < data.length; i++)\n\t\t\ttotal += data[i];\n\t\t\n\t\treturn total;\n\t}\n\t\n\tstatic void addColumnData(int[] ctotal, int[] rowdata){\n\t\tfor(int i=0; i<ctotal.length; i++)\n\t\t\tctotal[i] += rowdata[i];\n\t}\n\t\n\tstatic String printRow(int[] ctotal){\n\t\tString line = \"\";\n\t\tfor(int i=0; i < ctotal.length; i++) \n\t\t\tline = line + Integer.toString(ctotal[i]) + \" \";\n\t\treturn line;\n\t}\n\n}\n\n\nclass TempReaderCall{\n\t\n\tstatic ArrayList<String> getStdInReadlines(BufferedReader br, int line) throws IOException {\n\t\tArrayList<String> list = new ArrayList<String>();\n\t\tfor (int i = 0; i < line; i++)\n\t\t\tlist.add(br.readLine());\n\t\treturn list;\n\t}\n\t\n\tstatic String getStdInRead(BufferedReader br) throws IOException {\n\t\treturn (br.readLine());\n\t}\n\t\n\t\n\tstatic int[] splitIntArrayFromString(String st) {\n\t\tString[] sts = st.split(\" \");\n\t\tint[] data = new int[sts.length];\n\t\t\n\t\tfor (int i=0;i<sts.length;i++){\n\t\t\tdata[i] = Integer.parseInt(sts[i]);\n\t\t}\n\t\t\n\t\treturn data;\n\t}\n}",
"import java.util.ArrayList;",
"ArrayList",
"java.util",
"import java.io.InputStreamReader;",
"InputStreamReader",
"java.io",
"import java.io.IOException;",
"IOException",
"java.io",
"import java.io.BufferedReader;",
"BufferedReader",
"java.io",
"public final class Main {\n\n\tpublic static void main(String[] args) \n\tthrows IOException {\n\t\t// TODO Auto-generated method stub\n\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\t\tint[] arraysize = TempReaderCall.splitIntArrayFromString(TempReaderCall.getStdInRead(br));\n\t\t\n\t\tint[] ctotal = new int[arraysize[1]];\n\t\tArrayList<String> list = TempReaderCall.getStdInReadlines(br, arraysize[0]);\n\t\t\n\t\tfor (int i=0; i<arraysize[0]; i++){\n\t\t\tint[] rowdata = TempReaderCall.splitIntArrayFromString(list.get(i));\n\t\t\taddColumnData(ctotal, rowdata);\n\t\t\tSystem.out.println(list.get(i) + \" \" + sum(rowdata));\n\t\t}\n\t\t\n\t\tSystem.out.println(printRow(ctotal) + sum(ctotal));\n\t\t\n\t}\n\t\n\tstatic int sum (int[] data){\n\t\tint total = 0;\n\t\tfor(int i=0; i < data.length; i++)\n\t\t\ttotal += data[i];\n\t\t\n\t\treturn total;\n\t}\n\t\n\tstatic void addColumnData(int[] ctotal, int[] rowdata){\n\t\tfor(int i=0; i<ctotal.length; i++)\n\t\t\tctotal[i] += rowdata[i];\n\t}\n\t\n\tstatic String printRow(int[] ctotal){\n\t\tString line = \"\";\n\t\tfor(int i=0; i < ctotal.length; i++) \n\t\t\tline = line + Integer.toString(ctotal[i]) + \" \";\n\t\treturn line;\n\t}\n\n}",
"Main",
"public static void main(String[] args) \n\tthrows IOException {\n\t\t// TODO Auto-generated method stub\n\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\t\tint[] arraysize = TempReaderCall.splitIntArrayFromString(TempReaderCall.getStdInRead(br));\n\t\t\n\t\tint[] ctotal = new int[arraysize[1]];\n\t\tArrayList<String> list = TempReaderCall.getStdInReadlines(br, arraysize[0]);\n\t\t\n\t\tfor (int i=0; i<arraysize[0]; i++){\n\t\t\tint[] rowdata = TempReaderCall.splitIntArrayFromString(list.get(i));\n\t\t\taddColumnData(ctotal, rowdata);\n\t\t\tSystem.out.println(list.get(i) + \" \" + sum(rowdata));\n\t\t}\n\t\t\n\t\tSystem.out.println(printRow(ctotal) + sum(ctotal));\n\t\t\n\t}",
"main",
"{\n\t\t// TODO Auto-generated method stub\n\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\t\tint[] arraysize = TempReaderCall.splitIntArrayFromString(TempReaderCall.getStdInRead(br));\n\t\t\n\t\tint[] ctotal = new int[arraysize[1]];\n\t\tArrayList<String> list = TempReaderCall.getStdInReadlines(br, arraysize[0]);\n\t\t\n\t\tfor (int i=0; i<arraysize[0]; i++){\n\t\t\tint[] rowdata = TempReaderCall.splitIntArrayFromString(list.get(i));\n\t\t\taddColumnData(ctotal, rowdata);\n\t\t\tSystem.out.println(list.get(i) + \" \" + sum(rowdata));\n\t\t}\n\t\t\n\t\tSystem.out.println(printRow(ctotal) + sum(ctotal));\n\t\t\n\t}",
"BufferedReader br = new BufferedReader(new InputStreamReader(System.in));",
"br",
"new BufferedReader(new InputStreamReader(System.in))",
"int[] arraysize = TempReaderCall.splitIntArrayFromString(TempReaderCall.getStdInRead(br));",
"arraysize",
"TempReaderCall.splitIntArrayFromString(TempReaderCall.getStdInRead(br))",
"TempReaderCall.splitIntArrayFromString",
"TempReaderCall",
"TempReaderCall.getStdInRead(br)",
"TempReaderCall.getStdInRead",
"TempReaderCall",
"br",
"int[] ctotal = new int[arraysize[1]];",
"ctotal",
"new int[arraysize[1]]",
"arraysize[1]",
"arraysize",
"1",
"ArrayList<String> list = TempReaderCall.getStdInReadlines(br, arraysize[0]);",
"list",
"TempReaderCall.getStdInReadlines(br, arraysize[0])",
"TempReaderCall.getStdInReadlines",
"TempReaderCall",
"br",
"arraysize[0]",
"arraysize",
"0",
"for (int i=0; i<arraysize[0]; i++){\n\t\t\tint[] rowdata = TempReaderCall.splitIntArrayFromString(list.get(i));\n\t\t\taddColumnData(ctotal, rowdata);\n\t\t\tSystem.out.println(list.get(i) + \" \" + sum(rowdata));\n\t\t}",
"int i=0;",
"int i=0;",
"i",
"0",
"i<arraysize[0]",
"i",
"arraysize[0]",
"arraysize",
"0",
"i++",
"i++",
"i",
"{\n\t\t\tint[] rowdata = TempReaderCall.splitIntArrayFromString(list.get(i));\n\t\t\taddColumnData(ctotal, rowdata);\n\t\t\tSystem.out.println(list.get(i) + \" \" + sum(rowdata));\n\t\t}",
"{\n\t\t\tint[] rowdata = TempReaderCall.splitIntArrayFromString(list.get(i));\n\t\t\taddColumnData(ctotal, rowdata);\n\t\t\tSystem.out.println(list.get(i) + \" \" + sum(rowdata));\n\t\t}",
"int[] rowdata = TempReaderCall.splitIntArrayFromString(list.get(i));",
"rowdata",
"TempReaderCall.splitIntArrayFromString(list.get(i))",
"TempReaderCall.splitIntArrayFromString",
"TempReaderCall",
"list.get(i)",
"list.get",
"list",
"i",
"addColumnData(ctotal, rowdata)",
"addColumnData",
"ctotal",
"rowdata",
"System.out.println(list.get(i) + \" \" + sum(rowdata))",
"System.out.println",
"System.out",
"System",
"System.out",
"list.get(i) + \" \" + sum(rowdata)",
"list.get(i) + \" \" + sum(rowdata)",
"list.get(i)",
"list.get",
"list",
"i",
"\" \"",
"sum(rowdata)",
"sum",
"rowdata",
"System.out.println(printRow(ctotal) + sum(ctotal))",
"System.out.println",
"System.out",
"System",
"System.out",
"printRow(ctotal) + sum(ctotal)",
"printRow(ctotal)",
"printRow",
"ctotal",
"sum(ctotal)",
"sum",
"ctotal",
"String[] args",
"args",
"static int sum (int[] data){\n\t\tint total = 0;\n\t\tfor(int i=0; i < data.length; i++)\n\t\t\ttotal += data[i];\n\t\t\n\t\treturn total;\n\t}",
"sum",
"{\n\t\tint total = 0;\n\t\tfor(int i=0; i < data.length; i++)\n\t\t\ttotal += data[i];\n\t\t\n\t\treturn total;\n\t}",
"int total = 0;",
"total",
"0",
"for(int i=0; i < data.length; i++)\n\t\t\ttotal += data[i];",
"int i=0;",
"int i=0;",
"i",
"0",
"i < data.length",
"i",
"data.length",
"data",
"data.length",
"i++",
"i++",
"i",
"total += data[i];",
"total += data[i]",
"total",
"data[i]",
"data",
"i",
"return total;",
"total",
"int[] data",
"data",
"static void addColumnData(int[] ctotal, int[] rowdata){\n\t\tfor(int i=0; i<ctotal.length; i++)\n\t\t\tctotal[i] += rowdata[i];\n\t}",
"addColumnData",
"{\n\t\tfor(int i=0; i<ctotal.length; i++)\n\t\t\tctotal[i] += rowdata[i];\n\t}",
"for(int i=0; i<ctotal.length; i++)\n\t\t\tctotal[i] += rowdata[i];",
"int i=0;",
"int i=0;",
"i",
"0",
"i<ctotal.length",
"i",
"ctotal.length",
"ctotal",
"ctotal.length",
"i++",
"i++",
"i",
"ctotal[i] += rowdata[i];",
"ctotal[i] += rowdata[i]",
"ctotal[i]",
"ctotal",
"i",
"rowdata[i]",
"rowdata",
"i",
"int[] ctotal",
"ctotal",
"int[] rowdata",
"rowdata",
"static String printRow(int[] ctotal){\n\t\tString line = \"\";\n\t\tfor(int i=0; i < ctotal.length; i++) \n\t\t\tline = line + Integer.toString(ctotal[i]) + \" \";\n\t\treturn line;\n\t}",
"printRow",
"{\n\t\tString line = \"\";\n\t\tfor(int i=0; i < ctotal.length; i++) \n\t\t\tline = line + Integer.toString(ctotal[i]) + \" \";\n\t\treturn line;\n\t}",
"String line = \"\";",
"line",
"\"\"",
"for(int i=0; i < ctotal.length; i++) \n\t\t\tline = line + Integer.toString(ctotal[i]) + \" \";",
"int i=0;",
"int i=0;",
"i",
"0",
"i < ctotal.length",
"i",
"ctotal.length",
"ctotal",
"ctotal.length",
"i++",
"i++",
"i",
"line = line + Integer.toString(ctotal[i]) + \" \";",
"line = line + Integer.toString(ctotal[i]) + \" \"",
"line",
"line + Integer.toString(ctotal[i]) + \" \"",
"line + Integer.toString(ctotal[i]) + \" \"",
"line",
"Integer.toString(ctotal[i])",
"Integer.toString",
"Integer",
"ctotal[i]",
"ctotal",
"i",
"\" \"",
"return line;",
"line",
"int[] ctotal",
"ctotal",
"class TempReaderCall{\n\t\n\tstatic ArrayList<String> getStdInReadlines(BufferedReader br, int line) throws IOException {\n\t\tArrayList<String> list = new ArrayList<String>();\n\t\tfor (int i = 0; i < line; i++)\n\t\t\tlist.add(br.readLine());\n\t\treturn list;\n\t}\n\t\n\tstatic String getStdInRead(BufferedReader br) throws IOException {\n\t\treturn (br.readLine());\n\t}\n\t\n\t\n\tstatic int[] splitIntArrayFromString(String st) {\n\t\tString[] sts = st.split(\" \");\n\t\tint[] data = new int[sts.length];\n\t\t\n\t\tfor (int i=0;i<sts.length;i++){\n\t\t\tdata[i] = Integer.parseInt(sts[i]);\n\t\t}\n\t\t\n\t\treturn data;\n\t}\n}",
"TempReaderCall",
"static ArrayList<String> getStdInReadlines(BufferedReader br, int line) throws IOException {\n\t\tArrayList<String> list = new ArrayList<String>();\n\t\tfor (int i = 0; i < line; i++)\n\t\t\tlist.add(br.readLine());\n\t\treturn list;\n\t}",
"getStdInReadlines",
"{\n\t\tArrayList<String> list = new ArrayList<String>();\n\t\tfor (int i = 0; i < line; i++)\n\t\t\tlist.add(br.readLine());\n\t\treturn list;\n\t}",
"ArrayList<String> list = new ArrayList<String>();",
"list",
"new ArrayList<String>()",
"for (int i = 0; i < line; i++)\n\t\t\tlist.add(br.readLine());",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < line",
"i",
"line",
"i++",
"i++",
"i",
"list.add(br.readLine());",
"list.add(br.readLine())",
"list.add",
"list",
"br.readLine()",
"br.readLine",
"br",
"return list;",
"list",
"BufferedReader br",
"br",
"int line",
"line",
"static String getStdInRead(BufferedReader br) throws IOException {\n\t\treturn (br.readLine());\n\t}",
"getStdInRead",
"{\n\t\treturn (br.readLine());\n\t}",
"return (br.readLine());",
"(br.readLine())",
"br.readLine",
"br",
"BufferedReader br",
"br",
"static int[] splitIntArrayFromString(String st) {\n\t\tString[] sts = st.split(\" \");\n\t\tint[] data = new int[sts.length];\n\t\t\n\t\tfor (int i=0;i<sts.length;i++){\n\t\t\tdata[i] = Integer.parseInt(sts[i]);\n\t\t}\n\t\t\n\t\treturn data;\n\t}",
"splitIntArrayFromString",
"{\n\t\tString[] sts = st.split(\" \");\n\t\tint[] data = new int[sts.length];\n\t\t\n\t\tfor (int i=0;i<sts.length;i++){\n\t\t\tdata[i] = Integer.parseInt(sts[i]);\n\t\t}\n\t\t\n\t\treturn data;\n\t}",
"String[] sts = st.split(\" \");",
"sts",
"st.split(\" \")",
"st.split",
"st",
"\" \"",
"int[] data = new int[sts.length];",
"data",
"new int[sts.length]",
"sts.length",
"sts",
"sts.length",
"for (int i=0;i<sts.length;i++){\n\t\t\tdata[i] = Integer.parseInt(sts[i]);\n\t\t}",
"int i=0;",
"int i=0;",
"i",
"0",
"i<sts.length",
"i",
"sts.length",
"sts",
"sts.length",
"i++",
"i++",
"i",
"{\n\t\t\tdata[i] = Integer.parseInt(sts[i]);\n\t\t}",
"{\n\t\t\tdata[i] = Integer.parseInt(sts[i]);\n\t\t}",
"data[i] = Integer.parseInt(sts[i])",
"data[i]",
"data",
"i",
"Integer.parseInt(sts[i])",
"Integer.parseInt",
"Integer",
"sts[i]",
"sts",
"i",
"return data;",
"data",
"String st",
"st",
"public final class Main {\n\n\tpublic static void main(String[] args) \n\tthrows IOException {\n\t\t// TODO Auto-generated method stub\n\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\t\tint[] arraysize = TempReaderCall.splitIntArrayFromString(TempReaderCall.getStdInRead(br));\n\t\t\n\t\tint[] ctotal = new int[arraysize[1]];\n\t\tArrayList<String> list = TempReaderCall.getStdInReadlines(br, arraysize[0]);\n\t\t\n\t\tfor (int i=0; i<arraysize[0]; i++){\n\t\t\tint[] rowdata = TempReaderCall.splitIntArrayFromString(list.get(i));\n\t\t\taddColumnData(ctotal, rowdata);\n\t\t\tSystem.out.println(list.get(i) + \" \" + sum(rowdata));\n\t\t}\n\t\t\n\t\tSystem.out.println(printRow(ctotal) + sum(ctotal));\n\t\t\n\t}\n\t\n\tstatic int sum (int[] data){\n\t\tint total = 0;\n\t\tfor(int i=0; i < data.length; i++)\n\t\t\ttotal += data[i];\n\t\t\n\t\treturn total;\n\t}\n\t\n\tstatic void addColumnData(int[] ctotal, int[] rowdata){\n\t\tfor(int i=0; i<ctotal.length; i++)\n\t\t\tctotal[i] += rowdata[i];\n\t}\n\t\n\tstatic String printRow(int[] ctotal){\n\t\tString line = \"\";\n\t\tfor(int i=0; i < ctotal.length; i++) \n\t\t\tline = line + Integer.toString(ctotal[i]) + \" \";\n\t\treturn line;\n\t}\n\n}",
"public final class Main {\n\n\tpublic static void main(String[] args) \n\tthrows IOException {\n\t\t// TODO Auto-generated method stub\n\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\t\tint[] arraysize = TempReaderCall.splitIntArrayFromString(TempReaderCall.getStdInRead(br));\n\t\t\n\t\tint[] ctotal = new int[arraysize[1]];\n\t\tArrayList<String> list = TempReaderCall.getStdInReadlines(br, arraysize[0]);\n\t\t\n\t\tfor (int i=0; i<arraysize[0]; i++){\n\t\t\tint[] rowdata = TempReaderCall.splitIntArrayFromString(list.get(i));\n\t\t\taddColumnData(ctotal, rowdata);\n\t\t\tSystem.out.println(list.get(i) + \" \" + sum(rowdata));\n\t\t}\n\t\t\n\t\tSystem.out.println(printRow(ctotal) + sum(ctotal));\n\t\t\n\t}\n\t\n\tstatic int sum (int[] data){\n\t\tint total = 0;\n\t\tfor(int i=0; i < data.length; i++)\n\t\t\ttotal += data[i];\n\t\t\n\t\treturn total;\n\t}\n\t\n\tstatic void addColumnData(int[] ctotal, int[] rowdata){\n\t\tfor(int i=0; i<ctotal.length; i++)\n\t\t\tctotal[i] += rowdata[i];\n\t}\n\t\n\tstatic String printRow(int[] ctotal){\n\t\tString line = \"\";\n\t\tfor(int i=0; i < ctotal.length; i++) \n\t\t\tline = line + Integer.toString(ctotal[i]) + \" \";\n\t\treturn line;\n\t}\n\n}",
"Main"
] | import java.util.ArrayList;
import java.io.InputStreamReader;
import java.io.IOException;
import java.io.BufferedReader;
public final class Main {
public static void main(String[] args)
throws IOException {
// TODO Auto-generated method stub
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
int[] arraysize = TempReaderCall.splitIntArrayFromString(TempReaderCall.getStdInRead(br));
int[] ctotal = new int[arraysize[1]];
ArrayList<String> list = TempReaderCall.getStdInReadlines(br, arraysize[0]);
for (int i=0; i<arraysize[0]; i++){
int[] rowdata = TempReaderCall.splitIntArrayFromString(list.get(i));
addColumnData(ctotal, rowdata);
System.out.println(list.get(i) + " " + sum(rowdata));
}
System.out.println(printRow(ctotal) + sum(ctotal));
}
static int sum (int[] data){
int total = 0;
for(int i=0; i < data.length; i++)
total += data[i];
return total;
}
static void addColumnData(int[] ctotal, int[] rowdata){
for(int i=0; i<ctotal.length; i++)
ctotal[i] += rowdata[i];
}
static String printRow(int[] ctotal){
String line = "";
for(int i=0; i < ctotal.length; i++)
line = line + Integer.toString(ctotal[i]) + " ";
return line;
}
}
class TempReaderCall{
static ArrayList<String> getStdInReadlines(BufferedReader br, int line) throws IOException {
ArrayList<String> list = new ArrayList<String>();
for (int i = 0; i < line; i++)
list.add(br.readLine());
return list;
}
static String getStdInRead(BufferedReader br) throws IOException {
return (br.readLine());
}
static int[] splitIntArrayFromString(String st) {
String[] sts = st.split(" ");
int[] data = new int[sts.length];
for (int i=0;i<sts.length;i++){
data[i] = Integer.parseInt(sts[i]);
}
return data;
}
} |
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
41,
13,
20,
2,
13,
17,
2,
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,
0,
18,
18,
13,
13,
13,
4,
18,
13,
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,
0,
13,
18,
18,
13,
13,
13,
0,
18,
18,
13,
13,
13,
13,
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,
0,
13,
18,
18,
13,
13,
13,
0,
18,
18,
13,
13,
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,
4,
18,
18,
13,
13,
8,
2,
13,
17,
18,
18,
13,
13,
13,
2,
17,
18,
18,
13,
13,
13,
4,
18,
18,
13,
13,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
202,
5
],
[
202,
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
],
[
19,
20
],
[
20,
21
],
[
8,
22
],
[
22,
23
],
[
22,
24
],
[
25,
26
],
[
25,
27
],
[
28,
29
],
[
28,
30
],
[
8,
31
],
[
31,
32
],
[
32,
33
],
[
33,
34
],
[
33,
35
],
[
31,
36
],
[
36,
37
],
[
36,
38
],
[
31,
39
],
[
39,
40
],
[
40,
41
],
[
31,
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
],
[
54,
55
],
[
55,
56
],
[
56,
57
],
[
57,
58
],
[
57,
59
],
[
56,
60
],
[
55,
61
],
[
61,
62
],
[
62,
63
],
[
8,
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
],
[
77,
79
],
[
76,
80
],
[
80,
81
],
[
81,
82
],
[
82,
83
],
[
82,
84
],
[
80,
85
],
[
85,
86
],
[
85,
87
],
[
80,
88
],
[
88,
89
],
[
89,
90
],
[
80,
91
],
[
91,
92
],
[
92,
93
],
[
92,
94
],
[
94,
95
],
[
95,
96
],
[
95,
97
],
[
94,
98
],
[
76,
99
],
[
99,
100
],
[
100,
101
],
[
101,
102
],
[
101,
103
],
[
100,
104
],
[
99,
105
],
[
8,
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
],
[
118,
122
],
[
122,
123
],
[
123,
124
],
[
124,
125
],
[
124,
126
],
[
122,
127
],
[
127,
128
],
[
127,
129
],
[
122,
130
],
[
130,
131
],
[
131,
132
],
[
122,
133
],
[
133,
134
],
[
134,
135
],
[
134,
136
],
[
136,
137
],
[
137,
138
],
[
137,
139
],
[
136,
140
],
[
118,
141
],
[
141,
142
],
[
142,
143
],
[
143,
144
],
[
143,
145
],
[
142,
146
],
[
141,
147
],
[
8,
148
],
[
148,
149
],
[
149,
150
],
[
150,
151
],
[
150,
152
],
[
148,
153
],
[
153,
154
],
[
153,
155
],
[
148,
156
],
[
156,
157
],
[
157,
158
],
[
148,
159
],
[
160,
160
],
[
160,
161
],
[
161,
162
],
[
162,
163
],
[
163,
164
],
[
163,
165
],
[
161,
166
],
[
166,
167
],
[
166,
168
],
[
161,
169
],
[
169,
170
],
[
170,
171
],
[
161,
172
],
[
172,
173
],
[
173,
174
],
[
174,
175
],
[
175,
176
],
[
175,
177
],
[
173,
178
],
[
178,
179
],
[
179,
180
],
[
179,
181
],
[
178,
182
],
[
182,
183
],
[
183,
184
],
[
183,
185
],
[
182,
186
],
[
178,
187
],
[
187,
188
],
[
187,
189
],
[
189,
190
],
[
190,
191
],
[
190,
192
],
[
189,
193
],
[
160,
194
],
[
194,
195
],
[
195,
196
],
[
196,
197
],
[
196,
198
],
[
6,
199
],
[
199,
200
],
[
0,
201
],
[
201,
202
],
[
201,
203
]
] | [
"import java.util.*;\n\npublic class Main {\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n\n int r = sc.nextInt();\n int c = sc.nextInt();\n\n int[][] t = new int[r+1][c+1];\n \n for (int row = 0; row < r; row++)\n for (int col = 0; col < c; col++)\n t[row][col] = sc.nextInt();\n\n for (int row = 0; row < r; row++) {\n int sum = 0;\n for (int col = 0; col < c; col++)\n sum += t[row][col];\n t[row][c] = sum;\n }\n\n for (int col = 0; col <= c; col++) {\n int sum = 0;\n for (int row = 0; row < r; row++)\n sum += t[row][col];\n t[r][col] = sum;\n }\n\n for (int row = 0; row <= r; row++) {\n for (int col = 0; col <= c; col++)\n System.out.print((col == 0) ? t[row][col] : \" \" + t[row][col]);\n System.out.println();\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 r = sc.nextInt();\n int c = sc.nextInt();\n\n int[][] t = new int[r+1][c+1];\n \n for (int row = 0; row < r; row++)\n for (int col = 0; col < c; col++)\n t[row][col] = sc.nextInt();\n\n for (int row = 0; row < r; row++) {\n int sum = 0;\n for (int col = 0; col < c; col++)\n sum += t[row][col];\n t[row][c] = sum;\n }\n\n for (int col = 0; col <= c; col++) {\n int sum = 0;\n for (int row = 0; row < r; row++)\n sum += t[row][col];\n t[r][col] = sum;\n }\n\n for (int row = 0; row <= r; row++) {\n for (int col = 0; col <= c; col++)\n System.out.print((col == 0) ? t[row][col] : \" \" + t[row][col]);\n System.out.println();\n }\n }\n}",
"Main",
"public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n\n int r = sc.nextInt();\n int c = sc.nextInt();\n\n int[][] t = new int[r+1][c+1];\n \n for (int row = 0; row < r; row++)\n for (int col = 0; col < c; col++)\n t[row][col] = sc.nextInt();\n\n for (int row = 0; row < r; row++) {\n int sum = 0;\n for (int col = 0; col < c; col++)\n sum += t[row][col];\n t[row][c] = sum;\n }\n\n for (int col = 0; col <= c; col++) {\n int sum = 0;\n for (int row = 0; row < r; row++)\n sum += t[row][col];\n t[r][col] = sum;\n }\n\n for (int row = 0; row <= r; row++) {\n for (int col = 0; col <= c; col++)\n System.out.print((col == 0) ? t[row][col] : \" \" + t[row][col]);\n System.out.println();\n }\n }",
"main",
"{\n Scanner sc = new Scanner(System.in);\n\n int r = sc.nextInt();\n int c = sc.nextInt();\n\n int[][] t = new int[r+1][c+1];\n \n for (int row = 0; row < r; row++)\n for (int col = 0; col < c; col++)\n t[row][col] = sc.nextInt();\n\n for (int row = 0; row < r; row++) {\n int sum = 0;\n for (int col = 0; col < c; col++)\n sum += t[row][col];\n t[row][c] = sum;\n }\n\n for (int col = 0; col <= c; col++) {\n int sum = 0;\n for (int row = 0; row < r; row++)\n sum += t[row][col];\n t[r][col] = sum;\n }\n\n for (int row = 0; row <= r; row++) {\n for (int col = 0; col <= c; col++)\n System.out.print((col == 0) ? t[row][col] : \" \" + t[row][col]);\n System.out.println();\n }\n }",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"int r = sc.nextInt();",
"r",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int c = sc.nextInt();",
"c",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int[][] t = new int[r+1][c+1];",
"t",
"new int[r+1][c+1]",
"r+1",
"r",
"1",
"c+1",
"c",
"1",
"for (int row = 0; row < r; row++)\n for (int col = 0; col < c; col++)\n t[row][col] = sc.nextInt();",
"int row = 0;",
"int row = 0;",
"row",
"0",
"row < r",
"row",
"r",
"row++",
"row++",
"row",
"for (int col = 0; col < c; col++)\n t[row][col] = sc.nextInt();",
"for (int col = 0; col < c; col++)\n t[row][col] = sc.nextInt();",
"int col = 0;",
"int col = 0;",
"col",
"0",
"col < c",
"col",
"c",
"col++",
"col++",
"col",
"t[row][col] = sc.nextInt();",
"t[row][col] = sc.nextInt()",
"t[row][col]",
"t[row]",
"t",
"row",
"col",
"sc.nextInt()",
"sc.nextInt",
"sc",
"for (int row = 0; row < r; row++) {\n int sum = 0;\n for (int col = 0; col < c; col++)\n sum += t[row][col];\n t[row][c] = sum;\n }",
"int row = 0;",
"int row = 0;",
"row",
"0",
"row < r",
"row",
"r",
"row++",
"row++",
"row",
"{\n int sum = 0;\n for (int col = 0; col < c; col++)\n sum += t[row][col];\n t[row][c] = sum;\n }",
"{\n int sum = 0;\n for (int col = 0; col < c; col++)\n sum += t[row][col];\n t[row][c] = sum;\n }",
"int sum = 0;",
"sum",
"0",
"for (int col = 0; col < c; col++)\n sum += t[row][col];",
"int col = 0;",
"int col = 0;",
"col",
"0",
"col < c",
"col",
"c",
"col++",
"col++",
"col",
"sum += t[row][col];",
"sum += t[row][col]",
"sum",
"t[row][col]",
"t[row]",
"t",
"row",
"col",
"t[row][c] = sum",
"t[row][c]",
"t[row]",
"t",
"row",
"c",
"sum",
"for (int col = 0; col <= c; col++) {\n int sum = 0;\n for (int row = 0; row < r; row++)\n sum += t[row][col];\n t[r][col] = sum;\n }",
"int col = 0;",
"int col = 0;",
"col",
"0",
"col <= c",
"col",
"c",
"col++",
"col++",
"col",
"{\n int sum = 0;\n for (int row = 0; row < r; row++)\n sum += t[row][col];\n t[r][col] = sum;\n }",
"{\n int sum = 0;\n for (int row = 0; row < r; row++)\n sum += t[row][col];\n t[r][col] = sum;\n }",
"int sum = 0;",
"sum",
"0",
"for (int row = 0; row < r; row++)\n sum += t[row][col];",
"int row = 0;",
"int row = 0;",
"row",
"0",
"row < r",
"row",
"r",
"row++",
"row++",
"row",
"sum += t[row][col];",
"sum += t[row][col]",
"sum",
"t[row][col]",
"t[row]",
"t",
"row",
"col",
"t[r][col] = sum",
"t[r][col]",
"t[r]",
"t",
"r",
"col",
"sum",
"for (int row = 0; row <= r; row++) {\n for (int col = 0; col <= c; col++)\n System.out.print((col == 0) ? t[row][col] : \" \" + t[row][col]);\n System.out.println();\n }",
"int row = 0;",
"int row = 0;",
"row",
"0",
"row <= r",
"row",
"r",
"row++",
"row++",
"row",
"{\n for (int col = 0; col <= c; col++)\n System.out.print((col == 0) ? t[row][col] : \" \" + t[row][col]);\n System.out.println();\n }",
"{\n for (int col = 0; col <= c; col++)\n System.out.print((col == 0) ? t[row][col] : \" \" + t[row][col]);\n System.out.println();\n }",
"for (int col = 0; col <= c; col++)\n System.out.print((col == 0) ? t[row][col] : \" \" + t[row][col]);",
"int col = 0;",
"int col = 0;",
"col",
"0",
"col <= c",
"col",
"c",
"col++",
"col++",
"col",
"System.out.print((col == 0) ? t[row][col] : \" \" + t[row][col]);",
"System.out.print((col == 0) ? t[row][col] : \" \" + t[row][col])",
"System.out.print",
"System.out",
"System",
"System.out",
"(col == 0) ? t[row][col] : \" \" + t[row][col]",
"(col == 0)",
"col",
"0",
"t[row][col]",
"t[row]",
"t",
"row",
"col",
"\" \" + t[row][col]",
"\" \"",
"t[row][col]",
"t[row]",
"t",
"row",
"col",
"System.out.println()",
"System.out.println",
"System.out",
"System",
"System.out",
"String[] args",
"args",
"public class Main {\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n\n int r = sc.nextInt();\n int c = sc.nextInt();\n\n int[][] t = new int[r+1][c+1];\n \n for (int row = 0; row < r; row++)\n for (int col = 0; col < c; col++)\n t[row][col] = sc.nextInt();\n\n for (int row = 0; row < r; row++) {\n int sum = 0;\n for (int col = 0; col < c; col++)\n sum += t[row][col];\n t[row][c] = sum;\n }\n\n for (int col = 0; col <= c; col++) {\n int sum = 0;\n for (int row = 0; row < r; row++)\n sum += t[row][col];\n t[r][col] = sum;\n }\n\n for (int row = 0; row <= r; row++) {\n for (int col = 0; col <= c; col++)\n System.out.print((col == 0) ? t[row][col] : \" \" + t[row][col]);\n System.out.println();\n }\n }\n}",
"public class Main {\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n\n int r = sc.nextInt();\n int c = sc.nextInt();\n\n int[][] t = new int[r+1][c+1];\n \n for (int row = 0; row < r; row++)\n for (int col = 0; col < c; col++)\n t[row][col] = sc.nextInt();\n\n for (int row = 0; row < r; row++) {\n int sum = 0;\n for (int col = 0; col < c; col++)\n sum += t[row][col];\n t[row][c] = sum;\n }\n\n for (int col = 0; col <= c; col++) {\n int sum = 0;\n for (int row = 0; row < r; row++)\n sum += t[row][col];\n t[r][col] = sum;\n }\n\n for (int row = 0; row <= r; row++) {\n for (int col = 0; col <= c; col++)\n System.out.print((col == 0) ? t[row][col] : \" \" + t[row][col]);\n System.out.println();\n }\n }\n}",
"Main"
] | import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int r = sc.nextInt();
int c = sc.nextInt();
int[][] t = new int[r+1][c+1];
for (int row = 0; row < r; row++)
for (int col = 0; col < c; col++)
t[row][col] = sc.nextInt();
for (int row = 0; row < r; row++) {
int sum = 0;
for (int col = 0; col < c; col++)
sum += t[row][col];
t[row][c] = sum;
}
for (int col = 0; col <= c; col++) {
int sum = 0;
for (int row = 0; row < r; row++)
sum += t[row][col];
t[r][col] = sum;
}
for (int row = 0; row <= r; row++) {
for (int col = 0; col <= c; col++)
System.out.print((col == 0) ? t[row][col] : " " + t[row][col]);
System.out.println();
}
}
}
|
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
41,
13,
0,
13,
20,
2,
13,
17,
2,
13,
17,
41,
13,
41,
13,
11,
1,
0,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
11,
1,
0,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
18,
18,
13,
13,
13,
4,
18,
13,
11,
1,
0,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
11,
1,
0,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
18,
18,
13,
13,
13,
18,
18,
13,
13,
13,
11,
1,
0,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
11,
1,
0,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
18,
18,
13,
13,
13,
18,
18,
13,
13,
13,
11,
1,
0,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
11,
1,
0,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
14,
2,
13,
13,
30,
4,
18,
18,
13,
13,
2,
18,
18,
13,
13,
13,
17,
14,
2,
13,
13,
30,
4,
18,
18,
13,
13,
18,
18,
13,
13,
13,
14,
2,
13,
13,
30,
4,
18,
18,
13,
13,
17,
23,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
8,
17
],
[
17,
18
],
[
17,
19
],
[
19,
20
],
[
20,
21
],
[
8,
22
],
[
22,
23
],
[
8,
24
],
[
24,
25
],
[
24,
26
],
[
27,
28
],
[
27,
29
],
[
30,
31
],
[
30,
32
],
[
8,
33
],
[
33,
34
],
[
8,
35
],
[
35,
36
],
[
8,
37
],
[
37,
38
],
[
38,
39
],
[
39,
40
],
[
39,
41
],
[
37,
42
],
[
42,
43
],
[
42,
44
],
[
37,
45
],
[
45,
46
],
[
46,
47
],
[
37,
48
],
[
49,
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
],
[
62,
62
],
[
62,
63
],
[
63,
64
],
[
64,
65
],
[
65,
66
],
[
65,
67
],
[
64,
68
],
[
63,
69
],
[
69,
70
],
[
70,
71
],
[
8,
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
],
[
85,
93
],
[
93,
94
],
[
94,
95
],
[
85,
96
],
[
97,
97
],
[
97,
98
],
[
98,
99
],
[
99,
100
],
[
100,
101
],
[
100,
102
],
[
99,
103
],
[
98,
104
],
[
104,
105
],
[
105,
106
],
[
105,
107
],
[
104,
108
],
[
8,
109
],
[
109,
110
],
[
110,
111
],
[
111,
112
],
[
111,
113
],
[
109,
114
],
[
114,
115
],
[
114,
116
],
[
109,
117
],
[
117,
118
],
[
118,
119
],
[
109,
120
],
[
121,
121
],
[
121,
122
],
[
122,
123
],
[
123,
124
],
[
124,
125
],
[
124,
126
],
[
122,
127
],
[
127,
128
],
[
127,
129
],
[
122,
130
],
[
130,
131
],
[
131,
132
],
[
122,
133
],
[
134,
134
],
[
134,
135
],
[
135,
136
],
[
136,
137
],
[
137,
138
],
[
137,
139
],
[
136,
140
],
[
135,
141
],
[
141,
142
],
[
142,
143
],
[
142,
144
],
[
141,
145
],
[
8,
146
],
[
146,
147
],
[
147,
148
],
[
148,
149
],
[
148,
150
],
[
146,
151
],
[
151,
152
],
[
151,
153
],
[
146,
154
],
[
154,
155
],
[
155,
156
],
[
146,
157
],
[
158,
158
],
[
158,
159
],
[
159,
160
],
[
160,
161
],
[
161,
162
],
[
161,
163
],
[
159,
164
],
[
164,
165
],
[
164,
166
],
[
159,
167
],
[
167,
168
],
[
168,
169
],
[
159,
170
],
[
171,
171
],
[
171,
172
],
[
172,
173
],
[
173,
174
],
[
173,
175
],
[
172,
176
],
[
176,
177
],
[
177,
178
],
[
178,
179
],
[
179,
180
],
[
179,
181
],
[
177,
182
],
[
182,
183
],
[
183,
184
],
[
184,
185
],
[
184,
186
],
[
183,
187
],
[
182,
188
],
[
172,
189
],
[
189,
190
],
[
190,
191
],
[
190,
192
],
[
189,
193
],
[
193,
194
],
[
194,
195
],
[
195,
196
],
[
196,
197
],
[
196,
198
],
[
194,
199
],
[
199,
200
],
[
200,
201
],
[
200,
202
],
[
199,
203
],
[
171,
204
],
[
204,
205
],
[
205,
206
],
[
205,
207
],
[
204,
208
],
[
208,
209
],
[
209,
210
],
[
210,
211
],
[
211,
212
],
[
211,
213
],
[
209,
214
],
[
6,
215
],
[
215,
216
]
] | [
"import java.util.Scanner;\n\nclass Main {\n public static void main(String[] args) {\n Scanner scan = new Scanner(System.in);\n \n \tint r = scan.nextInt();\n \tint c = scan.nextInt();\n \tint [][]sheet;\n \tsheet = new int[(r+1)][(c+1)];\n \tint sheetr,sheetc;\n\n \tfor(sheetr = 0; sheetr < r; sheetr++){\n \t\tfor(sheetc = 0; sheetc < c; sheetc++){\n \t\tsheet[sheetr][sheetc] = scan.nextInt();\n \t\t}\n \t}\n \tfor(sheetr = 0; sheetr < r; sheetr++){\n \t\tfor(sheetc = 0; sheetc < c; sheetc++){ \t\t\t\n \t\tsheet[sheetr][c] += sheet[sheetr][sheetc];\n \t\t}\n \t}\n \tfor(sheetc = 0; sheetc <= c; sheetc++){\n \t\tfor(sheetr = 0; sheetr < r; sheetr++){\n \t\tsheet[r][sheetc] += sheet[sheetr][sheetc];\n \t\t}\n \t}\n \tfor(sheetr = 0; sheetr <= r; sheetr++){\n \t\tfor(sheetc = 0; sheetc <= c; sheetc++){ \n \t\t\tif(sheetc < c){\n \t\t\t\tSystem.out.print(sheet[sheetr][sheetc]+\" \");\n \t\t\t}\n \t\t\telse if(sheetc == c){\n \t\t\tSystem.out.print(sheet[sheetr][sheetc]);\n \t\t\t}\n \t\t\tif(sheetc == c){\n \t\t\t\tSystem.out.print(\"\\r\\n\");\n \t\t\t}\n \t\t}\n \t}\n }\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"class Main {\n public static void main(String[] args) {\n Scanner scan = new Scanner(System.in);\n \n \tint r = scan.nextInt();\n \tint c = scan.nextInt();\n \tint [][]sheet;\n \tsheet = new int[(r+1)][(c+1)];\n \tint sheetr,sheetc;\n\n \tfor(sheetr = 0; sheetr < r; sheetr++){\n \t\tfor(sheetc = 0; sheetc < c; sheetc++){\n \t\tsheet[sheetr][sheetc] = scan.nextInt();\n \t\t}\n \t}\n \tfor(sheetr = 0; sheetr < r; sheetr++){\n \t\tfor(sheetc = 0; sheetc < c; sheetc++){ \t\t\t\n \t\tsheet[sheetr][c] += sheet[sheetr][sheetc];\n \t\t}\n \t}\n \tfor(sheetc = 0; sheetc <= c; sheetc++){\n \t\tfor(sheetr = 0; sheetr < r; sheetr++){\n \t\tsheet[r][sheetc] += sheet[sheetr][sheetc];\n \t\t}\n \t}\n \tfor(sheetr = 0; sheetr <= r; sheetr++){\n \t\tfor(sheetc = 0; sheetc <= c; sheetc++){ \n \t\t\tif(sheetc < c){\n \t\t\t\tSystem.out.print(sheet[sheetr][sheetc]+\" \");\n \t\t\t}\n \t\t\telse if(sheetc == c){\n \t\t\tSystem.out.print(sheet[sheetr][sheetc]);\n \t\t\t}\n \t\t\tif(sheetc == c){\n \t\t\t\tSystem.out.print(\"\\r\\n\");\n \t\t\t}\n \t\t}\n \t}\n }\n}",
"Main",
"public static void main(String[] args) {\n Scanner scan = new Scanner(System.in);\n \n \tint r = scan.nextInt();\n \tint c = scan.nextInt();\n \tint [][]sheet;\n \tsheet = new int[(r+1)][(c+1)];\n \tint sheetr,sheetc;\n\n \tfor(sheetr = 0; sheetr < r; sheetr++){\n \t\tfor(sheetc = 0; sheetc < c; sheetc++){\n \t\tsheet[sheetr][sheetc] = scan.nextInt();\n \t\t}\n \t}\n \tfor(sheetr = 0; sheetr < r; sheetr++){\n \t\tfor(sheetc = 0; sheetc < c; sheetc++){ \t\t\t\n \t\tsheet[sheetr][c] += sheet[sheetr][sheetc];\n \t\t}\n \t}\n \tfor(sheetc = 0; sheetc <= c; sheetc++){\n \t\tfor(sheetr = 0; sheetr < r; sheetr++){\n \t\tsheet[r][sheetc] += sheet[sheetr][sheetc];\n \t\t}\n \t}\n \tfor(sheetr = 0; sheetr <= r; sheetr++){\n \t\tfor(sheetc = 0; sheetc <= c; sheetc++){ \n \t\t\tif(sheetc < c){\n \t\t\t\tSystem.out.print(sheet[sheetr][sheetc]+\" \");\n \t\t\t}\n \t\t\telse if(sheetc == c){\n \t\t\tSystem.out.print(sheet[sheetr][sheetc]);\n \t\t\t}\n \t\t\tif(sheetc == c){\n \t\t\t\tSystem.out.print(\"\\r\\n\");\n \t\t\t}\n \t\t}\n \t}\n }",
"main",
"{\n Scanner scan = new Scanner(System.in);\n \n \tint r = scan.nextInt();\n \tint c = scan.nextInt();\n \tint [][]sheet;\n \tsheet = new int[(r+1)][(c+1)];\n \tint sheetr,sheetc;\n\n \tfor(sheetr = 0; sheetr < r; sheetr++){\n \t\tfor(sheetc = 0; sheetc < c; sheetc++){\n \t\tsheet[sheetr][sheetc] = scan.nextInt();\n \t\t}\n \t}\n \tfor(sheetr = 0; sheetr < r; sheetr++){\n \t\tfor(sheetc = 0; sheetc < c; sheetc++){ \t\t\t\n \t\tsheet[sheetr][c] += sheet[sheetr][sheetc];\n \t\t}\n \t}\n \tfor(sheetc = 0; sheetc <= c; sheetc++){\n \t\tfor(sheetr = 0; sheetr < r; sheetr++){\n \t\tsheet[r][sheetc] += sheet[sheetr][sheetc];\n \t\t}\n \t}\n \tfor(sheetr = 0; sheetr <= r; sheetr++){\n \t\tfor(sheetc = 0; sheetc <= c; sheetc++){ \n \t\t\tif(sheetc < c){\n \t\t\t\tSystem.out.print(sheet[sheetr][sheetc]+\" \");\n \t\t\t}\n \t\t\telse if(sheetc == c){\n \t\t\tSystem.out.print(sheet[sheetr][sheetc]);\n \t\t\t}\n \t\t\tif(sheetc == c){\n \t\t\t\tSystem.out.print(\"\\r\\n\");\n \t\t\t}\n \t\t}\n \t}\n }",
"Scanner scan = new Scanner(System.in);",
"scan",
"new Scanner(System.in)",
"int r = scan.nextInt();",
"r",
"scan.nextInt()",
"scan.nextInt",
"scan",
"int c = scan.nextInt();",
"c",
"scan.nextInt()",
"scan.nextInt",
"scan",
"int [][]sheet;",
"sheet",
"sheet = new int[(r+1)][(c+1)]",
"sheet",
"new int[(r+1)][(c+1)]",
"(r+1)",
"r",
"1",
"(c+1)",
"c",
"1",
"int sheetr",
"sheetr",
"sheetc;",
"sheetc",
"for(sheetr = 0; sheetr < r; sheetr++){\n \t\tfor(sheetc = 0; sheetc < c; sheetc++){\n \t\tsheet[sheetr][sheetc] = scan.nextInt();\n \t\t}\n \t}",
"sheetr = 0;",
"sheetr = 0",
"sheetr",
"0",
"sheetr < r",
"sheetr",
"r",
"sheetr++",
"sheetr++",
"sheetr",
"{\n \t\tfor(sheetc = 0; sheetc < c; sheetc++){\n \t\tsheet[sheetr][sheetc] = scan.nextInt();\n \t\t}\n \t}",
"{\n \t\tfor(sheetc = 0; sheetc < c; sheetc++){\n \t\tsheet[sheetr][sheetc] = scan.nextInt();\n \t\t}\n \t}",
"for(sheetc = 0; sheetc < c; sheetc++){\n \t\tsheet[sheetr][sheetc] = scan.nextInt();\n \t\t}",
"sheetc = 0;",
"sheetc = 0",
"sheetc",
"0",
"sheetc < c",
"sheetc",
"c",
"sheetc++",
"sheetc++",
"sheetc",
"{\n \t\tsheet[sheetr][sheetc] = scan.nextInt();\n \t\t}",
"{\n \t\tsheet[sheetr][sheetc] = scan.nextInt();\n \t\t}",
"sheet[sheetr][sheetc] = scan.nextInt()",
"sheet[sheetr][sheetc]",
"sheet[sheetr]",
"sheet",
"sheetr",
"sheetc",
"scan.nextInt()",
"scan.nextInt",
"scan",
"for(sheetr = 0; sheetr < r; sheetr++){\n \t\tfor(sheetc = 0; sheetc < c; sheetc++){ \t\t\t\n \t\tsheet[sheetr][c] += sheet[sheetr][sheetc];\n \t\t}\n \t}",
"sheetr = 0;",
"sheetr = 0",
"sheetr",
"0",
"sheetr < r",
"sheetr",
"r",
"sheetr++",
"sheetr++",
"sheetr",
"{\n \t\tfor(sheetc = 0; sheetc < c; sheetc++){ \t\t\t\n \t\tsheet[sheetr][c] += sheet[sheetr][sheetc];\n \t\t}\n \t}",
"{\n \t\tfor(sheetc = 0; sheetc < c; sheetc++){ \t\t\t\n \t\tsheet[sheetr][c] += sheet[sheetr][sheetc];\n \t\t}\n \t}",
"for(sheetc = 0; sheetc < c; sheetc++){ \t\t\t\n \t\tsheet[sheetr][c] += sheet[sheetr][sheetc];\n \t\t}",
"sheetc = 0;",
"sheetc = 0",
"sheetc",
"0",
"sheetc < c",
"sheetc",
"c",
"sheetc++",
"sheetc++",
"sheetc",
"{ \t\t\t\n \t\tsheet[sheetr][c] += sheet[sheetr][sheetc];\n \t\t}",
"{ \t\t\t\n \t\tsheet[sheetr][c] += sheet[sheetr][sheetc];\n \t\t}",
"sheet[sheetr][c] += sheet[sheetr][sheetc]",
"sheet[sheetr][c]",
"sheet[sheetr]",
"sheet",
"sheetr",
"c",
"sheet[sheetr][sheetc]",
"sheet[sheetr]",
"sheet",
"sheetr",
"sheetc",
"for(sheetc = 0; sheetc <= c; sheetc++){\n \t\tfor(sheetr = 0; sheetr < r; sheetr++){\n \t\tsheet[r][sheetc] += sheet[sheetr][sheetc];\n \t\t}\n \t}",
"sheetc = 0;",
"sheetc = 0",
"sheetc",
"0",
"sheetc <= c",
"sheetc",
"c",
"sheetc++",
"sheetc++",
"sheetc",
"{\n \t\tfor(sheetr = 0; sheetr < r; sheetr++){\n \t\tsheet[r][sheetc] += sheet[sheetr][sheetc];\n \t\t}\n \t}",
"{\n \t\tfor(sheetr = 0; sheetr < r; sheetr++){\n \t\tsheet[r][sheetc] += sheet[sheetr][sheetc];\n \t\t}\n \t}",
"for(sheetr = 0; sheetr < r; sheetr++){\n \t\tsheet[r][sheetc] += sheet[sheetr][sheetc];\n \t\t}",
"sheetr = 0;",
"sheetr = 0",
"sheetr",
"0",
"sheetr < r",
"sheetr",
"r",
"sheetr++",
"sheetr++",
"sheetr",
"{\n \t\tsheet[r][sheetc] += sheet[sheetr][sheetc];\n \t\t}",
"{\n \t\tsheet[r][sheetc] += sheet[sheetr][sheetc];\n \t\t}",
"sheet[r][sheetc] += sheet[sheetr][sheetc]",
"sheet[r][sheetc]",
"sheet[r]",
"sheet",
"r",
"sheetc",
"sheet[sheetr][sheetc]",
"sheet[sheetr]",
"sheet",
"sheetr",
"sheetc",
"for(sheetr = 0; sheetr <= r; sheetr++){\n \t\tfor(sheetc = 0; sheetc <= c; sheetc++){ \n \t\t\tif(sheetc < c){\n \t\t\t\tSystem.out.print(sheet[sheetr][sheetc]+\" \");\n \t\t\t}\n \t\t\telse if(sheetc == c){\n \t\t\tSystem.out.print(sheet[sheetr][sheetc]);\n \t\t\t}\n \t\t\tif(sheetc == c){\n \t\t\t\tSystem.out.print(\"\\r\\n\");\n \t\t\t}\n \t\t}\n \t}",
"sheetr = 0;",
"sheetr = 0",
"sheetr",
"0",
"sheetr <= r",
"sheetr",
"r",
"sheetr++",
"sheetr++",
"sheetr",
"{\n \t\tfor(sheetc = 0; sheetc <= c; sheetc++){ \n \t\t\tif(sheetc < c){\n \t\t\t\tSystem.out.print(sheet[sheetr][sheetc]+\" \");\n \t\t\t}\n \t\t\telse if(sheetc == c){\n \t\t\tSystem.out.print(sheet[sheetr][sheetc]);\n \t\t\t}\n \t\t\tif(sheetc == c){\n \t\t\t\tSystem.out.print(\"\\r\\n\");\n \t\t\t}\n \t\t}\n \t}",
"{\n \t\tfor(sheetc = 0; sheetc <= c; sheetc++){ \n \t\t\tif(sheetc < c){\n \t\t\t\tSystem.out.print(sheet[sheetr][sheetc]+\" \");\n \t\t\t}\n \t\t\telse if(sheetc == c){\n \t\t\tSystem.out.print(sheet[sheetr][sheetc]);\n \t\t\t}\n \t\t\tif(sheetc == c){\n \t\t\t\tSystem.out.print(\"\\r\\n\");\n \t\t\t}\n \t\t}\n \t}",
"for(sheetc = 0; sheetc <= c; sheetc++){ \n \t\t\tif(sheetc < c){\n \t\t\t\tSystem.out.print(sheet[sheetr][sheetc]+\" \");\n \t\t\t}\n \t\t\telse if(sheetc == c){\n \t\t\tSystem.out.print(sheet[sheetr][sheetc]);\n \t\t\t}\n \t\t\tif(sheetc == c){\n \t\t\t\tSystem.out.print(\"\\r\\n\");\n \t\t\t}\n \t\t}",
"sheetc = 0;",
"sheetc = 0",
"sheetc",
"0",
"sheetc <= c",
"sheetc",
"c",
"sheetc++",
"sheetc++",
"sheetc",
"{ \n \t\t\tif(sheetc < c){\n \t\t\t\tSystem.out.print(sheet[sheetr][sheetc]+\" \");\n \t\t\t}\n \t\t\telse if(sheetc == c){\n \t\t\tSystem.out.print(sheet[sheetr][sheetc]);\n \t\t\t}\n \t\t\tif(sheetc == c){\n \t\t\t\tSystem.out.print(\"\\r\\n\");\n \t\t\t}\n \t\t}",
"{ \n \t\t\tif(sheetc < c){\n \t\t\t\tSystem.out.print(sheet[sheetr][sheetc]+\" \");\n \t\t\t}\n \t\t\telse if(sheetc == c){\n \t\t\tSystem.out.print(sheet[sheetr][sheetc]);\n \t\t\t}\n \t\t\tif(sheetc == c){\n \t\t\t\tSystem.out.print(\"\\r\\n\");\n \t\t\t}\n \t\t}",
"if(sheetc < c){\n \t\t\t\tSystem.out.print(sheet[sheetr][sheetc]+\" \");\n \t\t\t}\n \t\t\telse if(sheetc == c){\n \t\t\tSystem.out.print(sheet[sheetr][sheetc]);\n \t\t\t}",
"sheetc < c",
"sheetc",
"c",
"{\n \t\t\t\tSystem.out.print(sheet[sheetr][sheetc]+\" \");\n \t\t\t}",
"System.out.print(sheet[sheetr][sheetc]+\" \")",
"System.out.print",
"System.out",
"System",
"System.out",
"sheet[sheetr][sheetc]+\" \"",
"sheet[sheetr][sheetc]",
"sheet[sheetr]",
"sheet",
"sheetr",
"sheetc",
"\" \"",
"if(sheetc == c){\n \t\t\tSystem.out.print(sheet[sheetr][sheetc]);\n \t\t\t}",
"sheetc == c",
"sheetc",
"c",
"{\n \t\t\tSystem.out.print(sheet[sheetr][sheetc]);\n \t\t\t}",
"System.out.print(sheet[sheetr][sheetc])",
"System.out.print",
"System.out",
"System",
"System.out",
"sheet[sheetr][sheetc]",
"sheet[sheetr]",
"sheet",
"sheetr",
"sheetc",
"if(sheetc == c){\n \t\t\t\tSystem.out.print(\"\\r\\n\");\n \t\t\t}",
"sheetc == c",
"sheetc",
"c",
"{\n \t\t\t\tSystem.out.print(\"\\r\\n\");\n \t\t\t}",
"System.out.print(\"\\r\\n\")",
"System.out.print",
"System.out",
"System",
"System.out",
"\"\\r\\n\"",
"String[] args",
"args"
] | import java.util.Scanner;
class Main {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
int r = scan.nextInt();
int c = scan.nextInt();
int [][]sheet;
sheet = new int[(r+1)][(c+1)];
int sheetr,sheetc;
for(sheetr = 0; sheetr < r; sheetr++){
for(sheetc = 0; sheetc < c; sheetc++){
sheet[sheetr][sheetc] = scan.nextInt();
}
}
for(sheetr = 0; sheetr < r; sheetr++){
for(sheetc = 0; sheetc < c; sheetc++){
sheet[sheetr][c] += sheet[sheetr][sheetc];
}
}
for(sheetc = 0; sheetc <= c; sheetc++){
for(sheetr = 0; sheetr < r; sheetr++){
sheet[r][sheetc] += sheet[sheetr][sheetc];
}
}
for(sheetr = 0; sheetr <= r; sheetr++){
for(sheetc = 0; sheetc <= c; sheetc++){
if(sheetc < c){
System.out.print(sheet[sheetr][sheetc]+" ");
}
else if(sheetc == c){
System.out.print(sheet[sheetr][sheetc]);
}
if(sheetc == c){
System.out.print("\r\n");
}
}
}
}
} |
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
41,
13,
20,
2,
13,
17,
2,
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,
18,
18,
13,
13,
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,
0,
18,
18,
13,
13,
13,
18,
18,
13,
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,
18,
18,
13,
13,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
4,
18,
18,
13,
13,
17,
18,
18,
13,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
4,
18,
18,
13,
13,
17,
18,
18,
13,
13,
13,
4,
18,
18,
13,
13,
17,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
197,
5
],
[
197,
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
],
[
19,
20
],
[
20,
21
],
[
8,
22
],
[
22,
23
],
[
22,
24
],
[
25,
26
],
[
25,
27
],
[
28,
29
],
[
28,
30
],
[
8,
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
],
[
58,
62
],
[
57,
63
],
[
63,
64
],
[
64,
65
],
[
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
],
[
93,
94
],
[
94,
95
],
[
94,
96
],
[
93,
97
],
[
92,
98
],
[
98,
99
],
[
99,
100
],
[
99,
101
],
[
98,
102
],
[
8,
103
],
[
103,
104
],
[
104,
105
],
[
105,
106
],
[
105,
107
],
[
103,
108
],
[
108,
109
],
[
108,
110
],
[
103,
111
],
[
111,
112
],
[
112,
113
],
[
103,
114
],
[
115,
115
],
[
115,
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
],
[
130,
131
],
[
131,
132
],
[
131,
133
],
[
130,
134
],
[
129,
135
],
[
135,
136
],
[
136,
137
],
[
136,
138
],
[
135,
139
],
[
8,
140
],
[
140,
141
],
[
141,
142
],
[
142,
143
],
[
142,
144
],
[
140,
145
],
[
145,
146
],
[
145,
147
],
[
140,
148
],
[
148,
149
],
[
149,
150
],
[
140,
151
],
[
152,
152
],
[
152,
153
],
[
153,
154
],
[
154,
155
],
[
155,
156
],
[
155,
157
],
[
153,
158
],
[
153,
159
],
[
159,
160
],
[
160,
161
],
[
160,
162
],
[
159,
163
],
[
152,
164
],
[
164,
165
],
[
165,
166
],
[
166,
167
],
[
166,
168
],
[
164,
169
],
[
169,
170
],
[
169,
171
],
[
164,
172
],
[
172,
173
],
[
173,
174
],
[
164,
175
],
[
176,
176
],
[
176,
177
],
[
177,
178
],
[
178,
179
],
[
179,
180
],
[
179,
181
],
[
177,
182
],
[
177,
183
],
[
183,
184
],
[
184,
185
],
[
184,
186
],
[
183,
187
],
[
152,
188
],
[
188,
189
],
[
189,
190
],
[
190,
191
],
[
190,
192
],
[
188,
193
],
[
6,
194
],
[
194,
195
],
[
0,
196
],
[
196,
197
],
[
196,
198
]
] | [
"import java.util.*;\npublic class Main{\n public static void main(String[] args){\n Scanner sc = new Scanner(System.in);\n int Row=sc.nextInt();\n int Col=sc.nextInt();\n int table[][] =new int[Row+1][Col+1];\n for(int i=0;i<Row;i++){\n for(int j=0;j<Col;j++){\n table[i][j]=sc.nextInt();\n }\n }\n for(int i = 0; i < Row; i++){\n\t\t\tfor(int j = 0; j < Col; j++){\n\t\t\t\ttable[i][Col] += table[i][j];\n\t\t\t}\n\t\t}\n\n\t\tfor(int i = 0; i <= Col; i++){\n\t\t\tfor(int j = 0; j < Row; j++){\n\t\t\t\ttable[Row][i] += table[j][i];\n\t\t\t}\n\t\t}\n\n\t\tfor(int i = 0; i <= Row; i++){\n\t\t\tSystem.out.printf(\"%d\", table[i][0]);\n\t\t\tfor(int j = 1; j <= Col; j++){\n\t\t\t\tSystem.out.printf(\" %d\", table[i][j]);\n\t\t\t}\n\t\t\tSystem.out.printf(\"\\n\");\n\t\t}\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 Row=sc.nextInt();\n int Col=sc.nextInt();\n int table[][] =new int[Row+1][Col+1];\n for(int i=0;i<Row;i++){\n for(int j=0;j<Col;j++){\n table[i][j]=sc.nextInt();\n }\n }\n for(int i = 0; i < Row; i++){\n\t\t\tfor(int j = 0; j < Col; j++){\n\t\t\t\ttable[i][Col] += table[i][j];\n\t\t\t}\n\t\t}\n\n\t\tfor(int i = 0; i <= Col; i++){\n\t\t\tfor(int j = 0; j < Row; j++){\n\t\t\t\ttable[Row][i] += table[j][i];\n\t\t\t}\n\t\t}\n\n\t\tfor(int i = 0; i <= Row; i++){\n\t\t\tSystem.out.printf(\"%d\", table[i][0]);\n\t\t\tfor(int j = 1; j <= Col; j++){\n\t\t\t\tSystem.out.printf(\" %d\", table[i][j]);\n\t\t\t}\n\t\t\tSystem.out.printf(\"\\n\");\n\t\t}\n }\n}",
"Main",
"public static void main(String[] args){\n Scanner sc = new Scanner(System.in);\n int Row=sc.nextInt();\n int Col=sc.nextInt();\n int table[][] =new int[Row+1][Col+1];\n for(int i=0;i<Row;i++){\n for(int j=0;j<Col;j++){\n table[i][j]=sc.nextInt();\n }\n }\n for(int i = 0; i < Row; i++){\n\t\t\tfor(int j = 0; j < Col; j++){\n\t\t\t\ttable[i][Col] += table[i][j];\n\t\t\t}\n\t\t}\n\n\t\tfor(int i = 0; i <= Col; i++){\n\t\t\tfor(int j = 0; j < Row; j++){\n\t\t\t\ttable[Row][i] += table[j][i];\n\t\t\t}\n\t\t}\n\n\t\tfor(int i = 0; i <= Row; i++){\n\t\t\tSystem.out.printf(\"%d\", table[i][0]);\n\t\t\tfor(int j = 1; j <= Col; j++){\n\t\t\t\tSystem.out.printf(\" %d\", table[i][j]);\n\t\t\t}\n\t\t\tSystem.out.printf(\"\\n\");\n\t\t}\n }",
"main",
"{\n Scanner sc = new Scanner(System.in);\n int Row=sc.nextInt();\n int Col=sc.nextInt();\n int table[][] =new int[Row+1][Col+1];\n for(int i=0;i<Row;i++){\n for(int j=0;j<Col;j++){\n table[i][j]=sc.nextInt();\n }\n }\n for(int i = 0; i < Row; i++){\n\t\t\tfor(int j = 0; j < Col; j++){\n\t\t\t\ttable[i][Col] += table[i][j];\n\t\t\t}\n\t\t}\n\n\t\tfor(int i = 0; i <= Col; i++){\n\t\t\tfor(int j = 0; j < Row; j++){\n\t\t\t\ttable[Row][i] += table[j][i];\n\t\t\t}\n\t\t}\n\n\t\tfor(int i = 0; i <= Row; i++){\n\t\t\tSystem.out.printf(\"%d\", table[i][0]);\n\t\t\tfor(int j = 1; j <= Col; j++){\n\t\t\t\tSystem.out.printf(\" %d\", table[i][j]);\n\t\t\t}\n\t\t\tSystem.out.printf(\"\\n\");\n\t\t}\n }",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"int Row=sc.nextInt();",
"Row",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int Col=sc.nextInt();",
"Col",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int table[][] =new int[Row+1][Col+1];",
"table",
"new int[Row+1][Col+1]",
"Row+1",
"Row",
"1",
"Col+1",
"Col",
"1",
"for(int i=0;i<Row;i++){\n for(int j=0;j<Col;j++){\n table[i][j]=sc.nextInt();\n }\n }",
"int i=0;",
"int i=0;",
"i",
"0",
"i<Row",
"i",
"Row",
"i++",
"i++",
"i",
"{\n for(int j=0;j<Col;j++){\n table[i][j]=sc.nextInt();\n }\n }",
"{\n for(int j=0;j<Col;j++){\n table[i][j]=sc.nextInt();\n }\n }",
"for(int j=0;j<Col;j++){\n table[i][j]=sc.nextInt();\n }",
"int j=0;",
"int j=0;",
"j",
"0",
"j<Col",
"j",
"Col",
"j++",
"j++",
"j",
"{\n table[i][j]=sc.nextInt();\n }",
"{\n table[i][j]=sc.nextInt();\n }",
"table[i][j]=sc.nextInt()",
"table[i][j]",
"table[i]",
"table",
"i",
"j",
"sc.nextInt()",
"sc.nextInt",
"sc",
"for(int i = 0; i < Row; i++){\n\t\t\tfor(int j = 0; j < Col; j++){\n\t\t\t\ttable[i][Col] += table[i][j];\n\t\t\t}\n\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < Row",
"i",
"Row",
"i++",
"i++",
"i",
"{\n\t\t\tfor(int j = 0; j < Col; j++){\n\t\t\t\ttable[i][Col] += table[i][j];\n\t\t\t}\n\t\t}",
"{\n\t\t\tfor(int j = 0; j < Col; j++){\n\t\t\t\ttable[i][Col] += table[i][j];\n\t\t\t}\n\t\t}",
"for(int j = 0; j < Col; j++){\n\t\t\t\ttable[i][Col] += table[i][j];\n\t\t\t}",
"int j = 0;",
"int j = 0;",
"j",
"0",
"j < Col",
"j",
"Col",
"j++",
"j++",
"j",
"{\n\t\t\t\ttable[i][Col] += table[i][j];\n\t\t\t}",
"{\n\t\t\t\ttable[i][Col] += table[i][j];\n\t\t\t}",
"table[i][Col] += table[i][j]",
"table[i][Col]",
"table[i]",
"table",
"i",
"Col",
"table[i][j]",
"table[i]",
"table",
"i",
"j",
"for(int i = 0; i <= Col; i++){\n\t\t\tfor(int j = 0; j < Row; j++){\n\t\t\t\ttable[Row][i] += table[j][i];\n\t\t\t}\n\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i <= Col",
"i",
"Col",
"i++",
"i++",
"i",
"{\n\t\t\tfor(int j = 0; j < Row; j++){\n\t\t\t\ttable[Row][i] += table[j][i];\n\t\t\t}\n\t\t}",
"{\n\t\t\tfor(int j = 0; j < Row; j++){\n\t\t\t\ttable[Row][i] += table[j][i];\n\t\t\t}\n\t\t}",
"for(int j = 0; j < Row; j++){\n\t\t\t\ttable[Row][i] += table[j][i];\n\t\t\t}",
"int j = 0;",
"int j = 0;",
"j",
"0",
"j < Row",
"j",
"Row",
"j++",
"j++",
"j",
"{\n\t\t\t\ttable[Row][i] += table[j][i];\n\t\t\t}",
"{\n\t\t\t\ttable[Row][i] += table[j][i];\n\t\t\t}",
"table[Row][i] += table[j][i]",
"table[Row][i]",
"table[Row]",
"table",
"Row",
"i",
"table[j][i]",
"table[j]",
"table",
"j",
"i",
"for(int i = 0; i <= Row; i++){\n\t\t\tSystem.out.printf(\"%d\", table[i][0]);\n\t\t\tfor(int j = 1; j <= Col; j++){\n\t\t\t\tSystem.out.printf(\" %d\", table[i][j]);\n\t\t\t}\n\t\t\tSystem.out.printf(\"\\n\");\n\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i <= Row",
"i",
"Row",
"i++",
"i++",
"i",
"{\n\t\t\tSystem.out.printf(\"%d\", table[i][0]);\n\t\t\tfor(int j = 1; j <= Col; j++){\n\t\t\t\tSystem.out.printf(\" %d\", table[i][j]);\n\t\t\t}\n\t\t\tSystem.out.printf(\"\\n\");\n\t\t}",
"{\n\t\t\tSystem.out.printf(\"%d\", table[i][0]);\n\t\t\tfor(int j = 1; j <= Col; j++){\n\t\t\t\tSystem.out.printf(\" %d\", table[i][j]);\n\t\t\t}\n\t\t\tSystem.out.printf(\"\\n\");\n\t\t}",
"System.out.printf(\"%d\", table[i][0])",
"System.out.printf",
"System.out",
"System",
"System.out",
"\"%d\"",
"table[i][0]",
"table[i]",
"table",
"i",
"0",
"for(int j = 1; j <= Col; j++){\n\t\t\t\tSystem.out.printf(\" %d\", table[i][j]);\n\t\t\t}",
"int j = 1;",
"int j = 1;",
"j",
"1",
"j <= Col",
"j",
"Col",
"j++",
"j++",
"j",
"{\n\t\t\t\tSystem.out.printf(\" %d\", table[i][j]);\n\t\t\t}",
"{\n\t\t\t\tSystem.out.printf(\" %d\", table[i][j]);\n\t\t\t}",
"System.out.printf(\" %d\", table[i][j])",
"System.out.printf",
"System.out",
"System",
"System.out",
"\" %d\"",
"table[i][j]",
"table[i]",
"table",
"i",
"j",
"System.out.printf(\"\\n\")",
"System.out.printf",
"System.out",
"System",
"System.out",
"\"\\n\"",
"String[] args",
"args",
"public class Main{\n public static void main(String[] args){\n Scanner sc = new Scanner(System.in);\n int Row=sc.nextInt();\n int Col=sc.nextInt();\n int table[][] =new int[Row+1][Col+1];\n for(int i=0;i<Row;i++){\n for(int j=0;j<Col;j++){\n table[i][j]=sc.nextInt();\n }\n }\n for(int i = 0; i < Row; i++){\n\t\t\tfor(int j = 0; j < Col; j++){\n\t\t\t\ttable[i][Col] += table[i][j];\n\t\t\t}\n\t\t}\n\n\t\tfor(int i = 0; i <= Col; i++){\n\t\t\tfor(int j = 0; j < Row; j++){\n\t\t\t\ttable[Row][i] += table[j][i];\n\t\t\t}\n\t\t}\n\n\t\tfor(int i = 0; i <= Row; i++){\n\t\t\tSystem.out.printf(\"%d\", table[i][0]);\n\t\t\tfor(int j = 1; j <= Col; j++){\n\t\t\t\tSystem.out.printf(\" %d\", table[i][j]);\n\t\t\t}\n\t\t\tSystem.out.printf(\"\\n\");\n\t\t}\n }\n}",
"public class Main{\n public static void main(String[] args){\n Scanner sc = new Scanner(System.in);\n int Row=sc.nextInt();\n int Col=sc.nextInt();\n int table[][] =new int[Row+1][Col+1];\n for(int i=0;i<Row;i++){\n for(int j=0;j<Col;j++){\n table[i][j]=sc.nextInt();\n }\n }\n for(int i = 0; i < Row; i++){\n\t\t\tfor(int j = 0; j < Col; j++){\n\t\t\t\ttable[i][Col] += table[i][j];\n\t\t\t}\n\t\t}\n\n\t\tfor(int i = 0; i <= Col; i++){\n\t\t\tfor(int j = 0; j < Row; j++){\n\t\t\t\ttable[Row][i] += table[j][i];\n\t\t\t}\n\t\t}\n\n\t\tfor(int i = 0; i <= Row; i++){\n\t\t\tSystem.out.printf(\"%d\", table[i][0]);\n\t\t\tfor(int j = 1; j <= Col; j++){\n\t\t\t\tSystem.out.printf(\" %d\", table[i][j]);\n\t\t\t}\n\t\t\tSystem.out.printf(\"\\n\");\n\t\t}\n }\n}",
"Main"
] | import java.util.*;
public class Main{
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
int Row=sc.nextInt();
int Col=sc.nextInt();
int table[][] =new int[Row+1][Col+1];
for(int i=0;i<Row;i++){
for(int j=0;j<Col;j++){
table[i][j]=sc.nextInt();
}
}
for(int i = 0; i < Row; i++){
for(int j = 0; j < Col; j++){
table[i][Col] += table[i][j];
}
}
for(int i = 0; i <= Col; i++){
for(int j = 0; j < Row; j++){
table[Row][i] += table[j][i];
}
}
for(int i = 0; i <= Row; i++){
System.out.printf("%d", table[i][0]);
for(int j = 1; j <= Col; j++){
System.out.printf(" %d", table[i][j]);
}
System.out.printf("\n");
}
}
}
|
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
41,
13,
41,
13,
17,
0,
13,
4,
18,
13,
0,
13,
4,
18,
13,
41,
13,
20,
13,
13,
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,
18,
18,
13,
13,
13,
4,
18,
13,
0,
13,
18,
18,
13,
13,
13,
4,
18,
18,
13,
13,
2,
18,
18,
13,
13,
13,
17,
0,
13,
13,
4,
18,
18,
13,
13,
13,
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,
18,
18,
13,
13,
13,
4,
18,
18,
13,
13,
2,
13,
17,
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
],
[
8,
14
],
[
14,
15
],
[
8,
16
],
[
16,
17
],
[
16,
18
],
[
8,
19
],
[
19,
20
],
[
19,
21
],
[
21,
22
],
[
22,
23
],
[
8,
24
],
[
24,
25
],
[
24,
26
],
[
26,
27
],
[
27,
28
],
[
8,
29
],
[
29,
30
],
[
29,
31
],
[
8,
34
],
[
34,
35
],
[
35,
36
],
[
36,
37
],
[
36,
38
],
[
34,
39
],
[
39,
40
],
[
39,
41
],
[
34,
42
],
[
42,
43
],
[
43,
44
],
[
34,
45
],
[
46,
46
],
[
46,
47
],
[
47,
48
],
[
47,
49
],
[
46,
50
],
[
50,
51
],
[
51,
52
],
[
52,
53
],
[
52,
54
],
[
50,
55
],
[
55,
56
],
[
55,
57
],
[
50,
58
],
[
58,
59
],
[
59,
60
],
[
50,
61
],
[
62,
62
],
[
62,
63
],
[
63,
64
],
[
64,
65
],
[
65,
66
],
[
65,
67
],
[
64,
68
],
[
63,
69
],
[
69,
70
],
[
70,
71
],
[
62,
72
],
[
72,
73
],
[
72,
74
],
[
74,
75
],
[
75,
76
],
[
75,
77
],
[
74,
78
],
[
62,
79
],
[
79,
80
],
[
80,
81
],
[
81,
82
],
[
81,
83
],
[
79,
84
],
[
84,
85
],
[
85,
86
],
[
86,
87
],
[
86,
88
],
[
85,
89
],
[
84,
90
],
[
46,
91
],
[
91,
92
],
[
91,
93
],
[
46,
94
],
[
94,
95
],
[
95,
96
],
[
96,
97
],
[
96,
98
],
[
94,
99
],
[
8,
100
],
[
100,
101
],
[
101,
102
],
[
102,
103
],
[
102,
104
],
[
100,
105
],
[
105,
106
],
[
105,
107
],
[
100,
108
],
[
108,
109
],
[
109,
110
],
[
100,
111
],
[
112,
112
],
[
112,
113
],
[
113,
114
],
[
113,
115
],
[
112,
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
],
[
132,
133
],
[
132,
134
],
[
131,
135
],
[
112,
136
],
[
136,
137
],
[
137,
138
],
[
138,
139
],
[
138,
140
],
[
136,
141
],
[
141,
142
],
[
141,
143
],
[
8,
144
],
[
144,
145
],
[
145,
146
],
[
146,
147
],
[
146,
148
],
[
144,
149
],
[
6,
150
],
[
150,
151
]
] | [
"import java.util.Scanner;\nclass Main\n{\n public static void main(String args[])\n {\n\tScanner scan=new Scanner(System.in);\n\tint r,c,e=0;\n\tr=scan.nextInt();\n\tc=scan.nextInt();\n\tint a[][]=new int[r][c];\n\t\n\tfor(int i=0;i<r;i++)\n\t {\n\t\tint b=0;\n\t\tfor(int j=0;j<c;j++)\n\t\t {\n\t\t\ta[i][j]=scan.nextInt();\n\t\t\tb+=a[i][j];\t\t\t\n\t\t\tSystem.out.print(a[i][j]+\" \");\n\t\t }\n\t\te+=b;\n\t\tSystem.out.println(b);\t\t\t\n\t }\n\tfor(int i=0;i<c;i++)\n\t {\n\t\tint d=0;\n\t\tfor(int j=0;j<r;j++)\n\t\t {\n\t\t\td+=a[j][i];\t\t\t\t\n\t\t }\n\t\tSystem.out.print(d+\" \");\t\n\t }\n\tSystem.out.println(e);\n }\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"class Main\n{\n public static void main(String args[])\n {\n\tScanner scan=new Scanner(System.in);\n\tint r,c,e=0;\n\tr=scan.nextInt();\n\tc=scan.nextInt();\n\tint a[][]=new int[r][c];\n\t\n\tfor(int i=0;i<r;i++)\n\t {\n\t\tint b=0;\n\t\tfor(int j=0;j<c;j++)\n\t\t {\n\t\t\ta[i][j]=scan.nextInt();\n\t\t\tb+=a[i][j];\t\t\t\n\t\t\tSystem.out.print(a[i][j]+\" \");\n\t\t }\n\t\te+=b;\n\t\tSystem.out.println(b);\t\t\t\n\t }\n\tfor(int i=0;i<c;i++)\n\t {\n\t\tint d=0;\n\t\tfor(int j=0;j<r;j++)\n\t\t {\n\t\t\td+=a[j][i];\t\t\t\t\n\t\t }\n\t\tSystem.out.print(d+\" \");\t\n\t }\n\tSystem.out.println(e);\n }\n}",
"Main",
"public static void main(String args[])\n {\n\tScanner scan=new Scanner(System.in);\n\tint r,c,e=0;\n\tr=scan.nextInt();\n\tc=scan.nextInt();\n\tint a[][]=new int[r][c];\n\t\n\tfor(int i=0;i<r;i++)\n\t {\n\t\tint b=0;\n\t\tfor(int j=0;j<c;j++)\n\t\t {\n\t\t\ta[i][j]=scan.nextInt();\n\t\t\tb+=a[i][j];\t\t\t\n\t\t\tSystem.out.print(a[i][j]+\" \");\n\t\t }\n\t\te+=b;\n\t\tSystem.out.println(b);\t\t\t\n\t }\n\tfor(int i=0;i<c;i++)\n\t {\n\t\tint d=0;\n\t\tfor(int j=0;j<r;j++)\n\t\t {\n\t\t\td+=a[j][i];\t\t\t\t\n\t\t }\n\t\tSystem.out.print(d+\" \");\t\n\t }\n\tSystem.out.println(e);\n }",
"main",
"{\n\tScanner scan=new Scanner(System.in);\n\tint r,c,e=0;\n\tr=scan.nextInt();\n\tc=scan.nextInt();\n\tint a[][]=new int[r][c];\n\t\n\tfor(int i=0;i<r;i++)\n\t {\n\t\tint b=0;\n\t\tfor(int j=0;j<c;j++)\n\t\t {\n\t\t\ta[i][j]=scan.nextInt();\n\t\t\tb+=a[i][j];\t\t\t\n\t\t\tSystem.out.print(a[i][j]+\" \");\n\t\t }\n\t\te+=b;\n\t\tSystem.out.println(b);\t\t\t\n\t }\n\tfor(int i=0;i<c;i++)\n\t {\n\t\tint d=0;\n\t\tfor(int j=0;j<r;j++)\n\t\t {\n\t\t\td+=a[j][i];\t\t\t\t\n\t\t }\n\t\tSystem.out.print(d+\" \");\t\n\t }\n\tSystem.out.println(e);\n }",
"Scanner scan=new Scanner(System.in);",
"scan",
"new Scanner(System.in)",
"int r",
"r",
"c",
"c",
"e=0;",
"e",
"0",
"r=scan.nextInt()",
"r",
"scan.nextInt()",
"scan.nextInt",
"scan",
"c=scan.nextInt()",
"c",
"scan.nextInt()",
"scan.nextInt",
"scan",
"int a[][]=new int[r][c];",
"a",
"new int[r][c]",
"r",
"c",
"for(int i=0;i<r;i++)\n\t {\n\t\tint b=0;\n\t\tfor(int j=0;j<c;j++)\n\t\t {\n\t\t\ta[i][j]=scan.nextInt();\n\t\t\tb+=a[i][j];\t\t\t\n\t\t\tSystem.out.print(a[i][j]+\" \");\n\t\t }\n\t\te+=b;\n\t\tSystem.out.println(b);\t\t\t\n\t }",
"int i=0;",
"int i=0;",
"i",
"0",
"i<r",
"i",
"r",
"i++",
"i++",
"i",
"{\n\t\tint b=0;\n\t\tfor(int j=0;j<c;j++)\n\t\t {\n\t\t\ta[i][j]=scan.nextInt();\n\t\t\tb+=a[i][j];\t\t\t\n\t\t\tSystem.out.print(a[i][j]+\" \");\n\t\t }\n\t\te+=b;\n\t\tSystem.out.println(b);\t\t\t\n\t }",
"{\n\t\tint b=0;\n\t\tfor(int j=0;j<c;j++)\n\t\t {\n\t\t\ta[i][j]=scan.nextInt();\n\t\t\tb+=a[i][j];\t\t\t\n\t\t\tSystem.out.print(a[i][j]+\" \");\n\t\t }\n\t\te+=b;\n\t\tSystem.out.println(b);\t\t\t\n\t }",
"int b=0;",
"b",
"0",
"for(int j=0;j<c;j++)\n\t\t {\n\t\t\ta[i][j]=scan.nextInt();\n\t\t\tb+=a[i][j];\t\t\t\n\t\t\tSystem.out.print(a[i][j]+\" \");\n\t\t }",
"int j=0;",
"int j=0;",
"j",
"0",
"j<c",
"j",
"c",
"j++",
"j++",
"j",
"{\n\t\t\ta[i][j]=scan.nextInt();\n\t\t\tb+=a[i][j];\t\t\t\n\t\t\tSystem.out.print(a[i][j]+\" \");\n\t\t }",
"{\n\t\t\ta[i][j]=scan.nextInt();\n\t\t\tb+=a[i][j];\t\t\t\n\t\t\tSystem.out.print(a[i][j]+\" \");\n\t\t }",
"a[i][j]=scan.nextInt()",
"a[i][j]",
"a[i]",
"a",
"i",
"j",
"scan.nextInt()",
"scan.nextInt",
"scan",
"b+=a[i][j]",
"b",
"a[i][j]",
"a[i]",
"a",
"i",
"j",
"System.out.print(a[i][j]+\" \")",
"System.out.print",
"System.out",
"System",
"System.out",
"a[i][j]+\" \"",
"a[i][j]",
"a[i]",
"a",
"i",
"j",
"\" \"",
"e+=b",
"e",
"b",
"System.out.println(b)",
"System.out.println",
"System.out",
"System",
"System.out",
"b",
"for(int i=0;i<c;i++)\n\t {\n\t\tint d=0;\n\t\tfor(int j=0;j<r;j++)\n\t\t {\n\t\t\td+=a[j][i];\t\t\t\t\n\t\t }\n\t\tSystem.out.print(d+\" \");\t\n\t }",
"int i=0;",
"int i=0;",
"i",
"0",
"i<c",
"i",
"c",
"i++",
"i++",
"i",
"{\n\t\tint d=0;\n\t\tfor(int j=0;j<r;j++)\n\t\t {\n\t\t\td+=a[j][i];\t\t\t\t\n\t\t }\n\t\tSystem.out.print(d+\" \");\t\n\t }",
"{\n\t\tint d=0;\n\t\tfor(int j=0;j<r;j++)\n\t\t {\n\t\t\td+=a[j][i];\t\t\t\t\n\t\t }\n\t\tSystem.out.print(d+\" \");\t\n\t }",
"int d=0;",
"d",
"0",
"for(int j=0;j<r;j++)\n\t\t {\n\t\t\td+=a[j][i];\t\t\t\t\n\t\t }",
"int j=0;",
"int j=0;",
"j",
"0",
"j<r",
"j",
"r",
"j++",
"j++",
"j",
"{\n\t\t\td+=a[j][i];\t\t\t\t\n\t\t }",
"{\n\t\t\td+=a[j][i];\t\t\t\t\n\t\t }",
"d+=a[j][i]",
"d",
"a[j][i]",
"a[j]",
"a",
"j",
"i",
"System.out.print(d+\" \")",
"System.out.print",
"System.out",
"System",
"System.out",
"d+\" \"",
"d",
"\" \"",
"System.out.println(e)",
"System.out.println",
"System.out",
"System",
"System.out",
"e",
"String args[]",
"args"
] | import java.util.Scanner;
class Main
{
public static void main(String args[])
{
Scanner scan=new Scanner(System.in);
int r,c,e=0;
r=scan.nextInt();
c=scan.nextInt();
int a[][]=new int[r][c];
for(int i=0;i<r;i++)
{
int b=0;
for(int j=0;j<c;j++)
{
a[i][j]=scan.nextInt();
b+=a[i][j];
System.out.print(a[i][j]+" ");
}
e+=b;
System.out.println(b);
}
for(int i=0;i<c;i++)
{
int d=0;
for(int j=0;j<r;j++)
{
d+=a[j][i];
}
System.out.print(d+" ");
}
System.out.println(e);
}
} |
[
7,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
4,
18,
13,
17,
41,
13,
4,
18,
13,
18,
13,
17,
41,
13,
4,
18,
13,
18,
13,
17,
41,
13,
20,
13,
13,
41,
13,
41,
13,
17,
41,
13,
17,
41,
13,
17,
41,
13,
17,
41,
13,
17,
42,
2,
0,
13,
4,
18,
13,
17,
30,
41,
13,
4,
18,
13,
17,
11,
1,
2,
13,
18,
13,
13,
1,
40,
13,
30,
30,
41,
13,
4,
18,
13,
18,
13,
13,
0,
18,
18,
13,
13,
13,
13,
0,
13,
17,
40,
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,
13,
18,
18,
13,
13,
13,
4,
18,
18,
13,
13,
2,
18,
18,
13,
13,
13,
17,
4,
18,
18,
13,
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,
0,
13,
18,
18,
13,
13,
13,
4,
18,
18,
13,
13,
2,
13,
17,
0,
13,
13,
0,
13,
17,
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
],
[
12,
14
],
[
11,
15
],
[
15,
16
],
[
15,
17
],
[
17,
18
],
[
18,
19
],
[
19,
20
],
[
20,
21
],
[
17,
22
],
[
11,
23
],
[
23,
24
],
[
23,
25
],
[
25,
26
],
[
26,
27
],
[
25,
28
],
[
28,
29
],
[
28,
30
],
[
11,
31
],
[
31,
32
],
[
31,
33
],
[
33,
34
],
[
34,
35
],
[
33,
36
],
[
36,
37
],
[
36,
38
],
[
11,
39
],
[
39,
40
],
[
39,
41
],
[
11,
44
],
[
44,
45
],
[
11,
46
],
[
46,
47
],
[
46,
48
],
[
11,
49
],
[
49,
50
],
[
49,
51
],
[
11,
52
],
[
52,
53
],
[
52,
54
],
[
11,
55
],
[
55,
56
],
[
55,
57
],
[
11,
58
],
[
58,
59
],
[
58,
60
],
[
11,
61
],
[
61,
62
],
[
62,
63
],
[
63,
64
],
[
63,
65
],
[
65,
66
],
[
66,
67
],
[
62,
68
],
[
61,
69
],
[
69,
70
],
[
70,
71
],
[
70,
72
],
[
72,
73
],
[
73,
74
],
[
72,
75
],
[
69,
76
],
[
76,
77
],
[
76,
78
],
[
78,
79
],
[
78,
80
],
[
80,
81
],
[
80,
82
],
[
76,
83
],
[
83,
84
],
[
84,
85
],
[
76,
86
],
[
87,
87
],
[
87,
88
],
[
88,
89
],
[
88,
90
],
[
90,
91
],
[
91,
92
],
[
90,
93
],
[
93,
94
],
[
93,
95
],
[
87,
96
],
[
96,
97
],
[
97,
98
],
[
98,
99
],
[
98,
100
],
[
97,
101
],
[
96,
102
],
[
69,
103
],
[
103,
104
],
[
103,
105
],
[
69,
106
],
[
106,
107
],
[
11,
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
],
[
137,
138
],
[
137,
139
],
[
136,
140
],
[
133,
141
],
[
141,
142
],
[
142,
143
],
[
143,
144
],
[
143,
145
],
[
141,
146
],
[
146,
147
],
[
147,
148
],
[
148,
149
],
[
148,
150
],
[
147,
151
],
[
146,
152
],
[
120,
153
],
[
153,
154
],
[
154,
155
],
[
155,
156
],
[
155,
157
],
[
153,
158
],
[
120,
159
],
[
159,
160
],
[
159,
161
],
[
11,
162
],
[
162,
163
],
[
163,
164
],
[
164,
165
],
[
164,
166
],
[
162,
167
],
[
167,
168
],
[
167,
169
],
[
162,
170
],
[
170,
171
],
[
171,
172
],
[
162,
173
],
[
174,
174
],
[
174,
175
],
[
175,
176
],
[
176,
177
],
[
177,
178
],
[
177,
179
],
[
175,
180
],
[
180,
181
],
[
180,
182
],
[
175,
183
],
[
183,
184
],
[
184,
185
],
[
175,
186
],
[
187,
187
],
[
187,
188
],
[
188,
189
],
[
188,
190
],
[
190,
191
],
[
191,
192
],
[
191,
193
],
[
190,
194
],
[
174,
195
],
[
195,
196
],
[
196,
197
],
[
197,
198
],
[
197,
199
],
[
195,
200
],
[
200,
201
],
[
200,
202
],
[
174,
203
],
[
203,
204
],
[
203,
205
],
[
174,
206
],
[
206,
207
],
[
206,
208
],
[
11,
209
],
[
209,
210
],
[
210,
211
],
[
211,
212
],
[
211,
213
],
[
209,
214
],
[
9,
215
],
[
215,
216
]
] | [
"import java.io.*;\nimport java.util.*;\n \nclass Main{\n public static void main(String args[])throws IOException{\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n String[] s = br.readLine().split(\" \");\n int r = Integer.parseInt(s[0]);\n int c = Integer.parseInt(s[1]);\n int[][] num = new int[r][c];\n String str;\n int i=0;\n int j=0;\n int sum1=0,sum2=0,sum3=0;\n while((str=br.readLine())!=null){\n String[] sg = str.split(\" \");\n for(; i<sg.length; i++){\n int a = Integer.parseInt(sg[i]);\n num[j][i] = a;\n }\n i=0;\n j++;\n }\n for(int k=0; k<r; k++){\n for(int l=0; l<c; l++){\n sum1 += num[k][l];\n System.out.print(num[k][l]+\" \");\n }\n System.out.println(sum1);\n sum1=0;\n }\n for(int k=0; k<c; k++){\n for(int l=0; l<r; l++){\n sum2 += num[l][k];\n }\n System.out.print(sum2+ \" \");\n sum3 += sum2;\n sum2=0;\n }\n System.out.println(sum3);\n }\n}",
"import java.io.*;",
"io.*",
"java",
"import java.util.*;",
"util.*",
"java",
"class Main{\n public static void main(String args[])throws IOException{\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n String[] s = br.readLine().split(\" \");\n int r = Integer.parseInt(s[0]);\n int c = Integer.parseInt(s[1]);\n int[][] num = new int[r][c];\n String str;\n int i=0;\n int j=0;\n int sum1=0,sum2=0,sum3=0;\n while((str=br.readLine())!=null){\n String[] sg = str.split(\" \");\n for(; i<sg.length; i++){\n int a = Integer.parseInt(sg[i]);\n num[j][i] = a;\n }\n i=0;\n j++;\n }\n for(int k=0; k<r; k++){\n for(int l=0; l<c; l++){\n sum1 += num[k][l];\n System.out.print(num[k][l]+\" \");\n }\n System.out.println(sum1);\n sum1=0;\n }\n for(int k=0; k<c; k++){\n for(int l=0; l<r; l++){\n sum2 += num[l][k];\n }\n System.out.print(sum2+ \" \");\n sum3 += sum2;\n sum2=0;\n }\n System.out.println(sum3);\n }\n}",
"Main",
"public static void main(String args[])throws IOException{\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n String[] s = br.readLine().split(\" \");\n int r = Integer.parseInt(s[0]);\n int c = Integer.parseInt(s[1]);\n int[][] num = new int[r][c];\n String str;\n int i=0;\n int j=0;\n int sum1=0,sum2=0,sum3=0;\n while((str=br.readLine())!=null){\n String[] sg = str.split(\" \");\n for(; i<sg.length; i++){\n int a = Integer.parseInt(sg[i]);\n num[j][i] = a;\n }\n i=0;\n j++;\n }\n for(int k=0; k<r; k++){\n for(int l=0; l<c; l++){\n sum1 += num[k][l];\n System.out.print(num[k][l]+\" \");\n }\n System.out.println(sum1);\n sum1=0;\n }\n for(int k=0; k<c; k++){\n for(int l=0; l<r; l++){\n sum2 += num[l][k];\n }\n System.out.print(sum2+ \" \");\n sum3 += sum2;\n sum2=0;\n }\n System.out.println(sum3);\n }",
"main",
"{\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n String[] s = br.readLine().split(\" \");\n int r = Integer.parseInt(s[0]);\n int c = Integer.parseInt(s[1]);\n int[][] num = new int[r][c];\n String str;\n int i=0;\n int j=0;\n int sum1=0,sum2=0,sum3=0;\n while((str=br.readLine())!=null){\n String[] sg = str.split(\" \");\n for(; i<sg.length; i++){\n int a = Integer.parseInt(sg[i]);\n num[j][i] = a;\n }\n i=0;\n j++;\n }\n for(int k=0; k<r; k++){\n for(int l=0; l<c; l++){\n sum1 += num[k][l];\n System.out.print(num[k][l]+\" \");\n }\n System.out.println(sum1);\n sum1=0;\n }\n for(int k=0; k<c; k++){\n for(int l=0; l<r; l++){\n sum2 += num[l][k];\n }\n System.out.print(sum2+ \" \");\n sum3 += sum2;\n sum2=0;\n }\n System.out.println(sum3);\n }",
"BufferedReader br = new BufferedReader(new InputStreamReader(System.in));",
"br",
"new BufferedReader(new InputStreamReader(System.in))",
"String[] s = br.readLine().split(\" \");",
"s",
"br.readLine().split(\" \")",
"br.readLine().split",
"br.readLine()",
"br.readLine",
"br",
"\" \"",
"int r = Integer.parseInt(s[0]);",
"r",
"Integer.parseInt(s[0])",
"Integer.parseInt",
"Integer",
"s[0]",
"s",
"0",
"int c = Integer.parseInt(s[1]);",
"c",
"Integer.parseInt(s[1])",
"Integer.parseInt",
"Integer",
"s[1]",
"s",
"1",
"int[][] num = new int[r][c];",
"num",
"new int[r][c]",
"r",
"c",
"String str;",
"str",
"int i=0;",
"i",
"0",
"int j=0;",
"j",
"0",
"int sum1=0",
"sum1",
"0",
"sum2=0",
"sum2",
"0",
"sum3=0;",
"sum3",
"0",
"while((str=br.readLine())!=null){\n String[] sg = str.split(\" \");\n for(; i<sg.length; i++){\n int a = Integer.parseInt(sg[i]);\n num[j][i] = a;\n }\n i=0;\n j++;\n }",
"(str=br.readLine())!=null",
"(str=br.readLine())",
"str",
"br.readLine()",
"br.readLine",
"br",
"null",
"{\n String[] sg = str.split(\" \");\n for(; i<sg.length; i++){\n int a = Integer.parseInt(sg[i]);\n num[j][i] = a;\n }\n i=0;\n j++;\n }",
"String[] sg = str.split(\" \");",
"sg",
"str.split(\" \")",
"str.split",
"str",
"\" \"",
"for(; i<sg.length; i++){\n int a = Integer.parseInt(sg[i]);\n num[j][i] = a;\n }",
";",
"i<sg.length",
"i",
"sg.length",
"sg",
"sg.length",
"i++",
"i++",
"i",
"{\n int a = Integer.parseInt(sg[i]);\n num[j][i] = a;\n }",
"{\n int a = Integer.parseInt(sg[i]);\n num[j][i] = a;\n }",
"int a = Integer.parseInt(sg[i]);",
"a",
"Integer.parseInt(sg[i])",
"Integer.parseInt",
"Integer",
"sg[i]",
"sg",
"i",
"num[j][i] = a",
"num[j][i]",
"num[j]",
"num",
"j",
"i",
"a",
"i=0",
"i",
"0",
"j++",
"j",
"for(int k=0; k<r; k++){\n for(int l=0; l<c; l++){\n sum1 += num[k][l];\n System.out.print(num[k][l]+\" \");\n }\n System.out.println(sum1);\n sum1=0;\n }",
"int k=0;",
"int k=0;",
"k",
"0",
"k<r",
"k",
"r",
"k++",
"k++",
"k",
"{\n for(int l=0; l<c; l++){\n sum1 += num[k][l];\n System.out.print(num[k][l]+\" \");\n }\n System.out.println(sum1);\n sum1=0;\n }",
"{\n for(int l=0; l<c; l++){\n sum1 += num[k][l];\n System.out.print(num[k][l]+\" \");\n }\n System.out.println(sum1);\n sum1=0;\n }",
"for(int l=0; l<c; l++){\n sum1 += num[k][l];\n System.out.print(num[k][l]+\" \");\n }",
"int l=0;",
"int l=0;",
"l",
"0",
"l<c",
"l",
"c",
"l++",
"l++",
"l",
"{\n sum1 += num[k][l];\n System.out.print(num[k][l]+\" \");\n }",
"{\n sum1 += num[k][l];\n System.out.print(num[k][l]+\" \");\n }",
"sum1 += num[k][l]",
"sum1",
"num[k][l]",
"num[k]",
"num",
"k",
"l",
"System.out.print(num[k][l]+\" \")",
"System.out.print",
"System.out",
"System",
"System.out",
"num[k][l]+\" \"",
"num[k][l]",
"num[k]",
"num",
"k",
"l",
"\" \"",
"System.out.println(sum1)",
"System.out.println",
"System.out",
"System",
"System.out",
"sum1",
"sum1=0",
"sum1",
"0",
"for(int k=0; k<c; k++){\n for(int l=0; l<r; l++){\n sum2 += num[l][k];\n }\n System.out.print(sum2+ \" \");\n sum3 += sum2;\n sum2=0;\n }",
"int k=0;",
"int k=0;",
"k",
"0",
"k<c",
"k",
"c",
"k++",
"k++",
"k",
"{\n for(int l=0; l<r; l++){\n sum2 += num[l][k];\n }\n System.out.print(sum2+ \" \");\n sum3 += sum2;\n sum2=0;\n }",
"{\n for(int l=0; l<r; l++){\n sum2 += num[l][k];\n }\n System.out.print(sum2+ \" \");\n sum3 += sum2;\n sum2=0;\n }",
"for(int l=0; l<r; l++){\n sum2 += num[l][k];\n }",
"int l=0;",
"int l=0;",
"l",
"0",
"l<r",
"l",
"r",
"l++",
"l++",
"l",
"{\n sum2 += num[l][k];\n }",
"{\n sum2 += num[l][k];\n }",
"sum2 += num[l][k]",
"sum2",
"num[l][k]",
"num[l]",
"num",
"l",
"k",
"System.out.print(sum2+ \" \")",
"System.out.print",
"System.out",
"System",
"System.out",
"sum2+ \" \"",
"sum2",
"\" \"",
"sum3 += sum2",
"sum3",
"sum2",
"sum2=0",
"sum2",
"0",
"System.out.println(sum3)",
"System.out.println",
"System.out",
"System",
"System.out",
"sum3",
"String args[]",
"args"
] | import java.io.*;
import java.util.*;
class Main{
public static void main(String args[])throws IOException{
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
String[] s = br.readLine().split(" ");
int r = Integer.parseInt(s[0]);
int c = Integer.parseInt(s[1]);
int[][] num = new int[r][c];
String str;
int i=0;
int j=0;
int sum1=0,sum2=0,sum3=0;
while((str=br.readLine())!=null){
String[] sg = str.split(" ");
for(; i<sg.length; i++){
int a = Integer.parseInt(sg[i]);
num[j][i] = a;
}
i=0;
j++;
}
for(int k=0; k<r; k++){
for(int l=0; l<c; l++){
sum1 += num[k][l];
System.out.print(num[k][l]+" ");
}
System.out.println(sum1);
sum1=0;
}
for(int k=0; k<c; k++){
for(int l=0; l<r; l++){
sum2 += num[l][k];
}
System.out.print(sum2+ " ");
sum3 += sum2;
sum2=0;
}
System.out.println(sum3);
}
} |
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
41,
13,
20,
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,
41,
13,
4,
18,
13,
0,
18,
13,
13,
13,
0,
13,
13,
4,
18,
18,
13,
13,
2,
13,
17,
0,
13,
13,
4,
18,
18,
13,
13,
13,
0,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
4,
18,
18,
13,
13,
2,
18,
13,
13,
17,
4,
18,
18,
13,
13,
13,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
129,
11
],
[
129,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
15,
17
],
[
14,
18
],
[
18,
19
],
[
18,
20
],
[
20,
21
],
[
21,
22
],
[
14,
23
],
[
23,
24
],
[
23,
25
],
[
25,
26
],
[
26,
27
],
[
14,
28
],
[
28,
29
],
[
28,
30
],
[
14,
32
],
[
32,
33
],
[
32,
34
],
[
14,
35
],
[
35,
36
],
[
35,
37
],
[
14,
38
],
[
38,
39
],
[
39,
40
],
[
40,
41
],
[
40,
42
],
[
38,
43
],
[
43,
44
],
[
43,
45
],
[
38,
46
],
[
46,
47
],
[
47,
48
],
[
38,
49
],
[
50,
50
],
[
50,
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
],
[
64,
66
],
[
66,
67
],
[
67,
68
],
[
63,
69
],
[
69,
70
],
[
70,
71
],
[
70,
72
],
[
69,
73
],
[
63,
74
],
[
74,
75
],
[
74,
76
],
[
63,
77
],
[
77,
78
],
[
78,
79
],
[
79,
80
],
[
79,
81
],
[
77,
82
],
[
82,
83
],
[
82,
84
],
[
50,
85
],
[
85,
86
],
[
85,
87
],
[
50,
88
],
[
88,
89
],
[
89,
90
],
[
90,
91
],
[
90,
92
],
[
88,
93
],
[
50,
94
],
[
94,
95
],
[
94,
96
],
[
14,
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
],
[
116,
117
],
[
116,
118
],
[
115,
119
],
[
14,
120
],
[
120,
121
],
[
121,
122
],
[
122,
123
],
[
122,
124
],
[
120,
125
],
[
12,
126
],
[
126,
127
],
[
0,
128
],
[
128,
129
],
[
128,
130
]
] | [
"import java.io.BufferedReader;\nimport java.io.InputStreamReader;\nimport java.util.*;\npublic class Main {\n public static void main(String[] args) throws Exception {\n Scanner sc = new Scanner(System.in);\n int row = sc.nextInt();//row\n int col = sc.nextInt();//col\n int[] sum_v = new int[col];\n int sum_h = 0;\n int sum = 0;\n for(int i=0;i<row;i++){\n for(int j=0;j<col;j++){\n int tmp = sc.nextInt();\n sum_v[j] += tmp;\n sum += tmp;\n System.out.print(tmp + \" \");\n }\n sum_h += sum;\n System.out.println(sum);\n sum=0;\n }\n for(int i=0;i<col;i++){\n System.out.print(sum_v[i] + \" \");\n }\n System.out.println(sum_h);\n }\n}",
"import java.io.BufferedReader;",
"BufferedReader",
"java.io",
"import java.io.InputStreamReader;",
"InputStreamReader",
"java.io",
"import java.util.*;",
"util.*",
"java",
"public class Main {\n public static void main(String[] args) throws Exception {\n Scanner sc = new Scanner(System.in);\n int row = sc.nextInt();//row\n int col = sc.nextInt();//col\n int[] sum_v = new int[col];\n int sum_h = 0;\n int sum = 0;\n for(int i=0;i<row;i++){\n for(int j=0;j<col;j++){\n int tmp = sc.nextInt();\n sum_v[j] += tmp;\n sum += tmp;\n System.out.print(tmp + \" \");\n }\n sum_h += sum;\n System.out.println(sum);\n sum=0;\n }\n for(int i=0;i<col;i++){\n System.out.print(sum_v[i] + \" \");\n }\n System.out.println(sum_h);\n }\n}",
"Main",
"public static void main(String[] args) throws Exception {\n Scanner sc = new Scanner(System.in);\n int row = sc.nextInt();//row\n int col = sc.nextInt();//col\n int[] sum_v = new int[col];\n int sum_h = 0;\n int sum = 0;\n for(int i=0;i<row;i++){\n for(int j=0;j<col;j++){\n int tmp = sc.nextInt();\n sum_v[j] += tmp;\n sum += tmp;\n System.out.print(tmp + \" \");\n }\n sum_h += sum;\n System.out.println(sum);\n sum=0;\n }\n for(int i=0;i<col;i++){\n System.out.print(sum_v[i] + \" \");\n }\n System.out.println(sum_h);\n }",
"main",
"{\n Scanner sc = new Scanner(System.in);\n int row = sc.nextInt();//row\n int col = sc.nextInt();//col\n int[] sum_v = new int[col];\n int sum_h = 0;\n int sum = 0;\n for(int i=0;i<row;i++){\n for(int j=0;j<col;j++){\n int tmp = sc.nextInt();\n sum_v[j] += tmp;\n sum += tmp;\n System.out.print(tmp + \" \");\n }\n sum_h += sum;\n System.out.println(sum);\n sum=0;\n }\n for(int i=0;i<col;i++){\n System.out.print(sum_v[i] + \" \");\n }\n System.out.println(sum_h);\n }",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"int row = sc.nextInt();",
"row",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int col = sc.nextInt();",
"col",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int[] sum_v = new int[col];",
"sum_v",
"new int[col]",
"col",
"int sum_h = 0;",
"sum_h",
"0",
"int sum = 0;",
"sum",
"0",
"for(int i=0;i<row;i++){\n for(int j=0;j<col;j++){\n int tmp = sc.nextInt();\n sum_v[j] += tmp;\n sum += tmp;\n System.out.print(tmp + \" \");\n }\n sum_h += sum;\n System.out.println(sum);\n sum=0;\n }",
"int i=0;",
"int i=0;",
"i",
"0",
"i<row",
"i",
"row",
"i++",
"i++",
"i",
"{\n for(int j=0;j<col;j++){\n int tmp = sc.nextInt();\n sum_v[j] += tmp;\n sum += tmp;\n System.out.print(tmp + \" \");\n }\n sum_h += sum;\n System.out.println(sum);\n sum=0;\n }",
"{\n for(int j=0;j<col;j++){\n int tmp = sc.nextInt();\n sum_v[j] += tmp;\n sum += tmp;\n System.out.print(tmp + \" \");\n }\n sum_h += sum;\n System.out.println(sum);\n sum=0;\n }",
"for(int j=0;j<col;j++){\n int tmp = sc.nextInt();\n sum_v[j] += tmp;\n sum += tmp;\n System.out.print(tmp + \" \");\n }",
"int j=0;",
"int j=0;",
"j",
"0",
"j<col",
"j",
"col",
"j++",
"j++",
"j",
"{\n int tmp = sc.nextInt();\n sum_v[j] += tmp;\n sum += tmp;\n System.out.print(tmp + \" \");\n }",
"{\n int tmp = sc.nextInt();\n sum_v[j] += tmp;\n sum += tmp;\n System.out.print(tmp + \" \");\n }",
"int tmp = sc.nextInt();",
"tmp",
"sc.nextInt()",
"sc.nextInt",
"sc",
"sum_v[j] += tmp",
"sum_v[j]",
"sum_v",
"j",
"tmp",
"sum += tmp",
"sum",
"tmp",
"System.out.print(tmp + \" \")",
"System.out.print",
"System.out",
"System",
"System.out",
"tmp + \" \"",
"tmp",
"\" \"",
"sum_h += sum",
"sum_h",
"sum",
"System.out.println(sum)",
"System.out.println",
"System.out",
"System",
"System.out",
"sum",
"sum=0",
"sum",
"0",
"for(int i=0;i<col;i++){\n System.out.print(sum_v[i] + \" \");\n }",
"int i=0;",
"int i=0;",
"i",
"0",
"i<col",
"i",
"col",
"i++",
"i++",
"i",
"{\n System.out.print(sum_v[i] + \" \");\n }",
"{\n System.out.print(sum_v[i] + \" \");\n }",
"System.out.print(sum_v[i] + \" \")",
"System.out.print",
"System.out",
"System",
"System.out",
"sum_v[i] + \" \"",
"sum_v[i]",
"sum_v",
"i",
"\" \"",
"System.out.println(sum_h)",
"System.out.println",
"System.out",
"System",
"System.out",
"sum_h",
"String[] args",
"args",
"public class Main {\n public static void main(String[] args) throws Exception {\n Scanner sc = new Scanner(System.in);\n int row = sc.nextInt();//row\n int col = sc.nextInt();//col\n int[] sum_v = new int[col];\n int sum_h = 0;\n int sum = 0;\n for(int i=0;i<row;i++){\n for(int j=0;j<col;j++){\n int tmp = sc.nextInt();\n sum_v[j] += tmp;\n sum += tmp;\n System.out.print(tmp + \" \");\n }\n sum_h += sum;\n System.out.println(sum);\n sum=0;\n }\n for(int i=0;i<col;i++){\n System.out.print(sum_v[i] + \" \");\n }\n System.out.println(sum_h);\n }\n}",
"public class Main {\n public static void main(String[] args) throws Exception {\n Scanner sc = new Scanner(System.in);\n int row = sc.nextInt();//row\n int col = sc.nextInt();//col\n int[] sum_v = new int[col];\n int sum_h = 0;\n int sum = 0;\n for(int i=0;i<row;i++){\n for(int j=0;j<col;j++){\n int tmp = sc.nextInt();\n sum_v[j] += tmp;\n sum += tmp;\n System.out.print(tmp + \" \");\n }\n sum_h += sum;\n System.out.println(sum);\n sum=0;\n }\n for(int i=0;i<col;i++){\n System.out.print(sum_v[i] + \" \");\n }\n System.out.println(sum_h);\n }\n}",
"Main"
] | import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.*;
public class Main {
public static void main(String[] args) throws Exception {
Scanner sc = new Scanner(System.in);
int row = sc.nextInt();//row
int col = sc.nextInt();//col
int[] sum_v = new int[col];
int sum_h = 0;
int sum = 0;
for(int i=0;i<row;i++){
for(int j=0;j<col;j++){
int tmp = sc.nextInt();
sum_v[j] += tmp;
sum += tmp;
System.out.print(tmp + " ");
}
sum_h += sum;
System.out.println(sum);
sum=0;
}
for(int i=0;i<col;i++){
System.out.print(sum_v[i] + " ");
}
System.out.println(sum_h);
}
} |
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
41,
13,
41,
13,
41,
13,
41,
13,
17,
41,
13,
17,
41,
13,
20,
17,
17,
0,
13,
4,
18,
13,
0,
13,
4,
18,
13,
11,
1,
0,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
11,
1,
0,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
18,
18,
13,
13,
13,
4,
18,
13,
0,
13,
18,
18,
13,
13,
13,
0,
18,
18,
13,
13,
13,
13,
0,
13,
17,
11,
1,
0,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
11,
1,
0,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
18,
18,
13,
13,
13,
0,
18,
18,
13,
13,
13,
13,
0,
13,
17,
11,
1,
0,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
11,
1,
0,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
4,
18,
18,
13,
13,
2,
18,
18,
13,
13,
13,
17,
4,
18,
18,
13,
13,
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
],
[
8,
14
],
[
14,
15
],
[
8,
16
],
[
16,
17
],
[
8,
18
],
[
18,
19
],
[
8,
20
],
[
20,
21
],
[
20,
22
],
[
8,
23
],
[
23,
24
],
[
23,
25
],
[
8,
26
],
[
26,
27
],
[
26,
28
],
[
8,
31
],
[
31,
32
],
[
31,
33
],
[
33,
34
],
[
34,
35
],
[
8,
36
],
[
36,
37
],
[
36,
38
],
[
38,
39
],
[
39,
40
],
[
8,
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
],
[
68,
72
],
[
67,
73
],
[
73,
74
],
[
74,
75
],
[
66,
76
],
[
76,
77
],
[
76,
78
],
[
78,
79
],
[
79,
80
],
[
79,
81
],
[
78,
82
],
[
53,
83
],
[
83,
84
],
[
84,
85
],
[
85,
86
],
[
85,
87
],
[
84,
88
],
[
83,
89
],
[
53,
90
],
[
90,
91
],
[
90,
92
],
[
8,
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
],
[
122,
124
],
[
121,
125
],
[
105,
126
],
[
126,
127
],
[
127,
128
],
[
128,
129
],
[
128,
130
],
[
127,
131
],
[
126,
132
],
[
105,
133
],
[
133,
134
],
[
133,
135
],
[
8,
136
],
[
136,
137
],
[
137,
138
],
[
138,
139
],
[
138,
140
],
[
136,
141
],
[
141,
142
],
[
141,
143
],
[
136,
144
],
[
144,
145
],
[
145,
146
],
[
136,
147
],
[
148,
148
],
[
148,
149
],
[
149,
150
],
[
150,
151
],
[
151,
152
],
[
151,
153
],
[
149,
154
],
[
154,
155
],
[
154,
156
],
[
149,
157
],
[
157,
158
],
[
158,
159
],
[
149,
160
],
[
161,
161
],
[
161,
162
],
[
162,
163
],
[
163,
164
],
[
164,
165
],
[
164,
166
],
[
162,
167
],
[
167,
168
],
[
168,
169
],
[
169,
170
],
[
169,
171
],
[
168,
172
],
[
167,
173
],
[
148,
174
],
[
174,
175
],
[
175,
176
],
[
176,
177
],
[
176,
178
],
[
174,
179
],
[
179,
180
],
[
180,
181
],
[
180,
182
],
[
179,
183
],
[
6,
184
],
[
184,
185
]
] | [
"import java.util.Scanner;\n\n class Main{\n\tpublic static void main(String[] args){\n\tScanner scan = new Scanner(System.in);\n\n int r, c, i, j, sum1 = 0, sum2 = 0;\n int data[][] = new int[150][150];\n //scanf(\"%d%d\", &r, &c);\n r = scan.nextInt();\n c = scan.nextInt();\n for (i = 0; i < r; i++) {\n for (j = 0; j < c; j++) {\n //scanf(\"%d\", &data[i][j]);\n \tdata[i][j] = scan.nextInt();\n sum1 += data[i][j];\n }\n data[i][c] = sum1;\n sum1 = 0;\n }\n for (j = 0; j <= c; j++) {\n for (i = 0; i < r; i++) {\n sum2 += data[i][j];\n }\n data[r][j] = sum2;\n sum2 = 0;\n }\n for (i = 0; i <= r; i++) {\n for (j = 0; j < c; j++) {\n //printf(\"%d \", data[i][j]);\n \tSystem.out.print(data[i][j] + \" \");\n }\n //printf(\"%d\\n\", data[i][c]);\n System.out.println(data[i][c]);\n }\n\n\n\t}\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"class Main{\n\tpublic static void main(String[] args){\n\tScanner scan = new Scanner(System.in);\n\n int r, c, i, j, sum1 = 0, sum2 = 0;\n int data[][] = new int[150][150];\n //scanf(\"%d%d\", &r, &c);\n r = scan.nextInt();\n c = scan.nextInt();\n for (i = 0; i < r; i++) {\n for (j = 0; j < c; j++) {\n //scanf(\"%d\", &data[i][j]);\n \tdata[i][j] = scan.nextInt();\n sum1 += data[i][j];\n }\n data[i][c] = sum1;\n sum1 = 0;\n }\n for (j = 0; j <= c; j++) {\n for (i = 0; i < r; i++) {\n sum2 += data[i][j];\n }\n data[r][j] = sum2;\n sum2 = 0;\n }\n for (i = 0; i <= r; i++) {\n for (j = 0; j < c; j++) {\n //printf(\"%d \", data[i][j]);\n \tSystem.out.print(data[i][j] + \" \");\n }\n //printf(\"%d\\n\", data[i][c]);\n System.out.println(data[i][c]);\n }\n\n\n\t}\n}",
"Main",
"public static void main(String[] args){\n\tScanner scan = new Scanner(System.in);\n\n int r, c, i, j, sum1 = 0, sum2 = 0;\n int data[][] = new int[150][150];\n //scanf(\"%d%d\", &r, &c);\n r = scan.nextInt();\n c = scan.nextInt();\n for (i = 0; i < r; i++) {\n for (j = 0; j < c; j++) {\n //scanf(\"%d\", &data[i][j]);\n \tdata[i][j] = scan.nextInt();\n sum1 += data[i][j];\n }\n data[i][c] = sum1;\n sum1 = 0;\n }\n for (j = 0; j <= c; j++) {\n for (i = 0; i < r; i++) {\n sum2 += data[i][j];\n }\n data[r][j] = sum2;\n sum2 = 0;\n }\n for (i = 0; i <= r; i++) {\n for (j = 0; j < c; j++) {\n //printf(\"%d \", data[i][j]);\n \tSystem.out.print(data[i][j] + \" \");\n }\n //printf(\"%d\\n\", data[i][c]);\n System.out.println(data[i][c]);\n }\n\n\n\t}",
"main",
"{\n\tScanner scan = new Scanner(System.in);\n\n int r, c, i, j, sum1 = 0, sum2 = 0;\n int data[][] = new int[150][150];\n //scanf(\"%d%d\", &r, &c);\n r = scan.nextInt();\n c = scan.nextInt();\n for (i = 0; i < r; i++) {\n for (j = 0; j < c; j++) {\n //scanf(\"%d\", &data[i][j]);\n \tdata[i][j] = scan.nextInt();\n sum1 += data[i][j];\n }\n data[i][c] = sum1;\n sum1 = 0;\n }\n for (j = 0; j <= c; j++) {\n for (i = 0; i < r; i++) {\n sum2 += data[i][j];\n }\n data[r][j] = sum2;\n sum2 = 0;\n }\n for (i = 0; i <= r; i++) {\n for (j = 0; j < c; j++) {\n //printf(\"%d \", data[i][j]);\n \tSystem.out.print(data[i][j] + \" \");\n }\n //printf(\"%d\\n\", data[i][c]);\n System.out.println(data[i][c]);\n }\n\n\n\t}",
"Scanner scan = new Scanner(System.in);",
"scan",
"new Scanner(System.in)",
"int r",
"r",
"c",
"c",
"i",
"i",
"j",
"j",
"sum1 = 0",
"sum1",
"0",
"sum2 = 0;",
"sum2",
"0",
"int data[][] = new int[150][150];",
"data",
"new int[150][150]",
"150",
"150",
"r = scan.nextInt()",
"r",
"scan.nextInt()",
"scan.nextInt",
"scan",
"c = scan.nextInt()",
"c",
"scan.nextInt()",
"scan.nextInt",
"scan",
"for (i = 0; i < r; i++) {\n for (j = 0; j < c; j++) {\n //scanf(\"%d\", &data[i][j]);\n \tdata[i][j] = scan.nextInt();\n sum1 += data[i][j];\n }\n data[i][c] = sum1;\n sum1 = 0;\n }",
"i = 0;",
"i = 0",
"i",
"0",
"i < r",
"i",
"r",
"i++",
"i++",
"i",
"{\n for (j = 0; j < c; j++) {\n //scanf(\"%d\", &data[i][j]);\n \tdata[i][j] = scan.nextInt();\n sum1 += data[i][j];\n }\n data[i][c] = sum1;\n sum1 = 0;\n }",
"{\n for (j = 0; j < c; j++) {\n //scanf(\"%d\", &data[i][j]);\n \tdata[i][j] = scan.nextInt();\n sum1 += data[i][j];\n }\n data[i][c] = sum1;\n sum1 = 0;\n }",
"for (j = 0; j < c; j++) {\n //scanf(\"%d\", &data[i][j]);\n \tdata[i][j] = scan.nextInt();\n sum1 += data[i][j];\n }",
"j = 0;",
"j = 0",
"j",
"0",
"j < c",
"j",
"c",
"j++",
"j++",
"j",
"{\n //scanf(\"%d\", &data[i][j]);\n \tdata[i][j] = scan.nextInt();\n sum1 += data[i][j];\n }",
"{\n //scanf(\"%d\", &data[i][j]);\n \tdata[i][j] = scan.nextInt();\n sum1 += data[i][j];\n }",
"data[i][j] = scan.nextInt()",
"data[i][j]",
"data[i]",
"data",
"i",
"j",
"scan.nextInt()",
"scan.nextInt",
"scan",
"sum1 += data[i][j]",
"sum1",
"data[i][j]",
"data[i]",
"data",
"i",
"j",
"data[i][c] = sum1",
"data[i][c]",
"data[i]",
"data",
"i",
"c",
"sum1",
"sum1 = 0",
"sum1",
"0",
"for (j = 0; j <= c; j++) {\n for (i = 0; i < r; i++) {\n sum2 += data[i][j];\n }\n data[r][j] = sum2;\n sum2 = 0;\n }",
"j = 0;",
"j = 0",
"j",
"0",
"j <= c",
"j",
"c",
"j++",
"j++",
"j",
"{\n for (i = 0; i < r; i++) {\n sum2 += data[i][j];\n }\n data[r][j] = sum2;\n sum2 = 0;\n }",
"{\n for (i = 0; i < r; i++) {\n sum2 += data[i][j];\n }\n data[r][j] = sum2;\n sum2 = 0;\n }",
"for (i = 0; i < r; i++) {\n sum2 += data[i][j];\n }",
"i = 0;",
"i = 0",
"i",
"0",
"i < r",
"i",
"r",
"i++",
"i++",
"i",
"{\n sum2 += data[i][j];\n }",
"{\n sum2 += data[i][j];\n }",
"sum2 += data[i][j]",
"sum2",
"data[i][j]",
"data[i]",
"data",
"i",
"j",
"data[r][j] = sum2",
"data[r][j]",
"data[r]",
"data",
"r",
"j",
"sum2",
"sum2 = 0",
"sum2",
"0",
"for (i = 0; i <= r; i++) {\n for (j = 0; j < c; j++) {\n //printf(\"%d \", data[i][j]);\n \tSystem.out.print(data[i][j] + \" \");\n }\n //printf(\"%d\\n\", data[i][c]);\n System.out.println(data[i][c]);\n }",
"i = 0;",
"i = 0",
"i",
"0",
"i <= r",
"i",
"r",
"i++",
"i++",
"i",
"{\n for (j = 0; j < c; j++) {\n //printf(\"%d \", data[i][j]);\n \tSystem.out.print(data[i][j] + \" \");\n }\n //printf(\"%d\\n\", data[i][c]);\n System.out.println(data[i][c]);\n }",
"{\n for (j = 0; j < c; j++) {\n //printf(\"%d \", data[i][j]);\n \tSystem.out.print(data[i][j] + \" \");\n }\n //printf(\"%d\\n\", data[i][c]);\n System.out.println(data[i][c]);\n }",
"for (j = 0; j < c; j++) {\n //printf(\"%d \", data[i][j]);\n \tSystem.out.print(data[i][j] + \" \");\n }",
"j = 0;",
"j = 0",
"j",
"0",
"j < c",
"j",
"c",
"j++",
"j++",
"j",
"{\n //printf(\"%d \", data[i][j]);\n \tSystem.out.print(data[i][j] + \" \");\n }",
"{\n //printf(\"%d \", data[i][j]);\n \tSystem.out.print(data[i][j] + \" \");\n }",
"System.out.print(data[i][j] + \" \")",
"System.out.print",
"System.out",
"System",
"System.out",
"data[i][j] + \" \"",
"data[i][j]",
"data[i]",
"data",
"i",
"j",
"\" \"",
"System.out.println(data[i][c])",
"System.out.println",
"System.out",
"System",
"System.out",
"data[i][c]",
"data[i]",
"data",
"i",
"c",
"String[] args",
"args"
] | import java.util.Scanner;
class Main{
public static void main(String[] args){
Scanner scan = new Scanner(System.in);
int r, c, i, j, sum1 = 0, sum2 = 0;
int data[][] = new int[150][150];
//scanf("%d%d", &r, &c);
r = scan.nextInt();
c = scan.nextInt();
for (i = 0; i < r; i++) {
for (j = 0; j < c; j++) {
//scanf("%d", &data[i][j]);
data[i][j] = scan.nextInt();
sum1 += data[i][j];
}
data[i][c] = sum1;
sum1 = 0;
}
for (j = 0; j <= c; j++) {
for (i = 0; i < r; i++) {
sum2 += data[i][j];
}
data[r][j] = sum2;
sum2 = 0;
}
for (i = 0; i <= r; i++) {
for (j = 0; j < c; j++) {
//printf("%d ", data[i][j]);
System.out.print(data[i][j] + " ");
}
//printf("%d\n", data[i][c]);
System.out.println(data[i][c]);
}
}
} |
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
41,
13,
20,
2,
13,
17,
2,
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,
14,
2,
2,
13,
13,
2,
13,
13,
30,
0,
18,
18,
13,
13,
13,
17,
30,
0,
18,
18,
13,
13,
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,
0,
18,
18,
13,
13,
13,
18,
18,
13,
13,
13,
0,
18,
18,
13,
13,
13,
18,
18,
13,
13,
13,
0,
18,
18,
13,
13,
13,
18,
18,
13,
13,
13,
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,
4,
18,
18,
13,
13,
2,
18,
18,
13,
13,
13,
8,
2,
13,
13,
17,
17,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
196,
5
],
[
196,
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
],
[
19,
20
],
[
20,
21
],
[
8,
22
],
[
22,
23
],
[
22,
24
],
[
25,
26
],
[
25,
27
],
[
28,
29
],
[
28,
30
],
[
8,
31
],
[
31,
32
],
[
32,
33
],
[
33,
34
],
[
33,
35
],
[
31,
36
],
[
36,
37
],
[
36,
38
],
[
38,
39
],
[
38,
40
],
[
31,
41
],
[
41,
42
],
[
42,
43
],
[
31,
44
],
[
45,
45
],
[
45,
46
],
[
46,
47
],
[
47,
48
],
[
48,
49
],
[
48,
50
],
[
46,
51
],
[
51,
52
],
[
51,
53
],
[
53,
54
],
[
53,
55
],
[
46,
56
],
[
56,
57
],
[
57,
58
],
[
46,
59
],
[
60,
60
],
[
60,
61
],
[
61,
62
],
[
62,
63
],
[
63,
64
],
[
63,
65
],
[
62,
66
],
[
66,
67
],
[
66,
68
],
[
61,
69
],
[
69,
70
],
[
70,
71
],
[
71,
72
],
[
72,
73
],
[
72,
74
],
[
71,
75
],
[
70,
76
],
[
61,
77
],
[
77,
78
],
[
78,
79
],
[
79,
80
],
[
80,
81
],
[
80,
82
],
[
79,
83
],
[
78,
84
],
[
84,
85
],
[
85,
86
],
[
8,
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
],
[
101,
102
],
[
102,
103
],
[
102,
104
],
[
100,
105
],
[
105,
106
],
[
105,
107
],
[
100,
108
],
[
108,
109
],
[
109,
110
],
[
100,
111
],
[
112,
112
],
[
112,
113
],
[
113,
114
],
[
114,
115
],
[
115,
116
],
[
115,
117
],
[
114,
118
],
[
113,
119
],
[
119,
120
],
[
120,
121
],
[
120,
122
],
[
119,
123
],
[
112,
124
],
[
124,
125
],
[
125,
126
],
[
126,
127
],
[
126,
128
],
[
125,
129
],
[
124,
130
],
[
130,
131
],
[
131,
132
],
[
131,
133
],
[
130,
134
],
[
99,
135
],
[
135,
136
],
[
136,
137
],
[
137,
138
],
[
137,
139
],
[
136,
140
],
[
135,
141
],
[
141,
142
],
[
142,
143
],
[
142,
144
],
[
141,
145
],
[
8,
146
],
[
146,
147
],
[
147,
148
],
[
148,
149
],
[
148,
150
],
[
146,
151
],
[
151,
152
],
[
151,
153
],
[
153,
154
],
[
153,
155
],
[
146,
156
],
[
156,
157
],
[
157,
158
],
[
146,
159
],
[
160,
160
],
[
160,
161
],
[
161,
162
],
[
162,
163
],
[
163,
164
],
[
163,
165
],
[
161,
166
],
[
166,
167
],
[
166,
168
],
[
168,
169
],
[
168,
170
],
[
161,
171
],
[
171,
172
],
[
172,
173
],
[
161,
174
],
[
175,
175
],
[
175,
176
],
[
176,
177
],
[
177,
178
],
[
178,
179
],
[
178,
180
],
[
176,
181
],
[
181,
182
],
[
182,
183
],
[
183,
184
],
[
183,
185
],
[
182,
186
],
[
181,
187
],
[
187,
188
],
[
188,
189
],
[
188,
190
],
[
187,
191
],
[
187,
192
],
[
6,
193
],
[
193,
194
],
[
0,
195
],
[
195,
196
],
[
195,
197
]
] | [
"import java.util.Scanner;\n\npublic class Main {\n\tpublic static void main(String[] args)\n\t{\n\t\tScanner scanner = new Scanner(System.in);\n\t\tint r = scanner.nextInt();\n\t\tint c = scanner.nextInt();\n\t\tint[][] a = new int[r+1][c+1];\n\n\t\tfor(int i=0; i<r+1; i++)\n\t\t{\n\t\t\tfor(int j=0; j<c+1; j++)\n\t\t\t{\n\t\t\t\tif(i==r || j==c)\n\t\t\t\t{\n\t\t\t\t\ta[i][j] = 0;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\ta[i][j] = scanner.nextInt();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tfor(int i=0; i<r; i++)\n\t\t{\n\t\t\tfor(int j=0; j<c; j++)\n\t\t\t{\n\t\t\t\ta[i][c] += a[i][j];\n\t\t\t\ta[r][j] += a[i][j];\n\t\t\t}\n\t\t\ta[r][c] += a[i][c];\n\t\t}\n\t\t\n\t\t\n\t\tfor(int i=0; i<r+1; i++)\n\t\t{\n\t\t\tfor(int j=0; j<c+1; j++)\n\t\t\t{\n\t\t\t\tSystem.out.print(a[i][j]+(j<c?\" \":\"\\n\"));\n\t\t\t}\n\t\t}\n\t}\n}\n",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n\tpublic static void main(String[] args)\n\t{\n\t\tScanner scanner = new Scanner(System.in);\n\t\tint r = scanner.nextInt();\n\t\tint c = scanner.nextInt();\n\t\tint[][] a = new int[r+1][c+1];\n\n\t\tfor(int i=0; i<r+1; i++)\n\t\t{\n\t\t\tfor(int j=0; j<c+1; j++)\n\t\t\t{\n\t\t\t\tif(i==r || j==c)\n\t\t\t\t{\n\t\t\t\t\ta[i][j] = 0;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\ta[i][j] = scanner.nextInt();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tfor(int i=0; i<r; i++)\n\t\t{\n\t\t\tfor(int j=0; j<c; j++)\n\t\t\t{\n\t\t\t\ta[i][c] += a[i][j];\n\t\t\t\ta[r][j] += a[i][j];\n\t\t\t}\n\t\t\ta[r][c] += a[i][c];\n\t\t}\n\t\t\n\t\t\n\t\tfor(int i=0; i<r+1; i++)\n\t\t{\n\t\t\tfor(int j=0; j<c+1; j++)\n\t\t\t{\n\t\t\t\tSystem.out.print(a[i][j]+(j<c?\" \":\"\\n\"));\n\t\t\t}\n\t\t}\n\t}\n}",
"Main",
"public static void main(String[] args)\n\t{\n\t\tScanner scanner = new Scanner(System.in);\n\t\tint r = scanner.nextInt();\n\t\tint c = scanner.nextInt();\n\t\tint[][] a = new int[r+1][c+1];\n\n\t\tfor(int i=0; i<r+1; i++)\n\t\t{\n\t\t\tfor(int j=0; j<c+1; j++)\n\t\t\t{\n\t\t\t\tif(i==r || j==c)\n\t\t\t\t{\n\t\t\t\t\ta[i][j] = 0;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\ta[i][j] = scanner.nextInt();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tfor(int i=0; i<r; i++)\n\t\t{\n\t\t\tfor(int j=0; j<c; j++)\n\t\t\t{\n\t\t\t\ta[i][c] += a[i][j];\n\t\t\t\ta[r][j] += a[i][j];\n\t\t\t}\n\t\t\ta[r][c] += a[i][c];\n\t\t}\n\t\t\n\t\t\n\t\tfor(int i=0; i<r+1; i++)\n\t\t{\n\t\t\tfor(int j=0; j<c+1; j++)\n\t\t\t{\n\t\t\t\tSystem.out.print(a[i][j]+(j<c?\" \":\"\\n\"));\n\t\t\t}\n\t\t}\n\t}",
"main",
"{\n\t\tScanner scanner = new Scanner(System.in);\n\t\tint r = scanner.nextInt();\n\t\tint c = scanner.nextInt();\n\t\tint[][] a = new int[r+1][c+1];\n\n\t\tfor(int i=0; i<r+1; i++)\n\t\t{\n\t\t\tfor(int j=0; j<c+1; j++)\n\t\t\t{\n\t\t\t\tif(i==r || j==c)\n\t\t\t\t{\n\t\t\t\t\ta[i][j] = 0;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\ta[i][j] = scanner.nextInt();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tfor(int i=0; i<r; i++)\n\t\t{\n\t\t\tfor(int j=0; j<c; j++)\n\t\t\t{\n\t\t\t\ta[i][c] += a[i][j];\n\t\t\t\ta[r][j] += a[i][j];\n\t\t\t}\n\t\t\ta[r][c] += a[i][c];\n\t\t}\n\t\t\n\t\t\n\t\tfor(int i=0; i<r+1; i++)\n\t\t{\n\t\t\tfor(int j=0; j<c+1; j++)\n\t\t\t{\n\t\t\t\tSystem.out.print(a[i][j]+(j<c?\" \":\"\\n\"));\n\t\t\t}\n\t\t}\n\t}",
"Scanner scanner = new Scanner(System.in);",
"scanner",
"new Scanner(System.in)",
"int r = scanner.nextInt();",
"r",
"scanner.nextInt()",
"scanner.nextInt",
"scanner",
"int c = scanner.nextInt();",
"c",
"scanner.nextInt()",
"scanner.nextInt",
"scanner",
"int[][] a = new int[r+1][c+1];",
"a",
"new int[r+1][c+1]",
"r+1",
"r",
"1",
"c+1",
"c",
"1",
"for(int i=0; i<r+1; i++)\n\t\t{\n\t\t\tfor(int j=0; j<c+1; j++)\n\t\t\t{\n\t\t\t\tif(i==r || j==c)\n\t\t\t\t{\n\t\t\t\t\ta[i][j] = 0;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\ta[i][j] = scanner.nextInt();\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"int i=0;",
"int i=0;",
"i",
"0",
"i<r+1",
"i",
"r+1",
"r",
"1",
"i++",
"i++",
"i",
"{\n\t\t\tfor(int j=0; j<c+1; j++)\n\t\t\t{\n\t\t\t\tif(i==r || j==c)\n\t\t\t\t{\n\t\t\t\t\ta[i][j] = 0;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\ta[i][j] = scanner.nextInt();\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"{\n\t\t\tfor(int j=0; j<c+1; j++)\n\t\t\t{\n\t\t\t\tif(i==r || j==c)\n\t\t\t\t{\n\t\t\t\t\ta[i][j] = 0;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\ta[i][j] = scanner.nextInt();\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"for(int j=0; j<c+1; j++)\n\t\t\t{\n\t\t\t\tif(i==r || j==c)\n\t\t\t\t{\n\t\t\t\t\ta[i][j] = 0;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\ta[i][j] = scanner.nextInt();\n\t\t\t\t}\n\t\t\t}",
"int j=0;",
"int j=0;",
"j",
"0",
"j<c+1",
"j",
"c+1",
"c",
"1",
"j++",
"j++",
"j",
"{\n\t\t\t\tif(i==r || j==c)\n\t\t\t\t{\n\t\t\t\t\ta[i][j] = 0;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\ta[i][j] = scanner.nextInt();\n\t\t\t\t}\n\t\t\t}",
"{\n\t\t\t\tif(i==r || j==c)\n\t\t\t\t{\n\t\t\t\t\ta[i][j] = 0;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\ta[i][j] = scanner.nextInt();\n\t\t\t\t}\n\t\t\t}",
"if(i==r || j==c)\n\t\t\t\t{\n\t\t\t\t\ta[i][j] = 0;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\ta[i][j] = scanner.nextInt();\n\t\t\t\t}",
"i==r || j==c",
"i==r",
"i",
"r",
"j==c",
"j",
"c",
"{\n\t\t\t\t\ta[i][j] = 0;\n\t\t\t\t}",
"a[i][j] = 0",
"a[i][j]",
"a[i]",
"a",
"i",
"j",
"0",
"{\n\t\t\t\t\ta[i][j] = scanner.nextInt();\n\t\t\t\t}",
"a[i][j] = scanner.nextInt()",
"a[i][j]",
"a[i]",
"a",
"i",
"j",
"scanner.nextInt()",
"scanner.nextInt",
"scanner",
"for(int i=0; i<r; i++)\n\t\t{\n\t\t\tfor(int j=0; j<c; j++)\n\t\t\t{\n\t\t\t\ta[i][c] += a[i][j];\n\t\t\t\ta[r][j] += a[i][j];\n\t\t\t}\n\t\t\ta[r][c] += a[i][c];\n\t\t}",
"int i=0;",
"int i=0;",
"i",
"0",
"i<r",
"i",
"r",
"i++",
"i++",
"i",
"{\n\t\t\tfor(int j=0; j<c; j++)\n\t\t\t{\n\t\t\t\ta[i][c] += a[i][j];\n\t\t\t\ta[r][j] += a[i][j];\n\t\t\t}\n\t\t\ta[r][c] += a[i][c];\n\t\t}",
"{\n\t\t\tfor(int j=0; j<c; j++)\n\t\t\t{\n\t\t\t\ta[i][c] += a[i][j];\n\t\t\t\ta[r][j] += a[i][j];\n\t\t\t}\n\t\t\ta[r][c] += a[i][c];\n\t\t}",
"for(int j=0; j<c; j++)\n\t\t\t{\n\t\t\t\ta[i][c] += a[i][j];\n\t\t\t\ta[r][j] += a[i][j];\n\t\t\t}",
"int j=0;",
"int j=0;",
"j",
"0",
"j<c",
"j",
"c",
"j++",
"j++",
"j",
"{\n\t\t\t\ta[i][c] += a[i][j];\n\t\t\t\ta[r][j] += a[i][j];\n\t\t\t}",
"{\n\t\t\t\ta[i][c] += a[i][j];\n\t\t\t\ta[r][j] += a[i][j];\n\t\t\t}",
"a[i][c] += a[i][j]",
"a[i][c]",
"a[i]",
"a",
"i",
"c",
"a[i][j]",
"a[i]",
"a",
"i",
"j",
"a[r][j] += a[i][j]",
"a[r][j]",
"a[r]",
"a",
"r",
"j",
"a[i][j]",
"a[i]",
"a",
"i",
"j",
"a[r][c] += a[i][c]",
"a[r][c]",
"a[r]",
"a",
"r",
"c",
"a[i][c]",
"a[i]",
"a",
"i",
"c",
"for(int i=0; i<r+1; i++)\n\t\t{\n\t\t\tfor(int j=0; j<c+1; j++)\n\t\t\t{\n\t\t\t\tSystem.out.print(a[i][j]+(j<c?\" \":\"\\n\"));\n\t\t\t}\n\t\t}",
"int i=0;",
"int i=0;",
"i",
"0",
"i<r+1",
"i",
"r+1",
"r",
"1",
"i++",
"i++",
"i",
"{\n\t\t\tfor(int j=0; j<c+1; j++)\n\t\t\t{\n\t\t\t\tSystem.out.print(a[i][j]+(j<c?\" \":\"\\n\"));\n\t\t\t}\n\t\t}",
"{\n\t\t\tfor(int j=0; j<c+1; j++)\n\t\t\t{\n\t\t\t\tSystem.out.print(a[i][j]+(j<c?\" \":\"\\n\"));\n\t\t\t}\n\t\t}",
"for(int j=0; j<c+1; j++)\n\t\t\t{\n\t\t\t\tSystem.out.print(a[i][j]+(j<c?\" \":\"\\n\"));\n\t\t\t}",
"int j=0;",
"int j=0;",
"j",
"0",
"j<c+1",
"j",
"c+1",
"c",
"1",
"j++",
"j++",
"j",
"{\n\t\t\t\tSystem.out.print(a[i][j]+(j<c?\" \":\"\\n\"));\n\t\t\t}",
"{\n\t\t\t\tSystem.out.print(a[i][j]+(j<c?\" \":\"\\n\"));\n\t\t\t}",
"System.out.print(a[i][j]+(j<c?\" \":\"\\n\"))",
"System.out.print",
"System.out",
"System",
"System.out",
"a[i][j]+(j<c?\" \":\"\\n\")",
"a[i][j]",
"a[i]",
"a",
"i",
"j",
"(j<c?\" \":\"\\n\")",
"j<c",
"j",
"c",
"\" \"",
"\"\\n\"",
"String[] args",
"args",
"public class Main {\n\tpublic static void main(String[] args)\n\t{\n\t\tScanner scanner = new Scanner(System.in);\n\t\tint r = scanner.nextInt();\n\t\tint c = scanner.nextInt();\n\t\tint[][] a = new int[r+1][c+1];\n\n\t\tfor(int i=0; i<r+1; i++)\n\t\t{\n\t\t\tfor(int j=0; j<c+1; j++)\n\t\t\t{\n\t\t\t\tif(i==r || j==c)\n\t\t\t\t{\n\t\t\t\t\ta[i][j] = 0;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\ta[i][j] = scanner.nextInt();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tfor(int i=0; i<r; i++)\n\t\t{\n\t\t\tfor(int j=0; j<c; j++)\n\t\t\t{\n\t\t\t\ta[i][c] += a[i][j];\n\t\t\t\ta[r][j] += a[i][j];\n\t\t\t}\n\t\t\ta[r][c] += a[i][c];\n\t\t}\n\t\t\n\t\t\n\t\tfor(int i=0; i<r+1; i++)\n\t\t{\n\t\t\tfor(int j=0; j<c+1; j++)\n\t\t\t{\n\t\t\t\tSystem.out.print(a[i][j]+(j<c?\" \":\"\\n\"));\n\t\t\t}\n\t\t}\n\t}\n}",
"public class Main {\n\tpublic static void main(String[] args)\n\t{\n\t\tScanner scanner = new Scanner(System.in);\n\t\tint r = scanner.nextInt();\n\t\tint c = scanner.nextInt();\n\t\tint[][] a = new int[r+1][c+1];\n\n\t\tfor(int i=0; i<r+1; i++)\n\t\t{\n\t\t\tfor(int j=0; j<c+1; j++)\n\t\t\t{\n\t\t\t\tif(i==r || j==c)\n\t\t\t\t{\n\t\t\t\t\ta[i][j] = 0;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\ta[i][j] = scanner.nextInt();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tfor(int i=0; i<r; i++)\n\t\t{\n\t\t\tfor(int j=0; j<c; j++)\n\t\t\t{\n\t\t\t\ta[i][c] += a[i][j];\n\t\t\t\ta[r][j] += a[i][j];\n\t\t\t}\n\t\t\ta[r][c] += a[i][c];\n\t\t}\n\t\t\n\t\t\n\t\tfor(int i=0; i<r+1; i++)\n\t\t{\n\t\t\tfor(int j=0; j<c+1; j++)\n\t\t\t{\n\t\t\t\tSystem.out.print(a[i][j]+(j<c?\" \":\"\\n\"));\n\t\t\t}\n\t\t}\n\t}\n}",
"Main"
] | import java.util.Scanner;
public class Main {
public static void main(String[] args)
{
Scanner scanner = new Scanner(System.in);
int r = scanner.nextInt();
int c = scanner.nextInt();
int[][] a = new int[r+1][c+1];
for(int i=0; i<r+1; i++)
{
for(int j=0; j<c+1; j++)
{
if(i==r || j==c)
{
a[i][j] = 0;
}
else {
a[i][j] = scanner.nextInt();
}
}
}
for(int i=0; i<r; i++)
{
for(int j=0; j<c; j++)
{
a[i][c] += a[i][j];
a[r][j] += a[i][j];
}
a[r][c] += a[i][c];
}
for(int i=0; i<r+1; i++)
{
for(int j=0; j<c+1; j++)
{
System.out.print(a[i][j]+(j<c?" ":"\n"));
}
}
}
}
|
[
7,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
17,
41,
13,
17,
41,
13,
17,
41,
13,
41,
13,
41,
13,
20,
38,
5,
13,
30,
4,
18,
18,
13,
13,
13,
29,
30,
0,
13,
4,
18,
4,
18,
13,
17,
0,
13,
4,
18,
13,
18,
13,
17,
0,
13,
4,
18,
13,
18,
13,
17,
41,
13,
20,
2,
13,
17,
2,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
4,
18,
4,
18,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
18,
18,
13,
13,
13,
4,
18,
13,
18,
13,
13,
0,
13,
18,
18,
13,
13,
13,
0,
18,
18,
13,
13,
13,
13,
0,
13,
17,
11,
1,
41,
13,
17,
2,
13,
2,
13,
17,
1,
40,
13,
30,
30,
0,
13,
17,
11,
1,
41,
13,
17,
2,
13,
2,
13,
17,
1,
40,
13,
30,
30,
0,
13,
18,
18,
13,
13,
13,
0,
18,
18,
13,
13,
13,
13,
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,
2,
18,
18,
13,
13,
13,
17,
4,
18,
18,
13,
13,
4,
18,
13,
17,
2,
4,
18,
13,
17,
0,
13,
17,
23,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
9,
10
],
[
9,
11
],
[
11,
12
],
[
12,
13
],
[
12,
14
],
[
11,
16
],
[
16,
17
],
[
16,
18
],
[
11,
19
],
[
19,
20
],
[
19,
21
],
[
11,
22
],
[
22,
23
],
[
11,
24
],
[
24,
25
],
[
11,
26
],
[
26,
27
],
[
26,
28
],
[
11,
29
],
[
29,
30
],
[
30,
31
],
[
30,
32
],
[
32,
33
],
[
33,
34
],
[
34,
35
],
[
35,
36
],
[
35,
37
],
[
33,
38
],
[
32,
39
],
[
29,
40
],
[
40,
41
],
[
41,
42
],
[
41,
43
],
[
43,
44
],
[
44,
45
],
[
45,
46
],
[
46,
47
],
[
43,
48
],
[
40,
49
],
[
49,
50
],
[
49,
51
],
[
51,
52
],
[
52,
53
],
[
51,
54
],
[
54,
55
],
[
54,
56
],
[
40,
57
],
[
57,
58
],
[
57,
59
],
[
59,
60
],
[
60,
61
],
[
59,
62
],
[
62,
63
],
[
62,
64
],
[
40,
65
],
[
65,
66
],
[
65,
67
],
[
68,
69
],
[
68,
70
],
[
71,
72
],
[
71,
73
],
[
40,
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
],
[
90,
91
],
[
91,
92
],
[
92,
93
],
[
89,
94
],
[
86,
95
],
[
95,
96
],
[
96,
97
],
[
97,
98
],
[
97,
99
],
[
95,
100
],
[
100,
101
],
[
100,
102
],
[
95,
103
],
[
103,
104
],
[
104,
105
],
[
95,
106
],
[
107,
107
],
[
107,
108
],
[
108,
109
],
[
109,
110
],
[
110,
111
],
[
110,
112
],
[
109,
113
],
[
108,
114
],
[
114,
115
],
[
115,
116
],
[
114,
117
],
[
117,
118
],
[
117,
119
],
[
107,
120
],
[
120,
121
],
[
120,
122
],
[
122,
123
],
[
123,
124
],
[
123,
125
],
[
122,
126
],
[
86,
127
],
[
127,
128
],
[
128,
129
],
[
129,
130
],
[
129,
131
],
[
128,
132
],
[
127,
133
],
[
86,
134
],
[
134,
135
],
[
134,
136
],
[
40,
137
],
[
137,
138
],
[
138,
139
],
[
139,
140
],
[
139,
141
],
[
137,
142
],
[
142,
143
],
[
142,
144
],
[
144,
145
],
[
144,
146
],
[
137,
147
],
[
147,
148
],
[
148,
149
],
[
137,
150
],
[
151,
151
],
[
151,
152
],
[
152,
153
],
[
152,
154
],
[
151,
155
],
[
155,
156
],
[
156,
157
],
[
157,
158
],
[
157,
159
],
[
155,
160
],
[
160,
161
],
[
160,
162
],
[
162,
163
],
[
162,
164
],
[
155,
165
],
[
165,
166
],
[
166,
167
],
[
155,
168
],
[
169,
169
],
[
169,
170
],
[
170,
171
],
[
170,
172
],
[
172,
173
],
[
173,
174
],
[
173,
175
],
[
172,
176
],
[
151,
177
],
[
177,
178
],
[
178,
179
],
[
179,
180
],
[
179,
181
],
[
178,
182
],
[
177,
183
],
[
40,
184
],
[
184,
185
],
[
185,
186
],
[
186,
187
],
[
186,
188
],
[
184,
189
],
[
189,
190
],
[
189,
191
],
[
191,
192
],
[
191,
193
],
[
184,
194
],
[
194,
195
],
[
195,
196
],
[
184,
197
],
[
198,
198
],
[
198,
199
],
[
199,
200
],
[
200,
201
],
[
201,
202
],
[
201,
203
],
[
199,
204
],
[
204,
205
],
[
204,
206
],
[
206,
207
],
[
206,
208
],
[
199,
209
],
[
209,
210
],
[
210,
211
],
[
199,
212
],
[
213,
213
],
[
213,
214
],
[
214,
215
],
[
214,
216
],
[
216,
217
],
[
217,
218
],
[
218,
219
],
[
218,
220
],
[
217,
221
],
[
216,
222
],
[
198,
223
],
[
223,
224
],
[
224,
225
],
[
225,
226
],
[
225,
227
],
[
223,
228
],
[
228,
229
],
[
229,
230
],
[
228,
231
],
[
228,
232
],
[
232,
233
],
[
233,
234
],
[
234,
235
],
[
232,
236
],
[
198,
237
],
[
237,
238
],
[
237,
239
],
[
9,
240
],
[
240,
241
]
] | [
"import java.io.*;\nimport java.io.IOException;\n\nclass Main{\n\tpublic static void main(String args[]){\n\t\tString[] inp = new String[100];\n\t\tString ans = \"\";\n\t\tint sum=0;\n\t\tint r,c;\n\t\t\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\t\ttry{\n\t\tinp = br.readLine().split(\"[\\\\s]+\");\n\t\tr = Integer.parseInt(inp[0]);\n\t\tc = Integer.parseInt(inp[1]);\n\t\t\n\t\t\n\t\tint table[][] = new int[r+1][c+1];\n\t\t\n\t\tfor(int i=0;i<r;i++){\n\t\t\tinp = br.readLine().split(\"[\\\\s]+\");\n\t\t\t\n\t\t\tfor(int j=0;j<c;j++){\n\t\t\t\ttable[i][j] = Integer.parseInt(inp[j]);\n\t\t\t\tsum += table[i][j];\n\t\t\t}\n\t\t\ttable[i][c]=sum;\n\t\t\tsum=0;\n\t\t}\n\t\t\n\t\t\n\t\t\n\t\tfor(int j=0;j<c+1;j++){\n\t\t\tsum=0;\n\t\t\tfor(int i=0;i<r+1;i++){\n\t\t\t\tsum += table[i][j];\n\t\t\t\t\n\t\t\t}\n\t\t\ttable[r][j] = sum;\n\t\t\t\n\t\t}\n\t\t\n\t\tfor(int i=0;i<r+1;i++){\n\t\t\tfor(int j=0;j<c+1;j++){\n\t\t\t\tans +=table[i][j] + \" \";\n\t\t\t}\n\t\t\tSystem.out.println(ans.substring(0, ans.length()-1));\n\t\t\tans=\"\";\n\t\t}\n\t\t}catch(IOException e){\n\t\t\tSystem.out.println(e);\n\t\t\treturn;\n\t\t}\n\t}\n}\n",
"import java.io.*;",
"io.*",
"java",
"import java.io.IOException;",
"IOException",
"java.io",
"class Main{\n\tpublic static void main(String args[]){\n\t\tString[] inp = new String[100];\n\t\tString ans = \"\";\n\t\tint sum=0;\n\t\tint r,c;\n\t\t\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\t\ttry{\n\t\tinp = br.readLine().split(\"[\\\\s]+\");\n\t\tr = Integer.parseInt(inp[0]);\n\t\tc = Integer.parseInt(inp[1]);\n\t\t\n\t\t\n\t\tint table[][] = new int[r+1][c+1];\n\t\t\n\t\tfor(int i=0;i<r;i++){\n\t\t\tinp = br.readLine().split(\"[\\\\s]+\");\n\t\t\t\n\t\t\tfor(int j=0;j<c;j++){\n\t\t\t\ttable[i][j] = Integer.parseInt(inp[j]);\n\t\t\t\tsum += table[i][j];\n\t\t\t}\n\t\t\ttable[i][c]=sum;\n\t\t\tsum=0;\n\t\t}\n\t\t\n\t\t\n\t\t\n\t\tfor(int j=0;j<c+1;j++){\n\t\t\tsum=0;\n\t\t\tfor(int i=0;i<r+1;i++){\n\t\t\t\tsum += table[i][j];\n\t\t\t\t\n\t\t\t}\n\t\t\ttable[r][j] = sum;\n\t\t\t\n\t\t}\n\t\t\n\t\tfor(int i=0;i<r+1;i++){\n\t\t\tfor(int j=0;j<c+1;j++){\n\t\t\t\tans +=table[i][j] + \" \";\n\t\t\t}\n\t\t\tSystem.out.println(ans.substring(0, ans.length()-1));\n\t\t\tans=\"\";\n\t\t}\n\t\t}catch(IOException e){\n\t\t\tSystem.out.println(e);\n\t\t\treturn;\n\t\t}\n\t}\n}",
"Main",
"public static void main(String args[]){\n\t\tString[] inp = new String[100];\n\t\tString ans = \"\";\n\t\tint sum=0;\n\t\tint r,c;\n\t\t\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\t\ttry{\n\t\tinp = br.readLine().split(\"[\\\\s]+\");\n\t\tr = Integer.parseInt(inp[0]);\n\t\tc = Integer.parseInt(inp[1]);\n\t\t\n\t\t\n\t\tint table[][] = new int[r+1][c+1];\n\t\t\n\t\tfor(int i=0;i<r;i++){\n\t\t\tinp = br.readLine().split(\"[\\\\s]+\");\n\t\t\t\n\t\t\tfor(int j=0;j<c;j++){\n\t\t\t\ttable[i][j] = Integer.parseInt(inp[j]);\n\t\t\t\tsum += table[i][j];\n\t\t\t}\n\t\t\ttable[i][c]=sum;\n\t\t\tsum=0;\n\t\t}\n\t\t\n\t\t\n\t\t\n\t\tfor(int j=0;j<c+1;j++){\n\t\t\tsum=0;\n\t\t\tfor(int i=0;i<r+1;i++){\n\t\t\t\tsum += table[i][j];\n\t\t\t\t\n\t\t\t}\n\t\t\ttable[r][j] = sum;\n\t\t\t\n\t\t}\n\t\t\n\t\tfor(int i=0;i<r+1;i++){\n\t\t\tfor(int j=0;j<c+1;j++){\n\t\t\t\tans +=table[i][j] + \" \";\n\t\t\t}\n\t\t\tSystem.out.println(ans.substring(0, ans.length()-1));\n\t\t\tans=\"\";\n\t\t}\n\t\t}catch(IOException e){\n\t\t\tSystem.out.println(e);\n\t\t\treturn;\n\t\t}\n\t}",
"main",
"{\n\t\tString[] inp = new String[100];\n\t\tString ans = \"\";\n\t\tint sum=0;\n\t\tint r,c;\n\t\t\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\t\ttry{\n\t\tinp = br.readLine().split(\"[\\\\s]+\");\n\t\tr = Integer.parseInt(inp[0]);\n\t\tc = Integer.parseInt(inp[1]);\n\t\t\n\t\t\n\t\tint table[][] = new int[r+1][c+1];\n\t\t\n\t\tfor(int i=0;i<r;i++){\n\t\t\tinp = br.readLine().split(\"[\\\\s]+\");\n\t\t\t\n\t\t\tfor(int j=0;j<c;j++){\n\t\t\t\ttable[i][j] = Integer.parseInt(inp[j]);\n\t\t\t\tsum += table[i][j];\n\t\t\t}\n\t\t\ttable[i][c]=sum;\n\t\t\tsum=0;\n\t\t}\n\t\t\n\t\t\n\t\t\n\t\tfor(int j=0;j<c+1;j++){\n\t\t\tsum=0;\n\t\t\tfor(int i=0;i<r+1;i++){\n\t\t\t\tsum += table[i][j];\n\t\t\t\t\n\t\t\t}\n\t\t\ttable[r][j] = sum;\n\t\t\t\n\t\t}\n\t\t\n\t\tfor(int i=0;i<r+1;i++){\n\t\t\tfor(int j=0;j<c+1;j++){\n\t\t\t\tans +=table[i][j] + \" \";\n\t\t\t}\n\t\t\tSystem.out.println(ans.substring(0, ans.length()-1));\n\t\t\tans=\"\";\n\t\t}\n\t\t}catch(IOException e){\n\t\t\tSystem.out.println(e);\n\t\t\treturn;\n\t\t}\n\t}",
"String[] inp = new String[100];",
"inp",
"new String[100]",
"100",
"String ans = \"\";",
"ans",
"\"\"",
"int sum=0;",
"sum",
"0",
"int r",
"r",
"c;",
"c",
"BufferedReader br = new BufferedReader(new InputStreamReader(System.in));",
"br",
"new BufferedReader(new InputStreamReader(System.in))",
"try{\n\t\tinp = br.readLine().split(\"[\\\\s]+\");\n\t\tr = Integer.parseInt(inp[0]);\n\t\tc = Integer.parseInt(inp[1]);\n\t\t\n\t\t\n\t\tint table[][] = new int[r+1][c+1];\n\t\t\n\t\tfor(int i=0;i<r;i++){\n\t\t\tinp = br.readLine().split(\"[\\\\s]+\");\n\t\t\t\n\t\t\tfor(int j=0;j<c;j++){\n\t\t\t\ttable[i][j] = Integer.parseInt(inp[j]);\n\t\t\t\tsum += table[i][j];\n\t\t\t}\n\t\t\ttable[i][c]=sum;\n\t\t\tsum=0;\n\t\t}\n\t\t\n\t\t\n\t\t\n\t\tfor(int j=0;j<c+1;j++){\n\t\t\tsum=0;\n\t\t\tfor(int i=0;i<r+1;i++){\n\t\t\t\tsum += table[i][j];\n\t\t\t\t\n\t\t\t}\n\t\t\ttable[r][j] = sum;\n\t\t\t\n\t\t}\n\t\t\n\t\tfor(int i=0;i<r+1;i++){\n\t\t\tfor(int j=0;j<c+1;j++){\n\t\t\t\tans +=table[i][j] + \" \";\n\t\t\t}\n\t\t\tSystem.out.println(ans.substring(0, ans.length()-1));\n\t\t\tans=\"\";\n\t\t}\n\t\t}catch(IOException e){\n\t\t\tSystem.out.println(e);\n\t\t\treturn;\n\t\t}",
"catch(IOException e){\n\t\t\tSystem.out.println(e);\n\t\t\treturn;\n\t\t}",
"IOException e",
"{\n\t\t\tSystem.out.println(e);\n\t\t\treturn;\n\t\t}",
"System.out.println(e)",
"System.out.println",
"System.out",
"System",
"System.out",
"e",
"return;",
"{\n\t\tinp = br.readLine().split(\"[\\\\s]+\");\n\t\tr = Integer.parseInt(inp[0]);\n\t\tc = Integer.parseInt(inp[1]);\n\t\t\n\t\t\n\t\tint table[][] = new int[r+1][c+1];\n\t\t\n\t\tfor(int i=0;i<r;i++){\n\t\t\tinp = br.readLine().split(\"[\\\\s]+\");\n\t\t\t\n\t\t\tfor(int j=0;j<c;j++){\n\t\t\t\ttable[i][j] = Integer.parseInt(inp[j]);\n\t\t\t\tsum += table[i][j];\n\t\t\t}\n\t\t\ttable[i][c]=sum;\n\t\t\tsum=0;\n\t\t}\n\t\t\n\t\t\n\t\t\n\t\tfor(int j=0;j<c+1;j++){\n\t\t\tsum=0;\n\t\t\tfor(int i=0;i<r+1;i++){\n\t\t\t\tsum += table[i][j];\n\t\t\t\t\n\t\t\t}\n\t\t\ttable[r][j] = sum;\n\t\t\t\n\t\t}\n\t\t\n\t\tfor(int i=0;i<r+1;i++){\n\t\t\tfor(int j=0;j<c+1;j++){\n\t\t\t\tans +=table[i][j] + \" \";\n\t\t\t}\n\t\t\tSystem.out.println(ans.substring(0, ans.length()-1));\n\t\t\tans=\"\";\n\t\t}\n\t\t}",
"inp = br.readLine().split(\"[\\\\s]+\")",
"inp",
"br.readLine().split(\"[\\\\s]+\")",
"br.readLine().split",
"br.readLine()",
"br.readLine",
"br",
"\"[\\\\s]+\"",
"r = Integer.parseInt(inp[0])",
"r",
"Integer.parseInt(inp[0])",
"Integer.parseInt",
"Integer",
"inp[0]",
"inp",
"0",
"c = Integer.parseInt(inp[1])",
"c",
"Integer.parseInt(inp[1])",
"Integer.parseInt",
"Integer",
"inp[1]",
"inp",
"1",
"int table[][] = new int[r+1][c+1];",
"table",
"new int[r+1][c+1]",
"r+1",
"r",
"1",
"c+1",
"c",
"1",
"for(int i=0;i<r;i++){\n\t\t\tinp = br.readLine().split(\"[\\\\s]+\");\n\t\t\t\n\t\t\tfor(int j=0;j<c;j++){\n\t\t\t\ttable[i][j] = Integer.parseInt(inp[j]);\n\t\t\t\tsum += table[i][j];\n\t\t\t}\n\t\t\ttable[i][c]=sum;\n\t\t\tsum=0;\n\t\t}",
"int i=0;",
"int i=0;",
"i",
"0",
"i<r",
"i",
"r",
"i++",
"i++",
"i",
"{\n\t\t\tinp = br.readLine().split(\"[\\\\s]+\");\n\t\t\t\n\t\t\tfor(int j=0;j<c;j++){\n\t\t\t\ttable[i][j] = Integer.parseInt(inp[j]);\n\t\t\t\tsum += table[i][j];\n\t\t\t}\n\t\t\ttable[i][c]=sum;\n\t\t\tsum=0;\n\t\t}",
"{\n\t\t\tinp = br.readLine().split(\"[\\\\s]+\");\n\t\t\t\n\t\t\tfor(int j=0;j<c;j++){\n\t\t\t\ttable[i][j] = Integer.parseInt(inp[j]);\n\t\t\t\tsum += table[i][j];\n\t\t\t}\n\t\t\ttable[i][c]=sum;\n\t\t\tsum=0;\n\t\t}",
"inp = br.readLine().split(\"[\\\\s]+\")",
"inp",
"br.readLine().split(\"[\\\\s]+\")",
"br.readLine().split",
"br.readLine()",
"br.readLine",
"br",
"\"[\\\\s]+\"",
"for(int j=0;j<c;j++){\n\t\t\t\ttable[i][j] = Integer.parseInt(inp[j]);\n\t\t\t\tsum += table[i][j];\n\t\t\t}",
"int j=0;",
"int j=0;",
"j",
"0",
"j<c",
"j",
"c",
"j++",
"j++",
"j",
"{\n\t\t\t\ttable[i][j] = Integer.parseInt(inp[j]);\n\t\t\t\tsum += table[i][j];\n\t\t\t}",
"{\n\t\t\t\ttable[i][j] = Integer.parseInt(inp[j]);\n\t\t\t\tsum += table[i][j];\n\t\t\t}",
"table[i][j] = Integer.parseInt(inp[j])",
"table[i][j]",
"table[i]",
"table",
"i",
"j",
"Integer.parseInt(inp[j])",
"Integer.parseInt",
"Integer",
"inp[j]",
"inp",
"j",
"sum += table[i][j]",
"sum",
"table[i][j]",
"table[i]",
"table",
"i",
"j",
"table[i][c]=sum",
"table[i][c]",
"table[i]",
"table",
"i",
"c",
"sum",
"sum=0",
"sum",
"0",
"for(int j=0;j<c+1;j++){\n\t\t\tsum=0;\n\t\t\tfor(int i=0;i<r+1;i++){\n\t\t\t\tsum += table[i][j];\n\t\t\t\t\n\t\t\t}\n\t\t\ttable[r][j] = sum;\n\t\t\t\n\t\t}",
"int j=0;",
"int j=0;",
"j",
"0",
"j<c+1",
"j",
"c+1",
"c",
"1",
"j++",
"j++",
"j",
"{\n\t\t\tsum=0;\n\t\t\tfor(int i=0;i<r+1;i++){\n\t\t\t\tsum += table[i][j];\n\t\t\t\t\n\t\t\t}\n\t\t\ttable[r][j] = sum;\n\t\t\t\n\t\t}",
"{\n\t\t\tsum=0;\n\t\t\tfor(int i=0;i<r+1;i++){\n\t\t\t\tsum += table[i][j];\n\t\t\t\t\n\t\t\t}\n\t\t\ttable[r][j] = sum;\n\t\t\t\n\t\t}",
"sum=0",
"sum",
"0",
"for(int i=0;i<r+1;i++){\n\t\t\t\tsum += table[i][j];\n\t\t\t\t\n\t\t\t}",
"int i=0;",
"int i=0;",
"i",
"0",
"i<r+1",
"i",
"r+1",
"r",
"1",
"i++",
"i++",
"i",
"{\n\t\t\t\tsum += table[i][j];\n\t\t\t\t\n\t\t\t}",
"{\n\t\t\t\tsum += table[i][j];\n\t\t\t\t\n\t\t\t}",
"sum += table[i][j]",
"sum",
"table[i][j]",
"table[i]",
"table",
"i",
"j",
"table[r][j] = sum",
"table[r][j]",
"table[r]",
"table",
"r",
"j",
"sum",
"for(int i=0;i<r+1;i++){\n\t\t\tfor(int j=0;j<c+1;j++){\n\t\t\t\tans +=table[i][j] + \" \";\n\t\t\t}\n\t\t\tSystem.out.println(ans.substring(0, ans.length()-1));\n\t\t\tans=\"\";\n\t\t}",
"int i=0;",
"int i=0;",
"i",
"0",
"i<r+1",
"i",
"r+1",
"r",
"1",
"i++",
"i++",
"i",
"{\n\t\t\tfor(int j=0;j<c+1;j++){\n\t\t\t\tans +=table[i][j] + \" \";\n\t\t\t}\n\t\t\tSystem.out.println(ans.substring(0, ans.length()-1));\n\t\t\tans=\"\";\n\t\t}",
"{\n\t\t\tfor(int j=0;j<c+1;j++){\n\t\t\t\tans +=table[i][j] + \" \";\n\t\t\t}\n\t\t\tSystem.out.println(ans.substring(0, ans.length()-1));\n\t\t\tans=\"\";\n\t\t}",
"for(int j=0;j<c+1;j++){\n\t\t\t\tans +=table[i][j] + \" \";\n\t\t\t}",
"int j=0;",
"int j=0;",
"j",
"0",
"j<c+1",
"j",
"c+1",
"c",
"1",
"j++",
"j++",
"j",
"{\n\t\t\t\tans +=table[i][j] + \" \";\n\t\t\t}",
"{\n\t\t\t\tans +=table[i][j] + \" \";\n\t\t\t}",
"ans +=table[i][j] + \" \"",
"ans",
"table[i][j] + \" \"",
"table[i][j]",
"table[i]",
"table",
"i",
"j",
"\" \"",
"System.out.println(ans.substring(0, ans.length()-1))",
"System.out.println",
"System.out",
"System",
"System.out",
"ans.substring(0, ans.length()-1)",
"ans.substring",
"ans",
"0",
"ans.length()-1",
"ans.length()",
"ans.length",
"ans",
"1",
"ans=\"\"",
"ans",
"\"\"",
"String args[]",
"args"
] | import java.io.*;
import java.io.IOException;
class Main{
public static void main(String args[]){
String[] inp = new String[100];
String ans = "";
int sum=0;
int r,c;
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
try{
inp = br.readLine().split("[\\s]+");
r = Integer.parseInt(inp[0]);
c = Integer.parseInt(inp[1]);
int table[][] = new int[r+1][c+1];
for(int i=0;i<r;i++){
inp = br.readLine().split("[\\s]+");
for(int j=0;j<c;j++){
table[i][j] = Integer.parseInt(inp[j]);
sum += table[i][j];
}
table[i][c]=sum;
sum=0;
}
for(int j=0;j<c+1;j++){
sum=0;
for(int i=0;i<r+1;i++){
sum += table[i][j];
}
table[r][j] = sum;
}
for(int i=0;i<r+1;i++){
for(int j=0;j<c+1;j++){
ans +=table[i][j] + " ";
}
System.out.println(ans.substring(0, ans.length()-1));
ans="";
}
}catch(IOException e){
System.out.println(e);
return;
}
}
}
|
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
4,
18,
13,
17,
41,
13,
4,
18,
13,
18,
13,
17,
41,
13,
4,
18,
13,
18,
13,
17,
41,
13,
20,
41,
13,
41,
13,
41,
13,
17,
41,
13,
41,
13,
20,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
4,
18,
13,
0,
13,
4,
18,
13,
17,
0,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
4,
18,
13,
18,
13,
13,
0,
13,
13,
0,
18,
13,
13,
13,
0,
13,
13,
4,
18,
13,
2,
2,
2,
13,
17,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
4,
18,
13,
2,
18,
13,
13,
17,
4,
18,
13,
13,
4,
18,
18,
13,
13,
13,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
154,
5
],
[
154,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
16,
17
],
[
17,
18
],
[
14,
19
],
[
8,
20
],
[
20,
21
],
[
20,
22
],
[
22,
23
],
[
23,
24
],
[
22,
25
],
[
25,
26
],
[
25,
27
],
[
8,
28
],
[
28,
29
],
[
28,
30
],
[
30,
31
],
[
31,
32
],
[
30,
33
],
[
33,
34
],
[
33,
35
],
[
8,
36
],
[
36,
37
],
[
36,
38
],
[
8,
39
],
[
39,
40
],
[
8,
41
],
[
41,
42
],
[
8,
43
],
[
43,
44
],
[
43,
45
],
[
8,
46
],
[
46,
47
],
[
8,
48
],
[
48,
49
],
[
48,
50
],
[
8,
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
],
[
68,
69
],
[
64,
70
],
[
70,
71
],
[
70,
72
],
[
72,
73
],
[
73,
74
],
[
72,
75
],
[
64,
76
],
[
76,
77
],
[
76,
78
],
[
64,
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
],
[
97,
98
],
[
97,
99
],
[
91,
100
],
[
100,
101
],
[
100,
102
],
[
91,
103
],
[
103,
104
],
[
104,
105
],
[
104,
106
],
[
103,
107
],
[
64,
108
],
[
108,
109
],
[
108,
110
],
[
64,
111
],
[
111,
112
],
[
112,
113
],
[
111,
114
],
[
116,
115
],
[
115,
116
],
[
116,
117
],
[
116,
118
],
[
115,
119
],
[
116,
120
],
[
8,
121
],
[
121,
122
],
[
122,
123
],
[
123,
124
],
[
123,
125
],
[
121,
126
],
[
126,
127
],
[
126,
128
],
[
121,
129
],
[
129,
130
],
[
130,
131
],
[
121,
132
],
[
132,
133
],
[
133,
134
],
[
134,
135
],
[
133,
136
],
[
136,
137
],
[
137,
138
],
[
137,
139
],
[
136,
140
],
[
8,
141
],
[
141,
142
],
[
142,
143
],
[
141,
144
],
[
8,
145
],
[
145,
146
],
[
146,
147
],
[
147,
148
],
[
147,
149
],
[
145,
150
],
[
6,
151
],
[
151,
152
],
[
0,
153
],
[
153,
154
],
[
153,
155
]
] | [
"import java.io.*;\npublic class Main {\n\tpublic static void main(String[] args) throws IOException{\n\t\tBufferedReader br=new BufferedReader(new InputStreamReader(System.in));\n\t\tString[] dat = br.readLine().split(\" \");\n\t\tint r = Integer.parseInt(dat[0]);\n\t\tint c = Integer.parseInt(dat[1]);\n\t\tStringBuilder out=new StringBuilder();\n\t\tint g,p,gg=0;\n\t\tString str;\n\t\tint[] SumC=new int[c];\n\t\tfor (int i=0;i<r;i++){\n\t\t\tstr =br.readLine();\n\t\t\tdat = str.split(\" \");\n\t\t\tg=0;\n\t\t\tfor (int j=0;j<c;j++){\n\t\t\t\tp=Integer.parseInt(dat[j]);\n\t\t\t\tg += p;\n\t\t\t\tSumC[j] += p;\n\t\t\t}\n\t\t\tgg+=g;\n\t\t\tout.append(str+\" \"+g+\"\\n\");\n\t\t}\n\t\tfor (int j=0;j<c;j++) out.append(SumC[j]+\" \");\n\t\tout.append(gg);\n\t\tSystem.out.println(out);\n\t}\n}",
"import java.io.*;",
"io.*",
"java",
"public class Main {\n\tpublic static void main(String[] args) throws IOException{\n\t\tBufferedReader br=new BufferedReader(new InputStreamReader(System.in));\n\t\tString[] dat = br.readLine().split(\" \");\n\t\tint r = Integer.parseInt(dat[0]);\n\t\tint c = Integer.parseInt(dat[1]);\n\t\tStringBuilder out=new StringBuilder();\n\t\tint g,p,gg=0;\n\t\tString str;\n\t\tint[] SumC=new int[c];\n\t\tfor (int i=0;i<r;i++){\n\t\t\tstr =br.readLine();\n\t\t\tdat = str.split(\" \");\n\t\t\tg=0;\n\t\t\tfor (int j=0;j<c;j++){\n\t\t\t\tp=Integer.parseInt(dat[j]);\n\t\t\t\tg += p;\n\t\t\t\tSumC[j] += p;\n\t\t\t}\n\t\t\tgg+=g;\n\t\t\tout.append(str+\" \"+g+\"\\n\");\n\t\t}\n\t\tfor (int j=0;j<c;j++) out.append(SumC[j]+\" \");\n\t\tout.append(gg);\n\t\tSystem.out.println(out);\n\t}\n}",
"Main",
"public static void main(String[] args) throws IOException{\n\t\tBufferedReader br=new BufferedReader(new InputStreamReader(System.in));\n\t\tString[] dat = br.readLine().split(\" \");\n\t\tint r = Integer.parseInt(dat[0]);\n\t\tint c = Integer.parseInt(dat[1]);\n\t\tStringBuilder out=new StringBuilder();\n\t\tint g,p,gg=0;\n\t\tString str;\n\t\tint[] SumC=new int[c];\n\t\tfor (int i=0;i<r;i++){\n\t\t\tstr =br.readLine();\n\t\t\tdat = str.split(\" \");\n\t\t\tg=0;\n\t\t\tfor (int j=0;j<c;j++){\n\t\t\t\tp=Integer.parseInt(dat[j]);\n\t\t\t\tg += p;\n\t\t\t\tSumC[j] += p;\n\t\t\t}\n\t\t\tgg+=g;\n\t\t\tout.append(str+\" \"+g+\"\\n\");\n\t\t}\n\t\tfor (int j=0;j<c;j++) out.append(SumC[j]+\" \");\n\t\tout.append(gg);\n\t\tSystem.out.println(out);\n\t}",
"main",
"{\n\t\tBufferedReader br=new BufferedReader(new InputStreamReader(System.in));\n\t\tString[] dat = br.readLine().split(\" \");\n\t\tint r = Integer.parseInt(dat[0]);\n\t\tint c = Integer.parseInt(dat[1]);\n\t\tStringBuilder out=new StringBuilder();\n\t\tint g,p,gg=0;\n\t\tString str;\n\t\tint[] SumC=new int[c];\n\t\tfor (int i=0;i<r;i++){\n\t\t\tstr =br.readLine();\n\t\t\tdat = str.split(\" \");\n\t\t\tg=0;\n\t\t\tfor (int j=0;j<c;j++){\n\t\t\t\tp=Integer.parseInt(dat[j]);\n\t\t\t\tg += p;\n\t\t\t\tSumC[j] += p;\n\t\t\t}\n\t\t\tgg+=g;\n\t\t\tout.append(str+\" \"+g+\"\\n\");\n\t\t}\n\t\tfor (int j=0;j<c;j++) out.append(SumC[j]+\" \");\n\t\tout.append(gg);\n\t\tSystem.out.println(out);\n\t}",
"BufferedReader br=new BufferedReader(new InputStreamReader(System.in));",
"br",
"new BufferedReader(new InputStreamReader(System.in))",
"String[] dat = br.readLine().split(\" \");",
"dat",
"br.readLine().split(\" \")",
"br.readLine().split",
"br.readLine()",
"br.readLine",
"br",
"\" \"",
"int r = Integer.parseInt(dat[0]);",
"r",
"Integer.parseInt(dat[0])",
"Integer.parseInt",
"Integer",
"dat[0]",
"dat",
"0",
"int c = Integer.parseInt(dat[1]);",
"c",
"Integer.parseInt(dat[1])",
"Integer.parseInt",
"Integer",
"dat[1]",
"dat",
"1",
"StringBuilder out=new StringBuilder();",
"out",
"new StringBuilder()",
"int g",
"g",
"p",
"p",
"gg=0;",
"gg",
"0",
"String str;",
"str",
"int[] SumC=new int[c];",
"SumC",
"new int[c]",
"c",
"for (int i=0;i<r;i++){\n\t\t\tstr =br.readLine();\n\t\t\tdat = str.split(\" \");\n\t\t\tg=0;\n\t\t\tfor (int j=0;j<c;j++){\n\t\t\t\tp=Integer.parseInt(dat[j]);\n\t\t\t\tg += p;\n\t\t\t\tSumC[j] += p;\n\t\t\t}\n\t\t\tgg+=g;\n\t\t\tout.append(str+\" \"+g+\"\\n\");\n\t\t}",
"int i=0;",
"int i=0;",
"i",
"0",
"i<r",
"i",
"r",
"i++",
"i++",
"i",
"{\n\t\t\tstr =br.readLine();\n\t\t\tdat = str.split(\" \");\n\t\t\tg=0;\n\t\t\tfor (int j=0;j<c;j++){\n\t\t\t\tp=Integer.parseInt(dat[j]);\n\t\t\t\tg += p;\n\t\t\t\tSumC[j] += p;\n\t\t\t}\n\t\t\tgg+=g;\n\t\t\tout.append(str+\" \"+g+\"\\n\");\n\t\t}",
"{\n\t\t\tstr =br.readLine();\n\t\t\tdat = str.split(\" \");\n\t\t\tg=0;\n\t\t\tfor (int j=0;j<c;j++){\n\t\t\t\tp=Integer.parseInt(dat[j]);\n\t\t\t\tg += p;\n\t\t\t\tSumC[j] += p;\n\t\t\t}\n\t\t\tgg+=g;\n\t\t\tout.append(str+\" \"+g+\"\\n\");\n\t\t}",
"str =br.readLine()",
"str",
"br.readLine()",
"br.readLine",
"br",
"dat = str.split(\" \")",
"dat",
"str.split(\" \")",
"str.split",
"str",
"\" \"",
"g=0",
"g",
"0",
"for (int j=0;j<c;j++){\n\t\t\t\tp=Integer.parseInt(dat[j]);\n\t\t\t\tg += p;\n\t\t\t\tSumC[j] += p;\n\t\t\t}",
"int j=0;",
"int j=0;",
"j",
"0",
"j<c",
"j",
"c",
"j++",
"j++",
"j",
"{\n\t\t\t\tp=Integer.parseInt(dat[j]);\n\t\t\t\tg += p;\n\t\t\t\tSumC[j] += p;\n\t\t\t}",
"{\n\t\t\t\tp=Integer.parseInt(dat[j]);\n\t\t\t\tg += p;\n\t\t\t\tSumC[j] += p;\n\t\t\t}",
"p=Integer.parseInt(dat[j])",
"p",
"Integer.parseInt(dat[j])",
"Integer.parseInt",
"Integer",
"dat[j]",
"dat",
"j",
"g += p",
"g",
"p",
"SumC[j] += p",
"SumC[j]",
"SumC",
"j",
"p",
"gg+=g",
"gg",
"g",
"out.append(str+\" \"+g+\"\\n\")",
"out.append",
"out",
"str+\" \"+g+\"\\n\"",
"g",
"str+\" \"+g+\"\\n\"",
"str",
"\" \"",
"g",
"\"\\n\"",
"for (int j=0;j<c;j++) out.append(SumC[j]+\" \");",
"int j=0;",
"int j=0;",
"j",
"0",
"j<c",
"j",
"c",
"j++",
"j++",
"j",
"out.append(SumC[j]+\" \");",
"out.append(SumC[j]+\" \")",
"out.append",
"out",
"SumC[j]+\" \"",
"SumC[j]",
"SumC",
"j",
"\" \"",
"out.append(gg)",
"out.append",
"out",
"gg",
"System.out.println(out)",
"System.out.println",
"System.out",
"System",
"System.out",
"out",
"String[] args",
"args",
"public class Main {\n\tpublic static void main(String[] args) throws IOException{\n\t\tBufferedReader br=new BufferedReader(new InputStreamReader(System.in));\n\t\tString[] dat = br.readLine().split(\" \");\n\t\tint r = Integer.parseInt(dat[0]);\n\t\tint c = Integer.parseInt(dat[1]);\n\t\tStringBuilder out=new StringBuilder();\n\t\tint g,p,gg=0;\n\t\tString str;\n\t\tint[] SumC=new int[c];\n\t\tfor (int i=0;i<r;i++){\n\t\t\tstr =br.readLine();\n\t\t\tdat = str.split(\" \");\n\t\t\tg=0;\n\t\t\tfor (int j=0;j<c;j++){\n\t\t\t\tp=Integer.parseInt(dat[j]);\n\t\t\t\tg += p;\n\t\t\t\tSumC[j] += p;\n\t\t\t}\n\t\t\tgg+=g;\n\t\t\tout.append(str+\" \"+g+\"\\n\");\n\t\t}\n\t\tfor (int j=0;j<c;j++) out.append(SumC[j]+\" \");\n\t\tout.append(gg);\n\t\tSystem.out.println(out);\n\t}\n}",
"public class Main {\n\tpublic static void main(String[] args) throws IOException{\n\t\tBufferedReader br=new BufferedReader(new InputStreamReader(System.in));\n\t\tString[] dat = br.readLine().split(\" \");\n\t\tint r = Integer.parseInt(dat[0]);\n\t\tint c = Integer.parseInt(dat[1]);\n\t\tStringBuilder out=new StringBuilder();\n\t\tint g,p,gg=0;\n\t\tString str;\n\t\tint[] SumC=new int[c];\n\t\tfor (int i=0;i<r;i++){\n\t\t\tstr =br.readLine();\n\t\t\tdat = str.split(\" \");\n\t\t\tg=0;\n\t\t\tfor (int j=0;j<c;j++){\n\t\t\t\tp=Integer.parseInt(dat[j]);\n\t\t\t\tg += p;\n\t\t\t\tSumC[j] += p;\n\t\t\t}\n\t\t\tgg+=g;\n\t\t\tout.append(str+\" \"+g+\"\\n\");\n\t\t}\n\t\tfor (int j=0;j<c;j++) out.append(SumC[j]+\" \");\n\t\tout.append(gg);\n\t\tSystem.out.println(out);\n\t}\n}",
"Main"
] | import java.io.*;
public class Main {
public static void main(String[] args) throws IOException{
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
String[] dat = br.readLine().split(" ");
int r = Integer.parseInt(dat[0]);
int c = Integer.parseInt(dat[1]);
StringBuilder out=new StringBuilder();
int g,p,gg=0;
String str;
int[] SumC=new int[c];
for (int i=0;i<r;i++){
str =br.readLine();
dat = str.split(" ");
g=0;
for (int j=0;j<c;j++){
p=Integer.parseInt(dat[j]);
g += p;
SumC[j] += p;
}
gg+=g;
out.append(str+" "+g+"\n");
}
for (int j=0;j<c;j++) out.append(SumC[j]+" ");
out.append(gg);
System.out.println(out);
}
} |
[
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,
4,
18,
13,
17,
41,
13,
20,
41,
13,
20,
11,
1,
41,
13,
17,
2,
13,
2,
4,
18,
13,
18,
13,
17,
17,
1,
40,
13,
30,
30,
14,
2,
13,
4,
18,
13,
18,
13,
17,
30,
11,
1,
41,
13,
17,
2,
13,
2,
4,
18,
13,
18,
13,
17,
17,
1,
40,
13,
30,
30,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
4,
18,
13,
18,
13,
17,
1,
40,
13,
30,
30,
0,
13,
4,
18,
4,
18,
13,
13,
13,
4,
18,
13,
13,
4,
18,
13,
13,
30,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
17,
11,
1,
41,
13,
17,
2,
13,
2,
4,
18,
13,
18,
13,
17,
17,
1,
40,
13,
30,
30,
14,
2,
13,
4,
18,
13,
18,
13,
17,
30,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
4,
18,
13,
1,
40,
13,
30,
30,
0,
13,
4,
18,
13,
13,
4,
18,
13,
13,
30,
4,
18,
13,
4,
18,
13,
18,
13,
13,
4,
18,
13,
13,
0,
13,
20,
11,
1,
41,
13,
17,
2,
13,
2,
4,
18,
13,
18,
13,
17,
17,
1,
40,
13,
30,
30,
11,
1,
41,
13,
17,
2,
13,
2,
4,
18,
13,
18,
13,
17,
17,
1,
40,
13,
30,
30,
14,
2,
13,
4,
18,
13,
18,
13,
17,
30,
4,
18,
18,
13,
13,
4,
18,
4,
18,
13,
13,
13,
30,
4,
18,
18,
13,
13,
2,
4,
18,
4,
18,
13,
13,
13,
17,
23,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
10,
11
],
[
10,
12
],
[
0,
13
],
[
13,
14
],
[
13,
15
],
[
15,
16
],
[
15,
17
],
[
17,
18
],
[
18,
19
],
[
18,
20
],
[
17,
21
],
[
21,
22
],
[
21,
23
],
[
23,
24
],
[
24,
25
],
[
25,
26
],
[
26,
27
],
[
23,
28
],
[
17,
29
],
[
29,
30
],
[
29,
31
],
[
17,
32
],
[
32,
33
],
[
32,
34
],
[
17,
35
],
[
35,
36
],
[
36,
37
],
[
37,
38
],
[
37,
39
],
[
35,
40
],
[
40,
41
],
[
40,
42
],
[
42,
43
],
[
43,
44
],
[
44,
45
],
[
43,
46
],
[
46,
47
],
[
46,
48
],
[
42,
49
],
[
35,
50
],
[
50,
51
],
[
51,
52
],
[
35,
53
],
[
54,
54
],
[
54,
55
],
[
55,
56
],
[
56,
57
],
[
56,
58
],
[
58,
59
],
[
59,
60
],
[
58,
61
],
[
61,
62
],
[
61,
63
],
[
55,
64
],
[
64,
65
],
[
65,
66
],
[
66,
67
],
[
67,
68
],
[
67,
69
],
[
65,
70
],
[
70,
71
],
[
70,
72
],
[
72,
73
],
[
73,
74
],
[
74,
75
],
[
73,
76
],
[
76,
77
],
[
76,
78
],
[
72,
79
],
[
65,
80
],
[
80,
81
],
[
81,
82
],
[
65,
83
],
[
84,
84
],
[
84,
85
],
[
85,
86
],
[
85,
87
],
[
84,
88
],
[
88,
89
],
[
89,
90
],
[
90,
91
],
[
90,
92
],
[
88,
93
],
[
93,
94
],
[
93,
95
],
[
95,
96
],
[
96,
97
],
[
95,
98
],
[
98,
99
],
[
98,
100
],
[
88,
101
],
[
101,
102
],
[
102,
103
],
[
88,
104
],
[
105,
105
],
[
105,
106
],
[
106,
107
],
[
106,
108
],
[
108,
109
],
[
109,
110
],
[
110,
111
],
[
111,
112
],
[
110,
113
],
[
108,
114
],
[
84,
115
],
[
115,
116
],
[
116,
117
],
[
115,
118
],
[
64,
119
],
[
119,
120
],
[
120,
121
],
[
119,
122
],
[
55,
123
],
[
123,
124
],
[
124,
125
],
[
124,
126
],
[
126,
127
],
[
127,
128
],
[
123,
129
],
[
129,
130
],
[
129,
131
],
[
131,
132
],
[
132,
133
],
[
131,
134
],
[
123,
135
],
[
135,
136
],
[
136,
137
],
[
137,
138
],
[
137,
139
],
[
135,
140
],
[
140,
141
],
[
140,
142
],
[
142,
143
],
[
143,
144
],
[
144,
145
],
[
143,
146
],
[
146,
147
],
[
146,
148
],
[
142,
149
],
[
135,
150
],
[
150,
151
],
[
151,
152
],
[
135,
153
],
[
154,
154
],
[
154,
155
],
[
155,
156
],
[
156,
157
],
[
156,
158
],
[
158,
159
],
[
159,
160
],
[
158,
161
],
[
161,
162
],
[
161,
163
],
[
155,
164
],
[
164,
165
],
[
165,
166
],
[
165,
167
],
[
164,
168
],
[
168,
169
],
[
169,
170
],
[
170,
171
],
[
170,
172
],
[
168,
173
],
[
173,
174
],
[
173,
175
],
[
175,
176
],
[
176,
177
],
[
168,
178
],
[
178,
179
],
[
179,
180
],
[
168,
181
],
[
182,
182
],
[
182,
183
],
[
183,
184
],
[
183,
185
],
[
185,
186
],
[
186,
187
],
[
185,
188
],
[
164,
189
],
[
189,
190
],
[
190,
191
],
[
189,
192
],
[
155,
193
],
[
193,
194
],
[
194,
195
],
[
195,
196
],
[
194,
197
],
[
197,
198
],
[
198,
199
],
[
197,
200
],
[
200,
201
],
[
200,
202
],
[
123,
203
],
[
203,
204
],
[
204,
205
],
[
203,
206
],
[
123,
207
],
[
207,
208
],
[
207,
209
],
[
17,
210
],
[
210,
211
],
[
211,
212
],
[
212,
213
],
[
212,
214
],
[
210,
215
],
[
215,
216
],
[
215,
217
],
[
217,
218
],
[
218,
219
],
[
219,
220
],
[
218,
221
],
[
221,
222
],
[
221,
223
],
[
217,
224
],
[
210,
225
],
[
225,
226
],
[
226,
227
],
[
210,
228
],
[
229,
229
],
[
229,
230
],
[
230,
231
],
[
231,
232
],
[
232,
233
],
[
232,
234
],
[
230,
235
],
[
235,
236
],
[
235,
237
],
[
237,
238
],
[
238,
239
],
[
239,
240
],
[
238,
241
],
[
241,
242
],
[
241,
243
],
[
237,
244
],
[
230,
245
],
[
245,
246
],
[
246,
247
],
[
230,
248
],
[
249,
249
],
[
249,
250
],
[
250,
251
],
[
251,
252
],
[
251,
253
],
[
253,
254
],
[
254,
255
],
[
253,
256
],
[
256,
257
],
[
256,
258
],
[
250,
259
],
[
259,
260
],
[
260,
261
],
[
261,
262
],
[
262,
263
],
[
262,
264
],
[
260,
265
],
[
265,
266
],
[
266,
267
],
[
267,
268
],
[
268,
269
],
[
267,
270
],
[
265,
271
],
[
250,
272
],
[
272,
273
],
[
273,
274
],
[
274,
275
],
[
275,
276
],
[
275,
277
],
[
273,
278
],
[
278,
279
],
[
279,
280
],
[
280,
281
],
[
281,
282
],
[
282,
283
],
[
281,
284
],
[
279,
285
],
[
278,
286
],
[
15,
287
],
[
287,
288
]
] | [
"import java.io.BufferedReader;\nimport java.io.IOException;\nimport java.io.InputStreamReader;\nimport java.util.ArrayList;\n\nclass Main {\n\n\tpublic static void main(String[] args) throws IOException {\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\t\tString[] strRC = br.readLine().split(\" \");\n\t\tArrayList<Integer> niKaiso = new ArrayList<Integer>();\n\t\tArrayList<ArrayList<Integer>> itiKaiso = new ArrayList<ArrayList<Integer>>();\n\t\tfor (int i = 0; i < Integer.parseInt(strRC[0]) + 1; i++) {\n\t\t\tif (i == Integer.parseInt(strRC[0])) {\n\t\t\t\tfor (int j = 0; j < Integer.parseInt(strRC[1]) + 1; j++) {\n\t\t\t\t\tInteger sum = 0;\n\t\t\t\t\tfor (int k = 0; k < Integer.parseInt(strRC[0]); k++) {\n\t\t\t\t\t\tsum += itiKaiso.get(k).get(j);\n\t\t\t\t\t}\n\t\t\t\t\tniKaiso.add(sum);\n\t\t\t\t}\n\t\t\t\titiKaiso.add(niKaiso);\n\t\t\t} else {\n\t\t\t\tString line = br.readLine();\n\t\t\t\tString[] lineArrays = line.split(\" \");\n\t\t\t\tfor (int j = 0; j < Integer.parseInt(strRC[1]) + 1; j++) {\n\t\t\t\t\tif (j == Integer.parseInt(strRC[1])) {\n\t\t\t\t\t\tInteger sum = 0;\n\t\t\t\t\t\tfor (int k = 0; k < niKaiso.size(); k++) {\n\t\t\t\t\t\t\tsum += niKaiso.get(k);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tniKaiso.add(sum);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tniKaiso.add(Integer.parseInt(lineArrays[j]));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\titiKaiso.add(niKaiso);\n\t\t\t\tniKaiso = new ArrayList<Integer>();\n\t\t\t}\n\t\t}\n\t\tfor (int i = 0; i < Integer.parseInt(strRC[0]) + 1; i++) {\n\t\t\tfor (int j = 0; j < Integer.parseInt(strRC[1]) + 1; j++) {\n\t\t\t\tif (j == Integer.parseInt(strRC[1])) {\n\t\t\t\t\tSystem.out.println(itiKaiso.get(i).get(j));\n\t\t\t\t} else {\n\t\t\t\t\tSystem.out.print(itiKaiso.get(i).get(j) + \" \");\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}",
"import java.io.BufferedReader;",
"BufferedReader",
"java.io",
"import java.io.IOException;",
"IOException",
"java.io",
"import java.io.InputStreamReader;",
"InputStreamReader",
"java.io",
"import java.util.ArrayList;",
"ArrayList",
"java.util",
"class Main {\n\n\tpublic static void main(String[] args) throws IOException {\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\t\tString[] strRC = br.readLine().split(\" \");\n\t\tArrayList<Integer> niKaiso = new ArrayList<Integer>();\n\t\tArrayList<ArrayList<Integer>> itiKaiso = new ArrayList<ArrayList<Integer>>();\n\t\tfor (int i = 0; i < Integer.parseInt(strRC[0]) + 1; i++) {\n\t\t\tif (i == Integer.parseInt(strRC[0])) {\n\t\t\t\tfor (int j = 0; j < Integer.parseInt(strRC[1]) + 1; j++) {\n\t\t\t\t\tInteger sum = 0;\n\t\t\t\t\tfor (int k = 0; k < Integer.parseInt(strRC[0]); k++) {\n\t\t\t\t\t\tsum += itiKaiso.get(k).get(j);\n\t\t\t\t\t}\n\t\t\t\t\tniKaiso.add(sum);\n\t\t\t\t}\n\t\t\t\titiKaiso.add(niKaiso);\n\t\t\t} else {\n\t\t\t\tString line = br.readLine();\n\t\t\t\tString[] lineArrays = line.split(\" \");\n\t\t\t\tfor (int j = 0; j < Integer.parseInt(strRC[1]) + 1; j++) {\n\t\t\t\t\tif (j == Integer.parseInt(strRC[1])) {\n\t\t\t\t\t\tInteger sum = 0;\n\t\t\t\t\t\tfor (int k = 0; k < niKaiso.size(); k++) {\n\t\t\t\t\t\t\tsum += niKaiso.get(k);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tniKaiso.add(sum);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tniKaiso.add(Integer.parseInt(lineArrays[j]));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\titiKaiso.add(niKaiso);\n\t\t\t\tniKaiso = new ArrayList<Integer>();\n\t\t\t}\n\t\t}\n\t\tfor (int i = 0; i < Integer.parseInt(strRC[0]) + 1; i++) {\n\t\t\tfor (int j = 0; j < Integer.parseInt(strRC[1]) + 1; j++) {\n\t\t\t\tif (j == Integer.parseInt(strRC[1])) {\n\t\t\t\t\tSystem.out.println(itiKaiso.get(i).get(j));\n\t\t\t\t} else {\n\t\t\t\t\tSystem.out.print(itiKaiso.get(i).get(j) + \" \");\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}",
"Main",
"public static void main(String[] args) throws IOException {\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\t\tString[] strRC = br.readLine().split(\" \");\n\t\tArrayList<Integer> niKaiso = new ArrayList<Integer>();\n\t\tArrayList<ArrayList<Integer>> itiKaiso = new ArrayList<ArrayList<Integer>>();\n\t\tfor (int i = 0; i < Integer.parseInt(strRC[0]) + 1; i++) {\n\t\t\tif (i == Integer.parseInt(strRC[0])) {\n\t\t\t\tfor (int j = 0; j < Integer.parseInt(strRC[1]) + 1; j++) {\n\t\t\t\t\tInteger sum = 0;\n\t\t\t\t\tfor (int k = 0; k < Integer.parseInt(strRC[0]); k++) {\n\t\t\t\t\t\tsum += itiKaiso.get(k).get(j);\n\t\t\t\t\t}\n\t\t\t\t\tniKaiso.add(sum);\n\t\t\t\t}\n\t\t\t\titiKaiso.add(niKaiso);\n\t\t\t} else {\n\t\t\t\tString line = br.readLine();\n\t\t\t\tString[] lineArrays = line.split(\" \");\n\t\t\t\tfor (int j = 0; j < Integer.parseInt(strRC[1]) + 1; j++) {\n\t\t\t\t\tif (j == Integer.parseInt(strRC[1])) {\n\t\t\t\t\t\tInteger sum = 0;\n\t\t\t\t\t\tfor (int k = 0; k < niKaiso.size(); k++) {\n\t\t\t\t\t\t\tsum += niKaiso.get(k);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tniKaiso.add(sum);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tniKaiso.add(Integer.parseInt(lineArrays[j]));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\titiKaiso.add(niKaiso);\n\t\t\t\tniKaiso = new ArrayList<Integer>();\n\t\t\t}\n\t\t}\n\t\tfor (int i = 0; i < Integer.parseInt(strRC[0]) + 1; i++) {\n\t\t\tfor (int j = 0; j < Integer.parseInt(strRC[1]) + 1; j++) {\n\t\t\t\tif (j == Integer.parseInt(strRC[1])) {\n\t\t\t\t\tSystem.out.println(itiKaiso.get(i).get(j));\n\t\t\t\t} else {\n\t\t\t\t\tSystem.out.print(itiKaiso.get(i).get(j) + \" \");\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"main",
"{\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\t\tString[] strRC = br.readLine().split(\" \");\n\t\tArrayList<Integer> niKaiso = new ArrayList<Integer>();\n\t\tArrayList<ArrayList<Integer>> itiKaiso = new ArrayList<ArrayList<Integer>>();\n\t\tfor (int i = 0; i < Integer.parseInt(strRC[0]) + 1; i++) {\n\t\t\tif (i == Integer.parseInt(strRC[0])) {\n\t\t\t\tfor (int j = 0; j < Integer.parseInt(strRC[1]) + 1; j++) {\n\t\t\t\t\tInteger sum = 0;\n\t\t\t\t\tfor (int k = 0; k < Integer.parseInt(strRC[0]); k++) {\n\t\t\t\t\t\tsum += itiKaiso.get(k).get(j);\n\t\t\t\t\t}\n\t\t\t\t\tniKaiso.add(sum);\n\t\t\t\t}\n\t\t\t\titiKaiso.add(niKaiso);\n\t\t\t} else {\n\t\t\t\tString line = br.readLine();\n\t\t\t\tString[] lineArrays = line.split(\" \");\n\t\t\t\tfor (int j = 0; j < Integer.parseInt(strRC[1]) + 1; j++) {\n\t\t\t\t\tif (j == Integer.parseInt(strRC[1])) {\n\t\t\t\t\t\tInteger sum = 0;\n\t\t\t\t\t\tfor (int k = 0; k < niKaiso.size(); k++) {\n\t\t\t\t\t\t\tsum += niKaiso.get(k);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tniKaiso.add(sum);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tniKaiso.add(Integer.parseInt(lineArrays[j]));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\titiKaiso.add(niKaiso);\n\t\t\t\tniKaiso = new ArrayList<Integer>();\n\t\t\t}\n\t\t}\n\t\tfor (int i = 0; i < Integer.parseInt(strRC[0]) + 1; i++) {\n\t\t\tfor (int j = 0; j < Integer.parseInt(strRC[1]) + 1; j++) {\n\t\t\t\tif (j == Integer.parseInt(strRC[1])) {\n\t\t\t\t\tSystem.out.println(itiKaiso.get(i).get(j));\n\t\t\t\t} else {\n\t\t\t\t\tSystem.out.print(itiKaiso.get(i).get(j) + \" \");\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"BufferedReader br = new BufferedReader(new InputStreamReader(System.in));",
"br",
"new BufferedReader(new InputStreamReader(System.in))",
"String[] strRC = br.readLine().split(\" \");",
"strRC",
"br.readLine().split(\" \")",
"br.readLine().split",
"br.readLine()",
"br.readLine",
"br",
"\" \"",
"ArrayList<Integer> niKaiso = new ArrayList<Integer>();",
"niKaiso",
"new ArrayList<Integer>()",
"ArrayList<ArrayList<Integer>> itiKaiso = new ArrayList<ArrayList<Integer>>();",
"itiKaiso",
"new ArrayList<ArrayList<Integer>>()",
"for (int i = 0; i < Integer.parseInt(strRC[0]) + 1; i++) {\n\t\t\tif (i == Integer.parseInt(strRC[0])) {\n\t\t\t\tfor (int j = 0; j < Integer.parseInt(strRC[1]) + 1; j++) {\n\t\t\t\t\tInteger sum = 0;\n\t\t\t\t\tfor (int k = 0; k < Integer.parseInt(strRC[0]); k++) {\n\t\t\t\t\t\tsum += itiKaiso.get(k).get(j);\n\t\t\t\t\t}\n\t\t\t\t\tniKaiso.add(sum);\n\t\t\t\t}\n\t\t\t\titiKaiso.add(niKaiso);\n\t\t\t} else {\n\t\t\t\tString line = br.readLine();\n\t\t\t\tString[] lineArrays = line.split(\" \");\n\t\t\t\tfor (int j = 0; j < Integer.parseInt(strRC[1]) + 1; j++) {\n\t\t\t\t\tif (j == Integer.parseInt(strRC[1])) {\n\t\t\t\t\t\tInteger sum = 0;\n\t\t\t\t\t\tfor (int k = 0; k < niKaiso.size(); k++) {\n\t\t\t\t\t\t\tsum += niKaiso.get(k);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tniKaiso.add(sum);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tniKaiso.add(Integer.parseInt(lineArrays[j]));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\titiKaiso.add(niKaiso);\n\t\t\t\tniKaiso = new ArrayList<Integer>();\n\t\t\t}\n\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < Integer.parseInt(strRC[0]) + 1",
"i",
"Integer.parseInt(strRC[0]) + 1",
"Integer.parseInt(strRC[0])",
"Integer.parseInt",
"Integer",
"strRC[0]",
"strRC",
"0",
"1",
"i++",
"i++",
"i",
"{\n\t\t\tif (i == Integer.parseInt(strRC[0])) {\n\t\t\t\tfor (int j = 0; j < Integer.parseInt(strRC[1]) + 1; j++) {\n\t\t\t\t\tInteger sum = 0;\n\t\t\t\t\tfor (int k = 0; k < Integer.parseInt(strRC[0]); k++) {\n\t\t\t\t\t\tsum += itiKaiso.get(k).get(j);\n\t\t\t\t\t}\n\t\t\t\t\tniKaiso.add(sum);\n\t\t\t\t}\n\t\t\t\titiKaiso.add(niKaiso);\n\t\t\t} else {\n\t\t\t\tString line = br.readLine();\n\t\t\t\tString[] lineArrays = line.split(\" \");\n\t\t\t\tfor (int j = 0; j < Integer.parseInt(strRC[1]) + 1; j++) {\n\t\t\t\t\tif (j == Integer.parseInt(strRC[1])) {\n\t\t\t\t\t\tInteger sum = 0;\n\t\t\t\t\t\tfor (int k = 0; k < niKaiso.size(); k++) {\n\t\t\t\t\t\t\tsum += niKaiso.get(k);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tniKaiso.add(sum);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tniKaiso.add(Integer.parseInt(lineArrays[j]));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\titiKaiso.add(niKaiso);\n\t\t\t\tniKaiso = new ArrayList<Integer>();\n\t\t\t}\n\t\t}",
"{\n\t\t\tif (i == Integer.parseInt(strRC[0])) {\n\t\t\t\tfor (int j = 0; j < Integer.parseInt(strRC[1]) + 1; j++) {\n\t\t\t\t\tInteger sum = 0;\n\t\t\t\t\tfor (int k = 0; k < Integer.parseInt(strRC[0]); k++) {\n\t\t\t\t\t\tsum += itiKaiso.get(k).get(j);\n\t\t\t\t\t}\n\t\t\t\t\tniKaiso.add(sum);\n\t\t\t\t}\n\t\t\t\titiKaiso.add(niKaiso);\n\t\t\t} else {\n\t\t\t\tString line = br.readLine();\n\t\t\t\tString[] lineArrays = line.split(\" \");\n\t\t\t\tfor (int j = 0; j < Integer.parseInt(strRC[1]) + 1; j++) {\n\t\t\t\t\tif (j == Integer.parseInt(strRC[1])) {\n\t\t\t\t\t\tInteger sum = 0;\n\t\t\t\t\t\tfor (int k = 0; k < niKaiso.size(); k++) {\n\t\t\t\t\t\t\tsum += niKaiso.get(k);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tniKaiso.add(sum);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tniKaiso.add(Integer.parseInt(lineArrays[j]));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\titiKaiso.add(niKaiso);\n\t\t\t\tniKaiso = new ArrayList<Integer>();\n\t\t\t}\n\t\t}",
"if (i == Integer.parseInt(strRC[0])) {\n\t\t\t\tfor (int j = 0; j < Integer.parseInt(strRC[1]) + 1; j++) {\n\t\t\t\t\tInteger sum = 0;\n\t\t\t\t\tfor (int k = 0; k < Integer.parseInt(strRC[0]); k++) {\n\t\t\t\t\t\tsum += itiKaiso.get(k).get(j);\n\t\t\t\t\t}\n\t\t\t\t\tniKaiso.add(sum);\n\t\t\t\t}\n\t\t\t\titiKaiso.add(niKaiso);\n\t\t\t} else {\n\t\t\t\tString line = br.readLine();\n\t\t\t\tString[] lineArrays = line.split(\" \");\n\t\t\t\tfor (int j = 0; j < Integer.parseInt(strRC[1]) + 1; j++) {\n\t\t\t\t\tif (j == Integer.parseInt(strRC[1])) {\n\t\t\t\t\t\tInteger sum = 0;\n\t\t\t\t\t\tfor (int k = 0; k < niKaiso.size(); k++) {\n\t\t\t\t\t\t\tsum += niKaiso.get(k);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tniKaiso.add(sum);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tniKaiso.add(Integer.parseInt(lineArrays[j]));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\titiKaiso.add(niKaiso);\n\t\t\t\tniKaiso = new ArrayList<Integer>();\n\t\t\t}",
"i == Integer.parseInt(strRC[0])",
"i",
"Integer.parseInt(strRC[0])",
"Integer.parseInt",
"Integer",
"strRC[0]",
"strRC",
"0",
"{\n\t\t\t\tfor (int j = 0; j < Integer.parseInt(strRC[1]) + 1; j++) {\n\t\t\t\t\tInteger sum = 0;\n\t\t\t\t\tfor (int k = 0; k < Integer.parseInt(strRC[0]); k++) {\n\t\t\t\t\t\tsum += itiKaiso.get(k).get(j);\n\t\t\t\t\t}\n\t\t\t\t\tniKaiso.add(sum);\n\t\t\t\t}\n\t\t\t\titiKaiso.add(niKaiso);\n\t\t\t}",
"for (int j = 0; j < Integer.parseInt(strRC[1]) + 1; j++) {\n\t\t\t\t\tInteger sum = 0;\n\t\t\t\t\tfor (int k = 0; k < Integer.parseInt(strRC[0]); k++) {\n\t\t\t\t\t\tsum += itiKaiso.get(k).get(j);\n\t\t\t\t\t}\n\t\t\t\t\tniKaiso.add(sum);\n\t\t\t\t}",
"int j = 0;",
"int j = 0;",
"j",
"0",
"j < Integer.parseInt(strRC[1]) + 1",
"j",
"Integer.parseInt(strRC[1]) + 1",
"Integer.parseInt(strRC[1])",
"Integer.parseInt",
"Integer",
"strRC[1]",
"strRC",
"1",
"1",
"j++",
"j++",
"j",
"{\n\t\t\t\t\tInteger sum = 0;\n\t\t\t\t\tfor (int k = 0; k < Integer.parseInt(strRC[0]); k++) {\n\t\t\t\t\t\tsum += itiKaiso.get(k).get(j);\n\t\t\t\t\t}\n\t\t\t\t\tniKaiso.add(sum);\n\t\t\t\t}",
"{\n\t\t\t\t\tInteger sum = 0;\n\t\t\t\t\tfor (int k = 0; k < Integer.parseInt(strRC[0]); k++) {\n\t\t\t\t\t\tsum += itiKaiso.get(k).get(j);\n\t\t\t\t\t}\n\t\t\t\t\tniKaiso.add(sum);\n\t\t\t\t}",
"Integer sum = 0;",
"sum",
"0",
"for (int k = 0; k < Integer.parseInt(strRC[0]); k++) {\n\t\t\t\t\t\tsum += itiKaiso.get(k).get(j);\n\t\t\t\t\t}",
"int k = 0;",
"int k = 0;",
"k",
"0",
"k < Integer.parseInt(strRC[0])",
"k",
"Integer.parseInt(strRC[0])",
"Integer.parseInt",
"Integer",
"strRC[0]",
"strRC",
"0",
"k++",
"k++",
"k",
"{\n\t\t\t\t\t\tsum += itiKaiso.get(k).get(j);\n\t\t\t\t\t}",
"{\n\t\t\t\t\t\tsum += itiKaiso.get(k).get(j);\n\t\t\t\t\t}",
"sum += itiKaiso.get(k).get(j)",
"sum",
"itiKaiso.get(k).get(j)",
"itiKaiso.get(k).get",
"itiKaiso.get(k)",
"itiKaiso.get",
"itiKaiso",
"k",
"j",
"niKaiso.add(sum)",
"niKaiso.add",
"niKaiso",
"sum",
"itiKaiso.add(niKaiso)",
"itiKaiso.add",
"itiKaiso",
"niKaiso",
"{\n\t\t\t\tString line = br.readLine();\n\t\t\t\tString[] lineArrays = line.split(\" \");\n\t\t\t\tfor (int j = 0; j < Integer.parseInt(strRC[1]) + 1; j++) {\n\t\t\t\t\tif (j == Integer.parseInt(strRC[1])) {\n\t\t\t\t\t\tInteger sum = 0;\n\t\t\t\t\t\tfor (int k = 0; k < niKaiso.size(); k++) {\n\t\t\t\t\t\t\tsum += niKaiso.get(k);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tniKaiso.add(sum);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tniKaiso.add(Integer.parseInt(lineArrays[j]));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\titiKaiso.add(niKaiso);\n\t\t\t\tniKaiso = new ArrayList<Integer>();\n\t\t\t}",
"String line = br.readLine();",
"line",
"br.readLine()",
"br.readLine",
"br",
"String[] lineArrays = line.split(\" \");",
"lineArrays",
"line.split(\" \")",
"line.split",
"line",
"\" \"",
"for (int j = 0; j < Integer.parseInt(strRC[1]) + 1; j++) {\n\t\t\t\t\tif (j == Integer.parseInt(strRC[1])) {\n\t\t\t\t\t\tInteger sum = 0;\n\t\t\t\t\t\tfor (int k = 0; k < niKaiso.size(); k++) {\n\t\t\t\t\t\t\tsum += niKaiso.get(k);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tniKaiso.add(sum);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tniKaiso.add(Integer.parseInt(lineArrays[j]));\n\t\t\t\t\t}\n\t\t\t\t}",
"int j = 0;",
"int j = 0;",
"j",
"0",
"j < Integer.parseInt(strRC[1]) + 1",
"j",
"Integer.parseInt(strRC[1]) + 1",
"Integer.parseInt(strRC[1])",
"Integer.parseInt",
"Integer",
"strRC[1]",
"strRC",
"1",
"1",
"j++",
"j++",
"j",
"{\n\t\t\t\t\tif (j == Integer.parseInt(strRC[1])) {\n\t\t\t\t\t\tInteger sum = 0;\n\t\t\t\t\t\tfor (int k = 0; k < niKaiso.size(); k++) {\n\t\t\t\t\t\t\tsum += niKaiso.get(k);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tniKaiso.add(sum);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tniKaiso.add(Integer.parseInt(lineArrays[j]));\n\t\t\t\t\t}\n\t\t\t\t}",
"{\n\t\t\t\t\tif (j == Integer.parseInt(strRC[1])) {\n\t\t\t\t\t\tInteger sum = 0;\n\t\t\t\t\t\tfor (int k = 0; k < niKaiso.size(); k++) {\n\t\t\t\t\t\t\tsum += niKaiso.get(k);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tniKaiso.add(sum);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tniKaiso.add(Integer.parseInt(lineArrays[j]));\n\t\t\t\t\t}\n\t\t\t\t}",
"if (j == Integer.parseInt(strRC[1])) {\n\t\t\t\t\t\tInteger sum = 0;\n\t\t\t\t\t\tfor (int k = 0; k < niKaiso.size(); k++) {\n\t\t\t\t\t\t\tsum += niKaiso.get(k);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tniKaiso.add(sum);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tniKaiso.add(Integer.parseInt(lineArrays[j]));\n\t\t\t\t\t}",
"j == Integer.parseInt(strRC[1])",
"j",
"Integer.parseInt(strRC[1])",
"Integer.parseInt",
"Integer",
"strRC[1]",
"strRC",
"1",
"{\n\t\t\t\t\t\tInteger sum = 0;\n\t\t\t\t\t\tfor (int k = 0; k < niKaiso.size(); k++) {\n\t\t\t\t\t\t\tsum += niKaiso.get(k);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tniKaiso.add(sum);\n\t\t\t\t\t}",
"Integer sum = 0;",
"sum",
"0",
"for (int k = 0; k < niKaiso.size(); k++) {\n\t\t\t\t\t\t\tsum += niKaiso.get(k);\n\t\t\t\t\t\t}",
"int k = 0;",
"int k = 0;",
"k",
"0",
"k < niKaiso.size()",
"k",
"niKaiso.size()",
"niKaiso.size",
"niKaiso",
"k++",
"k++",
"k",
"{\n\t\t\t\t\t\t\tsum += niKaiso.get(k);\n\t\t\t\t\t\t}",
"{\n\t\t\t\t\t\t\tsum += niKaiso.get(k);\n\t\t\t\t\t\t}",
"sum += niKaiso.get(k)",
"sum",
"niKaiso.get(k)",
"niKaiso.get",
"niKaiso",
"k",
"niKaiso.add(sum)",
"niKaiso.add",
"niKaiso",
"sum",
"{\n\t\t\t\t\t\tniKaiso.add(Integer.parseInt(lineArrays[j]));\n\t\t\t\t\t}",
"niKaiso.add(Integer.parseInt(lineArrays[j]))",
"niKaiso.add",
"niKaiso",
"Integer.parseInt(lineArrays[j])",
"Integer.parseInt",
"Integer",
"lineArrays[j]",
"lineArrays",
"j",
"itiKaiso.add(niKaiso)",
"itiKaiso.add",
"itiKaiso",
"niKaiso",
"niKaiso = new ArrayList<Integer>()",
"niKaiso",
"new ArrayList<Integer>()",
"for (int i = 0; i < Integer.parseInt(strRC[0]) + 1; i++) {\n\t\t\tfor (int j = 0; j < Integer.parseInt(strRC[1]) + 1; j++) {\n\t\t\t\tif (j == Integer.parseInt(strRC[1])) {\n\t\t\t\t\tSystem.out.println(itiKaiso.get(i).get(j));\n\t\t\t\t} else {\n\t\t\t\t\tSystem.out.print(itiKaiso.get(i).get(j) + \" \");\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < Integer.parseInt(strRC[0]) + 1",
"i",
"Integer.parseInt(strRC[0]) + 1",
"Integer.parseInt(strRC[0])",
"Integer.parseInt",
"Integer",
"strRC[0]",
"strRC",
"0",
"1",
"i++",
"i++",
"i",
"{\n\t\t\tfor (int j = 0; j < Integer.parseInt(strRC[1]) + 1; j++) {\n\t\t\t\tif (j == Integer.parseInt(strRC[1])) {\n\t\t\t\t\tSystem.out.println(itiKaiso.get(i).get(j));\n\t\t\t\t} else {\n\t\t\t\t\tSystem.out.print(itiKaiso.get(i).get(j) + \" \");\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"{\n\t\t\tfor (int j = 0; j < Integer.parseInt(strRC[1]) + 1; j++) {\n\t\t\t\tif (j == Integer.parseInt(strRC[1])) {\n\t\t\t\t\tSystem.out.println(itiKaiso.get(i).get(j));\n\t\t\t\t} else {\n\t\t\t\t\tSystem.out.print(itiKaiso.get(i).get(j) + \" \");\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"for (int j = 0; j < Integer.parseInt(strRC[1]) + 1; j++) {\n\t\t\t\tif (j == Integer.parseInt(strRC[1])) {\n\t\t\t\t\tSystem.out.println(itiKaiso.get(i).get(j));\n\t\t\t\t} else {\n\t\t\t\t\tSystem.out.print(itiKaiso.get(i).get(j) + \" \");\n\t\t\t\t}\n\t\t\t}",
"int j = 0;",
"int j = 0;",
"j",
"0",
"j < Integer.parseInt(strRC[1]) + 1",
"j",
"Integer.parseInt(strRC[1]) + 1",
"Integer.parseInt(strRC[1])",
"Integer.parseInt",
"Integer",
"strRC[1]",
"strRC",
"1",
"1",
"j++",
"j++",
"j",
"{\n\t\t\t\tif (j == Integer.parseInt(strRC[1])) {\n\t\t\t\t\tSystem.out.println(itiKaiso.get(i).get(j));\n\t\t\t\t} else {\n\t\t\t\t\tSystem.out.print(itiKaiso.get(i).get(j) + \" \");\n\t\t\t\t}\n\t\t\t}",
"{\n\t\t\t\tif (j == Integer.parseInt(strRC[1])) {\n\t\t\t\t\tSystem.out.println(itiKaiso.get(i).get(j));\n\t\t\t\t} else {\n\t\t\t\t\tSystem.out.print(itiKaiso.get(i).get(j) + \" \");\n\t\t\t\t}\n\t\t\t}",
"if (j == Integer.parseInt(strRC[1])) {\n\t\t\t\t\tSystem.out.println(itiKaiso.get(i).get(j));\n\t\t\t\t} else {\n\t\t\t\t\tSystem.out.print(itiKaiso.get(i).get(j) + \" \");\n\t\t\t\t}",
"j == Integer.parseInt(strRC[1])",
"j",
"Integer.parseInt(strRC[1])",
"Integer.parseInt",
"Integer",
"strRC[1]",
"strRC",
"1",
"{\n\t\t\t\t\tSystem.out.println(itiKaiso.get(i).get(j));\n\t\t\t\t}",
"System.out.println(itiKaiso.get(i).get(j))",
"System.out.println",
"System.out",
"System",
"System.out",
"itiKaiso.get(i).get(j)",
"itiKaiso.get(i).get",
"itiKaiso.get(i)",
"itiKaiso.get",
"itiKaiso",
"i",
"j",
"{\n\t\t\t\t\tSystem.out.print(itiKaiso.get(i).get(j) + \" \");\n\t\t\t\t}",
"System.out.print(itiKaiso.get(i).get(j) + \" \")",
"System.out.print",
"System.out",
"System",
"System.out",
"itiKaiso.get(i).get(j) + \" \"",
"itiKaiso.get(i).get(j)",
"itiKaiso.get(i).get",
"itiKaiso.get(i)",
"itiKaiso.get",
"itiKaiso",
"i",
"j",
"\" \"",
"String[] args",
"args"
] | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
class Main {
public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
String[] strRC = br.readLine().split(" ");
ArrayList<Integer> niKaiso = new ArrayList<Integer>();
ArrayList<ArrayList<Integer>> itiKaiso = new ArrayList<ArrayList<Integer>>();
for (int i = 0; i < Integer.parseInt(strRC[0]) + 1; i++) {
if (i == Integer.parseInt(strRC[0])) {
for (int j = 0; j < Integer.parseInt(strRC[1]) + 1; j++) {
Integer sum = 0;
for (int k = 0; k < Integer.parseInt(strRC[0]); k++) {
sum += itiKaiso.get(k).get(j);
}
niKaiso.add(sum);
}
itiKaiso.add(niKaiso);
} else {
String line = br.readLine();
String[] lineArrays = line.split(" ");
for (int j = 0; j < Integer.parseInt(strRC[1]) + 1; j++) {
if (j == Integer.parseInt(strRC[1])) {
Integer sum = 0;
for (int k = 0; k < niKaiso.size(); k++) {
sum += niKaiso.get(k);
}
niKaiso.add(sum);
} else {
niKaiso.add(Integer.parseInt(lineArrays[j]));
}
}
itiKaiso.add(niKaiso);
niKaiso = new ArrayList<Integer>();
}
}
for (int i = 0; i < Integer.parseInt(strRC[0]) + 1; i++) {
for (int j = 0; j < Integer.parseInt(strRC[1]) + 1; j++) {
if (j == Integer.parseInt(strRC[1])) {
System.out.println(itiKaiso.get(i).get(j));
} else {
System.out.print(itiKaiso.get(i).get(j) + " ");
}
}
}
}
} |
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
41,
13,
41,
13,
41,
13,
20,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
4,
18,
13,
4,
18,
18,
13,
13,
2,
13,
17,
0,
13,
13,
0,
18,
13,
13,
13,
4,
18,
18,
13,
13,
13,
0,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
4,
18,
18,
13,
13,
2,
18,
13,
13,
17,
0,
13,
18,
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
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
8,
17
],
[
17,
18
],
[
17,
19
],
[
19,
20
],
[
20,
21
],
[
8,
22
],
[
22,
23
],
[
8,
24
],
[
24,
25
],
[
8,
26
],
[
26,
27
],
[
26,
28
],
[
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
],
[
43,
45
],
[
42,
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
],
[
58,
64
],
[
64,
65
],
[
65,
66
],
[
66,
67
],
[
66,
68
],
[
64,
69
],
[
69,
70
],
[
69,
71
],
[
58,
72
],
[
72,
73
],
[
72,
74
],
[
58,
75
],
[
75,
76
],
[
76,
77
],
[
76,
78
],
[
75,
79
],
[
42,
80
],
[
80,
81
],
[
81,
82
],
[
82,
83
],
[
82,
84
],
[
80,
85
],
[
8,
86
],
[
86,
87
],
[
86,
88
],
[
8,
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
],
[
108,
109
],
[
108,
110
],
[
107,
111
],
[
101,
112
],
[
112,
113
],
[
112,
114
],
[
114,
115
],
[
114,
116
],
[
8,
117
],
[
117,
118
],
[
118,
119
],
[
119,
120
],
[
119,
121
],
[
117,
122
],
[
6,
123
],
[
123,
124
]
] | [
"import java.util.*;\nclass Main{\n\tpublic static void main(String[] args){\n\t\tScanner sc = new Scanner(System.in);\n\t\tint r = sc.nextInt();\n\t\tint c = sc.nextInt();\n\t\tint value;\n\t\tint rowTotal;\n\t\tint[] colTotal = new int[c];\n\t\t\n\t\tfor (int i = 0; i < r; i++){\n\t\t\trowTotal = 0;\n\t\t\tfor (int j = 0; j < c; j++){\n\t\t\t\tvalue = sc.nextInt();\n\t\t\t\tSystem.out.print(value + \" \");\n\t\t\t\trowTotal += value;\n\t\t\t\tcolTotal[j] += value;\n\t\t\t}\n\t\t\tSystem.out.println(rowTotal);\n\t\t}\n\t\t\n\t\trowTotal = 0;\n\t\tfor (int i = 0; i < c; i++){\n\t\t\tSystem.out.print(colTotal[i] + \" \");\n\t\t\trowTotal += colTotal[i];\n\t\t}\n\t\tSystem.out.println(rowTotal);\n\t}\n}",
"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 r = sc.nextInt();\n\t\tint c = sc.nextInt();\n\t\tint value;\n\t\tint rowTotal;\n\t\tint[] colTotal = new int[c];\n\t\t\n\t\tfor (int i = 0; i < r; i++){\n\t\t\trowTotal = 0;\n\t\t\tfor (int j = 0; j < c; j++){\n\t\t\t\tvalue = sc.nextInt();\n\t\t\t\tSystem.out.print(value + \" \");\n\t\t\t\trowTotal += value;\n\t\t\t\tcolTotal[j] += value;\n\t\t\t}\n\t\t\tSystem.out.println(rowTotal);\n\t\t}\n\t\t\n\t\trowTotal = 0;\n\t\tfor (int i = 0; i < c; i++){\n\t\t\tSystem.out.print(colTotal[i] + \" \");\n\t\t\trowTotal += colTotal[i];\n\t\t}\n\t\tSystem.out.println(rowTotal);\n\t}\n}",
"Main",
"public static void main(String[] args){\n\t\tScanner sc = new Scanner(System.in);\n\t\tint r = sc.nextInt();\n\t\tint c = sc.nextInt();\n\t\tint value;\n\t\tint rowTotal;\n\t\tint[] colTotal = new int[c];\n\t\t\n\t\tfor (int i = 0; i < r; i++){\n\t\t\trowTotal = 0;\n\t\t\tfor (int j = 0; j < c; j++){\n\t\t\t\tvalue = sc.nextInt();\n\t\t\t\tSystem.out.print(value + \" \");\n\t\t\t\trowTotal += value;\n\t\t\t\tcolTotal[j] += value;\n\t\t\t}\n\t\t\tSystem.out.println(rowTotal);\n\t\t}\n\t\t\n\t\trowTotal = 0;\n\t\tfor (int i = 0; i < c; i++){\n\t\t\tSystem.out.print(colTotal[i] + \" \");\n\t\t\trowTotal += colTotal[i];\n\t\t}\n\t\tSystem.out.println(rowTotal);\n\t}",
"main",
"{\n\t\tScanner sc = new Scanner(System.in);\n\t\tint r = sc.nextInt();\n\t\tint c = sc.nextInt();\n\t\tint value;\n\t\tint rowTotal;\n\t\tint[] colTotal = new int[c];\n\t\t\n\t\tfor (int i = 0; i < r; i++){\n\t\t\trowTotal = 0;\n\t\t\tfor (int j = 0; j < c; j++){\n\t\t\t\tvalue = sc.nextInt();\n\t\t\t\tSystem.out.print(value + \" \");\n\t\t\t\trowTotal += value;\n\t\t\t\tcolTotal[j] += value;\n\t\t\t}\n\t\t\tSystem.out.println(rowTotal);\n\t\t}\n\t\t\n\t\trowTotal = 0;\n\t\tfor (int i = 0; i < c; i++){\n\t\t\tSystem.out.print(colTotal[i] + \" \");\n\t\t\trowTotal += colTotal[i];\n\t\t}\n\t\tSystem.out.println(rowTotal);\n\t}",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"int r = sc.nextInt();",
"r",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int c = sc.nextInt();",
"c",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int value;",
"value",
"int rowTotal;",
"rowTotal",
"int[] colTotal = new int[c];",
"colTotal",
"new int[c]",
"c",
"for (int i = 0; i < r; i++){\n\t\t\trowTotal = 0;\n\t\t\tfor (int j = 0; j < c; j++){\n\t\t\t\tvalue = sc.nextInt();\n\t\t\t\tSystem.out.print(value + \" \");\n\t\t\t\trowTotal += value;\n\t\t\t\tcolTotal[j] += value;\n\t\t\t}\n\t\t\tSystem.out.println(rowTotal);\n\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < r",
"i",
"r",
"i++",
"i++",
"i",
"{\n\t\t\trowTotal = 0;\n\t\t\tfor (int j = 0; j < c; j++){\n\t\t\t\tvalue = sc.nextInt();\n\t\t\t\tSystem.out.print(value + \" \");\n\t\t\t\trowTotal += value;\n\t\t\t\tcolTotal[j] += value;\n\t\t\t}\n\t\t\tSystem.out.println(rowTotal);\n\t\t}",
"{\n\t\t\trowTotal = 0;\n\t\t\tfor (int j = 0; j < c; j++){\n\t\t\t\tvalue = sc.nextInt();\n\t\t\t\tSystem.out.print(value + \" \");\n\t\t\t\trowTotal += value;\n\t\t\t\tcolTotal[j] += value;\n\t\t\t}\n\t\t\tSystem.out.println(rowTotal);\n\t\t}",
"rowTotal = 0",
"rowTotal",
"0",
"for (int j = 0; j < c; j++){\n\t\t\t\tvalue = sc.nextInt();\n\t\t\t\tSystem.out.print(value + \" \");\n\t\t\t\trowTotal += value;\n\t\t\t\tcolTotal[j] += value;\n\t\t\t}",
"int j = 0;",
"int j = 0;",
"j",
"0",
"j < c",
"j",
"c",
"j++",
"j++",
"j",
"{\n\t\t\t\tvalue = sc.nextInt();\n\t\t\t\tSystem.out.print(value + \" \");\n\t\t\t\trowTotal += value;\n\t\t\t\tcolTotal[j] += value;\n\t\t\t}",
"{\n\t\t\t\tvalue = sc.nextInt();\n\t\t\t\tSystem.out.print(value + \" \");\n\t\t\t\trowTotal += value;\n\t\t\t\tcolTotal[j] += value;\n\t\t\t}",
"value = sc.nextInt()",
"value",
"sc.nextInt()",
"sc.nextInt",
"sc",
"System.out.print(value + \" \")",
"System.out.print",
"System.out",
"System",
"System.out",
"value + \" \"",
"value",
"\" \"",
"rowTotal += value",
"rowTotal",
"value",
"colTotal[j] += value",
"colTotal[j]",
"colTotal",
"j",
"value",
"System.out.println(rowTotal)",
"System.out.println",
"System.out",
"System",
"System.out",
"rowTotal",
"rowTotal = 0",
"rowTotal",
"0",
"for (int i = 0; i < c; i++){\n\t\t\tSystem.out.print(colTotal[i] + \" \");\n\t\t\trowTotal += colTotal[i];\n\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < c",
"i",
"c",
"i++",
"i++",
"i",
"{\n\t\t\tSystem.out.print(colTotal[i] + \" \");\n\t\t\trowTotal += colTotal[i];\n\t\t}",
"{\n\t\t\tSystem.out.print(colTotal[i] + \" \");\n\t\t\trowTotal += colTotal[i];\n\t\t}",
"System.out.print(colTotal[i] + \" \")",
"System.out.print",
"System.out",
"System",
"System.out",
"colTotal[i] + \" \"",
"colTotal[i]",
"colTotal",
"i",
"\" \"",
"rowTotal += colTotal[i]",
"rowTotal",
"colTotal[i]",
"colTotal",
"i",
"System.out.println(rowTotal)",
"System.out.println",
"System.out",
"System",
"System.out",
"rowTotal",
"String[] args",
"args"
] | import java.util.*;
class Main{
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
int r = sc.nextInt();
int c = sc.nextInt();
int value;
int rowTotal;
int[] colTotal = new int[c];
for (int i = 0; i < r; i++){
rowTotal = 0;
for (int j = 0; j < c; j++){
value = sc.nextInt();
System.out.print(value + " ");
rowTotal += value;
colTotal[j] += value;
}
System.out.println(rowTotal);
}
rowTotal = 0;
for (int i = 0; i < c; i++){
System.out.print(colTotal[i] + " ");
rowTotal += colTotal[i];
}
System.out.println(rowTotal);
}
} |
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
41,
13,
20,
13,
2,
13,
17,
41,
13,
20,
2,
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,
18,
18,
13,
13,
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,
0,
18,
18,
13,
13,
13,
2,
18,
18,
13,
13,
13,
18,
18,
13,
13,
13,
11,
1,
41,
13,
17,
2,
13,
2,
13,
17,
1,
40,
13,
30,
30,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
18,
13,
13,
2,
18,
13,
13,
18,
18,
13,
13,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
11,
1,
41,
13,
17,
2,
13,
2,
13,
17,
1,
40,
13,
30,
30,
14,
2,
13,
17,
4,
18,
18,
13,
13,
17,
4,
18,
18,
13,
13,
18,
18,
13,
13,
13,
4,
18,
18,
13,
13,
11,
1,
41,
13,
17,
2,
13,
2,
13,
17,
1,
40,
13,
30,
30,
14,
2,
13,
17,
4,
18,
18,
13,
13,
17,
4,
18,
18,
13,
13,
18,
13,
13,
4,
18,
18,
13,
13,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
248,
5
],
[
248,
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
],
[
19,
20
],
[
20,
21
],
[
8,
22
],
[
22,
23
],
[
22,
24
],
[
26,
27
],
[
26,
28
],
[
8,
29
],
[
29,
30
],
[
29,
31
],
[
32,
33
],
[
32,
34
],
[
8,
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
],
[
63,
64
],
[
63,
65
],
[
62,
66
],
[
61,
67
],
[
67,
68
],
[
68,
69
],
[
8,
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
],
[
97,
98
],
[
98,
99
],
[
98,
100
],
[
97,
101
],
[
96,
102
],
[
102,
103
],
[
103,
104
],
[
104,
105
],
[
104,
106
],
[
103,
107
],
[
102,
108
],
[
108,
109
],
[
109,
110
],
[
109,
111
],
[
108,
112
],
[
8,
113
],
[
113,
114
],
[
114,
115
],
[
115,
116
],
[
115,
117
],
[
113,
118
],
[
118,
119
],
[
118,
120
],
[
120,
121
],
[
120,
122
],
[
113,
123
],
[
123,
124
],
[
124,
125
],
[
113,
126
],
[
127,
127
],
[
127,
128
],
[
128,
129
],
[
129,
130
],
[
130,
131
],
[
130,
132
],
[
128,
133
],
[
133,
134
],
[
133,
135
],
[
128,
136
],
[
136,
137
],
[
137,
138
],
[
128,
139
],
[
140,
140
],
[
140,
141
],
[
141,
142
],
[
142,
143
],
[
142,
144
],
[
141,
145
],
[
145,
146
],
[
146,
147
],
[
146,
148
],
[
145,
149
],
[
149,
150
],
[
150,
151
],
[
150,
152
],
[
149,
153
],
[
8,
154
],
[
154,
155
],
[
155,
156
],
[
156,
157
],
[
156,
158
],
[
154,
159
],
[
159,
160
],
[
159,
161
],
[
154,
162
],
[
162,
163
],
[
163,
164
],
[
154,
165
],
[
166,
166
],
[
166,
167
],
[
167,
168
],
[
168,
169
],
[
169,
170
],
[
169,
171
],
[
167,
172
],
[
172,
173
],
[
172,
174
],
[
174,
175
],
[
174,
176
],
[
167,
177
],
[
177,
178
],
[
178,
179
],
[
167,
180
],
[
181,
181
],
[
181,
182
],
[
182,
183
],
[
183,
184
],
[
183,
185
],
[
182,
186
],
[
186,
187
],
[
187,
188
],
[
188,
189
],
[
188,
190
],
[
186,
191
],
[
181,
192
],
[
192,
193
],
[
193,
194
],
[
194,
195
],
[
194,
196
],
[
192,
197
],
[
197,
198
],
[
198,
199
],
[
198,
200
],
[
197,
201
],
[
166,
202
],
[
202,
203
],
[
203,
204
],
[
204,
205
],
[
204,
206
],
[
8,
207
],
[
207,
208
],
[
208,
209
],
[
209,
210
],
[
209,
211
],
[
207,
212
],
[
212,
213
],
[
212,
214
],
[
214,
215
],
[
214,
216
],
[
207,
217
],
[
217,
218
],
[
218,
219
],
[
207,
220
],
[
221,
221
],
[
221,
222
],
[
222,
223
],
[
223,
224
],
[
223,
225
],
[
222,
226
],
[
226,
227
],
[
227,
228
],
[
228,
229
],
[
228,
230
],
[
226,
231
],
[
221,
232
],
[
232,
233
],
[
233,
234
],
[
234,
235
],
[
234,
236
],
[
232,
237
],
[
237,
238
],
[
237,
239
],
[
8,
240
],
[
240,
241
],
[
241,
242
],
[
242,
243
],
[
242,
244
],
[
6,
245
],
[
245,
246
],
[
0,
247
],
[
247,
248
],
[
247,
249
]
] | [
"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\tint r = scan.nextInt();\n\t\tint c = scan.nextInt();\n\t\tint[][] a = new int[r][c+1];\n\t\tint[] sum = new int[c+1];\n\t\t\n\t\tfor(int i=0;i<r;i++){\n\t\t\tfor(int j=0;j<c;j++){\n\t\t\t\ta[i][j] = scan.nextInt();\n\t\t\t}\n\t\t}\n\n\t\tfor(int i=0;i<r;i++){\n\t\t\tfor(int j=0;j<c;j++){\n\t\t\t\ta[i][c]= a[i][c]+a[i][j];\n\t\t\t}\n\t\t}\n\t\t\n\t\tfor(int i=0;i<c+1;i++){\n\t\t\tfor(int j=0;j<r;j++){\n\t\t\t\tsum[i]= sum[i]+a[j][i];\n\t\t\t}\n\t\t}\n\n\t\tfor(int i=0;i<r;i++){\n\t\t\tfor(int j=0;j<c+1;j++){\n\t\t\t\tif(j!=0)System.out.print(\" \");\n\t\t\t\tSystem.out.print(a[i][j]);\n\t\t\t}\n\t\t\t System.out.println();\n\t\t}\n\t\tfor(int j=0;j<c+1;j++){\n\t\t\t\tif(j!=0)System.out.print(\" \");\n\t\t\t\tSystem.out.print(sum[j]);\n\t\t\t}\n\t\t\t System.out.println();\n\t\t}\n}\n\n\n\n\n//\n//import java.util.ArrayList;\n//import java.util.List;\n//import java.util.Scanner;\n//\n//public class Main {\n//\tpublic static void main(String[] args) {\n//\t\tScanner scan = new Scanner(System.in);\n//\t\tList<Integer> n = new ArrayList<Integer>();\n//\t\tList<Integer> x = new ArrayList<Integer>();\n//\t\tList<Integer> count = new ArrayList<Integer>();\n//\n//\t\t for(int i=0;;i++){\n//\t\t\t n.add(i, scan.nextInt());\n//\t\t\t x.add(i, scan.nextInt());\n//\t\t\t count.add(i, 0);\n//\t\t\t if(n.get(i)==0 && x.get(i)==0) break;\n//\t\t }\n//\n//\n//\n// for(int h=0;;h++){\n//\t\t if(n.get(h)==0 && x.get(h)==0) break;\n//\t\t for(int i=1;i<=n.get(h);i++){\n//\t\t\t for(int j=i;j<=n.get(h);j++){\n//\t\t\t\t if(i==j)continue;\n//\t\t\t\t for(int k=j;k <= n.get(h);k++){\n//\t\t\t\t\t if(i==k || j==k)continue;\n//\t\t\t\t\t if(i+j+k == x.get(h)) count.set(h, count.get(h)+1 );\n//\t\t\t\t }\n//\t\t\t }\n//\t\t }\n//\n//\t\t\tSystem.out.println(count.get(h));\n// }\n//\t}\n//\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\tint r = scan.nextInt();\n\t\tint c = scan.nextInt();\n\t\tint[][] a = new int[r][c+1];\n\t\tint[] sum = new int[c+1];\n\t\t\n\t\tfor(int i=0;i<r;i++){\n\t\t\tfor(int j=0;j<c;j++){\n\t\t\t\ta[i][j] = scan.nextInt();\n\t\t\t}\n\t\t}\n\n\t\tfor(int i=0;i<r;i++){\n\t\t\tfor(int j=0;j<c;j++){\n\t\t\t\ta[i][c]= a[i][c]+a[i][j];\n\t\t\t}\n\t\t}\n\t\t\n\t\tfor(int i=0;i<c+1;i++){\n\t\t\tfor(int j=0;j<r;j++){\n\t\t\t\tsum[i]= sum[i]+a[j][i];\n\t\t\t}\n\t\t}\n\n\t\tfor(int i=0;i<r;i++){\n\t\t\tfor(int j=0;j<c+1;j++){\n\t\t\t\tif(j!=0)System.out.print(\" \");\n\t\t\t\tSystem.out.print(a[i][j]);\n\t\t\t}\n\t\t\t System.out.println();\n\t\t}\n\t\tfor(int j=0;j<c+1;j++){\n\t\t\t\tif(j!=0)System.out.print(\" \");\n\t\t\t\tSystem.out.print(sum[j]);\n\t\t\t}\n\t\t\t System.out.println();\n\t\t}\n}",
"Main",
"public static void main(String[] args) {\n\t\tScanner scan = new Scanner(System.in);\n\t\tint r = scan.nextInt();\n\t\tint c = scan.nextInt();\n\t\tint[][] a = new int[r][c+1];\n\t\tint[] sum = new int[c+1];\n\t\t\n\t\tfor(int i=0;i<r;i++){\n\t\t\tfor(int j=0;j<c;j++){\n\t\t\t\ta[i][j] = scan.nextInt();\n\t\t\t}\n\t\t}\n\n\t\tfor(int i=0;i<r;i++){\n\t\t\tfor(int j=0;j<c;j++){\n\t\t\t\ta[i][c]= a[i][c]+a[i][j];\n\t\t\t}\n\t\t}\n\t\t\n\t\tfor(int i=0;i<c+1;i++){\n\t\t\tfor(int j=0;j<r;j++){\n\t\t\t\tsum[i]= sum[i]+a[j][i];\n\t\t\t}\n\t\t}\n\n\t\tfor(int i=0;i<r;i++){\n\t\t\tfor(int j=0;j<c+1;j++){\n\t\t\t\tif(j!=0)System.out.print(\" \");\n\t\t\t\tSystem.out.print(a[i][j]);\n\t\t\t}\n\t\t\t System.out.println();\n\t\t}\n\t\tfor(int j=0;j<c+1;j++){\n\t\t\t\tif(j!=0)System.out.print(\" \");\n\t\t\t\tSystem.out.print(sum[j]);\n\t\t\t}\n\t\t\t System.out.println();\n\t\t}",
"main",
"{\n\t\tScanner scan = new Scanner(System.in);\n\t\tint r = scan.nextInt();\n\t\tint c = scan.nextInt();\n\t\tint[][] a = new int[r][c+1];\n\t\tint[] sum = new int[c+1];\n\t\t\n\t\tfor(int i=0;i<r;i++){\n\t\t\tfor(int j=0;j<c;j++){\n\t\t\t\ta[i][j] = scan.nextInt();\n\t\t\t}\n\t\t}\n\n\t\tfor(int i=0;i<r;i++){\n\t\t\tfor(int j=0;j<c;j++){\n\t\t\t\ta[i][c]= a[i][c]+a[i][j];\n\t\t\t}\n\t\t}\n\t\t\n\t\tfor(int i=0;i<c+1;i++){\n\t\t\tfor(int j=0;j<r;j++){\n\t\t\t\tsum[i]= sum[i]+a[j][i];\n\t\t\t}\n\t\t}\n\n\t\tfor(int i=0;i<r;i++){\n\t\t\tfor(int j=0;j<c+1;j++){\n\t\t\t\tif(j!=0)System.out.print(\" \");\n\t\t\t\tSystem.out.print(a[i][j]);\n\t\t\t}\n\t\t\t System.out.println();\n\t\t}\n\t\tfor(int j=0;j<c+1;j++){\n\t\t\t\tif(j!=0)System.out.print(\" \");\n\t\t\t\tSystem.out.print(sum[j]);\n\t\t\t}\n\t\t\t System.out.println();\n\t\t}",
"Scanner scan = new Scanner(System.in);",
"scan",
"new Scanner(System.in)",
"int r = scan.nextInt();",
"r",
"scan.nextInt()",
"scan.nextInt",
"scan",
"int c = scan.nextInt();",
"c",
"scan.nextInt()",
"scan.nextInt",
"scan",
"int[][] a = new int[r][c+1];",
"a",
"new int[r][c+1]",
"r",
"c+1",
"c",
"1",
"int[] sum = new int[c+1];",
"sum",
"new int[c+1]",
"c+1",
"c",
"1",
"for(int i=0;i<r;i++){\n\t\t\tfor(int j=0;j<c;j++){\n\t\t\t\ta[i][j] = scan.nextInt();\n\t\t\t}\n\t\t}",
"int i=0;",
"int i=0;",
"i",
"0",
"i<r",
"i",
"r",
"i++",
"i++",
"i",
"{\n\t\t\tfor(int j=0;j<c;j++){\n\t\t\t\ta[i][j] = scan.nextInt();\n\t\t\t}\n\t\t}",
"{\n\t\t\tfor(int j=0;j<c;j++){\n\t\t\t\ta[i][j] = scan.nextInt();\n\t\t\t}\n\t\t}",
"for(int j=0;j<c;j++){\n\t\t\t\ta[i][j] = scan.nextInt();\n\t\t\t}",
"int j=0;",
"int j=0;",
"j",
"0",
"j<c",
"j",
"c",
"j++",
"j++",
"j",
"{\n\t\t\t\ta[i][j] = scan.nextInt();\n\t\t\t}",
"{\n\t\t\t\ta[i][j] = scan.nextInt();\n\t\t\t}",
"a[i][j] = scan.nextInt()",
"a[i][j]",
"a[i]",
"a",
"i",
"j",
"scan.nextInt()",
"scan.nextInt",
"scan",
"for(int i=0;i<r;i++){\n\t\t\tfor(int j=0;j<c;j++){\n\t\t\t\ta[i][c]= a[i][c]+a[i][j];\n\t\t\t}\n\t\t}",
"int i=0;",
"int i=0;",
"i",
"0",
"i<r",
"i",
"r",
"i++",
"i++",
"i",
"{\n\t\t\tfor(int j=0;j<c;j++){\n\t\t\t\ta[i][c]= a[i][c]+a[i][j];\n\t\t\t}\n\t\t}",
"{\n\t\t\tfor(int j=0;j<c;j++){\n\t\t\t\ta[i][c]= a[i][c]+a[i][j];\n\t\t\t}\n\t\t}",
"for(int j=0;j<c;j++){\n\t\t\t\ta[i][c]= a[i][c]+a[i][j];\n\t\t\t}",
"int j=0;",
"int j=0;",
"j",
"0",
"j<c",
"j",
"c",
"j++",
"j++",
"j",
"{\n\t\t\t\ta[i][c]= a[i][c]+a[i][j];\n\t\t\t}",
"{\n\t\t\t\ta[i][c]= a[i][c]+a[i][j];\n\t\t\t}",
"a[i][c]= a[i][c]+a[i][j]",
"a[i][c]",
"a[i]",
"a",
"i",
"c",
"a[i][c]+a[i][j]",
"a[i][c]",
"a[i]",
"a",
"i",
"c",
"a[i][j]",
"a[i]",
"a",
"i",
"j",
"for(int i=0;i<c+1;i++){\n\t\t\tfor(int j=0;j<r;j++){\n\t\t\t\tsum[i]= sum[i]+a[j][i];\n\t\t\t}\n\t\t}",
"int i=0;",
"int i=0;",
"i",
"0",
"i<c+1",
"i",
"c+1",
"c",
"1",
"i++",
"i++",
"i",
"{\n\t\t\tfor(int j=0;j<r;j++){\n\t\t\t\tsum[i]= sum[i]+a[j][i];\n\t\t\t}\n\t\t}",
"{\n\t\t\tfor(int j=0;j<r;j++){\n\t\t\t\tsum[i]= sum[i]+a[j][i];\n\t\t\t}\n\t\t}",
"for(int j=0;j<r;j++){\n\t\t\t\tsum[i]= sum[i]+a[j][i];\n\t\t\t}",
"int j=0;",
"int j=0;",
"j",
"0",
"j<r",
"j",
"r",
"j++",
"j++",
"j",
"{\n\t\t\t\tsum[i]= sum[i]+a[j][i];\n\t\t\t}",
"{\n\t\t\t\tsum[i]= sum[i]+a[j][i];\n\t\t\t}",
"sum[i]= sum[i]+a[j][i]",
"sum[i]",
"sum",
"i",
"sum[i]+a[j][i]",
"sum[i]",
"sum",
"i",
"a[j][i]",
"a[j]",
"a",
"j",
"i",
"for(int i=0;i<r;i++){\n\t\t\tfor(int j=0;j<c+1;j++){\n\t\t\t\tif(j!=0)System.out.print(\" \");\n\t\t\t\tSystem.out.print(a[i][j]);\n\t\t\t}\n\t\t\t System.out.println();\n\t\t}",
"int i=0;",
"int i=0;",
"i",
"0",
"i<r",
"i",
"r",
"i++",
"i++",
"i",
"{\n\t\t\tfor(int j=0;j<c+1;j++){\n\t\t\t\tif(j!=0)System.out.print(\" \");\n\t\t\t\tSystem.out.print(a[i][j]);\n\t\t\t}\n\t\t\t System.out.println();\n\t\t}",
"{\n\t\t\tfor(int j=0;j<c+1;j++){\n\t\t\t\tif(j!=0)System.out.print(\" \");\n\t\t\t\tSystem.out.print(a[i][j]);\n\t\t\t}\n\t\t\t System.out.println();\n\t\t}",
"for(int j=0;j<c+1;j++){\n\t\t\t\tif(j!=0)System.out.print(\" \");\n\t\t\t\tSystem.out.print(a[i][j]);\n\t\t\t}",
"int j=0;",
"int j=0;",
"j",
"0",
"j<c+1",
"j",
"c+1",
"c",
"1",
"j++",
"j++",
"j",
"{\n\t\t\t\tif(j!=0)System.out.print(\" \");\n\t\t\t\tSystem.out.print(a[i][j]);\n\t\t\t}",
"{\n\t\t\t\tif(j!=0)System.out.print(\" \");\n\t\t\t\tSystem.out.print(a[i][j]);\n\t\t\t}",
"if(j!=0)System.out.print(\" \");",
"j!=0",
"j",
"0",
"System.out.print(\" \")",
"System.out.print",
"System.out",
"System",
"System.out",
"\" \"",
"System.out.print(a[i][j])",
"System.out.print",
"System.out",
"System",
"System.out",
"a[i][j]",
"a[i]",
"a",
"i",
"j",
"System.out.println()",
"System.out.println",
"System.out",
"System",
"System.out",
"for(int j=0;j<c+1;j++){\n\t\t\t\tif(j!=0)System.out.print(\" \");\n\t\t\t\tSystem.out.print(sum[j]);\n\t\t\t}",
"int j=0;",
"int j=0;",
"j",
"0",
"j<c+1",
"j",
"c+1",
"c",
"1",
"j++",
"j++",
"j",
"{\n\t\t\t\tif(j!=0)System.out.print(\" \");\n\t\t\t\tSystem.out.print(sum[j]);\n\t\t\t}",
"{\n\t\t\t\tif(j!=0)System.out.print(\" \");\n\t\t\t\tSystem.out.print(sum[j]);\n\t\t\t}",
"if(j!=0)System.out.print(\" \");",
"j!=0",
"j",
"0",
"System.out.print(\" \")",
"System.out.print",
"System.out",
"System",
"System.out",
"\" \"",
"System.out.print(sum[j])",
"System.out.print",
"System.out",
"System",
"System.out",
"sum[j]",
"sum",
"j",
"System.out.println()",
"System.out.println",
"System.out",
"System",
"System.out",
"String[] args",
"args",
"public class Main {\n\tpublic static void main(String[] args) {\n\t\tScanner scan = new Scanner(System.in);\n\t\tint r = scan.nextInt();\n\t\tint c = scan.nextInt();\n\t\tint[][] a = new int[r][c+1];\n\t\tint[] sum = new int[c+1];\n\t\t\n\t\tfor(int i=0;i<r;i++){\n\t\t\tfor(int j=0;j<c;j++){\n\t\t\t\ta[i][j] = scan.nextInt();\n\t\t\t}\n\t\t}\n\n\t\tfor(int i=0;i<r;i++){\n\t\t\tfor(int j=0;j<c;j++){\n\t\t\t\ta[i][c]= a[i][c]+a[i][j];\n\t\t\t}\n\t\t}\n\t\t\n\t\tfor(int i=0;i<c+1;i++){\n\t\t\tfor(int j=0;j<r;j++){\n\t\t\t\tsum[i]= sum[i]+a[j][i];\n\t\t\t}\n\t\t}\n\n\t\tfor(int i=0;i<r;i++){\n\t\t\tfor(int j=0;j<c+1;j++){\n\t\t\t\tif(j!=0)System.out.print(\" \");\n\t\t\t\tSystem.out.print(a[i][j]);\n\t\t\t}\n\t\t\t System.out.println();\n\t\t}\n\t\tfor(int j=0;j<c+1;j++){\n\t\t\t\tif(j!=0)System.out.print(\" \");\n\t\t\t\tSystem.out.print(sum[j]);\n\t\t\t}\n\t\t\t System.out.println();\n\t\t}\n}",
"public class Main {\n\tpublic static void main(String[] args) {\n\t\tScanner scan = new Scanner(System.in);\n\t\tint r = scan.nextInt();\n\t\tint c = scan.nextInt();\n\t\tint[][] a = new int[r][c+1];\n\t\tint[] sum = new int[c+1];\n\t\t\n\t\tfor(int i=0;i<r;i++){\n\t\t\tfor(int j=0;j<c;j++){\n\t\t\t\ta[i][j] = scan.nextInt();\n\t\t\t}\n\t\t}\n\n\t\tfor(int i=0;i<r;i++){\n\t\t\tfor(int j=0;j<c;j++){\n\t\t\t\ta[i][c]= a[i][c]+a[i][j];\n\t\t\t}\n\t\t}\n\t\t\n\t\tfor(int i=0;i<c+1;i++){\n\t\t\tfor(int j=0;j<r;j++){\n\t\t\t\tsum[i]= sum[i]+a[j][i];\n\t\t\t}\n\t\t}\n\n\t\tfor(int i=0;i<r;i++){\n\t\t\tfor(int j=0;j<c+1;j++){\n\t\t\t\tif(j!=0)System.out.print(\" \");\n\t\t\t\tSystem.out.print(a[i][j]);\n\t\t\t}\n\t\t\t System.out.println();\n\t\t}\n\t\tfor(int j=0;j<c+1;j++){\n\t\t\t\tif(j!=0)System.out.print(\" \");\n\t\t\t\tSystem.out.print(sum[j]);\n\t\t\t}\n\t\t\t System.out.println();\n\t\t}\n}",
"Main"
] | import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
int r = scan.nextInt();
int c = scan.nextInt();
int[][] a = new int[r][c+1];
int[] sum = new int[c+1];
for(int i=0;i<r;i++){
for(int j=0;j<c;j++){
a[i][j] = scan.nextInt();
}
}
for(int i=0;i<r;i++){
for(int j=0;j<c;j++){
a[i][c]= a[i][c]+a[i][j];
}
}
for(int i=0;i<c+1;i++){
for(int j=0;j<r;j++){
sum[i]= sum[i]+a[j][i];
}
}
for(int i=0;i<r;i++){
for(int j=0;j<c+1;j++){
if(j!=0)System.out.print(" ");
System.out.print(a[i][j]);
}
System.out.println();
}
for(int j=0;j<c+1;j++){
if(j!=0)System.out.print(" ");
System.out.print(sum[j]);
}
System.out.println();
}
}
//
//import java.util.ArrayList;
//import java.util.List;
//import java.util.Scanner;
//
//public class Main {
// public static void main(String[] args) {
// Scanner scan = new Scanner(System.in);
// List<Integer> n = new ArrayList<Integer>();
// List<Integer> x = new ArrayList<Integer>();
// List<Integer> count = new ArrayList<Integer>();
//
// for(int i=0;;i++){
// n.add(i, scan.nextInt());
// x.add(i, scan.nextInt());
// count.add(i, 0);
// if(n.get(i)==0 && x.get(i)==0) break;
// }
//
//
//
// for(int h=0;;h++){
// if(n.get(h)==0 && x.get(h)==0) break;
// for(int i=1;i<=n.get(h);i++){
// for(int j=i;j<=n.get(h);j++){
// if(i==j)continue;
// for(int k=j;k <= n.get(h);k++){
// if(i==k || j==k)continue;
// if(i+j+k == x.get(h)) count.set(h, count.get(h)+1 );
// }
// }
// }
//
// System.out.println(count.get(h));
// }
// }
//
//}
//
// |
[
7,
15,
13,
17,
6,
13,
41,
13,
20,
12,
13,
30,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
41,
13,
20,
2,
13,
17,
2,
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,
18,
18,
13,
13,
13,
4,
18,
13,
0,
13,
18,
18,
13,
13,
13,
0,
18,
18,
13,
13,
13,
18,
18,
13,
13,
13,
0,
18,
18,
13,
13,
13,
18,
18,
13,
13,
13,
0,
18,
18,
13,
13,
13,
13,
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,
14,
2,
13,
13,
30,
4,
18,
18,
13,
13,
17,
18,
18,
13,
13,
13,
30,
4,
18,
18,
13,
13,
17,
18,
18,
13,
13,
13,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
166,
5
],
[
166,
6
],
[
6,
7
],
[
6,
8
],
[
166,
9
],
[
9,
10
],
[
9,
11
],
[
11,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
11,
17
],
[
17,
18
],
[
17,
19
],
[
19,
20
],
[
20,
21
],
[
11,
22
],
[
22,
23
],
[
22,
24
],
[
25,
26
],
[
25,
27
],
[
28,
29
],
[
28,
30
],
[
11,
31
],
[
31,
32
],
[
31,
33
],
[
11,
34
],
[
34,
35
],
[
35,
36
],
[
36,
37
],
[
36,
38
],
[
34,
39
],
[
39,
40
],
[
39,
41
],
[
34,
42
],
[
42,
43
],
[
43,
44
],
[
34,
45
],
[
46,
46
],
[
46,
47
],
[
47,
48
],
[
48,
49
],
[
49,
50
],
[
49,
51
],
[
47,
52
],
[
52,
53
],
[
52,
54
],
[
47,
55
],
[
55,
56
],
[
56,
57
],
[
47,
58
],
[
59,
59
],
[
59,
60
],
[
60,
61
],
[
61,
62
],
[
62,
63
],
[
62,
64
],
[
61,
65
],
[
60,
66
],
[
66,
67
],
[
67,
68
],
[
59,
69
],
[
69,
70
],
[
69,
71
],
[
71,
72
],
[
72,
73
],
[
72,
74
],
[
71,
75
],
[
59,
76
],
[
76,
77
],
[
77,
78
],
[
78,
79
],
[
78,
80
],
[
77,
81
],
[
76,
82
],
[
82,
83
],
[
83,
84
],
[
83,
85
],
[
82,
86
],
[
59,
87
],
[
87,
88
],
[
88,
89
],
[
89,
90
],
[
89,
91
],
[
88,
92
],
[
87,
93
],
[
93,
94
],
[
94,
95
],
[
94,
96
],
[
93,
97
],
[
11,
98
],
[
98,
99
],
[
99,
100
],
[
100,
101
],
[
100,
102
],
[
99,
103
],
[
98,
104
],
[
11,
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
],
[
119,
119
],
[
119,
120
],
[
120,
121
],
[
121,
122
],
[
122,
123
],
[
122,
124
],
[
120,
125
],
[
125,
126
],
[
125,
127
],
[
127,
128
],
[
127,
129
],
[
120,
130
],
[
130,
131
],
[
131,
132
],
[
120,
133
],
[
134,
134
],
[
134,
135
],
[
135,
136
],
[
136,
137
],
[
136,
138
],
[
135,
139
],
[
139,
140
],
[
140,
141
],
[
141,
142
],
[
142,
143
],
[
142,
144
],
[
140,
145
],
[
140,
146
],
[
146,
147
],
[
147,
148
],
[
147,
149
],
[
146,
150
],
[
135,
151
],
[
151,
152
],
[
152,
153
],
[
153,
154
],
[
154,
155
],
[
154,
156
],
[
152,
157
],
[
152,
158
],
[
158,
159
],
[
159,
160
],
[
159,
161
],
[
158,
162
],
[
9,
163
],
[
163,
164
],
[
0,
165
],
[
165,
166
],
[
165,
167
]
] | [
"import java.util.*;\n\npublic class Main{\n\tprivate static final Scanner scan = new Scanner(System.in);\n\n\tpublic static void main(String[] args){\n\t\tint r = scan.nextInt();\n\t\tint c = scan.nextInt();\n\t\tint[][] sheet = new int[r + 1][c + 1];\n\t\tint sum = 0;\n\t\tfor(int i = 0; i < r; i++){\n\t\t\tfor(int j = 0; j < c; j++){\n\t\t\t\tsheet[i][j] = scan.nextInt();\n\t\t\t\tsum += sheet[i][j];\n\t\t\t\tsheet[r][j] += sheet[i][j];\n\t\t\t\tsheet[i][c] += sheet[i][j];\n\t\t\t}\n\t\t}\n\t\tsheet[r][c] = sum;\n\n\t\tfor(int i = 0; i < r + 1; i++){\n\t\t\tfor(int j = 0; j < c + 1; j++){\n\t\t\t\tif(j != c){\n\t\t\t\t\tSystem.out.printf(\"%d \", sheet[i][j]);\n\t\t\t\t} else{\n\t\t\t\t\tSystem.out.printf(\"%d\\n\", sheet[i][j]);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}",
"import java.util.*;",
"util.*",
"java",
"public class Main{\n\tprivate static final Scanner scan = new Scanner(System.in);\n\n\tpublic static void main(String[] args){\n\t\tint r = scan.nextInt();\n\t\tint c = scan.nextInt();\n\t\tint[][] sheet = new int[r + 1][c + 1];\n\t\tint sum = 0;\n\t\tfor(int i = 0; i < r; i++){\n\t\t\tfor(int j = 0; j < c; j++){\n\t\t\t\tsheet[i][j] = scan.nextInt();\n\t\t\t\tsum += sheet[i][j];\n\t\t\t\tsheet[r][j] += sheet[i][j];\n\t\t\t\tsheet[i][c] += sheet[i][j];\n\t\t\t}\n\t\t}\n\t\tsheet[r][c] = sum;\n\n\t\tfor(int i = 0; i < r + 1; i++){\n\t\t\tfor(int j = 0; j < c + 1; j++){\n\t\t\t\tif(j != c){\n\t\t\t\t\tSystem.out.printf(\"%d \", sheet[i][j]);\n\t\t\t\t} else{\n\t\t\t\t\tSystem.out.printf(\"%d\\n\", sheet[i][j]);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}",
"Main",
"private static final Scanner scan = new Scanner(System.in);",
"scan",
"new Scanner(System.in)",
"public static void main(String[] args){\n\t\tint r = scan.nextInt();\n\t\tint c = scan.nextInt();\n\t\tint[][] sheet = new int[r + 1][c + 1];\n\t\tint sum = 0;\n\t\tfor(int i = 0; i < r; i++){\n\t\t\tfor(int j = 0; j < c; j++){\n\t\t\t\tsheet[i][j] = scan.nextInt();\n\t\t\t\tsum += sheet[i][j];\n\t\t\t\tsheet[r][j] += sheet[i][j];\n\t\t\t\tsheet[i][c] += sheet[i][j];\n\t\t\t}\n\t\t}\n\t\tsheet[r][c] = sum;\n\n\t\tfor(int i = 0; i < r + 1; i++){\n\t\t\tfor(int j = 0; j < c + 1; j++){\n\t\t\t\tif(j != c){\n\t\t\t\t\tSystem.out.printf(\"%d \", sheet[i][j]);\n\t\t\t\t} else{\n\t\t\t\t\tSystem.out.printf(\"%d\\n\", sheet[i][j]);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"main",
"{\n\t\tint r = scan.nextInt();\n\t\tint c = scan.nextInt();\n\t\tint[][] sheet = new int[r + 1][c + 1];\n\t\tint sum = 0;\n\t\tfor(int i = 0; i < r; i++){\n\t\t\tfor(int j = 0; j < c; j++){\n\t\t\t\tsheet[i][j] = scan.nextInt();\n\t\t\t\tsum += sheet[i][j];\n\t\t\t\tsheet[r][j] += sheet[i][j];\n\t\t\t\tsheet[i][c] += sheet[i][j];\n\t\t\t}\n\t\t}\n\t\tsheet[r][c] = sum;\n\n\t\tfor(int i = 0; i < r + 1; i++){\n\t\t\tfor(int j = 0; j < c + 1; j++){\n\t\t\t\tif(j != c){\n\t\t\t\t\tSystem.out.printf(\"%d \", sheet[i][j]);\n\t\t\t\t} else{\n\t\t\t\t\tSystem.out.printf(\"%d\\n\", sheet[i][j]);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"int r = scan.nextInt();",
"r",
"scan.nextInt()",
"scan.nextInt",
"scan",
"int c = scan.nextInt();",
"c",
"scan.nextInt()",
"scan.nextInt",
"scan",
"int[][] sheet = new int[r + 1][c + 1];",
"sheet",
"new int[r + 1][c + 1]",
"r + 1",
"r",
"1",
"c + 1",
"c",
"1",
"int sum = 0;",
"sum",
"0",
"for(int i = 0; i < r; i++){\n\t\t\tfor(int j = 0; j < c; j++){\n\t\t\t\tsheet[i][j] = scan.nextInt();\n\t\t\t\tsum += sheet[i][j];\n\t\t\t\tsheet[r][j] += sheet[i][j];\n\t\t\t\tsheet[i][c] += sheet[i][j];\n\t\t\t}\n\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < r",
"i",
"r",
"i++",
"i++",
"i",
"{\n\t\t\tfor(int j = 0; j < c; j++){\n\t\t\t\tsheet[i][j] = scan.nextInt();\n\t\t\t\tsum += sheet[i][j];\n\t\t\t\tsheet[r][j] += sheet[i][j];\n\t\t\t\tsheet[i][c] += sheet[i][j];\n\t\t\t}\n\t\t}",
"{\n\t\t\tfor(int j = 0; j < c; j++){\n\t\t\t\tsheet[i][j] = scan.nextInt();\n\t\t\t\tsum += sheet[i][j];\n\t\t\t\tsheet[r][j] += sheet[i][j];\n\t\t\t\tsheet[i][c] += sheet[i][j];\n\t\t\t}\n\t\t}",
"for(int j = 0; j < c; j++){\n\t\t\t\tsheet[i][j] = scan.nextInt();\n\t\t\t\tsum += sheet[i][j];\n\t\t\t\tsheet[r][j] += sheet[i][j];\n\t\t\t\tsheet[i][c] += sheet[i][j];\n\t\t\t}",
"int j = 0;",
"int j = 0;",
"j",
"0",
"j < c",
"j",
"c",
"j++",
"j++",
"j",
"{\n\t\t\t\tsheet[i][j] = scan.nextInt();\n\t\t\t\tsum += sheet[i][j];\n\t\t\t\tsheet[r][j] += sheet[i][j];\n\t\t\t\tsheet[i][c] += sheet[i][j];\n\t\t\t}",
"{\n\t\t\t\tsheet[i][j] = scan.nextInt();\n\t\t\t\tsum += sheet[i][j];\n\t\t\t\tsheet[r][j] += sheet[i][j];\n\t\t\t\tsheet[i][c] += sheet[i][j];\n\t\t\t}",
"sheet[i][j] = scan.nextInt()",
"sheet[i][j]",
"sheet[i]",
"sheet",
"i",
"j",
"scan.nextInt()",
"scan.nextInt",
"scan",
"sum += sheet[i][j]",
"sum",
"sheet[i][j]",
"sheet[i]",
"sheet",
"i",
"j",
"sheet[r][j] += sheet[i][j]",
"sheet[r][j]",
"sheet[r]",
"sheet",
"r",
"j",
"sheet[i][j]",
"sheet[i]",
"sheet",
"i",
"j",
"sheet[i][c] += sheet[i][j]",
"sheet[i][c]",
"sheet[i]",
"sheet",
"i",
"c",
"sheet[i][j]",
"sheet[i]",
"sheet",
"i",
"j",
"sheet[r][c] = sum",
"sheet[r][c]",
"sheet[r]",
"sheet",
"r",
"c",
"sum",
"for(int i = 0; i < r + 1; i++){\n\t\t\tfor(int j = 0; j < c + 1; j++){\n\t\t\t\tif(j != c){\n\t\t\t\t\tSystem.out.printf(\"%d \", sheet[i][j]);\n\t\t\t\t} else{\n\t\t\t\t\tSystem.out.printf(\"%d\\n\", sheet[i][j]);\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < r + 1",
"i",
"r + 1",
"r",
"1",
"i++",
"i++",
"i",
"{\n\t\t\tfor(int j = 0; j < c + 1; j++){\n\t\t\t\tif(j != c){\n\t\t\t\t\tSystem.out.printf(\"%d \", sheet[i][j]);\n\t\t\t\t} else{\n\t\t\t\t\tSystem.out.printf(\"%d\\n\", sheet[i][j]);\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"{\n\t\t\tfor(int j = 0; j < c + 1; j++){\n\t\t\t\tif(j != c){\n\t\t\t\t\tSystem.out.printf(\"%d \", sheet[i][j]);\n\t\t\t\t} else{\n\t\t\t\t\tSystem.out.printf(\"%d\\n\", sheet[i][j]);\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"for(int j = 0; j < c + 1; j++){\n\t\t\t\tif(j != c){\n\t\t\t\t\tSystem.out.printf(\"%d \", sheet[i][j]);\n\t\t\t\t} else{\n\t\t\t\t\tSystem.out.printf(\"%d\\n\", sheet[i][j]);\n\t\t\t\t}\n\t\t\t}",
"int j = 0;",
"int j = 0;",
"j",
"0",
"j < c + 1",
"j",
"c + 1",
"c",
"1",
"j++",
"j++",
"j",
"{\n\t\t\t\tif(j != c){\n\t\t\t\t\tSystem.out.printf(\"%d \", sheet[i][j]);\n\t\t\t\t} else{\n\t\t\t\t\tSystem.out.printf(\"%d\\n\", sheet[i][j]);\n\t\t\t\t}\n\t\t\t}",
"{\n\t\t\t\tif(j != c){\n\t\t\t\t\tSystem.out.printf(\"%d \", sheet[i][j]);\n\t\t\t\t} else{\n\t\t\t\t\tSystem.out.printf(\"%d\\n\", sheet[i][j]);\n\t\t\t\t}\n\t\t\t}",
"if(j != c){\n\t\t\t\t\tSystem.out.printf(\"%d \", sheet[i][j]);\n\t\t\t\t} else{\n\t\t\t\t\tSystem.out.printf(\"%d\\n\", sheet[i][j]);\n\t\t\t\t}",
"j != c",
"j",
"c",
"{\n\t\t\t\t\tSystem.out.printf(\"%d \", sheet[i][j]);\n\t\t\t\t}",
"System.out.printf(\"%d \", sheet[i][j])",
"System.out.printf",
"System.out",
"System",
"System.out",
"\"%d \"",
"sheet[i][j]",
"sheet[i]",
"sheet",
"i",
"j",
"{\n\t\t\t\t\tSystem.out.printf(\"%d\\n\", sheet[i][j]);\n\t\t\t\t}",
"System.out.printf(\"%d\\n\", sheet[i][j])",
"System.out.printf",
"System.out",
"System",
"System.out",
"\"%d\\n\"",
"sheet[i][j]",
"sheet[i]",
"sheet",
"i",
"j",
"String[] args",
"args",
"public class Main{\n\tprivate static final Scanner scan = new Scanner(System.in);\n\n\tpublic static void main(String[] args){\n\t\tint r = scan.nextInt();\n\t\tint c = scan.nextInt();\n\t\tint[][] sheet = new int[r + 1][c + 1];\n\t\tint sum = 0;\n\t\tfor(int i = 0; i < r; i++){\n\t\t\tfor(int j = 0; j < c; j++){\n\t\t\t\tsheet[i][j] = scan.nextInt();\n\t\t\t\tsum += sheet[i][j];\n\t\t\t\tsheet[r][j] += sheet[i][j];\n\t\t\t\tsheet[i][c] += sheet[i][j];\n\t\t\t}\n\t\t}\n\t\tsheet[r][c] = sum;\n\n\t\tfor(int i = 0; i < r + 1; i++){\n\t\t\tfor(int j = 0; j < c + 1; j++){\n\t\t\t\tif(j != c){\n\t\t\t\t\tSystem.out.printf(\"%d \", sheet[i][j]);\n\t\t\t\t} else{\n\t\t\t\t\tSystem.out.printf(\"%d\\n\", sheet[i][j]);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}",
"public class Main{\n\tprivate static final Scanner scan = new Scanner(System.in);\n\n\tpublic static void main(String[] args){\n\t\tint r = scan.nextInt();\n\t\tint c = scan.nextInt();\n\t\tint[][] sheet = new int[r + 1][c + 1];\n\t\tint sum = 0;\n\t\tfor(int i = 0; i < r; i++){\n\t\t\tfor(int j = 0; j < c; j++){\n\t\t\t\tsheet[i][j] = scan.nextInt();\n\t\t\t\tsum += sheet[i][j];\n\t\t\t\tsheet[r][j] += sheet[i][j];\n\t\t\t\tsheet[i][c] += sheet[i][j];\n\t\t\t}\n\t\t}\n\t\tsheet[r][c] = sum;\n\n\t\tfor(int i = 0; i < r + 1; i++){\n\t\t\tfor(int j = 0; j < c + 1; j++){\n\t\t\t\tif(j != c){\n\t\t\t\t\tSystem.out.printf(\"%d \", sheet[i][j]);\n\t\t\t\t} else{\n\t\t\t\t\tSystem.out.printf(\"%d\\n\", sheet[i][j]);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}",
"Main"
] | import java.util.*;
public class Main{
private static final Scanner scan = new Scanner(System.in);
public static void main(String[] args){
int r = scan.nextInt();
int c = scan.nextInt();
int[][] sheet = new int[r + 1][c + 1];
int sum = 0;
for(int i = 0; i < r; i++){
for(int j = 0; j < c; j++){
sheet[i][j] = scan.nextInt();
sum += sheet[i][j];
sheet[r][j] += sheet[i][j];
sheet[i][c] += sheet[i][j];
}
}
sheet[r][c] = sum;
for(int i = 0; i < r + 1; i++){
for(int j = 0; j < c + 1; j++){
if(j != c){
System.out.printf("%d ", sheet[i][j]);
} else{
System.out.printf("%d\n", sheet[i][j]);
}
}
}
}
} |
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
17,
41,
13,
4,
18,
13,
18,
13,
17,
41,
13,
4,
18,
13,
18,
13,
17,
41,
13,
20,
13,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
18,
18,
13,
13,
13,
4,
18,
13,
18,
13,
13,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
18,
13,
13,
1,
40,
13,
30,
30,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
18,
18,
13,
13,
13,
1,
40,
13,
30,
30,
4,
18,
18,
13,
13,
2,
18,
18,
13,
13,
13,
17,
0,
13,
18,
18,
13,
13,
13,
4,
18,
18,
13,
13,
13,
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,
18,
18,
13,
13,
13,
0,
13,
13,
4,
18,
18,
13,
13,
2,
13,
17,
4,
18,
18,
13,
13,
13,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
212,
5
],
[
212,
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
],
[
19,
20
],
[
20,
21
],
[
19,
22
],
[
8,
23
],
[
23,
24
],
[
23,
25
],
[
25,
26
],
[
26,
27
],
[
25,
28
],
[
28,
29
],
[
28,
30
],
[
8,
31
],
[
31,
32
],
[
31,
33
],
[
33,
34
],
[
34,
35
],
[
33,
36
],
[
36,
37
],
[
36,
38
],
[
8,
39
],
[
39,
40
],
[
39,
41
],
[
8,
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
],
[
57,
59
],
[
59,
60
],
[
60,
61
],
[
56,
62
],
[
62,
63
],
[
62,
64
],
[
64,
65
],
[
65,
66
],
[
64,
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
],
[
82,
86
],
[
81,
87
],
[
87,
88
],
[
88,
89
],
[
87,
90
],
[
90,
91
],
[
90,
92
],
[
8,
93
],
[
93,
94
],
[
93,
95
],
[
8,
96
],
[
96,
97
],
[
97,
98
],
[
98,
99
],
[
98,
100
],
[
96,
101
],
[
101,
102
],
[
101,
103
],
[
103,
104
],
[
103,
105
],
[
96,
106
],
[
106,
107
],
[
107,
108
],
[
96,
109
],
[
110,
110
],
[
110,
111
],
[
111,
112
],
[
111,
113
],
[
110,
114
],
[
114,
115
],
[
115,
116
],
[
116,
117
],
[
116,
118
],
[
114,
119
],
[
119,
120
],
[
119,
121
],
[
121,
122
],
[
122,
123
],
[
122,
124
],
[
121,
125
],
[
114,
126
],
[
126,
127
],
[
127,
128
],
[
114,
129
],
[
130,
130
],
[
130,
131
],
[
131,
132
],
[
132,
133
],
[
133,
134
],
[
133,
135
],
[
131,
136
],
[
136,
137
],
[
137,
138
],
[
138,
139
],
[
138,
140
],
[
137,
141
],
[
136,
142
],
[
130,
143
],
[
143,
144
],
[
143,
145
],
[
145,
146
],
[
146,
147
],
[
146,
148
],
[
145,
149
],
[
110,
150
],
[
150,
151
],
[
151,
152
],
[
152,
153
],
[
152,
154
],
[
150,
155
],
[
8,
156
],
[
156,
157
],
[
157,
158
],
[
158,
159
],
[
158,
160
],
[
156,
161
],
[
161,
162
],
[
161,
163
],
[
156,
164
],
[
164,
165
],
[
165,
166
],
[
156,
167
],
[
168,
168
],
[
168,
169
],
[
169,
170
],
[
169,
171
],
[
168,
172
],
[
172,
173
],
[
173,
174
],
[
174,
175
],
[
174,
176
],
[
172,
177
],
[
177,
178
],
[
177,
179
],
[
172,
180
],
[
180,
181
],
[
181,
182
],
[
172,
183
],
[
184,
184
],
[
184,
185
],
[
185,
186
],
[
185,
187
],
[
187,
188
],
[
188,
189
],
[
188,
190
],
[
187,
191
],
[
168,
192
],
[
192,
193
],
[
192,
194
],
[
168,
195
],
[
195,
196
],
[
196,
197
],
[
197,
198
],
[
197,
199
],
[
195,
200
],
[
200,
201
],
[
200,
202
],
[
8,
203
],
[
203,
204
],
[
204,
205
],
[
205,
206
],
[
205,
207
],
[
203,
208
],
[
6,
209
],
[
209,
210
],
[
0,
211
],
[
211,
212
],
[
211,
213
]
] | [
"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\t\n\t\t//?????¨?¨????????????????????????????\n\t\tString s = sc.nextLine();\n\t\tString [] ary = s.split(\" \");\n\t\tint height = Integer.parseInt(ary[0]);\n\t\tint width = Integer.parseInt(ary[1]);\n\t\t\n\t\t//?????±????????????????´???????\n\t\tint [][] data = new int[height][width];\n \t\tfor(int i = 0; i < height; i++) {\n\t\t\tString strData = sc.nextLine();\n\t\t\tString[] dataAry = strData.split(\" \");\n\t\t\tfor(int j = 0; j < width; j++) {\n\t\t\t\tdata[i][j] = Integer.parseInt(dataAry[j]);\n\t\t\t}\n\t\t}\n \t\t\n \t\t//??\\?????????????????±?????¨?????????\n \t\tint sumG = 0;\n \t\tfor(int i = 0; i < data.length; i++) {\n \t\t\tint sum = 0;\n \t\t\tfor(int j = 0; j <data[i].length; j++) {\n \t\t\t\tSystem.out.print(data[i][j] + \" \");\n \t\t\t\tsum += data[i][j];\n \t\t\t}\n \t\t\tSystem.out.println(sum);\n \t\t}\n \t\t\n \t\t//????¨??????¨?????????\n \t\tfor(int i = 0; i < width; i++) {\n \t\t\tint sum = 0;\n \t\t\tfor(int j = 0; j < height; j++) {\n \t\t\t\tsum += data[j][i];\n \t\t\t}\n \t\t\tsumG += sum;\n \t\t\tSystem.out.print(sum + \" \");\n \t\t}\n \t\tSystem.out.println(sumG);\n \t\t\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\t\n\t\t//?????¨?¨????????????????????????????\n\t\tString s = sc.nextLine();\n\t\tString [] ary = s.split(\" \");\n\t\tint height = Integer.parseInt(ary[0]);\n\t\tint width = Integer.parseInt(ary[1]);\n\t\t\n\t\t//?????±????????????????´???????\n\t\tint [][] data = new int[height][width];\n \t\tfor(int i = 0; i < height; i++) {\n\t\t\tString strData = sc.nextLine();\n\t\t\tString[] dataAry = strData.split(\" \");\n\t\t\tfor(int j = 0; j < width; j++) {\n\t\t\t\tdata[i][j] = Integer.parseInt(dataAry[j]);\n\t\t\t}\n\t\t}\n \t\t\n \t\t//??\\?????????????????±?????¨?????????\n \t\tint sumG = 0;\n \t\tfor(int i = 0; i < data.length; i++) {\n \t\t\tint sum = 0;\n \t\t\tfor(int j = 0; j <data[i].length; j++) {\n \t\t\t\tSystem.out.print(data[i][j] + \" \");\n \t\t\t\tsum += data[i][j];\n \t\t\t}\n \t\t\tSystem.out.println(sum);\n \t\t}\n \t\t\n \t\t//????¨??????¨?????????\n \t\tfor(int i = 0; i < width; i++) {\n \t\t\tint sum = 0;\n \t\t\tfor(int j = 0; j < height; j++) {\n \t\t\t\tsum += data[j][i];\n \t\t\t}\n \t\t\tsumG += sum;\n \t\t\tSystem.out.print(sum + \" \");\n \t\t}\n \t\tSystem.out.println(sumG);\n \t\t\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\t\n\t\t//?????¨?¨????????????????????????????\n\t\tString s = sc.nextLine();\n\t\tString [] ary = s.split(\" \");\n\t\tint height = Integer.parseInt(ary[0]);\n\t\tint width = Integer.parseInt(ary[1]);\n\t\t\n\t\t//?????±????????????????´???????\n\t\tint [][] data = new int[height][width];\n \t\tfor(int i = 0; i < height; i++) {\n\t\t\tString strData = sc.nextLine();\n\t\t\tString[] dataAry = strData.split(\" \");\n\t\t\tfor(int j = 0; j < width; j++) {\n\t\t\t\tdata[i][j] = Integer.parseInt(dataAry[j]);\n\t\t\t}\n\t\t}\n \t\t\n \t\t//??\\?????????????????±?????¨?????????\n \t\tint sumG = 0;\n \t\tfor(int i = 0; i < data.length; i++) {\n \t\t\tint sum = 0;\n \t\t\tfor(int j = 0; j <data[i].length; j++) {\n \t\t\t\tSystem.out.print(data[i][j] + \" \");\n \t\t\t\tsum += data[i][j];\n \t\t\t}\n \t\t\tSystem.out.println(sum);\n \t\t}\n \t\t\n \t\t//????¨??????¨?????????\n \t\tfor(int i = 0; i < width; i++) {\n \t\t\tint sum = 0;\n \t\t\tfor(int j = 0; j < height; j++) {\n \t\t\t\tsum += data[j][i];\n \t\t\t}\n \t\t\tsumG += sum;\n \t\t\tSystem.out.print(sum + \" \");\n \t\t}\n \t\tSystem.out.println(sumG);\n \t\t\n\t}",
"main",
"{\n\t\t// TODO ?????????????????????????????????????????????\n\t\tScanner sc = new Scanner(System.in);\n\t\t\n\t\t//?????¨?¨????????????????????????????\n\t\tString s = sc.nextLine();\n\t\tString [] ary = s.split(\" \");\n\t\tint height = Integer.parseInt(ary[0]);\n\t\tint width = Integer.parseInt(ary[1]);\n\t\t\n\t\t//?????±????????????????´???????\n\t\tint [][] data = new int[height][width];\n \t\tfor(int i = 0; i < height; i++) {\n\t\t\tString strData = sc.nextLine();\n\t\t\tString[] dataAry = strData.split(\" \");\n\t\t\tfor(int j = 0; j < width; j++) {\n\t\t\t\tdata[i][j] = Integer.parseInt(dataAry[j]);\n\t\t\t}\n\t\t}\n \t\t\n \t\t//??\\?????????????????±?????¨?????????\n \t\tint sumG = 0;\n \t\tfor(int i = 0; i < data.length; i++) {\n \t\t\tint sum = 0;\n \t\t\tfor(int j = 0; j <data[i].length; j++) {\n \t\t\t\tSystem.out.print(data[i][j] + \" \");\n \t\t\t\tsum += data[i][j];\n \t\t\t}\n \t\t\tSystem.out.println(sum);\n \t\t}\n \t\t\n \t\t//????¨??????¨?????????\n \t\tfor(int i = 0; i < width; i++) {\n \t\t\tint sum = 0;\n \t\t\tfor(int j = 0; j < height; j++) {\n \t\t\t\tsum += data[j][i];\n \t\t\t}\n \t\t\tsumG += sum;\n \t\t\tSystem.out.print(sum + \" \");\n \t\t}\n \t\tSystem.out.println(sumG);\n \t\t\n\t}",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"String s = sc.nextLine();",
"s",
"sc.nextLine()",
"sc.nextLine",
"sc",
"String [] ary = s.split(\" \");",
"ary",
"s.split(\" \")",
"s.split",
"s",
"\" \"",
"int height = Integer.parseInt(ary[0]);",
"height",
"Integer.parseInt(ary[0])",
"Integer.parseInt",
"Integer",
"ary[0]",
"ary",
"0",
"int width = Integer.parseInt(ary[1]);",
"width",
"Integer.parseInt(ary[1])",
"Integer.parseInt",
"Integer",
"ary[1]",
"ary",
"1",
"int [][] data = new int[height][width];",
"data",
"new int[height][width]",
"height",
"width",
"for(int i = 0; i < height; i++) {\n\t\t\tString strData = sc.nextLine();\n\t\t\tString[] dataAry = strData.split(\" \");\n\t\t\tfor(int j = 0; j < width; j++) {\n\t\t\t\tdata[i][j] = Integer.parseInt(dataAry[j]);\n\t\t\t}\n\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < height",
"i",
"height",
"i++",
"i++",
"i",
"{\n\t\t\tString strData = sc.nextLine();\n\t\t\tString[] dataAry = strData.split(\" \");\n\t\t\tfor(int j = 0; j < width; j++) {\n\t\t\t\tdata[i][j] = Integer.parseInt(dataAry[j]);\n\t\t\t}\n\t\t}",
"{\n\t\t\tString strData = sc.nextLine();\n\t\t\tString[] dataAry = strData.split(\" \");\n\t\t\tfor(int j = 0; j < width; j++) {\n\t\t\t\tdata[i][j] = Integer.parseInt(dataAry[j]);\n\t\t\t}\n\t\t}",
"String strData = sc.nextLine();",
"strData",
"sc.nextLine()",
"sc.nextLine",
"sc",
"String[] dataAry = strData.split(\" \");",
"dataAry",
"strData.split(\" \")",
"strData.split",
"strData",
"\" \"",
"for(int j = 0; j < width; j++) {\n\t\t\t\tdata[i][j] = Integer.parseInt(dataAry[j]);\n\t\t\t}",
"int j = 0;",
"int j = 0;",
"j",
"0",
"j < width",
"j",
"width",
"j++",
"j++",
"j",
"{\n\t\t\t\tdata[i][j] = Integer.parseInt(dataAry[j]);\n\t\t\t}",
"{\n\t\t\t\tdata[i][j] = Integer.parseInt(dataAry[j]);\n\t\t\t}",
"data[i][j] = Integer.parseInt(dataAry[j])",
"data[i][j]",
"data[i]",
"data",
"i",
"j",
"Integer.parseInt(dataAry[j])",
"Integer.parseInt",
"Integer",
"dataAry[j]",
"dataAry",
"j",
"int sumG = 0;",
"sumG",
"0",
"for(int i = 0; i < data.length; i++) {\n \t\t\tint sum = 0;\n \t\t\tfor(int j = 0; j <data[i].length; j++) {\n \t\t\t\tSystem.out.print(data[i][j] + \" \");\n \t\t\t\tsum += data[i][j];\n \t\t\t}\n \t\t\tSystem.out.println(sum);\n \t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < data.length",
"i",
"data.length",
"data",
"data.length",
"i++",
"i++",
"i",
"{\n \t\t\tint sum = 0;\n \t\t\tfor(int j = 0; j <data[i].length; j++) {\n \t\t\t\tSystem.out.print(data[i][j] + \" \");\n \t\t\t\tsum += data[i][j];\n \t\t\t}\n \t\t\tSystem.out.println(sum);\n \t\t}",
"{\n \t\t\tint sum = 0;\n \t\t\tfor(int j = 0; j <data[i].length; j++) {\n \t\t\t\tSystem.out.print(data[i][j] + \" \");\n \t\t\t\tsum += data[i][j];\n \t\t\t}\n \t\t\tSystem.out.println(sum);\n \t\t}",
"int sum = 0;",
"sum",
"0",
"for(int j = 0; j <data[i].length; j++) {\n \t\t\t\tSystem.out.print(data[i][j] + \" \");\n \t\t\t\tsum += data[i][j];\n \t\t\t}",
"int j = 0;",
"int j = 0;",
"j",
"0",
"j <data[i].length",
"j",
"data[i].length",
"data[i]",
"data",
"i",
"data[i].length",
"j++",
"j++",
"j",
"{\n \t\t\t\tSystem.out.print(data[i][j] + \" \");\n \t\t\t\tsum += data[i][j];\n \t\t\t}",
"{\n \t\t\t\tSystem.out.print(data[i][j] + \" \");\n \t\t\t\tsum += data[i][j];\n \t\t\t}",
"System.out.print(data[i][j] + \" \")",
"System.out.print",
"System.out",
"System",
"System.out",
"data[i][j] + \" \"",
"data[i][j]",
"data[i]",
"data",
"i",
"j",
"\" \"",
"sum += data[i][j]",
"sum",
"data[i][j]",
"data[i]",
"data",
"i",
"j",
"System.out.println(sum)",
"System.out.println",
"System.out",
"System",
"System.out",
"sum",
"for(int i = 0; i < width; i++) {\n \t\t\tint sum = 0;\n \t\t\tfor(int j = 0; j < height; j++) {\n \t\t\t\tsum += data[j][i];\n \t\t\t}\n \t\t\tsumG += sum;\n \t\t\tSystem.out.print(sum + \" \");\n \t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < width",
"i",
"width",
"i++",
"i++",
"i",
"{\n \t\t\tint sum = 0;\n \t\t\tfor(int j = 0; j < height; j++) {\n \t\t\t\tsum += data[j][i];\n \t\t\t}\n \t\t\tsumG += sum;\n \t\t\tSystem.out.print(sum + \" \");\n \t\t}",
"{\n \t\t\tint sum = 0;\n \t\t\tfor(int j = 0; j < height; j++) {\n \t\t\t\tsum += data[j][i];\n \t\t\t}\n \t\t\tsumG += sum;\n \t\t\tSystem.out.print(sum + \" \");\n \t\t}",
"int sum = 0;",
"sum",
"0",
"for(int j = 0; j < height; j++) {\n \t\t\t\tsum += data[j][i];\n \t\t\t}",
"int j = 0;",
"int j = 0;",
"j",
"0",
"j < height",
"j",
"height",
"j++",
"j++",
"j",
"{\n \t\t\t\tsum += data[j][i];\n \t\t\t}",
"{\n \t\t\t\tsum += data[j][i];\n \t\t\t}",
"sum += data[j][i]",
"sum",
"data[j][i]",
"data[j]",
"data",
"j",
"i",
"sumG += sum",
"sumG",
"sum",
"System.out.print(sum + \" \")",
"System.out.print",
"System.out",
"System",
"System.out",
"sum + \" \"",
"sum",
"\" \"",
"System.out.println(sumG)",
"System.out.println",
"System.out",
"System",
"System.out",
"sumG",
"String[] args",
"args",
"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\t\n\t\t//?????¨?¨????????????????????????????\n\t\tString s = sc.nextLine();\n\t\tString [] ary = s.split(\" \");\n\t\tint height = Integer.parseInt(ary[0]);\n\t\tint width = Integer.parseInt(ary[1]);\n\t\t\n\t\t//?????±????????????????´???????\n\t\tint [][] data = new int[height][width];\n \t\tfor(int i = 0; i < height; i++) {\n\t\t\tString strData = sc.nextLine();\n\t\t\tString[] dataAry = strData.split(\" \");\n\t\t\tfor(int j = 0; j < width; j++) {\n\t\t\t\tdata[i][j] = Integer.parseInt(dataAry[j]);\n\t\t\t}\n\t\t}\n \t\t\n \t\t//??\\?????????????????±?????¨?????????\n \t\tint sumG = 0;\n \t\tfor(int i = 0; i < data.length; i++) {\n \t\t\tint sum = 0;\n \t\t\tfor(int j = 0; j <data[i].length; j++) {\n \t\t\t\tSystem.out.print(data[i][j] + \" \");\n \t\t\t\tsum += data[i][j];\n \t\t\t}\n \t\t\tSystem.out.println(sum);\n \t\t}\n \t\t\n \t\t//????¨??????¨?????????\n \t\tfor(int i = 0; i < width; i++) {\n \t\t\tint sum = 0;\n \t\t\tfor(int j = 0; j < height; j++) {\n \t\t\t\tsum += data[j][i];\n \t\t\t}\n \t\t\tsumG += sum;\n \t\t\tSystem.out.print(sum + \" \");\n \t\t}\n \t\tSystem.out.println(sumG);\n \t\t\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\t\n\t\t//?????¨?¨????????????????????????????\n\t\tString s = sc.nextLine();\n\t\tString [] ary = s.split(\" \");\n\t\tint height = Integer.parseInt(ary[0]);\n\t\tint width = Integer.parseInt(ary[1]);\n\t\t\n\t\t//?????±????????????????´???????\n\t\tint [][] data = new int[height][width];\n \t\tfor(int i = 0; i < height; i++) {\n\t\t\tString strData = sc.nextLine();\n\t\t\tString[] dataAry = strData.split(\" \");\n\t\t\tfor(int j = 0; j < width; j++) {\n\t\t\t\tdata[i][j] = Integer.parseInt(dataAry[j]);\n\t\t\t}\n\t\t}\n \t\t\n \t\t//??\\?????????????????±?????¨?????????\n \t\tint sumG = 0;\n \t\tfor(int i = 0; i < data.length; i++) {\n \t\t\tint sum = 0;\n \t\t\tfor(int j = 0; j <data[i].length; j++) {\n \t\t\t\tSystem.out.print(data[i][j] + \" \");\n \t\t\t\tsum += data[i][j];\n \t\t\t}\n \t\t\tSystem.out.println(sum);\n \t\t}\n \t\t\n \t\t//????¨??????¨?????????\n \t\tfor(int i = 0; i < width; i++) {\n \t\t\tint sum = 0;\n \t\t\tfor(int j = 0; j < height; j++) {\n \t\t\t\tsum += data[j][i];\n \t\t\t}\n \t\t\tsumG += sum;\n \t\t\tSystem.out.print(sum + \" \");\n \t\t}\n \t\tSystem.out.println(sumG);\n \t\t\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);
//?????¨?¨????????????????????????????
String s = sc.nextLine();
String [] ary = s.split(" ");
int height = Integer.parseInt(ary[0]);
int width = Integer.parseInt(ary[1]);
//?????±????????????????´???????
int [][] data = new int[height][width];
for(int i = 0; i < height; i++) {
String strData = sc.nextLine();
String[] dataAry = strData.split(" ");
for(int j = 0; j < width; j++) {
data[i][j] = Integer.parseInt(dataAry[j]);
}
}
//??\?????????????????±?????¨?????????
int sumG = 0;
for(int i = 0; i < data.length; i++) {
int sum = 0;
for(int j = 0; j <data[i].length; j++) {
System.out.print(data[i][j] + " ");
sum += data[i][j];
}
System.out.println(sum);
}
//????¨??????¨?????????
for(int i = 0; i < width; i++) {
int sum = 0;
for(int j = 0; j < height; j++) {
sum += data[j][i];
}
sumG += sum;
System.out.print(sum + " ");
}
System.out.println(sumG);
}
} |
[
7,
15,
13,
17,
15,
13,
17,
6,
13,
41,
13,
20,
41,
13,
20,
12,
13,
30,
41,
13,
4,
18,
13,
4,
18,
13,
41,
13,
4,
18,
13,
4,
18,
13,
41,
13,
20,
2,
13,
17,
2,
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,
13,
4,
18,
13,
0,
18,
18,
13,
13,
13,
13,
0,
18,
18,
13,
13,
13,
13,
0,
18,
18,
13,
13,
13,
13,
0,
18,
18,
13,
13,
13,
13,
28,
13,
13,
30,
30,
41,
13,
17,
28,
13,
13,
30,
30,
14,
13,
0,
13,
17,
4,
18,
13,
17,
4,
18,
13,
13,
4,
18,
13,
4,
18,
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
],
[
7,
12
],
[
12,
13
],
[
12,
14
],
[
7,
15
],
[
15,
16
],
[
15,
17
],
[
17,
18
],
[
18,
19
],
[
18,
20
],
[
20,
21
],
[
21,
22
],
[
20,
23
],
[
23,
24
],
[
24,
25
],
[
17,
26
],
[
26,
27
],
[
26,
28
],
[
28,
29
],
[
29,
30
],
[
28,
31
],
[
31,
32
],
[
32,
33
],
[
17,
34
],
[
34,
35
],
[
34,
36
],
[
37,
38
],
[
37,
39
],
[
40,
41
],
[
40,
42
],
[
17,
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
],
[
69,
71
],
[
71,
72
],
[
72,
73
],
[
71,
74
],
[
74,
75
],
[
75,
76
],
[
68,
77
],
[
77,
78
],
[
78,
79
],
[
79,
80
],
[
79,
81
],
[
78,
82
],
[
77,
83
],
[
68,
84
],
[
84,
85
],
[
85,
86
],
[
86,
87
],
[
86,
88
],
[
85,
89
],
[
84,
90
],
[
68,
91
],
[
91,
92
],
[
92,
93
],
[
93,
94
],
[
93,
95
],
[
92,
96
],
[
91,
97
],
[
68,
98
],
[
98,
99
],
[
99,
100
],
[
100,
101
],
[
100,
102
],
[
99,
103
],
[
98,
104
],
[
17,
105
],
[
105,
106
],
[
105,
107
],
[
105,
108
],
[
109,
109
],
[
109,
110
],
[
110,
111
],
[
110,
112
],
[
109,
113
],
[
113,
114
],
[
113,
115
],
[
113,
116
],
[
117,
117
],
[
117,
118
],
[
118,
119
],
[
118,
120
],
[
120,
121
],
[
120,
122
],
[
118,
123
],
[
123,
124
],
[
124,
125
],
[
123,
126
],
[
117,
127
],
[
127,
128
],
[
128,
129
],
[
127,
130
],
[
109,
131
],
[
131,
132
],
[
132,
133
],
[
17,
134
],
[
134,
135
],
[
135,
136
],
[
15,
137
],
[
137,
138
]
] | [
"import java.io.PrintWriter;\nimport java.util.Scanner;\n\nclass Main{\n private static final Scanner sc = new Scanner(System.in);\n private static final PrintWriter out = new PrintWriter(System.out);\n public static void main(String[] Args){\n final int r = Integer.parseInt(sc.next());\n final int c = Integer.parseInt(sc.next());\n final int[][] cells = new int[r+1][c+1];\n for(int i = 0; i<r; i++){\n for(int j = 0; j<c; j++){\n final int num = Integer.parseInt(sc.next());\n cells[i][j] = num;\n cells[r][j] += num;\n cells[i][c] += num;\n cells[r][c] += num;\n }\n }\n for(final int[] cell:cells){\n boolean first = true;\n for(final int element:cell){\n if(first) first = false;\n else out.print(' ');\n out.print(element);\n }\n out.println();\n }\n out.flush();\n }\n}",
"import java.io.PrintWriter;",
"PrintWriter",
"java.io",
"import java.util.Scanner;",
"Scanner",
"java.util",
"class Main{\n private static final Scanner sc = new Scanner(System.in);\n private static final PrintWriter out = new PrintWriter(System.out);\n public static void main(String[] Args){\n final int r = Integer.parseInt(sc.next());\n final int c = Integer.parseInt(sc.next());\n final int[][] cells = new int[r+1][c+1];\n for(int i = 0; i<r; i++){\n for(int j = 0; j<c; j++){\n final int num = Integer.parseInt(sc.next());\n cells[i][j] = num;\n cells[r][j] += num;\n cells[i][c] += num;\n cells[r][c] += num;\n }\n }\n for(final int[] cell:cells){\n boolean first = true;\n for(final int element:cell){\n if(first) first = false;\n else out.print(' ');\n out.print(element);\n }\n out.println();\n }\n out.flush();\n }\n}",
"Main",
"private static final Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"private static final PrintWriter out = new PrintWriter(System.out);",
"out",
"new PrintWriter(System.out)",
"public static void main(String[] Args){\n final int r = Integer.parseInt(sc.next());\n final int c = Integer.parseInt(sc.next());\n final int[][] cells = new int[r+1][c+1];\n for(int i = 0; i<r; i++){\n for(int j = 0; j<c; j++){\n final int num = Integer.parseInt(sc.next());\n cells[i][j] = num;\n cells[r][j] += num;\n cells[i][c] += num;\n cells[r][c] += num;\n }\n }\n for(final int[] cell:cells){\n boolean first = true;\n for(final int element:cell){\n if(first) first = false;\n else out.print(' ');\n out.print(element);\n }\n out.println();\n }\n out.flush();\n }",
"main",
"{\n final int r = Integer.parseInt(sc.next());\n final int c = Integer.parseInt(sc.next());\n final int[][] cells = new int[r+1][c+1];\n for(int i = 0; i<r; i++){\n for(int j = 0; j<c; j++){\n final int num = Integer.parseInt(sc.next());\n cells[i][j] = num;\n cells[r][j] += num;\n cells[i][c] += num;\n cells[r][c] += num;\n }\n }\n for(final int[] cell:cells){\n boolean first = true;\n for(final int element:cell){\n if(first) first = false;\n else out.print(' ');\n out.print(element);\n }\n out.println();\n }\n out.flush();\n }",
"final int r = Integer.parseInt(sc.next());",
"r",
"Integer.parseInt(sc.next())",
"Integer.parseInt",
"Integer",
"sc.next()",
"sc.next",
"sc",
"final int c = Integer.parseInt(sc.next());",
"c",
"Integer.parseInt(sc.next())",
"Integer.parseInt",
"Integer",
"sc.next()",
"sc.next",
"sc",
"final int[][] cells = new int[r+1][c+1];",
"cells",
"new int[r+1][c+1]",
"r+1",
"r",
"1",
"c+1",
"c",
"1",
"for(int i = 0; i<r; i++){\n for(int j = 0; j<c; j++){\n final int num = Integer.parseInt(sc.next());\n cells[i][j] = num;\n cells[r][j] += num;\n cells[i][c] += num;\n cells[r][c] += num;\n }\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i<r",
"i",
"r",
"i++",
"i++",
"i",
"{\n for(int j = 0; j<c; j++){\n final int num = Integer.parseInt(sc.next());\n cells[i][j] = num;\n cells[r][j] += num;\n cells[i][c] += num;\n cells[r][c] += num;\n }\n }",
"{\n for(int j = 0; j<c; j++){\n final int num = Integer.parseInt(sc.next());\n cells[i][j] = num;\n cells[r][j] += num;\n cells[i][c] += num;\n cells[r][c] += num;\n }\n }",
"for(int j = 0; j<c; j++){\n final int num = Integer.parseInt(sc.next());\n cells[i][j] = num;\n cells[r][j] += num;\n cells[i][c] += num;\n cells[r][c] += num;\n }",
"int j = 0;",
"int j = 0;",
"j",
"0",
"j<c",
"j",
"c",
"j++",
"j++",
"j",
"{\n final int num = Integer.parseInt(sc.next());\n cells[i][j] = num;\n cells[r][j] += num;\n cells[i][c] += num;\n cells[r][c] += num;\n }",
"{\n final int num = Integer.parseInt(sc.next());\n cells[i][j] = num;\n cells[r][j] += num;\n cells[i][c] += num;\n cells[r][c] += num;\n }",
"final int num = Integer.parseInt(sc.next());",
"num",
"Integer.parseInt(sc.next())",
"Integer.parseInt",
"Integer",
"sc.next()",
"sc.next",
"sc",
"cells[i][j] = num",
"cells[i][j]",
"cells[i]",
"cells",
"i",
"j",
"num",
"cells[r][j] += num",
"cells[r][j]",
"cells[r]",
"cells",
"r",
"j",
"num",
"cells[i][c] += num",
"cells[i][c]",
"cells[i]",
"cells",
"i",
"c",
"num",
"cells[r][c] += num",
"cells[r][c]",
"cells[r]",
"cells",
"r",
"c",
"num",
"for(final int[] cell:cells){\n boolean first = true;\n for(final int element:cell){\n if(first) first = false;\n else out.print(' ');\n out.print(element);\n }\n out.println();\n }",
"final int[] cell",
"cells",
"{\n boolean first = true;\n for(final int element:cell){\n if(first) first = false;\n else out.print(' ');\n out.print(element);\n }\n out.println();\n }",
"{\n boolean first = true;\n for(final int element:cell){\n if(first) first = false;\n else out.print(' ');\n out.print(element);\n }\n out.println();\n }",
"boolean first = true;",
"first",
"true",
"for(final int element:cell){\n if(first) first = false;\n else out.print(' ');\n out.print(element);\n }",
"final int element",
"cell",
"{\n if(first) first = false;\n else out.print(' ');\n out.print(element);\n }",
"{\n if(first) first = false;\n else out.print(' ');\n out.print(element);\n }",
"if(first) first = false;\n else out.print(' ');",
"first",
"first = false",
"first",
"false",
"out.print(' ')",
"out.print",
"out",
"' '",
"out.print(element)",
"out.print",
"out",
"element",
"out.println()",
"out.println",
"out",
"out.flush()",
"out.flush",
"out",
"String[] Args",
"Args"
] | import java.io.PrintWriter;
import java.util.Scanner;
class Main{
private static final Scanner sc = new Scanner(System.in);
private static final PrintWriter out = new PrintWriter(System.out);
public static void main(String[] Args){
final int r = Integer.parseInt(sc.next());
final int c = Integer.parseInt(sc.next());
final int[][] cells = new int[r+1][c+1];
for(int i = 0; i<r; i++){
for(int j = 0; j<c; j++){
final int num = Integer.parseInt(sc.next());
cells[i][j] = num;
cells[r][j] += num;
cells[i][c] += num;
cells[r][c] += num;
}
}
for(final int[] cell:cells){
boolean first = true;
for(final int element:cell){
if(first) first = false;
else out.print(' ');
out.print(element);
}
out.println();
}
out.flush();
}
} |
[
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,
41,
13,
20,
2,
13,
17,
2,
13,
17,
41,
13,
20,
13,
41,
13,
20,
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,
14,
2,
2,
13,
13,
2,
13,
13,
30,
0,
18,
18,
13,
13,
13,
4,
18,
13,
0,
13,
18,
18,
13,
13,
13,
0,
18,
13,
13,
18,
18,
13,
13,
13,
0,
18,
13,
13,
18,
18,
13,
13,
13,
14,
2,
2,
13,
13,
2,
13,
13,
30,
0,
18,
18,
13,
13,
13,
18,
13,
13,
14,
2,
2,
13,
13,
2,
13,
13,
30,
0,
18,
18,
13,
13,
13,
18,
13,
13,
14,
2,
2,
13,
13,
2,
13,
13,
30,
0,
18,
18,
13,
13,
13,
13,
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,
4,
18,
18,
13,
13,
18,
18,
13,
13,
13,
14,
2,
13,
13,
30,
4,
18,
18,
13,
13,
17,
4,
18,
18,
13,
13,
4,
18,
13,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
232,
8
],
[
232,
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
],
[
11,
25
],
[
25,
26
],
[
25,
27
],
[
28,
29
],
[
28,
30
],
[
31,
32
],
[
31,
33
],
[
11,
34
],
[
34,
35
],
[
34,
36
],
[
11,
38
],
[
38,
39
],
[
38,
40
],
[
11,
42
],
[
42,
43
],
[
42,
44
],
[
11,
45
],
[
45,
46
],
[
46,
47
],
[
47,
48
],
[
47,
49
],
[
45,
50
],
[
50,
51
],
[
50,
52
],
[
52,
53
],
[
52,
54
],
[
45,
55
],
[
55,
56
],
[
56,
57
],
[
45,
58
],
[
59,
59
],
[
59,
60
],
[
60,
61
],
[
61,
62
],
[
62,
63
],
[
62,
64
],
[
60,
65
],
[
65,
66
],
[
65,
67
],
[
67,
68
],
[
67,
69
],
[
60,
70
],
[
70,
71
],
[
71,
72
],
[
60,
73
],
[
74,
74
],
[
74,
75
],
[
75,
76
],
[
76,
77
],
[
77,
78
],
[
77,
79
],
[
76,
80
],
[
80,
81
],
[
80,
82
],
[
75,
83
],
[
83,
84
],
[
84,
85
],
[
85,
86
],
[
86,
87
],
[
86,
88
],
[
85,
89
],
[
84,
90
],
[
90,
91
],
[
91,
92
],
[
83,
93
],
[
93,
94
],
[
93,
95
],
[
95,
96
],
[
96,
97
],
[
96,
98
],
[
95,
99
],
[
83,
100
],
[
100,
101
],
[
101,
102
],
[
101,
103
],
[
100,
104
],
[
104,
105
],
[
105,
106
],
[
105,
107
],
[
104,
108
],
[
83,
109
],
[
109,
110
],
[
110,
111
],
[
110,
112
],
[
109,
113
],
[
113,
114
],
[
114,
115
],
[
114,
116
],
[
113,
117
],
[
75,
118
],
[
118,
119
],
[
119,
120
],
[
120,
121
],
[
120,
122
],
[
119,
123
],
[
123,
124
],
[
123,
125
],
[
118,
126
],
[
126,
127
],
[
127,
128
],
[
128,
129
],
[
129,
130
],
[
129,
131
],
[
128,
132
],
[
127,
133
],
[
133,
134
],
[
133,
135
],
[
118,
136
],
[
136,
137
],
[
137,
138
],
[
138,
139
],
[
138,
140
],
[
137,
141
],
[
141,
142
],
[
141,
143
],
[
136,
144
],
[
144,
145
],
[
145,
146
],
[
146,
147
],
[
147,
148
],
[
147,
149
],
[
146,
150
],
[
145,
151
],
[
151,
152
],
[
151,
153
],
[
136,
154
],
[
154,
155
],
[
155,
156
],
[
156,
157
],
[
156,
158
],
[
155,
159
],
[
159,
160
],
[
159,
161
],
[
154,
162
],
[
162,
163
],
[
163,
164
],
[
164,
165
],
[
165,
166
],
[
165,
167
],
[
164,
168
],
[
163,
169
],
[
11,
170
],
[
170,
171
],
[
171,
172
],
[
172,
173
],
[
172,
174
],
[
170,
175
],
[
175,
176
],
[
175,
177
],
[
177,
178
],
[
177,
179
],
[
170,
180
],
[
180,
181
],
[
181,
182
],
[
170,
183
],
[
184,
184
],
[
184,
185
],
[
185,
186
],
[
186,
187
],
[
187,
188
],
[
187,
189
],
[
185,
190
],
[
190,
191
],
[
190,
192
],
[
192,
193
],
[
192,
194
],
[
185,
195
],
[
195,
196
],
[
196,
197
],
[
185,
198
],
[
199,
199
],
[
199,
200
],
[
200,
201
],
[
201,
202
],
[
202,
203
],
[
202,
204
],
[
200,
205
],
[
205,
206
],
[
206,
207
],
[
206,
208
],
[
205,
209
],
[
199,
210
],
[
210,
211
],
[
211,
212
],
[
211,
213
],
[
210,
214
],
[
214,
215
],
[
215,
216
],
[
216,
217
],
[
217,
218
],
[
217,
219
],
[
215,
220
],
[
184,
221
],
[
221,
222
],
[
222,
223
],
[
223,
224
],
[
223,
225
],
[
11,
226
],
[
226,
227
],
[
227,
228
],
[
9,
229
],
[
229,
230
],
[
0,
231
],
[
231,
232
],
[
231,
233
]
] | [
"import java.io.IOException;\nimport java.util.Scanner;\npublic class Main {\n\tpublic static void main(String[] args) throws IOException{\n\n\t\tScanner sc = new Scanner(System.in);\n\n\t\tint x = sc.nextInt();\n\t\tint y = sc.nextInt();\n\n\t\tint[][] sheet = new int[x+1][y+1];\n\t\tint[] row = new int[x];\n\t\tint[] col = new int[y];\n\t\tint total = 0;\n\n\t\tfor(int i=0;i<x+1;i++) {\n\t\t\tfor(int j=0;j<y+1;j++) {\n\t\t\t\tif(i!=x && j!=y){\n\t\t\t\t\tsheet[i][j] = sc.nextInt();\n\t\t\t\t\ttotal += sheet[i][j];\n\t\t\t\t\trow[i] += sheet[i][j];\n\t\t\t\t\tcol[j] += sheet[i][j];\n\t\t\t\t}else if(i!=x && j==y) {\n\t\t\t\t\tsheet[i][j] = row[i];\n\t\t\t\t}else if(i==x && j!=y) {\n\t\t\t\t\tsheet[i][j] = col[j];\n\t\t\t\t}else if(i==x && j==y) {\n\t\t\t\t\tsheet[i][j] = total;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tfor(int i=0;i<x+1;i++) {\n\t\t\tfor(int j=0;j<y+1;j++) {\n\t\t\t\tSystem.out.print(sheet[i][j]);\n\t\t\t\tif(j!=y) {\n\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t}\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}\n\t\tsc.close();\n\t}\n}",
"import java.io.IOException;",
"IOException",
"java.io",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n\tpublic static void main(String[] args) throws IOException{\n\n\t\tScanner sc = new Scanner(System.in);\n\n\t\tint x = sc.nextInt();\n\t\tint y = sc.nextInt();\n\n\t\tint[][] sheet = new int[x+1][y+1];\n\t\tint[] row = new int[x];\n\t\tint[] col = new int[y];\n\t\tint total = 0;\n\n\t\tfor(int i=0;i<x+1;i++) {\n\t\t\tfor(int j=0;j<y+1;j++) {\n\t\t\t\tif(i!=x && j!=y){\n\t\t\t\t\tsheet[i][j] = sc.nextInt();\n\t\t\t\t\ttotal += sheet[i][j];\n\t\t\t\t\trow[i] += sheet[i][j];\n\t\t\t\t\tcol[j] += sheet[i][j];\n\t\t\t\t}else if(i!=x && j==y) {\n\t\t\t\t\tsheet[i][j] = row[i];\n\t\t\t\t}else if(i==x && j!=y) {\n\t\t\t\t\tsheet[i][j] = col[j];\n\t\t\t\t}else if(i==x && j==y) {\n\t\t\t\t\tsheet[i][j] = total;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tfor(int i=0;i<x+1;i++) {\n\t\t\tfor(int j=0;j<y+1;j++) {\n\t\t\t\tSystem.out.print(sheet[i][j]);\n\t\t\t\tif(j!=y) {\n\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t}\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}\n\t\tsc.close();\n\t}\n}",
"Main",
"public static void main(String[] args) throws IOException{\n\n\t\tScanner sc = new Scanner(System.in);\n\n\t\tint x = sc.nextInt();\n\t\tint y = sc.nextInt();\n\n\t\tint[][] sheet = new int[x+1][y+1];\n\t\tint[] row = new int[x];\n\t\tint[] col = new int[y];\n\t\tint total = 0;\n\n\t\tfor(int i=0;i<x+1;i++) {\n\t\t\tfor(int j=0;j<y+1;j++) {\n\t\t\t\tif(i!=x && j!=y){\n\t\t\t\t\tsheet[i][j] = sc.nextInt();\n\t\t\t\t\ttotal += sheet[i][j];\n\t\t\t\t\trow[i] += sheet[i][j];\n\t\t\t\t\tcol[j] += sheet[i][j];\n\t\t\t\t}else if(i!=x && j==y) {\n\t\t\t\t\tsheet[i][j] = row[i];\n\t\t\t\t}else if(i==x && j!=y) {\n\t\t\t\t\tsheet[i][j] = col[j];\n\t\t\t\t}else if(i==x && j==y) {\n\t\t\t\t\tsheet[i][j] = total;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tfor(int i=0;i<x+1;i++) {\n\t\t\tfor(int j=0;j<y+1;j++) {\n\t\t\t\tSystem.out.print(sheet[i][j]);\n\t\t\t\tif(j!=y) {\n\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t}\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}\n\t\tsc.close();\n\t}",
"main",
"{\n\n\t\tScanner sc = new Scanner(System.in);\n\n\t\tint x = sc.nextInt();\n\t\tint y = sc.nextInt();\n\n\t\tint[][] sheet = new int[x+1][y+1];\n\t\tint[] row = new int[x];\n\t\tint[] col = new int[y];\n\t\tint total = 0;\n\n\t\tfor(int i=0;i<x+1;i++) {\n\t\t\tfor(int j=0;j<y+1;j++) {\n\t\t\t\tif(i!=x && j!=y){\n\t\t\t\t\tsheet[i][j] = sc.nextInt();\n\t\t\t\t\ttotal += sheet[i][j];\n\t\t\t\t\trow[i] += sheet[i][j];\n\t\t\t\t\tcol[j] += sheet[i][j];\n\t\t\t\t}else if(i!=x && j==y) {\n\t\t\t\t\tsheet[i][j] = row[i];\n\t\t\t\t}else if(i==x && j!=y) {\n\t\t\t\t\tsheet[i][j] = col[j];\n\t\t\t\t}else if(i==x && j==y) {\n\t\t\t\t\tsheet[i][j] = total;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tfor(int i=0;i<x+1;i++) {\n\t\t\tfor(int j=0;j<y+1;j++) {\n\t\t\t\tSystem.out.print(sheet[i][j]);\n\t\t\t\tif(j!=y) {\n\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t}\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}\n\t\tsc.close();\n\t}",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"int x = sc.nextInt();",
"x",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int y = sc.nextInt();",
"y",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int[][] sheet = new int[x+1][y+1];",
"sheet",
"new int[x+1][y+1]",
"x+1",
"x",
"1",
"y+1",
"y",
"1",
"int[] row = new int[x];",
"row",
"new int[x]",
"x",
"int[] col = new int[y];",
"col",
"new int[y]",
"y",
"int total = 0;",
"total",
"0",
"for(int i=0;i<x+1;i++) {\n\t\t\tfor(int j=0;j<y+1;j++) {\n\t\t\t\tif(i!=x && j!=y){\n\t\t\t\t\tsheet[i][j] = sc.nextInt();\n\t\t\t\t\ttotal += sheet[i][j];\n\t\t\t\t\trow[i] += sheet[i][j];\n\t\t\t\t\tcol[j] += sheet[i][j];\n\t\t\t\t}else if(i!=x && j==y) {\n\t\t\t\t\tsheet[i][j] = row[i];\n\t\t\t\t}else if(i==x && j!=y) {\n\t\t\t\t\tsheet[i][j] = col[j];\n\t\t\t\t}else if(i==x && j==y) {\n\t\t\t\t\tsheet[i][j] = total;\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"int i=0;",
"int i=0;",
"i",
"0",
"i<x+1",
"i",
"x+1",
"x",
"1",
"i++",
"i++",
"i",
"{\n\t\t\tfor(int j=0;j<y+1;j++) {\n\t\t\t\tif(i!=x && j!=y){\n\t\t\t\t\tsheet[i][j] = sc.nextInt();\n\t\t\t\t\ttotal += sheet[i][j];\n\t\t\t\t\trow[i] += sheet[i][j];\n\t\t\t\t\tcol[j] += sheet[i][j];\n\t\t\t\t}else if(i!=x && j==y) {\n\t\t\t\t\tsheet[i][j] = row[i];\n\t\t\t\t}else if(i==x && j!=y) {\n\t\t\t\t\tsheet[i][j] = col[j];\n\t\t\t\t}else if(i==x && j==y) {\n\t\t\t\t\tsheet[i][j] = total;\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"{\n\t\t\tfor(int j=0;j<y+1;j++) {\n\t\t\t\tif(i!=x && j!=y){\n\t\t\t\t\tsheet[i][j] = sc.nextInt();\n\t\t\t\t\ttotal += sheet[i][j];\n\t\t\t\t\trow[i] += sheet[i][j];\n\t\t\t\t\tcol[j] += sheet[i][j];\n\t\t\t\t}else if(i!=x && j==y) {\n\t\t\t\t\tsheet[i][j] = row[i];\n\t\t\t\t}else if(i==x && j!=y) {\n\t\t\t\t\tsheet[i][j] = col[j];\n\t\t\t\t}else if(i==x && j==y) {\n\t\t\t\t\tsheet[i][j] = total;\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"for(int j=0;j<y+1;j++) {\n\t\t\t\tif(i!=x && j!=y){\n\t\t\t\t\tsheet[i][j] = sc.nextInt();\n\t\t\t\t\ttotal += sheet[i][j];\n\t\t\t\t\trow[i] += sheet[i][j];\n\t\t\t\t\tcol[j] += sheet[i][j];\n\t\t\t\t}else if(i!=x && j==y) {\n\t\t\t\t\tsheet[i][j] = row[i];\n\t\t\t\t}else if(i==x && j!=y) {\n\t\t\t\t\tsheet[i][j] = col[j];\n\t\t\t\t}else if(i==x && j==y) {\n\t\t\t\t\tsheet[i][j] = total;\n\t\t\t\t}\n\t\t\t}",
"int j=0;",
"int j=0;",
"j",
"0",
"j<y+1",
"j",
"y+1",
"y",
"1",
"j++",
"j++",
"j",
"{\n\t\t\t\tif(i!=x && j!=y){\n\t\t\t\t\tsheet[i][j] = sc.nextInt();\n\t\t\t\t\ttotal += sheet[i][j];\n\t\t\t\t\trow[i] += sheet[i][j];\n\t\t\t\t\tcol[j] += sheet[i][j];\n\t\t\t\t}else if(i!=x && j==y) {\n\t\t\t\t\tsheet[i][j] = row[i];\n\t\t\t\t}else if(i==x && j!=y) {\n\t\t\t\t\tsheet[i][j] = col[j];\n\t\t\t\t}else if(i==x && j==y) {\n\t\t\t\t\tsheet[i][j] = total;\n\t\t\t\t}\n\t\t\t}",
"{\n\t\t\t\tif(i!=x && j!=y){\n\t\t\t\t\tsheet[i][j] = sc.nextInt();\n\t\t\t\t\ttotal += sheet[i][j];\n\t\t\t\t\trow[i] += sheet[i][j];\n\t\t\t\t\tcol[j] += sheet[i][j];\n\t\t\t\t}else if(i!=x && j==y) {\n\t\t\t\t\tsheet[i][j] = row[i];\n\t\t\t\t}else if(i==x && j!=y) {\n\t\t\t\t\tsheet[i][j] = col[j];\n\t\t\t\t}else if(i==x && j==y) {\n\t\t\t\t\tsheet[i][j] = total;\n\t\t\t\t}\n\t\t\t}",
"if(i!=x && j!=y){\n\t\t\t\t\tsheet[i][j] = sc.nextInt();\n\t\t\t\t\ttotal += sheet[i][j];\n\t\t\t\t\trow[i] += sheet[i][j];\n\t\t\t\t\tcol[j] += sheet[i][j];\n\t\t\t\t}else if(i!=x && j==y) {\n\t\t\t\t\tsheet[i][j] = row[i];\n\t\t\t\t}else if(i==x && j!=y) {\n\t\t\t\t\tsheet[i][j] = col[j];\n\t\t\t\t}else if(i==x && j==y) {\n\t\t\t\t\tsheet[i][j] = total;\n\t\t\t\t}",
"i!=x && j!=y",
"i!=x",
"i",
"x",
"j!=y",
"j",
"y",
"{\n\t\t\t\t\tsheet[i][j] = sc.nextInt();\n\t\t\t\t\ttotal += sheet[i][j];\n\t\t\t\t\trow[i] += sheet[i][j];\n\t\t\t\t\tcol[j] += sheet[i][j];\n\t\t\t\t}",
"sheet[i][j] = sc.nextInt()",
"sheet[i][j]",
"sheet[i]",
"sheet",
"i",
"j",
"sc.nextInt()",
"sc.nextInt",
"sc",
"total += sheet[i][j]",
"total",
"sheet[i][j]",
"sheet[i]",
"sheet",
"i",
"j",
"row[i] += sheet[i][j]",
"row[i]",
"row",
"i",
"sheet[i][j]",
"sheet[i]",
"sheet",
"i",
"j",
"col[j] += sheet[i][j]",
"col[j]",
"col",
"j",
"sheet[i][j]",
"sheet[i]",
"sheet",
"i",
"j",
"if(i!=x && j==y) {\n\t\t\t\t\tsheet[i][j] = row[i];\n\t\t\t\t}else if(i==x && j!=y) {\n\t\t\t\t\tsheet[i][j] = col[j];\n\t\t\t\t}else if(i==x && j==y) {\n\t\t\t\t\tsheet[i][j] = total;\n\t\t\t\t}",
"i!=x && j==y",
"i!=x",
"i",
"x",
"j==y",
"j",
"y",
"{\n\t\t\t\t\tsheet[i][j] = row[i];\n\t\t\t\t}",
"sheet[i][j] = row[i]",
"sheet[i][j]",
"sheet[i]",
"sheet",
"i",
"j",
"row[i]",
"row",
"i",
"if(i==x && j!=y) {\n\t\t\t\t\tsheet[i][j] = col[j];\n\t\t\t\t}else if(i==x && j==y) {\n\t\t\t\t\tsheet[i][j] = total;\n\t\t\t\t}",
"i==x && j!=y",
"i==x",
"i",
"x",
"j!=y",
"j",
"y",
"{\n\t\t\t\t\tsheet[i][j] = col[j];\n\t\t\t\t}",
"sheet[i][j] = col[j]",
"sheet[i][j]",
"sheet[i]",
"sheet",
"i",
"j",
"col[j]",
"col",
"j",
"if(i==x && j==y) {\n\t\t\t\t\tsheet[i][j] = total;\n\t\t\t\t}",
"i==x && j==y",
"i==x",
"i",
"x",
"j==y",
"j",
"y",
"{\n\t\t\t\t\tsheet[i][j] = total;\n\t\t\t\t}",
"sheet[i][j] = total",
"sheet[i][j]",
"sheet[i]",
"sheet",
"i",
"j",
"total",
"for(int i=0;i<x+1;i++) {\n\t\t\tfor(int j=0;j<y+1;j++) {\n\t\t\t\tSystem.out.print(sheet[i][j]);\n\t\t\t\tif(j!=y) {\n\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t}\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}",
"int i=0;",
"int i=0;",
"i",
"0",
"i<x+1",
"i",
"x+1",
"x",
"1",
"i++",
"i++",
"i",
"{\n\t\t\tfor(int j=0;j<y+1;j++) {\n\t\t\t\tSystem.out.print(sheet[i][j]);\n\t\t\t\tif(j!=y) {\n\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t}\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}",
"{\n\t\t\tfor(int j=0;j<y+1;j++) {\n\t\t\t\tSystem.out.print(sheet[i][j]);\n\t\t\t\tif(j!=y) {\n\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t}\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}",
"for(int j=0;j<y+1;j++) {\n\t\t\t\tSystem.out.print(sheet[i][j]);\n\t\t\t\tif(j!=y) {\n\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t}\n\t\t\t}",
"int j=0;",
"int j=0;",
"j",
"0",
"j<y+1",
"j",
"y+1",
"y",
"1",
"j++",
"j++",
"j",
"{\n\t\t\t\tSystem.out.print(sheet[i][j]);\n\t\t\t\tif(j!=y) {\n\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t}\n\t\t\t}",
"{\n\t\t\t\tSystem.out.print(sheet[i][j]);\n\t\t\t\tif(j!=y) {\n\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t}\n\t\t\t}",
"System.out.print(sheet[i][j])",
"System.out.print",
"System.out",
"System",
"System.out",
"sheet[i][j]",
"sheet[i]",
"sheet",
"i",
"j",
"if(j!=y) {\n\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t}",
"j!=y",
"j",
"y",
"{\n\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t}",
"System.out.print(\" \")",
"System.out.print",
"System.out",
"System",
"System.out",
"\" \"",
"System.out.println()",
"System.out.println",
"System.out",
"System",
"System.out",
"sc.close()",
"sc.close",
"sc",
"String[] args",
"args",
"public class Main {\n\tpublic static void main(String[] args) throws IOException{\n\n\t\tScanner sc = new Scanner(System.in);\n\n\t\tint x = sc.nextInt();\n\t\tint y = sc.nextInt();\n\n\t\tint[][] sheet = new int[x+1][y+1];\n\t\tint[] row = new int[x];\n\t\tint[] col = new int[y];\n\t\tint total = 0;\n\n\t\tfor(int i=0;i<x+1;i++) {\n\t\t\tfor(int j=0;j<y+1;j++) {\n\t\t\t\tif(i!=x && j!=y){\n\t\t\t\t\tsheet[i][j] = sc.nextInt();\n\t\t\t\t\ttotal += sheet[i][j];\n\t\t\t\t\trow[i] += sheet[i][j];\n\t\t\t\t\tcol[j] += sheet[i][j];\n\t\t\t\t}else if(i!=x && j==y) {\n\t\t\t\t\tsheet[i][j] = row[i];\n\t\t\t\t}else if(i==x && j!=y) {\n\t\t\t\t\tsheet[i][j] = col[j];\n\t\t\t\t}else if(i==x && j==y) {\n\t\t\t\t\tsheet[i][j] = total;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tfor(int i=0;i<x+1;i++) {\n\t\t\tfor(int j=0;j<y+1;j++) {\n\t\t\t\tSystem.out.print(sheet[i][j]);\n\t\t\t\tif(j!=y) {\n\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t}\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}\n\t\tsc.close();\n\t}\n}",
"public class Main {\n\tpublic static void main(String[] args) throws IOException{\n\n\t\tScanner sc = new Scanner(System.in);\n\n\t\tint x = sc.nextInt();\n\t\tint y = sc.nextInt();\n\n\t\tint[][] sheet = new int[x+1][y+1];\n\t\tint[] row = new int[x];\n\t\tint[] col = new int[y];\n\t\tint total = 0;\n\n\t\tfor(int i=0;i<x+1;i++) {\n\t\t\tfor(int j=0;j<y+1;j++) {\n\t\t\t\tif(i!=x && j!=y){\n\t\t\t\t\tsheet[i][j] = sc.nextInt();\n\t\t\t\t\ttotal += sheet[i][j];\n\t\t\t\t\trow[i] += sheet[i][j];\n\t\t\t\t\tcol[j] += sheet[i][j];\n\t\t\t\t}else if(i!=x && j==y) {\n\t\t\t\t\tsheet[i][j] = row[i];\n\t\t\t\t}else if(i==x && j!=y) {\n\t\t\t\t\tsheet[i][j] = col[j];\n\t\t\t\t}else if(i==x && j==y) {\n\t\t\t\t\tsheet[i][j] = total;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tfor(int i=0;i<x+1;i++) {\n\t\t\tfor(int j=0;j<y+1;j++) {\n\t\t\t\tSystem.out.print(sheet[i][j]);\n\t\t\t\tif(j!=y) {\n\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t}\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}\n\t\tsc.close();\n\t}\n}",
"Main"
] | import java.io.IOException;
import java.util.Scanner;
public class Main {
public static void main(String[] args) throws IOException{
Scanner sc = new Scanner(System.in);
int x = sc.nextInt();
int y = sc.nextInt();
int[][] sheet = new int[x+1][y+1];
int[] row = new int[x];
int[] col = new int[y];
int total = 0;
for(int i=0;i<x+1;i++) {
for(int j=0;j<y+1;j++) {
if(i!=x && j!=y){
sheet[i][j] = sc.nextInt();
total += sheet[i][j];
row[i] += sheet[i][j];
col[j] += sheet[i][j];
}else if(i!=x && j==y) {
sheet[i][j] = row[i];
}else if(i==x && j!=y) {
sheet[i][j] = col[j];
}else if(i==x && j==y) {
sheet[i][j] = total;
}
}
}
for(int i=0;i<x+1;i++) {
for(int j=0;j<y+1;j++) {
System.out.print(sheet[i][j]);
if(j!=y) {
System.out.print(" ");
}
}
System.out.println();
}
sc.close();
}
}
|
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
41,
13,
20,
2,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
41,
13,
17,
41,
13,
4,
18,
13,
4,
18,
18,
13,
13,
13,
0,
13,
13,
0,
18,
13,
17,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
4,
18,
13,
4,
18,
18,
13,
13,
2,
17,
13,
0,
13,
13,
0,
18,
13,
13,
13,
4,
18,
18,
13,
13,
2,
17,
13,
0,
18,
13,
13,
13,
4,
18,
18,
13,
13,
18,
13,
17,
11,
1,
41,
13,
17,
2,
13,
2,
13,
17,
1,
40,
13,
30,
30,
4,
18,
18,
13,
13,
2,
17,
18,
13,
13,
4,
18,
18,
13,
13,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
151,
5
],
[
151,
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
],
[
19,
20
],
[
20,
21
],
[
8,
22
],
[
22,
23
],
[
22,
24
],
[
25,
26
],
[
25,
27
],
[
8,
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
],
[
41,
43
],
[
40,
44
],
[
44,
45
],
[
44,
46
],
[
46,
47
],
[
47,
48
],
[
40,
49
],
[
49,
50
],
[
50,
51
],
[
51,
52
],
[
51,
53
],
[
49,
54
],
[
40,
55
],
[
55,
56
],
[
55,
57
],
[
40,
58
],
[
58,
59
],
[
59,
60
],
[
59,
61
],
[
58,
62
],
[
40,
63
],
[
63,
64
],
[
64,
65
],
[
65,
66
],
[
65,
67
],
[
63,
68
],
[
68,
69
],
[
68,
70
],
[
63,
71
],
[
71,
72
],
[
72,
73
],
[
63,
74
],
[
75,
75
],
[
75,
76
],
[
76,
77
],
[
76,
78
],
[
78,
79
],
[
79,
80
],
[
75,
81
],
[
81,
82
],
[
82,
83
],
[
83,
84
],
[
83,
85
],
[
81,
86
],
[
86,
87
],
[
86,
88
],
[
75,
89
],
[
89,
90
],
[
89,
91
],
[
75,
92
],
[
92,
93
],
[
93,
94
],
[
93,
95
],
[
92,
96
],
[
40,
97
],
[
97,
98
],
[
98,
99
],
[
99,
100
],
[
99,
101
],
[
97,
102
],
[
102,
103
],
[
102,
104
],
[
40,
105
],
[
105,
106
],
[
106,
107
],
[
106,
108
],
[
105,
109
],
[
8,
110
],
[
110,
111
],
[
111,
112
],
[
112,
113
],
[
112,
114
],
[
110,
115
],
[
115,
116
],
[
115,
117
],
[
8,
118
],
[
118,
119
],
[
119,
120
],
[
120,
121
],
[
120,
122
],
[
118,
123
],
[
123,
124
],
[
123,
125
],
[
125,
126
],
[
125,
127
],
[
118,
128
],
[
128,
129
],
[
129,
130
],
[
118,
131
],
[
132,
132
],
[
132,
133
],
[
133,
134
],
[
134,
135
],
[
135,
136
],
[
135,
137
],
[
133,
138
],
[
138,
139
],
[
138,
140
],
[
140,
141
],
[
140,
142
],
[
8,
143
],
[
143,
144
],
[
144,
145
],
[
145,
146
],
[
145,
147
],
[
6,
148
],
[
148,
149
],
[
0,
150
],
[
150,
151
],
[
150,
152
]
] | [
"import java.util.Scanner;\n\n\npublic class Main{\n\n\tpublic static void main(String[] args) {\n\t\tScanner scan = new Scanner(System.in);\n\t\tint c = scan.nextInt();\n\t\tint r = scan.nextInt();\n\t\tint[] s = new int[r + 1];\n\t\tfor(int i = 0; i < c; i++){\n\t\t\tint sum = 0;\n\t\t\tint a = scan.nextInt();\n\t\t\tSystem.out.print(a);\n\t\t\tsum += a;\n\t\t\ts[0] += a;\n\t\t\tfor(int j = 1; j < r; j++){\n\t\t\t\ta = scan.nextInt();\n\t\t\t\tSystem.out.print(\" \" + a);\n\t\t\t\tsum += a;\n\t\t\t\ts[j] += a;\n\t\t\t}System.out.println(\" \" + sum);\n\t\t\ts[r] += sum;\n\t\t}\n\t\tSystem.out.print(s[0]);\n\t\tfor(int i = 1; i < r + 1; i++){\n\t\t\tSystem.out.print(\" \" + s[i]);\n\t\t}System.out.println();\n\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 scan = new Scanner(System.in);\n\t\tint c = scan.nextInt();\n\t\tint r = scan.nextInt();\n\t\tint[] s = new int[r + 1];\n\t\tfor(int i = 0; i < c; i++){\n\t\t\tint sum = 0;\n\t\t\tint a = scan.nextInt();\n\t\t\tSystem.out.print(a);\n\t\t\tsum += a;\n\t\t\ts[0] += a;\n\t\t\tfor(int j = 1; j < r; j++){\n\t\t\t\ta = scan.nextInt();\n\t\t\t\tSystem.out.print(\" \" + a);\n\t\t\t\tsum += a;\n\t\t\t\ts[j] += a;\n\t\t\t}System.out.println(\" \" + sum);\n\t\t\ts[r] += sum;\n\t\t}\n\t\tSystem.out.print(s[0]);\n\t\tfor(int i = 1; i < r + 1; i++){\n\t\t\tSystem.out.print(\" \" + s[i]);\n\t\t}System.out.println();\n\n\t}\n\n}",
"Main",
"public static void main(String[] args) {\n\t\tScanner scan = new Scanner(System.in);\n\t\tint c = scan.nextInt();\n\t\tint r = scan.nextInt();\n\t\tint[] s = new int[r + 1];\n\t\tfor(int i = 0; i < c; i++){\n\t\t\tint sum = 0;\n\t\t\tint a = scan.nextInt();\n\t\t\tSystem.out.print(a);\n\t\t\tsum += a;\n\t\t\ts[0] += a;\n\t\t\tfor(int j = 1; j < r; j++){\n\t\t\t\ta = scan.nextInt();\n\t\t\t\tSystem.out.print(\" \" + a);\n\t\t\t\tsum += a;\n\t\t\t\ts[j] += a;\n\t\t\t}System.out.println(\" \" + sum);\n\t\t\ts[r] += sum;\n\t\t}\n\t\tSystem.out.print(s[0]);\n\t\tfor(int i = 1; i < r + 1; i++){\n\t\t\tSystem.out.print(\" \" + s[i]);\n\t\t}System.out.println();\n\n\t}",
"main",
"{\n\t\tScanner scan = new Scanner(System.in);\n\t\tint c = scan.nextInt();\n\t\tint r = scan.nextInt();\n\t\tint[] s = new int[r + 1];\n\t\tfor(int i = 0; i < c; i++){\n\t\t\tint sum = 0;\n\t\t\tint a = scan.nextInt();\n\t\t\tSystem.out.print(a);\n\t\t\tsum += a;\n\t\t\ts[0] += a;\n\t\t\tfor(int j = 1; j < r; j++){\n\t\t\t\ta = scan.nextInt();\n\t\t\t\tSystem.out.print(\" \" + a);\n\t\t\t\tsum += a;\n\t\t\t\ts[j] += a;\n\t\t\t}System.out.println(\" \" + sum);\n\t\t\ts[r] += sum;\n\t\t}\n\t\tSystem.out.print(s[0]);\n\t\tfor(int i = 1; i < r + 1; i++){\n\t\t\tSystem.out.print(\" \" + s[i]);\n\t\t}System.out.println();\n\n\t}",
"Scanner scan = new Scanner(System.in);",
"scan",
"new Scanner(System.in)",
"int c = scan.nextInt();",
"c",
"scan.nextInt()",
"scan.nextInt",
"scan",
"int r = scan.nextInt();",
"r",
"scan.nextInt()",
"scan.nextInt",
"scan",
"int[] s = new int[r + 1];",
"s",
"new int[r + 1]",
"r + 1",
"r",
"1",
"for(int i = 0; i < c; i++){\n\t\t\tint sum = 0;\n\t\t\tint a = scan.nextInt();\n\t\t\tSystem.out.print(a);\n\t\t\tsum += a;\n\t\t\ts[0] += a;\n\t\t\tfor(int j = 1; j < r; j++){\n\t\t\t\ta = scan.nextInt();\n\t\t\t\tSystem.out.print(\" \" + a);\n\t\t\t\tsum += a;\n\t\t\t\ts[j] += a;\n\t\t\t}System.out.println(\" \" + sum);\n\t\t\ts[r] += sum;\n\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < c",
"i",
"c",
"i++",
"i++",
"i",
"{\n\t\t\tint sum = 0;\n\t\t\tint a = scan.nextInt();\n\t\t\tSystem.out.print(a);\n\t\t\tsum += a;\n\t\t\ts[0] += a;\n\t\t\tfor(int j = 1; j < r; j++){\n\t\t\t\ta = scan.nextInt();\n\t\t\t\tSystem.out.print(\" \" + a);\n\t\t\t\tsum += a;\n\t\t\t\ts[j] += a;\n\t\t\t}System.out.println(\" \" + sum);\n\t\t\ts[r] += sum;\n\t\t}",
"{\n\t\t\tint sum = 0;\n\t\t\tint a = scan.nextInt();\n\t\t\tSystem.out.print(a);\n\t\t\tsum += a;\n\t\t\ts[0] += a;\n\t\t\tfor(int j = 1; j < r; j++){\n\t\t\t\ta = scan.nextInt();\n\t\t\t\tSystem.out.print(\" \" + a);\n\t\t\t\tsum += a;\n\t\t\t\ts[j] += a;\n\t\t\t}System.out.println(\" \" + sum);\n\t\t\ts[r] += sum;\n\t\t}",
"int sum = 0;",
"sum",
"0",
"int a = scan.nextInt();",
"a",
"scan.nextInt()",
"scan.nextInt",
"scan",
"System.out.print(a)",
"System.out.print",
"System.out",
"System",
"System.out",
"a",
"sum += a",
"sum",
"a",
"s[0] += a",
"s[0]",
"s",
"0",
"a",
"for(int j = 1; j < r; j++){\n\t\t\t\ta = scan.nextInt();\n\t\t\t\tSystem.out.print(\" \" + a);\n\t\t\t\tsum += a;\n\t\t\t\ts[j] += a;\n\t\t\t}",
"int j = 1;",
"int j = 1;",
"j",
"1",
"j < r",
"j",
"r",
"j++",
"j++",
"j",
"{\n\t\t\t\ta = scan.nextInt();\n\t\t\t\tSystem.out.print(\" \" + a);\n\t\t\t\tsum += a;\n\t\t\t\ts[j] += a;\n\t\t\t}",
"{\n\t\t\t\ta = scan.nextInt();\n\t\t\t\tSystem.out.print(\" \" + a);\n\t\t\t\tsum += a;\n\t\t\t\ts[j] += a;\n\t\t\t}",
"a = scan.nextInt()",
"a",
"scan.nextInt()",
"scan.nextInt",
"scan",
"System.out.print(\" \" + a)",
"System.out.print",
"System.out",
"System",
"System.out",
"\" \" + a",
"\" \"",
"a",
"sum += a",
"sum",
"a",
"s[j] += a",
"s[j]",
"s",
"j",
"a",
"System.out.println(\" \" + sum)",
"System.out.println",
"System.out",
"System",
"System.out",
"\" \" + sum",
"\" \"",
"sum",
"s[r] += sum",
"s[r]",
"s",
"r",
"sum",
"System.out.print(s[0])",
"System.out.print",
"System.out",
"System",
"System.out",
"s[0]",
"s",
"0",
"for(int i = 1; i < r + 1; i++){\n\t\t\tSystem.out.print(\" \" + s[i]);\n\t\t}",
"int i = 1;",
"int i = 1;",
"i",
"1",
"i < r + 1",
"i",
"r + 1",
"r",
"1",
"i++",
"i++",
"i",
"{\n\t\t\tSystem.out.print(\" \" + s[i]);\n\t\t}",
"{\n\t\t\tSystem.out.print(\" \" + s[i]);\n\t\t}",
"System.out.print(\" \" + s[i])",
"System.out.print",
"System.out",
"System",
"System.out",
"\" \" + s[i]",
"\" \"",
"s[i]",
"s",
"i",
"System.out.println()",
"System.out.println",
"System.out",
"System",
"System.out",
"String[] args",
"args",
"public class Main{\n\n\tpublic static void main(String[] args) {\n\t\tScanner scan = new Scanner(System.in);\n\t\tint c = scan.nextInt();\n\t\tint r = scan.nextInt();\n\t\tint[] s = new int[r + 1];\n\t\tfor(int i = 0; i < c; i++){\n\t\t\tint sum = 0;\n\t\t\tint a = scan.nextInt();\n\t\t\tSystem.out.print(a);\n\t\t\tsum += a;\n\t\t\ts[0] += a;\n\t\t\tfor(int j = 1; j < r; j++){\n\t\t\t\ta = scan.nextInt();\n\t\t\t\tSystem.out.print(\" \" + a);\n\t\t\t\tsum += a;\n\t\t\t\ts[j] += a;\n\t\t\t}System.out.println(\" \" + sum);\n\t\t\ts[r] += sum;\n\t\t}\n\t\tSystem.out.print(s[0]);\n\t\tfor(int i = 1; i < r + 1; i++){\n\t\t\tSystem.out.print(\" \" + s[i]);\n\t\t}System.out.println();\n\n\t}\n\n}",
"public class Main{\n\n\tpublic static void main(String[] args) {\n\t\tScanner scan = new Scanner(System.in);\n\t\tint c = scan.nextInt();\n\t\tint r = scan.nextInt();\n\t\tint[] s = new int[r + 1];\n\t\tfor(int i = 0; i < c; i++){\n\t\t\tint sum = 0;\n\t\t\tint a = scan.nextInt();\n\t\t\tSystem.out.print(a);\n\t\t\tsum += a;\n\t\t\ts[0] += a;\n\t\t\tfor(int j = 1; j < r; j++){\n\t\t\t\ta = scan.nextInt();\n\t\t\t\tSystem.out.print(\" \" + a);\n\t\t\t\tsum += a;\n\t\t\t\ts[j] += a;\n\t\t\t}System.out.println(\" \" + sum);\n\t\t\ts[r] += sum;\n\t\t}\n\t\tSystem.out.print(s[0]);\n\t\tfor(int i = 1; i < r + 1; i++){\n\t\t\tSystem.out.print(\" \" + s[i]);\n\t\t}System.out.println();\n\n\t}\n\n}",
"Main"
] | import java.util.Scanner;
public class Main{
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
int c = scan.nextInt();
int r = scan.nextInt();
int[] s = new int[r + 1];
for(int i = 0; i < c; i++){
int sum = 0;
int a = scan.nextInt();
System.out.print(a);
sum += a;
s[0] += a;
for(int j = 1; j < r; j++){
a = scan.nextInt();
System.out.print(" " + a);
sum += a;
s[j] += a;
}System.out.println(" " + sum);
s[r] += sum;
}
System.out.print(s[0]);
for(int i = 1; i < r + 1; i++){
System.out.print(" " + s[i]);
}System.out.println();
}
} |
[
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,
17,
41,
13,
4,
18,
13,
18,
13,
17,
41,
13,
4,
18,
13,
18,
13,
17,
41,
13,
20,
2,
13,
17,
2,
13,
17,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
4,
18,
13,
41,
13,
4,
18,
13,
17,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
41,
13,
4,
18,
13,
18,
13,
13,
0,
13,
13,
0,
18,
18,
13,
13,
13,
13,
14,
2,
13,
17,
30,
0,
18,
18,
13,
13,
13,
13,
30,
41,
13,
18,
18,
13,
13,
13,
0,
13,
13,
0,
18,
18,
13,
13,
13,
13,
0,
18,
18,
13,
13,
13,
13,
0,
13,
13,
4,
18,
13,
0,
18,
18,
13,
13,
13,
13,
11,
1,
41,
13,
17,
2,
13,
2,
13,
17,
1,
40,
13,
30,
30,
41,
13,
20,
11,
1,
41,
13,
17,
2,
13,
2,
13,
17,
1,
40,
13,
30,
30,
41,
13,
4,
18,
13,
18,
18,
13,
13,
13,
4,
18,
13,
13,
14,
2,
13,
13,
30,
4,
18,
13,
17,
4,
18,
18,
13,
13,
20,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
227,
8
],
[
227,
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
],
[
28,
29
],
[
29,
30
],
[
28,
31
],
[
31,
32
],
[
31,
33
],
[
11,
34
],
[
34,
35
],
[
34,
36
],
[
36,
37
],
[
37,
38
],
[
36,
39
],
[
39,
40
],
[
39,
41
],
[
11,
42
],
[
42,
43
],
[
42,
44
],
[
45,
46
],
[
45,
47
],
[
48,
49
],
[
48,
50
],
[
11,
51
],
[
51,
52
],
[
51,
53
],
[
11,
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
],
[
67,
69
],
[
69,
70
],
[
70,
71
],
[
66,
72
],
[
72,
73
],
[
72,
74
],
[
74,
75
],
[
75,
76
],
[
74,
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
],
[
93,
93
],
[
93,
94
],
[
94,
95
],
[
94,
96
],
[
96,
97
],
[
97,
98
],
[
96,
99
],
[
99,
100
],
[
99,
101
],
[
93,
102
],
[
102,
103
],
[
102,
104
],
[
93,
105
],
[
105,
106
],
[
106,
107
],
[
107,
108
],
[
107,
109
],
[
106,
110
],
[
105,
111
],
[
93,
112
],
[
112,
113
],
[
113,
114
],
[
113,
115
],
[
112,
116
],
[
116,
117
],
[
117,
118
],
[
118,
119
],
[
119,
120
],
[
119,
121
],
[
118,
122
],
[
117,
123
],
[
112,
124
],
[
124,
125
],
[
125,
126
],
[
125,
127
],
[
127,
128
],
[
128,
129
],
[
128,
130
],
[
127,
131
],
[
124,
132
],
[
132,
133
],
[
132,
134
],
[
124,
135
],
[
135,
136
],
[
136,
137
],
[
137,
138
],
[
137,
139
],
[
136,
140
],
[
135,
141
],
[
66,
142
],
[
142,
143
],
[
143,
144
],
[
144,
145
],
[
144,
146
],
[
143,
147
],
[
142,
148
],
[
66,
149
],
[
149,
150
],
[
149,
151
],
[
11,
152
],
[
152,
153
],
[
153,
154
],
[
11,
155
],
[
155,
156
],
[
156,
157
],
[
157,
158
],
[
157,
159
],
[
156,
160
],
[
155,
161
],
[
11,
162
],
[
162,
163
],
[
163,
164
],
[
164,
165
],
[
164,
166
],
[
162,
167
],
[
167,
168
],
[
167,
169
],
[
169,
170
],
[
169,
171
],
[
162,
172
],
[
172,
173
],
[
173,
174
],
[
162,
175
],
[
176,
176
],
[
176,
177
],
[
177,
178
],
[
177,
179
],
[
176,
180
],
[
180,
181
],
[
181,
182
],
[
182,
183
],
[
182,
184
],
[
180,
185
],
[
185,
186
],
[
185,
187
],
[
187,
188
],
[
187,
189
],
[
180,
190
],
[
190,
191
],
[
191,
192
],
[
180,
193
],
[
194,
194
],
[
194,
195
],
[
195,
196
],
[
195,
197
],
[
197,
198
],
[
198,
199
],
[
197,
200
],
[
200,
201
],
[
201,
202
],
[
201,
203
],
[
200,
204
],
[
194,
205
],
[
205,
206
],
[
206,
207
],
[
205,
208
],
[
194,
209
],
[
209,
210
],
[
210,
211
],
[
210,
212
],
[
209,
213
],
[
213,
214
],
[
214,
215
],
[
215,
216
],
[
214,
217
],
[
176,
218
],
[
218,
219
],
[
219,
220
],
[
220,
221
],
[
220,
222
],
[
218,
223
],
[
9,
224
],
[
224,
225
],
[
0,
226
],
[
226,
227
],
[
226,
228
]
] | [
"import java.util.*;\nimport java.io.*;\n \npublic class Main{\n public static void main(String[] args)throws IOException{\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n \nString str = br.readLine();\n String[] strs = str.split(\"\\\\s\");\n int r = Integer.parseInt(strs[0]);\n int c = Integer.parseInt(strs[1]);\n int[][] graph = new int[r+1][c+1];\n int lastnum = 0;\n \n for(int i = 0;i<r;i++){\n str = br.readLine();\n String[] temp = str.split(\"\\\\s\");\n int total =0;\n \n for(int j =0;j<c;j++){\n int tempnum = Integer.parseInt(temp[j]);\n total += tempnum;\n graph[i][j] = tempnum;\n \n if(i == 0){\n graph[r][j]= tempnum;\n }else{\n int tempnum2 = graph[r][j];\n tempnum2 += tempnum;\n graph[r][j]=tempnum2;\n }\n }\n graph[i][c] = total;\n lastnum += total;\n }\n br.close();\n graph[r][c] = lastnum;\n \n for(int i =0;i<r+1;i++){\n StringBuilder sb = new StringBuilder();\n for(int j=0;j<c+1;j++){\n String ts = String.valueOf(graph[i][j]);\n sb.append(ts);\n \n if(j != c){\n sb.append(\" \");\n }\n }\n System.out.println(new String(sb));\n \n }\n \n \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 br = new BufferedReader(new InputStreamReader(System.in));\n \nString str = br.readLine();\n String[] strs = str.split(\"\\\\s\");\n int r = Integer.parseInt(strs[0]);\n int c = Integer.parseInt(strs[1]);\n int[][] graph = new int[r+1][c+1];\n int lastnum = 0;\n \n for(int i = 0;i<r;i++){\n str = br.readLine();\n String[] temp = str.split(\"\\\\s\");\n int total =0;\n \n for(int j =0;j<c;j++){\n int tempnum = Integer.parseInt(temp[j]);\n total += tempnum;\n graph[i][j] = tempnum;\n \n if(i == 0){\n graph[r][j]= tempnum;\n }else{\n int tempnum2 = graph[r][j];\n tempnum2 += tempnum;\n graph[r][j]=tempnum2;\n }\n }\n graph[i][c] = total;\n lastnum += total;\n }\n br.close();\n graph[r][c] = lastnum;\n \n for(int i =0;i<r+1;i++){\n StringBuilder sb = new StringBuilder();\n for(int j=0;j<c+1;j++){\n String ts = String.valueOf(graph[i][j]);\n sb.append(ts);\n \n if(j != c){\n sb.append(\" \");\n }\n }\n System.out.println(new String(sb));\n \n }\n \n \n}\n}",
"Main",
"public static void main(String[] args)throws IOException{\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n \nString str = br.readLine();\n String[] strs = str.split(\"\\\\s\");\n int r = Integer.parseInt(strs[0]);\n int c = Integer.parseInt(strs[1]);\n int[][] graph = new int[r+1][c+1];\n int lastnum = 0;\n \n for(int i = 0;i<r;i++){\n str = br.readLine();\n String[] temp = str.split(\"\\\\s\");\n int total =0;\n \n for(int j =0;j<c;j++){\n int tempnum = Integer.parseInt(temp[j]);\n total += tempnum;\n graph[i][j] = tempnum;\n \n if(i == 0){\n graph[r][j]= tempnum;\n }else{\n int tempnum2 = graph[r][j];\n tempnum2 += tempnum;\n graph[r][j]=tempnum2;\n }\n }\n graph[i][c] = total;\n lastnum += total;\n }\n br.close();\n graph[r][c] = lastnum;\n \n for(int i =0;i<r+1;i++){\n StringBuilder sb = new StringBuilder();\n for(int j=0;j<c+1;j++){\n String ts = String.valueOf(graph[i][j]);\n sb.append(ts);\n \n if(j != c){\n sb.append(\" \");\n }\n }\n System.out.println(new String(sb));\n \n }\n \n \n}",
"main",
"{\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n \nString str = br.readLine();\n String[] strs = str.split(\"\\\\s\");\n int r = Integer.parseInt(strs[0]);\n int c = Integer.parseInt(strs[1]);\n int[][] graph = new int[r+1][c+1];\n int lastnum = 0;\n \n for(int i = 0;i<r;i++){\n str = br.readLine();\n String[] temp = str.split(\"\\\\s\");\n int total =0;\n \n for(int j =0;j<c;j++){\n int tempnum = Integer.parseInt(temp[j]);\n total += tempnum;\n graph[i][j] = tempnum;\n \n if(i == 0){\n graph[r][j]= tempnum;\n }else{\n int tempnum2 = graph[r][j];\n tempnum2 += tempnum;\n graph[r][j]=tempnum2;\n }\n }\n graph[i][c] = total;\n lastnum += total;\n }\n br.close();\n graph[r][c] = lastnum;\n \n for(int i =0;i<r+1;i++){\n StringBuilder sb = new StringBuilder();\n for(int j=0;j<c+1;j++){\n String ts = String.valueOf(graph[i][j]);\n sb.append(ts);\n \n if(j != c){\n sb.append(\" \");\n }\n }\n System.out.println(new String(sb));\n \n }\n \n \n}",
"BufferedReader br = new BufferedReader(new InputStreamReader(System.in));",
"br",
"new BufferedReader(new InputStreamReader(System.in))",
"String str = br.readLine();",
"str",
"br.readLine()",
"br.readLine",
"br",
"String[] strs = str.split(\"\\\\s\");",
"strs",
"str.split(\"\\\\s\")",
"str.split",
"str",
"\"\\\\s\"",
"int r = Integer.parseInt(strs[0]);",
"r",
"Integer.parseInt(strs[0])",
"Integer.parseInt",
"Integer",
"strs[0]",
"strs",
"0",
"int c = Integer.parseInt(strs[1]);",
"c",
"Integer.parseInt(strs[1])",
"Integer.parseInt",
"Integer",
"strs[1]",
"strs",
"1",
"int[][] graph = new int[r+1][c+1];",
"graph",
"new int[r+1][c+1]",
"r+1",
"r",
"1",
"c+1",
"c",
"1",
"int lastnum = 0;",
"lastnum",
"0",
"for(int i = 0;i<r;i++){\n str = br.readLine();\n String[] temp = str.split(\"\\\\s\");\n int total =0;\n \n for(int j =0;j<c;j++){\n int tempnum = Integer.parseInt(temp[j]);\n total += tempnum;\n graph[i][j] = tempnum;\n \n if(i == 0){\n graph[r][j]= tempnum;\n }else{\n int tempnum2 = graph[r][j];\n tempnum2 += tempnum;\n graph[r][j]=tempnum2;\n }\n }\n graph[i][c] = total;\n lastnum += total;\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i<r",
"i",
"r",
"i++",
"i++",
"i",
"{\n str = br.readLine();\n String[] temp = str.split(\"\\\\s\");\n int total =0;\n \n for(int j =0;j<c;j++){\n int tempnum = Integer.parseInt(temp[j]);\n total += tempnum;\n graph[i][j] = tempnum;\n \n if(i == 0){\n graph[r][j]= tempnum;\n }else{\n int tempnum2 = graph[r][j];\n tempnum2 += tempnum;\n graph[r][j]=tempnum2;\n }\n }\n graph[i][c] = total;\n lastnum += total;\n }",
"{\n str = br.readLine();\n String[] temp = str.split(\"\\\\s\");\n int total =0;\n \n for(int j =0;j<c;j++){\n int tempnum = Integer.parseInt(temp[j]);\n total += tempnum;\n graph[i][j] = tempnum;\n \n if(i == 0){\n graph[r][j]= tempnum;\n }else{\n int tempnum2 = graph[r][j];\n tempnum2 += tempnum;\n graph[r][j]=tempnum2;\n }\n }\n graph[i][c] = total;\n lastnum += total;\n }",
"str = br.readLine()",
"str",
"br.readLine()",
"br.readLine",
"br",
"String[] temp = str.split(\"\\\\s\");",
"temp",
"str.split(\"\\\\s\")",
"str.split",
"str",
"\"\\\\s\"",
"int total =0;",
"total",
"0",
"for(int j =0;j<c;j++){\n int tempnum = Integer.parseInt(temp[j]);\n total += tempnum;\n graph[i][j] = tempnum;\n \n if(i == 0){\n graph[r][j]= tempnum;\n }else{\n int tempnum2 = graph[r][j];\n tempnum2 += tempnum;\n graph[r][j]=tempnum2;\n }\n }",
"int j =0;",
"int j =0;",
"j",
"0",
"j<c",
"j",
"c",
"j++",
"j++",
"j",
"{\n int tempnum = Integer.parseInt(temp[j]);\n total += tempnum;\n graph[i][j] = tempnum;\n \n if(i == 0){\n graph[r][j]= tempnum;\n }else{\n int tempnum2 = graph[r][j];\n tempnum2 += tempnum;\n graph[r][j]=tempnum2;\n }\n }",
"{\n int tempnum = Integer.parseInt(temp[j]);\n total += tempnum;\n graph[i][j] = tempnum;\n \n if(i == 0){\n graph[r][j]= tempnum;\n }else{\n int tempnum2 = graph[r][j];\n tempnum2 += tempnum;\n graph[r][j]=tempnum2;\n }\n }",
"int tempnum = Integer.parseInt(temp[j]);",
"tempnum",
"Integer.parseInt(temp[j])",
"Integer.parseInt",
"Integer",
"temp[j]",
"temp",
"j",
"total += tempnum",
"total",
"tempnum",
"graph[i][j] = tempnum",
"graph[i][j]",
"graph[i]",
"graph",
"i",
"j",
"tempnum",
"if(i == 0){\n graph[r][j]= tempnum;\n }else{\n int tempnum2 = graph[r][j];\n tempnum2 += tempnum;\n graph[r][j]=tempnum2;\n }",
"i == 0",
"i",
"0",
"{\n graph[r][j]= tempnum;\n }",
"graph[r][j]= tempnum",
"graph[r][j]",
"graph[r]",
"graph",
"r",
"j",
"tempnum",
"{\n int tempnum2 = graph[r][j];\n tempnum2 += tempnum;\n graph[r][j]=tempnum2;\n }",
"int tempnum2 = graph[r][j];",
"tempnum2",
"graph[r][j]",
"graph[r]",
"graph",
"r",
"j",
"tempnum2 += tempnum",
"tempnum2",
"tempnum",
"graph[r][j]=tempnum2",
"graph[r][j]",
"graph[r]",
"graph",
"r",
"j",
"tempnum2",
"graph[i][c] = total",
"graph[i][c]",
"graph[i]",
"graph",
"i",
"c",
"total",
"lastnum += total",
"lastnum",
"total",
"br.close()",
"br.close",
"br",
"graph[r][c] = lastnum",
"graph[r][c]",
"graph[r]",
"graph",
"r",
"c",
"lastnum",
"for(int i =0;i<r+1;i++){\n StringBuilder sb = new StringBuilder();\n for(int j=0;j<c+1;j++){\n String ts = String.valueOf(graph[i][j]);\n sb.append(ts);\n \n if(j != c){\n sb.append(\" \");\n }\n }\n System.out.println(new String(sb));\n \n }",
"int i =0;",
"int i =0;",
"i",
"0",
"i<r+1",
"i",
"r+1",
"r",
"1",
"i++",
"i++",
"i",
"{\n StringBuilder sb = new StringBuilder();\n for(int j=0;j<c+1;j++){\n String ts = String.valueOf(graph[i][j]);\n sb.append(ts);\n \n if(j != c){\n sb.append(\" \");\n }\n }\n System.out.println(new String(sb));\n \n }",
"{\n StringBuilder sb = new StringBuilder();\n for(int j=0;j<c+1;j++){\n String ts = String.valueOf(graph[i][j]);\n sb.append(ts);\n \n if(j != c){\n sb.append(\" \");\n }\n }\n System.out.println(new String(sb));\n \n }",
"StringBuilder sb = new StringBuilder();",
"sb",
"new StringBuilder()",
"for(int j=0;j<c+1;j++){\n String ts = String.valueOf(graph[i][j]);\n sb.append(ts);\n \n if(j != c){\n sb.append(\" \");\n }\n }",
"int j=0;",
"int j=0;",
"j",
"0",
"j<c+1",
"j",
"c+1",
"c",
"1",
"j++",
"j++",
"j",
"{\n String ts = String.valueOf(graph[i][j]);\n sb.append(ts);\n \n if(j != c){\n sb.append(\" \");\n }\n }",
"{\n String ts = String.valueOf(graph[i][j]);\n sb.append(ts);\n \n if(j != c){\n sb.append(\" \");\n }\n }",
"String ts = String.valueOf(graph[i][j]);",
"ts",
"String.valueOf(graph[i][j])",
"String.valueOf",
"String",
"graph[i][j]",
"graph[i]",
"graph",
"i",
"j",
"sb.append(ts)",
"sb.append",
"sb",
"ts",
"if(j != c){\n sb.append(\" \");\n }",
"j != c",
"j",
"c",
"{\n sb.append(\" \");\n }",
"sb.append(\" \")",
"sb.append",
"sb",
"\" \"",
"System.out.println(new String(sb))",
"System.out.println",
"System.out",
"System",
"System.out",
"new String(sb)",
"String[] args",
"args",
"public class Main{\n public static void main(String[] args)throws IOException{\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n \nString str = br.readLine();\n String[] strs = str.split(\"\\\\s\");\n int r = Integer.parseInt(strs[0]);\n int c = Integer.parseInt(strs[1]);\n int[][] graph = new int[r+1][c+1];\n int lastnum = 0;\n \n for(int i = 0;i<r;i++){\n str = br.readLine();\n String[] temp = str.split(\"\\\\s\");\n int total =0;\n \n for(int j =0;j<c;j++){\n int tempnum = Integer.parseInt(temp[j]);\n total += tempnum;\n graph[i][j] = tempnum;\n \n if(i == 0){\n graph[r][j]= tempnum;\n }else{\n int tempnum2 = graph[r][j];\n tempnum2 += tempnum;\n graph[r][j]=tempnum2;\n }\n }\n graph[i][c] = total;\n lastnum += total;\n }\n br.close();\n graph[r][c] = lastnum;\n \n for(int i =0;i<r+1;i++){\n StringBuilder sb = new StringBuilder();\n for(int j=0;j<c+1;j++){\n String ts = String.valueOf(graph[i][j]);\n sb.append(ts);\n \n if(j != c){\n sb.append(\" \");\n }\n }\n System.out.println(new String(sb));\n \n }\n \n \n}\n}",
"public class Main{\n public static void main(String[] args)throws IOException{\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n \nString str = br.readLine();\n String[] strs = str.split(\"\\\\s\");\n int r = Integer.parseInt(strs[0]);\n int c = Integer.parseInt(strs[1]);\n int[][] graph = new int[r+1][c+1];\n int lastnum = 0;\n \n for(int i = 0;i<r;i++){\n str = br.readLine();\n String[] temp = str.split(\"\\\\s\");\n int total =0;\n \n for(int j =0;j<c;j++){\n int tempnum = Integer.parseInt(temp[j]);\n total += tempnum;\n graph[i][j] = tempnum;\n \n if(i == 0){\n graph[r][j]= tempnum;\n }else{\n int tempnum2 = graph[r][j];\n tempnum2 += tempnum;\n graph[r][j]=tempnum2;\n }\n }\n graph[i][c] = total;\n lastnum += total;\n }\n br.close();\n graph[r][c] = lastnum;\n \n for(int i =0;i<r+1;i++){\n StringBuilder sb = new StringBuilder();\n for(int j=0;j<c+1;j++){\n String ts = String.valueOf(graph[i][j]);\n sb.append(ts);\n \n if(j != c){\n sb.append(\" \");\n }\n }\n System.out.println(new String(sb));\n \n }\n \n \n}\n}",
"Main"
] | import java.util.*;
import java.io.*;
public class Main{
public static void main(String[] args)throws IOException{
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
String str = br.readLine();
String[] strs = str.split("\\s");
int r = Integer.parseInt(strs[0]);
int c = Integer.parseInt(strs[1]);
int[][] graph = new int[r+1][c+1];
int lastnum = 0;
for(int i = 0;i<r;i++){
str = br.readLine();
String[] temp = str.split("\\s");
int total =0;
for(int j =0;j<c;j++){
int tempnum = Integer.parseInt(temp[j]);
total += tempnum;
graph[i][j] = tempnum;
if(i == 0){
graph[r][j]= tempnum;
}else{
int tempnum2 = graph[r][j];
tempnum2 += tempnum;
graph[r][j]=tempnum2;
}
}
graph[i][c] = total;
lastnum += total;
}
br.close();
graph[r][c] = lastnum;
for(int i =0;i<r+1;i++){
StringBuilder sb = new StringBuilder();
for(int j=0;j<c+1;j++){
String ts = String.valueOf(graph[i][j]);
sb.append(ts);
if(j != c){
sb.append(" ");
}
}
System.out.println(new String(sb));
}
}
} |
[
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,
4,
18,
13,
4,
18,
13,
41,
13,
20,
13,
13,
11,
1,
41,
13,
17,
2,
13,
18,
13,
13,
1,
40,
13,
30,
30,
11,
1,
41,
13,
17,
2,
13,
18,
18,
13,
13,
13,
1,
40,
13,
30,
30,
0,
18,
18,
13,
13,
13,
4,
18,
13,
4,
18,
13,
41,
13,
20,
2,
13,
17,
2,
13,
17,
11,
1,
41,
13,
17,
2,
13,
2,
18,
13,
13,
17,
1,
40,
13,
30,
30,
11,
1,
41,
13,
17,
2,
13,
2,
18,
18,
13,
13,
13,
17,
1,
40,
13,
30,
30,
0,
18,
18,
13,
13,
13,
18,
18,
13,
13,
13,
11,
1,
41,
13,
17,
2,
13,
2,
18,
13,
13,
17,
1,
40,
13,
30,
30,
11,
1,
41,
13,
17,
2,
13,
2,
18,
18,
13,
13,
13,
17,
1,
40,
13,
30,
30,
0,
18,
18,
13,
13,
13,
18,
18,
13,
13,
13,
11,
1,
41,
13,
17,
2,
13,
2,
13,
17,
1,
40,
13,
30,
30,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
18,
18,
13,
13,
13,
18,
18,
13,
13,
13,
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,
14,
2,
13,
13,
30,
4,
18,
18,
13,
13,
2,
18,
18,
13,
13,
13,
17,
30,
4,
18,
18,
13,
13,
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
],
[
0,
10
],
[
10,
11
],
[
10,
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
],
[
28,
29
],
[
29,
30
],
[
28,
31
],
[
31,
32
],
[
32,
33
],
[
14,
34
],
[
34,
35
],
[
34,
36
],
[
14,
39
],
[
39,
40
],
[
40,
41
],
[
41,
42
],
[
41,
43
],
[
39,
44
],
[
44,
45
],
[
44,
46
],
[
46,
47
],
[
46,
48
],
[
39,
49
],
[
49,
50
],
[
50,
51
],
[
39,
52
],
[
53,
53
],
[
53,
54
],
[
54,
55
],
[
55,
56
],
[
56,
57
],
[
56,
58
],
[
54,
59
],
[
59,
60
],
[
59,
61
],
[
61,
62
],
[
62,
63
],
[
62,
64
],
[
61,
65
],
[
54,
66
],
[
66,
67
],
[
67,
68
],
[
54,
69
],
[
70,
70
],
[
70,
71
],
[
71,
72
],
[
72,
73
],
[
73,
74
],
[
73,
75
],
[
72,
76
],
[
71,
77
],
[
77,
78
],
[
78,
79
],
[
77,
80
],
[
80,
81
],
[
81,
82
],
[
14,
83
],
[
83,
84
],
[
83,
85
],
[
86,
87
],
[
86,
88
],
[
89,
90
],
[
89,
91
],
[
14,
92
],
[
92,
93
],
[
93,
94
],
[
94,
95
],
[
94,
96
],
[
92,
97
],
[
97,
98
],
[
97,
99
],
[
99,
100
],
[
100,
101
],
[
100,
102
],
[
99,
103
],
[
92,
104
],
[
104,
105
],
[
105,
106
],
[
92,
107
],
[
108,
108
],
[
108,
109
],
[
109,
110
],
[
110,
111
],
[
111,
112
],
[
111,
113
],
[
109,
114
],
[
114,
115
],
[
114,
116
],
[
116,
117
],
[
117,
118
],
[
118,
119
],
[
118,
120
],
[
117,
121
],
[
116,
122
],
[
109,
123
],
[
123,
124
],
[
124,
125
],
[
109,
126
],
[
127,
127
],
[
127,
128
],
[
128,
129
],
[
129,
130
],
[
130,
131
],
[
130,
132
],
[
129,
133
],
[
128,
134
],
[
134,
135
],
[
135,
136
],
[
135,
137
],
[
134,
138
],
[
14,
139
],
[
139,
140
],
[
140,
141
],
[
141,
142
],
[
141,
143
],
[
139,
144
],
[
144,
145
],
[
144,
146
],
[
146,
147
],
[
147,
148
],
[
147,
149
],
[
146,
150
],
[
139,
151
],
[
151,
152
],
[
152,
153
],
[
139,
154
],
[
155,
155
],
[
155,
156
],
[
156,
157
],
[
157,
158
],
[
158,
159
],
[
158,
160
],
[
156,
161
],
[
161,
162
],
[
161,
163
],
[
163,
164
],
[
164,
165
],
[
165,
166
],
[
165,
167
],
[
164,
168
],
[
163,
169
],
[
156,
170
],
[
170,
171
],
[
171,
172
],
[
156,
173
],
[
174,
174
],
[
174,
175
],
[
175,
176
],
[
176,
177
],
[
177,
178
],
[
177,
179
],
[
176,
180
],
[
175,
181
],
[
181,
182
],
[
182,
183
],
[
182,
184
],
[
181,
185
],
[
14,
186
],
[
186,
187
],
[
187,
188
],
[
188,
189
],
[
188,
190
],
[
186,
191
],
[
191,
192
],
[
191,
193
],
[
193,
194
],
[
193,
195
],
[
186,
196
],
[
196,
197
],
[
197,
198
],
[
186,
199
],
[
200,
200
],
[
200,
201
],
[
201,
202
],
[
202,
203
],
[
203,
204
],
[
203,
205
],
[
201,
206
],
[
206,
207
],
[
206,
208
],
[
201,
209
],
[
209,
210
],
[
210,
211
],
[
201,
212
],
[
213,
213
],
[
213,
214
],
[
214,
215
],
[
215,
216
],
[
216,
217
],
[
216,
218
],
[
215,
219
],
[
214,
220
],
[
220,
221
],
[
221,
222
],
[
221,
223
],
[
220,
224
],
[
14,
225
],
[
225,
226
],
[
226,
227
],
[
227,
228
],
[
227,
229
],
[
225,
230
],
[
230,
231
],
[
230,
232
],
[
232,
233
],
[
232,
234
],
[
225,
235
],
[
235,
236
],
[
236,
237
],
[
225,
238
],
[
239,
239
],
[
239,
240
],
[
240,
241
],
[
241,
242
],
[
242,
243
],
[
242,
244
],
[
240,
245
],
[
245,
246
],
[
245,
247
],
[
247,
248
],
[
247,
249
],
[
240,
250
],
[
250,
251
],
[
251,
252
],
[
240,
253
],
[
254,
254
],
[
254,
255
],
[
255,
256
],
[
256,
257
],
[
256,
258
],
[
255,
259
],
[
259,
260
],
[
260,
261
],
[
261,
262
],
[
262,
263
],
[
262,
264
],
[
260,
265
],
[
265,
266
],
[
266,
267
],
[
267,
268
],
[
267,
269
],
[
266,
270
],
[
265,
271
],
[
255,
272
],
[
272,
273
],
[
273,
274
],
[
274,
275
],
[
275,
276
],
[
275,
277
],
[
273,
278
],
[
278,
279
],
[
279,
280
],
[
279,
281
],
[
278,
282
],
[
12,
283
],
[
283,
284
]
] | [
"import java.io.*;\nimport java.util.*;\nimport java.lang.*;\n\nclass Main{\n public static void main(String[] args) throws IOException{\n Scanner scan=new Scanner(System.in);\n int r=Integer.parseInt(scan.next());\n int c=Integer.parseInt(scan.next());\n int[][] array1=new int[r][c];\n for(int i=0;i<array1.length;i++){\n for(int j=0;j<array1[i].length;j++){\n array1[i][j]=Integer.parseInt(scan.next());\n }\n }\n\n int[][] array2=new int[r+1][c+1];\n for(int i=0;i<array2.length-1;i++){\n for(int j=0;j<array2[i].length-1;j++){\n array2[i][j]=array1[i][j];\n }\n }\n for(int i=0;i<array2.length-1;i++){\n for(int j=0;j<array2[i].length-1;j++){\n array2[i][c]+=array2[i][j];\n }\n }\n for(int i=0;i<c+1;i++){\n for(int j=0;j<r;j++){\n array2[r][i]+=array2[j][i];\n }\n }\n\n for(int i=0;i<r+1;i++){\n for(int j=0;j<c+1;j++){\n if(j<c){\n System.out.print(array2[i][j]+\" \");\n }else{\n System.out.println(array2[i][j]);\n }\n }\n }\n }\n}",
"import java.io.*;",
"io.*",
"java",
"import java.util.*;",
"util.*",
"java",
"import java.lang.*;",
"lang.*",
"java",
"class Main{\n public static void main(String[] args) throws IOException{\n Scanner scan=new Scanner(System.in);\n int r=Integer.parseInt(scan.next());\n int c=Integer.parseInt(scan.next());\n int[][] array1=new int[r][c];\n for(int i=0;i<array1.length;i++){\n for(int j=0;j<array1[i].length;j++){\n array1[i][j]=Integer.parseInt(scan.next());\n }\n }\n\n int[][] array2=new int[r+1][c+1];\n for(int i=0;i<array2.length-1;i++){\n for(int j=0;j<array2[i].length-1;j++){\n array2[i][j]=array1[i][j];\n }\n }\n for(int i=0;i<array2.length-1;i++){\n for(int j=0;j<array2[i].length-1;j++){\n array2[i][c]+=array2[i][j];\n }\n }\n for(int i=0;i<c+1;i++){\n for(int j=0;j<r;j++){\n array2[r][i]+=array2[j][i];\n }\n }\n\n for(int i=0;i<r+1;i++){\n for(int j=0;j<c+1;j++){\n if(j<c){\n System.out.print(array2[i][j]+\" \");\n }else{\n System.out.println(array2[i][j]);\n }\n }\n }\n }\n}",
"Main",
"public static void main(String[] args) throws IOException{\n Scanner scan=new Scanner(System.in);\n int r=Integer.parseInt(scan.next());\n int c=Integer.parseInt(scan.next());\n int[][] array1=new int[r][c];\n for(int i=0;i<array1.length;i++){\n for(int j=0;j<array1[i].length;j++){\n array1[i][j]=Integer.parseInt(scan.next());\n }\n }\n\n int[][] array2=new int[r+1][c+1];\n for(int i=0;i<array2.length-1;i++){\n for(int j=0;j<array2[i].length-1;j++){\n array2[i][j]=array1[i][j];\n }\n }\n for(int i=0;i<array2.length-1;i++){\n for(int j=0;j<array2[i].length-1;j++){\n array2[i][c]+=array2[i][j];\n }\n }\n for(int i=0;i<c+1;i++){\n for(int j=0;j<r;j++){\n array2[r][i]+=array2[j][i];\n }\n }\n\n for(int i=0;i<r+1;i++){\n for(int j=0;j<c+1;j++){\n if(j<c){\n System.out.print(array2[i][j]+\" \");\n }else{\n System.out.println(array2[i][j]);\n }\n }\n }\n }",
"main",
"{\n Scanner scan=new Scanner(System.in);\n int r=Integer.parseInt(scan.next());\n int c=Integer.parseInt(scan.next());\n int[][] array1=new int[r][c];\n for(int i=0;i<array1.length;i++){\n for(int j=0;j<array1[i].length;j++){\n array1[i][j]=Integer.parseInt(scan.next());\n }\n }\n\n int[][] array2=new int[r+1][c+1];\n for(int i=0;i<array2.length-1;i++){\n for(int j=0;j<array2[i].length-1;j++){\n array2[i][j]=array1[i][j];\n }\n }\n for(int i=0;i<array2.length-1;i++){\n for(int j=0;j<array2[i].length-1;j++){\n array2[i][c]+=array2[i][j];\n }\n }\n for(int i=0;i<c+1;i++){\n for(int j=0;j<r;j++){\n array2[r][i]+=array2[j][i];\n }\n }\n\n for(int i=0;i<r+1;i++){\n for(int j=0;j<c+1;j++){\n if(j<c){\n System.out.print(array2[i][j]+\" \");\n }else{\n System.out.println(array2[i][j]);\n }\n }\n }\n }",
"Scanner scan=new Scanner(System.in);",
"scan",
"new Scanner(System.in)",
"int r=Integer.parseInt(scan.next());",
"r",
"Integer.parseInt(scan.next())",
"Integer.parseInt",
"Integer",
"scan.next()",
"scan.next",
"scan",
"int c=Integer.parseInt(scan.next());",
"c",
"Integer.parseInt(scan.next())",
"Integer.parseInt",
"Integer",
"scan.next()",
"scan.next",
"scan",
"int[][] array1=new int[r][c];",
"array1",
"new int[r][c]",
"r",
"c",
"for(int i=0;i<array1.length;i++){\n for(int j=0;j<array1[i].length;j++){\n array1[i][j]=Integer.parseInt(scan.next());\n }\n }",
"int i=0;",
"int i=0;",
"i",
"0",
"i<array1.length",
"i",
"array1.length",
"array1",
"array1.length",
"i++",
"i++",
"i",
"{\n for(int j=0;j<array1[i].length;j++){\n array1[i][j]=Integer.parseInt(scan.next());\n }\n }",
"{\n for(int j=0;j<array1[i].length;j++){\n array1[i][j]=Integer.parseInt(scan.next());\n }\n }",
"for(int j=0;j<array1[i].length;j++){\n array1[i][j]=Integer.parseInt(scan.next());\n }",
"int j=0;",
"int j=0;",
"j",
"0",
"j<array1[i].length",
"j",
"array1[i].length",
"array1[i]",
"array1",
"i",
"array1[i].length",
"j++",
"j++",
"j",
"{\n array1[i][j]=Integer.parseInt(scan.next());\n }",
"{\n array1[i][j]=Integer.parseInt(scan.next());\n }",
"array1[i][j]=Integer.parseInt(scan.next())",
"array1[i][j]",
"array1[i]",
"array1",
"i",
"j",
"Integer.parseInt(scan.next())",
"Integer.parseInt",
"Integer",
"scan.next()",
"scan.next",
"scan",
"int[][] array2=new int[r+1][c+1];",
"array2",
"new int[r+1][c+1]",
"r+1",
"r",
"1",
"c+1",
"c",
"1",
"for(int i=0;i<array2.length-1;i++){\n for(int j=0;j<array2[i].length-1;j++){\n array2[i][j]=array1[i][j];\n }\n }",
"int i=0;",
"int i=0;",
"i",
"0",
"i<array2.length-1",
"i",
"array2.length-1",
"array2.length",
"array2",
"array2.length",
"1",
"i++",
"i++",
"i",
"{\n for(int j=0;j<array2[i].length-1;j++){\n array2[i][j]=array1[i][j];\n }\n }",
"{\n for(int j=0;j<array2[i].length-1;j++){\n array2[i][j]=array1[i][j];\n }\n }",
"for(int j=0;j<array2[i].length-1;j++){\n array2[i][j]=array1[i][j];\n }",
"int j=0;",
"int j=0;",
"j",
"0",
"j<array2[i].length-1",
"j",
"array2[i].length-1",
"array2[i].length",
"array2[i]",
"array2",
"i",
"array2[i].length",
"1",
"j++",
"j++",
"j",
"{\n array2[i][j]=array1[i][j];\n }",
"{\n array2[i][j]=array1[i][j];\n }",
"array2[i][j]=array1[i][j]",
"array2[i][j]",
"array2[i]",
"array2",
"i",
"j",
"array1[i][j]",
"array1[i]",
"array1",
"i",
"j",
"for(int i=0;i<array2.length-1;i++){\n for(int j=0;j<array2[i].length-1;j++){\n array2[i][c]+=array2[i][j];\n }\n }",
"int i=0;",
"int i=0;",
"i",
"0",
"i<array2.length-1",
"i",
"array2.length-1",
"array2.length",
"array2",
"array2.length",
"1",
"i++",
"i++",
"i",
"{\n for(int j=0;j<array2[i].length-1;j++){\n array2[i][c]+=array2[i][j];\n }\n }",
"{\n for(int j=0;j<array2[i].length-1;j++){\n array2[i][c]+=array2[i][j];\n }\n }",
"for(int j=0;j<array2[i].length-1;j++){\n array2[i][c]+=array2[i][j];\n }",
"int j=0;",
"int j=0;",
"j",
"0",
"j<array2[i].length-1",
"j",
"array2[i].length-1",
"array2[i].length",
"array2[i]",
"array2",
"i",
"array2[i].length",
"1",
"j++",
"j++",
"j",
"{\n array2[i][c]+=array2[i][j];\n }",
"{\n array2[i][c]+=array2[i][j];\n }",
"array2[i][c]+=array2[i][j]",
"array2[i][c]",
"array2[i]",
"array2",
"i",
"c",
"array2[i][j]",
"array2[i]",
"array2",
"i",
"j",
"for(int i=0;i<c+1;i++){\n for(int j=0;j<r;j++){\n array2[r][i]+=array2[j][i];\n }\n }",
"int i=0;",
"int i=0;",
"i",
"0",
"i<c+1",
"i",
"c+1",
"c",
"1",
"i++",
"i++",
"i",
"{\n for(int j=0;j<r;j++){\n array2[r][i]+=array2[j][i];\n }\n }",
"{\n for(int j=0;j<r;j++){\n array2[r][i]+=array2[j][i];\n }\n }",
"for(int j=0;j<r;j++){\n array2[r][i]+=array2[j][i];\n }",
"int j=0;",
"int j=0;",
"j",
"0",
"j<r",
"j",
"r",
"j++",
"j++",
"j",
"{\n array2[r][i]+=array2[j][i];\n }",
"{\n array2[r][i]+=array2[j][i];\n }",
"array2[r][i]+=array2[j][i]",
"array2[r][i]",
"array2[r]",
"array2",
"r",
"i",
"array2[j][i]",
"array2[j]",
"array2",
"j",
"i",
"for(int i=0;i<r+1;i++){\n for(int j=0;j<c+1;j++){\n if(j<c){\n System.out.print(array2[i][j]+\" \");\n }else{\n System.out.println(array2[i][j]);\n }\n }\n }",
"int i=0;",
"int i=0;",
"i",
"0",
"i<r+1",
"i",
"r+1",
"r",
"1",
"i++",
"i++",
"i",
"{\n for(int j=0;j<c+1;j++){\n if(j<c){\n System.out.print(array2[i][j]+\" \");\n }else{\n System.out.println(array2[i][j]);\n }\n }\n }",
"{\n for(int j=0;j<c+1;j++){\n if(j<c){\n System.out.print(array2[i][j]+\" \");\n }else{\n System.out.println(array2[i][j]);\n }\n }\n }",
"for(int j=0;j<c+1;j++){\n if(j<c){\n System.out.print(array2[i][j]+\" \");\n }else{\n System.out.println(array2[i][j]);\n }\n }",
"int j=0;",
"int j=0;",
"j",
"0",
"j<c+1",
"j",
"c+1",
"c",
"1",
"j++",
"j++",
"j",
"{\n if(j<c){\n System.out.print(array2[i][j]+\" \");\n }else{\n System.out.println(array2[i][j]);\n }\n }",
"{\n if(j<c){\n System.out.print(array2[i][j]+\" \");\n }else{\n System.out.println(array2[i][j]);\n }\n }",
"if(j<c){\n System.out.print(array2[i][j]+\" \");\n }else{\n System.out.println(array2[i][j]);\n }",
"j<c",
"j",
"c",
"{\n System.out.print(array2[i][j]+\" \");\n }",
"System.out.print(array2[i][j]+\" \")",
"System.out.print",
"System.out",
"System",
"System.out",
"array2[i][j]+\" \"",
"array2[i][j]",
"array2[i]",
"array2",
"i",
"j",
"\" \"",
"{\n System.out.println(array2[i][j]);\n }",
"System.out.println(array2[i][j])",
"System.out.println",
"System.out",
"System",
"System.out",
"array2[i][j]",
"array2[i]",
"array2",
"i",
"j",
"String[] args",
"args"
] | import java.io.*;
import java.util.*;
import java.lang.*;
class Main{
public static void main(String[] args) throws IOException{
Scanner scan=new Scanner(System.in);
int r=Integer.parseInt(scan.next());
int c=Integer.parseInt(scan.next());
int[][] array1=new int[r][c];
for(int i=0;i<array1.length;i++){
for(int j=0;j<array1[i].length;j++){
array1[i][j]=Integer.parseInt(scan.next());
}
}
int[][] array2=new int[r+1][c+1];
for(int i=0;i<array2.length-1;i++){
for(int j=0;j<array2[i].length-1;j++){
array2[i][j]=array1[i][j];
}
}
for(int i=0;i<array2.length-1;i++){
for(int j=0;j<array2[i].length-1;j++){
array2[i][c]+=array2[i][j];
}
}
for(int i=0;i<c+1;i++){
for(int j=0;j<r;j++){
array2[r][i]+=array2[j][i];
}
}
for(int i=0;i<r+1;i++){
for(int j=0;j<c+1;j++){
if(j<c){
System.out.print(array2[i][j]+" ");
}else{
System.out.println(array2[i][j]);
}
}
}
}
}
|
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
41,
13,
20,
13,
13,
41,
13,
20,
13,
41,
13,
20,
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,
13,
0,
18,
18,
13,
13,
13,
13,
0,
18,
13,
13,
13,
0,
18,
13,
13,
13,
0,
13,
13,
11,
1,
41,
13,
17,
2,
13,
2,
13,
17,
1,
40,
13,
30,
30,
14,
2,
13,
13,
11,
1,
41,
13,
17,
2,
13,
2,
13,
17,
1,
40,
13,
30,
30,
14,
2,
13,
13,
4,
18,
18,
13,
13,
2,
18,
18,
13,
13,
13,
17,
4,
18,
18,
13,
13,
18,
13,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
4,
18,
18,
13,
13,
2,
18,
13,
13,
17,
4,
18,
18,
13,
13,
13,
4,
18,
13,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
182,
5
],
[
182,
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
],
[
19,
20
],
[
20,
21
],
[
8,
22
],
[
22,
23
],
[
22,
24
],
[
8,
27
],
[
27,
28
],
[
27,
29
],
[
8,
31
],
[
31,
32
],
[
31,
33
],
[
8,
35
],
[
35,
36
],
[
35,
37
],
[
8,
38
],
[
38,
39
],
[
39,
40
],
[
40,
41
],
[
40,
42
],
[
38,
43
],
[
43,
44
],
[
43,
45
],
[
38,
46
],
[
46,
47
],
[
47,
48
],
[
38,
49
],
[
50,
50
],
[
50,
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
],
[
64,
66
],
[
66,
67
],
[
67,
68
],
[
63,
69
],
[
69,
70
],
[
70,
71
],
[
71,
72
],
[
71,
73
],
[
70,
74
],
[
69,
75
],
[
63,
76
],
[
76,
77
],
[
77,
78
],
[
77,
79
],
[
76,
80
],
[
63,
81
],
[
81,
82
],
[
82,
83
],
[
82,
84
],
[
81,
85
],
[
63,
86
],
[
86,
87
],
[
86,
88
],
[
8,
89
],
[
89,
90
],
[
90,
91
],
[
91,
92
],
[
91,
93
],
[
89,
94
],
[
94,
95
],
[
94,
96
],
[
96,
97
],
[
96,
98
],
[
89,
99
],
[
99,
100
],
[
100,
101
],
[
89,
102
],
[
103,
103
],
[
103,
104
],
[
104,
105
],
[
105,
106
],
[
105,
107
],
[
104,
108
],
[
108,
109
],
[
109,
110
],
[
110,
111
],
[
110,
112
],
[
108,
113
],
[
113,
114
],
[
113,
115
],
[
115,
116
],
[
115,
117
],
[
108,
118
],
[
118,
119
],
[
119,
120
],
[
108,
121
],
[
122,
122
],
[
122,
123
],
[
123,
124
],
[
124,
125
],
[
124,
126
],
[
123,
127
],
[
127,
128
],
[
128,
129
],
[
129,
130
],
[
129,
131
],
[
127,
132
],
[
132,
133
],
[
133,
134
],
[
134,
135
],
[
134,
136
],
[
133,
137
],
[
132,
138
],
[
123,
139
],
[
139,
140
],
[
140,
141
],
[
141,
142
],
[
141,
143
],
[
139,
144
],
[
144,
145
],
[
144,
146
],
[
104,
147
],
[
147,
148
],
[
148,
149
],
[
149,
150
],
[
149,
151
],
[
147,
152
],
[
152,
153
],
[
152,
154
],
[
147,
155
],
[
155,
156
],
[
156,
157
],
[
147,
158
],
[
159,
159
],
[
159,
160
],
[
160,
161
],
[
161,
162
],
[
162,
163
],
[
162,
164
],
[
160,
165
],
[
165,
166
],
[
166,
167
],
[
166,
168
],
[
165,
169
],
[
8,
170
],
[
170,
171
],
[
171,
172
],
[
172,
173
],
[
172,
174
],
[
170,
175
],
[
8,
176
],
[
176,
177
],
[
177,
178
],
[
6,
179
],
[
179,
180
],
[
0,
181
],
[
181,
182
],
[
181,
183
]
] | [
"import java.util.Scanner;\n\npublic class Main {\n\tpublic static void main(String[] args){\n\t\tScanner s = new Scanner(System.in);\n\t\t\n\t\tint r = s.nextInt();\n\t\tint c = s.nextInt();\n\t\tint[][] yousoA = new int[r][c];\n\t\tint[] yousoB = new int[r];\n\t\tint[] yousoB2 = new int[c];\n\t\tint sum = 0;\n\t\t\n\t\tfor(int i = 0; i < r; i++){\n\t\t\tfor(int j = 0; j < c; j++){\n\t\t\t\tint x = s.nextInt();\n\t\t\t\tyousoA[i][j] = x;\n\t\t\t\tyousoB[i] += x;\n\t\t\t\tyousoB2[j] += x;\n\t\t\t\tsum += x;\n\t\t\t}\n\t\t}\n\t\tfor(int i=0; i < r+1; i++){\n\t\t\tif(i < r)\n\t\t\t\tfor(int j =0; j < c+1; j++){\n\t\t\t\t\tif(j < c) System.out.print(yousoA[i][j] + \" \");\n\t\t\t\t\telse System.out.println(yousoB[i]);\n\t\t\t\t}\n\t\t\telse\n\t\t\t\tfor(int k = 0; k < c; k++){\n\t\t\t\t\tSystem.out.print(yousoB2[k] + \" \");\n\t\t\t\t}\n\t\t}\n\t\tSystem.out.println(sum);\n\t\ts.close();\n\t}\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n\tpublic static void main(String[] args){\n\t\tScanner s = new Scanner(System.in);\n\t\t\n\t\tint r = s.nextInt();\n\t\tint c = s.nextInt();\n\t\tint[][] yousoA = new int[r][c];\n\t\tint[] yousoB = new int[r];\n\t\tint[] yousoB2 = new int[c];\n\t\tint sum = 0;\n\t\t\n\t\tfor(int i = 0; i < r; i++){\n\t\t\tfor(int j = 0; j < c; j++){\n\t\t\t\tint x = s.nextInt();\n\t\t\t\tyousoA[i][j] = x;\n\t\t\t\tyousoB[i] += x;\n\t\t\t\tyousoB2[j] += x;\n\t\t\t\tsum += x;\n\t\t\t}\n\t\t}\n\t\tfor(int i=0; i < r+1; i++){\n\t\t\tif(i < r)\n\t\t\t\tfor(int j =0; j < c+1; j++){\n\t\t\t\t\tif(j < c) System.out.print(yousoA[i][j] + \" \");\n\t\t\t\t\telse System.out.println(yousoB[i]);\n\t\t\t\t}\n\t\t\telse\n\t\t\t\tfor(int k = 0; k < c; k++){\n\t\t\t\t\tSystem.out.print(yousoB2[k] + \" \");\n\t\t\t\t}\n\t\t}\n\t\tSystem.out.println(sum);\n\t\ts.close();\n\t}\n}",
"Main",
"public static void main(String[] args){\n\t\tScanner s = new Scanner(System.in);\n\t\t\n\t\tint r = s.nextInt();\n\t\tint c = s.nextInt();\n\t\tint[][] yousoA = new int[r][c];\n\t\tint[] yousoB = new int[r];\n\t\tint[] yousoB2 = new int[c];\n\t\tint sum = 0;\n\t\t\n\t\tfor(int i = 0; i < r; i++){\n\t\t\tfor(int j = 0; j < c; j++){\n\t\t\t\tint x = s.nextInt();\n\t\t\t\tyousoA[i][j] = x;\n\t\t\t\tyousoB[i] += x;\n\t\t\t\tyousoB2[j] += x;\n\t\t\t\tsum += x;\n\t\t\t}\n\t\t}\n\t\tfor(int i=0; i < r+1; i++){\n\t\t\tif(i < r)\n\t\t\t\tfor(int j =0; j < c+1; j++){\n\t\t\t\t\tif(j < c) System.out.print(yousoA[i][j] + \" \");\n\t\t\t\t\telse System.out.println(yousoB[i]);\n\t\t\t\t}\n\t\t\telse\n\t\t\t\tfor(int k = 0; k < c; k++){\n\t\t\t\t\tSystem.out.print(yousoB2[k] + \" \");\n\t\t\t\t}\n\t\t}\n\t\tSystem.out.println(sum);\n\t\ts.close();\n\t}",
"main",
"{\n\t\tScanner s = new Scanner(System.in);\n\t\t\n\t\tint r = s.nextInt();\n\t\tint c = s.nextInt();\n\t\tint[][] yousoA = new int[r][c];\n\t\tint[] yousoB = new int[r];\n\t\tint[] yousoB2 = new int[c];\n\t\tint sum = 0;\n\t\t\n\t\tfor(int i = 0; i < r; i++){\n\t\t\tfor(int j = 0; j < c; j++){\n\t\t\t\tint x = s.nextInt();\n\t\t\t\tyousoA[i][j] = x;\n\t\t\t\tyousoB[i] += x;\n\t\t\t\tyousoB2[j] += x;\n\t\t\t\tsum += x;\n\t\t\t}\n\t\t}\n\t\tfor(int i=0; i < r+1; i++){\n\t\t\tif(i < r)\n\t\t\t\tfor(int j =0; j < c+1; j++){\n\t\t\t\t\tif(j < c) System.out.print(yousoA[i][j] + \" \");\n\t\t\t\t\telse System.out.println(yousoB[i]);\n\t\t\t\t}\n\t\t\telse\n\t\t\t\tfor(int k = 0; k < c; k++){\n\t\t\t\t\tSystem.out.print(yousoB2[k] + \" \");\n\t\t\t\t}\n\t\t}\n\t\tSystem.out.println(sum);\n\t\ts.close();\n\t}",
"Scanner s = new Scanner(System.in);",
"s",
"new Scanner(System.in)",
"int r = s.nextInt();",
"r",
"s.nextInt()",
"s.nextInt",
"s",
"int c = s.nextInt();",
"c",
"s.nextInt()",
"s.nextInt",
"s",
"int[][] yousoA = new int[r][c];",
"yousoA",
"new int[r][c]",
"r",
"c",
"int[] yousoB = new int[r];",
"yousoB",
"new int[r]",
"r",
"int[] yousoB2 = new int[c];",
"yousoB2",
"new int[c]",
"c",
"int sum = 0;",
"sum",
"0",
"for(int i = 0; i < r; i++){\n\t\t\tfor(int j = 0; j < c; j++){\n\t\t\t\tint x = s.nextInt();\n\t\t\t\tyousoA[i][j] = x;\n\t\t\t\tyousoB[i] += x;\n\t\t\t\tyousoB2[j] += x;\n\t\t\t\tsum += x;\n\t\t\t}\n\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < r",
"i",
"r",
"i++",
"i++",
"i",
"{\n\t\t\tfor(int j = 0; j < c; j++){\n\t\t\t\tint x = s.nextInt();\n\t\t\t\tyousoA[i][j] = x;\n\t\t\t\tyousoB[i] += x;\n\t\t\t\tyousoB2[j] += x;\n\t\t\t\tsum += x;\n\t\t\t}\n\t\t}",
"{\n\t\t\tfor(int j = 0; j < c; j++){\n\t\t\t\tint x = s.nextInt();\n\t\t\t\tyousoA[i][j] = x;\n\t\t\t\tyousoB[i] += x;\n\t\t\t\tyousoB2[j] += x;\n\t\t\t\tsum += x;\n\t\t\t}\n\t\t}",
"for(int j = 0; j < c; j++){\n\t\t\t\tint x = s.nextInt();\n\t\t\t\tyousoA[i][j] = x;\n\t\t\t\tyousoB[i] += x;\n\t\t\t\tyousoB2[j] += x;\n\t\t\t\tsum += x;\n\t\t\t}",
"int j = 0;",
"int j = 0;",
"j",
"0",
"j < c",
"j",
"c",
"j++",
"j++",
"j",
"{\n\t\t\t\tint x = s.nextInt();\n\t\t\t\tyousoA[i][j] = x;\n\t\t\t\tyousoB[i] += x;\n\t\t\t\tyousoB2[j] += x;\n\t\t\t\tsum += x;\n\t\t\t}",
"{\n\t\t\t\tint x = s.nextInt();\n\t\t\t\tyousoA[i][j] = x;\n\t\t\t\tyousoB[i] += x;\n\t\t\t\tyousoB2[j] += x;\n\t\t\t\tsum += x;\n\t\t\t}",
"int x = s.nextInt();",
"x",
"s.nextInt()",
"s.nextInt",
"s",
"yousoA[i][j] = x",
"yousoA[i][j]",
"yousoA[i]",
"yousoA",
"i",
"j",
"x",
"yousoB[i] += x",
"yousoB[i]",
"yousoB",
"i",
"x",
"yousoB2[j] += x",
"yousoB2[j]",
"yousoB2",
"j",
"x",
"sum += x",
"sum",
"x",
"for(int i=0; i < r+1; i++){\n\t\t\tif(i < r)\n\t\t\t\tfor(int j =0; j < c+1; j++){\n\t\t\t\t\tif(j < c) System.out.print(yousoA[i][j] + \" \");\n\t\t\t\t\telse System.out.println(yousoB[i]);\n\t\t\t\t}\n\t\t\telse\n\t\t\t\tfor(int k = 0; k < c; k++){\n\t\t\t\t\tSystem.out.print(yousoB2[k] + \" \");\n\t\t\t\t}\n\t\t}",
"int i=0;",
"int i=0;",
"i",
"0",
"i < r+1",
"i",
"r+1",
"r",
"1",
"i++",
"i++",
"i",
"{\n\t\t\tif(i < r)\n\t\t\t\tfor(int j =0; j < c+1; j++){\n\t\t\t\t\tif(j < c) System.out.print(yousoA[i][j] + \" \");\n\t\t\t\t\telse System.out.println(yousoB[i]);\n\t\t\t\t}\n\t\t\telse\n\t\t\t\tfor(int k = 0; k < c; k++){\n\t\t\t\t\tSystem.out.print(yousoB2[k] + \" \");\n\t\t\t\t}\n\t\t}",
"{\n\t\t\tif(i < r)\n\t\t\t\tfor(int j =0; j < c+1; j++){\n\t\t\t\t\tif(j < c) System.out.print(yousoA[i][j] + \" \");\n\t\t\t\t\telse System.out.println(yousoB[i]);\n\t\t\t\t}\n\t\t\telse\n\t\t\t\tfor(int k = 0; k < c; k++){\n\t\t\t\t\tSystem.out.print(yousoB2[k] + \" \");\n\t\t\t\t}\n\t\t}",
"if(i < r)\n\t\t\t\tfor(int j =0; j < c+1; j++){\n\t\t\t\t\tif(j < c) System.out.print(yousoA[i][j] + \" \");\n\t\t\t\t\telse System.out.println(yousoB[i]);\n\t\t\t\t}\n\t\t\telse\n\t\t\t\tfor(int k = 0; k < c; k++){\n\t\t\t\t\tSystem.out.print(yousoB2[k] + \" \");\n\t\t\t\t}",
"i < r",
"i",
"r",
"for(int j =0; j < c+1; j++){\n\t\t\t\t\tif(j < c) System.out.print(yousoA[i][j] + \" \");\n\t\t\t\t\telse System.out.println(yousoB[i]);\n\t\t\t\t}",
"int j =0;",
"int j =0;",
"j",
"0",
"j < c+1",
"j",
"c+1",
"c",
"1",
"j++",
"j++",
"j",
"{\n\t\t\t\t\tif(j < c) System.out.print(yousoA[i][j] + \" \");\n\t\t\t\t\telse System.out.println(yousoB[i]);\n\t\t\t\t}",
"{\n\t\t\t\t\tif(j < c) System.out.print(yousoA[i][j] + \" \");\n\t\t\t\t\telse System.out.println(yousoB[i]);\n\t\t\t\t}",
"if(j < c) System.out.print(yousoA[i][j] + \" \");\n\t\t\t\t\telse System.out.println(yousoB[i]);",
"j < c",
"j",
"c",
"System.out.print(yousoA[i][j] + \" \")",
"System.out.print",
"System.out",
"System",
"System.out",
"yousoA[i][j] + \" \"",
"yousoA[i][j]",
"yousoA[i]",
"yousoA",
"i",
"j",
"\" \"",
"System.out.println(yousoB[i])",
"System.out.println",
"System.out",
"System",
"System.out",
"yousoB[i]",
"yousoB",
"i",
"for(int k = 0; k < c; k++){\n\t\t\t\t\tSystem.out.print(yousoB2[k] + \" \");\n\t\t\t\t}",
"int k = 0;",
"int k = 0;",
"k",
"0",
"k < c",
"k",
"c",
"k++",
"k++",
"k",
"{\n\t\t\t\t\tSystem.out.print(yousoB2[k] + \" \");\n\t\t\t\t}",
"{\n\t\t\t\t\tSystem.out.print(yousoB2[k] + \" \");\n\t\t\t\t}",
"System.out.print(yousoB2[k] + \" \")",
"System.out.print",
"System.out",
"System",
"System.out",
"yousoB2[k] + \" \"",
"yousoB2[k]",
"yousoB2",
"k",
"\" \"",
"System.out.println(sum)",
"System.out.println",
"System.out",
"System",
"System.out",
"sum",
"s.close()",
"s.close",
"s",
"String[] args",
"args",
"public class Main {\n\tpublic static void main(String[] args){\n\t\tScanner s = new Scanner(System.in);\n\t\t\n\t\tint r = s.nextInt();\n\t\tint c = s.nextInt();\n\t\tint[][] yousoA = new int[r][c];\n\t\tint[] yousoB = new int[r];\n\t\tint[] yousoB2 = new int[c];\n\t\tint sum = 0;\n\t\t\n\t\tfor(int i = 0; i < r; i++){\n\t\t\tfor(int j = 0; j < c; j++){\n\t\t\t\tint x = s.nextInt();\n\t\t\t\tyousoA[i][j] = x;\n\t\t\t\tyousoB[i] += x;\n\t\t\t\tyousoB2[j] += x;\n\t\t\t\tsum += x;\n\t\t\t}\n\t\t}\n\t\tfor(int i=0; i < r+1; i++){\n\t\t\tif(i < r)\n\t\t\t\tfor(int j =0; j < c+1; j++){\n\t\t\t\t\tif(j < c) System.out.print(yousoA[i][j] + \" \");\n\t\t\t\t\telse System.out.println(yousoB[i]);\n\t\t\t\t}\n\t\t\telse\n\t\t\t\tfor(int k = 0; k < c; k++){\n\t\t\t\t\tSystem.out.print(yousoB2[k] + \" \");\n\t\t\t\t}\n\t\t}\n\t\tSystem.out.println(sum);\n\t\ts.close();\n\t}\n}",
"public class Main {\n\tpublic static void main(String[] args){\n\t\tScanner s = new Scanner(System.in);\n\t\t\n\t\tint r = s.nextInt();\n\t\tint c = s.nextInt();\n\t\tint[][] yousoA = new int[r][c];\n\t\tint[] yousoB = new int[r];\n\t\tint[] yousoB2 = new int[c];\n\t\tint sum = 0;\n\t\t\n\t\tfor(int i = 0; i < r; i++){\n\t\t\tfor(int j = 0; j < c; j++){\n\t\t\t\tint x = s.nextInt();\n\t\t\t\tyousoA[i][j] = x;\n\t\t\t\tyousoB[i] += x;\n\t\t\t\tyousoB2[j] += x;\n\t\t\t\tsum += x;\n\t\t\t}\n\t\t}\n\t\tfor(int i=0; i < r+1; i++){\n\t\t\tif(i < r)\n\t\t\t\tfor(int j =0; j < c+1; j++){\n\t\t\t\t\tif(j < c) System.out.print(yousoA[i][j] + \" \");\n\t\t\t\t\telse System.out.println(yousoB[i]);\n\t\t\t\t}\n\t\t\telse\n\t\t\t\tfor(int k = 0; k < c; k++){\n\t\t\t\t\tSystem.out.print(yousoB2[k] + \" \");\n\t\t\t\t}\n\t\t}\n\t\tSystem.out.println(sum);\n\t\ts.close();\n\t}\n}",
"Main"
] | import java.util.Scanner;
public class Main {
public static void main(String[] args){
Scanner s = new Scanner(System.in);
int r = s.nextInt();
int c = s.nextInt();
int[][] yousoA = new int[r][c];
int[] yousoB = new int[r];
int[] yousoB2 = new int[c];
int sum = 0;
for(int i = 0; i < r; i++){
for(int j = 0; j < c; j++){
int x = s.nextInt();
yousoA[i][j] = x;
yousoB[i] += x;
yousoB2[j] += x;
sum += x;
}
}
for(int i=0; i < r+1; i++){
if(i < r)
for(int j =0; j < c+1; j++){
if(j < c) System.out.print(yousoA[i][j] + " ");
else System.out.println(yousoB[i]);
}
else
for(int k = 0; k < c; k++){
System.out.print(yousoB2[k] + " ");
}
}
System.out.println(sum);
s.close();
}
}
|
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
20,
17,
17,
41,
13,
41,
13,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
11,
1,
0,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
11,
1,
0,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
18,
18,
13,
13,
13,
17,
11,
1,
0,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
11,
1,
0,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
18,
18,
13,
13,
13,
4,
18,
13,
0,
18,
18,
13,
13,
13,
18,
18,
13,
13,
13,
0,
18,
18,
13,
13,
13,
18,
18,
13,
13,
13,
0,
18,
18,
13,
13,
13,
18,
18,
13,
13,
13,
11,
1,
0,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
11,
1,
0,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
4,
18,
18,
13,
13,
17,
18,
18,
13,
13,
13,
4,
18,
18,
13,
13,
18,
18,
13,
13,
13,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
182,
5
],
[
182,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
8,
17
],
[
17,
18
],
[
8,
19
],
[
19,
20
],
[
8,
21
],
[
21,
22
],
[
21,
23
],
[
23,
24
],
[
24,
25
],
[
8,
26
],
[
26,
27
],
[
26,
28
],
[
28,
29
],
[
29,
30
],
[
8,
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
],
[
58,
62
],
[
57,
63
],
[
8,
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
],
[
91,
95
],
[
90,
96
],
[
96,
97
],
[
97,
98
],
[
89,
99
],
[
99,
100
],
[
100,
101
],
[
101,
102
],
[
101,
103
],
[
100,
104
],
[
99,
105
],
[
105,
106
],
[
106,
107
],
[
106,
108
],
[
105,
109
],
[
89,
110
],
[
110,
111
],
[
111,
112
],
[
112,
113
],
[
112,
114
],
[
111,
115
],
[
110,
116
],
[
116,
117
],
[
117,
118
],
[
117,
119
],
[
116,
120
],
[
76,
121
],
[
121,
122
],
[
122,
123
],
[
123,
124
],
[
123,
125
],
[
122,
126
],
[
121,
127
],
[
127,
128
],
[
128,
129
],
[
128,
130
],
[
127,
131
],
[
8,
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
],
[
158,
164
],
[
164,
165
],
[
165,
166
],
[
165,
167
],
[
164,
168
],
[
144,
169
],
[
169,
170
],
[
170,
171
],
[
171,
172
],
[
171,
173
],
[
169,
174
],
[
174,
175
],
[
175,
176
],
[
175,
177
],
[
174,
178
],
[
6,
179
],
[
179,
180
],
[
0,
181
],
[
181,
182
],
[
181,
183
]
] | [
"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\tint a[][]=new int[101][101];\n\t\tint i,j;\n\t\t\n\t\tint r=scan.nextInt(); int c=scan.nextInt();\n\t\t\n\t\t//初期化\n\t\tfor(i=0;i<=r;i++){\n\t\t\tfor(j=0;j<=c;j++){\n\t\t\t\ta[i][j]=0;\n\t\t\t}\n\t\t}\n\t\t\n\t\t//読み込みと計算\n\t\tfor(i=0;i<r;i++){\n\t\t\tfor(j=0;j<c;j++){\n\t\t\t\ta[i][j]=scan.nextInt();\n\t\t\t\ta[i][c]+=a[i][j];\n\t\t\t\ta[r][j]+=a[i][j];\n\t\t\t}\n\t\t\ta[r][c]+=a[i][c];\n\t\t}\n\t\t\n\t\t//表示\n\t\tfor(i=0;i<=r;i++){\n\t\t\tfor(j=0;j<c;j++){\n\t\t\t\tSystem.out.printf(\"%d \",a[i][j]);\n\t\t\t}\n\t\t\tSystem.out.println(a[i][c]);\n\t\t}\n\t\t\n\t}\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n\tpublic static void main(String[] args){\n\t\tScanner scan=new Scanner(System.in);\n\t\tint a[][]=new int[101][101];\n\t\tint i,j;\n\t\t\n\t\tint r=scan.nextInt(); int c=scan.nextInt();\n\t\t\n\t\t//初期化\n\t\tfor(i=0;i<=r;i++){\n\t\t\tfor(j=0;j<=c;j++){\n\t\t\t\ta[i][j]=0;\n\t\t\t}\n\t\t}\n\t\t\n\t\t//読み込みと計算\n\t\tfor(i=0;i<r;i++){\n\t\t\tfor(j=0;j<c;j++){\n\t\t\t\ta[i][j]=scan.nextInt();\n\t\t\t\ta[i][c]+=a[i][j];\n\t\t\t\ta[r][j]+=a[i][j];\n\t\t\t}\n\t\t\ta[r][c]+=a[i][c];\n\t\t}\n\t\t\n\t\t//表示\n\t\tfor(i=0;i<=r;i++){\n\t\t\tfor(j=0;j<c;j++){\n\t\t\t\tSystem.out.printf(\"%d \",a[i][j]);\n\t\t\t}\n\t\t\tSystem.out.println(a[i][c]);\n\t\t}\n\t\t\n\t}\n}",
"Main",
"public static void main(String[] args){\n\t\tScanner scan=new Scanner(System.in);\n\t\tint a[][]=new int[101][101];\n\t\tint i,j;\n\t\t\n\t\tint r=scan.nextInt(); int c=scan.nextInt();\n\t\t\n\t\t//初期化\n\t\tfor(i=0;i<=r;i++){\n\t\t\tfor(j=0;j<=c;j++){\n\t\t\t\ta[i][j]=0;\n\t\t\t}\n\t\t}\n\t\t\n\t\t//読み込みと計算\n\t\tfor(i=0;i<r;i++){\n\t\t\tfor(j=0;j<c;j++){\n\t\t\t\ta[i][j]=scan.nextInt();\n\t\t\t\ta[i][c]+=a[i][j];\n\t\t\t\ta[r][j]+=a[i][j];\n\t\t\t}\n\t\t\ta[r][c]+=a[i][c];\n\t\t}\n\t\t\n\t\t//表示\n\t\tfor(i=0;i<=r;i++){\n\t\t\tfor(j=0;j<c;j++){\n\t\t\t\tSystem.out.printf(\"%d \",a[i][j]);\n\t\t\t}\n\t\t\tSystem.out.println(a[i][c]);\n\t\t}\n\t\t\n\t}",
"main",
"{\n\t\tScanner scan=new Scanner(System.in);\n\t\tint a[][]=new int[101][101];\n\t\tint i,j;\n\t\t\n\t\tint r=scan.nextInt(); int c=scan.nextInt();\n\t\t\n\t\t//初期化\n\t\tfor(i=0;i<=r;i++){\n\t\t\tfor(j=0;j<=c;j++){\n\t\t\t\ta[i][j]=0;\n\t\t\t}\n\t\t}\n\t\t\n\t\t//読み込みと計算\n\t\tfor(i=0;i<r;i++){\n\t\t\tfor(j=0;j<c;j++){\n\t\t\t\ta[i][j]=scan.nextInt();\n\t\t\t\ta[i][c]+=a[i][j];\n\t\t\t\ta[r][j]+=a[i][j];\n\t\t\t}\n\t\t\ta[r][c]+=a[i][c];\n\t\t}\n\t\t\n\t\t//表示\n\t\tfor(i=0;i<=r;i++){\n\t\t\tfor(j=0;j<c;j++){\n\t\t\t\tSystem.out.printf(\"%d \",a[i][j]);\n\t\t\t}\n\t\t\tSystem.out.println(a[i][c]);\n\t\t}\n\t\t\n\t}",
"Scanner scan=new Scanner(System.in);",
"scan",
"new Scanner(System.in)",
"int a[][]=new int[101][101];",
"a",
"new int[101][101]",
"101",
"101",
"int i",
"i",
"j;",
"j",
"int r=scan.nextInt();",
"r",
"scan.nextInt()",
"scan.nextInt",
"scan",
"int c=scan.nextInt();",
"c",
"scan.nextInt()",
"scan.nextInt",
"scan",
"for(i=0;i<=r;i++){\n\t\t\tfor(j=0;j<=c;j++){\n\t\t\t\ta[i][j]=0;\n\t\t\t}\n\t\t}",
"i=0;",
"i=0",
"i",
"0",
"i<=r",
"i",
"r",
"i++",
"i++",
"i",
"{\n\t\t\tfor(j=0;j<=c;j++){\n\t\t\t\ta[i][j]=0;\n\t\t\t}\n\t\t}",
"{\n\t\t\tfor(j=0;j<=c;j++){\n\t\t\t\ta[i][j]=0;\n\t\t\t}\n\t\t}",
"for(j=0;j<=c;j++){\n\t\t\t\ta[i][j]=0;\n\t\t\t}",
"j=0;",
"j=0",
"j",
"0",
"j<=c",
"j",
"c",
"j++",
"j++",
"j",
"{\n\t\t\t\ta[i][j]=0;\n\t\t\t}",
"{\n\t\t\t\ta[i][j]=0;\n\t\t\t}",
"a[i][j]=0",
"a[i][j]",
"a[i]",
"a",
"i",
"j",
"0",
"for(i=0;i<r;i++){\n\t\t\tfor(j=0;j<c;j++){\n\t\t\t\ta[i][j]=scan.nextInt();\n\t\t\t\ta[i][c]+=a[i][j];\n\t\t\t\ta[r][j]+=a[i][j];\n\t\t\t}\n\t\t\ta[r][c]+=a[i][c];\n\t\t}",
"i=0;",
"i=0",
"i",
"0",
"i<r",
"i",
"r",
"i++",
"i++",
"i",
"{\n\t\t\tfor(j=0;j<c;j++){\n\t\t\t\ta[i][j]=scan.nextInt();\n\t\t\t\ta[i][c]+=a[i][j];\n\t\t\t\ta[r][j]+=a[i][j];\n\t\t\t}\n\t\t\ta[r][c]+=a[i][c];\n\t\t}",
"{\n\t\t\tfor(j=0;j<c;j++){\n\t\t\t\ta[i][j]=scan.nextInt();\n\t\t\t\ta[i][c]+=a[i][j];\n\t\t\t\ta[r][j]+=a[i][j];\n\t\t\t}\n\t\t\ta[r][c]+=a[i][c];\n\t\t}",
"for(j=0;j<c;j++){\n\t\t\t\ta[i][j]=scan.nextInt();\n\t\t\t\ta[i][c]+=a[i][j];\n\t\t\t\ta[r][j]+=a[i][j];\n\t\t\t}",
"j=0;",
"j=0",
"j",
"0",
"j<c",
"j",
"c",
"j++",
"j++",
"j",
"{\n\t\t\t\ta[i][j]=scan.nextInt();\n\t\t\t\ta[i][c]+=a[i][j];\n\t\t\t\ta[r][j]+=a[i][j];\n\t\t\t}",
"{\n\t\t\t\ta[i][j]=scan.nextInt();\n\t\t\t\ta[i][c]+=a[i][j];\n\t\t\t\ta[r][j]+=a[i][j];\n\t\t\t}",
"a[i][j]=scan.nextInt()",
"a[i][j]",
"a[i]",
"a",
"i",
"j",
"scan.nextInt()",
"scan.nextInt",
"scan",
"a[i][c]+=a[i][j]",
"a[i][c]",
"a[i]",
"a",
"i",
"c",
"a[i][j]",
"a[i]",
"a",
"i",
"j",
"a[r][j]+=a[i][j]",
"a[r][j]",
"a[r]",
"a",
"r",
"j",
"a[i][j]",
"a[i]",
"a",
"i",
"j",
"a[r][c]+=a[i][c]",
"a[r][c]",
"a[r]",
"a",
"r",
"c",
"a[i][c]",
"a[i]",
"a",
"i",
"c",
"for(i=0;i<=r;i++){\n\t\t\tfor(j=0;j<c;j++){\n\t\t\t\tSystem.out.printf(\"%d \",a[i][j]);\n\t\t\t}\n\t\t\tSystem.out.println(a[i][c]);\n\t\t}",
"i=0;",
"i=0",
"i",
"0",
"i<=r",
"i",
"r",
"i++",
"i++",
"i",
"{\n\t\t\tfor(j=0;j<c;j++){\n\t\t\t\tSystem.out.printf(\"%d \",a[i][j]);\n\t\t\t}\n\t\t\tSystem.out.println(a[i][c]);\n\t\t}",
"{\n\t\t\tfor(j=0;j<c;j++){\n\t\t\t\tSystem.out.printf(\"%d \",a[i][j]);\n\t\t\t}\n\t\t\tSystem.out.println(a[i][c]);\n\t\t}",
"for(j=0;j<c;j++){\n\t\t\t\tSystem.out.printf(\"%d \",a[i][j]);\n\t\t\t}",
"j=0;",
"j=0",
"j",
"0",
"j<c",
"j",
"c",
"j++",
"j++",
"j",
"{\n\t\t\t\tSystem.out.printf(\"%d \",a[i][j]);\n\t\t\t}",
"{\n\t\t\t\tSystem.out.printf(\"%d \",a[i][j]);\n\t\t\t}",
"System.out.printf(\"%d \",a[i][j])",
"System.out.printf",
"System.out",
"System",
"System.out",
"\"%d \"",
"a[i][j]",
"a[i]",
"a",
"i",
"j",
"System.out.println(a[i][c])",
"System.out.println",
"System.out",
"System",
"System.out",
"a[i][c]",
"a[i]",
"a",
"i",
"c",
"String[] args",
"args",
"public class Main {\n\tpublic static void main(String[] args){\n\t\tScanner scan=new Scanner(System.in);\n\t\tint a[][]=new int[101][101];\n\t\tint i,j;\n\t\t\n\t\tint r=scan.nextInt(); int c=scan.nextInt();\n\t\t\n\t\t//初期化\n\t\tfor(i=0;i<=r;i++){\n\t\t\tfor(j=0;j<=c;j++){\n\t\t\t\ta[i][j]=0;\n\t\t\t}\n\t\t}\n\t\t\n\t\t//読み込みと計算\n\t\tfor(i=0;i<r;i++){\n\t\t\tfor(j=0;j<c;j++){\n\t\t\t\ta[i][j]=scan.nextInt();\n\t\t\t\ta[i][c]+=a[i][j];\n\t\t\t\ta[r][j]+=a[i][j];\n\t\t\t}\n\t\t\ta[r][c]+=a[i][c];\n\t\t}\n\t\t\n\t\t//表示\n\t\tfor(i=0;i<=r;i++){\n\t\t\tfor(j=0;j<c;j++){\n\t\t\t\tSystem.out.printf(\"%d \",a[i][j]);\n\t\t\t}\n\t\t\tSystem.out.println(a[i][c]);\n\t\t}\n\t\t\n\t}\n}",
"public class Main {\n\tpublic static void main(String[] args){\n\t\tScanner scan=new Scanner(System.in);\n\t\tint a[][]=new int[101][101];\n\t\tint i,j;\n\t\t\n\t\tint r=scan.nextInt(); int c=scan.nextInt();\n\t\t\n\t\t//初期化\n\t\tfor(i=0;i<=r;i++){\n\t\t\tfor(j=0;j<=c;j++){\n\t\t\t\ta[i][j]=0;\n\t\t\t}\n\t\t}\n\t\t\n\t\t//読み込みと計算\n\t\tfor(i=0;i<r;i++){\n\t\t\tfor(j=0;j<c;j++){\n\t\t\t\ta[i][j]=scan.nextInt();\n\t\t\t\ta[i][c]+=a[i][j];\n\t\t\t\ta[r][j]+=a[i][j];\n\t\t\t}\n\t\t\ta[r][c]+=a[i][c];\n\t\t}\n\t\t\n\t\t//表示\n\t\tfor(i=0;i<=r;i++){\n\t\t\tfor(j=0;j<c;j++){\n\t\t\t\tSystem.out.printf(\"%d \",a[i][j]);\n\t\t\t}\n\t\t\tSystem.out.println(a[i][c]);\n\t\t}\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 a[][]=new int[101][101];
int i,j;
int r=scan.nextInt(); int c=scan.nextInt();
//初期化
for(i=0;i<=r;i++){
for(j=0;j<=c;j++){
a[i][j]=0;
}
}
//読み込みと計算
for(i=0;i<r;i++){
for(j=0;j<c;j++){
a[i][j]=scan.nextInt();
a[i][c]+=a[i][j];
a[r][j]+=a[i][j];
}
a[r][c]+=a[i][c];
}
//表示
for(i=0;i<=r;i++){
for(j=0;j<c;j++){
System.out.printf("%d ",a[i][j]);
}
System.out.println(a[i][c]);
}
}
}
|
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
38,
5,
13,
30,
4,
18,
18,
13,
13,
13,
30,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
17,
41,
13,
4,
18,
13,
18,
13,
17,
41,
13,
4,
18,
13,
18,
13,
17,
41,
13,
20,
2,
13,
17,
2,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
18,
18,
13,
13,
13,
17,
0,
13,
4,
18,
13,
0,
13,
4,
18,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
14,
2,
17,
13,
30,
0,
18,
18,
13,
13,
13,
17,
0,
18,
18,
13,
13,
13,
4,
18,
13,
18,
13,
13,
0,
18,
18,
13,
13,
13,
18,
18,
13,
13,
13,
0,
18,
18,
13,
13,
13,
18,
18,
13,
13,
13,
4,
18,
18,
13,
13,
2,
18,
13,
13,
17,
4,
18,
18,
13,
13,
18,
18,
13,
13,
13,
0,
18,
18,
13,
13,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
18,
18,
13,
13,
13,
18,
18,
13,
13,
13,
4,
18,
18,
13,
13,
2,
18,
18,
13,
13,
13,
17,
4,
18,
18,
13,
13,
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
],
[
13,
14
],
[
13,
15
],
[
15,
16
],
[
16,
17
],
[
17,
18
],
[
18,
19
],
[
18,
20
],
[
16,
21
],
[
12,
22
],
[
22,
23
],
[
23,
24
],
[
23,
25
],
[
25,
26
],
[
26,
27
],
[
22,
28
],
[
28,
29
],
[
28,
30
],
[
30,
31
],
[
31,
32
],
[
30,
33
],
[
22,
34
],
[
34,
35
],
[
34,
36
],
[
36,
37
],
[
37,
38
],
[
36,
39
],
[
39,
40
],
[
39,
41
],
[
22,
42
],
[
42,
43
],
[
42,
44
],
[
44,
45
],
[
45,
46
],
[
44,
47
],
[
47,
48
],
[
47,
49
],
[
22,
50
],
[
50,
51
],
[
50,
52
],
[
53,
54
],
[
53,
55
],
[
56,
57
],
[
56,
58
],
[
22,
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
],
[
73,
77
],
[
72,
78
],
[
71,
79
],
[
79,
80
],
[
79,
81
],
[
81,
82
],
[
82,
83
],
[
71,
84
],
[
84,
85
],
[
84,
86
],
[
86,
87
],
[
87,
88
],
[
86,
89
],
[
71,
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
],
[
104,
105
],
[
104,
106
],
[
103,
107
],
[
107,
108
],
[
108,
109
],
[
109,
110
],
[
110,
111
],
[
110,
112
],
[
109,
113
],
[
108,
114
],
[
102,
115
],
[
115,
116
],
[
116,
117
],
[
117,
118
],
[
117,
119
],
[
116,
120
],
[
115,
121
],
[
121,
122
],
[
122,
123
],
[
121,
124
],
[
124,
125
],
[
124,
126
],
[
102,
127
],
[
127,
128
],
[
128,
129
],
[
129,
130
],
[
129,
131
],
[
128,
132
],
[
127,
133
],
[
133,
134
],
[
134,
135
],
[
134,
136
],
[
133,
137
],
[
102,
138
],
[
138,
139
],
[
139,
140
],
[
140,
141
],
[
140,
142
],
[
139,
143
],
[
138,
144
],
[
144,
145
],
[
145,
146
],
[
145,
147
],
[
144,
148
],
[
102,
149
],
[
149,
150
],
[
150,
151
],
[
151,
152
],
[
151,
153
],
[
149,
154
],
[
154,
155
],
[
155,
156
],
[
155,
157
],
[
154,
158
],
[
71,
159
],
[
159,
160
],
[
160,
161
],
[
161,
162
],
[
161,
163
],
[
159,
164
],
[
164,
165
],
[
165,
166
],
[
165,
167
],
[
164,
168
],
[
22,
169
],
[
169,
170
],
[
170,
171
],
[
171,
172
],
[
171,
173
],
[
170,
174
],
[
169,
175
],
[
22,
176
],
[
176,
177
],
[
177,
178
],
[
178,
179
],
[
178,
180
],
[
176,
181
],
[
181,
182
],
[
181,
183
],
[
176,
184
],
[
184,
185
],
[
185,
186
],
[
176,
187
],
[
188,
188
],
[
188,
189
],
[
189,
190
],
[
190,
191
],
[
191,
192
],
[
191,
193
],
[
190,
194
],
[
189,
195
],
[
195,
196
],
[
196,
197
],
[
196,
198
],
[
195,
199
],
[
188,
200
],
[
200,
201
],
[
201,
202
],
[
202,
203
],
[
202,
204
],
[
200,
205
],
[
205,
206
],
[
206,
207
],
[
207,
208
],
[
207,
209
],
[
206,
210
],
[
205,
211
],
[
22,
212
],
[
212,
213
],
[
213,
214
],
[
214,
215
],
[
214,
216
],
[
212,
217
],
[
217,
218
],
[
218,
219
],
[
218,
220
],
[
217,
221
],
[
6,
222
],
[
222,
223
]
] | [
"import java.io.*;\n\nclass Main {\n\tpublic static void main(String[] args) {\n\t\tBufferedReader kb = new BufferedReader( new InputStreamReader( System.in ) );\n\t\ttry {\n\n\t\t\tString str = kb.readLine();\n\t\t\tString[] tmpArray = str.split( \" \" );\n\t\t\tint r=Integer.parseInt( tmpArray[0] );\n\t\t\tint c=Integer.parseInt( tmpArray[1] );\n\t\t\t\n\t\t\tint[][] spredsheet = new int[r+1][c+1];\n\t\t\tfor( int i=0; i<r; i++ ) {\n\t\t\t\tspredsheet[i][c]=0;\n\t\t\t\tstr = kb.readLine();\n\t\t\t\ttmpArray = str.split( \" \" );\n\t\t\t\tfor( int j=0; j<c; j++ ) {\n\t\t\t\t\tif( 0 == i ) { spredsheet[r][j]=0; }\n\t\t\t\t\tspredsheet[i][j]=Integer.parseInt( tmpArray[j] );\n\t\t\t\t\tspredsheet[i][c]+=spredsheet[i][j];\n\t\t\t\t\tspredsheet[r][j]+=spredsheet[i][j];\n\t\t\t\t\tSystem.out.print( tmpArray[j]+\" \" );\t\n\t\t\t\t}\n\t\t\t\tSystem.out.println( spredsheet[i][c] );\n\t\t\t}\n\t\t\tspredsheet[r][c]=0;\n\t\t\tfor( int j=0; j<c; j++ ) {\n\t\t\t\tspredsheet[r][c]+=spredsheet[r][j];\n\t\t\t\tSystem.out.print( spredsheet[r][j]+\" \" );\t\n\t\t\t}\n\t\t\tSystem.out.println( spredsheet[r][c] );\n\t\t\t\n\t\t} catch( IOException e ) {\n\t\t\tSystem.err.println( e );\n\t\t}\n\t}\n}",
"import java.io.*;",
"io.*",
"java",
"class Main {\n\tpublic static void main(String[] args) {\n\t\tBufferedReader kb = new BufferedReader( new InputStreamReader( System.in ) );\n\t\ttry {\n\n\t\t\tString str = kb.readLine();\n\t\t\tString[] tmpArray = str.split( \" \" );\n\t\t\tint r=Integer.parseInt( tmpArray[0] );\n\t\t\tint c=Integer.parseInt( tmpArray[1] );\n\t\t\t\n\t\t\tint[][] spredsheet = new int[r+1][c+1];\n\t\t\tfor( int i=0; i<r; i++ ) {\n\t\t\t\tspredsheet[i][c]=0;\n\t\t\t\tstr = kb.readLine();\n\t\t\t\ttmpArray = str.split( \" \" );\n\t\t\t\tfor( int j=0; j<c; j++ ) {\n\t\t\t\t\tif( 0 == i ) { spredsheet[r][j]=0; }\n\t\t\t\t\tspredsheet[i][j]=Integer.parseInt( tmpArray[j] );\n\t\t\t\t\tspredsheet[i][c]+=spredsheet[i][j];\n\t\t\t\t\tspredsheet[r][j]+=spredsheet[i][j];\n\t\t\t\t\tSystem.out.print( tmpArray[j]+\" \" );\t\n\t\t\t\t}\n\t\t\t\tSystem.out.println( spredsheet[i][c] );\n\t\t\t}\n\t\t\tspredsheet[r][c]=0;\n\t\t\tfor( int j=0; j<c; j++ ) {\n\t\t\t\tspredsheet[r][c]+=spredsheet[r][j];\n\t\t\t\tSystem.out.print( spredsheet[r][j]+\" \" );\t\n\t\t\t}\n\t\t\tSystem.out.println( spredsheet[r][c] );\n\t\t\t\n\t\t} catch( IOException e ) {\n\t\t\tSystem.err.println( e );\n\t\t}\n\t}\n}",
"Main",
"public static void main(String[] args) {\n\t\tBufferedReader kb = new BufferedReader( new InputStreamReader( System.in ) );\n\t\ttry {\n\n\t\t\tString str = kb.readLine();\n\t\t\tString[] tmpArray = str.split( \" \" );\n\t\t\tint r=Integer.parseInt( tmpArray[0] );\n\t\t\tint c=Integer.parseInt( tmpArray[1] );\n\t\t\t\n\t\t\tint[][] spredsheet = new int[r+1][c+1];\n\t\t\tfor( int i=0; i<r; i++ ) {\n\t\t\t\tspredsheet[i][c]=0;\n\t\t\t\tstr = kb.readLine();\n\t\t\t\ttmpArray = str.split( \" \" );\n\t\t\t\tfor( int j=0; j<c; j++ ) {\n\t\t\t\t\tif( 0 == i ) { spredsheet[r][j]=0; }\n\t\t\t\t\tspredsheet[i][j]=Integer.parseInt( tmpArray[j] );\n\t\t\t\t\tspredsheet[i][c]+=spredsheet[i][j];\n\t\t\t\t\tspredsheet[r][j]+=spredsheet[i][j];\n\t\t\t\t\tSystem.out.print( tmpArray[j]+\" \" );\t\n\t\t\t\t}\n\t\t\t\tSystem.out.println( spredsheet[i][c] );\n\t\t\t}\n\t\t\tspredsheet[r][c]=0;\n\t\t\tfor( int j=0; j<c; j++ ) {\n\t\t\t\tspredsheet[r][c]+=spredsheet[r][j];\n\t\t\t\tSystem.out.print( spredsheet[r][j]+\" \" );\t\n\t\t\t}\n\t\t\tSystem.out.println( spredsheet[r][c] );\n\t\t\t\n\t\t} catch( IOException e ) {\n\t\t\tSystem.err.println( e );\n\t\t}\n\t}",
"main",
"{\n\t\tBufferedReader kb = new BufferedReader( new InputStreamReader( System.in ) );\n\t\ttry {\n\n\t\t\tString str = kb.readLine();\n\t\t\tString[] tmpArray = str.split( \" \" );\n\t\t\tint r=Integer.parseInt( tmpArray[0] );\n\t\t\tint c=Integer.parseInt( tmpArray[1] );\n\t\t\t\n\t\t\tint[][] spredsheet = new int[r+1][c+1];\n\t\t\tfor( int i=0; i<r; i++ ) {\n\t\t\t\tspredsheet[i][c]=0;\n\t\t\t\tstr = kb.readLine();\n\t\t\t\ttmpArray = str.split( \" \" );\n\t\t\t\tfor( int j=0; j<c; j++ ) {\n\t\t\t\t\tif( 0 == i ) { spredsheet[r][j]=0; }\n\t\t\t\t\tspredsheet[i][j]=Integer.parseInt( tmpArray[j] );\n\t\t\t\t\tspredsheet[i][c]+=spredsheet[i][j];\n\t\t\t\t\tspredsheet[r][j]+=spredsheet[i][j];\n\t\t\t\t\tSystem.out.print( tmpArray[j]+\" \" );\t\n\t\t\t\t}\n\t\t\t\tSystem.out.println( spredsheet[i][c] );\n\t\t\t}\n\t\t\tspredsheet[r][c]=0;\n\t\t\tfor( int j=0; j<c; j++ ) {\n\t\t\t\tspredsheet[r][c]+=spredsheet[r][j];\n\t\t\t\tSystem.out.print( spredsheet[r][j]+\" \" );\t\n\t\t\t}\n\t\t\tSystem.out.println( spredsheet[r][c] );\n\t\t\t\n\t\t} catch( IOException e ) {\n\t\t\tSystem.err.println( e );\n\t\t}\n\t}",
"BufferedReader kb = new BufferedReader( new InputStreamReader( System.in ) );",
"kb",
"new BufferedReader( new InputStreamReader( System.in ) )",
"try {\n\n\t\t\tString str = kb.readLine();\n\t\t\tString[] tmpArray = str.split( \" \" );\n\t\t\tint r=Integer.parseInt( tmpArray[0] );\n\t\t\tint c=Integer.parseInt( tmpArray[1] );\n\t\t\t\n\t\t\tint[][] spredsheet = new int[r+1][c+1];\n\t\t\tfor( int i=0; i<r; i++ ) {\n\t\t\t\tspredsheet[i][c]=0;\n\t\t\t\tstr = kb.readLine();\n\t\t\t\ttmpArray = str.split( \" \" );\n\t\t\t\tfor( int j=0; j<c; j++ ) {\n\t\t\t\t\tif( 0 == i ) { spredsheet[r][j]=0; }\n\t\t\t\t\tspredsheet[i][j]=Integer.parseInt( tmpArray[j] );\n\t\t\t\t\tspredsheet[i][c]+=spredsheet[i][j];\n\t\t\t\t\tspredsheet[r][j]+=spredsheet[i][j];\n\t\t\t\t\tSystem.out.print( tmpArray[j]+\" \" );\t\n\t\t\t\t}\n\t\t\t\tSystem.out.println( spredsheet[i][c] );\n\t\t\t}\n\t\t\tspredsheet[r][c]=0;\n\t\t\tfor( int j=0; j<c; j++ ) {\n\t\t\t\tspredsheet[r][c]+=spredsheet[r][j];\n\t\t\t\tSystem.out.print( spredsheet[r][j]+\" \" );\t\n\t\t\t}\n\t\t\tSystem.out.println( spredsheet[r][c] );\n\t\t\t\n\t\t} catch( IOException e ) {\n\t\t\tSystem.err.println( e );\n\t\t}",
"catch( IOException e ) {\n\t\t\tSystem.err.println( e );\n\t\t}",
"IOException e",
"{\n\t\t\tSystem.err.println( e );\n\t\t}",
"System.err.println( e )",
"System.err.println",
"System.err",
"System",
"System.err",
"e",
"{\n\n\t\t\tString str = kb.readLine();\n\t\t\tString[] tmpArray = str.split( \" \" );\n\t\t\tint r=Integer.parseInt( tmpArray[0] );\n\t\t\tint c=Integer.parseInt( tmpArray[1] );\n\t\t\t\n\t\t\tint[][] spredsheet = new int[r+1][c+1];\n\t\t\tfor( int i=0; i<r; i++ ) {\n\t\t\t\tspredsheet[i][c]=0;\n\t\t\t\tstr = kb.readLine();\n\t\t\t\ttmpArray = str.split( \" \" );\n\t\t\t\tfor( int j=0; j<c; j++ ) {\n\t\t\t\t\tif( 0 == i ) { spredsheet[r][j]=0; }\n\t\t\t\t\tspredsheet[i][j]=Integer.parseInt( tmpArray[j] );\n\t\t\t\t\tspredsheet[i][c]+=spredsheet[i][j];\n\t\t\t\t\tspredsheet[r][j]+=spredsheet[i][j];\n\t\t\t\t\tSystem.out.print( tmpArray[j]+\" \" );\t\n\t\t\t\t}\n\t\t\t\tSystem.out.println( spredsheet[i][c] );\n\t\t\t}\n\t\t\tspredsheet[r][c]=0;\n\t\t\tfor( int j=0; j<c; j++ ) {\n\t\t\t\tspredsheet[r][c]+=spredsheet[r][j];\n\t\t\t\tSystem.out.print( spredsheet[r][j]+\" \" );\t\n\t\t\t}\n\t\t\tSystem.out.println( spredsheet[r][c] );\n\t\t\t\n\t\t}",
"String str = kb.readLine();",
"str",
"kb.readLine()",
"kb.readLine",
"kb",
"String[] tmpArray = str.split( \" \" );",
"tmpArray",
"str.split( \" \" )",
"str.split",
"str",
"\" \"",
"int r=Integer.parseInt( tmpArray[0] );",
"r",
"Integer.parseInt( tmpArray[0] )",
"Integer.parseInt",
"Integer",
"tmpArray[0]",
"tmpArray",
"0",
"int c=Integer.parseInt( tmpArray[1] );",
"c",
"Integer.parseInt( tmpArray[1] )",
"Integer.parseInt",
"Integer",
"tmpArray[1]",
"tmpArray",
"1",
"int[][] spredsheet = new int[r+1][c+1];",
"spredsheet",
"new int[r+1][c+1]",
"r+1",
"r",
"1",
"c+1",
"c",
"1",
"for( int i=0; i<r; i++ ) {\n\t\t\t\tspredsheet[i][c]=0;\n\t\t\t\tstr = kb.readLine();\n\t\t\t\ttmpArray = str.split( \" \" );\n\t\t\t\tfor( int j=0; j<c; j++ ) {\n\t\t\t\t\tif( 0 == i ) { spredsheet[r][j]=0; }\n\t\t\t\t\tspredsheet[i][j]=Integer.parseInt( tmpArray[j] );\n\t\t\t\t\tspredsheet[i][c]+=spredsheet[i][j];\n\t\t\t\t\tspredsheet[r][j]+=spredsheet[i][j];\n\t\t\t\t\tSystem.out.print( tmpArray[j]+\" \" );\t\n\t\t\t\t}\n\t\t\t\tSystem.out.println( spredsheet[i][c] );\n\t\t\t}",
"int i=0;",
"int i=0;",
"i",
"0",
"i<r",
"i",
"r",
"i++",
"i++",
"i",
"{\n\t\t\t\tspredsheet[i][c]=0;\n\t\t\t\tstr = kb.readLine();\n\t\t\t\ttmpArray = str.split( \" \" );\n\t\t\t\tfor( int j=0; j<c; j++ ) {\n\t\t\t\t\tif( 0 == i ) { spredsheet[r][j]=0; }\n\t\t\t\t\tspredsheet[i][j]=Integer.parseInt( tmpArray[j] );\n\t\t\t\t\tspredsheet[i][c]+=spredsheet[i][j];\n\t\t\t\t\tspredsheet[r][j]+=spredsheet[i][j];\n\t\t\t\t\tSystem.out.print( tmpArray[j]+\" \" );\t\n\t\t\t\t}\n\t\t\t\tSystem.out.println( spredsheet[i][c] );\n\t\t\t}",
"{\n\t\t\t\tspredsheet[i][c]=0;\n\t\t\t\tstr = kb.readLine();\n\t\t\t\ttmpArray = str.split( \" \" );\n\t\t\t\tfor( int j=0; j<c; j++ ) {\n\t\t\t\t\tif( 0 == i ) { spredsheet[r][j]=0; }\n\t\t\t\t\tspredsheet[i][j]=Integer.parseInt( tmpArray[j] );\n\t\t\t\t\tspredsheet[i][c]+=spredsheet[i][j];\n\t\t\t\t\tspredsheet[r][j]+=spredsheet[i][j];\n\t\t\t\t\tSystem.out.print( tmpArray[j]+\" \" );\t\n\t\t\t\t}\n\t\t\t\tSystem.out.println( spredsheet[i][c] );\n\t\t\t}",
"spredsheet[i][c]=0",
"spredsheet[i][c]",
"spredsheet[i]",
"spredsheet",
"i",
"c",
"0",
"str = kb.readLine()",
"str",
"kb.readLine()",
"kb.readLine",
"kb",
"tmpArray = str.split( \" \" )",
"tmpArray",
"str.split( \" \" )",
"str.split",
"str",
"\" \"",
"for( int j=0; j<c; j++ ) {\n\t\t\t\t\tif( 0 == i ) { spredsheet[r][j]=0; }\n\t\t\t\t\tspredsheet[i][j]=Integer.parseInt( tmpArray[j] );\n\t\t\t\t\tspredsheet[i][c]+=spredsheet[i][j];\n\t\t\t\t\tspredsheet[r][j]+=spredsheet[i][j];\n\t\t\t\t\tSystem.out.print( tmpArray[j]+\" \" );\t\n\t\t\t\t}",
"int j=0;",
"int j=0;",
"j",
"0",
"j<c",
"j",
"c",
"j++",
"j++",
"j",
"{\n\t\t\t\t\tif( 0 == i ) { spredsheet[r][j]=0; }\n\t\t\t\t\tspredsheet[i][j]=Integer.parseInt( tmpArray[j] );\n\t\t\t\t\tspredsheet[i][c]+=spredsheet[i][j];\n\t\t\t\t\tspredsheet[r][j]+=spredsheet[i][j];\n\t\t\t\t\tSystem.out.print( tmpArray[j]+\" \" );\t\n\t\t\t\t}",
"{\n\t\t\t\t\tif( 0 == i ) { spredsheet[r][j]=0; }\n\t\t\t\t\tspredsheet[i][j]=Integer.parseInt( tmpArray[j] );\n\t\t\t\t\tspredsheet[i][c]+=spredsheet[i][j];\n\t\t\t\t\tspredsheet[r][j]+=spredsheet[i][j];\n\t\t\t\t\tSystem.out.print( tmpArray[j]+\" \" );\t\n\t\t\t\t}",
"if( 0 == i ) { spredsheet[r][j]=0; }",
"0 == i",
"0",
"i",
"{ spredsheet[r][j]=0; }",
"spredsheet[r][j]=0",
"spredsheet[r][j]",
"spredsheet[r]",
"spredsheet",
"r",
"j",
"0",
"spredsheet[i][j]=Integer.parseInt( tmpArray[j] )",
"spredsheet[i][j]",
"spredsheet[i]",
"spredsheet",
"i",
"j",
"Integer.parseInt( tmpArray[j] )",
"Integer.parseInt",
"Integer",
"tmpArray[j]",
"tmpArray",
"j",
"spredsheet[i][c]+=spredsheet[i][j]",
"spredsheet[i][c]",
"spredsheet[i]",
"spredsheet",
"i",
"c",
"spredsheet[i][j]",
"spredsheet[i]",
"spredsheet",
"i",
"j",
"spredsheet[r][j]+=spredsheet[i][j]",
"spredsheet[r][j]",
"spredsheet[r]",
"spredsheet",
"r",
"j",
"spredsheet[i][j]",
"spredsheet[i]",
"spredsheet",
"i",
"j",
"System.out.print( tmpArray[j]+\" \" )",
"System.out.print",
"System.out",
"System",
"System.out",
"tmpArray[j]+\" \"",
"tmpArray[j]",
"tmpArray",
"j",
"\" \"",
"System.out.println( spredsheet[i][c] )",
"System.out.println",
"System.out",
"System",
"System.out",
"spredsheet[i][c]",
"spredsheet[i]",
"spredsheet",
"i",
"c",
"spredsheet[r][c]=0",
"spredsheet[r][c]",
"spredsheet[r]",
"spredsheet",
"r",
"c",
"0",
"for( int j=0; j<c; j++ ) {\n\t\t\t\tspredsheet[r][c]+=spredsheet[r][j];\n\t\t\t\tSystem.out.print( spredsheet[r][j]+\" \" );\t\n\t\t\t}",
"int j=0;",
"int j=0;",
"j",
"0",
"j<c",
"j",
"c",
"j++",
"j++",
"j",
"{\n\t\t\t\tspredsheet[r][c]+=spredsheet[r][j];\n\t\t\t\tSystem.out.print( spredsheet[r][j]+\" \" );\t\n\t\t\t}",
"{\n\t\t\t\tspredsheet[r][c]+=spredsheet[r][j];\n\t\t\t\tSystem.out.print( spredsheet[r][j]+\" \" );\t\n\t\t\t}",
"spredsheet[r][c]+=spredsheet[r][j]",
"spredsheet[r][c]",
"spredsheet[r]",
"spredsheet",
"r",
"c",
"spredsheet[r][j]",
"spredsheet[r]",
"spredsheet",
"r",
"j",
"System.out.print( spredsheet[r][j]+\" \" )",
"System.out.print",
"System.out",
"System",
"System.out",
"spredsheet[r][j]+\" \"",
"spredsheet[r][j]",
"spredsheet[r]",
"spredsheet",
"r",
"j",
"\" \"",
"System.out.println( spredsheet[r][c] )",
"System.out.println",
"System.out",
"System",
"System.out",
"spredsheet[r][c]",
"spredsheet[r]",
"spredsheet",
"r",
"c",
"String[] args",
"args"
] | import java.io.*;
class Main {
public static void main(String[] args) {
BufferedReader kb = new BufferedReader( new InputStreamReader( System.in ) );
try {
String str = kb.readLine();
String[] tmpArray = str.split( " " );
int r=Integer.parseInt( tmpArray[0] );
int c=Integer.parseInt( tmpArray[1] );
int[][] spredsheet = new int[r+1][c+1];
for( int i=0; i<r; i++ ) {
spredsheet[i][c]=0;
str = kb.readLine();
tmpArray = str.split( " " );
for( int j=0; j<c; j++ ) {
if( 0 == i ) { spredsheet[r][j]=0; }
spredsheet[i][j]=Integer.parseInt( tmpArray[j] );
spredsheet[i][c]+=spredsheet[i][j];
spredsheet[r][j]+=spredsheet[i][j];
System.out.print( tmpArray[j]+" " );
}
System.out.println( spredsheet[i][c] );
}
spredsheet[r][c]=0;
for( int j=0; j<c; j++ ) {
spredsheet[r][c]+=spredsheet[r][j];
System.out.print( spredsheet[r][j]+" " );
}
System.out.println( spredsheet[r][c] );
} catch( IOException e ) {
System.err.println( e );
}
}
} |
[
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,
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,
18,
13,
41,
13,
20,
13,
41,
13,
20,
13,
41,
13,
17,
4,
18,
13,
13,
17,
4,
18,
13,
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,
18,
18,
13,
13,
13,
0,
18,
13,
13,
18,
18,
13,
13,
13,
0,
18,
13,
13,
18,
18,
13,
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,
4,
18,
18,
13,
13,
2,
2,
17,
18,
18,
13,
13,
13,
17,
4,
18,
18,
13,
13,
2,
17,
18,
13,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
4,
18,
18,
13,
13,
2,
2,
17,
18,
13,
13,
17,
4,
18,
18,
13,
13,
13,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
221,
8
],
[
221,
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
],
[
11,
25
],
[
25,
26
],
[
25,
27
],
[
11,
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
],
[
57,
61
],
[
56,
62
],
[
62,
63
],
[
63,
64
],
[
11,
65
],
[
65,
66
],
[
65,
67
],
[
11,
69
],
[
69,
70
],
[
69,
71
],
[
11,
73
],
[
73,
74
],
[
73,
75
],
[
11,
76
],
[
76,
77
],
[
77,
78
],
[
76,
79
],
[
76,
80
],
[
11,
81
],
[
81,
82
],
[
82,
83
],
[
81,
84
],
[
81,
85
],
[
11,
86
],
[
86,
87
],
[
87,
88
],
[
88,
89
],
[
88,
90
],
[
86,
91
],
[
91,
92
],
[
91,
93
],
[
86,
94
],
[
94,
95
],
[
95,
96
],
[
86,
97
],
[
98,
98
],
[
98,
99
],
[
99,
100
],
[
100,
101
],
[
101,
102
],
[
101,
103
],
[
99,
104
],
[
104,
105
],
[
104,
106
],
[
99,
107
],
[
107,
108
],
[
108,
109
],
[
99,
110
],
[
111,
111
],
[
111,
112
],
[
112,
113
],
[
112,
114
],
[
114,
115
],
[
115,
116
],
[
115,
117
],
[
114,
118
],
[
111,
119
],
[
119,
120
],
[
120,
121
],
[
120,
122
],
[
119,
123
],
[
123,
124
],
[
124,
125
],
[
124,
126
],
[
123,
127
],
[
111,
128
],
[
128,
129
],
[
129,
130
],
[
129,
131
],
[
128,
132
],
[
132,
133
],
[
133,
134
],
[
133,
135
],
[
132,
136
],
[
11,
137
],
[
137,
138
],
[
138,
139
],
[
139,
140
],
[
139,
141
],
[
137,
142
],
[
142,
143
],
[
142,
144
],
[
137,
145
],
[
145,
146
],
[
146,
147
],
[
137,
148
],
[
149,
149
],
[
149,
150
],
[
150,
151
],
[
151,
152
],
[
152,
153
],
[
152,
154
],
[
150,
155
],
[
155,
156
],
[
155,
157
],
[
150,
158
],
[
158,
159
],
[
159,
160
],
[
150,
161
],
[
162,
162
],
[
162,
163
],
[
163,
164
],
[
164,
165
],
[
165,
166
],
[
165,
167
],
[
163,
168
],
[
169,
169
],
[
169,
170
],
[
169,
171
],
[
171,
172
],
[
172,
173
],
[
172,
174
],
[
171,
175
],
[
169,
176
],
[
149,
177
],
[
177,
178
],
[
178,
179
],
[
179,
180
],
[
179,
181
],
[
177,
182
],
[
182,
183
],
[
182,
184
],
[
184,
185
],
[
184,
186
],
[
11,
187
],
[
187,
188
],
[
188,
189
],
[
189,
190
],
[
189,
191
],
[
187,
192
],
[
192,
193
],
[
192,
194
],
[
187,
195
],
[
195,
196
],
[
196,
197
],
[
187,
198
],
[
199,
199
],
[
199,
200
],
[
200,
201
],
[
201,
202
],
[
202,
203
],
[
202,
204
],
[
200,
205
],
[
206,
206
],
[
206,
207
],
[
206,
208
],
[
208,
209
],
[
208,
210
],
[
206,
211
],
[
11,
212
],
[
212,
213
],
[
213,
214
],
[
214,
215
],
[
214,
216
],
[
212,
217
],
[
9,
218
],
[
218,
219
],
[
0,
220
],
[
220,
221
],
[
220,
222
]
] | [
"import java.util.Scanner;\nimport java.util.Arrays;\n\npublic class Main {\n\tpublic static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\tint row = sc.nextInt();\n\t\tint col = sc.nextInt();\n\t\tint[][] table = new int[row][col];\n\t\tfor(int i = 0; i < row; i++) {\n\t\t\tfor(int j = 0; j < col; j++) {\n\t\t\t\ttable[i][j] = sc.nextInt();\n\t\t\t}\n\t\t}\n\t\tint[] rowSum = new int[row];\n\t\tint[] colSum = new int[col];\n\t\tint sum = 0;\n\t\tArrays.fill(rowSum, 0);\n\t\tArrays.fill(colSum, 0);\n\t\tfor(int i = 0; i < row; i++) {\n\t\t\tfor(int j = 0; j < col; j++) {\n\t\t\t\tsum += table[i][j];\n\t\t\t\trowSum[i] += table[i][j];\n\t\t\t\tcolSum[j] += table[i][j];\n\t\t\t}\n\t\t}\n\t\tfor(int i = 0; i < row; i++) {\n\t\t\tfor(int j = 0; j < col; j++) {\n\t\t\t\tSystem.out.print(\"\" + table[i][j] + \" \");\n\t\t\t}\n\t\t\tSystem.out.println(\"\" + rowSum[i]);\n\t\t}\n\t\tfor(int j = 0; j < col; j++) {\n\t\t\tSystem.out.print(\"\" + colSum[j] + \" \");\n\t\t}\n\t\tSystem.out.println(sum);\n\t}\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"import java.util.Arrays;",
"Arrays",
"java.util",
"public class Main {\n\tpublic static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\tint row = sc.nextInt();\n\t\tint col = sc.nextInt();\n\t\tint[][] table = new int[row][col];\n\t\tfor(int i = 0; i < row; i++) {\n\t\t\tfor(int j = 0; j < col; j++) {\n\t\t\t\ttable[i][j] = sc.nextInt();\n\t\t\t}\n\t\t}\n\t\tint[] rowSum = new int[row];\n\t\tint[] colSum = new int[col];\n\t\tint sum = 0;\n\t\tArrays.fill(rowSum, 0);\n\t\tArrays.fill(colSum, 0);\n\t\tfor(int i = 0; i < row; i++) {\n\t\t\tfor(int j = 0; j < col; j++) {\n\t\t\t\tsum += table[i][j];\n\t\t\t\trowSum[i] += table[i][j];\n\t\t\t\tcolSum[j] += table[i][j];\n\t\t\t}\n\t\t}\n\t\tfor(int i = 0; i < row; i++) {\n\t\t\tfor(int j = 0; j < col; j++) {\n\t\t\t\tSystem.out.print(\"\" + table[i][j] + \" \");\n\t\t\t}\n\t\t\tSystem.out.println(\"\" + rowSum[i]);\n\t\t}\n\t\tfor(int j = 0; j < col; j++) {\n\t\t\tSystem.out.print(\"\" + colSum[j] + \" \");\n\t\t}\n\t\tSystem.out.println(sum);\n\t}\n}",
"Main",
"public static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\tint row = sc.nextInt();\n\t\tint col = sc.nextInt();\n\t\tint[][] table = new int[row][col];\n\t\tfor(int i = 0; i < row; i++) {\n\t\t\tfor(int j = 0; j < col; j++) {\n\t\t\t\ttable[i][j] = sc.nextInt();\n\t\t\t}\n\t\t}\n\t\tint[] rowSum = new int[row];\n\t\tint[] colSum = new int[col];\n\t\tint sum = 0;\n\t\tArrays.fill(rowSum, 0);\n\t\tArrays.fill(colSum, 0);\n\t\tfor(int i = 0; i < row; i++) {\n\t\t\tfor(int j = 0; j < col; j++) {\n\t\t\t\tsum += table[i][j];\n\t\t\t\trowSum[i] += table[i][j];\n\t\t\t\tcolSum[j] += table[i][j];\n\t\t\t}\n\t\t}\n\t\tfor(int i = 0; i < row; i++) {\n\t\t\tfor(int j = 0; j < col; j++) {\n\t\t\t\tSystem.out.print(\"\" + table[i][j] + \" \");\n\t\t\t}\n\t\t\tSystem.out.println(\"\" + rowSum[i]);\n\t\t}\n\t\tfor(int j = 0; j < col; j++) {\n\t\t\tSystem.out.print(\"\" + colSum[j] + \" \");\n\t\t}\n\t\tSystem.out.println(sum);\n\t}",
"main",
"{\n\t\tScanner sc = new Scanner(System.in);\n\t\tint row = sc.nextInt();\n\t\tint col = sc.nextInt();\n\t\tint[][] table = new int[row][col];\n\t\tfor(int i = 0; i < row; i++) {\n\t\t\tfor(int j = 0; j < col; j++) {\n\t\t\t\ttable[i][j] = sc.nextInt();\n\t\t\t}\n\t\t}\n\t\tint[] rowSum = new int[row];\n\t\tint[] colSum = new int[col];\n\t\tint sum = 0;\n\t\tArrays.fill(rowSum, 0);\n\t\tArrays.fill(colSum, 0);\n\t\tfor(int i = 0; i < row; i++) {\n\t\t\tfor(int j = 0; j < col; j++) {\n\t\t\t\tsum += table[i][j];\n\t\t\t\trowSum[i] += table[i][j];\n\t\t\t\tcolSum[j] += table[i][j];\n\t\t\t}\n\t\t}\n\t\tfor(int i = 0; i < row; i++) {\n\t\t\tfor(int j = 0; j < col; j++) {\n\t\t\t\tSystem.out.print(\"\" + table[i][j] + \" \");\n\t\t\t}\n\t\t\tSystem.out.println(\"\" + rowSum[i]);\n\t\t}\n\t\tfor(int j = 0; j < col; j++) {\n\t\t\tSystem.out.print(\"\" + colSum[j] + \" \");\n\t\t}\n\t\tSystem.out.println(sum);\n\t}",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"int row = sc.nextInt();",
"row",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int col = sc.nextInt();",
"col",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int[][] table = new int[row][col];",
"table",
"new int[row][col]",
"row",
"col",
"for(int i = 0; i < row; i++) {\n\t\t\tfor(int j = 0; j < col; j++) {\n\t\t\t\ttable[i][j] = sc.nextInt();\n\t\t\t}\n\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < row",
"i",
"row",
"i++",
"i++",
"i",
"{\n\t\t\tfor(int j = 0; j < col; j++) {\n\t\t\t\ttable[i][j] = sc.nextInt();\n\t\t\t}\n\t\t}",
"{\n\t\t\tfor(int j = 0; j < col; j++) {\n\t\t\t\ttable[i][j] = sc.nextInt();\n\t\t\t}\n\t\t}",
"for(int j = 0; j < col; j++) {\n\t\t\t\ttable[i][j] = sc.nextInt();\n\t\t\t}",
"int j = 0;",
"int j = 0;",
"j",
"0",
"j < col",
"j",
"col",
"j++",
"j++",
"j",
"{\n\t\t\t\ttable[i][j] = sc.nextInt();\n\t\t\t}",
"{\n\t\t\t\ttable[i][j] = sc.nextInt();\n\t\t\t}",
"table[i][j] = sc.nextInt()",
"table[i][j]",
"table[i]",
"table",
"i",
"j",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int[] rowSum = new int[row];",
"rowSum",
"new int[row]",
"row",
"int[] colSum = new int[col];",
"colSum",
"new int[col]",
"col",
"int sum = 0;",
"sum",
"0",
"Arrays.fill(rowSum, 0)",
"Arrays.fill",
"Arrays",
"rowSum",
"0",
"Arrays.fill(colSum, 0)",
"Arrays.fill",
"Arrays",
"colSum",
"0",
"for(int i = 0; i < row; i++) {\n\t\t\tfor(int j = 0; j < col; j++) {\n\t\t\t\tsum += table[i][j];\n\t\t\t\trowSum[i] += table[i][j];\n\t\t\t\tcolSum[j] += table[i][j];\n\t\t\t}\n\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < row",
"i",
"row",
"i++",
"i++",
"i",
"{\n\t\t\tfor(int j = 0; j < col; j++) {\n\t\t\t\tsum += table[i][j];\n\t\t\t\trowSum[i] += table[i][j];\n\t\t\t\tcolSum[j] += table[i][j];\n\t\t\t}\n\t\t}",
"{\n\t\t\tfor(int j = 0; j < col; j++) {\n\t\t\t\tsum += table[i][j];\n\t\t\t\trowSum[i] += table[i][j];\n\t\t\t\tcolSum[j] += table[i][j];\n\t\t\t}\n\t\t}",
"for(int j = 0; j < col; j++) {\n\t\t\t\tsum += table[i][j];\n\t\t\t\trowSum[i] += table[i][j];\n\t\t\t\tcolSum[j] += table[i][j];\n\t\t\t}",
"int j = 0;",
"int j = 0;",
"j",
"0",
"j < col",
"j",
"col",
"j++",
"j++",
"j",
"{\n\t\t\t\tsum += table[i][j];\n\t\t\t\trowSum[i] += table[i][j];\n\t\t\t\tcolSum[j] += table[i][j];\n\t\t\t}",
"{\n\t\t\t\tsum += table[i][j];\n\t\t\t\trowSum[i] += table[i][j];\n\t\t\t\tcolSum[j] += table[i][j];\n\t\t\t}",
"sum += table[i][j]",
"sum",
"table[i][j]",
"table[i]",
"table",
"i",
"j",
"rowSum[i] += table[i][j]",
"rowSum[i]",
"rowSum",
"i",
"table[i][j]",
"table[i]",
"table",
"i",
"j",
"colSum[j] += table[i][j]",
"colSum[j]",
"colSum",
"j",
"table[i][j]",
"table[i]",
"table",
"i",
"j",
"for(int i = 0; i < row; i++) {\n\t\t\tfor(int j = 0; j < col; j++) {\n\t\t\t\tSystem.out.print(\"\" + table[i][j] + \" \");\n\t\t\t}\n\t\t\tSystem.out.println(\"\" + rowSum[i]);\n\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < row",
"i",
"row",
"i++",
"i++",
"i",
"{\n\t\t\tfor(int j = 0; j < col; j++) {\n\t\t\t\tSystem.out.print(\"\" + table[i][j] + \" \");\n\t\t\t}\n\t\t\tSystem.out.println(\"\" + rowSum[i]);\n\t\t}",
"{\n\t\t\tfor(int j = 0; j < col; j++) {\n\t\t\t\tSystem.out.print(\"\" + table[i][j] + \" \");\n\t\t\t}\n\t\t\tSystem.out.println(\"\" + rowSum[i]);\n\t\t}",
"for(int j = 0; j < col; j++) {\n\t\t\t\tSystem.out.print(\"\" + table[i][j] + \" \");\n\t\t\t}",
"int j = 0;",
"int j = 0;",
"j",
"0",
"j < col",
"j",
"col",
"j++",
"j++",
"j",
"{\n\t\t\t\tSystem.out.print(\"\" + table[i][j] + \" \");\n\t\t\t}",
"{\n\t\t\t\tSystem.out.print(\"\" + table[i][j] + \" \");\n\t\t\t}",
"System.out.print(\"\" + table[i][j] + \" \")",
"System.out.print",
"System.out",
"System",
"System.out",
"\"\" + table[i][j] + \" \"",
"\"\" + table[i][j] + \" \"",
"\"\"",
"table[i][j]",
"table[i]",
"table",
"i",
"j",
"\" \"",
"System.out.println(\"\" + rowSum[i])",
"System.out.println",
"System.out",
"System",
"System.out",
"\"\" + rowSum[i]",
"\"\"",
"rowSum[i]",
"rowSum",
"i",
"for(int j = 0; j < col; j++) {\n\t\t\tSystem.out.print(\"\" + colSum[j] + \" \");\n\t\t}",
"int j = 0;",
"int j = 0;",
"j",
"0",
"j < col",
"j",
"col",
"j++",
"j++",
"j",
"{\n\t\t\tSystem.out.print(\"\" + colSum[j] + \" \");\n\t\t}",
"{\n\t\t\tSystem.out.print(\"\" + colSum[j] + \" \");\n\t\t}",
"System.out.print(\"\" + colSum[j] + \" \")",
"System.out.print",
"System.out",
"System",
"System.out",
"\"\" + colSum[j] + \" \"",
"\"\" + colSum[j] + \" \"",
"\"\"",
"colSum[j]",
"colSum",
"j",
"\" \"",
"System.out.println(sum)",
"System.out.println",
"System.out",
"System",
"System.out",
"sum",
"String[] args",
"args",
"public class Main {\n\tpublic static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\tint row = sc.nextInt();\n\t\tint col = sc.nextInt();\n\t\tint[][] table = new int[row][col];\n\t\tfor(int i = 0; i < row; i++) {\n\t\t\tfor(int j = 0; j < col; j++) {\n\t\t\t\ttable[i][j] = sc.nextInt();\n\t\t\t}\n\t\t}\n\t\tint[] rowSum = new int[row];\n\t\tint[] colSum = new int[col];\n\t\tint sum = 0;\n\t\tArrays.fill(rowSum, 0);\n\t\tArrays.fill(colSum, 0);\n\t\tfor(int i = 0; i < row; i++) {\n\t\t\tfor(int j = 0; j < col; j++) {\n\t\t\t\tsum += table[i][j];\n\t\t\t\trowSum[i] += table[i][j];\n\t\t\t\tcolSum[j] += table[i][j];\n\t\t\t}\n\t\t}\n\t\tfor(int i = 0; i < row; i++) {\n\t\t\tfor(int j = 0; j < col; j++) {\n\t\t\t\tSystem.out.print(\"\" + table[i][j] + \" \");\n\t\t\t}\n\t\t\tSystem.out.println(\"\" + rowSum[i]);\n\t\t}\n\t\tfor(int j = 0; j < col; j++) {\n\t\t\tSystem.out.print(\"\" + colSum[j] + \" \");\n\t\t}\n\t\tSystem.out.println(sum);\n\t}\n}",
"public class Main {\n\tpublic static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\tint row = sc.nextInt();\n\t\tint col = sc.nextInt();\n\t\tint[][] table = new int[row][col];\n\t\tfor(int i = 0; i < row; i++) {\n\t\t\tfor(int j = 0; j < col; j++) {\n\t\t\t\ttable[i][j] = sc.nextInt();\n\t\t\t}\n\t\t}\n\t\tint[] rowSum = new int[row];\n\t\tint[] colSum = new int[col];\n\t\tint sum = 0;\n\t\tArrays.fill(rowSum, 0);\n\t\tArrays.fill(colSum, 0);\n\t\tfor(int i = 0; i < row; i++) {\n\t\t\tfor(int j = 0; j < col; j++) {\n\t\t\t\tsum += table[i][j];\n\t\t\t\trowSum[i] += table[i][j];\n\t\t\t\tcolSum[j] += table[i][j];\n\t\t\t}\n\t\t}\n\t\tfor(int i = 0; i < row; i++) {\n\t\t\tfor(int j = 0; j < col; j++) {\n\t\t\t\tSystem.out.print(\"\" + table[i][j] + \" \");\n\t\t\t}\n\t\t\tSystem.out.println(\"\" + rowSum[i]);\n\t\t}\n\t\tfor(int j = 0; j < col; j++) {\n\t\t\tSystem.out.print(\"\" + colSum[j] + \" \");\n\t\t}\n\t\tSystem.out.println(sum);\n\t}\n}",
"Main"
] | import java.util.Scanner;
import java.util.Arrays;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int row = sc.nextInt();
int col = sc.nextInt();
int[][] table = new int[row][col];
for(int i = 0; i < row; i++) {
for(int j = 0; j < col; j++) {
table[i][j] = sc.nextInt();
}
}
int[] rowSum = new int[row];
int[] colSum = new int[col];
int sum = 0;
Arrays.fill(rowSum, 0);
Arrays.fill(colSum, 0);
for(int i = 0; i < row; i++) {
for(int j = 0; j < col; j++) {
sum += table[i][j];
rowSum[i] += table[i][j];
colSum[j] += table[i][j];
}
}
for(int i = 0; i < row; i++) {
for(int j = 0; j < col; j++) {
System.out.print("" + table[i][j] + " ");
}
System.out.println("" + rowSum[i]);
}
for(int j = 0; j < col; j++) {
System.out.print("" + colSum[j] + " ");
}
System.out.println(sum);
}
} |
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
41,
13,
20,
2,
13,
17,
11,
1,
41,
13,
17,
2,
13,
2,
13,
17,
1,
40,
13,
30,
30,
0,
18,
13,
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,
41,
13,
4,
18,
13,
0,
13,
13,
0,
18,
13,
13,
13,
4,
18,
18,
13,
13,
2,
13,
17,
4,
18,
18,
13,
13,
13,
0,
18,
13,
13,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
4,
18,
18,
13,
13,
2,
18,
13,
13,
17,
4,
18,
18,
13,
13,
18,
13,
13,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
143,
5
],
[
143,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
8,
17
],
[
17,
18
],
[
17,
19
],
[
19,
20
],
[
20,
21
],
[
8,
22
],
[
22,
23
],
[
22,
24
],
[
25,
26
],
[
25,
27
],
[
8,
28
],
[
28,
29
],
[
29,
30
],
[
30,
31
],
[
30,
32
],
[
28,
33
],
[
33,
34
],
[
33,
35
],
[
35,
36
],
[
35,
37
],
[
28,
38
],
[
38,
39
],
[
39,
40
],
[
28,
41
],
[
42,
42
],
[
42,
43
],
[
43,
44
],
[
44,
45
],
[
44,
46
],
[
43,
47
],
[
8,
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
],
[
60,
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
],
[
77,
79
],
[
79,
80
],
[
80,
81
],
[
76,
82
],
[
82,
83
],
[
82,
84
],
[
76,
85
],
[
85,
86
],
[
86,
87
],
[
86,
88
],
[
85,
89
],
[
76,
90
],
[
90,
91
],
[
91,
92
],
[
92,
93
],
[
92,
94
],
[
90,
95
],
[
95,
96
],
[
95,
97
],
[
60,
98
],
[
98,
99
],
[
99,
100
],
[
100,
101
],
[
100,
102
],
[
98,
103
],
[
60,
104
],
[
104,
105
],
[
105,
106
],
[
105,
107
],
[
104,
108
],
[
8,
109
],
[
109,
110
],
[
110,
111
],
[
111,
112
],
[
111,
113
],
[
109,
114
],
[
114,
115
],
[
114,
116
],
[
109,
117
],
[
117,
118
],
[
118,
119
],
[
109,
120
],
[
121,
121
],
[
121,
122
],
[
122,
123
],
[
123,
124
],
[
124,
125
],
[
124,
126
],
[
122,
127
],
[
127,
128
],
[
128,
129
],
[
128,
130
],
[
127,
131
],
[
8,
132
],
[
132,
133
],
[
133,
134
],
[
134,
135
],
[
134,
136
],
[
132,
137
],
[
137,
138
],
[
137,
139
],
[
6,
140
],
[
140,
141
],
[
0,
142
],
[
142,
143
],
[
142,
144
]
] | [
"import java.util.*;\n\npublic class Main {\n\tpublic static void main(String[] args){\n\t\tScanner sc = new Scanner(System.in);\n\t\tint r = sc.nextInt();\n\t\tint c = sc.nextInt();\n\t\tint[] cs=new int[c+1];\n\t\tfor(int i=0;i<c+1;i++){\n\t\t\tcs[i]=0;\n\t\t}\n\t\tfor(int i=0;i<r;i++){\n\t\t\tint rs=0;\n\t\t\tfor(int j=0;j<c;j++){\n\t\t\t\tint a=sc.nextInt();\n\t\t\t\trs+=a;\n\t\t\t\tcs[j]+=a;\n\t\t\t\tSystem.out.print(a+\" \");\n\t\t\t}\n\t\t\tSystem.out.println(rs);\n\t\t\tcs[c]+=rs;\n\t\t}\n\t\tfor(int i=0;i<c;i++){\n\t\t\tSystem.out.print(cs[i]+\" \");\n\t\t}\n\t\tSystem.out.println(cs[c]);\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 r = sc.nextInt();\n\t\tint c = sc.nextInt();\n\t\tint[] cs=new int[c+1];\n\t\tfor(int i=0;i<c+1;i++){\n\t\t\tcs[i]=0;\n\t\t}\n\t\tfor(int i=0;i<r;i++){\n\t\t\tint rs=0;\n\t\t\tfor(int j=0;j<c;j++){\n\t\t\t\tint a=sc.nextInt();\n\t\t\t\trs+=a;\n\t\t\t\tcs[j]+=a;\n\t\t\t\tSystem.out.print(a+\" \");\n\t\t\t}\n\t\t\tSystem.out.println(rs);\n\t\t\tcs[c]+=rs;\n\t\t}\n\t\tfor(int i=0;i<c;i++){\n\t\t\tSystem.out.print(cs[i]+\" \");\n\t\t}\n\t\tSystem.out.println(cs[c]);\n\t}\n}",
"Main",
"public static void main(String[] args){\n\t\tScanner sc = new Scanner(System.in);\n\t\tint r = sc.nextInt();\n\t\tint c = sc.nextInt();\n\t\tint[] cs=new int[c+1];\n\t\tfor(int i=0;i<c+1;i++){\n\t\t\tcs[i]=0;\n\t\t}\n\t\tfor(int i=0;i<r;i++){\n\t\t\tint rs=0;\n\t\t\tfor(int j=0;j<c;j++){\n\t\t\t\tint a=sc.nextInt();\n\t\t\t\trs+=a;\n\t\t\t\tcs[j]+=a;\n\t\t\t\tSystem.out.print(a+\" \");\n\t\t\t}\n\t\t\tSystem.out.println(rs);\n\t\t\tcs[c]+=rs;\n\t\t}\n\t\tfor(int i=0;i<c;i++){\n\t\t\tSystem.out.print(cs[i]+\" \");\n\t\t}\n\t\tSystem.out.println(cs[c]);\n\t}",
"main",
"{\n\t\tScanner sc = new Scanner(System.in);\n\t\tint r = sc.nextInt();\n\t\tint c = sc.nextInt();\n\t\tint[] cs=new int[c+1];\n\t\tfor(int i=0;i<c+1;i++){\n\t\t\tcs[i]=0;\n\t\t}\n\t\tfor(int i=0;i<r;i++){\n\t\t\tint rs=0;\n\t\t\tfor(int j=0;j<c;j++){\n\t\t\t\tint a=sc.nextInt();\n\t\t\t\trs+=a;\n\t\t\t\tcs[j]+=a;\n\t\t\t\tSystem.out.print(a+\" \");\n\t\t\t}\n\t\t\tSystem.out.println(rs);\n\t\t\tcs[c]+=rs;\n\t\t}\n\t\tfor(int i=0;i<c;i++){\n\t\t\tSystem.out.print(cs[i]+\" \");\n\t\t}\n\t\tSystem.out.println(cs[c]);\n\t}",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"int r = sc.nextInt();",
"r",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int c = sc.nextInt();",
"c",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int[] cs=new int[c+1];",
"cs",
"new int[c+1]",
"c+1",
"c",
"1",
"for(int i=0;i<c+1;i++){\n\t\t\tcs[i]=0;\n\t\t}",
"int i=0;",
"int i=0;",
"i",
"0",
"i<c+1",
"i",
"c+1",
"c",
"1",
"i++",
"i++",
"i",
"{\n\t\t\tcs[i]=0;\n\t\t}",
"{\n\t\t\tcs[i]=0;\n\t\t}",
"cs[i]=0",
"cs[i]",
"cs",
"i",
"0",
"for(int i=0;i<r;i++){\n\t\t\tint rs=0;\n\t\t\tfor(int j=0;j<c;j++){\n\t\t\t\tint a=sc.nextInt();\n\t\t\t\trs+=a;\n\t\t\t\tcs[j]+=a;\n\t\t\t\tSystem.out.print(a+\" \");\n\t\t\t}\n\t\t\tSystem.out.println(rs);\n\t\t\tcs[c]+=rs;\n\t\t}",
"int i=0;",
"int i=0;",
"i",
"0",
"i<r",
"i",
"r",
"i++",
"i++",
"i",
"{\n\t\t\tint rs=0;\n\t\t\tfor(int j=0;j<c;j++){\n\t\t\t\tint a=sc.nextInt();\n\t\t\t\trs+=a;\n\t\t\t\tcs[j]+=a;\n\t\t\t\tSystem.out.print(a+\" \");\n\t\t\t}\n\t\t\tSystem.out.println(rs);\n\t\t\tcs[c]+=rs;\n\t\t}",
"{\n\t\t\tint rs=0;\n\t\t\tfor(int j=0;j<c;j++){\n\t\t\t\tint a=sc.nextInt();\n\t\t\t\trs+=a;\n\t\t\t\tcs[j]+=a;\n\t\t\t\tSystem.out.print(a+\" \");\n\t\t\t}\n\t\t\tSystem.out.println(rs);\n\t\t\tcs[c]+=rs;\n\t\t}",
"int rs=0;",
"rs",
"0",
"for(int j=0;j<c;j++){\n\t\t\t\tint a=sc.nextInt();\n\t\t\t\trs+=a;\n\t\t\t\tcs[j]+=a;\n\t\t\t\tSystem.out.print(a+\" \");\n\t\t\t}",
"int j=0;",
"int j=0;",
"j",
"0",
"j<c",
"j",
"c",
"j++",
"j++",
"j",
"{\n\t\t\t\tint a=sc.nextInt();\n\t\t\t\trs+=a;\n\t\t\t\tcs[j]+=a;\n\t\t\t\tSystem.out.print(a+\" \");\n\t\t\t}",
"{\n\t\t\t\tint a=sc.nextInt();\n\t\t\t\trs+=a;\n\t\t\t\tcs[j]+=a;\n\t\t\t\tSystem.out.print(a+\" \");\n\t\t\t}",
"int a=sc.nextInt();",
"a",
"sc.nextInt()",
"sc.nextInt",
"sc",
"rs+=a",
"rs",
"a",
"cs[j]+=a",
"cs[j]",
"cs",
"j",
"a",
"System.out.print(a+\" \")",
"System.out.print",
"System.out",
"System",
"System.out",
"a+\" \"",
"a",
"\" \"",
"System.out.println(rs)",
"System.out.println",
"System.out",
"System",
"System.out",
"rs",
"cs[c]+=rs",
"cs[c]",
"cs",
"c",
"rs",
"for(int i=0;i<c;i++){\n\t\t\tSystem.out.print(cs[i]+\" \");\n\t\t}",
"int i=0;",
"int i=0;",
"i",
"0",
"i<c",
"i",
"c",
"i++",
"i++",
"i",
"{\n\t\t\tSystem.out.print(cs[i]+\" \");\n\t\t}",
"{\n\t\t\tSystem.out.print(cs[i]+\" \");\n\t\t}",
"System.out.print(cs[i]+\" \")",
"System.out.print",
"System.out",
"System",
"System.out",
"cs[i]+\" \"",
"cs[i]",
"cs",
"i",
"\" \"",
"System.out.println(cs[c])",
"System.out.println",
"System.out",
"System",
"System.out",
"cs[c]",
"cs",
"c",
"String[] args",
"args",
"public class Main {\n\tpublic static void main(String[] args){\n\t\tScanner sc = new Scanner(System.in);\n\t\tint r = sc.nextInt();\n\t\tint c = sc.nextInt();\n\t\tint[] cs=new int[c+1];\n\t\tfor(int i=0;i<c+1;i++){\n\t\t\tcs[i]=0;\n\t\t}\n\t\tfor(int i=0;i<r;i++){\n\t\t\tint rs=0;\n\t\t\tfor(int j=0;j<c;j++){\n\t\t\t\tint a=sc.nextInt();\n\t\t\t\trs+=a;\n\t\t\t\tcs[j]+=a;\n\t\t\t\tSystem.out.print(a+\" \");\n\t\t\t}\n\t\t\tSystem.out.println(rs);\n\t\t\tcs[c]+=rs;\n\t\t}\n\t\tfor(int i=0;i<c;i++){\n\t\t\tSystem.out.print(cs[i]+\" \");\n\t\t}\n\t\tSystem.out.println(cs[c]);\n\t}\n}",
"public class Main {\n\tpublic static void main(String[] args){\n\t\tScanner sc = new Scanner(System.in);\n\t\tint r = sc.nextInt();\n\t\tint c = sc.nextInt();\n\t\tint[] cs=new int[c+1];\n\t\tfor(int i=0;i<c+1;i++){\n\t\t\tcs[i]=0;\n\t\t}\n\t\tfor(int i=0;i<r;i++){\n\t\t\tint rs=0;\n\t\t\tfor(int j=0;j<c;j++){\n\t\t\t\tint a=sc.nextInt();\n\t\t\t\trs+=a;\n\t\t\t\tcs[j]+=a;\n\t\t\t\tSystem.out.print(a+\" \");\n\t\t\t}\n\t\t\tSystem.out.println(rs);\n\t\t\tcs[c]+=rs;\n\t\t}\n\t\tfor(int i=0;i<c;i++){\n\t\t\tSystem.out.print(cs[i]+\" \");\n\t\t}\n\t\tSystem.out.println(cs[c]);\n\t}\n}",
"Main"
] | import java.util.*;
public class Main {
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
int r = sc.nextInt();
int c = sc.nextInt();
int[] cs=new int[c+1];
for(int i=0;i<c+1;i++){
cs[i]=0;
}
for(int i=0;i<r;i++){
int rs=0;
for(int j=0;j<c;j++){
int a=sc.nextInt();
rs+=a;
cs[j]+=a;
System.out.print(a+" ");
}
System.out.println(rs);
cs[c]+=rs;
}
for(int i=0;i<c;i++){
System.out.print(cs[i]+" ");
}
System.out.println(cs[c]);
}
} |
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
41,
13,
20,
13,
13,
41,
13,
20,
2,
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,
18,
18,
13,
13,
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,
4,
18,
18,
13,
13,
2,
18,
18,
13,
13,
13,
17,
0,
13,
18,
18,
13,
13,
13,
14,
2,
13,
2,
13,
17,
30,
4,
18,
18,
13,
13,
13,
0,
13,
17,
0,
18,
13,
13,
18,
18,
13,
13,
13,
11,
1,
41,
13,
17,
2,
13,
2,
18,
13,
13,
17,
1,
40,
13,
30,
30,
4,
18,
18,
13,
13,
2,
18,
13,
13,
17,
0,
13,
18,
13,
13,
4,
18,
18,
13,
13,
13,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
185,
5
],
[
185,
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
],
[
19,
20
],
[
20,
21
],
[
8,
22
],
[
22,
23
],
[
22,
24
],
[
8,
27
],
[
27,
28
],
[
27,
29
],
[
30,
31
],
[
30,
32
],
[
8,
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
],
[
59,
65
],
[
65,
66
],
[
66,
67
],
[
8,
68
],
[
68,
69
],
[
68,
70
],
[
8,
71
],
[
71,
72
],
[
71,
73
],
[
8,
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
],
[
101,
102
],
[
102,
103
],
[
102,
104
],
[
100,
105
],
[
105,
106
],
[
106,
107
],
[
107,
108
],
[
107,
109
],
[
106,
110
],
[
105,
111
],
[
99,
112
],
[
112,
113
],
[
112,
114
],
[
114,
115
],
[
115,
116
],
[
115,
117
],
[
114,
118
],
[
99,
119
],
[
119,
120
],
[
120,
121
],
[
120,
122
],
[
122,
123
],
[
122,
124
],
[
119,
125
],
[
125,
126
],
[
126,
127
],
[
127,
128
],
[
128,
129
],
[
128,
130
],
[
126,
131
],
[
125,
132
],
[
132,
133
],
[
132,
134
],
[
99,
135
],
[
135,
136
],
[
136,
137
],
[
136,
138
],
[
135,
139
],
[
139,
140
],
[
140,
141
],
[
140,
142
],
[
139,
143
],
[
8,
144
],
[
144,
145
],
[
145,
146
],
[
146,
147
],
[
146,
148
],
[
144,
149
],
[
149,
150
],
[
149,
151
],
[
151,
152
],
[
152,
153
],
[
152,
154
],
[
151,
155
],
[
144,
156
],
[
156,
157
],
[
157,
158
],
[
144,
159
],
[
160,
160
],
[
160,
161
],
[
161,
162
],
[
162,
163
],
[
163,
164
],
[
163,
165
],
[
161,
166
],
[
166,
167
],
[
167,
168
],
[
167,
169
],
[
166,
170
],
[
160,
171
],
[
171,
172
],
[
171,
173
],
[
173,
174
],
[
173,
175
],
[
8,
176
],
[
176,
177
],
[
177,
178
],
[
178,
179
],
[
178,
180
],
[
176,
181
],
[
6,
182
],
[
182,
183
],
[
0,
184
],
[
184,
185
],
[
184,
186
]
] | [
"\nimport java.util.Scanner;\n\n\npublic class Main {\n public static void main(String[] args) {\n \n Scanner sc = new Scanner(System.in);\n \n int n = sc.nextInt();\n int m = sc.nextInt();\n \n int[][] a = new int[n][m];\n int[] sums = new int[m+1];\n \n for(int i=0; i < n; i++){\n for(int j=0; j < m; j++){\n a[i][j] = sc.nextInt();\n }\n }\n \n int sum = 0; \n int total = 0;\n \n for(int i=0; i < n; i++){\n for(int j=0; j < m; j++){\n \n System.out.print(a[i][j] +\" \");\n sum += a[i][j];\n \n if(j == m-1){\n System.out.println(sum);\n sum = 0;\n }\n \n sums[j] += a[i][j];\n \n }\n }\n \n for(int i=0; i<sums.length -1; i++){\n System.out.print(sums[i] + \" \");\n total += sums[i];\n }\n \n System.out.println(total);\n \n }\n}\n\n\n",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n public static void main(String[] args) {\n \n Scanner sc = new Scanner(System.in);\n \n int n = sc.nextInt();\n int m = sc.nextInt();\n \n int[][] a = new int[n][m];\n int[] sums = new int[m+1];\n \n for(int i=0; i < n; i++){\n for(int j=0; j < m; j++){\n a[i][j] = sc.nextInt();\n }\n }\n \n int sum = 0; \n int total = 0;\n \n for(int i=0; i < n; i++){\n for(int j=0; j < m; j++){\n \n System.out.print(a[i][j] +\" \");\n sum += a[i][j];\n \n if(j == m-1){\n System.out.println(sum);\n sum = 0;\n }\n \n sums[j] += a[i][j];\n \n }\n }\n \n for(int i=0; i<sums.length -1; i++){\n System.out.print(sums[i] + \" \");\n total += sums[i];\n }\n \n System.out.println(total);\n \n }\n}",
"Main",
"public static void main(String[] args) {\n \n Scanner sc = new Scanner(System.in);\n \n int n = sc.nextInt();\n int m = sc.nextInt();\n \n int[][] a = new int[n][m];\n int[] sums = new int[m+1];\n \n for(int i=0; i < n; i++){\n for(int j=0; j < m; j++){\n a[i][j] = sc.nextInt();\n }\n }\n \n int sum = 0; \n int total = 0;\n \n for(int i=0; i < n; i++){\n for(int j=0; j < m; j++){\n \n System.out.print(a[i][j] +\" \");\n sum += a[i][j];\n \n if(j == m-1){\n System.out.println(sum);\n sum = 0;\n }\n \n sums[j] += a[i][j];\n \n }\n }\n \n for(int i=0; i<sums.length -1; i++){\n System.out.print(sums[i] + \" \");\n total += sums[i];\n }\n \n System.out.println(total);\n \n }",
"main",
"{\n \n Scanner sc = new Scanner(System.in);\n \n int n = sc.nextInt();\n int m = sc.nextInt();\n \n int[][] a = new int[n][m];\n int[] sums = new int[m+1];\n \n for(int i=0; i < n; i++){\n for(int j=0; j < m; j++){\n a[i][j] = sc.nextInt();\n }\n }\n \n int sum = 0; \n int total = 0;\n \n for(int i=0; i < n; i++){\n for(int j=0; j < m; j++){\n \n System.out.print(a[i][j] +\" \");\n sum += a[i][j];\n \n if(j == m-1){\n System.out.println(sum);\n sum = 0;\n }\n \n sums[j] += a[i][j];\n \n }\n }\n \n for(int i=0; i<sums.length -1; i++){\n System.out.print(sums[i] + \" \");\n total += sums[i];\n }\n \n System.out.println(total);\n \n }",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"int n = sc.nextInt();",
"n",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int m = sc.nextInt();",
"m",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int[][] a = new int[n][m];",
"a",
"new int[n][m]",
"n",
"m",
"int[] sums = new int[m+1];",
"sums",
"new int[m+1]",
"m+1",
"m",
"1",
"for(int i=0; i < n; i++){\n for(int j=0; j < m; j++){\n a[i][j] = sc.nextInt();\n }\n }",
"int i=0;",
"int i=0;",
"i",
"0",
"i < n",
"i",
"n",
"i++",
"i++",
"i",
"{\n for(int j=0; j < m; j++){\n a[i][j] = sc.nextInt();\n }\n }",
"{\n for(int j=0; j < m; j++){\n a[i][j] = sc.nextInt();\n }\n }",
"for(int j=0; j < m; j++){\n a[i][j] = sc.nextInt();\n }",
"int j=0;",
"int j=0;",
"j",
"0",
"j < m",
"j",
"m",
"j++",
"j++",
"j",
"{\n a[i][j] = sc.nextInt();\n }",
"{\n a[i][j] = sc.nextInt();\n }",
"a[i][j] = sc.nextInt()",
"a[i][j]",
"a[i]",
"a",
"i",
"j",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int sum = 0;",
"sum",
"0",
"int total = 0;",
"total",
"0",
"for(int i=0; i < n; i++){\n for(int j=0; j < m; j++){\n \n System.out.print(a[i][j] +\" \");\n sum += a[i][j];\n \n if(j == m-1){\n System.out.println(sum);\n sum = 0;\n }\n \n sums[j] += a[i][j];\n \n }\n }",
"int i=0;",
"int i=0;",
"i",
"0",
"i < n",
"i",
"n",
"i++",
"i++",
"i",
"{\n for(int j=0; j < m; j++){\n \n System.out.print(a[i][j] +\" \");\n sum += a[i][j];\n \n if(j == m-1){\n System.out.println(sum);\n sum = 0;\n }\n \n sums[j] += a[i][j];\n \n }\n }",
"{\n for(int j=0; j < m; j++){\n \n System.out.print(a[i][j] +\" \");\n sum += a[i][j];\n \n if(j == m-1){\n System.out.println(sum);\n sum = 0;\n }\n \n sums[j] += a[i][j];\n \n }\n }",
"for(int j=0; j < m; j++){\n \n System.out.print(a[i][j] +\" \");\n sum += a[i][j];\n \n if(j == m-1){\n System.out.println(sum);\n sum = 0;\n }\n \n sums[j] += a[i][j];\n \n }",
"int j=0;",
"int j=0;",
"j",
"0",
"j < m",
"j",
"m",
"j++",
"j++",
"j",
"{\n \n System.out.print(a[i][j] +\" \");\n sum += a[i][j];\n \n if(j == m-1){\n System.out.println(sum);\n sum = 0;\n }\n \n sums[j] += a[i][j];\n \n }",
"{\n \n System.out.print(a[i][j] +\" \");\n sum += a[i][j];\n \n if(j == m-1){\n System.out.println(sum);\n sum = 0;\n }\n \n sums[j] += a[i][j];\n \n }",
"System.out.print(a[i][j] +\" \")",
"System.out.print",
"System.out",
"System",
"System.out",
"a[i][j] +\" \"",
"a[i][j]",
"a[i]",
"a",
"i",
"j",
"\" \"",
"sum += a[i][j]",
"sum",
"a[i][j]",
"a[i]",
"a",
"i",
"j",
"if(j == m-1){\n System.out.println(sum);\n sum = 0;\n }",
"j == m-1",
"j",
"m-1",
"m",
"1",
"{\n System.out.println(sum);\n sum = 0;\n }",
"System.out.println(sum)",
"System.out.println",
"System.out",
"System",
"System.out",
"sum",
"sum = 0",
"sum",
"0",
"sums[j] += a[i][j]",
"sums[j]",
"sums",
"j",
"a[i][j]",
"a[i]",
"a",
"i",
"j",
"for(int i=0; i<sums.length -1; i++){\n System.out.print(sums[i] + \" \");\n total += sums[i];\n }",
"int i=0;",
"int i=0;",
"i",
"0",
"i<sums.length -1",
"i",
"sums.length -1",
"sums.length",
"sums",
"sums.length",
"1",
"i++",
"i++",
"i",
"{\n System.out.print(sums[i] + \" \");\n total += sums[i];\n }",
"{\n System.out.print(sums[i] + \" \");\n total += sums[i];\n }",
"System.out.print(sums[i] + \" \")",
"System.out.print",
"System.out",
"System",
"System.out",
"sums[i] + \" \"",
"sums[i]",
"sums",
"i",
"\" \"",
"total += sums[i]",
"total",
"sums[i]",
"sums",
"i",
"System.out.println(total)",
"System.out.println",
"System.out",
"System",
"System.out",
"total",
"String[] args",
"args",
"public class Main {\n public static void main(String[] args) {\n \n Scanner sc = new Scanner(System.in);\n \n int n = sc.nextInt();\n int m = sc.nextInt();\n \n int[][] a = new int[n][m];\n int[] sums = new int[m+1];\n \n for(int i=0; i < n; i++){\n for(int j=0; j < m; j++){\n a[i][j] = sc.nextInt();\n }\n }\n \n int sum = 0; \n int total = 0;\n \n for(int i=0; i < n; i++){\n for(int j=0; j < m; j++){\n \n System.out.print(a[i][j] +\" \");\n sum += a[i][j];\n \n if(j == m-1){\n System.out.println(sum);\n sum = 0;\n }\n \n sums[j] += a[i][j];\n \n }\n }\n \n for(int i=0; i<sums.length -1; i++){\n System.out.print(sums[i] + \" \");\n total += sums[i];\n }\n \n System.out.println(total);\n \n }\n}",
"public class Main {\n public static void main(String[] args) {\n \n Scanner sc = new Scanner(System.in);\n \n int n = sc.nextInt();\n int m = sc.nextInt();\n \n int[][] a = new int[n][m];\n int[] sums = new int[m+1];\n \n for(int i=0; i < n; i++){\n for(int j=0; j < m; j++){\n a[i][j] = sc.nextInt();\n }\n }\n \n int sum = 0; \n int total = 0;\n \n for(int i=0; i < n; i++){\n for(int j=0; j < m; j++){\n \n System.out.print(a[i][j] +\" \");\n sum += a[i][j];\n \n if(j == m-1){\n System.out.println(sum);\n sum = 0;\n }\n \n sums[j] += a[i][j];\n \n }\n }\n \n for(int i=0; i<sums.length -1; i++){\n System.out.print(sums[i] + \" \");\n total += sums[i];\n }\n \n System.out.println(total);\n \n }\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();
int m = sc.nextInt();
int[][] a = new int[n][m];
int[] sums = new int[m+1];
for(int i=0; i < n; i++){
for(int j=0; j < m; j++){
a[i][j] = sc.nextInt();
}
}
int sum = 0;
int total = 0;
for(int i=0; i < n; i++){
for(int j=0; j < m; j++){
System.out.print(a[i][j] +" ");
sum += a[i][j];
if(j == m-1){
System.out.println(sum);
sum = 0;
}
sums[j] += a[i][j];
}
}
for(int i=0; i<sums.length -1; i++){
System.out.print(sums[i] + " ");
total += sums[i];
}
System.out.println(total);
}
}
|
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
41,
13,
20,
2,
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,
41,
13,
4,
18,
13,
0,
13,
13,
0,
18,
13,
13,
13,
0,
18,
13,
13,
13,
4,
18,
4,
18,
13,
13,
17,
4,
18,
4,
18,
13,
13,
17,
11,
1,
41,
13,
17,
2,
13,
18,
13,
13,
1,
40,
13,
30,
30,
4,
18,
13,
18,
13,
13,
4,
18,
13,
8,
2,
13,
13,
17,
17,
4,
18,
18,
13,
13,
4,
18,
13,
23,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
8,
15
],
[
15,
16
],
[
15,
17
],
[
17,
18
],
[
18,
19
],
[
8,
20
],
[
20,
21
],
[
20,
22
],
[
22,
23
],
[
23,
24
],
[
8,
25
],
[
25,
26
],
[
25,
27
],
[
28,
29
],
[
28,
30
],
[
8,
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
],
[
44,
46
],
[
43,
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
],
[
60,
62
],
[
62,
63
],
[
63,
64
],
[
59,
65
],
[
65,
66
],
[
65,
67
],
[
59,
68
],
[
68,
69
],
[
69,
70
],
[
69,
71
],
[
68,
72
],
[
59,
73
],
[
73,
74
],
[
74,
75
],
[
74,
76
],
[
73,
77
],
[
59,
78
],
[
78,
79
],
[
79,
80
],
[
80,
81
],
[
81,
82
],
[
80,
83
],
[
78,
84
],
[
43,
85
],
[
85,
86
],
[
86,
87
],
[
87,
88
],
[
88,
89
],
[
87,
90
],
[
85,
91
],
[
8,
92
],
[
92,
93
],
[
93,
94
],
[
94,
95
],
[
94,
96
],
[
92,
97
],
[
97,
98
],
[
97,
99
],
[
99,
100
],
[
99,
101
],
[
92,
102
],
[
102,
103
],
[
103,
104
],
[
92,
105
],
[
106,
106
],
[
106,
107
],
[
107,
108
],
[
108,
109
],
[
107,
110
],
[
110,
111
],
[
110,
112
],
[
106,
113
],
[
113,
114
],
[
114,
115
],
[
113,
116
],
[
116,
117
],
[
117,
118
],
[
117,
119
],
[
116,
120
],
[
116,
121
],
[
8,
122
],
[
122,
123
],
[
123,
124
],
[
124,
125
],
[
124,
126
],
[
122,
127
],
[
127,
128
],
[
128,
129
],
[
6,
130
],
[
130,
131
]
] | [
"import java.util.Scanner;\n\nclass Main {\n public static void main(String[] args) {\n Scanner in = new Scanner(System.in);\n StringBuilder sb = new StringBuilder();\n\n int r = in.nextInt();\n int c = in.nextInt();\n\n int[] rSum = new int[c + 1];\n\n for (int i = 0; i < r; i++) {\n int cSum = 0;\n for (int j = 0; j < c; j++) {\n int num = in.nextInt();\n cSum += num;\n rSum[j] += num;\n rSum[c] += num;\n sb.append(num).append(\" \");\n }\n sb.append(cSum).append(\"\\n\");\n }\n for (int i = 0; i < rSum.length; i++) {\n sb.append(rSum[i]);\n sb.append(i == c ? \"\\n\" : \" \");\n }\n\n System.out.print(sb.toString());\n }\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"class Main {\n public static void main(String[] args) {\n Scanner in = new Scanner(System.in);\n StringBuilder sb = new StringBuilder();\n\n int r = in.nextInt();\n int c = in.nextInt();\n\n int[] rSum = new int[c + 1];\n\n for (int i = 0; i < r; i++) {\n int cSum = 0;\n for (int j = 0; j < c; j++) {\n int num = in.nextInt();\n cSum += num;\n rSum[j] += num;\n rSum[c] += num;\n sb.append(num).append(\" \");\n }\n sb.append(cSum).append(\"\\n\");\n }\n for (int i = 0; i < rSum.length; i++) {\n sb.append(rSum[i]);\n sb.append(i == c ? \"\\n\" : \" \");\n }\n\n System.out.print(sb.toString());\n }\n}",
"Main",
"public static void main(String[] args) {\n Scanner in = new Scanner(System.in);\n StringBuilder sb = new StringBuilder();\n\n int r = in.nextInt();\n int c = in.nextInt();\n\n int[] rSum = new int[c + 1];\n\n for (int i = 0; i < r; i++) {\n int cSum = 0;\n for (int j = 0; j < c; j++) {\n int num = in.nextInt();\n cSum += num;\n rSum[j] += num;\n rSum[c] += num;\n sb.append(num).append(\" \");\n }\n sb.append(cSum).append(\"\\n\");\n }\n for (int i = 0; i < rSum.length; i++) {\n sb.append(rSum[i]);\n sb.append(i == c ? \"\\n\" : \" \");\n }\n\n System.out.print(sb.toString());\n }",
"main",
"{\n Scanner in = new Scanner(System.in);\n StringBuilder sb = new StringBuilder();\n\n int r = in.nextInt();\n int c = in.nextInt();\n\n int[] rSum = new int[c + 1];\n\n for (int i = 0; i < r; i++) {\n int cSum = 0;\n for (int j = 0; j < c; j++) {\n int num = in.nextInt();\n cSum += num;\n rSum[j] += num;\n rSum[c] += num;\n sb.append(num).append(\" \");\n }\n sb.append(cSum).append(\"\\n\");\n }\n for (int i = 0; i < rSum.length; i++) {\n sb.append(rSum[i]);\n sb.append(i == c ? \"\\n\" : \" \");\n }\n\n System.out.print(sb.toString());\n }",
"Scanner in = new Scanner(System.in);",
"in",
"new Scanner(System.in)",
"StringBuilder sb = new StringBuilder();",
"sb",
"new StringBuilder()",
"int r = in.nextInt();",
"r",
"in.nextInt()",
"in.nextInt",
"in",
"int c = in.nextInt();",
"c",
"in.nextInt()",
"in.nextInt",
"in",
"int[] rSum = new int[c + 1];",
"rSum",
"new int[c + 1]",
"c + 1",
"c",
"1",
"for (int i = 0; i < r; i++) {\n int cSum = 0;\n for (int j = 0; j < c; j++) {\n int num = in.nextInt();\n cSum += num;\n rSum[j] += num;\n rSum[c] += num;\n sb.append(num).append(\" \");\n }\n sb.append(cSum).append(\"\\n\");\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < r",
"i",
"r",
"i++",
"i++",
"i",
"{\n int cSum = 0;\n for (int j = 0; j < c; j++) {\n int num = in.nextInt();\n cSum += num;\n rSum[j] += num;\n rSum[c] += num;\n sb.append(num).append(\" \");\n }\n sb.append(cSum).append(\"\\n\");\n }",
"{\n int cSum = 0;\n for (int j = 0; j < c; j++) {\n int num = in.nextInt();\n cSum += num;\n rSum[j] += num;\n rSum[c] += num;\n sb.append(num).append(\" \");\n }\n sb.append(cSum).append(\"\\n\");\n }",
"int cSum = 0;",
"cSum",
"0",
"for (int j = 0; j < c; j++) {\n int num = in.nextInt();\n cSum += num;\n rSum[j] += num;\n rSum[c] += num;\n sb.append(num).append(\" \");\n }",
"int j = 0;",
"int j = 0;",
"j",
"0",
"j < c",
"j",
"c",
"j++",
"j++",
"j",
"{\n int num = in.nextInt();\n cSum += num;\n rSum[j] += num;\n rSum[c] += num;\n sb.append(num).append(\" \");\n }",
"{\n int num = in.nextInt();\n cSum += num;\n rSum[j] += num;\n rSum[c] += num;\n sb.append(num).append(\" \");\n }",
"int num = in.nextInt();",
"num",
"in.nextInt()",
"in.nextInt",
"in",
"cSum += num",
"cSum",
"num",
"rSum[j] += num",
"rSum[j]",
"rSum",
"j",
"num",
"rSum[c] += num",
"rSum[c]",
"rSum",
"c",
"num",
"sb.append(num).append(\" \")",
"sb.append(num).append",
"sb.append(num)",
"sb.append",
"sb",
"num",
"\" \"",
"sb.append(cSum).append(\"\\n\")",
"sb.append(cSum).append",
"sb.append(cSum)",
"sb.append",
"sb",
"cSum",
"\"\\n\"",
"for (int i = 0; i < rSum.length; i++) {\n sb.append(rSum[i]);\n sb.append(i == c ? \"\\n\" : \" \");\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < rSum.length",
"i",
"rSum.length",
"rSum",
"rSum.length",
"i++",
"i++",
"i",
"{\n sb.append(rSum[i]);\n sb.append(i == c ? \"\\n\" : \" \");\n }",
"{\n sb.append(rSum[i]);\n sb.append(i == c ? \"\\n\" : \" \");\n }",
"sb.append(rSum[i])",
"sb.append",
"sb",
"rSum[i]",
"rSum",
"i",
"sb.append(i == c ? \"\\n\" : \" \")",
"sb.append",
"sb",
"i == c ? \"\\n\" : \" \"",
"i == c",
"i",
"c",
"\"\\n\"",
"\" \"",
"System.out.print(sb.toString())",
"System.out.print",
"System.out",
"System",
"System.out",
"sb.toString()",
"sb.toString",
"sb",
"String[] args",
"args"
] | import java.util.Scanner;
class Main {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
StringBuilder sb = new StringBuilder();
int r = in.nextInt();
int c = in.nextInt();
int[] rSum = new int[c + 1];
for (int i = 0; i < r; i++) {
int cSum = 0;
for (int j = 0; j < c; j++) {
int num = in.nextInt();
cSum += num;
rSum[j] += num;
rSum[c] += num;
sb.append(num).append(" ");
}
sb.append(cSum).append("\n");
}
for (int i = 0; i < rSum.length; i++) {
sb.append(rSum[i]);
sb.append(i == c ? "\n" : " ");
}
System.out.print(sb.toString());
}
} |
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
17,
38,
5,
13,
30,
4,
18,
13,
5,
13,
30,
4,
18,
13,
30,
0,
13,
4,
18,
13,
41,
13,
4,
18,
13,
17,
41,
13,
4,
18,
13,
18,
13,
17,
41,
13,
4,
18,
13,
18,
13,
17,
41,
13,
20,
2,
13,
17,
2,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
4,
18,
13,
41,
13,
4,
18,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
14,
2,
13,
17,
0,
18,
18,
13,
13,
13,
17,
0,
18,
18,
13,
13,
13,
4,
18,
13,
18,
13,
13,
0,
18,
18,
13,
13,
13,
2,
18,
18,
13,
13,
13,
18,
18,
13,
13,
13,
0,
18,
18,
13,
13,
13,
2,
18,
18,
13,
13,
13,
18,
18,
13,
13,
13,
0,
18,
18,
13,
13,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
18,
18,
13,
13,
13,
2,
18,
18,
13,
13,
13,
18,
18,
13,
13,
13,
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,
14,
2,
13,
17,
4,
18,
18,
13,
13,
17,
4,
18,
18,
13,
13,
18,
18,
13,
13,
13,
4,
18,
18,
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
],
[
260,
11
],
[
260,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
15,
17
],
[
14,
18
],
[
18,
19
],
[
18,
20
],
[
14,
21
],
[
21,
22
],
[
22,
23
],
[
22,
24
],
[
24,
25
],
[
25,
26
],
[
26,
27
],
[
21,
28
],
[
28,
29
],
[
28,
30
],
[
30,
31
],
[
31,
32
],
[
32,
33
],
[
21,
34
],
[
34,
35
],
[
35,
36
],
[
35,
37
],
[
37,
38
],
[
38,
39
],
[
34,
40
],
[
40,
41
],
[
40,
42
],
[
42,
43
],
[
43,
44
],
[
42,
45
],
[
34,
46
],
[
46,
47
],
[
46,
48
],
[
48,
49
],
[
49,
50
],
[
48,
51
],
[
51,
52
],
[
51,
53
],
[
34,
54
],
[
54,
55
],
[
54,
56
],
[
56,
57
],
[
57,
58
],
[
56,
59
],
[
59,
60
],
[
59,
61
],
[
34,
62
],
[
62,
63
],
[
62,
64
],
[
65,
66
],
[
65,
67
],
[
68,
69
],
[
68,
70
],
[
34,
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
],
[
87,
88
],
[
83,
89
],
[
89,
90
],
[
89,
91
],
[
91,
92
],
[
92,
93
],
[
91,
94
],
[
83,
95
],
[
95,
96
],
[
96,
97
],
[
97,
98
],
[
97,
99
],
[
95,
100
],
[
100,
101
],
[
100,
102
],
[
95,
103
],
[
103,
104
],
[
104,
105
],
[
95,
106
],
[
107,
107
],
[
107,
108
],
[
108,
109
],
[
109,
110
],
[
109,
111
],
[
108,
112
],
[
112,
113
],
[
113,
114
],
[
114,
115
],
[
114,
116
],
[
113,
117
],
[
112,
118
],
[
107,
119
],
[
119,
120
],
[
120,
121
],
[
121,
122
],
[
121,
123
],
[
120,
124
],
[
119,
125
],
[
125,
126
],
[
126,
127
],
[
125,
128
],
[
128,
129
],
[
128,
130
],
[
107,
131
],
[
131,
132
],
[
132,
133
],
[
133,
134
],
[
133,
135
],
[
132,
136
],
[
131,
137
],
[
137,
138
],
[
138,
139
],
[
139,
140
],
[
139,
141
],
[
138,
142
],
[
137,
143
],
[
143,
144
],
[
144,
145
],
[
144,
146
],
[
143,
147
],
[
107,
148
],
[
148,
149
],
[
149,
150
],
[
150,
151
],
[
150,
152
],
[
149,
153
],
[
148,
154
],
[
154,
155
],
[
155,
156
],
[
156,
157
],
[
156,
158
],
[
155,
159
],
[
154,
160
],
[
160,
161
],
[
161,
162
],
[
161,
163
],
[
160,
164
],
[
34,
165
],
[
165,
166
],
[
166,
167
],
[
167,
168
],
[
167,
169
],
[
166,
170
],
[
165,
171
],
[
34,
172
],
[
172,
173
],
[
173,
174
],
[
174,
175
],
[
174,
176
],
[
172,
177
],
[
177,
178
],
[
177,
179
],
[
172,
180
],
[
180,
181
],
[
181,
182
],
[
172,
183
],
[
184,
184
],
[
184,
185
],
[
185,
186
],
[
186,
187
],
[
187,
188
],
[
187,
189
],
[
186,
190
],
[
185,
191
],
[
191,
192
],
[
192,
193
],
[
193,
194
],
[
193,
195
],
[
192,
196
],
[
191,
197
],
[
197,
198
],
[
198,
199
],
[
198,
200
],
[
197,
201
],
[
34,
202
],
[
202,
203
],
[
203,
204
],
[
204,
205
],
[
204,
206
],
[
202,
207
],
[
207,
208
],
[
207,
209
],
[
209,
210
],
[
209,
211
],
[
202,
212
],
[
212,
213
],
[
213,
214
],
[
202,
215
],
[
216,
216
],
[
216,
217
],
[
217,
218
],
[
218,
219
],
[
219,
220
],
[
219,
221
],
[
217,
222
],
[
222,
223
],
[
222,
224
],
[
224,
225
],
[
224,
226
],
[
217,
227
],
[
227,
228
],
[
228,
229
],
[
217,
230
],
[
231,
231
],
[
231,
232
],
[
232,
233
],
[
233,
234
],
[
233,
235
],
[
232,
236
],
[
236,
237
],
[
237,
238
],
[
238,
239
],
[
238,
240
],
[
236,
241
],
[
231,
242
],
[
242,
243
],
[
243,
244
],
[
244,
245
],
[
244,
246
],
[
242,
247
],
[
247,
248
],
[
248,
249
],
[
248,
250
],
[
247,
251
],
[
216,
252
],
[
252,
253
],
[
253,
254
],
[
254,
255
],
[
254,
256
],
[
12,
257
],
[
257,
258
],
[
0,
259
],
[
259,
260
],
[
259,
261
]
] | [
"import java.io.BufferedReader;\nimport java.io.IOException;\nimport java.io.InputStreamReader;\n\npublic class Main {\n\tpublic static void main(String[] args) {\n\t\tBufferedReader in = new BufferedReader(new InputStreamReader(System.in));\n \n\t\tString x = \"\";\n\t\ttry {\n\t\t\tx = in.readLine();\n\t\t\tString[] nm = x.split(\" \");\n\t\t\tint n = Integer.parseInt(nm[0]);\n\t\t\tint m = Integer.parseInt(nm[1]);\n\t\t\t\n\t\t\tint[][] md = new int[n + 1][m + 1];\n\t\t\t\n\t\t\tfor (int i = 0; i < n; i++) {\n\t\t\t\tx = in.readLine();\n\t\t\t\tString[] e = x.split(\" \");\n\t\t\t\t\n\t\t\t\tfor (int j = 0; j < m; j++) {\n\t\t\t\t\tif (i == 0) md[n][j] = 0;\n\t\t\t\t\t\n\t\t\t\t\tmd[i][j] = Integer.parseInt(e[j]);\n\t\t\t\t\tmd[i][m] = md[i][m] + md[i][j];\n\t\t\t\t\tmd[n][j] = md[n][j] + md[i][j];\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tmd[n][m] = 0;\n\t\t\tfor (int i = 0; i < n; i++) {\n\t\t\t\tmd[n][m] = md[n][m] + md[i][m];\n\t\t\t}\n\t\t\t\n\t\t\tfor (int i = 0; i < (n + 1); i++) {\n\t\t\t\tfor (int j = 0; j < (m + 1); j++) {\n\t\t\t\t\tif (j != 0) System.out.print(\" \");\n\t\t\t\t\tSystem.out.print(md[i][j]);\n\t\t\t\t}\n\t\t\t\tSystem.out.println();\n\t\t\t}\n\t\t} catch (NumberFormatException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t} catch (IOException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t}\n}",
"import java.io.BufferedReader;",
"BufferedReader",
"java.io",
"import java.io.IOException;",
"IOException",
"java.io",
"import java.io.InputStreamReader;",
"InputStreamReader",
"java.io",
"public class Main {\n\tpublic static void main(String[] args) {\n\t\tBufferedReader in = new BufferedReader(new InputStreamReader(System.in));\n \n\t\tString x = \"\";\n\t\ttry {\n\t\t\tx = in.readLine();\n\t\t\tString[] nm = x.split(\" \");\n\t\t\tint n = Integer.parseInt(nm[0]);\n\t\t\tint m = Integer.parseInt(nm[1]);\n\t\t\t\n\t\t\tint[][] md = new int[n + 1][m + 1];\n\t\t\t\n\t\t\tfor (int i = 0; i < n; i++) {\n\t\t\t\tx = in.readLine();\n\t\t\t\tString[] e = x.split(\" \");\n\t\t\t\t\n\t\t\t\tfor (int j = 0; j < m; j++) {\n\t\t\t\t\tif (i == 0) md[n][j] = 0;\n\t\t\t\t\t\n\t\t\t\t\tmd[i][j] = Integer.parseInt(e[j]);\n\t\t\t\t\tmd[i][m] = md[i][m] + md[i][j];\n\t\t\t\t\tmd[n][j] = md[n][j] + md[i][j];\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tmd[n][m] = 0;\n\t\t\tfor (int i = 0; i < n; i++) {\n\t\t\t\tmd[n][m] = md[n][m] + md[i][m];\n\t\t\t}\n\t\t\t\n\t\t\tfor (int i = 0; i < (n + 1); i++) {\n\t\t\t\tfor (int j = 0; j < (m + 1); j++) {\n\t\t\t\t\tif (j != 0) System.out.print(\" \");\n\t\t\t\t\tSystem.out.print(md[i][j]);\n\t\t\t\t}\n\t\t\t\tSystem.out.println();\n\t\t\t}\n\t\t} catch (NumberFormatException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t} catch (IOException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t}\n}",
"Main",
"public static void main(String[] args) {\n\t\tBufferedReader in = new BufferedReader(new InputStreamReader(System.in));\n \n\t\tString x = \"\";\n\t\ttry {\n\t\t\tx = in.readLine();\n\t\t\tString[] nm = x.split(\" \");\n\t\t\tint n = Integer.parseInt(nm[0]);\n\t\t\tint m = Integer.parseInt(nm[1]);\n\t\t\t\n\t\t\tint[][] md = new int[n + 1][m + 1];\n\t\t\t\n\t\t\tfor (int i = 0; i < n; i++) {\n\t\t\t\tx = in.readLine();\n\t\t\t\tString[] e = x.split(\" \");\n\t\t\t\t\n\t\t\t\tfor (int j = 0; j < m; j++) {\n\t\t\t\t\tif (i == 0) md[n][j] = 0;\n\t\t\t\t\t\n\t\t\t\t\tmd[i][j] = Integer.parseInt(e[j]);\n\t\t\t\t\tmd[i][m] = md[i][m] + md[i][j];\n\t\t\t\t\tmd[n][j] = md[n][j] + md[i][j];\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tmd[n][m] = 0;\n\t\t\tfor (int i = 0; i < n; i++) {\n\t\t\t\tmd[n][m] = md[n][m] + md[i][m];\n\t\t\t}\n\t\t\t\n\t\t\tfor (int i = 0; i < (n + 1); i++) {\n\t\t\t\tfor (int j = 0; j < (m + 1); j++) {\n\t\t\t\t\tif (j != 0) System.out.print(\" \");\n\t\t\t\t\tSystem.out.print(md[i][j]);\n\t\t\t\t}\n\t\t\t\tSystem.out.println();\n\t\t\t}\n\t\t} catch (NumberFormatException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t} catch (IOException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t}",
"main",
"{\n\t\tBufferedReader in = new BufferedReader(new InputStreamReader(System.in));\n \n\t\tString x = \"\";\n\t\ttry {\n\t\t\tx = in.readLine();\n\t\t\tString[] nm = x.split(\" \");\n\t\t\tint n = Integer.parseInt(nm[0]);\n\t\t\tint m = Integer.parseInt(nm[1]);\n\t\t\t\n\t\t\tint[][] md = new int[n + 1][m + 1];\n\t\t\t\n\t\t\tfor (int i = 0; i < n; i++) {\n\t\t\t\tx = in.readLine();\n\t\t\t\tString[] e = x.split(\" \");\n\t\t\t\t\n\t\t\t\tfor (int j = 0; j < m; j++) {\n\t\t\t\t\tif (i == 0) md[n][j] = 0;\n\t\t\t\t\t\n\t\t\t\t\tmd[i][j] = Integer.parseInt(e[j]);\n\t\t\t\t\tmd[i][m] = md[i][m] + md[i][j];\n\t\t\t\t\tmd[n][j] = md[n][j] + md[i][j];\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tmd[n][m] = 0;\n\t\t\tfor (int i = 0; i < n; i++) {\n\t\t\t\tmd[n][m] = md[n][m] + md[i][m];\n\t\t\t}\n\t\t\t\n\t\t\tfor (int i = 0; i < (n + 1); i++) {\n\t\t\t\tfor (int j = 0; j < (m + 1); j++) {\n\t\t\t\t\tif (j != 0) System.out.print(\" \");\n\t\t\t\t\tSystem.out.print(md[i][j]);\n\t\t\t\t}\n\t\t\t\tSystem.out.println();\n\t\t\t}\n\t\t} catch (NumberFormatException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t} catch (IOException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t}",
"BufferedReader in = new BufferedReader(new InputStreamReader(System.in));",
"in",
"new BufferedReader(new InputStreamReader(System.in))",
"String x = \"\";",
"x",
"\"\"",
"try {\n\t\t\tx = in.readLine();\n\t\t\tString[] nm = x.split(\" \");\n\t\t\tint n = Integer.parseInt(nm[0]);\n\t\t\tint m = Integer.parseInt(nm[1]);\n\t\t\t\n\t\t\tint[][] md = new int[n + 1][m + 1];\n\t\t\t\n\t\t\tfor (int i = 0; i < n; i++) {\n\t\t\t\tx = in.readLine();\n\t\t\t\tString[] e = x.split(\" \");\n\t\t\t\t\n\t\t\t\tfor (int j = 0; j < m; j++) {\n\t\t\t\t\tif (i == 0) md[n][j] = 0;\n\t\t\t\t\t\n\t\t\t\t\tmd[i][j] = Integer.parseInt(e[j]);\n\t\t\t\t\tmd[i][m] = md[i][m] + md[i][j];\n\t\t\t\t\tmd[n][j] = md[n][j] + md[i][j];\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tmd[n][m] = 0;\n\t\t\tfor (int i = 0; i < n; i++) {\n\t\t\t\tmd[n][m] = md[n][m] + md[i][m];\n\t\t\t}\n\t\t\t\n\t\t\tfor (int i = 0; i < (n + 1); i++) {\n\t\t\t\tfor (int j = 0; j < (m + 1); j++) {\n\t\t\t\t\tif (j != 0) System.out.print(\" \");\n\t\t\t\t\tSystem.out.print(md[i][j]);\n\t\t\t\t}\n\t\t\t\tSystem.out.println();\n\t\t\t}\n\t\t} catch (NumberFormatException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t} catch (IOException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}",
"catch (NumberFormatException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}",
"NumberFormatException e",
"{\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}",
"e.printStackTrace()",
"e.printStackTrace",
"e",
"catch (IOException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}",
"IOException e",
"{\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}",
"e.printStackTrace()",
"e.printStackTrace",
"e",
"{\n\t\t\tx = in.readLine();\n\t\t\tString[] nm = x.split(\" \");\n\t\t\tint n = Integer.parseInt(nm[0]);\n\t\t\tint m = Integer.parseInt(nm[1]);\n\t\t\t\n\t\t\tint[][] md = new int[n + 1][m + 1];\n\t\t\t\n\t\t\tfor (int i = 0; i < n; i++) {\n\t\t\t\tx = in.readLine();\n\t\t\t\tString[] e = x.split(\" \");\n\t\t\t\t\n\t\t\t\tfor (int j = 0; j < m; j++) {\n\t\t\t\t\tif (i == 0) md[n][j] = 0;\n\t\t\t\t\t\n\t\t\t\t\tmd[i][j] = Integer.parseInt(e[j]);\n\t\t\t\t\tmd[i][m] = md[i][m] + md[i][j];\n\t\t\t\t\tmd[n][j] = md[n][j] + md[i][j];\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tmd[n][m] = 0;\n\t\t\tfor (int i = 0; i < n; i++) {\n\t\t\t\tmd[n][m] = md[n][m] + md[i][m];\n\t\t\t}\n\t\t\t\n\t\t\tfor (int i = 0; i < (n + 1); i++) {\n\t\t\t\tfor (int j = 0; j < (m + 1); j++) {\n\t\t\t\t\tif (j != 0) System.out.print(\" \");\n\t\t\t\t\tSystem.out.print(md[i][j]);\n\t\t\t\t}\n\t\t\t\tSystem.out.println();\n\t\t\t}\n\t\t}",
"x = in.readLine()",
"x",
"in.readLine()",
"in.readLine",
"in",
"String[] nm = x.split(\" \");",
"nm",
"x.split(\" \")",
"x.split",
"x",
"\" \"",
"int n = Integer.parseInt(nm[0]);",
"n",
"Integer.parseInt(nm[0])",
"Integer.parseInt",
"Integer",
"nm[0]",
"nm",
"0",
"int m = Integer.parseInt(nm[1]);",
"m",
"Integer.parseInt(nm[1])",
"Integer.parseInt",
"Integer",
"nm[1]",
"nm",
"1",
"int[][] md = new int[n + 1][m + 1];",
"md",
"new int[n + 1][m + 1]",
"n + 1",
"n",
"1",
"m + 1",
"m",
"1",
"for (int i = 0; i < n; i++) {\n\t\t\t\tx = in.readLine();\n\t\t\t\tString[] e = x.split(\" \");\n\t\t\t\t\n\t\t\t\tfor (int j = 0; j < m; j++) {\n\t\t\t\t\tif (i == 0) md[n][j] = 0;\n\t\t\t\t\t\n\t\t\t\t\tmd[i][j] = Integer.parseInt(e[j]);\n\t\t\t\t\tmd[i][m] = md[i][m] + md[i][j];\n\t\t\t\t\tmd[n][j] = md[n][j] + md[i][j];\n\t\t\t\t}\n\t\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < n",
"i",
"n",
"i++",
"i++",
"i",
"{\n\t\t\t\tx = in.readLine();\n\t\t\t\tString[] e = x.split(\" \");\n\t\t\t\t\n\t\t\t\tfor (int j = 0; j < m; j++) {\n\t\t\t\t\tif (i == 0) md[n][j] = 0;\n\t\t\t\t\t\n\t\t\t\t\tmd[i][j] = Integer.parseInt(e[j]);\n\t\t\t\t\tmd[i][m] = md[i][m] + md[i][j];\n\t\t\t\t\tmd[n][j] = md[n][j] + md[i][j];\n\t\t\t\t}\n\t\t\t}",
"{\n\t\t\t\tx = in.readLine();\n\t\t\t\tString[] e = x.split(\" \");\n\t\t\t\t\n\t\t\t\tfor (int j = 0; j < m; j++) {\n\t\t\t\t\tif (i == 0) md[n][j] = 0;\n\t\t\t\t\t\n\t\t\t\t\tmd[i][j] = Integer.parseInt(e[j]);\n\t\t\t\t\tmd[i][m] = md[i][m] + md[i][j];\n\t\t\t\t\tmd[n][j] = md[n][j] + md[i][j];\n\t\t\t\t}\n\t\t\t}",
"x = in.readLine()",
"x",
"in.readLine()",
"in.readLine",
"in",
"String[] e = x.split(\" \");",
"e",
"x.split(\" \")",
"x.split",
"x",
"\" \"",
"for (int j = 0; j < m; j++) {\n\t\t\t\t\tif (i == 0) md[n][j] = 0;\n\t\t\t\t\t\n\t\t\t\t\tmd[i][j] = Integer.parseInt(e[j]);\n\t\t\t\t\tmd[i][m] = md[i][m] + md[i][j];\n\t\t\t\t\tmd[n][j] = md[n][j] + md[i][j];\n\t\t\t\t}",
"int j = 0;",
"int j = 0;",
"j",
"0",
"j < m",
"j",
"m",
"j++",
"j++",
"j",
"{\n\t\t\t\t\tif (i == 0) md[n][j] = 0;\n\t\t\t\t\t\n\t\t\t\t\tmd[i][j] = Integer.parseInt(e[j]);\n\t\t\t\t\tmd[i][m] = md[i][m] + md[i][j];\n\t\t\t\t\tmd[n][j] = md[n][j] + md[i][j];\n\t\t\t\t}",
"{\n\t\t\t\t\tif (i == 0) md[n][j] = 0;\n\t\t\t\t\t\n\t\t\t\t\tmd[i][j] = Integer.parseInt(e[j]);\n\t\t\t\t\tmd[i][m] = md[i][m] + md[i][j];\n\t\t\t\t\tmd[n][j] = md[n][j] + md[i][j];\n\t\t\t\t}",
"if (i == 0) md[n][j] = 0;",
"i == 0",
"i",
"0",
"md[n][j] = 0",
"md[n][j]",
"md[n]",
"md",
"n",
"j",
"0",
"md[i][j] = Integer.parseInt(e[j])",
"md[i][j]",
"md[i]",
"md",
"i",
"j",
"Integer.parseInt(e[j])",
"Integer.parseInt",
"Integer",
"e[j]",
"e",
"j",
"md[i][m] = md[i][m] + md[i][j]",
"md[i][m]",
"md[i]",
"md",
"i",
"m",
"md[i][m] + md[i][j]",
"md[i][m]",
"md[i]",
"md",
"i",
"m",
"md[i][j]",
"md[i]",
"md",
"i",
"j",
"md[n][j] = md[n][j] + md[i][j]",
"md[n][j]",
"md[n]",
"md",
"n",
"j",
"md[n][j] + md[i][j]",
"md[n][j]",
"md[n]",
"md",
"n",
"j",
"md[i][j]",
"md[i]",
"md",
"i",
"j",
"md[n][m] = 0",
"md[n][m]",
"md[n]",
"md",
"n",
"m",
"0",
"for (int i = 0; i < n; i++) {\n\t\t\t\tmd[n][m] = md[n][m] + md[i][m];\n\t\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < n",
"i",
"n",
"i++",
"i++",
"i",
"{\n\t\t\t\tmd[n][m] = md[n][m] + md[i][m];\n\t\t\t}",
"{\n\t\t\t\tmd[n][m] = md[n][m] + md[i][m];\n\t\t\t}",
"md[n][m] = md[n][m] + md[i][m]",
"md[n][m]",
"md[n]",
"md",
"n",
"m",
"md[n][m] + md[i][m]",
"md[n][m]",
"md[n]",
"md",
"n",
"m",
"md[i][m]",
"md[i]",
"md",
"i",
"m",
"for (int i = 0; i < (n + 1); i++) {\n\t\t\t\tfor (int j = 0; j < (m + 1); j++) {\n\t\t\t\t\tif (j != 0) System.out.print(\" \");\n\t\t\t\t\tSystem.out.print(md[i][j]);\n\t\t\t\t}\n\t\t\t\tSystem.out.println();\n\t\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < (n + 1)",
"i",
"(n + 1)",
"n",
"1",
"i++",
"i++",
"i",
"{\n\t\t\t\tfor (int j = 0; j < (m + 1); j++) {\n\t\t\t\t\tif (j != 0) System.out.print(\" \");\n\t\t\t\t\tSystem.out.print(md[i][j]);\n\t\t\t\t}\n\t\t\t\tSystem.out.println();\n\t\t\t}",
"{\n\t\t\t\tfor (int j = 0; j < (m + 1); j++) {\n\t\t\t\t\tif (j != 0) System.out.print(\" \");\n\t\t\t\t\tSystem.out.print(md[i][j]);\n\t\t\t\t}\n\t\t\t\tSystem.out.println();\n\t\t\t}",
"for (int j = 0; j < (m + 1); j++) {\n\t\t\t\t\tif (j != 0) System.out.print(\" \");\n\t\t\t\t\tSystem.out.print(md[i][j]);\n\t\t\t\t}",
"int j = 0;",
"int j = 0;",
"j",
"0",
"j < (m + 1)",
"j",
"(m + 1)",
"m",
"1",
"j++",
"j++",
"j",
"{\n\t\t\t\t\tif (j != 0) System.out.print(\" \");\n\t\t\t\t\tSystem.out.print(md[i][j]);\n\t\t\t\t}",
"{\n\t\t\t\t\tif (j != 0) System.out.print(\" \");\n\t\t\t\t\tSystem.out.print(md[i][j]);\n\t\t\t\t}",
"if (j != 0) System.out.print(\" \");",
"j != 0",
"j",
"0",
"System.out.print(\" \")",
"System.out.print",
"System.out",
"System",
"System.out",
"\" \"",
"System.out.print(md[i][j])",
"System.out.print",
"System.out",
"System",
"System.out",
"md[i][j]",
"md[i]",
"md",
"i",
"j",
"System.out.println()",
"System.out.println",
"System.out",
"System",
"System.out",
"String[] args",
"args",
"public class Main {\n\tpublic static void main(String[] args) {\n\t\tBufferedReader in = new BufferedReader(new InputStreamReader(System.in));\n \n\t\tString x = \"\";\n\t\ttry {\n\t\t\tx = in.readLine();\n\t\t\tString[] nm = x.split(\" \");\n\t\t\tint n = Integer.parseInt(nm[0]);\n\t\t\tint m = Integer.parseInt(nm[1]);\n\t\t\t\n\t\t\tint[][] md = new int[n + 1][m + 1];\n\t\t\t\n\t\t\tfor (int i = 0; i < n; i++) {\n\t\t\t\tx = in.readLine();\n\t\t\t\tString[] e = x.split(\" \");\n\t\t\t\t\n\t\t\t\tfor (int j = 0; j < m; j++) {\n\t\t\t\t\tif (i == 0) md[n][j] = 0;\n\t\t\t\t\t\n\t\t\t\t\tmd[i][j] = Integer.parseInt(e[j]);\n\t\t\t\t\tmd[i][m] = md[i][m] + md[i][j];\n\t\t\t\t\tmd[n][j] = md[n][j] + md[i][j];\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tmd[n][m] = 0;\n\t\t\tfor (int i = 0; i < n; i++) {\n\t\t\t\tmd[n][m] = md[n][m] + md[i][m];\n\t\t\t}\n\t\t\t\n\t\t\tfor (int i = 0; i < (n + 1); i++) {\n\t\t\t\tfor (int j = 0; j < (m + 1); j++) {\n\t\t\t\t\tif (j != 0) System.out.print(\" \");\n\t\t\t\t\tSystem.out.print(md[i][j]);\n\t\t\t\t}\n\t\t\t\tSystem.out.println();\n\t\t\t}\n\t\t} catch (NumberFormatException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t} catch (IOException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t}\n}",
"public class Main {\n\tpublic static void main(String[] args) {\n\t\tBufferedReader in = new BufferedReader(new InputStreamReader(System.in));\n \n\t\tString x = \"\";\n\t\ttry {\n\t\t\tx = in.readLine();\n\t\t\tString[] nm = x.split(\" \");\n\t\t\tint n = Integer.parseInt(nm[0]);\n\t\t\tint m = Integer.parseInt(nm[1]);\n\t\t\t\n\t\t\tint[][] md = new int[n + 1][m + 1];\n\t\t\t\n\t\t\tfor (int i = 0; i < n; i++) {\n\t\t\t\tx = in.readLine();\n\t\t\t\tString[] e = x.split(\" \");\n\t\t\t\t\n\t\t\t\tfor (int j = 0; j < m; j++) {\n\t\t\t\t\tif (i == 0) md[n][j] = 0;\n\t\t\t\t\t\n\t\t\t\t\tmd[i][j] = Integer.parseInt(e[j]);\n\t\t\t\t\tmd[i][m] = md[i][m] + md[i][j];\n\t\t\t\t\tmd[n][j] = md[n][j] + md[i][j];\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tmd[n][m] = 0;\n\t\t\tfor (int i = 0; i < n; i++) {\n\t\t\t\tmd[n][m] = md[n][m] + md[i][m];\n\t\t\t}\n\t\t\t\n\t\t\tfor (int i = 0; i < (n + 1); i++) {\n\t\t\t\tfor (int j = 0; j < (m + 1); j++) {\n\t\t\t\t\tif (j != 0) System.out.print(\" \");\n\t\t\t\t\tSystem.out.print(md[i][j]);\n\t\t\t\t}\n\t\t\t\tSystem.out.println();\n\t\t\t}\n\t\t} catch (NumberFormatException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t} catch (IOException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t}\n}",
"Main"
] | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class Main {
public static void main(String[] args) {
BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
String x = "";
try {
x = in.readLine();
String[] nm = x.split(" ");
int n = Integer.parseInt(nm[0]);
int m = Integer.parseInt(nm[1]);
int[][] md = new int[n + 1][m + 1];
for (int i = 0; i < n; i++) {
x = in.readLine();
String[] e = x.split(" ");
for (int j = 0; j < m; j++) {
if (i == 0) md[n][j] = 0;
md[i][j] = Integer.parseInt(e[j]);
md[i][m] = md[i][m] + md[i][j];
md[n][j] = md[n][j] + md[i][j];
}
}
md[n][m] = 0;
for (int i = 0; i < n; i++) {
md[n][m] = md[n][m] + md[i][m];
}
for (int i = 0; i < (n + 1); i++) {
for (int j = 0; j < (m + 1); j++) {
if (j != 0) System.out.print(" ");
System.out.print(md[i][j]);
}
System.out.println();
}
} catch (NumberFormatException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
} |
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
41,
13,
20,
2,
13,
17,
2,
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,
18,
18,
13,
13,
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,
0,
18,
18,
13,
13,
13,
18,
18,
13,
13,
13,
0,
18,
18,
13,
13,
13,
18,
18,
13,
13,
13,
0,
18,
18,
13,
13,
13,
18,
18,
13,
13,
13,
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,
4,
18,
18,
13,
13,
18,
18,
13,
13,
13,
14,
2,
13,
13,
30,
4,
18,
18,
13,
13,
17,
4,
18,
18,
13,
13,
4,
18,
13,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
187,
5
],
[
187,
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
],
[
19,
20
],
[
20,
21
],
[
8,
22
],
[
22,
23
],
[
22,
24
],
[
25,
26
],
[
25,
27
],
[
28,
29
],
[
28,
30
],
[
8,
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
],
[
58,
62
],
[
57,
63
],
[
63,
64
],
[
64,
65
],
[
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
],
[
93,
94
],
[
94,
95
],
[
94,
96
],
[
93,
97
],
[
92,
98
],
[
98,
99
],
[
99,
100
],
[
99,
101
],
[
98,
102
],
[
91,
103
],
[
103,
104
],
[
104,
105
],
[
105,
106
],
[
105,
107
],
[
104,
108
],
[
103,
109
],
[
109,
110
],
[
110,
111
],
[
110,
112
],
[
109,
113
],
[
91,
114
],
[
114,
115
],
[
115,
116
],
[
116,
117
],
[
116,
118
],
[
115,
119
],
[
114,
120
],
[
120,
121
],
[
121,
122
],
[
121,
123
],
[
120,
124
],
[
8,
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
],
[
141,
142
],
[
142,
143
],
[
142,
144
],
[
140,
145
],
[
145,
146
],
[
145,
147
],
[
147,
148
],
[
147,
149
],
[
140,
150
],
[
150,
151
],
[
151,
152
],
[
140,
153
],
[
154,
154
],
[
154,
155
],
[
155,
156
],
[
156,
157
],
[
157,
158
],
[
157,
159
],
[
155,
160
],
[
160,
161
],
[
161,
162
],
[
161,
163
],
[
160,
164
],
[
154,
165
],
[
165,
166
],
[
166,
167
],
[
166,
168
],
[
165,
169
],
[
169,
170
],
[
170,
171
],
[
171,
172
],
[
172,
173
],
[
172,
174
],
[
170,
175
],
[
139,
176
],
[
176,
177
],
[
177,
178
],
[
178,
179
],
[
178,
180
],
[
8,
181
],
[
181,
182
],
[
182,
183
],
[
6,
184
],
[
184,
185
],
[
0,
186
],
[
186,
187
],
[
186,
188
]
] | [
"import java.util.Scanner;\n\npublic class Main{\n\tpublic static void main(String[] args){\n\t\tScanner in = new Scanner(System.in);\n\t\tint r = in.nextInt();\n\t\tint c = in.nextInt();\n\t\tint[][] ary = new int[r+1][c+1];\n\t\t\n\t\t//Insert the given values\n\t\tfor(int i=0; i<r; i++){\n\t\t\tfor(int j=0; j<c; j++){\n\t\t\t\tary[i][j] = in.nextInt();\n\t\t\t}\n\t\t}\n\t\t//Calculate the total values\n\t\tfor(int i=0; i<r; i++){\n\t\t\tfor(int j=0; j<c; j++){\n\t\t\t\tary[i][c] += ary[i][j];\n\t\t\t\tary[r][j] += ary[i][j];\n\t\t\t\tary[r][c] += ary[i][j];\n\t\t\t}\n\t\t}\n\t\t//Display the matrix\n\t\tfor(int i=0; i<r+1; i++){\n\t\t\tfor(int j=0; j<c+1; j++){\n\t\t\t\tSystem.out.print(ary[i][j]);\n\t\t\t\tif(j != c){\n\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t}\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}\n\t\tin.close();\n\t}\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main{\n\tpublic static void main(String[] args){\n\t\tScanner in = new Scanner(System.in);\n\t\tint r = in.nextInt();\n\t\tint c = in.nextInt();\n\t\tint[][] ary = new int[r+1][c+1];\n\t\t\n\t\t//Insert the given values\n\t\tfor(int i=0; i<r; i++){\n\t\t\tfor(int j=0; j<c; j++){\n\t\t\t\tary[i][j] = in.nextInt();\n\t\t\t}\n\t\t}\n\t\t//Calculate the total values\n\t\tfor(int i=0; i<r; i++){\n\t\t\tfor(int j=0; j<c; j++){\n\t\t\t\tary[i][c] += ary[i][j];\n\t\t\t\tary[r][j] += ary[i][j];\n\t\t\t\tary[r][c] += ary[i][j];\n\t\t\t}\n\t\t}\n\t\t//Display the matrix\n\t\tfor(int i=0; i<r+1; i++){\n\t\t\tfor(int j=0; j<c+1; j++){\n\t\t\t\tSystem.out.print(ary[i][j]);\n\t\t\t\tif(j != c){\n\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t}\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}\n\t\tin.close();\n\t}\n}",
"Main",
"public static void main(String[] args){\n\t\tScanner in = new Scanner(System.in);\n\t\tint r = in.nextInt();\n\t\tint c = in.nextInt();\n\t\tint[][] ary = new int[r+1][c+1];\n\t\t\n\t\t//Insert the given values\n\t\tfor(int i=0; i<r; i++){\n\t\t\tfor(int j=0; j<c; j++){\n\t\t\t\tary[i][j] = in.nextInt();\n\t\t\t}\n\t\t}\n\t\t//Calculate the total values\n\t\tfor(int i=0; i<r; i++){\n\t\t\tfor(int j=0; j<c; j++){\n\t\t\t\tary[i][c] += ary[i][j];\n\t\t\t\tary[r][j] += ary[i][j];\n\t\t\t\tary[r][c] += ary[i][j];\n\t\t\t}\n\t\t}\n\t\t//Display the matrix\n\t\tfor(int i=0; i<r+1; i++){\n\t\t\tfor(int j=0; j<c+1; j++){\n\t\t\t\tSystem.out.print(ary[i][j]);\n\t\t\t\tif(j != c){\n\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t}\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}\n\t\tin.close();\n\t}",
"main",
"{\n\t\tScanner in = new Scanner(System.in);\n\t\tint r = in.nextInt();\n\t\tint c = in.nextInt();\n\t\tint[][] ary = new int[r+1][c+1];\n\t\t\n\t\t//Insert the given values\n\t\tfor(int i=0; i<r; i++){\n\t\t\tfor(int j=0; j<c; j++){\n\t\t\t\tary[i][j] = in.nextInt();\n\t\t\t}\n\t\t}\n\t\t//Calculate the total values\n\t\tfor(int i=0; i<r; i++){\n\t\t\tfor(int j=0; j<c; j++){\n\t\t\t\tary[i][c] += ary[i][j];\n\t\t\t\tary[r][j] += ary[i][j];\n\t\t\t\tary[r][c] += ary[i][j];\n\t\t\t}\n\t\t}\n\t\t//Display the matrix\n\t\tfor(int i=0; i<r+1; i++){\n\t\t\tfor(int j=0; j<c+1; j++){\n\t\t\t\tSystem.out.print(ary[i][j]);\n\t\t\t\tif(j != c){\n\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t}\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}\n\t\tin.close();\n\t}",
"Scanner in = new Scanner(System.in);",
"in",
"new Scanner(System.in)",
"int r = in.nextInt();",
"r",
"in.nextInt()",
"in.nextInt",
"in",
"int c = in.nextInt();",
"c",
"in.nextInt()",
"in.nextInt",
"in",
"int[][] ary = new int[r+1][c+1];",
"ary",
"new int[r+1][c+1]",
"r+1",
"r",
"1",
"c+1",
"c",
"1",
"for(int i=0; i<r; i++){\n\t\t\tfor(int j=0; j<c; j++){\n\t\t\t\tary[i][j] = in.nextInt();\n\t\t\t}\n\t\t}",
"int i=0;",
"int i=0;",
"i",
"0",
"i<r",
"i",
"r",
"i++",
"i++",
"i",
"{\n\t\t\tfor(int j=0; j<c; j++){\n\t\t\t\tary[i][j] = in.nextInt();\n\t\t\t}\n\t\t}",
"{\n\t\t\tfor(int j=0; j<c; j++){\n\t\t\t\tary[i][j] = in.nextInt();\n\t\t\t}\n\t\t}",
"for(int j=0; j<c; j++){\n\t\t\t\tary[i][j] = in.nextInt();\n\t\t\t}",
"int j=0;",
"int j=0;",
"j",
"0",
"j<c",
"j",
"c",
"j++",
"j++",
"j",
"{\n\t\t\t\tary[i][j] = in.nextInt();\n\t\t\t}",
"{\n\t\t\t\tary[i][j] = in.nextInt();\n\t\t\t}",
"ary[i][j] = in.nextInt()",
"ary[i][j]",
"ary[i]",
"ary",
"i",
"j",
"in.nextInt()",
"in.nextInt",
"in",
"for(int i=0; i<r; i++){\n\t\t\tfor(int j=0; j<c; j++){\n\t\t\t\tary[i][c] += ary[i][j];\n\t\t\t\tary[r][j] += ary[i][j];\n\t\t\t\tary[r][c] += ary[i][j];\n\t\t\t}\n\t\t}",
"int i=0;",
"int i=0;",
"i",
"0",
"i<r",
"i",
"r",
"i++",
"i++",
"i",
"{\n\t\t\tfor(int j=0; j<c; j++){\n\t\t\t\tary[i][c] += ary[i][j];\n\t\t\t\tary[r][j] += ary[i][j];\n\t\t\t\tary[r][c] += ary[i][j];\n\t\t\t}\n\t\t}",
"{\n\t\t\tfor(int j=0; j<c; j++){\n\t\t\t\tary[i][c] += ary[i][j];\n\t\t\t\tary[r][j] += ary[i][j];\n\t\t\t\tary[r][c] += ary[i][j];\n\t\t\t}\n\t\t}",
"for(int j=0; j<c; j++){\n\t\t\t\tary[i][c] += ary[i][j];\n\t\t\t\tary[r][j] += ary[i][j];\n\t\t\t\tary[r][c] += ary[i][j];\n\t\t\t}",
"int j=0;",
"int j=0;",
"j",
"0",
"j<c",
"j",
"c",
"j++",
"j++",
"j",
"{\n\t\t\t\tary[i][c] += ary[i][j];\n\t\t\t\tary[r][j] += ary[i][j];\n\t\t\t\tary[r][c] += ary[i][j];\n\t\t\t}",
"{\n\t\t\t\tary[i][c] += ary[i][j];\n\t\t\t\tary[r][j] += ary[i][j];\n\t\t\t\tary[r][c] += ary[i][j];\n\t\t\t}",
"ary[i][c] += ary[i][j]",
"ary[i][c]",
"ary[i]",
"ary",
"i",
"c",
"ary[i][j]",
"ary[i]",
"ary",
"i",
"j",
"ary[r][j] += ary[i][j]",
"ary[r][j]",
"ary[r]",
"ary",
"r",
"j",
"ary[i][j]",
"ary[i]",
"ary",
"i",
"j",
"ary[r][c] += ary[i][j]",
"ary[r][c]",
"ary[r]",
"ary",
"r",
"c",
"ary[i][j]",
"ary[i]",
"ary",
"i",
"j",
"for(int i=0; i<r+1; i++){\n\t\t\tfor(int j=0; j<c+1; j++){\n\t\t\t\tSystem.out.print(ary[i][j]);\n\t\t\t\tif(j != c){\n\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t}\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}",
"int i=0;",
"int i=0;",
"i",
"0",
"i<r+1",
"i",
"r+1",
"r",
"1",
"i++",
"i++",
"i",
"{\n\t\t\tfor(int j=0; j<c+1; j++){\n\t\t\t\tSystem.out.print(ary[i][j]);\n\t\t\t\tif(j != c){\n\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t}\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}",
"{\n\t\t\tfor(int j=0; j<c+1; j++){\n\t\t\t\tSystem.out.print(ary[i][j]);\n\t\t\t\tif(j != c){\n\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t}\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}",
"for(int j=0; j<c+1; j++){\n\t\t\t\tSystem.out.print(ary[i][j]);\n\t\t\t\tif(j != c){\n\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t}\n\t\t\t}",
"int j=0;",
"int j=0;",
"j",
"0",
"j<c+1",
"j",
"c+1",
"c",
"1",
"j++",
"j++",
"j",
"{\n\t\t\t\tSystem.out.print(ary[i][j]);\n\t\t\t\tif(j != c){\n\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t}\n\t\t\t}",
"{\n\t\t\t\tSystem.out.print(ary[i][j]);\n\t\t\t\tif(j != c){\n\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t}\n\t\t\t}",
"System.out.print(ary[i][j])",
"System.out.print",
"System.out",
"System",
"System.out",
"ary[i][j]",
"ary[i]",
"ary",
"i",
"j",
"if(j != c){\n\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t}",
"j != c",
"j",
"c",
"{\n\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t}",
"System.out.print(\" \")",
"System.out.print",
"System.out",
"System",
"System.out",
"\" \"",
"System.out.println()",
"System.out.println",
"System.out",
"System",
"System.out",
"in.close()",
"in.close",
"in",
"String[] args",
"args",
"public class Main{\n\tpublic static void main(String[] args){\n\t\tScanner in = new Scanner(System.in);\n\t\tint r = in.nextInt();\n\t\tint c = in.nextInt();\n\t\tint[][] ary = new int[r+1][c+1];\n\t\t\n\t\t//Insert the given values\n\t\tfor(int i=0; i<r; i++){\n\t\t\tfor(int j=0; j<c; j++){\n\t\t\t\tary[i][j] = in.nextInt();\n\t\t\t}\n\t\t}\n\t\t//Calculate the total values\n\t\tfor(int i=0; i<r; i++){\n\t\t\tfor(int j=0; j<c; j++){\n\t\t\t\tary[i][c] += ary[i][j];\n\t\t\t\tary[r][j] += ary[i][j];\n\t\t\t\tary[r][c] += ary[i][j];\n\t\t\t}\n\t\t}\n\t\t//Display the matrix\n\t\tfor(int i=0; i<r+1; i++){\n\t\t\tfor(int j=0; j<c+1; j++){\n\t\t\t\tSystem.out.print(ary[i][j]);\n\t\t\t\tif(j != c){\n\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t}\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}\n\t\tin.close();\n\t}\n}",
"public class Main{\n\tpublic static void main(String[] args){\n\t\tScanner in = new Scanner(System.in);\n\t\tint r = in.nextInt();\n\t\tint c = in.nextInt();\n\t\tint[][] ary = new int[r+1][c+1];\n\t\t\n\t\t//Insert the given values\n\t\tfor(int i=0; i<r; i++){\n\t\t\tfor(int j=0; j<c; j++){\n\t\t\t\tary[i][j] = in.nextInt();\n\t\t\t}\n\t\t}\n\t\t//Calculate the total values\n\t\tfor(int i=0; i<r; i++){\n\t\t\tfor(int j=0; j<c; j++){\n\t\t\t\tary[i][c] += ary[i][j];\n\t\t\t\tary[r][j] += ary[i][j];\n\t\t\t\tary[r][c] += ary[i][j];\n\t\t\t}\n\t\t}\n\t\t//Display the matrix\n\t\tfor(int i=0; i<r+1; i++){\n\t\t\tfor(int j=0; j<c+1; j++){\n\t\t\t\tSystem.out.print(ary[i][j]);\n\t\t\t\tif(j != c){\n\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t}\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}\n\t\tin.close();\n\t}\n}",
"Main"
] | import java.util.Scanner;
public class Main{
public static void main(String[] args){
Scanner in = new Scanner(System.in);
int r = in.nextInt();
int c = in.nextInt();
int[][] ary = new int[r+1][c+1];
//Insert the given values
for(int i=0; i<r; i++){
for(int j=0; j<c; j++){
ary[i][j] = in.nextInt();
}
}
//Calculate the total values
for(int i=0; i<r; i++){
for(int j=0; j<c; j++){
ary[i][c] += ary[i][j];
ary[r][j] += ary[i][j];
ary[r][c] += ary[i][j];
}
}
//Display the matrix
for(int i=0; i<r+1; i++){
for(int j=0; j<c+1; j++){
System.out.print(ary[i][j]);
if(j != c){
System.out.print(" ");
}
}
System.out.println();
}
in.close();
}
} |
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
17,
41,
13,
17,
41,
13,
20,
42,
4,
18,
13,
30,
0,
13,
4,
18,
13,
0,
13,
4,
18,
13,
3,
41,
13,
20,
4,
18,
13,
13,
13,
42,
4,
18,
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,
41,
13,
4,
18,
13,
4,
18,
13,
13,
13,
13,
3,
4,
18,
13,
4,
18,
13,
4,
18,
13,
23,
13,
6,
13,
41,
13,
12,
13,
30,
0,
13,
20,
2,
13,
17,
2,
13,
17,
23,
13,
23,
13,
12,
13,
30,
0,
18,
18,
13,
13,
13,
13,
23,
13,
23,
13,
23,
13,
12,
13,
30,
11,
1,
41,
13,
17,
2,
13,
18,
13,
13,
1,
40,
13,
30,
30,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
18,
18,
13,
17,
13,
1,
40,
13,
30,
30,
0,
13,
2,
18,
18,
13,
13,
13,
13,
0,
18,
18,
13,
13,
2,
18,
18,
13,
17,
13,
17,
13,
12,
13,
30,
11,
1,
41,
13,
17,
2,
13,
18,
18,
13,
17,
13,
1,
40,
13,
30,
30,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
18,
13,
13,
1,
40,
13,
30,
30,
0,
13,
2,
18,
18,
13,
13,
13,
13,
0,
18,
18,
13,
2,
18,
13,
13,
17,
13,
13,
12,
13,
30,
11,
1,
41,
13,
17,
2,
13,
18,
13,
13,
1,
40,
13,
30,
30,
11,
1,
41,
13,
17,
2,
13,
2,
18,
18,
13,
17,
13,
17,
1,
40,
13,
30,
30,
4,
18,
18,
13,
13,
2,
18,
18,
13,
13,
13,
17,
4,
18,
18,
13,
13,
18,
18,
13,
13,
2,
18,
18,
13,
17,
13,
17,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
316,
5
],
[
316,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
8,
15
],
[
15,
16
],
[
15,
17
],
[
8,
18
],
[
18,
19
],
[
19,
20
],
[
20,
21
],
[
18,
22
],
[
22,
23
],
[
23,
24
],
[
23,
25
],
[
25,
26
],
[
26,
27
],
[
22,
28
],
[
28,
29
],
[
28,
30
],
[
30,
31
],
[
31,
32
],
[
22,
33
],
[
8,
34
],
[
34,
35
],
[
34,
36
],
[
8,
37
],
[
37,
38
],
[
38,
39
],
[
37,
40
],
[
37,
41
],
[
8,
42
],
[
42,
43
],
[
43,
44
],
[
44,
45
],
[
42,
46
],
[
46,
47
],
[
47,
48
],
[
48,
49
],
[
49,
50
],
[
49,
51
],
[
47,
52
],
[
52,
53
],
[
52,
54
],
[
47,
55
],
[
55,
56
],
[
56,
57
],
[
47,
58
],
[
59,
59
],
[
59,
60
],
[
60,
61
],
[
61,
62
],
[
62,
63
],
[
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
],
[
76,
77
],
[
72,
78
],
[
78,
79
],
[
79,
80
],
[
78,
81
],
[
78,
82
],
[
78,
83
],
[
46,
84
],
[
8,
85
],
[
85,
86
],
[
86,
87
],
[
8,
88
],
[
88,
89
],
[
89,
90
],
[
8,
91
],
[
91,
92
],
[
92,
93
],
[
6,
94
],
[
94,
95
],
[
0,
96
],
[
96,
97
],
[
96,
98
],
[
98,
99
],
[
96,
100
],
[
100,
101
],
[
100,
102
],
[
102,
103
],
[
103,
104
],
[
103,
105
],
[
106,
107
],
[
106,
108
],
[
109,
110
],
[
109,
111
],
[
100,
112
],
[
112,
113
],
[
100,
114
],
[
114,
115
],
[
96,
116
],
[
116,
117
],
[
116,
118
],
[
118,
119
],
[
119,
120
],
[
120,
121
],
[
121,
122
],
[
121,
123
],
[
120,
124
],
[
119,
125
],
[
116,
126
],
[
126,
127
],
[
116,
128
],
[
128,
129
],
[
116,
130
],
[
130,
131
],
[
96,
132
],
[
132,
133
],
[
132,
134
],
[
134,
135
],
[
135,
136
],
[
136,
137
],
[
137,
138
],
[
137,
139
],
[
135,
140
],
[
140,
141
],
[
140,
142
],
[
142,
143
],
[
142,
144
],
[
135,
145
],
[
145,
146
],
[
146,
147
],
[
135,
148
],
[
149,
149
],
[
149,
150
],
[
150,
151
],
[
150,
152
],
[
149,
153
],
[
153,
154
],
[
154,
155
],
[
155,
156
],
[
155,
157
],
[
153,
158
],
[
158,
159
],
[
158,
160
],
[
160,
161
],
[
161,
162
],
[
161,
163
],
[
160,
164
],
[
153,
165
],
[
165,
166
],
[
166,
167
],
[
153,
168
],
[
169,
169
],
[
169,
170
],
[
170,
171
],
[
170,
172
],
[
172,
173
],
[
173,
174
],
[
174,
175
],
[
174,
176
],
[
173,
177
],
[
172,
178
],
[
149,
179
],
[
179,
180
],
[
180,
181
],
[
181,
182
],
[
181,
183
],
[
180,
184
],
[
184,
185
],
[
185,
186
],
[
186,
187
],
[
186,
188
],
[
185,
189
],
[
184,
190
],
[
179,
191
],
[
96,
192
],
[
192,
193
],
[
192,
194
],
[
194,
195
],
[
195,
196
],
[
196,
197
],
[
197,
198
],
[
197,
199
],
[
195,
200
],
[
200,
201
],
[
200,
202
],
[
202,
203
],
[
203,
204
],
[
203,
205
],
[
202,
206
],
[
195,
207
],
[
207,
208
],
[
208,
209
],
[
195,
210
],
[
211,
211
],
[
211,
212
],
[
212,
213
],
[
212,
214
],
[
211,
215
],
[
215,
216
],
[
216,
217
],
[
217,
218
],
[
217,
219
],
[
215,
220
],
[
220,
221
],
[
220,
222
],
[
222,
223
],
[
222,
224
],
[
215,
225
],
[
225,
226
],
[
226,
227
],
[
215,
228
],
[
229,
229
],
[
229,
230
],
[
230,
231
],
[
230,
232
],
[
232,
233
],
[
233,
234
],
[
234,
235
],
[
234,
236
],
[
233,
237
],
[
232,
238
],
[
211,
239
],
[
239,
240
],
[
240,
241
],
[
241,
242
],
[
241,
243
],
[
243,
244
],
[
244,
245
],
[
244,
246
],
[
243,
247
],
[
240,
248
],
[
239,
249
],
[
96,
250
],
[
250,
251
],
[
250,
252
],
[
252,
253
],
[
253,
254
],
[
254,
255
],
[
255,
256
],
[
255,
257
],
[
253,
258
],
[
258,
259
],
[
258,
260
],
[
260,
261
],
[
260,
262
],
[
253,
263
],
[
263,
264
],
[
264,
265
],
[
253,
266
],
[
267,
267
],
[
267,
268
],
[
268,
269
],
[
269,
270
],
[
270,
271
],
[
270,
272
],
[
268,
273
],
[
273,
274
],
[
273,
275
],
[
275,
276
],
[
276,
277
],
[
277,
278
],
[
277,
279
],
[
276,
280
],
[
275,
281
],
[
268,
282
],
[
282,
283
],
[
283,
284
],
[
268,
285
],
[
286,
286
],
[
286,
287
],
[
287,
288
],
[
288,
289
],
[
289,
290
],
[
289,
291
],
[
287,
292
],
[
292,
293
],
[
293,
294
],
[
294,
295
],
[
294,
296
],
[
293,
297
],
[
292,
298
],
[
267,
299
],
[
299,
300
],
[
300,
301
],
[
301,
302
],
[
301,
303
],
[
299,
304
],
[
304,
305
],
[
305,
306
],
[
305,
307
],
[
304,
308
],
[
308,
309
],
[
309,
310
],
[
310,
311
],
[
310,
312
],
[
309,
313
],
[
308,
314
],
[
0,
315
],
[
315,
316
],
[
315,
317
]
] | [
"\nimport java.util.Scanner;\n\npublic class Main{\n\n\tpublic static void main(String[] args) {\n\n\t\t//\n\t\tint height = 0;\n\t\tint width = 0;\n\n\t\t// 表の縦、横を決める入力値を持ってくる\n\t\tScanner sc = new Scanner(System.in);\n\t\twhile (sc.hasNext()) {\n\t\t\theight = sc.nextInt();\n\t\t\twidth = sc.nextInt();\n\t\t\tbreak;\n\t\t}\n\n\t\t// シートのインスタンスを作る\n\t\texcel ex = new excel();\n\n\t\t// 入力値から表を作る\n\t\tex.setSheet(height, width);\n\n\t\t// 表に入力する値を持ってくる\n\t\twhile (sc.hasNext()) {\n\n\t\t\t// 入力された値を表のそれぞれの場所に入れる\n\t\t\tfor (int i = 0; i < height; i++) {\n\t\t\t\tfor (int s = 0; s < width; s++) {\n\t\t\t\t\tint input_number = sc.nextInt();\n\t\t\t\t\tex.setSell(input_number, i, s);\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\t\t}\n\t\t// 表の最後の列に行の計算結果を挿入\n\t\tex.sum_row();\n\t\tex.sum_column();\n\n\t\t// 表全体を出力\n\t\tex.out_sheet();\n\n\t}\n}\n\nclass excel {\n\n\t// フィールド\n\tint[][] sheet;\n\n\t// 入力値から表(2次元配列)を作るメソッド\n\tpublic void setSheet(int height, int width) {\n\n\t\t// 最後に合計値を出す列を用意\n\t\tsheet = new int[height + 1][width + 1];\n\t}\n\n\t// 入力値をセルに入れる\n\tpublic void setSell(int input_number, int height, int width) {\n\t\tsheet[height][width] = input_number;\n\t}\n\n\t// 行の合計値を最後のセルに追加\n\tpublic void sum_row() {\n\t\t// 行の数だけ回す\n\t\tfor (int i = 0; i < sheet.length; i++) {\n\n\t\t\t// 列の数だけ回す\n\t\t\tint sum = 0;\n\t\t\tfor (int s = 0; s < sheet[0].length; s++) {\n\n\t\t\t\t// 行の合計値\n\t\t\t\tsum = sheet[i][s] + sum;\n\t\t\t}\n\t\t\t// 最後に追加\n\t\t\tsheet[i][(sheet[0].length - 1)] = sum;\n\t\t}\n\t}\n\n\t// 列の合計値を最後のセルに追加\n\tpublic void sum_column() {\n\t\t// 列の数だけ回す\n\t\tfor (int c = 0; c < sheet[0].length; c++) {\n\n\t\t\t// 行の数だけ回す\n\t\t\tint sum = 0;\n\t\t\tfor (int s = 0; s < sheet.length; s++) {\n\n\t\t\t\t// 行の合計値\n\t\t\t\tsum = sheet[s][c] + sum;\n\t\t\t}\n\t\t\t// 最後に追加\n\t\t\tsheet[sheet.length-1][c] = sum;\n\t\t}\n\t}\n\n\t// 表全体を出力\n\tpublic void out_sheet() {\n\n\t\t// 行の回数\n\t\tfor (int i = 0; i < sheet.length; i++) {\n\n\t\t\t// 列の回数\n\t\t\tfor (int s = 0; s < sheet[0].length - 1; s++) {\n\t\t\t\t// 空白を一つ空けて表示\n\t\t\t\tSystem.out.print(sheet[i][s] + \" \");\n\t\t\t}\n\t\t\t// 最後の行を改行\n\t\t\tSystem.out.println(sheet[i][(sheet[0].length - 1)]);\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\n\t\t//\n\t\tint height = 0;\n\t\tint width = 0;\n\n\t\t// 表の縦、横を決める入力値を持ってくる\n\t\tScanner sc = new Scanner(System.in);\n\t\twhile (sc.hasNext()) {\n\t\t\theight = sc.nextInt();\n\t\t\twidth = sc.nextInt();\n\t\t\tbreak;\n\t\t}\n\n\t\t// シートのインスタンスを作る\n\t\texcel ex = new excel();\n\n\t\t// 入力値から表を作る\n\t\tex.setSheet(height, width);\n\n\t\t// 表に入力する値を持ってくる\n\t\twhile (sc.hasNext()) {\n\n\t\t\t// 入力された値を表のそれぞれの場所に入れる\n\t\t\tfor (int i = 0; i < height; i++) {\n\t\t\t\tfor (int s = 0; s < width; s++) {\n\t\t\t\t\tint input_number = sc.nextInt();\n\t\t\t\t\tex.setSell(input_number, i, s);\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\t\t}\n\t\t// 表の最後の列に行の計算結果を挿入\n\t\tex.sum_row();\n\t\tex.sum_column();\n\n\t\t// 表全体を出力\n\t\tex.out_sheet();\n\n\t}\n}",
"Main",
"public static void main(String[] args) {\n\n\t\t//\n\t\tint height = 0;\n\t\tint width = 0;\n\n\t\t// 表の縦、横を決める入力値を持ってくる\n\t\tScanner sc = new Scanner(System.in);\n\t\twhile (sc.hasNext()) {\n\t\t\theight = sc.nextInt();\n\t\t\twidth = sc.nextInt();\n\t\t\tbreak;\n\t\t}\n\n\t\t// シートのインスタンスを作る\n\t\texcel ex = new excel();\n\n\t\t// 入力値から表を作る\n\t\tex.setSheet(height, width);\n\n\t\t// 表に入力する値を持ってくる\n\t\twhile (sc.hasNext()) {\n\n\t\t\t// 入力された値を表のそれぞれの場所に入れる\n\t\t\tfor (int i = 0; i < height; i++) {\n\t\t\t\tfor (int s = 0; s < width; s++) {\n\t\t\t\t\tint input_number = sc.nextInt();\n\t\t\t\t\tex.setSell(input_number, i, s);\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\t\t}\n\t\t// 表の最後の列に行の計算結果を挿入\n\t\tex.sum_row();\n\t\tex.sum_column();\n\n\t\t// 表全体を出力\n\t\tex.out_sheet();\n\n\t}",
"main",
"{\n\n\t\t//\n\t\tint height = 0;\n\t\tint width = 0;\n\n\t\t// 表の縦、横を決める入力値を持ってくる\n\t\tScanner sc = new Scanner(System.in);\n\t\twhile (sc.hasNext()) {\n\t\t\theight = sc.nextInt();\n\t\t\twidth = sc.nextInt();\n\t\t\tbreak;\n\t\t}\n\n\t\t// シートのインスタンスを作る\n\t\texcel ex = new excel();\n\n\t\t// 入力値から表を作る\n\t\tex.setSheet(height, width);\n\n\t\t// 表に入力する値を持ってくる\n\t\twhile (sc.hasNext()) {\n\n\t\t\t// 入力された値を表のそれぞれの場所に入れる\n\t\t\tfor (int i = 0; i < height; i++) {\n\t\t\t\tfor (int s = 0; s < width; s++) {\n\t\t\t\t\tint input_number = sc.nextInt();\n\t\t\t\t\tex.setSell(input_number, i, s);\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\t\t}\n\t\t// 表の最後の列に行の計算結果を挿入\n\t\tex.sum_row();\n\t\tex.sum_column();\n\n\t\t// 表全体を出力\n\t\tex.out_sheet();\n\n\t}",
"int height = 0;",
"height",
"0",
"int width = 0;",
"width",
"0",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"while (sc.hasNext()) {\n\t\t\theight = sc.nextInt();\n\t\t\twidth = sc.nextInt();\n\t\t\tbreak;\n\t\t}",
"sc.hasNext()",
"sc.hasNext",
"sc",
"{\n\t\t\theight = sc.nextInt();\n\t\t\twidth = sc.nextInt();\n\t\t\tbreak;\n\t\t}",
"height = sc.nextInt()",
"height",
"sc.nextInt()",
"sc.nextInt",
"sc",
"width = sc.nextInt()",
"width",
"sc.nextInt()",
"sc.nextInt",
"sc",
"break;",
"excel ex = new excel();",
"ex",
"new excel()",
"ex.setSheet(height, width)",
"ex.setSheet",
"ex",
"height",
"width",
"while (sc.hasNext()) {\n\n\t\t\t// 入力された値を表のそれぞれの場所に入れる\n\t\t\tfor (int i = 0; i < height; i++) {\n\t\t\t\tfor (int s = 0; s < width; s++) {\n\t\t\t\t\tint input_number = sc.nextInt();\n\t\t\t\t\tex.setSell(input_number, i, s);\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\t\t}",
"sc.hasNext()",
"sc.hasNext",
"sc",
"{\n\n\t\t\t// 入力された値を表のそれぞれの場所に入れる\n\t\t\tfor (int i = 0; i < height; i++) {\n\t\t\t\tfor (int s = 0; s < width; s++) {\n\t\t\t\t\tint input_number = sc.nextInt();\n\t\t\t\t\tex.setSell(input_number, i, s);\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\t\t}",
"for (int i = 0; i < height; i++) {\n\t\t\t\tfor (int s = 0; s < width; s++) {\n\t\t\t\t\tint input_number = sc.nextInt();\n\t\t\t\t\tex.setSell(input_number, i, s);\n\t\t\t\t}\n\t\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < height",
"i",
"height",
"i++",
"i++",
"i",
"{\n\t\t\t\tfor (int s = 0; s < width; s++) {\n\t\t\t\t\tint input_number = sc.nextInt();\n\t\t\t\t\tex.setSell(input_number, i, s);\n\t\t\t\t}\n\t\t\t}",
"{\n\t\t\t\tfor (int s = 0; s < width; s++) {\n\t\t\t\t\tint input_number = sc.nextInt();\n\t\t\t\t\tex.setSell(input_number, i, s);\n\t\t\t\t}\n\t\t\t}",
"for (int s = 0; s < width; s++) {\n\t\t\t\t\tint input_number = sc.nextInt();\n\t\t\t\t\tex.setSell(input_number, i, s);\n\t\t\t\t}",
"int s = 0;",
"int s = 0;",
"s",
"0",
"s < width",
"s",
"width",
"s++",
"s++",
"s",
"{\n\t\t\t\t\tint input_number = sc.nextInt();\n\t\t\t\t\tex.setSell(input_number, i, s);\n\t\t\t\t}",
"{\n\t\t\t\t\tint input_number = sc.nextInt();\n\t\t\t\t\tex.setSell(input_number, i, s);\n\t\t\t\t}",
"int input_number = sc.nextInt();",
"input_number",
"sc.nextInt()",
"sc.nextInt",
"sc",
"ex.setSell(input_number, i, s)",
"ex.setSell",
"ex",
"input_number",
"i",
"s",
"break;",
"ex.sum_row()",
"ex.sum_row",
"ex",
"ex.sum_column()",
"ex.sum_column",
"ex",
"ex.out_sheet()",
"ex.out_sheet",
"ex",
"String[] args",
"args",
"class excel {\n\n\t// フィールド\n\tint[][] sheet;\n\n\t// 入力値から表(2次元配列)を作るメソッド\n\tpublic void setSheet(int height, int width) {\n\n\t\t// 最後に合計値を出す列を用意\n\t\tsheet = new int[height + 1][width + 1];\n\t}\n\n\t// 入力値をセルに入れる\n\tpublic void setSell(int input_number, int height, int width) {\n\t\tsheet[height][width] = input_number;\n\t}\n\n\t// 行の合計値を最後のセルに追加\n\tpublic void sum_row() {\n\t\t// 行の数だけ回す\n\t\tfor (int i = 0; i < sheet.length; i++) {\n\n\t\t\t// 列の数だけ回す\n\t\t\tint sum = 0;\n\t\t\tfor (int s = 0; s < sheet[0].length; s++) {\n\n\t\t\t\t// 行の合計値\n\t\t\t\tsum = sheet[i][s] + sum;\n\t\t\t}\n\t\t\t// 最後に追加\n\t\t\tsheet[i][(sheet[0].length - 1)] = sum;\n\t\t}\n\t}\n\n\t// 列の合計値を最後のセルに追加\n\tpublic void sum_column() {\n\t\t// 列の数だけ回す\n\t\tfor (int c = 0; c < sheet[0].length; c++) {\n\n\t\t\t// 行の数だけ回す\n\t\t\tint sum = 0;\n\t\t\tfor (int s = 0; s < sheet.length; s++) {\n\n\t\t\t\t// 行の合計値\n\t\t\t\tsum = sheet[s][c] + sum;\n\t\t\t}\n\t\t\t// 最後に追加\n\t\t\tsheet[sheet.length-1][c] = sum;\n\t\t}\n\t}\n\n\t// 表全体を出力\n\tpublic void out_sheet() {\n\n\t\t// 行の回数\n\t\tfor (int i = 0; i < sheet.length; i++) {\n\n\t\t\t// 列の回数\n\t\t\tfor (int s = 0; s < sheet[0].length - 1; s++) {\n\t\t\t\t// 空白を一つ空けて表示\n\t\t\t\tSystem.out.print(sheet[i][s] + \" \");\n\t\t\t}\n\t\t\t// 最後の行を改行\n\t\t\tSystem.out.println(sheet[i][(sheet[0].length - 1)]);\n\t\t}\n\t}\n}",
"excel",
"// フィールド\n\tint[][] sheet;",
"sheet",
"// 入力値から表(2次元配列)を作るメソッド\n\tpublic void setSheet(int height, int width) {\n\n\t\t// 最後に合計値を出す列を用意\n\t\tsheet = new int[height + 1][width + 1];\n\t}",
"setSheet",
"{\n\n\t\t// 最後に合計値を出す列を用意\n\t\tsheet = new int[height + 1][width + 1];\n\t}",
"sheet = new int[height + 1][width + 1]",
"sheet",
"new int[height + 1][width + 1]",
"height + 1",
"height",
"1",
"width + 1",
"width",
"1",
"int height",
"height",
"int width",
"width",
"// 入力値をセルに入れる\n\tpublic void setSell(int input_number, int height, int width) {\n\t\tsheet[height][width] = input_number;\n\t}",
"setSell",
"{\n\t\tsheet[height][width] = input_number;\n\t}",
"sheet[height][width] = input_number",
"sheet[height][width]",
"sheet[height]",
"sheet",
"height",
"width",
"input_number",
"int input_number",
"input_number",
"int height",
"height",
"int width",
"width",
"// 行の合計値を最後のセルに追加\n\tpublic void sum_row() {\n\t\t// 行の数だけ回す\n\t\tfor (int i = 0; i < sheet.length; i++) {\n\n\t\t\t// 列の数だけ回す\n\t\t\tint sum = 0;\n\t\t\tfor (int s = 0; s < sheet[0].length; s++) {\n\n\t\t\t\t// 行の合計値\n\t\t\t\tsum = sheet[i][s] + sum;\n\t\t\t}\n\t\t\t// 最後に追加\n\t\t\tsheet[i][(sheet[0].length - 1)] = sum;\n\t\t}\n\t}",
"sum_row",
"{\n\t\t// 行の数だけ回す\n\t\tfor (int i = 0; i < sheet.length; i++) {\n\n\t\t\t// 列の数だけ回す\n\t\t\tint sum = 0;\n\t\t\tfor (int s = 0; s < sheet[0].length; s++) {\n\n\t\t\t\t// 行の合計値\n\t\t\t\tsum = sheet[i][s] + sum;\n\t\t\t}\n\t\t\t// 最後に追加\n\t\t\tsheet[i][(sheet[0].length - 1)] = sum;\n\t\t}\n\t}",
"for (int i = 0; i < sheet.length; i++) {\n\n\t\t\t// 列の数だけ回す\n\t\t\tint sum = 0;\n\t\t\tfor (int s = 0; s < sheet[0].length; s++) {\n\n\t\t\t\t// 行の合計値\n\t\t\t\tsum = sheet[i][s] + sum;\n\t\t\t}\n\t\t\t// 最後に追加\n\t\t\tsheet[i][(sheet[0].length - 1)] = sum;\n\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < sheet.length",
"i",
"sheet.length",
"sheet",
"sheet.length",
"i++",
"i++",
"i",
"{\n\n\t\t\t// 列の数だけ回す\n\t\t\tint sum = 0;\n\t\t\tfor (int s = 0; s < sheet[0].length; s++) {\n\n\t\t\t\t// 行の合計値\n\t\t\t\tsum = sheet[i][s] + sum;\n\t\t\t}\n\t\t\t// 最後に追加\n\t\t\tsheet[i][(sheet[0].length - 1)] = sum;\n\t\t}",
"{\n\n\t\t\t// 列の数だけ回す\n\t\t\tint sum = 0;\n\t\t\tfor (int s = 0; s < sheet[0].length; s++) {\n\n\t\t\t\t// 行の合計値\n\t\t\t\tsum = sheet[i][s] + sum;\n\t\t\t}\n\t\t\t// 最後に追加\n\t\t\tsheet[i][(sheet[0].length - 1)] = sum;\n\t\t}",
"int sum = 0;",
"sum",
"0",
"for (int s = 0; s < sheet[0].length; s++) {\n\n\t\t\t\t// 行の合計値\n\t\t\t\tsum = sheet[i][s] + sum;\n\t\t\t}",
"int s = 0;",
"int s = 0;",
"s",
"0",
"s < sheet[0].length",
"s",
"sheet[0].length",
"sheet[0]",
"sheet",
"0",
"sheet[0].length",
"s++",
"s++",
"s",
"{\n\n\t\t\t\t// 行の合計値\n\t\t\t\tsum = sheet[i][s] + sum;\n\t\t\t}",
"{\n\n\t\t\t\t// 行の合計値\n\t\t\t\tsum = sheet[i][s] + sum;\n\t\t\t}",
"sum = sheet[i][s] + sum",
"sum",
"sheet[i][s] + sum",
"sheet[i][s]",
"sheet[i]",
"sheet",
"i",
"s",
"sum",
"sheet[i][(sheet[0].length - 1)] = sum",
"sheet[i][(sheet[0].length - 1)]",
"sheet[i]",
"sheet",
"i",
"(sheet[0].length - 1)",
"sheet[0].length",
"sheet[0]",
"sheet",
"0",
"sheet[0].length",
"1",
"sum",
"// 列の合計値を最後のセルに追加\n\tpublic void sum_column() {\n\t\t// 列の数だけ回す\n\t\tfor (int c = 0; c < sheet[0].length; c++) {\n\n\t\t\t// 行の数だけ回す\n\t\t\tint sum = 0;\n\t\t\tfor (int s = 0; s < sheet.length; s++) {\n\n\t\t\t\t// 行の合計値\n\t\t\t\tsum = sheet[s][c] + sum;\n\t\t\t}\n\t\t\t// 最後に追加\n\t\t\tsheet[sheet.length-1][c] = sum;\n\t\t}\n\t}",
"sum_column",
"{\n\t\t// 列の数だけ回す\n\t\tfor (int c = 0; c < sheet[0].length; c++) {\n\n\t\t\t// 行の数だけ回す\n\t\t\tint sum = 0;\n\t\t\tfor (int s = 0; s < sheet.length; s++) {\n\n\t\t\t\t// 行の合計値\n\t\t\t\tsum = sheet[s][c] + sum;\n\t\t\t}\n\t\t\t// 最後に追加\n\t\t\tsheet[sheet.length-1][c] = sum;\n\t\t}\n\t}",
"for (int c = 0; c < sheet[0].length; c++) {\n\n\t\t\t// 行の数だけ回す\n\t\t\tint sum = 0;\n\t\t\tfor (int s = 0; s < sheet.length; s++) {\n\n\t\t\t\t// 行の合計値\n\t\t\t\tsum = sheet[s][c] + sum;\n\t\t\t}\n\t\t\t// 最後に追加\n\t\t\tsheet[sheet.length-1][c] = sum;\n\t\t}",
"int c = 0;",
"int c = 0;",
"c",
"0",
"c < sheet[0].length",
"c",
"sheet[0].length",
"sheet[0]",
"sheet",
"0",
"sheet[0].length",
"c++",
"c++",
"c",
"{\n\n\t\t\t// 行の数だけ回す\n\t\t\tint sum = 0;\n\t\t\tfor (int s = 0; s < sheet.length; s++) {\n\n\t\t\t\t// 行の合計値\n\t\t\t\tsum = sheet[s][c] + sum;\n\t\t\t}\n\t\t\t// 最後に追加\n\t\t\tsheet[sheet.length-1][c] = sum;\n\t\t}",
"{\n\n\t\t\t// 行の数だけ回す\n\t\t\tint sum = 0;\n\t\t\tfor (int s = 0; s < sheet.length; s++) {\n\n\t\t\t\t// 行の合計値\n\t\t\t\tsum = sheet[s][c] + sum;\n\t\t\t}\n\t\t\t// 最後に追加\n\t\t\tsheet[sheet.length-1][c] = sum;\n\t\t}",
"int sum = 0;",
"sum",
"0",
"for (int s = 0; s < sheet.length; s++) {\n\n\t\t\t\t// 行の合計値\n\t\t\t\tsum = sheet[s][c] + sum;\n\t\t\t}",
"int s = 0;",
"int s = 0;",
"s",
"0",
"s < sheet.length",
"s",
"sheet.length",
"sheet",
"sheet.length",
"s++",
"s++",
"s",
"{\n\n\t\t\t\t// 行の合計値\n\t\t\t\tsum = sheet[s][c] + sum;\n\t\t\t}",
"{\n\n\t\t\t\t// 行の合計値\n\t\t\t\tsum = sheet[s][c] + sum;\n\t\t\t}",
"sum = sheet[s][c] + sum",
"sum",
"sheet[s][c] + sum",
"sheet[s][c]",
"sheet[s]",
"sheet",
"s",
"c",
"sum",
"sheet[sheet.length-1][c] = sum",
"sheet[sheet.length-1][c]",
"sheet[sheet.length-1]",
"sheet",
"sheet.length-1",
"sheet.length",
"sheet",
"sheet.length",
"1",
"c",
"sum",
"// 表全体を出力\n\tpublic void out_sheet() {\n\n\t\t// 行の回数\n\t\tfor (int i = 0; i < sheet.length; i++) {\n\n\t\t\t// 列の回数\n\t\t\tfor (int s = 0; s < sheet[0].length - 1; s++) {\n\t\t\t\t// 空白を一つ空けて表示\n\t\t\t\tSystem.out.print(sheet[i][s] + \" \");\n\t\t\t}\n\t\t\t// 最後の行を改行\n\t\t\tSystem.out.println(sheet[i][(sheet[0].length - 1)]);\n\t\t}\n\t}",
"out_sheet",
"{\n\n\t\t// 行の回数\n\t\tfor (int i = 0; i < sheet.length; i++) {\n\n\t\t\t// 列の回数\n\t\t\tfor (int s = 0; s < sheet[0].length - 1; s++) {\n\t\t\t\t// 空白を一つ空けて表示\n\t\t\t\tSystem.out.print(sheet[i][s] + \" \");\n\t\t\t}\n\t\t\t// 最後の行を改行\n\t\t\tSystem.out.println(sheet[i][(sheet[0].length - 1)]);\n\t\t}\n\t}",
"for (int i = 0; i < sheet.length; i++) {\n\n\t\t\t// 列の回数\n\t\t\tfor (int s = 0; s < sheet[0].length - 1; s++) {\n\t\t\t\t// 空白を一つ空けて表示\n\t\t\t\tSystem.out.print(sheet[i][s] + \" \");\n\t\t\t}\n\t\t\t// 最後の行を改行\n\t\t\tSystem.out.println(sheet[i][(sheet[0].length - 1)]);\n\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < sheet.length",
"i",
"sheet.length",
"sheet",
"sheet.length",
"i++",
"i++",
"i",
"{\n\n\t\t\t// 列の回数\n\t\t\tfor (int s = 0; s < sheet[0].length - 1; s++) {\n\t\t\t\t// 空白を一つ空けて表示\n\t\t\t\tSystem.out.print(sheet[i][s] + \" \");\n\t\t\t}\n\t\t\t// 最後の行を改行\n\t\t\tSystem.out.println(sheet[i][(sheet[0].length - 1)]);\n\t\t}",
"{\n\n\t\t\t// 列の回数\n\t\t\tfor (int s = 0; s < sheet[0].length - 1; s++) {\n\t\t\t\t// 空白を一つ空けて表示\n\t\t\t\tSystem.out.print(sheet[i][s] + \" \");\n\t\t\t}\n\t\t\t// 最後の行を改行\n\t\t\tSystem.out.println(sheet[i][(sheet[0].length - 1)]);\n\t\t}",
"for (int s = 0; s < sheet[0].length - 1; s++) {\n\t\t\t\t// 空白を一つ空けて表示\n\t\t\t\tSystem.out.print(sheet[i][s] + \" \");\n\t\t\t}",
"int s = 0;",
"int s = 0;",
"s",
"0",
"s < sheet[0].length - 1",
"s",
"sheet[0].length - 1",
"sheet[0].length",
"sheet[0]",
"sheet",
"0",
"sheet[0].length",
"1",
"s++",
"s++",
"s",
"{\n\t\t\t\t// 空白を一つ空けて表示\n\t\t\t\tSystem.out.print(sheet[i][s] + \" \");\n\t\t\t}",
"{\n\t\t\t\t// 空白を一つ空けて表示\n\t\t\t\tSystem.out.print(sheet[i][s] + \" \");\n\t\t\t}",
"System.out.print(sheet[i][s] + \" \")",
"System.out.print",
"System.out",
"System",
"System.out",
"sheet[i][s] + \" \"",
"sheet[i][s]",
"sheet[i]",
"sheet",
"i",
"s",
"\" \"",
"System.out.println(sheet[i][(sheet[0].length - 1)])",
"System.out.println",
"System.out",
"System",
"System.out",
"sheet[i][(sheet[0].length - 1)]",
"sheet[i]",
"sheet",
"i",
"(sheet[0].length - 1)",
"sheet[0].length",
"sheet[0]",
"sheet",
"0",
"sheet[0].length",
"1",
"public class Main{\n\n\tpublic static void main(String[] args) {\n\n\t\t//\n\t\tint height = 0;\n\t\tint width = 0;\n\n\t\t// 表の縦、横を決める入力値を持ってくる\n\t\tScanner sc = new Scanner(System.in);\n\t\twhile (sc.hasNext()) {\n\t\t\theight = sc.nextInt();\n\t\t\twidth = sc.nextInt();\n\t\t\tbreak;\n\t\t}\n\n\t\t// シートのインスタンスを作る\n\t\texcel ex = new excel();\n\n\t\t// 入力値から表を作る\n\t\tex.setSheet(height, width);\n\n\t\t// 表に入力する値を持ってくる\n\t\twhile (sc.hasNext()) {\n\n\t\t\t// 入力された値を表のそれぞれの場所に入れる\n\t\t\tfor (int i = 0; i < height; i++) {\n\t\t\t\tfor (int s = 0; s < width; s++) {\n\t\t\t\t\tint input_number = sc.nextInt();\n\t\t\t\t\tex.setSell(input_number, i, s);\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\t\t}\n\t\t// 表の最後の列に行の計算結果を挿入\n\t\tex.sum_row();\n\t\tex.sum_column();\n\n\t\t// 表全体を出力\n\t\tex.out_sheet();\n\n\t}\n}",
"public class Main{\n\n\tpublic static void main(String[] args) {\n\n\t\t//\n\t\tint height = 0;\n\t\tint width = 0;\n\n\t\t// 表の縦、横を決める入力値を持ってくる\n\t\tScanner sc = new Scanner(System.in);\n\t\twhile (sc.hasNext()) {\n\t\t\theight = sc.nextInt();\n\t\t\twidth = sc.nextInt();\n\t\t\tbreak;\n\t\t}\n\n\t\t// シートのインスタンスを作る\n\t\texcel ex = new excel();\n\n\t\t// 入力値から表を作る\n\t\tex.setSheet(height, width);\n\n\t\t// 表に入力する値を持ってくる\n\t\twhile (sc.hasNext()) {\n\n\t\t\t// 入力された値を表のそれぞれの場所に入れる\n\t\t\tfor (int i = 0; i < height; i++) {\n\t\t\t\tfor (int s = 0; s < width; s++) {\n\t\t\t\t\tint input_number = sc.nextInt();\n\t\t\t\t\tex.setSell(input_number, i, s);\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\t\t}\n\t\t// 表の最後の列に行の計算結果を挿入\n\t\tex.sum_row();\n\t\tex.sum_column();\n\n\t\t// 表全体を出力\n\t\tex.out_sheet();\n\n\t}\n}",
"Main"
] |
import java.util.Scanner;
public class Main{
public static void main(String[] args) {
//
int height = 0;
int width = 0;
// 表の縦、横を決める入力値を持ってくる
Scanner sc = new Scanner(System.in);
while (sc.hasNext()) {
height = sc.nextInt();
width = sc.nextInt();
break;
}
// シートのインスタンスを作る
excel ex = new excel();
// 入力値から表を作る
ex.setSheet(height, width);
// 表に入力する値を持ってくる
while (sc.hasNext()) {
// 入力された値を表のそれぞれの場所に入れる
for (int i = 0; i < height; i++) {
for (int s = 0; s < width; s++) {
int input_number = sc.nextInt();
ex.setSell(input_number, i, s);
}
}
break;
}
// 表の最後の列に行の計算結果を挿入
ex.sum_row();
ex.sum_column();
// 表全体を出力
ex.out_sheet();
}
}
class excel {
// フィールド
int[][] sheet;
// 入力値から表(2次元配列)を作るメソッド
public void setSheet(int height, int width) {
// 最後に合計値を出す列を用意
sheet = new int[height + 1][width + 1];
}
// 入力値をセルに入れる
public void setSell(int input_number, int height, int width) {
sheet[height][width] = input_number;
}
// 行の合計値を最後のセルに追加
public void sum_row() {
// 行の数だけ回す
for (int i = 0; i < sheet.length; i++) {
// 列の数だけ回す
int sum = 0;
for (int s = 0; s < sheet[0].length; s++) {
// 行の合計値
sum = sheet[i][s] + sum;
}
// 最後に追加
sheet[i][(sheet[0].length - 1)] = sum;
}
}
// 列の合計値を最後のセルに追加
public void sum_column() {
// 列の数だけ回す
for (int c = 0; c < sheet[0].length; c++) {
// 行の数だけ回す
int sum = 0;
for (int s = 0; s < sheet.length; s++) {
// 行の合計値
sum = sheet[s][c] + sum;
}
// 最後に追加
sheet[sheet.length-1][c] = sum;
}
}
// 表全体を出力
public void out_sheet() {
// 行の回数
for (int i = 0; i < sheet.length; i++) {
// 列の回数
for (int s = 0; s < sheet[0].length - 1; s++) {
// 空白を一つ空けて表示
System.out.print(sheet[i][s] + " ");
}
// 最後の行を改行
System.out.println(sheet[i][(sheet[0].length - 1)]);
}
}
} |
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
41,
13,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
41,
13,
20,
2,
13,
17,
2,
13,
17,
11,
1,
0,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
11,
1,
0,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
41,
13,
4,
18,
13,
0,
18,
18,
13,
13,
13,
13,
0,
18,
18,
13,
13,
13,
13,
0,
18,
18,
13,
13,
13,
13,
0,
18,
18,
13,
13,
13,
13,
11,
1,
0,
13,
17,
2,
13,
2,
13,
17,
1,
40,
13,
30,
30,
11,
1,
0,
13,
17,
2,
13,
2,
13,
17,
1,
40,
13,
30,
30,
14,
2,
13,
13,
30,
4,
18,
18,
13,
13,
18,
18,
13,
13,
13,
30,
4,
18,
18,
13,
13,
2,
18,
18,
13,
13,
13,
17,
4,
18,
18,
13,
13,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
160,
5
],
[
160,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
8,
14
],
[
14,
15
],
[
8,
16
],
[
16,
17
],
[
16,
18
],
[
18,
19
],
[
19,
20
],
[
8,
21
],
[
21,
22
],
[
21,
23
],
[
23,
24
],
[
24,
25
],
[
8,
26
],
[
26,
27
],
[
26,
28
],
[
29,
30
],
[
29,
31
],
[
32,
33
],
[
32,
34
],
[
8,
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
],
[
64,
65
],
[
60,
66
],
[
66,
67
],
[
67,
68
],
[
68,
69
],
[
68,
70
],
[
67,
71
],
[
66,
72
],
[
60,
73
],
[
73,
74
],
[
74,
75
],
[
75,
76
],
[
75,
77
],
[
74,
78
],
[
73,
79
],
[
60,
80
],
[
80,
81
],
[
81,
82
],
[
82,
83
],
[
82,
84
],
[
81,
85
],
[
80,
86
],
[
60,
87
],
[
87,
88
],
[
88,
89
],
[
89,
90
],
[
89,
91
],
[
88,
92
],
[
87,
93
],
[
8,
94
],
[
94,
95
],
[
95,
96
],
[
96,
97
],
[
96,
98
],
[
94,
99
],
[
99,
100
],
[
99,
101
],
[
101,
102
],
[
101,
103
],
[
94,
104
],
[
104,
105
],
[
105,
106
],
[
94,
107
],
[
108,
108
],
[
108,
109
],
[
109,
110
],
[
110,
111
],
[
111,
112
],
[
111,
113
],
[
109,
114
],
[
114,
115
],
[
114,
116
],
[
116,
117
],
[
116,
118
],
[
109,
119
],
[
119,
120
],
[
120,
121
],
[
109,
122
],
[
123,
123
],
[
123,
124
],
[
124,
125
],
[
125,
126
],
[
125,
127
],
[
124,
128
],
[
128,
129
],
[
129,
130
],
[
130,
131
],
[
131,
132
],
[
131,
133
],
[
129,
134
],
[
134,
135
],
[
135,
136
],
[
135,
137
],
[
134,
138
],
[
124,
139
],
[
139,
140
],
[
140,
141
],
[
141,
142
],
[
142,
143
],
[
142,
144
],
[
140,
145
],
[
145,
146
],
[
146,
147
],
[
147,
148
],
[
147,
149
],
[
146,
150
],
[
145,
151
],
[
108,
152
],
[
152,
153
],
[
153,
154
],
[
154,
155
],
[
154,
156
],
[
6,
157
],
[
157,
158
],
[
0,
159
],
[
159,
160
],
[
159,
161
]
] | [
"import java.util.Scanner;\n\n\npublic class Main {\n\tpublic static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\n\t\tint i;\n\t\tint j;\n\n\t\tint r = sc.nextInt();\n\t\tint c = sc.nextInt();\n\n\t\tint result[][] = new int[r + 1][c + 1];\n\n\t\tfor(i = 0; i < r; i++) {\n\t\t\tfor(j = 0; j < c; j++) {\n\t\t\t\tint a = sc.nextInt();\n\t\t\t\tresult[i][j] = a;\n\t\t\t\tresult[i][c] += a;\n\t\t\t\tresult[r][j] += a;\n\t\t\t\tresult[r][c] += a;\n\t\t\t}\n\t\t}\n\n\t\tfor(i = 0; i < r + 1; i++) {\n\t\t\tfor(j = 0; j < c + 1; j++) {\n\n\t\t\t\tif(j == c) {\n\t\t\t\t\tSystem.out.print(result[i][j]);\n\t\t\t\t} else {\n\t\t\t\t\tSystem.out.print(result[i][j] + \" \");\n\t\t\t\t}\n\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}\n\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\tint i;\n\t\tint j;\n\n\t\tint r = sc.nextInt();\n\t\tint c = sc.nextInt();\n\n\t\tint result[][] = new int[r + 1][c + 1];\n\n\t\tfor(i = 0; i < r; i++) {\n\t\t\tfor(j = 0; j < c; j++) {\n\t\t\t\tint a = sc.nextInt();\n\t\t\t\tresult[i][j] = a;\n\t\t\t\tresult[i][c] += a;\n\t\t\t\tresult[r][j] += a;\n\t\t\t\tresult[r][c] += a;\n\t\t\t}\n\t\t}\n\n\t\tfor(i = 0; i < r + 1; i++) {\n\t\t\tfor(j = 0; j < c + 1; j++) {\n\n\t\t\t\tif(j == c) {\n\t\t\t\t\tSystem.out.print(result[i][j]);\n\t\t\t\t} else {\n\t\t\t\t\tSystem.out.print(result[i][j] + \" \");\n\t\t\t\t}\n\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}\n\n\t}\n}",
"Main",
"public static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\n\t\tint i;\n\t\tint j;\n\n\t\tint r = sc.nextInt();\n\t\tint c = sc.nextInt();\n\n\t\tint result[][] = new int[r + 1][c + 1];\n\n\t\tfor(i = 0; i < r; i++) {\n\t\t\tfor(j = 0; j < c; j++) {\n\t\t\t\tint a = sc.nextInt();\n\t\t\t\tresult[i][j] = a;\n\t\t\t\tresult[i][c] += a;\n\t\t\t\tresult[r][j] += a;\n\t\t\t\tresult[r][c] += a;\n\t\t\t}\n\t\t}\n\n\t\tfor(i = 0; i < r + 1; i++) {\n\t\t\tfor(j = 0; j < c + 1; j++) {\n\n\t\t\t\tif(j == c) {\n\t\t\t\t\tSystem.out.print(result[i][j]);\n\t\t\t\t} else {\n\t\t\t\t\tSystem.out.print(result[i][j] + \" \");\n\t\t\t\t}\n\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}\n\n\t}",
"main",
"{\n\t\tScanner sc = new Scanner(System.in);\n\n\t\tint i;\n\t\tint j;\n\n\t\tint r = sc.nextInt();\n\t\tint c = sc.nextInt();\n\n\t\tint result[][] = new int[r + 1][c + 1];\n\n\t\tfor(i = 0; i < r; i++) {\n\t\t\tfor(j = 0; j < c; j++) {\n\t\t\t\tint a = sc.nextInt();\n\t\t\t\tresult[i][j] = a;\n\t\t\t\tresult[i][c] += a;\n\t\t\t\tresult[r][j] += a;\n\t\t\t\tresult[r][c] += a;\n\t\t\t}\n\t\t}\n\n\t\tfor(i = 0; i < r + 1; i++) {\n\t\t\tfor(j = 0; j < c + 1; j++) {\n\n\t\t\t\tif(j == c) {\n\t\t\t\t\tSystem.out.print(result[i][j]);\n\t\t\t\t} else {\n\t\t\t\t\tSystem.out.print(result[i][j] + \" \");\n\t\t\t\t}\n\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}\n\n\t}",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"int i;",
"i",
"int j;",
"j",
"int r = sc.nextInt();",
"r",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int c = sc.nextInt();",
"c",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int result[][] = new int[r + 1][c + 1];",
"result",
"new int[r + 1][c + 1]",
"r + 1",
"r",
"1",
"c + 1",
"c",
"1",
"for(i = 0; i < r; i++) {\n\t\t\tfor(j = 0; j < c; j++) {\n\t\t\t\tint a = sc.nextInt();\n\t\t\t\tresult[i][j] = a;\n\t\t\t\tresult[i][c] += a;\n\t\t\t\tresult[r][j] += a;\n\t\t\t\tresult[r][c] += a;\n\t\t\t}\n\t\t}",
"i = 0;",
"i = 0",
"i",
"0",
"i < r",
"i",
"r",
"i++",
"i++",
"i",
"{\n\t\t\tfor(j = 0; j < c; j++) {\n\t\t\t\tint a = sc.nextInt();\n\t\t\t\tresult[i][j] = a;\n\t\t\t\tresult[i][c] += a;\n\t\t\t\tresult[r][j] += a;\n\t\t\t\tresult[r][c] += a;\n\t\t\t}\n\t\t}",
"{\n\t\t\tfor(j = 0; j < c; j++) {\n\t\t\t\tint a = sc.nextInt();\n\t\t\t\tresult[i][j] = a;\n\t\t\t\tresult[i][c] += a;\n\t\t\t\tresult[r][j] += a;\n\t\t\t\tresult[r][c] += a;\n\t\t\t}\n\t\t}",
"for(j = 0; j < c; j++) {\n\t\t\t\tint a = sc.nextInt();\n\t\t\t\tresult[i][j] = a;\n\t\t\t\tresult[i][c] += a;\n\t\t\t\tresult[r][j] += a;\n\t\t\t\tresult[r][c] += a;\n\t\t\t}",
"j = 0;",
"j = 0",
"j",
"0",
"j < c",
"j",
"c",
"j++",
"j++",
"j",
"{\n\t\t\t\tint a = sc.nextInt();\n\t\t\t\tresult[i][j] = a;\n\t\t\t\tresult[i][c] += a;\n\t\t\t\tresult[r][j] += a;\n\t\t\t\tresult[r][c] += a;\n\t\t\t}",
"{\n\t\t\t\tint a = sc.nextInt();\n\t\t\t\tresult[i][j] = a;\n\t\t\t\tresult[i][c] += a;\n\t\t\t\tresult[r][j] += a;\n\t\t\t\tresult[r][c] += a;\n\t\t\t}",
"int a = sc.nextInt();",
"a",
"sc.nextInt()",
"sc.nextInt",
"sc",
"result[i][j] = a",
"result[i][j]",
"result[i]",
"result",
"i",
"j",
"a",
"result[i][c] += a",
"result[i][c]",
"result[i]",
"result",
"i",
"c",
"a",
"result[r][j] += a",
"result[r][j]",
"result[r]",
"result",
"r",
"j",
"a",
"result[r][c] += a",
"result[r][c]",
"result[r]",
"result",
"r",
"c",
"a",
"for(i = 0; i < r + 1; i++) {\n\t\t\tfor(j = 0; j < c + 1; j++) {\n\n\t\t\t\tif(j == c) {\n\t\t\t\t\tSystem.out.print(result[i][j]);\n\t\t\t\t} else {\n\t\t\t\t\tSystem.out.print(result[i][j] + \" \");\n\t\t\t\t}\n\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}",
"i = 0;",
"i = 0",
"i",
"0",
"i < r + 1",
"i",
"r + 1",
"r",
"1",
"i++",
"i++",
"i",
"{\n\t\t\tfor(j = 0; j < c + 1; j++) {\n\n\t\t\t\tif(j == c) {\n\t\t\t\t\tSystem.out.print(result[i][j]);\n\t\t\t\t} else {\n\t\t\t\t\tSystem.out.print(result[i][j] + \" \");\n\t\t\t\t}\n\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}",
"{\n\t\t\tfor(j = 0; j < c + 1; j++) {\n\n\t\t\t\tif(j == c) {\n\t\t\t\t\tSystem.out.print(result[i][j]);\n\t\t\t\t} else {\n\t\t\t\t\tSystem.out.print(result[i][j] + \" \");\n\t\t\t\t}\n\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}",
"for(j = 0; j < c + 1; j++) {\n\n\t\t\t\tif(j == c) {\n\t\t\t\t\tSystem.out.print(result[i][j]);\n\t\t\t\t} else {\n\t\t\t\t\tSystem.out.print(result[i][j] + \" \");\n\t\t\t\t}\n\n\t\t\t}",
"j = 0;",
"j = 0",
"j",
"0",
"j < c + 1",
"j",
"c + 1",
"c",
"1",
"j++",
"j++",
"j",
"{\n\n\t\t\t\tif(j == c) {\n\t\t\t\t\tSystem.out.print(result[i][j]);\n\t\t\t\t} else {\n\t\t\t\t\tSystem.out.print(result[i][j] + \" \");\n\t\t\t\t}\n\n\t\t\t}",
"{\n\n\t\t\t\tif(j == c) {\n\t\t\t\t\tSystem.out.print(result[i][j]);\n\t\t\t\t} else {\n\t\t\t\t\tSystem.out.print(result[i][j] + \" \");\n\t\t\t\t}\n\n\t\t\t}",
"if(j == c) {\n\t\t\t\t\tSystem.out.print(result[i][j]);\n\t\t\t\t} else {\n\t\t\t\t\tSystem.out.print(result[i][j] + \" \");\n\t\t\t\t}",
"j == c",
"j",
"c",
"{\n\t\t\t\t\tSystem.out.print(result[i][j]);\n\t\t\t\t}",
"System.out.print(result[i][j])",
"System.out.print",
"System.out",
"System",
"System.out",
"result[i][j]",
"result[i]",
"result",
"i",
"j",
"{\n\t\t\t\t\tSystem.out.print(result[i][j] + \" \");\n\t\t\t\t}",
"System.out.print(result[i][j] + \" \")",
"System.out.print",
"System.out",
"System",
"System.out",
"result[i][j] + \" \"",
"result[i][j]",
"result[i]",
"result",
"i",
"j",
"\" \"",
"System.out.println()",
"System.out.println",
"System.out",
"System",
"System.out",
"String[] args",
"args",
"public class Main {\n\tpublic static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\n\t\tint i;\n\t\tint j;\n\n\t\tint r = sc.nextInt();\n\t\tint c = sc.nextInt();\n\n\t\tint result[][] = new int[r + 1][c + 1];\n\n\t\tfor(i = 0; i < r; i++) {\n\t\t\tfor(j = 0; j < c; j++) {\n\t\t\t\tint a = sc.nextInt();\n\t\t\t\tresult[i][j] = a;\n\t\t\t\tresult[i][c] += a;\n\t\t\t\tresult[r][j] += a;\n\t\t\t\tresult[r][c] += a;\n\t\t\t}\n\t\t}\n\n\t\tfor(i = 0; i < r + 1; i++) {\n\t\t\tfor(j = 0; j < c + 1; j++) {\n\n\t\t\t\tif(j == c) {\n\t\t\t\t\tSystem.out.print(result[i][j]);\n\t\t\t\t} else {\n\t\t\t\t\tSystem.out.print(result[i][j] + \" \");\n\t\t\t\t}\n\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}\n\n\t}\n}",
"public class Main {\n\tpublic static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\n\t\tint i;\n\t\tint j;\n\n\t\tint r = sc.nextInt();\n\t\tint c = sc.nextInt();\n\n\t\tint result[][] = new int[r + 1][c + 1];\n\n\t\tfor(i = 0; i < r; i++) {\n\t\t\tfor(j = 0; j < c; j++) {\n\t\t\t\tint a = sc.nextInt();\n\t\t\t\tresult[i][j] = a;\n\t\t\t\tresult[i][c] += a;\n\t\t\t\tresult[r][j] += a;\n\t\t\t\tresult[r][c] += a;\n\t\t\t}\n\t\t}\n\n\t\tfor(i = 0; i < r + 1; i++) {\n\t\t\tfor(j = 0; j < c + 1; j++) {\n\n\t\t\t\tif(j == c) {\n\t\t\t\t\tSystem.out.print(result[i][j]);\n\t\t\t\t} else {\n\t\t\t\t\tSystem.out.print(result[i][j] + \" \");\n\t\t\t\t}\n\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}\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 i;
int j;
int r = sc.nextInt();
int c = sc.nextInt();
int result[][] = new int[r + 1][c + 1];
for(i = 0; i < r; i++) {
for(j = 0; j < c; j++) {
int a = sc.nextInt();
result[i][j] = a;
result[i][c] += a;
result[r][j] += a;
result[r][c] += a;
}
}
for(i = 0; i < r + 1; i++) {
for(j = 0; j < c + 1; j++) {
if(j == c) {
System.out.print(result[i][j]);
} else {
System.out.print(result[i][j] + " ");
}
}
System.out.println();
}
}
} |
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
4,
18,
13,
17,
41,
13,
4,
18,
13,
18,
13,
17,
41,
13,
4,
18,
13,
18,
13,
17,
41,
13,
20,
2,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
4,
18,
4,
18,
13,
17,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
4,
18,
13,
18,
13,
13,
0,
18,
13,
13,
4,
18,
13,
18,
13,
13,
4,
18,
18,
13,
13,
2,
18,
13,
13,
17,
4,
18,
18,
13,
13,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
18,
13,
13,
18,
13,
13,
4,
18,
18,
13,
13,
2,
18,
13,
13,
17,
4,
18,
18,
13,
13,
18,
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
],
[
160,
11
],
[
160,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
15,
17
],
[
14,
18
],
[
18,
19
],
[
18,
20
],
[
20,
21
],
[
21,
22
],
[
22,
23
],
[
23,
24
],
[
20,
25
],
[
14,
26
],
[
26,
27
],
[
26,
28
],
[
28,
29
],
[
29,
30
],
[
28,
31
],
[
31,
32
],
[
31,
33
],
[
14,
34
],
[
34,
35
],
[
34,
36
],
[
36,
37
],
[
37,
38
],
[
36,
39
],
[
39,
40
],
[
39,
41
],
[
14,
42
],
[
42,
43
],
[
42,
44
],
[
45,
46
],
[
45,
47
],
[
14,
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
],
[
64,
65
],
[
65,
66
],
[
66,
67
],
[
63,
68
],
[
60,
69
],
[
69,
70
],
[
69,
71
],
[
60,
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
],
[
88,
89
],
[
87,
90
],
[
90,
91
],
[
90,
92
],
[
84,
93
],
[
93,
94
],
[
94,
95
],
[
94,
96
],
[
93,
97
],
[
97,
98
],
[
98,
99
],
[
97,
100
],
[
100,
101
],
[
100,
102
],
[
84,
103
],
[
103,
104
],
[
104,
105
],
[
105,
106
],
[
105,
107
],
[
103,
108
],
[
108,
109
],
[
109,
110
],
[
109,
111
],
[
108,
112
],
[
60,
113
],
[
113,
114
],
[
114,
115
],
[
115,
116
],
[
115,
117
],
[
113,
118
],
[
14,
119
],
[
119,
120
],
[
120,
121
],
[
121,
122
],
[
121,
123
],
[
119,
124
],
[
124,
125
],
[
124,
126
],
[
119,
127
],
[
127,
128
],
[
128,
129
],
[
119,
130
],
[
131,
131
],
[
131,
132
],
[
132,
133
],
[
133,
134
],
[
133,
135
],
[
132,
136
],
[
136,
137
],
[
136,
138
],
[
131,
139
],
[
139,
140
],
[
140,
141
],
[
141,
142
],
[
141,
143
],
[
139,
144
],
[
144,
145
],
[
145,
146
],
[
145,
147
],
[
144,
148
],
[
14,
149
],
[
149,
150
],
[
150,
151
],
[
151,
152
],
[
151,
153
],
[
149,
154
],
[
154,
155
],
[
154,
156
],
[
12,
157
],
[
157,
158
],
[
0,
159
],
[
159,
160
],
[
159,
161
]
] | [
"import java.io.BufferedReader;\nimport java.io.IOException;\nimport java.io.InputStreamReader;\n\npublic class Main {\n\tpublic static void main(String[] args) throws IOException{\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\n\n\t\t\tString[] str = br.readLine().split(\" \");\n\t\t\tint r = Integer.parseInt(str[0]);\n\t\t\tint c = Integer.parseInt(str[1]);\n\t\t\tint[] csum= new int[c + 1];\n\n\t\t\tfor(int i = 0; i<r; i++){\n\t\t\t\tstr = br.readLine().split(\" \");\n\t\t\t\tint value=0;\n\t\t\t\tfor(int j = 0; j<c; j++ ){\n\t\t\t\t\tvalue += Integer.parseInt(str[j]);\n\t\t\t\t\tcsum[j] += Integer.parseInt(str[j]);\n\t\t\t\t\tSystem.out.print(str[j] + \" \");\n\t\t\t\t}\n\t\t\t\tSystem.out.println(value);\n\t\t\t}\n\t\t\tfor(int i=0;i<c;i++){\n\t\t\t\tcsum[c] += csum[i];\n\t\t\t\tSystem.out.print(csum[i] + \" \");\n\t\t\t}\n\t\t\tSystem.out.println(csum[c]);\n\n\n\t}\n}",
"import java.io.BufferedReader;",
"BufferedReader",
"java.io",
"import java.io.IOException;",
"IOException",
"java.io",
"import java.io.InputStreamReader;",
"InputStreamReader",
"java.io",
"public class Main {\n\tpublic static void main(String[] args) throws IOException{\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\n\n\t\t\tString[] str = br.readLine().split(\" \");\n\t\t\tint r = Integer.parseInt(str[0]);\n\t\t\tint c = Integer.parseInt(str[1]);\n\t\t\tint[] csum= new int[c + 1];\n\n\t\t\tfor(int i = 0; i<r; i++){\n\t\t\t\tstr = br.readLine().split(\" \");\n\t\t\t\tint value=0;\n\t\t\t\tfor(int j = 0; j<c; j++ ){\n\t\t\t\t\tvalue += Integer.parseInt(str[j]);\n\t\t\t\t\tcsum[j] += Integer.parseInt(str[j]);\n\t\t\t\t\tSystem.out.print(str[j] + \" \");\n\t\t\t\t}\n\t\t\t\tSystem.out.println(value);\n\t\t\t}\n\t\t\tfor(int i=0;i<c;i++){\n\t\t\t\tcsum[c] += csum[i];\n\t\t\t\tSystem.out.print(csum[i] + \" \");\n\t\t\t}\n\t\t\tSystem.out.println(csum[c]);\n\n\n\t}\n}",
"Main",
"public static void main(String[] args) throws IOException{\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\n\n\t\t\tString[] str = br.readLine().split(\" \");\n\t\t\tint r = Integer.parseInt(str[0]);\n\t\t\tint c = Integer.parseInt(str[1]);\n\t\t\tint[] csum= new int[c + 1];\n\n\t\t\tfor(int i = 0; i<r; i++){\n\t\t\t\tstr = br.readLine().split(\" \");\n\t\t\t\tint value=0;\n\t\t\t\tfor(int j = 0; j<c; j++ ){\n\t\t\t\t\tvalue += Integer.parseInt(str[j]);\n\t\t\t\t\tcsum[j] += Integer.parseInt(str[j]);\n\t\t\t\t\tSystem.out.print(str[j] + \" \");\n\t\t\t\t}\n\t\t\t\tSystem.out.println(value);\n\t\t\t}\n\t\t\tfor(int i=0;i<c;i++){\n\t\t\t\tcsum[c] += csum[i];\n\t\t\t\tSystem.out.print(csum[i] + \" \");\n\t\t\t}\n\t\t\tSystem.out.println(csum[c]);\n\n\n\t}",
"main",
"{\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\n\n\t\t\tString[] str = br.readLine().split(\" \");\n\t\t\tint r = Integer.parseInt(str[0]);\n\t\t\tint c = Integer.parseInt(str[1]);\n\t\t\tint[] csum= new int[c + 1];\n\n\t\t\tfor(int i = 0; i<r; i++){\n\t\t\t\tstr = br.readLine().split(\" \");\n\t\t\t\tint value=0;\n\t\t\t\tfor(int j = 0; j<c; j++ ){\n\t\t\t\t\tvalue += Integer.parseInt(str[j]);\n\t\t\t\t\tcsum[j] += Integer.parseInt(str[j]);\n\t\t\t\t\tSystem.out.print(str[j] + \" \");\n\t\t\t\t}\n\t\t\t\tSystem.out.println(value);\n\t\t\t}\n\t\t\tfor(int i=0;i<c;i++){\n\t\t\t\tcsum[c] += csum[i];\n\t\t\t\tSystem.out.print(csum[i] + \" \");\n\t\t\t}\n\t\t\tSystem.out.println(csum[c]);\n\n\n\t}",
"BufferedReader br = new BufferedReader(new InputStreamReader(System.in));",
"br",
"new BufferedReader(new InputStreamReader(System.in))",
"String[] str = br.readLine().split(\" \");",
"str",
"br.readLine().split(\" \")",
"br.readLine().split",
"br.readLine()",
"br.readLine",
"br",
"\" \"",
"int r = Integer.parseInt(str[0]);",
"r",
"Integer.parseInt(str[0])",
"Integer.parseInt",
"Integer",
"str[0]",
"str",
"0",
"int c = Integer.parseInt(str[1]);",
"c",
"Integer.parseInt(str[1])",
"Integer.parseInt",
"Integer",
"str[1]",
"str",
"1",
"int[] csum= new int[c + 1];",
"csum",
"new int[c + 1]",
"c + 1",
"c",
"1",
"for(int i = 0; i<r; i++){\n\t\t\t\tstr = br.readLine().split(\" \");\n\t\t\t\tint value=0;\n\t\t\t\tfor(int j = 0; j<c; j++ ){\n\t\t\t\t\tvalue += Integer.parseInt(str[j]);\n\t\t\t\t\tcsum[j] += Integer.parseInt(str[j]);\n\t\t\t\t\tSystem.out.print(str[j] + \" \");\n\t\t\t\t}\n\t\t\t\tSystem.out.println(value);\n\t\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i<r",
"i",
"r",
"i++",
"i++",
"i",
"{\n\t\t\t\tstr = br.readLine().split(\" \");\n\t\t\t\tint value=0;\n\t\t\t\tfor(int j = 0; j<c; j++ ){\n\t\t\t\t\tvalue += Integer.parseInt(str[j]);\n\t\t\t\t\tcsum[j] += Integer.parseInt(str[j]);\n\t\t\t\t\tSystem.out.print(str[j] + \" \");\n\t\t\t\t}\n\t\t\t\tSystem.out.println(value);\n\t\t\t}",
"{\n\t\t\t\tstr = br.readLine().split(\" \");\n\t\t\t\tint value=0;\n\t\t\t\tfor(int j = 0; j<c; j++ ){\n\t\t\t\t\tvalue += Integer.parseInt(str[j]);\n\t\t\t\t\tcsum[j] += Integer.parseInt(str[j]);\n\t\t\t\t\tSystem.out.print(str[j] + \" \");\n\t\t\t\t}\n\t\t\t\tSystem.out.println(value);\n\t\t\t}",
"str = br.readLine().split(\" \")",
"str",
"br.readLine().split(\" \")",
"br.readLine().split",
"br.readLine()",
"br.readLine",
"br",
"\" \"",
"int value=0;",
"value",
"0",
"for(int j = 0; j<c; j++ ){\n\t\t\t\t\tvalue += Integer.parseInt(str[j]);\n\t\t\t\t\tcsum[j] += Integer.parseInt(str[j]);\n\t\t\t\t\tSystem.out.print(str[j] + \" \");\n\t\t\t\t}",
"int j = 0;",
"int j = 0;",
"j",
"0",
"j<c",
"j",
"c",
"j++",
"j++",
"j",
"{\n\t\t\t\t\tvalue += Integer.parseInt(str[j]);\n\t\t\t\t\tcsum[j] += Integer.parseInt(str[j]);\n\t\t\t\t\tSystem.out.print(str[j] + \" \");\n\t\t\t\t}",
"{\n\t\t\t\t\tvalue += Integer.parseInt(str[j]);\n\t\t\t\t\tcsum[j] += Integer.parseInt(str[j]);\n\t\t\t\t\tSystem.out.print(str[j] + \" \");\n\t\t\t\t}",
"value += Integer.parseInt(str[j])",
"value",
"Integer.parseInt(str[j])",
"Integer.parseInt",
"Integer",
"str[j]",
"str",
"j",
"csum[j] += Integer.parseInt(str[j])",
"csum[j]",
"csum",
"j",
"Integer.parseInt(str[j])",
"Integer.parseInt",
"Integer",
"str[j]",
"str",
"j",
"System.out.print(str[j] + \" \")",
"System.out.print",
"System.out",
"System",
"System.out",
"str[j] + \" \"",
"str[j]",
"str",
"j",
"\" \"",
"System.out.println(value)",
"System.out.println",
"System.out",
"System",
"System.out",
"value",
"for(int i=0;i<c;i++){\n\t\t\t\tcsum[c] += csum[i];\n\t\t\t\tSystem.out.print(csum[i] + \" \");\n\t\t\t}",
"int i=0;",
"int i=0;",
"i",
"0",
"i<c",
"i",
"c",
"i++",
"i++",
"i",
"{\n\t\t\t\tcsum[c] += csum[i];\n\t\t\t\tSystem.out.print(csum[i] + \" \");\n\t\t\t}",
"{\n\t\t\t\tcsum[c] += csum[i];\n\t\t\t\tSystem.out.print(csum[i] + \" \");\n\t\t\t}",
"csum[c] += csum[i]",
"csum[c]",
"csum",
"c",
"csum[i]",
"csum",
"i",
"System.out.print(csum[i] + \" \")",
"System.out.print",
"System.out",
"System",
"System.out",
"csum[i] + \" \"",
"csum[i]",
"csum",
"i",
"\" \"",
"System.out.println(csum[c])",
"System.out.println",
"System.out",
"System",
"System.out",
"csum[c]",
"csum",
"c",
"String[] args",
"args",
"public class Main {\n\tpublic static void main(String[] args) throws IOException{\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\n\n\t\t\tString[] str = br.readLine().split(\" \");\n\t\t\tint r = Integer.parseInt(str[0]);\n\t\t\tint c = Integer.parseInt(str[1]);\n\t\t\tint[] csum= new int[c + 1];\n\n\t\t\tfor(int i = 0; i<r; i++){\n\t\t\t\tstr = br.readLine().split(\" \");\n\t\t\t\tint value=0;\n\t\t\t\tfor(int j = 0; j<c; j++ ){\n\t\t\t\t\tvalue += Integer.parseInt(str[j]);\n\t\t\t\t\tcsum[j] += Integer.parseInt(str[j]);\n\t\t\t\t\tSystem.out.print(str[j] + \" \");\n\t\t\t\t}\n\t\t\t\tSystem.out.println(value);\n\t\t\t}\n\t\t\tfor(int i=0;i<c;i++){\n\t\t\t\tcsum[c] += csum[i];\n\t\t\t\tSystem.out.print(csum[i] + \" \");\n\t\t\t}\n\t\t\tSystem.out.println(csum[c]);\n\n\n\t}\n}",
"public class Main {\n\tpublic static void main(String[] args) throws IOException{\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\n\n\t\t\tString[] str = br.readLine().split(\" \");\n\t\t\tint r = Integer.parseInt(str[0]);\n\t\t\tint c = Integer.parseInt(str[1]);\n\t\t\tint[] csum= new int[c + 1];\n\n\t\t\tfor(int i = 0; i<r; i++){\n\t\t\t\tstr = br.readLine().split(\" \");\n\t\t\t\tint value=0;\n\t\t\t\tfor(int j = 0; j<c; j++ ){\n\t\t\t\t\tvalue += Integer.parseInt(str[j]);\n\t\t\t\t\tcsum[j] += Integer.parseInt(str[j]);\n\t\t\t\t\tSystem.out.print(str[j] + \" \");\n\t\t\t\t}\n\t\t\t\tSystem.out.println(value);\n\t\t\t}\n\t\t\tfor(int i=0;i<c;i++){\n\t\t\t\tcsum[c] += csum[i];\n\t\t\t\tSystem.out.print(csum[i] + \" \");\n\t\t\t}\n\t\t\tSystem.out.println(csum[c]);\n\n\n\t}\n}",
"Main"
] | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class Main {
public static void main(String[] args) throws IOException{
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
String[] str = br.readLine().split(" ");
int r = Integer.parseInt(str[0]);
int c = Integer.parseInt(str[1]);
int[] csum= new int[c + 1];
for(int i = 0; i<r; i++){
str = br.readLine().split(" ");
int value=0;
for(int j = 0; j<c; j++ ){
value += Integer.parseInt(str[j]);
csum[j] += Integer.parseInt(str[j]);
System.out.print(str[j] + " ");
}
System.out.println(value);
}
for(int i=0;i<c;i++){
csum[c] += csum[i];
System.out.print(csum[i] + " ");
}
System.out.println(csum[c]);
}
} |
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
41,
13,
20,
13,
2,
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,
18,
18,
13,
13,
13,
4,
18,
13,
0,
13,
18,
18,
13,
13,
13,
4,
18,
18,
13,
13,
2,
18,
18,
13,
13,
13,
17,
0,
18,
18,
13,
13,
13,
13,
4,
18,
18,
13,
13,
13,
11,
1,
41,
13,
17,
2,
13,
2,
13,
17,
1,
40,
13,
30,
30,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
18,
18,
13,
13,
13,
14,
2,
13,
17,
30,
4,
18,
18,
13,
13,
17,
4,
18,
18,
13,
13,
2,
13,
17,
4,
18,
18,
13,
13,
4,
18,
13,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
167,
5
],
[
167,
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
],
[
19,
20
],
[
20,
21
],
[
8,
22
],
[
22,
23
],
[
22,
24
],
[
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
],
[
42,
44
],
[
41,
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
],
[
59,
63
],
[
58,
64
],
[
64,
65
],
[
65,
66
],
[
57,
67
],
[
67,
68
],
[
67,
69
],
[
69,
70
],
[
70,
71
],
[
70,
72
],
[
69,
73
],
[
57,
74
],
[
74,
75
],
[
75,
76
],
[
76,
77
],
[
76,
78
],
[
74,
79
],
[
79,
80
],
[
80,
81
],
[
81,
82
],
[
81,
83
],
[
80,
84
],
[
79,
85
],
[
41,
86
],
[
86,
87
],
[
87,
88
],
[
88,
89
],
[
88,
90
],
[
87,
91
],
[
86,
92
],
[
41,
93
],
[
93,
94
],
[
94,
95
],
[
95,
96
],
[
95,
97
],
[
93,
98
],
[
8,
99
],
[
99,
100
],
[
100,
101
],
[
101,
102
],
[
101,
103
],
[
99,
104
],
[
104,
105
],
[
104,
106
],
[
106,
107
],
[
106,
108
],
[
99,
109
],
[
109,
110
],
[
110,
111
],
[
99,
112
],
[
113,
113
],
[
113,
114
],
[
114,
115
],
[
114,
116
],
[
113,
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
],
[
133,
135
],
[
132,
136
],
[
113,
137
],
[
137,
138
],
[
138,
139
],
[
138,
140
],
[
137,
141
],
[
141,
142
],
[
142,
143
],
[
143,
144
],
[
144,
145
],
[
144,
146
],
[
142,
147
],
[
113,
148
],
[
148,
149
],
[
149,
150
],
[
150,
151
],
[
150,
152
],
[
148,
153
],
[
153,
154
],
[
153,
155
],
[
8,
156
],
[
156,
157
],
[
157,
158
],
[
158,
159
],
[
158,
160
],
[
8,
161
],
[
161,
162
],
[
162,
163
],
[
6,
164
],
[
164,
165
],
[
0,
166
],
[
166,
167
],
[
166,
168
]
] | [
"import java.util.Scanner;\n\npublic class Main {\n\tpublic static void main(String[] args) {\n\t\tScanner scan = new Scanner(System.in);\n\n\t\tint r = scan.nextInt();\n\t\tint c = scan.nextInt();\n\n\t\tint[][] table = new int[r][c + 1];\n\n\t\tfor(int i = 0; i < r; i++) {\n\t\t\tint sum = 0;\n\t\t\tfor(int j = 0; j < c; j++) {\n\t\t\t\ttable[i][j] = scan.nextInt();\n\t\t\t\tsum += table[i][j];\n\t\t\t\tSystem.out.printf(table[i][j] + \" \");\n\t\t\t}\n\t\t\ttable[i][c] = sum;\n\t\t\tSystem.out.println(sum);\n\t\t}\n\n\t\tfor(int i = 0; i < c + 1; i++) {\n\t\t\tint sum = 0;\n\t\t\tfor(int j = 0; j < r; j++) {\n\t\t\t\tsum += table[j][i];\n\t\t\t}\n\t\t\tif(i != 0) {\n\t\t\t\tSystem.out.printf(\" \");\n\t\t\t}\n\t\t\tSystem.out.printf(sum + \"\");\n\t\t}\n\t\t\n\t\tSystem.out.println();\n\n\t\tscan.close();\n\t}\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n\tpublic static void main(String[] args) {\n\t\tScanner scan = new Scanner(System.in);\n\n\t\tint r = scan.nextInt();\n\t\tint c = scan.nextInt();\n\n\t\tint[][] table = new int[r][c + 1];\n\n\t\tfor(int i = 0; i < r; i++) {\n\t\t\tint sum = 0;\n\t\t\tfor(int j = 0; j < c; j++) {\n\t\t\t\ttable[i][j] = scan.nextInt();\n\t\t\t\tsum += table[i][j];\n\t\t\t\tSystem.out.printf(table[i][j] + \" \");\n\t\t\t}\n\t\t\ttable[i][c] = sum;\n\t\t\tSystem.out.println(sum);\n\t\t}\n\n\t\tfor(int i = 0; i < c + 1; i++) {\n\t\t\tint sum = 0;\n\t\t\tfor(int j = 0; j < r; j++) {\n\t\t\t\tsum += table[j][i];\n\t\t\t}\n\t\t\tif(i != 0) {\n\t\t\t\tSystem.out.printf(\" \");\n\t\t\t}\n\t\t\tSystem.out.printf(sum + \"\");\n\t\t}\n\t\t\n\t\tSystem.out.println();\n\n\t\tscan.close();\n\t}\n}",
"Main",
"public static void main(String[] args) {\n\t\tScanner scan = new Scanner(System.in);\n\n\t\tint r = scan.nextInt();\n\t\tint c = scan.nextInt();\n\n\t\tint[][] table = new int[r][c + 1];\n\n\t\tfor(int i = 0; i < r; i++) {\n\t\t\tint sum = 0;\n\t\t\tfor(int j = 0; j < c; j++) {\n\t\t\t\ttable[i][j] = scan.nextInt();\n\t\t\t\tsum += table[i][j];\n\t\t\t\tSystem.out.printf(table[i][j] + \" \");\n\t\t\t}\n\t\t\ttable[i][c] = sum;\n\t\t\tSystem.out.println(sum);\n\t\t}\n\n\t\tfor(int i = 0; i < c + 1; i++) {\n\t\t\tint sum = 0;\n\t\t\tfor(int j = 0; j < r; j++) {\n\t\t\t\tsum += table[j][i];\n\t\t\t}\n\t\t\tif(i != 0) {\n\t\t\t\tSystem.out.printf(\" \");\n\t\t\t}\n\t\t\tSystem.out.printf(sum + \"\");\n\t\t}\n\t\t\n\t\tSystem.out.println();\n\n\t\tscan.close();\n\t}",
"main",
"{\n\t\tScanner scan = new Scanner(System.in);\n\n\t\tint r = scan.nextInt();\n\t\tint c = scan.nextInt();\n\n\t\tint[][] table = new int[r][c + 1];\n\n\t\tfor(int i = 0; i < r; i++) {\n\t\t\tint sum = 0;\n\t\t\tfor(int j = 0; j < c; j++) {\n\t\t\t\ttable[i][j] = scan.nextInt();\n\t\t\t\tsum += table[i][j];\n\t\t\t\tSystem.out.printf(table[i][j] + \" \");\n\t\t\t}\n\t\t\ttable[i][c] = sum;\n\t\t\tSystem.out.println(sum);\n\t\t}\n\n\t\tfor(int i = 0; i < c + 1; i++) {\n\t\t\tint sum = 0;\n\t\t\tfor(int j = 0; j < r; j++) {\n\t\t\t\tsum += table[j][i];\n\t\t\t}\n\t\t\tif(i != 0) {\n\t\t\t\tSystem.out.printf(\" \");\n\t\t\t}\n\t\t\tSystem.out.printf(sum + \"\");\n\t\t}\n\t\t\n\t\tSystem.out.println();\n\n\t\tscan.close();\n\t}",
"Scanner scan = new Scanner(System.in);",
"scan",
"new Scanner(System.in)",
"int r = scan.nextInt();",
"r",
"scan.nextInt()",
"scan.nextInt",
"scan",
"int c = scan.nextInt();",
"c",
"scan.nextInt()",
"scan.nextInt",
"scan",
"int[][] table = new int[r][c + 1];",
"table",
"new int[r][c + 1]",
"r",
"c + 1",
"c",
"1",
"for(int i = 0; i < r; i++) {\n\t\t\tint sum = 0;\n\t\t\tfor(int j = 0; j < c; j++) {\n\t\t\t\ttable[i][j] = scan.nextInt();\n\t\t\t\tsum += table[i][j];\n\t\t\t\tSystem.out.printf(table[i][j] + \" \");\n\t\t\t}\n\t\t\ttable[i][c] = sum;\n\t\t\tSystem.out.println(sum);\n\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < r",
"i",
"r",
"i++",
"i++",
"i",
"{\n\t\t\tint sum = 0;\n\t\t\tfor(int j = 0; j < c; j++) {\n\t\t\t\ttable[i][j] = scan.nextInt();\n\t\t\t\tsum += table[i][j];\n\t\t\t\tSystem.out.printf(table[i][j] + \" \");\n\t\t\t}\n\t\t\ttable[i][c] = sum;\n\t\t\tSystem.out.println(sum);\n\t\t}",
"{\n\t\t\tint sum = 0;\n\t\t\tfor(int j = 0; j < c; j++) {\n\t\t\t\ttable[i][j] = scan.nextInt();\n\t\t\t\tsum += table[i][j];\n\t\t\t\tSystem.out.printf(table[i][j] + \" \");\n\t\t\t}\n\t\t\ttable[i][c] = sum;\n\t\t\tSystem.out.println(sum);\n\t\t}",
"int sum = 0;",
"sum",
"0",
"for(int j = 0; j < c; j++) {\n\t\t\t\ttable[i][j] = scan.nextInt();\n\t\t\t\tsum += table[i][j];\n\t\t\t\tSystem.out.printf(table[i][j] + \" \");\n\t\t\t}",
"int j = 0;",
"int j = 0;",
"j",
"0",
"j < c",
"j",
"c",
"j++",
"j++",
"j",
"{\n\t\t\t\ttable[i][j] = scan.nextInt();\n\t\t\t\tsum += table[i][j];\n\t\t\t\tSystem.out.printf(table[i][j] + \" \");\n\t\t\t}",
"{\n\t\t\t\ttable[i][j] = scan.nextInt();\n\t\t\t\tsum += table[i][j];\n\t\t\t\tSystem.out.printf(table[i][j] + \" \");\n\t\t\t}",
"table[i][j] = scan.nextInt()",
"table[i][j]",
"table[i]",
"table",
"i",
"j",
"scan.nextInt()",
"scan.nextInt",
"scan",
"sum += table[i][j]",
"sum",
"table[i][j]",
"table[i]",
"table",
"i",
"j",
"System.out.printf(table[i][j] + \" \")",
"System.out.printf",
"System.out",
"System",
"System.out",
"table[i][j] + \" \"",
"table[i][j]",
"table[i]",
"table",
"i",
"j",
"\" \"",
"table[i][c] = sum",
"table[i][c]",
"table[i]",
"table",
"i",
"c",
"sum",
"System.out.println(sum)",
"System.out.println",
"System.out",
"System",
"System.out",
"sum",
"for(int i = 0; i < c + 1; i++) {\n\t\t\tint sum = 0;\n\t\t\tfor(int j = 0; j < r; j++) {\n\t\t\t\tsum += table[j][i];\n\t\t\t}\n\t\t\tif(i != 0) {\n\t\t\t\tSystem.out.printf(\" \");\n\t\t\t}\n\t\t\tSystem.out.printf(sum + \"\");\n\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < c + 1",
"i",
"c + 1",
"c",
"1",
"i++",
"i++",
"i",
"{\n\t\t\tint sum = 0;\n\t\t\tfor(int j = 0; j < r; j++) {\n\t\t\t\tsum += table[j][i];\n\t\t\t}\n\t\t\tif(i != 0) {\n\t\t\t\tSystem.out.printf(\" \");\n\t\t\t}\n\t\t\tSystem.out.printf(sum + \"\");\n\t\t}",
"{\n\t\t\tint sum = 0;\n\t\t\tfor(int j = 0; j < r; j++) {\n\t\t\t\tsum += table[j][i];\n\t\t\t}\n\t\t\tif(i != 0) {\n\t\t\t\tSystem.out.printf(\" \");\n\t\t\t}\n\t\t\tSystem.out.printf(sum + \"\");\n\t\t}",
"int sum = 0;",
"sum",
"0",
"for(int j = 0; j < r; j++) {\n\t\t\t\tsum += table[j][i];\n\t\t\t}",
"int j = 0;",
"int j = 0;",
"j",
"0",
"j < r",
"j",
"r",
"j++",
"j++",
"j",
"{\n\t\t\t\tsum += table[j][i];\n\t\t\t}",
"{\n\t\t\t\tsum += table[j][i];\n\t\t\t}",
"sum += table[j][i]",
"sum",
"table[j][i]",
"table[j]",
"table",
"j",
"i",
"if(i != 0) {\n\t\t\t\tSystem.out.printf(\" \");\n\t\t\t}",
"i != 0",
"i",
"0",
"{\n\t\t\t\tSystem.out.printf(\" \");\n\t\t\t}",
"System.out.printf(\" \")",
"System.out.printf",
"System.out",
"System",
"System.out",
"\" \"",
"System.out.printf(sum + \"\")",
"System.out.printf",
"System.out",
"System",
"System.out",
"sum + \"\"",
"sum",
"\"\"",
"System.out.println()",
"System.out.println",
"System.out",
"System",
"System.out",
"scan.close()",
"scan.close",
"scan",
"String[] args",
"args",
"public class Main {\n\tpublic static void main(String[] args) {\n\t\tScanner scan = new Scanner(System.in);\n\n\t\tint r = scan.nextInt();\n\t\tint c = scan.nextInt();\n\n\t\tint[][] table = new int[r][c + 1];\n\n\t\tfor(int i = 0; i < r; i++) {\n\t\t\tint sum = 0;\n\t\t\tfor(int j = 0; j < c; j++) {\n\t\t\t\ttable[i][j] = scan.nextInt();\n\t\t\t\tsum += table[i][j];\n\t\t\t\tSystem.out.printf(table[i][j] + \" \");\n\t\t\t}\n\t\t\ttable[i][c] = sum;\n\t\t\tSystem.out.println(sum);\n\t\t}\n\n\t\tfor(int i = 0; i < c + 1; i++) {\n\t\t\tint sum = 0;\n\t\t\tfor(int j = 0; j < r; j++) {\n\t\t\t\tsum += table[j][i];\n\t\t\t}\n\t\t\tif(i != 0) {\n\t\t\t\tSystem.out.printf(\" \");\n\t\t\t}\n\t\t\tSystem.out.printf(sum + \"\");\n\t\t}\n\t\t\n\t\tSystem.out.println();\n\n\t\tscan.close();\n\t}\n}",
"public class Main {\n\tpublic static void main(String[] args) {\n\t\tScanner scan = new Scanner(System.in);\n\n\t\tint r = scan.nextInt();\n\t\tint c = scan.nextInt();\n\n\t\tint[][] table = new int[r][c + 1];\n\n\t\tfor(int i = 0; i < r; i++) {\n\t\t\tint sum = 0;\n\t\t\tfor(int j = 0; j < c; j++) {\n\t\t\t\ttable[i][j] = scan.nextInt();\n\t\t\t\tsum += table[i][j];\n\t\t\t\tSystem.out.printf(table[i][j] + \" \");\n\t\t\t}\n\t\t\ttable[i][c] = sum;\n\t\t\tSystem.out.println(sum);\n\t\t}\n\n\t\tfor(int i = 0; i < c + 1; i++) {\n\t\t\tint sum = 0;\n\t\t\tfor(int j = 0; j < r; j++) {\n\t\t\t\tsum += table[j][i];\n\t\t\t}\n\t\t\tif(i != 0) {\n\t\t\t\tSystem.out.printf(\" \");\n\t\t\t}\n\t\t\tSystem.out.printf(sum + \"\");\n\t\t}\n\t\t\n\t\tSystem.out.println();\n\n\t\tscan.close();\n\t}\n}",
"Main"
] | import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
int r = scan.nextInt();
int c = scan.nextInt();
int[][] table = new int[r][c + 1];
for(int i = 0; i < r; i++) {
int sum = 0;
for(int j = 0; j < c; j++) {
table[i][j] = scan.nextInt();
sum += table[i][j];
System.out.printf(table[i][j] + " ");
}
table[i][c] = sum;
System.out.println(sum);
}
for(int i = 0; i < c + 1; i++) {
int sum = 0;
for(int j = 0; j < r; j++) {
sum += table[j][i];
}
if(i != 0) {
System.out.printf(" ");
}
System.out.printf(sum + "");
}
System.out.println();
scan.close();
}
}
|
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
41,
13,
20,
2,
13,
17,
2,
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,
18,
18,
13,
13,
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,
0,
18,
18,
13,
13,
13,
18,
18,
13,
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,
18,
18,
13,
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,
4,
18,
18,
13,
13,
18,
18,
13,
13,
13,
14,
40,
2,
13,
13,
4,
18,
18,
13,
13,
17,
4,
18,
18,
13,
13,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
195,
5
],
[
195,
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
],
[
19,
20
],
[
20,
21
],
[
8,
22
],
[
22,
23
],
[
22,
24
],
[
25,
26
],
[
25,
27
],
[
28,
29
],
[
28,
30
],
[
8,
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
],
[
58,
62
],
[
57,
63
],
[
63,
64
],
[
64,
65
],
[
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
],
[
93,
94
],
[
94,
95
],
[
94,
96
],
[
93,
97
],
[
92,
98
],
[
98,
99
],
[
99,
100
],
[
99,
101
],
[
98,
102
],
[
8,
103
],
[
103,
104
],
[
104,
105
],
[
105,
106
],
[
105,
107
],
[
103,
108
],
[
108,
109
],
[
108,
110
],
[
103,
111
],
[
111,
112
],
[
112,
113
],
[
103,
114
],
[
115,
115
],
[
115,
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
],
[
130,
131
],
[
131,
132
],
[
131,
133
],
[
130,
134
],
[
129,
135
],
[
135,
136
],
[
136,
137
],
[
136,
138
],
[
135,
139
],
[
8,
140
],
[
140,
141
],
[
141,
142
],
[
142,
143
],
[
142,
144
],
[
140,
145
],
[
145,
146
],
[
145,
147
],
[
140,
148
],
[
148,
149
],
[
149,
150
],
[
140,
151
],
[
152,
152
],
[
152,
153
],
[
153,
154
],
[
154,
155
],
[
155,
156
],
[
155,
157
],
[
153,
158
],
[
158,
159
],
[
158,
160
],
[
153,
161
],
[
161,
162
],
[
162,
163
],
[
153,
164
],
[
165,
165
],
[
165,
166
],
[
166,
167
],
[
167,
168
],
[
168,
169
],
[
168,
170
],
[
166,
171
],
[
171,
172
],
[
172,
173
],
[
172,
174
],
[
171,
175
],
[
165,
176
],
[
176,
177
],
[
177,
178
],
[
178,
179
],
[
178,
180
],
[
176,
181
],
[
181,
182
],
[
182,
183
],
[
183,
184
],
[
183,
185
],
[
181,
186
],
[
152,
187
],
[
187,
188
],
[
188,
189
],
[
189,
190
],
[
189,
191
],
[
6,
192
],
[
192,
193
],
[
0,
194
],
[
194,
195
],
[
194,
196
]
] | [
"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 c = sc.nextInt();\n\t\tint r = sc.nextInt();\n\t\tint matrix[][] = new int[c + 1][r + 1];\n\t\tfor (int i = 0; i < c; i++) {\n\t\t\tfor (int j = 0; j < r; j++) {\n\t\t\t\tmatrix[i][j] = sc.nextInt();\n\t\t\t}\n\t\t}\n\n\t\tfor (int i = 0; i < c; i++) {\n\t\t\tfor (int j = 0; j < r; j++) {\n\t\t\t\tmatrix[i][r] += matrix[i][j];\n\t\t\t}\n\t\t}\n\n\t\tfor (int i = 0; i < c; i++) {\n\t\t\tfor (int j = 0; j <= r; j++) {\n\t\t\t\tmatrix[c][j] += matrix[i][j];\n\t\t\t}\n\t\t}\n\n\t\tfor (int i = 0; i <= c; i++) {\n\t\t\tfor (int j = 0; j <= r; j++) {\n\t\t\t\tSystem.out.print(matrix[i][j]);\n\t\t\t\tif (!(j == r))\n\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}\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 c = sc.nextInt();\n\t\tint r = sc.nextInt();\n\t\tint matrix[][] = new int[c + 1][r + 1];\n\t\tfor (int i = 0; i < c; i++) {\n\t\t\tfor (int j = 0; j < r; j++) {\n\t\t\t\tmatrix[i][j] = sc.nextInt();\n\t\t\t}\n\t\t}\n\n\t\tfor (int i = 0; i < c; i++) {\n\t\t\tfor (int j = 0; j < r; j++) {\n\t\t\t\tmatrix[i][r] += matrix[i][j];\n\t\t\t}\n\t\t}\n\n\t\tfor (int i = 0; i < c; i++) {\n\t\t\tfor (int j = 0; j <= r; j++) {\n\t\t\t\tmatrix[c][j] += matrix[i][j];\n\t\t\t}\n\t\t}\n\n\t\tfor (int i = 0; i <= c; i++) {\n\t\t\tfor (int j = 0; j <= r; j++) {\n\t\t\t\tSystem.out.print(matrix[i][j]);\n\t\t\t\tif (!(j == r))\n\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}\n\t}\n\n}",
"Main",
"public static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\tint c = sc.nextInt();\n\t\tint r = sc.nextInt();\n\t\tint matrix[][] = new int[c + 1][r + 1];\n\t\tfor (int i = 0; i < c; i++) {\n\t\t\tfor (int j = 0; j < r; j++) {\n\t\t\t\tmatrix[i][j] = sc.nextInt();\n\t\t\t}\n\t\t}\n\n\t\tfor (int i = 0; i < c; i++) {\n\t\t\tfor (int j = 0; j < r; j++) {\n\t\t\t\tmatrix[i][r] += matrix[i][j];\n\t\t\t}\n\t\t}\n\n\t\tfor (int i = 0; i < c; i++) {\n\t\t\tfor (int j = 0; j <= r; j++) {\n\t\t\t\tmatrix[c][j] += matrix[i][j];\n\t\t\t}\n\t\t}\n\n\t\tfor (int i = 0; i <= c; i++) {\n\t\t\tfor (int j = 0; j <= r; j++) {\n\t\t\t\tSystem.out.print(matrix[i][j]);\n\t\t\t\tif (!(j == r))\n\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}\n\t}",
"main",
"{\n\t\tScanner sc = new Scanner(System.in);\n\t\tint c = sc.nextInt();\n\t\tint r = sc.nextInt();\n\t\tint matrix[][] = new int[c + 1][r + 1];\n\t\tfor (int i = 0; i < c; i++) {\n\t\t\tfor (int j = 0; j < r; j++) {\n\t\t\t\tmatrix[i][j] = sc.nextInt();\n\t\t\t}\n\t\t}\n\n\t\tfor (int i = 0; i < c; i++) {\n\t\t\tfor (int j = 0; j < r; j++) {\n\t\t\t\tmatrix[i][r] += matrix[i][j];\n\t\t\t}\n\t\t}\n\n\t\tfor (int i = 0; i < c; i++) {\n\t\t\tfor (int j = 0; j <= r; j++) {\n\t\t\t\tmatrix[c][j] += matrix[i][j];\n\t\t\t}\n\t\t}\n\n\t\tfor (int i = 0; i <= c; i++) {\n\t\t\tfor (int j = 0; j <= r; j++) {\n\t\t\t\tSystem.out.print(matrix[i][j]);\n\t\t\t\tif (!(j == r))\n\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}\n\t}",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"int c = sc.nextInt();",
"c",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int r = sc.nextInt();",
"r",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int matrix[][] = new int[c + 1][r + 1];",
"matrix",
"new int[c + 1][r + 1]",
"c + 1",
"c",
"1",
"r + 1",
"r",
"1",
"for (int i = 0; i < c; i++) {\n\t\t\tfor (int j = 0; j < r; j++) {\n\t\t\t\tmatrix[i][j] = sc.nextInt();\n\t\t\t}\n\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < c",
"i",
"c",
"i++",
"i++",
"i",
"{\n\t\t\tfor (int j = 0; j < r; j++) {\n\t\t\t\tmatrix[i][j] = sc.nextInt();\n\t\t\t}\n\t\t}",
"{\n\t\t\tfor (int j = 0; j < r; j++) {\n\t\t\t\tmatrix[i][j] = sc.nextInt();\n\t\t\t}\n\t\t}",
"for (int j = 0; j < r; j++) {\n\t\t\t\tmatrix[i][j] = sc.nextInt();\n\t\t\t}",
"int j = 0;",
"int j = 0;",
"j",
"0",
"j < r",
"j",
"r",
"j++",
"j++",
"j",
"{\n\t\t\t\tmatrix[i][j] = sc.nextInt();\n\t\t\t}",
"{\n\t\t\t\tmatrix[i][j] = sc.nextInt();\n\t\t\t}",
"matrix[i][j] = sc.nextInt()",
"matrix[i][j]",
"matrix[i]",
"matrix",
"i",
"j",
"sc.nextInt()",
"sc.nextInt",
"sc",
"for (int i = 0; i < c; i++) {\n\t\t\tfor (int j = 0; j < r; j++) {\n\t\t\t\tmatrix[i][r] += matrix[i][j];\n\t\t\t}\n\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < c",
"i",
"c",
"i++",
"i++",
"i",
"{\n\t\t\tfor (int j = 0; j < r; j++) {\n\t\t\t\tmatrix[i][r] += matrix[i][j];\n\t\t\t}\n\t\t}",
"{\n\t\t\tfor (int j = 0; j < r; j++) {\n\t\t\t\tmatrix[i][r] += matrix[i][j];\n\t\t\t}\n\t\t}",
"for (int j = 0; j < r; j++) {\n\t\t\t\tmatrix[i][r] += matrix[i][j];\n\t\t\t}",
"int j = 0;",
"int j = 0;",
"j",
"0",
"j < r",
"j",
"r",
"j++",
"j++",
"j",
"{\n\t\t\t\tmatrix[i][r] += matrix[i][j];\n\t\t\t}",
"{\n\t\t\t\tmatrix[i][r] += matrix[i][j];\n\t\t\t}",
"matrix[i][r] += matrix[i][j]",
"matrix[i][r]",
"matrix[i]",
"matrix",
"i",
"r",
"matrix[i][j]",
"matrix[i]",
"matrix",
"i",
"j",
"for (int i = 0; i < c; i++) {\n\t\t\tfor (int j = 0; j <= r; j++) {\n\t\t\t\tmatrix[c][j] += matrix[i][j];\n\t\t\t}\n\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < c",
"i",
"c",
"i++",
"i++",
"i",
"{\n\t\t\tfor (int j = 0; j <= r; j++) {\n\t\t\t\tmatrix[c][j] += matrix[i][j];\n\t\t\t}\n\t\t}",
"{\n\t\t\tfor (int j = 0; j <= r; j++) {\n\t\t\t\tmatrix[c][j] += matrix[i][j];\n\t\t\t}\n\t\t}",
"for (int j = 0; j <= r; j++) {\n\t\t\t\tmatrix[c][j] += matrix[i][j];\n\t\t\t}",
"int j = 0;",
"int j = 0;",
"j",
"0",
"j <= r",
"j",
"r",
"j++",
"j++",
"j",
"{\n\t\t\t\tmatrix[c][j] += matrix[i][j];\n\t\t\t}",
"{\n\t\t\t\tmatrix[c][j] += matrix[i][j];\n\t\t\t}",
"matrix[c][j] += matrix[i][j]",
"matrix[c][j]",
"matrix[c]",
"matrix",
"c",
"j",
"matrix[i][j]",
"matrix[i]",
"matrix",
"i",
"j",
"for (int i = 0; i <= c; i++) {\n\t\t\tfor (int j = 0; j <= r; j++) {\n\t\t\t\tSystem.out.print(matrix[i][j]);\n\t\t\t\tif (!(j == r))\n\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i <= c",
"i",
"c",
"i++",
"i++",
"i",
"{\n\t\t\tfor (int j = 0; j <= r; j++) {\n\t\t\t\tSystem.out.print(matrix[i][j]);\n\t\t\t\tif (!(j == r))\n\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}",
"{\n\t\t\tfor (int j = 0; j <= r; j++) {\n\t\t\t\tSystem.out.print(matrix[i][j]);\n\t\t\t\tif (!(j == r))\n\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}",
"for (int j = 0; j <= r; j++) {\n\t\t\t\tSystem.out.print(matrix[i][j]);\n\t\t\t\tif (!(j == r))\n\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t}",
"int j = 0;",
"int j = 0;",
"j",
"0",
"j <= r",
"j",
"r",
"j++",
"j++",
"j",
"{\n\t\t\t\tSystem.out.print(matrix[i][j]);\n\t\t\t\tif (!(j == r))\n\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t}",
"{\n\t\t\t\tSystem.out.print(matrix[i][j]);\n\t\t\t\tif (!(j == r))\n\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t}",
"System.out.print(matrix[i][j])",
"System.out.print",
"System.out",
"System",
"System.out",
"matrix[i][j]",
"matrix[i]",
"matrix",
"i",
"j",
"if (!(j == r))\n\t\t\t\t\tSystem.out.print(\" \");",
"!(j == r)",
"(j == r)",
"j",
"r",
"System.out.print(\" \")",
"System.out.print",
"System.out",
"System",
"System.out",
"\" \"",
"System.out.println()",
"System.out.println",
"System.out",
"System",
"System.out",
"String[] args",
"args",
"public class Main {\n\n\tpublic static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\tint c = sc.nextInt();\n\t\tint r = sc.nextInt();\n\t\tint matrix[][] = new int[c + 1][r + 1];\n\t\tfor (int i = 0; i < c; i++) {\n\t\t\tfor (int j = 0; j < r; j++) {\n\t\t\t\tmatrix[i][j] = sc.nextInt();\n\t\t\t}\n\t\t}\n\n\t\tfor (int i = 0; i < c; i++) {\n\t\t\tfor (int j = 0; j < r; j++) {\n\t\t\t\tmatrix[i][r] += matrix[i][j];\n\t\t\t}\n\t\t}\n\n\t\tfor (int i = 0; i < c; i++) {\n\t\t\tfor (int j = 0; j <= r; j++) {\n\t\t\t\tmatrix[c][j] += matrix[i][j];\n\t\t\t}\n\t\t}\n\n\t\tfor (int i = 0; i <= c; i++) {\n\t\t\tfor (int j = 0; j <= r; j++) {\n\t\t\t\tSystem.out.print(matrix[i][j]);\n\t\t\t\tif (!(j == r))\n\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}\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 c = sc.nextInt();\n\t\tint r = sc.nextInt();\n\t\tint matrix[][] = new int[c + 1][r + 1];\n\t\tfor (int i = 0; i < c; i++) {\n\t\t\tfor (int j = 0; j < r; j++) {\n\t\t\t\tmatrix[i][j] = sc.nextInt();\n\t\t\t}\n\t\t}\n\n\t\tfor (int i = 0; i < c; i++) {\n\t\t\tfor (int j = 0; j < r; j++) {\n\t\t\t\tmatrix[i][r] += matrix[i][j];\n\t\t\t}\n\t\t}\n\n\t\tfor (int i = 0; i < c; i++) {\n\t\t\tfor (int j = 0; j <= r; j++) {\n\t\t\t\tmatrix[c][j] += matrix[i][j];\n\t\t\t}\n\t\t}\n\n\t\tfor (int i = 0; i <= c; i++) {\n\t\t\tfor (int j = 0; j <= r; j++) {\n\t\t\t\tSystem.out.print(matrix[i][j]);\n\t\t\t\tif (!(j == r))\n\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}\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 c = sc.nextInt();
int r = sc.nextInt();
int matrix[][] = new int[c + 1][r + 1];
for (int i = 0; i < c; i++) {
for (int j = 0; j < r; j++) {
matrix[i][j] = sc.nextInt();
}
}
for (int i = 0; i < c; i++) {
for (int j = 0; j < r; j++) {
matrix[i][r] += matrix[i][j];
}
}
for (int i = 0; i < c; i++) {
for (int j = 0; j <= r; j++) {
matrix[c][j] += matrix[i][j];
}
}
for (int i = 0; i <= c; i++) {
for (int j = 0; j <= r; j++) {
System.out.print(matrix[i][j]);
if (!(j == r))
System.out.print(" ");
}
System.out.println();
}
}
} |
[
7,
15,
13,
17,
6,
13,
41,
13,
20,
12,
13,
30,
41,
13,
4,
13,
41,
13,
4,
13,
41,
13,
20,
2,
13,
17,
2,
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,
18,
18,
13,
13,
13,
4,
13,
0,
18,
18,
13,
13,
13,
18,
18,
13,
13,
13,
0,
18,
18,
13,
13,
13,
18,
18,
13,
13,
13,
0,
18,
18,
13,
13,
13,
18,
18,
13,
13,
13,
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,
14,
2,
2,
13,
13,
2,
13,
13,
30,
4,
18,
18,
13,
13,
18,
18,
13,
13,
13,
14,
2,
2,
13,
13,
2,
13,
13,
30,
4,
18,
18,
13,
13,
18,
18,
13,
13,
13,
14,
2,
13,
13,
30,
4,
18,
18,
13,
13,
18,
18,
13,
13,
13,
14,
2,
13,
13,
30,
4,
18,
18,
13,
13,
18,
18,
13,
13,
13,
14,
2,
13,
13,
30,
4,
18,
18,
13,
13,
17,
4,
18,
18,
13,
13,
17,
4,
13,
23,
13,
12,
13,
30,
29,
4,
18,
13,
12,
13,
30,
14,
2,
13,
17,
30,
4,
18,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
234,
5
],
[
234,
6
],
[
6,
7
],
[
6,
8
],
[
234,
9
],
[
9,
10
],
[
9,
11
],
[
11,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
11,
16
],
[
16,
17
],
[
16,
18
],
[
18,
19
],
[
11,
20
],
[
20,
21
],
[
20,
22
],
[
23,
24
],
[
23,
25
],
[
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
],
[
56,
60
],
[
55,
61
],
[
61,
62
],
[
54,
63
],
[
63,
64
],
[
64,
65
],
[
65,
66
],
[
65,
67
],
[
64,
68
],
[
63,
69
],
[
69,
70
],
[
70,
71
],
[
70,
72
],
[
69,
73
],
[
54,
74
],
[
74,
75
],
[
75,
76
],
[
76,
77
],
[
76,
78
],
[
75,
79
],
[
74,
80
],
[
80,
81
],
[
81,
82
],
[
81,
83
],
[
80,
84
],
[
54,
85
],
[
85,
86
],
[
86,
87
],
[
87,
88
],
[
87,
89
],
[
86,
90
],
[
85,
91
],
[
91,
92
],
[
92,
93
],
[
92,
94
],
[
91,
95
],
[
11,
96
],
[
96,
97
],
[
97,
98
],
[
98,
99
],
[
98,
100
],
[
96,
101
],
[
101,
102
],
[
101,
103
],
[
103,
104
],
[
103,
105
],
[
96,
106
],
[
106,
107
],
[
107,
108
],
[
96,
109
],
[
110,
110
],
[
110,
111
],
[
111,
112
],
[
112,
113
],
[
113,
114
],
[
113,
115
],
[
111,
116
],
[
116,
117
],
[
116,
118
],
[
118,
119
],
[
118,
120
],
[
111,
121
],
[
121,
122
],
[
122,
123
],
[
111,
124
],
[
125,
125
],
[
125,
126
],
[
126,
127
],
[
127,
128
],
[
128,
129
],
[
128,
130
],
[
127,
131
],
[
131,
132
],
[
131,
133
],
[
126,
134
],
[
134,
135
],
[
135,
136
],
[
136,
137
],
[
137,
138
],
[
137,
139
],
[
135,
140
],
[
140,
141
],
[
141,
142
],
[
141,
143
],
[
140,
144
],
[
126,
145
],
[
145,
146
],
[
146,
147
],
[
147,
148
],
[
147,
149
],
[
146,
150
],
[
150,
151
],
[
150,
152
],
[
145,
153
],
[
153,
154
],
[
154,
155
],
[
155,
156
],
[
156,
157
],
[
156,
158
],
[
154,
159
],
[
159,
160
],
[
160,
161
],
[
160,
162
],
[
159,
163
],
[
145,
164
],
[
164,
165
],
[
165,
166
],
[
165,
167
],
[
164,
168
],
[
168,
169
],
[
169,
170
],
[
170,
171
],
[
171,
172
],
[
171,
173
],
[
169,
174
],
[
174,
175
],
[
175,
176
],
[
175,
177
],
[
174,
178
],
[
164,
179
],
[
179,
180
],
[
180,
181
],
[
180,
182
],
[
179,
183
],
[
183,
184
],
[
184,
185
],
[
185,
186
],
[
186,
187
],
[
186,
188
],
[
184,
189
],
[
189,
190
],
[
190,
191
],
[
190,
192
],
[
189,
193
],
[
125,
194
],
[
194,
195
],
[
195,
196
],
[
195,
197
],
[
194,
198
],
[
198,
199
],
[
199,
200
],
[
200,
201
],
[
201,
202
],
[
201,
203
],
[
199,
204
],
[
110,
205
],
[
205,
206
],
[
206,
207
],
[
207,
208
],
[
207,
209
],
[
205,
210
],
[
11,
211
],
[
211,
212
],
[
9,
213
],
[
213,
214
],
[
234,
215
],
[
215,
216
],
[
215,
217
],
[
217,
218
],
[
218,
219
],
[
219,
220
],
[
220,
221
],
[
234,
222
],
[
222,
223
],
[
222,
224
],
[
224,
225
],
[
225,
226
],
[
226,
227
],
[
226,
228
],
[
225,
229
],
[
229,
230
],
[
230,
231
],
[
231,
232
],
[
0,
233
],
[
233,
234
],
[
233,
235
]
] | [
"import java.util.Scanner;\n\npublic class Main {\n\n\tpublic static Scanner scanner = new Scanner(System.in);\n\n\tpublic static void main(String[] args) {\n\n\t\tint r = input();\n\t\tint c = input();\n\n\t\tint[][] table = new int[r + 1][c + 1];\n\n\t\tfor (int i = 0; i < r; i++) {\n\n\t\t\tfor (int j = 0; j < c; j++) {\n\n\t\t\t\ttable[i][j] = input();\n\t\t\t\ttable[i][c] += table[i][j];\n\t\t\t\ttable[r][j] += table[i][j];\n\t\t\t\ttable[r][c] += table[i][j];\n\n\t\t\t}\n\t\t}\n\n\t\tfor (int i = 0; i < r + 1; i++) {\n\n\t\t\tfor (int j = 0; j < c + 1; j++) {\n\n\t\t\t\tif (i < r && j < c) {\n\n\t\t\t\t\tSystem.out.print(table[i][j]);\n\n\t\t\t\t}else if (i == r && j == c) {\n\n\t\t\t\t\tSystem.out.print(table[r][c]);\n\n\t\t\t\t} else if (i == r) {\n\n\t\t\t\t\tSystem.out.print(table[r][j]);\n\n\t\t\t\t} else if (j == c) {\n\n\t\t\t\t\tSystem.out.print(table[i][c]);\n\n\t\t\t\t}\n\n\t\t\t\tif (j != c) {\n\n\t\t\t\t\tSystem.out.print(\" \");\n\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tSystem.out.println(\"\");\n\n\t\t}\n\n\t\tclose();\n\n\t}\n\n\tpublic static int input() {\n\n\t\treturn scanner.nextInt();\n\n\t}\n\n\tpublic static void close() {\n\n\t\tif (scanner != null) {\n\n\t\t\tscanner.close();\n\n\t\t}\n\t}\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n\n\tpublic static Scanner scanner = new Scanner(System.in);\n\n\tpublic static void main(String[] args) {\n\n\t\tint r = input();\n\t\tint c = input();\n\n\t\tint[][] table = new int[r + 1][c + 1];\n\n\t\tfor (int i = 0; i < r; i++) {\n\n\t\t\tfor (int j = 0; j < c; j++) {\n\n\t\t\t\ttable[i][j] = input();\n\t\t\t\ttable[i][c] += table[i][j];\n\t\t\t\ttable[r][j] += table[i][j];\n\t\t\t\ttable[r][c] += table[i][j];\n\n\t\t\t}\n\t\t}\n\n\t\tfor (int i = 0; i < r + 1; i++) {\n\n\t\t\tfor (int j = 0; j < c + 1; j++) {\n\n\t\t\t\tif (i < r && j < c) {\n\n\t\t\t\t\tSystem.out.print(table[i][j]);\n\n\t\t\t\t}else if (i == r && j == c) {\n\n\t\t\t\t\tSystem.out.print(table[r][c]);\n\n\t\t\t\t} else if (i == r) {\n\n\t\t\t\t\tSystem.out.print(table[r][j]);\n\n\t\t\t\t} else if (j == c) {\n\n\t\t\t\t\tSystem.out.print(table[i][c]);\n\n\t\t\t\t}\n\n\t\t\t\tif (j != c) {\n\n\t\t\t\t\tSystem.out.print(\" \");\n\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tSystem.out.println(\"\");\n\n\t\t}\n\n\t\tclose();\n\n\t}\n\n\tpublic static int input() {\n\n\t\treturn scanner.nextInt();\n\n\t}\n\n\tpublic static void close() {\n\n\t\tif (scanner != null) {\n\n\t\t\tscanner.close();\n\n\t\t}\n\t}\n}",
"Main",
"public static Scanner scanner = new Scanner(System.in);",
"scanner",
"new Scanner(System.in)",
"public static void main(String[] args) {\n\n\t\tint r = input();\n\t\tint c = input();\n\n\t\tint[][] table = new int[r + 1][c + 1];\n\n\t\tfor (int i = 0; i < r; i++) {\n\n\t\t\tfor (int j = 0; j < c; j++) {\n\n\t\t\t\ttable[i][j] = input();\n\t\t\t\ttable[i][c] += table[i][j];\n\t\t\t\ttable[r][j] += table[i][j];\n\t\t\t\ttable[r][c] += table[i][j];\n\n\t\t\t}\n\t\t}\n\n\t\tfor (int i = 0; i < r + 1; i++) {\n\n\t\t\tfor (int j = 0; j < c + 1; j++) {\n\n\t\t\t\tif (i < r && j < c) {\n\n\t\t\t\t\tSystem.out.print(table[i][j]);\n\n\t\t\t\t}else if (i == r && j == c) {\n\n\t\t\t\t\tSystem.out.print(table[r][c]);\n\n\t\t\t\t} else if (i == r) {\n\n\t\t\t\t\tSystem.out.print(table[r][j]);\n\n\t\t\t\t} else if (j == c) {\n\n\t\t\t\t\tSystem.out.print(table[i][c]);\n\n\t\t\t\t}\n\n\t\t\t\tif (j != c) {\n\n\t\t\t\t\tSystem.out.print(\" \");\n\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tSystem.out.println(\"\");\n\n\t\t}\n\n\t\tclose();\n\n\t}",
"main",
"{\n\n\t\tint r = input();\n\t\tint c = input();\n\n\t\tint[][] table = new int[r + 1][c + 1];\n\n\t\tfor (int i = 0; i < r; i++) {\n\n\t\t\tfor (int j = 0; j < c; j++) {\n\n\t\t\t\ttable[i][j] = input();\n\t\t\t\ttable[i][c] += table[i][j];\n\t\t\t\ttable[r][j] += table[i][j];\n\t\t\t\ttable[r][c] += table[i][j];\n\n\t\t\t}\n\t\t}\n\n\t\tfor (int i = 0; i < r + 1; i++) {\n\n\t\t\tfor (int j = 0; j < c + 1; j++) {\n\n\t\t\t\tif (i < r && j < c) {\n\n\t\t\t\t\tSystem.out.print(table[i][j]);\n\n\t\t\t\t}else if (i == r && j == c) {\n\n\t\t\t\t\tSystem.out.print(table[r][c]);\n\n\t\t\t\t} else if (i == r) {\n\n\t\t\t\t\tSystem.out.print(table[r][j]);\n\n\t\t\t\t} else if (j == c) {\n\n\t\t\t\t\tSystem.out.print(table[i][c]);\n\n\t\t\t\t}\n\n\t\t\t\tif (j != c) {\n\n\t\t\t\t\tSystem.out.print(\" \");\n\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tSystem.out.println(\"\");\n\n\t\t}\n\n\t\tclose();\n\n\t}",
"int r = input();",
"r",
"input()",
"input",
"int c = input();",
"c",
"input()",
"input",
"int[][] table = new int[r + 1][c + 1];",
"table",
"new int[r + 1][c + 1]",
"r + 1",
"r",
"1",
"c + 1",
"c",
"1",
"for (int i = 0; i < r; i++) {\n\n\t\t\tfor (int j = 0; j < c; j++) {\n\n\t\t\t\ttable[i][j] = input();\n\t\t\t\ttable[i][c] += table[i][j];\n\t\t\t\ttable[r][j] += table[i][j];\n\t\t\t\ttable[r][c] += table[i][j];\n\n\t\t\t}\n\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < r",
"i",
"r",
"i++",
"i++",
"i",
"{\n\n\t\t\tfor (int j = 0; j < c; j++) {\n\n\t\t\t\ttable[i][j] = input();\n\t\t\t\ttable[i][c] += table[i][j];\n\t\t\t\ttable[r][j] += table[i][j];\n\t\t\t\ttable[r][c] += table[i][j];\n\n\t\t\t}\n\t\t}",
"{\n\n\t\t\tfor (int j = 0; j < c; j++) {\n\n\t\t\t\ttable[i][j] = input();\n\t\t\t\ttable[i][c] += table[i][j];\n\t\t\t\ttable[r][j] += table[i][j];\n\t\t\t\ttable[r][c] += table[i][j];\n\n\t\t\t}\n\t\t}",
"for (int j = 0; j < c; j++) {\n\n\t\t\t\ttable[i][j] = input();\n\t\t\t\ttable[i][c] += table[i][j];\n\t\t\t\ttable[r][j] += table[i][j];\n\t\t\t\ttable[r][c] += table[i][j];\n\n\t\t\t}",
"int j = 0;",
"int j = 0;",
"j",
"0",
"j < c",
"j",
"c",
"j++",
"j++",
"j",
"{\n\n\t\t\t\ttable[i][j] = input();\n\t\t\t\ttable[i][c] += table[i][j];\n\t\t\t\ttable[r][j] += table[i][j];\n\t\t\t\ttable[r][c] += table[i][j];\n\n\t\t\t}",
"{\n\n\t\t\t\ttable[i][j] = input();\n\t\t\t\ttable[i][c] += table[i][j];\n\t\t\t\ttable[r][j] += table[i][j];\n\t\t\t\ttable[r][c] += table[i][j];\n\n\t\t\t}",
"table[i][j] = input()",
"table[i][j]",
"table[i]",
"table",
"i",
"j",
"input()",
"input",
"table[i][c] += table[i][j]",
"table[i][c]",
"table[i]",
"table",
"i",
"c",
"table[i][j]",
"table[i]",
"table",
"i",
"j",
"table[r][j] += table[i][j]",
"table[r][j]",
"table[r]",
"table",
"r",
"j",
"table[i][j]",
"table[i]",
"table",
"i",
"j",
"table[r][c] += table[i][j]",
"table[r][c]",
"table[r]",
"table",
"r",
"c",
"table[i][j]",
"table[i]",
"table",
"i",
"j",
"for (int i = 0; i < r + 1; i++) {\n\n\t\t\tfor (int j = 0; j < c + 1; j++) {\n\n\t\t\t\tif (i < r && j < c) {\n\n\t\t\t\t\tSystem.out.print(table[i][j]);\n\n\t\t\t\t}else if (i == r && j == c) {\n\n\t\t\t\t\tSystem.out.print(table[r][c]);\n\n\t\t\t\t} else if (i == r) {\n\n\t\t\t\t\tSystem.out.print(table[r][j]);\n\n\t\t\t\t} else if (j == c) {\n\n\t\t\t\t\tSystem.out.print(table[i][c]);\n\n\t\t\t\t}\n\n\t\t\t\tif (j != c) {\n\n\t\t\t\t\tSystem.out.print(\" \");\n\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tSystem.out.println(\"\");\n\n\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < r + 1",
"i",
"r + 1",
"r",
"1",
"i++",
"i++",
"i",
"{\n\n\t\t\tfor (int j = 0; j < c + 1; j++) {\n\n\t\t\t\tif (i < r && j < c) {\n\n\t\t\t\t\tSystem.out.print(table[i][j]);\n\n\t\t\t\t}else if (i == r && j == c) {\n\n\t\t\t\t\tSystem.out.print(table[r][c]);\n\n\t\t\t\t} else if (i == r) {\n\n\t\t\t\t\tSystem.out.print(table[r][j]);\n\n\t\t\t\t} else if (j == c) {\n\n\t\t\t\t\tSystem.out.print(table[i][c]);\n\n\t\t\t\t}\n\n\t\t\t\tif (j != c) {\n\n\t\t\t\t\tSystem.out.print(\" \");\n\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tSystem.out.println(\"\");\n\n\t\t}",
"{\n\n\t\t\tfor (int j = 0; j < c + 1; j++) {\n\n\t\t\t\tif (i < r && j < c) {\n\n\t\t\t\t\tSystem.out.print(table[i][j]);\n\n\t\t\t\t}else if (i == r && j == c) {\n\n\t\t\t\t\tSystem.out.print(table[r][c]);\n\n\t\t\t\t} else if (i == r) {\n\n\t\t\t\t\tSystem.out.print(table[r][j]);\n\n\t\t\t\t} else if (j == c) {\n\n\t\t\t\t\tSystem.out.print(table[i][c]);\n\n\t\t\t\t}\n\n\t\t\t\tif (j != c) {\n\n\t\t\t\t\tSystem.out.print(\" \");\n\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tSystem.out.println(\"\");\n\n\t\t}",
"for (int j = 0; j < c + 1; j++) {\n\n\t\t\t\tif (i < r && j < c) {\n\n\t\t\t\t\tSystem.out.print(table[i][j]);\n\n\t\t\t\t}else if (i == r && j == c) {\n\n\t\t\t\t\tSystem.out.print(table[r][c]);\n\n\t\t\t\t} else if (i == r) {\n\n\t\t\t\t\tSystem.out.print(table[r][j]);\n\n\t\t\t\t} else if (j == c) {\n\n\t\t\t\t\tSystem.out.print(table[i][c]);\n\n\t\t\t\t}\n\n\t\t\t\tif (j != c) {\n\n\t\t\t\t\tSystem.out.print(\" \");\n\n\t\t\t\t}\n\t\t\t}",
"int j = 0;",
"int j = 0;",
"j",
"0",
"j < c + 1",
"j",
"c + 1",
"c",
"1",
"j++",
"j++",
"j",
"{\n\n\t\t\t\tif (i < r && j < c) {\n\n\t\t\t\t\tSystem.out.print(table[i][j]);\n\n\t\t\t\t}else if (i == r && j == c) {\n\n\t\t\t\t\tSystem.out.print(table[r][c]);\n\n\t\t\t\t} else if (i == r) {\n\n\t\t\t\t\tSystem.out.print(table[r][j]);\n\n\t\t\t\t} else if (j == c) {\n\n\t\t\t\t\tSystem.out.print(table[i][c]);\n\n\t\t\t\t}\n\n\t\t\t\tif (j != c) {\n\n\t\t\t\t\tSystem.out.print(\" \");\n\n\t\t\t\t}\n\t\t\t}",
"{\n\n\t\t\t\tif (i < r && j < c) {\n\n\t\t\t\t\tSystem.out.print(table[i][j]);\n\n\t\t\t\t}else if (i == r && j == c) {\n\n\t\t\t\t\tSystem.out.print(table[r][c]);\n\n\t\t\t\t} else if (i == r) {\n\n\t\t\t\t\tSystem.out.print(table[r][j]);\n\n\t\t\t\t} else if (j == c) {\n\n\t\t\t\t\tSystem.out.print(table[i][c]);\n\n\t\t\t\t}\n\n\t\t\t\tif (j != c) {\n\n\t\t\t\t\tSystem.out.print(\" \");\n\n\t\t\t\t}\n\t\t\t}",
"if (i < r && j < c) {\n\n\t\t\t\t\tSystem.out.print(table[i][j]);\n\n\t\t\t\t}else if (i == r && j == c) {\n\n\t\t\t\t\tSystem.out.print(table[r][c]);\n\n\t\t\t\t} else if (i == r) {\n\n\t\t\t\t\tSystem.out.print(table[r][j]);\n\n\t\t\t\t} else if (j == c) {\n\n\t\t\t\t\tSystem.out.print(table[i][c]);\n\n\t\t\t\t}",
"i < r && j < c",
"i < r",
"i",
"r",
"j < c",
"j",
"c",
"{\n\n\t\t\t\t\tSystem.out.print(table[i][j]);\n\n\t\t\t\t}",
"System.out.print(table[i][j])",
"System.out.print",
"System.out",
"System",
"System.out",
"table[i][j]",
"table[i]",
"table",
"i",
"j",
"if (i == r && j == c) {\n\n\t\t\t\t\tSystem.out.print(table[r][c]);\n\n\t\t\t\t} else if (i == r) {\n\n\t\t\t\t\tSystem.out.print(table[r][j]);\n\n\t\t\t\t} else if (j == c) {\n\n\t\t\t\t\tSystem.out.print(table[i][c]);\n\n\t\t\t\t}",
"i == r && j == c",
"i == r",
"i",
"r",
"j == c",
"j",
"c",
"{\n\n\t\t\t\t\tSystem.out.print(table[r][c]);\n\n\t\t\t\t}",
"System.out.print(table[r][c])",
"System.out.print",
"System.out",
"System",
"System.out",
"table[r][c]",
"table[r]",
"table",
"r",
"c",
"if (i == r) {\n\n\t\t\t\t\tSystem.out.print(table[r][j]);\n\n\t\t\t\t} else if (j == c) {\n\n\t\t\t\t\tSystem.out.print(table[i][c]);\n\n\t\t\t\t}",
"i == r",
"i",
"r",
"{\n\n\t\t\t\t\tSystem.out.print(table[r][j]);\n\n\t\t\t\t}",
"System.out.print(table[r][j])",
"System.out.print",
"System.out",
"System",
"System.out",
"table[r][j]",
"table[r]",
"table",
"r",
"j",
"if (j == c) {\n\n\t\t\t\t\tSystem.out.print(table[i][c]);\n\n\t\t\t\t}",
"j == c",
"j",
"c",
"{\n\n\t\t\t\t\tSystem.out.print(table[i][c]);\n\n\t\t\t\t}",
"System.out.print(table[i][c])",
"System.out.print",
"System.out",
"System",
"System.out",
"table[i][c]",
"table[i]",
"table",
"i",
"c",
"if (j != c) {\n\n\t\t\t\t\tSystem.out.print(\" \");\n\n\t\t\t\t}",
"j != c",
"j",
"c",
"{\n\n\t\t\t\t\tSystem.out.print(\" \");\n\n\t\t\t\t}",
"System.out.print(\" \")",
"System.out.print",
"System.out",
"System",
"System.out",
"\" \"",
"System.out.println(\"\")",
"System.out.println",
"System.out",
"System",
"System.out",
"\"\"",
"close()",
"close",
"String[] args",
"args",
"public static int input() {\n\n\t\treturn scanner.nextInt();\n\n\t}",
"input",
"{\n\n\t\treturn scanner.nextInt();\n\n\t}",
"return scanner.nextInt();",
"scanner.nextInt()",
"scanner.nextInt",
"scanner",
"public static void close() {\n\n\t\tif (scanner != null) {\n\n\t\t\tscanner.close();\n\n\t\t}\n\t}",
"close",
"{\n\n\t\tif (scanner != null) {\n\n\t\t\tscanner.close();\n\n\t\t}\n\t}",
"if (scanner != null) {\n\n\t\t\tscanner.close();\n\n\t\t}",
"scanner != null",
"scanner",
"null",
"{\n\n\t\t\tscanner.close();\n\n\t\t}",
"scanner.close()",
"scanner.close",
"scanner",
"public class Main {\n\n\tpublic static Scanner scanner = new Scanner(System.in);\n\n\tpublic static void main(String[] args) {\n\n\t\tint r = input();\n\t\tint c = input();\n\n\t\tint[][] table = new int[r + 1][c + 1];\n\n\t\tfor (int i = 0; i < r; i++) {\n\n\t\t\tfor (int j = 0; j < c; j++) {\n\n\t\t\t\ttable[i][j] = input();\n\t\t\t\ttable[i][c] += table[i][j];\n\t\t\t\ttable[r][j] += table[i][j];\n\t\t\t\ttable[r][c] += table[i][j];\n\n\t\t\t}\n\t\t}\n\n\t\tfor (int i = 0; i < r + 1; i++) {\n\n\t\t\tfor (int j = 0; j < c + 1; j++) {\n\n\t\t\t\tif (i < r && j < c) {\n\n\t\t\t\t\tSystem.out.print(table[i][j]);\n\n\t\t\t\t}else if (i == r && j == c) {\n\n\t\t\t\t\tSystem.out.print(table[r][c]);\n\n\t\t\t\t} else if (i == r) {\n\n\t\t\t\t\tSystem.out.print(table[r][j]);\n\n\t\t\t\t} else if (j == c) {\n\n\t\t\t\t\tSystem.out.print(table[i][c]);\n\n\t\t\t\t}\n\n\t\t\t\tif (j != c) {\n\n\t\t\t\t\tSystem.out.print(\" \");\n\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tSystem.out.println(\"\");\n\n\t\t}\n\n\t\tclose();\n\n\t}\n\n\tpublic static int input() {\n\n\t\treturn scanner.nextInt();\n\n\t}\n\n\tpublic static void close() {\n\n\t\tif (scanner != null) {\n\n\t\t\tscanner.close();\n\n\t\t}\n\t}\n}",
"public class Main {\n\n\tpublic static Scanner scanner = new Scanner(System.in);\n\n\tpublic static void main(String[] args) {\n\n\t\tint r = input();\n\t\tint c = input();\n\n\t\tint[][] table = new int[r + 1][c + 1];\n\n\t\tfor (int i = 0; i < r; i++) {\n\n\t\t\tfor (int j = 0; j < c; j++) {\n\n\t\t\t\ttable[i][j] = input();\n\t\t\t\ttable[i][c] += table[i][j];\n\t\t\t\ttable[r][j] += table[i][j];\n\t\t\t\ttable[r][c] += table[i][j];\n\n\t\t\t}\n\t\t}\n\n\t\tfor (int i = 0; i < r + 1; i++) {\n\n\t\t\tfor (int j = 0; j < c + 1; j++) {\n\n\t\t\t\tif (i < r && j < c) {\n\n\t\t\t\t\tSystem.out.print(table[i][j]);\n\n\t\t\t\t}else if (i == r && j == c) {\n\n\t\t\t\t\tSystem.out.print(table[r][c]);\n\n\t\t\t\t} else if (i == r) {\n\n\t\t\t\t\tSystem.out.print(table[r][j]);\n\n\t\t\t\t} else if (j == c) {\n\n\t\t\t\t\tSystem.out.print(table[i][c]);\n\n\t\t\t\t}\n\n\t\t\t\tif (j != c) {\n\n\t\t\t\t\tSystem.out.print(\" \");\n\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tSystem.out.println(\"\");\n\n\t\t}\n\n\t\tclose();\n\n\t}\n\n\tpublic static int input() {\n\n\t\treturn scanner.nextInt();\n\n\t}\n\n\tpublic static void close() {\n\n\t\tif (scanner != null) {\n\n\t\t\tscanner.close();\n\n\t\t}\n\t}\n}",
"Main"
] | import java.util.Scanner;
public class Main {
public static Scanner scanner = new Scanner(System.in);
public static void main(String[] args) {
int r = input();
int c = input();
int[][] table = new int[r + 1][c + 1];
for (int i = 0; i < r; i++) {
for (int j = 0; j < c; j++) {
table[i][j] = input();
table[i][c] += table[i][j];
table[r][j] += table[i][j];
table[r][c] += table[i][j];
}
}
for (int i = 0; i < r + 1; i++) {
for (int j = 0; j < c + 1; j++) {
if (i < r && j < c) {
System.out.print(table[i][j]);
}else if (i == r && j == c) {
System.out.print(table[r][c]);
} else if (i == r) {
System.out.print(table[r][j]);
} else if (j == c) {
System.out.print(table[i][c]);
}
if (j != c) {
System.out.print(" ");
}
}
System.out.println("");
}
close();
}
public static int input() {
return scanner.nextInt();
}
public static void close() {
if (scanner != null) {
scanner.close();
}
}
} |
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
17,
41,
13,
4,
18,
13,
18,
13,
17,
41,
13,
4,
18,
13,
18,
13,
17,
41,
13,
17,
41,
13,
20,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
17,
41,
13,
20,
13,
41,
13,
20,
17,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
18,
13,
13,
4,
18,
13,
18,
13,
13,
4,
18,
18,
13,
13,
18,
13,
13,
4,
18,
18,
13,
13,
17,
0,
13,
18,
13,
13,
0,
18,
13,
13,
18,
13,
13,
4,
18,
18,
13,
13,
13,
0,
13,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
4,
18,
18,
13,
13,
18,
13,
13,
4,
18,
18,
13,
13,
17,
4,
18,
18,
13,
13,
13,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
175,
5
],
[
175,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
8,
17
],
[
17,
18
],
[
17,
19
],
[
19,
20
],
[
20,
21
],
[
19,
22
],
[
8,
23
],
[
23,
24
],
[
23,
25
],
[
25,
26
],
[
26,
27
],
[
25,
28
],
[
28,
29
],
[
28,
30
],
[
8,
31
],
[
31,
32
],
[
31,
33
],
[
33,
34
],
[
34,
35
],
[
33,
36
],
[
36,
37
],
[
36,
38
],
[
8,
39
],
[
39,
40
],
[
39,
41
],
[
8,
42
],
[
42,
43
],
[
42,
44
],
[
8,
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
],
[
58,
64
],
[
64,
65
],
[
64,
66
],
[
66,
67
],
[
67,
68
],
[
66,
69
],
[
58,
70
],
[
70,
71
],
[
70,
72
],
[
58,
74
],
[
74,
75
],
[
74,
76
],
[
58,
78
],
[
78,
79
],
[
78,
80
],
[
58,
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
],
[
95,
97
],
[
94,
98
],
[
98,
99
],
[
99,
100
],
[
98,
101
],
[
101,
102
],
[
101,
103
],
[
93,
104
],
[
104,
105
],
[
105,
106
],
[
106,
107
],
[
106,
108
],
[
104,
109
],
[
109,
110
],
[
109,
111
],
[
93,
112
],
[
112,
113
],
[
113,
114
],
[
114,
115
],
[
114,
116
],
[
112,
117
],
[
93,
118
],
[
118,
119
],
[
118,
120
],
[
120,
121
],
[
120,
122
],
[
93,
123
],
[
123,
124
],
[
124,
125
],
[
124,
126
],
[
123,
127
],
[
127,
128
],
[
127,
129
],
[
58,
130
],
[
130,
131
],
[
131,
132
],
[
132,
133
],
[
132,
134
],
[
130,
135
],
[
58,
136
],
[
136,
137
],
[
136,
138
],
[
8,
139
],
[
139,
140
],
[
140,
141
],
[
141,
142
],
[
141,
143
],
[
139,
144
],
[
144,
145
],
[
144,
146
],
[
139,
147
],
[
147,
148
],
[
148,
149
],
[
139,
150
],
[
151,
151
],
[
151,
152
],
[
152,
153
],
[
153,
154
],
[
154,
155
],
[
154,
156
],
[
152,
157
],
[
157,
158
],
[
157,
159
],
[
151,
160
],
[
160,
161
],
[
161,
162
],
[
162,
163
],
[
162,
164
],
[
160,
165
],
[
8,
166
],
[
166,
167
],
[
167,
168
],
[
168,
169
],
[
168,
170
],
[
166,
171
],
[
6,
172
],
[
172,
173
],
[
0,
174
],
[
174,
175
],
[
174,
176
]
] | [
"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\tString line = sc.nextLine();\n\t\tString[] kari = line.split(\" \");\n\t\tint r = Integer.parseInt(kari[0]);\n\t\tint c = Integer.parseInt(kari[1]);\n\n\t\tint bigsum = 0;\n\n\t\tint[] sum2 = new int[c];\n\n\t\tfor (int i = 0; i < r; i++) {\n\t\t\tString s = sc.nextLine();\n\t\t\tString[] k = s.split(\" \");\n\t\t\tint[] in = new int[c];\n\t\t\tint[] za = new int[2];\n\t\t\tint sum1 = 0;\n\t\t\tfor (int j = 0; j < c; j++) {\n\t\t\t\tin[j] = Integer.parseInt(k[j]);\n\t\t\t\tSystem.out.print(in[j]);\n\t\t\t\tSystem.out.print(\" \");\n\n\t\t\t\tsum1 += in[j];\n\t\t\t\tsum2[j] += in[j];\n\t\t\t}\n\t\t\tSystem.out.println(sum1);\n\t\t\tbigsum += sum1;\n\t\t}\n\n\t\tfor (int i = 0; i < c; i++) {\n\t\t\tSystem.out.print(sum2[i]);\n\t\t\tSystem.out.print(\" \");\n\t\t}\n\n\t\tSystem.out.println(bigsum);\n\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\tString line = sc.nextLine();\n\t\tString[] kari = line.split(\" \");\n\t\tint r = Integer.parseInt(kari[0]);\n\t\tint c = Integer.parseInt(kari[1]);\n\n\t\tint bigsum = 0;\n\n\t\tint[] sum2 = new int[c];\n\n\t\tfor (int i = 0; i < r; i++) {\n\t\t\tString s = sc.nextLine();\n\t\t\tString[] k = s.split(\" \");\n\t\t\tint[] in = new int[c];\n\t\t\tint[] za = new int[2];\n\t\t\tint sum1 = 0;\n\t\t\tfor (int j = 0; j < c; j++) {\n\t\t\t\tin[j] = Integer.parseInt(k[j]);\n\t\t\t\tSystem.out.print(in[j]);\n\t\t\t\tSystem.out.print(\" \");\n\n\t\t\t\tsum1 += in[j];\n\t\t\t\tsum2[j] += in[j];\n\t\t\t}\n\t\t\tSystem.out.println(sum1);\n\t\t\tbigsum += sum1;\n\t\t}\n\n\t\tfor (int i = 0; i < c; i++) {\n\t\t\tSystem.out.print(sum2[i]);\n\t\t\tSystem.out.print(\" \");\n\t\t}\n\n\t\tSystem.out.println(bigsum);\n\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\tString line = sc.nextLine();\n\t\tString[] kari = line.split(\" \");\n\t\tint r = Integer.parseInt(kari[0]);\n\t\tint c = Integer.parseInt(kari[1]);\n\n\t\tint bigsum = 0;\n\n\t\tint[] sum2 = new int[c];\n\n\t\tfor (int i = 0; i < r; i++) {\n\t\t\tString s = sc.nextLine();\n\t\t\tString[] k = s.split(\" \");\n\t\t\tint[] in = new int[c];\n\t\t\tint[] za = new int[2];\n\t\t\tint sum1 = 0;\n\t\t\tfor (int j = 0; j < c; j++) {\n\t\t\t\tin[j] = Integer.parseInt(k[j]);\n\t\t\t\tSystem.out.print(in[j]);\n\t\t\t\tSystem.out.print(\" \");\n\n\t\t\t\tsum1 += in[j];\n\t\t\t\tsum2[j] += in[j];\n\t\t\t}\n\t\t\tSystem.out.println(sum1);\n\t\t\tbigsum += sum1;\n\t\t}\n\n\t\tfor (int i = 0; i < c; i++) {\n\t\t\tSystem.out.print(sum2[i]);\n\t\t\tSystem.out.print(\" \");\n\t\t}\n\n\t\tSystem.out.println(bigsum);\n\n\t}",
"main",
"{\n\t\t// TODO ?????????????????????????????????????????????\n\t\tScanner sc = new Scanner(System.in);\n\t\tString line = sc.nextLine();\n\t\tString[] kari = line.split(\" \");\n\t\tint r = Integer.parseInt(kari[0]);\n\t\tint c = Integer.parseInt(kari[1]);\n\n\t\tint bigsum = 0;\n\n\t\tint[] sum2 = new int[c];\n\n\t\tfor (int i = 0; i < r; i++) {\n\t\t\tString s = sc.nextLine();\n\t\t\tString[] k = s.split(\" \");\n\t\t\tint[] in = new int[c];\n\t\t\tint[] za = new int[2];\n\t\t\tint sum1 = 0;\n\t\t\tfor (int j = 0; j < c; j++) {\n\t\t\t\tin[j] = Integer.parseInt(k[j]);\n\t\t\t\tSystem.out.print(in[j]);\n\t\t\t\tSystem.out.print(\" \");\n\n\t\t\t\tsum1 += in[j];\n\t\t\t\tsum2[j] += in[j];\n\t\t\t}\n\t\t\tSystem.out.println(sum1);\n\t\t\tbigsum += sum1;\n\t\t}\n\n\t\tfor (int i = 0; i < c; i++) {\n\t\t\tSystem.out.print(sum2[i]);\n\t\t\tSystem.out.print(\" \");\n\t\t}\n\n\t\tSystem.out.println(bigsum);\n\n\t}",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"String line = sc.nextLine();",
"line",
"sc.nextLine()",
"sc.nextLine",
"sc",
"String[] kari = line.split(\" \");",
"kari",
"line.split(\" \")",
"line.split",
"line",
"\" \"",
"int r = Integer.parseInt(kari[0]);",
"r",
"Integer.parseInt(kari[0])",
"Integer.parseInt",
"Integer",
"kari[0]",
"kari",
"0",
"int c = Integer.parseInt(kari[1]);",
"c",
"Integer.parseInt(kari[1])",
"Integer.parseInt",
"Integer",
"kari[1]",
"kari",
"1",
"int bigsum = 0;",
"bigsum",
"0",
"int[] sum2 = new int[c];",
"sum2",
"new int[c]",
"c",
"for (int i = 0; i < r; i++) {\n\t\t\tString s = sc.nextLine();\n\t\t\tString[] k = s.split(\" \");\n\t\t\tint[] in = new int[c];\n\t\t\tint[] za = new int[2];\n\t\t\tint sum1 = 0;\n\t\t\tfor (int j = 0; j < c; j++) {\n\t\t\t\tin[j] = Integer.parseInt(k[j]);\n\t\t\t\tSystem.out.print(in[j]);\n\t\t\t\tSystem.out.print(\" \");\n\n\t\t\t\tsum1 += in[j];\n\t\t\t\tsum2[j] += in[j];\n\t\t\t}\n\t\t\tSystem.out.println(sum1);\n\t\t\tbigsum += sum1;\n\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < r",
"i",
"r",
"i++",
"i++",
"i",
"{\n\t\t\tString s = sc.nextLine();\n\t\t\tString[] k = s.split(\" \");\n\t\t\tint[] in = new int[c];\n\t\t\tint[] za = new int[2];\n\t\t\tint sum1 = 0;\n\t\t\tfor (int j = 0; j < c; j++) {\n\t\t\t\tin[j] = Integer.parseInt(k[j]);\n\t\t\t\tSystem.out.print(in[j]);\n\t\t\t\tSystem.out.print(\" \");\n\n\t\t\t\tsum1 += in[j];\n\t\t\t\tsum2[j] += in[j];\n\t\t\t}\n\t\t\tSystem.out.println(sum1);\n\t\t\tbigsum += sum1;\n\t\t}",
"{\n\t\t\tString s = sc.nextLine();\n\t\t\tString[] k = s.split(\" \");\n\t\t\tint[] in = new int[c];\n\t\t\tint[] za = new int[2];\n\t\t\tint sum1 = 0;\n\t\t\tfor (int j = 0; j < c; j++) {\n\t\t\t\tin[j] = Integer.parseInt(k[j]);\n\t\t\t\tSystem.out.print(in[j]);\n\t\t\t\tSystem.out.print(\" \");\n\n\t\t\t\tsum1 += in[j];\n\t\t\t\tsum2[j] += in[j];\n\t\t\t}\n\t\t\tSystem.out.println(sum1);\n\t\t\tbigsum += sum1;\n\t\t}",
"String s = sc.nextLine();",
"s",
"sc.nextLine()",
"sc.nextLine",
"sc",
"String[] k = s.split(\" \");",
"k",
"s.split(\" \")",
"s.split",
"s",
"\" \"",
"int[] in = new int[c];",
"in",
"new int[c]",
"c",
"int[] za = new int[2];",
"za",
"new int[2]",
"2",
"int sum1 = 0;",
"sum1",
"0",
"for (int j = 0; j < c; j++) {\n\t\t\t\tin[j] = Integer.parseInt(k[j]);\n\t\t\t\tSystem.out.print(in[j]);\n\t\t\t\tSystem.out.print(\" \");\n\n\t\t\t\tsum1 += in[j];\n\t\t\t\tsum2[j] += in[j];\n\t\t\t}",
"int j = 0;",
"int j = 0;",
"j",
"0",
"j < c",
"j",
"c",
"j++",
"j++",
"j",
"{\n\t\t\t\tin[j] = Integer.parseInt(k[j]);\n\t\t\t\tSystem.out.print(in[j]);\n\t\t\t\tSystem.out.print(\" \");\n\n\t\t\t\tsum1 += in[j];\n\t\t\t\tsum2[j] += in[j];\n\t\t\t}",
"{\n\t\t\t\tin[j] = Integer.parseInt(k[j]);\n\t\t\t\tSystem.out.print(in[j]);\n\t\t\t\tSystem.out.print(\" \");\n\n\t\t\t\tsum1 += in[j];\n\t\t\t\tsum2[j] += in[j];\n\t\t\t}",
"in[j] = Integer.parseInt(k[j])",
"in[j]",
"in",
"j",
"Integer.parseInt(k[j])",
"Integer.parseInt",
"Integer",
"k[j]",
"k",
"j",
"System.out.print(in[j])",
"System.out.print",
"System.out",
"System",
"System.out",
"in[j]",
"in",
"j",
"System.out.print(\" \")",
"System.out.print",
"System.out",
"System",
"System.out",
"\" \"",
"sum1 += in[j]",
"sum1",
"in[j]",
"in",
"j",
"sum2[j] += in[j]",
"sum2[j]",
"sum2",
"j",
"in[j]",
"in",
"j",
"System.out.println(sum1)",
"System.out.println",
"System.out",
"System",
"System.out",
"sum1",
"bigsum += sum1",
"bigsum",
"sum1",
"for (int i = 0; i < c; i++) {\n\t\t\tSystem.out.print(sum2[i]);\n\t\t\tSystem.out.print(\" \");\n\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < c",
"i",
"c",
"i++",
"i++",
"i",
"{\n\t\t\tSystem.out.print(sum2[i]);\n\t\t\tSystem.out.print(\" \");\n\t\t}",
"{\n\t\t\tSystem.out.print(sum2[i]);\n\t\t\tSystem.out.print(\" \");\n\t\t}",
"System.out.print(sum2[i])",
"System.out.print",
"System.out",
"System",
"System.out",
"sum2[i]",
"sum2",
"i",
"System.out.print(\" \")",
"System.out.print",
"System.out",
"System",
"System.out",
"\" \"",
"System.out.println(bigsum)",
"System.out.println",
"System.out",
"System",
"System.out",
"bigsum",
"String[] args",
"args",
"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\tString line = sc.nextLine();\n\t\tString[] kari = line.split(\" \");\n\t\tint r = Integer.parseInt(kari[0]);\n\t\tint c = Integer.parseInt(kari[1]);\n\n\t\tint bigsum = 0;\n\n\t\tint[] sum2 = new int[c];\n\n\t\tfor (int i = 0; i < r; i++) {\n\t\t\tString s = sc.nextLine();\n\t\t\tString[] k = s.split(\" \");\n\t\t\tint[] in = new int[c];\n\t\t\tint[] za = new int[2];\n\t\t\tint sum1 = 0;\n\t\t\tfor (int j = 0; j < c; j++) {\n\t\t\t\tin[j] = Integer.parseInt(k[j]);\n\t\t\t\tSystem.out.print(in[j]);\n\t\t\t\tSystem.out.print(\" \");\n\n\t\t\t\tsum1 += in[j];\n\t\t\t\tsum2[j] += in[j];\n\t\t\t}\n\t\t\tSystem.out.println(sum1);\n\t\t\tbigsum += sum1;\n\t\t}\n\n\t\tfor (int i = 0; i < c; i++) {\n\t\t\tSystem.out.print(sum2[i]);\n\t\t\tSystem.out.print(\" \");\n\t\t}\n\n\t\tSystem.out.println(bigsum);\n\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\tString line = sc.nextLine();\n\t\tString[] kari = line.split(\" \");\n\t\tint r = Integer.parseInt(kari[0]);\n\t\tint c = Integer.parseInt(kari[1]);\n\n\t\tint bigsum = 0;\n\n\t\tint[] sum2 = new int[c];\n\n\t\tfor (int i = 0; i < r; i++) {\n\t\t\tString s = sc.nextLine();\n\t\t\tString[] k = s.split(\" \");\n\t\t\tint[] in = new int[c];\n\t\t\tint[] za = new int[2];\n\t\t\tint sum1 = 0;\n\t\t\tfor (int j = 0; j < c; j++) {\n\t\t\t\tin[j] = Integer.parseInt(k[j]);\n\t\t\t\tSystem.out.print(in[j]);\n\t\t\t\tSystem.out.print(\" \");\n\n\t\t\t\tsum1 += in[j];\n\t\t\t\tsum2[j] += in[j];\n\t\t\t}\n\t\t\tSystem.out.println(sum1);\n\t\t\tbigsum += sum1;\n\t\t}\n\n\t\tfor (int i = 0; i < c; i++) {\n\t\t\tSystem.out.print(sum2[i]);\n\t\t\tSystem.out.print(\" \");\n\t\t}\n\n\t\tSystem.out.println(bigsum);\n\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);
String line = sc.nextLine();
String[] kari = line.split(" ");
int r = Integer.parseInt(kari[0]);
int c = Integer.parseInt(kari[1]);
int bigsum = 0;
int[] sum2 = new int[c];
for (int i = 0; i < r; i++) {
String s = sc.nextLine();
String[] k = s.split(" ");
int[] in = new int[c];
int[] za = new int[2];
int sum1 = 0;
for (int j = 0; j < c; j++) {
in[j] = Integer.parseInt(k[j]);
System.out.print(in[j]);
System.out.print(" ");
sum1 += in[j];
sum2[j] += in[j];
}
System.out.println(sum1);
bigsum += sum1;
}
for (int i = 0; i < c; i++) {
System.out.print(sum2[i]);
System.out.print(" ");
}
System.out.println(bigsum);
}
} |
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
41,
13,
20,
2,
13,
17,
2,
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,
18,
18,
13,
13,
13,
4,
18,
13,
0,
18,
18,
13,
13,
13,
18,
18,
13,
13,
13,
0,
18,
18,
13,
13,
13,
18,
18,
13,
13,
13,
0,
18,
18,
13,
13,
13,
18,
18,
13,
13,
13,
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,
4,
18,
18,
13,
13,
18,
18,
13,
13,
13,
14,
2,
13,
13,
4,
18,
18,
13,
13,
17,
4,
18,
18,
13,
13,
17,
4,
18,
13,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
161,
5
],
[
161,
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
],
[
19,
20
],
[
20,
21
],
[
8,
22
],
[
22,
23
],
[
22,
24
],
[
25,
26
],
[
25,
27
],
[
28,
29
],
[
28,
30
],
[
8,
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
],
[
58,
62
],
[
57,
63
],
[
63,
64
],
[
64,
65
],
[
56,
66
],
[
66,
67
],
[
67,
68
],
[
68,
69
],
[
68,
70
],
[
67,
71
],
[
66,
72
],
[
72,
73
],
[
73,
74
],
[
73,
75
],
[
72,
76
],
[
56,
77
],
[
77,
78
],
[
78,
79
],
[
79,
80
],
[
79,
81
],
[
78,
82
],
[
77,
83
],
[
83,
84
],
[
84,
85
],
[
84,
86
],
[
83,
87
],
[
56,
88
],
[
88,
89
],
[
89,
90
],
[
90,
91
],
[
90,
92
],
[
89,
93
],
[
88,
94
],
[
94,
95
],
[
95,
96
],
[
95,
97
],
[
94,
98
],
[
8,
99
],
[
99,
100
],
[
100,
101
],
[
101,
102
],
[
101,
103
],
[
99,
104
],
[
104,
105
],
[
104,
106
],
[
106,
107
],
[
106,
108
],
[
99,
109
],
[
109,
110
],
[
110,
111
],
[
99,
112
],
[
113,
113
],
[
113,
114
],
[
114,
115
],
[
115,
116
],
[
116,
117
],
[
116,
118
],
[
114,
119
],
[
119,
120
],
[
119,
121
],
[
121,
122
],
[
121,
123
],
[
114,
124
],
[
124,
125
],
[
125,
126
],
[
114,
127
],
[
128,
128
],
[
128,
129
],
[
129,
130
],
[
130,
131
],
[
131,
132
],
[
131,
133
],
[
129,
134
],
[
134,
135
],
[
135,
136
],
[
135,
137
],
[
134,
138
],
[
128,
139
],
[
139,
140
],
[
140,
141
],
[
140,
142
],
[
139,
143
],
[
143,
144
],
[
144,
145
],
[
145,
146
],
[
145,
147
],
[
143,
148
],
[
113,
149
],
[
149,
150
],
[
150,
151
],
[
151,
152
],
[
151,
153
],
[
149,
154
],
[
8,
155
],
[
155,
156
],
[
156,
157
],
[
6,
158
],
[
158,
159
],
[
0,
160
],
[
160,
161
],
[
160,
162
]
] | [
"import java.util.Scanner;\n\npublic class Main {\n\n\n public static void main(String[] args){\n\t\tScanner scan = new Scanner(System.in);\n\t\tint r = scan.nextInt();//r?????¨?????????\n\t\tint c = scan.nextInt();//c?????¨????¨????\n\t\t\n\t\tint numlist[][] = new int[r + 1][c + 1];//????¨???¨?????????????????????\n\n\t\t//???????????????????????????????????????????´???¨????¨???¨?????????????¨?????????????\n\t\tfor (int cnt_r = 0; cnt_r < r; cnt_r++){\n\t\t\tfor (int cnt_c = 0; cnt_c < c ; cnt_c++) {\n\t\t\t\tnumlist[cnt_r][cnt_c] = scan.nextInt();//????????????????´?\n\t\t\t\tnumlist[cnt_r][c] += numlist[cnt_r][cnt_c];//????????¨???????¨?????¨????\n\t\t\t\tnumlist[r][cnt_c] += numlist[cnt_r][cnt_c];//????????¨???????¨?????¨????\n\t\t\t\tnumlist[r][c] += numlist[cnt_r][cnt_c];//??¨??????????¨?????¨????\n\t\t\t}\n\t\t}\n\t\tfor (int cnt_r = 0; cnt_r < r + 1; cnt_r++){\n\t\t\tfor (int cnt_c = 0; cnt_c < c + 1 ; cnt_c++) {\n\t\t\t\tSystem.out.print( numlist[cnt_r][cnt_c]);\n\t\t\t\tif(cnt_c != c)//?????????????????°?????§???????????°?????????????????\\??????\n\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t}\n\t\t\tSystem.out.print(\"\\n\");\n\t\t}\n\t\tscan.close();\n\t}\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n\n\n public static void main(String[] args){\n\t\tScanner scan = new Scanner(System.in);\n\t\tint r = scan.nextInt();//r?????¨?????????\n\t\tint c = scan.nextInt();//c?????¨????¨????\n\t\t\n\t\tint numlist[][] = new int[r + 1][c + 1];//????¨???¨?????????????????????\n\n\t\t//???????????????????????????????????????????´???¨????¨???¨?????????????¨?????????????\n\t\tfor (int cnt_r = 0; cnt_r < r; cnt_r++){\n\t\t\tfor (int cnt_c = 0; cnt_c < c ; cnt_c++) {\n\t\t\t\tnumlist[cnt_r][cnt_c] = scan.nextInt();//????????????????´?\n\t\t\t\tnumlist[cnt_r][c] += numlist[cnt_r][cnt_c];//????????¨???????¨?????¨????\n\t\t\t\tnumlist[r][cnt_c] += numlist[cnt_r][cnt_c];//????????¨???????¨?????¨????\n\t\t\t\tnumlist[r][c] += numlist[cnt_r][cnt_c];//??¨??????????¨?????¨????\n\t\t\t}\n\t\t}\n\t\tfor (int cnt_r = 0; cnt_r < r + 1; cnt_r++){\n\t\t\tfor (int cnt_c = 0; cnt_c < c + 1 ; cnt_c++) {\n\t\t\t\tSystem.out.print( numlist[cnt_r][cnt_c]);\n\t\t\t\tif(cnt_c != c)//?????????????????°?????§???????????°?????????????????\\??????\n\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t}\n\t\t\tSystem.out.print(\"\\n\");\n\t\t}\n\t\tscan.close();\n\t}\n}",
"Main",
"public static void main(String[] args){\n\t\tScanner scan = new Scanner(System.in);\n\t\tint r = scan.nextInt();//r?????¨?????????\n\t\tint c = scan.nextInt();//c?????¨????¨????\n\t\t\n\t\tint numlist[][] = new int[r + 1][c + 1];//????¨???¨?????????????????????\n\n\t\t//???????????????????????????????????????????´???¨????¨???¨?????????????¨?????????????\n\t\tfor (int cnt_r = 0; cnt_r < r; cnt_r++){\n\t\t\tfor (int cnt_c = 0; cnt_c < c ; cnt_c++) {\n\t\t\t\tnumlist[cnt_r][cnt_c] = scan.nextInt();//????????????????´?\n\t\t\t\tnumlist[cnt_r][c] += numlist[cnt_r][cnt_c];//????????¨???????¨?????¨????\n\t\t\t\tnumlist[r][cnt_c] += numlist[cnt_r][cnt_c];//????????¨???????¨?????¨????\n\t\t\t\tnumlist[r][c] += numlist[cnt_r][cnt_c];//??¨??????????¨?????¨????\n\t\t\t}\n\t\t}\n\t\tfor (int cnt_r = 0; cnt_r < r + 1; cnt_r++){\n\t\t\tfor (int cnt_c = 0; cnt_c < c + 1 ; cnt_c++) {\n\t\t\t\tSystem.out.print( numlist[cnt_r][cnt_c]);\n\t\t\t\tif(cnt_c != c)//?????????????????°?????§???????????°?????????????????\\??????\n\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t}\n\t\t\tSystem.out.print(\"\\n\");\n\t\t}\n\t\tscan.close();\n\t}",
"main",
"{\n\t\tScanner scan = new Scanner(System.in);\n\t\tint r = scan.nextInt();//r?????¨?????????\n\t\tint c = scan.nextInt();//c?????¨????¨????\n\t\t\n\t\tint numlist[][] = new int[r + 1][c + 1];//????¨???¨?????????????????????\n\n\t\t//???????????????????????????????????????????´???¨????¨???¨?????????????¨?????????????\n\t\tfor (int cnt_r = 0; cnt_r < r; cnt_r++){\n\t\t\tfor (int cnt_c = 0; cnt_c < c ; cnt_c++) {\n\t\t\t\tnumlist[cnt_r][cnt_c] = scan.nextInt();//????????????????´?\n\t\t\t\tnumlist[cnt_r][c] += numlist[cnt_r][cnt_c];//????????¨???????¨?????¨????\n\t\t\t\tnumlist[r][cnt_c] += numlist[cnt_r][cnt_c];//????????¨???????¨?????¨????\n\t\t\t\tnumlist[r][c] += numlist[cnt_r][cnt_c];//??¨??????????¨?????¨????\n\t\t\t}\n\t\t}\n\t\tfor (int cnt_r = 0; cnt_r < r + 1; cnt_r++){\n\t\t\tfor (int cnt_c = 0; cnt_c < c + 1 ; cnt_c++) {\n\t\t\t\tSystem.out.print( numlist[cnt_r][cnt_c]);\n\t\t\t\tif(cnt_c != c)//?????????????????°?????§???????????°?????????????????\\??????\n\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t}\n\t\t\tSystem.out.print(\"\\n\");\n\t\t}\n\t\tscan.close();\n\t}",
"Scanner scan = new Scanner(System.in);",
"scan",
"new Scanner(System.in)",
"int r = scan.nextInt();",
"r",
"scan.nextInt()",
"scan.nextInt",
"scan",
"int c = scan.nextInt();",
"c",
"scan.nextInt()",
"scan.nextInt",
"scan",
"int numlist[][] = new int[r + 1][c + 1];",
"numlist",
"new int[r + 1][c + 1]",
"r + 1",
"r",
"1",
"c + 1",
"c",
"1",
"for (int cnt_r = 0; cnt_r < r; cnt_r++){\n\t\t\tfor (int cnt_c = 0; cnt_c < c ; cnt_c++) {\n\t\t\t\tnumlist[cnt_r][cnt_c] = scan.nextInt();//????????????????´?\n\t\t\t\tnumlist[cnt_r][c] += numlist[cnt_r][cnt_c];//????????¨???????¨?????¨????\n\t\t\t\tnumlist[r][cnt_c] += numlist[cnt_r][cnt_c];//????????¨???????¨?????¨????\n\t\t\t\tnumlist[r][c] += numlist[cnt_r][cnt_c];//??¨??????????¨?????¨????\n\t\t\t}\n\t\t}",
"int cnt_r = 0;",
"int cnt_r = 0;",
"cnt_r",
"0",
"cnt_r < r",
"cnt_r",
"r",
"cnt_r++",
"cnt_r++",
"cnt_r",
"{\n\t\t\tfor (int cnt_c = 0; cnt_c < c ; cnt_c++) {\n\t\t\t\tnumlist[cnt_r][cnt_c] = scan.nextInt();//????????????????´?\n\t\t\t\tnumlist[cnt_r][c] += numlist[cnt_r][cnt_c];//????????¨???????¨?????¨????\n\t\t\t\tnumlist[r][cnt_c] += numlist[cnt_r][cnt_c];//????????¨???????¨?????¨????\n\t\t\t\tnumlist[r][c] += numlist[cnt_r][cnt_c];//??¨??????????¨?????¨????\n\t\t\t}\n\t\t}",
"{\n\t\t\tfor (int cnt_c = 0; cnt_c < c ; cnt_c++) {\n\t\t\t\tnumlist[cnt_r][cnt_c] = scan.nextInt();//????????????????´?\n\t\t\t\tnumlist[cnt_r][c] += numlist[cnt_r][cnt_c];//????????¨???????¨?????¨????\n\t\t\t\tnumlist[r][cnt_c] += numlist[cnt_r][cnt_c];//????????¨???????¨?????¨????\n\t\t\t\tnumlist[r][c] += numlist[cnt_r][cnt_c];//??¨??????????¨?????¨????\n\t\t\t}\n\t\t}",
"for (int cnt_c = 0; cnt_c < c ; cnt_c++) {\n\t\t\t\tnumlist[cnt_r][cnt_c] = scan.nextInt();//????????????????´?\n\t\t\t\tnumlist[cnt_r][c] += numlist[cnt_r][cnt_c];//????????¨???????¨?????¨????\n\t\t\t\tnumlist[r][cnt_c] += numlist[cnt_r][cnt_c];//????????¨???????¨?????¨????\n\t\t\t\tnumlist[r][c] += numlist[cnt_r][cnt_c];//??¨??????????¨?????¨????\n\t\t\t}",
"int cnt_c = 0;",
"int cnt_c = 0;",
"cnt_c",
"0",
"cnt_c < c",
"cnt_c",
"c",
"cnt_c++",
"cnt_c++",
"cnt_c",
"{\n\t\t\t\tnumlist[cnt_r][cnt_c] = scan.nextInt();//????????????????´?\n\t\t\t\tnumlist[cnt_r][c] += numlist[cnt_r][cnt_c];//????????¨???????¨?????¨????\n\t\t\t\tnumlist[r][cnt_c] += numlist[cnt_r][cnt_c];//????????¨???????¨?????¨????\n\t\t\t\tnumlist[r][c] += numlist[cnt_r][cnt_c];//??¨??????????¨?????¨????\n\t\t\t}",
"{\n\t\t\t\tnumlist[cnt_r][cnt_c] = scan.nextInt();//????????????????´?\n\t\t\t\tnumlist[cnt_r][c] += numlist[cnt_r][cnt_c];//????????¨???????¨?????¨????\n\t\t\t\tnumlist[r][cnt_c] += numlist[cnt_r][cnt_c];//????????¨???????¨?????¨????\n\t\t\t\tnumlist[r][c] += numlist[cnt_r][cnt_c];//??¨??????????¨?????¨????\n\t\t\t}",
"numlist[cnt_r][cnt_c] = scan.nextInt()",
"numlist[cnt_r][cnt_c]",
"numlist[cnt_r]",
"numlist",
"cnt_r",
"cnt_c",
"scan.nextInt()",
"scan.nextInt",
"scan",
"numlist[cnt_r][c] += numlist[cnt_r][cnt_c]",
"numlist[cnt_r][c]",
"numlist[cnt_r]",
"numlist",
"cnt_r",
"c",
"numlist[cnt_r][cnt_c]",
"numlist[cnt_r]",
"numlist",
"cnt_r",
"cnt_c",
"numlist[r][cnt_c] += numlist[cnt_r][cnt_c]",
"numlist[r][cnt_c]",
"numlist[r]",
"numlist",
"r",
"cnt_c",
"numlist[cnt_r][cnt_c]",
"numlist[cnt_r]",
"numlist",
"cnt_r",
"cnt_c",
"numlist[r][c] += numlist[cnt_r][cnt_c]",
"numlist[r][c]",
"numlist[r]",
"numlist",
"r",
"c",
"numlist[cnt_r][cnt_c]",
"numlist[cnt_r]",
"numlist",
"cnt_r",
"cnt_c",
"for (int cnt_r = 0; cnt_r < r + 1; cnt_r++){\n\t\t\tfor (int cnt_c = 0; cnt_c < c + 1 ; cnt_c++) {\n\t\t\t\tSystem.out.print( numlist[cnt_r][cnt_c]);\n\t\t\t\tif(cnt_c != c)//?????????????????°?????§???????????°?????????????????\\??????\n\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t}\n\t\t\tSystem.out.print(\"\\n\");\n\t\t}",
"int cnt_r = 0;",
"int cnt_r = 0;",
"cnt_r",
"0",
"cnt_r < r + 1",
"cnt_r",
"r + 1",
"r",
"1",
"cnt_r++",
"cnt_r++",
"cnt_r",
"{\n\t\t\tfor (int cnt_c = 0; cnt_c < c + 1 ; cnt_c++) {\n\t\t\t\tSystem.out.print( numlist[cnt_r][cnt_c]);\n\t\t\t\tif(cnt_c != c)//?????????????????°?????§???????????°?????????????????\\??????\n\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t}\n\t\t\tSystem.out.print(\"\\n\");\n\t\t}",
"{\n\t\t\tfor (int cnt_c = 0; cnt_c < c + 1 ; cnt_c++) {\n\t\t\t\tSystem.out.print( numlist[cnt_r][cnt_c]);\n\t\t\t\tif(cnt_c != c)//?????????????????°?????§???????????°?????????????????\\??????\n\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t}\n\t\t\tSystem.out.print(\"\\n\");\n\t\t}",
"for (int cnt_c = 0; cnt_c < c + 1 ; cnt_c++) {\n\t\t\t\tSystem.out.print( numlist[cnt_r][cnt_c]);\n\t\t\t\tif(cnt_c != c)//?????????????????°?????§???????????°?????????????????\\??????\n\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t}",
"int cnt_c = 0;",
"int cnt_c = 0;",
"cnt_c",
"0",
"cnt_c < c + 1",
"cnt_c",
"c + 1",
"c",
"1",
"cnt_c++",
"cnt_c++",
"cnt_c",
"{\n\t\t\t\tSystem.out.print( numlist[cnt_r][cnt_c]);\n\t\t\t\tif(cnt_c != c)//?????????????????°?????§???????????°?????????????????\\??????\n\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t}",
"{\n\t\t\t\tSystem.out.print( numlist[cnt_r][cnt_c]);\n\t\t\t\tif(cnt_c != c)//?????????????????°?????§???????????°?????????????????\\??????\n\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t}",
"System.out.print( numlist[cnt_r][cnt_c])",
"System.out.print",
"System.out",
"System",
"System.out",
"numlist[cnt_r][cnt_c]",
"numlist[cnt_r]",
"numlist",
"cnt_r",
"cnt_c",
"if(cnt_c != c)//?????????????????°?????§???????????°?????????????????\\??????\n\t\t\t\t\tSystem.out.print(\" \");",
"cnt_c != c",
"cnt_c",
"c",
"System.out.print(\" \")",
"System.out.print",
"System.out",
"System",
"System.out",
"\" \"",
"System.out.print(\"\\n\")",
"System.out.print",
"System.out",
"System",
"System.out",
"\"\\n\"",
"scan.close()",
"scan.close",
"scan",
"String[] args",
"args",
"public class Main {\n\n\n public static void main(String[] args){\n\t\tScanner scan = new Scanner(System.in);\n\t\tint r = scan.nextInt();//r?????¨?????????\n\t\tint c = scan.nextInt();//c?????¨????¨????\n\t\t\n\t\tint numlist[][] = new int[r + 1][c + 1];//????¨???¨?????????????????????\n\n\t\t//???????????????????????????????????????????´???¨????¨???¨?????????????¨?????????????\n\t\tfor (int cnt_r = 0; cnt_r < r; cnt_r++){\n\t\t\tfor (int cnt_c = 0; cnt_c < c ; cnt_c++) {\n\t\t\t\tnumlist[cnt_r][cnt_c] = scan.nextInt();//????????????????´?\n\t\t\t\tnumlist[cnt_r][c] += numlist[cnt_r][cnt_c];//????????¨???????¨?????¨????\n\t\t\t\tnumlist[r][cnt_c] += numlist[cnt_r][cnt_c];//????????¨???????¨?????¨????\n\t\t\t\tnumlist[r][c] += numlist[cnt_r][cnt_c];//??¨??????????¨?????¨????\n\t\t\t}\n\t\t}\n\t\tfor (int cnt_r = 0; cnt_r < r + 1; cnt_r++){\n\t\t\tfor (int cnt_c = 0; cnt_c < c + 1 ; cnt_c++) {\n\t\t\t\tSystem.out.print( numlist[cnt_r][cnt_c]);\n\t\t\t\tif(cnt_c != c)//?????????????????°?????§???????????°?????????????????\\??????\n\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t}\n\t\t\tSystem.out.print(\"\\n\");\n\t\t}\n\t\tscan.close();\n\t}\n}",
"public class Main {\n\n\n public static void main(String[] args){\n\t\tScanner scan = new Scanner(System.in);\n\t\tint r = scan.nextInt();//r?????¨?????????\n\t\tint c = scan.nextInt();//c?????¨????¨????\n\t\t\n\t\tint numlist[][] = new int[r + 1][c + 1];//????¨???¨?????????????????????\n\n\t\t//???????????????????????????????????????????´???¨????¨???¨?????????????¨?????????????\n\t\tfor (int cnt_r = 0; cnt_r < r; cnt_r++){\n\t\t\tfor (int cnt_c = 0; cnt_c < c ; cnt_c++) {\n\t\t\t\tnumlist[cnt_r][cnt_c] = scan.nextInt();//????????????????´?\n\t\t\t\tnumlist[cnt_r][c] += numlist[cnt_r][cnt_c];//????????¨???????¨?????¨????\n\t\t\t\tnumlist[r][cnt_c] += numlist[cnt_r][cnt_c];//????????¨???????¨?????¨????\n\t\t\t\tnumlist[r][c] += numlist[cnt_r][cnt_c];//??¨??????????¨?????¨????\n\t\t\t}\n\t\t}\n\t\tfor (int cnt_r = 0; cnt_r < r + 1; cnt_r++){\n\t\t\tfor (int cnt_c = 0; cnt_c < c + 1 ; cnt_c++) {\n\t\t\t\tSystem.out.print( numlist[cnt_r][cnt_c]);\n\t\t\t\tif(cnt_c != c)//?????????????????°?????§???????????°?????????????????\\??????\n\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t}\n\t\t\tSystem.out.print(\"\\n\");\n\t\t}\n\t\tscan.close();\n\t}\n}",
"Main"
] | import java.util.Scanner;
public class Main {
public static void main(String[] args){
Scanner scan = new Scanner(System.in);
int r = scan.nextInt();//r?????¨?????????
int c = scan.nextInt();//c?????¨????¨????
int numlist[][] = new int[r + 1][c + 1];//????¨???¨?????????????????????
//???????????????????????????????????????????´???¨????¨???¨?????????????¨?????????????
for (int cnt_r = 0; cnt_r < r; cnt_r++){
for (int cnt_c = 0; cnt_c < c ; cnt_c++) {
numlist[cnt_r][cnt_c] = scan.nextInt();//????????????????´?
numlist[cnt_r][c] += numlist[cnt_r][cnt_c];//????????¨???????¨?????¨????
numlist[r][cnt_c] += numlist[cnt_r][cnt_c];//????????¨???????¨?????¨????
numlist[r][c] += numlist[cnt_r][cnt_c];//??¨??????????¨?????¨????
}
}
for (int cnt_r = 0; cnt_r < r + 1; cnt_r++){
for (int cnt_c = 0; cnt_c < c + 1 ; cnt_c++) {
System.out.print( numlist[cnt_r][cnt_c]);
if(cnt_c != c)//?????????????????°?????§???????????°?????????????????\??????
System.out.print(" ");
}
System.out.print("\n");
}
scan.close();
}
} |
[
7,
15,
13,
17,
6,
13,
41,
13,
20,
41,
13,
41,
13,
41,
13,
41,
13,
41,
13,
12,
13,
30,
0,
13,
4,
18,
13,
0,
13,
4,
18,
13,
0,
13,
20,
2,
13,
17,
2,
13,
17,
11,
1,
0,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
11,
1,
0,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
18,
18,
13,
13,
13,
4,
18,
13,
0,
18,
18,
13,
13,
13,
2,
18,
18,
13,
13,
13,
18,
18,
13,
13,
13,
11,
1,
0,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
11,
1,
0,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
18,
18,
13,
13,
13,
2,
18,
18,
13,
13,
13,
18,
18,
13,
13,
13,
11,
1,
0,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
11,
1,
0,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
14,
2,
13,
13,
30,
4,
18,
18,
13,
13,
18,
18,
13,
13,
13,
30,
4,
18,
18,
13,
13,
2,
18,
18,
13,
13,
13,
17,
12,
13,
30,
20,
23,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
6,
7
],
[
6,
8
],
[
4,
9
],
[
9,
10
],
[
4,
11
],
[
11,
12
],
[
4,
13
],
[
13,
14
],
[
4,
15
],
[
15,
16
],
[
4,
17
],
[
17,
18
],
[
4,
19
],
[
19,
20
],
[
19,
21
],
[
21,
22
],
[
22,
23
],
[
22,
24
],
[
24,
25
],
[
25,
26
],
[
21,
27
],
[
27,
28
],
[
27,
29
],
[
29,
30
],
[
30,
31
],
[
21,
32
],
[
32,
33
],
[
32,
34
],
[
35,
36
],
[
35,
37
],
[
38,
39
],
[
38,
40
],
[
21,
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
],
[
68,
72
],
[
67,
73
],
[
73,
74
],
[
74,
75
],
[
66,
76
],
[
76,
77
],
[
77,
78
],
[
78,
79
],
[
78,
80
],
[
77,
81
],
[
76,
82
],
[
82,
83
],
[
83,
84
],
[
84,
85
],
[
84,
86
],
[
83,
87
],
[
82,
88
],
[
88,
89
],
[
89,
90
],
[
89,
91
],
[
88,
92
],
[
21,
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
],
[
120,
121
],
[
121,
122
],
[
121,
123
],
[
120,
124
],
[
119,
125
],
[
125,
126
],
[
126,
127
],
[
127,
128
],
[
127,
129
],
[
126,
130
],
[
125,
131
],
[
131,
132
],
[
132,
133
],
[
132,
134
],
[
131,
135
],
[
21,
136
],
[
136,
137
],
[
137,
138
],
[
138,
139
],
[
138,
140
],
[
136,
141
],
[
141,
142
],
[
141,
143
],
[
136,
144
],
[
144,
145
],
[
145,
146
],
[
136,
147
],
[
148,
148
],
[
148,
149
],
[
149,
150
],
[
150,
151
],
[
151,
152
],
[
151,
153
],
[
149,
154
],
[
154,
155
],
[
154,
156
],
[
149,
157
],
[
157,
158
],
[
158,
159
],
[
149,
160
],
[
161,
161
],
[
161,
162
],
[
162,
163
],
[
163,
164
],
[
163,
165
],
[
162,
166
],
[
166,
167
],
[
167,
168
],
[
168,
169
],
[
169,
170
],
[
169,
171
],
[
167,
172
],
[
172,
173
],
[
173,
174
],
[
173,
175
],
[
172,
176
],
[
162,
177
],
[
177,
178
],
[
178,
179
],
[
179,
180
],
[
180,
181
],
[
180,
182
],
[
178,
183
],
[
183,
184
],
[
184,
185
],
[
185,
186
],
[
185,
187
],
[
184,
188
],
[
183,
189
],
[
4,
190
],
[
190,
191
],
[
190,
192
],
[
192,
193
],
[
190,
194
],
[
194,
195
]
] | [
"import java.util.*;\n\nclass Main{\n\tScanner scan=new Scanner(System.in);\n\tint [][] a;\n\tint r;\n\tint c;\n\tint i;\n\tint j;\n\tpublic Main(){\n\t\tr=scan.nextInt();\n\t\tc=scan.nextInt();\n\t\ta=new int[r+1][c+1];\n\t\tfor(i=0;i<r;i++){\n\t\t\tfor(j=0;j<c;j++){\n\t\t\t\ta[i][j]=scan.nextInt();\n\t\t\t\ta[i][c]=a[i][c]+a[i][j];\n\t\t\t}\n\t\t}\n\t\tfor(j=0;j<=c;j++){\n\t\t\tfor(i=0;i<r;i++){\n\t\t\t\ta[r][j]=a[r][j]+a[i][j];\n\t\t\t}\n\t//\t\tSystem.out.print(a[r][j]+\" \");\n\t\t}\n\t\tfor(i=0;i<=r;i++){\n\t\t\tfor(j=0;j<=c;j++){\n\t\t\t\tif(j==c){\n\t\t\t\t\tSystem.out.println(a[i][c]);\n\t\t\t\t}else{\n\t\t\t\t\tSystem.out.print(a[i][j]+\" \");\n\t\t\t\t}\n\t\t\t\t\t\n\t\t\t}\n\t\t}\n\t}\n\tpublic static void main(String[] args){\n\t\tnew Main();\n\t}\n}",
"import java.util.*;",
"util.*",
"java",
"class Main{\n\tScanner scan=new Scanner(System.in);\n\tint [][] a;\n\tint r;\n\tint c;\n\tint i;\n\tint j;\n\tpublic Main(){\n\t\tr=scan.nextInt();\n\t\tc=scan.nextInt();\n\t\ta=new int[r+1][c+1];\n\t\tfor(i=0;i<r;i++){\n\t\t\tfor(j=0;j<c;j++){\n\t\t\t\ta[i][j]=scan.nextInt();\n\t\t\t\ta[i][c]=a[i][c]+a[i][j];\n\t\t\t}\n\t\t}\n\t\tfor(j=0;j<=c;j++){\n\t\t\tfor(i=0;i<r;i++){\n\t\t\t\ta[r][j]=a[r][j]+a[i][j];\n\t\t\t}\n\t//\t\tSystem.out.print(a[r][j]+\" \");\n\t\t}\n\t\tfor(i=0;i<=r;i++){\n\t\t\tfor(j=0;j<=c;j++){\n\t\t\t\tif(j==c){\n\t\t\t\t\tSystem.out.println(a[i][c]);\n\t\t\t\t}else{\n\t\t\t\t\tSystem.out.print(a[i][j]+\" \");\n\t\t\t\t}\n\t\t\t\t\t\n\t\t\t}\n\t\t}\n\t}\n\tpublic static void main(String[] args){\n\t\tnew Main();\n\t}\n}",
"Main",
"Scanner scan=new Scanner(System.in);",
"scan",
"new Scanner(System.in)",
"int [][] a;",
"a",
"int r;",
"r",
"int c;",
"c",
"int i;",
"i",
"int j;",
"j",
"public Main(){\n\t\tr=scan.nextInt();\n\t\tc=scan.nextInt();\n\t\ta=new int[r+1][c+1];\n\t\tfor(i=0;i<r;i++){\n\t\t\tfor(j=0;j<c;j++){\n\t\t\t\ta[i][j]=scan.nextInt();\n\t\t\t\ta[i][c]=a[i][c]+a[i][j];\n\t\t\t}\n\t\t}\n\t\tfor(j=0;j<=c;j++){\n\t\t\tfor(i=0;i<r;i++){\n\t\t\t\ta[r][j]=a[r][j]+a[i][j];\n\t\t\t}\n\t//\t\tSystem.out.print(a[r][j]+\" \");\n\t\t}\n\t\tfor(i=0;i<=r;i++){\n\t\t\tfor(j=0;j<=c;j++){\n\t\t\t\tif(j==c){\n\t\t\t\t\tSystem.out.println(a[i][c]);\n\t\t\t\t}else{\n\t\t\t\t\tSystem.out.print(a[i][j]+\" \");\n\t\t\t\t}\n\t\t\t\t\t\n\t\t\t}\n\t\t}\n\t}",
"Main",
"{\n\t\tr=scan.nextInt();\n\t\tc=scan.nextInt();\n\t\ta=new int[r+1][c+1];\n\t\tfor(i=0;i<r;i++){\n\t\t\tfor(j=0;j<c;j++){\n\t\t\t\ta[i][j]=scan.nextInt();\n\t\t\t\ta[i][c]=a[i][c]+a[i][j];\n\t\t\t}\n\t\t}\n\t\tfor(j=0;j<=c;j++){\n\t\t\tfor(i=0;i<r;i++){\n\t\t\t\ta[r][j]=a[r][j]+a[i][j];\n\t\t\t}\n\t//\t\tSystem.out.print(a[r][j]+\" \");\n\t\t}\n\t\tfor(i=0;i<=r;i++){\n\t\t\tfor(j=0;j<=c;j++){\n\t\t\t\tif(j==c){\n\t\t\t\t\tSystem.out.println(a[i][c]);\n\t\t\t\t}else{\n\t\t\t\t\tSystem.out.print(a[i][j]+\" \");\n\t\t\t\t}\n\t\t\t\t\t\n\t\t\t}\n\t\t}\n\t}",
"r=scan.nextInt()",
"r",
"scan.nextInt()",
"scan.nextInt",
"scan",
"c=scan.nextInt()",
"c",
"scan.nextInt()",
"scan.nextInt",
"scan",
"a=new int[r+1][c+1]",
"a",
"new int[r+1][c+1]",
"r+1",
"r",
"1",
"c+1",
"c",
"1",
"for(i=0;i<r;i++){\n\t\t\tfor(j=0;j<c;j++){\n\t\t\t\ta[i][j]=scan.nextInt();\n\t\t\t\ta[i][c]=a[i][c]+a[i][j];\n\t\t\t}\n\t\t}",
"i=0;",
"i=0",
"i",
"0",
"i<r",
"i",
"r",
"i++",
"i++",
"i",
"{\n\t\t\tfor(j=0;j<c;j++){\n\t\t\t\ta[i][j]=scan.nextInt();\n\t\t\t\ta[i][c]=a[i][c]+a[i][j];\n\t\t\t}\n\t\t}",
"{\n\t\t\tfor(j=0;j<c;j++){\n\t\t\t\ta[i][j]=scan.nextInt();\n\t\t\t\ta[i][c]=a[i][c]+a[i][j];\n\t\t\t}\n\t\t}",
"for(j=0;j<c;j++){\n\t\t\t\ta[i][j]=scan.nextInt();\n\t\t\t\ta[i][c]=a[i][c]+a[i][j];\n\t\t\t}",
"j=0;",
"j=0",
"j",
"0",
"j<c",
"j",
"c",
"j++",
"j++",
"j",
"{\n\t\t\t\ta[i][j]=scan.nextInt();\n\t\t\t\ta[i][c]=a[i][c]+a[i][j];\n\t\t\t}",
"{\n\t\t\t\ta[i][j]=scan.nextInt();\n\t\t\t\ta[i][c]=a[i][c]+a[i][j];\n\t\t\t}",
"a[i][j]=scan.nextInt()",
"a[i][j]",
"a[i]",
"a",
"i",
"j",
"scan.nextInt()",
"scan.nextInt",
"scan",
"a[i][c]=a[i][c]+a[i][j]",
"a[i][c]",
"a[i]",
"a",
"i",
"c",
"a[i][c]+a[i][j]",
"a[i][c]",
"a[i]",
"a",
"i",
"c",
"a[i][j]",
"a[i]",
"a",
"i",
"j",
"for(j=0;j<=c;j++){\n\t\t\tfor(i=0;i<r;i++){\n\t\t\t\ta[r][j]=a[r][j]+a[i][j];\n\t\t\t}\n\t//\t\tSystem.out.print(a[r][j]+\" \");\n\t\t}",
"j=0;",
"j=0",
"j",
"0",
"j<=c",
"j",
"c",
"j++",
"j++",
"j",
"{\n\t\t\tfor(i=0;i<r;i++){\n\t\t\t\ta[r][j]=a[r][j]+a[i][j];\n\t\t\t}\n\t//\t\tSystem.out.print(a[r][j]+\" \");\n\t\t}",
"{\n\t\t\tfor(i=0;i<r;i++){\n\t\t\t\ta[r][j]=a[r][j]+a[i][j];\n\t\t\t}\n\t//\t\tSystem.out.print(a[r][j]+\" \");\n\t\t}",
"for(i=0;i<r;i++){\n\t\t\t\ta[r][j]=a[r][j]+a[i][j];\n\t\t\t}",
"i=0;",
"i=0",
"i",
"0",
"i<r",
"i",
"r",
"i++",
"i++",
"i",
"{\n\t\t\t\ta[r][j]=a[r][j]+a[i][j];\n\t\t\t}",
"{\n\t\t\t\ta[r][j]=a[r][j]+a[i][j];\n\t\t\t}",
"a[r][j]=a[r][j]+a[i][j]",
"a[r][j]",
"a[r]",
"a",
"r",
"j",
"a[r][j]+a[i][j]",
"a[r][j]",
"a[r]",
"a",
"r",
"j",
"a[i][j]",
"a[i]",
"a",
"i",
"j",
"for(i=0;i<=r;i++){\n\t\t\tfor(j=0;j<=c;j++){\n\t\t\t\tif(j==c){\n\t\t\t\t\tSystem.out.println(a[i][c]);\n\t\t\t\t}else{\n\t\t\t\t\tSystem.out.print(a[i][j]+\" \");\n\t\t\t\t}\n\t\t\t\t\t\n\t\t\t}\n\t\t}",
"i=0;",
"i=0",
"i",
"0",
"i<=r",
"i",
"r",
"i++",
"i++",
"i",
"{\n\t\t\tfor(j=0;j<=c;j++){\n\t\t\t\tif(j==c){\n\t\t\t\t\tSystem.out.println(a[i][c]);\n\t\t\t\t}else{\n\t\t\t\t\tSystem.out.print(a[i][j]+\" \");\n\t\t\t\t}\n\t\t\t\t\t\n\t\t\t}\n\t\t}",
"{\n\t\t\tfor(j=0;j<=c;j++){\n\t\t\t\tif(j==c){\n\t\t\t\t\tSystem.out.println(a[i][c]);\n\t\t\t\t}else{\n\t\t\t\t\tSystem.out.print(a[i][j]+\" \");\n\t\t\t\t}\n\t\t\t\t\t\n\t\t\t}\n\t\t}",
"for(j=0;j<=c;j++){\n\t\t\t\tif(j==c){\n\t\t\t\t\tSystem.out.println(a[i][c]);\n\t\t\t\t}else{\n\t\t\t\t\tSystem.out.print(a[i][j]+\" \");\n\t\t\t\t}\n\t\t\t\t\t\n\t\t\t}",
"j=0;",
"j=0",
"j",
"0",
"j<=c",
"j",
"c",
"j++",
"j++",
"j",
"{\n\t\t\t\tif(j==c){\n\t\t\t\t\tSystem.out.println(a[i][c]);\n\t\t\t\t}else{\n\t\t\t\t\tSystem.out.print(a[i][j]+\" \");\n\t\t\t\t}\n\t\t\t\t\t\n\t\t\t}",
"{\n\t\t\t\tif(j==c){\n\t\t\t\t\tSystem.out.println(a[i][c]);\n\t\t\t\t}else{\n\t\t\t\t\tSystem.out.print(a[i][j]+\" \");\n\t\t\t\t}\n\t\t\t\t\t\n\t\t\t}",
"if(j==c){\n\t\t\t\t\tSystem.out.println(a[i][c]);\n\t\t\t\t}else{\n\t\t\t\t\tSystem.out.print(a[i][j]+\" \");\n\t\t\t\t}",
"j==c",
"j",
"c",
"{\n\t\t\t\t\tSystem.out.println(a[i][c]);\n\t\t\t\t}",
"System.out.println(a[i][c])",
"System.out.println",
"System.out",
"System",
"System.out",
"a[i][c]",
"a[i]",
"a",
"i",
"c",
"{\n\t\t\t\t\tSystem.out.print(a[i][j]+\" \");\n\t\t\t\t}",
"System.out.print(a[i][j]+\" \")",
"System.out.print",
"System.out",
"System",
"System.out",
"a[i][j]+\" \"",
"a[i][j]",
"a[i]",
"a",
"i",
"j",
"\" \"",
"public static void main(String[] args){\n\t\tnew Main();\n\t}",
"main",
"{\n\t\tnew Main();\n\t}",
"new Main()",
"String[] args",
"args"
] | import java.util.*;
class Main{
Scanner scan=new Scanner(System.in);
int [][] a;
int r;
int c;
int i;
int j;
public Main(){
r=scan.nextInt();
c=scan.nextInt();
a=new int[r+1][c+1];
for(i=0;i<r;i++){
for(j=0;j<c;j++){
a[i][j]=scan.nextInt();
a[i][c]=a[i][c]+a[i][j];
}
}
for(j=0;j<=c;j++){
for(i=0;i<r;i++){
a[r][j]=a[r][j]+a[i][j];
}
// System.out.print(a[r][j]+" ");
}
for(i=0;i<=r;i++){
for(j=0;j<=c;j++){
if(j==c){
System.out.println(a[i][c]);
}else{
System.out.print(a[i][j]+" ");
}
}
}
}
public static void main(String[] args){
new Main();
}
} |
[
7,
15,
13,
17,
6,
13,
41,
13,
20,
41,
13,
41,
13,
41,
13,
41,
13,
41,
13,
12,
13,
30,
4,
18,
20,
23,
13,
12,
13,
30,
42,
4,
18,
13,
30,
0,
13,
4,
18,
13,
0,
13,
4,
18,
13,
14,
2,
2,
13,
17,
2,
13,
17,
30,
0,
13,
20,
2,
13,
17,
2,
13,
17,
4,
13,
12,
13,
30,
11,
1,
0,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
11,
1,
0,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
18,
18,
13,
13,
13,
4,
18,
13,
0,
18,
18,
13,
13,
13,
18,
18,
13,
13,
13,
0,
18,
18,
13,
13,
13,
18,
18,
13,
13,
13,
0,
18,
18,
13,
13,
13,
18,
18,
13,
13,
13,
4,
13,
12,
13,
30,
11,
1,
0,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
11,
1,
0,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
4,
18,
18,
13,
13,
18,
18,
13,
13,
13,
14,
2,
2,
13,
17,
13,
4,
18,
18,
13,
13,
17,
4,
18,
18,
13,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
195,
5
],
[
195,
6
],
[
6,
7
],
[
6,
8
],
[
195,
9
],
[
9,
10
],
[
195,
11
],
[
11,
12
],
[
195,
13
],
[
13,
14
],
[
195,
15
],
[
15,
16
],
[
195,
17
],
[
17,
18
],
[
195,
19
],
[
19,
20
],
[
19,
21
],
[
21,
22
],
[
22,
23
],
[
23,
24
],
[
19,
25
],
[
25,
26
],
[
195,
27
],
[
27,
28
],
[
27,
29
],
[
29,
30
],
[
30,
31
],
[
31,
32
],
[
32,
33
],
[
30,
34
],
[
34,
35
],
[
35,
36
],
[
35,
37
],
[
37,
38
],
[
38,
39
],
[
34,
40
],
[
40,
41
],
[
40,
42
],
[
42,
43
],
[
43,
44
],
[
34,
45
],
[
45,
46
],
[
46,
47
],
[
47,
48
],
[
47,
49
],
[
46,
50
],
[
50,
51
],
[
50,
52
],
[
45,
53
],
[
53,
54
],
[
54,
55
],
[
54,
56
],
[
57,
58
],
[
57,
59
],
[
60,
61
],
[
60,
62
],
[
53,
63
],
[
63,
64
],
[
195,
65
],
[
65,
66
],
[
65,
67
],
[
67,
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
],
[
95,
99
],
[
94,
100
],
[
100,
101
],
[
101,
102
],
[
93,
103
],
[
103,
104
],
[
104,
105
],
[
105,
106
],
[
105,
107
],
[
104,
108
],
[
103,
109
],
[
109,
110
],
[
110,
111
],
[
110,
112
],
[
109,
113
],
[
93,
114
],
[
114,
115
],
[
115,
116
],
[
116,
117
],
[
116,
118
],
[
115,
119
],
[
114,
120
],
[
120,
121
],
[
121,
122
],
[
121,
123
],
[
120,
124
],
[
93,
125
],
[
125,
126
],
[
126,
127
],
[
127,
128
],
[
127,
129
],
[
126,
130
],
[
125,
131
],
[
131,
132
],
[
132,
133
],
[
132,
134
],
[
131,
135
],
[
67,
136
],
[
136,
137
],
[
195,
138
],
[
138,
139
],
[
138,
140
],
[
140,
141
],
[
141,
142
],
[
142,
143
],
[
143,
144
],
[
143,
145
],
[
141,
146
],
[
146,
147
],
[
146,
148
],
[
141,
149
],
[
149,
150
],
[
150,
151
],
[
141,
152
],
[
153,
153
],
[
153,
154
],
[
154,
155
],
[
155,
156
],
[
156,
157
],
[
156,
158
],
[
154,
159
],
[
159,
160
],
[
159,
161
],
[
154,
162
],
[
162,
163
],
[
163,
164
],
[
154,
165
],
[
166,
166
],
[
166,
167
],
[
167,
168
],
[
168,
169
],
[
169,
170
],
[
169,
171
],
[
167,
172
],
[
172,
173
],
[
173,
174
],
[
173,
175
],
[
172,
176
],
[
166,
177
],
[
177,
178
],
[
178,
179
],
[
179,
180
],
[
179,
181
],
[
178,
182
],
[
177,
183
],
[
183,
184
],
[
184,
185
],
[
185,
186
],
[
185,
187
],
[
183,
188
],
[
153,
189
],
[
189,
190
],
[
190,
191
],
[
191,
192
],
[
191,
193
],
[
0,
194
],
[
194,
195
],
[
194,
196
]
] | [
"import java.util.*;\npublic class Main{\n public static void main(String[]args){\n\tnew Main().run();\n }\n Scanner sc = new Scanner(System.in);\n\n int[][] cell;\n int h, w;\n int i, j;\n \n void run(){\n\twhile(sc.hasNext()){\n\t h = sc.nextInt();\n\t w = sc.nextInt();\n\t if(h!=0 && w!=0){\n\t\tcell = new int[h+1][w+1];\n\t\tsolve();\n\t }\n\t}\n }\n\n void solve(){\n\tfor(i=0; i<h; i++){\n\t for(j=0; j<w; j++){\n\t\tcell[i][j] = sc.nextInt();\n\t\tcell[h][j] += cell[i][j];\n\t\tcell[i][w] += cell[i][j];\n\t\tcell[h][w] += cell[i][j];\n\t }\n\t}\n\tprint();\n }\n\n void print(){\n\tfor(i=0; i<=h; i++){\n\t for(j=0; j<=w; j++){\n\t\tSystem.out.print(cell[i][j]);\n\t\tif(j+1<=w)\n\t\t System.out.print(\" \");\n\t }\n\t System.out.println();\n\t}\n }\n}",
"import java.util.*;",
"util.*",
"java",
"public class Main{\n public static void main(String[]args){\n\tnew Main().run();\n }\n Scanner sc = new Scanner(System.in);\n\n int[][] cell;\n int h, w;\n int i, j;\n \n void run(){\n\twhile(sc.hasNext()){\n\t h = sc.nextInt();\n\t w = sc.nextInt();\n\t if(h!=0 && w!=0){\n\t\tcell = new int[h+1][w+1];\n\t\tsolve();\n\t }\n\t}\n }\n\n void solve(){\n\tfor(i=0; i<h; i++){\n\t for(j=0; j<w; j++){\n\t\tcell[i][j] = sc.nextInt();\n\t\tcell[h][j] += cell[i][j];\n\t\tcell[i][w] += cell[i][j];\n\t\tcell[h][w] += cell[i][j];\n\t }\n\t}\n\tprint();\n }\n\n void print(){\n\tfor(i=0; i<=h; i++){\n\t for(j=0; j<=w; j++){\n\t\tSystem.out.print(cell[i][j]);\n\t\tif(j+1<=w)\n\t\t System.out.print(\" \");\n\t }\n\t System.out.println();\n\t}\n }\n}",
"Main",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"int[][] cell;",
"cell",
"int h",
"h",
"w;",
"w",
"int i",
"i",
"j;",
"j",
"public static void main(String[]args){\n\tnew Main().run();\n }",
"main",
"{\n\tnew Main().run();\n }",
"new Main().run()",
"new Main().run",
"new Main()",
"String[]args",
"args",
"void run(){\n\twhile(sc.hasNext()){\n\t h = sc.nextInt();\n\t w = sc.nextInt();\n\t if(h!=0 && w!=0){\n\t\tcell = new int[h+1][w+1];\n\t\tsolve();\n\t }\n\t}\n }",
"run",
"{\n\twhile(sc.hasNext()){\n\t h = sc.nextInt();\n\t w = sc.nextInt();\n\t if(h!=0 && w!=0){\n\t\tcell = new int[h+1][w+1];\n\t\tsolve();\n\t }\n\t}\n }",
"while(sc.hasNext()){\n\t h = sc.nextInt();\n\t w = sc.nextInt();\n\t if(h!=0 && w!=0){\n\t\tcell = new int[h+1][w+1];\n\t\tsolve();\n\t }\n\t}",
"sc.hasNext()",
"sc.hasNext",
"sc",
"{\n\t h = sc.nextInt();\n\t w = sc.nextInt();\n\t if(h!=0 && w!=0){\n\t\tcell = new int[h+1][w+1];\n\t\tsolve();\n\t }\n\t}",
"h = sc.nextInt()",
"h",
"sc.nextInt()",
"sc.nextInt",
"sc",
"w = sc.nextInt()",
"w",
"sc.nextInt()",
"sc.nextInt",
"sc",
"if(h!=0 && w!=0){\n\t\tcell = new int[h+1][w+1];\n\t\tsolve();\n\t }",
"h!=0 && w!=0",
"h!=0",
"h",
"0",
"w!=0",
"w",
"0",
"{\n\t\tcell = new int[h+1][w+1];\n\t\tsolve();\n\t }",
"cell = new int[h+1][w+1]",
"cell",
"new int[h+1][w+1]",
"h+1",
"h",
"1",
"w+1",
"w",
"1",
"solve()",
"solve",
"void solve(){\n\tfor(i=0; i<h; i++){\n\t for(j=0; j<w; j++){\n\t\tcell[i][j] = sc.nextInt();\n\t\tcell[h][j] += cell[i][j];\n\t\tcell[i][w] += cell[i][j];\n\t\tcell[h][w] += cell[i][j];\n\t }\n\t}\n\tprint();\n }",
"solve",
"{\n\tfor(i=0; i<h; i++){\n\t for(j=0; j<w; j++){\n\t\tcell[i][j] = sc.nextInt();\n\t\tcell[h][j] += cell[i][j];\n\t\tcell[i][w] += cell[i][j];\n\t\tcell[h][w] += cell[i][j];\n\t }\n\t}\n\tprint();\n }",
"for(i=0; i<h; i++){\n\t for(j=0; j<w; j++){\n\t\tcell[i][j] = sc.nextInt();\n\t\tcell[h][j] += cell[i][j];\n\t\tcell[i][w] += cell[i][j];\n\t\tcell[h][w] += cell[i][j];\n\t }\n\t}",
"i=0;",
"i=0",
"i",
"0",
"i<h",
"i",
"h",
"i++",
"i++",
"i",
"{\n\t for(j=0; j<w; j++){\n\t\tcell[i][j] = sc.nextInt();\n\t\tcell[h][j] += cell[i][j];\n\t\tcell[i][w] += cell[i][j];\n\t\tcell[h][w] += cell[i][j];\n\t }\n\t}",
"{\n\t for(j=0; j<w; j++){\n\t\tcell[i][j] = sc.nextInt();\n\t\tcell[h][j] += cell[i][j];\n\t\tcell[i][w] += cell[i][j];\n\t\tcell[h][w] += cell[i][j];\n\t }\n\t}",
"for(j=0; j<w; j++){\n\t\tcell[i][j] = sc.nextInt();\n\t\tcell[h][j] += cell[i][j];\n\t\tcell[i][w] += cell[i][j];\n\t\tcell[h][w] += cell[i][j];\n\t }",
"j=0;",
"j=0",
"j",
"0",
"j<w",
"j",
"w",
"j++",
"j++",
"j",
"{\n\t\tcell[i][j] = sc.nextInt();\n\t\tcell[h][j] += cell[i][j];\n\t\tcell[i][w] += cell[i][j];\n\t\tcell[h][w] += cell[i][j];\n\t }",
"{\n\t\tcell[i][j] = sc.nextInt();\n\t\tcell[h][j] += cell[i][j];\n\t\tcell[i][w] += cell[i][j];\n\t\tcell[h][w] += cell[i][j];\n\t }",
"cell[i][j] = sc.nextInt()",
"cell[i][j]",
"cell[i]",
"cell",
"i",
"j",
"sc.nextInt()",
"sc.nextInt",
"sc",
"cell[h][j] += cell[i][j]",
"cell[h][j]",
"cell[h]",
"cell",
"h",
"j",
"cell[i][j]",
"cell[i]",
"cell",
"i",
"j",
"cell[i][w] += cell[i][j]",
"cell[i][w]",
"cell[i]",
"cell",
"i",
"w",
"cell[i][j]",
"cell[i]",
"cell",
"i",
"j",
"cell[h][w] += cell[i][j]",
"cell[h][w]",
"cell[h]",
"cell",
"h",
"w",
"cell[i][j]",
"cell[i]",
"cell",
"i",
"j",
"print()",
"print",
"void print(){\n\tfor(i=0; i<=h; i++){\n\t for(j=0; j<=w; j++){\n\t\tSystem.out.print(cell[i][j]);\n\t\tif(j+1<=w)\n\t\t System.out.print(\" \");\n\t }\n\t System.out.println();\n\t}\n }",
"print",
"{\n\tfor(i=0; i<=h; i++){\n\t for(j=0; j<=w; j++){\n\t\tSystem.out.print(cell[i][j]);\n\t\tif(j+1<=w)\n\t\t System.out.print(\" \");\n\t }\n\t System.out.println();\n\t}\n }",
"for(i=0; i<=h; i++){\n\t for(j=0; j<=w; j++){\n\t\tSystem.out.print(cell[i][j]);\n\t\tif(j+1<=w)\n\t\t System.out.print(\" \");\n\t }\n\t System.out.println();\n\t}",
"i=0;",
"i=0",
"i",
"0",
"i<=h",
"i",
"h",
"i++",
"i++",
"i",
"{\n\t for(j=0; j<=w; j++){\n\t\tSystem.out.print(cell[i][j]);\n\t\tif(j+1<=w)\n\t\t System.out.print(\" \");\n\t }\n\t System.out.println();\n\t}",
"{\n\t for(j=0; j<=w; j++){\n\t\tSystem.out.print(cell[i][j]);\n\t\tif(j+1<=w)\n\t\t System.out.print(\" \");\n\t }\n\t System.out.println();\n\t}",
"for(j=0; j<=w; j++){\n\t\tSystem.out.print(cell[i][j]);\n\t\tif(j+1<=w)\n\t\t System.out.print(\" \");\n\t }",
"j=0;",
"j=0",
"j",
"0",
"j<=w",
"j",
"w",
"j++",
"j++",
"j",
"{\n\t\tSystem.out.print(cell[i][j]);\n\t\tif(j+1<=w)\n\t\t System.out.print(\" \");\n\t }",
"{\n\t\tSystem.out.print(cell[i][j]);\n\t\tif(j+1<=w)\n\t\t System.out.print(\" \");\n\t }",
"System.out.print(cell[i][j])",
"System.out.print",
"System.out",
"System",
"System.out",
"cell[i][j]",
"cell[i]",
"cell",
"i",
"j",
"if(j+1<=w)\n\t\t System.out.print(\" \");",
"j+1<=w",
"j+1",
"j",
"1",
"w",
"System.out.print(\" \")",
"System.out.print",
"System.out",
"System",
"System.out",
"\" \"",
"System.out.println()",
"System.out.println",
"System.out",
"System",
"System.out",
"public class Main{\n public static void main(String[]args){\n\tnew Main().run();\n }\n Scanner sc = new Scanner(System.in);\n\n int[][] cell;\n int h, w;\n int i, j;\n \n void run(){\n\twhile(sc.hasNext()){\n\t h = sc.nextInt();\n\t w = sc.nextInt();\n\t if(h!=0 && w!=0){\n\t\tcell = new int[h+1][w+1];\n\t\tsolve();\n\t }\n\t}\n }\n\n void solve(){\n\tfor(i=0; i<h; i++){\n\t for(j=0; j<w; j++){\n\t\tcell[i][j] = sc.nextInt();\n\t\tcell[h][j] += cell[i][j];\n\t\tcell[i][w] += cell[i][j];\n\t\tcell[h][w] += cell[i][j];\n\t }\n\t}\n\tprint();\n }\n\n void print(){\n\tfor(i=0; i<=h; i++){\n\t for(j=0; j<=w; j++){\n\t\tSystem.out.print(cell[i][j]);\n\t\tif(j+1<=w)\n\t\t System.out.print(\" \");\n\t }\n\t System.out.println();\n\t}\n }\n}",
"public class Main{\n public static void main(String[]args){\n\tnew Main().run();\n }\n Scanner sc = new Scanner(System.in);\n\n int[][] cell;\n int h, w;\n int i, j;\n \n void run(){\n\twhile(sc.hasNext()){\n\t h = sc.nextInt();\n\t w = sc.nextInt();\n\t if(h!=0 && w!=0){\n\t\tcell = new int[h+1][w+1];\n\t\tsolve();\n\t }\n\t}\n }\n\n void solve(){\n\tfor(i=0; i<h; i++){\n\t for(j=0; j<w; j++){\n\t\tcell[i][j] = sc.nextInt();\n\t\tcell[h][j] += cell[i][j];\n\t\tcell[i][w] += cell[i][j];\n\t\tcell[h][w] += cell[i][j];\n\t }\n\t}\n\tprint();\n }\n\n void print(){\n\tfor(i=0; i<=h; i++){\n\t for(j=0; j<=w; j++){\n\t\tSystem.out.print(cell[i][j]);\n\t\tif(j+1<=w)\n\t\t System.out.print(\" \");\n\t }\n\t System.out.println();\n\t}\n }\n}",
"Main"
] | import java.util.*;
public class Main{
public static void main(String[]args){
new Main().run();
}
Scanner sc = new Scanner(System.in);
int[][] cell;
int h, w;
int i, j;
void run(){
while(sc.hasNext()){
h = sc.nextInt();
w = sc.nextInt();
if(h!=0 && w!=0){
cell = new int[h+1][w+1];
solve();
}
}
}
void solve(){
for(i=0; i<h; i++){
for(j=0; j<w; j++){
cell[i][j] = sc.nextInt();
cell[h][j] += cell[i][j];
cell[i][w] += cell[i][j];
cell[h][w] += cell[i][j];
}
}
print();
}
void print(){
for(i=0; i<=h; i++){
for(j=0; j<=w; j++){
System.out.print(cell[i][j]);
if(j+1<=w)
System.out.print(" ");
}
System.out.println();
}
}
} |
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
20,
17,
0,
13,
4,
18,
4,
18,
13,
17,
41,
13,
4,
18,
13,
18,
13,
17,
41,
13,
4,
18,
13,
18,
13,
17,
41,
13,
20,
2,
13,
17,
2,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
18,
18,
13,
13,
13,
4,
18,
13,
18,
13,
13,
0,
18,
18,
13,
13,
13,
4,
18,
13,
18,
13,
13,
0,
18,
18,
13,
13,
13,
4,
18,
13,
18,
13,
13,
0,
18,
18,
13,
13,
13,
4,
18,
13,
18,
13,
13,
11,
1,
41,
13,
17,
2,
13,
2,
13,
17,
1,
40,
13,
30,
30,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
4,
18,
18,
13,
13,
2,
18,
18,
13,
13,
13,
17,
4,
18,
18,
13,
13,
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
],
[
193,
11
],
[
193,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
15,
17
],
[
14,
18
],
[
18,
19
],
[
18,
20
],
[
14,
22
],
[
22,
23
],
[
22,
24
],
[
24,
25
],
[
25,
26
],
[
26,
27
],
[
27,
28
],
[
24,
29
],
[
14,
30
],
[
30,
31
],
[
30,
32
],
[
32,
33
],
[
33,
34
],
[
32,
35
],
[
35,
36
],
[
35,
37
],
[
14,
38
],
[
38,
39
],
[
38,
40
],
[
40,
41
],
[
41,
42
],
[
40,
43
],
[
43,
44
],
[
43,
45
],
[
14,
46
],
[
46,
47
],
[
46,
48
],
[
49,
50
],
[
49,
51
],
[
52,
53
],
[
52,
54
],
[
14,
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
],
[
67,
73
],
[
73,
74
],
[
73,
75
],
[
75,
76
],
[
76,
77
],
[
75,
78
],
[
67,
79
],
[
79,
80
],
[
80,
81
],
[
81,
82
],
[
81,
83
],
[
79,
84
],
[
84,
85
],
[
84,
86
],
[
79,
87
],
[
87,
88
],
[
88,
89
],
[
79,
90
],
[
91,
91
],
[
91,
92
],
[
92,
93
],
[
93,
94
],
[
94,
95
],
[
94,
96
],
[
93,
97
],
[
92,
98
],
[
98,
99
],
[
99,
100
],
[
98,
101
],
[
101,
102
],
[
101,
103
],
[
91,
104
],
[
104,
105
],
[
105,
106
],
[
106,
107
],
[
106,
108
],
[
105,
109
],
[
104,
110
],
[
110,
111
],
[
111,
112
],
[
110,
113
],
[
113,
114
],
[
113,
115
],
[
91,
116
],
[
116,
117
],
[
117,
118
],
[
118,
119
],
[
118,
120
],
[
117,
121
],
[
116,
122
],
[
122,
123
],
[
123,
124
],
[
122,
125
],
[
125,
126
],
[
125,
127
],
[
91,
128
],
[
128,
129
],
[
129,
130
],
[
130,
131
],
[
130,
132
],
[
129,
133
],
[
128,
134
],
[
134,
135
],
[
135,
136
],
[
134,
137
],
[
137,
138
],
[
137,
139
],
[
14,
140
],
[
140,
141
],
[
141,
142
],
[
142,
143
],
[
142,
144
],
[
140,
145
],
[
145,
146
],
[
145,
147
],
[
147,
148
],
[
147,
149
],
[
140,
150
],
[
150,
151
],
[
151,
152
],
[
140,
153
],
[
154,
154
],
[
154,
155
],
[
155,
156
],
[
156,
157
],
[
157,
158
],
[
157,
159
],
[
155,
160
],
[
160,
161
],
[
160,
162
],
[
155,
163
],
[
163,
164
],
[
164,
165
],
[
155,
166
],
[
167,
167
],
[
167,
168
],
[
168,
169
],
[
169,
170
],
[
170,
171
],
[
170,
172
],
[
168,
173
],
[
173,
174
],
[
174,
175
],
[
175,
176
],
[
175,
177
],
[
174,
178
],
[
173,
179
],
[
154,
180
],
[
180,
181
],
[
181,
182
],
[
182,
183
],
[
182,
184
],
[
180,
185
],
[
185,
186
],
[
186,
187
],
[
186,
188
],
[
185,
189
],
[
12,
190
],
[
190,
191
],
[
0,
192
],
[
192,
193
],
[
192,
194
]
] | [
"\n\nimport java.io.BufferedReader;\nimport java.io.IOException;\nimport java.io.InputStreamReader;\n\npublic class Main{\n\n\tpublic static void main(String[] args) throws IOException {\n\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\n\t\t// ????????????????????????\n\t\tString[] size = new String[2];\n\t\tsize = br.readLine().split(\" \");\n\n\t\tint gyoR = Integer.parseInt(size[0]);\n\t\tint retsuC = Integer.parseInt(size[1]);\n\n\t\tint[][] spreadSheet = new int[gyoR + 1][retsuC + 1];\n\n\n\t\t\t// ?¶????????????±??\\???\n\t\t\t\n\t\t\tfor (int i = 0; i < gyoR; i++) {\n\t\t\t\tString tempInfo = br.readLine();\n\t\t\t\tString[] info = tempInfo.split(\" \");\n\n\t\t\t\tfor (int j = 0; j < retsuC; j++) {\n\t\t\t\t\tspreadSheet[i][j] = Integer.parseInt(info[j]);\n\t\t\t\t\tspreadSheet[i][retsuC] += Integer.parseInt(info[j]);\n\t\t\t\t\tspreadSheet[gyoR][j] += Integer.parseInt(info[j]);\n\t\t\t\t\tspreadSheet[gyoR][retsuC] += Integer.parseInt(info[j]);\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor (int i = 0; i < gyoR + 1; i++) {\n\t\t\t\tfor (int j = 0; j < retsuC; j++) {\n\t\t\t\t\tSystem.out.print(spreadSheet[i][j] + \" \");\n\t\t\t\t}\n\t\t\t\tSystem.out.println(spreadSheet[i][retsuC]);\n\t\t\t}\n\t\t}\n\t}",
"import java.io.BufferedReader;",
"BufferedReader",
"java.io",
"import java.io.IOException;",
"IOException",
"java.io",
"import java.io.InputStreamReader;",
"InputStreamReader",
"java.io",
"public class Main{\n\n\tpublic static void main(String[] args) throws IOException {\n\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\n\t\t// ????????????????????????\n\t\tString[] size = new String[2];\n\t\tsize = br.readLine().split(\" \");\n\n\t\tint gyoR = Integer.parseInt(size[0]);\n\t\tint retsuC = Integer.parseInt(size[1]);\n\n\t\tint[][] spreadSheet = new int[gyoR + 1][retsuC + 1];\n\n\n\t\t\t// ?¶????????????±??\\???\n\t\t\t\n\t\t\tfor (int i = 0; i < gyoR; i++) {\n\t\t\t\tString tempInfo = br.readLine();\n\t\t\t\tString[] info = tempInfo.split(\" \");\n\n\t\t\t\tfor (int j = 0; j < retsuC; j++) {\n\t\t\t\t\tspreadSheet[i][j] = Integer.parseInt(info[j]);\n\t\t\t\t\tspreadSheet[i][retsuC] += Integer.parseInt(info[j]);\n\t\t\t\t\tspreadSheet[gyoR][j] += Integer.parseInt(info[j]);\n\t\t\t\t\tspreadSheet[gyoR][retsuC] += Integer.parseInt(info[j]);\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor (int i = 0; i < gyoR + 1; i++) {\n\t\t\t\tfor (int j = 0; j < retsuC; j++) {\n\t\t\t\t\tSystem.out.print(spreadSheet[i][j] + \" \");\n\t\t\t\t}\n\t\t\t\tSystem.out.println(spreadSheet[i][retsuC]);\n\t\t\t}\n\t\t}\n\t}",
"Main",
"public static void main(String[] args) throws IOException {\n\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\n\t\t// ????????????????????????\n\t\tString[] size = new String[2];\n\t\tsize = br.readLine().split(\" \");\n\n\t\tint gyoR = Integer.parseInt(size[0]);\n\t\tint retsuC = Integer.parseInt(size[1]);\n\n\t\tint[][] spreadSheet = new int[gyoR + 1][retsuC + 1];\n\n\n\t\t\t// ?¶????????????±??\\???\n\t\t\t\n\t\t\tfor (int i = 0; i < gyoR; i++) {\n\t\t\t\tString tempInfo = br.readLine();\n\t\t\t\tString[] info = tempInfo.split(\" \");\n\n\t\t\t\tfor (int j = 0; j < retsuC; j++) {\n\t\t\t\t\tspreadSheet[i][j] = Integer.parseInt(info[j]);\n\t\t\t\t\tspreadSheet[i][retsuC] += Integer.parseInt(info[j]);\n\t\t\t\t\tspreadSheet[gyoR][j] += Integer.parseInt(info[j]);\n\t\t\t\t\tspreadSheet[gyoR][retsuC] += Integer.parseInt(info[j]);\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor (int i = 0; i < gyoR + 1; i++) {\n\t\t\t\tfor (int j = 0; j < retsuC; j++) {\n\t\t\t\t\tSystem.out.print(spreadSheet[i][j] + \" \");\n\t\t\t\t}\n\t\t\t\tSystem.out.println(spreadSheet[i][retsuC]);\n\t\t\t}\n\t\t}",
"main",
"{\n\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\n\t\t// ????????????????????????\n\t\tString[] size = new String[2];\n\t\tsize = br.readLine().split(\" \");\n\n\t\tint gyoR = Integer.parseInt(size[0]);\n\t\tint retsuC = Integer.parseInt(size[1]);\n\n\t\tint[][] spreadSheet = new int[gyoR + 1][retsuC + 1];\n\n\n\t\t\t// ?¶????????????±??\\???\n\t\t\t\n\t\t\tfor (int i = 0; i < gyoR; i++) {\n\t\t\t\tString tempInfo = br.readLine();\n\t\t\t\tString[] info = tempInfo.split(\" \");\n\n\t\t\t\tfor (int j = 0; j < retsuC; j++) {\n\t\t\t\t\tspreadSheet[i][j] = Integer.parseInt(info[j]);\n\t\t\t\t\tspreadSheet[i][retsuC] += Integer.parseInt(info[j]);\n\t\t\t\t\tspreadSheet[gyoR][j] += Integer.parseInt(info[j]);\n\t\t\t\t\tspreadSheet[gyoR][retsuC] += Integer.parseInt(info[j]);\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor (int i = 0; i < gyoR + 1; i++) {\n\t\t\t\tfor (int j = 0; j < retsuC; j++) {\n\t\t\t\t\tSystem.out.print(spreadSheet[i][j] + \" \");\n\t\t\t\t}\n\t\t\t\tSystem.out.println(spreadSheet[i][retsuC]);\n\t\t\t}\n\t\t}",
"BufferedReader br = new BufferedReader(new InputStreamReader(System.in));",
"br",
"new BufferedReader(new InputStreamReader(System.in))",
"String[] size = new String[2];",
"size",
"new String[2]",
"2",
"size = br.readLine().split(\" \")",
"size",
"br.readLine().split(\" \")",
"br.readLine().split",
"br.readLine()",
"br.readLine",
"br",
"\" \"",
"int gyoR = Integer.parseInt(size[0]);",
"gyoR",
"Integer.parseInt(size[0])",
"Integer.parseInt",
"Integer",
"size[0]",
"size",
"0",
"int retsuC = Integer.parseInt(size[1]);",
"retsuC",
"Integer.parseInt(size[1])",
"Integer.parseInt",
"Integer",
"size[1]",
"size",
"1",
"int[][] spreadSheet = new int[gyoR + 1][retsuC + 1];",
"spreadSheet",
"new int[gyoR + 1][retsuC + 1]",
"gyoR + 1",
"gyoR",
"1",
"retsuC + 1",
"retsuC",
"1",
"for (int i = 0; i < gyoR; i++) {\n\t\t\t\tString tempInfo = br.readLine();\n\t\t\t\tString[] info = tempInfo.split(\" \");\n\n\t\t\t\tfor (int j = 0; j < retsuC; j++) {\n\t\t\t\t\tspreadSheet[i][j] = Integer.parseInt(info[j]);\n\t\t\t\t\tspreadSheet[i][retsuC] += Integer.parseInt(info[j]);\n\t\t\t\t\tspreadSheet[gyoR][j] += Integer.parseInt(info[j]);\n\t\t\t\t\tspreadSheet[gyoR][retsuC] += Integer.parseInt(info[j]);\n\t\t\t\t}\n\t\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < gyoR",
"i",
"gyoR",
"i++",
"i++",
"i",
"{\n\t\t\t\tString tempInfo = br.readLine();\n\t\t\t\tString[] info = tempInfo.split(\" \");\n\n\t\t\t\tfor (int j = 0; j < retsuC; j++) {\n\t\t\t\t\tspreadSheet[i][j] = Integer.parseInt(info[j]);\n\t\t\t\t\tspreadSheet[i][retsuC] += Integer.parseInt(info[j]);\n\t\t\t\t\tspreadSheet[gyoR][j] += Integer.parseInt(info[j]);\n\t\t\t\t\tspreadSheet[gyoR][retsuC] += Integer.parseInt(info[j]);\n\t\t\t\t}\n\t\t\t}",
"{\n\t\t\t\tString tempInfo = br.readLine();\n\t\t\t\tString[] info = tempInfo.split(\" \");\n\n\t\t\t\tfor (int j = 0; j < retsuC; j++) {\n\t\t\t\t\tspreadSheet[i][j] = Integer.parseInt(info[j]);\n\t\t\t\t\tspreadSheet[i][retsuC] += Integer.parseInt(info[j]);\n\t\t\t\t\tspreadSheet[gyoR][j] += Integer.parseInt(info[j]);\n\t\t\t\t\tspreadSheet[gyoR][retsuC] += Integer.parseInt(info[j]);\n\t\t\t\t}\n\t\t\t}",
"String tempInfo = br.readLine();",
"tempInfo",
"br.readLine()",
"br.readLine",
"br",
"String[] info = tempInfo.split(\" \");",
"info",
"tempInfo.split(\" \")",
"tempInfo.split",
"tempInfo",
"\" \"",
"for (int j = 0; j < retsuC; j++) {\n\t\t\t\t\tspreadSheet[i][j] = Integer.parseInt(info[j]);\n\t\t\t\t\tspreadSheet[i][retsuC] += Integer.parseInt(info[j]);\n\t\t\t\t\tspreadSheet[gyoR][j] += Integer.parseInt(info[j]);\n\t\t\t\t\tspreadSheet[gyoR][retsuC] += Integer.parseInt(info[j]);\n\t\t\t\t}",
"int j = 0;",
"int j = 0;",
"j",
"0",
"j < retsuC",
"j",
"retsuC",
"j++",
"j++",
"j",
"{\n\t\t\t\t\tspreadSheet[i][j] = Integer.parseInt(info[j]);\n\t\t\t\t\tspreadSheet[i][retsuC] += Integer.parseInt(info[j]);\n\t\t\t\t\tspreadSheet[gyoR][j] += Integer.parseInt(info[j]);\n\t\t\t\t\tspreadSheet[gyoR][retsuC] += Integer.parseInt(info[j]);\n\t\t\t\t}",
"{\n\t\t\t\t\tspreadSheet[i][j] = Integer.parseInt(info[j]);\n\t\t\t\t\tspreadSheet[i][retsuC] += Integer.parseInt(info[j]);\n\t\t\t\t\tspreadSheet[gyoR][j] += Integer.parseInt(info[j]);\n\t\t\t\t\tspreadSheet[gyoR][retsuC] += Integer.parseInt(info[j]);\n\t\t\t\t}",
"spreadSheet[i][j] = Integer.parseInt(info[j])",
"spreadSheet[i][j]",
"spreadSheet[i]",
"spreadSheet",
"i",
"j",
"Integer.parseInt(info[j])",
"Integer.parseInt",
"Integer",
"info[j]",
"info",
"j",
"spreadSheet[i][retsuC] += Integer.parseInt(info[j])",
"spreadSheet[i][retsuC]",
"spreadSheet[i]",
"spreadSheet",
"i",
"retsuC",
"Integer.parseInt(info[j])",
"Integer.parseInt",
"Integer",
"info[j]",
"info",
"j",
"spreadSheet[gyoR][j] += Integer.parseInt(info[j])",
"spreadSheet[gyoR][j]",
"spreadSheet[gyoR]",
"spreadSheet",
"gyoR",
"j",
"Integer.parseInt(info[j])",
"Integer.parseInt",
"Integer",
"info[j]",
"info",
"j",
"spreadSheet[gyoR][retsuC] += Integer.parseInt(info[j])",
"spreadSheet[gyoR][retsuC]",
"spreadSheet[gyoR]",
"spreadSheet",
"gyoR",
"retsuC",
"Integer.parseInt(info[j])",
"Integer.parseInt",
"Integer",
"info[j]",
"info",
"j",
"for (int i = 0; i < gyoR + 1; i++) {\n\t\t\t\tfor (int j = 0; j < retsuC; j++) {\n\t\t\t\t\tSystem.out.print(spreadSheet[i][j] + \" \");\n\t\t\t\t}\n\t\t\t\tSystem.out.println(spreadSheet[i][retsuC]);\n\t\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < gyoR + 1",
"i",
"gyoR + 1",
"gyoR",
"1",
"i++",
"i++",
"i",
"{\n\t\t\t\tfor (int j = 0; j < retsuC; j++) {\n\t\t\t\t\tSystem.out.print(spreadSheet[i][j] + \" \");\n\t\t\t\t}\n\t\t\t\tSystem.out.println(spreadSheet[i][retsuC]);\n\t\t\t}",
"{\n\t\t\t\tfor (int j = 0; j < retsuC; j++) {\n\t\t\t\t\tSystem.out.print(spreadSheet[i][j] + \" \");\n\t\t\t\t}\n\t\t\t\tSystem.out.println(spreadSheet[i][retsuC]);\n\t\t\t}",
"for (int j = 0; j < retsuC; j++) {\n\t\t\t\t\tSystem.out.print(spreadSheet[i][j] + \" \");\n\t\t\t\t}",
"int j = 0;",
"int j = 0;",
"j",
"0",
"j < retsuC",
"j",
"retsuC",
"j++",
"j++",
"j",
"{\n\t\t\t\t\tSystem.out.print(spreadSheet[i][j] + \" \");\n\t\t\t\t}",
"{\n\t\t\t\t\tSystem.out.print(spreadSheet[i][j] + \" \");\n\t\t\t\t}",
"System.out.print(spreadSheet[i][j] + \" \")",
"System.out.print",
"System.out",
"System",
"System.out",
"spreadSheet[i][j] + \" \"",
"spreadSheet[i][j]",
"spreadSheet[i]",
"spreadSheet",
"i",
"j",
"\" \"",
"System.out.println(spreadSheet[i][retsuC])",
"System.out.println",
"System.out",
"System",
"System.out",
"spreadSheet[i][retsuC]",
"spreadSheet[i]",
"spreadSheet",
"i",
"retsuC",
"String[] args",
"args",
"public class Main{\n\n\tpublic static void main(String[] args) throws IOException {\n\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\n\t\t// ????????????????????????\n\t\tString[] size = new String[2];\n\t\tsize = br.readLine().split(\" \");\n\n\t\tint gyoR = Integer.parseInt(size[0]);\n\t\tint retsuC = Integer.parseInt(size[1]);\n\n\t\tint[][] spreadSheet = new int[gyoR + 1][retsuC + 1];\n\n\n\t\t\t// ?¶????????????±??\\???\n\t\t\t\n\t\t\tfor (int i = 0; i < gyoR; i++) {\n\t\t\t\tString tempInfo = br.readLine();\n\t\t\t\tString[] info = tempInfo.split(\" \");\n\n\t\t\t\tfor (int j = 0; j < retsuC; j++) {\n\t\t\t\t\tspreadSheet[i][j] = Integer.parseInt(info[j]);\n\t\t\t\t\tspreadSheet[i][retsuC] += Integer.parseInt(info[j]);\n\t\t\t\t\tspreadSheet[gyoR][j] += Integer.parseInt(info[j]);\n\t\t\t\t\tspreadSheet[gyoR][retsuC] += Integer.parseInt(info[j]);\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor (int i = 0; i < gyoR + 1; i++) {\n\t\t\t\tfor (int j = 0; j < retsuC; j++) {\n\t\t\t\t\tSystem.out.print(spreadSheet[i][j] + \" \");\n\t\t\t\t}\n\t\t\t\tSystem.out.println(spreadSheet[i][retsuC]);\n\t\t\t}\n\t\t}\n\t}",
"public class Main{\n\n\tpublic static void main(String[] args) throws IOException {\n\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\n\t\t// ????????????????????????\n\t\tString[] size = new String[2];\n\t\tsize = br.readLine().split(\" \");\n\n\t\tint gyoR = Integer.parseInt(size[0]);\n\t\tint retsuC = Integer.parseInt(size[1]);\n\n\t\tint[][] spreadSheet = new int[gyoR + 1][retsuC + 1];\n\n\n\t\t\t// ?¶????????????±??\\???\n\t\t\t\n\t\t\tfor (int i = 0; i < gyoR; i++) {\n\t\t\t\tString tempInfo = br.readLine();\n\t\t\t\tString[] info = tempInfo.split(\" \");\n\n\t\t\t\tfor (int j = 0; j < retsuC; j++) {\n\t\t\t\t\tspreadSheet[i][j] = Integer.parseInt(info[j]);\n\t\t\t\t\tspreadSheet[i][retsuC] += Integer.parseInt(info[j]);\n\t\t\t\t\tspreadSheet[gyoR][j] += Integer.parseInt(info[j]);\n\t\t\t\t\tspreadSheet[gyoR][retsuC] += Integer.parseInt(info[j]);\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor (int i = 0; i < gyoR + 1; i++) {\n\t\t\t\tfor (int j = 0; j < retsuC; j++) {\n\t\t\t\t\tSystem.out.print(spreadSheet[i][j] + \" \");\n\t\t\t\t}\n\t\t\t\tSystem.out.println(spreadSheet[i][retsuC]);\n\t\t\t}\n\t\t}\n\t}",
"Main"
] |
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class Main{
public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
// ????????????????????????
String[] size = new String[2];
size = br.readLine().split(" ");
int gyoR = Integer.parseInt(size[0]);
int retsuC = Integer.parseInt(size[1]);
int[][] spreadSheet = new int[gyoR + 1][retsuC + 1];
// ?¶????????????±??\???
for (int i = 0; i < gyoR; i++) {
String tempInfo = br.readLine();
String[] info = tempInfo.split(" ");
for (int j = 0; j < retsuC; j++) {
spreadSheet[i][j] = Integer.parseInt(info[j]);
spreadSheet[i][retsuC] += Integer.parseInt(info[j]);
spreadSheet[gyoR][j] += Integer.parseInt(info[j]);
spreadSheet[gyoR][retsuC] += Integer.parseInt(info[j]);
}
}
for (int i = 0; i < gyoR + 1; i++) {
for (int j = 0; j < retsuC; j++) {
System.out.print(spreadSheet[i][j] + " ");
}
System.out.println(spreadSheet[i][retsuC]);
}
}
} |
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
20,
41,
13,
20,
41,
13,
17,
41,
13,
17,
41,
13,
4,
18,
4,
18,
13,
13,
41,
13,
4,
18,
13,
18,
13,
17,
41,
13,
4,
18,
13,
18,
13,
17,
41,
13,
20,
2,
13,
17,
2,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
41,
13,
4,
18,
4,
18,
13,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
18,
18,
13,
13,
13,
4,
18,
13,
18,
13,
13,
4,
18,
13,
2,
18,
18,
13,
13,
13,
13,
0,
18,
18,
13,
13,
13,
18,
18,
13,
13,
13,
0,
18,
18,
13,
13,
13,
18,
18,
13,
13,
13,
0,
18,
18,
13,
13,
13,
18,
18,
13,
13,
13,
14,
2,
13,
2,
13,
17,
4,
18,
13,
2,
18,
18,
13,
13,
13,
13,
4,
18,
13,
2,
18,
18,
13,
13,
13,
13,
4,
18,
13,
18,
18,
13,
13,
13,
4,
18,
18,
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
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
8,
15
],
[
15,
16
],
[
15,
17
],
[
8,
18
],
[
18,
19
],
[
18,
20
],
[
8,
21
],
[
21,
22
],
[
21,
23
],
[
8,
24
],
[
24,
25
],
[
24,
26
],
[
26,
27
],
[
27,
28
],
[
28,
29
],
[
29,
30
],
[
26,
31
],
[
8,
32
],
[
32,
33
],
[
32,
34
],
[
34,
35
],
[
35,
36
],
[
34,
37
],
[
37,
38
],
[
37,
39
],
[
8,
40
],
[
40,
41
],
[
40,
42
],
[
42,
43
],
[
43,
44
],
[
42,
45
],
[
45,
46
],
[
45,
47
],
[
8,
48
],
[
48,
49
],
[
48,
50
],
[
51,
52
],
[
51,
53
],
[
54,
55
],
[
54,
56
],
[
8,
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
],
[
73,
74
],
[
74,
75
],
[
75,
76
],
[
72,
77
],
[
69,
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
],
[
92,
93
],
[
93,
94
],
[
93,
95
],
[
92,
96
],
[
91,
97
],
[
97,
98
],
[
98,
99
],
[
97,
100
],
[
100,
101
],
[
100,
102
],
[
90,
103
],
[
103,
104
],
[
104,
105
],
[
103,
106
],
[
106,
107
],
[
107,
108
],
[
108,
109
],
[
108,
110
],
[
107,
111
],
[
106,
112
],
[
90,
113
],
[
113,
114
],
[
114,
115
],
[
115,
116
],
[
115,
117
],
[
114,
118
],
[
113,
119
],
[
119,
120
],
[
120,
121
],
[
120,
122
],
[
119,
123
],
[
90,
124
],
[
124,
125
],
[
125,
126
],
[
126,
127
],
[
126,
128
],
[
125,
129
],
[
124,
130
],
[
130,
131
],
[
131,
132
],
[
131,
133
],
[
130,
134
],
[
90,
135
],
[
135,
136
],
[
136,
137
],
[
137,
138
],
[
137,
139
],
[
136,
140
],
[
135,
141
],
[
141,
142
],
[
142,
143
],
[
142,
144
],
[
141,
145
],
[
90,
146
],
[
146,
147
],
[
147,
148
],
[
147,
149
],
[
149,
150
],
[
149,
151
],
[
146,
152
],
[
152,
153
],
[
153,
154
],
[
152,
155
],
[
155,
156
],
[
156,
157
],
[
157,
158
],
[
157,
159
],
[
156,
160
],
[
155,
161
],
[
69,
162
],
[
162,
163
],
[
163,
164
],
[
162,
165
],
[
165,
166
],
[
166,
167
],
[
167,
168
],
[
167,
169
],
[
166,
170
],
[
165,
171
],
[
8,
172
],
[
172,
173
],
[
173,
174
],
[
172,
175
],
[
175,
176
],
[
176,
177
],
[
176,
178
],
[
175,
179
],
[
8,
180
],
[
180,
181
],
[
181,
182
],
[
182,
183
],
[
182,
184
],
[
180,
185
],
[
8,
186
],
[
186,
187
],
[
187,
188
],
[
188,
189
],
[
188,
190
],
[
186,
191
],
[
6,
192
],
[
192,
193
]
] | [
"import java.io.*;\n\nclass Main {\n\tpublic static void main(String[] args) throws Exception {\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\t\tStringBuilder sb1=new StringBuilder();\n\t\tStringBuilder sb2=new StringBuilder();\n\t\tString b=\" \",n=\"\\n\";\n String[] rc=br.readLine().split(b);\n int r=Integer.parseInt(rc[0]);\n int c=Integer.parseInt(rc[1]);\n int[][] h=new int[r+1][c+1];\n \n for(int i=0;i<r;i++){\n \tString[] row=br.readLine().split(b);\n \tfor(int j=0;j<c;j++){\n \t\th[i][j]=Integer.parseInt(row[j]);\n \t\tsb1.append(h[i][j]+b);\n \t\th[i][c]+=h[i][j];\n \t\th[r][j]+=h[i][j];\n \t\th[r][c]+=h[i][j];\n \t\tif(i==r-1) sb2.append(h[r][j]+b);\n \t}\n \tsb1.append(h[i][c]+n);\n }\n sb2.append(h[r][c]);\n System.out.print(sb1);\n System.out.println(sb2);\n\t}\n}",
"import java.io.*;",
"io.*",
"java",
"class Main {\n\tpublic static void main(String[] args) throws Exception {\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\t\tStringBuilder sb1=new StringBuilder();\n\t\tStringBuilder sb2=new StringBuilder();\n\t\tString b=\" \",n=\"\\n\";\n String[] rc=br.readLine().split(b);\n int r=Integer.parseInt(rc[0]);\n int c=Integer.parseInt(rc[1]);\n int[][] h=new int[r+1][c+1];\n \n for(int i=0;i<r;i++){\n \tString[] row=br.readLine().split(b);\n \tfor(int j=0;j<c;j++){\n \t\th[i][j]=Integer.parseInt(row[j]);\n \t\tsb1.append(h[i][j]+b);\n \t\th[i][c]+=h[i][j];\n \t\th[r][j]+=h[i][j];\n \t\th[r][c]+=h[i][j];\n \t\tif(i==r-1) sb2.append(h[r][j]+b);\n \t}\n \tsb1.append(h[i][c]+n);\n }\n sb2.append(h[r][c]);\n System.out.print(sb1);\n System.out.println(sb2);\n\t}\n}",
"Main",
"public static void main(String[] args) throws Exception {\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\t\tStringBuilder sb1=new StringBuilder();\n\t\tStringBuilder sb2=new StringBuilder();\n\t\tString b=\" \",n=\"\\n\";\n String[] rc=br.readLine().split(b);\n int r=Integer.parseInt(rc[0]);\n int c=Integer.parseInt(rc[1]);\n int[][] h=new int[r+1][c+1];\n \n for(int i=0;i<r;i++){\n \tString[] row=br.readLine().split(b);\n \tfor(int j=0;j<c;j++){\n \t\th[i][j]=Integer.parseInt(row[j]);\n \t\tsb1.append(h[i][j]+b);\n \t\th[i][c]+=h[i][j];\n \t\th[r][j]+=h[i][j];\n \t\th[r][c]+=h[i][j];\n \t\tif(i==r-1) sb2.append(h[r][j]+b);\n \t}\n \tsb1.append(h[i][c]+n);\n }\n sb2.append(h[r][c]);\n System.out.print(sb1);\n System.out.println(sb2);\n\t}",
"main",
"{\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\t\tStringBuilder sb1=new StringBuilder();\n\t\tStringBuilder sb2=new StringBuilder();\n\t\tString b=\" \",n=\"\\n\";\n String[] rc=br.readLine().split(b);\n int r=Integer.parseInt(rc[0]);\n int c=Integer.parseInt(rc[1]);\n int[][] h=new int[r+1][c+1];\n \n for(int i=0;i<r;i++){\n \tString[] row=br.readLine().split(b);\n \tfor(int j=0;j<c;j++){\n \t\th[i][j]=Integer.parseInt(row[j]);\n \t\tsb1.append(h[i][j]+b);\n \t\th[i][c]+=h[i][j];\n \t\th[r][j]+=h[i][j];\n \t\th[r][c]+=h[i][j];\n \t\tif(i==r-1) sb2.append(h[r][j]+b);\n \t}\n \tsb1.append(h[i][c]+n);\n }\n sb2.append(h[r][c]);\n System.out.print(sb1);\n System.out.println(sb2);\n\t}",
"BufferedReader br = new BufferedReader(new InputStreamReader(System.in));",
"br",
"new BufferedReader(new InputStreamReader(System.in))",
"StringBuilder sb1=new StringBuilder();",
"sb1",
"new StringBuilder()",
"StringBuilder sb2=new StringBuilder();",
"sb2",
"new StringBuilder()",
"String b=\" \"",
"b",
"\" \"",
"n=\"\\n\";",
"n",
"\"\\n\"",
"String[] rc=br.readLine().split(b);",
"rc",
"br.readLine().split(b)",
"br.readLine().split",
"br.readLine()",
"br.readLine",
"br",
"b",
"int r=Integer.parseInt(rc[0]);",
"r",
"Integer.parseInt(rc[0])",
"Integer.parseInt",
"Integer",
"rc[0]",
"rc",
"0",
"int c=Integer.parseInt(rc[1]);",
"c",
"Integer.parseInt(rc[1])",
"Integer.parseInt",
"Integer",
"rc[1]",
"rc",
"1",
"int[][] h=new int[r+1][c+1];",
"h",
"new int[r+1][c+1]",
"r+1",
"r",
"1",
"c+1",
"c",
"1",
"for(int i=0;i<r;i++){\n \tString[] row=br.readLine().split(b);\n \tfor(int j=0;j<c;j++){\n \t\th[i][j]=Integer.parseInt(row[j]);\n \t\tsb1.append(h[i][j]+b);\n \t\th[i][c]+=h[i][j];\n \t\th[r][j]+=h[i][j];\n \t\th[r][c]+=h[i][j];\n \t\tif(i==r-1) sb2.append(h[r][j]+b);\n \t}\n \tsb1.append(h[i][c]+n);\n }",
"int i=0;",
"int i=0;",
"i",
"0",
"i<r",
"i",
"r",
"i++",
"i++",
"i",
"{\n \tString[] row=br.readLine().split(b);\n \tfor(int j=0;j<c;j++){\n \t\th[i][j]=Integer.parseInt(row[j]);\n \t\tsb1.append(h[i][j]+b);\n \t\th[i][c]+=h[i][j];\n \t\th[r][j]+=h[i][j];\n \t\th[r][c]+=h[i][j];\n \t\tif(i==r-1) sb2.append(h[r][j]+b);\n \t}\n \tsb1.append(h[i][c]+n);\n }",
"{\n \tString[] row=br.readLine().split(b);\n \tfor(int j=0;j<c;j++){\n \t\th[i][j]=Integer.parseInt(row[j]);\n \t\tsb1.append(h[i][j]+b);\n \t\th[i][c]+=h[i][j];\n \t\th[r][j]+=h[i][j];\n \t\th[r][c]+=h[i][j];\n \t\tif(i==r-1) sb2.append(h[r][j]+b);\n \t}\n \tsb1.append(h[i][c]+n);\n }",
"String[] row=br.readLine().split(b);",
"row",
"br.readLine().split(b)",
"br.readLine().split",
"br.readLine()",
"br.readLine",
"br",
"b",
"for(int j=0;j<c;j++){\n \t\th[i][j]=Integer.parseInt(row[j]);\n \t\tsb1.append(h[i][j]+b);\n \t\th[i][c]+=h[i][j];\n \t\th[r][j]+=h[i][j];\n \t\th[r][c]+=h[i][j];\n \t\tif(i==r-1) sb2.append(h[r][j]+b);\n \t}",
"int j=0;",
"int j=0;",
"j",
"0",
"j<c",
"j",
"c",
"j++",
"j++",
"j",
"{\n \t\th[i][j]=Integer.parseInt(row[j]);\n \t\tsb1.append(h[i][j]+b);\n \t\th[i][c]+=h[i][j];\n \t\th[r][j]+=h[i][j];\n \t\th[r][c]+=h[i][j];\n \t\tif(i==r-1) sb2.append(h[r][j]+b);\n \t}",
"{\n \t\th[i][j]=Integer.parseInt(row[j]);\n \t\tsb1.append(h[i][j]+b);\n \t\th[i][c]+=h[i][j];\n \t\th[r][j]+=h[i][j];\n \t\th[r][c]+=h[i][j];\n \t\tif(i==r-1) sb2.append(h[r][j]+b);\n \t}",
"h[i][j]=Integer.parseInt(row[j])",
"h[i][j]",
"h[i]",
"h",
"i",
"j",
"Integer.parseInt(row[j])",
"Integer.parseInt",
"Integer",
"row[j]",
"row",
"j",
"sb1.append(h[i][j]+b)",
"sb1.append",
"sb1",
"h[i][j]+b",
"h[i][j]",
"h[i]",
"h",
"i",
"j",
"b",
"h[i][c]+=h[i][j]",
"h[i][c]",
"h[i]",
"h",
"i",
"c",
"h[i][j]",
"h[i]",
"h",
"i",
"j",
"h[r][j]+=h[i][j]",
"h[r][j]",
"h[r]",
"h",
"r",
"j",
"h[i][j]",
"h[i]",
"h",
"i",
"j",
"h[r][c]+=h[i][j]",
"h[r][c]",
"h[r]",
"h",
"r",
"c",
"h[i][j]",
"h[i]",
"h",
"i",
"j",
"if(i==r-1) sb2.append(h[r][j]+b);",
"i==r-1",
"i",
"r-1",
"r",
"1",
"sb2.append(h[r][j]+b)",
"sb2.append",
"sb2",
"h[r][j]+b",
"h[r][j]",
"h[r]",
"h",
"r",
"j",
"b",
"sb1.append(h[i][c]+n)",
"sb1.append",
"sb1",
"h[i][c]+n",
"h[i][c]",
"h[i]",
"h",
"i",
"c",
"n",
"sb2.append(h[r][c])",
"sb2.append",
"sb2",
"h[r][c]",
"h[r]",
"h",
"r",
"c",
"System.out.print(sb1)",
"System.out.print",
"System.out",
"System",
"System.out",
"sb1",
"System.out.println(sb2)",
"System.out.println",
"System.out",
"System",
"System.out",
"sb2",
"String[] args",
"args"
] | import java.io.*;
class Main {
public static void main(String[] args) throws Exception {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
StringBuilder sb1=new StringBuilder();
StringBuilder sb2=new StringBuilder();
String b=" ",n="\n";
String[] rc=br.readLine().split(b);
int r=Integer.parseInt(rc[0]);
int c=Integer.parseInt(rc[1]);
int[][] h=new int[r+1][c+1];
for(int i=0;i<r;i++){
String[] row=br.readLine().split(b);
for(int j=0;j<c;j++){
h[i][j]=Integer.parseInt(row[j]);
sb1.append(h[i][j]+b);
h[i][c]+=h[i][j];
h[r][j]+=h[i][j];
h[r][c]+=h[i][j];
if(i==r-1) sb2.append(h[r][j]+b);
}
sb1.append(h[i][c]+n);
}
sb2.append(h[r][c]);
System.out.print(sb1);
System.out.println(sb2);
}
} |
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
41,
13,
20,
2,
2,
13,
13,
17,
41,
13,
41,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
4,
18,
13,
0,
13,
13,
0,
18,
13,
13,
13,
4,
18,
18,
13,
13,
2,
13,
17,
0,
18,
13,
13,
13,
4,
18,
18,
13,
13,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
4,
18,
18,
13,
13,
2,
18,
13,
13,
17,
4,
18,
18,
13,
13,
18,
13,
13,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
129,
5
],
[
129,
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
],
[
19,
20
],
[
20,
21
],
[
8,
22
],
[
22,
23
],
[
22,
24
],
[
25,
26
],
[
26,
27
],
[
26,
28
],
[
25,
29
],
[
8,
30
],
[
30,
31
],
[
8,
32
],
[
32,
33
],
[
8,
34
],
[
34,
35
],
[
35,
36
],
[
36,
37
],
[
36,
38
],
[
34,
39
],
[
39,
40
],
[
39,
41
],
[
34,
42
],
[
42,
43
],
[
43,
44
],
[
34,
45
],
[
46,
46
],
[
46,
47
],
[
47,
48
],
[
47,
49
],
[
46,
50
],
[
50,
51
],
[
51,
52
],
[
52,
53
],
[
52,
54
],
[
50,
55
],
[
55,
56
],
[
55,
57
],
[
50,
58
],
[
58,
59
],
[
59,
60
],
[
50,
61
],
[
62,
62
],
[
62,
63
],
[
63,
64
],
[
63,
65
],
[
65,
66
],
[
66,
67
],
[
62,
68
],
[
68,
69
],
[
68,
70
],
[
62,
71
],
[
71,
72
],
[
72,
73
],
[
72,
74
],
[
71,
75
],
[
62,
76
],
[
76,
77
],
[
77,
78
],
[
78,
79
],
[
78,
80
],
[
76,
81
],
[
81,
82
],
[
81,
83
],
[
46,
84
],
[
84,
85
],
[
85,
86
],
[
85,
87
],
[
84,
88
],
[
46,
89
],
[
89,
90
],
[
90,
91
],
[
91,
92
],
[
91,
93
],
[
89,
94
],
[
8,
95
],
[
95,
96
],
[
96,
97
],
[
97,
98
],
[
97,
99
],
[
95,
100
],
[
100,
101
],
[
100,
102
],
[
95,
103
],
[
103,
104
],
[
104,
105
],
[
95,
106
],
[
107,
107
],
[
107,
108
],
[
108,
109
],
[
109,
110
],
[
110,
111
],
[
110,
112
],
[
108,
113
],
[
113,
114
],
[
114,
115
],
[
114,
116
],
[
113,
117
],
[
8,
118
],
[
118,
119
],
[
119,
120
],
[
120,
121
],
[
120,
122
],
[
118,
123
],
[
123,
124
],
[
123,
125
],
[
6,
126
],
[
126,
127
],
[
0,
128
],
[
128,
129
],
[
128,
130
]
] | [
"import java.util.Scanner;\n\npublic class Main {\n\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n int r = sc.nextInt();\n int c = sc.nextInt();\n int[] s = new int [r*c+1];\n int t, sum;\n for(int i = 0; i < r; i++)\n {\n sum = 0;\n for(int k = 0; k < c; k++)\n {\n t = sc.nextInt();\n sum += t;\n s[k] += t;\n System.out.print(t + \" \");\n }\n s[c] += sum;\n System.out.println(sum);\n }\n for(int i = 0; i < c; i++){\n System.out.print(s[i] + \" \");\n }\n System.out.println(s[c]);\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 int r = sc.nextInt();\n int c = sc.nextInt();\n int[] s = new int [r*c+1];\n int t, sum;\n for(int i = 0; i < r; i++)\n {\n sum = 0;\n for(int k = 0; k < c; k++)\n {\n t = sc.nextInt();\n sum += t;\n s[k] += t;\n System.out.print(t + \" \");\n }\n s[c] += sum;\n System.out.println(sum);\n }\n for(int i = 0; i < c; i++){\n System.out.print(s[i] + \" \");\n }\n System.out.println(s[c]);\n }\n\n}",
"Main",
"public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n int r = sc.nextInt();\n int c = sc.nextInt();\n int[] s = new int [r*c+1];\n int t, sum;\n for(int i = 0; i < r; i++)\n {\n sum = 0;\n for(int k = 0; k < c; k++)\n {\n t = sc.nextInt();\n sum += t;\n s[k] += t;\n System.out.print(t + \" \");\n }\n s[c] += sum;\n System.out.println(sum);\n }\n for(int i = 0; i < c; i++){\n System.out.print(s[i] + \" \");\n }\n System.out.println(s[c]);\n }",
"main",
"{\n Scanner sc = new Scanner(System.in);\n int r = sc.nextInt();\n int c = sc.nextInt();\n int[] s = new int [r*c+1];\n int t, sum;\n for(int i = 0; i < r; i++)\n {\n sum = 0;\n for(int k = 0; k < c; k++)\n {\n t = sc.nextInt();\n sum += t;\n s[k] += t;\n System.out.print(t + \" \");\n }\n s[c] += sum;\n System.out.println(sum);\n }\n for(int i = 0; i < c; i++){\n System.out.print(s[i] + \" \");\n }\n System.out.println(s[c]);\n }",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"int r = sc.nextInt();",
"r",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int c = sc.nextInt();",
"c",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int[] s = new int [r*c+1];",
"s",
"new int [r*c+1]",
"r*c+1",
"r*c",
"r",
"c",
"1",
"int t",
"t",
"sum;",
"sum",
"for(int i = 0; i < r; i++)\n {\n sum = 0;\n for(int k = 0; k < c; k++)\n {\n t = sc.nextInt();\n sum += t;\n s[k] += t;\n System.out.print(t + \" \");\n }\n s[c] += sum;\n System.out.println(sum);\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < r",
"i",
"r",
"i++",
"i++",
"i",
"{\n sum = 0;\n for(int k = 0; k < c; k++)\n {\n t = sc.nextInt();\n sum += t;\n s[k] += t;\n System.out.print(t + \" \");\n }\n s[c] += sum;\n System.out.println(sum);\n }",
"{\n sum = 0;\n for(int k = 0; k < c; k++)\n {\n t = sc.nextInt();\n sum += t;\n s[k] += t;\n System.out.print(t + \" \");\n }\n s[c] += sum;\n System.out.println(sum);\n }",
"sum = 0",
"sum",
"0",
"for(int k = 0; k < c; k++)\n {\n t = sc.nextInt();\n sum += t;\n s[k] += t;\n System.out.print(t + \" \");\n }",
"int k = 0;",
"int k = 0;",
"k",
"0",
"k < c",
"k",
"c",
"k++",
"k++",
"k",
"{\n t = sc.nextInt();\n sum += t;\n s[k] += t;\n System.out.print(t + \" \");\n }",
"{\n t = sc.nextInt();\n sum += t;\n s[k] += t;\n System.out.print(t + \" \");\n }",
"t = sc.nextInt()",
"t",
"sc.nextInt()",
"sc.nextInt",
"sc",
"sum += t",
"sum",
"t",
"s[k] += t",
"s[k]",
"s",
"k",
"t",
"System.out.print(t + \" \")",
"System.out.print",
"System.out",
"System",
"System.out",
"t + \" \"",
"t",
"\" \"",
"s[c] += sum",
"s[c]",
"s",
"c",
"sum",
"System.out.println(sum)",
"System.out.println",
"System.out",
"System",
"System.out",
"sum",
"for(int i = 0; i < c; i++){\n System.out.print(s[i] + \" \");\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < c",
"i",
"c",
"i++",
"i++",
"i",
"{\n System.out.print(s[i] + \" \");\n }",
"{\n System.out.print(s[i] + \" \");\n }",
"System.out.print(s[i] + \" \")",
"System.out.print",
"System.out",
"System",
"System.out",
"s[i] + \" \"",
"s[i]",
"s",
"i",
"\" \"",
"System.out.println(s[c])",
"System.out.println",
"System.out",
"System",
"System.out",
"s[c]",
"s",
"c",
"String[] args",
"args",
"public class Main {\n\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n int r = sc.nextInt();\n int c = sc.nextInt();\n int[] s = new int [r*c+1];\n int t, sum;\n for(int i = 0; i < r; i++)\n {\n sum = 0;\n for(int k = 0; k < c; k++)\n {\n t = sc.nextInt();\n sum += t;\n s[k] += t;\n System.out.print(t + \" \");\n }\n s[c] += sum;\n System.out.println(sum);\n }\n for(int i = 0; i < c; i++){\n System.out.print(s[i] + \" \");\n }\n System.out.println(s[c]);\n }\n\n}",
"public class Main {\n\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n int r = sc.nextInt();\n int c = sc.nextInt();\n int[] s = new int [r*c+1];\n int t, sum;\n for(int i = 0; i < r; i++)\n {\n sum = 0;\n for(int k = 0; k < c; k++)\n {\n t = sc.nextInt();\n sum += t;\n s[k] += t;\n System.out.print(t + \" \");\n }\n s[c] += sum;\n System.out.println(sum);\n }\n for(int i = 0; i < c; i++){\n System.out.print(s[i] + \" \");\n }\n System.out.println(s[c]);\n }\n\n}",
"Main"
] | import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int r = sc.nextInt();
int c = sc.nextInt();
int[] s = new int [r*c+1];
int t, sum;
for(int i = 0; i < r; i++)
{
sum = 0;
for(int k = 0; k < c; k++)
{
t = sc.nextInt();
sum += t;
s[k] += t;
System.out.print(t + " ");
}
s[c] += sum;
System.out.println(sum);
}
for(int i = 0; i < c; i++){
System.out.print(s[i] + " ");
}
System.out.println(s[c]);
}
} |
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
20,
41,
13,
41,
13,
41,
13,
41,
13,
0,
13,
4,
18,
13,
0,
13,
4,
18,
13,
17,
0,
13,
4,
18,
13,
18,
13,
17,
0,
13,
4,
18,
13,
18,
13,
17,
41,
13,
20,
2,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
41,
13,
17,
0,
13,
4,
18,
13,
0,
13,
4,
18,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
4,
18,
13,
18,
13,
13,
4,
18,
4,
18,
13,
18,
13,
13,
17,
0,
18,
13,
13,
4,
18,
13,
18,
13,
13,
4,
18,
4,
18,
13,
13,
17,
0,
18,
13,
13,
13,
11,
1,
41,
13,
17,
2,
13,
2,
13,
17,
1,
40,
13,
30,
30,
14,
2,
13,
17,
30,
4,
18,
13,
17,
4,
18,
13,
18,
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
],
[
180,
11
],
[
180,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
15,
17
],
[
14,
18
],
[
18,
19
],
[
18,
20
],
[
14,
21
],
[
21,
22
],
[
14,
23
],
[
23,
24
],
[
14,
25
],
[
25,
26
],
[
14,
27
],
[
27,
28
],
[
14,
29
],
[
29,
30
],
[
29,
31
],
[
31,
32
],
[
32,
33
],
[
14,
34
],
[
34,
35
],
[
34,
36
],
[
36,
37
],
[
37,
38
],
[
36,
39
],
[
14,
40
],
[
40,
41
],
[
40,
42
],
[
42,
43
],
[
43,
44
],
[
42,
45
],
[
45,
46
],
[
45,
47
],
[
14,
48
],
[
48,
49
],
[
48,
50
],
[
50,
51
],
[
51,
52
],
[
50,
53
],
[
53,
54
],
[
53,
55
],
[
14,
56
],
[
56,
57
],
[
56,
58
],
[
59,
60
],
[
59,
61
],
[
14,
62
],
[
62,
63
],
[
63,
64
],
[
64,
65
],
[
64,
66
],
[
62,
67
],
[
67,
68
],
[
67,
69
],
[
62,
70
],
[
70,
71
],
[
71,
72
],
[
62,
73
],
[
74,
74
],
[
74,
75
],
[
75,
76
],
[
75,
77
],
[
74,
78
],
[
78,
79
],
[
78,
80
],
[
80,
81
],
[
81,
82
],
[
74,
83
],
[
83,
84
],
[
83,
85
],
[
85,
86
],
[
86,
87
],
[
85,
88
],
[
74,
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
],
[
102,
104
],
[
104,
105
],
[
105,
106
],
[
104,
107
],
[
107,
108
],
[
107,
109
],
[
101,
110
],
[
110,
111
],
[
111,
112
],
[
112,
113
],
[
113,
114
],
[
112,
115
],
[
115,
116
],
[
115,
117
],
[
110,
118
],
[
101,
119
],
[
119,
120
],
[
120,
121
],
[
120,
122
],
[
119,
123
],
[
123,
124
],
[
124,
125
],
[
123,
126
],
[
126,
127
],
[
126,
128
],
[
74,
129
],
[
129,
130
],
[
130,
131
],
[
131,
132
],
[
132,
133
],
[
131,
134
],
[
129,
135
],
[
74,
136
],
[
136,
137
],
[
137,
138
],
[
137,
139
],
[
136,
140
],
[
14,
141
],
[
141,
142
],
[
142,
143
],
[
143,
144
],
[
143,
145
],
[
141,
146
],
[
146,
147
],
[
146,
148
],
[
148,
149
],
[
148,
150
],
[
141,
151
],
[
151,
152
],
[
152,
153
],
[
141,
154
],
[
155,
155
],
[
155,
156
],
[
156,
157
],
[
157,
158
],
[
157,
159
],
[
156,
160
],
[
160,
161
],
[
161,
162
],
[
162,
163
],
[
161,
164
],
[
155,
165
],
[
165,
166
],
[
166,
167
],
[
165,
168
],
[
168,
169
],
[
168,
170
],
[
14,
171
],
[
171,
172
],
[
172,
173
],
[
173,
174
],
[
173,
175
],
[
171,
176
],
[
12,
177
],
[
177,
178
],
[
0,
179
],
[
179,
180
],
[
179,
181
]
] | [
"\nimport java.io.BufferedReader;\nimport java.io.IOException;\nimport java.io.InputStreamReader;\n\npublic class Main {\n\n public static void main(String[] args) throws IOException {\n BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));\n StringBuilder builder = new StringBuilder();\n String line;\n String[] columns;\n int x, y;\n line = reader.readLine();\n columns = line.split(\" \");\n y = Integer.parseInt(columns[0]);\n x = Integer.parseInt(columns[1]);\n int[] total = new int[x+1];\n\n for (int i = 0; i < y; i++) {\n int sum = 0;\n line = reader.readLine();\n columns = line.split(\" \");\n for (int j = 0; j < x; j++) {\n sum += Integer.parseInt(columns[j]);\n builder.append(columns[j])\n .append(\" \");\n total[j] += Integer.parseInt(columns[j]);\n }\n builder.append(sum)\n .append(\"\\n\");\n total[x] += sum;\n }\n for (int i = 0; i < x + 1; i++) {\n if ( i != 0 ) {\n builder.append(\" \");\n }\n builder.append(total[i]);\n }\n// builder.append(\"\\n\");\n// System.out.print(\"\\n\");\n System.out.println(builder);\n }\n}",
"import java.io.BufferedReader;",
"BufferedReader",
"java.io",
"import java.io.IOException;",
"IOException",
"java.io",
"import java.io.InputStreamReader;",
"InputStreamReader",
"java.io",
"public class Main {\n\n public static void main(String[] args) throws IOException {\n BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));\n StringBuilder builder = new StringBuilder();\n String line;\n String[] columns;\n int x, y;\n line = reader.readLine();\n columns = line.split(\" \");\n y = Integer.parseInt(columns[0]);\n x = Integer.parseInt(columns[1]);\n int[] total = new int[x+1];\n\n for (int i = 0; i < y; i++) {\n int sum = 0;\n line = reader.readLine();\n columns = line.split(\" \");\n for (int j = 0; j < x; j++) {\n sum += Integer.parseInt(columns[j]);\n builder.append(columns[j])\n .append(\" \");\n total[j] += Integer.parseInt(columns[j]);\n }\n builder.append(sum)\n .append(\"\\n\");\n total[x] += sum;\n }\n for (int i = 0; i < x + 1; i++) {\n if ( i != 0 ) {\n builder.append(\" \");\n }\n builder.append(total[i]);\n }\n// builder.append(\"\\n\");\n// System.out.print(\"\\n\");\n System.out.println(builder);\n }\n}",
"Main",
"public static void main(String[] args) throws IOException {\n BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));\n StringBuilder builder = new StringBuilder();\n String line;\n String[] columns;\n int x, y;\n line = reader.readLine();\n columns = line.split(\" \");\n y = Integer.parseInt(columns[0]);\n x = Integer.parseInt(columns[1]);\n int[] total = new int[x+1];\n\n for (int i = 0; i < y; i++) {\n int sum = 0;\n line = reader.readLine();\n columns = line.split(\" \");\n for (int j = 0; j < x; j++) {\n sum += Integer.parseInt(columns[j]);\n builder.append(columns[j])\n .append(\" \");\n total[j] += Integer.parseInt(columns[j]);\n }\n builder.append(sum)\n .append(\"\\n\");\n total[x] += sum;\n }\n for (int i = 0; i < x + 1; i++) {\n if ( i != 0 ) {\n builder.append(\" \");\n }\n builder.append(total[i]);\n }\n// builder.append(\"\\n\");\n// System.out.print(\"\\n\");\n System.out.println(builder);\n }",
"main",
"{\n BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));\n StringBuilder builder = new StringBuilder();\n String line;\n String[] columns;\n int x, y;\n line = reader.readLine();\n columns = line.split(\" \");\n y = Integer.parseInt(columns[0]);\n x = Integer.parseInt(columns[1]);\n int[] total = new int[x+1];\n\n for (int i = 0; i < y; i++) {\n int sum = 0;\n line = reader.readLine();\n columns = line.split(\" \");\n for (int j = 0; j < x; j++) {\n sum += Integer.parseInt(columns[j]);\n builder.append(columns[j])\n .append(\" \");\n total[j] += Integer.parseInt(columns[j]);\n }\n builder.append(sum)\n .append(\"\\n\");\n total[x] += sum;\n }\n for (int i = 0; i < x + 1; i++) {\n if ( i != 0 ) {\n builder.append(\" \");\n }\n builder.append(total[i]);\n }\n// builder.append(\"\\n\");\n// System.out.print(\"\\n\");\n System.out.println(builder);\n }",
"BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));",
"reader",
"new BufferedReader(new InputStreamReader(System.in))",
"StringBuilder builder = new StringBuilder();",
"builder",
"new StringBuilder()",
"String line;",
"line",
"String[] columns;",
"columns",
"int x",
"x",
"y;",
"y",
"line = reader.readLine()",
"line",
"reader.readLine()",
"reader.readLine",
"reader",
"columns = line.split(\" \")",
"columns",
"line.split(\" \")",
"line.split",
"line",
"\" \"",
"y = Integer.parseInt(columns[0])",
"y",
"Integer.parseInt(columns[0])",
"Integer.parseInt",
"Integer",
"columns[0]",
"columns",
"0",
"x = Integer.parseInt(columns[1])",
"x",
"Integer.parseInt(columns[1])",
"Integer.parseInt",
"Integer",
"columns[1]",
"columns",
"1",
"int[] total = new int[x+1];",
"total",
"new int[x+1]",
"x+1",
"x",
"1",
"for (int i = 0; i < y; i++) {\n int sum = 0;\n line = reader.readLine();\n columns = line.split(\" \");\n for (int j = 0; j < x; j++) {\n sum += Integer.parseInt(columns[j]);\n builder.append(columns[j])\n .append(\" \");\n total[j] += Integer.parseInt(columns[j]);\n }\n builder.append(sum)\n .append(\"\\n\");\n total[x] += sum;\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < y",
"i",
"y",
"i++",
"i++",
"i",
"{\n int sum = 0;\n line = reader.readLine();\n columns = line.split(\" \");\n for (int j = 0; j < x; j++) {\n sum += Integer.parseInt(columns[j]);\n builder.append(columns[j])\n .append(\" \");\n total[j] += Integer.parseInt(columns[j]);\n }\n builder.append(sum)\n .append(\"\\n\");\n total[x] += sum;\n }",
"{\n int sum = 0;\n line = reader.readLine();\n columns = line.split(\" \");\n for (int j = 0; j < x; j++) {\n sum += Integer.parseInt(columns[j]);\n builder.append(columns[j])\n .append(\" \");\n total[j] += Integer.parseInt(columns[j]);\n }\n builder.append(sum)\n .append(\"\\n\");\n total[x] += sum;\n }",
"int sum = 0;",
"sum",
"0",
"line = reader.readLine()",
"line",
"reader.readLine()",
"reader.readLine",
"reader",
"columns = line.split(\" \")",
"columns",
"line.split(\" \")",
"line.split",
"line",
"\" \"",
"for (int j = 0; j < x; j++) {\n sum += Integer.parseInt(columns[j]);\n builder.append(columns[j])\n .append(\" \");\n total[j] += Integer.parseInt(columns[j]);\n }",
"int j = 0;",
"int j = 0;",
"j",
"0",
"j < x",
"j",
"x",
"j++",
"j++",
"j",
"{\n sum += Integer.parseInt(columns[j]);\n builder.append(columns[j])\n .append(\" \");\n total[j] += Integer.parseInt(columns[j]);\n }",
"{\n sum += Integer.parseInt(columns[j]);\n builder.append(columns[j])\n .append(\" \");\n total[j] += Integer.parseInt(columns[j]);\n }",
"sum += Integer.parseInt(columns[j])",
"sum",
"Integer.parseInt(columns[j])",
"Integer.parseInt",
"Integer",
"columns[j]",
"columns",
"j",
"builder.append(columns[j])\n .append(\" \")",
"builder.append(columns[j])\n .append",
"builder.append(columns[j])",
"builder.append",
"builder",
"columns[j]",
"columns",
"j",
"\" \"",
"total[j] += Integer.parseInt(columns[j])",
"total[j]",
"total",
"j",
"Integer.parseInt(columns[j])",
"Integer.parseInt",
"Integer",
"columns[j]",
"columns",
"j",
"builder.append(sum)\n .append(\"\\n\")",
"builder.append(sum)\n .append",
"builder.append(sum)",
"builder.append",
"builder",
"sum",
"\"\\n\"",
"total[x] += sum",
"total[x]",
"total",
"x",
"sum",
"for (int i = 0; i < x + 1; i++) {\n if ( i != 0 ) {\n builder.append(\" \");\n }\n builder.append(total[i]);\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < x + 1",
"i",
"x + 1",
"x",
"1",
"i++",
"i++",
"i",
"{\n if ( i != 0 ) {\n builder.append(\" \");\n }\n builder.append(total[i]);\n }",
"{\n if ( i != 0 ) {\n builder.append(\" \");\n }\n builder.append(total[i]);\n }",
"if ( i != 0 ) {\n builder.append(\" \");\n }",
"i != 0",
"i",
"0",
"{\n builder.append(\" \");\n }",
"builder.append(\" \")",
"builder.append",
"builder",
"\" \"",
"builder.append(total[i])",
"builder.append",
"builder",
"total[i]",
"total",
"i",
"System.out.println(builder)",
"System.out.println",
"System.out",
"System",
"System.out",
"builder",
"String[] args",
"args",
"public class Main {\n\n public static void main(String[] args) throws IOException {\n BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));\n StringBuilder builder = new StringBuilder();\n String line;\n String[] columns;\n int x, y;\n line = reader.readLine();\n columns = line.split(\" \");\n y = Integer.parseInt(columns[0]);\n x = Integer.parseInt(columns[1]);\n int[] total = new int[x+1];\n\n for (int i = 0; i < y; i++) {\n int sum = 0;\n line = reader.readLine();\n columns = line.split(\" \");\n for (int j = 0; j < x; j++) {\n sum += Integer.parseInt(columns[j]);\n builder.append(columns[j])\n .append(\" \");\n total[j] += Integer.parseInt(columns[j]);\n }\n builder.append(sum)\n .append(\"\\n\");\n total[x] += sum;\n }\n for (int i = 0; i < x + 1; i++) {\n if ( i != 0 ) {\n builder.append(\" \");\n }\n builder.append(total[i]);\n }\n// builder.append(\"\\n\");\n// System.out.print(\"\\n\");\n System.out.println(builder);\n }\n}",
"public class Main {\n\n public static void main(String[] args) throws IOException {\n BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));\n StringBuilder builder = new StringBuilder();\n String line;\n String[] columns;\n int x, y;\n line = reader.readLine();\n columns = line.split(\" \");\n y = Integer.parseInt(columns[0]);\n x = Integer.parseInt(columns[1]);\n int[] total = new int[x+1];\n\n for (int i = 0; i < y; i++) {\n int sum = 0;\n line = reader.readLine();\n columns = line.split(\" \");\n for (int j = 0; j < x; j++) {\n sum += Integer.parseInt(columns[j]);\n builder.append(columns[j])\n .append(\" \");\n total[j] += Integer.parseInt(columns[j]);\n }\n builder.append(sum)\n .append(\"\\n\");\n total[x] += sum;\n }\n for (int i = 0; i < x + 1; i++) {\n if ( i != 0 ) {\n builder.append(\" \");\n }\n builder.append(total[i]);\n }\n// builder.append(\"\\n\");\n// System.out.print(\"\\n\");\n System.out.println(builder);\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));
StringBuilder builder = new StringBuilder();
String line;
String[] columns;
int x, y;
line = reader.readLine();
columns = line.split(" ");
y = Integer.parseInt(columns[0]);
x = Integer.parseInt(columns[1]);
int[] total = new int[x+1];
for (int i = 0; i < y; i++) {
int sum = 0;
line = reader.readLine();
columns = line.split(" ");
for (int j = 0; j < x; j++) {
sum += Integer.parseInt(columns[j]);
builder.append(columns[j])
.append(" ");
total[j] += Integer.parseInt(columns[j]);
}
builder.append(sum)
.append("\n");
total[x] += sum;
}
for (int i = 0; i < x + 1; i++) {
if ( i != 0 ) {
builder.append(" ");
}
builder.append(total[i]);
}
// builder.append("\n");
// System.out.print("\n");
System.out.println(builder);
}
} |
[
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,
41,
13,
20,
13,
13,
41,
13,
20,
13,
41,
13,
20,
13,
41,
13,
17,
4,
18,
13,
13,
17,
4,
18,
13,
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,
18,
18,
13,
13,
13,
4,
18,
13,
0,
18,
13,
13,
18,
18,
13,
13,
13,
0,
18,
13,
13,
18,
18,
13,
13,
13,
0,
13,
18,
18,
13,
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,
4,
18,
18,
13,
13,
2,
18,
18,
13,
13,
13,
17,
4,
18,
18,
13,
13,
18,
13,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
4,
18,
18,
13,
13,
2,
18,
13,
13,
17,
4,
18,
18,
13,
13,
13,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
189,
8
],
[
189,
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
],
[
11,
25
],
[
25,
26
],
[
25,
27
],
[
11,
30
],
[
30,
31
],
[
30,
32
],
[
11,
34
],
[
34,
35
],
[
34,
36
],
[
11,
38
],
[
38,
39
],
[
38,
40
],
[
11,
41
],
[
41,
42
],
[
42,
43
],
[
41,
44
],
[
41,
45
],
[
11,
46
],
[
46,
47
],
[
47,
48
],
[
46,
49
],
[
46,
50
],
[
11,
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
],
[
78,
82
],
[
77,
83
],
[
83,
84
],
[
84,
85
],
[
76,
86
],
[
86,
87
],
[
87,
88
],
[
87,
89
],
[
86,
90
],
[
90,
91
],
[
91,
92
],
[
91,
93
],
[
90,
94
],
[
76,
95
],
[
95,
96
],
[
96,
97
],
[
96,
98
],
[
95,
99
],
[
99,
100
],
[
100,
101
],
[
100,
102
],
[
99,
103
],
[
76,
104
],
[
104,
105
],
[
104,
106
],
[
106,
107
],
[
107,
108
],
[
107,
109
],
[
106,
110
],
[
11,
111
],
[
111,
112
],
[
112,
113
],
[
113,
114
],
[
113,
115
],
[
111,
116
],
[
116,
117
],
[
116,
118
],
[
111,
119
],
[
119,
120
],
[
120,
121
],
[
111,
122
],
[
123,
123
],
[
123,
124
],
[
124,
125
],
[
125,
126
],
[
126,
127
],
[
126,
128
],
[
124,
129
],
[
129,
130
],
[
129,
131
],
[
124,
132
],
[
132,
133
],
[
133,
134
],
[
124,
135
],
[
136,
136
],
[
136,
137
],
[
137,
138
],
[
138,
139
],
[
139,
140
],
[
139,
141
],
[
137,
142
],
[
142,
143
],
[
143,
144
],
[
144,
145
],
[
144,
146
],
[
143,
147
],
[
142,
148
],
[
123,
149
],
[
149,
150
],
[
150,
151
],
[
151,
152
],
[
151,
153
],
[
149,
154
],
[
154,
155
],
[
154,
156
],
[
11,
157
],
[
157,
158
],
[
158,
159
],
[
159,
160
],
[
159,
161
],
[
157,
162
],
[
162,
163
],
[
162,
164
],
[
157,
165
],
[
165,
166
],
[
166,
167
],
[
157,
168
],
[
169,
169
],
[
169,
170
],
[
170,
171
],
[
171,
172
],
[
172,
173
],
[
172,
174
],
[
170,
175
],
[
175,
176
],
[
176,
177
],
[
176,
178
],
[
175,
179
],
[
11,
180
],
[
180,
181
],
[
181,
182
],
[
182,
183
],
[
182,
184
],
[
180,
185
],
[
9,
186
],
[
186,
187
],
[
0,
188
],
[
188,
189
],
[
188,
190
]
] | [
"\nimport java.util.Arrays;\nimport java.util.Scanner;\n\npublic class Main {\n\tpublic static void main(String[] args)\n\t{\n\t\tScanner stdIn = new Scanner(System.in);\n\t\tint r = stdIn.nextInt();\n\t\tint c = stdIn.nextInt();\n\t\tint[][] number = new int[r][c];\n\t\tint[] count_x = new int[r];\n\t\tint[] count_y = new int[c];\n\t\tint count = 0;\n\t\t\n\t\tArrays.fill(count_x,0);\n\t\tArrays.fill(count_y,0);\n\t\t\n\t\tfor(int i=0;i<r;i++)\n\t\t{\n\t\t\tfor(int j=0;j<c;j++)\n\t\t\t{\n\t\t\t\tnumber[i][j] = stdIn.nextInt();\n\t\t\t\tcount_x[i]+=number[i][j];\n\t\t\t\tcount_y[j]+=number[i][j];\n\t\t\t\tcount += number[i][j];\n\t\t\t}\n\t\t}\n\t\t\n\t\tfor(int i=0;i<r;i++)\n\t\t{\n\t\t\tfor(int j=0;j<c;j++)\n\t\t\t{\n\t\t\t\tSystem.out.print(number[i][j]+\" \");\n\t\t\t}\n\t\t\tSystem.out.println(count_x[i]);\n\t\t}\n\t\t\n\t\tfor(int i=0;i<c;i++)\n\t\t{\n\t\t\tSystem.out.print(count_y[i]+\" \");\n\t\t}\n\t\t\n\t\tSystem.out.println(count);\n\t\t\n\t}\n}",
"import java.util.Arrays;",
"Arrays",
"java.util",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n\tpublic static void main(String[] args)\n\t{\n\t\tScanner stdIn = new Scanner(System.in);\n\t\tint r = stdIn.nextInt();\n\t\tint c = stdIn.nextInt();\n\t\tint[][] number = new int[r][c];\n\t\tint[] count_x = new int[r];\n\t\tint[] count_y = new int[c];\n\t\tint count = 0;\n\t\t\n\t\tArrays.fill(count_x,0);\n\t\tArrays.fill(count_y,0);\n\t\t\n\t\tfor(int i=0;i<r;i++)\n\t\t{\n\t\t\tfor(int j=0;j<c;j++)\n\t\t\t{\n\t\t\t\tnumber[i][j] = stdIn.nextInt();\n\t\t\t\tcount_x[i]+=number[i][j];\n\t\t\t\tcount_y[j]+=number[i][j];\n\t\t\t\tcount += number[i][j];\n\t\t\t}\n\t\t}\n\t\t\n\t\tfor(int i=0;i<r;i++)\n\t\t{\n\t\t\tfor(int j=0;j<c;j++)\n\t\t\t{\n\t\t\t\tSystem.out.print(number[i][j]+\" \");\n\t\t\t}\n\t\t\tSystem.out.println(count_x[i]);\n\t\t}\n\t\t\n\t\tfor(int i=0;i<c;i++)\n\t\t{\n\t\t\tSystem.out.print(count_y[i]+\" \");\n\t\t}\n\t\t\n\t\tSystem.out.println(count);\n\t\t\n\t}\n}",
"Main",
"public static void main(String[] args)\n\t{\n\t\tScanner stdIn = new Scanner(System.in);\n\t\tint r = stdIn.nextInt();\n\t\tint c = stdIn.nextInt();\n\t\tint[][] number = new int[r][c];\n\t\tint[] count_x = new int[r];\n\t\tint[] count_y = new int[c];\n\t\tint count = 0;\n\t\t\n\t\tArrays.fill(count_x,0);\n\t\tArrays.fill(count_y,0);\n\t\t\n\t\tfor(int i=0;i<r;i++)\n\t\t{\n\t\t\tfor(int j=0;j<c;j++)\n\t\t\t{\n\t\t\t\tnumber[i][j] = stdIn.nextInt();\n\t\t\t\tcount_x[i]+=number[i][j];\n\t\t\t\tcount_y[j]+=number[i][j];\n\t\t\t\tcount += number[i][j];\n\t\t\t}\n\t\t}\n\t\t\n\t\tfor(int i=0;i<r;i++)\n\t\t{\n\t\t\tfor(int j=0;j<c;j++)\n\t\t\t{\n\t\t\t\tSystem.out.print(number[i][j]+\" \");\n\t\t\t}\n\t\t\tSystem.out.println(count_x[i]);\n\t\t}\n\t\t\n\t\tfor(int i=0;i<c;i++)\n\t\t{\n\t\t\tSystem.out.print(count_y[i]+\" \");\n\t\t}\n\t\t\n\t\tSystem.out.println(count);\n\t\t\n\t}",
"main",
"{\n\t\tScanner stdIn = new Scanner(System.in);\n\t\tint r = stdIn.nextInt();\n\t\tint c = stdIn.nextInt();\n\t\tint[][] number = new int[r][c];\n\t\tint[] count_x = new int[r];\n\t\tint[] count_y = new int[c];\n\t\tint count = 0;\n\t\t\n\t\tArrays.fill(count_x,0);\n\t\tArrays.fill(count_y,0);\n\t\t\n\t\tfor(int i=0;i<r;i++)\n\t\t{\n\t\t\tfor(int j=0;j<c;j++)\n\t\t\t{\n\t\t\t\tnumber[i][j] = stdIn.nextInt();\n\t\t\t\tcount_x[i]+=number[i][j];\n\t\t\t\tcount_y[j]+=number[i][j];\n\t\t\t\tcount += number[i][j];\n\t\t\t}\n\t\t}\n\t\t\n\t\tfor(int i=0;i<r;i++)\n\t\t{\n\t\t\tfor(int j=0;j<c;j++)\n\t\t\t{\n\t\t\t\tSystem.out.print(number[i][j]+\" \");\n\t\t\t}\n\t\t\tSystem.out.println(count_x[i]);\n\t\t}\n\t\t\n\t\tfor(int i=0;i<c;i++)\n\t\t{\n\t\t\tSystem.out.print(count_y[i]+\" \");\n\t\t}\n\t\t\n\t\tSystem.out.println(count);\n\t\t\n\t}",
"Scanner stdIn = new Scanner(System.in);",
"stdIn",
"new Scanner(System.in)",
"int r = stdIn.nextInt();",
"r",
"stdIn.nextInt()",
"stdIn.nextInt",
"stdIn",
"int c = stdIn.nextInt();",
"c",
"stdIn.nextInt()",
"stdIn.nextInt",
"stdIn",
"int[][] number = new int[r][c];",
"number",
"new int[r][c]",
"r",
"c",
"int[] count_x = new int[r];",
"count_x",
"new int[r]",
"r",
"int[] count_y = new int[c];",
"count_y",
"new int[c]",
"c",
"int count = 0;",
"count",
"0",
"Arrays.fill(count_x,0)",
"Arrays.fill",
"Arrays",
"count_x",
"0",
"Arrays.fill(count_y,0)",
"Arrays.fill",
"Arrays",
"count_y",
"0",
"for(int i=0;i<r;i++)\n\t\t{\n\t\t\tfor(int j=0;j<c;j++)\n\t\t\t{\n\t\t\t\tnumber[i][j] = stdIn.nextInt();\n\t\t\t\tcount_x[i]+=number[i][j];\n\t\t\t\tcount_y[j]+=number[i][j];\n\t\t\t\tcount += number[i][j];\n\t\t\t}\n\t\t}",
"int i=0;",
"int i=0;",
"i",
"0",
"i<r",
"i",
"r",
"i++",
"i++",
"i",
"{\n\t\t\tfor(int j=0;j<c;j++)\n\t\t\t{\n\t\t\t\tnumber[i][j] = stdIn.nextInt();\n\t\t\t\tcount_x[i]+=number[i][j];\n\t\t\t\tcount_y[j]+=number[i][j];\n\t\t\t\tcount += number[i][j];\n\t\t\t}\n\t\t}",
"{\n\t\t\tfor(int j=0;j<c;j++)\n\t\t\t{\n\t\t\t\tnumber[i][j] = stdIn.nextInt();\n\t\t\t\tcount_x[i]+=number[i][j];\n\t\t\t\tcount_y[j]+=number[i][j];\n\t\t\t\tcount += number[i][j];\n\t\t\t}\n\t\t}",
"for(int j=0;j<c;j++)\n\t\t\t{\n\t\t\t\tnumber[i][j] = stdIn.nextInt();\n\t\t\t\tcount_x[i]+=number[i][j];\n\t\t\t\tcount_y[j]+=number[i][j];\n\t\t\t\tcount += number[i][j];\n\t\t\t}",
"int j=0;",
"int j=0;",
"j",
"0",
"j<c",
"j",
"c",
"j++",
"j++",
"j",
"{\n\t\t\t\tnumber[i][j] = stdIn.nextInt();\n\t\t\t\tcount_x[i]+=number[i][j];\n\t\t\t\tcount_y[j]+=number[i][j];\n\t\t\t\tcount += number[i][j];\n\t\t\t}",
"{\n\t\t\t\tnumber[i][j] = stdIn.nextInt();\n\t\t\t\tcount_x[i]+=number[i][j];\n\t\t\t\tcount_y[j]+=number[i][j];\n\t\t\t\tcount += number[i][j];\n\t\t\t}",
"number[i][j] = stdIn.nextInt()",
"number[i][j]",
"number[i]",
"number",
"i",
"j",
"stdIn.nextInt()",
"stdIn.nextInt",
"stdIn",
"count_x[i]+=number[i][j]",
"count_x[i]",
"count_x",
"i",
"number[i][j]",
"number[i]",
"number",
"i",
"j",
"count_y[j]+=number[i][j]",
"count_y[j]",
"count_y",
"j",
"number[i][j]",
"number[i]",
"number",
"i",
"j",
"count += number[i][j]",
"count",
"number[i][j]",
"number[i]",
"number",
"i",
"j",
"for(int i=0;i<r;i++)\n\t\t{\n\t\t\tfor(int j=0;j<c;j++)\n\t\t\t{\n\t\t\t\tSystem.out.print(number[i][j]+\" \");\n\t\t\t}\n\t\t\tSystem.out.println(count_x[i]);\n\t\t}",
"int i=0;",
"int i=0;",
"i",
"0",
"i<r",
"i",
"r",
"i++",
"i++",
"i",
"{\n\t\t\tfor(int j=0;j<c;j++)\n\t\t\t{\n\t\t\t\tSystem.out.print(number[i][j]+\" \");\n\t\t\t}\n\t\t\tSystem.out.println(count_x[i]);\n\t\t}",
"{\n\t\t\tfor(int j=0;j<c;j++)\n\t\t\t{\n\t\t\t\tSystem.out.print(number[i][j]+\" \");\n\t\t\t}\n\t\t\tSystem.out.println(count_x[i]);\n\t\t}",
"for(int j=0;j<c;j++)\n\t\t\t{\n\t\t\t\tSystem.out.print(number[i][j]+\" \");\n\t\t\t}",
"int j=0;",
"int j=0;",
"j",
"0",
"j<c",
"j",
"c",
"j++",
"j++",
"j",
"{\n\t\t\t\tSystem.out.print(number[i][j]+\" \");\n\t\t\t}",
"{\n\t\t\t\tSystem.out.print(number[i][j]+\" \");\n\t\t\t}",
"System.out.print(number[i][j]+\" \")",
"System.out.print",
"System.out",
"System",
"System.out",
"number[i][j]+\" \"",
"number[i][j]",
"number[i]",
"number",
"i",
"j",
"\" \"",
"System.out.println(count_x[i])",
"System.out.println",
"System.out",
"System",
"System.out",
"count_x[i]",
"count_x",
"i",
"for(int i=0;i<c;i++)\n\t\t{\n\t\t\tSystem.out.print(count_y[i]+\" \");\n\t\t}",
"int i=0;",
"int i=0;",
"i",
"0",
"i<c",
"i",
"c",
"i++",
"i++",
"i",
"{\n\t\t\tSystem.out.print(count_y[i]+\" \");\n\t\t}",
"{\n\t\t\tSystem.out.print(count_y[i]+\" \");\n\t\t}",
"System.out.print(count_y[i]+\" \")",
"System.out.print",
"System.out",
"System",
"System.out",
"count_y[i]+\" \"",
"count_y[i]",
"count_y",
"i",
"\" \"",
"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{\n\t\tScanner stdIn = new Scanner(System.in);\n\t\tint r = stdIn.nextInt();\n\t\tint c = stdIn.nextInt();\n\t\tint[][] number = new int[r][c];\n\t\tint[] count_x = new int[r];\n\t\tint[] count_y = new int[c];\n\t\tint count = 0;\n\t\t\n\t\tArrays.fill(count_x,0);\n\t\tArrays.fill(count_y,0);\n\t\t\n\t\tfor(int i=0;i<r;i++)\n\t\t{\n\t\t\tfor(int j=0;j<c;j++)\n\t\t\t{\n\t\t\t\tnumber[i][j] = stdIn.nextInt();\n\t\t\t\tcount_x[i]+=number[i][j];\n\t\t\t\tcount_y[j]+=number[i][j];\n\t\t\t\tcount += number[i][j];\n\t\t\t}\n\t\t}\n\t\t\n\t\tfor(int i=0;i<r;i++)\n\t\t{\n\t\t\tfor(int j=0;j<c;j++)\n\t\t\t{\n\t\t\t\tSystem.out.print(number[i][j]+\" \");\n\t\t\t}\n\t\t\tSystem.out.println(count_x[i]);\n\t\t}\n\t\t\n\t\tfor(int i=0;i<c;i++)\n\t\t{\n\t\t\tSystem.out.print(count_y[i]+\" \");\n\t\t}\n\t\t\n\t\tSystem.out.println(count);\n\t\t\n\t}\n}",
"public class Main {\n\tpublic static void main(String[] args)\n\t{\n\t\tScanner stdIn = new Scanner(System.in);\n\t\tint r = stdIn.nextInt();\n\t\tint c = stdIn.nextInt();\n\t\tint[][] number = new int[r][c];\n\t\tint[] count_x = new int[r];\n\t\tint[] count_y = new int[c];\n\t\tint count = 0;\n\t\t\n\t\tArrays.fill(count_x,0);\n\t\tArrays.fill(count_y,0);\n\t\t\n\t\tfor(int i=0;i<r;i++)\n\t\t{\n\t\t\tfor(int j=0;j<c;j++)\n\t\t\t{\n\t\t\t\tnumber[i][j] = stdIn.nextInt();\n\t\t\t\tcount_x[i]+=number[i][j];\n\t\t\t\tcount_y[j]+=number[i][j];\n\t\t\t\tcount += number[i][j];\n\t\t\t}\n\t\t}\n\t\t\n\t\tfor(int i=0;i<r;i++)\n\t\t{\n\t\t\tfor(int j=0;j<c;j++)\n\t\t\t{\n\t\t\t\tSystem.out.print(number[i][j]+\" \");\n\t\t\t}\n\t\t\tSystem.out.println(count_x[i]);\n\t\t}\n\t\t\n\t\tfor(int i=0;i<c;i++)\n\t\t{\n\t\t\tSystem.out.print(count_y[i]+\" \");\n\t\t}\n\t\t\n\t\tSystem.out.println(count);\n\t\t\n\t}\n}",
"Main"
] |
import java.util.Arrays;
import java.util.Scanner;
public class Main {
public static void main(String[] args)
{
Scanner stdIn = new Scanner(System.in);
int r = stdIn.nextInt();
int c = stdIn.nextInt();
int[][] number = new int[r][c];
int[] count_x = new int[r];
int[] count_y = new int[c];
int count = 0;
Arrays.fill(count_x,0);
Arrays.fill(count_y,0);
for(int i=0;i<r;i++)
{
for(int j=0;j<c;j++)
{
number[i][j] = stdIn.nextInt();
count_x[i]+=number[i][j];
count_y[j]+=number[i][j];
count += number[i][j];
}
}
for(int i=0;i<r;i++)
{
for(int j=0;j<c;j++)
{
System.out.print(number[i][j]+" ");
}
System.out.println(count_x[i]);
}
for(int i=0;i<c;i++)
{
System.out.print(count_y[i]+" ");
}
System.out.println(count);
}
} |
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
41,
13,
20,
12,
13,
30,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
41,
13,
20,
2,
13,
17,
2,
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,
18,
18,
13,
13,
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,
0,
18,
18,
13,
13,
13,
18,
18,
13,
13,
13,
11,
1,
41,
13,
17,
2,
13,
2,
13,
17,
1,
40,
13,
30,
30,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
18,
18,
13,
13,
13,
18,
18,
13,
13,
13,
11,
1,
41,
13,
17,
2,
13,
2,
13,
17,
1,
40,
13,
30,
30,
41,
13,
20,
11,
1,
41,
13,
17,
2,
13,
2,
13,
17,
1,
40,
13,
30,
30,
4,
18,
4,
18,
13,
18,
18,
13,
13,
13,
17,
4,
18,
13,
2,
4,
18,
13,
17,
4,
18,
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
],
[
13,
14
],
[
13,
15
],
[
0,
16
],
[
218,
17
],
[
218,
18
],
[
18,
19
],
[
18,
20
],
[
218,
21
],
[
21,
22
],
[
21,
23
],
[
23,
24
],
[
24,
25
],
[
24,
26
],
[
26,
27
],
[
27,
28
],
[
23,
29
],
[
29,
30
],
[
29,
31
],
[
31,
32
],
[
32,
33
],
[
23,
34
],
[
34,
35
],
[
34,
36
],
[
37,
38
],
[
37,
39
],
[
40,
41
],
[
40,
42
],
[
23,
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
],
[
70,
74
],
[
69,
75
],
[
75,
76
],
[
76,
77
],
[
23,
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
],
[
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
],
[
105,
109
],
[
104,
110
],
[
110,
111
],
[
111,
112
],
[
111,
113
],
[
110,
114
],
[
23,
115
],
[
115,
116
],
[
116,
117
],
[
117,
118
],
[
117,
119
],
[
115,
120
],
[
120,
121
],
[
120,
122
],
[
122,
123
],
[
122,
124
],
[
115,
125
],
[
125,
126
],
[
126,
127
],
[
115,
128
],
[
129,
129
],
[
129,
130
],
[
130,
131
],
[
131,
132
],
[
132,
133
],
[
132,
134
],
[
130,
135
],
[
135,
136
],
[
135,
137
],
[
130,
138
],
[
138,
139
],
[
139,
140
],
[
130,
141
],
[
142,
142
],
[
142,
143
],
[
143,
144
],
[
144,
145
],
[
145,
146
],
[
145,
147
],
[
144,
148
],
[
143,
149
],
[
149,
150
],
[
150,
151
],
[
150,
152
],
[
149,
153
],
[
23,
154
],
[
154,
155
],
[
155,
156
],
[
156,
157
],
[
156,
158
],
[
154,
159
],
[
159,
160
],
[
159,
161
],
[
161,
162
],
[
161,
163
],
[
154,
164
],
[
164,
165
],
[
165,
166
],
[
154,
167
],
[
168,
168
],
[
168,
169
],
[
169,
170
],
[
169,
171
],
[
168,
172
],
[
172,
173
],
[
173,
174
],
[
174,
175
],
[
174,
176
],
[
172,
177
],
[
177,
178
],
[
177,
179
],
[
179,
180
],
[
179,
181
],
[
172,
182
],
[
182,
183
],
[
183,
184
],
[
172,
185
],
[
186,
186
],
[
186,
187
],
[
187,
188
],
[
188,
189
],
[
189,
190
],
[
190,
191
],
[
189,
192
],
[
192,
193
],
[
193,
194
],
[
193,
195
],
[
192,
196
],
[
187,
197
],
[
168,
198
],
[
198,
199
],
[
199,
200
],
[
198,
201
],
[
201,
202
],
[
202,
203
],
[
203,
204
],
[
201,
205
],
[
198,
206
],
[
206,
207
],
[
207,
208
],
[
168,
209
],
[
209,
210
],
[
210,
211
],
[
211,
212
],
[
211,
213
],
[
209,
214
],
[
21,
215
],
[
215,
216
],
[
0,
217
],
[
217,
218
],
[
217,
219
]
] | [
"import java.util.HashMap;\nimport java.util.ArrayList;\nimport java.util.Scanner;\nimport java.util.regex.Pattern;\nimport java.util.Collections;\n\npublic class Main {\n public static Scanner sc = new Scanner(System.in);\n public static void main(String[] args) throws Exception {\n int r = sc.nextInt();\n int c = sc.nextInt();\n int[][] ary = new int[r+1][c+1];\n \n for (int i = 0; i < r; i++) {\n for (int j = 0; j < c; j++){\n ary[i][j] = sc.nextInt();\n }\n }\n \n for (int i = 0; i < r; i++) {\n for (int j = 0; j < c; j++) {\n ary[i][c] += ary[i][j];\n }\n }\n\n for (int i = 0; i < c+1; i++) {\n for (int j = 0; j < r; j++) {\n ary[r][i] += ary[j][i];\n }\n }\n \n for (int i = 0; i < r+1; i++) {\n StringBuilder sb = new StringBuilder();\n for (int j = 0; j < c+1; j++) {\n sb.append(ary[i][j]).append(\" \");\n }\n sb.delete(sb.length()-1, sb.length());\n System.out.println(sb);\n }\n\n }\n}",
"import java.util.HashMap;",
"HashMap",
"java.util",
"import java.util.ArrayList;",
"ArrayList",
"java.util",
"import java.util.Scanner;",
"Scanner",
"java.util",
"import java.util.regex.Pattern;",
"Pattern",
"java.util.regex",
"import java.util.Collections;",
"Collections",
"java.util",
"public class Main {\n public static Scanner sc = new Scanner(System.in);\n public static void main(String[] args) throws Exception {\n int r = sc.nextInt();\n int c = sc.nextInt();\n int[][] ary = new int[r+1][c+1];\n \n for (int i = 0; i < r; i++) {\n for (int j = 0; j < c; j++){\n ary[i][j] = sc.nextInt();\n }\n }\n \n for (int i = 0; i < r; i++) {\n for (int j = 0; j < c; j++) {\n ary[i][c] += ary[i][j];\n }\n }\n\n for (int i = 0; i < c+1; i++) {\n for (int j = 0; j < r; j++) {\n ary[r][i] += ary[j][i];\n }\n }\n \n for (int i = 0; i < r+1; i++) {\n StringBuilder sb = new StringBuilder();\n for (int j = 0; j < c+1; j++) {\n sb.append(ary[i][j]).append(\" \");\n }\n sb.delete(sb.length()-1, sb.length());\n System.out.println(sb);\n }\n\n }\n}",
"Main",
"public static Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"public static void main(String[] args) throws Exception {\n int r = sc.nextInt();\n int c = sc.nextInt();\n int[][] ary = new int[r+1][c+1];\n \n for (int i = 0; i < r; i++) {\n for (int j = 0; j < c; j++){\n ary[i][j] = sc.nextInt();\n }\n }\n \n for (int i = 0; i < r; i++) {\n for (int j = 0; j < c; j++) {\n ary[i][c] += ary[i][j];\n }\n }\n\n for (int i = 0; i < c+1; i++) {\n for (int j = 0; j < r; j++) {\n ary[r][i] += ary[j][i];\n }\n }\n \n for (int i = 0; i < r+1; i++) {\n StringBuilder sb = new StringBuilder();\n for (int j = 0; j < c+1; j++) {\n sb.append(ary[i][j]).append(\" \");\n }\n sb.delete(sb.length()-1, sb.length());\n System.out.println(sb);\n }\n\n }",
"main",
"{\n int r = sc.nextInt();\n int c = sc.nextInt();\n int[][] ary = new int[r+1][c+1];\n \n for (int i = 0; i < r; i++) {\n for (int j = 0; j < c; j++){\n ary[i][j] = sc.nextInt();\n }\n }\n \n for (int i = 0; i < r; i++) {\n for (int j = 0; j < c; j++) {\n ary[i][c] += ary[i][j];\n }\n }\n\n for (int i = 0; i < c+1; i++) {\n for (int j = 0; j < r; j++) {\n ary[r][i] += ary[j][i];\n }\n }\n \n for (int i = 0; i < r+1; i++) {\n StringBuilder sb = new StringBuilder();\n for (int j = 0; j < c+1; j++) {\n sb.append(ary[i][j]).append(\" \");\n }\n sb.delete(sb.length()-1, sb.length());\n System.out.println(sb);\n }\n\n }",
"int r = sc.nextInt();",
"r",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int c = sc.nextInt();",
"c",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int[][] ary = new int[r+1][c+1];",
"ary",
"new int[r+1][c+1]",
"r+1",
"r",
"1",
"c+1",
"c",
"1",
"for (int i = 0; i < r; i++) {\n for (int j = 0; j < c; j++){\n ary[i][j] = sc.nextInt();\n }\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < r",
"i",
"r",
"i++",
"i++",
"i",
"{\n for (int j = 0; j < c; j++){\n ary[i][j] = sc.nextInt();\n }\n }",
"{\n for (int j = 0; j < c; j++){\n ary[i][j] = sc.nextInt();\n }\n }",
"for (int j = 0; j < c; j++){\n ary[i][j] = sc.nextInt();\n }",
"int j = 0;",
"int j = 0;",
"j",
"0",
"j < c",
"j",
"c",
"j++",
"j++",
"j",
"{\n ary[i][j] = sc.nextInt();\n }",
"{\n ary[i][j] = sc.nextInt();\n }",
"ary[i][j] = sc.nextInt()",
"ary[i][j]",
"ary[i]",
"ary",
"i",
"j",
"sc.nextInt()",
"sc.nextInt",
"sc",
"for (int i = 0; i < r; i++) {\n for (int j = 0; j < c; j++) {\n ary[i][c] += ary[i][j];\n }\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < r",
"i",
"r",
"i++",
"i++",
"i",
"{\n for (int j = 0; j < c; j++) {\n ary[i][c] += ary[i][j];\n }\n }",
"{\n for (int j = 0; j < c; j++) {\n ary[i][c] += ary[i][j];\n }\n }",
"for (int j = 0; j < c; j++) {\n ary[i][c] += ary[i][j];\n }",
"int j = 0;",
"int j = 0;",
"j",
"0",
"j < c",
"j",
"c",
"j++",
"j++",
"j",
"{\n ary[i][c] += ary[i][j];\n }",
"{\n ary[i][c] += ary[i][j];\n }",
"ary[i][c] += ary[i][j]",
"ary[i][c]",
"ary[i]",
"ary",
"i",
"c",
"ary[i][j]",
"ary[i]",
"ary",
"i",
"j",
"for (int i = 0; i < c+1; i++) {\n for (int j = 0; j < r; j++) {\n ary[r][i] += ary[j][i];\n }\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < c+1",
"i",
"c+1",
"c",
"1",
"i++",
"i++",
"i",
"{\n for (int j = 0; j < r; j++) {\n ary[r][i] += ary[j][i];\n }\n }",
"{\n for (int j = 0; j < r; j++) {\n ary[r][i] += ary[j][i];\n }\n }",
"for (int j = 0; j < r; j++) {\n ary[r][i] += ary[j][i];\n }",
"int j = 0;",
"int j = 0;",
"j",
"0",
"j < r",
"j",
"r",
"j++",
"j++",
"j",
"{\n ary[r][i] += ary[j][i];\n }",
"{\n ary[r][i] += ary[j][i];\n }",
"ary[r][i] += ary[j][i]",
"ary[r][i]",
"ary[r]",
"ary",
"r",
"i",
"ary[j][i]",
"ary[j]",
"ary",
"j",
"i",
"for (int i = 0; i < r+1; i++) {\n StringBuilder sb = new StringBuilder();\n for (int j = 0; j < c+1; j++) {\n sb.append(ary[i][j]).append(\" \");\n }\n sb.delete(sb.length()-1, sb.length());\n System.out.println(sb);\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < r+1",
"i",
"r+1",
"r",
"1",
"i++",
"i++",
"i",
"{\n StringBuilder sb = new StringBuilder();\n for (int j = 0; j < c+1; j++) {\n sb.append(ary[i][j]).append(\" \");\n }\n sb.delete(sb.length()-1, sb.length());\n System.out.println(sb);\n }",
"{\n StringBuilder sb = new StringBuilder();\n for (int j = 0; j < c+1; j++) {\n sb.append(ary[i][j]).append(\" \");\n }\n sb.delete(sb.length()-1, sb.length());\n System.out.println(sb);\n }",
"StringBuilder sb = new StringBuilder();",
"sb",
"new StringBuilder()",
"for (int j = 0; j < c+1; j++) {\n sb.append(ary[i][j]).append(\" \");\n }",
"int j = 0;",
"int j = 0;",
"j",
"0",
"j < c+1",
"j",
"c+1",
"c",
"1",
"j++",
"j++",
"j",
"{\n sb.append(ary[i][j]).append(\" \");\n }",
"{\n sb.append(ary[i][j]).append(\" \");\n }",
"sb.append(ary[i][j]).append(\" \")",
"sb.append(ary[i][j]).append",
"sb.append(ary[i][j])",
"sb.append",
"sb",
"ary[i][j]",
"ary[i]",
"ary",
"i",
"j",
"\" \"",
"sb.delete(sb.length()-1, sb.length())",
"sb.delete",
"sb",
"sb.length()-1",
"sb.length()",
"sb.length",
"sb",
"1",
"sb.length()",
"sb.length",
"sb",
"System.out.println(sb)",
"System.out.println",
"System.out",
"System",
"System.out",
"sb",
"String[] args",
"args",
"public class Main {\n public static Scanner sc = new Scanner(System.in);\n public static void main(String[] args) throws Exception {\n int r = sc.nextInt();\n int c = sc.nextInt();\n int[][] ary = new int[r+1][c+1];\n \n for (int i = 0; i < r; i++) {\n for (int j = 0; j < c; j++){\n ary[i][j] = sc.nextInt();\n }\n }\n \n for (int i = 0; i < r; i++) {\n for (int j = 0; j < c; j++) {\n ary[i][c] += ary[i][j];\n }\n }\n\n for (int i = 0; i < c+1; i++) {\n for (int j = 0; j < r; j++) {\n ary[r][i] += ary[j][i];\n }\n }\n \n for (int i = 0; i < r+1; i++) {\n StringBuilder sb = new StringBuilder();\n for (int j = 0; j < c+1; j++) {\n sb.append(ary[i][j]).append(\" \");\n }\n sb.delete(sb.length()-1, sb.length());\n System.out.println(sb);\n }\n\n }\n}",
"public class Main {\n public static Scanner sc = new Scanner(System.in);\n public static void main(String[] args) throws Exception {\n int r = sc.nextInt();\n int c = sc.nextInt();\n int[][] ary = new int[r+1][c+1];\n \n for (int i = 0; i < r; i++) {\n for (int j = 0; j < c; j++){\n ary[i][j] = sc.nextInt();\n }\n }\n \n for (int i = 0; i < r; i++) {\n for (int j = 0; j < c; j++) {\n ary[i][c] += ary[i][j];\n }\n }\n\n for (int i = 0; i < c+1; i++) {\n for (int j = 0; j < r; j++) {\n ary[r][i] += ary[j][i];\n }\n }\n \n for (int i = 0; i < r+1; i++) {\n StringBuilder sb = new StringBuilder();\n for (int j = 0; j < c+1; j++) {\n sb.append(ary[i][j]).append(\" \");\n }\n sb.delete(sb.length()-1, sb.length());\n System.out.println(sb);\n }\n\n }\n}",
"Main"
] | import java.util.HashMap;
import java.util.ArrayList;
import java.util.Scanner;
import java.util.regex.Pattern;
import java.util.Collections;
public class Main {
public static Scanner sc = new Scanner(System.in);
public static void main(String[] args) throws Exception {
int r = sc.nextInt();
int c = sc.nextInt();
int[][] ary = new int[r+1][c+1];
for (int i = 0; i < r; i++) {
for (int j = 0; j < c; j++){
ary[i][j] = sc.nextInt();
}
}
for (int i = 0; i < r; i++) {
for (int j = 0; j < c; j++) {
ary[i][c] += ary[i][j];
}
}
for (int i = 0; i < c+1; i++) {
for (int j = 0; j < r; j++) {
ary[r][i] += ary[j][i];
}
}
for (int i = 0; i < r+1; i++) {
StringBuilder sb = new StringBuilder();
for (int j = 0; j < c+1; j++) {
sb.append(ary[i][j]).append(" ");
}
sb.delete(sb.length()-1, sb.length());
System.out.println(sb);
}
}
} |
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
41,
13,
20,
13,
13,
41,
13,
20,
13,
13,
41,
13,
41,
13,
41,
13,
41,
13,
20,
13,
13,
11,
1,
0,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
11,
1,
0,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
18,
18,
13,
13,
13,
4,
18,
13,
11,
1,
0,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
11,
1,
0,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
18,
18,
13,
13,
13,
4,
18,
13,
4,
18,
13,
11,
1,
0,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
11,
1,
0,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
11,
1,
0,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
18,
18,
13,
13,
13,
2,
18,
18,
13,
13,
13,
18,
18,
13,
13,
13,
11,
1,
0,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
11,
1,
0,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
4,
18,
18,
13,
13,
18,
18,
13,
13,
13,
14,
2,
13,
2,
13,
17,
30,
4,
18,
18,
13,
13,
17,
4,
18,
18,
13,
13,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
234,
5
],
[
234,
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
],
[
19,
20
],
[
20,
21
],
[
8,
22
],
[
22,
23
],
[
22,
24
],
[
24,
25
],
[
25,
26
],
[
8,
27
],
[
27,
28
],
[
27,
29
],
[
8,
32
],
[
32,
33
],
[
32,
34
],
[
8,
37
],
[
37,
38
],
[
8,
39
],
[
39,
40
],
[
8,
41
],
[
41,
42
],
[
8,
43
],
[
43,
44
],
[
43,
45
],
[
8,
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
],
[
75,
79
],
[
74,
80
],
[
80,
81
],
[
81,
82
],
[
8,
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
],
[
97,
98
],
[
98,
99
],
[
98,
100
],
[
96,
101
],
[
101,
102
],
[
101,
103
],
[
96,
104
],
[
104,
105
],
[
105,
106
],
[
96,
107
],
[
108,
108
],
[
108,
109
],
[
109,
110
],
[
110,
111
],
[
111,
112
],
[
111,
113
],
[
110,
114
],
[
109,
115
],
[
115,
116
],
[
116,
117
],
[
8,
118
],
[
118,
119
],
[
119,
120
],
[
8,
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
],
[
135,
136
],
[
136,
137
],
[
136,
138
],
[
134,
139
],
[
139,
140
],
[
139,
141
],
[
134,
142
],
[
142,
143
],
[
143,
144
],
[
134,
145
],
[
146,
146
],
[
146,
147
],
[
147,
148
],
[
148,
149
],
[
149,
150
],
[
149,
151
],
[
147,
152
],
[
152,
153
],
[
152,
154
],
[
147,
155
],
[
155,
156
],
[
156,
157
],
[
147,
158
],
[
159,
159
],
[
159,
160
],
[
160,
161
],
[
161,
162
],
[
162,
163
],
[
162,
164
],
[
161,
165
],
[
160,
166
],
[
166,
167
],
[
167,
168
],
[
168,
169
],
[
168,
170
],
[
167,
171
],
[
166,
172
],
[
172,
173
],
[
173,
174
],
[
173,
175
],
[
172,
176
],
[
8,
177
],
[
177,
178
],
[
178,
179
],
[
179,
180
],
[
179,
181
],
[
177,
182
],
[
182,
183
],
[
182,
184
],
[
177,
185
],
[
185,
186
],
[
186,
187
],
[
177,
188
],
[
189,
189
],
[
189,
190
],
[
190,
191
],
[
191,
192
],
[
192,
193
],
[
192,
194
],
[
190,
195
],
[
195,
196
],
[
195,
197
],
[
190,
198
],
[
198,
199
],
[
199,
200
],
[
190,
201
],
[
202,
202
],
[
202,
203
],
[
203,
204
],
[
204,
205
],
[
205,
206
],
[
205,
207
],
[
203,
208
],
[
208,
209
],
[
209,
210
],
[
209,
211
],
[
208,
212
],
[
202,
213
],
[
213,
214
],
[
214,
215
],
[
214,
216
],
[
216,
217
],
[
216,
218
],
[
213,
219
],
[
219,
220
],
[
220,
221
],
[
221,
222
],
[
222,
223
],
[
222,
224
],
[
220,
225
],
[
189,
226
],
[
226,
227
],
[
227,
228
],
[
228,
229
],
[
228,
230
],
[
6,
231
],
[
231,
232
],
[
0,
233
],
[
233,
234
],
[
233,
235
]
] | [
"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 n = sc.nextInt();\n\t\tint m = sc.nextInt();\n\t\tint l = sc.nextInt();\n\t\tint vecnm[][] = new int[n][m];\n\t\tint vecml[][] = new int[m][l];\n\t\tint i,j,k;\n\t\tlong veca[][] = new long[n][l];\n\t\t\n\t\tfor(i=0;i<n;i++){\n\t\t\tfor(j=0;j<m;j++){\n\t\t\t\tvecnm[i][j] = sc.nextInt();\n\t\t\t}\n\t\t}\n\t\tfor(i=0;i<m;i++){\n\t\t\tfor(j=0;j<l;j++){\n\t\t\t\tvecml[i][j] = sc.nextInt();\n\t\t\t}\n\t\t\t\n\t\t}\n\t\tsc.close();\n\t\t\n\t\tfor(i=0;i<n;i++){\n\t\t\tfor(j=0;j<l;j++){\n\t\t\t\tfor(k=0;k<m;k++){\n\t\t\t\t\tveca[i][j]+=vecnm[i][k]*vecml[k][j];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tfor(i=0;i<n;i++){\n\t\t\tfor(j=0;j<l;j++){\n\t\t\t\tSystem.out.print(veca[i][j]);\n\t\t\t\tif(j!=(l-1)){\n\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t}\n\t\t\t}\n\t\t\t//if(i!=(n-1)){\n\t\t\t\tSystem.out.println();\n\t\t\t//}\n\t\t}\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 n = sc.nextInt();\n\t\tint m = sc.nextInt();\n\t\tint l = sc.nextInt();\n\t\tint vecnm[][] = new int[n][m];\n\t\tint vecml[][] = new int[m][l];\n\t\tint i,j,k;\n\t\tlong veca[][] = new long[n][l];\n\t\t\n\t\tfor(i=0;i<n;i++){\n\t\t\tfor(j=0;j<m;j++){\n\t\t\t\tvecnm[i][j] = sc.nextInt();\n\t\t\t}\n\t\t}\n\t\tfor(i=0;i<m;i++){\n\t\t\tfor(j=0;j<l;j++){\n\t\t\t\tvecml[i][j] = sc.nextInt();\n\t\t\t}\n\t\t\t\n\t\t}\n\t\tsc.close();\n\t\t\n\t\tfor(i=0;i<n;i++){\n\t\t\tfor(j=0;j<l;j++){\n\t\t\t\tfor(k=0;k<m;k++){\n\t\t\t\t\tveca[i][j]+=vecnm[i][k]*vecml[k][j];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tfor(i=0;i<n;i++){\n\t\t\tfor(j=0;j<l;j++){\n\t\t\t\tSystem.out.print(veca[i][j]);\n\t\t\t\tif(j!=(l-1)){\n\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t}\n\t\t\t}\n\t\t\t//if(i!=(n-1)){\n\t\t\t\tSystem.out.println();\n\t\t\t//}\n\t\t}\n\t}\n\n}",
"Main",
"public static void main(String[] args) {\n\n\t\tScanner sc = new Scanner(System.in);\n\t\tint n = sc.nextInt();\n\t\tint m = sc.nextInt();\n\t\tint l = sc.nextInt();\n\t\tint vecnm[][] = new int[n][m];\n\t\tint vecml[][] = new int[m][l];\n\t\tint i,j,k;\n\t\tlong veca[][] = new long[n][l];\n\t\t\n\t\tfor(i=0;i<n;i++){\n\t\t\tfor(j=0;j<m;j++){\n\t\t\t\tvecnm[i][j] = sc.nextInt();\n\t\t\t}\n\t\t}\n\t\tfor(i=0;i<m;i++){\n\t\t\tfor(j=0;j<l;j++){\n\t\t\t\tvecml[i][j] = sc.nextInt();\n\t\t\t}\n\t\t\t\n\t\t}\n\t\tsc.close();\n\t\t\n\t\tfor(i=0;i<n;i++){\n\t\t\tfor(j=0;j<l;j++){\n\t\t\t\tfor(k=0;k<m;k++){\n\t\t\t\t\tveca[i][j]+=vecnm[i][k]*vecml[k][j];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tfor(i=0;i<n;i++){\n\t\t\tfor(j=0;j<l;j++){\n\t\t\t\tSystem.out.print(veca[i][j]);\n\t\t\t\tif(j!=(l-1)){\n\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t}\n\t\t\t}\n\t\t\t//if(i!=(n-1)){\n\t\t\t\tSystem.out.println();\n\t\t\t//}\n\t\t}\n\t}",
"main",
"{\n\n\t\tScanner sc = new Scanner(System.in);\n\t\tint n = sc.nextInt();\n\t\tint m = sc.nextInt();\n\t\tint l = sc.nextInt();\n\t\tint vecnm[][] = new int[n][m];\n\t\tint vecml[][] = new int[m][l];\n\t\tint i,j,k;\n\t\tlong veca[][] = new long[n][l];\n\t\t\n\t\tfor(i=0;i<n;i++){\n\t\t\tfor(j=0;j<m;j++){\n\t\t\t\tvecnm[i][j] = sc.nextInt();\n\t\t\t}\n\t\t}\n\t\tfor(i=0;i<m;i++){\n\t\t\tfor(j=0;j<l;j++){\n\t\t\t\tvecml[i][j] = sc.nextInt();\n\t\t\t}\n\t\t\t\n\t\t}\n\t\tsc.close();\n\t\t\n\t\tfor(i=0;i<n;i++){\n\t\t\tfor(j=0;j<l;j++){\n\t\t\t\tfor(k=0;k<m;k++){\n\t\t\t\t\tveca[i][j]+=vecnm[i][k]*vecml[k][j];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tfor(i=0;i<n;i++){\n\t\t\tfor(j=0;j<l;j++){\n\t\t\t\tSystem.out.print(veca[i][j]);\n\t\t\t\tif(j!=(l-1)){\n\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t}\n\t\t\t}\n\t\t\t//if(i!=(n-1)){\n\t\t\t\tSystem.out.println();\n\t\t\t//}\n\t\t}\n\t}",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"int n = sc.nextInt();",
"n",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int m = sc.nextInt();",
"m",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int l = sc.nextInt();",
"l",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int vecnm[][] = new int[n][m];",
"vecnm",
"new int[n][m]",
"n",
"m",
"int vecml[][] = new int[m][l];",
"vecml",
"new int[m][l]",
"m",
"l",
"int i",
"i",
"j",
"j",
"k;",
"k",
"long veca[][] = new long[n][l];",
"veca",
"new long[n][l]",
"n",
"l",
"for(i=0;i<n;i++){\n\t\t\tfor(j=0;j<m;j++){\n\t\t\t\tvecnm[i][j] = sc.nextInt();\n\t\t\t}\n\t\t}",
"i=0;",
"i=0",
"i",
"0",
"i<n",
"i",
"n",
"i++",
"i++",
"i",
"{\n\t\t\tfor(j=0;j<m;j++){\n\t\t\t\tvecnm[i][j] = sc.nextInt();\n\t\t\t}\n\t\t}",
"{\n\t\t\tfor(j=0;j<m;j++){\n\t\t\t\tvecnm[i][j] = sc.nextInt();\n\t\t\t}\n\t\t}",
"for(j=0;j<m;j++){\n\t\t\t\tvecnm[i][j] = sc.nextInt();\n\t\t\t}",
"j=0;",
"j=0",
"j",
"0",
"j<m",
"j",
"m",
"j++",
"j++",
"j",
"{\n\t\t\t\tvecnm[i][j] = sc.nextInt();\n\t\t\t}",
"{\n\t\t\t\tvecnm[i][j] = sc.nextInt();\n\t\t\t}",
"vecnm[i][j] = sc.nextInt()",
"vecnm[i][j]",
"vecnm[i]",
"vecnm",
"i",
"j",
"sc.nextInt()",
"sc.nextInt",
"sc",
"for(i=0;i<m;i++){\n\t\t\tfor(j=0;j<l;j++){\n\t\t\t\tvecml[i][j] = sc.nextInt();\n\t\t\t}\n\t\t\t\n\t\t}",
"i=0;",
"i=0",
"i",
"0",
"i<m",
"i",
"m",
"i++",
"i++",
"i",
"{\n\t\t\tfor(j=0;j<l;j++){\n\t\t\t\tvecml[i][j] = sc.nextInt();\n\t\t\t}\n\t\t\t\n\t\t}",
"{\n\t\t\tfor(j=0;j<l;j++){\n\t\t\t\tvecml[i][j] = sc.nextInt();\n\t\t\t}\n\t\t\t\n\t\t}",
"for(j=0;j<l;j++){\n\t\t\t\tvecml[i][j] = sc.nextInt();\n\t\t\t}",
"j=0;",
"j=0",
"j",
"0",
"j<l",
"j",
"l",
"j++",
"j++",
"j",
"{\n\t\t\t\tvecml[i][j] = sc.nextInt();\n\t\t\t}",
"{\n\t\t\t\tvecml[i][j] = sc.nextInt();\n\t\t\t}",
"vecml[i][j] = sc.nextInt()",
"vecml[i][j]",
"vecml[i]",
"vecml",
"i",
"j",
"sc.nextInt()",
"sc.nextInt",
"sc",
"sc.close()",
"sc.close",
"sc",
"for(i=0;i<n;i++){\n\t\t\tfor(j=0;j<l;j++){\n\t\t\t\tfor(k=0;k<m;k++){\n\t\t\t\t\tveca[i][j]+=vecnm[i][k]*vecml[k][j];\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"i=0;",
"i=0",
"i",
"0",
"i<n",
"i",
"n",
"i++",
"i++",
"i",
"{\n\t\t\tfor(j=0;j<l;j++){\n\t\t\t\tfor(k=0;k<m;k++){\n\t\t\t\t\tveca[i][j]+=vecnm[i][k]*vecml[k][j];\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"{\n\t\t\tfor(j=0;j<l;j++){\n\t\t\t\tfor(k=0;k<m;k++){\n\t\t\t\t\tveca[i][j]+=vecnm[i][k]*vecml[k][j];\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"for(j=0;j<l;j++){\n\t\t\t\tfor(k=0;k<m;k++){\n\t\t\t\t\tveca[i][j]+=vecnm[i][k]*vecml[k][j];\n\t\t\t\t}\n\t\t\t}",
"j=0;",
"j=0",
"j",
"0",
"j<l",
"j",
"l",
"j++",
"j++",
"j",
"{\n\t\t\t\tfor(k=0;k<m;k++){\n\t\t\t\t\tveca[i][j]+=vecnm[i][k]*vecml[k][j];\n\t\t\t\t}\n\t\t\t}",
"{\n\t\t\t\tfor(k=0;k<m;k++){\n\t\t\t\t\tveca[i][j]+=vecnm[i][k]*vecml[k][j];\n\t\t\t\t}\n\t\t\t}",
"for(k=0;k<m;k++){\n\t\t\t\t\tveca[i][j]+=vecnm[i][k]*vecml[k][j];\n\t\t\t\t}",
"k=0;",
"k=0",
"k",
"0",
"k<m",
"k",
"m",
"k++",
"k++",
"k",
"{\n\t\t\t\t\tveca[i][j]+=vecnm[i][k]*vecml[k][j];\n\t\t\t\t}",
"{\n\t\t\t\t\tveca[i][j]+=vecnm[i][k]*vecml[k][j];\n\t\t\t\t}",
"veca[i][j]+=vecnm[i][k]*vecml[k][j]",
"veca[i][j]",
"veca[i]",
"veca",
"i",
"j",
"vecnm[i][k]*vecml[k][j]",
"vecnm[i][k]",
"vecnm[i]",
"vecnm",
"i",
"k",
"vecml[k][j]",
"vecml[k]",
"vecml",
"k",
"j",
"for(i=0;i<n;i++){\n\t\t\tfor(j=0;j<l;j++){\n\t\t\t\tSystem.out.print(veca[i][j]);\n\t\t\t\tif(j!=(l-1)){\n\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t}\n\t\t\t}\n\t\t\t//if(i!=(n-1)){\n\t\t\t\tSystem.out.println();\n\t\t\t//}\n\t\t}",
"i=0;",
"i=0",
"i",
"0",
"i<n",
"i",
"n",
"i++",
"i++",
"i",
"{\n\t\t\tfor(j=0;j<l;j++){\n\t\t\t\tSystem.out.print(veca[i][j]);\n\t\t\t\tif(j!=(l-1)){\n\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t}\n\t\t\t}\n\t\t\t//if(i!=(n-1)){\n\t\t\t\tSystem.out.println();\n\t\t\t//}\n\t\t}",
"{\n\t\t\tfor(j=0;j<l;j++){\n\t\t\t\tSystem.out.print(veca[i][j]);\n\t\t\t\tif(j!=(l-1)){\n\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t}\n\t\t\t}\n\t\t\t//if(i!=(n-1)){\n\t\t\t\tSystem.out.println();\n\t\t\t//}\n\t\t}",
"for(j=0;j<l;j++){\n\t\t\t\tSystem.out.print(veca[i][j]);\n\t\t\t\tif(j!=(l-1)){\n\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t}\n\t\t\t}",
"j=0;",
"j=0",
"j",
"0",
"j<l",
"j",
"l",
"j++",
"j++",
"j",
"{\n\t\t\t\tSystem.out.print(veca[i][j]);\n\t\t\t\tif(j!=(l-1)){\n\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t}\n\t\t\t}",
"{\n\t\t\t\tSystem.out.print(veca[i][j]);\n\t\t\t\tif(j!=(l-1)){\n\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t}\n\t\t\t}",
"System.out.print(veca[i][j])",
"System.out.print",
"System.out",
"System",
"System.out",
"veca[i][j]",
"veca[i]",
"veca",
"i",
"j",
"if(j!=(l-1)){\n\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t}",
"j!=(l-1)",
"j",
"(l-1)",
"l",
"1",
"{\n\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t}",
"System.out.print(\" \")",
"System.out.print",
"System.out",
"System",
"System.out",
"\" \"",
"System.out.println()",
"System.out.println",
"System.out",
"System",
"System.out",
"String[] args",
"args",
"public class Main {\n\n\tpublic static void main(String[] args) {\n\n\t\tScanner sc = new Scanner(System.in);\n\t\tint n = sc.nextInt();\n\t\tint m = sc.nextInt();\n\t\tint l = sc.nextInt();\n\t\tint vecnm[][] = new int[n][m];\n\t\tint vecml[][] = new int[m][l];\n\t\tint i,j,k;\n\t\tlong veca[][] = new long[n][l];\n\t\t\n\t\tfor(i=0;i<n;i++){\n\t\t\tfor(j=0;j<m;j++){\n\t\t\t\tvecnm[i][j] = sc.nextInt();\n\t\t\t}\n\t\t}\n\t\tfor(i=0;i<m;i++){\n\t\t\tfor(j=0;j<l;j++){\n\t\t\t\tvecml[i][j] = sc.nextInt();\n\t\t\t}\n\t\t\t\n\t\t}\n\t\tsc.close();\n\t\t\n\t\tfor(i=0;i<n;i++){\n\t\t\tfor(j=0;j<l;j++){\n\t\t\t\tfor(k=0;k<m;k++){\n\t\t\t\t\tveca[i][j]+=vecnm[i][k]*vecml[k][j];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tfor(i=0;i<n;i++){\n\t\t\tfor(j=0;j<l;j++){\n\t\t\t\tSystem.out.print(veca[i][j]);\n\t\t\t\tif(j!=(l-1)){\n\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t}\n\t\t\t}\n\t\t\t//if(i!=(n-1)){\n\t\t\t\tSystem.out.println();\n\t\t\t//}\n\t\t}\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 n = sc.nextInt();\n\t\tint m = sc.nextInt();\n\t\tint l = sc.nextInt();\n\t\tint vecnm[][] = new int[n][m];\n\t\tint vecml[][] = new int[m][l];\n\t\tint i,j,k;\n\t\tlong veca[][] = new long[n][l];\n\t\t\n\t\tfor(i=0;i<n;i++){\n\t\t\tfor(j=0;j<m;j++){\n\t\t\t\tvecnm[i][j] = sc.nextInt();\n\t\t\t}\n\t\t}\n\t\tfor(i=0;i<m;i++){\n\t\t\tfor(j=0;j<l;j++){\n\t\t\t\tvecml[i][j] = sc.nextInt();\n\t\t\t}\n\t\t\t\n\t\t}\n\t\tsc.close();\n\t\t\n\t\tfor(i=0;i<n;i++){\n\t\t\tfor(j=0;j<l;j++){\n\t\t\t\tfor(k=0;k<m;k++){\n\t\t\t\t\tveca[i][j]+=vecnm[i][k]*vecml[k][j];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tfor(i=0;i<n;i++){\n\t\t\tfor(j=0;j<l;j++){\n\t\t\t\tSystem.out.print(veca[i][j]);\n\t\t\t\tif(j!=(l-1)){\n\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t}\n\t\t\t}\n\t\t\t//if(i!=(n-1)){\n\t\t\t\tSystem.out.println();\n\t\t\t//}\n\t\t}\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 n = sc.nextInt();
int m = sc.nextInt();
int l = sc.nextInt();
int vecnm[][] = new int[n][m];
int vecml[][] = new int[m][l];
int i,j,k;
long veca[][] = new long[n][l];
for(i=0;i<n;i++){
for(j=0;j<m;j++){
vecnm[i][j] = sc.nextInt();
}
}
for(i=0;i<m;i++){
for(j=0;j<l;j++){
vecml[i][j] = sc.nextInt();
}
}
sc.close();
for(i=0;i<n;i++){
for(j=0;j<l;j++){
for(k=0;k<m;k++){
veca[i][j]+=vecnm[i][k]*vecml[k][j];
}
}
}
for(i=0;i<n;i++){
for(j=0;j<l;j++){
System.out.print(veca[i][j]);
if(j!=(l-1)){
System.out.print(" ");
}
}
//if(i!=(n-1)){
System.out.println();
//}
}
}
}
|
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
41,
13,
20,
13,
13,
41,
13,
20,
13,
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,
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,
0,
18,
18,
13,
13,
13,
4,
18,
13,
41,
13,
17,
41,
13,
41,
13,
41,
13,
11,
1,
0,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
11,
1,
0,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
11,
1,
0,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
2,
13,
2,
18,
18,
13,
13,
13,
18,
18,
13,
13,
13,
0,
18,
18,
13,
13,
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,
4,
18,
18,
13,
13,
18,
18,
13,
13,
13,
14,
40,
2,
13,
2,
13,
17,
30,
4,
18,
18,
13,
13,
17,
14,
2,
13,
2,
13,
17,
30,
4,
18,
18,
13,
13,
17,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
251,
5
],
[
251,
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
],
[
19,
20
],
[
20,
21
],
[
8,
22
],
[
22,
23
],
[
22,
24
],
[
24,
25
],
[
25,
26
],
[
8,
27
],
[
27,
28
],
[
27,
29
],
[
8,
32
],
[
32,
33
],
[
32,
34
],
[
8,
37
],
[
37,
38
],
[
37,
39
],
[
8,
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
],
[
69,
70
],
[
70,
71
],
[
70,
72
],
[
69,
73
],
[
68,
74
],
[
74,
75
],
[
75,
76
],
[
8,
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
],
[
104,
105
],
[
105,
106
],
[
105,
107
],
[
104,
108
],
[
103,
109
],
[
109,
110
],
[
110,
111
],
[
8,
112
],
[
112,
113
],
[
112,
114
],
[
8,
115
],
[
115,
116
],
[
8,
117
],
[
117,
118
],
[
8,
119
],
[
119,
120
],
[
8,
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
],
[
135,
136
],
[
136,
137
],
[
136,
138
],
[
134,
139
],
[
139,
140
],
[
139,
141
],
[
134,
142
],
[
142,
143
],
[
143,
144
],
[
134,
145
],
[
146,
146
],
[
146,
147
],
[
147,
148
],
[
148,
149
],
[
149,
150
],
[
149,
151
],
[
147,
152
],
[
152,
153
],
[
152,
154
],
[
147,
155
],
[
155,
156
],
[
156,
157
],
[
147,
158
],
[
159,
159
],
[
159,
160
],
[
160,
161
],
[
160,
162
],
[
162,
163
],
[
162,
164
],
[
164,
165
],
[
165,
166
],
[
166,
167
],
[
166,
168
],
[
165,
169
],
[
164,
170
],
[
170,
171
],
[
171,
172
],
[
171,
173
],
[
170,
174
],
[
146,
175
],
[
175,
176
],
[
176,
177
],
[
177,
178
],
[
177,
179
],
[
176,
180
],
[
175,
181
],
[
146,
182
],
[
182,
183
],
[
182,
184
],
[
8,
185
],
[
185,
186
],
[
186,
187
],
[
187,
188
],
[
187,
189
],
[
185,
190
],
[
190,
191
],
[
190,
192
],
[
185,
193
],
[
193,
194
],
[
194,
195
],
[
185,
196
],
[
197,
197
],
[
197,
198
],
[
198,
199
],
[
199,
200
],
[
200,
201
],
[
200,
202
],
[
198,
203
],
[
203,
204
],
[
203,
205
],
[
198,
206
],
[
206,
207
],
[
207,
208
],
[
198,
209
],
[
210,
210
],
[
210,
211
],
[
211,
212
],
[
212,
213
],
[
213,
214
],
[
213,
215
],
[
211,
216
],
[
216,
217
],
[
217,
218
],
[
217,
219
],
[
216,
220
],
[
210,
221
],
[
221,
222
],
[
222,
223
],
[
223,
224
],
[
223,
225
],
[
225,
226
],
[
225,
227
],
[
221,
228
],
[
228,
229
],
[
229,
230
],
[
230,
231
],
[
231,
232
],
[
231,
233
],
[
229,
234
],
[
210,
235
],
[
235,
236
],
[
236,
237
],
[
236,
238
],
[
238,
239
],
[
238,
240
],
[
235,
241
],
[
241,
242
],
[
242,
243
],
[
243,
244
],
[
244,
245
],
[
244,
246
],
[
242,
247
],
[
6,
248
],
[
248,
249
],
[
0,
250
],
[
250,
251
],
[
250,
252
]
] | [
"import java.util.Scanner;\n\npublic class Main {\n\n\tpublic static void main(String[] args) {\n\t\t// n×mの行列Aのnとmの数、m×lの列ベクトルbのmとlの数を取得\n\t\tScanner sc = new Scanner(System.in);\n\t\tint n = sc.nextInt();\n\t\tint m = sc.nextInt();\n\t\tint l = sc.nextInt();\n\n\t\t// aの二次元配列とbの二次元配列、答えを入れるcの一次元配列をつくる\n\t\tint[][] a = new int[n][m];\n\t\tint[][] b = new int[m][l];\n\t\tlong[][] c = new long[n][l];\n\n\t\t// aの二次元配列に入力値を入れる\n\t\tfor (int i = 0; i < n; i++) {\n\t\t\tfor (int j = 0; j < m; j++) {\n\t\t\t\ta[i][j] = sc.nextInt();\n\t\t\t}\n\t\t}\n\n\t\t// bの二次元配列に入力値を入れる\n\t\tfor (int i = 0; i < m; i++) {\n\t\t\tfor (int j = 0; j < l; j++) {\n\t\t\t\tb[i][j] = sc.nextInt();\n\t\t\t}\n\t\t}\n\n\t\t// ansを計算してcの二次元配列に入れる\n\t\tlong ans = 0;\n\t\tint i;\n\t\tint j;\n\t\tint k;\n\t\tfor (i = 0; i < n; i++) {\n\t\t\tfor (j = 0; j < l; j++) {\n\t\t\t\tfor (k = 0; k < m; k++) {\n\t\t\t\t\tans = ans + a[i][k] * b[k][j];\n\t\t\t\t}\n\t\t\t\tc[i][j] = ans;\n\t\t\t\tans = 0;\n\t\t\t}\n\t\t}\n\n\t\t// 答えcの二次元配列を表示\n\t\tfor (int row = 0; row < n; row++) {\n\t\t\tfor (int column = 0; column < l; column++) {\n\t\t\t\tSystem.out.print(c[row][column]);\n\t\t\t\tif (!(column == l - 1)) {\n\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t}\n\t\t\t\tif (column == l - 1) {\n\t\t\t\t\tSystem.out.println(\"\");\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n\n\tpublic static void main(String[] args) {\n\t\t// n×mの行列Aのnとmの数、m×lの列ベクトルbのmとlの数を取得\n\t\tScanner sc = new Scanner(System.in);\n\t\tint n = sc.nextInt();\n\t\tint m = sc.nextInt();\n\t\tint l = sc.nextInt();\n\n\t\t// aの二次元配列とbの二次元配列、答えを入れるcの一次元配列をつくる\n\t\tint[][] a = new int[n][m];\n\t\tint[][] b = new int[m][l];\n\t\tlong[][] c = new long[n][l];\n\n\t\t// aの二次元配列に入力値を入れる\n\t\tfor (int i = 0; i < n; i++) {\n\t\t\tfor (int j = 0; j < m; j++) {\n\t\t\t\ta[i][j] = sc.nextInt();\n\t\t\t}\n\t\t}\n\n\t\t// bの二次元配列に入力値を入れる\n\t\tfor (int i = 0; i < m; i++) {\n\t\t\tfor (int j = 0; j < l; j++) {\n\t\t\t\tb[i][j] = sc.nextInt();\n\t\t\t}\n\t\t}\n\n\t\t// ansを計算してcの二次元配列に入れる\n\t\tlong ans = 0;\n\t\tint i;\n\t\tint j;\n\t\tint k;\n\t\tfor (i = 0; i < n; i++) {\n\t\t\tfor (j = 0; j < l; j++) {\n\t\t\t\tfor (k = 0; k < m; k++) {\n\t\t\t\t\tans = ans + a[i][k] * b[k][j];\n\t\t\t\t}\n\t\t\t\tc[i][j] = ans;\n\t\t\t\tans = 0;\n\t\t\t}\n\t\t}\n\n\t\t// 答えcの二次元配列を表示\n\t\tfor (int row = 0; row < n; row++) {\n\t\t\tfor (int column = 0; column < l; column++) {\n\t\t\t\tSystem.out.print(c[row][column]);\n\t\t\t\tif (!(column == l - 1)) {\n\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t}\n\t\t\t\tif (column == l - 1) {\n\t\t\t\t\tSystem.out.println(\"\");\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}",
"Main",
"public static void main(String[] args) {\n\t\t// n×mの行列Aのnとmの数、m×lの列ベクトルbのmとlの数を取得\n\t\tScanner sc = new Scanner(System.in);\n\t\tint n = sc.nextInt();\n\t\tint m = sc.nextInt();\n\t\tint l = sc.nextInt();\n\n\t\t// aの二次元配列とbの二次元配列、答えを入れるcの一次元配列をつくる\n\t\tint[][] a = new int[n][m];\n\t\tint[][] b = new int[m][l];\n\t\tlong[][] c = new long[n][l];\n\n\t\t// aの二次元配列に入力値を入れる\n\t\tfor (int i = 0; i < n; i++) {\n\t\t\tfor (int j = 0; j < m; j++) {\n\t\t\t\ta[i][j] = sc.nextInt();\n\t\t\t}\n\t\t}\n\n\t\t// bの二次元配列に入力値を入れる\n\t\tfor (int i = 0; i < m; i++) {\n\t\t\tfor (int j = 0; j < l; j++) {\n\t\t\t\tb[i][j] = sc.nextInt();\n\t\t\t}\n\t\t}\n\n\t\t// ansを計算してcの二次元配列に入れる\n\t\tlong ans = 0;\n\t\tint i;\n\t\tint j;\n\t\tint k;\n\t\tfor (i = 0; i < n; i++) {\n\t\t\tfor (j = 0; j < l; j++) {\n\t\t\t\tfor (k = 0; k < m; k++) {\n\t\t\t\t\tans = ans + a[i][k] * b[k][j];\n\t\t\t\t}\n\t\t\t\tc[i][j] = ans;\n\t\t\t\tans = 0;\n\t\t\t}\n\t\t}\n\n\t\t// 答えcの二次元配列を表示\n\t\tfor (int row = 0; row < n; row++) {\n\t\t\tfor (int column = 0; column < l; column++) {\n\t\t\t\tSystem.out.print(c[row][column]);\n\t\t\t\tif (!(column == l - 1)) {\n\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t}\n\t\t\t\tif (column == l - 1) {\n\t\t\t\t\tSystem.out.println(\"\");\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"main",
"{\n\t\t// n×mの行列Aのnとmの数、m×lの列ベクトルbのmとlの数を取得\n\t\tScanner sc = new Scanner(System.in);\n\t\tint n = sc.nextInt();\n\t\tint m = sc.nextInt();\n\t\tint l = sc.nextInt();\n\n\t\t// aの二次元配列とbの二次元配列、答えを入れるcの一次元配列をつくる\n\t\tint[][] a = new int[n][m];\n\t\tint[][] b = new int[m][l];\n\t\tlong[][] c = new long[n][l];\n\n\t\t// aの二次元配列に入力値を入れる\n\t\tfor (int i = 0; i < n; i++) {\n\t\t\tfor (int j = 0; j < m; j++) {\n\t\t\t\ta[i][j] = sc.nextInt();\n\t\t\t}\n\t\t}\n\n\t\t// bの二次元配列に入力値を入れる\n\t\tfor (int i = 0; i < m; i++) {\n\t\t\tfor (int j = 0; j < l; j++) {\n\t\t\t\tb[i][j] = sc.nextInt();\n\t\t\t}\n\t\t}\n\n\t\t// ansを計算してcの二次元配列に入れる\n\t\tlong ans = 0;\n\t\tint i;\n\t\tint j;\n\t\tint k;\n\t\tfor (i = 0; i < n; i++) {\n\t\t\tfor (j = 0; j < l; j++) {\n\t\t\t\tfor (k = 0; k < m; k++) {\n\t\t\t\t\tans = ans + a[i][k] * b[k][j];\n\t\t\t\t}\n\t\t\t\tc[i][j] = ans;\n\t\t\t\tans = 0;\n\t\t\t}\n\t\t}\n\n\t\t// 答えcの二次元配列を表示\n\t\tfor (int row = 0; row < n; row++) {\n\t\t\tfor (int column = 0; column < l; column++) {\n\t\t\t\tSystem.out.print(c[row][column]);\n\t\t\t\tif (!(column == l - 1)) {\n\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t}\n\t\t\t\tif (column == l - 1) {\n\t\t\t\t\tSystem.out.println(\"\");\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"int n = sc.nextInt();",
"n",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int m = sc.nextInt();",
"m",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int l = sc.nextInt();",
"l",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int[][] a = new int[n][m];",
"a",
"new int[n][m]",
"n",
"m",
"int[][] b = new int[m][l];",
"b",
"new int[m][l]",
"m",
"l",
"long[][] c = new long[n][l];",
"c",
"new long[n][l]",
"n",
"l",
"for (int i = 0; i < n; i++) {\n\t\t\tfor (int j = 0; j < m; j++) {\n\t\t\t\ta[i][j] = sc.nextInt();\n\t\t\t}\n\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < n",
"i",
"n",
"i++",
"i++",
"i",
"{\n\t\t\tfor (int j = 0; j < m; j++) {\n\t\t\t\ta[i][j] = sc.nextInt();\n\t\t\t}\n\t\t}",
"{\n\t\t\tfor (int j = 0; j < m; j++) {\n\t\t\t\ta[i][j] = sc.nextInt();\n\t\t\t}\n\t\t}",
"for (int j = 0; j < m; j++) {\n\t\t\t\ta[i][j] = sc.nextInt();\n\t\t\t}",
"int j = 0;",
"int j = 0;",
"j",
"0",
"j < m",
"j",
"m",
"j++",
"j++",
"j",
"{\n\t\t\t\ta[i][j] = sc.nextInt();\n\t\t\t}",
"{\n\t\t\t\ta[i][j] = sc.nextInt();\n\t\t\t}",
"a[i][j] = sc.nextInt()",
"a[i][j]",
"a[i]",
"a",
"i",
"j",
"sc.nextInt()",
"sc.nextInt",
"sc",
"for (int i = 0; i < m; i++) {\n\t\t\tfor (int j = 0; j < l; j++) {\n\t\t\t\tb[i][j] = sc.nextInt();\n\t\t\t}\n\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < m",
"i",
"m",
"i++",
"i++",
"i",
"{\n\t\t\tfor (int j = 0; j < l; j++) {\n\t\t\t\tb[i][j] = sc.nextInt();\n\t\t\t}\n\t\t}",
"{\n\t\t\tfor (int j = 0; j < l; j++) {\n\t\t\t\tb[i][j] = sc.nextInt();\n\t\t\t}\n\t\t}",
"for (int j = 0; j < l; j++) {\n\t\t\t\tb[i][j] = sc.nextInt();\n\t\t\t}",
"int j = 0;",
"int j = 0;",
"j",
"0",
"j < l",
"j",
"l",
"j++",
"j++",
"j",
"{\n\t\t\t\tb[i][j] = sc.nextInt();\n\t\t\t}",
"{\n\t\t\t\tb[i][j] = sc.nextInt();\n\t\t\t}",
"b[i][j] = sc.nextInt()",
"b[i][j]",
"b[i]",
"b",
"i",
"j",
"sc.nextInt()",
"sc.nextInt",
"sc",
"long ans = 0;",
"ans",
"0",
"int i;",
"i",
"int j;",
"j",
"int k;",
"k",
"for (i = 0; i < n; i++) {\n\t\t\tfor (j = 0; j < l; j++) {\n\t\t\t\tfor (k = 0; k < m; k++) {\n\t\t\t\t\tans = ans + a[i][k] * b[k][j];\n\t\t\t\t}\n\t\t\t\tc[i][j] = ans;\n\t\t\t\tans = 0;\n\t\t\t}\n\t\t}",
"i = 0;",
"i = 0",
"i",
"0",
"i < n",
"i",
"n",
"i++",
"i++",
"i",
"{\n\t\t\tfor (j = 0; j < l; j++) {\n\t\t\t\tfor (k = 0; k < m; k++) {\n\t\t\t\t\tans = ans + a[i][k] * b[k][j];\n\t\t\t\t}\n\t\t\t\tc[i][j] = ans;\n\t\t\t\tans = 0;\n\t\t\t}\n\t\t}",
"{\n\t\t\tfor (j = 0; j < l; j++) {\n\t\t\t\tfor (k = 0; k < m; k++) {\n\t\t\t\t\tans = ans + a[i][k] * b[k][j];\n\t\t\t\t}\n\t\t\t\tc[i][j] = ans;\n\t\t\t\tans = 0;\n\t\t\t}\n\t\t}",
"for (j = 0; j < l; j++) {\n\t\t\t\tfor (k = 0; k < m; k++) {\n\t\t\t\t\tans = ans + a[i][k] * b[k][j];\n\t\t\t\t}\n\t\t\t\tc[i][j] = ans;\n\t\t\t\tans = 0;\n\t\t\t}",
"j = 0;",
"j = 0",
"j",
"0",
"j < l",
"j",
"l",
"j++",
"j++",
"j",
"{\n\t\t\t\tfor (k = 0; k < m; k++) {\n\t\t\t\t\tans = ans + a[i][k] * b[k][j];\n\t\t\t\t}\n\t\t\t\tc[i][j] = ans;\n\t\t\t\tans = 0;\n\t\t\t}",
"{\n\t\t\t\tfor (k = 0; k < m; k++) {\n\t\t\t\t\tans = ans + a[i][k] * b[k][j];\n\t\t\t\t}\n\t\t\t\tc[i][j] = ans;\n\t\t\t\tans = 0;\n\t\t\t}",
"for (k = 0; k < m; k++) {\n\t\t\t\t\tans = ans + a[i][k] * b[k][j];\n\t\t\t\t}",
"k = 0;",
"k = 0",
"k",
"0",
"k < m",
"k",
"m",
"k++",
"k++",
"k",
"{\n\t\t\t\t\tans = ans + a[i][k] * b[k][j];\n\t\t\t\t}",
"{\n\t\t\t\t\tans = ans + a[i][k] * b[k][j];\n\t\t\t\t}",
"ans = ans + a[i][k] * b[k][j]",
"ans",
"ans + a[i][k] * b[k][j]",
"ans",
"a[i][k] * b[k][j]",
"a[i][k]",
"a[i]",
"a",
"i",
"k",
"b[k][j]",
"b[k]",
"b",
"k",
"j",
"c[i][j] = ans",
"c[i][j]",
"c[i]",
"c",
"i",
"j",
"ans",
"ans = 0",
"ans",
"0",
"for (int row = 0; row < n; row++) {\n\t\t\tfor (int column = 0; column < l; column++) {\n\t\t\t\tSystem.out.print(c[row][column]);\n\t\t\t\tif (!(column == l - 1)) {\n\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t}\n\t\t\t\tif (column == l - 1) {\n\t\t\t\t\tSystem.out.println(\"\");\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"int row = 0;",
"int row = 0;",
"row",
"0",
"row < n",
"row",
"n",
"row++",
"row++",
"row",
"{\n\t\t\tfor (int column = 0; column < l; column++) {\n\t\t\t\tSystem.out.print(c[row][column]);\n\t\t\t\tif (!(column == l - 1)) {\n\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t}\n\t\t\t\tif (column == l - 1) {\n\t\t\t\t\tSystem.out.println(\"\");\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"{\n\t\t\tfor (int column = 0; column < l; column++) {\n\t\t\t\tSystem.out.print(c[row][column]);\n\t\t\t\tif (!(column == l - 1)) {\n\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t}\n\t\t\t\tif (column == l - 1) {\n\t\t\t\t\tSystem.out.println(\"\");\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"for (int column = 0; column < l; column++) {\n\t\t\t\tSystem.out.print(c[row][column]);\n\t\t\t\tif (!(column == l - 1)) {\n\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t}\n\t\t\t\tif (column == l - 1) {\n\t\t\t\t\tSystem.out.println(\"\");\n\t\t\t\t}\n\t\t\t}",
"int column = 0;",
"int column = 0;",
"column",
"0",
"column < l",
"column",
"l",
"column++",
"column++",
"column",
"{\n\t\t\t\tSystem.out.print(c[row][column]);\n\t\t\t\tif (!(column == l - 1)) {\n\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t}\n\t\t\t\tif (column == l - 1) {\n\t\t\t\t\tSystem.out.println(\"\");\n\t\t\t\t}\n\t\t\t}",
"{\n\t\t\t\tSystem.out.print(c[row][column]);\n\t\t\t\tif (!(column == l - 1)) {\n\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t}\n\t\t\t\tif (column == l - 1) {\n\t\t\t\t\tSystem.out.println(\"\");\n\t\t\t\t}\n\t\t\t}",
"System.out.print(c[row][column])",
"System.out.print",
"System.out",
"System",
"System.out",
"c[row][column]",
"c[row]",
"c",
"row",
"column",
"if (!(column == l - 1)) {\n\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t}",
"!(column == l - 1)",
"(column == l - 1)",
"column",
"l - 1",
"l",
"1",
"{\n\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t}",
"System.out.print(\" \")",
"System.out.print",
"System.out",
"System",
"System.out",
"\" \"",
"if (column == l - 1) {\n\t\t\t\t\tSystem.out.println(\"\");\n\t\t\t\t}",
"column == l - 1",
"column",
"l - 1",
"l",
"1",
"{\n\t\t\t\t\tSystem.out.println(\"\");\n\t\t\t\t}",
"System.out.println(\"\")",
"System.out.println",
"System.out",
"System",
"System.out",
"\"\"",
"String[] args",
"args",
"public class Main {\n\n\tpublic static void main(String[] args) {\n\t\t// n×mの行列Aのnとmの数、m×lの列ベクトルbのmとlの数を取得\n\t\tScanner sc = new Scanner(System.in);\n\t\tint n = sc.nextInt();\n\t\tint m = sc.nextInt();\n\t\tint l = sc.nextInt();\n\n\t\t// aの二次元配列とbの二次元配列、答えを入れるcの一次元配列をつくる\n\t\tint[][] a = new int[n][m];\n\t\tint[][] b = new int[m][l];\n\t\tlong[][] c = new long[n][l];\n\n\t\t// aの二次元配列に入力値を入れる\n\t\tfor (int i = 0; i < n; i++) {\n\t\t\tfor (int j = 0; j < m; j++) {\n\t\t\t\ta[i][j] = sc.nextInt();\n\t\t\t}\n\t\t}\n\n\t\t// bの二次元配列に入力値を入れる\n\t\tfor (int i = 0; i < m; i++) {\n\t\t\tfor (int j = 0; j < l; j++) {\n\t\t\t\tb[i][j] = sc.nextInt();\n\t\t\t}\n\t\t}\n\n\t\t// ansを計算してcの二次元配列に入れる\n\t\tlong ans = 0;\n\t\tint i;\n\t\tint j;\n\t\tint k;\n\t\tfor (i = 0; i < n; i++) {\n\t\t\tfor (j = 0; j < l; j++) {\n\t\t\t\tfor (k = 0; k < m; k++) {\n\t\t\t\t\tans = ans + a[i][k] * b[k][j];\n\t\t\t\t}\n\t\t\t\tc[i][j] = ans;\n\t\t\t\tans = 0;\n\t\t\t}\n\t\t}\n\n\t\t// 答えcの二次元配列を表示\n\t\tfor (int row = 0; row < n; row++) {\n\t\t\tfor (int column = 0; column < l; column++) {\n\t\t\t\tSystem.out.print(c[row][column]);\n\t\t\t\tif (!(column == l - 1)) {\n\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t}\n\t\t\t\tif (column == l - 1) {\n\t\t\t\t\tSystem.out.println(\"\");\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}",
"public class Main {\n\n\tpublic static void main(String[] args) {\n\t\t// n×mの行列Aのnとmの数、m×lの列ベクトルbのmとlの数を取得\n\t\tScanner sc = new Scanner(System.in);\n\t\tint n = sc.nextInt();\n\t\tint m = sc.nextInt();\n\t\tint l = sc.nextInt();\n\n\t\t// aの二次元配列とbの二次元配列、答えを入れるcの一次元配列をつくる\n\t\tint[][] a = new int[n][m];\n\t\tint[][] b = new int[m][l];\n\t\tlong[][] c = new long[n][l];\n\n\t\t// aの二次元配列に入力値を入れる\n\t\tfor (int i = 0; i < n; i++) {\n\t\t\tfor (int j = 0; j < m; j++) {\n\t\t\t\ta[i][j] = sc.nextInt();\n\t\t\t}\n\t\t}\n\n\t\t// bの二次元配列に入力値を入れる\n\t\tfor (int i = 0; i < m; i++) {\n\t\t\tfor (int j = 0; j < l; j++) {\n\t\t\t\tb[i][j] = sc.nextInt();\n\t\t\t}\n\t\t}\n\n\t\t// ansを計算してcの二次元配列に入れる\n\t\tlong ans = 0;\n\t\tint i;\n\t\tint j;\n\t\tint k;\n\t\tfor (i = 0; i < n; i++) {\n\t\t\tfor (j = 0; j < l; j++) {\n\t\t\t\tfor (k = 0; k < m; k++) {\n\t\t\t\t\tans = ans + a[i][k] * b[k][j];\n\t\t\t\t}\n\t\t\t\tc[i][j] = ans;\n\t\t\t\tans = 0;\n\t\t\t}\n\t\t}\n\n\t\t// 答えcの二次元配列を表示\n\t\tfor (int row = 0; row < n; row++) {\n\t\t\tfor (int column = 0; column < l; column++) {\n\t\t\t\tSystem.out.print(c[row][column]);\n\t\t\t\tif (!(column == l - 1)) {\n\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t}\n\t\t\t\tif (column == l - 1) {\n\t\t\t\t\tSystem.out.println(\"\");\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}",
"Main"
] | import java.util.Scanner;
public class Main {
public static void main(String[] args) {
// n×mの行列Aのnとmの数、m×lの列ベクトルbのmとlの数を取得
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
int m = sc.nextInt();
int l = sc.nextInt();
// aの二次元配列とbの二次元配列、答えを入れるcの一次元配列をつくる
int[][] a = new int[n][m];
int[][] b = new int[m][l];
long[][] c = new long[n][l];
// aの二次元配列に入力値を入れる
for (int i = 0; i < n; i++) {
for (int j = 0; j < m; j++) {
a[i][j] = sc.nextInt();
}
}
// bの二次元配列に入力値を入れる
for (int i = 0; i < m; i++) {
for (int j = 0; j < l; j++) {
b[i][j] = sc.nextInt();
}
}
// ansを計算してcの二次元配列に入れる
long ans = 0;
int i;
int j;
int k;
for (i = 0; i < n; i++) {
for (j = 0; j < l; j++) {
for (k = 0; k < m; k++) {
ans = ans + a[i][k] * b[k][j];
}
c[i][j] = ans;
ans = 0;
}
}
// 答えcの二次元配列を表示
for (int row = 0; row < n; row++) {
for (int column = 0; column < l; column++) {
System.out.print(c[row][column]);
if (!(column == l - 1)) {
System.out.print(" ");
}
if (column == l - 1) {
System.out.println("");
}
}
}
}
}
|
[
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,
41,
13,
4,
18,
13,
41,
13,
20,
17,
17,
41,
13,
20,
17,
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,
18,
18,
13,
13,
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,
0,
18,
18,
13,
13,
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,
0,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
2,
18,
18,
13,
13,
13,
18,
18,
13,
13,
13,
4,
18,
18,
13,
13,
13,
14,
2,
13,
2,
13,
17,
30,
4,
18,
18,
13,
13,
17,
4,
18,
18,
13,
13,
17,
23,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
9,
10
],
[
9,
11
],
[
11,
12
],
[
12,
13
],
[
12,
14
],
[
11,
15
],
[
15,
16
],
[
15,
17
],
[
17,
18
],
[
18,
19
],
[
11,
20
],
[
20,
21
],
[
20,
22
],
[
22,
23
],
[
23,
24
],
[
11,
25
],
[
25,
26
],
[
25,
27
],
[
27,
28
],
[
28,
29
],
[
11,
30
],
[
30,
31
],
[
30,
32
],
[
11,
35
],
[
35,
36
],
[
35,
37
],
[
11,
40
],
[
40,
41
],
[
40,
42
],
[
11,
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
],
[
70,
74
],
[
69,
75
],
[
75,
76
],
[
76,
77
],
[
11,
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
],
[
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
],
[
105,
109
],
[
104,
110
],
[
110,
111
],
[
111,
112
],
[
11,
113
],
[
113,
114
],
[
114,
115
],
[
115,
116
],
[
115,
117
],
[
113,
118
],
[
118,
119
],
[
118,
120
],
[
113,
121
],
[
121,
122
],
[
122,
123
],
[
113,
124
],
[
125,
125
],
[
125,
126
],
[
126,
127
],
[
127,
128
],
[
128,
129
],
[
128,
130
],
[
126,
131
],
[
131,
132
],
[
131,
133
],
[
126,
134
],
[
134,
135
],
[
135,
136
],
[
126,
137
],
[
138,
138
],
[
138,
139
],
[
139,
140
],
[
139,
141
],
[
138,
142
],
[
142,
143
],
[
143,
144
],
[
144,
145
],
[
144,
146
],
[
142,
147
],
[
147,
148
],
[
147,
149
],
[
142,
150
],
[
150,
151
],
[
151,
152
],
[
142,
153
],
[
154,
154
],
[
154,
155
],
[
155,
156
],
[
155,
157
],
[
157,
158
],
[
158,
159
],
[
159,
160
],
[
159,
161
],
[
158,
162
],
[
157,
163
],
[
163,
164
],
[
164,
165
],
[
164,
166
],
[
163,
167
],
[
138,
168
],
[
168,
169
],
[
169,
170
],
[
170,
171
],
[
170,
172
],
[
168,
173
],
[
138,
174
],
[
174,
175
],
[
175,
176
],
[
175,
177
],
[
177,
178
],
[
177,
179
],
[
174,
180
],
[
180,
181
],
[
181,
182
],
[
182,
183
],
[
183,
184
],
[
183,
185
],
[
181,
186
],
[
125,
187
],
[
187,
188
],
[
188,
189
],
[
189,
190
],
[
189,
191
],
[
187,
192
],
[
9,
193
],
[
193,
194
]
] | [
"import java.io.IOException;\nimport java.util.Scanner;\nclass Main{\n\tpublic static void main(String[] args)throws NumberFormatException, IOException{\n\t\t//System.out.print(\" \");\n\t\tScanner scan = new Scanner(System.in);\n\t\tint n =scan.nextInt();\n\t\tint m =scan.nextInt();\n\t\tint l =scan.nextInt();\n\t\tint A[][] = new int[100][100];\t//[???][?¨?]\n\t\tint B[][] = new int[100][100];\n\t\tlong keisan = 0;\n\n\t\tfor(int i =0; i<n; i++){\t//??????A?????????\n\t\t\tfor(int ii=0;ii<m;ii++){\n\t\t\t\tA[i][ii] = scan.nextInt();\n\t\t\t}\n\t\t}\n\n\t\tfor(int i=0;i<m;i++){\t//??????B?????????\n\t\t\tfor(int ii=0;ii<l;ii++){\n\t\t\t\tB[i][ii] = scan.nextInt();\n\t\t\t}\n\t\t}\n\n\t\tfor (int i=0; i<n; i++){\t//?¨????????????????C???\n\t\t\tfor(int ii=0; ii<l; ii++){\n\t\t\t\tkeisan = 0;\n\t\t\t\tfor(int iii=0; iii<m; iii++){\n\t\t\t\t\tkeisan += A[i][iii] * B[iii][ii];\n\t\t\t\t}\n\t\t\t\tSystem.out.print(keisan);\n\t\t\t\tif(ii < l-1){\n\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t}\n\t\t\t}\n\t\t\tSystem.out.println(\"\");\n\t\t}\n\t}\n}",
"import java.io.IOException;",
"IOException",
"java.io",
"import java.util.Scanner;",
"Scanner",
"java.util",
"class Main{\n\tpublic static void main(String[] args)throws NumberFormatException, IOException{\n\t\t//System.out.print(\" \");\n\t\tScanner scan = new Scanner(System.in);\n\t\tint n =scan.nextInt();\n\t\tint m =scan.nextInt();\n\t\tint l =scan.nextInt();\n\t\tint A[][] = new int[100][100];\t//[???][?¨?]\n\t\tint B[][] = new int[100][100];\n\t\tlong keisan = 0;\n\n\t\tfor(int i =0; i<n; i++){\t//??????A?????????\n\t\t\tfor(int ii=0;ii<m;ii++){\n\t\t\t\tA[i][ii] = scan.nextInt();\n\t\t\t}\n\t\t}\n\n\t\tfor(int i=0;i<m;i++){\t//??????B?????????\n\t\t\tfor(int ii=0;ii<l;ii++){\n\t\t\t\tB[i][ii] = scan.nextInt();\n\t\t\t}\n\t\t}\n\n\t\tfor (int i=0; i<n; i++){\t//?¨????????????????C???\n\t\t\tfor(int ii=0; ii<l; ii++){\n\t\t\t\tkeisan = 0;\n\t\t\t\tfor(int iii=0; iii<m; iii++){\n\t\t\t\t\tkeisan += A[i][iii] * B[iii][ii];\n\t\t\t\t}\n\t\t\t\tSystem.out.print(keisan);\n\t\t\t\tif(ii < l-1){\n\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t}\n\t\t\t}\n\t\t\tSystem.out.println(\"\");\n\t\t}\n\t}\n}",
"Main",
"public static void main(String[] args)throws NumberFormatException, IOException{\n\t\t//System.out.print(\" \");\n\t\tScanner scan = new Scanner(System.in);\n\t\tint n =scan.nextInt();\n\t\tint m =scan.nextInt();\n\t\tint l =scan.nextInt();\n\t\tint A[][] = new int[100][100];\t//[???][?¨?]\n\t\tint B[][] = new int[100][100];\n\t\tlong keisan = 0;\n\n\t\tfor(int i =0; i<n; i++){\t//??????A?????????\n\t\t\tfor(int ii=0;ii<m;ii++){\n\t\t\t\tA[i][ii] = scan.nextInt();\n\t\t\t}\n\t\t}\n\n\t\tfor(int i=0;i<m;i++){\t//??????B?????????\n\t\t\tfor(int ii=0;ii<l;ii++){\n\t\t\t\tB[i][ii] = scan.nextInt();\n\t\t\t}\n\t\t}\n\n\t\tfor (int i=0; i<n; i++){\t//?¨????????????????C???\n\t\t\tfor(int ii=0; ii<l; ii++){\n\t\t\t\tkeisan = 0;\n\t\t\t\tfor(int iii=0; iii<m; iii++){\n\t\t\t\t\tkeisan += A[i][iii] * B[iii][ii];\n\t\t\t\t}\n\t\t\t\tSystem.out.print(keisan);\n\t\t\t\tif(ii < l-1){\n\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t}\n\t\t\t}\n\t\t\tSystem.out.println(\"\");\n\t\t}\n\t}",
"main",
"{\n\t\t//System.out.print(\" \");\n\t\tScanner scan = new Scanner(System.in);\n\t\tint n =scan.nextInt();\n\t\tint m =scan.nextInt();\n\t\tint l =scan.nextInt();\n\t\tint A[][] = new int[100][100];\t//[???][?¨?]\n\t\tint B[][] = new int[100][100];\n\t\tlong keisan = 0;\n\n\t\tfor(int i =0; i<n; i++){\t//??????A?????????\n\t\t\tfor(int ii=0;ii<m;ii++){\n\t\t\t\tA[i][ii] = scan.nextInt();\n\t\t\t}\n\t\t}\n\n\t\tfor(int i=0;i<m;i++){\t//??????B?????????\n\t\t\tfor(int ii=0;ii<l;ii++){\n\t\t\t\tB[i][ii] = scan.nextInt();\n\t\t\t}\n\t\t}\n\n\t\tfor (int i=0; i<n; i++){\t//?¨????????????????C???\n\t\t\tfor(int ii=0; ii<l; ii++){\n\t\t\t\tkeisan = 0;\n\t\t\t\tfor(int iii=0; iii<m; iii++){\n\t\t\t\t\tkeisan += A[i][iii] * B[iii][ii];\n\t\t\t\t}\n\t\t\t\tSystem.out.print(keisan);\n\t\t\t\tif(ii < l-1){\n\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t}\n\t\t\t}\n\t\t\tSystem.out.println(\"\");\n\t\t}\n\t}",
"Scanner scan = new Scanner(System.in);",
"scan",
"new Scanner(System.in)",
"int n =scan.nextInt();",
"n",
"scan.nextInt()",
"scan.nextInt",
"scan",
"int m =scan.nextInt();",
"m",
"scan.nextInt()",
"scan.nextInt",
"scan",
"int l =scan.nextInt();",
"l",
"scan.nextInt()",
"scan.nextInt",
"scan",
"int A[][] = new int[100][100];",
"A",
"new int[100][100]",
"100",
"100",
"int B[][] = new int[100][100];",
"B",
"new int[100][100]",
"100",
"100",
"long keisan = 0;",
"keisan",
"0",
"for(int i =0; i<n; i++){\t//??????A?????????\n\t\t\tfor(int ii=0;ii<m;ii++){\n\t\t\t\tA[i][ii] = scan.nextInt();\n\t\t\t}\n\t\t}",
"int i =0;",
"int i =0;",
"i",
"0",
"i<n",
"i",
"n",
"i++",
"i++",
"i",
"{\t//??????A?????????\n\t\t\tfor(int ii=0;ii<m;ii++){\n\t\t\t\tA[i][ii] = scan.nextInt();\n\t\t\t}\n\t\t}",
"{\t//??????A?????????\n\t\t\tfor(int ii=0;ii<m;ii++){\n\t\t\t\tA[i][ii] = scan.nextInt();\n\t\t\t}\n\t\t}",
"for(int ii=0;ii<m;ii++){\n\t\t\t\tA[i][ii] = scan.nextInt();\n\t\t\t}",
"int ii=0;",
"int ii=0;",
"ii",
"0",
"ii<m",
"ii",
"m",
"ii++",
"ii++",
"ii",
"{\n\t\t\t\tA[i][ii] = scan.nextInt();\n\t\t\t}",
"{\n\t\t\t\tA[i][ii] = scan.nextInt();\n\t\t\t}",
"A[i][ii] = scan.nextInt()",
"A[i][ii]",
"A[i]",
"A",
"i",
"ii",
"scan.nextInt()",
"scan.nextInt",
"scan",
"for(int i=0;i<m;i++){\t//??????B?????????\n\t\t\tfor(int ii=0;ii<l;ii++){\n\t\t\t\tB[i][ii] = scan.nextInt();\n\t\t\t}\n\t\t}",
"int i=0;",
"int i=0;",
"i",
"0",
"i<m",
"i",
"m",
"i++",
"i++",
"i",
"{\t//??????B?????????\n\t\t\tfor(int ii=0;ii<l;ii++){\n\t\t\t\tB[i][ii] = scan.nextInt();\n\t\t\t}\n\t\t}",
"{\t//??????B?????????\n\t\t\tfor(int ii=0;ii<l;ii++){\n\t\t\t\tB[i][ii] = scan.nextInt();\n\t\t\t}\n\t\t}",
"for(int ii=0;ii<l;ii++){\n\t\t\t\tB[i][ii] = scan.nextInt();\n\t\t\t}",
"int ii=0;",
"int ii=0;",
"ii",
"0",
"ii<l",
"ii",
"l",
"ii++",
"ii++",
"ii",
"{\n\t\t\t\tB[i][ii] = scan.nextInt();\n\t\t\t}",
"{\n\t\t\t\tB[i][ii] = scan.nextInt();\n\t\t\t}",
"B[i][ii] = scan.nextInt()",
"B[i][ii]",
"B[i]",
"B",
"i",
"ii",
"scan.nextInt()",
"scan.nextInt",
"scan",
"for (int i=0; i<n; i++){\t//?¨????????????????C???\n\t\t\tfor(int ii=0; ii<l; ii++){\n\t\t\t\tkeisan = 0;\n\t\t\t\tfor(int iii=0; iii<m; iii++){\n\t\t\t\t\tkeisan += A[i][iii] * B[iii][ii];\n\t\t\t\t}\n\t\t\t\tSystem.out.print(keisan);\n\t\t\t\tif(ii < l-1){\n\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t}\n\t\t\t}\n\t\t\tSystem.out.println(\"\");\n\t\t}",
"int i=0;",
"int i=0;",
"i",
"0",
"i<n",
"i",
"n",
"i++",
"i++",
"i",
"{\t//?¨????????????????C???\n\t\t\tfor(int ii=0; ii<l; ii++){\n\t\t\t\tkeisan = 0;\n\t\t\t\tfor(int iii=0; iii<m; iii++){\n\t\t\t\t\tkeisan += A[i][iii] * B[iii][ii];\n\t\t\t\t}\n\t\t\t\tSystem.out.print(keisan);\n\t\t\t\tif(ii < l-1){\n\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t}\n\t\t\t}\n\t\t\tSystem.out.println(\"\");\n\t\t}",
"{\t//?¨????????????????C???\n\t\t\tfor(int ii=0; ii<l; ii++){\n\t\t\t\tkeisan = 0;\n\t\t\t\tfor(int iii=0; iii<m; iii++){\n\t\t\t\t\tkeisan += A[i][iii] * B[iii][ii];\n\t\t\t\t}\n\t\t\t\tSystem.out.print(keisan);\n\t\t\t\tif(ii < l-1){\n\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t}\n\t\t\t}\n\t\t\tSystem.out.println(\"\");\n\t\t}",
"for(int ii=0; ii<l; ii++){\n\t\t\t\tkeisan = 0;\n\t\t\t\tfor(int iii=0; iii<m; iii++){\n\t\t\t\t\tkeisan += A[i][iii] * B[iii][ii];\n\t\t\t\t}\n\t\t\t\tSystem.out.print(keisan);\n\t\t\t\tif(ii < l-1){\n\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t}\n\t\t\t}",
"int ii=0;",
"int ii=0;",
"ii",
"0",
"ii<l",
"ii",
"l",
"ii++",
"ii++",
"ii",
"{\n\t\t\t\tkeisan = 0;\n\t\t\t\tfor(int iii=0; iii<m; iii++){\n\t\t\t\t\tkeisan += A[i][iii] * B[iii][ii];\n\t\t\t\t}\n\t\t\t\tSystem.out.print(keisan);\n\t\t\t\tif(ii < l-1){\n\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t}\n\t\t\t}",
"{\n\t\t\t\tkeisan = 0;\n\t\t\t\tfor(int iii=0; iii<m; iii++){\n\t\t\t\t\tkeisan += A[i][iii] * B[iii][ii];\n\t\t\t\t}\n\t\t\t\tSystem.out.print(keisan);\n\t\t\t\tif(ii < l-1){\n\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t}\n\t\t\t}",
"keisan = 0",
"keisan",
"0",
"for(int iii=0; iii<m; iii++){\n\t\t\t\t\tkeisan += A[i][iii] * B[iii][ii];\n\t\t\t\t}",
"int iii=0;",
"int iii=0;",
"iii",
"0",
"iii<m",
"iii",
"m",
"iii++",
"iii++",
"iii",
"{\n\t\t\t\t\tkeisan += A[i][iii] * B[iii][ii];\n\t\t\t\t}",
"{\n\t\t\t\t\tkeisan += A[i][iii] * B[iii][ii];\n\t\t\t\t}",
"keisan += A[i][iii] * B[iii][ii]",
"keisan",
"A[i][iii] * B[iii][ii]",
"A[i][iii]",
"A[i]",
"A",
"i",
"iii",
"B[iii][ii]",
"B[iii]",
"B",
"iii",
"ii",
"System.out.print(keisan)",
"System.out.print",
"System.out",
"System",
"System.out",
"keisan",
"if(ii < l-1){\n\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t}",
"ii < l-1",
"ii",
"l-1",
"l",
"1",
"{\n\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t}",
"System.out.print(\" \")",
"System.out.print",
"System.out",
"System",
"System.out",
"\" \"",
"System.out.println(\"\")",
"System.out.println",
"System.out",
"System",
"System.out",
"\"\"",
"String[] args",
"args"
] | import java.io.IOException;
import java.util.Scanner;
class Main{
public static void main(String[] args)throws NumberFormatException, IOException{
//System.out.print(" ");
Scanner scan = new Scanner(System.in);
int n =scan.nextInt();
int m =scan.nextInt();
int l =scan.nextInt();
int A[][] = new int[100][100]; //[???][?¨?]
int B[][] = new int[100][100];
long keisan = 0;
for(int i =0; i<n; i++){ //??????A?????????
for(int ii=0;ii<m;ii++){
A[i][ii] = scan.nextInt();
}
}
for(int i=0;i<m;i++){ //??????B?????????
for(int ii=0;ii<l;ii++){
B[i][ii] = scan.nextInt();
}
}
for (int i=0; i<n; i++){ //?¨????????????????C???
for(int ii=0; ii<l; ii++){
keisan = 0;
for(int iii=0; iii<m; iii++){
keisan += A[i][iii] * B[iii][ii];
}
System.out.print(keisan);
if(ii < l-1){
System.out.print(" ");
}
}
System.out.println("");
}
}
} |
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
17,
41,
13,
20,
17,
41,
13,
17,
41,
13,
17,
41,
13,
17,
41,
13,
17,
0,
13,
4,
18,
13,
0,
13,
4,
18,
13,
17,
0,
13,
4,
18,
13,
18,
13,
17,
0,
13,
4,
18,
13,
18,
13,
17,
0,
13,
4,
18,
13,
18,
13,
17,
14,
2,
2,
2,
2,
17,
13,
2,
13,
17,
2,
2,
17,
13,
2,
13,
17,
2,
2,
17,
13,
2,
13,
17,
30,
0,
13,
17,
14,
2,
13,
17,
30,
41,
13,
17,
41,
13,
20,
13,
41,
13,
20,
13,
13,
41,
13,
20,
13,
41,
13,
20,
13,
13,
41,
13,
20,
13,
13,
41,
13,
20,
13,
14,
2,
13,
17,
30,
14,
2,
13,
17,
30,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
18,
13,
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,
18,
18,
13,
13,
13,
2,
18,
18,
13,
13,
13,
18,
18,
13,
13,
13,
14,
2,
13,
17,
30,
0,
18,
13,
13,
2,
17,
18,
18,
13,
13,
13,
30,
0,
18,
13,
13,
2,
17,
18,
18,
13,
13,
13,
4,
18,
18,
13,
13,
18,
13,
13,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
239,
5
],
[
239,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
8,
15
],
[
15,
16
],
[
15,
17
],
[
8,
19
],
[
19,
20
],
[
19,
21
],
[
8,
22
],
[
22,
23
],
[
22,
24
],
[
8,
25
],
[
25,
26
],
[
25,
27
],
[
8,
28
],
[
28,
29
],
[
28,
30
],
[
8,
31
],
[
31,
32
],
[
31,
33
],
[
33,
34
],
[
34,
35
],
[
8,
36
],
[
36,
37
],
[
36,
38
],
[
38,
39
],
[
39,
40
],
[
38,
41
],
[
8,
42
],
[
42,
43
],
[
42,
44
],
[
44,
45
],
[
45,
46
],
[
44,
47
],
[
47,
48
],
[
47,
49
],
[
8,
50
],
[
50,
51
],
[
50,
52
],
[
52,
53
],
[
53,
54
],
[
52,
55
],
[
55,
56
],
[
55,
57
],
[
8,
58
],
[
58,
59
],
[
58,
60
],
[
60,
61
],
[
61,
62
],
[
60,
63
],
[
63,
64
],
[
63,
65
],
[
8,
66
],
[
66,
67
],
[
68,
68
],
[
68,
69
],
[
69,
70
],
[
70,
71
],
[
70,
72
],
[
69,
73
],
[
73,
74
],
[
73,
75
],
[
68,
76
],
[
76,
77
],
[
77,
78
],
[
77,
79
],
[
76,
80
],
[
80,
81
],
[
80,
82
],
[
68,
83
],
[
83,
84
],
[
84,
85
],
[
84,
86
],
[
83,
87
],
[
87,
88
],
[
87,
89
],
[
66,
90
],
[
90,
91
],
[
91,
92
],
[
91,
93
],
[
8,
94
],
[
94,
95
],
[
95,
96
],
[
95,
97
],
[
94,
98
],
[
98,
99
],
[
99,
100
],
[
99,
101
],
[
98,
102
],
[
102,
103
],
[
102,
104
],
[
98,
106
],
[
106,
107
],
[
106,
108
],
[
98,
111
],
[
111,
112
],
[
111,
113
],
[
98,
115
],
[
115,
116
],
[
115,
117
],
[
98,
120
],
[
120,
121
],
[
120,
122
],
[
98,
125
],
[
125,
126
],
[
125,
127
],
[
98,
129
],
[
129,
130
],
[
130,
131
],
[
130,
132
],
[
129,
133
],
[
98,
134
],
[
134,
135
],
[
135,
136
],
[
135,
137
],
[
134,
138
],
[
138,
139
],
[
139,
140
],
[
140,
141
],
[
141,
142
],
[
141,
143
],
[
139,
144
],
[
144,
145
],
[
144,
146
],
[
139,
147
],
[
147,
148
],
[
148,
149
],
[
139,
150
],
[
151,
151
],
[
151,
152
],
[
152,
153
],
[
153,
154
],
[
153,
155
],
[
152,
156
],
[
151,
157
],
[
157,
158
],
[
158,
159
],
[
159,
160
],
[
159,
161
],
[
157,
162
],
[
162,
163
],
[
162,
164
],
[
157,
165
],
[
165,
166
],
[
166,
167
],
[
157,
168
],
[
169,
169
],
[
169,
170
],
[
170,
171
],
[
171,
172
],
[
172,
173
],
[
172,
174
],
[
170,
175
],
[
175,
176
],
[
175,
177
],
[
170,
178
],
[
178,
179
],
[
179,
180
],
[
170,
181
],
[
182,
182
],
[
182,
183
],
[
183,
184
],
[
184,
185
],
[
185,
186
],
[
185,
187
],
[
184,
188
],
[
183,
189
],
[
189,
190
],
[
190,
191
],
[
191,
192
],
[
191,
193
],
[
190,
194
],
[
189,
195
],
[
195,
196
],
[
196,
197
],
[
196,
198
],
[
195,
199
],
[
169,
200
],
[
200,
201
],
[
201,
202
],
[
201,
203
],
[
200,
204
],
[
204,
205
],
[
205,
206
],
[
206,
207
],
[
206,
208
],
[
205,
209
],
[
209,
210
],
[
209,
211
],
[
211,
212
],
[
212,
213
],
[
212,
214
],
[
211,
215
],
[
200,
216
],
[
216,
217
],
[
217,
218
],
[
218,
219
],
[
218,
220
],
[
217,
221
],
[
221,
222
],
[
221,
223
],
[
223,
224
],
[
224,
225
],
[
224,
226
],
[
223,
227
],
[
151,
228
],
[
228,
229
],
[
229,
230
],
[
230,
231
],
[
230,
232
],
[
228,
233
],
[
233,
234
],
[
233,
235
],
[
6,
236
],
[
236,
237
],
[
0,
238
],
[
238,
239
],
[
238,
240
]
] | [
"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\tString input_nml = \"\";\n\t\tString[] nml_data = new String[3];\n\t\tint n = 0;\n\t\tint m = 0;\n\t\tint l = 0;\n\t\tboolean judge = true;\n\n\t\tinput_nml = sc.nextLine();\n\t\tnml_data = input_nml.split(\" \");\n\t\tn = Integer.parseInt(nml_data[0]);\n\t\tm = Integer.parseInt(nml_data[1]);\n\t\tl = Integer.parseInt(nml_data[2]);\n\n\t\tif ((1 > n || n > 100) || (1 > m || m > 100) || (1 > l || l > 100)) {\n\t\t\tjudge = false;\n\t\t}\n\n\t\tif (judge == true) {\n\t\t\tString input_AB = \"\";\n\t\t\tString[] A_in = new String[m];\n\t\t\tint[][] A_out = new int[n][m];\n\t\t\tString[] B_in = new String[l];\n\t\t\tint[][] B_out = new int[m][l];\n\t\t\tlong[][] C_out = new long[n][l];\n\t\t\tString[] output_result = new String[n];\n\n\t\t\t// Aの入力とその値のチェック\n\t\t\tout: for (int i = 0; i < n; i++) {\n\t\t\t\tinput_AB = sc.nextLine();\n\t\t\t\tA_in = input_AB.split(\" \");\n\n\t\t\t\tfor (int j = 0; j < m; j++) {\n\t\t\t\t\tA_out[i][j] = Integer.parseInt(A_in[j]);\n\n\t\t\t\t\tif (A_out[i][j] < 0 || A_out[i][j] > 10000) {\n\t\t\t\t\t\tjudge = false;\n\t\t\t\t\t\tbreak out;\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}// Aの入力ここまで\n\n\t\t\tif (judge == true) {\n\n\t\t\t\t// Bの入力とその値のチェック\n\t\t\t\tout: for (int k = 0; k < m; k++) {\n\t\t\t\t\tinput_AB = sc.nextLine();\n\t\t\t\t\tB_in = input_AB.split(\" \");\n\n\t\t\t\t\tfor (int p = 0; p < l; p++) {\n\t\t\t\t\t\tB_out[k][p] = Integer.parseInt(B_in[p]);\n\n\t\t\t\t\t\tif (B_out[k][p] < 0 || B_out[k][p] > 10000) {\n\t\t\t\t\t\t\tjudge = false;\n\t\t\t\t\t\t\tbreak out;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}// Bの入力ここまで\n\n\t\t\tif (judge == true) {\n\n\t\t\t\tfor (int i = 0; i < n; i++) {\n\t\t\t\t\toutput_result[i] = \"\";\n\t\t\t\t\tfor (int j = 0; j < l; j++) {\n\n\t\t\t\t\t\tfor (int k = 0; k < m; k++) {\n\t\t\t\t\t\t\tC_out[i][j] += A_out[i][k] * B_out[k][j];\n\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (j == 0) {\n\t\t\t\t\t\t\toutput_result[i] += \"\" + C_out[i][j];\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\toutput_result[i] += \" \" + C_out[i][j];\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// System.out.print(C_out[i][j]);\n\n\t\t\t\t\t}\n\n\t\t\t\t\tSystem.out.println(output_result[i]);\n\t\t\t\t\t// System.out.println();\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\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\tString input_nml = \"\";\n\t\tString[] nml_data = new String[3];\n\t\tint n = 0;\n\t\tint m = 0;\n\t\tint l = 0;\n\t\tboolean judge = true;\n\n\t\tinput_nml = sc.nextLine();\n\t\tnml_data = input_nml.split(\" \");\n\t\tn = Integer.parseInt(nml_data[0]);\n\t\tm = Integer.parseInt(nml_data[1]);\n\t\tl = Integer.parseInt(nml_data[2]);\n\n\t\tif ((1 > n || n > 100) || (1 > m || m > 100) || (1 > l || l > 100)) {\n\t\t\tjudge = false;\n\t\t}\n\n\t\tif (judge == true) {\n\t\t\tString input_AB = \"\";\n\t\t\tString[] A_in = new String[m];\n\t\t\tint[][] A_out = new int[n][m];\n\t\t\tString[] B_in = new String[l];\n\t\t\tint[][] B_out = new int[m][l];\n\t\t\tlong[][] C_out = new long[n][l];\n\t\t\tString[] output_result = new String[n];\n\n\t\t\t// Aの入力とその値のチェック\n\t\t\tout: for (int i = 0; i < n; i++) {\n\t\t\t\tinput_AB = sc.nextLine();\n\t\t\t\tA_in = input_AB.split(\" \");\n\n\t\t\t\tfor (int j = 0; j < m; j++) {\n\t\t\t\t\tA_out[i][j] = Integer.parseInt(A_in[j]);\n\n\t\t\t\t\tif (A_out[i][j] < 0 || A_out[i][j] > 10000) {\n\t\t\t\t\t\tjudge = false;\n\t\t\t\t\t\tbreak out;\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}// Aの入力ここまで\n\n\t\t\tif (judge == true) {\n\n\t\t\t\t// Bの入力とその値のチェック\n\t\t\t\tout: for (int k = 0; k < m; k++) {\n\t\t\t\t\tinput_AB = sc.nextLine();\n\t\t\t\t\tB_in = input_AB.split(\" \");\n\n\t\t\t\t\tfor (int p = 0; p < l; p++) {\n\t\t\t\t\t\tB_out[k][p] = Integer.parseInt(B_in[p]);\n\n\t\t\t\t\t\tif (B_out[k][p] < 0 || B_out[k][p] > 10000) {\n\t\t\t\t\t\t\tjudge = false;\n\t\t\t\t\t\t\tbreak out;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}// Bの入力ここまで\n\n\t\t\tif (judge == true) {\n\n\t\t\t\tfor (int i = 0; i < n; i++) {\n\t\t\t\t\toutput_result[i] = \"\";\n\t\t\t\t\tfor (int j = 0; j < l; j++) {\n\n\t\t\t\t\t\tfor (int k = 0; k < m; k++) {\n\t\t\t\t\t\t\tC_out[i][j] += A_out[i][k] * B_out[k][j];\n\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (j == 0) {\n\t\t\t\t\t\t\toutput_result[i] += \"\" + C_out[i][j];\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\toutput_result[i] += \" \" + C_out[i][j];\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// System.out.print(C_out[i][j]);\n\n\t\t\t\t\t}\n\n\t\t\t\t\tSystem.out.println(output_result[i]);\n\t\t\t\t\t// System.out.println();\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t}\n}",
"Main",
"public static void main(String[] args) {\n\t\t// TODO 自動生成されたメソッド・スタブ\n\t\tScanner sc = new Scanner(System.in);\n\t\tString input_nml = \"\";\n\t\tString[] nml_data = new String[3];\n\t\tint n = 0;\n\t\tint m = 0;\n\t\tint l = 0;\n\t\tboolean judge = true;\n\n\t\tinput_nml = sc.nextLine();\n\t\tnml_data = input_nml.split(\" \");\n\t\tn = Integer.parseInt(nml_data[0]);\n\t\tm = Integer.parseInt(nml_data[1]);\n\t\tl = Integer.parseInt(nml_data[2]);\n\n\t\tif ((1 > n || n > 100) || (1 > m || m > 100) || (1 > l || l > 100)) {\n\t\t\tjudge = false;\n\t\t}\n\n\t\tif (judge == true) {\n\t\t\tString input_AB = \"\";\n\t\t\tString[] A_in = new String[m];\n\t\t\tint[][] A_out = new int[n][m];\n\t\t\tString[] B_in = new String[l];\n\t\t\tint[][] B_out = new int[m][l];\n\t\t\tlong[][] C_out = new long[n][l];\n\t\t\tString[] output_result = new String[n];\n\n\t\t\t// Aの入力とその値のチェック\n\t\t\tout: for (int i = 0; i < n; i++) {\n\t\t\t\tinput_AB = sc.nextLine();\n\t\t\t\tA_in = input_AB.split(\" \");\n\n\t\t\t\tfor (int j = 0; j < m; j++) {\n\t\t\t\t\tA_out[i][j] = Integer.parseInt(A_in[j]);\n\n\t\t\t\t\tif (A_out[i][j] < 0 || A_out[i][j] > 10000) {\n\t\t\t\t\t\tjudge = false;\n\t\t\t\t\t\tbreak out;\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}// Aの入力ここまで\n\n\t\t\tif (judge == true) {\n\n\t\t\t\t// Bの入力とその値のチェック\n\t\t\t\tout: for (int k = 0; k < m; k++) {\n\t\t\t\t\tinput_AB = sc.nextLine();\n\t\t\t\t\tB_in = input_AB.split(\" \");\n\n\t\t\t\t\tfor (int p = 0; p < l; p++) {\n\t\t\t\t\t\tB_out[k][p] = Integer.parseInt(B_in[p]);\n\n\t\t\t\t\t\tif (B_out[k][p] < 0 || B_out[k][p] > 10000) {\n\t\t\t\t\t\t\tjudge = false;\n\t\t\t\t\t\t\tbreak out;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}// Bの入力ここまで\n\n\t\t\tif (judge == true) {\n\n\t\t\t\tfor (int i = 0; i < n; i++) {\n\t\t\t\t\toutput_result[i] = \"\";\n\t\t\t\t\tfor (int j = 0; j < l; j++) {\n\n\t\t\t\t\t\tfor (int k = 0; k < m; k++) {\n\t\t\t\t\t\t\tC_out[i][j] += A_out[i][k] * B_out[k][j];\n\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (j == 0) {\n\t\t\t\t\t\t\toutput_result[i] += \"\" + C_out[i][j];\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\toutput_result[i] += \" \" + C_out[i][j];\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// System.out.print(C_out[i][j]);\n\n\t\t\t\t\t}\n\n\t\t\t\t\tSystem.out.println(output_result[i]);\n\t\t\t\t\t// System.out.println();\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t}",
"main",
"{\n\t\t// TODO 自動生成されたメソッド・スタブ\n\t\tScanner sc = new Scanner(System.in);\n\t\tString input_nml = \"\";\n\t\tString[] nml_data = new String[3];\n\t\tint n = 0;\n\t\tint m = 0;\n\t\tint l = 0;\n\t\tboolean judge = true;\n\n\t\tinput_nml = sc.nextLine();\n\t\tnml_data = input_nml.split(\" \");\n\t\tn = Integer.parseInt(nml_data[0]);\n\t\tm = Integer.parseInt(nml_data[1]);\n\t\tl = Integer.parseInt(nml_data[2]);\n\n\t\tif ((1 > n || n > 100) || (1 > m || m > 100) || (1 > l || l > 100)) {\n\t\t\tjudge = false;\n\t\t}\n\n\t\tif (judge == true) {\n\t\t\tString input_AB = \"\";\n\t\t\tString[] A_in = new String[m];\n\t\t\tint[][] A_out = new int[n][m];\n\t\t\tString[] B_in = new String[l];\n\t\t\tint[][] B_out = new int[m][l];\n\t\t\tlong[][] C_out = new long[n][l];\n\t\t\tString[] output_result = new String[n];\n\n\t\t\t// Aの入力とその値のチェック\n\t\t\tout: for (int i = 0; i < n; i++) {\n\t\t\t\tinput_AB = sc.nextLine();\n\t\t\t\tA_in = input_AB.split(\" \");\n\n\t\t\t\tfor (int j = 0; j < m; j++) {\n\t\t\t\t\tA_out[i][j] = Integer.parseInt(A_in[j]);\n\n\t\t\t\t\tif (A_out[i][j] < 0 || A_out[i][j] > 10000) {\n\t\t\t\t\t\tjudge = false;\n\t\t\t\t\t\tbreak out;\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}// Aの入力ここまで\n\n\t\t\tif (judge == true) {\n\n\t\t\t\t// Bの入力とその値のチェック\n\t\t\t\tout: for (int k = 0; k < m; k++) {\n\t\t\t\t\tinput_AB = sc.nextLine();\n\t\t\t\t\tB_in = input_AB.split(\" \");\n\n\t\t\t\t\tfor (int p = 0; p < l; p++) {\n\t\t\t\t\t\tB_out[k][p] = Integer.parseInt(B_in[p]);\n\n\t\t\t\t\t\tif (B_out[k][p] < 0 || B_out[k][p] > 10000) {\n\t\t\t\t\t\t\tjudge = false;\n\t\t\t\t\t\t\tbreak out;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}// Bの入力ここまで\n\n\t\t\tif (judge == true) {\n\n\t\t\t\tfor (int i = 0; i < n; i++) {\n\t\t\t\t\toutput_result[i] = \"\";\n\t\t\t\t\tfor (int j = 0; j < l; j++) {\n\n\t\t\t\t\t\tfor (int k = 0; k < m; k++) {\n\t\t\t\t\t\t\tC_out[i][j] += A_out[i][k] * B_out[k][j];\n\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (j == 0) {\n\t\t\t\t\t\t\toutput_result[i] += \"\" + C_out[i][j];\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\toutput_result[i] += \" \" + C_out[i][j];\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// System.out.print(C_out[i][j]);\n\n\t\t\t\t\t}\n\n\t\t\t\t\tSystem.out.println(output_result[i]);\n\t\t\t\t\t// System.out.println();\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t}",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"String input_nml = \"\";",
"input_nml",
"\"\"",
"String[] nml_data = new String[3];",
"nml_data",
"new String[3]",
"3",
"int n = 0;",
"n",
"0",
"int m = 0;",
"m",
"0",
"int l = 0;",
"l",
"0",
"boolean judge = true;",
"judge",
"true",
"input_nml = sc.nextLine()",
"input_nml",
"sc.nextLine()",
"sc.nextLine",
"sc",
"nml_data = input_nml.split(\" \")",
"nml_data",
"input_nml.split(\" \")",
"input_nml.split",
"input_nml",
"\" \"",
"n = Integer.parseInt(nml_data[0])",
"n",
"Integer.parseInt(nml_data[0])",
"Integer.parseInt",
"Integer",
"nml_data[0]",
"nml_data",
"0",
"m = Integer.parseInt(nml_data[1])",
"m",
"Integer.parseInt(nml_data[1])",
"Integer.parseInt",
"Integer",
"nml_data[1]",
"nml_data",
"1",
"l = Integer.parseInt(nml_data[2])",
"l",
"Integer.parseInt(nml_data[2])",
"Integer.parseInt",
"Integer",
"nml_data[2]",
"nml_data",
"2",
"if ((1 > n || n > 100) || (1 > m || m > 100) || (1 > l || l > 100)) {\n\t\t\tjudge = false;\n\t\t}",
"(1 > n || n > 100) || (1 > m || m > 100) || (1 > l || l > 100)",
"(1 > n || n > 100) || (1 > m || m > 100) || (1 > l || l > 100)",
"(1 > n || n > 100)",
"1 > n",
"1",
"n",
"n > 100",
"n",
"100",
"(1 > m || m > 100)",
"1 > m",
"1",
"m",
"m > 100",
"m",
"100",
"(1 > l || l > 100)",
"1 > l",
"1",
"l",
"l > 100",
"l",
"100",
"{\n\t\t\tjudge = false;\n\t\t}",
"judge = false",
"judge",
"false",
"if (judge == true) {\n\t\t\tString input_AB = \"\";\n\t\t\tString[] A_in = new String[m];\n\t\t\tint[][] A_out = new int[n][m];\n\t\t\tString[] B_in = new String[l];\n\t\t\tint[][] B_out = new int[m][l];\n\t\t\tlong[][] C_out = new long[n][l];\n\t\t\tString[] output_result = new String[n];\n\n\t\t\t// Aの入力とその値のチェック\n\t\t\tout: for (int i = 0; i < n; i++) {\n\t\t\t\tinput_AB = sc.nextLine();\n\t\t\t\tA_in = input_AB.split(\" \");\n\n\t\t\t\tfor (int j = 0; j < m; j++) {\n\t\t\t\t\tA_out[i][j] = Integer.parseInt(A_in[j]);\n\n\t\t\t\t\tif (A_out[i][j] < 0 || A_out[i][j] > 10000) {\n\t\t\t\t\t\tjudge = false;\n\t\t\t\t\t\tbreak out;\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}// Aの入力ここまで\n\n\t\t\tif (judge == true) {\n\n\t\t\t\t// Bの入力とその値のチェック\n\t\t\t\tout: for (int k = 0; k < m; k++) {\n\t\t\t\t\tinput_AB = sc.nextLine();\n\t\t\t\t\tB_in = input_AB.split(\" \");\n\n\t\t\t\t\tfor (int p = 0; p < l; p++) {\n\t\t\t\t\t\tB_out[k][p] = Integer.parseInt(B_in[p]);\n\n\t\t\t\t\t\tif (B_out[k][p] < 0 || B_out[k][p] > 10000) {\n\t\t\t\t\t\t\tjudge = false;\n\t\t\t\t\t\t\tbreak out;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}// Bの入力ここまで\n\n\t\t\tif (judge == true) {\n\n\t\t\t\tfor (int i = 0; i < n; i++) {\n\t\t\t\t\toutput_result[i] = \"\";\n\t\t\t\t\tfor (int j = 0; j < l; j++) {\n\n\t\t\t\t\t\tfor (int k = 0; k < m; k++) {\n\t\t\t\t\t\t\tC_out[i][j] += A_out[i][k] * B_out[k][j];\n\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (j == 0) {\n\t\t\t\t\t\t\toutput_result[i] += \"\" + C_out[i][j];\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\toutput_result[i] += \" \" + C_out[i][j];\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// System.out.print(C_out[i][j]);\n\n\t\t\t\t\t}\n\n\t\t\t\t\tSystem.out.println(output_result[i]);\n\t\t\t\t\t// System.out.println();\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}",
"judge == true",
"judge",
"true",
"{\n\t\t\tString input_AB = \"\";\n\t\t\tString[] A_in = new String[m];\n\t\t\tint[][] A_out = new int[n][m];\n\t\t\tString[] B_in = new String[l];\n\t\t\tint[][] B_out = new int[m][l];\n\t\t\tlong[][] C_out = new long[n][l];\n\t\t\tString[] output_result = new String[n];\n\n\t\t\t// Aの入力とその値のチェック\n\t\t\tout: for (int i = 0; i < n; i++) {\n\t\t\t\tinput_AB = sc.nextLine();\n\t\t\t\tA_in = input_AB.split(\" \");\n\n\t\t\t\tfor (int j = 0; j < m; j++) {\n\t\t\t\t\tA_out[i][j] = Integer.parseInt(A_in[j]);\n\n\t\t\t\t\tif (A_out[i][j] < 0 || A_out[i][j] > 10000) {\n\t\t\t\t\t\tjudge = false;\n\t\t\t\t\t\tbreak out;\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}// Aの入力ここまで\n\n\t\t\tif (judge == true) {\n\n\t\t\t\t// Bの入力とその値のチェック\n\t\t\t\tout: for (int k = 0; k < m; k++) {\n\t\t\t\t\tinput_AB = sc.nextLine();\n\t\t\t\t\tB_in = input_AB.split(\" \");\n\n\t\t\t\t\tfor (int p = 0; p < l; p++) {\n\t\t\t\t\t\tB_out[k][p] = Integer.parseInt(B_in[p]);\n\n\t\t\t\t\t\tif (B_out[k][p] < 0 || B_out[k][p] > 10000) {\n\t\t\t\t\t\t\tjudge = false;\n\t\t\t\t\t\t\tbreak out;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}// Bの入力ここまで\n\n\t\t\tif (judge == true) {\n\n\t\t\t\tfor (int i = 0; i < n; i++) {\n\t\t\t\t\toutput_result[i] = \"\";\n\t\t\t\t\tfor (int j = 0; j < l; j++) {\n\n\t\t\t\t\t\tfor (int k = 0; k < m; k++) {\n\t\t\t\t\t\t\tC_out[i][j] += A_out[i][k] * B_out[k][j];\n\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (j == 0) {\n\t\t\t\t\t\t\toutput_result[i] += \"\" + C_out[i][j];\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\toutput_result[i] += \" \" + C_out[i][j];\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// System.out.print(C_out[i][j]);\n\n\t\t\t\t\t}\n\n\t\t\t\t\tSystem.out.println(output_result[i]);\n\t\t\t\t\t// System.out.println();\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}",
"String input_AB = \"\";",
"input_AB",
"\"\"",
"String[] A_in = new String[m];",
"A_in",
"new String[m]",
"m",
"int[][] A_out = new int[n][m];",
"A_out",
"new int[n][m]",
"n",
"m",
"String[] B_in = new String[l];",
"B_in",
"new String[l]",
"l",
"int[][] B_out = new int[m][l];",
"B_out",
"new int[m][l]",
"m",
"l",
"long[][] C_out = new long[n][l];",
"C_out",
"new long[n][l]",
"n",
"l",
"String[] output_result = new String[n];",
"output_result",
"new String[n]",
"n",
"if (judge == true) {\n\n\t\t\t\t// Bの入力とその値のチェック\n\t\t\t\tout: for (int k = 0; k < m; k++) {\n\t\t\t\t\tinput_AB = sc.nextLine();\n\t\t\t\t\tB_in = input_AB.split(\" \");\n\n\t\t\t\t\tfor (int p = 0; p < l; p++) {\n\t\t\t\t\t\tB_out[k][p] = Integer.parseInt(B_in[p]);\n\n\t\t\t\t\t\tif (B_out[k][p] < 0 || B_out[k][p] > 10000) {\n\t\t\t\t\t\t\tjudge = false;\n\t\t\t\t\t\t\tbreak out;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}// Bの入力ここまで",
"judge == true",
"judge",
"true",
"{\n\n\t\t\t\t// Bの入力とその値のチェック\n\t\t\t\tout: for (int k = 0; k < m; k++) {\n\t\t\t\t\tinput_AB = sc.nextLine();\n\t\t\t\t\tB_in = input_AB.split(\" \");\n\n\t\t\t\t\tfor (int p = 0; p < l; p++) {\n\t\t\t\t\t\tB_out[k][p] = Integer.parseInt(B_in[p]);\n\n\t\t\t\t\t\tif (B_out[k][p] < 0 || B_out[k][p] > 10000) {\n\t\t\t\t\t\t\tjudge = false;\n\t\t\t\t\t\t\tbreak out;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}",
"if (judge == true) {\n\n\t\t\t\tfor (int i = 0; i < n; i++) {\n\t\t\t\t\toutput_result[i] = \"\";\n\t\t\t\t\tfor (int j = 0; j < l; j++) {\n\n\t\t\t\t\t\tfor (int k = 0; k < m; k++) {\n\t\t\t\t\t\t\tC_out[i][j] += A_out[i][k] * B_out[k][j];\n\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (j == 0) {\n\t\t\t\t\t\t\toutput_result[i] += \"\" + C_out[i][j];\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\toutput_result[i] += \" \" + C_out[i][j];\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// System.out.print(C_out[i][j]);\n\n\t\t\t\t\t}\n\n\t\t\t\t\tSystem.out.println(output_result[i]);\n\t\t\t\t\t// System.out.println();\n\t\t\t\t}\n\n\t\t\t}",
"judge == true",
"judge",
"true",
"{\n\n\t\t\t\tfor (int i = 0; i < n; i++) {\n\t\t\t\t\toutput_result[i] = \"\";\n\t\t\t\t\tfor (int j = 0; j < l; j++) {\n\n\t\t\t\t\t\tfor (int k = 0; k < m; k++) {\n\t\t\t\t\t\t\tC_out[i][j] += A_out[i][k] * B_out[k][j];\n\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (j == 0) {\n\t\t\t\t\t\t\toutput_result[i] += \"\" + C_out[i][j];\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\toutput_result[i] += \" \" + C_out[i][j];\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// System.out.print(C_out[i][j]);\n\n\t\t\t\t\t}\n\n\t\t\t\t\tSystem.out.println(output_result[i]);\n\t\t\t\t\t// System.out.println();\n\t\t\t\t}\n\n\t\t\t}",
"for (int i = 0; i < n; i++) {\n\t\t\t\t\toutput_result[i] = \"\";\n\t\t\t\t\tfor (int j = 0; j < l; j++) {\n\n\t\t\t\t\t\tfor (int k = 0; k < m; k++) {\n\t\t\t\t\t\t\tC_out[i][j] += A_out[i][k] * B_out[k][j];\n\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (j == 0) {\n\t\t\t\t\t\t\toutput_result[i] += \"\" + C_out[i][j];\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\toutput_result[i] += \" \" + C_out[i][j];\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// System.out.print(C_out[i][j]);\n\n\t\t\t\t\t}\n\n\t\t\t\t\tSystem.out.println(output_result[i]);\n\t\t\t\t\t// System.out.println();\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\toutput_result[i] = \"\";\n\t\t\t\t\tfor (int j = 0; j < l; j++) {\n\n\t\t\t\t\t\tfor (int k = 0; k < m; k++) {\n\t\t\t\t\t\t\tC_out[i][j] += A_out[i][k] * B_out[k][j];\n\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (j == 0) {\n\t\t\t\t\t\t\toutput_result[i] += \"\" + C_out[i][j];\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\toutput_result[i] += \" \" + C_out[i][j];\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// System.out.print(C_out[i][j]);\n\n\t\t\t\t\t}\n\n\t\t\t\t\tSystem.out.println(output_result[i]);\n\t\t\t\t\t// System.out.println();\n\t\t\t\t}",
"{\n\t\t\t\t\toutput_result[i] = \"\";\n\t\t\t\t\tfor (int j = 0; j < l; j++) {\n\n\t\t\t\t\t\tfor (int k = 0; k < m; k++) {\n\t\t\t\t\t\t\tC_out[i][j] += A_out[i][k] * B_out[k][j];\n\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (j == 0) {\n\t\t\t\t\t\t\toutput_result[i] += \"\" + C_out[i][j];\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\toutput_result[i] += \" \" + C_out[i][j];\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// System.out.print(C_out[i][j]);\n\n\t\t\t\t\t}\n\n\t\t\t\t\tSystem.out.println(output_result[i]);\n\t\t\t\t\t// System.out.println();\n\t\t\t\t}",
"output_result[i] = \"\"",
"output_result[i]",
"output_result",
"i",
"\"\"",
"for (int j = 0; j < l; j++) {\n\n\t\t\t\t\t\tfor (int k = 0; k < m; k++) {\n\t\t\t\t\t\t\tC_out[i][j] += A_out[i][k] * B_out[k][j];\n\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (j == 0) {\n\t\t\t\t\t\t\toutput_result[i] += \"\" + C_out[i][j];\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\toutput_result[i] += \" \" + C_out[i][j];\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// System.out.print(C_out[i][j]);\n\n\t\t\t\t\t}",
"int j = 0;",
"int j = 0;",
"j",
"0",
"j < l",
"j",
"l",
"j++",
"j++",
"j",
"{\n\n\t\t\t\t\t\tfor (int k = 0; k < m; k++) {\n\t\t\t\t\t\t\tC_out[i][j] += A_out[i][k] * B_out[k][j];\n\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (j == 0) {\n\t\t\t\t\t\t\toutput_result[i] += \"\" + C_out[i][j];\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\toutput_result[i] += \" \" + C_out[i][j];\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// System.out.print(C_out[i][j]);\n\n\t\t\t\t\t}",
"{\n\n\t\t\t\t\t\tfor (int k = 0; k < m; k++) {\n\t\t\t\t\t\t\tC_out[i][j] += A_out[i][k] * B_out[k][j];\n\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (j == 0) {\n\t\t\t\t\t\t\toutput_result[i] += \"\" + C_out[i][j];\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\toutput_result[i] += \" \" + C_out[i][j];\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// System.out.print(C_out[i][j]);\n\n\t\t\t\t\t}",
"for (int k = 0; k < m; k++) {\n\t\t\t\t\t\t\tC_out[i][j] += A_out[i][k] * B_out[k][j];\n\n\t\t\t\t\t\t}",
"int k = 0;",
"int k = 0;",
"k",
"0",
"k < m",
"k",
"m",
"k++",
"k++",
"k",
"{\n\t\t\t\t\t\t\tC_out[i][j] += A_out[i][k] * B_out[k][j];\n\n\t\t\t\t\t\t}",
"{\n\t\t\t\t\t\t\tC_out[i][j] += A_out[i][k] * B_out[k][j];\n\n\t\t\t\t\t\t}",
"C_out[i][j] += A_out[i][k] * B_out[k][j]",
"C_out[i][j]",
"C_out[i]",
"C_out",
"i",
"j",
"A_out[i][k] * B_out[k][j]",
"A_out[i][k]",
"A_out[i]",
"A_out",
"i",
"k",
"B_out[k][j]",
"B_out[k]",
"B_out",
"k",
"j",
"if (j == 0) {\n\t\t\t\t\t\t\toutput_result[i] += \"\" + C_out[i][j];\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\toutput_result[i] += \" \" + C_out[i][j];\n\t\t\t\t\t\t}",
"j == 0",
"j",
"0",
"{\n\t\t\t\t\t\t\toutput_result[i] += \"\" + C_out[i][j];\n\t\t\t\t\t\t}",
"output_result[i] += \"\" + C_out[i][j]",
"output_result[i]",
"output_result",
"i",
"\"\" + C_out[i][j]",
"\"\"",
"C_out[i][j]",
"C_out[i]",
"C_out",
"i",
"j",
"{\n\t\t\t\t\t\t\toutput_result[i] += \" \" + C_out[i][j];\n\t\t\t\t\t\t}",
"output_result[i] += \" \" + C_out[i][j]",
"output_result[i]",
"output_result",
"i",
"\" \" + C_out[i][j]",
"\" \"",
"C_out[i][j]",
"C_out[i]",
"C_out",
"i",
"j",
"System.out.println(output_result[i])",
"System.out.println",
"System.out",
"System",
"System.out",
"output_result[i]",
"output_result",
"i",
"String[] args",
"args",
"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\tString input_nml = \"\";\n\t\tString[] nml_data = new String[3];\n\t\tint n = 0;\n\t\tint m = 0;\n\t\tint l = 0;\n\t\tboolean judge = true;\n\n\t\tinput_nml = sc.nextLine();\n\t\tnml_data = input_nml.split(\" \");\n\t\tn = Integer.parseInt(nml_data[0]);\n\t\tm = Integer.parseInt(nml_data[1]);\n\t\tl = Integer.parseInt(nml_data[2]);\n\n\t\tif ((1 > n || n > 100) || (1 > m || m > 100) || (1 > l || l > 100)) {\n\t\t\tjudge = false;\n\t\t}\n\n\t\tif (judge == true) {\n\t\t\tString input_AB = \"\";\n\t\t\tString[] A_in = new String[m];\n\t\t\tint[][] A_out = new int[n][m];\n\t\t\tString[] B_in = new String[l];\n\t\t\tint[][] B_out = new int[m][l];\n\t\t\tlong[][] C_out = new long[n][l];\n\t\t\tString[] output_result = new String[n];\n\n\t\t\t// Aの入力とその値のチェック\n\t\t\tout: for (int i = 0; i < n; i++) {\n\t\t\t\tinput_AB = sc.nextLine();\n\t\t\t\tA_in = input_AB.split(\" \");\n\n\t\t\t\tfor (int j = 0; j < m; j++) {\n\t\t\t\t\tA_out[i][j] = Integer.parseInt(A_in[j]);\n\n\t\t\t\t\tif (A_out[i][j] < 0 || A_out[i][j] > 10000) {\n\t\t\t\t\t\tjudge = false;\n\t\t\t\t\t\tbreak out;\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}// Aの入力ここまで\n\n\t\t\tif (judge == true) {\n\n\t\t\t\t// Bの入力とその値のチェック\n\t\t\t\tout: for (int k = 0; k < m; k++) {\n\t\t\t\t\tinput_AB = sc.nextLine();\n\t\t\t\t\tB_in = input_AB.split(\" \");\n\n\t\t\t\t\tfor (int p = 0; p < l; p++) {\n\t\t\t\t\t\tB_out[k][p] = Integer.parseInt(B_in[p]);\n\n\t\t\t\t\t\tif (B_out[k][p] < 0 || B_out[k][p] > 10000) {\n\t\t\t\t\t\t\tjudge = false;\n\t\t\t\t\t\t\tbreak out;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}// Bの入力ここまで\n\n\t\t\tif (judge == true) {\n\n\t\t\t\tfor (int i = 0; i < n; i++) {\n\t\t\t\t\toutput_result[i] = \"\";\n\t\t\t\t\tfor (int j = 0; j < l; j++) {\n\n\t\t\t\t\t\tfor (int k = 0; k < m; k++) {\n\t\t\t\t\t\t\tC_out[i][j] += A_out[i][k] * B_out[k][j];\n\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (j == 0) {\n\t\t\t\t\t\t\toutput_result[i] += \"\" + C_out[i][j];\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\toutput_result[i] += \" \" + C_out[i][j];\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// System.out.print(C_out[i][j]);\n\n\t\t\t\t\t}\n\n\t\t\t\t\tSystem.out.println(output_result[i]);\n\t\t\t\t\t// System.out.println();\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t}\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\tString input_nml = \"\";\n\t\tString[] nml_data = new String[3];\n\t\tint n = 0;\n\t\tint m = 0;\n\t\tint l = 0;\n\t\tboolean judge = true;\n\n\t\tinput_nml = sc.nextLine();\n\t\tnml_data = input_nml.split(\" \");\n\t\tn = Integer.parseInt(nml_data[0]);\n\t\tm = Integer.parseInt(nml_data[1]);\n\t\tl = Integer.parseInt(nml_data[2]);\n\n\t\tif ((1 > n || n > 100) || (1 > m || m > 100) || (1 > l || l > 100)) {\n\t\t\tjudge = false;\n\t\t}\n\n\t\tif (judge == true) {\n\t\t\tString input_AB = \"\";\n\t\t\tString[] A_in = new String[m];\n\t\t\tint[][] A_out = new int[n][m];\n\t\t\tString[] B_in = new String[l];\n\t\t\tint[][] B_out = new int[m][l];\n\t\t\tlong[][] C_out = new long[n][l];\n\t\t\tString[] output_result = new String[n];\n\n\t\t\t// Aの入力とその値のチェック\n\t\t\tout: for (int i = 0; i < n; i++) {\n\t\t\t\tinput_AB = sc.nextLine();\n\t\t\t\tA_in = input_AB.split(\" \");\n\n\t\t\t\tfor (int j = 0; j < m; j++) {\n\t\t\t\t\tA_out[i][j] = Integer.parseInt(A_in[j]);\n\n\t\t\t\t\tif (A_out[i][j] < 0 || A_out[i][j] > 10000) {\n\t\t\t\t\t\tjudge = false;\n\t\t\t\t\t\tbreak out;\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}// Aの入力ここまで\n\n\t\t\tif (judge == true) {\n\n\t\t\t\t// Bの入力とその値のチェック\n\t\t\t\tout: for (int k = 0; k < m; k++) {\n\t\t\t\t\tinput_AB = sc.nextLine();\n\t\t\t\t\tB_in = input_AB.split(\" \");\n\n\t\t\t\t\tfor (int p = 0; p < l; p++) {\n\t\t\t\t\t\tB_out[k][p] = Integer.parseInt(B_in[p]);\n\n\t\t\t\t\t\tif (B_out[k][p] < 0 || B_out[k][p] > 10000) {\n\t\t\t\t\t\t\tjudge = false;\n\t\t\t\t\t\t\tbreak out;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}// Bの入力ここまで\n\n\t\t\tif (judge == true) {\n\n\t\t\t\tfor (int i = 0; i < n; i++) {\n\t\t\t\t\toutput_result[i] = \"\";\n\t\t\t\t\tfor (int j = 0; j < l; j++) {\n\n\t\t\t\t\t\tfor (int k = 0; k < m; k++) {\n\t\t\t\t\t\t\tC_out[i][j] += A_out[i][k] * B_out[k][j];\n\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (j == 0) {\n\t\t\t\t\t\t\toutput_result[i] += \"\" + C_out[i][j];\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\toutput_result[i] += \" \" + C_out[i][j];\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// System.out.print(C_out[i][j]);\n\n\t\t\t\t\t}\n\n\t\t\t\t\tSystem.out.println(output_result[i]);\n\t\t\t\t\t// System.out.println();\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t}\n}",
"Main"
] | import java.util.Scanner;
public class Main{
public static void main(String[] args) {
// TODO 自動生成されたメソッド・スタブ
Scanner sc = new Scanner(System.in);
String input_nml = "";
String[] nml_data = new String[3];
int n = 0;
int m = 0;
int l = 0;
boolean judge = true;
input_nml = sc.nextLine();
nml_data = input_nml.split(" ");
n = Integer.parseInt(nml_data[0]);
m = Integer.parseInt(nml_data[1]);
l = Integer.parseInt(nml_data[2]);
if ((1 > n || n > 100) || (1 > m || m > 100) || (1 > l || l > 100)) {
judge = false;
}
if (judge == true) {
String input_AB = "";
String[] A_in = new String[m];
int[][] A_out = new int[n][m];
String[] B_in = new String[l];
int[][] B_out = new int[m][l];
long[][] C_out = new long[n][l];
String[] output_result = new String[n];
// Aの入力とその値のチェック
out: for (int i = 0; i < n; i++) {
input_AB = sc.nextLine();
A_in = input_AB.split(" ");
for (int j = 0; j < m; j++) {
A_out[i][j] = Integer.parseInt(A_in[j]);
if (A_out[i][j] < 0 || A_out[i][j] > 10000) {
judge = false;
break out;
}
}
}// Aの入力ここまで
if (judge == true) {
// Bの入力とその値のチェック
out: for (int k = 0; k < m; k++) {
input_AB = sc.nextLine();
B_in = input_AB.split(" ");
for (int p = 0; p < l; p++) {
B_out[k][p] = Integer.parseInt(B_in[p]);
if (B_out[k][p] < 0 || B_out[k][p] > 10000) {
judge = false;
break out;
}
}
}
}// Bの入力ここまで
if (judge == true) {
for (int i = 0; i < n; i++) {
output_result[i] = "";
for (int j = 0; j < l; j++) {
for (int k = 0; k < m; k++) {
C_out[i][j] += A_out[i][k] * B_out[k][j];
}
if (j == 0) {
output_result[i] += "" + C_out[i][j];
} else {
output_result[i] += " " + C_out[i][j];
}
// System.out.print(C_out[i][j]);
}
System.out.println(output_result[i]);
// System.out.println();
}
}
}
}
}
|
[
7,
15,
13,
17,
6,
13,
41,
13,
20,
12,
13,
30,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
4,
13,
4,
13,
13,
13,
4,
13,
13,
13,
23,
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,
18,
13,
29,
13,
23,
13,
23,
13,
12,
13,
30,
11,
1,
41,
13,
17,
2,
13,
18,
13,
13,
1,
40,
13,
30,
30,
41,
13,
20,
11,
1,
41,
13,
17,
2,
13,
18,
18,
13,
17,
13,
1,
40,
13,
30,
30,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
18,
13,
13,
1,
40,
13,
30,
30,
0,
13,
2,
18,
18,
13,
13,
13,
18,
18,
13,
13,
13,
4,
18,
13,
2,
13,
17,
4,
18,
18,
13,
13,
4,
18,
4,
18,
13,
23,
13,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
178,
5
],
[
178,
6
],
[
6,
7
],
[
6,
8
],
[
178,
9
],
[
9,
10
],
[
9,
11
],
[
11,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
11,
17
],
[
17,
18
],
[
17,
19
],
[
19,
20
],
[
20,
21
],
[
11,
22
],
[
22,
23
],
[
22,
24
],
[
24,
25
],
[
25,
26
],
[
11,
27
],
[
27,
28
],
[
27,
29
],
[
29,
30
],
[
29,
31
],
[
29,
32
],
[
27,
33
],
[
33,
34
],
[
33,
35
],
[
33,
36
],
[
9,
37
],
[
37,
38
],
[
178,
39
],
[
39,
40
],
[
39,
41
],
[
41,
42
],
[
42,
43
],
[
42,
44
],
[
41,
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
],
[
74,
78
],
[
73,
79
],
[
79,
80
],
[
80,
81
],
[
41,
82
],
[
82,
83
],
[
39,
84
],
[
84,
85
],
[
39,
86
],
[
86,
87
],
[
178,
88
],
[
88,
89
],
[
88,
90
],
[
90,
91
],
[
91,
92
],
[
92,
93
],
[
93,
94
],
[
93,
95
],
[
91,
96
],
[
96,
97
],
[
96,
98
],
[
98,
99
],
[
98,
100
],
[
91,
101
],
[
101,
102
],
[
102,
103
],
[
91,
104
],
[
105,
105
],
[
105,
106
],
[
106,
107
],
[
106,
108
],
[
105,
109
],
[
109,
110
],
[
110,
111
],
[
111,
112
],
[
111,
113
],
[
109,
114
],
[
114,
115
],
[
114,
116
],
[
116,
117
],
[
117,
118
],
[
117,
119
],
[
116,
120
],
[
109,
121
],
[
121,
122
],
[
122,
123
],
[
109,
124
],
[
125,
125
],
[
125,
126
],
[
126,
127
],
[
126,
128
],
[
125,
129
],
[
129,
130
],
[
130,
131
],
[
131,
132
],
[
131,
133
],
[
129,
134
],
[
134,
135
],
[
134,
136
],
[
136,
137
],
[
136,
138
],
[
129,
139
],
[
139,
140
],
[
140,
141
],
[
129,
142
],
[
143,
143
],
[
143,
144
],
[
144,
145
],
[
144,
146
],
[
146,
147
],
[
147,
148
],
[
148,
149
],
[
148,
150
],
[
147,
151
],
[
146,
152
],
[
152,
153
],
[
153,
154
],
[
153,
155
],
[
152,
156
],
[
125,
157
],
[
157,
158
],
[
158,
159
],
[
157,
160
],
[
160,
161
],
[
160,
162
],
[
105,
163
],
[
163,
164
],
[
164,
165
],
[
165,
166
],
[
165,
167
],
[
163,
168
],
[
168,
169
],
[
169,
170
],
[
170,
171
],
[
171,
172
],
[
88,
173
],
[
173,
174
],
[
88,
175
],
[
175,
176
],
[
0,
177
],
[
177,
178
],
[
177,
179
]
] | [
"import java.util.*;\n\npublic class Main {\n private static final Scanner scn = new Scanner(System.in);\n \n public static void main(String[] args) {\n int n = scn.nextInt(), m = scn.nextInt(), l = scn.nextInt();\n showMatrix(createTable(n, m), createTable(m, l));\n }\n \n private static int[][] createTable(int y, int x) {\n int[][] tbl = new int[y][x];\n for(int i = 0; i < y; i++) {\n for(int j = 0; j < x; j++) {\n tbl[i][j] = scn.nextInt();\n }\n }\n return tbl;\n }\n \n private static void showMatrix(int[][] a, int[][] b) {\n for(int i = 0; i < a.length; i++) {\n StringBuilder sb = new StringBuilder();\n for(int j = 0; j < b[0].length; j++) {\n long v = 0;\n for(int k = 0; k < b.length; k++) {\n v += a[i][k] * b[k][j];\n }\n sb.append(v + \" \");\n }\n System.out.println(sb.toString().trim());\n }\n }\n}",
"import java.util.*;",
"util.*",
"java",
"public class Main {\n private static final Scanner scn = new Scanner(System.in);\n \n public static void main(String[] args) {\n int n = scn.nextInt(), m = scn.nextInt(), l = scn.nextInt();\n showMatrix(createTable(n, m), createTable(m, l));\n }\n \n private static int[][] createTable(int y, int x) {\n int[][] tbl = new int[y][x];\n for(int i = 0; i < y; i++) {\n for(int j = 0; j < x; j++) {\n tbl[i][j] = scn.nextInt();\n }\n }\n return tbl;\n }\n \n private static void showMatrix(int[][] a, int[][] b) {\n for(int i = 0; i < a.length; i++) {\n StringBuilder sb = new StringBuilder();\n for(int j = 0; j < b[0].length; j++) {\n long v = 0;\n for(int k = 0; k < b.length; k++) {\n v += a[i][k] * b[k][j];\n }\n sb.append(v + \" \");\n }\n System.out.println(sb.toString().trim());\n }\n }\n}",
"Main",
"private static final Scanner scn = new Scanner(System.in);",
"scn",
"new Scanner(System.in)",
"public static void main(String[] args) {\n int n = scn.nextInt(), m = scn.nextInt(), l = scn.nextInt();\n showMatrix(createTable(n, m), createTable(m, l));\n }",
"main",
"{\n int n = scn.nextInt(), m = scn.nextInt(), l = scn.nextInt();\n showMatrix(createTable(n, m), createTable(m, l));\n }",
"int n = scn.nextInt()",
"n",
"scn.nextInt()",
"scn.nextInt",
"scn",
"m = scn.nextInt()",
"m",
"scn.nextInt()",
"scn.nextInt",
"scn",
"l = scn.nextInt();",
"l",
"scn.nextInt()",
"scn.nextInt",
"scn",
"showMatrix(createTable(n, m), createTable(m, l))",
"showMatrix",
"createTable(n, m)",
"createTable",
"n",
"m",
"createTable(m, l)",
"createTable",
"m",
"l",
"String[] args",
"args",
"private static int[][] createTable(int y, int x) {\n int[][] tbl = new int[y][x];\n for(int i = 0; i < y; i++) {\n for(int j = 0; j < x; j++) {\n tbl[i][j] = scn.nextInt();\n }\n }\n return tbl;\n }",
"createTable",
"{\n int[][] tbl = new int[y][x];\n for(int i = 0; i < y; i++) {\n for(int j = 0; j < x; j++) {\n tbl[i][j] = scn.nextInt();\n }\n }\n return tbl;\n }",
"int[][] tbl = new int[y][x];",
"tbl",
"new int[y][x]",
"y",
"x",
"for(int i = 0; i < y; i++) {\n for(int j = 0; j < x; j++) {\n tbl[i][j] = scn.nextInt();\n }\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < y",
"i",
"y",
"i++",
"i++",
"i",
"{\n for(int j = 0; j < x; j++) {\n tbl[i][j] = scn.nextInt();\n }\n }",
"{\n for(int j = 0; j < x; j++) {\n tbl[i][j] = scn.nextInt();\n }\n }",
"for(int j = 0; j < x; j++) {\n tbl[i][j] = scn.nextInt();\n }",
"int j = 0;",
"int j = 0;",
"j",
"0",
"j < x",
"j",
"x",
"j++",
"j++",
"j",
"{\n tbl[i][j] = scn.nextInt();\n }",
"{\n tbl[i][j] = scn.nextInt();\n }",
"tbl[i][j] = scn.nextInt()",
"tbl[i][j]",
"tbl[i]",
"tbl",
"i",
"j",
"scn.nextInt()",
"scn.nextInt",
"scn",
"return tbl;",
"tbl",
"int y",
"y",
"int x",
"x",
"private static void showMatrix(int[][] a, int[][] b) {\n for(int i = 0; i < a.length; i++) {\n StringBuilder sb = new StringBuilder();\n for(int j = 0; j < b[0].length; j++) {\n long v = 0;\n for(int k = 0; k < b.length; k++) {\n v += a[i][k] * b[k][j];\n }\n sb.append(v + \" \");\n }\n System.out.println(sb.toString().trim());\n }\n }",
"showMatrix",
"{\n for(int i = 0; i < a.length; i++) {\n StringBuilder sb = new StringBuilder();\n for(int j = 0; j < b[0].length; j++) {\n long v = 0;\n for(int k = 0; k < b.length; k++) {\n v += a[i][k] * b[k][j];\n }\n sb.append(v + \" \");\n }\n System.out.println(sb.toString().trim());\n }\n }",
"for(int i = 0; i < a.length; i++) {\n StringBuilder sb = new StringBuilder();\n for(int j = 0; j < b[0].length; j++) {\n long v = 0;\n for(int k = 0; k < b.length; k++) {\n v += a[i][k] * b[k][j];\n }\n sb.append(v + \" \");\n }\n System.out.println(sb.toString().trim());\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < a.length",
"i",
"a.length",
"a",
"a.length",
"i++",
"i++",
"i",
"{\n StringBuilder sb = new StringBuilder();\n for(int j = 0; j < b[0].length; j++) {\n long v = 0;\n for(int k = 0; k < b.length; k++) {\n v += a[i][k] * b[k][j];\n }\n sb.append(v + \" \");\n }\n System.out.println(sb.toString().trim());\n }",
"{\n StringBuilder sb = new StringBuilder();\n for(int j = 0; j < b[0].length; j++) {\n long v = 0;\n for(int k = 0; k < b.length; k++) {\n v += a[i][k] * b[k][j];\n }\n sb.append(v + \" \");\n }\n System.out.println(sb.toString().trim());\n }",
"StringBuilder sb = new StringBuilder();",
"sb",
"new StringBuilder()",
"for(int j = 0; j < b[0].length; j++) {\n long v = 0;\n for(int k = 0; k < b.length; k++) {\n v += a[i][k] * b[k][j];\n }\n sb.append(v + \" \");\n }",
"int j = 0;",
"int j = 0;",
"j",
"0",
"j < b[0].length",
"j",
"b[0].length",
"b[0]",
"b",
"0",
"b[0].length",
"j++",
"j++",
"j",
"{\n long v = 0;\n for(int k = 0; k < b.length; k++) {\n v += a[i][k] * b[k][j];\n }\n sb.append(v + \" \");\n }",
"{\n long v = 0;\n for(int k = 0; k < b.length; k++) {\n v += a[i][k] * b[k][j];\n }\n sb.append(v + \" \");\n }",
"long v = 0;",
"v",
"0",
"for(int k = 0; k < b.length; k++) {\n v += a[i][k] * b[k][j];\n }",
"int k = 0;",
"int k = 0;",
"k",
"0",
"k < b.length",
"k",
"b.length",
"b",
"b.length",
"k++",
"k++",
"k",
"{\n v += a[i][k] * b[k][j];\n }",
"{\n v += a[i][k] * b[k][j];\n }",
"v += a[i][k] * b[k][j]",
"v",
"a[i][k] * b[k][j]",
"a[i][k]",
"a[i]",
"a",
"i",
"k",
"b[k][j]",
"b[k]",
"b",
"k",
"j",
"sb.append(v + \" \")",
"sb.append",
"sb",
"v + \" \"",
"v",
"\" \"",
"System.out.println(sb.toString().trim())",
"System.out.println",
"System.out",
"System",
"System.out",
"sb.toString().trim()",
"sb.toString().trim",
"sb.toString()",
"sb.toString",
"sb",
"int[][] a",
"a",
"int[][] b",
"b",
"public class Main {\n private static final Scanner scn = new Scanner(System.in);\n \n public static void main(String[] args) {\n int n = scn.nextInt(), m = scn.nextInt(), l = scn.nextInt();\n showMatrix(createTable(n, m), createTable(m, l));\n }\n \n private static int[][] createTable(int y, int x) {\n int[][] tbl = new int[y][x];\n for(int i = 0; i < y; i++) {\n for(int j = 0; j < x; j++) {\n tbl[i][j] = scn.nextInt();\n }\n }\n return tbl;\n }\n \n private static void showMatrix(int[][] a, int[][] b) {\n for(int i = 0; i < a.length; i++) {\n StringBuilder sb = new StringBuilder();\n for(int j = 0; j < b[0].length; j++) {\n long v = 0;\n for(int k = 0; k < b.length; k++) {\n v += a[i][k] * b[k][j];\n }\n sb.append(v + \" \");\n }\n System.out.println(sb.toString().trim());\n }\n }\n}",
"public class Main {\n private static final Scanner scn = new Scanner(System.in);\n \n public static void main(String[] args) {\n int n = scn.nextInt(), m = scn.nextInt(), l = scn.nextInt();\n showMatrix(createTable(n, m), createTable(m, l));\n }\n \n private static int[][] createTable(int y, int x) {\n int[][] tbl = new int[y][x];\n for(int i = 0; i < y; i++) {\n for(int j = 0; j < x; j++) {\n tbl[i][j] = scn.nextInt();\n }\n }\n return tbl;\n }\n \n private static void showMatrix(int[][] a, int[][] b) {\n for(int i = 0; i < a.length; i++) {\n StringBuilder sb = new StringBuilder();\n for(int j = 0; j < b[0].length; j++) {\n long v = 0;\n for(int k = 0; k < b.length; k++) {\n v += a[i][k] * b[k][j];\n }\n sb.append(v + \" \");\n }\n System.out.println(sb.toString().trim());\n }\n }\n}",
"Main"
] | import java.util.*;
public class Main {
private static final Scanner scn = new Scanner(System.in);
public static void main(String[] args) {
int n = scn.nextInt(), m = scn.nextInt(), l = scn.nextInt();
showMatrix(createTable(n, m), createTable(m, l));
}
private static int[][] createTable(int y, int x) {
int[][] tbl = new int[y][x];
for(int i = 0; i < y; i++) {
for(int j = 0; j < x; j++) {
tbl[i][j] = scn.nextInt();
}
}
return tbl;
}
private static void showMatrix(int[][] a, int[][] b) {
for(int i = 0; i < a.length; i++) {
StringBuilder sb = new StringBuilder();
for(int j = 0; j < b[0].length; j++) {
long v = 0;
for(int k = 0; k < b.length; k++) {
v += a[i][k] * b[k][j];
}
sb.append(v + " ");
}
System.out.println(sb.toString().trim());
}
}
} |
[
7,
15,
13,
17,
6,
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,
0,
18,
18,
13,
13,
13,
4,
18,
13,
23,
13,
23,
13,
23,
13,
23,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
41,
13,
20,
13,
13,
41,
13,
20,
13,
13,
41,
13,
4,
13,
13,
13,
13,
13,
4,
13,
13,
13,
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,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
2,
18,
18,
13,
13,
13,
18,
18,
13,
13,
13,
14,
2,
13,
17,
30,
4,
18,
18,
13,
13,
13,
30,
4,
18,
18,
13,
13,
2,
17,
13,
4,
18,
18,
13,
13,
4,
18,
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
],
[
10,
11
],
[
11,
12
],
[
11,
13
],
[
9,
14
],
[
14,
15
],
[
14,
16
],
[
9,
17
],
[
17,
18
],
[
18,
19
],
[
9,
20
],
[
21,
21
],
[
21,
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
],
[
36,
40
],
[
35,
41
],
[
41,
42
],
[
42,
43
],
[
6,
44
],
[
44,
45
],
[
6,
46
],
[
46,
47
],
[
6,
48
],
[
48,
49
],
[
6,
50
],
[
50,
51
],
[
183,
52
],
[
52,
53
],
[
52,
54
],
[
54,
55
],
[
55,
56
],
[
55,
57
],
[
54,
58
],
[
58,
59
],
[
58,
60
],
[
60,
61
],
[
61,
62
],
[
54,
63
],
[
63,
64
],
[
63,
65
],
[
65,
66
],
[
66,
67
],
[
54,
68
],
[
68,
69
],
[
68,
70
],
[
70,
71
],
[
71,
72
],
[
54,
73
],
[
73,
74
],
[
73,
75
],
[
54,
78
],
[
78,
79
],
[
78,
80
],
[
54,
83
],
[
83,
84
],
[
54,
85
],
[
85,
86
],
[
85,
87
],
[
85,
88
],
[
85,
89
],
[
85,
90
],
[
54,
91
],
[
91,
92
],
[
91,
93
],
[
91,
94
],
[
91,
95
],
[
91,
96
],
[
54,
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
],
[
122,
126
],
[
126,
127
],
[
127,
128
],
[
128,
129
],
[
128,
130
],
[
126,
131
],
[
131,
132
],
[
131,
133
],
[
126,
134
],
[
134,
135
],
[
135,
136
],
[
126,
137
],
[
138,
138
],
[
138,
139
],
[
139,
140
],
[
139,
141
],
[
141,
142
],
[
142,
143
],
[
143,
144
],
[
143,
145
],
[
142,
146
],
[
141,
147
],
[
147,
148
],
[
148,
149
],
[
148,
150
],
[
147,
151
],
[
122,
152
],
[
152,
153
],
[
153,
154
],
[
153,
155
],
[
152,
156
],
[
156,
157
],
[
157,
158
],
[
158,
159
],
[
159,
160
],
[
159,
161
],
[
157,
162
],
[
152,
163
],
[
163,
164
],
[
164,
165
],
[
165,
166
],
[
166,
167
],
[
166,
168
],
[
164,
169
],
[
169,
170
],
[
169,
171
],
[
109,
172
],
[
172,
173
],
[
173,
174
],
[
174,
175
],
[
174,
176
],
[
54,
177
],
[
177,
178
],
[
178,
179
],
[
52,
180
],
[
180,
181
],
[
0,
182
],
[
182,
183
],
[
182,
184
]
] | [
"import java.util.Scanner;\n\npublic class Main {\n\n\tstatic void input(long[][] array,int y,int x,Scanner scan){\n\t\tfor(int i=0;i<y;i++){\n\t\t\tfor(int j=0;j<x;j++){\n\t\t\t\tarray[i][j]=scan.nextInt();\n\t\t\t}\n\t\t}\n\t}\n\t\n\tpublic static void main(String[] args) {\n\t\tScanner scan=new Scanner(System.in);\n\t\tint n=scan.nextInt();\n\t\tint m=scan.nextInt();\n\t\tint l=scan.nextInt();\n\t\tlong[][] A=new long[n][m];\n\t\tlong[][] B=new long[m][l];\n\t\tlong sum;\n\t\tinput(A,n,m,scan);\n\t\tinput(B,m,l,scan);\n\t\tfor(int i=0;i<n;i++){\n\t\t\tfor(int j=0;j<l;j++){\n\t\t\t\t\n\t\t\t\tsum=0;\n\t\t\t\tfor(int k=0;k<m;k++){\n\t\t\t\t\tsum+=A[i][k]*B[k][j];\n\t\t\t\t}\n\t\t\t\tif(j==0){\n\t\t\t\t\tSystem.out.print(sum);\n\t\t\t\t}else{\n\t\t\t\t\tSystem.out.print(\" \"+sum);\n\t\t\t\t}\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}\n\t\tscan.close();\n\t}\n\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n\n\tstatic void input(long[][] array,int y,int x,Scanner scan){\n\t\tfor(int i=0;i<y;i++){\n\t\t\tfor(int j=0;j<x;j++){\n\t\t\t\tarray[i][j]=scan.nextInt();\n\t\t\t}\n\t\t}\n\t}\n\t\n\tpublic static void main(String[] args) {\n\t\tScanner scan=new Scanner(System.in);\n\t\tint n=scan.nextInt();\n\t\tint m=scan.nextInt();\n\t\tint l=scan.nextInt();\n\t\tlong[][] A=new long[n][m];\n\t\tlong[][] B=new long[m][l];\n\t\tlong sum;\n\t\tinput(A,n,m,scan);\n\t\tinput(B,m,l,scan);\n\t\tfor(int i=0;i<n;i++){\n\t\t\tfor(int j=0;j<l;j++){\n\t\t\t\t\n\t\t\t\tsum=0;\n\t\t\t\tfor(int k=0;k<m;k++){\n\t\t\t\t\tsum+=A[i][k]*B[k][j];\n\t\t\t\t}\n\t\t\t\tif(j==0){\n\t\t\t\t\tSystem.out.print(sum);\n\t\t\t\t}else{\n\t\t\t\t\tSystem.out.print(\" \"+sum);\n\t\t\t\t}\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}\n\t\tscan.close();\n\t}\n\n}",
"Main",
"static void input(long[][] array,int y,int x,Scanner scan){\n\t\tfor(int i=0;i<y;i++){\n\t\t\tfor(int j=0;j<x;j++){\n\t\t\t\tarray[i][j]=scan.nextInt();\n\t\t\t}\n\t\t}\n\t}",
"input",
"{\n\t\tfor(int i=0;i<y;i++){\n\t\t\tfor(int j=0;j<x;j++){\n\t\t\t\tarray[i][j]=scan.nextInt();\n\t\t\t}\n\t\t}\n\t}",
"for(int i=0;i<y;i++){\n\t\t\tfor(int j=0;j<x;j++){\n\t\t\t\tarray[i][j]=scan.nextInt();\n\t\t\t}\n\t\t}",
"int i=0;",
"int i=0;",
"i",
"0",
"i<y",
"i",
"y",
"i++",
"i++",
"i",
"{\n\t\t\tfor(int j=0;j<x;j++){\n\t\t\t\tarray[i][j]=scan.nextInt();\n\t\t\t}\n\t\t}",
"{\n\t\t\tfor(int j=0;j<x;j++){\n\t\t\t\tarray[i][j]=scan.nextInt();\n\t\t\t}\n\t\t}",
"for(int j=0;j<x;j++){\n\t\t\t\tarray[i][j]=scan.nextInt();\n\t\t\t}",
"int j=0;",
"int j=0;",
"j",
"0",
"j<x",
"j",
"x",
"j++",
"j++",
"j",
"{\n\t\t\t\tarray[i][j]=scan.nextInt();\n\t\t\t}",
"{\n\t\t\t\tarray[i][j]=scan.nextInt();\n\t\t\t}",
"array[i][j]=scan.nextInt()",
"array[i][j]",
"array[i]",
"array",
"i",
"j",
"scan.nextInt()",
"scan.nextInt",
"scan",
"long[][] array",
"array",
"int y",
"y",
"int x",
"x",
"Scanner scan",
"scan",
"public static void main(String[] args) {\n\t\tScanner scan=new Scanner(System.in);\n\t\tint n=scan.nextInt();\n\t\tint m=scan.nextInt();\n\t\tint l=scan.nextInt();\n\t\tlong[][] A=new long[n][m];\n\t\tlong[][] B=new long[m][l];\n\t\tlong sum;\n\t\tinput(A,n,m,scan);\n\t\tinput(B,m,l,scan);\n\t\tfor(int i=0;i<n;i++){\n\t\t\tfor(int j=0;j<l;j++){\n\t\t\t\t\n\t\t\t\tsum=0;\n\t\t\t\tfor(int k=0;k<m;k++){\n\t\t\t\t\tsum+=A[i][k]*B[k][j];\n\t\t\t\t}\n\t\t\t\tif(j==0){\n\t\t\t\t\tSystem.out.print(sum);\n\t\t\t\t}else{\n\t\t\t\t\tSystem.out.print(\" \"+sum);\n\t\t\t\t}\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}\n\t\tscan.close();\n\t}",
"main",
"{\n\t\tScanner scan=new Scanner(System.in);\n\t\tint n=scan.nextInt();\n\t\tint m=scan.nextInt();\n\t\tint l=scan.nextInt();\n\t\tlong[][] A=new long[n][m];\n\t\tlong[][] B=new long[m][l];\n\t\tlong sum;\n\t\tinput(A,n,m,scan);\n\t\tinput(B,m,l,scan);\n\t\tfor(int i=0;i<n;i++){\n\t\t\tfor(int j=0;j<l;j++){\n\t\t\t\t\n\t\t\t\tsum=0;\n\t\t\t\tfor(int k=0;k<m;k++){\n\t\t\t\t\tsum+=A[i][k]*B[k][j];\n\t\t\t\t}\n\t\t\t\tif(j==0){\n\t\t\t\t\tSystem.out.print(sum);\n\t\t\t\t}else{\n\t\t\t\t\tSystem.out.print(\" \"+sum);\n\t\t\t\t}\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}\n\t\tscan.close();\n\t}",
"Scanner scan=new Scanner(System.in);",
"scan",
"new Scanner(System.in)",
"int n=scan.nextInt();",
"n",
"scan.nextInt()",
"scan.nextInt",
"scan",
"int m=scan.nextInt();",
"m",
"scan.nextInt()",
"scan.nextInt",
"scan",
"int l=scan.nextInt();",
"l",
"scan.nextInt()",
"scan.nextInt",
"scan",
"long[][] A=new long[n][m];",
"A",
"new long[n][m]",
"n",
"m",
"long[][] B=new long[m][l];",
"B",
"new long[m][l]",
"m",
"l",
"long sum;",
"sum",
"input(A,n,m,scan)",
"input",
"A",
"n",
"m",
"scan",
"input(B,m,l,scan)",
"input",
"B",
"m",
"l",
"scan",
"for(int i=0;i<n;i++){\n\t\t\tfor(int j=0;j<l;j++){\n\t\t\t\t\n\t\t\t\tsum=0;\n\t\t\t\tfor(int k=0;k<m;k++){\n\t\t\t\t\tsum+=A[i][k]*B[k][j];\n\t\t\t\t}\n\t\t\t\tif(j==0){\n\t\t\t\t\tSystem.out.print(sum);\n\t\t\t\t}else{\n\t\t\t\t\tSystem.out.print(\" \"+sum);\n\t\t\t\t}\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}",
"int i=0;",
"int i=0;",
"i",
"0",
"i<n",
"i",
"n",
"i++",
"i++",
"i",
"{\n\t\t\tfor(int j=0;j<l;j++){\n\t\t\t\t\n\t\t\t\tsum=0;\n\t\t\t\tfor(int k=0;k<m;k++){\n\t\t\t\t\tsum+=A[i][k]*B[k][j];\n\t\t\t\t}\n\t\t\t\tif(j==0){\n\t\t\t\t\tSystem.out.print(sum);\n\t\t\t\t}else{\n\t\t\t\t\tSystem.out.print(\" \"+sum);\n\t\t\t\t}\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}",
"{\n\t\t\tfor(int j=0;j<l;j++){\n\t\t\t\t\n\t\t\t\tsum=0;\n\t\t\t\tfor(int k=0;k<m;k++){\n\t\t\t\t\tsum+=A[i][k]*B[k][j];\n\t\t\t\t}\n\t\t\t\tif(j==0){\n\t\t\t\t\tSystem.out.print(sum);\n\t\t\t\t}else{\n\t\t\t\t\tSystem.out.print(\" \"+sum);\n\t\t\t\t}\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}",
"for(int j=0;j<l;j++){\n\t\t\t\t\n\t\t\t\tsum=0;\n\t\t\t\tfor(int k=0;k<m;k++){\n\t\t\t\t\tsum+=A[i][k]*B[k][j];\n\t\t\t\t}\n\t\t\t\tif(j==0){\n\t\t\t\t\tSystem.out.print(sum);\n\t\t\t\t}else{\n\t\t\t\t\tSystem.out.print(\" \"+sum);\n\t\t\t\t}\n\t\t\t}",
"int j=0;",
"int j=0;",
"j",
"0",
"j<l",
"j",
"l",
"j++",
"j++",
"j",
"{\n\t\t\t\t\n\t\t\t\tsum=0;\n\t\t\t\tfor(int k=0;k<m;k++){\n\t\t\t\t\tsum+=A[i][k]*B[k][j];\n\t\t\t\t}\n\t\t\t\tif(j==0){\n\t\t\t\t\tSystem.out.print(sum);\n\t\t\t\t}else{\n\t\t\t\t\tSystem.out.print(\" \"+sum);\n\t\t\t\t}\n\t\t\t}",
"{\n\t\t\t\t\n\t\t\t\tsum=0;\n\t\t\t\tfor(int k=0;k<m;k++){\n\t\t\t\t\tsum+=A[i][k]*B[k][j];\n\t\t\t\t}\n\t\t\t\tif(j==0){\n\t\t\t\t\tSystem.out.print(sum);\n\t\t\t\t}else{\n\t\t\t\t\tSystem.out.print(\" \"+sum);\n\t\t\t\t}\n\t\t\t}",
"sum=0",
"sum",
"0",
"for(int k=0;k<m;k++){\n\t\t\t\t\tsum+=A[i][k]*B[k][j];\n\t\t\t\t}",
"int k=0;",
"int k=0;",
"k",
"0",
"k<m",
"k",
"m",
"k++",
"k++",
"k",
"{\n\t\t\t\t\tsum+=A[i][k]*B[k][j];\n\t\t\t\t}",
"{\n\t\t\t\t\tsum+=A[i][k]*B[k][j];\n\t\t\t\t}",
"sum+=A[i][k]*B[k][j]",
"sum",
"A[i][k]*B[k][j]",
"A[i][k]",
"A[i]",
"A",
"i",
"k",
"B[k][j]",
"B[k]",
"B",
"k",
"j",
"if(j==0){\n\t\t\t\t\tSystem.out.print(sum);\n\t\t\t\t}else{\n\t\t\t\t\tSystem.out.print(\" \"+sum);\n\t\t\t\t}",
"j==0",
"j",
"0",
"{\n\t\t\t\t\tSystem.out.print(sum);\n\t\t\t\t}",
"System.out.print(sum)",
"System.out.print",
"System.out",
"System",
"System.out",
"sum",
"{\n\t\t\t\t\tSystem.out.print(\" \"+sum);\n\t\t\t\t}",
"System.out.print(\" \"+sum)",
"System.out.print",
"System.out",
"System",
"System.out",
"\" \"+sum",
"\" \"",
"sum",
"System.out.println()",
"System.out.println",
"System.out",
"System",
"System.out",
"scan.close()",
"scan.close",
"scan",
"String[] args",
"args",
"public class Main {\n\n\tstatic void input(long[][] array,int y,int x,Scanner scan){\n\t\tfor(int i=0;i<y;i++){\n\t\t\tfor(int j=0;j<x;j++){\n\t\t\t\tarray[i][j]=scan.nextInt();\n\t\t\t}\n\t\t}\n\t}\n\t\n\tpublic static void main(String[] args) {\n\t\tScanner scan=new Scanner(System.in);\n\t\tint n=scan.nextInt();\n\t\tint m=scan.nextInt();\n\t\tint l=scan.nextInt();\n\t\tlong[][] A=new long[n][m];\n\t\tlong[][] B=new long[m][l];\n\t\tlong sum;\n\t\tinput(A,n,m,scan);\n\t\tinput(B,m,l,scan);\n\t\tfor(int i=0;i<n;i++){\n\t\t\tfor(int j=0;j<l;j++){\n\t\t\t\t\n\t\t\t\tsum=0;\n\t\t\t\tfor(int k=0;k<m;k++){\n\t\t\t\t\tsum+=A[i][k]*B[k][j];\n\t\t\t\t}\n\t\t\t\tif(j==0){\n\t\t\t\t\tSystem.out.print(sum);\n\t\t\t\t}else{\n\t\t\t\t\tSystem.out.print(\" \"+sum);\n\t\t\t\t}\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}\n\t\tscan.close();\n\t}\n\n}",
"public class Main {\n\n\tstatic void input(long[][] array,int y,int x,Scanner scan){\n\t\tfor(int i=0;i<y;i++){\n\t\t\tfor(int j=0;j<x;j++){\n\t\t\t\tarray[i][j]=scan.nextInt();\n\t\t\t}\n\t\t}\n\t}\n\t\n\tpublic static void main(String[] args) {\n\t\tScanner scan=new Scanner(System.in);\n\t\tint n=scan.nextInt();\n\t\tint m=scan.nextInt();\n\t\tint l=scan.nextInt();\n\t\tlong[][] A=new long[n][m];\n\t\tlong[][] B=new long[m][l];\n\t\tlong sum;\n\t\tinput(A,n,m,scan);\n\t\tinput(B,m,l,scan);\n\t\tfor(int i=0;i<n;i++){\n\t\t\tfor(int j=0;j<l;j++){\n\t\t\t\t\n\t\t\t\tsum=0;\n\t\t\t\tfor(int k=0;k<m;k++){\n\t\t\t\t\tsum+=A[i][k]*B[k][j];\n\t\t\t\t}\n\t\t\t\tif(j==0){\n\t\t\t\t\tSystem.out.print(sum);\n\t\t\t\t}else{\n\t\t\t\t\tSystem.out.print(\" \"+sum);\n\t\t\t\t}\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}\n\t\tscan.close();\n\t}\n\n}",
"Main"
] | import java.util.Scanner;
public class Main {
static void input(long[][] array,int y,int x,Scanner scan){
for(int i=0;i<y;i++){
for(int j=0;j<x;j++){
array[i][j]=scan.nextInt();
}
}
}
public static void main(String[] args) {
Scanner scan=new Scanner(System.in);
int n=scan.nextInt();
int m=scan.nextInt();
int l=scan.nextInt();
long[][] A=new long[n][m];
long[][] B=new long[m][l];
long sum;
input(A,n,m,scan);
input(B,m,l,scan);
for(int i=0;i<n;i++){
for(int j=0;j<l;j++){
sum=0;
for(int k=0;k<m;k++){
sum+=A[i][k]*B[k][j];
}
if(j==0){
System.out.print(sum);
}else{
System.out.print(" "+sum);
}
}
System.out.println();
}
scan.close();
}
} |
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
41,
13,
20,
13,
13,
41,
13,
20,
13,
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,
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,
0,
18,
18,
13,
13,
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,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
2,
18,
18,
13,
13,
13,
18,
18,
13,
13,
13,
0,
18,
18,
13,
13,
13,
13,
4,
13,
13,
13,
13,
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,
2,
13,
17,
1,
40,
13,
30,
30,
4,
18,
18,
13,
13,
2,
18,
18,
13,
13,
13,
17,
14,
2,
13,
17,
30,
4,
18,
18,
13,
13,
18,
18,
13,
13,
2,
13,
17,
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
],
[
19,
20
],
[
20,
21
],
[
8,
22
],
[
22,
23
],
[
22,
24
],
[
24,
25
],
[
25,
26
],
[
8,
27
],
[
27,
28
],
[
27,
29
],
[
8,
32
],
[
32,
33
],
[
32,
34
],
[
8,
37
],
[
37,
38
],
[
37,
39
],
[
8,
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
],
[
69,
70
],
[
70,
71
],
[
70,
72
],
[
69,
73
],
[
68,
74
],
[
74,
75
],
[
75,
76
],
[
8,
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
],
[
104,
105
],
[
105,
106
],
[
105,
107
],
[
104,
108
],
[
103,
109
],
[
109,
110
],
[
110,
111
],
[
8,
112
],
[
112,
113
],
[
113,
114
],
[
114,
115
],
[
114,
116
],
[
112,
117
],
[
117,
118
],
[
117,
119
],
[
112,
120
],
[
120,
121
],
[
121,
122
],
[
112,
123
],
[
124,
124
],
[
124,
125
],
[
125,
126
],
[
126,
127
],
[
127,
128
],
[
127,
129
],
[
125,
130
],
[
130,
131
],
[
130,
132
],
[
125,
133
],
[
133,
134
],
[
134,
135
],
[
125,
136
],
[
137,
137
],
[
137,
138
],
[
138,
139
],
[
138,
140
],
[
137,
141
],
[
141,
142
],
[
142,
143
],
[
143,
144
],
[
143,
145
],
[
141,
146
],
[
146,
147
],
[
146,
148
],
[
141,
149
],
[
149,
150
],
[
150,
151
],
[
141,
152
],
[
153,
153
],
[
153,
154
],
[
154,
155
],
[
154,
156
],
[
156,
157
],
[
157,
158
],
[
158,
159
],
[
158,
160
],
[
157,
161
],
[
156,
162
],
[
162,
163
],
[
163,
164
],
[
163,
165
],
[
162,
166
],
[
137,
167
],
[
167,
168
],
[
168,
169
],
[
169,
170
],
[
169,
171
],
[
168,
172
],
[
167,
173
],
[
8,
174
],
[
174,
175
],
[
174,
176
],
[
174,
177
],
[
174,
178
],
[
6,
179
],
[
179,
180
],
[
4,
181
],
[
181,
182
],
[
181,
183
],
[
183,
184
],
[
184,
185
],
[
185,
186
],
[
186,
187
],
[
186,
188
],
[
184,
189
],
[
189,
190
],
[
189,
191
],
[
184,
192
],
[
192,
193
],
[
193,
194
],
[
184,
195
],
[
196,
196
],
[
196,
197
],
[
197,
198
],
[
198,
199
],
[
199,
200
],
[
199,
201
],
[
197,
202
],
[
202,
203
],
[
202,
204
],
[
204,
205
],
[
204,
206
],
[
197,
207
],
[
207,
208
],
[
208,
209
],
[
197,
210
],
[
211,
211
],
[
211,
212
],
[
212,
213
],
[
213,
214
],
[
214,
215
],
[
214,
216
],
[
212,
217
],
[
217,
218
],
[
218,
219
],
[
219,
220
],
[
219,
221
],
[
218,
222
],
[
217,
223
],
[
196,
224
],
[
224,
225
],
[
225,
226
],
[
225,
227
],
[
224,
228
],
[
228,
229
],
[
229,
230
],
[
230,
231
],
[
231,
232
],
[
231,
233
],
[
229,
234
],
[
234,
235
],
[
235,
236
],
[
235,
237
],
[
234,
238
],
[
238,
239
],
[
238,
240
],
[
181,
241
],
[
241,
242
],
[
181,
243
],
[
243,
244
],
[
181,
245
],
[
245,
246
]
] | [
"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 n=sc.nextInt();\n\t\tint m=sc.nextInt();\n\t\tint l=sc.nextInt();\n\t\tlong[][] m1=new long[n][m];\n\t\tlong[][] m2=new long[m][l];\n\t\tlong[][] ans=new long[n][l];\n\t\tfor(int i=0; i<n; i++) {\n\t\t\tfor(int j=0; j<m; j++) {\n\t\t\t\tm1[i][j]=sc.nextLong();\n\t\t\t}\n\t\t}\n\t\tfor(int i=0; i<m; i++) {\n\t\t\tfor(int j=0; j<l; j++) {\n\t\t\t\tm2[i][j]=sc.nextLong();\n\t\t\t}\n\t\t}\n\t\tfor(int i=0; i<n; i++) {\n\t\t\tfor(int j=0; j<l; j++) {\n\t\t\t\tlong tmp=0;\n\t\t\t\tfor(int k=0; k<m; k++) {\n\t\t\t\t\ttmp+=m1[i][k]*m2[k][j];\n\t\t\t\t}\n\t\t\t\tans[i][j]=tmp;\n\t\t\t}\n\t\t}\n\t\toutput(ans,n,l);\n\t}\n\tpublic static void output(long[][] a,int h,int w) {\n\t\tfor(int i=0; i<h; i++) {\n\t\t\tfor(int j=0; j<w-1; j++) {\n\t\t\t\tSystem.out.print(a[i][j]+\" \");\n\t\t\t}\n\t\t\tif(w>0) {\n\t\t\t\tSystem.out.println(a[i][w-1]);;\n\t\t\t}\n\t\t}\n\t}\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"class Main{\n\tpublic static void main(String[] args) {\n\t\tScanner sc=new Scanner(System.in);\n\t\tint n=sc.nextInt();\n\t\tint m=sc.nextInt();\n\t\tint l=sc.nextInt();\n\t\tlong[][] m1=new long[n][m];\n\t\tlong[][] m2=new long[m][l];\n\t\tlong[][] ans=new long[n][l];\n\t\tfor(int i=0; i<n; i++) {\n\t\t\tfor(int j=0; j<m; j++) {\n\t\t\t\tm1[i][j]=sc.nextLong();\n\t\t\t}\n\t\t}\n\t\tfor(int i=0; i<m; i++) {\n\t\t\tfor(int j=0; j<l; j++) {\n\t\t\t\tm2[i][j]=sc.nextLong();\n\t\t\t}\n\t\t}\n\t\tfor(int i=0; i<n; i++) {\n\t\t\tfor(int j=0; j<l; j++) {\n\t\t\t\tlong tmp=0;\n\t\t\t\tfor(int k=0; k<m; k++) {\n\t\t\t\t\ttmp+=m1[i][k]*m2[k][j];\n\t\t\t\t}\n\t\t\t\tans[i][j]=tmp;\n\t\t\t}\n\t\t}\n\t\toutput(ans,n,l);\n\t}\n\tpublic static void output(long[][] a,int h,int w) {\n\t\tfor(int i=0; i<h; i++) {\n\t\t\tfor(int j=0; j<w-1; j++) {\n\t\t\t\tSystem.out.print(a[i][j]+\" \");\n\t\t\t}\n\t\t\tif(w>0) {\n\t\t\t\tSystem.out.println(a[i][w-1]);;\n\t\t\t}\n\t\t}\n\t}\n}",
"Main",
"public static void main(String[] args) {\n\t\tScanner sc=new Scanner(System.in);\n\t\tint n=sc.nextInt();\n\t\tint m=sc.nextInt();\n\t\tint l=sc.nextInt();\n\t\tlong[][] m1=new long[n][m];\n\t\tlong[][] m2=new long[m][l];\n\t\tlong[][] ans=new long[n][l];\n\t\tfor(int i=0; i<n; i++) {\n\t\t\tfor(int j=0; j<m; j++) {\n\t\t\t\tm1[i][j]=sc.nextLong();\n\t\t\t}\n\t\t}\n\t\tfor(int i=0; i<m; i++) {\n\t\t\tfor(int j=0; j<l; j++) {\n\t\t\t\tm2[i][j]=sc.nextLong();\n\t\t\t}\n\t\t}\n\t\tfor(int i=0; i<n; i++) {\n\t\t\tfor(int j=0; j<l; j++) {\n\t\t\t\tlong tmp=0;\n\t\t\t\tfor(int k=0; k<m; k++) {\n\t\t\t\t\ttmp+=m1[i][k]*m2[k][j];\n\t\t\t\t}\n\t\t\t\tans[i][j]=tmp;\n\t\t\t}\n\t\t}\n\t\toutput(ans,n,l);\n\t}",
"main",
"{\n\t\tScanner sc=new Scanner(System.in);\n\t\tint n=sc.nextInt();\n\t\tint m=sc.nextInt();\n\t\tint l=sc.nextInt();\n\t\tlong[][] m1=new long[n][m];\n\t\tlong[][] m2=new long[m][l];\n\t\tlong[][] ans=new long[n][l];\n\t\tfor(int i=0; i<n; i++) {\n\t\t\tfor(int j=0; j<m; j++) {\n\t\t\t\tm1[i][j]=sc.nextLong();\n\t\t\t}\n\t\t}\n\t\tfor(int i=0; i<m; i++) {\n\t\t\tfor(int j=0; j<l; j++) {\n\t\t\t\tm2[i][j]=sc.nextLong();\n\t\t\t}\n\t\t}\n\t\tfor(int i=0; i<n; i++) {\n\t\t\tfor(int j=0; j<l; j++) {\n\t\t\t\tlong tmp=0;\n\t\t\t\tfor(int k=0; k<m; k++) {\n\t\t\t\t\ttmp+=m1[i][k]*m2[k][j];\n\t\t\t\t}\n\t\t\t\tans[i][j]=tmp;\n\t\t\t}\n\t\t}\n\t\toutput(ans,n,l);\n\t}",
"Scanner sc=new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"int n=sc.nextInt();",
"n",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int m=sc.nextInt();",
"m",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int l=sc.nextInt();",
"l",
"sc.nextInt()",
"sc.nextInt",
"sc",
"long[][] m1=new long[n][m];",
"m1",
"new long[n][m]",
"n",
"m",
"long[][] m2=new long[m][l];",
"m2",
"new long[m][l]",
"m",
"l",
"long[][] ans=new long[n][l];",
"ans",
"new long[n][l]",
"n",
"l",
"for(int i=0; i<n; i++) {\n\t\t\tfor(int j=0; j<m; j++) {\n\t\t\t\tm1[i][j]=sc.nextLong();\n\t\t\t}\n\t\t}",
"int i=0;",
"int i=0;",
"i",
"0",
"i<n",
"i",
"n",
"i++",
"i++",
"i",
"{\n\t\t\tfor(int j=0; j<m; j++) {\n\t\t\t\tm1[i][j]=sc.nextLong();\n\t\t\t}\n\t\t}",
"{\n\t\t\tfor(int j=0; j<m; j++) {\n\t\t\t\tm1[i][j]=sc.nextLong();\n\t\t\t}\n\t\t}",
"for(int j=0; j<m; j++) {\n\t\t\t\tm1[i][j]=sc.nextLong();\n\t\t\t}",
"int j=0;",
"int j=0;",
"j",
"0",
"j<m",
"j",
"m",
"j++",
"j++",
"j",
"{\n\t\t\t\tm1[i][j]=sc.nextLong();\n\t\t\t}",
"{\n\t\t\t\tm1[i][j]=sc.nextLong();\n\t\t\t}",
"m1[i][j]=sc.nextLong()",
"m1[i][j]",
"m1[i]",
"m1",
"i",
"j",
"sc.nextLong()",
"sc.nextLong",
"sc",
"for(int i=0; i<m; i++) {\n\t\t\tfor(int j=0; j<l; j++) {\n\t\t\t\tm2[i][j]=sc.nextLong();\n\t\t\t}\n\t\t}",
"int i=0;",
"int i=0;",
"i",
"0",
"i<m",
"i",
"m",
"i++",
"i++",
"i",
"{\n\t\t\tfor(int j=0; j<l; j++) {\n\t\t\t\tm2[i][j]=sc.nextLong();\n\t\t\t}\n\t\t}",
"{\n\t\t\tfor(int j=0; j<l; j++) {\n\t\t\t\tm2[i][j]=sc.nextLong();\n\t\t\t}\n\t\t}",
"for(int j=0; j<l; j++) {\n\t\t\t\tm2[i][j]=sc.nextLong();\n\t\t\t}",
"int j=0;",
"int j=0;",
"j",
"0",
"j<l",
"j",
"l",
"j++",
"j++",
"j",
"{\n\t\t\t\tm2[i][j]=sc.nextLong();\n\t\t\t}",
"{\n\t\t\t\tm2[i][j]=sc.nextLong();\n\t\t\t}",
"m2[i][j]=sc.nextLong()",
"m2[i][j]",
"m2[i]",
"m2",
"i",
"j",
"sc.nextLong()",
"sc.nextLong",
"sc",
"for(int i=0; i<n; i++) {\n\t\t\tfor(int j=0; j<l; j++) {\n\t\t\t\tlong tmp=0;\n\t\t\t\tfor(int k=0; k<m; k++) {\n\t\t\t\t\ttmp+=m1[i][k]*m2[k][j];\n\t\t\t\t}\n\t\t\t\tans[i][j]=tmp;\n\t\t\t}\n\t\t}",
"int i=0;",
"int i=0;",
"i",
"0",
"i<n",
"i",
"n",
"i++",
"i++",
"i",
"{\n\t\t\tfor(int j=0; j<l; j++) {\n\t\t\t\tlong tmp=0;\n\t\t\t\tfor(int k=0; k<m; k++) {\n\t\t\t\t\ttmp+=m1[i][k]*m2[k][j];\n\t\t\t\t}\n\t\t\t\tans[i][j]=tmp;\n\t\t\t}\n\t\t}",
"{\n\t\t\tfor(int j=0; j<l; j++) {\n\t\t\t\tlong tmp=0;\n\t\t\t\tfor(int k=0; k<m; k++) {\n\t\t\t\t\ttmp+=m1[i][k]*m2[k][j];\n\t\t\t\t}\n\t\t\t\tans[i][j]=tmp;\n\t\t\t}\n\t\t}",
"for(int j=0; j<l; j++) {\n\t\t\t\tlong tmp=0;\n\t\t\t\tfor(int k=0; k<m; k++) {\n\t\t\t\t\ttmp+=m1[i][k]*m2[k][j];\n\t\t\t\t}\n\t\t\t\tans[i][j]=tmp;\n\t\t\t}",
"int j=0;",
"int j=0;",
"j",
"0",
"j<l",
"j",
"l",
"j++",
"j++",
"j",
"{\n\t\t\t\tlong tmp=0;\n\t\t\t\tfor(int k=0; k<m; k++) {\n\t\t\t\t\ttmp+=m1[i][k]*m2[k][j];\n\t\t\t\t}\n\t\t\t\tans[i][j]=tmp;\n\t\t\t}",
"{\n\t\t\t\tlong tmp=0;\n\t\t\t\tfor(int k=0; k<m; k++) {\n\t\t\t\t\ttmp+=m1[i][k]*m2[k][j];\n\t\t\t\t}\n\t\t\t\tans[i][j]=tmp;\n\t\t\t}",
"long tmp=0;",
"tmp",
"0",
"for(int k=0; k<m; k++) {\n\t\t\t\t\ttmp+=m1[i][k]*m2[k][j];\n\t\t\t\t}",
"int k=0;",
"int k=0;",
"k",
"0",
"k<m",
"k",
"m",
"k++",
"k++",
"k",
"{\n\t\t\t\t\ttmp+=m1[i][k]*m2[k][j];\n\t\t\t\t}",
"{\n\t\t\t\t\ttmp+=m1[i][k]*m2[k][j];\n\t\t\t\t}",
"tmp+=m1[i][k]*m2[k][j]",
"tmp",
"m1[i][k]*m2[k][j]",
"m1[i][k]",
"m1[i]",
"m1",
"i",
"k",
"m2[k][j]",
"m2[k]",
"m2",
"k",
"j",
"ans[i][j]=tmp",
"ans[i][j]",
"ans[i]",
"ans",
"i",
"j",
"tmp",
"output(ans,n,l)",
"output",
"ans",
"n",
"l",
"String[] args",
"args",
"public static void output(long[][] a,int h,int w) {\n\t\tfor(int i=0; i<h; i++) {\n\t\t\tfor(int j=0; j<w-1; j++) {\n\t\t\t\tSystem.out.print(a[i][j]+\" \");\n\t\t\t}\n\t\t\tif(w>0) {\n\t\t\t\tSystem.out.println(a[i][w-1]);;\n\t\t\t}\n\t\t}\n\t}",
"output",
"{\n\t\tfor(int i=0; i<h; i++) {\n\t\t\tfor(int j=0; j<w-1; j++) {\n\t\t\t\tSystem.out.print(a[i][j]+\" \");\n\t\t\t}\n\t\t\tif(w>0) {\n\t\t\t\tSystem.out.println(a[i][w-1]);;\n\t\t\t}\n\t\t}\n\t}",
"for(int i=0; i<h; i++) {\n\t\t\tfor(int j=0; j<w-1; j++) {\n\t\t\t\tSystem.out.print(a[i][j]+\" \");\n\t\t\t}\n\t\t\tif(w>0) {\n\t\t\t\tSystem.out.println(a[i][w-1]);;\n\t\t\t}\n\t\t}",
"int i=0;",
"int i=0;",
"i",
"0",
"i<h",
"i",
"h",
"i++",
"i++",
"i",
"{\n\t\t\tfor(int j=0; j<w-1; j++) {\n\t\t\t\tSystem.out.print(a[i][j]+\" \");\n\t\t\t}\n\t\t\tif(w>0) {\n\t\t\t\tSystem.out.println(a[i][w-1]);;\n\t\t\t}\n\t\t}",
"{\n\t\t\tfor(int j=0; j<w-1; j++) {\n\t\t\t\tSystem.out.print(a[i][j]+\" \");\n\t\t\t}\n\t\t\tif(w>0) {\n\t\t\t\tSystem.out.println(a[i][w-1]);;\n\t\t\t}\n\t\t}",
"for(int j=0; j<w-1; j++) {\n\t\t\t\tSystem.out.print(a[i][j]+\" \");\n\t\t\t}",
"int j=0;",
"int j=0;",
"j",
"0",
"j<w-1",
"j",
"w-1",
"w",
"1",
"j++",
"j++",
"j",
"{\n\t\t\t\tSystem.out.print(a[i][j]+\" \");\n\t\t\t}",
"{\n\t\t\t\tSystem.out.print(a[i][j]+\" \");\n\t\t\t}",
"System.out.print(a[i][j]+\" \")",
"System.out.print",
"System.out",
"System",
"System.out",
"a[i][j]+\" \"",
"a[i][j]",
"a[i]",
"a",
"i",
"j",
"\" \"",
"if(w>0) {\n\t\t\t\tSystem.out.println(a[i][w-1]);;\n\t\t\t}",
"w>0",
"w",
"0",
"{\n\t\t\t\tSystem.out.println(a[i][w-1]);;\n\t\t\t}",
"System.out.println(a[i][w-1])",
"System.out.println",
"System.out",
"System",
"System.out",
"a[i][w-1]",
"a[i]",
"a",
"i",
"w-1",
"w",
"1",
"long[][] a",
"a",
"int h",
"h",
"int w",
"w"
] | import java.util.Scanner;
class Main{
public static void main(String[] args) {
Scanner sc=new Scanner(System.in);
int n=sc.nextInt();
int m=sc.nextInt();
int l=sc.nextInt();
long[][] m1=new long[n][m];
long[][] m2=new long[m][l];
long[][] ans=new long[n][l];
for(int i=0; i<n; i++) {
for(int j=0; j<m; j++) {
m1[i][j]=sc.nextLong();
}
}
for(int i=0; i<m; i++) {
for(int j=0; j<l; j++) {
m2[i][j]=sc.nextLong();
}
}
for(int i=0; i<n; i++) {
for(int j=0; j<l; j++) {
long tmp=0;
for(int k=0; k<m; k++) {
tmp+=m1[i][k]*m2[k][j];
}
ans[i][j]=tmp;
}
}
output(ans,n,l);
}
public static void output(long[][] a,int h,int w) {
for(int i=0; i<h; i++) {
for(int j=0; j<w-1; j++) {
System.out.print(a[i][j]+" ");
}
if(w>0) {
System.out.println(a[i][w-1]);;
}
}
}
}
|
[
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,
41,
13,
41,
13,
41,
13,
20,
0,
13,
4,
18,
13,
0,
13,
4,
18,
13,
0,
13,
4,
18,
13,
0,
13,
20,
13,
13,
0,
13,
20,
13,
13,
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,
18,
18,
13,
13,
13,
4,
18,
13,
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,
18,
18,
13,
13,
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,
0,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
2,
18,
18,
13,
13,
13,
18,
18,
13,
13,
13,
4,
18,
18,
13,
13,
13,
14,
2,
13,
2,
13,
17,
4,
18,
18,
13,
13,
17,
4,
18,
18,
13,
13,
23,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
10,
11
],
[
10,
12
],
[
0,
13
],
[
13,
14
],
[
13,
15
],
[
15,
16
],
[
15,
17
],
[
17,
18
],
[
18,
19
],
[
17,
20
],
[
20,
21
],
[
17,
22
],
[
22,
23
],
[
17,
24
],
[
24,
25
],
[
17,
26
],
[
26,
27
],
[
17,
28
],
[
28,
29
],
[
17,
30
],
[
30,
31
],
[
30,
32
],
[
17,
33
],
[
33,
34
],
[
33,
35
],
[
35,
36
],
[
36,
37
],
[
17,
38
],
[
38,
39
],
[
38,
40
],
[
40,
41
],
[
41,
42
],
[
17,
43
],
[
43,
44
],
[
43,
45
],
[
45,
46
],
[
46,
47
],
[
17,
48
],
[
48,
49
],
[
48,
50
],
[
17,
53
],
[
53,
54
],
[
53,
55
],
[
17,
58
],
[
58,
59
],
[
59,
60
],
[
60,
61
],
[
60,
62
],
[
58,
63
],
[
63,
64
],
[
63,
65
],
[
58,
66
],
[
66,
67
],
[
67,
68
],
[
58,
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
],
[
81,
82
],
[
82,
83
],
[
83,
84
],
[
84,
85
],
[
84,
86
],
[
83,
87
],
[
82,
88
],
[
88,
89
],
[
89,
90
],
[
17,
91
],
[
91,
92
],
[
92,
93
],
[
93,
94
],
[
93,
95
],
[
91,
96
],
[
96,
97
],
[
96,
98
],
[
91,
99
],
[
99,
100
],
[
100,
101
],
[
91,
102
],
[
102,
103
],
[
103,
104
],
[
104,
105
],
[
105,
106
],
[
105,
107
],
[
103,
108
],
[
108,
109
],
[
108,
110
],
[
103,
111
],
[
111,
112
],
[
112,
113
],
[
103,
114
],
[
114,
115
],
[
115,
116
],
[
116,
117
],
[
117,
118
],
[
117,
119
],
[
116,
120
],
[
115,
121
],
[
121,
122
],
[
122,
123
],
[
17,
124
],
[
124,
125
],
[
125,
126
],
[
126,
127
],
[
126,
128
],
[
124,
129
],
[
129,
130
],
[
129,
131
],
[
124,
132
],
[
132,
133
],
[
133,
134
],
[
124,
135
],
[
136,
136
],
[
136,
137
],
[
137,
138
],
[
138,
139
],
[
139,
140
],
[
139,
141
],
[
137,
142
],
[
142,
143
],
[
142,
144
],
[
137,
145
],
[
145,
146
],
[
146,
147
],
[
137,
148
],
[
149,
149
],
[
149,
150
],
[
150,
151
],
[
150,
152
],
[
149,
153
],
[
153,
154
],
[
154,
155
],
[
155,
156
],
[
155,
157
],
[
153,
158
],
[
158,
159
],
[
158,
160
],
[
153,
161
],
[
161,
162
],
[
162,
163
],
[
153,
164
],
[
165,
165
],
[
165,
166
],
[
166,
167
],
[
166,
168
],
[
168,
169
],
[
169,
170
],
[
170,
171
],
[
170,
172
],
[
169,
173
],
[
168,
174
],
[
174,
175
],
[
175,
176
],
[
175,
177
],
[
174,
178
],
[
149,
179
],
[
179,
180
],
[
180,
181
],
[
181,
182
],
[
181,
183
],
[
179,
184
],
[
149,
185
],
[
185,
186
],
[
186,
187
],
[
186,
188
],
[
188,
189
],
[
188,
190
],
[
185,
191
],
[
191,
192
],
[
192,
193
],
[
193,
194
],
[
193,
195
],
[
191,
196
],
[
136,
197
],
[
197,
198
],
[
198,
199
],
[
199,
200
],
[
199,
201
],
[
15,
202
],
[
202,
203
]
] | [
"import java.util.Scanner;\nimport java.util.ArrayList;\nimport java.util.Iterator;\nimport java.util.List;\n\nclass Main {\n public static void main(String[] args) {\n int n, m, l;\n long sum;\n int[][] a;\n int[][] b;\n Scanner sc = new Scanner(System.in);\n n = sc.nextInt();\n m = sc.nextInt();\n l = sc.nextInt();\n a = new int[n][m];\n b = new int[m][l];\n for (int i = 0; i < n; i++) \n \tfor (int j = 0; j < m; j++) \n \t\ta[i][j] = sc.nextInt();\n for (int i = 0; i < m; i++)\n \tfor (int j = 0; j < l; j++)\n\t \tb[i][j] = sc.nextInt();\n\n for (int i = 0; i < n; i++) {\n \tfor (int k = 0; k < l; k++) {\n \t\tsum = 0;\n\t \tfor (int j = 0; j < m; j++) {\n \t \t\tsum += a[i][j] * b[j][k];\n \t\t}\n \t\tSystem.out.print(sum);\n \t\tif (k != l - 1) \n \t\t\tSystem.out.print(\" \");\n \t}\n \tSystem.out.println();\n }\n }\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"import java.util.ArrayList;",
"ArrayList",
"java.util",
"import java.util.Iterator;",
"Iterator",
"java.util",
"import java.util.List;",
"List",
"java.util",
"class Main {\n public static void main(String[] args) {\n int n, m, l;\n long sum;\n int[][] a;\n int[][] b;\n Scanner sc = new Scanner(System.in);\n n = sc.nextInt();\n m = sc.nextInt();\n l = sc.nextInt();\n a = new int[n][m];\n b = new int[m][l];\n for (int i = 0; i < n; i++) \n \tfor (int j = 0; j < m; j++) \n \t\ta[i][j] = sc.nextInt();\n for (int i = 0; i < m; i++)\n \tfor (int j = 0; j < l; j++)\n\t \tb[i][j] = sc.nextInt();\n\n for (int i = 0; i < n; i++) {\n \tfor (int k = 0; k < l; k++) {\n \t\tsum = 0;\n\t \tfor (int j = 0; j < m; j++) {\n \t \t\tsum += a[i][j] * b[j][k];\n \t\t}\n \t\tSystem.out.print(sum);\n \t\tif (k != l - 1) \n \t\t\tSystem.out.print(\" \");\n \t}\n \tSystem.out.println();\n }\n }\n}",
"Main",
"public static void main(String[] args) {\n int n, m, l;\n long sum;\n int[][] a;\n int[][] b;\n Scanner sc = new Scanner(System.in);\n n = sc.nextInt();\n m = sc.nextInt();\n l = sc.nextInt();\n a = new int[n][m];\n b = new int[m][l];\n for (int i = 0; i < n; i++) \n \tfor (int j = 0; j < m; j++) \n \t\ta[i][j] = sc.nextInt();\n for (int i = 0; i < m; i++)\n \tfor (int j = 0; j < l; j++)\n\t \tb[i][j] = sc.nextInt();\n\n for (int i = 0; i < n; i++) {\n \tfor (int k = 0; k < l; k++) {\n \t\tsum = 0;\n\t \tfor (int j = 0; j < m; j++) {\n \t \t\tsum += a[i][j] * b[j][k];\n \t\t}\n \t\tSystem.out.print(sum);\n \t\tif (k != l - 1) \n \t\t\tSystem.out.print(\" \");\n \t}\n \tSystem.out.println();\n }\n }",
"main",
"{\n int n, m, l;\n long sum;\n int[][] a;\n int[][] b;\n Scanner sc = new Scanner(System.in);\n n = sc.nextInt();\n m = sc.nextInt();\n l = sc.nextInt();\n a = new int[n][m];\n b = new int[m][l];\n for (int i = 0; i < n; i++) \n \tfor (int j = 0; j < m; j++) \n \t\ta[i][j] = sc.nextInt();\n for (int i = 0; i < m; i++)\n \tfor (int j = 0; j < l; j++)\n\t \tb[i][j] = sc.nextInt();\n\n for (int i = 0; i < n; i++) {\n \tfor (int k = 0; k < l; k++) {\n \t\tsum = 0;\n\t \tfor (int j = 0; j < m; j++) {\n \t \t\tsum += a[i][j] * b[j][k];\n \t\t}\n \t\tSystem.out.print(sum);\n \t\tif (k != l - 1) \n \t\t\tSystem.out.print(\" \");\n \t}\n \tSystem.out.println();\n }\n }",
"int n",
"n",
"m",
"m",
"l;",
"l",
"long sum;",
"sum",
"int[][] a;",
"a",
"int[][] b;",
"b",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"n = sc.nextInt()",
"n",
"sc.nextInt()",
"sc.nextInt",
"sc",
"m = sc.nextInt()",
"m",
"sc.nextInt()",
"sc.nextInt",
"sc",
"l = sc.nextInt()",
"l",
"sc.nextInt()",
"sc.nextInt",
"sc",
"a = new int[n][m]",
"a",
"new int[n][m]",
"n",
"m",
"b = new int[m][l]",
"b",
"new int[m][l]",
"m",
"l",
"for (int i = 0; i < n; i++) \n \tfor (int j = 0; j < m; j++) \n \t\ta[i][j] = sc.nextInt();",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < n",
"i",
"n",
"i++",
"i++",
"i",
"for (int j = 0; j < m; j++) \n \t\ta[i][j] = sc.nextInt();",
"for (int j = 0; j < m; j++) \n \t\ta[i][j] = sc.nextInt();",
"int j = 0;",
"int j = 0;",
"j",
"0",
"j < m",
"j",
"m",
"j++",
"j++",
"j",
"a[i][j] = sc.nextInt();",
"a[i][j] = sc.nextInt()",
"a[i][j]",
"a[i]",
"a",
"i",
"j",
"sc.nextInt()",
"sc.nextInt",
"sc",
"for (int i = 0; i < m; i++)\n \tfor (int j = 0; j < l; j++)\n\t \tb[i][j] = sc.nextInt();",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < m",
"i",
"m",
"i++",
"i++",
"i",
"for (int j = 0; j < l; j++)\n\t \tb[i][j] = sc.nextInt();",
"for (int j = 0; j < l; j++)\n\t \tb[i][j] = sc.nextInt();",
"int j = 0;",
"int j = 0;",
"j",
"0",
"j < l",
"j",
"l",
"j++",
"j++",
"j",
"b[i][j] = sc.nextInt();",
"b[i][j] = sc.nextInt()",
"b[i][j]",
"b[i]",
"b",
"i",
"j",
"sc.nextInt()",
"sc.nextInt",
"sc",
"for (int i = 0; i < n; i++) {\n \tfor (int k = 0; k < l; k++) {\n \t\tsum = 0;\n\t \tfor (int j = 0; j < m; j++) {\n \t \t\tsum += a[i][j] * b[j][k];\n \t\t}\n \t\tSystem.out.print(sum);\n \t\tif (k != l - 1) \n \t\t\tSystem.out.print(\" \");\n \t}\n \tSystem.out.println();\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < n",
"i",
"n",
"i++",
"i++",
"i",
"{\n \tfor (int k = 0; k < l; k++) {\n \t\tsum = 0;\n\t \tfor (int j = 0; j < m; j++) {\n \t \t\tsum += a[i][j] * b[j][k];\n \t\t}\n \t\tSystem.out.print(sum);\n \t\tif (k != l - 1) \n \t\t\tSystem.out.print(\" \");\n \t}\n \tSystem.out.println();\n }",
"{\n \tfor (int k = 0; k < l; k++) {\n \t\tsum = 0;\n\t \tfor (int j = 0; j < m; j++) {\n \t \t\tsum += a[i][j] * b[j][k];\n \t\t}\n \t\tSystem.out.print(sum);\n \t\tif (k != l - 1) \n \t\t\tSystem.out.print(\" \");\n \t}\n \tSystem.out.println();\n }",
"for (int k = 0; k < l; k++) {\n \t\tsum = 0;\n\t \tfor (int j = 0; j < m; j++) {\n \t \t\tsum += a[i][j] * b[j][k];\n \t\t}\n \t\tSystem.out.print(sum);\n \t\tif (k != l - 1) \n \t\t\tSystem.out.print(\" \");\n \t}",
"int k = 0;",
"int k = 0;",
"k",
"0",
"k < l",
"k",
"l",
"k++",
"k++",
"k",
"{\n \t\tsum = 0;\n\t \tfor (int j = 0; j < m; j++) {\n \t \t\tsum += a[i][j] * b[j][k];\n \t\t}\n \t\tSystem.out.print(sum);\n \t\tif (k != l - 1) \n \t\t\tSystem.out.print(\" \");\n \t}",
"{\n \t\tsum = 0;\n\t \tfor (int j = 0; j < m; j++) {\n \t \t\tsum += a[i][j] * b[j][k];\n \t\t}\n \t\tSystem.out.print(sum);\n \t\tif (k != l - 1) \n \t\t\tSystem.out.print(\" \");\n \t}",
"sum = 0",
"sum",
"0",
"for (int j = 0; j < m; j++) {\n \t \t\tsum += a[i][j] * b[j][k];\n \t\t}",
"int j = 0;",
"int j = 0;",
"j",
"0",
"j < m",
"j",
"m",
"j++",
"j++",
"j",
"{\n \t \t\tsum += a[i][j] * b[j][k];\n \t\t}",
"{\n \t \t\tsum += a[i][j] * b[j][k];\n \t\t}",
"sum += a[i][j] * b[j][k]",
"sum",
"a[i][j] * b[j][k]",
"a[i][j]",
"a[i]",
"a",
"i",
"j",
"b[j][k]",
"b[j]",
"b",
"j",
"k",
"System.out.print(sum)",
"System.out.print",
"System.out",
"System",
"System.out",
"sum",
"if (k != l - 1) \n \t\t\tSystem.out.print(\" \");",
"k != l - 1",
"k",
"l - 1",
"l",
"1",
"System.out.print(\" \")",
"System.out.print",
"System.out",
"System",
"System.out",
"\" \"",
"System.out.println()",
"System.out.println",
"System.out",
"System",
"System.out",
"String[] args",
"args"
] | import java.util.Scanner;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
class Main {
public static void main(String[] args) {
int n, m, l;
long sum;
int[][] a;
int[][] b;
Scanner sc = new Scanner(System.in);
n = sc.nextInt();
m = sc.nextInt();
l = sc.nextInt();
a = new int[n][m];
b = new int[m][l];
for (int i = 0; i < n; i++)
for (int j = 0; j < m; j++)
a[i][j] = sc.nextInt();
for (int i = 0; i < m; i++)
for (int j = 0; j < l; j++)
b[i][j] = sc.nextInt();
for (int i = 0; i < n; i++) {
for (int k = 0; k < l; k++) {
sum = 0;
for (int j = 0; j < m; j++) {
sum += a[i][j] * b[j][k];
}
System.out.print(sum);
if (k != l - 1)
System.out.print(" ");
}
System.out.println();
}
}
}
|
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
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,
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,
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,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
18,
18,
13,
13,
13,
2,
18,
18,
13,
13,
13,
18,
18,
13,
13,
13,
4,
13,
13,
23,
13,
12,
13,
30,
41,
13,
18,
13,
13,
41,
13,
18,
18,
13,
17,
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,
4,
18,
18,
13,
13,
18,
18,
13,
13,
13,
14,
2,
13,
2,
13,
17,
30,
4,
18,
18,
13,
13,
17,
4,
18,
18,
13,
13,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
245,
5
],
[
245,
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
],
[
19,
20
],
[
20,
21
],
[
8,
22
],
[
22,
23
],
[
22,
24
],
[
24,
25
],
[
25,
26
],
[
8,
27
],
[
27,
28
],
[
27,
29
],
[
8,
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
],
[
59,
63
],
[
58,
64
],
[
64,
65
],
[
65,
66
],
[
8,
67
],
[
67,
68
],
[
67,
69
],
[
8,
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
],
[
85,
93
],
[
93,
94
],
[
94,
95
],
[
85,
96
],
[
97,
97
],
[
97,
98
],
[
98,
99
],
[
99,
100
],
[
100,
101
],
[
100,
102
],
[
99,
103
],
[
98,
104
],
[
104,
105
],
[
105,
106
],
[
8,
107
],
[
107,
108
],
[
107,
109
],
[
8,
112
],
[
112,
113
],
[
113,
114
],
[
114,
115
],
[
114,
116
],
[
112,
117
],
[
117,
118
],
[
117,
119
],
[
112,
120
],
[
120,
121
],
[
121,
122
],
[
112,
123
],
[
124,
124
],
[
124,
125
],
[
125,
126
],
[
126,
127
],
[
127,
128
],
[
127,
129
],
[
125,
130
],
[
130,
131
],
[
130,
132
],
[
125,
133
],
[
133,
134
],
[
134,
135
],
[
125,
136
],
[
137,
137
],
[
137,
138
],
[
138,
139
],
[
139,
140
],
[
140,
141
],
[
140,
142
],
[
138,
143
],
[
143,
144
],
[
143,
145
],
[
138,
146
],
[
146,
147
],
[
147,
148
],
[
138,
149
],
[
150,
150
],
[
150,
151
],
[
151,
152
],
[
152,
153
],
[
153,
154
],
[
153,
155
],
[
152,
156
],
[
151,
157
],
[
157,
158
],
[
158,
159
],
[
159,
160
],
[
159,
161
],
[
158,
162
],
[
157,
163
],
[
163,
164
],
[
164,
165
],
[
164,
166
],
[
163,
167
],
[
8,
168
],
[
168,
169
],
[
168,
170
],
[
6,
171
],
[
171,
172
],
[
245,
173
],
[
173,
174
],
[
173,
175
],
[
175,
176
],
[
176,
177
],
[
176,
178
],
[
178,
179
],
[
178,
180
],
[
175,
181
],
[
181,
182
],
[
181,
183
],
[
183,
184
],
[
184,
185
],
[
184,
186
],
[
183,
187
],
[
175,
188
],
[
188,
189
],
[
189,
190
],
[
190,
191
],
[
190,
192
],
[
188,
193
],
[
193,
194
],
[
193,
195
],
[
188,
196
],
[
196,
197
],
[
197,
198
],
[
188,
199
],
[
200,
200
],
[
200,
201
],
[
201,
202
],
[
202,
203
],
[
203,
204
],
[
203,
205
],
[
201,
206
],
[
206,
207
],
[
206,
208
],
[
201,
209
],
[
209,
210
],
[
210,
211
],
[
201,
212
],
[
213,
213
],
[
213,
214
],
[
214,
215
],
[
215,
216
],
[
216,
217
],
[
216,
218
],
[
214,
219
],
[
219,
220
],
[
220,
221
],
[
220,
222
],
[
219,
223
],
[
213,
224
],
[
224,
225
],
[
225,
226
],
[
225,
227
],
[
227,
228
],
[
227,
229
],
[
224,
230
],
[
230,
231
],
[
231,
232
],
[
232,
233
],
[
233,
234
],
[
233,
235
],
[
231,
236
],
[
200,
237
],
[
237,
238
],
[
238,
239
],
[
239,
240
],
[
239,
241
],
[
173,
242
],
[
242,
243
],
[
0,
244
],
[
244,
245
],
[
244,
246
]
] | [
"import java.util.Scanner;\n\npublic class Main {\n \n public static void main(String[] args) {\n Scanner scanner = new Scanner(System.in);\n \n // Cij = (k=1...m) AikBkj\n // Cnl = Anm x Bml\n \n // input n,m,l\n int n = scanner.nextInt();\n int m = scanner.nextInt();\n int l = scanner.nextInt();\n \n // create Anm\n int[][] Anm = new int[n][m];\n for(int i=0; i<n; i++){\n for(int j=0; j<m; j++){\n Anm[i][j] = scanner.nextInt();\n }\n }\n \n // create Bml\n int[][] Bml = new int[m][l];\n for(int i=0; i<m; i++){\n for(int j=0; j<l; j++){\n Bml[i][j] = scanner.nextInt();\n }\n }\n \n // create Cnl\n long[][] Cnl = new long[n][l];\n for(int iN=0; iN<n; iN++){\n for(int kM=0; kM<m; kM++){ \n for(int jL=0; jL<l; jL++){\n Cnl[iN][jL] += Anm[iN][kM] * Bml[kM][jL];\n }\n }\n }\n \n // display\n printArray(Cnl);\n\n }\n \n public static void printArray(long[][] array) {\n int row = array.length;\n int width = array[0].length;\n for(int i=0; i<row; i++){\n for(int j=0; j<width; j++){\n System.out.print(array[i][j]);\n if (j != width-1) { System.out.print(\" \"); }\n }\n System.out.println();\n }\n }\n \n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n \n public static void main(String[] args) {\n Scanner scanner = new Scanner(System.in);\n \n // Cij = (k=1...m) AikBkj\n // Cnl = Anm x Bml\n \n // input n,m,l\n int n = scanner.nextInt();\n int m = scanner.nextInt();\n int l = scanner.nextInt();\n \n // create Anm\n int[][] Anm = new int[n][m];\n for(int i=0; i<n; i++){\n for(int j=0; j<m; j++){\n Anm[i][j] = scanner.nextInt();\n }\n }\n \n // create Bml\n int[][] Bml = new int[m][l];\n for(int i=0; i<m; i++){\n for(int j=0; j<l; j++){\n Bml[i][j] = scanner.nextInt();\n }\n }\n \n // create Cnl\n long[][] Cnl = new long[n][l];\n for(int iN=0; iN<n; iN++){\n for(int kM=0; kM<m; kM++){ \n for(int jL=0; jL<l; jL++){\n Cnl[iN][jL] += Anm[iN][kM] * Bml[kM][jL];\n }\n }\n }\n \n // display\n printArray(Cnl);\n\n }\n \n public static void printArray(long[][] array) {\n int row = array.length;\n int width = array[0].length;\n for(int i=0; i<row; i++){\n for(int j=0; j<width; j++){\n System.out.print(array[i][j]);\n if (j != width-1) { System.out.print(\" \"); }\n }\n System.out.println();\n }\n }\n \n}",
"Main",
"public static void main(String[] args) {\n Scanner scanner = new Scanner(System.in);\n \n // Cij = (k=1...m) AikBkj\n // Cnl = Anm x Bml\n \n // input n,m,l\n int n = scanner.nextInt();\n int m = scanner.nextInt();\n int l = scanner.nextInt();\n \n // create Anm\n int[][] Anm = new int[n][m];\n for(int i=0; i<n; i++){\n for(int j=0; j<m; j++){\n Anm[i][j] = scanner.nextInt();\n }\n }\n \n // create Bml\n int[][] Bml = new int[m][l];\n for(int i=0; i<m; i++){\n for(int j=0; j<l; j++){\n Bml[i][j] = scanner.nextInt();\n }\n }\n \n // create Cnl\n long[][] Cnl = new long[n][l];\n for(int iN=0; iN<n; iN++){\n for(int kM=0; kM<m; kM++){ \n for(int jL=0; jL<l; jL++){\n Cnl[iN][jL] += Anm[iN][kM] * Bml[kM][jL];\n }\n }\n }\n \n // display\n printArray(Cnl);\n\n }",
"main",
"{\n Scanner scanner = new Scanner(System.in);\n \n // Cij = (k=1...m) AikBkj\n // Cnl = Anm x Bml\n \n // input n,m,l\n int n = scanner.nextInt();\n int m = scanner.nextInt();\n int l = scanner.nextInt();\n \n // create Anm\n int[][] Anm = new int[n][m];\n for(int i=0; i<n; i++){\n for(int j=0; j<m; j++){\n Anm[i][j] = scanner.nextInt();\n }\n }\n \n // create Bml\n int[][] Bml = new int[m][l];\n for(int i=0; i<m; i++){\n for(int j=0; j<l; j++){\n Bml[i][j] = scanner.nextInt();\n }\n }\n \n // create Cnl\n long[][] Cnl = new long[n][l];\n for(int iN=0; iN<n; iN++){\n for(int kM=0; kM<m; kM++){ \n for(int jL=0; jL<l; jL++){\n Cnl[iN][jL] += Anm[iN][kM] * Bml[kM][jL];\n }\n }\n }\n \n // display\n printArray(Cnl);\n\n }",
"Scanner scanner = new Scanner(System.in);",
"scanner",
"new Scanner(System.in)",
"int n = scanner.nextInt();",
"n",
"scanner.nextInt()",
"scanner.nextInt",
"scanner",
"int m = scanner.nextInt();",
"m",
"scanner.nextInt()",
"scanner.nextInt",
"scanner",
"int l = scanner.nextInt();",
"l",
"scanner.nextInt()",
"scanner.nextInt",
"scanner",
"int[][] Anm = new int[n][m];",
"Anm",
"new int[n][m]",
"n",
"m",
"for(int i=0; i<n; i++){\n for(int j=0; j<m; j++){\n Anm[i][j] = scanner.nextInt();\n }\n }",
"int i=0;",
"int i=0;",
"i",
"0",
"i<n",
"i",
"n",
"i++",
"i++",
"i",
"{\n for(int j=0; j<m; j++){\n Anm[i][j] = scanner.nextInt();\n }\n }",
"{\n for(int j=0; j<m; j++){\n Anm[i][j] = scanner.nextInt();\n }\n }",
"for(int j=0; j<m; j++){\n Anm[i][j] = scanner.nextInt();\n }",
"int j=0;",
"int j=0;",
"j",
"0",
"j<m",
"j",
"m",
"j++",
"j++",
"j",
"{\n Anm[i][j] = scanner.nextInt();\n }",
"{\n Anm[i][j] = scanner.nextInt();\n }",
"Anm[i][j] = scanner.nextInt()",
"Anm[i][j]",
"Anm[i]",
"Anm",
"i",
"j",
"scanner.nextInt()",
"scanner.nextInt",
"scanner",
"int[][] Bml = new int[m][l];",
"Bml",
"new int[m][l]",
"m",
"l",
"for(int i=0; i<m; i++){\n for(int j=0; j<l; j++){\n Bml[i][j] = scanner.nextInt();\n }\n }",
"int i=0;",
"int i=0;",
"i",
"0",
"i<m",
"i",
"m",
"i++",
"i++",
"i",
"{\n for(int j=0; j<l; j++){\n Bml[i][j] = scanner.nextInt();\n }\n }",
"{\n for(int j=0; j<l; j++){\n Bml[i][j] = scanner.nextInt();\n }\n }",
"for(int j=0; j<l; j++){\n Bml[i][j] = scanner.nextInt();\n }",
"int j=0;",
"int j=0;",
"j",
"0",
"j<l",
"j",
"l",
"j++",
"j++",
"j",
"{\n Bml[i][j] = scanner.nextInt();\n }",
"{\n Bml[i][j] = scanner.nextInt();\n }",
"Bml[i][j] = scanner.nextInt()",
"Bml[i][j]",
"Bml[i]",
"Bml",
"i",
"j",
"scanner.nextInt()",
"scanner.nextInt",
"scanner",
"long[][] Cnl = new long[n][l];",
"Cnl",
"new long[n][l]",
"n",
"l",
"for(int iN=0; iN<n; iN++){\n for(int kM=0; kM<m; kM++){ \n for(int jL=0; jL<l; jL++){\n Cnl[iN][jL] += Anm[iN][kM] * Bml[kM][jL];\n }\n }\n }",
"int iN=0;",
"int iN=0;",
"iN",
"0",
"iN<n",
"iN",
"n",
"iN++",
"iN++",
"iN",
"{\n for(int kM=0; kM<m; kM++){ \n for(int jL=0; jL<l; jL++){\n Cnl[iN][jL] += Anm[iN][kM] * Bml[kM][jL];\n }\n }\n }",
"{\n for(int kM=0; kM<m; kM++){ \n for(int jL=0; jL<l; jL++){\n Cnl[iN][jL] += Anm[iN][kM] * Bml[kM][jL];\n }\n }\n }",
"for(int kM=0; kM<m; kM++){ \n for(int jL=0; jL<l; jL++){\n Cnl[iN][jL] += Anm[iN][kM] * Bml[kM][jL];\n }\n }",
"int kM=0;",
"int kM=0;",
"kM",
"0",
"kM<m",
"kM",
"m",
"kM++",
"kM++",
"kM",
"{ \n for(int jL=0; jL<l; jL++){\n Cnl[iN][jL] += Anm[iN][kM] * Bml[kM][jL];\n }\n }",
"{ \n for(int jL=0; jL<l; jL++){\n Cnl[iN][jL] += Anm[iN][kM] * Bml[kM][jL];\n }\n }",
"for(int jL=0; jL<l; jL++){\n Cnl[iN][jL] += Anm[iN][kM] * Bml[kM][jL];\n }",
"int jL=0;",
"int jL=0;",
"jL",
"0",
"jL<l",
"jL",
"l",
"jL++",
"jL++",
"jL",
"{\n Cnl[iN][jL] += Anm[iN][kM] * Bml[kM][jL];\n }",
"{\n Cnl[iN][jL] += Anm[iN][kM] * Bml[kM][jL];\n }",
"Cnl[iN][jL] += Anm[iN][kM] * Bml[kM][jL]",
"Cnl[iN][jL]",
"Cnl[iN]",
"Cnl",
"iN",
"jL",
"Anm[iN][kM] * Bml[kM][jL]",
"Anm[iN][kM]",
"Anm[iN]",
"Anm",
"iN",
"kM",
"Bml[kM][jL]",
"Bml[kM]",
"Bml",
"kM",
"jL",
"printArray(Cnl)",
"printArray",
"Cnl",
"String[] args",
"args",
"public static void printArray(long[][] array) {\n int row = array.length;\n int width = array[0].length;\n for(int i=0; i<row; i++){\n for(int j=0; j<width; j++){\n System.out.print(array[i][j]);\n if (j != width-1) { System.out.print(\" \"); }\n }\n System.out.println();\n }\n }",
"printArray",
"{\n int row = array.length;\n int width = array[0].length;\n for(int i=0; i<row; i++){\n for(int j=0; j<width; j++){\n System.out.print(array[i][j]);\n if (j != width-1) { System.out.print(\" \"); }\n }\n System.out.println();\n }\n }",
"int row = array.length;",
"row",
"array.length",
"array",
"array.length",
"int width = array[0].length;",
"width",
"array[0].length",
"array[0]",
"array",
"0",
"array[0].length",
"for(int i=0; i<row; i++){\n for(int j=0; j<width; j++){\n System.out.print(array[i][j]);\n if (j != width-1) { System.out.print(\" \"); }\n }\n System.out.println();\n }",
"int i=0;",
"int i=0;",
"i",
"0",
"i<row",
"i",
"row",
"i++",
"i++",
"i",
"{\n for(int j=0; j<width; j++){\n System.out.print(array[i][j]);\n if (j != width-1) { System.out.print(\" \"); }\n }\n System.out.println();\n }",
"{\n for(int j=0; j<width; j++){\n System.out.print(array[i][j]);\n if (j != width-1) { System.out.print(\" \"); }\n }\n System.out.println();\n }",
"for(int j=0; j<width; j++){\n System.out.print(array[i][j]);\n if (j != width-1) { System.out.print(\" \"); }\n }",
"int j=0;",
"int j=0;",
"j",
"0",
"j<width",
"j",
"width",
"j++",
"j++",
"j",
"{\n System.out.print(array[i][j]);\n if (j != width-1) { System.out.print(\" \"); }\n }",
"{\n System.out.print(array[i][j]);\n if (j != width-1) { System.out.print(\" \"); }\n }",
"System.out.print(array[i][j])",
"System.out.print",
"System.out",
"System",
"System.out",
"array[i][j]",
"array[i]",
"array",
"i",
"j",
"if (j != width-1) { System.out.print(\" \"); }",
"j != width-1",
"j",
"width-1",
"width",
"1",
"{ System.out.print(\" \"); }",
"System.out.print(\" \")",
"System.out.print",
"System.out",
"System",
"System.out",
"\" \"",
"System.out.println()",
"System.out.println",
"System.out",
"System",
"System.out",
"long[][] array",
"array",
"public class Main {\n \n public static void main(String[] args) {\n Scanner scanner = new Scanner(System.in);\n \n // Cij = (k=1...m) AikBkj\n // Cnl = Anm x Bml\n \n // input n,m,l\n int n = scanner.nextInt();\n int m = scanner.nextInt();\n int l = scanner.nextInt();\n \n // create Anm\n int[][] Anm = new int[n][m];\n for(int i=0; i<n; i++){\n for(int j=0; j<m; j++){\n Anm[i][j] = scanner.nextInt();\n }\n }\n \n // create Bml\n int[][] Bml = new int[m][l];\n for(int i=0; i<m; i++){\n for(int j=0; j<l; j++){\n Bml[i][j] = scanner.nextInt();\n }\n }\n \n // create Cnl\n long[][] Cnl = new long[n][l];\n for(int iN=0; iN<n; iN++){\n for(int kM=0; kM<m; kM++){ \n for(int jL=0; jL<l; jL++){\n Cnl[iN][jL] += Anm[iN][kM] * Bml[kM][jL];\n }\n }\n }\n \n // display\n printArray(Cnl);\n\n }\n \n public static void printArray(long[][] array) {\n int row = array.length;\n int width = array[0].length;\n for(int i=0; i<row; i++){\n for(int j=0; j<width; j++){\n System.out.print(array[i][j]);\n if (j != width-1) { System.out.print(\" \"); }\n }\n System.out.println();\n }\n }\n \n}",
"public class Main {\n \n public static void main(String[] args) {\n Scanner scanner = new Scanner(System.in);\n \n // Cij = (k=1...m) AikBkj\n // Cnl = Anm x Bml\n \n // input n,m,l\n int n = scanner.nextInt();\n int m = scanner.nextInt();\n int l = scanner.nextInt();\n \n // create Anm\n int[][] Anm = new int[n][m];\n for(int i=0; i<n; i++){\n for(int j=0; j<m; j++){\n Anm[i][j] = scanner.nextInt();\n }\n }\n \n // create Bml\n int[][] Bml = new int[m][l];\n for(int i=0; i<m; i++){\n for(int j=0; j<l; j++){\n Bml[i][j] = scanner.nextInt();\n }\n }\n \n // create Cnl\n long[][] Cnl = new long[n][l];\n for(int iN=0; iN<n; iN++){\n for(int kM=0; kM<m; kM++){ \n for(int jL=0; jL<l; jL++){\n Cnl[iN][jL] += Anm[iN][kM] * Bml[kM][jL];\n }\n }\n }\n \n // display\n printArray(Cnl);\n\n }\n \n public static void printArray(long[][] array) {\n int row = array.length;\n int width = array[0].length;\n for(int i=0; i<row; i++){\n for(int j=0; j<width; j++){\n System.out.print(array[i][j]);\n if (j != width-1) { System.out.print(\" \"); }\n }\n System.out.println();\n }\n }\n \n}",
"Main"
] | import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
// Cij = (k=1...m) AikBkj
// Cnl = Anm x Bml
// input n,m,l
int n = scanner.nextInt();
int m = scanner.nextInt();
int l = scanner.nextInt();
// create Anm
int[][] Anm = new int[n][m];
for(int i=0; i<n; i++){
for(int j=0; j<m; j++){
Anm[i][j] = scanner.nextInt();
}
}
// create Bml
int[][] Bml = new int[m][l];
for(int i=0; i<m; i++){
for(int j=0; j<l; j++){
Bml[i][j] = scanner.nextInt();
}
}
// create Cnl
long[][] Cnl = new long[n][l];
for(int iN=0; iN<n; iN++){
for(int kM=0; kM<m; kM++){
for(int jL=0; jL<l; jL++){
Cnl[iN][jL] += Anm[iN][kM] * Bml[kM][jL];
}
}
}
// display
printArray(Cnl);
}
public static void printArray(long[][] array) {
int row = array.length;
int width = array[0].length;
for(int i=0; i<row; i++){
for(int j=0; j<width; j++){
System.out.print(array[i][j]);
if (j != width-1) { System.out.print(" "); }
}
System.out.println();
}
}
}
|
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
41,
13,
20,
13,
13,
41,
13,
20,
13,
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,
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,
0,
18,
18,
13,
13,
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,
18,
18,
13,
13,
13,
2,
18,
18,
13,
13,
13,
18,
18,
13,
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,
14,
2,
2,
13,
17,
13,
30,
4,
18,
18,
13,
13,
18,
18,
13,
13,
13,
14,
2,
13,
13,
30,
4,
18,
18,
13,
13,
2,
18,
18,
13,
13,
13,
17,
4,
18,
13,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
234,
5
],
[
234,
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
],
[
19,
20
],
[
20,
21
],
[
8,
22
],
[
22,
23
],
[
22,
24
],
[
24,
25
],
[
25,
26
],
[
8,
27
],
[
27,
28
],
[
27,
29
],
[
8,
32
],
[
32,
33
],
[
32,
34
],
[
8,
37
],
[
37,
38
],
[
37,
39
],
[
8,
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
],
[
69,
70
],
[
70,
71
],
[
70,
72
],
[
69,
73
],
[
68,
74
],
[
74,
75
],
[
75,
76
],
[
8,
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
],
[
104,
105
],
[
105,
106
],
[
105,
107
],
[
104,
108
],
[
103,
109
],
[
109,
110
],
[
110,
111
],
[
8,
112
],
[
112,
113
],
[
113,
114
],
[
114,
115
],
[
114,
116
],
[
112,
117
],
[
117,
118
],
[
117,
119
],
[
112,
120
],
[
120,
121
],
[
121,
122
],
[
112,
123
],
[
124,
124
],
[
124,
125
],
[
125,
126
],
[
126,
127
],
[
127,
128
],
[
127,
129
],
[
125,
130
],
[
130,
131
],
[
130,
132
],
[
125,
133
],
[
133,
134
],
[
134,
135
],
[
125,
136
],
[
137,
137
],
[
137,
138
],
[
138,
139
],
[
139,
140
],
[
140,
141
],
[
140,
142
],
[
138,
143
],
[
143,
144
],
[
143,
145
],
[
138,
146
],
[
146,
147
],
[
147,
148
],
[
138,
149
],
[
150,
150
],
[
150,
151
],
[
151,
152
],
[
152,
153
],
[
153,
154
],
[
153,
155
],
[
152,
156
],
[
151,
157
],
[
157,
158
],
[
158,
159
],
[
159,
160
],
[
159,
161
],
[
158,
162
],
[
157,
163
],
[
163,
164
],
[
164,
165
],
[
164,
166
],
[
163,
167
],
[
8,
168
],
[
168,
169
],
[
169,
170
],
[
170,
171
],
[
170,
172
],
[
168,
173
],
[
173,
174
],
[
173,
175
],
[
168,
176
],
[
176,
177
],
[
177,
178
],
[
168,
179
],
[
180,
180
],
[
180,
181
],
[
181,
182
],
[
182,
183
],
[
183,
184
],
[
183,
185
],
[
181,
186
],
[
186,
187
],
[
186,
188
],
[
181,
189
],
[
189,
190
],
[
190,
191
],
[
181,
192
],
[
193,
193
],
[
193,
194
],
[
194,
195
],
[
195,
196
],
[
196,
197
],
[
196,
198
],
[
195,
199
],
[
194,
200
],
[
200,
201
],
[
201,
202
],
[
202,
203
],
[
203,
204
],
[
203,
205
],
[
201,
206
],
[
206,
207
],
[
207,
208
],
[
207,
209
],
[
206,
210
],
[
194,
211
],
[
211,
212
],
[
212,
213
],
[
212,
214
],
[
211,
215
],
[
215,
216
],
[
216,
217
],
[
217,
218
],
[
218,
219
],
[
218,
220
],
[
216,
221
],
[
221,
222
],
[
222,
223
],
[
223,
224
],
[
223,
225
],
[
222,
226
],
[
221,
227
],
[
8,
228
],
[
228,
229
],
[
229,
230
],
[
6,
231
],
[
231,
232
],
[
0,
233
],
[
233,
234
],
[
233,
235
]
] | [
"import java.util.Scanner;\n\npublic class Main{\n\tpublic static void main(String[] args){\n\n\t\tScanner scan = new Scanner(System.in);\n\n\t\t//二つの行列の行と列を宣言\n\t\tint row = scan.nextInt();\n\t\tint columnRow = scan.nextInt();\n\t\tint column = scan.nextInt();\n\n\t\t//二つの行列(二次元配列)を宣言\n\t\tint[][] matrixA = new int[row][columnRow];\n\t\tint[][] matrixB = new int[columnRow][column];\n\t\tlong[][] matrixC = new long[row][column];\n\n\t\t//行列Aのためのループ\n\t\tfor(int rowI = 0 ;rowI < row;rowI++){\n\t\t\tfor(int columnRowI =0 ;columnRowI < columnRow ;columnRowI++){\n\t\t\t\t//行列Aの入力\n\t\t\t\tmatrixA[rowI][columnRowI] = scan.nextInt();\n\t\t\t}\n\t\t}\n\n\t\t//行列Bのためのループ\n\t\tfor(int columnRowI = 0 ;columnRowI < columnRow;columnRowI++){\n\t\t\tfor(int columnI =0 ;columnI < column ;columnI++){\n\t\t\t\t//行列Bの入力\n\t\t\t\tmatrixB[columnRowI][columnI] = scan.nextInt();\n\t\t\t}\n\t\t}\n\n\t\t//行列Cの計算のためのループ\n\t\tfor(int rowI = 0 ;rowI < row;rowI++){\n\t\t\tfor(int columnRowI =0 ;columnRowI < column ;columnRowI++){\n\t\t\t\tfor(int columnI =0 ;columnI < columnRow ;columnI++){\n\n\t\t\t\t\t//行列Cの入力\n\t\t\t\t\tmatrixC[rowI][columnRowI]\n\t\t\t\t\t\t\t+= matrixA[rowI][columnI] * matrixB[columnI][columnRowI];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tfor(int rowI = 0 ;rowI < row;rowI++){\n\t\t\tfor(int columnI = 0 ;columnI < column ;columnI++){\n\t\t\t\tif(columnI+ 1 == column){\n\t\t\t\t\tSystem.out.println(matrixC[rowI][columnI]);\n\t\t\t\t}else if(columnI < column){\n\t\t\t\t\tSystem.out.print(matrixC[rowI][columnI] + \" \");\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tscan.close();\n\t}\n}\n",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main{\n\tpublic static void main(String[] args){\n\n\t\tScanner scan = new Scanner(System.in);\n\n\t\t//二つの行列の行と列を宣言\n\t\tint row = scan.nextInt();\n\t\tint columnRow = scan.nextInt();\n\t\tint column = scan.nextInt();\n\n\t\t//二つの行列(二次元配列)を宣言\n\t\tint[][] matrixA = new int[row][columnRow];\n\t\tint[][] matrixB = new int[columnRow][column];\n\t\tlong[][] matrixC = new long[row][column];\n\n\t\t//行列Aのためのループ\n\t\tfor(int rowI = 0 ;rowI < row;rowI++){\n\t\t\tfor(int columnRowI =0 ;columnRowI < columnRow ;columnRowI++){\n\t\t\t\t//行列Aの入力\n\t\t\t\tmatrixA[rowI][columnRowI] = scan.nextInt();\n\t\t\t}\n\t\t}\n\n\t\t//行列Bのためのループ\n\t\tfor(int columnRowI = 0 ;columnRowI < columnRow;columnRowI++){\n\t\t\tfor(int columnI =0 ;columnI < column ;columnI++){\n\t\t\t\t//行列Bの入力\n\t\t\t\tmatrixB[columnRowI][columnI] = scan.nextInt();\n\t\t\t}\n\t\t}\n\n\t\t//行列Cの計算のためのループ\n\t\tfor(int rowI = 0 ;rowI < row;rowI++){\n\t\t\tfor(int columnRowI =0 ;columnRowI < column ;columnRowI++){\n\t\t\t\tfor(int columnI =0 ;columnI < columnRow ;columnI++){\n\n\t\t\t\t\t//行列Cの入力\n\t\t\t\t\tmatrixC[rowI][columnRowI]\n\t\t\t\t\t\t\t+= matrixA[rowI][columnI] * matrixB[columnI][columnRowI];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tfor(int rowI = 0 ;rowI < row;rowI++){\n\t\t\tfor(int columnI = 0 ;columnI < column ;columnI++){\n\t\t\t\tif(columnI+ 1 == column){\n\t\t\t\t\tSystem.out.println(matrixC[rowI][columnI]);\n\t\t\t\t}else if(columnI < column){\n\t\t\t\t\tSystem.out.print(matrixC[rowI][columnI] + \" \");\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tscan.close();\n\t}\n}",
"Main",
"public static void main(String[] args){\n\n\t\tScanner scan = new Scanner(System.in);\n\n\t\t//二つの行列の行と列を宣言\n\t\tint row = scan.nextInt();\n\t\tint columnRow = scan.nextInt();\n\t\tint column = scan.nextInt();\n\n\t\t//二つの行列(二次元配列)を宣言\n\t\tint[][] matrixA = new int[row][columnRow];\n\t\tint[][] matrixB = new int[columnRow][column];\n\t\tlong[][] matrixC = new long[row][column];\n\n\t\t//行列Aのためのループ\n\t\tfor(int rowI = 0 ;rowI < row;rowI++){\n\t\t\tfor(int columnRowI =0 ;columnRowI < columnRow ;columnRowI++){\n\t\t\t\t//行列Aの入力\n\t\t\t\tmatrixA[rowI][columnRowI] = scan.nextInt();\n\t\t\t}\n\t\t}\n\n\t\t//行列Bのためのループ\n\t\tfor(int columnRowI = 0 ;columnRowI < columnRow;columnRowI++){\n\t\t\tfor(int columnI =0 ;columnI < column ;columnI++){\n\t\t\t\t//行列Bの入力\n\t\t\t\tmatrixB[columnRowI][columnI] = scan.nextInt();\n\t\t\t}\n\t\t}\n\n\t\t//行列Cの計算のためのループ\n\t\tfor(int rowI = 0 ;rowI < row;rowI++){\n\t\t\tfor(int columnRowI =0 ;columnRowI < column ;columnRowI++){\n\t\t\t\tfor(int columnI =0 ;columnI < columnRow ;columnI++){\n\n\t\t\t\t\t//行列Cの入力\n\t\t\t\t\tmatrixC[rowI][columnRowI]\n\t\t\t\t\t\t\t+= matrixA[rowI][columnI] * matrixB[columnI][columnRowI];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tfor(int rowI = 0 ;rowI < row;rowI++){\n\t\t\tfor(int columnI = 0 ;columnI < column ;columnI++){\n\t\t\t\tif(columnI+ 1 == column){\n\t\t\t\t\tSystem.out.println(matrixC[rowI][columnI]);\n\t\t\t\t}else if(columnI < column){\n\t\t\t\t\tSystem.out.print(matrixC[rowI][columnI] + \" \");\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tscan.close();\n\t}",
"main",
"{\n\n\t\tScanner scan = new Scanner(System.in);\n\n\t\t//二つの行列の行と列を宣言\n\t\tint row = scan.nextInt();\n\t\tint columnRow = scan.nextInt();\n\t\tint column = scan.nextInt();\n\n\t\t//二つの行列(二次元配列)を宣言\n\t\tint[][] matrixA = new int[row][columnRow];\n\t\tint[][] matrixB = new int[columnRow][column];\n\t\tlong[][] matrixC = new long[row][column];\n\n\t\t//行列Aのためのループ\n\t\tfor(int rowI = 0 ;rowI < row;rowI++){\n\t\t\tfor(int columnRowI =0 ;columnRowI < columnRow ;columnRowI++){\n\t\t\t\t//行列Aの入力\n\t\t\t\tmatrixA[rowI][columnRowI] = scan.nextInt();\n\t\t\t}\n\t\t}\n\n\t\t//行列Bのためのループ\n\t\tfor(int columnRowI = 0 ;columnRowI < columnRow;columnRowI++){\n\t\t\tfor(int columnI =0 ;columnI < column ;columnI++){\n\t\t\t\t//行列Bの入力\n\t\t\t\tmatrixB[columnRowI][columnI] = scan.nextInt();\n\t\t\t}\n\t\t}\n\n\t\t//行列Cの計算のためのループ\n\t\tfor(int rowI = 0 ;rowI < row;rowI++){\n\t\t\tfor(int columnRowI =0 ;columnRowI < column ;columnRowI++){\n\t\t\t\tfor(int columnI =0 ;columnI < columnRow ;columnI++){\n\n\t\t\t\t\t//行列Cの入力\n\t\t\t\t\tmatrixC[rowI][columnRowI]\n\t\t\t\t\t\t\t+= matrixA[rowI][columnI] * matrixB[columnI][columnRowI];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tfor(int rowI = 0 ;rowI < row;rowI++){\n\t\t\tfor(int columnI = 0 ;columnI < column ;columnI++){\n\t\t\t\tif(columnI+ 1 == column){\n\t\t\t\t\tSystem.out.println(matrixC[rowI][columnI]);\n\t\t\t\t}else if(columnI < column){\n\t\t\t\t\tSystem.out.print(matrixC[rowI][columnI] + \" \");\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tscan.close();\n\t}",
"Scanner scan = new Scanner(System.in);",
"scan",
"new Scanner(System.in)",
"int row = scan.nextInt();",
"row",
"scan.nextInt()",
"scan.nextInt",
"scan",
"int columnRow = scan.nextInt();",
"columnRow",
"scan.nextInt()",
"scan.nextInt",
"scan",
"int column = scan.nextInt();",
"column",
"scan.nextInt()",
"scan.nextInt",
"scan",
"int[][] matrixA = new int[row][columnRow];",
"matrixA",
"new int[row][columnRow]",
"row",
"columnRow",
"int[][] matrixB = new int[columnRow][column];",
"matrixB",
"new int[columnRow][column]",
"columnRow",
"column",
"long[][] matrixC = new long[row][column];",
"matrixC",
"new long[row][column]",
"row",
"column",
"for(int rowI = 0 ;rowI < row;rowI++){\n\t\t\tfor(int columnRowI =0 ;columnRowI < columnRow ;columnRowI++){\n\t\t\t\t//行列Aの入力\n\t\t\t\tmatrixA[rowI][columnRowI] = scan.nextInt();\n\t\t\t}\n\t\t}",
"int rowI = 0 ;",
"int rowI = 0 ;",
"rowI",
"0",
"rowI < row",
"rowI",
"row",
"rowI++",
"rowI++",
"rowI",
"{\n\t\t\tfor(int columnRowI =0 ;columnRowI < columnRow ;columnRowI++){\n\t\t\t\t//行列Aの入力\n\t\t\t\tmatrixA[rowI][columnRowI] = scan.nextInt();\n\t\t\t}\n\t\t}",
"{\n\t\t\tfor(int columnRowI =0 ;columnRowI < columnRow ;columnRowI++){\n\t\t\t\t//行列Aの入力\n\t\t\t\tmatrixA[rowI][columnRowI] = scan.nextInt();\n\t\t\t}\n\t\t}",
"for(int columnRowI =0 ;columnRowI < columnRow ;columnRowI++){\n\t\t\t\t//行列Aの入力\n\t\t\t\tmatrixA[rowI][columnRowI] = scan.nextInt();\n\t\t\t}",
"int columnRowI =0 ;",
"int columnRowI =0 ;",
"columnRowI",
"0",
"columnRowI < columnRow",
"columnRowI",
"columnRow",
"columnRowI++",
"columnRowI++",
"columnRowI",
"{\n\t\t\t\t//行列Aの入力\n\t\t\t\tmatrixA[rowI][columnRowI] = scan.nextInt();\n\t\t\t}",
"{\n\t\t\t\t//行列Aの入力\n\t\t\t\tmatrixA[rowI][columnRowI] = scan.nextInt();\n\t\t\t}",
"matrixA[rowI][columnRowI] = scan.nextInt()",
"matrixA[rowI][columnRowI]",
"matrixA[rowI]",
"matrixA",
"rowI",
"columnRowI",
"scan.nextInt()",
"scan.nextInt",
"scan",
"for(int columnRowI = 0 ;columnRowI < columnRow;columnRowI++){\n\t\t\tfor(int columnI =0 ;columnI < column ;columnI++){\n\t\t\t\t//行列Bの入力\n\t\t\t\tmatrixB[columnRowI][columnI] = scan.nextInt();\n\t\t\t}\n\t\t}",
"int columnRowI = 0 ;",
"int columnRowI = 0 ;",
"columnRowI",
"0",
"columnRowI < columnRow",
"columnRowI",
"columnRow",
"columnRowI++",
"columnRowI++",
"columnRowI",
"{\n\t\t\tfor(int columnI =0 ;columnI < column ;columnI++){\n\t\t\t\t//行列Bの入力\n\t\t\t\tmatrixB[columnRowI][columnI] = scan.nextInt();\n\t\t\t}\n\t\t}",
"{\n\t\t\tfor(int columnI =0 ;columnI < column ;columnI++){\n\t\t\t\t//行列Bの入力\n\t\t\t\tmatrixB[columnRowI][columnI] = scan.nextInt();\n\t\t\t}\n\t\t}",
"for(int columnI =0 ;columnI < column ;columnI++){\n\t\t\t\t//行列Bの入力\n\t\t\t\tmatrixB[columnRowI][columnI] = scan.nextInt();\n\t\t\t}",
"int columnI =0 ;",
"int columnI =0 ;",
"columnI",
"0",
"columnI < column",
"columnI",
"column",
"columnI++",
"columnI++",
"columnI",
"{\n\t\t\t\t//行列Bの入力\n\t\t\t\tmatrixB[columnRowI][columnI] = scan.nextInt();\n\t\t\t}",
"{\n\t\t\t\t//行列Bの入力\n\t\t\t\tmatrixB[columnRowI][columnI] = scan.nextInt();\n\t\t\t}",
"matrixB[columnRowI][columnI] = scan.nextInt()",
"matrixB[columnRowI][columnI]",
"matrixB[columnRowI]",
"matrixB",
"columnRowI",
"columnI",
"scan.nextInt()",
"scan.nextInt",
"scan",
"for(int rowI = 0 ;rowI < row;rowI++){\n\t\t\tfor(int columnRowI =0 ;columnRowI < column ;columnRowI++){\n\t\t\t\tfor(int columnI =0 ;columnI < columnRow ;columnI++){\n\n\t\t\t\t\t//行列Cの入力\n\t\t\t\t\tmatrixC[rowI][columnRowI]\n\t\t\t\t\t\t\t+= matrixA[rowI][columnI] * matrixB[columnI][columnRowI];\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"int rowI = 0 ;",
"int rowI = 0 ;",
"rowI",
"0",
"rowI < row",
"rowI",
"row",
"rowI++",
"rowI++",
"rowI",
"{\n\t\t\tfor(int columnRowI =0 ;columnRowI < column ;columnRowI++){\n\t\t\t\tfor(int columnI =0 ;columnI < columnRow ;columnI++){\n\n\t\t\t\t\t//行列Cの入力\n\t\t\t\t\tmatrixC[rowI][columnRowI]\n\t\t\t\t\t\t\t+= matrixA[rowI][columnI] * matrixB[columnI][columnRowI];\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"{\n\t\t\tfor(int columnRowI =0 ;columnRowI < column ;columnRowI++){\n\t\t\t\tfor(int columnI =0 ;columnI < columnRow ;columnI++){\n\n\t\t\t\t\t//行列Cの入力\n\t\t\t\t\tmatrixC[rowI][columnRowI]\n\t\t\t\t\t\t\t+= matrixA[rowI][columnI] * matrixB[columnI][columnRowI];\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"for(int columnRowI =0 ;columnRowI < column ;columnRowI++){\n\t\t\t\tfor(int columnI =0 ;columnI < columnRow ;columnI++){\n\n\t\t\t\t\t//行列Cの入力\n\t\t\t\t\tmatrixC[rowI][columnRowI]\n\t\t\t\t\t\t\t+= matrixA[rowI][columnI] * matrixB[columnI][columnRowI];\n\t\t\t\t}\n\t\t\t}",
"int columnRowI =0 ;",
"int columnRowI =0 ;",
"columnRowI",
"0",
"columnRowI < column",
"columnRowI",
"column",
"columnRowI++",
"columnRowI++",
"columnRowI",
"{\n\t\t\t\tfor(int columnI =0 ;columnI < columnRow ;columnI++){\n\n\t\t\t\t\t//行列Cの入力\n\t\t\t\t\tmatrixC[rowI][columnRowI]\n\t\t\t\t\t\t\t+= matrixA[rowI][columnI] * matrixB[columnI][columnRowI];\n\t\t\t\t}\n\t\t\t}",
"{\n\t\t\t\tfor(int columnI =0 ;columnI < columnRow ;columnI++){\n\n\t\t\t\t\t//行列Cの入力\n\t\t\t\t\tmatrixC[rowI][columnRowI]\n\t\t\t\t\t\t\t+= matrixA[rowI][columnI] * matrixB[columnI][columnRowI];\n\t\t\t\t}\n\t\t\t}",
"for(int columnI =0 ;columnI < columnRow ;columnI++){\n\n\t\t\t\t\t//行列Cの入力\n\t\t\t\t\tmatrixC[rowI][columnRowI]\n\t\t\t\t\t\t\t+= matrixA[rowI][columnI] * matrixB[columnI][columnRowI];\n\t\t\t\t}",
"int columnI =0 ;",
"int columnI =0 ;",
"columnI",
"0",
"columnI < columnRow",
"columnI",
"columnRow",
"columnI++",
"columnI++",
"columnI",
"{\n\n\t\t\t\t\t//行列Cの入力\n\t\t\t\t\tmatrixC[rowI][columnRowI]\n\t\t\t\t\t\t\t+= matrixA[rowI][columnI] * matrixB[columnI][columnRowI];\n\t\t\t\t}",
"{\n\n\t\t\t\t\t//行列Cの入力\n\t\t\t\t\tmatrixC[rowI][columnRowI]\n\t\t\t\t\t\t\t+= matrixA[rowI][columnI] * matrixB[columnI][columnRowI];\n\t\t\t\t}",
"matrixC[rowI][columnRowI]\n\t\t\t\t\t\t\t+= matrixA[rowI][columnI] * matrixB[columnI][columnRowI]",
"matrixC[rowI][columnRowI]",
"matrixC[rowI]",
"matrixC",
"rowI",
"columnRowI",
"matrixA[rowI][columnI] * matrixB[columnI][columnRowI]",
"matrixA[rowI][columnI]",
"matrixA[rowI]",
"matrixA",
"rowI",
"columnI",
"matrixB[columnI][columnRowI]",
"matrixB[columnI]",
"matrixB",
"columnI",
"columnRowI",
"for(int rowI = 0 ;rowI < row;rowI++){\n\t\t\tfor(int columnI = 0 ;columnI < column ;columnI++){\n\t\t\t\tif(columnI+ 1 == column){\n\t\t\t\t\tSystem.out.println(matrixC[rowI][columnI]);\n\t\t\t\t}else if(columnI < column){\n\t\t\t\t\tSystem.out.print(matrixC[rowI][columnI] + \" \");\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"int rowI = 0 ;",
"int rowI = 0 ;",
"rowI",
"0",
"rowI < row",
"rowI",
"row",
"rowI++",
"rowI++",
"rowI",
"{\n\t\t\tfor(int columnI = 0 ;columnI < column ;columnI++){\n\t\t\t\tif(columnI+ 1 == column){\n\t\t\t\t\tSystem.out.println(matrixC[rowI][columnI]);\n\t\t\t\t}else if(columnI < column){\n\t\t\t\t\tSystem.out.print(matrixC[rowI][columnI] + \" \");\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"{\n\t\t\tfor(int columnI = 0 ;columnI < column ;columnI++){\n\t\t\t\tif(columnI+ 1 == column){\n\t\t\t\t\tSystem.out.println(matrixC[rowI][columnI]);\n\t\t\t\t}else if(columnI < column){\n\t\t\t\t\tSystem.out.print(matrixC[rowI][columnI] + \" \");\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"for(int columnI = 0 ;columnI < column ;columnI++){\n\t\t\t\tif(columnI+ 1 == column){\n\t\t\t\t\tSystem.out.println(matrixC[rowI][columnI]);\n\t\t\t\t}else if(columnI < column){\n\t\t\t\t\tSystem.out.print(matrixC[rowI][columnI] + \" \");\n\t\t\t\t}\n\t\t\t}",
"int columnI = 0 ;",
"int columnI = 0 ;",
"columnI",
"0",
"columnI < column",
"columnI",
"column",
"columnI++",
"columnI++",
"columnI",
"{\n\t\t\t\tif(columnI+ 1 == column){\n\t\t\t\t\tSystem.out.println(matrixC[rowI][columnI]);\n\t\t\t\t}else if(columnI < column){\n\t\t\t\t\tSystem.out.print(matrixC[rowI][columnI] + \" \");\n\t\t\t\t}\n\t\t\t}",
"{\n\t\t\t\tif(columnI+ 1 == column){\n\t\t\t\t\tSystem.out.println(matrixC[rowI][columnI]);\n\t\t\t\t}else if(columnI < column){\n\t\t\t\t\tSystem.out.print(matrixC[rowI][columnI] + \" \");\n\t\t\t\t}\n\t\t\t}",
"if(columnI+ 1 == column){\n\t\t\t\t\tSystem.out.println(matrixC[rowI][columnI]);\n\t\t\t\t}else if(columnI < column){\n\t\t\t\t\tSystem.out.print(matrixC[rowI][columnI] + \" \");\n\t\t\t\t}",
"columnI+ 1 == column",
"columnI+ 1",
"columnI",
"1",
"column",
"{\n\t\t\t\t\tSystem.out.println(matrixC[rowI][columnI]);\n\t\t\t\t}",
"System.out.println(matrixC[rowI][columnI])",
"System.out.println",
"System.out",
"System",
"System.out",
"matrixC[rowI][columnI]",
"matrixC[rowI]",
"matrixC",
"rowI",
"columnI",
"if(columnI < column){\n\t\t\t\t\tSystem.out.print(matrixC[rowI][columnI] + \" \");\n\t\t\t\t}",
"columnI < column",
"columnI",
"column",
"{\n\t\t\t\t\tSystem.out.print(matrixC[rowI][columnI] + \" \");\n\t\t\t\t}",
"System.out.print(matrixC[rowI][columnI] + \" \")",
"System.out.print",
"System.out",
"System",
"System.out",
"matrixC[rowI][columnI] + \" \"",
"matrixC[rowI][columnI]",
"matrixC[rowI]",
"matrixC",
"rowI",
"columnI",
"\" \"",
"scan.close()",
"scan.close",
"scan",
"String[] args",
"args",
"public class Main{\n\tpublic static void main(String[] args){\n\n\t\tScanner scan = new Scanner(System.in);\n\n\t\t//二つの行列の行と列を宣言\n\t\tint row = scan.nextInt();\n\t\tint columnRow = scan.nextInt();\n\t\tint column = scan.nextInt();\n\n\t\t//二つの行列(二次元配列)を宣言\n\t\tint[][] matrixA = new int[row][columnRow];\n\t\tint[][] matrixB = new int[columnRow][column];\n\t\tlong[][] matrixC = new long[row][column];\n\n\t\t//行列Aのためのループ\n\t\tfor(int rowI = 0 ;rowI < row;rowI++){\n\t\t\tfor(int columnRowI =0 ;columnRowI < columnRow ;columnRowI++){\n\t\t\t\t//行列Aの入力\n\t\t\t\tmatrixA[rowI][columnRowI] = scan.nextInt();\n\t\t\t}\n\t\t}\n\n\t\t//行列Bのためのループ\n\t\tfor(int columnRowI = 0 ;columnRowI < columnRow;columnRowI++){\n\t\t\tfor(int columnI =0 ;columnI < column ;columnI++){\n\t\t\t\t//行列Bの入力\n\t\t\t\tmatrixB[columnRowI][columnI] = scan.nextInt();\n\t\t\t}\n\t\t}\n\n\t\t//行列Cの計算のためのループ\n\t\tfor(int rowI = 0 ;rowI < row;rowI++){\n\t\t\tfor(int columnRowI =0 ;columnRowI < column ;columnRowI++){\n\t\t\t\tfor(int columnI =0 ;columnI < columnRow ;columnI++){\n\n\t\t\t\t\t//行列Cの入力\n\t\t\t\t\tmatrixC[rowI][columnRowI]\n\t\t\t\t\t\t\t+= matrixA[rowI][columnI] * matrixB[columnI][columnRowI];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tfor(int rowI = 0 ;rowI < row;rowI++){\n\t\t\tfor(int columnI = 0 ;columnI < column ;columnI++){\n\t\t\t\tif(columnI+ 1 == column){\n\t\t\t\t\tSystem.out.println(matrixC[rowI][columnI]);\n\t\t\t\t}else if(columnI < column){\n\t\t\t\t\tSystem.out.print(matrixC[rowI][columnI] + \" \");\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tscan.close();\n\t}\n}",
"public class Main{\n\tpublic static void main(String[] args){\n\n\t\tScanner scan = new Scanner(System.in);\n\n\t\t//二つの行列の行と列を宣言\n\t\tint row = scan.nextInt();\n\t\tint columnRow = scan.nextInt();\n\t\tint column = scan.nextInt();\n\n\t\t//二つの行列(二次元配列)を宣言\n\t\tint[][] matrixA = new int[row][columnRow];\n\t\tint[][] matrixB = new int[columnRow][column];\n\t\tlong[][] matrixC = new long[row][column];\n\n\t\t//行列Aのためのループ\n\t\tfor(int rowI = 0 ;rowI < row;rowI++){\n\t\t\tfor(int columnRowI =0 ;columnRowI < columnRow ;columnRowI++){\n\t\t\t\t//行列Aの入力\n\t\t\t\tmatrixA[rowI][columnRowI] = scan.nextInt();\n\t\t\t}\n\t\t}\n\n\t\t//行列Bのためのループ\n\t\tfor(int columnRowI = 0 ;columnRowI < columnRow;columnRowI++){\n\t\t\tfor(int columnI =0 ;columnI < column ;columnI++){\n\t\t\t\t//行列Bの入力\n\t\t\t\tmatrixB[columnRowI][columnI] = scan.nextInt();\n\t\t\t}\n\t\t}\n\n\t\t//行列Cの計算のためのループ\n\t\tfor(int rowI = 0 ;rowI < row;rowI++){\n\t\t\tfor(int columnRowI =0 ;columnRowI < column ;columnRowI++){\n\t\t\t\tfor(int columnI =0 ;columnI < columnRow ;columnI++){\n\n\t\t\t\t\t//行列Cの入力\n\t\t\t\t\tmatrixC[rowI][columnRowI]\n\t\t\t\t\t\t\t+= matrixA[rowI][columnI] * matrixB[columnI][columnRowI];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tfor(int rowI = 0 ;rowI < row;rowI++){\n\t\t\tfor(int columnI = 0 ;columnI < column ;columnI++){\n\t\t\t\tif(columnI+ 1 == column){\n\t\t\t\t\tSystem.out.println(matrixC[rowI][columnI]);\n\t\t\t\t}else if(columnI < column){\n\t\t\t\t\tSystem.out.print(matrixC[rowI][columnI] + \" \");\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tscan.close();\n\t}\n}",
"Main"
] | import java.util.Scanner;
public class Main{
public static void main(String[] args){
Scanner scan = new Scanner(System.in);
//二つの行列の行と列を宣言
int row = scan.nextInt();
int columnRow = scan.nextInt();
int column = scan.nextInt();
//二つの行列(二次元配列)を宣言
int[][] matrixA = new int[row][columnRow];
int[][] matrixB = new int[columnRow][column];
long[][] matrixC = new long[row][column];
//行列Aのためのループ
for(int rowI = 0 ;rowI < row;rowI++){
for(int columnRowI =0 ;columnRowI < columnRow ;columnRowI++){
//行列Aの入力
matrixA[rowI][columnRowI] = scan.nextInt();
}
}
//行列Bのためのループ
for(int columnRowI = 0 ;columnRowI < columnRow;columnRowI++){
for(int columnI =0 ;columnI < column ;columnI++){
//行列Bの入力
matrixB[columnRowI][columnI] = scan.nextInt();
}
}
//行列Cの計算のためのループ
for(int rowI = 0 ;rowI < row;rowI++){
for(int columnRowI =0 ;columnRowI < column ;columnRowI++){
for(int columnI =0 ;columnI < columnRow ;columnI++){
//行列Cの入力
matrixC[rowI][columnRowI]
+= matrixA[rowI][columnI] * matrixB[columnI][columnRowI];
}
}
}
for(int rowI = 0 ;rowI < row;rowI++){
for(int columnI = 0 ;columnI < column ;columnI++){
if(columnI+ 1 == column){
System.out.println(matrixC[rowI][columnI]);
}else if(columnI < column){
System.out.print(matrixC[rowI][columnI] + " ");
}
}
}
scan.close();
}
}
|
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
41,
13,
20,
13,
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,
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,
0,
18,
18,
13,
13,
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,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
18,
18,
13,
13,
13,
2,
18,
18,
13,
13,
13,
18,
18,
13,
13,
13,
14,
2,
13,
2,
13,
17,
30,
4,
18,
18,
13,
13,
18,
18,
13,
13,
13,
30,
4,
18,
18,
13,
13,
2,
18,
18,
13,
13,
13,
17,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
201,
5
],
[
201,
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
],
[
19,
20
],
[
20,
21
],
[
8,
22
],
[
22,
23
],
[
22,
24
],
[
24,
25
],
[
25,
26
],
[
8,
27
],
[
27,
28
],
[
27,
29
],
[
8,
32
],
[
32,
33
],
[
32,
34
],
[
8,
37
],
[
37,
38
],
[
38,
39
],
[
39,
40
],
[
39,
41
],
[
37,
42
],
[
42,
43
],
[
42,
44
],
[
37,
45
],
[
45,
46
],
[
46,
47
],
[
37,
48
],
[
49,
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
],
[
62,
62
],
[
62,
63
],
[
63,
64
],
[
64,
65
],
[
65,
66
],
[
65,
67
],
[
64,
68
],
[
63,
69
],
[
69,
70
],
[
70,
71
],
[
8,
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
],
[
85,
93
],
[
93,
94
],
[
94,
95
],
[
85,
96
],
[
97,
97
],
[
97,
98
],
[
98,
99
],
[
99,
100
],
[
100,
101
],
[
100,
102
],
[
99,
103
],
[
98,
104
],
[
104,
105
],
[
105,
106
],
[
8,
107
],
[
107,
108
],
[
107,
109
],
[
8,
112
],
[
112,
113
],
[
113,
114
],
[
114,
115
],
[
114,
116
],
[
112,
117
],
[
117,
118
],
[
117,
119
],
[
112,
120
],
[
120,
121
],
[
121,
122
],
[
112,
123
],
[
124,
124
],
[
124,
125
],
[
125,
126
],
[
126,
127
],
[
127,
128
],
[
127,
129
],
[
125,
130
],
[
130,
131
],
[
130,
132
],
[
125,
133
],
[
133,
134
],
[
134,
135
],
[
125,
136
],
[
137,
137
],
[
137,
138
],
[
138,
139
],
[
139,
140
],
[
140,
141
],
[
140,
142
],
[
138,
143
],
[
143,
144
],
[
143,
145
],
[
138,
146
],
[
146,
147
],
[
147,
148
],
[
138,
149
],
[
150,
150
],
[
150,
151
],
[
151,
152
],
[
152,
153
],
[
153,
154
],
[
153,
155
],
[
152,
156
],
[
151,
157
],
[
157,
158
],
[
158,
159
],
[
159,
160
],
[
159,
161
],
[
158,
162
],
[
157,
163
],
[
163,
164
],
[
164,
165
],
[
164,
166
],
[
163,
167
],
[
137,
168
],
[
168,
169
],
[
169,
170
],
[
169,
171
],
[
171,
172
],
[
171,
173
],
[
168,
174
],
[
174,
175
],
[
175,
176
],
[
176,
177
],
[
177,
178
],
[
177,
179
],
[
175,
180
],
[
180,
181
],
[
181,
182
],
[
181,
183
],
[
180,
184
],
[
168,
185
],
[
185,
186
],
[
186,
187
],
[
187,
188
],
[
188,
189
],
[
188,
190
],
[
186,
191
],
[
191,
192
],
[
192,
193
],
[
193,
194
],
[
193,
195
],
[
192,
196
],
[
191,
197
],
[
6,
198
],
[
198,
199
],
[
0,
200
],
[
200,
201
],
[
200,
202
]
] | [
"import java.util.Scanner;\n\npublic class Main {\n\tpublic static void main(String[] args) {\n\n\t\tScanner sc = new Scanner(System.in);\n\t\tint num1 = sc.nextInt();\n\t\tint num2 = sc.nextInt();\n\t\tint num3 = sc.nextInt();\n\t\tint[][] table = new int[num1][num2];\n\t\tint[][] grid = new int[num2][num3];\n\n\t\tfor (int i1 = 0; i1 < num1; i1++) {\n\t\t\tfor (int i2 = 0; i2 < num2; i2++) {\n\t\t\t\ttable[i1][i2] = sc.nextInt();\n\t\t\t}\n\t\t}\n\n\t\tfor (int i1 = 0; i1 < num2; i1++) {\n\t\t\tfor (int i2 = 0; i2 < num3; i2++) {\n\t\t\t\tgrid[i1][i2] = sc.nextInt();\n\t\t\t}\n\t\t}\n\n\t\tlong [][] sum = new long[num1][num3];\n\t\tfor (int i3 = 0; i3 < num1; i3++) {\n\t\t\tfor (int i1 = 0; i1 < num3; i1++) {\n\t\t\t\tfor (int i2 = 0; i2 < num2; i2++) {\n\t\t\t\t\tsum[i3][i1] += table[i3][i2] * grid[i2][i1];\n\t\t\t\t}\n\n\t\t\t\tif (i1 >= num3-1) {\n\t\t\t\t\tSystem.out.println(sum[i3][i1]);\n\t\t\t\t} else {\n\t\t\t\t\tSystem.out.print(sum[i3][i1] + \" \");\n\t\t\t\t}\n\t\t\t}\n\t\t}\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\t\tint num1 = sc.nextInt();\n\t\tint num2 = sc.nextInt();\n\t\tint num3 = sc.nextInt();\n\t\tint[][] table = new int[num1][num2];\n\t\tint[][] grid = new int[num2][num3];\n\n\t\tfor (int i1 = 0; i1 < num1; i1++) {\n\t\t\tfor (int i2 = 0; i2 < num2; i2++) {\n\t\t\t\ttable[i1][i2] = sc.nextInt();\n\t\t\t}\n\t\t}\n\n\t\tfor (int i1 = 0; i1 < num2; i1++) {\n\t\t\tfor (int i2 = 0; i2 < num3; i2++) {\n\t\t\t\tgrid[i1][i2] = sc.nextInt();\n\t\t\t}\n\t\t}\n\n\t\tlong [][] sum = new long[num1][num3];\n\t\tfor (int i3 = 0; i3 < num1; i3++) {\n\t\t\tfor (int i1 = 0; i1 < num3; i1++) {\n\t\t\t\tfor (int i2 = 0; i2 < num2; i2++) {\n\t\t\t\t\tsum[i3][i1] += table[i3][i2] * grid[i2][i1];\n\t\t\t\t}\n\n\t\t\t\tif (i1 >= num3-1) {\n\t\t\t\t\tSystem.out.println(sum[i3][i1]);\n\t\t\t\t} else {\n\t\t\t\t\tSystem.out.print(sum[i3][i1] + \" \");\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}",
"Main",
"public static void main(String[] args) {\n\n\t\tScanner sc = new Scanner(System.in);\n\t\tint num1 = sc.nextInt();\n\t\tint num2 = sc.nextInt();\n\t\tint num3 = sc.nextInt();\n\t\tint[][] table = new int[num1][num2];\n\t\tint[][] grid = new int[num2][num3];\n\n\t\tfor (int i1 = 0; i1 < num1; i1++) {\n\t\t\tfor (int i2 = 0; i2 < num2; i2++) {\n\t\t\t\ttable[i1][i2] = sc.nextInt();\n\t\t\t}\n\t\t}\n\n\t\tfor (int i1 = 0; i1 < num2; i1++) {\n\t\t\tfor (int i2 = 0; i2 < num3; i2++) {\n\t\t\t\tgrid[i1][i2] = sc.nextInt();\n\t\t\t}\n\t\t}\n\n\t\tlong [][] sum = new long[num1][num3];\n\t\tfor (int i3 = 0; i3 < num1; i3++) {\n\t\t\tfor (int i1 = 0; i1 < num3; i1++) {\n\t\t\t\tfor (int i2 = 0; i2 < num2; i2++) {\n\t\t\t\t\tsum[i3][i1] += table[i3][i2] * grid[i2][i1];\n\t\t\t\t}\n\n\t\t\t\tif (i1 >= num3-1) {\n\t\t\t\t\tSystem.out.println(sum[i3][i1]);\n\t\t\t\t} else {\n\t\t\t\t\tSystem.out.print(sum[i3][i1] + \" \");\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"main",
"{\n\n\t\tScanner sc = new Scanner(System.in);\n\t\tint num1 = sc.nextInt();\n\t\tint num2 = sc.nextInt();\n\t\tint num3 = sc.nextInt();\n\t\tint[][] table = new int[num1][num2];\n\t\tint[][] grid = new int[num2][num3];\n\n\t\tfor (int i1 = 0; i1 < num1; i1++) {\n\t\t\tfor (int i2 = 0; i2 < num2; i2++) {\n\t\t\t\ttable[i1][i2] = sc.nextInt();\n\t\t\t}\n\t\t}\n\n\t\tfor (int i1 = 0; i1 < num2; i1++) {\n\t\t\tfor (int i2 = 0; i2 < num3; i2++) {\n\t\t\t\tgrid[i1][i2] = sc.nextInt();\n\t\t\t}\n\t\t}\n\n\t\tlong [][] sum = new long[num1][num3];\n\t\tfor (int i3 = 0; i3 < num1; i3++) {\n\t\t\tfor (int i1 = 0; i1 < num3; i1++) {\n\t\t\t\tfor (int i2 = 0; i2 < num2; i2++) {\n\t\t\t\t\tsum[i3][i1] += table[i3][i2] * grid[i2][i1];\n\t\t\t\t}\n\n\t\t\t\tif (i1 >= num3-1) {\n\t\t\t\t\tSystem.out.println(sum[i3][i1]);\n\t\t\t\t} else {\n\t\t\t\t\tSystem.out.print(sum[i3][i1] + \" \");\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"int num1 = sc.nextInt();",
"num1",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int num2 = sc.nextInt();",
"num2",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int num3 = sc.nextInt();",
"num3",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int[][] table = new int[num1][num2];",
"table",
"new int[num1][num2]",
"num1",
"num2",
"int[][] grid = new int[num2][num3];",
"grid",
"new int[num2][num3]",
"num2",
"num3",
"for (int i1 = 0; i1 < num1; i1++) {\n\t\t\tfor (int i2 = 0; i2 < num2; i2++) {\n\t\t\t\ttable[i1][i2] = sc.nextInt();\n\t\t\t}\n\t\t}",
"int i1 = 0;",
"int i1 = 0;",
"i1",
"0",
"i1 < num1",
"i1",
"num1",
"i1++",
"i1++",
"i1",
"{\n\t\t\tfor (int i2 = 0; i2 < num2; i2++) {\n\t\t\t\ttable[i1][i2] = sc.nextInt();\n\t\t\t}\n\t\t}",
"{\n\t\t\tfor (int i2 = 0; i2 < num2; i2++) {\n\t\t\t\ttable[i1][i2] = sc.nextInt();\n\t\t\t}\n\t\t}",
"for (int i2 = 0; i2 < num2; i2++) {\n\t\t\t\ttable[i1][i2] = sc.nextInt();\n\t\t\t}",
"int i2 = 0;",
"int i2 = 0;",
"i2",
"0",
"i2 < num2",
"i2",
"num2",
"i2++",
"i2++",
"i2",
"{\n\t\t\t\ttable[i1][i2] = sc.nextInt();\n\t\t\t}",
"{\n\t\t\t\ttable[i1][i2] = sc.nextInt();\n\t\t\t}",
"table[i1][i2] = sc.nextInt()",
"table[i1][i2]",
"table[i1]",
"table",
"i1",
"i2",
"sc.nextInt()",
"sc.nextInt",
"sc",
"for (int i1 = 0; i1 < num2; i1++) {\n\t\t\tfor (int i2 = 0; i2 < num3; i2++) {\n\t\t\t\tgrid[i1][i2] = sc.nextInt();\n\t\t\t}\n\t\t}",
"int i1 = 0;",
"int i1 = 0;",
"i1",
"0",
"i1 < num2",
"i1",
"num2",
"i1++",
"i1++",
"i1",
"{\n\t\t\tfor (int i2 = 0; i2 < num3; i2++) {\n\t\t\t\tgrid[i1][i2] = sc.nextInt();\n\t\t\t}\n\t\t}",
"{\n\t\t\tfor (int i2 = 0; i2 < num3; i2++) {\n\t\t\t\tgrid[i1][i2] = sc.nextInt();\n\t\t\t}\n\t\t}",
"for (int i2 = 0; i2 < num3; i2++) {\n\t\t\t\tgrid[i1][i2] = sc.nextInt();\n\t\t\t}",
"int i2 = 0;",
"int i2 = 0;",
"i2",
"0",
"i2 < num3",
"i2",
"num3",
"i2++",
"i2++",
"i2",
"{\n\t\t\t\tgrid[i1][i2] = sc.nextInt();\n\t\t\t}",
"{\n\t\t\t\tgrid[i1][i2] = sc.nextInt();\n\t\t\t}",
"grid[i1][i2] = sc.nextInt()",
"grid[i1][i2]",
"grid[i1]",
"grid",
"i1",
"i2",
"sc.nextInt()",
"sc.nextInt",
"sc",
"long [][] sum = new long[num1][num3];",
"sum",
"new long[num1][num3]",
"num1",
"num3",
"for (int i3 = 0; i3 < num1; i3++) {\n\t\t\tfor (int i1 = 0; i1 < num3; i1++) {\n\t\t\t\tfor (int i2 = 0; i2 < num2; i2++) {\n\t\t\t\t\tsum[i3][i1] += table[i3][i2] * grid[i2][i1];\n\t\t\t\t}\n\n\t\t\t\tif (i1 >= num3-1) {\n\t\t\t\t\tSystem.out.println(sum[i3][i1]);\n\t\t\t\t} else {\n\t\t\t\t\tSystem.out.print(sum[i3][i1] + \" \");\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"int i3 = 0;",
"int i3 = 0;",
"i3",
"0",
"i3 < num1",
"i3",
"num1",
"i3++",
"i3++",
"i3",
"{\n\t\t\tfor (int i1 = 0; i1 < num3; i1++) {\n\t\t\t\tfor (int i2 = 0; i2 < num2; i2++) {\n\t\t\t\t\tsum[i3][i1] += table[i3][i2] * grid[i2][i1];\n\t\t\t\t}\n\n\t\t\t\tif (i1 >= num3-1) {\n\t\t\t\t\tSystem.out.println(sum[i3][i1]);\n\t\t\t\t} else {\n\t\t\t\t\tSystem.out.print(sum[i3][i1] + \" \");\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"{\n\t\t\tfor (int i1 = 0; i1 < num3; i1++) {\n\t\t\t\tfor (int i2 = 0; i2 < num2; i2++) {\n\t\t\t\t\tsum[i3][i1] += table[i3][i2] * grid[i2][i1];\n\t\t\t\t}\n\n\t\t\t\tif (i1 >= num3-1) {\n\t\t\t\t\tSystem.out.println(sum[i3][i1]);\n\t\t\t\t} else {\n\t\t\t\t\tSystem.out.print(sum[i3][i1] + \" \");\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"for (int i1 = 0; i1 < num3; i1++) {\n\t\t\t\tfor (int i2 = 0; i2 < num2; i2++) {\n\t\t\t\t\tsum[i3][i1] += table[i3][i2] * grid[i2][i1];\n\t\t\t\t}\n\n\t\t\t\tif (i1 >= num3-1) {\n\t\t\t\t\tSystem.out.println(sum[i3][i1]);\n\t\t\t\t} else {\n\t\t\t\t\tSystem.out.print(sum[i3][i1] + \" \");\n\t\t\t\t}\n\t\t\t}",
"int i1 = 0;",
"int i1 = 0;",
"i1",
"0",
"i1 < num3",
"i1",
"num3",
"i1++",
"i1++",
"i1",
"{\n\t\t\t\tfor (int i2 = 0; i2 < num2; i2++) {\n\t\t\t\t\tsum[i3][i1] += table[i3][i2] * grid[i2][i1];\n\t\t\t\t}\n\n\t\t\t\tif (i1 >= num3-1) {\n\t\t\t\t\tSystem.out.println(sum[i3][i1]);\n\t\t\t\t} else {\n\t\t\t\t\tSystem.out.print(sum[i3][i1] + \" \");\n\t\t\t\t}\n\t\t\t}",
"{\n\t\t\t\tfor (int i2 = 0; i2 < num2; i2++) {\n\t\t\t\t\tsum[i3][i1] += table[i3][i2] * grid[i2][i1];\n\t\t\t\t}\n\n\t\t\t\tif (i1 >= num3-1) {\n\t\t\t\t\tSystem.out.println(sum[i3][i1]);\n\t\t\t\t} else {\n\t\t\t\t\tSystem.out.print(sum[i3][i1] + \" \");\n\t\t\t\t}\n\t\t\t}",
"for (int i2 = 0; i2 < num2; i2++) {\n\t\t\t\t\tsum[i3][i1] += table[i3][i2] * grid[i2][i1];\n\t\t\t\t}",
"int i2 = 0;",
"int i2 = 0;",
"i2",
"0",
"i2 < num2",
"i2",
"num2",
"i2++",
"i2++",
"i2",
"{\n\t\t\t\t\tsum[i3][i1] += table[i3][i2] * grid[i2][i1];\n\t\t\t\t}",
"{\n\t\t\t\t\tsum[i3][i1] += table[i3][i2] * grid[i2][i1];\n\t\t\t\t}",
"sum[i3][i1] += table[i3][i2] * grid[i2][i1]",
"sum[i3][i1]",
"sum[i3]",
"sum",
"i3",
"i1",
"table[i3][i2] * grid[i2][i1]",
"table[i3][i2]",
"table[i3]",
"table",
"i3",
"i2",
"grid[i2][i1]",
"grid[i2]",
"grid",
"i2",
"i1",
"if (i1 >= num3-1) {\n\t\t\t\t\tSystem.out.println(sum[i3][i1]);\n\t\t\t\t} else {\n\t\t\t\t\tSystem.out.print(sum[i3][i1] + \" \");\n\t\t\t\t}",
"i1 >= num3-1",
"i1",
"num3-1",
"num3",
"1",
"{\n\t\t\t\t\tSystem.out.println(sum[i3][i1]);\n\t\t\t\t}",
"System.out.println(sum[i3][i1])",
"System.out.println",
"System.out",
"System",
"System.out",
"sum[i3][i1]",
"sum[i3]",
"sum",
"i3",
"i1",
"{\n\t\t\t\t\tSystem.out.print(sum[i3][i1] + \" \");\n\t\t\t\t}",
"System.out.print(sum[i3][i1] + \" \")",
"System.out.print",
"System.out",
"System",
"System.out",
"sum[i3][i1] + \" \"",
"sum[i3][i1]",
"sum[i3]",
"sum",
"i3",
"i1",
"\" \"",
"String[] args",
"args",
"public class Main {\n\tpublic static void main(String[] args) {\n\n\t\tScanner sc = new Scanner(System.in);\n\t\tint num1 = sc.nextInt();\n\t\tint num2 = sc.nextInt();\n\t\tint num3 = sc.nextInt();\n\t\tint[][] table = new int[num1][num2];\n\t\tint[][] grid = new int[num2][num3];\n\n\t\tfor (int i1 = 0; i1 < num1; i1++) {\n\t\t\tfor (int i2 = 0; i2 < num2; i2++) {\n\t\t\t\ttable[i1][i2] = sc.nextInt();\n\t\t\t}\n\t\t}\n\n\t\tfor (int i1 = 0; i1 < num2; i1++) {\n\t\t\tfor (int i2 = 0; i2 < num3; i2++) {\n\t\t\t\tgrid[i1][i2] = sc.nextInt();\n\t\t\t}\n\t\t}\n\n\t\tlong [][] sum = new long[num1][num3];\n\t\tfor (int i3 = 0; i3 < num1; i3++) {\n\t\t\tfor (int i1 = 0; i1 < num3; i1++) {\n\t\t\t\tfor (int i2 = 0; i2 < num2; i2++) {\n\t\t\t\t\tsum[i3][i1] += table[i3][i2] * grid[i2][i1];\n\t\t\t\t}\n\n\t\t\t\tif (i1 >= num3-1) {\n\t\t\t\t\tSystem.out.println(sum[i3][i1]);\n\t\t\t\t} else {\n\t\t\t\t\tSystem.out.print(sum[i3][i1] + \" \");\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}",
"public class Main {\n\tpublic static void main(String[] args) {\n\n\t\tScanner sc = new Scanner(System.in);\n\t\tint num1 = sc.nextInt();\n\t\tint num2 = sc.nextInt();\n\t\tint num3 = sc.nextInt();\n\t\tint[][] table = new int[num1][num2];\n\t\tint[][] grid = new int[num2][num3];\n\n\t\tfor (int i1 = 0; i1 < num1; i1++) {\n\t\t\tfor (int i2 = 0; i2 < num2; i2++) {\n\t\t\t\ttable[i1][i2] = sc.nextInt();\n\t\t\t}\n\t\t}\n\n\t\tfor (int i1 = 0; i1 < num2; i1++) {\n\t\t\tfor (int i2 = 0; i2 < num3; i2++) {\n\t\t\t\tgrid[i1][i2] = sc.nextInt();\n\t\t\t}\n\t\t}\n\n\t\tlong [][] sum = new long[num1][num3];\n\t\tfor (int i3 = 0; i3 < num1; i3++) {\n\t\t\tfor (int i1 = 0; i1 < num3; i1++) {\n\t\t\t\tfor (int i2 = 0; i2 < num2; i2++) {\n\t\t\t\t\tsum[i3][i1] += table[i3][i2] * grid[i2][i1];\n\t\t\t\t}\n\n\t\t\t\tif (i1 >= num3-1) {\n\t\t\t\t\tSystem.out.println(sum[i3][i1]);\n\t\t\t\t} else {\n\t\t\t\t\tSystem.out.print(sum[i3][i1] + \" \");\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}",
"Main"
] | import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int num1 = sc.nextInt();
int num2 = sc.nextInt();
int num3 = sc.nextInt();
int[][] table = new int[num1][num2];
int[][] grid = new int[num2][num3];
for (int i1 = 0; i1 < num1; i1++) {
for (int i2 = 0; i2 < num2; i2++) {
table[i1][i2] = sc.nextInt();
}
}
for (int i1 = 0; i1 < num2; i1++) {
for (int i2 = 0; i2 < num3; i2++) {
grid[i1][i2] = sc.nextInt();
}
}
long [][] sum = new long[num1][num3];
for (int i3 = 0; i3 < num1; i3++) {
for (int i1 = 0; i1 < num3; i1++) {
for (int i2 = 0; i2 < num2; i2++) {
sum[i3][i1] += table[i3][i2] * grid[i2][i1];
}
if (i1 >= num3-1) {
System.out.println(sum[i3][i1]);
} else {
System.out.print(sum[i3][i1] + " ");
}
}
}
}
}
|
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
41,
13,
41,
13,
41,
13,
41,
13,
41,
13,
41,
13,
38,
5,
13,
30,
4,
18,
13,
30,
0,
13,
4,
18,
4,
18,
13,
17,
0,
13,
4,
18,
13,
18,
13,
17,
0,
13,
4,
18,
13,
18,
13,
17,
0,
13,
4,
18,
13,
18,
13,
17,
0,
13,
20,
13,
13,
0,
13,
20,
13,
13,
0,
13,
20,
13,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
4,
18,
4,
18,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
0,
18,
18,
13,
13,
13,
4,
18,
13,
18,
13,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
4,
18,
4,
18,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
0,
18,
18,
13,
13,
13,
4,
18,
13,
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,
18,
18,
13,
13,
13,
2,
18,
18,
13,
13,
13,
18,
18,
13,
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,
14,
2,
13,
17,
4,
18,
18,
13,
13,
17,
4,
18,
18,
13,
13,
17,
18,
18,
13,
13,
13,
4,
18,
18,
13,
13,
17,
23,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
10,
11
],
[
10,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
15,
17
],
[
14,
18
],
[
18,
19
],
[
14,
20
],
[
20,
21
],
[
14,
22
],
[
22,
23
],
[
14,
24
],
[
24,
25
],
[
14,
26
],
[
26,
27
],
[
14,
28
],
[
28,
29
],
[
14,
30
],
[
30,
31
],
[
14,
32
],
[
32,
33
],
[
33,
34
],
[
33,
35
],
[
35,
36
],
[
36,
37
],
[
37,
38
],
[
32,
39
],
[
39,
40
],
[
40,
41
],
[
40,
42
],
[
42,
43
],
[
43,
44
],
[
44,
45
],
[
45,
46
],
[
42,
47
],
[
39,
48
],
[
48,
49
],
[
48,
50
],
[
50,
51
],
[
51,
52
],
[
50,
53
],
[
53,
54
],
[
53,
55
],
[
39,
56
],
[
56,
57
],
[
56,
58
],
[
58,
59
],
[
59,
60
],
[
58,
61
],
[
61,
62
],
[
61,
63
],
[
39,
64
],
[
64,
65
],
[
64,
66
],
[
66,
67
],
[
67,
68
],
[
66,
69
],
[
69,
70
],
[
69,
71
],
[
39,
72
],
[
72,
73
],
[
72,
74
],
[
39,
77
],
[
77,
78
],
[
77,
79
],
[
39,
82
],
[
82,
83
],
[
82,
84
],
[
39,
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
],
[
103,
104
],
[
104,
105
],
[
105,
106
],
[
102,
107
],
[
99,
108
],
[
108,
109
],
[
109,
110
],
[
110,
111
],
[
110,
112
],
[
108,
113
],
[
113,
114
],
[
113,
115
],
[
108,
116
],
[
116,
117
],
[
117,
118
],
[
108,
119
],
[
119,
120
],
[
120,
121
],
[
121,
122
],
[
122,
123
],
[
122,
124
],
[
121,
125
],
[
120,
126
],
[
126,
127
],
[
127,
128
],
[
126,
129
],
[
129,
130
],
[
129,
131
],
[
39,
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
],
[
145,
147
],
[
147,
148
],
[
148,
149
],
[
149,
150
],
[
150,
151
],
[
147,
152
],
[
144,
153
],
[
153,
154
],
[
154,
155
],
[
155,
156
],
[
155,
157
],
[
153,
158
],
[
158,
159
],
[
158,
160
],
[
153,
161
],
[
161,
162
],
[
162,
163
],
[
153,
164
],
[
164,
165
],
[
165,
166
],
[
166,
167
],
[
167,
168
],
[
167,
169
],
[
166,
170
],
[
165,
171
],
[
171,
172
],
[
172,
173
],
[
171,
174
],
[
174,
175
],
[
174,
176
],
[
39,
177
],
[
177,
178
],
[
178,
179
],
[
179,
180
],
[
179,
181
],
[
177,
182
],
[
182,
183
],
[
182,
184
],
[
177,
185
],
[
185,
186
],
[
186,
187
],
[
177,
188
],
[
189,
189
],
[
189,
190
],
[
190,
191
],
[
191,
192
],
[
192,
193
],
[
192,
194
],
[
190,
195
],
[
195,
196
],
[
195,
197
],
[
190,
198
],
[
198,
199
],
[
199,
200
],
[
190,
201
],
[
202,
202
],
[
202,
203
],
[
203,
204
],
[
204,
205
],
[
205,
206
],
[
205,
207
],
[
203,
208
],
[
208,
209
],
[
208,
210
],
[
203,
211
],
[
211,
212
],
[
212,
213
],
[
203,
214
],
[
215,
215
],
[
215,
216
],
[
216,
217
],
[
217,
218
],
[
218,
219
],
[
218,
220
],
[
217,
221
],
[
216,
222
],
[
222,
223
],
[
223,
224
],
[
224,
225
],
[
224,
226
],
[
223,
227
],
[
222,
228
],
[
228,
229
],
[
229,
230
],
[
229,
231
],
[
228,
232
],
[
39,
233
],
[
233,
234
],
[
234,
235
],
[
235,
236
],
[
235,
237
],
[
233,
238
],
[
238,
239
],
[
238,
240
],
[
233,
241
],
[
241,
242
],
[
242,
243
],
[
233,
244
],
[
245,
245
],
[
245,
246
],
[
246,
247
],
[
247,
248
],
[
248,
249
],
[
248,
250
],
[
246,
251
],
[
251,
252
],
[
251,
253
],
[
246,
254
],
[
254,
255
],
[
255,
256
],
[
246,
257
],
[
258,
258
],
[
258,
259
],
[
259,
260
],
[
260,
261
],
[
260,
262
],
[
259,
263
],
[
263,
264
],
[
264,
265
],
[
265,
266
],
[
265,
267
],
[
263,
268
],
[
258,
269
],
[
269,
270
],
[
270,
271
],
[
271,
272
],
[
271,
273
],
[
269,
274
],
[
269,
275
],
[
275,
276
],
[
276,
277
],
[
276,
278
],
[
275,
279
],
[
245,
280
],
[
280,
281
],
[
281,
282
],
[
282,
283
],
[
282,
284
],
[
280,
285
],
[
12,
286
],
[
286,
287
]
] | [
"import java.io.BufferedReader;\nimport java.io.IOException;\nimport java.io.InputStreamReader;\n\nclass Main {\n public static void main(String[] args) {\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n String input_data[];\n int n, m, l;\n long mx1[][], mx2[][], mx3[][];\n try {\n input_data = br.readLine().split(\" \");\n n = Integer.parseInt(input_data[0]);\n m = Integer.parseInt(input_data[1]);\n l = Integer.parseInt(input_data[2]);\n\n mx1 = new long[n][m];\n mx2 = new long[m][l];\n mx3 = new long[n][l];\n\n // TODOdata input\n for (int i = 0; i < n; i++) {\n input_data = br.readLine().split(\" \");\n for (int j = 0; j < m; j++)\n mx1[i][j] = Integer.parseInt(input_data[j]);\n }\n for (int i = 0; i < m; i++) {\n input_data = br.readLine().split(\" \");\n for (int j = 0; j < l; j++)\n mx2[i][j] = Integer.parseInt(input_data[j]);\n }\n\n // calc\n for (int i = 0; i < n; i++) {\n for (int j = 0; j < l; j++) {\n for (int k = 0; k < m; k++) {\n mx3[i][j] += mx1[i][k] * mx2[k][j];\n }\n }\n }\n\n // print\n for (int i = 0; i < n; i++) {\n for (int j = 0; j < l; j++) {\n if (j != 0)\n System.out.print(\" \");\n System.out.printf(\"%d\", mx3[i][j]);\n }\n System.out.print(\"\\n\");\n }\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n}",
"import java.io.BufferedReader;",
"BufferedReader",
"java.io",
"import java.io.IOException;",
"IOException",
"java.io",
"import java.io.InputStreamReader;",
"InputStreamReader",
"java.io",
"class Main {\n public static void main(String[] args) {\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n String input_data[];\n int n, m, l;\n long mx1[][], mx2[][], mx3[][];\n try {\n input_data = br.readLine().split(\" \");\n n = Integer.parseInt(input_data[0]);\n m = Integer.parseInt(input_data[1]);\n l = Integer.parseInt(input_data[2]);\n\n mx1 = new long[n][m];\n mx2 = new long[m][l];\n mx3 = new long[n][l];\n\n // TODOdata input\n for (int i = 0; i < n; i++) {\n input_data = br.readLine().split(\" \");\n for (int j = 0; j < m; j++)\n mx1[i][j] = Integer.parseInt(input_data[j]);\n }\n for (int i = 0; i < m; i++) {\n input_data = br.readLine().split(\" \");\n for (int j = 0; j < l; j++)\n mx2[i][j] = Integer.parseInt(input_data[j]);\n }\n\n // calc\n for (int i = 0; i < n; i++) {\n for (int j = 0; j < l; j++) {\n for (int k = 0; k < m; k++) {\n mx3[i][j] += mx1[i][k] * mx2[k][j];\n }\n }\n }\n\n // print\n for (int i = 0; i < n; i++) {\n for (int j = 0; j < l; j++) {\n if (j != 0)\n System.out.print(\" \");\n System.out.printf(\"%d\", mx3[i][j]);\n }\n System.out.print(\"\\n\");\n }\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n}",
"Main",
"public static void main(String[] args) {\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n String input_data[];\n int n, m, l;\n long mx1[][], mx2[][], mx3[][];\n try {\n input_data = br.readLine().split(\" \");\n n = Integer.parseInt(input_data[0]);\n m = Integer.parseInt(input_data[1]);\n l = Integer.parseInt(input_data[2]);\n\n mx1 = new long[n][m];\n mx2 = new long[m][l];\n mx3 = new long[n][l];\n\n // TODOdata input\n for (int i = 0; i < n; i++) {\n input_data = br.readLine().split(\" \");\n for (int j = 0; j < m; j++)\n mx1[i][j] = Integer.parseInt(input_data[j]);\n }\n for (int i = 0; i < m; i++) {\n input_data = br.readLine().split(\" \");\n for (int j = 0; j < l; j++)\n mx2[i][j] = Integer.parseInt(input_data[j]);\n }\n\n // calc\n for (int i = 0; i < n; i++) {\n for (int j = 0; j < l; j++) {\n for (int k = 0; k < m; k++) {\n mx3[i][j] += mx1[i][k] * mx2[k][j];\n }\n }\n }\n\n // print\n for (int i = 0; i < n; i++) {\n for (int j = 0; j < l; j++) {\n if (j != 0)\n System.out.print(\" \");\n System.out.printf(\"%d\", mx3[i][j]);\n }\n System.out.print(\"\\n\");\n }\n } catch (IOException e) {\n e.printStackTrace();\n }\n }",
"main",
"{\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n String input_data[];\n int n, m, l;\n long mx1[][], mx2[][], mx3[][];\n try {\n input_data = br.readLine().split(\" \");\n n = Integer.parseInt(input_data[0]);\n m = Integer.parseInt(input_data[1]);\n l = Integer.parseInt(input_data[2]);\n\n mx1 = new long[n][m];\n mx2 = new long[m][l];\n mx3 = new long[n][l];\n\n // TODOdata input\n for (int i = 0; i < n; i++) {\n input_data = br.readLine().split(\" \");\n for (int j = 0; j < m; j++)\n mx1[i][j] = Integer.parseInt(input_data[j]);\n }\n for (int i = 0; i < m; i++) {\n input_data = br.readLine().split(\" \");\n for (int j = 0; j < l; j++)\n mx2[i][j] = Integer.parseInt(input_data[j]);\n }\n\n // calc\n for (int i = 0; i < n; i++) {\n for (int j = 0; j < l; j++) {\n for (int k = 0; k < m; k++) {\n mx3[i][j] += mx1[i][k] * mx2[k][j];\n }\n }\n }\n\n // print\n for (int i = 0; i < n; i++) {\n for (int j = 0; j < l; j++) {\n if (j != 0)\n System.out.print(\" \");\n System.out.printf(\"%d\", mx3[i][j]);\n }\n System.out.print(\"\\n\");\n }\n } catch (IOException e) {\n e.printStackTrace();\n }\n }",
"BufferedReader br = new BufferedReader(new InputStreamReader(System.in));",
"br",
"new BufferedReader(new InputStreamReader(System.in))",
"String input_data[];",
"input_data",
"int n",
"n",
"m",
"m",
"l;",
"l",
"long mx1[][]",
"mx1",
"mx2[][]",
"mx2",
"mx3[][];",
"mx3",
"try {\n input_data = br.readLine().split(\" \");\n n = Integer.parseInt(input_data[0]);\n m = Integer.parseInt(input_data[1]);\n l = Integer.parseInt(input_data[2]);\n\n mx1 = new long[n][m];\n mx2 = new long[m][l];\n mx3 = new long[n][l];\n\n // TODOdata input\n for (int i = 0; i < n; i++) {\n input_data = br.readLine().split(\" \");\n for (int j = 0; j < m; j++)\n mx1[i][j] = Integer.parseInt(input_data[j]);\n }\n for (int i = 0; i < m; i++) {\n input_data = br.readLine().split(\" \");\n for (int j = 0; j < l; j++)\n mx2[i][j] = Integer.parseInt(input_data[j]);\n }\n\n // calc\n for (int i = 0; i < n; i++) {\n for (int j = 0; j < l; j++) {\n for (int k = 0; k < m; k++) {\n mx3[i][j] += mx1[i][k] * mx2[k][j];\n }\n }\n }\n\n // print\n for (int i = 0; i < n; i++) {\n for (int j = 0; j < l; j++) {\n if (j != 0)\n System.out.print(\" \");\n System.out.printf(\"%d\", mx3[i][j]);\n }\n System.out.print(\"\\n\");\n }\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 input_data = br.readLine().split(\" \");\n n = Integer.parseInt(input_data[0]);\n m = Integer.parseInt(input_data[1]);\n l = Integer.parseInt(input_data[2]);\n\n mx1 = new long[n][m];\n mx2 = new long[m][l];\n mx3 = new long[n][l];\n\n // TODOdata input\n for (int i = 0; i < n; i++) {\n input_data = br.readLine().split(\" \");\n for (int j = 0; j < m; j++)\n mx1[i][j] = Integer.parseInt(input_data[j]);\n }\n for (int i = 0; i < m; i++) {\n input_data = br.readLine().split(\" \");\n for (int j = 0; j < l; j++)\n mx2[i][j] = Integer.parseInt(input_data[j]);\n }\n\n // calc\n for (int i = 0; i < n; i++) {\n for (int j = 0; j < l; j++) {\n for (int k = 0; k < m; k++) {\n mx3[i][j] += mx1[i][k] * mx2[k][j];\n }\n }\n }\n\n // print\n for (int i = 0; i < n; i++) {\n for (int j = 0; j < l; j++) {\n if (j != 0)\n System.out.print(\" \");\n System.out.printf(\"%d\", mx3[i][j]);\n }\n System.out.print(\"\\n\");\n }\n }",
"input_data = br.readLine().split(\" \")",
"input_data",
"br.readLine().split(\" \")",
"br.readLine().split",
"br.readLine()",
"br.readLine",
"br",
"\" \"",
"n = Integer.parseInt(input_data[0])",
"n",
"Integer.parseInt(input_data[0])",
"Integer.parseInt",
"Integer",
"input_data[0]",
"input_data",
"0",
"m = Integer.parseInt(input_data[1])",
"m",
"Integer.parseInt(input_data[1])",
"Integer.parseInt",
"Integer",
"input_data[1]",
"input_data",
"1",
"l = Integer.parseInt(input_data[2])",
"l",
"Integer.parseInt(input_data[2])",
"Integer.parseInt",
"Integer",
"input_data[2]",
"input_data",
"2",
"mx1 = new long[n][m]",
"mx1",
"new long[n][m]",
"n",
"m",
"mx2 = new long[m][l]",
"mx2",
"new long[m][l]",
"m",
"l",
"mx3 = new long[n][l]",
"mx3",
"new long[n][l]",
"n",
"l",
"for (int i = 0; i < n; i++) {\n input_data = br.readLine().split(\" \");\n for (int j = 0; j < m; j++)\n mx1[i][j] = Integer.parseInt(input_data[j]);\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < n",
"i",
"n",
"i++",
"i++",
"i",
"{\n input_data = br.readLine().split(\" \");\n for (int j = 0; j < m; j++)\n mx1[i][j] = Integer.parseInt(input_data[j]);\n }",
"{\n input_data = br.readLine().split(\" \");\n for (int j = 0; j < m; j++)\n mx1[i][j] = Integer.parseInt(input_data[j]);\n }",
"input_data = br.readLine().split(\" \")",
"input_data",
"br.readLine().split(\" \")",
"br.readLine().split",
"br.readLine()",
"br.readLine",
"br",
"\" \"",
"for (int j = 0; j < m; j++)\n mx1[i][j] = Integer.parseInt(input_data[j]);",
"int j = 0;",
"int j = 0;",
"j",
"0",
"j < m",
"j",
"m",
"j++",
"j++",
"j",
"mx1[i][j] = Integer.parseInt(input_data[j]);",
"mx1[i][j] = Integer.parseInt(input_data[j])",
"mx1[i][j]",
"mx1[i]",
"mx1",
"i",
"j",
"Integer.parseInt(input_data[j])",
"Integer.parseInt",
"Integer",
"input_data[j]",
"input_data",
"j",
"for (int i = 0; i < m; i++) {\n input_data = br.readLine().split(\" \");\n for (int j = 0; j < l; j++)\n mx2[i][j] = Integer.parseInt(input_data[j]);\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < m",
"i",
"m",
"i++",
"i++",
"i",
"{\n input_data = br.readLine().split(\" \");\n for (int j = 0; j < l; j++)\n mx2[i][j] = Integer.parseInt(input_data[j]);\n }",
"{\n input_data = br.readLine().split(\" \");\n for (int j = 0; j < l; j++)\n mx2[i][j] = Integer.parseInt(input_data[j]);\n }",
"input_data = br.readLine().split(\" \")",
"input_data",
"br.readLine().split(\" \")",
"br.readLine().split",
"br.readLine()",
"br.readLine",
"br",
"\" \"",
"for (int j = 0; j < l; j++)\n mx2[i][j] = Integer.parseInt(input_data[j]);",
"int j = 0;",
"int j = 0;",
"j",
"0",
"j < l",
"j",
"l",
"j++",
"j++",
"j",
"mx2[i][j] = Integer.parseInt(input_data[j]);",
"mx2[i][j] = Integer.parseInt(input_data[j])",
"mx2[i][j]",
"mx2[i]",
"mx2",
"i",
"j",
"Integer.parseInt(input_data[j])",
"Integer.parseInt",
"Integer",
"input_data[j]",
"input_data",
"j",
"for (int i = 0; i < n; i++) {\n for (int j = 0; j < l; j++) {\n for (int k = 0; k < m; k++) {\n mx3[i][j] += mx1[i][k] * mx2[k][j];\n }\n }\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < n",
"i",
"n",
"i++",
"i++",
"i",
"{\n for (int j = 0; j < l; j++) {\n for (int k = 0; k < m; k++) {\n mx3[i][j] += mx1[i][k] * mx2[k][j];\n }\n }\n }",
"{\n for (int j = 0; j < l; j++) {\n for (int k = 0; k < m; k++) {\n mx3[i][j] += mx1[i][k] * mx2[k][j];\n }\n }\n }",
"for (int j = 0; j < l; j++) {\n for (int k = 0; k < m; k++) {\n mx3[i][j] += mx1[i][k] * mx2[k][j];\n }\n }",
"int j = 0;",
"int j = 0;",
"j",
"0",
"j < l",
"j",
"l",
"j++",
"j++",
"j",
"{\n for (int k = 0; k < m; k++) {\n mx3[i][j] += mx1[i][k] * mx2[k][j];\n }\n }",
"{\n for (int k = 0; k < m; k++) {\n mx3[i][j] += mx1[i][k] * mx2[k][j];\n }\n }",
"for (int k = 0; k < m; k++) {\n mx3[i][j] += mx1[i][k] * mx2[k][j];\n }",
"int k = 0;",
"int k = 0;",
"k",
"0",
"k < m",
"k",
"m",
"k++",
"k++",
"k",
"{\n mx3[i][j] += mx1[i][k] * mx2[k][j];\n }",
"{\n mx3[i][j] += mx1[i][k] * mx2[k][j];\n }",
"mx3[i][j] += mx1[i][k] * mx2[k][j]",
"mx3[i][j]",
"mx3[i]",
"mx3",
"i",
"j",
"mx1[i][k] * mx2[k][j]",
"mx1[i][k]",
"mx1[i]",
"mx1",
"i",
"k",
"mx2[k][j]",
"mx2[k]",
"mx2",
"k",
"j",
"for (int i = 0; i < n; i++) {\n for (int j = 0; j < l; j++) {\n if (j != 0)\n System.out.print(\" \");\n System.out.printf(\"%d\", mx3[i][j]);\n }\n System.out.print(\"\\n\");\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < n",
"i",
"n",
"i++",
"i++",
"i",
"{\n for (int j = 0; j < l; j++) {\n if (j != 0)\n System.out.print(\" \");\n System.out.printf(\"%d\", mx3[i][j]);\n }\n System.out.print(\"\\n\");\n }",
"{\n for (int j = 0; j < l; j++) {\n if (j != 0)\n System.out.print(\" \");\n System.out.printf(\"%d\", mx3[i][j]);\n }\n System.out.print(\"\\n\");\n }",
"for (int j = 0; j < l; j++) {\n if (j != 0)\n System.out.print(\" \");\n System.out.printf(\"%d\", mx3[i][j]);\n }",
"int j = 0;",
"int j = 0;",
"j",
"0",
"j < l",
"j",
"l",
"j++",
"j++",
"j",
"{\n if (j != 0)\n System.out.print(\" \");\n System.out.printf(\"%d\", mx3[i][j]);\n }",
"{\n if (j != 0)\n System.out.print(\" \");\n System.out.printf(\"%d\", mx3[i][j]);\n }",
"if (j != 0)\n System.out.print(\" \");",
"j != 0",
"j",
"0",
"System.out.print(\" \")",
"System.out.print",
"System.out",
"System",
"System.out",
"\" \"",
"System.out.printf(\"%d\", mx3[i][j])",
"System.out.printf",
"System.out",
"System",
"System.out",
"\"%d\"",
"mx3[i][j]",
"mx3[i]",
"mx3",
"i",
"j",
"System.out.print(\"\\n\")",
"System.out.print",
"System.out",
"System",
"System.out",
"\"\\n\"",
"String[] args",
"args"
] | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
class Main {
public static void main(String[] args) {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
String input_data[];
int n, m, l;
long mx1[][], mx2[][], mx3[][];
try {
input_data = br.readLine().split(" ");
n = Integer.parseInt(input_data[0]);
m = Integer.parseInt(input_data[1]);
l = Integer.parseInt(input_data[2]);
mx1 = new long[n][m];
mx2 = new long[m][l];
mx3 = new long[n][l];
// TODOdata input
for (int i = 0; i < n; i++) {
input_data = br.readLine().split(" ");
for (int j = 0; j < m; j++)
mx1[i][j] = Integer.parseInt(input_data[j]);
}
for (int i = 0; i < m; i++) {
input_data = br.readLine().split(" ");
for (int j = 0; j < l; j++)
mx2[i][j] = Integer.parseInt(input_data[j]);
}
// calc
for (int i = 0; i < n; i++) {
for (int j = 0; j < l; j++) {
for (int k = 0; k < m; k++) {
mx3[i][j] += mx1[i][k] * mx2[k][j];
}
}
}
// print
for (int i = 0; i < n; i++) {
for (int j = 0; j < l; j++) {
if (j != 0)
System.out.print(" ");
System.out.printf("%d", mx3[i][j]);
}
System.out.print("\n");
}
} catch (IOException e) {
e.printStackTrace();
}
}
}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.