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,
41,
13,
41,
13,
41,
13,
41,
13,
41,
13,
20,
0,
13,
4,
18,
13,
0,
13,
4,
18,
13,
41,
13,
20,
2,
13,
17,
2,
13,
17,
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,
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,
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,
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,
2,
13,
17,
1,
40,
13,
30,
30,
11,
1,
0,
13,
17,
2,
13,
13,
1,
40,
13,
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
],
[
8,
11
],
[
11,
12
],
[
8,
13
],
[
13,
14
],
[
8,
15
],
[
15,
16
],
[
8,
17
],
[
17,
18
],
[
8,
19
],
[
19,
20
],
[
19,
21
],
[
8,
22
],
[
22,
23
],
[
22,
24
],
[
24,
25
],
[
25,
26
],
[
8,
27
],
[
27,
28
],
[
27,
29
],
[
29,
30
],
[
30,
31
],
[
8,
32
],
[
32,
33
],
[
32,
34
],
[
35,
36
],
[
35,
37
],
[
38,
39
],
[
38,
40
],
[
8,
41
],
[
41,
42
],
[
42,
43
],
[
43,
44
],
[
43,
45
],
[
41,
46
],
[
46,
47
],
[
46,
48
],
[
48,
49
],
[
48,
50
],
[
41,
51
],
[
51,
52
],
[
52,
53
],
[
41,
54
],
[
55,
55
],
[
55,
56
],
[
56,
57
],
[
57,
58
],
[
58,
59
],
[
58,
60
],
[
56,
61
],
[
61,
62
],
[
61,
63
],
[
63,
64
],
[
63,
65
],
[
56,
66
],
[
66,
67
],
[
67,
68
],
[
56,
69
],
[
69,
70
],
[
70,
71
],
[
71,
72
],
[
72,
73
],
[
72,
74
],
[
71,
75
],
[
70,
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
],
[
101,
102
],
[
102,
103
],
[
103,
104
],
[
104,
105
],
[
104,
106
],
[
103,
107
],
[
102,
108
],
[
108,
109
],
[
109,
110
],
[
8,
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
],
[
138,
142
],
[
137,
143
],
[
143,
144
],
[
144,
145
],
[
144,
146
],
[
143,
147
],
[
136,
148
],
[
148,
149
],
[
149,
150
],
[
150,
151
],
[
150,
152
],
[
149,
153
],
[
148,
154
],
[
154,
155
],
[
155,
156
],
[
155,
157
],
[
154,
158
],
[
123,
159
],
[
159,
160
],
[
160,
161
],
[
161,
162
],
[
161,
163
],
[
160,
164
],
[
159,
165
],
[
165,
166
],
[
166,
167
],
[
166,
168
],
[
165,
169
],
[
8,
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
],
[
185,
193
],
[
193,
194
],
[
194,
195
],
[
185,
196
],
[
196,
197
],
[
197,
198
],
[
198,
199
],
[
199,
200
],
[
199,
201
],
[
197,
202
],
[
202,
203
],
[
203,
204
],
[
204,
205
],
[
204,
206
],
[
203,
207
],
[
202,
208
],
[
184,
209
],
[
209,
210
],
[
210,
211
],
[
211,
212
],
[
211,
213
],
[
209,
214
],
[
214,
215
],
[
215,
216
],
[
215,
217
],
[
214,
218
],
[
6,
219
],
[
219,
220
]
] | [
"import java.util.Scanner;\nclass Main{\n\tpublic static void main(String args[]){\n\t\tint i,j,g,r,x;\n\t\tScanner sc = new Scanner(System.in);\n\t\tg=sc.nextInt();\n\t\tr=sc.nextInt();\n\t\tint[][] map= new int[g+1][r+1];\n\t\tfor(i=0;i<g+1;i++){\n\t\t\tfor(j=0;j<r+1;j++)\n\t\t\tmap[i][j]=0;\n\t\t}\n\t\tfor(i=0;i<g;i++){\n\t\t\tfor(j=0;j<r;j++)\n\t\t\t\tmap[i][j]=sc.nextInt();\n\t\t}\n\t\tfor(i=0;i<g;i++){\n\t\t\tfor(j=0;j<r;j++){\n\t\t\t\tmap[i][r]+=map[i][j];\n\t\t\t\tmap[g][j]+=map[i][j];}\n\t\t\tmap[g][r]+=map[i][r];\n\t\t}\n\t\tfor(i=0;i<g+1;i++){\n\t\t\tfor(j=0;j<r;j++)\n\t\t\t\tSystem.out.print(map[i][j]+\" \");\n\t\t\tSystem.out.println(map[i][r]);\n\t\t}\n\t}\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"class Main{\n\tpublic static void main(String args[]){\n\t\tint i,j,g,r,x;\n\t\tScanner sc = new Scanner(System.in);\n\t\tg=sc.nextInt();\n\t\tr=sc.nextInt();\n\t\tint[][] map= new int[g+1][r+1];\n\t\tfor(i=0;i<g+1;i++){\n\t\t\tfor(j=0;j<r+1;j++)\n\t\t\tmap[i][j]=0;\n\t\t}\n\t\tfor(i=0;i<g;i++){\n\t\t\tfor(j=0;j<r;j++)\n\t\t\t\tmap[i][j]=sc.nextInt();\n\t\t}\n\t\tfor(i=0;i<g;i++){\n\t\t\tfor(j=0;j<r;j++){\n\t\t\t\tmap[i][r]+=map[i][j];\n\t\t\t\tmap[g][j]+=map[i][j];}\n\t\t\tmap[g][r]+=map[i][r];\n\t\t}\n\t\tfor(i=0;i<g+1;i++){\n\t\t\tfor(j=0;j<r;j++)\n\t\t\t\tSystem.out.print(map[i][j]+\" \");\n\t\t\tSystem.out.println(map[i][r]);\n\t\t}\n\t}\n}",
"Main",
"public static void main(String args[]){\n\t\tint i,j,g,r,x;\n\t\tScanner sc = new Scanner(System.in);\n\t\tg=sc.nextInt();\n\t\tr=sc.nextInt();\n\t\tint[][] map= new int[g+1][r+1];\n\t\tfor(i=0;i<g+1;i++){\n\t\t\tfor(j=0;j<r+1;j++)\n\t\t\tmap[i][j]=0;\n\t\t}\n\t\tfor(i=0;i<g;i++){\n\t\t\tfor(j=0;j<r;j++)\n\t\t\t\tmap[i][j]=sc.nextInt();\n\t\t}\n\t\tfor(i=0;i<g;i++){\n\t\t\tfor(j=0;j<r;j++){\n\t\t\t\tmap[i][r]+=map[i][j];\n\t\t\t\tmap[g][j]+=map[i][j];}\n\t\t\tmap[g][r]+=map[i][r];\n\t\t}\n\t\tfor(i=0;i<g+1;i++){\n\t\t\tfor(j=0;j<r;j++)\n\t\t\t\tSystem.out.print(map[i][j]+\" \");\n\t\t\tSystem.out.println(map[i][r]);\n\t\t}\n\t}",
"main",
"{\n\t\tint i,j,g,r,x;\n\t\tScanner sc = new Scanner(System.in);\n\t\tg=sc.nextInt();\n\t\tr=sc.nextInt();\n\t\tint[][] map= new int[g+1][r+1];\n\t\tfor(i=0;i<g+1;i++){\n\t\t\tfor(j=0;j<r+1;j++)\n\t\t\tmap[i][j]=0;\n\t\t}\n\t\tfor(i=0;i<g;i++){\n\t\t\tfor(j=0;j<r;j++)\n\t\t\t\tmap[i][j]=sc.nextInt();\n\t\t}\n\t\tfor(i=0;i<g;i++){\n\t\t\tfor(j=0;j<r;j++){\n\t\t\t\tmap[i][r]+=map[i][j];\n\t\t\t\tmap[g][j]+=map[i][j];}\n\t\t\tmap[g][r]+=map[i][r];\n\t\t}\n\t\tfor(i=0;i<g+1;i++){\n\t\t\tfor(j=0;j<r;j++)\n\t\t\t\tSystem.out.print(map[i][j]+\" \");\n\t\t\tSystem.out.println(map[i][r]);\n\t\t}\n\t}",
"int i",
"i",
"j",
"j",
"g",
"g",
"r",
"r",
"x;",
"x",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"g=sc.nextInt()",
"g",
"sc.nextInt()",
"sc.nextInt",
"sc",
"r=sc.nextInt()",
"r",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int[][] map= new int[g+1][r+1];",
"map",
"new int[g+1][r+1]",
"g+1",
"g",
"1",
"r+1",
"r",
"1",
"for(i=0;i<g+1;i++){\n\t\t\tfor(j=0;j<r+1;j++)\n\t\t\tmap[i][j]=0;\n\t\t}",
"i=0;",
"i=0",
"i",
"0",
"i<g+1",
"i",
"g+1",
"g",
"1",
"i++",
"i++",
"i",
"{\n\t\t\tfor(j=0;j<r+1;j++)\n\t\t\tmap[i][j]=0;\n\t\t}",
"{\n\t\t\tfor(j=0;j<r+1;j++)\n\t\t\tmap[i][j]=0;\n\t\t}",
"for(j=0;j<r+1;j++)\n\t\t\tmap[i][j]=0;",
"j=0;",
"j=0",
"j",
"0",
"j<r+1",
"j",
"r+1",
"r",
"1",
"j++",
"j++",
"j",
"map[i][j]=0;",
"map[i][j]=0",
"map[i][j]",
"map[i]",
"map",
"i",
"j",
"0",
"for(i=0;i<g;i++){\n\t\t\tfor(j=0;j<r;j++)\n\t\t\t\tmap[i][j]=sc.nextInt();\n\t\t}",
"i=0;",
"i=0",
"i",
"0",
"i<g",
"i",
"g",
"i++",
"i++",
"i",
"{\n\t\t\tfor(j=0;j<r;j++)\n\t\t\t\tmap[i][j]=sc.nextInt();\n\t\t}",
"{\n\t\t\tfor(j=0;j<r;j++)\n\t\t\t\tmap[i][j]=sc.nextInt();\n\t\t}",
"for(j=0;j<r;j++)\n\t\t\t\tmap[i][j]=sc.nextInt();",
"j=0;",
"j=0",
"j",
"0",
"j<r",
"j",
"r",
"j++",
"j++",
"j",
"map[i][j]=sc.nextInt();",
"map[i][j]=sc.nextInt()",
"map[i][j]",
"map[i]",
"map",
"i",
"j",
"sc.nextInt()",
"sc.nextInt",
"sc",
"for(i=0;i<g;i++){\n\t\t\tfor(j=0;j<r;j++){\n\t\t\t\tmap[i][r]+=map[i][j];\n\t\t\t\tmap[g][j]+=map[i][j];}\n\t\t\tmap[g][r]+=map[i][r];\n\t\t}",
"i=0;",
"i=0",
"i",
"0",
"i<g",
"i",
"g",
"i++",
"i++",
"i",
"{\n\t\t\tfor(j=0;j<r;j++){\n\t\t\t\tmap[i][r]+=map[i][j];\n\t\t\t\tmap[g][j]+=map[i][j];}\n\t\t\tmap[g][r]+=map[i][r];\n\t\t}",
"{\n\t\t\tfor(j=0;j<r;j++){\n\t\t\t\tmap[i][r]+=map[i][j];\n\t\t\t\tmap[g][j]+=map[i][j];}\n\t\t\tmap[g][r]+=map[i][r];\n\t\t}",
"for(j=0;j<r;j++){\n\t\t\t\tmap[i][r]+=map[i][j];\n\t\t\t\tmap[g][j]+=map[i][j];}",
"j=0;",
"j=0",
"j",
"0",
"j<r",
"j",
"r",
"j++",
"j++",
"j",
"{\n\t\t\t\tmap[i][r]+=map[i][j];\n\t\t\t\tmap[g][j]+=map[i][j];}",
"{\n\t\t\t\tmap[i][r]+=map[i][j];\n\t\t\t\tmap[g][j]+=map[i][j];}",
"map[i][r]+=map[i][j]",
"map[i][r]",
"map[i]",
"map",
"i",
"r",
"map[i][j]",
"map[i]",
"map",
"i",
"j",
"map[g][j]+=map[i][j]",
"map[g][j]",
"map[g]",
"map",
"g",
"j",
"map[i][j]",
"map[i]",
"map",
"i",
"j",
"map[g][r]+=map[i][r]",
"map[g][r]",
"map[g]",
"map",
"g",
"r",
"map[i][r]",
"map[i]",
"map",
"i",
"r",
"for(i=0;i<g+1;i++){\n\t\t\tfor(j=0;j<r;j++)\n\t\t\t\tSystem.out.print(map[i][j]+\" \");\n\t\t\tSystem.out.println(map[i][r]);\n\t\t}",
"i=0;",
"i=0",
"i",
"0",
"i<g+1",
"i",
"g+1",
"g",
"1",
"i++",
"i++",
"i",
"{\n\t\t\tfor(j=0;j<r;j++)\n\t\t\t\tSystem.out.print(map[i][j]+\" \");\n\t\t\tSystem.out.println(map[i][r]);\n\t\t}",
"{\n\t\t\tfor(j=0;j<r;j++)\n\t\t\t\tSystem.out.print(map[i][j]+\" \");\n\t\t\tSystem.out.println(map[i][r]);\n\t\t}",
"for(j=0;j<r;j++)\n\t\t\t\tSystem.out.print(map[i][j]+\" \");",
"j=0;",
"j=0",
"j",
"0",
"j<r",
"j",
"r",
"j++",
"j++",
"j",
"System.out.print(map[i][j]+\" \");",
"System.out.print(map[i][j]+\" \")",
"System.out.print",
"System.out",
"System",
"System.out",
"map[i][j]+\" \"",
"map[i][j]",
"map[i]",
"map",
"i",
"j",
"\" \"",
"System.out.println(map[i][r])",
"System.out.println",
"System.out",
"System",
"System.out",
"map[i][r]",
"map[i]",
"map",
"i",
"r",
"String args[]",
"args"
] | import java.util.Scanner;
class Main{
public static void main(String args[]){
int i,j,g,r,x;
Scanner sc = new Scanner(System.in);
g=sc.nextInt();
r=sc.nextInt();
int[][] map= new int[g+1][r+1];
for(i=0;i<g+1;i++){
for(j=0;j<r+1;j++)
map[i][j]=0;
}
for(i=0;i<g;i++){
for(j=0;j<r;j++)
map[i][j]=sc.nextInt();
}
for(i=0;i<g;i++){
for(j=0;j<r;j++){
map[i][r]+=map[i][j];
map[g][j]+=map[i][j];}
map[g][r]+=map[i][r];
}
for(i=0;i<g+1;i++){
for(j=0;j<r;j++)
System.out.print(map[i][j]+" ");
System.out.println(map[i][r]);
}
}
}
|
[
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,
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,
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,
30,
4,
18,
18,
13,
13,
18,
18,
13,
13,
13,
30,
4,
18,
18,
13,
13,
2,
17,
18,
18,
13,
13,
13,
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
],
[
74,
75
],
[
74,
76
],
[
73,
77
],
[
72,
78
],
[
78,
79
],
[
79,
80
],
[
79,
81
],
[
78,
82
],
[
56,
83
],
[
83,
84
],
[
84,
85
],
[
85,
86
],
[
85,
87
],
[
84,
88
],
[
83,
89
],
[
89,
90
],
[
90,
91
],
[
91,
92
],
[
91,
93
],
[
90,
94
],
[
89,
95
],
[
95,
96
],
[
96,
97
],
[
96,
98
],
[
95,
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
],
[
114,
115
],
[
115,
116
],
[
115,
117
],
[
114,
118
],
[
113,
119
],
[
119,
120
],
[
120,
121
],
[
121,
122
],
[
121,
123
],
[
120,
124
],
[
119,
125
],
[
125,
126
],
[
126,
127
],
[
126,
128
],
[
125,
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
],
[
171,
173
],
[
170,
174
],
[
160,
175
],
[
175,
176
],
[
176,
177
],
[
177,
178
],
[
178,
179
],
[
178,
180
],
[
176,
181
],
[
181,
182
],
[
181,
183
],
[
183,
184
],
[
184,
185
],
[
184,
186
],
[
183,
187
],
[
144,
188
],
[
188,
189
],
[
189,
190
],
[
190,
191
],
[
190,
192
],
[
6,
193
],
[
193,
194
]
] | [
"//7-C\n\nimport java.util.Scanner;\n\nclass Main {\n public static void main(String [] args){\n \tScanner sc = new Scanner(System.in);\n\n int r = sc.nextInt();//行\n int c = sc.nextInt();//列\n \n int[][] num = new int[r+1][c+1];//配列宣言 //ok\n \n //配列の中に整数代入\n for( int i = 0 ; i < r ; i++ ){\n \tfor ( int j = 0 ; j < c ; j++ ){\n \t\t\n \t\tnum[i][j] = sc.nextInt();\n \t\t\n \t\tnum[r][j] = num[r][j] + num[i][j];\n \t\tnum[i][c] = num[i][c] + num[i][j];\n \t\t\n \t}\n }\n \n //総合計入力\n \tfor ( int j = 0 ; j < c ; j++ ){\n \t\t\n \t\tnum[r][c] = num[r][c] + num[r][j];\n \t\t\n \t}\n \t\n \n //配列の中身と合計を出力\n for( int i = 0 ; i < r+1 ; i++ ){\n \tfor ( int j = 0 ; j < c+1 ; j++ ){\n \t\t\n \t\tif(j == 0){\n \t\t\tSystem.out.print(num[i][j]);\n \t\t}else{\n \t\t\tSystem.out.print(\" \" + num[i][j]);\n \t\t}\n \t\t\n \t}\n \tSystem.out.println();\n }\n }\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"class Main {\n public static void main(String [] args){\n \tScanner sc = new Scanner(System.in);\n\n int r = sc.nextInt();//行\n int c = sc.nextInt();//列\n \n int[][] num = new int[r+1][c+1];//配列宣言 //ok\n \n //配列の中に整数代入\n for( int i = 0 ; i < r ; i++ ){\n \tfor ( int j = 0 ; j < c ; j++ ){\n \t\t\n \t\tnum[i][j] = sc.nextInt();\n \t\t\n \t\tnum[r][j] = num[r][j] + num[i][j];\n \t\tnum[i][c] = num[i][c] + num[i][j];\n \t\t\n \t}\n }\n \n //総合計入力\n \tfor ( int j = 0 ; j < c ; j++ ){\n \t\t\n \t\tnum[r][c] = num[r][c] + num[r][j];\n \t\t\n \t}\n \t\n \n //配列の中身と合計を出力\n for( int i = 0 ; i < r+1 ; i++ ){\n \tfor ( int j = 0 ; j < c+1 ; j++ ){\n \t\t\n \t\tif(j == 0){\n \t\t\tSystem.out.print(num[i][j]);\n \t\t}else{\n \t\t\tSystem.out.print(\" \" + num[i][j]);\n \t\t}\n \t\t\n \t}\n \tSystem.out.println();\n }\n }\n}",
"Main",
"public static void main(String [] args){\n \tScanner sc = new Scanner(System.in);\n\n int r = sc.nextInt();//行\n int c = sc.nextInt();//列\n \n int[][] num = new int[r+1][c+1];//配列宣言 //ok\n \n //配列の中に整数代入\n for( int i = 0 ; i < r ; i++ ){\n \tfor ( int j = 0 ; j < c ; j++ ){\n \t\t\n \t\tnum[i][j] = sc.nextInt();\n \t\t\n \t\tnum[r][j] = num[r][j] + num[i][j];\n \t\tnum[i][c] = num[i][c] + num[i][j];\n \t\t\n \t}\n }\n \n //総合計入力\n \tfor ( int j = 0 ; j < c ; j++ ){\n \t\t\n \t\tnum[r][c] = num[r][c] + num[r][j];\n \t\t\n \t}\n \t\n \n //配列の中身と合計を出力\n for( int i = 0 ; i < r+1 ; i++ ){\n \tfor ( int j = 0 ; j < c+1 ; j++ ){\n \t\t\n \t\tif(j == 0){\n \t\t\tSystem.out.print(num[i][j]);\n \t\t}else{\n \t\t\tSystem.out.print(\" \" + num[i][j]);\n \t\t}\n \t\t\n \t}\n \tSystem.out.println();\n }\n }",
"main",
"{\n \tScanner sc = new Scanner(System.in);\n\n int r = sc.nextInt();//行\n int c = sc.nextInt();//列\n \n int[][] num = new int[r+1][c+1];//配列宣言 //ok\n \n //配列の中に整数代入\n for( int i = 0 ; i < r ; i++ ){\n \tfor ( int j = 0 ; j < c ; j++ ){\n \t\t\n \t\tnum[i][j] = sc.nextInt();\n \t\t\n \t\tnum[r][j] = num[r][j] + num[i][j];\n \t\tnum[i][c] = num[i][c] + num[i][j];\n \t\t\n \t}\n }\n \n //総合計入力\n \tfor ( int j = 0 ; j < c ; j++ ){\n \t\t\n \t\tnum[r][c] = num[r][c] + num[r][j];\n \t\t\n \t}\n \t\n \n //配列の中身と合計を出力\n for( int i = 0 ; i < r+1 ; i++ ){\n \tfor ( int j = 0 ; j < c+1 ; j++ ){\n \t\t\n \t\tif(j == 0){\n \t\t\tSystem.out.print(num[i][j]);\n \t\t}else{\n \t\t\tSystem.out.print(\" \" + num[i][j]);\n \t\t}\n \t\t\n \t}\n \tSystem.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[][] num = new int[r+1][c+1];",
"num",
"new int[r+1][c+1]",
"r+1",
"r",
"1",
"c+1",
"c",
"1",
"for( int i = 0 ; i < r ; i++ ){\n \tfor ( int j = 0 ; j < c ; j++ ){\n \t\t\n \t\tnum[i][j] = sc.nextInt();\n \t\t\n \t\tnum[r][j] = num[r][j] + num[i][j];\n \t\tnum[i][c] = num[i][c] + num[i][j];\n \t\t\n \t}\n }",
"int i = 0 ;",
"int i = 0 ;",
"i",
"0",
"i < r",
"i",
"r",
"i++",
"i++",
"i",
"{\n \tfor ( int j = 0 ; j < c ; j++ ){\n \t\t\n \t\tnum[i][j] = sc.nextInt();\n \t\t\n \t\tnum[r][j] = num[r][j] + num[i][j];\n \t\tnum[i][c] = num[i][c] + num[i][j];\n \t\t\n \t}\n }",
"{\n \tfor ( int j = 0 ; j < c ; j++ ){\n \t\t\n \t\tnum[i][j] = sc.nextInt();\n \t\t\n \t\tnum[r][j] = num[r][j] + num[i][j];\n \t\tnum[i][c] = num[i][c] + num[i][j];\n \t\t\n \t}\n }",
"for ( int j = 0 ; j < c ; j++ ){\n \t\t\n \t\tnum[i][j] = sc.nextInt();\n \t\t\n \t\tnum[r][j] = num[r][j] + num[i][j];\n \t\tnum[i][c] = num[i][c] + num[i][j];\n \t\t\n \t}",
"int j = 0 ;",
"int j = 0 ;",
"j",
"0",
"j < c",
"j",
"c",
"j++",
"j++",
"j",
"{\n \t\t\n \t\tnum[i][j] = sc.nextInt();\n \t\t\n \t\tnum[r][j] = num[r][j] + num[i][j];\n \t\tnum[i][c] = num[i][c] + num[i][j];\n \t\t\n \t}",
"{\n \t\t\n \t\tnum[i][j] = sc.nextInt();\n \t\t\n \t\tnum[r][j] = num[r][j] + num[i][j];\n \t\tnum[i][c] = num[i][c] + num[i][j];\n \t\t\n \t}",
"num[i][j] = sc.nextInt()",
"num[i][j]",
"num[i]",
"num",
"i",
"j",
"sc.nextInt()",
"sc.nextInt",
"sc",
"num[r][j] = num[r][j] + num[i][j]",
"num[r][j]",
"num[r]",
"num",
"r",
"j",
"num[r][j] + num[i][j]",
"num[r][j]",
"num[r]",
"num",
"r",
"j",
"num[i][j]",
"num[i]",
"num",
"i",
"j",
"num[i][c] = num[i][c] + num[i][j]",
"num[i][c]",
"num[i]",
"num",
"i",
"c",
"num[i][c] + num[i][j]",
"num[i][c]",
"num[i]",
"num",
"i",
"c",
"num[i][j]",
"num[i]",
"num",
"i",
"j",
"for ( int j = 0 ; j < c ; j++ ){\n \t\t\n \t\tnum[r][c] = num[r][c] + num[r][j];\n \t\t\n \t}",
"int j = 0 ;",
"int j = 0 ;",
"j",
"0",
"j < c",
"j",
"c",
"j++",
"j++",
"j",
"{\n \t\t\n \t\tnum[r][c] = num[r][c] + num[r][j];\n \t\t\n \t}",
"{\n \t\t\n \t\tnum[r][c] = num[r][c] + num[r][j];\n \t\t\n \t}",
"num[r][c] = num[r][c] + num[r][j]",
"num[r][c]",
"num[r]",
"num",
"r",
"c",
"num[r][c] + num[r][j]",
"num[r][c]",
"num[r]",
"num",
"r",
"c",
"num[r][j]",
"num[r]",
"num",
"r",
"j",
"for( int i = 0 ; i < r+1 ; i++ ){\n \tfor ( int j = 0 ; j < c+1 ; j++ ){\n \t\t\n \t\tif(j == 0){\n \t\t\tSystem.out.print(num[i][j]);\n \t\t}else{\n \t\t\tSystem.out.print(\" \" + num[i][j]);\n \t\t}\n \t\t\n \t}\n \tSystem.out.println();\n }",
"int i = 0 ;",
"int i = 0 ;",
"i",
"0",
"i < r+1",
"i",
"r+1",
"r",
"1",
"i++",
"i++",
"i",
"{\n \tfor ( int j = 0 ; j < c+1 ; j++ ){\n \t\t\n \t\tif(j == 0){\n \t\t\tSystem.out.print(num[i][j]);\n \t\t}else{\n \t\t\tSystem.out.print(\" \" + num[i][j]);\n \t\t}\n \t\t\n \t}\n \tSystem.out.println();\n }",
"{\n \tfor ( int j = 0 ; j < c+1 ; j++ ){\n \t\t\n \t\tif(j == 0){\n \t\t\tSystem.out.print(num[i][j]);\n \t\t}else{\n \t\t\tSystem.out.print(\" \" + num[i][j]);\n \t\t}\n \t\t\n \t}\n \tSystem.out.println();\n }",
"for ( int j = 0 ; j < c+1 ; j++ ){\n \t\t\n \t\tif(j == 0){\n \t\t\tSystem.out.print(num[i][j]);\n \t\t}else{\n \t\t\tSystem.out.print(\" \" + num[i][j]);\n \t\t}\n \t\t\n \t}",
"int j = 0 ;",
"int j = 0 ;",
"j",
"0",
"j < c+1",
"j",
"c+1",
"c",
"1",
"j++",
"j++",
"j",
"{\n \t\t\n \t\tif(j == 0){\n \t\t\tSystem.out.print(num[i][j]);\n \t\t}else{\n \t\t\tSystem.out.print(\" \" + num[i][j]);\n \t\t}\n \t\t\n \t}",
"{\n \t\t\n \t\tif(j == 0){\n \t\t\tSystem.out.print(num[i][j]);\n \t\t}else{\n \t\t\tSystem.out.print(\" \" + num[i][j]);\n \t\t}\n \t\t\n \t}",
"if(j == 0){\n \t\t\tSystem.out.print(num[i][j]);\n \t\t}else{\n \t\t\tSystem.out.print(\" \" + num[i][j]);\n \t\t}",
"j == 0",
"j",
"0",
"{\n \t\t\tSystem.out.print(num[i][j]);\n \t\t}",
"System.out.print(num[i][j])",
"System.out.print",
"System.out",
"System",
"System.out",
"num[i][j]",
"num[i]",
"num",
"i",
"j",
"{\n \t\t\tSystem.out.print(\" \" + num[i][j]);\n \t\t}",
"System.out.print(\" \" + num[i][j])",
"System.out.print",
"System.out",
"System",
"System.out",
"\" \" + num[i][j]",
"\" \"",
"num[i][j]",
"num[i]",
"num",
"i",
"j",
"System.out.println()",
"System.out.println",
"System.out",
"System",
"System.out",
"String [] args",
"args"
] | //7-C
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[][] num = new int[r+1][c+1];//配列宣言 //ok
//配列の中に整数代入
for( int i = 0 ; i < r ; i++ ){
for ( int j = 0 ; j < c ; j++ ){
num[i][j] = sc.nextInt();
num[r][j] = num[r][j] + num[i][j];
num[i][c] = num[i][c] + num[i][j];
}
}
//総合計入力
for ( int j = 0 ; j < c ; j++ ){
num[r][c] = num[r][c] + num[r][j];
}
//配列の中身と合計を出力
for( int i = 0 ; i < r+1 ; i++ ){
for ( int j = 0 ; j < c+1 ; j++ ){
if(j == 0){
System.out.print(num[i][j]);
}else{
System.out.print(" " + num[i][j]);
}
}
System.out.println();
}
}
} |
[
7,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
20,
17,
41,
13,
17,
41,
13,
41,
13,
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,
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,
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,
15
],
[
15,
16
],
[
15,
17
],
[
11,
19
],
[
19,
20
],
[
19,
21
],
[
11,
22
],
[
22,
23
],
[
11,
24
],
[
24,
25
],
[
11,
26
],
[
26,
27
],
[
27,
28
],
[
27,
29
],
[
29,
30
],
[
30,
31
],
[
31,
32
],
[
32,
33
],
[
32,
34
],
[
30,
35
],
[
29,
36
],
[
26,
37
],
[
37,
38
],
[
38,
39
],
[
38,
40
],
[
40,
41
],
[
41,
42
],
[
42,
43
],
[
43,
44
],
[
40,
45
],
[
37,
46
],
[
46,
47
],
[
46,
48
],
[
48,
49
],
[
49,
50
],
[
48,
51
],
[
51,
52
],
[
51,
53
],
[
37,
54
],
[
54,
55
],
[
54,
56
],
[
56,
57
],
[
57,
58
],
[
56,
59
],
[
59,
60
],
[
59,
61
],
[
37,
62
],
[
62,
63
],
[
62,
64
],
[
65,
66
],
[
65,
67
],
[
68,
69
],
[
68,
70
],
[
37,
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
],
[
88,
89
],
[
89,
90
],
[
86,
91
],
[
83,
92
],
[
92,
93
],
[
93,
94
],
[
94,
95
],
[
94,
96
],
[
92,
97
],
[
97,
98
],
[
97,
99
],
[
92,
100
],
[
100,
101
],
[
101,
102
],
[
92,
103
],
[
104,
104
],
[
104,
105
],
[
105,
106
],
[
106,
107
],
[
107,
108
],
[
107,
109
],
[
106,
110
],
[
105,
111
],
[
111,
112
],
[
112,
113
],
[
111,
114
],
[
114,
115
],
[
114,
116
],
[
104,
117
],
[
117,
118
],
[
118,
119
],
[
119,
120
],
[
119,
121
],
[
118,
122
],
[
117,
123
],
[
123,
124
],
[
124,
125
],
[
124,
126
],
[
123,
127
],
[
37,
128
],
[
128,
129
],
[
129,
130
],
[
130,
131
],
[
130,
132
],
[
128,
133
],
[
133,
134
],
[
133,
135
],
[
135,
136
],
[
135,
137
],
[
128,
138
],
[
138,
139
],
[
139,
140
],
[
128,
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
],
[
158,
159
],
[
158,
160
],
[
157,
161
],
[
156,
162
],
[
162,
163
],
[
163,
164
],
[
163,
165
],
[
162,
166
],
[
37,
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
],
[
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
],
[
197,
199
],
[
199,
200
],
[
200,
201
],
[
201,
202
],
[
201,
203
],
[
200,
204
],
[
199,
205
],
[
181,
206
],
[
206,
207
],
[
207,
208
],
[
208,
209
],
[
208,
210
],
[
206,
211
],
[
211,
212
],
[
212,
213
],
[
211,
214
],
[
211,
215
],
[
215,
216
],
[
216,
217
],
[
217,
218
],
[
215,
219
],
[
181,
220
],
[
220,
221
],
[
220,
222
],
[
9,
223
],
[
223,
224
]
] | [
"import java.io.*;\nimport java.io.IOException;\n\nclass Main{\n\tpublic static void main(String args[]){\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\t\t\n\t\tString[] input = new String[100];\n\t\tString output = \"\";\n\t\tint \tr,\n\t\t\t\tc;\n\t\t\n\t\ttry{\n\t\t\tinput = br.readLine().split(\"[\\\\s]+\");\n\t\t\tr = Integer.parseInt(input[0]);\n\t\t\tc = Integer.parseInt(input[1]);\n\t\t\tint table[][] = new int[r+1][c+1];\n\t\t\n\t\tfor(int y = 0;y < r;y++){\n\t\t\tinput = br.readLine().split(\"[\\\\s]+\");\n\t\t\t\n\t\t\tfor(int x = 0;x < c;x++){\n\t\t\t\ttable[y][x] = Integer.parseInt(input[x]);\n\t\t\t\ttable[y][c] += table[y][x];\n\t\t\t}\n\t\t}\n\t\t\n\t\tfor(int x = 0;x < c + 1;x++){\n\t\t\tfor(int y = 0;y < r;y++){\n\t\t\t\ttable[r][x] += table[y][x];\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t\tfor(int y = 0;y < r + 1;y++){\n\t\t\tfor(int x = 0;x < c + 1;x++){\n\t\t\t\toutput += table[y][x] + \" \";\n\t\t\t}\n\t\t\tSystem.out.println(output.substring(0, output.length()-1));\n\t\t\toutput = \"\";\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\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\t\t\n\t\tString[] input = new String[100];\n\t\tString output = \"\";\n\t\tint \tr,\n\t\t\t\tc;\n\t\t\n\t\ttry{\n\t\t\tinput = br.readLine().split(\"[\\\\s]+\");\n\t\t\tr = Integer.parseInt(input[0]);\n\t\t\tc = Integer.parseInt(input[1]);\n\t\t\tint table[][] = new int[r+1][c+1];\n\t\t\n\t\tfor(int y = 0;y < r;y++){\n\t\t\tinput = br.readLine().split(\"[\\\\s]+\");\n\t\t\t\n\t\t\tfor(int x = 0;x < c;x++){\n\t\t\t\ttable[y][x] = Integer.parseInt(input[x]);\n\t\t\t\ttable[y][c] += table[y][x];\n\t\t\t}\n\t\t}\n\t\t\n\t\tfor(int x = 0;x < c + 1;x++){\n\t\t\tfor(int y = 0;y < r;y++){\n\t\t\t\ttable[r][x] += table[y][x];\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t\tfor(int y = 0;y < r + 1;y++){\n\t\t\tfor(int x = 0;x < c + 1;x++){\n\t\t\t\toutput += table[y][x] + \" \";\n\t\t\t}\n\t\t\tSystem.out.println(output.substring(0, output.length()-1));\n\t\t\toutput = \"\";\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\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\t\t\n\t\tString[] input = new String[100];\n\t\tString output = \"\";\n\t\tint \tr,\n\t\t\t\tc;\n\t\t\n\t\ttry{\n\t\t\tinput = br.readLine().split(\"[\\\\s]+\");\n\t\t\tr = Integer.parseInt(input[0]);\n\t\t\tc = Integer.parseInt(input[1]);\n\t\t\tint table[][] = new int[r+1][c+1];\n\t\t\n\t\tfor(int y = 0;y < r;y++){\n\t\t\tinput = br.readLine().split(\"[\\\\s]+\");\n\t\t\t\n\t\t\tfor(int x = 0;x < c;x++){\n\t\t\t\ttable[y][x] = Integer.parseInt(input[x]);\n\t\t\t\ttable[y][c] += table[y][x];\n\t\t\t}\n\t\t}\n\t\t\n\t\tfor(int x = 0;x < c + 1;x++){\n\t\t\tfor(int y = 0;y < r;y++){\n\t\t\t\ttable[r][x] += table[y][x];\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t\tfor(int y = 0;y < r + 1;y++){\n\t\t\tfor(int x = 0;x < c + 1;x++){\n\t\t\t\toutput += table[y][x] + \" \";\n\t\t\t}\n\t\t\tSystem.out.println(output.substring(0, output.length()-1));\n\t\t\toutput = \"\";\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\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\t\t\n\t\tString[] input = new String[100];\n\t\tString output = \"\";\n\t\tint \tr,\n\t\t\t\tc;\n\t\t\n\t\ttry{\n\t\t\tinput = br.readLine().split(\"[\\\\s]+\");\n\t\t\tr = Integer.parseInt(input[0]);\n\t\t\tc = Integer.parseInt(input[1]);\n\t\t\tint table[][] = new int[r+1][c+1];\n\t\t\n\t\tfor(int y = 0;y < r;y++){\n\t\t\tinput = br.readLine().split(\"[\\\\s]+\");\n\t\t\t\n\t\t\tfor(int x = 0;x < c;x++){\n\t\t\t\ttable[y][x] = Integer.parseInt(input[x]);\n\t\t\t\ttable[y][c] += table[y][x];\n\t\t\t}\n\t\t}\n\t\t\n\t\tfor(int x = 0;x < c + 1;x++){\n\t\t\tfor(int y = 0;y < r;y++){\n\t\t\t\ttable[r][x] += table[y][x];\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t\tfor(int y = 0;y < r + 1;y++){\n\t\t\tfor(int x = 0;x < c + 1;x++){\n\t\t\t\toutput += table[y][x] + \" \";\n\t\t\t}\n\t\t\tSystem.out.println(output.substring(0, output.length()-1));\n\t\t\toutput = \"\";\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}",
"BufferedReader br = new BufferedReader(new InputStreamReader(System.in));",
"br",
"new BufferedReader(new InputStreamReader(System.in))",
"String[] input = new String[100];",
"input",
"new String[100]",
"100",
"String output = \"\";",
"output",
"\"\"",
"int \tr",
"r",
"c;",
"c",
"try{\n\t\t\tinput = br.readLine().split(\"[\\\\s]+\");\n\t\t\tr = Integer.parseInt(input[0]);\n\t\t\tc = Integer.parseInt(input[1]);\n\t\t\tint table[][] = new int[r+1][c+1];\n\t\t\n\t\tfor(int y = 0;y < r;y++){\n\t\t\tinput = br.readLine().split(\"[\\\\s]+\");\n\t\t\t\n\t\t\tfor(int x = 0;x < c;x++){\n\t\t\t\ttable[y][x] = Integer.parseInt(input[x]);\n\t\t\t\ttable[y][c] += table[y][x];\n\t\t\t}\n\t\t}\n\t\t\n\t\tfor(int x = 0;x < c + 1;x++){\n\t\t\tfor(int y = 0;y < r;y++){\n\t\t\t\ttable[r][x] += table[y][x];\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t\tfor(int y = 0;y < r + 1;y++){\n\t\t\tfor(int x = 0;x < c + 1;x++){\n\t\t\t\toutput += table[y][x] + \" \";\n\t\t\t}\n\t\t\tSystem.out.println(output.substring(0, output.length()-1));\n\t\t\toutput = \"\";\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\t\tinput = br.readLine().split(\"[\\\\s]+\");\n\t\t\tr = Integer.parseInt(input[0]);\n\t\t\tc = Integer.parseInt(input[1]);\n\t\t\tint table[][] = new int[r+1][c+1];\n\t\t\n\t\tfor(int y = 0;y < r;y++){\n\t\t\tinput = br.readLine().split(\"[\\\\s]+\");\n\t\t\t\n\t\t\tfor(int x = 0;x < c;x++){\n\t\t\t\ttable[y][x] = Integer.parseInt(input[x]);\n\t\t\t\ttable[y][c] += table[y][x];\n\t\t\t}\n\t\t}\n\t\t\n\t\tfor(int x = 0;x < c + 1;x++){\n\t\t\tfor(int y = 0;y < r;y++){\n\t\t\t\ttable[r][x] += table[y][x];\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t\tfor(int y = 0;y < r + 1;y++){\n\t\t\tfor(int x = 0;x < c + 1;x++){\n\t\t\t\toutput += table[y][x] + \" \";\n\t\t\t}\n\t\t\tSystem.out.println(output.substring(0, output.length()-1));\n\t\t\toutput = \"\";\n\t\t}\n\t\t}",
"input = br.readLine().split(\"[\\\\s]+\")",
"input",
"br.readLine().split(\"[\\\\s]+\")",
"br.readLine().split",
"br.readLine()",
"br.readLine",
"br",
"\"[\\\\s]+\"",
"r = Integer.parseInt(input[0])",
"r",
"Integer.parseInt(input[0])",
"Integer.parseInt",
"Integer",
"input[0]",
"input",
"0",
"c = Integer.parseInt(input[1])",
"c",
"Integer.parseInt(input[1])",
"Integer.parseInt",
"Integer",
"input[1]",
"input",
"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 y = 0;y < r;y++){\n\t\t\tinput = br.readLine().split(\"[\\\\s]+\");\n\t\t\t\n\t\t\tfor(int x = 0;x < c;x++){\n\t\t\t\ttable[y][x] = Integer.parseInt(input[x]);\n\t\t\t\ttable[y][c] += table[y][x];\n\t\t\t}\n\t\t}",
"int y = 0;",
"int y = 0;",
"y",
"0",
"y < r",
"y",
"r",
"y++",
"y++",
"y",
"{\n\t\t\tinput = br.readLine().split(\"[\\\\s]+\");\n\t\t\t\n\t\t\tfor(int x = 0;x < c;x++){\n\t\t\t\ttable[y][x] = Integer.parseInt(input[x]);\n\t\t\t\ttable[y][c] += table[y][x];\n\t\t\t}\n\t\t}",
"{\n\t\t\tinput = br.readLine().split(\"[\\\\s]+\");\n\t\t\t\n\t\t\tfor(int x = 0;x < c;x++){\n\t\t\t\ttable[y][x] = Integer.parseInt(input[x]);\n\t\t\t\ttable[y][c] += table[y][x];\n\t\t\t}\n\t\t}",
"input = br.readLine().split(\"[\\\\s]+\")",
"input",
"br.readLine().split(\"[\\\\s]+\")",
"br.readLine().split",
"br.readLine()",
"br.readLine",
"br",
"\"[\\\\s]+\"",
"for(int x = 0;x < c;x++){\n\t\t\t\ttable[y][x] = Integer.parseInt(input[x]);\n\t\t\t\ttable[y][c] += table[y][x];\n\t\t\t}",
"int x = 0;",
"int x = 0;",
"x",
"0",
"x < c",
"x",
"c",
"x++",
"x++",
"x",
"{\n\t\t\t\ttable[y][x] = Integer.parseInt(input[x]);\n\t\t\t\ttable[y][c] += table[y][x];\n\t\t\t}",
"{\n\t\t\t\ttable[y][x] = Integer.parseInt(input[x]);\n\t\t\t\ttable[y][c] += table[y][x];\n\t\t\t}",
"table[y][x] = Integer.parseInt(input[x])",
"table[y][x]",
"table[y]",
"table",
"y",
"x",
"Integer.parseInt(input[x])",
"Integer.parseInt",
"Integer",
"input[x]",
"input",
"x",
"table[y][c] += table[y][x]",
"table[y][c]",
"table[y]",
"table",
"y",
"c",
"table[y][x]",
"table[y]",
"table",
"y",
"x",
"for(int x = 0;x < c + 1;x++){\n\t\t\tfor(int y = 0;y < r;y++){\n\t\t\t\ttable[r][x] += table[y][x];\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t}",
"int x = 0;",
"int x = 0;",
"x",
"0",
"x < c + 1",
"x",
"c + 1",
"c",
"1",
"x++",
"x++",
"x",
"{\n\t\t\tfor(int y = 0;y < r;y++){\n\t\t\t\ttable[r][x] += table[y][x];\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t}",
"{\n\t\t\tfor(int y = 0;y < r;y++){\n\t\t\t\ttable[r][x] += table[y][x];\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t}",
"for(int y = 0;y < r;y++){\n\t\t\t\ttable[r][x] += table[y][x];\n\t\t\t\t\n\t\t\t}",
"int y = 0;",
"int y = 0;",
"y",
"0",
"y < r",
"y",
"r",
"y++",
"y++",
"y",
"{\n\t\t\t\ttable[r][x] += table[y][x];\n\t\t\t\t\n\t\t\t}",
"{\n\t\t\t\ttable[r][x] += table[y][x];\n\t\t\t\t\n\t\t\t}",
"table[r][x] += table[y][x]",
"table[r][x]",
"table[r]",
"table",
"r",
"x",
"table[y][x]",
"table[y]",
"table",
"y",
"x",
"for(int y = 0;y < r + 1;y++){\n\t\t\tfor(int x = 0;x < c + 1;x++){\n\t\t\t\toutput += table[y][x] + \" \";\n\t\t\t}\n\t\t\tSystem.out.println(output.substring(0, output.length()-1));\n\t\t\toutput = \"\";\n\t\t}",
"int y = 0;",
"int y = 0;",
"y",
"0",
"y < r + 1",
"y",
"r + 1",
"r",
"1",
"y++",
"y++",
"y",
"{\n\t\t\tfor(int x = 0;x < c + 1;x++){\n\t\t\t\toutput += table[y][x] + \" \";\n\t\t\t}\n\t\t\tSystem.out.println(output.substring(0, output.length()-1));\n\t\t\toutput = \"\";\n\t\t}",
"{\n\t\t\tfor(int x = 0;x < c + 1;x++){\n\t\t\t\toutput += table[y][x] + \" \";\n\t\t\t}\n\t\t\tSystem.out.println(output.substring(0, output.length()-1));\n\t\t\toutput = \"\";\n\t\t}",
"for(int x = 0;x < c + 1;x++){\n\t\t\t\toutput += table[y][x] + \" \";\n\t\t\t}",
"int x = 0;",
"int x = 0;",
"x",
"0",
"x < c + 1",
"x",
"c + 1",
"c",
"1",
"x++",
"x++",
"x",
"{\n\t\t\t\toutput += table[y][x] + \" \";\n\t\t\t}",
"{\n\t\t\t\toutput += table[y][x] + \" \";\n\t\t\t}",
"output += table[y][x] + \" \"",
"output",
"table[y][x] + \" \"",
"table[y][x]",
"table[y]",
"table",
"y",
"x",
"\" \"",
"System.out.println(output.substring(0, output.length()-1))",
"System.out.println",
"System.out",
"System",
"System.out",
"output.substring(0, output.length()-1)",
"output.substring",
"output",
"0",
"output.length()-1",
"output.length()",
"output.length",
"output",
"1",
"output = \"\"",
"output",
"\"\"",
"String args[]",
"args"
] | import java.io.*;
import java.io.IOException;
class Main{
public static void main(String args[]){
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
String[] input = new String[100];
String output = "";
int r,
c;
try{
input = br.readLine().split("[\\s]+");
r = Integer.parseInt(input[0]);
c = Integer.parseInt(input[1]);
int table[][] = new int[r+1][c+1];
for(int y = 0;y < r;y++){
input = br.readLine().split("[\\s]+");
for(int x = 0;x < c;x++){
table[y][x] = Integer.parseInt(input[x]);
table[y][c] += table[y][x];
}
}
for(int x = 0;x < c + 1;x++){
for(int y = 0;y < r;y++){
table[r][x] += table[y][x];
}
}
for(int y = 0;y < r + 1;y++){
for(int x = 0;x < c + 1;x++){
output += table[y][x] + " ";
}
System.out.println(output.substring(0, output.length()-1));
output = "";
}
}catch(IOException e){
System.out.println(e);
return;
}
}
}
|
[
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,
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,
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
],
[
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
],
[
28,
29
],
[
28,
30
],
[
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
],
[
11,
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
],
[
11,
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
],
[
11,
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
],
[
158,
159
],
[
158,
160
],
[
156,
161
],
[
161,
162
],
[
161,
163
],
[
156,
164
],
[
164,
165
],
[
165,
166
],
[
156,
167
],
[
168,
168
],
[
168,
169
],
[
169,
170
],
[
170,
171
],
[
171,
172
],
[
171,
173
],
[
169,
174
],
[
174,
175
],
[
175,
176
],
[
176,
177
],
[
176,
178
],
[
175,
179
],
[
174,
180
],
[
155,
181
],
[
181,
182
],
[
182,
183
],
[
183,
184
],
[
183,
185
],
[
181,
186
],
[
186,
187
],
[
187,
188
],
[
187,
189
],
[
186,
190
],
[
9,
191
],
[
191,
192
]
] | [
"import java.util.Scanner;\nimport java.util.Arrays;\n\nclass Main{\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[][] numbers = 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\tnumbers[i][j] = scanner.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\tnumbers[i][c] += numbers[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\tnumbers[r][i] += numbers[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; j++){\n\t\t\t\tSystem.out.print(numbers[i][j] + \" \");\n\t\t\t}\n\t\t\tSystem.out.println(numbers[i][c]);\n\t\t}\n\t\t\n\t}\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"import java.util.Arrays;",
"Arrays",
"java.util",
"class Main{\n\tpublic static void main(String[] args){\n\t\tScanner scanner = new Scanner(System.in);\n\t\tint r = scanner.nextInt();\n\t\tint c = scanner.nextInt();\n\t\tint[][] numbers = 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\tnumbers[i][j] = scanner.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\tnumbers[i][c] += numbers[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\tnumbers[r][i] += numbers[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; j++){\n\t\t\t\tSystem.out.print(numbers[i][j] + \" \");\n\t\t\t}\n\t\t\tSystem.out.println(numbers[i][c]);\n\t\t}\n\t\t\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[][] numbers = 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\tnumbers[i][j] = scanner.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\tnumbers[i][c] += numbers[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\tnumbers[r][i] += numbers[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; j++){\n\t\t\t\tSystem.out.print(numbers[i][j] + \" \");\n\t\t\t}\n\t\t\tSystem.out.println(numbers[i][c]);\n\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[][] numbers = 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\tnumbers[i][j] = scanner.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\tnumbers[i][c] += numbers[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\tnumbers[r][i] += numbers[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; j++){\n\t\t\t\tSystem.out.print(numbers[i][j] + \" \");\n\t\t\t}\n\t\t\tSystem.out.println(numbers[i][c]);\n\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[][] numbers = new int[r+1][c+1];",
"numbers",
"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\tnumbers[i][j] = scanner.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\tnumbers[i][j] = scanner.nextInt();\n\t\t\t}\n\t\t}",
"{\n\t\t\tfor(int j = 0; j < c; j++){\n\t\t\t\tnumbers[i][j] = scanner.nextInt();\n\t\t\t}\n\t\t}",
"for(int j = 0; j < c; j++){\n\t\t\t\tnumbers[i][j] = scanner.nextInt();\n\t\t\t}",
"int j = 0;",
"int j = 0;",
"j",
"0",
"j < c",
"j",
"c",
"j++",
"j++",
"j",
"{\n\t\t\t\tnumbers[i][j] = scanner.nextInt();\n\t\t\t}",
"{\n\t\t\t\tnumbers[i][j] = scanner.nextInt();\n\t\t\t}",
"numbers[i][j] = scanner.nextInt()",
"numbers[i][j]",
"numbers[i]",
"numbers",
"i",
"j",
"scanner.nextInt()",
"scanner.nextInt",
"scanner",
"for(int i = 0; i < r; i++){\n\t\t\tfor(int j = 0; j < c; j++){\n\t\t\t\tnumbers[i][c] += numbers[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\tnumbers[i][c] += numbers[i][j];\n\t\t\t}\n\t\t}",
"{\n\t\t\tfor(int j = 0; j < c; j++){\n\t\t\t\tnumbers[i][c] += numbers[i][j];\n\t\t\t}\n\t\t}",
"for(int j = 0; j < c; j++){\n\t\t\t\tnumbers[i][c] += numbers[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\tnumbers[i][c] += numbers[i][j];\n\t\t\t}",
"{\n\t\t\t\tnumbers[i][c] += numbers[i][j];\n\t\t\t}",
"numbers[i][c] += numbers[i][j]",
"numbers[i][c]",
"numbers[i]",
"numbers",
"i",
"c",
"numbers[i][j]",
"numbers[i]",
"numbers",
"i",
"j",
"for(int i = 0; i <= c; i++){\n\t\t\tfor(int j = 0; j < r; j++){\n\t\t\t\tnumbers[r][i] += numbers[j][i];\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\tnumbers[r][i] += numbers[j][i];\n\t\t\t}\n\t\t}",
"{\n\t\t\tfor(int j = 0; j < r; j++){\n\t\t\t\tnumbers[r][i] += numbers[j][i];\n\t\t\t}\n\t\t}",
"for(int j = 0; j < r; j++){\n\t\t\t\tnumbers[r][i] += numbers[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\tnumbers[r][i] += numbers[j][i];\n\t\t\t}",
"{\n\t\t\t\tnumbers[r][i] += numbers[j][i];\n\t\t\t}",
"numbers[r][i] += numbers[j][i]",
"numbers[r][i]",
"numbers[r]",
"numbers",
"r",
"i",
"numbers[j][i]",
"numbers[j]",
"numbers",
"j",
"i",
"for(int i = 0; i <= r; i++){\n\t\t\tfor(int j = 0; j < c; j++){\n\t\t\t\tSystem.out.print(numbers[i][j] + \" \");\n\t\t\t}\n\t\t\tSystem.out.println(numbers[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\tSystem.out.print(numbers[i][j] + \" \");\n\t\t\t}\n\t\t\tSystem.out.println(numbers[i][c]);\n\t\t}",
"{\n\t\t\tfor(int j = 0; j < c; j++){\n\t\t\t\tSystem.out.print(numbers[i][j] + \" \");\n\t\t\t}\n\t\t\tSystem.out.println(numbers[i][c]);\n\t\t}",
"for(int j = 0; j < c; j++){\n\t\t\t\tSystem.out.print(numbers[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(numbers[i][j] + \" \");\n\t\t\t}",
"{\n\t\t\t\tSystem.out.print(numbers[i][j] + \" \");\n\t\t\t}",
"System.out.print(numbers[i][j] + \" \")",
"System.out.print",
"System.out",
"System",
"System.out",
"numbers[i][j] + \" \"",
"numbers[i][j]",
"numbers[i]",
"numbers",
"i",
"j",
"\" \"",
"System.out.println(numbers[i][c])",
"System.out.println",
"System.out",
"System",
"System.out",
"numbers[i][c]",
"numbers[i]",
"numbers",
"i",
"c",
"String[] args",
"args"
] | import java.util.Scanner;
import java.util.Arrays;
class Main{
public static void main(String[] args){
Scanner scanner = new Scanner(System.in);
int r = scanner.nextInt();
int c = scanner.nextInt();
int[][] numbers = new int[r+1][c+1];
for(int i = 0; i < r; i++){
for(int j = 0; j < c; j++){
numbers[i][j] = scanner.nextInt();
}
}
for(int i = 0; i < r; i++){
for(int j = 0; j < c; j++){
numbers[i][c] += numbers[i][j];
}
}
for(int i = 0; i <= c; i++){
for(int j = 0; j < r; j++){
numbers[r][i] += numbers[j][i];
}
}
for(int i = 0; i <= r; i++){
for(int j = 0; j < c; j++){
System.out.print(numbers[i][j] + " ");
}
System.out.println(numbers[i][c]);
}
}
} |
[
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,
17,
17,
41,
13,
20,
17,
41,
13,
17,
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,
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,
4,
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,
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
] | [
[
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
],
[
11,
30
],
[
30,
31
],
[
30,
32
],
[
11,
34
],
[
34,
35
],
[
34,
36
],
[
11,
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
],
[
50,
52
],
[
49,
53
],
[
53,
54
],
[
54,
55
],
[
55,
56
],
[
55,
57
],
[
53,
58
],
[
58,
59
],
[
58,
60
],
[
53,
61
],
[
61,
62
],
[
62,
63
],
[
53,
64
],
[
65,
65
],
[
65,
66
],
[
66,
67
],
[
67,
68
],
[
68,
69
],
[
68,
70
],
[
67,
71
],
[
66,
72
],
[
72,
73
],
[
73,
74
],
[
65,
75
],
[
75,
76
],
[
75,
77
],
[
77,
78
],
[
78,
79
],
[
78,
80
],
[
77,
81
],
[
65,
82
],
[
82,
83
],
[
83,
84
],
[
84,
85
],
[
84,
86
],
[
82,
87
],
[
87,
88
],
[
88,
89
],
[
89,
90
],
[
89,
91
],
[
88,
92
],
[
87,
93
],
[
49,
94
],
[
94,
95
],
[
95,
96
],
[
96,
97
],
[
96,
98
],
[
94,
99
],
[
11,
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
],
[
113,
118
],
[
118,
119
],
[
118,
120
],
[
113,
121
],
[
121,
122
],
[
122,
123
],
[
113,
124
],
[
125,
125
],
[
125,
126
],
[
126,
127
],
[
127,
128
],
[
127,
129
],
[
126,
130
],
[
130,
131
],
[
131,
132
],
[
131,
133
],
[
130,
134
],
[
11,
135
],
[
135,
136
],
[
135,
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
],
[
150,
150
],
[
150,
151
],
[
151,
152
],
[
151,
153
],
[
153,
154
],
[
153,
155
],
[
150,
156
],
[
156,
157
],
[
157,
158
],
[
158,
159
],
[
158,
160
],
[
156,
161
],
[
161,
162
],
[
162,
163
],
[
162,
164
],
[
161,
165
],
[
11,
166
],
[
166,
167
],
[
167,
168
],
[
168,
169
],
[
168,
170
],
[
166,
171
],
[
9,
172
],
[
172,
173
]
] | [
"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 r =scan.nextInt();\n\t\tint c =scan.nextInt();\n\t\tint num[][] = new int[100][101]; //num[???][?¨?]\n\t\tint sumsum[] = new int [101];\n\t\tint sum = 0;\n\t\t\n\t\tfor(int i =0; i<r; i++){\n\t\t\tsum = 0;\n\t\t\tfor(int ii=0;ii<c;ii++){\n\t\t\t\tnum[ii][i] = scan.nextInt();\n\t\t\t\tsum += num[ii][i];\n\t\t\t\tSystem.out.print(num[ii][i]+\" \");\n\t\t\t}\n\t\t\tSystem.out.println(sum);\n\t\t}\n\t\t\n\t\tfor(int i =0; i<r; i++){\n\t\t\tfor(int ii=0;ii<c;ii++){\n\t\t\t\tsumsum[ii] += num[ii][i];\n\t\t\t}\n\t\t}\n\t\t\n\t\tsum = 0;\n\t\tfor(int i=0; i<c; i++){\n\t\t\tsum += sumsum[i];\n\t\t\tSystem.out.print(sumsum[i]+\" \");\n\t\t}\n\t\tSystem.out.println(sum);\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 r =scan.nextInt();\n\t\tint c =scan.nextInt();\n\t\tint num[][] = new int[100][101]; //num[???][?¨?]\n\t\tint sumsum[] = new int [101];\n\t\tint sum = 0;\n\t\t\n\t\tfor(int i =0; i<r; i++){\n\t\t\tsum = 0;\n\t\t\tfor(int ii=0;ii<c;ii++){\n\t\t\t\tnum[ii][i] = scan.nextInt();\n\t\t\t\tsum += num[ii][i];\n\t\t\t\tSystem.out.print(num[ii][i]+\" \");\n\t\t\t}\n\t\t\tSystem.out.println(sum);\n\t\t}\n\t\t\n\t\tfor(int i =0; i<r; i++){\n\t\t\tfor(int ii=0;ii<c;ii++){\n\t\t\t\tsumsum[ii] += num[ii][i];\n\t\t\t}\n\t\t}\n\t\t\n\t\tsum = 0;\n\t\tfor(int i=0; i<c; i++){\n\t\t\tsum += sumsum[i];\n\t\t\tSystem.out.print(sumsum[i]+\" \");\n\t\t}\n\t\tSystem.out.println(sum);\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 r =scan.nextInt();\n\t\tint c =scan.nextInt();\n\t\tint num[][] = new int[100][101]; //num[???][?¨?]\n\t\tint sumsum[] = new int [101];\n\t\tint sum = 0;\n\t\t\n\t\tfor(int i =0; i<r; i++){\n\t\t\tsum = 0;\n\t\t\tfor(int ii=0;ii<c;ii++){\n\t\t\t\tnum[ii][i] = scan.nextInt();\n\t\t\t\tsum += num[ii][i];\n\t\t\t\tSystem.out.print(num[ii][i]+\" \");\n\t\t\t}\n\t\t\tSystem.out.println(sum);\n\t\t}\n\t\t\n\t\tfor(int i =0; i<r; i++){\n\t\t\tfor(int ii=0;ii<c;ii++){\n\t\t\t\tsumsum[ii] += num[ii][i];\n\t\t\t}\n\t\t}\n\t\t\n\t\tsum = 0;\n\t\tfor(int i=0; i<c; i++){\n\t\t\tsum += sumsum[i];\n\t\t\tSystem.out.print(sumsum[i]+\" \");\n\t\t}\n\t\tSystem.out.println(sum);\n\t}",
"main",
"{\n\t\t//System.out.print(\" \");\n\t\tScanner scan = new Scanner(System.in);\n\t\tint r =scan.nextInt();\n\t\tint c =scan.nextInt();\n\t\tint num[][] = new int[100][101]; //num[???][?¨?]\n\t\tint sumsum[] = new int [101];\n\t\tint sum = 0;\n\t\t\n\t\tfor(int i =0; i<r; i++){\n\t\t\tsum = 0;\n\t\t\tfor(int ii=0;ii<c;ii++){\n\t\t\t\tnum[ii][i] = scan.nextInt();\n\t\t\t\tsum += num[ii][i];\n\t\t\t\tSystem.out.print(num[ii][i]+\" \");\n\t\t\t}\n\t\t\tSystem.out.println(sum);\n\t\t}\n\t\t\n\t\tfor(int i =0; i<r; i++){\n\t\t\tfor(int ii=0;ii<c;ii++){\n\t\t\t\tsumsum[ii] += num[ii][i];\n\t\t\t}\n\t\t}\n\t\t\n\t\tsum = 0;\n\t\tfor(int i=0; i<c; i++){\n\t\t\tsum += sumsum[i];\n\t\t\tSystem.out.print(sumsum[i]+\" \");\n\t\t}\n\t\tSystem.out.println(sum);\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 num[][] = new int[100][101];",
"num",
"new int[100][101]",
"100",
"101",
"int sumsum[] = new int [101];",
"sumsum",
"new int [101]",
"101",
"int sum = 0;",
"sum",
"0",
"for(int i =0; i<r; i++){\n\t\t\tsum = 0;\n\t\t\tfor(int ii=0;ii<c;ii++){\n\t\t\t\tnum[ii][i] = scan.nextInt();\n\t\t\t\tsum += num[ii][i];\n\t\t\t\tSystem.out.print(num[ii][i]+\" \");\n\t\t\t}\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\tsum = 0;\n\t\t\tfor(int ii=0;ii<c;ii++){\n\t\t\t\tnum[ii][i] = scan.nextInt();\n\t\t\t\tsum += num[ii][i];\n\t\t\t\tSystem.out.print(num[ii][i]+\" \");\n\t\t\t}\n\t\t\tSystem.out.println(sum);\n\t\t}",
"{\n\t\t\tsum = 0;\n\t\t\tfor(int ii=0;ii<c;ii++){\n\t\t\t\tnum[ii][i] = scan.nextInt();\n\t\t\t\tsum += num[ii][i];\n\t\t\t\tSystem.out.print(num[ii][i]+\" \");\n\t\t\t}\n\t\t\tSystem.out.println(sum);\n\t\t}",
"sum = 0",
"sum",
"0",
"for(int ii=0;ii<c;ii++){\n\t\t\t\tnum[ii][i] = scan.nextInt();\n\t\t\t\tsum += num[ii][i];\n\t\t\t\tSystem.out.print(num[ii][i]+\" \");\n\t\t\t}",
"int ii=0;",
"int ii=0;",
"ii",
"0",
"ii<c",
"ii",
"c",
"ii++",
"ii++",
"ii",
"{\n\t\t\t\tnum[ii][i] = scan.nextInt();\n\t\t\t\tsum += num[ii][i];\n\t\t\t\tSystem.out.print(num[ii][i]+\" \");\n\t\t\t}",
"{\n\t\t\t\tnum[ii][i] = scan.nextInt();\n\t\t\t\tsum += num[ii][i];\n\t\t\t\tSystem.out.print(num[ii][i]+\" \");\n\t\t\t}",
"num[ii][i] = scan.nextInt()",
"num[ii][i]",
"num[ii]",
"num",
"ii",
"i",
"scan.nextInt()",
"scan.nextInt",
"scan",
"sum += num[ii][i]",
"sum",
"num[ii][i]",
"num[ii]",
"num",
"ii",
"i",
"System.out.print(num[ii][i]+\" \")",
"System.out.print",
"System.out",
"System",
"System.out",
"num[ii][i]+\" \"",
"num[ii][i]",
"num[ii]",
"num",
"ii",
"i",
"\" \"",
"System.out.println(sum)",
"System.out.println",
"System.out",
"System",
"System.out",
"sum",
"for(int i =0; i<r; i++){\n\t\t\tfor(int ii=0;ii<c;ii++){\n\t\t\t\tsumsum[ii] += num[ii][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 ii=0;ii<c;ii++){\n\t\t\t\tsumsum[ii] += num[ii][i];\n\t\t\t}\n\t\t}",
"{\n\t\t\tfor(int ii=0;ii<c;ii++){\n\t\t\t\tsumsum[ii] += num[ii][i];\n\t\t\t}\n\t\t}",
"for(int ii=0;ii<c;ii++){\n\t\t\t\tsumsum[ii] += num[ii][i];\n\t\t\t}",
"int ii=0;",
"int ii=0;",
"ii",
"0",
"ii<c",
"ii",
"c",
"ii++",
"ii++",
"ii",
"{\n\t\t\t\tsumsum[ii] += num[ii][i];\n\t\t\t}",
"{\n\t\t\t\tsumsum[ii] += num[ii][i];\n\t\t\t}",
"sumsum[ii] += num[ii][i]",
"sumsum[ii]",
"sumsum",
"ii",
"num[ii][i]",
"num[ii]",
"num",
"ii",
"i",
"sum = 0",
"sum",
"0",
"for(int i=0; i<c; i++){\n\t\t\tsum += sumsum[i];\n\t\t\tSystem.out.print(sumsum[i]+\" \");\n\t\t}",
"int i=0;",
"int i=0;",
"i",
"0",
"i<c",
"i",
"c",
"i++",
"i++",
"i",
"{\n\t\t\tsum += sumsum[i];\n\t\t\tSystem.out.print(sumsum[i]+\" \");\n\t\t}",
"{\n\t\t\tsum += sumsum[i];\n\t\t\tSystem.out.print(sumsum[i]+\" \");\n\t\t}",
"sum += sumsum[i]",
"sum",
"sumsum[i]",
"sumsum",
"i",
"System.out.print(sumsum[i]+\" \")",
"System.out.print",
"System.out",
"System",
"System.out",
"sumsum[i]+\" \"",
"sumsum[i]",
"sumsum",
"i",
"\" \"",
"System.out.println(sum)",
"System.out.println",
"System.out",
"System",
"System.out",
"sum",
"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 r =scan.nextInt();
int c =scan.nextInt();
int num[][] = new int[100][101]; //num[???][?¨?]
int sumsum[] = new int [101];
int sum = 0;
for(int i =0; i<r; i++){
sum = 0;
for(int ii=0;ii<c;ii++){
num[ii][i] = scan.nextInt();
sum += num[ii][i];
System.out.print(num[ii][i]+" ");
}
System.out.println(sum);
}
for(int i =0; i<r; i++){
for(int ii=0;ii<c;ii++){
sumsum[ii] += num[ii][i];
}
}
sum = 0;
for(int i=0; i<c; i++){
sum += sumsum[i];
System.out.print(sumsum[i]+" ");
}
System.out.println(sum);
}
} |
[
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,
13,
1,
40,
13,
30,
30,
0,
18,
18,
13,
13,
13,
4,
18,
13,
18,
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,
14,
2,
13,
2,
18,
18,
13,
13,
13,
17,
30,
4,
18,
18,
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,
4,
18,
18,
13,
13,
2,
18,
18,
13,
13,
13,
17,
30,
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,
18,
13,
13,
13,
17,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
217,
8
],
[
217,
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
],
[
69,
77
],
[
77,
78
],
[
78,
79
],
[
69,
80
],
[
81,
81
],
[
81,
82
],
[
82,
83
],
[
83,
84
],
[
84,
85
],
[
84,
86
],
[
83,
87
],
[
82,
88
],
[
88,
89
],
[
89,
90
],
[
88,
91
],
[
91,
92
],
[
91,
93
],
[
11,
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
],
[
117,
118
],
[
117,
119
],
[
116,
120
],
[
109,
121
],
[
121,
122
],
[
122,
123
],
[
109,
124
],
[
125,
125
],
[
125,
126
],
[
126,
127
],
[
127,
128
],
[
127,
129
],
[
129,
130
],
[
130,
131
],
[
131,
132
],
[
131,
133
],
[
130,
134
],
[
129,
135
],
[
126,
136
],
[
136,
137
],
[
137,
138
],
[
138,
139
],
[
139,
140
],
[
139,
141
],
[
137,
142
],
[
142,
143
],
[
143,
144
],
[
143,
145
],
[
142,
146
],
[
126,
147
],
[
147,
148
],
[
148,
149
],
[
148,
150
],
[
150,
151
],
[
151,
152
],
[
151,
153
],
[
150,
154
],
[
147,
155
],
[
155,
156
],
[
156,
157
],
[
157,
158
],
[
158,
159
],
[
158,
160
],
[
157,
161
],
[
156,
162
],
[
162,
163
],
[
163,
164
],
[
163,
165
],
[
162,
166
],
[
155,
167
],
[
167,
168
],
[
168,
169
],
[
169,
170
],
[
169,
171
],
[
167,
172
],
[
172,
173
],
[
173,
174
],
[
174,
175
],
[
174,
176
],
[
173,
177
],
[
172,
178
],
[
147,
179
],
[
179,
180
],
[
180,
181
],
[
181,
182
],
[
182,
183
],
[
182,
184
],
[
181,
185
],
[
180,
186
],
[
186,
187
],
[
187,
188
],
[
187,
189
],
[
186,
190
],
[
179,
191
],
[
191,
192
],
[
192,
193
],
[
193,
194
],
[
193,
195
],
[
192,
196
],
[
191,
197
],
[
197,
198
],
[
198,
199
],
[
198,
200
],
[
197,
201
],
[
179,
202
],
[
202,
203
],
[
203,
204
],
[
204,
205
],
[
204,
206
],
[
202,
207
],
[
207,
208
],
[
208,
209
],
[
209,
210
],
[
209,
211
],
[
208,
212
],
[
207,
213
],
[
9,
214
],
[
214,
215
],
[
0,
216
],
[
216,
217
],
[
216,
218
]
] | [
"import java.io.BufferedReader;\nimport java.io.InputStreamReader;\n\npublic class Main {\n\n public static void main(String[] args) throws Exception {\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n String[] ar = br.readLine().split(\" \");\n int x = Integer.parseInt(ar[0]);\n int y = Integer.parseInt(ar[1]);\n int[][] list = new int[x+1][y+1];\n for(int i = 0; i < x; i++){\n ar = br.readLine().split(\" \");\n for(int j = 0; j < y; j++){\n list[i][j] = Integer.parseInt(ar[j]);\n }\n }\n for(int i = 0; i < list.length; i++){\n for(int j = 0; j < list[i].length; j++){\n if(j == list[i].length-1){\n System.out.println(list[i][j]);\n }else if(i == list.length-1){\n list[i][y] += list[i][j];\n System.out.print(list[i][j]+\" \");\n }else{\n list[i][y] += list[i][j];\n list[x][j] += list[i][j];\n System.out.print(list[i][j]+\" \");\n }\n }\n }\n }\n}",
"import java.io.BufferedReader;",
"BufferedReader",
"java.io",
"import java.io.InputStreamReader;",
"InputStreamReader",
"java.io",
"public class Main {\n\n public static void main(String[] args) throws Exception {\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n String[] ar = br.readLine().split(\" \");\n int x = Integer.parseInt(ar[0]);\n int y = Integer.parseInt(ar[1]);\n int[][] list = new int[x+1][y+1];\n for(int i = 0; i < x; i++){\n ar = br.readLine().split(\" \");\n for(int j = 0; j < y; j++){\n list[i][j] = Integer.parseInt(ar[j]);\n }\n }\n for(int i = 0; i < list.length; i++){\n for(int j = 0; j < list[i].length; j++){\n if(j == list[i].length-1){\n System.out.println(list[i][j]);\n }else if(i == list.length-1){\n list[i][y] += list[i][j];\n System.out.print(list[i][j]+\" \");\n }else{\n list[i][y] += list[i][j];\n list[x][j] += list[i][j];\n System.out.print(list[i][j]+\" \");\n }\n }\n }\n }\n}",
"Main",
"public static void main(String[] args) throws Exception {\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n String[] ar = br.readLine().split(\" \");\n int x = Integer.parseInt(ar[0]);\n int y = Integer.parseInt(ar[1]);\n int[][] list = new int[x+1][y+1];\n for(int i = 0; i < x; i++){\n ar = br.readLine().split(\" \");\n for(int j = 0; j < y; j++){\n list[i][j] = Integer.parseInt(ar[j]);\n }\n }\n for(int i = 0; i < list.length; i++){\n for(int j = 0; j < list[i].length; j++){\n if(j == list[i].length-1){\n System.out.println(list[i][j]);\n }else if(i == list.length-1){\n list[i][y] += list[i][j];\n System.out.print(list[i][j]+\" \");\n }else{\n list[i][y] += list[i][j];\n list[x][j] += list[i][j];\n System.out.print(list[i][j]+\" \");\n }\n }\n }\n }",
"main",
"{\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n String[] ar = br.readLine().split(\" \");\n int x = Integer.parseInt(ar[0]);\n int y = Integer.parseInt(ar[1]);\n int[][] list = new int[x+1][y+1];\n for(int i = 0; i < x; i++){\n ar = br.readLine().split(\" \");\n for(int j = 0; j < y; j++){\n list[i][j] = Integer.parseInt(ar[j]);\n }\n }\n for(int i = 0; i < list.length; i++){\n for(int j = 0; j < list[i].length; j++){\n if(j == list[i].length-1){\n System.out.println(list[i][j]);\n }else if(i == list.length-1){\n list[i][y] += list[i][j];\n System.out.print(list[i][j]+\" \");\n }else{\n list[i][y] += list[i][j];\n list[x][j] += list[i][j];\n System.out.print(list[i][j]+\" \");\n }\n }\n }\n }",
"BufferedReader br = new BufferedReader(new InputStreamReader(System.in));",
"br",
"new BufferedReader(new InputStreamReader(System.in))",
"String[] ar = br.readLine().split(\" \");",
"ar",
"br.readLine().split(\" \")",
"br.readLine().split",
"br.readLine()",
"br.readLine",
"br",
"\" \"",
"int x = Integer.parseInt(ar[0]);",
"x",
"Integer.parseInt(ar[0])",
"Integer.parseInt",
"Integer",
"ar[0]",
"ar",
"0",
"int y = Integer.parseInt(ar[1]);",
"y",
"Integer.parseInt(ar[1])",
"Integer.parseInt",
"Integer",
"ar[1]",
"ar",
"1",
"int[][] list = new int[x+1][y+1];",
"list",
"new int[x+1][y+1]",
"x+1",
"x",
"1",
"y+1",
"y",
"1",
"for(int i = 0; i < x; i++){\n ar = br.readLine().split(\" \");\n for(int j = 0; j < y; j++){\n list[i][j] = Integer.parseInt(ar[j]);\n }\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < x",
"i",
"x",
"i++",
"i++",
"i",
"{\n ar = br.readLine().split(\" \");\n for(int j = 0; j < y; j++){\n list[i][j] = Integer.parseInt(ar[j]);\n }\n }",
"{\n ar = br.readLine().split(\" \");\n for(int j = 0; j < y; j++){\n list[i][j] = Integer.parseInt(ar[j]);\n }\n }",
"ar = br.readLine().split(\" \")",
"ar",
"br.readLine().split(\" \")",
"br.readLine().split",
"br.readLine()",
"br.readLine",
"br",
"\" \"",
"for(int j = 0; j < y; j++){\n list[i][j] = Integer.parseInt(ar[j]);\n }",
"int j = 0;",
"int j = 0;",
"j",
"0",
"j < y",
"j",
"y",
"j++",
"j++",
"j",
"{\n list[i][j] = Integer.parseInt(ar[j]);\n }",
"{\n list[i][j] = Integer.parseInt(ar[j]);\n }",
"list[i][j] = Integer.parseInt(ar[j])",
"list[i][j]",
"list[i]",
"list",
"i",
"j",
"Integer.parseInt(ar[j])",
"Integer.parseInt",
"Integer",
"ar[j]",
"ar",
"j",
"for(int i = 0; i < list.length; i++){\n for(int j = 0; j < list[i].length; j++){\n if(j == list[i].length-1){\n System.out.println(list[i][j]);\n }else if(i == list.length-1){\n list[i][y] += list[i][j];\n System.out.print(list[i][j]+\" \");\n }else{\n list[i][y] += list[i][j];\n list[x][j] += list[i][j];\n System.out.print(list[i][j]+\" \");\n }\n }\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < list.length",
"i",
"list.length",
"list",
"list.length",
"i++",
"i++",
"i",
"{\n for(int j = 0; j < list[i].length; j++){\n if(j == list[i].length-1){\n System.out.println(list[i][j]);\n }else if(i == list.length-1){\n list[i][y] += list[i][j];\n System.out.print(list[i][j]+\" \");\n }else{\n list[i][y] += list[i][j];\n list[x][j] += list[i][j];\n System.out.print(list[i][j]+\" \");\n }\n }\n }",
"{\n for(int j = 0; j < list[i].length; j++){\n if(j == list[i].length-1){\n System.out.println(list[i][j]);\n }else if(i == list.length-1){\n list[i][y] += list[i][j];\n System.out.print(list[i][j]+\" \");\n }else{\n list[i][y] += list[i][j];\n list[x][j] += list[i][j];\n System.out.print(list[i][j]+\" \");\n }\n }\n }",
"for(int j = 0; j < list[i].length; j++){\n if(j == list[i].length-1){\n System.out.println(list[i][j]);\n }else if(i == list.length-1){\n list[i][y] += list[i][j];\n System.out.print(list[i][j]+\" \");\n }else{\n list[i][y] += list[i][j];\n list[x][j] += list[i][j];\n System.out.print(list[i][j]+\" \");\n }\n }",
"int j = 0;",
"int j = 0;",
"j",
"0",
"j < list[i].length",
"j",
"list[i].length",
"list[i]",
"list",
"i",
"list[i].length",
"j++",
"j++",
"j",
"{\n if(j == list[i].length-1){\n System.out.println(list[i][j]);\n }else if(i == list.length-1){\n list[i][y] += list[i][j];\n System.out.print(list[i][j]+\" \");\n }else{\n list[i][y] += list[i][j];\n list[x][j] += list[i][j];\n System.out.print(list[i][j]+\" \");\n }\n }",
"{\n if(j == list[i].length-1){\n System.out.println(list[i][j]);\n }else if(i == list.length-1){\n list[i][y] += list[i][j];\n System.out.print(list[i][j]+\" \");\n }else{\n list[i][y] += list[i][j];\n list[x][j] += list[i][j];\n System.out.print(list[i][j]+\" \");\n }\n }",
"if(j == list[i].length-1){\n System.out.println(list[i][j]);\n }else if(i == list.length-1){\n list[i][y] += list[i][j];\n System.out.print(list[i][j]+\" \");\n }else{\n list[i][y] += list[i][j];\n list[x][j] += list[i][j];\n System.out.print(list[i][j]+\" \");\n }",
"j == list[i].length-1",
"j",
"list[i].length-1",
"list[i].length",
"list[i]",
"list",
"i",
"list[i].length",
"1",
"{\n System.out.println(list[i][j]);\n }",
"System.out.println(list[i][j])",
"System.out.println",
"System.out",
"System",
"System.out",
"list[i][j]",
"list[i]",
"list",
"i",
"j",
"if(i == list.length-1){\n list[i][y] += list[i][j];\n System.out.print(list[i][j]+\" \");\n }else{\n list[i][y] += list[i][j];\n list[x][j] += list[i][j];\n System.out.print(list[i][j]+\" \");\n }",
"i == list.length-1",
"i",
"list.length-1",
"list.length",
"list",
"list.length",
"1",
"{\n list[i][y] += list[i][j];\n System.out.print(list[i][j]+\" \");\n }",
"list[i][y] += list[i][j]",
"list[i][y]",
"list[i]",
"list",
"i",
"y",
"list[i][j]",
"list[i]",
"list",
"i",
"j",
"System.out.print(list[i][j]+\" \")",
"System.out.print",
"System.out",
"System",
"System.out",
"list[i][j]+\" \"",
"list[i][j]",
"list[i]",
"list",
"i",
"j",
"\" \"",
"{\n list[i][y] += list[i][j];\n list[x][j] += list[i][j];\n System.out.print(list[i][j]+\" \");\n }",
"list[i][y] += list[i][j]",
"list[i][y]",
"list[i]",
"list",
"i",
"y",
"list[i][j]",
"list[i]",
"list",
"i",
"j",
"list[x][j] += list[i][j]",
"list[x][j]",
"list[x]",
"list",
"x",
"j",
"list[i][j]",
"list[i]",
"list",
"i",
"j",
"System.out.print(list[i][j]+\" \")",
"System.out.print",
"System.out",
"System",
"System.out",
"list[i][j]+\" \"",
"list[i][j]",
"list[i]",
"list",
"i",
"j",
"\" \"",
"String[] args",
"args",
"public class Main {\n\n public static void main(String[] args) throws Exception {\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n String[] ar = br.readLine().split(\" \");\n int x = Integer.parseInt(ar[0]);\n int y = Integer.parseInt(ar[1]);\n int[][] list = new int[x+1][y+1];\n for(int i = 0; i < x; i++){\n ar = br.readLine().split(\" \");\n for(int j = 0; j < y; j++){\n list[i][j] = Integer.parseInt(ar[j]);\n }\n }\n for(int i = 0; i < list.length; i++){\n for(int j = 0; j < list[i].length; j++){\n if(j == list[i].length-1){\n System.out.println(list[i][j]);\n }else if(i == list.length-1){\n list[i][y] += list[i][j];\n System.out.print(list[i][j]+\" \");\n }else{\n list[i][y] += list[i][j];\n list[x][j] += list[i][j];\n System.out.print(list[i][j]+\" \");\n }\n }\n }\n }\n}",
"public class Main {\n\n public static void main(String[] args) throws Exception {\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n String[] ar = br.readLine().split(\" \");\n int x = Integer.parseInt(ar[0]);\n int y = Integer.parseInt(ar[1]);\n int[][] list = new int[x+1][y+1];\n for(int i = 0; i < x; i++){\n ar = br.readLine().split(\" \");\n for(int j = 0; j < y; j++){\n list[i][j] = Integer.parseInt(ar[j]);\n }\n }\n for(int i = 0; i < list.length; i++){\n for(int j = 0; j < list[i].length; j++){\n if(j == list[i].length-1){\n System.out.println(list[i][j]);\n }else if(i == list.length-1){\n list[i][y] += list[i][j];\n System.out.print(list[i][j]+\" \");\n }else{\n list[i][y] += list[i][j];\n list[x][j] += list[i][j];\n System.out.print(list[i][j]+\" \");\n }\n }\n }\n }\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[] ar = br.readLine().split(" ");
int x = Integer.parseInt(ar[0]);
int y = Integer.parseInt(ar[1]);
int[][] list = new int[x+1][y+1];
for(int i = 0; i < x; i++){
ar = br.readLine().split(" ");
for(int j = 0; j < y; j++){
list[i][j] = Integer.parseInt(ar[j]);
}
}
for(int i = 0; i < list.length; i++){
for(int j = 0; j < list[i].length; j++){
if(j == list[i].length-1){
System.out.println(list[i][j]);
}else if(i == list.length-1){
list[i][y] += list[i][j];
System.out.print(list[i][j]+" ");
}else{
list[i][y] += list[i][j];
list[x][j] += list[i][j];
System.out.print(list[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,
2,
13,
17,
2,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
0,
18,
18,
13,
13,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
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,
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,
30,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
0,
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,
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,
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,
4,
18,
13,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
318,
5
],
[
318,
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
],
[
33,
34
],
[
33,
35
],
[
8,
36
],
[
36,
37
],
[
37,
38
],
[
38,
39
],
[
38,
40
],
[
36,
41
],
[
41,
42
],
[
41,
43
],
[
36,
44
],
[
44,
45
],
[
45,
46
],
[
36,
47
],
[
47,
48
],
[
48,
49
],
[
49,
50
],
[
50,
51
],
[
50,
52
],
[
49,
53
],
[
48,
54
],
[
8,
55
],
[
55,
56
],
[
56,
57
],
[
57,
58
],
[
57,
59
],
[
55,
60
],
[
60,
61
],
[
60,
62
],
[
55,
63
],
[
63,
64
],
[
64,
65
],
[
55,
66
],
[
66,
67
],
[
67,
68
],
[
68,
69
],
[
69,
70
],
[
69,
71
],
[
68,
72
],
[
67,
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
],
[
98,
99
],
[
99,
100
],
[
100,
101
],
[
101,
102
],
[
101,
103
],
[
100,
104
],
[
99,
105
],
[
105,
106
],
[
106,
107
],
[
8,
108
],
[
108,
109
],
[
109,
110
],
[
110,
111
],
[
110,
112
],
[
108,
113
],
[
113,
114
],
[
113,
115
],
[
108,
116
],
[
116,
117
],
[
117,
118
],
[
108,
119
],
[
120,
120
],
[
120,
121
],
[
121,
122
],
[
122,
123
],
[
123,
124
],
[
123,
125
],
[
121,
126
],
[
126,
127
],
[
126,
128
],
[
121,
129
],
[
129,
130
],
[
130,
131
],
[
121,
132
],
[
132,
133
],
[
133,
134
],
[
134,
135
],
[
135,
136
],
[
135,
137
],
[
134,
138
],
[
133,
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
],
[
144,
152
],
[
152,
153
],
[
153,
154
],
[
144,
155
],
[
156,
156
],
[
156,
157
],
[
157,
158
],
[
158,
159
],
[
159,
160
],
[
159,
161
],
[
157,
162
],
[
162,
163
],
[
162,
164
],
[
157,
165
],
[
165,
166
],
[
166,
167
],
[
157,
168
],
[
168,
169
],
[
169,
170
],
[
170,
171
],
[
171,
172
],
[
171,
173
],
[
170,
174
],
[
169,
175
],
[
175,
176
],
[
176,
177
],
[
176,
178
],
[
175,
179
],
[
8,
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
],
[
204,
205
],
[
205,
206
],
[
206,
207
],
[
207,
208
],
[
207,
209
],
[
206,
210
],
[
205,
211
],
[
211,
212
],
[
212,
213
],
[
212,
214
],
[
211,
215
],
[
8,
216
],
[
216,
217
],
[
217,
218
],
[
218,
219
],
[
218,
220
],
[
217,
221
],
[
216,
222
],
[
8,
223
],
[
223,
224
],
[
224,
225
],
[
225,
226
],
[
225,
227
],
[
223,
228
],
[
228,
229
],
[
228,
230
],
[
223,
231
],
[
231,
232
],
[
232,
233
],
[
223,
234
],
[
235,
235
],
[
235,
236
],
[
236,
237
],
[
237,
238
],
[
238,
239
],
[
238,
240
],
[
236,
241
],
[
241,
242
],
[
241,
243
],
[
236,
244
],
[
244,
245
],
[
245,
246
],
[
236,
247
],
[
247,
248
],
[
248,
249
],
[
249,
250
],
[
250,
251
],
[
250,
252
],
[
249,
253
],
[
248,
254
],
[
254,
255
],
[
255,
256
],
[
255,
257
],
[
254,
258
],
[
8,
259
],
[
259,
260
],
[
260,
261
],
[
261,
262
],
[
261,
263
],
[
259,
264
],
[
264,
265
],
[
264,
266
],
[
259,
267
],
[
267,
268
],
[
268,
269
],
[
259,
270
],
[
271,
271
],
[
271,
272
],
[
272,
273
],
[
273,
274
],
[
274,
275
],
[
274,
276
],
[
272,
277
],
[
277,
278
],
[
278,
279
],
[
278,
280
],
[
277,
281
],
[
271,
282
],
[
282,
283
],
[
283,
284
],
[
284,
285
],
[
284,
286
],
[
282,
287
],
[
287,
288
],
[
287,
289
],
[
282,
290
],
[
290,
291
],
[
291,
292
],
[
282,
293
],
[
293,
294
],
[
294,
295
],
[
295,
296
],
[
296,
297
],
[
296,
298
],
[
294,
299
],
[
299,
300
],
[
299,
301
],
[
301,
302
],
[
302,
303
],
[
302,
304
],
[
301,
305
],
[
271,
306
],
[
306,
307
],
[
307,
308
],
[
308,
309
],
[
308,
310
],
[
306,
311
],
[
8,
312
],
[
312,
313
],
[
313,
314
],
[
6,
315
],
[
315,
316
],
[
0,
317
],
[
317,
318
],
[
317,
319
]
] | [
"import java.util.Scanner;\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[][] A = new int[r][c];\n int[][] n = new int[r + 1][c + 1];\n\n for(int i = 0; i < r; i++)\n n[i][c] = 0;\n\n for(int i = 0; i < c; i++)\n n[r][i] = 0;\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 for(int j = 0; j < c; j++)\n n[i][j] = A[i][j];\n }\n\n for(int i = 0; i < r; i++){\n for(int j = 0; j < c; j++)\n n[i][c] += A[i][j];\n }\n\n for(int i = 0; i < c; i++){\n for(int j = 0; j < r; j++)\n n[r][i] += A[j][i];\n }\n\n n[r][c] = 0;\n for(int i = 0; i< r; i++){\n for(int j = 0; j < c; j++)\n n[r][c] += A[i][j];\n }\n\n for(int i = 0; i <= r; i++){\n System.out.print(n[i][0]);\n for(int j = 1; j <= c; j++)\n System.out.print(\" \" + n[i][j]);\n System.out.println(\"\");\n }\n\n sc.close();\n }\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n public static void main(String[] args){\n Scanner sc = new Scanner(System.in);\n\n int r = sc.nextInt();\n int c = sc.nextInt();\n\n int[][] A = new int[r][c];\n int[][] n = new int[r + 1][c + 1];\n\n for(int i = 0; i < r; i++)\n n[i][c] = 0;\n\n for(int i = 0; i < c; i++)\n n[r][i] = 0;\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 for(int j = 0; j < c; j++)\n n[i][j] = A[i][j];\n }\n\n for(int i = 0; i < r; i++){\n for(int j = 0; j < c; j++)\n n[i][c] += A[i][j];\n }\n\n for(int i = 0; i < c; i++){\n for(int j = 0; j < r; j++)\n n[r][i] += A[j][i];\n }\n\n n[r][c] = 0;\n for(int i = 0; i< r; i++){\n for(int j = 0; j < c; j++)\n n[r][c] += A[i][j];\n }\n\n for(int i = 0; i <= r; i++){\n System.out.print(n[i][0]);\n for(int j = 1; j <= c; j++)\n System.out.print(\" \" + n[i][j]);\n System.out.println(\"\");\n }\n\n sc.close();\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[][] A = new int[r][c];\n int[][] n = new int[r + 1][c + 1];\n\n for(int i = 0; i < r; i++)\n n[i][c] = 0;\n\n for(int i = 0; i < c; i++)\n n[r][i] = 0;\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 for(int j = 0; j < c; j++)\n n[i][j] = A[i][j];\n }\n\n for(int i = 0; i < r; i++){\n for(int j = 0; j < c; j++)\n n[i][c] += A[i][j];\n }\n\n for(int i = 0; i < c; i++){\n for(int j = 0; j < r; j++)\n n[r][i] += A[j][i];\n }\n\n n[r][c] = 0;\n for(int i = 0; i< r; i++){\n for(int j = 0; j < c; j++)\n n[r][c] += A[i][j];\n }\n\n for(int i = 0; i <= r; i++){\n System.out.print(n[i][0]);\n for(int j = 1; j <= c; j++)\n System.out.print(\" \" + n[i][j]);\n System.out.println(\"\");\n }\n\n sc.close();\n }",
"main",
"{\n Scanner sc = new Scanner(System.in);\n\n int r = sc.nextInt();\n int c = sc.nextInt();\n\n int[][] A = new int[r][c];\n int[][] n = new int[r + 1][c + 1];\n\n for(int i = 0; i < r; i++)\n n[i][c] = 0;\n\n for(int i = 0; i < c; i++)\n n[r][i] = 0;\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 for(int j = 0; j < c; j++)\n n[i][j] = A[i][j];\n }\n\n for(int i = 0; i < r; i++){\n for(int j = 0; j < c; j++)\n n[i][c] += A[i][j];\n }\n\n for(int i = 0; i < c; i++){\n for(int j = 0; j < r; j++)\n n[r][i] += A[j][i];\n }\n\n n[r][c] = 0;\n for(int i = 0; i< r; i++){\n for(int j = 0; j < c; j++)\n n[r][c] += A[i][j];\n }\n\n for(int i = 0; i <= r; i++){\n System.out.print(n[i][0]);\n for(int j = 1; j <= c; j++)\n System.out.print(\" \" + n[i][j]);\n System.out.println(\"\");\n }\n\n sc.close();\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[][] A = new int[r][c];",
"A",
"new int[r][c]",
"r",
"c",
"int[][] n = new int[r + 1][c + 1];",
"n",
"new int[r + 1][c + 1]",
"r + 1",
"r",
"1",
"c + 1",
"c",
"1",
"for(int i = 0; i < r; i++)\n n[i][c] = 0;",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < r",
"i",
"r",
"i++",
"i++",
"i",
"n[i][c] = 0;",
"n[i][c] = 0",
"n[i][c]",
"n[i]",
"n",
"i",
"c",
"0",
"for(int i = 0; i < c; i++)\n n[r][i] = 0;",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < c",
"i",
"c",
"i++",
"i++",
"i",
"n[r][i] = 0;",
"n[r][i] = 0",
"n[r][i]",
"n[r]",
"n",
"r",
"i",
"0",
"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",
"{\n for(int j = 0; j < c; j++)\n A[i][j] = sc.nextInt();\n }",
"{\n 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();",
"int j = 0;",
"int j = 0;",
"j",
"0",
"j < c",
"j",
"c",
"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 < r; i++){\n for(int j = 0; j < c; j++)\n n[i][j] = A[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++)\n n[i][j] = A[i][j];\n }",
"{\n for(int j = 0; j < c; j++)\n n[i][j] = A[i][j];\n }",
"for(int j = 0; j < c; j++)\n n[i][j] = A[i][j];",
"int j = 0;",
"int j = 0;",
"j",
"0",
"j < c",
"j",
"c",
"j++",
"j++",
"j",
"n[i][j] = A[i][j];",
"n[i][j] = A[i][j]",
"n[i][j]",
"n[i]",
"n",
"i",
"j",
"A[i][j]",
"A[i]",
"A",
"i",
"j",
"for(int i = 0; i < r; i++){\n for(int j = 0; j < c; j++)\n n[i][c] += A[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++)\n n[i][c] += A[i][j];\n }",
"{\n for(int j = 0; j < c; j++)\n n[i][c] += A[i][j];\n }",
"for(int j = 0; j < c; j++)\n n[i][c] += A[i][j];",
"int j = 0;",
"int j = 0;",
"j",
"0",
"j < c",
"j",
"c",
"j++",
"j++",
"j",
"n[i][c] += A[i][j];",
"n[i][c] += A[i][j]",
"n[i][c]",
"n[i]",
"n",
"i",
"c",
"A[i][j]",
"A[i]",
"A",
"i",
"j",
"for(int i = 0; i < c; i++){\n for(int j = 0; j < r; j++)\n n[r][i] += A[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++)\n n[r][i] += A[j][i];\n }",
"{\n for(int j = 0; j < r; j++)\n n[r][i] += A[j][i];\n }",
"for(int j = 0; j < r; j++)\n n[r][i] += A[j][i];",
"int j = 0;",
"int j = 0;",
"j",
"0",
"j < r",
"j",
"r",
"j++",
"j++",
"j",
"n[r][i] += A[j][i];",
"n[r][i] += A[j][i]",
"n[r][i]",
"n[r]",
"n",
"r",
"i",
"A[j][i]",
"A[j]",
"A",
"j",
"i",
"n[r][c] = 0",
"n[r][c]",
"n[r]",
"n",
"r",
"c",
"0",
"for(int i = 0; i< r; i++){\n for(int j = 0; j < c; j++)\n n[r][c] += A[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++)\n n[r][c] += A[i][j];\n }",
"{\n for(int j = 0; j < c; j++)\n n[r][c] += A[i][j];\n }",
"for(int j = 0; j < c; j++)\n n[r][c] += A[i][j];",
"int j = 0;",
"int j = 0;",
"j",
"0",
"j < c",
"j",
"c",
"j++",
"j++",
"j",
"n[r][c] += A[i][j];",
"n[r][c] += A[i][j]",
"n[r][c]",
"n[r]",
"n",
"r",
"c",
"A[i][j]",
"A[i]",
"A",
"i",
"j",
"for(int i = 0; i <= r; i++){\n System.out.print(n[i][0]);\n for(int j = 1; j <= c; j++)\n System.out.print(\" \" + n[i][j]);\n System.out.println(\"\");\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i <= r",
"i",
"r",
"i++",
"i++",
"i",
"{\n System.out.print(n[i][0]);\n for(int j = 1; j <= c; j++)\n System.out.print(\" \" + n[i][j]);\n System.out.println(\"\");\n }",
"{\n System.out.print(n[i][0]);\n for(int j = 1; j <= c; j++)\n System.out.print(\" \" + n[i][j]);\n System.out.println(\"\");\n }",
"System.out.print(n[i][0])",
"System.out.print",
"System.out",
"System",
"System.out",
"n[i][0]",
"n[i]",
"n",
"i",
"0",
"for(int j = 1; j <= c; j++)\n System.out.print(\" \" + n[i][j]);",
"int j = 1;",
"int j = 1;",
"j",
"1",
"j <= c",
"j",
"c",
"j++",
"j++",
"j",
"System.out.print(\" \" + n[i][j]);",
"System.out.print(\" \" + n[i][j])",
"System.out.print",
"System.out",
"System",
"System.out",
"\" \" + n[i][j]",
"\" \"",
"n[i][j]",
"n[i]",
"n",
"i",
"j",
"System.out.println(\"\")",
"System.out.println",
"System.out",
"System",
"System.out",
"\"\"",
"sc.close()",
"sc.close",
"sc",
"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[][] A = new int[r][c];\n int[][] n = new int[r + 1][c + 1];\n\n for(int i = 0; i < r; i++)\n n[i][c] = 0;\n\n for(int i = 0; i < c; i++)\n n[r][i] = 0;\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 for(int j = 0; j < c; j++)\n n[i][j] = A[i][j];\n }\n\n for(int i = 0; i < r; i++){\n for(int j = 0; j < c; j++)\n n[i][c] += A[i][j];\n }\n\n for(int i = 0; i < c; i++){\n for(int j = 0; j < r; j++)\n n[r][i] += A[j][i];\n }\n\n n[r][c] = 0;\n for(int i = 0; i< r; i++){\n for(int j = 0; j < c; j++)\n n[r][c] += A[i][j];\n }\n\n for(int i = 0; i <= r; i++){\n System.out.print(n[i][0]);\n for(int j = 1; j <= c; j++)\n System.out.print(\" \" + n[i][j]);\n System.out.println(\"\");\n }\n\n sc.close();\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[][] A = new int[r][c];\n int[][] n = new int[r + 1][c + 1];\n\n for(int i = 0; i < r; i++)\n n[i][c] = 0;\n\n for(int i = 0; i < c; i++)\n n[r][i] = 0;\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 for(int j = 0; j < c; j++)\n n[i][j] = A[i][j];\n }\n\n for(int i = 0; i < r; i++){\n for(int j = 0; j < c; j++)\n n[i][c] += A[i][j];\n }\n\n for(int i = 0; i < c; i++){\n for(int j = 0; j < r; j++)\n n[r][i] += A[j][i];\n }\n\n n[r][c] = 0;\n for(int i = 0; i< r; i++){\n for(int j = 0; j < c; j++)\n n[r][c] += A[i][j];\n }\n\n for(int i = 0; i <= r; i++){\n System.out.print(n[i][0]);\n for(int j = 1; j <= c; j++)\n System.out.print(\" \" + n[i][j]);\n System.out.println(\"\");\n }\n\n sc.close();\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[][] A = new int[r][c];
int[][] n = new int[r + 1][c + 1];
for(int i = 0; i < r; i++)
n[i][c] = 0;
for(int i = 0; i < c; i++)
n[r][i] = 0;
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++){
for(int j = 0; j < c; j++)
n[i][j] = A[i][j];
}
for(int i = 0; i < r; i++){
for(int j = 0; j < c; j++)
n[i][c] += A[i][j];
}
for(int i = 0; i < c; i++){
for(int j = 0; j < r; j++)
n[r][i] += A[j][i];
}
n[r][c] = 0;
for(int i = 0; i< r; i++){
for(int j = 0; j < c; j++)
n[r][c] += A[i][j];
}
for(int i = 0; i <= r; i++){
System.out.print(n[i][0]);
for(int j = 1; j <= c; j++)
System.out.print(" " + n[i][j]);
System.out.println("");
}
sc.close();
}
}
|
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
41,
13,
41,
13,
41,
13,
41,
13,
41,
13,
20,
17,
17,
41,
13,
20,
17,
41,
13,
20,
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,
11,
1,
0,
13,
17,
2,
13,
2,
13,
17,
1,
40,
13,
30,
30,
0,
18,
13,
13,
17,
11,
1,
0,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
17,
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,
0,
13,
18,
18,
13,
13,
13,
14,
2,
13,
2,
13,
17,
30,
4,
18,
18,
13,
13,
13,
0,
18,
13,
13,
13,
0,
18,
13,
13,
18,
18,
13,
13,
13,
11,
1,
0,
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
] | [
[
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
],
[
8,
15
],
[
15,
16
],
[
8,
17
],
[
17,
18
],
[
8,
19
],
[
19,
20
],
[
19,
21
],
[
8,
24
],
[
24,
25
],
[
24,
26
],
[
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
],
[
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
],
[
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
],
[
92,
94
],
[
91,
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
],
[
109,
111
],
[
108,
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
],
[
132,
133
],
[
132,
134
],
[
131,
135
],
[
130,
136
],
[
124,
137
],
[
137,
138
],
[
137,
139
],
[
139,
140
],
[
140,
141
],
[
140,
142
],
[
139,
143
],
[
124,
144
],
[
144,
145
],
[
145,
146
],
[
145,
147
],
[
147,
148
],
[
147,
149
],
[
144,
150
],
[
150,
151
],
[
151,
152
],
[
152,
153
],
[
153,
154
],
[
153,
155
],
[
151,
156
],
[
150,
157
],
[
157,
158
],
[
158,
159
],
[
158,
160
],
[
157,
161
],
[
124,
162
],
[
162,
163
],
[
163,
164
],
[
163,
165
],
[
162,
166
],
[
166,
167
],
[
167,
168
],
[
167,
169
],
[
166,
170
],
[
8,
171
],
[
171,
172
],
[
172,
173
],
[
173,
174
],
[
173,
175
],
[
171,
176
],
[
176,
177
],
[
176,
178
],
[
171,
179
],
[
179,
180
],
[
180,
181
],
[
171,
182
],
[
183,
183
],
[
183,
184
],
[
184,
185
],
[
185,
186
],
[
186,
187
],
[
186,
188
],
[
184,
189
],
[
189,
190
],
[
190,
191
],
[
190,
192
],
[
189,
193
],
[
8,
194
],
[
194,
195
],
[
195,
196
],
[
196,
197
],
[
196,
198
],
[
194,
199
],
[
199,
200
],
[
199,
201
],
[
6,
202
],
[
202,
203
]
] | [
"import java.util.Scanner;\n\nclass Main{\n public static void main(String args[]){\n int i,j,r,c,wsum;\n int [][] table = new int[101][101];\n int [] hsum = new int[101];\n Scanner sc = new Scanner(System.in);\n r = sc.nextInt();\n c = sc.nextInt();\n for(i = 0;i < r;i++){\n for(j = 0;j < c;j++){\n table[i][j] = sc.nextInt();\n }\n }\n for(i = 0;i < c + 1;i++){\n hsum[i] = 0;\n }\n for(i = 0;i < r;i++){\n wsum = 0;\n for(j = 0;j < c;j++){\n System.out.print(table[i][j] + \" \");\n wsum += table[i][j];\n if(j == c - 1){\n System.out.println(wsum);\n hsum[c] += wsum;\n }\n hsum[j] += table[i][j];\n }\n }\n for(i = 0;i < c;i++){\n System.out.print(hsum[i] + \" \");\n }\n System.out.println(hsum[i]);\n }\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"class Main{\n public static void main(String args[]){\n int i,j,r,c,wsum;\n int [][] table = new int[101][101];\n int [] hsum = new int[101];\n Scanner sc = new Scanner(System.in);\n r = sc.nextInt();\n c = sc.nextInt();\n for(i = 0;i < r;i++){\n for(j = 0;j < c;j++){\n table[i][j] = sc.nextInt();\n }\n }\n for(i = 0;i < c + 1;i++){\n hsum[i] = 0;\n }\n for(i = 0;i < r;i++){\n wsum = 0;\n for(j = 0;j < c;j++){\n System.out.print(table[i][j] + \" \");\n wsum += table[i][j];\n if(j == c - 1){\n System.out.println(wsum);\n hsum[c] += wsum;\n }\n hsum[j] += table[i][j];\n }\n }\n for(i = 0;i < c;i++){\n System.out.print(hsum[i] + \" \");\n }\n System.out.println(hsum[i]);\n }\n}",
"Main",
"public static void main(String args[]){\n int i,j,r,c,wsum;\n int [][] table = new int[101][101];\n int [] hsum = new int[101];\n Scanner sc = new Scanner(System.in);\n r = sc.nextInt();\n c = sc.nextInt();\n for(i = 0;i < r;i++){\n for(j = 0;j < c;j++){\n table[i][j] = sc.nextInt();\n }\n }\n for(i = 0;i < c + 1;i++){\n hsum[i] = 0;\n }\n for(i = 0;i < r;i++){\n wsum = 0;\n for(j = 0;j < c;j++){\n System.out.print(table[i][j] + \" \");\n wsum += table[i][j];\n if(j == c - 1){\n System.out.println(wsum);\n hsum[c] += wsum;\n }\n hsum[j] += table[i][j];\n }\n }\n for(i = 0;i < c;i++){\n System.out.print(hsum[i] + \" \");\n }\n System.out.println(hsum[i]);\n }",
"main",
"{\n int i,j,r,c,wsum;\n int [][] table = new int[101][101];\n int [] hsum = new int[101];\n Scanner sc = new Scanner(System.in);\n r = sc.nextInt();\n c = sc.nextInt();\n for(i = 0;i < r;i++){\n for(j = 0;j < c;j++){\n table[i][j] = sc.nextInt();\n }\n }\n for(i = 0;i < c + 1;i++){\n hsum[i] = 0;\n }\n for(i = 0;i < r;i++){\n wsum = 0;\n for(j = 0;j < c;j++){\n System.out.print(table[i][j] + \" \");\n wsum += table[i][j];\n if(j == c - 1){\n System.out.println(wsum);\n hsum[c] += wsum;\n }\n hsum[j] += table[i][j];\n }\n }\n for(i = 0;i < c;i++){\n System.out.print(hsum[i] + \" \");\n }\n System.out.println(hsum[i]);\n }",
"int i",
"i",
"j",
"j",
"r",
"r",
"c",
"c",
"wsum;",
"wsum",
"int [][] table = new int[101][101];",
"table",
"new int[101][101]",
"101",
"101",
"int [] hsum = new int[101];",
"hsum",
"new int[101]",
"101",
"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",
"for(i = 0;i < r;i++){\n for(j = 0;j < c;j++){\n table[i][j] = sc.nextInt();\n }\n }",
"i = 0;",
"i = 0",
"i",
"0",
"i < r",
"i",
"r",
"i++",
"i++",
"i",
"{\n for(j = 0;j < c;j++){\n table[i][j] = sc.nextInt();\n }\n }",
"{\n for(j = 0;j < c;j++){\n table[i][j] = sc.nextInt();\n }\n }",
"for(j = 0;j < c;j++){\n table[i][j] = sc.nextInt();\n }",
"j = 0;",
"j = 0",
"j",
"0",
"j < c",
"j",
"c",
"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(i = 0;i < c + 1;i++){\n hsum[i] = 0;\n }",
"i = 0;",
"i = 0",
"i",
"0",
"i < c + 1",
"i",
"c + 1",
"c",
"1",
"i++",
"i++",
"i",
"{\n hsum[i] = 0;\n }",
"{\n hsum[i] = 0;\n }",
"hsum[i] = 0",
"hsum[i]",
"hsum",
"i",
"0",
"for(i = 0;i < r;i++){\n wsum = 0;\n for(j = 0;j < c;j++){\n System.out.print(table[i][j] + \" \");\n wsum += table[i][j];\n if(j == c - 1){\n System.out.println(wsum);\n hsum[c] += wsum;\n }\n hsum[j] += table[i][j];\n }\n }",
"i = 0;",
"i = 0",
"i",
"0",
"i < r",
"i",
"r",
"i++",
"i++",
"i",
"{\n wsum = 0;\n for(j = 0;j < c;j++){\n System.out.print(table[i][j] + \" \");\n wsum += table[i][j];\n if(j == c - 1){\n System.out.println(wsum);\n hsum[c] += wsum;\n }\n hsum[j] += table[i][j];\n }\n }",
"{\n wsum = 0;\n for(j = 0;j < c;j++){\n System.out.print(table[i][j] + \" \");\n wsum += table[i][j];\n if(j == c - 1){\n System.out.println(wsum);\n hsum[c] += wsum;\n }\n hsum[j] += table[i][j];\n }\n }",
"wsum = 0",
"wsum",
"0",
"for(j = 0;j < c;j++){\n System.out.print(table[i][j] + \" \");\n wsum += table[i][j];\n if(j == c - 1){\n System.out.println(wsum);\n hsum[c] += wsum;\n }\n hsum[j] += table[i][j];\n }",
"j = 0;",
"j = 0",
"j",
"0",
"j < c",
"j",
"c",
"j++",
"j++",
"j",
"{\n System.out.print(table[i][j] + \" \");\n wsum += table[i][j];\n if(j == c - 1){\n System.out.println(wsum);\n hsum[c] += wsum;\n }\n hsum[j] += table[i][j];\n }",
"{\n System.out.print(table[i][j] + \" \");\n wsum += table[i][j];\n if(j == c - 1){\n System.out.println(wsum);\n hsum[c] += wsum;\n }\n hsum[j] += table[i][j];\n }",
"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",
"\" \"",
"wsum += table[i][j]",
"wsum",
"table[i][j]",
"table[i]",
"table",
"i",
"j",
"if(j == c - 1){\n System.out.println(wsum);\n hsum[c] += wsum;\n }",
"j == c - 1",
"j",
"c - 1",
"c",
"1",
"{\n System.out.println(wsum);\n hsum[c] += wsum;\n }",
"System.out.println(wsum)",
"System.out.println",
"System.out",
"System",
"System.out",
"wsum",
"hsum[c] += wsum",
"hsum[c]",
"hsum",
"c",
"wsum",
"hsum[j] += table[i][j]",
"hsum[j]",
"hsum",
"j",
"table[i][j]",
"table[i]",
"table",
"i",
"j",
"for(i = 0;i < c;i++){\n System.out.print(hsum[i] + \" \");\n }",
"i = 0;",
"i = 0",
"i",
"0",
"i < c",
"i",
"c",
"i++",
"i++",
"i",
"{\n System.out.print(hsum[i] + \" \");\n }",
"{\n System.out.print(hsum[i] + \" \");\n }",
"System.out.print(hsum[i] + \" \")",
"System.out.print",
"System.out",
"System",
"System.out",
"hsum[i] + \" \"",
"hsum[i]",
"hsum",
"i",
"\" \"",
"System.out.println(hsum[i])",
"System.out.println",
"System.out",
"System",
"System.out",
"hsum[i]",
"hsum",
"i",
"String args[]",
"args"
] | import java.util.Scanner;
class Main{
public static void main(String args[]){
int i,j,r,c,wsum;
int [][] table = new int[101][101];
int [] hsum = new int[101];
Scanner sc = new Scanner(System.in);
r = sc.nextInt();
c = sc.nextInt();
for(i = 0;i < r;i++){
for(j = 0;j < c;j++){
table[i][j] = sc.nextInt();
}
}
for(i = 0;i < c + 1;i++){
hsum[i] = 0;
}
for(i = 0;i < r;i++){
wsum = 0;
for(j = 0;j < c;j++){
System.out.print(table[i][j] + " ");
wsum += table[i][j];
if(j == c - 1){
System.out.println(wsum);
hsum[c] += wsum;
}
hsum[j] += table[i][j];
}
}
for(i = 0;i < c;i++){
System.out.print(hsum[i] + " ");
}
System.out.println(hsum[i]);
}
} |
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
17,
41,
13,
17,
41,
13,
41,
13,
20,
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,
18,
18,
13,
13,
13,
4,
18,
13,
14,
2,
13,
17,
30,
0,
18,
18,
13,
13,
13,
17,
0,
18,
18,
13,
13,
13,
18,
18,
13,
13,
13,
14,
2,
13,
17,
30,
0,
18,
18,
13,
13,
13,
17,
0,
18,
18,
13,
13,
13,
18,
18,
13,
13,
13,
14,
2,
13,
17,
30,
0,
18,
18,
13,
13,
13,
17,
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
],
[
206,
5
],
[
206,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
8,
15
],
[
15,
16
],
[
8,
17
],
[
17,
18
],
[
17,
19
],
[
8,
20
],
[
20,
21
],
[
20,
22
],
[
22,
23
],
[
23,
24
],
[
8,
25
],
[
25,
26
],
[
25,
27
],
[
27,
28
],
[
28,
29
],
[
8,
30
],
[
30,
31
],
[
30,
32
],
[
33,
34
],
[
33,
35
],
[
36,
37
],
[
36,
38
],
[
8,
39
],
[
39,
40
],
[
40,
41
],
[
41,
42
],
[
41,
43
],
[
39,
44
],
[
44,
45
],
[
44,
46
],
[
39,
47
],
[
47,
48
],
[
48,
49
],
[
39,
50
],
[
51,
51
],
[
51,
52
],
[
52,
53
],
[
53,
54
],
[
54,
55
],
[
54,
56
],
[
52,
57
],
[
57,
58
],
[
57,
59
],
[
52,
60
],
[
60,
61
],
[
61,
62
],
[
52,
63
],
[
64,
64
],
[
64,
65
],
[
65,
66
],
[
66,
67
],
[
67,
68
],
[
67,
69
],
[
66,
70
],
[
65,
71
],
[
71,
72
],
[
72,
73
],
[
64,
74
],
[
74,
75
],
[
75,
76
],
[
75,
77
],
[
74,
78
],
[
78,
79
],
[
79,
80
],
[
80,
81
],
[
81,
82
],
[
81,
83
],
[
80,
84
],
[
79,
85
],
[
64,
86
],
[
86,
87
],
[
87,
88
],
[
88,
89
],
[
88,
90
],
[
87,
91
],
[
86,
92
],
[
92,
93
],
[
93,
94
],
[
93,
95
],
[
92,
96
],
[
64,
97
],
[
97,
98
],
[
98,
99
],
[
98,
100
],
[
97,
101
],
[
101,
102
],
[
102,
103
],
[
103,
104
],
[
104,
105
],
[
104,
106
],
[
103,
107
],
[
102,
108
],
[
64,
109
],
[
109,
110
],
[
110,
111
],
[
111,
112
],
[
111,
113
],
[
110,
114
],
[
109,
115
],
[
115,
116
],
[
116,
117
],
[
116,
118
],
[
115,
119
],
[
51,
120
],
[
120,
121
],
[
121,
122
],
[
121,
123
],
[
120,
124
],
[
124,
125
],
[
125,
126
],
[
126,
127
],
[
127,
128
],
[
127,
129
],
[
126,
130
],
[
125,
131
],
[
51,
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
],
[
150,
151
],
[
150,
152
],
[
143,
153
],
[
153,
154
],
[
154,
155
],
[
143,
156
],
[
157,
157
],
[
157,
158
],
[
158,
159
],
[
159,
160
],
[
160,
161
],
[
160,
162
],
[
158,
163
],
[
163,
164
],
[
163,
165
],
[
165,
166
],
[
165,
167
],
[
158,
168
],
[
168,
169
],
[
169,
170
],
[
158,
171
],
[
172,
172
],
[
172,
173
],
[
173,
174
],
[
174,
175
],
[
175,
176
],
[
175,
177
],
[
173,
178
],
[
178,
179
],
[
179,
180
],
[
179,
181
],
[
178,
182
],
[
172,
183
],
[
183,
184
],
[
184,
185
],
[
184,
186
],
[
183,
187
],
[
187,
188
],
[
188,
189
],
[
189,
190
],
[
190,
191
],
[
190,
192
],
[
188,
193
],
[
157,
194
],
[
194,
195
],
[
195,
196
],
[
196,
197
],
[
196,
198
],
[
194,
199
],
[
8,
200
],
[
200,
201
],
[
201,
202
],
[
6,
203
],
[
203,
204
],
[
0,
205
],
[
205,
206
],
[
205,
207
]
] | [
"import java.util.Scanner;\n\npublic class Main {\n\n\tpublic static void main(String[] args) {\n\n\t\tint r = 0;\n\t\tint c = 0;\n\t\tint[][] sp_sheet;\n\n\t\tScanner sc= new Scanner( System.in );\n\n\n\t\tr = sc.nextInt();\n\t\tc = sc.nextInt();\n\n\t\tsp_sheet = 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\n\t\t\t\tsp_sheet[i][j] = sc.nextInt();\n\n\t\t\t\tif ( j == 0 ) {\n\t\t\t\t\tsp_sheet[i][c] = 0;\n\t\t\t\t}\n\t\t\t\tsp_sheet[i][c] += sp_sheet[i][j];\n\n\t\t\t\tif ( i == 0 ) {\n\t\t\t\t\tsp_sheet[r][j] = 0;\n\t\t\t\t}\n\t\t\t\tsp_sheet[r][j] += sp_sheet[i][j];\n\t\t\t}\n\t\t\tif ( i == 0 ) {\n\t\t\t\tsp_sheet[r][c] = 0;\n\t\t\t}\n\t\t\tsp_sheet[r][c] += sp_sheet[i][c];\n\t\t}\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\tSystem.out.print( sp_sheet[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.print( \"\\n\" );\n\t\t}\n\t\tsc.close();\n\t}\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n\n\tpublic static void main(String[] args) {\n\n\t\tint r = 0;\n\t\tint c = 0;\n\t\tint[][] sp_sheet;\n\n\t\tScanner sc= new Scanner( System.in );\n\n\n\t\tr = sc.nextInt();\n\t\tc = sc.nextInt();\n\n\t\tsp_sheet = 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\n\t\t\t\tsp_sheet[i][j] = sc.nextInt();\n\n\t\t\t\tif ( j == 0 ) {\n\t\t\t\t\tsp_sheet[i][c] = 0;\n\t\t\t\t}\n\t\t\t\tsp_sheet[i][c] += sp_sheet[i][j];\n\n\t\t\t\tif ( i == 0 ) {\n\t\t\t\t\tsp_sheet[r][j] = 0;\n\t\t\t\t}\n\t\t\t\tsp_sheet[r][j] += sp_sheet[i][j];\n\t\t\t}\n\t\t\tif ( i == 0 ) {\n\t\t\t\tsp_sheet[r][c] = 0;\n\t\t\t}\n\t\t\tsp_sheet[r][c] += sp_sheet[i][c];\n\t\t}\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\tSystem.out.print( sp_sheet[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.print( \"\\n\" );\n\t\t}\n\t\tsc.close();\n\t}\n}",
"Main",
"public static void main(String[] args) {\n\n\t\tint r = 0;\n\t\tint c = 0;\n\t\tint[][] sp_sheet;\n\n\t\tScanner sc= new Scanner( System.in );\n\n\n\t\tr = sc.nextInt();\n\t\tc = sc.nextInt();\n\n\t\tsp_sheet = 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\n\t\t\t\tsp_sheet[i][j] = sc.nextInt();\n\n\t\t\t\tif ( j == 0 ) {\n\t\t\t\t\tsp_sheet[i][c] = 0;\n\t\t\t\t}\n\t\t\t\tsp_sheet[i][c] += sp_sheet[i][j];\n\n\t\t\t\tif ( i == 0 ) {\n\t\t\t\t\tsp_sheet[r][j] = 0;\n\t\t\t\t}\n\t\t\t\tsp_sheet[r][j] += sp_sheet[i][j];\n\t\t\t}\n\t\t\tif ( i == 0 ) {\n\t\t\t\tsp_sheet[r][c] = 0;\n\t\t\t}\n\t\t\tsp_sheet[r][c] += sp_sheet[i][c];\n\t\t}\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\tSystem.out.print( sp_sheet[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.print( \"\\n\" );\n\t\t}\n\t\tsc.close();\n\t}",
"main",
"{\n\n\t\tint r = 0;\n\t\tint c = 0;\n\t\tint[][] sp_sheet;\n\n\t\tScanner sc= new Scanner( System.in );\n\n\n\t\tr = sc.nextInt();\n\t\tc = sc.nextInt();\n\n\t\tsp_sheet = 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\n\t\t\t\tsp_sheet[i][j] = sc.nextInt();\n\n\t\t\t\tif ( j == 0 ) {\n\t\t\t\t\tsp_sheet[i][c] = 0;\n\t\t\t\t}\n\t\t\t\tsp_sheet[i][c] += sp_sheet[i][j];\n\n\t\t\t\tif ( i == 0 ) {\n\t\t\t\t\tsp_sheet[r][j] = 0;\n\t\t\t\t}\n\t\t\t\tsp_sheet[r][j] += sp_sheet[i][j];\n\t\t\t}\n\t\t\tif ( i == 0 ) {\n\t\t\t\tsp_sheet[r][c] = 0;\n\t\t\t}\n\t\t\tsp_sheet[r][c] += sp_sheet[i][c];\n\t\t}\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\tSystem.out.print( sp_sheet[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.print( \"\\n\" );\n\t\t}\n\t\tsc.close();\n\t}",
"int r = 0;",
"r",
"0",
"int c = 0;",
"c",
"0",
"int[][] sp_sheet;",
"sp_sheet",
"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",
"sp_sheet = new int[r+1][c+1]",
"sp_sheet",
"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\n\t\t\t\tsp_sheet[i][j] = sc.nextInt();\n\n\t\t\t\tif ( j == 0 ) {\n\t\t\t\t\tsp_sheet[i][c] = 0;\n\t\t\t\t}\n\t\t\t\tsp_sheet[i][c] += sp_sheet[i][j];\n\n\t\t\t\tif ( i == 0 ) {\n\t\t\t\t\tsp_sheet[r][j] = 0;\n\t\t\t\t}\n\t\t\t\tsp_sheet[r][j] += sp_sheet[i][j];\n\t\t\t}\n\t\t\tif ( i == 0 ) {\n\t\t\t\tsp_sheet[r][c] = 0;\n\t\t\t}\n\t\t\tsp_sheet[r][c] += sp_sheet[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\n\t\t\t\tsp_sheet[i][j] = sc.nextInt();\n\n\t\t\t\tif ( j == 0 ) {\n\t\t\t\t\tsp_sheet[i][c] = 0;\n\t\t\t\t}\n\t\t\t\tsp_sheet[i][c] += sp_sheet[i][j];\n\n\t\t\t\tif ( i == 0 ) {\n\t\t\t\t\tsp_sheet[r][j] = 0;\n\t\t\t\t}\n\t\t\t\tsp_sheet[r][j] += sp_sheet[i][j];\n\t\t\t}\n\t\t\tif ( i == 0 ) {\n\t\t\t\tsp_sheet[r][c] = 0;\n\t\t\t}\n\t\t\tsp_sheet[r][c] += sp_sheet[i][c];\n\t\t}",
"{\n\t\t\tfor ( int j = 0 ; j < c ; j++ ) {\n\n\t\t\t\tsp_sheet[i][j] = sc.nextInt();\n\n\t\t\t\tif ( j == 0 ) {\n\t\t\t\t\tsp_sheet[i][c] = 0;\n\t\t\t\t}\n\t\t\t\tsp_sheet[i][c] += sp_sheet[i][j];\n\n\t\t\t\tif ( i == 0 ) {\n\t\t\t\t\tsp_sheet[r][j] = 0;\n\t\t\t\t}\n\t\t\t\tsp_sheet[r][j] += sp_sheet[i][j];\n\t\t\t}\n\t\t\tif ( i == 0 ) {\n\t\t\t\tsp_sheet[r][c] = 0;\n\t\t\t}\n\t\t\tsp_sheet[r][c] += sp_sheet[i][c];\n\t\t}",
"for ( int j = 0 ; j < c ; j++ ) {\n\n\t\t\t\tsp_sheet[i][j] = sc.nextInt();\n\n\t\t\t\tif ( j == 0 ) {\n\t\t\t\t\tsp_sheet[i][c] = 0;\n\t\t\t\t}\n\t\t\t\tsp_sheet[i][c] += sp_sheet[i][j];\n\n\t\t\t\tif ( i == 0 ) {\n\t\t\t\t\tsp_sheet[r][j] = 0;\n\t\t\t\t}\n\t\t\t\tsp_sheet[r][j] += sp_sheet[i][j];\n\t\t\t}",
"int j = 0 ;",
"int j = 0 ;",
"j",
"0",
"j < c",
"j",
"c",
"j++",
"j++",
"j",
"{\n\n\t\t\t\tsp_sheet[i][j] = sc.nextInt();\n\n\t\t\t\tif ( j == 0 ) {\n\t\t\t\t\tsp_sheet[i][c] = 0;\n\t\t\t\t}\n\t\t\t\tsp_sheet[i][c] += sp_sheet[i][j];\n\n\t\t\t\tif ( i == 0 ) {\n\t\t\t\t\tsp_sheet[r][j] = 0;\n\t\t\t\t}\n\t\t\t\tsp_sheet[r][j] += sp_sheet[i][j];\n\t\t\t}",
"{\n\n\t\t\t\tsp_sheet[i][j] = sc.nextInt();\n\n\t\t\t\tif ( j == 0 ) {\n\t\t\t\t\tsp_sheet[i][c] = 0;\n\t\t\t\t}\n\t\t\t\tsp_sheet[i][c] += sp_sheet[i][j];\n\n\t\t\t\tif ( i == 0 ) {\n\t\t\t\t\tsp_sheet[r][j] = 0;\n\t\t\t\t}\n\t\t\t\tsp_sheet[r][j] += sp_sheet[i][j];\n\t\t\t}",
"sp_sheet[i][j] = sc.nextInt()",
"sp_sheet[i][j]",
"sp_sheet[i]",
"sp_sheet",
"i",
"j",
"sc.nextInt()",
"sc.nextInt",
"sc",
"if ( j == 0 ) {\n\t\t\t\t\tsp_sheet[i][c] = 0;\n\t\t\t\t}",
"j == 0",
"j",
"0",
"{\n\t\t\t\t\tsp_sheet[i][c] = 0;\n\t\t\t\t}",
"sp_sheet[i][c] = 0",
"sp_sheet[i][c]",
"sp_sheet[i]",
"sp_sheet",
"i",
"c",
"0",
"sp_sheet[i][c] += sp_sheet[i][j]",
"sp_sheet[i][c]",
"sp_sheet[i]",
"sp_sheet",
"i",
"c",
"sp_sheet[i][j]",
"sp_sheet[i]",
"sp_sheet",
"i",
"j",
"if ( i == 0 ) {\n\t\t\t\t\tsp_sheet[r][j] = 0;\n\t\t\t\t}",
"i == 0",
"i",
"0",
"{\n\t\t\t\t\tsp_sheet[r][j] = 0;\n\t\t\t\t}",
"sp_sheet[r][j] = 0",
"sp_sheet[r][j]",
"sp_sheet[r]",
"sp_sheet",
"r",
"j",
"0",
"sp_sheet[r][j] += sp_sheet[i][j]",
"sp_sheet[r][j]",
"sp_sheet[r]",
"sp_sheet",
"r",
"j",
"sp_sheet[i][j]",
"sp_sheet[i]",
"sp_sheet",
"i",
"j",
"if ( i == 0 ) {\n\t\t\t\tsp_sheet[r][c] = 0;\n\t\t\t}",
"i == 0",
"i",
"0",
"{\n\t\t\t\tsp_sheet[r][c] = 0;\n\t\t\t}",
"sp_sheet[r][c] = 0",
"sp_sheet[r][c]",
"sp_sheet[r]",
"sp_sheet",
"r",
"c",
"0",
"sp_sheet[r][c] += sp_sheet[i][c]",
"sp_sheet[r][c]",
"sp_sheet[r]",
"sp_sheet",
"r",
"c",
"sp_sheet[i][c]",
"sp_sheet[i]",
"sp_sheet",
"i",
"c",
"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( sp_sheet[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.print( \"\\n\" );\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( sp_sheet[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.print( \"\\n\" );\n\t\t}",
"{\n\t\t\tfor ( int j = 0 ; j < ( c + 1 ) ; j++ ) {\n\t\t\t\tSystem.out.print( sp_sheet[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.print( \"\\n\" );\n\t\t}",
"for ( int j = 0 ; j < ( c + 1 ) ; j++ ) {\n\t\t\t\tSystem.out.print( sp_sheet[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( sp_sheet[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( sp_sheet[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( sp_sheet[i][j] )",
"System.out.print",
"System.out",
"System",
"System.out",
"sp_sheet[i][j]",
"sp_sheet[i]",
"sp_sheet",
"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.print( \"\\n\" )",
"System.out.print",
"System.out",
"System",
"System.out",
"\"\\n\"",
"sc.close()",
"sc.close",
"sc",
"String[] args",
"args",
"public class Main {\n\n\tpublic static void main(String[] args) {\n\n\t\tint r = 0;\n\t\tint c = 0;\n\t\tint[][] sp_sheet;\n\n\t\tScanner sc= new Scanner( System.in );\n\n\n\t\tr = sc.nextInt();\n\t\tc = sc.nextInt();\n\n\t\tsp_sheet = 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\n\t\t\t\tsp_sheet[i][j] = sc.nextInt();\n\n\t\t\t\tif ( j == 0 ) {\n\t\t\t\t\tsp_sheet[i][c] = 0;\n\t\t\t\t}\n\t\t\t\tsp_sheet[i][c] += sp_sheet[i][j];\n\n\t\t\t\tif ( i == 0 ) {\n\t\t\t\t\tsp_sheet[r][j] = 0;\n\t\t\t\t}\n\t\t\t\tsp_sheet[r][j] += sp_sheet[i][j];\n\t\t\t}\n\t\t\tif ( i == 0 ) {\n\t\t\t\tsp_sheet[r][c] = 0;\n\t\t\t}\n\t\t\tsp_sheet[r][c] += sp_sheet[i][c];\n\t\t}\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\tSystem.out.print( sp_sheet[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.print( \"\\n\" );\n\t\t}\n\t\tsc.close();\n\t}\n}",
"public class Main {\n\n\tpublic static void main(String[] args) {\n\n\t\tint r = 0;\n\t\tint c = 0;\n\t\tint[][] sp_sheet;\n\n\t\tScanner sc= new Scanner( System.in );\n\n\n\t\tr = sc.nextInt();\n\t\tc = sc.nextInt();\n\n\t\tsp_sheet = 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\n\t\t\t\tsp_sheet[i][j] = sc.nextInt();\n\n\t\t\t\tif ( j == 0 ) {\n\t\t\t\t\tsp_sheet[i][c] = 0;\n\t\t\t\t}\n\t\t\t\tsp_sheet[i][c] += sp_sheet[i][j];\n\n\t\t\t\tif ( i == 0 ) {\n\t\t\t\t\tsp_sheet[r][j] = 0;\n\t\t\t\t}\n\t\t\t\tsp_sheet[r][j] += sp_sheet[i][j];\n\t\t\t}\n\t\t\tif ( i == 0 ) {\n\t\t\t\tsp_sheet[r][c] = 0;\n\t\t\t}\n\t\t\tsp_sheet[r][c] += sp_sheet[i][c];\n\t\t}\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\tSystem.out.print( sp_sheet[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.print( \"\\n\" );\n\t\t}\n\t\tsc.close();\n\t}\n}",
"Main"
] | import java.util.Scanner;
public class Main {
public static void main(String[] args) {
int r = 0;
int c = 0;
int[][] sp_sheet;
Scanner sc= new Scanner( System.in );
r = sc.nextInt();
c = sc.nextInt();
sp_sheet = new int[r+1][c+1];
for( int i = 0 ; i < r ; i++ ) {
for ( int j = 0 ; j < c ; j++ ) {
sp_sheet[i][j] = sc.nextInt();
if ( j == 0 ) {
sp_sheet[i][c] = 0;
}
sp_sheet[i][c] += sp_sheet[i][j];
if ( i == 0 ) {
sp_sheet[r][j] = 0;
}
sp_sheet[r][j] += sp_sheet[i][j];
}
if ( i == 0 ) {
sp_sheet[r][c] = 0;
}
sp_sheet[r][c] += sp_sheet[i][c];
}
for( int i = 0 ; i < ( r + 1 ) ; i++ ) {
for ( int j = 0 ; j < ( c + 1 ) ; j++ ) {
System.out.print( sp_sheet[i][j] );
if ( j != c ) {
System.out.print( " " );
}
}
System.out.print( "\n" );
}
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,
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,
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,
4,
18,
13,
18,
18,
13,
13,
13,
14,
2,
13,
13,
30,
4,
18,
13,
17,
4,
18,
18,
13,
13,
13,
4,
18,
13,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
152,
5
],
[
152,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
8,
17
],
[
17,
18
],
[
17,
19
],
[
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
],
[
57,
59
],
[
59,
60
],
[
60,
61
],
[
56,
62
],
[
62,
63
],
[
63,
64
],
[
64,
65
],
[
64,
66
],
[
63,
67
],
[
62,
68
],
[
56,
69
],
[
69,
70
],
[
70,
71
],
[
71,
72
],
[
71,
73
],
[
70,
74
],
[
69,
75
],
[
56,
76
],
[
76,
77
],
[
77,
78
],
[
78,
79
],
[
78,
80
],
[
77,
81
],
[
76,
82
],
[
56,
83
],
[
83,
84
],
[
84,
85
],
[
85,
86
],
[
85,
87
],
[
84,
88
],
[
83,
89
],
[
8,
90
],
[
90,
91
],
[
91,
92
],
[
92,
93
],
[
92,
94
],
[
90,
95
],
[
95,
96
],
[
95,
97
],
[
97,
98
],
[
97,
99
],
[
90,
100
],
[
100,
101
],
[
101,
102
],
[
90,
103
],
[
104,
104
],
[
104,
105
],
[
105,
106
],
[
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
],
[
123,
126
],
[
126,
127
],
[
127,
128
],
[
127,
129
],
[
126,
130
],
[
122,
131
],
[
131,
132
],
[
132,
133
],
[
132,
134
],
[
131,
135
],
[
135,
136
],
[
136,
137
],
[
137,
138
],
[
136,
139
],
[
104,
140
],
[
140,
141
],
[
141,
142
],
[
142,
143
],
[
142,
144
],
[
140,
145
],
[
8,
146
],
[
146,
147
],
[
147,
148
],
[
6,
149
],
[
149,
150
],
[
0,
151
],
[
151,
152
],
[
151,
153
]
] | [
"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\n\t\tint r = sc.nextInt();\n\t\tint c = sc.nextInt();\n\n\t\tint[][] sheet = new int[r + 1][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\tint data = sc.nextInt();\n\t\t\t\tsheet[i][j] = data;\n\t\t\t\tsheet[i][c] += data;\n\t\t\t\tsheet[r][j] += data;\n\t\t\t\tsheet[r][c] += data;\n\t\t\t}\n\t\t}\n\n\t\tfor (int i = 0; i < r + 1; i++) {\n\t\t\tStringBuffer line = new StringBuffer();\n\t\t\tfor (int j = 0; j < c + 1; j++) {\n\t\t\t\tline.append(sheet[i][j]);\n\t\t\t\tif (j != c) {\n\t\t\t\t\tline.append(' ');\n\t\t\t\t}\n\t\t\t}\n\t\t\tSystem.out.println(line);\n\t\t}\n\n\t\tsc.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 sc = new Scanner(System.in); \n\n\t\tint r = sc.nextInt();\n\t\tint c = sc.nextInt();\n\n\t\tint[][] sheet = new int[r + 1][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\tint data = sc.nextInt();\n\t\t\t\tsheet[i][j] = data;\n\t\t\t\tsheet[i][c] += data;\n\t\t\t\tsheet[r][j] += data;\n\t\t\t\tsheet[r][c] += data;\n\t\t\t}\n\t\t}\n\n\t\tfor (int i = 0; i < r + 1; i++) {\n\t\t\tStringBuffer line = new StringBuffer();\n\t\t\tfor (int j = 0; j < c + 1; j++) {\n\t\t\t\tline.append(sheet[i][j]);\n\t\t\t\tif (j != c) {\n\t\t\t\t\tline.append(' ');\n\t\t\t\t}\n\t\t\t}\n\t\t\tSystem.out.println(line);\n\t\t}\n\n\t\tsc.close();\n\t}\n}",
"Main",
"public static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in); \n\n\t\tint r = sc.nextInt();\n\t\tint c = sc.nextInt();\n\n\t\tint[][] sheet = new int[r + 1][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\tint data = sc.nextInt();\n\t\t\t\tsheet[i][j] = data;\n\t\t\t\tsheet[i][c] += data;\n\t\t\t\tsheet[r][j] += data;\n\t\t\t\tsheet[r][c] += data;\n\t\t\t}\n\t\t}\n\n\t\tfor (int i = 0; i < r + 1; i++) {\n\t\t\tStringBuffer line = new StringBuffer();\n\t\t\tfor (int j = 0; j < c + 1; j++) {\n\t\t\t\tline.append(sheet[i][j]);\n\t\t\t\tif (j != c) {\n\t\t\t\t\tline.append(' ');\n\t\t\t\t}\n\t\t\t}\n\t\t\tSystem.out.println(line);\n\t\t}\n\n\t\tsc.close();\n\t}",
"main",
"{\n\t\tScanner sc = new Scanner(System.in); \n\n\t\tint r = sc.nextInt();\n\t\tint c = sc.nextInt();\n\n\t\tint[][] sheet = new int[r + 1][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\tint data = sc.nextInt();\n\t\t\t\tsheet[i][j] = data;\n\t\t\t\tsheet[i][c] += data;\n\t\t\t\tsheet[r][j] += data;\n\t\t\t\tsheet[r][c] += data;\n\t\t\t}\n\t\t}\n\n\t\tfor (int i = 0; i < r + 1; i++) {\n\t\t\tStringBuffer line = new StringBuffer();\n\t\t\tfor (int j = 0; j < c + 1; j++) {\n\t\t\t\tline.append(sheet[i][j]);\n\t\t\t\tif (j != c) {\n\t\t\t\t\tline.append(' ');\n\t\t\t\t}\n\t\t\t}\n\t\t\tSystem.out.println(line);\n\t\t}\n\n\t\tsc.close();\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[][] sheet = new int[r + 1][c + 1];",
"sheet",
"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\tint data = sc.nextInt();\n\t\t\t\tsheet[i][j] = data;\n\t\t\t\tsheet[i][c] += data;\n\t\t\t\tsheet[r][j] += data;\n\t\t\t\tsheet[r][c] += data;\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 data = sc.nextInt();\n\t\t\t\tsheet[i][j] = data;\n\t\t\t\tsheet[i][c] += data;\n\t\t\t\tsheet[r][j] += data;\n\t\t\t\tsheet[r][c] += data;\n\t\t\t}\n\t\t}",
"{\n\t\t\tfor (int j = 0; j < c; j++) {\n\t\t\t\tint data = sc.nextInt();\n\t\t\t\tsheet[i][j] = data;\n\t\t\t\tsheet[i][c] += data;\n\t\t\t\tsheet[r][j] += data;\n\t\t\t\tsheet[r][c] += data;\n\t\t\t}\n\t\t}",
"for (int j = 0; j < c; j++) {\n\t\t\t\tint data = sc.nextInt();\n\t\t\t\tsheet[i][j] = data;\n\t\t\t\tsheet[i][c] += data;\n\t\t\t\tsheet[r][j] += data;\n\t\t\t\tsheet[r][c] += data;\n\t\t\t}",
"int j = 0;",
"int j = 0;",
"j",
"0",
"j < c",
"j",
"c",
"j++",
"j++",
"j",
"{\n\t\t\t\tint data = sc.nextInt();\n\t\t\t\tsheet[i][j] = data;\n\t\t\t\tsheet[i][c] += data;\n\t\t\t\tsheet[r][j] += data;\n\t\t\t\tsheet[r][c] += data;\n\t\t\t}",
"{\n\t\t\t\tint data = sc.nextInt();\n\t\t\t\tsheet[i][j] = data;\n\t\t\t\tsheet[i][c] += data;\n\t\t\t\tsheet[r][j] += data;\n\t\t\t\tsheet[r][c] += data;\n\t\t\t}",
"int data = sc.nextInt();",
"data",
"sc.nextInt()",
"sc.nextInt",
"sc",
"sheet[i][j] = data",
"sheet[i][j]",
"sheet[i]",
"sheet",
"i",
"j",
"data",
"sheet[i][c] += data",
"sheet[i][c]",
"sheet[i]",
"sheet",
"i",
"c",
"data",
"sheet[r][j] += data",
"sheet[r][j]",
"sheet[r]",
"sheet",
"r",
"j",
"data",
"sheet[r][c] += data",
"sheet[r][c]",
"sheet[r]",
"sheet",
"r",
"c",
"data",
"for (int i = 0; i < r + 1; i++) {\n\t\t\tStringBuffer line = new StringBuffer();\n\t\t\tfor (int j = 0; j < c + 1; j++) {\n\t\t\t\tline.append(sheet[i][j]);\n\t\t\t\tif (j != c) {\n\t\t\t\t\tline.append(' ');\n\t\t\t\t}\n\t\t\t}\n\t\t\tSystem.out.println(line);\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\tStringBuffer line = new StringBuffer();\n\t\t\tfor (int j = 0; j < c + 1; j++) {\n\t\t\t\tline.append(sheet[i][j]);\n\t\t\t\tif (j != c) {\n\t\t\t\t\tline.append(' ');\n\t\t\t\t}\n\t\t\t}\n\t\t\tSystem.out.println(line);\n\t\t}",
"{\n\t\t\tStringBuffer line = new StringBuffer();\n\t\t\tfor (int j = 0; j < c + 1; j++) {\n\t\t\t\tline.append(sheet[i][j]);\n\t\t\t\tif (j != c) {\n\t\t\t\t\tline.append(' ');\n\t\t\t\t}\n\t\t\t}\n\t\t\tSystem.out.println(line);\n\t\t}",
"StringBuffer line = new StringBuffer();",
"line",
"new StringBuffer()",
"for (int j = 0; j < c + 1; j++) {\n\t\t\t\tline.append(sheet[i][j]);\n\t\t\t\tif (j != c) {\n\t\t\t\t\tline.append(' ');\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\tline.append(sheet[i][j]);\n\t\t\t\tif (j != c) {\n\t\t\t\t\tline.append(' ');\n\t\t\t\t}\n\t\t\t}",
"{\n\t\t\t\tline.append(sheet[i][j]);\n\t\t\t\tif (j != c) {\n\t\t\t\t\tline.append(' ');\n\t\t\t\t}\n\t\t\t}",
"line.append(sheet[i][j])",
"line.append",
"line",
"sheet[i][j]",
"sheet[i]",
"sheet",
"i",
"j",
"if (j != c) {\n\t\t\t\t\tline.append(' ');\n\t\t\t\t}",
"j != c",
"j",
"c",
"{\n\t\t\t\t\tline.append(' ');\n\t\t\t\t}",
"line.append(' ')",
"line.append",
"line",
"' '",
"System.out.println(line)",
"System.out.println",
"System.out",
"System",
"System.out",
"line",
"sc.close()",
"sc.close",
"sc",
"String[] args",
"args",
"public class Main {\n\n\tpublic static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in); \n\n\t\tint r = sc.nextInt();\n\t\tint c = sc.nextInt();\n\n\t\tint[][] sheet = new int[r + 1][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\tint data = sc.nextInt();\n\t\t\t\tsheet[i][j] = data;\n\t\t\t\tsheet[i][c] += data;\n\t\t\t\tsheet[r][j] += data;\n\t\t\t\tsheet[r][c] += data;\n\t\t\t}\n\t\t}\n\n\t\tfor (int i = 0; i < r + 1; i++) {\n\t\t\tStringBuffer line = new StringBuffer();\n\t\t\tfor (int j = 0; j < c + 1; j++) {\n\t\t\t\tline.append(sheet[i][j]);\n\t\t\t\tif (j != c) {\n\t\t\t\t\tline.append(' ');\n\t\t\t\t}\n\t\t\t}\n\t\t\tSystem.out.println(line);\n\t\t}\n\n\t\tsc.close();\n\t}\n}",
"public class Main {\n\n\tpublic static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in); \n\n\t\tint r = sc.nextInt();\n\t\tint c = sc.nextInt();\n\n\t\tint[][] sheet = new int[r + 1][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\tint data = sc.nextInt();\n\t\t\t\tsheet[i][j] = data;\n\t\t\t\tsheet[i][c] += data;\n\t\t\t\tsheet[r][j] += data;\n\t\t\t\tsheet[r][c] += data;\n\t\t\t}\n\t\t}\n\n\t\tfor (int i = 0; i < r + 1; i++) {\n\t\t\tStringBuffer line = new StringBuffer();\n\t\t\tfor (int j = 0; j < c + 1; j++) {\n\t\t\t\tline.append(sheet[i][j]);\n\t\t\t\tif (j != c) {\n\t\t\t\t\tline.append(' ');\n\t\t\t\t}\n\t\t\t}\n\t\t\tSystem.out.println(line);\n\t\t}\n\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 r = sc.nextInt();
int c = sc.nextInt();
int[][] sheet = new int[r + 1][c + 1];
for (int i = 0; i < r; i++) {
for (int j = 0; j < c; j++) {
int data = sc.nextInt();
sheet[i][j] = data;
sheet[i][c] += data;
sheet[r][j] += data;
sheet[r][c] += data;
}
}
for (int i = 0; i < r + 1; i++) {
StringBuffer line = new StringBuffer();
for (int j = 0; j < c + 1; j++) {
line.append(sheet[i][j]);
if (j != c) {
line.append(' ');
}
}
System.out.println(line);
}
sc.close();
}
} |
[
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,
41,
13,
20,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
41,
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,
4,
18,
13,
4,
18,
13,
18,
13,
13,
0,
18,
13,
13,
4,
18,
13,
18,
13,
13,
4,
18,
13,
13,
41,
13,
17,
41,
13,
17,
28,
13,
13,
30,
30,
4,
18,
18,
13,
13,
13,
14,
2,
2,
13,
2,
13,
17,
17,
30,
0,
13,
13,
4,
18,
18,
13,
13,
30,
4,
18,
18,
13,
13,
17,
40,
13,
28,
13,
13,
30,
30,
4,
18,
18,
13,
13,
2,
13,
17,
4,
18,
18,
13,
13,
13,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
182,
11
],
[
182,
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,
45
],
[
45,
46
],
[
45,
47
],
[
14,
49
],
[
49,
50
],
[
50,
51
],
[
51,
52
],
[
51,
53
],
[
49,
54
],
[
54,
55
],
[
54,
56
],
[
49,
57
],
[
57,
58
],
[
58,
59
],
[
49,
60
],
[
61,
61
],
[
61,
62
],
[
62,
63
],
[
62,
64
],
[
64,
65
],
[
65,
66
],
[
66,
67
],
[
67,
68
],
[
64,
69
],
[
61,
70
],
[
70,
71
],
[
70,
72
],
[
61,
73
],
[
73,
74
],
[
74,
75
],
[
75,
76
],
[
75,
77
],
[
73,
78
],
[
78,
79
],
[
78,
80
],
[
73,
81
],
[
81,
82
],
[
82,
83
],
[
73,
84
],
[
85,
85
],
[
85,
86
],
[
86,
87
],
[
86,
88
],
[
88,
89
],
[
89,
90
],
[
88,
91
],
[
91,
92
],
[
91,
93
],
[
85,
94
],
[
94,
95
],
[
95,
96
],
[
94,
97
],
[
97,
98
],
[
98,
99
],
[
97,
100
],
[
100,
101
],
[
100,
102
],
[
85,
103
],
[
103,
104
],
[
104,
105
],
[
104,
106
],
[
103,
107
],
[
107,
108
],
[
108,
109
],
[
107,
110
],
[
110,
111
],
[
110,
112
],
[
61,
113
],
[
113,
114
],
[
114,
115
],
[
113,
116
],
[
14,
117
],
[
117,
118
],
[
117,
119
],
[
14,
120
],
[
120,
121
],
[
120,
122
],
[
14,
123
],
[
123,
124
],
[
123,
125
],
[
123,
126
],
[
127,
127
],
[
127,
128
],
[
128,
129
],
[
129,
130
],
[
130,
131
],
[
130,
132
],
[
128,
133
],
[
127,
134
],
[
134,
135
],
[
135,
136
],
[
136,
137
],
[
136,
138
],
[
138,
139
],
[
138,
140
],
[
135,
141
],
[
134,
142
],
[
142,
143
],
[
143,
144
],
[
143,
145
],
[
142,
146
],
[
146,
147
],
[
147,
148
],
[
148,
149
],
[
148,
150
],
[
134,
151
],
[
151,
152
],
[
152,
153
],
[
153,
154
],
[
154,
155
],
[
154,
156
],
[
152,
157
],
[
127,
158
],
[
158,
159
],
[
14,
160
],
[
160,
161
],
[
160,
162
],
[
160,
163
],
[
164,
164
],
[
164,
165
],
[
165,
166
],
[
166,
167
],
[
167,
168
],
[
167,
169
],
[
165,
170
],
[
170,
171
],
[
170,
172
],
[
14,
173
],
[
173,
174
],
[
174,
175
],
[
175,
176
],
[
175,
177
],
[
173,
178
],
[
12,
179
],
[
179,
180
],
[
0,
181
],
[
181,
182
],
[
181,
183
]
] | [
"import java.io.BufferedReader;\nimport java.io.InputStreamReader;\nimport java.util.ArrayList;\n\npublic class Main {\n public static void main(String[] args) throws Exception {\n // Here your code !\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n String[] line = br.readLine().split(\" \");\n\n int num1 = Integer.parseInt(line[0]);\n int num2 = Integer.parseInt(line[1]);\n ArrayList<Integer> aryNum = new ArrayList<Integer>();\n int[] totalCol = new int[num2];\n\n for(int i = 0; i < num1; i++){\n \tString[] input = br.readLine().split(\" \");\n \tint total = 0;\n \tfor(int j = 0; j < num2; j++){\n \t\ttotal += Integer.parseInt(input[j]);\n \t\taryNum.add(Integer.parseInt(input[j]));\n \t\ttotalCol[j] += Integer.parseInt(input[j]);\n \t}\n \taryNum.add(total);\n }\n\n int count = 1;\n int lastTotal = 0;\n for(int num : aryNum){\n\n \tSystem.out.print(num);\n \tif(count % (num2 + 1) == 0){\n \t\tlastTotal += num;\n \t\tSystem.out.println();\n \t}else{\n \t\tSystem.out.print(\" \");\n \t}\n \tcount++;\n }\n\n for(int num : totalCol){\n \tSystem.out.print(num + \" \");\n }\n System.out.println(lastTotal);\n\n }\n}",
"import java.io.BufferedReader;",
"BufferedReader",
"java.io",
"import java.io.InputStreamReader;",
"InputStreamReader",
"java.io",
"import java.util.ArrayList;",
"ArrayList",
"java.util",
"public class Main {\n public static void main(String[] args) throws Exception {\n // Here your code !\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n String[] line = br.readLine().split(\" \");\n\n int num1 = Integer.parseInt(line[0]);\n int num2 = Integer.parseInt(line[1]);\n ArrayList<Integer> aryNum = new ArrayList<Integer>();\n int[] totalCol = new int[num2];\n\n for(int i = 0; i < num1; i++){\n \tString[] input = br.readLine().split(\" \");\n \tint total = 0;\n \tfor(int j = 0; j < num2; j++){\n \t\ttotal += Integer.parseInt(input[j]);\n \t\taryNum.add(Integer.parseInt(input[j]));\n \t\ttotalCol[j] += Integer.parseInt(input[j]);\n \t}\n \taryNum.add(total);\n }\n\n int count = 1;\n int lastTotal = 0;\n for(int num : aryNum){\n\n \tSystem.out.print(num);\n \tif(count % (num2 + 1) == 0){\n \t\tlastTotal += num;\n \t\tSystem.out.println();\n \t}else{\n \t\tSystem.out.print(\" \");\n \t}\n \tcount++;\n }\n\n for(int num : totalCol){\n \tSystem.out.print(num + \" \");\n }\n System.out.println(lastTotal);\n\n }\n}",
"Main",
"public static void main(String[] args) throws Exception {\n // Here your code !\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n String[] line = br.readLine().split(\" \");\n\n int num1 = Integer.parseInt(line[0]);\n int num2 = Integer.parseInt(line[1]);\n ArrayList<Integer> aryNum = new ArrayList<Integer>();\n int[] totalCol = new int[num2];\n\n for(int i = 0; i < num1; i++){\n \tString[] input = br.readLine().split(\" \");\n \tint total = 0;\n \tfor(int j = 0; j < num2; j++){\n \t\ttotal += Integer.parseInt(input[j]);\n \t\taryNum.add(Integer.parseInt(input[j]));\n \t\ttotalCol[j] += Integer.parseInt(input[j]);\n \t}\n \taryNum.add(total);\n }\n\n int count = 1;\n int lastTotal = 0;\n for(int num : aryNum){\n\n \tSystem.out.print(num);\n \tif(count % (num2 + 1) == 0){\n \t\tlastTotal += num;\n \t\tSystem.out.println();\n \t}else{\n \t\tSystem.out.print(\" \");\n \t}\n \tcount++;\n }\n\n for(int num : totalCol){\n \tSystem.out.print(num + \" \");\n }\n System.out.println(lastTotal);\n\n }",
"main",
"{\n // Here your code !\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n String[] line = br.readLine().split(\" \");\n\n int num1 = Integer.parseInt(line[0]);\n int num2 = Integer.parseInt(line[1]);\n ArrayList<Integer> aryNum = new ArrayList<Integer>();\n int[] totalCol = new int[num2];\n\n for(int i = 0; i < num1; i++){\n \tString[] input = br.readLine().split(\" \");\n \tint total = 0;\n \tfor(int j = 0; j < num2; j++){\n \t\ttotal += Integer.parseInt(input[j]);\n \t\taryNum.add(Integer.parseInt(input[j]));\n \t\ttotalCol[j] += Integer.parseInt(input[j]);\n \t}\n \taryNum.add(total);\n }\n\n int count = 1;\n int lastTotal = 0;\n for(int num : aryNum){\n\n \tSystem.out.print(num);\n \tif(count % (num2 + 1) == 0){\n \t\tlastTotal += num;\n \t\tSystem.out.println();\n \t}else{\n \t\tSystem.out.print(\" \");\n \t}\n \tcount++;\n }\n\n for(int num : totalCol){\n \tSystem.out.print(num + \" \");\n }\n System.out.println(lastTotal);\n\n }",
"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 num1 = Integer.parseInt(line[0]);",
"num1",
"Integer.parseInt(line[0])",
"Integer.parseInt",
"Integer",
"line[0]",
"line",
"0",
"int num2 = Integer.parseInt(line[1]);",
"num2",
"Integer.parseInt(line[1])",
"Integer.parseInt",
"Integer",
"line[1]",
"line",
"1",
"ArrayList<Integer> aryNum = new ArrayList<Integer>();",
"aryNum",
"new ArrayList<Integer>()",
"int[] totalCol = new int[num2];",
"totalCol",
"new int[num2]",
"num2",
"for(int i = 0; i < num1; i++){\n \tString[] input = br.readLine().split(\" \");\n \tint total = 0;\n \tfor(int j = 0; j < num2; j++){\n \t\ttotal += Integer.parseInt(input[j]);\n \t\taryNum.add(Integer.parseInt(input[j]));\n \t\ttotalCol[j] += Integer.parseInt(input[j]);\n \t}\n \taryNum.add(total);\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < num1",
"i",
"num1",
"i++",
"i++",
"i",
"{\n \tString[] input = br.readLine().split(\" \");\n \tint total = 0;\n \tfor(int j = 0; j < num2; j++){\n \t\ttotal += Integer.parseInt(input[j]);\n \t\taryNum.add(Integer.parseInt(input[j]));\n \t\ttotalCol[j] += Integer.parseInt(input[j]);\n \t}\n \taryNum.add(total);\n }",
"{\n \tString[] input = br.readLine().split(\" \");\n \tint total = 0;\n \tfor(int j = 0; j < num2; j++){\n \t\ttotal += Integer.parseInt(input[j]);\n \t\taryNum.add(Integer.parseInt(input[j]));\n \t\ttotalCol[j] += Integer.parseInt(input[j]);\n \t}\n \taryNum.add(total);\n }",
"String[] input = br.readLine().split(\" \");",
"input",
"br.readLine().split(\" \")",
"br.readLine().split",
"br.readLine()",
"br.readLine",
"br",
"\" \"",
"int total = 0;",
"total",
"0",
"for(int j = 0; j < num2; j++){\n \t\ttotal += Integer.parseInt(input[j]);\n \t\taryNum.add(Integer.parseInt(input[j]));\n \t\ttotalCol[j] += Integer.parseInt(input[j]);\n \t}",
"int j = 0;",
"int j = 0;",
"j",
"0",
"j < num2",
"j",
"num2",
"j++",
"j++",
"j",
"{\n \t\ttotal += Integer.parseInt(input[j]);\n \t\taryNum.add(Integer.parseInt(input[j]));\n \t\ttotalCol[j] += Integer.parseInt(input[j]);\n \t}",
"{\n \t\ttotal += Integer.parseInt(input[j]);\n \t\taryNum.add(Integer.parseInt(input[j]));\n \t\ttotalCol[j] += Integer.parseInt(input[j]);\n \t}",
"total += Integer.parseInt(input[j])",
"total",
"Integer.parseInt(input[j])",
"Integer.parseInt",
"Integer",
"input[j]",
"input",
"j",
"aryNum.add(Integer.parseInt(input[j]))",
"aryNum.add",
"aryNum",
"Integer.parseInt(input[j])",
"Integer.parseInt",
"Integer",
"input[j]",
"input",
"j",
"totalCol[j] += Integer.parseInt(input[j])",
"totalCol[j]",
"totalCol",
"j",
"Integer.parseInt(input[j])",
"Integer.parseInt",
"Integer",
"input[j]",
"input",
"j",
"aryNum.add(total)",
"aryNum.add",
"aryNum",
"total",
"int count = 1;",
"count",
"1",
"int lastTotal = 0;",
"lastTotal",
"0",
"for(int num : aryNum){\n\n \tSystem.out.print(num);\n \tif(count % (num2 + 1) == 0){\n \t\tlastTotal += num;\n \t\tSystem.out.println();\n \t}else{\n \t\tSystem.out.print(\" \");\n \t}\n \tcount++;\n }",
"int num",
"aryNum",
"{\n\n \tSystem.out.print(num);\n \tif(count % (num2 + 1) == 0){\n \t\tlastTotal += num;\n \t\tSystem.out.println();\n \t}else{\n \t\tSystem.out.print(\" \");\n \t}\n \tcount++;\n }",
"{\n\n \tSystem.out.print(num);\n \tif(count % (num2 + 1) == 0){\n \t\tlastTotal += num;\n \t\tSystem.out.println();\n \t}else{\n \t\tSystem.out.print(\" \");\n \t}\n \tcount++;\n }",
"System.out.print(num)",
"System.out.print",
"System.out",
"System",
"System.out",
"num",
"if(count % (num2 + 1) == 0){\n \t\tlastTotal += num;\n \t\tSystem.out.println();\n \t}else{\n \t\tSystem.out.print(\" \");\n \t}",
"count % (num2 + 1) == 0",
"count % (num2 + 1)",
"count",
"(num2 + 1)",
"num2",
"1",
"0",
"{\n \t\tlastTotal += num;\n \t\tSystem.out.println();\n \t}",
"lastTotal += num",
"lastTotal",
"num",
"System.out.println()",
"System.out.println",
"System.out",
"System",
"System.out",
"{\n \t\tSystem.out.print(\" \");\n \t}",
"System.out.print(\" \")",
"System.out.print",
"System.out",
"System",
"System.out",
"\" \"",
"count++",
"count",
"for(int num : totalCol){\n \tSystem.out.print(num + \" \");\n }",
"int num",
"totalCol",
"{\n \tSystem.out.print(num + \" \");\n }",
"{\n \tSystem.out.print(num + \" \");\n }",
"System.out.print(num + \" \")",
"System.out.print",
"System.out",
"System",
"System.out",
"num + \" \"",
"num",
"\" \"",
"System.out.println(lastTotal)",
"System.out.println",
"System.out",
"System",
"System.out",
"lastTotal",
"String[] args",
"args",
"public class Main {\n public static void main(String[] args) throws Exception {\n // Here your code !\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n String[] line = br.readLine().split(\" \");\n\n int num1 = Integer.parseInt(line[0]);\n int num2 = Integer.parseInt(line[1]);\n ArrayList<Integer> aryNum = new ArrayList<Integer>();\n int[] totalCol = new int[num2];\n\n for(int i = 0; i < num1; i++){\n \tString[] input = br.readLine().split(\" \");\n \tint total = 0;\n \tfor(int j = 0; j < num2; j++){\n \t\ttotal += Integer.parseInt(input[j]);\n \t\taryNum.add(Integer.parseInt(input[j]));\n \t\ttotalCol[j] += Integer.parseInt(input[j]);\n \t}\n \taryNum.add(total);\n }\n\n int count = 1;\n int lastTotal = 0;\n for(int num : aryNum){\n\n \tSystem.out.print(num);\n \tif(count % (num2 + 1) == 0){\n \t\tlastTotal += num;\n \t\tSystem.out.println();\n \t}else{\n \t\tSystem.out.print(\" \");\n \t}\n \tcount++;\n }\n\n for(int num : totalCol){\n \tSystem.out.print(num + \" \");\n }\n System.out.println(lastTotal);\n\n }\n}",
"public class Main {\n public static void main(String[] args) throws Exception {\n // Here your code !\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n String[] line = br.readLine().split(\" \");\n\n int num1 = Integer.parseInt(line[0]);\n int num2 = Integer.parseInt(line[1]);\n ArrayList<Integer> aryNum = new ArrayList<Integer>();\n int[] totalCol = new int[num2];\n\n for(int i = 0; i < num1; i++){\n \tString[] input = br.readLine().split(\" \");\n \tint total = 0;\n \tfor(int j = 0; j < num2; j++){\n \t\ttotal += Integer.parseInt(input[j]);\n \t\taryNum.add(Integer.parseInt(input[j]));\n \t\ttotalCol[j] += Integer.parseInt(input[j]);\n \t}\n \taryNum.add(total);\n }\n\n int count = 1;\n int lastTotal = 0;\n for(int num : aryNum){\n\n \tSystem.out.print(num);\n \tif(count % (num2 + 1) == 0){\n \t\tlastTotal += num;\n \t\tSystem.out.println();\n \t}else{\n \t\tSystem.out.print(\" \");\n \t}\n \tcount++;\n }\n\n for(int num : totalCol){\n \tSystem.out.print(num + \" \");\n }\n System.out.println(lastTotal);\n\n }\n}",
"Main"
] | import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.ArrayList;
public class Main {
public static void main(String[] args) throws Exception {
// Here your code !
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
String[] line = br.readLine().split(" ");
int num1 = Integer.parseInt(line[0]);
int num2 = Integer.parseInt(line[1]);
ArrayList<Integer> aryNum = new ArrayList<Integer>();
int[] totalCol = new int[num2];
for(int i = 0; i < num1; i++){
String[] input = br.readLine().split(" ");
int total = 0;
for(int j = 0; j < num2; j++){
total += Integer.parseInt(input[j]);
aryNum.add(Integer.parseInt(input[j]));
totalCol[j] += Integer.parseInt(input[j]);
}
aryNum.add(total);
}
int count = 1;
int lastTotal = 0;
for(int num : aryNum){
System.out.print(num);
if(count % (num2 + 1) == 0){
lastTotal += num;
System.out.println();
}else{
System.out.print(" ");
}
count++;
}
for(int num : totalCol){
System.out.print(num + " ");
}
System.out.println(lastTotal);
}
} |
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
38,
5,
13,
30,
4,
18,
18,
13,
13,
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,
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,
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,
14,
2,
13,
13,
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,
18,
18,
13,
13,
13,
0,
13,
18,
18,
13,
13,
13,
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,
18,
13,
13,
13,
18,
13,
13,
30,
11,
1,
41,
13,
17,
2,
13,
2,
13,
17,
1,
40,
13,
30,
30,
14,
2,
13,
13,
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,
18,
13,
13,
13,
18,
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,
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,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
334,
5
],
[
334,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
10,
11
],
[
10,
12
],
[
12,
13
],
[
13,
14
],
[
14,
15
],
[
15,
16
],
[
15,
17
],
[
13,
18
],
[
9,
19
],
[
19,
20
],
[
20,
21
],
[
20,
22
],
[
19,
23
],
[
23,
24
],
[
23,
25
],
[
25,
26
],
[
26,
27
],
[
27,
28
],
[
28,
29
],
[
25,
30
],
[
19,
31
],
[
31,
32
],
[
31,
33
],
[
33,
34
],
[
34,
35
],
[
33,
36
],
[
36,
37
],
[
36,
38
],
[
19,
39
],
[
39,
40
],
[
39,
41
],
[
41,
42
],
[
42,
43
],
[
41,
44
],
[
44,
45
],
[
44,
46
],
[
19,
47
],
[
47,
48
],
[
47,
49
],
[
19,
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
],
[
69,
70
],
[
70,
71
],
[
67,
72
],
[
64,
73
],
[
73,
74
],
[
74,
75
],
[
75,
76
],
[
75,
77
],
[
73,
78
],
[
78,
79
],
[
78,
80
],
[
73,
81
],
[
81,
82
],
[
82,
83
],
[
73,
84
],
[
85,
85
],
[
85,
86
],
[
86,
87
],
[
87,
88
],
[
88,
89
],
[
88,
90
],
[
87,
91
],
[
86,
92
],
[
92,
93
],
[
93,
94
],
[
92,
95
],
[
95,
96
],
[
95,
97
],
[
19,
98
],
[
98,
99
],
[
98,
100
],
[
101,
102
],
[
101,
103
],
[
104,
105
],
[
104,
106
],
[
19,
107
],
[
107,
108
],
[
107,
109
],
[
19,
111
],
[
111,
112
],
[
111,
113
],
[
19,
115
],
[
115,
116
],
[
115,
117
],
[
19,
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
],
[
134,
136
],
[
133,
137
],
[
137,
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
],
[
154,
155
],
[
154,
156
],
[
153,
157
],
[
157,
158
],
[
158,
159
],
[
159,
160
],
[
160,
161
],
[
160,
162
],
[
159,
163
],
[
158,
164
],
[
164,
165
],
[
165,
166
],
[
165,
167
],
[
164,
168
],
[
157,
169
],
[
169,
170
],
[
169,
171
],
[
171,
172
],
[
172,
173
],
[
172,
174
],
[
171,
175
],
[
153,
176
],
[
176,
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
],
[
191,
193
],
[
190,
194
],
[
194,
195
],
[
195,
196
],
[
195,
197
],
[
194,
198
],
[
189,
199
],
[
199,
200
],
[
200,
201
],
[
201,
202
],
[
201,
203
],
[
200,
204
],
[
199,
205
],
[
205,
206
],
[
205,
207
],
[
133,
208
],
[
208,
209
],
[
209,
210
],
[
210,
211
],
[
211,
212
],
[
211,
213
],
[
209,
214
],
[
214,
215
],
[
214,
216
],
[
216,
217
],
[
216,
218
],
[
209,
219
],
[
219,
220
],
[
220,
221
],
[
209,
222
],
[
223,
223
],
[
223,
224
],
[
224,
225
],
[
225,
226
],
[
225,
227
],
[
224,
228
],
[
228,
229
],
[
229,
230
],
[
230,
231
],
[
231,
232
],
[
231,
233
],
[
229,
234
],
[
234,
235
],
[
234,
236
],
[
229,
237
],
[
237,
238
],
[
238,
239
],
[
229,
240
],
[
241,
241
],
[
241,
242
],
[
242,
243
],
[
243,
244
],
[
243,
245
],
[
242,
246
],
[
246,
247
],
[
247,
248
],
[
247,
249
],
[
246,
250
],
[
241,
251
],
[
251,
252
],
[
252,
253
],
[
253,
254
],
[
253,
255
],
[
252,
256
],
[
251,
257
],
[
257,
258
],
[
257,
259
],
[
224,
260
],
[
260,
261
],
[
261,
262
],
[
262,
263
],
[
263,
264
],
[
263,
265
],
[
262,
266
],
[
261,
267
],
[
19,
268
],
[
268,
269
],
[
269,
270
],
[
270,
271
],
[
270,
272
],
[
268,
273
],
[
273,
274
],
[
273,
275
],
[
275,
276
],
[
275,
277
],
[
268,
278
],
[
278,
279
],
[
279,
280
],
[
268,
281
],
[
282,
282
],
[
282,
283
],
[
283,
284
],
[
284,
285
],
[
285,
286
],
[
285,
287
],
[
283,
288
],
[
288,
289
],
[
288,
290
],
[
290,
291
],
[
290,
292
],
[
283,
293
],
[
293,
294
],
[
294,
295
],
[
283,
296
],
[
297,
297
],
[
297,
298
],
[
298,
299
],
[
299,
300
],
[
299,
301
],
[
298,
302
],
[
302,
303
],
[
303,
304
],
[
304,
305
],
[
305,
306
],
[
305,
307
],
[
303,
308
],
[
308,
309
],
[
309,
310
],
[
310,
311
],
[
310,
312
],
[
309,
313
],
[
308,
314
],
[
298,
315
],
[
315,
316
],
[
316,
317
],
[
317,
318
],
[
318,
319
],
[
318,
320
],
[
316,
321
],
[
321,
322
],
[
322,
323
],
[
322,
324
],
[
321,
325
],
[
282,
326
],
[
326,
327
],
[
327,
328
],
[
328,
329
],
[
328,
330
],
[
6,
331
],
[
331,
332
],
[
0,
333
],
[
333,
334
],
[
333,
335
]
] | [
"import java.io.*;\n\npublic class Main{\n\tpublic static void main(String[] args){\n\t\ttry{\n\t\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\t\t\tString[] tableSize = br.readLine().split(\" \");\n\t\t\tint n = Integer.parseInt(tableSize[0]);\n\t\t\tint m = Integer.parseInt(tableSize[1]);\n\t\t\tint[][] table = new int[n][m];\n\n\t\t\tfor (int i = 0; i < n; i++){\n\t\t\t\tString[] str = br.readLine().split(\" \");\n\t\t\t\tfor(int j = 0; j < m; j++){\n\t\t\t\t\ttable[i][j] = Integer.parseInt(str[j]);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tint[][] newTable = new int[n+1][m+1];\n\t\t\tint[] sumX = new int[m];\n\t\t\tint[] sumY = new int[n];\n\t\t\tint sumAll = 0;\n\n\t\t\tfor (int x = 0; x < n+1; x++){\n\t\t\t\tif (x < n){\n\t\t\t\t\tfor (int y = 0; y < m+1; y++){\n\t\t\t\t\t\tif(y < m){\n\t\t\t\t\t\t\tnewTable[x][y] = table[x][y];\n\t\t\t\t\t\t\tsumAll += newTable[x][y];\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\tfor (int a = 0; a < m; a++){\n\t\t\t\t\t\t\t\tsumY[x] += table[x][a];\n\t\t\t\t\t\t\t\tnewTable[x][y] = sumY[x];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}else{\n\t\t\t\t\tfor (int z = 0; z < m+1; z++){\n\t\t\t\t\t\tif (z < m){\n\t\t\t\t\t\t\tfor (int b = 0; b < n; b++){\n\t\t\t\t\t\t\tsumX[z] += table[b][z];\n\t\t\t\t\t\t\tnewTable[x][z] = sumX[z];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\tnewTable[x][z] = sumAll;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tfor (int s = 0; s < n+1; s++){\n\t\t\t\tfor (int t = 0; t < m+1; t++){\n\t\t\t\t\tif (t < m ){\n\t\t\t\t\t\tSystem.out.print(newTable[s][t] + \" \");\n\t\t\t\t\t}else{\n\t\t\t\t\t\tSystem.out.print(newTable[s][t]);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tSystem.out.println();\n\t\t\t}\n\t\t}catch(IOException e){\n\t\tSystem.out.println(e);\n\t\t}\n\t}\n}",
"import java.io.*;",
"io.*",
"java",
"public class Main{\n\tpublic static void main(String[] args){\n\t\ttry{\n\t\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\t\t\tString[] tableSize = br.readLine().split(\" \");\n\t\t\tint n = Integer.parseInt(tableSize[0]);\n\t\t\tint m = Integer.parseInt(tableSize[1]);\n\t\t\tint[][] table = new int[n][m];\n\n\t\t\tfor (int i = 0; i < n; i++){\n\t\t\t\tString[] str = br.readLine().split(\" \");\n\t\t\t\tfor(int j = 0; j < m; j++){\n\t\t\t\t\ttable[i][j] = Integer.parseInt(str[j]);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tint[][] newTable = new int[n+1][m+1];\n\t\t\tint[] sumX = new int[m];\n\t\t\tint[] sumY = new int[n];\n\t\t\tint sumAll = 0;\n\n\t\t\tfor (int x = 0; x < n+1; x++){\n\t\t\t\tif (x < n){\n\t\t\t\t\tfor (int y = 0; y < m+1; y++){\n\t\t\t\t\t\tif(y < m){\n\t\t\t\t\t\t\tnewTable[x][y] = table[x][y];\n\t\t\t\t\t\t\tsumAll += newTable[x][y];\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\tfor (int a = 0; a < m; a++){\n\t\t\t\t\t\t\t\tsumY[x] += table[x][a];\n\t\t\t\t\t\t\t\tnewTable[x][y] = sumY[x];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}else{\n\t\t\t\t\tfor (int z = 0; z < m+1; z++){\n\t\t\t\t\t\tif (z < m){\n\t\t\t\t\t\t\tfor (int b = 0; b < n; b++){\n\t\t\t\t\t\t\tsumX[z] += table[b][z];\n\t\t\t\t\t\t\tnewTable[x][z] = sumX[z];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\tnewTable[x][z] = sumAll;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tfor (int s = 0; s < n+1; s++){\n\t\t\t\tfor (int t = 0; t < m+1; t++){\n\t\t\t\t\tif (t < m ){\n\t\t\t\t\t\tSystem.out.print(newTable[s][t] + \" \");\n\t\t\t\t\t}else{\n\t\t\t\t\t\tSystem.out.print(newTable[s][t]);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tSystem.out.println();\n\t\t\t}\n\t\t}catch(IOException e){\n\t\tSystem.out.println(e);\n\t\t}\n\t}\n}",
"Main",
"public static void main(String[] args){\n\t\ttry{\n\t\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\t\t\tString[] tableSize = br.readLine().split(\" \");\n\t\t\tint n = Integer.parseInt(tableSize[0]);\n\t\t\tint m = Integer.parseInt(tableSize[1]);\n\t\t\tint[][] table = new int[n][m];\n\n\t\t\tfor (int i = 0; i < n; i++){\n\t\t\t\tString[] str = br.readLine().split(\" \");\n\t\t\t\tfor(int j = 0; j < m; j++){\n\t\t\t\t\ttable[i][j] = Integer.parseInt(str[j]);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tint[][] newTable = new int[n+1][m+1];\n\t\t\tint[] sumX = new int[m];\n\t\t\tint[] sumY = new int[n];\n\t\t\tint sumAll = 0;\n\n\t\t\tfor (int x = 0; x < n+1; x++){\n\t\t\t\tif (x < n){\n\t\t\t\t\tfor (int y = 0; y < m+1; y++){\n\t\t\t\t\t\tif(y < m){\n\t\t\t\t\t\t\tnewTable[x][y] = table[x][y];\n\t\t\t\t\t\t\tsumAll += newTable[x][y];\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\tfor (int a = 0; a < m; a++){\n\t\t\t\t\t\t\t\tsumY[x] += table[x][a];\n\t\t\t\t\t\t\t\tnewTable[x][y] = sumY[x];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}else{\n\t\t\t\t\tfor (int z = 0; z < m+1; z++){\n\t\t\t\t\t\tif (z < m){\n\t\t\t\t\t\t\tfor (int b = 0; b < n; b++){\n\t\t\t\t\t\t\tsumX[z] += table[b][z];\n\t\t\t\t\t\t\tnewTable[x][z] = sumX[z];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\tnewTable[x][z] = sumAll;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tfor (int s = 0; s < n+1; s++){\n\t\t\t\tfor (int t = 0; t < m+1; t++){\n\t\t\t\t\tif (t < m ){\n\t\t\t\t\t\tSystem.out.print(newTable[s][t] + \" \");\n\t\t\t\t\t}else{\n\t\t\t\t\t\tSystem.out.print(newTable[s][t]);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tSystem.out.println();\n\t\t\t}\n\t\t}catch(IOException e){\n\t\tSystem.out.println(e);\n\t\t}\n\t}",
"main",
"{\n\t\ttry{\n\t\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\t\t\tString[] tableSize = br.readLine().split(\" \");\n\t\t\tint n = Integer.parseInt(tableSize[0]);\n\t\t\tint m = Integer.parseInt(tableSize[1]);\n\t\t\tint[][] table = new int[n][m];\n\n\t\t\tfor (int i = 0; i < n; i++){\n\t\t\t\tString[] str = br.readLine().split(\" \");\n\t\t\t\tfor(int j = 0; j < m; j++){\n\t\t\t\t\ttable[i][j] = Integer.parseInt(str[j]);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tint[][] newTable = new int[n+1][m+1];\n\t\t\tint[] sumX = new int[m];\n\t\t\tint[] sumY = new int[n];\n\t\t\tint sumAll = 0;\n\n\t\t\tfor (int x = 0; x < n+1; x++){\n\t\t\t\tif (x < n){\n\t\t\t\t\tfor (int y = 0; y < m+1; y++){\n\t\t\t\t\t\tif(y < m){\n\t\t\t\t\t\t\tnewTable[x][y] = table[x][y];\n\t\t\t\t\t\t\tsumAll += newTable[x][y];\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\tfor (int a = 0; a < m; a++){\n\t\t\t\t\t\t\t\tsumY[x] += table[x][a];\n\t\t\t\t\t\t\t\tnewTable[x][y] = sumY[x];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}else{\n\t\t\t\t\tfor (int z = 0; z < m+1; z++){\n\t\t\t\t\t\tif (z < m){\n\t\t\t\t\t\t\tfor (int b = 0; b < n; b++){\n\t\t\t\t\t\t\tsumX[z] += table[b][z];\n\t\t\t\t\t\t\tnewTable[x][z] = sumX[z];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\tnewTable[x][z] = sumAll;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tfor (int s = 0; s < n+1; s++){\n\t\t\t\tfor (int t = 0; t < m+1; t++){\n\t\t\t\t\tif (t < m ){\n\t\t\t\t\t\tSystem.out.print(newTable[s][t] + \" \");\n\t\t\t\t\t}else{\n\t\t\t\t\t\tSystem.out.print(newTable[s][t]);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tSystem.out.println();\n\t\t\t}\n\t\t}catch(IOException e){\n\t\tSystem.out.println(e);\n\t\t}\n\t}",
"try{\n\t\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\t\t\tString[] tableSize = br.readLine().split(\" \");\n\t\t\tint n = Integer.parseInt(tableSize[0]);\n\t\t\tint m = Integer.parseInt(tableSize[1]);\n\t\t\tint[][] table = new int[n][m];\n\n\t\t\tfor (int i = 0; i < n; i++){\n\t\t\t\tString[] str = br.readLine().split(\" \");\n\t\t\t\tfor(int j = 0; j < m; j++){\n\t\t\t\t\ttable[i][j] = Integer.parseInt(str[j]);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tint[][] newTable = new int[n+1][m+1];\n\t\t\tint[] sumX = new int[m];\n\t\t\tint[] sumY = new int[n];\n\t\t\tint sumAll = 0;\n\n\t\t\tfor (int x = 0; x < n+1; x++){\n\t\t\t\tif (x < n){\n\t\t\t\t\tfor (int y = 0; y < m+1; y++){\n\t\t\t\t\t\tif(y < m){\n\t\t\t\t\t\t\tnewTable[x][y] = table[x][y];\n\t\t\t\t\t\t\tsumAll += newTable[x][y];\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\tfor (int a = 0; a < m; a++){\n\t\t\t\t\t\t\t\tsumY[x] += table[x][a];\n\t\t\t\t\t\t\t\tnewTable[x][y] = sumY[x];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}else{\n\t\t\t\t\tfor (int z = 0; z < m+1; z++){\n\t\t\t\t\t\tif (z < m){\n\t\t\t\t\t\t\tfor (int b = 0; b < n; b++){\n\t\t\t\t\t\t\tsumX[z] += table[b][z];\n\t\t\t\t\t\t\tnewTable[x][z] = sumX[z];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\tnewTable[x][z] = sumAll;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tfor (int s = 0; s < n+1; s++){\n\t\t\t\tfor (int t = 0; t < m+1; t++){\n\t\t\t\t\tif (t < m ){\n\t\t\t\t\t\tSystem.out.print(newTable[s][t] + \" \");\n\t\t\t\t\t}else{\n\t\t\t\t\t\tSystem.out.print(newTable[s][t]);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tSystem.out.println();\n\t\t\t}\n\t\t}catch(IOException e){\n\t\tSystem.out.println(e);\n\t\t}",
"catch(IOException e){\n\t\tSystem.out.println(e);\n\t\t}",
"IOException e",
"{\n\t\tSystem.out.println(e);\n\t\t}",
"System.out.println(e)",
"System.out.println",
"System.out",
"System",
"System.out",
"e",
"{\n\t\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\t\t\tString[] tableSize = br.readLine().split(\" \");\n\t\t\tint n = Integer.parseInt(tableSize[0]);\n\t\t\tint m = Integer.parseInt(tableSize[1]);\n\t\t\tint[][] table = new int[n][m];\n\n\t\t\tfor (int i = 0; i < n; i++){\n\t\t\t\tString[] str = br.readLine().split(\" \");\n\t\t\t\tfor(int j = 0; j < m; j++){\n\t\t\t\t\ttable[i][j] = Integer.parseInt(str[j]);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tint[][] newTable = new int[n+1][m+1];\n\t\t\tint[] sumX = new int[m];\n\t\t\tint[] sumY = new int[n];\n\t\t\tint sumAll = 0;\n\n\t\t\tfor (int x = 0; x < n+1; x++){\n\t\t\t\tif (x < n){\n\t\t\t\t\tfor (int y = 0; y < m+1; y++){\n\t\t\t\t\t\tif(y < m){\n\t\t\t\t\t\t\tnewTable[x][y] = table[x][y];\n\t\t\t\t\t\t\tsumAll += newTable[x][y];\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\tfor (int a = 0; a < m; a++){\n\t\t\t\t\t\t\t\tsumY[x] += table[x][a];\n\t\t\t\t\t\t\t\tnewTable[x][y] = sumY[x];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}else{\n\t\t\t\t\tfor (int z = 0; z < m+1; z++){\n\t\t\t\t\t\tif (z < m){\n\t\t\t\t\t\t\tfor (int b = 0; b < n; b++){\n\t\t\t\t\t\t\tsumX[z] += table[b][z];\n\t\t\t\t\t\t\tnewTable[x][z] = sumX[z];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\tnewTable[x][z] = sumAll;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tfor (int s = 0; s < n+1; s++){\n\t\t\t\tfor (int t = 0; t < m+1; t++){\n\t\t\t\t\tif (t < m ){\n\t\t\t\t\t\tSystem.out.print(newTable[s][t] + \" \");\n\t\t\t\t\t}else{\n\t\t\t\t\t\tSystem.out.print(newTable[s][t]);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tSystem.out.println();\n\t\t\t}\n\t\t}",
"BufferedReader br = new BufferedReader(new InputStreamReader(System.in));",
"br",
"new BufferedReader(new InputStreamReader(System.in))",
"String[] tableSize = br.readLine().split(\" \");",
"tableSize",
"br.readLine().split(\" \")",
"br.readLine().split",
"br.readLine()",
"br.readLine",
"br",
"\" \"",
"int n = Integer.parseInt(tableSize[0]);",
"n",
"Integer.parseInt(tableSize[0])",
"Integer.parseInt",
"Integer",
"tableSize[0]",
"tableSize",
"0",
"int m = Integer.parseInt(tableSize[1]);",
"m",
"Integer.parseInt(tableSize[1])",
"Integer.parseInt",
"Integer",
"tableSize[1]",
"tableSize",
"1",
"int[][] table = new int[n][m];",
"table",
"new int[n][m]",
"n",
"m",
"for (int i = 0; i < n; i++){\n\t\t\t\tString[] str = br.readLine().split(\" \");\n\t\t\t\tfor(int j = 0; j < m; j++){\n\t\t\t\t\ttable[i][j] = Integer.parseInt(str[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\tString[] str = br.readLine().split(\" \");\n\t\t\t\tfor(int j = 0; j < m; j++){\n\t\t\t\t\ttable[i][j] = Integer.parseInt(str[j]);\n\t\t\t\t}\n\t\t\t}",
"{\n\t\t\t\tString[] str = br.readLine().split(\" \");\n\t\t\t\tfor(int j = 0; j < m; j++){\n\t\t\t\t\ttable[i][j] = Integer.parseInt(str[j]);\n\t\t\t\t}\n\t\t\t}",
"String[] str = br.readLine().split(\" \");",
"str",
"br.readLine().split(\" \")",
"br.readLine().split",
"br.readLine()",
"br.readLine",
"br",
"\" \"",
"for(int j = 0; j < m; j++){\n\t\t\t\t\ttable[i][j] = Integer.parseInt(str[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\ttable[i][j] = Integer.parseInt(str[j]);\n\t\t\t\t}",
"{\n\t\t\t\t\ttable[i][j] = Integer.parseInt(str[j]);\n\t\t\t\t}",
"table[i][j] = Integer.parseInt(str[j])",
"table[i][j]",
"table[i]",
"table",
"i",
"j",
"Integer.parseInt(str[j])",
"Integer.parseInt",
"Integer",
"str[j]",
"str",
"j",
"int[][] newTable = new int[n+1][m+1];",
"newTable",
"new int[n+1][m+1]",
"n+1",
"n",
"1",
"m+1",
"m",
"1",
"int[] sumX = new int[m];",
"sumX",
"new int[m]",
"m",
"int[] sumY = new int[n];",
"sumY",
"new int[n]",
"n",
"int sumAll = 0;",
"sumAll",
"0",
"for (int x = 0; x < n+1; x++){\n\t\t\t\tif (x < n){\n\t\t\t\t\tfor (int y = 0; y < m+1; y++){\n\t\t\t\t\t\tif(y < m){\n\t\t\t\t\t\t\tnewTable[x][y] = table[x][y];\n\t\t\t\t\t\t\tsumAll += newTable[x][y];\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\tfor (int a = 0; a < m; a++){\n\t\t\t\t\t\t\t\tsumY[x] += table[x][a];\n\t\t\t\t\t\t\t\tnewTable[x][y] = sumY[x];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}else{\n\t\t\t\t\tfor (int z = 0; z < m+1; z++){\n\t\t\t\t\t\tif (z < m){\n\t\t\t\t\t\t\tfor (int b = 0; b < n; b++){\n\t\t\t\t\t\t\tsumX[z] += table[b][z];\n\t\t\t\t\t\t\tnewTable[x][z] = sumX[z];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\tnewTable[x][z] = sumAll;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}",
"int x = 0;",
"int x = 0;",
"x",
"0",
"x < n+1",
"x",
"n+1",
"n",
"1",
"x++",
"x++",
"x",
"{\n\t\t\t\tif (x < n){\n\t\t\t\t\tfor (int y = 0; y < m+1; y++){\n\t\t\t\t\t\tif(y < m){\n\t\t\t\t\t\t\tnewTable[x][y] = table[x][y];\n\t\t\t\t\t\t\tsumAll += newTable[x][y];\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\tfor (int a = 0; a < m; a++){\n\t\t\t\t\t\t\t\tsumY[x] += table[x][a];\n\t\t\t\t\t\t\t\tnewTable[x][y] = sumY[x];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}else{\n\t\t\t\t\tfor (int z = 0; z < m+1; z++){\n\t\t\t\t\t\tif (z < m){\n\t\t\t\t\t\t\tfor (int b = 0; b < n; b++){\n\t\t\t\t\t\t\tsumX[z] += table[b][z];\n\t\t\t\t\t\t\tnewTable[x][z] = sumX[z];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\tnewTable[x][z] = sumAll;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}",
"{\n\t\t\t\tif (x < n){\n\t\t\t\t\tfor (int y = 0; y < m+1; y++){\n\t\t\t\t\t\tif(y < m){\n\t\t\t\t\t\t\tnewTable[x][y] = table[x][y];\n\t\t\t\t\t\t\tsumAll += newTable[x][y];\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\tfor (int a = 0; a < m; a++){\n\t\t\t\t\t\t\t\tsumY[x] += table[x][a];\n\t\t\t\t\t\t\t\tnewTable[x][y] = sumY[x];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}else{\n\t\t\t\t\tfor (int z = 0; z < m+1; z++){\n\t\t\t\t\t\tif (z < m){\n\t\t\t\t\t\t\tfor (int b = 0; b < n; b++){\n\t\t\t\t\t\t\tsumX[z] += table[b][z];\n\t\t\t\t\t\t\tnewTable[x][z] = sumX[z];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\tnewTable[x][z] = sumAll;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}",
"if (x < n){\n\t\t\t\t\tfor (int y = 0; y < m+1; y++){\n\t\t\t\t\t\tif(y < m){\n\t\t\t\t\t\t\tnewTable[x][y] = table[x][y];\n\t\t\t\t\t\t\tsumAll += newTable[x][y];\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\tfor (int a = 0; a < m; a++){\n\t\t\t\t\t\t\t\tsumY[x] += table[x][a];\n\t\t\t\t\t\t\t\tnewTable[x][y] = sumY[x];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}else{\n\t\t\t\t\tfor (int z = 0; z < m+1; z++){\n\t\t\t\t\t\tif (z < m){\n\t\t\t\t\t\t\tfor (int b = 0; b < n; b++){\n\t\t\t\t\t\t\tsumX[z] += table[b][z];\n\t\t\t\t\t\t\tnewTable[x][z] = sumX[z];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\tnewTable[x][z] = sumAll;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}",
"x < n",
"x",
"n",
"{\n\t\t\t\t\tfor (int y = 0; y < m+1; y++){\n\t\t\t\t\t\tif(y < m){\n\t\t\t\t\t\t\tnewTable[x][y] = table[x][y];\n\t\t\t\t\t\t\tsumAll += newTable[x][y];\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\tfor (int a = 0; a < m; a++){\n\t\t\t\t\t\t\t\tsumY[x] += table[x][a];\n\t\t\t\t\t\t\t\tnewTable[x][y] = sumY[x];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}",
"for (int y = 0; y < m+1; y++){\n\t\t\t\t\t\tif(y < m){\n\t\t\t\t\t\t\tnewTable[x][y] = table[x][y];\n\t\t\t\t\t\t\tsumAll += newTable[x][y];\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\tfor (int a = 0; a < m; a++){\n\t\t\t\t\t\t\t\tsumY[x] += table[x][a];\n\t\t\t\t\t\t\t\tnewTable[x][y] = sumY[x];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}",
"int y = 0;",
"int y = 0;",
"y",
"0",
"y < m+1",
"y",
"m+1",
"m",
"1",
"y++",
"y++",
"y",
"{\n\t\t\t\t\t\tif(y < m){\n\t\t\t\t\t\t\tnewTable[x][y] = table[x][y];\n\t\t\t\t\t\t\tsumAll += newTable[x][y];\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\tfor (int a = 0; a < m; a++){\n\t\t\t\t\t\t\t\tsumY[x] += table[x][a];\n\t\t\t\t\t\t\t\tnewTable[x][y] = sumY[x];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}",
"{\n\t\t\t\t\t\tif(y < m){\n\t\t\t\t\t\t\tnewTable[x][y] = table[x][y];\n\t\t\t\t\t\t\tsumAll += newTable[x][y];\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\tfor (int a = 0; a < m; a++){\n\t\t\t\t\t\t\t\tsumY[x] += table[x][a];\n\t\t\t\t\t\t\t\tnewTable[x][y] = sumY[x];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}",
"if(y < m){\n\t\t\t\t\t\t\tnewTable[x][y] = table[x][y];\n\t\t\t\t\t\t\tsumAll += newTable[x][y];\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\tfor (int a = 0; a < m; a++){\n\t\t\t\t\t\t\t\tsumY[x] += table[x][a];\n\t\t\t\t\t\t\t\tnewTable[x][y] = sumY[x];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}",
"y < m",
"y",
"m",
"{\n\t\t\t\t\t\t\tnewTable[x][y] = table[x][y];\n\t\t\t\t\t\t\tsumAll += newTable[x][y];\n\t\t\t\t\t\t}",
"newTable[x][y] = table[x][y]",
"newTable[x][y]",
"newTable[x]",
"newTable",
"x",
"y",
"table[x][y]",
"table[x]",
"table",
"x",
"y",
"sumAll += newTable[x][y]",
"sumAll",
"newTable[x][y]",
"newTable[x]",
"newTable",
"x",
"y",
"{\n\t\t\t\t\t\t\tfor (int a = 0; a < m; a++){\n\t\t\t\t\t\t\t\tsumY[x] += table[x][a];\n\t\t\t\t\t\t\t\tnewTable[x][y] = sumY[x];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}",
"for (int a = 0; a < m; a++){\n\t\t\t\t\t\t\t\tsumY[x] += table[x][a];\n\t\t\t\t\t\t\t\tnewTable[x][y] = sumY[x];\n\t\t\t\t\t\t\t}",
"int a = 0;",
"int a = 0;",
"a",
"0",
"a < m",
"a",
"m",
"a++",
"a++",
"a",
"{\n\t\t\t\t\t\t\t\tsumY[x] += table[x][a];\n\t\t\t\t\t\t\t\tnewTable[x][y] = sumY[x];\n\t\t\t\t\t\t\t}",
"{\n\t\t\t\t\t\t\t\tsumY[x] += table[x][a];\n\t\t\t\t\t\t\t\tnewTable[x][y] = sumY[x];\n\t\t\t\t\t\t\t}",
"sumY[x] += table[x][a]",
"sumY[x]",
"sumY",
"x",
"table[x][a]",
"table[x]",
"table",
"x",
"a",
"newTable[x][y] = sumY[x]",
"newTable[x][y]",
"newTable[x]",
"newTable",
"x",
"y",
"sumY[x]",
"sumY",
"x",
"{\n\t\t\t\t\tfor (int z = 0; z < m+1; z++){\n\t\t\t\t\t\tif (z < m){\n\t\t\t\t\t\t\tfor (int b = 0; b < n; b++){\n\t\t\t\t\t\t\tsumX[z] += table[b][z];\n\t\t\t\t\t\t\tnewTable[x][z] = sumX[z];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\tnewTable[x][z] = sumAll;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}",
"for (int z = 0; z < m+1; z++){\n\t\t\t\t\t\tif (z < m){\n\t\t\t\t\t\t\tfor (int b = 0; b < n; b++){\n\t\t\t\t\t\t\tsumX[z] += table[b][z];\n\t\t\t\t\t\t\tnewTable[x][z] = sumX[z];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\tnewTable[x][z] = sumAll;\n\t\t\t\t\t\t}\n\t\t\t\t\t}",
"int z = 0;",
"int z = 0;",
"z",
"0",
"z < m+1",
"z",
"m+1",
"m",
"1",
"z++",
"z++",
"z",
"{\n\t\t\t\t\t\tif (z < m){\n\t\t\t\t\t\t\tfor (int b = 0; b < n; b++){\n\t\t\t\t\t\t\tsumX[z] += table[b][z];\n\t\t\t\t\t\t\tnewTable[x][z] = sumX[z];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\tnewTable[x][z] = sumAll;\n\t\t\t\t\t\t}\n\t\t\t\t\t}",
"{\n\t\t\t\t\t\tif (z < m){\n\t\t\t\t\t\t\tfor (int b = 0; b < n; b++){\n\t\t\t\t\t\t\tsumX[z] += table[b][z];\n\t\t\t\t\t\t\tnewTable[x][z] = sumX[z];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\tnewTable[x][z] = sumAll;\n\t\t\t\t\t\t}\n\t\t\t\t\t}",
"if (z < m){\n\t\t\t\t\t\t\tfor (int b = 0; b < n; b++){\n\t\t\t\t\t\t\tsumX[z] += table[b][z];\n\t\t\t\t\t\t\tnewTable[x][z] = sumX[z];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\tnewTable[x][z] = sumAll;\n\t\t\t\t\t\t}",
"z < m",
"z",
"m",
"{\n\t\t\t\t\t\t\tfor (int b = 0; b < n; b++){\n\t\t\t\t\t\t\tsumX[z] += table[b][z];\n\t\t\t\t\t\t\tnewTable[x][z] = sumX[z];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}",
"for (int b = 0; b < n; b++){\n\t\t\t\t\t\t\tsumX[z] += table[b][z];\n\t\t\t\t\t\t\tnewTable[x][z] = sumX[z];\n\t\t\t\t\t\t\t}",
"int b = 0;",
"int b = 0;",
"b",
"0",
"b < n",
"b",
"n",
"b++",
"b++",
"b",
"{\n\t\t\t\t\t\t\tsumX[z] += table[b][z];\n\t\t\t\t\t\t\tnewTable[x][z] = sumX[z];\n\t\t\t\t\t\t\t}",
"{\n\t\t\t\t\t\t\tsumX[z] += table[b][z];\n\t\t\t\t\t\t\tnewTable[x][z] = sumX[z];\n\t\t\t\t\t\t\t}",
"sumX[z] += table[b][z]",
"sumX[z]",
"sumX",
"z",
"table[b][z]",
"table[b]",
"table",
"b",
"z",
"newTable[x][z] = sumX[z]",
"newTable[x][z]",
"newTable[x]",
"newTable",
"x",
"z",
"sumX[z]",
"sumX",
"z",
"{\n\t\t\t\t\t\t\tnewTable[x][z] = sumAll;\n\t\t\t\t\t\t}",
"newTable[x][z] = sumAll",
"newTable[x][z]",
"newTable[x]",
"newTable",
"x",
"z",
"sumAll",
"for (int s = 0; s < n+1; s++){\n\t\t\t\tfor (int t = 0; t < m+1; t++){\n\t\t\t\t\tif (t < m ){\n\t\t\t\t\t\tSystem.out.print(newTable[s][t] + \" \");\n\t\t\t\t\t}else{\n\t\t\t\t\t\tSystem.out.print(newTable[s][t]);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tSystem.out.println();\n\t\t\t}",
"int s = 0;",
"int s = 0;",
"s",
"0",
"s < n+1",
"s",
"n+1",
"n",
"1",
"s++",
"s++",
"s",
"{\n\t\t\t\tfor (int t = 0; t < m+1; t++){\n\t\t\t\t\tif (t < m ){\n\t\t\t\t\t\tSystem.out.print(newTable[s][t] + \" \");\n\t\t\t\t\t}else{\n\t\t\t\t\t\tSystem.out.print(newTable[s][t]);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tSystem.out.println();\n\t\t\t}",
"{\n\t\t\t\tfor (int t = 0; t < m+1; t++){\n\t\t\t\t\tif (t < m ){\n\t\t\t\t\t\tSystem.out.print(newTable[s][t] + \" \");\n\t\t\t\t\t}else{\n\t\t\t\t\t\tSystem.out.print(newTable[s][t]);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tSystem.out.println();\n\t\t\t}",
"for (int t = 0; t < m+1; t++){\n\t\t\t\t\tif (t < m ){\n\t\t\t\t\t\tSystem.out.print(newTable[s][t] + \" \");\n\t\t\t\t\t}else{\n\t\t\t\t\t\tSystem.out.print(newTable[s][t]);\n\t\t\t\t\t}\n\t\t\t\t}",
"int t = 0;",
"int t = 0;",
"t",
"0",
"t < m+1",
"t",
"m+1",
"m",
"1",
"t++",
"t++",
"t",
"{\n\t\t\t\t\tif (t < m ){\n\t\t\t\t\t\tSystem.out.print(newTable[s][t] + \" \");\n\t\t\t\t\t}else{\n\t\t\t\t\t\tSystem.out.print(newTable[s][t]);\n\t\t\t\t\t}\n\t\t\t\t}",
"{\n\t\t\t\t\tif (t < m ){\n\t\t\t\t\t\tSystem.out.print(newTable[s][t] + \" \");\n\t\t\t\t\t}else{\n\t\t\t\t\t\tSystem.out.print(newTable[s][t]);\n\t\t\t\t\t}\n\t\t\t\t}",
"if (t < m ){\n\t\t\t\t\t\tSystem.out.print(newTable[s][t] + \" \");\n\t\t\t\t\t}else{\n\t\t\t\t\t\tSystem.out.print(newTable[s][t]);\n\t\t\t\t\t}",
"t < m",
"t",
"m",
"{\n\t\t\t\t\t\tSystem.out.print(newTable[s][t] + \" \");\n\t\t\t\t\t}",
"System.out.print(newTable[s][t] + \" \")",
"System.out.print",
"System.out",
"System",
"System.out",
"newTable[s][t] + \" \"",
"newTable[s][t]",
"newTable[s]",
"newTable",
"s",
"t",
"\" \"",
"{\n\t\t\t\t\t\tSystem.out.print(newTable[s][t]);\n\t\t\t\t\t}",
"System.out.print(newTable[s][t])",
"System.out.print",
"System.out",
"System",
"System.out",
"newTable[s][t]",
"newTable[s]",
"newTable",
"s",
"t",
"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\ttry{\n\t\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\t\t\tString[] tableSize = br.readLine().split(\" \");\n\t\t\tint n = Integer.parseInt(tableSize[0]);\n\t\t\tint m = Integer.parseInt(tableSize[1]);\n\t\t\tint[][] table = new int[n][m];\n\n\t\t\tfor (int i = 0; i < n; i++){\n\t\t\t\tString[] str = br.readLine().split(\" \");\n\t\t\t\tfor(int j = 0; j < m; j++){\n\t\t\t\t\ttable[i][j] = Integer.parseInt(str[j]);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tint[][] newTable = new int[n+1][m+1];\n\t\t\tint[] sumX = new int[m];\n\t\t\tint[] sumY = new int[n];\n\t\t\tint sumAll = 0;\n\n\t\t\tfor (int x = 0; x < n+1; x++){\n\t\t\t\tif (x < n){\n\t\t\t\t\tfor (int y = 0; y < m+1; y++){\n\t\t\t\t\t\tif(y < m){\n\t\t\t\t\t\t\tnewTable[x][y] = table[x][y];\n\t\t\t\t\t\t\tsumAll += newTable[x][y];\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\tfor (int a = 0; a < m; a++){\n\t\t\t\t\t\t\t\tsumY[x] += table[x][a];\n\t\t\t\t\t\t\t\tnewTable[x][y] = sumY[x];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}else{\n\t\t\t\t\tfor (int z = 0; z < m+1; z++){\n\t\t\t\t\t\tif (z < m){\n\t\t\t\t\t\t\tfor (int b = 0; b < n; b++){\n\t\t\t\t\t\t\tsumX[z] += table[b][z];\n\t\t\t\t\t\t\tnewTable[x][z] = sumX[z];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\tnewTable[x][z] = sumAll;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tfor (int s = 0; s < n+1; s++){\n\t\t\t\tfor (int t = 0; t < m+1; t++){\n\t\t\t\t\tif (t < m ){\n\t\t\t\t\t\tSystem.out.print(newTable[s][t] + \" \");\n\t\t\t\t\t}else{\n\t\t\t\t\t\tSystem.out.print(newTable[s][t]);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tSystem.out.println();\n\t\t\t}\n\t\t}catch(IOException e){\n\t\tSystem.out.println(e);\n\t\t}\n\t}\n}",
"public class Main{\n\tpublic static void main(String[] args){\n\t\ttry{\n\t\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\t\t\tString[] tableSize = br.readLine().split(\" \");\n\t\t\tint n = Integer.parseInt(tableSize[0]);\n\t\t\tint m = Integer.parseInt(tableSize[1]);\n\t\t\tint[][] table = new int[n][m];\n\n\t\t\tfor (int i = 0; i < n; i++){\n\t\t\t\tString[] str = br.readLine().split(\" \");\n\t\t\t\tfor(int j = 0; j < m; j++){\n\t\t\t\t\ttable[i][j] = Integer.parseInt(str[j]);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tint[][] newTable = new int[n+1][m+1];\n\t\t\tint[] sumX = new int[m];\n\t\t\tint[] sumY = new int[n];\n\t\t\tint sumAll = 0;\n\n\t\t\tfor (int x = 0; x < n+1; x++){\n\t\t\t\tif (x < n){\n\t\t\t\t\tfor (int y = 0; y < m+1; y++){\n\t\t\t\t\t\tif(y < m){\n\t\t\t\t\t\t\tnewTable[x][y] = table[x][y];\n\t\t\t\t\t\t\tsumAll += newTable[x][y];\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\tfor (int a = 0; a < m; a++){\n\t\t\t\t\t\t\t\tsumY[x] += table[x][a];\n\t\t\t\t\t\t\t\tnewTable[x][y] = sumY[x];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}else{\n\t\t\t\t\tfor (int z = 0; z < m+1; z++){\n\t\t\t\t\t\tif (z < m){\n\t\t\t\t\t\t\tfor (int b = 0; b < n; b++){\n\t\t\t\t\t\t\tsumX[z] += table[b][z];\n\t\t\t\t\t\t\tnewTable[x][z] = sumX[z];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\tnewTable[x][z] = sumAll;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tfor (int s = 0; s < n+1; s++){\n\t\t\t\tfor (int t = 0; t < m+1; t++){\n\t\t\t\t\tif (t < m ){\n\t\t\t\t\t\tSystem.out.print(newTable[s][t] + \" \");\n\t\t\t\t\t}else{\n\t\t\t\t\t\tSystem.out.print(newTable[s][t]);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tSystem.out.println();\n\t\t\t}\n\t\t}catch(IOException e){\n\t\tSystem.out.println(e);\n\t\t}\n\t}\n}",
"Main"
] | import java.io.*;
public class Main{
public static void main(String[] args){
try{
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
String[] tableSize = br.readLine().split(" ");
int n = Integer.parseInt(tableSize[0]);
int m = Integer.parseInt(tableSize[1]);
int[][] table = new int[n][m];
for (int i = 0; i < n; i++){
String[] str = br.readLine().split(" ");
for(int j = 0; j < m; j++){
table[i][j] = Integer.parseInt(str[j]);
}
}
int[][] newTable = new int[n+1][m+1];
int[] sumX = new int[m];
int[] sumY = new int[n];
int sumAll = 0;
for (int x = 0; x < n+1; x++){
if (x < n){
for (int y = 0; y < m+1; y++){
if(y < m){
newTable[x][y] = table[x][y];
sumAll += newTable[x][y];
}else{
for (int a = 0; a < m; a++){
sumY[x] += table[x][a];
newTable[x][y] = sumY[x];
}
}
}
}else{
for (int z = 0; z < m+1; z++){
if (z < m){
for (int b = 0; b < n; b++){
sumX[z] += table[b][z];
newTable[x][z] = sumX[z];
}
}else{
newTable[x][z] = sumAll;
}
}
}
}
for (int s = 0; s < n+1; s++){
for (int t = 0; t < m+1; t++){
if (t < m ){
System.out.print(newTable[s][t] + " ");
}else{
System.out.print(newTable[s][t]);
}
}
System.out.println();
}
}catch(IOException e){
System.out.println(e);
}
}
} |
[
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,
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,
30,
4,
18,
18,
13,
13,
4,
18,
13,
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
],
[
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
],
[
128,
140
],
[
140,
141
],
[
141,
142
],
[
142,
143
],
[
142,
144
],
[
141,
145
],
[
140,
146
],
[
146,
147
],
[
147,
148
],
[
147,
149
],
[
146,
150
],
[
8,
151
],
[
151,
152
],
[
152,
153
],
[
153,
154
],
[
153,
155
],
[
151,
156
],
[
156,
157
],
[
156,
158
],
[
158,
159
],
[
158,
160
],
[
151,
161
],
[
161,
162
],
[
162,
163
],
[
151,
164
],
[
165,
165
],
[
165,
166
],
[
166,
167
],
[
167,
168
],
[
168,
169
],
[
168,
170
],
[
166,
171
],
[
171,
172
],
[
171,
173
],
[
173,
174
],
[
173,
175
],
[
166,
176
],
[
176,
177
],
[
177,
178
],
[
166,
179
],
[
180,
180
],
[
180,
181
],
[
181,
182
],
[
182,
183
],
[
183,
184
],
[
183,
185
],
[
181,
186
],
[
186,
187
],
[
187,
188
],
[
187,
189
],
[
186,
190
],
[
180,
191
],
[
191,
192
],
[
192,
193
],
[
192,
194
],
[
191,
195
],
[
195,
196
],
[
196,
197
],
[
197,
198
],
[
198,
199
],
[
198,
200
],
[
196,
201
],
[
191,
202
],
[
202,
203
],
[
203,
204
],
[
204,
205
],
[
205,
206
],
[
205,
207
],
[
8,
208
],
[
208,
209
],
[
209,
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[] args) {\n\t\tScanner sc = new Scanner( System.in );\n\t\t\n\t\t// 入力\n\t\tint r = sc.nextInt();\n\t\tint c = sc.nextInt();\n\t\t\n\t\tint[][] vector = new int[r + 1][c + 1];\n\t\t\n\t\tfor ( int iR = 0; iR < r; iR++ ) {\n\t\t\tfor ( int iC = 0; iC < c; iC++ ) {\n\t\t\t\tvector[iR][iC] = sc.nextInt();\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t\t\n\t\t// 計算\n\t\tfor ( int iR = 0; iR < r; iR++ ) {\n\t\t\tfor ( int iC = 0; iC < c; iC++ ) {\n\t\t\t\tvector[iR][c] += vector[iR][iC];\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t\t\n\t\tfor ( int iC = 0; iC < c; iC++ ) {\n\t\t\tfor ( int iR = 0; iR < r; iR++ ) {\n\t\t\t\tvector[r][iC] += vector[iR][iC];\n\t\t\t\tvector[r][c] += vector[iR][iC];\n\t\t\t}\n\t\t}\n\t\t\t\t\n\t\t// 出力\n\t\tfor ( int iR = 0; iR < r+1; iR++ ) {\n\t\t\tfor ( int iC = 0; iC < c+1; iC++ ) {\n\t\t\t\tSystem.out.print(vector[iR][iC]);\n\t\t\t\tif( iC != c ) {\n\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t\t\n\t\t\t\t} else {\n\t\t\t\t\tSystem.out.println();\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tsc.close();\n\t}\n\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n\tpublic static void main(String[] args) {\n\t\tScanner sc = new Scanner( System.in );\n\t\t\n\t\t// 入力\n\t\tint r = sc.nextInt();\n\t\tint c = sc.nextInt();\n\t\t\n\t\tint[][] vector = new int[r + 1][c + 1];\n\t\t\n\t\tfor ( int iR = 0; iR < r; iR++ ) {\n\t\t\tfor ( int iC = 0; iC < c; iC++ ) {\n\t\t\t\tvector[iR][iC] = sc.nextInt();\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t\t\n\t\t// 計算\n\t\tfor ( int iR = 0; iR < r; iR++ ) {\n\t\t\tfor ( int iC = 0; iC < c; iC++ ) {\n\t\t\t\tvector[iR][c] += vector[iR][iC];\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t\t\n\t\tfor ( int iC = 0; iC < c; iC++ ) {\n\t\t\tfor ( int iR = 0; iR < r; iR++ ) {\n\t\t\t\tvector[r][iC] += vector[iR][iC];\n\t\t\t\tvector[r][c] += vector[iR][iC];\n\t\t\t}\n\t\t}\n\t\t\t\t\n\t\t// 出力\n\t\tfor ( int iR = 0; iR < r+1; iR++ ) {\n\t\t\tfor ( int iC = 0; iC < c+1; iC++ ) {\n\t\t\t\tSystem.out.print(vector[iR][iC]);\n\t\t\t\tif( iC != c ) {\n\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t\t\n\t\t\t\t} else {\n\t\t\t\t\tSystem.out.println();\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tsc.close();\n\t}\n\n}",
"Main",
"public static void main(String[] args) {\n\t\tScanner sc = new Scanner( System.in );\n\t\t\n\t\t// 入力\n\t\tint r = sc.nextInt();\n\t\tint c = sc.nextInt();\n\t\t\n\t\tint[][] vector = new int[r + 1][c + 1];\n\t\t\n\t\tfor ( int iR = 0; iR < r; iR++ ) {\n\t\t\tfor ( int iC = 0; iC < c; iC++ ) {\n\t\t\t\tvector[iR][iC] = sc.nextInt();\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t\t\n\t\t// 計算\n\t\tfor ( int iR = 0; iR < r; iR++ ) {\n\t\t\tfor ( int iC = 0; iC < c; iC++ ) {\n\t\t\t\tvector[iR][c] += vector[iR][iC];\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t\t\n\t\tfor ( int iC = 0; iC < c; iC++ ) {\n\t\t\tfor ( int iR = 0; iR < r; iR++ ) {\n\t\t\t\tvector[r][iC] += vector[iR][iC];\n\t\t\t\tvector[r][c] += vector[iR][iC];\n\t\t\t}\n\t\t}\n\t\t\t\t\n\t\t// 出力\n\t\tfor ( int iR = 0; iR < r+1; iR++ ) {\n\t\t\tfor ( int iC = 0; iC < c+1; iC++ ) {\n\t\t\t\tSystem.out.print(vector[iR][iC]);\n\t\t\t\tif( iC != c ) {\n\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t\t\n\t\t\t\t} else {\n\t\t\t\t\tSystem.out.println();\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tsc.close();\n\t}",
"main",
"{\n\t\tScanner sc = new Scanner( System.in );\n\t\t\n\t\t// 入力\n\t\tint r = sc.nextInt();\n\t\tint c = sc.nextInt();\n\t\t\n\t\tint[][] vector = new int[r + 1][c + 1];\n\t\t\n\t\tfor ( int iR = 0; iR < r; iR++ ) {\n\t\t\tfor ( int iC = 0; iC < c; iC++ ) {\n\t\t\t\tvector[iR][iC] = sc.nextInt();\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t\t\n\t\t// 計算\n\t\tfor ( int iR = 0; iR < r; iR++ ) {\n\t\t\tfor ( int iC = 0; iC < c; iC++ ) {\n\t\t\t\tvector[iR][c] += vector[iR][iC];\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t\t\n\t\tfor ( int iC = 0; iC < c; iC++ ) {\n\t\t\tfor ( int iR = 0; iR < r; iR++ ) {\n\t\t\t\tvector[r][iC] += vector[iR][iC];\n\t\t\t\tvector[r][c] += vector[iR][iC];\n\t\t\t}\n\t\t}\n\t\t\t\t\n\t\t// 出力\n\t\tfor ( int iR = 0; iR < r+1; iR++ ) {\n\t\t\tfor ( int iC = 0; iC < c+1; iC++ ) {\n\t\t\t\tSystem.out.print(vector[iR][iC]);\n\t\t\t\tif( iC != c ) {\n\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t\t\n\t\t\t\t} else {\n\t\t\t\t\tSystem.out.println();\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tsc.close();\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[][] vector = new int[r + 1][c + 1];",
"vector",
"new int[r + 1][c + 1]",
"r + 1",
"r",
"1",
"c + 1",
"c",
"1",
"for ( int iR = 0; iR < r; iR++ ) {\n\t\t\tfor ( int iC = 0; iC < c; iC++ ) {\n\t\t\t\tvector[iR][iC] = sc.nextInt();\n\t\t\t\t\n\t\t\t}\n\t\t}",
"int iR = 0;",
"int iR = 0;",
"iR",
"0",
"iR < r",
"iR",
"r",
"iR++",
"iR++",
"iR",
"{\n\t\t\tfor ( int iC = 0; iC < c; iC++ ) {\n\t\t\t\tvector[iR][iC] = sc.nextInt();\n\t\t\t\t\n\t\t\t}\n\t\t}",
"{\n\t\t\tfor ( int iC = 0; iC < c; iC++ ) {\n\t\t\t\tvector[iR][iC] = sc.nextInt();\n\t\t\t\t\n\t\t\t}\n\t\t}",
"for ( int iC = 0; iC < c; iC++ ) {\n\t\t\t\tvector[iR][iC] = sc.nextInt();\n\t\t\t\t\n\t\t\t}",
"int iC = 0;",
"int iC = 0;",
"iC",
"0",
"iC < c",
"iC",
"c",
"iC++",
"iC++",
"iC",
"{\n\t\t\t\tvector[iR][iC] = sc.nextInt();\n\t\t\t\t\n\t\t\t}",
"{\n\t\t\t\tvector[iR][iC] = sc.nextInt();\n\t\t\t\t\n\t\t\t}",
"vector[iR][iC] = sc.nextInt()",
"vector[iR][iC]",
"vector[iR]",
"vector",
"iR",
"iC",
"sc.nextInt()",
"sc.nextInt",
"sc",
"for ( int iR = 0; iR < r; iR++ ) {\n\t\t\tfor ( int iC = 0; iC < c; iC++ ) {\n\t\t\t\tvector[iR][c] += vector[iR][iC];\n\t\t\t\t\n\t\t\t}\n\t\t}",
"int iR = 0;",
"int iR = 0;",
"iR",
"0",
"iR < r",
"iR",
"r",
"iR++",
"iR++",
"iR",
"{\n\t\t\tfor ( int iC = 0; iC < c; iC++ ) {\n\t\t\t\tvector[iR][c] += vector[iR][iC];\n\t\t\t\t\n\t\t\t}\n\t\t}",
"{\n\t\t\tfor ( int iC = 0; iC < c; iC++ ) {\n\t\t\t\tvector[iR][c] += vector[iR][iC];\n\t\t\t\t\n\t\t\t}\n\t\t}",
"for ( int iC = 0; iC < c; iC++ ) {\n\t\t\t\tvector[iR][c] += vector[iR][iC];\n\t\t\t\t\n\t\t\t}",
"int iC = 0;",
"int iC = 0;",
"iC",
"0",
"iC < c",
"iC",
"c",
"iC++",
"iC++",
"iC",
"{\n\t\t\t\tvector[iR][c] += vector[iR][iC];\n\t\t\t\t\n\t\t\t}",
"{\n\t\t\t\tvector[iR][c] += vector[iR][iC];\n\t\t\t\t\n\t\t\t}",
"vector[iR][c] += vector[iR][iC]",
"vector[iR][c]",
"vector[iR]",
"vector",
"iR",
"c",
"vector[iR][iC]",
"vector[iR]",
"vector",
"iR",
"iC",
"for ( int iC = 0; iC < c; iC++ ) {\n\t\t\tfor ( int iR = 0; iR < r; iR++ ) {\n\t\t\t\tvector[r][iC] += vector[iR][iC];\n\t\t\t\tvector[r][c] += vector[iR][iC];\n\t\t\t}\n\t\t}",
"int iC = 0;",
"int iC = 0;",
"iC",
"0",
"iC < c",
"iC",
"c",
"iC++",
"iC++",
"iC",
"{\n\t\t\tfor ( int iR = 0; iR < r; iR++ ) {\n\t\t\t\tvector[r][iC] += vector[iR][iC];\n\t\t\t\tvector[r][c] += vector[iR][iC];\n\t\t\t}\n\t\t}",
"{\n\t\t\tfor ( int iR = 0; iR < r; iR++ ) {\n\t\t\t\tvector[r][iC] += vector[iR][iC];\n\t\t\t\tvector[r][c] += vector[iR][iC];\n\t\t\t}\n\t\t}",
"for ( int iR = 0; iR < r; iR++ ) {\n\t\t\t\tvector[r][iC] += vector[iR][iC];\n\t\t\t\tvector[r][c] += vector[iR][iC];\n\t\t\t}",
"int iR = 0;",
"int iR = 0;",
"iR",
"0",
"iR < r",
"iR",
"r",
"iR++",
"iR++",
"iR",
"{\n\t\t\t\tvector[r][iC] += vector[iR][iC];\n\t\t\t\tvector[r][c] += vector[iR][iC];\n\t\t\t}",
"{\n\t\t\t\tvector[r][iC] += vector[iR][iC];\n\t\t\t\tvector[r][c] += vector[iR][iC];\n\t\t\t}",
"vector[r][iC] += vector[iR][iC]",
"vector[r][iC]",
"vector[r]",
"vector",
"r",
"iC",
"vector[iR][iC]",
"vector[iR]",
"vector",
"iR",
"iC",
"vector[r][c] += vector[iR][iC]",
"vector[r][c]",
"vector[r]",
"vector",
"r",
"c",
"vector[iR][iC]",
"vector[iR]",
"vector",
"iR",
"iC",
"for ( int iR = 0; iR < r+1; iR++ ) {\n\t\t\tfor ( int iC = 0; iC < c+1; iC++ ) {\n\t\t\t\tSystem.out.print(vector[iR][iC]);\n\t\t\t\tif( iC != c ) {\n\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t\t\n\t\t\t\t} else {\n\t\t\t\t\tSystem.out.println();\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"int iR = 0;",
"int iR = 0;",
"iR",
"0",
"iR < r+1",
"iR",
"r+1",
"r",
"1",
"iR++",
"iR++",
"iR",
"{\n\t\t\tfor ( int iC = 0; iC < c+1; iC++ ) {\n\t\t\t\tSystem.out.print(vector[iR][iC]);\n\t\t\t\tif( iC != c ) {\n\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t\t\n\t\t\t\t} else {\n\t\t\t\t\tSystem.out.println();\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"{\n\t\t\tfor ( int iC = 0; iC < c+1; iC++ ) {\n\t\t\t\tSystem.out.print(vector[iR][iC]);\n\t\t\t\tif( iC != c ) {\n\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t\t\n\t\t\t\t} else {\n\t\t\t\t\tSystem.out.println();\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"for ( int iC = 0; iC < c+1; iC++ ) {\n\t\t\t\tSystem.out.print(vector[iR][iC]);\n\t\t\t\tif( iC != c ) {\n\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t\t\n\t\t\t\t} else {\n\t\t\t\t\tSystem.out.println();\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}",
"int iC = 0;",
"int iC = 0;",
"iC",
"0",
"iC < c+1",
"iC",
"c+1",
"c",
"1",
"iC++",
"iC++",
"iC",
"{\n\t\t\t\tSystem.out.print(vector[iR][iC]);\n\t\t\t\tif( iC != c ) {\n\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t\t\n\t\t\t\t} else {\n\t\t\t\t\tSystem.out.println();\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}",
"{\n\t\t\t\tSystem.out.print(vector[iR][iC]);\n\t\t\t\tif( iC != c ) {\n\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t\t\n\t\t\t\t} else {\n\t\t\t\t\tSystem.out.println();\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}",
"System.out.print(vector[iR][iC])",
"System.out.print",
"System.out",
"System",
"System.out",
"vector[iR][iC]",
"vector[iR]",
"vector",
"iR",
"iC",
"if( iC != c ) {\n\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t\t\n\t\t\t\t} else {\n\t\t\t\t\tSystem.out.println();\n\t\t\t\t\t\n\t\t\t\t}",
"iC != c",
"iC",
"c",
"{\n\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t\t\n\t\t\t\t}",
"System.out.print(\" \")",
"System.out.print",
"System.out",
"System",
"System.out",
"\" \"",
"{\n\t\t\t\t\tSystem.out.println();\n\t\t\t\t\t\n\t\t\t\t}",
"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) {\n\t\tScanner sc = new Scanner( System.in );\n\t\t\n\t\t// 入力\n\t\tint r = sc.nextInt();\n\t\tint c = sc.nextInt();\n\t\t\n\t\tint[][] vector = new int[r + 1][c + 1];\n\t\t\n\t\tfor ( int iR = 0; iR < r; iR++ ) {\n\t\t\tfor ( int iC = 0; iC < c; iC++ ) {\n\t\t\t\tvector[iR][iC] = sc.nextInt();\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t\t\n\t\t// 計算\n\t\tfor ( int iR = 0; iR < r; iR++ ) {\n\t\t\tfor ( int iC = 0; iC < c; iC++ ) {\n\t\t\t\tvector[iR][c] += vector[iR][iC];\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t\t\n\t\tfor ( int iC = 0; iC < c; iC++ ) {\n\t\t\tfor ( int iR = 0; iR < r; iR++ ) {\n\t\t\t\tvector[r][iC] += vector[iR][iC];\n\t\t\t\tvector[r][c] += vector[iR][iC];\n\t\t\t}\n\t\t}\n\t\t\t\t\n\t\t// 出力\n\t\tfor ( int iR = 0; iR < r+1; iR++ ) {\n\t\t\tfor ( int iC = 0; iC < c+1; iC++ ) {\n\t\t\t\tSystem.out.print(vector[iR][iC]);\n\t\t\t\tif( iC != c ) {\n\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t\t\n\t\t\t\t} else {\n\t\t\t\t\tSystem.out.println();\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tsc.close();\n\t}\n\n}",
"public class Main {\n\tpublic static void main(String[] args) {\n\t\tScanner sc = new Scanner( System.in );\n\t\t\n\t\t// 入力\n\t\tint r = sc.nextInt();\n\t\tint c = sc.nextInt();\n\t\t\n\t\tint[][] vector = new int[r + 1][c + 1];\n\t\t\n\t\tfor ( int iR = 0; iR < r; iR++ ) {\n\t\t\tfor ( int iC = 0; iC < c; iC++ ) {\n\t\t\t\tvector[iR][iC] = sc.nextInt();\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t\t\n\t\t// 計算\n\t\tfor ( int iR = 0; iR < r; iR++ ) {\n\t\t\tfor ( int iC = 0; iC < c; iC++ ) {\n\t\t\t\tvector[iR][c] += vector[iR][iC];\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t\t\n\t\tfor ( int iC = 0; iC < c; iC++ ) {\n\t\t\tfor ( int iR = 0; iR < r; iR++ ) {\n\t\t\t\tvector[r][iC] += vector[iR][iC];\n\t\t\t\tvector[r][c] += vector[iR][iC];\n\t\t\t}\n\t\t}\n\t\t\t\t\n\t\t// 出力\n\t\tfor ( int iR = 0; iR < r+1; iR++ ) {\n\t\t\tfor ( int iC = 0; iC < c+1; iC++ ) {\n\t\t\t\tSystem.out.print(vector[iR][iC]);\n\t\t\t\tif( iC != c ) {\n\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t\t\n\t\t\t\t} else {\n\t\t\t\t\tSystem.out.println();\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tsc.close();\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 r = sc.nextInt();
int c = sc.nextInt();
int[][] vector = new int[r + 1][c + 1];
for ( int iR = 0; iR < r; iR++ ) {
for ( int iC = 0; iC < c; iC++ ) {
vector[iR][iC] = sc.nextInt();
}
}
// 計算
for ( int iR = 0; iR < r; iR++ ) {
for ( int iC = 0; iC < c; iC++ ) {
vector[iR][c] += vector[iR][iC];
}
}
for ( int iC = 0; iC < c; iC++ ) {
for ( int iR = 0; iR < r; iR++ ) {
vector[r][iC] += vector[iR][iC];
vector[r][c] += vector[iR][iC];
}
}
// 出力
for ( int iR = 0; iR < r+1; iR++ ) {
for ( int iC = 0; iC < c+1; iC++ ) {
System.out.print(vector[iR][iC]);
if( iC != c ) {
System.out.print(" ");
} else {
System.out.println();
}
}
}
sc.close();
}
} |
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
41,
13,
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,
2,
18,
13,
13,
17,
1,
40,
13,
30,
30,
4,
18,
13,
11,
1,
41,
13,
17,
2,
13,
2,
18,
18,
13,
17,
13,
17,
1,
40,
13,
30,
30,
0,
18,
18,
13,
13,
13,
4,
18,
13,
11,
1,
41,
13,
17,
2,
13,
18,
13,
13,
1,
40,
13,
30,
0,
18,
18,
13,
13,
2,
18,
18,
13,
17,
13,
17,
17,
11,
1,
41,
13,
17,
2,
13,
2,
18,
18,
13,
17,
13,
17,
1,
40,
13,
30,
0,
18,
18,
13,
2,
18,
13,
13,
17,
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,
17,
13,
17,
1,
40,
13,
30,
30,
0,
18,
18,
13,
13,
2,
18,
18,
13,
17,
13,
17,
18,
18,
13,
13,
13,
0,
18,
18,
13,
2,
18,
13,
13,
17,
13,
18,
18,
13,
13,
13,
11,
1,
41,
13,
17,
2,
13,
2,
18,
18,
13,
17,
13,
17,
1,
40,
13,
30,
0,
18,
18,
13,
2,
18,
13,
13,
17,
2,
18,
18,
13,
17,
13,
17,
18,
18,
13,
2,
18,
13,
13,
17,
13,
11,
1,
41,
13,
17,
41,
13,
2,
13,
18,
13,
13,
1,
40,
13,
30,
30,
11,
1,
0,
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,
13,
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
],
[
8,
11
],
[
11,
12
],
[
8,
13
],
[
13,
14
],
[
13,
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
],
[
42,
43
],
[
43,
44
],
[
43,
45
],
[
42,
46
],
[
35,
47
],
[
47,
48
],
[
48,
49
],
[
35,
50
],
[
51,
51
],
[
51,
52
],
[
52,
53
],
[
53,
54
],
[
51,
55
],
[
55,
56
],
[
56,
57
],
[
57,
58
],
[
57,
59
],
[
55,
60
],
[
60,
61
],
[
60,
62
],
[
62,
63
],
[
63,
64
],
[
64,
65
],
[
64,
66
],
[
63,
67
],
[
62,
68
],
[
55,
69
],
[
69,
70
],
[
70,
71
],
[
55,
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
],
[
90,
91
],
[
90,
92
],
[
83,
93
],
[
93,
94
],
[
94,
95
],
[
83,
96
],
[
96,
97
],
[
97,
98
],
[
98,
99
],
[
99,
100
],
[
99,
101
],
[
98,
102
],
[
102,
103
],
[
103,
104
],
[
104,
105
],
[
104,
106
],
[
103,
107
],
[
102,
108
],
[
97,
109
],
[
8,
110
],
[
110,
111
],
[
111,
112
],
[
112,
113
],
[
112,
114
],
[
110,
115
],
[
115,
116
],
[
115,
117
],
[
117,
118
],
[
118,
119
],
[
119,
120
],
[
119,
121
],
[
118,
122
],
[
117,
123
],
[
110,
124
],
[
124,
125
],
[
125,
126
],
[
110,
127
],
[
127,
128
],
[
128,
129
],
[
129,
130
],
[
130,
131
],
[
130,
132
],
[
132,
133
],
[
133,
134
],
[
133,
135
],
[
132,
136
],
[
129,
137
],
[
128,
138
],
[
8,
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
],
[
180,
181
],
[
181,
182
],
[
182,
183
],
[
182,
184
],
[
181,
185
],
[
180,
186
],
[
175,
187
],
[
187,
188
],
[
188,
189
],
[
188,
190
],
[
187,
191
],
[
174,
192
],
[
192,
193
],
[
193,
194
],
[
194,
195
],
[
194,
196
],
[
196,
197
],
[
197,
198
],
[
197,
199
],
[
196,
200
],
[
193,
201
],
[
192,
202
],
[
202,
203
],
[
203,
204
],
[
203,
205
],
[
202,
206
],
[
8,
207
],
[
207,
208
],
[
208,
209
],
[
209,
210
],
[
209,
211
],
[
207,
212
],
[
212,
213
],
[
212,
214
],
[
214,
215
],
[
215,
216
],
[
216,
217
],
[
216,
218
],
[
215,
219
],
[
214,
220
],
[
207,
221
],
[
221,
222
],
[
222,
223
],
[
207,
224
],
[
224,
225
],
[
225,
226
],
[
226,
227
],
[
227,
228
],
[
227,
229
],
[
229,
230
],
[
230,
231
],
[
230,
232
],
[
229,
233
],
[
226,
234
],
[
234,
235
],
[
235,
236
],
[
236,
237
],
[
236,
238
],
[
235,
239
],
[
234,
240
],
[
225,
241
],
[
241,
242
],
[
242,
243
],
[
242,
244
],
[
244,
245
],
[
245,
246
],
[
245,
247
],
[
244,
248
],
[
241,
249
],
[
8,
250
],
[
250,
251
],
[
251,
252
],
[
252,
253
],
[
252,
254
],
[
251,
255
],
[
255,
256
],
[
250,
257
],
[
257,
258
],
[
257,
259
],
[
259,
260
],
[
259,
261
],
[
250,
262
],
[
262,
263
],
[
263,
264
],
[
250,
265
],
[
266,
266
],
[
266,
267
],
[
267,
268
],
[
268,
269
],
[
269,
270
],
[
269,
271
],
[
267,
272
],
[
272,
273
],
[
272,
274
],
[
274,
275
],
[
275,
276
],
[
276,
277
],
[
276,
278
],
[
275,
279
],
[
274,
280
],
[
267,
281
],
[
281,
282
],
[
282,
283
],
[
267,
284
],
[
285,
285
],
[
285,
286
],
[
286,
287
],
[
287,
288
],
[
288,
289
],
[
288,
290
],
[
286,
291
],
[
291,
292
],
[
292,
293
],
[
293,
294
],
[
293,
295
],
[
292,
296
],
[
291,
297
],
[
266,
298
],
[
298,
299
],
[
299,
300
],
[
300,
301
],
[
300,
302
],
[
298,
303
],
[
303,
304
],
[
304,
305
],
[
304,
306
],
[
303,
307
],
[
266,
308
],
[
308,
309
],
[
309,
310
],
[
310,
311
],
[
310,
312
],
[
6,
313
],
[
313,
314
]
] | [
"import java.util.Scanner;\n \nclass Main{\n public static void main(String[] arg){\n int r, c;\n\n Scanner in = new Scanner(System.in);\n\n r = in.nextInt();\n c = in.nextInt();\n\n int [][] output = new int[r+1][c+1];\n\n for(int i=0; i<output.length-1; i++){\n in.nextLine();\n for(int j=0; j<output[0].length-1; j++){\n output[i][j] = in.nextInt();\n }\n }\n\n for(int i=0; i<output.length; i++)\n output[i][output[0].length-1] = 0;\n\n for(int i=0; i<output[0].length-1; i++)\n output[output.length-1][i] = 0;\n\n for(int i=0; i<output.length-1; i++){\n for(int j=0; j<output[0].length-1; j++){\n output[i][output[0].length-1] += output[i][j];\n output[output.length-1][j] += output[i][j];\n }\n }\n\n for(int i=0; i<output[0].length-1; i++)\n output[output.length-1][output[0].length-1] += output[output.length-1][i];\n\n for(int i=0,j; i<output.length; i++){\n for(j=0; j<output[0].length-1; j++){\n System.out.print(output[i][j] + \" \");\n }\n System.out.print(output[i][j]);\n System.out.println();\n }\n\n }\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"class Main{\n public static void main(String[] arg){\n int r, c;\n\n Scanner in = new Scanner(System.in);\n\n r = in.nextInt();\n c = in.nextInt();\n\n int [][] output = new int[r+1][c+1];\n\n for(int i=0; i<output.length-1; i++){\n in.nextLine();\n for(int j=0; j<output[0].length-1; j++){\n output[i][j] = in.nextInt();\n }\n }\n\n for(int i=0; i<output.length; i++)\n output[i][output[0].length-1] = 0;\n\n for(int i=0; i<output[0].length-1; i++)\n output[output.length-1][i] = 0;\n\n for(int i=0; i<output.length-1; i++){\n for(int j=0; j<output[0].length-1; j++){\n output[i][output[0].length-1] += output[i][j];\n output[output.length-1][j] += output[i][j];\n }\n }\n\n for(int i=0; i<output[0].length-1; i++)\n output[output.length-1][output[0].length-1] += output[output.length-1][i];\n\n for(int i=0,j; i<output.length; i++){\n for(j=0; j<output[0].length-1; j++){\n System.out.print(output[i][j] + \" \");\n }\n System.out.print(output[i][j]);\n System.out.println();\n }\n\n }\n}",
"Main",
"public static void main(String[] arg){\n int r, c;\n\n Scanner in = new Scanner(System.in);\n\n r = in.nextInt();\n c = in.nextInt();\n\n int [][] output = new int[r+1][c+1];\n\n for(int i=0; i<output.length-1; i++){\n in.nextLine();\n for(int j=0; j<output[0].length-1; j++){\n output[i][j] = in.nextInt();\n }\n }\n\n for(int i=0; i<output.length; i++)\n output[i][output[0].length-1] = 0;\n\n for(int i=0; i<output[0].length-1; i++)\n output[output.length-1][i] = 0;\n\n for(int i=0; i<output.length-1; i++){\n for(int j=0; j<output[0].length-1; j++){\n output[i][output[0].length-1] += output[i][j];\n output[output.length-1][j] += output[i][j];\n }\n }\n\n for(int i=0; i<output[0].length-1; i++)\n output[output.length-1][output[0].length-1] += output[output.length-1][i];\n\n for(int i=0,j; i<output.length; i++){\n for(j=0; j<output[0].length-1; j++){\n System.out.print(output[i][j] + \" \");\n }\n System.out.print(output[i][j]);\n System.out.println();\n }\n\n }",
"main",
"{\n int r, c;\n\n Scanner in = new Scanner(System.in);\n\n r = in.nextInt();\n c = in.nextInt();\n\n int [][] output = new int[r+1][c+1];\n\n for(int i=0; i<output.length-1; i++){\n in.nextLine();\n for(int j=0; j<output[0].length-1; j++){\n output[i][j] = in.nextInt();\n }\n }\n\n for(int i=0; i<output.length; i++)\n output[i][output[0].length-1] = 0;\n\n for(int i=0; i<output[0].length-1; i++)\n output[output.length-1][i] = 0;\n\n for(int i=0; i<output.length-1; i++){\n for(int j=0; j<output[0].length-1; j++){\n output[i][output[0].length-1] += output[i][j];\n output[output.length-1][j] += output[i][j];\n }\n }\n\n for(int i=0; i<output[0].length-1; i++)\n output[output.length-1][output[0].length-1] += output[output.length-1][i];\n\n for(int i=0,j; i<output.length; i++){\n for(j=0; j<output[0].length-1; j++){\n System.out.print(output[i][j] + \" \");\n }\n System.out.print(output[i][j]);\n System.out.println();\n }\n\n }",
"int r",
"r",
"c;",
"c",
"Scanner in = new Scanner(System.in);",
"in",
"new Scanner(System.in)",
"r = in.nextInt()",
"r",
"in.nextInt()",
"in.nextInt",
"in",
"c = in.nextInt()",
"c",
"in.nextInt()",
"in.nextInt",
"in",
"int [][] output = new int[r+1][c+1];",
"output",
"new int[r+1][c+1]",
"r+1",
"r",
"1",
"c+1",
"c",
"1",
"for(int i=0; i<output.length-1; i++){\n in.nextLine();\n for(int j=0; j<output[0].length-1; j++){\n output[i][j] = in.nextInt();\n }\n }",
"int i=0;",
"int i=0;",
"i",
"0",
"i<output.length-1",
"i",
"output.length-1",
"output.length",
"output",
"output.length",
"1",
"i++",
"i++",
"i",
"{\n in.nextLine();\n for(int j=0; j<output[0].length-1; j++){\n output[i][j] = in.nextInt();\n }\n }",
"{\n in.nextLine();\n for(int j=0; j<output[0].length-1; j++){\n output[i][j] = in.nextInt();\n }\n }",
"in.nextLine()",
"in.nextLine",
"in",
"for(int j=0; j<output[0].length-1; j++){\n output[i][j] = in.nextInt();\n }",
"int j=0;",
"int j=0;",
"j",
"0",
"j<output[0].length-1",
"j",
"output[0].length-1",
"output[0].length",
"output[0]",
"output",
"0",
"output[0].length",
"1",
"j++",
"j++",
"j",
"{\n output[i][j] = in.nextInt();\n }",
"{\n output[i][j] = in.nextInt();\n }",
"output[i][j] = in.nextInt()",
"output[i][j]",
"output[i]",
"output",
"i",
"j",
"in.nextInt()",
"in.nextInt",
"in",
"for(int i=0; i<output.length; i++)\n output[i][output[0].length-1] = 0;",
"int i=0;",
"int i=0;",
"i",
"0",
"i<output.length",
"i",
"output.length",
"output",
"output.length",
"i++",
"i++",
"i",
"output[i][output[0].length-1] = 0;",
"output[i][output[0].length-1] = 0",
"output[i][output[0].length-1]",
"output[i]",
"output",
"i",
"output[0].length-1",
"output[0].length",
"output[0]",
"output",
"0",
"output[0].length",
"1",
"0",
"for(int i=0; i<output[0].length-1; i++)\n output[output.length-1][i] = 0;",
"int i=0;",
"int i=0;",
"i",
"0",
"i<output[0].length-1",
"i",
"output[0].length-1",
"output[0].length",
"output[0]",
"output",
"0",
"output[0].length",
"1",
"i++",
"i++",
"i",
"output[output.length-1][i] = 0;",
"output[output.length-1][i] = 0",
"output[output.length-1][i]",
"output[output.length-1]",
"output",
"output.length-1",
"output.length",
"output",
"output.length",
"1",
"i",
"0",
"for(int i=0; i<output.length-1; i++){\n for(int j=0; j<output[0].length-1; j++){\n output[i][output[0].length-1] += output[i][j];\n output[output.length-1][j] += output[i][j];\n }\n }",
"int i=0;",
"int i=0;",
"i",
"0",
"i<output.length-1",
"i",
"output.length-1",
"output.length",
"output",
"output.length",
"1",
"i++",
"i++",
"i",
"{\n for(int j=0; j<output[0].length-1; j++){\n output[i][output[0].length-1] += output[i][j];\n output[output.length-1][j] += output[i][j];\n }\n }",
"{\n for(int j=0; j<output[0].length-1; j++){\n output[i][output[0].length-1] += output[i][j];\n output[output.length-1][j] += output[i][j];\n }\n }",
"for(int j=0; j<output[0].length-1; j++){\n output[i][output[0].length-1] += output[i][j];\n output[output.length-1][j] += output[i][j];\n }",
"int j=0;",
"int j=0;",
"j",
"0",
"j<output[0].length-1",
"j",
"output[0].length-1",
"output[0].length",
"output[0]",
"output",
"0",
"output[0].length",
"1",
"j++",
"j++",
"j",
"{\n output[i][output[0].length-1] += output[i][j];\n output[output.length-1][j] += output[i][j];\n }",
"{\n output[i][output[0].length-1] += output[i][j];\n output[output.length-1][j] += output[i][j];\n }",
"output[i][output[0].length-1] += output[i][j]",
"output[i][output[0].length-1]",
"output[i]",
"output",
"i",
"output[0].length-1",
"output[0].length",
"output[0]",
"output",
"0",
"output[0].length",
"1",
"output[i][j]",
"output[i]",
"output",
"i",
"j",
"output[output.length-1][j] += output[i][j]",
"output[output.length-1][j]",
"output[output.length-1]",
"output",
"output.length-1",
"output.length",
"output",
"output.length",
"1",
"j",
"output[i][j]",
"output[i]",
"output",
"i",
"j",
"for(int i=0; i<output[0].length-1; i++)\n output[output.length-1][output[0].length-1] += output[output.length-1][i];",
"int i=0;",
"int i=0;",
"i",
"0",
"i<output[0].length-1",
"i",
"output[0].length-1",
"output[0].length",
"output[0]",
"output",
"0",
"output[0].length",
"1",
"i++",
"i++",
"i",
"output[output.length-1][output[0].length-1] += output[output.length-1][i];",
"output[output.length-1][output[0].length-1] += output[output.length-1][i]",
"output[output.length-1][output[0].length-1]",
"output[output.length-1]",
"output",
"output.length-1",
"output.length",
"output",
"output.length",
"1",
"output[0].length-1",
"output[0].length",
"output[0]",
"output",
"0",
"output[0].length",
"1",
"output[output.length-1][i]",
"output[output.length-1]",
"output",
"output.length-1",
"output.length",
"output",
"output.length",
"1",
"i",
"for(int i=0,j; i<output.length; i++){\n for(j=0; j<output[0].length-1; j++){\n System.out.print(output[i][j] + \" \");\n }\n System.out.print(output[i][j]);\n System.out.println();\n }",
"int i=0,j;",
"int i=0",
"i",
"0",
"j;",
"j",
"i<output.length",
"i",
"output.length",
"output",
"output.length",
"i++",
"i++",
"i",
"{\n for(j=0; j<output[0].length-1; j++){\n System.out.print(output[i][j] + \" \");\n }\n System.out.print(output[i][j]);\n System.out.println();\n }",
"{\n for(j=0; j<output[0].length-1; j++){\n System.out.print(output[i][j] + \" \");\n }\n System.out.print(output[i][j]);\n System.out.println();\n }",
"for(j=0; j<output[0].length-1; j++){\n System.out.print(output[i][j] + \" \");\n }",
"j=0;",
"j=0",
"j",
"0",
"j<output[0].length-1",
"j",
"output[0].length-1",
"output[0].length",
"output[0]",
"output",
"0",
"output[0].length",
"1",
"j++",
"j++",
"j",
"{\n System.out.print(output[i][j] + \" \");\n }",
"{\n System.out.print(output[i][j] + \" \");\n }",
"System.out.print(output[i][j] + \" \")",
"System.out.print",
"System.out",
"System",
"System.out",
"output[i][j] + \" \"",
"output[i][j]",
"output[i]",
"output",
"i",
"j",
"\" \"",
"System.out.print(output[i][j])",
"System.out.print",
"System.out",
"System",
"System.out",
"output[i][j]",
"output[i]",
"output",
"i",
"j",
"System.out.println()",
"System.out.println",
"System.out",
"System",
"System.out",
"String[] arg",
"arg"
] | import java.util.Scanner;
class Main{
public static void main(String[] arg){
int r, c;
Scanner in = new Scanner(System.in);
r = in.nextInt();
c = in.nextInt();
int [][] output = new int[r+1][c+1];
for(int i=0; i<output.length-1; i++){
in.nextLine();
for(int j=0; j<output[0].length-1; j++){
output[i][j] = in.nextInt();
}
}
for(int i=0; i<output.length; i++)
output[i][output[0].length-1] = 0;
for(int i=0; i<output[0].length-1; i++)
output[output.length-1][i] = 0;
for(int i=0; i<output.length-1; i++){
for(int j=0; j<output[0].length-1; j++){
output[i][output[0].length-1] += output[i][j];
output[output.length-1][j] += output[i][j];
}
}
for(int i=0; i<output[0].length-1; i++)
output[output.length-1][output[0].length-1] += output[output.length-1][i];
for(int i=0,j; i<output.length; i++){
for(j=0; j<output[0].length-1; j++){
System.out.print(output[i][j] + " ");
}
System.out.print(output[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,
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,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
2,
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,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
2,
18,
18,
13,
13,
13,
13,
0,
18,
18,
13,
13,
13,
13,
0,
13,
2,
18,
18,
13,
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,
4,
18,
18,
13,
13,
18,
18,
13,
13,
13,
14,
2,
13,
13,
30,
4,
18,
18,
13,
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
],
[
241,
5
],
[
241,
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
],
[
82,
84
],
[
81,
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
],
[
102,
103
],
[
102,
104
],
[
101,
105
],
[
100,
106
],
[
81,
107
],
[
107,
108
],
[
108,
109
],
[
109,
110
],
[
109,
111
],
[
108,
112
],
[
107,
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
],
[
127,
129
],
[
126,
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
],
[
143,
145
],
[
145,
146
],
[
146,
147
],
[
147,
148
],
[
147,
149
],
[
146,
150
],
[
145,
151
],
[
126,
152
],
[
152,
153
],
[
153,
154
],
[
154,
155
],
[
154,
156
],
[
153,
157
],
[
152,
158
],
[
126,
159
],
[
159,
160
],
[
159,
161
],
[
161,
162
],
[
162,
163
],
[
163,
164
],
[
163,
165
],
[
162,
166
],
[
161,
167
],
[
8,
168
],
[
168,
169
],
[
169,
170
],
[
170,
171
],
[
170,
172
],
[
169,
173
],
[
168,
174
],
[
8,
175
],
[
175,
176
],
[
176,
177
],
[
177,
178
],
[
177,
179
],
[
175,
180
],
[
180,
181
],
[
180,
182
],
[
182,
183
],
[
182,
184
],
[
175,
185
],
[
185,
186
],
[
186,
187
],
[
175,
188
],
[
189,
189
],
[
189,
190
],
[
190,
191
],
[
191,
192
],
[
192,
193
],
[
192,
194
],
[
190,
195
],
[
195,
196
],
[
195,
197
],
[
197,
198
],
[
197,
199
],
[
190,
200
],
[
200,
201
],
[
201,
202
],
[
190,
203
],
[
204,
204
],
[
204,
205
],
[
205,
206
],
[
206,
207
],
[
207,
208
],
[
207,
209
],
[
205,
210
],
[
210,
211
],
[
211,
212
],
[
211,
213
],
[
210,
214
],
[
204,
215
],
[
215,
216
],
[
216,
217
],
[
216,
218
],
[
215,
219
],
[
219,
220
],
[
220,
221
],
[
221,
222
],
[
222,
223
],
[
222,
224
],
[
220,
225
],
[
215,
226
],
[
226,
227
],
[
227,
228
],
[
228,
229
],
[
229,
230
],
[
229,
231
],
[
227,
232
],
[
189,
233
],
[
233,
234
],
[
234,
235
],
[
235,
236
],
[
235,
237
],
[
6,
238
],
[
238,
239
],
[
0,
240
],
[
240,
241
],
[
240,
242
]
] | [
"import java.util.Scanner;\n\npublic class Main {\n\n\tpublic static void main(String[] args) {\n\t\t// TODO ?????????????????????????????????????????????\n\t\tScanner scan = new Scanner(System.in);\n\t\t\n\t\tint r = scan.nextInt();\n\t\tint c = scan.nextInt();\n\t\tint[][] numbers = new int[r + 1][c + 1];\n\t\t\n\t\tint sUB = 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\tnumbers[i][j] = scan.nextInt();\n\t\t\t}\n\t\t}\n\t\t\n\t\tfor(int k = 0; k < r; k++){\n\t\t\tint sB = 0;\n\t\t\tfor(int l = 0; l < c; l++){\n\t\t\t\tsB = numbers[k][l] + sB;\n\t\t\t}\n\t\t\tnumbers[k][c] = sB;\n\t\t}\n\t\t\n\t\tfor(int l = 0; l < c; l++){\n\t\t\tint sU = 0;\n\t\t\tfor(int k = 0; k < r; k++){\n\t\t\t\tsU = numbers[k][l] + sU;\n\t\t\t}\n\t\t\tnumbers[r][l] = sU;\n\t\t\t\n\t\t\tsUB = numbers[r][l] + sUB;\n\t\t}\n\t\tnumbers[r][c] = sUB;\n\t\t\n\t\tfor(int p = 0; p < r + 1; p++){\n\t\t\tfor(int q = 0; q < c + 1; q++){\n\t\t\t\tSystem.out.print(numbers[p][q]);\n\t\t\t\tif(q == c){\n\t\t\t\t\tSystem.out.print(\"\");\n\t\t\t\t}else{\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.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n\n\tpublic static void main(String[] args) {\n\t\t// TODO ?????????????????????????????????????????????\n\t\tScanner scan = new Scanner(System.in);\n\t\t\n\t\tint r = scan.nextInt();\n\t\tint c = scan.nextInt();\n\t\tint[][] numbers = new int[r + 1][c + 1];\n\t\t\n\t\tint sUB = 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\tnumbers[i][j] = scan.nextInt();\n\t\t\t}\n\t\t}\n\t\t\n\t\tfor(int k = 0; k < r; k++){\n\t\t\tint sB = 0;\n\t\t\tfor(int l = 0; l < c; l++){\n\t\t\t\tsB = numbers[k][l] + sB;\n\t\t\t}\n\t\t\tnumbers[k][c] = sB;\n\t\t}\n\t\t\n\t\tfor(int l = 0; l < c; l++){\n\t\t\tint sU = 0;\n\t\t\tfor(int k = 0; k < r; k++){\n\t\t\t\tsU = numbers[k][l] + sU;\n\t\t\t}\n\t\t\tnumbers[r][l] = sU;\n\t\t\t\n\t\t\tsUB = numbers[r][l] + sUB;\n\t\t}\n\t\tnumbers[r][c] = sUB;\n\t\t\n\t\tfor(int p = 0; p < r + 1; p++){\n\t\t\tfor(int q = 0; q < c + 1; q++){\n\t\t\t\tSystem.out.print(numbers[p][q]);\n\t\t\t\tif(q == c){\n\t\t\t\t\tSystem.out.print(\"\");\n\t\t\t\t}else{\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) {\n\t\t// TODO ?????????????????????????????????????????????\n\t\tScanner scan = new Scanner(System.in);\n\t\t\n\t\tint r = scan.nextInt();\n\t\tint c = scan.nextInt();\n\t\tint[][] numbers = new int[r + 1][c + 1];\n\t\t\n\t\tint sUB = 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\tnumbers[i][j] = scan.nextInt();\n\t\t\t}\n\t\t}\n\t\t\n\t\tfor(int k = 0; k < r; k++){\n\t\t\tint sB = 0;\n\t\t\tfor(int l = 0; l < c; l++){\n\t\t\t\tsB = numbers[k][l] + sB;\n\t\t\t}\n\t\t\tnumbers[k][c] = sB;\n\t\t}\n\t\t\n\t\tfor(int l = 0; l < c; l++){\n\t\t\tint sU = 0;\n\t\t\tfor(int k = 0; k < r; k++){\n\t\t\t\tsU = numbers[k][l] + sU;\n\t\t\t}\n\t\t\tnumbers[r][l] = sU;\n\t\t\t\n\t\t\tsUB = numbers[r][l] + sUB;\n\t\t}\n\t\tnumbers[r][c] = sUB;\n\t\t\n\t\tfor(int p = 0; p < r + 1; p++){\n\t\t\tfor(int q = 0; q < c + 1; q++){\n\t\t\t\tSystem.out.print(numbers[p][q]);\n\t\t\t\tif(q == c){\n\t\t\t\t\tSystem.out.print(\"\");\n\t\t\t\t}else{\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// TODO ?????????????????????????????????????????????\n\t\tScanner scan = new Scanner(System.in);\n\t\t\n\t\tint r = scan.nextInt();\n\t\tint c = scan.nextInt();\n\t\tint[][] numbers = new int[r + 1][c + 1];\n\t\t\n\t\tint sUB = 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\tnumbers[i][j] = scan.nextInt();\n\t\t\t}\n\t\t}\n\t\t\n\t\tfor(int k = 0; k < r; k++){\n\t\t\tint sB = 0;\n\t\t\tfor(int l = 0; l < c; l++){\n\t\t\t\tsB = numbers[k][l] + sB;\n\t\t\t}\n\t\t\tnumbers[k][c] = sB;\n\t\t}\n\t\t\n\t\tfor(int l = 0; l < c; l++){\n\t\t\tint sU = 0;\n\t\t\tfor(int k = 0; k < r; k++){\n\t\t\t\tsU = numbers[k][l] + sU;\n\t\t\t}\n\t\t\tnumbers[r][l] = sU;\n\t\t\t\n\t\t\tsUB = numbers[r][l] + sUB;\n\t\t}\n\t\tnumbers[r][c] = sUB;\n\t\t\n\t\tfor(int p = 0; p < r + 1; p++){\n\t\t\tfor(int q = 0; q < c + 1; q++){\n\t\t\t\tSystem.out.print(numbers[p][q]);\n\t\t\t\tif(q == c){\n\t\t\t\t\tSystem.out.print(\"\");\n\t\t\t\t}else{\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 r = scan.nextInt();",
"r",
"scan.nextInt()",
"scan.nextInt",
"scan",
"int c = scan.nextInt();",
"c",
"scan.nextInt()",
"scan.nextInt",
"scan",
"int[][] numbers = new int[r + 1][c + 1];",
"numbers",
"new int[r + 1][c + 1]",
"r + 1",
"r",
"1",
"c + 1",
"c",
"1",
"int sUB = 0;",
"sUB",
"0",
"for(int i = 0; i < r; i++){\n\t\t\tfor(int j = 0; j < c; j++){\n\t\t\t\tnumbers[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\tnumbers[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\tnumbers[i][j] = scan.nextInt();\n\t\t\t}\n\t\t}",
"for(int j = 0; j < c; j++){\n\t\t\t\tnumbers[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\tnumbers[i][j] = scan.nextInt();\n\t\t\t}",
"{\n\t\t\t\tnumbers[i][j] = scan.nextInt();\n\t\t\t}",
"numbers[i][j] = scan.nextInt()",
"numbers[i][j]",
"numbers[i]",
"numbers",
"i",
"j",
"scan.nextInt()",
"scan.nextInt",
"scan",
"for(int k = 0; k < r; k++){\n\t\t\tint sB = 0;\n\t\t\tfor(int l = 0; l < c; l++){\n\t\t\t\tsB = numbers[k][l] + sB;\n\t\t\t}\n\t\t\tnumbers[k][c] = sB;\n\t\t}",
"int k = 0;",
"int k = 0;",
"k",
"0",
"k < r",
"k",
"r",
"k++",
"k++",
"k",
"{\n\t\t\tint sB = 0;\n\t\t\tfor(int l = 0; l < c; l++){\n\t\t\t\tsB = numbers[k][l] + sB;\n\t\t\t}\n\t\t\tnumbers[k][c] = sB;\n\t\t}",
"{\n\t\t\tint sB = 0;\n\t\t\tfor(int l = 0; l < c; l++){\n\t\t\t\tsB = numbers[k][l] + sB;\n\t\t\t}\n\t\t\tnumbers[k][c] = sB;\n\t\t}",
"int sB = 0;",
"sB",
"0",
"for(int l = 0; l < c; l++){\n\t\t\t\tsB = numbers[k][l] + sB;\n\t\t\t}",
"int l = 0;",
"int l = 0;",
"l",
"0",
"l < c",
"l",
"c",
"l++",
"l++",
"l",
"{\n\t\t\t\tsB = numbers[k][l] + sB;\n\t\t\t}",
"{\n\t\t\t\tsB = numbers[k][l] + sB;\n\t\t\t}",
"sB = numbers[k][l] + sB",
"sB",
"numbers[k][l] + sB",
"numbers[k][l]",
"numbers[k]",
"numbers",
"k",
"l",
"sB",
"numbers[k][c] = sB",
"numbers[k][c]",
"numbers[k]",
"numbers",
"k",
"c",
"sB",
"for(int l = 0; l < c; l++){\n\t\t\tint sU = 0;\n\t\t\tfor(int k = 0; k < r; k++){\n\t\t\t\tsU = numbers[k][l] + sU;\n\t\t\t}\n\t\t\tnumbers[r][l] = sU;\n\t\t\t\n\t\t\tsUB = numbers[r][l] + sUB;\n\t\t}",
"int l = 0;",
"int l = 0;",
"l",
"0",
"l < c",
"l",
"c",
"l++",
"l++",
"l",
"{\n\t\t\tint sU = 0;\n\t\t\tfor(int k = 0; k < r; k++){\n\t\t\t\tsU = numbers[k][l] + sU;\n\t\t\t}\n\t\t\tnumbers[r][l] = sU;\n\t\t\t\n\t\t\tsUB = numbers[r][l] + sUB;\n\t\t}",
"{\n\t\t\tint sU = 0;\n\t\t\tfor(int k = 0; k < r; k++){\n\t\t\t\tsU = numbers[k][l] + sU;\n\t\t\t}\n\t\t\tnumbers[r][l] = sU;\n\t\t\t\n\t\t\tsUB = numbers[r][l] + sUB;\n\t\t}",
"int sU = 0;",
"sU",
"0",
"for(int k = 0; k < r; k++){\n\t\t\t\tsU = numbers[k][l] + sU;\n\t\t\t}",
"int k = 0;",
"int k = 0;",
"k",
"0",
"k < r",
"k",
"r",
"k++",
"k++",
"k",
"{\n\t\t\t\tsU = numbers[k][l] + sU;\n\t\t\t}",
"{\n\t\t\t\tsU = numbers[k][l] + sU;\n\t\t\t}",
"sU = numbers[k][l] + sU",
"sU",
"numbers[k][l] + sU",
"numbers[k][l]",
"numbers[k]",
"numbers",
"k",
"l",
"sU",
"numbers[r][l] = sU",
"numbers[r][l]",
"numbers[r]",
"numbers",
"r",
"l",
"sU",
"sUB = numbers[r][l] + sUB",
"sUB",
"numbers[r][l] + sUB",
"numbers[r][l]",
"numbers[r]",
"numbers",
"r",
"l",
"sUB",
"numbers[r][c] = sUB",
"numbers[r][c]",
"numbers[r]",
"numbers",
"r",
"c",
"sUB",
"for(int p = 0; p < r + 1; p++){\n\t\t\tfor(int q = 0; q < c + 1; q++){\n\t\t\t\tSystem.out.print(numbers[p][q]);\n\t\t\t\tif(q == c){\n\t\t\t\t\tSystem.out.print(\"\");\n\t\t\t\t}else{\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 p = 0;",
"int p = 0;",
"p",
"0",
"p < r + 1",
"p",
"r + 1",
"r",
"1",
"p++",
"p++",
"p",
"{\n\t\t\tfor(int q = 0; q < c + 1; q++){\n\t\t\t\tSystem.out.print(numbers[p][q]);\n\t\t\t\tif(q == c){\n\t\t\t\t\tSystem.out.print(\"\");\n\t\t\t\t}else{\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 q = 0; q < c + 1; q++){\n\t\t\t\tSystem.out.print(numbers[p][q]);\n\t\t\t\tif(q == c){\n\t\t\t\t\tSystem.out.print(\"\");\n\t\t\t\t}else{\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 q = 0; q < c + 1; q++){\n\t\t\t\tSystem.out.print(numbers[p][q]);\n\t\t\t\tif(q == c){\n\t\t\t\t\tSystem.out.print(\"\");\n\t\t\t\t}else{\n\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t}\n\t\t\t}",
"int q = 0;",
"int q = 0;",
"q",
"0",
"q < c + 1",
"q",
"c + 1",
"c",
"1",
"q++",
"q++",
"q",
"{\n\t\t\t\tSystem.out.print(numbers[p][q]);\n\t\t\t\tif(q == c){\n\t\t\t\t\tSystem.out.print(\"\");\n\t\t\t\t}else{\n\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t}\n\t\t\t}",
"{\n\t\t\t\tSystem.out.print(numbers[p][q]);\n\t\t\t\tif(q == c){\n\t\t\t\t\tSystem.out.print(\"\");\n\t\t\t\t}else{\n\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t}\n\t\t\t}",
"System.out.print(numbers[p][q])",
"System.out.print",
"System.out",
"System",
"System.out",
"numbers[p][q]",
"numbers[p]",
"numbers",
"p",
"q",
"if(q == c){\n\t\t\t\t\tSystem.out.print(\"\");\n\t\t\t\t}else{\n\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t}",
"q == c",
"q",
"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",
"\"\"",
"{\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\t\t// TODO ?????????????????????????????????????????????\n\t\tScanner scan = new Scanner(System.in);\n\t\t\n\t\tint r = scan.nextInt();\n\t\tint c = scan.nextInt();\n\t\tint[][] numbers = new int[r + 1][c + 1];\n\t\t\n\t\tint sUB = 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\tnumbers[i][j] = scan.nextInt();\n\t\t\t}\n\t\t}\n\t\t\n\t\tfor(int k = 0; k < r; k++){\n\t\t\tint sB = 0;\n\t\t\tfor(int l = 0; l < c; l++){\n\t\t\t\tsB = numbers[k][l] + sB;\n\t\t\t}\n\t\t\tnumbers[k][c] = sB;\n\t\t}\n\t\t\n\t\tfor(int l = 0; l < c; l++){\n\t\t\tint sU = 0;\n\t\t\tfor(int k = 0; k < r; k++){\n\t\t\t\tsU = numbers[k][l] + sU;\n\t\t\t}\n\t\t\tnumbers[r][l] = sU;\n\t\t\t\n\t\t\tsUB = numbers[r][l] + sUB;\n\t\t}\n\t\tnumbers[r][c] = sUB;\n\t\t\n\t\tfor(int p = 0; p < r + 1; p++){\n\t\t\tfor(int q = 0; q < c + 1; q++){\n\t\t\t\tSystem.out.print(numbers[p][q]);\n\t\t\t\tif(q == c){\n\t\t\t\t\tSystem.out.print(\"\");\n\t\t\t\t}else{\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}",
"public class Main {\n\n\tpublic static void main(String[] args) {\n\t\t// TODO ?????????????????????????????????????????????\n\t\tScanner scan = new Scanner(System.in);\n\t\t\n\t\tint r = scan.nextInt();\n\t\tint c = scan.nextInt();\n\t\tint[][] numbers = new int[r + 1][c + 1];\n\t\t\n\t\tint sUB = 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\tnumbers[i][j] = scan.nextInt();\n\t\t\t}\n\t\t}\n\t\t\n\t\tfor(int k = 0; k < r; k++){\n\t\t\tint sB = 0;\n\t\t\tfor(int l = 0; l < c; l++){\n\t\t\t\tsB = numbers[k][l] + sB;\n\t\t\t}\n\t\t\tnumbers[k][c] = sB;\n\t\t}\n\t\t\n\t\tfor(int l = 0; l < c; l++){\n\t\t\tint sU = 0;\n\t\t\tfor(int k = 0; k < r; k++){\n\t\t\t\tsU = numbers[k][l] + sU;\n\t\t\t}\n\t\t\tnumbers[r][l] = sU;\n\t\t\t\n\t\t\tsUB = numbers[r][l] + sUB;\n\t\t}\n\t\tnumbers[r][c] = sUB;\n\t\t\n\t\tfor(int p = 0; p < r + 1; p++){\n\t\t\tfor(int q = 0; q < c + 1; q++){\n\t\t\t\tSystem.out.print(numbers[p][q]);\n\t\t\t\tif(q == c){\n\t\t\t\t\tSystem.out.print(\"\");\n\t\t\t\t}else{\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"
] | import java.util.Scanner;
public class Main {
public static void main(String[] args) {
// TODO ?????????????????????????????????????????????
Scanner scan = new Scanner(System.in);
int r = scan.nextInt();
int c = scan.nextInt();
int[][] numbers = new int[r + 1][c + 1];
int sUB = 0;
for(int i = 0; i < r; i++){
for(int j = 0; j < c; j++){
numbers[i][j] = scan.nextInt();
}
}
for(int k = 0; k < r; k++){
int sB = 0;
for(int l = 0; l < c; l++){
sB = numbers[k][l] + sB;
}
numbers[k][c] = sB;
}
for(int l = 0; l < c; l++){
int sU = 0;
for(int k = 0; k < r; k++){
sU = numbers[k][l] + sU;
}
numbers[r][l] = sU;
sUB = numbers[r][l] + sUB;
}
numbers[r][c] = sUB;
for(int p = 0; p < r + 1; p++){
for(int q = 0; q < c + 1; q++){
System.out.print(numbers[p][q]);
if(q == c){
System.out.print("");
}else{
System.out.print(" ");
}
}
System.out.println();
}
}
} |
[
7,
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,
38,
5,
13,
30,
4,
18,
18,
13,
13,
13,
30,
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,
0,
18,
13,
13,
4,
18,
13,
18,
13,
13,
4,
18,
4,
18,
13,
18,
13,
13,
17,
0,
18,
13,
13,
13,
4,
18,
13,
13,
4,
18,
13,
17,
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
],
[
189,
8
],
[
189,
9
],
[
9,
10
],
[
9,
11
],
[
11,
12
],
[
12,
13
],
[
12,
14
],
[
11,
15
],
[
15,
16
],
[
15,
17
],
[
11,
18
],
[
18,
19
],
[
11,
20
],
[
20,
21
],
[
11,
22
],
[
22,
23
],
[
11,
24
],
[
24,
25
],
[
11,
26
],
[
26,
27
],
[
27,
28
],
[
27,
29
],
[
29,
30
],
[
30,
31
],
[
31,
32
],
[
32,
33
],
[
32,
34
],
[
30,
35
],
[
26,
36
],
[
36,
37
],
[
37,
38
],
[
37,
39
],
[
39,
40
],
[
40,
41
],
[
36,
42
],
[
42,
43
],
[
42,
44
],
[
44,
45
],
[
45,
46
],
[
44,
47
],
[
36,
48
],
[
48,
49
],
[
48,
50
],
[
50,
51
],
[
51,
52
],
[
50,
53
],
[
53,
54
],
[
53,
55
],
[
36,
56
],
[
56,
57
],
[
56,
58
],
[
58,
59
],
[
59,
60
],
[
58,
61
],
[
61,
62
],
[
61,
63
],
[
36,
64
],
[
64,
65
],
[
64,
66
],
[
67,
68
],
[
67,
69
],
[
36,
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
],
[
82,
86
],
[
86,
87
],
[
86,
88
],
[
88,
89
],
[
89,
90
],
[
82,
91
],
[
91,
92
],
[
91,
93
],
[
93,
94
],
[
94,
95
],
[
93,
96
],
[
82,
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
],
[
110,
112
],
[
112,
113
],
[
113,
114
],
[
112,
115
],
[
115,
116
],
[
115,
117
],
[
109,
118
],
[
118,
119
],
[
119,
120
],
[
119,
121
],
[
118,
122
],
[
122,
123
],
[
123,
124
],
[
122,
125
],
[
125,
126
],
[
125,
127
],
[
109,
128
],
[
128,
129
],
[
129,
130
],
[
130,
131
],
[
131,
132
],
[
130,
133
],
[
133,
134
],
[
133,
135
],
[
128,
136
],
[
82,
137
],
[
137,
138
],
[
138,
139
],
[
138,
140
],
[
137,
141
],
[
82,
142
],
[
142,
143
],
[
143,
144
],
[
142,
145
],
[
82,
146
],
[
146,
147
],
[
147,
148
],
[
146,
149
],
[
36,
150
],
[
150,
151
],
[
151,
152
],
[
152,
153
],
[
152,
154
],
[
150,
155
],
[
155,
156
],
[
155,
157
],
[
157,
158
],
[
157,
159
],
[
150,
160
],
[
160,
161
],
[
161,
162
],
[
150,
163
],
[
164,
164
],
[
164,
165
],
[
165,
166
],
[
166,
167
],
[
166,
168
],
[
165,
169
],
[
169,
170
],
[
170,
171
],
[
171,
172
],
[
170,
173
],
[
164,
174
],
[
174,
175
],
[
175,
176
],
[
174,
177
],
[
177,
178
],
[
177,
179
],
[
36,
180
],
[
180,
181
],
[
181,
182
],
[
182,
183
],
[
182,
184
],
[
180,
185
],
[
9,
186
],
[
186,
187
],
[
0,
188
],
[
188,
189
],
[
188,
190
]
] | [
"import java.io.BufferedReader;\nimport java.io.InputStreamReader;\n\npublic class Main {\n\n\tpublic static void main(String[] args) {\n\t\tStringBuilder sb =new StringBuilder();\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\t\tint r,c;\n\t\tString str;\n\t\tString strs[];\n\t\ttry {\n\t\t\tstr = br.readLine();\n\t\t\tstrs=str.split(\" \");\n\t\t\tr=Integer.parseInt(strs[0]);\n\t\t\tc=Integer.parseInt(strs[1]);\n\t\t\tint total[]=new int[c+1];\n\t\t\tfor(int i=0;i<r;i++){\n\t\t\t\tint sum=0;\n\t\t\t\tstr=br.readLine();\n\t\t\t\tstrs=str.split(\" \");\n\t\t\t\tfor(int j=0;j<c;j++){\n\t\t\t\t\tsum+=Integer.parseInt(strs[j]);\n\t\t\t\t\ttotal[j]+=Integer.parseInt(strs[j]);\n\t\t\t\t\tsb.append(strs[j]).append(\" \");\n\t\t\t\t}\n\t\t\t\ttotal[c]+=sum;\n\t\t\t\tsb.append(sum);\n\t\t\t\tsb.append(\"\\n\");\n\t\t\t}\n\t\t\tfor(int i=0;i<c+1;i++){\n\t\t\t\tif(i != 0){\n\t\t\t\t\tsb.append(\" \");\n\t\t\t\t}\n\t\t\t\tsb.append(total[i]);\n\t\t\t}\n\t\t\tSystem.out.println(sb);\n\t\t} catch (Exception e) {\n\t\t\tSystem.err.println(e);\n\t\t}\n\n\t}\n\n}",
"import java.io.BufferedReader;",
"BufferedReader",
"java.io",
"import java.io.InputStreamReader;",
"InputStreamReader",
"java.io",
"public class Main {\n\n\tpublic static void main(String[] args) {\n\t\tStringBuilder sb =new StringBuilder();\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\t\tint r,c;\n\t\tString str;\n\t\tString strs[];\n\t\ttry {\n\t\t\tstr = br.readLine();\n\t\t\tstrs=str.split(\" \");\n\t\t\tr=Integer.parseInt(strs[0]);\n\t\t\tc=Integer.parseInt(strs[1]);\n\t\t\tint total[]=new int[c+1];\n\t\t\tfor(int i=0;i<r;i++){\n\t\t\t\tint sum=0;\n\t\t\t\tstr=br.readLine();\n\t\t\t\tstrs=str.split(\" \");\n\t\t\t\tfor(int j=0;j<c;j++){\n\t\t\t\t\tsum+=Integer.parseInt(strs[j]);\n\t\t\t\t\ttotal[j]+=Integer.parseInt(strs[j]);\n\t\t\t\t\tsb.append(strs[j]).append(\" \");\n\t\t\t\t}\n\t\t\t\ttotal[c]+=sum;\n\t\t\t\tsb.append(sum);\n\t\t\t\tsb.append(\"\\n\");\n\t\t\t}\n\t\t\tfor(int i=0;i<c+1;i++){\n\t\t\t\tif(i != 0){\n\t\t\t\t\tsb.append(\" \");\n\t\t\t\t}\n\t\t\t\tsb.append(total[i]);\n\t\t\t}\n\t\t\tSystem.out.println(sb);\n\t\t} catch (Exception e) {\n\t\t\tSystem.err.println(e);\n\t\t}\n\n\t}\n\n}",
"Main",
"public static void main(String[] args) {\n\t\tStringBuilder sb =new StringBuilder();\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\t\tint r,c;\n\t\tString str;\n\t\tString strs[];\n\t\ttry {\n\t\t\tstr = br.readLine();\n\t\t\tstrs=str.split(\" \");\n\t\t\tr=Integer.parseInt(strs[0]);\n\t\t\tc=Integer.parseInt(strs[1]);\n\t\t\tint total[]=new int[c+1];\n\t\t\tfor(int i=0;i<r;i++){\n\t\t\t\tint sum=0;\n\t\t\t\tstr=br.readLine();\n\t\t\t\tstrs=str.split(\" \");\n\t\t\t\tfor(int j=0;j<c;j++){\n\t\t\t\t\tsum+=Integer.parseInt(strs[j]);\n\t\t\t\t\ttotal[j]+=Integer.parseInt(strs[j]);\n\t\t\t\t\tsb.append(strs[j]).append(\" \");\n\t\t\t\t}\n\t\t\t\ttotal[c]+=sum;\n\t\t\t\tsb.append(sum);\n\t\t\t\tsb.append(\"\\n\");\n\t\t\t}\n\t\t\tfor(int i=0;i<c+1;i++){\n\t\t\t\tif(i != 0){\n\t\t\t\t\tsb.append(\" \");\n\t\t\t\t}\n\t\t\t\tsb.append(total[i]);\n\t\t\t}\n\t\t\tSystem.out.println(sb);\n\t\t} catch (Exception e) {\n\t\t\tSystem.err.println(e);\n\t\t}\n\n\t}",
"main",
"{\n\t\tStringBuilder sb =new StringBuilder();\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\t\tint r,c;\n\t\tString str;\n\t\tString strs[];\n\t\ttry {\n\t\t\tstr = br.readLine();\n\t\t\tstrs=str.split(\" \");\n\t\t\tr=Integer.parseInt(strs[0]);\n\t\t\tc=Integer.parseInt(strs[1]);\n\t\t\tint total[]=new int[c+1];\n\t\t\tfor(int i=0;i<r;i++){\n\t\t\t\tint sum=0;\n\t\t\t\tstr=br.readLine();\n\t\t\t\tstrs=str.split(\" \");\n\t\t\t\tfor(int j=0;j<c;j++){\n\t\t\t\t\tsum+=Integer.parseInt(strs[j]);\n\t\t\t\t\ttotal[j]+=Integer.parseInt(strs[j]);\n\t\t\t\t\tsb.append(strs[j]).append(\" \");\n\t\t\t\t}\n\t\t\t\ttotal[c]+=sum;\n\t\t\t\tsb.append(sum);\n\t\t\t\tsb.append(\"\\n\");\n\t\t\t}\n\t\t\tfor(int i=0;i<c+1;i++){\n\t\t\t\tif(i != 0){\n\t\t\t\t\tsb.append(\" \");\n\t\t\t\t}\n\t\t\t\tsb.append(total[i]);\n\t\t\t}\n\t\t\tSystem.out.println(sb);\n\t\t} catch (Exception e) {\n\t\t\tSystem.err.println(e);\n\t\t}\n\n\t}",
"StringBuilder sb =new StringBuilder();",
"sb",
"new StringBuilder()",
"BufferedReader br = new BufferedReader(new InputStreamReader(System.in));",
"br",
"new BufferedReader(new InputStreamReader(System.in))",
"int r",
"r",
"c;",
"c",
"String str;",
"str",
"String strs[];",
"strs",
"try {\n\t\t\tstr = br.readLine();\n\t\t\tstrs=str.split(\" \");\n\t\t\tr=Integer.parseInt(strs[0]);\n\t\t\tc=Integer.parseInt(strs[1]);\n\t\t\tint total[]=new int[c+1];\n\t\t\tfor(int i=0;i<r;i++){\n\t\t\t\tint sum=0;\n\t\t\t\tstr=br.readLine();\n\t\t\t\tstrs=str.split(\" \");\n\t\t\t\tfor(int j=0;j<c;j++){\n\t\t\t\t\tsum+=Integer.parseInt(strs[j]);\n\t\t\t\t\ttotal[j]+=Integer.parseInt(strs[j]);\n\t\t\t\t\tsb.append(strs[j]).append(\" \");\n\t\t\t\t}\n\t\t\t\ttotal[c]+=sum;\n\t\t\t\tsb.append(sum);\n\t\t\t\tsb.append(\"\\n\");\n\t\t\t}\n\t\t\tfor(int i=0;i<c+1;i++){\n\t\t\t\tif(i != 0){\n\t\t\t\t\tsb.append(\" \");\n\t\t\t\t}\n\t\t\t\tsb.append(total[i]);\n\t\t\t}\n\t\t\tSystem.out.println(sb);\n\t\t} catch (Exception e) {\n\t\t\tSystem.err.println(e);\n\t\t}",
"catch (Exception e) {\n\t\t\tSystem.err.println(e);\n\t\t}",
"Exception 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\t\t\tstr = br.readLine();\n\t\t\tstrs=str.split(\" \");\n\t\t\tr=Integer.parseInt(strs[0]);\n\t\t\tc=Integer.parseInt(strs[1]);\n\t\t\tint total[]=new int[c+1];\n\t\t\tfor(int i=0;i<r;i++){\n\t\t\t\tint sum=0;\n\t\t\t\tstr=br.readLine();\n\t\t\t\tstrs=str.split(\" \");\n\t\t\t\tfor(int j=0;j<c;j++){\n\t\t\t\t\tsum+=Integer.parseInt(strs[j]);\n\t\t\t\t\ttotal[j]+=Integer.parseInt(strs[j]);\n\t\t\t\t\tsb.append(strs[j]).append(\" \");\n\t\t\t\t}\n\t\t\t\ttotal[c]+=sum;\n\t\t\t\tsb.append(sum);\n\t\t\t\tsb.append(\"\\n\");\n\t\t\t}\n\t\t\tfor(int i=0;i<c+1;i++){\n\t\t\t\tif(i != 0){\n\t\t\t\t\tsb.append(\" \");\n\t\t\t\t}\n\t\t\t\tsb.append(total[i]);\n\t\t\t}\n\t\t\tSystem.out.println(sb);\n\t\t}",
"str = br.readLine()",
"str",
"br.readLine()",
"br.readLine",
"br",
"strs=str.split(\" \")",
"strs",
"str.split(\" \")",
"str.split",
"str",
"\" \"",
"r=Integer.parseInt(strs[0])",
"r",
"Integer.parseInt(strs[0])",
"Integer.parseInt",
"Integer",
"strs[0]",
"strs",
"0",
"c=Integer.parseInt(strs[1])",
"c",
"Integer.parseInt(strs[1])",
"Integer.parseInt",
"Integer",
"strs[1]",
"strs",
"1",
"int total[]=new int[c+1];",
"total",
"new int[c+1]",
"c+1",
"c",
"1",
"for(int i=0;i<r;i++){\n\t\t\t\tint sum=0;\n\t\t\t\tstr=br.readLine();\n\t\t\t\tstrs=str.split(\" \");\n\t\t\t\tfor(int j=0;j<c;j++){\n\t\t\t\t\tsum+=Integer.parseInt(strs[j]);\n\t\t\t\t\ttotal[j]+=Integer.parseInt(strs[j]);\n\t\t\t\t\tsb.append(strs[j]).append(\" \");\n\t\t\t\t}\n\t\t\t\ttotal[c]+=sum;\n\t\t\t\tsb.append(sum);\n\t\t\t\tsb.append(\"\\n\");\n\t\t\t}",
"int i=0;",
"int i=0;",
"i",
"0",
"i<r",
"i",
"r",
"i++",
"i++",
"i",
"{\n\t\t\t\tint sum=0;\n\t\t\t\tstr=br.readLine();\n\t\t\t\tstrs=str.split(\" \");\n\t\t\t\tfor(int j=0;j<c;j++){\n\t\t\t\t\tsum+=Integer.parseInt(strs[j]);\n\t\t\t\t\ttotal[j]+=Integer.parseInt(strs[j]);\n\t\t\t\t\tsb.append(strs[j]).append(\" \");\n\t\t\t\t}\n\t\t\t\ttotal[c]+=sum;\n\t\t\t\tsb.append(sum);\n\t\t\t\tsb.append(\"\\n\");\n\t\t\t}",
"{\n\t\t\t\tint sum=0;\n\t\t\t\tstr=br.readLine();\n\t\t\t\tstrs=str.split(\" \");\n\t\t\t\tfor(int j=0;j<c;j++){\n\t\t\t\t\tsum+=Integer.parseInt(strs[j]);\n\t\t\t\t\ttotal[j]+=Integer.parseInt(strs[j]);\n\t\t\t\t\tsb.append(strs[j]).append(\" \");\n\t\t\t\t}\n\t\t\t\ttotal[c]+=sum;\n\t\t\t\tsb.append(sum);\n\t\t\t\tsb.append(\"\\n\");\n\t\t\t}",
"int sum=0;",
"sum",
"0",
"str=br.readLine()",
"str",
"br.readLine()",
"br.readLine",
"br",
"strs=str.split(\" \")",
"strs",
"str.split(\" \")",
"str.split",
"str",
"\" \"",
"for(int j=0;j<c;j++){\n\t\t\t\t\tsum+=Integer.parseInt(strs[j]);\n\t\t\t\t\ttotal[j]+=Integer.parseInt(strs[j]);\n\t\t\t\t\tsb.append(strs[j]).append(\" \");\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\tsum+=Integer.parseInt(strs[j]);\n\t\t\t\t\ttotal[j]+=Integer.parseInt(strs[j]);\n\t\t\t\t\tsb.append(strs[j]).append(\" \");\n\t\t\t\t}",
"{\n\t\t\t\t\tsum+=Integer.parseInt(strs[j]);\n\t\t\t\t\ttotal[j]+=Integer.parseInt(strs[j]);\n\t\t\t\t\tsb.append(strs[j]).append(\" \");\n\t\t\t\t}",
"sum+=Integer.parseInt(strs[j])",
"sum",
"Integer.parseInt(strs[j])",
"Integer.parseInt",
"Integer",
"strs[j]",
"strs",
"j",
"total[j]+=Integer.parseInt(strs[j])",
"total[j]",
"total",
"j",
"Integer.parseInt(strs[j])",
"Integer.parseInt",
"Integer",
"strs[j]",
"strs",
"j",
"sb.append(strs[j]).append(\" \")",
"sb.append(strs[j]).append",
"sb.append(strs[j])",
"sb.append",
"sb",
"strs[j]",
"strs",
"j",
"\" \"",
"total[c]+=sum",
"total[c]",
"total",
"c",
"sum",
"sb.append(sum)",
"sb.append",
"sb",
"sum",
"sb.append(\"\\n\")",
"sb.append",
"sb",
"\"\\n\"",
"for(int i=0;i<c+1;i++){\n\t\t\t\tif(i != 0){\n\t\t\t\t\tsb.append(\" \");\n\t\t\t\t}\n\t\t\t\tsb.append(total[i]);\n\t\t\t}",
"int i=0;",
"int i=0;",
"i",
"0",
"i<c+1",
"i",
"c+1",
"c",
"1",
"i++",
"i++",
"i",
"{\n\t\t\t\tif(i != 0){\n\t\t\t\t\tsb.append(\" \");\n\t\t\t\t}\n\t\t\t\tsb.append(total[i]);\n\t\t\t}",
"{\n\t\t\t\tif(i != 0){\n\t\t\t\t\tsb.append(\" \");\n\t\t\t\t}\n\t\t\t\tsb.append(total[i]);\n\t\t\t}",
"if(i != 0){\n\t\t\t\t\tsb.append(\" \");\n\t\t\t\t}",
"i != 0",
"i",
"0",
"{\n\t\t\t\t\tsb.append(\" \");\n\t\t\t\t}",
"sb.append(\" \")",
"sb.append",
"sb",
"\" \"",
"sb.append(total[i])",
"sb.append",
"sb",
"total[i]",
"total",
"i",
"System.out.println(sb)",
"System.out.println",
"System.out",
"System",
"System.out",
"sb",
"String[] args",
"args",
"public class Main {\n\n\tpublic static void main(String[] args) {\n\t\tStringBuilder sb =new StringBuilder();\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\t\tint r,c;\n\t\tString str;\n\t\tString strs[];\n\t\ttry {\n\t\t\tstr = br.readLine();\n\t\t\tstrs=str.split(\" \");\n\t\t\tr=Integer.parseInt(strs[0]);\n\t\t\tc=Integer.parseInt(strs[1]);\n\t\t\tint total[]=new int[c+1];\n\t\t\tfor(int i=0;i<r;i++){\n\t\t\t\tint sum=0;\n\t\t\t\tstr=br.readLine();\n\t\t\t\tstrs=str.split(\" \");\n\t\t\t\tfor(int j=0;j<c;j++){\n\t\t\t\t\tsum+=Integer.parseInt(strs[j]);\n\t\t\t\t\ttotal[j]+=Integer.parseInt(strs[j]);\n\t\t\t\t\tsb.append(strs[j]).append(\" \");\n\t\t\t\t}\n\t\t\t\ttotal[c]+=sum;\n\t\t\t\tsb.append(sum);\n\t\t\t\tsb.append(\"\\n\");\n\t\t\t}\n\t\t\tfor(int i=0;i<c+1;i++){\n\t\t\t\tif(i != 0){\n\t\t\t\t\tsb.append(\" \");\n\t\t\t\t}\n\t\t\t\tsb.append(total[i]);\n\t\t\t}\n\t\t\tSystem.out.println(sb);\n\t\t} catch (Exception e) {\n\t\t\tSystem.err.println(e);\n\t\t}\n\n\t}\n\n}",
"public class Main {\n\n\tpublic static void main(String[] args) {\n\t\tStringBuilder sb =new StringBuilder();\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\t\tint r,c;\n\t\tString str;\n\t\tString strs[];\n\t\ttry {\n\t\t\tstr = br.readLine();\n\t\t\tstrs=str.split(\" \");\n\t\t\tr=Integer.parseInt(strs[0]);\n\t\t\tc=Integer.parseInt(strs[1]);\n\t\t\tint total[]=new int[c+1];\n\t\t\tfor(int i=0;i<r;i++){\n\t\t\t\tint sum=0;\n\t\t\t\tstr=br.readLine();\n\t\t\t\tstrs=str.split(\" \");\n\t\t\t\tfor(int j=0;j<c;j++){\n\t\t\t\t\tsum+=Integer.parseInt(strs[j]);\n\t\t\t\t\ttotal[j]+=Integer.parseInt(strs[j]);\n\t\t\t\t\tsb.append(strs[j]).append(\" \");\n\t\t\t\t}\n\t\t\t\ttotal[c]+=sum;\n\t\t\t\tsb.append(sum);\n\t\t\t\tsb.append(\"\\n\");\n\t\t\t}\n\t\t\tfor(int i=0;i<c+1;i++){\n\t\t\t\tif(i != 0){\n\t\t\t\t\tsb.append(\" \");\n\t\t\t\t}\n\t\t\t\tsb.append(total[i]);\n\t\t\t}\n\t\t\tSystem.out.println(sb);\n\t\t} catch (Exception e) {\n\t\t\tSystem.err.println(e);\n\t\t}\n\n\t}\n\n}",
"Main"
] | import java.io.BufferedReader;
import java.io.InputStreamReader;
public class Main {
public static void main(String[] args) {
StringBuilder sb =new StringBuilder();
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
int r,c;
String str;
String strs[];
try {
str = br.readLine();
strs=str.split(" ");
r=Integer.parseInt(strs[0]);
c=Integer.parseInt(strs[1]);
int total[]=new int[c+1];
for(int i=0;i<r;i++){
int sum=0;
str=br.readLine();
strs=str.split(" ");
for(int j=0;j<c;j++){
sum+=Integer.parseInt(strs[j]);
total[j]+=Integer.parseInt(strs[j]);
sb.append(strs[j]).append(" ");
}
total[c]+=sum;
sb.append(sum);
sb.append("\n");
}
for(int i=0;i<c+1;i++){
if(i != 0){
sb.append(" ");
}
sb.append(total[i]);
}
System.out.println(sb);
} catch (Exception e) {
System.err.println(e);
}
}
} |
[
7,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
41,
13,
41,
13,
41,
13,
41,
13,
41,
13,
41,
13,
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,
20,
13,
13,
0,
13,
20,
13,
0,
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,
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,
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,
4,
18,
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
],
[
229,
8
],
[
229,
9
],
[
9,
10
],
[
9,
11
],
[
11,
12
],
[
12,
13
],
[
12,
14
],
[
11,
15
],
[
15,
16
],
[
11,
17
],
[
17,
18
],
[
11,
19
],
[
19,
20
],
[
11,
21
],
[
21,
22
],
[
11,
23
],
[
23,
24
],
[
11,
25
],
[
25,
26
],
[
11,
27
],
[
27,
28
],
[
11,
29
],
[
29,
30
],
[
29,
31
],
[
11,
32
],
[
32,
33
],
[
32,
34
],
[
34,
35
],
[
35,
36
],
[
11,
37
],
[
37,
38
],
[
37,
39
],
[
39,
40
],
[
40,
41
],
[
39,
42
],
[
11,
43
],
[
43,
44
],
[
43,
45
],
[
45,
46
],
[
46,
47
],
[
45,
48
],
[
48,
49
],
[
48,
50
],
[
11,
51
],
[
51,
52
],
[
51,
53
],
[
53,
54
],
[
54,
55
],
[
53,
56
],
[
56,
57
],
[
56,
58
],
[
11,
59
],
[
59,
60
],
[
59,
61
],
[
11,
64
],
[
64,
65
],
[
64,
66
],
[
11,
68
],
[
68,
69
],
[
68,
70
],
[
11,
72
],
[
72,
73
],
[
73,
74
],
[
74,
75
],
[
74,
76
],
[
72,
77
],
[
77,
78
],
[
77,
79
],
[
72,
80
],
[
80,
81
],
[
81,
82
],
[
72,
83
],
[
84,
84
],
[
84,
85
],
[
85,
86
],
[
85,
87
],
[
87,
88
],
[
88,
89
],
[
84,
90
],
[
90,
91
],
[
90,
92
],
[
92,
93
],
[
93,
94
],
[
92,
95
],
[
84,
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
],
[
115,
118
],
[
118,
119
],
[
118,
120
],
[
108,
121
],
[
121,
122
],
[
122,
123
],
[
122,
124
],
[
121,
125
],
[
125,
126
],
[
126,
127
],
[
126,
128
],
[
125,
129
],
[
108,
130
],
[
130,
131
],
[
131,
132
],
[
131,
133
],
[
130,
134
],
[
134,
135
],
[
135,
136
],
[
135,
137
],
[
134,
138
],
[
108,
139
],
[
139,
140
],
[
139,
141
],
[
141,
142
],
[
142,
143
],
[
142,
144
],
[
141,
145
],
[
11,
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
],
[
174,
175
],
[
174,
176
],
[
172,
177
],
[
177,
178
],
[
178,
179
],
[
179,
180
],
[
179,
181
],
[
178,
182
],
[
177,
183
],
[
158,
184
],
[
184,
185
],
[
185,
186
],
[
186,
187
],
[
186,
188
],
[
184,
189
],
[
189,
190
],
[
189,
191
],
[
158,
192
],
[
192,
193
],
[
193,
194
],
[
194,
195
],
[
194,
196
],
[
11,
197
],
[
197,
198
],
[
198,
199
],
[
199,
200
],
[
199,
201
],
[
197,
202
],
[
202,
203
],
[
202,
204
],
[
197,
205
],
[
205,
206
],
[
206,
207
],
[
197,
208
],
[
209,
209
],
[
209,
210
],
[
210,
211
],
[
211,
212
],
[
212,
213
],
[
212,
214
],
[
210,
215
],
[
215,
216
],
[
216,
217
],
[
216,
218
],
[
215,
219
],
[
11,
220
],
[
220,
221
],
[
221,
222
],
[
222,
223
],
[
222,
224
],
[
220,
225
],
[
9,
226
],
[
226,
227
],
[
0,
228
],
[
228,
229
],
[
228,
230
]
] | [
"import java.util.*;\nimport java.text.*;\n/*\nMain class for AOJ where there is no input.\n*/\npublic class Main{\n public static void main(String[] args){\n Scanner sc = new Scanner(System.in);\n String str;\n String[] arr;\n \n int row;\n int column;\n \n int[][] a;\n int[] sum_r;\n int[] sum_c;\n int grandTotal = 0;\n \n //read column and row\n str = sc.nextLine();\n arr = str.split(\" \");\n \n row = Integer.parseInt(arr[0]);\n column = Integer.parseInt(arr[1]);\n \n a = new int[row][column];\n sum_r = new int[row];\n sum_c = new int[column];\n \n //read the table\n for(int i = 0; i < row; i ++){\n str = sc.nextLine();\n arr = str.split(\" \");\n for(int j = 0; j < column; j ++){\n a[i][j] = Integer.parseInt(arr[j]);\n sum_r[i] += a[i][j];\n sum_c[j] += a[i][j];\n grandTotal += a[i][j];\n \n }\n }\n \n //check\n for(int i = 0; i < row; i ++){\n for(int j = 0; j < column; j ++){\n System.out.print(a[i][j] + \" \");\n }\n System.out.print(sum_r[i]);\n System.out.println();\n }\n \n for(int i = 0; i < column; i++){\n System.out.print(sum_c[i] + \" \");\n }\n System.out.println(grandTotal);\n \n \n \n }//main\n}//class",
"import java.util.*;",
"util.*",
"java",
"import java.text.*;",
"text.*",
"java",
"public class Main{\n public static void main(String[] args){\n Scanner sc = new Scanner(System.in);\n String str;\n String[] arr;\n \n int row;\n int column;\n \n int[][] a;\n int[] sum_r;\n int[] sum_c;\n int grandTotal = 0;\n \n //read column and row\n str = sc.nextLine();\n arr = str.split(\" \");\n \n row = Integer.parseInt(arr[0]);\n column = Integer.parseInt(arr[1]);\n \n a = new int[row][column];\n sum_r = new int[row];\n sum_c = new int[column];\n \n //read the table\n for(int i = 0; i < row; i ++){\n str = sc.nextLine();\n arr = str.split(\" \");\n for(int j = 0; j < column; j ++){\n a[i][j] = Integer.parseInt(arr[j]);\n sum_r[i] += a[i][j];\n sum_c[j] += a[i][j];\n grandTotal += a[i][j];\n \n }\n }\n \n //check\n for(int i = 0; i < row; i ++){\n for(int j = 0; j < column; j ++){\n System.out.print(a[i][j] + \" \");\n }\n System.out.print(sum_r[i]);\n System.out.println();\n }\n \n for(int i = 0; i < column; i++){\n System.out.print(sum_c[i] + \" \");\n }\n System.out.println(grandTotal);\n \n \n \n }//main\n}//class",
"Main",
"public static void main(String[] args){\n Scanner sc = new Scanner(System.in);\n String str;\n String[] arr;\n \n int row;\n int column;\n \n int[][] a;\n int[] sum_r;\n int[] sum_c;\n int grandTotal = 0;\n \n //read column and row\n str = sc.nextLine();\n arr = str.split(\" \");\n \n row = Integer.parseInt(arr[0]);\n column = Integer.parseInt(arr[1]);\n \n a = new int[row][column];\n sum_r = new int[row];\n sum_c = new int[column];\n \n //read the table\n for(int i = 0; i < row; i ++){\n str = sc.nextLine();\n arr = str.split(\" \");\n for(int j = 0; j < column; j ++){\n a[i][j] = Integer.parseInt(arr[j]);\n sum_r[i] += a[i][j];\n sum_c[j] += a[i][j];\n grandTotal += a[i][j];\n \n }\n }\n \n //check\n for(int i = 0; i < row; i ++){\n for(int j = 0; j < column; j ++){\n System.out.print(a[i][j] + \" \");\n }\n System.out.print(sum_r[i]);\n System.out.println();\n }\n \n for(int i = 0; i < column; i++){\n System.out.print(sum_c[i] + \" \");\n }\n System.out.println(grandTotal);\n \n \n \n }//main",
"main",
"{\n Scanner sc = new Scanner(System.in);\n String str;\n String[] arr;\n \n int row;\n int column;\n \n int[][] a;\n int[] sum_r;\n int[] sum_c;\n int grandTotal = 0;\n \n //read column and row\n str = sc.nextLine();\n arr = str.split(\" \");\n \n row = Integer.parseInt(arr[0]);\n column = Integer.parseInt(arr[1]);\n \n a = new int[row][column];\n sum_r = new int[row];\n sum_c = new int[column];\n \n //read the table\n for(int i = 0; i < row; i ++){\n str = sc.nextLine();\n arr = str.split(\" \");\n for(int j = 0; j < column; j ++){\n a[i][j] = Integer.parseInt(arr[j]);\n sum_r[i] += a[i][j];\n sum_c[j] += a[i][j];\n grandTotal += a[i][j];\n \n }\n }\n \n //check\n for(int i = 0; i < row; i ++){\n for(int j = 0; j < column; j ++){\n System.out.print(a[i][j] + \" \");\n }\n System.out.print(sum_r[i]);\n System.out.println();\n }\n \n for(int i = 0; i < column; i++){\n System.out.print(sum_c[i] + \" \");\n }\n System.out.println(grandTotal);\n \n \n \n }",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"String str;",
"str",
"String[] arr;",
"arr",
"int row;",
"row",
"int column;",
"column",
"int[][] a;",
"a",
"int[] sum_r;",
"sum_r",
"int[] sum_c;",
"sum_c",
"int grandTotal = 0;",
"grandTotal",
"0",
"str = sc.nextLine()",
"str",
"sc.nextLine()",
"sc.nextLine",
"sc",
"arr = str.split(\" \")",
"arr",
"str.split(\" \")",
"str.split",
"str",
"\" \"",
"row = Integer.parseInt(arr[0])",
"row",
"Integer.parseInt(arr[0])",
"Integer.parseInt",
"Integer",
"arr[0]",
"arr",
"0",
"column = Integer.parseInt(arr[1])",
"column",
"Integer.parseInt(arr[1])",
"Integer.parseInt",
"Integer",
"arr[1]",
"arr",
"1",
"a = new int[row][column]",
"a",
"new int[row][column]",
"row",
"column",
"sum_r = new int[row]",
"sum_r",
"new int[row]",
"row",
"sum_c = new int[column]",
"sum_c",
"new int[column]",
"column",
"for(int i = 0; i < row; i ++){\n str = sc.nextLine();\n arr = str.split(\" \");\n for(int j = 0; j < column; j ++){\n a[i][j] = Integer.parseInt(arr[j]);\n sum_r[i] += a[i][j];\n sum_c[j] += a[i][j];\n grandTotal += a[i][j];\n \n }\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < row",
"i",
"row",
"i ++",
"i ++",
"i",
"{\n str = sc.nextLine();\n arr = str.split(\" \");\n for(int j = 0; j < column; j ++){\n a[i][j] = Integer.parseInt(arr[j]);\n sum_r[i] += a[i][j];\n sum_c[j] += a[i][j];\n grandTotal += a[i][j];\n \n }\n }",
"{\n str = sc.nextLine();\n arr = str.split(\" \");\n for(int j = 0; j < column; j ++){\n a[i][j] = Integer.parseInt(arr[j]);\n sum_r[i] += a[i][j];\n sum_c[j] += a[i][j];\n grandTotal += a[i][j];\n \n }\n }",
"str = sc.nextLine()",
"str",
"sc.nextLine()",
"sc.nextLine",
"sc",
"arr = str.split(\" \")",
"arr",
"str.split(\" \")",
"str.split",
"str",
"\" \"",
"for(int j = 0; j < column; j ++){\n a[i][j] = Integer.parseInt(arr[j]);\n sum_r[i] += a[i][j];\n sum_c[j] += a[i][j];\n grandTotal += a[i][j];\n \n }",
"int j = 0;",
"int j = 0;",
"j",
"0",
"j < column",
"j",
"column",
"j ++",
"j ++",
"j",
"{\n a[i][j] = Integer.parseInt(arr[j]);\n sum_r[i] += a[i][j];\n sum_c[j] += a[i][j];\n grandTotal += a[i][j];\n \n }",
"{\n a[i][j] = Integer.parseInt(arr[j]);\n sum_r[i] += a[i][j];\n sum_c[j] += a[i][j];\n grandTotal += a[i][j];\n \n }",
"a[i][j] = Integer.parseInt(arr[j])",
"a[i][j]",
"a[i]",
"a",
"i",
"j",
"Integer.parseInt(arr[j])",
"Integer.parseInt",
"Integer",
"arr[j]",
"arr",
"j",
"sum_r[i] += a[i][j]",
"sum_r[i]",
"sum_r",
"i",
"a[i][j]",
"a[i]",
"a",
"i",
"j",
"sum_c[j] += a[i][j]",
"sum_c[j]",
"sum_c",
"j",
"a[i][j]",
"a[i]",
"a",
"i",
"j",
"grandTotal += a[i][j]",
"grandTotal",
"a[i][j]",
"a[i]",
"a",
"i",
"j",
"for(int i = 0; i < row; i ++){\n for(int j = 0; j < column; j ++){\n System.out.print(a[i][j] + \" \");\n }\n System.out.print(sum_r[i]);\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 < column; j ++){\n System.out.print(a[i][j] + \" \");\n }\n System.out.print(sum_r[i]);\n System.out.println();\n }",
"{\n for(int j = 0; j < column; j ++){\n System.out.print(a[i][j] + \" \");\n }\n System.out.print(sum_r[i]);\n System.out.println();\n }",
"for(int j = 0; j < column; j ++){\n System.out.print(a[i][j] + \" \");\n }",
"int j = 0;",
"int j = 0;",
"j",
"0",
"j < column",
"j",
"column",
"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.print(sum_r[i])",
"System.out.print",
"System.out",
"System",
"System.out",
"sum_r[i]",
"sum_r",
"i",
"System.out.println()",
"System.out.println",
"System.out",
"System",
"System.out",
"for(int i = 0; i < column; i++){\n System.out.print(sum_c[i] + \" \");\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < column",
"i",
"column",
"i++",
"i++",
"i",
"{\n System.out.print(sum_c[i] + \" \");\n }",
"{\n System.out.print(sum_c[i] + \" \");\n }",
"System.out.print(sum_c[i] + \" \")",
"System.out.print",
"System.out",
"System",
"System.out",
"sum_c[i] + \" \"",
"sum_c[i]",
"sum_c",
"i",
"\" \"",
"System.out.println(grandTotal)",
"System.out.println",
"System.out",
"System",
"System.out",
"grandTotal",
"String[] args",
"args",
"public class Main{\n public static void main(String[] args){\n Scanner sc = new Scanner(System.in);\n String str;\n String[] arr;\n \n int row;\n int column;\n \n int[][] a;\n int[] sum_r;\n int[] sum_c;\n int grandTotal = 0;\n \n //read column and row\n str = sc.nextLine();\n arr = str.split(\" \");\n \n row = Integer.parseInt(arr[0]);\n column = Integer.parseInt(arr[1]);\n \n a = new int[row][column];\n sum_r = new int[row];\n sum_c = new int[column];\n \n //read the table\n for(int i = 0; i < row; i ++){\n str = sc.nextLine();\n arr = str.split(\" \");\n for(int j = 0; j < column; j ++){\n a[i][j] = Integer.parseInt(arr[j]);\n sum_r[i] += a[i][j];\n sum_c[j] += a[i][j];\n grandTotal += a[i][j];\n \n }\n }\n \n //check\n for(int i = 0; i < row; i ++){\n for(int j = 0; j < column; j ++){\n System.out.print(a[i][j] + \" \");\n }\n System.out.print(sum_r[i]);\n System.out.println();\n }\n \n for(int i = 0; i < column; i++){\n System.out.print(sum_c[i] + \" \");\n }\n System.out.println(grandTotal);\n \n \n \n }//main\n}//class",
"public class Main{\n public static void main(String[] args){\n Scanner sc = new Scanner(System.in);\n String str;\n String[] arr;\n \n int row;\n int column;\n \n int[][] a;\n int[] sum_r;\n int[] sum_c;\n int grandTotal = 0;\n \n //read column and row\n str = sc.nextLine();\n arr = str.split(\" \");\n \n row = Integer.parseInt(arr[0]);\n column = Integer.parseInt(arr[1]);\n \n a = new int[row][column];\n sum_r = new int[row];\n sum_c = new int[column];\n \n //read the table\n for(int i = 0; i < row; i ++){\n str = sc.nextLine();\n arr = str.split(\" \");\n for(int j = 0; j < column; j ++){\n a[i][j] = Integer.parseInt(arr[j]);\n sum_r[i] += a[i][j];\n sum_c[j] += a[i][j];\n grandTotal += a[i][j];\n \n }\n }\n \n //check\n for(int i = 0; i < row; i ++){\n for(int j = 0; j < column; j ++){\n System.out.print(a[i][j] + \" \");\n }\n System.out.print(sum_r[i]);\n System.out.println();\n }\n \n for(int i = 0; i < column; i++){\n System.out.print(sum_c[i] + \" \");\n }\n System.out.println(grandTotal);\n \n \n \n }//main\n}//class",
"Main"
] | import java.util.*;
import java.text.*;
/*
Main class for AOJ where there is no input.
*/
public class Main{
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
String str;
String[] arr;
int row;
int column;
int[][] a;
int[] sum_r;
int[] sum_c;
int grandTotal = 0;
//read column and row
str = sc.nextLine();
arr = str.split(" ");
row = Integer.parseInt(arr[0]);
column = Integer.parseInt(arr[1]);
a = new int[row][column];
sum_r = new int[row];
sum_c = new int[column];
//read the table
for(int i = 0; i < row; i ++){
str = sc.nextLine();
arr = str.split(" ");
for(int j = 0; j < column; j ++){
a[i][j] = Integer.parseInt(arr[j]);
sum_r[i] += a[i][j];
sum_c[j] += a[i][j];
grandTotal += a[i][j];
}
}
//check
for(int i = 0; i < row; i ++){
for(int j = 0; j < column; j ++){
System.out.print(a[i][j] + " ");
}
System.out.print(sum_r[i]);
System.out.println();
}
for(int i = 0; i < column; i++){
System.out.print(sum_c[i] + " ");
}
System.out.println(grandTotal);
}//main
}//class |
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
17,
38,
30,
14,
2,
13,
17,
4,
18,
13,
30,
0,
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,
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,
18,
13,
13,
1,
40,
13,
30,
30,
4,
18,
18,
13,
13,
18,
18,
13,
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,
17,
18,
18,
13,
13,
13,
4,
18,
18,
13,
13,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
231,
5
],
[
231,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
13,
14
],
[
14,
15
],
[
15,
16
],
[
15,
17
],
[
14,
18
],
[
18,
19
],
[
19,
20
],
[
12,
21
],
[
21,
22
],
[
22,
23
],
[
22,
24
],
[
21,
25
],
[
25,
26
],
[
21,
27
],
[
27,
28
],
[
21,
29
],
[
29,
30
],
[
29,
31
],
[
31,
32
],
[
32,
33
],
[
21,
34
],
[
34,
35
],
[
34,
36
],
[
36,
37
],
[
37,
38
],
[
21,
39
],
[
39,
40
],
[
39,
41
],
[
42,
43
],
[
42,
44
],
[
45,
46
],
[
45,
47
],
[
21,
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
],
[
21,
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
],
[
95,
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
],
[
95,
119
],
[
119,
120
],
[
120,
121
],
[
121,
122
],
[
121,
123
],
[
120,
124
],
[
119,
125
],
[
21,
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
],
[
158,
160
],
[
157,
161
],
[
138,
162
],
[
162,
163
],
[
163,
164
],
[
164,
165
],
[
164,
166
],
[
163,
167
],
[
162,
168
],
[
21,
169
],
[
169,
170
],
[
170,
171
],
[
171,
172
],
[
171,
173
],
[
169,
174
],
[
174,
175
],
[
174,
176
],
[
176,
177
],
[
176,
178
],
[
169,
179
],
[
179,
180
],
[
180,
181
],
[
169,
182
],
[
183,
183
],
[
183,
184
],
[
184,
185
],
[
185,
186
],
[
186,
187
],
[
186,
188
],
[
184,
189
],
[
189,
190
],
[
190,
191
],
[
190,
192
],
[
189,
193
],
[
183,
194
],
[
194,
195
],
[
195,
196
],
[
196,
197
],
[
196,
198
],
[
194,
199
],
[
199,
200
],
[
199,
201
],
[
201,
202
],
[
202,
203
],
[
202,
204
],
[
201,
205
],
[
194,
206
],
[
206,
207
],
[
207,
208
],
[
194,
209
],
[
210,
210
],
[
210,
211
],
[
211,
212
],
[
212,
213
],
[
213,
214
],
[
213,
215
],
[
211,
216
],
[
216,
217
],
[
216,
218
],
[
218,
219
],
[
219,
220
],
[
219,
221
],
[
218,
222
],
[
183,
223
],
[
223,
224
],
[
224,
225
],
[
225,
226
],
[
225,
227
],
[
6,
228
],
[
228,
229
],
[
0,
230
],
[
230,
231
],
[
230,
232
]
] | [
"import java.util.Scanner;\n\npublic class Main{\n\tpublic static void main(String[] args){\n\t\tScanner scan = null;\n\t\ttry{\n\t\t\tscan = new Scanner(System.in);\n\t\t\tint r ,c;\n\t\t\tr = scan.nextInt();\n\t\t\tc = scan.nextInt();\n\t\t\tint[][] matrix = new int[r + 1][c + 1];\n\t\t\tfor(int i = 0; i < r ;i++){\n\t\t\t\tfor(int j = 0 ; j < c;j++){\n\t\t\t\t\tmatrix[i][j] = scan.nextInt();\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor(int i = 0 ;i < r;i++){\n\t\t\t\tint sum = 0;\n\t\t\t\tfor(int j = 0; j < c;j++){\n\t\t\t\t\tsum += matrix[i][j];\n\t\t\t\t}\n\t\t\t\tmatrix[i][c] = sum;\n\t\t\t}\n\t\t\tfor(int i = 0 ; i <= c;i++){\n\t\t\t\tint sum = 0;\n\t\t\t\tfor(int j = 0 ; j < r; j++){\n\t\t\t\t\tsum += matrix[j][i];\n\t\t\t\t}\n\t\t\t\tmatrix[r][i] = sum;\n\t\t\t}\n\t\t\tfor(int i = 0 ; i < matrix.length;i++){\n\t\t\t\tSystem.out.print(matrix[i][0]);\n\t\t\t\tfor(int j = 1 ; j < matrix[i].length;j++){\n\t\t\t\t\tSystem.out.print(\" \" + matrix[i][j]);\n\t\t\t\t}\n\t\t\t\tSystem.out.println();\n\t\t\t}\n\t\t}finally{\n\t\t\tif(scan !=null)scan.close();\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 = null;\n\t\ttry{\n\t\t\tscan = new Scanner(System.in);\n\t\t\tint r ,c;\n\t\t\tr = scan.nextInt();\n\t\t\tc = scan.nextInt();\n\t\t\tint[][] matrix = new int[r + 1][c + 1];\n\t\t\tfor(int i = 0; i < r ;i++){\n\t\t\t\tfor(int j = 0 ; j < c;j++){\n\t\t\t\t\tmatrix[i][j] = scan.nextInt();\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor(int i = 0 ;i < r;i++){\n\t\t\t\tint sum = 0;\n\t\t\t\tfor(int j = 0; j < c;j++){\n\t\t\t\t\tsum += matrix[i][j];\n\t\t\t\t}\n\t\t\t\tmatrix[i][c] = sum;\n\t\t\t}\n\t\t\tfor(int i = 0 ; i <= c;i++){\n\t\t\t\tint sum = 0;\n\t\t\t\tfor(int j = 0 ; j < r; j++){\n\t\t\t\t\tsum += matrix[j][i];\n\t\t\t\t}\n\t\t\t\tmatrix[r][i] = sum;\n\t\t\t}\n\t\t\tfor(int i = 0 ; i < matrix.length;i++){\n\t\t\t\tSystem.out.print(matrix[i][0]);\n\t\t\t\tfor(int j = 1 ; j < matrix[i].length;j++){\n\t\t\t\t\tSystem.out.print(\" \" + matrix[i][j]);\n\t\t\t\t}\n\t\t\t\tSystem.out.println();\n\t\t\t}\n\t\t}finally{\n\t\t\tif(scan !=null)scan.close();\n\t\t}\n\t}\n}",
"Main",
"public static void main(String[] args){\n\t\tScanner scan = null;\n\t\ttry{\n\t\t\tscan = new Scanner(System.in);\n\t\t\tint r ,c;\n\t\t\tr = scan.nextInt();\n\t\t\tc = scan.nextInt();\n\t\t\tint[][] matrix = new int[r + 1][c + 1];\n\t\t\tfor(int i = 0; i < r ;i++){\n\t\t\t\tfor(int j = 0 ; j < c;j++){\n\t\t\t\t\tmatrix[i][j] = scan.nextInt();\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor(int i = 0 ;i < r;i++){\n\t\t\t\tint sum = 0;\n\t\t\t\tfor(int j = 0; j < c;j++){\n\t\t\t\t\tsum += matrix[i][j];\n\t\t\t\t}\n\t\t\t\tmatrix[i][c] = sum;\n\t\t\t}\n\t\t\tfor(int i = 0 ; i <= c;i++){\n\t\t\t\tint sum = 0;\n\t\t\t\tfor(int j = 0 ; j < r; j++){\n\t\t\t\t\tsum += matrix[j][i];\n\t\t\t\t}\n\t\t\t\tmatrix[r][i] = sum;\n\t\t\t}\n\t\t\tfor(int i = 0 ; i < matrix.length;i++){\n\t\t\t\tSystem.out.print(matrix[i][0]);\n\t\t\t\tfor(int j = 1 ; j < matrix[i].length;j++){\n\t\t\t\t\tSystem.out.print(\" \" + matrix[i][j]);\n\t\t\t\t}\n\t\t\t\tSystem.out.println();\n\t\t\t}\n\t\t}finally{\n\t\t\tif(scan !=null)scan.close();\n\t\t}\n\t}",
"main",
"{\n\t\tScanner scan = null;\n\t\ttry{\n\t\t\tscan = new Scanner(System.in);\n\t\t\tint r ,c;\n\t\t\tr = scan.nextInt();\n\t\t\tc = scan.nextInt();\n\t\t\tint[][] matrix = new int[r + 1][c + 1];\n\t\t\tfor(int i = 0; i < r ;i++){\n\t\t\t\tfor(int j = 0 ; j < c;j++){\n\t\t\t\t\tmatrix[i][j] = scan.nextInt();\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor(int i = 0 ;i < r;i++){\n\t\t\t\tint sum = 0;\n\t\t\t\tfor(int j = 0; j < c;j++){\n\t\t\t\t\tsum += matrix[i][j];\n\t\t\t\t}\n\t\t\t\tmatrix[i][c] = sum;\n\t\t\t}\n\t\t\tfor(int i = 0 ; i <= c;i++){\n\t\t\t\tint sum = 0;\n\t\t\t\tfor(int j = 0 ; j < r; j++){\n\t\t\t\t\tsum += matrix[j][i];\n\t\t\t\t}\n\t\t\t\tmatrix[r][i] = sum;\n\t\t\t}\n\t\t\tfor(int i = 0 ; i < matrix.length;i++){\n\t\t\t\tSystem.out.print(matrix[i][0]);\n\t\t\t\tfor(int j = 1 ; j < matrix[i].length;j++){\n\t\t\t\t\tSystem.out.print(\" \" + matrix[i][j]);\n\t\t\t\t}\n\t\t\t\tSystem.out.println();\n\t\t\t}\n\t\t}finally{\n\t\t\tif(scan !=null)scan.close();\n\t\t}\n\t}",
"Scanner scan = null;",
"scan",
"null",
"try{\n\t\t\tscan = new Scanner(System.in);\n\t\t\tint r ,c;\n\t\t\tr = scan.nextInt();\n\t\t\tc = scan.nextInt();\n\t\t\tint[][] matrix = new int[r + 1][c + 1];\n\t\t\tfor(int i = 0; i < r ;i++){\n\t\t\t\tfor(int j = 0 ; j < c;j++){\n\t\t\t\t\tmatrix[i][j] = scan.nextInt();\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor(int i = 0 ;i < r;i++){\n\t\t\t\tint sum = 0;\n\t\t\t\tfor(int j = 0; j < c;j++){\n\t\t\t\t\tsum += matrix[i][j];\n\t\t\t\t}\n\t\t\t\tmatrix[i][c] = sum;\n\t\t\t}\n\t\t\tfor(int i = 0 ; i <= c;i++){\n\t\t\t\tint sum = 0;\n\t\t\t\tfor(int j = 0 ; j < r; j++){\n\t\t\t\t\tsum += matrix[j][i];\n\t\t\t\t}\n\t\t\t\tmatrix[r][i] = sum;\n\t\t\t}\n\t\t\tfor(int i = 0 ; i < matrix.length;i++){\n\t\t\t\tSystem.out.print(matrix[i][0]);\n\t\t\t\tfor(int j = 1 ; j < matrix[i].length;j++){\n\t\t\t\t\tSystem.out.print(\" \" + matrix[i][j]);\n\t\t\t\t}\n\t\t\t\tSystem.out.println();\n\t\t\t}\n\t\t}finally{\n\t\t\tif(scan !=null)scan.close();\n\t\t}",
"{\n\t\t\tif(scan !=null)scan.close();\n\t\t}",
"if(scan !=null)scan.close();",
"scan !=null",
"scan",
"null",
"scan.close()",
"scan.close",
"scan",
"{\n\t\t\tscan = new Scanner(System.in);\n\t\t\tint r ,c;\n\t\t\tr = scan.nextInt();\n\t\t\tc = scan.nextInt();\n\t\t\tint[][] matrix = new int[r + 1][c + 1];\n\t\t\tfor(int i = 0; i < r ;i++){\n\t\t\t\tfor(int j = 0 ; j < c;j++){\n\t\t\t\t\tmatrix[i][j] = scan.nextInt();\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor(int i = 0 ;i < r;i++){\n\t\t\t\tint sum = 0;\n\t\t\t\tfor(int j = 0; j < c;j++){\n\t\t\t\t\tsum += matrix[i][j];\n\t\t\t\t}\n\t\t\t\tmatrix[i][c] = sum;\n\t\t\t}\n\t\t\tfor(int i = 0 ; i <= c;i++){\n\t\t\t\tint sum = 0;\n\t\t\t\tfor(int j = 0 ; j < r; j++){\n\t\t\t\t\tsum += matrix[j][i];\n\t\t\t\t}\n\t\t\t\tmatrix[r][i] = sum;\n\t\t\t}\n\t\t\tfor(int i = 0 ; i < matrix.length;i++){\n\t\t\t\tSystem.out.print(matrix[i][0]);\n\t\t\t\tfor(int j = 1 ; j < matrix[i].length;j++){\n\t\t\t\t\tSystem.out.print(\" \" + matrix[i][j]);\n\t\t\t\t}\n\t\t\t\tSystem.out.println();\n\t\t\t}\n\t\t}",
"scan = new Scanner(System.in)",
"scan",
"new Scanner(System.in)",
"int r",
"r",
"c;",
"c",
"r = scan.nextInt()",
"r",
"scan.nextInt()",
"scan.nextInt",
"scan",
"c = scan.nextInt()",
"c",
"scan.nextInt()",
"scan.nextInt",
"scan",
"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\t\t\tfor(int j = 0 ; j < c;j++){\n\t\t\t\t\tmatrix[i][j] = scan.nextInt();\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\tfor(int j = 0 ; j < c;j++){\n\t\t\t\t\tmatrix[i][j] = scan.nextInt();\n\t\t\t\t}\n\t\t\t}",
"{\n\t\t\t\tfor(int j = 0 ; j < c;j++){\n\t\t\t\t\tmatrix[i][j] = scan.nextInt();\n\t\t\t\t}\n\t\t\t}",
"for(int j = 0 ; j < c;j++){\n\t\t\t\t\tmatrix[i][j] = scan.nextInt();\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\tmatrix[i][j] = scan.nextInt();\n\t\t\t\t}",
"{\n\t\t\t\t\tmatrix[i][j] = scan.nextInt();\n\t\t\t\t}",
"matrix[i][j] = scan.nextInt()",
"matrix[i][j]",
"matrix[i]",
"matrix",
"i",
"j",
"scan.nextInt()",
"scan.nextInt",
"scan",
"for(int i = 0 ;i < r;i++){\n\t\t\t\tint sum = 0;\n\t\t\t\tfor(int j = 0; j < c;j++){\n\t\t\t\t\tsum += matrix[i][j];\n\t\t\t\t}\n\t\t\t\tmatrix[i][c] = sum;\n\t\t\t}",
"int i = 0 ;",
"int i = 0 ;",
"i",
"0",
"i < r",
"i",
"r",
"i++",
"i++",
"i",
"{\n\t\t\t\tint sum = 0;\n\t\t\t\tfor(int j = 0; j < c;j++){\n\t\t\t\t\tsum += matrix[i][j];\n\t\t\t\t}\n\t\t\t\tmatrix[i][c] = sum;\n\t\t\t}",
"{\n\t\t\t\tint sum = 0;\n\t\t\t\tfor(int j = 0; j < c;j++){\n\t\t\t\t\tsum += matrix[i][j];\n\t\t\t\t}\n\t\t\t\tmatrix[i][c] = sum;\n\t\t\t}",
"int sum = 0;",
"sum",
"0",
"for(int j = 0; j < c;j++){\n\t\t\t\t\tsum += matrix[i][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\tsum += matrix[i][j];\n\t\t\t\t}",
"{\n\t\t\t\t\tsum += matrix[i][j];\n\t\t\t\t}",
"sum += matrix[i][j]",
"sum",
"matrix[i][j]",
"matrix[i]",
"matrix",
"i",
"j",
"matrix[i][c] = sum",
"matrix[i][c]",
"matrix[i]",
"matrix",
"i",
"c",
"sum",
"for(int i = 0 ; i <= c;i++){\n\t\t\t\tint sum = 0;\n\t\t\t\tfor(int j = 0 ; j < r; j++){\n\t\t\t\t\tsum += matrix[j][i];\n\t\t\t\t}\n\t\t\t\tmatrix[r][i] = sum;\n\t\t\t}",
"int i = 0 ;",
"int i = 0 ;",
"i",
"0",
"i <= c",
"i",
"c",
"i++",
"i++",
"i",
"{\n\t\t\t\tint sum = 0;\n\t\t\t\tfor(int j = 0 ; j < r; j++){\n\t\t\t\t\tsum += matrix[j][i];\n\t\t\t\t}\n\t\t\t\tmatrix[r][i] = sum;\n\t\t\t}",
"{\n\t\t\t\tint sum = 0;\n\t\t\t\tfor(int j = 0 ; j < r; j++){\n\t\t\t\t\tsum += matrix[j][i];\n\t\t\t\t}\n\t\t\t\tmatrix[r][i] = sum;\n\t\t\t}",
"int sum = 0;",
"sum",
"0",
"for(int j = 0 ; j < r; j++){\n\t\t\t\t\tsum += matrix[j][i];\n\t\t\t\t}",
"int j = 0 ;",
"int j = 0 ;",
"j",
"0",
"j < r",
"j",
"r",
"j++",
"j++",
"j",
"{\n\t\t\t\t\tsum += matrix[j][i];\n\t\t\t\t}",
"{\n\t\t\t\t\tsum += matrix[j][i];\n\t\t\t\t}",
"sum += matrix[j][i]",
"sum",
"matrix[j][i]",
"matrix[j]",
"matrix",
"j",
"i",
"matrix[r][i] = sum",
"matrix[r][i]",
"matrix[r]",
"matrix",
"r",
"i",
"sum",
"for(int i = 0 ; i < matrix.length;i++){\n\t\t\t\tSystem.out.print(matrix[i][0]);\n\t\t\t\tfor(int j = 1 ; j < matrix[i].length;j++){\n\t\t\t\t\tSystem.out.print(\" \" + matrix[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 < matrix.length",
"i",
"matrix.length",
"matrix",
"matrix.length",
"i++",
"i++",
"i",
"{\n\t\t\t\tSystem.out.print(matrix[i][0]);\n\t\t\t\tfor(int j = 1 ; j < matrix[i].length;j++){\n\t\t\t\t\tSystem.out.print(\" \" + matrix[i][j]);\n\t\t\t\t}\n\t\t\t\tSystem.out.println();\n\t\t\t}",
"{\n\t\t\t\tSystem.out.print(matrix[i][0]);\n\t\t\t\tfor(int j = 1 ; j < matrix[i].length;j++){\n\t\t\t\t\tSystem.out.print(\" \" + matrix[i][j]);\n\t\t\t\t}\n\t\t\t\tSystem.out.println();\n\t\t\t}",
"System.out.print(matrix[i][0])",
"System.out.print",
"System.out",
"System",
"System.out",
"matrix[i][0]",
"matrix[i]",
"matrix",
"i",
"0",
"for(int j = 1 ; j < matrix[i].length;j++){\n\t\t\t\t\tSystem.out.print(\" \" + matrix[i][j]);\n\t\t\t\t}",
"int j = 1 ;",
"int j = 1 ;",
"j",
"1",
"j < matrix[i].length",
"j",
"matrix[i].length",
"matrix[i]",
"matrix",
"i",
"matrix[i].length",
"j++",
"j++",
"j",
"{\n\t\t\t\t\tSystem.out.print(\" \" + matrix[i][j]);\n\t\t\t\t}",
"{\n\t\t\t\t\tSystem.out.print(\" \" + matrix[i][j]);\n\t\t\t\t}",
"System.out.print(\" \" + matrix[i][j])",
"System.out.print",
"System.out",
"System",
"System.out",
"\" \" + matrix[i][j]",
"\" \"",
"matrix[i][j]",
"matrix[i]",
"matrix",
"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 = null;\n\t\ttry{\n\t\t\tscan = new Scanner(System.in);\n\t\t\tint r ,c;\n\t\t\tr = scan.nextInt();\n\t\t\tc = scan.nextInt();\n\t\t\tint[][] matrix = new int[r + 1][c + 1];\n\t\t\tfor(int i = 0; i < r ;i++){\n\t\t\t\tfor(int j = 0 ; j < c;j++){\n\t\t\t\t\tmatrix[i][j] = scan.nextInt();\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor(int i = 0 ;i < r;i++){\n\t\t\t\tint sum = 0;\n\t\t\t\tfor(int j = 0; j < c;j++){\n\t\t\t\t\tsum += matrix[i][j];\n\t\t\t\t}\n\t\t\t\tmatrix[i][c] = sum;\n\t\t\t}\n\t\t\tfor(int i = 0 ; i <= c;i++){\n\t\t\t\tint sum = 0;\n\t\t\t\tfor(int j = 0 ; j < r; j++){\n\t\t\t\t\tsum += matrix[j][i];\n\t\t\t\t}\n\t\t\t\tmatrix[r][i] = sum;\n\t\t\t}\n\t\t\tfor(int i = 0 ; i < matrix.length;i++){\n\t\t\t\tSystem.out.print(matrix[i][0]);\n\t\t\t\tfor(int j = 1 ; j < matrix[i].length;j++){\n\t\t\t\t\tSystem.out.print(\" \" + matrix[i][j]);\n\t\t\t\t}\n\t\t\t\tSystem.out.println();\n\t\t\t}\n\t\t}finally{\n\t\t\tif(scan !=null)scan.close();\n\t\t}\n\t}\n}",
"public class Main{\n\tpublic static void main(String[] args){\n\t\tScanner scan = null;\n\t\ttry{\n\t\t\tscan = new Scanner(System.in);\n\t\t\tint r ,c;\n\t\t\tr = scan.nextInt();\n\t\t\tc = scan.nextInt();\n\t\t\tint[][] matrix = new int[r + 1][c + 1];\n\t\t\tfor(int i = 0; i < r ;i++){\n\t\t\t\tfor(int j = 0 ; j < c;j++){\n\t\t\t\t\tmatrix[i][j] = scan.nextInt();\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor(int i = 0 ;i < r;i++){\n\t\t\t\tint sum = 0;\n\t\t\t\tfor(int j = 0; j < c;j++){\n\t\t\t\t\tsum += matrix[i][j];\n\t\t\t\t}\n\t\t\t\tmatrix[i][c] = sum;\n\t\t\t}\n\t\t\tfor(int i = 0 ; i <= c;i++){\n\t\t\t\tint sum = 0;\n\t\t\t\tfor(int j = 0 ; j < r; j++){\n\t\t\t\t\tsum += matrix[j][i];\n\t\t\t\t}\n\t\t\t\tmatrix[r][i] = sum;\n\t\t\t}\n\t\t\tfor(int i = 0 ; i < matrix.length;i++){\n\t\t\t\tSystem.out.print(matrix[i][0]);\n\t\t\t\tfor(int j = 1 ; j < matrix[i].length;j++){\n\t\t\t\t\tSystem.out.print(\" \" + matrix[i][j]);\n\t\t\t\t}\n\t\t\t\tSystem.out.println();\n\t\t\t}\n\t\t}finally{\n\t\t\tif(scan !=null)scan.close();\n\t\t}\n\t}\n}",
"Main"
] | import java.util.Scanner;
public class Main{
public static void main(String[] args){
Scanner scan = null;
try{
scan = new Scanner(System.in);
int r ,c;
r = scan.nextInt();
c = scan.nextInt();
int[][] matrix = new int[r + 1][c + 1];
for(int i = 0; i < r ;i++){
for(int j = 0 ; j < c;j++){
matrix[i][j] = scan.nextInt();
}
}
for(int i = 0 ;i < r;i++){
int sum = 0;
for(int j = 0; j < c;j++){
sum += matrix[i][j];
}
matrix[i][c] = sum;
}
for(int i = 0 ; i <= c;i++){
int sum = 0;
for(int j = 0 ; j < r; j++){
sum += matrix[j][i];
}
matrix[r][i] = sum;
}
for(int i = 0 ; i < matrix.length;i++){
System.out.print(matrix[i][0]);
for(int j = 1 ; j < matrix[i].length;j++){
System.out.print(" " + matrix[i][j]);
}
System.out.println();
}
}finally{
if(scan !=null)scan.close();
}
}
} |
[
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,
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,
17,
13,
1,
40,
13,
30,
30,
0,
18,
18,
13,
13,
13,
4,
18,
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,
17,
13,
1,
40,
13,
30,
30,
0,
18,
13,
13,
18,
18,
13,
13,
13,
11,
1,
41,
13,
17,
2,
13,
18,
18,
13,
17,
13,
1,
40,
13,
30,
30,
11,
1,
41,
13,
17,
2,
13,
18,
13,
13,
1,
40,
13,
30,
30,
0,
18,
13,
13,
18,
18,
13,
13,
13,
0,
13,
18,
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,
17,
13,
1,
40,
13,
30,
30,
4,
18,
18,
13,
13,
2,
18,
18,
13,
13,
13,
17,
4,
18,
18,
13,
13,
2,
18,
13,
13,
17,
28,
13,
13,
30,
30,
4,
18,
18,
13,
13,
2,
13,
17,
4,
18,
18,
13,
13,
2,
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
],
[
11,
30
],
[
30,
31
],
[
30,
32
],
[
11,
34
],
[
34,
35
],
[
34,
36
],
[
11,
38
],
[
38,
39
],
[
38,
40
],
[
11,
41
],
[
41,
42
],
[
42,
43
],
[
43,
44
],
[
43,
45
],
[
41,
46
],
[
46,
47
],
[
46,
48
],
[
48,
49
],
[
48,
50
],
[
41,
51
],
[
51,
52
],
[
52,
53
],
[
41,
54
],
[
55,
55
],
[
55,
56
],
[
56,
57
],
[
57,
58
],
[
58,
59
],
[
58,
60
],
[
56,
61
],
[
61,
62
],
[
61,
63
],
[
63,
64
],
[
64,
65
],
[
64,
66
],
[
63,
67
],
[
56,
68
],
[
68,
69
],
[
69,
70
],
[
56,
71
],
[
72,
72
],
[
72,
73
],
[
73,
74
],
[
74,
75
],
[
75,
76
],
[
75,
77
],
[
74,
78
],
[
73,
79
],
[
79,
80
],
[
80,
81
],
[
11,
82
],
[
82,
83
],
[
83,
84
],
[
84,
85
],
[
84,
86
],
[
82,
87
],
[
87,
88
],
[
87,
89
],
[
89,
90
],
[
89,
91
],
[
82,
92
],
[
92,
93
],
[
93,
94
],
[
82,
95
],
[
96,
96
],
[
96,
97
],
[
97,
98
],
[
98,
99
],
[
99,
100
],
[
99,
101
],
[
97,
102
],
[
102,
103
],
[
102,
104
],
[
104,
105
],
[
105,
106
],
[
105,
107
],
[
104,
108
],
[
97,
109
],
[
109,
110
],
[
110,
111
],
[
97,
112
],
[
113,
113
],
[
113,
114
],
[
114,
115
],
[
115,
116
],
[
115,
117
],
[
114,
118
],
[
118,
119
],
[
119,
120
],
[
119,
121
],
[
118,
122
],
[
11,
123
],
[
123,
124
],
[
124,
125
],
[
125,
126
],
[
125,
127
],
[
123,
128
],
[
128,
129
],
[
128,
130
],
[
130,
131
],
[
131,
132
],
[
131,
133
],
[
130,
134
],
[
123,
135
],
[
135,
136
],
[
136,
137
],
[
123,
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
],
[
156,
158
],
[
155,
159
],
[
159,
160
],
[
160,
161
],
[
160,
162
],
[
159,
163
],
[
139,
164
],
[
164,
165
],
[
164,
166
],
[
166,
167
],
[
166,
168
],
[
11,
169
],
[
169,
170
],
[
170,
171
],
[
171,
172
],
[
171,
173
],
[
169,
174
],
[
174,
175
],
[
174,
176
],
[
176,
177
],
[
176,
178
],
[
169,
179
],
[
179,
180
],
[
180,
181
],
[
169,
182
],
[
183,
183
],
[
183,
184
],
[
184,
185
],
[
185,
186
],
[
186,
187
],
[
186,
188
],
[
184,
189
],
[
189,
190
],
[
189,
191
],
[
191,
192
],
[
192,
193
],
[
192,
194
],
[
191,
195
],
[
184,
196
],
[
196,
197
],
[
197,
198
],
[
184,
199
],
[
200,
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
],
[
183,
213
],
[
213,
214
],
[
214,
215
],
[
215,
216
],
[
215,
217
],
[
213,
218
],
[
218,
219
],
[
219,
220
],
[
219,
221
],
[
218,
222
],
[
11,
223
],
[
223,
224
],
[
223,
225
],
[
223,
226
],
[
227,
227
],
[
227,
228
],
[
228,
229
],
[
229,
230
],
[
230,
231
],
[
230,
232
],
[
228,
233
],
[
233,
234
],
[
233,
235
],
[
11,
236
],
[
236,
237
],
[
237,
238
],
[
238,
239
],
[
238,
240
],
[
236,
241
],
[
241,
242
],
[
241,
243
],
[
9,
244
],
[
244,
245
]
] | [
"import java.io.IOException;\nimport java.util.Scanner;\n \nclass Main {\n \n public static void main(String[] args) throws IOException {\n \n Scanner scanner = new Scanner(System.in);\n \n int r = scanner.nextInt();\n int c = scanner.nextInt();\n int[][] list = new int[r][c];\n int[] sumR = new int[r];\n int[] sumC = new int[c];\n int sumRC = 0;\n \n for (int i = 0; i < list.length; i++) {\n for (int j = 0; j < list[0].length; j++) {\n list[i][j] = scanner.nextInt();\n }\n }\n \n for (int i = 0; i < list.length; i++) {\n for (int j = 0; j < list[0].length; j++) {\n sumR[i] += list[i][j];\n }\n }\n \n for (int i = 0; i < list[0].length; i++) {\n for (int j = 0; j < list.length; j++) {\n sumC[i] += list[j][i];\n }\n sumRC += sumC[i];\n }\n \n for (int i = 0; i < list.length; i++) {\n for (int j = 0; j < list[0].length; j++) {\n System.out.print(list[i][j] + \" \");\n }\n System.out.println(sumR[i] + \"\");\n }\n \n for (int num : sumC) {\n System.out.print(num + \" \");\n }\n System.out.print(sumRC + \"\\n\");\n }\n}",
"import java.io.IOException;",
"IOException",
"java.io",
"import java.util.Scanner;",
"Scanner",
"java.util",
"class Main {\n \n public static void main(String[] args) throws IOException {\n \n Scanner scanner = new Scanner(System.in);\n \n int r = scanner.nextInt();\n int c = scanner.nextInt();\n int[][] list = new int[r][c];\n int[] sumR = new int[r];\n int[] sumC = new int[c];\n int sumRC = 0;\n \n for (int i = 0; i < list.length; i++) {\n for (int j = 0; j < list[0].length; j++) {\n list[i][j] = scanner.nextInt();\n }\n }\n \n for (int i = 0; i < list.length; i++) {\n for (int j = 0; j < list[0].length; j++) {\n sumR[i] += list[i][j];\n }\n }\n \n for (int i = 0; i < list[0].length; i++) {\n for (int j = 0; j < list.length; j++) {\n sumC[i] += list[j][i];\n }\n sumRC += sumC[i];\n }\n \n for (int i = 0; i < list.length; i++) {\n for (int j = 0; j < list[0].length; j++) {\n System.out.print(list[i][j] + \" \");\n }\n System.out.println(sumR[i] + \"\");\n }\n \n for (int num : sumC) {\n System.out.print(num + \" \");\n }\n System.out.print(sumRC + \"\\n\");\n }\n}",
"Main",
"public static void main(String[] args) throws IOException {\n \n Scanner scanner = new Scanner(System.in);\n \n int r = scanner.nextInt();\n int c = scanner.nextInt();\n int[][] list = new int[r][c];\n int[] sumR = new int[r];\n int[] sumC = new int[c];\n int sumRC = 0;\n \n for (int i = 0; i < list.length; i++) {\n for (int j = 0; j < list[0].length; j++) {\n list[i][j] = scanner.nextInt();\n }\n }\n \n for (int i = 0; i < list.length; i++) {\n for (int j = 0; j < list[0].length; j++) {\n sumR[i] += list[i][j];\n }\n }\n \n for (int i = 0; i < list[0].length; i++) {\n for (int j = 0; j < list.length; j++) {\n sumC[i] += list[j][i];\n }\n sumRC += sumC[i];\n }\n \n for (int i = 0; i < list.length; i++) {\n for (int j = 0; j < list[0].length; j++) {\n System.out.print(list[i][j] + \" \");\n }\n System.out.println(sumR[i] + \"\");\n }\n \n for (int num : sumC) {\n System.out.print(num + \" \");\n }\n System.out.print(sumRC + \"\\n\");\n }",
"main",
"{\n \n Scanner scanner = new Scanner(System.in);\n \n int r = scanner.nextInt();\n int c = scanner.nextInt();\n int[][] list = new int[r][c];\n int[] sumR = new int[r];\n int[] sumC = new int[c];\n int sumRC = 0;\n \n for (int i = 0; i < list.length; i++) {\n for (int j = 0; j < list[0].length; j++) {\n list[i][j] = scanner.nextInt();\n }\n }\n \n for (int i = 0; i < list.length; i++) {\n for (int j = 0; j < list[0].length; j++) {\n sumR[i] += list[i][j];\n }\n }\n \n for (int i = 0; i < list[0].length; i++) {\n for (int j = 0; j < list.length; j++) {\n sumC[i] += list[j][i];\n }\n sumRC += sumC[i];\n }\n \n for (int i = 0; i < list.length; i++) {\n for (int j = 0; j < list[0].length; j++) {\n System.out.print(list[i][j] + \" \");\n }\n System.out.println(sumR[i] + \"\");\n }\n \n for (int num : sumC) {\n System.out.print(num + \" \");\n }\n System.out.print(sumRC + \"\\n\");\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[][] list = new int[r][c];",
"list",
"new int[r][c]",
"r",
"c",
"int[] sumR = new int[r];",
"sumR",
"new int[r]",
"r",
"int[] sumC = new int[c];",
"sumC",
"new int[c]",
"c",
"int sumRC = 0;",
"sumRC",
"0",
"for (int i = 0; i < list.length; i++) {\n for (int j = 0; j < list[0].length; j++) {\n list[i][j] = scanner.nextInt();\n }\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < list.length",
"i",
"list.length",
"list",
"list.length",
"i++",
"i++",
"i",
"{\n for (int j = 0; j < list[0].length; j++) {\n list[i][j] = scanner.nextInt();\n }\n }",
"{\n for (int j = 0; j < list[0].length; j++) {\n list[i][j] = scanner.nextInt();\n }\n }",
"for (int j = 0; j < list[0].length; j++) {\n list[i][j] = scanner.nextInt();\n }",
"int j = 0;",
"int j = 0;",
"j",
"0",
"j < list[0].length",
"j",
"list[0].length",
"list[0]",
"list",
"0",
"list[0].length",
"j++",
"j++",
"j",
"{\n list[i][j] = scanner.nextInt();\n }",
"{\n list[i][j] = scanner.nextInt();\n }",
"list[i][j] = scanner.nextInt()",
"list[i][j]",
"list[i]",
"list",
"i",
"j",
"scanner.nextInt()",
"scanner.nextInt",
"scanner",
"for (int i = 0; i < list.length; i++) {\n for (int j = 0; j < list[0].length; j++) {\n sumR[i] += list[i][j];\n }\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < list.length",
"i",
"list.length",
"list",
"list.length",
"i++",
"i++",
"i",
"{\n for (int j = 0; j < list[0].length; j++) {\n sumR[i] += list[i][j];\n }\n }",
"{\n for (int j = 0; j < list[0].length; j++) {\n sumR[i] += list[i][j];\n }\n }",
"for (int j = 0; j < list[0].length; j++) {\n sumR[i] += list[i][j];\n }",
"int j = 0;",
"int j = 0;",
"j",
"0",
"j < list[0].length",
"j",
"list[0].length",
"list[0]",
"list",
"0",
"list[0].length",
"j++",
"j++",
"j",
"{\n sumR[i] += list[i][j];\n }",
"{\n sumR[i] += list[i][j];\n }",
"sumR[i] += list[i][j]",
"sumR[i]",
"sumR",
"i",
"list[i][j]",
"list[i]",
"list",
"i",
"j",
"for (int i = 0; i < list[0].length; i++) {\n for (int j = 0; j < list.length; j++) {\n sumC[i] += list[j][i];\n }\n sumRC += sumC[i];\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < list[0].length",
"i",
"list[0].length",
"list[0]",
"list",
"0",
"list[0].length",
"i++",
"i++",
"i",
"{\n for (int j = 0; j < list.length; j++) {\n sumC[i] += list[j][i];\n }\n sumRC += sumC[i];\n }",
"{\n for (int j = 0; j < list.length; j++) {\n sumC[i] += list[j][i];\n }\n sumRC += sumC[i];\n }",
"for (int j = 0; j < list.length; j++) {\n sumC[i] += list[j][i];\n }",
"int j = 0;",
"int j = 0;",
"j",
"0",
"j < list.length",
"j",
"list.length",
"list",
"list.length",
"j++",
"j++",
"j",
"{\n sumC[i] += list[j][i];\n }",
"{\n sumC[i] += list[j][i];\n }",
"sumC[i] += list[j][i]",
"sumC[i]",
"sumC",
"i",
"list[j][i]",
"list[j]",
"list",
"j",
"i",
"sumRC += sumC[i]",
"sumRC",
"sumC[i]",
"sumC",
"i",
"for (int i = 0; i < list.length; i++) {\n for (int j = 0; j < list[0].length; j++) {\n System.out.print(list[i][j] + \" \");\n }\n System.out.println(sumR[i] + \"\");\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < list.length",
"i",
"list.length",
"list",
"list.length",
"i++",
"i++",
"i",
"{\n for (int j = 0; j < list[0].length; j++) {\n System.out.print(list[i][j] + \" \");\n }\n System.out.println(sumR[i] + \"\");\n }",
"{\n for (int j = 0; j < list[0].length; j++) {\n System.out.print(list[i][j] + \" \");\n }\n System.out.println(sumR[i] + \"\");\n }",
"for (int j = 0; j < list[0].length; j++) {\n System.out.print(list[i][j] + \" \");\n }",
"int j = 0;",
"int j = 0;",
"j",
"0",
"j < list[0].length",
"j",
"list[0].length",
"list[0]",
"list",
"0",
"list[0].length",
"j++",
"j++",
"j",
"{\n System.out.print(list[i][j] + \" \");\n }",
"{\n System.out.print(list[i][j] + \" \");\n }",
"System.out.print(list[i][j] + \" \")",
"System.out.print",
"System.out",
"System",
"System.out",
"list[i][j] + \" \"",
"list[i][j]",
"list[i]",
"list",
"i",
"j",
"\" \"",
"System.out.println(sumR[i] + \"\")",
"System.out.println",
"System.out",
"System",
"System.out",
"sumR[i] + \"\"",
"sumR[i]",
"sumR",
"i",
"\"\"",
"for (int num : sumC) {\n System.out.print(num + \" \");\n }",
"int num",
"sumC",
"{\n System.out.print(num + \" \");\n }",
"{\n System.out.print(num + \" \");\n }",
"System.out.print(num + \" \")",
"System.out.print",
"System.out",
"System",
"System.out",
"num + \" \"",
"num",
"\" \"",
"System.out.print(sumRC + \"\\n\")",
"System.out.print",
"System.out",
"System",
"System.out",
"sumRC + \"\\n\"",
"sumRC",
"\"\\n\"",
"String[] args",
"args"
] | import java.io.IOException;
import java.util.Scanner;
class Main {
public static void main(String[] args) throws IOException {
Scanner scanner = new Scanner(System.in);
int r = scanner.nextInt();
int c = scanner.nextInt();
int[][] list = new int[r][c];
int[] sumR = new int[r];
int[] sumC = new int[c];
int sumRC = 0;
for (int i = 0; i < list.length; i++) {
for (int j = 0; j < list[0].length; j++) {
list[i][j] = scanner.nextInt();
}
}
for (int i = 0; i < list.length; i++) {
for (int j = 0; j < list[0].length; j++) {
sumR[i] += list[i][j];
}
}
for (int i = 0; i < list[0].length; i++) {
for (int j = 0; j < list.length; j++) {
sumC[i] += list[j][i];
}
sumRC += sumC[i];
}
for (int i = 0; i < list.length; i++) {
for (int j = 0; j < list[0].length; j++) {
System.out.print(list[i][j] + " ");
}
System.out.println(sumR[i] + "");
}
for (int num : sumC) {
System.out.print(num + " ");
}
System.out.print(sumRC + "\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,
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,
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
],
[
143,
144
],
[
128,
145
],
[
145,
146
],
[
146,
147
],
[
147,
148
],
[
147,
149
],
[
145,
150
],
[
113,
151
],
[
151,
152
],
[
152,
153
],
[
153,
154
],
[
153,
155
],
[
6,
156
],
[
156,
157
]
] | [
"import java.util.Scanner;\nclass Main {\n public static void main(String args[]) {\n Scanner scan = new Scanner(System.in);\n\n int h = scan.nextInt();\n int w = scan.nextInt();\n\n int number[][] = new int[h + 1][w + 1];\n\n for (int i = 0; i < h;i++) {\n for (int j = 0; j < w;j++) {\n number[i][j] = scan.nextInt();\n number[i][w] += number[i][j];\n number[h][j] += number[i][j];\n }\n number[h][w] += number[i][w];\n }\n\n for (int i = 0;i < h + 1;i++) {\n for (int j = 0;j < w + 1;j++) {\n System.out.print(number[i][j]);\n if(j == w) {\n continue;\n }\n System.out.print(\" \");\n }\n System.out.println();\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 h = scan.nextInt();\n int w = scan.nextInt();\n\n int number[][] = new int[h + 1][w + 1];\n\n for (int i = 0; i < h;i++) {\n for (int j = 0; j < w;j++) {\n number[i][j] = scan.nextInt();\n number[i][w] += number[i][j];\n number[h][j] += number[i][j];\n }\n number[h][w] += number[i][w];\n }\n\n for (int i = 0;i < h + 1;i++) {\n for (int j = 0;j < w + 1;j++) {\n System.out.print(number[i][j]);\n if(j == w) {\n continue;\n }\n System.out.print(\" \");\n }\n System.out.println();\n }\n }\n}",
"Main",
"public static void main(String args[]) {\n Scanner scan = new Scanner(System.in);\n\n int h = scan.nextInt();\n int w = scan.nextInt();\n\n int number[][] = new int[h + 1][w + 1];\n\n for (int i = 0; i < h;i++) {\n for (int j = 0; j < w;j++) {\n number[i][j] = scan.nextInt();\n number[i][w] += number[i][j];\n number[h][j] += number[i][j];\n }\n number[h][w] += number[i][w];\n }\n\n for (int i = 0;i < h + 1;i++) {\n for (int j = 0;j < w + 1;j++) {\n System.out.print(number[i][j]);\n if(j == w) {\n continue;\n }\n System.out.print(\" \");\n }\n System.out.println();\n }\n }",
"main",
"{\n Scanner scan = new Scanner(System.in);\n\n int h = scan.nextInt();\n int w = scan.nextInt();\n\n int number[][] = new int[h + 1][w + 1];\n\n for (int i = 0; i < h;i++) {\n for (int j = 0; j < w;j++) {\n number[i][j] = scan.nextInt();\n number[i][w] += number[i][j];\n number[h][j] += number[i][j];\n }\n number[h][w] += number[i][w];\n }\n\n for (int i = 0;i < h + 1;i++) {\n for (int j = 0;j < w + 1;j++) {\n System.out.print(number[i][j]);\n if(j == w) {\n continue;\n }\n System.out.print(\" \");\n }\n System.out.println();\n }\n }",
"Scanner scan = new Scanner(System.in);",
"scan",
"new Scanner(System.in)",
"int h = scan.nextInt();",
"h",
"scan.nextInt()",
"scan.nextInt",
"scan",
"int w = scan.nextInt();",
"w",
"scan.nextInt()",
"scan.nextInt",
"scan",
"int number[][] = new int[h + 1][w + 1];",
"number",
"new int[h + 1][w + 1]",
"h + 1",
"h",
"1",
"w + 1",
"w",
"1",
"for (int i = 0; i < h;i++) {\n for (int j = 0; j < w;j++) {\n number[i][j] = scan.nextInt();\n number[i][w] += number[i][j];\n number[h][j] += number[i][j];\n }\n number[h][w] += number[i][w];\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < h",
"i",
"h",
"i++",
"i++",
"i",
"{\n for (int j = 0; j < w;j++) {\n number[i][j] = scan.nextInt();\n number[i][w] += number[i][j];\n number[h][j] += number[i][j];\n }\n number[h][w] += number[i][w];\n }",
"{\n for (int j = 0; j < w;j++) {\n number[i][j] = scan.nextInt();\n number[i][w] += number[i][j];\n number[h][j] += number[i][j];\n }\n number[h][w] += number[i][w];\n }",
"for (int j = 0; j < w;j++) {\n number[i][j] = scan.nextInt();\n number[i][w] += number[i][j];\n number[h][j] += number[i][j];\n }",
"int j = 0;",
"int j = 0;",
"j",
"0",
"j < w",
"j",
"w",
"j++",
"j++",
"j",
"{\n number[i][j] = scan.nextInt();\n number[i][w] += number[i][j];\n number[h][j] += number[i][j];\n }",
"{\n number[i][j] = scan.nextInt();\n number[i][w] += number[i][j];\n number[h][j] += number[i][j];\n }",
"number[i][j] = scan.nextInt()",
"number[i][j]",
"number[i]",
"number",
"i",
"j",
"scan.nextInt()",
"scan.nextInt",
"scan",
"number[i][w] += number[i][j]",
"number[i][w]",
"number[i]",
"number",
"i",
"w",
"number[i][j]",
"number[i]",
"number",
"i",
"j",
"number[h][j] += number[i][j]",
"number[h][j]",
"number[h]",
"number",
"h",
"j",
"number[i][j]",
"number[i]",
"number",
"i",
"j",
"number[h][w] += number[i][w]",
"number[h][w]",
"number[h]",
"number",
"h",
"w",
"number[i][w]",
"number[i]",
"number",
"i",
"w",
"for (int i = 0;i < h + 1;i++) {\n for (int j = 0;j < w + 1;j++) {\n System.out.print(number[i][j]);\n if(j == w) {\n continue;\n }\n System.out.print(\" \");\n }\n System.out.println();\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < h + 1",
"i",
"h + 1",
"h",
"1",
"i++",
"i++",
"i",
"{\n for (int j = 0;j < w + 1;j++) {\n System.out.print(number[i][j]);\n if(j == w) {\n continue;\n }\n System.out.print(\" \");\n }\n System.out.println();\n }",
"{\n for (int j = 0;j < w + 1;j++) {\n System.out.print(number[i][j]);\n if(j == w) {\n continue;\n }\n System.out.print(\" \");\n }\n System.out.println();\n }",
"for (int j = 0;j < w + 1;j++) {\n System.out.print(number[i][j]);\n if(j == w) {\n continue;\n }\n System.out.print(\" \");\n }",
"int j = 0;",
"int j = 0;",
"j",
"0",
"j < w + 1",
"j",
"w + 1",
"w",
"1",
"j++",
"j++",
"j",
"{\n System.out.print(number[i][j]);\n if(j == w) {\n continue;\n }\n System.out.print(\" \");\n }",
"{\n System.out.print(number[i][j]);\n if(j == w) {\n continue;\n }\n System.out.print(\" \");\n }",
"System.out.print(number[i][j])",
"System.out.print",
"System.out",
"System",
"System.out",
"number[i][j]",
"number[i]",
"number",
"i",
"j",
"if(j == w) {\n continue;\n }",
"j == w",
"j",
"w",
"{\n continue;\n }",
"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 h = scan.nextInt();
int w = scan.nextInt();
int number[][] = new int[h + 1][w + 1];
for (int i = 0; i < h;i++) {
for (int j = 0; j < w;j++) {
number[i][j] = scan.nextInt();
number[i][w] += number[i][j];
number[h][j] += number[i][j];
}
number[h][w] += number[i][w];
}
for (int i = 0;i < h + 1;i++) {
for (int j = 0;j < w + 1;j++) {
System.out.print(number[i][j]);
if(j == w) {
continue;
}
System.out.print(" ");
}
System.out.println();
}
}
} |
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
17,
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,
18,
18,
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,
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,
17,
18,
18,
13,
13,
13,
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
],
[
165,
5
],
[
165,
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
],
[
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
],
[
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
],
[
80,
84
],
[
79,
85
],
[
85,
86
],
[
86,
87
],
[
86,
88
],
[
85,
89
],
[
46,
90
],
[
90,
91
],
[
91,
92
],
[
92,
93
],
[
92,
94
],
[
91,
95
],
[
90,
96
],
[
46,
97
],
[
97,
98
],
[
97,
99
],
[
8,
100
],
[
100,
101
],
[
101,
102
],
[
102,
103
],
[
102,
104
],
[
101,
105
],
[
100,
106
],
[
8,
107
],
[
107,
108
],
[
108,
109
],
[
109,
110
],
[
109,
111
],
[
107,
112
],
[
112,
113
],
[
112,
114
],
[
114,
115
],
[
114,
116
],
[
107,
117
],
[
117,
118
],
[
118,
119
],
[
107,
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
],
[
135,
140
],
[
135,
141
],
[
141,
142
],
[
142,
143
],
[
142,
144
],
[
141,
145
],
[
121,
146
],
[
146,
147
],
[
147,
148
],
[
148,
149
],
[
148,
150
],
[
146,
151
],
[
146,
152
],
[
152,
153
],
[
153,
154
],
[
153,
155
],
[
152,
156
],
[
121,
157
],
[
157,
158
],
[
158,
159
],
[
159,
160
],
[
159,
161
],
[
6,
162
],
[
162,
163
],
[
0,
164
],
[
164,
165
],
[
164,
166
]
] | [
"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 total_sum=0;\n\t\tint r=sc.nextInt();\n\t\tint c=sc.nextInt();\n\t\tint[][] cell=new int[r+1][c+1];\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\tcell[i][j]=sc.nextInt();\n\t\t\t\tsum+=cell[i][j];\n\t\t\t\tcell[r][j]+=cell[i][j];\n\t\t\t}\n\t\t\tcell[i][c]=sum;\n\t\t\t\n\t\t\ttotal_sum+=sum;\n\t\t}\n\t\tcell[r][c]=total_sum;\n\t\t\n\t\tfor(int i=0; i<r+1; i++) {\n\t\t\tfor(int j=0; j<c; j++) {\n\t\t\t\tSystem.out.printf(\"%d \", cell[i][j]);\n\t\t\t}\n\t\t\tSystem.out.printf(\"%d\", cell[i][c]);\n\t\t\tSystem.out.println();\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\tScanner sc = new Scanner(System.in);\n\t\tint total_sum=0;\n\t\tint r=sc.nextInt();\n\t\tint c=sc.nextInt();\n\t\tint[][] cell=new int[r+1][c+1];\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\tcell[i][j]=sc.nextInt();\n\t\t\t\tsum+=cell[i][j];\n\t\t\t\tcell[r][j]+=cell[i][j];\n\t\t\t}\n\t\t\tcell[i][c]=sum;\n\t\t\t\n\t\t\ttotal_sum+=sum;\n\t\t}\n\t\tcell[r][c]=total_sum;\n\t\t\n\t\tfor(int i=0; i<r+1; i++) {\n\t\t\tfor(int j=0; j<c; j++) {\n\t\t\t\tSystem.out.printf(\"%d \", cell[i][j]);\n\t\t\t}\n\t\t\tSystem.out.printf(\"%d\", cell[i][c]);\n\t\t\tSystem.out.println();\n\t\t}\n\t}\n}",
"Main",
"public static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\tint total_sum=0;\n\t\tint r=sc.nextInt();\n\t\tint c=sc.nextInt();\n\t\tint[][] cell=new int[r+1][c+1];\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\tcell[i][j]=sc.nextInt();\n\t\t\t\tsum+=cell[i][j];\n\t\t\t\tcell[r][j]+=cell[i][j];\n\t\t\t}\n\t\t\tcell[i][c]=sum;\n\t\t\t\n\t\t\ttotal_sum+=sum;\n\t\t}\n\t\tcell[r][c]=total_sum;\n\t\t\n\t\tfor(int i=0; i<r+1; i++) {\n\t\t\tfor(int j=0; j<c; j++) {\n\t\t\t\tSystem.out.printf(\"%d \", cell[i][j]);\n\t\t\t}\n\t\t\tSystem.out.printf(\"%d\", cell[i][c]);\n\t\t\tSystem.out.println();\n\t\t}\n\t}",
"main",
"{\n\t\tScanner sc = new Scanner(System.in);\n\t\tint total_sum=0;\n\t\tint r=sc.nextInt();\n\t\tint c=sc.nextInt();\n\t\tint[][] cell=new int[r+1][c+1];\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\tcell[i][j]=sc.nextInt();\n\t\t\t\tsum+=cell[i][j];\n\t\t\t\tcell[r][j]+=cell[i][j];\n\t\t\t}\n\t\t\tcell[i][c]=sum;\n\t\t\t\n\t\t\ttotal_sum+=sum;\n\t\t}\n\t\tcell[r][c]=total_sum;\n\t\t\n\t\tfor(int i=0; i<r+1; i++) {\n\t\t\tfor(int j=0; j<c; j++) {\n\t\t\t\tSystem.out.printf(\"%d \", cell[i][j]);\n\t\t\t}\n\t\t\tSystem.out.printf(\"%d\", cell[i][c]);\n\t\t\tSystem.out.println();\n\t\t}\n\t}",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"int total_sum=0;",
"total_sum",
"0",
"int r=sc.nextInt();",
"r",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int c=sc.nextInt();",
"c",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int[][] cell=new int[r+1][c+1];",
"cell",
"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 sum=0;\n\t\t\tfor(int j=0; j<c; j++) {\n\t\t\t\tcell[i][j]=sc.nextInt();\n\t\t\t\tsum+=cell[i][j];\n\t\t\t\tcell[r][j]+=cell[i][j];\n\t\t\t}\n\t\t\tcell[i][c]=sum;\n\t\t\t\n\t\t\ttotal_sum+=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\tcell[i][j]=sc.nextInt();\n\t\t\t\tsum+=cell[i][j];\n\t\t\t\tcell[r][j]+=cell[i][j];\n\t\t\t}\n\t\t\tcell[i][c]=sum;\n\t\t\t\n\t\t\ttotal_sum+=sum;\n\t\t}",
"{\n\t\t\tint sum=0;\n\t\t\tfor(int j=0; j<c; j++) {\n\t\t\t\tcell[i][j]=sc.nextInt();\n\t\t\t\tsum+=cell[i][j];\n\t\t\t\tcell[r][j]+=cell[i][j];\n\t\t\t}\n\t\t\tcell[i][c]=sum;\n\t\t\t\n\t\t\ttotal_sum+=sum;\n\t\t}",
"int sum=0;",
"sum",
"0",
"for(int j=0; j<c; j++) {\n\t\t\t\tcell[i][j]=sc.nextInt();\n\t\t\t\tsum+=cell[i][j];\n\t\t\t\tcell[r][j]+=cell[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\tcell[i][j]=sc.nextInt();\n\t\t\t\tsum+=cell[i][j];\n\t\t\t\tcell[r][j]+=cell[i][j];\n\t\t\t}",
"{\n\t\t\t\tcell[i][j]=sc.nextInt();\n\t\t\t\tsum+=cell[i][j];\n\t\t\t\tcell[r][j]+=cell[i][j];\n\t\t\t}",
"cell[i][j]=sc.nextInt()",
"cell[i][j]",
"cell[i]",
"cell",
"i",
"j",
"sc.nextInt()",
"sc.nextInt",
"sc",
"sum+=cell[i][j]",
"sum",
"cell[i][j]",
"cell[i]",
"cell",
"i",
"j",
"cell[r][j]+=cell[i][j]",
"cell[r][j]",
"cell[r]",
"cell",
"r",
"j",
"cell[i][j]",
"cell[i]",
"cell",
"i",
"j",
"cell[i][c]=sum",
"cell[i][c]",
"cell[i]",
"cell",
"i",
"c",
"sum",
"total_sum+=sum",
"total_sum",
"sum",
"cell[r][c]=total_sum",
"cell[r][c]",
"cell[r]",
"cell",
"r",
"c",
"total_sum",
"for(int i=0; i<r+1; i++) {\n\t\t\tfor(int j=0; j<c; j++) {\n\t\t\t\tSystem.out.printf(\"%d \", cell[i][j]);\n\t\t\t}\n\t\t\tSystem.out.printf(\"%d\", cell[i][c]);\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; j++) {\n\t\t\t\tSystem.out.printf(\"%d \", cell[i][j]);\n\t\t\t}\n\t\t\tSystem.out.printf(\"%d\", cell[i][c]);\n\t\t\tSystem.out.println();\n\t\t}",
"{\n\t\t\tfor(int j=0; j<c; j++) {\n\t\t\t\tSystem.out.printf(\"%d \", cell[i][j]);\n\t\t\t}\n\t\t\tSystem.out.printf(\"%d\", cell[i][c]);\n\t\t\tSystem.out.println();\n\t\t}",
"for(int j=0; j<c; j++) {\n\t\t\t\tSystem.out.printf(\"%d \", cell[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.printf(\"%d \", cell[i][j]);\n\t\t\t}",
"{\n\t\t\t\tSystem.out.printf(\"%d \", cell[i][j]);\n\t\t\t}",
"System.out.printf(\"%d \", cell[i][j])",
"System.out.printf",
"System.out",
"System",
"System.out",
"\"%d \"",
"cell[i][j]",
"cell[i]",
"cell",
"i",
"j",
"System.out.printf(\"%d\", cell[i][c])",
"System.out.printf",
"System.out",
"System",
"System.out",
"\"%d\"",
"cell[i][c]",
"cell[i]",
"cell",
"i",
"c",
"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\t\tint total_sum=0;\n\t\tint r=sc.nextInt();\n\t\tint c=sc.nextInt();\n\t\tint[][] cell=new int[r+1][c+1];\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\tcell[i][j]=sc.nextInt();\n\t\t\t\tsum+=cell[i][j];\n\t\t\t\tcell[r][j]+=cell[i][j];\n\t\t\t}\n\t\t\tcell[i][c]=sum;\n\t\t\t\n\t\t\ttotal_sum+=sum;\n\t\t}\n\t\tcell[r][c]=total_sum;\n\t\t\n\t\tfor(int i=0; i<r+1; i++) {\n\t\t\tfor(int j=0; j<c; j++) {\n\t\t\t\tSystem.out.printf(\"%d \", cell[i][j]);\n\t\t\t}\n\t\t\tSystem.out.printf(\"%d\", cell[i][c]);\n\t\t\tSystem.out.println();\n\t\t}\n\t}\n}",
"public class Main {\n\tpublic static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\tint total_sum=0;\n\t\tint r=sc.nextInt();\n\t\tint c=sc.nextInt();\n\t\tint[][] cell=new int[r+1][c+1];\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\tcell[i][j]=sc.nextInt();\n\t\t\t\tsum+=cell[i][j];\n\t\t\t\tcell[r][j]+=cell[i][j];\n\t\t\t}\n\t\t\tcell[i][c]=sum;\n\t\t\t\n\t\t\ttotal_sum+=sum;\n\t\t}\n\t\tcell[r][c]=total_sum;\n\t\t\n\t\tfor(int i=0; i<r+1; i++) {\n\t\t\tfor(int j=0; j<c; j++) {\n\t\t\t\tSystem.out.printf(\"%d \", cell[i][j]);\n\t\t\t}\n\t\t\tSystem.out.printf(\"%d\", cell[i][c]);\n\t\t\tSystem.out.println();\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 total_sum=0;
int r=sc.nextInt();
int c=sc.nextInt();
int[][] cell=new int[r+1][c+1];
for(int i=0; i<r; i++) {
int sum=0;
for(int j=0; j<c; j++) {
cell[i][j]=sc.nextInt();
sum+=cell[i][j];
cell[r][j]+=cell[i][j];
}
cell[i][c]=sum;
total_sum+=sum;
}
cell[r][c]=total_sum;
for(int i=0; i<r+1; i++) {
for(int j=0; j<c; j++) {
System.out.printf("%d ", cell[i][j]);
}
System.out.printf("%d", cell[i][c]);
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,
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,
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,
4,
18,
18,
13,
13,
2,
18,
18,
13,
13,
13,
17,
14,
2,
13,
13,
30,
0,
18,
18,
13,
13,
13,
13,
4,
18,
18,
13,
13,
18,
18,
13,
13,
13,
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,
0,
13,
18,
18,
13,
13,
13,
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
],
[
176,
5
],
[
176,
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
],
[
46,
48
],
[
45,
49
],
[
49,
50
],
[
50,
51
],
[
51,
52
],
[
51,
53
],
[
49,
54
],
[
54,
55
],
[
54,
56
],
[
56,
57
],
[
56,
58
],
[
49,
59
],
[
59,
60
],
[
60,
61
],
[
49,
62
],
[
63,
63
],
[
63,
64
],
[
64,
65
],
[
65,
66
],
[
66,
67
],
[
66,
68
],
[
65,
69
],
[
69,
70
],
[
69,
71
],
[
64,
72
],
[
72,
73
],
[
73,
74
],
[
74,
75
],
[
75,
76
],
[
75,
77
],
[
74,
78
],
[
73,
79
],
[
79,
80
],
[
80,
81
],
[
72,
82
],
[
82,
83
],
[
82,
84
],
[
84,
85
],
[
85,
86
],
[
85,
87
],
[
84,
88
],
[
72,
89
],
[
89,
90
],
[
90,
91
],
[
91,
92
],
[
91,
93
],
[
89,
94
],
[
94,
95
],
[
95,
96
],
[
96,
97
],
[
96,
98
],
[
95,
99
],
[
94,
100
],
[
64,
101
],
[
101,
102
],
[
102,
103
],
[
102,
104
],
[
101,
105
],
[
105,
106
],
[
106,
107
],
[
107,
108
],
[
108,
109
],
[
108,
110
],
[
107,
111
],
[
106,
112
],
[
105,
113
],
[
113,
114
],
[
114,
115
],
[
115,
116
],
[
115,
117
],
[
113,
118
],
[
118,
119
],
[
119,
120
],
[
119,
121
],
[
118,
122
],
[
101,
123
],
[
123,
124
],
[
124,
125
],
[
124,
126
],
[
123,
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
],
[
143,
144
],
[
143,
145
],
[
142,
146
],
[
123,
147
],
[
147,
148
],
[
148,
149
],
[
149,
150
],
[
149,
151
],
[
148,
152
],
[
147,
153
],
[
123,
154
],
[
154,
155
],
[
154,
156
],
[
156,
157
],
[
157,
158
],
[
157,
159
],
[
156,
160
],
[
123,
161
],
[
161,
162
],
[
162,
163
],
[
163,
164
],
[
163,
165
],
[
161,
166
],
[
166,
167
],
[
167,
168
],
[
168,
169
],
[
168,
170
],
[
167,
171
],
[
166,
172
],
[
6,
173
],
[
173,
174
],
[
0,
175
],
[
175,
176
],
[
175,
177
]
] | [
"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 r = sc.nextInt();\n\t\tint c = sc.nextInt();\n\t\t\n\t\tint[][] table = new int[r+1][c+1];\n\t\tfor(int i=0; i<r+1; i++) {\n\t\t\tint sum_c = 0;\n\t\t\tfor(int j=0; j<c+1; j++) {\n\t\t\t\tif(i != r && j != c) {\n\t\t\t\t\ttable[i][j] = sc.nextInt();\n\t\t\t\t\tsum_c += table[i][j];\n\t\t\t\t\tSystem.out.print(table[i][j] + \" \");\n\t\t\t\t} else if(j == c) {\n\t\t\t\t\ttable[i][j] = sum_c;\n\t\t\t\t\tSystem.out.println(table[i][j]);\n\t\t\t\t} else {\n\t\t\t\t\tint sum_r = 0;\n\t\t\t\t\tfor(int k=0; k<r; k++){\n\t\t\t\t\t\tsum_r += table[k][j];\n\t\t\t\t\t}\n\t\t\t\t\ttable[i][j] = sum_r;\n\t\t\t\t\tsum_c += table[i][j];\n\t\t\t\t\tSystem.out.print(table[i][j] + \" \");\n\t\t\t\t}\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\t\tScanner sc = new Scanner(System.in);\n\t\tint r = sc.nextInt();\n\t\tint c = sc.nextInt();\n\t\t\n\t\tint[][] table = new int[r+1][c+1];\n\t\tfor(int i=0; i<r+1; i++) {\n\t\t\tint sum_c = 0;\n\t\t\tfor(int j=0; j<c+1; j++) {\n\t\t\t\tif(i != r && j != c) {\n\t\t\t\t\ttable[i][j] = sc.nextInt();\n\t\t\t\t\tsum_c += table[i][j];\n\t\t\t\t\tSystem.out.print(table[i][j] + \" \");\n\t\t\t\t} else if(j == c) {\n\t\t\t\t\ttable[i][j] = sum_c;\n\t\t\t\t\tSystem.out.println(table[i][j]);\n\t\t\t\t} else {\n\t\t\t\t\tint sum_r = 0;\n\t\t\t\t\tfor(int k=0; k<r; k++){\n\t\t\t\t\t\tsum_r += table[k][j];\n\t\t\t\t\t}\n\t\t\t\t\ttable[i][j] = sum_r;\n\t\t\t\t\tsum_c += table[i][j];\n\t\t\t\t\tSystem.out.print(table[i][j] + \" \");\n\t\t\t\t}\n\t\t\t}\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 r = sc.nextInt();\n\t\tint c = sc.nextInt();\n\t\t\n\t\tint[][] table = new int[r+1][c+1];\n\t\tfor(int i=0; i<r+1; i++) {\n\t\t\tint sum_c = 0;\n\t\t\tfor(int j=0; j<c+1; j++) {\n\t\t\t\tif(i != r && j != c) {\n\t\t\t\t\ttable[i][j] = sc.nextInt();\n\t\t\t\t\tsum_c += table[i][j];\n\t\t\t\t\tSystem.out.print(table[i][j] + \" \");\n\t\t\t\t} else if(j == c) {\n\t\t\t\t\ttable[i][j] = sum_c;\n\t\t\t\t\tSystem.out.println(table[i][j]);\n\t\t\t\t} else {\n\t\t\t\t\tint sum_r = 0;\n\t\t\t\t\tfor(int k=0; k<r; k++){\n\t\t\t\t\t\tsum_r += table[k][j];\n\t\t\t\t\t}\n\t\t\t\t\ttable[i][j] = sum_r;\n\t\t\t\t\tsum_c += table[i][j];\n\t\t\t\t\tSystem.out.print(table[i][j] + \" \");\n\t\t\t\t}\n\t\t\t}\n\t\t}\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\t\n\t\tint[][] table = new int[r+1][c+1];\n\t\tfor(int i=0; i<r+1; i++) {\n\t\t\tint sum_c = 0;\n\t\t\tfor(int j=0; j<c+1; j++) {\n\t\t\t\tif(i != r && j != c) {\n\t\t\t\t\ttable[i][j] = sc.nextInt();\n\t\t\t\t\tsum_c += table[i][j];\n\t\t\t\t\tSystem.out.print(table[i][j] + \" \");\n\t\t\t\t} else if(j == c) {\n\t\t\t\t\ttable[i][j] = sum_c;\n\t\t\t\t\tSystem.out.println(table[i][j]);\n\t\t\t\t} else {\n\t\t\t\t\tint sum_r = 0;\n\t\t\t\t\tfor(int k=0; k<r; k++){\n\t\t\t\t\t\tsum_r += table[k][j];\n\t\t\t\t\t}\n\t\t\t\t\ttable[i][j] = sum_r;\n\t\t\t\t\tsum_c += table[i][j];\n\t\t\t\t\tSystem.out.print(table[i][j] + \" \");\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 r = sc.nextInt();",
"r",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int c = sc.nextInt();",
"c",
"sc.nextInt()",
"sc.nextInt",
"sc",
"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 sum_c = 0;\n\t\t\tfor(int j=0; j<c+1; j++) {\n\t\t\t\tif(i != r && j != c) {\n\t\t\t\t\ttable[i][j] = sc.nextInt();\n\t\t\t\t\tsum_c += table[i][j];\n\t\t\t\t\tSystem.out.print(table[i][j] + \" \");\n\t\t\t\t} else if(j == c) {\n\t\t\t\t\ttable[i][j] = sum_c;\n\t\t\t\t\tSystem.out.println(table[i][j]);\n\t\t\t\t} else {\n\t\t\t\t\tint sum_r = 0;\n\t\t\t\t\tfor(int k=0; k<r; k++){\n\t\t\t\t\t\tsum_r += table[k][j];\n\t\t\t\t\t}\n\t\t\t\t\ttable[i][j] = sum_r;\n\t\t\t\t\tsum_c += table[i][j];\n\t\t\t\t\tSystem.out.print(table[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\tint sum_c = 0;\n\t\t\tfor(int j=0; j<c+1; j++) {\n\t\t\t\tif(i != r && j != c) {\n\t\t\t\t\ttable[i][j] = sc.nextInt();\n\t\t\t\t\tsum_c += table[i][j];\n\t\t\t\t\tSystem.out.print(table[i][j] + \" \");\n\t\t\t\t} else if(j == c) {\n\t\t\t\t\ttable[i][j] = sum_c;\n\t\t\t\t\tSystem.out.println(table[i][j]);\n\t\t\t\t} else {\n\t\t\t\t\tint sum_r = 0;\n\t\t\t\t\tfor(int k=0; k<r; k++){\n\t\t\t\t\t\tsum_r += table[k][j];\n\t\t\t\t\t}\n\t\t\t\t\ttable[i][j] = sum_r;\n\t\t\t\t\tsum_c += table[i][j];\n\t\t\t\t\tSystem.out.print(table[i][j] + \" \");\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"{\n\t\t\tint sum_c = 0;\n\t\t\tfor(int j=0; j<c+1; j++) {\n\t\t\t\tif(i != r && j != c) {\n\t\t\t\t\ttable[i][j] = sc.nextInt();\n\t\t\t\t\tsum_c += table[i][j];\n\t\t\t\t\tSystem.out.print(table[i][j] + \" \");\n\t\t\t\t} else if(j == c) {\n\t\t\t\t\ttable[i][j] = sum_c;\n\t\t\t\t\tSystem.out.println(table[i][j]);\n\t\t\t\t} else {\n\t\t\t\t\tint sum_r = 0;\n\t\t\t\t\tfor(int k=0; k<r; k++){\n\t\t\t\t\t\tsum_r += table[k][j];\n\t\t\t\t\t}\n\t\t\t\t\ttable[i][j] = sum_r;\n\t\t\t\t\tsum_c += table[i][j];\n\t\t\t\t\tSystem.out.print(table[i][j] + \" \");\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"int sum_c = 0;",
"sum_c",
"0",
"for(int j=0; j<c+1; j++) {\n\t\t\t\tif(i != r && j != c) {\n\t\t\t\t\ttable[i][j] = sc.nextInt();\n\t\t\t\t\tsum_c += table[i][j];\n\t\t\t\t\tSystem.out.print(table[i][j] + \" \");\n\t\t\t\t} else if(j == c) {\n\t\t\t\t\ttable[i][j] = sum_c;\n\t\t\t\t\tSystem.out.println(table[i][j]);\n\t\t\t\t} else {\n\t\t\t\t\tint sum_r = 0;\n\t\t\t\t\tfor(int k=0; k<r; k++){\n\t\t\t\t\t\tsum_r += table[k][j];\n\t\t\t\t\t}\n\t\t\t\t\ttable[i][j] = sum_r;\n\t\t\t\t\tsum_c += table[i][j];\n\t\t\t\t\tSystem.out.print(table[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(i != r && j != c) {\n\t\t\t\t\ttable[i][j] = sc.nextInt();\n\t\t\t\t\tsum_c += table[i][j];\n\t\t\t\t\tSystem.out.print(table[i][j] + \" \");\n\t\t\t\t} else if(j == c) {\n\t\t\t\t\ttable[i][j] = sum_c;\n\t\t\t\t\tSystem.out.println(table[i][j]);\n\t\t\t\t} else {\n\t\t\t\t\tint sum_r = 0;\n\t\t\t\t\tfor(int k=0; k<r; k++){\n\t\t\t\t\t\tsum_r += table[k][j];\n\t\t\t\t\t}\n\t\t\t\t\ttable[i][j] = sum_r;\n\t\t\t\t\tsum_c += table[i][j];\n\t\t\t\t\tSystem.out.print(table[i][j] + \" \");\n\t\t\t\t}\n\t\t\t}",
"{\n\t\t\t\tif(i != r && j != c) {\n\t\t\t\t\ttable[i][j] = sc.nextInt();\n\t\t\t\t\tsum_c += table[i][j];\n\t\t\t\t\tSystem.out.print(table[i][j] + \" \");\n\t\t\t\t} else if(j == c) {\n\t\t\t\t\ttable[i][j] = sum_c;\n\t\t\t\t\tSystem.out.println(table[i][j]);\n\t\t\t\t} else {\n\t\t\t\t\tint sum_r = 0;\n\t\t\t\t\tfor(int k=0; k<r; k++){\n\t\t\t\t\t\tsum_r += table[k][j];\n\t\t\t\t\t}\n\t\t\t\t\ttable[i][j] = sum_r;\n\t\t\t\t\tsum_c += table[i][j];\n\t\t\t\t\tSystem.out.print(table[i][j] + \" \");\n\t\t\t\t}\n\t\t\t}",
"if(i != r && j != c) {\n\t\t\t\t\ttable[i][j] = sc.nextInt();\n\t\t\t\t\tsum_c += table[i][j];\n\t\t\t\t\tSystem.out.print(table[i][j] + \" \");\n\t\t\t\t} else if(j == c) {\n\t\t\t\t\ttable[i][j] = sum_c;\n\t\t\t\t\tSystem.out.println(table[i][j]);\n\t\t\t\t} else {\n\t\t\t\t\tint sum_r = 0;\n\t\t\t\t\tfor(int k=0; k<r; k++){\n\t\t\t\t\t\tsum_r += table[k][j];\n\t\t\t\t\t}\n\t\t\t\t\ttable[i][j] = sum_r;\n\t\t\t\t\tsum_c += table[i][j];\n\t\t\t\t\tSystem.out.print(table[i][j] + \" \");\n\t\t\t\t}",
"i != r && j != c",
"i != r",
"i",
"r",
"j != c",
"j",
"c",
"{\n\t\t\t\t\ttable[i][j] = sc.nextInt();\n\t\t\t\t\tsum_c += table[i][j];\n\t\t\t\t\tSystem.out.print(table[i][j] + \" \");\n\t\t\t\t}",
"table[i][j] = sc.nextInt()",
"table[i][j]",
"table[i]",
"table",
"i",
"j",
"sc.nextInt()",
"sc.nextInt",
"sc",
"sum_c += table[i][j]",
"sum_c",
"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",
"\" \"",
"if(j == c) {\n\t\t\t\t\ttable[i][j] = sum_c;\n\t\t\t\t\tSystem.out.println(table[i][j]);\n\t\t\t\t} else {\n\t\t\t\t\tint sum_r = 0;\n\t\t\t\t\tfor(int k=0; k<r; k++){\n\t\t\t\t\t\tsum_r += table[k][j];\n\t\t\t\t\t}\n\t\t\t\t\ttable[i][j] = sum_r;\n\t\t\t\t\tsum_c += table[i][j];\n\t\t\t\t\tSystem.out.print(table[i][j] + \" \");\n\t\t\t\t}",
"j == c",
"j",
"c",
"{\n\t\t\t\t\ttable[i][j] = sum_c;\n\t\t\t\t\tSystem.out.println(table[i][j]);\n\t\t\t\t}",
"table[i][j] = sum_c",
"table[i][j]",
"table[i]",
"table",
"i",
"j",
"sum_c",
"System.out.println(table[i][j])",
"System.out.println",
"System.out",
"System",
"System.out",
"table[i][j]",
"table[i]",
"table",
"i",
"j",
"{\n\t\t\t\t\tint sum_r = 0;\n\t\t\t\t\tfor(int k=0; k<r; k++){\n\t\t\t\t\t\tsum_r += table[k][j];\n\t\t\t\t\t}\n\t\t\t\t\ttable[i][j] = sum_r;\n\t\t\t\t\tsum_c += table[i][j];\n\t\t\t\t\tSystem.out.print(table[i][j] + \" \");\n\t\t\t\t}",
"int sum_r = 0;",
"sum_r",
"0",
"for(int k=0; k<r; k++){\n\t\t\t\t\t\tsum_r += table[k][j];\n\t\t\t\t\t}",
"int k=0;",
"int k=0;",
"k",
"0",
"k<r",
"k",
"r",
"k++",
"k++",
"k",
"{\n\t\t\t\t\t\tsum_r += table[k][j];\n\t\t\t\t\t}",
"{\n\t\t\t\t\t\tsum_r += table[k][j];\n\t\t\t\t\t}",
"sum_r += table[k][j]",
"sum_r",
"table[k][j]",
"table[k]",
"table",
"k",
"j",
"table[i][j] = sum_r",
"table[i][j]",
"table[i]",
"table",
"i",
"j",
"sum_r",
"sum_c += table[i][j]",
"sum_c",
"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[] args",
"args",
"public class Main {\n\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\t\n\t\tint[][] table = new int[r+1][c+1];\n\t\tfor(int i=0; i<r+1; i++) {\n\t\t\tint sum_c = 0;\n\t\t\tfor(int j=0; j<c+1; j++) {\n\t\t\t\tif(i != r && j != c) {\n\t\t\t\t\ttable[i][j] = sc.nextInt();\n\t\t\t\t\tsum_c += table[i][j];\n\t\t\t\t\tSystem.out.print(table[i][j] + \" \");\n\t\t\t\t} else if(j == c) {\n\t\t\t\t\ttable[i][j] = sum_c;\n\t\t\t\t\tSystem.out.println(table[i][j]);\n\t\t\t\t} else {\n\t\t\t\t\tint sum_r = 0;\n\t\t\t\t\tfor(int k=0; k<r; k++){\n\t\t\t\t\t\tsum_r += table[k][j];\n\t\t\t\t\t}\n\t\t\t\t\ttable[i][j] = sum_r;\n\t\t\t\t\tsum_c += table[i][j];\n\t\t\t\t\tSystem.out.print(table[i][j] + \" \");\n\t\t\t\t}\n\t\t\t}\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 r = sc.nextInt();\n\t\tint c = sc.nextInt();\n\t\t\n\t\tint[][] table = new int[r+1][c+1];\n\t\tfor(int i=0; i<r+1; i++) {\n\t\t\tint sum_c = 0;\n\t\t\tfor(int j=0; j<c+1; j++) {\n\t\t\t\tif(i != r && j != c) {\n\t\t\t\t\ttable[i][j] = sc.nextInt();\n\t\t\t\t\tsum_c += table[i][j];\n\t\t\t\t\tSystem.out.print(table[i][j] + \" \");\n\t\t\t\t} else if(j == c) {\n\t\t\t\t\ttable[i][j] = sum_c;\n\t\t\t\t\tSystem.out.println(table[i][j]);\n\t\t\t\t} else {\n\t\t\t\t\tint sum_r = 0;\n\t\t\t\t\tfor(int k=0; k<r; k++){\n\t\t\t\t\t\tsum_r += table[k][j];\n\t\t\t\t\t}\n\t\t\t\t\ttable[i][j] = sum_r;\n\t\t\t\t\tsum_c += table[i][j];\n\t\t\t\t\tSystem.out.print(table[i][j] + \" \");\n\t\t\t\t}\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 r = sc.nextInt();
int c = sc.nextInt();
int[][] table = new int[r+1][c+1];
for(int i=0; i<r+1; i++) {
int sum_c = 0;
for(int j=0; j<c+1; j++) {
if(i != r && j != c) {
table[i][j] = sc.nextInt();
sum_c += table[i][j];
System.out.print(table[i][j] + " ");
} else if(j == c) {
table[i][j] = sum_c;
System.out.println(table[i][j]);
} else {
int sum_r = 0;
for(int k=0; k<r; k++){
sum_r += table[k][j];
}
table[i][j] = sum_r;
sum_c += table[i][j];
System.out.print(table[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,
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
],
[
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
],
[
146,
147
],
[
146,
148
],
[
144,
149
],
[
113,
150
],
[
150,
151
],
[
151,
152
],
[
152,
153
],
[
152,
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\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 mat[][] = 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\tmat[i][j] = scan.nextInt();\n\t\t\t\tmat[i][c] += mat[i][j];\n\t\t\t\tmat[r][j] += mat[i][j];\n\t\t\t\tmat[r][c] += mat[i][j];\n\t\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\tSystem.out.print(mat[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\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\t\tint r = scan.nextInt();\n\t\tint c = scan.nextInt();\n\t\tint mat[][] = 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\tmat[i][j] = scan.nextInt();\n\t\t\t\tmat[i][c] += mat[i][j];\n\t\t\t\tmat[r][j] += mat[i][j];\n\t\t\t\tmat[r][c] += mat[i][j];\n\t\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\tSystem.out.print(mat[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\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();\n\t\tint c = scan.nextInt();\n\t\tint mat[][] = 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\tmat[i][j] = scan.nextInt();\n\t\t\t\tmat[i][c] += mat[i][j];\n\t\t\t\tmat[r][j] += mat[i][j];\n\t\t\t\tmat[r][c] += mat[i][j];\n\t\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\tSystem.out.print(mat[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\tscan.close();\n\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 mat[][] = 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\tmat[i][j] = scan.nextInt();\n\t\t\t\tmat[i][c] += mat[i][j];\n\t\t\t\tmat[r][j] += mat[i][j];\n\t\t\t\tmat[r][c] += mat[i][j];\n\t\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\tSystem.out.print(mat[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\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 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\tfor(int j = 0; j < c; j++){\n\t\t\t\tmat[i][j] = scan.nextInt();\n\t\t\t\tmat[i][c] += mat[i][j];\n\t\t\t\tmat[r][j] += mat[i][j];\n\t\t\t\tmat[r][c] += mat[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\tmat[i][j] = scan.nextInt();\n\t\t\t\tmat[i][c] += mat[i][j];\n\t\t\t\tmat[r][j] += mat[i][j];\n\t\t\t\tmat[r][c] += mat[i][j];\n\t\t\t}\n\t\t}",
"{\n\t\t\tfor(int j = 0; j < c; j++){\n\t\t\t\tmat[i][j] = scan.nextInt();\n\t\t\t\tmat[i][c] += mat[i][j];\n\t\t\t\tmat[r][j] += mat[i][j];\n\t\t\t\tmat[r][c] += mat[i][j];\n\t\t\t}\n\t\t}",
"for(int j = 0; j < c; j++){\n\t\t\t\tmat[i][j] = scan.nextInt();\n\t\t\t\tmat[i][c] += mat[i][j];\n\t\t\t\tmat[r][j] += mat[i][j];\n\t\t\t\tmat[r][c] += mat[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\tmat[i][j] = scan.nextInt();\n\t\t\t\tmat[i][c] += mat[i][j];\n\t\t\t\tmat[r][j] += mat[i][j];\n\t\t\t\tmat[r][c] += mat[i][j];\n\t\t\t}",
"{\n\t\t\t\tmat[i][j] = scan.nextInt();\n\t\t\t\tmat[i][c] += mat[i][j];\n\t\t\t\tmat[r][j] += mat[i][j];\n\t\t\t\tmat[r][c] += mat[i][j];\n\t\t\t}",
"mat[i][j] = scan.nextInt()",
"mat[i][j]",
"mat[i]",
"mat",
"i",
"j",
"scan.nextInt()",
"scan.nextInt",
"scan",
"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",
"mat[r][c] += mat[i][j]",
"mat[r][c]",
"mat[r]",
"mat",
"r",
"c",
"mat[i][j]",
"mat[i]",
"mat",
"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(mat[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(mat[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(mat[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(mat[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(mat[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(mat[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(mat[i][j])",
"System.out.print",
"System.out",
"System",
"System.out",
"mat[i][j]",
"mat[i]",
"mat",
"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",
"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\t\tint r = scan.nextInt();\n\t\tint c = scan.nextInt();\n\t\tint mat[][] = 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\tmat[i][j] = scan.nextInt();\n\t\t\t\tmat[i][c] += mat[i][j];\n\t\t\t\tmat[r][j] += mat[i][j];\n\t\t\t\tmat[r][c] += mat[i][j];\n\t\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\tSystem.out.print(mat[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\tscan.close();\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();\n\t\tint c = scan.nextInt();\n\t\tint mat[][] = 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\tmat[i][j] = scan.nextInt();\n\t\t\t\tmat[i][c] += mat[i][j];\n\t\t\t\tmat[r][j] += mat[i][j];\n\t\t\t\tmat[r][c] += mat[i][j];\n\t\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\tSystem.out.print(mat[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\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 mat[][] = new int[r + 1][c + 1];
for(int i = 0; i < r; i++){
for(int j = 0; j < c; j++){
mat[i][j] = scan.nextInt();
mat[i][c] += mat[i][j];
mat[r][j] += mat[i][j];
mat[r][c] += mat[i][j];
}
}
for(int i = 0; i < r + 1; i++){
for(int j = 0; j < c + 1; j++){
System.out.print(mat[i][j]);
if(j != c){
System.out.print(" ");
}
}
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,
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,
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
],
[
158,
159
],
[
158,
160
],
[
153,
161
],
[
161,
162
],
[
162,
163
],
[
153,
164
],
[
165,
165
],
[
165,
166
],
[
166,
167
],
[
167,
168
],
[
167,
169
],
[
166,
170
],
[
170,
171
],
[
171,
172
],
[
172,
173
],
[
173,
174
],
[
173,
175
],
[
171,
176
],
[
176,
177
],
[
177,
178
],
[
178,
179
],
[
178,
180
],
[
177,
181
],
[
176,
182
],
[
166,
183
],
[
183,
184
],
[
184,
185
],
[
185,
186
],
[
186,
187
],
[
186,
188
],
[
184,
189
],
[
189,
190
],
[
190,
191
],
[
190,
192
],
[
189,
193
],
[
6,
194
],
[
194,
195
],
[
0,
196
],
[
196,
197
],
[
196,
198
]
] | [
"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\n\t\tint r = sc.nextInt();\n\t\tint c = sc.nextInt();\n\t\tint arr[][] = new int[r + 1][c + 1];\n\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\tarr[i][j] = sc.nextInt();\n\t\t\t}\n\t\t}\n\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\tarr[i][c] += arr[i][j];\n\t\t\t}\n\t\t}\n\t\tfor (int i = 0; i <= c; i++) {\n\t\t\tfor (int j = 0; j < r; j++) {\n\t\t\t\tarr[r][i] += arr[j][i];\n\t\t\t}\n\t\t}\n\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 != 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.println(arr[i][j]);\n\t\t\t\t}\n\t\t\t}\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\tScanner sc = new Scanner(System.in);\n\n\t\tint r = sc.nextInt();\n\t\tint c = sc.nextInt();\n\t\tint arr[][] = new int[r + 1][c + 1];\n\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\tarr[i][j] = sc.nextInt();\n\t\t\t}\n\t\t}\n\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\tarr[i][c] += arr[i][j];\n\t\t\t}\n\t\t}\n\t\tfor (int i = 0; i <= c; i++) {\n\t\t\tfor (int j = 0; j < r; j++) {\n\t\t\t\tarr[r][i] += arr[j][i];\n\t\t\t}\n\t\t}\n\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 != 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.println(arr[i][j]);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t}\n\n}",
"Main",
"public static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\n\t\tint r = sc.nextInt();\n\t\tint c = sc.nextInt();\n\t\tint arr[][] = new int[r + 1][c + 1];\n\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\tarr[i][j] = sc.nextInt();\n\t\t\t}\n\t\t}\n\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\tarr[i][c] += arr[i][j];\n\t\t\t}\n\t\t}\n\t\tfor (int i = 0; i <= c; i++) {\n\t\t\tfor (int j = 0; j < r; j++) {\n\t\t\t\tarr[r][i] += arr[j][i];\n\t\t\t}\n\t\t}\n\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 != 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.println(arr[i][j]);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t}",
"main",
"{\n\t\tScanner sc = new Scanner(System.in);\n\n\t\tint r = sc.nextInt();\n\t\tint c = sc.nextInt();\n\t\tint arr[][] = new int[r + 1][c + 1];\n\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\tarr[i][j] = sc.nextInt();\n\t\t\t}\n\t\t}\n\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\tarr[i][c] += arr[i][j];\n\t\t\t}\n\t\t}\n\t\tfor (int i = 0; i <= c; i++) {\n\t\t\tfor (int j = 0; j < r; j++) {\n\t\t\t\tarr[r][i] += arr[j][i];\n\t\t\t}\n\t\t}\n\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 != 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.println(arr[i][j]);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\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 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\tfor (int j = 0; j < c; j++) {\n\t\t\t\tarr[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\tarr[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\tarr[i][j] = sc.nextInt();\n\t\t\t}\n\t\t}",
"for (int j = 0; j < c; j++) {\n\t\t\t\tarr[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\tarr[i][j] = sc.nextInt();\n\t\t\t}",
"{\n\t\t\t\tarr[i][j] = sc.nextInt();\n\t\t\t}",
"arr[i][j] = sc.nextInt()",
"arr[i][j]",
"arr[i]",
"arr",
"i",
"j",
"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\tarr[i][c] += arr[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\tarr[i][c] += arr[i][j];\n\t\t\t}\n\t\t}",
"{\n\t\t\tfor (int j = 0; j < c; j++) {\n\t\t\t\tarr[i][c] += arr[i][j];\n\t\t\t}\n\t\t}",
"for (int j = 0; j < c; j++) {\n\t\t\t\tarr[i][c] += 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][c] += arr[i][j];\n\t\t\t}",
"{\n\t\t\t\tarr[i][c] += arr[i][j];\n\t\t\t}",
"arr[i][c] += arr[i][j]",
"arr[i][c]",
"arr[i]",
"arr",
"i",
"c",
"arr[i][j]",
"arr[i]",
"arr",
"i",
"j",
"for (int i = 0; i <= c; i++) {\n\t\t\tfor (int j = 0; j < r; j++) {\n\t\t\t\tarr[r][i] += arr[j][i];\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\tarr[r][i] += arr[j][i];\n\t\t\t}\n\t\t}",
"{\n\t\t\tfor (int j = 0; j < r; j++) {\n\t\t\t\tarr[r][i] += arr[j][i];\n\t\t\t}\n\t\t}",
"for (int j = 0; j < r; j++) {\n\t\t\t\tarr[r][i] += arr[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\tarr[r][i] += arr[j][i];\n\t\t\t}",
"{\n\t\t\t\tarr[r][i] += arr[j][i];\n\t\t\t}",
"arr[r][i] += arr[j][i]",
"arr[r][i]",
"arr[r]",
"arr",
"r",
"i",
"arr[j][i]",
"arr[j]",
"arr",
"j",
"i",
"for (int i = 0; i <= r; i++) {\n\t\t\tfor (int j = 0; j <= c; 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.println(arr[i][j]);\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 (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.println(arr[i][j]);\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 (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.println(arr[i][j]);\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"for (int j = 0; j <= c; 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.println(arr[i][j]);\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\tSystem.out.print(arr[i][j] + \" \");\n\t\t\t\t} else {\n\t\t\t\t\tSystem.out.println(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.println(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.println(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.println(arr[i][j]);\n\t\t\t\t}",
"System.out.println(arr[i][j])",
"System.out.println",
"System.out",
"System",
"System.out",
"arr[i][j]",
"arr[i]",
"arr",
"i",
"j",
"String[] args",
"args",
"public class Main {\n\n\tpublic static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\n\t\tint r = sc.nextInt();\n\t\tint c = sc.nextInt();\n\t\tint arr[][] = new int[r + 1][c + 1];\n\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\tarr[i][j] = sc.nextInt();\n\t\t\t}\n\t\t}\n\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\tarr[i][c] += arr[i][j];\n\t\t\t}\n\t\t}\n\t\tfor (int i = 0; i <= c; i++) {\n\t\t\tfor (int j = 0; j < r; j++) {\n\t\t\t\tarr[r][i] += arr[j][i];\n\t\t\t}\n\t\t}\n\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 != 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.println(arr[i][j]);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t}\n\n}",
"public class Main {\n\n\tpublic static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\n\t\tint r = sc.nextInt();\n\t\tint c = sc.nextInt();\n\t\tint arr[][] = new int[r + 1][c + 1];\n\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\tarr[i][j] = sc.nextInt();\n\t\t\t}\n\t\t}\n\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\tarr[i][c] += arr[i][j];\n\t\t\t}\n\t\t}\n\t\tfor (int i = 0; i <= c; i++) {\n\t\t\tfor (int j = 0; j < r; j++) {\n\t\t\t\tarr[r][i] += arr[j][i];\n\t\t\t}\n\t\t}\n\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 != 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.println(arr[i][j]);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t}\n\n}",
"Main"
] | import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int r = sc.nextInt();
int c = sc.nextInt();
int arr[][] = new int[r + 1][c + 1];
// ????????????
for (int i = 0; i < r; i++) {
for (int j = 0; j < c; j++) {
arr[i][j] = sc.nextInt();
}
}
// ????¨?
for (int i = 0; i < r; i++) {
for (int j = 0; j < c; j++) {
arr[i][c] += arr[i][j];
}
}
for (int i = 0; i <= c; i++) {
for (int j = 0; j < r; j++) {
arr[r][i] += arr[j][i];
}
}
// ????????????
for (int i = 0; i <= r; i++) {
for (int j = 0; j <= c; j++) {
if (j != c) {
System.out.print(arr[i][j] + " ");
} else {
System.out.println(arr[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,
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,
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,
18,
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,
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,
13,
13,
18,
18,
13,
13,
13,
0,
13,
18,
13,
13,
4,
18,
18,
13,
13,
2,
18,
13,
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
],
[
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,
30
],
[
30,
31
],
[
30,
32
],
[
8,
34
],
[
34,
35
],
[
34,
36
],
[
8,
38
],
[
38,
39
],
[
39,
40
],
[
40,
41
],
[
40,
42
],
[
38,
43
],
[
43,
44
],
[
43,
45
],
[
38,
46
],
[
46,
47
],
[
47,
48
],
[
38,
49
],
[
49,
50
],
[
50,
51
],
[
51,
52
],
[
52,
53
],
[
52,
54
],
[
50,
55
],
[
55,
56
],
[
55,
57
],
[
50,
58
],
[
58,
59
],
[
59,
60
],
[
50,
61
],
[
61,
62
],
[
62,
63
],
[
63,
64
],
[
64,
65
],
[
64,
66
],
[
63,
67
],
[
62,
68
],
[
68,
69
],
[
69,
70
],
[
8,
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
],
[
85,
86
],
[
86,
87
],
[
86,
88
],
[
84,
89
],
[
89,
90
],
[
89,
91
],
[
84,
92
],
[
92,
93
],
[
93,
94
],
[
84,
95
],
[
96,
96
],
[
96,
97
],
[
97,
98
],
[
98,
99
],
[
98,
100
],
[
97,
101
],
[
101,
102
],
[
102,
103
],
[
102,
104
],
[
101,
105
],
[
96,
106
],
[
106,
107
],
[
107,
108
],
[
108,
109
],
[
108,
110
],
[
106,
111
],
[
111,
112
],
[
112,
113
],
[
113,
114
],
[
113,
115
],
[
112,
116
],
[
111,
117
],
[
83,
118
],
[
118,
119
],
[
119,
120
],
[
120,
121
],
[
120,
122
],
[
118,
123
],
[
123,
124
],
[
123,
125
],
[
8,
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
],
[
140,
141
],
[
141,
142
],
[
141,
143
],
[
139,
144
],
[
144,
145
],
[
144,
146
],
[
139,
147
],
[
147,
148
],
[
148,
149
],
[
139,
150
],
[
150,
151
],
[
151,
152
],
[
152,
153
],
[
152,
154
],
[
151,
155
],
[
155,
156
],
[
156,
157
],
[
156,
158
],
[
155,
159
],
[
138,
160
],
[
160,
161
],
[
160,
162
],
[
162,
163
],
[
162,
164
],
[
138,
165
],
[
165,
166
],
[
166,
167
],
[
167,
168
],
[
167,
169
],
[
165,
170
],
[
170,
171
],
[
171,
172
],
[
171,
173
],
[
170,
174
],
[
8,
175
],
[
175,
176
],
[
176,
177
],
[
177,
178
],
[
177,
179
],
[
175,
180
],
[
6,
181
],
[
181,
182
]
] | [
"import java.util.Scanner;\n\nclass Main {\n\tpublic static void main(String[] args) {\n\t\tScanner scanner = new Scanner(System.in);\n\t\tint r = scanner.nextInt(), c = scanner.nextInt(), total = 0;\n\n\t\tint[][] input = new int[r][c];\n\t\tint[] outputR = new int[r];\n\t\tint[] outputC = new int[c];\n\n\t\tfor (int i = 0; i < r; i++)\n\t\t\tfor (int i2 = 0; i2 < c; i2++)\n\t\t\t\tinput[i][i2] = scanner.nextInt();\n\n\t\tfor (int i = 0; i < r; i++) {\n\t\t\tfor (int i2 = 0; i2 < c; i2++) {\n\t\t\t\toutputR[i] += input[i][i2];\n\t\t\t\tSystem.out.print(input[i][i2] + \" \");\n\t\t\t}\n\n\t\t\tSystem.out.println(outputR[i]);\n\t\t}\n\n\t\tfor (int i = 0; i < c; i++) {\n\t\t\tfor (int i2 = 0; i2 < r; i2++)\n\t\t\t\toutputC[i] += input[i2][i];\n\n\t\t\ttotal += outputC[i];\n\t\t\tSystem.out.print(outputC[i] + \" \");\n\t\t}\n\n\t\tSystem.out.println(total);\n\t}\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"class Main {\n\tpublic static void main(String[] args) {\n\t\tScanner scanner = new Scanner(System.in);\n\t\tint r = scanner.nextInt(), c = scanner.nextInt(), total = 0;\n\n\t\tint[][] input = new int[r][c];\n\t\tint[] outputR = new int[r];\n\t\tint[] outputC = new int[c];\n\n\t\tfor (int i = 0; i < r; i++)\n\t\t\tfor (int i2 = 0; i2 < c; i2++)\n\t\t\t\tinput[i][i2] = scanner.nextInt();\n\n\t\tfor (int i = 0; i < r; i++) {\n\t\t\tfor (int i2 = 0; i2 < c; i2++) {\n\t\t\t\toutputR[i] += input[i][i2];\n\t\t\t\tSystem.out.print(input[i][i2] + \" \");\n\t\t\t}\n\n\t\t\tSystem.out.println(outputR[i]);\n\t\t}\n\n\t\tfor (int i = 0; i < c; i++) {\n\t\t\tfor (int i2 = 0; i2 < r; i2++)\n\t\t\t\toutputC[i] += input[i2][i];\n\n\t\t\ttotal += outputC[i];\n\t\t\tSystem.out.print(outputC[i] + \" \");\n\t\t}\n\n\t\tSystem.out.println(total);\n\t}\n}",
"Main",
"public static void main(String[] args) {\n\t\tScanner scanner = new Scanner(System.in);\n\t\tint r = scanner.nextInt(), c = scanner.nextInt(), total = 0;\n\n\t\tint[][] input = new int[r][c];\n\t\tint[] outputR = new int[r];\n\t\tint[] outputC = new int[c];\n\n\t\tfor (int i = 0; i < r; i++)\n\t\t\tfor (int i2 = 0; i2 < c; i2++)\n\t\t\t\tinput[i][i2] = scanner.nextInt();\n\n\t\tfor (int i = 0; i < r; i++) {\n\t\t\tfor (int i2 = 0; i2 < c; i2++) {\n\t\t\t\toutputR[i] += input[i][i2];\n\t\t\t\tSystem.out.print(input[i][i2] + \" \");\n\t\t\t}\n\n\t\t\tSystem.out.println(outputR[i]);\n\t\t}\n\n\t\tfor (int i = 0; i < c; i++) {\n\t\t\tfor (int i2 = 0; i2 < r; i2++)\n\t\t\t\toutputC[i] += input[i2][i];\n\n\t\t\ttotal += outputC[i];\n\t\t\tSystem.out.print(outputC[i] + \" \");\n\t\t}\n\n\t\tSystem.out.println(total);\n\t}",
"main",
"{\n\t\tScanner scanner = new Scanner(System.in);\n\t\tint r = scanner.nextInt(), c = scanner.nextInt(), total = 0;\n\n\t\tint[][] input = new int[r][c];\n\t\tint[] outputR = new int[r];\n\t\tint[] outputC = new int[c];\n\n\t\tfor (int i = 0; i < r; i++)\n\t\t\tfor (int i2 = 0; i2 < c; i2++)\n\t\t\t\tinput[i][i2] = scanner.nextInt();\n\n\t\tfor (int i = 0; i < r; i++) {\n\t\t\tfor (int i2 = 0; i2 < c; i2++) {\n\t\t\t\toutputR[i] += input[i][i2];\n\t\t\t\tSystem.out.print(input[i][i2] + \" \");\n\t\t\t}\n\n\t\t\tSystem.out.println(outputR[i]);\n\t\t}\n\n\t\tfor (int i = 0; i < c; i++) {\n\t\t\tfor (int i2 = 0; i2 < r; i2++)\n\t\t\t\toutputC[i] += input[i2][i];\n\n\t\t\ttotal += outputC[i];\n\t\t\tSystem.out.print(outputC[i] + \" \");\n\t\t}\n\n\t\tSystem.out.println(total);\n\t}",
"Scanner scanner = new Scanner(System.in);",
"scanner",
"new Scanner(System.in)",
"int r = scanner.nextInt()",
"r",
"scanner.nextInt()",
"scanner.nextInt",
"scanner",
"c = scanner.nextInt()",
"c",
"scanner.nextInt()",
"scanner.nextInt",
"scanner",
"total = 0;",
"total",
"0",
"int[][] input = new int[r][c];",
"input",
"new int[r][c]",
"r",
"c",
"int[] outputR = new int[r];",
"outputR",
"new int[r]",
"r",
"int[] outputC = new int[c];",
"outputC",
"new int[c]",
"c",
"for (int i = 0; i < r; i++)\n\t\t\tfor (int i2 = 0; i2 < c; i2++)\n\t\t\t\tinput[i][i2] = scanner.nextInt();",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < r",
"i",
"r",
"i++",
"i++",
"i",
"for (int i2 = 0; i2 < c; i2++)\n\t\t\t\tinput[i][i2] = scanner.nextInt();",
"for (int i2 = 0; i2 < c; i2++)\n\t\t\t\tinput[i][i2] = scanner.nextInt();",
"int i2 = 0;",
"int i2 = 0;",
"i2",
"0",
"i2 < c",
"i2",
"c",
"i2++",
"i2++",
"i2",
"input[i][i2] = scanner.nextInt();",
"input[i][i2] = scanner.nextInt()",
"input[i][i2]",
"input[i]",
"input",
"i",
"i2",
"scanner.nextInt()",
"scanner.nextInt",
"scanner",
"for (int i = 0; i < r; i++) {\n\t\t\tfor (int i2 = 0; i2 < c; i2++) {\n\t\t\t\toutputR[i] += input[i][i2];\n\t\t\t\tSystem.out.print(input[i][i2] + \" \");\n\t\t\t}\n\n\t\t\tSystem.out.println(outputR[i]);\n\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < r",
"i",
"r",
"i++",
"i++",
"i",
"{\n\t\t\tfor (int i2 = 0; i2 < c; i2++) {\n\t\t\t\toutputR[i] += input[i][i2];\n\t\t\t\tSystem.out.print(input[i][i2] + \" \");\n\t\t\t}\n\n\t\t\tSystem.out.println(outputR[i]);\n\t\t}",
"{\n\t\t\tfor (int i2 = 0; i2 < c; i2++) {\n\t\t\t\toutputR[i] += input[i][i2];\n\t\t\t\tSystem.out.print(input[i][i2] + \" \");\n\t\t\t}\n\n\t\t\tSystem.out.println(outputR[i]);\n\t\t}",
"for (int i2 = 0; i2 < c; i2++) {\n\t\t\t\toutputR[i] += input[i][i2];\n\t\t\t\tSystem.out.print(input[i][i2] + \" \");\n\t\t\t}",
"int i2 = 0;",
"int i2 = 0;",
"i2",
"0",
"i2 < c",
"i2",
"c",
"i2++",
"i2++",
"i2",
"{\n\t\t\t\toutputR[i] += input[i][i2];\n\t\t\t\tSystem.out.print(input[i][i2] + \" \");\n\t\t\t}",
"{\n\t\t\t\toutputR[i] += input[i][i2];\n\t\t\t\tSystem.out.print(input[i][i2] + \" \");\n\t\t\t}",
"outputR[i] += input[i][i2]",
"outputR[i]",
"outputR",
"i",
"input[i][i2]",
"input[i]",
"input",
"i",
"i2",
"System.out.print(input[i][i2] + \" \")",
"System.out.print",
"System.out",
"System",
"System.out",
"input[i][i2] + \" \"",
"input[i][i2]",
"input[i]",
"input",
"i",
"i2",
"\" \"",
"System.out.println(outputR[i])",
"System.out.println",
"System.out",
"System",
"System.out",
"outputR[i]",
"outputR",
"i",
"for (int i = 0; i < c; i++) {\n\t\t\tfor (int i2 = 0; i2 < r; i2++)\n\t\t\t\toutputC[i] += input[i2][i];\n\n\t\t\ttotal += outputC[i];\n\t\t\tSystem.out.print(outputC[i] + \" \");\n\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < c",
"i",
"c",
"i++",
"i++",
"i",
"{\n\t\t\tfor (int i2 = 0; i2 < r; i2++)\n\t\t\t\toutputC[i] += input[i2][i];\n\n\t\t\ttotal += outputC[i];\n\t\t\tSystem.out.print(outputC[i] + \" \");\n\t\t}",
"{\n\t\t\tfor (int i2 = 0; i2 < r; i2++)\n\t\t\t\toutputC[i] += input[i2][i];\n\n\t\t\ttotal += outputC[i];\n\t\t\tSystem.out.print(outputC[i] + \" \");\n\t\t}",
"for (int i2 = 0; i2 < r; i2++)\n\t\t\t\toutputC[i] += input[i2][i];",
"int i2 = 0;",
"int i2 = 0;",
"i2",
"0",
"i2 < r",
"i2",
"r",
"i2++",
"i2++",
"i2",
"outputC[i] += input[i2][i];",
"outputC[i] += input[i2][i]",
"outputC[i]",
"outputC",
"i",
"input[i2][i]",
"input[i2]",
"input",
"i2",
"i",
"total += outputC[i]",
"total",
"outputC[i]",
"outputC",
"i",
"System.out.print(outputC[i] + \" \")",
"System.out.print",
"System.out",
"System",
"System.out",
"outputC[i] + \" \"",
"outputC[i]",
"outputC",
"i",
"\" \"",
"System.out.println(total)",
"System.out.println",
"System.out",
"System",
"System.out",
"total",
"String[] args",
"args"
] | import java.util.Scanner;
class Main {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
int r = scanner.nextInt(), c = scanner.nextInt(), total = 0;
int[][] input = new int[r][c];
int[] outputR = new int[r];
int[] outputC = new int[c];
for (int i = 0; i < r; i++)
for (int i2 = 0; i2 < c; i2++)
input[i][i2] = scanner.nextInt();
for (int i = 0; i < r; i++) {
for (int i2 = 0; i2 < c; i2++) {
outputR[i] += input[i][i2];
System.out.print(input[i][i2] + " ");
}
System.out.println(outputR[i]);
}
for (int i = 0; i < c; i++) {
for (int i2 = 0; i2 < r; i2++)
outputC[i] += input[i2][i];
total += outputC[i];
System.out.print(outputC[i] + " ");
}
System.out.println(total);
}
} |
[
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,
17,
41,
13,
17,
41,
13,
41,
13,
0,
13,
20,
2,
13,
17,
2,
13,
17,
0,
13,
20,
13,
41,
13,
11,
1,
0,
13,
17,
2,
13,
13,
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,
0,
18,
18,
13,
13,
13,
13,
30,
0,
18,
18,
13,
13,
13,
4,
18,
13,
0,
18,
13,
13,
2,
18,
13,
13,
18,
18,
13,
13,
13,
0,
13,
2,
13,
18,
18,
13,
13,
13,
0,
13,
2,
13,
18,
18,
13,
13,
13,
0,
13,
17,
11,
1,
0,
13,
17,
2,
13,
2,
13,
17,
1,
40,
13,
30,
30,
14,
2,
13,
13,
30,
0,
18,
18,
13,
13,
13,
13,
30,
0,
18,
18,
13,
13,
13,
18,
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,
0,
13,
4,
18,
13,
18,
18,
13,
13,
13,
4,
18,
18,
13,
13,
13,
30,
0,
13,
2,
4,
18,
13,
18,
18,
13,
13,
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
],
[
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,
29
],
[
29,
30
],
[
29,
31
],
[
8,
32
],
[
32,
33
],
[
8,
34
],
[
34,
35
],
[
8,
36
],
[
36,
37
],
[
36,
38
],
[
39,
40
],
[
39,
41
],
[
42,
43
],
[
42,
44
],
[
8,
45
],
[
45,
46
],
[
45,
47
],
[
8,
49
],
[
49,
50
],
[
8,
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
],
[
71,
72
],
[
71,
73
],
[
64,
74
],
[
74,
75
],
[
75,
76
],
[
64,
77
],
[
78,
78
],
[
78,
79
],
[
79,
80
],
[
80,
81
],
[
80,
82
],
[
79,
83
],
[
83,
84
],
[
84,
85
],
[
85,
86
],
[
86,
87
],
[
86,
88
],
[
85,
89
],
[
84,
90
],
[
79,
91
],
[
91,
92
],
[
92,
93
],
[
93,
94
],
[
94,
95
],
[
94,
96
],
[
93,
97
],
[
92,
98
],
[
98,
99
],
[
99,
100
],
[
91,
101
],
[
101,
102
],
[
102,
103
],
[
102,
104
],
[
101,
105
],
[
105,
106
],
[
106,
107
],
[
106,
108
],
[
105,
109
],
[
109,
110
],
[
110,
111
],
[
110,
112
],
[
109,
113
],
[
91,
114
],
[
114,
115
],
[
114,
116
],
[
116,
117
],
[
116,
118
],
[
118,
119
],
[
119,
120
],
[
119,
121
],
[
118,
122
],
[
91,
123
],
[
123,
124
],
[
123,
125
],
[
125,
126
],
[
125,
127
],
[
127,
128
],
[
128,
129
],
[
128,
130
],
[
127,
131
],
[
63,
132
],
[
132,
133
],
[
132,
134
],
[
8,
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
],
[
155,
156
],
[
156,
157
],
[
157,
158
],
[
157,
159
],
[
156,
160
],
[
155,
161
],
[
150,
162
],
[
162,
163
],
[
163,
164
],
[
164,
165
],
[
165,
166
],
[
165,
167
],
[
164,
168
],
[
163,
169
],
[
169,
170
],
[
169,
171
],
[
8,
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
],
[
189,
191
],
[
187,
192
],
[
192,
193
],
[
192,
194
],
[
194,
195
],
[
194,
196
],
[
187,
197
],
[
197,
198
],
[
198,
199
],
[
187,
200
],
[
201,
201
],
[
201,
202
],
[
202,
203
],
[
203,
204
],
[
203,
205
],
[
202,
206
],
[
206,
207
],
[
207,
208
],
[
207,
209
],
[
209,
210
],
[
210,
211
],
[
209,
212
],
[
212,
213
],
[
213,
214
],
[
213,
215
],
[
212,
216
],
[
206,
217
],
[
217,
218
],
[
218,
219
],
[
219,
220
],
[
219,
221
],
[
217,
222
],
[
202,
223
],
[
223,
224
],
[
224,
225
],
[
224,
226
],
[
226,
227
],
[
227,
228
],
[
228,
229
],
[
227,
230
],
[
230,
231
],
[
231,
232
],
[
231,
233
],
[
230,
234
],
[
226,
235
],
[
223,
236
],
[
236,
237
],
[
237,
238
],
[
238,
239
],
[
238,
240
],
[
236,
241
],
[
6,
242
],
[
242,
243
]
] | [
"import java.util.Scanner;\n\n/**\n * @author kawakami\n *\n */\nclass Main {\n\n\t/**\n\t * @param args\n\t */\n\tpublic static void main(String[] args) {\n\t\t// TODO Auto-generated method stub\n\t\tScanner as = new Scanner(System.in);\n\t\t\n\t\tint r=as.nextInt(); //????????°\n int c=as.nextInt(); //????????°\n \n int i,j;\n int smr = 0;\n int src = 0;\n int glf[][];\n int smc[];\n glf = new int[r+1][c+1]; //??????\n smc = new int[c];\n String str;\n \n for(i=0;i<r;i++){ \n for(j=0;j<c+1;j++){\n \t\n \tif(j == c){\n \t\t\n \t\tglf[i][j]=smr;\n \t\t\n \t}\n \telse{\n \t\t\n \t\t\n \n \t\tglf[i][j]=as.nextInt(); //?????????????´?\n \tsmc[j]=smc[j]+glf[i][j];\n \t\tsmr=smr+glf[i][j];\n \t\tsrc=src+glf[i][j];\n \t\t\n \t}\n \n }\n \n smr=0;\n \n }\n \n for(i=0;i<c+1;i++){\n \tif(i == c){\n \t\n \t\tglf[r][i]=src;\n \t\t\n \t}\n \telse{\n \t\t\n \t\tglf[r][i]=smc[i];\n \t\t\n \t}\n \t\n }\n \n for(i=0;i<r+1;i++){\n \tfor(j=0;j<c+1;j++){\n \t\t\n \t\tif(j == c){\n \t\t\t\n \t\t\tstr=String.valueOf(glf[i][j]);\n \t\t\tSystem.out.println(str);\n \t\t\t\n \t\t}\n \t\telse{\n \t\t\t\n \t\t\tstr=String.valueOf(glf[i][j])+\" \";\n \t\t\tSystem.out.print(str);\n \t\t\t\n \t\t}\n \t}\n }\n \n\n\t}\n\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"class Main {\n\n\t/**\n\t * @param args\n\t */\n\tpublic static void main(String[] args) {\n\t\t// TODO Auto-generated method stub\n\t\tScanner as = new Scanner(System.in);\n\t\t\n\t\tint r=as.nextInt(); //????????°\n int c=as.nextInt(); //????????°\n \n int i,j;\n int smr = 0;\n int src = 0;\n int glf[][];\n int smc[];\n glf = new int[r+1][c+1]; //??????\n smc = new int[c];\n String str;\n \n for(i=0;i<r;i++){ \n for(j=0;j<c+1;j++){\n \t\n \tif(j == c){\n \t\t\n \t\tglf[i][j]=smr;\n \t\t\n \t}\n \telse{\n \t\t\n \t\t\n \n \t\tglf[i][j]=as.nextInt(); //?????????????´?\n \tsmc[j]=smc[j]+glf[i][j];\n \t\tsmr=smr+glf[i][j];\n \t\tsrc=src+glf[i][j];\n \t\t\n \t}\n \n }\n \n smr=0;\n \n }\n \n for(i=0;i<c+1;i++){\n \tif(i == c){\n \t\n \t\tglf[r][i]=src;\n \t\t\n \t}\n \telse{\n \t\t\n \t\tglf[r][i]=smc[i];\n \t\t\n \t}\n \t\n }\n \n for(i=0;i<r+1;i++){\n \tfor(j=0;j<c+1;j++){\n \t\t\n \t\tif(j == c){\n \t\t\t\n \t\t\tstr=String.valueOf(glf[i][j]);\n \t\t\tSystem.out.println(str);\n \t\t\t\n \t\t}\n \t\telse{\n \t\t\t\n \t\t\tstr=String.valueOf(glf[i][j])+\" \";\n \t\t\tSystem.out.print(str);\n \t\t\t\n \t\t}\n \t}\n }\n \n\n\t}\n\n}",
"Main",
"/**\n\t * @param args\n\t */\n\tpublic static void main(String[] args) {\n\t\t// TODO Auto-generated method stub\n\t\tScanner as = new Scanner(System.in);\n\t\t\n\t\tint r=as.nextInt(); //????????°\n int c=as.nextInt(); //????????°\n \n int i,j;\n int smr = 0;\n int src = 0;\n int glf[][];\n int smc[];\n glf = new int[r+1][c+1]; //??????\n smc = new int[c];\n String str;\n \n for(i=0;i<r;i++){ \n for(j=0;j<c+1;j++){\n \t\n \tif(j == c){\n \t\t\n \t\tglf[i][j]=smr;\n \t\t\n \t}\n \telse{\n \t\t\n \t\t\n \n \t\tglf[i][j]=as.nextInt(); //?????????????´?\n \tsmc[j]=smc[j]+glf[i][j];\n \t\tsmr=smr+glf[i][j];\n \t\tsrc=src+glf[i][j];\n \t\t\n \t}\n \n }\n \n smr=0;\n \n }\n \n for(i=0;i<c+1;i++){\n \tif(i == c){\n \t\n \t\tglf[r][i]=src;\n \t\t\n \t}\n \telse{\n \t\t\n \t\tglf[r][i]=smc[i];\n \t\t\n \t}\n \t\n }\n \n for(i=0;i<r+1;i++){\n \tfor(j=0;j<c+1;j++){\n \t\t\n \t\tif(j == c){\n \t\t\t\n \t\t\tstr=String.valueOf(glf[i][j]);\n \t\t\tSystem.out.println(str);\n \t\t\t\n \t\t}\n \t\telse{\n \t\t\t\n \t\t\tstr=String.valueOf(glf[i][j])+\" \";\n \t\t\tSystem.out.print(str);\n \t\t\t\n \t\t}\n \t}\n }\n \n\n\t}",
"main",
"{\n\t\t// TODO Auto-generated method stub\n\t\tScanner as = new Scanner(System.in);\n\t\t\n\t\tint r=as.nextInt(); //????????°\n int c=as.nextInt(); //????????°\n \n int i,j;\n int smr = 0;\n int src = 0;\n int glf[][];\n int smc[];\n glf = new int[r+1][c+1]; //??????\n smc = new int[c];\n String str;\n \n for(i=0;i<r;i++){ \n for(j=0;j<c+1;j++){\n \t\n \tif(j == c){\n \t\t\n \t\tglf[i][j]=smr;\n \t\t\n \t}\n \telse{\n \t\t\n \t\t\n \n \t\tglf[i][j]=as.nextInt(); //?????????????´?\n \tsmc[j]=smc[j]+glf[i][j];\n \t\tsmr=smr+glf[i][j];\n \t\tsrc=src+glf[i][j];\n \t\t\n \t}\n \n }\n \n smr=0;\n \n }\n \n for(i=0;i<c+1;i++){\n \tif(i == c){\n \t\n \t\tglf[r][i]=src;\n \t\t\n \t}\n \telse{\n \t\t\n \t\tglf[r][i]=smc[i];\n \t\t\n \t}\n \t\n }\n \n for(i=0;i<r+1;i++){\n \tfor(j=0;j<c+1;j++){\n \t\t\n \t\tif(j == c){\n \t\t\t\n \t\t\tstr=String.valueOf(glf[i][j]);\n \t\t\tSystem.out.println(str);\n \t\t\t\n \t\t}\n \t\telse{\n \t\t\t\n \t\t\tstr=String.valueOf(glf[i][j])+\" \";\n \t\t\tSystem.out.print(str);\n \t\t\t\n \t\t}\n \t}\n }\n \n\n\t}",
"Scanner as = new Scanner(System.in);",
"as",
"new Scanner(System.in)",
"int r=as.nextInt();",
"r",
"as.nextInt()",
"as.nextInt",
"as",
"int c=as.nextInt();",
"c",
"as.nextInt()",
"as.nextInt",
"as",
"int i",
"i",
"j;",
"j",
"int smr = 0;",
"smr",
"0",
"int src = 0;",
"src",
"0",
"int glf[][];",
"glf",
"int smc[];",
"smc",
"glf = new int[r+1][c+1]",
"glf",
"new int[r+1][c+1]",
"r+1",
"r",
"1",
"c+1",
"c",
"1",
"smc = new int[c]",
"smc",
"new int[c]",
"c",
"String str;",
"str",
"for(i=0;i<r;i++){ \n for(j=0;j<c+1;j++){\n \t\n \tif(j == c){\n \t\t\n \t\tglf[i][j]=smr;\n \t\t\n \t}\n \telse{\n \t\t\n \t\t\n \n \t\tglf[i][j]=as.nextInt(); //?????????????´?\n \tsmc[j]=smc[j]+glf[i][j];\n \t\tsmr=smr+glf[i][j];\n \t\tsrc=src+glf[i][j];\n \t\t\n \t}\n \n }\n \n smr=0;\n \n }",
"i=0;",
"i=0",
"i",
"0",
"i<r",
"i",
"r",
"i++",
"i++",
"i",
"{ \n for(j=0;j<c+1;j++){\n \t\n \tif(j == c){\n \t\t\n \t\tglf[i][j]=smr;\n \t\t\n \t}\n \telse{\n \t\t\n \t\t\n \n \t\tglf[i][j]=as.nextInt(); //?????????????´?\n \tsmc[j]=smc[j]+glf[i][j];\n \t\tsmr=smr+glf[i][j];\n \t\tsrc=src+glf[i][j];\n \t\t\n \t}\n \n }\n \n smr=0;\n \n }",
"{ \n for(j=0;j<c+1;j++){\n \t\n \tif(j == c){\n \t\t\n \t\tglf[i][j]=smr;\n \t\t\n \t}\n \telse{\n \t\t\n \t\t\n \n \t\tglf[i][j]=as.nextInt(); //?????????????´?\n \tsmc[j]=smc[j]+glf[i][j];\n \t\tsmr=smr+glf[i][j];\n \t\tsrc=src+glf[i][j];\n \t\t\n \t}\n \n }\n \n smr=0;\n \n }",
"for(j=0;j<c+1;j++){\n \t\n \tif(j == c){\n \t\t\n \t\tglf[i][j]=smr;\n \t\t\n \t}\n \telse{\n \t\t\n \t\t\n \n \t\tglf[i][j]=as.nextInt(); //?????????????´?\n \tsmc[j]=smc[j]+glf[i][j];\n \t\tsmr=smr+glf[i][j];\n \t\tsrc=src+glf[i][j];\n \t\t\n \t}\n \n }",
"j=0;",
"j=0",
"j",
"0",
"j<c+1",
"j",
"c+1",
"c",
"1",
"j++",
"j++",
"j",
"{\n \t\n \tif(j == c){\n \t\t\n \t\tglf[i][j]=smr;\n \t\t\n \t}\n \telse{\n \t\t\n \t\t\n \n \t\tglf[i][j]=as.nextInt(); //?????????????´?\n \tsmc[j]=smc[j]+glf[i][j];\n \t\tsmr=smr+glf[i][j];\n \t\tsrc=src+glf[i][j];\n \t\t\n \t}\n \n }",
"{\n \t\n \tif(j == c){\n \t\t\n \t\tglf[i][j]=smr;\n \t\t\n \t}\n \telse{\n \t\t\n \t\t\n \n \t\tglf[i][j]=as.nextInt(); //?????????????´?\n \tsmc[j]=smc[j]+glf[i][j];\n \t\tsmr=smr+glf[i][j];\n \t\tsrc=src+glf[i][j];\n \t\t\n \t}\n \n }",
"if(j == c){\n \t\t\n \t\tglf[i][j]=smr;\n \t\t\n \t}\n \telse{\n \t\t\n \t\t\n \n \t\tglf[i][j]=as.nextInt(); //?????????????´?\n \tsmc[j]=smc[j]+glf[i][j];\n \t\tsmr=smr+glf[i][j];\n \t\tsrc=src+glf[i][j];\n \t\t\n \t}",
"j == c",
"j",
"c",
"{\n \t\t\n \t\tglf[i][j]=smr;\n \t\t\n \t}",
"glf[i][j]=smr",
"glf[i][j]",
"glf[i]",
"glf",
"i",
"j",
"smr",
"{\n \t\t\n \t\t\n \n \t\tglf[i][j]=as.nextInt(); //?????????????´?\n \tsmc[j]=smc[j]+glf[i][j];\n \t\tsmr=smr+glf[i][j];\n \t\tsrc=src+glf[i][j];\n \t\t\n \t}",
"glf[i][j]=as.nextInt()",
"glf[i][j]",
"glf[i]",
"glf",
"i",
"j",
"as.nextInt()",
"as.nextInt",
"as",
"smc[j]=smc[j]+glf[i][j]",
"smc[j]",
"smc",
"j",
"smc[j]+glf[i][j]",
"smc[j]",
"smc",
"j",
"glf[i][j]",
"glf[i]",
"glf",
"i",
"j",
"smr=smr+glf[i][j]",
"smr",
"smr+glf[i][j]",
"smr",
"glf[i][j]",
"glf[i]",
"glf",
"i",
"j",
"src=src+glf[i][j]",
"src",
"src+glf[i][j]",
"src",
"glf[i][j]",
"glf[i]",
"glf",
"i",
"j",
"smr=0",
"smr",
"0",
"for(i=0;i<c+1;i++){\n \tif(i == c){\n \t\n \t\tglf[r][i]=src;\n \t\t\n \t}\n \telse{\n \t\t\n \t\tglf[r][i]=smc[i];\n \t\t\n \t}\n \t\n }",
"i=0;",
"i=0",
"i",
"0",
"i<c+1",
"i",
"c+1",
"c",
"1",
"i++",
"i++",
"i",
"{\n \tif(i == c){\n \t\n \t\tglf[r][i]=src;\n \t\t\n \t}\n \telse{\n \t\t\n \t\tglf[r][i]=smc[i];\n \t\t\n \t}\n \t\n }",
"{\n \tif(i == c){\n \t\n \t\tglf[r][i]=src;\n \t\t\n \t}\n \telse{\n \t\t\n \t\tglf[r][i]=smc[i];\n \t\t\n \t}\n \t\n }",
"if(i == c){\n \t\n \t\tglf[r][i]=src;\n \t\t\n \t}\n \telse{\n \t\t\n \t\tglf[r][i]=smc[i];\n \t\t\n \t}",
"i == c",
"i",
"c",
"{\n \t\n \t\tglf[r][i]=src;\n \t\t\n \t}",
"glf[r][i]=src",
"glf[r][i]",
"glf[r]",
"glf",
"r",
"i",
"src",
"{\n \t\t\n \t\tglf[r][i]=smc[i];\n \t\t\n \t}",
"glf[r][i]=smc[i]",
"glf[r][i]",
"glf[r]",
"glf",
"r",
"i",
"smc[i]",
"smc",
"i",
"for(i=0;i<r+1;i++){\n \tfor(j=0;j<c+1;j++){\n \t\t\n \t\tif(j == c){\n \t\t\t\n \t\t\tstr=String.valueOf(glf[i][j]);\n \t\t\tSystem.out.println(str);\n \t\t\t\n \t\t}\n \t\telse{\n \t\t\t\n \t\t\tstr=String.valueOf(glf[i][j])+\" \";\n \t\t\tSystem.out.print(str);\n \t\t\t\n \t\t}\n \t}\n }",
"i=0;",
"i=0",
"i",
"0",
"i<r+1",
"i",
"r+1",
"r",
"1",
"i++",
"i++",
"i",
"{\n \tfor(j=0;j<c+1;j++){\n \t\t\n \t\tif(j == c){\n \t\t\t\n \t\t\tstr=String.valueOf(glf[i][j]);\n \t\t\tSystem.out.println(str);\n \t\t\t\n \t\t}\n \t\telse{\n \t\t\t\n \t\t\tstr=String.valueOf(glf[i][j])+\" \";\n \t\t\tSystem.out.print(str);\n \t\t\t\n \t\t}\n \t}\n }",
"{\n \tfor(j=0;j<c+1;j++){\n \t\t\n \t\tif(j == c){\n \t\t\t\n \t\t\tstr=String.valueOf(glf[i][j]);\n \t\t\tSystem.out.println(str);\n \t\t\t\n \t\t}\n \t\telse{\n \t\t\t\n \t\t\tstr=String.valueOf(glf[i][j])+\" \";\n \t\t\tSystem.out.print(str);\n \t\t\t\n \t\t}\n \t}\n }",
"for(j=0;j<c+1;j++){\n \t\t\n \t\tif(j == c){\n \t\t\t\n \t\t\tstr=String.valueOf(glf[i][j]);\n \t\t\tSystem.out.println(str);\n \t\t\t\n \t\t}\n \t\telse{\n \t\t\t\n \t\t\tstr=String.valueOf(glf[i][j])+\" \";\n \t\t\tSystem.out.print(str);\n \t\t\t\n \t\t}\n \t}",
"j=0;",
"j=0",
"j",
"0",
"j<c+1",
"j",
"c+1",
"c",
"1",
"j++",
"j++",
"j",
"{\n \t\t\n \t\tif(j == c){\n \t\t\t\n \t\t\tstr=String.valueOf(glf[i][j]);\n \t\t\tSystem.out.println(str);\n \t\t\t\n \t\t}\n \t\telse{\n \t\t\t\n \t\t\tstr=String.valueOf(glf[i][j])+\" \";\n \t\t\tSystem.out.print(str);\n \t\t\t\n \t\t}\n \t}",
"{\n \t\t\n \t\tif(j == c){\n \t\t\t\n \t\t\tstr=String.valueOf(glf[i][j]);\n \t\t\tSystem.out.println(str);\n \t\t\t\n \t\t}\n \t\telse{\n \t\t\t\n \t\t\tstr=String.valueOf(glf[i][j])+\" \";\n \t\t\tSystem.out.print(str);\n \t\t\t\n \t\t}\n \t}",
"if(j == c){\n \t\t\t\n \t\t\tstr=String.valueOf(glf[i][j]);\n \t\t\tSystem.out.println(str);\n \t\t\t\n \t\t}\n \t\telse{\n \t\t\t\n \t\t\tstr=String.valueOf(glf[i][j])+\" \";\n \t\t\tSystem.out.print(str);\n \t\t\t\n \t\t}",
"j == c",
"j",
"c",
"{\n \t\t\t\n \t\t\tstr=String.valueOf(glf[i][j]);\n \t\t\tSystem.out.println(str);\n \t\t\t\n \t\t}",
"str=String.valueOf(glf[i][j])",
"str",
"String.valueOf(glf[i][j])",
"String.valueOf",
"String",
"glf[i][j]",
"glf[i]",
"glf",
"i",
"j",
"System.out.println(str)",
"System.out.println",
"System.out",
"System",
"System.out",
"str",
"{\n \t\t\t\n \t\t\tstr=String.valueOf(glf[i][j])+\" \";\n \t\t\tSystem.out.print(str);\n \t\t\t\n \t\t}",
"str=String.valueOf(glf[i][j])+\" \"",
"str",
"String.valueOf(glf[i][j])+\" \"",
"String.valueOf(glf[i][j])",
"String.valueOf",
"String",
"glf[i][j]",
"glf[i]",
"glf",
"i",
"j",
"\" \"",
"System.out.print(str)",
"System.out.print",
"System.out",
"System",
"System.out",
"str",
"String[] args",
"args"
] | import java.util.Scanner;
/**
* @author kawakami
*
*/
class Main {
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
Scanner as = new Scanner(System.in);
int r=as.nextInt(); //????????°
int c=as.nextInt(); //????????°
int i,j;
int smr = 0;
int src = 0;
int glf[][];
int smc[];
glf = new int[r+1][c+1]; //??????
smc = new int[c];
String str;
for(i=0;i<r;i++){
for(j=0;j<c+1;j++){
if(j == c){
glf[i][j]=smr;
}
else{
glf[i][j]=as.nextInt(); //?????????????´?
smc[j]=smc[j]+glf[i][j];
smr=smr+glf[i][j];
src=src+glf[i][j];
}
}
smr=0;
}
for(i=0;i<c+1;i++){
if(i == c){
glf[r][i]=src;
}
else{
glf[r][i]=smc[i];
}
}
for(i=0;i<r+1;i++){
for(j=0;j<c+1;j++){
if(j == c){
str=String.valueOf(glf[i][j]);
System.out.println(str);
}
else{
str=String.valueOf(glf[i][j])+" ";
System.out.print(str);
}
}
}
}
} |
[
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,
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,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
41,
13,
4,
18,
13,
17,
0,
18,
18,
13,
13,
13,
18,
13,
13,
0,
18,
18,
13,
13,
13,
4,
18,
13,
18,
18,
13,
13,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
14,
2,
13,
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,
14,
2,
13,
13,
30,
0,
18,
18,
13,
13,
13,
18,
18,
13,
13,
13,
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,
30,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
14,
2,
13,
13,
30,
0,
18,
18,
13,
13,
13,
18,
18,
13,
13,
13,
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
],
[
272,
5
],
[
272,
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
],
[
44,
46
],
[
47,
48
],
[
47,
49
],
[
50,
51
],
[
50,
52
],
[
8,
53
],
[
53,
54
],
[
54,
55
],
[
55,
56
],
[
55,
57
],
[
53,
58
],
[
58,
59
],
[
58,
60
],
[
53,
61
],
[
61,
62
],
[
62,
63
],
[
53,
64
],
[
65,
65
],
[
65,
66
],
[
66,
67
],
[
66,
68
],
[
68,
69
],
[
69,
70
],
[
65,
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
],
[
86,
89
],
[
83,
90
],
[
90,
91
],
[
91,
92
],
[
92,
93
],
[
92,
94
],
[
91,
95
],
[
90,
96
],
[
96,
97
],
[
96,
98
],
[
83,
99
],
[
99,
100
],
[
100,
101
],
[
101,
102
],
[
101,
103
],
[
100,
104
],
[
99,
105
],
[
105,
106
],
[
106,
107
],
[
105,
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
],
[
113,
121
],
[
121,
122
],
[
122,
123
],
[
113,
124
],
[
125,
125
],
[
125,
126
],
[
126,
127
],
[
127,
128
],
[
127,
129
],
[
126,
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
],
[
144,
149
],
[
149,
150
],
[
149,
151
],
[
144,
152
],
[
152,
153
],
[
153,
154
],
[
144,
155
],
[
156,
156
],
[
156,
157
],
[
157,
158
],
[
158,
159
],
[
158,
160
],
[
157,
161
],
[
161,
162
],
[
162,
163
],
[
163,
164
],
[
164,
165
],
[
164,
166
],
[
163,
167
],
[
162,
168
],
[
168,
169
],
[
169,
170
],
[
169,
171
],
[
168,
172
],
[
143,
173
],
[
173,
174
],
[
174,
175
],
[
174,
176
],
[
173,
177
],
[
177,
178
],
[
178,
179
],
[
179,
180
],
[
180,
181
],
[
180,
182
],
[
178,
183
],
[
183,
184
],
[
184,
185
],
[
184,
186
],
[
183,
187
],
[
173,
188
],
[
188,
189
],
[
189,
190
],
[
190,
191
],
[
191,
192
],
[
191,
193
],
[
189,
194
],
[
194,
195
],
[
195,
196
],
[
196,
197
],
[
196,
198
],
[
195,
199
],
[
194,
200
],
[
130,
201
],
[
201,
202
],
[
202,
203
],
[
203,
204
],
[
203,
205
],
[
126,
206
],
[
206,
207
],
[
207,
208
],
[
208,
209
],
[
209,
210
],
[
209,
211
],
[
207,
212
],
[
212,
213
],
[
212,
214
],
[
207,
215
],
[
215,
216
],
[
216,
217
],
[
207,
218
],
[
219,
219
],
[
219,
220
],
[
220,
221
],
[
221,
222
],
[
221,
223
],
[
220,
224
],
[
224,
225
],
[
225,
226
],
[
226,
227
],
[
227,
228
],
[
227,
229
],
[
226,
230
],
[
225,
231
],
[
231,
232
],
[
232,
233
],
[
232,
234
],
[
231,
235
],
[
219,
236
],
[
236,
237
],
[
237,
238
],
[
237,
239
],
[
236,
240
],
[
240,
241
],
[
241,
242
],
[
242,
243
],
[
243,
244
],
[
243,
245
],
[
241,
246
],
[
246,
247
],
[
247,
248
],
[
247,
249
],
[
246,
250
],
[
236,
251
],
[
251,
252
],
[
252,
253
],
[
253,
254
],
[
254,
255
],
[
254,
256
],
[
252,
257
],
[
257,
258
],
[
258,
259
],
[
259,
260
],
[
259,
261
],
[
258,
262
],
[
257,
263
],
[
206,
264
],
[
264,
265
],
[
265,
266
],
[
266,
267
],
[
266,
268
],
[
6,
269
],
[
269,
270
],
[
0,
271
],
[
271,
272
],
[
271,
273
]
] | [
"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\n\t\tString line1 = sc.nextLine();\n\t\tString[] array1 = line1.split(\" \");\n\t\tint r = Integer.parseInt(array1[0]);\n\t\tint c = Integer.parseInt(array1[1]);\n\n\t\tString[][] h = new String[r][c];\n\t\tint[][] hyou = new int[r + 1][c + 1];\n\t\tfor (int i = 0; i < r; i++) {\n\t\t\tString line2 = sc.nextLine();\n\t\t\tfor (int j = 0; j < c; j++) {\n\t\t\t\tString[] string = line2.split(\" \");\n\t\t\t\th[i][j] = string[j];\n\t\t\t\thyou[i][j] = Integer.parseInt(h[i][j]);\n\t\t\t}\n\n\t\t}\n\n\t\tfor (int i = 0; i <= r; i++) {\n\t\t\tif (i == r) {\n\t\t\t\tfor (int k = 0; k <= c; k++) {\n\t\t\t\t\tfor (int p = 0; p <= r; p++) {\n\t\t\t\t\t\tif (p < r) {\n\t\t\t\t\t\t\thyou[r][k] += hyou[p][k];\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\t\t\t\t\tif (k == c) {\n\t\t\t\t\t\tSystem.out.print(hyou[r][k]);\n\n\t\t\t\t\t} else {\n\t\t\t\t\t\tSystem.out.print(hyou[r][k] + \" \");\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\t\t\t\tSystem.out.println();\n\n\t\t\t} else {\n\t\t\t\tfor (int j = 0; j <= c; j++) {\n\t\t\t\t\tif (j < c) {\n\t\t\t\t\t\thyou[i][c] += hyou[i][j];\n\t\t\t\t\t}\n\t\t\t\t\tif (j == c) {\n\t\t\t\t\t\tSystem.out.print(hyou[i][j]);\n\n\t\t\t\t\t} else {\n\t\t\t\t\t\tSystem.out.print(hyou[i][j] + \" \");\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\t\t\t\tSystem.out.println();\n\t\t\t}\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\tScanner sc = new Scanner(System.in);\n\n\t\tString line1 = sc.nextLine();\n\t\tString[] array1 = line1.split(\" \");\n\t\tint r = Integer.parseInt(array1[0]);\n\t\tint c = Integer.parseInt(array1[1]);\n\n\t\tString[][] h = new String[r][c];\n\t\tint[][] hyou = new int[r + 1][c + 1];\n\t\tfor (int i = 0; i < r; i++) {\n\t\t\tString line2 = sc.nextLine();\n\t\t\tfor (int j = 0; j < c; j++) {\n\t\t\t\tString[] string = line2.split(\" \");\n\t\t\t\th[i][j] = string[j];\n\t\t\t\thyou[i][j] = Integer.parseInt(h[i][j]);\n\t\t\t}\n\n\t\t}\n\n\t\tfor (int i = 0; i <= r; i++) {\n\t\t\tif (i == r) {\n\t\t\t\tfor (int k = 0; k <= c; k++) {\n\t\t\t\t\tfor (int p = 0; p <= r; p++) {\n\t\t\t\t\t\tif (p < r) {\n\t\t\t\t\t\t\thyou[r][k] += hyou[p][k];\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\t\t\t\t\tif (k == c) {\n\t\t\t\t\t\tSystem.out.print(hyou[r][k]);\n\n\t\t\t\t\t} else {\n\t\t\t\t\t\tSystem.out.print(hyou[r][k] + \" \");\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\t\t\t\tSystem.out.println();\n\n\t\t\t} else {\n\t\t\t\tfor (int j = 0; j <= c; j++) {\n\t\t\t\t\tif (j < c) {\n\t\t\t\t\t\thyou[i][c] += hyou[i][j];\n\t\t\t\t\t}\n\t\t\t\t\tif (j == c) {\n\t\t\t\t\t\tSystem.out.print(hyou[i][j]);\n\n\t\t\t\t\t} else {\n\t\t\t\t\t\tSystem.out.print(hyou[i][j] + \" \");\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\t\t\t\tSystem.out.println();\n\t\t\t}\n\t\t}\n\n\t}\n\n}",
"Main",
"public static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\n\t\tString line1 = sc.nextLine();\n\t\tString[] array1 = line1.split(\" \");\n\t\tint r = Integer.parseInt(array1[0]);\n\t\tint c = Integer.parseInt(array1[1]);\n\n\t\tString[][] h = new String[r][c];\n\t\tint[][] hyou = new int[r + 1][c + 1];\n\t\tfor (int i = 0; i < r; i++) {\n\t\t\tString line2 = sc.nextLine();\n\t\t\tfor (int j = 0; j < c; j++) {\n\t\t\t\tString[] string = line2.split(\" \");\n\t\t\t\th[i][j] = string[j];\n\t\t\t\thyou[i][j] = Integer.parseInt(h[i][j]);\n\t\t\t}\n\n\t\t}\n\n\t\tfor (int i = 0; i <= r; i++) {\n\t\t\tif (i == r) {\n\t\t\t\tfor (int k = 0; k <= c; k++) {\n\t\t\t\t\tfor (int p = 0; p <= r; p++) {\n\t\t\t\t\t\tif (p < r) {\n\t\t\t\t\t\t\thyou[r][k] += hyou[p][k];\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\t\t\t\t\tif (k == c) {\n\t\t\t\t\t\tSystem.out.print(hyou[r][k]);\n\n\t\t\t\t\t} else {\n\t\t\t\t\t\tSystem.out.print(hyou[r][k] + \" \");\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\t\t\t\tSystem.out.println();\n\n\t\t\t} else {\n\t\t\t\tfor (int j = 0; j <= c; j++) {\n\t\t\t\t\tif (j < c) {\n\t\t\t\t\t\thyou[i][c] += hyou[i][j];\n\t\t\t\t\t}\n\t\t\t\t\tif (j == c) {\n\t\t\t\t\t\tSystem.out.print(hyou[i][j]);\n\n\t\t\t\t\t} else {\n\t\t\t\t\t\tSystem.out.print(hyou[i][j] + \" \");\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\t\t\t\tSystem.out.println();\n\t\t\t}\n\t\t}\n\n\t}",
"main",
"{\n\t\tScanner sc = new Scanner(System.in);\n\n\t\tString line1 = sc.nextLine();\n\t\tString[] array1 = line1.split(\" \");\n\t\tint r = Integer.parseInt(array1[0]);\n\t\tint c = Integer.parseInt(array1[1]);\n\n\t\tString[][] h = new String[r][c];\n\t\tint[][] hyou = new int[r + 1][c + 1];\n\t\tfor (int i = 0; i < r; i++) {\n\t\t\tString line2 = sc.nextLine();\n\t\t\tfor (int j = 0; j < c; j++) {\n\t\t\t\tString[] string = line2.split(\" \");\n\t\t\t\th[i][j] = string[j];\n\t\t\t\thyou[i][j] = Integer.parseInt(h[i][j]);\n\t\t\t}\n\n\t\t}\n\n\t\tfor (int i = 0; i <= r; i++) {\n\t\t\tif (i == r) {\n\t\t\t\tfor (int k = 0; k <= c; k++) {\n\t\t\t\t\tfor (int p = 0; p <= r; p++) {\n\t\t\t\t\t\tif (p < r) {\n\t\t\t\t\t\t\thyou[r][k] += hyou[p][k];\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\t\t\t\t\tif (k == c) {\n\t\t\t\t\t\tSystem.out.print(hyou[r][k]);\n\n\t\t\t\t\t} else {\n\t\t\t\t\t\tSystem.out.print(hyou[r][k] + \" \");\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\t\t\t\tSystem.out.println();\n\n\t\t\t} else {\n\t\t\t\tfor (int j = 0; j <= c; j++) {\n\t\t\t\t\tif (j < c) {\n\t\t\t\t\t\thyou[i][c] += hyou[i][j];\n\t\t\t\t\t}\n\t\t\t\t\tif (j == c) {\n\t\t\t\t\t\tSystem.out.print(hyou[i][j]);\n\n\t\t\t\t\t} else {\n\t\t\t\t\t\tSystem.out.print(hyou[i][j] + \" \");\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\t\t\t\tSystem.out.println();\n\t\t\t}\n\t\t}\n\n\t}",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"String line1 = sc.nextLine();",
"line1",
"sc.nextLine()",
"sc.nextLine",
"sc",
"String[] array1 = line1.split(\" \");",
"array1",
"line1.split(\" \")",
"line1.split",
"line1",
"\" \"",
"int r = Integer.parseInt(array1[0]);",
"r",
"Integer.parseInt(array1[0])",
"Integer.parseInt",
"Integer",
"array1[0]",
"array1",
"0",
"int c = Integer.parseInt(array1[1]);",
"c",
"Integer.parseInt(array1[1])",
"Integer.parseInt",
"Integer",
"array1[1]",
"array1",
"1",
"String[][] h = new String[r][c];",
"h",
"new String[r][c]",
"r",
"c",
"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\t\t\tString line2 = sc.nextLine();\n\t\t\tfor (int j = 0; j < c; j++) {\n\t\t\t\tString[] string = line2.split(\" \");\n\t\t\t\th[i][j] = string[j];\n\t\t\t\thyou[i][j] = Integer.parseInt(h[i][j]);\n\t\t\t}\n\n\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < r",
"i",
"r",
"i++",
"i++",
"i",
"{\n\t\t\tString line2 = sc.nextLine();\n\t\t\tfor (int j = 0; j < c; j++) {\n\t\t\t\tString[] string = line2.split(\" \");\n\t\t\t\th[i][j] = string[j];\n\t\t\t\thyou[i][j] = Integer.parseInt(h[i][j]);\n\t\t\t}\n\n\t\t}",
"{\n\t\t\tString line2 = sc.nextLine();\n\t\t\tfor (int j = 0; j < c; j++) {\n\t\t\t\tString[] string = line2.split(\" \");\n\t\t\t\th[i][j] = string[j];\n\t\t\t\thyou[i][j] = Integer.parseInt(h[i][j]);\n\t\t\t}\n\n\t\t}",
"String line2 = sc.nextLine();",
"line2",
"sc.nextLine()",
"sc.nextLine",
"sc",
"for (int j = 0; j < c; j++) {\n\t\t\t\tString[] string = line2.split(\" \");\n\t\t\t\th[i][j] = string[j];\n\t\t\t\thyou[i][j] = Integer.parseInt(h[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\tString[] string = line2.split(\" \");\n\t\t\t\th[i][j] = string[j];\n\t\t\t\thyou[i][j] = Integer.parseInt(h[i][j]);\n\t\t\t}",
"{\n\t\t\t\tString[] string = line2.split(\" \");\n\t\t\t\th[i][j] = string[j];\n\t\t\t\thyou[i][j] = Integer.parseInt(h[i][j]);\n\t\t\t}",
"String[] string = line2.split(\" \");",
"string",
"line2.split(\" \")",
"line2.split",
"line2",
"\" \"",
"h[i][j] = string[j]",
"h[i][j]",
"h[i]",
"h",
"i",
"j",
"string[j]",
"string",
"j",
"hyou[i][j] = Integer.parseInt(h[i][j])",
"hyou[i][j]",
"hyou[i]",
"hyou",
"i",
"j",
"Integer.parseInt(h[i][j])",
"Integer.parseInt",
"Integer",
"h[i][j]",
"h[i]",
"h",
"i",
"j",
"for (int i = 0; i <= r; i++) {\n\t\t\tif (i == r) {\n\t\t\t\tfor (int k = 0; k <= c; k++) {\n\t\t\t\t\tfor (int p = 0; p <= r; p++) {\n\t\t\t\t\t\tif (p < r) {\n\t\t\t\t\t\t\thyou[r][k] += hyou[p][k];\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\t\t\t\t\tif (k == c) {\n\t\t\t\t\t\tSystem.out.print(hyou[r][k]);\n\n\t\t\t\t\t} else {\n\t\t\t\t\t\tSystem.out.print(hyou[r][k] + \" \");\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\t\t\t\tSystem.out.println();\n\n\t\t\t} else {\n\t\t\t\tfor (int j = 0; j <= c; j++) {\n\t\t\t\t\tif (j < c) {\n\t\t\t\t\t\thyou[i][c] += hyou[i][j];\n\t\t\t\t\t}\n\t\t\t\t\tif (j == c) {\n\t\t\t\t\t\tSystem.out.print(hyou[i][j]);\n\n\t\t\t\t\t} else {\n\t\t\t\t\t\tSystem.out.print(hyou[i][j] + \" \");\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\t\t\t\tSystem.out.println();\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\tif (i == r) {\n\t\t\t\tfor (int k = 0; k <= c; k++) {\n\t\t\t\t\tfor (int p = 0; p <= r; p++) {\n\t\t\t\t\t\tif (p < r) {\n\t\t\t\t\t\t\thyou[r][k] += hyou[p][k];\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\t\t\t\t\tif (k == c) {\n\t\t\t\t\t\tSystem.out.print(hyou[r][k]);\n\n\t\t\t\t\t} else {\n\t\t\t\t\t\tSystem.out.print(hyou[r][k] + \" \");\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\t\t\t\tSystem.out.println();\n\n\t\t\t} else {\n\t\t\t\tfor (int j = 0; j <= c; j++) {\n\t\t\t\t\tif (j < c) {\n\t\t\t\t\t\thyou[i][c] += hyou[i][j];\n\t\t\t\t\t}\n\t\t\t\t\tif (j == c) {\n\t\t\t\t\t\tSystem.out.print(hyou[i][j]);\n\n\t\t\t\t\t} else {\n\t\t\t\t\t\tSystem.out.print(hyou[i][j] + \" \");\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\t\t\t\tSystem.out.println();\n\t\t\t}\n\t\t}",
"{\n\t\t\tif (i == r) {\n\t\t\t\tfor (int k = 0; k <= c; k++) {\n\t\t\t\t\tfor (int p = 0; p <= r; p++) {\n\t\t\t\t\t\tif (p < r) {\n\t\t\t\t\t\t\thyou[r][k] += hyou[p][k];\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\t\t\t\t\tif (k == c) {\n\t\t\t\t\t\tSystem.out.print(hyou[r][k]);\n\n\t\t\t\t\t} else {\n\t\t\t\t\t\tSystem.out.print(hyou[r][k] + \" \");\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\t\t\t\tSystem.out.println();\n\n\t\t\t} else {\n\t\t\t\tfor (int j = 0; j <= c; j++) {\n\t\t\t\t\tif (j < c) {\n\t\t\t\t\t\thyou[i][c] += hyou[i][j];\n\t\t\t\t\t}\n\t\t\t\t\tif (j == c) {\n\t\t\t\t\t\tSystem.out.print(hyou[i][j]);\n\n\t\t\t\t\t} else {\n\t\t\t\t\t\tSystem.out.print(hyou[i][j] + \" \");\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\t\t\t\tSystem.out.println();\n\t\t\t}\n\t\t}",
"if (i == r) {\n\t\t\t\tfor (int k = 0; k <= c; k++) {\n\t\t\t\t\tfor (int p = 0; p <= r; p++) {\n\t\t\t\t\t\tif (p < r) {\n\t\t\t\t\t\t\thyou[r][k] += hyou[p][k];\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\t\t\t\t\tif (k == c) {\n\t\t\t\t\t\tSystem.out.print(hyou[r][k]);\n\n\t\t\t\t\t} else {\n\t\t\t\t\t\tSystem.out.print(hyou[r][k] + \" \");\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\t\t\t\tSystem.out.println();\n\n\t\t\t} else {\n\t\t\t\tfor (int j = 0; j <= c; j++) {\n\t\t\t\t\tif (j < c) {\n\t\t\t\t\t\thyou[i][c] += hyou[i][j];\n\t\t\t\t\t}\n\t\t\t\t\tif (j == c) {\n\t\t\t\t\t\tSystem.out.print(hyou[i][j]);\n\n\t\t\t\t\t} else {\n\t\t\t\t\t\tSystem.out.print(hyou[i][j] + \" \");\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\t\t\t\tSystem.out.println();\n\t\t\t}",
"i == r",
"i",
"r",
"{\n\t\t\t\tfor (int k = 0; k <= c; k++) {\n\t\t\t\t\tfor (int p = 0; p <= r; p++) {\n\t\t\t\t\t\tif (p < r) {\n\t\t\t\t\t\t\thyou[r][k] += hyou[p][k];\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\t\t\t\t\tif (k == c) {\n\t\t\t\t\t\tSystem.out.print(hyou[r][k]);\n\n\t\t\t\t\t} else {\n\t\t\t\t\t\tSystem.out.print(hyou[r][k] + \" \");\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\t\t\t\tSystem.out.println();\n\n\t\t\t}",
"for (int k = 0; k <= c; k++) {\n\t\t\t\t\tfor (int p = 0; p <= r; p++) {\n\t\t\t\t\t\tif (p < r) {\n\t\t\t\t\t\t\thyou[r][k] += hyou[p][k];\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\t\t\t\t\tif (k == c) {\n\t\t\t\t\t\tSystem.out.print(hyou[r][k]);\n\n\t\t\t\t\t} else {\n\t\t\t\t\t\tSystem.out.print(hyou[r][k] + \" \");\n\n\t\t\t\t\t}\n\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\tfor (int p = 0; p <= r; p++) {\n\t\t\t\t\t\tif (p < r) {\n\t\t\t\t\t\t\thyou[r][k] += hyou[p][k];\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\t\t\t\t\tif (k == c) {\n\t\t\t\t\t\tSystem.out.print(hyou[r][k]);\n\n\t\t\t\t\t} else {\n\t\t\t\t\t\tSystem.out.print(hyou[r][k] + \" \");\n\n\t\t\t\t\t}\n\n\t\t\t\t}",
"{\n\t\t\t\t\tfor (int p = 0; p <= r; p++) {\n\t\t\t\t\t\tif (p < r) {\n\t\t\t\t\t\t\thyou[r][k] += hyou[p][k];\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\t\t\t\t\tif (k == c) {\n\t\t\t\t\t\tSystem.out.print(hyou[r][k]);\n\n\t\t\t\t\t} else {\n\t\t\t\t\t\tSystem.out.print(hyou[r][k] + \" \");\n\n\t\t\t\t\t}\n\n\t\t\t\t}",
"for (int p = 0; p <= r; p++) {\n\t\t\t\t\t\tif (p < r) {\n\t\t\t\t\t\t\thyou[r][k] += hyou[p][k];\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}",
"int p = 0;",
"int p = 0;",
"p",
"0",
"p <= r",
"p",
"r",
"p++",
"p++",
"p",
"{\n\t\t\t\t\t\tif (p < r) {\n\t\t\t\t\t\t\thyou[r][k] += hyou[p][k];\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}",
"{\n\t\t\t\t\t\tif (p < r) {\n\t\t\t\t\t\t\thyou[r][k] += hyou[p][k];\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}",
"if (p < r) {\n\t\t\t\t\t\t\thyou[r][k] += hyou[p][k];\n\t\t\t\t\t\t}",
"p < r",
"p",
"r",
"{\n\t\t\t\t\t\t\thyou[r][k] += hyou[p][k];\n\t\t\t\t\t\t}",
"hyou[r][k] += hyou[p][k]",
"hyou[r][k]",
"hyou[r]",
"hyou",
"r",
"k",
"hyou[p][k]",
"hyou[p]",
"hyou",
"p",
"k",
"if (k == c) {\n\t\t\t\t\t\tSystem.out.print(hyou[r][k]);\n\n\t\t\t\t\t} else {\n\t\t\t\t\t\tSystem.out.print(hyou[r][k] + \" \");\n\n\t\t\t\t\t}",
"k == c",
"k",
"c",
"{\n\t\t\t\t\t\tSystem.out.print(hyou[r][k]);\n\n\t\t\t\t\t}",
"System.out.print(hyou[r][k])",
"System.out.print",
"System.out",
"System",
"System.out",
"hyou[r][k]",
"hyou[r]",
"hyou",
"r",
"k",
"{\n\t\t\t\t\t\tSystem.out.print(hyou[r][k] + \" \");\n\n\t\t\t\t\t}",
"System.out.print(hyou[r][k] + \" \")",
"System.out.print",
"System.out",
"System",
"System.out",
"hyou[r][k] + \" \"",
"hyou[r][k]",
"hyou[r]",
"hyou",
"r",
"k",
"\" \"",
"System.out.println()",
"System.out.println",
"System.out",
"System",
"System.out",
"{\n\t\t\t\tfor (int j = 0; j <= c; j++) {\n\t\t\t\t\tif (j < c) {\n\t\t\t\t\t\thyou[i][c] += hyou[i][j];\n\t\t\t\t\t}\n\t\t\t\t\tif (j == c) {\n\t\t\t\t\t\tSystem.out.print(hyou[i][j]);\n\n\t\t\t\t\t} else {\n\t\t\t\t\t\tSystem.out.print(hyou[i][j] + \" \");\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\t\t\t\tSystem.out.println();\n\t\t\t}",
"for (int j = 0; j <= c; j++) {\n\t\t\t\t\tif (j < c) {\n\t\t\t\t\t\thyou[i][c] += hyou[i][j];\n\t\t\t\t\t}\n\t\t\t\t\tif (j == c) {\n\t\t\t\t\t\tSystem.out.print(hyou[i][j]);\n\n\t\t\t\t\t} else {\n\t\t\t\t\t\tSystem.out.print(hyou[i][j] + \" \");\n\n\t\t\t\t\t}\n\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 (j < c) {\n\t\t\t\t\t\thyou[i][c] += hyou[i][j];\n\t\t\t\t\t}\n\t\t\t\t\tif (j == c) {\n\t\t\t\t\t\tSystem.out.print(hyou[i][j]);\n\n\t\t\t\t\t} else {\n\t\t\t\t\t\tSystem.out.print(hyou[i][j] + \" \");\n\n\t\t\t\t\t}\n\n\t\t\t\t}",
"{\n\t\t\t\t\tif (j < c) {\n\t\t\t\t\t\thyou[i][c] += hyou[i][j];\n\t\t\t\t\t}\n\t\t\t\t\tif (j == c) {\n\t\t\t\t\t\tSystem.out.print(hyou[i][j]);\n\n\t\t\t\t\t} else {\n\t\t\t\t\t\tSystem.out.print(hyou[i][j] + \" \");\n\n\t\t\t\t\t}\n\n\t\t\t\t}",
"if (j < c) {\n\t\t\t\t\t\thyou[i][c] += hyou[i][j];\n\t\t\t\t\t}",
"j < c",
"j",
"c",
"{\n\t\t\t\t\t\thyou[i][c] += hyou[i][j];\n\t\t\t\t\t}",
"hyou[i][c] += hyou[i][j]",
"hyou[i][c]",
"hyou[i]",
"hyou",
"i",
"c",
"hyou[i][j]",
"hyou[i]",
"hyou",
"i",
"j",
"if (j == c) {\n\t\t\t\t\t\tSystem.out.print(hyou[i][j]);\n\n\t\t\t\t\t} else {\n\t\t\t\t\t\tSystem.out.print(hyou[i][j] + \" \");\n\n\t\t\t\t\t}",
"j == c",
"j",
"c",
"{\n\t\t\t\t\t\tSystem.out.print(hyou[i][j]);\n\n\t\t\t\t\t}",
"System.out.print(hyou[i][j])",
"System.out.print",
"System.out",
"System",
"System.out",
"hyou[i][j]",
"hyou[i]",
"hyou",
"i",
"j",
"{\n\t\t\t\t\t\tSystem.out.print(hyou[i][j] + \" \");\n\n\t\t\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()",
"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\n\t\tString line1 = sc.nextLine();\n\t\tString[] array1 = line1.split(\" \");\n\t\tint r = Integer.parseInt(array1[0]);\n\t\tint c = Integer.parseInt(array1[1]);\n\n\t\tString[][] h = new String[r][c];\n\t\tint[][] hyou = new int[r + 1][c + 1];\n\t\tfor (int i = 0; i < r; i++) {\n\t\t\tString line2 = sc.nextLine();\n\t\t\tfor (int j = 0; j < c; j++) {\n\t\t\t\tString[] string = line2.split(\" \");\n\t\t\t\th[i][j] = string[j];\n\t\t\t\thyou[i][j] = Integer.parseInt(h[i][j]);\n\t\t\t}\n\n\t\t}\n\n\t\tfor (int i = 0; i <= r; i++) {\n\t\t\tif (i == r) {\n\t\t\t\tfor (int k = 0; k <= c; k++) {\n\t\t\t\t\tfor (int p = 0; p <= r; p++) {\n\t\t\t\t\t\tif (p < r) {\n\t\t\t\t\t\t\thyou[r][k] += hyou[p][k];\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\t\t\t\t\tif (k == c) {\n\t\t\t\t\t\tSystem.out.print(hyou[r][k]);\n\n\t\t\t\t\t} else {\n\t\t\t\t\t\tSystem.out.print(hyou[r][k] + \" \");\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\t\t\t\tSystem.out.println();\n\n\t\t\t} else {\n\t\t\t\tfor (int j = 0; j <= c; j++) {\n\t\t\t\t\tif (j < c) {\n\t\t\t\t\t\thyou[i][c] += hyou[i][j];\n\t\t\t\t\t}\n\t\t\t\t\tif (j == c) {\n\t\t\t\t\t\tSystem.out.print(hyou[i][j]);\n\n\t\t\t\t\t} else {\n\t\t\t\t\t\tSystem.out.print(hyou[i][j] + \" \");\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\t\t\t\tSystem.out.println();\n\t\t\t}\n\t\t}\n\n\t}\n\n}",
"public class Main {\n\n\tpublic static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\n\t\tString line1 = sc.nextLine();\n\t\tString[] array1 = line1.split(\" \");\n\t\tint r = Integer.parseInt(array1[0]);\n\t\tint c = Integer.parseInt(array1[1]);\n\n\t\tString[][] h = new String[r][c];\n\t\tint[][] hyou = new int[r + 1][c + 1];\n\t\tfor (int i = 0; i < r; i++) {\n\t\t\tString line2 = sc.nextLine();\n\t\t\tfor (int j = 0; j < c; j++) {\n\t\t\t\tString[] string = line2.split(\" \");\n\t\t\t\th[i][j] = string[j];\n\t\t\t\thyou[i][j] = Integer.parseInt(h[i][j]);\n\t\t\t}\n\n\t\t}\n\n\t\tfor (int i = 0; i <= r; i++) {\n\t\t\tif (i == r) {\n\t\t\t\tfor (int k = 0; k <= c; k++) {\n\t\t\t\t\tfor (int p = 0; p <= r; p++) {\n\t\t\t\t\t\tif (p < r) {\n\t\t\t\t\t\t\thyou[r][k] += hyou[p][k];\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\t\t\t\t\tif (k == c) {\n\t\t\t\t\t\tSystem.out.print(hyou[r][k]);\n\n\t\t\t\t\t} else {\n\t\t\t\t\t\tSystem.out.print(hyou[r][k] + \" \");\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\t\t\t\tSystem.out.println();\n\n\t\t\t} else {\n\t\t\t\tfor (int j = 0; j <= c; j++) {\n\t\t\t\t\tif (j < c) {\n\t\t\t\t\t\thyou[i][c] += hyou[i][j];\n\t\t\t\t\t}\n\t\t\t\t\tif (j == c) {\n\t\t\t\t\t\tSystem.out.print(hyou[i][j]);\n\n\t\t\t\t\t} else {\n\t\t\t\t\t\tSystem.out.print(hyou[i][j] + \" \");\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\t\t\t\tSystem.out.println();\n\t\t\t}\n\t\t}\n\n\t}\n\n}",
"Main"
] | import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
String line1 = sc.nextLine();
String[] array1 = line1.split(" ");
int r = Integer.parseInt(array1[0]);
int c = Integer.parseInt(array1[1]);
String[][] h = new String[r][c];
int[][] hyou = new int[r + 1][c + 1];
for (int i = 0; i < r; i++) {
String line2 = sc.nextLine();
for (int j = 0; j < c; j++) {
String[] string = line2.split(" ");
h[i][j] = string[j];
hyou[i][j] = Integer.parseInt(h[i][j]);
}
}
for (int i = 0; i <= r; i++) {
if (i == r) {
for (int k = 0; k <= c; k++) {
for (int p = 0; p <= r; p++) {
if (p < r) {
hyou[r][k] += hyou[p][k];
}
}
if (k == c) {
System.out.print(hyou[r][k]);
} else {
System.out.print(hyou[r][k] + " ");
}
}
System.out.println();
} else {
for (int j = 0; j <= c; j++) {
if (j < c) {
hyou[i][c] += hyou[i][j];
}
if (j == c) {
System.out.print(hyou[i][j]);
} else {
System.out.print(hyou[i][j] + " ");
}
}
System.out.println();
}
}
}
} |
[
7,
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,
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,
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,
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,
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,
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,
4,
18,
13,
18,
18,
13,
13,
13,
17,
4,
18,
4,
18,
13,
18,
13,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
4,
18,
4,
18,
13,
18,
13,
13,
17,
4,
18,
4,
18,
13,
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
],
[
12,
14
],
[
8,
15
],
[
15,
16
],
[
15,
17
],
[
17,
18
],
[
18,
19
],
[
19,
20
],
[
20,
21
],
[
17,
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
],
[
44,
46
],
[
8,
48
],
[
48,
49
],
[
48,
50
],
[
8,
52
],
[
52,
53
],
[
52,
54
],
[
8,
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
],
[
72,
73
],
[
73,
74
],
[
70,
75
],
[
67,
76
],
[
76,
77
],
[
77,
78
],
[
78,
79
],
[
78,
80
],
[
76,
81
],
[
81,
82
],
[
81,
83
],
[
76,
84
],
[
84,
85
],
[
85,
86
],
[
76,
87
],
[
88,
88
],
[
88,
89
],
[
89,
90
],
[
90,
91
],
[
91,
92
],
[
91,
93
],
[
90,
94
],
[
89,
95
],
[
95,
96
],
[
96,
97
],
[
95,
98
],
[
98,
99
],
[
98,
100
],
[
8,
101
],
[
101,
102
],
[
102,
103
],
[
103,
104
],
[
103,
105
],
[
101,
106
],
[
106,
107
],
[
106,
108
],
[
101,
109
],
[
109,
110
],
[
110,
111
],
[
101,
112
],
[
113,
113
],
[
113,
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
],
[
128,
130
],
[
127,
131
],
[
131,
132
],
[
132,
133
],
[
132,
134
],
[
131,
135
],
[
113,
136
],
[
136,
137
],
[
136,
138
],
[
138,
139
],
[
138,
140
],
[
8,
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
],
[
168,
170
],
[
167,
171
],
[
171,
172
],
[
172,
173
],
[
172,
174
],
[
171,
175
],
[
8,
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
],
[
189,
194
],
[
194,
195
],
[
194,
196
],
[
189,
197
],
[
197,
198
],
[
198,
199
],
[
189,
200
],
[
201,
201
],
[
201,
202
],
[
202,
203
],
[
203,
204
],
[
204,
205
],
[
205,
206
],
[
204,
207
],
[
207,
208
],
[
208,
209
],
[
208,
210
],
[
207,
211
],
[
202,
212
],
[
188,
213
],
[
213,
214
],
[
214,
215
],
[
215,
216
],
[
216,
217
],
[
215,
218
],
[
218,
219
],
[
218,
220
],
[
213,
221
],
[
8,
222
],
[
222,
223
],
[
223,
224
],
[
224,
225
],
[
224,
226
],
[
222,
227
],
[
227,
228
],
[
227,
229
],
[
222,
230
],
[
230,
231
],
[
231,
232
],
[
222,
233
],
[
234,
234
],
[
234,
235
],
[
235,
236
],
[
236,
237
],
[
237,
238
],
[
238,
239
],
[
237,
240
],
[
240,
241
],
[
240,
242
],
[
235,
243
],
[
8,
244
],
[
244,
245
],
[
245,
246
],
[
246,
247
],
[
247,
248
],
[
246,
249
],
[
244,
250
],
[
8,
251
],
[
251,
252
],
[
252,
253
],
[
253,
254
],
[
253,
255
],
[
251,
256
],
[
6,
257
],
[
257,
258
]
] | [
"import java.io.*;\n\nclass Main{\n public static void main(String[]args)throws IOException{\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n StringBuilder sb = new StringBuilder();\n\n String[] str1 = br.readLine().split(\" \");\n int r = Integer.parseInt(str1[0]);\n int c = Integer.parseInt(str1[1]);\n int[][] data = new int[r][c];\n int[] sumR = new int[r];\n int[] sumC = new int[c];\n int sumX = 0;\n\n // r x c ????????????????¨??????\\???????????????????´???????\n for(int i=0; i<r; i++){\n String[] str2 = br.readLine().split(\" \");\n for(int k=0; k<c; k++){\n data[i][k] = Integer.parseInt(str2[k]);\n }\n }\n\n // ????¨????sumR????¨??????????\n for(int i=0; i<r; i++){\n for(int k=0; k<c; k++){\n sumR[i] += data[i][k];\n }\n sumX += sumR[i];\n }\n // ????¨????sumC????¨??????????\n for(int i=0; i<c; i++){\n for(int k=0; k<r; k++){\n sumC[i] += data[k][i];\n }\n }\n\n //??????\n for(int i=0; i<r; i++){\n for(int k=0; k<c; k++){\n sb.append(data[i][k]).append(\" \");\n }\n sb.append(sumR[i]).append(\"\\n\");\n }\n for(int k=0; k<c; k++){\n sb.append(sumC[k]).append(\" \");\n }\n sb.append(sumX).append(\"\\n\");\n\n System.out.print(sb);\n }\n}",
"import java.io.*;",
"io.*",
"java",
"class Main{\n public static void main(String[]args)throws IOException{\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n StringBuilder sb = new StringBuilder();\n\n String[] str1 = br.readLine().split(\" \");\n int r = Integer.parseInt(str1[0]);\n int c = Integer.parseInt(str1[1]);\n int[][] data = new int[r][c];\n int[] sumR = new int[r];\n int[] sumC = new int[c];\n int sumX = 0;\n\n // r x c ????????????????¨??????\\???????????????????´???????\n for(int i=0; i<r; i++){\n String[] str2 = br.readLine().split(\" \");\n for(int k=0; k<c; k++){\n data[i][k] = Integer.parseInt(str2[k]);\n }\n }\n\n // ????¨????sumR????¨??????????\n for(int i=0; i<r; i++){\n for(int k=0; k<c; k++){\n sumR[i] += data[i][k];\n }\n sumX += sumR[i];\n }\n // ????¨????sumC????¨??????????\n for(int i=0; i<c; i++){\n for(int k=0; k<r; k++){\n sumC[i] += data[k][i];\n }\n }\n\n //??????\n for(int i=0; i<r; i++){\n for(int k=0; k<c; k++){\n sb.append(data[i][k]).append(\" \");\n }\n sb.append(sumR[i]).append(\"\\n\");\n }\n for(int k=0; k<c; k++){\n sb.append(sumC[k]).append(\" \");\n }\n sb.append(sumX).append(\"\\n\");\n\n System.out.print(sb);\n }\n}",
"Main",
"public static void main(String[]args)throws IOException{\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n StringBuilder sb = new StringBuilder();\n\n String[] str1 = br.readLine().split(\" \");\n int r = Integer.parseInt(str1[0]);\n int c = Integer.parseInt(str1[1]);\n int[][] data = new int[r][c];\n int[] sumR = new int[r];\n int[] sumC = new int[c];\n int sumX = 0;\n\n // r x c ????????????????¨??????\\???????????????????´???????\n for(int i=0; i<r; i++){\n String[] str2 = br.readLine().split(\" \");\n for(int k=0; k<c; k++){\n data[i][k] = Integer.parseInt(str2[k]);\n }\n }\n\n // ????¨????sumR????¨??????????\n for(int i=0; i<r; i++){\n for(int k=0; k<c; k++){\n sumR[i] += data[i][k];\n }\n sumX += sumR[i];\n }\n // ????¨????sumC????¨??????????\n for(int i=0; i<c; i++){\n for(int k=0; k<r; k++){\n sumC[i] += data[k][i];\n }\n }\n\n //??????\n for(int i=0; i<r; i++){\n for(int k=0; k<c; k++){\n sb.append(data[i][k]).append(\" \");\n }\n sb.append(sumR[i]).append(\"\\n\");\n }\n for(int k=0; k<c; k++){\n sb.append(sumC[k]).append(\" \");\n }\n sb.append(sumX).append(\"\\n\");\n\n System.out.print(sb);\n }",
"main",
"{\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n StringBuilder sb = new StringBuilder();\n\n String[] str1 = br.readLine().split(\" \");\n int r = Integer.parseInt(str1[0]);\n int c = Integer.parseInt(str1[1]);\n int[][] data = new int[r][c];\n int[] sumR = new int[r];\n int[] sumC = new int[c];\n int sumX = 0;\n\n // r x c ????????????????¨??????\\???????????????????´???????\n for(int i=0; i<r; i++){\n String[] str2 = br.readLine().split(\" \");\n for(int k=0; k<c; k++){\n data[i][k] = Integer.parseInt(str2[k]);\n }\n }\n\n // ????¨????sumR????¨??????????\n for(int i=0; i<r; i++){\n for(int k=0; k<c; k++){\n sumR[i] += data[i][k];\n }\n sumX += sumR[i];\n }\n // ????¨????sumC????¨??????????\n for(int i=0; i<c; i++){\n for(int k=0; k<r; k++){\n sumC[i] += data[k][i];\n }\n }\n\n //??????\n for(int i=0; i<r; i++){\n for(int k=0; k<c; k++){\n sb.append(data[i][k]).append(\" \");\n }\n sb.append(sumR[i]).append(\"\\n\");\n }\n for(int k=0; k<c; k++){\n sb.append(sumC[k]).append(\" \");\n }\n sb.append(sumX).append(\"\\n\");\n\n System.out.print(sb);\n }",
"BufferedReader br = new BufferedReader(new InputStreamReader(System.in));",
"br",
"new BufferedReader(new InputStreamReader(System.in))",
"StringBuilder sb = new StringBuilder();",
"sb",
"new StringBuilder()",
"String[] str1 = br.readLine().split(\" \");",
"str1",
"br.readLine().split(\" \")",
"br.readLine().split",
"br.readLine()",
"br.readLine",
"br",
"\" \"",
"int r = Integer.parseInt(str1[0]);",
"r",
"Integer.parseInt(str1[0])",
"Integer.parseInt",
"Integer",
"str1[0]",
"str1",
"0",
"int c = Integer.parseInt(str1[1]);",
"c",
"Integer.parseInt(str1[1])",
"Integer.parseInt",
"Integer",
"str1[1]",
"str1",
"1",
"int[][] data = new int[r][c];",
"data",
"new int[r][c]",
"r",
"c",
"int[] sumR = new int[r];",
"sumR",
"new int[r]",
"r",
"int[] sumC = new int[c];",
"sumC",
"new int[c]",
"c",
"int sumX = 0;",
"sumX",
"0",
"for(int i=0; i<r; i++){\n String[] str2 = br.readLine().split(\" \");\n for(int k=0; k<c; k++){\n data[i][k] = Integer.parseInt(str2[k]);\n }\n }",
"int i=0;",
"int i=0;",
"i",
"0",
"i<r",
"i",
"r",
"i++",
"i++",
"i",
"{\n String[] str2 = br.readLine().split(\" \");\n for(int k=0; k<c; k++){\n data[i][k] = Integer.parseInt(str2[k]);\n }\n }",
"{\n String[] str2 = br.readLine().split(\" \");\n for(int k=0; k<c; k++){\n data[i][k] = Integer.parseInt(str2[k]);\n }\n }",
"String[] str2 = br.readLine().split(\" \");",
"str2",
"br.readLine().split(\" \")",
"br.readLine().split",
"br.readLine()",
"br.readLine",
"br",
"\" \"",
"for(int k=0; k<c; k++){\n data[i][k] = Integer.parseInt(str2[k]);\n }",
"int k=0;",
"int k=0;",
"k",
"0",
"k<c",
"k",
"c",
"k++",
"k++",
"k",
"{\n data[i][k] = Integer.parseInt(str2[k]);\n }",
"{\n data[i][k] = Integer.parseInt(str2[k]);\n }",
"data[i][k] = Integer.parseInt(str2[k])",
"data[i][k]",
"data[i]",
"data",
"i",
"k",
"Integer.parseInt(str2[k])",
"Integer.parseInt",
"Integer",
"str2[k]",
"str2",
"k",
"for(int i=0; i<r; i++){\n for(int k=0; k<c; k++){\n sumR[i] += data[i][k];\n }\n sumX += sumR[i];\n }",
"int i=0;",
"int i=0;",
"i",
"0",
"i<r",
"i",
"r",
"i++",
"i++",
"i",
"{\n for(int k=0; k<c; k++){\n sumR[i] += data[i][k];\n }\n sumX += sumR[i];\n }",
"{\n for(int k=0; k<c; k++){\n sumR[i] += data[i][k];\n }\n sumX += sumR[i];\n }",
"for(int k=0; k<c; k++){\n sumR[i] += data[i][k];\n }",
"int k=0;",
"int k=0;",
"k",
"0",
"k<c",
"k",
"c",
"k++",
"k++",
"k",
"{\n sumR[i] += data[i][k];\n }",
"{\n sumR[i] += data[i][k];\n }",
"sumR[i] += data[i][k]",
"sumR[i]",
"sumR",
"i",
"data[i][k]",
"data[i]",
"data",
"i",
"k",
"sumX += sumR[i]",
"sumX",
"sumR[i]",
"sumR",
"i",
"for(int i=0; i<c; i++){\n for(int k=0; k<r; k++){\n sumC[i] += data[k][i];\n }\n }",
"int i=0;",
"int i=0;",
"i",
"0",
"i<c",
"i",
"c",
"i++",
"i++",
"i",
"{\n for(int k=0; k<r; k++){\n sumC[i] += data[k][i];\n }\n }",
"{\n for(int k=0; k<r; k++){\n sumC[i] += data[k][i];\n }\n }",
"for(int k=0; k<r; k++){\n sumC[i] += data[k][i];\n }",
"int k=0;",
"int k=0;",
"k",
"0",
"k<r",
"k",
"r",
"k++",
"k++",
"k",
"{\n sumC[i] += data[k][i];\n }",
"{\n sumC[i] += data[k][i];\n }",
"sumC[i] += data[k][i]",
"sumC[i]",
"sumC",
"i",
"data[k][i]",
"data[k]",
"data",
"k",
"i",
"for(int i=0; i<r; i++){\n for(int k=0; k<c; k++){\n sb.append(data[i][k]).append(\" \");\n }\n sb.append(sumR[i]).append(\"\\n\");\n }",
"int i=0;",
"int i=0;",
"i",
"0",
"i<r",
"i",
"r",
"i++",
"i++",
"i",
"{\n for(int k=0; k<c; k++){\n sb.append(data[i][k]).append(\" \");\n }\n sb.append(sumR[i]).append(\"\\n\");\n }",
"{\n for(int k=0; k<c; k++){\n sb.append(data[i][k]).append(\" \");\n }\n sb.append(sumR[i]).append(\"\\n\");\n }",
"for(int k=0; k<c; k++){\n sb.append(data[i][k]).append(\" \");\n }",
"int k=0;",
"int k=0;",
"k",
"0",
"k<c",
"k",
"c",
"k++",
"k++",
"k",
"{\n sb.append(data[i][k]).append(\" \");\n }",
"{\n sb.append(data[i][k]).append(\" \");\n }",
"sb.append(data[i][k]).append(\" \")",
"sb.append(data[i][k]).append",
"sb.append(data[i][k])",
"sb.append",
"sb",
"data[i][k]",
"data[i]",
"data",
"i",
"k",
"\" \"",
"sb.append(sumR[i]).append(\"\\n\")",
"sb.append(sumR[i]).append",
"sb.append(sumR[i])",
"sb.append",
"sb",
"sumR[i]",
"sumR",
"i",
"\"\\n\"",
"for(int k=0; k<c; k++){\n sb.append(sumC[k]).append(\" \");\n }",
"int k=0;",
"int k=0;",
"k",
"0",
"k<c",
"k",
"c",
"k++",
"k++",
"k",
"{\n sb.append(sumC[k]).append(\" \");\n }",
"{\n sb.append(sumC[k]).append(\" \");\n }",
"sb.append(sumC[k]).append(\" \")",
"sb.append(sumC[k]).append",
"sb.append(sumC[k])",
"sb.append",
"sb",
"sumC[k]",
"sumC",
"k",
"\" \"",
"sb.append(sumX).append(\"\\n\")",
"sb.append(sumX).append",
"sb.append(sumX)",
"sb.append",
"sb",
"sumX",
"\"\\n\"",
"System.out.print(sb)",
"System.out.print",
"System.out",
"System",
"System.out",
"sb",
"String[]args",
"args"
] | import java.io.*;
class Main{
public static void main(String[]args)throws IOException{
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
StringBuilder sb = new StringBuilder();
String[] str1 = br.readLine().split(" ");
int r = Integer.parseInt(str1[0]);
int c = Integer.parseInt(str1[1]);
int[][] data = new int[r][c];
int[] sumR = new int[r];
int[] sumC = new int[c];
int sumX = 0;
// r x c ????????????????¨??????\???????????????????´???????
for(int i=0; i<r; i++){
String[] str2 = br.readLine().split(" ");
for(int k=0; k<c; k++){
data[i][k] = Integer.parseInt(str2[k]);
}
}
// ????¨????sumR????¨??????????
for(int i=0; i<r; i++){
for(int k=0; k<c; k++){
sumR[i] += data[i][k];
}
sumX += sumR[i];
}
// ????¨????sumC????¨??????????
for(int i=0; i<c; i++){
for(int k=0; k<r; k++){
sumC[i] += data[k][i];
}
}
//??????
for(int i=0; i<r; i++){
for(int k=0; k<c; k++){
sb.append(data[i][k]).append(" ");
}
sb.append(sumR[i]).append("\n");
}
for(int k=0; k<c; k++){
sb.append(sumC[k]).append(" ");
}
sb.append(sumX).append("\n");
System.out.print(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,
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,
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,
4,
18,
18,
13,
13,
18,
18,
13,
13,
13,
14,
2,
13,
13,
30,
4,
18,
18,
13,
13,
17,
30,
4,
18,
18,
13,
13,
17,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
218,
5
],
[
218,
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
],
[
28,
29
],
[
28,
30
],
[
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
],
[
95,
97
],
[
97,
98
],
[
98,
99
],
[
98,
100
],
[
97,
101
],
[
81,
102
],
[
102,
103
],
[
103,
104
],
[
104,
105
],
[
104,
106
],
[
103,
107
],
[
102,
108
],
[
81,
109
],
[
109,
110
],
[
109,
111
],
[
8,
112
],
[
112,
113
],
[
113,
114
],
[
114,
115
],
[
114,
116
],
[
112,
117
],
[
117,
118
],
[
117,
119
],
[
119,
120
],
[
119,
121
],
[
112,
122
],
[
122,
123
],
[
123,
124
],
[
112,
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
],
[
143,
144
],
[
143,
145
],
[
142,
146
],
[
126,
147
],
[
147,
148
],
[
148,
149
],
[
149,
150
],
[
149,
151
],
[
148,
152
],
[
147,
153
],
[
126,
154
],
[
154,
155
],
[
154,
156
],
[
8,
157
],
[
157,
158
],
[
158,
159
],
[
159,
160
],
[
159,
161
],
[
157,
162
],
[
162,
163
],
[
162,
164
],
[
164,
165
],
[
164,
166
],
[
157,
167
],
[
167,
168
],
[
168,
169
],
[
157,
170
],
[
171,
171
],
[
171,
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
],
[
189,
191
],
[
187,
192
],
[
192,
193
],
[
193,
194
],
[
193,
195
],
[
192,
196
],
[
186,
197
],
[
197,
198
],
[
198,
199
],
[
198,
200
],
[
197,
201
],
[
201,
202
],
[
202,
203
],
[
203,
204
],
[
204,
205
],
[
204,
206
],
[
202,
207
],
[
197,
208
],
[
208,
209
],
[
209,
210
],
[
210,
211
],
[
211,
212
],
[
211,
213
],
[
209,
214
],
[
6,
215
],
[
215,
216
],
[
0,
217
],
[
217,
218
],
[
217,
219
]
] | [
"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 r = sc.nextInt();\n\t\tint c = sc.nextInt();\n\t\tint worksum = 0;\n\t\tint sheet[][] = 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\tsheet[i][j] = sc.nextInt();\n\t\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\tworksum += sheet[i][j];\n\t\t\t}\n\t\t\tsheet[i][c] = worksum;\n\t\t\tworksum = 0;\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\tworksum += sheet[j][i];\n\t\t\t}\n\t\t\tsheet[r][i] = worksum;\n\t\t\tworksum = 0;\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\tSystem.out.print(sheet[i][j]);\n\t\t\t\tif(j == c){\n\t\t\t\t\tSystem.out.println(\"\");\n\t\t\t\t}else{\n\t\t\t\t\tSystem.out.print(\" \");\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\t\tScanner sc = new Scanner(System.in);\n\t\tint r = sc.nextInt();\n\t\tint c = sc.nextInt();\n\t\tint worksum = 0;\n\t\tint sheet[][] = 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\tsheet[i][j] = sc.nextInt();\n\t\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\tworksum += sheet[i][j];\n\t\t\t}\n\t\t\tsheet[i][c] = worksum;\n\t\t\tworksum = 0;\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\tworksum += sheet[j][i];\n\t\t\t}\n\t\t\tsheet[r][i] = worksum;\n\t\t\tworksum = 0;\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\tSystem.out.print(sheet[i][j]);\n\t\t\t\tif(j == c){\n\t\t\t\t\tSystem.out.println(\"\");\n\t\t\t\t}else{\n\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t}\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 r = sc.nextInt();\n\t\tint c = sc.nextInt();\n\t\tint worksum = 0;\n\t\tint sheet[][] = 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\tsheet[i][j] = sc.nextInt();\n\t\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\tworksum += sheet[i][j];\n\t\t\t}\n\t\t\tsheet[i][c] = worksum;\n\t\t\tworksum = 0;\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\tworksum += sheet[j][i];\n\t\t\t}\n\t\t\tsheet[r][i] = worksum;\n\t\t\tworksum = 0;\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\tSystem.out.print(sheet[i][j]);\n\t\t\t\tif(j == c){\n\t\t\t\t\tSystem.out.println(\"\");\n\t\t\t\t}else{\n\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t}\n\t\t\t}\n\t\t}\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 worksum = 0;\n\t\tint sheet[][] = 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\tsheet[i][j] = sc.nextInt();\n\t\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\tworksum += sheet[i][j];\n\t\t\t}\n\t\t\tsheet[i][c] = worksum;\n\t\t\tworksum = 0;\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\tworksum += sheet[j][i];\n\t\t\t}\n\t\t\tsheet[r][i] = worksum;\n\t\t\tworksum = 0;\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\tSystem.out.print(sheet[i][j]);\n\t\t\t\tif(j == c){\n\t\t\t\t\tSystem.out.println(\"\");\n\t\t\t\t}else{\n\t\t\t\t\tSystem.out.print(\" \");\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 r = sc.nextInt();",
"r",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int c = sc.nextInt();",
"c",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int worksum = 0;",
"worksum",
"0",
"int sheet[][] = new int[r+1][c+1];",
"sheet",
"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\tsheet[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\tsheet[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\tsheet[i][j] = sc.nextInt();\n\t\t\t}\n\t\t}",
"for(int j = 0; j < c; j++){\n\t\t\t\tsheet[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\tsheet[i][j] = sc.nextInt();\n\t\t\t}",
"{\n\t\t\t\tsheet[i][j] = sc.nextInt();\n\t\t\t}",
"sheet[i][j] = sc.nextInt()",
"sheet[i][j]",
"sheet[i]",
"sheet",
"i",
"j",
"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\tworksum += sheet[i][j];\n\t\t\t}\n\t\t\tsheet[i][c] = worksum;\n\t\t\tworksum = 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\tworksum += sheet[i][j];\n\t\t\t}\n\t\t\tsheet[i][c] = worksum;\n\t\t\tworksum = 0;\n\t\t}",
"{\n\t\t\tfor(int j = 0; j < c; j++){\n\t\t\t\tworksum += sheet[i][j];\n\t\t\t}\n\t\t\tsheet[i][c] = worksum;\n\t\t\tworksum = 0;\n\t\t}",
"for(int j = 0; j < c; j++){\n\t\t\t\tworksum += 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\tworksum += sheet[i][j];\n\t\t\t}",
"{\n\t\t\t\tworksum += sheet[i][j];\n\t\t\t}",
"worksum += sheet[i][j]",
"worksum",
"sheet[i][j]",
"sheet[i]",
"sheet",
"i",
"j",
"sheet[i][c] = worksum",
"sheet[i][c]",
"sheet[i]",
"sheet",
"i",
"c",
"worksum",
"worksum = 0",
"worksum",
"0",
"for(int i = 0; i < c + 1; i++){\n\t\t\tfor(int j = 0; j < r; j++){\n\t\t\t\tworksum += sheet[j][i];\n\t\t\t}\n\t\t\tsheet[r][i] = worksum;\n\t\t\tworksum = 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\tfor(int j = 0; j < r; j++){\n\t\t\t\tworksum += sheet[j][i];\n\t\t\t}\n\t\t\tsheet[r][i] = worksum;\n\t\t\tworksum = 0;\n\t\t}",
"{\n\t\t\tfor(int j = 0; j < r; j++){\n\t\t\t\tworksum += sheet[j][i];\n\t\t\t}\n\t\t\tsheet[r][i] = worksum;\n\t\t\tworksum = 0;\n\t\t}",
"for(int j = 0; j < r; j++){\n\t\t\t\tworksum += sheet[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\tworksum += sheet[j][i];\n\t\t\t}",
"{\n\t\t\t\tworksum += sheet[j][i];\n\t\t\t}",
"worksum += sheet[j][i]",
"worksum",
"sheet[j][i]",
"sheet[j]",
"sheet",
"j",
"i",
"sheet[r][i] = worksum",
"sheet[r][i]",
"sheet[r]",
"sheet",
"r",
"i",
"worksum",
"worksum = 0",
"worksum",
"0",
"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(sheet[i][j]);\n\t\t\t\tif(j == c){\n\t\t\t\t\tSystem.out.println(\"\");\n\t\t\t\t}else{\n\t\t\t\t\tSystem.out.print(\" \");\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\tSystem.out.print(sheet[i][j]);\n\t\t\t\tif(j == c){\n\t\t\t\t\tSystem.out.println(\"\");\n\t\t\t\t}else{\n\t\t\t\t\tSystem.out.print(\" \");\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\tSystem.out.print(sheet[i][j]);\n\t\t\t\tif(j == c){\n\t\t\t\t\tSystem.out.println(\"\");\n\t\t\t\t}else{\n\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"for(int j = 0; j < c + 1; j++){\n\t\t\t\tSystem.out.print(sheet[i][j]);\n\t\t\t\tif(j == c){\n\t\t\t\t\tSystem.out.println(\"\");\n\t\t\t\t}else{\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(sheet[i][j]);\n\t\t\t\tif(j == c){\n\t\t\t\t\tSystem.out.println(\"\");\n\t\t\t\t}else{\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 == c){\n\t\t\t\t\tSystem.out.println(\"\");\n\t\t\t\t}else{\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 == c){\n\t\t\t\t\tSystem.out.println(\"\");\n\t\t\t\t}else{\n\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t}",
"j == c",
"j",
"c",
"{\n\t\t\t\t\tSystem.out.println(\"\");\n\t\t\t\t}",
"System.out.println(\"\")",
"System.out.println",
"System.out",
"System",
"System.out",
"\"\"",
"{\n\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t}",
"System.out.print(\" \")",
"System.out.print",
"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\t\tint r = sc.nextInt();\n\t\tint c = sc.nextInt();\n\t\tint worksum = 0;\n\t\tint sheet[][] = 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\tsheet[i][j] = sc.nextInt();\n\t\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\tworksum += sheet[i][j];\n\t\t\t}\n\t\t\tsheet[i][c] = worksum;\n\t\t\tworksum = 0;\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\tworksum += sheet[j][i];\n\t\t\t}\n\t\t\tsheet[r][i] = worksum;\n\t\t\tworksum = 0;\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\tSystem.out.print(sheet[i][j]);\n\t\t\t\tif(j == c){\n\t\t\t\t\tSystem.out.println(\"\");\n\t\t\t\t}else{\n\t\t\t\t\tSystem.out.print(\" \");\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\t\tScanner sc = new Scanner(System.in);\n\t\tint r = sc.nextInt();\n\t\tint c = sc.nextInt();\n\t\tint worksum = 0;\n\t\tint sheet[][] = 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\tsheet[i][j] = sc.nextInt();\n\t\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\tworksum += sheet[i][j];\n\t\t\t}\n\t\t\tsheet[i][c] = worksum;\n\t\t\tworksum = 0;\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\tworksum += sheet[j][i];\n\t\t\t}\n\t\t\tsheet[r][i] = worksum;\n\t\t\tworksum = 0;\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\tSystem.out.print(sheet[i][j]);\n\t\t\t\tif(j == c){\n\t\t\t\t\tSystem.out.println(\"\");\n\t\t\t\t}else{\n\t\t\t\t\tSystem.out.print(\" \");\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 r = sc.nextInt();
int c = sc.nextInt();
int worksum = 0;
int sheet[][] = new int[r+1][c+1];
for(int i = 0; i < r; i++){
for(int j = 0; j < c; j++){
sheet[i][j] = sc.nextInt();
}
}
for(int i = 0; i < r; i++){
for(int j = 0; j < c; j++){
worksum += sheet[i][j];
}
sheet[i][c] = worksum;
worksum = 0;
}
for(int i = 0; i < c + 1; i++){
for(int j = 0; j < r; j++){
worksum += sheet[j][i];
}
sheet[r][i] = worksum;
worksum = 0;
}
for(int i = 0; i < r + 1; i++){
for(int j = 0; j < c + 1; j++){
System.out.print(sheet[i][j]);
if(j == c){
System.out.println("");
}else{
System.out.print(" ");
}
}
}
}
} |
[
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,
41,
13,
20,
13,
41,
13,
20,
13,
41,
13,
17,
41,
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,
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,
13,
18,
18,
13,
13,
13,
14,
2,
13,
2,
13,
17,
30,
0,
18,
18,
13,
13,
13,
13,
0,
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,
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,
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,
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
],
[
270,
11
],
[
270,
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
],
[
51,
53
],
[
14,
55
],
[
55,
56
],
[
55,
57
],
[
14,
59
],
[
59,
60
],
[
59,
61
],
[
14,
62
],
[
62,
63
],
[
62,
64
],
[
14,
65
],
[
65,
66
],
[
65,
67
],
[
14,
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
],
[
81,
83
],
[
83,
84
],
[
84,
85
],
[
85,
86
],
[
86,
87
],
[
83,
88
],
[
80,
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
],
[
108,
111
],
[
111,
112
],
[
111,
113
],
[
14,
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
],
[
138,
139
],
[
139,
140
],
[
140,
141
],
[
140,
142
],
[
142,
143
],
[
143,
144
],
[
143,
145
],
[
142,
146
],
[
139,
147
],
[
147,
148
],
[
147,
149
],
[
149,
150
],
[
150,
151
],
[
150,
152
],
[
149,
153
],
[
139,
154
],
[
154,
155
],
[
155,
156
],
[
155,
157
],
[
157,
158
],
[
157,
159
],
[
154,
160
],
[
160,
161
],
[
161,
162
],
[
162,
163
],
[
163,
164
],
[
163,
165
],
[
162,
166
],
[
161,
167
],
[
160,
168
],
[
168,
169
],
[
168,
170
],
[
126,
171
],
[
171,
172
],
[
172,
173
],
[
173,
174
],
[
173,
175
],
[
171,
176
],
[
176,
177
],
[
176,
178
],
[
171,
179
],
[
179,
180
],
[
180,
181
],
[
171,
182
],
[
183,
183
],
[
183,
184
],
[
184,
185
],
[
185,
186
],
[
186,
187
],
[
186,
188
],
[
185,
189
],
[
184,
190
],
[
190,
191
],
[
191,
192
],
[
191,
193
],
[
190,
194
],
[
14,
195
],
[
195,
196
],
[
196,
197
],
[
197,
198
],
[
197,
199
],
[
195,
200
],
[
200,
201
],
[
200,
202
],
[
202,
203
],
[
202,
204
],
[
195,
205
],
[
205,
206
],
[
206,
207
],
[
195,
208
],
[
209,
209
],
[
209,
210
],
[
210,
211
],
[
211,
212
],
[
212,
213
],
[
212,
214
],
[
210,
215
],
[
215,
216
],
[
215,
217
],
[
217,
218
],
[
217,
219
],
[
210,
220
],
[
220,
221
],
[
221,
222
],
[
210,
223
],
[
224,
224
],
[
224,
225
],
[
225,
226
],
[
226,
227
],
[
227,
228
],
[
227,
229
],
[
226,
230
],
[
230,
231
],
[
230,
232
],
[
225,
233
],
[
233,
234
],
[
234,
235
],
[
235,
236
],
[
236,
237
],
[
236,
238
],
[
234,
239
],
[
225,
240
],
[
240,
241
],
[
241,
242
],
[
242,
243
],
[
243,
244
],
[
243,
245
],
[
241,
246
],
[
246,
247
],
[
247,
248
],
[
247,
249
],
[
246,
250
],
[
240,
251
],
[
251,
252
],
[
252,
253
],
[
252,
254
],
[
251,
255
],
[
255,
256
],
[
256,
257
],
[
257,
258
],
[
258,
259
],
[
258,
260
],
[
256,
261
],
[
209,
262
],
[
262,
263
],
[
263,
264
],
[
264,
265
],
[
264,
266
],
[
12,
267
],
[
267,
268
],
[
0,
269
],
[
269,
270
],
[
269,
271
]
] | [
"\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\n\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\n\t\tString[] imput = br.readLine().split(\" \");\n\t\tint r = Integer.parseInt(imput[0]);\n\t\tint c = Integer.parseInt(imput[1]);\n\t\tint[][] data = new int[r+1][c+1];\n\t\tint[] sumR = new int[c];\n\t\tint[] sumC = new int[r];\n\t\tint sumX = 0;\n\t\tint sumA =0;\n\t\tint cnt=0;\n\n\t\tfor(int i=0;i<r;i++){\n\t\t\tString[] str = br.readLine().split(\" \");\n\t\t\tfor(int j=0;j<c;j++){\n\t\t\t\t//System.out.println(str[j]);\n\t\t\t\tdata[i][j] = Integer.parseInt(str[j]);\n\n\t\t\t}\n\t\t}\n\n\t\tfor(int i=0;i<r;i++){\n\t\t\t\n\t\t\tfor(int j=0;j<c;j++){\n\t\t\t\tsumA += data[i][j];\n\t\t\t\tsumX += data[i][j];\n\t\t\t\t//System.out.println(sumX);\n\t\t\t\tif(j == c-1){\n\t\t\t\t\tdata[i][c]=sumX;\n\t\t\t\t\tsumX=0;\n\t\t\t\t}\n\t\t\t}//System.out.print(data[r][i]+\" \");\n\t\t\t\n\t\t\tfor(int j=0;j<c;j++){\n\t\t\t\t\n\t\t\t\tdata[r][j] += data[i][j];\n\t\t\t\t\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t\t//System.out.println(sumA);\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\t\n\t\t\t\tif(i==r&&j==c){\n\t\t\t\t\tSystem.out.print(sumA);\n\t\t\t\t}else{\n\t\t\t\t\tSystem.out.print(data[i][j]);\n\t\t\t\t\tif(j!=c){\n\t\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t}System.out.println();\n\t\t}\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\n\tpublic static void main(String[] args) throws IOException {\n\n\n\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\n\t\tString[] imput = br.readLine().split(\" \");\n\t\tint r = Integer.parseInt(imput[0]);\n\t\tint c = Integer.parseInt(imput[1]);\n\t\tint[][] data = new int[r+1][c+1];\n\t\tint[] sumR = new int[c];\n\t\tint[] sumC = new int[r];\n\t\tint sumX = 0;\n\t\tint sumA =0;\n\t\tint cnt=0;\n\n\t\tfor(int i=0;i<r;i++){\n\t\t\tString[] str = br.readLine().split(\" \");\n\t\t\tfor(int j=0;j<c;j++){\n\t\t\t\t//System.out.println(str[j]);\n\t\t\t\tdata[i][j] = Integer.parseInt(str[j]);\n\n\t\t\t}\n\t\t}\n\n\t\tfor(int i=0;i<r;i++){\n\t\t\t\n\t\t\tfor(int j=0;j<c;j++){\n\t\t\t\tsumA += data[i][j];\n\t\t\t\tsumX += data[i][j];\n\t\t\t\t//System.out.println(sumX);\n\t\t\t\tif(j == c-1){\n\t\t\t\t\tdata[i][c]=sumX;\n\t\t\t\t\tsumX=0;\n\t\t\t\t}\n\t\t\t}//System.out.print(data[r][i]+\" \");\n\t\t\t\n\t\t\tfor(int j=0;j<c;j++){\n\t\t\t\t\n\t\t\t\tdata[r][j] += data[i][j];\n\t\t\t\t\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t\t//System.out.println(sumA);\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\t\n\t\t\t\tif(i==r&&j==c){\n\t\t\t\t\tSystem.out.print(sumA);\n\t\t\t\t}else{\n\t\t\t\t\tSystem.out.print(data[i][j]);\n\t\t\t\t\tif(j!=c){\n\t\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t}System.out.println();\n\t\t}\n\n\t}\n}",
"Main",
"public static void main(String[] args) throws IOException {\n\n\n\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\n\t\tString[] imput = br.readLine().split(\" \");\n\t\tint r = Integer.parseInt(imput[0]);\n\t\tint c = Integer.parseInt(imput[1]);\n\t\tint[][] data = new int[r+1][c+1];\n\t\tint[] sumR = new int[c];\n\t\tint[] sumC = new int[r];\n\t\tint sumX = 0;\n\t\tint sumA =0;\n\t\tint cnt=0;\n\n\t\tfor(int i=0;i<r;i++){\n\t\t\tString[] str = br.readLine().split(\" \");\n\t\t\tfor(int j=0;j<c;j++){\n\t\t\t\t//System.out.println(str[j]);\n\t\t\t\tdata[i][j] = Integer.parseInt(str[j]);\n\n\t\t\t}\n\t\t}\n\n\t\tfor(int i=0;i<r;i++){\n\t\t\t\n\t\t\tfor(int j=0;j<c;j++){\n\t\t\t\tsumA += data[i][j];\n\t\t\t\tsumX += data[i][j];\n\t\t\t\t//System.out.println(sumX);\n\t\t\t\tif(j == c-1){\n\t\t\t\t\tdata[i][c]=sumX;\n\t\t\t\t\tsumX=0;\n\t\t\t\t}\n\t\t\t}//System.out.print(data[r][i]+\" \");\n\t\t\t\n\t\t\tfor(int j=0;j<c;j++){\n\t\t\t\t\n\t\t\t\tdata[r][j] += data[i][j];\n\t\t\t\t\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t\t//System.out.println(sumA);\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\t\n\t\t\t\tif(i==r&&j==c){\n\t\t\t\t\tSystem.out.print(sumA);\n\t\t\t\t}else{\n\t\t\t\t\tSystem.out.print(data[i][j]);\n\t\t\t\t\tif(j!=c){\n\t\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t}System.out.println();\n\t\t}\n\n\t}",
"main",
"{\n\n\n\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\n\t\tString[] imput = br.readLine().split(\" \");\n\t\tint r = Integer.parseInt(imput[0]);\n\t\tint c = Integer.parseInt(imput[1]);\n\t\tint[][] data = new int[r+1][c+1];\n\t\tint[] sumR = new int[c];\n\t\tint[] sumC = new int[r];\n\t\tint sumX = 0;\n\t\tint sumA =0;\n\t\tint cnt=0;\n\n\t\tfor(int i=0;i<r;i++){\n\t\t\tString[] str = br.readLine().split(\" \");\n\t\t\tfor(int j=0;j<c;j++){\n\t\t\t\t//System.out.println(str[j]);\n\t\t\t\tdata[i][j] = Integer.parseInt(str[j]);\n\n\t\t\t}\n\t\t}\n\n\t\tfor(int i=0;i<r;i++){\n\t\t\t\n\t\t\tfor(int j=0;j<c;j++){\n\t\t\t\tsumA += data[i][j];\n\t\t\t\tsumX += data[i][j];\n\t\t\t\t//System.out.println(sumX);\n\t\t\t\tif(j == c-1){\n\t\t\t\t\tdata[i][c]=sumX;\n\t\t\t\t\tsumX=0;\n\t\t\t\t}\n\t\t\t}//System.out.print(data[r][i]+\" \");\n\t\t\t\n\t\t\tfor(int j=0;j<c;j++){\n\t\t\t\t\n\t\t\t\tdata[r][j] += data[i][j];\n\t\t\t\t\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t\t//System.out.println(sumA);\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\t\n\t\t\t\tif(i==r&&j==c){\n\t\t\t\t\tSystem.out.print(sumA);\n\t\t\t\t}else{\n\t\t\t\t\tSystem.out.print(data[i][j]);\n\t\t\t\t\tif(j!=c){\n\t\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t}System.out.println();\n\t\t}\n\n\t}",
"BufferedReader br = new BufferedReader(new InputStreamReader(System.in));",
"br",
"new BufferedReader(new InputStreamReader(System.in))",
"String[] imput = br.readLine().split(\" \");",
"imput",
"br.readLine().split(\" \")",
"br.readLine().split",
"br.readLine()",
"br.readLine",
"br",
"\" \"",
"int r = Integer.parseInt(imput[0]);",
"r",
"Integer.parseInt(imput[0])",
"Integer.parseInt",
"Integer",
"imput[0]",
"imput",
"0",
"int c = Integer.parseInt(imput[1]);",
"c",
"Integer.parseInt(imput[1])",
"Integer.parseInt",
"Integer",
"imput[1]",
"imput",
"1",
"int[][] data = new int[r+1][c+1];",
"data",
"new int[r+1][c+1]",
"r+1",
"r",
"1",
"c+1",
"c",
"1",
"int[] sumR = new int[c];",
"sumR",
"new int[c]",
"c",
"int[] sumC = new int[r];",
"sumC",
"new int[r]",
"r",
"int sumX = 0;",
"sumX",
"0",
"int sumA =0;",
"sumA",
"0",
"int cnt=0;",
"cnt",
"0",
"for(int i=0;i<r;i++){\n\t\t\tString[] str = br.readLine().split(\" \");\n\t\t\tfor(int j=0;j<c;j++){\n\t\t\t\t//System.out.println(str[j]);\n\t\t\t\tdata[i][j] = Integer.parseInt(str[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\t\t\tString[] str = br.readLine().split(\" \");\n\t\t\tfor(int j=0;j<c;j++){\n\t\t\t\t//System.out.println(str[j]);\n\t\t\t\tdata[i][j] = Integer.parseInt(str[j]);\n\n\t\t\t}\n\t\t}",
"{\n\t\t\tString[] str = br.readLine().split(\" \");\n\t\t\tfor(int j=0;j<c;j++){\n\t\t\t\t//System.out.println(str[j]);\n\t\t\t\tdata[i][j] = Integer.parseInt(str[j]);\n\n\t\t\t}\n\t\t}",
"String[] str = br.readLine().split(\" \");",
"str",
"br.readLine().split(\" \")",
"br.readLine().split",
"br.readLine()",
"br.readLine",
"br",
"\" \"",
"for(int j=0;j<c;j++){\n\t\t\t\t//System.out.println(str[j]);\n\t\t\t\tdata[i][j] = Integer.parseInt(str[j]);\n\n\t\t\t}",
"int j=0;",
"int j=0;",
"j",
"0",
"j<c",
"j",
"c",
"j++",
"j++",
"j",
"{\n\t\t\t\t//System.out.println(str[j]);\n\t\t\t\tdata[i][j] = Integer.parseInt(str[j]);\n\n\t\t\t}",
"{\n\t\t\t\t//System.out.println(str[j]);\n\t\t\t\tdata[i][j] = Integer.parseInt(str[j]);\n\n\t\t\t}",
"data[i][j] = Integer.parseInt(str[j])",
"data[i][j]",
"data[i]",
"data",
"i",
"j",
"Integer.parseInt(str[j])",
"Integer.parseInt",
"Integer",
"str[j]",
"str",
"j",
"for(int i=0;i<r;i++){\n\t\t\t\n\t\t\tfor(int j=0;j<c;j++){\n\t\t\t\tsumA += data[i][j];\n\t\t\t\tsumX += data[i][j];\n\t\t\t\t//System.out.println(sumX);\n\t\t\t\tif(j == c-1){\n\t\t\t\t\tdata[i][c]=sumX;\n\t\t\t\t\tsumX=0;\n\t\t\t\t}\n\t\t\t}//System.out.print(data[r][i]+\" \");\n\t\t\t\n\t\t\tfor(int j=0;j<c;j++){\n\t\t\t\t\n\t\t\t\tdata[r][j] += data[i][j];\n\t\t\t\t\n\t\t\t\t\n\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\t\n\t\t\tfor(int j=0;j<c;j++){\n\t\t\t\tsumA += data[i][j];\n\t\t\t\tsumX += data[i][j];\n\t\t\t\t//System.out.println(sumX);\n\t\t\t\tif(j == c-1){\n\t\t\t\t\tdata[i][c]=sumX;\n\t\t\t\t\tsumX=0;\n\t\t\t\t}\n\t\t\t}//System.out.print(data[r][i]+\" \");\n\t\t\t\n\t\t\tfor(int j=0;j<c;j++){\n\t\t\t\t\n\t\t\t\tdata[r][j] += data[i][j];\n\t\t\t\t\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t}",
"{\n\t\t\t\n\t\t\tfor(int j=0;j<c;j++){\n\t\t\t\tsumA += data[i][j];\n\t\t\t\tsumX += data[i][j];\n\t\t\t\t//System.out.println(sumX);\n\t\t\t\tif(j == c-1){\n\t\t\t\t\tdata[i][c]=sumX;\n\t\t\t\t\tsumX=0;\n\t\t\t\t}\n\t\t\t}//System.out.print(data[r][i]+\" \");\n\t\t\t\n\t\t\tfor(int j=0;j<c;j++){\n\t\t\t\t\n\t\t\t\tdata[r][j] += data[i][j];\n\t\t\t\t\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t}",
"for(int j=0;j<c;j++){\n\t\t\t\tsumA += data[i][j];\n\t\t\t\tsumX += data[i][j];\n\t\t\t\t//System.out.println(sumX);\n\t\t\t\tif(j == c-1){\n\t\t\t\t\tdata[i][c]=sumX;\n\t\t\t\t\tsumX=0;\n\t\t\t\t}\n\t\t\t}//System.out.print(data[r][i]+\" \");",
"int j=0;",
"int j=0;",
"j",
"0",
"j<c",
"j",
"c",
"j++",
"j++",
"j",
"{\n\t\t\t\tsumA += data[i][j];\n\t\t\t\tsumX += data[i][j];\n\t\t\t\t//System.out.println(sumX);\n\t\t\t\tif(j == c-1){\n\t\t\t\t\tdata[i][c]=sumX;\n\t\t\t\t\tsumX=0;\n\t\t\t\t}\n\t\t\t}//System.out.print(data[r][i]+\" \");",
"{\n\t\t\t\tsumA += data[i][j];\n\t\t\t\tsumX += data[i][j];\n\t\t\t\t//System.out.println(sumX);\n\t\t\t\tif(j == c-1){\n\t\t\t\t\tdata[i][c]=sumX;\n\t\t\t\t\tsumX=0;\n\t\t\t\t}\n\t\t\t}",
"sumA += data[i][j]",
"sumA",
"data[i][j]",
"data[i]",
"data",
"i",
"j",
"sumX += data[i][j]",
"sumX",
"data[i][j]",
"data[i]",
"data",
"i",
"j",
"if(j == c-1){\n\t\t\t\t\tdata[i][c]=sumX;\n\t\t\t\t\tsumX=0;\n\t\t\t\t}",
"j == c-1",
"j",
"c-1",
"c",
"1",
"{\n\t\t\t\t\tdata[i][c]=sumX;\n\t\t\t\t\tsumX=0;\n\t\t\t\t}",
"data[i][c]=sumX",
"data[i][c]",
"data[i]",
"data",
"i",
"c",
"sumX",
"sumX=0",
"sumX",
"0",
"for(int j=0;j<c;j++){\n\t\t\t\t\n\t\t\t\tdata[r][j] += data[i][j];\n\t\t\t\t\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\t\n\t\t\t\tdata[r][j] += data[i][j];\n\t\t\t\t\n\t\t\t\t\n\t\t\t}",
"{\n\t\t\t\t\n\t\t\t\tdata[r][j] += data[i][j];\n\t\t\t\t\n\t\t\t\t\n\t\t\t}",
"data[r][j] += data[i][j]",
"data[r][j]",
"data[r]",
"data",
"r",
"j",
"data[i][j]",
"data[i]",
"data",
"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\t\n\t\t\t\tif(i==r&&j==c){\n\t\t\t\t\tSystem.out.print(sumA);\n\t\t\t\t}else{\n\t\t\t\t\tSystem.out.print(data[i][j]);\n\t\t\t\t\tif(j!=c){\n\t\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t}System.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\t\n\t\t\t\tif(i==r&&j==c){\n\t\t\t\t\tSystem.out.print(sumA);\n\t\t\t\t}else{\n\t\t\t\t\tSystem.out.print(data[i][j]);\n\t\t\t\t\tif(j!=c){\n\t\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t\t}\n\t\t\t\t}\n\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\t\n\t\t\t\tif(i==r&&j==c){\n\t\t\t\t\tSystem.out.print(sumA);\n\t\t\t\t}else{\n\t\t\t\t\tSystem.out.print(data[i][j]);\n\t\t\t\t\tif(j!=c){\n\t\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t}System.out.println();\n\t\t}",
"for(int j=0;j<c+1;j++){\n\t\t\t\t\n\t\t\t\tif(i==r&&j==c){\n\t\t\t\t\tSystem.out.print(sumA);\n\t\t\t\t}else{\n\t\t\t\t\tSystem.out.print(data[i][j]);\n\t\t\t\t\tif(j!=c){\n\t\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t\t}\n\t\t\t\t}\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\t\n\t\t\t\tif(i==r&&j==c){\n\t\t\t\t\tSystem.out.print(sumA);\n\t\t\t\t}else{\n\t\t\t\t\tSystem.out.print(data[i][j]);\n\t\t\t\t\tif(j!=c){\n\t\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t}",
"{\n\t\t\t\t\n\t\t\t\tif(i==r&&j==c){\n\t\t\t\t\tSystem.out.print(sumA);\n\t\t\t\t}else{\n\t\t\t\t\tSystem.out.print(data[i][j]);\n\t\t\t\t\tif(j!=c){\n\t\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t}",
"if(i==r&&j==c){\n\t\t\t\t\tSystem.out.print(sumA);\n\t\t\t\t}else{\n\t\t\t\t\tSystem.out.print(data[i][j]);\n\t\t\t\t\tif(j!=c){\n\t\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t\t}\n\t\t\t\t}",
"i==r&&j==c",
"i==r",
"i",
"r",
"j==c",
"j",
"c",
"{\n\t\t\t\t\tSystem.out.print(sumA);\n\t\t\t\t}",
"System.out.print(sumA)",
"System.out.print",
"System.out",
"System",
"System.out",
"sumA",
"{\n\t\t\t\t\tSystem.out.print(data[i][j]);\n\t\t\t\t\tif(j!=c){\n\t\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t\t}\n\t\t\t\t}",
"System.out.print(data[i][j])",
"System.out.print",
"System.out",
"System",
"System.out",
"data[i][j]",
"data[i]",
"data",
"i",
"j",
"if(j!=c){\n\t\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t\t}",
"j!=c",
"j",
"c",
"{\n\t\t\t\t\t\tSystem.out.print(\" \");\n\t\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) throws IOException {\n\n\n\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\n\t\tString[] imput = br.readLine().split(\" \");\n\t\tint r = Integer.parseInt(imput[0]);\n\t\tint c = Integer.parseInt(imput[1]);\n\t\tint[][] data = new int[r+1][c+1];\n\t\tint[] sumR = new int[c];\n\t\tint[] sumC = new int[r];\n\t\tint sumX = 0;\n\t\tint sumA =0;\n\t\tint cnt=0;\n\n\t\tfor(int i=0;i<r;i++){\n\t\t\tString[] str = br.readLine().split(\" \");\n\t\t\tfor(int j=0;j<c;j++){\n\t\t\t\t//System.out.println(str[j]);\n\t\t\t\tdata[i][j] = Integer.parseInt(str[j]);\n\n\t\t\t}\n\t\t}\n\n\t\tfor(int i=0;i<r;i++){\n\t\t\t\n\t\t\tfor(int j=0;j<c;j++){\n\t\t\t\tsumA += data[i][j];\n\t\t\t\tsumX += data[i][j];\n\t\t\t\t//System.out.println(sumX);\n\t\t\t\tif(j == c-1){\n\t\t\t\t\tdata[i][c]=sumX;\n\t\t\t\t\tsumX=0;\n\t\t\t\t}\n\t\t\t}//System.out.print(data[r][i]+\" \");\n\t\t\t\n\t\t\tfor(int j=0;j<c;j++){\n\t\t\t\t\n\t\t\t\tdata[r][j] += data[i][j];\n\t\t\t\t\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t\t//System.out.println(sumA);\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\t\n\t\t\t\tif(i==r&&j==c){\n\t\t\t\t\tSystem.out.print(sumA);\n\t\t\t\t}else{\n\t\t\t\t\tSystem.out.print(data[i][j]);\n\t\t\t\t\tif(j!=c){\n\t\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t}System.out.println();\n\t\t}\n\n\t}\n}",
"public class Main {\n\n\tpublic static void main(String[] args) throws IOException {\n\n\n\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\n\t\tString[] imput = br.readLine().split(\" \");\n\t\tint r = Integer.parseInt(imput[0]);\n\t\tint c = Integer.parseInt(imput[1]);\n\t\tint[][] data = new int[r+1][c+1];\n\t\tint[] sumR = new int[c];\n\t\tint[] sumC = new int[r];\n\t\tint sumX = 0;\n\t\tint sumA =0;\n\t\tint cnt=0;\n\n\t\tfor(int i=0;i<r;i++){\n\t\t\tString[] str = br.readLine().split(\" \");\n\t\t\tfor(int j=0;j<c;j++){\n\t\t\t\t//System.out.println(str[j]);\n\t\t\t\tdata[i][j] = Integer.parseInt(str[j]);\n\n\t\t\t}\n\t\t}\n\n\t\tfor(int i=0;i<r;i++){\n\t\t\t\n\t\t\tfor(int j=0;j<c;j++){\n\t\t\t\tsumA += data[i][j];\n\t\t\t\tsumX += data[i][j];\n\t\t\t\t//System.out.println(sumX);\n\t\t\t\tif(j == c-1){\n\t\t\t\t\tdata[i][c]=sumX;\n\t\t\t\t\tsumX=0;\n\t\t\t\t}\n\t\t\t}//System.out.print(data[r][i]+\" \");\n\t\t\t\n\t\t\tfor(int j=0;j<c;j++){\n\t\t\t\t\n\t\t\t\tdata[r][j] += data[i][j];\n\t\t\t\t\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t\t//System.out.println(sumA);\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\t\n\t\t\t\tif(i==r&&j==c){\n\t\t\t\t\tSystem.out.print(sumA);\n\t\t\t\t}else{\n\t\t\t\t\tSystem.out.print(data[i][j]);\n\t\t\t\t\tif(j!=c){\n\t\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t}System.out.println();\n\t\t}\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[] imput = br.readLine().split(" ");
int r = Integer.parseInt(imput[0]);
int c = Integer.parseInt(imput[1]);
int[][] data = new int[r+1][c+1];
int[] sumR = new int[c];
int[] sumC = new int[r];
int sumX = 0;
int sumA =0;
int cnt=0;
for(int i=0;i<r;i++){
String[] str = br.readLine().split(" ");
for(int j=0;j<c;j++){
//System.out.println(str[j]);
data[i][j] = Integer.parseInt(str[j]);
}
}
for(int i=0;i<r;i++){
for(int j=0;j<c;j++){
sumA += data[i][j];
sumX += data[i][j];
//System.out.println(sumX);
if(j == c-1){
data[i][c]=sumX;
sumX=0;
}
}//System.out.print(data[r][i]+" ");
for(int j=0;j<c;j++){
data[r][j] += data[i][j];
}
}
//System.out.println(sumA);
for(int i=0;i<r+1;i++){
for(int j=0;j<c+1;j++){
if(i==r&&j==c){
System.out.print(sumA);
}else{
System.out.print(data[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,
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,
2,
13,
18,
18,
13,
13,
13,
14,
2,
13,
2,
13,
17,
30,
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,
30,
0,
13,
2,
13,
18,
18,
13,
13,
13,
14,
2,
13,
2,
13,
17,
30,
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,
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
],
[
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
],
[
8,
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
],
[
81,
83
],
[
80,
84
],
[
84,
85
],
[
85,
86
],
[
86,
87
],
[
86,
88
],
[
84,
89
],
[
89,
90
],
[
89,
91
],
[
84,
92
],
[
92,
93
],
[
93,
94
],
[
84,
95
],
[
96,
96
],
[
96,
97
],
[
97,
98
],
[
97,
99
],
[
99,
100
],
[
99,
101
],
[
101,
102
],
[
102,
103
],
[
102,
104
],
[
101,
105
],
[
96,
106
],
[
106,
107
],
[
107,
108
],
[
107,
109
],
[
109,
110
],
[
109,
111
],
[
106,
112
],
[
112,
113
],
[
113,
114
],
[
114,
115
],
[
115,
116
],
[
115,
117
],
[
114,
118
],
[
113,
119
],
[
8,
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
],
[
133,
135
],
[
132,
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
],
[
149,
151
],
[
151,
152
],
[
151,
153
],
[
153,
154
],
[
154,
155
],
[
154,
156
],
[
153,
157
],
[
148,
158
],
[
158,
159
],
[
159,
160
],
[
159,
161
],
[
161,
162
],
[
161,
163
],
[
158,
164
],
[
164,
165
],
[
165,
166
],
[
166,
167
],
[
167,
168
],
[
167,
169
],
[
166,
170
],
[
165,
171
],
[
8,
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
],
[
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
],
[
204,
205
],
[
204,
206
],
[
203,
207
],
[
197,
208
],
[
208,
209
],
[
209,
210
],
[
209,
211
],
[
208,
212
],
[
212,
213
],
[
213,
214
],
[
214,
215
],
[
215,
216
],
[
215,
217
],
[
213,
218
],
[
184,
219
],
[
219,
220
],
[
220,
221
],
[
221,
222
],
[
221,
223
],
[
6,
224
],
[
224,
225
]
] | [
"import java.util.Scanner;\nclass 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[][] rc=new int[r+1][c+1]; \n for(int i=0;i<r;i++){\n for(int j=0;j<c;j++){\n rc[i][j]=sc.nextInt();\n }\n }\n int sum;\n for(int k=0;k<r;k++){\n sum=0;\n for(int l=0;l<c;l++){\n sum=sum+rc[k][l];\n if(l==c-1){\n rc[k][c]=sum;\n }\n }\n }for(int a=0;a<=c;a++){\n sum=0;\n for(int b=0;b<r;b++){\n sum=sum+rc[b][a];\n if(b==r-1){\n rc[r][a]=sum;\n }\n }\n }\n for(int d=0;d<=r;d++){\n for(int e=0;e<=c;e++){\n System.out.print(rc[d][e]);\n if(e!=c){\n System.out.print(\" \");\n }\n }\n System.out.println();\n }\n }\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"class Main{\n public static void main(String[] args){\n Scanner sc=new Scanner(System.in);\n int r=sc.nextInt();\n int c=sc.nextInt();\n int[][] rc=new int[r+1][c+1]; \n for(int i=0;i<r;i++){\n for(int j=0;j<c;j++){\n rc[i][j]=sc.nextInt();\n }\n }\n int sum;\n for(int k=0;k<r;k++){\n sum=0;\n for(int l=0;l<c;l++){\n sum=sum+rc[k][l];\n if(l==c-1){\n rc[k][c]=sum;\n }\n }\n }for(int a=0;a<=c;a++){\n sum=0;\n for(int b=0;b<r;b++){\n sum=sum+rc[b][a];\n if(b==r-1){\n rc[r][a]=sum;\n }\n }\n }\n for(int d=0;d<=r;d++){\n for(int e=0;e<=c;e++){\n System.out.print(rc[d][e]);\n if(e!=c){\n System.out.print(\" \");\n }\n }\n System.out.println();\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[][] rc=new int[r+1][c+1]; \n for(int i=0;i<r;i++){\n for(int j=0;j<c;j++){\n rc[i][j]=sc.nextInt();\n }\n }\n int sum;\n for(int k=0;k<r;k++){\n sum=0;\n for(int l=0;l<c;l++){\n sum=sum+rc[k][l];\n if(l==c-1){\n rc[k][c]=sum;\n }\n }\n }for(int a=0;a<=c;a++){\n sum=0;\n for(int b=0;b<r;b++){\n sum=sum+rc[b][a];\n if(b==r-1){\n rc[r][a]=sum;\n }\n }\n }\n for(int d=0;d<=r;d++){\n for(int e=0;e<=c;e++){\n System.out.print(rc[d][e]);\n if(e!=c){\n System.out.print(\" \");\n }\n }\n System.out.println();\n }\n }",
"main",
"{\n Scanner sc=new Scanner(System.in);\n int r=sc.nextInt();\n int c=sc.nextInt();\n int[][] rc=new int[r+1][c+1]; \n for(int i=0;i<r;i++){\n for(int j=0;j<c;j++){\n rc[i][j]=sc.nextInt();\n }\n }\n int sum;\n for(int k=0;k<r;k++){\n sum=0;\n for(int l=0;l<c;l++){\n sum=sum+rc[k][l];\n if(l==c-1){\n rc[k][c]=sum;\n }\n }\n }for(int a=0;a<=c;a++){\n sum=0;\n for(int b=0;b<r;b++){\n sum=sum+rc[b][a];\n if(b==r-1){\n rc[r][a]=sum;\n }\n }\n }\n for(int d=0;d<=r;d++){\n for(int e=0;e<=c;e++){\n System.out.print(rc[d][e]);\n if(e!=c){\n System.out.print(\" \");\n }\n }\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[][] rc=new int[r+1][c+1];",
"rc",
"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 rc[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 rc[i][j]=sc.nextInt();\n }\n }",
"{\n for(int j=0;j<c;j++){\n rc[i][j]=sc.nextInt();\n }\n }",
"for(int j=0;j<c;j++){\n rc[i][j]=sc.nextInt();\n }",
"int j=0;",
"int j=0;",
"j",
"0",
"j<c",
"j",
"c",
"j++",
"j++",
"j",
"{\n rc[i][j]=sc.nextInt();\n }",
"{\n rc[i][j]=sc.nextInt();\n }",
"rc[i][j]=sc.nextInt()",
"rc[i][j]",
"rc[i]",
"rc",
"i",
"j",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int sum;",
"sum",
"for(int k=0;k<r;k++){\n sum=0;\n for(int l=0;l<c;l++){\n sum=sum+rc[k][l];\n if(l==c-1){\n rc[k][c]=sum;\n }\n }\n }",
"int k=0;",
"int k=0;",
"k",
"0",
"k<r",
"k",
"r",
"k++",
"k++",
"k",
"{\n sum=0;\n for(int l=0;l<c;l++){\n sum=sum+rc[k][l];\n if(l==c-1){\n rc[k][c]=sum;\n }\n }\n }",
"{\n sum=0;\n for(int l=0;l<c;l++){\n sum=sum+rc[k][l];\n if(l==c-1){\n rc[k][c]=sum;\n }\n }\n }",
"sum=0",
"sum",
"0",
"for(int l=0;l<c;l++){\n sum=sum+rc[k][l];\n if(l==c-1){\n rc[k][c]=sum;\n }\n }",
"int l=0;",
"int l=0;",
"l",
"0",
"l<c",
"l",
"c",
"l++",
"l++",
"l",
"{\n sum=sum+rc[k][l];\n if(l==c-1){\n rc[k][c]=sum;\n }\n }",
"{\n sum=sum+rc[k][l];\n if(l==c-1){\n rc[k][c]=sum;\n }\n }",
"sum=sum+rc[k][l]",
"sum",
"sum+rc[k][l]",
"sum",
"rc[k][l]",
"rc[k]",
"rc",
"k",
"l",
"if(l==c-1){\n rc[k][c]=sum;\n }",
"l==c-1",
"l",
"c-1",
"c",
"1",
"{\n rc[k][c]=sum;\n }",
"rc[k][c]=sum",
"rc[k][c]",
"rc[k]",
"rc",
"k",
"c",
"sum",
"for(int a=0;a<=c;a++){\n sum=0;\n for(int b=0;b<r;b++){\n sum=sum+rc[b][a];\n if(b==r-1){\n rc[r][a]=sum;\n }\n }\n }",
"int a=0;",
"int a=0;",
"a",
"0",
"a<=c",
"a",
"c",
"a++",
"a++",
"a",
"{\n sum=0;\n for(int b=0;b<r;b++){\n sum=sum+rc[b][a];\n if(b==r-1){\n rc[r][a]=sum;\n }\n }\n }",
"{\n sum=0;\n for(int b=0;b<r;b++){\n sum=sum+rc[b][a];\n if(b==r-1){\n rc[r][a]=sum;\n }\n }\n }",
"sum=0",
"sum",
"0",
"for(int b=0;b<r;b++){\n sum=sum+rc[b][a];\n if(b==r-1){\n rc[r][a]=sum;\n }\n }",
"int b=0;",
"int b=0;",
"b",
"0",
"b<r",
"b",
"r",
"b++",
"b++",
"b",
"{\n sum=sum+rc[b][a];\n if(b==r-1){\n rc[r][a]=sum;\n }\n }",
"{\n sum=sum+rc[b][a];\n if(b==r-1){\n rc[r][a]=sum;\n }\n }",
"sum=sum+rc[b][a]",
"sum",
"sum+rc[b][a]",
"sum",
"rc[b][a]",
"rc[b]",
"rc",
"b",
"a",
"if(b==r-1){\n rc[r][a]=sum;\n }",
"b==r-1",
"b",
"r-1",
"r",
"1",
"{\n rc[r][a]=sum;\n }",
"rc[r][a]=sum",
"rc[r][a]",
"rc[r]",
"rc",
"r",
"a",
"sum",
"for(int d=0;d<=r;d++){\n for(int e=0;e<=c;e++){\n System.out.print(rc[d][e]);\n if(e!=c){\n System.out.print(\" \");\n }\n }\n System.out.println();\n }",
"int d=0;",
"int d=0;",
"d",
"0",
"d<=r",
"d",
"r",
"d++",
"d++",
"d",
"{\n for(int e=0;e<=c;e++){\n System.out.print(rc[d][e]);\n if(e!=c){\n System.out.print(\" \");\n }\n }\n System.out.println();\n }",
"{\n for(int e=0;e<=c;e++){\n System.out.print(rc[d][e]);\n if(e!=c){\n System.out.print(\" \");\n }\n }\n System.out.println();\n }",
"for(int e=0;e<=c;e++){\n System.out.print(rc[d][e]);\n if(e!=c){\n System.out.print(\" \");\n }\n }",
"int e=0;",
"int e=0;",
"e",
"0",
"e<=c",
"e",
"c",
"e++",
"e++",
"e",
"{\n System.out.print(rc[d][e]);\n if(e!=c){\n System.out.print(\" \");\n }\n }",
"{\n System.out.print(rc[d][e]);\n if(e!=c){\n System.out.print(\" \");\n }\n }",
"System.out.print(rc[d][e])",
"System.out.print",
"System.out",
"System",
"System.out",
"rc[d][e]",
"rc[d]",
"rc",
"d",
"e",
"if(e!=c){\n System.out.print(\" \");\n }",
"e!=c",
"e",
"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"
] | 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[][] rc=new int[r+1][c+1];
for(int i=0;i<r;i++){
for(int j=0;j<c;j++){
rc[i][j]=sc.nextInt();
}
}
int sum;
for(int k=0;k<r;k++){
sum=0;
for(int l=0;l<c;l++){
sum=sum+rc[k][l];
if(l==c-1){
rc[k][c]=sum;
}
}
}for(int a=0;a<=c;a++){
sum=0;
for(int b=0;b<r;b++){
sum=sum+rc[b][a];
if(b==r-1){
rc[r][a]=sum;
}
}
}
for(int d=0;d<=r;d++){
for(int e=0;e<=c;e++){
System.out.print(rc[d][e]);
if(e!=c){
System.out.print(" ");
}
}
System.out.println();
}
}
}
|
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
41,
13,
41,
13,
41,
13,
41,
13,
20,
41,
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,
13,
13,
41,
13,
20,
13,
41,
13,
17,
11,
1,
0,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
41,
13,
4,
18,
4,
18,
13,
17,
11,
1,
0,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
18,
18,
13,
13,
13,
4,
18,
13,
18,
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,
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,
2,
18,
18,
13,
13,
13,
17,
0,
13,
18,
18,
13,
13,
13,
4,
18,
18,
13,
13,
13,
0,
13,
17,
11,
1,
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,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
234,
11
],
[
234,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
14,
17
],
[
17,
18
],
[
14,
19
],
[
19,
20
],
[
14,
21
],
[
21,
22
],
[
14,
23
],
[
23,
24
],
[
23,
25
],
[
14,
26
],
[
26,
27
],
[
26,
28
],
[
28,
29
],
[
29,
30
],
[
30,
31
],
[
31,
32
],
[
28,
33
],
[
14,
34
],
[
34,
35
],
[
34,
36
],
[
36,
37
],
[
37,
38
],
[
36,
39
],
[
39,
40
],
[
39,
41
],
[
14,
42
],
[
42,
43
],
[
42,
44
],
[
44,
45
],
[
45,
46
],
[
44,
47
],
[
47,
48
],
[
47,
49
],
[
14,
50
],
[
50,
51
],
[
50,
52
],
[
14,
55
],
[
55,
56
],
[
55,
57
],
[
14,
59
],
[
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
],
[
77,
78
],
[
78,
79
],
[
79,
80
],
[
80,
81
],
[
77,
82
],
[
74,
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
],
[
102,
105
],
[
105,
106
],
[
105,
107
],
[
14,
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
],
[
135,
136
],
[
135,
137
],
[
134,
138
],
[
138,
139
],
[
139,
140
],
[
139,
141
],
[
138,
142
],
[
14,
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
],
[
158,
159
],
[
158,
160
],
[
156,
161
],
[
161,
162
],
[
161,
163
],
[
156,
164
],
[
164,
165
],
[
165,
166
],
[
156,
167
],
[
168,
168
],
[
168,
169
],
[
169,
170
],
[
170,
171
],
[
171,
172
],
[
171,
173
],
[
169,
174
],
[
174,
175
],
[
175,
176
],
[
176,
177
],
[
176,
178
],
[
175,
179
],
[
174,
180
],
[
168,
181
],
[
181,
182
],
[
181,
183
],
[
183,
184
],
[
184,
185
],
[
184,
186
],
[
183,
187
],
[
155,
188
],
[
188,
189
],
[
189,
190
],
[
190,
191
],
[
190,
192
],
[
188,
193
],
[
155,
194
],
[
194,
195
],
[
194,
196
],
[
14,
197
],
[
197,
198
],
[
198,
199
],
[
199,
200
],
[
199,
201
],
[
197,
202
],
[
202,
203
],
[
202,
204
],
[
197,
205
],
[
205,
206
],
[
206,
207
],
[
197,
208
],
[
209,
209
],
[
209,
210
],
[
210,
211
],
[
211,
212
],
[
212,
213
],
[
212,
214
],
[
210,
215
],
[
215,
216
],
[
216,
217
],
[
216,
218
],
[
215,
219
],
[
209,
220
],
[
220,
221
],
[
220,
222
],
[
222,
223
],
[
222,
224
],
[
14,
225
],
[
225,
226
],
[
226,
227
],
[
227,
228
],
[
227,
229
],
[
225,
230
],
[
12,
231
],
[
231,
232
],
[
0,
233
],
[
233,
234
],
[
233,
235
]
] | [
"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{\n\t\tint i,j,n,m;\n\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in) );\n\n\t\tString[] nm = br.readLine().split(\" \");\n\n\t\tn = Integer.parseInt(nm[0]);//input n\n\t\tm = Integer.parseInt(nm[1]);//input m\n\n\t\tint[][] matrix = new int[n][m];\n\t\tint[] vsum = new int[m];\n\t\tint sum=0;\n\n\t\tfor(i=0; i<n; i++)//get matrix\n\t\t{\n\t\t\tString[] str = br.readLine().split(\" \");\n\n\t\t\tfor(j=0; j<m; j++)\n\t\t\t{\n\t\t\t\tmatrix[i][j] = Integer.parseInt(str[j]);\n\t\t\t}\n\t\t}\n\n\t\tfor(i=0; i<m; i++)//print reverse\n\t\t{\n\t\t\tfor(j=0; j<n; j++)\n\t\t\t{\n//\t\t\t\tSystem.out.print(matrix[j][i] + \" \");\n\t\t\t\tvsum[i] += matrix[j][i];\n\t\t\t}\n\n//\t\t\tSystem.out.println(vsum[i]);\n\t\t}\n\n\t\tfor(i=0; i<n; i++)//printf\n\t\t{\n\t\t\tfor(j=0; j<m; j++)\n\t\t\t{\n\t\t\t\tSystem.out.print(matrix[i][j] + \" \");\n\t\t\t\tsum += matrix[i][j];\n\t\t\t}\n\n\t\t\tSystem.out.println(sum);\n\t\t\tsum = 0;\n\t\t}\n\n\t\tfor(i=0; i<m; i++)\n\t\t{\n\t\t\tSystem.out.print(vsum[i] + \" \");\n\t\t\tsum += vsum[i];\n\t\t}\n\n\t\tSystem.out.println(sum);\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{\n\t\tint i,j,n,m;\n\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in) );\n\n\t\tString[] nm = br.readLine().split(\" \");\n\n\t\tn = Integer.parseInt(nm[0]);//input n\n\t\tm = Integer.parseInt(nm[1]);//input m\n\n\t\tint[][] matrix = new int[n][m];\n\t\tint[] vsum = new int[m];\n\t\tint sum=0;\n\n\t\tfor(i=0; i<n; i++)//get matrix\n\t\t{\n\t\t\tString[] str = br.readLine().split(\" \");\n\n\t\t\tfor(j=0; j<m; j++)\n\t\t\t{\n\t\t\t\tmatrix[i][j] = Integer.parseInt(str[j]);\n\t\t\t}\n\t\t}\n\n\t\tfor(i=0; i<m; i++)//print reverse\n\t\t{\n\t\t\tfor(j=0; j<n; j++)\n\t\t\t{\n//\t\t\t\tSystem.out.print(matrix[j][i] + \" \");\n\t\t\t\tvsum[i] += matrix[j][i];\n\t\t\t}\n\n//\t\t\tSystem.out.println(vsum[i]);\n\t\t}\n\n\t\tfor(i=0; i<n; i++)//printf\n\t\t{\n\t\t\tfor(j=0; j<m; j++)\n\t\t\t{\n\t\t\t\tSystem.out.print(matrix[i][j] + \" \");\n\t\t\t\tsum += matrix[i][j];\n\t\t\t}\n\n\t\t\tSystem.out.println(sum);\n\t\t\tsum = 0;\n\t\t}\n\n\t\tfor(i=0; i<m; i++)\n\t\t{\n\t\t\tSystem.out.print(vsum[i] + \" \");\n\t\t\tsum += vsum[i];\n\t\t}\n\n\t\tSystem.out.println(sum);\n\t}\n\n}",
"Main",
"public static void main(String[] args) throws IOException\n\t{\n\t\tint i,j,n,m;\n\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in) );\n\n\t\tString[] nm = br.readLine().split(\" \");\n\n\t\tn = Integer.parseInt(nm[0]);//input n\n\t\tm = Integer.parseInt(nm[1]);//input m\n\n\t\tint[][] matrix = new int[n][m];\n\t\tint[] vsum = new int[m];\n\t\tint sum=0;\n\n\t\tfor(i=0; i<n; i++)//get matrix\n\t\t{\n\t\t\tString[] str = br.readLine().split(\" \");\n\n\t\t\tfor(j=0; j<m; j++)\n\t\t\t{\n\t\t\t\tmatrix[i][j] = Integer.parseInt(str[j]);\n\t\t\t}\n\t\t}\n\n\t\tfor(i=0; i<m; i++)//print reverse\n\t\t{\n\t\t\tfor(j=0; j<n; j++)\n\t\t\t{\n//\t\t\t\tSystem.out.print(matrix[j][i] + \" \");\n\t\t\t\tvsum[i] += matrix[j][i];\n\t\t\t}\n\n//\t\t\tSystem.out.println(vsum[i]);\n\t\t}\n\n\t\tfor(i=0; i<n; i++)//printf\n\t\t{\n\t\t\tfor(j=0; j<m; j++)\n\t\t\t{\n\t\t\t\tSystem.out.print(matrix[i][j] + \" \");\n\t\t\t\tsum += matrix[i][j];\n\t\t\t}\n\n\t\t\tSystem.out.println(sum);\n\t\t\tsum = 0;\n\t\t}\n\n\t\tfor(i=0; i<m; i++)\n\t\t{\n\t\t\tSystem.out.print(vsum[i] + \" \");\n\t\t\tsum += vsum[i];\n\t\t}\n\n\t\tSystem.out.println(sum);\n\t}",
"main",
"{\n\t\tint i,j,n,m;\n\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in) );\n\n\t\tString[] nm = br.readLine().split(\" \");\n\n\t\tn = Integer.parseInt(nm[0]);//input n\n\t\tm = Integer.parseInt(nm[1]);//input m\n\n\t\tint[][] matrix = new int[n][m];\n\t\tint[] vsum = new int[m];\n\t\tint sum=0;\n\n\t\tfor(i=0; i<n; i++)//get matrix\n\t\t{\n\t\t\tString[] str = br.readLine().split(\" \");\n\n\t\t\tfor(j=0; j<m; j++)\n\t\t\t{\n\t\t\t\tmatrix[i][j] = Integer.parseInt(str[j]);\n\t\t\t}\n\t\t}\n\n\t\tfor(i=0; i<m; i++)//print reverse\n\t\t{\n\t\t\tfor(j=0; j<n; j++)\n\t\t\t{\n//\t\t\t\tSystem.out.print(matrix[j][i] + \" \");\n\t\t\t\tvsum[i] += matrix[j][i];\n\t\t\t}\n\n//\t\t\tSystem.out.println(vsum[i]);\n\t\t}\n\n\t\tfor(i=0; i<n; i++)//printf\n\t\t{\n\t\t\tfor(j=0; j<m; j++)\n\t\t\t{\n\t\t\t\tSystem.out.print(matrix[i][j] + \" \");\n\t\t\t\tsum += matrix[i][j];\n\t\t\t}\n\n\t\t\tSystem.out.println(sum);\n\t\t\tsum = 0;\n\t\t}\n\n\t\tfor(i=0; i<m; i++)\n\t\t{\n\t\t\tSystem.out.print(vsum[i] + \" \");\n\t\t\tsum += vsum[i];\n\t\t}\n\n\t\tSystem.out.println(sum);\n\t}",
"int i",
"i",
"j",
"j",
"n",
"n",
"m;",
"m",
"BufferedReader br = new BufferedReader(new InputStreamReader(System.in) );",
"br",
"new BufferedReader(new InputStreamReader(System.in) )",
"String[] nm = br.readLine().split(\" \");",
"nm",
"br.readLine().split(\" \")",
"br.readLine().split",
"br.readLine()",
"br.readLine",
"br",
"\" \"",
"n = Integer.parseInt(nm[0])",
"n",
"Integer.parseInt(nm[0])",
"Integer.parseInt",
"Integer",
"nm[0]",
"nm",
"0",
"m = Integer.parseInt(nm[1])",
"m",
"Integer.parseInt(nm[1])",
"Integer.parseInt",
"Integer",
"nm[1]",
"nm",
"1",
"int[][] matrix = new int[n][m];",
"matrix",
"new int[n][m]",
"n",
"m",
"int[] vsum = new int[m];",
"vsum",
"new int[m]",
"m",
"int sum=0;",
"sum",
"0",
"for(i=0; i<n; i++)//get matrix\n\t\t{\n\t\t\tString[] str = br.readLine().split(\" \");\n\n\t\t\tfor(j=0; j<m; j++)\n\t\t\t{\n\t\t\t\tmatrix[i][j] = Integer.parseInt(str[j]);\n\t\t\t}\n\t\t}",
"i=0;",
"i=0",
"i",
"0",
"i<n",
"i",
"n",
"i++",
"i++",
"i",
"{\n\t\t\tString[] str = br.readLine().split(\" \");\n\n\t\t\tfor(j=0; j<m; j++)\n\t\t\t{\n\t\t\t\tmatrix[i][j] = Integer.parseInt(str[j]);\n\t\t\t}\n\t\t}",
"{\n\t\t\tString[] str = br.readLine().split(\" \");\n\n\t\t\tfor(j=0; j<m; j++)\n\t\t\t{\n\t\t\t\tmatrix[i][j] = Integer.parseInt(str[j]);\n\t\t\t}\n\t\t}",
"String[] str = br.readLine().split(\" \");",
"str",
"br.readLine().split(\" \")",
"br.readLine().split",
"br.readLine()",
"br.readLine",
"br",
"\" \"",
"for(j=0; j<m; j++)\n\t\t\t{\n\t\t\t\tmatrix[i][j] = Integer.parseInt(str[j]);\n\t\t\t}",
"j=0;",
"j=0",
"j",
"0",
"j<m",
"j",
"m",
"j++",
"j++",
"j",
"{\n\t\t\t\tmatrix[i][j] = Integer.parseInt(str[j]);\n\t\t\t}",
"{\n\t\t\t\tmatrix[i][j] = Integer.parseInt(str[j]);\n\t\t\t}",
"matrix[i][j] = Integer.parseInt(str[j])",
"matrix[i][j]",
"matrix[i]",
"matrix",
"i",
"j",
"Integer.parseInt(str[j])",
"Integer.parseInt",
"Integer",
"str[j]",
"str",
"j",
"for(i=0; i<m; i++)//print reverse\n\t\t{\n\t\t\tfor(j=0; j<n; j++)\n\t\t\t{\n//\t\t\t\tSystem.out.print(matrix[j][i] + \" \");\n\t\t\t\tvsum[i] += matrix[j][i];\n\t\t\t}\n\n//\t\t\tSystem.out.println(vsum[i]);\n\t\t}",
"i=0;",
"i=0",
"i",
"0",
"i<m",
"i",
"m",
"i++",
"i++",
"i",
"{\n\t\t\tfor(j=0; j<n; j++)\n\t\t\t{\n//\t\t\t\tSystem.out.print(matrix[j][i] + \" \");\n\t\t\t\tvsum[i] += matrix[j][i];\n\t\t\t}\n\n//\t\t\tSystem.out.println(vsum[i]);\n\t\t}",
"{\n\t\t\tfor(j=0; j<n; j++)\n\t\t\t{\n//\t\t\t\tSystem.out.print(matrix[j][i] + \" \");\n\t\t\t\tvsum[i] += matrix[j][i];\n\t\t\t}\n\n//\t\t\tSystem.out.println(vsum[i]);\n\t\t}",
"for(j=0; j<n; j++)\n\t\t\t{\n//\t\t\t\tSystem.out.print(matrix[j][i] + \" \");\n\t\t\t\tvsum[i] += matrix[j][i];\n\t\t\t}",
"j=0;",
"j=0",
"j",
"0",
"j<n",
"j",
"n",
"j++",
"j++",
"j",
"{\n//\t\t\t\tSystem.out.print(matrix[j][i] + \" \");\n\t\t\t\tvsum[i] += matrix[j][i];\n\t\t\t}",
"{\n//\t\t\t\tSystem.out.print(matrix[j][i] + \" \");\n\t\t\t\tvsum[i] += matrix[j][i];\n\t\t\t}",
"vsum[i] += matrix[j][i]",
"vsum[i]",
"vsum",
"i",
"matrix[j][i]",
"matrix[j]",
"matrix",
"j",
"i",
"for(i=0; i<n; i++)//printf\n\t\t{\n\t\t\tfor(j=0; j<m; j++)\n\t\t\t{\n\t\t\t\tSystem.out.print(matrix[i][j] + \" \");\n\t\t\t\tsum += matrix[i][j];\n\t\t\t}\n\n\t\t\tSystem.out.println(sum);\n\t\t\tsum = 0;\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{\n\t\t\t\tSystem.out.print(matrix[i][j] + \" \");\n\t\t\t\tsum += matrix[i][j];\n\t\t\t}\n\n\t\t\tSystem.out.println(sum);\n\t\t\tsum = 0;\n\t\t}",
"{\n\t\t\tfor(j=0; j<m; j++)\n\t\t\t{\n\t\t\t\tSystem.out.print(matrix[i][j] + \" \");\n\t\t\t\tsum += matrix[i][j];\n\t\t\t}\n\n\t\t\tSystem.out.println(sum);\n\t\t\tsum = 0;\n\t\t}",
"for(j=0; j<m; j++)\n\t\t\t{\n\t\t\t\tSystem.out.print(matrix[i][j] + \" \");\n\t\t\t\tsum += matrix[i][j];\n\t\t\t}",
"j=0;",
"j=0",
"j",
"0",
"j<m",
"j",
"m",
"j++",
"j++",
"j",
"{\n\t\t\t\tSystem.out.print(matrix[i][j] + \" \");\n\t\t\t\tsum += matrix[i][j];\n\t\t\t}",
"{\n\t\t\t\tSystem.out.print(matrix[i][j] + \" \");\n\t\t\t\tsum += matrix[i][j];\n\t\t\t}",
"System.out.print(matrix[i][j] + \" \")",
"System.out.print",
"System.out",
"System",
"System.out",
"matrix[i][j] + \" \"",
"matrix[i][j]",
"matrix[i]",
"matrix",
"i",
"j",
"\" \"",
"sum += matrix[i][j]",
"sum",
"matrix[i][j]",
"matrix[i]",
"matrix",
"i",
"j",
"System.out.println(sum)",
"System.out.println",
"System.out",
"System",
"System.out",
"sum",
"sum = 0",
"sum",
"0",
"for(i=0; i<m; i++)\n\t\t{\n\t\t\tSystem.out.print(vsum[i] + \" \");\n\t\t\tsum += vsum[i];\n\t\t}",
"i=0;",
"i=0",
"i",
"0",
"i<m",
"i",
"m",
"i++",
"i++",
"i",
"{\n\t\t\tSystem.out.print(vsum[i] + \" \");\n\t\t\tsum += vsum[i];\n\t\t}",
"{\n\t\t\tSystem.out.print(vsum[i] + \" \");\n\t\t\tsum += vsum[i];\n\t\t}",
"System.out.print(vsum[i] + \" \")",
"System.out.print",
"System.out",
"System",
"System.out",
"vsum[i] + \" \"",
"vsum[i]",
"vsum",
"i",
"\" \"",
"sum += vsum[i]",
"sum",
"vsum[i]",
"vsum",
"i",
"System.out.println(sum)",
"System.out.println",
"System.out",
"System",
"System.out",
"sum",
"String[] args",
"args",
"public class Main{\n\n\tpublic static void main(String[] args) throws IOException\n\t{\n\t\tint i,j,n,m;\n\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in) );\n\n\t\tString[] nm = br.readLine().split(\" \");\n\n\t\tn = Integer.parseInt(nm[0]);//input n\n\t\tm = Integer.parseInt(nm[1]);//input m\n\n\t\tint[][] matrix = new int[n][m];\n\t\tint[] vsum = new int[m];\n\t\tint sum=0;\n\n\t\tfor(i=0; i<n; i++)//get matrix\n\t\t{\n\t\t\tString[] str = br.readLine().split(\" \");\n\n\t\t\tfor(j=0; j<m; j++)\n\t\t\t{\n\t\t\t\tmatrix[i][j] = Integer.parseInt(str[j]);\n\t\t\t}\n\t\t}\n\n\t\tfor(i=0; i<m; i++)//print reverse\n\t\t{\n\t\t\tfor(j=0; j<n; j++)\n\t\t\t{\n//\t\t\t\tSystem.out.print(matrix[j][i] + \" \");\n\t\t\t\tvsum[i] += matrix[j][i];\n\t\t\t}\n\n//\t\t\tSystem.out.println(vsum[i]);\n\t\t}\n\n\t\tfor(i=0; i<n; i++)//printf\n\t\t{\n\t\t\tfor(j=0; j<m; j++)\n\t\t\t{\n\t\t\t\tSystem.out.print(matrix[i][j] + \" \");\n\t\t\t\tsum += matrix[i][j];\n\t\t\t}\n\n\t\t\tSystem.out.println(sum);\n\t\t\tsum = 0;\n\t\t}\n\n\t\tfor(i=0; i<m; i++)\n\t\t{\n\t\t\tSystem.out.print(vsum[i] + \" \");\n\t\t\tsum += vsum[i];\n\t\t}\n\n\t\tSystem.out.println(sum);\n\t}\n\n}",
"public class Main{\n\n\tpublic static void main(String[] args) throws IOException\n\t{\n\t\tint i,j,n,m;\n\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in) );\n\n\t\tString[] nm = br.readLine().split(\" \");\n\n\t\tn = Integer.parseInt(nm[0]);//input n\n\t\tm = Integer.parseInt(nm[1]);//input m\n\n\t\tint[][] matrix = new int[n][m];\n\t\tint[] vsum = new int[m];\n\t\tint sum=0;\n\n\t\tfor(i=0; i<n; i++)//get matrix\n\t\t{\n\t\t\tString[] str = br.readLine().split(\" \");\n\n\t\t\tfor(j=0; j<m; j++)\n\t\t\t{\n\t\t\t\tmatrix[i][j] = Integer.parseInt(str[j]);\n\t\t\t}\n\t\t}\n\n\t\tfor(i=0; i<m; i++)//print reverse\n\t\t{\n\t\t\tfor(j=0; j<n; j++)\n\t\t\t{\n//\t\t\t\tSystem.out.print(matrix[j][i] + \" \");\n\t\t\t\tvsum[i] += matrix[j][i];\n\t\t\t}\n\n//\t\t\tSystem.out.println(vsum[i]);\n\t\t}\n\n\t\tfor(i=0; i<n; i++)//printf\n\t\t{\n\t\t\tfor(j=0; j<m; j++)\n\t\t\t{\n\t\t\t\tSystem.out.print(matrix[i][j] + \" \");\n\t\t\t\tsum += matrix[i][j];\n\t\t\t}\n\n\t\t\tSystem.out.println(sum);\n\t\t\tsum = 0;\n\t\t}\n\n\t\tfor(i=0; i<m; i++)\n\t\t{\n\t\t\tSystem.out.print(vsum[i] + \" \");\n\t\t\tsum += vsum[i];\n\t\t}\n\n\t\tSystem.out.println(sum);\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
{
int i,j,n,m;
BufferedReader br = new BufferedReader(new InputStreamReader(System.in) );
String[] nm = br.readLine().split(" ");
n = Integer.parseInt(nm[0]);//input n
m = Integer.parseInt(nm[1]);//input m
int[][] matrix = new int[n][m];
int[] vsum = new int[m];
int sum=0;
for(i=0; i<n; i++)//get matrix
{
String[] str = br.readLine().split(" ");
for(j=0; j<m; j++)
{
matrix[i][j] = Integer.parseInt(str[j]);
}
}
for(i=0; i<m; i++)//print reverse
{
for(j=0; j<n; j++)
{
// System.out.print(matrix[j][i] + " ");
vsum[i] += matrix[j][i];
}
// System.out.println(vsum[i]);
}
for(i=0; i<n; i++)//printf
{
for(j=0; j<m; j++)
{
System.out.print(matrix[i][j] + " ");
sum += matrix[i][j];
}
System.out.println(sum);
sum = 0;
}
for(i=0; i<m; i++)
{
System.out.print(vsum[i] + " ");
sum += vsum[i];
}
System.out.println(sum);
}
} |
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
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,
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,
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
],
[
10,
11
],
[
10,
12
],
[
0,
13
],
[
216,
14
],
[
216,
15
],
[
15,
16
],
[
15,
17
],
[
17,
18
],
[
18,
19
],
[
18,
20
],
[
17,
21
],
[
21,
22
],
[
21,
23
],
[
23,
24
],
[
24,
25
],
[
17,
26
],
[
26,
27
],
[
26,
28
],
[
28,
29
],
[
29,
30
],
[
17,
31
],
[
31,
32
],
[
31,
33
],
[
34,
35
],
[
34,
36
],
[
37,
38
],
[
37,
39
],
[
17,
40
],
[
40,
41
],
[
41,
42
],
[
42,
43
],
[
42,
44
],
[
40,
45
],
[
45,
46
],
[
45,
47
],
[
40,
48
],
[
48,
49
],
[
49,
50
],
[
40,
51
],
[
52,
52
],
[
52,
53
],
[
53,
54
],
[
54,
55
],
[
55,
56
],
[
55,
57
],
[
53,
58
],
[
58,
59
],
[
58,
60
],
[
53,
61
],
[
61,
62
],
[
62,
63
],
[
53,
64
],
[
65,
65
],
[
65,
66
],
[
66,
67
],
[
67,
68
],
[
68,
69
],
[
68,
70
],
[
67,
71
],
[
66,
72
],
[
72,
73
],
[
73,
74
],
[
17,
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
],
[
88,
90
],
[
87,
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
],
[
104,
106
],
[
106,
107
],
[
107,
108
],
[
107,
109
],
[
106,
110
],
[
87,
111
],
[
111,
112
],
[
112,
113
],
[
113,
114
],
[
113,
115
],
[
112,
116
],
[
111,
117
],
[
17,
118
],
[
118,
119
],
[
119,
120
],
[
120,
121
],
[
120,
122
],
[
118,
123
],
[
123,
124
],
[
123,
125
],
[
118,
126
],
[
126,
127
],
[
127,
128
],
[
118,
129
],
[
130,
130
],
[
130,
131
],
[
131,
132
],
[
131,
133
],
[
130,
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
],
[
147,
149
],
[
149,
150
],
[
150,
151
],
[
150,
152
],
[
149,
153
],
[
130,
154
],
[
154,
155
],
[
155,
156
],
[
156,
157
],
[
156,
158
],
[
155,
159
],
[
154,
160
],
[
17,
161
],
[
161,
162
],
[
162,
163
],
[
163,
164
],
[
163,
165
],
[
161,
166
],
[
166,
167
],
[
166,
168
],
[
161,
169
],
[
169,
170
],
[
170,
171
],
[
161,
172
],
[
173,
173
],
[
173,
174
],
[
174,
175
],
[
175,
176
],
[
176,
177
],
[
176,
178
],
[
174,
179
],
[
179,
180
],
[
179,
181
],
[
174,
182
],
[
182,
183
],
[
183,
184
],
[
174,
185
],
[
186,
186
],
[
186,
187
],
[
187,
188
],
[
188,
189
],
[
188,
190
],
[
187,
191
],
[
191,
192
],
[
192,
193
],
[
193,
194
],
[
194,
195
],
[
194,
196
],
[
192,
197
],
[
186,
198
],
[
198,
199
],
[
199,
200
],
[
200,
201
],
[
200,
202
],
[
198,
203
],
[
203,
204
],
[
204,
205
],
[
204,
206
],
[
203,
207
],
[
173,
208
],
[
208,
209
],
[
209,
210
],
[
210,
211
],
[
210,
212
],
[
15,
213
],
[
213,
214
],
[
0,
215
],
[
215,
216
],
[
215,
217
]
] | [
"import java.util.Arrays;\nimport java.util.HashMap;\nimport java.util.Map;\nimport java.util.Scanner;\n\npublic class Main {\n\t\n\tpublic static void main(String args[]) {\n\t\tScanner sc = new Scanner(System.in);\n\n\t\tfinal int r = sc.nextInt();\n\t\tfinal int c = sc.nextInt();\n\t\t\n\t\tint[][] matrix = 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\tmatrix[i][j] = sc.nextInt();\n\t\t\t}\n\t\t}\n\t\t\n\t\tfor(int i = 0; i < r; i++){\n\t\t\t\n\t\t\tint r_sum = 0;\n\t\t\tfor(int j = 0; j < c; j++){\n\t\t\t\tr_sum += matrix[i][j];\n\t\t\t}\n\t\t\t\n\t\t\tmatrix[i][c] = r_sum;\n\t\t}\n\t\t\n\t\tfor(int j = 0; j <= c; j++){\n\t\t\t\n\t\t\tint c_sum = 0;\n\t\t\tfor(int i = 0; i < r; i++){\n\t\t\t\tc_sum += matrix[i][j];\n\t\t\t}\n\t\t\t\n\t\t\tmatrix[r][j] = c_sum;\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(matrix[i][j]);\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}\n\t}\n\n}",
"import java.util.Arrays;",
"Arrays",
"java.util",
"import java.util.HashMap;",
"HashMap",
"java.util",
"import java.util.Map;",
"Map",
"java.util",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n\t\n\tpublic static void main(String args[]) {\n\t\tScanner sc = new Scanner(System.in);\n\n\t\tfinal int r = sc.nextInt();\n\t\tfinal int c = sc.nextInt();\n\t\t\n\t\tint[][] matrix = 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\tmatrix[i][j] = sc.nextInt();\n\t\t\t}\n\t\t}\n\t\t\n\t\tfor(int i = 0; i < r; i++){\n\t\t\t\n\t\t\tint r_sum = 0;\n\t\t\tfor(int j = 0; j < c; j++){\n\t\t\t\tr_sum += matrix[i][j];\n\t\t\t}\n\t\t\t\n\t\t\tmatrix[i][c] = r_sum;\n\t\t}\n\t\t\n\t\tfor(int j = 0; j <= c; j++){\n\t\t\t\n\t\t\tint c_sum = 0;\n\t\t\tfor(int i = 0; i < r; i++){\n\t\t\t\tc_sum += matrix[i][j];\n\t\t\t}\n\t\t\t\n\t\t\tmatrix[r][j] = c_sum;\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(matrix[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[]) {\n\t\tScanner sc = new Scanner(System.in);\n\n\t\tfinal int r = sc.nextInt();\n\t\tfinal int c = sc.nextInt();\n\t\t\n\t\tint[][] matrix = 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\tmatrix[i][j] = sc.nextInt();\n\t\t\t}\n\t\t}\n\t\t\n\t\tfor(int i = 0; i < r; i++){\n\t\t\t\n\t\t\tint r_sum = 0;\n\t\t\tfor(int j = 0; j < c; j++){\n\t\t\t\tr_sum += matrix[i][j];\n\t\t\t}\n\t\t\t\n\t\t\tmatrix[i][c] = r_sum;\n\t\t}\n\t\t\n\t\tfor(int j = 0; j <= c; j++){\n\t\t\t\n\t\t\tint c_sum = 0;\n\t\t\tfor(int i = 0; i < r; i++){\n\t\t\t\tc_sum += matrix[i][j];\n\t\t\t}\n\t\t\t\n\t\t\tmatrix[r][j] = c_sum;\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(matrix[i][j]);\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\n\t\tfinal int r = sc.nextInt();\n\t\tfinal int c = sc.nextInt();\n\t\t\n\t\tint[][] matrix = 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\tmatrix[i][j] = sc.nextInt();\n\t\t\t}\n\t\t}\n\t\t\n\t\tfor(int i = 0; i < r; i++){\n\t\t\t\n\t\t\tint r_sum = 0;\n\t\t\tfor(int j = 0; j < c; j++){\n\t\t\t\tr_sum += matrix[i][j];\n\t\t\t}\n\t\t\t\n\t\t\tmatrix[i][c] = r_sum;\n\t\t}\n\t\t\n\t\tfor(int j = 0; j <= c; j++){\n\t\t\t\n\t\t\tint c_sum = 0;\n\t\t\tfor(int i = 0; i < r; i++){\n\t\t\t\tc_sum += matrix[i][j];\n\t\t\t}\n\t\t\t\n\t\t\tmatrix[r][j] = c_sum;\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(matrix[i][j]);\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)",
"final int r = sc.nextInt();",
"r",
"sc.nextInt()",
"sc.nextInt",
"sc",
"final int c = sc.nextInt();",
"c",
"sc.nextInt()",
"sc.nextInt",
"sc",
"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\t\tfor(int j = 0; j < c; 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 < r",
"i",
"r",
"i++",
"i++",
"i",
"{\n\t\t\tfor(int j = 0; j < c; 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 < c; j++){\n\t\t\t\tmatrix[i][j] = sc.nextInt();\n\t\t\t}\n\t\t}",
"for(int j = 0; j < c; j++){\n\t\t\t\tmatrix[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\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 < r; i++){\n\t\t\t\n\t\t\tint r_sum = 0;\n\t\t\tfor(int j = 0; j < c; j++){\n\t\t\t\tr_sum += matrix[i][j];\n\t\t\t}\n\t\t\t\n\t\t\tmatrix[i][c] = r_sum;\n\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < r",
"i",
"r",
"i++",
"i++",
"i",
"{\n\t\t\t\n\t\t\tint r_sum = 0;\n\t\t\tfor(int j = 0; j < c; j++){\n\t\t\t\tr_sum += matrix[i][j];\n\t\t\t}\n\t\t\t\n\t\t\tmatrix[i][c] = r_sum;\n\t\t}",
"{\n\t\t\t\n\t\t\tint r_sum = 0;\n\t\t\tfor(int j = 0; j < c; j++){\n\t\t\t\tr_sum += matrix[i][j];\n\t\t\t}\n\t\t\t\n\t\t\tmatrix[i][c] = r_sum;\n\t\t}",
"int r_sum = 0;",
"r_sum",
"0",
"for(int j = 0; j < c; j++){\n\t\t\t\tr_sum += matrix[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\tr_sum += matrix[i][j];\n\t\t\t}",
"{\n\t\t\t\tr_sum += matrix[i][j];\n\t\t\t}",
"r_sum += matrix[i][j]",
"r_sum",
"matrix[i][j]",
"matrix[i]",
"matrix",
"i",
"j",
"matrix[i][c] = r_sum",
"matrix[i][c]",
"matrix[i]",
"matrix",
"i",
"c",
"r_sum",
"for(int j = 0; j <= c; j++){\n\t\t\t\n\t\t\tint c_sum = 0;\n\t\t\tfor(int i = 0; i < r; i++){\n\t\t\t\tc_sum += matrix[i][j];\n\t\t\t}\n\t\t\t\n\t\t\tmatrix[r][j] = c_sum;\n\t\t}",
"int j = 0;",
"int j = 0;",
"j",
"0",
"j <= c",
"j",
"c",
"j++",
"j++",
"j",
"{\n\t\t\t\n\t\t\tint c_sum = 0;\n\t\t\tfor(int i = 0; i < r; i++){\n\t\t\t\tc_sum += matrix[i][j];\n\t\t\t}\n\t\t\t\n\t\t\tmatrix[r][j] = c_sum;\n\t\t}",
"{\n\t\t\t\n\t\t\tint c_sum = 0;\n\t\t\tfor(int i = 0; i < r; i++){\n\t\t\t\tc_sum += matrix[i][j];\n\t\t\t}\n\t\t\t\n\t\t\tmatrix[r][j] = c_sum;\n\t\t}",
"int c_sum = 0;",
"c_sum",
"0",
"for(int i = 0; i < r; i++){\n\t\t\t\tc_sum += matrix[i][j];\n\t\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < r",
"i",
"r",
"i++",
"i++",
"i",
"{\n\t\t\t\tc_sum += matrix[i][j];\n\t\t\t}",
"{\n\t\t\t\tc_sum += matrix[i][j];\n\t\t\t}",
"c_sum += matrix[i][j]",
"c_sum",
"matrix[i][j]",
"matrix[i]",
"matrix",
"i",
"j",
"matrix[r][j] = c_sum",
"matrix[r][j]",
"matrix[r]",
"matrix",
"r",
"j",
"c_sum",
"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(matrix[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(matrix[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(matrix[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(matrix[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(matrix[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(matrix[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(matrix[i][j])",
"System.out.print",
"System.out",
"System",
"System.out",
"matrix[i][j]",
"matrix[i]",
"matrix",
"i",
"j",
"System.out.println()",
"System.out.println",
"System.out",
"System",
"System.out",
"String args[]",
"args",
"public class Main {\n\t\n\tpublic static void main(String args[]) {\n\t\tScanner sc = new Scanner(System.in);\n\n\t\tfinal int r = sc.nextInt();\n\t\tfinal int c = sc.nextInt();\n\t\t\n\t\tint[][] matrix = 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\tmatrix[i][j] = sc.nextInt();\n\t\t\t}\n\t\t}\n\t\t\n\t\tfor(int i = 0; i < r; i++){\n\t\t\t\n\t\t\tint r_sum = 0;\n\t\t\tfor(int j = 0; j < c; j++){\n\t\t\t\tr_sum += matrix[i][j];\n\t\t\t}\n\t\t\t\n\t\t\tmatrix[i][c] = r_sum;\n\t\t}\n\t\t\n\t\tfor(int j = 0; j <= c; j++){\n\t\t\t\n\t\t\tint c_sum = 0;\n\t\t\tfor(int i = 0; i < r; i++){\n\t\t\t\tc_sum += matrix[i][j];\n\t\t\t}\n\t\t\t\n\t\t\tmatrix[r][j] = c_sum;\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(matrix[i][j]);\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}\n\t}\n\n}",
"public class Main {\n\t\n\tpublic static void main(String args[]) {\n\t\tScanner sc = new Scanner(System.in);\n\n\t\tfinal int r = sc.nextInt();\n\t\tfinal int c = sc.nextInt();\n\t\t\n\t\tint[][] matrix = 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\tmatrix[i][j] = sc.nextInt();\n\t\t\t}\n\t\t}\n\t\t\n\t\tfor(int i = 0; i < r; i++){\n\t\t\t\n\t\t\tint r_sum = 0;\n\t\t\tfor(int j = 0; j < c; j++){\n\t\t\t\tr_sum += matrix[i][j];\n\t\t\t}\n\t\t\t\n\t\t\tmatrix[i][c] = r_sum;\n\t\t}\n\t\t\n\t\tfor(int j = 0; j <= c; j++){\n\t\t\t\n\t\t\tint c_sum = 0;\n\t\t\tfor(int i = 0; i < r; i++){\n\t\t\t\tc_sum += matrix[i][j];\n\t\t\t}\n\t\t\t\n\t\t\tmatrix[r][j] = c_sum;\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(matrix[i][j]);\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}\n\t}\n\n}",
"Main"
] | import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
import java.util.Scanner;
public class Main {
public static void main(String args[]) {
Scanner sc = new Scanner(System.in);
final int r = sc.nextInt();
final int c = sc.nextInt();
int[][] matrix = new int[r + 1][c + 1];
for(int i = 0; i < r; i++){
for(int j = 0; j < c; j++){
matrix[i][j] = sc.nextInt();
}
}
for(int i = 0; i < r; i++){
int r_sum = 0;
for(int j = 0; j < c; j++){
r_sum += matrix[i][j];
}
matrix[i][c] = r_sum;
}
for(int j = 0; j <= c; j++){
int c_sum = 0;
for(int i = 0; i < r; i++){
c_sum += matrix[i][j];
}
matrix[r][j] = c_sum;
}
for(int i = 0; i <= r; i++){
for(int j = 0; j <= c; j++){
if(j != 0){
System.out.print(" ");
}
System.out.print(matrix[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,
38,
5,
13,
30,
4,
18,
13,
30,
41,
13,
4,
18,
4,
18,
13,
17,
41,
13,
4,
18,
13,
18,
13,
17,
41,
13,
4,
18,
13,
18,
13,
17,
41,
13,
20,
2,
13,
17,
2,
13,
17,
41,
13,
41,
13,
41,
13,
41,
13,
11,
1,
0,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
17,
41,
13,
4,
18,
4,
18,
13,
17,
11,
1,
0,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
4,
18,
13,
18,
13,
13,
0,
18,
18,
13,
13,
13,
4,
18,
13,
18,
13,
13,
0,
13,
2,
13,
13,
0,
18,
18,
13,
13,
13,
13,
11,
1,
0,
13,
17,
2,
13,
2,
13,
17,
1,
40,
13,
30,
30,
0,
13,
17,
11,
1,
0,
13,
17,
2,
13,
2,
13,
17,
1,
40,
13,
30,
30,
0,
13,
2,
13,
18,
18,
13,
13,
13,
0,
18,
18,
13,
13,
13,
13,
41,
13,
11,
1,
0,
13,
17,
2,
13,
2,
13,
17,
1,
40,
13,
30,
30,
0,
13,
17,
11,
1,
0,
13,
17,
2,
13,
2,
13,
17,
1,
40,
13,
30,
30,
0,
13,
2,
2,
13,
18,
18,
13,
13,
13,
17,
4,
18,
18,
13,
13,
4,
18,
13,
17,
2,
4,
18,
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
],
[
18,
20
],
[
14,
21
],
[
21,
22
],
[
22,
23
],
[
22,
24
],
[
24,
25
],
[
25,
26
],
[
26,
27
],
[
21,
28
],
[
28,
29
],
[
29,
30
],
[
29,
31
],
[
31,
32
],
[
32,
33
],
[
33,
34
],
[
34,
35
],
[
31,
36
],
[
28,
37
],
[
37,
38
],
[
37,
39
],
[
39,
40
],
[
40,
41
],
[
39,
42
],
[
42,
43
],
[
42,
44
],
[
28,
45
],
[
45,
46
],
[
45,
47
],
[
47,
48
],
[
48,
49
],
[
47,
50
],
[
50,
51
],
[
50,
52
],
[
28,
53
],
[
53,
54
],
[
53,
55
],
[
56,
57
],
[
56,
58
],
[
59,
60
],
[
59,
61
],
[
28,
62
],
[
62,
63
],
[
28,
64
],
[
64,
65
],
[
28,
66
],
[
66,
67
],
[
28,
68
],
[
68,
69
],
[
28,
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
],
[
82,
86
],
[
86,
87
],
[
86,
88
],
[
88,
89
],
[
89,
90
],
[
90,
91
],
[
91,
92
],
[
88,
93
],
[
82,
94
],
[
94,
95
],
[
95,
96
],
[
96,
97
],
[
96,
98
],
[
94,
99
],
[
99,
100
],
[
99,
101
],
[
94,
102
],
[
102,
103
],
[
103,
104
],
[
94,
105
],
[
106,
106
],
[
106,
107
],
[
107,
108
],
[
107,
109
],
[
109,
110
],
[
110,
111
],
[
109,
112
],
[
112,
113
],
[
112,
114
],
[
106,
115
],
[
115,
116
],
[
116,
117
],
[
117,
118
],
[
117,
119
],
[
116,
120
],
[
115,
121
],
[
121,
122
],
[
122,
123
],
[
121,
124
],
[
124,
125
],
[
124,
126
],
[
106,
127
],
[
127,
128
],
[
127,
129
],
[
129,
130
],
[
129,
131
],
[
82,
132
],
[
132,
133
],
[
133,
134
],
[
134,
135
],
[
134,
136
],
[
133,
137
],
[
132,
138
],
[
28,
139
],
[
139,
140
],
[
140,
141
],
[
141,
142
],
[
141,
143
],
[
139,
144
],
[
144,
145
],
[
144,
146
],
[
146,
147
],
[
146,
148
],
[
139,
149
],
[
149,
150
],
[
150,
151
],
[
139,
152
],
[
153,
153
],
[
153,
154
],
[
154,
155
],
[
154,
156
],
[
153,
157
],
[
157,
158
],
[
158,
159
],
[
159,
160
],
[
159,
161
],
[
157,
162
],
[
162,
163
],
[
162,
164
],
[
164,
165
],
[
164,
166
],
[
157,
167
],
[
167,
168
],
[
168,
169
],
[
157,
170
],
[
171,
171
],
[
171,
172
],
[
172,
173
],
[
172,
174
],
[
174,
175
],
[
174,
176
],
[
176,
177
],
[
177,
178
],
[
177,
179
],
[
176,
180
],
[
153,
181
],
[
181,
182
],
[
182,
183
],
[
183,
184
],
[
183,
185
],
[
182,
186
],
[
181,
187
],
[
28,
188
],
[
188,
189
],
[
28,
190
],
[
190,
191
],
[
191,
192
],
[
192,
193
],
[
192,
194
],
[
190,
195
],
[
195,
196
],
[
195,
197
],
[
197,
198
],
[
197,
199
],
[
190,
200
],
[
200,
201
],
[
201,
202
],
[
190,
203
],
[
204,
204
],
[
204,
205
],
[
205,
206
],
[
205,
207
],
[
204,
208
],
[
208,
209
],
[
209,
210
],
[
210,
211
],
[
210,
212
],
[
208,
213
],
[
213,
214
],
[
213,
215
],
[
215,
216
],
[
215,
217
],
[
208,
218
],
[
218,
219
],
[
219,
220
],
[
208,
221
],
[
222,
222
],
[
222,
223
],
[
223,
224
],
[
223,
225
],
[
226,
226
],
[
226,
227
],
[
226,
228
],
[
228,
229
],
[
229,
230
],
[
229,
231
],
[
228,
232
],
[
226,
233
],
[
204,
234
],
[
234,
235
],
[
235,
236
],
[
236,
237
],
[
236,
238
],
[
234,
239
],
[
239,
240
],
[
240,
241
],
[
239,
242
],
[
239,
243
],
[
243,
244
],
[
244,
245
],
[
245,
246
],
[
243,
247
],
[
12,
248
],
[
248,
249
]
] | [
"import java.io.BufferedReader;\nimport java.io.IOException;\nimport java.io.InputStreamReader;\n\nclass Main {\n\tpublic static void main(String[] args) {\n\t\tInputStreamReader isr = new InputStreamReader(System.in);\n\t\tBufferedReader br = new BufferedReader(isr);\n\t\ttry {\n\t\t\tString[] inputList = br.readLine().split(\" \");\n\t\t\tint r = Integer.parseInt(inputList[0]);\n\t\t\tint c = Integer.parseInt(inputList[1]);\n\t\t\tint[][] list = new int[r + 1][c + 1];\n\t\t\tint i, j, num, sum;\n\t\t\tfor (i = 0; i < r; i++) {\n\t\t\t\tsum = 0;\n\t\t\t\tString[] hoge = br.readLine().split(\" \");\n\t\t\t\tfor (j = 0; j < c; j++) {\n\t\t\t\t\tnum = Integer.parseInt(hoge[j]);\n\t\t\t\t\tlist[i][j] = Integer.parseInt(hoge[j]);\n\t\t\t\t\tsum = sum + num;\n\t\t\t\t}\n\t\t\t\tlist[i][c] = sum;\n\t\t\t}\n\n\t\t\tfor (i = 0; i < c + 1; i++) {\n\t\t\t\tsum = 0;\n\t\t\t\tfor (j = 0; j < r + 1; j++) {\n\t\t\t\t\tsum = sum + list[j][i];\n\t\t\t\t}\n\t\t\t\tlist[r][i] = sum;\n\t\t\t}\n\n\t\t\tString output;\n\t\t\tfor (i = 0; i < r + 1; i++) {\n\t\t\t\toutput = \"\";\n\t\t\t\tfor (j = 0; j < c + 1; j++) {\n\t\t\t\t\toutput = output + list[i][j] + \" \";\n\t\t\t\t}\n\t\t\t\tSystem.out.println(output.substring(0, output.length() - 1));\n\t\t\t}\n\t\t} catch (IOException e) {\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",
"class Main {\n\tpublic static void main(String[] args) {\n\t\tInputStreamReader isr = new InputStreamReader(System.in);\n\t\tBufferedReader br = new BufferedReader(isr);\n\t\ttry {\n\t\t\tString[] inputList = br.readLine().split(\" \");\n\t\t\tint r = Integer.parseInt(inputList[0]);\n\t\t\tint c = Integer.parseInt(inputList[1]);\n\t\t\tint[][] list = new int[r + 1][c + 1];\n\t\t\tint i, j, num, sum;\n\t\t\tfor (i = 0; i < r; i++) {\n\t\t\t\tsum = 0;\n\t\t\t\tString[] hoge = br.readLine().split(\" \");\n\t\t\t\tfor (j = 0; j < c; j++) {\n\t\t\t\t\tnum = Integer.parseInt(hoge[j]);\n\t\t\t\t\tlist[i][j] = Integer.parseInt(hoge[j]);\n\t\t\t\t\tsum = sum + num;\n\t\t\t\t}\n\t\t\t\tlist[i][c] = sum;\n\t\t\t}\n\n\t\t\tfor (i = 0; i < c + 1; i++) {\n\t\t\t\tsum = 0;\n\t\t\t\tfor (j = 0; j < r + 1; j++) {\n\t\t\t\t\tsum = sum + list[j][i];\n\t\t\t\t}\n\t\t\t\tlist[r][i] = sum;\n\t\t\t}\n\n\t\t\tString output;\n\t\t\tfor (i = 0; i < r + 1; i++) {\n\t\t\t\toutput = \"\";\n\t\t\t\tfor (j = 0; j < c + 1; j++) {\n\t\t\t\t\toutput = output + list[i][j] + \" \";\n\t\t\t\t}\n\t\t\t\tSystem.out.println(output.substring(0, output.length() - 1));\n\t\t\t}\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}\n}",
"Main",
"public static void main(String[] args) {\n\t\tInputStreamReader isr = new InputStreamReader(System.in);\n\t\tBufferedReader br = new BufferedReader(isr);\n\t\ttry {\n\t\t\tString[] inputList = br.readLine().split(\" \");\n\t\t\tint r = Integer.parseInt(inputList[0]);\n\t\t\tint c = Integer.parseInt(inputList[1]);\n\t\t\tint[][] list = new int[r + 1][c + 1];\n\t\t\tint i, j, num, sum;\n\t\t\tfor (i = 0; i < r; i++) {\n\t\t\t\tsum = 0;\n\t\t\t\tString[] hoge = br.readLine().split(\" \");\n\t\t\t\tfor (j = 0; j < c; j++) {\n\t\t\t\t\tnum = Integer.parseInt(hoge[j]);\n\t\t\t\t\tlist[i][j] = Integer.parseInt(hoge[j]);\n\t\t\t\t\tsum = sum + num;\n\t\t\t\t}\n\t\t\t\tlist[i][c] = sum;\n\t\t\t}\n\n\t\t\tfor (i = 0; i < c + 1; i++) {\n\t\t\t\tsum = 0;\n\t\t\t\tfor (j = 0; j < r + 1; j++) {\n\t\t\t\t\tsum = sum + list[j][i];\n\t\t\t\t}\n\t\t\t\tlist[r][i] = sum;\n\t\t\t}\n\n\t\t\tString output;\n\t\t\tfor (i = 0; i < r + 1; i++) {\n\t\t\t\toutput = \"\";\n\t\t\t\tfor (j = 0; j < c + 1; j++) {\n\t\t\t\t\toutput = output + list[i][j] + \" \";\n\t\t\t\t}\n\t\t\t\tSystem.out.println(output.substring(0, output.length() - 1));\n\t\t\t}\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}",
"main",
"{\n\t\tInputStreamReader isr = new InputStreamReader(System.in);\n\t\tBufferedReader br = new BufferedReader(isr);\n\t\ttry {\n\t\t\tString[] inputList = br.readLine().split(\" \");\n\t\t\tint r = Integer.parseInt(inputList[0]);\n\t\t\tint c = Integer.parseInt(inputList[1]);\n\t\t\tint[][] list = new int[r + 1][c + 1];\n\t\t\tint i, j, num, sum;\n\t\t\tfor (i = 0; i < r; i++) {\n\t\t\t\tsum = 0;\n\t\t\t\tString[] hoge = br.readLine().split(\" \");\n\t\t\t\tfor (j = 0; j < c; j++) {\n\t\t\t\t\tnum = Integer.parseInt(hoge[j]);\n\t\t\t\t\tlist[i][j] = Integer.parseInt(hoge[j]);\n\t\t\t\t\tsum = sum + num;\n\t\t\t\t}\n\t\t\t\tlist[i][c] = sum;\n\t\t\t}\n\n\t\t\tfor (i = 0; i < c + 1; i++) {\n\t\t\t\tsum = 0;\n\t\t\t\tfor (j = 0; j < r + 1; j++) {\n\t\t\t\t\tsum = sum + list[j][i];\n\t\t\t\t}\n\t\t\t\tlist[r][i] = sum;\n\t\t\t}\n\n\t\t\tString output;\n\t\t\tfor (i = 0; i < r + 1; i++) {\n\t\t\t\toutput = \"\";\n\t\t\t\tfor (j = 0; j < c + 1; j++) {\n\t\t\t\t\toutput = output + list[i][j] + \" \";\n\t\t\t\t}\n\t\t\t\tSystem.out.println(output.substring(0, output.length() - 1));\n\t\t\t}\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}",
"InputStreamReader isr = new InputStreamReader(System.in);",
"isr",
"new InputStreamReader(System.in)",
"BufferedReader br = new BufferedReader(isr);",
"br",
"new BufferedReader(isr)",
"try {\n\t\t\tString[] inputList = br.readLine().split(\" \");\n\t\t\tint r = Integer.parseInt(inputList[0]);\n\t\t\tint c = Integer.parseInt(inputList[1]);\n\t\t\tint[][] list = new int[r + 1][c + 1];\n\t\t\tint i, j, num, sum;\n\t\t\tfor (i = 0; i < r; i++) {\n\t\t\t\tsum = 0;\n\t\t\t\tString[] hoge = br.readLine().split(\" \");\n\t\t\t\tfor (j = 0; j < c; j++) {\n\t\t\t\t\tnum = Integer.parseInt(hoge[j]);\n\t\t\t\t\tlist[i][j] = Integer.parseInt(hoge[j]);\n\t\t\t\t\tsum = sum + num;\n\t\t\t\t}\n\t\t\t\tlist[i][c] = sum;\n\t\t\t}\n\n\t\t\tfor (i = 0; i < c + 1; i++) {\n\t\t\t\tsum = 0;\n\t\t\t\tfor (j = 0; j < r + 1; j++) {\n\t\t\t\t\tsum = sum + list[j][i];\n\t\t\t\t}\n\t\t\t\tlist[r][i] = sum;\n\t\t\t}\n\n\t\t\tString output;\n\t\t\tfor (i = 0; i < r + 1; i++) {\n\t\t\t\toutput = \"\";\n\t\t\t\tfor (j = 0; j < c + 1; j++) {\n\t\t\t\t\toutput = output + list[i][j] + \" \";\n\t\t\t\t}\n\t\t\t\tSystem.out.println(output.substring(0, output.length() - 1));\n\t\t\t}\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}",
"catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}",
"IOException e",
"{\n\t\t\te.printStackTrace();\n\t\t}",
"e.printStackTrace()",
"e.printStackTrace",
"e",
"{\n\t\t\tString[] inputList = br.readLine().split(\" \");\n\t\t\tint r = Integer.parseInt(inputList[0]);\n\t\t\tint c = Integer.parseInt(inputList[1]);\n\t\t\tint[][] list = new int[r + 1][c + 1];\n\t\t\tint i, j, num, sum;\n\t\t\tfor (i = 0; i < r; i++) {\n\t\t\t\tsum = 0;\n\t\t\t\tString[] hoge = br.readLine().split(\" \");\n\t\t\t\tfor (j = 0; j < c; j++) {\n\t\t\t\t\tnum = Integer.parseInt(hoge[j]);\n\t\t\t\t\tlist[i][j] = Integer.parseInt(hoge[j]);\n\t\t\t\t\tsum = sum + num;\n\t\t\t\t}\n\t\t\t\tlist[i][c] = sum;\n\t\t\t}\n\n\t\t\tfor (i = 0; i < c + 1; i++) {\n\t\t\t\tsum = 0;\n\t\t\t\tfor (j = 0; j < r + 1; j++) {\n\t\t\t\t\tsum = sum + list[j][i];\n\t\t\t\t}\n\t\t\t\tlist[r][i] = sum;\n\t\t\t}\n\n\t\t\tString output;\n\t\t\tfor (i = 0; i < r + 1; i++) {\n\t\t\t\toutput = \"\";\n\t\t\t\tfor (j = 0; j < c + 1; j++) {\n\t\t\t\t\toutput = output + list[i][j] + \" \";\n\t\t\t\t}\n\t\t\t\tSystem.out.println(output.substring(0, output.length() - 1));\n\t\t\t}\n\t\t}",
"String[] inputList = br.readLine().split(\" \");",
"inputList",
"br.readLine().split(\" \")",
"br.readLine().split",
"br.readLine()",
"br.readLine",
"br",
"\" \"",
"int r = Integer.parseInt(inputList[0]);",
"r",
"Integer.parseInt(inputList[0])",
"Integer.parseInt",
"Integer",
"inputList[0]",
"inputList",
"0",
"int c = Integer.parseInt(inputList[1]);",
"c",
"Integer.parseInt(inputList[1])",
"Integer.parseInt",
"Integer",
"inputList[1]",
"inputList",
"1",
"int[][] list = new int[r + 1][c + 1];",
"list",
"new int[r + 1][c + 1]",
"r + 1",
"r",
"1",
"c + 1",
"c",
"1",
"int i",
"i",
"j",
"j",
"num",
"num",
"sum;",
"sum",
"for (i = 0; i < r; i++) {\n\t\t\t\tsum = 0;\n\t\t\t\tString[] hoge = br.readLine().split(\" \");\n\t\t\t\tfor (j = 0; j < c; j++) {\n\t\t\t\t\tnum = Integer.parseInt(hoge[j]);\n\t\t\t\t\tlist[i][j] = Integer.parseInt(hoge[j]);\n\t\t\t\t\tsum = sum + num;\n\t\t\t\t}\n\t\t\t\tlist[i][c] = sum;\n\t\t\t}",
"i = 0;",
"i = 0",
"i",
"0",
"i < r",
"i",
"r",
"i++",
"i++",
"i",
"{\n\t\t\t\tsum = 0;\n\t\t\t\tString[] hoge = br.readLine().split(\" \");\n\t\t\t\tfor (j = 0; j < c; j++) {\n\t\t\t\t\tnum = Integer.parseInt(hoge[j]);\n\t\t\t\t\tlist[i][j] = Integer.parseInt(hoge[j]);\n\t\t\t\t\tsum = sum + num;\n\t\t\t\t}\n\t\t\t\tlist[i][c] = sum;\n\t\t\t}",
"{\n\t\t\t\tsum = 0;\n\t\t\t\tString[] hoge = br.readLine().split(\" \");\n\t\t\t\tfor (j = 0; j < c; j++) {\n\t\t\t\t\tnum = Integer.parseInt(hoge[j]);\n\t\t\t\t\tlist[i][j] = Integer.parseInt(hoge[j]);\n\t\t\t\t\tsum = sum + num;\n\t\t\t\t}\n\t\t\t\tlist[i][c] = sum;\n\t\t\t}",
"sum = 0",
"sum",
"0",
"String[] hoge = br.readLine().split(\" \");",
"hoge",
"br.readLine().split(\" \")",
"br.readLine().split",
"br.readLine()",
"br.readLine",
"br",
"\" \"",
"for (j = 0; j < c; j++) {\n\t\t\t\t\tnum = Integer.parseInt(hoge[j]);\n\t\t\t\t\tlist[i][j] = Integer.parseInt(hoge[j]);\n\t\t\t\t\tsum = sum + num;\n\t\t\t\t}",
"j = 0;",
"j = 0",
"j",
"0",
"j < c",
"j",
"c",
"j++",
"j++",
"j",
"{\n\t\t\t\t\tnum = Integer.parseInt(hoge[j]);\n\t\t\t\t\tlist[i][j] = Integer.parseInt(hoge[j]);\n\t\t\t\t\tsum = sum + num;\n\t\t\t\t}",
"{\n\t\t\t\t\tnum = Integer.parseInt(hoge[j]);\n\t\t\t\t\tlist[i][j] = Integer.parseInt(hoge[j]);\n\t\t\t\t\tsum = sum + num;\n\t\t\t\t}",
"num = Integer.parseInt(hoge[j])",
"num",
"Integer.parseInt(hoge[j])",
"Integer.parseInt",
"Integer",
"hoge[j]",
"hoge",
"j",
"list[i][j] = Integer.parseInt(hoge[j])",
"list[i][j]",
"list[i]",
"list",
"i",
"j",
"Integer.parseInt(hoge[j])",
"Integer.parseInt",
"Integer",
"hoge[j]",
"hoge",
"j",
"sum = sum + num",
"sum",
"sum + num",
"sum",
"num",
"list[i][c] = sum",
"list[i][c]",
"list[i]",
"list",
"i",
"c",
"sum",
"for (i = 0; i < c + 1; i++) {\n\t\t\t\tsum = 0;\n\t\t\t\tfor (j = 0; j < r + 1; j++) {\n\t\t\t\t\tsum = sum + list[j][i];\n\t\t\t\t}\n\t\t\t\tlist[r][i] = sum;\n\t\t\t}",
"i = 0;",
"i = 0",
"i",
"0",
"i < c + 1",
"i",
"c + 1",
"c",
"1",
"i++",
"i++",
"i",
"{\n\t\t\t\tsum = 0;\n\t\t\t\tfor (j = 0; j < r + 1; j++) {\n\t\t\t\t\tsum = sum + list[j][i];\n\t\t\t\t}\n\t\t\t\tlist[r][i] = sum;\n\t\t\t}",
"{\n\t\t\t\tsum = 0;\n\t\t\t\tfor (j = 0; j < r + 1; j++) {\n\t\t\t\t\tsum = sum + list[j][i];\n\t\t\t\t}\n\t\t\t\tlist[r][i] = sum;\n\t\t\t}",
"sum = 0",
"sum",
"0",
"for (j = 0; j < r + 1; j++) {\n\t\t\t\t\tsum = sum + list[j][i];\n\t\t\t\t}",
"j = 0;",
"j = 0",
"j",
"0",
"j < r + 1",
"j",
"r + 1",
"r",
"1",
"j++",
"j++",
"j",
"{\n\t\t\t\t\tsum = sum + list[j][i];\n\t\t\t\t}",
"{\n\t\t\t\t\tsum = sum + list[j][i];\n\t\t\t\t}",
"sum = sum + list[j][i]",
"sum",
"sum + list[j][i]",
"sum",
"list[j][i]",
"list[j]",
"list",
"j",
"i",
"list[r][i] = sum",
"list[r][i]",
"list[r]",
"list",
"r",
"i",
"sum",
"String output;",
"output",
"for (i = 0; i < r + 1; i++) {\n\t\t\t\toutput = \"\";\n\t\t\t\tfor (j = 0; j < c + 1; j++) {\n\t\t\t\t\toutput = output + list[i][j] + \" \";\n\t\t\t\t}\n\t\t\t\tSystem.out.println(output.substring(0, output.length() - 1));\n\t\t\t}",
"i = 0;",
"i = 0",
"i",
"0",
"i < r + 1",
"i",
"r + 1",
"r",
"1",
"i++",
"i++",
"i",
"{\n\t\t\t\toutput = \"\";\n\t\t\t\tfor (j = 0; j < c + 1; j++) {\n\t\t\t\t\toutput = output + list[i][j] + \" \";\n\t\t\t\t}\n\t\t\t\tSystem.out.println(output.substring(0, output.length() - 1));\n\t\t\t}",
"{\n\t\t\t\toutput = \"\";\n\t\t\t\tfor (j = 0; j < c + 1; j++) {\n\t\t\t\t\toutput = output + list[i][j] + \" \";\n\t\t\t\t}\n\t\t\t\tSystem.out.println(output.substring(0, output.length() - 1));\n\t\t\t}",
"output = \"\"",
"output",
"\"\"",
"for (j = 0; j < c + 1; j++) {\n\t\t\t\t\toutput = output + list[i][j] + \" \";\n\t\t\t\t}",
"j = 0;",
"j = 0",
"j",
"0",
"j < c + 1",
"j",
"c + 1",
"c",
"1",
"j++",
"j++",
"j",
"{\n\t\t\t\t\toutput = output + list[i][j] + \" \";\n\t\t\t\t}",
"{\n\t\t\t\t\toutput = output + list[i][j] + \" \";\n\t\t\t\t}",
"output = output + list[i][j] + \" \"",
"output",
"output + list[i][j] + \" \"",
"output + list[i][j] + \" \"",
"output",
"list[i][j]",
"list[i]",
"list",
"i",
"j",
"\" \"",
"System.out.println(output.substring(0, output.length() - 1))",
"System.out.println",
"System.out",
"System",
"System.out",
"output.substring(0, output.length() - 1)",
"output.substring",
"output",
"0",
"output.length() - 1",
"output.length()",
"output.length",
"output",
"1",
"String[] args",
"args"
] | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
class Main {
public static void main(String[] args) {
InputStreamReader isr = new InputStreamReader(System.in);
BufferedReader br = new BufferedReader(isr);
try {
String[] inputList = br.readLine().split(" ");
int r = Integer.parseInt(inputList[0]);
int c = Integer.parseInt(inputList[1]);
int[][] list = new int[r + 1][c + 1];
int i, j, num, sum;
for (i = 0; i < r; i++) {
sum = 0;
String[] hoge = br.readLine().split(" ");
for (j = 0; j < c; j++) {
num = Integer.parseInt(hoge[j]);
list[i][j] = Integer.parseInt(hoge[j]);
sum = sum + num;
}
list[i][c] = sum;
}
for (i = 0; i < c + 1; i++) {
sum = 0;
for (j = 0; j < r + 1; j++) {
sum = sum + list[j][i];
}
list[r][i] = sum;
}
String output;
for (i = 0; i < r + 1; i++) {
output = "";
for (j = 0; j < c + 1; j++) {
output = output + list[i][j] + " ";
}
System.out.println(output.substring(0, output.length() - 1));
}
} catch (IOException e) {
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,
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,
0,
18,
18,
13,
13,
13,
4,
18,
13,
41,
13,
20,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
18,
18,
13,
17,
13,
0,
18,
13,
17,
18,
18,
13,
17,
13,
4,
18,
18,
13,
13,
18,
18,
13,
17,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
41,
13,
18,
18,
13,
13,
13,
0,
13,
13,
0,
18,
13,
13,
13,
4,
18,
18,
13,
13,
17,
13,
4,
18,
18,
13,
13,
17,
13,
0,
13,
18,
13,
17,
4,
18,
18,
13,
13,
18,
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,
17,
18,
13,
13,
4,
18,
18,
13,
13,
17,
13,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
198,
5
],
[
198,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
8,
17
],
[
17,
18
],
[
17,
19
],
[
19,
20
],
[
20,
21
],
[
8,
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
],
[
53,
54
],
[
54,
55
],
[
55,
56
],
[
56,
57
],
[
56,
58
],
[
55,
59
],
[
54,
60
],
[
60,
61
],
[
61,
62
],
[
8,
63
],
[
63,
64
],
[
63,
65
],
[
8,
67
],
[
67,
68
],
[
68,
69
],
[
69,
70
],
[
69,
71
],
[
67,
72
],
[
72,
73
],
[
72,
74
],
[
67,
75
],
[
75,
76
],
[
76,
77
],
[
67,
78
],
[
79,
79
],
[
79,
80
],
[
80,
81
],
[
80,
82
],
[
82,
83
],
[
83,
84
],
[
83,
85
],
[
82,
86
],
[
79,
87
],
[
87,
88
],
[
88,
89
],
[
88,
90
],
[
87,
91
],
[
91,
92
],
[
92,
93
],
[
92,
94
],
[
91,
95
],
[
79,
96
],
[
96,
97
],
[
97,
98
],
[
98,
99
],
[
98,
100
],
[
96,
101
],
[
101,
102
],
[
102,
103
],
[
102,
104
],
[
101,
105
],
[
79,
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
],
[
118,
126
],
[
126,
127
],
[
126,
128
],
[
118,
129
],
[
129,
130
],
[
130,
131
],
[
130,
132
],
[
129,
133
],
[
118,
134
],
[
134,
135
],
[
135,
136
],
[
136,
137
],
[
136,
138
],
[
134,
139
],
[
134,
140
],
[
79,
141
],
[
141,
142
],
[
142,
143
],
[
143,
144
],
[
143,
145
],
[
141,
146
],
[
141,
147
],
[
8,
148
],
[
148,
149
],
[
148,
150
],
[
150,
151
],
[
150,
152
],
[
8,
153
],
[
153,
154
],
[
154,
155
],
[
155,
156
],
[
155,
157
],
[
153,
158
],
[
158,
159
],
[
158,
160
],
[
8,
161
],
[
161,
162
],
[
162,
163
],
[
163,
164
],
[
163,
165
],
[
161,
166
],
[
166,
167
],
[
166,
168
],
[
161,
169
],
[
169,
170
],
[
170,
171
],
[
161,
172
],
[
173,
173
],
[
173,
174
],
[
174,
175
],
[
174,
176
],
[
176,
177
],
[
176,
178
],
[
173,
179
],
[
179,
180
],
[
180,
181
],
[
181,
182
],
[
181,
183
],
[
179,
184
],
[
179,
185
],
[
185,
186
],
[
185,
187
],
[
8,
188
],
[
188,
189
],
[
189,
190
],
[
190,
191
],
[
190,
192
],
[
188,
193
],
[
188,
194
],
[
6,
195
],
[
195,
196
],
[
0,
197
],
[
197,
198
],
[
197,
199
]
] | [
"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(),c = sc.nextInt(),sum;\n int[][] a = new int[c][r];\n for(int i = 0;i < r;++i){\n for(int j = 0;j < c;++j) a[j][i] = sc.nextInt();\n }\n int[] b = new int[c];\n for(int i = 0;i < r;++i){\n sum = a[0][i];\n b[0] += a[0][i];\n System.out.print(a[0][i]);\n for(int j = 1;j < c;++j){\n int v = a[j][i];\n sum += v;\n b[j] += v;\n System.out.printf(\" %d\",v);\n }\n System.out.printf(\" %d\\n\",sum);\n }\n sum = b[0];\n System.out.print(b[0]);\n for(int i = 1;i < c;++i){\n sum += b[i];\n System.out.printf(\" %d\",b[i]);\n }\n System.out.printf(\" %d\\n\",sum);\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(),c = sc.nextInt(),sum;\n int[][] a = new int[c][r];\n for(int i = 0;i < r;++i){\n for(int j = 0;j < c;++j) a[j][i] = sc.nextInt();\n }\n int[] b = new int[c];\n for(int i = 0;i < r;++i){\n sum = a[0][i];\n b[0] += a[0][i];\n System.out.print(a[0][i]);\n for(int j = 1;j < c;++j){\n int v = a[j][i];\n sum += v;\n b[j] += v;\n System.out.printf(\" %d\",v);\n }\n System.out.printf(\" %d\\n\",sum);\n }\n sum = b[0];\n System.out.print(b[0]);\n for(int i = 1;i < c;++i){\n sum += b[i];\n System.out.printf(\" %d\",b[i]);\n }\n System.out.printf(\" %d\\n\",sum);\n }\n\n}",
"Main",
"public static void main(String[] args){\n Scanner sc = new Scanner(System.in);\n int r = sc.nextInt(),c = sc.nextInt(),sum;\n int[][] a = new int[c][r];\n for(int i = 0;i < r;++i){\n for(int j = 0;j < c;++j) a[j][i] = sc.nextInt();\n }\n int[] b = new int[c];\n for(int i = 0;i < r;++i){\n sum = a[0][i];\n b[0] += a[0][i];\n System.out.print(a[0][i]);\n for(int j = 1;j < c;++j){\n int v = a[j][i];\n sum += v;\n b[j] += v;\n System.out.printf(\" %d\",v);\n }\n System.out.printf(\" %d\\n\",sum);\n }\n sum = b[0];\n System.out.print(b[0]);\n for(int i = 1;i < c;++i){\n sum += b[i];\n System.out.printf(\" %d\",b[i]);\n }\n System.out.printf(\" %d\\n\",sum);\n }",
"main",
"{\n Scanner sc = new Scanner(System.in);\n int r = sc.nextInt(),c = sc.nextInt(),sum;\n int[][] a = new int[c][r];\n for(int i = 0;i < r;++i){\n for(int j = 0;j < c;++j) a[j][i] = sc.nextInt();\n }\n int[] b = new int[c];\n for(int i = 0;i < r;++i){\n sum = a[0][i];\n b[0] += a[0][i];\n System.out.print(a[0][i]);\n for(int j = 1;j < c;++j){\n int v = a[j][i];\n sum += v;\n b[j] += v;\n System.out.printf(\" %d\",v);\n }\n System.out.printf(\" %d\\n\",sum);\n }\n sum = b[0];\n System.out.print(b[0]);\n for(int i = 1;i < c;++i){\n sum += b[i];\n System.out.printf(\" %d\",b[i]);\n }\n System.out.printf(\" %d\\n\",sum);\n }",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"int r = sc.nextInt()",
"r",
"sc.nextInt()",
"sc.nextInt",
"sc",
"c = sc.nextInt()",
"c",
"sc.nextInt()",
"sc.nextInt",
"sc",
"sum;",
"sum",
"int[][] a = new int[c][r];",
"a",
"new int[c][r]",
"c",
"r",
"for(int i = 0;i < r;++i){\n for(int j = 0;j < c;++j) a[j][i] = sc.nextInt();\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < r",
"i",
"r",
"++i",
"++i",
"i",
"{\n for(int j = 0;j < c;++j) a[j][i] = sc.nextInt();\n }",
"{\n for(int j = 0;j < c;++j) a[j][i] = sc.nextInt();\n }",
"for(int j = 0;j < c;++j) a[j][i] = sc.nextInt();",
"int j = 0;",
"int j = 0;",
"j",
"0",
"j < c",
"j",
"c",
"++j",
"++j",
"j",
"a[j][i] = sc.nextInt();",
"a[j][i] = sc.nextInt()",
"a[j][i]",
"a[j]",
"a",
"j",
"i",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int[] b = new int[c];",
"b",
"new int[c]",
"c",
"for(int i = 0;i < r;++i){\n sum = a[0][i];\n b[0] += a[0][i];\n System.out.print(a[0][i]);\n for(int j = 1;j < c;++j){\n int v = a[j][i];\n sum += v;\n b[j] += v;\n System.out.printf(\" %d\",v);\n }\n System.out.printf(\" %d\\n\",sum);\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < r",
"i",
"r",
"++i",
"++i",
"i",
"{\n sum = a[0][i];\n b[0] += a[0][i];\n System.out.print(a[0][i]);\n for(int j = 1;j < c;++j){\n int v = a[j][i];\n sum += v;\n b[j] += v;\n System.out.printf(\" %d\",v);\n }\n System.out.printf(\" %d\\n\",sum);\n }",
"{\n sum = a[0][i];\n b[0] += a[0][i];\n System.out.print(a[0][i]);\n for(int j = 1;j < c;++j){\n int v = a[j][i];\n sum += v;\n b[j] += v;\n System.out.printf(\" %d\",v);\n }\n System.out.printf(\" %d\\n\",sum);\n }",
"sum = a[0][i]",
"sum",
"a[0][i]",
"a[0]",
"a",
"0",
"i",
"b[0] += a[0][i]",
"b[0]",
"b",
"0",
"a[0][i]",
"a[0]",
"a",
"0",
"i",
"System.out.print(a[0][i])",
"System.out.print",
"System.out",
"System",
"System.out",
"a[0][i]",
"a[0]",
"a",
"0",
"i",
"for(int j = 1;j < c;++j){\n int v = a[j][i];\n sum += v;\n b[j] += v;\n System.out.printf(\" %d\",v);\n }",
"int j = 1;",
"int j = 1;",
"j",
"1",
"j < c",
"j",
"c",
"++j",
"++j",
"j",
"{\n int v = a[j][i];\n sum += v;\n b[j] += v;\n System.out.printf(\" %d\",v);\n }",
"{\n int v = a[j][i];\n sum += v;\n b[j] += v;\n System.out.printf(\" %d\",v);\n }",
"int v = a[j][i];",
"v",
"a[j][i]",
"a[j]",
"a",
"j",
"i",
"sum += v",
"sum",
"v",
"b[j] += v",
"b[j]",
"b",
"j",
"v",
"System.out.printf(\" %d\",v)",
"System.out.printf",
"System.out",
"System",
"System.out",
"\" %d\"",
"v",
"System.out.printf(\" %d\\n\",sum)",
"System.out.printf",
"System.out",
"System",
"System.out",
"\" %d\\n\"",
"sum",
"sum = b[0]",
"sum",
"b[0]",
"b",
"0",
"System.out.print(b[0])",
"System.out.print",
"System.out",
"System",
"System.out",
"b[0]",
"b",
"0",
"for(int i = 1;i < c;++i){\n sum += b[i];\n System.out.printf(\" %d\",b[i]);\n }",
"int i = 1;",
"int i = 1;",
"i",
"1",
"i < c",
"i",
"c",
"++i",
"++i",
"i",
"{\n sum += b[i];\n System.out.printf(\" %d\",b[i]);\n }",
"{\n sum += b[i];\n System.out.printf(\" %d\",b[i]);\n }",
"sum += b[i]",
"sum",
"b[i]",
"b",
"i",
"System.out.printf(\" %d\",b[i])",
"System.out.printf",
"System.out",
"System",
"System.out",
"\" %d\"",
"b[i]",
"b",
"i",
"System.out.printf(\" %d\\n\",sum)",
"System.out.printf",
"System.out",
"System",
"System.out",
"\" %d\\n\"",
"sum",
"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(),c = sc.nextInt(),sum;\n int[][] a = new int[c][r];\n for(int i = 0;i < r;++i){\n for(int j = 0;j < c;++j) a[j][i] = sc.nextInt();\n }\n int[] b = new int[c];\n for(int i = 0;i < r;++i){\n sum = a[0][i];\n b[0] += a[0][i];\n System.out.print(a[0][i]);\n for(int j = 1;j < c;++j){\n int v = a[j][i];\n sum += v;\n b[j] += v;\n System.out.printf(\" %d\",v);\n }\n System.out.printf(\" %d\\n\",sum);\n }\n sum = b[0];\n System.out.print(b[0]);\n for(int i = 1;i < c;++i){\n sum += b[i];\n System.out.printf(\" %d\",b[i]);\n }\n System.out.printf(\" %d\\n\",sum);\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(),c = sc.nextInt(),sum;\n int[][] a = new int[c][r];\n for(int i = 0;i < r;++i){\n for(int j = 0;j < c;++j) a[j][i] = sc.nextInt();\n }\n int[] b = new int[c];\n for(int i = 0;i < r;++i){\n sum = a[0][i];\n b[0] += a[0][i];\n System.out.print(a[0][i]);\n for(int j = 1;j < c;++j){\n int v = a[j][i];\n sum += v;\n b[j] += v;\n System.out.printf(\" %d\",v);\n }\n System.out.printf(\" %d\\n\",sum);\n }\n sum = b[0];\n System.out.print(b[0]);\n for(int i = 1;i < c;++i){\n sum += b[i];\n System.out.printf(\" %d\",b[i]);\n }\n System.out.printf(\" %d\\n\",sum);\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(),c = sc.nextInt(),sum;
int[][] a = new int[c][r];
for(int i = 0;i < r;++i){
for(int j = 0;j < c;++j) a[j][i] = sc.nextInt();
}
int[] b = new int[c];
for(int i = 0;i < r;++i){
sum = a[0][i];
b[0] += a[0][i];
System.out.print(a[0][i]);
for(int j = 1;j < c;++j){
int v = a[j][i];
sum += v;
b[j] += v;
System.out.printf(" %d",v);
}
System.out.printf(" %d\n",sum);
}
sum = b[0];
System.out.print(b[0]);
for(int i = 1;i < c;++i){
sum += b[i];
System.out.printf(" %d",b[i]);
}
System.out.printf(" %d\n",sum);
}
} |
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
20,
4,
18,
13,
17,
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,
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,
28,
13,
18,
13,
13,
30,
30,
0,
18,
18,
13,
13,
13,
13,
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,
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,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
203,
5
],
[
203,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
8,
15
],
[
15,
16
],
[
16,
17
],
[
15,
18
],
[
8,
19
],
[
19,
20
],
[
8,
21
],
[
21,
22
],
[
8,
23
],
[
23,
24
],
[
23,
25
],
[
25,
26
],
[
26,
27
],
[
8,
28
],
[
28,
29
],
[
28,
30
],
[
30,
31
],
[
31,
32
],
[
8,
33
],
[
33,
34
],
[
33,
35
],
[
36,
37
],
[
36,
38
],
[
39,
40
],
[
39,
41
],
[
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
],
[
110,
112
],
[
109,
113
],
[
102,
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
],
[
125,
127
],
[
127,
128
],
[
127,
129
],
[
125,
130
],
[
131,
131
],
[
131,
132
],
[
132,
133
],
[
133,
134
],
[
134,
135
],
[
134,
136
],
[
133,
137
],
[
132,
138
],
[
8,
139
],
[
139,
140
],
[
140,
141
],
[
141,
142
],
[
141,
143
],
[
140,
144
],
[
139,
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
],
[
191,
192
],
[
192,
193
],
[
192,
194
],
[
190,
195
],
[
195,
196
],
[
196,
197
],
[
196,
198
],
[
195,
199
],
[
6,
200
],
[
200,
201
],
[
0,
202
],
[
202,
203
],
[
202,
204
]
] | [
"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\tStringBuilder sb = new StringBuilder();\n\t\tsb.append(\"\");\n\t\tint r, c;\n\t\tr = scan.nextInt();\n\t\tc = scan.nextInt();\n\t\tint[][] ar = 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\tar[i][j] = scan.nextInt();\n\t\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\tar[i][c] += ar[i][j];\n\t\t\t\tar[r][j] += ar[i][j];\n\t\t\t}\n\t\t}\n\t\tfor (int i : ar[r]) {\n\t\t\tar[r][c] += i;\n\t\t}\n\t\tar[r][c] /= 2;\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 != c) {\n\t\t\t\t\tSystem.out.print(ar[i][j] + \" \");\n\t\t\t\t}else {\n\t\t\t\t\tSystem.out.println(ar[i][j]);\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\t\tScanner scan = new Scanner(System.in);\n\t\tStringBuilder sb = new StringBuilder();\n\t\tsb.append(\"\");\n\t\tint r, c;\n\t\tr = scan.nextInt();\n\t\tc = scan.nextInt();\n\t\tint[][] ar = 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\tar[i][j] = scan.nextInt();\n\t\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\tar[i][c] += ar[i][j];\n\t\t\t\tar[r][j] += ar[i][j];\n\t\t\t}\n\t\t}\n\t\tfor (int i : ar[r]) {\n\t\t\tar[r][c] += i;\n\t\t}\n\t\tar[r][c] /= 2;\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 != c) {\n\t\t\t\t\tSystem.out.print(ar[i][j] + \" \");\n\t\t\t\t}else {\n\t\t\t\t\tSystem.out.println(ar[i][j]);\n\t\t\t\t}\n\t\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\tStringBuilder sb = new StringBuilder();\n\t\tsb.append(\"\");\n\t\tint r, c;\n\t\tr = scan.nextInt();\n\t\tc = scan.nextInt();\n\t\tint[][] ar = 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\tar[i][j] = scan.nextInt();\n\t\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\tar[i][c] += ar[i][j];\n\t\t\t\tar[r][j] += ar[i][j];\n\t\t\t}\n\t\t}\n\t\tfor (int i : ar[r]) {\n\t\t\tar[r][c] += i;\n\t\t}\n\t\tar[r][c] /= 2;\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 != c) {\n\t\t\t\t\tSystem.out.print(ar[i][j] + \" \");\n\t\t\t\t}else {\n\t\t\t\t\tSystem.out.println(ar[i][j]);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"main",
"{\n\t\tScanner scan = new Scanner(System.in);\n\t\tStringBuilder sb = new StringBuilder();\n\t\tsb.append(\"\");\n\t\tint r, c;\n\t\tr = scan.nextInt();\n\t\tc = scan.nextInt();\n\t\tint[][] ar = 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\tar[i][j] = scan.nextInt();\n\t\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\tar[i][c] += ar[i][j];\n\t\t\t\tar[r][j] += ar[i][j];\n\t\t\t}\n\t\t}\n\t\tfor (int i : ar[r]) {\n\t\t\tar[r][c] += i;\n\t\t}\n\t\tar[r][c] /= 2;\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 != c) {\n\t\t\t\t\tSystem.out.print(ar[i][j] + \" \");\n\t\t\t\t}else {\n\t\t\t\t\tSystem.out.println(ar[i][j]);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"Scanner scan = new Scanner(System.in);",
"scan",
"new Scanner(System.in)",
"StringBuilder sb = new StringBuilder();",
"sb",
"new StringBuilder()",
"sb.append(\"\")",
"sb.append",
"sb",
"\"\"",
"int r",
"r",
"c;",
"c",
"r = scan.nextInt()",
"r",
"scan.nextInt()",
"scan.nextInt",
"scan",
"c = scan.nextInt()",
"c",
"scan.nextInt()",
"scan.nextInt",
"scan",
"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\t\tfor (int j = 0; j < c; j++) {\n\t\t\t\tar[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\tar[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\tar[i][j] = scan.nextInt();\n\t\t\t}\n\t\t}",
"for (int j = 0; j < c; j++) {\n\t\t\t\tar[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\tar[i][j] = scan.nextInt();\n\t\t\t}",
"{\n\t\t\t\tar[i][j] = scan.nextInt();\n\t\t\t}",
"ar[i][j] = scan.nextInt()",
"ar[i][j]",
"ar[i]",
"ar",
"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\tar[i][c] += ar[i][j];\n\t\t\t\tar[r][j] += ar[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\tar[i][c] += ar[i][j];\n\t\t\t\tar[r][j] += ar[i][j];\n\t\t\t}\n\t\t}",
"{\n\t\t\tfor (int j = 0; j < c; j++) {\n\t\t\t\tar[i][c] += ar[i][j];\n\t\t\t\tar[r][j] += ar[i][j];\n\t\t\t}\n\t\t}",
"for (int j = 0; j < c; j++) {\n\t\t\t\tar[i][c] += ar[i][j];\n\t\t\t\tar[r][j] += ar[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\tar[i][c] += ar[i][j];\n\t\t\t\tar[r][j] += ar[i][j];\n\t\t\t}",
"{\n\t\t\t\tar[i][c] += ar[i][j];\n\t\t\t\tar[r][j] += ar[i][j];\n\t\t\t}",
"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",
"for (int i : ar[r]) {\n\t\t\tar[r][c] += i;\n\t\t}",
"int i",
"ar[r]",
"ar",
"r",
"{\n\t\t\tar[r][c] += i;\n\t\t}",
"{\n\t\t\tar[r][c] += i;\n\t\t}",
"ar[r][c] += i",
"ar[r][c]",
"ar[r]",
"ar",
"r",
"c",
"i",
"ar[r][c] /= 2",
"ar[r][c]",
"ar[r]",
"ar",
"r",
"c",
"2",
"for (int i = 0; i <= r; i++) {\n\t\t\tfor (int j = 0; j <= c; j++) {\n\t\t\t\tif (j != c) {\n\t\t\t\t\tSystem.out.print(ar[i][j] + \" \");\n\t\t\t\t}else {\n\t\t\t\t\tSystem.out.println(ar[i][j]);\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 (j != c) {\n\t\t\t\t\tSystem.out.print(ar[i][j] + \" \");\n\t\t\t\t}else {\n\t\t\t\t\tSystem.out.println(ar[i][j]);\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 (j != c) {\n\t\t\t\t\tSystem.out.print(ar[i][j] + \" \");\n\t\t\t\t}else {\n\t\t\t\t\tSystem.out.println(ar[i][j]);\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"for (int j = 0; j <= c; j++) {\n\t\t\t\tif (j != c) {\n\t\t\t\t\tSystem.out.print(ar[i][j] + \" \");\n\t\t\t\t}else {\n\t\t\t\t\tSystem.out.println(ar[i][j]);\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\tSystem.out.print(ar[i][j] + \" \");\n\t\t\t\t}else {\n\t\t\t\t\tSystem.out.println(ar[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(ar[i][j] + \" \");\n\t\t\t\t}else {\n\t\t\t\t\tSystem.out.println(ar[i][j]);\n\t\t\t\t}\n\t\t\t}",
"if (j != c) {\n\t\t\t\t\tSystem.out.print(ar[i][j] + \" \");\n\t\t\t\t}else {\n\t\t\t\t\tSystem.out.println(ar[i][j]);\n\t\t\t\t}",
"j != c",
"j",
"c",
"{\n\t\t\t\t\tSystem.out.print(ar[i][j] + \" \");\n\t\t\t\t}",
"System.out.print(ar[i][j] + \" \")",
"System.out.print",
"System.out",
"System",
"System.out",
"ar[i][j] + \" \"",
"ar[i][j]",
"ar[i]",
"ar",
"i",
"j",
"\" \"",
"{\n\t\t\t\t\tSystem.out.println(ar[i][j]);\n\t\t\t\t}",
"System.out.println(ar[i][j])",
"System.out.println",
"System.out",
"System",
"System.out",
"ar[i][j]",
"ar[i]",
"ar",
"i",
"j",
"String[] args",
"args",
"public class Main {\n\tpublic static void main(String[] args) {\n\t\tScanner scan = new Scanner(System.in);\n\t\tStringBuilder sb = new StringBuilder();\n\t\tsb.append(\"\");\n\t\tint r, c;\n\t\tr = scan.nextInt();\n\t\tc = scan.nextInt();\n\t\tint[][] ar = 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\tar[i][j] = scan.nextInt();\n\t\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\tar[i][c] += ar[i][j];\n\t\t\t\tar[r][j] += ar[i][j];\n\t\t\t}\n\t\t}\n\t\tfor (int i : ar[r]) {\n\t\t\tar[r][c] += i;\n\t\t}\n\t\tar[r][c] /= 2;\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 != c) {\n\t\t\t\t\tSystem.out.print(ar[i][j] + \" \");\n\t\t\t\t}else {\n\t\t\t\t\tSystem.out.println(ar[i][j]);\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\t\tScanner scan = new Scanner(System.in);\n\t\tStringBuilder sb = new StringBuilder();\n\t\tsb.append(\"\");\n\t\tint r, c;\n\t\tr = scan.nextInt();\n\t\tc = scan.nextInt();\n\t\tint[][] ar = 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\tar[i][j] = scan.nextInt();\n\t\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\tar[i][c] += ar[i][j];\n\t\t\t\tar[r][j] += ar[i][j];\n\t\t\t}\n\t\t}\n\t\tfor (int i : ar[r]) {\n\t\t\tar[r][c] += i;\n\t\t}\n\t\tar[r][c] /= 2;\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 != c) {\n\t\t\t\t\tSystem.out.print(ar[i][j] + \" \");\n\t\t\t\t}else {\n\t\t\t\t\tSystem.out.println(ar[i][j]);\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 scan = new Scanner(System.in);
StringBuilder sb = new StringBuilder();
sb.append("");
int r, c;
r = scan.nextInt();
c = scan.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] = scan.nextInt();
}
}
for (int i = 0; i < r; i++) {
for (int j = 0; j < c; j++) {
ar[i][c] += ar[i][j];
ar[r][j] += ar[i][j];
}
}
for (int i : ar[r]) {
ar[r][c] += i;
}
ar[r][c] /= 2;
for (int i = 0; i <= r; i++) {
for (int j = 0; j <= c; j++) {
if (j != c) {
System.out.print(ar[i][j] + " ");
}else {
System.out.println(ar[i][j]);
}
}
}
}
} |
[
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,
13,
4,
18,
13,
41,
13,
4,
18,
13,
4,
18,
13,
41,
13,
20,
13,
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,
41,
13,
4,
18,
13,
4,
18,
13,
0,
18,
18,
13,
13,
13,
13,
41,
13,
20,
2,
13,
17,
2,
13,
17,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
2,
13,
17,
1,
40,
13,
30,
30,
11,
1,
41,
13,
17,
2,
13,
2,
13,
17,
1,
40,
13,
30,
30,
14,
2,
2,
13,
13,
2,
13,
13,
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,
3,
14,
2,
13,
13,
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,
9,
14,
2,
2,
13,
13,
2,
13,
13,
30,
0,
18,
18,
13,
13,
13,
13,
0,
13,
17,
9,
0,
18,
18,
13,
13,
13,
18,
18,
13,
13,
13,
0,
13,
2,
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,
3,
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
],
[
308,
14
],
[
308,
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
],
[
26,
29
],
[
29,
30
],
[
30,
31
],
[
17,
32
],
[
32,
33
],
[
32,
34
],
[
34,
35
],
[
35,
36
],
[
34,
37
],
[
37,
38
],
[
38,
39
],
[
17,
40
],
[
40,
41
],
[
40,
42
],
[
17,
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
],
[
57,
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
],
[
74,
76
],
[
76,
77
],
[
77,
78
],
[
76,
79
],
[
79,
80
],
[
80,
81
],
[
73,
82
],
[
82,
83
],
[
83,
84
],
[
84,
85
],
[
84,
86
],
[
83,
87
],
[
82,
88
],
[
17,
89
],
[
89,
90
],
[
89,
91
],
[
92,
93
],
[
92,
94
],
[
95,
96
],
[
95,
97
],
[
17,
98
],
[
98,
99
],
[
98,
100
],
[
17,
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
],
[
117,
118
],
[
118,
119
],
[
118,
120
],
[
116,
121
],
[
121,
122
],
[
121,
123
],
[
123,
124
],
[
123,
125
],
[
116,
126
],
[
126,
127
],
[
127,
128
],
[
116,
129
],
[
130,
130
],
[
130,
131
],
[
131,
132
],
[
132,
133
],
[
133,
134
],
[
133,
135
],
[
132,
136
],
[
136,
137
],
[
136,
138
],
[
131,
139
],
[
139,
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
],
[
153,
155
],
[
155,
156
],
[
155,
157
],
[
157,
158
],
[
158,
159
],
[
158,
160
],
[
157,
161
],
[
139,
162
],
[
162,
163
],
[
163,
164
],
[
164,
165
],
[
164,
166
],
[
163,
167
],
[
162,
168
],
[
139,
169
],
[
130,
170
],
[
170,
171
],
[
171,
172
],
[
171,
173
],
[
170,
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
],
[
190,
192
],
[
192,
193
],
[
193,
194
],
[
193,
195
],
[
192,
196
],
[
174,
197
],
[
197,
198
],
[
198,
199
],
[
199,
200
],
[
199,
201
],
[
198,
202
],
[
197,
203
],
[
174,
204
],
[
204,
205
],
[
204,
206
],
[
174,
207
],
[
130,
208
],
[
208,
209
],
[
209,
210
],
[
210,
211
],
[
210,
212
],
[
209,
213
],
[
213,
214
],
[
213,
215
],
[
208,
216
],
[
216,
217
],
[
217,
218
],
[
218,
219
],
[
219,
220
],
[
219,
221
],
[
218,
222
],
[
217,
223
],
[
216,
224
],
[
224,
225
],
[
224,
226
],
[
216,
227
],
[
130,
228
],
[
228,
229
],
[
229,
230
],
[
230,
231
],
[
230,
232
],
[
229,
233
],
[
228,
234
],
[
234,
235
],
[
235,
236
],
[
235,
237
],
[
234,
238
],
[
130,
239
],
[
239,
240
],
[
239,
241
],
[
241,
242
],
[
241,
243
],
[
243,
244
],
[
244,
245
],
[
244,
246
],
[
243,
247
],
[
17,
248
],
[
248,
249
],
[
249,
250
],
[
250,
251
],
[
250,
252
],
[
248,
253
],
[
253,
254
],
[
253,
255
],
[
255,
256
],
[
255,
257
],
[
248,
258
],
[
258,
259
],
[
259,
260
],
[
248,
261
],
[
262,
262
],
[
262,
263
],
[
263,
264
],
[
264,
265
],
[
265,
266
],
[
265,
267
],
[
263,
268
],
[
268,
269
],
[
268,
270
],
[
270,
271
],
[
270,
272
],
[
263,
273
],
[
273,
274
],
[
274,
275
],
[
263,
276
],
[
277,
277
],
[
277,
278
],
[
278,
279
],
[
279,
280
],
[
280,
281
],
[
280,
282
],
[
278,
283
],
[
283,
284
],
[
284,
285
],
[
284,
286
],
[
283,
287
],
[
277,
288
],
[
288,
289
],
[
289,
290
],
[
289,
291
],
[
288,
292
],
[
292,
293
],
[
277,
294
],
[
294,
295
],
[
295,
296
],
[
296,
297
],
[
296,
298
],
[
294,
299
],
[
262,
300
],
[
300,
301
],
[
301,
302
],
[
302,
303
],
[
302,
304
],
[
15,
305
],
[
305,
306
],
[
0,
307
],
[
307,
308
],
[
307,
309
]
] | [
"import java.io.BufferedReader;\nimport java.io.IOException;\nimport java.io.InputStreamReader;\nimport java.util.StringTokenizer;\n\npublic class Main {\n\n\tpublic static void main(String[] args) throws IOException {\n\t\t//入力処理\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\t\tStringTokenizer st=new StringTokenizer(br.readLine());\n\t\tint r=Integer.parseInt(st.nextToken());\n\t\tint c=Integer.parseInt(st.nextToken());\n\n\t\t//配列の作成・入力\n\t\tint[][] ary=new int[r][c];\n\t\tfor(int j=0;j<r;j++) {\n\t\t\tStringTokenizer sa=new StringTokenizer(br.readLine());\n\t\t\tfor(int i=0;i<c;i++) {\n\t\t\t\tint d=Integer.parseInt(sa.nextToken());\n\t\t\t\tary[j][i]=d;\n\t\t\t}\n\t\t}\n\n\t\t//出力する配列作成\n\t\tint[][] Opary=new int[r+1][c+1];\n\t\tint sum=0;\n\t\tfor(int j=0;j<r+1;j++) {\n\t\t\tfor(int i=0;i<c+1;i++) {\n\t\t\t\tif(i==c && j==r) {\n\t\t\t\t\tfor(int k=0;k<=r;k++) {\n\t\t\t\t\t\tsum=sum+Opary[k][i];\n\t\t\t\t\t}\n\t\t\t\t\tOpary[j][i]=sum;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif(j==r) {\n\t\t\t\t\tfor(int k=0;k<=r;k++) {\n\t\t\t\t\t\tsum=sum+Opary[k][i];\n\t\t\t\t\t}\n\t\t\t\t\tOpary[j][i]=sum;\n\t\t\t\t\tsum=0;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tif(i==c && j!=r) {\n\t\t\t\t\tOpary[j][i]=sum;\n\t\t\t\t\tsum=0;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tOpary[j][i]=ary[j][i];\n\t\t\t\tsum=sum+Opary[j][i];\n\t\t\t}\n\t\t}\n\n\t\t//配列の出力\n\t\tfor(int j=0;j<r+1;j++) {\n\t\t\tfor(int i=0;i<c+1;i++) {\n\t\t\t\tSystem.out.print(Opary[j][i]);\n\t\t\t\tif(i==c) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tSystem.out.print(\" \");\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}\n\t}\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\tpublic static void main(String[] args) throws IOException {\n\t\t//入力処理\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\t\tStringTokenizer st=new StringTokenizer(br.readLine());\n\t\tint r=Integer.parseInt(st.nextToken());\n\t\tint c=Integer.parseInt(st.nextToken());\n\n\t\t//配列の作成・入力\n\t\tint[][] ary=new int[r][c];\n\t\tfor(int j=0;j<r;j++) {\n\t\t\tStringTokenizer sa=new StringTokenizer(br.readLine());\n\t\t\tfor(int i=0;i<c;i++) {\n\t\t\t\tint d=Integer.parseInt(sa.nextToken());\n\t\t\t\tary[j][i]=d;\n\t\t\t}\n\t\t}\n\n\t\t//出力する配列作成\n\t\tint[][] Opary=new int[r+1][c+1];\n\t\tint sum=0;\n\t\tfor(int j=0;j<r+1;j++) {\n\t\t\tfor(int i=0;i<c+1;i++) {\n\t\t\t\tif(i==c && j==r) {\n\t\t\t\t\tfor(int k=0;k<=r;k++) {\n\t\t\t\t\t\tsum=sum+Opary[k][i];\n\t\t\t\t\t}\n\t\t\t\t\tOpary[j][i]=sum;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif(j==r) {\n\t\t\t\t\tfor(int k=0;k<=r;k++) {\n\t\t\t\t\t\tsum=sum+Opary[k][i];\n\t\t\t\t\t}\n\t\t\t\t\tOpary[j][i]=sum;\n\t\t\t\t\tsum=0;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tif(i==c && j!=r) {\n\t\t\t\t\tOpary[j][i]=sum;\n\t\t\t\t\tsum=0;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tOpary[j][i]=ary[j][i];\n\t\t\t\tsum=sum+Opary[j][i];\n\t\t\t}\n\t\t}\n\n\t\t//配列の出力\n\t\tfor(int j=0;j<r+1;j++) {\n\t\t\tfor(int i=0;i<c+1;i++) {\n\t\t\t\tSystem.out.print(Opary[j][i]);\n\t\t\t\tif(i==c) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\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) throws IOException {\n\t\t//入力処理\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\t\tStringTokenizer st=new StringTokenizer(br.readLine());\n\t\tint r=Integer.parseInt(st.nextToken());\n\t\tint c=Integer.parseInt(st.nextToken());\n\n\t\t//配列の作成・入力\n\t\tint[][] ary=new int[r][c];\n\t\tfor(int j=0;j<r;j++) {\n\t\t\tStringTokenizer sa=new StringTokenizer(br.readLine());\n\t\t\tfor(int i=0;i<c;i++) {\n\t\t\t\tint d=Integer.parseInt(sa.nextToken());\n\t\t\t\tary[j][i]=d;\n\t\t\t}\n\t\t}\n\n\t\t//出力する配列作成\n\t\tint[][] Opary=new int[r+1][c+1];\n\t\tint sum=0;\n\t\tfor(int j=0;j<r+1;j++) {\n\t\t\tfor(int i=0;i<c+1;i++) {\n\t\t\t\tif(i==c && j==r) {\n\t\t\t\t\tfor(int k=0;k<=r;k++) {\n\t\t\t\t\t\tsum=sum+Opary[k][i];\n\t\t\t\t\t}\n\t\t\t\t\tOpary[j][i]=sum;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif(j==r) {\n\t\t\t\t\tfor(int k=0;k<=r;k++) {\n\t\t\t\t\t\tsum=sum+Opary[k][i];\n\t\t\t\t\t}\n\t\t\t\t\tOpary[j][i]=sum;\n\t\t\t\t\tsum=0;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tif(i==c && j!=r) {\n\t\t\t\t\tOpary[j][i]=sum;\n\t\t\t\t\tsum=0;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tOpary[j][i]=ary[j][i];\n\t\t\t\tsum=sum+Opary[j][i];\n\t\t\t}\n\t\t}\n\n\t\t//配列の出力\n\t\tfor(int j=0;j<r+1;j++) {\n\t\t\tfor(int i=0;i<c+1;i++) {\n\t\t\t\tSystem.out.print(Opary[j][i]);\n\t\t\t\tif(i==c) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tSystem.out.print(\" \");\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}\n\t}",
"main",
"{\n\t\t//入力処理\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\t\tStringTokenizer st=new StringTokenizer(br.readLine());\n\t\tint r=Integer.parseInt(st.nextToken());\n\t\tint c=Integer.parseInt(st.nextToken());\n\n\t\t//配列の作成・入力\n\t\tint[][] ary=new int[r][c];\n\t\tfor(int j=0;j<r;j++) {\n\t\t\tStringTokenizer sa=new StringTokenizer(br.readLine());\n\t\t\tfor(int i=0;i<c;i++) {\n\t\t\t\tint d=Integer.parseInt(sa.nextToken());\n\t\t\t\tary[j][i]=d;\n\t\t\t}\n\t\t}\n\n\t\t//出力する配列作成\n\t\tint[][] Opary=new int[r+1][c+1];\n\t\tint sum=0;\n\t\tfor(int j=0;j<r+1;j++) {\n\t\t\tfor(int i=0;i<c+1;i++) {\n\t\t\t\tif(i==c && j==r) {\n\t\t\t\t\tfor(int k=0;k<=r;k++) {\n\t\t\t\t\t\tsum=sum+Opary[k][i];\n\t\t\t\t\t}\n\t\t\t\t\tOpary[j][i]=sum;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif(j==r) {\n\t\t\t\t\tfor(int k=0;k<=r;k++) {\n\t\t\t\t\t\tsum=sum+Opary[k][i];\n\t\t\t\t\t}\n\t\t\t\t\tOpary[j][i]=sum;\n\t\t\t\t\tsum=0;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tif(i==c && j!=r) {\n\t\t\t\t\tOpary[j][i]=sum;\n\t\t\t\t\tsum=0;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tOpary[j][i]=ary[j][i];\n\t\t\t\tsum=sum+Opary[j][i];\n\t\t\t}\n\t\t}\n\n\t\t//配列の出力\n\t\tfor(int j=0;j<r+1;j++) {\n\t\t\tfor(int i=0;i<c+1;i++) {\n\t\t\t\tSystem.out.print(Opary[j][i]);\n\t\t\t\tif(i==c) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tSystem.out.print(\" \");\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))",
"StringTokenizer st=new StringTokenizer(br.readLine());",
"st",
"new StringTokenizer(br.readLine())",
"int r=Integer.parseInt(st.nextToken());",
"r",
"Integer.parseInt(st.nextToken())",
"Integer.parseInt",
"Integer",
"st.nextToken()",
"st.nextToken",
"st",
"int c=Integer.parseInt(st.nextToken());",
"c",
"Integer.parseInt(st.nextToken())",
"Integer.parseInt",
"Integer",
"st.nextToken()",
"st.nextToken",
"st",
"int[][] ary=new int[r][c];",
"ary",
"new int[r][c]",
"r",
"c",
"for(int j=0;j<r;j++) {\n\t\t\tStringTokenizer sa=new StringTokenizer(br.readLine());\n\t\t\tfor(int i=0;i<c;i++) {\n\t\t\t\tint d=Integer.parseInt(sa.nextToken());\n\t\t\t\tary[j][i]=d;\n\t\t\t}\n\t\t}",
"int j=0;",
"int j=0;",
"j",
"0",
"j<r",
"j",
"r",
"j++",
"j++",
"j",
"{\n\t\t\tStringTokenizer sa=new StringTokenizer(br.readLine());\n\t\t\tfor(int i=0;i<c;i++) {\n\t\t\t\tint d=Integer.parseInt(sa.nextToken());\n\t\t\t\tary[j][i]=d;\n\t\t\t}\n\t\t}",
"{\n\t\t\tStringTokenizer sa=new StringTokenizer(br.readLine());\n\t\t\tfor(int i=0;i<c;i++) {\n\t\t\t\tint d=Integer.parseInt(sa.nextToken());\n\t\t\t\tary[j][i]=d;\n\t\t\t}\n\t\t}",
"StringTokenizer sa=new StringTokenizer(br.readLine());",
"sa",
"new StringTokenizer(br.readLine())",
"for(int i=0;i<c;i++) {\n\t\t\t\tint d=Integer.parseInt(sa.nextToken());\n\t\t\t\tary[j][i]=d;\n\t\t\t}",
"int i=0;",
"int i=0;",
"i",
"0",
"i<c",
"i",
"c",
"i++",
"i++",
"i",
"{\n\t\t\t\tint d=Integer.parseInt(sa.nextToken());\n\t\t\t\tary[j][i]=d;\n\t\t\t}",
"{\n\t\t\t\tint d=Integer.parseInt(sa.nextToken());\n\t\t\t\tary[j][i]=d;\n\t\t\t}",
"int d=Integer.parseInt(sa.nextToken());",
"d",
"Integer.parseInt(sa.nextToken())",
"Integer.parseInt",
"Integer",
"sa.nextToken()",
"sa.nextToken",
"sa",
"ary[j][i]=d",
"ary[j][i]",
"ary[j]",
"ary",
"j",
"i",
"d",
"int[][] Opary=new int[r+1][c+1];",
"Opary",
"new int[r+1][c+1]",
"r+1",
"r",
"1",
"c+1",
"c",
"1",
"int sum=0;",
"sum",
"0",
"for(int j=0;j<r+1;j++) {\n\t\t\tfor(int i=0;i<c+1;i++) {\n\t\t\t\tif(i==c && j==r) {\n\t\t\t\t\tfor(int k=0;k<=r;k++) {\n\t\t\t\t\t\tsum=sum+Opary[k][i];\n\t\t\t\t\t}\n\t\t\t\t\tOpary[j][i]=sum;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif(j==r) {\n\t\t\t\t\tfor(int k=0;k<=r;k++) {\n\t\t\t\t\t\tsum=sum+Opary[k][i];\n\t\t\t\t\t}\n\t\t\t\t\tOpary[j][i]=sum;\n\t\t\t\t\tsum=0;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tif(i==c && j!=r) {\n\t\t\t\t\tOpary[j][i]=sum;\n\t\t\t\t\tsum=0;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tOpary[j][i]=ary[j][i];\n\t\t\t\tsum=sum+Opary[j][i];\n\t\t\t}\n\t\t}",
"int j=0;",
"int j=0;",
"j",
"0",
"j<r+1",
"j",
"r+1",
"r",
"1",
"j++",
"j++",
"j",
"{\n\t\t\tfor(int i=0;i<c+1;i++) {\n\t\t\t\tif(i==c && j==r) {\n\t\t\t\t\tfor(int k=0;k<=r;k++) {\n\t\t\t\t\t\tsum=sum+Opary[k][i];\n\t\t\t\t\t}\n\t\t\t\t\tOpary[j][i]=sum;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif(j==r) {\n\t\t\t\t\tfor(int k=0;k<=r;k++) {\n\t\t\t\t\t\tsum=sum+Opary[k][i];\n\t\t\t\t\t}\n\t\t\t\t\tOpary[j][i]=sum;\n\t\t\t\t\tsum=0;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tif(i==c && j!=r) {\n\t\t\t\t\tOpary[j][i]=sum;\n\t\t\t\t\tsum=0;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tOpary[j][i]=ary[j][i];\n\t\t\t\tsum=sum+Opary[j][i];\n\t\t\t}\n\t\t}",
"{\n\t\t\tfor(int i=0;i<c+1;i++) {\n\t\t\t\tif(i==c && j==r) {\n\t\t\t\t\tfor(int k=0;k<=r;k++) {\n\t\t\t\t\t\tsum=sum+Opary[k][i];\n\t\t\t\t\t}\n\t\t\t\t\tOpary[j][i]=sum;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif(j==r) {\n\t\t\t\t\tfor(int k=0;k<=r;k++) {\n\t\t\t\t\t\tsum=sum+Opary[k][i];\n\t\t\t\t\t}\n\t\t\t\t\tOpary[j][i]=sum;\n\t\t\t\t\tsum=0;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tif(i==c && j!=r) {\n\t\t\t\t\tOpary[j][i]=sum;\n\t\t\t\t\tsum=0;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tOpary[j][i]=ary[j][i];\n\t\t\t\tsum=sum+Opary[j][i];\n\t\t\t}\n\t\t}",
"for(int i=0;i<c+1;i++) {\n\t\t\t\tif(i==c && j==r) {\n\t\t\t\t\tfor(int k=0;k<=r;k++) {\n\t\t\t\t\t\tsum=sum+Opary[k][i];\n\t\t\t\t\t}\n\t\t\t\t\tOpary[j][i]=sum;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif(j==r) {\n\t\t\t\t\tfor(int k=0;k<=r;k++) {\n\t\t\t\t\t\tsum=sum+Opary[k][i];\n\t\t\t\t\t}\n\t\t\t\t\tOpary[j][i]=sum;\n\t\t\t\t\tsum=0;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tif(i==c && j!=r) {\n\t\t\t\t\tOpary[j][i]=sum;\n\t\t\t\t\tsum=0;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tOpary[j][i]=ary[j][i];\n\t\t\t\tsum=sum+Opary[j][i];\n\t\t\t}",
"int i=0;",
"int i=0;",
"i",
"0",
"i<c+1",
"i",
"c+1",
"c",
"1",
"i++",
"i++",
"i",
"{\n\t\t\t\tif(i==c && j==r) {\n\t\t\t\t\tfor(int k=0;k<=r;k++) {\n\t\t\t\t\t\tsum=sum+Opary[k][i];\n\t\t\t\t\t}\n\t\t\t\t\tOpary[j][i]=sum;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif(j==r) {\n\t\t\t\t\tfor(int k=0;k<=r;k++) {\n\t\t\t\t\t\tsum=sum+Opary[k][i];\n\t\t\t\t\t}\n\t\t\t\t\tOpary[j][i]=sum;\n\t\t\t\t\tsum=0;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tif(i==c && j!=r) {\n\t\t\t\t\tOpary[j][i]=sum;\n\t\t\t\t\tsum=0;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tOpary[j][i]=ary[j][i];\n\t\t\t\tsum=sum+Opary[j][i];\n\t\t\t}",
"{\n\t\t\t\tif(i==c && j==r) {\n\t\t\t\t\tfor(int k=0;k<=r;k++) {\n\t\t\t\t\t\tsum=sum+Opary[k][i];\n\t\t\t\t\t}\n\t\t\t\t\tOpary[j][i]=sum;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif(j==r) {\n\t\t\t\t\tfor(int k=0;k<=r;k++) {\n\t\t\t\t\t\tsum=sum+Opary[k][i];\n\t\t\t\t\t}\n\t\t\t\t\tOpary[j][i]=sum;\n\t\t\t\t\tsum=0;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tif(i==c && j!=r) {\n\t\t\t\t\tOpary[j][i]=sum;\n\t\t\t\t\tsum=0;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tOpary[j][i]=ary[j][i];\n\t\t\t\tsum=sum+Opary[j][i];\n\t\t\t}",
"if(i==c && j==r) {\n\t\t\t\t\tfor(int k=0;k<=r;k++) {\n\t\t\t\t\t\tsum=sum+Opary[k][i];\n\t\t\t\t\t}\n\t\t\t\t\tOpary[j][i]=sum;\n\t\t\t\t\tbreak;\n\t\t\t\t}",
"i==c && j==r",
"i==c",
"i",
"c",
"j==r",
"j",
"r",
"{\n\t\t\t\t\tfor(int k=0;k<=r;k++) {\n\t\t\t\t\t\tsum=sum+Opary[k][i];\n\t\t\t\t\t}\n\t\t\t\t\tOpary[j][i]=sum;\n\t\t\t\t\tbreak;\n\t\t\t\t}",
"for(int k=0;k<=r;k++) {\n\t\t\t\t\t\tsum=sum+Opary[k][i];\n\t\t\t\t\t}",
"int k=0;",
"int k=0;",
"k",
"0",
"k<=r",
"k",
"r",
"k++",
"k++",
"k",
"{\n\t\t\t\t\t\tsum=sum+Opary[k][i];\n\t\t\t\t\t}",
"{\n\t\t\t\t\t\tsum=sum+Opary[k][i];\n\t\t\t\t\t}",
"sum=sum+Opary[k][i]",
"sum",
"sum+Opary[k][i]",
"sum",
"Opary[k][i]",
"Opary[k]",
"Opary",
"k",
"i",
"Opary[j][i]=sum",
"Opary[j][i]",
"Opary[j]",
"Opary",
"j",
"i",
"sum",
"break;",
"if(j==r) {\n\t\t\t\t\tfor(int k=0;k<=r;k++) {\n\t\t\t\t\t\tsum=sum+Opary[k][i];\n\t\t\t\t\t}\n\t\t\t\t\tOpary[j][i]=sum;\n\t\t\t\t\tsum=0;\n\t\t\t\t\tcontinue;\n\t\t\t\t}",
"j==r",
"j",
"r",
"{\n\t\t\t\t\tfor(int k=0;k<=r;k++) {\n\t\t\t\t\t\tsum=sum+Opary[k][i];\n\t\t\t\t\t}\n\t\t\t\t\tOpary[j][i]=sum;\n\t\t\t\t\tsum=0;\n\t\t\t\t\tcontinue;\n\t\t\t\t}",
"for(int k=0;k<=r;k++) {\n\t\t\t\t\t\tsum=sum+Opary[k][i];\n\t\t\t\t\t}",
"int k=0;",
"int k=0;",
"k",
"0",
"k<=r",
"k",
"r",
"k++",
"k++",
"k",
"{\n\t\t\t\t\t\tsum=sum+Opary[k][i];\n\t\t\t\t\t}",
"{\n\t\t\t\t\t\tsum=sum+Opary[k][i];\n\t\t\t\t\t}",
"sum=sum+Opary[k][i]",
"sum",
"sum+Opary[k][i]",
"sum",
"Opary[k][i]",
"Opary[k]",
"Opary",
"k",
"i",
"Opary[j][i]=sum",
"Opary[j][i]",
"Opary[j]",
"Opary",
"j",
"i",
"sum",
"sum=0",
"sum",
"0",
"continue;",
"if(i==c && j!=r) {\n\t\t\t\t\tOpary[j][i]=sum;\n\t\t\t\t\tsum=0;\n\t\t\t\t\tcontinue;\n\t\t\t\t}",
"i==c && j!=r",
"i==c",
"i",
"c",
"j!=r",
"j",
"r",
"{\n\t\t\t\t\tOpary[j][i]=sum;\n\t\t\t\t\tsum=0;\n\t\t\t\t\tcontinue;\n\t\t\t\t}",
"Opary[j][i]=sum",
"Opary[j][i]",
"Opary[j]",
"Opary",
"j",
"i",
"sum",
"sum=0",
"sum",
"0",
"continue;",
"Opary[j][i]=ary[j][i]",
"Opary[j][i]",
"Opary[j]",
"Opary",
"j",
"i",
"ary[j][i]",
"ary[j]",
"ary",
"j",
"i",
"sum=sum+Opary[j][i]",
"sum",
"sum+Opary[j][i]",
"sum",
"Opary[j][i]",
"Opary[j]",
"Opary",
"j",
"i",
"for(int j=0;j<r+1;j++) {\n\t\t\tfor(int i=0;i<c+1;i++) {\n\t\t\t\tSystem.out.print(Opary[j][i]);\n\t\t\t\tif(i==c) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tSystem.out.print(\" \");\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}",
"int j=0;",
"int j=0;",
"j",
"0",
"j<r+1",
"j",
"r+1",
"r",
"1",
"j++",
"j++",
"j",
"{\n\t\t\tfor(int i=0;i<c+1;i++) {\n\t\t\t\tSystem.out.print(Opary[j][i]);\n\t\t\t\tif(i==c) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tSystem.out.print(\" \");\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}",
"{\n\t\t\tfor(int i=0;i<c+1;i++) {\n\t\t\t\tSystem.out.print(Opary[j][i]);\n\t\t\t\tif(i==c) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tSystem.out.print(\" \");\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}",
"for(int i=0;i<c+1;i++) {\n\t\t\t\tSystem.out.print(Opary[j][i]);\n\t\t\t\tif(i==c) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tSystem.out.print(\" \");\n\t\t\t}",
"int i=0;",
"int i=0;",
"i",
"0",
"i<c+1",
"i",
"c+1",
"c",
"1",
"i++",
"i++",
"i",
"{\n\t\t\t\tSystem.out.print(Opary[j][i]);\n\t\t\t\tif(i==c) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tSystem.out.print(\" \");\n\t\t\t}",
"{\n\t\t\t\tSystem.out.print(Opary[j][i]);\n\t\t\t\tif(i==c) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tSystem.out.print(\" \");\n\t\t\t}",
"System.out.print(Opary[j][i])",
"System.out.print",
"System.out",
"System",
"System.out",
"Opary[j][i]",
"Opary[j]",
"Opary",
"j",
"i",
"if(i==c) {\n\t\t\t\t\tbreak;\n\t\t\t\t}",
"i==c",
"i",
"c",
"{\n\t\t\t\t\tbreak;\n\t\t\t\t}",
"break;",
"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) throws IOException {\n\t\t//入力処理\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\t\tStringTokenizer st=new StringTokenizer(br.readLine());\n\t\tint r=Integer.parseInt(st.nextToken());\n\t\tint c=Integer.parseInt(st.nextToken());\n\n\t\t//配列の作成・入力\n\t\tint[][] ary=new int[r][c];\n\t\tfor(int j=0;j<r;j++) {\n\t\t\tStringTokenizer sa=new StringTokenizer(br.readLine());\n\t\t\tfor(int i=0;i<c;i++) {\n\t\t\t\tint d=Integer.parseInt(sa.nextToken());\n\t\t\t\tary[j][i]=d;\n\t\t\t}\n\t\t}\n\n\t\t//出力する配列作成\n\t\tint[][] Opary=new int[r+1][c+1];\n\t\tint sum=0;\n\t\tfor(int j=0;j<r+1;j++) {\n\t\t\tfor(int i=0;i<c+1;i++) {\n\t\t\t\tif(i==c && j==r) {\n\t\t\t\t\tfor(int k=0;k<=r;k++) {\n\t\t\t\t\t\tsum=sum+Opary[k][i];\n\t\t\t\t\t}\n\t\t\t\t\tOpary[j][i]=sum;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif(j==r) {\n\t\t\t\t\tfor(int k=0;k<=r;k++) {\n\t\t\t\t\t\tsum=sum+Opary[k][i];\n\t\t\t\t\t}\n\t\t\t\t\tOpary[j][i]=sum;\n\t\t\t\t\tsum=0;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tif(i==c && j!=r) {\n\t\t\t\t\tOpary[j][i]=sum;\n\t\t\t\t\tsum=0;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tOpary[j][i]=ary[j][i];\n\t\t\t\tsum=sum+Opary[j][i];\n\t\t\t}\n\t\t}\n\n\t\t//配列の出力\n\t\tfor(int j=0;j<r+1;j++) {\n\t\t\tfor(int i=0;i<c+1;i++) {\n\t\t\t\tSystem.out.print(Opary[j][i]);\n\t\t\t\tif(i==c) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\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) throws IOException {\n\t\t//入力処理\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\t\tStringTokenizer st=new StringTokenizer(br.readLine());\n\t\tint r=Integer.parseInt(st.nextToken());\n\t\tint c=Integer.parseInt(st.nextToken());\n\n\t\t//配列の作成・入力\n\t\tint[][] ary=new int[r][c];\n\t\tfor(int j=0;j<r;j++) {\n\t\t\tStringTokenizer sa=new StringTokenizer(br.readLine());\n\t\t\tfor(int i=0;i<c;i++) {\n\t\t\t\tint d=Integer.parseInt(sa.nextToken());\n\t\t\t\tary[j][i]=d;\n\t\t\t}\n\t\t}\n\n\t\t//出力する配列作成\n\t\tint[][] Opary=new int[r+1][c+1];\n\t\tint sum=0;\n\t\tfor(int j=0;j<r+1;j++) {\n\t\t\tfor(int i=0;i<c+1;i++) {\n\t\t\t\tif(i==c && j==r) {\n\t\t\t\t\tfor(int k=0;k<=r;k++) {\n\t\t\t\t\t\tsum=sum+Opary[k][i];\n\t\t\t\t\t}\n\t\t\t\t\tOpary[j][i]=sum;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif(j==r) {\n\t\t\t\t\tfor(int k=0;k<=r;k++) {\n\t\t\t\t\t\tsum=sum+Opary[k][i];\n\t\t\t\t\t}\n\t\t\t\t\tOpary[j][i]=sum;\n\t\t\t\t\tsum=0;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tif(i==c && j!=r) {\n\t\t\t\t\tOpary[j][i]=sum;\n\t\t\t\t\tsum=0;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tOpary[j][i]=ary[j][i];\n\t\t\t\tsum=sum+Opary[j][i];\n\t\t\t}\n\t\t}\n\n\t\t//配列の出力\n\t\tfor(int j=0;j<r+1;j++) {\n\t\t\tfor(int i=0;i<c+1;i++) {\n\t\t\t\tSystem.out.print(Opary[j][i]);\n\t\t\t\tif(i==c) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\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.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.StringTokenizer;
public class Main {
public static void main(String[] args) throws IOException {
//入力処理
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
StringTokenizer st=new StringTokenizer(br.readLine());
int r=Integer.parseInt(st.nextToken());
int c=Integer.parseInt(st.nextToken());
//配列の作成・入力
int[][] ary=new int[r][c];
for(int j=0;j<r;j++) {
StringTokenizer sa=new StringTokenizer(br.readLine());
for(int i=0;i<c;i++) {
int d=Integer.parseInt(sa.nextToken());
ary[j][i]=d;
}
}
//出力する配列作成
int[][] Opary=new int[r+1][c+1];
int sum=0;
for(int j=0;j<r+1;j++) {
for(int i=0;i<c+1;i++) {
if(i==c && j==r) {
for(int k=0;k<=r;k++) {
sum=sum+Opary[k][i];
}
Opary[j][i]=sum;
break;
}
if(j==r) {
for(int k=0;k<=r;k++) {
sum=sum+Opary[k][i];
}
Opary[j][i]=sum;
sum=0;
continue;
}
if(i==c && j!=r) {
Opary[j][i]=sum;
sum=0;
continue;
}
Opary[j][i]=ary[j][i];
sum=sum+Opary[j][i];
}
}
//配列の出力
for(int j=0;j<r+1;j++) {
for(int i=0;i<c+1;i++) {
System.out.print(Opary[j][i]);
if(i==c) {
break;
}
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,
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,
41,
13,
17,
41,
13,
17,
41,
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,
41,
13,
4,
18,
13,
18,
13,
13,
0,
18,
18,
13,
13,
13,
13,
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,
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,
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
],
[
195,
11
],
[
195,
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
],
[
25,
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
],
[
14,
50
],
[
50,
51
],
[
50,
52
],
[
14,
53
],
[
53,
54
],
[
53,
55
],
[
14,
56
],
[
56,
57
],
[
56,
58
],
[
14,
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
],
[
71,
77
],
[
77,
78
],
[
77,
79
],
[
79,
80
],
[
80,
81
],
[
79,
82
],
[
71,
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
],
[
98,
101
],
[
101,
102
],
[
101,
103
],
[
95,
104
],
[
104,
105
],
[
105,
106
],
[
106,
107
],
[
106,
108
],
[
105,
109
],
[
104,
110
],
[
95,
111
],
[
111,
112
],
[
111,
113
],
[
113,
114
],
[
114,
115
],
[
114,
116
],
[
113,
117
],
[
95,
118
],
[
118,
119
],
[
119,
120
],
[
120,
121
],
[
120,
122
],
[
118,
123
],
[
123,
124
],
[
124,
125
],
[
125,
126
],
[
125,
127
],
[
124,
128
],
[
123,
129
],
[
71,
130
],
[
130,
131
],
[
131,
132
],
[
132,
133
],
[
132,
134
],
[
130,
135
],
[
71,
136
],
[
136,
137
],
[
136,
138
],
[
71,
139
],
[
139,
140
],
[
139,
141
],
[
14,
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
],
[
157,
159
],
[
155,
160
],
[
160,
161
],
[
160,
162
],
[
155,
163
],
[
163,
164
],
[
164,
165
],
[
155,
166
],
[
167,
167
],
[
167,
168
],
[
168,
169
],
[
168,
170
],
[
170,
171
],
[
171,
172
],
[
171,
173
],
[
170,
174
],
[
154,
175
],
[
175,
176
],
[
176,
177
],
[
177,
178
],
[
177,
179
],
[
175,
180
],
[
180,
181
],
[
180,
182
],
[
154,
183
],
[
183,
184
],
[
183,
185
],
[
14,
186
],
[
186,
187
],
[
187,
188
],
[
188,
189
],
[
188,
190
],
[
186,
191
],
[
12,
192
],
[
192,
193
],
[
0,
194
],
[
194,
195
],
[
194,
196
]
] | [
"\nimport 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 input = new BufferedReader(new InputStreamReader(System.in));\n\n\t\tString first_line = input.readLine();\n\n\t\t// ?????°??¨?????°?????????\n\t\tString[] array_of_li_col = first_line.split(\" \");\n\n\t\t// ?????°\n\t\tint line_r = Integer.parseInt(array_of_li_col[0]);\n\n\t\t// ?????°\n\t\tint column_c = Integer.parseInt(array_of_li_col[1]);\n\t\t// ??¨????????????????¬????????????????\n\t\tint graph_array[][] = new int[line_r][column_c];\n\n\t\tint column_sum = 0;\n\n\t\tint line_sum=0;\n\n\t\tint All_sum=0;\n\n\t\t// ??¨?????????????????¨?????¨??????????¨???????????????¨????????¨??????????¬??????????\n\t\tfor (int line_spot = 0; line_spot < line_r; line_spot++) {\n\n\n\t\t\tString input_column = input.readLine();\n\n\t\t\tString[] array_of_column = input_column.split(\" \");\n\n\n\t\t\tfor (int column_spot = 0; column_spot < column_c; column_spot++) {\n\n\t\t\t\tint element_column = Integer.parseInt(array_of_column[column_spot]);\n\n\t\t\t\tgraph_array[line_spot][column_spot] = element_column;\n\n\t\t\t\tcolumn_sum+=graph_array[line_spot][column_spot] ;\n\n\n\n\n\t\t\t\tSystem.out.print(graph_array[line_spot][column_spot]+\" \");\n\t\t\t}\n\n\t\t\tSystem.out.println(column_sum);\n\t\t\tAll_sum+=column_sum;\n\t\t\tcolumn_sum = 0;\n\n\t\t}\n\n\t\tfor(int column_spot=0; column_spot<column_c; column_spot++){\n\t\t\tfor(int line_spot = 0; line_spot < line_r; line_spot++){\n\t\t\t\tline_sum+=graph_array[line_spot][column_spot] ;\n\t\t\t}\n\t\t\tSystem.out.print(line_sum+\" \");\n\n\t\t\tline_sum=0;\n\t\t}\n\t\tSystem.out.println(All_sum);\n\n\t}\n\n}",
"import java.io.BufferedReader;",
"BufferedReader",
"java.io",
"import java.io.IOException;",
"IOException",
"java.io",
"import java.io.InputStreamReader;",
"InputStreamReader",
"java.io",
"public class Main{\n\tpublic static void main(String[] args) throws IOException {\n\t\tBufferedReader input = new BufferedReader(new InputStreamReader(System.in));\n\n\t\tString first_line = input.readLine();\n\n\t\t// ?????°??¨?????°?????????\n\t\tString[] array_of_li_col = first_line.split(\" \");\n\n\t\t// ?????°\n\t\tint line_r = Integer.parseInt(array_of_li_col[0]);\n\n\t\t// ?????°\n\t\tint column_c = Integer.parseInt(array_of_li_col[1]);\n\t\t// ??¨????????????????¬????????????????\n\t\tint graph_array[][] = new int[line_r][column_c];\n\n\t\tint column_sum = 0;\n\n\t\tint line_sum=0;\n\n\t\tint All_sum=0;\n\n\t\t// ??¨?????????????????¨?????¨??????????¨???????????????¨????????¨??????????¬??????????\n\t\tfor (int line_spot = 0; line_spot < line_r; line_spot++) {\n\n\n\t\t\tString input_column = input.readLine();\n\n\t\t\tString[] array_of_column = input_column.split(\" \");\n\n\n\t\t\tfor (int column_spot = 0; column_spot < column_c; column_spot++) {\n\n\t\t\t\tint element_column = Integer.parseInt(array_of_column[column_spot]);\n\n\t\t\t\tgraph_array[line_spot][column_spot] = element_column;\n\n\t\t\t\tcolumn_sum+=graph_array[line_spot][column_spot] ;\n\n\n\n\n\t\t\t\tSystem.out.print(graph_array[line_spot][column_spot]+\" \");\n\t\t\t}\n\n\t\t\tSystem.out.println(column_sum);\n\t\t\tAll_sum+=column_sum;\n\t\t\tcolumn_sum = 0;\n\n\t\t}\n\n\t\tfor(int column_spot=0; column_spot<column_c; column_spot++){\n\t\t\tfor(int line_spot = 0; line_spot < line_r; line_spot++){\n\t\t\t\tline_sum+=graph_array[line_spot][column_spot] ;\n\t\t\t}\n\t\t\tSystem.out.print(line_sum+\" \");\n\n\t\t\tline_sum=0;\n\t\t}\n\t\tSystem.out.println(All_sum);\n\n\t}\n\n}",
"Main",
"public static void main(String[] args) throws IOException {\n\t\tBufferedReader input = new BufferedReader(new InputStreamReader(System.in));\n\n\t\tString first_line = input.readLine();\n\n\t\t// ?????°??¨?????°?????????\n\t\tString[] array_of_li_col = first_line.split(\" \");\n\n\t\t// ?????°\n\t\tint line_r = Integer.parseInt(array_of_li_col[0]);\n\n\t\t// ?????°\n\t\tint column_c = Integer.parseInt(array_of_li_col[1]);\n\t\t// ??¨????????????????¬????????????????\n\t\tint graph_array[][] = new int[line_r][column_c];\n\n\t\tint column_sum = 0;\n\n\t\tint line_sum=0;\n\n\t\tint All_sum=0;\n\n\t\t// ??¨?????????????????¨?????¨??????????¨???????????????¨????????¨??????????¬??????????\n\t\tfor (int line_spot = 0; line_spot < line_r; line_spot++) {\n\n\n\t\t\tString input_column = input.readLine();\n\n\t\t\tString[] array_of_column = input_column.split(\" \");\n\n\n\t\t\tfor (int column_spot = 0; column_spot < column_c; column_spot++) {\n\n\t\t\t\tint element_column = Integer.parseInt(array_of_column[column_spot]);\n\n\t\t\t\tgraph_array[line_spot][column_spot] = element_column;\n\n\t\t\t\tcolumn_sum+=graph_array[line_spot][column_spot] ;\n\n\n\n\n\t\t\t\tSystem.out.print(graph_array[line_spot][column_spot]+\" \");\n\t\t\t}\n\n\t\t\tSystem.out.println(column_sum);\n\t\t\tAll_sum+=column_sum;\n\t\t\tcolumn_sum = 0;\n\n\t\t}\n\n\t\tfor(int column_spot=0; column_spot<column_c; column_spot++){\n\t\t\tfor(int line_spot = 0; line_spot < line_r; line_spot++){\n\t\t\t\tline_sum+=graph_array[line_spot][column_spot] ;\n\t\t\t}\n\t\t\tSystem.out.print(line_sum+\" \");\n\n\t\t\tline_sum=0;\n\t\t}\n\t\tSystem.out.println(All_sum);\n\n\t}",
"main",
"{\n\t\tBufferedReader input = new BufferedReader(new InputStreamReader(System.in));\n\n\t\tString first_line = input.readLine();\n\n\t\t// ?????°??¨?????°?????????\n\t\tString[] array_of_li_col = first_line.split(\" \");\n\n\t\t// ?????°\n\t\tint line_r = Integer.parseInt(array_of_li_col[0]);\n\n\t\t// ?????°\n\t\tint column_c = Integer.parseInt(array_of_li_col[1]);\n\t\t// ??¨????????????????¬????????????????\n\t\tint graph_array[][] = new int[line_r][column_c];\n\n\t\tint column_sum = 0;\n\n\t\tint line_sum=0;\n\n\t\tint All_sum=0;\n\n\t\t// ??¨?????????????????¨?????¨??????????¨???????????????¨????????¨??????????¬??????????\n\t\tfor (int line_spot = 0; line_spot < line_r; line_spot++) {\n\n\n\t\t\tString input_column = input.readLine();\n\n\t\t\tString[] array_of_column = input_column.split(\" \");\n\n\n\t\t\tfor (int column_spot = 0; column_spot < column_c; column_spot++) {\n\n\t\t\t\tint element_column = Integer.parseInt(array_of_column[column_spot]);\n\n\t\t\t\tgraph_array[line_spot][column_spot] = element_column;\n\n\t\t\t\tcolumn_sum+=graph_array[line_spot][column_spot] ;\n\n\n\n\n\t\t\t\tSystem.out.print(graph_array[line_spot][column_spot]+\" \");\n\t\t\t}\n\n\t\t\tSystem.out.println(column_sum);\n\t\t\tAll_sum+=column_sum;\n\t\t\tcolumn_sum = 0;\n\n\t\t}\n\n\t\tfor(int column_spot=0; column_spot<column_c; column_spot++){\n\t\t\tfor(int line_spot = 0; line_spot < line_r; line_spot++){\n\t\t\t\tline_sum+=graph_array[line_spot][column_spot] ;\n\t\t\t}\n\t\t\tSystem.out.print(line_sum+\" \");\n\n\t\t\tline_sum=0;\n\t\t}\n\t\tSystem.out.println(All_sum);\n\n\t}",
"BufferedReader input = new BufferedReader(new InputStreamReader(System.in));",
"input",
"new BufferedReader(new InputStreamReader(System.in))",
"String first_line = input.readLine();",
"first_line",
"input.readLine()",
"input.readLine",
"input",
"String[] array_of_li_col = first_line.split(\" \");",
"array_of_li_col",
"first_line.split(\" \")",
"first_line.split",
"first_line",
"\" \"",
"int line_r = Integer.parseInt(array_of_li_col[0]);",
"line_r",
"Integer.parseInt(array_of_li_col[0])",
"Integer.parseInt",
"Integer",
"array_of_li_col[0]",
"array_of_li_col",
"0",
"int column_c = Integer.parseInt(array_of_li_col[1]);",
"column_c",
"Integer.parseInt(array_of_li_col[1])",
"Integer.parseInt",
"Integer",
"array_of_li_col[1]",
"array_of_li_col",
"1",
"int graph_array[][] = new int[line_r][column_c];",
"graph_array",
"new int[line_r][column_c]",
"line_r",
"column_c",
"int column_sum = 0;",
"column_sum",
"0",
"int line_sum=0;",
"line_sum",
"0",
"int All_sum=0;",
"All_sum",
"0",
"for (int line_spot = 0; line_spot < line_r; line_spot++) {\n\n\n\t\t\tString input_column = input.readLine();\n\n\t\t\tString[] array_of_column = input_column.split(\" \");\n\n\n\t\t\tfor (int column_spot = 0; column_spot < column_c; column_spot++) {\n\n\t\t\t\tint element_column = Integer.parseInt(array_of_column[column_spot]);\n\n\t\t\t\tgraph_array[line_spot][column_spot] = element_column;\n\n\t\t\t\tcolumn_sum+=graph_array[line_spot][column_spot] ;\n\n\n\n\n\t\t\t\tSystem.out.print(graph_array[line_spot][column_spot]+\" \");\n\t\t\t}\n\n\t\t\tSystem.out.println(column_sum);\n\t\t\tAll_sum+=column_sum;\n\t\t\tcolumn_sum = 0;\n\n\t\t}",
"int line_spot = 0;",
"int line_spot = 0;",
"line_spot",
"0",
"line_spot < line_r",
"line_spot",
"line_r",
"line_spot++",
"line_spot++",
"line_spot",
"{\n\n\n\t\t\tString input_column = input.readLine();\n\n\t\t\tString[] array_of_column = input_column.split(\" \");\n\n\n\t\t\tfor (int column_spot = 0; column_spot < column_c; column_spot++) {\n\n\t\t\t\tint element_column = Integer.parseInt(array_of_column[column_spot]);\n\n\t\t\t\tgraph_array[line_spot][column_spot] = element_column;\n\n\t\t\t\tcolumn_sum+=graph_array[line_spot][column_spot] ;\n\n\n\n\n\t\t\t\tSystem.out.print(graph_array[line_spot][column_spot]+\" \");\n\t\t\t}\n\n\t\t\tSystem.out.println(column_sum);\n\t\t\tAll_sum+=column_sum;\n\t\t\tcolumn_sum = 0;\n\n\t\t}",
"{\n\n\n\t\t\tString input_column = input.readLine();\n\n\t\t\tString[] array_of_column = input_column.split(\" \");\n\n\n\t\t\tfor (int column_spot = 0; column_spot < column_c; column_spot++) {\n\n\t\t\t\tint element_column = Integer.parseInt(array_of_column[column_spot]);\n\n\t\t\t\tgraph_array[line_spot][column_spot] = element_column;\n\n\t\t\t\tcolumn_sum+=graph_array[line_spot][column_spot] ;\n\n\n\n\n\t\t\t\tSystem.out.print(graph_array[line_spot][column_spot]+\" \");\n\t\t\t}\n\n\t\t\tSystem.out.println(column_sum);\n\t\t\tAll_sum+=column_sum;\n\t\t\tcolumn_sum = 0;\n\n\t\t}",
"String input_column = input.readLine();",
"input_column",
"input.readLine()",
"input.readLine",
"input",
"String[] array_of_column = input_column.split(\" \");",
"array_of_column",
"input_column.split(\" \")",
"input_column.split",
"input_column",
"\" \"",
"for (int column_spot = 0; column_spot < column_c; column_spot++) {\n\n\t\t\t\tint element_column = Integer.parseInt(array_of_column[column_spot]);\n\n\t\t\t\tgraph_array[line_spot][column_spot] = element_column;\n\n\t\t\t\tcolumn_sum+=graph_array[line_spot][column_spot] ;\n\n\n\n\n\t\t\t\tSystem.out.print(graph_array[line_spot][column_spot]+\" \");\n\t\t\t}",
"int column_spot = 0;",
"int column_spot = 0;",
"column_spot",
"0",
"column_spot < column_c",
"column_spot",
"column_c",
"column_spot++",
"column_spot++",
"column_spot",
"{\n\n\t\t\t\tint element_column = Integer.parseInt(array_of_column[column_spot]);\n\n\t\t\t\tgraph_array[line_spot][column_spot] = element_column;\n\n\t\t\t\tcolumn_sum+=graph_array[line_spot][column_spot] ;\n\n\n\n\n\t\t\t\tSystem.out.print(graph_array[line_spot][column_spot]+\" \");\n\t\t\t}",
"{\n\n\t\t\t\tint element_column = Integer.parseInt(array_of_column[column_spot]);\n\n\t\t\t\tgraph_array[line_spot][column_spot] = element_column;\n\n\t\t\t\tcolumn_sum+=graph_array[line_spot][column_spot] ;\n\n\n\n\n\t\t\t\tSystem.out.print(graph_array[line_spot][column_spot]+\" \");\n\t\t\t}",
"int element_column = Integer.parseInt(array_of_column[column_spot]);",
"element_column",
"Integer.parseInt(array_of_column[column_spot])",
"Integer.parseInt",
"Integer",
"array_of_column[column_spot]",
"array_of_column",
"column_spot",
"graph_array[line_spot][column_spot] = element_column",
"graph_array[line_spot][column_spot]",
"graph_array[line_spot]",
"graph_array",
"line_spot",
"column_spot",
"element_column",
"column_sum+=graph_array[line_spot][column_spot]",
"column_sum",
"graph_array[line_spot][column_spot]",
"graph_array[line_spot]",
"graph_array",
"line_spot",
"column_spot",
"System.out.print(graph_array[line_spot][column_spot]+\" \")",
"System.out.print",
"System.out",
"System",
"System.out",
"graph_array[line_spot][column_spot]+\" \"",
"graph_array[line_spot][column_spot]",
"graph_array[line_spot]",
"graph_array",
"line_spot",
"column_spot",
"\" \"",
"System.out.println(column_sum)",
"System.out.println",
"System.out",
"System",
"System.out",
"column_sum",
"All_sum+=column_sum",
"All_sum",
"column_sum",
"column_sum = 0",
"column_sum",
"0",
"for(int column_spot=0; column_spot<column_c; column_spot++){\n\t\t\tfor(int line_spot = 0; line_spot < line_r; line_spot++){\n\t\t\t\tline_sum+=graph_array[line_spot][column_spot] ;\n\t\t\t}\n\t\t\tSystem.out.print(line_sum+\" \");\n\n\t\t\tline_sum=0;\n\t\t}",
"int column_spot=0;",
"int column_spot=0;",
"column_spot",
"0",
"column_spot<column_c",
"column_spot",
"column_c",
"column_spot++",
"column_spot++",
"column_spot",
"{\n\t\t\tfor(int line_spot = 0; line_spot < line_r; line_spot++){\n\t\t\t\tline_sum+=graph_array[line_spot][column_spot] ;\n\t\t\t}\n\t\t\tSystem.out.print(line_sum+\" \");\n\n\t\t\tline_sum=0;\n\t\t}",
"{\n\t\t\tfor(int line_spot = 0; line_spot < line_r; line_spot++){\n\t\t\t\tline_sum+=graph_array[line_spot][column_spot] ;\n\t\t\t}\n\t\t\tSystem.out.print(line_sum+\" \");\n\n\t\t\tline_sum=0;\n\t\t}",
"for(int line_spot = 0; line_spot < line_r; line_spot++){\n\t\t\t\tline_sum+=graph_array[line_spot][column_spot] ;\n\t\t\t}",
"int line_spot = 0;",
"int line_spot = 0;",
"line_spot",
"0",
"line_spot < line_r",
"line_spot",
"line_r",
"line_spot++",
"line_spot++",
"line_spot",
"{\n\t\t\t\tline_sum+=graph_array[line_spot][column_spot] ;\n\t\t\t}",
"{\n\t\t\t\tline_sum+=graph_array[line_spot][column_spot] ;\n\t\t\t}",
"line_sum+=graph_array[line_spot][column_spot]",
"line_sum",
"graph_array[line_spot][column_spot]",
"graph_array[line_spot]",
"graph_array",
"line_spot",
"column_spot",
"System.out.print(line_sum+\" \")",
"System.out.print",
"System.out",
"System",
"System.out",
"line_sum+\" \"",
"line_sum",
"\" \"",
"line_sum=0",
"line_sum",
"0",
"System.out.println(All_sum)",
"System.out.println",
"System.out",
"System",
"System.out",
"All_sum",
"String[] args",
"args",
"public class Main{\n\tpublic static void main(String[] args) throws IOException {\n\t\tBufferedReader input = new BufferedReader(new InputStreamReader(System.in));\n\n\t\tString first_line = input.readLine();\n\n\t\t// ?????°??¨?????°?????????\n\t\tString[] array_of_li_col = first_line.split(\" \");\n\n\t\t// ?????°\n\t\tint line_r = Integer.parseInt(array_of_li_col[0]);\n\n\t\t// ?????°\n\t\tint column_c = Integer.parseInt(array_of_li_col[1]);\n\t\t// ??¨????????????????¬????????????????\n\t\tint graph_array[][] = new int[line_r][column_c];\n\n\t\tint column_sum = 0;\n\n\t\tint line_sum=0;\n\n\t\tint All_sum=0;\n\n\t\t// ??¨?????????????????¨?????¨??????????¨???????????????¨????????¨??????????¬??????????\n\t\tfor (int line_spot = 0; line_spot < line_r; line_spot++) {\n\n\n\t\t\tString input_column = input.readLine();\n\n\t\t\tString[] array_of_column = input_column.split(\" \");\n\n\n\t\t\tfor (int column_spot = 0; column_spot < column_c; column_spot++) {\n\n\t\t\t\tint element_column = Integer.parseInt(array_of_column[column_spot]);\n\n\t\t\t\tgraph_array[line_spot][column_spot] = element_column;\n\n\t\t\t\tcolumn_sum+=graph_array[line_spot][column_spot] ;\n\n\n\n\n\t\t\t\tSystem.out.print(graph_array[line_spot][column_spot]+\" \");\n\t\t\t}\n\n\t\t\tSystem.out.println(column_sum);\n\t\t\tAll_sum+=column_sum;\n\t\t\tcolumn_sum = 0;\n\n\t\t}\n\n\t\tfor(int column_spot=0; column_spot<column_c; column_spot++){\n\t\t\tfor(int line_spot = 0; line_spot < line_r; line_spot++){\n\t\t\t\tline_sum+=graph_array[line_spot][column_spot] ;\n\t\t\t}\n\t\t\tSystem.out.print(line_sum+\" \");\n\n\t\t\tline_sum=0;\n\t\t}\n\t\tSystem.out.println(All_sum);\n\n\t}\n\n}",
"public class Main{\n\tpublic static void main(String[] args) throws IOException {\n\t\tBufferedReader input = new BufferedReader(new InputStreamReader(System.in));\n\n\t\tString first_line = input.readLine();\n\n\t\t// ?????°??¨?????°?????????\n\t\tString[] array_of_li_col = first_line.split(\" \");\n\n\t\t// ?????°\n\t\tint line_r = Integer.parseInt(array_of_li_col[0]);\n\n\t\t// ?????°\n\t\tint column_c = Integer.parseInt(array_of_li_col[1]);\n\t\t// ??¨????????????????¬????????????????\n\t\tint graph_array[][] = new int[line_r][column_c];\n\n\t\tint column_sum = 0;\n\n\t\tint line_sum=0;\n\n\t\tint All_sum=0;\n\n\t\t// ??¨?????????????????¨?????¨??????????¨???????????????¨????????¨??????????¬??????????\n\t\tfor (int line_spot = 0; line_spot < line_r; line_spot++) {\n\n\n\t\t\tString input_column = input.readLine();\n\n\t\t\tString[] array_of_column = input_column.split(\" \");\n\n\n\t\t\tfor (int column_spot = 0; column_spot < column_c; column_spot++) {\n\n\t\t\t\tint element_column = Integer.parseInt(array_of_column[column_spot]);\n\n\t\t\t\tgraph_array[line_spot][column_spot] = element_column;\n\n\t\t\t\tcolumn_sum+=graph_array[line_spot][column_spot] ;\n\n\n\n\n\t\t\t\tSystem.out.print(graph_array[line_spot][column_spot]+\" \");\n\t\t\t}\n\n\t\t\tSystem.out.println(column_sum);\n\t\t\tAll_sum+=column_sum;\n\t\t\tcolumn_sum = 0;\n\n\t\t}\n\n\t\tfor(int column_spot=0; column_spot<column_c; column_spot++){\n\t\t\tfor(int line_spot = 0; line_spot < line_r; line_spot++){\n\t\t\t\tline_sum+=graph_array[line_spot][column_spot] ;\n\t\t\t}\n\t\t\tSystem.out.print(line_sum+\" \");\n\n\t\t\tline_sum=0;\n\t\t}\n\t\tSystem.out.println(All_sum);\n\n\t}\n\n}",
"Main"
] |
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class Main{
public static void main(String[] args) throws IOException {
BufferedReader input = new BufferedReader(new InputStreamReader(System.in));
String first_line = input.readLine();
// ?????°??¨?????°?????????
String[] array_of_li_col = first_line.split(" ");
// ?????°
int line_r = Integer.parseInt(array_of_li_col[0]);
// ?????°
int column_c = Integer.parseInt(array_of_li_col[1]);
// ??¨????????????????¬????????????????
int graph_array[][] = new int[line_r][column_c];
int column_sum = 0;
int line_sum=0;
int All_sum=0;
// ??¨?????????????????¨?????¨??????????¨???????????????¨????????¨??????????¬??????????
for (int line_spot = 0; line_spot < line_r; line_spot++) {
String input_column = input.readLine();
String[] array_of_column = input_column.split(" ");
for (int column_spot = 0; column_spot < column_c; column_spot++) {
int element_column = Integer.parseInt(array_of_column[column_spot]);
graph_array[line_spot][column_spot] = element_column;
column_sum+=graph_array[line_spot][column_spot] ;
System.out.print(graph_array[line_spot][column_spot]+" ");
}
System.out.println(column_sum);
All_sum+=column_sum;
column_sum = 0;
}
for(int column_spot=0; column_spot<column_c; column_spot++){
for(int line_spot = 0; line_spot < line_r; line_spot++){
line_sum+=graph_array[line_spot][column_spot] ;
}
System.out.print(line_sum+" ");
line_sum=0;
}
System.out.println(All_sum);
}
} |
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
13,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
13,
41,
13,
20,
13,
13,
14,
2,
2,
17,
13,
2,
13,
17,
30,
14,
2,
2,
17,
13,
2,
13,
17,
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,
41,
13,
4,
18,
13,
13,
0,
18,
18,
13,
13,
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,
4,
18,
18,
13,
13,
2,
18,
18,
13,
13,
13,
17,
0,
13,
18,
18,
13,
13,
13,
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
],
[
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
],
[
8,
28
],
[
28,
29
],
[
28,
30
],
[
30,
31
],
[
31,
32
],
[
30,
33
],
[
8,
34
],
[
34,
35
],
[
34,
36
],
[
8,
39
],
[
39,
40
],
[
40,
41
],
[
41,
42
],
[
41,
43
],
[
40,
44
],
[
44,
45
],
[
44,
46
],
[
39,
47
],
[
47,
48
],
[
48,
49
],
[
49,
50
],
[
50,
51
],
[
50,
52
],
[
49,
53
],
[
53,
54
],
[
53,
55
],
[
48,
56
],
[
56,
57
],
[
57,
58
],
[
58,
59
],
[
59,
60
],
[
59,
61
],
[
57,
62
],
[
62,
63
],
[
62,
64
],
[
57,
65
],
[
65,
66
],
[
66,
67
],
[
57,
68
],
[
69,
69
],
[
69,
70
],
[
70,
71
],
[
71,
72
],
[
72,
73
],
[
72,
74
],
[
70,
75
],
[
75,
76
],
[
75,
77
],
[
70,
78
],
[
78,
79
],
[
79,
80
],
[
70,
81
],
[
82,
82
],
[
82,
83
],
[
83,
84
],
[
83,
85
],
[
85,
86
],
[
86,
87
],
[
82,
88
],
[
88,
89
],
[
88,
90
],
[
90,
91
],
[
91,
92
],
[
90,
93
],
[
82,
94
],
[
94,
95
],
[
95,
96
],
[
96,
97
],
[
96,
98
],
[
95,
99
],
[
94,
100
],
[
56,
101
],
[
101,
102
],
[
101,
103
],
[
56,
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
],
[
132,
132
],
[
132,
133
],
[
133,
134
],
[
134,
135
],
[
135,
136
],
[
135,
137
],
[
133,
138
],
[
138,
139
],
[
139,
140
],
[
140,
141
],
[
140,
142
],
[
139,
143
],
[
138,
144
],
[
132,
145
],
[
145,
146
],
[
145,
147
],
[
147,
148
],
[
148,
149
],
[
148,
150
],
[
147,
151
],
[
116,
152
],
[
152,
153
],
[
152,
154
],
[
116,
155
],
[
155,
156
],
[
156,
157
],
[
157,
158
],
[
157,
159
],
[
155,
160
],
[
56,
161
],
[
161,
162
],
[
162,
163
],
[
163,
164
],
[
163,
165
],
[
161,
166
],
[
166,
167
],
[
166,
168
],
[
161,
169
],
[
169,
170
],
[
170,
171
],
[
161,
172
],
[
173,
173
],
[
173,
174
],
[
174,
175
],
[
174,
176
],
[
173,
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
],
[
190,
192
],
[
192,
193
],
[
193,
194
],
[
193,
195
],
[
192,
196
],
[
173,
197
],
[
197,
198
],
[
198,
199
],
[
199,
200
],
[
199,
201
],
[
197,
202
],
[
202,
203
],
[
202,
204
],
[
56,
205
],
[
205,
206
],
[
206,
207
],
[
207,
208
],
[
207,
209
],
[
205,
210
],
[
6,
211
],
[
211,
212
]
] | [
"\nimport 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\t//表の行数rと列数cを読み取る\n\t\tString s1 = sc.next();\n\t\tint r = Integer.parseInt(s1);\n\t\tString s2 = sc.next();\n\t\tint c = Integer.parseInt(s2);\n\t\t//表を値を配列に受け取る\n\t\tint a[][] = new int[r][c];\n\t\t\n\t\t//cとrが条件範囲内か確認\n\t\tif(1 <= r && r <= 100){\n\t\t\tif(1 <= c && c <= 100){\n\t\t\t\t\n\t\t\t\t//配列に格納していく\n\t\t\t\tfor(int i = 0; i < r; i++ ){\n\t\t\t\t\tfor(int j = 0; j < c; j++){\n\t\t\t\t\t\tString s3 = sc.next();\n\t\t\t\t\t\tint k = Integer.parseInt(s3);\n\t\t\t\t\t\ta[i][j] = k;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tint total = 0;\n\t\t\t\t//入力された表の値と行ごとの合計値の表示\n\t\t\t\tfor(int i = 0; i < r; i++ ){\n\t\t\t\t\tint sum = 0;\n\t\t\t\t\tfor(int j = 0; j < c; j++){\n\t\t\t\t\t\tSystem.out.print(a[i][j] + \" \");\n\t\t\t\t\t\tsum += a[i][j];\n\t\t\t\t\t}\n\t\t\t\t\ttotal += sum;\n\t\t\t\t\tSystem.out.println( sum );\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//入力された表の値の列ごとの合計値の表示\n\t\t\t\tfor(int j = 0; j < c; j++ ){\n\t\t\t\t\tint sum = 0;\n\t\t\t\t\tfor(int i = 0; i < r; i++){\n\t\t\t\t\t\tsum += a[i][j];\n\t\t\t\t\t}\n\t\t\t\t\tSystem.out.print( sum + \" \");\n\t\t\t\t}\n\t\t\t\tSystem.out.println( total );\n\t\t\t}\n\t\t}\n\t}\n\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\t//表の行数rと列数cを読み取る\n\t\tString s1 = sc.next();\n\t\tint r = Integer.parseInt(s1);\n\t\tString s2 = sc.next();\n\t\tint c = Integer.parseInt(s2);\n\t\t//表を値を配列に受け取る\n\t\tint a[][] = new int[r][c];\n\t\t\n\t\t//cとrが条件範囲内か確認\n\t\tif(1 <= r && r <= 100){\n\t\t\tif(1 <= c && c <= 100){\n\t\t\t\t\n\t\t\t\t//配列に格納していく\n\t\t\t\tfor(int i = 0; i < r; i++ ){\n\t\t\t\t\tfor(int j = 0; j < c; j++){\n\t\t\t\t\t\tString s3 = sc.next();\n\t\t\t\t\t\tint k = Integer.parseInt(s3);\n\t\t\t\t\t\ta[i][j] = k;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tint total = 0;\n\t\t\t\t//入力された表の値と行ごとの合計値の表示\n\t\t\t\tfor(int i = 0; i < r; i++ ){\n\t\t\t\t\tint sum = 0;\n\t\t\t\t\tfor(int j = 0; j < c; j++){\n\t\t\t\t\t\tSystem.out.print(a[i][j] + \" \");\n\t\t\t\t\t\tsum += a[i][j];\n\t\t\t\t\t}\n\t\t\t\t\ttotal += sum;\n\t\t\t\t\tSystem.out.println( sum );\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//入力された表の値の列ごとの合計値の表示\n\t\t\t\tfor(int j = 0; j < c; j++ ){\n\t\t\t\t\tint sum = 0;\n\t\t\t\t\tfor(int i = 0; i < r; i++){\n\t\t\t\t\t\tsum += a[i][j];\n\t\t\t\t\t}\n\t\t\t\t\tSystem.out.print( sum + \" \");\n\t\t\t\t}\n\t\t\t\tSystem.out.println( total );\n\t\t\t}\n\t\t}\n\t}\n\n}",
"Main",
"public static void main(String args[]){\n\t\t\n\t\tScanner sc = new Scanner(System.in);\n\t\t\n\t\t//表の行数rと列数cを読み取る\n\t\tString s1 = sc.next();\n\t\tint r = Integer.parseInt(s1);\n\t\tString s2 = sc.next();\n\t\tint c = Integer.parseInt(s2);\n\t\t//表を値を配列に受け取る\n\t\tint a[][] = new int[r][c];\n\t\t\n\t\t//cとrが条件範囲内か確認\n\t\tif(1 <= r && r <= 100){\n\t\t\tif(1 <= c && c <= 100){\n\t\t\t\t\n\t\t\t\t//配列に格納していく\n\t\t\t\tfor(int i = 0; i < r; i++ ){\n\t\t\t\t\tfor(int j = 0; j < c; j++){\n\t\t\t\t\t\tString s3 = sc.next();\n\t\t\t\t\t\tint k = Integer.parseInt(s3);\n\t\t\t\t\t\ta[i][j] = k;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tint total = 0;\n\t\t\t\t//入力された表の値と行ごとの合計値の表示\n\t\t\t\tfor(int i = 0; i < r; i++ ){\n\t\t\t\t\tint sum = 0;\n\t\t\t\t\tfor(int j = 0; j < c; j++){\n\t\t\t\t\t\tSystem.out.print(a[i][j] + \" \");\n\t\t\t\t\t\tsum += a[i][j];\n\t\t\t\t\t}\n\t\t\t\t\ttotal += sum;\n\t\t\t\t\tSystem.out.println( sum );\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//入力された表の値の列ごとの合計値の表示\n\t\t\t\tfor(int j = 0; j < c; j++ ){\n\t\t\t\t\tint sum = 0;\n\t\t\t\t\tfor(int i = 0; i < r; i++){\n\t\t\t\t\t\tsum += a[i][j];\n\t\t\t\t\t}\n\t\t\t\t\tSystem.out.print( sum + \" \");\n\t\t\t\t}\n\t\t\t\tSystem.out.println( total );\n\t\t\t}\n\t\t}\n\t}",
"main",
"{\n\t\t\n\t\tScanner sc = new Scanner(System.in);\n\t\t\n\t\t//表の行数rと列数cを読み取る\n\t\tString s1 = sc.next();\n\t\tint r = Integer.parseInt(s1);\n\t\tString s2 = sc.next();\n\t\tint c = Integer.parseInt(s2);\n\t\t//表を値を配列に受け取る\n\t\tint a[][] = new int[r][c];\n\t\t\n\t\t//cとrが条件範囲内か確認\n\t\tif(1 <= r && r <= 100){\n\t\t\tif(1 <= c && c <= 100){\n\t\t\t\t\n\t\t\t\t//配列に格納していく\n\t\t\t\tfor(int i = 0; i < r; i++ ){\n\t\t\t\t\tfor(int j = 0; j < c; j++){\n\t\t\t\t\t\tString s3 = sc.next();\n\t\t\t\t\t\tint k = Integer.parseInt(s3);\n\t\t\t\t\t\ta[i][j] = k;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tint total = 0;\n\t\t\t\t//入力された表の値と行ごとの合計値の表示\n\t\t\t\tfor(int i = 0; i < r; i++ ){\n\t\t\t\t\tint sum = 0;\n\t\t\t\t\tfor(int j = 0; j < c; j++){\n\t\t\t\t\t\tSystem.out.print(a[i][j] + \" \");\n\t\t\t\t\t\tsum += a[i][j];\n\t\t\t\t\t}\n\t\t\t\t\ttotal += sum;\n\t\t\t\t\tSystem.out.println( sum );\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//入力された表の値の列ごとの合計値の表示\n\t\t\t\tfor(int j = 0; j < c; j++ ){\n\t\t\t\t\tint sum = 0;\n\t\t\t\t\tfor(int i = 0; i < r; i++){\n\t\t\t\t\t\tsum += a[i][j];\n\t\t\t\t\t}\n\t\t\t\t\tSystem.out.print( sum + \" \");\n\t\t\t\t}\n\t\t\t\tSystem.out.println( total );\n\t\t\t}\n\t\t}\n\t}",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"String s1 = sc.next();",
"s1",
"sc.next()",
"sc.next",
"sc",
"int r = Integer.parseInt(s1);",
"r",
"Integer.parseInt(s1)",
"Integer.parseInt",
"Integer",
"s1",
"String s2 = sc.next();",
"s2",
"sc.next()",
"sc.next",
"sc",
"int c = Integer.parseInt(s2);",
"c",
"Integer.parseInt(s2)",
"Integer.parseInt",
"Integer",
"s2",
"int a[][] = new int[r][c];",
"a",
"new int[r][c]",
"r",
"c",
"if(1 <= r && r <= 100){\n\t\t\tif(1 <= c && c <= 100){\n\t\t\t\t\n\t\t\t\t//配列に格納していく\n\t\t\t\tfor(int i = 0; i < r; i++ ){\n\t\t\t\t\tfor(int j = 0; j < c; j++){\n\t\t\t\t\t\tString s3 = sc.next();\n\t\t\t\t\t\tint k = Integer.parseInt(s3);\n\t\t\t\t\t\ta[i][j] = k;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tint total = 0;\n\t\t\t\t//入力された表の値と行ごとの合計値の表示\n\t\t\t\tfor(int i = 0; i < r; i++ ){\n\t\t\t\t\tint sum = 0;\n\t\t\t\t\tfor(int j = 0; j < c; j++){\n\t\t\t\t\t\tSystem.out.print(a[i][j] + \" \");\n\t\t\t\t\t\tsum += a[i][j];\n\t\t\t\t\t}\n\t\t\t\t\ttotal += sum;\n\t\t\t\t\tSystem.out.println( sum );\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//入力された表の値の列ごとの合計値の表示\n\t\t\t\tfor(int j = 0; j < c; j++ ){\n\t\t\t\t\tint sum = 0;\n\t\t\t\t\tfor(int i = 0; i < r; i++){\n\t\t\t\t\t\tsum += a[i][j];\n\t\t\t\t\t}\n\t\t\t\t\tSystem.out.print( sum + \" \");\n\t\t\t\t}\n\t\t\t\tSystem.out.println( total );\n\t\t\t}\n\t\t}",
"1 <= r && r <= 100",
"1 <= r",
"1",
"r",
"r <= 100",
"r",
"100",
"{\n\t\t\tif(1 <= c && c <= 100){\n\t\t\t\t\n\t\t\t\t//配列に格納していく\n\t\t\t\tfor(int i = 0; i < r; i++ ){\n\t\t\t\t\tfor(int j = 0; j < c; j++){\n\t\t\t\t\t\tString s3 = sc.next();\n\t\t\t\t\t\tint k = Integer.parseInt(s3);\n\t\t\t\t\t\ta[i][j] = k;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tint total = 0;\n\t\t\t\t//入力された表の値と行ごとの合計値の表示\n\t\t\t\tfor(int i = 0; i < r; i++ ){\n\t\t\t\t\tint sum = 0;\n\t\t\t\t\tfor(int j = 0; j < c; j++){\n\t\t\t\t\t\tSystem.out.print(a[i][j] + \" \");\n\t\t\t\t\t\tsum += a[i][j];\n\t\t\t\t\t}\n\t\t\t\t\ttotal += sum;\n\t\t\t\t\tSystem.out.println( sum );\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//入力された表の値の列ごとの合計値の表示\n\t\t\t\tfor(int j = 0; j < c; j++ ){\n\t\t\t\t\tint sum = 0;\n\t\t\t\t\tfor(int i = 0; i < r; i++){\n\t\t\t\t\t\tsum += a[i][j];\n\t\t\t\t\t}\n\t\t\t\t\tSystem.out.print( sum + \" \");\n\t\t\t\t}\n\t\t\t\tSystem.out.println( total );\n\t\t\t}\n\t\t}",
"if(1 <= c && c <= 100){\n\t\t\t\t\n\t\t\t\t//配列に格納していく\n\t\t\t\tfor(int i = 0; i < r; i++ ){\n\t\t\t\t\tfor(int j = 0; j < c; j++){\n\t\t\t\t\t\tString s3 = sc.next();\n\t\t\t\t\t\tint k = Integer.parseInt(s3);\n\t\t\t\t\t\ta[i][j] = k;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tint total = 0;\n\t\t\t\t//入力された表の値と行ごとの合計値の表示\n\t\t\t\tfor(int i = 0; i < r; i++ ){\n\t\t\t\t\tint sum = 0;\n\t\t\t\t\tfor(int j = 0; j < c; j++){\n\t\t\t\t\t\tSystem.out.print(a[i][j] + \" \");\n\t\t\t\t\t\tsum += a[i][j];\n\t\t\t\t\t}\n\t\t\t\t\ttotal += sum;\n\t\t\t\t\tSystem.out.println( sum );\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//入力された表の値の列ごとの合計値の表示\n\t\t\t\tfor(int j = 0; j < c; j++ ){\n\t\t\t\t\tint sum = 0;\n\t\t\t\t\tfor(int i = 0; i < r; i++){\n\t\t\t\t\t\tsum += a[i][j];\n\t\t\t\t\t}\n\t\t\t\t\tSystem.out.print( sum + \" \");\n\t\t\t\t}\n\t\t\t\tSystem.out.println( total );\n\t\t\t}",
"1 <= c && c <= 100",
"1 <= c",
"1",
"c",
"c <= 100",
"c",
"100",
"{\n\t\t\t\t\n\t\t\t\t//配列に格納していく\n\t\t\t\tfor(int i = 0; i < r; i++ ){\n\t\t\t\t\tfor(int j = 0; j < c; j++){\n\t\t\t\t\t\tString s3 = sc.next();\n\t\t\t\t\t\tint k = Integer.parseInt(s3);\n\t\t\t\t\t\ta[i][j] = k;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tint total = 0;\n\t\t\t\t//入力された表の値と行ごとの合計値の表示\n\t\t\t\tfor(int i = 0; i < r; i++ ){\n\t\t\t\t\tint sum = 0;\n\t\t\t\t\tfor(int j = 0; j < c; j++){\n\t\t\t\t\t\tSystem.out.print(a[i][j] + \" \");\n\t\t\t\t\t\tsum += a[i][j];\n\t\t\t\t\t}\n\t\t\t\t\ttotal += sum;\n\t\t\t\t\tSystem.out.println( sum );\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//入力された表の値の列ごとの合計値の表示\n\t\t\t\tfor(int j = 0; j < c; j++ ){\n\t\t\t\t\tint sum = 0;\n\t\t\t\t\tfor(int i = 0; i < r; i++){\n\t\t\t\t\t\tsum += a[i][j];\n\t\t\t\t\t}\n\t\t\t\t\tSystem.out.print( sum + \" \");\n\t\t\t\t}\n\t\t\t\tSystem.out.println( total );\n\t\t\t}",
"for(int i = 0; i < r; i++ ){\n\t\t\t\t\tfor(int j = 0; j < c; j++){\n\t\t\t\t\t\tString s3 = sc.next();\n\t\t\t\t\t\tint k = Integer.parseInt(s3);\n\t\t\t\t\t\ta[i][j] = k;\n\t\t\t\t\t}\n\t\t\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < r",
"i",
"r",
"i++",
"i++",
"i",
"{\n\t\t\t\t\tfor(int j = 0; j < c; j++){\n\t\t\t\t\t\tString s3 = sc.next();\n\t\t\t\t\t\tint k = Integer.parseInt(s3);\n\t\t\t\t\t\ta[i][j] = k;\n\t\t\t\t\t}\n\t\t\t\t}",
"{\n\t\t\t\t\tfor(int j = 0; j < c; j++){\n\t\t\t\t\t\tString s3 = sc.next();\n\t\t\t\t\t\tint k = Integer.parseInt(s3);\n\t\t\t\t\t\ta[i][j] = k;\n\t\t\t\t\t}\n\t\t\t\t}",
"for(int j = 0; j < c; j++){\n\t\t\t\t\t\tString s3 = sc.next();\n\t\t\t\t\t\tint k = Integer.parseInt(s3);\n\t\t\t\t\t\ta[i][j] = k;\n\t\t\t\t\t}",
"int j = 0;",
"int j = 0;",
"j",
"0",
"j < c",
"j",
"c",
"j++",
"j++",
"j",
"{\n\t\t\t\t\t\tString s3 = sc.next();\n\t\t\t\t\t\tint k = Integer.parseInt(s3);\n\t\t\t\t\t\ta[i][j] = k;\n\t\t\t\t\t}",
"{\n\t\t\t\t\t\tString s3 = sc.next();\n\t\t\t\t\t\tint k = Integer.parseInt(s3);\n\t\t\t\t\t\ta[i][j] = k;\n\t\t\t\t\t}",
"String s3 = sc.next();",
"s3",
"sc.next()",
"sc.next",
"sc",
"int k = Integer.parseInt(s3);",
"k",
"Integer.parseInt(s3)",
"Integer.parseInt",
"Integer",
"s3",
"a[i][j] = k",
"a[i][j]",
"a[i]",
"a",
"i",
"j",
"k",
"int total = 0;",
"total",
"0",
"for(int i = 0; i < r; i++ ){\n\t\t\t\t\tint sum = 0;\n\t\t\t\t\tfor(int j = 0; j < c; j++){\n\t\t\t\t\t\tSystem.out.print(a[i][j] + \" \");\n\t\t\t\t\t\tsum += a[i][j];\n\t\t\t\t\t}\n\t\t\t\t\ttotal += sum;\n\t\t\t\t\tSystem.out.println( sum );\n\t\t\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < r",
"i",
"r",
"i++",
"i++",
"i",
"{\n\t\t\t\t\tint sum = 0;\n\t\t\t\t\tfor(int j = 0; j < c; j++){\n\t\t\t\t\t\tSystem.out.print(a[i][j] + \" \");\n\t\t\t\t\t\tsum += a[i][j];\n\t\t\t\t\t}\n\t\t\t\t\ttotal += sum;\n\t\t\t\t\tSystem.out.println( sum );\n\t\t\t\t}",
"{\n\t\t\t\t\tint sum = 0;\n\t\t\t\t\tfor(int j = 0; j < c; j++){\n\t\t\t\t\t\tSystem.out.print(a[i][j] + \" \");\n\t\t\t\t\t\tsum += a[i][j];\n\t\t\t\t\t}\n\t\t\t\t\ttotal += sum;\n\t\t\t\t\tSystem.out.println( sum );\n\t\t\t\t}",
"int sum = 0;",
"sum",
"0",
"for(int j = 0; j < c; j++){\n\t\t\t\t\t\tSystem.out.print(a[i][j] + \" \");\n\t\t\t\t\t\tsum += a[i][j];\n\t\t\t\t\t}",
"int j = 0;",
"int j = 0;",
"j",
"0",
"j < c",
"j",
"c",
"j++",
"j++",
"j",
"{\n\t\t\t\t\t\tSystem.out.print(a[i][j] + \" \");\n\t\t\t\t\t\tsum += a[i][j];\n\t\t\t\t\t}",
"{\n\t\t\t\t\t\tSystem.out.print(a[i][j] + \" \");\n\t\t\t\t\t\tsum += a[i][j];\n\t\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",
"\" \"",
"sum += a[i][j]",
"sum",
"a[i][j]",
"a[i]",
"a",
"i",
"j",
"total += sum",
"total",
"sum",
"System.out.println( sum )",
"System.out.println",
"System.out",
"System",
"System.out",
"sum",
"for(int j = 0; j < c; j++ ){\n\t\t\t\t\tint sum = 0;\n\t\t\t\t\tfor(int i = 0; i < r; i++){\n\t\t\t\t\t\tsum += a[i][j];\n\t\t\t\t\t}\n\t\t\t\t\tSystem.out.print( sum + \" \");\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\tint sum = 0;\n\t\t\t\t\tfor(int i = 0; i < r; i++){\n\t\t\t\t\t\tsum += a[i][j];\n\t\t\t\t\t}\n\t\t\t\t\tSystem.out.print( sum + \" \");\n\t\t\t\t}",
"{\n\t\t\t\t\tint sum = 0;\n\t\t\t\t\tfor(int i = 0; i < r; i++){\n\t\t\t\t\t\tsum += a[i][j];\n\t\t\t\t\t}\n\t\t\t\t\tSystem.out.print( sum + \" \");\n\t\t\t\t}",
"int sum = 0;",
"sum",
"0",
"for(int i = 0; i < r; i++){\n\t\t\t\t\t\tsum += a[i][j];\n\t\t\t\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < r",
"i",
"r",
"i++",
"i++",
"i",
"{\n\t\t\t\t\t\tsum += a[i][j];\n\t\t\t\t\t}",
"{\n\t\t\t\t\t\tsum += a[i][j];\n\t\t\t\t\t}",
"sum += a[i][j]",
"sum",
"a[i][j]",
"a[i]",
"a",
"i",
"j",
"System.out.print( sum + \" \")",
"System.out.print",
"System.out",
"System",
"System.out",
"sum + \" \"",
"sum",
"\" \"",
"System.out.println( total )",
"System.out.println",
"System.out",
"System",
"System.out",
"total",
"String args[]",
"args"
] |
import java.util.*;
class Main {
public static void main(String args[]){
Scanner sc = new Scanner(System.in);
//表の行数rと列数cを読み取る
String s1 = sc.next();
int r = Integer.parseInt(s1);
String s2 = sc.next();
int c = Integer.parseInt(s2);
//表を値を配列に受け取る
int a[][] = new int[r][c];
//cとrが条件範囲内か確認
if(1 <= r && r <= 100){
if(1 <= c && c <= 100){
//配列に格納していく
for(int i = 0; i < r; i++ ){
for(int j = 0; j < c; j++){
String s3 = sc.next();
int k = Integer.parseInt(s3);
a[i][j] = k;
}
}
int total = 0;
//入力された表の値と行ごとの合計値の表示
for(int i = 0; i < r; i++ ){
int sum = 0;
for(int j = 0; j < c; j++){
System.out.print(a[i][j] + " ");
sum += a[i][j];
}
total += sum;
System.out.println( sum );
}
//入力された表の値の列ごとの合計値の表示
for(int j = 0; j < c; j++ ){
int sum = 0;
for(int i = 0; i < r; i++){
sum += a[i][j];
}
System.out.print( sum + " ");
}
System.out.println( total );
}
}
}
} |
[
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,
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,
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
],
[
113,
114
],
[
113,
115
],
[
112,
116
],
[
116,
117
],
[
117,
118
],
[
117,
119
],
[
116,
120
],
[
111,
121
],
[
121,
122
],
[
122,
123
],
[
122,
124
],
[
121,
125
],
[
125,
126
],
[
126,
127
],
[
126,
128
],
[
125,
129
],
[
111,
130
],
[
130,
131
],
[
130,
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\t\n\t\tScanner sc = new Scanner(System.in); \n\t\t\t\n\t\tint rows = sc.nextInt(); \n\t\tint columns = sc.nextInt(); \n\t\tint[][] data = new int[rows][columns];\n\t\t\n\t\tfor (int i=0; i<rows; i++) {\n\t\t\tfor (int j=0; j<columns; j++) {\n\t\t\t\tdata[i][j]=sc.nextInt();\n\t\t\t}\n\t\t}\n\t\t\n\t\tint[] rowSums = new int[rows];\n\t\tint[] colSums = new int[columns];\n\t\tint sum = 0;\n\t\tArrays.fill(rowSums, 0);\n\t\tArrays.fill(colSums, 0);\n\t\tfor (int i = 0; i<rows; i++) {\n\t\t\tfor (int j = 0; j<columns; j++ ) {\n\t\t\t\trowSums[i]+= data[i][j];\n\t\t\t\tcolSums[j]+= data[i][j];\n\t\t\t\tsum+= data[i][j];\n\t\t\t}\n\t\t}\n\t\t\n\t\tfor(int i=0; i<rows; i++){\n\t\t\tfor(int j=0; j<columns; j++){\n\t\t\t\tSystem.out.print(\"\"+data[i][j]+\" \");\n\t\t\t}\n\t\t\tSystem.out.println(\"\"+ rowSums[i]);\n\t\t}\n\t\tfor(int j=0; j<columns; j++){\n\t\t\tSystem.out.print(\"\"+colSums[j]+\" \");\n\t\t}\n\t\tSystem.out.println(sum);\n\n\t\t \n\t} \n}\n\n\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\t\n\t\tScanner sc = new Scanner(System.in); \n\t\t\t\n\t\tint rows = sc.nextInt(); \n\t\tint columns = sc.nextInt(); \n\t\tint[][] data = new int[rows][columns];\n\t\t\n\t\tfor (int i=0; i<rows; i++) {\n\t\t\tfor (int j=0; j<columns; j++) {\n\t\t\t\tdata[i][j]=sc.nextInt();\n\t\t\t}\n\t\t}\n\t\t\n\t\tint[] rowSums = new int[rows];\n\t\tint[] colSums = new int[columns];\n\t\tint sum = 0;\n\t\tArrays.fill(rowSums, 0);\n\t\tArrays.fill(colSums, 0);\n\t\tfor (int i = 0; i<rows; i++) {\n\t\t\tfor (int j = 0; j<columns; j++ ) {\n\t\t\t\trowSums[i]+= data[i][j];\n\t\t\t\tcolSums[j]+= data[i][j];\n\t\t\t\tsum+= data[i][j];\n\t\t\t}\n\t\t}\n\t\t\n\t\tfor(int i=0; i<rows; i++){\n\t\t\tfor(int j=0; j<columns; j++){\n\t\t\t\tSystem.out.print(\"\"+data[i][j]+\" \");\n\t\t\t}\n\t\t\tSystem.out.println(\"\"+ rowSums[i]);\n\t\t}\n\t\tfor(int j=0; j<columns; j++){\n\t\t\tSystem.out.print(\"\"+colSums[j]+\" \");\n\t\t}\n\t\tSystem.out.println(sum);\n\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\t\t\t\n\t\tint rows = sc.nextInt(); \n\t\tint columns = sc.nextInt(); \n\t\tint[][] data = new int[rows][columns];\n\t\t\n\t\tfor (int i=0; i<rows; i++) {\n\t\t\tfor (int j=0; j<columns; j++) {\n\t\t\t\tdata[i][j]=sc.nextInt();\n\t\t\t}\n\t\t}\n\t\t\n\t\tint[] rowSums = new int[rows];\n\t\tint[] colSums = new int[columns];\n\t\tint sum = 0;\n\t\tArrays.fill(rowSums, 0);\n\t\tArrays.fill(colSums, 0);\n\t\tfor (int i = 0; i<rows; i++) {\n\t\t\tfor (int j = 0; j<columns; j++ ) {\n\t\t\t\trowSums[i]+= data[i][j];\n\t\t\t\tcolSums[j]+= data[i][j];\n\t\t\t\tsum+= data[i][j];\n\t\t\t}\n\t\t}\n\t\t\n\t\tfor(int i=0; i<rows; i++){\n\t\t\tfor(int j=0; j<columns; j++){\n\t\t\t\tSystem.out.print(\"\"+data[i][j]+\" \");\n\t\t\t}\n\t\t\tSystem.out.println(\"\"+ rowSums[i]);\n\t\t}\n\t\tfor(int j=0; j<columns; j++){\n\t\t\tSystem.out.print(\"\"+colSums[j]+\" \");\n\t\t}\n\t\tSystem.out.println(sum);\n\n\t\t \n\t}",
"main",
"{ \n\t\t\n\t\tScanner sc = new Scanner(System.in); \n\t\t\t\n\t\tint rows = sc.nextInt(); \n\t\tint columns = sc.nextInt(); \n\t\tint[][] data = new int[rows][columns];\n\t\t\n\t\tfor (int i=0; i<rows; i++) {\n\t\t\tfor (int j=0; j<columns; j++) {\n\t\t\t\tdata[i][j]=sc.nextInt();\n\t\t\t}\n\t\t}\n\t\t\n\t\tint[] rowSums = new int[rows];\n\t\tint[] colSums = new int[columns];\n\t\tint sum = 0;\n\t\tArrays.fill(rowSums, 0);\n\t\tArrays.fill(colSums, 0);\n\t\tfor (int i = 0; i<rows; i++) {\n\t\t\tfor (int j = 0; j<columns; j++ ) {\n\t\t\t\trowSums[i]+= data[i][j];\n\t\t\t\tcolSums[j]+= data[i][j];\n\t\t\t\tsum+= data[i][j];\n\t\t\t}\n\t\t}\n\t\t\n\t\tfor(int i=0; i<rows; i++){\n\t\t\tfor(int j=0; j<columns; j++){\n\t\t\t\tSystem.out.print(\"\"+data[i][j]+\" \");\n\t\t\t}\n\t\t\tSystem.out.println(\"\"+ rowSums[i]);\n\t\t}\n\t\tfor(int j=0; j<columns; j++){\n\t\t\tSystem.out.print(\"\"+colSums[j]+\" \");\n\t\t}\n\t\tSystem.out.println(sum);\n\n\t\t \n\t}",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"int rows = sc.nextInt();",
"rows",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int columns = sc.nextInt();",
"columns",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int[][] data = new int[rows][columns];",
"data",
"new int[rows][columns]",
"rows",
"columns",
"for (int i=0; i<rows; i++) {\n\t\t\tfor (int j=0; j<columns; j++) {\n\t\t\t\tdata[i][j]=sc.nextInt();\n\t\t\t}\n\t\t}",
"int i=0;",
"int i=0;",
"i",
"0",
"i<rows",
"i",
"rows",
"i++",
"i++",
"i",
"{\n\t\t\tfor (int j=0; j<columns; j++) {\n\t\t\t\tdata[i][j]=sc.nextInt();\n\t\t\t}\n\t\t}",
"{\n\t\t\tfor (int j=0; j<columns; j++) {\n\t\t\t\tdata[i][j]=sc.nextInt();\n\t\t\t}\n\t\t}",
"for (int j=0; j<columns; j++) {\n\t\t\t\tdata[i][j]=sc.nextInt();\n\t\t\t}",
"int j=0;",
"int j=0;",
"j",
"0",
"j<columns",
"j",
"columns",
"j++",
"j++",
"j",
"{\n\t\t\t\tdata[i][j]=sc.nextInt();\n\t\t\t}",
"{\n\t\t\t\tdata[i][j]=sc.nextInt();\n\t\t\t}",
"data[i][j]=sc.nextInt()",
"data[i][j]",
"data[i]",
"data",
"i",
"j",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int[] rowSums = new int[rows];",
"rowSums",
"new int[rows]",
"rows",
"int[] colSums = new int[columns];",
"colSums",
"new int[columns]",
"columns",
"int sum = 0;",
"sum",
"0",
"Arrays.fill(rowSums, 0)",
"Arrays.fill",
"Arrays",
"rowSums",
"0",
"Arrays.fill(colSums, 0)",
"Arrays.fill",
"Arrays",
"colSums",
"0",
"for (int i = 0; i<rows; i++) {\n\t\t\tfor (int j = 0; j<columns; j++ ) {\n\t\t\t\trowSums[i]+= data[i][j];\n\t\t\t\tcolSums[j]+= data[i][j];\n\t\t\t\tsum+= data[i][j];\n\t\t\t}\n\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i<rows",
"i",
"rows",
"i++",
"i++",
"i",
"{\n\t\t\tfor (int j = 0; j<columns; j++ ) {\n\t\t\t\trowSums[i]+= data[i][j];\n\t\t\t\tcolSums[j]+= data[i][j];\n\t\t\t\tsum+= data[i][j];\n\t\t\t}\n\t\t}",
"{\n\t\t\tfor (int j = 0; j<columns; j++ ) {\n\t\t\t\trowSums[i]+= data[i][j];\n\t\t\t\tcolSums[j]+= data[i][j];\n\t\t\t\tsum+= data[i][j];\n\t\t\t}\n\t\t}",
"for (int j = 0; j<columns; j++ ) {\n\t\t\t\trowSums[i]+= data[i][j];\n\t\t\t\tcolSums[j]+= data[i][j];\n\t\t\t\tsum+= data[i][j];\n\t\t\t}",
"int j = 0;",
"int j = 0;",
"j",
"0",
"j<columns",
"j",
"columns",
"j++",
"j++",
"j",
"{\n\t\t\t\trowSums[i]+= data[i][j];\n\t\t\t\tcolSums[j]+= data[i][j];\n\t\t\t\tsum+= data[i][j];\n\t\t\t}",
"{\n\t\t\t\trowSums[i]+= data[i][j];\n\t\t\t\tcolSums[j]+= data[i][j];\n\t\t\t\tsum+= data[i][j];\n\t\t\t}",
"rowSums[i]+= data[i][j]",
"rowSums[i]",
"rowSums",
"i",
"data[i][j]",
"data[i]",
"data",
"i",
"j",
"colSums[j]+= data[i][j]",
"colSums[j]",
"colSums",
"j",
"data[i][j]",
"data[i]",
"data",
"i",
"j",
"sum+= data[i][j]",
"sum",
"data[i][j]",
"data[i]",
"data",
"i",
"j",
"for(int i=0; i<rows; i++){\n\t\t\tfor(int j=0; j<columns; j++){\n\t\t\t\tSystem.out.print(\"\"+data[i][j]+\" \");\n\t\t\t}\n\t\t\tSystem.out.println(\"\"+ rowSums[i]);\n\t\t}",
"int i=0;",
"int i=0;",
"i",
"0",
"i<rows",
"i",
"rows",
"i++",
"i++",
"i",
"{\n\t\t\tfor(int j=0; j<columns; j++){\n\t\t\t\tSystem.out.print(\"\"+data[i][j]+\" \");\n\t\t\t}\n\t\t\tSystem.out.println(\"\"+ rowSums[i]);\n\t\t}",
"{\n\t\t\tfor(int j=0; j<columns; j++){\n\t\t\t\tSystem.out.print(\"\"+data[i][j]+\" \");\n\t\t\t}\n\t\t\tSystem.out.println(\"\"+ rowSums[i]);\n\t\t}",
"for(int j=0; j<columns; j++){\n\t\t\t\tSystem.out.print(\"\"+data[i][j]+\" \");\n\t\t\t}",
"int j=0;",
"int j=0;",
"j",
"0",
"j<columns",
"j",
"columns",
"j++",
"j++",
"j",
"{\n\t\t\t\tSystem.out.print(\"\"+data[i][j]+\" \");\n\t\t\t}",
"{\n\t\t\t\tSystem.out.print(\"\"+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][j]",
"data[i]",
"data",
"i",
"j",
"\" \"",
"System.out.println(\"\"+ rowSums[i])",
"System.out.println",
"System.out",
"System",
"System.out",
"\"\"+ rowSums[i]",
"\"\"",
"rowSums[i]",
"rowSums",
"i",
"for(int j=0; j<columns; j++){\n\t\t\tSystem.out.print(\"\"+colSums[j]+\" \");\n\t\t}",
"int j=0;",
"int j=0;",
"j",
"0",
"j<columns",
"j",
"columns",
"j++",
"j++",
"j",
"{\n\t\t\tSystem.out.print(\"\"+colSums[j]+\" \");\n\t\t}",
"{\n\t\t\tSystem.out.print(\"\"+colSums[j]+\" \");\n\t\t}",
"System.out.print(\"\"+colSums[j]+\" \")",
"System.out.print",
"System.out",
"System",
"System.out",
"\"\"+colSums[j]+\" \"",
"\"\"+colSums[j]+\" \"",
"\"\"",
"colSums[j]",
"colSums",
"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\t\n\t\tScanner sc = new Scanner(System.in); \n\t\t\t\n\t\tint rows = sc.nextInt(); \n\t\tint columns = sc.nextInt(); \n\t\tint[][] data = new int[rows][columns];\n\t\t\n\t\tfor (int i=0; i<rows; i++) {\n\t\t\tfor (int j=0; j<columns; j++) {\n\t\t\t\tdata[i][j]=sc.nextInt();\n\t\t\t}\n\t\t}\n\t\t\n\t\tint[] rowSums = new int[rows];\n\t\tint[] colSums = new int[columns];\n\t\tint sum = 0;\n\t\tArrays.fill(rowSums, 0);\n\t\tArrays.fill(colSums, 0);\n\t\tfor (int i = 0; i<rows; i++) {\n\t\t\tfor (int j = 0; j<columns; j++ ) {\n\t\t\t\trowSums[i]+= data[i][j];\n\t\t\t\tcolSums[j]+= data[i][j];\n\t\t\t\tsum+= data[i][j];\n\t\t\t}\n\t\t}\n\t\t\n\t\tfor(int i=0; i<rows; i++){\n\t\t\tfor(int j=0; j<columns; j++){\n\t\t\t\tSystem.out.print(\"\"+data[i][j]+\" \");\n\t\t\t}\n\t\t\tSystem.out.println(\"\"+ rowSums[i]);\n\t\t}\n\t\tfor(int j=0; j<columns; j++){\n\t\t\tSystem.out.print(\"\"+colSums[j]+\" \");\n\t\t}\n\t\tSystem.out.println(sum);\n\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\t\t\t\n\t\tint rows = sc.nextInt(); \n\t\tint columns = sc.nextInt(); \n\t\tint[][] data = new int[rows][columns];\n\t\t\n\t\tfor (int i=0; i<rows; i++) {\n\t\t\tfor (int j=0; j<columns; j++) {\n\t\t\t\tdata[i][j]=sc.nextInt();\n\t\t\t}\n\t\t}\n\t\t\n\t\tint[] rowSums = new int[rows];\n\t\tint[] colSums = new int[columns];\n\t\tint sum = 0;\n\t\tArrays.fill(rowSums, 0);\n\t\tArrays.fill(colSums, 0);\n\t\tfor (int i = 0; i<rows; i++) {\n\t\t\tfor (int j = 0; j<columns; j++ ) {\n\t\t\t\trowSums[i]+= data[i][j];\n\t\t\t\tcolSums[j]+= data[i][j];\n\t\t\t\tsum+= data[i][j];\n\t\t\t}\n\t\t}\n\t\t\n\t\tfor(int i=0; i<rows; i++){\n\t\t\tfor(int j=0; j<columns; j++){\n\t\t\t\tSystem.out.print(\"\"+data[i][j]+\" \");\n\t\t\t}\n\t\t\tSystem.out.println(\"\"+ rowSums[i]);\n\t\t}\n\t\tfor(int j=0; j<columns; j++){\n\t\t\tSystem.out.print(\"\"+colSums[j]+\" \");\n\t\t}\n\t\tSystem.out.println(sum);\n\n\t\t \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 rows = sc.nextInt();
int columns = sc.nextInt();
int[][] data = new int[rows][columns];
for (int i=0; i<rows; i++) {
for (int j=0; j<columns; j++) {
data[i][j]=sc.nextInt();
}
}
int[] rowSums = new int[rows];
int[] colSums = new int[columns];
int sum = 0;
Arrays.fill(rowSums, 0);
Arrays.fill(colSums, 0);
for (int i = 0; i<rows; i++) {
for (int j = 0; j<columns; j++ ) {
rowSums[i]+= data[i][j];
colSums[j]+= data[i][j];
sum+= data[i][j];
}
}
for(int i=0; i<rows; i++){
for(int j=0; j<columns; j++){
System.out.print(""+data[i][j]+" ");
}
System.out.println(""+ rowSums[i]);
}
for(int j=0; j<columns; j++){
System.out.print(""+colSums[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,
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,
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,
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,
12,
13,
30,
41,
13,
20,
4,
18,
13,
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
],
[
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
],
[
101,
109
],
[
109,
110
],
[
110,
111
],
[
101,
112
],
[
113,
113
],
[
113,
114
],
[
114,
115
],
[
114,
116
],
[
116,
117
],
[
117,
118
],
[
117,
119
],
[
116,
120
],
[
97,
121
],
[
121,
122
],
[
122,
123
],
[
123,
124
],
[
123,
125
],
[
122,
126
],
[
121,
127
],
[
8,
128
],
[
128,
129
],
[
129,
130
],
[
130,
131
],
[
130,
132
],
[
128,
133
],
[
133,
134
],
[
133,
135
],
[
135,
136
],
[
135,
137
],
[
128,
138
],
[
138,
139
],
[
139,
140
],
[
128,
141
],
[
142,
142
],
[
142,
143
],
[
143,
144
],
[
144,
145
],
[
145,
146
],
[
145,
147
],
[
143,
148
],
[
148,
149
],
[
148,
150
],
[
150,
151
],
[
150,
152
],
[
143,
153
],
[
153,
154
],
[
154,
155
],
[
143,
156
],
[
157,
157
],
[
157,
158
],
[
158,
159
],
[
159,
160
],
[
160,
161
],
[
160,
162
],
[
158,
163
],
[
163,
164
],
[
164,
165
],
[
164,
166
],
[
163,
167
],
[
157,
168
],
[
168,
169
],
[
169,
170
],
[
169,
171
],
[
168,
172
],
[
172,
173
],
[
173,
174
],
[
174,
175
],
[
175,
176
],
[
175,
177
],
[
173,
178
],
[
142,
179
],
[
179,
180
],
[
180,
181
],
[
181,
182
],
[
181,
183
],
[
179,
184
],
[
197,
185
],
[
185,
186
],
[
185,
187
],
[
187,
188
],
[
188,
189
],
[
188,
190
],
[
187,
191
],
[
191,
192
],
[
192,
193
],
[
185,
194
],
[
194,
195
],
[
0,
196
],
[
196,
197
],
[
196,
198
]
] | [
"import java.util.Scanner;\n\npublic class Main {\n\tvoid spread(){\n\t\tScanner s = new Scanner(System.in);\n\t\tint r = s.nextInt();\n\t\tint c = s.nextInt();\n\t\tint rxc[][] = new int[r+1][c+1];\n\t\tfor(int i = 0;i < r;i++){\n\t\t\tint sumJ = 0;\n\t\t\tfor(int j = 0;j<c;j++){\n\t\t\t\trxc[i][j] = s.nextInt();\n\t\t\t\tsumJ+=rxc[i][j];\n\t\t\t}\n\t\t\trxc[i][c] = sumJ;\n\t\t}\n\t\tfor(int j = 0;j < c + 1;j++){\n\t\t\tint sumI = 0;\n\t\t\tfor(int i = 0;i < r;i++){\n\t\t\t\tsumI+=rxc[i][j];\n\t\t\t}\n\t\t\trxc[r][j] = sumI;\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\tSystem.out.print(rxc[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.print(\"\\n\");\n\t\t}\n\t}\n\tpublic static void main(String args[]){\n\t\tMain m = new Main();\n\t\tm.spread();\n\t}\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n\tvoid spread(){\n\t\tScanner s = new Scanner(System.in);\n\t\tint r = s.nextInt();\n\t\tint c = s.nextInt();\n\t\tint rxc[][] = new int[r+1][c+1];\n\t\tfor(int i = 0;i < r;i++){\n\t\t\tint sumJ = 0;\n\t\t\tfor(int j = 0;j<c;j++){\n\t\t\t\trxc[i][j] = s.nextInt();\n\t\t\t\tsumJ+=rxc[i][j];\n\t\t\t}\n\t\t\trxc[i][c] = sumJ;\n\t\t}\n\t\tfor(int j = 0;j < c + 1;j++){\n\t\t\tint sumI = 0;\n\t\t\tfor(int i = 0;i < r;i++){\n\t\t\t\tsumI+=rxc[i][j];\n\t\t\t}\n\t\t\trxc[r][j] = sumI;\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\tSystem.out.print(rxc[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.print(\"\\n\");\n\t\t}\n\t}\n\tpublic static void main(String args[]){\n\t\tMain m = new Main();\n\t\tm.spread();\n\t}\n}",
"Main",
"void spread(){\n\t\tScanner s = new Scanner(System.in);\n\t\tint r = s.nextInt();\n\t\tint c = s.nextInt();\n\t\tint rxc[][] = new int[r+1][c+1];\n\t\tfor(int i = 0;i < r;i++){\n\t\t\tint sumJ = 0;\n\t\t\tfor(int j = 0;j<c;j++){\n\t\t\t\trxc[i][j] = s.nextInt();\n\t\t\t\tsumJ+=rxc[i][j];\n\t\t\t}\n\t\t\trxc[i][c] = sumJ;\n\t\t}\n\t\tfor(int j = 0;j < c + 1;j++){\n\t\t\tint sumI = 0;\n\t\t\tfor(int i = 0;i < r;i++){\n\t\t\t\tsumI+=rxc[i][j];\n\t\t\t}\n\t\t\trxc[r][j] = sumI;\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\tSystem.out.print(rxc[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.print(\"\\n\");\n\t\t}\n\t}",
"spread",
"{\n\t\tScanner s = new Scanner(System.in);\n\t\tint r = s.nextInt();\n\t\tint c = s.nextInt();\n\t\tint rxc[][] = new int[r+1][c+1];\n\t\tfor(int i = 0;i < r;i++){\n\t\t\tint sumJ = 0;\n\t\t\tfor(int j = 0;j<c;j++){\n\t\t\t\trxc[i][j] = s.nextInt();\n\t\t\t\tsumJ+=rxc[i][j];\n\t\t\t}\n\t\t\trxc[i][c] = sumJ;\n\t\t}\n\t\tfor(int j = 0;j < c + 1;j++){\n\t\t\tint sumI = 0;\n\t\t\tfor(int i = 0;i < r;i++){\n\t\t\t\tsumI+=rxc[i][j];\n\t\t\t}\n\t\t\trxc[r][j] = sumI;\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\tSystem.out.print(rxc[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.print(\"\\n\");\n\t\t}\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 rxc[][] = new int[r+1][c+1];",
"rxc",
"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 sumJ = 0;\n\t\t\tfor(int j = 0;j<c;j++){\n\t\t\t\trxc[i][j] = s.nextInt();\n\t\t\t\tsumJ+=rxc[i][j];\n\t\t\t}\n\t\t\trxc[i][c] = sumJ;\n\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < r",
"i",
"r",
"i++",
"i++",
"i",
"{\n\t\t\tint sumJ = 0;\n\t\t\tfor(int j = 0;j<c;j++){\n\t\t\t\trxc[i][j] = s.nextInt();\n\t\t\t\tsumJ+=rxc[i][j];\n\t\t\t}\n\t\t\trxc[i][c] = sumJ;\n\t\t}",
"{\n\t\t\tint sumJ = 0;\n\t\t\tfor(int j = 0;j<c;j++){\n\t\t\t\trxc[i][j] = s.nextInt();\n\t\t\t\tsumJ+=rxc[i][j];\n\t\t\t}\n\t\t\trxc[i][c] = sumJ;\n\t\t}",
"int sumJ = 0;",
"sumJ",
"0",
"for(int j = 0;j<c;j++){\n\t\t\t\trxc[i][j] = s.nextInt();\n\t\t\t\tsumJ+=rxc[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\trxc[i][j] = s.nextInt();\n\t\t\t\tsumJ+=rxc[i][j];\n\t\t\t}",
"{\n\t\t\t\trxc[i][j] = s.nextInt();\n\t\t\t\tsumJ+=rxc[i][j];\n\t\t\t}",
"rxc[i][j] = s.nextInt()",
"rxc[i][j]",
"rxc[i]",
"rxc",
"i",
"j",
"s.nextInt()",
"s.nextInt",
"s",
"sumJ+=rxc[i][j]",
"sumJ",
"rxc[i][j]",
"rxc[i]",
"rxc",
"i",
"j",
"rxc[i][c] = sumJ",
"rxc[i][c]",
"rxc[i]",
"rxc",
"i",
"c",
"sumJ",
"for(int j = 0;j < c + 1;j++){\n\t\t\tint sumI = 0;\n\t\t\tfor(int i = 0;i < r;i++){\n\t\t\t\tsumI+=rxc[i][j];\n\t\t\t}\n\t\t\trxc[r][j] = sumI;\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\tint sumI = 0;\n\t\t\tfor(int i = 0;i < r;i++){\n\t\t\t\tsumI+=rxc[i][j];\n\t\t\t}\n\t\t\trxc[r][j] = sumI;\n\t\t}",
"{\n\t\t\tint sumI = 0;\n\t\t\tfor(int i = 0;i < r;i++){\n\t\t\t\tsumI+=rxc[i][j];\n\t\t\t}\n\t\t\trxc[r][j] = sumI;\n\t\t}",
"int sumI = 0;",
"sumI",
"0",
"for(int i = 0;i < r;i++){\n\t\t\t\tsumI+=rxc[i][j];\n\t\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < r",
"i",
"r",
"i++",
"i++",
"i",
"{\n\t\t\t\tsumI+=rxc[i][j];\n\t\t\t}",
"{\n\t\t\t\tsumI+=rxc[i][j];\n\t\t\t}",
"sumI+=rxc[i][j]",
"sumI",
"rxc[i][j]",
"rxc[i]",
"rxc",
"i",
"j",
"rxc[r][j] = sumI",
"rxc[r][j]",
"rxc[r]",
"rxc",
"r",
"j",
"sumI",
"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(rxc[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.print(\"\\n\");\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(rxc[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.print(\"\\n\");\n\t\t}",
"{\n\t\t\tfor(int j = 0;j < c+1;j++){\n\t\t\t\tSystem.out.print(rxc[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.print(\"\\n\");\n\t\t}",
"for(int j = 0;j < c+1;j++){\n\t\t\t\tSystem.out.print(rxc[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(rxc[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(rxc[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(rxc[i][j])",
"System.out.print",
"System.out",
"System",
"System.out",
"rxc[i][j]",
"rxc[i]",
"rxc",
"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.print(\"\\n\")",
"System.out.print",
"System.out",
"System",
"System.out",
"\"\\n\"",
"public static void main(String args[]){\n\t\tMain m = new Main();\n\t\tm.spread();\n\t}",
"main",
"{\n\t\tMain m = new Main();\n\t\tm.spread();\n\t}",
"Main m = new Main();",
"m",
"new Main()",
"m.spread()",
"m.spread",
"m",
"String args[]",
"args",
"public class Main {\n\tvoid spread(){\n\t\tScanner s = new Scanner(System.in);\n\t\tint r = s.nextInt();\n\t\tint c = s.nextInt();\n\t\tint rxc[][] = new int[r+1][c+1];\n\t\tfor(int i = 0;i < r;i++){\n\t\t\tint sumJ = 0;\n\t\t\tfor(int j = 0;j<c;j++){\n\t\t\t\trxc[i][j] = s.nextInt();\n\t\t\t\tsumJ+=rxc[i][j];\n\t\t\t}\n\t\t\trxc[i][c] = sumJ;\n\t\t}\n\t\tfor(int j = 0;j < c + 1;j++){\n\t\t\tint sumI = 0;\n\t\t\tfor(int i = 0;i < r;i++){\n\t\t\t\tsumI+=rxc[i][j];\n\t\t\t}\n\t\t\trxc[r][j] = sumI;\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\tSystem.out.print(rxc[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.print(\"\\n\");\n\t\t}\n\t}\n\tpublic static void main(String args[]){\n\t\tMain m = new Main();\n\t\tm.spread();\n\t}\n}",
"public class Main {\n\tvoid spread(){\n\t\tScanner s = new Scanner(System.in);\n\t\tint r = s.nextInt();\n\t\tint c = s.nextInt();\n\t\tint rxc[][] = new int[r+1][c+1];\n\t\tfor(int i = 0;i < r;i++){\n\t\t\tint sumJ = 0;\n\t\t\tfor(int j = 0;j<c;j++){\n\t\t\t\trxc[i][j] = s.nextInt();\n\t\t\t\tsumJ+=rxc[i][j];\n\t\t\t}\n\t\t\trxc[i][c] = sumJ;\n\t\t}\n\t\tfor(int j = 0;j < c + 1;j++){\n\t\t\tint sumI = 0;\n\t\t\tfor(int i = 0;i < r;i++){\n\t\t\t\tsumI+=rxc[i][j];\n\t\t\t}\n\t\t\trxc[r][j] = sumI;\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\tSystem.out.print(rxc[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.print(\"\\n\");\n\t\t}\n\t}\n\tpublic static void main(String args[]){\n\t\tMain m = new Main();\n\t\tm.spread();\n\t}\n}",
"Main"
] | import java.util.Scanner;
public class Main {
void spread(){
Scanner s = new Scanner(System.in);
int r = s.nextInt();
int c = s.nextInt();
int rxc[][] = new int[r+1][c+1];
for(int i = 0;i < r;i++){
int sumJ = 0;
for(int j = 0;j<c;j++){
rxc[i][j] = s.nextInt();
sumJ+=rxc[i][j];
}
rxc[i][c] = sumJ;
}
for(int j = 0;j < c + 1;j++){
int sumI = 0;
for(int i = 0;i < r;i++){
sumI+=rxc[i][j];
}
rxc[r][j] = sumI;
}
for(int i = 0;i < r+1;i++){
for(int j = 0;j < c+1;j++){
System.out.print(rxc[i][j]);
if(j < c){
System.out.print(" ");
}
}
System.out.print("\n");
}
}
public static void main(String args[]){
Main m = new Main();
m.spread();
}
} |
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
17,
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,
13,
1,
40,
13,
30,
30,
41,
13,
4,
18,
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,
18,
18,
13,
13,
13,
4,
18,
18,
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,
0,
18,
18,
13,
13,
13,
18,
18,
13,
13,
13,
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,
4,
18,
18,
13,
13,
18,
18,
13,
13,
13,
14,
2,
13,
13,
30,
3,
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
],
[
213,
5
],
[
213,
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
],
[
20,
21
],
[
21,
22
],
[
8,
23
],
[
23,
24
],
[
23,
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
],
[
63,
65
],
[
65,
66
],
[
66,
67
],
[
62,
68
],
[
68,
69
],
[
69,
70
],
[
70,
71
],
[
70,
72
],
[
69,
73
],
[
68,
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
],
[
101,
106
],
[
106,
107
],
[
107,
108
],
[
107,
109
],
[
106,
110
],
[
100,
111
],
[
111,
112
],
[
112,
113
],
[
113,
114
],
[
113,
115
],
[
111,
116
],
[
100,
117
],
[
117,
118
],
[
118,
119
],
[
119,
120
],
[
119,
121
],
[
118,
122
],
[
117,
123
],
[
123,
124
],
[
124,
125
],
[
124,
126
],
[
123,
127
],
[
100,
128
],
[
128,
129
],
[
129,
130
],
[
130,
131
],
[
130,
132
],
[
129,
133
],
[
128,
134
],
[
134,
135
],
[
135,
136
],
[
135,
137
],
[
134,
138
],
[
100,
139
],
[
139,
140
],
[
140,
141
],
[
141,
142
],
[
141,
143
],
[
140,
144
],
[
139,
145
],
[
145,
146
],
[
146,
147
],
[
146,
148
],
[
145,
149
],
[
87,
150
],
[
150,
151
],
[
151,
152
],
[
152,
153
],
[
152,
154
],
[
150,
155
],
[
155,
156
],
[
156,
157
],
[
156,
158
],
[
155,
159
],
[
87,
160
],
[
160,
161
],
[
161,
162
],
[
162,
163
],
[
162,
164
],
[
8,
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
],
[
179,
179
],
[
179,
180
],
[
180,
181
],
[
181,
182
],
[
182,
183
],
[
182,
184
],
[
180,
185
],
[
185,
186
],
[
186,
187
],
[
186,
188
],
[
185,
189
],
[
179,
190
],
[
190,
191
],
[
191,
192
],
[
191,
193
],
[
190,
194
],
[
194,
195
],
[
179,
196
],
[
196,
197
],
[
197,
198
],
[
198,
199
],
[
198,
200
],
[
196,
201
],
[
8,
202
],
[
202,
203
],
[
203,
204
],
[
204,
205
],
[
204,
206
],
[
8,
207
],
[
207,
208
],
[
208,
209
],
[
6,
210
],
[
210,
211
],
[
0,
212
],
[
212,
213
],
[
212,
214
]
] | [
"import java.util.Scanner;\n\n// (1) ??¨????????°r???????????????\n// (2) ??¨????????°c???????????????\n// (3) r + 1??¨c + 1???????¬??????????((r + 1) ?? (c + 1))?????¨?????????\n\n// (4) r - 1????????\\?????????????????????\n\t// (4.1) c - 1????????\\?????????????????????\n\t\t// (4.1.1) ??°??????????????????\n\t\t// (4.1.2) ?????????????????°??????????¬??????????((r + 1) ?? (c + 1))???????´???????\n\n// (5) r - 1????????\\?????????????????????\n\t// (5.1) c - 1????????\\?????????????????????\n\t\t// (5.1.1) (4.1.2)??§????´?????????°????????¨?????????\n\t\t// (5.1.2) ????´??????????????????§?????£???????????°???????¶?????????????(c[0] + c[1] + ?????????c[n])\n\t\t// (5.1.3) c - 1?????°???????????´????????\\?????????????????????\n\t\t\t// (5.1.3.1) c - 1?????§???????¨???????c????????¨?????????\n\t// (5.2) ?????????r - 1????????£???????????\\?????????????????????\n\t\t// (5.2.1) ?????????????????????\n\t// (5.3) ??????????????????\n\n// (6) c????????\\?????????????????????\n\t// (6.1) r - 1????????\\?????????????????????\n\t\t// (6.1.1) ????´??????????????????§????¬??????????????´?????????°???????¶?????????????(r[0] + r[1] + ?????????r[n])\n\t// (6.2) c??????????????????r??????r - 1?????§???????¨?????????¨?????????\n\npublic class Main {\n\n\tpublic static void main(String[] args) {\n\n\t\tint r = 0;\n\t\tint c = 0;\n\n\t\tScanner scan = new Scanner(System.in);\n\n\t\tr = scan.nextInt();\n\t\tc = scan.nextInt();\n\n\t\tint[][] matrix = 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\tint matNum = scan.nextInt();\n\t\t\t\tmatrix[i][j] = matNum;\n\t\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\tSystem.out.print(matrix[i][j]);\n\t\t\t\tSystem.out.print(\" \");\n\n\t\t\t\tmatrix[i][c] += matrix[i][j];\n\n\t\t\t\tmatrix[r][j] += matrix[i][j];\n\n\t\t\t\tmatrix[r][c] += matrix[i][j];\n\t\t\t}\n\t\t\tSystem.out.print(matrix[i][c]);\n\t\t\tSystem.out.println();\n\t\t}\n\t\tfor (int j = 0; j < c + 1; j++) {\n\t\t\tSystem.out.print(matrix[r][j]);\n\t\t\tif (j == c) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tSystem.out.print(\" \");\n\t\t}\n\t\tSystem.out.println();\n\t\tscan.close();\n\t}\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n\n\tpublic static void main(String[] args) {\n\n\t\tint r = 0;\n\t\tint c = 0;\n\n\t\tScanner scan = new Scanner(System.in);\n\n\t\tr = scan.nextInt();\n\t\tc = scan.nextInt();\n\n\t\tint[][] matrix = 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\tint matNum = scan.nextInt();\n\t\t\t\tmatrix[i][j] = matNum;\n\t\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\tSystem.out.print(matrix[i][j]);\n\t\t\t\tSystem.out.print(\" \");\n\n\t\t\t\tmatrix[i][c] += matrix[i][j];\n\n\t\t\t\tmatrix[r][j] += matrix[i][j];\n\n\t\t\t\tmatrix[r][c] += matrix[i][j];\n\t\t\t}\n\t\t\tSystem.out.print(matrix[i][c]);\n\t\t\tSystem.out.println();\n\t\t}\n\t\tfor (int j = 0; j < c + 1; j++) {\n\t\t\tSystem.out.print(matrix[r][j]);\n\t\t\tif (j == c) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tSystem.out.print(\" \");\n\t\t}\n\t\tSystem.out.println();\n\t\tscan.close();\n\t}\n}",
"Main",
"public static void main(String[] args) {\n\n\t\tint r = 0;\n\t\tint c = 0;\n\n\t\tScanner scan = new Scanner(System.in);\n\n\t\tr = scan.nextInt();\n\t\tc = scan.nextInt();\n\n\t\tint[][] matrix = 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\tint matNum = scan.nextInt();\n\t\t\t\tmatrix[i][j] = matNum;\n\t\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\tSystem.out.print(matrix[i][j]);\n\t\t\t\tSystem.out.print(\" \");\n\n\t\t\t\tmatrix[i][c] += matrix[i][j];\n\n\t\t\t\tmatrix[r][j] += matrix[i][j];\n\n\t\t\t\tmatrix[r][c] += matrix[i][j];\n\t\t\t}\n\t\t\tSystem.out.print(matrix[i][c]);\n\t\t\tSystem.out.println();\n\t\t}\n\t\tfor (int j = 0; j < c + 1; j++) {\n\t\t\tSystem.out.print(matrix[r][j]);\n\t\t\tif (j == c) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tSystem.out.print(\" \");\n\t\t}\n\t\tSystem.out.println();\n\t\tscan.close();\n\t}",
"main",
"{\n\n\t\tint r = 0;\n\t\tint c = 0;\n\n\t\tScanner scan = new Scanner(System.in);\n\n\t\tr = scan.nextInt();\n\t\tc = scan.nextInt();\n\n\t\tint[][] matrix = 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\tint matNum = scan.nextInt();\n\t\t\t\tmatrix[i][j] = matNum;\n\t\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\tSystem.out.print(matrix[i][j]);\n\t\t\t\tSystem.out.print(\" \");\n\n\t\t\t\tmatrix[i][c] += matrix[i][j];\n\n\t\t\t\tmatrix[r][j] += matrix[i][j];\n\n\t\t\t\tmatrix[r][c] += matrix[i][j];\n\t\t\t}\n\t\t\tSystem.out.print(matrix[i][c]);\n\t\t\tSystem.out.println();\n\t\t}\n\t\tfor (int j = 0; j < c + 1; j++) {\n\t\t\tSystem.out.print(matrix[r][j]);\n\t\t\tif (j == c) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tSystem.out.print(\" \");\n\t\t}\n\t\tSystem.out.println();\n\t\tscan.close();\n\t}",
"int r = 0;",
"r",
"0",
"int c = 0;",
"c",
"0",
"Scanner scan = new Scanner(System.in);",
"scan",
"new Scanner(System.in)",
"r = scan.nextInt()",
"r",
"scan.nextInt()",
"scan.nextInt",
"scan",
"c = scan.nextInt()",
"c",
"scan.nextInt()",
"scan.nextInt",
"scan",
"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\t\tfor (int j = 0; j < c; j++) {\n\t\t\t\tint matNum = scan.nextInt();\n\t\t\t\tmatrix[i][j] = matNum;\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 matNum = scan.nextInt();\n\t\t\t\tmatrix[i][j] = matNum;\n\t\t\t}\n\t\t}",
"{\n\t\t\tfor (int j = 0; j < c; j++) {\n\t\t\t\tint matNum = scan.nextInt();\n\t\t\t\tmatrix[i][j] = matNum;\n\t\t\t}\n\t\t}",
"for (int j = 0; j < c; j++) {\n\t\t\t\tint matNum = scan.nextInt();\n\t\t\t\tmatrix[i][j] = matNum;\n\t\t\t}",
"int j = 0;",
"int j = 0;",
"j",
"0",
"j < c",
"j",
"c",
"j++",
"j++",
"j",
"{\n\t\t\t\tint matNum = scan.nextInt();\n\t\t\t\tmatrix[i][j] = matNum;\n\t\t\t}",
"{\n\t\t\t\tint matNum = scan.nextInt();\n\t\t\t\tmatrix[i][j] = matNum;\n\t\t\t}",
"int matNum = scan.nextInt();",
"matNum",
"scan.nextInt()",
"scan.nextInt",
"scan",
"matrix[i][j] = matNum",
"matrix[i][j]",
"matrix[i]",
"matrix",
"i",
"j",
"matNum",
"for (int i = 0; i < r; i++) {\n\t\t\tfor (int j = 0; j < c; j++) {\n\t\t\t\tSystem.out.print(matrix[i][j]);\n\t\t\t\tSystem.out.print(\" \");\n\n\t\t\t\tmatrix[i][c] += matrix[i][j];\n\n\t\t\t\tmatrix[r][j] += matrix[i][j];\n\n\t\t\t\tmatrix[r][c] += matrix[i][j];\n\t\t\t}\n\t\t\tSystem.out.print(matrix[i][c]);\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\tSystem.out.print(matrix[i][j]);\n\t\t\t\tSystem.out.print(\" \");\n\n\t\t\t\tmatrix[i][c] += matrix[i][j];\n\n\t\t\t\tmatrix[r][j] += matrix[i][j];\n\n\t\t\t\tmatrix[r][c] += matrix[i][j];\n\t\t\t}\n\t\t\tSystem.out.print(matrix[i][c]);\n\t\t\tSystem.out.println();\n\t\t}",
"{\n\t\t\tfor (int j = 0; j < c; j++) {\n\t\t\t\tSystem.out.print(matrix[i][j]);\n\t\t\t\tSystem.out.print(\" \");\n\n\t\t\t\tmatrix[i][c] += matrix[i][j];\n\n\t\t\t\tmatrix[r][j] += matrix[i][j];\n\n\t\t\t\tmatrix[r][c] += matrix[i][j];\n\t\t\t}\n\t\t\tSystem.out.print(matrix[i][c]);\n\t\t\tSystem.out.println();\n\t\t}",
"for (int j = 0; j < c; j++) {\n\t\t\t\tSystem.out.print(matrix[i][j]);\n\t\t\t\tSystem.out.print(\" \");\n\n\t\t\t\tmatrix[i][c] += matrix[i][j];\n\n\t\t\t\tmatrix[r][j] += matrix[i][j];\n\n\t\t\t\tmatrix[r][c] += matrix[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(matrix[i][j]);\n\t\t\t\tSystem.out.print(\" \");\n\n\t\t\t\tmatrix[i][c] += matrix[i][j];\n\n\t\t\t\tmatrix[r][j] += matrix[i][j];\n\n\t\t\t\tmatrix[r][c] += matrix[i][j];\n\t\t\t}",
"{\n\t\t\t\tSystem.out.print(matrix[i][j]);\n\t\t\t\tSystem.out.print(\" \");\n\n\t\t\t\tmatrix[i][c] += matrix[i][j];\n\n\t\t\t\tmatrix[r][j] += matrix[i][j];\n\n\t\t\t\tmatrix[r][c] += matrix[i][j];\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",
"System.out.print(\" \")",
"System.out.print",
"System.out",
"System",
"System.out",
"\" \"",
"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",
"matrix[r][c] += matrix[i][j]",
"matrix[r][c]",
"matrix[r]",
"matrix",
"r",
"c",
"matrix[i][j]",
"matrix[i]",
"matrix",
"i",
"j",
"System.out.print(matrix[i][c])",
"System.out.print",
"System.out",
"System",
"System.out",
"matrix[i][c]",
"matrix[i]",
"matrix",
"i",
"c",
"System.out.println()",
"System.out.println",
"System.out",
"System",
"System.out",
"for (int j = 0; j < c + 1; j++) {\n\t\t\tSystem.out.print(matrix[r][j]);\n\t\t\tif (j == c) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tSystem.out.print(\" \");\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\tSystem.out.print(matrix[r][j]);\n\t\t\tif (j == c) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tSystem.out.print(\" \");\n\t\t}",
"{\n\t\t\tSystem.out.print(matrix[r][j]);\n\t\t\tif (j == c) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tSystem.out.print(\" \");\n\t\t}",
"System.out.print(matrix[r][j])",
"System.out.print",
"System.out",
"System",
"System.out",
"matrix[r][j]",
"matrix[r]",
"matrix",
"r",
"j",
"if (j == c) {\n\t\t\t\tbreak;\n\t\t\t}",
"j == c",
"j",
"c",
"{\n\t\t\t\tbreak;\n\t\t\t}",
"break;",
"System.out.print(\" \")",
"System.out.print",
"System.out",
"System",
"System.out",
"\" \"",
"System.out.println()",
"System.out.println",
"System.out",
"System",
"System.out",
"scan.close()",
"scan.close",
"scan",
"String[] args",
"args",
"public class Main {\n\n\tpublic static void main(String[] args) {\n\n\t\tint r = 0;\n\t\tint c = 0;\n\n\t\tScanner scan = new Scanner(System.in);\n\n\t\tr = scan.nextInt();\n\t\tc = scan.nextInt();\n\n\t\tint[][] matrix = 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\tint matNum = scan.nextInt();\n\t\t\t\tmatrix[i][j] = matNum;\n\t\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\tSystem.out.print(matrix[i][j]);\n\t\t\t\tSystem.out.print(\" \");\n\n\t\t\t\tmatrix[i][c] += matrix[i][j];\n\n\t\t\t\tmatrix[r][j] += matrix[i][j];\n\n\t\t\t\tmatrix[r][c] += matrix[i][j];\n\t\t\t}\n\t\t\tSystem.out.print(matrix[i][c]);\n\t\t\tSystem.out.println();\n\t\t}\n\t\tfor (int j = 0; j < c + 1; j++) {\n\t\t\tSystem.out.print(matrix[r][j]);\n\t\t\tif (j == c) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tSystem.out.print(\" \");\n\t\t}\n\t\tSystem.out.println();\n\t\tscan.close();\n\t}\n}",
"public class Main {\n\n\tpublic static void main(String[] args) {\n\n\t\tint r = 0;\n\t\tint c = 0;\n\n\t\tScanner scan = new Scanner(System.in);\n\n\t\tr = scan.nextInt();\n\t\tc = scan.nextInt();\n\n\t\tint[][] matrix = 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\tint matNum = scan.nextInt();\n\t\t\t\tmatrix[i][j] = matNum;\n\t\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\tSystem.out.print(matrix[i][j]);\n\t\t\t\tSystem.out.print(\" \");\n\n\t\t\t\tmatrix[i][c] += matrix[i][j];\n\n\t\t\t\tmatrix[r][j] += matrix[i][j];\n\n\t\t\t\tmatrix[r][c] += matrix[i][j];\n\t\t\t}\n\t\t\tSystem.out.print(matrix[i][c]);\n\t\t\tSystem.out.println();\n\t\t}\n\t\tfor (int j = 0; j < c + 1; j++) {\n\t\t\tSystem.out.print(matrix[r][j]);\n\t\t\tif (j == c) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tSystem.out.print(\" \");\n\t\t}\n\t\tSystem.out.println();\n\t\tscan.close();\n\t}\n}",
"Main"
] | import java.util.Scanner;
// (1) ??¨????????°r???????????????
// (2) ??¨????????°c???????????????
// (3) r + 1??¨c + 1???????¬??????????((r + 1) ?? (c + 1))?????¨?????????
// (4) r - 1????????\?????????????????????
// (4.1) c - 1????????\?????????????????????
// (4.1.1) ??°??????????????????
// (4.1.2) ?????????????????°??????????¬??????????((r + 1) ?? (c + 1))???????´???????
// (5) r - 1????????\?????????????????????
// (5.1) c - 1????????\?????????????????????
// (5.1.1) (4.1.2)??§????´?????????°????????¨?????????
// (5.1.2) ????´??????????????????§?????£???????????°???????¶?????????????(c[0] + c[1] + ?????????c[n])
// (5.1.3) c - 1?????°???????????´????????\?????????????????????
// (5.1.3.1) c - 1?????§???????¨???????c????????¨?????????
// (5.2) ?????????r - 1????????£???????????\?????????????????????
// (5.2.1) ?????????????????????
// (5.3) ??????????????????
// (6) c????????\?????????????????????
// (6.1) r - 1????????\?????????????????????
// (6.1.1) ????´??????????????????§????¬??????????????´?????????°???????¶?????????????(r[0] + r[1] + ?????????r[n])
// (6.2) c??????????????????r??????r - 1?????§???????¨?????????¨?????????
public class Main {
public static void main(String[] args) {
int r = 0;
int c = 0;
Scanner scan = new Scanner(System.in);
r = scan.nextInt();
c = scan.nextInt();
int[][] matrix = new int[r + 1][c + 1];
for (int i = 0; i < r; i++) {
for (int j = 0; j < c; j++) {
int matNum = scan.nextInt();
matrix[i][j] = matNum;
}
}
for (int i = 0; i < r; i++) {
for (int j = 0; j < c; j++) {
System.out.print(matrix[i][j]);
System.out.print(" ");
matrix[i][c] += matrix[i][j];
matrix[r][j] += matrix[i][j];
matrix[r][c] += matrix[i][j];
}
System.out.print(matrix[i][c]);
System.out.println();
}
for (int j = 0; j < c + 1; j++) {
System.out.print(matrix[r][j]);
if (j == c) {
break;
}
System.out.print(" ");
}
System.out.println();
scan.close();
}
} |
[
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,
17,
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,
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,
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,
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,
2,
18,
18,
13,
13,
13,
18,
18,
13,
13,
13,
4,
18,
18,
13,
13,
2,
18,
18,
13,
13,
13,
17,
14,
2,
13,
2,
13,
17,
30,
4,
18,
18,
13,
13,
18,
18,
13,
13,
13,
14,
2,
13,
2,
13,
17,
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,
30,
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
],
[
239,
11
],
[
239,
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
],
[
25,
28
],
[
25,
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
],
[
55,
57
],
[
14,
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
],
[
71,
77
],
[
77,
78
],
[
77,
79
],
[
79,
80
],
[
80,
81
],
[
79,
82
],
[
79,
83
],
[
71,
84
],
[
84,
85
],
[
85,
86
],
[
86,
87
],
[
86,
88
],
[
84,
89
],
[
89,
90
],
[
89,
91
],
[
84,
92
],
[
92,
93
],
[
93,
94
],
[
84,
95
],
[
96,
96
],
[
96,
97
],
[
97,
98
],
[
98,
99
],
[
99,
100
],
[
99,
101
],
[
98,
102
],
[
97,
103
],
[
103,
104
],
[
104,
105
],
[
103,
106
],
[
106,
107
],
[
106,
108
],
[
96,
109
],
[
109,
110
],
[
110,
111
],
[
111,
112
],
[
111,
113
],
[
110,
114
],
[
109,
115
],
[
115,
116
],
[
116,
117
],
[
117,
118
],
[
117,
119
],
[
116,
120
],
[
115,
121
],
[
121,
122
],
[
122,
123
],
[
122,
124
],
[
121,
125
],
[
96,
126
],
[
126,
127
],
[
127,
128
],
[
128,
129
],
[
128,
130
],
[
127,
131
],
[
126,
132
],
[
132,
133
],
[
133,
134
],
[
134,
135
],
[
134,
136
],
[
133,
137
],
[
132,
138
],
[
138,
139
],
[
139,
140
],
[
139,
141
],
[
138,
142
],
[
96,
143
],
[
143,
144
],
[
144,
145
],
[
145,
146
],
[
145,
147
],
[
144,
148
],
[
143,
149
],
[
149,
150
],
[
150,
151
],
[
151,
152
],
[
151,
153
],
[
150,
154
],
[
149,
155
],
[
155,
156
],
[
156,
157
],
[
156,
158
],
[
155,
159
],
[
96,
160
],
[
160,
161
],
[
161,
162
],
[
162,
163
],
[
162,
164
],
[
160,
165
],
[
165,
166
],
[
166,
167
],
[
167,
168
],
[
167,
169
],
[
166,
170
],
[
165,
171
],
[
96,
172
],
[
172,
173
],
[
173,
174
],
[
173,
175
],
[
175,
176
],
[
175,
177
],
[
172,
178
],
[
178,
179
],
[
179,
180
],
[
180,
181
],
[
181,
182
],
[
181,
183
],
[
179,
184
],
[
184,
185
],
[
185,
186
],
[
185,
187
],
[
184,
188
],
[
71,
189
],
[
189,
190
],
[
190,
191
],
[
190,
192
],
[
192,
193
],
[
192,
194
],
[
189,
195
],
[
195,
196
],
[
196,
197
],
[
197,
198
],
[
198,
199
],
[
198,
200
],
[
196,
201
],
[
201,
202
],
[
201,
203
],
[
196,
204
],
[
204,
205
],
[
205,
206
],
[
196,
207
],
[
208,
208
],
[
208,
209
],
[
209,
210
],
[
210,
211
],
[
211,
212
],
[
211,
213
],
[
209,
214
],
[
214,
215
],
[
215,
216
],
[
215,
217
],
[
214,
218
],
[
208,
219
],
[
219,
220
],
[
220,
221
],
[
220,
222
],
[
219,
223
],
[
223,
224
],
[
224,
225
],
[
225,
226
],
[
226,
227
],
[
226,
228
],
[
224,
229
],
[
219,
230
],
[
230,
231
],
[
231,
232
],
[
232,
233
],
[
233,
234
],
[
233,
235
],
[
12,
236
],
[
236,
237
],
[
0,
238
],
[
238,
239
],
[
238,
240
]
] | [
"import java.io.BufferedReader;\nimport java.io.IOException;\nimport java.io.InputStreamReader;\n\npublic class Main {\n\tpublic static void main(String[] args) throws IOException {\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\t\tString str = br.readLine();\n\t\tString[] size = str.split(\" \", 2);\n\t\tint r = Integer.parseInt(size[0]);\n\t\tint c = Integer.parseInt(size[1]);\n\t\tint[][] data = new int[r + 1][c + 1];\n\t\tString[] datastr = new String[c];\n\t\tfor (int i = 0; i < r; i++) {\n\t\t\tstr = br.readLine();\n\t\t\tdatastr = str.split(\" \", c);\n\t\t\tfor (int j = 0; j < c; j++) {\n\t\t\t\tdata[i][j] = Integer.parseInt(datastr[j]);\n\t\t\t\tdata[i][c] = data[i][c] + data[i][j];\n\t\t\t\tdata[r][j] = data[r][j] + data[i][j];\n\t\t\t\tdata[r][c] = data[r][c] + data[i][j];\n\t\t\t\tSystem.out.print(data[i][j] + \" \");\n\t\t\t\tif (j == c - 1) {\n\t\t\t\t\tSystem.out.println(data[i][c]);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (i == r - 1) {\n\t\t\t\tfor (int k = 0; k <= c; k++) {\n\t\t\t\t\tSystem.out.print(data[r][k]);\n\t\t\t\t\tif (k != c) {\n\t\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t\t} else {\n\t\t\t\t\t\tSystem.out.println();\n\t\t\t\t\t}\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",
"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[] size = str.split(\" \", 2);\n\t\tint r = Integer.parseInt(size[0]);\n\t\tint c = Integer.parseInt(size[1]);\n\t\tint[][] data = new int[r + 1][c + 1];\n\t\tString[] datastr = new String[c];\n\t\tfor (int i = 0; i < r; i++) {\n\t\t\tstr = br.readLine();\n\t\t\tdatastr = str.split(\" \", c);\n\t\t\tfor (int j = 0; j < c; j++) {\n\t\t\t\tdata[i][j] = Integer.parseInt(datastr[j]);\n\t\t\t\tdata[i][c] = data[i][c] + data[i][j];\n\t\t\t\tdata[r][j] = data[r][j] + data[i][j];\n\t\t\t\tdata[r][c] = data[r][c] + data[i][j];\n\t\t\t\tSystem.out.print(data[i][j] + \" \");\n\t\t\t\tif (j == c - 1) {\n\t\t\t\t\tSystem.out.println(data[i][c]);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (i == r - 1) {\n\t\t\t\tfor (int k = 0; k <= c; k++) {\n\t\t\t\t\tSystem.out.print(data[r][k]);\n\t\t\t\t\tif (k != c) {\n\t\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t\t} else {\n\t\t\t\t\t\tSystem.out.println();\n\t\t\t\t\t}\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 str = br.readLine();\n\t\tString[] size = str.split(\" \", 2);\n\t\tint r = Integer.parseInt(size[0]);\n\t\tint c = Integer.parseInt(size[1]);\n\t\tint[][] data = new int[r + 1][c + 1];\n\t\tString[] datastr = new String[c];\n\t\tfor (int i = 0; i < r; i++) {\n\t\t\tstr = br.readLine();\n\t\t\tdatastr = str.split(\" \", c);\n\t\t\tfor (int j = 0; j < c; j++) {\n\t\t\t\tdata[i][j] = Integer.parseInt(datastr[j]);\n\t\t\t\tdata[i][c] = data[i][c] + data[i][j];\n\t\t\t\tdata[r][j] = data[r][j] + data[i][j];\n\t\t\t\tdata[r][c] = data[r][c] + data[i][j];\n\t\t\t\tSystem.out.print(data[i][j] + \" \");\n\t\t\t\tif (j == c - 1) {\n\t\t\t\t\tSystem.out.println(data[i][c]);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (i == r - 1) {\n\t\t\t\tfor (int k = 0; k <= c; k++) {\n\t\t\t\t\tSystem.out.print(data[r][k]);\n\t\t\t\t\tif (k != c) {\n\t\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t\t} else {\n\t\t\t\t\t\tSystem.out.println();\n\t\t\t\t\t}\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 str = br.readLine();\n\t\tString[] size = str.split(\" \", 2);\n\t\tint r = Integer.parseInt(size[0]);\n\t\tint c = Integer.parseInt(size[1]);\n\t\tint[][] data = new int[r + 1][c + 1];\n\t\tString[] datastr = new String[c];\n\t\tfor (int i = 0; i < r; i++) {\n\t\t\tstr = br.readLine();\n\t\t\tdatastr = str.split(\" \", c);\n\t\t\tfor (int j = 0; j < c; j++) {\n\t\t\t\tdata[i][j] = Integer.parseInt(datastr[j]);\n\t\t\t\tdata[i][c] = data[i][c] + data[i][j];\n\t\t\t\tdata[r][j] = data[r][j] + data[i][j];\n\t\t\t\tdata[r][c] = data[r][c] + data[i][j];\n\t\t\t\tSystem.out.print(data[i][j] + \" \");\n\t\t\t\tif (j == c - 1) {\n\t\t\t\t\tSystem.out.println(data[i][c]);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (i == r - 1) {\n\t\t\t\tfor (int k = 0; k <= c; k++) {\n\t\t\t\t\tSystem.out.print(data[r][k]);\n\t\t\t\t\tif (k != c) {\n\t\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t\t} else {\n\t\t\t\t\t\tSystem.out.println();\n\t\t\t\t\t}\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 str = br.readLine();",
"str",
"br.readLine()",
"br.readLine",
"br",
"String[] size = str.split(\" \", 2);",
"size",
"str.split(\" \", 2)",
"str.split",
"str",
"\" \"",
"2",
"int r = Integer.parseInt(size[0]);",
"r",
"Integer.parseInt(size[0])",
"Integer.parseInt",
"Integer",
"size[0]",
"size",
"0",
"int c = Integer.parseInt(size[1]);",
"c",
"Integer.parseInt(size[1])",
"Integer.parseInt",
"Integer",
"size[1]",
"size",
"1",
"int[][] data = new int[r + 1][c + 1];",
"data",
"new int[r + 1][c + 1]",
"r + 1",
"r",
"1",
"c + 1",
"c",
"1",
"String[] datastr = new String[c];",
"datastr",
"new String[c]",
"c",
"for (int i = 0; i < r; i++) {\n\t\t\tstr = br.readLine();\n\t\t\tdatastr = str.split(\" \", c);\n\t\t\tfor (int j = 0; j < c; j++) {\n\t\t\t\tdata[i][j] = Integer.parseInt(datastr[j]);\n\t\t\t\tdata[i][c] = data[i][c] + data[i][j];\n\t\t\t\tdata[r][j] = data[r][j] + data[i][j];\n\t\t\t\tdata[r][c] = data[r][c] + data[i][j];\n\t\t\t\tSystem.out.print(data[i][j] + \" \");\n\t\t\t\tif (j == c - 1) {\n\t\t\t\t\tSystem.out.println(data[i][c]);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (i == r - 1) {\n\t\t\t\tfor (int k = 0; k <= c; k++) {\n\t\t\t\t\tSystem.out.print(data[r][k]);\n\t\t\t\t\tif (k != c) {\n\t\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t\t} else {\n\t\t\t\t\t\tSystem.out.println();\n\t\t\t\t\t}\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\tstr = br.readLine();\n\t\t\tdatastr = str.split(\" \", c);\n\t\t\tfor (int j = 0; j < c; j++) {\n\t\t\t\tdata[i][j] = Integer.parseInt(datastr[j]);\n\t\t\t\tdata[i][c] = data[i][c] + data[i][j];\n\t\t\t\tdata[r][j] = data[r][j] + data[i][j];\n\t\t\t\tdata[r][c] = data[r][c] + data[i][j];\n\t\t\t\tSystem.out.print(data[i][j] + \" \");\n\t\t\t\tif (j == c - 1) {\n\t\t\t\t\tSystem.out.println(data[i][c]);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (i == r - 1) {\n\t\t\t\tfor (int k = 0; k <= c; k++) {\n\t\t\t\t\tSystem.out.print(data[r][k]);\n\t\t\t\t\tif (k != c) {\n\t\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t\t} else {\n\t\t\t\t\t\tSystem.out.println();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"{\n\t\t\tstr = br.readLine();\n\t\t\tdatastr = str.split(\" \", c);\n\t\t\tfor (int j = 0; j < c; j++) {\n\t\t\t\tdata[i][j] = Integer.parseInt(datastr[j]);\n\t\t\t\tdata[i][c] = data[i][c] + data[i][j];\n\t\t\t\tdata[r][j] = data[r][j] + data[i][j];\n\t\t\t\tdata[r][c] = data[r][c] + data[i][j];\n\t\t\t\tSystem.out.print(data[i][j] + \" \");\n\t\t\t\tif (j == c - 1) {\n\t\t\t\t\tSystem.out.println(data[i][c]);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (i == r - 1) {\n\t\t\t\tfor (int k = 0; k <= c; k++) {\n\t\t\t\t\tSystem.out.print(data[r][k]);\n\t\t\t\t\tif (k != c) {\n\t\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t\t} else {\n\t\t\t\t\t\tSystem.out.println();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"str = br.readLine()",
"str",
"br.readLine()",
"br.readLine",
"br",
"datastr = str.split(\" \", c)",
"datastr",
"str.split(\" \", c)",
"str.split",
"str",
"\" \"",
"c",
"for (int j = 0; j < c; j++) {\n\t\t\t\tdata[i][j] = Integer.parseInt(datastr[j]);\n\t\t\t\tdata[i][c] = data[i][c] + data[i][j];\n\t\t\t\tdata[r][j] = data[r][j] + data[i][j];\n\t\t\t\tdata[r][c] = data[r][c] + data[i][j];\n\t\t\t\tSystem.out.print(data[i][j] + \" \");\n\t\t\t\tif (j == c - 1) {\n\t\t\t\t\tSystem.out.println(data[i][c]);\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\tdata[i][j] = Integer.parseInt(datastr[j]);\n\t\t\t\tdata[i][c] = data[i][c] + data[i][j];\n\t\t\t\tdata[r][j] = data[r][j] + data[i][j];\n\t\t\t\tdata[r][c] = data[r][c] + data[i][j];\n\t\t\t\tSystem.out.print(data[i][j] + \" \");\n\t\t\t\tif (j == c - 1) {\n\t\t\t\t\tSystem.out.println(data[i][c]);\n\t\t\t\t}\n\t\t\t}",
"{\n\t\t\t\tdata[i][j] = Integer.parseInt(datastr[j]);\n\t\t\t\tdata[i][c] = data[i][c] + data[i][j];\n\t\t\t\tdata[r][j] = data[r][j] + data[i][j];\n\t\t\t\tdata[r][c] = data[r][c] + data[i][j];\n\t\t\t\tSystem.out.print(data[i][j] + \" \");\n\t\t\t\tif (j == c - 1) {\n\t\t\t\t\tSystem.out.println(data[i][c]);\n\t\t\t\t}\n\t\t\t}",
"data[i][j] = Integer.parseInt(datastr[j])",
"data[i][j]",
"data[i]",
"data",
"i",
"j",
"Integer.parseInt(datastr[j])",
"Integer.parseInt",
"Integer",
"datastr[j]",
"datastr",
"j",
"data[i][c] = data[i][c] + data[i][j]",
"data[i][c]",
"data[i]",
"data",
"i",
"c",
"data[i][c] + data[i][j]",
"data[i][c]",
"data[i]",
"data",
"i",
"c",
"data[i][j]",
"data[i]",
"data",
"i",
"j",
"data[r][j] = data[r][j] + data[i][j]",
"data[r][j]",
"data[r]",
"data",
"r",
"j",
"data[r][j] + data[i][j]",
"data[r][j]",
"data[r]",
"data",
"r",
"j",
"data[i][j]",
"data[i]",
"data",
"i",
"j",
"data[r][c] = data[r][c] + data[i][j]",
"data[r][c]",
"data[r]",
"data",
"r",
"c",
"data[r][c] + data[i][j]",
"data[r][c]",
"data[r]",
"data",
"r",
"c",
"data[i][j]",
"data[i]",
"data",
"i",
"j",
"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",
"\" \"",
"if (j == c - 1) {\n\t\t\t\t\tSystem.out.println(data[i][c]);\n\t\t\t\t}",
"j == c - 1",
"j",
"c - 1",
"c",
"1",
"{\n\t\t\t\t\tSystem.out.println(data[i][c]);\n\t\t\t\t}",
"System.out.println(data[i][c])",
"System.out.println",
"System.out",
"System",
"System.out",
"data[i][c]",
"data[i]",
"data",
"i",
"c",
"if (i == r - 1) {\n\t\t\t\tfor (int k = 0; k <= c; k++) {\n\t\t\t\t\tSystem.out.print(data[r][k]);\n\t\t\t\t\tif (k != c) {\n\t\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t\t} else {\n\t\t\t\t\t\tSystem.out.println();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}",
"i == r - 1",
"i",
"r - 1",
"r",
"1",
"{\n\t\t\t\tfor (int k = 0; k <= c; k++) {\n\t\t\t\t\tSystem.out.print(data[r][k]);\n\t\t\t\t\tif (k != c) {\n\t\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t\t} else {\n\t\t\t\t\t\tSystem.out.println();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}",
"for (int k = 0; k <= c; k++) {\n\t\t\t\t\tSystem.out.print(data[r][k]);\n\t\t\t\t\tif (k != c) {\n\t\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t\t} else {\n\t\t\t\t\t\tSystem.out.println();\n\t\t\t\t\t}\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(data[r][k]);\n\t\t\t\t\tif (k != c) {\n\t\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t\t} else {\n\t\t\t\t\t\tSystem.out.println();\n\t\t\t\t\t}\n\t\t\t\t}",
"{\n\t\t\t\t\tSystem.out.print(data[r][k]);\n\t\t\t\t\tif (k != c) {\n\t\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t\t} else {\n\t\t\t\t\t\tSystem.out.println();\n\t\t\t\t\t}\n\t\t\t\t}",
"System.out.print(data[r][k])",
"System.out.print",
"System.out",
"System",
"System.out",
"data[r][k]",
"data[r]",
"data",
"r",
"k",
"if (k != c) {\n\t\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t\t} else {\n\t\t\t\t\t\tSystem.out.println();\n\t\t\t\t\t}",
"k != c",
"k",
"c",
"{\n\t\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t\t}",
"System.out.print(\" \")",
"System.out.print",
"System.out",
"System",
"System.out",
"\" \"",
"{\n\t\t\t\t\t\tSystem.out.println();\n\t\t\t\t\t}",
"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[] size = str.split(\" \", 2);\n\t\tint r = Integer.parseInt(size[0]);\n\t\tint c = Integer.parseInt(size[1]);\n\t\tint[][] data = new int[r + 1][c + 1];\n\t\tString[] datastr = new String[c];\n\t\tfor (int i = 0; i < r; i++) {\n\t\t\tstr = br.readLine();\n\t\t\tdatastr = str.split(\" \", c);\n\t\t\tfor (int j = 0; j < c; j++) {\n\t\t\t\tdata[i][j] = Integer.parseInt(datastr[j]);\n\t\t\t\tdata[i][c] = data[i][c] + data[i][j];\n\t\t\t\tdata[r][j] = data[r][j] + data[i][j];\n\t\t\t\tdata[r][c] = data[r][c] + data[i][j];\n\t\t\t\tSystem.out.print(data[i][j] + \" \");\n\t\t\t\tif (j == c - 1) {\n\t\t\t\t\tSystem.out.println(data[i][c]);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (i == r - 1) {\n\t\t\t\tfor (int k = 0; k <= c; k++) {\n\t\t\t\t\tSystem.out.print(data[r][k]);\n\t\t\t\t\tif (k != c) {\n\t\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t\t} else {\n\t\t\t\t\t\tSystem.out.println();\n\t\t\t\t\t}\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) throws IOException {\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\t\tString str = br.readLine();\n\t\tString[] size = str.split(\" \", 2);\n\t\tint r = Integer.parseInt(size[0]);\n\t\tint c = Integer.parseInt(size[1]);\n\t\tint[][] data = new int[r + 1][c + 1];\n\t\tString[] datastr = new String[c];\n\t\tfor (int i = 0; i < r; i++) {\n\t\t\tstr = br.readLine();\n\t\t\tdatastr = str.split(\" \", c);\n\t\t\tfor (int j = 0; j < c; j++) {\n\t\t\t\tdata[i][j] = Integer.parseInt(datastr[j]);\n\t\t\t\tdata[i][c] = data[i][c] + data[i][j];\n\t\t\t\tdata[r][j] = data[r][j] + data[i][j];\n\t\t\t\tdata[r][c] = data[r][c] + data[i][j];\n\t\t\t\tSystem.out.print(data[i][j] + \" \");\n\t\t\t\tif (j == c - 1) {\n\t\t\t\t\tSystem.out.println(data[i][c]);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (i == r - 1) {\n\t\t\t\tfor (int k = 0; k <= c; k++) {\n\t\t\t\t\tSystem.out.print(data[r][k]);\n\t\t\t\t\tif (k != c) {\n\t\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t\t} else {\n\t\t\t\t\t\tSystem.out.println();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\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) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
String str = br.readLine();
String[] size = str.split(" ", 2);
int r = Integer.parseInt(size[0]);
int c = Integer.parseInt(size[1]);
int[][] data = new int[r + 1][c + 1];
String[] datastr = new String[c];
for (int i = 0; i < r; i++) {
str = br.readLine();
datastr = str.split(" ", c);
for (int j = 0; j < c; j++) {
data[i][j] = Integer.parseInt(datastr[j]);
data[i][c] = data[i][c] + data[i][j];
data[r][j] = data[r][j] + data[i][j];
data[r][c] = data[r][c] + data[i][j];
System.out.print(data[i][j] + " ");
if (j == c - 1) {
System.out.println(data[i][c]);
}
}
if (i == r - 1) {
for (int k = 0; k <= c; k++) {
System.out.print(data[r][k]);
if (k != c) {
System.out.print(" ");
} else {
System.out.println();
}
}
}
}
}
} |
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
41,
13,
18,
13,
13,
41,
13,
20,
41,
13,
18,
13,
13,
41,
13,
18,
13,
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,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
41,
13,
20,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
4,
18,
13,
2,
18,
18,
13,
13,
13,
17,
0,
13,
18,
18,
13,
13,
13,
4,
18,
13,
13,
4,
18,
13,
13,
41,
13,
17,
41,
13,
20,
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,
13,
2,
13,
17,
0,
13,
13,
4,
18,
13,
13,
4,
18,
13,
13,
4,
18,
13,
23,
13,
6,
13,
41,
13,
41,
13,
20,
17,
41,
13,
41,
13,
12,
13,
30,
0,
18,
36,
13,
13,
0,
18,
36,
13,
0,
18,
36,
13,
17,
23,
13,
12,
13,
30,
14,
2,
13,
13,
30,
0,
13,
17,
38,
5,
13,
30,
37,
20,
30,
0,
13,
4,
18,
13,
13,
14,
2,
13,
17,
29,
17,
29,
17,
12,
13,
30,
14,
4,
13,
29,
18,
13,
40,
13,
29,
40,
17,
12,
13,
30,
29,
40,
2,
2,
13,
17,
2,
13,
17,
23,
13,
12,
13,
30,
42,
2,
4,
13,
4,
13,
18,
13,
13,
40,
13,
12,
13,
30,
4,
13,
29,
4,
13,
12,
13,
30,
14,
40,
4,
13,
37,
20,
41,
13,
20,
41,
13,
4,
13,
42,
40,
4,
13,
13,
30,
4,
18,
13,
13,
0,
13,
4,
13,
29,
4,
18,
13,
12,
13,
30,
14,
40,
4,
13,
37,
20,
41,
13,
4,
13,
42,
4,
13,
13,
0,
13,
4,
13,
41,
13,
17,
14,
2,
13,
17,
30,
0,
13,
17,
0,
13,
4,
13,
41,
13,
17,
42,
40,
4,
13,
13,
30,
14,
2,
2,
13,
17,
2,
13,
17,
37,
20,
0,
13,
2,
2,
2,
13,
17,
13,
17,
0,
13,
4,
13,
29,
8,
13,
40,
13,
13,
12,
13,
30,
14,
40,
4,
13,
37,
20,
41,
13,
4,
13,
42,
4,
13,
13,
0,
13,
4,
13,
41,
13,
17,
14,
2,
13,
17,
30,
0,
13,
17,
0,
13,
4,
13,
41,
13,
17,
42,
40,
4,
13,
13,
30,
14,
2,
2,
13,
17,
2,
13,
17,
37,
20,
0,
13,
2,
2,
2,
13,
17,
13,
17,
0,
13,
4,
13,
29,
8,
13,
40,
13,
13,
12,
13,
30,
29,
4,
18,
13,
4,
13,
12,
13,
30,
29,
20,
12,
13,
30,
41,
13,
20,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
0,
18,
13,
13,
4,
13,
29,
13,
23,
13,
12,
13,
30,
41,
13,
20,
13,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
0,
18,
13,
13,
4,
18,
4,
13,
29,
13,
23,
13,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
10,
11
],
[
10,
12
],
[
0,
13
],
[
13,
14
],
[
13,
15
],
[
0,
16
],
[
16,
17
],
[
16,
18
],
[
0,
19
],
[
19,
20
],
[
19,
21
],
[
0,
22
],
[
22,
23
],
[
22,
24
],
[
0,
25
],
[
25,
26
],
[
25,
27
],
[
0,
28
],
[
28,
29
],
[
28,
30
],
[
0,
31
],
[
31,
32
],
[
31,
33
],
[
0,
34
],
[
34,
35
],
[
34,
36
],
[
0,
37
],
[
37,
38
],
[
37,
39
],
[
0,
40
],
[
40,
41
],
[
40,
42
],
[
0,
43
],
[
43,
44
],
[
43,
45
],
[
0,
46
],
[
46,
47
],
[
46,
48
],
[
0,
49
],
[
49,
50
],
[
49,
51
],
[
0,
52
],
[
52,
53
],
[
52,
54
],
[
0,
55
],
[
625,
56
],
[
625,
57
],
[
57,
58
],
[
57,
59
],
[
59,
60
],
[
59,
61
],
[
625,
62
],
[
62,
63
],
[
62,
64
],
[
625,
65
],
[
65,
66
],
[
65,
67
],
[
67,
68
],
[
67,
69
],
[
625,
70
],
[
70,
71
],
[
70,
72
],
[
72,
73
],
[
72,
74
],
[
625,
75
],
[
75,
76
],
[
75,
77
],
[
77,
78
],
[
78,
79
],
[
78,
80
],
[
77,
81
],
[
81,
82
],
[
81,
83
],
[
83,
84
],
[
84,
85
],
[
77,
86
],
[
86,
87
],
[
86,
88
],
[
88,
89
],
[
89,
90
],
[
77,
91
],
[
91,
92
],
[
91,
93
],
[
77,
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
],
[
123,
127
],
[
122,
128
],
[
128,
129
],
[
129,
130
],
[
77,
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
],
[
144,
146
],
[
143,
147
],
[
147,
148
],
[
147,
149
],
[
143,
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
],
[
163,
166
],
[
166,
167
],
[
167,
168
],
[
168,
169
],
[
168,
170
],
[
167,
171
],
[
166,
172
],
[
162,
173
],
[
173,
174
],
[
173,
175
],
[
175,
176
],
[
176,
177
],
[
176,
178
],
[
175,
179
],
[
143,
180
],
[
180,
181
],
[
181,
182
],
[
180,
183
],
[
143,
184
],
[
184,
185
],
[
185,
186
],
[
184,
187
],
[
77,
188
],
[
188,
189
],
[
188,
190
],
[
77,
191
],
[
191,
192
],
[
191,
193
],
[
77,
194
],
[
194,
195
],
[
195,
196
],
[
196,
197
],
[
196,
198
],
[
194,
199
],
[
199,
200
],
[
199,
201
],
[
194,
202
],
[
202,
203
],
[
203,
204
],
[
194,
205
],
[
206,
206
],
[
206,
207
],
[
207,
208
],
[
207,
209
],
[
206,
210
],
[
210,
211
],
[
211,
212
],
[
212,
213
],
[
212,
214
],
[
210,
215
],
[
215,
216
],
[
215,
217
],
[
210,
218
],
[
218,
219
],
[
219,
220
],
[
210,
221
],
[
222,
222
],
[
222,
223
],
[
223,
224
],
[
223,
225
],
[
225,
226
],
[
226,
227
],
[
226,
228
],
[
225,
229
],
[
206,
230
],
[
230,
231
],
[
231,
232
],
[
230,
233
],
[
233,
234
],
[
233,
235
],
[
206,
236
],
[
236,
237
],
[
236,
238
],
[
77,
239
],
[
239,
240
],
[
240,
241
],
[
239,
242
],
[
77,
243
],
[
243,
244
],
[
244,
245
],
[
243,
246
],
[
77,
247
],
[
247,
248
],
[
248,
249
],
[
75,
250
],
[
250,
251
],
[
625,
252
],
[
252,
253
],
[
252,
254
],
[
254,
255
],
[
252,
256
],
[
256,
257
],
[
256,
258
],
[
252,
260
],
[
260,
261
],
[
252,
262
],
[
262,
263
],
[
252,
264
],
[
264,
265
],
[
264,
266
],
[
266,
267
],
[
267,
268
],
[
268,
269
],
[
268,
270
],
[
267,
271
],
[
266,
272
],
[
272,
273
],
[
273,
274
],
[
273,
275
],
[
272,
276
],
[
276,
277
],
[
277,
278
],
[
277,
279
],
[
276,
280
],
[
264,
281
],
[
281,
282
],
[
252,
283
],
[
283,
284
],
[
283,
285
],
[
285,
286
],
[
286,
287
],
[
287,
288
],
[
287,
289
],
[
286,
290
],
[
290,
291
],
[
291,
292
],
[
291,
293
],
[
290,
294
],
[
294,
295
],
[
295,
296
],
[
295,
297
],
[
297,
298
],
[
298,
299
],
[
294,
300
],
[
300,
301
],
[
301,
302
],
[
301,
303
],
[
303,
304
],
[
304,
305
],
[
303,
306
],
[
290,
307
],
[
307,
308
],
[
308,
309
],
[
308,
310
],
[
307,
311
],
[
311,
312
],
[
285,
313
],
[
313,
314
],
[
252,
315
],
[
315,
316
],
[
315,
317
],
[
317,
318
],
[
318,
319
],
[
319,
320
],
[
318,
321
],
[
321,
322
],
[
322,
323
],
[
322,
324
],
[
324,
325
],
[
318,
326
],
[
326,
327
],
[
327,
328
],
[
252,
329
],
[
329,
330
],
[
329,
331
],
[
331,
332
],
[
332,
333
],
[
333,
334
],
[
334,
335
],
[
335,
336
],
[
335,
337
],
[
334,
338
],
[
338,
339
],
[
338,
340
],
[
329,
341
],
[
341,
342
],
[
252,
343
],
[
343,
344
],
[
343,
345
],
[
345,
346
],
[
346,
347
],
[
347,
348
],
[
348,
349
],
[
347,
350
],
[
350,
351
],
[
350,
352
],
[
352,
353
],
[
352,
354
],
[
346,
355
],
[
355,
356
],
[
252,
357
],
[
357,
358
],
[
357,
359
],
[
359,
360
],
[
360,
361
],
[
359,
362
],
[
362,
363
],
[
363,
364
],
[
252,
365
],
[
365,
366
],
[
365,
367
],
[
367,
368
],
[
368,
369
],
[
369,
370
],
[
370,
371
],
[
368,
372
],
[
372,
373
],
[
367,
374
],
[
374,
375
],
[
374,
376
],
[
367,
377
],
[
377,
378
],
[
377,
379
],
[
379,
380
],
[
367,
381
],
[
381,
382
],
[
382,
383
],
[
383,
384
],
[
383,
385
],
[
381,
386
],
[
386,
387
],
[
387,
388
],
[
388,
389
],
[
387,
390
],
[
386,
391
],
[
391,
392
],
[
391,
393
],
[
393,
394
],
[
367,
395
],
[
395,
396
],
[
396,
397
],
[
397,
398
],
[
252,
399
],
[
399,
400
],
[
399,
401
],
[
401,
402
],
[
402,
403
],
[
403,
404
],
[
404,
405
],
[
402,
406
],
[
406,
407
],
[
401,
408
],
[
408,
409
],
[
408,
410
],
[
410,
411
],
[
401,
412
],
[
412,
413
],
[
413,
414
],
[
413,
415
],
[
412,
416
],
[
416,
417
],
[
416,
418
],
[
418,
419
],
[
401,
420
],
[
420,
421
],
[
420,
422
],
[
401,
423
],
[
423,
424
],
[
424,
425
],
[
424,
426
],
[
423,
427
],
[
427,
428
],
[
428,
429
],
[
428,
430
],
[
427,
431
],
[
431,
432
],
[
431,
433
],
[
433,
434
],
[
401,
435
],
[
435,
436
],
[
435,
437
],
[
401,
438
],
[
438,
439
],
[
439,
440
],
[
440,
441
],
[
440,
442
],
[
438,
443
],
[
443,
444
],
[
444,
445
],
[
445,
446
],
[
446,
447
],
[
446,
448
],
[
445,
449
],
[
449,
450
],
[
449,
451
],
[
444,
452
],
[
452,
453
],
[
443,
454
],
[
454,
455
],
[
454,
456
],
[
456,
457
],
[
457,
458
],
[
458,
459
],
[
458,
460
],
[
457,
461
],
[
456,
462
],
[
443,
463
],
[
463,
464
],
[
463,
465
],
[
465,
466
],
[
401,
467
],
[
467,
468
],
[
468,
469
],
[
468,
470
],
[
470,
471
],
[
468,
472
],
[
252,
473
],
[
473,
474
],
[
473,
475
],
[
475,
476
],
[
476,
477
],
[
477,
478
],
[
478,
479
],
[
476,
480
],
[
480,
481
],
[
475,
482
],
[
482,
483
],
[
482,
484
],
[
484,
485
],
[
475,
486
],
[
486,
487
],
[
487,
488
],
[
487,
489
],
[
486,
490
],
[
490,
491
],
[
490,
492
],
[
492,
493
],
[
475,
494
],
[
494,
495
],
[
494,
496
],
[
475,
497
],
[
497,
498
],
[
498,
499
],
[
498,
500
],
[
497,
501
],
[
501,
502
],
[
502,
503
],
[
502,
504
],
[
501,
505
],
[
505,
506
],
[
505,
507
],
[
507,
508
],
[
475,
509
],
[
509,
510
],
[
509,
511
],
[
475,
512
],
[
512,
513
],
[
513,
514
],
[
514,
515
],
[
514,
516
],
[
512,
517
],
[
517,
518
],
[
518,
519
],
[
519,
520
],
[
520,
521
],
[
520,
522
],
[
519,
523
],
[
523,
524
],
[
523,
525
],
[
518,
526
],
[
526,
527
],
[
517,
528
],
[
528,
529
],
[
528,
530
],
[
530,
531
],
[
531,
532
],
[
532,
533
],
[
532,
534
],
[
531,
535
],
[
530,
536
],
[
517,
537
],
[
537,
538
],
[
537,
539
],
[
539,
540
],
[
475,
541
],
[
541,
542
],
[
542,
543
],
[
542,
544
],
[
544,
545
],
[
542,
546
],
[
252,
547
],
[
547,
548
],
[
547,
549
],
[
549,
550
],
[
550,
551
],
[
551,
552
],
[
552,
553
],
[
551,
554
],
[
554,
555
],
[
252,
556
],
[
556,
557
],
[
556,
558
],
[
558,
559
],
[
559,
560
],
[
252,
561
],
[
561,
562
],
[
561,
563
],
[
563,
564
],
[
564,
565
],
[
564,
566
],
[
563,
568
],
[
568,
569
],
[
569,
570
],
[
570,
571
],
[
570,
572
],
[
568,
573
],
[
573,
574
],
[
573,
575
],
[
568,
576
],
[
576,
577
],
[
577,
578
],
[
568,
579
],
[
579,
580
],
[
580,
581
],
[
581,
582
],
[
581,
583
],
[
580,
584
],
[
584,
585
],
[
563,
586
],
[
586,
587
],
[
561,
588
],
[
588,
589
],
[
252,
590
],
[
590,
591
],
[
590,
592
],
[
592,
593
],
[
593,
594
],
[
593,
595
],
[
592,
598
],
[
598,
599
],
[
599,
600
],
[
600,
601
],
[
600,
602
],
[
598,
603
],
[
603,
604
],
[
603,
605
],
[
598,
606
],
[
606,
607
],
[
607,
608
],
[
598,
609
],
[
609,
610
],
[
610,
611
],
[
611,
612
],
[
611,
613
],
[
610,
614
],
[
614,
615
],
[
615,
616
],
[
616,
617
],
[
592,
618
],
[
618,
619
],
[
590,
620
],
[
620,
621
],
[
590,
622
],
[
622,
623
],
[
0,
624
],
[
624,
625
],
[
624,
626
]
] | [
"import java.io.InputStream;\nimport java.io.IOException;\nimport java.io.PrintWriter;\nimport java.util.ArrayDeque;\nimport java.util.ArrayList;\nimport java.util.Arrays;\nimport java.util.BitSet;\nimport java.util.Comparator;\nimport java.util.Deque;\nimport java.util.HashMap;\nimport java.util.HashSet;\nimport java.util.InputMismatchException;\nimport java.util.Map;\nimport java.util.NoSuchElementException;\nimport java.util.PriorityQueue;\nimport java.util.TreeMap;\nimport java.math.BigDecimal;\nimport java.math.BigInteger;\n \npublic class Main{\n \nstatic final InputStream in=System.in;\nstatic final PrintWriter out=new PrintWriter(System.out);\nstatic final int INF=Integer.MAX_VALUE;\nstatic final long LINF=Long.MAX_VALUE;\n \npublic static void main(String[] args) throws IOException{\nInputReader ir=new InputReader(in);\nint r=ir.nextInt();\nint c=ir.nextInt();\nint[][] table=new int[r][c];\nfor(int i=0;i<r;i++){\n for(int j=0;j<c;j++){\n table[i][j]=ir.nextInt();\n }\n}\nfor(int i=0;i<r;i++){\n StringBuilder sb=new StringBuilder();\n int sum=0;\n for(int j=0;j<c;j++){\n sb.append(table[i][j]+\" \");\n sum+=table[i][j];\n }\n sb.append(sum);\n out.println(sb);\n}\nint allsum=0;\nStringBuilder sb=new StringBuilder();\nfor(int i=0;i<c;i++){\n int sum=0;\n for(int j=0;j<r;j++){\n sum+=table[j][i];\n }\n sb.append(sum+\" \");\n allsum+=sum;\n}\nsb.append(allsum);\nout.println(sb);\nout.flush();\n}\n\nstatic class InputReader {\n private InputStream in;\n private byte[] buffer=new byte[1024];\n private int curbuf;\n private int lenbuf;\n \n public InputReader(InputStream in) {this.in=in; this.curbuf=this.lenbuf=0;}\n \n public boolean hasNextByte() {\n if(curbuf>=lenbuf){\n curbuf= 0;\n try{\n lenbuf=in.read(buffer);\n }catch(IOException e) {\n throw new InputMismatchException();\n }\n if(lenbuf<=0) return false;\n }\n return true;\n }\n \n private int readByte(){if(hasNextByte()) return buffer[curbuf++]; else return -1;}\n\n private boolean isSpaceChar(int c){return !(c>=33&&c<=126);}\n \n private void skip(){while(hasNextByte()&&isSpaceChar(buffer[curbuf])) curbuf++;}\n\n public boolean hasNext(){skip(); return hasNextByte();}\n \n public String next(){\n if(!hasNext()) throw new NoSuchElementException();\n StringBuilder sb=new StringBuilder();\n int b=readByte();\n while(!isSpaceChar(b)){\n sb.appendCodePoint(b);\n b=readByte();\n }\n return sb.toString();\n }\n \n public int nextInt() {\n if(!hasNext()) throw new NoSuchElementException();\n int c=readByte();\n while (isSpaceChar(c)) c=readByte();\n boolean minus=false;\n if (c=='-') {\n minus=true;\n c=readByte();\n }\n int res=0;\n do{\n if(c<'0'||c>'9') throw new InputMismatchException();\n res=res*10+c-'0';\n c=readByte();\n }while(!isSpaceChar(c));\n return (minus)?-res:res;\n }\n \n public long nextLong() {\n if(!hasNext()) throw new NoSuchElementException();\n int c=readByte();\n while (isSpaceChar(c)) c=readByte();\n boolean minus=false;\n if (c=='-') {\n minus=true;\n c=readByte();\n }\n long res = 0;\n do{\n if(c<'0'||c>'9') throw new InputMismatchException();\n res=res*10+c-'0';\n c=readByte();\n }while(!isSpaceChar(c));\n return (minus)?-res:res;\n }\n \n public double nextDouble(){return Double.parseDouble(next());}\n \n public BigInteger nextBigInteger(){return new BigInteger(next());}\n \n public int[] nextIntArray(int n){\n int[] a=new int[n];\n for(int i=0;i<n;i++) a[i]=nextInt();\n return a;\n }\n \n public char[][] nextCharMap(int n,int m){\n char[][] map=new char[n][m];\n for(int i=0;i<n;i++) map[i]=next().toCharArray();\n return map;\n }\n}\n}",
"import java.io.InputStream;",
"InputStream",
"java.io",
"import java.io.IOException;",
"IOException",
"java.io",
"import java.io.PrintWriter;",
"PrintWriter",
"java.io",
"import java.util.ArrayDeque;",
"ArrayDeque",
"java.util",
"import java.util.ArrayList;",
"ArrayList",
"java.util",
"import java.util.Arrays;",
"Arrays",
"java.util",
"import java.util.BitSet;",
"BitSet",
"java.util",
"import java.util.Comparator;",
"Comparator",
"java.util",
"import java.util.Deque;",
"Deque",
"java.util",
"import java.util.HashMap;",
"HashMap",
"java.util",
"import java.util.HashSet;",
"HashSet",
"java.util",
"import java.util.InputMismatchException;",
"InputMismatchException",
"java.util",
"import java.util.Map;",
"Map",
"java.util",
"import java.util.NoSuchElementException;",
"NoSuchElementException",
"java.util",
"import java.util.PriorityQueue;",
"PriorityQueue",
"java.util",
"import java.util.TreeMap;",
"TreeMap",
"java.util",
"import java.math.BigDecimal;",
"BigDecimal",
"java.math",
"import java.math.BigInteger;",
"BigInteger",
"java.math",
"public class Main{\n \nstatic final InputStream in=System.in;\nstatic final PrintWriter out=new PrintWriter(System.out);\nstatic final int INF=Integer.MAX_VALUE;\nstatic final long LINF=Long.MAX_VALUE;\n \npublic static void main(String[] args) throws IOException{\nInputReader ir=new InputReader(in);\nint r=ir.nextInt();\nint c=ir.nextInt();\nint[][] table=new int[r][c];\nfor(int i=0;i<r;i++){\n for(int j=0;j<c;j++){\n table[i][j]=ir.nextInt();\n }\n}\nfor(int i=0;i<r;i++){\n StringBuilder sb=new StringBuilder();\n int sum=0;\n for(int j=0;j<c;j++){\n sb.append(table[i][j]+\" \");\n sum+=table[i][j];\n }\n sb.append(sum);\n out.println(sb);\n}\nint allsum=0;\nStringBuilder sb=new StringBuilder();\nfor(int i=0;i<c;i++){\n int sum=0;\n for(int j=0;j<r;j++){\n sum+=table[j][i];\n }\n sb.append(sum+\" \");\n allsum+=sum;\n}\nsb.append(allsum);\nout.println(sb);\nout.flush();\n}\n\nstatic class InputReader {\n private InputStream in;\n private byte[] buffer=new byte[1024];\n private int curbuf;\n private int lenbuf;\n \n public InputReader(InputStream in) {this.in=in; this.curbuf=this.lenbuf=0;}\n \n public boolean hasNextByte() {\n if(curbuf>=lenbuf){\n curbuf= 0;\n try{\n lenbuf=in.read(buffer);\n }catch(IOException e) {\n throw new InputMismatchException();\n }\n if(lenbuf<=0) return false;\n }\n return true;\n }\n \n private int readByte(){if(hasNextByte()) return buffer[curbuf++]; else return -1;}\n\n private boolean isSpaceChar(int c){return !(c>=33&&c<=126);}\n \n private void skip(){while(hasNextByte()&&isSpaceChar(buffer[curbuf])) curbuf++;}\n\n public boolean hasNext(){skip(); return hasNextByte();}\n \n public String next(){\n if(!hasNext()) throw new NoSuchElementException();\n StringBuilder sb=new StringBuilder();\n int b=readByte();\n while(!isSpaceChar(b)){\n sb.appendCodePoint(b);\n b=readByte();\n }\n return sb.toString();\n }\n \n public int nextInt() {\n if(!hasNext()) throw new NoSuchElementException();\n int c=readByte();\n while (isSpaceChar(c)) c=readByte();\n boolean minus=false;\n if (c=='-') {\n minus=true;\n c=readByte();\n }\n int res=0;\n do{\n if(c<'0'||c>'9') throw new InputMismatchException();\n res=res*10+c-'0';\n c=readByte();\n }while(!isSpaceChar(c));\n return (minus)?-res:res;\n }\n \n public long nextLong() {\n if(!hasNext()) throw new NoSuchElementException();\n int c=readByte();\n while (isSpaceChar(c)) c=readByte();\n boolean minus=false;\n if (c=='-') {\n minus=true;\n c=readByte();\n }\n long res = 0;\n do{\n if(c<'0'||c>'9') throw new InputMismatchException();\n res=res*10+c-'0';\n c=readByte();\n }while(!isSpaceChar(c));\n return (minus)?-res:res;\n }\n \n public double nextDouble(){return Double.parseDouble(next());}\n \n public BigInteger nextBigInteger(){return new BigInteger(next());}\n \n public int[] nextIntArray(int n){\n int[] a=new int[n];\n for(int i=0;i<n;i++) a[i]=nextInt();\n return a;\n }\n \n public char[][] nextCharMap(int n,int m){\n char[][] map=new char[n][m];\n for(int i=0;i<n;i++) map[i]=next().toCharArray();\n return map;\n }\n}\n}",
"Main",
"static final InputStream in=System.in;",
"in",
"System.in",
"System",
"System.in",
"static final PrintWriter out=new PrintWriter(System.out);",
"out",
"new PrintWriter(System.out)",
"static final int INF=Integer.MAX_VALUE;",
"INF",
"Integer.MAX_VALUE",
"Integer",
"Integer.MAX_VALUE",
"static final long LINF=Long.MAX_VALUE;",
"LINF",
"Long.MAX_VALUE",
"Long",
"Long.MAX_VALUE",
"public static void main(String[] args) throws IOException{\nInputReader ir=new InputReader(in);\nint r=ir.nextInt();\nint c=ir.nextInt();\nint[][] table=new int[r][c];\nfor(int i=0;i<r;i++){\n for(int j=0;j<c;j++){\n table[i][j]=ir.nextInt();\n }\n}\nfor(int i=0;i<r;i++){\n StringBuilder sb=new StringBuilder();\n int sum=0;\n for(int j=0;j<c;j++){\n sb.append(table[i][j]+\" \");\n sum+=table[i][j];\n }\n sb.append(sum);\n out.println(sb);\n}\nint allsum=0;\nStringBuilder sb=new StringBuilder();\nfor(int i=0;i<c;i++){\n int sum=0;\n for(int j=0;j<r;j++){\n sum+=table[j][i];\n }\n sb.append(sum+\" \");\n allsum+=sum;\n}\nsb.append(allsum);\nout.println(sb);\nout.flush();\n}",
"main",
"{\nInputReader ir=new InputReader(in);\nint r=ir.nextInt();\nint c=ir.nextInt();\nint[][] table=new int[r][c];\nfor(int i=0;i<r;i++){\n for(int j=0;j<c;j++){\n table[i][j]=ir.nextInt();\n }\n}\nfor(int i=0;i<r;i++){\n StringBuilder sb=new StringBuilder();\n int sum=0;\n for(int j=0;j<c;j++){\n sb.append(table[i][j]+\" \");\n sum+=table[i][j];\n }\n sb.append(sum);\n out.println(sb);\n}\nint allsum=0;\nStringBuilder sb=new StringBuilder();\nfor(int i=0;i<c;i++){\n int sum=0;\n for(int j=0;j<r;j++){\n sum+=table[j][i];\n }\n sb.append(sum+\" \");\n allsum+=sum;\n}\nsb.append(allsum);\nout.println(sb);\nout.flush();\n}",
"InputReader ir=new InputReader(in);",
"ir",
"new InputReader(in)",
"int r=ir.nextInt();",
"r",
"ir.nextInt()",
"ir.nextInt",
"ir",
"int c=ir.nextInt();",
"c",
"ir.nextInt()",
"ir.nextInt",
"ir",
"int[][] table=new int[r][c];",
"table",
"new int[r][c]",
"r",
"c",
"for(int i=0;i<r;i++){\n for(int j=0;j<c;j++){\n table[i][j]=ir.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 table[i][j]=ir.nextInt();\n }\n}",
"{\n for(int j=0;j<c;j++){\n table[i][j]=ir.nextInt();\n }\n}",
"for(int j=0;j<c;j++){\n table[i][j]=ir.nextInt();\n }",
"int j=0;",
"int j=0;",
"j",
"0",
"j<c",
"j",
"c",
"j++",
"j++",
"j",
"{\n table[i][j]=ir.nextInt();\n }",
"{\n table[i][j]=ir.nextInt();\n }",
"table[i][j]=ir.nextInt()",
"table[i][j]",
"table[i]",
"table",
"i",
"j",
"ir.nextInt()",
"ir.nextInt",
"ir",
"for(int i=0;i<r;i++){\n StringBuilder sb=new StringBuilder();\n int sum=0;\n for(int j=0;j<c;j++){\n sb.append(table[i][j]+\" \");\n sum+=table[i][j];\n }\n sb.append(sum);\n out.println(sb);\n}",
"int i=0;",
"int i=0;",
"i",
"0",
"i<r",
"i",
"r",
"i++",
"i++",
"i",
"{\n StringBuilder sb=new StringBuilder();\n int sum=0;\n for(int j=0;j<c;j++){\n sb.append(table[i][j]+\" \");\n sum+=table[i][j];\n }\n sb.append(sum);\n out.println(sb);\n}",
"{\n StringBuilder sb=new StringBuilder();\n int sum=0;\n for(int j=0;j<c;j++){\n sb.append(table[i][j]+\" \");\n sum+=table[i][j];\n }\n sb.append(sum);\n out.println(sb);\n}",
"StringBuilder sb=new StringBuilder();",
"sb",
"new StringBuilder()",
"int sum=0;",
"sum",
"0",
"for(int j=0;j<c;j++){\n sb.append(table[i][j]+\" \");\n sum+=table[i][j];\n }",
"int j=0;",
"int j=0;",
"j",
"0",
"j<c",
"j",
"c",
"j++",
"j++",
"j",
"{\n sb.append(table[i][j]+\" \");\n sum+=table[i][j];\n }",
"{\n sb.append(table[i][j]+\" \");\n sum+=table[i][j];\n }",
"sb.append(table[i][j]+\" \")",
"sb.append",
"sb",
"table[i][j]+\" \"",
"table[i][j]",
"table[i]",
"table",
"i",
"j",
"\" \"",
"sum+=table[i][j]",
"sum",
"table[i][j]",
"table[i]",
"table",
"i",
"j",
"sb.append(sum)",
"sb.append",
"sb",
"sum",
"out.println(sb)",
"out.println",
"out",
"sb",
"int allsum=0;",
"allsum",
"0",
"StringBuilder sb=new StringBuilder();",
"sb",
"new StringBuilder()",
"for(int i=0;i<c;i++){\n int sum=0;\n for(int j=0;j<r;j++){\n sum+=table[j][i];\n }\n sb.append(sum+\" \");\n allsum+=sum;\n}",
"int i=0;",
"int i=0;",
"i",
"0",
"i<c",
"i",
"c",
"i++",
"i++",
"i",
"{\n int sum=0;\n for(int j=0;j<r;j++){\n sum+=table[j][i];\n }\n sb.append(sum+\" \");\n allsum+=sum;\n}",
"{\n int sum=0;\n for(int j=0;j<r;j++){\n sum+=table[j][i];\n }\n sb.append(sum+\" \");\n allsum+=sum;\n}",
"int sum=0;",
"sum",
"0",
"for(int j=0;j<r;j++){\n sum+=table[j][i];\n }",
"int j=0;",
"int j=0;",
"j",
"0",
"j<r",
"j",
"r",
"j++",
"j++",
"j",
"{\n sum+=table[j][i];\n }",
"{\n sum+=table[j][i];\n }",
"sum+=table[j][i]",
"sum",
"table[j][i]",
"table[j]",
"table",
"j",
"i",
"sb.append(sum+\" \")",
"sb.append",
"sb",
"sum+\" \"",
"sum",
"\" \"",
"allsum+=sum",
"allsum",
"sum",
"sb.append(allsum)",
"sb.append",
"sb",
"allsum",
"out.println(sb)",
"out.println",
"out",
"sb",
"out.flush()",
"out.flush",
"out",
"String[] args",
"args",
"static class InputReader {\n private InputStream in;\n private byte[] buffer=new byte[1024];\n private int curbuf;\n private int lenbuf;\n \n public InputReader(InputStream in) {this.in=in; this.curbuf=this.lenbuf=0;}\n \n public boolean hasNextByte() {\n if(curbuf>=lenbuf){\n curbuf= 0;\n try{\n lenbuf=in.read(buffer);\n }catch(IOException e) {\n throw new InputMismatchException();\n }\n if(lenbuf<=0) return false;\n }\n return true;\n }\n \n private int readByte(){if(hasNextByte()) return buffer[curbuf++]; else return -1;}\n\n private boolean isSpaceChar(int c){return !(c>=33&&c<=126);}\n \n private void skip(){while(hasNextByte()&&isSpaceChar(buffer[curbuf])) curbuf++;}\n\n public boolean hasNext(){skip(); return hasNextByte();}\n \n public String next(){\n if(!hasNext()) throw new NoSuchElementException();\n StringBuilder sb=new StringBuilder();\n int b=readByte();\n while(!isSpaceChar(b)){\n sb.appendCodePoint(b);\n b=readByte();\n }\n return sb.toString();\n }\n \n public int nextInt() {\n if(!hasNext()) throw new NoSuchElementException();\n int c=readByte();\n while (isSpaceChar(c)) c=readByte();\n boolean minus=false;\n if (c=='-') {\n minus=true;\n c=readByte();\n }\n int res=0;\n do{\n if(c<'0'||c>'9') throw new InputMismatchException();\n res=res*10+c-'0';\n c=readByte();\n }while(!isSpaceChar(c));\n return (minus)?-res:res;\n }\n \n public long nextLong() {\n if(!hasNext()) throw new NoSuchElementException();\n int c=readByte();\n while (isSpaceChar(c)) c=readByte();\n boolean minus=false;\n if (c=='-') {\n minus=true;\n c=readByte();\n }\n long res = 0;\n do{\n if(c<'0'||c>'9') throw new InputMismatchException();\n res=res*10+c-'0';\n c=readByte();\n }while(!isSpaceChar(c));\n return (minus)?-res:res;\n }\n \n public double nextDouble(){return Double.parseDouble(next());}\n \n public BigInteger nextBigInteger(){return new BigInteger(next());}\n \n public int[] nextIntArray(int n){\n int[] a=new int[n];\n for(int i=0;i<n;i++) a[i]=nextInt();\n return a;\n }\n \n public char[][] nextCharMap(int n,int m){\n char[][] map=new char[n][m];\n for(int i=0;i<n;i++) map[i]=next().toCharArray();\n return map;\n }\n}",
"InputReader",
"private InputStream in;",
"in",
"private byte[] buffer=new byte[1024];",
"buffer",
"new byte[1024]",
"1024",
"private int curbuf;",
"curbuf",
"private int lenbuf;",
"lenbuf",
"public InputReader(InputStream in) {this.in=in; this.curbuf=this.lenbuf=0;}",
"InputReader",
"{this.in=in; this.curbuf=this.lenbuf=0;}",
"this.in=in",
"this.in",
"this",
"this.in",
"in",
"this.curbuf=this.lenbuf=0",
"this.curbuf",
"this",
"this.curbuf",
"this.lenbuf=0",
"this.lenbuf",
"this",
"this.lenbuf",
"0",
"InputStream in",
"in",
"public boolean hasNextByte() {\n if(curbuf>=lenbuf){\n curbuf= 0;\n try{\n lenbuf=in.read(buffer);\n }catch(IOException e) {\n throw new InputMismatchException();\n }\n if(lenbuf<=0) return false;\n }\n return true;\n }",
"hasNextByte",
"{\n if(curbuf>=lenbuf){\n curbuf= 0;\n try{\n lenbuf=in.read(buffer);\n }catch(IOException e) {\n throw new InputMismatchException();\n }\n if(lenbuf<=0) return false;\n }\n return true;\n }",
"if(curbuf>=lenbuf){\n curbuf= 0;\n try{\n lenbuf=in.read(buffer);\n }catch(IOException e) {\n throw new InputMismatchException();\n }\n if(lenbuf<=0) return false;\n }",
"curbuf>=lenbuf",
"curbuf",
"lenbuf",
"{\n curbuf= 0;\n try{\n lenbuf=in.read(buffer);\n }catch(IOException e) {\n throw new InputMismatchException();\n }\n if(lenbuf<=0) return false;\n }",
"curbuf= 0",
"curbuf",
"0",
"try{\n lenbuf=in.read(buffer);\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=in.read(buffer);\n }",
"lenbuf=in.read(buffer)",
"lenbuf",
"in.read(buffer)",
"in.read",
"in",
"buffer",
"if(lenbuf<=0) return false;",
"lenbuf<=0",
"lenbuf",
"0",
"return false;",
"false",
"return true;",
"true",
"private int readByte(){if(hasNextByte()) return buffer[curbuf++]; else return -1;}",
"readByte",
"{if(hasNextByte()) return buffer[curbuf++]; else return -1;}",
"if(hasNextByte()) return buffer[curbuf++]; else return -1;",
"hasNextByte()",
"hasNextByte",
"return buffer[curbuf++];",
"buffer[curbuf++]",
"buffer",
"curbuf++",
"curbuf",
"return -1;",
"-1",
"1",
"private boolean isSpaceChar(int c){return !(c>=33&&c<=126);}",
"isSpaceChar",
"{return !(c>=33&&c<=126);}",
"return !(c>=33&&c<=126);",
"!(c>=33&&c<=126)",
"(c>=33&&c<=126)",
"c>=33",
"c",
"33",
"c<=126",
"c",
"126",
"int c",
"c",
"private void skip(){while(hasNextByte()&&isSpaceChar(buffer[curbuf])) curbuf++;}",
"skip",
"{while(hasNextByte()&&isSpaceChar(buffer[curbuf])) curbuf++;}",
"while(hasNextByte()&&isSpaceChar(buffer[curbuf])) curbuf++;",
"hasNextByte()&&isSpaceChar(buffer[curbuf])",
"hasNextByte()",
"hasNextByte",
"isSpaceChar(buffer[curbuf])",
"isSpaceChar",
"buffer[curbuf]",
"buffer",
"curbuf",
"curbuf++",
"curbuf",
"public boolean hasNext(){skip(); return hasNextByte();}",
"hasNext",
"{skip(); return hasNextByte();}",
"skip()",
"skip",
"return hasNextByte();",
"hasNextByte()",
"hasNextByte",
"public String next(){\n if(!hasNext()) throw new NoSuchElementException();\n StringBuilder sb=new StringBuilder();\n int b=readByte();\n while(!isSpaceChar(b)){\n sb.appendCodePoint(b);\n b=readByte();\n }\n return sb.toString();\n }",
"next",
"{\n if(!hasNext()) throw new NoSuchElementException();\n StringBuilder sb=new StringBuilder();\n int b=readByte();\n while(!isSpaceChar(b)){\n sb.appendCodePoint(b);\n b=readByte();\n }\n return sb.toString();\n }",
"if(!hasNext()) throw new NoSuchElementException();",
"!hasNext()",
"hasNext()",
"hasNext",
"throw new NoSuchElementException();",
"new NoSuchElementException()",
"StringBuilder sb=new StringBuilder();",
"sb",
"new StringBuilder()",
"int b=readByte();",
"b",
"readByte()",
"readByte",
"while(!isSpaceChar(b)){\n 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",
"public int nextInt() {\n if(!hasNext()) throw new NoSuchElementException();\n int c=readByte();\n while (isSpaceChar(c)) c=readByte();\n boolean minus=false;\n if (c=='-') {\n minus=true;\n c=readByte();\n }\n int res=0;\n do{\n if(c<'0'||c>'9') throw new InputMismatchException();\n res=res*10+c-'0';\n c=readByte();\n }while(!isSpaceChar(c));\n return (minus)?-res:res;\n }",
"nextInt",
"{\n if(!hasNext()) throw new NoSuchElementException();\n int c=readByte();\n while (isSpaceChar(c)) c=readByte();\n boolean minus=false;\n if (c=='-') {\n minus=true;\n c=readByte();\n }\n int res=0;\n do{\n if(c<'0'||c>'9') throw new InputMismatchException();\n res=res*10+c-'0';\n c=readByte();\n }while(!isSpaceChar(c));\n return (minus)?-res:res;\n }",
"if(!hasNext()) throw new NoSuchElementException();",
"!hasNext()",
"hasNext()",
"hasNext",
"throw new NoSuchElementException();",
"new NoSuchElementException()",
"int c=readByte();",
"c",
"readByte()",
"readByte",
"while (isSpaceChar(c)) c=readByte();",
"isSpaceChar(c)",
"isSpaceChar",
"c",
"c=readByte()",
"c",
"readByte()",
"readByte",
"boolean minus=false;",
"minus",
"false",
"if (c=='-') {\n minus=true;\n c=readByte();\n }",
"c=='-'",
"c",
"'-'",
"{\n minus=true;\n c=readByte();\n }",
"minus=true",
"minus",
"true",
"c=readByte()",
"c",
"readByte()",
"readByte",
"int res=0;",
"res",
"0",
"do{\n if(c<'0'||c>'9') throw new InputMismatchException();\n res=res*10+c-'0';\n c=readByte();\n }while(!isSpaceChar(c));",
"!isSpaceChar(c)",
"isSpaceChar(c)",
"isSpaceChar",
"c",
"{\n if(c<'0'||c>'9') throw new InputMismatchException();\n res=res*10+c-'0';\n c=readByte();\n }",
"if(c<'0'||c>'9') throw new InputMismatchException();",
"c<'0'||c>'9'",
"c<'0'",
"c",
"'0'",
"c>'9'",
"c",
"'9'",
"throw new InputMismatchException();",
"new InputMismatchException()",
"res=res*10+c-'0'",
"res",
"res*10+c-'0'",
"res*10+c",
"res*10",
"res",
"10",
"c",
"'0'",
"c=readByte()",
"c",
"readByte()",
"readByte",
"return (minus)?-res:res;",
"(minus)?-res:res",
"(minus)",
"-res",
"res",
"res",
"public long nextLong() {\n if(!hasNext()) throw new NoSuchElementException();\n int c=readByte();\n while (isSpaceChar(c)) c=readByte();\n boolean minus=false;\n if (c=='-') {\n minus=true;\n c=readByte();\n }\n long res = 0;\n do{\n if(c<'0'||c>'9') throw new InputMismatchException();\n res=res*10+c-'0';\n c=readByte();\n }while(!isSpaceChar(c));\n return (minus)?-res:res;\n }",
"nextLong",
"{\n if(!hasNext()) throw new NoSuchElementException();\n int c=readByte();\n while (isSpaceChar(c)) c=readByte();\n boolean minus=false;\n if (c=='-') {\n minus=true;\n c=readByte();\n }\n long res = 0;\n do{\n if(c<'0'||c>'9') throw new InputMismatchException();\n res=res*10+c-'0';\n c=readByte();\n }while(!isSpaceChar(c));\n return (minus)?-res:res;\n }",
"if(!hasNext()) throw new NoSuchElementException();",
"!hasNext()",
"hasNext()",
"hasNext",
"throw new NoSuchElementException();",
"new NoSuchElementException()",
"int c=readByte();",
"c",
"readByte()",
"readByte",
"while (isSpaceChar(c)) c=readByte();",
"isSpaceChar(c)",
"isSpaceChar",
"c",
"c=readByte()",
"c",
"readByte()",
"readByte",
"boolean minus=false;",
"minus",
"false",
"if (c=='-') {\n minus=true;\n c=readByte();\n }",
"c=='-'",
"c",
"'-'",
"{\n minus=true;\n c=readByte();\n }",
"minus=true",
"minus",
"true",
"c=readByte()",
"c",
"readByte()",
"readByte",
"long res = 0;",
"res",
"0",
"do{\n if(c<'0'||c>'9') throw new InputMismatchException();\n res=res*10+c-'0';\n c=readByte();\n }while(!isSpaceChar(c));",
"!isSpaceChar(c)",
"isSpaceChar(c)",
"isSpaceChar",
"c",
"{\n if(c<'0'||c>'9') throw new InputMismatchException();\n res=res*10+c-'0';\n c=readByte();\n }",
"if(c<'0'||c>'9') throw new InputMismatchException();",
"c<'0'||c>'9'",
"c<'0'",
"c",
"'0'",
"c>'9'",
"c",
"'9'",
"throw new InputMismatchException();",
"new InputMismatchException()",
"res=res*10+c-'0'",
"res",
"res*10+c-'0'",
"res*10+c",
"res*10",
"res",
"10",
"c",
"'0'",
"c=readByte()",
"c",
"readByte()",
"readByte",
"return (minus)?-res:res;",
"(minus)?-res:res",
"(minus)",
"-res",
"res",
"res",
"public double nextDouble(){return Double.parseDouble(next());}",
"nextDouble",
"{return Double.parseDouble(next());}",
"return Double.parseDouble(next());",
"Double.parseDouble(next())",
"Double.parseDouble",
"Double",
"next()",
"next",
"public BigInteger nextBigInteger(){return new BigInteger(next());}",
"nextBigInteger",
"{return new BigInteger(next());}",
"return new BigInteger(next());",
"new BigInteger(next())",
"public int[] nextIntArray(int n){\n int[] a=new int[n];\n for(int i=0;i<n;i++) a[i]=nextInt();\n return a;\n }",
"nextIntArray",
"{\n int[] a=new int[n];\n for(int i=0;i<n;i++) a[i]=nextInt();\n return a;\n }",
"int[] a=new int[n];",
"a",
"new int[n]",
"n",
"for(int i=0;i<n;i++) a[i]=nextInt();",
"int i=0;",
"int i=0;",
"i",
"0",
"i<n",
"i",
"n",
"i++",
"i++",
"i",
"a[i]=nextInt();",
"a[i]=nextInt()",
"a[i]",
"a",
"i",
"nextInt()",
"nextInt",
"return a;",
"a",
"int n",
"n",
"public char[][] nextCharMap(int n,int m){\n char[][] map=new char[n][m];\n for(int i=0;i<n;i++) map[i]=next().toCharArray();\n return map;\n }",
"nextCharMap",
"{\n char[][] map=new char[n][m];\n for(int i=0;i<n;i++) map[i]=next().toCharArray();\n return map;\n }",
"char[][] map=new char[n][m];",
"map",
"new char[n][m]",
"n",
"m",
"for(int i=0;i<n;i++) map[i]=next().toCharArray();",
"int i=0;",
"int i=0;",
"i",
"0",
"i<n",
"i",
"n",
"i++",
"i++",
"i",
"map[i]=next().toCharArray();",
"map[i]=next().toCharArray()",
"map[i]",
"map",
"i",
"next().toCharArray()",
"next().toCharArray",
"next()",
"next",
"return map;",
"map",
"int n",
"n",
"int m",
"m",
"public class Main{\n \nstatic final InputStream in=System.in;\nstatic final PrintWriter out=new PrintWriter(System.out);\nstatic final int INF=Integer.MAX_VALUE;\nstatic final long LINF=Long.MAX_VALUE;\n \npublic static void main(String[] args) throws IOException{\nInputReader ir=new InputReader(in);\nint r=ir.nextInt();\nint c=ir.nextInt();\nint[][] table=new int[r][c];\nfor(int i=0;i<r;i++){\n for(int j=0;j<c;j++){\n table[i][j]=ir.nextInt();\n }\n}\nfor(int i=0;i<r;i++){\n StringBuilder sb=new StringBuilder();\n int sum=0;\n for(int j=0;j<c;j++){\n sb.append(table[i][j]+\" \");\n sum+=table[i][j];\n }\n sb.append(sum);\n out.println(sb);\n}\nint allsum=0;\nStringBuilder sb=new StringBuilder();\nfor(int i=0;i<c;i++){\n int sum=0;\n for(int j=0;j<r;j++){\n sum+=table[j][i];\n }\n sb.append(sum+\" \");\n allsum+=sum;\n}\nsb.append(allsum);\nout.println(sb);\nout.flush();\n}\n\nstatic class InputReader {\n private InputStream in;\n private byte[] buffer=new byte[1024];\n private int curbuf;\n private int lenbuf;\n \n public InputReader(InputStream in) {this.in=in; this.curbuf=this.lenbuf=0;}\n \n public boolean hasNextByte() {\n if(curbuf>=lenbuf){\n curbuf= 0;\n try{\n lenbuf=in.read(buffer);\n }catch(IOException e) {\n throw new InputMismatchException();\n }\n if(lenbuf<=0) return false;\n }\n return true;\n }\n \n private int readByte(){if(hasNextByte()) return buffer[curbuf++]; else return -1;}\n\n private boolean isSpaceChar(int c){return !(c>=33&&c<=126);}\n \n private void skip(){while(hasNextByte()&&isSpaceChar(buffer[curbuf])) curbuf++;}\n\n public boolean hasNext(){skip(); return hasNextByte();}\n \n public String next(){\n if(!hasNext()) throw new NoSuchElementException();\n StringBuilder sb=new StringBuilder();\n int b=readByte();\n while(!isSpaceChar(b)){\n sb.appendCodePoint(b);\n b=readByte();\n }\n return sb.toString();\n }\n \n public int nextInt() {\n if(!hasNext()) throw new NoSuchElementException();\n int c=readByte();\n while (isSpaceChar(c)) c=readByte();\n boolean minus=false;\n if (c=='-') {\n minus=true;\n c=readByte();\n }\n int res=0;\n do{\n if(c<'0'||c>'9') throw new InputMismatchException();\n res=res*10+c-'0';\n c=readByte();\n }while(!isSpaceChar(c));\n return (minus)?-res:res;\n }\n \n public long nextLong() {\n if(!hasNext()) throw new NoSuchElementException();\n int c=readByte();\n while (isSpaceChar(c)) c=readByte();\n boolean minus=false;\n if (c=='-') {\n minus=true;\n c=readByte();\n }\n long res = 0;\n do{\n if(c<'0'||c>'9') throw new InputMismatchException();\n res=res*10+c-'0';\n c=readByte();\n }while(!isSpaceChar(c));\n return (minus)?-res:res;\n }\n \n public double nextDouble(){return Double.parseDouble(next());}\n \n public BigInteger nextBigInteger(){return new BigInteger(next());}\n \n public int[] nextIntArray(int n){\n int[] a=new int[n];\n for(int i=0;i<n;i++) a[i]=nextInt();\n return a;\n }\n \n public char[][] nextCharMap(int n,int m){\n char[][] map=new char[n][m];\n for(int i=0;i<n;i++) map[i]=next().toCharArray();\n return map;\n }\n}\n}",
"public class Main{\n \nstatic final InputStream in=System.in;\nstatic final PrintWriter out=new PrintWriter(System.out);\nstatic final int INF=Integer.MAX_VALUE;\nstatic final long LINF=Long.MAX_VALUE;\n \npublic static void main(String[] args) throws IOException{\nInputReader ir=new InputReader(in);\nint r=ir.nextInt();\nint c=ir.nextInt();\nint[][] table=new int[r][c];\nfor(int i=0;i<r;i++){\n for(int j=0;j<c;j++){\n table[i][j]=ir.nextInt();\n }\n}\nfor(int i=0;i<r;i++){\n StringBuilder sb=new StringBuilder();\n int sum=0;\n for(int j=0;j<c;j++){\n sb.append(table[i][j]+\" \");\n sum+=table[i][j];\n }\n sb.append(sum);\n out.println(sb);\n}\nint allsum=0;\nStringBuilder sb=new StringBuilder();\nfor(int i=0;i<c;i++){\n int sum=0;\n for(int j=0;j<r;j++){\n sum+=table[j][i];\n }\n sb.append(sum+\" \");\n allsum+=sum;\n}\nsb.append(allsum);\nout.println(sb);\nout.flush();\n}\n\nstatic class InputReader {\n private InputStream in;\n private byte[] buffer=new byte[1024];\n private int curbuf;\n private int lenbuf;\n \n public InputReader(InputStream in) {this.in=in; this.curbuf=this.lenbuf=0;}\n \n public boolean hasNextByte() {\n if(curbuf>=lenbuf){\n curbuf= 0;\n try{\n lenbuf=in.read(buffer);\n }catch(IOException e) {\n throw new InputMismatchException();\n }\n if(lenbuf<=0) return false;\n }\n return true;\n }\n \n private int readByte(){if(hasNextByte()) return buffer[curbuf++]; else return -1;}\n\n private boolean isSpaceChar(int c){return !(c>=33&&c<=126);}\n \n private void skip(){while(hasNextByte()&&isSpaceChar(buffer[curbuf])) curbuf++;}\n\n public boolean hasNext(){skip(); return hasNextByte();}\n \n public String next(){\n if(!hasNext()) throw new NoSuchElementException();\n StringBuilder sb=new StringBuilder();\n int b=readByte();\n while(!isSpaceChar(b)){\n sb.appendCodePoint(b);\n b=readByte();\n }\n return sb.toString();\n }\n \n public int nextInt() {\n if(!hasNext()) throw new NoSuchElementException();\n int c=readByte();\n while (isSpaceChar(c)) c=readByte();\n boolean minus=false;\n if (c=='-') {\n minus=true;\n c=readByte();\n }\n int res=0;\n do{\n if(c<'0'||c>'9') throw new InputMismatchException();\n res=res*10+c-'0';\n c=readByte();\n }while(!isSpaceChar(c));\n return (minus)?-res:res;\n }\n \n public long nextLong() {\n if(!hasNext()) throw new NoSuchElementException();\n int c=readByte();\n while (isSpaceChar(c)) c=readByte();\n boolean minus=false;\n if (c=='-') {\n minus=true;\n c=readByte();\n }\n long res = 0;\n do{\n if(c<'0'||c>'9') throw new InputMismatchException();\n res=res*10+c-'0';\n c=readByte();\n }while(!isSpaceChar(c));\n return (minus)?-res:res;\n }\n \n public double nextDouble(){return Double.parseDouble(next());}\n \n public BigInteger nextBigInteger(){return new BigInteger(next());}\n \n public int[] nextIntArray(int n){\n int[] a=new int[n];\n for(int i=0;i<n;i++) a[i]=nextInt();\n return a;\n }\n \n public char[][] nextCharMap(int n,int m){\n char[][] map=new char[n][m];\n for(int i=0;i<n;i++) map[i]=next().toCharArray();\n return map;\n }\n}\n}",
"Main"
] | import java.io.InputStream;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.ArrayDeque;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.BitSet;
import java.util.Comparator;
import java.util.Deque;
import java.util.HashMap;
import java.util.HashSet;
import java.util.InputMismatchException;
import java.util.Map;
import java.util.NoSuchElementException;
import java.util.PriorityQueue;
import java.util.TreeMap;
import java.math.BigDecimal;
import java.math.BigInteger;
public class Main{
static final InputStream in=System.in;
static final PrintWriter out=new PrintWriter(System.out);
static final int INF=Integer.MAX_VALUE;
static final long LINF=Long.MAX_VALUE;
public static void main(String[] args) throws IOException{
InputReader ir=new InputReader(in);
int r=ir.nextInt();
int c=ir.nextInt();
int[][] table=new int[r][c];
for(int i=0;i<r;i++){
for(int j=0;j<c;j++){
table[i][j]=ir.nextInt();
}
}
for(int i=0;i<r;i++){
StringBuilder sb=new StringBuilder();
int sum=0;
for(int j=0;j<c;j++){
sb.append(table[i][j]+" ");
sum+=table[i][j];
}
sb.append(sum);
out.println(sb);
}
int allsum=0;
StringBuilder sb=new StringBuilder();
for(int i=0;i<c;i++){
int sum=0;
for(int j=0;j<r;j++){
sum+=table[j][i];
}
sb.append(sum+" ");
allsum+=sum;
}
sb.append(allsum);
out.println(sb);
out.flush();
}
static class InputReader {
private InputStream in;
private byte[] buffer=new byte[1024];
private int curbuf;
private int lenbuf;
public InputReader(InputStream in) {this.in=in; this.curbuf=this.lenbuf=0;}
public boolean hasNextByte() {
if(curbuf>=lenbuf){
curbuf= 0;
try{
lenbuf=in.read(buffer);
}catch(IOException e) {
throw new InputMismatchException();
}
if(lenbuf<=0) return false;
}
return true;
}
private int readByte(){if(hasNextByte()) return buffer[curbuf++]; else return -1;}
private boolean isSpaceChar(int c){return !(c>=33&&c<=126);}
private void skip(){while(hasNextByte()&&isSpaceChar(buffer[curbuf])) curbuf++;}
public boolean hasNext(){skip(); return hasNextByte();}
public String next(){
if(!hasNext()) throw new NoSuchElementException();
StringBuilder sb=new StringBuilder();
int b=readByte();
while(!isSpaceChar(b)){
sb.appendCodePoint(b);
b=readByte();
}
return sb.toString();
}
public int nextInt() {
if(!hasNext()) throw new NoSuchElementException();
int c=readByte();
while (isSpaceChar(c)) c=readByte();
boolean minus=false;
if (c=='-') {
minus=true;
c=readByte();
}
int res=0;
do{
if(c<'0'||c>'9') throw new InputMismatchException();
res=res*10+c-'0';
c=readByte();
}while(!isSpaceChar(c));
return (minus)?-res:res;
}
public long nextLong() {
if(!hasNext()) throw new NoSuchElementException();
int c=readByte();
while (isSpaceChar(c)) c=readByte();
boolean minus=false;
if (c=='-') {
minus=true;
c=readByte();
}
long res = 0;
do{
if(c<'0'||c>'9') throw new InputMismatchException();
res=res*10+c-'0';
c=readByte();
}while(!isSpaceChar(c));
return (minus)?-res:res;
}
public double nextDouble(){return Double.parseDouble(next());}
public BigInteger nextBigInteger(){return new BigInteger(next());}
public int[] nextIntArray(int n){
int[] a=new int[n];
for(int i=0;i<n;i++) a[i]=nextInt();
return a;
}
public char[][] nextCharMap(int n,int m){
char[][] map=new char[n][m];
for(int i=0;i<n;i++) map[i]=next().toCharArray();
return map;
}
}
} |
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
41,
13,
41,
13,
41,
13,
4,
18,
13,
41,
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,
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,
11,
1,
0,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
41,
13,
17,
11,
1,
0,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
14,
2,
13,
13,
30,
0,
18,
18,
13,
13,
13,
13,
30,
0,
13,
18,
18,
13,
13,
13,
11,
1,
0,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
41,
13,
17,
11,
1,
0,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
14,
2,
13,
13,
30,
0,
18,
18,
13,
13,
13,
13,
30,
0,
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,
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
],
[
261,
5
],
[
261,
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
],
[
18,
20
],
[
20,
21
],
[
21,
22
],
[
8,
23
],
[
23,
24
],
[
23,
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
],
[
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
],
[
96,
98
],
[
98,
99
],
[
99,
100
],
[
95,
101
],
[
101,
102
],
[
102,
103
],
[
103,
104
],
[
103,
105
],
[
102,
106
],
[
101,
107
],
[
8,
108
],
[
108,
109
],
[
109,
110
],
[
110,
111
],
[
110,
112
],
[
108,
113
],
[
113,
114
],
[
113,
115
],
[
108,
116
],
[
116,
117
],
[
117,
118
],
[
108,
119
],
[
120,
120
],
[
120,
121
],
[
121,
122
],
[
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
],
[
138,
139
],
[
138,
140
],
[
137,
141
],
[
141,
142
],
[
142,
143
],
[
143,
144
],
[
144,
145
],
[
144,
146
],
[
143,
147
],
[
142,
148
],
[
137,
149
],
[
149,
150
],
[
150,
151
],
[
150,
152
],
[
152,
153
],
[
153,
154
],
[
153,
155
],
[
152,
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
],
[
170,
172
],
[
169,
173
],
[
173,
174
],
[
174,
175
],
[
175,
176
],
[
175,
177
],
[
173,
178
],
[
178,
179
],
[
178,
180
],
[
173,
181
],
[
181,
182
],
[
182,
183
],
[
173,
184
],
[
185,
185
],
[
185,
186
],
[
186,
187
],
[
187,
188
],
[
187,
189
],
[
186,
190
],
[
190,
191
],
[
191,
192
],
[
192,
193
],
[
193,
194
],
[
193,
195
],
[
192,
196
],
[
191,
197
],
[
186,
198
],
[
198,
199
],
[
199,
200
],
[
199,
201
],
[
201,
202
],
[
202,
203
],
[
202,
204
],
[
201,
205
],
[
8,
206
],
[
206,
207
],
[
207,
208
],
[
208,
209
],
[
208,
210
],
[
206,
211
],
[
211,
212
],
[
211,
213
],
[
206,
214
],
[
214,
215
],
[
215,
216
],
[
206,
217
],
[
218,
218
],
[
218,
219
],
[
219,
220
],
[
220,
221
],
[
221,
222
],
[
221,
223
],
[
219,
224
],
[
224,
225
],
[
224,
226
],
[
219,
227
],
[
227,
228
],
[
228,
229
],
[
219,
230
],
[
231,
231
],
[
231,
232
],
[
232,
233
],
[
233,
234
],
[
234,
235
],
[
234,
236
],
[
232,
237
],
[
237,
238
],
[
238,
239
],
[
238,
240
],
[
237,
241
],
[
231,
242
],
[
242,
243
],
[
243,
244
],
[
243,
245
],
[
242,
246
],
[
246,
247
],
[
247,
248
],
[
248,
249
],
[
249,
250
],
[
249,
251
],
[
247,
252
],
[
218,
253
],
[
253,
254
],
[
254,
255
],
[
255,
256
],
[
255,
257
],
[
6,
258
],
[
258,
259
],
[
0,
260
],
[
260,
261
],
[
260,
262
]
] | [
"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 one[][], i, j;\n\t\t\n\t\tint r = scan.nextInt();\n\t\tint c = scan.nextInt();\n\t\tone = new int[r+1][c+1]; \n\t\t\n\t\tfor(i=0; i<=r; i++){\n\t\t\tfor(j=0; j<=c; j++){\t\t\n\t\t\t\tone[i][j] = 0;\n\t\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++){\t\t\n\t\t\t\tint x = scan.nextInt();\n\t\t\t\tone[i][j] = x;\n\t\t\t}\n\t\t}\n\t\t\n\t\tfor(i=0; i<r; i++){\n\t\t\tint sumx=0;\n\t\t\tfor(j=0; j<=c; j++){\n\t\t\t\tif(j==c){\n\t\t\t\t\tone[i][c] = sumx;\n\t\t\t\t}else{\n\t\t\t\t\tsumx += one[i][j];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tfor(i=0; i<=c; i++){ \n\t\t\tint sumy=0;\n\t\t\tfor(j=0; j<=r; j++){\n\t\t\t\tif(j==r){\n\t\t\t\t\tone[r][i] = sumy;\n\t\t\t\t}else{\n\t\t\t\t\tsumy += one[j][i];\n\t\t\t\t}\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\tSystem.out.print(one[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}\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 one[][], i, j;\n\t\t\n\t\tint r = scan.nextInt();\n\t\tint c = scan.nextInt();\n\t\tone = new int[r+1][c+1]; \n\t\t\n\t\tfor(i=0; i<=r; i++){\n\t\t\tfor(j=0; j<=c; j++){\t\t\n\t\t\t\tone[i][j] = 0;\n\t\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++){\t\t\n\t\t\t\tint x = scan.nextInt();\n\t\t\t\tone[i][j] = x;\n\t\t\t}\n\t\t}\n\t\t\n\t\tfor(i=0; i<r; i++){\n\t\t\tint sumx=0;\n\t\t\tfor(j=0; j<=c; j++){\n\t\t\t\tif(j==c){\n\t\t\t\t\tone[i][c] = sumx;\n\t\t\t\t}else{\n\t\t\t\t\tsumx += one[i][j];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tfor(i=0; i<=c; i++){ \n\t\t\tint sumy=0;\n\t\t\tfor(j=0; j<=r; j++){\n\t\t\t\tif(j==r){\n\t\t\t\t\tone[r][i] = sumy;\n\t\t\t\t}else{\n\t\t\t\t\tsumy += one[j][i];\n\t\t\t\t}\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\tSystem.out.print(one[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}\n}",
"Main",
"public static void main(String [] args){\n\t\tScanner scan = new Scanner(System.in);\n\t\tint one[][], i, j;\n\t\t\n\t\tint r = scan.nextInt();\n\t\tint c = scan.nextInt();\n\t\tone = new int[r+1][c+1]; \n\t\t\n\t\tfor(i=0; i<=r; i++){\n\t\t\tfor(j=0; j<=c; j++){\t\t\n\t\t\t\tone[i][j] = 0;\n\t\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++){\t\t\n\t\t\t\tint x = scan.nextInt();\n\t\t\t\tone[i][j] = x;\n\t\t\t}\n\t\t}\n\t\t\n\t\tfor(i=0; i<r; i++){\n\t\t\tint sumx=0;\n\t\t\tfor(j=0; j<=c; j++){\n\t\t\t\tif(j==c){\n\t\t\t\t\tone[i][c] = sumx;\n\t\t\t\t}else{\n\t\t\t\t\tsumx += one[i][j];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tfor(i=0; i<=c; i++){ \n\t\t\tint sumy=0;\n\t\t\tfor(j=0; j<=r; j++){\n\t\t\t\tif(j==r){\n\t\t\t\t\tone[r][i] = sumy;\n\t\t\t\t}else{\n\t\t\t\t\tsumy += one[j][i];\n\t\t\t\t}\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\tSystem.out.print(one[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}",
"main",
"{\n\t\tScanner scan = new Scanner(System.in);\n\t\tint one[][], i, j;\n\t\t\n\t\tint r = scan.nextInt();\n\t\tint c = scan.nextInt();\n\t\tone = new int[r+1][c+1]; \n\t\t\n\t\tfor(i=0; i<=r; i++){\n\t\t\tfor(j=0; j<=c; j++){\t\t\n\t\t\t\tone[i][j] = 0;\n\t\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++){\t\t\n\t\t\t\tint x = scan.nextInt();\n\t\t\t\tone[i][j] = x;\n\t\t\t}\n\t\t}\n\t\t\n\t\tfor(i=0; i<r; i++){\n\t\t\tint sumx=0;\n\t\t\tfor(j=0; j<=c; j++){\n\t\t\t\tif(j==c){\n\t\t\t\t\tone[i][c] = sumx;\n\t\t\t\t}else{\n\t\t\t\t\tsumx += one[i][j];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tfor(i=0; i<=c; i++){ \n\t\t\tint sumy=0;\n\t\t\tfor(j=0; j<=r; j++){\n\t\t\t\tif(j==r){\n\t\t\t\t\tone[r][i] = sumy;\n\t\t\t\t}else{\n\t\t\t\t\tsumy += one[j][i];\n\t\t\t\t}\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\tSystem.out.print(one[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}",
"Scanner scan = new Scanner(System.in);",
"scan",
"new Scanner(System.in)",
"int one[][]",
"one",
"i",
"i",
"j;",
"j",
"int r = scan.nextInt();",
"r",
"scan.nextInt()",
"scan.nextInt",
"scan",
"int c = scan.nextInt();",
"c",
"scan.nextInt()",
"scan.nextInt",
"scan",
"one = new int[r+1][c+1]",
"one",
"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++){\t\t\n\t\t\t\tone[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++){\t\t\n\t\t\t\tone[i][j] = 0;\n\t\t\t}\n\t\t}",
"{\n\t\t\tfor(j=0; j<=c; j++){\t\t\n\t\t\t\tone[i][j] = 0;\n\t\t\t}\n\t\t}",
"for(j=0; j<=c; j++){\t\t\n\t\t\t\tone[i][j] = 0;\n\t\t\t}",
"j=0;",
"j=0",
"j",
"0",
"j<=c",
"j",
"c",
"j++",
"j++",
"j",
"{\t\t\n\t\t\t\tone[i][j] = 0;\n\t\t\t}",
"{\t\t\n\t\t\t\tone[i][j] = 0;\n\t\t\t}",
"one[i][j] = 0",
"one[i][j]",
"one[i]",
"one",
"i",
"j",
"0",
"for(i=0; i<r; i++){\n\t\t\tfor(j=0; j<c; j++){\t\t\n\t\t\t\tint x = scan.nextInt();\n\t\t\t\tone[i][j] = x;\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++){\t\t\n\t\t\t\tint x = scan.nextInt();\n\t\t\t\tone[i][j] = x;\n\t\t\t}\n\t\t}",
"{\n\t\t\tfor(j=0; j<c; j++){\t\t\n\t\t\t\tint x = scan.nextInt();\n\t\t\t\tone[i][j] = x;\n\t\t\t}\n\t\t}",
"for(j=0; j<c; j++){\t\t\n\t\t\t\tint x = scan.nextInt();\n\t\t\t\tone[i][j] = x;\n\t\t\t}",
"j=0;",
"j=0",
"j",
"0",
"j<c",
"j",
"c",
"j++",
"j++",
"j",
"{\t\t\n\t\t\t\tint x = scan.nextInt();\n\t\t\t\tone[i][j] = x;\n\t\t\t}",
"{\t\t\n\t\t\t\tint x = scan.nextInt();\n\t\t\t\tone[i][j] = x;\n\t\t\t}",
"int x = scan.nextInt();",
"x",
"scan.nextInt()",
"scan.nextInt",
"scan",
"one[i][j] = x",
"one[i][j]",
"one[i]",
"one",
"i",
"j",
"x",
"for(i=0; i<r; i++){\n\t\t\tint sumx=0;\n\t\t\tfor(j=0; j<=c; j++){\n\t\t\t\tif(j==c){\n\t\t\t\t\tone[i][c] = sumx;\n\t\t\t\t}else{\n\t\t\t\t\tsumx += one[i][j];\n\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\tint sumx=0;\n\t\t\tfor(j=0; j<=c; j++){\n\t\t\t\tif(j==c){\n\t\t\t\t\tone[i][c] = sumx;\n\t\t\t\t}else{\n\t\t\t\t\tsumx += one[i][j];\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"{\n\t\t\tint sumx=0;\n\t\t\tfor(j=0; j<=c; j++){\n\t\t\t\tif(j==c){\n\t\t\t\t\tone[i][c] = sumx;\n\t\t\t\t}else{\n\t\t\t\t\tsumx += one[i][j];\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"int sumx=0;",
"sumx",
"0",
"for(j=0; j<=c; j++){\n\t\t\t\tif(j==c){\n\t\t\t\t\tone[i][c] = sumx;\n\t\t\t\t}else{\n\t\t\t\t\tsumx += one[i][j];\n\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\tone[i][c] = sumx;\n\t\t\t\t}else{\n\t\t\t\t\tsumx += one[i][j];\n\t\t\t\t}\n\t\t\t}",
"{\n\t\t\t\tif(j==c){\n\t\t\t\t\tone[i][c] = sumx;\n\t\t\t\t}else{\n\t\t\t\t\tsumx += one[i][j];\n\t\t\t\t}\n\t\t\t}",
"if(j==c){\n\t\t\t\t\tone[i][c] = sumx;\n\t\t\t\t}else{\n\t\t\t\t\tsumx += one[i][j];\n\t\t\t\t}",
"j==c",
"j",
"c",
"{\n\t\t\t\t\tone[i][c] = sumx;\n\t\t\t\t}",
"one[i][c] = sumx",
"one[i][c]",
"one[i]",
"one",
"i",
"c",
"sumx",
"{\n\t\t\t\t\tsumx += one[i][j];\n\t\t\t\t}",
"sumx += one[i][j]",
"sumx",
"one[i][j]",
"one[i]",
"one",
"i",
"j",
"for(i=0; i<=c; i++){ \n\t\t\tint sumy=0;\n\t\t\tfor(j=0; j<=r; j++){\n\t\t\t\tif(j==r){\n\t\t\t\t\tone[r][i] = sumy;\n\t\t\t\t}else{\n\t\t\t\t\tsumy += one[j][i];\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"i=0;",
"i=0",
"i",
"0",
"i<=c",
"i",
"c",
"i++",
"i++",
"i",
"{ \n\t\t\tint sumy=0;\n\t\t\tfor(j=0; j<=r; j++){\n\t\t\t\tif(j==r){\n\t\t\t\t\tone[r][i] = sumy;\n\t\t\t\t}else{\n\t\t\t\t\tsumy += one[j][i];\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"{ \n\t\t\tint sumy=0;\n\t\t\tfor(j=0; j<=r; j++){\n\t\t\t\tif(j==r){\n\t\t\t\t\tone[r][i] = sumy;\n\t\t\t\t}else{\n\t\t\t\t\tsumy += one[j][i];\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"int sumy=0;",
"sumy",
"0",
"for(j=0; j<=r; j++){\n\t\t\t\tif(j==r){\n\t\t\t\t\tone[r][i] = sumy;\n\t\t\t\t}else{\n\t\t\t\t\tsumy += one[j][i];\n\t\t\t\t}\n\t\t\t}",
"j=0;",
"j=0",
"j",
"0",
"j<=r",
"j",
"r",
"j++",
"j++",
"j",
"{\n\t\t\t\tif(j==r){\n\t\t\t\t\tone[r][i] = sumy;\n\t\t\t\t}else{\n\t\t\t\t\tsumy += one[j][i];\n\t\t\t\t}\n\t\t\t}",
"{\n\t\t\t\tif(j==r){\n\t\t\t\t\tone[r][i] = sumy;\n\t\t\t\t}else{\n\t\t\t\t\tsumy += one[j][i];\n\t\t\t\t}\n\t\t\t}",
"if(j==r){\n\t\t\t\t\tone[r][i] = sumy;\n\t\t\t\t}else{\n\t\t\t\t\tsumy += one[j][i];\n\t\t\t\t}",
"j==r",
"j",
"r",
"{\n\t\t\t\t\tone[r][i] = sumy;\n\t\t\t\t}",
"one[r][i] = sumy",
"one[r][i]",
"one[r]",
"one",
"r",
"i",
"sumy",
"{\n\t\t\t\t\tsumy += one[j][i];\n\t\t\t\t}",
"sumy += one[j][i]",
"sumy",
"one[j][i]",
"one[j]",
"one",
"j",
"i",
"for(i=0; i<=r; i++){\n\t\t\tfor(j=0; j<=c; j++){\n\t\t\t\tSystem.out.print(one[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}",
"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.print(one[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(j=0; j<=c; j++){\n\t\t\t\tSystem.out.print(one[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(j=0; j<=c; j++){\n\t\t\t\tSystem.out.print(one[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}",
"j=0;",
"j=0",
"j",
"0",
"j<=c",
"j",
"c",
"j++",
"j++",
"j",
"{\n\t\t\t\tSystem.out.print(one[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(one[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(one[i][j])",
"System.out.print",
"System.out",
"System",
"System.out",
"one[i][j]",
"one[i]",
"one",
"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",
"String [] args",
"args",
"public class Main {\n\tpublic static void main(String [] args){\n\t\tScanner scan = new Scanner(System.in);\n\t\tint one[][], i, j;\n\t\t\n\t\tint r = scan.nextInt();\n\t\tint c = scan.nextInt();\n\t\tone = new int[r+1][c+1]; \n\t\t\n\t\tfor(i=0; i<=r; i++){\n\t\t\tfor(j=0; j<=c; j++){\t\t\n\t\t\t\tone[i][j] = 0;\n\t\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++){\t\t\n\t\t\t\tint x = scan.nextInt();\n\t\t\t\tone[i][j] = x;\n\t\t\t}\n\t\t}\n\t\t\n\t\tfor(i=0; i<r; i++){\n\t\t\tint sumx=0;\n\t\t\tfor(j=0; j<=c; j++){\n\t\t\t\tif(j==c){\n\t\t\t\t\tone[i][c] = sumx;\n\t\t\t\t}else{\n\t\t\t\t\tsumx += one[i][j];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tfor(i=0; i<=c; i++){ \n\t\t\tint sumy=0;\n\t\t\tfor(j=0; j<=r; j++){\n\t\t\t\tif(j==r){\n\t\t\t\t\tone[r][i] = sumy;\n\t\t\t\t}else{\n\t\t\t\t\tsumy += one[j][i];\n\t\t\t\t}\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\tSystem.out.print(one[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}\n}",
"public class Main {\n\tpublic static void main(String [] args){\n\t\tScanner scan = new Scanner(System.in);\n\t\tint one[][], i, j;\n\t\t\n\t\tint r = scan.nextInt();\n\t\tint c = scan.nextInt();\n\t\tone = new int[r+1][c+1]; \n\t\t\n\t\tfor(i=0; i<=r; i++){\n\t\t\tfor(j=0; j<=c; j++){\t\t\n\t\t\t\tone[i][j] = 0;\n\t\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++){\t\t\n\t\t\t\tint x = scan.nextInt();\n\t\t\t\tone[i][j] = x;\n\t\t\t}\n\t\t}\n\t\t\n\t\tfor(i=0; i<r; i++){\n\t\t\tint sumx=0;\n\t\t\tfor(j=0; j<=c; j++){\n\t\t\t\tif(j==c){\n\t\t\t\t\tone[i][c] = sumx;\n\t\t\t\t}else{\n\t\t\t\t\tsumx += one[i][j];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tfor(i=0; i<=c; i++){ \n\t\t\tint sumy=0;\n\t\t\tfor(j=0; j<=r; j++){\n\t\t\t\tif(j==r){\n\t\t\t\t\tone[r][i] = sumy;\n\t\t\t\t}else{\n\t\t\t\t\tsumy += one[j][i];\n\t\t\t\t}\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\tSystem.out.print(one[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}\n}",
"Main"
] | import java.util.Scanner;
public class Main {
public static void main(String [] args){
Scanner scan = new Scanner(System.in);
int one[][], i, j;
int r = scan.nextInt();
int c = scan.nextInt();
one = new int[r+1][c+1];
for(i=0; i<=r; i++){
for(j=0; j<=c; j++){
one[i][j] = 0;
}
}
for(i=0; i<r; i++){
for(j=0; j<c; j++){
int x = scan.nextInt();
one[i][j] = x;
}
}
for(i=0; i<r; i++){
int sumx=0;
for(j=0; j<=c; j++){
if(j==c){
one[i][c] = sumx;
}else{
sumx += one[i][j];
}
}
}
for(i=0; i<=c; i++){
int sumy=0;
for(j=0; j<=r; j++){
if(j==r){
one[r][i] = sumy;
}else{
sumy += one[j][i];
}
}
}
for(i=0; i<=r; i++){
for(j=0; j<=c; j++){
System.out.print(one[i][j]);
if(j != c){
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,
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,
4,
18,
13,
17,
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,
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,
41,
13,
20,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
4,
18,
13,
18,
18,
13,
13,
13,
14,
2,
13,
13,
4,
18,
13,
17,
14,
2,
13,
13,
4,
18,
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
],
[
236,
11
],
[
236,
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
],
[
66,
72
],
[
63,
73
],
[
73,
74
],
[
74,
75
],
[
75,
76
],
[
75,
77
],
[
73,
78
],
[
78,
79
],
[
78,
80
],
[
73,
81
],
[
81,
82
],
[
82,
83
],
[
73,
84
],
[
85,
85
],
[
85,
86
],
[
86,
87
],
[
87,
88
],
[
88,
89
],
[
88,
90
],
[
87,
91
],
[
86,
92
],
[
92,
93
],
[
93,
94
],
[
92,
95
],
[
95,
96
],
[
95,
97
],
[
14,
98
],
[
98,
99
],
[
99,
100
],
[
100,
101
],
[
100,
102
],
[
98,
103
],
[
103,
104
],
[
103,
105
],
[
98,
106
],
[
106,
107
],
[
107,
108
],
[
98,
109
],
[
110,
110
],
[
110,
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
],
[
125,
129
],
[
124,
130
],
[
130,
131
],
[
131,
132
],
[
131,
133
],
[
130,
134
],
[
14,
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
],
[
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
],
[
164,
168
],
[
163,
169
],
[
169,
170
],
[
170,
171
],
[
170,
172
],
[
169,
173
],
[
14,
174
],
[
174,
175
],
[
174,
176
],
[
14,
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
],
[
203,
206
],
[
206,
207
],
[
207,
208
],
[
207,
209
],
[
206,
210
],
[
202,
211
],
[
211,
212
],
[
212,
213
],
[
212,
214
],
[
211,
215
],
[
215,
216
],
[
216,
217
],
[
215,
218
],
[
189,
219
],
[
219,
220
],
[
220,
221
],
[
220,
222
],
[
219,
223
],
[
223,
224
],
[
224,
225
],
[
223,
226
],
[
14,
227
],
[
227,
228
],
[
228,
229
],
[
229,
230
],
[
229,
231
],
[
227,
232
],
[
12,
233
],
[
233,
234
],
[
0,
235
],
[
235,
236
],
[
235,
237
]
] | [
"import java.io.IOException;\nimport java.io.BufferedReader;\nimport java.io.InputStreamReader;\n\npublic class Main{\n public static void main(String[] args) throws IOException{\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\n String[] input = br.readLine().split(\" \");\n int r = Integer.valueOf(input[0]);\n int c = Integer.valueOf(input[1]);\n\n int[][] matrix = new int[r+1][c+1];\n \n //input data\n for(int i = 0; i < r; i++){\n String[] line = br.readLine().split(\" \" , c);\n for(int j = 0; j < c; j++){\n matrix[i][j] = Integer.parseInt(line[j]);\n }\n }\n\n for(int i = 0; i < r; i++){\n for(int j = 0; j < c; j++){\n matrix[i][c] += matrix[i][j];\n }\n }\n\n for(int i = 0; i < c+1; i++){\n for(int j = 0; j < r; j++){\n matrix[r][i] += matrix[j][i];\n }\n }\n \n StringBuilder sb = new StringBuilder();\n for(int i = 0; i <= r; i++){\n for(int j = 0; j <= c; j++){\n sb.append(matrix[i][j]);\n if(j != c) sb.append(\" \");\n }\n if(i != r)sb.append(\"\\n\");\n }\n System.out.println(sb);\n\n }\n}",
"import java.io.IOException;",
"IOException",
"java.io",
"import java.io.BufferedReader;",
"BufferedReader",
"java.io",
"import java.io.InputStreamReader;",
"InputStreamReader",
"java.io",
"public class Main{\n public static void main(String[] args) throws IOException{\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\n String[] input = br.readLine().split(\" \");\n int r = Integer.valueOf(input[0]);\n int c = Integer.valueOf(input[1]);\n\n int[][] matrix = new int[r+1][c+1];\n \n //input data\n for(int i = 0; i < r; i++){\n String[] line = br.readLine().split(\" \" , c);\n for(int j = 0; j < c; j++){\n matrix[i][j] = Integer.parseInt(line[j]);\n }\n }\n\n for(int i = 0; i < r; i++){\n for(int j = 0; j < c; j++){\n matrix[i][c] += matrix[i][j];\n }\n }\n\n for(int i = 0; i < c+1; i++){\n for(int j = 0; j < r; j++){\n matrix[r][i] += matrix[j][i];\n }\n }\n \n StringBuilder sb = new StringBuilder();\n for(int i = 0; i <= r; i++){\n for(int j = 0; j <= c; j++){\n sb.append(matrix[i][j]);\n if(j != c) sb.append(\" \");\n }\n if(i != r)sb.append(\"\\n\");\n }\n System.out.println(sb);\n\n }\n}",
"Main",
"public static void main(String[] args) throws IOException{\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\n String[] input = br.readLine().split(\" \");\n int r = Integer.valueOf(input[0]);\n int c = Integer.valueOf(input[1]);\n\n int[][] matrix = new int[r+1][c+1];\n \n //input data\n for(int i = 0; i < r; i++){\n String[] line = br.readLine().split(\" \" , c);\n for(int j = 0; j < c; j++){\n matrix[i][j] = Integer.parseInt(line[j]);\n }\n }\n\n for(int i = 0; i < r; i++){\n for(int j = 0; j < c; j++){\n matrix[i][c] += matrix[i][j];\n }\n }\n\n for(int i = 0; i < c+1; i++){\n for(int j = 0; j < r; j++){\n matrix[r][i] += matrix[j][i];\n }\n }\n \n StringBuilder sb = new StringBuilder();\n for(int i = 0; i <= r; i++){\n for(int j = 0; j <= c; j++){\n sb.append(matrix[i][j]);\n if(j != c) sb.append(\" \");\n }\n if(i != r)sb.append(\"\\n\");\n }\n System.out.println(sb);\n\n }",
"main",
"{\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\n String[] input = br.readLine().split(\" \");\n int r = Integer.valueOf(input[0]);\n int c = Integer.valueOf(input[1]);\n\n int[][] matrix = new int[r+1][c+1];\n \n //input data\n for(int i = 0; i < r; i++){\n String[] line = br.readLine().split(\" \" , c);\n for(int j = 0; j < c; j++){\n matrix[i][j] = Integer.parseInt(line[j]);\n }\n }\n\n for(int i = 0; i < r; i++){\n for(int j = 0; j < c; j++){\n matrix[i][c] += matrix[i][j];\n }\n }\n\n for(int i = 0; i < c+1; i++){\n for(int j = 0; j < r; j++){\n matrix[r][i] += matrix[j][i];\n }\n }\n \n StringBuilder sb = new StringBuilder();\n for(int i = 0; i <= r; i++){\n for(int j = 0; j <= c; j++){\n sb.append(matrix[i][j]);\n if(j != c) sb.append(\" \");\n }\n if(i != r)sb.append(\"\\n\");\n }\n System.out.println(sb);\n\n }",
"BufferedReader br = new BufferedReader(new InputStreamReader(System.in));",
"br",
"new BufferedReader(new InputStreamReader(System.in))",
"String[] input = br.readLine().split(\" \");",
"input",
"br.readLine().split(\" \")",
"br.readLine().split",
"br.readLine()",
"br.readLine",
"br",
"\" \"",
"int r = Integer.valueOf(input[0]);",
"r",
"Integer.valueOf(input[0])",
"Integer.valueOf",
"Integer",
"input[0]",
"input",
"0",
"int c = Integer.valueOf(input[1]);",
"c",
"Integer.valueOf(input[1])",
"Integer.valueOf",
"Integer",
"input[1]",
"input",
"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 String[] line = br.readLine().split(\" \" , c);\n for(int j = 0; j < c; j++){\n matrix[i][j] = Integer.parseInt(line[j]);\n }\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < r",
"i",
"r",
"i++",
"i++",
"i",
"{\n String[] line = br.readLine().split(\" \" , c);\n for(int j = 0; j < c; j++){\n matrix[i][j] = Integer.parseInt(line[j]);\n }\n }",
"{\n String[] line = br.readLine().split(\" \" , c);\n for(int j = 0; j < c; j++){\n matrix[i][j] = Integer.parseInt(line[j]);\n }\n }",
"String[] line = br.readLine().split(\" \" , c);",
"line",
"br.readLine().split(\" \" , c)",
"br.readLine().split",
"br.readLine()",
"br.readLine",
"br",
"\" \"",
"c",
"for(int j = 0; j < c; j++){\n matrix[i][j] = Integer.parseInt(line[j]);\n }",
"int j = 0;",
"int j = 0;",
"j",
"0",
"j < c",
"j",
"c",
"j++",
"j++",
"j",
"{\n matrix[i][j] = Integer.parseInt(line[j]);\n }",
"{\n matrix[i][j] = Integer.parseInt(line[j]);\n }",
"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",
"for(int i = 0; i < r; i++){\n for(int j = 0; j < c; j++){\n matrix[i][c] += 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 matrix[i][c] += matrix[i][j];\n }\n }",
"{\n for(int j = 0; j < c; j++){\n matrix[i][c] += matrix[i][j];\n }\n }",
"for(int j = 0; j < c; j++){\n matrix[i][c] += matrix[i][j];\n }",
"int j = 0;",
"int j = 0;",
"j",
"0",
"j < c",
"j",
"c",
"j++",
"j++",
"j",
"{\n matrix[i][c] += matrix[i][j];\n }",
"{\n matrix[i][c] += matrix[i][j];\n }",
"matrix[i][c] += matrix[i][j]",
"matrix[i][c]",
"matrix[i]",
"matrix",
"i",
"c",
"matrix[i][j]",
"matrix[i]",
"matrix",
"i",
"j",
"for(int i = 0; i < c+1; i++){\n for(int j = 0; j < r; j++){\n matrix[r][i] += matrix[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 matrix[r][i] += matrix[j][i];\n }\n }",
"{\n for(int j = 0; j < r; j++){\n matrix[r][i] += matrix[j][i];\n }\n }",
"for(int j = 0; j < r; j++){\n matrix[r][i] += matrix[j][i];\n }",
"int j = 0;",
"int j = 0;",
"j",
"0",
"j < r",
"j",
"r",
"j++",
"j++",
"j",
"{\n matrix[r][i] += matrix[j][i];\n }",
"{\n matrix[r][i] += matrix[j][i];\n }",
"matrix[r][i] += matrix[j][i]",
"matrix[r][i]",
"matrix[r]",
"matrix",
"r",
"i",
"matrix[j][i]",
"matrix[j]",
"matrix",
"j",
"i",
"StringBuilder sb = new StringBuilder();",
"sb",
"new StringBuilder()",
"for(int i = 0; i <= r; i++){\n for(int j = 0; j <= c; j++){\n sb.append(matrix[i][j]);\n if(j != c) sb.append(\" \");\n }\n if(i != r)sb.append(\"\\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 sb.append(matrix[i][j]);\n if(j != c) sb.append(\" \");\n }\n if(i != r)sb.append(\"\\n\");\n }",
"{\n for(int j = 0; j <= c; j++){\n sb.append(matrix[i][j]);\n if(j != c) sb.append(\" \");\n }\n if(i != r)sb.append(\"\\n\");\n }",
"for(int j = 0; j <= c; j++){\n sb.append(matrix[i][j]);\n if(j != c) sb.append(\" \");\n }",
"int j = 0;",
"int j = 0;",
"j",
"0",
"j <= c",
"j",
"c",
"j++",
"j++",
"j",
"{\n sb.append(matrix[i][j]);\n if(j != c) sb.append(\" \");\n }",
"{\n sb.append(matrix[i][j]);\n if(j != c) sb.append(\" \");\n }",
"sb.append(matrix[i][j])",
"sb.append",
"sb",
"matrix[i][j]",
"matrix[i]",
"matrix",
"i",
"j",
"if(j != c) sb.append(\" \");",
"j != c",
"j",
"c",
"sb.append(\" \")",
"sb.append",
"sb",
"\" \"",
"if(i != r)sb.append(\"\\n\");",
"i != r",
"i",
"r",
"sb.append(\"\\n\")",
"sb.append",
"sb",
"\"\\n\"",
"System.out.println(sb)",
"System.out.println",
"System.out",
"System",
"System.out",
"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\n String[] input = br.readLine().split(\" \");\n int r = Integer.valueOf(input[0]);\n int c = Integer.valueOf(input[1]);\n\n int[][] matrix = new int[r+1][c+1];\n \n //input data\n for(int i = 0; i < r; i++){\n String[] line = br.readLine().split(\" \" , c);\n for(int j = 0; j < c; j++){\n matrix[i][j] = Integer.parseInt(line[j]);\n }\n }\n\n for(int i = 0; i < r; i++){\n for(int j = 0; j < c; j++){\n matrix[i][c] += matrix[i][j];\n }\n }\n\n for(int i = 0; i < c+1; i++){\n for(int j = 0; j < r; j++){\n matrix[r][i] += matrix[j][i];\n }\n }\n \n StringBuilder sb = new StringBuilder();\n for(int i = 0; i <= r; i++){\n for(int j = 0; j <= c; j++){\n sb.append(matrix[i][j]);\n if(j != c) sb.append(\" \");\n }\n if(i != r)sb.append(\"\\n\");\n }\n System.out.println(sb);\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\n String[] input = br.readLine().split(\" \");\n int r = Integer.valueOf(input[0]);\n int c = Integer.valueOf(input[1]);\n\n int[][] matrix = new int[r+1][c+1];\n \n //input data\n for(int i = 0; i < r; i++){\n String[] line = br.readLine().split(\" \" , c);\n for(int j = 0; j < c; j++){\n matrix[i][j] = Integer.parseInt(line[j]);\n }\n }\n\n for(int i = 0; i < r; i++){\n for(int j = 0; j < c; j++){\n matrix[i][c] += matrix[i][j];\n }\n }\n\n for(int i = 0; i < c+1; i++){\n for(int j = 0; j < r; j++){\n matrix[r][i] += matrix[j][i];\n }\n }\n \n StringBuilder sb = new StringBuilder();\n for(int i = 0; i <= r; i++){\n for(int j = 0; j <= c; j++){\n sb.append(matrix[i][j]);\n if(j != c) sb.append(\" \");\n }\n if(i != r)sb.append(\"\\n\");\n }\n System.out.println(sb);\n\n }\n}",
"Main"
] | import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
public class Main{
public static void main(String[] args) throws IOException{
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
String[] input = br.readLine().split(" ");
int r = Integer.valueOf(input[0]);
int c = Integer.valueOf(input[1]);
int[][] matrix = new int[r+1][c+1];
//input data
for(int i = 0; i < r; i++){
String[] line = br.readLine().split(" " , c);
for(int j = 0; j < c; j++){
matrix[i][j] = Integer.parseInt(line[j]);
}
}
for(int i = 0; i < r; i++){
for(int j = 0; j < c; j++){
matrix[i][c] += matrix[i][j];
}
}
for(int i = 0; i < c+1; i++){
for(int j = 0; j < r; j++){
matrix[r][i] += matrix[j][i];
}
}
StringBuilder sb = new StringBuilder();
for(int i = 0; i <= r; i++){
for(int j = 0; j <= c; j++){
sb.append(matrix[i][j]);
if(j != c) sb.append(" ");
}
if(i != r)sb.append("\n");
}
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,
20,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
4,
18,
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,
4,
18,
18,
13,
13,
2,
13,
17,
0,
13,
13,
4,
18,
13,
13,
2,
4,
18,
13,
13,
13,
4,
18,
18,
13,
13,
13,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
4,
18,
18,
13,
13,
2,
4,
18,
13,
13,
17,
0,
13,
4,
18,
13,
13,
4,
18,
18,
13,
13,
13,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
144,
5
],
[
144,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
8,
17
],
[
17,
18
],
[
17,
19
],
[
19,
20
],
[
20,
21
],
[
8,
22
],
[
22,
23
],
[
22,
24
],
[
8,
25
],
[
25,
26
],
[
26,
27
],
[
27,
28
],
[
27,
29
],
[
25,
30
],
[
30,
31
],
[
30,
32
],
[
25,
33
],
[
33,
34
],
[
34,
35
],
[
25,
36
],
[
36,
37
],
[
37,
38
],
[
38,
39
],
[
37,
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
],
[
54,
56
],
[
53,
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
],
[
69,
75
],
[
75,
76
],
[
76,
77
],
[
77,
78
],
[
77,
79
],
[
75,
80
],
[
80,
81
],
[
80,
82
],
[
69,
83
],
[
83,
84
],
[
83,
85
],
[
69,
86
],
[
86,
87
],
[
87,
88
],
[
86,
89
],
[
86,
90
],
[
90,
91
],
[
91,
92
],
[
92,
93
],
[
91,
94
],
[
90,
95
],
[
53,
96
],
[
96,
97
],
[
97,
98
],
[
98,
99
],
[
98,
100
],
[
96,
101
],
[
8,
102
],
[
102,
103
],
[
102,
104
],
[
8,
105
],
[
105,
106
],
[
106,
107
],
[
107,
108
],
[
107,
109
],
[
105,
110
],
[
110,
111
],
[
110,
112
],
[
105,
113
],
[
113,
114
],
[
114,
115
],
[
105,
116
],
[
117,
117
],
[
117,
118
],
[
118,
119
],
[
119,
120
],
[
120,
121
],
[
120,
122
],
[
118,
123
],
[
123,
124
],
[
124,
125
],
[
125,
126
],
[
124,
127
],
[
123,
128
],
[
117,
129
],
[
129,
130
],
[
129,
131
],
[
131,
132
],
[
132,
133
],
[
131,
134
],
[
8,
135
],
[
135,
136
],
[
136,
137
],
[
137,
138
],
[
137,
139
],
[
135,
140
],
[
6,
141
],
[
141,
142
],
[
0,
143
],
[
143,
144
],
[
143,
145
]
] | [
"\nimport java.util.*;\n\npublic class Main {\n\t\n\tpublic static void main(String[] args) {\n\t\tScanner cin=new Scanner(System.in);\n\t\t\n\t\tint r=cin.nextInt(),c=cin.nextInt();\n\t\tList<Integer> rsum=new ArrayList<>();\n\t\tfor(int i=0;i<c;i++)rsum.add(0);\n\t\t\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\tint x=cin.nextInt();\n\t\t\t\tSystem.out.print(x+\" \");\n\t\t\t\tsum+=x;\n\t\t\t\trsum.set(j, rsum.get(j)+x);\n\t\t\t}\n\t\t\tSystem.out.println(sum);\n\t\t}\n\t\t\n\t\tint rcsum=0;\n\t\tfor(int i=0;i<c;i++) {\n\t\t\tSystem.out.print(rsum.get(i)+\" \");\n\t\t\trcsum+=rsum.get(i);\n\t\t}\n\t\tSystem.out.println(rcsum);\n\t}\n\t\n}",
"import java.util.*;",
"util.*",
"java",
"public class Main {\n\t\n\tpublic static void main(String[] args) {\n\t\tScanner cin=new Scanner(System.in);\n\t\t\n\t\tint r=cin.nextInt(),c=cin.nextInt();\n\t\tList<Integer> rsum=new ArrayList<>();\n\t\tfor(int i=0;i<c;i++)rsum.add(0);\n\t\t\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\tint x=cin.nextInt();\n\t\t\t\tSystem.out.print(x+\" \");\n\t\t\t\tsum+=x;\n\t\t\t\trsum.set(j, rsum.get(j)+x);\n\t\t\t}\n\t\t\tSystem.out.println(sum);\n\t\t}\n\t\t\n\t\tint rcsum=0;\n\t\tfor(int i=0;i<c;i++) {\n\t\t\tSystem.out.print(rsum.get(i)+\" \");\n\t\t\trcsum+=rsum.get(i);\n\t\t}\n\t\tSystem.out.println(rcsum);\n\t}\n\t\n}",
"Main",
"public static void main(String[] args) {\n\t\tScanner cin=new Scanner(System.in);\n\t\t\n\t\tint r=cin.nextInt(),c=cin.nextInt();\n\t\tList<Integer> rsum=new ArrayList<>();\n\t\tfor(int i=0;i<c;i++)rsum.add(0);\n\t\t\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\tint x=cin.nextInt();\n\t\t\t\tSystem.out.print(x+\" \");\n\t\t\t\tsum+=x;\n\t\t\t\trsum.set(j, rsum.get(j)+x);\n\t\t\t}\n\t\t\tSystem.out.println(sum);\n\t\t}\n\t\t\n\t\tint rcsum=0;\n\t\tfor(int i=0;i<c;i++) {\n\t\t\tSystem.out.print(rsum.get(i)+\" \");\n\t\t\trcsum+=rsum.get(i);\n\t\t}\n\t\tSystem.out.println(rcsum);\n\t}",
"main",
"{\n\t\tScanner cin=new Scanner(System.in);\n\t\t\n\t\tint r=cin.nextInt(),c=cin.nextInt();\n\t\tList<Integer> rsum=new ArrayList<>();\n\t\tfor(int i=0;i<c;i++)rsum.add(0);\n\t\t\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\tint x=cin.nextInt();\n\t\t\t\tSystem.out.print(x+\" \");\n\t\t\t\tsum+=x;\n\t\t\t\trsum.set(j, rsum.get(j)+x);\n\t\t\t}\n\t\t\tSystem.out.println(sum);\n\t\t}\n\t\t\n\t\tint rcsum=0;\n\t\tfor(int i=0;i<c;i++) {\n\t\t\tSystem.out.print(rsum.get(i)+\" \");\n\t\t\trcsum+=rsum.get(i);\n\t\t}\n\t\tSystem.out.println(rcsum);\n\t}",
"Scanner cin=new Scanner(System.in);",
"cin",
"new Scanner(System.in)",
"int r=cin.nextInt()",
"r",
"cin.nextInt()",
"cin.nextInt",
"cin",
"c=cin.nextInt();",
"c",
"cin.nextInt()",
"cin.nextInt",
"cin",
"List<Integer> rsum=new ArrayList<>();",
"rsum",
"new ArrayList<>()",
"for(int i=0;i<c;i++)rsum.add(0);",
"int i=0;",
"int i=0;",
"i",
"0",
"i<c",
"i",
"c",
"i++",
"i++",
"i",
"rsum.add(0);",
"rsum.add(0)",
"rsum.add",
"rsum",
"0",
"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\tint x=cin.nextInt();\n\t\t\t\tSystem.out.print(x+\" \");\n\t\t\t\tsum+=x;\n\t\t\t\trsum.set(j, rsum.get(j)+x);\n\t\t\t}\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\tint x=cin.nextInt();\n\t\t\t\tSystem.out.print(x+\" \");\n\t\t\t\tsum+=x;\n\t\t\t\trsum.set(j, rsum.get(j)+x);\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<c;j++) {\n\t\t\t\tint x=cin.nextInt();\n\t\t\t\tSystem.out.print(x+\" \");\n\t\t\t\tsum+=x;\n\t\t\t\trsum.set(j, rsum.get(j)+x);\n\t\t\t}\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\tint x=cin.nextInt();\n\t\t\t\tSystem.out.print(x+\" \");\n\t\t\t\tsum+=x;\n\t\t\t\trsum.set(j, rsum.get(j)+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=cin.nextInt();\n\t\t\t\tSystem.out.print(x+\" \");\n\t\t\t\tsum+=x;\n\t\t\t\trsum.set(j, rsum.get(j)+x);\n\t\t\t}",
"{\n\t\t\t\tint x=cin.nextInt();\n\t\t\t\tSystem.out.print(x+\" \");\n\t\t\t\tsum+=x;\n\t\t\t\trsum.set(j, rsum.get(j)+x);\n\t\t\t}",
"int x=cin.nextInt();",
"x",
"cin.nextInt()",
"cin.nextInt",
"cin",
"System.out.print(x+\" \")",
"System.out.print",
"System.out",
"System",
"System.out",
"x+\" \"",
"x",
"\" \"",
"sum+=x",
"sum",
"x",
"rsum.set(j, rsum.get(j)+x)",
"rsum.set",
"rsum",
"j",
"rsum.get(j)+x",
"rsum.get(j)",
"rsum.get",
"rsum",
"j",
"x",
"System.out.println(sum)",
"System.out.println",
"System.out",
"System",
"System.out",
"sum",
"int rcsum=0;",
"rcsum",
"0",
"for(int i=0;i<c;i++) {\n\t\t\tSystem.out.print(rsum.get(i)+\" \");\n\t\t\trcsum+=rsum.get(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(rsum.get(i)+\" \");\n\t\t\trcsum+=rsum.get(i);\n\t\t}",
"{\n\t\t\tSystem.out.print(rsum.get(i)+\" \");\n\t\t\trcsum+=rsum.get(i);\n\t\t}",
"System.out.print(rsum.get(i)+\" \")",
"System.out.print",
"System.out",
"System",
"System.out",
"rsum.get(i)+\" \"",
"rsum.get(i)",
"rsum.get",
"rsum",
"i",
"\" \"",
"rcsum+=rsum.get(i)",
"rcsum",
"rsum.get(i)",
"rsum.get",
"rsum",
"i",
"System.out.println(rcsum)",
"System.out.println",
"System.out",
"System",
"System.out",
"rcsum",
"String[] args",
"args",
"public class Main {\n\t\n\tpublic static void main(String[] args) {\n\t\tScanner cin=new Scanner(System.in);\n\t\t\n\t\tint r=cin.nextInt(),c=cin.nextInt();\n\t\tList<Integer> rsum=new ArrayList<>();\n\t\tfor(int i=0;i<c;i++)rsum.add(0);\n\t\t\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\tint x=cin.nextInt();\n\t\t\t\tSystem.out.print(x+\" \");\n\t\t\t\tsum+=x;\n\t\t\t\trsum.set(j, rsum.get(j)+x);\n\t\t\t}\n\t\t\tSystem.out.println(sum);\n\t\t}\n\t\t\n\t\tint rcsum=0;\n\t\tfor(int i=0;i<c;i++) {\n\t\t\tSystem.out.print(rsum.get(i)+\" \");\n\t\t\trcsum+=rsum.get(i);\n\t\t}\n\t\tSystem.out.println(rcsum);\n\t}\n\t\n}",
"public class Main {\n\t\n\tpublic static void main(String[] args) {\n\t\tScanner cin=new Scanner(System.in);\n\t\t\n\t\tint r=cin.nextInt(),c=cin.nextInt();\n\t\tList<Integer> rsum=new ArrayList<>();\n\t\tfor(int i=0;i<c;i++)rsum.add(0);\n\t\t\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\tint x=cin.nextInt();\n\t\t\t\tSystem.out.print(x+\" \");\n\t\t\t\tsum+=x;\n\t\t\t\trsum.set(j, rsum.get(j)+x);\n\t\t\t}\n\t\t\tSystem.out.println(sum);\n\t\t}\n\t\t\n\t\tint rcsum=0;\n\t\tfor(int i=0;i<c;i++) {\n\t\t\tSystem.out.print(rsum.get(i)+\" \");\n\t\t\trcsum+=rsum.get(i);\n\t\t}\n\t\tSystem.out.println(rcsum);\n\t}\n\t\n}",
"Main"
] |
import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner cin=new Scanner(System.in);
int r=cin.nextInt(),c=cin.nextInt();
List<Integer> rsum=new ArrayList<>();
for(int i=0;i<c;i++)rsum.add(0);
for(int i=0;i<r;i++) {
int sum=0;
for(int j=0;j<c;j++) {
int x=cin.nextInt();
System.out.print(x+" ");
sum+=x;
rsum.set(j, rsum.get(j)+x);
}
System.out.println(sum);
}
int rcsum=0;
for(int i=0;i<c;i++) {
System.out.print(rsum.get(i)+" ");
rcsum+=rsum.get(i);
}
System.out.println(rcsum);
}
}
|
[
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,
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,
2,
17,
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,
2,
17,
18,
13,
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
],
[
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
],
[
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
],
[
77,
79
],
[
76,
80
],
[
80,
81
],
[
81,
82
],
[
81,
83
],
[
80,
84
],
[
66,
85
],
[
85,
86
],
[
86,
87
],
[
86,
88
],
[
85,
89
],
[
89,
90
],
[
90,
91
],
[
90,
92
],
[
89,
93
],
[
66,
94
],
[
94,
95
],
[
94,
96
],
[
96,
97
],
[
97,
98
],
[
97,
99
],
[
96,
100
],
[
11,
101
],
[
101,
102
],
[
102,
103
],
[
103,
104
],
[
103,
105
],
[
101,
106
],
[
106,
107
],
[
106,
108
],
[
101,
109
],
[
109,
110
],
[
110,
111
],
[
101,
112
],
[
113,
113
],
[
113,
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
],
[
133,
133
],
[
133,
134
],
[
133,
135
],
[
135,
136
],
[
136,
137
],
[
136,
138
],
[
135,
139
],
[
133,
140
],
[
113,
141
],
[
141,
142
],
[
142,
143
],
[
143,
144
],
[
143,
145
],
[
141,
146
],
[
146,
147
],
[
146,
148
],
[
11,
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
],
[
168,
168
],
[
168,
169
],
[
168,
170
],
[
170,
171
],
[
170,
172
],
[
168,
173
],
[
11,
174
],
[
174,
175
],
[
175,
176
],
[
176,
177
],
[
176,
178
],
[
174,
179
],
[
9,
180
],
[
180,
181
]
] | [
"import java.util.*;\nimport java.text.*;\n\nclass Main {\n public static void main(String[]args)throws Exception {\n Scanner sc = new Scanner(System.in);\n int r = sc.nextInt();\n int c = sc.nextInt();\n int [][] a = new int[r][c];\n int [] rs = new int[c];\n int [] cs = new int[r];\n int s = 0;\n for(int i = 0; i < r; i++) {\n for(int j = 0; j < c; j++) {\n a[i][j] = sc.nextInt();\n cs[i] += a[i][j];\n rs[j] += a[i][j];\n s += 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(cs[i]);\n }\n for(int j = 0; j < c; j++) {\n System.out.print(\"\" + rs[j] + \" \");\n }\n System.out.println(s);\n }\n}",
"import java.util.*;",
"util.*",
"java",
"import java.text.*;",
"text.*",
"java",
"class Main {\n public static void main(String[]args)throws Exception {\n Scanner sc = new Scanner(System.in);\n int r = sc.nextInt();\n int c = sc.nextInt();\n int [][] a = new int[r][c];\n int [] rs = new int[c];\n int [] cs = new int[r];\n int s = 0;\n for(int i = 0; i < r; i++) {\n for(int j = 0; j < c; j++) {\n a[i][j] = sc.nextInt();\n cs[i] += a[i][j];\n rs[j] += a[i][j];\n s += 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(cs[i]);\n }\n for(int j = 0; j < c; j++) {\n System.out.print(\"\" + rs[j] + \" \");\n }\n System.out.println(s);\n }\n}",
"Main",
"public static void main(String[]args)throws Exception {\n Scanner sc = new Scanner(System.in);\n int r = sc.nextInt();\n int c = sc.nextInt();\n int [][] a = new int[r][c];\n int [] rs = new int[c];\n int [] cs = new int[r];\n int s = 0;\n for(int i = 0; i < r; i++) {\n for(int j = 0; j < c; j++) {\n a[i][j] = sc.nextInt();\n cs[i] += a[i][j];\n rs[j] += a[i][j];\n s += 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(cs[i]);\n }\n for(int j = 0; j < c; j++) {\n System.out.print(\"\" + rs[j] + \" \");\n }\n System.out.println(s);\n }",
"main",
"{\n Scanner sc = new Scanner(System.in);\n int r = sc.nextInt();\n int c = sc.nextInt();\n int [][] a = new int[r][c];\n int [] rs = new int[c];\n int [] cs = new int[r];\n int s = 0;\n for(int i = 0; i < r; i++) {\n for(int j = 0; j < c; j++) {\n a[i][j] = sc.nextInt();\n cs[i] += a[i][j];\n rs[j] += a[i][j];\n s += 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(cs[i]);\n }\n for(int j = 0; j < c; j++) {\n System.out.print(\"\" + rs[j] + \" \");\n }\n System.out.println(s);\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 [][] a = new int[r][c];",
"a",
"new int[r][c]",
"r",
"c",
"int [] rs = new int[c];",
"rs",
"new int[c]",
"c",
"int [] cs = new int[r];",
"cs",
"new int[r]",
"r",
"int s = 0;",
"s",
"0",
"for(int i = 0; i < r; i++) {\n for(int j = 0; j < c; j++) {\n a[i][j] = sc.nextInt();\n cs[i] += a[i][j];\n rs[j] += a[i][j];\n s += 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 cs[i] += a[i][j];\n rs[j] += a[i][j];\n s += a[i][j];\n }\n }",
"{\n for(int j = 0; j < c; j++) {\n a[i][j] = sc.nextInt();\n cs[i] += a[i][j];\n rs[j] += a[i][j];\n s += a[i][j];\n }\n }",
"for(int j = 0; j < c; j++) {\n a[i][j] = sc.nextInt();\n cs[i] += a[i][j];\n rs[j] += a[i][j];\n s += 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 cs[i] += a[i][j];\n rs[j] += a[i][j];\n s += a[i][j];\n }",
"{\n a[i][j] = sc.nextInt();\n cs[i] += a[i][j];\n rs[j] += a[i][j];\n s += a[i][j];\n }",
"a[i][j] = sc.nextInt()",
"a[i][j]",
"a[i]",
"a",
"i",
"j",
"sc.nextInt()",
"sc.nextInt",
"sc",
"cs[i] += a[i][j]",
"cs[i]",
"cs",
"i",
"a[i][j]",
"a[i]",
"a",
"i",
"j",
"rs[j] += a[i][j]",
"rs[j]",
"rs",
"j",
"a[i][j]",
"a[i]",
"a",
"i",
"j",
"s += a[i][j]",
"s",
"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(cs[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(cs[i]);\n }",
"{\n for(int j = 0; j < c; j++) {\n System.out.print(\"\" + a[i][j] + \" \");\n }\n System.out.println(cs[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][j]",
"a[i]",
"a",
"i",
"j",
"\" \"",
"System.out.println(cs[i])",
"System.out.println",
"System.out",
"System",
"System.out",
"cs[i]",
"cs",
"i",
"for(int j = 0; j < c; j++) {\n System.out.print(\"\" + rs[j] + \" \");\n }",
"int j = 0;",
"int j = 0;",
"j",
"0",
"j < c",
"j",
"c",
"j++",
"j++",
"j",
"{\n System.out.print(\"\" + rs[j] + \" \");\n }",
"{\n System.out.print(\"\" + rs[j] + \" \");\n }",
"System.out.print(\"\" + rs[j] + \" \")",
"System.out.print",
"System.out",
"System",
"System.out",
"\"\" + rs[j] + \" \"",
"\"\" + rs[j] + \" \"",
"\"\"",
"rs[j]",
"rs",
"j",
"\" \"",
"System.out.println(s)",
"System.out.println",
"System.out",
"System",
"System.out",
"s",
"String[]args",
"args"
] | import java.util.*;
import java.text.*;
class Main {
public static void main(String[]args)throws Exception {
Scanner sc = new Scanner(System.in);
int r = sc.nextInt();
int c = sc.nextInt();
int [][] a = new int[r][c];
int [] rs = new int[c];
int [] cs = new int[r];
int s = 0;
for(int i = 0; i < r; i++) {
for(int j = 0; j < c; j++) {
a[i][j] = sc.nextInt();
cs[i] += a[i][j];
rs[j] += a[i][j];
s += 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(cs[i]);
}
for(int j = 0; j < c; j++) {
System.out.print("" + rs[j] + " ");
}
System.out.println(s);
}
} |
[
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,
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,
41,
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,
17,
11,
1,
41,
13,
17,
2,
13,
2,
13,
17,
1,
40,
13,
30,
30,
14,
2,
13,
13,
30,
14,
2,
13,
13,
30,
0,
13,
2,
13,
18,
18,
13,
13,
13,
0,
18,
13,
13,
2,
18,
13,
13,
18,
18,
13,
13,
13,
14,
2,
13,
13,
30,
0,
18,
18,
13,
13,
13,
13,
0,
18,
13,
13,
2,
18,
13,
13,
18,
18,
13,
13,
13,
14,
2,
13,
13,
30,
0,
18,
18,
13,
13,
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,
2,
13,
17,
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
],
[
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
],
[
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
],
[
63,
65
],
[
65,
66
],
[
66,
67
],
[
62,
68
],
[
68,
69
],
[
69,
70
],
[
70,
71
],
[
70,
72
],
[
69,
73
],
[
68,
74
],
[
8,
75
],
[
75,
76
],
[
76,
77
],
[
77,
78
],
[
77,
79
],
[
75,
80
],
[
80,
81
],
[
80,
82
],
[
82,
83
],
[
82,
84
],
[
75,
85
],
[
85,
86
],
[
86,
87
],
[
75,
88
],
[
89,
89
],
[
89,
90
],
[
90,
91
],
[
90,
92
],
[
89,
93
],
[
93,
94
],
[
94,
95
],
[
95,
96
],
[
95,
97
],
[
93,
98
],
[
98,
99
],
[
98,
100
],
[
100,
101
],
[
100,
102
],
[
93,
103
],
[
103,
104
],
[
104,
105
],
[
93,
106
],
[
107,
107
],
[
107,
108
],
[
108,
109
],
[
109,
110
],
[
109,
111
],
[
108,
112
],
[
112,
113
],
[
113,
114
],
[
114,
115
],
[
114,
116
],
[
113,
117
],
[
117,
118
],
[
118,
119
],
[
118,
120
],
[
120,
121
],
[
120,
122
],
[
122,
123
],
[
123,
124
],
[
123,
125
],
[
122,
126
],
[
117,
127
],
[
127,
128
],
[
128,
129
],
[
128,
130
],
[
127,
131
],
[
131,
132
],
[
132,
133
],
[
132,
134
],
[
131,
135
],
[
135,
136
],
[
136,
137
],
[
136,
138
],
[
135,
139
],
[
113,
140
],
[
140,
141
],
[
141,
142
],
[
141,
143
],
[
140,
144
],
[
144,
145
],
[
145,
146
],
[
146,
147
],
[
147,
148
],
[
147,
149
],
[
146,
150
],
[
145,
151
],
[
144,
152
],
[
152,
153
],
[
153,
154
],
[
153,
155
],
[
152,
156
],
[
156,
157
],
[
157,
158
],
[
157,
159
],
[
156,
160
],
[
160,
161
],
[
161,
162
],
[
161,
163
],
[
160,
164
],
[
108,
165
],
[
165,
166
],
[
166,
167
],
[
166,
168
],
[
165,
169
],
[
169,
170
],
[
170,
171
],
[
171,
172
],
[
172,
173
],
[
172,
174
],
[
171,
175
],
[
170,
176
],
[
176,
177
],
[
176,
178
],
[
8,
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
],
[
196,
198
],
[
194,
199
],
[
199,
200
],
[
199,
201
],
[
201,
202
],
[
201,
203
],
[
194,
204
],
[
204,
205
],
[
205,
206
],
[
194,
207
],
[
208,
208
],
[
208,
209
],
[
209,
210
],
[
210,
211
],
[
211,
212
],
[
211,
213
],
[
209,
214
],
[
214,
215
],
[
215,
216
],
[
215,
217
],
[
214,
218
],
[
214,
219
],
[
209,
220
],
[
220,
221
],
[
221,
222
],
[
221,
223
],
[
220,
224
],
[
6,
225
],
[
225,
226
],
[
0,
227
],
[
227,
228
],
[
227,
229
]
] | [
"import java.util.*;\n\npublic class Main{\n\tpublic static void main(String[] args){\n\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\tint[] sumC = new int[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\tint n = scan.nextInt();\n\t\t\t\ttable[i][j] = n;\n\t\t\t}\n\t\t}\n\n\t\tfor(int i = 0; i < r + 1; i++){\n\t\t\tint sum = 0;\n\t\t\tfor(int j = 0; j < c + 1; j++){\n\t\t\t\tif(i != r){\n\t\t\t\t\tif(j != c){\n\t\t\t\t\t\tsum = sum + table[i][j];\n\t\t\t\t\t\tsumC[j] = sumC[j] + table[i][j];\n\t\t\t\t\t} else if(j == c){\n\t\t\t\t\t\ttable[i][c] = sum;\n\t\t\t\t\t\tsumC[c] = sumC[c] + table[i][c];\n\t\t\t\t\t}\n\t\t\t\t} else if(i == r){\n\t\t\t\t\ttable[r][j] = sumC[j];\n\t\t\t\t}\n\t\t\t}\n\t\t}\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\tSystem.out.printf((j != c) ? \"%d \" : \"%d\\n\", table[i][j]);\n\t\t\t}\n\t\t}\n\t}\n}",
"import java.util.*;",
"util.*",
"java",
"public class Main{\n\tpublic static void main(String[] args){\n\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\tint[] sumC = new int[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\tint n = scan.nextInt();\n\t\t\t\ttable[i][j] = n;\n\t\t\t}\n\t\t}\n\n\t\tfor(int i = 0; i < r + 1; i++){\n\t\t\tint sum = 0;\n\t\t\tfor(int j = 0; j < c + 1; j++){\n\t\t\t\tif(i != r){\n\t\t\t\t\tif(j != c){\n\t\t\t\t\t\tsum = sum + table[i][j];\n\t\t\t\t\t\tsumC[j] = sumC[j] + table[i][j];\n\t\t\t\t\t} else if(j == c){\n\t\t\t\t\t\ttable[i][c] = sum;\n\t\t\t\t\t\tsumC[c] = sumC[c] + table[i][c];\n\t\t\t\t\t}\n\t\t\t\t} else if(i == r){\n\t\t\t\t\ttable[r][j] = sumC[j];\n\t\t\t\t}\n\t\t\t}\n\t\t}\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\tSystem.out.printf((j != c) ? \"%d \" : \"%d\\n\", table[i][j]);\n\t\t\t}\n\t\t}\n\t}\n}",
"Main",
"public static void main(String[] args){\n\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\tint[] sumC = new int[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\tint n = scan.nextInt();\n\t\t\t\ttable[i][j] = n;\n\t\t\t}\n\t\t}\n\n\t\tfor(int i = 0; i < r + 1; i++){\n\t\t\tint sum = 0;\n\t\t\tfor(int j = 0; j < c + 1; j++){\n\t\t\t\tif(i != r){\n\t\t\t\t\tif(j != c){\n\t\t\t\t\t\tsum = sum + table[i][j];\n\t\t\t\t\t\tsumC[j] = sumC[j] + table[i][j];\n\t\t\t\t\t} else if(j == c){\n\t\t\t\t\t\ttable[i][c] = sum;\n\t\t\t\t\t\tsumC[c] = sumC[c] + table[i][c];\n\t\t\t\t\t}\n\t\t\t\t} else if(i == r){\n\t\t\t\t\ttable[r][j] = sumC[j];\n\t\t\t\t}\n\t\t\t}\n\t\t}\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\tSystem.out.printf((j != c) ? \"%d \" : \"%d\\n\", table[i][j]);\n\t\t\t}\n\t\t}\n\t}",
"main",
"{\n\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\tint[] sumC = new int[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\tint n = scan.nextInt();\n\t\t\t\ttable[i][j] = n;\n\t\t\t}\n\t\t}\n\n\t\tfor(int i = 0; i < r + 1; i++){\n\t\t\tint sum = 0;\n\t\t\tfor(int j = 0; j < c + 1; j++){\n\t\t\t\tif(i != r){\n\t\t\t\t\tif(j != c){\n\t\t\t\t\t\tsum = sum + table[i][j];\n\t\t\t\t\t\tsumC[j] = sumC[j] + table[i][j];\n\t\t\t\t\t} else if(j == c){\n\t\t\t\t\t\ttable[i][c] = sum;\n\t\t\t\t\t\tsumC[c] = sumC[c] + table[i][c];\n\t\t\t\t\t}\n\t\t\t\t} else if(i == r){\n\t\t\t\t\ttable[r][j] = sumC[j];\n\t\t\t\t}\n\t\t\t}\n\t\t}\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\tSystem.out.printf((j != c) ? \"%d \" : \"%d\\n\", table[i][j]);\n\t\t\t}\n\t\t}\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 + 1][c + 1];",
"table",
"new int[r + 1][c + 1]",
"r + 1",
"r",
"1",
"c + 1",
"c",
"1",
"int[] sumC = new int[c + 1];",
"sumC",
"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\tint n = scan.nextInt();\n\t\t\t\ttable[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\t\t\tfor(int j = 0; j < c; j++){\n\t\t\t\tint n = scan.nextInt();\n\t\t\t\ttable[i][j] = n;\n\t\t\t}\n\t\t}",
"{\n\t\t\tfor(int j = 0; j < c; j++){\n\t\t\t\tint n = scan.nextInt();\n\t\t\t\ttable[i][j] = n;\n\t\t\t}\n\t\t}",
"for(int j = 0; j < c; j++){\n\t\t\t\tint n = scan.nextInt();\n\t\t\t\ttable[i][j] = n;\n\t\t\t}",
"int j = 0;",
"int j = 0;",
"j",
"0",
"j < c",
"j",
"c",
"j++",
"j++",
"j",
"{\n\t\t\t\tint n = scan.nextInt();\n\t\t\t\ttable[i][j] = n;\n\t\t\t}",
"{\n\t\t\t\tint n = scan.nextInt();\n\t\t\t\ttable[i][j] = n;\n\t\t\t}",
"int n = scan.nextInt();",
"n",
"scan.nextInt()",
"scan.nextInt",
"scan",
"table[i][j] = n",
"table[i][j]",
"table[i]",
"table",
"i",
"j",
"n",
"for(int i = 0; i < r + 1; i++){\n\t\t\tint sum = 0;\n\t\t\tfor(int j = 0; j < c + 1; j++){\n\t\t\t\tif(i != r){\n\t\t\t\t\tif(j != c){\n\t\t\t\t\t\tsum = sum + table[i][j];\n\t\t\t\t\t\tsumC[j] = sumC[j] + table[i][j];\n\t\t\t\t\t} else if(j == c){\n\t\t\t\t\t\ttable[i][c] = sum;\n\t\t\t\t\t\tsumC[c] = sumC[c] + table[i][c];\n\t\t\t\t\t}\n\t\t\t\t} else if(i == r){\n\t\t\t\t\ttable[r][j] = sumC[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\tint sum = 0;\n\t\t\tfor(int j = 0; j < c + 1; j++){\n\t\t\t\tif(i != r){\n\t\t\t\t\tif(j != c){\n\t\t\t\t\t\tsum = sum + table[i][j];\n\t\t\t\t\t\tsumC[j] = sumC[j] + table[i][j];\n\t\t\t\t\t} else if(j == c){\n\t\t\t\t\t\ttable[i][c] = sum;\n\t\t\t\t\t\tsumC[c] = sumC[c] + table[i][c];\n\t\t\t\t\t}\n\t\t\t\t} else if(i == r){\n\t\t\t\t\ttable[r][j] = sumC[j];\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"{\n\t\t\tint sum = 0;\n\t\t\tfor(int j = 0; j < c + 1; j++){\n\t\t\t\tif(i != r){\n\t\t\t\t\tif(j != c){\n\t\t\t\t\t\tsum = sum + table[i][j];\n\t\t\t\t\t\tsumC[j] = sumC[j] + table[i][j];\n\t\t\t\t\t} else if(j == c){\n\t\t\t\t\t\ttable[i][c] = sum;\n\t\t\t\t\t\tsumC[c] = sumC[c] + table[i][c];\n\t\t\t\t\t}\n\t\t\t\t} else if(i == r){\n\t\t\t\t\ttable[r][j] = sumC[j];\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"int sum = 0;",
"sum",
"0",
"for(int j = 0; j < c + 1; j++){\n\t\t\t\tif(i != r){\n\t\t\t\t\tif(j != c){\n\t\t\t\t\t\tsum = sum + table[i][j];\n\t\t\t\t\t\tsumC[j] = sumC[j] + table[i][j];\n\t\t\t\t\t} else if(j == c){\n\t\t\t\t\t\ttable[i][c] = sum;\n\t\t\t\t\t\tsumC[c] = sumC[c] + table[i][c];\n\t\t\t\t\t}\n\t\t\t\t} else if(i == r){\n\t\t\t\t\ttable[r][j] = sumC[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(i != r){\n\t\t\t\t\tif(j != c){\n\t\t\t\t\t\tsum = sum + table[i][j];\n\t\t\t\t\t\tsumC[j] = sumC[j] + table[i][j];\n\t\t\t\t\t} else if(j == c){\n\t\t\t\t\t\ttable[i][c] = sum;\n\t\t\t\t\t\tsumC[c] = sumC[c] + table[i][c];\n\t\t\t\t\t}\n\t\t\t\t} else if(i == r){\n\t\t\t\t\ttable[r][j] = sumC[j];\n\t\t\t\t}\n\t\t\t}",
"{\n\t\t\t\tif(i != r){\n\t\t\t\t\tif(j != c){\n\t\t\t\t\t\tsum = sum + table[i][j];\n\t\t\t\t\t\tsumC[j] = sumC[j] + table[i][j];\n\t\t\t\t\t} else if(j == c){\n\t\t\t\t\t\ttable[i][c] = sum;\n\t\t\t\t\t\tsumC[c] = sumC[c] + table[i][c];\n\t\t\t\t\t}\n\t\t\t\t} else if(i == r){\n\t\t\t\t\ttable[r][j] = sumC[j];\n\t\t\t\t}\n\t\t\t}",
"if(i != r){\n\t\t\t\t\tif(j != c){\n\t\t\t\t\t\tsum = sum + table[i][j];\n\t\t\t\t\t\tsumC[j] = sumC[j] + table[i][j];\n\t\t\t\t\t} else if(j == c){\n\t\t\t\t\t\ttable[i][c] = sum;\n\t\t\t\t\t\tsumC[c] = sumC[c] + table[i][c];\n\t\t\t\t\t}\n\t\t\t\t} else if(i == r){\n\t\t\t\t\ttable[r][j] = sumC[j];\n\t\t\t\t}",
"i != r",
"i",
"r",
"{\n\t\t\t\t\tif(j != c){\n\t\t\t\t\t\tsum = sum + table[i][j];\n\t\t\t\t\t\tsumC[j] = sumC[j] + table[i][j];\n\t\t\t\t\t} else if(j == c){\n\t\t\t\t\t\ttable[i][c] = sum;\n\t\t\t\t\t\tsumC[c] = sumC[c] + table[i][c];\n\t\t\t\t\t}\n\t\t\t\t}",
"if(j != c){\n\t\t\t\t\t\tsum = sum + table[i][j];\n\t\t\t\t\t\tsumC[j] = sumC[j] + table[i][j];\n\t\t\t\t\t} else if(j == c){\n\t\t\t\t\t\ttable[i][c] = sum;\n\t\t\t\t\t\tsumC[c] = sumC[c] + table[i][c];\n\t\t\t\t\t}",
"j != c",
"j",
"c",
"{\n\t\t\t\t\t\tsum = sum + table[i][j];\n\t\t\t\t\t\tsumC[j] = sumC[j] + table[i][j];\n\t\t\t\t\t}",
"sum = sum + table[i][j]",
"sum",
"sum + table[i][j]",
"sum",
"table[i][j]",
"table[i]",
"table",
"i",
"j",
"sumC[j] = sumC[j] + table[i][j]",
"sumC[j]",
"sumC",
"j",
"sumC[j] + table[i][j]",
"sumC[j]",
"sumC",
"j",
"table[i][j]",
"table[i]",
"table",
"i",
"j",
"if(j == c){\n\t\t\t\t\t\ttable[i][c] = sum;\n\t\t\t\t\t\tsumC[c] = sumC[c] + table[i][c];\n\t\t\t\t\t}",
"j == c",
"j",
"c",
"{\n\t\t\t\t\t\ttable[i][c] = sum;\n\t\t\t\t\t\tsumC[c] = sumC[c] + table[i][c];\n\t\t\t\t\t}",
"table[i][c] = sum",
"table[i][c]",
"table[i]",
"table",
"i",
"c",
"sum",
"sumC[c] = sumC[c] + table[i][c]",
"sumC[c]",
"sumC",
"c",
"sumC[c] + table[i][c]",
"sumC[c]",
"sumC",
"c",
"table[i][c]",
"table[i]",
"table",
"i",
"c",
"if(i == r){\n\t\t\t\t\ttable[r][j] = sumC[j];\n\t\t\t\t}",
"i == r",
"i",
"r",
"{\n\t\t\t\t\ttable[r][j] = sumC[j];\n\t\t\t\t}",
"table[r][j] = sumC[j]",
"table[r][j]",
"table[r]",
"table",
"r",
"j",
"sumC[j]",
"sumC",
"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.printf((j != c) ? \"%d \" : \"%d\\n\", 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\tSystem.out.printf((j != c) ? \"%d \" : \"%d\\n\", 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\tSystem.out.printf((j != c) ? \"%d \" : \"%d\\n\", table[i][j]);\n\t\t\t}\n\t\t}",
"for(int j = 0; j < c + 1; j++){\n\t\t\t\tSystem.out.printf((j != c) ? \"%d \" : \"%d\\n\", 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\tSystem.out.printf((j != c) ? \"%d \" : \"%d\\n\", table[i][j]);\n\t\t\t}",
"{\n\t\t\t\tSystem.out.printf((j != c) ? \"%d \" : \"%d\\n\", table[i][j]);\n\t\t\t}",
"System.out.printf((j != c) ? \"%d \" : \"%d\\n\", table[i][j])",
"System.out.printf",
"System.out",
"System",
"System.out",
"(j != c) ? \"%d \" : \"%d\\n\"",
"(j != c)",
"j",
"c",
"\"%d \"",
"\"%d\\n\"",
"table[i][j]",
"table[i]",
"table",
"i",
"j",
"String[] args",
"args",
"public class Main{\n\tpublic static void main(String[] args){\n\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\tint[] sumC = new int[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\tint n = scan.nextInt();\n\t\t\t\ttable[i][j] = n;\n\t\t\t}\n\t\t}\n\n\t\tfor(int i = 0; i < r + 1; i++){\n\t\t\tint sum = 0;\n\t\t\tfor(int j = 0; j < c + 1; j++){\n\t\t\t\tif(i != r){\n\t\t\t\t\tif(j != c){\n\t\t\t\t\t\tsum = sum + table[i][j];\n\t\t\t\t\t\tsumC[j] = sumC[j] + table[i][j];\n\t\t\t\t\t} else if(j == c){\n\t\t\t\t\t\ttable[i][c] = sum;\n\t\t\t\t\t\tsumC[c] = sumC[c] + table[i][c];\n\t\t\t\t\t}\n\t\t\t\t} else if(i == r){\n\t\t\t\t\ttable[r][j] = sumC[j];\n\t\t\t\t}\n\t\t\t}\n\t\t}\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\tSystem.out.printf((j != c) ? \"%d \" : \"%d\\n\", table[i][j]);\n\t\t\t}\n\t\t}\n\t}\n}",
"public class Main{\n\tpublic static void main(String[] args){\n\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\tint[] sumC = new int[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\tint n = scan.nextInt();\n\t\t\t\ttable[i][j] = n;\n\t\t\t}\n\t\t}\n\n\t\tfor(int i = 0; i < r + 1; i++){\n\t\t\tint sum = 0;\n\t\t\tfor(int j = 0; j < c + 1; j++){\n\t\t\t\tif(i != r){\n\t\t\t\t\tif(j != c){\n\t\t\t\t\t\tsum = sum + table[i][j];\n\t\t\t\t\t\tsumC[j] = sumC[j] + table[i][j];\n\t\t\t\t\t} else if(j == c){\n\t\t\t\t\t\ttable[i][c] = sum;\n\t\t\t\t\t\tsumC[c] = sumC[c] + table[i][c];\n\t\t\t\t\t}\n\t\t\t\t} else if(i == r){\n\t\t\t\t\ttable[r][j] = sumC[j];\n\t\t\t\t}\n\t\t\t}\n\t\t}\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\tSystem.out.printf((j != c) ? \"%d \" : \"%d\\n\", table[i][j]);\n\t\t\t}\n\t\t}\n\t}\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[][] table = new int[r + 1][c + 1];
int[] sumC = new int[c + 1];
for(int i = 0; i < r ; i++){
for(int j = 0; j < c; j++){
int n = scan.nextInt();
table[i][j] = n;
}
}
for(int i = 0; i < r + 1; i++){
int sum = 0;
for(int j = 0; j < c + 1; j++){
if(i != r){
if(j != c){
sum = sum + table[i][j];
sumC[j] = sumC[j] + table[i][j];
} else if(j == c){
table[i][c] = sum;
sumC[c] = sumC[c] + table[i][c];
}
} else if(i == r){
table[r][j] = sumC[j];
}
}
}
for(int i = 0; i < r + 1; i++){
for(int j = 0; j < c + 1; j++){
System.out.printf((j != c) ? "%d " : "%d\n", table[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,
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,
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,
30,
4,
18,
18,
13,
13,
17,
4,
18,
18,
13,
13,
2,
18,
18,
13,
13,
13,
17,
4,
18,
18,
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
],
[
205,
5
],
[
205,
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
],
[
41,
74
],
[
74,
75
],
[
75,
76
],
[
76,
77
],
[
76,
78
],
[
75,
79
],
[
74,
80
],
[
8,
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
],
[
101,
102
],
[
101,
103
],
[
94,
104
],
[
104,
105
],
[
105,
106
],
[
94,
107
],
[
108,
108
],
[
108,
109
],
[
109,
110
],
[
110,
111
],
[
110,
112
],
[
109,
113
],
[
113,
114
],
[
114,
115
],
[
115,
116
],
[
116,
117
],
[
116,
118
],
[
114,
119
],
[
108,
120
],
[
120,
121
],
[
121,
122
],
[
122,
123
],
[
122,
124
],
[
120,
125
],
[
125,
126
],
[
126,
127
],
[
127,
128
],
[
127,
129
],
[
126,
130
],
[
125,
131
],
[
93,
132
],
[
132,
133
],
[
133,
134
],
[
134,
135
],
[
134,
136
],
[
8,
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
],
[
155,
163
],
[
163,
164
],
[
164,
165
],
[
155,
166
],
[
167,
167
],
[
167,
168
],
[
168,
169
],
[
168,
170
],
[
170,
171
],
[
171,
172
],
[
171,
173
],
[
170,
174
],
[
151,
175
],
[
175,
176
],
[
176,
177
],
[
176,
178
],
[
175,
179
],
[
179,
180
],
[
180,
181
],
[
181,
182
],
[
182,
183
],
[
182,
184
],
[
180,
185
],
[
151,
186
],
[
186,
187
],
[
187,
188
],
[
188,
189
],
[
188,
190
],
[
186,
191
],
[
191,
192
],
[
191,
193
],
[
8,
194
],
[
194,
195
],
[
195,
196
],
[
196,
197
],
[
196,
198
],
[
8,
199
],
[
199,
200
],
[
200,
201
],
[
6,
202
],
[
202,
203
],
[
0,
204
],
[
204,
205
],
[
204,
206
]
] | [
"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}\n\t\t\ttable[i][c] = sum;\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) {\n\t\t\t\t\tSystem.out.printf(\" \");\n\t\t\t\t}\n\t\t\t\tSystem.out.printf(table[i][j] + \"\");\n\t\t\t}\n\t\t\tSystem.out.println();\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\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}\n\t\t\ttable[i][c] = sum;\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) {\n\t\t\t\t\tSystem.out.printf(\" \");\n\t\t\t\t}\n\t\t\t\tSystem.out.printf(table[i][j] + \"\");\n\t\t\t}\n\t\t\tSystem.out.println();\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\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}\n\t\t\ttable[i][c] = sum;\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) {\n\t\t\t\t\tSystem.out.printf(\" \");\n\t\t\t\t}\n\t\t\t\tSystem.out.printf(table[i][j] + \"\");\n\t\t\t}\n\t\t\tSystem.out.println();\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\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}\n\t\t\ttable[i][c] = sum;\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) {\n\t\t\t\t\tSystem.out.printf(\" \");\n\t\t\t\t}\n\t\t\t\tSystem.out.printf(table[i][j] + \"\");\n\t\t\t}\n\t\t\tSystem.out.println();\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\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}\n\t\t\ttable[i][c] = 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}\n\t\t\ttable[i][c] = 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}\n\t\t\ttable[i][c] = 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}",
"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}",
"{\n\t\t\t\ttable[i][j] = scan.nextInt();\n\t\t\t\tsum += 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",
"table[i][c] = sum",
"table[i][c]",
"table[i]",
"table",
"i",
"c",
"sum",
"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) {\n\t\t\t\t\tSystem.out.printf(\" \");\n\t\t\t\t}\n\t\t\t\tSystem.out.printf(table[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 + 1; j++) {\n\t\t\t\tif(j != 0) {\n\t\t\t\t\tSystem.out.printf(\" \");\n\t\t\t\t}\n\t\t\t\tSystem.out.printf(table[i][j] + \"\");\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 != 0) {\n\t\t\t\t\tSystem.out.printf(\" \");\n\t\t\t\t}\n\t\t\t\tSystem.out.printf(table[i][j] + \"\");\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 != 0) {\n\t\t\t\t\tSystem.out.printf(\" \");\n\t\t\t\t}\n\t\t\t\tSystem.out.printf(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(j != 0) {\n\t\t\t\t\tSystem.out.printf(\" \");\n\t\t\t\t}\n\t\t\t\tSystem.out.printf(table[i][j] + \"\");\n\t\t\t}",
"{\n\t\t\t\tif(j != 0) {\n\t\t\t\t\tSystem.out.printf(\" \");\n\t\t\t\t}\n\t\t\t\tSystem.out.printf(table[i][j] + \"\");\n\t\t\t}",
"if(j != 0) {\n\t\t\t\t\tSystem.out.printf(\" \");\n\t\t\t\t}",
"j != 0",
"j",
"0",
"{\n\t\t\t\t\tSystem.out.printf(\" \");\n\t\t\t\t}",
"System.out.printf(\" \")",
"System.out.printf",
"System.out",
"System",
"System.out",
"\" \"",
"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",
"\"\"",
"System.out.println()",
"System.out.println",
"System.out",
"System",
"System.out",
"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}\n\t\t\ttable[i][c] = sum;\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) {\n\t\t\t\t\tSystem.out.printf(\" \");\n\t\t\t\t}\n\t\t\t\tSystem.out.printf(table[i][j] + \"\");\n\t\t\t}\n\t\t\tSystem.out.println();\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\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}\n\t\t\ttable[i][c] = sum;\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) {\n\t\t\t\t\tSystem.out.printf(\" \");\n\t\t\t\t}\n\t\t\t\tSystem.out.printf(table[i][j] + \"\");\n\t\t\t}\n\t\t\tSystem.out.println();\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\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];
}
table[i][c] = sum;
}
for(int i = 0; i < r; i++) {
for(int j = 0; j < c + 1; j++) {
if(j != 0) {
System.out.printf(" ");
}
System.out.printf(table[i][j] + "");
}
System.out.println();
}
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,
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,
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,
0,
13,
20,
13,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
0,
13,
17,
30,
30,
0,
13,
17,
41,
13,
4,
18,
4,
18,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
0,
13,
17,
30,
30,
0,
18,
18,
13,
13,
13,
4,
18,
13,
18,
13,
13,
4,
18,
4,
18,
13,
18,
18,
13,
13,
13,
17,
0,
13,
18,
18,
13,
13,
13,
4,
18,
13,
2,
13,
4,
18,
13,
17,
0,
13,
17,
0,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
0,
13,
17,
30,
30,
0,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
0,
13,
17,
30,
30,
0,
13,
18,
18,
13,
13,
13,
0,
13,
13,
4,
18,
4,
18,
13,
13,
17,
4,
18,
13,
13,
4,
18,
18,
13,
13,
13,
0,
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
],
[
208,
11
],
[
208,
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
],
[
28,
30
],
[
30,
31
],
[
31,
32
],
[
32,
33
],
[
33,
34
],
[
30,
35
],
[
14,
36
],
[
36,
37
],
[
36,
38
],
[
38,
39
],
[
39,
40
],
[
38,
41
],
[
41,
42
],
[
41,
43
],
[
14,
44
],
[
44,
45
],
[
44,
46
],
[
46,
47
],
[
47,
48
],
[
46,
49
],
[
49,
50
],
[
49,
51
],
[
14,
52
],
[
52,
53
],
[
52,
54
],
[
14,
55
],
[
55,
56
],
[
55,
57
],
[
14,
60
],
[
60,
61
],
[
61,
62
],
[
62,
63
],
[
62,
64
],
[
60,
65
],
[
65,
66
],
[
65,
67
],
[
60,
68
],
[
68,
69
],
[
69,
70
],
[
69,
71
],
[
60,
72
],
[
73,
73
],
[
73,
74
],
[
74,
75
],
[
74,
76
],
[
73,
77
],
[
77,
78
],
[
77,
79
],
[
79,
80
],
[
80,
81
],
[
81,
82
],
[
82,
83
],
[
79,
84
],
[
73,
85
],
[
85,
86
],
[
86,
87
],
[
87,
88
],
[
87,
89
],
[
85,
90
],
[
90,
91
],
[
90,
92
],
[
85,
93
],
[
93,
94
],
[
94,
95
],
[
94,
96
],
[
85,
97
],
[
98,
98
],
[
98,
99
],
[
99,
100
],
[
100,
101
],
[
101,
102
],
[
101,
103
],
[
100,
104
],
[
99,
105
],
[
105,
106
],
[
106,
107
],
[
105,
108
],
[
108,
109
],
[
108,
110
],
[
98,
111
],
[
111,
112
],
[
112,
113
],
[
113,
114
],
[
114,
115
],
[
113,
116
],
[
116,
117
],
[
117,
118
],
[
117,
119
],
[
116,
120
],
[
111,
121
],
[
98,
122
],
[
122,
123
],
[
122,
124
],
[
124,
125
],
[
125,
126
],
[
125,
127
],
[
124,
128
],
[
73,
129
],
[
129,
130
],
[
130,
131
],
[
129,
132
],
[
132,
133
],
[
132,
134
],
[
134,
135
],
[
135,
136
],
[
134,
137
],
[
14,
138
],
[
138,
139
],
[
138,
140
],
[
14,
141
],
[
141,
142
],
[
141,
143
],
[
14,
144
],
[
144,
145
],
[
145,
146
],
[
146,
147
],
[
146,
148
],
[
144,
149
],
[
149,
150
],
[
149,
151
],
[
144,
152
],
[
152,
153
],
[
153,
154
],
[
153,
155
],
[
144,
156
],
[
157,
157
],
[
157,
158
],
[
158,
159
],
[
158,
160
],
[
157,
161
],
[
161,
162
],
[
162,
163
],
[
163,
164
],
[
163,
165
],
[
161,
166
],
[
166,
167
],
[
166,
168
],
[
161,
169
],
[
169,
170
],
[
170,
171
],
[
170,
172
],
[
161,
173
],
[
174,
174
],
[
174,
175
],
[
175,
176
],
[
175,
177
],
[
177,
178
],
[
178,
179
],
[
178,
180
],
[
177,
181
],
[
157,
182
],
[
182,
183
],
[
182,
184
],
[
157,
185
],
[
185,
186
],
[
186,
187
],
[
187,
188
],
[
188,
189
],
[
187,
190
],
[
185,
191
],
[
14,
192
],
[
192,
193
],
[
193,
194
],
[
192,
195
],
[
14,
196
],
[
196,
197
],
[
197,
198
],
[
198,
199
],
[
198,
200
],
[
196,
201
],
[
14,
202
],
[
202,
203
],
[
202,
204
],
[
12,
205
],
[
205,
206
],
[
0,
207
],
[
207,
208
],
[
207,
209
]
] | [
"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 in = new BufferedReader(new InputStreamReader(System.in));\n\t\tint r, c, sum, sumOfAll;\n\t\tint[][] sheet;\n\t\tString[] size = in.readLine().split(\" \");\n\t\tr = Integer.parseInt(size[0]);\n\t\tc = Integer.parseInt(size[1]);\n\t\tStringBuilder sb = new StringBuilder((r + 1) * (c + 1));\n\t\tsheet = new int[r][c];\n\t\tfor (int i = 0; i < r; i += 1) {\n\t\t\tsum = 0;\n\t\t\tString[] array = in.readLine().split(\" \");\n\t\t\tfor (int j = 0; j < c; j += 1) {\n\t\t\t\tsheet[i][j] = Integer.parseInt(array[j]);\n\t\t\t\tsb.append(sheet[i][j]).append(\" \");\n\t\t\t\tsum += sheet[i][j];\n\t\t\t}\n\t\t\tsb.append(sum + System.getProperty(\"line.separator\"));\n\t\t}\n\t\tin = null;\n\t\tsumOfAll = 0;\n\t\tfor (int m = 0; m < c; m += 1) {\n\t\t\tsum = 0;\n\t\t\tfor (int n = 0; n < r; n += 1) {\n\t\t\t\tsum += sheet[n][m];\n\t\t\t}\n\t\t\tsumOfAll += sum;\n\t\t\tsb.append(sum).append(\" \");\n\t\t}\n\t\tsb.append(sumOfAll);\n\t\tSystem.out.println(sb);\n\t\tsb = null;\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 in = new BufferedReader(new InputStreamReader(System.in));\n\t\tint r, c, sum, sumOfAll;\n\t\tint[][] sheet;\n\t\tString[] size = in.readLine().split(\" \");\n\t\tr = Integer.parseInt(size[0]);\n\t\tc = Integer.parseInt(size[1]);\n\t\tStringBuilder sb = new StringBuilder((r + 1) * (c + 1));\n\t\tsheet = new int[r][c];\n\t\tfor (int i = 0; i < r; i += 1) {\n\t\t\tsum = 0;\n\t\t\tString[] array = in.readLine().split(\" \");\n\t\t\tfor (int j = 0; j < c; j += 1) {\n\t\t\t\tsheet[i][j] = Integer.parseInt(array[j]);\n\t\t\t\tsb.append(sheet[i][j]).append(\" \");\n\t\t\t\tsum += sheet[i][j];\n\t\t\t}\n\t\t\tsb.append(sum + System.getProperty(\"line.separator\"));\n\t\t}\n\t\tin = null;\n\t\tsumOfAll = 0;\n\t\tfor (int m = 0; m < c; m += 1) {\n\t\t\tsum = 0;\n\t\t\tfor (int n = 0; n < r; n += 1) {\n\t\t\t\tsum += sheet[n][m];\n\t\t\t}\n\t\t\tsumOfAll += sum;\n\t\t\tsb.append(sum).append(\" \");\n\t\t}\n\t\tsb.append(sumOfAll);\n\t\tSystem.out.println(sb);\n\t\tsb = null;\n\t}\n}",
"Main",
"public static void main(String[] args) throws IOException {\n\t\tBufferedReader in = new BufferedReader(new InputStreamReader(System.in));\n\t\tint r, c, sum, sumOfAll;\n\t\tint[][] sheet;\n\t\tString[] size = in.readLine().split(\" \");\n\t\tr = Integer.parseInt(size[0]);\n\t\tc = Integer.parseInt(size[1]);\n\t\tStringBuilder sb = new StringBuilder((r + 1) * (c + 1));\n\t\tsheet = new int[r][c];\n\t\tfor (int i = 0; i < r; i += 1) {\n\t\t\tsum = 0;\n\t\t\tString[] array = in.readLine().split(\" \");\n\t\t\tfor (int j = 0; j < c; j += 1) {\n\t\t\t\tsheet[i][j] = Integer.parseInt(array[j]);\n\t\t\t\tsb.append(sheet[i][j]).append(\" \");\n\t\t\t\tsum += sheet[i][j];\n\t\t\t}\n\t\t\tsb.append(sum + System.getProperty(\"line.separator\"));\n\t\t}\n\t\tin = null;\n\t\tsumOfAll = 0;\n\t\tfor (int m = 0; m < c; m += 1) {\n\t\t\tsum = 0;\n\t\t\tfor (int n = 0; n < r; n += 1) {\n\t\t\t\tsum += sheet[n][m];\n\t\t\t}\n\t\t\tsumOfAll += sum;\n\t\t\tsb.append(sum).append(\" \");\n\t\t}\n\t\tsb.append(sumOfAll);\n\t\tSystem.out.println(sb);\n\t\tsb = null;\n\t}",
"main",
"{\n\t\tBufferedReader in = new BufferedReader(new InputStreamReader(System.in));\n\t\tint r, c, sum, sumOfAll;\n\t\tint[][] sheet;\n\t\tString[] size = in.readLine().split(\" \");\n\t\tr = Integer.parseInt(size[0]);\n\t\tc = Integer.parseInt(size[1]);\n\t\tStringBuilder sb = new StringBuilder((r + 1) * (c + 1));\n\t\tsheet = new int[r][c];\n\t\tfor (int i = 0; i < r; i += 1) {\n\t\t\tsum = 0;\n\t\t\tString[] array = in.readLine().split(\" \");\n\t\t\tfor (int j = 0; j < c; j += 1) {\n\t\t\t\tsheet[i][j] = Integer.parseInt(array[j]);\n\t\t\t\tsb.append(sheet[i][j]).append(\" \");\n\t\t\t\tsum += sheet[i][j];\n\t\t\t}\n\t\t\tsb.append(sum + System.getProperty(\"line.separator\"));\n\t\t}\n\t\tin = null;\n\t\tsumOfAll = 0;\n\t\tfor (int m = 0; m < c; m += 1) {\n\t\t\tsum = 0;\n\t\t\tfor (int n = 0; n < r; n += 1) {\n\t\t\t\tsum += sheet[n][m];\n\t\t\t}\n\t\t\tsumOfAll += sum;\n\t\t\tsb.append(sum).append(\" \");\n\t\t}\n\t\tsb.append(sumOfAll);\n\t\tSystem.out.println(sb);\n\t\tsb = null;\n\t}",
"BufferedReader in = new BufferedReader(new InputStreamReader(System.in));",
"in",
"new BufferedReader(new InputStreamReader(System.in))",
"int r",
"r",
"c",
"c",
"sum",
"sum",
"sumOfAll;",
"sumOfAll",
"int[][] sheet;",
"sheet",
"String[] size = in.readLine().split(\" \");",
"size",
"in.readLine().split(\" \")",
"in.readLine().split",
"in.readLine()",
"in.readLine",
"in",
"\" \"",
"r = Integer.parseInt(size[0])",
"r",
"Integer.parseInt(size[0])",
"Integer.parseInt",
"Integer",
"size[0]",
"size",
"0",
"c = Integer.parseInt(size[1])",
"c",
"Integer.parseInt(size[1])",
"Integer.parseInt",
"Integer",
"size[1]",
"size",
"1",
"StringBuilder sb = new StringBuilder((r + 1) * (c + 1));",
"sb",
"new StringBuilder((r + 1) * (c + 1))",
"sheet = new int[r][c]",
"sheet",
"new int[r][c]",
"r",
"c",
"for (int i = 0; i < r; i += 1) {\n\t\t\tsum = 0;\n\t\t\tString[] array = in.readLine().split(\" \");\n\t\t\tfor (int j = 0; j < c; j += 1) {\n\t\t\t\tsheet[i][j] = Integer.parseInt(array[j]);\n\t\t\t\tsb.append(sheet[i][j]).append(\" \");\n\t\t\t\tsum += sheet[i][j];\n\t\t\t}\n\t\t\tsb.append(sum + System.getProperty(\"line.separator\"));\n\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < r",
"i",
"r",
"i += 1",
"i += 1",
"i",
"1",
"{\n\t\t\tsum = 0;\n\t\t\tString[] array = in.readLine().split(\" \");\n\t\t\tfor (int j = 0; j < c; j += 1) {\n\t\t\t\tsheet[i][j] = Integer.parseInt(array[j]);\n\t\t\t\tsb.append(sheet[i][j]).append(\" \");\n\t\t\t\tsum += sheet[i][j];\n\t\t\t}\n\t\t\tsb.append(sum + System.getProperty(\"line.separator\"));\n\t\t}",
"{\n\t\t\tsum = 0;\n\t\t\tString[] array = in.readLine().split(\" \");\n\t\t\tfor (int j = 0; j < c; j += 1) {\n\t\t\t\tsheet[i][j] = Integer.parseInt(array[j]);\n\t\t\t\tsb.append(sheet[i][j]).append(\" \");\n\t\t\t\tsum += sheet[i][j];\n\t\t\t}\n\t\t\tsb.append(sum + System.getProperty(\"line.separator\"));\n\t\t}",
"sum = 0",
"sum",
"0",
"String[] array = in.readLine().split(\" \");",
"array",
"in.readLine().split(\" \")",
"in.readLine().split",
"in.readLine()",
"in.readLine",
"in",
"\" \"",
"for (int j = 0; j < c; j += 1) {\n\t\t\t\tsheet[i][j] = Integer.parseInt(array[j]);\n\t\t\t\tsb.append(sheet[i][j]).append(\" \");\n\t\t\t\tsum += sheet[i][j];\n\t\t\t}",
"int j = 0;",
"int j = 0;",
"j",
"0",
"j < c",
"j",
"c",
"j += 1",
"j += 1",
"j",
"1",
"{\n\t\t\t\tsheet[i][j] = Integer.parseInt(array[j]);\n\t\t\t\tsb.append(sheet[i][j]).append(\" \");\n\t\t\t\tsum += sheet[i][j];\n\t\t\t}",
"{\n\t\t\t\tsheet[i][j] = Integer.parseInt(array[j]);\n\t\t\t\tsb.append(sheet[i][j]).append(\" \");\n\t\t\t\tsum += sheet[i][j];\n\t\t\t}",
"sheet[i][j] = Integer.parseInt(array[j])",
"sheet[i][j]",
"sheet[i]",
"sheet",
"i",
"j",
"Integer.parseInt(array[j])",
"Integer.parseInt",
"Integer",
"array[j]",
"array",
"j",
"sb.append(sheet[i][j]).append(\" \")",
"sb.append(sheet[i][j]).append",
"sb.append(sheet[i][j])",
"sb.append",
"sb",
"sheet[i][j]",
"sheet[i]",
"sheet",
"i",
"j",
"\" \"",
"sum += sheet[i][j]",
"sum",
"sheet[i][j]",
"sheet[i]",
"sheet",
"i",
"j",
"sb.append(sum + System.getProperty(\"line.separator\"))",
"sb.append",
"sb",
"sum + System.getProperty(\"line.separator\")",
"sum",
"System.getProperty(\"line.separator\")",
"System.getProperty",
"System",
"\"line.separator\"",
"in = null",
"in",
"null",
"sumOfAll = 0",
"sumOfAll",
"0",
"for (int m = 0; m < c; m += 1) {\n\t\t\tsum = 0;\n\t\t\tfor (int n = 0; n < r; n += 1) {\n\t\t\t\tsum += sheet[n][m];\n\t\t\t}\n\t\t\tsumOfAll += sum;\n\t\t\tsb.append(sum).append(\" \");\n\t\t}",
"int m = 0;",
"int m = 0;",
"m",
"0",
"m < c",
"m",
"c",
"m += 1",
"m += 1",
"m",
"1",
"{\n\t\t\tsum = 0;\n\t\t\tfor (int n = 0; n < r; n += 1) {\n\t\t\t\tsum += sheet[n][m];\n\t\t\t}\n\t\t\tsumOfAll += sum;\n\t\t\tsb.append(sum).append(\" \");\n\t\t}",
"{\n\t\t\tsum = 0;\n\t\t\tfor (int n = 0; n < r; n += 1) {\n\t\t\t\tsum += sheet[n][m];\n\t\t\t}\n\t\t\tsumOfAll += sum;\n\t\t\tsb.append(sum).append(\" \");\n\t\t}",
"sum = 0",
"sum",
"0",
"for (int n = 0; n < r; n += 1) {\n\t\t\t\tsum += sheet[n][m];\n\t\t\t}",
"int n = 0;",
"int n = 0;",
"n",
"0",
"n < r",
"n",
"r",
"n += 1",
"n += 1",
"n",
"1",
"{\n\t\t\t\tsum += sheet[n][m];\n\t\t\t}",
"{\n\t\t\t\tsum += sheet[n][m];\n\t\t\t}",
"sum += sheet[n][m]",
"sum",
"sheet[n][m]",
"sheet[n]",
"sheet",
"n",
"m",
"sumOfAll += sum",
"sumOfAll",
"sum",
"sb.append(sum).append(\" \")",
"sb.append(sum).append",
"sb.append(sum)",
"sb.append",
"sb",
"sum",
"\" \"",
"sb.append(sumOfAll)",
"sb.append",
"sb",
"sumOfAll",
"System.out.println(sb)",
"System.out.println",
"System.out",
"System",
"System.out",
"sb",
"sb = null",
"sb",
"null",
"String[] args",
"args",
"public class Main{\n\tpublic static void main(String[] args) throws IOException {\n\t\tBufferedReader in = new BufferedReader(new InputStreamReader(System.in));\n\t\tint r, c, sum, sumOfAll;\n\t\tint[][] sheet;\n\t\tString[] size = in.readLine().split(\" \");\n\t\tr = Integer.parseInt(size[0]);\n\t\tc = Integer.parseInt(size[1]);\n\t\tStringBuilder sb = new StringBuilder((r + 1) * (c + 1));\n\t\tsheet = new int[r][c];\n\t\tfor (int i = 0; i < r; i += 1) {\n\t\t\tsum = 0;\n\t\t\tString[] array = in.readLine().split(\" \");\n\t\t\tfor (int j = 0; j < c; j += 1) {\n\t\t\t\tsheet[i][j] = Integer.parseInt(array[j]);\n\t\t\t\tsb.append(sheet[i][j]).append(\" \");\n\t\t\t\tsum += sheet[i][j];\n\t\t\t}\n\t\t\tsb.append(sum + System.getProperty(\"line.separator\"));\n\t\t}\n\t\tin = null;\n\t\tsumOfAll = 0;\n\t\tfor (int m = 0; m < c; m += 1) {\n\t\t\tsum = 0;\n\t\t\tfor (int n = 0; n < r; n += 1) {\n\t\t\t\tsum += sheet[n][m];\n\t\t\t}\n\t\t\tsumOfAll += sum;\n\t\t\tsb.append(sum).append(\" \");\n\t\t}\n\t\tsb.append(sumOfAll);\n\t\tSystem.out.println(sb);\n\t\tsb = null;\n\t}\n}",
"public class Main{\n\tpublic static void main(String[] args) throws IOException {\n\t\tBufferedReader in = new BufferedReader(new InputStreamReader(System.in));\n\t\tint r, c, sum, sumOfAll;\n\t\tint[][] sheet;\n\t\tString[] size = in.readLine().split(\" \");\n\t\tr = Integer.parseInt(size[0]);\n\t\tc = Integer.parseInt(size[1]);\n\t\tStringBuilder sb = new StringBuilder((r + 1) * (c + 1));\n\t\tsheet = new int[r][c];\n\t\tfor (int i = 0; i < r; i += 1) {\n\t\t\tsum = 0;\n\t\t\tString[] array = in.readLine().split(\" \");\n\t\t\tfor (int j = 0; j < c; j += 1) {\n\t\t\t\tsheet[i][j] = Integer.parseInt(array[j]);\n\t\t\t\tsb.append(sheet[i][j]).append(\" \");\n\t\t\t\tsum += sheet[i][j];\n\t\t\t}\n\t\t\tsb.append(sum + System.getProperty(\"line.separator\"));\n\t\t}\n\t\tin = null;\n\t\tsumOfAll = 0;\n\t\tfor (int m = 0; m < c; m += 1) {\n\t\t\tsum = 0;\n\t\t\tfor (int n = 0; n < r; n += 1) {\n\t\t\t\tsum += sheet[n][m];\n\t\t\t}\n\t\t\tsumOfAll += sum;\n\t\t\tsb.append(sum).append(\" \");\n\t\t}\n\t\tsb.append(sumOfAll);\n\t\tSystem.out.println(sb);\n\t\tsb = null;\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 in = new BufferedReader(new InputStreamReader(System.in));
int r, c, sum, sumOfAll;
int[][] sheet;
String[] size = in.readLine().split(" ");
r = Integer.parseInt(size[0]);
c = Integer.parseInt(size[1]);
StringBuilder sb = new StringBuilder((r + 1) * (c + 1));
sheet = new int[r][c];
for (int i = 0; i < r; i += 1) {
sum = 0;
String[] array = in.readLine().split(" ");
for (int j = 0; j < c; j += 1) {
sheet[i][j] = Integer.parseInt(array[j]);
sb.append(sheet[i][j]).append(" ");
sum += sheet[i][j];
}
sb.append(sum + System.getProperty("line.separator"));
}
in = null;
sumOfAll = 0;
for (int m = 0; m < c; m += 1) {
sum = 0;
for (int n = 0; n < r; n += 1) {
sum += sheet[n][m];
}
sumOfAll += sum;
sb.append(sum).append(" ");
}
sb.append(sumOfAll);
System.out.println(sb);
sb = null;
}
} |
[
7,
15,
13,
17,
6,
13,
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,
41,
13,
41,
13,
41,
13,
41,
13,
11,
1,
0,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
17,
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,
11,
1,
0,
13,
17,
2,
13,
2,
13,
17,
1,
40,
13,
30,
30,
11,
1,
0,
13,
17,
2,
13,
13,
1,
40,
13,
30,
0,
18,
18,
13,
13,
13,
18,
18,
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,
17,
4,
18,
18,
13,
13,
17,
18,
18,
13,
13,
13,
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
],
[
198,
5
],
[
198,
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
],
[
8,
37
],
[
37,
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
],
[
55,
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
],
[
78,
79
],
[
79,
80
],
[
71,
81
],
[
81,
82
],
[
81,
83
],
[
83,
84
],
[
84,
85
],
[
84,
86
],
[
83,
87
],
[
55,
88
],
[
88,
89
],
[
89,
90
],
[
90,
91
],
[
90,
92
],
[
89,
93
],
[
88,
94
],
[
8,
95
],
[
95,
96
],
[
96,
97
],
[
97,
98
],
[
97,
99
],
[
95,
100
],
[
100,
101
],
[
100,
102
],
[
102,
103
],
[
102,
104
],
[
95,
105
],
[
105,
106
],
[
106,
107
],
[
95,
108
],
[
109,
109
],
[
109,
110
],
[
110,
111
],
[
111,
112
],
[
112,
113
],
[
112,
114
],
[
110,
115
],
[
115,
116
],
[
115,
117
],
[
110,
118
],
[
118,
119
],
[
119,
120
],
[
110,
121
],
[
121,
122
],
[
122,
123
],
[
123,
124
],
[
124,
125
],
[
124,
126
],
[
123,
127
],
[
122,
128
],
[
128,
129
],
[
129,
130
],
[
129,
131
],
[
128,
132
],
[
8,
133
],
[
133,
134
],
[
134,
135
],
[
135,
136
],
[
135,
137
],
[
133,
138
],
[
138,
139
],
[
138,
140
],
[
140,
141
],
[
140,
142
],
[
133,
143
],
[
143,
144
],
[
144,
145
],
[
133,
146
],
[
147,
147
],
[
147,
148
],
[
148,
149
],
[
149,
150
],
[
150,
151
],
[
150,
152
],
[
148,
153
],
[
153,
154
],
[
153,
155
],
[
155,
156
],
[
155,
157
],
[
148,
158
],
[
158,
159
],
[
159,
160
],
[
148,
161
],
[
162,
162
],
[
162,
163
],
[
163,
164
],
[
164,
165
],
[
164,
166
],
[
163,
167
],
[
167,
168
],
[
168,
169
],
[
169,
170
],
[
169,
171
],
[
167,
172
],
[
167,
173
],
[
173,
174
],
[
174,
175
],
[
174,
176
],
[
173,
177
],
[
163,
178
],
[
178,
179
],
[
179,
180
],
[
180,
181
],
[
180,
182
],
[
178,
183
],
[
178,
184
],
[
184,
185
],
[
185,
186
],
[
185,
187
],
[
184,
188
],
[
147,
189
],
[
189,
190
],
[
190,
191
],
[
191,
192
],
[
191,
193
],
[
189,
194
],
[
6,
195
],
[
195,
196
],
[
0,
197
],
[
197,
198
],
[
197,
199
]
] | [
"import java.util.*;\n\npublic class Main {\n public static void main(String[] args) throws Exception {\n Scanner sc=new Scanner(System.in);\n int r,c;\n r=sc.nextInt();\n c=sc.nextInt();\n \n int table[][]=new int[r+1][c+1];\n \n int sum;\n int i,j,k;\n for(i=0;i<r;i++){\n sum=0;\n for(j=0;j<c;j++){\n table[i][j]=sc.nextInt();\n sum+=table[i][j];\n }\n table[i][j]=sum;\n }\n for(j=0;j<c+1;j++){\n for(k=0;k<r;k++)table[i][j]+=table[k][j];\n }\n \n for(i=0;i<r+1;i++){\n for(j=0;j<c+1;j++){\n if(j==0)System.out.printf(\"%d\",table[i][j]);\n else System.out.printf(\" %d\",table[i][j]);\n }\n System.out.printf(\"\\n\");\n }\n\n }\n}",
"import java.util.*;",
"util.*",
"java",
"public class Main {\n public static void main(String[] args) throws Exception {\n Scanner sc=new Scanner(System.in);\n int r,c;\n r=sc.nextInt();\n c=sc.nextInt();\n \n int table[][]=new int[r+1][c+1];\n \n int sum;\n int i,j,k;\n for(i=0;i<r;i++){\n sum=0;\n for(j=0;j<c;j++){\n table[i][j]=sc.nextInt();\n sum+=table[i][j];\n }\n table[i][j]=sum;\n }\n for(j=0;j<c+1;j++){\n for(k=0;k<r;k++)table[i][j]+=table[k][j];\n }\n \n for(i=0;i<r+1;i++){\n for(j=0;j<c+1;j++){\n if(j==0)System.out.printf(\"%d\",table[i][j]);\n else System.out.printf(\" %d\",table[i][j]);\n }\n System.out.printf(\"\\n\");\n }\n\n }\n}",
"Main",
"public static void main(String[] args) throws Exception {\n Scanner sc=new Scanner(System.in);\n int r,c;\n r=sc.nextInt();\n c=sc.nextInt();\n \n int table[][]=new int[r+1][c+1];\n \n int sum;\n int i,j,k;\n for(i=0;i<r;i++){\n sum=0;\n for(j=0;j<c;j++){\n table[i][j]=sc.nextInt();\n sum+=table[i][j];\n }\n table[i][j]=sum;\n }\n for(j=0;j<c+1;j++){\n for(k=0;k<r;k++)table[i][j]+=table[k][j];\n }\n \n for(i=0;i<r+1;i++){\n for(j=0;j<c+1;j++){\n if(j==0)System.out.printf(\"%d\",table[i][j]);\n else System.out.printf(\" %d\",table[i][j]);\n }\n System.out.printf(\"\\n\");\n }\n\n }",
"main",
"{\n Scanner sc=new Scanner(System.in);\n int r,c;\n r=sc.nextInt();\n c=sc.nextInt();\n \n int table[][]=new int[r+1][c+1];\n \n int sum;\n int i,j,k;\n for(i=0;i<r;i++){\n sum=0;\n for(j=0;j<c;j++){\n table[i][j]=sc.nextInt();\n sum+=table[i][j];\n }\n table[i][j]=sum;\n }\n for(j=0;j<c+1;j++){\n for(k=0;k<r;k++)table[i][j]+=table[k][j];\n }\n \n for(i=0;i<r+1;i++){\n for(j=0;j<c+1;j++){\n if(j==0)System.out.printf(\"%d\",table[i][j]);\n else System.out.printf(\" %d\",table[i][j]);\n }\n System.out.printf(\"\\n\");\n }\n\n }",
"Scanner sc=new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"int r",
"r",
"c;",
"c",
"r=sc.nextInt()",
"r",
"sc.nextInt()",
"sc.nextInt",
"sc",
"c=sc.nextInt()",
"c",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int table[][]=new int[r+1][c+1];",
"table",
"new int[r+1][c+1]",
"r+1",
"r",
"1",
"c+1",
"c",
"1",
"int sum;",
"sum",
"int i",
"i",
"j",
"j",
"k;",
"k",
"for(i=0;i<r;i++){\n sum=0;\n for(j=0;j<c;j++){\n table[i][j]=sc.nextInt();\n sum+=table[i][j];\n }\n table[i][j]=sum;\n }",
"i=0;",
"i=0",
"i",
"0",
"i<r",
"i",
"r",
"i++",
"i++",
"i",
"{\n sum=0;\n for(j=0;j<c;j++){\n table[i][j]=sc.nextInt();\n sum+=table[i][j];\n }\n table[i][j]=sum;\n }",
"{\n sum=0;\n for(j=0;j<c;j++){\n table[i][j]=sc.nextInt();\n sum+=table[i][j];\n }\n table[i][j]=sum;\n }",
"sum=0",
"sum",
"0",
"for(j=0;j<c;j++){\n table[i][j]=sc.nextInt();\n sum+=table[i][j];\n }",
"j=0;",
"j=0",
"j",
"0",
"j<c",
"j",
"c",
"j++",
"j++",
"j",
"{\n table[i][j]=sc.nextInt();\n sum+=table[i][j];\n }",
"{\n table[i][j]=sc.nextInt();\n sum+=table[i][j];\n }",
"table[i][j]=sc.nextInt()",
"table[i][j]",
"table[i]",
"table",
"i",
"j",
"sc.nextInt()",
"sc.nextInt",
"sc",
"sum+=table[i][j]",
"sum",
"table[i][j]",
"table[i]",
"table",
"i",
"j",
"table[i][j]=sum",
"table[i][j]",
"table[i]",
"table",
"i",
"j",
"sum",
"for(j=0;j<c+1;j++){\n for(k=0;k<r;k++)table[i][j]+=table[k][j];\n }",
"j=0;",
"j=0",
"j",
"0",
"j<c+1",
"j",
"c+1",
"c",
"1",
"j++",
"j++",
"j",
"{\n for(k=0;k<r;k++)table[i][j]+=table[k][j];\n }",
"{\n for(k=0;k<r;k++)table[i][j]+=table[k][j];\n }",
"for(k=0;k<r;k++)table[i][j]+=table[k][j];",
"k=0;",
"k=0",
"k",
"0",
"k<r",
"k",
"r",
"k++",
"k++",
"k",
"table[i][j]+=table[k][j];",
"table[i][j]+=table[k][j]",
"table[i][j]",
"table[i]",
"table",
"i",
"j",
"table[k][j]",
"table[k]",
"table",
"k",
"j",
"for(i=0;i<r+1;i++){\n for(j=0;j<c+1;j++){\n if(j==0)System.out.printf(\"%d\",table[i][j]);\n else System.out.printf(\" %d\",table[i][j]);\n }\n System.out.printf(\"\\n\");\n }",
"i=0;",
"i=0",
"i",
"0",
"i<r+1",
"i",
"r+1",
"r",
"1",
"i++",
"i++",
"i",
"{\n for(j=0;j<c+1;j++){\n if(j==0)System.out.printf(\"%d\",table[i][j]);\n else System.out.printf(\" %d\",table[i][j]);\n }\n System.out.printf(\"\\n\");\n }",
"{\n for(j=0;j<c+1;j++){\n if(j==0)System.out.printf(\"%d\",table[i][j]);\n else System.out.printf(\" %d\",table[i][j]);\n }\n System.out.printf(\"\\n\");\n }",
"for(j=0;j<c+1;j++){\n if(j==0)System.out.printf(\"%d\",table[i][j]);\n else System.out.printf(\" %d\",table[i][j]);\n }",
"j=0;",
"j=0",
"j",
"0",
"j<c+1",
"j",
"c+1",
"c",
"1",
"j++",
"j++",
"j",
"{\n if(j==0)System.out.printf(\"%d\",table[i][j]);\n else System.out.printf(\" %d\",table[i][j]);\n }",
"{\n if(j==0)System.out.printf(\"%d\",table[i][j]);\n else System.out.printf(\" %d\",table[i][j]);\n }",
"if(j==0)System.out.printf(\"%d\",table[i][j]);\n else System.out.printf(\" %d\",table[i][j]);",
"j==0",
"j",
"0",
"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(\" %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) throws Exception {\n Scanner sc=new Scanner(System.in);\n int r,c;\n r=sc.nextInt();\n c=sc.nextInt();\n \n int table[][]=new int[r+1][c+1];\n \n int sum;\n int i,j,k;\n for(i=0;i<r;i++){\n sum=0;\n for(j=0;j<c;j++){\n table[i][j]=sc.nextInt();\n sum+=table[i][j];\n }\n table[i][j]=sum;\n }\n for(j=0;j<c+1;j++){\n for(k=0;k<r;k++)table[i][j]+=table[k][j];\n }\n \n for(i=0;i<r+1;i++){\n for(j=0;j<c+1;j++){\n if(j==0)System.out.printf(\"%d\",table[i][j]);\n else System.out.printf(\" %d\",table[i][j]);\n }\n System.out.printf(\"\\n\");\n }\n\n }\n}",
"public class Main {\n public static void main(String[] args) throws Exception {\n Scanner sc=new Scanner(System.in);\n int r,c;\n r=sc.nextInt();\n c=sc.nextInt();\n \n int table[][]=new int[r+1][c+1];\n \n int sum;\n int i,j,k;\n for(i=0;i<r;i++){\n sum=0;\n for(j=0;j<c;j++){\n table[i][j]=sc.nextInt();\n sum+=table[i][j];\n }\n table[i][j]=sum;\n }\n for(j=0;j<c+1;j++){\n for(k=0;k<r;k++)table[i][j]+=table[k][j];\n }\n \n for(i=0;i<r+1;i++){\n for(j=0;j<c+1;j++){\n if(j==0)System.out.printf(\"%d\",table[i][j]);\n else System.out.printf(\" %d\",table[i][j]);\n }\n System.out.printf(\"\\n\");\n }\n\n }\n}",
"Main"
] | import java.util.*;
public class Main {
public static void main(String[] args) throws Exception {
Scanner sc=new Scanner(System.in);
int r,c;
r=sc.nextInt();
c=sc.nextInt();
int table[][]=new int[r+1][c+1];
int sum;
int i,j,k;
for(i=0;i<r;i++){
sum=0;
for(j=0;j<c;j++){
table[i][j]=sc.nextInt();
sum+=table[i][j];
}
table[i][j]=sum;
}
for(j=0;j<c+1;j++){
for(k=0;k<r;k++)table[i][j]+=table[k][j];
}
for(i=0;i<r+1;i++){
for(j=0;j<c+1;j++){
if(j==0)System.out.printf("%d",table[i][j]);
else System.out.printf(" %d",table[i][j]);
}
System.out.printf("\n");
}
}
}
|
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
13,
4,
18,
4,
18,
13,
17,
41,
13,
18,
13,
17,
41,
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,
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,
18,
13,
13,
0,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
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,
4,
13,
18,
13,
13,
23,
13,
12,
13,
30,
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,
12,
13,
30,
41,
13,
20,
11,
1,
41,
13,
17,
2,
13,
18,
13,
13,
1,
40,
13,
30,
30,
4,
18,
13,
18,
13,
13,
14,
2,
13,
2,
18,
13,
13,
17,
30,
3,
4,
18,
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
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
285,
11
],
[
285,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
15,
17
],
[
14,
18
],
[
18,
19
],
[
18,
20
],
[
20,
21
],
[
20,
22
],
[
22,
23
],
[
23,
24
],
[
24,
25
],
[
25,
26
],
[
22,
27
],
[
14,
28
],
[
28,
29
],
[
28,
30
],
[
30,
31
],
[
30,
32
],
[
14,
33
],
[
33,
34
],
[
33,
35
],
[
35,
36
],
[
35,
37
],
[
14,
38
],
[
38,
39
],
[
38,
40
],
[
41,
42
],
[
41,
43
],
[
44,
45
],
[
44,
46
],
[
14,
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
],
[
62,
64
],
[
64,
65
],
[
65,
66
],
[
66,
67
],
[
67,
68
],
[
64,
69
],
[
59,
70
],
[
70,
71
],
[
71,
72
],
[
72,
73
],
[
72,
74
],
[
70,
75
],
[
75,
76
],
[
75,
77
],
[
77,
78
],
[
77,
79
],
[
70,
80
],
[
80,
81
],
[
81,
82
],
[
70,
83
],
[
84,
84
],
[
84,
85
],
[
85,
86
],
[
86,
87
],
[
87,
88
],
[
87,
89
],
[
86,
90
],
[
85,
91
],
[
91,
92
],
[
91,
93
],
[
14,
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
],
[
115,
117
],
[
110,
118
],
[
118,
119
],
[
119,
120
],
[
110,
121
],
[
122,
122
],
[
122,
123
],
[
123,
124
],
[
124,
125
],
[
125,
126
],
[
125,
127
],
[
124,
128
],
[
123,
129
],
[
129,
130
],
[
130,
131
],
[
130,
132
],
[
129,
133
],
[
14,
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
],
[
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
],
[
163,
167
],
[
162,
168
],
[
168,
169
],
[
169,
170
],
[
169,
171
],
[
168,
172
],
[
14,
173
],
[
173,
174
],
[
174,
175
],
[
175,
176
],
[
175,
177
],
[
173,
178
],
[
178,
179
],
[
178,
180
],
[
180,
181
],
[
180,
182
],
[
173,
183
],
[
183,
184
],
[
184,
185
],
[
173,
186
],
[
187,
187
],
[
187,
188
],
[
188,
189
],
[
188,
190
],
[
190,
191
],
[
190,
192
],
[
12,
193
],
[
193,
194
],
[
285,
195
],
[
195,
196
],
[
195,
197
],
[
197,
198
],
[
198,
199
],
[
198,
200
],
[
201,
202
],
[
201,
203
],
[
197,
204
],
[
204,
205
],
[
205,
206
],
[
206,
207
],
[
206,
208
],
[
204,
209
],
[
209,
210
],
[
209,
211
],
[
211,
212
],
[
211,
213
],
[
204,
214
],
[
214,
215
],
[
215,
216
],
[
204,
217
],
[
218,
218
],
[
218,
219
],
[
219,
220
],
[
220,
221
],
[
220,
222
],
[
219,
223
],
[
223,
224
],
[
224,
225
],
[
223,
226
],
[
226,
227
],
[
226,
228
],
[
197,
229
],
[
229,
230
],
[
195,
231
],
[
231,
232
],
[
285,
233
],
[
233,
234
],
[
233,
235
],
[
235,
236
],
[
236,
237
],
[
236,
238
],
[
235,
239
],
[
239,
240
],
[
240,
241
],
[
241,
242
],
[
241,
243
],
[
239,
244
],
[
244,
245
],
[
244,
246
],
[
246,
247
],
[
246,
248
],
[
239,
249
],
[
249,
250
],
[
250,
251
],
[
239,
252
],
[
253,
253
],
[
253,
254
],
[
254,
255
],
[
255,
256
],
[
254,
257
],
[
257,
258
],
[
257,
259
],
[
253,
260
],
[
260,
261
],
[
261,
262
],
[
261,
263
],
[
263,
264
],
[
264,
265
],
[
264,
266
],
[
263,
267
],
[
260,
268
],
[
268,
269
],
[
253,
270
],
[
270,
271
],
[
271,
272
],
[
270,
273
],
[
235,
274
],
[
274,
275
],
[
275,
276
],
[
276,
277
],
[
276,
278
],
[
274,
279
],
[
279,
280
],
[
280,
281
],
[
233,
282
],
[
282,
283
],
[
0,
284
],
[
284,
285
],
[
284,
286
]
] | [
"import java.io.BufferedReader;\nimport java.io.IOException;\nimport java.io.InputStreamReader;\n\npublic class Main {\n\n\tpublic static void main(String[] args) throws IOException {\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\t\tint[] arr = parceIntArray(br.readLine().split(\" \"));\n\t\tint r = arr[0];\n\t\tint c = arr[1];\n\t\tint[][] sheet = new int[r + 1][c + 1];\n\t\tfor(int i = 0;i < r;i++){\n\t\t\tarr = parceIntArray(br.readLine().split(\" \"));\n\t\t\tfor(int j = 0;j < arr.length;j++){\n\t\t\t\tsheet[i][j] = arr[j];\n\t\t\t}\n\t\t}\n\t\tarr = null;\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][c] += sheet[i][j];\n\t\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\tsheet[r][i] += sheet[j][i];\n\t\t\t}\n\t\t}\n\t\tfor(int i = 0;i < r + 1;i++){\n\t\t\twrite(sheet[i]);\n\t\t}\n\t}\n\n\tstatic int[] parceIntArray(String[] strArr){\n\t\tint[] arr = new int[strArr.length];\n\t\tfor(int i = 0;i < arr.length;i++){\n\t\t\tarr[i] = Integer.parseInt(strArr[i]);\n\t\t}\n\t\treturn arr;\n\t}\n\t\n\tstatic void write(int[] arr){\n\t\tStringBuilder sb = new StringBuilder();\n\t\tfor(int i = 0;i < arr.length;i++){\n\t\t\tsb.append(arr[i]);\n\t\t\tif(i >= arr.length - 1){\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tsb.append(\" \");\n\t\t}\n\t\tSystem.out.println(sb.toString());\n\t}\n}",
"import java.io.BufferedReader;",
"BufferedReader",
"java.io",
"import java.io.IOException;",
"IOException",
"java.io",
"import java.io.InputStreamReader;",
"InputStreamReader",
"java.io",
"public class Main {\n\n\tpublic static void main(String[] args) throws IOException {\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\t\tint[] arr = parceIntArray(br.readLine().split(\" \"));\n\t\tint r = arr[0];\n\t\tint c = arr[1];\n\t\tint[][] sheet = new int[r + 1][c + 1];\n\t\tfor(int i = 0;i < r;i++){\n\t\t\tarr = parceIntArray(br.readLine().split(\" \"));\n\t\t\tfor(int j = 0;j < arr.length;j++){\n\t\t\t\tsheet[i][j] = arr[j];\n\t\t\t}\n\t\t}\n\t\tarr = null;\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][c] += sheet[i][j];\n\t\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\tsheet[r][i] += sheet[j][i];\n\t\t\t}\n\t\t}\n\t\tfor(int i = 0;i < r + 1;i++){\n\t\t\twrite(sheet[i]);\n\t\t}\n\t}\n\n\tstatic int[] parceIntArray(String[] strArr){\n\t\tint[] arr = new int[strArr.length];\n\t\tfor(int i = 0;i < arr.length;i++){\n\t\t\tarr[i] = Integer.parseInt(strArr[i]);\n\t\t}\n\t\treturn arr;\n\t}\n\t\n\tstatic void write(int[] arr){\n\t\tStringBuilder sb = new StringBuilder();\n\t\tfor(int i = 0;i < arr.length;i++){\n\t\t\tsb.append(arr[i]);\n\t\t\tif(i >= arr.length - 1){\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tsb.append(\" \");\n\t\t}\n\t\tSystem.out.println(sb.toString());\n\t}\n}",
"Main",
"public static void main(String[] args) throws IOException {\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\t\tint[] arr = parceIntArray(br.readLine().split(\" \"));\n\t\tint r = arr[0];\n\t\tint c = arr[1];\n\t\tint[][] sheet = new int[r + 1][c + 1];\n\t\tfor(int i = 0;i < r;i++){\n\t\t\tarr = parceIntArray(br.readLine().split(\" \"));\n\t\t\tfor(int j = 0;j < arr.length;j++){\n\t\t\t\tsheet[i][j] = arr[j];\n\t\t\t}\n\t\t}\n\t\tarr = null;\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][c] += sheet[i][j];\n\t\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\tsheet[r][i] += sheet[j][i];\n\t\t\t}\n\t\t}\n\t\tfor(int i = 0;i < r + 1;i++){\n\t\t\twrite(sheet[i]);\n\t\t}\n\t}",
"main",
"{\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\t\tint[] arr = parceIntArray(br.readLine().split(\" \"));\n\t\tint r = arr[0];\n\t\tint c = arr[1];\n\t\tint[][] sheet = new int[r + 1][c + 1];\n\t\tfor(int i = 0;i < r;i++){\n\t\t\tarr = parceIntArray(br.readLine().split(\" \"));\n\t\t\tfor(int j = 0;j < arr.length;j++){\n\t\t\t\tsheet[i][j] = arr[j];\n\t\t\t}\n\t\t}\n\t\tarr = null;\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][c] += sheet[i][j];\n\t\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\tsheet[r][i] += sheet[j][i];\n\t\t\t}\n\t\t}\n\t\tfor(int i = 0;i < r + 1;i++){\n\t\t\twrite(sheet[i]);\n\t\t}\n\t}",
"BufferedReader br = new BufferedReader(new InputStreamReader(System.in));",
"br",
"new BufferedReader(new InputStreamReader(System.in))",
"int[] arr = parceIntArray(br.readLine().split(\" \"));",
"arr",
"parceIntArray(br.readLine().split(\" \"))",
"parceIntArray",
"br.readLine().split(\" \")",
"br.readLine().split",
"br.readLine()",
"br.readLine",
"br",
"\" \"",
"int r = arr[0];",
"r",
"arr[0]",
"arr",
"0",
"int c = arr[1];",
"c",
"arr[1]",
"arr",
"1",
"int[][] sheet = new int[r + 1][c + 1];",
"sheet",
"new int[r + 1][c + 1]",
"r + 1",
"r",
"1",
"c + 1",
"c",
"1",
"for(int i = 0;i < r;i++){\n\t\t\tarr = parceIntArray(br.readLine().split(\" \"));\n\t\t\tfor(int j = 0;j < arr.length;j++){\n\t\t\t\tsheet[i][j] = arr[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\tarr = parceIntArray(br.readLine().split(\" \"));\n\t\t\tfor(int j = 0;j < arr.length;j++){\n\t\t\t\tsheet[i][j] = arr[j];\n\t\t\t}\n\t\t}",
"{\n\t\t\tarr = parceIntArray(br.readLine().split(\" \"));\n\t\t\tfor(int j = 0;j < arr.length;j++){\n\t\t\t\tsheet[i][j] = arr[j];\n\t\t\t}\n\t\t}",
"arr = parceIntArray(br.readLine().split(\" \"))",
"arr",
"parceIntArray(br.readLine().split(\" \"))",
"parceIntArray",
"br.readLine().split(\" \")",
"br.readLine().split",
"br.readLine()",
"br.readLine",
"br",
"\" \"",
"for(int j = 0;j < arr.length;j++){\n\t\t\t\tsheet[i][j] = arr[j];\n\t\t\t}",
"int j = 0;",
"int j = 0;",
"j",
"0",
"j < arr.length",
"j",
"arr.length",
"arr",
"arr.length",
"j++",
"j++",
"j",
"{\n\t\t\t\tsheet[i][j] = arr[j];\n\t\t\t}",
"{\n\t\t\t\tsheet[i][j] = arr[j];\n\t\t\t}",
"sheet[i][j] = arr[j]",
"sheet[i][j]",
"sheet[i]",
"sheet",
"i",
"j",
"arr[j]",
"arr",
"j",
"arr = null",
"arr",
"null",
"for(int i = 0;i < r;i++){\n\t\t\tfor(int j = 0;j < c;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][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][c] += sheet[i][j];\n\t\t\t}\n\t\t}",
"for(int j = 0;j < c;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][c] += sheet[i][j];\n\t\t\t}",
"{\n\t\t\t\tsheet[i][c] += sheet[i][j];\n\t\t\t}",
"sheet[i][c] += sheet[i][j]",
"sheet[i][c]",
"sheet[i]",
"sheet",
"i",
"c",
"sheet[i][j]",
"sheet[i]",
"sheet",
"i",
"j",
"for(int i = 0;i < c + 1;i++){\n\t\t\tfor(int j = 0;j < r;j++){\n\t\t\t\tsheet[r][i] += sheet[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\tsheet[r][i] += sheet[j][i];\n\t\t\t}\n\t\t}",
"{\n\t\t\tfor(int j = 0;j < r;j++){\n\t\t\t\tsheet[r][i] += sheet[j][i];\n\t\t\t}\n\t\t}",
"for(int j = 0;j < r;j++){\n\t\t\t\tsheet[r][i] += sheet[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\tsheet[r][i] += sheet[j][i];\n\t\t\t}",
"{\n\t\t\t\tsheet[r][i] += sheet[j][i];\n\t\t\t}",
"sheet[r][i] += sheet[j][i]",
"sheet[r][i]",
"sheet[r]",
"sheet",
"r",
"i",
"sheet[j][i]",
"sheet[j]",
"sheet",
"j",
"i",
"for(int i = 0;i < r + 1;i++){\n\t\t\twrite(sheet[i]);\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\twrite(sheet[i]);\n\t\t}",
"{\n\t\t\twrite(sheet[i]);\n\t\t}",
"write(sheet[i])",
"write",
"sheet[i]",
"sheet",
"i",
"String[] args",
"args",
"static int[] parceIntArray(String[] strArr){\n\t\tint[] arr = new int[strArr.length];\n\t\tfor(int i = 0;i < arr.length;i++){\n\t\t\tarr[i] = Integer.parseInt(strArr[i]);\n\t\t}\n\t\treturn arr;\n\t}",
"parceIntArray",
"{\n\t\tint[] arr = new int[strArr.length];\n\t\tfor(int i = 0;i < arr.length;i++){\n\t\t\tarr[i] = Integer.parseInt(strArr[i]);\n\t\t}\n\t\treturn arr;\n\t}",
"int[] arr = new int[strArr.length];",
"arr",
"new int[strArr.length]",
"strArr.length",
"strArr",
"strArr.length",
"for(int i = 0;i < arr.length;i++){\n\t\t\tarr[i] = Integer.parseInt(strArr[i]);\n\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < arr.length",
"i",
"arr.length",
"arr",
"arr.length",
"i++",
"i++",
"i",
"{\n\t\t\tarr[i] = Integer.parseInt(strArr[i]);\n\t\t}",
"{\n\t\t\tarr[i] = Integer.parseInt(strArr[i]);\n\t\t}",
"arr[i] = Integer.parseInt(strArr[i])",
"arr[i]",
"arr",
"i",
"Integer.parseInt(strArr[i])",
"Integer.parseInt",
"Integer",
"strArr[i]",
"strArr",
"i",
"return arr;",
"arr",
"String[] strArr",
"strArr",
"static void write(int[] arr){\n\t\tStringBuilder sb = new StringBuilder();\n\t\tfor(int i = 0;i < arr.length;i++){\n\t\t\tsb.append(arr[i]);\n\t\t\tif(i >= arr.length - 1){\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tsb.append(\" \");\n\t\t}\n\t\tSystem.out.println(sb.toString());\n\t}",
"write",
"{\n\t\tStringBuilder sb = new StringBuilder();\n\t\tfor(int i = 0;i < arr.length;i++){\n\t\t\tsb.append(arr[i]);\n\t\t\tif(i >= arr.length - 1){\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tsb.append(\" \");\n\t\t}\n\t\tSystem.out.println(sb.toString());\n\t}",
"StringBuilder sb = new StringBuilder();",
"sb",
"new StringBuilder()",
"for(int i = 0;i < arr.length;i++){\n\t\t\tsb.append(arr[i]);\n\t\t\tif(i >= arr.length - 1){\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tsb.append(\" \");\n\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < arr.length",
"i",
"arr.length",
"arr",
"arr.length",
"i++",
"i++",
"i",
"{\n\t\t\tsb.append(arr[i]);\n\t\t\tif(i >= arr.length - 1){\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tsb.append(\" \");\n\t\t}",
"{\n\t\t\tsb.append(arr[i]);\n\t\t\tif(i >= arr.length - 1){\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tsb.append(\" \");\n\t\t}",
"sb.append(arr[i])",
"sb.append",
"sb",
"arr[i]",
"arr",
"i",
"if(i >= arr.length - 1){\n\t\t\t\tbreak;\n\t\t\t}",
"i >= arr.length - 1",
"i",
"arr.length - 1",
"arr.length",
"arr",
"arr.length",
"1",
"{\n\t\t\t\tbreak;\n\t\t\t}",
"break;",
"sb.append(\" \")",
"sb.append",
"sb",
"\" \"",
"System.out.println(sb.toString())",
"System.out.println",
"System.out",
"System",
"System.out",
"sb.toString()",
"sb.toString",
"sb",
"int[] arr",
"arr",
"public class Main {\n\n\tpublic static void main(String[] args) throws IOException {\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\t\tint[] arr = parceIntArray(br.readLine().split(\" \"));\n\t\tint r = arr[0];\n\t\tint c = arr[1];\n\t\tint[][] sheet = new int[r + 1][c + 1];\n\t\tfor(int i = 0;i < r;i++){\n\t\t\tarr = parceIntArray(br.readLine().split(\" \"));\n\t\t\tfor(int j = 0;j < arr.length;j++){\n\t\t\t\tsheet[i][j] = arr[j];\n\t\t\t}\n\t\t}\n\t\tarr = null;\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][c] += sheet[i][j];\n\t\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\tsheet[r][i] += sheet[j][i];\n\t\t\t}\n\t\t}\n\t\tfor(int i = 0;i < r + 1;i++){\n\t\t\twrite(sheet[i]);\n\t\t}\n\t}\n\n\tstatic int[] parceIntArray(String[] strArr){\n\t\tint[] arr = new int[strArr.length];\n\t\tfor(int i = 0;i < arr.length;i++){\n\t\t\tarr[i] = Integer.parseInt(strArr[i]);\n\t\t}\n\t\treturn arr;\n\t}\n\t\n\tstatic void write(int[] arr){\n\t\tStringBuilder sb = new StringBuilder();\n\t\tfor(int i = 0;i < arr.length;i++){\n\t\t\tsb.append(arr[i]);\n\t\t\tif(i >= arr.length - 1){\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tsb.append(\" \");\n\t\t}\n\t\tSystem.out.println(sb.toString());\n\t}\n}",
"public class Main {\n\n\tpublic static void main(String[] args) throws IOException {\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\t\tint[] arr = parceIntArray(br.readLine().split(\" \"));\n\t\tint r = arr[0];\n\t\tint c = arr[1];\n\t\tint[][] sheet = new int[r + 1][c + 1];\n\t\tfor(int i = 0;i < r;i++){\n\t\t\tarr = parceIntArray(br.readLine().split(\" \"));\n\t\t\tfor(int j = 0;j < arr.length;j++){\n\t\t\t\tsheet[i][j] = arr[j];\n\t\t\t}\n\t\t}\n\t\tarr = null;\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][c] += sheet[i][j];\n\t\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\tsheet[r][i] += sheet[j][i];\n\t\t\t}\n\t\t}\n\t\tfor(int i = 0;i < r + 1;i++){\n\t\t\twrite(sheet[i]);\n\t\t}\n\t}\n\n\tstatic int[] parceIntArray(String[] strArr){\n\t\tint[] arr = new int[strArr.length];\n\t\tfor(int i = 0;i < arr.length;i++){\n\t\t\tarr[i] = Integer.parseInt(strArr[i]);\n\t\t}\n\t\treturn arr;\n\t}\n\t\n\tstatic void write(int[] arr){\n\t\tStringBuilder sb = new StringBuilder();\n\t\tfor(int i = 0;i < arr.length;i++){\n\t\t\tsb.append(arr[i]);\n\t\t\tif(i >= arr.length - 1){\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tsb.append(\" \");\n\t\t}\n\t\tSystem.out.println(sb.toString());\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));
int[] arr = parceIntArray(br.readLine().split(" "));
int r = arr[0];
int c = arr[1];
int[][] sheet = new int[r + 1][c + 1];
for(int i = 0;i < r;i++){
arr = parceIntArray(br.readLine().split(" "));
for(int j = 0;j < arr.length;j++){
sheet[i][j] = arr[j];
}
}
arr = null;
for(int i = 0;i < r;i++){
for(int j = 0;j < c;j++){
sheet[i][c] += sheet[i][j];
}
}
for(int i = 0;i < c + 1;i++){
for(int j = 0;j < r;j++){
sheet[r][i] += sheet[j][i];
}
}
for(int i = 0;i < r + 1;i++){
write(sheet[i]);
}
}
static int[] parceIntArray(String[] strArr){
int[] arr = new int[strArr.length];
for(int i = 0;i < arr.length;i++){
arr[i] = Integer.parseInt(strArr[i]);
}
return arr;
}
static void write(int[] arr){
StringBuilder sb = new StringBuilder();
for(int i = 0;i < arr.length;i++){
sb.append(arr[i]);
if(i >= arr.length - 1){
break;
}
sb.append(" ");
}
System.out.println(sb.toString());
}
} |
[
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,
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,
4,
18,
13,
41,
13,
20,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
4,
18,
13,
18,
18,
13,
13,
13,
14,
2,
13,
13,
30,
4,
18,
13,
17,
30,
4,
18,
13,
17,
4,
18,
18,
13,
13,
13,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
153,
5
],
[
153,
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
],
[
57,
59
],
[
59,
60
],
[
60,
61
],
[
56,
62
],
[
62,
63
],
[
63,
64
],
[
64,
65
],
[
64,
66
],
[
63,
67
],
[
62,
68
],
[
56,
69
],
[
69,
70
],
[
70,
71
],
[
71,
72
],
[
71,
73
],
[
70,
74
],
[
69,
75
],
[
56,
76
],
[
76,
77
],
[
77,
78
],
[
78,
79
],
[
78,
80
],
[
77,
81
],
[
76,
82
],
[
56,
83
],
[
83,
84
],
[
84,
85
],
[
85,
86
],
[
85,
87
],
[
84,
88
],
[
83,
89
],
[
8,
90
],
[
90,
91
],
[
91,
92
],
[
8,
93
],
[
93,
94
],
[
93,
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
],
[
122,
125
],
[
125,
126
],
[
126,
127
],
[
126,
128
],
[
125,
129
],
[
121,
130
],
[
130,
131
],
[
131,
132
],
[
131,
133
],
[
130,
134
],
[
134,
135
],
[
135,
136
],
[
136,
137
],
[
135,
138
],
[
130,
139
],
[
139,
140
],
[
140,
141
],
[
141,
142
],
[
140,
143
],
[
8,
144
],
[
144,
145
],
[
145,
146
],
[
146,
147
],
[
146,
148
],
[
144,
149
],
[
6,
150
],
[
150,
151
],
[
0,
152
],
[
152,
153
],
[
152,
154
]
] | [
"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\tfinal int r = sc.nextInt();\n\t\tfinal int c = sc.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\tint v = sc.nextInt();\n\t\t\t\ttable[i][j] = v;\n\t\t\t\ttable[i][c] += v;\n\t\t\t\ttable[r][j] += v;\n\t\t\t\ttable[r][c] += v;\n\t\t\t}\n\t\t}\n\t\tsc.close();\n\t\tStringBuilder sb = new StringBuilder();\n\t\tfor (int i = 0; i <= r; i++) {\n\t\t\tfor (int j = 0; j <= c; j++) {\n\t\t\t\tsb.append(table[i][j]);\n\t\t\t\tif (j == c) {\n\t\t\t\t\tsb.append(\"\\n\");\n\t\t\t\t} else {\n\t\t\t\t\tsb.append(\" \");\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tSystem.out.print(sb);\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\tfinal int r = sc.nextInt();\n\t\tfinal int c = sc.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\tint v = sc.nextInt();\n\t\t\t\ttable[i][j] = v;\n\t\t\t\ttable[i][c] += v;\n\t\t\t\ttable[r][j] += v;\n\t\t\t\ttable[r][c] += v;\n\t\t\t}\n\t\t}\n\t\tsc.close();\n\t\tStringBuilder sb = new StringBuilder();\n\t\tfor (int i = 0; i <= r; i++) {\n\t\t\tfor (int j = 0; j <= c; j++) {\n\t\t\t\tsb.append(table[i][j]);\n\t\t\t\tif (j == c) {\n\t\t\t\t\tsb.append(\"\\n\");\n\t\t\t\t} else {\n\t\t\t\t\tsb.append(\" \");\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tSystem.out.print(sb);\n\t}\n}",
"Main",
"public static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\tfinal int r = sc.nextInt();\n\t\tfinal int c = sc.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\tint v = sc.nextInt();\n\t\t\t\ttable[i][j] = v;\n\t\t\t\ttable[i][c] += v;\n\t\t\t\ttable[r][j] += v;\n\t\t\t\ttable[r][c] += v;\n\t\t\t}\n\t\t}\n\t\tsc.close();\n\t\tStringBuilder sb = new StringBuilder();\n\t\tfor (int i = 0; i <= r; i++) {\n\t\t\tfor (int j = 0; j <= c; j++) {\n\t\t\t\tsb.append(table[i][j]);\n\t\t\t\tif (j == c) {\n\t\t\t\t\tsb.append(\"\\n\");\n\t\t\t\t} else {\n\t\t\t\t\tsb.append(\" \");\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tSystem.out.print(sb);\n\t}",
"main",
"{\n\t\tScanner sc = new Scanner(System.in);\n\t\tfinal int r = sc.nextInt();\n\t\tfinal int c = sc.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\tint v = sc.nextInt();\n\t\t\t\ttable[i][j] = v;\n\t\t\t\ttable[i][c] += v;\n\t\t\t\ttable[r][j] += v;\n\t\t\t\ttable[r][c] += v;\n\t\t\t}\n\t\t}\n\t\tsc.close();\n\t\tStringBuilder sb = new StringBuilder();\n\t\tfor (int i = 0; i <= r; i++) {\n\t\t\tfor (int j = 0; j <= c; j++) {\n\t\t\t\tsb.append(table[i][j]);\n\t\t\t\tif (j == c) {\n\t\t\t\t\tsb.append(\"\\n\");\n\t\t\t\t} else {\n\t\t\t\t\tsb.append(\" \");\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tSystem.out.print(sb);\n\t}",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"final int r = sc.nextInt();",
"r",
"sc.nextInt()",
"sc.nextInt",
"sc",
"final int c = sc.nextInt();",
"c",
"sc.nextInt()",
"sc.nextInt",
"sc",
"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\tint v = sc.nextInt();\n\t\t\t\ttable[i][j] = v;\n\t\t\t\ttable[i][c] += v;\n\t\t\t\ttable[r][j] += v;\n\t\t\t\ttable[r][c] += v;\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 v = sc.nextInt();\n\t\t\t\ttable[i][j] = v;\n\t\t\t\ttable[i][c] += v;\n\t\t\t\ttable[r][j] += v;\n\t\t\t\ttable[r][c] += v;\n\t\t\t}\n\t\t}",
"{\n\t\t\tfor (int j = 0; j < c; j++) {\n\t\t\t\tint v = sc.nextInt();\n\t\t\t\ttable[i][j] = v;\n\t\t\t\ttable[i][c] += v;\n\t\t\t\ttable[r][j] += v;\n\t\t\t\ttable[r][c] += v;\n\t\t\t}\n\t\t}",
"for (int j = 0; j < c; j++) {\n\t\t\t\tint v = sc.nextInt();\n\t\t\t\ttable[i][j] = v;\n\t\t\t\ttable[i][c] += v;\n\t\t\t\ttable[r][j] += v;\n\t\t\t\ttable[r][c] += v;\n\t\t\t}",
"int j = 0;",
"int j = 0;",
"j",
"0",
"j < c",
"j",
"c",
"j++",
"j++",
"j",
"{\n\t\t\t\tint v = sc.nextInt();\n\t\t\t\ttable[i][j] = v;\n\t\t\t\ttable[i][c] += v;\n\t\t\t\ttable[r][j] += v;\n\t\t\t\ttable[r][c] += v;\n\t\t\t}",
"{\n\t\t\t\tint v = sc.nextInt();\n\t\t\t\ttable[i][j] = v;\n\t\t\t\ttable[i][c] += v;\n\t\t\t\ttable[r][j] += v;\n\t\t\t\ttable[r][c] += v;\n\t\t\t}",
"int v = sc.nextInt();",
"v",
"sc.nextInt()",
"sc.nextInt",
"sc",
"table[i][j] = v",
"table[i][j]",
"table[i]",
"table",
"i",
"j",
"v",
"table[i][c] += v",
"table[i][c]",
"table[i]",
"table",
"i",
"c",
"v",
"table[r][j] += v",
"table[r][j]",
"table[r]",
"table",
"r",
"j",
"v",
"table[r][c] += v",
"table[r][c]",
"table[r]",
"table",
"r",
"c",
"v",
"sc.close()",
"sc.close",
"sc",
"StringBuilder sb = new StringBuilder();",
"sb",
"new StringBuilder()",
"for (int i = 0; i <= r; i++) {\n\t\t\tfor (int j = 0; j <= c; j++) {\n\t\t\t\tsb.append(table[i][j]);\n\t\t\t\tif (j == c) {\n\t\t\t\t\tsb.append(\"\\n\");\n\t\t\t\t} else {\n\t\t\t\t\tsb.append(\" \");\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\tsb.append(table[i][j]);\n\t\t\t\tif (j == c) {\n\t\t\t\t\tsb.append(\"\\n\");\n\t\t\t\t} else {\n\t\t\t\t\tsb.append(\" \");\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\tsb.append(table[i][j]);\n\t\t\t\tif (j == c) {\n\t\t\t\t\tsb.append(\"\\n\");\n\t\t\t\t} else {\n\t\t\t\t\tsb.append(\" \");\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"for (int j = 0; j <= c; j++) {\n\t\t\t\tsb.append(table[i][j]);\n\t\t\t\tif (j == c) {\n\t\t\t\t\tsb.append(\"\\n\");\n\t\t\t\t} else {\n\t\t\t\t\tsb.append(\" \");\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\tsb.append(table[i][j]);\n\t\t\t\tif (j == c) {\n\t\t\t\t\tsb.append(\"\\n\");\n\t\t\t\t} else {\n\t\t\t\t\tsb.append(\" \");\n\t\t\t\t}\n\t\t\t}",
"{\n\t\t\t\tsb.append(table[i][j]);\n\t\t\t\tif (j == c) {\n\t\t\t\t\tsb.append(\"\\n\");\n\t\t\t\t} else {\n\t\t\t\t\tsb.append(\" \");\n\t\t\t\t}\n\t\t\t}",
"sb.append(table[i][j])",
"sb.append",
"sb",
"table[i][j]",
"table[i]",
"table",
"i",
"j",
"if (j == c) {\n\t\t\t\t\tsb.append(\"\\n\");\n\t\t\t\t} else {\n\t\t\t\t\tsb.append(\" \");\n\t\t\t\t}",
"j == c",
"j",
"c",
"{\n\t\t\t\t\tsb.append(\"\\n\");\n\t\t\t\t}",
"sb.append(\"\\n\")",
"sb.append",
"sb",
"\"\\n\"",
"{\n\t\t\t\t\tsb.append(\" \");\n\t\t\t\t}",
"sb.append(\" \")",
"sb.append",
"sb",
"\" \"",
"System.out.print(sb)",
"System.out.print",
"System.out",
"System",
"System.out",
"sb",
"String[] args",
"args",
"public class Main {\n\tpublic static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\tfinal int r = sc.nextInt();\n\t\tfinal int c = sc.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\tint v = sc.nextInt();\n\t\t\t\ttable[i][j] = v;\n\t\t\t\ttable[i][c] += v;\n\t\t\t\ttable[r][j] += v;\n\t\t\t\ttable[r][c] += v;\n\t\t\t}\n\t\t}\n\t\tsc.close();\n\t\tStringBuilder sb = new StringBuilder();\n\t\tfor (int i = 0; i <= r; i++) {\n\t\t\tfor (int j = 0; j <= c; j++) {\n\t\t\t\tsb.append(table[i][j]);\n\t\t\t\tif (j == c) {\n\t\t\t\t\tsb.append(\"\\n\");\n\t\t\t\t} else {\n\t\t\t\t\tsb.append(\" \");\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tSystem.out.print(sb);\n\t}\n}",
"public class Main {\n\tpublic static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\tfinal int r = sc.nextInt();\n\t\tfinal int c = sc.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\tint v = sc.nextInt();\n\t\t\t\ttable[i][j] = v;\n\t\t\t\ttable[i][c] += v;\n\t\t\t\ttable[r][j] += v;\n\t\t\t\ttable[r][c] += v;\n\t\t\t}\n\t\t}\n\t\tsc.close();\n\t\tStringBuilder sb = new StringBuilder();\n\t\tfor (int i = 0; i <= r; i++) {\n\t\t\tfor (int j = 0; j <= c; j++) {\n\t\t\t\tsb.append(table[i][j]);\n\t\t\t\tif (j == c) {\n\t\t\t\t\tsb.append(\"\\n\");\n\t\t\t\t} else {\n\t\t\t\t\tsb.append(\" \");\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tSystem.out.print(sb);\n\t}\n}",
"Main"
] | import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
final int r = sc.nextInt();
final int c = sc.nextInt();
int[][] table = new int[r + 1][c + 1];
for (int i = 0; i < r; i++) {
for (int j = 0; j < c; j++) {
int v = sc.nextInt();
table[i][j] = v;
table[i][c] += v;
table[r][j] += v;
table[r][c] += v;
}
}
sc.close();
StringBuilder sb = new StringBuilder();
for (int i = 0; i <= r; i++) {
for (int j = 0; j <= c; j++) {
sb.append(table[i][j]);
if (j == c) {
sb.append("\n");
} else {
sb.append(" ");
}
}
}
System.out.print(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,
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,
14,
2,
2,
13,
13,
2,
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,
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,
4,
18,
13,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
163,
5
],
[
163,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
8,
17
],
[
17,
18
],
[
17,
19
],
[
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
],
[
93,
94
],
[
93,
95
],
[
88,
96
],
[
96,
97
],
[
97,
98
],
[
98,
99
],
[
98,
100
],
[
97,
101
],
[
96,
102
],
[
102,
103
],
[
103,
104
],
[
103,
105
],
[
102,
106
],
[
8,
107
],
[
107,
108
],
[
108,
109
],
[
109,
110
],
[
109,
111
],
[
107,
112
],
[
112,
113
],
[
112,
114
],
[
114,
115
],
[
114,
116
],
[
107,
117
],
[
117,
118
],
[
118,
119
],
[
107,
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
],
[
135,
140
],
[
140,
141
],
[
141,
142
],
[
142,
143
],
[
142,
144
],
[
141,
145
],
[
140,
146
],
[
121,
147
],
[
147,
148
],
[
148,
149
],
[
149,
150
],
[
149,
151
],
[
147,
152
],
[
152,
153
],
[
153,
154
],
[
153,
155
],
[
152,
156
],
[
8,
157
],
[
157,
158
],
[
158,
159
],
[
6,
160
],
[
160,
161
],
[
0,
162
],
[
162,
163
],
[
162,
164
]
] | [
"import java.util.Scanner;\n\npublic class Main {\n\tpublic static void main(String[] args) {\n\tScanner sc = new Scanner(System.in);\n\t\n\tint r = sc.nextInt(); //?????????????????§???\n\tint c = sc.nextInt(); //?????????????????§???\n\tint[][] num = new int[r+1][c+1] ; //??\\?????????????????§???\n\t\n\tfor(int i = 0; i < r ; i++) {\n\t\tfor(int j = 0; j < c ; j++) {\n\t\t num[i][j] = sc.nextInt();\n\t\t \n\t\t num[i][c] += num[i][j]; //?????°???????¨???§???\n\t\t num[r][j] += num[i][j]; //?????°???????¨???§???\n\t\t if(i < r & j < c)\n\t\t num[r][c] += num[i][j]; //?????????????????°???????¨???§???\n\t\t \n\t\t}\n\t }\n\t\n//???????????????????????????????????????\t\n\tfor(int i = 0; i < r+1 ; i++) {\n\t\tfor(int j = 0; j < c ; j++) {\n\t\t\tSystem.out.print(num[i][j] + \" \");\n\t\t}\n\t\tSystem.out.println(num[i][c]); //?????????????????????????????°???????¨??????????????????????\n\t}\n sc.close();\t\n }\n\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n\tpublic static void main(String[] args) {\n\tScanner sc = new Scanner(System.in);\n\t\n\tint r = sc.nextInt(); //?????????????????§???\n\tint c = sc.nextInt(); //?????????????????§???\n\tint[][] num = new int[r+1][c+1] ; //??\\?????????????????§???\n\t\n\tfor(int i = 0; i < r ; i++) {\n\t\tfor(int j = 0; j < c ; j++) {\n\t\t num[i][j] = sc.nextInt();\n\t\t \n\t\t num[i][c] += num[i][j]; //?????°???????¨???§???\n\t\t num[r][j] += num[i][j]; //?????°???????¨???§???\n\t\t if(i < r & j < c)\n\t\t num[r][c] += num[i][j]; //?????????????????°???????¨???§???\n\t\t \n\t\t}\n\t }\n\t\n//???????????????????????????????????????\t\n\tfor(int i = 0; i < r+1 ; i++) {\n\t\tfor(int j = 0; j < c ; j++) {\n\t\t\tSystem.out.print(num[i][j] + \" \");\n\t\t}\n\t\tSystem.out.println(num[i][c]); //?????????????????????????????°???????¨??????????????????????\n\t}\n sc.close();\t\n }\n\n}",
"Main",
"public static void main(String[] args) {\n\tScanner sc = new Scanner(System.in);\n\t\n\tint r = sc.nextInt(); //?????????????????§???\n\tint c = sc.nextInt(); //?????????????????§???\n\tint[][] num = new int[r+1][c+1] ; //??\\?????????????????§???\n\t\n\tfor(int i = 0; i < r ; i++) {\n\t\tfor(int j = 0; j < c ; j++) {\n\t\t num[i][j] = sc.nextInt();\n\t\t \n\t\t num[i][c] += num[i][j]; //?????°???????¨???§???\n\t\t num[r][j] += num[i][j]; //?????°???????¨???§???\n\t\t if(i < r & j < c)\n\t\t num[r][c] += num[i][j]; //?????????????????°???????¨???§???\n\t\t \n\t\t}\n\t }\n\t\n//???????????????????????????????????????\t\n\tfor(int i = 0; i < r+1 ; i++) {\n\t\tfor(int j = 0; j < c ; j++) {\n\t\t\tSystem.out.print(num[i][j] + \" \");\n\t\t}\n\t\tSystem.out.println(num[i][c]); //?????????????????????????????°???????¨??????????????????????\n\t}\n sc.close();\t\n }",
"main",
"{\n\tScanner sc = new Scanner(System.in);\n\t\n\tint r = sc.nextInt(); //?????????????????§???\n\tint c = sc.nextInt(); //?????????????????§???\n\tint[][] num = new int[r+1][c+1] ; //??\\?????????????????§???\n\t\n\tfor(int i = 0; i < r ; i++) {\n\t\tfor(int j = 0; j < c ; j++) {\n\t\t num[i][j] = sc.nextInt();\n\t\t \n\t\t num[i][c] += num[i][j]; //?????°???????¨???§???\n\t\t num[r][j] += num[i][j]; //?????°???????¨???§???\n\t\t if(i < r & j < c)\n\t\t num[r][c] += num[i][j]; //?????????????????°???????¨???§???\n\t\t \n\t\t}\n\t }\n\t\n//???????????????????????????????????????\t\n\tfor(int i = 0; i < r+1 ; i++) {\n\t\tfor(int j = 0; j < c ; j++) {\n\t\t\tSystem.out.print(num[i][j] + \" \");\n\t\t}\n\t\tSystem.out.println(num[i][c]); //?????????????????????????????°???????¨??????????????????????\n\t}\n sc.close();\t\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[][] num = new int[r+1][c+1] ;",
"num",
"new int[r+1][c+1]",
"r+1",
"r",
"1",
"c+1",
"c",
"1",
"for(int i = 0; i < r ; i++) {\n\t\tfor(int j = 0; j < c ; j++) {\n\t\t num[i][j] = sc.nextInt();\n\t\t \n\t\t num[i][c] += num[i][j]; //?????°???????¨???§???\n\t\t num[r][j] += num[i][j]; //?????°???????¨???§???\n\t\t if(i < r & j < c)\n\t\t num[r][c] += num[i][j]; //?????????????????°???????¨???§???\n\t\t \n\t\t}\n\t }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < r",
"i",
"r",
"i++",
"i++",
"i",
"{\n\t\tfor(int j = 0; j < c ; j++) {\n\t\t num[i][j] = sc.nextInt();\n\t\t \n\t\t num[i][c] += num[i][j]; //?????°???????¨???§???\n\t\t num[r][j] += num[i][j]; //?????°???????¨???§???\n\t\t if(i < r & j < c)\n\t\t num[r][c] += num[i][j]; //?????????????????°???????¨???§???\n\t\t \n\t\t}\n\t }",
"{\n\t\tfor(int j = 0; j < c ; j++) {\n\t\t num[i][j] = sc.nextInt();\n\t\t \n\t\t num[i][c] += num[i][j]; //?????°???????¨???§???\n\t\t num[r][j] += num[i][j]; //?????°???????¨???§???\n\t\t if(i < r & j < c)\n\t\t num[r][c] += num[i][j]; //?????????????????°???????¨???§???\n\t\t \n\t\t}\n\t }",
"for(int j = 0; j < c ; j++) {\n\t\t num[i][j] = sc.nextInt();\n\t\t \n\t\t num[i][c] += num[i][j]; //?????°???????¨???§???\n\t\t num[r][j] += num[i][j]; //?????°???????¨???§???\n\t\t if(i < r & j < c)\n\t\t num[r][c] += num[i][j]; //?????????????????°???????¨???§???\n\t\t \n\t\t}",
"int j = 0;",
"int j = 0;",
"j",
"0",
"j < c",
"j",
"c",
"j++",
"j++",
"j",
"{\n\t\t num[i][j] = sc.nextInt();\n\t\t \n\t\t num[i][c] += num[i][j]; //?????°???????¨???§???\n\t\t num[r][j] += num[i][j]; //?????°???????¨???§???\n\t\t if(i < r & j < c)\n\t\t num[r][c] += num[i][j]; //?????????????????°???????¨???§???\n\t\t \n\t\t}",
"{\n\t\t num[i][j] = sc.nextInt();\n\t\t \n\t\t num[i][c] += num[i][j]; //?????°???????¨???§???\n\t\t num[r][j] += num[i][j]; //?????°???????¨???§???\n\t\t if(i < r & j < c)\n\t\t num[r][c] += num[i][j]; //?????????????????°???????¨???§???\n\t\t \n\t\t}",
"num[i][j] = sc.nextInt()",
"num[i][j]",
"num[i]",
"num",
"i",
"j",
"sc.nextInt()",
"sc.nextInt",
"sc",
"num[i][c] += num[i][j]",
"num[i][c]",
"num[i]",
"num",
"i",
"c",
"num[i][j]",
"num[i]",
"num",
"i",
"j",
"num[r][j] += num[i][j]",
"num[r][j]",
"num[r]",
"num",
"r",
"j",
"num[i][j]",
"num[i]",
"num",
"i",
"j",
"if(i < r & j < c)\n\t\t num[r][c] += num[i][j]; //?????????????????°???????¨???§???",
"i < r & j < c",
"i < r",
"i",
"r",
"j < c",
"j",
"c",
"num[r][c] += num[i][j]",
"num[r][c]",
"num[r]",
"num",
"r",
"c",
"num[i][j]",
"num[i]",
"num",
"i",
"j",
"for(int i = 0; i < r+1 ; i++) {\n\t\tfor(int j = 0; j < c ; j++) {\n\t\t\tSystem.out.print(num[i][j] + \" \");\n\t\t}\n\t\tSystem.out.println(num[i][c]); //?????????????????????????????°???????¨??????????????????????\n\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < r+1",
"i",
"r+1",
"r",
"1",
"i++",
"i++",
"i",
"{\n\t\tfor(int j = 0; j < c ; j++) {\n\t\t\tSystem.out.print(num[i][j] + \" \");\n\t\t}\n\t\tSystem.out.println(num[i][c]); //?????????????????????????????°???????¨??????????????????????\n\t}",
"{\n\t\tfor(int j = 0; j < c ; j++) {\n\t\t\tSystem.out.print(num[i][j] + \" \");\n\t\t}\n\t\tSystem.out.println(num[i][c]); //?????????????????????????????°???????¨??????????????????????\n\t}",
"for(int j = 0; j < c ; j++) {\n\t\t\tSystem.out.print(num[i][j] + \" \");\n\t\t}",
"int j = 0;",
"int j = 0;",
"j",
"0",
"j < c",
"j",
"c",
"j++",
"j++",
"j",
"{\n\t\t\tSystem.out.print(num[i][j] + \" \");\n\t\t}",
"{\n\t\t\tSystem.out.print(num[i][j] + \" \");\n\t\t}",
"System.out.print(num[i][j] + \" \")",
"System.out.print",
"System.out",
"System",
"System.out",
"num[i][j] + \" \"",
"num[i][j]",
"num[i]",
"num",
"i",
"j",
"\" \"",
"System.out.println(num[i][c])",
"System.out.println",
"System.out",
"System",
"System.out",
"num[i][c]",
"num[i]",
"num",
"i",
"c",
"sc.close()",
"sc.close",
"sc",
"String[] args",
"args",
"public class Main {\n\tpublic static void main(String[] args) {\n\tScanner sc = new Scanner(System.in);\n\t\n\tint r = sc.nextInt(); //?????????????????§???\n\tint c = sc.nextInt(); //?????????????????§???\n\tint[][] num = new int[r+1][c+1] ; //??\\?????????????????§???\n\t\n\tfor(int i = 0; i < r ; i++) {\n\t\tfor(int j = 0; j < c ; j++) {\n\t\t num[i][j] = sc.nextInt();\n\t\t \n\t\t num[i][c] += num[i][j]; //?????°???????¨???§???\n\t\t num[r][j] += num[i][j]; //?????°???????¨???§???\n\t\t if(i < r & j < c)\n\t\t num[r][c] += num[i][j]; //?????????????????°???????¨???§???\n\t\t \n\t\t}\n\t }\n\t\n//???????????????????????????????????????\t\n\tfor(int i = 0; i < r+1 ; i++) {\n\t\tfor(int j = 0; j < c ; j++) {\n\t\t\tSystem.out.print(num[i][j] + \" \");\n\t\t}\n\t\tSystem.out.println(num[i][c]); //?????????????????????????????°???????¨??????????????????????\n\t}\n sc.close();\t\n }\n\n}",
"public class Main {\n\tpublic static void main(String[] args) {\n\tScanner sc = new Scanner(System.in);\n\t\n\tint r = sc.nextInt(); //?????????????????§???\n\tint c = sc.nextInt(); //?????????????????§???\n\tint[][] num = new int[r+1][c+1] ; //??\\?????????????????§???\n\t\n\tfor(int i = 0; i < r ; i++) {\n\t\tfor(int j = 0; j < c ; j++) {\n\t\t num[i][j] = sc.nextInt();\n\t\t \n\t\t num[i][c] += num[i][j]; //?????°???????¨???§???\n\t\t num[r][j] += num[i][j]; //?????°???????¨???§???\n\t\t if(i < r & j < c)\n\t\t num[r][c] += num[i][j]; //?????????????????°???????¨???§???\n\t\t \n\t\t}\n\t }\n\t\n//???????????????????????????????????????\t\n\tfor(int i = 0; i < r+1 ; i++) {\n\t\tfor(int j = 0; j < c ; j++) {\n\t\t\tSystem.out.print(num[i][j] + \" \");\n\t\t}\n\t\tSystem.out.println(num[i][c]); //?????????????????????????????°???????¨??????????????????????\n\t}\n sc.close();\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 r = sc.nextInt(); //?????????????????§???
int c = sc.nextInt(); //?????????????????§???
int[][] num = new int[r+1][c+1] ; //??\?????????????????§???
for(int i = 0; i < r ; i++) {
for(int j = 0; j < c ; j++) {
num[i][j] = sc.nextInt();
num[i][c] += num[i][j]; //?????°???????¨???§???
num[r][j] += num[i][j]; //?????°???????¨???§???
if(i < r & j < c)
num[r][c] += num[i][j]; //?????????????????°???????¨???§???
}
}
//???????????????????????????????????????
for(int i = 0; i < r+1 ; i++) {
for(int j = 0; j < c ; j++) {
System.out.print(num[i][j] + " ");
}
System.out.println(num[i][c]); //?????????????????????????????°???????¨??????????????????????
}
sc.close();
}
} |
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
41,
13,
41,
13,
41,
13,
41,
13,
20,
17,
17,
11,
1,
0,
13,
17,
2,
13,
17,
1,
40,
13,
30,
30,
11,
1,
0,
13,
17,
2,
13,
17,
1,
40,
13,
30,
30,
0,
18,
18,
13,
13,
13,
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,
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,
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,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
233,
5
],
[
233,
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,
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
],
[
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
],
[
52,
56
],
[
51,
57
],
[
8,
58
],
[
58,
59
],
[
58,
60
],
[
60,
61
],
[
61,
62
],
[
8,
63
],
[
63,
64
],
[
63,
65
],
[
65,
66
],
[
66,
67
],
[
8,
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
],
[
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
],
[
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
],
[
213,
217
],
[
217,
218
],
[
218,
219
],
[
219,
220
],
[
220,
221
],
[
220,
222
],
[
218,
223
],
[
189,
224
],
[
224,
225
],
[
225,
226
],
[
226,
227
],
[
226,
228
],
[
224,
229
],
[
6,
230
],
[
230,
231
],
[
0,
232
],
[
232,
233
],
[
232,
234
]
] | [
"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, c;\n\t\tint i, j;\n\t\tint[][] sheet = new int[101][101];\n\t\t\n\t\tfor(i = 0; i < 101; i++){\n\t\t\tfor(j = 0; j < 101; j++){\n\t\t\t\tsheet[i][j] = 0;\n\t\t\t}\n\t\t}\n\t\t\n\t\tr = sc.nextInt();\n\t\tc = sc.nextInt();\n\t\t\n\t\tfor(i = 0; i < r; i++){\n\t\t\tfor(j = 0; j < c; j++){\n\t\t\t\tsheet[i][j] = sc.nextInt();\n\t\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\tsheet[i][c] += sheet[i][j];\n\t\t\t}\n\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\tsheet[r][j] += sheet[i][j];\n\t\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.print(sheet[i][j]);\n\t\t\t\t\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\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\tScanner sc = new Scanner(System.in);\n\t\tint r, c;\n\t\tint i, j;\n\t\tint[][] sheet = new int[101][101];\n\t\t\n\t\tfor(i = 0; i < 101; i++){\n\t\t\tfor(j = 0; j < 101; j++){\n\t\t\t\tsheet[i][j] = 0;\n\t\t\t}\n\t\t}\n\t\t\n\t\tr = sc.nextInt();\n\t\tc = sc.nextInt();\n\t\t\n\t\tfor(i = 0; i < r; i++){\n\t\t\tfor(j = 0; j < c; j++){\n\t\t\t\tsheet[i][j] = sc.nextInt();\n\t\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\tsheet[i][c] += sheet[i][j];\n\t\t\t}\n\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\tsheet[r][j] += sheet[i][j];\n\t\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.print(sheet[i][j]);\n\t\t\t\t\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\n\t\t\tSystem.out.println(\"\");\n\t\t}\n\t}\n}",
"Main",
"public static void main(String args[]){\n\t\tScanner sc = new Scanner(System.in);\n\t\tint r, c;\n\t\tint i, j;\n\t\tint[][] sheet = new int[101][101];\n\t\t\n\t\tfor(i = 0; i < 101; i++){\n\t\t\tfor(j = 0; j < 101; j++){\n\t\t\t\tsheet[i][j] = 0;\n\t\t\t}\n\t\t}\n\t\t\n\t\tr = sc.nextInt();\n\t\tc = sc.nextInt();\n\t\t\n\t\tfor(i = 0; i < r; i++){\n\t\t\tfor(j = 0; j < c; j++){\n\t\t\t\tsheet[i][j] = sc.nextInt();\n\t\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\tsheet[i][c] += sheet[i][j];\n\t\t\t}\n\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\tsheet[r][j] += sheet[i][j];\n\t\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.print(sheet[i][j]);\n\t\t\t\t\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\n\t\t\tSystem.out.println(\"\");\n\t\t}\n\t}",
"main",
"{\n\t\tScanner sc = new Scanner(System.in);\n\t\tint r, c;\n\t\tint i, j;\n\t\tint[][] sheet = new int[101][101];\n\t\t\n\t\tfor(i = 0; i < 101; i++){\n\t\t\tfor(j = 0; j < 101; j++){\n\t\t\t\tsheet[i][j] = 0;\n\t\t\t}\n\t\t}\n\t\t\n\t\tr = sc.nextInt();\n\t\tc = sc.nextInt();\n\t\t\n\t\tfor(i = 0; i < r; i++){\n\t\t\tfor(j = 0; j < c; j++){\n\t\t\t\tsheet[i][j] = sc.nextInt();\n\t\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\tsheet[i][c] += sheet[i][j];\n\t\t\t}\n\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\tsheet[r][j] += sheet[i][j];\n\t\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.print(sheet[i][j]);\n\t\t\t\t\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\n\t\t\tSystem.out.println(\"\");\n\t\t}\n\t}",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"int r",
"r",
"c;",
"c",
"int i",
"i",
"j;",
"j",
"int[][] sheet = new int[101][101];",
"sheet",
"new int[101][101]",
"101",
"101",
"for(i = 0; i < 101; i++){\n\t\t\tfor(j = 0; j < 101; j++){\n\t\t\t\tsheet[i][j] = 0;\n\t\t\t}\n\t\t}",
"i = 0;",
"i = 0",
"i",
"0",
"i < 101",
"i",
"101",
"i++",
"i++",
"i",
"{\n\t\t\tfor(j = 0; j < 101; j++){\n\t\t\t\tsheet[i][j] = 0;\n\t\t\t}\n\t\t}",
"{\n\t\t\tfor(j = 0; j < 101; j++){\n\t\t\t\tsheet[i][j] = 0;\n\t\t\t}\n\t\t}",
"for(j = 0; j < 101; j++){\n\t\t\t\tsheet[i][j] = 0;\n\t\t\t}",
"j = 0;",
"j = 0",
"j",
"0",
"j < 101",
"j",
"101",
"j++",
"j++",
"j",
"{\n\t\t\t\tsheet[i][j] = 0;\n\t\t\t}",
"{\n\t\t\t\tsheet[i][j] = 0;\n\t\t\t}",
"sheet[i][j] = 0",
"sheet[i][j]",
"sheet[i]",
"sheet",
"i",
"j",
"0",
"r = sc.nextInt()",
"r",
"sc.nextInt()",
"sc.nextInt",
"sc",
"c = sc.nextInt()",
"c",
"sc.nextInt()",
"sc.nextInt",
"sc",
"for(i = 0; i < r; i++){\n\t\t\tfor(j = 0; j < c; j++){\n\t\t\t\tsheet[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\tsheet[i][j] = sc.nextInt();\n\t\t\t}\n\t\t}",
"{\n\t\t\tfor(j = 0; j < c; j++){\n\t\t\t\tsheet[i][j] = sc.nextInt();\n\t\t\t}\n\t\t}",
"for(j = 0; j < c; j++){\n\t\t\t\tsheet[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\tsheet[i][j] = sc.nextInt();\n\t\t\t}",
"{\n\t\t\t\tsheet[i][j] = sc.nextInt();\n\t\t\t}",
"sheet[i][j] = sc.nextInt()",
"sheet[i][j]",
"sheet[i]",
"sheet",
"i",
"j",
"sc.nextInt()",
"sc.nextInt",
"sc",
"for(i = 0; i < r; i++){\n\t\t\tfor(j = 0; j < c; j++){\n\t\t\t\tsheet[i][c] += sheet[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\tsheet[i][c] += sheet[i][j];\n\t\t\t}\n\t\t}",
"{\n\t\t\tfor(j = 0; j < c; j++){\n\t\t\t\tsheet[i][c] += sheet[i][j];\n\t\t\t}\n\t\t}",
"for(j = 0; j < c; j++){\n\t\t\t\tsheet[i][c] += sheet[i][j];\n\t\t\t}",
"j = 0;",
"j = 0",
"j",
"0",
"j < c",
"j",
"c",
"j++",
"j++",
"j",
"{\n\t\t\t\tsheet[i][c] += sheet[i][j];\n\t\t\t}",
"{\n\t\t\t\tsheet[i][c] += sheet[i][j];\n\t\t\t}",
"sheet[i][c] += sheet[i][j]",
"sheet[i][c]",
"sheet[i]",
"sheet",
"i",
"c",
"sheet[i][j]",
"sheet[i]",
"sheet",
"i",
"j",
"for(j = 0; j <= c; j++){\n\t\t\tfor(i = 0; i < r; i++){\n\t\t\t\tsheet[r][j] += sheet[i][j];\n\t\t\t}\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\tsheet[r][j] += sheet[i][j];\n\t\t\t}\n\t\t}",
"{\n\t\t\tfor(i = 0; i < r; i++){\n\t\t\t\tsheet[r][j] += sheet[i][j];\n\t\t\t}\n\t\t}",
"for(i = 0; i < r; i++){\n\t\t\t\tsheet[r][j] += sheet[i][j];\n\t\t\t}",
"i = 0;",
"i = 0",
"i",
"0",
"i < r",
"i",
"r",
"i++",
"i++",
"i",
"{\n\t\t\t\tsheet[r][j] += sheet[i][j];\n\t\t\t}",
"{\n\t\t\t\tsheet[r][j] += sheet[i][j];\n\t\t\t}",
"sheet[r][j] += sheet[i][j]",
"sheet[r][j]",
"sheet[r]",
"sheet",
"r",
"j",
"sheet[i][j]",
"sheet[i]",
"sheet",
"i",
"j",
"for(i = 0; i <= r; i++){\n\t\t\tfor(j = 0; j <= c; j++){\n\t\t\t\tSystem.out.print(sheet[i][j]);\n\t\t\t\t\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\n\t\t\tSystem.out.println(\"\");\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.print(sheet[i][j]);\n\t\t\t\t\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\n\t\t\tSystem.out.println(\"\");\n\t\t}",
"{\n\t\t\tfor(j = 0; j <= c; j++){\n\t\t\t\tSystem.out.print(sheet[i][j]);\n\t\t\t\t\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\n\t\t\tSystem.out.println(\"\");\n\t\t}",
"for(j = 0; j <= c; j++){\n\t\t\t\tSystem.out.print(sheet[i][j]);\n\t\t\t\t\n\t\t\t\tif(j < c){\n\t\t\t\t\tSystem.out.print(\" \");\n\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\tSystem.out.print(sheet[i][j]);\n\t\t\t\t\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(sheet[i][j]);\n\t\t\t\t\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(sheet[i][j])",
"System.out.print",
"System.out",
"System",
"System.out",
"sheet[i][j]",
"sheet[i]",
"sheet",
"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",
"\"\"",
"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, c;\n\t\tint i, j;\n\t\tint[][] sheet = new int[101][101];\n\t\t\n\t\tfor(i = 0; i < 101; i++){\n\t\t\tfor(j = 0; j < 101; j++){\n\t\t\t\tsheet[i][j] = 0;\n\t\t\t}\n\t\t}\n\t\t\n\t\tr = sc.nextInt();\n\t\tc = sc.nextInt();\n\t\t\n\t\tfor(i = 0; i < r; i++){\n\t\t\tfor(j = 0; j < c; j++){\n\t\t\t\tsheet[i][j] = sc.nextInt();\n\t\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\tsheet[i][c] += sheet[i][j];\n\t\t\t}\n\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\tsheet[r][j] += sheet[i][j];\n\t\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.print(sheet[i][j]);\n\t\t\t\t\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\n\t\t\tSystem.out.println(\"\");\n\t\t}\n\t}\n}",
"public class Main{\n\tpublic static void main(String args[]){\n\t\tScanner sc = new Scanner(System.in);\n\t\tint r, c;\n\t\tint i, j;\n\t\tint[][] sheet = new int[101][101];\n\t\t\n\t\tfor(i = 0; i < 101; i++){\n\t\t\tfor(j = 0; j < 101; j++){\n\t\t\t\tsheet[i][j] = 0;\n\t\t\t}\n\t\t}\n\t\t\n\t\tr = sc.nextInt();\n\t\tc = sc.nextInt();\n\t\t\n\t\tfor(i = 0; i < r; i++){\n\t\t\tfor(j = 0; j < c; j++){\n\t\t\t\tsheet[i][j] = sc.nextInt();\n\t\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\tsheet[i][c] += sheet[i][j];\n\t\t\t}\n\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\tsheet[r][j] += sheet[i][j];\n\t\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.print(sheet[i][j]);\n\t\t\t\t\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\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, c;
int i, j;
int[][] sheet = new int[101][101];
for(i = 0; i < 101; i++){
for(j = 0; j < 101; j++){
sheet[i][j] = 0;
}
}
r = sc.nextInt();
c = sc.nextInt();
for(i = 0; i < r; i++){
for(j = 0; j < c; j++){
sheet[i][j] = sc.nextInt();
}
}
for(i = 0; i < r; i++){
for(j = 0; j < c; j++){
sheet[i][c] += sheet[i][j];
}
}
for(j = 0; j <= c; j++){
for(i = 0; i < r; i++){
sheet[r][j] += sheet[i][j];
}
}
for(i = 0; i <= r; i++){
for(j = 0; j <= c; j++){
System.out.print(sheet[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,
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,
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,
0,
18,
18,
13,
13,
13,
18,
18,
13,
13,
13,
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
],
[
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
],
[
73,
74
],
[
73,
75
],
[
66,
76
],
[
76,
77
],
[
77,
78
],
[
66,
79
],
[
80,
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
],
[
97,
99
],
[
96,
100
],
[
100,
101
],
[
101,
102
],
[
102,
103
],
[
102,
104
],
[
101,
105
],
[
100,
106
],
[
106,
107
],
[
107,
108
],
[
107,
109
],
[
106,
110
],
[
8,
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
],
[
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
],
[
142,
144
],
[
141,
145
],
[
145,
146
],
[
146,
147
],
[
147,
148
],
[
148,
149
],
[
148,
150
],
[
146,
151
],
[
151,
152
],
[
152,
153
],
[
153,
154
],
[
153,
155
],
[
152,
156
],
[
151,
157
],
[
145,
158
],
[
158,
159
],
[
159,
160
],
[
160,
161
],
[
160,
162
],
[
159,
163
],
[
158,
164
],
[
164,
165
],
[
165,
166
],
[
165,
167
],
[
164,
168
],
[
141,
169
],
[
169,
170
],
[
170,
171
],
[
171,
172
],
[
171,
173
],
[
169,
174
],
[
174,
175
],
[
175,
176
],
[
175,
177
],
[
174,
178
],
[
6,
179
],
[
179,
180
]
] | [
"\nimport java.util.*;\n\nclass Main{\npublic static void main(String[] args){\nScanner sc = new Scanner(System.in);\nint r=sc.nextInt();\nint c =sc.nextInt();\nint [][]hy =new int[r+1][c+1];\nfor(int i=0; i<r; i++){\n\tfor(int s=0; s<c; s++){\n\t\thy[i][s]=sc.nextInt();\n\t}\n}\nfor(int l=0; l<c+1; l++){\n\tfor(int m=0; m<r+1; m++){\n\t\tif(m<r) hy[r][l] += hy[m][l];\n\t\t}\n\t}\nfor(int j=0; j<r+1; j++){\n\tfor(int k=0; k<c+1; k++){\n\t\tif(k<c){System.out.print(hy[j][k]+\" \");\n\t\thy[j][c] += hy[j][k];\n\t\t}\n\t\telse System.out.println(hy[j][k]);\n\t}\n}\n}\n}",
"import java.util.*;",
"util.*",
"java",
"class Main{\npublic static void main(String[] args){\nScanner sc = new Scanner(System.in);\nint r=sc.nextInt();\nint c =sc.nextInt();\nint [][]hy =new int[r+1][c+1];\nfor(int i=0; i<r; i++){\n\tfor(int s=0; s<c; s++){\n\t\thy[i][s]=sc.nextInt();\n\t}\n}\nfor(int l=0; l<c+1; l++){\n\tfor(int m=0; m<r+1; m++){\n\t\tif(m<r) hy[r][l] += hy[m][l];\n\t\t}\n\t}\nfor(int j=0; j<r+1; j++){\n\tfor(int k=0; k<c+1; k++){\n\t\tif(k<c){System.out.print(hy[j][k]+\" \");\n\t\thy[j][c] += hy[j][k];\n\t\t}\n\t\telse System.out.println(hy[j][k]);\n\t}\n}\n}\n}",
"Main",
"public static void main(String[] args){\nScanner sc = new Scanner(System.in);\nint r=sc.nextInt();\nint c =sc.nextInt();\nint [][]hy =new int[r+1][c+1];\nfor(int i=0; i<r; i++){\n\tfor(int s=0; s<c; s++){\n\t\thy[i][s]=sc.nextInt();\n\t}\n}\nfor(int l=0; l<c+1; l++){\n\tfor(int m=0; m<r+1; m++){\n\t\tif(m<r) hy[r][l] += hy[m][l];\n\t\t}\n\t}\nfor(int j=0; j<r+1; j++){\n\tfor(int k=0; k<c+1; k++){\n\t\tif(k<c){System.out.print(hy[j][k]+\" \");\n\t\thy[j][c] += hy[j][k];\n\t\t}\n\t\telse System.out.println(hy[j][k]);\n\t}\n}\n}",
"main",
"{\nScanner sc = new Scanner(System.in);\nint r=sc.nextInt();\nint c =sc.nextInt();\nint [][]hy =new int[r+1][c+1];\nfor(int i=0; i<r; i++){\n\tfor(int s=0; s<c; s++){\n\t\thy[i][s]=sc.nextInt();\n\t}\n}\nfor(int l=0; l<c+1; l++){\n\tfor(int m=0; m<r+1; m++){\n\t\tif(m<r) hy[r][l] += hy[m][l];\n\t\t}\n\t}\nfor(int j=0; j<r+1; j++){\n\tfor(int k=0; k<c+1; k++){\n\t\tif(k<c){System.out.print(hy[j][k]+\" \");\n\t\thy[j][c] += hy[j][k];\n\t\t}\n\t\telse System.out.println(hy[j][k]);\n\t}\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 [][]hy =new int[r+1][c+1];",
"hy",
"new int[r+1][c+1]",
"r+1",
"r",
"1",
"c+1",
"c",
"1",
"for(int i=0; i<r; i++){\n\tfor(int s=0; s<c; s++){\n\t\thy[i][s]=sc.nextInt();\n\t}\n}",
"int i=0;",
"int i=0;",
"i",
"0",
"i<r",
"i",
"r",
"i++",
"i++",
"i",
"{\n\tfor(int s=0; s<c; s++){\n\t\thy[i][s]=sc.nextInt();\n\t}\n}",
"{\n\tfor(int s=0; s<c; s++){\n\t\thy[i][s]=sc.nextInt();\n\t}\n}",
"for(int s=0; s<c; s++){\n\t\thy[i][s]=sc.nextInt();\n\t}",
"int s=0;",
"int s=0;",
"s",
"0",
"s<c",
"s",
"c",
"s++",
"s++",
"s",
"{\n\t\thy[i][s]=sc.nextInt();\n\t}",
"{\n\t\thy[i][s]=sc.nextInt();\n\t}",
"hy[i][s]=sc.nextInt()",
"hy[i][s]",
"hy[i]",
"hy",
"i",
"s",
"sc.nextInt()",
"sc.nextInt",
"sc",
"for(int l=0; l<c+1; l++){\n\tfor(int m=0; m<r+1; m++){\n\t\tif(m<r) hy[r][l] += hy[m][l];\n\t\t}\n\t}",
"int l=0;",
"int l=0;",
"l",
"0",
"l<c+1",
"l",
"c+1",
"c",
"1",
"l++",
"l++",
"l",
"{\n\tfor(int m=0; m<r+1; m++){\n\t\tif(m<r) hy[r][l] += hy[m][l];\n\t\t}\n\t}",
"{\n\tfor(int m=0; m<r+1; m++){\n\t\tif(m<r) hy[r][l] += hy[m][l];\n\t\t}\n\t}",
"for(int m=0; m<r+1; m++){\n\t\tif(m<r) hy[r][l] += hy[m][l];\n\t\t}",
"int m=0;",
"int m=0;",
"m",
"0",
"m<r+1",
"m",
"r+1",
"r",
"1",
"m++",
"m++",
"m",
"{\n\t\tif(m<r) hy[r][l] += hy[m][l];\n\t\t}",
"{\n\t\tif(m<r) hy[r][l] += hy[m][l];\n\t\t}",
"if(m<r) hy[r][l] += hy[m][l];",
"m<r",
"m",
"r",
"hy[r][l] += hy[m][l]",
"hy[r][l]",
"hy[r]",
"hy",
"r",
"l",
"hy[m][l]",
"hy[m]",
"hy",
"m",
"l",
"for(int j=0; j<r+1; j++){\n\tfor(int k=0; k<c+1; k++){\n\t\tif(k<c){System.out.print(hy[j][k]+\" \");\n\t\thy[j][c] += hy[j][k];\n\t\t}\n\t\telse System.out.println(hy[j][k]);\n\t}\n}",
"int j=0;",
"int j=0;",
"j",
"0",
"j<r+1",
"j",
"r+1",
"r",
"1",
"j++",
"j++",
"j",
"{\n\tfor(int k=0; k<c+1; k++){\n\t\tif(k<c){System.out.print(hy[j][k]+\" \");\n\t\thy[j][c] += hy[j][k];\n\t\t}\n\t\telse System.out.println(hy[j][k]);\n\t}\n}",
"{\n\tfor(int k=0; k<c+1; k++){\n\t\tif(k<c){System.out.print(hy[j][k]+\" \");\n\t\thy[j][c] += hy[j][k];\n\t\t}\n\t\telse System.out.println(hy[j][k]);\n\t}\n}",
"for(int k=0; k<c+1; k++){\n\t\tif(k<c){System.out.print(hy[j][k]+\" \");\n\t\thy[j][c] += hy[j][k];\n\t\t}\n\t\telse System.out.println(hy[j][k]);\n\t}",
"int k=0;",
"int k=0;",
"k",
"0",
"k<c+1",
"k",
"c+1",
"c",
"1",
"k++",
"k++",
"k",
"{\n\t\tif(k<c){System.out.print(hy[j][k]+\" \");\n\t\thy[j][c] += hy[j][k];\n\t\t}\n\t\telse System.out.println(hy[j][k]);\n\t}",
"{\n\t\tif(k<c){System.out.print(hy[j][k]+\" \");\n\t\thy[j][c] += hy[j][k];\n\t\t}\n\t\telse System.out.println(hy[j][k]);\n\t}",
"if(k<c){System.out.print(hy[j][k]+\" \");\n\t\thy[j][c] += hy[j][k];\n\t\t}\n\t\telse System.out.println(hy[j][k]);",
"k<c",
"k",
"c",
"{System.out.print(hy[j][k]+\" \");\n\t\thy[j][c] += hy[j][k];\n\t\t}",
"System.out.print(hy[j][k]+\" \")",
"System.out.print",
"System.out",
"System",
"System.out",
"hy[j][k]+\" \"",
"hy[j][k]",
"hy[j]",
"hy",
"j",
"k",
"\" \"",
"hy[j][c] += hy[j][k]",
"hy[j][c]",
"hy[j]",
"hy",
"j",
"c",
"hy[j][k]",
"hy[j]",
"hy",
"j",
"k",
"System.out.println(hy[j][k])",
"System.out.println",
"System.out",
"System",
"System.out",
"hy[j][k]",
"hy[j]",
"hy",
"j",
"k",
"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 [][]hy =new int[r+1][c+1];
for(int i=0; i<r; i++){
for(int s=0; s<c; s++){
hy[i][s]=sc.nextInt();
}
}
for(int l=0; l<c+1; l++){
for(int m=0; m<r+1; m++){
if(m<r) hy[r][l] += hy[m][l];
}
}
for(int j=0; j<r+1; j++){
for(int k=0; k<c+1; k++){
if(k<c){System.out.print(hy[j][k]+" ");
hy[j][c] += hy[j][k];
}
else System.out.println(hy[j][k]);
}
}
}
} |
[
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,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
41,
13,
17,
14,
2,
13,
13,
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,
41,
13,
4,
18,
13,
18,
13,
13,
4,
18,
18,
13,
13,
2,
13,
17,
0,
13,
13,
0,
18,
13,
13,
13,
14,
2,
13,
13,
30,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
41,
13,
18,
13,
13,
4,
18,
18,
13,
13,
2,
13,
17,
0,
13,
13,
4,
18,
18,
13,
13,
13,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
155,
5
],
[
155,
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,
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
],
[
55,
59
],
[
59,
60
],
[
60,
61
],
[
60,
62
],
[
59,
63
],
[
63,
64
],
[
64,
65
],
[
64,
66
],
[
66,
67
],
[
67,
68
],
[
63,
69
],
[
69,
70
],
[
69,
71
],
[
71,
72
],
[
72,
73
],
[
71,
74
],
[
63,
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
],
[
88,
90
],
[
90,
91
],
[
91,
92
],
[
90,
93
],
[
93,
94
],
[
93,
95
],
[
87,
96
],
[
96,
97
],
[
97,
98
],
[
98,
99
],
[
98,
100
],
[
96,
101
],
[
101,
102
],
[
101,
103
],
[
87,
104
],
[
104,
105
],
[
104,
106
],
[
87,
107
],
[
107,
108
],
[
108,
109
],
[
108,
110
],
[
107,
111
],
[
55,
112
],
[
112,
113
],
[
113,
114
],
[
113,
115
],
[
112,
116
],
[
116,
117
],
[
117,
118
],
[
118,
119
],
[
119,
120
],
[
119,
121
],
[
117,
122
],
[
122,
123
],
[
122,
124
],
[
117,
125
],
[
125,
126
],
[
126,
127
],
[
117,
128
],
[
129,
129
],
[
129,
130
],
[
130,
131
],
[
130,
132
],
[
132,
133
],
[
132,
134
],
[
129,
135
],
[
135,
136
],
[
136,
137
],
[
137,
138
],
[
137,
139
],
[
135,
140
],
[
140,
141
],
[
140,
142
],
[
129,
143
],
[
143,
144
],
[
143,
145
],
[
55,
146
],
[
146,
147
],
[
147,
148
],
[
148,
149
],
[
148,
150
],
[
146,
151
],
[
6,
152
],
[
152,
153
],
[
0,
154
],
[
154,
155
],
[
154,
156
]
] | [
"import java.util.*;\n\npublic class Main {\n public static void main(String[] args) {\n\n Scanner sc = new Scanner(System.in);\n String line = sc.nextLine();\n String[] l = line.split(\" \");\n int r = Integer.parseInt(l[0]);\n int c = Integer.parseInt(l[1]);\n\n int[] SUM = new int[c];\n for(int i = 0; i <= r; i++) {\n\n int sum = 0;\n\n if(i != r) {\n line = sc.nextLine();\n String[] L = line.split(\" \");\n\n for(int j = 0; j < c; j++) {\n int C = Integer.parseInt(L[j]);\n System.out.print(C + \" \");\n sum += C;\n SUM[j] += C;\n }\n }\n\n if(i == r) {\n for(int j = 0; j < c; j++) {\n int C = SUM[j];\n System.out.print(C + \" \");\n sum += C;\n }\n }\n\n System.out.println(sum);\n }\n }\n}",
"import java.util.*;",
"util.*",
"java",
"public class Main {\n public static void main(String[] args) {\n\n Scanner sc = new Scanner(System.in);\n String line = sc.nextLine();\n String[] l = line.split(\" \");\n int r = Integer.parseInt(l[0]);\n int c = Integer.parseInt(l[1]);\n\n int[] SUM = new int[c];\n for(int i = 0; i <= r; i++) {\n\n int sum = 0;\n\n if(i != r) {\n line = sc.nextLine();\n String[] L = line.split(\" \");\n\n for(int j = 0; j < c; j++) {\n int C = Integer.parseInt(L[j]);\n System.out.print(C + \" \");\n sum += C;\n SUM[j] += C;\n }\n }\n\n if(i == r) {\n for(int j = 0; j < c; j++) {\n int C = SUM[j];\n System.out.print(C + \" \");\n sum += C;\n }\n }\n\n System.out.println(sum);\n }\n }\n}",
"Main",
"public static void main(String[] args) {\n\n Scanner sc = new Scanner(System.in);\n String line = sc.nextLine();\n String[] l = line.split(\" \");\n int r = Integer.parseInt(l[0]);\n int c = Integer.parseInt(l[1]);\n\n int[] SUM = new int[c];\n for(int i = 0; i <= r; i++) {\n\n int sum = 0;\n\n if(i != r) {\n line = sc.nextLine();\n String[] L = line.split(\" \");\n\n for(int j = 0; j < c; j++) {\n int C = Integer.parseInt(L[j]);\n System.out.print(C + \" \");\n sum += C;\n SUM[j] += C;\n }\n }\n\n if(i == r) {\n for(int j = 0; j < c; j++) {\n int C = SUM[j];\n System.out.print(C + \" \");\n sum += C;\n }\n }\n\n System.out.println(sum);\n }\n }",
"main",
"{\n\n Scanner sc = new Scanner(System.in);\n String line = sc.nextLine();\n String[] l = line.split(\" \");\n int r = Integer.parseInt(l[0]);\n int c = Integer.parseInt(l[1]);\n\n int[] SUM = new int[c];\n for(int i = 0; i <= r; i++) {\n\n int sum = 0;\n\n if(i != r) {\n line = sc.nextLine();\n String[] L = line.split(\" \");\n\n for(int j = 0; j < c; j++) {\n int C = Integer.parseInt(L[j]);\n System.out.print(C + \" \");\n sum += C;\n SUM[j] += C;\n }\n }\n\n if(i == r) {\n for(int j = 0; j < c; j++) {\n int C = SUM[j];\n System.out.print(C + \" \");\n sum += C;\n }\n }\n\n System.out.println(sum);\n }\n }",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"String line = sc.nextLine();",
"line",
"sc.nextLine()",
"sc.nextLine",
"sc",
"String[] l = line.split(\" \");",
"l",
"line.split(\" \")",
"line.split",
"line",
"\" \"",
"int r = Integer.parseInt(l[0]);",
"r",
"Integer.parseInt(l[0])",
"Integer.parseInt",
"Integer",
"l[0]",
"l",
"0",
"int c = Integer.parseInt(l[1]);",
"c",
"Integer.parseInt(l[1])",
"Integer.parseInt",
"Integer",
"l[1]",
"l",
"1",
"int[] SUM = new int[c];",
"SUM",
"new int[c]",
"c",
"for(int i = 0; i <= r; i++) {\n\n int sum = 0;\n\n if(i != r) {\n line = sc.nextLine();\n String[] L = line.split(\" \");\n\n for(int j = 0; j < c; j++) {\n int C = Integer.parseInt(L[j]);\n System.out.print(C + \" \");\n sum += C;\n SUM[j] += C;\n }\n }\n\n if(i == r) {\n for(int j = 0; j < c; j++) {\n int C = SUM[j];\n System.out.print(C + \" \");\n sum += C;\n }\n }\n\n System.out.println(sum);\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i <= r",
"i",
"r",
"i++",
"i++",
"i",
"{\n\n int sum = 0;\n\n if(i != r) {\n line = sc.nextLine();\n String[] L = line.split(\" \");\n\n for(int j = 0; j < c; j++) {\n int C = Integer.parseInt(L[j]);\n System.out.print(C + \" \");\n sum += C;\n SUM[j] += C;\n }\n }\n\n if(i == r) {\n for(int j = 0; j < c; j++) {\n int C = SUM[j];\n System.out.print(C + \" \");\n sum += C;\n }\n }\n\n System.out.println(sum);\n }",
"{\n\n int sum = 0;\n\n if(i != r) {\n line = sc.nextLine();\n String[] L = line.split(\" \");\n\n for(int j = 0; j < c; j++) {\n int C = Integer.parseInt(L[j]);\n System.out.print(C + \" \");\n sum += C;\n SUM[j] += C;\n }\n }\n\n if(i == r) {\n for(int j = 0; j < c; j++) {\n int C = SUM[j];\n System.out.print(C + \" \");\n sum += C;\n }\n }\n\n System.out.println(sum);\n }",
"int sum = 0;",
"sum",
"0",
"if(i != r) {\n line = sc.nextLine();\n String[] L = line.split(\" \");\n\n for(int j = 0; j < c; j++) {\n int C = Integer.parseInt(L[j]);\n System.out.print(C + \" \");\n sum += C;\n SUM[j] += C;\n }\n }",
"i != r",
"i",
"r",
"{\n line = sc.nextLine();\n String[] L = line.split(\" \");\n\n for(int j = 0; j < c; j++) {\n int C = Integer.parseInt(L[j]);\n System.out.print(C + \" \");\n sum += C;\n SUM[j] += C;\n }\n }",
"line = sc.nextLine()",
"line",
"sc.nextLine()",
"sc.nextLine",
"sc",
"String[] L = line.split(\" \");",
"L",
"line.split(\" \")",
"line.split",
"line",
"\" \"",
"for(int j = 0; j < c; j++) {\n int C = Integer.parseInt(L[j]);\n System.out.print(C + \" \");\n sum += C;\n SUM[j] += C;\n }",
"int j = 0;",
"int j = 0;",
"j",
"0",
"j < c",
"j",
"c",
"j++",
"j++",
"j",
"{\n int C = Integer.parseInt(L[j]);\n System.out.print(C + \" \");\n sum += C;\n SUM[j] += C;\n }",
"{\n int C = Integer.parseInt(L[j]);\n System.out.print(C + \" \");\n sum += C;\n SUM[j] += C;\n }",
"int C = Integer.parseInt(L[j]);",
"C",
"Integer.parseInt(L[j])",
"Integer.parseInt",
"Integer",
"L[j]",
"L",
"j",
"System.out.print(C + \" \")",
"System.out.print",
"System.out",
"System",
"System.out",
"C + \" \"",
"C",
"\" \"",
"sum += C",
"sum",
"C",
"SUM[j] += C",
"SUM[j]",
"SUM",
"j",
"C",
"if(i == r) {\n for(int j = 0; j < c; j++) {\n int C = SUM[j];\n System.out.print(C + \" \");\n sum += C;\n }\n }",
"i == r",
"i",
"r",
"{\n for(int j = 0; j < c; j++) {\n int C = SUM[j];\n System.out.print(C + \" \");\n sum += C;\n }\n }",
"for(int j = 0; j < c; j++) {\n int C = SUM[j];\n System.out.print(C + \" \");\n sum += C;\n }",
"int j = 0;",
"int j = 0;",
"j",
"0",
"j < c",
"j",
"c",
"j++",
"j++",
"j",
"{\n int C = SUM[j];\n System.out.print(C + \" \");\n sum += C;\n }",
"{\n int C = SUM[j];\n System.out.print(C + \" \");\n sum += C;\n }",
"int C = SUM[j];",
"C",
"SUM[j]",
"SUM",
"j",
"System.out.print(C + \" \")",
"System.out.print",
"System.out",
"System",
"System.out",
"C + \" \"",
"C",
"\" \"",
"sum += C",
"sum",
"C",
"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\n Scanner sc = new Scanner(System.in);\n String line = sc.nextLine();\n String[] l = line.split(\" \");\n int r = Integer.parseInt(l[0]);\n int c = Integer.parseInt(l[1]);\n\n int[] SUM = new int[c];\n for(int i = 0; i <= r; i++) {\n\n int sum = 0;\n\n if(i != r) {\n line = sc.nextLine();\n String[] L = line.split(\" \");\n\n for(int j = 0; j < c; j++) {\n int C = Integer.parseInt(L[j]);\n System.out.print(C + \" \");\n sum += C;\n SUM[j] += C;\n }\n }\n\n if(i == r) {\n for(int j = 0; j < c; j++) {\n int C = SUM[j];\n System.out.print(C + \" \");\n sum += C;\n }\n }\n\n System.out.println(sum);\n }\n }\n}",
"public class Main {\n public static void main(String[] args) {\n\n Scanner sc = new Scanner(System.in);\n String line = sc.nextLine();\n String[] l = line.split(\" \");\n int r = Integer.parseInt(l[0]);\n int c = Integer.parseInt(l[1]);\n\n int[] SUM = new int[c];\n for(int i = 0; i <= r; i++) {\n\n int sum = 0;\n\n if(i != r) {\n line = sc.nextLine();\n String[] L = line.split(\" \");\n\n for(int j = 0; j < c; j++) {\n int C = Integer.parseInt(L[j]);\n System.out.print(C + \" \");\n sum += C;\n SUM[j] += C;\n }\n }\n\n if(i == r) {\n for(int j = 0; j < c; j++) {\n int C = SUM[j];\n System.out.print(C + \" \");\n sum += C;\n }\n }\n\n System.out.println(sum);\n }\n }\n}",
"Main"
] | import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
String line = sc.nextLine();
String[] l = line.split(" ");
int r = Integer.parseInt(l[0]);
int c = Integer.parseInt(l[1]);
int[] SUM = new int[c];
for(int i = 0; i <= r; i++) {
int sum = 0;
if(i != r) {
line = sc.nextLine();
String[] L = line.split(" ");
for(int j = 0; j < c; j++) {
int C = Integer.parseInt(L[j]);
System.out.print(C + " ");
sum += C;
SUM[j] += C;
}
}
if(i == r) {
for(int j = 0; j < c; j++) {
int C = SUM[j];
System.out.print(C + " ");
sum += C;
}
}
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,
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,
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
],
[
150,
5
],
[
150,
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
],
[
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
],
[
132,
133
],
[
132,
134
],
[
131,
135
],
[
130,
136
],
[
111,
137
],
[
137,
138
],
[
138,
139
],
[
139,
140
],
[
139,
141
],
[
137,
142
],
[
142,
143
],
[
143,
144
],
[
143,
145
],
[
142,
146
],
[
6,
147
],
[
147,
148
],
[
0,
149
],
[
149,
150
],
[
149,
151
]
] | [
"import java.util.Scanner;\n\npublic class Main {\n\tpublic static void main(String[] args)\n\t{\n\t\tScanner scan = new Scanner(System.in);\n\t\tint r = scan.nextInt();\n\t\tint c = scan.nextInt();\n\t\tint[][] array = new int[r + 1][c + 1];\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\tarray[i][j] = scan.nextInt();\n\t\t\t\tarray[r][j] += array[i][j];\n\t\t\t\tarray[i][c] += array[i][j];\n\t\t\t}\n\t\t\tarray[r][c] += array[i][c];\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(array[i][j] + \" \");\n\t\t\t}\n\t\t\tSystem.out.println(array[i][c]);\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{\n\t\tScanner scan = new Scanner(System.in);\n\t\tint r = scan.nextInt();\n\t\tint c = scan.nextInt();\n\t\tint[][] array = new int[r + 1][c + 1];\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\tarray[i][j] = scan.nextInt();\n\t\t\t\tarray[r][j] += array[i][j];\n\t\t\t\tarray[i][c] += array[i][j];\n\t\t\t}\n\t\t\tarray[r][c] += array[i][c];\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(array[i][j] + \" \");\n\t\t\t}\n\t\t\tSystem.out.println(array[i][c]);\n\t\t}\n\t}\n}",
"Main",
"public static void main(String[] args)\n\t{\n\t\tScanner scan = new Scanner(System.in);\n\t\tint r = scan.nextInt();\n\t\tint c = scan.nextInt();\n\t\tint[][] array = new int[r + 1][c + 1];\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\tarray[i][j] = scan.nextInt();\n\t\t\t\tarray[r][j] += array[i][j];\n\t\t\t\tarray[i][c] += array[i][j];\n\t\t\t}\n\t\t\tarray[r][c] += array[i][c];\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(array[i][j] + \" \");\n\t\t\t}\n\t\t\tSystem.out.println(array[i][c]);\n\t\t}\n\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[][] array = new int[r + 1][c + 1];\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\tarray[i][j] = scan.nextInt();\n\t\t\t\tarray[r][j] += array[i][j];\n\t\t\t\tarray[i][c] += array[i][j];\n\t\t\t}\n\t\t\tarray[r][c] += array[i][c];\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(array[i][j] + \" \");\n\t\t\t}\n\t\t\tSystem.out.println(array[i][c]);\n\t\t}\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{\n\t\t\tfor(int j = 0;j < c;j++)\n\t\t\t{\n\t\t\t\tarray[i][j] = scan.nextInt();\n\t\t\t\tarray[r][j] += array[i][j];\n\t\t\t\tarray[i][c] += array[i][j];\n\t\t\t}\n\t\t\tarray[r][c] += array[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\tarray[i][j] = scan.nextInt();\n\t\t\t\tarray[r][j] += array[i][j];\n\t\t\t\tarray[i][c] += array[i][j];\n\t\t\t}\n\t\t\tarray[r][c] += array[i][c];\n\t\t}",
"{\n\t\t\tfor(int j = 0;j < c;j++)\n\t\t\t{\n\t\t\t\tarray[i][j] = scan.nextInt();\n\t\t\t\tarray[r][j] += array[i][j];\n\t\t\t\tarray[i][c] += array[i][j];\n\t\t\t}\n\t\t\tarray[r][c] += array[i][c];\n\t\t}",
"for(int j = 0;j < c;j++)\n\t\t\t{\n\t\t\t\tarray[i][j] = scan.nextInt();\n\t\t\t\tarray[r][j] += array[i][j];\n\t\t\t\tarray[i][c] += array[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\tarray[i][j] = scan.nextInt();\n\t\t\t\tarray[r][j] += array[i][j];\n\t\t\t\tarray[i][c] += array[i][j];\n\t\t\t}",
"{\n\t\t\t\tarray[i][j] = scan.nextInt();\n\t\t\t\tarray[r][j] += array[i][j];\n\t\t\t\tarray[i][c] += array[i][j];\n\t\t\t}",
"array[i][j] = scan.nextInt()",
"array[i][j]",
"array[i]",
"array",
"i",
"j",
"scan.nextInt()",
"scan.nextInt",
"scan",
"array[r][j] += array[i][j]",
"array[r][j]",
"array[r]",
"array",
"r",
"j",
"array[i][j]",
"array[i]",
"array",
"i",
"j",
"array[i][c] += array[i][j]",
"array[i][c]",
"array[i]",
"array",
"i",
"c",
"array[i][j]",
"array[i]",
"array",
"i",
"j",
"array[r][c] += array[i][c]",
"array[r][c]",
"array[r]",
"array",
"r",
"c",
"array[i][c]",
"array[i]",
"array",
"i",
"c",
"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(array[i][j] + \" \");\n\t\t\t}\n\t\t\tSystem.out.println(array[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\tSystem.out.print(array[i][j] + \" \");\n\t\t\t}\n\t\t\tSystem.out.println(array[i][c]);\n\t\t}",
"{\n\t\t\tfor(int j = 0;j < c;j++)\n\t\t\t{\n\t\t\t\tSystem.out.print(array[i][j] + \" \");\n\t\t\t}\n\t\t\tSystem.out.println(array[i][c]);\n\t\t}",
"for(int j = 0;j < c;j++)\n\t\t\t{\n\t\t\t\tSystem.out.print(array[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(array[i][j] + \" \");\n\t\t\t}",
"{\n\t\t\t\tSystem.out.print(array[i][j] + \" \");\n\t\t\t}",
"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(array[i][c])",
"System.out.println",
"System.out",
"System",
"System.out",
"array[i][c]",
"array[i]",
"array",
"i",
"c",
"String[] args",
"args",
"public class Main {\n\tpublic static void main(String[] args)\n\t{\n\t\tScanner scan = new Scanner(System.in);\n\t\tint r = scan.nextInt();\n\t\tint c = scan.nextInt();\n\t\tint[][] array = new int[r + 1][c + 1];\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\tarray[i][j] = scan.nextInt();\n\t\t\t\tarray[r][j] += array[i][j];\n\t\t\t\tarray[i][c] += array[i][j];\n\t\t\t}\n\t\t\tarray[r][c] += array[i][c];\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(array[i][j] + \" \");\n\t\t\t}\n\t\t\tSystem.out.println(array[i][c]);\n\t\t}\n\t}\n}",
"public class Main {\n\tpublic static void main(String[] args)\n\t{\n\t\tScanner scan = new Scanner(System.in);\n\t\tint r = scan.nextInt();\n\t\tint c = scan.nextInt();\n\t\tint[][] array = new int[r + 1][c + 1];\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\tarray[i][j] = scan.nextInt();\n\t\t\t\tarray[r][j] += array[i][j];\n\t\t\t\tarray[i][c] += array[i][j];\n\t\t\t}\n\t\t\tarray[r][c] += array[i][c];\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(array[i][j] + \" \");\n\t\t\t}\n\t\t\tSystem.out.println(array[i][c]);\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 r = scan.nextInt();
int c = scan.nextInt();
int[][] array = new int[r + 1][c + 1];
for(int i = 0;i < r;i++)
{
for(int j = 0;j < c;j++)
{
array[i][j] = scan.nextInt();
array[r][j] += array[i][j];
array[i][c] += array[i][j];
}
array[r][c] += array[i][c];
}
for(int i = 0;i <= r;i++)
{
for(int j = 0;j < c;j++)
{
System.out.print(array[i][j] + " ");
}
System.out.println(array[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,
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,
4,
18,
18,
13,
13,
18,
18,
13,
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,
18,
13,
13,
13,
4,
18,
18,
13,
13,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
159,
5
],
[
159,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
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
],
[
120,
121
],
[
120,
122
],
[
119,
123
],
[
113,
124
],
[
124,
125
],
[
125,
126
],
[
126,
127
],
[
126,
128
],
[
124,
129
],
[
129,
130
],
[
129,
131
],
[
131,
132
],
[
131,
133
],
[
124,
134
],
[
134,
135
],
[
135,
136
],
[
124,
137
],
[
138,
138
],
[
138,
139
],
[
139,
140
],
[
140,
141
],
[
141,
142
],
[
141,
143
],
[
139,
144
],
[
144,
145
],
[
144,
146
],
[
146,
147
],
[
147,
148
],
[
147,
149
],
[
146,
150
],
[
113,
151
],
[
151,
152
],
[
152,
153
],
[
153,
154
],
[
153,
155
],
[
6,
156
],
[
156,
157
],
[
0,
158
],
[
158,
159
],
[
158,
160
]
] | [
"import java.util.Scanner;\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 \n int[][] array = new int[r + 1][c + 1];\n for(int i = 0; i < r; i++){\n for(int j = 0; j < c; j++){\n array[i][j] = sc.nextInt();\n array[i][c] += array[i][j];\n array[r][j] += array[i][j];\n }\n array[r][c] += array[i][c];\n }\n \n for(int i = 0; i < r + 1; i++){\n System.out.print(array[i][0]);\n for(int j = 1; j < c + 1; j++){\n System.out.print(\" \" + array[i][j]);\n }\n System.out.println();\n }\n }\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main{\n public static void main(String[] args){\n Scanner sc = new Scanner(System.in);\n int r = sc.nextInt();\n int c = sc.nextInt();\n \n int[][] array = new int[r + 1][c + 1];\n for(int i = 0; i < r; i++){\n for(int j = 0; j < c; j++){\n array[i][j] = sc.nextInt();\n array[i][c] += array[i][j];\n array[r][j] += array[i][j];\n }\n array[r][c] += array[i][c];\n }\n \n for(int i = 0; i < r + 1; i++){\n System.out.print(array[i][0]);\n for(int j = 1; j < c + 1; j++){\n System.out.print(\" \" + array[i][j]);\n }\n System.out.println();\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 \n int[][] array = new int[r + 1][c + 1];\n for(int i = 0; i < r; i++){\n for(int j = 0; j < c; j++){\n array[i][j] = sc.nextInt();\n array[i][c] += array[i][j];\n array[r][j] += array[i][j];\n }\n array[r][c] += array[i][c];\n }\n \n for(int i = 0; i < r + 1; i++){\n System.out.print(array[i][0]);\n for(int j = 1; j < c + 1; j++){\n System.out.print(\" \" + array[i][j]);\n }\n System.out.println();\n }\n }",
"main",
"{\n Scanner sc = new Scanner(System.in);\n int r = sc.nextInt();\n int c = sc.nextInt();\n \n int[][] array = new int[r + 1][c + 1];\n for(int i = 0; i < r; i++){\n for(int j = 0; j < c; j++){\n array[i][j] = sc.nextInt();\n array[i][c] += array[i][j];\n array[r][j] += array[i][j];\n }\n array[r][c] += array[i][c];\n }\n \n for(int i = 0; i < r + 1; i++){\n System.out.print(array[i][0]);\n for(int j = 1; j < c + 1; j++){\n System.out.print(\" \" + array[i][j]);\n }\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[][] 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 for(int j = 0; j < c; j++){\n array[i][j] = sc.nextInt();\n array[i][c] += array[i][j];\n array[r][j] += array[i][j];\n }\n array[r][c] += array[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 array[i][j] = sc.nextInt();\n array[i][c] += array[i][j];\n array[r][j] += array[i][j];\n }\n array[r][c] += array[i][c];\n }",
"{\n for(int j = 0; j < c; j++){\n array[i][j] = sc.nextInt();\n array[i][c] += array[i][j];\n array[r][j] += array[i][j];\n }\n array[r][c] += array[i][c];\n }",
"for(int j = 0; j < c; j++){\n array[i][j] = sc.nextInt();\n array[i][c] += array[i][j];\n array[r][j] += array[i][j];\n }",
"int j = 0;",
"int j = 0;",
"j",
"0",
"j < c",
"j",
"c",
"j++",
"j++",
"j",
"{\n array[i][j] = sc.nextInt();\n array[i][c] += array[i][j];\n array[r][j] += array[i][j];\n }",
"{\n array[i][j] = sc.nextInt();\n array[i][c] += array[i][j];\n array[r][j] += array[i][j];\n }",
"array[i][j] = sc.nextInt()",
"array[i][j]",
"array[i]",
"array",
"i",
"j",
"sc.nextInt()",
"sc.nextInt",
"sc",
"array[i][c] += array[i][j]",
"array[i][c]",
"array[i]",
"array",
"i",
"c",
"array[i][j]",
"array[i]",
"array",
"i",
"j",
"array[r][j] += array[i][j]",
"array[r][j]",
"array[r]",
"array",
"r",
"j",
"array[i][j]",
"array[i]",
"array",
"i",
"j",
"array[r][c] += array[i][c]",
"array[r][c]",
"array[r]",
"array",
"r",
"c",
"array[i][c]",
"array[i]",
"array",
"i",
"c",
"for(int i = 0; i < r + 1; i++){\n System.out.print(array[i][0]);\n for(int j = 1; j < c + 1; j++){\n System.out.print(\" \" + array[i][j]);\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 System.out.print(array[i][0]);\n for(int j = 1; j < c + 1; j++){\n System.out.print(\" \" + array[i][j]);\n }\n System.out.println();\n }",
"{\n System.out.print(array[i][0]);\n for(int j = 1; j < c + 1; j++){\n System.out.print(\" \" + array[i][j]);\n }\n System.out.println();\n }",
"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 + 1; j++){\n System.out.print(\" \" + array[i][j]);\n }",
"int j = 1;",
"int j = 1;",
"j",
"1",
"j < c + 1",
"j",
"c + 1",
"c",
"1",
"j++",
"j++",
"j",
"{\n System.out.print(\" \" + array[i][j]);\n }",
"{\n System.out.print(\" \" + array[i][j]);\n }",
"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 public static void main(String[] args){\n Scanner sc = new Scanner(System.in);\n int r = sc.nextInt();\n int c = sc.nextInt();\n \n int[][] array = new int[r + 1][c + 1];\n for(int i = 0; i < r; i++){\n for(int j = 0; j < c; j++){\n array[i][j] = sc.nextInt();\n array[i][c] += array[i][j];\n array[r][j] += array[i][j];\n }\n array[r][c] += array[i][c];\n }\n \n for(int i = 0; i < r + 1; i++){\n System.out.print(array[i][0]);\n for(int j = 1; j < c + 1; j++){\n System.out.print(\" \" + array[i][j]);\n }\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 int r = sc.nextInt();\n int c = sc.nextInt();\n \n int[][] array = new int[r + 1][c + 1];\n for(int i = 0; i < r; i++){\n for(int j = 0; j < c; j++){\n array[i][j] = sc.nextInt();\n array[i][c] += array[i][j];\n array[r][j] += array[i][j];\n }\n array[r][c] += array[i][c];\n }\n \n for(int i = 0; i < r + 1; i++){\n System.out.print(array[i][0]);\n for(int j = 1; j < c + 1; j++){\n System.out.print(\" \" + array[i][j]);\n }\n System.out.println();\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[][] array = new int[r + 1][c + 1];
for(int i = 0; i < r; i++){
for(int j = 0; j < c; j++){
array[i][j] = sc.nextInt();
array[i][c] += array[i][j];
array[r][j] += array[i][j];
}
array[r][c] += array[i][c];
}
for(int i = 0; i < r + 1; i++){
System.out.print(array[i][0]);
for(int j = 1; j < c + 1; j++){
System.out.print(" " + array[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,
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,
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,
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
],
[
176,
5
],
[
176,
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
],
[
102,
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
],
[
143,
145
],
[
138,
146
],
[
146,
147
],
[
147,
148
],
[
138,
149
],
[
150,
150
],
[
150,
151
],
[
151,
152
],
[
152,
153
],
[
153,
154
],
[
153,
155
],
[
151,
156
],
[
156,
157
],
[
157,
158
],
[
158,
159
],
[
158,
160
],
[
157,
161
],
[
156,
162
],
[
137,
163
],
[
163,
164
],
[
164,
165
],
[
165,
166
],
[
165,
167
],
[
163,
168
],
[
168,
169
],
[
169,
170
],
[
169,
171
],
[
168,
172
],
[
6,
173
],
[
173,
174
],
[
0,
175
],
[
175,
176
],
[
175,
177
]
] | [
"\n\nimport java.util.Scanner;\n\npublic class Main {\n\n\tpublic static void main(String[] args) {\n\n\t\tScanner in = new Scanner(System.in);\n\n\t\t// ?????°??¨?????°?????????\n\t\tint line = in.nextInt();\n\t\tint column = in.nextInt();\n\n\t\t// ????????????????´??????????????????¨???\n\t\tint[][] matrix = new int[line + 1][column + 1];\n\n\t\t// ?????????????????????????´?\n\t\tfor(int l = 0; l < line; l++){\n\n\t\t\tfor(int c = 0; c < column; c++){\n\n\t\t\t\tmatrix[l][c] = in.nextInt();\n\n\t\t\t\tmatrix[l][column] += matrix[l][c];\n\n\t\t\t}\n\t\t}\n\n\t\tfor(int c = 0; c < column; c++){\n\n\t\t\tfor(int l = 0; l < line; l++){\n\n\t\t\t\tmatrix[line][c] += matrix[l][c];\n\n\t\t\t\tmatrix[line][column] += matrix[l][c];\n\n\t\t\t}\n\n\t\t}\n\n\t\t// ???????????????????????????\n\t\tfor(int l = 0; l <= line; l++){\n\n\t\t\tfor(int c = 0; c < column; c++){\n\n\t\t\t\tSystem.out.print(matrix[l][c] + \" \");\n\n\t\t\t}\n\n\t\t\tSystem.out.println(matrix[l][column]);\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\n\t\tScanner in = new Scanner(System.in);\n\n\t\t// ?????°??¨?????°?????????\n\t\tint line = in.nextInt();\n\t\tint column = in.nextInt();\n\n\t\t// ????????????????´??????????????????¨???\n\t\tint[][] matrix = new int[line + 1][column + 1];\n\n\t\t// ?????????????????????????´?\n\t\tfor(int l = 0; l < line; l++){\n\n\t\t\tfor(int c = 0; c < column; c++){\n\n\t\t\t\tmatrix[l][c] = in.nextInt();\n\n\t\t\t\tmatrix[l][column] += matrix[l][c];\n\n\t\t\t}\n\t\t}\n\n\t\tfor(int c = 0; c < column; c++){\n\n\t\t\tfor(int l = 0; l < line; l++){\n\n\t\t\t\tmatrix[line][c] += matrix[l][c];\n\n\t\t\t\tmatrix[line][column] += matrix[l][c];\n\n\t\t\t}\n\n\t\t}\n\n\t\t// ???????????????????????????\n\t\tfor(int l = 0; l <= line; l++){\n\n\t\t\tfor(int c = 0; c < column; c++){\n\n\t\t\t\tSystem.out.print(matrix[l][c] + \" \");\n\n\t\t\t}\n\n\t\t\tSystem.out.println(matrix[l][column]);\n\n\t\t}\n\n\t}\n\n}",
"Main",
"public static void main(String[] args) {\n\n\t\tScanner in = new Scanner(System.in);\n\n\t\t// ?????°??¨?????°?????????\n\t\tint line = in.nextInt();\n\t\tint column = in.nextInt();\n\n\t\t// ????????????????´??????????????????¨???\n\t\tint[][] matrix = new int[line + 1][column + 1];\n\n\t\t// ?????????????????????????´?\n\t\tfor(int l = 0; l < line; l++){\n\n\t\t\tfor(int c = 0; c < column; c++){\n\n\t\t\t\tmatrix[l][c] = in.nextInt();\n\n\t\t\t\tmatrix[l][column] += matrix[l][c];\n\n\t\t\t}\n\t\t}\n\n\t\tfor(int c = 0; c < column; c++){\n\n\t\t\tfor(int l = 0; l < line; l++){\n\n\t\t\t\tmatrix[line][c] += matrix[l][c];\n\n\t\t\t\tmatrix[line][column] += matrix[l][c];\n\n\t\t\t}\n\n\t\t}\n\n\t\t// ???????????????????????????\n\t\tfor(int l = 0; l <= line; l++){\n\n\t\t\tfor(int c = 0; c < column; c++){\n\n\t\t\t\tSystem.out.print(matrix[l][c] + \" \");\n\n\t\t\t}\n\n\t\t\tSystem.out.println(matrix[l][column]);\n\n\t\t}\n\n\t}",
"main",
"{\n\n\t\tScanner in = new Scanner(System.in);\n\n\t\t// ?????°??¨?????°?????????\n\t\tint line = in.nextInt();\n\t\tint column = in.nextInt();\n\n\t\t// ????????????????´??????????????????¨???\n\t\tint[][] matrix = new int[line + 1][column + 1];\n\n\t\t// ?????????????????????????´?\n\t\tfor(int l = 0; l < line; l++){\n\n\t\t\tfor(int c = 0; c < column; c++){\n\n\t\t\t\tmatrix[l][c] = in.nextInt();\n\n\t\t\t\tmatrix[l][column] += matrix[l][c];\n\n\t\t\t}\n\t\t}\n\n\t\tfor(int c = 0; c < column; c++){\n\n\t\t\tfor(int l = 0; l < line; l++){\n\n\t\t\t\tmatrix[line][c] += matrix[l][c];\n\n\t\t\t\tmatrix[line][column] += matrix[l][c];\n\n\t\t\t}\n\n\t\t}\n\n\t\t// ???????????????????????????\n\t\tfor(int l = 0; l <= line; l++){\n\n\t\t\tfor(int c = 0; c < column; c++){\n\n\t\t\t\tSystem.out.print(matrix[l][c] + \" \");\n\n\t\t\t}\n\n\t\t\tSystem.out.println(matrix[l][column]);\n\n\t\t}\n\n\t}",
"Scanner in = new Scanner(System.in);",
"in",
"new Scanner(System.in)",
"int line = in.nextInt();",
"line",
"in.nextInt()",
"in.nextInt",
"in",
"int column = in.nextInt();",
"column",
"in.nextInt()",
"in.nextInt",
"in",
"int[][] matrix = new int[line + 1][column + 1];",
"matrix",
"new int[line + 1][column + 1]",
"line + 1",
"line",
"1",
"column + 1",
"column",
"1",
"for(int l = 0; l < line; l++){\n\n\t\t\tfor(int c = 0; c < column; c++){\n\n\t\t\t\tmatrix[l][c] = in.nextInt();\n\n\t\t\t\tmatrix[l][column] += matrix[l][c];\n\n\t\t\t}\n\t\t}",
"int l = 0;",
"int l = 0;",
"l",
"0",
"l < line",
"l",
"line",
"l++",
"l++",
"l",
"{\n\n\t\t\tfor(int c = 0; c < column; c++){\n\n\t\t\t\tmatrix[l][c] = in.nextInt();\n\n\t\t\t\tmatrix[l][column] += matrix[l][c];\n\n\t\t\t}\n\t\t}",
"{\n\n\t\t\tfor(int c = 0; c < column; c++){\n\n\t\t\t\tmatrix[l][c] = in.nextInt();\n\n\t\t\t\tmatrix[l][column] += matrix[l][c];\n\n\t\t\t}\n\t\t}",
"for(int c = 0; c < column; c++){\n\n\t\t\t\tmatrix[l][c] = in.nextInt();\n\n\t\t\t\tmatrix[l][column] += matrix[l][c];\n\n\t\t\t}",
"int c = 0;",
"int c = 0;",
"c",
"0",
"c < column",
"c",
"column",
"c++",
"c++",
"c",
"{\n\n\t\t\t\tmatrix[l][c] = in.nextInt();\n\n\t\t\t\tmatrix[l][column] += matrix[l][c];\n\n\t\t\t}",
"{\n\n\t\t\t\tmatrix[l][c] = in.nextInt();\n\n\t\t\t\tmatrix[l][column] += matrix[l][c];\n\n\t\t\t}",
"matrix[l][c] = in.nextInt()",
"matrix[l][c]",
"matrix[l]",
"matrix",
"l",
"c",
"in.nextInt()",
"in.nextInt",
"in",
"matrix[l][column] += matrix[l][c]",
"matrix[l][column]",
"matrix[l]",
"matrix",
"l",
"column",
"matrix[l][c]",
"matrix[l]",
"matrix",
"l",
"c",
"for(int c = 0; c < column; c++){\n\n\t\t\tfor(int l = 0; l < line; l++){\n\n\t\t\t\tmatrix[line][c] += matrix[l][c];\n\n\t\t\t\tmatrix[line][column] += matrix[l][c];\n\n\t\t\t}\n\n\t\t}",
"int c = 0;",
"int c = 0;",
"c",
"0",
"c < column",
"c",
"column",
"c++",
"c++",
"c",
"{\n\n\t\t\tfor(int l = 0; l < line; l++){\n\n\t\t\t\tmatrix[line][c] += matrix[l][c];\n\n\t\t\t\tmatrix[line][column] += matrix[l][c];\n\n\t\t\t}\n\n\t\t}",
"{\n\n\t\t\tfor(int l = 0; l < line; l++){\n\n\t\t\t\tmatrix[line][c] += matrix[l][c];\n\n\t\t\t\tmatrix[line][column] += matrix[l][c];\n\n\t\t\t}\n\n\t\t}",
"for(int l = 0; l < line; l++){\n\n\t\t\t\tmatrix[line][c] += matrix[l][c];\n\n\t\t\t\tmatrix[line][column] += matrix[l][c];\n\n\t\t\t}",
"int l = 0;",
"int l = 0;",
"l",
"0",
"l < line",
"l",
"line",
"l++",
"l++",
"l",
"{\n\n\t\t\t\tmatrix[line][c] += matrix[l][c];\n\n\t\t\t\tmatrix[line][column] += matrix[l][c];\n\n\t\t\t}",
"{\n\n\t\t\t\tmatrix[line][c] += matrix[l][c];\n\n\t\t\t\tmatrix[line][column] += matrix[l][c];\n\n\t\t\t}",
"matrix[line][c] += matrix[l][c]",
"matrix[line][c]",
"matrix[line]",
"matrix",
"line",
"c",
"matrix[l][c]",
"matrix[l]",
"matrix",
"l",
"c",
"matrix[line][column] += matrix[l][c]",
"matrix[line][column]",
"matrix[line]",
"matrix",
"line",
"column",
"matrix[l][c]",
"matrix[l]",
"matrix",
"l",
"c",
"for(int l = 0; l <= line; l++){\n\n\t\t\tfor(int c = 0; c < column; c++){\n\n\t\t\t\tSystem.out.print(matrix[l][c] + \" \");\n\n\t\t\t}\n\n\t\t\tSystem.out.println(matrix[l][column]);\n\n\t\t}",
"int l = 0;",
"int l = 0;",
"l",
"0",
"l <= line",
"l",
"line",
"l++",
"l++",
"l",
"{\n\n\t\t\tfor(int c = 0; c < column; c++){\n\n\t\t\t\tSystem.out.print(matrix[l][c] + \" \");\n\n\t\t\t}\n\n\t\t\tSystem.out.println(matrix[l][column]);\n\n\t\t}",
"{\n\n\t\t\tfor(int c = 0; c < column; c++){\n\n\t\t\t\tSystem.out.print(matrix[l][c] + \" \");\n\n\t\t\t}\n\n\t\t\tSystem.out.println(matrix[l][column]);\n\n\t\t}",
"for(int c = 0; c < column; c++){\n\n\t\t\t\tSystem.out.print(matrix[l][c] + \" \");\n\n\t\t\t}",
"int c = 0;",
"int c = 0;",
"c",
"0",
"c < column",
"c",
"column",
"c++",
"c++",
"c",
"{\n\n\t\t\t\tSystem.out.print(matrix[l][c] + \" \");\n\n\t\t\t}",
"{\n\n\t\t\t\tSystem.out.print(matrix[l][c] + \" \");\n\n\t\t\t}",
"System.out.print(matrix[l][c] + \" \")",
"System.out.print",
"System.out",
"System",
"System.out",
"matrix[l][c] + \" \"",
"matrix[l][c]",
"matrix[l]",
"matrix",
"l",
"c",
"\" \"",
"System.out.println(matrix[l][column])",
"System.out.println",
"System.out",
"System",
"System.out",
"matrix[l][column]",
"matrix[l]",
"matrix",
"l",
"column",
"String[] args",
"args",
"public class Main {\n\n\tpublic static void main(String[] args) {\n\n\t\tScanner in = new Scanner(System.in);\n\n\t\t// ?????°??¨?????°?????????\n\t\tint line = in.nextInt();\n\t\tint column = in.nextInt();\n\n\t\t// ????????????????´??????????????????¨???\n\t\tint[][] matrix = new int[line + 1][column + 1];\n\n\t\t// ?????????????????????????´?\n\t\tfor(int l = 0; l < line; l++){\n\n\t\t\tfor(int c = 0; c < column; c++){\n\n\t\t\t\tmatrix[l][c] = in.nextInt();\n\n\t\t\t\tmatrix[l][column] += matrix[l][c];\n\n\t\t\t}\n\t\t}\n\n\t\tfor(int c = 0; c < column; c++){\n\n\t\t\tfor(int l = 0; l < line; l++){\n\n\t\t\t\tmatrix[line][c] += matrix[l][c];\n\n\t\t\t\tmatrix[line][column] += matrix[l][c];\n\n\t\t\t}\n\n\t\t}\n\n\t\t// ???????????????????????????\n\t\tfor(int l = 0; l <= line; l++){\n\n\t\t\tfor(int c = 0; c < column; c++){\n\n\t\t\t\tSystem.out.print(matrix[l][c] + \" \");\n\n\t\t\t}\n\n\t\t\tSystem.out.println(matrix[l][column]);\n\n\t\t}\n\n\t}\n\n}",
"public class Main {\n\n\tpublic static void main(String[] args) {\n\n\t\tScanner in = new Scanner(System.in);\n\n\t\t// ?????°??¨?????°?????????\n\t\tint line = in.nextInt();\n\t\tint column = in.nextInt();\n\n\t\t// ????????????????´??????????????????¨???\n\t\tint[][] matrix = new int[line + 1][column + 1];\n\n\t\t// ?????????????????????????´?\n\t\tfor(int l = 0; l < line; l++){\n\n\t\t\tfor(int c = 0; c < column; c++){\n\n\t\t\t\tmatrix[l][c] = in.nextInt();\n\n\t\t\t\tmatrix[l][column] += matrix[l][c];\n\n\t\t\t}\n\t\t}\n\n\t\tfor(int c = 0; c < column; c++){\n\n\t\t\tfor(int l = 0; l < line; l++){\n\n\t\t\t\tmatrix[line][c] += matrix[l][c];\n\n\t\t\t\tmatrix[line][column] += matrix[l][c];\n\n\t\t\t}\n\n\t\t}\n\n\t\t// ???????????????????????????\n\t\tfor(int l = 0; l <= line; l++){\n\n\t\t\tfor(int c = 0; c < column; c++){\n\n\t\t\t\tSystem.out.print(matrix[l][c] + \" \");\n\n\t\t\t}\n\n\t\t\tSystem.out.println(matrix[l][column]);\n\n\t\t}\n\n\t}\n\n}",
"Main"
] |
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
// ?????°??¨?????°?????????
int line = in.nextInt();
int column = in.nextInt();
// ????????????????´??????????????????¨???
int[][] matrix = new int[line + 1][column + 1];
// ?????????????????????????´?
for(int l = 0; l < line; l++){
for(int c = 0; c < column; c++){
matrix[l][c] = in.nextInt();
matrix[l][column] += matrix[l][c];
}
}
for(int c = 0; c < column; c++){
for(int l = 0; l < line; l++){
matrix[line][c] += matrix[l][c];
matrix[line][column] += matrix[l][c];
}
}
// ???????????????????????????
for(int l = 0; l <= line; l++){
for(int c = 0; c < column; c++){
System.out.print(matrix[l][c] + " ");
}
System.out.println(matrix[l][column]);
}
}
} |
[
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,
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,
41,
13,
4,
18,
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,
0,
13,
18,
18,
13,
13,
13,
0,
18,
13,
13,
18,
18,
13,
13,
13,
4,
18,
18,
13,
13,
18,
18,
13,
13,
13,
4,
18,
18,
13,
13,
17,
0,
18,
13,
13,
13,
4,
18,
18,
13,
13,
13,
0,
13,
17,
11,
1,
41,
13,
17,
2,
13,
2,
13,
17,
1,
40,
13,
30,
30,
4,
18,
18,
13,
13,
18,
13,
13,
14,
2,
13,
13,
30,
4,
18,
18,
13,
13,
17,
4,
18,
18,
13,
13,
17,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
189,
5
],
[
189,
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,
30
],
[
30,
31
],
[
30,
32
],
[
33,
34
],
[
33,
35
],
[
8,
36
],
[
36,
37
],
[
37,
38
],
[
38,
39
],
[
38,
40
],
[
36,
41
],
[
41,
42
],
[
41,
43
],
[
36,
44
],
[
44,
45
],
[
45,
46
],
[
36,
47
],
[
48,
48
],
[
48,
49
],
[
49,
50
],
[
50,
51
],
[
51,
52
],
[
51,
53
],
[
49,
54
],
[
54,
55
],
[
54,
56
],
[
49,
57
],
[
57,
58
],
[
58,
59
],
[
49,
60
],
[
61,
61
],
[
61,
62
],
[
62,
63
],
[
62,
64
],
[
64,
65
],
[
65,
66
],
[
61,
67
],
[
67,
68
],
[
68,
69
],
[
69,
70
],
[
69,
71
],
[
68,
72
],
[
67,
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
],
[
100,
102
],
[
102,
103
],
[
103,
104
],
[
103,
105
],
[
102,
106
],
[
99,
107
],
[
107,
108
],
[
108,
109
],
[
108,
110
],
[
107,
111
],
[
111,
112
],
[
112,
113
],
[
112,
114
],
[
111,
115
],
[
99,
116
],
[
116,
117
],
[
117,
118
],
[
118,
119
],
[
118,
120
],
[
116,
121
],
[
121,
122
],
[
122,
123
],
[
122,
124
],
[
121,
125
],
[
99,
126
],
[
126,
127
],
[
127,
128
],
[
128,
129
],
[
128,
130
],
[
126,
131
],
[
86,
132
],
[
132,
133
],
[
133,
134
],
[
133,
135
],
[
132,
136
],
[
86,
137
],
[
137,
138
],
[
138,
139
],
[
139,
140
],
[
139,
141
],
[
137,
142
],
[
86,
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
],
[
160,
169
],
[
169,
170
],
[
170,
171
],
[
170,
172
],
[
169,
173
],
[
173,
174
],
[
174,
175
],
[
175,
176
],
[
176,
177
],
[
176,
178
],
[
174,
179
],
[
8,
180
],
[
180,
181
],
[
181,
182
],
[
182,
183
],
[
182,
184
],
[
180,
185
],
[
6,
186
],
[
186,
187
],
[
0,
188
],
[
188,
189
],
[
188,
190
]
] | [
"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 rc[][] = new int[r][c];\n int c_total = 0;\n int r_total[] = new int[c + 1];\n\n for (int i = 0; i < r; i++) {\n for (int j = 0; j < c; j++) {\n int num = sc.nextInt();\n rc[i][j] = num;\n }\n }\n for (int i = 0; i < r; i++) {\n for (int j = 0; j < c; j++) {\n c_total += rc[i][j];\n r_total[j] += rc[i][j];\n System.out.print(rc[i][j]);\n System.out.print(\" \");\n }\n r_total[c] += c_total; \n System.out.println(c_total);\n c_total = 0;\n }\n for(int i = 0; i < c + 1; i++){\n System.out.print(r_total[i]);\n if(i != c){\n System.out.print(\" \");\n }\n }\n System.out.println(\"\");\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 rc[][] = new int[r][c];\n int c_total = 0;\n int r_total[] = new int[c + 1];\n\n for (int i = 0; i < r; i++) {\n for (int j = 0; j < c; j++) {\n int num = sc.nextInt();\n rc[i][j] = num;\n }\n }\n for (int i = 0; i < r; i++) {\n for (int j = 0; j < c; j++) {\n c_total += rc[i][j];\n r_total[j] += rc[i][j];\n System.out.print(rc[i][j]);\n System.out.print(\" \");\n }\n r_total[c] += c_total; \n System.out.println(c_total);\n c_total = 0;\n }\n for(int i = 0; i < c + 1; i++){\n System.out.print(r_total[i]);\n if(i != c){\n System.out.print(\" \");\n }\n }\n System.out.println(\"\");\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 rc[][] = new int[r][c];\n int c_total = 0;\n int r_total[] = new int[c + 1];\n\n for (int i = 0; i < r; i++) {\n for (int j = 0; j < c; j++) {\n int num = sc.nextInt();\n rc[i][j] = num;\n }\n }\n for (int i = 0; i < r; i++) {\n for (int j = 0; j < c; j++) {\n c_total += rc[i][j];\n r_total[j] += rc[i][j];\n System.out.print(rc[i][j]);\n System.out.print(\" \");\n }\n r_total[c] += c_total; \n System.out.println(c_total);\n c_total = 0;\n }\n for(int i = 0; i < c + 1; i++){\n System.out.print(r_total[i]);\n if(i != c){\n System.out.print(\" \");\n }\n }\n System.out.println(\"\");\n }",
"main",
"{\n Scanner sc = new Scanner(System.in);\n int r = sc.nextInt();\n int c = sc.nextInt();\n int rc[][] = new int[r][c];\n int c_total = 0;\n int r_total[] = new int[c + 1];\n\n for (int i = 0; i < r; i++) {\n for (int j = 0; j < c; j++) {\n int num = sc.nextInt();\n rc[i][j] = num;\n }\n }\n for (int i = 0; i < r; i++) {\n for (int j = 0; j < c; j++) {\n c_total += rc[i][j];\n r_total[j] += rc[i][j];\n System.out.print(rc[i][j]);\n System.out.print(\" \");\n }\n r_total[c] += c_total; \n System.out.println(c_total);\n c_total = 0;\n }\n for(int i = 0; i < c + 1; i++){\n System.out.print(r_total[i]);\n if(i != c){\n System.out.print(\" \");\n }\n }\n System.out.println(\"\");\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 rc[][] = new int[r][c];",
"rc",
"new int[r][c]",
"r",
"c",
"int c_total = 0;",
"c_total",
"0",
"int r_total[] = new int[c + 1];",
"r_total",
"new int[c + 1]",
"c + 1",
"c",
"1",
"for (int i = 0; i < r; i++) {\n for (int j = 0; j < c; j++) {\n int num = sc.nextInt();\n rc[i][j] = 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 int num = sc.nextInt();\n rc[i][j] = num;\n }\n }",
"{\n for (int j = 0; j < c; j++) {\n int num = sc.nextInt();\n rc[i][j] = num;\n }\n }",
"for (int j = 0; j < c; j++) {\n int num = sc.nextInt();\n rc[i][j] = num;\n }",
"int j = 0;",
"int j = 0;",
"j",
"0",
"j < c",
"j",
"c",
"j++",
"j++",
"j",
"{\n int num = sc.nextInt();\n rc[i][j] = num;\n }",
"{\n int num = sc.nextInt();\n rc[i][j] = num;\n }",
"int num = sc.nextInt();",
"num",
"sc.nextInt()",
"sc.nextInt",
"sc",
"rc[i][j] = num",
"rc[i][j]",
"rc[i]",
"rc",
"i",
"j",
"num",
"for (int i = 0; i < r; i++) {\n for (int j = 0; j < c; j++) {\n c_total += rc[i][j];\n r_total[j] += rc[i][j];\n System.out.print(rc[i][j]);\n System.out.print(\" \");\n }\n r_total[c] += c_total; \n System.out.println(c_total);\n c_total = 0;\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 c_total += rc[i][j];\n r_total[j] += rc[i][j];\n System.out.print(rc[i][j]);\n System.out.print(\" \");\n }\n r_total[c] += c_total; \n System.out.println(c_total);\n c_total = 0;\n }",
"{\n for (int j = 0; j < c; j++) {\n c_total += rc[i][j];\n r_total[j] += rc[i][j];\n System.out.print(rc[i][j]);\n System.out.print(\" \");\n }\n r_total[c] += c_total; \n System.out.println(c_total);\n c_total = 0;\n }",
"for (int j = 0; j < c; j++) {\n c_total += rc[i][j];\n r_total[j] += rc[i][j];\n System.out.print(rc[i][j]);\n System.out.print(\" \");\n }",
"int j = 0;",
"int j = 0;",
"j",
"0",
"j < c",
"j",
"c",
"j++",
"j++",
"j",
"{\n c_total += rc[i][j];\n r_total[j] += rc[i][j];\n System.out.print(rc[i][j]);\n System.out.print(\" \");\n }",
"{\n c_total += rc[i][j];\n r_total[j] += rc[i][j];\n System.out.print(rc[i][j]);\n System.out.print(\" \");\n }",
"c_total += rc[i][j]",
"c_total",
"rc[i][j]",
"rc[i]",
"rc",
"i",
"j",
"r_total[j] += rc[i][j]",
"r_total[j]",
"r_total",
"j",
"rc[i][j]",
"rc[i]",
"rc",
"i",
"j",
"System.out.print(rc[i][j])",
"System.out.print",
"System.out",
"System",
"System.out",
"rc[i][j]",
"rc[i]",
"rc",
"i",
"j",
"System.out.print(\" \")",
"System.out.print",
"System.out",
"System",
"System.out",
"\" \"",
"r_total[c] += c_total",
"r_total[c]",
"r_total",
"c",
"c_total",
"System.out.println(c_total)",
"System.out.println",
"System.out",
"System",
"System.out",
"c_total",
"c_total = 0",
"c_total",
"0",
"for(int i = 0; i < c + 1; i++){\n System.out.print(r_total[i]);\n if(i != c){\n System.out.print(\" \");\n }\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < c + 1",
"i",
"c + 1",
"c",
"1",
"i++",
"i++",
"i",
"{\n System.out.print(r_total[i]);\n if(i != c){\n System.out.print(\" \");\n }\n }",
"{\n System.out.print(r_total[i]);\n if(i != c){\n System.out.print(\" \");\n }\n }",
"System.out.print(r_total[i])",
"System.out.print",
"System.out",
"System",
"System.out",
"r_total[i]",
"r_total",
"i",
"if(i != c){\n System.out.print(\" \");\n }",
"i != c",
"i",
"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 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 rc[][] = new int[r][c];\n int c_total = 0;\n int r_total[] = new int[c + 1];\n\n for (int i = 0; i < r; i++) {\n for (int j = 0; j < c; j++) {\n int num = sc.nextInt();\n rc[i][j] = num;\n }\n }\n for (int i = 0; i < r; i++) {\n for (int j = 0; j < c; j++) {\n c_total += rc[i][j];\n r_total[j] += rc[i][j];\n System.out.print(rc[i][j]);\n System.out.print(\" \");\n }\n r_total[c] += c_total; \n System.out.println(c_total);\n c_total = 0;\n }\n for(int i = 0; i < c + 1; i++){\n System.out.print(r_total[i]);\n if(i != c){\n System.out.print(\" \");\n }\n }\n System.out.println(\"\");\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 rc[][] = new int[r][c];\n int c_total = 0;\n int r_total[] = new int[c + 1];\n\n for (int i = 0; i < r; i++) {\n for (int j = 0; j < c; j++) {\n int num = sc.nextInt();\n rc[i][j] = num;\n }\n }\n for (int i = 0; i < r; i++) {\n for (int j = 0; j < c; j++) {\n c_total += rc[i][j];\n r_total[j] += rc[i][j];\n System.out.print(rc[i][j]);\n System.out.print(\" \");\n }\n r_total[c] += c_total; \n System.out.println(c_total);\n c_total = 0;\n }\n for(int i = 0; i < c + 1; i++){\n System.out.print(r_total[i]);\n if(i != c){\n System.out.print(\" \");\n }\n }\n System.out.println(\"\");\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 rc[][] = new int[r][c];
int c_total = 0;
int r_total[] = new int[c + 1];
for (int i = 0; i < r; i++) {
for (int j = 0; j < c; j++) {
int num = sc.nextInt();
rc[i][j] = num;
}
}
for (int i = 0; i < r; i++) {
for (int j = 0; j < c; j++) {
c_total += rc[i][j];
r_total[j] += rc[i][j];
System.out.print(rc[i][j]);
System.out.print(" ");
}
r_total[c] += c_total;
System.out.println(c_total);
c_total = 0;
}
for(int i = 0; i < c + 1; i++){
System.out.print(r_total[i]);
if(i != 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,
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,
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,
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
],
[
205,
5
],
[
205,
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
],
[
61,
67
],
[
60,
68
],
[
68,
69
],
[
69,
70
],
[
70,
71
],
[
70,
72
],
[
69,
73
],
[
68,
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
],
[
100,
110
],
[
110,
111
],
[
111,
112
],
[
112,
113
],
[
112,
114
],
[
111,
115
],
[
110,
116
],
[
116,
117
],
[
117,
118
],
[
117,
119
],
[
116,
120
],
[
100,
121
],
[
121,
122
],
[
122,
123
],
[
123,
124
],
[
123,
125
],
[
122,
126
],
[
121,
127
],
[
127,
128
],
[
128,
129
],
[
128,
130
],
[
127,
131
],
[
100,
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
],
[
150,
151
],
[
150,
152
],
[
143,
153
],
[
153,
154
],
[
154,
155
],
[
143,
156
],
[
157,
157
],
[
157,
158
],
[
158,
159
],
[
159,
160
],
[
160,
161
],
[
160,
162
],
[
158,
163
],
[
163,
164
],
[
163,
165
],
[
165,
166
],
[
165,
167
],
[
158,
168
],
[
168,
169
],
[
169,
170
],
[
158,
171
],
[
172,
172
],
[
172,
173
],
[
173,
174
],
[
174,
175
],
[
175,
176
],
[
175,
177
],
[
173,
178
],
[
178,
179
],
[
179,
180
],
[
179,
181
],
[
178,
182
],
[
172,
183
],
[
183,
184
],
[
184,
185
],
[
184,
186
],
[
183,
187
],
[
187,
188
],
[
188,
189
],
[
189,
190
],
[
189,
191
],
[
187,
192
],
[
157,
193
],
[
193,
194
],
[
194,
195
],
[
195,
196
],
[
195,
197
],
[
193,
198
],
[
8,
199
],
[
199,
200
],
[
200,
201
],
[
6,
202
],
[
202,
203
],
[
0,
204
],
[
204,
205
],
[
204,
206
]
] | [
"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 + 1; cnt_r++){\n\t\t\tfor (int cnt_c = 0; cnt_c < c + 1 ; cnt_c++) {\n\t\t\t\tnumlist[cnt_r][c] += 0;//????????¨???????¨?????¨????\n\t\t\t\tnumlist[r][cnt_c] += 0;//????????¨???????¨?????¨????\n\t\t\t}\n\t\t}\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 + 1; cnt_r++){\n\t\t\tfor (int cnt_c = 0; cnt_c < c + 1 ; cnt_c++) {\n\t\t\t\tnumlist[cnt_r][c] += 0;//????????¨???????¨?????¨????\n\t\t\t\tnumlist[r][cnt_c] += 0;//????????¨???????¨?????¨????\n\t\t\t}\n\t\t}\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 + 1; cnt_r++){\n\t\t\tfor (int cnt_c = 0; cnt_c < c + 1 ; cnt_c++) {\n\t\t\t\tnumlist[cnt_r][c] += 0;//????????¨???????¨?????¨????\n\t\t\t\tnumlist[r][cnt_c] += 0;//????????¨???????¨?????¨????\n\t\t\t}\n\t\t}\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 + 1; cnt_r++){\n\t\t\tfor (int cnt_c = 0; cnt_c < c + 1 ; cnt_c++) {\n\t\t\t\tnumlist[cnt_r][c] += 0;//????????¨???????¨?????¨????\n\t\t\t\tnumlist[r][cnt_c] += 0;//????????¨???????¨?????¨????\n\t\t\t}\n\t\t}\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 + 1; cnt_r++){\n\t\t\tfor (int cnt_c = 0; cnt_c < c + 1 ; cnt_c++) {\n\t\t\t\tnumlist[cnt_r][c] += 0;//????????¨???????¨?????¨????\n\t\t\t\tnumlist[r][cnt_c] += 0;//????????¨???????¨?????¨????\n\t\t\t}\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\tnumlist[cnt_r][c] += 0;//????????¨???????¨?????¨????\n\t\t\t\tnumlist[r][cnt_c] += 0;//????????¨???????¨?????¨????\n\t\t\t}\n\t\t}",
"{\n\t\t\tfor (int cnt_c = 0; cnt_c < c + 1 ; cnt_c++) {\n\t\t\t\tnumlist[cnt_r][c] += 0;//????????¨???????¨?????¨????\n\t\t\t\tnumlist[r][cnt_c] += 0;//????????¨???????¨?????¨????\n\t\t\t}\n\t\t}",
"for (int cnt_c = 0; cnt_c < c + 1 ; cnt_c++) {\n\t\t\t\tnumlist[cnt_r][c] += 0;//????????¨???????¨?????¨????\n\t\t\t\tnumlist[r][cnt_c] += 0;//????????¨???????¨?????¨????\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\tnumlist[cnt_r][c] += 0;//????????¨???????¨?????¨????\n\t\t\t\tnumlist[r][cnt_c] += 0;//????????¨???????¨?????¨????\n\t\t\t}",
"{\n\t\t\t\tnumlist[cnt_r][c] += 0;//????????¨???????¨?????¨????\n\t\t\t\tnumlist[r][cnt_c] += 0;//????????¨???????¨?????¨????\n\t\t\t}",
"numlist[cnt_r][c] += 0",
"numlist[cnt_r][c]",
"numlist[cnt_r]",
"numlist",
"cnt_r",
"c",
"0",
"numlist[r][cnt_c] += 0",
"numlist[r][cnt_c]",
"numlist[r]",
"numlist",
"r",
"cnt_c",
"0",
"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 + 1; cnt_r++){\n\t\t\tfor (int cnt_c = 0; cnt_c < c + 1 ; cnt_c++) {\n\t\t\t\tnumlist[cnt_r][c] += 0;//????????¨???????¨?????¨????\n\t\t\t\tnumlist[r][cnt_c] += 0;//????????¨???????¨?????¨????\n\t\t\t}\n\t\t}\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 + 1; cnt_r++){\n\t\t\tfor (int cnt_c = 0; cnt_c < c + 1 ; cnt_c++) {\n\t\t\t\tnumlist[cnt_r][c] += 0;//????????¨???????¨?????¨????\n\t\t\t\tnumlist[r][cnt_c] += 0;//????????¨???????¨?????¨????\n\t\t\t}\n\t\t}\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 + 1; cnt_r++){
for (int cnt_c = 0; cnt_c < c + 1 ; cnt_c++) {
numlist[cnt_r][c] += 0;//????????¨???????¨?????¨????
numlist[r][cnt_c] += 0;//????????¨???????¨?????¨????
}
}
//???????????????????????????????????????????´???¨????¨???¨?????????????¨?????????????
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,
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,
17,
41,
13,
17,
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,
18,
18,
13,
13,
13,
4,
18,
13,
4,
18,
18,
13,
13,
2,
18,
18,
13,
13,
13,
17,
0,
13,
18,
18,
13,
13,
13,
0,
13,
13,
4,
18,
18,
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,
30,
0,
13,
18,
18,
13,
13,
13,
4,
18,
18,
13,
13,
2,
13,
17,
4,
18,
18,
13,
13,
13,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
149,
2
],
[
149,
3
],
[
3,
4
],
[
3,
5
],
[
5,
6
],
[
6,
7
],
[
6,
8
],
[
5,
9
],
[
9,
10
],
[
9,
11
],
[
11,
12
],
[
12,
13
],
[
5,
14
],
[
14,
15
],
[
14,
16
],
[
16,
17
],
[
17,
18
],
[
5,
19
],
[
19,
20
],
[
19,
21
],
[
5,
24
],
[
24,
25
],
[
24,
26
],
[
5,
27
],
[
27,
28
],
[
27,
29
],
[
5,
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
],
[
60,
61
],
[
61,
62
],
[
61,
63
],
[
60,
64
],
[
59,
65
],
[
65,
66
],
[
66,
67
],
[
58,
68
],
[
68,
69
],
[
69,
70
],
[
70,
71
],
[
70,
72
],
[
68,
73
],
[
73,
74
],
[
74,
75
],
[
75,
76
],
[
75,
77
],
[
74,
78
],
[
73,
79
],
[
58,
80
],
[
80,
81
],
[
80,
82
],
[
82,
83
],
[
83,
84
],
[
83,
85
],
[
82,
86
],
[
42,
87
],
[
87,
88
],
[
87,
89
],
[
42,
90
],
[
90,
91
],
[
91,
92
],
[
92,
93
],
[
92,
94
],
[
90,
95
],
[
5,
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
],
[
109,
111
],
[
108,
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
],
[
125,
127
],
[
127,
128
],
[
128,
129
],
[
128,
130
],
[
127,
131
],
[
108,
132
],
[
132,
133
],
[
133,
134
],
[
134,
135
],
[
134,
136
],
[
132,
137
],
[
137,
138
],
[
137,
139
],
[
5,
140
],
[
140,
141
],
[
141,
142
],
[
142,
143
],
[
142,
144
],
[
140,
145
],
[
3,
146
],
[
146,
147
],
[
0,
148
],
[
148,
149
],
[
148,
150
]
] | [
"public class Main {\n\tpublic static void main(String[] args){\n\t\tjava.util.Scanner scan = new java.util.Scanner(System.in);\n\t\tint r = scan.nextInt();\n\t\tint c = scan.nextInt();\n\n\t\tint[][] arr = new int[r][c];\n\t\tint sum = 0;\n\t\tint kai = 0;\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\tarr[i][j] = scan.nextInt();\n\t\t\t\tSystem.out.print(arr[i][j] + \" \");\n\t\t\t\tsum += arr[i][j];\n\t\t\t}\n\t\t\tkai += sum;\n\t\t\tSystem.out.println(sum);\n\t\t}\n\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 += arr[j][i];\n\t\t\t}\n\t\t\tSystem.out.print(sum + \" \");\n\t\t}\n\t\tSystem.out.println(kai);\n\t}\n}",
"public class Main {\n\tpublic static void main(String[] args){\n\t\tjava.util.Scanner scan = new java.util.Scanner(System.in);\n\t\tint r = scan.nextInt();\n\t\tint c = scan.nextInt();\n\n\t\tint[][] arr = new int[r][c];\n\t\tint sum = 0;\n\t\tint kai = 0;\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\tarr[i][j] = scan.nextInt();\n\t\t\t\tSystem.out.print(arr[i][j] + \" \");\n\t\t\t\tsum += arr[i][j];\n\t\t\t}\n\t\t\tkai += sum;\n\t\t\tSystem.out.println(sum);\n\t\t}\n\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 += arr[j][i];\n\t\t\t}\n\t\t\tSystem.out.print(sum + \" \");\n\t\t}\n\t\tSystem.out.println(kai);\n\t}\n}",
"Main",
"public static void main(String[] args){\n\t\tjava.util.Scanner scan = new java.util.Scanner(System.in);\n\t\tint r = scan.nextInt();\n\t\tint c = scan.nextInt();\n\n\t\tint[][] arr = new int[r][c];\n\t\tint sum = 0;\n\t\tint kai = 0;\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\tarr[i][j] = scan.nextInt();\n\t\t\t\tSystem.out.print(arr[i][j] + \" \");\n\t\t\t\tsum += arr[i][j];\n\t\t\t}\n\t\t\tkai += sum;\n\t\t\tSystem.out.println(sum);\n\t\t}\n\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 += arr[j][i];\n\t\t\t}\n\t\t\tSystem.out.print(sum + \" \");\n\t\t}\n\t\tSystem.out.println(kai);\n\t}",
"main",
"{\n\t\tjava.util.Scanner scan = new java.util.Scanner(System.in);\n\t\tint r = scan.nextInt();\n\t\tint c = scan.nextInt();\n\n\t\tint[][] arr = new int[r][c];\n\t\tint sum = 0;\n\t\tint kai = 0;\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\tarr[i][j] = scan.nextInt();\n\t\t\t\tSystem.out.print(arr[i][j] + \" \");\n\t\t\t\tsum += arr[i][j];\n\t\t\t}\n\t\t\tkai += sum;\n\t\t\tSystem.out.println(sum);\n\t\t}\n\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 += arr[j][i];\n\t\t\t}\n\t\t\tSystem.out.print(sum + \" \");\n\t\t}\n\t\tSystem.out.println(kai);\n\t}",
"java.util.Scanner scan = new java.util.Scanner(System.in);",
"scan",
"new java.util.Scanner(System.in)",
"int r = scan.nextInt();",
"r",
"scan.nextInt()",
"scan.nextInt",
"scan",
"int c = scan.nextInt();",
"c",
"scan.nextInt()",
"scan.nextInt",
"scan",
"int[][] arr = new int[r][c];",
"arr",
"new int[r][c]",
"r",
"c",
"int sum = 0;",
"sum",
"0",
"int kai = 0;",
"kai",
"0",
"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\tarr[i][j] = scan.nextInt();\n\t\t\t\tSystem.out.print(arr[i][j] + \" \");\n\t\t\t\tsum += arr[i][j];\n\t\t\t}\n\t\t\tkai += 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\tsum = 0;\n\t\t\tfor(int j = 0; j < c; j++){\n\t\t\t\tarr[i][j] = scan.nextInt();\n\t\t\t\tSystem.out.print(arr[i][j] + \" \");\n\t\t\t\tsum += arr[i][j];\n\t\t\t}\n\t\t\tkai += sum;\n\t\t\tSystem.out.println(sum);\n\t\t}",
"{\n\t\t\tsum = 0;\n\t\t\tfor(int j = 0; j < c; j++){\n\t\t\t\tarr[i][j] = scan.nextInt();\n\t\t\t\tSystem.out.print(arr[i][j] + \" \");\n\t\t\t\tsum += arr[i][j];\n\t\t\t}\n\t\t\tkai += sum;\n\t\t\tSystem.out.println(sum);\n\t\t}",
"sum = 0",
"sum",
"0",
"for(int j = 0; j < c; j++){\n\t\t\t\tarr[i][j] = scan.nextInt();\n\t\t\t\tSystem.out.print(arr[i][j] + \" \");\n\t\t\t\tsum += 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] = scan.nextInt();\n\t\t\t\tSystem.out.print(arr[i][j] + \" \");\n\t\t\t\tsum += arr[i][j];\n\t\t\t}",
"{\n\t\t\t\tarr[i][j] = scan.nextInt();\n\t\t\t\tSystem.out.print(arr[i][j] + \" \");\n\t\t\t\tsum += arr[i][j];\n\t\t\t}",
"arr[i][j] = scan.nextInt()",
"arr[i][j]",
"arr[i]",
"arr",
"i",
"j",
"scan.nextInt()",
"scan.nextInt",
"scan",
"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",
"\" \"",
"sum += arr[i][j]",
"sum",
"arr[i][j]",
"arr[i]",
"arr",
"i",
"j",
"kai += sum",
"kai",
"sum",
"System.out.println(sum)",
"System.out.println",
"System.out",
"System",
"System.out",
"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 += arr[j][i];\n\t\t\t}\n\t\t\tSystem.out.print(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 += arr[j][i];\n\t\t\t}\n\t\t\tSystem.out.print(sum + \" \");\n\t\t}",
"{\n\t\t\tsum = 0;\n\t\t\tfor(int j = 0; j < r; j++){\n\t\t\t\tsum += arr[j][i];\n\t\t\t}\n\t\t\tSystem.out.print(sum + \" \");\n\t\t}",
"sum = 0",
"sum",
"0",
"for(int j = 0; j < r; j++){\n\t\t\t\tsum += arr[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 += arr[j][i];\n\t\t\t}",
"{\n\t\t\t\tsum += arr[j][i];\n\t\t\t}",
"sum += arr[j][i]",
"sum",
"arr[j][i]",
"arr[j]",
"arr",
"j",
"i",
"System.out.print(sum + \" \")",
"System.out.print",
"System.out",
"System",
"System.out",
"sum + \" \"",
"sum",
"\" \"",
"System.out.println(kai)",
"System.out.println",
"System.out",
"System",
"System.out",
"kai",
"String[] args",
"args",
"public class Main {\n\tpublic static void main(String[] args){\n\t\tjava.util.Scanner scan = new java.util.Scanner(System.in);\n\t\tint r = scan.nextInt();\n\t\tint c = scan.nextInt();\n\n\t\tint[][] arr = new int[r][c];\n\t\tint sum = 0;\n\t\tint kai = 0;\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\tarr[i][j] = scan.nextInt();\n\t\t\t\tSystem.out.print(arr[i][j] + \" \");\n\t\t\t\tsum += arr[i][j];\n\t\t\t}\n\t\t\tkai += sum;\n\t\t\tSystem.out.println(sum);\n\t\t}\n\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 += arr[j][i];\n\t\t\t}\n\t\t\tSystem.out.print(sum + \" \");\n\t\t}\n\t\tSystem.out.println(kai);\n\t}\n}",
"public class Main {\n\tpublic static void main(String[] args){\n\t\tjava.util.Scanner scan = new java.util.Scanner(System.in);\n\t\tint r = scan.nextInt();\n\t\tint c = scan.nextInt();\n\n\t\tint[][] arr = new int[r][c];\n\t\tint sum = 0;\n\t\tint kai = 0;\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\tarr[i][j] = scan.nextInt();\n\t\t\t\tSystem.out.print(arr[i][j] + \" \");\n\t\t\t\tsum += arr[i][j];\n\t\t\t}\n\t\t\tkai += sum;\n\t\t\tSystem.out.println(sum);\n\t\t}\n\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 += arr[j][i];\n\t\t\t}\n\t\t\tSystem.out.print(sum + \" \");\n\t\t}\n\t\tSystem.out.println(kai);\n\t}\n}",
"Main"
] | public class Main {
public static void main(String[] args){
java.util.Scanner scan = new java.util.Scanner(System.in);
int r = scan.nextInt();
int c = scan.nextInt();
int[][] arr = new int[r][c];
int sum = 0;
int kai = 0;
for(int i = 0; i < r; i++){
sum = 0;
for(int j = 0; j < c; j++){
arr[i][j] = scan.nextInt();
System.out.print(arr[i][j] + " ");
sum += arr[i][j];
}
kai += sum;
System.out.println(sum);
}
for(int i = 0; i < c; i++){
sum = 0;
for(int j = 0; j < r; j++){
sum += arr[j][i];
}
System.out.print(sum + " ");
}
System.out.println(kai);
}
} |
[
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,
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,
4,
18,
13,
18,
13,
13,
0,
18,
18,
13,
13,
13,
4,
18,
13,
18,
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,
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,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
187,
11
],
[
187,
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
],
[
103,
106
],
[
106,
107
],
[
106,
108
],
[
84,
109
],
[
109,
110
],
[
110,
111
],
[
111,
112
],
[
111,
113
],
[
110,
114
],
[
109,
115
],
[
115,
116
],
[
116,
117
],
[
115,
118
],
[
118,
119
],
[
118,
120
],
[
63,
121
],
[
121,
122
],
[
122,
123
],
[
123,
124
],
[
123,
125
],
[
122,
126
],
[
121,
127
],
[
127,
128
],
[
128,
129
],
[
128,
130
],
[
127,
131
],
[
14,
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
],
[
159,
161
],
[
158,
162
],
[
162,
163
],
[
163,
164
],
[
164,
165
],
[
164,
166
],
[
162,
167
],
[
167,
168
],
[
168,
169
],
[
168,
170
],
[
167,
171
],
[
158,
172
],
[
172,
173
],
[
173,
174
],
[
174,
175
],
[
174,
176
],
[
172,
177
],
[
177,
178
],
[
178,
179
],
[
179,
180
],
[
179,
181
],
[
178,
182
],
[
177,
183
],
[
12,
184
],
[
184,
185
],
[
0,
186
],
[
186,
187
],
[
186,
188
]
] | [
"import java.io.InputStreamReader;\nimport java.io.BufferedReader;\nimport java.io.IOException;\n\npublic class Main {\n\tpublic static void main(String[] args) throws IOException {\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\t\tString[] strAry = br.readLine().split(\" \");\n\t\tint r = Integer.parseInt(strAry[0]);\n\t\tint c = Integer.parseInt(strAry[1]);\n\t\tint[][] table = new int[r + 1][c + 1];\n\t\tfor (int i = 0; i < r; i++) {\n\t\t\tString[] tableAry = br.readLine().split(\" \");\n\t\t\tfor (int j = 0; j < c; j++) {\n\t\t\t\ttable[i][j] = Integer.parseInt(tableAry[j]);\n\t\t\t\ttable[i][c] += Integer.parseInt(tableAry[j]);\n\t\t\t\ttable[r][j] += Integer.parseInt(tableAry[j]);\n\t\t\t}\n\t\t\ttable[r][c] += table[i][c];\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 == c) 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}\n}",
"import java.io.InputStreamReader;",
"InputStreamReader",
"java.io",
"import java.io.BufferedReader;",
"BufferedReader",
"java.io",
"import java.io.IOException;",
"IOException",
"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\t\tString[] strAry = br.readLine().split(\" \");\n\t\tint r = Integer.parseInt(strAry[0]);\n\t\tint c = Integer.parseInt(strAry[1]);\n\t\tint[][] table = new int[r + 1][c + 1];\n\t\tfor (int i = 0; i < r; i++) {\n\t\t\tString[] tableAry = br.readLine().split(\" \");\n\t\t\tfor (int j = 0; j < c; j++) {\n\t\t\t\ttable[i][j] = Integer.parseInt(tableAry[j]);\n\t\t\t\ttable[i][c] += Integer.parseInt(tableAry[j]);\n\t\t\t\ttable[r][j] += Integer.parseInt(tableAry[j]);\n\t\t\t}\n\t\t\ttable[r][c] += table[i][c];\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 == c) 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}\n}",
"Main",
"public static void main(String[] args) throws IOException {\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\t\tString[] strAry = br.readLine().split(\" \");\n\t\tint r = Integer.parseInt(strAry[0]);\n\t\tint c = Integer.parseInt(strAry[1]);\n\t\tint[][] table = new int[r + 1][c + 1];\n\t\tfor (int i = 0; i < r; i++) {\n\t\t\tString[] tableAry = br.readLine().split(\" \");\n\t\t\tfor (int j = 0; j < c; j++) {\n\t\t\t\ttable[i][j] = Integer.parseInt(tableAry[j]);\n\t\t\t\ttable[i][c] += Integer.parseInt(tableAry[j]);\n\t\t\t\ttable[r][j] += Integer.parseInt(tableAry[j]);\n\t\t\t}\n\t\t\ttable[r][c] += table[i][c];\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 == c) 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}",
"main",
"{\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\t\tString[] strAry = br.readLine().split(\" \");\n\t\tint r = Integer.parseInt(strAry[0]);\n\t\tint c = Integer.parseInt(strAry[1]);\n\t\tint[][] table = new int[r + 1][c + 1];\n\t\tfor (int i = 0; i < r; i++) {\n\t\t\tString[] tableAry = br.readLine().split(\" \");\n\t\t\tfor (int j = 0; j < c; j++) {\n\t\t\t\ttable[i][j] = Integer.parseInt(tableAry[j]);\n\t\t\t\ttable[i][c] += Integer.parseInt(tableAry[j]);\n\t\t\t\ttable[r][j] += Integer.parseInt(tableAry[j]);\n\t\t\t}\n\t\t\ttable[r][c] += table[i][c];\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 == c) 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}",
"BufferedReader br = new BufferedReader(new InputStreamReader(System.in));",
"br",
"new BufferedReader(new InputStreamReader(System.in))",
"String[] strAry = br.readLine().split(\" \");",
"strAry",
"br.readLine().split(\" \")",
"br.readLine().split",
"br.readLine()",
"br.readLine",
"br",
"\" \"",
"int r = Integer.parseInt(strAry[0]);",
"r",
"Integer.parseInt(strAry[0])",
"Integer.parseInt",
"Integer",
"strAry[0]",
"strAry",
"0",
"int c = Integer.parseInt(strAry[1]);",
"c",
"Integer.parseInt(strAry[1])",
"Integer.parseInt",
"Integer",
"strAry[1]",
"strAry",
"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\tString[] tableAry = br.readLine().split(\" \");\n\t\t\tfor (int j = 0; j < c; j++) {\n\t\t\t\ttable[i][j] = Integer.parseInt(tableAry[j]);\n\t\t\t\ttable[i][c] += Integer.parseInt(tableAry[j]);\n\t\t\t\ttable[r][j] += Integer.parseInt(tableAry[j]);\n\t\t\t}\n\t\t\ttable[r][c] += table[i][c];\n\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < r",
"i",
"r",
"i++",
"i++",
"i",
"{\n\t\t\tString[] tableAry = br.readLine().split(\" \");\n\t\t\tfor (int j = 0; j < c; j++) {\n\t\t\t\ttable[i][j] = Integer.parseInt(tableAry[j]);\n\t\t\t\ttable[i][c] += Integer.parseInt(tableAry[j]);\n\t\t\t\ttable[r][j] += Integer.parseInt(tableAry[j]);\n\t\t\t}\n\t\t\ttable[r][c] += table[i][c];\n\t\t}",
"{\n\t\t\tString[] tableAry = br.readLine().split(\" \");\n\t\t\tfor (int j = 0; j < c; j++) {\n\t\t\t\ttable[i][j] = Integer.parseInt(tableAry[j]);\n\t\t\t\ttable[i][c] += Integer.parseInt(tableAry[j]);\n\t\t\t\ttable[r][j] += Integer.parseInt(tableAry[j]);\n\t\t\t}\n\t\t\ttable[r][c] += table[i][c];\n\t\t}",
"String[] tableAry = br.readLine().split(\" \");",
"tableAry",
"br.readLine().split(\" \")",
"br.readLine().split",
"br.readLine()",
"br.readLine",
"br",
"\" \"",
"for (int j = 0; j < c; j++) {\n\t\t\t\ttable[i][j] = Integer.parseInt(tableAry[j]);\n\t\t\t\ttable[i][c] += Integer.parseInt(tableAry[j]);\n\t\t\t\ttable[r][j] += Integer.parseInt(tableAry[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(tableAry[j]);\n\t\t\t\ttable[i][c] += Integer.parseInt(tableAry[j]);\n\t\t\t\ttable[r][j] += Integer.parseInt(tableAry[j]);\n\t\t\t}",
"{\n\t\t\t\ttable[i][j] = Integer.parseInt(tableAry[j]);\n\t\t\t\ttable[i][c] += Integer.parseInt(tableAry[j]);\n\t\t\t\ttable[r][j] += Integer.parseInt(tableAry[j]);\n\t\t\t}",
"table[i][j] = Integer.parseInt(tableAry[j])",
"table[i][j]",
"table[i]",
"table",
"i",
"j",
"Integer.parseInt(tableAry[j])",
"Integer.parseInt",
"Integer",
"tableAry[j]",
"tableAry",
"j",
"table[i][c] += Integer.parseInt(tableAry[j])",
"table[i][c]",
"table[i]",
"table",
"i",
"c",
"Integer.parseInt(tableAry[j])",
"Integer.parseInt",
"Integer",
"tableAry[j]",
"tableAry",
"j",
"table[r][j] += Integer.parseInt(tableAry[j])",
"table[r][j]",
"table[r]",
"table",
"r",
"j",
"Integer.parseInt(tableAry[j])",
"Integer.parseInt",
"Integer",
"tableAry[j]",
"tableAry",
"j",
"table[r][c] += table[i][c]",
"table[r][c]",
"table[r]",
"table",
"r",
"c",
"table[i][c]",
"table[i]",
"table",
"i",
"c",
"for (int i = 0; i <= r; i++) {\n\t\t\tfor (int j = 0; j <= c; j++) {\n\t\t\t\tif (j == c) 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",
"i",
"r",
"i++",
"i++",
"i",
"{\n\t\t\tfor (int j = 0; j <= c; j++) {\n\t\t\t\tif (j == c) 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; j++) {\n\t\t\t\tif (j == c) 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; j++) {\n\t\t\t\tif (j == c) 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",
"j",
"c",
"j++",
"j++",
"j",
"{\n\t\t\t\tif (j == c) 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 (j == c) System.out.println(table[i][j]);\n\t\t\t\telse System.out.print(table[i][j] + \" \");\n\t\t\t}",
"if (j == c) System.out.println(table[i][j]);\n\t\t\t\telse System.out.print(table[i][j] + \" \");",
"j == c",
"j",
"c",
"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[] 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[] strAry = br.readLine().split(\" \");\n\t\tint r = Integer.parseInt(strAry[0]);\n\t\tint c = Integer.parseInt(strAry[1]);\n\t\tint[][] table = new int[r + 1][c + 1];\n\t\tfor (int i = 0; i < r; i++) {\n\t\t\tString[] tableAry = br.readLine().split(\" \");\n\t\t\tfor (int j = 0; j < c; j++) {\n\t\t\t\ttable[i][j] = Integer.parseInt(tableAry[j]);\n\t\t\t\ttable[i][c] += Integer.parseInt(tableAry[j]);\n\t\t\t\ttable[r][j] += Integer.parseInt(tableAry[j]);\n\t\t\t}\n\t\t\ttable[r][c] += table[i][c];\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 == c) 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}\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[] strAry = br.readLine().split(\" \");\n\t\tint r = Integer.parseInt(strAry[0]);\n\t\tint c = Integer.parseInt(strAry[1]);\n\t\tint[][] table = new int[r + 1][c + 1];\n\t\tfor (int i = 0; i < r; i++) {\n\t\t\tString[] tableAry = br.readLine().split(\" \");\n\t\t\tfor (int j = 0; j < c; j++) {\n\t\t\t\ttable[i][j] = Integer.parseInt(tableAry[j]);\n\t\t\t\ttable[i][c] += Integer.parseInt(tableAry[j]);\n\t\t\t\ttable[r][j] += Integer.parseInt(tableAry[j]);\n\t\t\t}\n\t\t\ttable[r][c] += table[i][c];\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 == c) 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}\n}",
"Main"
] | import java.io.InputStreamReader;
import java.io.BufferedReader;
import java.io.IOException;
public class Main {
public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
String[] strAry = br.readLine().split(" ");
int r = Integer.parseInt(strAry[0]);
int c = Integer.parseInt(strAry[1]);
int[][] table = new int[r + 1][c + 1];
for (int i = 0; i < r; i++) {
String[] tableAry = br.readLine().split(" ");
for (int j = 0; j < c; j++) {
table[i][j] = Integer.parseInt(tableAry[j]);
table[i][c] += Integer.parseInt(tableAry[j]);
table[r][j] += Integer.parseInt(tableAry[j]);
}
table[r][c] += table[i][c];
}
for (int i = 0; i <= r; i++) {
for (int j = 0; j <= c; j++) {
if (j == c) System.out.println(table[i][j]);
else System.out.print(table[i][j] + " ");
}
}
}
} |
[
7,
6,
13,
12,
13,
30,
41,
13,
20,
41,
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,
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,
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,
4,
18,
18,
13,
13,
2,
18,
18,
13,
13,
13,
17,
4,
18,
18,
13,
13,
2,
18,
18,
13,
13,
13,
17,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
165,
2
],
[
165,
3
],
[
3,
4
],
[
3,
5
],
[
5,
6
],
[
6,
7
],
[
6,
8
],
[
5,
9
],
[
9,
10
],
[
9,
11
],
[
11,
12
],
[
12,
13
],
[
5,
14
],
[
14,
15
],
[
14,
16
],
[
16,
17
],
[
17,
18
],
[
5,
19
],
[
19,
20
],
[
20,
21
],
[
5,
22
],
[
22,
23
],
[
22,
24
],
[
25,
26
],
[
25,
27
],
[
28,
29
],
[
28,
30
],
[
5,
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
],
[
46,
47
],
[
47,
48
],
[
48,
49
],
[
49,
50
],
[
46,
51
],
[
43,
52
],
[
52,
53
],
[
53,
54
],
[
54,
55
],
[
54,
56
],
[
52,
57
],
[
57,
58
],
[
57,
59
],
[
52,
60
],
[
60,
61
],
[
61,
62
],
[
52,
63
],
[
64,
64
],
[
64,
65
],
[
65,
66
],
[
66,
67
],
[
67,
68
],
[
67,
69
],
[
66,
70
],
[
65,
71
],
[
71,
72
],
[
72,
73
],
[
71,
74
],
[
74,
75
],
[
74,
76
],
[
64,
77
],
[
77,
78
],
[
78,
79
],
[
79,
80
],
[
79,
81
],
[
78,
82
],
[
77,
83
],
[
83,
84
],
[
84,
85
],
[
84,
86
],
[
83,
87
],
[
64,
88
],
[
88,
89
],
[
89,
90
],
[
90,
91
],
[
90,
92
],
[
89,
93
],
[
88,
94
],
[
94,
95
],
[
95,
96
],
[
95,
97
],
[
94,
98
],
[
43,
99
],
[
99,
100
],
[
100,
101
],
[
101,
102
],
[
101,
103
],
[
100,
104
],
[
99,
105
],
[
105,
106
],
[
106,
107
],
[
106,
108
],
[
105,
109
],
[
5,
110
],
[
110,
111
],
[
111,
112
],
[
112,
113
],
[
112,
114
],
[
110,
115
],
[
115,
116
],
[
115,
117
],
[
117,
118
],
[
117,
119
],
[
110,
120
],
[
120,
121
],
[
121,
122
],
[
110,
123
],
[
124,
124
],
[
124,
125
],
[
125,
126
],
[
126,
127
],
[
127,
128
],
[
127,
129
],
[
125,
130
],
[
130,
131
],
[
130,
132
],
[
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
],
[
145,
146
],
[
145,
147
],
[
144,
148
],
[
143,
149
],
[
124,
150
],
[
150,
151
],
[
151,
152
],
[
152,
153
],
[
152,
154
],
[
150,
155
],
[
155,
156
],
[
156,
157
],
[
157,
158
],
[
157,
159
],
[
156,
160
],
[
155,
161
],
[
3,
162
],
[
162,
163
],
[
0,
164
],
[
164,
165
],
[
164,
166
]
] | [
"public class Main {\n\n\tpublic static void main(String[] args) {\n\t\t// TODO ?????????????????????????????????????????????\n\t\tjava.util.Scanner sc = new java.util.Scanner(System.in);\n\n\t\tint r = sc.nextInt();\n\t\tint c = sc.nextInt();\n\t\tsc.nextLine();\n\n\t\tint[][] mat = new int[r+1][c+1];\n\n\t\tfor (int i=0; i < r; i++) {\n\n\t\t\tString[] data = sc.nextLine().split(\" \");\n\n\t\t\tfor (int j=0; j < c; j++) {\n\t\t\t\tmat[i][j] = Integer.parseInt(data[j]);\n\n\t\t\t\tmat[i][c] += mat[i][j];\n\t\t\t\tmat[r][j] += mat[i][j];\n\t\t\t}\n\t\t\tmat[r][c] += mat[i][c];\n\n\t\t}\n\n\t\tfor (int i=0; i<r+1; i++) {\n\n\t\t\tfor (int j=0; j<c; j++) {\n\t\t\t\tSystem.out.print(mat[i][j] + \" \");\n\t\t\t}\n\t\t\tSystem.out.print(mat[i][c] + \"\\n\");\n\n\t\t}\n\t}\n\n}",
"public class Main {\n\n\tpublic static void main(String[] args) {\n\t\t// TODO ?????????????????????????????????????????????\n\t\tjava.util.Scanner sc = new java.util.Scanner(System.in);\n\n\t\tint r = sc.nextInt();\n\t\tint c = sc.nextInt();\n\t\tsc.nextLine();\n\n\t\tint[][] mat = new int[r+1][c+1];\n\n\t\tfor (int i=0; i < r; i++) {\n\n\t\t\tString[] data = sc.nextLine().split(\" \");\n\n\t\t\tfor (int j=0; j < c; j++) {\n\t\t\t\tmat[i][j] = Integer.parseInt(data[j]);\n\n\t\t\t\tmat[i][c] += mat[i][j];\n\t\t\t\tmat[r][j] += mat[i][j];\n\t\t\t}\n\t\t\tmat[r][c] += mat[i][c];\n\n\t\t}\n\n\t\tfor (int i=0; i<r+1; i++) {\n\n\t\t\tfor (int j=0; j<c; j++) {\n\t\t\t\tSystem.out.print(mat[i][j] + \" \");\n\t\t\t}\n\t\t\tSystem.out.print(mat[i][c] + \"\\n\");\n\n\t\t}\n\t}\n\n}",
"Main",
"public static void main(String[] args) {\n\t\t// TODO ?????????????????????????????????????????????\n\t\tjava.util.Scanner sc = new java.util.Scanner(System.in);\n\n\t\tint r = sc.nextInt();\n\t\tint c = sc.nextInt();\n\t\tsc.nextLine();\n\n\t\tint[][] mat = new int[r+1][c+1];\n\n\t\tfor (int i=0; i < r; i++) {\n\n\t\t\tString[] data = sc.nextLine().split(\" \");\n\n\t\t\tfor (int j=0; j < c; j++) {\n\t\t\t\tmat[i][j] = Integer.parseInt(data[j]);\n\n\t\t\t\tmat[i][c] += mat[i][j];\n\t\t\t\tmat[r][j] += mat[i][j];\n\t\t\t}\n\t\t\tmat[r][c] += mat[i][c];\n\n\t\t}\n\n\t\tfor (int i=0; i<r+1; i++) {\n\n\t\t\tfor (int j=0; j<c; j++) {\n\t\t\t\tSystem.out.print(mat[i][j] + \" \");\n\t\t\t}\n\t\t\tSystem.out.print(mat[i][c] + \"\\n\");\n\n\t\t}\n\t}",
"main",
"{\n\t\t// TODO ?????????????????????????????????????????????\n\t\tjava.util.Scanner sc = new java.util.Scanner(System.in);\n\n\t\tint r = sc.nextInt();\n\t\tint c = sc.nextInt();\n\t\tsc.nextLine();\n\n\t\tint[][] mat = new int[r+1][c+1];\n\n\t\tfor (int i=0; i < r; i++) {\n\n\t\t\tString[] data = sc.nextLine().split(\" \");\n\n\t\t\tfor (int j=0; j < c; j++) {\n\t\t\t\tmat[i][j] = Integer.parseInt(data[j]);\n\n\t\t\t\tmat[i][c] += mat[i][j];\n\t\t\t\tmat[r][j] += mat[i][j];\n\t\t\t}\n\t\t\tmat[r][c] += mat[i][c];\n\n\t\t}\n\n\t\tfor (int i=0; i<r+1; i++) {\n\n\t\t\tfor (int j=0; j<c; j++) {\n\t\t\t\tSystem.out.print(mat[i][j] + \" \");\n\t\t\t}\n\t\t\tSystem.out.print(mat[i][c] + \"\\n\");\n\n\t\t}\n\t}",
"java.util.Scanner sc = new java.util.Scanner(System.in);",
"sc",
"new java.util.Scanner(System.in)",
"int r = sc.nextInt();",
"r",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int c = sc.nextInt();",
"c",
"sc.nextInt()",
"sc.nextInt",
"sc",
"sc.nextLine()",
"sc.nextLine",
"sc",
"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\n\t\t\tString[] data = sc.nextLine().split(\" \");\n\n\t\t\tfor (int j=0; j < c; j++) {\n\t\t\t\tmat[i][j] = Integer.parseInt(data[j]);\n\n\t\t\t\tmat[i][c] += mat[i][j];\n\t\t\t\tmat[r][j] += mat[i][j];\n\t\t\t}\n\t\t\tmat[r][c] += mat[i][c];\n\n\t\t}",
"int i=0;",
"int i=0;",
"i",
"0",
"i < r",
"i",
"r",
"i++",
"i++",
"i",
"{\n\n\t\t\tString[] data = sc.nextLine().split(\" \");\n\n\t\t\tfor (int j=0; j < c; j++) {\n\t\t\t\tmat[i][j] = Integer.parseInt(data[j]);\n\n\t\t\t\tmat[i][c] += mat[i][j];\n\t\t\t\tmat[r][j] += mat[i][j];\n\t\t\t}\n\t\t\tmat[r][c] += mat[i][c];\n\n\t\t}",
"{\n\n\t\t\tString[] data = sc.nextLine().split(\" \");\n\n\t\t\tfor (int j=0; j < c; j++) {\n\t\t\t\tmat[i][j] = Integer.parseInt(data[j]);\n\n\t\t\t\tmat[i][c] += mat[i][j];\n\t\t\t\tmat[r][j] += mat[i][j];\n\t\t\t}\n\t\t\tmat[r][c] += mat[i][c];\n\n\t\t}",
"String[] data = sc.nextLine().split(\" \");",
"data",
"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(data[j]);\n\n\t\t\t\tmat[i][c] += mat[i][j];\n\t\t\t\tmat[r][j] += mat[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\tmat[i][j] = Integer.parseInt(data[j]);\n\n\t\t\t\tmat[i][c] += mat[i][j];\n\t\t\t\tmat[r][j] += mat[i][j];\n\t\t\t}",
"{\n\t\t\t\tmat[i][j] = Integer.parseInt(data[j]);\n\n\t\t\t\tmat[i][c] += mat[i][j];\n\t\t\t\tmat[r][j] += mat[i][j];\n\t\t\t}",
"mat[i][j] = Integer.parseInt(data[j])",
"mat[i][j]",
"mat[i]",
"mat",
"i",
"j",
"Integer.parseInt(data[j])",
"Integer.parseInt",
"Integer",
"data[j]",
"data",
"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",
"mat[r][c] += mat[i][c]",
"mat[r][c]",
"mat[r]",
"mat",
"r",
"c",
"mat[i][c]",
"mat[i]",
"mat",
"i",
"c",
"for (int i=0; i<r+1; i++) {\n\n\t\t\tfor (int j=0; j<c; j++) {\n\t\t\t\tSystem.out.print(mat[i][j] + \" \");\n\t\t\t}\n\t\t\tSystem.out.print(mat[i][c] + \"\\n\");\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; j++) {\n\t\t\t\tSystem.out.print(mat[i][j] + \" \");\n\t\t\t}\n\t\t\tSystem.out.print(mat[i][c] + \"\\n\");\n\n\t\t}",
"{\n\n\t\t\tfor (int j=0; j<c; j++) {\n\t\t\t\tSystem.out.print(mat[i][j] + \" \");\n\t\t\t}\n\t\t\tSystem.out.print(mat[i][c] + \"\\n\");\n\n\t\t}",
"for (int j=0; j<c; j++) {\n\t\t\t\tSystem.out.print(mat[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(mat[i][j] + \" \");\n\t\t\t}",
"{\n\t\t\t\tSystem.out.print(mat[i][j] + \" \");\n\t\t\t}",
"System.out.print(mat[i][j] + \" \")",
"System.out.print",
"System.out",
"System",
"System.out",
"mat[i][j] + \" \"",
"mat[i][j]",
"mat[i]",
"mat",
"i",
"j",
"\" \"",
"System.out.print(mat[i][c] + \"\\n\")",
"System.out.print",
"System.out",
"System",
"System.out",
"mat[i][c] + \"\\n\"",
"mat[i][c]",
"mat[i]",
"mat",
"i",
"c",
"\"\\n\"",
"String[] args",
"args",
"public class Main {\n\n\tpublic static void main(String[] args) {\n\t\t// TODO ?????????????????????????????????????????????\n\t\tjava.util.Scanner sc = new java.util.Scanner(System.in);\n\n\t\tint r = sc.nextInt();\n\t\tint c = sc.nextInt();\n\t\tsc.nextLine();\n\n\t\tint[][] mat = new int[r+1][c+1];\n\n\t\tfor (int i=0; i < r; i++) {\n\n\t\t\tString[] data = sc.nextLine().split(\" \");\n\n\t\t\tfor (int j=0; j < c; j++) {\n\t\t\t\tmat[i][j] = Integer.parseInt(data[j]);\n\n\t\t\t\tmat[i][c] += mat[i][j];\n\t\t\t\tmat[r][j] += mat[i][j];\n\t\t\t}\n\t\t\tmat[r][c] += mat[i][c];\n\n\t\t}\n\n\t\tfor (int i=0; i<r+1; i++) {\n\n\t\t\tfor (int j=0; j<c; j++) {\n\t\t\t\tSystem.out.print(mat[i][j] + \" \");\n\t\t\t}\n\t\t\tSystem.out.print(mat[i][c] + \"\\n\");\n\n\t\t}\n\t}\n\n}",
"public class Main {\n\n\tpublic static void main(String[] args) {\n\t\t// TODO ?????????????????????????????????????????????\n\t\tjava.util.Scanner sc = new java.util.Scanner(System.in);\n\n\t\tint r = sc.nextInt();\n\t\tint c = sc.nextInt();\n\t\tsc.nextLine();\n\n\t\tint[][] mat = new int[r+1][c+1];\n\n\t\tfor (int i=0; i < r; i++) {\n\n\t\t\tString[] data = sc.nextLine().split(\" \");\n\n\t\t\tfor (int j=0; j < c; j++) {\n\t\t\t\tmat[i][j] = Integer.parseInt(data[j]);\n\n\t\t\t\tmat[i][c] += mat[i][j];\n\t\t\t\tmat[r][j] += mat[i][j];\n\t\t\t}\n\t\t\tmat[r][c] += mat[i][c];\n\n\t\t}\n\n\t\tfor (int i=0; i<r+1; i++) {\n\n\t\t\tfor (int j=0; j<c; j++) {\n\t\t\t\tSystem.out.print(mat[i][j] + \" \");\n\t\t\t}\n\t\t\tSystem.out.print(mat[i][c] + \"\\n\");\n\n\t\t}\n\t}\n\n}",
"Main"
] | public class Main {
public static void main(String[] args) {
// TODO ?????????????????????????????????????????????
java.util.Scanner sc = new java.util.Scanner(System.in);
int r = sc.nextInt();
int c = sc.nextInt();
sc.nextLine();
int[][] mat = new int[r+1][c+1];
for (int i=0; i < r; i++) {
String[] data = sc.nextLine().split(" ");
for (int j=0; j < c; j++) {
mat[i][j] = Integer.parseInt(data[j]);
mat[i][c] += mat[i][j];
mat[r][j] += mat[i][j];
}
mat[r][c] += mat[i][c];
}
for (int i=0; i<r+1; i++) {
for (int j=0; j<c; j++) {
System.out.print(mat[i][j] + " ");
}
System.out.print(mat[i][c] + "\n");
}
}
} |
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
20,
41,
13,
4,
18,
13,
17,
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,
13,
0,
13,
17,
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,
4,
18,
13,
13,
17,
4,
18,
4,
18,
13,
13,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
4,
18,
4,
18,
13,
18,
13,
13,
17,
0,
13,
18,
13,
13,
4,
18,
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
],
[
8,
15
],
[
15,
16
],
[
15,
17
],
[
17,
18
],
[
18,
19
],
[
17,
20
],
[
8,
21
],
[
21,
22
],
[
8,
23
],
[
23,
24
],
[
8,
25
],
[
25,
26
],
[
8,
27
],
[
27,
28
],
[
8,
29
],
[
29,
30
],
[
8,
31
],
[
31,
32
],
[
8,
33
],
[
33,
34
],
[
33,
35
],
[
35,
36
],
[
36,
37
],
[
8,
38
],
[
38,
39
],
[
38,
40
],
[
40,
41
],
[
41,
42
],
[
8,
43
],
[
43,
44
],
[
43,
45
],
[
8,
47
],
[
47,
48
],
[
47,
49
],
[
8,
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
],
[
62,
66
],
[
66,
67
],
[
67,
68
],
[
68,
69
],
[
68,
70
],
[
66,
71
],
[
71,
72
],
[
71,
73
],
[
66,
74
],
[
74,
75
],
[
75,
76
],
[
66,
77
],
[
78,
78
],
[
78,
79
],
[
79,
80
],
[
79,
81
],
[
81,
82
],
[
82,
83
],
[
78,
84
],
[
84,
85
],
[
84,
86
],
[
78,
87
],
[
87,
88
],
[
88,
89
],
[
88,
90
],
[
87,
91
],
[
78,
92
],
[
92,
93
],
[
93,
94
],
[
94,
95
],
[
95,
96
],
[
94,
97
],
[
92,
98
],
[
62,
99
],
[
99,
100
],
[
100,
101
],
[
101,
102
],
[
102,
103
],
[
101,
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
],
[
120,
121
],
[
121,
122
],
[
122,
123
],
[
121,
124
],
[
124,
125
],
[
124,
126
],
[
119,
127
],
[
118,
128
],
[
128,
129
],
[
128,
130
],
[
130,
131
],
[
130,
132
],
[
8,
133
],
[
133,
134
],
[
134,
135
],
[
133,
136
],
[
8,
137
],
[
137,
138
],
[
138,
139
],
[
139,
140
],
[
139,
141
],
[
137,
142
],
[
142,
143
],
[
143,
144
],
[
6,
145
],
[
145,
146
]
] | [
"import java.util.Scanner;\n\nclass Main {\n public static void main(String[] args) {\n Scanner in = new Scanner(System.in);\n StringBuilder output = new StringBuilder();\n String crlf = System.getProperty(\"line.separator\");\n int row, col, input;\n int sumRow, sumMat;\n int[] sumCol;\n \n row = in.nextInt();\n col = in.nextInt();\n sumCol = new int[col];\n sumMat = 0;\n \n for (int i = 0; i < row; i++) {\n sumRow = 0;\n for (int j = 0; j < col; j++) {\n input =in.nextInt();\n sumRow += input;\n sumCol[j] += input;\n output.append(input).append(\" \");\n }\n output.append(sumRow).append(crlf);\n }\n for (int k = 0; k < col; k++) {\n output.append(sumCol[k]).append(\" \");\n sumMat += sumCol[k];\n }\n output.append(sumMat);\n System.out.println(output.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 output = new StringBuilder();\n String crlf = System.getProperty(\"line.separator\");\n int row, col, input;\n int sumRow, sumMat;\n int[] sumCol;\n \n row = in.nextInt();\n col = in.nextInt();\n sumCol = new int[col];\n sumMat = 0;\n \n for (int i = 0; i < row; i++) {\n sumRow = 0;\n for (int j = 0; j < col; j++) {\n input =in.nextInt();\n sumRow += input;\n sumCol[j] += input;\n output.append(input).append(\" \");\n }\n output.append(sumRow).append(crlf);\n }\n for (int k = 0; k < col; k++) {\n output.append(sumCol[k]).append(\" \");\n sumMat += sumCol[k];\n }\n output.append(sumMat);\n System.out.println(output.toString());\n }\n}",
"Main",
"public static void main(String[] args) {\n Scanner in = new Scanner(System.in);\n StringBuilder output = new StringBuilder();\n String crlf = System.getProperty(\"line.separator\");\n int row, col, input;\n int sumRow, sumMat;\n int[] sumCol;\n \n row = in.nextInt();\n col = in.nextInt();\n sumCol = new int[col];\n sumMat = 0;\n \n for (int i = 0; i < row; i++) {\n sumRow = 0;\n for (int j = 0; j < col; j++) {\n input =in.nextInt();\n sumRow += input;\n sumCol[j] += input;\n output.append(input).append(\" \");\n }\n output.append(sumRow).append(crlf);\n }\n for (int k = 0; k < col; k++) {\n output.append(sumCol[k]).append(\" \");\n sumMat += sumCol[k];\n }\n output.append(sumMat);\n System.out.println(output.toString());\n }",
"main",
"{\n Scanner in = new Scanner(System.in);\n StringBuilder output = new StringBuilder();\n String crlf = System.getProperty(\"line.separator\");\n int row, col, input;\n int sumRow, sumMat;\n int[] sumCol;\n \n row = in.nextInt();\n col = in.nextInt();\n sumCol = new int[col];\n sumMat = 0;\n \n for (int i = 0; i < row; i++) {\n sumRow = 0;\n for (int j = 0; j < col; j++) {\n input =in.nextInt();\n sumRow += input;\n sumCol[j] += input;\n output.append(input).append(\" \");\n }\n output.append(sumRow).append(crlf);\n }\n for (int k = 0; k < col; k++) {\n output.append(sumCol[k]).append(\" \");\n sumMat += sumCol[k];\n }\n output.append(sumMat);\n System.out.println(output.toString());\n }",
"Scanner in = new Scanner(System.in);",
"in",
"new Scanner(System.in)",
"StringBuilder output = new StringBuilder();",
"output",
"new StringBuilder()",
"String crlf = System.getProperty(\"line.separator\");",
"crlf",
"System.getProperty(\"line.separator\")",
"System.getProperty",
"System",
"\"line.separator\"",
"int row",
"row",
"col",
"col",
"input;",
"input",
"int sumRow",
"sumRow",
"sumMat;",
"sumMat",
"int[] sumCol;",
"sumCol",
"row = in.nextInt()",
"row",
"in.nextInt()",
"in.nextInt",
"in",
"col = in.nextInt()",
"col",
"in.nextInt()",
"in.nextInt",
"in",
"sumCol = new int[col]",
"sumCol",
"new int[col]",
"col",
"sumMat = 0",
"sumMat",
"0",
"for (int i = 0; i < row; i++) {\n sumRow = 0;\n for (int j = 0; j < col; j++) {\n input =in.nextInt();\n sumRow += input;\n sumCol[j] += input;\n output.append(input).append(\" \");\n }\n output.append(sumRow).append(crlf);\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < row",
"i",
"row",
"i++",
"i++",
"i",
"{\n sumRow = 0;\n for (int j = 0; j < col; j++) {\n input =in.nextInt();\n sumRow += input;\n sumCol[j] += input;\n output.append(input).append(\" \");\n }\n output.append(sumRow).append(crlf);\n }",
"{\n sumRow = 0;\n for (int j = 0; j < col; j++) {\n input =in.nextInt();\n sumRow += input;\n sumCol[j] += input;\n output.append(input).append(\" \");\n }\n output.append(sumRow).append(crlf);\n }",
"sumRow = 0",
"sumRow",
"0",
"for (int j = 0; j < col; j++) {\n input =in.nextInt();\n sumRow += input;\n sumCol[j] += input;\n output.append(input).append(\" \");\n }",
"int j = 0;",
"int j = 0;",
"j",
"0",
"j < col",
"j",
"col",
"j++",
"j++",
"j",
"{\n input =in.nextInt();\n sumRow += input;\n sumCol[j] += input;\n output.append(input).append(\" \");\n }",
"{\n input =in.nextInt();\n sumRow += input;\n sumCol[j] += input;\n output.append(input).append(\" \");\n }",
"input =in.nextInt()",
"input",
"in.nextInt()",
"in.nextInt",
"in",
"sumRow += input",
"sumRow",
"input",
"sumCol[j] += input",
"sumCol[j]",
"sumCol",
"j",
"input",
"output.append(input).append(\" \")",
"output.append(input).append",
"output.append(input)",
"output.append",
"output",
"input",
"\" \"",
"output.append(sumRow).append(crlf)",
"output.append(sumRow).append",
"output.append(sumRow)",
"output.append",
"output",
"sumRow",
"crlf",
"for (int k = 0; k < col; k++) {\n output.append(sumCol[k]).append(\" \");\n sumMat += sumCol[k];\n }",
"int k = 0;",
"int k = 0;",
"k",
"0",
"k < col",
"k",
"col",
"k++",
"k++",
"k",
"{\n output.append(sumCol[k]).append(\" \");\n sumMat += sumCol[k];\n }",
"{\n output.append(sumCol[k]).append(\" \");\n sumMat += sumCol[k];\n }",
"output.append(sumCol[k]).append(\" \")",
"output.append(sumCol[k]).append",
"output.append(sumCol[k])",
"output.append",
"output",
"sumCol[k]",
"sumCol",
"k",
"\" \"",
"sumMat += sumCol[k]",
"sumMat",
"sumCol[k]",
"sumCol",
"k",
"output.append(sumMat)",
"output.append",
"output",
"sumMat",
"System.out.println(output.toString())",
"System.out.println",
"System.out",
"System",
"System.out",
"output.toString()",
"output.toString",
"output",
"String[] args",
"args"
] | import java.util.Scanner;
class Main {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
StringBuilder output = new StringBuilder();
String crlf = System.getProperty("line.separator");
int row, col, input;
int sumRow, sumMat;
int[] sumCol;
row = in.nextInt();
col = in.nextInt();
sumCol = new int[col];
sumMat = 0;
for (int i = 0; i < row; i++) {
sumRow = 0;
for (int j = 0; j < col; j++) {
input =in.nextInt();
sumRow += input;
sumCol[j] += input;
output.append(input).append(" ");
}
output.append(sumRow).append(crlf);
}
for (int k = 0; k < col; k++) {
output.append(sumCol[k]).append(" ");
sumMat += sumCol[k];
}
output.append(sumMat);
System.out.println(output.toString());
}
} |
[
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,
2,
13,
17,
2,
13,
17,
41,
13,
41,
13,
11,
1,
0,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
41,
13,
17,
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,
4,
18,
18,
13,
13,
2,
18,
18,
13,
13,
13,
17,
0,
18,
18,
13,
13,
13,
13,
0,
13,
13,
4,
18,
18,
13,
13,
18,
18,
13,
13,
13,
11,
1,
0,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
41,
13,
17,
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,
4,
18,
18,
13,
13,
2,
18,
18,
13,
13,
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
],
[
32,
33
],
[
32,
34
],
[
35,
36
],
[
35,
37
],
[
8,
38
],
[
38,
39
],
[
8,
40
],
[
40,
41
],
[
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
],
[
55,
57
],
[
54,
58
],
[
58,
59
],
[
59,
60
],
[
60,
61
],
[
60,
62
],
[
58,
63
],
[
63,
64
],
[
63,
65
],
[
58,
66
],
[
66,
67
],
[
67,
68
],
[
58,
69
],
[
70,
70
],
[
70,
71
],
[
71,
72
],
[
72,
73
],
[
73,
74
],
[
73,
75
],
[
72,
76
],
[
71,
77
],
[
77,
78
],
[
78,
79
],
[
70,
80
],
[
80,
81
],
[
80,
82
],
[
82,
83
],
[
83,
84
],
[
83,
85
],
[
82,
86
],
[
70,
87
],
[
87,
88
],
[
88,
89
],
[
89,
90
],
[
89,
91
],
[
87,
92
],
[
92,
93
],
[
93,
94
],
[
94,
95
],
[
94,
96
],
[
93,
97
],
[
92,
98
],
[
54,
99
],
[
99,
100
],
[
100,
101
],
[
101,
102
],
[
101,
103
],
[
100,
104
],
[
99,
105
],
[
54,
106
],
[
106,
107
],
[
106,
108
],
[
54,
109
],
[
109,
110
],
[
110,
111
],
[
111,
112
],
[
111,
113
],
[
109,
114
],
[
114,
115
],
[
115,
116
],
[
115,
117
],
[
114,
118
],
[
8,
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
],
[
132,
134
],
[
131,
135
],
[
135,
136
],
[
136,
137
],
[
137,
138
],
[
137,
139
],
[
135,
140
],
[
140,
141
],
[
140,
142
],
[
135,
143
],
[
143,
144
],
[
144,
145
],
[
135,
146
],
[
147,
147
],
[
147,
148
],
[
148,
149
],
[
148,
150
],
[
150,
151
],
[
151,
152
],
[
151,
153
],
[
150,
154
],
[
131,
155
],
[
155,
156
],
[
156,
157
],
[
157,
158
],
[
157,
159
],
[
156,
160
],
[
155,
161
],
[
131,
162
],
[
162,
163
],
[
163,
164
],
[
164,
165
],
[
164,
166
],
[
162,
167
],
[
167,
168
],
[
168,
169
],
[
169,
170
],
[
169,
171
],
[
168,
172
],
[
167,
173
],
[
8,
174
],
[
174,
175
],
[
175,
176
],
[
176,
177
],
[
176,
178
],
[
174,
179
],
[
6,
180
],
[
180,
181
]
] | [
"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+1][c+1];\n\tint i,j;\n\tfor(i=0;i<r;i++)\n\t {\n\t\tint b=0;\n\t\tfor(j=0;j<c;j++)\n\t\t {\n\t\t\ta[i][j]=scan.nextInt();\n\t\t\tb+=a[i][j];\n\t\t\t\n\t\t\tSystem.out.print(a[i][j]+\" \");\n\t\t }\n\t\ta[i][j]=b;\n\t\te+=b;\n\t\tSystem.out.println(a[i][j]);\n\t\n\t\t\n\t }\n\tfor(i=0;i<c;i++)\n\t {\n\t\tint d=0;\n\t\tfor(j=0;j<r;j++)\n\t\t {\n\t\t\td+=a[j][i];\n\t\t\t\t\n\t\t }\n\t\ta[j][i]=d;\n\t\tSystem.out.print(a[j][i]+\" \");\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+1][c+1];\n\tint i,j;\n\tfor(i=0;i<r;i++)\n\t {\n\t\tint b=0;\n\t\tfor(j=0;j<c;j++)\n\t\t {\n\t\t\ta[i][j]=scan.nextInt();\n\t\t\tb+=a[i][j];\n\t\t\t\n\t\t\tSystem.out.print(a[i][j]+\" \");\n\t\t }\n\t\ta[i][j]=b;\n\t\te+=b;\n\t\tSystem.out.println(a[i][j]);\n\t\n\t\t\n\t }\n\tfor(i=0;i<c;i++)\n\t {\n\t\tint d=0;\n\t\tfor(j=0;j<r;j++)\n\t\t {\n\t\t\td+=a[j][i];\n\t\t\t\t\n\t\t }\n\t\ta[j][i]=d;\n\t\tSystem.out.print(a[j][i]+\" \");\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+1][c+1];\n\tint i,j;\n\tfor(i=0;i<r;i++)\n\t {\n\t\tint b=0;\n\t\tfor(j=0;j<c;j++)\n\t\t {\n\t\t\ta[i][j]=scan.nextInt();\n\t\t\tb+=a[i][j];\n\t\t\t\n\t\t\tSystem.out.print(a[i][j]+\" \");\n\t\t }\n\t\ta[i][j]=b;\n\t\te+=b;\n\t\tSystem.out.println(a[i][j]);\n\t\n\t\t\n\t }\n\tfor(i=0;i<c;i++)\n\t {\n\t\tint d=0;\n\t\tfor(j=0;j<r;j++)\n\t\t {\n\t\t\td+=a[j][i];\n\t\t\t\t\n\t\t }\n\t\ta[j][i]=d;\n\t\tSystem.out.print(a[j][i]+\" \");\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+1][c+1];\n\tint i,j;\n\tfor(i=0;i<r;i++)\n\t {\n\t\tint b=0;\n\t\tfor(j=0;j<c;j++)\n\t\t {\n\t\t\ta[i][j]=scan.nextInt();\n\t\t\tb+=a[i][j];\n\t\t\t\n\t\t\tSystem.out.print(a[i][j]+\" \");\n\t\t }\n\t\ta[i][j]=b;\n\t\te+=b;\n\t\tSystem.out.println(a[i][j]);\n\t\n\t\t\n\t }\n\tfor(i=0;i<c;i++)\n\t {\n\t\tint d=0;\n\t\tfor(j=0;j<r;j++)\n\t\t {\n\t\t\td+=a[j][i];\n\t\t\t\t\n\t\t }\n\t\ta[j][i]=d;\n\t\tSystem.out.print(a[j][i]+\" \");\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+1][c+1];",
"a",
"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\t {\n\t\tint b=0;\n\t\tfor(j=0;j<c;j++)\n\t\t {\n\t\t\ta[i][j]=scan.nextInt();\n\t\t\tb+=a[i][j];\n\t\t\t\n\t\t\tSystem.out.print(a[i][j]+\" \");\n\t\t }\n\t\ta[i][j]=b;\n\t\te+=b;\n\t\tSystem.out.println(a[i][j]);\n\t\n\t\t\n\t }",
"i=0;",
"i=0",
"i",
"0",
"i<r",
"i",
"r",
"i++",
"i++",
"i",
"{\n\t\tint b=0;\n\t\tfor(j=0;j<c;j++)\n\t\t {\n\t\t\ta[i][j]=scan.nextInt();\n\t\t\tb+=a[i][j];\n\t\t\t\n\t\t\tSystem.out.print(a[i][j]+\" \");\n\t\t }\n\t\ta[i][j]=b;\n\t\te+=b;\n\t\tSystem.out.println(a[i][j]);\n\t\n\t\t\n\t }",
"{\n\t\tint b=0;\n\t\tfor(j=0;j<c;j++)\n\t\t {\n\t\t\ta[i][j]=scan.nextInt();\n\t\t\tb+=a[i][j];\n\t\t\t\n\t\t\tSystem.out.print(a[i][j]+\" \");\n\t\t }\n\t\ta[i][j]=b;\n\t\te+=b;\n\t\tSystem.out.println(a[i][j]);\n\t\n\t\t\n\t }",
"int b=0;",
"b",
"0",
"for(j=0;j<c;j++)\n\t\t {\n\t\t\ta[i][j]=scan.nextInt();\n\t\t\tb+=a[i][j];\n\t\t\t\n\t\t\tSystem.out.print(a[i][j]+\" \");\n\t\t }",
"j=0;",
"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];\n\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];\n\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",
"\" \"",
"a[i][j]=b",
"a[i][j]",
"a[i]",
"a",
"i",
"j",
"b",
"e+=b",
"e",
"b",
"System.out.println(a[i][j])",
"System.out.println",
"System.out",
"System",
"System.out",
"a[i][j]",
"a[i]",
"a",
"i",
"j",
"for(i=0;i<c;i++)\n\t {\n\t\tint d=0;\n\t\tfor(j=0;j<r;j++)\n\t\t {\n\t\t\td+=a[j][i];\n\t\t\t\t\n\t\t }\n\t\ta[j][i]=d;\n\t\tSystem.out.print(a[j][i]+\" \");\t\n\t }",
"i=0;",
"i=0",
"i",
"0",
"i<c",
"i",
"c",
"i++",
"i++",
"i",
"{\n\t\tint d=0;\n\t\tfor(j=0;j<r;j++)\n\t\t {\n\t\t\td+=a[j][i];\n\t\t\t\t\n\t\t }\n\t\ta[j][i]=d;\n\t\tSystem.out.print(a[j][i]+\" \");\t\n\t }",
"{\n\t\tint d=0;\n\t\tfor(j=0;j<r;j++)\n\t\t {\n\t\t\td+=a[j][i];\n\t\t\t\t\n\t\t }\n\t\ta[j][i]=d;\n\t\tSystem.out.print(a[j][i]+\" \");\t\n\t }",
"int d=0;",
"d",
"0",
"for(j=0;j<r;j++)\n\t\t {\n\t\t\td+=a[j][i];\n\t\t\t\t\n\t\t }",
"j=0;",
"j=0",
"j",
"0",
"j<r",
"j",
"r",
"j++",
"j++",
"j",
"{\n\t\t\td+=a[j][i];\n\t\t\t\t\n\t\t }",
"{\n\t\t\td+=a[j][i];\n\t\t\t\t\n\t\t }",
"d+=a[j][i]",
"d",
"a[j][i]",
"a[j]",
"a",
"j",
"i",
"a[j][i]=d",
"a[j][i]",
"a[j]",
"a",
"j",
"i",
"d",
"System.out.print(a[j][i]+\" \")",
"System.out.print",
"System.out",
"System",
"System.out",
"a[j][i]+\" \"",
"a[j][i]",
"a[j]",
"a",
"j",
"i",
"\" \"",
"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+1][c+1];
int i,j;
for(i=0;i<r;i++)
{
int b=0;
for(j=0;j<c;j++)
{
a[i][j]=scan.nextInt();
b+=a[i][j];
System.out.print(a[i][j]+" ");
}
a[i][j]=b;
e+=b;
System.out.println(a[i][j]);
}
for(i=0;i<c;i++)
{
int d=0;
for(j=0;j<r;j++)
{
d+=a[j][i];
}
a[j][i]=d;
System.out.print(a[j][i]+" ");
}
System.out.println(e);
}
} |
[
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,
0,
18,
18,
13,
13,
13,
18,
18,
13,
13,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
11,
1,
41,
13,
17,
2,
13,
2,
13,
17,
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,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
4,
18,
18,
13,
13,
2,
18,
18,
13,
13,
13,
17,
4,
18,
18,
13,
13,
18,
18,
13,
13,
13,
12,
13,
30,
4,
18,
20,
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
],
[
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
],
[
11,
77
],
[
77,
78
],
[
78,
79
],
[
79,
80
],
[
79,
81
],
[
77,
82
],
[
82,
83
],
[
82,
84
],
[
77,
85
],
[
85,
86
],
[
86,
87
],
[
77,
88
],
[
88,
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
],
[
102,
103
],
[
103,
104
],
[
104,
105
],
[
105,
106
],
[
105,
107
],
[
104,
108
],
[
103,
109
],
[
109,
110
],
[
110,
111
],
[
110,
112
],
[
109,
113
],
[
11,
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
],
[
134,
136
],
[
129,
137
],
[
137,
138
],
[
138,
139
],
[
129,
140
],
[
140,
141
],
[
141,
142
],
[
142,
143
],
[
143,
144
],
[
143,
145
],
[
141,
146
],
[
146,
147
],
[
147,
148
],
[
148,
149
],
[
148,
150
],
[
147,
151
],
[
146,
152
],
[
128,
153
],
[
153,
154
],
[
154,
155
],
[
155,
156
],
[
155,
157
],
[
153,
158
],
[
158,
159
],
[
159,
160
],
[
159,
161
],
[
158,
162
],
[
4,
163
],
[
163,
164
],
[
163,
165
],
[
165,
166
],
[
166,
167
],
[
167,
168
],
[
163,
169
],
[
169,
170
]
] | [
"import java.util.*;\nclass Main{\n Scanner sc=new Scanner(System.in);\n void main(){\n\tint r=sc.nextInt();\n int c=sc.nextInt();\n\tint[][]x=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\tx[i][j]=sc.nextInt();\n\t\tx[i][c]+=x[i][j];\n\t }\n\t}\n\tfor(int i=0;i<r;i++)for(int j=0;j<c+1;j++)x[r][j]+=x[i][j];\n\tfor(int i=0;i<r+1;i++){\n\t for(int j=0;j<c;j++)System.out.print(x[i][j]+\" \");\n\t System.out.println(x[i][c]);\n\t}\n }\n public static void main(String[]ag){\n\tnew Main().main();\n }\n}",
"import java.util.*;",
"util.*",
"java",
"class Main{\n Scanner sc=new Scanner(System.in);\n void main(){\n\tint r=sc.nextInt();\n int c=sc.nextInt();\n\tint[][]x=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\tx[i][j]=sc.nextInt();\n\t\tx[i][c]+=x[i][j];\n\t }\n\t}\n\tfor(int i=0;i<r;i++)for(int j=0;j<c+1;j++)x[r][j]+=x[i][j];\n\tfor(int i=0;i<r+1;i++){\n\t for(int j=0;j<c;j++)System.out.print(x[i][j]+\" \");\n\t System.out.println(x[i][c]);\n\t}\n }\n public static void main(String[]ag){\n\tnew Main().main();\n }\n}",
"Main",
"Scanner sc=new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"void main(){\n\tint r=sc.nextInt();\n int c=sc.nextInt();\n\tint[][]x=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\tx[i][j]=sc.nextInt();\n\t\tx[i][c]+=x[i][j];\n\t }\n\t}\n\tfor(int i=0;i<r;i++)for(int j=0;j<c+1;j++)x[r][j]+=x[i][j];\n\tfor(int i=0;i<r+1;i++){\n\t for(int j=0;j<c;j++)System.out.print(x[i][j]+\" \");\n\t System.out.println(x[i][c]);\n\t}\n }",
"main",
"{\n\tint r=sc.nextInt();\n int c=sc.nextInt();\n\tint[][]x=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\tx[i][j]=sc.nextInt();\n\t\tx[i][c]+=x[i][j];\n\t }\n\t}\n\tfor(int i=0;i<r;i++)for(int j=0;j<c+1;j++)x[r][j]+=x[i][j];\n\tfor(int i=0;i<r+1;i++){\n\t for(int j=0;j<c;j++)System.out.print(x[i][j]+\" \");\n\t System.out.println(x[i][c]);\n\t}\n }",
"int r=sc.nextInt();",
"r",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int c=sc.nextInt();",
"c",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int[][]x=new int[r+1][c+1];",
"x",
"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\tx[i][j]=sc.nextInt();\n\t\tx[i][c]+=x[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\tx[i][j]=sc.nextInt();\n\t\tx[i][c]+=x[i][j];\n\t }\n\t}",
"{\n\t for(int j=0;j<c;j++){\n\t\tx[i][j]=sc.nextInt();\n\t\tx[i][c]+=x[i][j];\n\t }\n\t}",
"for(int j=0;j<c;j++){\n\t\tx[i][j]=sc.nextInt();\n\t\tx[i][c]+=x[i][j];\n\t }",
"int j=0;",
"int j=0;",
"j",
"0",
"j<c",
"j",
"c",
"j++",
"j++",
"j",
"{\n\t\tx[i][j]=sc.nextInt();\n\t\tx[i][c]+=x[i][j];\n\t }",
"{\n\t\tx[i][j]=sc.nextInt();\n\t\tx[i][c]+=x[i][j];\n\t }",
"x[i][j]=sc.nextInt()",
"x[i][j]",
"x[i]",
"x",
"i",
"j",
"sc.nextInt()",
"sc.nextInt",
"sc",
"x[i][c]+=x[i][j]",
"x[i][c]",
"x[i]",
"x",
"i",
"c",
"x[i][j]",
"x[i]",
"x",
"i",
"j",
"for(int i=0;i<r;i++)for(int j=0;j<c+1;j++)x[r][j]+=x[i][j];",
"int i=0;",
"int i=0;",
"i",
"0",
"i<r",
"i",
"r",
"i++",
"i++",
"i",
"for(int j=0;j<c+1;j++)x[r][j]+=x[i][j];",
"for(int j=0;j<c+1;j++)x[r][j]+=x[i][j];",
"int j=0;",
"int j=0;",
"j",
"0",
"j<c+1",
"j",
"c+1",
"c",
"1",
"j++",
"j++",
"j",
"x[r][j]+=x[i][j];",
"x[r][j]+=x[i][j]",
"x[r][j]",
"x[r]",
"x",
"r",
"j",
"x[i][j]",
"x[i]",
"x",
"i",
"j",
"for(int i=0;i<r+1;i++){\n\t for(int j=0;j<c;j++)System.out.print(x[i][j]+\" \");\n\t System.out.println(x[i][c]);\n\t}",
"int i=0;",
"int i=0;",
"i",
"0",
"i<r+1",
"i",
"r+1",
"r",
"1",
"i++",
"i++",
"i",
"{\n\t for(int j=0;j<c;j++)System.out.print(x[i][j]+\" \");\n\t System.out.println(x[i][c]);\n\t}",
"{\n\t for(int j=0;j<c;j++)System.out.print(x[i][j]+\" \");\n\t System.out.println(x[i][c]);\n\t}",
"for(int j=0;j<c;j++)System.out.print(x[i][j]+\" \");",
"int j=0;",
"int j=0;",
"j",
"0",
"j<c",
"j",
"c",
"j++",
"j++",
"j",
"System.out.print(x[i][j]+\" \");",
"System.out.print(x[i][j]+\" \")",
"System.out.print",
"System.out",
"System",
"System.out",
"x[i][j]+\" \"",
"x[i][j]",
"x[i]",
"x",
"i",
"j",
"\" \"",
"System.out.println(x[i][c])",
"System.out.println",
"System.out",
"System",
"System.out",
"x[i][c]",
"x[i]",
"x",
"i",
"c",
"public static void main(String[]ag){\n\tnew Main().main();\n }",
"main",
"{\n\tnew Main().main();\n }",
"new Main().main()",
"new Main().main",
"new Main()",
"String[]ag",
"ag"
] | import java.util.*;
class Main{
Scanner sc=new Scanner(System.in);
void main(){
int r=sc.nextInt();
int c=sc.nextInt();
int[][]x=new int[r+1][c+1];
for(int i=0;i<r;i++){
for(int j=0;j<c;j++){
x[i][j]=sc.nextInt();
x[i][c]+=x[i][j];
}
}
for(int i=0;i<r;i++)for(int j=0;j<c+1;j++)x[r][j]+=x[i][j];
for(int i=0;i<r+1;i++){
for(int j=0;j<c;j++)System.out.print(x[i][j]+" ");
System.out.println(x[i][c]);
}
}
public static void main(String[]ag){
new Main().main();
}
} |
[
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,
17,
41,
13,
4,
18,
13,
18,
13,
17,
41,
13,
4,
18,
13,
18,
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,
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,
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,
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,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
18,
13,
13,
11,
1,
41,
13,
17,
2,
13,
2,
13,
17,
1,
40,
13,
30,
30,
14,
2,
13,
13,
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,
13,
13,
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,
13,
13,
17,
30,
4,
18,
18,
13,
13,
13,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
294,
11
],
[
294,
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
],
[
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
],
[
14,
50
],
[
50,
51
],
[
50,
52
],
[
14,
54
],
[
54,
55
],
[
54,
56
],
[
14,
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
],
[
71,
73
],
[
73,
74
],
[
74,
75
],
[
75,
76
],
[
76,
77
],
[
73,
78
],
[
70,
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
],
[
14,
104
],
[
104,
105
],
[
105,
106
],
[
106,
107
],
[
106,
108
],
[
104,
109
],
[
109,
110
],
[
109,
111
],
[
104,
112
],
[
112,
113
],
[
113,
114
],
[
104,
115
],
[
116,
116
],
[
116,
117
],
[
117,
118
],
[
118,
119
],
[
119,
120
],
[
119,
121
],
[
117,
122
],
[
122,
123
],
[
122,
124
],
[
117,
125
],
[
125,
126
],
[
126,
127
],
[
117,
128
],
[
129,
129
],
[
129,
130
],
[
130,
131
],
[
131,
132
],
[
131,
133
],
[
130,
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
],
[
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
],
[
152,
160
],
[
160,
161
],
[
161,
162
],
[
152,
163
],
[
164,
164
],
[
164,
165
],
[
165,
166
],
[
166,
167
],
[
166,
168
],
[
165,
169
],
[
169,
170
],
[
170,
171
],
[
170,
172
],
[
169,
173
],
[
14,
174
],
[
174,
175
],
[
175,
176
],
[
176,
177
],
[
176,
178
],
[
174,
179
],
[
179,
180
],
[
179,
181
],
[
174,
182
],
[
182,
183
],
[
183,
184
],
[
174,
185
],
[
186,
186
],
[
186,
187
],
[
187,
188
],
[
187,
189
],
[
189,
190
],
[
189,
191
],
[
14,
192
],
[
192,
193
],
[
193,
194
],
[
194,
195
],
[
194,
196
],
[
192,
197
],
[
197,
198
],
[
197,
199
],
[
199,
200
],
[
199,
201
],
[
192,
202
],
[
202,
203
],
[
203,
204
],
[
192,
205
],
[
206,
206
],
[
206,
207
],
[
207,
208
],
[
208,
209
],
[
208,
210
],
[
207,
211
],
[
211,
212
],
[
212,
213
],
[
213,
214
],
[
214,
215
],
[
214,
216
],
[
212,
217
],
[
217,
218
],
[
217,
219
],
[
219,
220
],
[
219,
221
],
[
212,
222
],
[
222,
223
],
[
223,
224
],
[
212,
225
],
[
226,
226
],
[
226,
227
],
[
227,
228
],
[
228,
229
],
[
228,
230
],
[
227,
231
],
[
231,
232
],
[
232,
233
],
[
233,
234
],
[
234,
235
],
[
234,
236
],
[
232,
237
],
[
237,
238
],
[
238,
239
],
[
239,
240
],
[
239,
241
],
[
238,
242
],
[
237,
243
],
[
227,
244
],
[
244,
245
],
[
245,
246
],
[
246,
247
],
[
247,
248
],
[
247,
249
],
[
245,
250
],
[
250,
251
],
[
250,
252
],
[
207,
253
],
[
253,
254
],
[
254,
255
],
[
255,
256
],
[
256,
257
],
[
256,
258
],
[
254,
259
],
[
259,
260
],
[
259,
261
],
[
261,
262
],
[
261,
263
],
[
254,
264
],
[
264,
265
],
[
265,
266
],
[
254,
267
],
[
268,
268
],
[
268,
269
],
[
269,
270
],
[
270,
271
],
[
270,
272
],
[
269,
273
],
[
273,
274
],
[
274,
275
],
[
275,
276
],
[
276,
277
],
[
276,
278
],
[
274,
279
],
[
279,
280
],
[
280,
281
],
[
280,
282
],
[
279,
283
],
[
269,
284
],
[
284,
285
],
[
285,
286
],
[
286,
287
],
[
287,
288
],
[
287,
289
],
[
285,
290
],
[
12,
291
],
[
291,
292
],
[
0,
293
],
[
293,
294
],
[
293,
295
]
] | [
"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\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\n String[] line = br.readLine().split(\" \");\n \n int f = 0;\n int r = Integer.parseInt(line[0]);\n int c = Integer.parseInt(line[1]);\n int num[][] = new int[r][c];\n int sum_r[] = new int[r];\n int sum_c[] = new int[c];\n\n for (int a = 0; a < r; a++) {\n String[] line1 = br.readLine().split(\" \");\n for (int b = 0; b < c; b++) { \n num[a][b] = Integer.parseInt(line1[b]);\n }\n }\n \n for (int a = 0; a < r; a++) {\n for (int b = 0; b < c; b++) { \n sum_r[a] += num[a][b];\n } \n }\n \n for (int b = 0; b < c; b++) {\n for (int a = 0; a < r; a++) { \n sum_c[b] += num[a][b];\n } \n }\n \n for(int a = 0; a < r; a++) {\n f += sum_r[a];\n }\n\n for(int x = 0; x < r + 1; x++) {\n if(x != r) { \n for(int y = 0; y < c + 1; y++) {\n if(y != c) { System.out.print(num[x][y] + \" \"); }\n else { System.out.println(sum_r[x]); }\n } \n }\n \n else {\n for(int z = 0; z < c + 1; z++) {\n if(z != c){\n System.out.print(sum_c[z] + \" \");\n }\n else {\n System.out.println(f); \n }\n }\n }\n }\n \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",
"public class Main {\n\n public static void main(String[] args) throws IOException {\n\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\n String[] line = br.readLine().split(\" \");\n \n int f = 0;\n int r = Integer.parseInt(line[0]);\n int c = Integer.parseInt(line[1]);\n int num[][] = new int[r][c];\n int sum_r[] = new int[r];\n int sum_c[] = new int[c];\n\n for (int a = 0; a < r; a++) {\n String[] line1 = br.readLine().split(\" \");\n for (int b = 0; b < c; b++) { \n num[a][b] = Integer.parseInt(line1[b]);\n }\n }\n \n for (int a = 0; a < r; a++) {\n for (int b = 0; b < c; b++) { \n sum_r[a] += num[a][b];\n } \n }\n \n for (int b = 0; b < c; b++) {\n for (int a = 0; a < r; a++) { \n sum_c[b] += num[a][b];\n } \n }\n \n for(int a = 0; a < r; a++) {\n f += sum_r[a];\n }\n\n for(int x = 0; x < r + 1; x++) {\n if(x != r) { \n for(int y = 0; y < c + 1; y++) {\n if(y != c) { System.out.print(num[x][y] + \" \"); }\n else { System.out.println(sum_r[x]); }\n } \n }\n \n else {\n for(int z = 0; z < c + 1; z++) {\n if(z != c){\n System.out.print(sum_c[z] + \" \");\n }\n else {\n System.out.println(f); \n }\n }\n }\n }\n \n\n }\n\n}",
"Main",
"public static void main(String[] args) throws IOException {\n\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\n String[] line = br.readLine().split(\" \");\n \n int f = 0;\n int r = Integer.parseInt(line[0]);\n int c = Integer.parseInt(line[1]);\n int num[][] = new int[r][c];\n int sum_r[] = new int[r];\n int sum_c[] = new int[c];\n\n for (int a = 0; a < r; a++) {\n String[] line1 = br.readLine().split(\" \");\n for (int b = 0; b < c; b++) { \n num[a][b] = Integer.parseInt(line1[b]);\n }\n }\n \n for (int a = 0; a < r; a++) {\n for (int b = 0; b < c; b++) { \n sum_r[a] += num[a][b];\n } \n }\n \n for (int b = 0; b < c; b++) {\n for (int a = 0; a < r; a++) { \n sum_c[b] += num[a][b];\n } \n }\n \n for(int a = 0; a < r; a++) {\n f += sum_r[a];\n }\n\n for(int x = 0; x < r + 1; x++) {\n if(x != r) { \n for(int y = 0; y < c + 1; y++) {\n if(y != c) { System.out.print(num[x][y] + \" \"); }\n else { System.out.println(sum_r[x]); }\n } \n }\n \n else {\n for(int z = 0; z < c + 1; z++) {\n if(z != c){\n System.out.print(sum_c[z] + \" \");\n }\n else {\n System.out.println(f); \n }\n }\n }\n }\n \n\n }",
"main",
"{\n\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\n String[] line = br.readLine().split(\" \");\n \n int f = 0;\n int r = Integer.parseInt(line[0]);\n int c = Integer.parseInt(line[1]);\n int num[][] = new int[r][c];\n int sum_r[] = new int[r];\n int sum_c[] = new int[c];\n\n for (int a = 0; a < r; a++) {\n String[] line1 = br.readLine().split(\" \");\n for (int b = 0; b < c; b++) { \n num[a][b] = Integer.parseInt(line1[b]);\n }\n }\n \n for (int a = 0; a < r; a++) {\n for (int b = 0; b < c; b++) { \n sum_r[a] += num[a][b];\n } \n }\n \n for (int b = 0; b < c; b++) {\n for (int a = 0; a < r; a++) { \n sum_c[b] += num[a][b];\n } \n }\n \n for(int a = 0; a < r; a++) {\n f += sum_r[a];\n }\n\n for(int x = 0; x < r + 1; x++) {\n if(x != r) { \n for(int y = 0; y < c + 1; y++) {\n if(y != c) { System.out.print(num[x][y] + \" \"); }\n else { System.out.println(sum_r[x]); }\n } \n }\n \n else {\n for(int z = 0; z < c + 1; z++) {\n if(z != c){\n System.out.print(sum_c[z] + \" \");\n }\n else {\n System.out.println(f); \n }\n }\n }\n }\n \n\n }",
"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 f = 0;",
"f",
"0",
"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 num[][] = new int[r][c];",
"num",
"new int[r][c]",
"r",
"c",
"int sum_r[] = new int[r];",
"sum_r",
"new int[r]",
"r",
"int sum_c[] = new int[c];",
"sum_c",
"new int[c]",
"c",
"for (int a = 0; a < r; a++) {\n String[] line1 = br.readLine().split(\" \");\n for (int b = 0; b < c; b++) { \n num[a][b] = Integer.parseInt(line1[b]);\n }\n }",
"int a = 0;",
"int a = 0;",
"a",
"0",
"a < r",
"a",
"r",
"a++",
"a++",
"a",
"{\n String[] line1 = br.readLine().split(\" \");\n for (int b = 0; b < c; b++) { \n num[a][b] = Integer.parseInt(line1[b]);\n }\n }",
"{\n String[] line1 = br.readLine().split(\" \");\n for (int b = 0; b < c; b++) { \n num[a][b] = Integer.parseInt(line1[b]);\n }\n }",
"String[] line1 = br.readLine().split(\" \");",
"line1",
"br.readLine().split(\" \")",
"br.readLine().split",
"br.readLine()",
"br.readLine",
"br",
"\" \"",
"for (int b = 0; b < c; b++) { \n num[a][b] = Integer.parseInt(line1[b]);\n }",
"int b = 0;",
"int b = 0;",
"b",
"0",
"b < c",
"b",
"c",
"b++",
"b++",
"b",
"{ \n num[a][b] = Integer.parseInt(line1[b]);\n }",
"{ \n num[a][b] = Integer.parseInt(line1[b]);\n }",
"num[a][b] = Integer.parseInt(line1[b])",
"num[a][b]",
"num[a]",
"num",
"a",
"b",
"Integer.parseInt(line1[b])",
"Integer.parseInt",
"Integer",
"line1[b]",
"line1",
"b",
"for (int a = 0; a < r; a++) {\n for (int b = 0; b < c; b++) { \n sum_r[a] += num[a][b];\n } \n }",
"int a = 0;",
"int a = 0;",
"a",
"0",
"a < r",
"a",
"r",
"a++",
"a++",
"a",
"{\n for (int b = 0; b < c; b++) { \n sum_r[a] += num[a][b];\n } \n }",
"{\n for (int b = 0; b < c; b++) { \n sum_r[a] += num[a][b];\n } \n }",
"for (int b = 0; b < c; b++) { \n sum_r[a] += num[a][b];\n }",
"int b = 0;",
"int b = 0;",
"b",
"0",
"b < c",
"b",
"c",
"b++",
"b++",
"b",
"{ \n sum_r[a] += num[a][b];\n }",
"{ \n sum_r[a] += num[a][b];\n }",
"sum_r[a] += num[a][b]",
"sum_r[a]",
"sum_r",
"a",
"num[a][b]",
"num[a]",
"num",
"a",
"b",
"for (int b = 0; b < c; b++) {\n for (int a = 0; a < r; a++) { \n sum_c[b] += num[a][b];\n } \n }",
"int b = 0;",
"int b = 0;",
"b",
"0",
"b < c",
"b",
"c",
"b++",
"b++",
"b",
"{\n for (int a = 0; a < r; a++) { \n sum_c[b] += num[a][b];\n } \n }",
"{\n for (int a = 0; a < r; a++) { \n sum_c[b] += num[a][b];\n } \n }",
"for (int a = 0; a < r; a++) { \n sum_c[b] += num[a][b];\n }",
"int a = 0;",
"int a = 0;",
"a",
"0",
"a < r",
"a",
"r",
"a++",
"a++",
"a",
"{ \n sum_c[b] += num[a][b];\n }",
"{ \n sum_c[b] += num[a][b];\n }",
"sum_c[b] += num[a][b]",
"sum_c[b]",
"sum_c",
"b",
"num[a][b]",
"num[a]",
"num",
"a",
"b",
"for(int a = 0; a < r; a++) {\n f += sum_r[a];\n }",
"int a = 0;",
"int a = 0;",
"a",
"0",
"a < r",
"a",
"r",
"a++",
"a++",
"a",
"{\n f += sum_r[a];\n }",
"{\n f += sum_r[a];\n }",
"f += sum_r[a]",
"f",
"sum_r[a]",
"sum_r",
"a",
"for(int x = 0; x < r + 1; x++) {\n if(x != r) { \n for(int y = 0; y < c + 1; y++) {\n if(y != c) { System.out.print(num[x][y] + \" \"); }\n else { System.out.println(sum_r[x]); }\n } \n }\n \n else {\n for(int z = 0; z < c + 1; z++) {\n if(z != c){\n System.out.print(sum_c[z] + \" \");\n }\n else {\n System.out.println(f); \n }\n }\n }\n }",
"int x = 0;",
"int x = 0;",
"x",
"0",
"x < r + 1",
"x",
"r + 1",
"r",
"1",
"x++",
"x++",
"x",
"{\n if(x != r) { \n for(int y = 0; y < c + 1; y++) {\n if(y != c) { System.out.print(num[x][y] + \" \"); }\n else { System.out.println(sum_r[x]); }\n } \n }\n \n else {\n for(int z = 0; z < c + 1; z++) {\n if(z != c){\n System.out.print(sum_c[z] + \" \");\n }\n else {\n System.out.println(f); \n }\n }\n }\n }",
"{\n if(x != r) { \n for(int y = 0; y < c + 1; y++) {\n if(y != c) { System.out.print(num[x][y] + \" \"); }\n else { System.out.println(sum_r[x]); }\n } \n }\n \n else {\n for(int z = 0; z < c + 1; z++) {\n if(z != c){\n System.out.print(sum_c[z] + \" \");\n }\n else {\n System.out.println(f); \n }\n }\n }\n }",
"if(x != r) { \n for(int y = 0; y < c + 1; y++) {\n if(y != c) { System.out.print(num[x][y] + \" \"); }\n else { System.out.println(sum_r[x]); }\n } \n }\n \n else {\n for(int z = 0; z < c + 1; z++) {\n if(z != c){\n System.out.print(sum_c[z] + \" \");\n }\n else {\n System.out.println(f); \n }\n }\n }",
"x != r",
"x",
"r",
"{ \n for(int y = 0; y < c + 1; y++) {\n if(y != c) { System.out.print(num[x][y] + \" \"); }\n else { System.out.println(sum_r[x]); }\n } \n }",
"for(int y = 0; y < c + 1; y++) {\n if(y != c) { System.out.print(num[x][y] + \" \"); }\n else { System.out.println(sum_r[x]); }\n }",
"int y = 0;",
"int y = 0;",
"y",
"0",
"y < c + 1",
"y",
"c + 1",
"c",
"1",
"y++",
"y++",
"y",
"{\n if(y != c) { System.out.print(num[x][y] + \" \"); }\n else { System.out.println(sum_r[x]); }\n }",
"{\n if(y != c) { System.out.print(num[x][y] + \" \"); }\n else { System.out.println(sum_r[x]); }\n }",
"if(y != c) { System.out.print(num[x][y] + \" \"); }\n else { System.out.println(sum_r[x]); }",
"y != c",
"y",
"c",
"{ System.out.print(num[x][y] + \" \"); }",
"System.out.print(num[x][y] + \" \")",
"System.out.print",
"System.out",
"System",
"System.out",
"num[x][y] + \" \"",
"num[x][y]",
"num[x]",
"num",
"x",
"y",
"\" \"",
"{ System.out.println(sum_r[x]); }",
"System.out.println(sum_r[x])",
"System.out.println",
"System.out",
"System",
"System.out",
"sum_r[x]",
"sum_r",
"x",
"{\n for(int z = 0; z < c + 1; z++) {\n if(z != c){\n System.out.print(sum_c[z] + \" \");\n }\n else {\n System.out.println(f); \n }\n }\n }",
"for(int z = 0; z < c + 1; z++) {\n if(z != c){\n System.out.print(sum_c[z] + \" \");\n }\n else {\n System.out.println(f); \n }\n }",
"int z = 0;",
"int z = 0;",
"z",
"0",
"z < c + 1",
"z",
"c + 1",
"c",
"1",
"z++",
"z++",
"z",
"{\n if(z != c){\n System.out.print(sum_c[z] + \" \");\n }\n else {\n System.out.println(f); \n }\n }",
"{\n if(z != c){\n System.out.print(sum_c[z] + \" \");\n }\n else {\n System.out.println(f); \n }\n }",
"if(z != c){\n System.out.print(sum_c[z] + \" \");\n }\n else {\n System.out.println(f); \n }",
"z != c",
"z",
"c",
"{\n System.out.print(sum_c[z] + \" \");\n }",
"System.out.print(sum_c[z] + \" \")",
"System.out.print",
"System.out",
"System",
"System.out",
"sum_c[z] + \" \"",
"sum_c[z]",
"sum_c",
"z",
"\" \"",
"{\n System.out.println(f); \n }",
"System.out.println(f)",
"System.out.println",
"System.out",
"System",
"System.out",
"f",
"String[] args",
"args",
"public class Main {\n\n public static void main(String[] args) throws IOException {\n\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\n String[] line = br.readLine().split(\" \");\n \n int f = 0;\n int r = Integer.parseInt(line[0]);\n int c = Integer.parseInt(line[1]);\n int num[][] = new int[r][c];\n int sum_r[] = new int[r];\n int sum_c[] = new int[c];\n\n for (int a = 0; a < r; a++) {\n String[] line1 = br.readLine().split(\" \");\n for (int b = 0; b < c; b++) { \n num[a][b] = Integer.parseInt(line1[b]);\n }\n }\n \n for (int a = 0; a < r; a++) {\n for (int b = 0; b < c; b++) { \n sum_r[a] += num[a][b];\n } \n }\n \n for (int b = 0; b < c; b++) {\n for (int a = 0; a < r; a++) { \n sum_c[b] += num[a][b];\n } \n }\n \n for(int a = 0; a < r; a++) {\n f += sum_r[a];\n }\n\n for(int x = 0; x < r + 1; x++) {\n if(x != r) { \n for(int y = 0; y < c + 1; y++) {\n if(y != c) { System.out.print(num[x][y] + \" \"); }\n else { System.out.println(sum_r[x]); }\n } \n }\n \n else {\n for(int z = 0; z < c + 1; z++) {\n if(z != c){\n System.out.print(sum_c[z] + \" \");\n }\n else {\n System.out.println(f); \n }\n }\n }\n }\n \n\n }\n\n}",
"public class Main {\n\n public static void main(String[] args) throws IOException {\n\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\n String[] line = br.readLine().split(\" \");\n \n int f = 0;\n int r = Integer.parseInt(line[0]);\n int c = Integer.parseInt(line[1]);\n int num[][] = new int[r][c];\n int sum_r[] = new int[r];\n int sum_c[] = new int[c];\n\n for (int a = 0; a < r; a++) {\n String[] line1 = br.readLine().split(\" \");\n for (int b = 0; b < c; b++) { \n num[a][b] = Integer.parseInt(line1[b]);\n }\n }\n \n for (int a = 0; a < r; a++) {\n for (int b = 0; b < c; b++) { \n sum_r[a] += num[a][b];\n } \n }\n \n for (int b = 0; b < c; b++) {\n for (int a = 0; a < r; a++) { \n sum_c[b] += num[a][b];\n } \n }\n \n for(int a = 0; a < r; a++) {\n f += sum_r[a];\n }\n\n for(int x = 0; x < r + 1; x++) {\n if(x != r) { \n for(int y = 0; y < c + 1; y++) {\n if(y != c) { System.out.print(num[x][y] + \" \"); }\n else { System.out.println(sum_r[x]); }\n } \n }\n \n else {\n for(int z = 0; z < c + 1; z++) {\n if(z != c){\n System.out.print(sum_c[z] + \" \");\n }\n else {\n System.out.println(f); \n }\n }\n }\n }\n \n\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[] line = br.readLine().split(" ");
int f = 0;
int r = Integer.parseInt(line[0]);
int c = Integer.parseInt(line[1]);
int num[][] = new int[r][c];
int sum_r[] = new int[r];
int sum_c[] = new int[c];
for (int a = 0; a < r; a++) {
String[] line1 = br.readLine().split(" ");
for (int b = 0; b < c; b++) {
num[a][b] = Integer.parseInt(line1[b]);
}
}
for (int a = 0; a < r; a++) {
for (int b = 0; b < c; b++) {
sum_r[a] += num[a][b];
}
}
for (int b = 0; b < c; b++) {
for (int a = 0; a < r; a++) {
sum_c[b] += num[a][b];
}
}
for(int a = 0; a < r; a++) {
f += sum_r[a];
}
for(int x = 0; x < r + 1; x++) {
if(x != r) {
for(int y = 0; y < c + 1; y++) {
if(y != c) { System.out.print(num[x][y] + " "); }
else { System.out.println(sum_r[x]); }
}
}
else {
for(int z = 0; z < c + 1; z++) {
if(z != c){
System.out.print(sum_c[z] + " ");
}
else {
System.out.println(f);
}
}
}
}
}
} |
[
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,
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,
0,
13,
17,
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,
13,
4,
18,
18,
13,
13,
17,
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,
18,
18,
13,
13,
13,
4,
18,
18,
13,
13,
2,
13,
17,
4,
18,
18,
13,
13,
13,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
191,
5
],
[
191,
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
],
[
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
],
[
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
],
[
81,
83
],
[
80,
84
],
[
84,
85
],
[
85,
86
],
[
86,
87
],
[
86,
88
],
[
84,
89
],
[
89,
90
],
[
89,
91
],
[
84,
92
],
[
92,
93
],
[
93,
94
],
[
84,
95
],
[
96,
96
],
[
96,
97
],
[
97,
98
],
[
98,
99
],
[
99,
100
],
[
99,
101
],
[
97,
102
],
[
102,
103
],
[
103,
104
],
[
104,
105
],
[
104,
106
],
[
103,
107
],
[
102,
108
],
[
96,
109
],
[
109,
110
],
[
109,
111
],
[
111,
112
],
[
112,
113
],
[
112,
114
],
[
111,
115
],
[
96,
116
],
[
116,
117
],
[
117,
118
],
[
117,
119
],
[
119,
120
],
[
119,
121
],
[
116,
122
],
[
122,
123
],
[
123,
124
],
[
124,
125
],
[
125,
126
],
[
125,
127
],
[
123,
128
],
[
122,
129
],
[
129,
130
],
[
129,
131
],
[
80,
132
],
[
132,
133
],
[
133,
134
],
[
134,
135
],
[
134,
136
],
[
132,
137
],
[
8,
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
],
[
151,
153
],
[
150,
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
],
[
167,
169
],
[
169,
170
],
[
170,
171
],
[
170,
172
],
[
169,
173
],
[
150,
174
],
[
174,
175
],
[
175,
176
],
[
176,
177
],
[
176,
178
],
[
174,
179
],
[
179,
180
],
[
179,
181
],
[
8,
182
],
[
182,
183
],
[
183,
184
],
[
184,
185
],
[
184,
186
],
[
182,
187
],
[
6,
188
],
[
188,
189
],
[
0,
190
],
[
190,
191
],
[
190,
192
]
] | [
"import java.util.*;\n\npublic class Main {\n\n\tpublic static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\tint r = sc.nextInt();\n\t\tint c = sc.nextInt();\n\t\tint sum = 0;\n\t\tint sumsum = 0;\n\t\tint[][] matrix = 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\tmatrix[i][j] = sc.nextInt();\n\t\t\t}\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\tSystem.out.print(matrix[i][j] + \" \");\n\t\t\t\tsum += matrix[i][j];\n\t\t\t\tif (j == c - 1) {\n\t\t\t\t\tSystem.out.print(sum);\n\t\t\t\t\tsumsum += sum;\n\t\t\t\t}\n\t\t\t}\n\t\t\tSystem.out.println(\"\");\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 += matrix[j][i];\n\t\t\t}\n\t\t\tSystem.out.print(sum + \" \");\n\t\t}\n\t\tSystem.out.println(sumsum);\n\t}\n}",
"import java.util.*;",
"util.*",
"java",
"public class Main {\n\n\tpublic static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\tint r = sc.nextInt();\n\t\tint c = sc.nextInt();\n\t\tint sum = 0;\n\t\tint sumsum = 0;\n\t\tint[][] matrix = 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\tmatrix[i][j] = sc.nextInt();\n\t\t\t}\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\tSystem.out.print(matrix[i][j] + \" \");\n\t\t\t\tsum += matrix[i][j];\n\t\t\t\tif (j == c - 1) {\n\t\t\t\t\tSystem.out.print(sum);\n\t\t\t\t\tsumsum += sum;\n\t\t\t\t}\n\t\t\t}\n\t\t\tSystem.out.println(\"\");\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 += matrix[j][i];\n\t\t\t}\n\t\t\tSystem.out.print(sum + \" \");\n\t\t}\n\t\tSystem.out.println(sumsum);\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 sum = 0;\n\t\tint sumsum = 0;\n\t\tint[][] matrix = 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\tmatrix[i][j] = sc.nextInt();\n\t\t\t}\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\tSystem.out.print(matrix[i][j] + \" \");\n\t\t\t\tsum += matrix[i][j];\n\t\t\t\tif (j == c - 1) {\n\t\t\t\t\tSystem.out.print(sum);\n\t\t\t\t\tsumsum += sum;\n\t\t\t\t}\n\t\t\t}\n\t\t\tSystem.out.println(\"\");\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 += matrix[j][i];\n\t\t\t}\n\t\t\tSystem.out.print(sum + \" \");\n\t\t}\n\t\tSystem.out.println(sumsum);\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 sum = 0;\n\t\tint sumsum = 0;\n\t\tint[][] matrix = 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\tmatrix[i][j] = sc.nextInt();\n\t\t\t}\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\tSystem.out.print(matrix[i][j] + \" \");\n\t\t\t\tsum += matrix[i][j];\n\t\t\t\tif (j == c - 1) {\n\t\t\t\t\tSystem.out.print(sum);\n\t\t\t\t\tsumsum += sum;\n\t\t\t\t}\n\t\t\t}\n\t\t\tSystem.out.println(\"\");\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 += matrix[j][i];\n\t\t\t}\n\t\t\tSystem.out.print(sum + \" \");\n\t\t}\n\t\tSystem.out.println(sumsum);\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 sum = 0;",
"sum",
"0",
"int sumsum = 0;",
"sumsum",
"0",
"int[][] matrix = new int[r][c];",
"matrix",
"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\tmatrix[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\tmatrix[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\tmatrix[i][j] = sc.nextInt();\n\t\t\t}\n\t\t}",
"for (int j = 0; j < c; j++) {\n\t\t\t\tmatrix[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\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 < r; i++) {\n\t\t\tsum = 0;\n\t\t\tfor (int j = 0; j < c; j++) {\n\t\t\t\tSystem.out.print(matrix[i][j] + \" \");\n\t\t\t\tsum += matrix[i][j];\n\t\t\t\tif (j == c - 1) {\n\t\t\t\t\tSystem.out.print(sum);\n\t\t\t\t\tsumsum += 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 < 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\tSystem.out.print(matrix[i][j] + \" \");\n\t\t\t\tsum += matrix[i][j];\n\t\t\t\tif (j == c - 1) {\n\t\t\t\t\tSystem.out.print(sum);\n\t\t\t\t\tsumsum += sum;\n\t\t\t\t}\n\t\t\t}\n\t\t\tSystem.out.println(\"\");\n\t\t}",
"{\n\t\t\tsum = 0;\n\t\t\tfor (int j = 0; j < c; j++) {\n\t\t\t\tSystem.out.print(matrix[i][j] + \" \");\n\t\t\t\tsum += matrix[i][j];\n\t\t\t\tif (j == c - 1) {\n\t\t\t\t\tSystem.out.print(sum);\n\t\t\t\t\tsumsum += sum;\n\t\t\t\t}\n\t\t\t}\n\t\t\tSystem.out.println(\"\");\n\t\t}",
"sum = 0",
"sum",
"0",
"for (int j = 0; j < c; j++) {\n\t\t\t\tSystem.out.print(matrix[i][j] + \" \");\n\t\t\t\tsum += matrix[i][j];\n\t\t\t\tif (j == c - 1) {\n\t\t\t\t\tSystem.out.print(sum);\n\t\t\t\t\tsumsum += sum;\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\tSystem.out.print(matrix[i][j] + \" \");\n\t\t\t\tsum += matrix[i][j];\n\t\t\t\tif (j == c - 1) {\n\t\t\t\t\tSystem.out.print(sum);\n\t\t\t\t\tsumsum += sum;\n\t\t\t\t}\n\t\t\t}",
"{\n\t\t\t\tSystem.out.print(matrix[i][j] + \" \");\n\t\t\t\tsum += matrix[i][j];\n\t\t\t\tif (j == c - 1) {\n\t\t\t\t\tSystem.out.print(sum);\n\t\t\t\t\tsumsum += sum;\n\t\t\t\t}\n\t\t\t}",
"System.out.print(matrix[i][j] + \" \")",
"System.out.print",
"System.out",
"System",
"System.out",
"matrix[i][j] + \" \"",
"matrix[i][j]",
"matrix[i]",
"matrix",
"i",
"j",
"\" \"",
"sum += matrix[i][j]",
"sum",
"matrix[i][j]",
"matrix[i]",
"matrix",
"i",
"j",
"if (j == c - 1) {\n\t\t\t\t\tSystem.out.print(sum);\n\t\t\t\t\tsumsum += sum;\n\t\t\t\t}",
"j == c - 1",
"j",
"c - 1",
"c",
"1",
"{\n\t\t\t\t\tSystem.out.print(sum);\n\t\t\t\t\tsumsum += sum;\n\t\t\t\t}",
"System.out.print(sum)",
"System.out.print",
"System.out",
"System",
"System.out",
"sum",
"sumsum += sum",
"sumsum",
"sum",
"System.out.println(\"\")",
"System.out.println",
"System.out",
"System",
"System.out",
"\"\"",
"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 += matrix[j][i];\n\t\t\t}\n\t\t\tSystem.out.print(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 += matrix[j][i];\n\t\t\t}\n\t\t\tSystem.out.print(sum + \" \");\n\t\t}",
"{\n\t\t\tsum = 0;\n\t\t\tfor (int j = 0; j < r; j++) {\n\t\t\t\tsum += matrix[j][i];\n\t\t\t}\n\t\t\tSystem.out.print(sum + \" \");\n\t\t}",
"sum = 0",
"sum",
"0",
"for (int j = 0; j < r; j++) {\n\t\t\t\tsum += matrix[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 += matrix[j][i];\n\t\t\t}",
"{\n\t\t\t\tsum += matrix[j][i];\n\t\t\t}",
"sum += matrix[j][i]",
"sum",
"matrix[j][i]",
"matrix[j]",
"matrix",
"j",
"i",
"System.out.print(sum + \" \")",
"System.out.print",
"System.out",
"System",
"System.out",
"sum + \" \"",
"sum",
"\" \"",
"System.out.println(sumsum)",
"System.out.println",
"System.out",
"System",
"System.out",
"sumsum",
"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 r = sc.nextInt();\n\t\tint c = sc.nextInt();\n\t\tint sum = 0;\n\t\tint sumsum = 0;\n\t\tint[][] matrix = 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\tmatrix[i][j] = sc.nextInt();\n\t\t\t}\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\tSystem.out.print(matrix[i][j] + \" \");\n\t\t\t\tsum += matrix[i][j];\n\t\t\t\tif (j == c - 1) {\n\t\t\t\t\tSystem.out.print(sum);\n\t\t\t\t\tsumsum += sum;\n\t\t\t\t}\n\t\t\t}\n\t\t\tSystem.out.println(\"\");\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 += matrix[j][i];\n\t\t\t}\n\t\t\tSystem.out.print(sum + \" \");\n\t\t}\n\t\tSystem.out.println(sumsum);\n\t}\n}",
"public class Main {\n\n\tpublic static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\tint r = sc.nextInt();\n\t\tint c = sc.nextInt();\n\t\tint sum = 0;\n\t\tint sumsum = 0;\n\t\tint[][] matrix = 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\tmatrix[i][j] = sc.nextInt();\n\t\t\t}\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\tSystem.out.print(matrix[i][j] + \" \");\n\t\t\t\tsum += matrix[i][j];\n\t\t\t\tif (j == c - 1) {\n\t\t\t\t\tSystem.out.print(sum);\n\t\t\t\t\tsumsum += sum;\n\t\t\t\t}\n\t\t\t}\n\t\t\tSystem.out.println(\"\");\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 += matrix[j][i];\n\t\t\t}\n\t\t\tSystem.out.print(sum + \" \");\n\t\t}\n\t\tSystem.out.println(sumsum);\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 sum = 0;
int sumsum = 0;
int[][] matrix = new int[r][c];
for (int i = 0; i < r; i++) {
for (int j = 0; j < c; j++) {
matrix[i][j] = sc.nextInt();
}
}
for (int i = 0; i < r; i++) {
sum = 0;
for (int j = 0; j < c; j++) {
System.out.print(matrix[i][j] + " ");
sum += matrix[i][j];
if (j == c - 1) {
System.out.print(sum);
sumsum += sum;
}
}
System.out.println("");
}
for (int i = 0; i < c; i++) {
sum = 0;
for (int j = 0; j < r; j++) {
sum += matrix[j][i];
}
System.out.print(sum + " ");
}
System.out.println(sumsum);
}
} |
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
41,
13,
41,
13,
20,
17,
17,
41,
13,
41,
13,
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,
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,
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,
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
] | [
[
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,
21
],
[
21,
22
],
[
8,
23
],
[
23,
24
],
[
8,
25
],
[
25,
26
],
[
25,
27
],
[
27,
28
],
[
28,
29
],
[
8,
30
],
[
30,
31
],
[
30,
32
],
[
32,
33
],
[
33,
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
],
[
60,
70
],
[
70,
71
],
[
71,
72
],
[
72,
73
],
[
72,
74
],
[
71,
75
],
[
70,
76
],
[
76,
77
],
[
77,
78
],
[
77,
79
],
[
76,
80
],
[
8,
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
],
[
105,
106
],
[
106,
107
],
[
107,
108
],
[
108,
109
],
[
108,
110
],
[
107,
111
],
[
106,
112
],
[
112,
113
],
[
113,
114
],
[
113,
115
],
[
112,
116
],
[
93,
117
],
[
117,
118
],
[
118,
119
],
[
119,
120
],
[
119,
121
],
[
118,
122
],
[
117,
123
],
[
123,
124
],
[
124,
125
],
[
124,
126
],
[
123,
127
],
[
8,
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
],
[
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
],
[
155,
157
],
[
154,
158
],
[
158,
159
],
[
159,
160
],
[
160,
161
],
[
160,
162
],
[
158,
163
],
[
153,
164
],
[
164,
165
],
[
165,
166
],
[
166,
167
],
[
166,
168
],
[
164,
169
],
[
169,
170
],
[
170,
171
],
[
170,
172
],
[
169,
173
],
[
140,
174
],
[
174,
175
],
[
175,
176
],
[
176,
177
],
[
176,
178
],
[
6,
179
],
[
179,
180
]
] | [
"import java.util.Scanner;\n\nclass Main{\n\tpublic static void main(String[] args){\n\t\tScanner stdIn=new Scanner(System.in);\n\t\tint r,c,a[][]=new int[101][101],i,j;\n\t\tr=stdIn.nextInt();\n\t\tc=stdIn.nextInt();\n\t\tfor(i=0;i<r;i++){\n\t\t\tfor(j=0;j<c;j++){\n\t\t\t\ta[i][j]=stdIn.nextInt();\n\t\t\t\ta[i][c]+=a[i][j];\n\t\t\t}\n\t\t}\n\t\tfor(i=0;i<c;i++){\n\t\t\tfor(j=0;j<r;j++)a[r][i]+=a[j][i];\n\t\t\ta[r][c]+=a[r][i];\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!=0)System.out.print(\" \");\n\t\t\t\tSystem.out.print(a[i][j]);\n\t\t\t}\n\t\t\tSystem.out.println();\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 stdIn=new Scanner(System.in);\n\t\tint r,c,a[][]=new int[101][101],i,j;\n\t\tr=stdIn.nextInt();\n\t\tc=stdIn.nextInt();\n\t\tfor(i=0;i<r;i++){\n\t\t\tfor(j=0;j<c;j++){\n\t\t\t\ta[i][j]=stdIn.nextInt();\n\t\t\t\ta[i][c]+=a[i][j];\n\t\t\t}\n\t\t}\n\t\tfor(i=0;i<c;i++){\n\t\t\tfor(j=0;j<r;j++)a[r][i]+=a[j][i];\n\t\t\ta[r][c]+=a[r][i];\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!=0)System.out.print(\" \");\n\t\t\t\tSystem.out.print(a[i][j]);\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\tScanner stdIn=new Scanner(System.in);\n\t\tint r,c,a[][]=new int[101][101],i,j;\n\t\tr=stdIn.nextInt();\n\t\tc=stdIn.nextInt();\n\t\tfor(i=0;i<r;i++){\n\t\t\tfor(j=0;j<c;j++){\n\t\t\t\ta[i][j]=stdIn.nextInt();\n\t\t\t\ta[i][c]+=a[i][j];\n\t\t\t}\n\t\t}\n\t\tfor(i=0;i<c;i++){\n\t\t\tfor(j=0;j<r;j++)a[r][i]+=a[j][i];\n\t\t\ta[r][c]+=a[r][i];\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!=0)System.out.print(\" \");\n\t\t\t\tSystem.out.print(a[i][j]);\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}\n\t}",
"main",
"{\n\t\tScanner stdIn=new Scanner(System.in);\n\t\tint r,c,a[][]=new int[101][101],i,j;\n\t\tr=stdIn.nextInt();\n\t\tc=stdIn.nextInt();\n\t\tfor(i=0;i<r;i++){\n\t\t\tfor(j=0;j<c;j++){\n\t\t\t\ta[i][j]=stdIn.nextInt();\n\t\t\t\ta[i][c]+=a[i][j];\n\t\t\t}\n\t\t}\n\t\tfor(i=0;i<c;i++){\n\t\t\tfor(j=0;j<r;j++)a[r][i]+=a[j][i];\n\t\t\ta[r][c]+=a[r][i];\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!=0)System.out.print(\" \");\n\t\t\t\tSystem.out.print(a[i][j]);\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}\n\t}",
"Scanner stdIn=new Scanner(System.in);",
"stdIn",
"new Scanner(System.in)",
"int r",
"r",
"c",
"c",
"a[][]=new int[101][101]",
"a",
"new int[101][101]",
"101",
"101",
"i",
"i",
"j;",
"j",
"r=stdIn.nextInt()",
"r",
"stdIn.nextInt()",
"stdIn.nextInt",
"stdIn",
"c=stdIn.nextInt()",
"c",
"stdIn.nextInt()",
"stdIn.nextInt",
"stdIn",
"for(i=0;i<r;i++){\n\t\t\tfor(j=0;j<c;j++){\n\t\t\t\ta[i][j]=stdIn.nextInt();\n\t\t\t\ta[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]=stdIn.nextInt();\n\t\t\t\ta[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]=stdIn.nextInt();\n\t\t\t\ta[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]=stdIn.nextInt();\n\t\t\t\ta[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]=stdIn.nextInt();\n\t\t\t\ta[i][c]+=a[i][j];\n\t\t\t}",
"{\n\t\t\t\ta[i][j]=stdIn.nextInt();\n\t\t\t\ta[i][c]+=a[i][j];\n\t\t\t}",
"a[i][j]=stdIn.nextInt()",
"a[i][j]",
"a[i]",
"a",
"i",
"j",
"stdIn.nextInt()",
"stdIn.nextInt",
"stdIn",
"a[i][c]+=a[i][j]",
"a[i][c]",
"a[i]",
"a",
"i",
"c",
"a[i][j]",
"a[i]",
"a",
"i",
"j",
"for(i=0;i<c;i++){\n\t\t\tfor(j=0;j<r;j++)a[r][i]+=a[j][i];\n\t\t\ta[r][c]+=a[r][i];\n\t\t}",
"i=0;",
"i=0",
"i",
"0",
"i<c",
"i",
"c",
"i++",
"i++",
"i",
"{\n\t\t\tfor(j=0;j<r;j++)a[r][i]+=a[j][i];\n\t\t\ta[r][c]+=a[r][i];\n\t\t}",
"{\n\t\t\tfor(j=0;j<r;j++)a[r][i]+=a[j][i];\n\t\t\ta[r][c]+=a[r][i];\n\t\t}",
"for(j=0;j<r;j++)a[r][i]+=a[j][i];",
"j=0;",
"j=0",
"j",
"0",
"j<r",
"j",
"r",
"j++",
"j++",
"j",
"a[r][i]+=a[j][i];",
"a[r][i]+=a[j][i]",
"a[r][i]",
"a[r]",
"a",
"r",
"i",
"a[j][i]",
"a[j]",
"a",
"j",
"i",
"a[r][c]+=a[r][i]",
"a[r][c]",
"a[r]",
"a",
"r",
"c",
"a[r][i]",
"a[r]",
"a",
"r",
"i",
"for(i=0;i<=r;i++){\n\t\t\tfor(j=0;j<=c;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\tSystem.out.println();\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!=0)System.out.print(\" \");\n\t\t\t\tSystem.out.print(a[i][j]);\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}",
"{\n\t\t\tfor(j=0;j<=c;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\tSystem.out.println();\n\t\t}",
"for(j=0;j<=c;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}",
"j=0;",
"j=0",
"j",
"0",
"j<=c",
"j",
"c",
"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",
"String[] args",
"args"
] | import java.util.Scanner;
class Main{
public static void main(String[] args){
Scanner stdIn=new Scanner(System.in);
int r,c,a[][]=new int[101][101],i,j;
r=stdIn.nextInt();
c=stdIn.nextInt();
for(i=0;i<r;i++){
for(j=0;j<c;j++){
a[i][j]=stdIn.nextInt();
a[i][c]+=a[i][j];
}
}
for(i=0;i<c;i++){
for(j=0;j<r;j++)a[r][i]+=a[j][i];
a[r][c]+=a[r][i];
}
for(i=0;i<=r;i++){
for(j=0;j<=c;j++){
if(j!=0)System.out.print(" ");
System.out.print(a[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,
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,
4,
18,
18,
13,
13,
17,
18,
18,
13,
13,
13,
0,
13,
18,
18,
13,
13,
13,
4,
18,
18,
13,
13,
17,
13,
0,
13,
17,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
18,
18,
13,
13,
13,
0,
13,
13,
4,
18,
18,
13,
13,
17,
13,
0,
13,
17,
4,
18,
18,
13,
13,
17,
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
],
[
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
],
[
95,
100
],
[
95,
101
],
[
101,
102
],
[
102,
103
],
[
102,
104
],
[
101,
105
],
[
94,
106
],
[
106,
107
],
[
106,
108
],
[
108,
109
],
[
109,
110
],
[
109,
111
],
[
108,
112
],
[
81,
113
],
[
113,
114
],
[
114,
115
],
[
115,
116
],
[
115,
117
],
[
113,
118
],
[
113,
119
],
[
81,
120
],
[
120,
121
],
[
120,
122
],
[
8,
123
],
[
123,
124
],
[
123,
125
],
[
8,
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
],
[
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
],
[
138,
159
],
[
159,
160
],
[
159,
161
],
[
138,
162
],
[
162,
163
],
[
163,
164
],
[
164,
165
],
[
164,
166
],
[
162,
167
],
[
162,
168
],
[
138,
169
],
[
169,
170
],
[
169,
171
],
[
8,
172
],
[
172,
173
],
[
173,
174
],
[
174,
175
],
[
174,
176
],
[
172,
177
],
[
172,
178
],
[
6,
179
],
[
179,
180
],
[
0,
181
],
[
181,
182
],
[
181,
183
]
] | [
"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 r = sc.nextInt();\n\t\tint c = sc.nextInt();\n\t\tint [][] cell = new int[r+1][c+1];\n\t\tint sum1 = 0;\n\t\tfor(int i=0; i<r; i++) {\n\t\t\tfor(int j=0; j<c; j++) {\n\t\t\t\tcell[i][j] = sc.nextInt();\n\t\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\tSystem.out.printf(\"%d \", cell[i][j]);\n\t\t\t\tsum1 += cell[i][j];\n\t\t\t}\n\t\t\tSystem.out.printf(\"%d\\n\", sum1);\n\t\t\tsum1 = 0;\n\t\t}\n\t\tint sum2 = 0;\n\t\tfor(int i=0; i<c; i++) {\n\t\t\tfor(int j=0; j<r; j++) {\n\t\t\t\tsum1 += cell[j][i];\n\t\t\t}\n\t\t\tsum2 += sum1;\n\t\t\tSystem.out.printf(\"%d \", sum1);\n\t\t\tsum1 = 0;\n\t\t}\n\t\tSystem.out.printf(\"%d\\n\",sum2);\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 r = sc.nextInt();\n\t\tint c = sc.nextInt();\n\t\tint [][] cell = new int[r+1][c+1];\n\t\tint sum1 = 0;\n\t\tfor(int i=0; i<r; i++) {\n\t\t\tfor(int j=0; j<c; j++) {\n\t\t\t\tcell[i][j] = sc.nextInt();\n\t\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\tSystem.out.printf(\"%d \", cell[i][j]);\n\t\t\t\tsum1 += cell[i][j];\n\t\t\t}\n\t\t\tSystem.out.printf(\"%d\\n\", sum1);\n\t\t\tsum1 = 0;\n\t\t}\n\t\tint sum2 = 0;\n\t\tfor(int i=0; i<c; i++) {\n\t\t\tfor(int j=0; j<r; j++) {\n\t\t\t\tsum1 += cell[j][i];\n\t\t\t}\n\t\t\tsum2 += sum1;\n\t\t\tSystem.out.printf(\"%d \", sum1);\n\t\t\tsum1 = 0;\n\t\t}\n\t\tSystem.out.printf(\"%d\\n\",sum2);\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 [][] cell = new int[r+1][c+1];\n\t\tint sum1 = 0;\n\t\tfor(int i=0; i<r; i++) {\n\t\t\tfor(int j=0; j<c; j++) {\n\t\t\t\tcell[i][j] = sc.nextInt();\n\t\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\tSystem.out.printf(\"%d \", cell[i][j]);\n\t\t\t\tsum1 += cell[i][j];\n\t\t\t}\n\t\t\tSystem.out.printf(\"%d\\n\", sum1);\n\t\t\tsum1 = 0;\n\t\t}\n\t\tint sum2 = 0;\n\t\tfor(int i=0; i<c; i++) {\n\t\t\tfor(int j=0; j<r; j++) {\n\t\t\t\tsum1 += cell[j][i];\n\t\t\t}\n\t\t\tsum2 += sum1;\n\t\t\tSystem.out.printf(\"%d \", sum1);\n\t\t\tsum1 = 0;\n\t\t}\n\t\tSystem.out.printf(\"%d\\n\",sum2);\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 [][] cell = new int[r+1][c+1];\n\t\tint sum1 = 0;\n\t\tfor(int i=0; i<r; i++) {\n\t\t\tfor(int j=0; j<c; j++) {\n\t\t\t\tcell[i][j] = sc.nextInt();\n\t\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\tSystem.out.printf(\"%d \", cell[i][j]);\n\t\t\t\tsum1 += cell[i][j];\n\t\t\t}\n\t\t\tSystem.out.printf(\"%d\\n\", sum1);\n\t\t\tsum1 = 0;\n\t\t}\n\t\tint sum2 = 0;\n\t\tfor(int i=0; i<c; i++) {\n\t\t\tfor(int j=0; j<r; j++) {\n\t\t\t\tsum1 += cell[j][i];\n\t\t\t}\n\t\t\tsum2 += sum1;\n\t\t\tSystem.out.printf(\"%d \", sum1);\n\t\t\tsum1 = 0;\n\t\t}\n\t\tSystem.out.printf(\"%d\\n\",sum2);\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 [][] cell = new int[r+1][c+1];",
"cell",
"new int[r+1][c+1]",
"r+1",
"r",
"1",
"c+1",
"c",
"1",
"int sum1 = 0;",
"sum1",
"0",
"for(int i=0; i<r; i++) {\n\t\t\tfor(int j=0; j<c; j++) {\n\t\t\t\tcell[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\tcell[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\tcell[i][j] = sc.nextInt();\n\t\t\t}\n\t\t}",
"for(int j=0; j<c; j++) {\n\t\t\t\tcell[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\tcell[i][j] = sc.nextInt();\n\t\t\t}",
"{\n\t\t\t\tcell[i][j] = sc.nextInt();\n\t\t\t}",
"cell[i][j] = sc.nextInt()",
"cell[i][j]",
"cell[i]",
"cell",
"i",
"j",
"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\tSystem.out.printf(\"%d \", cell[i][j]);\n\t\t\t\tsum1 += cell[i][j];\n\t\t\t}\n\t\t\tSystem.out.printf(\"%d\\n\", sum1);\n\t\t\tsum1 = 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\tSystem.out.printf(\"%d \", cell[i][j]);\n\t\t\t\tsum1 += cell[i][j];\n\t\t\t}\n\t\t\tSystem.out.printf(\"%d\\n\", sum1);\n\t\t\tsum1 = 0;\n\t\t}",
"{\n\t\t\tfor(int j=0; j<c; j++) {\n\t\t\t\tSystem.out.printf(\"%d \", cell[i][j]);\n\t\t\t\tsum1 += cell[i][j];\n\t\t\t}\n\t\t\tSystem.out.printf(\"%d\\n\", sum1);\n\t\t\tsum1 = 0;\n\t\t}",
"for(int j=0; j<c; j++) {\n\t\t\t\tSystem.out.printf(\"%d \", cell[i][j]);\n\t\t\t\tsum1 += cell[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.printf(\"%d \", cell[i][j]);\n\t\t\t\tsum1 += cell[i][j];\n\t\t\t}",
"{\n\t\t\t\tSystem.out.printf(\"%d \", cell[i][j]);\n\t\t\t\tsum1 += cell[i][j];\n\t\t\t}",
"System.out.printf(\"%d \", cell[i][j])",
"System.out.printf",
"System.out",
"System",
"System.out",
"\"%d \"",
"cell[i][j]",
"cell[i]",
"cell",
"i",
"j",
"sum1 += cell[i][j]",
"sum1",
"cell[i][j]",
"cell[i]",
"cell",
"i",
"j",
"System.out.printf(\"%d\\n\", sum1)",
"System.out.printf",
"System.out",
"System",
"System.out",
"\"%d\\n\"",
"sum1",
"sum1 = 0",
"sum1",
"0",
"int sum2 = 0;",
"sum2",
"0",
"for(int i=0; i<c; i++) {\n\t\t\tfor(int j=0; j<r; j++) {\n\t\t\t\tsum1 += cell[j][i];\n\t\t\t}\n\t\t\tsum2 += sum1;\n\t\t\tSystem.out.printf(\"%d \", sum1);\n\t\t\tsum1 = 0;\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\tsum1 += cell[j][i];\n\t\t\t}\n\t\t\tsum2 += sum1;\n\t\t\tSystem.out.printf(\"%d \", sum1);\n\t\t\tsum1 = 0;\n\t\t}",
"{\n\t\t\tfor(int j=0; j<r; j++) {\n\t\t\t\tsum1 += cell[j][i];\n\t\t\t}\n\t\t\tsum2 += sum1;\n\t\t\tSystem.out.printf(\"%d \", sum1);\n\t\t\tsum1 = 0;\n\t\t}",
"for(int j=0; j<r; j++) {\n\t\t\t\tsum1 += cell[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\tsum1 += cell[j][i];\n\t\t\t}",
"{\n\t\t\t\tsum1 += cell[j][i];\n\t\t\t}",
"sum1 += cell[j][i]",
"sum1",
"cell[j][i]",
"cell[j]",
"cell",
"j",
"i",
"sum2 += sum1",
"sum2",
"sum1",
"System.out.printf(\"%d \", sum1)",
"System.out.printf",
"System.out",
"System",
"System.out",
"\"%d \"",
"sum1",
"sum1 = 0",
"sum1",
"0",
"System.out.printf(\"%d\\n\",sum2)",
"System.out.printf",
"System.out",
"System",
"System.out",
"\"%d\\n\"",
"sum2",
"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 r = sc.nextInt();\n\t\tint c = sc.nextInt();\n\t\tint [][] cell = new int[r+1][c+1];\n\t\tint sum1 = 0;\n\t\tfor(int i=0; i<r; i++) {\n\t\t\tfor(int j=0; j<c; j++) {\n\t\t\t\tcell[i][j] = sc.nextInt();\n\t\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\tSystem.out.printf(\"%d \", cell[i][j]);\n\t\t\t\tsum1 += cell[i][j];\n\t\t\t}\n\t\t\tSystem.out.printf(\"%d\\n\", sum1);\n\t\t\tsum1 = 0;\n\t\t}\n\t\tint sum2 = 0;\n\t\tfor(int i=0; i<c; i++) {\n\t\t\tfor(int j=0; j<r; j++) {\n\t\t\t\tsum1 += cell[j][i];\n\t\t\t}\n\t\t\tsum2 += sum1;\n\t\t\tSystem.out.printf(\"%d \", sum1);\n\t\t\tsum1 = 0;\n\t\t}\n\t\tSystem.out.printf(\"%d\\n\",sum2);\n\t}\n}",
"public class Main {\n\n\tpublic static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\tint r = sc.nextInt();\n\t\tint c = sc.nextInt();\n\t\tint [][] cell = new int[r+1][c+1];\n\t\tint sum1 = 0;\n\t\tfor(int i=0; i<r; i++) {\n\t\t\tfor(int j=0; j<c; j++) {\n\t\t\t\tcell[i][j] = sc.nextInt();\n\t\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\tSystem.out.printf(\"%d \", cell[i][j]);\n\t\t\t\tsum1 += cell[i][j];\n\t\t\t}\n\t\t\tSystem.out.printf(\"%d\\n\", sum1);\n\t\t\tsum1 = 0;\n\t\t}\n\t\tint sum2 = 0;\n\t\tfor(int i=0; i<c; i++) {\n\t\t\tfor(int j=0; j<r; j++) {\n\t\t\t\tsum1 += cell[j][i];\n\t\t\t}\n\t\t\tsum2 += sum1;\n\t\t\tSystem.out.printf(\"%d \", sum1);\n\t\t\tsum1 = 0;\n\t\t}\n\t\tSystem.out.printf(\"%d\\n\",sum2);\n\t}\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 [][] cell = new int[r+1][c+1];
int sum1 = 0;
for(int i=0; i<r; i++) {
for(int j=0; j<c; j++) {
cell[i][j] = sc.nextInt();
}
}
for(int i=0; i<r; i++) {
for(int j=0; j<c; j++) {
System.out.printf("%d ", cell[i][j]);
sum1 += cell[i][j];
}
System.out.printf("%d\n", sum1);
sum1 = 0;
}
int sum2 = 0;
for(int i=0; i<c; i++) {
for(int j=0; j<r; j++) {
sum1 += cell[j][i];
}
sum2 += sum1;
System.out.printf("%d ", sum1);
sum1 = 0;
}
System.out.printf("%d\n",sum2);
}
}
|
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
4,
13,
23,
13,
12,
13,
30,
41,
13,
4,
18,
13,
13,
41,
13,
2,
2,
13,
13,
13,
29,
13,
23,
13,
12,
13,
30,
41,
13,
20,
41,
13,
38,
5,
13,
30,
4,
18,
13,
30,
38,
5,
13,
30,
4,
18,
13,
30,
4,
18,
13,
30,
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,
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,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
201,
5
],
[
201,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
6,
11
],
[
11,
12
],
[
201,
13
],
[
13,
14
],
[
13,
15
],
[
15,
16
],
[
16,
17
],
[
16,
18
],
[
18,
19
],
[
19,
20
],
[
18,
21
],
[
15,
22
],
[
22,
23
],
[
22,
24
],
[
25,
25
],
[
25,
26
],
[
25,
27
],
[
25,
28
],
[
15,
29
],
[
29,
30
],
[
13,
31
],
[
31,
32
],
[
201,
33
],
[
33,
34
],
[
33,
35
],
[
35,
36
],
[
36,
37
],
[
36,
38
],
[
35,
39
],
[
39,
40
],
[
35,
41
],
[
41,
42
],
[
42,
43
],
[
42,
44
],
[
44,
45
],
[
45,
46
],
[
46,
47
],
[
41,
48
],
[
48,
49
],
[
49,
50
],
[
50,
51
],
[
50,
52
],
[
52,
53
],
[
53,
54
],
[
54,
55
],
[
49,
56
],
[
56,
57
],
[
57,
58
],
[
58,
59
],
[
41,
60
],
[
60,
61
],
[
61,
62
],
[
61,
63
],
[
63,
64
],
[
64,
65
],
[
65,
66
],
[
66,
67
],
[
63,
68
],
[
60,
69
],
[
69,
70
],
[
69,
71
],
[
71,
72
],
[
72,
73
],
[
71,
74
],
[
74,
75
],
[
74,
76
],
[
60,
77
],
[
77,
78
],
[
77,
79
],
[
79,
80
],
[
80,
81
],
[
79,
82
],
[
82,
83
],
[
82,
84
],
[
60,
85
],
[
85,
86
],
[
85,
87
],
[
60,
88
],
[
88,
89
],
[
60,
90
],
[
90,
91
],
[
60,
92
],
[
92,
93
],
[
92,
94
],
[
60,
95
],
[
95,
96
],
[
60,
97
],
[
97,
98
],
[
97,
99
],
[
60,
101
],
[
101,
102
],
[
102,
103
],
[
103,
104
],
[
103,
105
],
[
101,
106
],
[
106,
107
],
[
106,
108
],
[
101,
109
],
[
109,
110
],
[
110,
111
],
[
101,
112
],
[
113,
113
],
[
113,
114
],
[
114,
115
],
[
114,
116
],
[
116,
117
],
[
117,
118
],
[
113,
119
],
[
119,
120
],
[
119,
121
],
[
121,
122
],
[
122,
123
],
[
121,
124
],
[
113,
125
],
[
125,
126
],
[
125,
127
],
[
113,
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
],
[
141,
143
],
[
143,
144
],
[
144,
145
],
[
143,
146
],
[
146,
147
],
[
146,
148
],
[
140,
149
],
[
149,
150
],
[
149,
151
],
[
140,
152
],
[
152,
153
],
[
153,
154
],
[
153,
155
],
[
152,
156
],
[
113,
157
],
[
157,
158
],
[
157,
159
],
[
113,
160
],
[
160,
161
],
[
161,
162
],
[
160,
163
],
[
165,
164
],
[
164,
165
],
[
165,
166
],
[
165,
167
],
[
164,
168
],
[
165,
169
],
[
60,
170
],
[
170,
171
],
[
171,
172
],
[
172,
173
],
[
172,
174
],
[
170,
175
],
[
175,
176
],
[
175,
177
],
[
170,
178
],
[
178,
179
],
[
179,
180
],
[
170,
181
],
[
181,
182
],
[
182,
183
],
[
183,
184
],
[
182,
185
],
[
185,
186
],
[
186,
187
],
[
186,
188
],
[
185,
189
],
[
60,
190
],
[
190,
191
],
[
191,
192
],
[
190,
193
],
[
60,
194
],
[
194,
195
],
[
195,
196
],
[
196,
197
],
[
196,
198
],
[
194,
199
],
[
0,
200
],
[
200,
201
],
[
200,
202
]
] | [
"import java.io.*;\n\npublic class Main {\n public static void main(String[] args){\n test2_1();\n\n }\n\n private static int test1_1(String i){\n int num = Integer.parseInt(i);\n int three_num = num*num*num;\n return three_num;\n }\n\n private static void test2_1(){\n BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));\n //String word;\n String[] dat;\n try {\n //word = reader.readLine();\n dat = reader.readLine().split(\" \");\n int r = Integer.parseInt(dat[0]);\n int c = Integer.parseInt(dat[1]);\n StringBuilder out=new StringBuilder();\n int g,p,gg=0;\n String str;\n int[] SumC=new int[c];\n for (int i=0;i<r;i++){\n str =reader.readLine();\n dat = str.split(\" \");\n g=0;\n for (int j=0;j<c;j++){\n p=Integer.parseInt(dat[j]);\n g += p;\n SumC[j] += p;\n }\n gg+=g;\n out.append(str+\" \"+g+\"\\n\");\n }\n for (int j=0;j<c;j++) out.append(SumC[j]+\" \");\n out.append(gg);\n System.out.println(out);\n } catch (IOException e) {\n e.printStackTrace();\n } finally {\n try {\n reader.close();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n\n }\n}",
"import java.io.*;",
"io.*",
"java",
"public class Main {\n public static void main(String[] args){\n test2_1();\n\n }\n\n private static int test1_1(String i){\n int num = Integer.parseInt(i);\n int three_num = num*num*num;\n return three_num;\n }\n\n private static void test2_1(){\n BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));\n //String word;\n String[] dat;\n try {\n //word = reader.readLine();\n dat = reader.readLine().split(\" \");\n int r = Integer.parseInt(dat[0]);\n int c = Integer.parseInt(dat[1]);\n StringBuilder out=new StringBuilder();\n int g,p,gg=0;\n String str;\n int[] SumC=new int[c];\n for (int i=0;i<r;i++){\n str =reader.readLine();\n dat = str.split(\" \");\n g=0;\n for (int j=0;j<c;j++){\n p=Integer.parseInt(dat[j]);\n g += p;\n SumC[j] += p;\n }\n gg+=g;\n out.append(str+\" \"+g+\"\\n\");\n }\n for (int j=0;j<c;j++) out.append(SumC[j]+\" \");\n out.append(gg);\n System.out.println(out);\n } catch (IOException e) {\n e.printStackTrace();\n } finally {\n try {\n reader.close();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n\n }\n}",
"Main",
"public static void main(String[] args){\n test2_1();\n\n }",
"main",
"{\n test2_1();\n\n }",
"test2_1()",
"test2_1",
"String[] args",
"args",
"private static int test1_1(String i){\n int num = Integer.parseInt(i);\n int three_num = num*num*num;\n return three_num;\n }",
"test1_1",
"{\n int num = Integer.parseInt(i);\n int three_num = num*num*num;\n return three_num;\n }",
"int num = Integer.parseInt(i);",
"num",
"Integer.parseInt(i)",
"Integer.parseInt",
"Integer",
"i",
"int three_num = num*num*num;",
"three_num",
"num*num*num",
"num*num*num",
"num",
"num",
"num",
"return three_num;",
"three_num",
"String i",
"i",
"private static void test2_1(){\n BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));\n //String word;\n String[] dat;\n try {\n //word = reader.readLine();\n dat = reader.readLine().split(\" \");\n int r = Integer.parseInt(dat[0]);\n int c = Integer.parseInt(dat[1]);\n StringBuilder out=new StringBuilder();\n int g,p,gg=0;\n String str;\n int[] SumC=new int[c];\n for (int i=0;i<r;i++){\n str =reader.readLine();\n dat = str.split(\" \");\n g=0;\n for (int j=0;j<c;j++){\n p=Integer.parseInt(dat[j]);\n g += p;\n SumC[j] += p;\n }\n gg+=g;\n out.append(str+\" \"+g+\"\\n\");\n }\n for (int j=0;j<c;j++) out.append(SumC[j]+\" \");\n out.append(gg);\n System.out.println(out);\n } catch (IOException e) {\n e.printStackTrace();\n } finally {\n try {\n reader.close();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n\n }",
"test2_1",
"{\n BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));\n //String word;\n String[] dat;\n try {\n //word = reader.readLine();\n dat = reader.readLine().split(\" \");\n int r = Integer.parseInt(dat[0]);\n int c = Integer.parseInt(dat[1]);\n StringBuilder out=new StringBuilder();\n int g,p,gg=0;\n String str;\n int[] SumC=new int[c];\n for (int i=0;i<r;i++){\n str =reader.readLine();\n dat = str.split(\" \");\n g=0;\n for (int j=0;j<c;j++){\n p=Integer.parseInt(dat[j]);\n g += p;\n SumC[j] += p;\n }\n gg+=g;\n out.append(str+\" \"+g+\"\\n\");\n }\n for (int j=0;j<c;j++) out.append(SumC[j]+\" \");\n out.append(gg);\n System.out.println(out);\n } catch (IOException e) {\n e.printStackTrace();\n } finally {\n try {\n reader.close();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n\n }",
"BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));",
"reader",
"new BufferedReader(new InputStreamReader(System.in))",
"String[] dat;",
"dat",
"try {\n //word = reader.readLine();\n dat = reader.readLine().split(\" \");\n int r = Integer.parseInt(dat[0]);\n int c = Integer.parseInt(dat[1]);\n StringBuilder out=new StringBuilder();\n int g,p,gg=0;\n String str;\n int[] SumC=new int[c];\n for (int i=0;i<r;i++){\n str =reader.readLine();\n dat = str.split(\" \");\n g=0;\n for (int j=0;j<c;j++){\n p=Integer.parseInt(dat[j]);\n g += p;\n SumC[j] += p;\n }\n gg+=g;\n out.append(str+\" \"+g+\"\\n\");\n }\n for (int j=0;j<c;j++) out.append(SumC[j]+\" \");\n out.append(gg);\n System.out.println(out);\n } catch (IOException e) {\n e.printStackTrace();\n } finally {\n try {\n reader.close();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }",
"catch (IOException e) {\n e.printStackTrace();\n }",
"IOException e",
"{\n e.printStackTrace();\n }",
"e.printStackTrace()",
"e.printStackTrace",
"e",
"{\n try {\n reader.close();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }",
"try {\n reader.close();\n } catch (IOException e) {\n e.printStackTrace();\n }",
"catch (IOException e) {\n e.printStackTrace();\n }",
"IOException e",
"{\n e.printStackTrace();\n }",
"e.printStackTrace()",
"e.printStackTrace",
"e",
"{\n reader.close();\n }",
"reader.close()",
"reader.close",
"reader",
"{\n //word = reader.readLine();\n dat = reader.readLine().split(\" \");\n int r = Integer.parseInt(dat[0]);\n int c = Integer.parseInt(dat[1]);\n StringBuilder out=new StringBuilder();\n int g,p,gg=0;\n String str;\n int[] SumC=new int[c];\n for (int i=0;i<r;i++){\n str =reader.readLine();\n dat = str.split(\" \");\n g=0;\n for (int j=0;j<c;j++){\n p=Integer.parseInt(dat[j]);\n g += p;\n SumC[j] += p;\n }\n gg+=g;\n out.append(str+\" \"+g+\"\\n\");\n }\n for (int j=0;j<c;j++) out.append(SumC[j]+\" \");\n out.append(gg);\n System.out.println(out);\n }",
"dat = reader.readLine().split(\" \")",
"dat",
"reader.readLine().split(\" \")",
"reader.readLine().split",
"reader.readLine()",
"reader.readLine",
"reader",
"\" \"",
"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 str =reader.readLine();\n dat = str.split(\" \");\n g=0;\n for (int j=0;j<c;j++){\n p=Integer.parseInt(dat[j]);\n g += p;\n SumC[j] += p;\n }\n gg+=g;\n out.append(str+\" \"+g+\"\\n\");\n }",
"int i=0;",
"int i=0;",
"i",
"0",
"i<r",
"i",
"r",
"i++",
"i++",
"i",
"{\n str =reader.readLine();\n dat = str.split(\" \");\n g=0;\n for (int j=0;j<c;j++){\n p=Integer.parseInt(dat[j]);\n g += p;\n SumC[j] += p;\n }\n gg+=g;\n out.append(str+\" \"+g+\"\\n\");\n }",
"{\n str =reader.readLine();\n dat = str.split(\" \");\n g=0;\n for (int j=0;j<c;j++){\n p=Integer.parseInt(dat[j]);\n g += p;\n SumC[j] += p;\n }\n gg+=g;\n out.append(str+\" \"+g+\"\\n\");\n }",
"str =reader.readLine()",
"str",
"reader.readLine()",
"reader.readLine",
"reader",
"dat = str.split(\" \")",
"dat",
"str.split(\" \")",
"str.split",
"str",
"\" \"",
"g=0",
"g",
"0",
"for (int j=0;j<c;j++){\n p=Integer.parseInt(dat[j]);\n g += p;\n SumC[j] += p;\n }",
"int j=0;",
"int j=0;",
"j",
"0",
"j<c",
"j",
"c",
"j++",
"j++",
"j",
"{\n p=Integer.parseInt(dat[j]);\n g += p;\n SumC[j] += p;\n }",
"{\n p=Integer.parseInt(dat[j]);\n g += p;\n SumC[j] += p;\n }",
"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",
"public class Main {\n public static void main(String[] args){\n test2_1();\n\n }\n\n private static int test1_1(String i){\n int num = Integer.parseInt(i);\n int three_num = num*num*num;\n return three_num;\n }\n\n private static void test2_1(){\n BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));\n //String word;\n String[] dat;\n try {\n //word = reader.readLine();\n dat = reader.readLine().split(\" \");\n int r = Integer.parseInt(dat[0]);\n int c = Integer.parseInt(dat[1]);\n StringBuilder out=new StringBuilder();\n int g,p,gg=0;\n String str;\n int[] SumC=new int[c];\n for (int i=0;i<r;i++){\n str =reader.readLine();\n dat = str.split(\" \");\n g=0;\n for (int j=0;j<c;j++){\n p=Integer.parseInt(dat[j]);\n g += p;\n SumC[j] += p;\n }\n gg+=g;\n out.append(str+\" \"+g+\"\\n\");\n }\n for (int j=0;j<c;j++) out.append(SumC[j]+\" \");\n out.append(gg);\n System.out.println(out);\n } catch (IOException e) {\n e.printStackTrace();\n } finally {\n try {\n reader.close();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n\n }\n}",
"public class Main {\n public static void main(String[] args){\n test2_1();\n\n }\n\n private static int test1_1(String i){\n int num = Integer.parseInt(i);\n int three_num = num*num*num;\n return three_num;\n }\n\n private static void test2_1(){\n BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));\n //String word;\n String[] dat;\n try {\n //word = reader.readLine();\n dat = reader.readLine().split(\" \");\n int r = Integer.parseInt(dat[0]);\n int c = Integer.parseInt(dat[1]);\n StringBuilder out=new StringBuilder();\n int g,p,gg=0;\n String str;\n int[] SumC=new int[c];\n for (int i=0;i<r;i++){\n str =reader.readLine();\n dat = str.split(\" \");\n g=0;\n for (int j=0;j<c;j++){\n p=Integer.parseInt(dat[j]);\n g += p;\n SumC[j] += p;\n }\n gg+=g;\n out.append(str+\" \"+g+\"\\n\");\n }\n for (int j=0;j<c;j++) out.append(SumC[j]+\" \");\n out.append(gg);\n System.out.println(out);\n } catch (IOException e) {\n e.printStackTrace();\n } finally {\n try {\n reader.close();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n\n }\n}",
"Main"
] | import java.io.*;
public class Main {
public static void main(String[] args){
test2_1();
}
private static int test1_1(String i){
int num = Integer.parseInt(i);
int three_num = num*num*num;
return three_num;
}
private static void test2_1(){
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
//String word;
String[] dat;
try {
//word = reader.readLine();
dat = reader.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 =reader.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);
} catch (IOException e) {
e.printStackTrace();
} finally {
try {
reader.close();
} catch (IOException e) {
e.printStackTrace();
}
}
}
} |
[
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,
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,
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,
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
],
[
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
],
[
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
],
[
97,
109
],
[
109,
110
],
[
110,
111
],
[
111,
112
],
[
111,
113
],
[
110,
114
],
[
109,
115
],
[
115,
116
],
[
116,
117
],
[
116,
118
],
[
115,
119
],
[
97,
120
],
[
120,
121
],
[
121,
122
],
[
122,
123
],
[
122,
124
],
[
121,
125
],
[
120,
126
],
[
126,
127
],
[
127,
128
],
[
127,
129
],
[
126,
130
],
[
8,
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
],
[
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
],
[
162,
164
],
[
161,
165
],
[
165,
166
],
[
166,
167
],
[
167,
168
],
[
168,
169
],
[
168,
170
],
[
166,
171
],
[
171,
172
],
[
172,
173
],
[
173,
174
],
[
173,
175
],
[
172,
176
],
[
171,
177
],
[
161,
178
],
[
178,
179
],
[
179,
180
],
[
180,
181
],
[
181,
182
],
[
181,
183
],
[
179,
184
],
[
184,
185
],
[
185,
186
],
[
185,
187
],
[
184,
188
],
[
6,
189
],
[
189,
190
],
[
0,
191
],
[
191,
192
],
[
191,
193
]
] | [
"import java.util.*;\npublic class Main {\npublic static void main(String[] args){\nScanner sc = new Scanner(System.in);\nint r=Integer.parseInt(sc.next());\nint c=Integer.parseInt(sc.next());\nint[][] rc=new int[r+1][c+1];\nfor(int i=0;i<r;i++){\n for(int j=0;j<c;j++){\n rc[i][j]=sc.nextInt();\n \n }\n}\nfor(int i=0;i<r;i++){\n for(int j=0;j<c;j++){\n rc[i][c]+=rc[i][j];\n rc[r][j]+=rc[i][j];\n rc[r][c]+=rc[i][j];\n }\n}\n\nfor(int j=0;j<r+1;j++){\n for(int i=0;i<c+1;i++){\n if(i!=c){System.out.print(rc[j][i]+\" \");}else{System.out.println(rc[j][i]);}\n }\n}\n\n}\n}",
"import java.util.*;",
"util.*",
"java",
"public class Main {\npublic static void main(String[] args){\nScanner sc = new Scanner(System.in);\nint r=Integer.parseInt(sc.next());\nint c=Integer.parseInt(sc.next());\nint[][] rc=new int[r+1][c+1];\nfor(int i=0;i<r;i++){\n for(int j=0;j<c;j++){\n rc[i][j]=sc.nextInt();\n \n }\n}\nfor(int i=0;i<r;i++){\n for(int j=0;j<c;j++){\n rc[i][c]+=rc[i][j];\n rc[r][j]+=rc[i][j];\n rc[r][c]+=rc[i][j];\n }\n}\n\nfor(int j=0;j<r+1;j++){\n for(int i=0;i<c+1;i++){\n if(i!=c){System.out.print(rc[j][i]+\" \");}else{System.out.println(rc[j][i]);}\n }\n}\n\n}\n}",
"Main",
"public static void main(String[] args){\nScanner sc = new Scanner(System.in);\nint r=Integer.parseInt(sc.next());\nint c=Integer.parseInt(sc.next());\nint[][] rc=new int[r+1][c+1];\nfor(int i=0;i<r;i++){\n for(int j=0;j<c;j++){\n rc[i][j]=sc.nextInt();\n \n }\n}\nfor(int i=0;i<r;i++){\n for(int j=0;j<c;j++){\n rc[i][c]+=rc[i][j];\n rc[r][j]+=rc[i][j];\n rc[r][c]+=rc[i][j];\n }\n}\n\nfor(int j=0;j<r+1;j++){\n for(int i=0;i<c+1;i++){\n if(i!=c){System.out.print(rc[j][i]+\" \");}else{System.out.println(rc[j][i]);}\n }\n}\n\n}",
"main",
"{\nScanner sc = new Scanner(System.in);\nint r=Integer.parseInt(sc.next());\nint c=Integer.parseInt(sc.next());\nint[][] rc=new int[r+1][c+1];\nfor(int i=0;i<r;i++){\n for(int j=0;j<c;j++){\n rc[i][j]=sc.nextInt();\n \n }\n}\nfor(int i=0;i<r;i++){\n for(int j=0;j<c;j++){\n rc[i][c]+=rc[i][j];\n rc[r][j]+=rc[i][j];\n rc[r][c]+=rc[i][j];\n }\n}\n\nfor(int j=0;j<r+1;j++){\n for(int i=0;i<c+1;i++){\n if(i!=c){System.out.print(rc[j][i]+\" \");}else{System.out.println(rc[j][i]);}\n }\n}\n\n}",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"int r=Integer.parseInt(sc.next());",
"r",
"Integer.parseInt(sc.next())",
"Integer.parseInt",
"Integer",
"sc.next()",
"sc.next",
"sc",
"int c=Integer.parseInt(sc.next());",
"c",
"Integer.parseInt(sc.next())",
"Integer.parseInt",
"Integer",
"sc.next()",
"sc.next",
"sc",
"int[][] rc=new int[r+1][c+1];",
"rc",
"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 rc[i][j]=sc.nextInt();\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 rc[i][j]=sc.nextInt();\n \n }\n}",
"{\n for(int j=0;j<c;j++){\n rc[i][j]=sc.nextInt();\n \n }\n}",
"for(int j=0;j<c;j++){\n rc[i][j]=sc.nextInt();\n \n }",
"int j=0;",
"int j=0;",
"j",
"0",
"j<c",
"j",
"c",
"j++",
"j++",
"j",
"{\n rc[i][j]=sc.nextInt();\n \n }",
"{\n rc[i][j]=sc.nextInt();\n \n }",
"rc[i][j]=sc.nextInt()",
"rc[i][j]",
"rc[i]",
"rc",
"i",
"j",
"sc.nextInt()",
"sc.nextInt",
"sc",
"for(int i=0;i<r;i++){\n for(int j=0;j<c;j++){\n rc[i][c]+=rc[i][j];\n rc[r][j]+=rc[i][j];\n rc[r][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 rc[r][j]+=rc[i][j];\n rc[r][c]+=rc[i][j];\n }\n}",
"{\n for(int j=0;j<c;j++){\n rc[i][c]+=rc[i][j];\n rc[r][j]+=rc[i][j];\n rc[r][c]+=rc[i][j];\n }\n}",
"for(int j=0;j<c;j++){\n rc[i][c]+=rc[i][j];\n rc[r][j]+=rc[i][j];\n rc[r][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 rc[r][j]+=rc[i][j];\n rc[r][c]+=rc[i][j];\n }",
"{\n rc[i][c]+=rc[i][j];\n rc[r][j]+=rc[i][j];\n rc[r][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",
"rc[r][j]+=rc[i][j]",
"rc[r][j]",
"rc[r]",
"rc",
"r",
"j",
"rc[i][j]",
"rc[i]",
"rc",
"i",
"j",
"rc[r][c]+=rc[i][j]",
"rc[r][c]",
"rc[r]",
"rc",
"r",
"c",
"rc[i][j]",
"rc[i]",
"rc",
"i",
"j",
"for(int j=0;j<r+1;j++){\n for(int i=0;i<c+1;i++){\n if(i!=c){System.out.print(rc[j][i]+\" \");}else{System.out.println(rc[j][i]);}\n }\n}",
"int j=0;",
"int j=0;",
"j",
"0",
"j<r+1",
"j",
"r+1",
"r",
"1",
"j++",
"j++",
"j",
"{\n for(int i=0;i<c+1;i++){\n if(i!=c){System.out.print(rc[j][i]+\" \");}else{System.out.println(rc[j][i]);}\n }\n}",
"{\n for(int i=0;i<c+1;i++){\n if(i!=c){System.out.print(rc[j][i]+\" \");}else{System.out.println(rc[j][i]);}\n }\n}",
"for(int i=0;i<c+1;i++){\n if(i!=c){System.out.print(rc[j][i]+\" \");}else{System.out.println(rc[j][i]);}\n }",
"int i=0;",
"int i=0;",
"i",
"0",
"i<c+1",
"i",
"c+1",
"c",
"1",
"i++",
"i++",
"i",
"{\n if(i!=c){System.out.print(rc[j][i]+\" \");}else{System.out.println(rc[j][i]);}\n }",
"{\n if(i!=c){System.out.print(rc[j][i]+\" \");}else{System.out.println(rc[j][i]);}\n }",
"if(i!=c){System.out.print(rc[j][i]+\" \");}else{System.out.println(rc[j][i]);}",
"i!=c",
"i",
"c",
"{System.out.print(rc[j][i]+\" \");}",
"System.out.print(rc[j][i]+\" \")",
"System.out.print",
"System.out",
"System",
"System.out",
"rc[j][i]+\" \"",
"rc[j][i]",
"rc[j]",
"rc",
"j",
"i",
"\" \"",
"{System.out.println(rc[j][i]);}",
"System.out.println(rc[j][i])",
"System.out.println",
"System.out",
"System",
"System.out",
"rc[j][i]",
"rc[j]",
"rc",
"j",
"i",
"String[] args",
"args",
"public class Main {\npublic static void main(String[] args){\nScanner sc = new Scanner(System.in);\nint r=Integer.parseInt(sc.next());\nint c=Integer.parseInt(sc.next());\nint[][] rc=new int[r+1][c+1];\nfor(int i=0;i<r;i++){\n for(int j=0;j<c;j++){\n rc[i][j]=sc.nextInt();\n \n }\n}\nfor(int i=0;i<r;i++){\n for(int j=0;j<c;j++){\n rc[i][c]+=rc[i][j];\n rc[r][j]+=rc[i][j];\n rc[r][c]+=rc[i][j];\n }\n}\n\nfor(int j=0;j<r+1;j++){\n for(int i=0;i<c+1;i++){\n if(i!=c){System.out.print(rc[j][i]+\" \");}else{System.out.println(rc[j][i]);}\n }\n}\n\n}\n}",
"public class Main {\npublic static void main(String[] args){\nScanner sc = new Scanner(System.in);\nint r=Integer.parseInt(sc.next());\nint c=Integer.parseInt(sc.next());\nint[][] rc=new int[r+1][c+1];\nfor(int i=0;i<r;i++){\n for(int j=0;j<c;j++){\n rc[i][j]=sc.nextInt();\n \n }\n}\nfor(int i=0;i<r;i++){\n for(int j=0;j<c;j++){\n rc[i][c]+=rc[i][j];\n rc[r][j]+=rc[i][j];\n rc[r][c]+=rc[i][j];\n }\n}\n\nfor(int j=0;j<r+1;j++){\n for(int i=0;i<c+1;i++){\n if(i!=c){System.out.print(rc[j][i]+\" \");}else{System.out.println(rc[j][i]);}\n }\n}\n\n}\n}",
"Main"
] | import java.util.*;
public class Main {
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
int r=Integer.parseInt(sc.next());
int c=Integer.parseInt(sc.next());
int[][] rc=new int[r+1][c+1];
for(int i=0;i<r;i++){
for(int j=0;j<c;j++){
rc[i][j]=sc.nextInt();
}
}
for(int i=0;i<r;i++){
for(int j=0;j<c;j++){
rc[i][c]+=rc[i][j];
rc[r][j]+=rc[i][j];
rc[r][c]+=rc[i][j];
}
}
for(int j=0;j<r+1;j++){
for(int i=0;i<c+1;i++){
if(i!=c){System.out.print(rc[j][i]+" ");}else{System.out.println(rc[j][i]);}
}
}
}
}
|
[
7,
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,
17,
38,
5,
13,
30,
4,
18,
18,
13,
13,
13,
5,
13,
30,
4,
18,
18,
13,
13,
17,
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,
41,
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,
0,
18,
18,
13,
13,
13,
13,
0,
13,
13,
0,
18,
18,
13,
13,
13,
13,
0,
13,
13,
0,
18,
18,
13,
13,
13,
13,
0,
13,
17,
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,
17,
30,
4,
18,
18,
13,
13,
18,
18,
13,
13,
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
],
[
231,
11
],
[
231,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
15,
17
],
[
14,
18
],
[
18,
19
],
[
18,
20
],
[
14,
21
],
[
21,
22
],
[
21,
23
],
[
14,
24
],
[
24,
25
],
[
24,
26
],
[
14,
27
],
[
27,
28
],
[
28,
29
],
[
28,
30
],
[
30,
31
],
[
31,
32
],
[
32,
33
],
[
33,
34
],
[
33,
35
],
[
31,
36
],
[
27,
37
],
[
37,
38
],
[
37,
39
],
[
39,
40
],
[
40,
41
],
[
41,
42
],
[
42,
43
],
[
42,
44
],
[
40,
45
],
[
27,
46
],
[
46,
47
],
[
47,
48
],
[
47,
49
],
[
46,
50
],
[
50,
51
],
[
50,
52
],
[
52,
53
],
[
53,
54
],
[
46,
55
],
[
55,
56
],
[
55,
57
],
[
57,
58
],
[
58,
59
],
[
57,
60
],
[
46,
61
],
[
61,
62
],
[
61,
63
],
[
63,
64
],
[
64,
65
],
[
63,
66
],
[
66,
67
],
[
66,
68
],
[
46,
69
],
[
69,
70
],
[
69,
71
],
[
71,
72
],
[
72,
73
],
[
71,
74
],
[
74,
75
],
[
74,
76
],
[
46,
77
],
[
77,
78
],
[
77,
79
],
[
80,
81
],
[
80,
82
],
[
83,
84
],
[
83,
85
],
[
46,
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
],
[
99,
101
],
[
101,
102
],
[
102,
103
],
[
98,
104
],
[
104,
105
],
[
104,
106
],
[
106,
107
],
[
107,
108
],
[
106,
109
],
[
98,
110
],
[
110,
111
],
[
111,
112
],
[
112,
113
],
[
112,
114
],
[
110,
115
],
[
115,
116
],
[
115,
117
],
[
110,
118
],
[
118,
119
],
[
119,
120
],
[
110,
121
],
[
122,
122
],
[
122,
123
],
[
123,
124
],
[
123,
125
],
[
125,
126
],
[
126,
127
],
[
125,
128
],
[
128,
129
],
[
128,
130
],
[
122,
131
],
[
131,
132
],
[
132,
133
],
[
133,
134
],
[
133,
135
],
[
132,
136
],
[
131,
137
],
[
122,
138
],
[
138,
139
],
[
138,
140
],
[
122,
141
],
[
141,
142
],
[
142,
143
],
[
143,
144
],
[
143,
145
],
[
142,
146
],
[
141,
147
],
[
122,
148
],
[
148,
149
],
[
148,
150
],
[
98,
151
],
[
151,
152
],
[
152,
153
],
[
153,
154
],
[
153,
155
],
[
152,
156
],
[
151,
157
],
[
98,
158
],
[
158,
159
],
[
158,
160
],
[
46,
161
],
[
161,
162
],
[
162,
163
],
[
163,
164
],
[
163,
165
],
[
162,
166
],
[
161,
167
],
[
46,
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
],
[
195,
197
],
[
194,
198
],
[
198,
199
],
[
199,
200
],
[
200,
201
],
[
201,
202
],
[
201,
203
],
[
199,
204
],
[
204,
205
],
[
205,
206
],
[
205,
207
],
[
204,
208
],
[
194,
209
],
[
209,
210
],
[
210,
211
],
[
211,
212
],
[
212,
213
],
[
212,
214
],
[
210,
215
],
[
215,
216
],
[
215,
217
],
[
217,
218
],
[
218,
219
],
[
218,
220
],
[
217,
221
],
[
180,
222
],
[
222,
223
],
[
223,
224
],
[
224,
225
],
[
224,
226
],
[
222,
227
],
[
12,
228
],
[
228,
229
],
[
0,
230
],
[
230,
231
],
[
230,
232
]
] | [
"import java.io.BufferedReader;\nimport java.io.IOException;\nimport java.io.InputStreamReader;\n\n/**\n * Lesson7C 表の行数rと列数c、r × c の要素を持つ表を読み込んで、\n * 各行と列の合計を挿入した新しい表を出力するプログラム\n *\n * @author Internship\n *\n */\npublic class Main{\n\n\t/**\n\t * プログラムのエントリポイント\n\t *\n\t * @param args\n\t */\n\tpublic static void main(String[] args) {\n\n\n\t\t//行や列の各数字の一時保管場所\n\t\tint intVector = 0;\n\n\t\t//入力値の各行の文字列の一時保管場所\n\t\tString strLineAll = \"\";\n\n\t\t//行の合計値\n\t\tint intColumnSum = 0;\n\n\t\t//行と列の全合計値\n\t\tint intSum = 0;\n\n\t\t//一行目を読み込む\n\t\ttry {\n\t\t\tBufferedReader insBR = new BufferedReader(new InputStreamReader(System.in));\n\n\t\t\tString strLine1 = insBR.readLine();\n\n\t\t\t//ばらけさせる\n\t\t\tString[] strAryLine1 = strLine1.split(\" \");\n\n\t\t\t//行の数\n\t\t\tint intLine = Integer.parseInt(strAryLine1[0]);\n\n\t\t\t//列の数\n\t\t\tint intColumn = Integer.parseInt(strAryLine1[1]);\n\n\t\t\t//行と列が決まったところで配列の大きさが決まる\n\t\t\tint[][] intTable = new int[intLine + 1][intColumn + 1];\n\n\t\t\t//二行目以降を読み込む\n\t\t\t//i行目\n\t\t\tfor(int i = 0; i < intLine; i++) {\n\t\t\t\tstrLineAll = insBR.readLine();\n\n\t\t\t//ばらけさせる\n\t\t\t\tString[] strAryLine = strLineAll.split(\" \");\n\n\t\t\t\t//int型にキャスト\n\t\t\t\t//j列目\n\t\t\t\tfor(int j = 0; j < intColumn; j++) {\n\t\t\t\t\tintVector = Integer.parseInt(strAryLine[j]);\n\n\t\t\t\t\t//配列に格納\n\t\t\t\t\t//i行のj列\n\t\t\t\t\tintTable[i][j] = intVector;\n\n\t\t\t\t\t//行の合計値をカウント\n\t\t\t\t\tintColumnSum += intVector;\n\n\t\t\t\t\t//列の合計値をカウント\n\t\t\t\t\tintTable[intLine][j] += intVector;\n\n\t\t\t\t\t//総合計値をカウント\n\t\t\t\t\tintSum += intVector;\n\t\t\t\t}\n\t\t\t\t//行の合計値を代入\n\t\t\t\tintTable[i][intColumn] = intColumnSum;\n\n\t\t\t\t//1行分終わったのでリセット\n\t\t\t\tintColumnSum = 0;\n\t\t\t}\n\n\t\t\t//総合計値を代入\n\t\t\tintTable[intLine][intColumn] = intSum;\n\n\t\t\t//計算して出力\n\t\t\tfor(int i = 0; i <= intLine; i++) {\n\t\t\t\tfor(int j = 0; j <= intColumn; j++) {\n\n\t\t\t\t\tif(j == 0) {\n\t\t\t\t\t\tSystem.out.print(intTable[i][j]);\n\t\t\t\t\t}else {\n\t\t\t\t\t\tSystem.out.print(\" \" + intTable[i][j]);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tSystem.out.println(\"\");\n\t\t\t}\n\n\t\t} catch (IOException e) {\n\t\t\tSystem.out.println(e);\n\t\t} catch (NumberFormatException e) {\n\t\t\tSystem.out.println(\"数字で入力して下さい\");\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\n\t/**\n\t * プログラムのエントリポイント\n\t *\n\t * @param args\n\t */\n\tpublic static void main(String[] args) {\n\n\n\t\t//行や列の各数字の一時保管場所\n\t\tint intVector = 0;\n\n\t\t//入力値の各行の文字列の一時保管場所\n\t\tString strLineAll = \"\";\n\n\t\t//行の合計値\n\t\tint intColumnSum = 0;\n\n\t\t//行と列の全合計値\n\t\tint intSum = 0;\n\n\t\t//一行目を読み込む\n\t\ttry {\n\t\t\tBufferedReader insBR = new BufferedReader(new InputStreamReader(System.in));\n\n\t\t\tString strLine1 = insBR.readLine();\n\n\t\t\t//ばらけさせる\n\t\t\tString[] strAryLine1 = strLine1.split(\" \");\n\n\t\t\t//行の数\n\t\t\tint intLine = Integer.parseInt(strAryLine1[0]);\n\n\t\t\t//列の数\n\t\t\tint intColumn = Integer.parseInt(strAryLine1[1]);\n\n\t\t\t//行と列が決まったところで配列の大きさが決まる\n\t\t\tint[][] intTable = new int[intLine + 1][intColumn + 1];\n\n\t\t\t//二行目以降を読み込む\n\t\t\t//i行目\n\t\t\tfor(int i = 0; i < intLine; i++) {\n\t\t\t\tstrLineAll = insBR.readLine();\n\n\t\t\t//ばらけさせる\n\t\t\t\tString[] strAryLine = strLineAll.split(\" \");\n\n\t\t\t\t//int型にキャスト\n\t\t\t\t//j列目\n\t\t\t\tfor(int j = 0; j < intColumn; j++) {\n\t\t\t\t\tintVector = Integer.parseInt(strAryLine[j]);\n\n\t\t\t\t\t//配列に格納\n\t\t\t\t\t//i行のj列\n\t\t\t\t\tintTable[i][j] = intVector;\n\n\t\t\t\t\t//行の合計値をカウント\n\t\t\t\t\tintColumnSum += intVector;\n\n\t\t\t\t\t//列の合計値をカウント\n\t\t\t\t\tintTable[intLine][j] += intVector;\n\n\t\t\t\t\t//総合計値をカウント\n\t\t\t\t\tintSum += intVector;\n\t\t\t\t}\n\t\t\t\t//行の合計値を代入\n\t\t\t\tintTable[i][intColumn] = intColumnSum;\n\n\t\t\t\t//1行分終わったのでリセット\n\t\t\t\tintColumnSum = 0;\n\t\t\t}\n\n\t\t\t//総合計値を代入\n\t\t\tintTable[intLine][intColumn] = intSum;\n\n\t\t\t//計算して出力\n\t\t\tfor(int i = 0; i <= intLine; i++) {\n\t\t\t\tfor(int j = 0; j <= intColumn; j++) {\n\n\t\t\t\t\tif(j == 0) {\n\t\t\t\t\t\tSystem.out.print(intTable[i][j]);\n\t\t\t\t\t}else {\n\t\t\t\t\t\tSystem.out.print(\" \" + intTable[i][j]);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tSystem.out.println(\"\");\n\t\t\t}\n\n\t\t} catch (IOException e) {\n\t\t\tSystem.out.println(e);\n\t\t} catch (NumberFormatException e) {\n\t\t\tSystem.out.println(\"数字で入力して下さい\");\n\t\t}\n\t}\n}",
"Main",
"/**\n\t * プログラムのエントリポイント\n\t *\n\t * @param args\n\t */\n\tpublic static void main(String[] args) {\n\n\n\t\t//行や列の各数字の一時保管場所\n\t\tint intVector = 0;\n\n\t\t//入力値の各行の文字列の一時保管場所\n\t\tString strLineAll = \"\";\n\n\t\t//行の合計値\n\t\tint intColumnSum = 0;\n\n\t\t//行と列の全合計値\n\t\tint intSum = 0;\n\n\t\t//一行目を読み込む\n\t\ttry {\n\t\t\tBufferedReader insBR = new BufferedReader(new InputStreamReader(System.in));\n\n\t\t\tString strLine1 = insBR.readLine();\n\n\t\t\t//ばらけさせる\n\t\t\tString[] strAryLine1 = strLine1.split(\" \");\n\n\t\t\t//行の数\n\t\t\tint intLine = Integer.parseInt(strAryLine1[0]);\n\n\t\t\t//列の数\n\t\t\tint intColumn = Integer.parseInt(strAryLine1[1]);\n\n\t\t\t//行と列が決まったところで配列の大きさが決まる\n\t\t\tint[][] intTable = new int[intLine + 1][intColumn + 1];\n\n\t\t\t//二行目以降を読み込む\n\t\t\t//i行目\n\t\t\tfor(int i = 0; i < intLine; i++) {\n\t\t\t\tstrLineAll = insBR.readLine();\n\n\t\t\t//ばらけさせる\n\t\t\t\tString[] strAryLine = strLineAll.split(\" \");\n\n\t\t\t\t//int型にキャスト\n\t\t\t\t//j列目\n\t\t\t\tfor(int j = 0; j < intColumn; j++) {\n\t\t\t\t\tintVector = Integer.parseInt(strAryLine[j]);\n\n\t\t\t\t\t//配列に格納\n\t\t\t\t\t//i行のj列\n\t\t\t\t\tintTable[i][j] = intVector;\n\n\t\t\t\t\t//行の合計値をカウント\n\t\t\t\t\tintColumnSum += intVector;\n\n\t\t\t\t\t//列の合計値をカウント\n\t\t\t\t\tintTable[intLine][j] += intVector;\n\n\t\t\t\t\t//総合計値をカウント\n\t\t\t\t\tintSum += intVector;\n\t\t\t\t}\n\t\t\t\t//行の合計値を代入\n\t\t\t\tintTable[i][intColumn] = intColumnSum;\n\n\t\t\t\t//1行分終わったのでリセット\n\t\t\t\tintColumnSum = 0;\n\t\t\t}\n\n\t\t\t//総合計値を代入\n\t\t\tintTable[intLine][intColumn] = intSum;\n\n\t\t\t//計算して出力\n\t\t\tfor(int i = 0; i <= intLine; i++) {\n\t\t\t\tfor(int j = 0; j <= intColumn; j++) {\n\n\t\t\t\t\tif(j == 0) {\n\t\t\t\t\t\tSystem.out.print(intTable[i][j]);\n\t\t\t\t\t}else {\n\t\t\t\t\t\tSystem.out.print(\" \" + intTable[i][j]);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tSystem.out.println(\"\");\n\t\t\t}\n\n\t\t} catch (IOException e) {\n\t\t\tSystem.out.println(e);\n\t\t} catch (NumberFormatException e) {\n\t\t\tSystem.out.println(\"数字で入力して下さい\");\n\t\t}\n\t}",
"main",
"{\n\n\n\t\t//行や列の各数字の一時保管場所\n\t\tint intVector = 0;\n\n\t\t//入力値の各行の文字列の一時保管場所\n\t\tString strLineAll = \"\";\n\n\t\t//行の合計値\n\t\tint intColumnSum = 0;\n\n\t\t//行と列の全合計値\n\t\tint intSum = 0;\n\n\t\t//一行目を読み込む\n\t\ttry {\n\t\t\tBufferedReader insBR = new BufferedReader(new InputStreamReader(System.in));\n\n\t\t\tString strLine1 = insBR.readLine();\n\n\t\t\t//ばらけさせる\n\t\t\tString[] strAryLine1 = strLine1.split(\" \");\n\n\t\t\t//行の数\n\t\t\tint intLine = Integer.parseInt(strAryLine1[0]);\n\n\t\t\t//列の数\n\t\t\tint intColumn = Integer.parseInt(strAryLine1[1]);\n\n\t\t\t//行と列が決まったところで配列の大きさが決まる\n\t\t\tint[][] intTable = new int[intLine + 1][intColumn + 1];\n\n\t\t\t//二行目以降を読み込む\n\t\t\t//i行目\n\t\t\tfor(int i = 0; i < intLine; i++) {\n\t\t\t\tstrLineAll = insBR.readLine();\n\n\t\t\t//ばらけさせる\n\t\t\t\tString[] strAryLine = strLineAll.split(\" \");\n\n\t\t\t\t//int型にキャスト\n\t\t\t\t//j列目\n\t\t\t\tfor(int j = 0; j < intColumn; j++) {\n\t\t\t\t\tintVector = Integer.parseInt(strAryLine[j]);\n\n\t\t\t\t\t//配列に格納\n\t\t\t\t\t//i行のj列\n\t\t\t\t\tintTable[i][j] = intVector;\n\n\t\t\t\t\t//行の合計値をカウント\n\t\t\t\t\tintColumnSum += intVector;\n\n\t\t\t\t\t//列の合計値をカウント\n\t\t\t\t\tintTable[intLine][j] += intVector;\n\n\t\t\t\t\t//総合計値をカウント\n\t\t\t\t\tintSum += intVector;\n\t\t\t\t}\n\t\t\t\t//行の合計値を代入\n\t\t\t\tintTable[i][intColumn] = intColumnSum;\n\n\t\t\t\t//1行分終わったのでリセット\n\t\t\t\tintColumnSum = 0;\n\t\t\t}\n\n\t\t\t//総合計値を代入\n\t\t\tintTable[intLine][intColumn] = intSum;\n\n\t\t\t//計算して出力\n\t\t\tfor(int i = 0; i <= intLine; i++) {\n\t\t\t\tfor(int j = 0; j <= intColumn; j++) {\n\n\t\t\t\t\tif(j == 0) {\n\t\t\t\t\t\tSystem.out.print(intTable[i][j]);\n\t\t\t\t\t}else {\n\t\t\t\t\t\tSystem.out.print(\" \" + intTable[i][j]);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tSystem.out.println(\"\");\n\t\t\t}\n\n\t\t} catch (IOException e) {\n\t\t\tSystem.out.println(e);\n\t\t} catch (NumberFormatException e) {\n\t\t\tSystem.out.println(\"数字で入力して下さい\");\n\t\t}\n\t}",
"int intVector = 0;",
"intVector",
"0",
"String strLineAll = \"\";",
"strLineAll",
"\"\"",
"int intColumnSum = 0;",
"intColumnSum",
"0",
"int intSum = 0;",
"intSum",
"0",
"try {\n\t\t\tBufferedReader insBR = new BufferedReader(new InputStreamReader(System.in));\n\n\t\t\tString strLine1 = insBR.readLine();\n\n\t\t\t//ばらけさせる\n\t\t\tString[] strAryLine1 = strLine1.split(\" \");\n\n\t\t\t//行の数\n\t\t\tint intLine = Integer.parseInt(strAryLine1[0]);\n\n\t\t\t//列の数\n\t\t\tint intColumn = Integer.parseInt(strAryLine1[1]);\n\n\t\t\t//行と列が決まったところで配列の大きさが決まる\n\t\t\tint[][] intTable = new int[intLine + 1][intColumn + 1];\n\n\t\t\t//二行目以降を読み込む\n\t\t\t//i行目\n\t\t\tfor(int i = 0; i < intLine; i++) {\n\t\t\t\tstrLineAll = insBR.readLine();\n\n\t\t\t//ばらけさせる\n\t\t\t\tString[] strAryLine = strLineAll.split(\" \");\n\n\t\t\t\t//int型にキャスト\n\t\t\t\t//j列目\n\t\t\t\tfor(int j = 0; j < intColumn; j++) {\n\t\t\t\t\tintVector = Integer.parseInt(strAryLine[j]);\n\n\t\t\t\t\t//配列に格納\n\t\t\t\t\t//i行のj列\n\t\t\t\t\tintTable[i][j] = intVector;\n\n\t\t\t\t\t//行の合計値をカウント\n\t\t\t\t\tintColumnSum += intVector;\n\n\t\t\t\t\t//列の合計値をカウント\n\t\t\t\t\tintTable[intLine][j] += intVector;\n\n\t\t\t\t\t//総合計値をカウント\n\t\t\t\t\tintSum += intVector;\n\t\t\t\t}\n\t\t\t\t//行の合計値を代入\n\t\t\t\tintTable[i][intColumn] = intColumnSum;\n\n\t\t\t\t//1行分終わったのでリセット\n\t\t\t\tintColumnSum = 0;\n\t\t\t}\n\n\t\t\t//総合計値を代入\n\t\t\tintTable[intLine][intColumn] = intSum;\n\n\t\t\t//計算して出力\n\t\t\tfor(int i = 0; i <= intLine; i++) {\n\t\t\t\tfor(int j = 0; j <= intColumn; j++) {\n\n\t\t\t\t\tif(j == 0) {\n\t\t\t\t\t\tSystem.out.print(intTable[i][j]);\n\t\t\t\t\t}else {\n\t\t\t\t\t\tSystem.out.print(\" \" + intTable[i][j]);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tSystem.out.println(\"\");\n\t\t\t}\n\n\t\t} catch (IOException e) {\n\t\t\tSystem.out.println(e);\n\t\t} catch (NumberFormatException e) {\n\t\t\tSystem.out.println(\"数字で入力して下さい\");\n\t\t}",
"catch (IOException e) {\n\t\t\tSystem.out.println(e);\n\t\t}",
"IOException e",
"{\n\t\t\tSystem.out.println(e);\n\t\t}",
"System.out.println(e)",
"System.out.println",
"System.out",
"System",
"System.out",
"e",
"catch (NumberFormatException e) {\n\t\t\tSystem.out.println(\"数字で入力して下さい\");\n\t\t}",
"NumberFormatException e",
"{\n\t\t\tSystem.out.println(\"数字で入力して下さい\");\n\t\t}",
"System.out.println(\"数字で入力して下さい\")",
"System.out.println",
"System.out",
"System",
"System.out",
"\"数字で入力して下さい\"",
"{\n\t\t\tBufferedReader insBR = new BufferedReader(new InputStreamReader(System.in));\n\n\t\t\tString strLine1 = insBR.readLine();\n\n\t\t\t//ばらけさせる\n\t\t\tString[] strAryLine1 = strLine1.split(\" \");\n\n\t\t\t//行の数\n\t\t\tint intLine = Integer.parseInt(strAryLine1[0]);\n\n\t\t\t//列の数\n\t\t\tint intColumn = Integer.parseInt(strAryLine1[1]);\n\n\t\t\t//行と列が決まったところで配列の大きさが決まる\n\t\t\tint[][] intTable = new int[intLine + 1][intColumn + 1];\n\n\t\t\t//二行目以降を読み込む\n\t\t\t//i行目\n\t\t\tfor(int i = 0; i < intLine; i++) {\n\t\t\t\tstrLineAll = insBR.readLine();\n\n\t\t\t//ばらけさせる\n\t\t\t\tString[] strAryLine = strLineAll.split(\" \");\n\n\t\t\t\t//int型にキャスト\n\t\t\t\t//j列目\n\t\t\t\tfor(int j = 0; j < intColumn; j++) {\n\t\t\t\t\tintVector = Integer.parseInt(strAryLine[j]);\n\n\t\t\t\t\t//配列に格納\n\t\t\t\t\t//i行のj列\n\t\t\t\t\tintTable[i][j] = intVector;\n\n\t\t\t\t\t//行の合計値をカウント\n\t\t\t\t\tintColumnSum += intVector;\n\n\t\t\t\t\t//列の合計値をカウント\n\t\t\t\t\tintTable[intLine][j] += intVector;\n\n\t\t\t\t\t//総合計値をカウント\n\t\t\t\t\tintSum += intVector;\n\t\t\t\t}\n\t\t\t\t//行の合計値を代入\n\t\t\t\tintTable[i][intColumn] = intColumnSum;\n\n\t\t\t\t//1行分終わったのでリセット\n\t\t\t\tintColumnSum = 0;\n\t\t\t}\n\n\t\t\t//総合計値を代入\n\t\t\tintTable[intLine][intColumn] = intSum;\n\n\t\t\t//計算して出力\n\t\t\tfor(int i = 0; i <= intLine; i++) {\n\t\t\t\tfor(int j = 0; j <= intColumn; j++) {\n\n\t\t\t\t\tif(j == 0) {\n\t\t\t\t\t\tSystem.out.print(intTable[i][j]);\n\t\t\t\t\t}else {\n\t\t\t\t\t\tSystem.out.print(\" \" + intTable[i][j]);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tSystem.out.println(\"\");\n\t\t\t}\n\n\t\t}",
"BufferedReader insBR = new BufferedReader(new InputStreamReader(System.in));",
"insBR",
"new BufferedReader(new InputStreamReader(System.in))",
"String strLine1 = insBR.readLine();",
"strLine1",
"insBR.readLine()",
"insBR.readLine",
"insBR",
"String[] strAryLine1 = strLine1.split(\" \");",
"strAryLine1",
"strLine1.split(\" \")",
"strLine1.split",
"strLine1",
"\" \"",
"int intLine = Integer.parseInt(strAryLine1[0]);",
"intLine",
"Integer.parseInt(strAryLine1[0])",
"Integer.parseInt",
"Integer",
"strAryLine1[0]",
"strAryLine1",
"0",
"int intColumn = Integer.parseInt(strAryLine1[1]);",
"intColumn",
"Integer.parseInt(strAryLine1[1])",
"Integer.parseInt",
"Integer",
"strAryLine1[1]",
"strAryLine1",
"1",
"int[][] intTable = new int[intLine + 1][intColumn + 1];",
"intTable",
"new int[intLine + 1][intColumn + 1]",
"intLine + 1",
"intLine",
"1",
"intColumn + 1",
"intColumn",
"1",
"for(int i = 0; i < intLine; i++) {\n\t\t\t\tstrLineAll = insBR.readLine();\n\n\t\t\t//ばらけさせる\n\t\t\t\tString[] strAryLine = strLineAll.split(\" \");\n\n\t\t\t\t//int型にキャスト\n\t\t\t\t//j列目\n\t\t\t\tfor(int j = 0; j < intColumn; j++) {\n\t\t\t\t\tintVector = Integer.parseInt(strAryLine[j]);\n\n\t\t\t\t\t//配列に格納\n\t\t\t\t\t//i行のj列\n\t\t\t\t\tintTable[i][j] = intVector;\n\n\t\t\t\t\t//行の合計値をカウント\n\t\t\t\t\tintColumnSum += intVector;\n\n\t\t\t\t\t//列の合計値をカウント\n\t\t\t\t\tintTable[intLine][j] += intVector;\n\n\t\t\t\t\t//総合計値をカウント\n\t\t\t\t\tintSum += intVector;\n\t\t\t\t}\n\t\t\t\t//行の合計値を代入\n\t\t\t\tintTable[i][intColumn] = intColumnSum;\n\n\t\t\t\t//1行分終わったのでリセット\n\t\t\t\tintColumnSum = 0;\n\t\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < intLine",
"i",
"intLine",
"i++",
"i++",
"i",
"{\n\t\t\t\tstrLineAll = insBR.readLine();\n\n\t\t\t//ばらけさせる\n\t\t\t\tString[] strAryLine = strLineAll.split(\" \");\n\n\t\t\t\t//int型にキャスト\n\t\t\t\t//j列目\n\t\t\t\tfor(int j = 0; j < intColumn; j++) {\n\t\t\t\t\tintVector = Integer.parseInt(strAryLine[j]);\n\n\t\t\t\t\t//配列に格納\n\t\t\t\t\t//i行のj列\n\t\t\t\t\tintTable[i][j] = intVector;\n\n\t\t\t\t\t//行の合計値をカウント\n\t\t\t\t\tintColumnSum += intVector;\n\n\t\t\t\t\t//列の合計値をカウント\n\t\t\t\t\tintTable[intLine][j] += intVector;\n\n\t\t\t\t\t//総合計値をカウント\n\t\t\t\t\tintSum += intVector;\n\t\t\t\t}\n\t\t\t\t//行の合計値を代入\n\t\t\t\tintTable[i][intColumn] = intColumnSum;\n\n\t\t\t\t//1行分終わったのでリセット\n\t\t\t\tintColumnSum = 0;\n\t\t\t}",
"{\n\t\t\t\tstrLineAll = insBR.readLine();\n\n\t\t\t//ばらけさせる\n\t\t\t\tString[] strAryLine = strLineAll.split(\" \");\n\n\t\t\t\t//int型にキャスト\n\t\t\t\t//j列目\n\t\t\t\tfor(int j = 0; j < intColumn; j++) {\n\t\t\t\t\tintVector = Integer.parseInt(strAryLine[j]);\n\n\t\t\t\t\t//配列に格納\n\t\t\t\t\t//i行のj列\n\t\t\t\t\tintTable[i][j] = intVector;\n\n\t\t\t\t\t//行の合計値をカウント\n\t\t\t\t\tintColumnSum += intVector;\n\n\t\t\t\t\t//列の合計値をカウント\n\t\t\t\t\tintTable[intLine][j] += intVector;\n\n\t\t\t\t\t//総合計値をカウント\n\t\t\t\t\tintSum += intVector;\n\t\t\t\t}\n\t\t\t\t//行の合計値を代入\n\t\t\t\tintTable[i][intColumn] = intColumnSum;\n\n\t\t\t\t//1行分終わったのでリセット\n\t\t\t\tintColumnSum = 0;\n\t\t\t}",
"strLineAll = insBR.readLine()",
"strLineAll",
"insBR.readLine()",
"insBR.readLine",
"insBR",
"String[] strAryLine = strLineAll.split(\" \");",
"strAryLine",
"strLineAll.split(\" \")",
"strLineAll.split",
"strLineAll",
"\" \"",
"for(int j = 0; j < intColumn; j++) {\n\t\t\t\t\tintVector = Integer.parseInt(strAryLine[j]);\n\n\t\t\t\t\t//配列に格納\n\t\t\t\t\t//i行のj列\n\t\t\t\t\tintTable[i][j] = intVector;\n\n\t\t\t\t\t//行の合計値をカウント\n\t\t\t\t\tintColumnSum += intVector;\n\n\t\t\t\t\t//列の合計値をカウント\n\t\t\t\t\tintTable[intLine][j] += intVector;\n\n\t\t\t\t\t//総合計値をカウント\n\t\t\t\t\tintSum += intVector;\n\t\t\t\t}",
"int j = 0;",
"int j = 0;",
"j",
"0",
"j < intColumn",
"j",
"intColumn",
"j++",
"j++",
"j",
"{\n\t\t\t\t\tintVector = Integer.parseInt(strAryLine[j]);\n\n\t\t\t\t\t//配列に格納\n\t\t\t\t\t//i行のj列\n\t\t\t\t\tintTable[i][j] = intVector;\n\n\t\t\t\t\t//行の合計値をカウント\n\t\t\t\t\tintColumnSum += intVector;\n\n\t\t\t\t\t//列の合計値をカウント\n\t\t\t\t\tintTable[intLine][j] += intVector;\n\n\t\t\t\t\t//総合計値をカウント\n\t\t\t\t\tintSum += intVector;\n\t\t\t\t}",
"{\n\t\t\t\t\tintVector = Integer.parseInt(strAryLine[j]);\n\n\t\t\t\t\t//配列に格納\n\t\t\t\t\t//i行のj列\n\t\t\t\t\tintTable[i][j] = intVector;\n\n\t\t\t\t\t//行の合計値をカウント\n\t\t\t\t\tintColumnSum += intVector;\n\n\t\t\t\t\t//列の合計値をカウント\n\t\t\t\t\tintTable[intLine][j] += intVector;\n\n\t\t\t\t\t//総合計値をカウント\n\t\t\t\t\tintSum += intVector;\n\t\t\t\t}",
"intVector = Integer.parseInt(strAryLine[j])",
"intVector",
"Integer.parseInt(strAryLine[j])",
"Integer.parseInt",
"Integer",
"strAryLine[j]",
"strAryLine",
"j",
"intTable[i][j] = intVector",
"intTable[i][j]",
"intTable[i]",
"intTable",
"i",
"j",
"intVector",
"intColumnSum += intVector",
"intColumnSum",
"intVector",
"intTable[intLine][j] += intVector",
"intTable[intLine][j]",
"intTable[intLine]",
"intTable",
"intLine",
"j",
"intVector",
"intSum += intVector",
"intSum",
"intVector",
"intTable[i][intColumn] = intColumnSum",
"intTable[i][intColumn]",
"intTable[i]",
"intTable",
"i",
"intColumn",
"intColumnSum",
"intColumnSum = 0",
"intColumnSum",
"0",
"intTable[intLine][intColumn] = intSum",
"intTable[intLine][intColumn]",
"intTable[intLine]",
"intTable",
"intLine",
"intColumn",
"intSum",
"for(int i = 0; i <= intLine; i++) {\n\t\t\t\tfor(int j = 0; j <= intColumn; j++) {\n\n\t\t\t\t\tif(j == 0) {\n\t\t\t\t\t\tSystem.out.print(intTable[i][j]);\n\t\t\t\t\t}else {\n\t\t\t\t\t\tSystem.out.print(\" \" + intTable[i][j]);\n\t\t\t\t\t}\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 <= intLine",
"i",
"intLine",
"i++",
"i++",
"i",
"{\n\t\t\t\tfor(int j = 0; j <= intColumn; j++) {\n\n\t\t\t\t\tif(j == 0) {\n\t\t\t\t\t\tSystem.out.print(intTable[i][j]);\n\t\t\t\t\t}else {\n\t\t\t\t\t\tSystem.out.print(\" \" + intTable[i][j]);\n\t\t\t\t\t}\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 <= intColumn; j++) {\n\n\t\t\t\t\tif(j == 0) {\n\t\t\t\t\t\tSystem.out.print(intTable[i][j]);\n\t\t\t\t\t}else {\n\t\t\t\t\t\tSystem.out.print(\" \" + intTable[i][j]);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tSystem.out.println(\"\");\n\t\t\t}",
"for(int j = 0; j <= intColumn; j++) {\n\n\t\t\t\t\tif(j == 0) {\n\t\t\t\t\t\tSystem.out.print(intTable[i][j]);\n\t\t\t\t\t}else {\n\t\t\t\t\t\tSystem.out.print(\" \" + intTable[i][j]);\n\t\t\t\t\t}\n\t\t\t\t}",
"int j = 0;",
"int j = 0;",
"j",
"0",
"j <= intColumn",
"j",
"intColumn",
"j++",
"j++",
"j",
"{\n\n\t\t\t\t\tif(j == 0) {\n\t\t\t\t\t\tSystem.out.print(intTable[i][j]);\n\t\t\t\t\t}else {\n\t\t\t\t\t\tSystem.out.print(\" \" + intTable[i][j]);\n\t\t\t\t\t}\n\t\t\t\t}",
"{\n\n\t\t\t\t\tif(j == 0) {\n\t\t\t\t\t\tSystem.out.print(intTable[i][j]);\n\t\t\t\t\t}else {\n\t\t\t\t\t\tSystem.out.print(\" \" + intTable[i][j]);\n\t\t\t\t\t}\n\t\t\t\t}",
"if(j == 0) {\n\t\t\t\t\t\tSystem.out.print(intTable[i][j]);\n\t\t\t\t\t}else {\n\t\t\t\t\t\tSystem.out.print(\" \" + intTable[i][j]);\n\t\t\t\t\t}",
"j == 0",
"j",
"0",
"{\n\t\t\t\t\t\tSystem.out.print(intTable[i][j]);\n\t\t\t\t\t}",
"System.out.print(intTable[i][j])",
"System.out.print",
"System.out",
"System",
"System.out",
"intTable[i][j]",
"intTable[i]",
"intTable",
"i",
"j",
"{\n\t\t\t\t\t\tSystem.out.print(\" \" + intTable[i][j]);\n\t\t\t\t\t}",
"System.out.print(\" \" + intTable[i][j])",
"System.out.print",
"System.out",
"System",
"System.out",
"\" \" + intTable[i][j]",
"\" \"",
"intTable[i][j]",
"intTable[i]",
"intTable",
"i",
"j",
"System.out.println(\"\")",
"System.out.println",
"System.out",
"System",
"System.out",
"\"\"",
"String[] args",
"args",
"public class Main{\n\n\t/**\n\t * プログラムのエントリポイント\n\t *\n\t * @param args\n\t */\n\tpublic static void main(String[] args) {\n\n\n\t\t//行や列の各数字の一時保管場所\n\t\tint intVector = 0;\n\n\t\t//入力値の各行の文字列の一時保管場所\n\t\tString strLineAll = \"\";\n\n\t\t//行の合計値\n\t\tint intColumnSum = 0;\n\n\t\t//行と列の全合計値\n\t\tint intSum = 0;\n\n\t\t//一行目を読み込む\n\t\ttry {\n\t\t\tBufferedReader insBR = new BufferedReader(new InputStreamReader(System.in));\n\n\t\t\tString strLine1 = insBR.readLine();\n\n\t\t\t//ばらけさせる\n\t\t\tString[] strAryLine1 = strLine1.split(\" \");\n\n\t\t\t//行の数\n\t\t\tint intLine = Integer.parseInt(strAryLine1[0]);\n\n\t\t\t//列の数\n\t\t\tint intColumn = Integer.parseInt(strAryLine1[1]);\n\n\t\t\t//行と列が決まったところで配列の大きさが決まる\n\t\t\tint[][] intTable = new int[intLine + 1][intColumn + 1];\n\n\t\t\t//二行目以降を読み込む\n\t\t\t//i行目\n\t\t\tfor(int i = 0; i < intLine; i++) {\n\t\t\t\tstrLineAll = insBR.readLine();\n\n\t\t\t//ばらけさせる\n\t\t\t\tString[] strAryLine = strLineAll.split(\" \");\n\n\t\t\t\t//int型にキャスト\n\t\t\t\t//j列目\n\t\t\t\tfor(int j = 0; j < intColumn; j++) {\n\t\t\t\t\tintVector = Integer.parseInt(strAryLine[j]);\n\n\t\t\t\t\t//配列に格納\n\t\t\t\t\t//i行のj列\n\t\t\t\t\tintTable[i][j] = intVector;\n\n\t\t\t\t\t//行の合計値をカウント\n\t\t\t\t\tintColumnSum += intVector;\n\n\t\t\t\t\t//列の合計値をカウント\n\t\t\t\t\tintTable[intLine][j] += intVector;\n\n\t\t\t\t\t//総合計値をカウント\n\t\t\t\t\tintSum += intVector;\n\t\t\t\t}\n\t\t\t\t//行の合計値を代入\n\t\t\t\tintTable[i][intColumn] = intColumnSum;\n\n\t\t\t\t//1行分終わったのでリセット\n\t\t\t\tintColumnSum = 0;\n\t\t\t}\n\n\t\t\t//総合計値を代入\n\t\t\tintTable[intLine][intColumn] = intSum;\n\n\t\t\t//計算して出力\n\t\t\tfor(int i = 0; i <= intLine; i++) {\n\t\t\t\tfor(int j = 0; j <= intColumn; j++) {\n\n\t\t\t\t\tif(j == 0) {\n\t\t\t\t\t\tSystem.out.print(intTable[i][j]);\n\t\t\t\t\t}else {\n\t\t\t\t\t\tSystem.out.print(\" \" + intTable[i][j]);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tSystem.out.println(\"\");\n\t\t\t}\n\n\t\t} catch (IOException e) {\n\t\t\tSystem.out.println(e);\n\t\t} catch (NumberFormatException e) {\n\t\t\tSystem.out.println(\"数字で入力して下さい\");\n\t\t}\n\t}\n}",
"public class Main{\n\n\t/**\n\t * プログラムのエントリポイント\n\t *\n\t * @param args\n\t */\n\tpublic static void main(String[] args) {\n\n\n\t\t//行や列の各数字の一時保管場所\n\t\tint intVector = 0;\n\n\t\t//入力値の各行の文字列の一時保管場所\n\t\tString strLineAll = \"\";\n\n\t\t//行の合計値\n\t\tint intColumnSum = 0;\n\n\t\t//行と列の全合計値\n\t\tint intSum = 0;\n\n\t\t//一行目を読み込む\n\t\ttry {\n\t\t\tBufferedReader insBR = new BufferedReader(new InputStreamReader(System.in));\n\n\t\t\tString strLine1 = insBR.readLine();\n\n\t\t\t//ばらけさせる\n\t\t\tString[] strAryLine1 = strLine1.split(\" \");\n\n\t\t\t//行の数\n\t\t\tint intLine = Integer.parseInt(strAryLine1[0]);\n\n\t\t\t//列の数\n\t\t\tint intColumn = Integer.parseInt(strAryLine1[1]);\n\n\t\t\t//行と列が決まったところで配列の大きさが決まる\n\t\t\tint[][] intTable = new int[intLine + 1][intColumn + 1];\n\n\t\t\t//二行目以降を読み込む\n\t\t\t//i行目\n\t\t\tfor(int i = 0; i < intLine; i++) {\n\t\t\t\tstrLineAll = insBR.readLine();\n\n\t\t\t//ばらけさせる\n\t\t\t\tString[] strAryLine = strLineAll.split(\" \");\n\n\t\t\t\t//int型にキャスト\n\t\t\t\t//j列目\n\t\t\t\tfor(int j = 0; j < intColumn; j++) {\n\t\t\t\t\tintVector = Integer.parseInt(strAryLine[j]);\n\n\t\t\t\t\t//配列に格納\n\t\t\t\t\t//i行のj列\n\t\t\t\t\tintTable[i][j] = intVector;\n\n\t\t\t\t\t//行の合計値をカウント\n\t\t\t\t\tintColumnSum += intVector;\n\n\t\t\t\t\t//列の合計値をカウント\n\t\t\t\t\tintTable[intLine][j] += intVector;\n\n\t\t\t\t\t//総合計値をカウント\n\t\t\t\t\tintSum += intVector;\n\t\t\t\t}\n\t\t\t\t//行の合計値を代入\n\t\t\t\tintTable[i][intColumn] = intColumnSum;\n\n\t\t\t\t//1行分終わったのでリセット\n\t\t\t\tintColumnSum = 0;\n\t\t\t}\n\n\t\t\t//総合計値を代入\n\t\t\tintTable[intLine][intColumn] = intSum;\n\n\t\t\t//計算して出力\n\t\t\tfor(int i = 0; i <= intLine; i++) {\n\t\t\t\tfor(int j = 0; j <= intColumn; j++) {\n\n\t\t\t\t\tif(j == 0) {\n\t\t\t\t\t\tSystem.out.print(intTable[i][j]);\n\t\t\t\t\t}else {\n\t\t\t\t\t\tSystem.out.print(\" \" + intTable[i][j]);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tSystem.out.println(\"\");\n\t\t\t}\n\n\t\t} catch (IOException e) {\n\t\t\tSystem.out.println(e);\n\t\t} catch (NumberFormatException e) {\n\t\t\tSystem.out.println(\"数字で入力して下さい\");\n\t\t}\n\t}\n}",
"Main"
] | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
/**
* Lesson7C 表の行数rと列数c、r × c の要素を持つ表を読み込んで、
* 各行と列の合計を挿入した新しい表を出力するプログラム
*
* @author Internship
*
*/
public class Main{
/**
* プログラムのエントリポイント
*
* @param args
*/
public static void main(String[] args) {
//行や列の各数字の一時保管場所
int intVector = 0;
//入力値の各行の文字列の一時保管場所
String strLineAll = "";
//行の合計値
int intColumnSum = 0;
//行と列の全合計値
int intSum = 0;
//一行目を読み込む
try {
BufferedReader insBR = new BufferedReader(new InputStreamReader(System.in));
String strLine1 = insBR.readLine();
//ばらけさせる
String[] strAryLine1 = strLine1.split(" ");
//行の数
int intLine = Integer.parseInt(strAryLine1[0]);
//列の数
int intColumn = Integer.parseInt(strAryLine1[1]);
//行と列が決まったところで配列の大きさが決まる
int[][] intTable = new int[intLine + 1][intColumn + 1];
//二行目以降を読み込む
//i行目
for(int i = 0; i < intLine; i++) {
strLineAll = insBR.readLine();
//ばらけさせる
String[] strAryLine = strLineAll.split(" ");
//int型にキャスト
//j列目
for(int j = 0; j < intColumn; j++) {
intVector = Integer.parseInt(strAryLine[j]);
//配列に格納
//i行のj列
intTable[i][j] = intVector;
//行の合計値をカウント
intColumnSum += intVector;
//列の合計値をカウント
intTable[intLine][j] += intVector;
//総合計値をカウント
intSum += intVector;
}
//行の合計値を代入
intTable[i][intColumn] = intColumnSum;
//1行分終わったのでリセット
intColumnSum = 0;
}
//総合計値を代入
intTable[intLine][intColumn] = intSum;
//計算して出力
for(int i = 0; i <= intLine; i++) {
for(int j = 0; j <= intColumn; j++) {
if(j == 0) {
System.out.print(intTable[i][j]);
}else {
System.out.print(" " + intTable[i][j]);
}
}
System.out.println("");
}
} catch (IOException e) {
System.out.println(e);
} catch (NumberFormatException e) {
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,
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,
13,
4,
18,
13,
18,
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,
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,
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,
30,
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
],
[
252,
11
],
[
252,
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
],
[
25,
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
],
[
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
],
[
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
],
[
14,
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
],
[
116,
118
],
[
115,
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
],
[
132,
134
],
[
134,
135
],
[
135,
136
],
[
135,
137
],
[
134,
138
],
[
115,
139
],
[
139,
140
],
[
140,
141
],
[
141,
142
],
[
141,
143
],
[
140,
144
],
[
139,
145
],
[
14,
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
],
[
161,
163
],
[
160,
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
],
[
177,
179
],
[
179,
180
],
[
180,
181
],
[
180,
182
],
[
179,
183
],
[
160,
184
],
[
184,
185
],
[
185,
186
],
[
186,
187
],
[
186,
188
],
[
185,
189
],
[
184,
190
],
[
14,
191
],
[
191,
192
],
[
192,
193
],
[
193,
194
],
[
193,
195
],
[
191,
196
],
[
196,
197
],
[
196,
198
],
[
198,
199
],
[
198,
200
],
[
191,
201
],
[
201,
202
],
[
202,
203
],
[
191,
204
],
[
205,
205
],
[
205,
206
],
[
206,
207
],
[
207,
208
],
[
208,
209
],
[
208,
210
],
[
206,
211
],
[
211,
212
],
[
211,
213
],
[
213,
214
],
[
213,
215
],
[
206,
216
],
[
216,
217
],
[
217,
218
],
[
206,
219
],
[
220,
220
],
[
220,
221
],
[
221,
222
],
[
222,
223
],
[
223,
224
],
[
223,
225
],
[
221,
226
],
[
226,
227
],
[
227,
228
],
[
227,
229
],
[
226,
230
],
[
220,
231
],
[
231,
232
],
[
232,
233
],
[
232,
234
],
[
231,
235
],
[
235,
236
],
[
236,
237
],
[
237,
238
],
[
238,
239
],
[
238,
240
],
[
236,
241
],
[
231,
242
],
[
242,
243
],
[
243,
244
],
[
244,
245
],
[
245,
246
],
[
245,
247
],
[
243,
248
],
[
12,
249
],
[
249,
250
],
[
0,
251
],
[
251,
252
],
[
251,
253
]
] | [
"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\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n String input = br.readLine();\n String[] strArray = input.split(\" \");\n\n int r = Integer.parseInt(strArray[0]); //???r\n int c = Integer.parseInt(strArray[1]); //???c\n\n int[][] table = new int[r+1][c+1];\n\n// ??????A???????????????\n for(int i = 0; i < r; i++){\n input = br.readLine();\n strArray = input.split(\" \");\n\n for(int j = 0; j < c; j++){\n table[i][j] = Integer.parseInt(strArray[j]);\n }\n }\n\n// ???????????????????????¨??????????????????????¨????????±???????\n for(int i = 0; i < r; i++){\n int sum = 0;\n\n for(int j = 0; j < c; j++){\n sum += table[i][j];\n }\n table[i][c] = sum;\n }\n\n// ???????????????????????¨??????????????????????¨????????±???????\n// ?????????????¨??????§?????????????????????????¨??????????????????§???\n// i????????????c+1??¨?????????\n for(int i = 0; i < c+1; i++){\n int sum = 0;\n\n for(int j = 0; j < r; j++){\n sum += table[j][i];\n }\n table[r][i] = sum;\n }\n\n// (r+1) ?? (c+1) ?????°????????¨?????????\n for(int i = 0; i < r+1; i++){\n\n for(int j = 0; j < c+1; j++){\n System.out.print(table[i][j]);\n\n if(j != c){\n System.out.print(\" \");\n }else{\n System.out.print(\"\\n\");\n }\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",
"public class Main {\n\n public static void main(String[] args) throws IOException {\n\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n String input = br.readLine();\n String[] strArray = input.split(\" \");\n\n int r = Integer.parseInt(strArray[0]); //???r\n int c = Integer.parseInt(strArray[1]); //???c\n\n int[][] table = new int[r+1][c+1];\n\n// ??????A???????????????\n for(int i = 0; i < r; i++){\n input = br.readLine();\n strArray = input.split(\" \");\n\n for(int j = 0; j < c; j++){\n table[i][j] = Integer.parseInt(strArray[j]);\n }\n }\n\n// ???????????????????????¨??????????????????????¨????????±???????\n for(int i = 0; i < r; i++){\n int sum = 0;\n\n for(int j = 0; j < c; j++){\n sum += table[i][j];\n }\n table[i][c] = sum;\n }\n\n// ???????????????????????¨??????????????????????¨????????±???????\n// ?????????????¨??????§?????????????????????????¨??????????????????§???\n// i????????????c+1??¨?????????\n for(int i = 0; i < c+1; i++){\n int sum = 0;\n\n for(int j = 0; j < r; j++){\n sum += table[j][i];\n }\n table[r][i] = sum;\n }\n\n// (r+1) ?? (c+1) ?????°????????¨?????????\n for(int i = 0; i < r+1; i++){\n\n for(int j = 0; j < c+1; j++){\n System.out.print(table[i][j]);\n\n if(j != c){\n System.out.print(\" \");\n }else{\n System.out.print(\"\\n\");\n }\n }\n }\n }\n}",
"Main",
"public static void main(String[] args) throws IOException {\n\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n String input = br.readLine();\n String[] strArray = input.split(\" \");\n\n int r = Integer.parseInt(strArray[0]); //???r\n int c = Integer.parseInt(strArray[1]); //???c\n\n int[][] table = new int[r+1][c+1];\n\n// ??????A???????????????\n for(int i = 0; i < r; i++){\n input = br.readLine();\n strArray = input.split(\" \");\n\n for(int j = 0; j < c; j++){\n table[i][j] = Integer.parseInt(strArray[j]);\n }\n }\n\n// ???????????????????????¨??????????????????????¨????????±???????\n for(int i = 0; i < r; i++){\n int sum = 0;\n\n for(int j = 0; j < c; j++){\n sum += table[i][j];\n }\n table[i][c] = sum;\n }\n\n// ???????????????????????¨??????????????????????¨????????±???????\n// ?????????????¨??????§?????????????????????????¨??????????????????§???\n// i????????????c+1??¨?????????\n for(int i = 0; i < c+1; i++){\n int sum = 0;\n\n for(int j = 0; j < r; j++){\n sum += table[j][i];\n }\n table[r][i] = sum;\n }\n\n// (r+1) ?? (c+1) ?????°????????¨?????????\n for(int i = 0; i < r+1; i++){\n\n for(int j = 0; j < c+1; j++){\n System.out.print(table[i][j]);\n\n if(j != c){\n System.out.print(\" \");\n }else{\n System.out.print(\"\\n\");\n }\n }\n }\n }",
"main",
"{\n\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n String input = br.readLine();\n String[] strArray = input.split(\" \");\n\n int r = Integer.parseInt(strArray[0]); //???r\n int c = Integer.parseInt(strArray[1]); //???c\n\n int[][] table = new int[r+1][c+1];\n\n// ??????A???????????????\n for(int i = 0; i < r; i++){\n input = br.readLine();\n strArray = input.split(\" \");\n\n for(int j = 0; j < c; j++){\n table[i][j] = Integer.parseInt(strArray[j]);\n }\n }\n\n// ???????????????????????¨??????????????????????¨????????±???????\n for(int i = 0; i < r; i++){\n int sum = 0;\n\n for(int j = 0; j < c; j++){\n sum += table[i][j];\n }\n table[i][c] = sum;\n }\n\n// ???????????????????????¨??????????????????????¨????????±???????\n// ?????????????¨??????§?????????????????????????¨??????????????????§???\n// i????????????c+1??¨?????????\n for(int i = 0; i < c+1; i++){\n int sum = 0;\n\n for(int j = 0; j < r; j++){\n sum += table[j][i];\n }\n table[r][i] = sum;\n }\n\n// (r+1) ?? (c+1) ?????°????????¨?????????\n for(int i = 0; i < r+1; i++){\n\n for(int j = 0; j < c+1; j++){\n System.out.print(table[i][j]);\n\n if(j != c){\n System.out.print(\" \");\n }else{\n System.out.print(\"\\n\");\n }\n }\n }\n }",
"BufferedReader br = new BufferedReader(new InputStreamReader(System.in));",
"br",
"new BufferedReader(new InputStreamReader(System.in))",
"String input = br.readLine();",
"input",
"br.readLine()",
"br.readLine",
"br",
"String[] strArray = input.split(\" \");",
"strArray",
"input.split(\" \")",
"input.split",
"input",
"\" \"",
"int r = Integer.parseInt(strArray[0]);",
"r",
"Integer.parseInt(strArray[0])",
"Integer.parseInt",
"Integer",
"strArray[0]",
"strArray",
"0",
"int c = Integer.parseInt(strArray[1]);",
"c",
"Integer.parseInt(strArray[1])",
"Integer.parseInt",
"Integer",
"strArray[1]",
"strArray",
"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 input = br.readLine();\n strArray = input.split(\" \");\n\n for(int j = 0; j < c; j++){\n table[i][j] = Integer.parseInt(strArray[j]);\n }\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < r",
"i",
"r",
"i++",
"i++",
"i",
"{\n input = br.readLine();\n strArray = input.split(\" \");\n\n for(int j = 0; j < c; j++){\n table[i][j] = Integer.parseInt(strArray[j]);\n }\n }",
"{\n input = br.readLine();\n strArray = input.split(\" \");\n\n for(int j = 0; j < c; j++){\n table[i][j] = Integer.parseInt(strArray[j]);\n }\n }",
"input = br.readLine()",
"input",
"br.readLine()",
"br.readLine",
"br",
"strArray = input.split(\" \")",
"strArray",
"input.split(\" \")",
"input.split",
"input",
"\" \"",
"for(int j = 0; j < c; j++){\n table[i][j] = Integer.parseInt(strArray[j]);\n }",
"int j = 0;",
"int j = 0;",
"j",
"0",
"j < c",
"j",
"c",
"j++",
"j++",
"j",
"{\n table[i][j] = Integer.parseInt(strArray[j]);\n }",
"{\n table[i][j] = Integer.parseInt(strArray[j]);\n }",
"table[i][j] = Integer.parseInt(strArray[j])",
"table[i][j]",
"table[i]",
"table",
"i",
"j",
"Integer.parseInt(strArray[j])",
"Integer.parseInt",
"Integer",
"strArray[j]",
"strArray",
"j",
"for(int i = 0; i < r; i++){\n int sum = 0;\n\n for(int j = 0; j < c; j++){\n sum += table[i][j];\n }\n table[i][c] = sum;\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < r",
"i",
"r",
"i++",
"i++",
"i",
"{\n int sum = 0;\n\n for(int j = 0; j < c; j++){\n sum += table[i][j];\n }\n table[i][c] = sum;\n }",
"{\n int sum = 0;\n\n for(int j = 0; j < c; j++){\n sum += table[i][j];\n }\n table[i][c] = sum;\n }",
"int sum = 0;",
"sum",
"0",
"for(int j = 0; j < c; j++){\n sum += table[i][j];\n }",
"int j = 0;",
"int j = 0;",
"j",
"0",
"j < c",
"j",
"c",
"j++",
"j++",
"j",
"{\n sum += table[i][j];\n }",
"{\n sum += table[i][j];\n }",
"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",
"for(int i = 0; i < c+1; i++){\n int sum = 0;\n\n for(int j = 0; j < r; j++){\n sum += table[j][i];\n }\n table[r][i] = sum;\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < c+1",
"i",
"c+1",
"c",
"1",
"i++",
"i++",
"i",
"{\n int sum = 0;\n\n for(int j = 0; j < r; j++){\n sum += table[j][i];\n }\n table[r][i] = sum;\n }",
"{\n int sum = 0;\n\n for(int j = 0; j < r; j++){\n sum += table[j][i];\n }\n table[r][i] = sum;\n }",
"int sum = 0;",
"sum",
"0",
"for(int j = 0; j < r; j++){\n sum += table[j][i];\n }",
"int j = 0;",
"int j = 0;",
"j",
"0",
"j < r",
"j",
"r",
"j++",
"j++",
"j",
"{\n sum += table[j][i];\n }",
"{\n sum += table[j][i];\n }",
"sum += table[j][i]",
"sum",
"table[j][i]",
"table[j]",
"table",
"j",
"i",
"table[r][i] = sum",
"table[r][i]",
"table[r]",
"table",
"r",
"i",
"sum",
"for(int i = 0; i < r+1; i++){\n\n for(int j = 0; j < c+1; j++){\n System.out.print(table[i][j]);\n\n if(j != c){\n System.out.print(\" \");\n }else{\n System.out.print(\"\\n\");\n }\n }\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < r+1",
"i",
"r+1",
"r",
"1",
"i++",
"i++",
"i",
"{\n\n for(int j = 0; j < c+1; j++){\n System.out.print(table[i][j]);\n\n if(j != c){\n System.out.print(\" \");\n }else{\n System.out.print(\"\\n\");\n }\n }\n }",
"{\n\n for(int j = 0; j < c+1; j++){\n System.out.print(table[i][j]);\n\n if(j != c){\n System.out.print(\" \");\n }else{\n System.out.print(\"\\n\");\n }\n }\n }",
"for(int j = 0; j < c+1; j++){\n System.out.print(table[i][j]);\n\n if(j != c){\n System.out.print(\" \");\n }else{\n System.out.print(\"\\n\");\n }\n }",
"int j = 0;",
"int j = 0;",
"j",
"0",
"j < c+1",
"j",
"c+1",
"c",
"1",
"j++",
"j++",
"j",
"{\n System.out.print(table[i][j]);\n\n if(j != c){\n System.out.print(\" \");\n }else{\n System.out.print(\"\\n\");\n }\n }",
"{\n System.out.print(table[i][j]);\n\n if(j != c){\n System.out.print(\" \");\n }else{\n System.out.print(\"\\n\");\n }\n }",
"System.out.print(table[i][j])",
"System.out.print",
"System.out",
"System",
"System.out",
"table[i][j]",
"table[i]",
"table",
"i",
"j",
"if(j != c){\n System.out.print(\" \");\n }else{\n System.out.print(\"\\n\");\n }",
"j != c",
"j",
"c",
"{\n System.out.print(\" \");\n }",
"System.out.print(\" \")",
"System.out.print",
"System.out",
"System",
"System.out",
"\" \"",
"{\n System.out.print(\"\\n\");\n }",
"System.out.print(\"\\n\")",
"System.out.print",
"System.out",
"System",
"System.out",
"\"\\n\"",
"String[] args",
"args",
"public class Main {\n\n public static void main(String[] args) throws IOException {\n\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n String input = br.readLine();\n String[] strArray = input.split(\" \");\n\n int r = Integer.parseInt(strArray[0]); //???r\n int c = Integer.parseInt(strArray[1]); //???c\n\n int[][] table = new int[r+1][c+1];\n\n// ??????A???????????????\n for(int i = 0; i < r; i++){\n input = br.readLine();\n strArray = input.split(\" \");\n\n for(int j = 0; j < c; j++){\n table[i][j] = Integer.parseInt(strArray[j]);\n }\n }\n\n// ???????????????????????¨??????????????????????¨????????±???????\n for(int i = 0; i < r; i++){\n int sum = 0;\n\n for(int j = 0; j < c; j++){\n sum += table[i][j];\n }\n table[i][c] = sum;\n }\n\n// ???????????????????????¨??????????????????????¨????????±???????\n// ?????????????¨??????§?????????????????????????¨??????????????????§???\n// i????????????c+1??¨?????????\n for(int i = 0; i < c+1; i++){\n int sum = 0;\n\n for(int j = 0; j < r; j++){\n sum += table[j][i];\n }\n table[r][i] = sum;\n }\n\n// (r+1) ?? (c+1) ?????°????????¨?????????\n for(int i = 0; i < r+1; i++){\n\n for(int j = 0; j < c+1; j++){\n System.out.print(table[i][j]);\n\n if(j != c){\n System.out.print(\" \");\n }else{\n System.out.print(\"\\n\");\n }\n }\n }\n }\n}",
"public class Main {\n\n public static void main(String[] args) throws IOException {\n\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n String input = br.readLine();\n String[] strArray = input.split(\" \");\n\n int r = Integer.parseInt(strArray[0]); //???r\n int c = Integer.parseInt(strArray[1]); //???c\n\n int[][] table = new int[r+1][c+1];\n\n// ??????A???????????????\n for(int i = 0; i < r; i++){\n input = br.readLine();\n strArray = input.split(\" \");\n\n for(int j = 0; j < c; j++){\n table[i][j] = Integer.parseInt(strArray[j]);\n }\n }\n\n// ???????????????????????¨??????????????????????¨????????±???????\n for(int i = 0; i < r; i++){\n int sum = 0;\n\n for(int j = 0; j < c; j++){\n sum += table[i][j];\n }\n table[i][c] = sum;\n }\n\n// ???????????????????????¨??????????????????????¨????????±???????\n// ?????????????¨??????§?????????????????????????¨??????????????????§???\n// i????????????c+1??¨?????????\n for(int i = 0; i < c+1; i++){\n int sum = 0;\n\n for(int j = 0; j < r; j++){\n sum += table[j][i];\n }\n table[r][i] = sum;\n }\n\n// (r+1) ?? (c+1) ?????°????????¨?????????\n for(int i = 0; i < r+1; i++){\n\n for(int j = 0; j < c+1; j++){\n System.out.print(table[i][j]);\n\n if(j != c){\n System.out.print(\" \");\n }else{\n System.out.print(\"\\n\");\n }\n }\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 input = br.readLine();
String[] strArray = input.split(" ");
int r = Integer.parseInt(strArray[0]); //???r
int c = Integer.parseInt(strArray[1]); //???c
int[][] table = new int[r+1][c+1];
// ??????A???????????????
for(int i = 0; i < r; i++){
input = br.readLine();
strArray = input.split(" ");
for(int j = 0; j < c; j++){
table[i][j] = Integer.parseInt(strArray[j]);
}
}
// ???????????????????????¨??????????????????????¨????????±???????
for(int i = 0; i < r; i++){
int sum = 0;
for(int j = 0; j < c; j++){
sum += table[i][j];
}
table[i][c] = sum;
}
// ???????????????????????¨??????????????????????¨????????±???????
// ?????????????¨??????§?????????????????????????¨??????????????????§???
// i????????????c+1??¨?????????
for(int i = 0; i < c+1; i++){
int sum = 0;
for(int j = 0; j < r; j++){
sum += table[j][i];
}
table[r][i] = sum;
}
// (r+1) ?? (c+1) ?????°????????¨?????????
for(int i = 0; i < r+1; i++){
for(int j = 0; j < c+1; j++){
System.out.print(table[i][j]);
if(j != c){
System.out.print(" ");
}else{
System.out.print("\n");
}
}
}
}
} |
[
7,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
13,
4,
18,
4,
18,
13,
17,
41,
13,
20,
18,
13,
17,
18,
13,
17,
41,
13,
20,
18,
13,
17,
11,
1,
41,
13,
17,
2,
13,
18,
13,
17,
1,
40,
13,
30,
30,
0,
18,
13,
13,
4,
13,
4,
18,
4,
18,
13,
17,
11,
1,
41,
13,
17,
2,
13,
18,
13,
17,
1,
40,
13,
30,
30,
11,
1,
41,
13,
17,
2,
13,
18,
13,
17,
1,
40,
13,
30,
30,
0,
18,
13,
13,
18,
18,
13,
13,
13,
4,
18,
18,
13,
13,
2,
18,
18,
13,
13,
13,
17,
4,
18,
18,
13,
13,
4,
13,
18,
13,
13,
11,
1,
41,
13,
17,
2,
13,
18,
13,
17,
1,
40,
13,
30,
30,
4,
18,
18,
13,
13,
2,
18,
13,
13,
17,
4,
18,
18,
13,
13,
4,
13,
13,
23,
13,
12,
13,
30,
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,
12,
13,
30,
41,
13,
17,
28,
13,
13,
30,
30,
0,
13,
13,
29,
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
],
[
17,
19
],
[
19,
20
],
[
20,
21
],
[
21,
22
],
[
22,
23
],
[
19,
24
],
[
11,
25
],
[
25,
26
],
[
25,
27
],
[
28,
29
],
[
28,
30
],
[
31,
32
],
[
31,
33
],
[
11,
34
],
[
34,
35
],
[
34,
36
],
[
37,
38
],
[
37,
39
],
[
11,
40
],
[
40,
41
],
[
41,
42
],
[
42,
43
],
[
42,
44
],
[
40,
45
],
[
45,
46
],
[
45,
47
],
[
47,
48
],
[
47,
49
],
[
40,
50
],
[
50,
51
],
[
51,
52
],
[
40,
53
],
[
54,
54
],
[
54,
55
],
[
55,
56
],
[
56,
57
],
[
56,
58
],
[
55,
59
],
[
59,
60
],
[
59,
61
],
[
61,
62
],
[
62,
63
],
[
63,
64
],
[
64,
65
],
[
61,
66
],
[
11,
67
],
[
67,
68
],
[
68,
69
],
[
69,
70
],
[
69,
71
],
[
67,
72
],
[
72,
73
],
[
72,
74
],
[
74,
75
],
[
74,
76
],
[
67,
77
],
[
77,
78
],
[
78,
79
],
[
67,
80
],
[
81,
81
],
[
81,
82
],
[
82,
83
],
[
83,
84
],
[
84,
85
],
[
84,
86
],
[
82,
87
],
[
87,
88
],
[
87,
89
],
[
89,
90
],
[
89,
91
],
[
82,
92
],
[
92,
93
],
[
93,
94
],
[
82,
95
],
[
96,
96
],
[
96,
97
],
[
97,
98
],
[
98,
99
],
[
98,
100
],
[
97,
101
],
[
101,
102
],
[
102,
103
],
[
102,
104
],
[
101,
105
],
[
96,
106
],
[
106,
107
],
[
107,
108
],
[
108,
109
],
[
108,
110
],
[
106,
111
],
[
111,
112
],
[
112,
113
],
[
113,
114
],
[
113,
115
],
[
112,
116
],
[
111,
117
],
[
81,
118
],
[
118,
119
],
[
119,
120
],
[
120,
121
],
[
120,
122
],
[
118,
123
],
[
123,
124
],
[
123,
125
],
[
125,
126
],
[
125,
127
],
[
11,
128
],
[
128,
129
],
[
129,
130
],
[
130,
131
],
[
130,
132
],
[
128,
133
],
[
133,
134
],
[
133,
135
],
[
135,
136
],
[
135,
137
],
[
128,
138
],
[
138,
139
],
[
139,
140
],
[
128,
141
],
[
142,
142
],
[
142,
143
],
[
143,
144
],
[
144,
145
],
[
145,
146
],
[
145,
147
],
[
143,
148
],
[
148,
149
],
[
149,
150
],
[
149,
151
],
[
148,
152
],
[
11,
153
],
[
153,
154
],
[
154,
155
],
[
155,
156
],
[
155,
157
],
[
153,
158
],
[
158,
159
],
[
158,
160
],
[
9,
161
],
[
161,
162
],
[
7,
163
],
[
163,
164
],
[
163,
165
],
[
165,
166
],
[
166,
167
],
[
166,
168
],
[
169,
170
],
[
169,
171
],
[
165,
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
],
[
188,
190
],
[
187,
191
],
[
191,
192
],
[
192,
193
],
[
191,
194
],
[
194,
195
],
[
194,
196
],
[
165,
197
],
[
197,
198
],
[
163,
199
],
[
199,
200
],
[
7,
201
],
[
201,
202
],
[
201,
203
],
[
203,
204
],
[
204,
205
],
[
204,
206
],
[
203,
207
],
[
207,
208
],
[
207,
209
],
[
207,
210
],
[
211,
211
],
[
211,
212
],
[
212,
213
],
[
212,
214
],
[
203,
215
],
[
215,
216
],
[
201,
217
],
[
217,
218
]
] | [
"import java.io.*;\nimport java.util.Arrays;\n\nclass Main{\n\tpublic static void main(String[] args)throws IOException{\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\t\tint in[] = parseInts(br.readLine().split(\" \"));\n\t\tint in1[][] = new int[in[0]][in[1]];\n\t\tint in2[] = new int[in[1]];\n\t\tfor(int i=0; i<in[0]; i++){\n\t\t\tin1[i] = parseInts(br.readLine().split(\" \"));\n\t\t}\n\t\tfor(int n=0; n<in[0]; n++){\n\t\t\tfor(int m=0; m<in[1]; m++){\n\t\t\t\tin2[m] += in1[n][m];\n\t\t\t\tSystem.out.print(in1[n][m] + \" \");\n\t\t\t}\n\t\t\tSystem.out.println(sum(in1[n]));\n\t\t}\n\t\tfor(int i=0; i<in[1]; i++){\n\t\t\tSystem.out.print(in2[i] + \" \");\n\t\t}\n\t\tSystem.out.println(sum(in2));\n\t}\n\tstatic int[] parseInts(String[] s){\n\t\tint[] x = new int[s.length];\n\t\tfor(int i=0; i<s.length; i++){\n\t\t\tx[i] = Integer.parseInt(s[i]);\n\t\t}\n\t\treturn x;\n\t}\n\tstatic int sum(int[] x){\n\t\tint t = 0;\n\t\tfor(int a : x){\n\t\t\tt += a;\n\t\t}\n\t\treturn t;\n\t}\n}",
"import java.io.*;",
"io.*",
"java",
"import java.util.Arrays;",
"Arrays",
"java.util",
"class Main{\n\tpublic static void main(String[] args)throws IOException{\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\t\tint in[] = parseInts(br.readLine().split(\" \"));\n\t\tint in1[][] = new int[in[0]][in[1]];\n\t\tint in2[] = new int[in[1]];\n\t\tfor(int i=0; i<in[0]; i++){\n\t\t\tin1[i] = parseInts(br.readLine().split(\" \"));\n\t\t}\n\t\tfor(int n=0; n<in[0]; n++){\n\t\t\tfor(int m=0; m<in[1]; m++){\n\t\t\t\tin2[m] += in1[n][m];\n\t\t\t\tSystem.out.print(in1[n][m] + \" \");\n\t\t\t}\n\t\t\tSystem.out.println(sum(in1[n]));\n\t\t}\n\t\tfor(int i=0; i<in[1]; i++){\n\t\t\tSystem.out.print(in2[i] + \" \");\n\t\t}\n\t\tSystem.out.println(sum(in2));\n\t}\n\tstatic int[] parseInts(String[] s){\n\t\tint[] x = new int[s.length];\n\t\tfor(int i=0; i<s.length; i++){\n\t\t\tx[i] = Integer.parseInt(s[i]);\n\t\t}\n\t\treturn x;\n\t}\n\tstatic int sum(int[] x){\n\t\tint t = 0;\n\t\tfor(int a : x){\n\t\t\tt += a;\n\t\t}\n\t\treturn 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\tint in[] = parseInts(br.readLine().split(\" \"));\n\t\tint in1[][] = new int[in[0]][in[1]];\n\t\tint in2[] = new int[in[1]];\n\t\tfor(int i=0; i<in[0]; i++){\n\t\t\tin1[i] = parseInts(br.readLine().split(\" \"));\n\t\t}\n\t\tfor(int n=0; n<in[0]; n++){\n\t\t\tfor(int m=0; m<in[1]; m++){\n\t\t\t\tin2[m] += in1[n][m];\n\t\t\t\tSystem.out.print(in1[n][m] + \" \");\n\t\t\t}\n\t\t\tSystem.out.println(sum(in1[n]));\n\t\t}\n\t\tfor(int i=0; i<in[1]; i++){\n\t\t\tSystem.out.print(in2[i] + \" \");\n\t\t}\n\t\tSystem.out.println(sum(in2));\n\t}",
"main",
"{\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\t\tint in[] = parseInts(br.readLine().split(\" \"));\n\t\tint in1[][] = new int[in[0]][in[1]];\n\t\tint in2[] = new int[in[1]];\n\t\tfor(int i=0; i<in[0]; i++){\n\t\t\tin1[i] = parseInts(br.readLine().split(\" \"));\n\t\t}\n\t\tfor(int n=0; n<in[0]; n++){\n\t\t\tfor(int m=0; m<in[1]; m++){\n\t\t\t\tin2[m] += in1[n][m];\n\t\t\t\tSystem.out.print(in1[n][m] + \" \");\n\t\t\t}\n\t\t\tSystem.out.println(sum(in1[n]));\n\t\t}\n\t\tfor(int i=0; i<in[1]; i++){\n\t\t\tSystem.out.print(in2[i] + \" \");\n\t\t}\n\t\tSystem.out.println(sum(in2));\n\t}",
"BufferedReader br = new BufferedReader(new InputStreamReader(System.in));",
"br",
"new BufferedReader(new InputStreamReader(System.in))",
"int in[] = parseInts(br.readLine().split(\" \"));",
"in",
"parseInts(br.readLine().split(\" \"))",
"parseInts",
"br.readLine().split(\" \")",
"br.readLine().split",
"br.readLine()",
"br.readLine",
"br",
"\" \"",
"int in1[][] = new int[in[0]][in[1]];",
"in1",
"new int[in[0]][in[1]]",
"in[0]",
"in",
"0",
"in[1]",
"in",
"1",
"int in2[] = new int[in[1]];",
"in2",
"new int[in[1]]",
"in[1]",
"in",
"1",
"for(int i=0; i<in[0]; i++){\n\t\t\tin1[i] = parseInts(br.readLine().split(\" \"));\n\t\t}",
"int i=0;",
"int i=0;",
"i",
"0",
"i<in[0]",
"i",
"in[0]",
"in",
"0",
"i++",
"i++",
"i",
"{\n\t\t\tin1[i] = parseInts(br.readLine().split(\" \"));\n\t\t}",
"{\n\t\t\tin1[i] = parseInts(br.readLine().split(\" \"));\n\t\t}",
"in1[i] = parseInts(br.readLine().split(\" \"))",
"in1[i]",
"in1",
"i",
"parseInts(br.readLine().split(\" \"))",
"parseInts",
"br.readLine().split(\" \")",
"br.readLine().split",
"br.readLine()",
"br.readLine",
"br",
"\" \"",
"for(int n=0; n<in[0]; n++){\n\t\t\tfor(int m=0; m<in[1]; m++){\n\t\t\t\tin2[m] += in1[n][m];\n\t\t\t\tSystem.out.print(in1[n][m] + \" \");\n\t\t\t}\n\t\t\tSystem.out.println(sum(in1[n]));\n\t\t}",
"int n=0;",
"int n=0;",
"n",
"0",
"n<in[0]",
"n",
"in[0]",
"in",
"0",
"n++",
"n++",
"n",
"{\n\t\t\tfor(int m=0; m<in[1]; m++){\n\t\t\t\tin2[m] += in1[n][m];\n\t\t\t\tSystem.out.print(in1[n][m] + \" \");\n\t\t\t}\n\t\t\tSystem.out.println(sum(in1[n]));\n\t\t}",
"{\n\t\t\tfor(int m=0; m<in[1]; m++){\n\t\t\t\tin2[m] += in1[n][m];\n\t\t\t\tSystem.out.print(in1[n][m] + \" \");\n\t\t\t}\n\t\t\tSystem.out.println(sum(in1[n]));\n\t\t}",
"for(int m=0; m<in[1]; m++){\n\t\t\t\tin2[m] += in1[n][m];\n\t\t\t\tSystem.out.print(in1[n][m] + \" \");\n\t\t\t}",
"int m=0;",
"int m=0;",
"m",
"0",
"m<in[1]",
"m",
"in[1]",
"in",
"1",
"m++",
"m++",
"m",
"{\n\t\t\t\tin2[m] += in1[n][m];\n\t\t\t\tSystem.out.print(in1[n][m] + \" \");\n\t\t\t}",
"{\n\t\t\t\tin2[m] += in1[n][m];\n\t\t\t\tSystem.out.print(in1[n][m] + \" \");\n\t\t\t}",
"in2[m] += in1[n][m]",
"in2[m]",
"in2",
"m",
"in1[n][m]",
"in1[n]",
"in1",
"n",
"m",
"System.out.print(in1[n][m] + \" \")",
"System.out.print",
"System.out",
"System",
"System.out",
"in1[n][m] + \" \"",
"in1[n][m]",
"in1[n]",
"in1",
"n",
"m",
"\" \"",
"System.out.println(sum(in1[n]))",
"System.out.println",
"System.out",
"System",
"System.out",
"sum(in1[n])",
"sum",
"in1[n]",
"in1",
"n",
"for(int i=0; i<in[1]; i++){\n\t\t\tSystem.out.print(in2[i] + \" \");\n\t\t}",
"int i=0;",
"int i=0;",
"i",
"0",
"i<in[1]",
"i",
"in[1]",
"in",
"1",
"i++",
"i++",
"i",
"{\n\t\t\tSystem.out.print(in2[i] + \" \");\n\t\t}",
"{\n\t\t\tSystem.out.print(in2[i] + \" \");\n\t\t}",
"System.out.print(in2[i] + \" \")",
"System.out.print",
"System.out",
"System",
"System.out",
"in2[i] + \" \"",
"in2[i]",
"in2",
"i",
"\" \"",
"System.out.println(sum(in2))",
"System.out.println",
"System.out",
"System",
"System.out",
"sum(in2)",
"sum",
"in2",
"String[] args",
"args",
"static int[] parseInts(String[] s){\n\t\tint[] x = new int[s.length];\n\t\tfor(int i=0; i<s.length; i++){\n\t\t\tx[i] = Integer.parseInt(s[i]);\n\t\t}\n\t\treturn x;\n\t}",
"parseInts",
"{\n\t\tint[] x = new int[s.length];\n\t\tfor(int i=0; i<s.length; i++){\n\t\t\tx[i] = Integer.parseInt(s[i]);\n\t\t}\n\t\treturn x;\n\t}",
"int[] x = new int[s.length];",
"x",
"new int[s.length]",
"s.length",
"s",
"s.length",
"for(int i=0; i<s.length; i++){\n\t\t\tx[i] = Integer.parseInt(s[i]);\n\t\t}",
"int i=0;",
"int i=0;",
"i",
"0",
"i<s.length",
"i",
"s.length",
"s",
"s.length",
"i++",
"i++",
"i",
"{\n\t\t\tx[i] = Integer.parseInt(s[i]);\n\t\t}",
"{\n\t\t\tx[i] = Integer.parseInt(s[i]);\n\t\t}",
"x[i] = Integer.parseInt(s[i])",
"x[i]",
"x",
"i",
"Integer.parseInt(s[i])",
"Integer.parseInt",
"Integer",
"s[i]",
"s",
"i",
"return x;",
"x",
"String[] s",
"s",
"static int sum(int[] x){\n\t\tint t = 0;\n\t\tfor(int a : x){\n\t\t\tt += a;\n\t\t}\n\t\treturn t;\n\t}",
"sum",
"{\n\t\tint t = 0;\n\t\tfor(int a : x){\n\t\t\tt += a;\n\t\t}\n\t\treturn t;\n\t}",
"int t = 0;",
"t",
"0",
"for(int a : x){\n\t\t\tt += a;\n\t\t}",
"int a",
"x",
"{\n\t\t\tt += a;\n\t\t}",
"{\n\t\t\tt += a;\n\t\t}",
"t += a",
"t",
"a",
"return t;",
"t",
"int[] x",
"x"
] | import java.io.*;
import java.util.Arrays;
class Main{
public static void main(String[] args)throws IOException{
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
int in[] = parseInts(br.readLine().split(" "));
int in1[][] = new int[in[0]][in[1]];
int in2[] = new int[in[1]];
for(int i=0; i<in[0]; i++){
in1[i] = parseInts(br.readLine().split(" "));
}
for(int n=0; n<in[0]; n++){
for(int m=0; m<in[1]; m++){
in2[m] += in1[n][m];
System.out.print(in1[n][m] + " ");
}
System.out.println(sum(in1[n]));
}
for(int i=0; i<in[1]; i++){
System.out.print(in2[i] + " ");
}
System.out.println(sum(in2));
}
static int[] parseInts(String[] s){
int[] x = new int[s.length];
for(int i=0; i<s.length; i++){
x[i] = Integer.parseInt(s[i]);
}
return x;
}
static int sum(int[] x){
int t = 0;
for(int a : x){
t += a;
}
return t;
}
} |
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
17,
41,
13,
17,
41,
13,
20,
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,
14,
2,
2,
13,
17,
2,
13,
17,
30,
0,
13,
17,
14,
2,
2,
13,
17,
2,
13,
17,
30,
0,
13,
17,
14,
2,
13,
17,
30,
41,
13,
20,
2,
13,
17,
2,
13,
17,
41,
13,
20,
13,
14,
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,
14,
2,
13,
17,
30,
4,
18,
18,
13,
13,
2,
17,
18,
18,
13,
13,
13,
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
],
[
173,
5
],
[
173,
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,
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
],
[
59,
60
],
[
60,
61
],
[
60,
62
],
[
59,
63
],
[
63,
64
],
[
63,
65
],
[
58,
66
],
[
66,
67
],
[
67,
68
],
[
67,
69
],
[
8,
70
],
[
70,
71
],
[
71,
72
],
[
72,
73
],
[
72,
74
],
[
71,
75
],
[
75,
76
],
[
75,
77
],
[
70,
78
],
[
78,
79
],
[
79,
80
],
[
79,
81
],
[
8,
82
],
[
82,
83
],
[
83,
84
],
[
83,
85
],
[
82,
86
],
[
86,
87
],
[
87,
88
],
[
87,
89
],
[
90,
91
],
[
90,
92
],
[
93,
94
],
[
93,
95
],
[
86,
96
],
[
96,
97
],
[
96,
98
],
[
86,
100
],
[
100,
101
],
[
101,
102
],
[
101,
103
],
[
100,
104
],
[
104,
105
],
[
105,
106
],
[
106,
107
],
[
107,
108
],
[
107,
109
],
[
105,
110
],
[
110,
111
],
[
110,
112
],
[
112,
113
],
[
112,
114
],
[
105,
115
],
[
115,
116
],
[
116,
117
],
[
105,
118
],
[
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
],
[
145,
146
],
[
145,
147
],
[
147,
148
],
[
148,
149
],
[
148,
150
],
[
147,
151
],
[
135,
152
],
[
152,
153
],
[
153,
154
],
[
154,
155
],
[
155,
156
],
[
155,
157
],
[
153,
158
],
[
158,
159
],
[
158,
160
],
[
160,
161
],
[
161,
162
],
[
161,
163
],
[
160,
164
],
[
119,
165
],
[
165,
166
],
[
166,
167
],
[
167,
168
],
[
167,
169
],
[
6,
170
],
[
170,
171
],
[
0,
172
],
[
172,
173
],
[
172,
174
]
] | [
"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 input1 = \"\";\n\t\tString input2 = \"\";\n\t\tString[] input_rc = new String[2];\n\t\tint r = 0;\n\t\tint c = 0;\n\t\tboolean judge = true;\n\n\t\tinput1 = sc.nextLine();\n\t\tinput_rc = input1.split(\" \");\n\t\tr = Integer.parseInt(input_rc[0]);\n\t\tc = Integer.parseInt(input_rc[1]);\n\n\t\tif (r < 1 || r > 100) {\n\t\t\tjudge = false;\n\t\t}\n\n\t\tif (c < 1 || c > 100) {\n\t\t\tjudge = false;\n\t\t}\n\n\t\tif (judge == true) {\n\t\t\t// String[] outputstring = new String[r + 1];\n\t\t\tint[][] output_data = new int[r + 1][c + 1];\n\t\t\tString[] string_data = new String[c];\n\n\t\t\t// 1行ずつ入力される行列データを処理する\n\t\t\tout: for (int i = 0; i < r; i++) {\n\t\t\t\tinput2 = sc.nextLine(); // 1行ずつ入力される各行のデータを受け取る\n\t\t\t\tstring_data = input2.split(\" \"); // 1行ずつ入力される各行のデータを半角区切りで分けて格納する\n\n\t\t\t\t// 各行の各列のデータの処理を行う\n\t\t\t\tfor (int j = 0; j < c; j++) {\n\t\t\t\t\toutput_data[i][j] = Integer.parseInt(string_data[j]);\n\t\t\t\t\tif (output_data[i][j] < 0 || output_data[i][j] > 100) {\n\t\t\t\t\t\tjudge = false;\n\t\t\t\t\t\tbreak out;\n\t\t\t\t\t}\n\t\t\t\t\toutput_data[r][j] += output_data[i][j];\n\t\t\t\t\toutput_data[i][c] += output_data[i][j];\n\t\t\t\t\toutput_data[r][c] += output_data[i][j];\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tif (judge == true) {\n\t\t\t\tfor (int k = 0; k < (r + 1); k++) {\n\t\t\t\t\tfor (int m = 0; m < (c + 1); m++) {\n\t\t\t\t\t\tif (m == 0) {\n\t\t\t\t\t\t\tSystem.out.print(\"\" + output_data[k][m]);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tSystem.out.print(\" \" + output_data[k][m]);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\t\t\t\t\tSystem.out.println();\n\n\t\t\t\t}\n\t\t\t}\n\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\tString input1 = \"\";\n\t\tString input2 = \"\";\n\t\tString[] input_rc = new String[2];\n\t\tint r = 0;\n\t\tint c = 0;\n\t\tboolean judge = true;\n\n\t\tinput1 = sc.nextLine();\n\t\tinput_rc = input1.split(\" \");\n\t\tr = Integer.parseInt(input_rc[0]);\n\t\tc = Integer.parseInt(input_rc[1]);\n\n\t\tif (r < 1 || r > 100) {\n\t\t\tjudge = false;\n\t\t}\n\n\t\tif (c < 1 || c > 100) {\n\t\t\tjudge = false;\n\t\t}\n\n\t\tif (judge == true) {\n\t\t\t// String[] outputstring = new String[r + 1];\n\t\t\tint[][] output_data = new int[r + 1][c + 1];\n\t\t\tString[] string_data = new String[c];\n\n\t\t\t// 1行ずつ入力される行列データを処理する\n\t\t\tout: for (int i = 0; i < r; i++) {\n\t\t\t\tinput2 = sc.nextLine(); // 1行ずつ入力される各行のデータを受け取る\n\t\t\t\tstring_data = input2.split(\" \"); // 1行ずつ入力される各行のデータを半角区切りで分けて格納する\n\n\t\t\t\t// 各行の各列のデータの処理を行う\n\t\t\t\tfor (int j = 0; j < c; j++) {\n\t\t\t\t\toutput_data[i][j] = Integer.parseInt(string_data[j]);\n\t\t\t\t\tif (output_data[i][j] < 0 || output_data[i][j] > 100) {\n\t\t\t\t\t\tjudge = false;\n\t\t\t\t\t\tbreak out;\n\t\t\t\t\t}\n\t\t\t\t\toutput_data[r][j] += output_data[i][j];\n\t\t\t\t\toutput_data[i][c] += output_data[i][j];\n\t\t\t\t\toutput_data[r][c] += output_data[i][j];\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tif (judge == true) {\n\t\t\t\tfor (int k = 0; k < (r + 1); k++) {\n\t\t\t\t\tfor (int m = 0; m < (c + 1); m++) {\n\t\t\t\t\t\tif (m == 0) {\n\t\t\t\t\t\t\tSystem.out.print(\"\" + output_data[k][m]);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tSystem.out.print(\" \" + output_data[k][m]);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\t\t\t\t\tSystem.out.println();\n\n\t\t\t\t}\n\t\t\t}\n\n\t\t}\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 input1 = \"\";\n\t\tString input2 = \"\";\n\t\tString[] input_rc = new String[2];\n\t\tint r = 0;\n\t\tint c = 0;\n\t\tboolean judge = true;\n\n\t\tinput1 = sc.nextLine();\n\t\tinput_rc = input1.split(\" \");\n\t\tr = Integer.parseInt(input_rc[0]);\n\t\tc = Integer.parseInt(input_rc[1]);\n\n\t\tif (r < 1 || r > 100) {\n\t\t\tjudge = false;\n\t\t}\n\n\t\tif (c < 1 || c > 100) {\n\t\t\tjudge = false;\n\t\t}\n\n\t\tif (judge == true) {\n\t\t\t// String[] outputstring = new String[r + 1];\n\t\t\tint[][] output_data = new int[r + 1][c + 1];\n\t\t\tString[] string_data = new String[c];\n\n\t\t\t// 1行ずつ入力される行列データを処理する\n\t\t\tout: for (int i = 0; i < r; i++) {\n\t\t\t\tinput2 = sc.nextLine(); // 1行ずつ入力される各行のデータを受け取る\n\t\t\t\tstring_data = input2.split(\" \"); // 1行ずつ入力される各行のデータを半角区切りで分けて格納する\n\n\t\t\t\t// 各行の各列のデータの処理を行う\n\t\t\t\tfor (int j = 0; j < c; j++) {\n\t\t\t\t\toutput_data[i][j] = Integer.parseInt(string_data[j]);\n\t\t\t\t\tif (output_data[i][j] < 0 || output_data[i][j] > 100) {\n\t\t\t\t\t\tjudge = false;\n\t\t\t\t\t\tbreak out;\n\t\t\t\t\t}\n\t\t\t\t\toutput_data[r][j] += output_data[i][j];\n\t\t\t\t\toutput_data[i][c] += output_data[i][j];\n\t\t\t\t\toutput_data[r][c] += output_data[i][j];\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tif (judge == true) {\n\t\t\t\tfor (int k = 0; k < (r + 1); k++) {\n\t\t\t\t\tfor (int m = 0; m < (c + 1); m++) {\n\t\t\t\t\t\tif (m == 0) {\n\t\t\t\t\t\t\tSystem.out.print(\"\" + output_data[k][m]);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tSystem.out.print(\" \" + output_data[k][m]);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\t\t\t\t\tSystem.out.println();\n\n\t\t\t\t}\n\t\t\t}\n\n\t\t}\n\t}",
"main",
"{\n\t\t// TODO 自動生成されたメソッド・スタブ\n\t\tScanner sc = new Scanner(System.in);\n\t\tString input1 = \"\";\n\t\tString input2 = \"\";\n\t\tString[] input_rc = new String[2];\n\t\tint r = 0;\n\t\tint c = 0;\n\t\tboolean judge = true;\n\n\t\tinput1 = sc.nextLine();\n\t\tinput_rc = input1.split(\" \");\n\t\tr = Integer.parseInt(input_rc[0]);\n\t\tc = Integer.parseInt(input_rc[1]);\n\n\t\tif (r < 1 || r > 100) {\n\t\t\tjudge = false;\n\t\t}\n\n\t\tif (c < 1 || c > 100) {\n\t\t\tjudge = false;\n\t\t}\n\n\t\tif (judge == true) {\n\t\t\t// String[] outputstring = new String[r + 1];\n\t\t\tint[][] output_data = new int[r + 1][c + 1];\n\t\t\tString[] string_data = new String[c];\n\n\t\t\t// 1行ずつ入力される行列データを処理する\n\t\t\tout: for (int i = 0; i < r; i++) {\n\t\t\t\tinput2 = sc.nextLine(); // 1行ずつ入力される各行のデータを受け取る\n\t\t\t\tstring_data = input2.split(\" \"); // 1行ずつ入力される各行のデータを半角区切りで分けて格納する\n\n\t\t\t\t// 各行の各列のデータの処理を行う\n\t\t\t\tfor (int j = 0; j < c; j++) {\n\t\t\t\t\toutput_data[i][j] = Integer.parseInt(string_data[j]);\n\t\t\t\t\tif (output_data[i][j] < 0 || output_data[i][j] > 100) {\n\t\t\t\t\t\tjudge = false;\n\t\t\t\t\t\tbreak out;\n\t\t\t\t\t}\n\t\t\t\t\toutput_data[r][j] += output_data[i][j];\n\t\t\t\t\toutput_data[i][c] += output_data[i][j];\n\t\t\t\t\toutput_data[r][c] += output_data[i][j];\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tif (judge == true) {\n\t\t\t\tfor (int k = 0; k < (r + 1); k++) {\n\t\t\t\t\tfor (int m = 0; m < (c + 1); m++) {\n\t\t\t\t\t\tif (m == 0) {\n\t\t\t\t\t\t\tSystem.out.print(\"\" + output_data[k][m]);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tSystem.out.print(\" \" + output_data[k][m]);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\t\t\t\t\tSystem.out.println();\n\n\t\t\t\t}\n\t\t\t}\n\n\t\t}\n\t}",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"String input1 = \"\";",
"input1",
"\"\"",
"String input2 = \"\";",
"input2",
"\"\"",
"String[] input_rc = new String[2];",
"input_rc",
"new String[2]",
"2",
"int r = 0;",
"r",
"0",
"int c = 0;",
"c",
"0",
"boolean judge = true;",
"judge",
"true",
"input1 = sc.nextLine()",
"input1",
"sc.nextLine()",
"sc.nextLine",
"sc",
"input_rc = input1.split(\" \")",
"input_rc",
"input1.split(\" \")",
"input1.split",
"input1",
"\" \"",
"r = Integer.parseInt(input_rc[0])",
"r",
"Integer.parseInt(input_rc[0])",
"Integer.parseInt",
"Integer",
"input_rc[0]",
"input_rc",
"0",
"c = Integer.parseInt(input_rc[1])",
"c",
"Integer.parseInt(input_rc[1])",
"Integer.parseInt",
"Integer",
"input_rc[1]",
"input_rc",
"1",
"if (r < 1 || r > 100) {\n\t\t\tjudge = false;\n\t\t}",
"r < 1 || r > 100",
"r < 1",
"r",
"1",
"r > 100",
"r",
"100",
"{\n\t\t\tjudge = false;\n\t\t}",
"judge = false",
"judge",
"false",
"if (c < 1 || c > 100) {\n\t\t\tjudge = false;\n\t\t}",
"c < 1 || c > 100",
"c < 1",
"c",
"1",
"c > 100",
"c",
"100",
"{\n\t\t\tjudge = false;\n\t\t}",
"judge = false",
"judge",
"false",
"if (judge == true) {\n\t\t\t// String[] outputstring = new String[r + 1];\n\t\t\tint[][] output_data = new int[r + 1][c + 1];\n\t\t\tString[] string_data = new String[c];\n\n\t\t\t// 1行ずつ入力される行列データを処理する\n\t\t\tout: for (int i = 0; i < r; i++) {\n\t\t\t\tinput2 = sc.nextLine(); // 1行ずつ入力される各行のデータを受け取る\n\t\t\t\tstring_data = input2.split(\" \"); // 1行ずつ入力される各行のデータを半角区切りで分けて格納する\n\n\t\t\t\t// 各行の各列のデータの処理を行う\n\t\t\t\tfor (int j = 0; j < c; j++) {\n\t\t\t\t\toutput_data[i][j] = Integer.parseInt(string_data[j]);\n\t\t\t\t\tif (output_data[i][j] < 0 || output_data[i][j] > 100) {\n\t\t\t\t\t\tjudge = false;\n\t\t\t\t\t\tbreak out;\n\t\t\t\t\t}\n\t\t\t\t\toutput_data[r][j] += output_data[i][j];\n\t\t\t\t\toutput_data[i][c] += output_data[i][j];\n\t\t\t\t\toutput_data[r][c] += output_data[i][j];\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tif (judge == true) {\n\t\t\t\tfor (int k = 0; k < (r + 1); k++) {\n\t\t\t\t\tfor (int m = 0; m < (c + 1); m++) {\n\t\t\t\t\t\tif (m == 0) {\n\t\t\t\t\t\t\tSystem.out.print(\"\" + output_data[k][m]);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tSystem.out.print(\" \" + output_data[k][m]);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\t\t\t\t\tSystem.out.println();\n\n\t\t\t\t}\n\t\t\t}\n\n\t\t}",
"judge == true",
"judge",
"true",
"{\n\t\t\t// String[] outputstring = new String[r + 1];\n\t\t\tint[][] output_data = new int[r + 1][c + 1];\n\t\t\tString[] string_data = new String[c];\n\n\t\t\t// 1行ずつ入力される行列データを処理する\n\t\t\tout: for (int i = 0; i < r; i++) {\n\t\t\t\tinput2 = sc.nextLine(); // 1行ずつ入力される各行のデータを受け取る\n\t\t\t\tstring_data = input2.split(\" \"); // 1行ずつ入力される各行のデータを半角区切りで分けて格納する\n\n\t\t\t\t// 各行の各列のデータの処理を行う\n\t\t\t\tfor (int j = 0; j < c; j++) {\n\t\t\t\t\toutput_data[i][j] = Integer.parseInt(string_data[j]);\n\t\t\t\t\tif (output_data[i][j] < 0 || output_data[i][j] > 100) {\n\t\t\t\t\t\tjudge = false;\n\t\t\t\t\t\tbreak out;\n\t\t\t\t\t}\n\t\t\t\t\toutput_data[r][j] += output_data[i][j];\n\t\t\t\t\toutput_data[i][c] += output_data[i][j];\n\t\t\t\t\toutput_data[r][c] += output_data[i][j];\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tif (judge == true) {\n\t\t\t\tfor (int k = 0; k < (r + 1); k++) {\n\t\t\t\t\tfor (int m = 0; m < (c + 1); m++) {\n\t\t\t\t\t\tif (m == 0) {\n\t\t\t\t\t\t\tSystem.out.print(\"\" + output_data[k][m]);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tSystem.out.print(\" \" + output_data[k][m]);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\t\t\t\t\tSystem.out.println();\n\n\t\t\t\t}\n\t\t\t}\n\n\t\t}",
"int[][] output_data = new int[r + 1][c + 1];",
"output_data",
"new int[r + 1][c + 1]",
"r + 1",
"r",
"1",
"c + 1",
"c",
"1",
"String[] string_data = new String[c];",
"string_data",
"new String[c]",
"c",
"if (judge == true) {\n\t\t\t\tfor (int k = 0; k < (r + 1); k++) {\n\t\t\t\t\tfor (int m = 0; m < (c + 1); m++) {\n\t\t\t\t\t\tif (m == 0) {\n\t\t\t\t\t\t\tSystem.out.print(\"\" + output_data[k][m]);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tSystem.out.print(\" \" + output_data[k][m]);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\t\t\t\t\tSystem.out.println();\n\n\t\t\t\t}\n\t\t\t}",
"judge == true",
"judge",
"true",
"{\n\t\t\t\tfor (int k = 0; k < (r + 1); k++) {\n\t\t\t\t\tfor (int m = 0; m < (c + 1); m++) {\n\t\t\t\t\t\tif (m == 0) {\n\t\t\t\t\t\t\tSystem.out.print(\"\" + output_data[k][m]);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tSystem.out.print(\" \" + output_data[k][m]);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\t\t\t\t\tSystem.out.println();\n\n\t\t\t\t}\n\t\t\t}",
"for (int k = 0; k < (r + 1); k++) {\n\t\t\t\t\tfor (int m = 0; m < (c + 1); m++) {\n\t\t\t\t\t\tif (m == 0) {\n\t\t\t\t\t\t\tSystem.out.print(\"\" + output_data[k][m]);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tSystem.out.print(\" \" + output_data[k][m]);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\t\t\t\t\tSystem.out.println();\n\n\t\t\t\t}",
"int k = 0;",
"int k = 0;",
"k",
"0",
"k < (r + 1)",
"k",
"(r + 1)",
"r",
"1",
"k++",
"k++",
"k",
"{\n\t\t\t\t\tfor (int m = 0; m < (c + 1); m++) {\n\t\t\t\t\t\tif (m == 0) {\n\t\t\t\t\t\t\tSystem.out.print(\"\" + output_data[k][m]);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tSystem.out.print(\" \" + output_data[k][m]);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\t\t\t\t\tSystem.out.println();\n\n\t\t\t\t}",
"{\n\t\t\t\t\tfor (int m = 0; m < (c + 1); m++) {\n\t\t\t\t\t\tif (m == 0) {\n\t\t\t\t\t\t\tSystem.out.print(\"\" + output_data[k][m]);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tSystem.out.print(\" \" + output_data[k][m]);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\t\t\t\t\tSystem.out.println();\n\n\t\t\t\t}",
"for (int m = 0; m < (c + 1); m++) {\n\t\t\t\t\t\tif (m == 0) {\n\t\t\t\t\t\t\tSystem.out.print(\"\" + output_data[k][m]);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tSystem.out.print(\" \" + output_data[k][m]);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}",
"int m = 0;",
"int m = 0;",
"m",
"0",
"m < (c + 1)",
"m",
"(c + 1)",
"c",
"1",
"m++",
"m++",
"m",
"{\n\t\t\t\t\t\tif (m == 0) {\n\t\t\t\t\t\t\tSystem.out.print(\"\" + output_data[k][m]);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tSystem.out.print(\" \" + output_data[k][m]);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}",
"{\n\t\t\t\t\t\tif (m == 0) {\n\t\t\t\t\t\t\tSystem.out.print(\"\" + output_data[k][m]);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tSystem.out.print(\" \" + output_data[k][m]);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}",
"if (m == 0) {\n\t\t\t\t\t\t\tSystem.out.print(\"\" + output_data[k][m]);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tSystem.out.print(\" \" + output_data[k][m]);\n\t\t\t\t\t\t}",
"m == 0",
"m",
"0",
"{\n\t\t\t\t\t\t\tSystem.out.print(\"\" + output_data[k][m]);\n\t\t\t\t\t\t}",
"System.out.print(\"\" + output_data[k][m])",
"System.out.print",
"System.out",
"System",
"System.out",
"\"\" + output_data[k][m]",
"\"\"",
"output_data[k][m]",
"output_data[k]",
"output_data",
"k",
"m",
"{\n\t\t\t\t\t\t\tSystem.out.print(\" \" + output_data[k][m]);\n\t\t\t\t\t\t}",
"System.out.print(\" \" + output_data[k][m])",
"System.out.print",
"System.out",
"System",
"System.out",
"\" \" + output_data[k][m]",
"\" \"",
"output_data[k][m]",
"output_data[k]",
"output_data",
"k",
"m",
"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// TODO 自動生成されたメソッド・スタブ\n\t\tScanner sc = new Scanner(System.in);\n\t\tString input1 = \"\";\n\t\tString input2 = \"\";\n\t\tString[] input_rc = new String[2];\n\t\tint r = 0;\n\t\tint c = 0;\n\t\tboolean judge = true;\n\n\t\tinput1 = sc.nextLine();\n\t\tinput_rc = input1.split(\" \");\n\t\tr = Integer.parseInt(input_rc[0]);\n\t\tc = Integer.parseInt(input_rc[1]);\n\n\t\tif (r < 1 || r > 100) {\n\t\t\tjudge = false;\n\t\t}\n\n\t\tif (c < 1 || c > 100) {\n\t\t\tjudge = false;\n\t\t}\n\n\t\tif (judge == true) {\n\t\t\t// String[] outputstring = new String[r + 1];\n\t\t\tint[][] output_data = new int[r + 1][c + 1];\n\t\t\tString[] string_data = new String[c];\n\n\t\t\t// 1行ずつ入力される行列データを処理する\n\t\t\tout: for (int i = 0; i < r; i++) {\n\t\t\t\tinput2 = sc.nextLine(); // 1行ずつ入力される各行のデータを受け取る\n\t\t\t\tstring_data = input2.split(\" \"); // 1行ずつ入力される各行のデータを半角区切りで分けて格納する\n\n\t\t\t\t// 各行の各列のデータの処理を行う\n\t\t\t\tfor (int j = 0; j < c; j++) {\n\t\t\t\t\toutput_data[i][j] = Integer.parseInt(string_data[j]);\n\t\t\t\t\tif (output_data[i][j] < 0 || output_data[i][j] > 100) {\n\t\t\t\t\t\tjudge = false;\n\t\t\t\t\t\tbreak out;\n\t\t\t\t\t}\n\t\t\t\t\toutput_data[r][j] += output_data[i][j];\n\t\t\t\t\toutput_data[i][c] += output_data[i][j];\n\t\t\t\t\toutput_data[r][c] += output_data[i][j];\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tif (judge == true) {\n\t\t\t\tfor (int k = 0; k < (r + 1); k++) {\n\t\t\t\t\tfor (int m = 0; m < (c + 1); m++) {\n\t\t\t\t\t\tif (m == 0) {\n\t\t\t\t\t\t\tSystem.out.print(\"\" + output_data[k][m]);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tSystem.out.print(\" \" + output_data[k][m]);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\t\t\t\t\tSystem.out.println();\n\n\t\t\t\t}\n\t\t\t}\n\n\t\t}\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 input1 = \"\";\n\t\tString input2 = \"\";\n\t\tString[] input_rc = new String[2];\n\t\tint r = 0;\n\t\tint c = 0;\n\t\tboolean judge = true;\n\n\t\tinput1 = sc.nextLine();\n\t\tinput_rc = input1.split(\" \");\n\t\tr = Integer.parseInt(input_rc[0]);\n\t\tc = Integer.parseInt(input_rc[1]);\n\n\t\tif (r < 1 || r > 100) {\n\t\t\tjudge = false;\n\t\t}\n\n\t\tif (c < 1 || c > 100) {\n\t\t\tjudge = false;\n\t\t}\n\n\t\tif (judge == true) {\n\t\t\t// String[] outputstring = new String[r + 1];\n\t\t\tint[][] output_data = new int[r + 1][c + 1];\n\t\t\tString[] string_data = new String[c];\n\n\t\t\t// 1行ずつ入力される行列データを処理する\n\t\t\tout: for (int i = 0; i < r; i++) {\n\t\t\t\tinput2 = sc.nextLine(); // 1行ずつ入力される各行のデータを受け取る\n\t\t\t\tstring_data = input2.split(\" \"); // 1行ずつ入力される各行のデータを半角区切りで分けて格納する\n\n\t\t\t\t// 各行の各列のデータの処理を行う\n\t\t\t\tfor (int j = 0; j < c; j++) {\n\t\t\t\t\toutput_data[i][j] = Integer.parseInt(string_data[j]);\n\t\t\t\t\tif (output_data[i][j] < 0 || output_data[i][j] > 100) {\n\t\t\t\t\t\tjudge = false;\n\t\t\t\t\t\tbreak out;\n\t\t\t\t\t}\n\t\t\t\t\toutput_data[r][j] += output_data[i][j];\n\t\t\t\t\toutput_data[i][c] += output_data[i][j];\n\t\t\t\t\toutput_data[r][c] += output_data[i][j];\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tif (judge == true) {\n\t\t\t\tfor (int k = 0; k < (r + 1); k++) {\n\t\t\t\t\tfor (int m = 0; m < (c + 1); m++) {\n\t\t\t\t\t\tif (m == 0) {\n\t\t\t\t\t\t\tSystem.out.print(\"\" + output_data[k][m]);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tSystem.out.print(\" \" + output_data[k][m]);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\t\t\t\t\tSystem.out.println();\n\n\t\t\t\t}\n\t\t\t}\n\n\t\t}\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 input1 = "";
String input2 = "";
String[] input_rc = new String[2];
int r = 0;
int c = 0;
boolean judge = true;
input1 = sc.nextLine();
input_rc = input1.split(" ");
r = Integer.parseInt(input_rc[0]);
c = Integer.parseInt(input_rc[1]);
if (r < 1 || r > 100) {
judge = false;
}
if (c < 1 || c > 100) {
judge = false;
}
if (judge == true) {
// String[] outputstring = new String[r + 1];
int[][] output_data = new int[r + 1][c + 1];
String[] string_data = new String[c];
// 1行ずつ入力される行列データを処理する
out: for (int i = 0; i < r; i++) {
input2 = sc.nextLine(); // 1行ずつ入力される各行のデータを受け取る
string_data = input2.split(" "); // 1行ずつ入力される各行のデータを半角区切りで分けて格納する
// 各行の各列のデータの処理を行う
for (int j = 0; j < c; j++) {
output_data[i][j] = Integer.parseInt(string_data[j]);
if (output_data[i][j] < 0 || output_data[i][j] > 100) {
judge = false;
break out;
}
output_data[r][j] += output_data[i][j];
output_data[i][c] += output_data[i][j];
output_data[r][c] += output_data[i][j];
}
}
if (judge == true) {
for (int k = 0; k < (r + 1); k++) {
for (int m = 0; m < (c + 1); m++) {
if (m == 0) {
System.out.print("" + output_data[k][m]);
} else {
System.out.print(" " + output_data[k][m]);
}
}
System.out.println();
}
}
}
}
}
|
[
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,
13,
41,
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,
13,
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,
18,
13,
13,
13,
0,
13,
13,
14,
2,
13,
2,
13,
17,
30,
0,
13,
18,
13,
13,
4,
18,
13,
2,
18,
13,
13,
13,
4,
18,
13,
2,
2,
2,
13,
13,
13,
13,
4,
18,
4,
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
],
[
8,
52
],
[
52,
53
],
[
52,
54
],
[
8,
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
],
[
79,
81
],
[
67,
82
],
[
82,
83
],
[
83,
84
],
[
84,
85
],
[
84,
86
],
[
82,
87
],
[
87,
88
],
[
87,
89
],
[
82,
90
],
[
90,
91
],
[
91,
92
],
[
82,
93
],
[
94,
94
],
[
94,
95
],
[
95,
96
],
[
95,
97
],
[
97,
98
],
[
98,
99
],
[
97,
100
],
[
100,
101
],
[
100,
102
],
[
94,
103
],
[
103,
104
],
[
104,
105
],
[
104,
106
],
[
103,
107
],
[
94,
108
],
[
108,
109
],
[
108,
110
],
[
94,
111
],
[
111,
112
],
[
112,
113
],
[
112,
114
],
[
114,
115
],
[
114,
116
],
[
111,
117
],
[
117,
118
],
[
118,
119
],
[
118,
120
],
[
120,
121
],
[
120,
122
],
[
117,
123
],
[
123,
124
],
[
124,
125
],
[
123,
126
],
[
126,
127
],
[
127,
128
],
[
127,
129
],
[
126,
130
],
[
67,
131
],
[
131,
132
],
[
132,
133
],
[
131,
134
],
[
136,
135
],
[
135,
136
],
[
136,
137
],
[
136,
138
],
[
135,
139
],
[
136,
140
],
[
8,
141
],
[
141,
142
],
[
142,
143
],
[
143,
144
],
[
144,
145
],
[
143,
146
],
[
141,
147
],
[
8,
148
],
[
148,
149
],
[
149,
150
],
[
150,
151
],
[
150,
152
],
[
148,
153
],
[
6,
154
],
[
154,
155
]
] | [
"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[] ct=new int[c];\n int t=0;\n for(int i=0;i<r;i++){\n \tString str=br.readLine();\n \tString[] row=str.split(b);\n \tint rt=0;\n \tfor(int j=0;j<c;j++){\n \t\tint v=Integer.parseInt(row[j]);\n \t\tct[j]+=v;\n \t\trt+=v;\n \t\tif(i==r-1){\n \t\t\tt+=ct[j];\n \t\t\tsb2.append(ct[j]+b);\n \t\t}\n \t}\n \tsb1.append(str+b+rt+n);\n }\n sb1.append(sb2).append(t);\n System.out.println(sb1);\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[] ct=new int[c];\n int t=0;\n for(int i=0;i<r;i++){\n \tString str=br.readLine();\n \tString[] row=str.split(b);\n \tint rt=0;\n \tfor(int j=0;j<c;j++){\n \t\tint v=Integer.parseInt(row[j]);\n \t\tct[j]+=v;\n \t\trt+=v;\n \t\tif(i==r-1){\n \t\t\tt+=ct[j];\n \t\t\tsb2.append(ct[j]+b);\n \t\t}\n \t}\n \tsb1.append(str+b+rt+n);\n }\n sb1.append(sb2).append(t);\n System.out.println(sb1);\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[] ct=new int[c];\n int t=0;\n for(int i=0;i<r;i++){\n \tString str=br.readLine();\n \tString[] row=str.split(b);\n \tint rt=0;\n \tfor(int j=0;j<c;j++){\n \t\tint v=Integer.parseInt(row[j]);\n \t\tct[j]+=v;\n \t\trt+=v;\n \t\tif(i==r-1){\n \t\t\tt+=ct[j];\n \t\t\tsb2.append(ct[j]+b);\n \t\t}\n \t}\n \tsb1.append(str+b+rt+n);\n }\n sb1.append(sb2).append(t);\n System.out.println(sb1);\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[] ct=new int[c];\n int t=0;\n for(int i=0;i<r;i++){\n \tString str=br.readLine();\n \tString[] row=str.split(b);\n \tint rt=0;\n \tfor(int j=0;j<c;j++){\n \t\tint v=Integer.parseInt(row[j]);\n \t\tct[j]+=v;\n \t\trt+=v;\n \t\tif(i==r-1){\n \t\t\tt+=ct[j];\n \t\t\tsb2.append(ct[j]+b);\n \t\t}\n \t}\n \tsb1.append(str+b+rt+n);\n }\n sb1.append(sb2).append(t);\n System.out.println(sb1);\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[] ct=new int[c];",
"ct",
"new int[c]",
"c",
"int t=0;",
"t",
"0",
"for(int i=0;i<r;i++){\n \tString str=br.readLine();\n \tString[] row=str.split(b);\n \tint rt=0;\n \tfor(int j=0;j<c;j++){\n \t\tint v=Integer.parseInt(row[j]);\n \t\tct[j]+=v;\n \t\trt+=v;\n \t\tif(i==r-1){\n \t\t\tt+=ct[j];\n \t\t\tsb2.append(ct[j]+b);\n \t\t}\n \t}\n \tsb1.append(str+b+rt+n);\n }",
"int i=0;",
"int i=0;",
"i",
"0",
"i<r",
"i",
"r",
"i++",
"i++",
"i",
"{\n \tString str=br.readLine();\n \tString[] row=str.split(b);\n \tint rt=0;\n \tfor(int j=0;j<c;j++){\n \t\tint v=Integer.parseInt(row[j]);\n \t\tct[j]+=v;\n \t\trt+=v;\n \t\tif(i==r-1){\n \t\t\tt+=ct[j];\n \t\t\tsb2.append(ct[j]+b);\n \t\t}\n \t}\n \tsb1.append(str+b+rt+n);\n }",
"{\n \tString str=br.readLine();\n \tString[] row=str.split(b);\n \tint rt=0;\n \tfor(int j=0;j<c;j++){\n \t\tint v=Integer.parseInt(row[j]);\n \t\tct[j]+=v;\n \t\trt+=v;\n \t\tif(i==r-1){\n \t\t\tt+=ct[j];\n \t\t\tsb2.append(ct[j]+b);\n \t\t}\n \t}\n \tsb1.append(str+b+rt+n);\n }",
"String str=br.readLine();",
"str",
"br.readLine()",
"br.readLine",
"br",
"String[] row=str.split(b);",
"row",
"str.split(b)",
"str.split",
"str",
"b",
"int rt=0;",
"rt",
"0",
"for(int j=0;j<c;j++){\n \t\tint v=Integer.parseInt(row[j]);\n \t\tct[j]+=v;\n \t\trt+=v;\n \t\tif(i==r-1){\n \t\t\tt+=ct[j];\n \t\t\tsb2.append(ct[j]+b);\n \t\t}\n \t}",
"int j=0;",
"int j=0;",
"j",
"0",
"j<c",
"j",
"c",
"j++",
"j++",
"j",
"{\n \t\tint v=Integer.parseInt(row[j]);\n \t\tct[j]+=v;\n \t\trt+=v;\n \t\tif(i==r-1){\n \t\t\tt+=ct[j];\n \t\t\tsb2.append(ct[j]+b);\n \t\t}\n \t}",
"{\n \t\tint v=Integer.parseInt(row[j]);\n \t\tct[j]+=v;\n \t\trt+=v;\n \t\tif(i==r-1){\n \t\t\tt+=ct[j];\n \t\t\tsb2.append(ct[j]+b);\n \t\t}\n \t}",
"int v=Integer.parseInt(row[j]);",
"v",
"Integer.parseInt(row[j])",
"Integer.parseInt",
"Integer",
"row[j]",
"row",
"j",
"ct[j]+=v",
"ct[j]",
"ct",
"j",
"v",
"rt+=v",
"rt",
"v",
"if(i==r-1){\n \t\t\tt+=ct[j];\n \t\t\tsb2.append(ct[j]+b);\n \t\t}",
"i==r-1",
"i",
"r-1",
"r",
"1",
"{\n \t\t\tt+=ct[j];\n \t\t\tsb2.append(ct[j]+b);\n \t\t}",
"t+=ct[j]",
"t",
"ct[j]",
"ct",
"j",
"sb2.append(ct[j]+b)",
"sb2.append",
"sb2",
"ct[j]+b",
"ct[j]",
"ct",
"j",
"b",
"sb1.append(str+b+rt+n)",
"sb1.append",
"sb1",
"str+b+rt+n",
"rt",
"str+b+rt+n",
"str",
"b",
"rt",
"n",
"sb1.append(sb2).append(t)",
"sb1.append(sb2).append",
"sb1.append(sb2)",
"sb1.append",
"sb1",
"sb2",
"t",
"System.out.println(sb1)",
"System.out.println",
"System.out",
"System",
"System.out",
"sb1",
"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[] ct=new int[c];
int t=0;
for(int i=0;i<r;i++){
String str=br.readLine();
String[] row=str.split(b);
int rt=0;
for(int j=0;j<c;j++){
int v=Integer.parseInt(row[j]);
ct[j]+=v;
rt+=v;
if(i==r-1){
t+=ct[j];
sb2.append(ct[j]+b);
}
}
sb1.append(str+b+rt+n);
}
sb1.append(sb2).append(t);
System.out.println(sb1);
}
} |
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
41,
13,
41,
13,
17,
41,
13,
17,
41,
13,
41,
13,
17,
38,
30,
4,
18,
13,
30,
0,
13,
20,
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,
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,
18,
18,
13,
17,
13,
1,
40,
13,
30,
30,
0,
18,
18,
13,
13,
13,
18,
18,
13,
13,
13,
0,
13,
17,
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,
17,
13,
1,
40,
13,
30,
30,
14,
40,
4,
18,
13,
17,
30,
0,
13,
17,
0,
13,
18,
18,
13,
13,
13,
4,
18,
18,
13,
13,
13,
0,
13,
17,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
193,
5
],
[
193,
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
],
[
8,
21
],
[
21,
22
],
[
21,
23
],
[
8,
24
],
[
24,
25
],
[
25,
26
],
[
26,
27
],
[
27,
28
],
[
24,
29
],
[
29,
30
],
[
30,
31
],
[
30,
32
],
[
29,
33
],
[
33,
34
],
[
33,
35
],
[
35,
36
],
[
36,
37
],
[
29,
38
],
[
38,
39
],
[
38,
40
],
[
40,
41
],
[
41,
42
],
[
29,
43
],
[
43,
44
],
[
43,
45
],
[
46,
47
],
[
46,
48
],
[
49,
50
],
[
49,
51
],
[
29,
52
],
[
52,
53
],
[
53,
54
],
[
54,
55
],
[
54,
56
],
[
52,
57
],
[
57,
58
],
[
57,
59
],
[
52,
60
],
[
60,
61
],
[
61,
62
],
[
52,
63
],
[
64,
64
],
[
64,
65
],
[
65,
66
],
[
66,
67
],
[
67,
68
],
[
67,
69
],
[
65,
70
],
[
70,
71
],
[
70,
72
],
[
65,
73
],
[
73,
74
],
[
74,
75
],
[
65,
76
],
[
77,
77
],
[
77,
78
],
[
78,
79
],
[
79,
80
],
[
80,
81
],
[
80,
82
],
[
79,
83
],
[
78,
84
],
[
84,
85
],
[
85,
86
],
[
77,
87
],
[
87,
88
],
[
87,
89
],
[
89,
90
],
[
90,
91
],
[
90,
92
],
[
89,
93
],
[
64,
94
],
[
94,
95
],
[
95,
96
],
[
96,
97
],
[
96,
98
],
[
95,
99
],
[
94,
100
],
[
64,
101
],
[
101,
102
],
[
102,
103
],
[
103,
104
],
[
103,
105
],
[
101,
106
],
[
106,
107
],
[
106,
108
],
[
108,
109
],
[
109,
110
],
[
109,
111
],
[
108,
112
],
[
101,
113
],
[
113,
114
],
[
114,
115
],
[
101,
116
],
[
117,
117
],
[
117,
118
],
[
118,
119
],
[
119,
120
],
[
120,
121
],
[
120,
122
],
[
119,
123
],
[
118,
124
],
[
124,
125
],
[
125,
126
],
[
125,
127
],
[
124,
128
],
[
64,
129
],
[
129,
130
],
[
129,
131
],
[
29,
132
],
[
132,
133
],
[
133,
134
],
[
134,
135
],
[
134,
136
],
[
132,
137
],
[
137,
138
],
[
137,
139
],
[
139,
140
],
[
139,
141
],
[
132,
142
],
[
142,
143
],
[
143,
144
],
[
132,
145
],
[
146,
146
],
[
146,
147
],
[
147,
148
],
[
148,
149
],
[
149,
150
],
[
149,
151
],
[
147,
152
],
[
152,
153
],
[
152,
154
],
[
154,
155
],
[
155,
156
],
[
155,
157
],
[
154,
158
],
[
147,
159
],
[
159,
160
],
[
160,
161
],
[
147,
162
],
[
163,
163
],
[
163,
164
],
[
164,
165
],
[
165,
166
],
[
166,
167
],
[
167,
168
],
[
166,
169
],
[
164,
170
],
[
170,
171
],
[
171,
172
],
[
171,
173
],
[
163,
174
],
[
174,
175
],
[
174,
176
],
[
176,
177
],
[
177,
178
],
[
177,
179
],
[
176,
180
],
[
146,
181
],
[
181,
182
],
[
182,
183
],
[
183,
184
],
[
183,
185
],
[
181,
186
],
[
146,
187
],
[
187,
188
],
[
187,
189
],
[
6,
190
],
[
190,
191
],
[
0,
192
],
[
192,
193
],
[
192,
194
]
] | [
"import java.util.Scanner;\n\npublic class Main {\n\n\tpublic static void main(String[] args) {\n\n\t\tint numR;\n\t\tint numC;\n\t\tint add = 0;\n\n\t\tString outPut = \"\";\n\n\t\tint[][] tableList;\n\n\t\tScanner sc = null;\n\n\t\ttry {\n\t\t\t//??\\????????????\n\t\t\tsc = new Scanner(System.in);\n\n\t\t\tnumR = sc.nextInt();\n\t\t\tnumC = sc.nextInt();\n\n\t\t\t//???????????°??¨\n\t\t\t//System.out.println(numR + \" \" + numC);\n\n\t\t\t//??¨??????????????£?¨?\n\t\t\ttableList = new int[numR + 1][numC + 1];\n\n\t\t\t\t//??¨?????\\??????????????????\n\t\t\t\tfor (int i = 0; i < numR; i++) {\n\n\t\t\t\t\tfor (int j = 0; j < numC; j++) {\n\t\t\t\t\t\ttableList[i][j] = sc.nextInt();\n\t\t\t\t\t\tadd += tableList[i][j];\n\t\t\t\t\t}\n\t\t\t\t\t//??????????¨???????????´?\n\t\t\t\t\ttableList[i][numC] =add;\n\n\t\t\t\t\t//??????????¨???????????´?\n\t\t\t\t\tfor (int k = 0; k < tableList[0].length; k++) {\n\t\t\t\t\t\ttableList[numR][k] += tableList[i][k];\n\t\t\t\t\t}\n\t\t\t\t\t//????¨???????????????????\n\t\t\t\t\tadd = 0;\n\t\t\t\t}\n\n\t\t\t\t//??¨?????????\n\t\t\t\tfor (int i = 0; i < tableList.length; i++) {\n\t\t\t\t\tfor (int j = 0; j < tableList[0].length; j++) {\n\n\t\t\t\t\t\tif (!outPut.equals(\"\")) {\n\t\t\t\t\t\t\toutPut += \" \";\n\t\t\t\t\t\t}\n\t\t\t\t\t\toutPut += tableList[i][j];\n\n\t\t\t\t\t}\n\t\t\t\t\tSystem.out.println(outPut);\n\t\t\t\t\toutPut = \"\";\n\t\t\t\t}\n\n\t\t\t}finally {\n\t\t\t\tsc.close();\n\t\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\tint numR;\n\t\tint numC;\n\t\tint add = 0;\n\n\t\tString outPut = \"\";\n\n\t\tint[][] tableList;\n\n\t\tScanner sc = null;\n\n\t\ttry {\n\t\t\t//??\\????????????\n\t\t\tsc = new Scanner(System.in);\n\n\t\t\tnumR = sc.nextInt();\n\t\t\tnumC = sc.nextInt();\n\n\t\t\t//???????????°??¨\n\t\t\t//System.out.println(numR + \" \" + numC);\n\n\t\t\t//??¨??????????????£?¨?\n\t\t\ttableList = new int[numR + 1][numC + 1];\n\n\t\t\t\t//??¨?????\\??????????????????\n\t\t\t\tfor (int i = 0; i < numR; i++) {\n\n\t\t\t\t\tfor (int j = 0; j < numC; j++) {\n\t\t\t\t\t\ttableList[i][j] = sc.nextInt();\n\t\t\t\t\t\tadd += tableList[i][j];\n\t\t\t\t\t}\n\t\t\t\t\t//??????????¨???????????´?\n\t\t\t\t\ttableList[i][numC] =add;\n\n\t\t\t\t\t//??????????¨???????????´?\n\t\t\t\t\tfor (int k = 0; k < tableList[0].length; k++) {\n\t\t\t\t\t\ttableList[numR][k] += tableList[i][k];\n\t\t\t\t\t}\n\t\t\t\t\t//????¨???????????????????\n\t\t\t\t\tadd = 0;\n\t\t\t\t}\n\n\t\t\t\t//??¨?????????\n\t\t\t\tfor (int i = 0; i < tableList.length; i++) {\n\t\t\t\t\tfor (int j = 0; j < tableList[0].length; j++) {\n\n\t\t\t\t\t\tif (!outPut.equals(\"\")) {\n\t\t\t\t\t\t\toutPut += \" \";\n\t\t\t\t\t\t}\n\t\t\t\t\t\toutPut += tableList[i][j];\n\n\t\t\t\t\t}\n\t\t\t\t\tSystem.out.println(outPut);\n\t\t\t\t\toutPut = \"\";\n\t\t\t\t}\n\n\t\t\t}finally {\n\t\t\t\tsc.close();\n\t\t\t}\n\t}\n\n}",
"Main",
"public static void main(String[] args) {\n\n\t\tint numR;\n\t\tint numC;\n\t\tint add = 0;\n\n\t\tString outPut = \"\";\n\n\t\tint[][] tableList;\n\n\t\tScanner sc = null;\n\n\t\ttry {\n\t\t\t//??\\????????????\n\t\t\tsc = new Scanner(System.in);\n\n\t\t\tnumR = sc.nextInt();\n\t\t\tnumC = sc.nextInt();\n\n\t\t\t//???????????°??¨\n\t\t\t//System.out.println(numR + \" \" + numC);\n\n\t\t\t//??¨??????????????£?¨?\n\t\t\ttableList = new int[numR + 1][numC + 1];\n\n\t\t\t\t//??¨?????\\??????????????????\n\t\t\t\tfor (int i = 0; i < numR; i++) {\n\n\t\t\t\t\tfor (int j = 0; j < numC; j++) {\n\t\t\t\t\t\ttableList[i][j] = sc.nextInt();\n\t\t\t\t\t\tadd += tableList[i][j];\n\t\t\t\t\t}\n\t\t\t\t\t//??????????¨???????????´?\n\t\t\t\t\ttableList[i][numC] =add;\n\n\t\t\t\t\t//??????????¨???????????´?\n\t\t\t\t\tfor (int k = 0; k < tableList[0].length; k++) {\n\t\t\t\t\t\ttableList[numR][k] += tableList[i][k];\n\t\t\t\t\t}\n\t\t\t\t\t//????¨???????????????????\n\t\t\t\t\tadd = 0;\n\t\t\t\t}\n\n\t\t\t\t//??¨?????????\n\t\t\t\tfor (int i = 0; i < tableList.length; i++) {\n\t\t\t\t\tfor (int j = 0; j < tableList[0].length; j++) {\n\n\t\t\t\t\t\tif (!outPut.equals(\"\")) {\n\t\t\t\t\t\t\toutPut += \" \";\n\t\t\t\t\t\t}\n\t\t\t\t\t\toutPut += tableList[i][j];\n\n\t\t\t\t\t}\n\t\t\t\t\tSystem.out.println(outPut);\n\t\t\t\t\toutPut = \"\";\n\t\t\t\t}\n\n\t\t\t}finally {\n\t\t\t\tsc.close();\n\t\t\t}\n\t}",
"main",
"{\n\n\t\tint numR;\n\t\tint numC;\n\t\tint add = 0;\n\n\t\tString outPut = \"\";\n\n\t\tint[][] tableList;\n\n\t\tScanner sc = null;\n\n\t\ttry {\n\t\t\t//??\\????????????\n\t\t\tsc = new Scanner(System.in);\n\n\t\t\tnumR = sc.nextInt();\n\t\t\tnumC = sc.nextInt();\n\n\t\t\t//???????????°??¨\n\t\t\t//System.out.println(numR + \" \" + numC);\n\n\t\t\t//??¨??????????????£?¨?\n\t\t\ttableList = new int[numR + 1][numC + 1];\n\n\t\t\t\t//??¨?????\\??????????????????\n\t\t\t\tfor (int i = 0; i < numR; i++) {\n\n\t\t\t\t\tfor (int j = 0; j < numC; j++) {\n\t\t\t\t\t\ttableList[i][j] = sc.nextInt();\n\t\t\t\t\t\tadd += tableList[i][j];\n\t\t\t\t\t}\n\t\t\t\t\t//??????????¨???????????´?\n\t\t\t\t\ttableList[i][numC] =add;\n\n\t\t\t\t\t//??????????¨???????????´?\n\t\t\t\t\tfor (int k = 0; k < tableList[0].length; k++) {\n\t\t\t\t\t\ttableList[numR][k] += tableList[i][k];\n\t\t\t\t\t}\n\t\t\t\t\t//????¨???????????????????\n\t\t\t\t\tadd = 0;\n\t\t\t\t}\n\n\t\t\t\t//??¨?????????\n\t\t\t\tfor (int i = 0; i < tableList.length; i++) {\n\t\t\t\t\tfor (int j = 0; j < tableList[0].length; j++) {\n\n\t\t\t\t\t\tif (!outPut.equals(\"\")) {\n\t\t\t\t\t\t\toutPut += \" \";\n\t\t\t\t\t\t}\n\t\t\t\t\t\toutPut += tableList[i][j];\n\n\t\t\t\t\t}\n\t\t\t\t\tSystem.out.println(outPut);\n\t\t\t\t\toutPut = \"\";\n\t\t\t\t}\n\n\t\t\t}finally {\n\t\t\t\tsc.close();\n\t\t\t}\n\t}",
"int numR;",
"numR",
"int numC;",
"numC",
"int add = 0;",
"add",
"0",
"String outPut = \"\";",
"outPut",
"\"\"",
"int[][] tableList;",
"tableList",
"Scanner sc = null;",
"sc",
"null",
"try {\n\t\t\t//??\\????????????\n\t\t\tsc = new Scanner(System.in);\n\n\t\t\tnumR = sc.nextInt();\n\t\t\tnumC = sc.nextInt();\n\n\t\t\t//???????????°??¨\n\t\t\t//System.out.println(numR + \" \" + numC);\n\n\t\t\t//??¨??????????????£?¨?\n\t\t\ttableList = new int[numR + 1][numC + 1];\n\n\t\t\t\t//??¨?????\\??????????????????\n\t\t\t\tfor (int i = 0; i < numR; i++) {\n\n\t\t\t\t\tfor (int j = 0; j < numC; j++) {\n\t\t\t\t\t\ttableList[i][j] = sc.nextInt();\n\t\t\t\t\t\tadd += tableList[i][j];\n\t\t\t\t\t}\n\t\t\t\t\t//??????????¨???????????´?\n\t\t\t\t\ttableList[i][numC] =add;\n\n\t\t\t\t\t//??????????¨???????????´?\n\t\t\t\t\tfor (int k = 0; k < tableList[0].length; k++) {\n\t\t\t\t\t\ttableList[numR][k] += tableList[i][k];\n\t\t\t\t\t}\n\t\t\t\t\t//????¨???????????????????\n\t\t\t\t\tadd = 0;\n\t\t\t\t}\n\n\t\t\t\t//??¨?????????\n\t\t\t\tfor (int i = 0; i < tableList.length; i++) {\n\t\t\t\t\tfor (int j = 0; j < tableList[0].length; j++) {\n\n\t\t\t\t\t\tif (!outPut.equals(\"\")) {\n\t\t\t\t\t\t\toutPut += \" \";\n\t\t\t\t\t\t}\n\t\t\t\t\t\toutPut += tableList[i][j];\n\n\t\t\t\t\t}\n\t\t\t\t\tSystem.out.println(outPut);\n\t\t\t\t\toutPut = \"\";\n\t\t\t\t}\n\n\t\t\t}finally {\n\t\t\t\tsc.close();\n\t\t\t}",
"{\n\t\t\t\tsc.close();\n\t\t\t}",
"sc.close()",
"sc.close",
"sc",
"{\n\t\t\t//??\\????????????\n\t\t\tsc = new Scanner(System.in);\n\n\t\t\tnumR = sc.nextInt();\n\t\t\tnumC = sc.nextInt();\n\n\t\t\t//???????????°??¨\n\t\t\t//System.out.println(numR + \" \" + numC);\n\n\t\t\t//??¨??????????????£?¨?\n\t\t\ttableList = new int[numR + 1][numC + 1];\n\n\t\t\t\t//??¨?????\\??????????????????\n\t\t\t\tfor (int i = 0; i < numR; i++) {\n\n\t\t\t\t\tfor (int j = 0; j < numC; j++) {\n\t\t\t\t\t\ttableList[i][j] = sc.nextInt();\n\t\t\t\t\t\tadd += tableList[i][j];\n\t\t\t\t\t}\n\t\t\t\t\t//??????????¨???????????´?\n\t\t\t\t\ttableList[i][numC] =add;\n\n\t\t\t\t\t//??????????¨???????????´?\n\t\t\t\t\tfor (int k = 0; k < tableList[0].length; k++) {\n\t\t\t\t\t\ttableList[numR][k] += tableList[i][k];\n\t\t\t\t\t}\n\t\t\t\t\t//????¨???????????????????\n\t\t\t\t\tadd = 0;\n\t\t\t\t}\n\n\t\t\t\t//??¨?????????\n\t\t\t\tfor (int i = 0; i < tableList.length; i++) {\n\t\t\t\t\tfor (int j = 0; j < tableList[0].length; j++) {\n\n\t\t\t\t\t\tif (!outPut.equals(\"\")) {\n\t\t\t\t\t\t\toutPut += \" \";\n\t\t\t\t\t\t}\n\t\t\t\t\t\toutPut += tableList[i][j];\n\n\t\t\t\t\t}\n\t\t\t\t\tSystem.out.println(outPut);\n\t\t\t\t\toutPut = \"\";\n\t\t\t\t}\n\n\t\t\t}",
"sc = new Scanner(System.in)",
"sc",
"new Scanner(System.in)",
"numR = sc.nextInt()",
"numR",
"sc.nextInt()",
"sc.nextInt",
"sc",
"numC = sc.nextInt()",
"numC",
"sc.nextInt()",
"sc.nextInt",
"sc",
"tableList = new int[numR + 1][numC + 1]",
"tableList",
"new int[numR + 1][numC + 1]",
"numR + 1",
"numR",
"1",
"numC + 1",
"numC",
"1",
"for (int i = 0; i < numR; i++) {\n\n\t\t\t\t\tfor (int j = 0; j < numC; j++) {\n\t\t\t\t\t\ttableList[i][j] = sc.nextInt();\n\t\t\t\t\t\tadd += tableList[i][j];\n\t\t\t\t\t}\n\t\t\t\t\t//??????????¨???????????´?\n\t\t\t\t\ttableList[i][numC] =add;\n\n\t\t\t\t\t//??????????¨???????????´?\n\t\t\t\t\tfor (int k = 0; k < tableList[0].length; k++) {\n\t\t\t\t\t\ttableList[numR][k] += tableList[i][k];\n\t\t\t\t\t}\n\t\t\t\t\t//????¨???????????????????\n\t\t\t\t\tadd = 0;\n\t\t\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < numR",
"i",
"numR",
"i++",
"i++",
"i",
"{\n\n\t\t\t\t\tfor (int j = 0; j < numC; j++) {\n\t\t\t\t\t\ttableList[i][j] = sc.nextInt();\n\t\t\t\t\t\tadd += tableList[i][j];\n\t\t\t\t\t}\n\t\t\t\t\t//??????????¨???????????´?\n\t\t\t\t\ttableList[i][numC] =add;\n\n\t\t\t\t\t//??????????¨???????????´?\n\t\t\t\t\tfor (int k = 0; k < tableList[0].length; k++) {\n\t\t\t\t\t\ttableList[numR][k] += tableList[i][k];\n\t\t\t\t\t}\n\t\t\t\t\t//????¨???????????????????\n\t\t\t\t\tadd = 0;\n\t\t\t\t}",
"{\n\n\t\t\t\t\tfor (int j = 0; j < numC; j++) {\n\t\t\t\t\t\ttableList[i][j] = sc.nextInt();\n\t\t\t\t\t\tadd += tableList[i][j];\n\t\t\t\t\t}\n\t\t\t\t\t//??????????¨???????????´?\n\t\t\t\t\ttableList[i][numC] =add;\n\n\t\t\t\t\t//??????????¨???????????´?\n\t\t\t\t\tfor (int k = 0; k < tableList[0].length; k++) {\n\t\t\t\t\t\ttableList[numR][k] += tableList[i][k];\n\t\t\t\t\t}\n\t\t\t\t\t//????¨???????????????????\n\t\t\t\t\tadd = 0;\n\t\t\t\t}",
"for (int j = 0; j < numC; j++) {\n\t\t\t\t\t\ttableList[i][j] = sc.nextInt();\n\t\t\t\t\t\tadd += tableList[i][j];\n\t\t\t\t\t}",
"int j = 0;",
"int j = 0;",
"j",
"0",
"j < numC",
"j",
"numC",
"j++",
"j++",
"j",
"{\n\t\t\t\t\t\ttableList[i][j] = sc.nextInt();\n\t\t\t\t\t\tadd += tableList[i][j];\n\t\t\t\t\t}",
"{\n\t\t\t\t\t\ttableList[i][j] = sc.nextInt();\n\t\t\t\t\t\tadd += tableList[i][j];\n\t\t\t\t\t}",
"tableList[i][j] = sc.nextInt()",
"tableList[i][j]",
"tableList[i]",
"tableList",
"i",
"j",
"sc.nextInt()",
"sc.nextInt",
"sc",
"add += tableList[i][j]",
"add",
"tableList[i][j]",
"tableList[i]",
"tableList",
"i",
"j",
"tableList[i][numC] =add",
"tableList[i][numC]",
"tableList[i]",
"tableList",
"i",
"numC",
"add",
"for (int k = 0; k < tableList[0].length; k++) {\n\t\t\t\t\t\ttableList[numR][k] += tableList[i][k];\n\t\t\t\t\t}",
"int k = 0;",
"int k = 0;",
"k",
"0",
"k < tableList[0].length",
"k",
"tableList[0].length",
"tableList[0]",
"tableList",
"0",
"tableList[0].length",
"k++",
"k++",
"k",
"{\n\t\t\t\t\t\ttableList[numR][k] += tableList[i][k];\n\t\t\t\t\t}",
"{\n\t\t\t\t\t\ttableList[numR][k] += tableList[i][k];\n\t\t\t\t\t}",
"tableList[numR][k] += tableList[i][k]",
"tableList[numR][k]",
"tableList[numR]",
"tableList",
"numR",
"k",
"tableList[i][k]",
"tableList[i]",
"tableList",
"i",
"k",
"add = 0",
"add",
"0",
"for (int i = 0; i < tableList.length; i++) {\n\t\t\t\t\tfor (int j = 0; j < tableList[0].length; j++) {\n\n\t\t\t\t\t\tif (!outPut.equals(\"\")) {\n\t\t\t\t\t\t\toutPut += \" \";\n\t\t\t\t\t\t}\n\t\t\t\t\t\toutPut += tableList[i][j];\n\n\t\t\t\t\t}\n\t\t\t\t\tSystem.out.println(outPut);\n\t\t\t\t\toutPut = \"\";\n\t\t\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < tableList.length",
"i",
"tableList.length",
"tableList",
"tableList.length",
"i++",
"i++",
"i",
"{\n\t\t\t\t\tfor (int j = 0; j < tableList[0].length; j++) {\n\n\t\t\t\t\t\tif (!outPut.equals(\"\")) {\n\t\t\t\t\t\t\toutPut += \" \";\n\t\t\t\t\t\t}\n\t\t\t\t\t\toutPut += tableList[i][j];\n\n\t\t\t\t\t}\n\t\t\t\t\tSystem.out.println(outPut);\n\t\t\t\t\toutPut = \"\";\n\t\t\t\t}",
"{\n\t\t\t\t\tfor (int j = 0; j < tableList[0].length; j++) {\n\n\t\t\t\t\t\tif (!outPut.equals(\"\")) {\n\t\t\t\t\t\t\toutPut += \" \";\n\t\t\t\t\t\t}\n\t\t\t\t\t\toutPut += tableList[i][j];\n\n\t\t\t\t\t}\n\t\t\t\t\tSystem.out.println(outPut);\n\t\t\t\t\toutPut = \"\";\n\t\t\t\t}",
"for (int j = 0; j < tableList[0].length; j++) {\n\n\t\t\t\t\t\tif (!outPut.equals(\"\")) {\n\t\t\t\t\t\t\toutPut += \" \";\n\t\t\t\t\t\t}\n\t\t\t\t\t\toutPut += tableList[i][j];\n\n\t\t\t\t\t}",
"int j = 0;",
"int j = 0;",
"j",
"0",
"j < tableList[0].length",
"j",
"tableList[0].length",
"tableList[0]",
"tableList",
"0",
"tableList[0].length",
"j++",
"j++",
"j",
"{\n\n\t\t\t\t\t\tif (!outPut.equals(\"\")) {\n\t\t\t\t\t\t\toutPut += \" \";\n\t\t\t\t\t\t}\n\t\t\t\t\t\toutPut += tableList[i][j];\n\n\t\t\t\t\t}",
"{\n\n\t\t\t\t\t\tif (!outPut.equals(\"\")) {\n\t\t\t\t\t\t\toutPut += \" \";\n\t\t\t\t\t\t}\n\t\t\t\t\t\toutPut += tableList[i][j];\n\n\t\t\t\t\t}",
"if (!outPut.equals(\"\")) {\n\t\t\t\t\t\t\toutPut += \" \";\n\t\t\t\t\t\t}",
"!outPut.equals(\"\")",
"outPut.equals(\"\")",
"outPut.equals",
"outPut",
"\"\"",
"{\n\t\t\t\t\t\t\toutPut += \" \";\n\t\t\t\t\t\t}",
"outPut += \" \"",
"outPut",
"\" \"",
"outPut += tableList[i][j]",
"outPut",
"tableList[i][j]",
"tableList[i]",
"tableList",
"i",
"j",
"System.out.println(outPut)",
"System.out.println",
"System.out",
"System",
"System.out",
"outPut",
"outPut = \"\"",
"outPut",
"\"\"",
"String[] args",
"args",
"public class Main {\n\n\tpublic static void main(String[] args) {\n\n\t\tint numR;\n\t\tint numC;\n\t\tint add = 0;\n\n\t\tString outPut = \"\";\n\n\t\tint[][] tableList;\n\n\t\tScanner sc = null;\n\n\t\ttry {\n\t\t\t//??\\????????????\n\t\t\tsc = new Scanner(System.in);\n\n\t\t\tnumR = sc.nextInt();\n\t\t\tnumC = sc.nextInt();\n\n\t\t\t//???????????°??¨\n\t\t\t//System.out.println(numR + \" \" + numC);\n\n\t\t\t//??¨??????????????£?¨?\n\t\t\ttableList = new int[numR + 1][numC + 1];\n\n\t\t\t\t//??¨?????\\??????????????????\n\t\t\t\tfor (int i = 0; i < numR; i++) {\n\n\t\t\t\t\tfor (int j = 0; j < numC; j++) {\n\t\t\t\t\t\ttableList[i][j] = sc.nextInt();\n\t\t\t\t\t\tadd += tableList[i][j];\n\t\t\t\t\t}\n\t\t\t\t\t//??????????¨???????????´?\n\t\t\t\t\ttableList[i][numC] =add;\n\n\t\t\t\t\t//??????????¨???????????´?\n\t\t\t\t\tfor (int k = 0; k < tableList[0].length; k++) {\n\t\t\t\t\t\ttableList[numR][k] += tableList[i][k];\n\t\t\t\t\t}\n\t\t\t\t\t//????¨???????????????????\n\t\t\t\t\tadd = 0;\n\t\t\t\t}\n\n\t\t\t\t//??¨?????????\n\t\t\t\tfor (int i = 0; i < tableList.length; i++) {\n\t\t\t\t\tfor (int j = 0; j < tableList[0].length; j++) {\n\n\t\t\t\t\t\tif (!outPut.equals(\"\")) {\n\t\t\t\t\t\t\toutPut += \" \";\n\t\t\t\t\t\t}\n\t\t\t\t\t\toutPut += tableList[i][j];\n\n\t\t\t\t\t}\n\t\t\t\t\tSystem.out.println(outPut);\n\t\t\t\t\toutPut = \"\";\n\t\t\t\t}\n\n\t\t\t}finally {\n\t\t\t\tsc.close();\n\t\t\t}\n\t}\n\n}",
"public class Main {\n\n\tpublic static void main(String[] args) {\n\n\t\tint numR;\n\t\tint numC;\n\t\tint add = 0;\n\n\t\tString outPut = \"\";\n\n\t\tint[][] tableList;\n\n\t\tScanner sc = null;\n\n\t\ttry {\n\t\t\t//??\\????????????\n\t\t\tsc = new Scanner(System.in);\n\n\t\t\tnumR = sc.nextInt();\n\t\t\tnumC = sc.nextInt();\n\n\t\t\t//???????????°??¨\n\t\t\t//System.out.println(numR + \" \" + numC);\n\n\t\t\t//??¨??????????????£?¨?\n\t\t\ttableList = new int[numR + 1][numC + 1];\n\n\t\t\t\t//??¨?????\\??????????????????\n\t\t\t\tfor (int i = 0; i < numR; i++) {\n\n\t\t\t\t\tfor (int j = 0; j < numC; j++) {\n\t\t\t\t\t\ttableList[i][j] = sc.nextInt();\n\t\t\t\t\t\tadd += tableList[i][j];\n\t\t\t\t\t}\n\t\t\t\t\t//??????????¨???????????´?\n\t\t\t\t\ttableList[i][numC] =add;\n\n\t\t\t\t\t//??????????¨???????????´?\n\t\t\t\t\tfor (int k = 0; k < tableList[0].length; k++) {\n\t\t\t\t\t\ttableList[numR][k] += tableList[i][k];\n\t\t\t\t\t}\n\t\t\t\t\t//????¨???????????????????\n\t\t\t\t\tadd = 0;\n\t\t\t\t}\n\n\t\t\t\t//??¨?????????\n\t\t\t\tfor (int i = 0; i < tableList.length; i++) {\n\t\t\t\t\tfor (int j = 0; j < tableList[0].length; j++) {\n\n\t\t\t\t\t\tif (!outPut.equals(\"\")) {\n\t\t\t\t\t\t\toutPut += \" \";\n\t\t\t\t\t\t}\n\t\t\t\t\t\toutPut += tableList[i][j];\n\n\t\t\t\t\t}\n\t\t\t\t\tSystem.out.println(outPut);\n\t\t\t\t\toutPut = \"\";\n\t\t\t\t}\n\n\t\t\t}finally {\n\t\t\t\tsc.close();\n\t\t\t}\n\t}\n\n}",
"Main"
] | import java.util.Scanner;
public class Main {
public static void main(String[] args) {
int numR;
int numC;
int add = 0;
String outPut = "";
int[][] tableList;
Scanner sc = null;
try {
//??\????????????
sc = new Scanner(System.in);
numR = sc.nextInt();
numC = sc.nextInt();
//???????????°??¨
//System.out.println(numR + " " + numC);
//??¨??????????????£?¨?
tableList = new int[numR + 1][numC + 1];
//??¨?????\??????????????????
for (int i = 0; i < numR; i++) {
for (int j = 0; j < numC; j++) {
tableList[i][j] = sc.nextInt();
add += tableList[i][j];
}
//??????????¨???????????´?
tableList[i][numC] =add;
//??????????¨???????????´?
for (int k = 0; k < tableList[0].length; k++) {
tableList[numR][k] += tableList[i][k];
}
//????¨???????????????????
add = 0;
}
//??¨?????????
for (int i = 0; i < tableList.length; i++) {
for (int j = 0; j < tableList[0].length; j++) {
if (!outPut.equals("")) {
outPut += " ";
}
outPut += tableList[i][j];
}
System.out.println(outPut);
outPut = "";
}
}finally {
sc.close();
}
}
} |
[
7,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
41,
13,
17,
41,
13,
17,
41,
13,
17,
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,
0,
13,
17,
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,
4,
18,
18,
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,
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,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
187,
8
],
[
187,
9
],
[
9,
10
],
[
9,
11
],
[
11,
12
],
[
12,
13
],
[
12,
14
],
[
11,
15
],
[
15,
16
],
[
15,
17
],
[
11,
18
],
[
18,
19
],
[
18,
20
],
[
20,
21
],
[
21,
22
],
[
11,
23
],
[
23,
24
],
[
23,
25
],
[
25,
26
],
[
26,
27
],
[
11,
28
],
[
28,
29
],
[
28,
30
],
[
11,
31
],
[
31,
32
],
[
31,
33
],
[
11,
34
],
[
34,
35
],
[
34,
36
],
[
11,
37
],
[
37,
38
],
[
37,
39
],
[
11,
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
],
[
11,
77
],
[
77,
78
],
[
78,
79
],
[
79,
80
],
[
79,
81
],
[
77,
82
],
[
82,
83
],
[
82,
84
],
[
77,
85
],
[
85,
86
],
[
86,
87
],
[
77,
88
],
[
89,
89
],
[
89,
90
],
[
90,
91
],
[
90,
92
],
[
89,
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
],
[
112,
113
],
[
113,
114
],
[
113,
115
],
[
112,
116
],
[
111,
117
],
[
105,
118
],
[
118,
119
],
[
118,
120
],
[
120,
121
],
[
121,
122
],
[
121,
123
],
[
120,
124
],
[
89,
125
],
[
125,
126
],
[
126,
127
],
[
127,
128
],
[
127,
129
],
[
125,
130
],
[
11,
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
],
[
144,
146
],
[
143,
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
],
[
163,
164
],
[
163,
165
],
[
162,
166
],
[
143,
167
],
[
167,
168
],
[
168,
169
],
[
169,
170
],
[
169,
171
],
[
167,
172
],
[
172,
173
],
[
172,
174
],
[
143,
175
],
[
175,
176
],
[
175,
177
],
[
11,
178
],
[
178,
179
],
[
179,
180
],
[
180,
181
],
[
180,
182
],
[
178,
183
],
[
9,
184
],
[
184,
185
],
[
0,
186
],
[
186,
187
],
[
186,
188
]
] | [
"import java.io.PrintWriter;\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\tPrintWriter out = new PrintWriter(System.out);\n\t\tint gyou = sc.nextInt();\n\t\tint retu = sc.nextInt();\n\t\tint gyouSum = 0;\n\t\tint retuSum = 0;\n\t\tint sum = 0;\n\t\tint map[][] = new int[gyou][retu];\n\n\t\tfor(int i = 0; i < gyou; i++){\n\t\t\tfor(int j = 0; j < retu; j++){\n\t\t\t\tmap[i][j] = sc.nextInt();\n\t\t\t}\n\t\t}\n\n\t\tfor(int i = 0; i < gyou; i++){\n\t\t\tgyouSum = 0;\n\t\t\tfor(int j = 0; j < retu; j++){\n\t\t\t\tSystem.out.print(map[i][j] + \" \");\n\t\t\t\tgyouSum += map[i][j];\n\t\t\t}\n\t\t\tSystem.out.println(gyouSum);\n\t\t}\n\t\tfor(int j = 0; j < retu; j++){\n\t\t\tretuSum = 0;\n\t\t\tfor(int i = 0; i < gyou; i++){\n\t\t\t\tretuSum += map[i][j];\n\t\t\t}\n\t\t\tSystem.out.print(retuSum + \" \");\n\t\t\tsum += retuSum;\n\t\t}\n\t\tSystem.out.println(sum);\n\n\n\t}\n}",
"import java.io.PrintWriter;",
"PrintWriter",
"java.io",
"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\tPrintWriter out = new PrintWriter(System.out);\n\t\tint gyou = sc.nextInt();\n\t\tint retu = sc.nextInt();\n\t\tint gyouSum = 0;\n\t\tint retuSum = 0;\n\t\tint sum = 0;\n\t\tint map[][] = new int[gyou][retu];\n\n\t\tfor(int i = 0; i < gyou; i++){\n\t\t\tfor(int j = 0; j < retu; j++){\n\t\t\t\tmap[i][j] = sc.nextInt();\n\t\t\t}\n\t\t}\n\n\t\tfor(int i = 0; i < gyou; i++){\n\t\t\tgyouSum = 0;\n\t\t\tfor(int j = 0; j < retu; j++){\n\t\t\t\tSystem.out.print(map[i][j] + \" \");\n\t\t\t\tgyouSum += map[i][j];\n\t\t\t}\n\t\t\tSystem.out.println(gyouSum);\n\t\t}\n\t\tfor(int j = 0; j < retu; j++){\n\t\t\tretuSum = 0;\n\t\t\tfor(int i = 0; i < gyou; i++){\n\t\t\t\tretuSum += map[i][j];\n\t\t\t}\n\t\t\tSystem.out.print(retuSum + \" \");\n\t\t\tsum += retuSum;\n\t\t}\n\t\tSystem.out.println(sum);\n\n\n\t}\n}",
"Main",
"public static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\tPrintWriter out = new PrintWriter(System.out);\n\t\tint gyou = sc.nextInt();\n\t\tint retu = sc.nextInt();\n\t\tint gyouSum = 0;\n\t\tint retuSum = 0;\n\t\tint sum = 0;\n\t\tint map[][] = new int[gyou][retu];\n\n\t\tfor(int i = 0; i < gyou; i++){\n\t\t\tfor(int j = 0; j < retu; j++){\n\t\t\t\tmap[i][j] = sc.nextInt();\n\t\t\t}\n\t\t}\n\n\t\tfor(int i = 0; i < gyou; i++){\n\t\t\tgyouSum = 0;\n\t\t\tfor(int j = 0; j < retu; j++){\n\t\t\t\tSystem.out.print(map[i][j] + \" \");\n\t\t\t\tgyouSum += map[i][j];\n\t\t\t}\n\t\t\tSystem.out.println(gyouSum);\n\t\t}\n\t\tfor(int j = 0; j < retu; j++){\n\t\t\tretuSum = 0;\n\t\t\tfor(int i = 0; i < gyou; i++){\n\t\t\t\tretuSum += map[i][j];\n\t\t\t}\n\t\t\tSystem.out.print(retuSum + \" \");\n\t\t\tsum += retuSum;\n\t\t}\n\t\tSystem.out.println(sum);\n\n\n\t}",
"main",
"{\n\t\tScanner sc = new Scanner(System.in);\n\t\tPrintWriter out = new PrintWriter(System.out);\n\t\tint gyou = sc.nextInt();\n\t\tint retu = sc.nextInt();\n\t\tint gyouSum = 0;\n\t\tint retuSum = 0;\n\t\tint sum = 0;\n\t\tint map[][] = new int[gyou][retu];\n\n\t\tfor(int i = 0; i < gyou; i++){\n\t\t\tfor(int j = 0; j < retu; j++){\n\t\t\t\tmap[i][j] = sc.nextInt();\n\t\t\t}\n\t\t}\n\n\t\tfor(int i = 0; i < gyou; i++){\n\t\t\tgyouSum = 0;\n\t\t\tfor(int j = 0; j < retu; j++){\n\t\t\t\tSystem.out.print(map[i][j] + \" \");\n\t\t\t\tgyouSum += map[i][j];\n\t\t\t}\n\t\t\tSystem.out.println(gyouSum);\n\t\t}\n\t\tfor(int j = 0; j < retu; j++){\n\t\t\tretuSum = 0;\n\t\t\tfor(int i = 0; i < gyou; i++){\n\t\t\t\tretuSum += map[i][j];\n\t\t\t}\n\t\t\tSystem.out.print(retuSum + \" \");\n\t\t\tsum += retuSum;\n\t\t}\n\t\tSystem.out.println(sum);\n\n\n\t}",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"PrintWriter out = new PrintWriter(System.out);",
"out",
"new PrintWriter(System.out)",
"int gyou = sc.nextInt();",
"gyou",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int retu = sc.nextInt();",
"retu",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int gyouSum = 0;",
"gyouSum",
"0",
"int retuSum = 0;",
"retuSum",
"0",
"int sum = 0;",
"sum",
"0",
"int map[][] = new int[gyou][retu];",
"map",
"new int[gyou][retu]",
"gyou",
"retu",
"for(int i = 0; i < gyou; i++){\n\t\t\tfor(int j = 0; j < retu; j++){\n\t\t\t\tmap[i][j] = sc.nextInt();\n\t\t\t}\n\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < gyou",
"i",
"gyou",
"i++",
"i++",
"i",
"{\n\t\t\tfor(int j = 0; j < retu; j++){\n\t\t\t\tmap[i][j] = sc.nextInt();\n\t\t\t}\n\t\t}",
"{\n\t\t\tfor(int j = 0; j < retu; j++){\n\t\t\t\tmap[i][j] = sc.nextInt();\n\t\t\t}\n\t\t}",
"for(int j = 0; j < retu; j++){\n\t\t\t\tmap[i][j] = sc.nextInt();\n\t\t\t}",
"int j = 0;",
"int j = 0;",
"j",
"0",
"j < retu",
"j",
"retu",
"j++",
"j++",
"j",
"{\n\t\t\t\tmap[i][j] = sc.nextInt();\n\t\t\t}",
"{\n\t\t\t\tmap[i][j] = sc.nextInt();\n\t\t\t}",
"map[i][j] = sc.nextInt()",
"map[i][j]",
"map[i]",
"map",
"i",
"j",
"sc.nextInt()",
"sc.nextInt",
"sc",
"for(int i = 0; i < gyou; i++){\n\t\t\tgyouSum = 0;\n\t\t\tfor(int j = 0; j < retu; j++){\n\t\t\t\tSystem.out.print(map[i][j] + \" \");\n\t\t\t\tgyouSum += map[i][j];\n\t\t\t}\n\t\t\tSystem.out.println(gyouSum);\n\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < gyou",
"i",
"gyou",
"i++",
"i++",
"i",
"{\n\t\t\tgyouSum = 0;\n\t\t\tfor(int j = 0; j < retu; j++){\n\t\t\t\tSystem.out.print(map[i][j] + \" \");\n\t\t\t\tgyouSum += map[i][j];\n\t\t\t}\n\t\t\tSystem.out.println(gyouSum);\n\t\t}",
"{\n\t\t\tgyouSum = 0;\n\t\t\tfor(int j = 0; j < retu; j++){\n\t\t\t\tSystem.out.print(map[i][j] + \" \");\n\t\t\t\tgyouSum += map[i][j];\n\t\t\t}\n\t\t\tSystem.out.println(gyouSum);\n\t\t}",
"gyouSum = 0",
"gyouSum",
"0",
"for(int j = 0; j < retu; j++){\n\t\t\t\tSystem.out.print(map[i][j] + \" \");\n\t\t\t\tgyouSum += map[i][j];\n\t\t\t}",
"int j = 0;",
"int j = 0;",
"j",
"0",
"j < retu",
"j",
"retu",
"j++",
"j++",
"j",
"{\n\t\t\t\tSystem.out.print(map[i][j] + \" \");\n\t\t\t\tgyouSum += map[i][j];\n\t\t\t}",
"{\n\t\t\t\tSystem.out.print(map[i][j] + \" \");\n\t\t\t\tgyouSum += map[i][j];\n\t\t\t}",
"System.out.print(map[i][j] + \" \")",
"System.out.print",
"System.out",
"System",
"System.out",
"map[i][j] + \" \"",
"map[i][j]",
"map[i]",
"map",
"i",
"j",
"\" \"",
"gyouSum += map[i][j]",
"gyouSum",
"map[i][j]",
"map[i]",
"map",
"i",
"j",
"System.out.println(gyouSum)",
"System.out.println",
"System.out",
"System",
"System.out",
"gyouSum",
"for(int j = 0; j < retu; j++){\n\t\t\tretuSum = 0;\n\t\t\tfor(int i = 0; i < gyou; i++){\n\t\t\t\tretuSum += map[i][j];\n\t\t\t}\n\t\t\tSystem.out.print(retuSum + \" \");\n\t\t\tsum += retuSum;\n\t\t}",
"int j = 0;",
"int j = 0;",
"j",
"0",
"j < retu",
"j",
"retu",
"j++",
"j++",
"j",
"{\n\t\t\tretuSum = 0;\n\t\t\tfor(int i = 0; i < gyou; i++){\n\t\t\t\tretuSum += map[i][j];\n\t\t\t}\n\t\t\tSystem.out.print(retuSum + \" \");\n\t\t\tsum += retuSum;\n\t\t}",
"{\n\t\t\tretuSum = 0;\n\t\t\tfor(int i = 0; i < gyou; i++){\n\t\t\t\tretuSum += map[i][j];\n\t\t\t}\n\t\t\tSystem.out.print(retuSum + \" \");\n\t\t\tsum += retuSum;\n\t\t}",
"retuSum = 0",
"retuSum",
"0",
"for(int i = 0; i < gyou; i++){\n\t\t\t\tretuSum += map[i][j];\n\t\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < gyou",
"i",
"gyou",
"i++",
"i++",
"i",
"{\n\t\t\t\tretuSum += map[i][j];\n\t\t\t}",
"{\n\t\t\t\tretuSum += map[i][j];\n\t\t\t}",
"retuSum += map[i][j]",
"retuSum",
"map[i][j]",
"map[i]",
"map",
"i",
"j",
"System.out.print(retuSum + \" \")",
"System.out.print",
"System.out",
"System",
"System.out",
"retuSum + \" \"",
"retuSum",
"\" \"",
"sum += retuSum",
"sum",
"retuSum",
"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\tPrintWriter out = new PrintWriter(System.out);\n\t\tint gyou = sc.nextInt();\n\t\tint retu = sc.nextInt();\n\t\tint gyouSum = 0;\n\t\tint retuSum = 0;\n\t\tint sum = 0;\n\t\tint map[][] = new int[gyou][retu];\n\n\t\tfor(int i = 0; i < gyou; i++){\n\t\t\tfor(int j = 0; j < retu; j++){\n\t\t\t\tmap[i][j] = sc.nextInt();\n\t\t\t}\n\t\t}\n\n\t\tfor(int i = 0; i < gyou; i++){\n\t\t\tgyouSum = 0;\n\t\t\tfor(int j = 0; j < retu; j++){\n\t\t\t\tSystem.out.print(map[i][j] + \" \");\n\t\t\t\tgyouSum += map[i][j];\n\t\t\t}\n\t\t\tSystem.out.println(gyouSum);\n\t\t}\n\t\tfor(int j = 0; j < retu; j++){\n\t\t\tretuSum = 0;\n\t\t\tfor(int i = 0; i < gyou; i++){\n\t\t\t\tretuSum += map[i][j];\n\t\t\t}\n\t\t\tSystem.out.print(retuSum + \" \");\n\t\t\tsum += retuSum;\n\t\t}\n\t\tSystem.out.println(sum);\n\n\n\t}\n}",
"public class Main{\n\tpublic static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\tPrintWriter out = new PrintWriter(System.out);\n\t\tint gyou = sc.nextInt();\n\t\tint retu = sc.nextInt();\n\t\tint gyouSum = 0;\n\t\tint retuSum = 0;\n\t\tint sum = 0;\n\t\tint map[][] = new int[gyou][retu];\n\n\t\tfor(int i = 0; i < gyou; i++){\n\t\t\tfor(int j = 0; j < retu; j++){\n\t\t\t\tmap[i][j] = sc.nextInt();\n\t\t\t}\n\t\t}\n\n\t\tfor(int i = 0; i < gyou; i++){\n\t\t\tgyouSum = 0;\n\t\t\tfor(int j = 0; j < retu; j++){\n\t\t\t\tSystem.out.print(map[i][j] + \" \");\n\t\t\t\tgyouSum += map[i][j];\n\t\t\t}\n\t\t\tSystem.out.println(gyouSum);\n\t\t}\n\t\tfor(int j = 0; j < retu; j++){\n\t\t\tretuSum = 0;\n\t\t\tfor(int i = 0; i < gyou; i++){\n\t\t\t\tretuSum += map[i][j];\n\t\t\t}\n\t\t\tSystem.out.print(retuSum + \" \");\n\t\t\tsum += retuSum;\n\t\t}\n\t\tSystem.out.println(sum);\n\n\n\t}\n}",
"Main"
] | import java.io.PrintWriter;
import java.util.Scanner;
public class Main{
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
PrintWriter out = new PrintWriter(System.out);
int gyou = sc.nextInt();
int retu = sc.nextInt();
int gyouSum = 0;
int retuSum = 0;
int sum = 0;
int map[][] = new int[gyou][retu];
for(int i = 0; i < gyou; i++){
for(int j = 0; j < retu; j++){
map[i][j] = sc.nextInt();
}
}
for(int i = 0; i < gyou; i++){
gyouSum = 0;
for(int j = 0; j < retu; j++){
System.out.print(map[i][j] + " ");
gyouSum += map[i][j];
}
System.out.println(gyouSum);
}
for(int j = 0; j < retu; j++){
retuSum = 0;
for(int i = 0; i < gyou; i++){
retuSum += map[i][j];
}
System.out.print(retuSum + " ");
sum += retuSum;
}
System.out.println(sum);
}
} |
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
17,
41,
13,
17,
41,
13,
17,
41,
13,
41,
13,
41,
13,
41,
13,
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,
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,
4,
18,
13,
0,
18,
18,
13,
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,
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,
18,
18,
13,
13,
17,
18,
18,
13,
13,
17,
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,
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
],
[
8,
15
],
[
15,
16
],
[
15,
17
],
[
8,
18
],
[
18,
19
],
[
18,
20
],
[
8,
21
],
[
21,
22
],
[
8,
23
],
[
23,
24
],
[
8,
25
],
[
25,
26
],
[
8,
27
],
[
27,
28
],
[
8,
29
],
[
29,
30
],
[
8,
31
],
[
31,
32
],
[
8,
33
],
[
33,
34
],
[
33,
35
],
[
35,
36
],
[
36,
37
],
[
8,
38
],
[
38,
39
],
[
38,
40
],
[
40,
41
],
[
41,
42
],
[
8,
43
],
[
43,
44
],
[
43,
45
],
[
46,
47
],
[
46,
48
],
[
49,
50
],
[
49,
51
],
[
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
],
[
66,
67
],
[
67,
68
],
[
67,
69
],
[
65,
70
],
[
70,
71
],
[
70,
72
],
[
65,
73
],
[
73,
74
],
[
74,
75
],
[
65,
76
],
[
77,
77
],
[
77,
78
],
[
78,
79
],
[
78,
80
],
[
80,
81
],
[
81,
82
],
[
77,
83
],
[
83,
84
],
[
84,
85
],
[
85,
86
],
[
85,
87
],
[
84,
88
],
[
83,
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
],
[
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
],
[
117,
121
],
[
116,
122
],
[
122,
123
],
[
123,
124
],
[
123,
125
],
[
122,
126
],
[
8,
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
],
[
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
],
[
8,
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
],
[
6,
218
],
[
218,
219
]
] | [
"import java.util.*;\nclass Main{\n public static void main(String[] args){\n Scanner scan=new Scanner(System.in);\n int r=0, c=0, x=0;\n int i, j, k, l, m, n;\n r=scan.nextInt();\n c=scan.nextInt();\n int[][] a=new int[r+1][c+1];\n \n for (i=0; i<r; i++) {\n for (j=0; j<c; j++) {\n x=scan.nextInt();\n a[i][j] = x;\n }\n }\n for (k=0; k<r; k++) {\n for (l=0; l<c; l++) {\n a[k][c] += a[k][l];\n }\n }\n for(m=0; m<=c; m++){ \n for(n=0; n<r; n++){\n a[r][m] += a[n][m];\n }\n }\n for(i = 0; i <= r; i++){\n\t\t\tSystem.out.printf(\"%d\", a[i][0]);\n\t\t\tfor(j = 1; j <= c; j++){\n\t\t\t\tSystem.out.printf(\" %d\", a[i][j]);\n\t\t\t}\n\t\t\tSystem.out.printf(\"\\n\");\n\t\t}\n }\n}",
"import java.util.*;",
"util.*",
"java",
"class Main{\n public static void main(String[] args){\n Scanner scan=new Scanner(System.in);\n int r=0, c=0, x=0;\n int i, j, k, l, m, n;\n r=scan.nextInt();\n c=scan.nextInt();\n int[][] a=new int[r+1][c+1];\n \n for (i=0; i<r; i++) {\n for (j=0; j<c; j++) {\n x=scan.nextInt();\n a[i][j] = x;\n }\n }\n for (k=0; k<r; k++) {\n for (l=0; l<c; l++) {\n a[k][c] += a[k][l];\n }\n }\n for(m=0; m<=c; m++){ \n for(n=0; n<r; n++){\n a[r][m] += a[n][m];\n }\n }\n for(i = 0; i <= r; i++){\n\t\t\tSystem.out.printf(\"%d\", a[i][0]);\n\t\t\tfor(j = 1; j <= c; j++){\n\t\t\t\tSystem.out.printf(\" %d\", a[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 scan=new Scanner(System.in);\n int r=0, c=0, x=0;\n int i, j, k, l, m, n;\n r=scan.nextInt();\n c=scan.nextInt();\n int[][] a=new int[r+1][c+1];\n \n for (i=0; i<r; i++) {\n for (j=0; j<c; j++) {\n x=scan.nextInt();\n a[i][j] = x;\n }\n }\n for (k=0; k<r; k++) {\n for (l=0; l<c; l++) {\n a[k][c] += a[k][l];\n }\n }\n for(m=0; m<=c; m++){ \n for(n=0; n<r; n++){\n a[r][m] += a[n][m];\n }\n }\n for(i = 0; i <= r; i++){\n\t\t\tSystem.out.printf(\"%d\", a[i][0]);\n\t\t\tfor(j = 1; j <= c; j++){\n\t\t\t\tSystem.out.printf(\" %d\", a[i][j]);\n\t\t\t}\n\t\t\tSystem.out.printf(\"\\n\");\n\t\t}\n }",
"main",
"{\n Scanner scan=new Scanner(System.in);\n int r=0, c=0, x=0;\n int i, j, k, l, m, n;\n r=scan.nextInt();\n c=scan.nextInt();\n int[][] a=new int[r+1][c+1];\n \n for (i=0; i<r; i++) {\n for (j=0; j<c; j++) {\n x=scan.nextInt();\n a[i][j] = x;\n }\n }\n for (k=0; k<r; k++) {\n for (l=0; l<c; l++) {\n a[k][c] += a[k][l];\n }\n }\n for(m=0; m<=c; m++){ \n for(n=0; n<r; n++){\n a[r][m] += a[n][m];\n }\n }\n for(i = 0; i <= r; i++){\n\t\t\tSystem.out.printf(\"%d\", a[i][0]);\n\t\t\tfor(j = 1; j <= c; j++){\n\t\t\t\tSystem.out.printf(\" %d\", a[i][j]);\n\t\t\t}\n\t\t\tSystem.out.printf(\"\\n\");\n\t\t}\n }",
"Scanner scan=new Scanner(System.in);",
"scan",
"new Scanner(System.in)",
"int r=0",
"r",
"0",
"c=0",
"c",
"0",
"x=0;",
"x",
"0",
"int i",
"i",
"j",
"j",
"k",
"k",
"l",
"l",
"m",
"m",
"n;",
"n",
"r=scan.nextInt()",
"r",
"scan.nextInt()",
"scan.nextInt",
"scan",
"c=scan.nextInt()",
"c",
"scan.nextInt()",
"scan.nextInt",
"scan",
"int[][] 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 for (j=0; j<c; j++) {\n x=scan.nextInt();\n a[i][j] = x;\n }\n }",
"i=0;",
"i=0",
"i",
"0",
"i<r",
"i",
"r",
"i++",
"i++",
"i",
"{\n for (j=0; j<c; j++) {\n x=scan.nextInt();\n a[i][j] = x;\n }\n }",
"{\n for (j=0; j<c; j++) {\n x=scan.nextInt();\n a[i][j] = x;\n }\n }",
"for (j=0; j<c; j++) {\n x=scan.nextInt();\n a[i][j] = x;\n }",
"j=0;",
"j=0",
"j",
"0",
"j<c",
"j",
"c",
"j++",
"j++",
"j",
"{\n x=scan.nextInt();\n a[i][j] = x;\n }",
"{\n x=scan.nextInt();\n a[i][j] = x;\n }",
"x=scan.nextInt()",
"x",
"scan.nextInt()",
"scan.nextInt",
"scan",
"a[i][j] = x",
"a[i][j]",
"a[i]",
"a",
"i",
"j",
"x",
"for (k=0; k<r; k++) {\n for (l=0; l<c; l++) {\n a[k][c] += a[k][l];\n }\n }",
"k=0;",
"k=0",
"k",
"0",
"k<r",
"k",
"r",
"k++",
"k++",
"k",
"{\n for (l=0; l<c; l++) {\n a[k][c] += a[k][l];\n }\n }",
"{\n for (l=0; l<c; l++) {\n a[k][c] += a[k][l];\n }\n }",
"for (l=0; l<c; l++) {\n a[k][c] += a[k][l];\n }",
"l=0;",
"l=0",
"l",
"0",
"l<c",
"l",
"c",
"l++",
"l++",
"l",
"{\n a[k][c] += a[k][l];\n }",
"{\n a[k][c] += a[k][l];\n }",
"a[k][c] += a[k][l]",
"a[k][c]",
"a[k]",
"a",
"k",
"c",
"a[k][l]",
"a[k]",
"a",
"k",
"l",
"for(m=0; m<=c; m++){ \n for(n=0; n<r; n++){\n a[r][m] += a[n][m];\n }\n }",
"m=0;",
"m=0",
"m",
"0",
"m<=c",
"m",
"c",
"m++",
"m++",
"m",
"{ \n for(n=0; n<r; n++){\n a[r][m] += a[n][m];\n }\n }",
"{ \n for(n=0; n<r; n++){\n a[r][m] += a[n][m];\n }\n }",
"for(n=0; n<r; n++){\n a[r][m] += a[n][m];\n }",
"n=0;",
"n=0",
"n",
"0",
"n<r",
"n",
"r",
"n++",
"n++",
"n",
"{\n a[r][m] += a[n][m];\n }",
"{\n a[r][m] += a[n][m];\n }",
"a[r][m] += a[n][m]",
"a[r][m]",
"a[r]",
"a",
"r",
"m",
"a[n][m]",
"a[n]",
"a",
"n",
"m",
"for(i = 0; i <= r; i++){\n\t\t\tSystem.out.printf(\"%d\", a[i][0]);\n\t\t\tfor(j = 1; j <= c; j++){\n\t\t\t\tSystem.out.printf(\" %d\", a[i][j]);\n\t\t\t}\n\t\t\tSystem.out.printf(\"\\n\");\n\t\t}",
"i = 0;",
"i = 0",
"i",
"0",
"i <= r",
"i",
"r",
"i++",
"i++",
"i",
"{\n\t\t\tSystem.out.printf(\"%d\", a[i][0]);\n\t\t\tfor(j = 1; j <= c; j++){\n\t\t\t\tSystem.out.printf(\" %d\", a[i][j]);\n\t\t\t}\n\t\t\tSystem.out.printf(\"\\n\");\n\t\t}",
"{\n\t\t\tSystem.out.printf(\"%d\", a[i][0]);\n\t\t\tfor(j = 1; j <= c; j++){\n\t\t\t\tSystem.out.printf(\" %d\", a[i][j]);\n\t\t\t}\n\t\t\tSystem.out.printf(\"\\n\");\n\t\t}",
"System.out.printf(\"%d\", a[i][0])",
"System.out.printf",
"System.out",
"System",
"System.out",
"\"%d\"",
"a[i][0]",
"a[i]",
"a",
"i",
"0",
"for(j = 1; j <= c; j++){\n\t\t\t\tSystem.out.printf(\" %d\", a[i][j]);\n\t\t\t}",
"j = 1;",
"j = 1",
"j",
"1",
"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.printf(\"\\n\")",
"System.out.printf",
"System.out",
"System",
"System.out",
"\"\\n\"",
"String[] args",
"args"
] | import java.util.*;
class Main{
public static void main(String[] args){
Scanner scan=new Scanner(System.in);
int r=0, c=0, x=0;
int i, j, k, l, m, n;
r=scan.nextInt();
c=scan.nextInt();
int[][] a=new int[r+1][c+1];
for (i=0; i<r; i++) {
for (j=0; j<c; j++) {
x=scan.nextInt();
a[i][j] = x;
}
}
for (k=0; k<r; k++) {
for (l=0; l<c; l++) {
a[k][c] += a[k][l];
}
}
for(m=0; m<=c; m++){
for(n=0; n<r; n++){
a[r][m] += a[n][m];
}
}
for(i = 0; i <= r; i++){
System.out.printf("%d", a[i][0]);
for(j = 1; j <= c; j++){
System.out.printf(" %d", a[i][j]);
}
System.out.printf("\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,
2,
13,
17,
41,
13,
2,
13,
17,
41,
13,
20,
13,
13,
41,
13,
20,
13,
41,
13,
20,
13,
41,
13,
41,
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,
0,
18,
18,
13,
13,
13,
4,
18,
13,
0,
18,
18,
13,
13,
2,
13,
17,
18,
18,
13,
13,
13,
0,
18,
18,
13,
2,
13,
17,
13,
18,
18,
13,
13,
13,
0,
18,
18,
13,
2,
13,
17,
2,
13,
17,
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,
2,
13,
17,
30,
4,
18,
18,
13,
13,
18,
18,
13,
13,
13,
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
],
[
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
],
[
24,
25
],
[
24,
26
],
[
8,
27
],
[
27,
28
],
[
27,
29
],
[
29,
30
],
[
29,
31
],
[
8,
32
],
[
32,
33
],
[
32,
34
],
[
8,
37
],
[
37,
38
],
[
37,
39
],
[
8,
41
],
[
41,
42
],
[
41,
43
],
[
8,
45
],
[
45,
46
],
[
8,
47
],
[
47,
48
],
[
8,
49
],
[
49,
50
],
[
50,
51
],
[
51,
52
],
[
51,
53
],
[
49,
54
],
[
54,
55
],
[
54,
56
],
[
56,
57
],
[
56,
58
],
[
49,
59
],
[
59,
60
],
[
60,
61
],
[
49,
62
],
[
63,
63
],
[
63,
64
],
[
64,
65
],
[
65,
66
],
[
66,
67
],
[
66,
68
],
[
64,
69
],
[
69,
70
],
[
69,
71
],
[
71,
72
],
[
71,
73
],
[
64,
74
],
[
74,
75
],
[
75,
76
],
[
64,
77
],
[
78,
78
],
[
78,
79
],
[
79,
80
],
[
80,
81
],
[
81,
82
],
[
81,
83
],
[
80,
84
],
[
79,
85
],
[
85,
86
],
[
86,
87
],
[
78,
88
],
[
88,
89
],
[
89,
90
],
[
90,
91
],
[
90,
92
],
[
89,
93
],
[
93,
94
],
[
93,
95
],
[
88,
96
],
[
96,
97
],
[
97,
98
],
[
97,
99
],
[
96,
100
],
[
78,
101
],
[
101,
102
],
[
102,
103
],
[
103,
104
],
[
103,
105
],
[
105,
106
],
[
105,
107
],
[
102,
108
],
[
101,
109
],
[
109,
110
],
[
110,
111
],
[
110,
112
],
[
109,
113
],
[
78,
114
],
[
114,
115
],
[
115,
116
],
[
116,
117
],
[
116,
118
],
[
118,
119
],
[
118,
120
],
[
115,
121
],
[
121,
122
],
[
121,
123
],
[
114,
124
],
[
124,
125
],
[
125,
126
],
[
125,
127
],
[
124,
128
],
[
8,
129
],
[
129,
130
],
[
130,
131
],
[
131,
132
],
[
131,
133
],
[
129,
134
],
[
134,
135
],
[
134,
136
],
[
129,
137
],
[
137,
138
],
[
138,
139
],
[
129,
140
],
[
141,
141
],
[
141,
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
],
[
156,
158
],
[
158,
159
],
[
158,
160
],
[
155,
161
],
[
161,
162
],
[
162,
163
],
[
163,
164
],
[
164,
165
],
[
164,
166
],
[
162,
167
],
[
167,
168
],
[
168,
169
],
[
168,
170
],
[
167,
171
],
[
155,
172
],
[
172,
173
],
[
173,
174
],
[
174,
175
],
[
174,
176
],
[
172,
177
],
[
177,
178
],
[
178,
179
],
[
179,
180
],
[
179,
181
],
[
178,
182
],
[
177,
183
],
[
6,
184
],
[
184,
185
],
[
0,
186
],
[
186,
187
],
[
186,
188
]
] | [
"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 t = scan.nextInt();\n\t\tint u = scan.nextInt();\n\t\tint n = t + 1;\n\t\tint m = u + 1;\n\t\tint[][] a = new int[n][m];\n\t\tint b[] = new int[m];\n\t\tint c[] = new int[n];\n\t\tint i,r;\n\t\tfor(i = 0; i < n - 1; ++i){\n\t\t\tfor(r = 0; r < m - 1; ++r){\n\t\t\t\ta[i][r] = scan.nextInt();\n\t\t\t\ta[i][m - 1] += a[i][r];\n\t\t\t\ta[n - 1][r]\t+= a[i][r];\n\t\t\t\ta[n - 1][m - 1] += a[i][r];\n\t\t\t}\n\t\t}\n\t\tfor(i = 0; i < n; ++i){\n\t\t\tfor(r = 0; r < m; ++r){\n\t\t\t\tif(r == m - 1){\n\t\t\t\t\tSystem.out.println(a[i][r]);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\tSystem.out.print(a[i][r]+\" \");\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t}\n}\n\t\t",
"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 t = scan.nextInt();\n\t\tint u = scan.nextInt();\n\t\tint n = t + 1;\n\t\tint m = u + 1;\n\t\tint[][] a = new int[n][m];\n\t\tint b[] = new int[m];\n\t\tint c[] = new int[n];\n\t\tint i,r;\n\t\tfor(i = 0; i < n - 1; ++i){\n\t\t\tfor(r = 0; r < m - 1; ++r){\n\t\t\t\ta[i][r] = scan.nextInt();\n\t\t\t\ta[i][m - 1] += a[i][r];\n\t\t\t\ta[n - 1][r]\t+= a[i][r];\n\t\t\t\ta[n - 1][m - 1] += a[i][r];\n\t\t\t}\n\t\t}\n\t\tfor(i = 0; i < n; ++i){\n\t\t\tfor(r = 0; r < m; ++r){\n\t\t\t\tif(r == m - 1){\n\t\t\t\t\tSystem.out.println(a[i][r]);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\tSystem.out.print(a[i][r]+\" \");\n\t\t\t\t\n\t\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 t = scan.nextInt();\n\t\tint u = scan.nextInt();\n\t\tint n = t + 1;\n\t\tint m = u + 1;\n\t\tint[][] a = new int[n][m];\n\t\tint b[] = new int[m];\n\t\tint c[] = new int[n];\n\t\tint i,r;\n\t\tfor(i = 0; i < n - 1; ++i){\n\t\t\tfor(r = 0; r < m - 1; ++r){\n\t\t\t\ta[i][r] = scan.nextInt();\n\t\t\t\ta[i][m - 1] += a[i][r];\n\t\t\t\ta[n - 1][r]\t+= a[i][r];\n\t\t\t\ta[n - 1][m - 1] += a[i][r];\n\t\t\t}\n\t\t}\n\t\tfor(i = 0; i < n; ++i){\n\t\t\tfor(r = 0; r < m; ++r){\n\t\t\t\tif(r == m - 1){\n\t\t\t\t\tSystem.out.println(a[i][r]);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\tSystem.out.print(a[i][r]+\" \");\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t}",
"main",
"{\n\t\tScanner scan = new Scanner(System.in);\n\t\tint t = scan.nextInt();\n\t\tint u = scan.nextInt();\n\t\tint n = t + 1;\n\t\tint m = u + 1;\n\t\tint[][] a = new int[n][m];\n\t\tint b[] = new int[m];\n\t\tint c[] = new int[n];\n\t\tint i,r;\n\t\tfor(i = 0; i < n - 1; ++i){\n\t\t\tfor(r = 0; r < m - 1; ++r){\n\t\t\t\ta[i][r] = scan.nextInt();\n\t\t\t\ta[i][m - 1] += a[i][r];\n\t\t\t\ta[n - 1][r]\t+= a[i][r];\n\t\t\t\ta[n - 1][m - 1] += a[i][r];\n\t\t\t}\n\t\t}\n\t\tfor(i = 0; i < n; ++i){\n\t\t\tfor(r = 0; r < m; ++r){\n\t\t\t\tif(r == m - 1){\n\t\t\t\t\tSystem.out.println(a[i][r]);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\tSystem.out.print(a[i][r]+\" \");\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t}",
"Scanner scan = new Scanner(System.in);",
"scan",
"new Scanner(System.in)",
"int t = scan.nextInt();",
"t",
"scan.nextInt()",
"scan.nextInt",
"scan",
"int u = scan.nextInt();",
"u",
"scan.nextInt()",
"scan.nextInt",
"scan",
"int n = t + 1;",
"n",
"t + 1",
"t",
"1",
"int m = u + 1;",
"m",
"u + 1",
"u",
"1",
"int[][] a = new int[n][m];",
"a",
"new int[n][m]",
"n",
"m",
"int b[] = new int[m];",
"b",
"new int[m]",
"m",
"int c[] = new int[n];",
"c",
"new int[n]",
"n",
"int i",
"i",
"r;",
"r",
"for(i = 0; i < n - 1; ++i){\n\t\t\tfor(r = 0; r < m - 1; ++r){\n\t\t\t\ta[i][r] = scan.nextInt();\n\t\t\t\ta[i][m - 1] += a[i][r];\n\t\t\t\ta[n - 1][r]\t+= a[i][r];\n\t\t\t\ta[n - 1][m - 1] += a[i][r];\n\t\t\t}\n\t\t}",
"i = 0;",
"i = 0",
"i",
"0",
"i < n - 1",
"i",
"n - 1",
"n",
"1",
"++i",
"++i",
"i",
"{\n\t\t\tfor(r = 0; r < m - 1; ++r){\n\t\t\t\ta[i][r] = scan.nextInt();\n\t\t\t\ta[i][m - 1] += a[i][r];\n\t\t\t\ta[n - 1][r]\t+= a[i][r];\n\t\t\t\ta[n - 1][m - 1] += a[i][r];\n\t\t\t}\n\t\t}",
"{\n\t\t\tfor(r = 0; r < m - 1; ++r){\n\t\t\t\ta[i][r] = scan.nextInt();\n\t\t\t\ta[i][m - 1] += a[i][r];\n\t\t\t\ta[n - 1][r]\t+= a[i][r];\n\t\t\t\ta[n - 1][m - 1] += a[i][r];\n\t\t\t}\n\t\t}",
"for(r = 0; r < m - 1; ++r){\n\t\t\t\ta[i][r] = scan.nextInt();\n\t\t\t\ta[i][m - 1] += a[i][r];\n\t\t\t\ta[n - 1][r]\t+= a[i][r];\n\t\t\t\ta[n - 1][m - 1] += a[i][r];\n\t\t\t}",
"r = 0;",
"r = 0",
"r",
"0",
"r < m - 1",
"r",
"m - 1",
"m",
"1",
"++r",
"++r",
"r",
"{\n\t\t\t\ta[i][r] = scan.nextInt();\n\t\t\t\ta[i][m - 1] += a[i][r];\n\t\t\t\ta[n - 1][r]\t+= a[i][r];\n\t\t\t\ta[n - 1][m - 1] += a[i][r];\n\t\t\t}",
"{\n\t\t\t\ta[i][r] = scan.nextInt();\n\t\t\t\ta[i][m - 1] += a[i][r];\n\t\t\t\ta[n - 1][r]\t+= a[i][r];\n\t\t\t\ta[n - 1][m - 1] += a[i][r];\n\t\t\t}",
"a[i][r] = scan.nextInt()",
"a[i][r]",
"a[i]",
"a",
"i",
"r",
"scan.nextInt()",
"scan.nextInt",
"scan",
"a[i][m - 1] += a[i][r]",
"a[i][m - 1]",
"a[i]",
"a",
"i",
"m - 1",
"m",
"1",
"a[i][r]",
"a[i]",
"a",
"i",
"r",
"a[n - 1][r]\t+= a[i][r]",
"a[n - 1][r]",
"a[n - 1]",
"a",
"n - 1",
"n",
"1",
"r",
"a[i][r]",
"a[i]",
"a",
"i",
"r",
"a[n - 1][m - 1] += a[i][r]",
"a[n - 1][m - 1]",
"a[n - 1]",
"a",
"n - 1",
"n",
"1",
"m - 1",
"m",
"1",
"a[i][r]",
"a[i]",
"a",
"i",
"r",
"for(i = 0; i < n; ++i){\n\t\t\tfor(r = 0; r < m; ++r){\n\t\t\t\tif(r == m - 1){\n\t\t\t\t\tSystem.out.println(a[i][r]);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\tSystem.out.print(a[i][r]+\" \");\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(r = 0; r < m; ++r){\n\t\t\t\tif(r == m - 1){\n\t\t\t\t\tSystem.out.println(a[i][r]);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\tSystem.out.print(a[i][r]+\" \");\n\t\t\t\t\n\t\t\t}\n\t\t}",
"{\n\t\t\tfor(r = 0; r < m; ++r){\n\t\t\t\tif(r == m - 1){\n\t\t\t\t\tSystem.out.println(a[i][r]);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\tSystem.out.print(a[i][r]+\" \");\n\t\t\t\t\n\t\t\t}\n\t\t}",
"for(r = 0; r < m; ++r){\n\t\t\t\tif(r == m - 1){\n\t\t\t\t\tSystem.out.println(a[i][r]);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\tSystem.out.print(a[i][r]+\" \");\n\t\t\t\t\n\t\t\t}",
"r = 0;",
"r = 0",
"r",
"0",
"r < m",
"r",
"m",
"++r",
"++r",
"r",
"{\n\t\t\t\tif(r == m - 1){\n\t\t\t\t\tSystem.out.println(a[i][r]);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\tSystem.out.print(a[i][r]+\" \");\n\t\t\t\t\n\t\t\t}",
"{\n\t\t\t\tif(r == m - 1){\n\t\t\t\t\tSystem.out.println(a[i][r]);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\tSystem.out.print(a[i][r]+\" \");\n\t\t\t\t\n\t\t\t}",
"if(r == m - 1){\n\t\t\t\t\tSystem.out.println(a[i][r]);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\tSystem.out.print(a[i][r]+\" \");",
"r == m - 1",
"r",
"m - 1",
"m",
"1",
"{\n\t\t\t\t\tSystem.out.println(a[i][r]);\n\t\t\t\t}",
"System.out.println(a[i][r])",
"System.out.println",
"System.out",
"System",
"System.out",
"a[i][r]",
"a[i]",
"a",
"i",
"r",
"System.out.print(a[i][r]+\" \")",
"System.out.print",
"System.out",
"System",
"System.out",
"a[i][r]+\" \"",
"a[i][r]",
"a[i]",
"a",
"i",
"r",
"\" \"",
"String[] args",
"args",
"public class Main {\n\tpublic static void main(String[] args){\n\t\tScanner scan = new Scanner(System.in);\n\t\tint t = scan.nextInt();\n\t\tint u = scan.nextInt();\n\t\tint n = t + 1;\n\t\tint m = u + 1;\n\t\tint[][] a = new int[n][m];\n\t\tint b[] = new int[m];\n\t\tint c[] = new int[n];\n\t\tint i,r;\n\t\tfor(i = 0; i < n - 1; ++i){\n\t\t\tfor(r = 0; r < m - 1; ++r){\n\t\t\t\ta[i][r] = scan.nextInt();\n\t\t\t\ta[i][m - 1] += a[i][r];\n\t\t\t\ta[n - 1][r]\t+= a[i][r];\n\t\t\t\ta[n - 1][m - 1] += a[i][r];\n\t\t\t}\n\t\t}\n\t\tfor(i = 0; i < n; ++i){\n\t\t\tfor(r = 0; r < m; ++r){\n\t\t\t\tif(r == m - 1){\n\t\t\t\t\tSystem.out.println(a[i][r]);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\tSystem.out.print(a[i][r]+\" \");\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\t\tScanner scan = new Scanner(System.in);\n\t\tint t = scan.nextInt();\n\t\tint u = scan.nextInt();\n\t\tint n = t + 1;\n\t\tint m = u + 1;\n\t\tint[][] a = new int[n][m];\n\t\tint b[] = new int[m];\n\t\tint c[] = new int[n];\n\t\tint i,r;\n\t\tfor(i = 0; i < n - 1; ++i){\n\t\t\tfor(r = 0; r < m - 1; ++r){\n\t\t\t\ta[i][r] = scan.nextInt();\n\t\t\t\ta[i][m - 1] += a[i][r];\n\t\t\t\ta[n - 1][r]\t+= a[i][r];\n\t\t\t\ta[n - 1][m - 1] += a[i][r];\n\t\t\t}\n\t\t}\n\t\tfor(i = 0; i < n; ++i){\n\t\t\tfor(r = 0; r < m; ++r){\n\t\t\t\tif(r == m - 1){\n\t\t\t\t\tSystem.out.println(a[i][r]);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\tSystem.out.print(a[i][r]+\" \");\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 scan = new Scanner(System.in);
int t = scan.nextInt();
int u = scan.nextInt();
int n = t + 1;
int m = u + 1;
int[][] a = new int[n][m];
int b[] = new int[m];
int c[] = new int[n];
int i,r;
for(i = 0; i < n - 1; ++i){
for(r = 0; r < m - 1; ++r){
a[i][r] = scan.nextInt();
a[i][m - 1] += a[i][r];
a[n - 1][r] += a[i][r];
a[n - 1][m - 1] += a[i][r];
}
}
for(i = 0; i < n; ++i){
for(r = 0; r < m; ++r){
if(r == m - 1){
System.out.println(a[i][r]);
}
else
System.out.print(a[i][r]+" ");
}
}
}
}
|
[
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,
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,
18,
18,
13,
13,
13,
18,
18,
13,
13,
13,
4,
18,
18,
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,
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,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
194,
5
],
[
194,
6
],
[
6,
7
],
[
194,
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
],
[
68,
76
],
[
76,
77
],
[
77,
78
],
[
68,
79
],
[
80,
80
],
[
80,
81
],
[
81,
82
],
[
82,
83
],
[
83,
84
],
[
83,
85
],
[
81,
86
],
[
86,
87
],
[
86,
88
],
[
81,
89
],
[
89,
90
],
[
90,
91
],
[
81,
92
],
[
93,
93
],
[
93,
94
],
[
94,
95
],
[
95,
96
],
[
96,
97
],
[
96,
98
],
[
94,
99
],
[
99,
100
],
[
100,
101
],
[
101,
102
],
[
101,
103
],
[
100,
104
],
[
99,
105
],
[
93,
106
],
[
106,
107
],
[
107,
108
],
[
108,
109
],
[
108,
110
],
[
107,
111
],
[
106,
112
],
[
112,
113
],
[
113,
114
],
[
113,
115
],
[
112,
116
],
[
80,
117
],
[
117,
118
],
[
118,
119
],
[
119,
120
],
[
119,
121
],
[
117,
122
],
[
122,
123
],
[
123,
124
],
[
123,
125
],
[
122,
126
],
[
10,
127
],
[
127,
128
],
[
128,
129
],
[
129,
130
],
[
129,
131
],
[
127,
132
],
[
132,
133
],
[
132,
134
],
[
134,
135
],
[
134,
136
],
[
127,
137
],
[
137,
138
],
[
138,
139
],
[
127,
140
],
[
141,
141
],
[
141,
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
],
[
157,
159
],
[
156,
160
],
[
155,
161
],
[
161,
162
],
[
162,
163
],
[
162,
164
],
[
161,
165
],
[
141,
166
],
[
166,
167
],
[
167,
168
],
[
168,
169
],
[
168,
170
],
[
166,
171
],
[
171,
172
],
[
172,
173
],
[
172,
174
],
[
171,
175
],
[
141,
176
],
[
176,
177
],
[
177,
178
],
[
177,
179
],
[
176,
180
],
[
180,
181
],
[
181,
182
],
[
182,
183
],
[
182,
184
],
[
180,
185
],
[
10,
186
],
[
186,
187
],
[
187,
188
],
[
188,
189
],
[
188,
190
],
[
8,
191
],
[
191,
192
],
[
0,
193
],
[
193,
194
],
[
193,
195
]
] | [
"import java.util.Scanner;\n\npublic class Main {\n\n\tprivate static Scanner sc;\n\n\tpublic static void main(String[] args){\n\t\tsc = new Scanner(System.in);\n\t\tint r=sc.nextInt();\n\t\tint c=sc.nextInt();\n\t\tint m[][]=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\tm[i][j]=sc.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\tSystem.out.print(m[i][j]+\" \");\n\t\t\t\tm[i][c]+=m[i][j];\n\t\t\t}\n\t\t\tSystem.out.println(m[i][c]);\n\t\t}\n\t\tfor(int j=0;j<c+1;j++){\n\t\t\tfor(int i=0;i<r;i++){\n\t\t\t\tm[r][j]+=m[i][j];\n\t\t\t}\n\t\t\tSystem.out.print(m[r][j]);\n\t\t\tif(j!=c)System.out.print(\" \");\n\t\t}\n\t\tSystem.out.println();\n\t}\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n\n\tprivate static Scanner sc;\n\n\tpublic static void main(String[] args){\n\t\tsc = new Scanner(System.in);\n\t\tint r=sc.nextInt();\n\t\tint c=sc.nextInt();\n\t\tint m[][]=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\tm[i][j]=sc.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\tSystem.out.print(m[i][j]+\" \");\n\t\t\t\tm[i][c]+=m[i][j];\n\t\t\t}\n\t\t\tSystem.out.println(m[i][c]);\n\t\t}\n\t\tfor(int j=0;j<c+1;j++){\n\t\t\tfor(int i=0;i<r;i++){\n\t\t\t\tm[r][j]+=m[i][j];\n\t\t\t}\n\t\t\tSystem.out.print(m[r][j]);\n\t\t\tif(j!=c)System.out.print(\" \");\n\t\t}\n\t\tSystem.out.println();\n\t}\n}",
"Main",
"private static Scanner sc;",
"sc",
"public static void main(String[] args){\n\t\tsc = new Scanner(System.in);\n\t\tint r=sc.nextInt();\n\t\tint c=sc.nextInt();\n\t\tint m[][]=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\tm[i][j]=sc.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\tSystem.out.print(m[i][j]+\" \");\n\t\t\t\tm[i][c]+=m[i][j];\n\t\t\t}\n\t\t\tSystem.out.println(m[i][c]);\n\t\t}\n\t\tfor(int j=0;j<c+1;j++){\n\t\t\tfor(int i=0;i<r;i++){\n\t\t\t\tm[r][j]+=m[i][j];\n\t\t\t}\n\t\t\tSystem.out.print(m[r][j]);\n\t\t\tif(j!=c)System.out.print(\" \");\n\t\t}\n\t\tSystem.out.println();\n\t}",
"main",
"{\n\t\tsc = new Scanner(System.in);\n\t\tint r=sc.nextInt();\n\t\tint c=sc.nextInt();\n\t\tint m[][]=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\tm[i][j]=sc.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\tSystem.out.print(m[i][j]+\" \");\n\t\t\t\tm[i][c]+=m[i][j];\n\t\t\t}\n\t\t\tSystem.out.println(m[i][c]);\n\t\t}\n\t\tfor(int j=0;j<c+1;j++){\n\t\t\tfor(int i=0;i<r;i++){\n\t\t\t\tm[r][j]+=m[i][j];\n\t\t\t}\n\t\t\tSystem.out.print(m[r][j]);\n\t\t\tif(j!=c)System.out.print(\" \");\n\t\t}\n\t\tSystem.out.println();\n\t}",
"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 m[][]=new int[r+1][c+1];",
"m",
"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\tm[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\tm[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\tm[i][j]=sc.nextInt();\n\t\t\t}\n\t\t}",
"for(int j=0;j<c;j++){\n\t\t\t\tm[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\tm[i][j]=sc.nextInt();\n\t\t\t}",
"{\n\t\t\t\tm[i][j]=sc.nextInt();\n\t\t\t}",
"m[i][j]=sc.nextInt()",
"m[i][j]",
"m[i]",
"m",
"i",
"j",
"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\tSystem.out.print(m[i][j]+\" \");\n\t\t\t\tm[i][c]+=m[i][j];\n\t\t\t}\n\t\t\tSystem.out.println(m[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\tSystem.out.print(m[i][j]+\" \");\n\t\t\t\tm[i][c]+=m[i][j];\n\t\t\t}\n\t\t\tSystem.out.println(m[i][c]);\n\t\t}",
"{\n\t\t\tfor(int j=0;j<c;j++){\n\t\t\t\tSystem.out.print(m[i][j]+\" \");\n\t\t\t\tm[i][c]+=m[i][j];\n\t\t\t}\n\t\t\tSystem.out.println(m[i][c]);\n\t\t}",
"for(int j=0;j<c;j++){\n\t\t\t\tSystem.out.print(m[i][j]+\" \");\n\t\t\t\tm[i][c]+=m[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(m[i][j]+\" \");\n\t\t\t\tm[i][c]+=m[i][j];\n\t\t\t}",
"{\n\t\t\t\tSystem.out.print(m[i][j]+\" \");\n\t\t\t\tm[i][c]+=m[i][j];\n\t\t\t}",
"System.out.print(m[i][j]+\" \")",
"System.out.print",
"System.out",
"System",
"System.out",
"m[i][j]+\" \"",
"m[i][j]",
"m[i]",
"m",
"i",
"j",
"\" \"",
"m[i][c]+=m[i][j]",
"m[i][c]",
"m[i]",
"m",
"i",
"c",
"m[i][j]",
"m[i]",
"m",
"i",
"j",
"System.out.println(m[i][c])",
"System.out.println",
"System.out",
"System",
"System.out",
"m[i][c]",
"m[i]",
"m",
"i",
"c",
"for(int j=0;j<c+1;j++){\n\t\t\tfor(int i=0;i<r;i++){\n\t\t\t\tm[r][j]+=m[i][j];\n\t\t\t}\n\t\t\tSystem.out.print(m[r][j]);\n\t\t\tif(j!=c)System.out.print(\" \");\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\tfor(int i=0;i<r;i++){\n\t\t\t\tm[r][j]+=m[i][j];\n\t\t\t}\n\t\t\tSystem.out.print(m[r][j]);\n\t\t\tif(j!=c)System.out.print(\" \");\n\t\t}",
"{\n\t\t\tfor(int i=0;i<r;i++){\n\t\t\t\tm[r][j]+=m[i][j];\n\t\t\t}\n\t\t\tSystem.out.print(m[r][j]);\n\t\t\tif(j!=c)System.out.print(\" \");\n\t\t}",
"for(int i=0;i<r;i++){\n\t\t\t\tm[r][j]+=m[i][j];\n\t\t\t}",
"int i=0;",
"int i=0;",
"i",
"0",
"i<r",
"i",
"r",
"i++",
"i++",
"i",
"{\n\t\t\t\tm[r][j]+=m[i][j];\n\t\t\t}",
"{\n\t\t\t\tm[r][j]+=m[i][j];\n\t\t\t}",
"m[r][j]+=m[i][j]",
"m[r][j]",
"m[r]",
"m",
"r",
"j",
"m[i][j]",
"m[i]",
"m",
"i",
"j",
"System.out.print(m[r][j])",
"System.out.print",
"System.out",
"System",
"System.out",
"m[r][j]",
"m[r]",
"m",
"r",
"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",
"public class Main {\n\n\tprivate static Scanner sc;\n\n\tpublic static void main(String[] args){\n\t\tsc = new Scanner(System.in);\n\t\tint r=sc.nextInt();\n\t\tint c=sc.nextInt();\n\t\tint m[][]=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\tm[i][j]=sc.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\tSystem.out.print(m[i][j]+\" \");\n\t\t\t\tm[i][c]+=m[i][j];\n\t\t\t}\n\t\t\tSystem.out.println(m[i][c]);\n\t\t}\n\t\tfor(int j=0;j<c+1;j++){\n\t\t\tfor(int i=0;i<r;i++){\n\t\t\t\tm[r][j]+=m[i][j];\n\t\t\t}\n\t\t\tSystem.out.print(m[r][j]);\n\t\t\tif(j!=c)System.out.print(\" \");\n\t\t}\n\t\tSystem.out.println();\n\t}\n}",
"public class Main {\n\n\tprivate static Scanner sc;\n\n\tpublic static void main(String[] args){\n\t\tsc = new Scanner(System.in);\n\t\tint r=sc.nextInt();\n\t\tint c=sc.nextInt();\n\t\tint m[][]=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\tm[i][j]=sc.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\tSystem.out.print(m[i][j]+\" \");\n\t\t\t\tm[i][c]+=m[i][j];\n\t\t\t}\n\t\t\tSystem.out.println(m[i][c]);\n\t\t}\n\t\tfor(int j=0;j<c+1;j++){\n\t\t\tfor(int i=0;i<r;i++){\n\t\t\t\tm[r][j]+=m[i][j];\n\t\t\t}\n\t\t\tSystem.out.print(m[r][j]);\n\t\t\tif(j!=c)System.out.print(\" \");\n\t\t}\n\t\tSystem.out.println();\n\t}\n}",
"Main"
] | import java.util.Scanner;
public class Main {
private static Scanner sc;
public static void main(String[] args){
sc = new Scanner(System.in);
int r=sc.nextInt();
int c=sc.nextInt();
int m[][]=new int[r+1][c+1];
for(int i=0;i<r;i++){
for(int j=0;j<c;j++){
m[i][j]=sc.nextInt();
}
}
for(int i=0;i<r;i++){
for(int j=0;j<c;j++){
System.out.print(m[i][j]+" ");
m[i][c]+=m[i][j];
}
System.out.println(m[i][c]);
}
for(int j=0;j<c+1;j++){
for(int i=0;i<r;i++){
m[r][j]+=m[i][j];
}
System.out.print(m[r][j]);
if(j!=c)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,
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,
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,
0,
13,
18,
18,
13,
13,
13,
14,
2,
13,
13,
30,
0,
18,
18,
13,
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,
0,
18,
18,
13,
13,
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,
4,
18,
18,
13,
13,
4,
18,
13,
17,
18,
18,
13,
13,
13,
8,
2,
13,
13,
17,
17,
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
],
[
216,
11
],
[
216,
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
],
[
76,
78
],
[
79,
80
],
[
79,
81
],
[
14,
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
],
[
94,
98
],
[
98,
99
],
[
99,
100
],
[
100,
101
],
[
100,
102
],
[
98,
103
],
[
103,
104
],
[
103,
105
],
[
98,
106
],
[
106,
107
],
[
107,
108
],
[
98,
109
],
[
110,
110
],
[
110,
111
],
[
111,
112
],
[
111,
113
],
[
113,
114
],
[
114,
115
],
[
114,
116
],
[
113,
117
],
[
110,
118
],
[
118,
119
],
[
119,
120
],
[
119,
121
],
[
118,
122
],
[
122,
123
],
[
123,
124
],
[
124,
125
],
[
125,
126
],
[
125,
127
],
[
124,
128
],
[
123,
129
],
[
110,
130
],
[
130,
131
],
[
131,
132
],
[
131,
133
],
[
130,
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
],
[
139,
147
],
[
147,
148
],
[
148,
149
],
[
139,
150
],
[
151,
151
],
[
151,
152
],
[
152,
153
],
[
153,
154
],
[
154,
155
],
[
154,
156
],
[
153,
157
],
[
152,
158
],
[
158,
159
],
[
158,
160
],
[
14,
161
],
[
161,
162
],
[
162,
163
],
[
163,
164
],
[
163,
165
],
[
161,
166
],
[
166,
167
],
[
166,
168
],
[
161,
169
],
[
169,
170
],
[
170,
171
],
[
161,
172
],
[
173,
173
],
[
173,
174
],
[
174,
175
],
[
175,
176
],
[
176,
177
],
[
176,
178
],
[
174,
179
],
[
179,
180
],
[
179,
181
],
[
174,
182
],
[
182,
183
],
[
183,
184
],
[
174,
185
],
[
186,
186
],
[
186,
187
],
[
187,
188
],
[
188,
189
],
[
189,
190
],
[
189,
191
],
[
187,
192
],
[
192,
193
],
[
193,
194
],
[
192,
195
],
[
192,
196
],
[
196,
197
],
[
197,
198
],
[
197,
199
],
[
196,
200
],
[
192,
201
],
[
201,
202
],
[
202,
203
],
[
202,
204
],
[
201,
205
],
[
201,
206
],
[
173,
207
],
[
207,
208
],
[
208,
209
],
[
209,
210
],
[
209,
211
],
[
207,
212
],
[
12,
213
],
[
213,
214
],
[
0,
215
],
[
215,
216
],
[
215,
217
]
] | [
"import java.util.ArrayList;\nimport java.util.List;\nimport 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, c;\n\t\tr = in.nextInt();\n\t\tc = in.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] = in.nextInt();\n\t\t\t}\n\t\t}\n\t\tint[] colSum = new int[c+1];\n\t\tfor(int i=0;i<r;i++) {\n\t\t\tint rowSum = 0;\n\t\t\tfor(int j=0;j<=c;j++) {\n\t\t\t\trowSum += table[i][j];\n\t\t\t\tif(j == c) {\n\t\t\t\t\ttable[i][j] = rowSum;\n\t\t\t\t}\n\t\t\t\tcolSum[j] += table[i][j];\n\t\t\t}\n\t\t}\n\t\tfor(int i=0;i<=c;i++) {\n\t\t\ttable[r][i] = colSum[i];\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\tSystem.out.print(String.format(\"%d%s\", table[i][j], (j == c) ? \"\": \" \"));\n\t\t\t}\n\t\t\tSystem.out.println(\"\");\n\t\t}\n\t}\n}",
"import java.util.ArrayList;",
"ArrayList",
"java.util",
"import java.util.List;",
"List",
"java.util",
"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, c;\n\t\tr = in.nextInt();\n\t\tc = in.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] = in.nextInt();\n\t\t\t}\n\t\t}\n\t\tint[] colSum = new int[c+1];\n\t\tfor(int i=0;i<r;i++) {\n\t\t\tint rowSum = 0;\n\t\t\tfor(int j=0;j<=c;j++) {\n\t\t\t\trowSum += table[i][j];\n\t\t\t\tif(j == c) {\n\t\t\t\t\ttable[i][j] = rowSum;\n\t\t\t\t}\n\t\t\t\tcolSum[j] += table[i][j];\n\t\t\t}\n\t\t}\n\t\tfor(int i=0;i<=c;i++) {\n\t\t\ttable[r][i] = colSum[i];\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\tSystem.out.print(String.format(\"%d%s\", table[i][j], (j == c) ? \"\": \" \"));\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\tScanner in = new Scanner(System.in);\n\t\tint r, c;\n\t\tr = in.nextInt();\n\t\tc = in.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] = in.nextInt();\n\t\t\t}\n\t\t}\n\t\tint[] colSum = new int[c+1];\n\t\tfor(int i=0;i<r;i++) {\n\t\t\tint rowSum = 0;\n\t\t\tfor(int j=0;j<=c;j++) {\n\t\t\t\trowSum += table[i][j];\n\t\t\t\tif(j == c) {\n\t\t\t\t\ttable[i][j] = rowSum;\n\t\t\t\t}\n\t\t\t\tcolSum[j] += table[i][j];\n\t\t\t}\n\t\t}\n\t\tfor(int i=0;i<=c;i++) {\n\t\t\ttable[r][i] = colSum[i];\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\tSystem.out.print(String.format(\"%d%s\", table[i][j], (j == c) ? \"\": \" \"));\n\t\t\t}\n\t\t\tSystem.out.println(\"\");\n\t\t}\n\t}",
"main",
"{\n\t\tScanner in = new Scanner(System.in);\n\t\tint r, c;\n\t\tr = in.nextInt();\n\t\tc = in.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] = in.nextInt();\n\t\t\t}\n\t\t}\n\t\tint[] colSum = new int[c+1];\n\t\tfor(int i=0;i<r;i++) {\n\t\t\tint rowSum = 0;\n\t\t\tfor(int j=0;j<=c;j++) {\n\t\t\t\trowSum += table[i][j];\n\t\t\t\tif(j == c) {\n\t\t\t\t\ttable[i][j] = rowSum;\n\t\t\t\t}\n\t\t\t\tcolSum[j] += table[i][j];\n\t\t\t}\n\t\t}\n\t\tfor(int i=0;i<=c;i++) {\n\t\t\ttable[r][i] = colSum[i];\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\tSystem.out.print(String.format(\"%d%s\", table[i][j], (j == c) ? \"\": \" \"));\n\t\t\t}\n\t\t\tSystem.out.println(\"\");\n\t\t}\n\t}",
"Scanner in = new Scanner(System.in);",
"in",
"new Scanner(System.in)",
"int r",
"r",
"c;",
"c",
"r = in.nextInt()",
"r",
"in.nextInt()",
"in.nextInt",
"in",
"c = in.nextInt()",
"c",
"in.nextInt()",
"in.nextInt",
"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] = 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\ttable[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\ttable[i][j] = in.nextInt();\n\t\t\t}\n\t\t}",
"for(int j=0;j<c;j++) {\n\t\t\t\ttable[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\ttable[i][j] = in.nextInt();\n\t\t\t}",
"{\n\t\t\t\ttable[i][j] = in.nextInt();\n\t\t\t}",
"table[i][j] = in.nextInt()",
"table[i][j]",
"table[i]",
"table",
"i",
"j",
"in.nextInt()",
"in.nextInt",
"in",
"int[] colSum = new int[c+1];",
"colSum",
"new int[c+1]",
"c+1",
"c",
"1",
"for(int i=0;i<r;i++) {\n\t\t\tint rowSum = 0;\n\t\t\tfor(int j=0;j<=c;j++) {\n\t\t\t\trowSum += table[i][j];\n\t\t\t\tif(j == c) {\n\t\t\t\t\ttable[i][j] = rowSum;\n\t\t\t\t}\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<r",
"i",
"r",
"i++",
"i++",
"i",
"{\n\t\t\tint rowSum = 0;\n\t\t\tfor(int j=0;j<=c;j++) {\n\t\t\t\trowSum += table[i][j];\n\t\t\t\tif(j == c) {\n\t\t\t\t\ttable[i][j] = rowSum;\n\t\t\t\t}\n\t\t\t\tcolSum[j] += table[i][j];\n\t\t\t}\n\t\t}",
"{\n\t\t\tint rowSum = 0;\n\t\t\tfor(int j=0;j<=c;j++) {\n\t\t\t\trowSum += table[i][j];\n\t\t\t\tif(j == c) {\n\t\t\t\t\ttable[i][j] = rowSum;\n\t\t\t\t}\n\t\t\t\tcolSum[j] += table[i][j];\n\t\t\t}\n\t\t}",
"int rowSum = 0;",
"rowSum",
"0",
"for(int j=0;j<=c;j++) {\n\t\t\t\trowSum += table[i][j];\n\t\t\t\tif(j == c) {\n\t\t\t\t\ttable[i][j] = rowSum;\n\t\t\t\t}\n\t\t\t\tcolSum[j] += 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\trowSum += table[i][j];\n\t\t\t\tif(j == c) {\n\t\t\t\t\ttable[i][j] = rowSum;\n\t\t\t\t}\n\t\t\t\tcolSum[j] += table[i][j];\n\t\t\t}",
"{\n\t\t\t\trowSum += table[i][j];\n\t\t\t\tif(j == c) {\n\t\t\t\t\ttable[i][j] = rowSum;\n\t\t\t\t}\n\t\t\t\tcolSum[j] += table[i][j];\n\t\t\t}",
"rowSum += table[i][j]",
"rowSum",
"table[i][j]",
"table[i]",
"table",
"i",
"j",
"if(j == c) {\n\t\t\t\t\ttable[i][j] = rowSum;\n\t\t\t\t}",
"j == c",
"j",
"c",
"{\n\t\t\t\t\ttable[i][j] = rowSum;\n\t\t\t\t}",
"table[i][j] = rowSum",
"table[i][j]",
"table[i]",
"table",
"i",
"j",
"rowSum",
"colSum[j] += table[i][j]",
"colSum[j]",
"colSum",
"j",
"table[i][j]",
"table[i]",
"table",
"i",
"j",
"for(int i=0;i<=c;i++) {\n\t\t\ttable[r][i] = colSum[i];\n\t\t}",
"int i=0;",
"int i=0;",
"i",
"0",
"i<=c",
"i",
"c",
"i++",
"i++",
"i",
"{\n\t\t\ttable[r][i] = colSum[i];\n\t\t}",
"{\n\t\t\ttable[r][i] = colSum[i];\n\t\t}",
"table[r][i] = colSum[i]",
"table[r][i]",
"table[r]",
"table",
"r",
"i",
"colSum[i]",
"colSum",
"i",
"for(int i=0;i<=r;i++) {\n\t\t\tfor(int j=0;j<=c;j++) {\n\t\t\t\tSystem.out.print(String.format(\"%d%s\", table[i][j], (j == c) ? \"\": \" \"));\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\tSystem.out.print(String.format(\"%d%s\", table[i][j], (j == c) ? \"\": \" \"));\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\tSystem.out.print(String.format(\"%d%s\", table[i][j], (j == c) ? \"\": \" \"));\n\t\t\t}\n\t\t\tSystem.out.println(\"\");\n\t\t}",
"for(int j=0;j<=c;j++) {\n\t\t\t\tSystem.out.print(String.format(\"%d%s\", table[i][j], (j == c) ? \"\": \" \"));\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(String.format(\"%d%s\", table[i][j], (j == c) ? \"\": \" \"));\n\t\t\t}",
"{\n\t\t\t\tSystem.out.print(String.format(\"%d%s\", table[i][j], (j == c) ? \"\": \" \"));\n\t\t\t}",
"System.out.print(String.format(\"%d%s\", table[i][j], (j == c) ? \"\": \" \"))",
"System.out.print",
"System.out",
"System",
"System.out",
"String.format(\"%d%s\", table[i][j], (j == c) ? \"\": \" \")",
"String.format",
"String",
"\"%d%s\"",
"table[i][j]",
"table[i]",
"table",
"i",
"j",
"(j == c) ? \"\": \" \"",
"(j == c)",
"j",
"c",
"\"\"",
"\" \"",
"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 in = new Scanner(System.in);\n\t\tint r, c;\n\t\tr = in.nextInt();\n\t\tc = in.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] = in.nextInt();\n\t\t\t}\n\t\t}\n\t\tint[] colSum = new int[c+1];\n\t\tfor(int i=0;i<r;i++) {\n\t\t\tint rowSum = 0;\n\t\t\tfor(int j=0;j<=c;j++) {\n\t\t\t\trowSum += table[i][j];\n\t\t\t\tif(j == c) {\n\t\t\t\t\ttable[i][j] = rowSum;\n\t\t\t\t}\n\t\t\t\tcolSum[j] += table[i][j];\n\t\t\t}\n\t\t}\n\t\tfor(int i=0;i<=c;i++) {\n\t\t\ttable[r][i] = colSum[i];\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\tSystem.out.print(String.format(\"%d%s\", table[i][j], (j == c) ? \"\": \" \"));\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\tScanner in = new Scanner(System.in);\n\t\tint r, c;\n\t\tr = in.nextInt();\n\t\tc = in.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] = in.nextInt();\n\t\t\t}\n\t\t}\n\t\tint[] colSum = new int[c+1];\n\t\tfor(int i=0;i<r;i++) {\n\t\t\tint rowSum = 0;\n\t\t\tfor(int j=0;j<=c;j++) {\n\t\t\t\trowSum += table[i][j];\n\t\t\t\tif(j == c) {\n\t\t\t\t\ttable[i][j] = rowSum;\n\t\t\t\t}\n\t\t\t\tcolSum[j] += table[i][j];\n\t\t\t}\n\t\t}\n\t\tfor(int i=0;i<=c;i++) {\n\t\t\ttable[r][i] = colSum[i];\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\tSystem.out.print(String.format(\"%d%s\", table[i][j], (j == c) ? \"\": \" \"));\n\t\t\t}\n\t\t\tSystem.out.println(\"\");\n\t\t}\n\t}\n}",
"Main"
] | import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
int r, c;
r = in.nextInt();
c = in.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] = in.nextInt();
}
}
int[] colSum = new int[c+1];
for(int i=0;i<r;i++) {
int rowSum = 0;
for(int j=0;j<=c;j++) {
rowSum += table[i][j];
if(j == c) {
table[i][j] = rowSum;
}
colSum[j] += table[i][j];
}
}
for(int i=0;i<=c;i++) {
table[r][i] = colSum[i];
}
for(int i=0;i<=r;i++) {
for(int j=0;j<=c;j++) {
System.out.print(String.format("%d%s", table[i][j], (j == c) ? "": " "));
}
System.out.println("");
}
}
} |
[
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,
18,
13,
13,
4,
13,
4,
18,
4,
18,
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,
14,
2,
13,
13,
30,
9,
14,
2,
13,
13,
30,
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,
28,
13,
13,
30,
30,
41,
13,
17,
28,
13,
13,
30,
30,
4,
18,
18,
13,
13,
13,
14,
2,
13,
13,
30,
4,
18,
18,
13,
13,
17,
40,
13,
4,
18,
18,
13,
13,
17,
23,
13,
12,
13,
30,
41,
13,
18,
13,
13,
41,
13,
20,
2,
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,
29,
13,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
226,
8
],
[
226,
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
],
[
62,
63
],
[
62,
64
],
[
61,
65
],
[
65,
66
],
[
65,
67
],
[
67,
68
],
[
68,
69
],
[
69,
70
],
[
70,
71
],
[
67,
72
],
[
11,
73
],
[
73,
74
],
[
74,
75
],
[
75,
76
],
[
75,
77
],
[
73,
78
],
[
78,
79
],
[
78,
80
],
[
73,
81
],
[
81,
82
],
[
82,
83
],
[
73,
84
],
[
85,
85
],
[
85,
86
],
[
86,
87
],
[
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
],
[
100,
102
],
[
99,
103
],
[
103,
104
],
[
98,
105
],
[
105,
106
],
[
106,
107
],
[
106,
108
],
[
105,
109
],
[
109,
110
],
[
110,
111
],
[
111,
112
],
[
112,
113
],
[
112,
114
],
[
111,
115
],
[
110,
116
],
[
116,
117
],
[
117,
118
],
[
118,
119
],
[
118,
120
],
[
117,
121
],
[
116,
122
],
[
122,
123
],
[
123,
124
],
[
123,
125
],
[
122,
126
],
[
98,
127
],
[
127,
128
],
[
128,
129
],
[
129,
130
],
[
129,
131
],
[
128,
132
],
[
127,
133
],
[
133,
134
],
[
134,
135
],
[
135,
136
],
[
135,
137
],
[
134,
138
],
[
133,
139
],
[
139,
140
],
[
140,
141
],
[
140,
142
],
[
139,
143
],
[
11,
144
],
[
144,
145
],
[
144,
146
],
[
144,
147
],
[
148,
148
],
[
148,
149
],
[
149,
150
],
[
149,
151
],
[
148,
152
],
[
152,
153
],
[
152,
154
],
[
152,
155
],
[
156,
156
],
[
156,
157
],
[
157,
158
],
[
158,
159
],
[
159,
160
],
[
159,
161
],
[
157,
162
],
[
156,
163
],
[
163,
164
],
[
164,
165
],
[
164,
166
],
[
163,
167
],
[
167,
168
],
[
168,
169
],
[
169,
170
],
[
170,
171
],
[
170,
172
],
[
168,
173
],
[
156,
174
],
[
174,
175
],
[
148,
176
],
[
176,
177
],
[
177,
178
],
[
178,
179
],
[
178,
180
],
[
176,
181
],
[
9,
182
],
[
182,
183
],
[
226,
184
],
[
184,
185
],
[
184,
186
],
[
186,
187
],
[
187,
188
],
[
187,
189
],
[
189,
190
],
[
189,
191
],
[
186,
192
],
[
192,
193
],
[
192,
194
],
[
195,
196
],
[
195,
197
],
[
186,
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
],
[
212,
214
],
[
211,
215
],
[
215,
216
],
[
216,
217
],
[
215,
218
],
[
218,
219
],
[
218,
220
],
[
186,
221
],
[
221,
222
],
[
184,
223
],
[
223,
224
],
[
0,
225
],
[
225,
226
],
[
225,
227
]
] | [
"import java.io.BufferedReader;\nimport java.io.InputStreamReader;\n\npublic class Main {\n \n public static void main(String[] args) throws Exception {\n \tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n \tString[] rc = br.readLine().split(\" \");\n \tint r = Integer.parseInt(rc[0]);\n \tint c = Integer.parseInt(rc[1]);\n \tint[][] table = new int[r + 1][c + 1];\n \tfor (int i = 0; i < r; i++) {\n \t\ttable[i] = convertInt(br.readLine().split(\" \"));\n \t}\n \tfor (int i = 0; i <= r; i++) {\n \t\tfor (int j = 0; j <= c; j++) {\n \t\t\tif (j == c) {\n \t\t\t\tcontinue;\n \t\t\t}\n \t\t\tif (i != r) {\n \t\t\t\ttable[r][j] = table[r][j] + table[i][j];\n \t\t\t}\n \t\t\ttable[i][c] = table[i][c] + table[i][j];\n \t\t}\n \t}\n \tfor (int[] row : table) {\n \t\tint cnt = 0;\n \t\tfor (int n : row) {\n \t\t\tSystem.out.print(n);\n \t\t\tif (cnt != c) {\n \t\t\t\tSystem.out.print(\" \");\n \t\t\t}\n \t\t\tcnt++;\n \t\t}\n \t\tSystem.out.println(\"\");\n \t}\n\n }\n\n private static int[] convertInt(String[] str) {\n \tint len = str.length;\n \tint[] iArray = new int[len + 1];\n \tfor (int i = 0; i < len; i++) {\n \t\tiArray[i] = Integer.parseInt(str[i]);\n \t}\n \treturn iArray;\n }\n}",
"import java.io.BufferedReader;",
"BufferedReader",
"java.io",
"import java.io.InputStreamReader;",
"InputStreamReader",
"java.io",
"public class Main {\n \n public static void main(String[] args) throws Exception {\n \tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n \tString[] rc = br.readLine().split(\" \");\n \tint r = Integer.parseInt(rc[0]);\n \tint c = Integer.parseInt(rc[1]);\n \tint[][] table = new int[r + 1][c + 1];\n \tfor (int i = 0; i < r; i++) {\n \t\ttable[i] = convertInt(br.readLine().split(\" \"));\n \t}\n \tfor (int i = 0; i <= r; i++) {\n \t\tfor (int j = 0; j <= c; j++) {\n \t\t\tif (j == c) {\n \t\t\t\tcontinue;\n \t\t\t}\n \t\t\tif (i != r) {\n \t\t\t\ttable[r][j] = table[r][j] + table[i][j];\n \t\t\t}\n \t\t\ttable[i][c] = table[i][c] + table[i][j];\n \t\t}\n \t}\n \tfor (int[] row : table) {\n \t\tint cnt = 0;\n \t\tfor (int n : row) {\n \t\t\tSystem.out.print(n);\n \t\t\tif (cnt != c) {\n \t\t\t\tSystem.out.print(\" \");\n \t\t\t}\n \t\t\tcnt++;\n \t\t}\n \t\tSystem.out.println(\"\");\n \t}\n\n }\n\n private static int[] convertInt(String[] str) {\n \tint len = str.length;\n \tint[] iArray = new int[len + 1];\n \tfor (int i = 0; i < len; i++) {\n \t\tiArray[i] = Integer.parseInt(str[i]);\n \t}\n \treturn iArray;\n }\n}",
"Main",
"public static void main(String[] args) throws Exception {\n \tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n \tString[] rc = br.readLine().split(\" \");\n \tint r = Integer.parseInt(rc[0]);\n \tint c = Integer.parseInt(rc[1]);\n \tint[][] table = new int[r + 1][c + 1];\n \tfor (int i = 0; i < r; i++) {\n \t\ttable[i] = convertInt(br.readLine().split(\" \"));\n \t}\n \tfor (int i = 0; i <= r; i++) {\n \t\tfor (int j = 0; j <= c; j++) {\n \t\t\tif (j == c) {\n \t\t\t\tcontinue;\n \t\t\t}\n \t\t\tif (i != r) {\n \t\t\t\ttable[r][j] = table[r][j] + table[i][j];\n \t\t\t}\n \t\t\ttable[i][c] = table[i][c] + table[i][j];\n \t\t}\n \t}\n \tfor (int[] row : table) {\n \t\tint cnt = 0;\n \t\tfor (int n : row) {\n \t\t\tSystem.out.print(n);\n \t\t\tif (cnt != c) {\n \t\t\t\tSystem.out.print(\" \");\n \t\t\t}\n \t\t\tcnt++;\n \t\t}\n \t\tSystem.out.println(\"\");\n \t}\n\n }",
"main",
"{\n \tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n \tString[] rc = br.readLine().split(\" \");\n \tint r = Integer.parseInt(rc[0]);\n \tint c = Integer.parseInt(rc[1]);\n \tint[][] table = new int[r + 1][c + 1];\n \tfor (int i = 0; i < r; i++) {\n \t\ttable[i] = convertInt(br.readLine().split(\" \"));\n \t}\n \tfor (int i = 0; i <= r; i++) {\n \t\tfor (int j = 0; j <= c; j++) {\n \t\t\tif (j == c) {\n \t\t\t\tcontinue;\n \t\t\t}\n \t\t\tif (i != r) {\n \t\t\t\ttable[r][j] = table[r][j] + table[i][j];\n \t\t\t}\n \t\t\ttable[i][c] = table[i][c] + table[i][j];\n \t\t}\n \t}\n \tfor (int[] row : table) {\n \t\tint cnt = 0;\n \t\tfor (int n : row) {\n \t\t\tSystem.out.print(n);\n \t\t\tif (cnt != c) {\n \t\t\t\tSystem.out.print(\" \");\n \t\t\t}\n \t\t\tcnt++;\n \t\t}\n \t\tSystem.out.println(\"\");\n \t}\n\n }",
"BufferedReader br = new BufferedReader(new InputStreamReader(System.in));",
"br",
"new BufferedReader(new InputStreamReader(System.in))",
"String[] rc = br.readLine().split(\" \");",
"rc",
"br.readLine().split(\" \")",
"br.readLine().split",
"br.readLine()",
"br.readLine",
"br",
"\" \"",
"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[][] 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\ttable[i] = convertInt(br.readLine().split(\" \"));\n \t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < r",
"i",
"r",
"i++",
"i++",
"i",
"{\n \t\ttable[i] = convertInt(br.readLine().split(\" \"));\n \t}",
"{\n \t\ttable[i] = convertInt(br.readLine().split(\" \"));\n \t}",
"table[i] = convertInt(br.readLine().split(\" \"))",
"table[i]",
"table",
"i",
"convertInt(br.readLine().split(\" \"))",
"convertInt",
"br.readLine().split(\" \")",
"br.readLine().split",
"br.readLine()",
"br.readLine",
"br",
"\" \"",
"for (int i = 0; i <= r; i++) {\n \t\tfor (int j = 0; j <= c; j++) {\n \t\t\tif (j == c) {\n \t\t\t\tcontinue;\n \t\t\t}\n \t\t\tif (i != r) {\n \t\t\t\ttable[r][j] = table[r][j] + table[i][j];\n \t\t\t}\n \t\t\ttable[i][c] = table[i][c] + table[i][j];\n \t\t}\n \t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i <= r",
"i",
"r",
"i++",
"i++",
"i",
"{\n \t\tfor (int j = 0; j <= c; j++) {\n \t\t\tif (j == c) {\n \t\t\t\tcontinue;\n \t\t\t}\n \t\t\tif (i != r) {\n \t\t\t\ttable[r][j] = table[r][j] + table[i][j];\n \t\t\t}\n \t\t\ttable[i][c] = table[i][c] + table[i][j];\n \t\t}\n \t}",
"{\n \t\tfor (int j = 0; j <= c; j++) {\n \t\t\tif (j == c) {\n \t\t\t\tcontinue;\n \t\t\t}\n \t\t\tif (i != r) {\n \t\t\t\ttable[r][j] = table[r][j] + table[i][j];\n \t\t\t}\n \t\t\ttable[i][c] = table[i][c] + table[i][j];\n \t\t}\n \t}",
"for (int j = 0; j <= c; j++) {\n \t\t\tif (j == c) {\n \t\t\t\tcontinue;\n \t\t\t}\n \t\t\tif (i != r) {\n \t\t\t\ttable[r][j] = table[r][j] + table[i][j];\n \t\t\t}\n \t\t\ttable[i][c] = table[i][c] + table[i][j];\n \t\t}",
"int j = 0;",
"int j = 0;",
"j",
"0",
"j <= c",
"j",
"c",
"j++",
"j++",
"j",
"{\n \t\t\tif (j == c) {\n \t\t\t\tcontinue;\n \t\t\t}\n \t\t\tif (i != r) {\n \t\t\t\ttable[r][j] = table[r][j] + table[i][j];\n \t\t\t}\n \t\t\ttable[i][c] = table[i][c] + table[i][j];\n \t\t}",
"{\n \t\t\tif (j == c) {\n \t\t\t\tcontinue;\n \t\t\t}\n \t\t\tif (i != r) {\n \t\t\t\ttable[r][j] = table[r][j] + table[i][j];\n \t\t\t}\n \t\t\ttable[i][c] = table[i][c] + table[i][j];\n \t\t}",
"if (j == c) {\n \t\t\t\tcontinue;\n \t\t\t}",
"j == c",
"j",
"c",
"{\n \t\t\t\tcontinue;\n \t\t\t}",
"continue;",
"if (i != r) {\n \t\t\t\ttable[r][j] = table[r][j] + table[i][j];\n \t\t\t}",
"i != r",
"i",
"r",
"{\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",
"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[] row : table) {\n \t\tint cnt = 0;\n \t\tfor (int n : row) {\n \t\t\tSystem.out.print(n);\n \t\t\tif (cnt != c) {\n \t\t\t\tSystem.out.print(\" \");\n \t\t\t}\n \t\t\tcnt++;\n \t\t}\n \t\tSystem.out.println(\"\");\n \t}",
"int[] row",
"table",
"{\n \t\tint cnt = 0;\n \t\tfor (int n : row) {\n \t\t\tSystem.out.print(n);\n \t\t\tif (cnt != c) {\n \t\t\t\tSystem.out.print(\" \");\n \t\t\t}\n \t\t\tcnt++;\n \t\t}\n \t\tSystem.out.println(\"\");\n \t}",
"{\n \t\tint cnt = 0;\n \t\tfor (int n : row) {\n \t\t\tSystem.out.print(n);\n \t\t\tif (cnt != c) {\n \t\t\t\tSystem.out.print(\" \");\n \t\t\t}\n \t\t\tcnt++;\n \t\t}\n \t\tSystem.out.println(\"\");\n \t}",
"int cnt = 0;",
"cnt",
"0",
"for (int n : row) {\n \t\t\tSystem.out.print(n);\n \t\t\tif (cnt != c) {\n \t\t\t\tSystem.out.print(\" \");\n \t\t\t}\n \t\t\tcnt++;\n \t\t}",
"int n",
"row",
"{\n \t\t\tSystem.out.print(n);\n \t\t\tif (cnt != c) {\n \t\t\t\tSystem.out.print(\" \");\n \t\t\t}\n \t\t\tcnt++;\n \t\t}",
"{\n \t\t\tSystem.out.print(n);\n \t\t\tif (cnt != c) {\n \t\t\t\tSystem.out.print(\" \");\n \t\t\t}\n \t\t\tcnt++;\n \t\t}",
"System.out.print(n)",
"System.out.print",
"System.out",
"System",
"System.out",
"n",
"if (cnt != c) {\n \t\t\t\tSystem.out.print(\" \");\n \t\t\t}",
"cnt != c",
"cnt",
"c",
"{\n \t\t\t\tSystem.out.print(\" \");\n \t\t\t}",
"System.out.print(\" \")",
"System.out.print",
"System.out",
"System",
"System.out",
"\" \"",
"cnt++",
"cnt",
"System.out.println(\"\")",
"System.out.println",
"System.out",
"System",
"System.out",
"\"\"",
"String[] args",
"args",
"private static int[] convertInt(String[] str) {\n \tint len = str.length;\n \tint[] iArray = new int[len + 1];\n \tfor (int i = 0; i < len; i++) {\n \t\tiArray[i] = Integer.parseInt(str[i]);\n \t}\n \treturn iArray;\n }",
"convertInt",
"{\n \tint len = str.length;\n \tint[] iArray = new int[len + 1];\n \tfor (int i = 0; i < len; i++) {\n \t\tiArray[i] = Integer.parseInt(str[i]);\n \t}\n \treturn iArray;\n }",
"int len = str.length;",
"len",
"str.length",
"str",
"str.length",
"int[] iArray = new int[len + 1];",
"iArray",
"new int[len + 1]",
"len + 1",
"len",
"1",
"for (int i = 0; i < len; i++) {\n \t\tiArray[i] = Integer.parseInt(str[i]);\n \t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < len",
"i",
"len",
"i++",
"i++",
"i",
"{\n \t\tiArray[i] = Integer.parseInt(str[i]);\n \t}",
"{\n \t\tiArray[i] = Integer.parseInt(str[i]);\n \t}",
"iArray[i] = Integer.parseInt(str[i])",
"iArray[i]",
"iArray",
"i",
"Integer.parseInt(str[i])",
"Integer.parseInt",
"Integer",
"str[i]",
"str",
"i",
"return iArray;",
"iArray",
"String[] str",
"str",
"public class Main {\n \n public static void main(String[] args) throws Exception {\n \tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n \tString[] rc = br.readLine().split(\" \");\n \tint r = Integer.parseInt(rc[0]);\n \tint c = Integer.parseInt(rc[1]);\n \tint[][] table = new int[r + 1][c + 1];\n \tfor (int i = 0; i < r; i++) {\n \t\ttable[i] = convertInt(br.readLine().split(\" \"));\n \t}\n \tfor (int i = 0; i <= r; i++) {\n \t\tfor (int j = 0; j <= c; j++) {\n \t\t\tif (j == c) {\n \t\t\t\tcontinue;\n \t\t\t}\n \t\t\tif (i != r) {\n \t\t\t\ttable[r][j] = table[r][j] + table[i][j];\n \t\t\t}\n \t\t\ttable[i][c] = table[i][c] + table[i][j];\n \t\t}\n \t}\n \tfor (int[] row : table) {\n \t\tint cnt = 0;\n \t\tfor (int n : row) {\n \t\t\tSystem.out.print(n);\n \t\t\tif (cnt != c) {\n \t\t\t\tSystem.out.print(\" \");\n \t\t\t}\n \t\t\tcnt++;\n \t\t}\n \t\tSystem.out.println(\"\");\n \t}\n\n }\n\n private static int[] convertInt(String[] str) {\n \tint len = str.length;\n \tint[] iArray = new int[len + 1];\n \tfor (int i = 0; i < len; i++) {\n \t\tiArray[i] = Integer.parseInt(str[i]);\n \t}\n \treturn iArray;\n }\n}",
"public class Main {\n \n public static void main(String[] args) throws Exception {\n \tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n \tString[] rc = br.readLine().split(\" \");\n \tint r = Integer.parseInt(rc[0]);\n \tint c = Integer.parseInt(rc[1]);\n \tint[][] table = new int[r + 1][c + 1];\n \tfor (int i = 0; i < r; i++) {\n \t\ttable[i] = convertInt(br.readLine().split(\" \"));\n \t}\n \tfor (int i = 0; i <= r; i++) {\n \t\tfor (int j = 0; j <= c; j++) {\n \t\t\tif (j == c) {\n \t\t\t\tcontinue;\n \t\t\t}\n \t\t\tif (i != r) {\n \t\t\t\ttable[r][j] = table[r][j] + table[i][j];\n \t\t\t}\n \t\t\ttable[i][c] = table[i][c] + table[i][j];\n \t\t}\n \t}\n \tfor (int[] row : table) {\n \t\tint cnt = 0;\n \t\tfor (int n : row) {\n \t\t\tSystem.out.print(n);\n \t\t\tif (cnt != c) {\n \t\t\t\tSystem.out.print(\" \");\n \t\t\t}\n \t\t\tcnt++;\n \t\t}\n \t\tSystem.out.println(\"\");\n \t}\n\n }\n\n private static int[] convertInt(String[] str) {\n \tint len = str.length;\n \tint[] iArray = new int[len + 1];\n \tfor (int i = 0; i < len; i++) {\n \t\tiArray[i] = Integer.parseInt(str[i]);\n \t}\n \treturn iArray;\n }\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[] rc = br.readLine().split(" ");
int r = Integer.parseInt(rc[0]);
int c = Integer.parseInt(rc[1]);
int[][] table = new int[r + 1][c + 1];
for (int i = 0; i < r; i++) {
table[i] = convertInt(br.readLine().split(" "));
}
for (int i = 0; i <= r; i++) {
for (int j = 0; j <= c; j++) {
if (j == c) {
continue;
}
if (i != r) {
table[r][j] = table[r][j] + table[i][j];
}
table[i][c] = table[i][c] + table[i][j];
}
}
for (int[] row : table) {
int cnt = 0;
for (int n : row) {
System.out.print(n);
if (cnt != c) {
System.out.print(" ");
}
cnt++;
}
System.out.println("");
}
}
private static int[] convertInt(String[] str) {
int len = str.length;
int[] iArray = new int[len + 1];
for (int i = 0; i < len; i++) {
iArray[i] = Integer.parseInt(str[i]);
}
return iArray;
}
} |
[
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,
41,
13,
17,
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,
41,
13,
4,
18,
4,
18,
13,
17,
41,
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,
18,
13,
13,
4,
18,
13,
18,
13,
13,
0,
13,
4,
18,
13,
18,
13,
13,
0,
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,
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
],
[
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
],
[
46,
48
],
[
14,
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
],
[
63,
64
],
[
63,
65
],
[
62,
66
],
[
14,
67
],
[
67,
68
],
[
68,
69
],
[
69,
70
],
[
69,
71
],
[
67,
72
],
[
72,
73
],
[
72,
74
],
[
67,
75
],
[
75,
76
],
[
76,
77
],
[
67,
78
],
[
79,
79
],
[
79,
80
],
[
80,
81
],
[
80,
82
],
[
82,
83
],
[
83,
84
],
[
84,
85
],
[
85,
86
],
[
82,
87
],
[
79,
88
],
[
88,
89
],
[
88,
90
],
[
79,
91
],
[
91,
92
],
[
92,
93
],
[
93,
94
],
[
93,
95
],
[
91,
96
],
[
96,
97
],
[
96,
98
],
[
91,
99
],
[
99,
100
],
[
100,
101
],
[
91,
102
],
[
103,
103
],
[
103,
104
],
[
104,
105
],
[
105,
106
],
[
106,
107
],
[
106,
108
],
[
104,
109
],
[
109,
110
],
[
110,
111
],
[
110,
112
],
[
109,
113
],
[
103,
114
],
[
114,
115
],
[
115,
116
],
[
115,
117
],
[
114,
118
],
[
118,
119
],
[
119,
120
],
[
118,
121
],
[
121,
122
],
[
121,
123
],
[
103,
124
],
[
124,
125
],
[
124,
126
],
[
126,
127
],
[
127,
128
],
[
126,
129
],
[
129,
130
],
[
129,
131
],
[
79,
132
],
[
132,
133
],
[
132,
134
],
[
79,
135
],
[
135,
136
],
[
136,
137
],
[
137,
138
],
[
137,
139
],
[
135,
140
],
[
14,
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
],
[
160,
161
],
[
160,
162
],
[
159,
163
],
[
14,
164
],
[
164,
165
],
[
165,
166
],
[
166,
167
],
[
166,
168
],
[
164,
169
],
[
12,
170
],
[
170,
171
]
] | [
"import java.io.BufferedReader;\nimport java.io.IOException;\nimport java.io.InputStreamReader;\n \nclass Main{\n public static void main(String args[]) throws IOException{\n \n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n String[] token = br.readLine().split(\" \");\n int r = Integer.parseInt(token[0]); \n int c = Integer.parseInt(token[1]); \n int[] Columnsum = new int[c];\n int totalsum = 0; \n for(int k = 0;k < c; k++){ \n Columnsum[k] = 0;\n }\n \n \n for(int i = 0;i < r; i++){\n String[] token2 = br.readLine().split(\" \");\n int sum = 0;\n for(int j = 0;j < c; j++){ \n System.out.print(token2[j] + \" \");\n Columnsum[j] += Integer.parseInt(token2[j]);\n sum += Integer.parseInt(token2[j]);\n }\n totalsum += sum;\n System.out.println(sum);\n }\n\n for(int l = 0;l < c; l++){ \n System.out.print(Columnsum[l] + \" \");\n }\n System.out.println(totalsum);\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",
"class Main{\n public static void main(String args[]) throws IOException{\n \n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n String[] token = br.readLine().split(\" \");\n int r = Integer.parseInt(token[0]); \n int c = Integer.parseInt(token[1]); \n int[] Columnsum = new int[c];\n int totalsum = 0; \n for(int k = 0;k < c; k++){ \n Columnsum[k] = 0;\n }\n \n \n for(int i = 0;i < r; i++){\n String[] token2 = br.readLine().split(\" \");\n int sum = 0;\n for(int j = 0;j < c; j++){ \n System.out.print(token2[j] + \" \");\n Columnsum[j] += Integer.parseInt(token2[j]);\n sum += Integer.parseInt(token2[j]);\n }\n totalsum += sum;\n System.out.println(sum);\n }\n\n for(int l = 0;l < c; l++){ \n System.out.print(Columnsum[l] + \" \");\n }\n System.out.println(totalsum);\n\n \n }\n}",
"Main",
"public static void main(String args[]) throws IOException{\n \n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n String[] token = br.readLine().split(\" \");\n int r = Integer.parseInt(token[0]); \n int c = Integer.parseInt(token[1]); \n int[] Columnsum = new int[c];\n int totalsum = 0; \n for(int k = 0;k < c; k++){ \n Columnsum[k] = 0;\n }\n \n \n for(int i = 0;i < r; i++){\n String[] token2 = br.readLine().split(\" \");\n int sum = 0;\n for(int j = 0;j < c; j++){ \n System.out.print(token2[j] + \" \");\n Columnsum[j] += Integer.parseInt(token2[j]);\n sum += Integer.parseInt(token2[j]);\n }\n totalsum += sum;\n System.out.println(sum);\n }\n\n for(int l = 0;l < c; l++){ \n System.out.print(Columnsum[l] + \" \");\n }\n System.out.println(totalsum);\n\n \n }",
"main",
"{\n \n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n String[] token = br.readLine().split(\" \");\n int r = Integer.parseInt(token[0]); \n int c = Integer.parseInt(token[1]); \n int[] Columnsum = new int[c];\n int totalsum = 0; \n for(int k = 0;k < c; k++){ \n Columnsum[k] = 0;\n }\n \n \n for(int i = 0;i < r; i++){\n String[] token2 = br.readLine().split(\" \");\n int sum = 0;\n for(int j = 0;j < c; j++){ \n System.out.print(token2[j] + \" \");\n Columnsum[j] += Integer.parseInt(token2[j]);\n sum += Integer.parseInt(token2[j]);\n }\n totalsum += sum;\n System.out.println(sum);\n }\n\n for(int l = 0;l < c; l++){ \n System.out.print(Columnsum[l] + \" \");\n }\n System.out.println(totalsum);\n\n \n }",
"BufferedReader br = new BufferedReader(new InputStreamReader(System.in));",
"br",
"new BufferedReader(new InputStreamReader(System.in))",
"String[] token = br.readLine().split(\" \");",
"token",
"br.readLine().split(\" \")",
"br.readLine().split",
"br.readLine()",
"br.readLine",
"br",
"\" \"",
"int r = Integer.parseInt(token[0]);",
"r",
"Integer.parseInt(token[0])",
"Integer.parseInt",
"Integer",
"token[0]",
"token",
"0",
"int c = Integer.parseInt(token[1]);",
"c",
"Integer.parseInt(token[1])",
"Integer.parseInt",
"Integer",
"token[1]",
"token",
"1",
"int[] Columnsum = new int[c];",
"Columnsum",
"new int[c]",
"c",
"int totalsum = 0;",
"totalsum",
"0",
"for(int k = 0;k < c; k++){ \n Columnsum[k] = 0;\n }",
"int k = 0;",
"int k = 0;",
"k",
"0",
"k < c",
"k",
"c",
"k++",
"k++",
"k",
"{ \n Columnsum[k] = 0;\n }",
"{ \n Columnsum[k] = 0;\n }",
"Columnsum[k] = 0",
"Columnsum[k]",
"Columnsum",
"k",
"0",
"for(int i = 0;i < r; i++){\n String[] token2 = br.readLine().split(\" \");\n int sum = 0;\n for(int j = 0;j < c; j++){ \n System.out.print(token2[j] + \" \");\n Columnsum[j] += Integer.parseInt(token2[j]);\n sum += Integer.parseInt(token2[j]);\n }\n totalsum += sum;\n System.out.println(sum);\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < r",
"i",
"r",
"i++",
"i++",
"i",
"{\n String[] token2 = br.readLine().split(\" \");\n int sum = 0;\n for(int j = 0;j < c; j++){ \n System.out.print(token2[j] + \" \");\n Columnsum[j] += Integer.parseInt(token2[j]);\n sum += Integer.parseInt(token2[j]);\n }\n totalsum += sum;\n System.out.println(sum);\n }",
"{\n String[] token2 = br.readLine().split(\" \");\n int sum = 0;\n for(int j = 0;j < c; j++){ \n System.out.print(token2[j] + \" \");\n Columnsum[j] += Integer.parseInt(token2[j]);\n sum += Integer.parseInt(token2[j]);\n }\n totalsum += sum;\n System.out.println(sum);\n }",
"String[] token2 = br.readLine().split(\" \");",
"token2",
"br.readLine().split(\" \")",
"br.readLine().split",
"br.readLine()",
"br.readLine",
"br",
"\" \"",
"int sum = 0;",
"sum",
"0",
"for(int j = 0;j < c; j++){ \n System.out.print(token2[j] + \" \");\n Columnsum[j] += Integer.parseInt(token2[j]);\n sum += Integer.parseInt(token2[j]);\n }",
"int j = 0;",
"int j = 0;",
"j",
"0",
"j < c",
"j",
"c",
"j++",
"j++",
"j",
"{ \n System.out.print(token2[j] + \" \");\n Columnsum[j] += Integer.parseInt(token2[j]);\n sum += Integer.parseInt(token2[j]);\n }",
"{ \n System.out.print(token2[j] + \" \");\n Columnsum[j] += Integer.parseInt(token2[j]);\n sum += Integer.parseInt(token2[j]);\n }",
"System.out.print(token2[j] + \" \")",
"System.out.print",
"System.out",
"System",
"System.out",
"token2[j] + \" \"",
"token2[j]",
"token2",
"j",
"\" \"",
"Columnsum[j] += Integer.parseInt(token2[j])",
"Columnsum[j]",
"Columnsum",
"j",
"Integer.parseInt(token2[j])",
"Integer.parseInt",
"Integer",
"token2[j]",
"token2",
"j",
"sum += Integer.parseInt(token2[j])",
"sum",
"Integer.parseInt(token2[j])",
"Integer.parseInt",
"Integer",
"token2[j]",
"token2",
"j",
"totalsum += sum",
"totalsum",
"sum",
"System.out.println(sum)",
"System.out.println",
"System.out",
"System",
"System.out",
"sum",
"for(int l = 0;l < c; l++){ \n System.out.print(Columnsum[l] + \" \");\n }",
"int l = 0;",
"int l = 0;",
"l",
"0",
"l < c",
"l",
"c",
"l++",
"l++",
"l",
"{ \n System.out.print(Columnsum[l] + \" \");\n }",
"{ \n System.out.print(Columnsum[l] + \" \");\n }",
"System.out.print(Columnsum[l] + \" \")",
"System.out.print",
"System.out",
"System",
"System.out",
"Columnsum[l] + \" \"",
"Columnsum[l]",
"Columnsum",
"l",
"\" \"",
"System.out.println(totalsum)",
"System.out.println",
"System.out",
"System",
"System.out",
"totalsum",
"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));
String[] token = br.readLine().split(" ");
int r = Integer.parseInt(token[0]);
int c = Integer.parseInt(token[1]);
int[] Columnsum = new int[c];
int totalsum = 0;
for(int k = 0;k < c; k++){
Columnsum[k] = 0;
}
for(int i = 0;i < r; i++){
String[] token2 = br.readLine().split(" ");
int sum = 0;
for(int j = 0;j < c; j++){
System.out.print(token2[j] + " ");
Columnsum[j] += Integer.parseInt(token2[j]);
sum += Integer.parseInt(token2[j]);
}
totalsum += sum;
System.out.println(sum);
}
for(int l = 0;l < c; l++){
System.out.print(Columnsum[l] + " ");
}
System.out.println(totalsum);
}
} |
[
7,
15,
13,
17,
6,
13,
41,
13,
20,
12,
13,
30,
41,
13,
4,
13,
4,
18,
13,
4,
18,
13,
4,
13,
13,
23,
13,
12,
13,
30,
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,
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,
29,
13,
23,
13,
23,
13,
12,
13,
30,
11,
1,
41,
13,
17,
2,
13,
18,
13,
13,
1,
40,
13,
30,
30,
4,
18,
18,
13,
13,
18,
18,
13,
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,
17,
18,
18,
13,
13,
13,
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
],
[
195,
9
],
[
9,
10
],
[
9,
11
],
[
11,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
14,
16
],
[
16,
17
],
[
17,
18
],
[
14,
19
],
[
19,
20
],
[
20,
21
],
[
11,
22
],
[
22,
23
],
[
22,
24
],
[
9,
25
],
[
25,
26
],
[
195,
27
],
[
27,
28
],
[
27,
29
],
[
29,
30
],
[
30,
31
],
[
30,
32
],
[
33,
34
],
[
33,
35
],
[
36,
37
],
[
36,
38
],
[
29,
39
],
[
39,
40
],
[
40,
41
],
[
41,
42
],
[
41,
43
],
[
39,
44
],
[
44,
45
],
[
44,
46
],
[
39,
47
],
[
47,
48
],
[
48,
49
],
[
39,
50
],
[
51,
51
],
[
51,
52
],
[
52,
53
],
[
53,
54
],
[
54,
55
],
[
54,
56
],
[
52,
57
],
[
57,
58
],
[
57,
59
],
[
52,
60
],
[
60,
61
],
[
61,
62
],
[
52,
63
],
[
64,
64
],
[
64,
65
],
[
65,
66
],
[
66,
67
],
[
67,
68
],
[
67,
69
],
[
66,
70
],
[
65,
71
],
[
71,
72
],
[
72,
73
],
[
64,
74
],
[
74,
75
],
[
75,
76
],
[
76,
77
],
[
76,
78
],
[
75,
79
],
[
74,
80
],
[
80,
81
],
[
81,
82
],
[
81,
83
],
[
80,
84
],
[
29,
85
],
[
85,
86
],
[
86,
87
],
[
87,
88
],
[
87,
89
],
[
85,
90
],
[
90,
91
],
[
90,
92
],
[
92,
93
],
[
92,
94
],
[
85,
95
],
[
95,
96
],
[
96,
97
],
[
85,
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
],
[
29,
124
],
[
124,
125
],
[
27,
126
],
[
126,
127
],
[
27,
128
],
[
128,
129
],
[
195,
130
],
[
130,
131
],
[
130,
132
],
[
132,
133
],
[
133,
134
],
[
134,
135
],
[
135,
136
],
[
135,
137
],
[
133,
138
],
[
138,
139
],
[
138,
140
],
[
140,
141
],
[
140,
142
],
[
133,
143
],
[
143,
144
],
[
144,
145
],
[
133,
146
],
[
147,
147
],
[
147,
148
],
[
148,
149
],
[
149,
150
],
[
150,
151
],
[
150,
152
],
[
148,
153
],
[
153,
154
],
[
154,
155
],
[
154,
156
],
[
153,
157
],
[
147,
158
],
[
158,
159
],
[
159,
160
],
[
160,
161
],
[
160,
162
],
[
158,
163
],
[
163,
164
],
[
163,
165
],
[
165,
166
],
[
166,
167
],
[
166,
168
],
[
165,
169
],
[
158,
170
],
[
170,
171
],
[
171,
172
],
[
158,
173
],
[
174,
174
],
[
174,
175
],
[
175,
176
],
[
176,
177
],
[
177,
178
],
[
177,
179
],
[
175,
180
],
[
180,
181
],
[
180,
182
],
[
182,
183
],
[
183,
184
],
[
183,
185
],
[
182,
186
],
[
147,
187
],
[
187,
188
],
[
188,
189
],
[
189,
190
],
[
189,
191
],
[
130,
192
],
[
192,
193
],
[
0,
194
],
[
194,
195
],
[
194,
196
]
] | [
"import java.util.Scanner;\n\npublic class Main {\n\n\tstatic Scanner sc = new Scanner(System.in);\n\n\tpublic static void main(String[] args) {\n\n\t\t// 表の作成と入力\n\t\tint[][] table = CreateTable(sc.nextInt(), sc.nextInt());\n\n\t\t// 表示\n\t\tPrint(table);\n\t}\n\n\t// 表の生成と入力し、表(2次元配列)を返す\n\tstatic int[][] CreateTable(int r, int c) {\n\t\tint table[][] = new int[r + 1][c + 1]; // 表を生成(+1は合計行列分)\n\n\t\tfor (int y = 0; y < r; y++) {\n\n\t\t\tfor (int x = 0; x < c; x++) {\n\n\t\t\t\ttable[y][x] = sc.nextInt();\n\n\t\t\t\ttable[y][c] += table[y][x]; // 最後列(行の合計)に値を加算\n\t\t\t}\n\t\t}\n\n\t\t// 最下行(列の合計)の計算\n\t\tfor (int x = 0; x < c + 1; x++) {\n\n\t\t\tfor (int y = 0; y < r; y++) {\n\n\t\t\t\ttable[r][x] += table[y][x]; // 最下行(列合計)に値を加算\n\t\t\t}\n\t\t}\n\t\treturn table;\n\t}\n\n\t// 表示処理\n\tstatic void Print(int[][] table) {\n\t\t// 出力用のループ\n\t\tfor (int y = 0; y < table.length; y++) {\n\n\t\t\tSystem.out.print(table[y][0]);\n\t\t\tfor (int x = 1; x < table[y].length; x++) {\n\n\t\t\t\tSystem.out.print(\" \" + table[y][x]);\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}\n\t}\n\n}\n",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n\n\tstatic Scanner sc = new Scanner(System.in);\n\n\tpublic static void main(String[] args) {\n\n\t\t// 表の作成と入力\n\t\tint[][] table = CreateTable(sc.nextInt(), sc.nextInt());\n\n\t\t// 表示\n\t\tPrint(table);\n\t}\n\n\t// 表の生成と入力し、表(2次元配列)を返す\n\tstatic int[][] CreateTable(int r, int c) {\n\t\tint table[][] = new int[r + 1][c + 1]; // 表を生成(+1は合計行列分)\n\n\t\tfor (int y = 0; y < r; y++) {\n\n\t\t\tfor (int x = 0; x < c; x++) {\n\n\t\t\t\ttable[y][x] = sc.nextInt();\n\n\t\t\t\ttable[y][c] += table[y][x]; // 最後列(行の合計)に値を加算\n\t\t\t}\n\t\t}\n\n\t\t// 最下行(列の合計)の計算\n\t\tfor (int x = 0; x < c + 1; x++) {\n\n\t\t\tfor (int y = 0; y < r; y++) {\n\n\t\t\t\ttable[r][x] += table[y][x]; // 最下行(列合計)に値を加算\n\t\t\t}\n\t\t}\n\t\treturn table;\n\t}\n\n\t// 表示処理\n\tstatic void Print(int[][] table) {\n\t\t// 出力用のループ\n\t\tfor (int y = 0; y < table.length; y++) {\n\n\t\t\tSystem.out.print(table[y][0]);\n\t\t\tfor (int x = 1; x < table[y].length; x++) {\n\n\t\t\t\tSystem.out.print(\" \" + table[y][x]);\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}\n\t}\n\n}",
"Main",
"static Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"public static void main(String[] args) {\n\n\t\t// 表の作成と入力\n\t\tint[][] table = CreateTable(sc.nextInt(), sc.nextInt());\n\n\t\t// 表示\n\t\tPrint(table);\n\t}",
"main",
"{\n\n\t\t// 表の作成と入力\n\t\tint[][] table = CreateTable(sc.nextInt(), sc.nextInt());\n\n\t\t// 表示\n\t\tPrint(table);\n\t}",
"int[][] table = CreateTable(sc.nextInt(), sc.nextInt());",
"table",
"CreateTable(sc.nextInt(), sc.nextInt())",
"CreateTable",
"sc.nextInt()",
"sc.nextInt",
"sc",
"sc.nextInt()",
"sc.nextInt",
"sc",
"Print(table)",
"Print",
"table",
"String[] args",
"args",
"// 表の生成と入力し、表(2次元配列)を返す\n\tstatic int[][] CreateTable(int r, int c) {\n\t\tint table[][] = new int[r + 1][c + 1]; // 表を生成(+1は合計行列分)\n\n\t\tfor (int y = 0; y < r; y++) {\n\n\t\t\tfor (int x = 0; x < c; x++) {\n\n\t\t\t\ttable[y][x] = sc.nextInt();\n\n\t\t\t\ttable[y][c] += table[y][x]; // 最後列(行の合計)に値を加算\n\t\t\t}\n\t\t}\n\n\t\t// 最下行(列の合計)の計算\n\t\tfor (int x = 0; x < c + 1; x++) {\n\n\t\t\tfor (int y = 0; y < r; y++) {\n\n\t\t\t\ttable[r][x] += table[y][x]; // 最下行(列合計)に値を加算\n\t\t\t}\n\t\t}\n\t\treturn table;\n\t}",
"CreateTable",
"{\n\t\tint table[][] = new int[r + 1][c + 1]; // 表を生成(+1は合計行列分)\n\n\t\tfor (int y = 0; y < r; y++) {\n\n\t\t\tfor (int x = 0; x < c; x++) {\n\n\t\t\t\ttable[y][x] = sc.nextInt();\n\n\t\t\t\ttable[y][c] += table[y][x]; // 最後列(行の合計)に値を加算\n\t\t\t}\n\t\t}\n\n\t\t// 最下行(列の合計)の計算\n\t\tfor (int x = 0; x < c + 1; x++) {\n\n\t\t\tfor (int y = 0; y < r; y++) {\n\n\t\t\t\ttable[r][x] += table[y][x]; // 最下行(列合計)に値を加算\n\t\t\t}\n\t\t}\n\t\treturn table;\n\t}",
"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 y = 0; y < r; y++) {\n\n\t\t\tfor (int x = 0; x < c; x++) {\n\n\t\t\t\ttable[y][x] = sc.nextInt();\n\n\t\t\t\ttable[y][c] += table[y][x]; // 最後列(行の合計)に値を加算\n\t\t\t}\n\t\t}",
"int y = 0;",
"int y = 0;",
"y",
"0",
"y < r",
"y",
"r",
"y++",
"y++",
"y",
"{\n\n\t\t\tfor (int x = 0; x < c; x++) {\n\n\t\t\t\ttable[y][x] = sc.nextInt();\n\n\t\t\t\ttable[y][c] += table[y][x]; // 最後列(行の合計)に値を加算\n\t\t\t}\n\t\t}",
"{\n\n\t\t\tfor (int x = 0; x < c; x++) {\n\n\t\t\t\ttable[y][x] = sc.nextInt();\n\n\t\t\t\ttable[y][c] += table[y][x]; // 最後列(行の合計)に値を加算\n\t\t\t}\n\t\t}",
"for (int x = 0; x < c; x++) {\n\n\t\t\t\ttable[y][x] = sc.nextInt();\n\n\t\t\t\ttable[y][c] += table[y][x]; // 最後列(行の合計)に値を加算\n\t\t\t}",
"int x = 0;",
"int x = 0;",
"x",
"0",
"x < c",
"x",
"c",
"x++",
"x++",
"x",
"{\n\n\t\t\t\ttable[y][x] = sc.nextInt();\n\n\t\t\t\ttable[y][c] += table[y][x]; // 最後列(行の合計)に値を加算\n\t\t\t}",
"{\n\n\t\t\t\ttable[y][x] = sc.nextInt();\n\n\t\t\t\ttable[y][c] += table[y][x]; // 最後列(行の合計)に値を加算\n\t\t\t}",
"table[y][x] = sc.nextInt()",
"table[y][x]",
"table[y]",
"table",
"y",
"x",
"sc.nextInt()",
"sc.nextInt",
"sc",
"table[y][c] += table[y][x]",
"table[y][c]",
"table[y]",
"table",
"y",
"c",
"table[y][x]",
"table[y]",
"table",
"y",
"x",
"for (int x = 0; x < c + 1; x++) {\n\n\t\t\tfor (int y = 0; y < r; y++) {\n\n\t\t\t\ttable[r][x] += table[y][x]; // 最下行(列合計)に値を加算\n\t\t\t}\n\t\t}",
"int x = 0;",
"int x = 0;",
"x",
"0",
"x < c + 1",
"x",
"c + 1",
"c",
"1",
"x++",
"x++",
"x",
"{\n\n\t\t\tfor (int y = 0; y < r; y++) {\n\n\t\t\t\ttable[r][x] += table[y][x]; // 最下行(列合計)に値を加算\n\t\t\t}\n\t\t}",
"{\n\n\t\t\tfor (int y = 0; y < r; y++) {\n\n\t\t\t\ttable[r][x] += table[y][x]; // 最下行(列合計)に値を加算\n\t\t\t}\n\t\t}",
"for (int y = 0; y < r; y++) {\n\n\t\t\t\ttable[r][x] += table[y][x]; // 最下行(列合計)に値を加算\n\t\t\t}",
"int y = 0;",
"int y = 0;",
"y",
"0",
"y < r",
"y",
"r",
"y++",
"y++",
"y",
"{\n\n\t\t\t\ttable[r][x] += table[y][x]; // 最下行(列合計)に値を加算\n\t\t\t}",
"{\n\n\t\t\t\ttable[r][x] += table[y][x]; // 最下行(列合計)に値を加算\n\t\t\t}",
"table[r][x] += table[y][x]",
"table[r][x]",
"table[r]",
"table",
"r",
"x",
"table[y][x]",
"table[y]",
"table",
"y",
"x",
"return table;",
"table",
"int r",
"r",
"int c",
"c",
"// 表示処理\n\tstatic void Print(int[][] table) {\n\t\t// 出力用のループ\n\t\tfor (int y = 0; y < table.length; y++) {\n\n\t\t\tSystem.out.print(table[y][0]);\n\t\t\tfor (int x = 1; x < table[y].length; x++) {\n\n\t\t\t\tSystem.out.print(\" \" + table[y][x]);\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}\n\t}",
"Print",
"{\n\t\t// 出力用のループ\n\t\tfor (int y = 0; y < table.length; y++) {\n\n\t\t\tSystem.out.print(table[y][0]);\n\t\t\tfor (int x = 1; x < table[y].length; x++) {\n\n\t\t\t\tSystem.out.print(\" \" + table[y][x]);\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}\n\t}",
"for (int y = 0; y < table.length; y++) {\n\n\t\t\tSystem.out.print(table[y][0]);\n\t\t\tfor (int x = 1; x < table[y].length; x++) {\n\n\t\t\t\tSystem.out.print(\" \" + table[y][x]);\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}",
"int y = 0;",
"int y = 0;",
"y",
"0",
"y < table.length",
"y",
"table.length",
"table",
"table.length",
"y++",
"y++",
"y",
"{\n\n\t\t\tSystem.out.print(table[y][0]);\n\t\t\tfor (int x = 1; x < table[y].length; x++) {\n\n\t\t\t\tSystem.out.print(\" \" + table[y][x]);\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}",
"{\n\n\t\t\tSystem.out.print(table[y][0]);\n\t\t\tfor (int x = 1; x < table[y].length; x++) {\n\n\t\t\t\tSystem.out.print(\" \" + table[y][x]);\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}",
"System.out.print(table[y][0])",
"System.out.print",
"System.out",
"System",
"System.out",
"table[y][0]",
"table[y]",
"table",
"y",
"0",
"for (int x = 1; x < table[y].length; x++) {\n\n\t\t\t\tSystem.out.print(\" \" + table[y][x]);\n\t\t\t}",
"int x = 1;",
"int x = 1;",
"x",
"1",
"x < table[y].length",
"x",
"table[y].length",
"table[y]",
"table",
"y",
"table[y].length",
"x++",
"x++",
"x",
"{\n\n\t\t\t\tSystem.out.print(\" \" + table[y][x]);\n\t\t\t}",
"{\n\n\t\t\t\tSystem.out.print(\" \" + table[y][x]);\n\t\t\t}",
"System.out.print(\" \" + table[y][x])",
"System.out.print",
"System.out",
"System",
"System.out",
"\" \" + table[y][x]",
"\" \"",
"table[y][x]",
"table[y]",
"table",
"y",
"x",
"System.out.println()",
"System.out.println",
"System.out",
"System",
"System.out",
"int[][] table",
"table",
"public class Main {\n\n\tstatic Scanner sc = new Scanner(System.in);\n\n\tpublic static void main(String[] args) {\n\n\t\t// 表の作成と入力\n\t\tint[][] table = CreateTable(sc.nextInt(), sc.nextInt());\n\n\t\t// 表示\n\t\tPrint(table);\n\t}\n\n\t// 表の生成と入力し、表(2次元配列)を返す\n\tstatic int[][] CreateTable(int r, int c) {\n\t\tint table[][] = new int[r + 1][c + 1]; // 表を生成(+1は合計行列分)\n\n\t\tfor (int y = 0; y < r; y++) {\n\n\t\t\tfor (int x = 0; x < c; x++) {\n\n\t\t\t\ttable[y][x] = sc.nextInt();\n\n\t\t\t\ttable[y][c] += table[y][x]; // 最後列(行の合計)に値を加算\n\t\t\t}\n\t\t}\n\n\t\t// 最下行(列の合計)の計算\n\t\tfor (int x = 0; x < c + 1; x++) {\n\n\t\t\tfor (int y = 0; y < r; y++) {\n\n\t\t\t\ttable[r][x] += table[y][x]; // 最下行(列合計)に値を加算\n\t\t\t}\n\t\t}\n\t\treturn table;\n\t}\n\n\t// 表示処理\n\tstatic void Print(int[][] table) {\n\t\t// 出力用のループ\n\t\tfor (int y = 0; y < table.length; y++) {\n\n\t\t\tSystem.out.print(table[y][0]);\n\t\t\tfor (int x = 1; x < table[y].length; x++) {\n\n\t\t\t\tSystem.out.print(\" \" + table[y][x]);\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}\n\t}\n\n}",
"public class Main {\n\n\tstatic Scanner sc = new Scanner(System.in);\n\n\tpublic static void main(String[] args) {\n\n\t\t// 表の作成と入力\n\t\tint[][] table = CreateTable(sc.nextInt(), sc.nextInt());\n\n\t\t// 表示\n\t\tPrint(table);\n\t}\n\n\t// 表の生成と入力し、表(2次元配列)を返す\n\tstatic int[][] CreateTable(int r, int c) {\n\t\tint table[][] = new int[r + 1][c + 1]; // 表を生成(+1は合計行列分)\n\n\t\tfor (int y = 0; y < r; y++) {\n\n\t\t\tfor (int x = 0; x < c; x++) {\n\n\t\t\t\ttable[y][x] = sc.nextInt();\n\n\t\t\t\ttable[y][c] += table[y][x]; // 最後列(行の合計)に値を加算\n\t\t\t}\n\t\t}\n\n\t\t// 最下行(列の合計)の計算\n\t\tfor (int x = 0; x < c + 1; x++) {\n\n\t\t\tfor (int y = 0; y < r; y++) {\n\n\t\t\t\ttable[r][x] += table[y][x]; // 最下行(列合計)に値を加算\n\t\t\t}\n\t\t}\n\t\treturn table;\n\t}\n\n\t// 表示処理\n\tstatic void Print(int[][] table) {\n\t\t// 出力用のループ\n\t\tfor (int y = 0; y < table.length; y++) {\n\n\t\t\tSystem.out.print(table[y][0]);\n\t\t\tfor (int x = 1; x < table[y].length; x++) {\n\n\t\t\t\tSystem.out.print(\" \" + table[y][x]);\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 {
static Scanner sc = new Scanner(System.in);
public static void main(String[] args) {
// 表の作成と入力
int[][] table = CreateTable(sc.nextInt(), sc.nextInt());
// 表示
Print(table);
}
// 表の生成と入力し、表(2次元配列)を返す
static int[][] CreateTable(int r, int c) {
int table[][] = new int[r + 1][c + 1]; // 表を生成(+1は合計行列分)
for (int y = 0; y < r; y++) {
for (int x = 0; x < c; x++) {
table[y][x] = sc.nextInt();
table[y][c] += table[y][x]; // 最後列(行の合計)に値を加算
}
}
// 最下行(列の合計)の計算
for (int x = 0; x < c + 1; x++) {
for (int y = 0; y < r; y++) {
table[r][x] += table[y][x]; // 最下行(列合計)に値を加算
}
}
return table;
}
// 表示処理
static void Print(int[][] table) {
// 出力用のループ
for (int y = 0; y < table.length; y++) {
System.out.print(table[y][0]);
for (int x = 1; x < table[y].length; x++) {
System.out.print(" " + table[y][x]);
}
System.out.println();
}
}
}
|
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
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,
4,
18,
13,
2,
18,
18,
13,
13,
13,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
4,
18,
13,
2,
18,
18,
13,
13,
13,
13,
4,
18,
13,
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
],
[
23,
24
],
[
24,
25
],
[
25,
26
],
[
26,
27
],
[
23,
28
],
[
8,
29
],
[
29,
30
],
[
29,
31
],
[
31,
32
],
[
32,
33
],
[
31,
34
],
[
34,
35
],
[
34,
36
],
[
8,
37
],
[
37,
38
],
[
37,
39
],
[
39,
40
],
[
40,
41
],
[
39,
42
],
[
42,
43
],
[
42,
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
],
[
100,
103
],
[
103,
104
],
[
104,
105
],
[
105,
106
],
[
105,
107
],
[
104,
108
],
[
103,
109
],
[
87,
110
],
[
110,
111
],
[
111,
112
],
[
112,
113
],
[
112,
114
],
[
111,
115
],
[
110,
116
],
[
116,
117
],
[
117,
118
],
[
117,
119
],
[
116,
120
],
[
87,
121
],
[
121,
122
],
[
122,
123
],
[
123,
124
],
[
123,
125
],
[
122,
126
],
[
121,
127
],
[
127,
128
],
[
128,
129
],
[
128,
130
],
[
127,
131
],
[
87,
132
],
[
132,
133
],
[
133,
134
],
[
134,
135
],
[
134,
136
],
[
133,
137
],
[
132,
138
],
[
138,
139
],
[
139,
140
],
[
139,
141
],
[
138,
142
],
[
66,
143
],
[
143,
144
],
[
144,
145
],
[
143,
146
],
[
146,
147
],
[
147,
148
],
[
148,
149
],
[
148,
150
],
[
147,
151
],
[
146,
152
],
[
8,
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
],
[
165,
168
],
[
168,
169
],
[
169,
170
],
[
170,
171
],
[
170,
172
],
[
169,
173
],
[
168,
174
],
[
8,
175
],
[
175,
176
],
[
176,
177
],
[
175,
178
],
[
178,
179
],
[
179,
180
],
[
179,
181
],
[
178,
182
],
[
8,
183
],
[
183,
184
],
[
184,
185
],
[
185,
186
],
[
185,
187
],
[
183,
188
],
[
6,
189
],
[
189,
190
]
] | [
"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 sb=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\tsb.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}\n \tsb.append(h[i][c]+n);\n }\n \tfor(int j=0;j<c;j++) sb.append(h[r][j]+b);\n sb.append(h[r][c]);\n System.out.println(sb);\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 sb=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\tsb.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}\n \tsb.append(h[i][c]+n);\n }\n \tfor(int j=0;j<c;j++) sb.append(h[r][j]+b);\n sb.append(h[r][c]);\n System.out.println(sb);\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 sb=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\tsb.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}\n \tsb.append(h[i][c]+n);\n }\n \tfor(int j=0;j<c;j++) sb.append(h[r][j]+b);\n sb.append(h[r][c]);\n System.out.println(sb);\n\t}",
"main",
"{\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\t\tStringBuilder sb=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\tsb.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}\n \tsb.append(h[i][c]+n);\n }\n \tfor(int j=0;j<c;j++) sb.append(h[r][j]+b);\n sb.append(h[r][c]);\n System.out.println(sb);\n\t}",
"BufferedReader br = new BufferedReader(new InputStreamReader(System.in));",
"br",
"new BufferedReader(new InputStreamReader(System.in))",
"StringBuilder sb=new StringBuilder();",
"sb",
"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\tsb.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}\n \tsb.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\tsb.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}\n \tsb.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\tsb.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}\n \tsb.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\tsb.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}",
"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\tsb.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}",
"{\n \t\th[i][j]=Integer.parseInt(row[j]);\n \t\tsb.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}",
"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",
"sb.append(h[i][j]+b)",
"sb.append",
"sb",
"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",
"sb.append(h[i][c]+n)",
"sb.append",
"sb",
"h[i][c]+n",
"h[i][c]",
"h[i]",
"h",
"i",
"c",
"n",
"for(int j=0;j<c;j++) sb.append(h[r][j]+b);",
"int j=0;",
"int j=0;",
"j",
"0",
"j<c",
"j",
"c",
"j++",
"j++",
"j",
"sb.append(h[r][j]+b);",
"sb.append(h[r][j]+b)",
"sb.append",
"sb",
"h[r][j]+b",
"h[r][j]",
"h[r]",
"h",
"r",
"j",
"b",
"sb.append(h[r][c])",
"sb.append",
"sb",
"h[r][c]",
"h[r]",
"h",
"r",
"c",
"System.out.println(sb)",
"System.out.println",
"System.out",
"System",
"System.out",
"sb",
"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 sb=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]);
sb.append(h[i][j]+b);
h[i][c]+=h[i][j];
h[r][j]+=h[i][j];
h[r][c]+=h[i][j];
}
sb.append(h[i][c]+n);
}
for(int j=0;j<c;j++) sb.append(h[r][j]+b);
sb.append(h[r][c]);
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,
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,
0,
18,
18,
13,
2,
13,
17,
2,
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,
0,
18,
18,
13,
2,
13,
17,
13,
18,
18,
13,
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,
2,
13,
17,
18,
18,
13,
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,
18,
18,
13,
2,
13,
17,
13,
11,
1,
41,
13,
17,
2,
2,
13,
17,
13,
1,
40,
13,
30,
30,
11,
1,
41,
13,
17,
2,
2,
13,
17,
13,
1,
40,
13,
30,
30,
14,
2,
13,
2,
13,
17,
30,
4,
18,
18,
13,
13,
2,
18,
18,
13,
2,
13,
17,
2,
13,
17,
17,
30,
4,
18,
18,
13,
13,
18,
18,
13,
2,
13,
17,
2,
13,
17,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
256,
5
],
[
256,
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
],
[
57,
59
],
[
59,
60
],
[
60,
61
],
[
56,
62
],
[
62,
63
],
[
63,
64
],
[
64,
65
],
[
64,
66
],
[
66,
67
],
[
66,
68
],
[
63,
69
],
[
69,
70
],
[
69,
71
],
[
62,
72
],
[
8,
73
],
[
73,
74
],
[
74,
75
],
[
75,
76
],
[
75,
77
],
[
73,
78
],
[
78,
79
],
[
78,
80
],
[
73,
81
],
[
81,
82
],
[
82,
83
],
[
73,
84
],
[
85,
85
],
[
85,
86
],
[
86,
87
],
[
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
],
[
103,
104
],
[
103,
105
],
[
100,
106
],
[
99,
107
],
[
107,
108
],
[
108,
109
],
[
108,
110
],
[
110,
111
],
[
110,
112
],
[
107,
113
],
[
113,
114
],
[
113,
115
],
[
8,
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
],
[
129,
134
],
[
134,
135
],
[
134,
136
],
[
129,
137
],
[
137,
138
],
[
138,
139
],
[
129,
140
],
[
141,
141
],
[
141,
142
],
[
142,
143
],
[
143,
144
],
[
144,
145
],
[
144,
146
],
[
143,
147
],
[
147,
148
],
[
147,
149
],
[
142,
150
],
[
150,
151
],
[
151,
152
],
[
151,
153
],
[
153,
154
],
[
153,
155
],
[
150,
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
],
[
173,
174
],
[
174,
175
],
[
174,
176
],
[
173,
177
],
[
172,
178
],
[
178,
179
],
[
179,
180
],
[
179,
181
],
[
181,
182
],
[
181,
183
],
[
178,
184
],
[
8,
185
],
[
185,
186
],
[
186,
187
],
[
187,
188
],
[
187,
189
],
[
185,
190
],
[
190,
191
],
[
191,
192
],
[
191,
193
],
[
190,
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
],
[
200,
210
],
[
210,
211
],
[
211,
212
],
[
200,
213
],
[
214,
214
],
[
214,
215
],
[
215,
216
],
[
216,
217
],
[
216,
218
],
[
218,
219
],
[
218,
220
],
[
215,
221
],
[
221,
222
],
[
222,
223
],
[
223,
224
],
[
224,
225
],
[
224,
226
],
[
222,
227
],
[
227,
228
],
[
228,
229
],
[
229,
230
],
[
229,
231
],
[
231,
232
],
[
231,
233
],
[
228,
234
],
[
234,
235
],
[
234,
236
],
[
227,
237
],
[
215,
238
],
[
238,
239
],
[
239,
240
],
[
240,
241
],
[
241,
242
],
[
241,
243
],
[
239,
244
],
[
244,
245
],
[
245,
246
],
[
245,
247
],
[
247,
248
],
[
247,
249
],
[
244,
250
],
[
250,
251
],
[
250,
252
],
[
6,
253
],
[
253,
254
],
[
0,
255
],
[
255,
256
],
[
255,
257
]
] | [
"import java.util.Scanner;\n\npublic class Main {\n\n public static void main(String[] args) {\n Scanner scanner = new Scanner(System.in);\n int retu = scanner.nextInt();\n int gyou = scanner.nextInt();\n int[][] shuturyoku = new int[(retu + 1)][(gyou + 1)];\n\n for (int i = 1; retu >= i; i++) {\n for (int j = 1; gyou >= j; j++) {\n int a = scanner.nextInt();\n shuturyoku[i - 1][j - 1] = a;\n }\n }\n for (int i = 1; retu >= i; i++) {\n for (int j = 1; gyou >= j; j++) {\n shuturyoku[i - 1][gyou] += shuturyoku[i - 1][j - 1];\n }\n }\n for (int i = 1; retu >= i; i++) {\n for (int j = 1; gyou >= j; j++) {\n shuturyoku[retu][j - 1] += shuturyoku[i - 1][j - 1];\n }\n }\n for (int i = 1; retu >= i; i++) {\n shuturyoku[retu][gyou] += shuturyoku[i-1][gyou];\n }\n for (int i = 1; retu + 1 >= i; i++) {\n for (int j = 1; gyou + 1 >= j; j++) {\n if (j != gyou+1) {\n System.out.print(shuturyoku[i - 1][j - 1] + \" \");\n } else {\n System.out.println(shuturyoku[i - 1][j - 1]);\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 scanner = new Scanner(System.in);\n int retu = scanner.nextInt();\n int gyou = scanner.nextInt();\n int[][] shuturyoku = new int[(retu + 1)][(gyou + 1)];\n\n for (int i = 1; retu >= i; i++) {\n for (int j = 1; gyou >= j; j++) {\n int a = scanner.nextInt();\n shuturyoku[i - 1][j - 1] = a;\n }\n }\n for (int i = 1; retu >= i; i++) {\n for (int j = 1; gyou >= j; j++) {\n shuturyoku[i - 1][gyou] += shuturyoku[i - 1][j - 1];\n }\n }\n for (int i = 1; retu >= i; i++) {\n for (int j = 1; gyou >= j; j++) {\n shuturyoku[retu][j - 1] += shuturyoku[i - 1][j - 1];\n }\n }\n for (int i = 1; retu >= i; i++) {\n shuturyoku[retu][gyou] += shuturyoku[i-1][gyou];\n }\n for (int i = 1; retu + 1 >= i; i++) {\n for (int j = 1; gyou + 1 >= j; j++) {\n if (j != gyou+1) {\n System.out.print(shuturyoku[i - 1][j - 1] + \" \");\n } else {\n System.out.println(shuturyoku[i - 1][j - 1]);\n }\n }\n }\n }\n}",
"Main",
"public static void main(String[] args) {\n Scanner scanner = new Scanner(System.in);\n int retu = scanner.nextInt();\n int gyou = scanner.nextInt();\n int[][] shuturyoku = new int[(retu + 1)][(gyou + 1)];\n\n for (int i = 1; retu >= i; i++) {\n for (int j = 1; gyou >= j; j++) {\n int a = scanner.nextInt();\n shuturyoku[i - 1][j - 1] = a;\n }\n }\n for (int i = 1; retu >= i; i++) {\n for (int j = 1; gyou >= j; j++) {\n shuturyoku[i - 1][gyou] += shuturyoku[i - 1][j - 1];\n }\n }\n for (int i = 1; retu >= i; i++) {\n for (int j = 1; gyou >= j; j++) {\n shuturyoku[retu][j - 1] += shuturyoku[i - 1][j - 1];\n }\n }\n for (int i = 1; retu >= i; i++) {\n shuturyoku[retu][gyou] += shuturyoku[i-1][gyou];\n }\n for (int i = 1; retu + 1 >= i; i++) {\n for (int j = 1; gyou + 1 >= j; j++) {\n if (j != gyou+1) {\n System.out.print(shuturyoku[i - 1][j - 1] + \" \");\n } else {\n System.out.println(shuturyoku[i - 1][j - 1]);\n }\n }\n }\n }",
"main",
"{\n Scanner scanner = new Scanner(System.in);\n int retu = scanner.nextInt();\n int gyou = scanner.nextInt();\n int[][] shuturyoku = new int[(retu + 1)][(gyou + 1)];\n\n for (int i = 1; retu >= i; i++) {\n for (int j = 1; gyou >= j; j++) {\n int a = scanner.nextInt();\n shuturyoku[i - 1][j - 1] = a;\n }\n }\n for (int i = 1; retu >= i; i++) {\n for (int j = 1; gyou >= j; j++) {\n shuturyoku[i - 1][gyou] += shuturyoku[i - 1][j - 1];\n }\n }\n for (int i = 1; retu >= i; i++) {\n for (int j = 1; gyou >= j; j++) {\n shuturyoku[retu][j - 1] += shuturyoku[i - 1][j - 1];\n }\n }\n for (int i = 1; retu >= i; i++) {\n shuturyoku[retu][gyou] += shuturyoku[i-1][gyou];\n }\n for (int i = 1; retu + 1 >= i; i++) {\n for (int j = 1; gyou + 1 >= j; j++) {\n if (j != gyou+1) {\n System.out.print(shuturyoku[i - 1][j - 1] + \" \");\n } else {\n System.out.println(shuturyoku[i - 1][j - 1]);\n }\n }\n }\n }",
"Scanner scanner = new Scanner(System.in);",
"scanner",
"new Scanner(System.in)",
"int retu = scanner.nextInt();",
"retu",
"scanner.nextInt()",
"scanner.nextInt",
"scanner",
"int gyou = scanner.nextInt();",
"gyou",
"scanner.nextInt()",
"scanner.nextInt",
"scanner",
"int[][] shuturyoku = new int[(retu + 1)][(gyou + 1)];",
"shuturyoku",
"new int[(retu + 1)][(gyou + 1)]",
"(retu + 1)",
"retu",
"1",
"(gyou + 1)",
"gyou",
"1",
"for (int i = 1; retu >= i; i++) {\n for (int j = 1; gyou >= j; j++) {\n int a = scanner.nextInt();\n shuturyoku[i - 1][j - 1] = a;\n }\n }",
"int i = 1;",
"int i = 1;",
"i",
"1",
"retu >= i",
"retu",
"i",
"i++",
"i++",
"i",
"{\n for (int j = 1; gyou >= j; j++) {\n int a = scanner.nextInt();\n shuturyoku[i - 1][j - 1] = a;\n }\n }",
"{\n for (int j = 1; gyou >= j; j++) {\n int a = scanner.nextInt();\n shuturyoku[i - 1][j - 1] = a;\n }\n }",
"for (int j = 1; gyou >= j; j++) {\n int a = scanner.nextInt();\n shuturyoku[i - 1][j - 1] = a;\n }",
"int j = 1;",
"int j = 1;",
"j",
"1",
"gyou >= j",
"gyou",
"j",
"j++",
"j++",
"j",
"{\n int a = scanner.nextInt();\n shuturyoku[i - 1][j - 1] = a;\n }",
"{\n int a = scanner.nextInt();\n shuturyoku[i - 1][j - 1] = a;\n }",
"int a = scanner.nextInt();",
"a",
"scanner.nextInt()",
"scanner.nextInt",
"scanner",
"shuturyoku[i - 1][j - 1] = a",
"shuturyoku[i - 1][j - 1]",
"shuturyoku[i - 1]",
"shuturyoku",
"i - 1",
"i",
"1",
"j - 1",
"j",
"1",
"a",
"for (int i = 1; retu >= i; i++) {\n for (int j = 1; gyou >= j; j++) {\n shuturyoku[i - 1][gyou] += shuturyoku[i - 1][j - 1];\n }\n }",
"int i = 1;",
"int i = 1;",
"i",
"1",
"retu >= i",
"retu",
"i",
"i++",
"i++",
"i",
"{\n for (int j = 1; gyou >= j; j++) {\n shuturyoku[i - 1][gyou] += shuturyoku[i - 1][j - 1];\n }\n }",
"{\n for (int j = 1; gyou >= j; j++) {\n shuturyoku[i - 1][gyou] += shuturyoku[i - 1][j - 1];\n }\n }",
"for (int j = 1; gyou >= j; j++) {\n shuturyoku[i - 1][gyou] += shuturyoku[i - 1][j - 1];\n }",
"int j = 1;",
"int j = 1;",
"j",
"1",
"gyou >= j",
"gyou",
"j",
"j++",
"j++",
"j",
"{\n shuturyoku[i - 1][gyou] += shuturyoku[i - 1][j - 1];\n }",
"{\n shuturyoku[i - 1][gyou] += shuturyoku[i - 1][j - 1];\n }",
"shuturyoku[i - 1][gyou] += shuturyoku[i - 1][j - 1]",
"shuturyoku[i - 1][gyou]",
"shuturyoku[i - 1]",
"shuturyoku",
"i - 1",
"i",
"1",
"gyou",
"shuturyoku[i - 1][j - 1]",
"shuturyoku[i - 1]",
"shuturyoku",
"i - 1",
"i",
"1",
"j - 1",
"j",
"1",
"for (int i = 1; retu >= i; i++) {\n for (int j = 1; gyou >= j; j++) {\n shuturyoku[retu][j - 1] += shuturyoku[i - 1][j - 1];\n }\n }",
"int i = 1;",
"int i = 1;",
"i",
"1",
"retu >= i",
"retu",
"i",
"i++",
"i++",
"i",
"{\n for (int j = 1; gyou >= j; j++) {\n shuturyoku[retu][j - 1] += shuturyoku[i - 1][j - 1];\n }\n }",
"{\n for (int j = 1; gyou >= j; j++) {\n shuturyoku[retu][j - 1] += shuturyoku[i - 1][j - 1];\n }\n }",
"for (int j = 1; gyou >= j; j++) {\n shuturyoku[retu][j - 1] += shuturyoku[i - 1][j - 1];\n }",
"int j = 1;",
"int j = 1;",
"j",
"1",
"gyou >= j",
"gyou",
"j",
"j++",
"j++",
"j",
"{\n shuturyoku[retu][j - 1] += shuturyoku[i - 1][j - 1];\n }",
"{\n shuturyoku[retu][j - 1] += shuturyoku[i - 1][j - 1];\n }",
"shuturyoku[retu][j - 1] += shuturyoku[i - 1][j - 1]",
"shuturyoku[retu][j - 1]",
"shuturyoku[retu]",
"shuturyoku",
"retu",
"j - 1",
"j",
"1",
"shuturyoku[i - 1][j - 1]",
"shuturyoku[i - 1]",
"shuturyoku",
"i - 1",
"i",
"1",
"j - 1",
"j",
"1",
"for (int i = 1; retu >= i; i++) {\n shuturyoku[retu][gyou] += shuturyoku[i-1][gyou];\n }",
"int i = 1;",
"int i = 1;",
"i",
"1",
"retu >= i",
"retu",
"i",
"i++",
"i++",
"i",
"{\n shuturyoku[retu][gyou] += shuturyoku[i-1][gyou];\n }",
"{\n shuturyoku[retu][gyou] += shuturyoku[i-1][gyou];\n }",
"shuturyoku[retu][gyou] += shuturyoku[i-1][gyou]",
"shuturyoku[retu][gyou]",
"shuturyoku[retu]",
"shuturyoku",
"retu",
"gyou",
"shuturyoku[i-1][gyou]",
"shuturyoku[i-1]",
"shuturyoku",
"i-1",
"i",
"1",
"gyou",
"for (int i = 1; retu + 1 >= i; i++) {\n for (int j = 1; gyou + 1 >= j; j++) {\n if (j != gyou+1) {\n System.out.print(shuturyoku[i - 1][j - 1] + \" \");\n } else {\n System.out.println(shuturyoku[i - 1][j - 1]);\n }\n }\n }",
"int i = 1;",
"int i = 1;",
"i",
"1",
"retu + 1 >= i",
"retu + 1",
"retu",
"1",
"i",
"i++",
"i++",
"i",
"{\n for (int j = 1; gyou + 1 >= j; j++) {\n if (j != gyou+1) {\n System.out.print(shuturyoku[i - 1][j - 1] + \" \");\n } else {\n System.out.println(shuturyoku[i - 1][j - 1]);\n }\n }\n }",
"{\n for (int j = 1; gyou + 1 >= j; j++) {\n if (j != gyou+1) {\n System.out.print(shuturyoku[i - 1][j - 1] + \" \");\n } else {\n System.out.println(shuturyoku[i - 1][j - 1]);\n }\n }\n }",
"for (int j = 1; gyou + 1 >= j; j++) {\n if (j != gyou+1) {\n System.out.print(shuturyoku[i - 1][j - 1] + \" \");\n } else {\n System.out.println(shuturyoku[i - 1][j - 1]);\n }\n }",
"int j = 1;",
"int j = 1;",
"j",
"1",
"gyou + 1 >= j",
"gyou + 1",
"gyou",
"1",
"j",
"j++",
"j++",
"j",
"{\n if (j != gyou+1) {\n System.out.print(shuturyoku[i - 1][j - 1] + \" \");\n } else {\n System.out.println(shuturyoku[i - 1][j - 1]);\n }\n }",
"{\n if (j != gyou+1) {\n System.out.print(shuturyoku[i - 1][j - 1] + \" \");\n } else {\n System.out.println(shuturyoku[i - 1][j - 1]);\n }\n }",
"if (j != gyou+1) {\n System.out.print(shuturyoku[i - 1][j - 1] + \" \");\n } else {\n System.out.println(shuturyoku[i - 1][j - 1]);\n }",
"j != gyou+1",
"j",
"gyou+1",
"gyou",
"1",
"{\n System.out.print(shuturyoku[i - 1][j - 1] + \" \");\n }",
"System.out.print(shuturyoku[i - 1][j - 1] + \" \")",
"System.out.print",
"System.out",
"System",
"System.out",
"shuturyoku[i - 1][j - 1] + \" \"",
"shuturyoku[i - 1][j - 1]",
"shuturyoku[i - 1]",
"shuturyoku",
"i - 1",
"i",
"1",
"j - 1",
"j",
"1",
"\" \"",
"{\n System.out.println(shuturyoku[i - 1][j - 1]);\n }",
"System.out.println(shuturyoku[i - 1][j - 1])",
"System.out.println",
"System.out",
"System",
"System.out",
"shuturyoku[i - 1][j - 1]",
"shuturyoku[i - 1]",
"shuturyoku",
"i - 1",
"i",
"1",
"j - 1",
"j",
"1",
"String[] args",
"args",
"public class Main {\n\n public static void main(String[] args) {\n Scanner scanner = new Scanner(System.in);\n int retu = scanner.nextInt();\n int gyou = scanner.nextInt();\n int[][] shuturyoku = new int[(retu + 1)][(gyou + 1)];\n\n for (int i = 1; retu >= i; i++) {\n for (int j = 1; gyou >= j; j++) {\n int a = scanner.nextInt();\n shuturyoku[i - 1][j - 1] = a;\n }\n }\n for (int i = 1; retu >= i; i++) {\n for (int j = 1; gyou >= j; j++) {\n shuturyoku[i - 1][gyou] += shuturyoku[i - 1][j - 1];\n }\n }\n for (int i = 1; retu >= i; i++) {\n for (int j = 1; gyou >= j; j++) {\n shuturyoku[retu][j - 1] += shuturyoku[i - 1][j - 1];\n }\n }\n for (int i = 1; retu >= i; i++) {\n shuturyoku[retu][gyou] += shuturyoku[i-1][gyou];\n }\n for (int i = 1; retu + 1 >= i; i++) {\n for (int j = 1; gyou + 1 >= j; j++) {\n if (j != gyou+1) {\n System.out.print(shuturyoku[i - 1][j - 1] + \" \");\n } else {\n System.out.println(shuturyoku[i - 1][j - 1]);\n }\n }\n }\n }\n}",
"public class Main {\n\n public static void main(String[] args) {\n Scanner scanner = new Scanner(System.in);\n int retu = scanner.nextInt();\n int gyou = scanner.nextInt();\n int[][] shuturyoku = new int[(retu + 1)][(gyou + 1)];\n\n for (int i = 1; retu >= i; i++) {\n for (int j = 1; gyou >= j; j++) {\n int a = scanner.nextInt();\n shuturyoku[i - 1][j - 1] = a;\n }\n }\n for (int i = 1; retu >= i; i++) {\n for (int j = 1; gyou >= j; j++) {\n shuturyoku[i - 1][gyou] += shuturyoku[i - 1][j - 1];\n }\n }\n for (int i = 1; retu >= i; i++) {\n for (int j = 1; gyou >= j; j++) {\n shuturyoku[retu][j - 1] += shuturyoku[i - 1][j - 1];\n }\n }\n for (int i = 1; retu >= i; i++) {\n shuturyoku[retu][gyou] += shuturyoku[i-1][gyou];\n }\n for (int i = 1; retu + 1 >= i; i++) {\n for (int j = 1; gyou + 1 >= j; j++) {\n if (j != gyou+1) {\n System.out.print(shuturyoku[i - 1][j - 1] + \" \");\n } else {\n System.out.println(shuturyoku[i - 1][j - 1]);\n }\n }\n }\n }\n}",
"Main"
] | import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
int retu = scanner.nextInt();
int gyou = scanner.nextInt();
int[][] shuturyoku = new int[(retu + 1)][(gyou + 1)];
for (int i = 1; retu >= i; i++) {
for (int j = 1; gyou >= j; j++) {
int a = scanner.nextInt();
shuturyoku[i - 1][j - 1] = a;
}
}
for (int i = 1; retu >= i; i++) {
for (int j = 1; gyou >= j; j++) {
shuturyoku[i - 1][gyou] += shuturyoku[i - 1][j - 1];
}
}
for (int i = 1; retu >= i; i++) {
for (int j = 1; gyou >= j; j++) {
shuturyoku[retu][j - 1] += shuturyoku[i - 1][j - 1];
}
}
for (int i = 1; retu >= i; i++) {
shuturyoku[retu][gyou] += shuturyoku[i-1][gyou];
}
for (int i = 1; retu + 1 >= i; i++) {
for (int j = 1; gyou + 1 >= j; j++) {
if (j != gyou+1) {
System.out.print(shuturyoku[i - 1][j - 1] + " ");
} else {
System.out.println(shuturyoku[i - 1][j - 1]);
}
}
}
}
} |
[
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,
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,
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
],
[
195,
5
],
[
195,
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
],
[
108,
110
],
[
107,
111
],
[
100,
112
],
[
112,
113
],
[
113,
114
],
[
114,
115
],
[
114,
116
],
[
113,
117
],
[
112,
118
],
[
118,
119
],
[
119,
120
],
[
119,
121
],
[
118,
122
],
[
87,
123
],
[
123,
124
],
[
124,
125
],
[
125,
126
],
[
125,
127
],
[
124,
128
],
[
123,
129
],
[
129,
130
],
[
130,
131
],
[
130,
132
],
[
129,
133
],
[
8,
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
],
[
148,
148
],
[
148,
149
],
[
149,
150
],
[
150,
151
],
[
151,
152
],
[
151,
153
],
[
149,
154
],
[
154,
155
],
[
154,
156
],
[
156,
157
],
[
156,
158
],
[
149,
159
],
[
159,
160
],
[
160,
161
],
[
149,
162
],
[
163,
163
],
[
163,
164
],
[
164,
165
],
[
165,
166
],
[
165,
167
],
[
164,
168
],
[
168,
169
],
[
169,
170
],
[
170,
171
],
[
171,
172
],
[
171,
173
],
[
169,
174
],
[
169,
175
],
[
175,
176
],
[
176,
177
],
[
176,
178
],
[
175,
179
],
[
164,
180
],
[
180,
181
],
[
181,
182
],
[
182,
183
],
[
183,
184
],
[
183,
185
],
[
181,
186
],
[
181,
187
],
[
187,
188
],
[
188,
189
],
[
188,
190
],
[
187,
191
],
[
6,
192
],
[
192,
193
],
[
0,
194
],
[
194,
195
],
[
194,
196
]
] | [
"import java.util.Scanner;\n\npublic class Main {\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n\n int r = Integer.parseInt(sc.next());\n int c = Integer.parseInt(sc.next());\n\n int[][] M = new int[r+1][c+1];\n\n for (int i = 0; i < r; i++) {\n for(int j = 0; j < c; j++) {\n M[i][j] = Integer.parseInt(sc.next());\n }\n }\n\n for (int i = 0; i < r; i++) {\n for (int j = 0; j < c; j++) {\n M[r][j] += M[i][j];\n M[i][c] += M[i][j];\n }\n M[r][c] += M[i][c];\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.printf(\"%d\\n\", M[i][j]);\n } else {\n System.out.printf(\"%d \", M[i][j]);\n }\n }\n }\n }\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n\n int r = Integer.parseInt(sc.next());\n int c = Integer.parseInt(sc.next());\n\n int[][] M = new int[r+1][c+1];\n\n for (int i = 0; i < r; i++) {\n for(int j = 0; j < c; j++) {\n M[i][j] = Integer.parseInt(sc.next());\n }\n }\n\n for (int i = 0; i < r; i++) {\n for (int j = 0; j < c; j++) {\n M[r][j] += M[i][j];\n M[i][c] += M[i][j];\n }\n M[r][c] += M[i][c];\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.printf(\"%d\\n\", M[i][j]);\n } else {\n System.out.printf(\"%d \", M[i][j]);\n }\n }\n }\n }\n}",
"Main",
"public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n\n int r = Integer.parseInt(sc.next());\n int c = Integer.parseInt(sc.next());\n\n int[][] M = new int[r+1][c+1];\n\n for (int i = 0; i < r; i++) {\n for(int j = 0; j < c; j++) {\n M[i][j] = Integer.parseInt(sc.next());\n }\n }\n\n for (int i = 0; i < r; i++) {\n for (int j = 0; j < c; j++) {\n M[r][j] += M[i][j];\n M[i][c] += M[i][j];\n }\n M[r][c] += M[i][c];\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.printf(\"%d\\n\", M[i][j]);\n } else {\n System.out.printf(\"%d \", M[i][j]);\n }\n }\n }\n }",
"main",
"{\n Scanner sc = new Scanner(System.in);\n\n int r = Integer.parseInt(sc.next());\n int c = Integer.parseInt(sc.next());\n\n int[][] M = new int[r+1][c+1];\n\n for (int i = 0; i < r; i++) {\n for(int j = 0; j < c; j++) {\n M[i][j] = Integer.parseInt(sc.next());\n }\n }\n\n for (int i = 0; i < r; i++) {\n for (int j = 0; j < c; j++) {\n M[r][j] += M[i][j];\n M[i][c] += M[i][j];\n }\n M[r][c] += M[i][c];\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.printf(\"%d\\n\", M[i][j]);\n } else {\n System.out.printf(\"%d \", M[i][j]);\n }\n }\n }\n }",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"int r = Integer.parseInt(sc.next());",
"r",
"Integer.parseInt(sc.next())",
"Integer.parseInt",
"Integer",
"sc.next()",
"sc.next",
"sc",
"int c = Integer.parseInt(sc.next());",
"c",
"Integer.parseInt(sc.next())",
"Integer.parseInt",
"Integer",
"sc.next()",
"sc.next",
"sc",
"int[][] M = new int[r+1][c+1];",
"M",
"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 M[i][j] = Integer.parseInt(sc.next());\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 M[i][j] = Integer.parseInt(sc.next());\n }\n }",
"{\n for(int j = 0; j < c; j++) {\n M[i][j] = Integer.parseInt(sc.next());\n }\n }",
"for(int j = 0; j < c; j++) {\n M[i][j] = Integer.parseInt(sc.next());\n }",
"int j = 0;",
"int j = 0;",
"j",
"0",
"j < c",
"j",
"c",
"j++",
"j++",
"j",
"{\n M[i][j] = Integer.parseInt(sc.next());\n }",
"{\n M[i][j] = Integer.parseInt(sc.next());\n }",
"M[i][j] = Integer.parseInt(sc.next())",
"M[i][j]",
"M[i]",
"M",
"i",
"j",
"Integer.parseInt(sc.next())",
"Integer.parseInt",
"Integer",
"sc.next()",
"sc.next",
"sc",
"for (int i = 0; i < r; i++) {\n for (int j = 0; j < c; j++) {\n M[r][j] += M[i][j];\n M[i][c] += M[i][j];\n }\n M[r][c] += M[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 M[r][j] += M[i][j];\n M[i][c] += M[i][j];\n }\n M[r][c] += M[i][c];\n }",
"{\n for (int j = 0; j < c; j++) {\n M[r][j] += M[i][j];\n M[i][c] += M[i][j];\n }\n M[r][c] += M[i][c];\n }",
"for (int j = 0; j < c; j++) {\n M[r][j] += M[i][j];\n M[i][c] += M[i][j];\n }",
"int j = 0;",
"int j = 0;",
"j",
"0",
"j < c",
"j",
"c",
"j++",
"j++",
"j",
"{\n M[r][j] += M[i][j];\n M[i][c] += M[i][j];\n }",
"{\n M[r][j] += M[i][j];\n M[i][c] += M[i][j];\n }",
"M[r][j] += M[i][j]",
"M[r][j]",
"M[r]",
"M",
"r",
"j",
"M[i][j]",
"M[i]",
"M",
"i",
"j",
"M[i][c] += M[i][j]",
"M[i][c]",
"M[i]",
"M",
"i",
"c",
"M[i][j]",
"M[i]",
"M",
"i",
"j",
"M[r][c] += M[i][c]",
"M[r][c]",
"M[r]",
"M",
"r",
"c",
"M[i][c]",
"M[i]",
"M",
"i",
"c",
"for (int i = 0; i < r + 1; i++) {\n for (int j = 0; j < c + 1; j++) {\n if (j == c ) {\n System.out.printf(\"%d\\n\", M[i][j]);\n } else {\n System.out.printf(\"%d \", M[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.printf(\"%d\\n\", M[i][j]);\n } else {\n System.out.printf(\"%d \", M[i][j]);\n }\n }\n }",
"{\n for (int j = 0; j < c + 1; j++) {\n if (j == c ) {\n System.out.printf(\"%d\\n\", M[i][j]);\n } else {\n System.out.printf(\"%d \", M[i][j]);\n }\n }\n }",
"for (int j = 0; j < c + 1; j++) {\n if (j == c ) {\n System.out.printf(\"%d\\n\", M[i][j]);\n } else {\n System.out.printf(\"%d \", M[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.printf(\"%d\\n\", M[i][j]);\n } else {\n System.out.printf(\"%d \", M[i][j]);\n }\n }",
"{\n if (j == c ) {\n System.out.printf(\"%d\\n\", M[i][j]);\n } else {\n System.out.printf(\"%d \", M[i][j]);\n }\n }",
"if (j == c ) {\n System.out.printf(\"%d\\n\", M[i][j]);\n } else {\n System.out.printf(\"%d \", M[i][j]);\n }",
"j == c",
"j",
"c",
"{\n System.out.printf(\"%d\\n\", M[i][j]);\n }",
"System.out.printf(\"%d\\n\", M[i][j])",
"System.out.printf",
"System.out",
"System",
"System.out",
"\"%d\\n\"",
"M[i][j]",
"M[i]",
"M",
"i",
"j",
"{\n System.out.printf(\"%d \", M[i][j]);\n }",
"System.out.printf(\"%d \", M[i][j])",
"System.out.printf",
"System.out",
"System",
"System.out",
"\"%d \"",
"M[i][j]",
"M[i]",
"M",
"i",
"j",
"String[] args",
"args",
"public class Main {\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n\n int r = Integer.parseInt(sc.next());\n int c = Integer.parseInt(sc.next());\n\n int[][] M = new int[r+1][c+1];\n\n for (int i = 0; i < r; i++) {\n for(int j = 0; j < c; j++) {\n M[i][j] = Integer.parseInt(sc.next());\n }\n }\n\n for (int i = 0; i < r; i++) {\n for (int j = 0; j < c; j++) {\n M[r][j] += M[i][j];\n M[i][c] += M[i][j];\n }\n M[r][c] += M[i][c];\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.printf(\"%d\\n\", M[i][j]);\n } else {\n System.out.printf(\"%d \", M[i][j]);\n }\n }\n }\n }\n}",
"public class Main {\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n\n int r = Integer.parseInt(sc.next());\n int c = Integer.parseInt(sc.next());\n\n int[][] M = new int[r+1][c+1];\n\n for (int i = 0; i < r; i++) {\n for(int j = 0; j < c; j++) {\n M[i][j] = Integer.parseInt(sc.next());\n }\n }\n\n for (int i = 0; i < r; i++) {\n for (int j = 0; j < c; j++) {\n M[r][j] += M[i][j];\n M[i][c] += M[i][j];\n }\n M[r][c] += M[i][c];\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.printf(\"%d\\n\", M[i][j]);\n } else {\n System.out.printf(\"%d \", M[i][j]);\n }\n }\n }\n }\n}",
"Main"
] | import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int r = Integer.parseInt(sc.next());
int c = Integer.parseInt(sc.next());
int[][] M = new int[r+1][c+1];
for (int i = 0; i < r; i++) {
for(int j = 0; j < c; j++) {
M[i][j] = Integer.parseInt(sc.next());
}
}
for (int i = 0; i < r; i++) {
for (int j = 0; j < c; j++) {
M[r][j] += M[i][j];
M[i][c] += M[i][j];
}
M[r][c] += M[i][c];
}
for (int i = 0; i < r + 1; i++) {
for (int j = 0; j < c + 1; j++) {
if (j == c ) {
System.out.printf("%d\n", M[i][j]);
} else {
System.out.printf("%d ", M[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,
41,
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,
2,
13,
17,
1,
40,
13,
30,
30,
14,
2,
2,
13,
13,
2,
13,
13,
30,
4,
18,
18,
13,
13,
13,
14,
2,
13,
13,
30,
0,
13,
13,
4,
18,
18,
13,
13,
13,
14,
2,
13,
13,
30,
4,
18,
18,
13,
13,
2,
18,
13,
13,
17,
30,
41,
13,
4,
18,
13,
4,
18,
18,
13,
13,
2,
13,
17,
0,
13,
13,
0,
18,
13,
13,
13,
12,
13,
30,
4,
18,
20,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
137,
5
],
[
137,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
8,
17
],
[
17,
18
],
[
17,
19
],
[
19,
20
],
[
20,
21
],
[
8,
22
],
[
22,
23
],
[
22,
24
],
[
8,
26
],
[
26,
27
],
[
26,
28
],
[
8,
29
],
[
29,
30
],
[
30,
31
],
[
31,
32
],
[
31,
33
],
[
29,
34
],
[
34,
35
],
[
34,
36
],
[
36,
37
],
[
36,
38
],
[
29,
39
],
[
39,
40
],
[
40,
41
],
[
29,
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
],
[
54,
55
],
[
54,
56
],
[
47,
57
],
[
57,
58
],
[
58,
59
],
[
47,
60
],
[
61,
61
],
[
61,
62
],
[
62,
63
],
[
63,
64
],
[
64,
65
],
[
64,
66
],
[
63,
67
],
[
67,
68
],
[
67,
69
],
[
62,
70
],
[
70,
71
],
[
71,
72
],
[
72,
73
],
[
73,
74
],
[
73,
75
],
[
71,
76
],
[
62,
77
],
[
77,
78
],
[
78,
79
],
[
78,
80
],
[
77,
81
],
[
81,
82
],
[
82,
83
],
[
82,
84
],
[
81,
85
],
[
85,
86
],
[
86,
87
],
[
87,
88
],
[
87,
89
],
[
85,
90
],
[
77,
91
],
[
91,
92
],
[
92,
93
],
[
92,
94
],
[
91,
95
],
[
95,
96
],
[
96,
97
],
[
97,
98
],
[
98,
99
],
[
98,
100
],
[
96,
101
],
[
101,
102
],
[
102,
103
],
[
102,
104
],
[
101,
105
],
[
91,
106
],
[
106,
107
],
[
107,
108
],
[
107,
109
],
[
109,
110
],
[
110,
111
],
[
106,
112
],
[
112,
113
],
[
113,
114
],
[
114,
115
],
[
114,
116
],
[
112,
117
],
[
117,
118
],
[
117,
119
],
[
106,
120
],
[
120,
121
],
[
120,
122
],
[
106,
123
],
[
123,
124
],
[
124,
125
],
[
124,
126
],
[
123,
127
],
[
137,
128
],
[
128,
129
],
[
128,
130
],
[
130,
131
],
[
131,
132
],
[
132,
133
],
[
128,
134
],
[
134,
135
],
[
0,
136
],
[
136,
137
],
[
136,
138
]
] | [
"import java.util.Scanner;\n\npublic class Main {\n\tvoid run() {\n\t\tScanner scan = new Scanner(System.in);\n\t\tint r = scan.nextInt();\n\t\tint c = scan.nextInt();\n\t\tint[] rsum = new int[c];\n\t\tint allsum = 0;\n\t\tfor (int i = 0; i < r + 1; i++) {\n\t\t\tint csum = 0;\n\t\t\tfor (int j = 0; j < c + 1; j++) {\n\t\t\t\tif (i == r && j == c) {\n\t\t\t\t\tSystem.out.println(allsum);\n\t\t\t\t} else if (j == c) {\n\t\t\t\t\tallsum += csum;\n\t\t\t\t\tSystem.out.println(csum);\n\t\t\t\t} else if (i == r) {\n\t\t\t\t\tSystem.out.print(rsum[j] + \" \");\n\t\t\t\t} else {\n\t\t\t\t\tint val = scan.nextInt();\n\t\t\t\t\tSystem.out.print(val + \" \");\n\t\t\t\t\tcsum += val;\n\t\t\t\t\trsum[j] += val;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tpublic static void main(String[] args) {\n\t\tnew Main().run();\n\t}\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n\tvoid run() {\n\t\tScanner scan = new Scanner(System.in);\n\t\tint r = scan.nextInt();\n\t\tint c = scan.nextInt();\n\t\tint[] rsum = new int[c];\n\t\tint allsum = 0;\n\t\tfor (int i = 0; i < r + 1; i++) {\n\t\t\tint csum = 0;\n\t\t\tfor (int j = 0; j < c + 1; j++) {\n\t\t\t\tif (i == r && j == c) {\n\t\t\t\t\tSystem.out.println(allsum);\n\t\t\t\t} else if (j == c) {\n\t\t\t\t\tallsum += csum;\n\t\t\t\t\tSystem.out.println(csum);\n\t\t\t\t} else if (i == r) {\n\t\t\t\t\tSystem.out.print(rsum[j] + \" \");\n\t\t\t\t} else {\n\t\t\t\t\tint val = scan.nextInt();\n\t\t\t\t\tSystem.out.print(val + \" \");\n\t\t\t\t\tcsum += val;\n\t\t\t\t\trsum[j] += val;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tpublic static void main(String[] args) {\n\t\tnew Main().run();\n\t}\n}",
"Main",
"void run() {\n\t\tScanner scan = new Scanner(System.in);\n\t\tint r = scan.nextInt();\n\t\tint c = scan.nextInt();\n\t\tint[] rsum = new int[c];\n\t\tint allsum = 0;\n\t\tfor (int i = 0; i < r + 1; i++) {\n\t\t\tint csum = 0;\n\t\t\tfor (int j = 0; j < c + 1; j++) {\n\t\t\t\tif (i == r && j == c) {\n\t\t\t\t\tSystem.out.println(allsum);\n\t\t\t\t} else if (j == c) {\n\t\t\t\t\tallsum += csum;\n\t\t\t\t\tSystem.out.println(csum);\n\t\t\t\t} else if (i == r) {\n\t\t\t\t\tSystem.out.print(rsum[j] + \" \");\n\t\t\t\t} else {\n\t\t\t\t\tint val = scan.nextInt();\n\t\t\t\t\tSystem.out.print(val + \" \");\n\t\t\t\t\tcsum += val;\n\t\t\t\t\trsum[j] += val;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"run",
"{\n\t\tScanner scan = new Scanner(System.in);\n\t\tint r = scan.nextInt();\n\t\tint c = scan.nextInt();\n\t\tint[] rsum = new int[c];\n\t\tint allsum = 0;\n\t\tfor (int i = 0; i < r + 1; i++) {\n\t\t\tint csum = 0;\n\t\t\tfor (int j = 0; j < c + 1; j++) {\n\t\t\t\tif (i == r && j == c) {\n\t\t\t\t\tSystem.out.println(allsum);\n\t\t\t\t} else if (j == c) {\n\t\t\t\t\tallsum += csum;\n\t\t\t\t\tSystem.out.println(csum);\n\t\t\t\t} else if (i == r) {\n\t\t\t\t\tSystem.out.print(rsum[j] + \" \");\n\t\t\t\t} else {\n\t\t\t\t\tint val = scan.nextInt();\n\t\t\t\t\tSystem.out.print(val + \" \");\n\t\t\t\t\tcsum += val;\n\t\t\t\t\trsum[j] += val;\n\t\t\t\t}\n\t\t\t}\n\t\t}\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[] rsum = new int[c];",
"rsum",
"new int[c]",
"c",
"int allsum = 0;",
"allsum",
"0",
"for (int i = 0; i < r + 1; i++) {\n\t\t\tint csum = 0;\n\t\t\tfor (int j = 0; j < c + 1; j++) {\n\t\t\t\tif (i == r && j == c) {\n\t\t\t\t\tSystem.out.println(allsum);\n\t\t\t\t} else if (j == c) {\n\t\t\t\t\tallsum += csum;\n\t\t\t\t\tSystem.out.println(csum);\n\t\t\t\t} else if (i == r) {\n\t\t\t\t\tSystem.out.print(rsum[j] + \" \");\n\t\t\t\t} else {\n\t\t\t\t\tint val = scan.nextInt();\n\t\t\t\t\tSystem.out.print(val + \" \");\n\t\t\t\t\tcsum += val;\n\t\t\t\t\trsum[j] += val;\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 csum = 0;\n\t\t\tfor (int j = 0; j < c + 1; j++) {\n\t\t\t\tif (i == r && j == c) {\n\t\t\t\t\tSystem.out.println(allsum);\n\t\t\t\t} else if (j == c) {\n\t\t\t\t\tallsum += csum;\n\t\t\t\t\tSystem.out.println(csum);\n\t\t\t\t} else if (i == r) {\n\t\t\t\t\tSystem.out.print(rsum[j] + \" \");\n\t\t\t\t} else {\n\t\t\t\t\tint val = scan.nextInt();\n\t\t\t\t\tSystem.out.print(val + \" \");\n\t\t\t\t\tcsum += val;\n\t\t\t\t\trsum[j] += val;\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"{\n\t\t\tint csum = 0;\n\t\t\tfor (int j = 0; j < c + 1; j++) {\n\t\t\t\tif (i == r && j == c) {\n\t\t\t\t\tSystem.out.println(allsum);\n\t\t\t\t} else if (j == c) {\n\t\t\t\t\tallsum += csum;\n\t\t\t\t\tSystem.out.println(csum);\n\t\t\t\t} else if (i == r) {\n\t\t\t\t\tSystem.out.print(rsum[j] + \" \");\n\t\t\t\t} else {\n\t\t\t\t\tint val = scan.nextInt();\n\t\t\t\t\tSystem.out.print(val + \" \");\n\t\t\t\t\tcsum += val;\n\t\t\t\t\trsum[j] += val;\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"int csum = 0;",
"csum",
"0",
"for (int j = 0; j < c + 1; j++) {\n\t\t\t\tif (i == r && j == c) {\n\t\t\t\t\tSystem.out.println(allsum);\n\t\t\t\t} else if (j == c) {\n\t\t\t\t\tallsum += csum;\n\t\t\t\t\tSystem.out.println(csum);\n\t\t\t\t} else if (i == r) {\n\t\t\t\t\tSystem.out.print(rsum[j] + \" \");\n\t\t\t\t} else {\n\t\t\t\t\tint val = scan.nextInt();\n\t\t\t\t\tSystem.out.print(val + \" \");\n\t\t\t\t\tcsum += val;\n\t\t\t\t\trsum[j] += val;\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\tSystem.out.println(allsum);\n\t\t\t\t} else if (j == c) {\n\t\t\t\t\tallsum += csum;\n\t\t\t\t\tSystem.out.println(csum);\n\t\t\t\t} else if (i == r) {\n\t\t\t\t\tSystem.out.print(rsum[j] + \" \");\n\t\t\t\t} else {\n\t\t\t\t\tint val = scan.nextInt();\n\t\t\t\t\tSystem.out.print(val + \" \");\n\t\t\t\t\tcsum += val;\n\t\t\t\t\trsum[j] += val;\n\t\t\t\t}\n\t\t\t}",
"{\n\t\t\t\tif (i == r && j == c) {\n\t\t\t\t\tSystem.out.println(allsum);\n\t\t\t\t} else if (j == c) {\n\t\t\t\t\tallsum += csum;\n\t\t\t\t\tSystem.out.println(csum);\n\t\t\t\t} else if (i == r) {\n\t\t\t\t\tSystem.out.print(rsum[j] + \" \");\n\t\t\t\t} else {\n\t\t\t\t\tint val = scan.nextInt();\n\t\t\t\t\tSystem.out.print(val + \" \");\n\t\t\t\t\tcsum += val;\n\t\t\t\t\trsum[j] += val;\n\t\t\t\t}\n\t\t\t}",
"if (i == r && j == c) {\n\t\t\t\t\tSystem.out.println(allsum);\n\t\t\t\t} else if (j == c) {\n\t\t\t\t\tallsum += csum;\n\t\t\t\t\tSystem.out.println(csum);\n\t\t\t\t} else if (i == r) {\n\t\t\t\t\tSystem.out.print(rsum[j] + \" \");\n\t\t\t\t} else {\n\t\t\t\t\tint val = scan.nextInt();\n\t\t\t\t\tSystem.out.print(val + \" \");\n\t\t\t\t\tcsum += val;\n\t\t\t\t\trsum[j] += val;\n\t\t\t\t}",
"i == r && j == c",
"i == r",
"i",
"r",
"j == c",
"j",
"c",
"{\n\t\t\t\t\tSystem.out.println(allsum);\n\t\t\t\t}",
"System.out.println(allsum)",
"System.out.println",
"System.out",
"System",
"System.out",
"allsum",
"if (j == c) {\n\t\t\t\t\tallsum += csum;\n\t\t\t\t\tSystem.out.println(csum);\n\t\t\t\t} else if (i == r) {\n\t\t\t\t\tSystem.out.print(rsum[j] + \" \");\n\t\t\t\t} else {\n\t\t\t\t\tint val = scan.nextInt();\n\t\t\t\t\tSystem.out.print(val + \" \");\n\t\t\t\t\tcsum += val;\n\t\t\t\t\trsum[j] += val;\n\t\t\t\t}",
"j == c",
"j",
"c",
"{\n\t\t\t\t\tallsum += csum;\n\t\t\t\t\tSystem.out.println(csum);\n\t\t\t\t}",
"allsum += csum",
"allsum",
"csum",
"System.out.println(csum)",
"System.out.println",
"System.out",
"System",
"System.out",
"csum",
"if (i == r) {\n\t\t\t\t\tSystem.out.print(rsum[j] + \" \");\n\t\t\t\t} else {\n\t\t\t\t\tint val = scan.nextInt();\n\t\t\t\t\tSystem.out.print(val + \" \");\n\t\t\t\t\tcsum += val;\n\t\t\t\t\trsum[j] += val;\n\t\t\t\t}",
"i == r",
"i",
"r",
"{\n\t\t\t\t\tSystem.out.print(rsum[j] + \" \");\n\t\t\t\t}",
"System.out.print(rsum[j] + \" \")",
"System.out.print",
"System.out",
"System",
"System.out",
"rsum[j] + \" \"",
"rsum[j]",
"rsum",
"j",
"\" \"",
"{\n\t\t\t\t\tint val = scan.nextInt();\n\t\t\t\t\tSystem.out.print(val + \" \");\n\t\t\t\t\tcsum += val;\n\t\t\t\t\trsum[j] += val;\n\t\t\t\t}",
"int val = scan.nextInt();",
"val",
"scan.nextInt()",
"scan.nextInt",
"scan",
"System.out.print(val + \" \")",
"System.out.print",
"System.out",
"System",
"System.out",
"val + \" \"",
"val",
"\" \"",
"csum += val",
"csum",
"val",
"rsum[j] += val",
"rsum[j]",
"rsum",
"j",
"val",
"public static void main(String[] args) {\n\t\tnew Main().run();\n\t}",
"main",
"{\n\t\tnew Main().run();\n\t}",
"new Main().run()",
"new Main().run",
"new Main()",
"String[] args",
"args",
"public class Main {\n\tvoid run() {\n\t\tScanner scan = new Scanner(System.in);\n\t\tint r = scan.nextInt();\n\t\tint c = scan.nextInt();\n\t\tint[] rsum = new int[c];\n\t\tint allsum = 0;\n\t\tfor (int i = 0; i < r + 1; i++) {\n\t\t\tint csum = 0;\n\t\t\tfor (int j = 0; j < c + 1; j++) {\n\t\t\t\tif (i == r && j == c) {\n\t\t\t\t\tSystem.out.println(allsum);\n\t\t\t\t} else if (j == c) {\n\t\t\t\t\tallsum += csum;\n\t\t\t\t\tSystem.out.println(csum);\n\t\t\t\t} else if (i == r) {\n\t\t\t\t\tSystem.out.print(rsum[j] + \" \");\n\t\t\t\t} else {\n\t\t\t\t\tint val = scan.nextInt();\n\t\t\t\t\tSystem.out.print(val + \" \");\n\t\t\t\t\tcsum += val;\n\t\t\t\t\trsum[j] += val;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tpublic static void main(String[] args) {\n\t\tnew Main().run();\n\t}\n}",
"public class Main {\n\tvoid run() {\n\t\tScanner scan = new Scanner(System.in);\n\t\tint r = scan.nextInt();\n\t\tint c = scan.nextInt();\n\t\tint[] rsum = new int[c];\n\t\tint allsum = 0;\n\t\tfor (int i = 0; i < r + 1; i++) {\n\t\t\tint csum = 0;\n\t\t\tfor (int j = 0; j < c + 1; j++) {\n\t\t\t\tif (i == r && j == c) {\n\t\t\t\t\tSystem.out.println(allsum);\n\t\t\t\t} else if (j == c) {\n\t\t\t\t\tallsum += csum;\n\t\t\t\t\tSystem.out.println(csum);\n\t\t\t\t} else if (i == r) {\n\t\t\t\t\tSystem.out.print(rsum[j] + \" \");\n\t\t\t\t} else {\n\t\t\t\t\tint val = scan.nextInt();\n\t\t\t\t\tSystem.out.print(val + \" \");\n\t\t\t\t\tcsum += val;\n\t\t\t\t\trsum[j] += val;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tpublic static void main(String[] args) {\n\t\tnew Main().run();\n\t}\n}",
"Main"
] | import java.util.Scanner;
public class Main {
void run() {
Scanner scan = new Scanner(System.in);
int r = scan.nextInt();
int c = scan.nextInt();
int[] rsum = new int[c];
int allsum = 0;
for (int i = 0; i < r + 1; i++) {
int csum = 0;
for (int j = 0; j < c + 1; j++) {
if (i == r && j == c) {
System.out.println(allsum);
} else if (j == c) {
allsum += csum;
System.out.println(csum);
} else if (i == r) {
System.out.print(rsum[j] + " ");
} else {
int val = scan.nextInt();
System.out.print(val + " ");
csum += val;
rsum[j] += val;
}
}
}
}
public static void main(String[] args) {
new Main().run();
}
} |
[
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,
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,
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,
30,
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
],
[
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
],
[
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
],
[
110,
112
],
[
109,
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
],
[
126,
128
],
[
128,
129
],
[
129,
130
],
[
129,
131
],
[
128,
132
],
[
109,
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
],
[
153,
155
],
[
152,
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
],
[
171,
172
],
[
172,
173
],
[
172,
174
],
[
171,
175
],
[
152,
176
],
[
176,
177
],
[
177,
178
],
[
178,
179
],
[
178,
180
],
[
177,
181
],
[
176,
182
],
[
14,
183
],
[
183,
184
],
[
184,
185
],
[
185,
186
],
[
185,
187
],
[
183,
188
],
[
188,
189
],
[
188,
190
],
[
183,
191
],
[
191,
192
],
[
192,
193
],
[
183,
194
],
[
195,
195
],
[
195,
196
],
[
196,
197
],
[
197,
198
],
[
198,
199
],
[
198,
200
],
[
196,
201
],
[
201,
202
],
[
201,
203
],
[
196,
204
],
[
204,
205
],
[
205,
206
],
[
196,
207
],
[
208,
208
],
[
208,
209
],
[
209,
210
],
[
210,
211
],
[
211,
212
],
[
211,
213
],
[
209,
214
],
[
214,
215
],
[
215,
216
],
[
215,
217
],
[
214,
218
],
[
208,
219
],
[
219,
220
],
[
220,
221
],
[
220,
222
],
[
219,
223
],
[
223,
224
],
[
224,
225
],
[
225,
226
],
[
226,
227
],
[
226,
228
],
[
224,
229
],
[
219,
230
],
[
230,
231
],
[
231,
232
],
[
232,
233
],
[
233,
234
],
[
233,
235
],
[
231,
236
],
[
12,
237
],
[
237,
238
]
] | [
"import java.io.BufferedReader;\nimport java.io.InputStreamReader;\nimport java.io.IOException;\n\nclass Main{\n\n\tpublic static void main(String[] args) throws IOException{\n\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\t\tString[] token = br.readLine().split(\" \");\n\t\tint row = Integer.parseInt(token[0]);\n\t\tint col = Integer.parseInt(token[1]);\n\t\tint[][] table = new int[row + 1][col + 1];\n\n\t\tfor(int i = 0; i < row; i++){\n\n\t\t\ttoken = br.readLine().split(\" \");\n\n\t\t\tfor(int j = 0; j < col; j++){\n\t\t\t\ttable[i][j] = Integer.parseInt(token[j]);\n\t\t\t}\n\n\t\t}\n\n\t\tfor(int i = 0; i < row; i++){\n\n\t\t\tint sum = 0;\n\n\t\t\tfor(int j = 0; j < col; j++){\n\t\t\t\tsum += table[i][j];\n\t\t\t}\n\n\t\t\ttable[i][col] = sum;\n\n\t\t}\n\n\t\tfor(int i = 0; i <= col; i++){\n\n\t\t\tint sum = 0;\n\n\t\t\tfor(int j = 0; j < row; j++){\n\t\t\t\tsum += table[j][i];\n\t\t\t}\n\n\t\t\ttable[row][i] = sum;\n\n\t\t}\n\n\t\tfor(int i = 0; i <= row; i++){\n\t\t\tfor(int j = 0; j <= col; j++){\n\n\t\t\t\tSystem.out.print(table[i][j]);\n\n\t\t\t\tif(j != col){\n\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t}else{\n\t\t\t\t\tSystem.out.print(\"\\n\");\n\t\t\t\t}\n\n\t\t\t}\n\t\t}\n\n\t}\n}",
"import java.io.BufferedReader;",
"BufferedReader",
"java.io",
"import java.io.InputStreamReader;",
"InputStreamReader",
"java.io",
"import java.io.IOException;",
"IOException",
"java.io",
"class Main{\n\n\tpublic static void main(String[] args) throws IOException{\n\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\t\tString[] token = br.readLine().split(\" \");\n\t\tint row = Integer.parseInt(token[0]);\n\t\tint col = Integer.parseInt(token[1]);\n\t\tint[][] table = new int[row + 1][col + 1];\n\n\t\tfor(int i = 0; i < row; i++){\n\n\t\t\ttoken = br.readLine().split(\" \");\n\n\t\t\tfor(int j = 0; j < col; j++){\n\t\t\t\ttable[i][j] = Integer.parseInt(token[j]);\n\t\t\t}\n\n\t\t}\n\n\t\tfor(int i = 0; i < row; i++){\n\n\t\t\tint sum = 0;\n\n\t\t\tfor(int j = 0; j < col; j++){\n\t\t\t\tsum += table[i][j];\n\t\t\t}\n\n\t\t\ttable[i][col] = sum;\n\n\t\t}\n\n\t\tfor(int i = 0; i <= col; i++){\n\n\t\t\tint sum = 0;\n\n\t\t\tfor(int j = 0; j < row; j++){\n\t\t\t\tsum += table[j][i];\n\t\t\t}\n\n\t\t\ttable[row][i] = sum;\n\n\t\t}\n\n\t\tfor(int i = 0; i <= row; i++){\n\t\t\tfor(int j = 0; j <= col; j++){\n\n\t\t\t\tSystem.out.print(table[i][j]);\n\n\t\t\t\tif(j != col){\n\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t}else{\n\t\t\t\t\tSystem.out.print(\"\\n\");\n\t\t\t\t}\n\n\t\t\t}\n\t\t}\n\n\t}\n}",
"Main",
"public static void main(String[] args) throws IOException{\n\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\t\tString[] token = br.readLine().split(\" \");\n\t\tint row = Integer.parseInt(token[0]);\n\t\tint col = Integer.parseInt(token[1]);\n\t\tint[][] table = new int[row + 1][col + 1];\n\n\t\tfor(int i = 0; i < row; i++){\n\n\t\t\ttoken = br.readLine().split(\" \");\n\n\t\t\tfor(int j = 0; j < col; j++){\n\t\t\t\ttable[i][j] = Integer.parseInt(token[j]);\n\t\t\t}\n\n\t\t}\n\n\t\tfor(int i = 0; i < row; i++){\n\n\t\t\tint sum = 0;\n\n\t\t\tfor(int j = 0; j < col; j++){\n\t\t\t\tsum += table[i][j];\n\t\t\t}\n\n\t\t\ttable[i][col] = sum;\n\n\t\t}\n\n\t\tfor(int i = 0; i <= col; i++){\n\n\t\t\tint sum = 0;\n\n\t\t\tfor(int j = 0; j < row; j++){\n\t\t\t\tsum += table[j][i];\n\t\t\t}\n\n\t\t\ttable[row][i] = sum;\n\n\t\t}\n\n\t\tfor(int i = 0; i <= row; i++){\n\t\t\tfor(int j = 0; j <= col; j++){\n\n\t\t\t\tSystem.out.print(table[i][j]);\n\n\t\t\t\tif(j != col){\n\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t}else{\n\t\t\t\t\tSystem.out.print(\"\\n\");\n\t\t\t\t}\n\n\t\t\t}\n\t\t}\n\n\t}",
"main",
"{\n\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\t\tString[] token = br.readLine().split(\" \");\n\t\tint row = Integer.parseInt(token[0]);\n\t\tint col = Integer.parseInt(token[1]);\n\t\tint[][] table = new int[row + 1][col + 1];\n\n\t\tfor(int i = 0; i < row; i++){\n\n\t\t\ttoken = br.readLine().split(\" \");\n\n\t\t\tfor(int j = 0; j < col; j++){\n\t\t\t\ttable[i][j] = Integer.parseInt(token[j]);\n\t\t\t}\n\n\t\t}\n\n\t\tfor(int i = 0; i < row; i++){\n\n\t\t\tint sum = 0;\n\n\t\t\tfor(int j = 0; j < col; j++){\n\t\t\t\tsum += table[i][j];\n\t\t\t}\n\n\t\t\ttable[i][col] = sum;\n\n\t\t}\n\n\t\tfor(int i = 0; i <= col; i++){\n\n\t\t\tint sum = 0;\n\n\t\t\tfor(int j = 0; j < row; j++){\n\t\t\t\tsum += table[j][i];\n\t\t\t}\n\n\t\t\ttable[row][i] = sum;\n\n\t\t}\n\n\t\tfor(int i = 0; i <= row; i++){\n\t\t\tfor(int j = 0; j <= col; j++){\n\n\t\t\t\tSystem.out.print(table[i][j]);\n\n\t\t\t\tif(j != col){\n\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t}else{\n\t\t\t\t\tSystem.out.print(\"\\n\");\n\t\t\t\t}\n\n\t\t\t}\n\t\t}\n\n\t}",
"BufferedReader br = new BufferedReader(new InputStreamReader(System.in));",
"br",
"new BufferedReader(new InputStreamReader(System.in))",
"String[] token = br.readLine().split(\" \");",
"token",
"br.readLine().split(\" \")",
"br.readLine().split",
"br.readLine()",
"br.readLine",
"br",
"\" \"",
"int row = Integer.parseInt(token[0]);",
"row",
"Integer.parseInt(token[0])",
"Integer.parseInt",
"Integer",
"token[0]",
"token",
"0",
"int col = Integer.parseInt(token[1]);",
"col",
"Integer.parseInt(token[1])",
"Integer.parseInt",
"Integer",
"token[1]",
"token",
"1",
"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\n\t\t\ttoken = br.readLine().split(\" \");\n\n\t\t\tfor(int j = 0; j < col; j++){\n\t\t\t\ttable[i][j] = Integer.parseInt(token[j]);\n\t\t\t}\n\n\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < row",
"i",
"row",
"i++",
"i++",
"i",
"{\n\n\t\t\ttoken = br.readLine().split(\" \");\n\n\t\t\tfor(int j = 0; j < col; j++){\n\t\t\t\ttable[i][j] = Integer.parseInt(token[j]);\n\t\t\t}\n\n\t\t}",
"{\n\n\t\t\ttoken = br.readLine().split(\" \");\n\n\t\t\tfor(int j = 0; j < col; j++){\n\t\t\t\ttable[i][j] = Integer.parseInt(token[j]);\n\t\t\t}\n\n\t\t}",
"token = br.readLine().split(\" \")",
"token",
"br.readLine().split(\" \")",
"br.readLine().split",
"br.readLine()",
"br.readLine",
"br",
"\" \"",
"for(int j = 0; j < col; j++){\n\t\t\t\ttable[i][j] = Integer.parseInt(token[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][j] = Integer.parseInt(token[j]);\n\t\t\t}",
"{\n\t\t\t\ttable[i][j] = Integer.parseInt(token[j]);\n\t\t\t}",
"table[i][j] = Integer.parseInt(token[j])",
"table[i][j]",
"table[i]",
"table",
"i",
"j",
"Integer.parseInt(token[j])",
"Integer.parseInt",
"Integer",
"token[j]",
"token",
"j",
"for(int i = 0; i < row; i++){\n\n\t\t\tint sum = 0;\n\n\t\t\tfor(int j = 0; j < col; j++){\n\t\t\t\tsum += table[i][j];\n\t\t\t}\n\n\t\t\ttable[i][col] = sum;\n\n\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < row",
"i",
"row",
"i++",
"i++",
"i",
"{\n\n\t\t\tint sum = 0;\n\n\t\t\tfor(int j = 0; j < col; j++){\n\t\t\t\tsum += table[i][j];\n\t\t\t}\n\n\t\t\ttable[i][col] = sum;\n\n\t\t}",
"{\n\n\t\t\tint sum = 0;\n\n\t\t\tfor(int j = 0; j < col; j++){\n\t\t\t\tsum += table[i][j];\n\t\t\t}\n\n\t\t\ttable[i][col] = sum;\n\n\t\t}",
"int sum = 0;",
"sum",
"0",
"for(int j = 0; j < col; j++){\n\t\t\t\tsum += 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}",
"{\n\t\t\t\tsum += table[i][j];\n\t\t\t}",
"sum += table[i][j]",
"sum",
"table[i][j]",
"table[i]",
"table",
"i",
"j",
"table[i][col] = sum",
"table[i][col]",
"table[i]",
"table",
"i",
"col",
"sum",
"for(int i = 0; i <= col; i++){\n\n\t\t\tint sum = 0;\n\n\t\t\tfor(int j = 0; j < row; j++){\n\t\t\t\tsum += table[j][i];\n\t\t\t}\n\n\t\t\ttable[row][i] = sum;\n\n\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i <= col",
"i",
"col",
"i++",
"i++",
"i",
"{\n\n\t\t\tint sum = 0;\n\n\t\t\tfor(int j = 0; j < row; j++){\n\t\t\t\tsum += table[j][i];\n\t\t\t}\n\n\t\t\ttable[row][i] = sum;\n\n\t\t}",
"{\n\n\t\t\tint sum = 0;\n\n\t\t\tfor(int j = 0; j < row; j++){\n\t\t\t\tsum += table[j][i];\n\t\t\t}\n\n\t\t\ttable[row][i] = sum;\n\n\t\t}",
"int sum = 0;",
"sum",
"0",
"for(int j = 0; j < row; j++){\n\t\t\t\tsum += 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\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",
"table[row][i] = sum",
"table[row][i]",
"table[row]",
"table",
"row",
"i",
"sum",
"for(int i = 0; i <= row; i++){\n\t\t\tfor(int j = 0; j <= col; j++){\n\n\t\t\t\tSystem.out.print(table[i][j]);\n\n\t\t\t\tif(j != col){\n\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t}else{\n\t\t\t\t\tSystem.out.print(\"\\n\");\n\t\t\t\t}\n\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\n\t\t\t\tSystem.out.print(table[i][j]);\n\n\t\t\t\tif(j != col){\n\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t}else{\n\t\t\t\t\tSystem.out.print(\"\\n\");\n\t\t\t\t}\n\n\t\t\t}\n\t\t}",
"{\n\t\t\tfor(int j = 0; j <= col; j++){\n\n\t\t\t\tSystem.out.print(table[i][j]);\n\n\t\t\t\tif(j != col){\n\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t}else{\n\t\t\t\t\tSystem.out.print(\"\\n\");\n\t\t\t\t}\n\n\t\t\t}\n\t\t}",
"for(int j = 0; j <= col; j++){\n\n\t\t\t\tSystem.out.print(table[i][j]);\n\n\t\t\t\tif(j != col){\n\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t}else{\n\t\t\t\t\tSystem.out.print(\"\\n\");\n\t\t\t\t}\n\n\t\t\t}",
"int j = 0;",
"int j = 0;",
"j",
"0",
"j <= col",
"j",
"col",
"j++",
"j++",
"j",
"{\n\n\t\t\t\tSystem.out.print(table[i][j]);\n\n\t\t\t\tif(j != col){\n\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t}else{\n\t\t\t\t\tSystem.out.print(\"\\n\");\n\t\t\t\t}\n\n\t\t\t}",
"{\n\n\t\t\t\tSystem.out.print(table[i][j]);\n\n\t\t\t\tif(j != col){\n\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t}else{\n\t\t\t\t\tSystem.out.print(\"\\n\");\n\t\t\t\t}\n\n\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(j != col){\n\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t}else{\n\t\t\t\t\tSystem.out.print(\"\\n\");\n\t\t\t\t}",
"j != col",
"j",
"col",
"{\n\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t}",
"System.out.print(\" \")",
"System.out.print",
"System.out",
"System",
"System.out",
"\" \"",
"{\n\t\t\t\t\tSystem.out.print(\"\\n\");\n\t\t\t\t}",
"System.out.print(\"\\n\")",
"System.out.print",
"System.out",
"System",
"System.out",
"\"\\n\"",
"String[] args",
"args"
] | import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.IOException;
class Main{
public static void main(String[] args) throws IOException{
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
String[] token = br.readLine().split(" ");
int row = Integer.parseInt(token[0]);
int col = Integer.parseInt(token[1]);
int[][] table = new int[row + 1][col + 1];
for(int i = 0; i < row; i++){
token = br.readLine().split(" ");
for(int j = 0; j < col; j++){
table[i][j] = Integer.parseInt(token[j]);
}
}
for(int i = 0; i < row; i++){
int sum = 0;
for(int j = 0; j < col; j++){
sum += table[i][j];
}
table[i][col] = sum;
}
for(int i = 0; i <= col; i++){
int sum = 0;
for(int j = 0; j < row; j++){
sum += table[j][i];
}
table[row][i] = sum;
}
for(int i = 0; i <= row; i++){
for(int j = 0; j <= col; j++){
System.out.print(table[i][j]);
if(j != col){
System.out.print(" ");
}else{
System.out.print("\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,
13,
13,
41,
13,
17,
41,
13,
17,
41,
13,
17,
41,
13,
17,
41,
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,
13,
18,
18,
13,
13,
13,
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,
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
],
[
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,
30
],
[
30,
31
],
[
30,
32
],
[
8,
33
],
[
33,
34
],
[
33,
35
],
[
8,
36
],
[
36,
37
],
[
36,
38
],
[
8,
39
],
[
39,
40
],
[
39,
41
],
[
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
],
[
67,
77
],
[
77,
78
],
[
77,
79
],
[
79,
80
],
[
80,
81
],
[
80,
82
],
[
79,
83
],
[
67,
84
],
[
84,
85
],
[
84,
86
],
[
86,
87
],
[
87,
88
],
[
87,
89
],
[
86,
90
],
[
67,
91
],
[
91,
92
],
[
92,
93
],
[
93,
94
],
[
93,
95
],
[
91,
96
],
[
96,
97
],
[
97,
98
],
[
98,
99
],
[
98,
100
],
[
97,
101
],
[
96,
102
],
[
54,
103
],
[
103,
104
],
[
104,
105
],
[
105,
106
],
[
105,
107
],
[
103,
108
],
[
54,
109
],
[
109,
110
],
[
109,
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
],
[
140,
141
],
[
141,
142
],
[
141,
143
],
[
140,
144
],
[
124,
145
],
[
145,
146
],
[
146,
147
],
[
147,
148
],
[
147,
149
],
[
145,
150
],
[
150,
151
],
[
150,
152
],
[
124,
153
],
[
153,
154
],
[
153,
155
],
[
8,
156
],
[
156,
157
],
[
157,
158
],
[
158,
159
],
[
158,
160
],
[
156,
161
],
[
6,
162
],
[
162,
163
]
] | [
"/**\n表計算を行う簡単なプログラムを作成します。\n\n表の行数rと列数c、r × c の要素を持つ表を読み込んで、\n各行と列の合計を挿入した新しい表を出力するプログラムを作成して下さい。\n\n */\n\n/*sucannerクラス使うためにインポート*/\nimport java.util.Scanner;\n\nclass Main {\n\t// プログラムのエントリポイント\n\tpublic static void main(String[] args) {\n\t\t// 入力ストリームの生成\n\t\tScanner sc = new Scanner(System.in);\n\t\tint intR = sc.nextInt();\n\t\tint intC = sc.nextInt();\n\n\t\tint Hyou[][] = new int[intR][intC];\n\t\tint intYokogoukei = 0;\n\t\tint intTategoukei = 0;\n\t\tint i = 0;\n\t\tint j = 0;\n\t\tint intSaigo = 0;\n\t\tfor (i = 0; i < intR; i++) {\n\n\t\t\tfor (j = 0; j < intC; j++) {\n\t\t\t\tHyou[i][j] = sc.nextInt();\n\t\t\t\tintYokogoukei += Hyou[i][j];\n\t\t\t\tintSaigo += Hyou[i][j];\n\t\t\t\tSystem.out.print(Hyou[i][j] + \" \");\n\n\t\t\t}\n\t\t\tSystem.out.println(intYokogoukei);\n\t\t\tintYokogoukei = 0;\n\t\t}\n\t\tfor (int k = 0; k < intC; k++) {\n\t\t\tfor (int l = 0; l < intR; l++) {\n\t\t\t\tintTategoukei += Hyou[l][k];\n\n\t\t\t}\n\t\t\tSystem.out.print(intTategoukei + \" \");\n\t\t\tintTategoukei = 0;\n\t\t}\n\t\tSystem.out.println(intSaigo);\n\n\t}\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"class Main {\n\t// プログラムのエントリポイント\n\tpublic static void main(String[] args) {\n\t\t// 入力ストリームの生成\n\t\tScanner sc = new Scanner(System.in);\n\t\tint intR = sc.nextInt();\n\t\tint intC = sc.nextInt();\n\n\t\tint Hyou[][] = new int[intR][intC];\n\t\tint intYokogoukei = 0;\n\t\tint intTategoukei = 0;\n\t\tint i = 0;\n\t\tint j = 0;\n\t\tint intSaigo = 0;\n\t\tfor (i = 0; i < intR; i++) {\n\n\t\t\tfor (j = 0; j < intC; j++) {\n\t\t\t\tHyou[i][j] = sc.nextInt();\n\t\t\t\tintYokogoukei += Hyou[i][j];\n\t\t\t\tintSaigo += Hyou[i][j];\n\t\t\t\tSystem.out.print(Hyou[i][j] + \" \");\n\n\t\t\t}\n\t\t\tSystem.out.println(intYokogoukei);\n\t\t\tintYokogoukei = 0;\n\t\t}\n\t\tfor (int k = 0; k < intC; k++) {\n\t\t\tfor (int l = 0; l < intR; l++) {\n\t\t\t\tintTategoukei += Hyou[l][k];\n\n\t\t\t}\n\t\t\tSystem.out.print(intTategoukei + \" \");\n\t\t\tintTategoukei = 0;\n\t\t}\n\t\tSystem.out.println(intSaigo);\n\n\t}\n}",
"Main",
"// プログラムのエントリポイント\n\tpublic static void main(String[] args) {\n\t\t// 入力ストリームの生成\n\t\tScanner sc = new Scanner(System.in);\n\t\tint intR = sc.nextInt();\n\t\tint intC = sc.nextInt();\n\n\t\tint Hyou[][] = new int[intR][intC];\n\t\tint intYokogoukei = 0;\n\t\tint intTategoukei = 0;\n\t\tint i = 0;\n\t\tint j = 0;\n\t\tint intSaigo = 0;\n\t\tfor (i = 0; i < intR; i++) {\n\n\t\t\tfor (j = 0; j < intC; j++) {\n\t\t\t\tHyou[i][j] = sc.nextInt();\n\t\t\t\tintYokogoukei += Hyou[i][j];\n\t\t\t\tintSaigo += Hyou[i][j];\n\t\t\t\tSystem.out.print(Hyou[i][j] + \" \");\n\n\t\t\t}\n\t\t\tSystem.out.println(intYokogoukei);\n\t\t\tintYokogoukei = 0;\n\t\t}\n\t\tfor (int k = 0; k < intC; k++) {\n\t\t\tfor (int l = 0; l < intR; l++) {\n\t\t\t\tintTategoukei += Hyou[l][k];\n\n\t\t\t}\n\t\t\tSystem.out.print(intTategoukei + \" \");\n\t\t\tintTategoukei = 0;\n\t\t}\n\t\tSystem.out.println(intSaigo);\n\n\t}",
"main",
"{\n\t\t// 入力ストリームの生成\n\t\tScanner sc = new Scanner(System.in);\n\t\tint intR = sc.nextInt();\n\t\tint intC = sc.nextInt();\n\n\t\tint Hyou[][] = new int[intR][intC];\n\t\tint intYokogoukei = 0;\n\t\tint intTategoukei = 0;\n\t\tint i = 0;\n\t\tint j = 0;\n\t\tint intSaigo = 0;\n\t\tfor (i = 0; i < intR; i++) {\n\n\t\t\tfor (j = 0; j < intC; j++) {\n\t\t\t\tHyou[i][j] = sc.nextInt();\n\t\t\t\tintYokogoukei += Hyou[i][j];\n\t\t\t\tintSaigo += Hyou[i][j];\n\t\t\t\tSystem.out.print(Hyou[i][j] + \" \");\n\n\t\t\t}\n\t\t\tSystem.out.println(intYokogoukei);\n\t\t\tintYokogoukei = 0;\n\t\t}\n\t\tfor (int k = 0; k < intC; k++) {\n\t\t\tfor (int l = 0; l < intR; l++) {\n\t\t\t\tintTategoukei += Hyou[l][k];\n\n\t\t\t}\n\t\t\tSystem.out.print(intTategoukei + \" \");\n\t\t\tintTategoukei = 0;\n\t\t}\n\t\tSystem.out.println(intSaigo);\n\n\t}",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"int intR = sc.nextInt();",
"intR",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int intC = sc.nextInt();",
"intC",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int Hyou[][] = new int[intR][intC];",
"Hyou",
"new int[intR][intC]",
"intR",
"intC",
"int intYokogoukei = 0;",
"intYokogoukei",
"0",
"int intTategoukei = 0;",
"intTategoukei",
"0",
"int i = 0;",
"i",
"0",
"int j = 0;",
"j",
"0",
"int intSaigo = 0;",
"intSaigo",
"0",
"for (i = 0; i < intR; i++) {\n\n\t\t\tfor (j = 0; j < intC; j++) {\n\t\t\t\tHyou[i][j] = sc.nextInt();\n\t\t\t\tintYokogoukei += Hyou[i][j];\n\t\t\t\tintSaigo += Hyou[i][j];\n\t\t\t\tSystem.out.print(Hyou[i][j] + \" \");\n\n\t\t\t}\n\t\t\tSystem.out.println(intYokogoukei);\n\t\t\tintYokogoukei = 0;\n\t\t}",
"i = 0;",
"i = 0",
"i",
"0",
"i < intR",
"i",
"intR",
"i++",
"i++",
"i",
"{\n\n\t\t\tfor (j = 0; j < intC; j++) {\n\t\t\t\tHyou[i][j] = sc.nextInt();\n\t\t\t\tintYokogoukei += Hyou[i][j];\n\t\t\t\tintSaigo += Hyou[i][j];\n\t\t\t\tSystem.out.print(Hyou[i][j] + \" \");\n\n\t\t\t}\n\t\t\tSystem.out.println(intYokogoukei);\n\t\t\tintYokogoukei = 0;\n\t\t}",
"{\n\n\t\t\tfor (j = 0; j < intC; j++) {\n\t\t\t\tHyou[i][j] = sc.nextInt();\n\t\t\t\tintYokogoukei += Hyou[i][j];\n\t\t\t\tintSaigo += Hyou[i][j];\n\t\t\t\tSystem.out.print(Hyou[i][j] + \" \");\n\n\t\t\t}\n\t\t\tSystem.out.println(intYokogoukei);\n\t\t\tintYokogoukei = 0;\n\t\t}",
"for (j = 0; j < intC; j++) {\n\t\t\t\tHyou[i][j] = sc.nextInt();\n\t\t\t\tintYokogoukei += Hyou[i][j];\n\t\t\t\tintSaigo += Hyou[i][j];\n\t\t\t\tSystem.out.print(Hyou[i][j] + \" \");\n\n\t\t\t}",
"j = 0;",
"j = 0",
"j",
"0",
"j < intC",
"j",
"intC",
"j++",
"j++",
"j",
"{\n\t\t\t\tHyou[i][j] = sc.nextInt();\n\t\t\t\tintYokogoukei += Hyou[i][j];\n\t\t\t\tintSaigo += Hyou[i][j];\n\t\t\t\tSystem.out.print(Hyou[i][j] + \" \");\n\n\t\t\t}",
"{\n\t\t\t\tHyou[i][j] = sc.nextInt();\n\t\t\t\tintYokogoukei += Hyou[i][j];\n\t\t\t\tintSaigo += Hyou[i][j];\n\t\t\t\tSystem.out.print(Hyou[i][j] + \" \");\n\n\t\t\t}",
"Hyou[i][j] = sc.nextInt()",
"Hyou[i][j]",
"Hyou[i]",
"Hyou",
"i",
"j",
"sc.nextInt()",
"sc.nextInt",
"sc",
"intYokogoukei += Hyou[i][j]",
"intYokogoukei",
"Hyou[i][j]",
"Hyou[i]",
"Hyou",
"i",
"j",
"intSaigo += Hyou[i][j]",
"intSaigo",
"Hyou[i][j]",
"Hyou[i]",
"Hyou",
"i",
"j",
"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(intYokogoukei)",
"System.out.println",
"System.out",
"System",
"System.out",
"intYokogoukei",
"intYokogoukei = 0",
"intYokogoukei",
"0",
"for (int k = 0; k < intC; k++) {\n\t\t\tfor (int l = 0; l < intR; l++) {\n\t\t\t\tintTategoukei += Hyou[l][k];\n\n\t\t\t}\n\t\t\tSystem.out.print(intTategoukei + \" \");\n\t\t\tintTategoukei = 0;\n\t\t}",
"int k = 0;",
"int k = 0;",
"k",
"0",
"k < intC",
"k",
"intC",
"k++",
"k++",
"k",
"{\n\t\t\tfor (int l = 0; l < intR; l++) {\n\t\t\t\tintTategoukei += Hyou[l][k];\n\n\t\t\t}\n\t\t\tSystem.out.print(intTategoukei + \" \");\n\t\t\tintTategoukei = 0;\n\t\t}",
"{\n\t\t\tfor (int l = 0; l < intR; l++) {\n\t\t\t\tintTategoukei += Hyou[l][k];\n\n\t\t\t}\n\t\t\tSystem.out.print(intTategoukei + \" \");\n\t\t\tintTategoukei = 0;\n\t\t}",
"for (int l = 0; l < intR; l++) {\n\t\t\t\tintTategoukei += Hyou[l][k];\n\n\t\t\t}",
"int l = 0;",
"int l = 0;",
"l",
"0",
"l < intR",
"l",
"intR",
"l++",
"l++",
"l",
"{\n\t\t\t\tintTategoukei += Hyou[l][k];\n\n\t\t\t}",
"{\n\t\t\t\tintTategoukei += Hyou[l][k];\n\n\t\t\t}",
"intTategoukei += Hyou[l][k]",
"intTategoukei",
"Hyou[l][k]",
"Hyou[l]",
"Hyou",
"l",
"k",
"System.out.print(intTategoukei + \" \")",
"System.out.print",
"System.out",
"System",
"System.out",
"intTategoukei + \" \"",
"intTategoukei",
"\" \"",
"intTategoukei = 0",
"intTategoukei",
"0",
"System.out.println(intSaigo)",
"System.out.println",
"System.out",
"System",
"System.out",
"intSaigo",
"String[] args",
"args"
] | /**
表計算を行う簡単なプログラムを作成します。
表の行数rと列数c、r × c の要素を持つ表を読み込んで、
各行と列の合計を挿入した新しい表を出力するプログラムを作成して下さい。
*/
/*sucannerクラス使うためにインポート*/
import java.util.Scanner;
class Main {
// プログラムのエントリポイント
public static void main(String[] args) {
// 入力ストリームの生成
Scanner sc = new Scanner(System.in);
int intR = sc.nextInt();
int intC = sc.nextInt();
int Hyou[][] = new int[intR][intC];
int intYokogoukei = 0;
int intTategoukei = 0;
int i = 0;
int j = 0;
int intSaigo = 0;
for (i = 0; i < intR; i++) {
for (j = 0; j < intC; j++) {
Hyou[i][j] = sc.nextInt();
intYokogoukei += Hyou[i][j];
intSaigo += Hyou[i][j];
System.out.print(Hyou[i][j] + " ");
}
System.out.println(intYokogoukei);
intYokogoukei = 0;
}
for (int k = 0; k < intC; k++) {
for (int l = 0; l < intR; l++) {
intTategoukei += Hyou[l][k];
}
System.out.print(intTategoukei + " ");
intTategoukei = 0;
}
System.out.println(intSaigo);
}
} |
[
7,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
20,
41,
13,
17,
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,
41,
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,
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,
4,
18,
13,
2,
18,
18,
13,
13,
13,
17,
0,
18,
13,
13,
0,
13,
18,
18,
13,
13,
13,
4,
18,
13,
2,
13,
17,
0,
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,
13,
2,
13,
17,
0,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
18,
13,
13,
4,
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
],
[
234,
8
],
[
234,
9
],
[
9,
10
],
[
9,
11
],
[
11,
12
],
[
12,
13
],
[
12,
14
],
[
11,
15
],
[
15,
16
],
[
15,
17
],
[
11,
18
],
[
18,
19
],
[
18,
20
],
[
11,
21
],
[
21,
22
],
[
21,
23
],
[
23,
24
],
[
24,
25
],
[
25,
26
],
[
26,
27
],
[
23,
28
],
[
11,
29
],
[
29,
30
],
[
29,
31
],
[
31,
32
],
[
32,
33
],
[
31,
34
],
[
34,
35
],
[
34,
36
],
[
11,
37
],
[
37,
38
],
[
37,
39
],
[
39,
40
],
[
40,
41
],
[
39,
42
],
[
42,
43
],
[
42,
44
],
[
11,
45
],
[
45,
46
],
[
45,
47
],
[
11,
49
],
[
49,
50
],
[
49,
51
],
[
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
],
[
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
],
[
11,
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
],
[
113,
118
],
[
118,
119
],
[
118,
120
],
[
113,
121
],
[
121,
122
],
[
122,
123
],
[
113,
124
],
[
125,
125
],
[
125,
126
],
[
126,
127
],
[
127,
128
],
[
126,
129
],
[
129,
130
],
[
130,
131
],
[
131,
132
],
[
131,
133
],
[
130,
134
],
[
129,
135
],
[
125,
136
],
[
136,
137
],
[
137,
138
],
[
137,
139
],
[
136,
140
],
[
140,
141
],
[
140,
142
],
[
142,
143
],
[
143,
144
],
[
143,
145
],
[
142,
146
],
[
112,
147
],
[
147,
148
],
[
148,
149
],
[
147,
150
],
[
150,
151
],
[
150,
152
],
[
112,
153
],
[
153,
154
],
[
154,
155
],
[
154,
156
],
[
153,
157
],
[
112,
158
],
[
158,
159
],
[
158,
160
],
[
11,
161
],
[
161,
162
],
[
162,
163
],
[
163,
164
],
[
163,
165
],
[
161,
166
],
[
166,
167
],
[
166,
168
],
[
161,
169
],
[
169,
170
],
[
170,
171
],
[
161,
172
],
[
173,
173
],
[
173,
174
],
[
174,
175
],
[
175,
176
],
[
176,
177
],
[
176,
178
],
[
174,
179
],
[
179,
180
],
[
179,
181
],
[
174,
182
],
[
182,
183
],
[
183,
184
],
[
174,
185
],
[
186,
186
],
[
186,
187
],
[
187,
188
],
[
187,
189
],
[
189,
190
],
[
190,
191
],
[
190,
192
],
[
189,
193
],
[
173,
194
],
[
194,
195
],
[
195,
196
],
[
194,
197
],
[
197,
198
],
[
197,
199
],
[
173,
200
],
[
200,
201
],
[
200,
202
],
[
11,
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
],
[
216,
218
],
[
218,
219
],
[
218,
220
],
[
11,
221
],
[
221,
222
],
[
222,
223
],
[
221,
224
],
[
11,
225
],
[
225,
226
],
[
226,
227
],
[
227,
228
],
[
227,
229
],
[
225,
230
],
[
9,
231
],
[
231,
232
],
[
0,
233
],
[
233,
234
],
[
233,
235
]
] | [
"import java.util.*;\nimport java.lang.StringBuilder;\npublic class Main {\n\tpublic static void main(String[] args) throws Exception{\n\t\tScanner sc = new Scanner(System.in);\n\t\tStringBuilder sb = new StringBuilder();\n\t\tint c = 0;\n\t\tString[] st = sc.nextLine().split(\" \");\n\t\tint h = Integer.parseInt(st[0]);\n\t\tint w = Integer.parseInt(st[1]);\n\t\tint[] t = new int[h];\n\t\tint[][] n = new int [h][w];\n\t\tfor(int i = 0;i < h;i++){\n\t\t\tst = sc.nextLine().split(\" \");\n\t\t\tfor(int k = 0;k < w;k++){\n\t\t\t\tn[i][k] = Integer.parseInt(st[k]);\n\t\t\t}\n\t\t}\n\t\tfor(int i = 0;i < h;i++){\n\t\t\tfor(int k = 0;k < w;k++){\n\t\t\t\tsb.append(n[i][k]+\" \");\n\t\t\t\tt[i] = c += n[i][k];\n\t\t\t}\n\t\t\tsb.append(c+\"\\n\");\n\t\t\tt[i] = c;\n\t\t\tc = 0;\n\t\t}\n\t\tfor(int i = 0;i < w;i++){\n\t\t\tfor(int k = 0;k < h;k++){\n\t\t\t\tc += n[k][i];\n\t\t\t}\n\t\t\tsb.append(c+\" \");\n\t\t\tc = 0;\n\t\t}\n\t\tfor(int i = 0;i < h;i++){\n\t\t\tc += t[i];\n\t\t}\n\t\tsb.append(c);\n\t\tSystem.out.println(sb);\n\t}\n}",
"import java.util.*;",
"util.*",
"java",
"import java.lang.StringBuilder;",
"StringBuilder",
"java.lang",
"public class Main {\n\tpublic static void main(String[] args) throws Exception{\n\t\tScanner sc = new Scanner(System.in);\n\t\tStringBuilder sb = new StringBuilder();\n\t\tint c = 0;\n\t\tString[] st = sc.nextLine().split(\" \");\n\t\tint h = Integer.parseInt(st[0]);\n\t\tint w = Integer.parseInt(st[1]);\n\t\tint[] t = new int[h];\n\t\tint[][] n = new int [h][w];\n\t\tfor(int i = 0;i < h;i++){\n\t\t\tst = sc.nextLine().split(\" \");\n\t\t\tfor(int k = 0;k < w;k++){\n\t\t\t\tn[i][k] = Integer.parseInt(st[k]);\n\t\t\t}\n\t\t}\n\t\tfor(int i = 0;i < h;i++){\n\t\t\tfor(int k = 0;k < w;k++){\n\t\t\t\tsb.append(n[i][k]+\" \");\n\t\t\t\tt[i] = c += n[i][k];\n\t\t\t}\n\t\t\tsb.append(c+\"\\n\");\n\t\t\tt[i] = c;\n\t\t\tc = 0;\n\t\t}\n\t\tfor(int i = 0;i < w;i++){\n\t\t\tfor(int k = 0;k < h;k++){\n\t\t\t\tc += n[k][i];\n\t\t\t}\n\t\t\tsb.append(c+\" \");\n\t\t\tc = 0;\n\t\t}\n\t\tfor(int i = 0;i < h;i++){\n\t\t\tc += t[i];\n\t\t}\n\t\tsb.append(c);\n\t\tSystem.out.println(sb);\n\t}\n}",
"Main",
"public static void main(String[] args) throws Exception{\n\t\tScanner sc = new Scanner(System.in);\n\t\tStringBuilder sb = new StringBuilder();\n\t\tint c = 0;\n\t\tString[] st = sc.nextLine().split(\" \");\n\t\tint h = Integer.parseInt(st[0]);\n\t\tint w = Integer.parseInt(st[1]);\n\t\tint[] t = new int[h];\n\t\tint[][] n = new int [h][w];\n\t\tfor(int i = 0;i < h;i++){\n\t\t\tst = sc.nextLine().split(\" \");\n\t\t\tfor(int k = 0;k < w;k++){\n\t\t\t\tn[i][k] = Integer.parseInt(st[k]);\n\t\t\t}\n\t\t}\n\t\tfor(int i = 0;i < h;i++){\n\t\t\tfor(int k = 0;k < w;k++){\n\t\t\t\tsb.append(n[i][k]+\" \");\n\t\t\t\tt[i] = c += n[i][k];\n\t\t\t}\n\t\t\tsb.append(c+\"\\n\");\n\t\t\tt[i] = c;\n\t\t\tc = 0;\n\t\t}\n\t\tfor(int i = 0;i < w;i++){\n\t\t\tfor(int k = 0;k < h;k++){\n\t\t\t\tc += n[k][i];\n\t\t\t}\n\t\t\tsb.append(c+\" \");\n\t\t\tc = 0;\n\t\t}\n\t\tfor(int i = 0;i < h;i++){\n\t\t\tc += t[i];\n\t\t}\n\t\tsb.append(c);\n\t\tSystem.out.println(sb);\n\t}",
"main",
"{\n\t\tScanner sc = new Scanner(System.in);\n\t\tStringBuilder sb = new StringBuilder();\n\t\tint c = 0;\n\t\tString[] st = sc.nextLine().split(\" \");\n\t\tint h = Integer.parseInt(st[0]);\n\t\tint w = Integer.parseInt(st[1]);\n\t\tint[] t = new int[h];\n\t\tint[][] n = new int [h][w];\n\t\tfor(int i = 0;i < h;i++){\n\t\t\tst = sc.nextLine().split(\" \");\n\t\t\tfor(int k = 0;k < w;k++){\n\t\t\t\tn[i][k] = Integer.parseInt(st[k]);\n\t\t\t}\n\t\t}\n\t\tfor(int i = 0;i < h;i++){\n\t\t\tfor(int k = 0;k < w;k++){\n\t\t\t\tsb.append(n[i][k]+\" \");\n\t\t\t\tt[i] = c += n[i][k];\n\t\t\t}\n\t\t\tsb.append(c+\"\\n\");\n\t\t\tt[i] = c;\n\t\t\tc = 0;\n\t\t}\n\t\tfor(int i = 0;i < w;i++){\n\t\t\tfor(int k = 0;k < h;k++){\n\t\t\t\tc += n[k][i];\n\t\t\t}\n\t\t\tsb.append(c+\" \");\n\t\t\tc = 0;\n\t\t}\n\t\tfor(int i = 0;i < h;i++){\n\t\t\tc += t[i];\n\t\t}\n\t\tsb.append(c);\n\t\tSystem.out.println(sb);\n\t}",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"StringBuilder sb = new StringBuilder();",
"sb",
"new StringBuilder()",
"int c = 0;",
"c",
"0",
"String[] st = sc.nextLine().split(\" \");",
"st",
"sc.nextLine().split(\" \")",
"sc.nextLine().split",
"sc.nextLine()",
"sc.nextLine",
"sc",
"\" \"",
"int h = Integer.parseInt(st[0]);",
"h",
"Integer.parseInt(st[0])",
"Integer.parseInt",
"Integer",
"st[0]",
"st",
"0",
"int w = Integer.parseInt(st[1]);",
"w",
"Integer.parseInt(st[1])",
"Integer.parseInt",
"Integer",
"st[1]",
"st",
"1",
"int[] t = new int[h];",
"t",
"new int[h]",
"h",
"int[][] n = new int [h][w];",
"n",
"new int [h][w]",
"h",
"w",
"for(int i = 0;i < h;i++){\n\t\t\tst = sc.nextLine().split(\" \");\n\t\t\tfor(int k = 0;k < w;k++){\n\t\t\t\tn[i][k] = Integer.parseInt(st[k]);\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\tst = sc.nextLine().split(\" \");\n\t\t\tfor(int k = 0;k < w;k++){\n\t\t\t\tn[i][k] = Integer.parseInt(st[k]);\n\t\t\t}\n\t\t}",
"{\n\t\t\tst = sc.nextLine().split(\" \");\n\t\t\tfor(int k = 0;k < w;k++){\n\t\t\t\tn[i][k] = Integer.parseInt(st[k]);\n\t\t\t}\n\t\t}",
"st = sc.nextLine().split(\" \")",
"st",
"sc.nextLine().split(\" \")",
"sc.nextLine().split",
"sc.nextLine()",
"sc.nextLine",
"sc",
"\" \"",
"for(int k = 0;k < w;k++){\n\t\t\t\tn[i][k] = Integer.parseInt(st[k]);\n\t\t\t}",
"int k = 0;",
"int k = 0;",
"k",
"0",
"k < w",
"k",
"w",
"k++",
"k++",
"k",
"{\n\t\t\t\tn[i][k] = Integer.parseInt(st[k]);\n\t\t\t}",
"{\n\t\t\t\tn[i][k] = Integer.parseInt(st[k]);\n\t\t\t}",
"n[i][k] = Integer.parseInt(st[k])",
"n[i][k]",
"n[i]",
"n",
"i",
"k",
"Integer.parseInt(st[k])",
"Integer.parseInt",
"Integer",
"st[k]",
"st",
"k",
"for(int i = 0;i < h;i++){\n\t\t\tfor(int k = 0;k < w;k++){\n\t\t\t\tsb.append(n[i][k]+\" \");\n\t\t\t\tt[i] = c += n[i][k];\n\t\t\t}\n\t\t\tsb.append(c+\"\\n\");\n\t\t\tt[i] = c;\n\t\t\tc = 0;\n\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < h",
"i",
"h",
"i++",
"i++",
"i",
"{\n\t\t\tfor(int k = 0;k < w;k++){\n\t\t\t\tsb.append(n[i][k]+\" \");\n\t\t\t\tt[i] = c += n[i][k];\n\t\t\t}\n\t\t\tsb.append(c+\"\\n\");\n\t\t\tt[i] = c;\n\t\t\tc = 0;\n\t\t}",
"{\n\t\t\tfor(int k = 0;k < w;k++){\n\t\t\t\tsb.append(n[i][k]+\" \");\n\t\t\t\tt[i] = c += n[i][k];\n\t\t\t}\n\t\t\tsb.append(c+\"\\n\");\n\t\t\tt[i] = c;\n\t\t\tc = 0;\n\t\t}",
"for(int k = 0;k < w;k++){\n\t\t\t\tsb.append(n[i][k]+\" \");\n\t\t\t\tt[i] = c += n[i][k];\n\t\t\t}",
"int k = 0;",
"int k = 0;",
"k",
"0",
"k < w",
"k",
"w",
"k++",
"k++",
"k",
"{\n\t\t\t\tsb.append(n[i][k]+\" \");\n\t\t\t\tt[i] = c += n[i][k];\n\t\t\t}",
"{\n\t\t\t\tsb.append(n[i][k]+\" \");\n\t\t\t\tt[i] = c += n[i][k];\n\t\t\t}",
"sb.append(n[i][k]+\" \")",
"sb.append",
"sb",
"n[i][k]+\" \"",
"n[i][k]",
"n[i]",
"n",
"i",
"k",
"\" \"",
"t[i] = c += n[i][k]",
"t[i]",
"t",
"i",
"c += n[i][k]",
"c",
"n[i][k]",
"n[i]",
"n",
"i",
"k",
"sb.append(c+\"\\n\")",
"sb.append",
"sb",
"c+\"\\n\"",
"c",
"\"\\n\"",
"t[i] = c",
"t[i]",
"t",
"i",
"c",
"c = 0",
"c",
"0",
"for(int i = 0;i < w;i++){\n\t\t\tfor(int k = 0;k < h;k++){\n\t\t\t\tc += n[k][i];\n\t\t\t}\n\t\t\tsb.append(c+\" \");\n\t\t\tc = 0;\n\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < w",
"i",
"w",
"i++",
"i++",
"i",
"{\n\t\t\tfor(int k = 0;k < h;k++){\n\t\t\t\tc += n[k][i];\n\t\t\t}\n\t\t\tsb.append(c+\" \");\n\t\t\tc = 0;\n\t\t}",
"{\n\t\t\tfor(int k = 0;k < h;k++){\n\t\t\t\tc += n[k][i];\n\t\t\t}\n\t\t\tsb.append(c+\" \");\n\t\t\tc = 0;\n\t\t}",
"for(int k = 0;k < h;k++){\n\t\t\t\tc += n[k][i];\n\t\t\t}",
"int k = 0;",
"int k = 0;",
"k",
"0",
"k < h",
"k",
"h",
"k++",
"k++",
"k",
"{\n\t\t\t\tc += n[k][i];\n\t\t\t}",
"{\n\t\t\t\tc += n[k][i];\n\t\t\t}",
"c += n[k][i]",
"c",
"n[k][i]",
"n[k]",
"n",
"k",
"i",
"sb.append(c+\" \")",
"sb.append",
"sb",
"c+\" \"",
"c",
"\" \"",
"c = 0",
"c",
"0",
"for(int i = 0;i < h;i++){\n\t\t\tc += t[i];\n\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < h",
"i",
"h",
"i++",
"i++",
"i",
"{\n\t\t\tc += t[i];\n\t\t}",
"{\n\t\t\tc += t[i];\n\t\t}",
"c += t[i]",
"c",
"t[i]",
"t",
"i",
"sb.append(c)",
"sb.append",
"sb",
"c",
"System.out.println(sb)",
"System.out.println",
"System.out",
"System",
"System.out",
"sb",
"String[] args",
"args",
"public class Main {\n\tpublic static void main(String[] args) throws Exception{\n\t\tScanner sc = new Scanner(System.in);\n\t\tStringBuilder sb = new StringBuilder();\n\t\tint c = 0;\n\t\tString[] st = sc.nextLine().split(\" \");\n\t\tint h = Integer.parseInt(st[0]);\n\t\tint w = Integer.parseInt(st[1]);\n\t\tint[] t = new int[h];\n\t\tint[][] n = new int [h][w];\n\t\tfor(int i = 0;i < h;i++){\n\t\t\tst = sc.nextLine().split(\" \");\n\t\t\tfor(int k = 0;k < w;k++){\n\t\t\t\tn[i][k] = Integer.parseInt(st[k]);\n\t\t\t}\n\t\t}\n\t\tfor(int i = 0;i < h;i++){\n\t\t\tfor(int k = 0;k < w;k++){\n\t\t\t\tsb.append(n[i][k]+\" \");\n\t\t\t\tt[i] = c += n[i][k];\n\t\t\t}\n\t\t\tsb.append(c+\"\\n\");\n\t\t\tt[i] = c;\n\t\t\tc = 0;\n\t\t}\n\t\tfor(int i = 0;i < w;i++){\n\t\t\tfor(int k = 0;k < h;k++){\n\t\t\t\tc += n[k][i];\n\t\t\t}\n\t\t\tsb.append(c+\" \");\n\t\t\tc = 0;\n\t\t}\n\t\tfor(int i = 0;i < h;i++){\n\t\t\tc += t[i];\n\t\t}\n\t\tsb.append(c);\n\t\tSystem.out.println(sb);\n\t}\n}",
"public class Main {\n\tpublic static void main(String[] args) throws Exception{\n\t\tScanner sc = new Scanner(System.in);\n\t\tStringBuilder sb = new StringBuilder();\n\t\tint c = 0;\n\t\tString[] st = sc.nextLine().split(\" \");\n\t\tint h = Integer.parseInt(st[0]);\n\t\tint w = Integer.parseInt(st[1]);\n\t\tint[] t = new int[h];\n\t\tint[][] n = new int [h][w];\n\t\tfor(int i = 0;i < h;i++){\n\t\t\tst = sc.nextLine().split(\" \");\n\t\t\tfor(int k = 0;k < w;k++){\n\t\t\t\tn[i][k] = Integer.parseInt(st[k]);\n\t\t\t}\n\t\t}\n\t\tfor(int i = 0;i < h;i++){\n\t\t\tfor(int k = 0;k < w;k++){\n\t\t\t\tsb.append(n[i][k]+\" \");\n\t\t\t\tt[i] = c += n[i][k];\n\t\t\t}\n\t\t\tsb.append(c+\"\\n\");\n\t\t\tt[i] = c;\n\t\t\tc = 0;\n\t\t}\n\t\tfor(int i = 0;i < w;i++){\n\t\t\tfor(int k = 0;k < h;k++){\n\t\t\t\tc += n[k][i];\n\t\t\t}\n\t\t\tsb.append(c+\" \");\n\t\t\tc = 0;\n\t\t}\n\t\tfor(int i = 0;i < h;i++){\n\t\t\tc += t[i];\n\t\t}\n\t\tsb.append(c);\n\t\tSystem.out.println(sb);\n\t}\n}",
"Main"
] | import java.util.*;
import java.lang.StringBuilder;
public class Main {
public static void main(String[] args) throws Exception{
Scanner sc = new Scanner(System.in);
StringBuilder sb = new StringBuilder();
int c = 0;
String[] st = sc.nextLine().split(" ");
int h = Integer.parseInt(st[0]);
int w = Integer.parseInt(st[1]);
int[] t = new int[h];
int[][] n = new int [h][w];
for(int i = 0;i < h;i++){
st = sc.nextLine().split(" ");
for(int k = 0;k < w;k++){
n[i][k] = Integer.parseInt(st[k]);
}
}
for(int i = 0;i < h;i++){
for(int k = 0;k < w;k++){
sb.append(n[i][k]+" ");
t[i] = c += n[i][k];
}
sb.append(c+"\n");
t[i] = c;
c = 0;
}
for(int i = 0;i < w;i++){
for(int k = 0;k < h;k++){
c += n[k][i];
}
sb.append(c+" ");
c = 0;
}
for(int i = 0;i < h;i++){
c += t[i];
}
sb.append(c);
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,
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,
14,
2,
2,
13,
13,
2,
13,
13,
30,
0,
18,
18,
13,
13,
13,
18,
18,
13,
13,
13,
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,
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,
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
],
[
170,
5
],
[
170,
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
],
[
62,
63
],
[
62,
64
],
[
57,
65
],
[
65,
66
],
[
66,
67
],
[
67,
68
],
[
68,
69
],
[
68,
70
],
[
67,
71
],
[
66,
72
],
[
72,
73
],
[
73,
74
],
[
73,
75
],
[
72,
76
],
[
57,
77
],
[
77,
78
],
[
78,
79
],
[
78,
80
],
[
77,
81
],
[
81,
82
],
[
82,
83
],
[
83,
84
],
[
84,
85
],
[
84,
86
],
[
83,
87
],
[
82,
88
],
[
88,
89
],
[
89,
90
],
[
81,
91
],
[
91,
92
],
[
92,
93
],
[
93,
94
],
[
93,
95
],
[
92,
96
],
[
91,
97
],
[
97,
98
],
[
98,
99
],
[
98,
100
],
[
97,
101
],
[
81,
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
],
[
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
],
[
140,
141
],
[
140,
142
],
[
139,
143
],
[
143,
144
],
[
144,
145
],
[
145,
146
],
[
146,
147
],
[
146,
148
],
[
144,
149
],
[
149,
150
],
[
150,
151
],
[
150,
152
],
[
149,
153
],
[
139,
154
],
[
154,
155
],
[
155,
156
],
[
156,
157
],
[
157,
158
],
[
157,
159
],
[
155,
160
],
[
160,
161
],
[
161,
162
],
[
162,
163
],
[
162,
164
],
[
161,
165
],
[
160,
166
],
[
6,
167
],
[
167,
168
],
[
0,
169
],
[
169,
170
],
[
169,
171
]
] | [
"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 data[][] = new int[r + 1][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\tif( j == c && i != r) {\n\t\t\t\t\tdata[r][c] += data[i][c];\n\t\t\t\t}else if( i != r){\n\t\t\t\t\tdata[i][j] = scan.nextInt();\n\t\t\t\t\tdata[i][c] += data[i][j];\n\t\t\t\t\tdata[r][j] += data[i][j];\n\t\t\t\t}\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\tif( j == c) {\n\t\t\t\t\tSystem.out.println(data[i][j]);\n\t\t\t\t}else {\n\t\t\t\t\tSystem.out.print(data[i][j] + \" \");\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\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\tScanner scan = new Scanner(System.in);\n\t\tint r = scan.nextInt();\n\t\tint c = scan.nextInt();\n\t\tint data[][] = new int[r + 1][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\tif( j == c && i != r) {\n\t\t\t\t\tdata[r][c] += data[i][c];\n\t\t\t\t}else if( i != r){\n\t\t\t\t\tdata[i][j] = scan.nextInt();\n\t\t\t\t\tdata[i][c] += data[i][j];\n\t\t\t\t\tdata[r][j] += data[i][j];\n\t\t\t\t}\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\tif( j == c) {\n\t\t\t\t\tSystem.out.println(data[i][j]);\n\t\t\t\t}else {\n\t\t\t\t\tSystem.out.print(data[i][j] + \" \");\n\t\t\t\t}\n\t\t\t}\n\t\t}\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 r = scan.nextInt();\n\t\tint c = scan.nextInt();\n\t\tint data[][] = new int[r + 1][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\tif( j == c && i != r) {\n\t\t\t\t\tdata[r][c] += data[i][c];\n\t\t\t\t}else if( i != r){\n\t\t\t\t\tdata[i][j] = scan.nextInt();\n\t\t\t\t\tdata[i][c] += data[i][j];\n\t\t\t\t\tdata[r][j] += data[i][j];\n\t\t\t\t}\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\tif( j == c) {\n\t\t\t\t\tSystem.out.println(data[i][j]);\n\t\t\t\t}else {\n\t\t\t\t\tSystem.out.print(data[i][j] + \" \");\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t\n\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 data[][] = new int[r + 1][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\tif( j == c && i != r) {\n\t\t\t\t\tdata[r][c] += data[i][c];\n\t\t\t\t}else if( i != r){\n\t\t\t\t\tdata[i][j] = scan.nextInt();\n\t\t\t\t\tdata[i][c] += data[i][j];\n\t\t\t\t\tdata[r][j] += data[i][j];\n\t\t\t\t}\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\tif( j == c) {\n\t\t\t\t\tSystem.out.println(data[i][j]);\n\t\t\t\t}else {\n\t\t\t\t\tSystem.out.print(data[i][j] + \" \");\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t\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 data[][] = new int[r + 1][c + 1];",
"data",
"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\tif( j == c && i != r) {\n\t\t\t\t\tdata[r][c] += data[i][c];\n\t\t\t\t}else if( i != r){\n\t\t\t\t\tdata[i][j] = scan.nextInt();\n\t\t\t\t\tdata[i][c] += data[i][j];\n\t\t\t\t\tdata[r][j] += data[i][j];\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( j == c && i != r) {\n\t\t\t\t\tdata[r][c] += data[i][c];\n\t\t\t\t}else if( i != r){\n\t\t\t\t\tdata[i][j] = scan.nextInt();\n\t\t\t\t\tdata[i][c] += data[i][j];\n\t\t\t\t\tdata[r][j] += data[i][j];\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( j == c && i != r) {\n\t\t\t\t\tdata[r][c] += data[i][c];\n\t\t\t\t}else if( i != r){\n\t\t\t\t\tdata[i][j] = scan.nextInt();\n\t\t\t\t\tdata[i][c] += data[i][j];\n\t\t\t\t\tdata[r][j] += data[i][j];\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"for(int j = 0; j <= c; j++) {\n\t\t\t\tif( j == c && i != r) {\n\t\t\t\t\tdata[r][c] += data[i][c];\n\t\t\t\t}else if( i != r){\n\t\t\t\t\tdata[i][j] = scan.nextInt();\n\t\t\t\t\tdata[i][c] += data[i][j];\n\t\t\t\t\tdata[r][j] += data[i][j];\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 && i != r) {\n\t\t\t\t\tdata[r][c] += data[i][c];\n\t\t\t\t}else if( i != r){\n\t\t\t\t\tdata[i][j] = scan.nextInt();\n\t\t\t\t\tdata[i][c] += data[i][j];\n\t\t\t\t\tdata[r][j] += data[i][j];\n\t\t\t\t}\n\t\t\t}",
"{\n\t\t\t\tif( j == c && i != r) {\n\t\t\t\t\tdata[r][c] += data[i][c];\n\t\t\t\t}else if( i != r){\n\t\t\t\t\tdata[i][j] = scan.nextInt();\n\t\t\t\t\tdata[i][c] += data[i][j];\n\t\t\t\t\tdata[r][j] += data[i][j];\n\t\t\t\t}\n\t\t\t}",
"if( j == c && i != r) {\n\t\t\t\t\tdata[r][c] += data[i][c];\n\t\t\t\t}else if( i != r){\n\t\t\t\t\tdata[i][j] = scan.nextInt();\n\t\t\t\t\tdata[i][c] += data[i][j];\n\t\t\t\t\tdata[r][j] += data[i][j];\n\t\t\t\t}",
"j == c && i != r",
"j == c",
"j",
"c",
"i != r",
"i",
"r",
"{\n\t\t\t\t\tdata[r][c] += data[i][c];\n\t\t\t\t}",
"data[r][c] += data[i][c]",
"data[r][c]",
"data[r]",
"data",
"r",
"c",
"data[i][c]",
"data[i]",
"data",
"i",
"c",
"if( i != r){\n\t\t\t\t\tdata[i][j] = scan.nextInt();\n\t\t\t\t\tdata[i][c] += data[i][j];\n\t\t\t\t\tdata[r][j] += data[i][j];\n\t\t\t\t}",
"i != r",
"i",
"r",
"{\n\t\t\t\t\tdata[i][j] = scan.nextInt();\n\t\t\t\t\tdata[i][c] += data[i][j];\n\t\t\t\t\tdata[r][j] += data[i][j];\n\t\t\t\t}",
"data[i][j] = scan.nextInt()",
"data[i][j]",
"data[i]",
"data",
"i",
"j",
"scan.nextInt()",
"scan.nextInt",
"scan",
"data[i][c] += data[i][j]",
"data[i][c]",
"data[i]",
"data",
"i",
"c",
"data[i][j]",
"data[i]",
"data",
"i",
"j",
"data[r][j] += data[i][j]",
"data[r][j]",
"data[r]",
"data",
"r",
"j",
"data[i][j]",
"data[i]",
"data",
"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 == c) {\n\t\t\t\t\tSystem.out.println(data[i][j]);\n\t\t\t\t}else {\n\t\t\t\t\tSystem.out.print(data[i][j] + \" \");\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( j == c) {\n\t\t\t\t\tSystem.out.println(data[i][j]);\n\t\t\t\t}else {\n\t\t\t\t\tSystem.out.print(data[i][j] + \" \");\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( j == c) {\n\t\t\t\t\tSystem.out.println(data[i][j]);\n\t\t\t\t}else {\n\t\t\t\t\tSystem.out.print(data[i][j] + \" \");\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"for(int j = 0; j <= c; j++) {\n\t\t\t\tif( j == c) {\n\t\t\t\t\tSystem.out.println(data[i][j]);\n\t\t\t\t}else {\n\t\t\t\t\tSystem.out.print(data[i][j] + \" \");\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\tSystem.out.println(data[i][j]);\n\t\t\t\t}else {\n\t\t\t\t\tSystem.out.print(data[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.println(data[i][j]);\n\t\t\t\t}else {\n\t\t\t\t\tSystem.out.print(data[i][j] + \" \");\n\t\t\t\t}\n\t\t\t}",
"if( j == c) {\n\t\t\t\t\tSystem.out.println(data[i][j]);\n\t\t\t\t}else {\n\t\t\t\t\tSystem.out.print(data[i][j] + \" \");\n\t\t\t\t}",
"j == c",
"j",
"c",
"{\n\t\t\t\t\tSystem.out.println(data[i][j]);\n\t\t\t\t}",
"System.out.println(data[i][j])",
"System.out.println",
"System.out",
"System",
"System.out",
"data[i][j]",
"data[i]",
"data",
"i",
"j",
"{\n\t\t\t\t\tSystem.out.print(data[i][j] + \" \");\n\t\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",
"\" \"",
"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 data[][] = new int[r + 1][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\tif( j == c && i != r) {\n\t\t\t\t\tdata[r][c] += data[i][c];\n\t\t\t\t}else if( i != r){\n\t\t\t\t\tdata[i][j] = scan.nextInt();\n\t\t\t\t\tdata[i][c] += data[i][j];\n\t\t\t\t\tdata[r][j] += data[i][j];\n\t\t\t\t}\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\tif( j == c) {\n\t\t\t\t\tSystem.out.println(data[i][j]);\n\t\t\t\t}else {\n\t\t\t\t\tSystem.out.print(data[i][j] + \" \");\n\t\t\t\t}\n\t\t\t}\n\t\t}\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 r = scan.nextInt();\n\t\tint c = scan.nextInt();\n\t\tint data[][] = new int[r + 1][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\tif( j == c && i != r) {\n\t\t\t\t\tdata[r][c] += data[i][c];\n\t\t\t\t}else if( i != r){\n\t\t\t\t\tdata[i][j] = scan.nextInt();\n\t\t\t\t\tdata[i][c] += data[i][j];\n\t\t\t\t\tdata[r][j] += data[i][j];\n\t\t\t\t}\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\tif( j == c) {\n\t\t\t\t\tSystem.out.println(data[i][j]);\n\t\t\t\t}else {\n\t\t\t\t\tSystem.out.print(data[i][j] + \" \");\n\t\t\t\t}\n\t\t\t}\n\t\t}\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 r = scan.nextInt();
int c = scan.nextInt();
int data[][] = new int[r + 1][c + 1];
for(int i = 0; i <= r; i++) {
for(int j = 0; j <= c; j++) {
if( j == c && i != r) {
data[r][c] += data[i][c];
}else if( i != r){
data[i][j] = scan.nextInt();
data[i][c] += data[i][j];
data[r][j] += data[i][j];
}
}
}
for(int i = 0; i <= r; i++) {
for(int j = 0; j <= c; j++) {
if( j == c) {
System.out.println(data[i][j]);
}else {
System.out.print(data[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,
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
],
[
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
],
[
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\tpublic static void main(String[]args){\n \tScanner sc = new Scanner(System.in);\n \tint x = sc.nextInt();\n \tint y = sc.nextInt();\n \tint table[][] = new int[x+1][y+1];\n \n \tfor(int i = 0; i < x; i++){\n \t\tfor(int j = 0; j < y; j++){\n \t\ttable[i][j] = sc.nextInt();\n \t\ttable[i][y]+=table[i][j];\n \t\ttable[x][j]+=table[i][j];\n \t\t\ttable[x][y]+=table[i][j];\n \t\t}\n \t}\n \n \tfor(int i = 0; i < x+1; i++){\n \t\tfor(int j = 0; j < y+1; j++){\n \t\tSystem.out.print(table[i][j]);\n \t\tif(j != y){\n\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t}\n \t\t}\n \tSystem.out.println();\n \t}\n \t}\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"class Main{\n\tpublic static void main(String[]args){\n \tScanner sc = new Scanner(System.in);\n \tint x = sc.nextInt();\n \tint y = sc.nextInt();\n \tint table[][] = new int[x+1][y+1];\n \n \tfor(int i = 0; i < x; i++){\n \t\tfor(int j = 0; j < y; j++){\n \t\ttable[i][j] = sc.nextInt();\n \t\ttable[i][y]+=table[i][j];\n \t\ttable[x][j]+=table[i][j];\n \t\t\ttable[x][y]+=table[i][j];\n \t\t}\n \t}\n \n \tfor(int i = 0; i < x+1; i++){\n \t\tfor(int j = 0; j < y+1; j++){\n \t\tSystem.out.print(table[i][j]);\n \t\tif(j != y){\n\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t}\n \t\t}\n \tSystem.out.println();\n \t}\n \t}\n}",
"Main",
"public static void main(String[]args){\n \tScanner sc = new Scanner(System.in);\n \tint x = sc.nextInt();\n \tint y = sc.nextInt();\n \tint table[][] = new int[x+1][y+1];\n \n \tfor(int i = 0; i < x; i++){\n \t\tfor(int j = 0; j < y; j++){\n \t\ttable[i][j] = sc.nextInt();\n \t\ttable[i][y]+=table[i][j];\n \t\ttable[x][j]+=table[i][j];\n \t\t\ttable[x][y]+=table[i][j];\n \t\t}\n \t}\n \n \tfor(int i = 0; i < x+1; i++){\n \t\tfor(int j = 0; j < y+1; j++){\n \t\tSystem.out.print(table[i][j]);\n \t\tif(j != y){\n\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t}\n \t\t}\n \tSystem.out.println();\n \t}\n \t}",
"main",
"{\n \tScanner sc = new Scanner(System.in);\n \tint x = sc.nextInt();\n \tint y = sc.nextInt();\n \tint table[][] = new int[x+1][y+1];\n \n \tfor(int i = 0; i < x; i++){\n \t\tfor(int j = 0; j < y; j++){\n \t\ttable[i][j] = sc.nextInt();\n \t\ttable[i][y]+=table[i][j];\n \t\ttable[x][j]+=table[i][j];\n \t\t\ttable[x][y]+=table[i][j];\n \t\t}\n \t}\n \n \tfor(int i = 0; i < x+1; i++){\n \t\tfor(int j = 0; j < y+1; j++){\n \t\tSystem.out.print(table[i][j]);\n \t\tif(j != y){\n\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t}\n \t\t}\n \tSystem.out.println();\n \t}\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 table[][] = new int[x+1][y+1];",
"table",
"new int[x+1][y+1]",
"x+1",
"x",
"1",
"y+1",
"y",
"1",
"for(int i = 0; i < x; i++){\n \t\tfor(int j = 0; j < y; j++){\n \t\ttable[i][j] = sc.nextInt();\n \t\ttable[i][y]+=table[i][j];\n \t\ttable[x][j]+=table[i][j];\n \t\t\ttable[x][y]+=table[i][j];\n \t\t}\n \t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < x",
"i",
"x",
"i++",
"i++",
"i",
"{\n \t\tfor(int j = 0; j < y; j++){\n \t\ttable[i][j] = sc.nextInt();\n \t\ttable[i][y]+=table[i][j];\n \t\ttable[x][j]+=table[i][j];\n \t\t\ttable[x][y]+=table[i][j];\n \t\t}\n \t}",
"{\n \t\tfor(int j = 0; j < y; j++){\n \t\ttable[i][j] = sc.nextInt();\n \t\ttable[i][y]+=table[i][j];\n \t\ttable[x][j]+=table[i][j];\n \t\t\ttable[x][y]+=table[i][j];\n \t\t}\n \t}",
"for(int j = 0; j < y; j++){\n \t\ttable[i][j] = sc.nextInt();\n \t\ttable[i][y]+=table[i][j];\n \t\ttable[x][j]+=table[i][j];\n \t\t\ttable[x][y]+=table[i][j];\n \t\t}",
"int j = 0;",
"int j = 0;",
"j",
"0",
"j < y",
"j",
"y",
"j++",
"j++",
"j",
"{\n \t\ttable[i][j] = sc.nextInt();\n \t\ttable[i][y]+=table[i][j];\n \t\ttable[x][j]+=table[i][j];\n \t\t\ttable[x][y]+=table[i][j];\n \t\t}",
"{\n \t\ttable[i][j] = sc.nextInt();\n \t\ttable[i][y]+=table[i][j];\n \t\ttable[x][j]+=table[i][j];\n \t\t\ttable[x][y]+=table[i][j];\n \t\t}",
"table[i][j] = sc.nextInt()",
"table[i][j]",
"table[i]",
"table",
"i",
"j",
"sc.nextInt()",
"sc.nextInt",
"sc",
"table[i][y]+=table[i][j]",
"table[i][y]",
"table[i]",
"table",
"i",
"y",
"table[i][j]",
"table[i]",
"table",
"i",
"j",
"table[x][j]+=table[i][j]",
"table[x][j]",
"table[x]",
"table",
"x",
"j",
"table[i][j]",
"table[i]",
"table",
"i",
"j",
"table[x][y]+=table[i][j]",
"table[x][y]",
"table[x]",
"table",
"x",
"y",
"table[i][j]",
"table[i]",
"table",
"i",
"j",
"for(int i = 0; i < x+1; i++){\n \t\tfor(int j = 0; j < y+1; j++){\n \t\tSystem.out.print(table[i][j]);\n \t\tif(j != y){\n\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t}\n \t\t}\n \tSystem.out.println();\n \t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < x+1",
"i",
"x+1",
"x",
"1",
"i++",
"i++",
"i",
"{\n \t\tfor(int j = 0; j < y+1; j++){\n \t\tSystem.out.print(table[i][j]);\n \t\tif(j != y){\n\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t}\n \t\t}\n \tSystem.out.println();\n \t}",
"{\n \t\tfor(int j = 0; j < y+1; j++){\n \t\tSystem.out.print(table[i][j]);\n \t\tif(j != y){\n\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t}\n \t\t}\n \tSystem.out.println();\n \t}",
"for(int j = 0; j < y+1; j++){\n \t\tSystem.out.print(table[i][j]);\n \t\tif(j != y){\n\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t}\n \t\t}",
"int j = 0;",
"int j = 0;",
"j",
"0",
"j < y+1",
"j",
"y+1",
"y",
"1",
"j++",
"j++",
"j",
"{\n \t\tSystem.out.print(table[i][j]);\n \t\tif(j != y){\n\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t}\n \t\t}",
"{\n \t\tSystem.out.print(table[i][j]);\n \t\tif(j != y){\n\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t}\n \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(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",
"String[]args",
"args"
] | import java.util.Scanner;
class Main{
public static void main(String[]args){
Scanner sc = new Scanner(System.in);
int x = sc.nextInt();
int y = sc.nextInt();
int table[][] = new int[x+1][y+1];
for(int i = 0; i < x; i++){
for(int j = 0; j < y; j++){
table[i][j] = sc.nextInt();
table[i][y]+=table[i][j];
table[x][j]+=table[i][j];
table[x][y]+=table[i][j];
}
}
for(int i = 0; i < x+1; i++){
for(int j = 0; j < y+1; j++){
System.out.print(table[i][j]);
if(j != y){
System.out.print(" ");
}
}
System.out.println();
}
}
} |
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
20,
41,
13,
20,
18,
13,
17,
18,
13,
17,
11,
1,
41,
13,
17,
2,
13,
18,
13,
17,
1,
40,
13,
30,
30,
11,
1,
41,
13,
17,
2,
13,
18,
13,
17,
1,
40,
13,
30,
30,
0,
18,
18,
13,
13,
13,
4,
18,
13,
4,
13,
13,
23,
13,
12,
13,
30,
41,
13,
20,
11,
1,
41,
13,
17,
2,
13,
18,
13,
13,
1,
40,
13,
30,
30,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
18,
18,
13,
13,
13,
1,
40,
13,
30,
30,
4,
18,
13,
18,
18,
13,
13,
13,
14,
2,
13,
2,
18,
18,
13,
13,
13,
17,
30,
4,
18,
13,
17,
0,
13,
18,
18,
13,
13,
13,
4,
18,
4,
18,
13,
17,
13,
4,
18,
13,
17,
41,
13,
17,
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,
18,
18,
13,
13,
13,
4,
18,
13,
13,
14,
2,
13,
2,
18,
18,
13,
17,
13,
17,
30,
4,
18,
13,
17,
0,
13,
13,
4,
18,
4,
18,
13,
17,
13,
4,
18,
18,
13,
13,
13,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
233,
5
],
[
233,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
8,
15
],
[
15,
16
],
[
15,
17
],
[
18,
19
],
[
18,
20
],
[
21,
22
],
[
21,
23
],
[
8,
24
],
[
24,
25
],
[
25,
26
],
[
26,
27
],
[
26,
28
],
[
24,
29
],
[
29,
30
],
[
29,
31
],
[
31,
32
],
[
31,
33
],
[
24,
34
],
[
34,
35
],
[
35,
36
],
[
24,
37
],
[
38,
38
],
[
38,
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
],
[
55,
59
],
[
54,
60
],
[
60,
61
],
[
61,
62
],
[
8,
63
],
[
63,
64
],
[
63,
65
],
[
6,
66
],
[
66,
67
],
[
233,
68
],
[
68,
69
],
[
68,
70
],
[
70,
71
],
[
71,
72
],
[
71,
73
],
[
70,
74
],
[
74,
75
],
[
75,
76
],
[
76,
77
],
[
76,
78
],
[
74,
79
],
[
79,
80
],
[
79,
81
],
[
81,
82
],
[
81,
83
],
[
74,
84
],
[
84,
85
],
[
85,
86
],
[
74,
87
],
[
88,
88
],
[
88,
89
],
[
89,
90
],
[
89,
91
],
[
88,
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
],
[
109,
112
],
[
112,
113
],
[
113,
114
],
[
113,
115
],
[
112,
116
],
[
108,
117
],
[
117,
118
],
[
118,
119
],
[
118,
120
],
[
120,
121
],
[
121,
122
],
[
122,
123
],
[
122,
124
],
[
121,
125
],
[
120,
126
],
[
117,
127
],
[
127,
128
],
[
128,
129
],
[
129,
130
],
[
128,
131
],
[
108,
132
],
[
132,
133
],
[
132,
134
],
[
134,
135
],
[
135,
136
],
[
135,
137
],
[
134,
138
],
[
88,
139
],
[
139,
140
],
[
140,
141
],
[
141,
142
],
[
142,
143
],
[
141,
144
],
[
139,
145
],
[
88,
146
],
[
146,
147
],
[
147,
148
],
[
146,
149
],
[
70,
150
],
[
150,
151
],
[
150,
152
],
[
70,
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
],
[
169,
173
],
[
173,
174
],
[
174,
175
],
[
175,
176
],
[
175,
177
],
[
173,
178
],
[
178,
179
],
[
178,
180
],
[
180,
181
],
[
180,
182
],
[
173,
183
],
[
183,
184
],
[
184,
185
],
[
173,
186
],
[
187,
187
],
[
187,
188
],
[
188,
189
],
[
188,
190
],
[
190,
191
],
[
191,
192
],
[
191,
193
],
[
190,
194
],
[
169,
195
],
[
195,
196
],
[
196,
197
],
[
195,
198
],
[
169,
199
],
[
199,
200
],
[
200,
201
],
[
200,
202
],
[
202,
203
],
[
203,
204
],
[
204,
205
],
[
204,
206
],
[
203,
207
],
[
202,
208
],
[
199,
209
],
[
209,
210
],
[
210,
211
],
[
211,
212
],
[
210,
213
],
[
169,
214
],
[
214,
215
],
[
214,
216
],
[
70,
217
],
[
217,
218
],
[
218,
219
],
[
219,
220
],
[
220,
221
],
[
219,
222
],
[
217,
223
],
[
70,
224
],
[
224,
225
],
[
225,
226
],
[
226,
227
],
[
226,
228
],
[
224,
229
],
[
68,
230
],
[
230,
231
],
[
0,
232
],
[
232,
233
],
[
232,
234
]
] | [
"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[] a = new int[]{sc.nextInt(), sc.nextInt()};\n int[][] m = new int[a[0]][a[1]];\n for (int i = 0; i < a[0]; i++) {\n for (int j = 0; j < a[1]; j++) {\n m[i][j] = sc.nextInt();\n }\n }\n print2DArray(m);\n }\n\n private static void print2DArray(int[][] array) {\n StringBuilder sb = new StringBuilder();\n for (int i = 0; i < array.length; i++) {\n int sum = 0;\n for (int j = 0; j < array[i].length; j++) {\n sb.append(array[i][j]);\n if (j != array[i].length - 1) {\n sb.append(\" \");\n }\n sum += array[i][j];\n }\n sb.append(\" \").append(sum);\n sb.append(\"\\n\");\n }\n int allsum = 0;\n for (int i = 0; i < array[0].length; i++) {\n int sum = 0;\n for (int j = 0; j < array.length; j++) {\n sum += array[j][i];\n }\n sb.append(sum);\n if (i != array[0].length - 1) {\n sb.append(\" \");\n }\n allsum += sum;\n }\n sb.append(\" \").append(allsum);\n System.out.println(sb);\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[] a = new int[]{sc.nextInt(), sc.nextInt()};\n int[][] m = new int[a[0]][a[1]];\n for (int i = 0; i < a[0]; i++) {\n for (int j = 0; j < a[1]; j++) {\n m[i][j] = sc.nextInt();\n }\n }\n print2DArray(m);\n }\n\n private static void print2DArray(int[][] array) {\n StringBuilder sb = new StringBuilder();\n for (int i = 0; i < array.length; i++) {\n int sum = 0;\n for (int j = 0; j < array[i].length; j++) {\n sb.append(array[i][j]);\n if (j != array[i].length - 1) {\n sb.append(\" \");\n }\n sum += array[i][j];\n }\n sb.append(\" \").append(sum);\n sb.append(\"\\n\");\n }\n int allsum = 0;\n for (int i = 0; i < array[0].length; i++) {\n int sum = 0;\n for (int j = 0; j < array.length; j++) {\n sum += array[j][i];\n }\n sb.append(sum);\n if (i != array[0].length - 1) {\n sb.append(\" \");\n }\n allsum += sum;\n }\n sb.append(\" \").append(allsum);\n System.out.println(sb);\n }\n}",
"Main",
"public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n int[] a = new int[]{sc.nextInt(), sc.nextInt()};\n int[][] m = new int[a[0]][a[1]];\n for (int i = 0; i < a[0]; i++) {\n for (int j = 0; j < a[1]; j++) {\n m[i][j] = sc.nextInt();\n }\n }\n print2DArray(m);\n }",
"main",
"{\n Scanner sc = new Scanner(System.in);\n int[] a = new int[]{sc.nextInt(), sc.nextInt()};\n int[][] m = new int[a[0]][a[1]];\n for (int i = 0; i < a[0]; i++) {\n for (int j = 0; j < a[1]; j++) {\n m[i][j] = sc.nextInt();\n }\n }\n print2DArray(m);\n }",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"int[] a = new int[]{sc.nextInt(), sc.nextInt()};",
"a",
"new int[]{sc.nextInt(), sc.nextInt()}",
"int[][] m = new int[a[0]][a[1]];",
"m",
"new int[a[0]][a[1]]",
"a[0]",
"a",
"0",
"a[1]",
"a",
"1",
"for (int i = 0; i < a[0]; i++) {\n for (int j = 0; j < a[1]; j++) {\n m[i][j] = sc.nextInt();\n }\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < a[0]",
"i",
"a[0]",
"a",
"0",
"i++",
"i++",
"i",
"{\n for (int j = 0; j < a[1]; j++) {\n m[i][j] = sc.nextInt();\n }\n }",
"{\n for (int j = 0; j < a[1]; j++) {\n m[i][j] = sc.nextInt();\n }\n }",
"for (int j = 0; j < a[1]; j++) {\n m[i][j] = sc.nextInt();\n }",
"int j = 0;",
"int j = 0;",
"j",
"0",
"j < a[1]",
"j",
"a[1]",
"a",
"1",
"j++",
"j++",
"j",
"{\n m[i][j] = sc.nextInt();\n }",
"{\n m[i][j] = sc.nextInt();\n }",
"m[i][j] = sc.nextInt()",
"m[i][j]",
"m[i]",
"m",
"i",
"j",
"sc.nextInt()",
"sc.nextInt",
"sc",
"print2DArray(m)",
"print2DArray",
"m",
"String[] args",
"args",
"private static void print2DArray(int[][] array) {\n StringBuilder sb = new StringBuilder();\n for (int i = 0; i < array.length; i++) {\n int sum = 0;\n for (int j = 0; j < array[i].length; j++) {\n sb.append(array[i][j]);\n if (j != array[i].length - 1) {\n sb.append(\" \");\n }\n sum += array[i][j];\n }\n sb.append(\" \").append(sum);\n sb.append(\"\\n\");\n }\n int allsum = 0;\n for (int i = 0; i < array[0].length; i++) {\n int sum = 0;\n for (int j = 0; j < array.length; j++) {\n sum += array[j][i];\n }\n sb.append(sum);\n if (i != array[0].length - 1) {\n sb.append(\" \");\n }\n allsum += sum;\n }\n sb.append(\" \").append(allsum);\n System.out.println(sb);\n }",
"print2DArray",
"{\n StringBuilder sb = new StringBuilder();\n for (int i = 0; i < array.length; i++) {\n int sum = 0;\n for (int j = 0; j < array[i].length; j++) {\n sb.append(array[i][j]);\n if (j != array[i].length - 1) {\n sb.append(\" \");\n }\n sum += array[i][j];\n }\n sb.append(\" \").append(sum);\n sb.append(\"\\n\");\n }\n int allsum = 0;\n for (int i = 0; i < array[0].length; i++) {\n int sum = 0;\n for (int j = 0; j < array.length; j++) {\n sum += array[j][i];\n }\n sb.append(sum);\n if (i != array[0].length - 1) {\n sb.append(\" \");\n }\n allsum += sum;\n }\n sb.append(\" \").append(allsum);\n System.out.println(sb);\n }",
"StringBuilder sb = new StringBuilder();",
"sb",
"new StringBuilder()",
"for (int i = 0; i < array.length; i++) {\n int sum = 0;\n for (int j = 0; j < array[i].length; j++) {\n sb.append(array[i][j]);\n if (j != array[i].length - 1) {\n sb.append(\" \");\n }\n sum += array[i][j];\n }\n sb.append(\" \").append(sum);\n sb.append(\"\\n\");\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < array.length",
"i",
"array.length",
"array",
"array.length",
"i++",
"i++",
"i",
"{\n int sum = 0;\n for (int j = 0; j < array[i].length; j++) {\n sb.append(array[i][j]);\n if (j != array[i].length - 1) {\n sb.append(\" \");\n }\n sum += array[i][j];\n }\n sb.append(\" \").append(sum);\n sb.append(\"\\n\");\n }",
"{\n int sum = 0;\n for (int j = 0; j < array[i].length; j++) {\n sb.append(array[i][j]);\n if (j != array[i].length - 1) {\n sb.append(\" \");\n }\n sum += array[i][j];\n }\n sb.append(\" \").append(sum);\n sb.append(\"\\n\");\n }",
"int sum = 0;",
"sum",
"0",
"for (int j = 0; j < array[i].length; j++) {\n sb.append(array[i][j]);\n if (j != array[i].length - 1) {\n sb.append(\" \");\n }\n sum += array[i][j];\n }",
"int j = 0;",
"int j = 0;",
"j",
"0",
"j < array[i].length",
"j",
"array[i].length",
"array[i]",
"array",
"i",
"array[i].length",
"j++",
"j++",
"j",
"{\n sb.append(array[i][j]);\n if (j != array[i].length - 1) {\n sb.append(\" \");\n }\n sum += array[i][j];\n }",
"{\n sb.append(array[i][j]);\n if (j != array[i].length - 1) {\n sb.append(\" \");\n }\n sum += array[i][j];\n }",
"sb.append(array[i][j])",
"sb.append",
"sb",
"array[i][j]",
"array[i]",
"array",
"i",
"j",
"if (j != array[i].length - 1) {\n sb.append(\" \");\n }",
"j != array[i].length - 1",
"j",
"array[i].length - 1",
"array[i].length",
"array[i]",
"array",
"i",
"array[i].length",
"1",
"{\n sb.append(\" \");\n }",
"sb.append(\" \")",
"sb.append",
"sb",
"\" \"",
"sum += array[i][j]",
"sum",
"array[i][j]",
"array[i]",
"array",
"i",
"j",
"sb.append(\" \").append(sum)",
"sb.append(\" \").append",
"sb.append(\" \")",
"sb.append",
"sb",
"\" \"",
"sum",
"sb.append(\"\\n\")",
"sb.append",
"sb",
"\"\\n\"",
"int allsum = 0;",
"allsum",
"0",
"for (int i = 0; i < array[0].length; i++) {\n int sum = 0;\n for (int j = 0; j < array.length; j++) {\n sum += array[j][i];\n }\n sb.append(sum);\n if (i != array[0].length - 1) {\n sb.append(\" \");\n }\n allsum += sum;\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < array[0].length",
"i",
"array[0].length",
"array[0]",
"array",
"0",
"array[0].length",
"i++",
"i++",
"i",
"{\n int sum = 0;\n for (int j = 0; j < array.length; j++) {\n sum += array[j][i];\n }\n sb.append(sum);\n if (i != array[0].length - 1) {\n sb.append(\" \");\n }\n allsum += sum;\n }",
"{\n int sum = 0;\n for (int j = 0; j < array.length; j++) {\n sum += array[j][i];\n }\n sb.append(sum);\n if (i != array[0].length - 1) {\n sb.append(\" \");\n }\n allsum += sum;\n }",
"int sum = 0;",
"sum",
"0",
"for (int j = 0; j < array.length; j++) {\n sum += array[j][i];\n }",
"int j = 0;",
"int j = 0;",
"j",
"0",
"j < array.length",
"j",
"array.length",
"array",
"array.length",
"j++",
"j++",
"j",
"{\n sum += array[j][i];\n }",
"{\n sum += array[j][i];\n }",
"sum += array[j][i]",
"sum",
"array[j][i]",
"array[j]",
"array",
"j",
"i",
"sb.append(sum)",
"sb.append",
"sb",
"sum",
"if (i != array[0].length - 1) {\n sb.append(\" \");\n }",
"i != array[0].length - 1",
"i",
"array[0].length - 1",
"array[0].length",
"array[0]",
"array",
"0",
"array[0].length",
"1",
"{\n sb.append(\" \");\n }",
"sb.append(\" \")",
"sb.append",
"sb",
"\" \"",
"allsum += sum",
"allsum",
"sum",
"sb.append(\" \").append(allsum)",
"sb.append(\" \").append",
"sb.append(\" \")",
"sb.append",
"sb",
"\" \"",
"allsum",
"System.out.println(sb)",
"System.out.println",
"System.out",
"System",
"System.out",
"sb",
"int[][] array",
"array",
"public class Main {\n\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n int[] a = new int[]{sc.nextInt(), sc.nextInt()};\n int[][] m = new int[a[0]][a[1]];\n for (int i = 0; i < a[0]; i++) {\n for (int j = 0; j < a[1]; j++) {\n m[i][j] = sc.nextInt();\n }\n }\n print2DArray(m);\n }\n\n private static void print2DArray(int[][] array) {\n StringBuilder sb = new StringBuilder();\n for (int i = 0; i < array.length; i++) {\n int sum = 0;\n for (int j = 0; j < array[i].length; j++) {\n sb.append(array[i][j]);\n if (j != array[i].length - 1) {\n sb.append(\" \");\n }\n sum += array[i][j];\n }\n sb.append(\" \").append(sum);\n sb.append(\"\\n\");\n }\n int allsum = 0;\n for (int i = 0; i < array[0].length; i++) {\n int sum = 0;\n for (int j = 0; j < array.length; j++) {\n sum += array[j][i];\n }\n sb.append(sum);\n if (i != array[0].length - 1) {\n sb.append(\" \");\n }\n allsum += sum;\n }\n sb.append(\" \").append(allsum);\n System.out.println(sb);\n }\n}",
"public class Main {\n\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n int[] a = new int[]{sc.nextInt(), sc.nextInt()};\n int[][] m = new int[a[0]][a[1]];\n for (int i = 0; i < a[0]; i++) {\n for (int j = 0; j < a[1]; j++) {\n m[i][j] = sc.nextInt();\n }\n }\n print2DArray(m);\n }\n\n private static void print2DArray(int[][] array) {\n StringBuilder sb = new StringBuilder();\n for (int i = 0; i < array.length; i++) {\n int sum = 0;\n for (int j = 0; j < array[i].length; j++) {\n sb.append(array[i][j]);\n if (j != array[i].length - 1) {\n sb.append(\" \");\n }\n sum += array[i][j];\n }\n sb.append(\" \").append(sum);\n sb.append(\"\\n\");\n }\n int allsum = 0;\n for (int i = 0; i < array[0].length; i++) {\n int sum = 0;\n for (int j = 0; j < array.length; j++) {\n sum += array[j][i];\n }\n sb.append(sum);\n if (i != array[0].length - 1) {\n sb.append(\" \");\n }\n allsum += sum;\n }\n sb.append(\" \").append(allsum);\n System.out.println(sb);\n }\n}",
"Main"
] | import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int[] a = new int[]{sc.nextInt(), sc.nextInt()};
int[][] m = new int[a[0]][a[1]];
for (int i = 0; i < a[0]; i++) {
for (int j = 0; j < a[1]; j++) {
m[i][j] = sc.nextInt();
}
}
print2DArray(m);
}
private static void print2DArray(int[][] array) {
StringBuilder sb = new StringBuilder();
for (int i = 0; i < array.length; i++) {
int sum = 0;
for (int j = 0; j < array[i].length; j++) {
sb.append(array[i][j]);
if (j != array[i].length - 1) {
sb.append(" ");
}
sum += array[i][j];
}
sb.append(" ").append(sum);
sb.append("\n");
}
int allsum = 0;
for (int i = 0; i < array[0].length; i++) {
int sum = 0;
for (int j = 0; j < array.length; j++) {
sum += array[j][i];
}
sb.append(sum);
if (i != array[0].length - 1) {
sb.append(" ");
}
allsum += sum;
}
sb.append(" ").append(allsum);
System.out.println(sb);
}
} |
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
38,
5,
13,
30,
4,
18,
18,
13,
13,
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,
2,
18,
13,
13,
17,
1,
40,
13,
30,
30,
41,
13,
4,
18,
4,
18,
13,
17,
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,
4,
18,
13,
18,
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,
2,
18,
18,
13,
13,
13,
17,
18,
18,
13,
13,
13,
0,
18,
18,
13,
2,
18,
13,
13,
17,
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,
2,
18,
13,
13,
17,
2,
18,
18,
13,
13,
13,
17,
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,
8,
2,
13,
2,
18,
18,
13,
13,
13,
17,
18,
18,
13,
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
],
[
304,
5
],
[
304,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
10,
11
],
[
10,
12
],
[
12,
13
],
[
13,
14
],
[
14,
15
],
[
15,
16
],
[
15,
17
],
[
13,
18
],
[
9,
19
],
[
19,
20
],
[
20,
21
],
[
20,
22
],
[
19,
23
],
[
23,
24
],
[
23,
25
],
[
25,
26
],
[
26,
27
],
[
27,
28
],
[
28,
29
],
[
25,
30
],
[
19,
31
],
[
31,
32
],
[
31,
33
],
[
33,
34
],
[
34,
35
],
[
33,
36
],
[
36,
37
],
[
36,
38
],
[
19,
39
],
[
39,
40
],
[
39,
41
],
[
41,
42
],
[
42,
43
],
[
41,
44
],
[
44,
45
],
[
44,
46
],
[
19,
47
],
[
47,
48
],
[
47,
49
],
[
50,
51
],
[
50,
52
],
[
53,
54
],
[
53,
55
],
[
19,
56
],
[
56,
57
],
[
57,
58
],
[
58,
59
],
[
58,
60
],
[
56,
61
],
[
61,
62
],
[
61,
63
],
[
63,
64
],
[
64,
65
],
[
64,
66
],
[
63,
67
],
[
56,
68
],
[
68,
69
],
[
69,
70
],
[
56,
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
],
[
88,
89
],
[
89,
90
],
[
90,
91
],
[
90,
92
],
[
89,
93
],
[
88,
94
],
[
81,
95
],
[
95,
96
],
[
96,
97
],
[
81,
98
],
[
99,
99
],
[
99,
100
],
[
100,
101
],
[
101,
102
],
[
102,
103
],
[
102,
104
],
[
101,
105
],
[
100,
106
],
[
106,
107
],
[
107,
108
],
[
106,
109
],
[
109,
110
],
[
109,
111
],
[
19,
112
],
[
112,
113
],
[
113,
114
],
[
114,
115
],
[
114,
116
],
[
112,
117
],
[
117,
118
],
[
117,
119
],
[
119,
120
],
[
120,
121
],
[
120,
122
],
[
119,
123
],
[
112,
124
],
[
124,
125
],
[
125,
126
],
[
112,
127
],
[
128,
128
],
[
128,
129
],
[
129,
130
],
[
130,
131
],
[
131,
132
],
[
131,
133
],
[
129,
134
],
[
134,
135
],
[
134,
136
],
[
136,
137
],
[
137,
138
],
[
138,
139
],
[
138,
140
],
[
137,
141
],
[
136,
142
],
[
129,
143
],
[
143,
144
],
[
144,
145
],
[
129,
146
],
[
147,
147
],
[
147,
148
],
[
148,
149
],
[
149,
150
],
[
150,
151
],
[
150,
152
],
[
149,
153
],
[
153,
154
],
[
154,
155
],
[
155,
156
],
[
155,
157
],
[
154,
158
],
[
153,
159
],
[
148,
160
],
[
160,
161
],
[
161,
162
],
[
161,
163
],
[
160,
164
],
[
147,
165
],
[
165,
166
],
[
166,
167
],
[
167,
168
],
[
167,
169
],
[
169,
170
],
[
170,
171
],
[
170,
172
],
[
169,
173
],
[
166,
174
],
[
165,
175
],
[
175,
176
],
[
176,
177
],
[
176,
178
],
[
175,
179
],
[
19,
180
],
[
180,
181
],
[
181,
182
],
[
182,
183
],
[
182,
184
],
[
180,
185
],
[
185,
186
],
[
185,
187
],
[
187,
188
],
[
188,
189
],
[
188,
190
],
[
187,
191
],
[
180,
192
],
[
192,
193
],
[
193,
194
],
[
180,
195
],
[
196,
196
],
[
196,
197
],
[
197,
198
],
[
198,
199
],
[
199,
200
],
[
199,
201
],
[
197,
202
],
[
202,
203
],
[
202,
204
],
[
204,
205
],
[
205,
206
],
[
206,
207
],
[
206,
208
],
[
205,
209
],
[
204,
210
],
[
197,
211
],
[
211,
212
],
[
212,
213
],
[
197,
214
],
[
215,
215
],
[
215,
216
],
[
216,
217
],
[
217,
218
],
[
218,
219
],
[
218,
220
],
[
220,
221
],
[
221,
222
],
[
221,
223
],
[
220,
224
],
[
217,
225
],
[
225,
226
],
[
226,
227
],
[
227,
228
],
[
227,
229
],
[
226,
230
],
[
225,
231
],
[
216,
232
],
[
232,
233
],
[
233,
234
],
[
233,
235
],
[
232,
236
],
[
19,
237
],
[
237,
238
],
[
238,
239
],
[
239,
240
],
[
239,
241
],
[
237,
242
],
[
242,
243
],
[
242,
244
],
[
244,
245
],
[
244,
246
],
[
237,
247
],
[
247,
248
],
[
248,
249
],
[
237,
250
],
[
251,
251
],
[
251,
252
],
[
252,
253
],
[
253,
254
],
[
254,
255
],
[
254,
256
],
[
252,
257
],
[
257,
258
],
[
257,
259
],
[
259,
260
],
[
260,
261
],
[
260,
262
],
[
259,
263
],
[
252,
264
],
[
264,
265
],
[
265,
266
],
[
252,
267
],
[
268,
268
],
[
268,
269
],
[
269,
270
],
[
270,
271
],
[
271,
272
],
[
271,
273
],
[
269,
274
],
[
274,
275
],
[
275,
276
],
[
275,
277
],
[
277,
278
],
[
278,
279
],
[
279,
280
],
[
279,
281
],
[
278,
282
],
[
277,
283
],
[
274,
284
],
[
284,
285
],
[
285,
286
],
[
285,
287
],
[
284,
288
],
[
274,
289
],
[
289,
290
],
[
290,
291
],
[
291,
292
],
[
291,
293
],
[
290,
294
],
[
289,
295
],
[
251,
296
],
[
296,
297
],
[
297,
298
],
[
298,
299
],
[
298,
300
],
[
6,
301
],
[
301,
302
],
[
0,
303
],
[
303,
304
],
[
303,
305
]
] | [
"// ITP1_7_C\nimport java.io.*;\n\npublic class Main {\n\n public static void main(String[] args) {\n try {\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n String[] strAry0 = br.readLine().split(\" \");\n int r = Integer.parseInt(strAry0[0]);\n int c = Integer.parseInt(strAry0[1]);\n int[][] s = new int[r + 1][c + 1];\n\n for (int i = 0; i < s.length -1; i++) {\n String[] strAry1 = br.readLine().split(\" \");\n for (int j = 0; j < s[i].length -1; j++) {\n s[i][j] = Integer.parseInt(strAry1[j]);\n }\n }\n\n for (int i = 0; i < s.length -1; i++) {\n for (int j = 0; j < s[i].length - 1; j++) {\n s[i][s[i].length -1] += s[i][j];\n s[s.length - 1][j] += s[i][j];\n }\n }\n\n for (int i = 0; i < s.length - 1; i++) {\n for (int j = 0; j < s[i].length - 1; j++) {\n s[s.length - 1][s[i].length - 1] += s[i][j];\n }\n }\n\n for (int i = 0; i < s.length; i++) {\n for (int j = 0; j < s[i].length; j++) {\n System.out.print(j == s[i].length - 1 ? s[i][j] : s[i][j] + \" \");\n }\n System.out.println();\n }\n }\n\n catch (Exception e) {\n System.err.println(e);\n }\n }\n}",
"import java.io.*;",
"io.*",
"java",
"public class Main {\n\n public static void main(String[] args) {\n try {\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n String[] strAry0 = br.readLine().split(\" \");\n int r = Integer.parseInt(strAry0[0]);\n int c = Integer.parseInt(strAry0[1]);\n int[][] s = new int[r + 1][c + 1];\n\n for (int i = 0; i < s.length -1; i++) {\n String[] strAry1 = br.readLine().split(\" \");\n for (int j = 0; j < s[i].length -1; j++) {\n s[i][j] = Integer.parseInt(strAry1[j]);\n }\n }\n\n for (int i = 0; i < s.length -1; i++) {\n for (int j = 0; j < s[i].length - 1; j++) {\n s[i][s[i].length -1] += s[i][j];\n s[s.length - 1][j] += s[i][j];\n }\n }\n\n for (int i = 0; i < s.length - 1; i++) {\n for (int j = 0; j < s[i].length - 1; j++) {\n s[s.length - 1][s[i].length - 1] += s[i][j];\n }\n }\n\n for (int i = 0; i < s.length; i++) {\n for (int j = 0; j < s[i].length; j++) {\n System.out.print(j == s[i].length - 1 ? s[i][j] : s[i][j] + \" \");\n }\n System.out.println();\n }\n }\n\n catch (Exception e) {\n System.err.println(e);\n }\n }\n}",
"Main",
"public static void main(String[] args) {\n try {\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n String[] strAry0 = br.readLine().split(\" \");\n int r = Integer.parseInt(strAry0[0]);\n int c = Integer.parseInt(strAry0[1]);\n int[][] s = new int[r + 1][c + 1];\n\n for (int i = 0; i < s.length -1; i++) {\n String[] strAry1 = br.readLine().split(\" \");\n for (int j = 0; j < s[i].length -1; j++) {\n s[i][j] = Integer.parseInt(strAry1[j]);\n }\n }\n\n for (int i = 0; i < s.length -1; i++) {\n for (int j = 0; j < s[i].length - 1; j++) {\n s[i][s[i].length -1] += s[i][j];\n s[s.length - 1][j] += s[i][j];\n }\n }\n\n for (int i = 0; i < s.length - 1; i++) {\n for (int j = 0; j < s[i].length - 1; j++) {\n s[s.length - 1][s[i].length - 1] += s[i][j];\n }\n }\n\n for (int i = 0; i < s.length; i++) {\n for (int j = 0; j < s[i].length; j++) {\n System.out.print(j == s[i].length - 1 ? s[i][j] : s[i][j] + \" \");\n }\n System.out.println();\n }\n }\n\n catch (Exception e) {\n System.err.println(e);\n }\n }",
"main",
"{\n try {\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n String[] strAry0 = br.readLine().split(\" \");\n int r = Integer.parseInt(strAry0[0]);\n int c = Integer.parseInt(strAry0[1]);\n int[][] s = new int[r + 1][c + 1];\n\n for (int i = 0; i < s.length -1; i++) {\n String[] strAry1 = br.readLine().split(\" \");\n for (int j = 0; j < s[i].length -1; j++) {\n s[i][j] = Integer.parseInt(strAry1[j]);\n }\n }\n\n for (int i = 0; i < s.length -1; i++) {\n for (int j = 0; j < s[i].length - 1; j++) {\n s[i][s[i].length -1] += s[i][j];\n s[s.length - 1][j] += s[i][j];\n }\n }\n\n for (int i = 0; i < s.length - 1; i++) {\n for (int j = 0; j < s[i].length - 1; j++) {\n s[s.length - 1][s[i].length - 1] += s[i][j];\n }\n }\n\n for (int i = 0; i < s.length; i++) {\n for (int j = 0; j < s[i].length; j++) {\n System.out.print(j == s[i].length - 1 ? s[i][j] : s[i][j] + \" \");\n }\n System.out.println();\n }\n }\n\n catch (Exception e) {\n System.err.println(e);\n }\n }",
"try {\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n String[] strAry0 = br.readLine().split(\" \");\n int r = Integer.parseInt(strAry0[0]);\n int c = Integer.parseInt(strAry0[1]);\n int[][] s = new int[r + 1][c + 1];\n\n for (int i = 0; i < s.length -1; i++) {\n String[] strAry1 = br.readLine().split(\" \");\n for (int j = 0; j < s[i].length -1; j++) {\n s[i][j] = Integer.parseInt(strAry1[j]);\n }\n }\n\n for (int i = 0; i < s.length -1; i++) {\n for (int j = 0; j < s[i].length - 1; j++) {\n s[i][s[i].length -1] += s[i][j];\n s[s.length - 1][j] += s[i][j];\n }\n }\n\n for (int i = 0; i < s.length - 1; i++) {\n for (int j = 0; j < s[i].length - 1; j++) {\n s[s.length - 1][s[i].length - 1] += s[i][j];\n }\n }\n\n for (int i = 0; i < s.length; i++) {\n for (int j = 0; j < s[i].length; j++) {\n System.out.print(j == s[i].length - 1 ? s[i][j] : s[i][j] + \" \");\n }\n System.out.println();\n }\n }\n\n catch (Exception e) {\n System.err.println(e);\n }",
"catch (Exception e) {\n System.err.println(e);\n }",
"Exception e",
"{\n System.err.println(e);\n }",
"System.err.println(e)",
"System.err.println",
"System.err",
"System",
"System.err",
"e",
"{\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n String[] strAry0 = br.readLine().split(\" \");\n int r = Integer.parseInt(strAry0[0]);\n int c = Integer.parseInt(strAry0[1]);\n int[][] s = new int[r + 1][c + 1];\n\n for (int i = 0; i < s.length -1; i++) {\n String[] strAry1 = br.readLine().split(\" \");\n for (int j = 0; j < s[i].length -1; j++) {\n s[i][j] = Integer.parseInt(strAry1[j]);\n }\n }\n\n for (int i = 0; i < s.length -1; i++) {\n for (int j = 0; j < s[i].length - 1; j++) {\n s[i][s[i].length -1] += s[i][j];\n s[s.length - 1][j] += s[i][j];\n }\n }\n\n for (int i = 0; i < s.length - 1; i++) {\n for (int j = 0; j < s[i].length - 1; j++) {\n s[s.length - 1][s[i].length - 1] += s[i][j];\n }\n }\n\n for (int i = 0; i < s.length; i++) {\n for (int j = 0; j < s[i].length; j++) {\n System.out.print(j == s[i].length - 1 ? s[i][j] : s[i][j] + \" \");\n }\n System.out.println();\n }\n }",
"BufferedReader br = new BufferedReader(new InputStreamReader(System.in));",
"br",
"new BufferedReader(new InputStreamReader(System.in))",
"String[] strAry0 = br.readLine().split(\" \");",
"strAry0",
"br.readLine().split(\" \")",
"br.readLine().split",
"br.readLine()",
"br.readLine",
"br",
"\" \"",
"int r = Integer.parseInt(strAry0[0]);",
"r",
"Integer.parseInt(strAry0[0])",
"Integer.parseInt",
"Integer",
"strAry0[0]",
"strAry0",
"0",
"int c = Integer.parseInt(strAry0[1]);",
"c",
"Integer.parseInt(strAry0[1])",
"Integer.parseInt",
"Integer",
"strAry0[1]",
"strAry0",
"1",
"int[][] s = new int[r + 1][c + 1];",
"s",
"new int[r + 1][c + 1]",
"r + 1",
"r",
"1",
"c + 1",
"c",
"1",
"for (int i = 0; i < s.length -1; i++) {\n String[] strAry1 = br.readLine().split(\" \");\n for (int j = 0; j < s[i].length -1; j++) {\n s[i][j] = Integer.parseInt(strAry1[j]);\n }\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < s.length -1",
"i",
"s.length -1",
"s.length",
"s",
"s.length",
"1",
"i++",
"i++",
"i",
"{\n String[] strAry1 = br.readLine().split(\" \");\n for (int j = 0; j < s[i].length -1; j++) {\n s[i][j] = Integer.parseInt(strAry1[j]);\n }\n }",
"{\n String[] strAry1 = br.readLine().split(\" \");\n for (int j = 0; j < s[i].length -1; j++) {\n s[i][j] = Integer.parseInt(strAry1[j]);\n }\n }",
"String[] strAry1 = br.readLine().split(\" \");",
"strAry1",
"br.readLine().split(\" \")",
"br.readLine().split",
"br.readLine()",
"br.readLine",
"br",
"\" \"",
"for (int j = 0; j < s[i].length -1; j++) {\n s[i][j] = Integer.parseInt(strAry1[j]);\n }",
"int j = 0;",
"int j = 0;",
"j",
"0",
"j < s[i].length -1",
"j",
"s[i].length -1",
"s[i].length",
"s[i]",
"s",
"i",
"s[i].length",
"1",
"j++",
"j++",
"j",
"{\n s[i][j] = Integer.parseInt(strAry1[j]);\n }",
"{\n s[i][j] = Integer.parseInt(strAry1[j]);\n }",
"s[i][j] = Integer.parseInt(strAry1[j])",
"s[i][j]",
"s[i]",
"s",
"i",
"j",
"Integer.parseInt(strAry1[j])",
"Integer.parseInt",
"Integer",
"strAry1[j]",
"strAry1",
"j",
"for (int i = 0; i < s.length -1; i++) {\n for (int j = 0; j < s[i].length - 1; j++) {\n s[i][s[i].length -1] += s[i][j];\n s[s.length - 1][j] += s[i][j];\n }\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < s.length -1",
"i",
"s.length -1",
"s.length",
"s",
"s.length",
"1",
"i++",
"i++",
"i",
"{\n for (int j = 0; j < s[i].length - 1; j++) {\n s[i][s[i].length -1] += s[i][j];\n s[s.length - 1][j] += s[i][j];\n }\n }",
"{\n for (int j = 0; j < s[i].length - 1; j++) {\n s[i][s[i].length -1] += s[i][j];\n s[s.length - 1][j] += s[i][j];\n }\n }",
"for (int j = 0; j < s[i].length - 1; j++) {\n s[i][s[i].length -1] += s[i][j];\n s[s.length - 1][j] += s[i][j];\n }",
"int j = 0;",
"int j = 0;",
"j",
"0",
"j < s[i].length - 1",
"j",
"s[i].length - 1",
"s[i].length",
"s[i]",
"s",
"i",
"s[i].length",
"1",
"j++",
"j++",
"j",
"{\n s[i][s[i].length -1] += s[i][j];\n s[s.length - 1][j] += s[i][j];\n }",
"{\n s[i][s[i].length -1] += s[i][j];\n s[s.length - 1][j] += s[i][j];\n }",
"s[i][s[i].length -1] += s[i][j]",
"s[i][s[i].length -1]",
"s[i]",
"s",
"i",
"s[i].length -1",
"s[i].length",
"s[i]",
"s",
"i",
"s[i].length",
"1",
"s[i][j]",
"s[i]",
"s",
"i",
"j",
"s[s.length - 1][j] += s[i][j]",
"s[s.length - 1][j]",
"s[s.length - 1]",
"s",
"s.length - 1",
"s.length",
"s",
"s.length",
"1",
"j",
"s[i][j]",
"s[i]",
"s",
"i",
"j",
"for (int i = 0; i < s.length - 1; i++) {\n for (int j = 0; j < s[i].length - 1; j++) {\n s[s.length - 1][s[i].length - 1] += s[i][j];\n }\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < s.length - 1",
"i",
"s.length - 1",
"s.length",
"s",
"s.length",
"1",
"i++",
"i++",
"i",
"{\n for (int j = 0; j < s[i].length - 1; j++) {\n s[s.length - 1][s[i].length - 1] += s[i][j];\n }\n }",
"{\n for (int j = 0; j < s[i].length - 1; j++) {\n s[s.length - 1][s[i].length - 1] += s[i][j];\n }\n }",
"for (int j = 0; j < s[i].length - 1; j++) {\n s[s.length - 1][s[i].length - 1] += s[i][j];\n }",
"int j = 0;",
"int j = 0;",
"j",
"0",
"j < s[i].length - 1",
"j",
"s[i].length - 1",
"s[i].length",
"s[i]",
"s",
"i",
"s[i].length",
"1",
"j++",
"j++",
"j",
"{\n s[s.length - 1][s[i].length - 1] += s[i][j];\n }",
"{\n s[s.length - 1][s[i].length - 1] += s[i][j];\n }",
"s[s.length - 1][s[i].length - 1] += s[i][j]",
"s[s.length - 1][s[i].length - 1]",
"s[s.length - 1]",
"s",
"s.length - 1",
"s.length",
"s",
"s.length",
"1",
"s[i].length - 1",
"s[i].length",
"s[i]",
"s",
"i",
"s[i].length",
"1",
"s[i][j]",
"s[i]",
"s",
"i",
"j",
"for (int i = 0; i < s.length; i++) {\n for (int j = 0; j < s[i].length; j++) {\n System.out.print(j == s[i].length - 1 ? s[i][j] : s[i][j] + \" \");\n }\n System.out.println();\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < s.length",
"i",
"s.length",
"s",
"s.length",
"i++",
"i++",
"i",
"{\n for (int j = 0; j < s[i].length; j++) {\n System.out.print(j == s[i].length - 1 ? s[i][j] : s[i][j] + \" \");\n }\n System.out.println();\n }",
"{\n for (int j = 0; j < s[i].length; j++) {\n System.out.print(j == s[i].length - 1 ? s[i][j] : s[i][j] + \" \");\n }\n System.out.println();\n }",
"for (int j = 0; j < s[i].length; j++) {\n System.out.print(j == s[i].length - 1 ? s[i][j] : s[i][j] + \" \");\n }",
"int j = 0;",
"int j = 0;",
"j",
"0",
"j < s[i].length",
"j",
"s[i].length",
"s[i]",
"s",
"i",
"s[i].length",
"j++",
"j++",
"j",
"{\n System.out.print(j == s[i].length - 1 ? s[i][j] : s[i][j] + \" \");\n }",
"{\n System.out.print(j == s[i].length - 1 ? s[i][j] : s[i][j] + \" \");\n }",
"System.out.print(j == s[i].length - 1 ? s[i][j] : s[i][j] + \" \")",
"System.out.print",
"System.out",
"System",
"System.out",
"j == s[i].length - 1 ? s[i][j] : s[i][j] + \" \"",
"j == s[i].length - 1",
"j",
"s[i].length - 1",
"s[i].length",
"s[i]",
"s",
"i",
"s[i].length",
"1",
"s[i][j]",
"s[i]",
"s",
"i",
"j",
"s[i][j] + \" \"",
"s[i][j]",
"s[i]",
"s",
"i",
"j",
"\" \"",
"System.out.println()",
"System.out.println",
"System.out",
"System",
"System.out",
"String[] args",
"args",
"public class Main {\n\n public static void main(String[] args) {\n try {\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n String[] strAry0 = br.readLine().split(\" \");\n int r = Integer.parseInt(strAry0[0]);\n int c = Integer.parseInt(strAry0[1]);\n int[][] s = new int[r + 1][c + 1];\n\n for (int i = 0; i < s.length -1; i++) {\n String[] strAry1 = br.readLine().split(\" \");\n for (int j = 0; j < s[i].length -1; j++) {\n s[i][j] = Integer.parseInt(strAry1[j]);\n }\n }\n\n for (int i = 0; i < s.length -1; i++) {\n for (int j = 0; j < s[i].length - 1; j++) {\n s[i][s[i].length -1] += s[i][j];\n s[s.length - 1][j] += s[i][j];\n }\n }\n\n for (int i = 0; i < s.length - 1; i++) {\n for (int j = 0; j < s[i].length - 1; j++) {\n s[s.length - 1][s[i].length - 1] += s[i][j];\n }\n }\n\n for (int i = 0; i < s.length; i++) {\n for (int j = 0; j < s[i].length; j++) {\n System.out.print(j == s[i].length - 1 ? s[i][j] : s[i][j] + \" \");\n }\n System.out.println();\n }\n }\n\n catch (Exception e) {\n System.err.println(e);\n }\n }\n}",
"public class Main {\n\n public static void main(String[] args) {\n try {\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n String[] strAry0 = br.readLine().split(\" \");\n int r = Integer.parseInt(strAry0[0]);\n int c = Integer.parseInt(strAry0[1]);\n int[][] s = new int[r + 1][c + 1];\n\n for (int i = 0; i < s.length -1; i++) {\n String[] strAry1 = br.readLine().split(\" \");\n for (int j = 0; j < s[i].length -1; j++) {\n s[i][j] = Integer.parseInt(strAry1[j]);\n }\n }\n\n for (int i = 0; i < s.length -1; i++) {\n for (int j = 0; j < s[i].length - 1; j++) {\n s[i][s[i].length -1] += s[i][j];\n s[s.length - 1][j] += s[i][j];\n }\n }\n\n for (int i = 0; i < s.length - 1; i++) {\n for (int j = 0; j < s[i].length - 1; j++) {\n s[s.length - 1][s[i].length - 1] += s[i][j];\n }\n }\n\n for (int i = 0; i < s.length; i++) {\n for (int j = 0; j < s[i].length; j++) {\n System.out.print(j == s[i].length - 1 ? s[i][j] : s[i][j] + \" \");\n }\n System.out.println();\n }\n }\n\n catch (Exception e) {\n System.err.println(e);\n }\n }\n}",
"Main"
] | // ITP1_7_C
import java.io.*;
public class Main {
public static void main(String[] args) {
try {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
String[] strAry0 = br.readLine().split(" ");
int r = Integer.parseInt(strAry0[0]);
int c = Integer.parseInt(strAry0[1]);
int[][] s = new int[r + 1][c + 1];
for (int i = 0; i < s.length -1; i++) {
String[] strAry1 = br.readLine().split(" ");
for (int j = 0; j < s[i].length -1; j++) {
s[i][j] = Integer.parseInt(strAry1[j]);
}
}
for (int i = 0; i < s.length -1; i++) {
for (int j = 0; j < s[i].length - 1; j++) {
s[i][s[i].length -1] += s[i][j];
s[s.length - 1][j] += s[i][j];
}
}
for (int i = 0; i < s.length - 1; i++) {
for (int j = 0; j < s[i].length - 1; j++) {
s[s.length - 1][s[i].length - 1] += s[i][j];
}
}
for (int i = 0; i < s.length; i++) {
for (int j = 0; j < s[i].length; j++) {
System.out.print(j == s[i].length - 1 ? s[i][j] : s[i][j] + " ");
}
System.out.println();
}
}
catch (Exception e) {
System.err.println(e);
}
}
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.