node_ids
listlengths 4
1.4k
| edge_index
listlengths 1
2.22k
| text
listlengths 4
1.4k
| source
stringlengths 14
427k
|
---|---|---|---|
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
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,
41,
13,
20,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
18,
13,
13,
4,
18,
13,
18,
13,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
18,
18,
13,
13,
13,
18,
13,
13,
0,
18,
18,
13,
13,
13,
18,
13,
13,
0,
18,
18,
13,
13,
13,
18,
13,
13,
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,
18,
18,
13,
13,
13,
14,
2,
13,
13,
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
],
[
197,
5
],
[
197,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
16,
17
],
[
17,
18
],
[
14,
19
],
[
8,
20
],
[
20,
21
],
[
20,
22
],
[
22,
23
],
[
23,
24
],
[
22,
25
],
[
25,
26
],
[
25,
27
],
[
8,
28
],
[
28,
29
],
[
28,
30
],
[
30,
31
],
[
31,
32
],
[
30,
33
],
[
33,
34
],
[
33,
35
],
[
8,
36
],
[
36,
37
],
[
36,
38
],
[
39,
40
],
[
39,
41
],
[
42,
43
],
[
42,
44
],
[
8,
45
],
[
45,
46
],
[
46,
47
],
[
47,
48
],
[
47,
49
],
[
45,
50
],
[
50,
51
],
[
50,
52
],
[
45,
53
],
[
53,
54
],
[
54,
55
],
[
45,
56
],
[
57,
57
],
[
57,
58
],
[
58,
59
],
[
58,
60
],
[
60,
61
],
[
61,
62
],
[
62,
63
],
[
63,
64
],
[
60,
65
],
[
57,
66
],
[
66,
67
],
[
66,
68
],
[
57,
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
],
[
84,
86
],
[
83,
87
],
[
87,
88
],
[
88,
89
],
[
87,
90
],
[
90,
91
],
[
90,
92
],
[
57,
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
],
[
107,
111
],
[
106,
112
],
[
112,
113
],
[
112,
114
],
[
105,
115
],
[
115,
116
],
[
116,
117
],
[
117,
118
],
[
117,
119
],
[
116,
120
],
[
115,
121
],
[
121,
122
],
[
121,
123
],
[
105,
124
],
[
124,
125
],
[
125,
126
],
[
126,
127
],
[
126,
128
],
[
125,
129
],
[
124,
130
],
[
130,
131
],
[
130,
132
],
[
105,
133
],
[
133,
134
],
[
134,
135
],
[
135,
136
],
[
135,
137
],
[
134,
138
],
[
133,
139
],
[
139,
140
],
[
139,
141
],
[
8,
142
],
[
142,
143
],
[
143,
144
],
[
144,
145
],
[
144,
146
],
[
142,
147
],
[
147,
148
],
[
147,
149
],
[
142,
150
],
[
150,
151
],
[
151,
152
],
[
142,
153
],
[
154,
154
],
[
154,
155
],
[
155,
156
],
[
156,
157
],
[
157,
158
],
[
157,
159
],
[
155,
160
],
[
160,
161
],
[
160,
162
],
[
155,
163
],
[
163,
164
],
[
164,
165
],
[
155,
166
],
[
167,
167
],
[
167,
168
],
[
168,
169
],
[
169,
170
],
[
170,
171
],
[
170,
172
],
[
168,
173
],
[
173,
174
],
[
174,
175
],
[
174,
176
],
[
173,
177
],
[
167,
178
],
[
178,
179
],
[
179,
180
],
[
179,
181
],
[
178,
182
],
[
182,
183
],
[
183,
184
],
[
184,
185
],
[
184,
186
],
[
182,
187
],
[
154,
188
],
[
188,
189
],
[
189,
190
],
[
190,
191
],
[
190,
192
],
[
188,
193
],
[
6,
194
],
[
194,
195
],
[
0,
196
],
[
196,
197
],
[
196,
198
]
] | [
"import java.io.*;\n\npublic class Main{\n public static void main(String[] args) throws IOException{\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n String[] line = br.readLine().split(\" \");\n int r = Integer.parseInt(line[0]);\n int c = Integer.parseInt(line[1]);\n int[][] sheet = new int[r+1][c+1];\n\n for(int i = 0; i < r; i++){\n line = br.readLine().split(\" \");\n int[] a = new int[c];\n for(int k = 0; k < c; k++){\n a[k] = Integer.parseInt(line[k]);\n }\n for(int j = 0; j < c; j++){\n sheet[i][j] = a[j];\n sheet[r][c] += a[j];\n sheet[i][c] += a[j];\n sheet[r][j] += a[j];\n }\n }\n\n for(int i = 0; i <= r; i++){\n for(int j = 0; j <= c; j++){\n System.out.print(sheet[i][j]);\n if(j != c)\n System.out.print(\" \");\n }\n System.out.print(\"\\n\");\n }\n }\n}",
"import java.io.*;",
"io.*",
"java",
"public class Main{\n public static void main(String[] args) throws IOException{\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n String[] line = br.readLine().split(\" \");\n int r = Integer.parseInt(line[0]);\n int c = Integer.parseInt(line[1]);\n int[][] sheet = new int[r+1][c+1];\n\n for(int i = 0; i < r; i++){\n line = br.readLine().split(\" \");\n int[] a = new int[c];\n for(int k = 0; k < c; k++){\n a[k] = Integer.parseInt(line[k]);\n }\n for(int j = 0; j < c; j++){\n sheet[i][j] = a[j];\n sheet[r][c] += a[j];\n sheet[i][c] += a[j];\n sheet[r][j] += a[j];\n }\n }\n\n for(int i = 0; i <= r; i++){\n for(int j = 0; j <= c; j++){\n System.out.print(sheet[i][j]);\n if(j != c)\n System.out.print(\" \");\n }\n System.out.print(\"\\n\");\n }\n }\n}",
"Main",
"public static void main(String[] args) throws IOException{\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n String[] line = br.readLine().split(\" \");\n int r = Integer.parseInt(line[0]);\n int c = Integer.parseInt(line[1]);\n int[][] sheet = new int[r+1][c+1];\n\n for(int i = 0; i < r; i++){\n line = br.readLine().split(\" \");\n int[] a = new int[c];\n for(int k = 0; k < c; k++){\n a[k] = Integer.parseInt(line[k]);\n }\n for(int j = 0; j < c; j++){\n sheet[i][j] = a[j];\n sheet[r][c] += a[j];\n sheet[i][c] += a[j];\n sheet[r][j] += a[j];\n }\n }\n\n for(int i = 0; i <= r; i++){\n for(int j = 0; j <= c; j++){\n System.out.print(sheet[i][j]);\n if(j != c)\n System.out.print(\" \");\n }\n System.out.print(\"\\n\");\n }\n }",
"main",
"{\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n String[] line = br.readLine().split(\" \");\n int r = Integer.parseInt(line[0]);\n int c = Integer.parseInt(line[1]);\n int[][] sheet = new int[r+1][c+1];\n\n for(int i = 0; i < r; i++){\n line = br.readLine().split(\" \");\n int[] a = new int[c];\n for(int k = 0; k < c; k++){\n a[k] = Integer.parseInt(line[k]);\n }\n for(int j = 0; j < c; j++){\n sheet[i][j] = a[j];\n sheet[r][c] += a[j];\n sheet[i][c] += a[j];\n sheet[r][j] += a[j];\n }\n }\n\n for(int i = 0; i <= r; i++){\n for(int j = 0; j <= c; j++){\n System.out.print(sheet[i][j]);\n if(j != c)\n System.out.print(\" \");\n }\n System.out.print(\"\\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 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[][] 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 line = br.readLine().split(\" \");\n int[] a = new int[c];\n for(int k = 0; k < c; k++){\n a[k] = Integer.parseInt(line[k]);\n }\n for(int j = 0; j < c; j++){\n sheet[i][j] = a[j];\n sheet[r][c] += a[j];\n sheet[i][c] += a[j];\n sheet[r][j] += a[j];\n }\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < r",
"i",
"r",
"i++",
"i++",
"i",
"{\n line = br.readLine().split(\" \");\n int[] a = new int[c];\n for(int k = 0; k < c; k++){\n a[k] = Integer.parseInt(line[k]);\n }\n for(int j = 0; j < c; j++){\n sheet[i][j] = a[j];\n sheet[r][c] += a[j];\n sheet[i][c] += a[j];\n sheet[r][j] += a[j];\n }\n }",
"{\n line = br.readLine().split(\" \");\n int[] a = new int[c];\n for(int k = 0; k < c; k++){\n a[k] = Integer.parseInt(line[k]);\n }\n for(int j = 0; j < c; j++){\n sheet[i][j] = a[j];\n sheet[r][c] += a[j];\n sheet[i][c] += a[j];\n sheet[r][j] += a[j];\n }\n }",
"line = br.readLine().split(\" \")",
"line",
"br.readLine().split(\" \")",
"br.readLine().split",
"br.readLine()",
"br.readLine",
"br",
"\" \"",
"int[] a = new int[c];",
"a",
"new int[c]",
"c",
"for(int k = 0; k < c; k++){\n a[k] = Integer.parseInt(line[k]);\n }",
"int k = 0;",
"int k = 0;",
"k",
"0",
"k < c",
"k",
"c",
"k++",
"k++",
"k",
"{\n a[k] = Integer.parseInt(line[k]);\n }",
"{\n a[k] = Integer.parseInt(line[k]);\n }",
"a[k] = Integer.parseInt(line[k])",
"a[k]",
"a",
"k",
"Integer.parseInt(line[k])",
"Integer.parseInt",
"Integer",
"line[k]",
"line",
"k",
"for(int j = 0; j < c; j++){\n sheet[i][j] = a[j];\n sheet[r][c] += a[j];\n sheet[i][c] += a[j];\n sheet[r][j] += a[j];\n }",
"int j = 0;",
"int j = 0;",
"j",
"0",
"j < c",
"j",
"c",
"j++",
"j++",
"j",
"{\n sheet[i][j] = a[j];\n sheet[r][c] += a[j];\n sheet[i][c] += a[j];\n sheet[r][j] += a[j];\n }",
"{\n sheet[i][j] = a[j];\n sheet[r][c] += a[j];\n sheet[i][c] += a[j];\n sheet[r][j] += a[j];\n }",
"sheet[i][j] = a[j]",
"sheet[i][j]",
"sheet[i]",
"sheet",
"i",
"j",
"a[j]",
"a",
"j",
"sheet[r][c] += a[j]",
"sheet[r][c]",
"sheet[r]",
"sheet",
"r",
"c",
"a[j]",
"a",
"j",
"sheet[i][c] += a[j]",
"sheet[i][c]",
"sheet[i]",
"sheet",
"i",
"c",
"a[j]",
"a",
"j",
"sheet[r][j] += a[j]",
"sheet[r][j]",
"sheet[r]",
"sheet",
"r",
"j",
"a[j]",
"a",
"j",
"for(int i = 0; i <= r; i++){\n for(int j = 0; j <= c; j++){\n System.out.print(sheet[i][j]);\n if(j != c)\n System.out.print(\" \");\n }\n System.out.print(\"\\n\");\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i <= r",
"i",
"r",
"i++",
"i++",
"i",
"{\n for(int j = 0; j <= c; j++){\n System.out.print(sheet[i][j]);\n if(j != c)\n System.out.print(\" \");\n }\n System.out.print(\"\\n\");\n }",
"{\n for(int j = 0; j <= c; j++){\n System.out.print(sheet[i][j]);\n if(j != c)\n System.out.print(\" \");\n }\n System.out.print(\"\\n\");\n }",
"for(int j = 0; j <= c; j++){\n System.out.print(sheet[i][j]);\n if(j != c)\n System.out.print(\" \");\n }",
"int j = 0;",
"int j = 0;",
"j",
"0",
"j <= c",
"j",
"c",
"j++",
"j++",
"j",
"{\n System.out.print(sheet[i][j]);\n if(j != c)\n System.out.print(\" \");\n }",
"{\n System.out.print(sheet[i][j]);\n if(j != c)\n System.out.print(\" \");\n }",
"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 System.out.print(\" \");",
"j != c",
"j",
"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\"",
"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 String[] line = br.readLine().split(\" \");\n int r = Integer.parseInt(line[0]);\n int c = Integer.parseInt(line[1]);\n int[][] sheet = new int[r+1][c+1];\n\n for(int i = 0; i < r; i++){\n line = br.readLine().split(\" \");\n int[] a = new int[c];\n for(int k = 0; k < c; k++){\n a[k] = Integer.parseInt(line[k]);\n }\n for(int j = 0; j < c; j++){\n sheet[i][j] = a[j];\n sheet[r][c] += a[j];\n sheet[i][c] += a[j];\n sheet[r][j] += a[j];\n }\n }\n\n for(int i = 0; i <= r; i++){\n for(int j = 0; j <= c; j++){\n System.out.print(sheet[i][j]);\n if(j != c)\n System.out.print(\" \");\n }\n System.out.print(\"\\n\");\n }\n }\n}",
"public class Main{\n public static void main(String[] args) throws IOException{\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n String[] line = br.readLine().split(\" \");\n int r = Integer.parseInt(line[0]);\n int c = Integer.parseInt(line[1]);\n int[][] sheet = new int[r+1][c+1];\n\n for(int i = 0; i < r; i++){\n line = br.readLine().split(\" \");\n int[] a = new int[c];\n for(int k = 0; k < c; k++){\n a[k] = Integer.parseInt(line[k]);\n }\n for(int j = 0; j < c; j++){\n sheet[i][j] = a[j];\n sheet[r][c] += a[j];\n sheet[i][c] += a[j];\n sheet[r][j] += a[j];\n }\n }\n\n for(int i = 0; i <= r; i++){\n for(int j = 0; j <= c; j++){\n System.out.print(sheet[i][j]);\n if(j != c)\n System.out.print(\" \");\n }\n System.out.print(\"\\n\");\n }\n }\n}",
"Main"
] | import java.io.*;
public class Main{
public static void main(String[] args) throws IOException{
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
String[] line = br.readLine().split(" ");
int r = Integer.parseInt(line[0]);
int c = Integer.parseInt(line[1]);
int[][] sheet = new int[r+1][c+1];
for(int i = 0; i < r; i++){
line = br.readLine().split(" ");
int[] a = new int[c];
for(int k = 0; k < c; k++){
a[k] = Integer.parseInt(line[k]);
}
for(int j = 0; j < c; j++){
sheet[i][j] = a[j];
sheet[r][c] += a[j];
sheet[i][c] += a[j];
sheet[r][j] += a[j];
}
}
for(int i = 0; i <= r; i++){
for(int j = 0; j <= c; j++){
System.out.print(sheet[i][j]);
if(j != c)
System.out.print(" ");
}
System.out.print("\n");
}
}
} |
[
7,
15,
13,
17,
6,
13,
41,
13,
41,
13,
41,
13,
41,
13,
12,
13,
30,
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,
13,
2,
13,
2,
13,
17,
1,
40,
13,
30,
30,
11,
1,
0,
13,
13,
2,
13,
2,
13,
17,
1,
40,
13,
30,
30,
0,
18,
18,
13,
13,
13,
17,
11,
1,
0,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
11,
1,
0,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
18,
18,
13,
13,
13,
4,
18,
13,
0,
18,
18,
13,
13,
13,
18,
18,
13,
13,
13,
0,
18,
18,
13,
13,
13,
18,
18,
13,
13,
13,
0,
18,
18,
13,
13,
13,
18,
18,
13,
13,
13,
11,
1,
0,
13,
17,
2,
13,
2,
13,
17,
1,
40,
13,
30,
30,
11,
1,
0,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
4,
18,
18,
13,
13,
17,
18,
18,
13,
13,
13,
4,
18,
18,
13,
13,
17,
18,
18,
13,
13,
13,
4,
18,
18,
13,
13,
12,
13,
30,
4,
18,
20,
23,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
6,
7
],
[
4,
8
],
[
8,
9
],
[
4,
10
],
[
10,
11
],
[
4,
12
],
[
12,
13
],
[
4,
14
],
[
14,
15
],
[
14,
16
],
[
16,
17
],
[
17,
18
],
[
17,
19
],
[
16,
20
],
[
20,
21
],
[
20,
22
],
[
22,
23
],
[
23,
24
],
[
16,
25
],
[
25,
26
],
[
25,
27
],
[
27,
28
],
[
28,
29
],
[
16,
30
],
[
30,
31
],
[
30,
32
],
[
33,
34
],
[
33,
35
],
[
36,
37
],
[
36,
38
],
[
16,
39
],
[
39,
40
],
[
40,
41
],
[
41,
42
],
[
41,
43
],
[
39,
44
],
[
44,
45
],
[
44,
46
],
[
46,
47
],
[
46,
48
],
[
39,
49
],
[
49,
50
],
[
50,
51
],
[
39,
52
],
[
53,
53
],
[
53,
54
],
[
54,
55
],
[
55,
56
],
[
56,
57
],
[
56,
58
],
[
54,
59
],
[
59,
60
],
[
59,
61
],
[
61,
62
],
[
61,
63
],
[
54,
64
],
[
64,
65
],
[
65,
66
],
[
54,
67
],
[
68,
68
],
[
68,
69
],
[
69,
70
],
[
70,
71
],
[
71,
72
],
[
71,
73
],
[
70,
74
],
[
69,
75
],
[
16,
76
],
[
76,
77
],
[
77,
78
],
[
78,
79
],
[
78,
80
],
[
76,
81
],
[
81,
82
],
[
81,
83
],
[
76,
84
],
[
84,
85
],
[
85,
86
],
[
76,
87
],
[
88,
88
],
[
88,
89
],
[
89,
90
],
[
90,
91
],
[
91,
92
],
[
91,
93
],
[
89,
94
],
[
94,
95
],
[
94,
96
],
[
89,
97
],
[
97,
98
],
[
98,
99
],
[
89,
100
],
[
101,
101
],
[
101,
102
],
[
102,
103
],
[
103,
104
],
[
104,
105
],
[
104,
106
],
[
103,
107
],
[
102,
108
],
[
108,
109
],
[
109,
110
],
[
101,
111
],
[
111,
112
],
[
112,
113
],
[
113,
114
],
[
113,
115
],
[
112,
116
],
[
111,
117
],
[
117,
118
],
[
118,
119
],
[
118,
120
],
[
117,
121
],
[
101,
122
],
[
122,
123
],
[
123,
124
],
[
124,
125
],
[
124,
126
],
[
123,
127
],
[
122,
128
],
[
128,
129
],
[
129,
130
],
[
129,
131
],
[
128,
132
],
[
101,
133
],
[
133,
134
],
[
134,
135
],
[
135,
136
],
[
135,
137
],
[
134,
138
],
[
133,
139
],
[
139,
140
],
[
140,
141
],
[
140,
142
],
[
139,
143
],
[
16,
144
],
[
144,
145
],
[
145,
146
],
[
146,
147
],
[
146,
148
],
[
144,
149
],
[
149,
150
],
[
149,
151
],
[
151,
152
],
[
151,
153
],
[
144,
154
],
[
154,
155
],
[
155,
156
],
[
144,
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
],
[
172,
178
],
[
178,
179
],
[
179,
180
],
[
179,
181
],
[
178,
182
],
[
158,
183
],
[
183,
184
],
[
184,
185
],
[
185,
186
],
[
185,
187
],
[
183,
188
],
[
183,
189
],
[
189,
190
],
[
190,
191
],
[
190,
192
],
[
189,
193
],
[
158,
194
],
[
194,
195
],
[
195,
196
],
[
196,
197
],
[
196,
198
],
[
4,
199
],
[
199,
200
],
[
199,
201
],
[
201,
202
],
[
202,
203
],
[
203,
204
],
[
199,
205
],
[
205,
206
]
] | [
"import java.util.Scanner;\nclass Main{\n int r,c,x,y;\n public void solve(){\n Scanner sc = new Scanner(System.in);\n r = sc.nextInt();\n c = sc.nextInt();\n int [][] a = new int [r+1][c+1];\n for(x = r; x < r+1; x++){\n for(y = c; y < c+1; y++){\n a[x][y] = 0;\n }\n }\n for(x = 0; x < r; x++){\n for(y = 0; y < c; y++){\n a[x][y] = sc.nextInt();\n a[x][c] += a[x][y];\n a[r][y] += a[x][y];\n a[r][c] += a[x][y];\n }\n }\n for(x = 0; x < r+1; x++){\n for(y = 0; y < c; y++){\n System.out.printf(\"%d \",a[x][y]);\n }\n System.out.printf(\"%d\",a[x][y]);\n System.out.println();\n }\n }\n public static void main(String[] args){\n new Main().solve();\n }\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"class Main{\n int r,c,x,y;\n public void solve(){\n Scanner sc = new Scanner(System.in);\n r = sc.nextInt();\n c = sc.nextInt();\n int [][] a = new int [r+1][c+1];\n for(x = r; x < r+1; x++){\n for(y = c; y < c+1; y++){\n a[x][y] = 0;\n }\n }\n for(x = 0; x < r; x++){\n for(y = 0; y < c; y++){\n a[x][y] = sc.nextInt();\n a[x][c] += a[x][y];\n a[r][y] += a[x][y];\n a[r][c] += a[x][y];\n }\n }\n for(x = 0; x < r+1; x++){\n for(y = 0; y < c; y++){\n System.out.printf(\"%d \",a[x][y]);\n }\n System.out.printf(\"%d\",a[x][y]);\n System.out.println();\n }\n }\n public static void main(String[] args){\n new Main().solve();\n }\n}",
"Main",
"int r",
"r",
"c",
"c",
"x",
"x",
"y;",
"y",
"public void solve(){\n Scanner sc = new Scanner(System.in);\n r = sc.nextInt();\n c = sc.nextInt();\n int [][] a = new int [r+1][c+1];\n for(x = r; x < r+1; x++){\n for(y = c; y < c+1; y++){\n a[x][y] = 0;\n }\n }\n for(x = 0; x < r; x++){\n for(y = 0; y < c; y++){\n a[x][y] = sc.nextInt();\n a[x][c] += a[x][y];\n a[r][y] += a[x][y];\n a[r][c] += a[x][y];\n }\n }\n for(x = 0; x < r+1; x++){\n for(y = 0; y < c; y++){\n System.out.printf(\"%d \",a[x][y]);\n }\n System.out.printf(\"%d\",a[x][y]);\n System.out.println();\n }\n }",
"solve",
"{\n Scanner sc = new Scanner(System.in);\n r = sc.nextInt();\n c = sc.nextInt();\n int [][] a = new int [r+1][c+1];\n for(x = r; x < r+1; x++){\n for(y = c; y < c+1; y++){\n a[x][y] = 0;\n }\n }\n for(x = 0; x < r; x++){\n for(y = 0; y < c; y++){\n a[x][y] = sc.nextInt();\n a[x][c] += a[x][y];\n a[r][y] += a[x][y];\n a[r][c] += a[x][y];\n }\n }\n for(x = 0; x < r+1; x++){\n for(y = 0; y < c; y++){\n System.out.printf(\"%d \",a[x][y]);\n }\n System.out.printf(\"%d\",a[x][y]);\n System.out.println();\n }\n }",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"r = sc.nextInt()",
"r",
"sc.nextInt()",
"sc.nextInt",
"sc",
"c = sc.nextInt()",
"c",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int [][] a = new int [r+1][c+1];",
"a",
"new int [r+1][c+1]",
"r+1",
"r",
"1",
"c+1",
"c",
"1",
"for(x = r; x < r+1; x++){\n for(y = c; y < c+1; y++){\n a[x][y] = 0;\n }\n }",
"x = r;",
"x = r",
"x",
"r",
"x < r+1",
"x",
"r+1",
"r",
"1",
"x++",
"x++",
"x",
"{\n for(y = c; y < c+1; y++){\n a[x][y] = 0;\n }\n }",
"{\n for(y = c; y < c+1; y++){\n a[x][y] = 0;\n }\n }",
"for(y = c; y < c+1; y++){\n a[x][y] = 0;\n }",
"y = c;",
"y = c",
"y",
"c",
"y < c+1",
"y",
"c+1",
"c",
"1",
"y++",
"y++",
"y",
"{\n a[x][y] = 0;\n }",
"{\n a[x][y] = 0;\n }",
"a[x][y] = 0",
"a[x][y]",
"a[x]",
"a",
"x",
"y",
"0",
"for(x = 0; x < r; x++){\n for(y = 0; y < c; y++){\n a[x][y] = sc.nextInt();\n a[x][c] += a[x][y];\n a[r][y] += a[x][y];\n a[r][c] += a[x][y];\n }\n }",
"x = 0;",
"x = 0",
"x",
"0",
"x < r",
"x",
"r",
"x++",
"x++",
"x",
"{\n for(y = 0; y < c; y++){\n a[x][y] = sc.nextInt();\n a[x][c] += a[x][y];\n a[r][y] += a[x][y];\n a[r][c] += a[x][y];\n }\n }",
"{\n for(y = 0; y < c; y++){\n a[x][y] = sc.nextInt();\n a[x][c] += a[x][y];\n a[r][y] += a[x][y];\n a[r][c] += a[x][y];\n }\n }",
"for(y = 0; y < c; y++){\n a[x][y] = sc.nextInt();\n a[x][c] += a[x][y];\n a[r][y] += a[x][y];\n a[r][c] += a[x][y];\n }",
"y = 0;",
"y = 0",
"y",
"0",
"y < c",
"y",
"c",
"y++",
"y++",
"y",
"{\n a[x][y] = sc.nextInt();\n a[x][c] += a[x][y];\n a[r][y] += a[x][y];\n a[r][c] += a[x][y];\n }",
"{\n a[x][y] = sc.nextInt();\n a[x][c] += a[x][y];\n a[r][y] += a[x][y];\n a[r][c] += a[x][y];\n }",
"a[x][y] = sc.nextInt()",
"a[x][y]",
"a[x]",
"a",
"x",
"y",
"sc.nextInt()",
"sc.nextInt",
"sc",
"a[x][c] += a[x][y]",
"a[x][c]",
"a[x]",
"a",
"x",
"c",
"a[x][y]",
"a[x]",
"a",
"x",
"y",
"a[r][y] += a[x][y]",
"a[r][y]",
"a[r]",
"a",
"r",
"y",
"a[x][y]",
"a[x]",
"a",
"x",
"y",
"a[r][c] += a[x][y]",
"a[r][c]",
"a[r]",
"a",
"r",
"c",
"a[x][y]",
"a[x]",
"a",
"x",
"y",
"for(x = 0; x < r+1; x++){\n for(y = 0; y < c; y++){\n System.out.printf(\"%d \",a[x][y]);\n }\n System.out.printf(\"%d\",a[x][y]);\n System.out.println();\n }",
"x = 0;",
"x = 0",
"x",
"0",
"x < r+1",
"x",
"r+1",
"r",
"1",
"x++",
"x++",
"x",
"{\n for(y = 0; y < c; y++){\n System.out.printf(\"%d \",a[x][y]);\n }\n System.out.printf(\"%d\",a[x][y]);\n System.out.println();\n }",
"{\n for(y = 0; y < c; y++){\n System.out.printf(\"%d \",a[x][y]);\n }\n System.out.printf(\"%d\",a[x][y]);\n System.out.println();\n }",
"for(y = 0; y < c; y++){\n System.out.printf(\"%d \",a[x][y]);\n }",
"y = 0;",
"y = 0",
"y",
"0",
"y < c",
"y",
"c",
"y++",
"y++",
"y",
"{\n System.out.printf(\"%d \",a[x][y]);\n }",
"{\n System.out.printf(\"%d \",a[x][y]);\n }",
"System.out.printf(\"%d \",a[x][y])",
"System.out.printf",
"System.out",
"System",
"System.out",
"\"%d \"",
"a[x][y]",
"a[x]",
"a",
"x",
"y",
"System.out.printf(\"%d\",a[x][y])",
"System.out.printf",
"System.out",
"System",
"System.out",
"\"%d\"",
"a[x][y]",
"a[x]",
"a",
"x",
"y",
"System.out.println()",
"System.out.println",
"System.out",
"System",
"System.out",
"public static void main(String[] args){\n new Main().solve();\n }",
"main",
"{\n new Main().solve();\n }",
"new Main().solve()",
"new Main().solve",
"new Main()",
"String[] args",
"args"
] | import java.util.Scanner;
class Main{
int r,c,x,y;
public void solve(){
Scanner sc = new Scanner(System.in);
r = sc.nextInt();
c = sc.nextInt();
int [][] a = new int [r+1][c+1];
for(x = r; x < r+1; x++){
for(y = c; y < c+1; y++){
a[x][y] = 0;
}
}
for(x = 0; x < r; x++){
for(y = 0; y < c; y++){
a[x][y] = sc.nextInt();
a[x][c] += a[x][y];
a[r][y] += a[x][y];
a[r][c] += a[x][y];
}
}
for(x = 0; x < r+1; x++){
for(y = 0; y < c; y++){
System.out.printf("%d ",a[x][y]);
}
System.out.printf("%d",a[x][y]);
System.out.println();
}
}
public static void main(String[] args){
new Main().solve();
}
} |
[
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,
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,
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,
18,
18,
13,
13,
13,
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
],
[
164,
5
],
[
164,
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
],
[
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
],
[
76,
77
],
[
76,
78
],
[
69,
79
],
[
79,
80
],
[
80,
81
],
[
69,
82
],
[
83,
83
],
[
83,
84
],
[
84,
85
],
[
85,
86
],
[
86,
87
],
[
86,
88
],
[
84,
89
],
[
89,
90
],
[
89,
91
],
[
91,
92
],
[
91,
93
],
[
84,
94
],
[
94,
95
],
[
95,
96
],
[
84,
97
],
[
98,
98
],
[
98,
99
],
[
99,
100
],
[
100,
101
],
[
101,
102
],
[
101,
103
],
[
100,
104
],
[
104,
105
],
[
104,
106
],
[
99,
107
],
[
107,
108
],
[
108,
109
],
[
109,
110
],
[
110,
111
],
[
110,
112
],
[
109,
113
],
[
108,
114
],
[
114,
115
],
[
115,
116
],
[
115,
117
],
[
114,
118
],
[
98,
119
],
[
119,
120
],
[
120,
121
],
[
120,
122
],
[
119,
123
],
[
123,
124
],
[
124,
125
],
[
125,
126
],
[
126,
127
],
[
126,
128
],
[
125,
129
],
[
124,
130
],
[
130,
131
],
[
131,
132
],
[
131,
133
],
[
130,
134
],
[
98,
135
],
[
135,
136
],
[
136,
137
],
[
137,
138
],
[
137,
139
],
[
135,
140
],
[
140,
141
],
[
141,
142
],
[
141,
143
],
[
140,
144
],
[
98,
145
],
[
145,
146
],
[
146,
147
],
[
146,
148
],
[
145,
149
],
[
149,
150
],
[
150,
151
],
[
151,
152
],
[
152,
153
],
[
152,
154
],
[
150,
155
],
[
83,
156
],
[
156,
157
],
[
157,
158
],
[
158,
159
],
[
158,
160
],
[
6,
161
],
[
161,
162
],
[
0,
163
],
[
163,
164
],
[
163,
165
]
] | [
"import java.util.Scanner;\n\npublic class Main {\n\n\tpublic static void main(String[] args) {\n\t\t// TODO ?????????????????????????????????????????????\n\n\t\tScanner scan = new Scanner(System.in);\n\n\t\tint intSumNum = 0;\n\n\t\tint r = scan.nextInt();\n\t\tint c = scan.nextInt();\n\t\tint[][] ary = new int[r+1][c+1];\n\n\t\t//r*c\n\t\tfor(int i =0; i < r ; i++){\n\n\t\t\tfor(int j = 0; j < c; j++ ){\n\n\t\t\t\tary[i][j] = scan.nextInt();\n\t\t\t}\n\t\t}\n\t\tfor(int k = 0; k < r + 1; k++){\n\t\t\tfor(int l = 0; l < c + 1; l++){\n\t\t\t\t//?????????????????????????????????????????????\n\t\t\t\tif(l != c && k != r){\n\t\t\t\t\tary[k][c] += ary[k][l];\n\t\t\t\t}\n\t\t\t\t//???????????????????????????\n\t\t\t\tif(k != r){\n\t\t\t\t\tary[r][l] += ary[k][l];\n\t\t\t\t}\n\n\t\t\t\tSystem.out.print(ary[k][l]);\n\t\t\t\tif(l != c){\n\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t}\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}\n\t}\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n\n\tpublic static void main(String[] args) {\n\t\t// TODO ?????????????????????????????????????????????\n\n\t\tScanner scan = new Scanner(System.in);\n\n\t\tint intSumNum = 0;\n\n\t\tint r = scan.nextInt();\n\t\tint c = scan.nextInt();\n\t\tint[][] ary = new int[r+1][c+1];\n\n\t\t//r*c\n\t\tfor(int i =0; i < r ; i++){\n\n\t\t\tfor(int j = 0; j < c; j++ ){\n\n\t\t\t\tary[i][j] = scan.nextInt();\n\t\t\t}\n\t\t}\n\t\tfor(int k = 0; k < r + 1; k++){\n\t\t\tfor(int l = 0; l < c + 1; l++){\n\t\t\t\t//?????????????????????????????????????????????\n\t\t\t\tif(l != c && k != r){\n\t\t\t\t\tary[k][c] += ary[k][l];\n\t\t\t\t}\n\t\t\t\t//???????????????????????????\n\t\t\t\tif(k != r){\n\t\t\t\t\tary[r][l] += ary[k][l];\n\t\t\t\t}\n\n\t\t\t\tSystem.out.print(ary[k][l]);\n\t\t\t\tif(l != c){\n\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t}\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}\n\t}\n}",
"Main",
"public static void main(String[] args) {\n\t\t// TODO ?????????????????????????????????????????????\n\n\t\tScanner scan = new Scanner(System.in);\n\n\t\tint intSumNum = 0;\n\n\t\tint r = scan.nextInt();\n\t\tint c = scan.nextInt();\n\t\tint[][] ary = new int[r+1][c+1];\n\n\t\t//r*c\n\t\tfor(int i =0; i < r ; i++){\n\n\t\t\tfor(int j = 0; j < c; j++ ){\n\n\t\t\t\tary[i][j] = scan.nextInt();\n\t\t\t}\n\t\t}\n\t\tfor(int k = 0; k < r + 1; k++){\n\t\t\tfor(int l = 0; l < c + 1; l++){\n\t\t\t\t//?????????????????????????????????????????????\n\t\t\t\tif(l != c && k != r){\n\t\t\t\t\tary[k][c] += ary[k][l];\n\t\t\t\t}\n\t\t\t\t//???????????????????????????\n\t\t\t\tif(k != r){\n\t\t\t\t\tary[r][l] += ary[k][l];\n\t\t\t\t}\n\n\t\t\t\tSystem.out.print(ary[k][l]);\n\t\t\t\tif(l != c){\n\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t}\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}\n\t}",
"main",
"{\n\t\t// TODO ?????????????????????????????????????????????\n\n\t\tScanner scan = new Scanner(System.in);\n\n\t\tint intSumNum = 0;\n\n\t\tint r = scan.nextInt();\n\t\tint c = scan.nextInt();\n\t\tint[][] ary = new int[r+1][c+1];\n\n\t\t//r*c\n\t\tfor(int i =0; i < r ; i++){\n\n\t\t\tfor(int j = 0; j < c; j++ ){\n\n\t\t\t\tary[i][j] = scan.nextInt();\n\t\t\t}\n\t\t}\n\t\tfor(int k = 0; k < r + 1; k++){\n\t\t\tfor(int l = 0; l < c + 1; l++){\n\t\t\t\t//?????????????????????????????????????????????\n\t\t\t\tif(l != c && k != r){\n\t\t\t\t\tary[k][c] += ary[k][l];\n\t\t\t\t}\n\t\t\t\t//???????????????????????????\n\t\t\t\tif(k != r){\n\t\t\t\t\tary[r][l] += ary[k][l];\n\t\t\t\t}\n\n\t\t\t\tSystem.out.print(ary[k][l]);\n\t\t\t\tif(l != c){\n\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t}\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}\n\t}",
"Scanner scan = new Scanner(System.in);",
"scan",
"new Scanner(System.in)",
"int intSumNum = 0;",
"intSumNum",
"0",
"int r = scan.nextInt();",
"r",
"scan.nextInt()",
"scan.nextInt",
"scan",
"int c = scan.nextInt();",
"c",
"scan.nextInt()",
"scan.nextInt",
"scan",
"int[][] ary = new int[r+1][c+1];",
"ary",
"new int[r+1][c+1]",
"r+1",
"r",
"1",
"c+1",
"c",
"1",
"for(int i =0; i < r ; i++){\n\n\t\t\tfor(int j = 0; j < c; j++ ){\n\n\t\t\t\tary[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\n\t\t\tfor(int j = 0; j < c; j++ ){\n\n\t\t\t\tary[i][j] = scan.nextInt();\n\t\t\t}\n\t\t}",
"{\n\n\t\t\tfor(int j = 0; j < c; j++ ){\n\n\t\t\t\tary[i][j] = scan.nextInt();\n\t\t\t}\n\t\t}",
"for(int j = 0; j < c; j++ ){\n\n\t\t\t\tary[i][j] = scan.nextInt();\n\t\t\t}",
"int j = 0;",
"int j = 0;",
"j",
"0",
"j < c",
"j",
"c",
"j++",
"j++",
"j",
"{\n\n\t\t\t\tary[i][j] = scan.nextInt();\n\t\t\t}",
"{\n\n\t\t\t\tary[i][j] = scan.nextInt();\n\t\t\t}",
"ary[i][j] = scan.nextInt()",
"ary[i][j]",
"ary[i]",
"ary",
"i",
"j",
"scan.nextInt()",
"scan.nextInt",
"scan",
"for(int k = 0; k < r + 1; k++){\n\t\t\tfor(int l = 0; l < c + 1; l++){\n\t\t\t\t//?????????????????????????????????????????????\n\t\t\t\tif(l != c && k != r){\n\t\t\t\t\tary[k][c] += ary[k][l];\n\t\t\t\t}\n\t\t\t\t//???????????????????????????\n\t\t\t\tif(k != r){\n\t\t\t\t\tary[r][l] += ary[k][l];\n\t\t\t\t}\n\n\t\t\t\tSystem.out.print(ary[k][l]);\n\t\t\t\tif(l != c){\n\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t}\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}",
"int k = 0;",
"int k = 0;",
"k",
"0",
"k < r + 1",
"k",
"r + 1",
"r",
"1",
"k++",
"k++",
"k",
"{\n\t\t\tfor(int l = 0; l < c + 1; l++){\n\t\t\t\t//?????????????????????????????????????????????\n\t\t\t\tif(l != c && k != r){\n\t\t\t\t\tary[k][c] += ary[k][l];\n\t\t\t\t}\n\t\t\t\t//???????????????????????????\n\t\t\t\tif(k != r){\n\t\t\t\t\tary[r][l] += ary[k][l];\n\t\t\t\t}\n\n\t\t\t\tSystem.out.print(ary[k][l]);\n\t\t\t\tif(l != c){\n\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t}\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}",
"{\n\t\t\tfor(int l = 0; l < c + 1; l++){\n\t\t\t\t//?????????????????????????????????????????????\n\t\t\t\tif(l != c && k != r){\n\t\t\t\t\tary[k][c] += ary[k][l];\n\t\t\t\t}\n\t\t\t\t//???????????????????????????\n\t\t\t\tif(k != r){\n\t\t\t\t\tary[r][l] += ary[k][l];\n\t\t\t\t}\n\n\t\t\t\tSystem.out.print(ary[k][l]);\n\t\t\t\tif(l != c){\n\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t}\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}",
"for(int l = 0; l < c + 1; l++){\n\t\t\t\t//?????????????????????????????????????????????\n\t\t\t\tif(l != c && k != r){\n\t\t\t\t\tary[k][c] += ary[k][l];\n\t\t\t\t}\n\t\t\t\t//???????????????????????????\n\t\t\t\tif(k != r){\n\t\t\t\t\tary[r][l] += ary[k][l];\n\t\t\t\t}\n\n\t\t\t\tSystem.out.print(ary[k][l]);\n\t\t\t\tif(l != c){\n\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t}\n\t\t\t}",
"int l = 0;",
"int l = 0;",
"l",
"0",
"l < c + 1",
"l",
"c + 1",
"c",
"1",
"l++",
"l++",
"l",
"{\n\t\t\t\t//?????????????????????????????????????????????\n\t\t\t\tif(l != c && k != r){\n\t\t\t\t\tary[k][c] += ary[k][l];\n\t\t\t\t}\n\t\t\t\t//???????????????????????????\n\t\t\t\tif(k != r){\n\t\t\t\t\tary[r][l] += ary[k][l];\n\t\t\t\t}\n\n\t\t\t\tSystem.out.print(ary[k][l]);\n\t\t\t\tif(l != c){\n\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t}\n\t\t\t}",
"{\n\t\t\t\t//?????????????????????????????????????????????\n\t\t\t\tif(l != c && k != r){\n\t\t\t\t\tary[k][c] += ary[k][l];\n\t\t\t\t}\n\t\t\t\t//???????????????????????????\n\t\t\t\tif(k != r){\n\t\t\t\t\tary[r][l] += ary[k][l];\n\t\t\t\t}\n\n\t\t\t\tSystem.out.print(ary[k][l]);\n\t\t\t\tif(l != c){\n\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t}\n\t\t\t}",
"if(l != c && k != r){\n\t\t\t\t\tary[k][c] += ary[k][l];\n\t\t\t\t}",
"l != c && k != r",
"l != c",
"l",
"c",
"k != r",
"k",
"r",
"{\n\t\t\t\t\tary[k][c] += ary[k][l];\n\t\t\t\t}",
"ary[k][c] += ary[k][l]",
"ary[k][c]",
"ary[k]",
"ary",
"k",
"c",
"ary[k][l]",
"ary[k]",
"ary",
"k",
"l",
"if(k != r){\n\t\t\t\t\tary[r][l] += ary[k][l];\n\t\t\t\t}",
"k != r",
"k",
"r",
"{\n\t\t\t\t\tary[r][l] += ary[k][l];\n\t\t\t\t}",
"ary[r][l] += ary[k][l]",
"ary[r][l]",
"ary[r]",
"ary",
"r",
"l",
"ary[k][l]",
"ary[k]",
"ary",
"k",
"l",
"System.out.print(ary[k][l])",
"System.out.print",
"System.out",
"System",
"System.out",
"ary[k][l]",
"ary[k]",
"ary",
"k",
"l",
"if(l != c){\n\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t}",
"l != c",
"l",
"c",
"{\n\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t}",
"System.out.print(\" \")",
"System.out.print",
"System.out",
"System",
"System.out",
"\" \"",
"System.out.println()",
"System.out.println",
"System.out",
"System",
"System.out",
"String[] args",
"args",
"public class Main {\n\n\tpublic static void main(String[] args) {\n\t\t// TODO ?????????????????????????????????????????????\n\n\t\tScanner scan = new Scanner(System.in);\n\n\t\tint intSumNum = 0;\n\n\t\tint r = scan.nextInt();\n\t\tint c = scan.nextInt();\n\t\tint[][] ary = new int[r+1][c+1];\n\n\t\t//r*c\n\t\tfor(int i =0; i < r ; i++){\n\n\t\t\tfor(int j = 0; j < c; j++ ){\n\n\t\t\t\tary[i][j] = scan.nextInt();\n\t\t\t}\n\t\t}\n\t\tfor(int k = 0; k < r + 1; k++){\n\t\t\tfor(int l = 0; l < c + 1; l++){\n\t\t\t\t//?????????????????????????????????????????????\n\t\t\t\tif(l != c && k != r){\n\t\t\t\t\tary[k][c] += ary[k][l];\n\t\t\t\t}\n\t\t\t\t//???????????????????????????\n\t\t\t\tif(k != r){\n\t\t\t\t\tary[r][l] += ary[k][l];\n\t\t\t\t}\n\n\t\t\t\tSystem.out.print(ary[k][l]);\n\t\t\t\tif(l != c){\n\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t}\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}\n\t}\n}",
"public class Main {\n\n\tpublic static void main(String[] args) {\n\t\t// TODO ?????????????????????????????????????????????\n\n\t\tScanner scan = new Scanner(System.in);\n\n\t\tint intSumNum = 0;\n\n\t\tint r = scan.nextInt();\n\t\tint c = scan.nextInt();\n\t\tint[][] ary = new int[r+1][c+1];\n\n\t\t//r*c\n\t\tfor(int i =0; i < r ; i++){\n\n\t\t\tfor(int j = 0; j < c; j++ ){\n\n\t\t\t\tary[i][j] = scan.nextInt();\n\t\t\t}\n\t\t}\n\t\tfor(int k = 0; k < r + 1; k++){\n\t\t\tfor(int l = 0; l < c + 1; l++){\n\t\t\t\t//?????????????????????????????????????????????\n\t\t\t\tif(l != c && k != r){\n\t\t\t\t\tary[k][c] += ary[k][l];\n\t\t\t\t}\n\t\t\t\t//???????????????????????????\n\t\t\t\tif(k != r){\n\t\t\t\t\tary[r][l] += ary[k][l];\n\t\t\t\t}\n\n\t\t\t\tSystem.out.print(ary[k][l]);\n\t\t\t\tif(l != c){\n\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t}\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}\n\t}\n}",
"Main"
] | import java.util.Scanner;
public class Main {
public static void main(String[] args) {
// TODO ?????????????????????????????????????????????
Scanner scan = new Scanner(System.in);
int intSumNum = 0;
int r = scan.nextInt();
int c = scan.nextInt();
int[][] ary = new int[r+1][c+1];
//r*c
for(int i =0; i < r ; i++){
for(int j = 0; j < c; j++ ){
ary[i][j] = scan.nextInt();
}
}
for(int k = 0; k < r + 1; k++){
for(int l = 0; l < c + 1; l++){
//?????????????????????????????????????????????
if(l != c && k != r){
ary[k][c] += ary[k][l];
}
//???????????????????????????
if(k != r){
ary[r][l] += ary[k][l];
}
System.out.print(ary[k][l]);
if(l != 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,
0,
18,
18,
13,
13,
13,
18,
18,
13,
13,
13,
0,
18,
18,
13,
13,
13,
18,
18,
13,
13,
13,
0,
18,
18,
13,
13,
13,
18,
18,
13,
13,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
4,
18,
18,
13,
13,
18,
18,
13,
13,
13,
14,
2,
13,
13,
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
],
[
156,
5
],
[
156,
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
],
[
131,
133
],
[
130,
134
],
[
124,
135
],
[
135,
136
],
[
136,
137
],
[
136,
138
],
[
135,
139
],
[
139,
140
],
[
140,
141
],
[
141,
142
],
[
142,
143
],
[
142,
144
],
[
140,
145
],
[
135,
146
],
[
146,
147
],
[
147,
148
],
[
148,
149
],
[
149,
150
],
[
149,
151
],
[
147,
152
],
[
6,
153
],
[
153,
154
],
[
0,
155
],
[
155,
156
],
[
155,
157
]
] | [
"import java.util.Scanner;\npublic class Main {\n\n\tpublic static void main(String[] args) {\n\t\t//??\\????????????\n\t\tScanner sc = new Scanner(System.in);\n\t\tint r = sc.nextInt();\n\t\tint c = sc.nextInt();\n\t\tint[][] rc = new int[r+1][c+1];\n\t\t//?¨????\n\t\tfor (int ri = 0; ri < r; ri++) {\n\t\t\tfor (int ci = 0; ci < c; ci++) {\n\t\t\t\trc[ri][ci] = sc.nextInt();\n\t\t\t\trc[r][ci] += rc[ri][ci];\n\t\t\t\trc[ri][c] += rc[ri][ci];\n\t\t\t}\n\t\t\trc[r][c] += rc[ri][c];\n\t\t}\n\t\t//??????\n\t\tfor (int ri = 0; ri <= r; ri++) {\n\t\t\tfor (int ci = 0; ci <= c; ci++) {\n\t\t\t\tSystem.out.print(rc[ri][ci]);\n\t\t\t\tif (ci < c) {\n\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t} else {\n\t\t\t\t\tSystem.out.println(\"\");\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\t//??\\????????????\n\t\tScanner sc = new Scanner(System.in);\n\t\tint r = sc.nextInt();\n\t\tint c = sc.nextInt();\n\t\tint[][] rc = new int[r+1][c+1];\n\t\t//?¨????\n\t\tfor (int ri = 0; ri < r; ri++) {\n\t\t\tfor (int ci = 0; ci < c; ci++) {\n\t\t\t\trc[ri][ci] = sc.nextInt();\n\t\t\t\trc[r][ci] += rc[ri][ci];\n\t\t\t\trc[ri][c] += rc[ri][ci];\n\t\t\t}\n\t\t\trc[r][c] += rc[ri][c];\n\t\t}\n\t\t//??????\n\t\tfor (int ri = 0; ri <= r; ri++) {\n\t\t\tfor (int ci = 0; ci <= c; ci++) {\n\t\t\t\tSystem.out.print(rc[ri][ci]);\n\t\t\t\tif (ci < c) {\n\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t} else {\n\t\t\t\t\tSystem.out.println(\"\");\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\t//??\\????????????\n\t\tScanner sc = new Scanner(System.in);\n\t\tint r = sc.nextInt();\n\t\tint c = sc.nextInt();\n\t\tint[][] rc = new int[r+1][c+1];\n\t\t//?¨????\n\t\tfor (int ri = 0; ri < r; ri++) {\n\t\t\tfor (int ci = 0; ci < c; ci++) {\n\t\t\t\trc[ri][ci] = sc.nextInt();\n\t\t\t\trc[r][ci] += rc[ri][ci];\n\t\t\t\trc[ri][c] += rc[ri][ci];\n\t\t\t}\n\t\t\trc[r][c] += rc[ri][c];\n\t\t}\n\t\t//??????\n\t\tfor (int ri = 0; ri <= r; ri++) {\n\t\t\tfor (int ci = 0; ci <= c; ci++) {\n\t\t\t\tSystem.out.print(rc[ri][ci]);\n\t\t\t\tif (ci < c) {\n\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t} else {\n\t\t\t\t\tSystem.out.println(\"\");\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"main",
"{\n\t\t//??\\????????????\n\t\tScanner sc = new Scanner(System.in);\n\t\tint r = sc.nextInt();\n\t\tint c = sc.nextInt();\n\t\tint[][] rc = new int[r+1][c+1];\n\t\t//?¨????\n\t\tfor (int ri = 0; ri < r; ri++) {\n\t\t\tfor (int ci = 0; ci < c; ci++) {\n\t\t\t\trc[ri][ci] = sc.nextInt();\n\t\t\t\trc[r][ci] += rc[ri][ci];\n\t\t\t\trc[ri][c] += rc[ri][ci];\n\t\t\t}\n\t\t\trc[r][c] += rc[ri][c];\n\t\t}\n\t\t//??????\n\t\tfor (int ri = 0; ri <= r; ri++) {\n\t\t\tfor (int ci = 0; ci <= c; ci++) {\n\t\t\t\tSystem.out.print(rc[ri][ci]);\n\t\t\t\tif (ci < c) {\n\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t} else {\n\t\t\t\t\tSystem.out.println(\"\");\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"int 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 ri = 0; ri < r; ri++) {\n\t\t\tfor (int ci = 0; ci < c; ci++) {\n\t\t\t\trc[ri][ci] = sc.nextInt();\n\t\t\t\trc[r][ci] += rc[ri][ci];\n\t\t\t\trc[ri][c] += rc[ri][ci];\n\t\t\t}\n\t\t\trc[r][c] += rc[ri][c];\n\t\t}",
"int ri = 0;",
"int ri = 0;",
"ri",
"0",
"ri < r",
"ri",
"r",
"ri++",
"ri++",
"ri",
"{\n\t\t\tfor (int ci = 0; ci < c; ci++) {\n\t\t\t\trc[ri][ci] = sc.nextInt();\n\t\t\t\trc[r][ci] += rc[ri][ci];\n\t\t\t\trc[ri][c] += rc[ri][ci];\n\t\t\t}\n\t\t\trc[r][c] += rc[ri][c];\n\t\t}",
"{\n\t\t\tfor (int ci = 0; ci < c; ci++) {\n\t\t\t\trc[ri][ci] = sc.nextInt();\n\t\t\t\trc[r][ci] += rc[ri][ci];\n\t\t\t\trc[ri][c] += rc[ri][ci];\n\t\t\t}\n\t\t\trc[r][c] += rc[ri][c];\n\t\t}",
"for (int ci = 0; ci < c; ci++) {\n\t\t\t\trc[ri][ci] = sc.nextInt();\n\t\t\t\trc[r][ci] += rc[ri][ci];\n\t\t\t\trc[ri][c] += rc[ri][ci];\n\t\t\t}",
"int ci = 0;",
"int ci = 0;",
"ci",
"0",
"ci < c",
"ci",
"c",
"ci++",
"ci++",
"ci",
"{\n\t\t\t\trc[ri][ci] = sc.nextInt();\n\t\t\t\trc[r][ci] += rc[ri][ci];\n\t\t\t\trc[ri][c] += rc[ri][ci];\n\t\t\t}",
"{\n\t\t\t\trc[ri][ci] = sc.nextInt();\n\t\t\t\trc[r][ci] += rc[ri][ci];\n\t\t\t\trc[ri][c] += rc[ri][ci];\n\t\t\t}",
"rc[ri][ci] = sc.nextInt()",
"rc[ri][ci]",
"rc[ri]",
"rc",
"ri",
"ci",
"sc.nextInt()",
"sc.nextInt",
"sc",
"rc[r][ci] += rc[ri][ci]",
"rc[r][ci]",
"rc[r]",
"rc",
"r",
"ci",
"rc[ri][ci]",
"rc[ri]",
"rc",
"ri",
"ci",
"rc[ri][c] += rc[ri][ci]",
"rc[ri][c]",
"rc[ri]",
"rc",
"ri",
"c",
"rc[ri][ci]",
"rc[ri]",
"rc",
"ri",
"ci",
"rc[r][c] += rc[ri][c]",
"rc[r][c]",
"rc[r]",
"rc",
"r",
"c",
"rc[ri][c]",
"rc[ri]",
"rc",
"ri",
"c",
"for (int ri = 0; ri <= r; ri++) {\n\t\t\tfor (int ci = 0; ci <= c; ci++) {\n\t\t\t\tSystem.out.print(rc[ri][ci]);\n\t\t\t\tif (ci < c) {\n\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t} else {\n\t\t\t\t\tSystem.out.println(\"\");\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"int ri = 0;",
"int ri = 0;",
"ri",
"0",
"ri <= r",
"ri",
"r",
"ri++",
"ri++",
"ri",
"{\n\t\t\tfor (int ci = 0; ci <= c; ci++) {\n\t\t\t\tSystem.out.print(rc[ri][ci]);\n\t\t\t\tif (ci < c) {\n\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t} else {\n\t\t\t\t\tSystem.out.println(\"\");\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"{\n\t\t\tfor (int ci = 0; ci <= c; ci++) {\n\t\t\t\tSystem.out.print(rc[ri][ci]);\n\t\t\t\tif (ci < c) {\n\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t} else {\n\t\t\t\t\tSystem.out.println(\"\");\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"for (int ci = 0; ci <= c; ci++) {\n\t\t\t\tSystem.out.print(rc[ri][ci]);\n\t\t\t\tif (ci < c) {\n\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t} else {\n\t\t\t\t\tSystem.out.println(\"\");\n\t\t\t\t}\n\t\t\t}",
"int ci = 0;",
"int ci = 0;",
"ci",
"0",
"ci <= c",
"ci",
"c",
"ci++",
"ci++",
"ci",
"{\n\t\t\t\tSystem.out.print(rc[ri][ci]);\n\t\t\t\tif (ci < c) {\n\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t} else {\n\t\t\t\t\tSystem.out.println(\"\");\n\t\t\t\t}\n\t\t\t}",
"{\n\t\t\t\tSystem.out.print(rc[ri][ci]);\n\t\t\t\tif (ci < c) {\n\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t} else {\n\t\t\t\t\tSystem.out.println(\"\");\n\t\t\t\t}\n\t\t\t}",
"System.out.print(rc[ri][ci])",
"System.out.print",
"System.out",
"System",
"System.out",
"rc[ri][ci]",
"rc[ri]",
"rc",
"ri",
"ci",
"if (ci < c) {\n\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t} else {\n\t\t\t\t\tSystem.out.println(\"\");\n\t\t\t\t}",
"ci < c",
"ci",
"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.println(\"\");\n\t\t\t\t}",
"System.out.println(\"\")",
"System.out.println",
"System.out",
"System",
"System.out",
"\"\"",
"String[] args",
"args",
"public class Main {\n\n\tpublic static void main(String[] args) {\n\t\t//??\\????????????\n\t\tScanner sc = new Scanner(System.in);\n\t\tint r = sc.nextInt();\n\t\tint c = sc.nextInt();\n\t\tint[][] rc = new int[r+1][c+1];\n\t\t//?¨????\n\t\tfor (int ri = 0; ri < r; ri++) {\n\t\t\tfor (int ci = 0; ci < c; ci++) {\n\t\t\t\trc[ri][ci] = sc.nextInt();\n\t\t\t\trc[r][ci] += rc[ri][ci];\n\t\t\t\trc[ri][c] += rc[ri][ci];\n\t\t\t}\n\t\t\trc[r][c] += rc[ri][c];\n\t\t}\n\t\t//??????\n\t\tfor (int ri = 0; ri <= r; ri++) {\n\t\t\tfor (int ci = 0; ci <= c; ci++) {\n\t\t\t\tSystem.out.print(rc[ri][ci]);\n\t\t\t\tif (ci < c) {\n\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t} else {\n\t\t\t\t\tSystem.out.println(\"\");\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\t//??\\????????????\n\t\tScanner sc = new Scanner(System.in);\n\t\tint r = sc.nextInt();\n\t\tint c = sc.nextInt();\n\t\tint[][] rc = new int[r+1][c+1];\n\t\t//?¨????\n\t\tfor (int ri = 0; ri < r; ri++) {\n\t\t\tfor (int ci = 0; ci < c; ci++) {\n\t\t\t\trc[ri][ci] = sc.nextInt();\n\t\t\t\trc[r][ci] += rc[ri][ci];\n\t\t\t\trc[ri][c] += rc[ri][ci];\n\t\t\t}\n\t\t\trc[r][c] += rc[ri][c];\n\t\t}\n\t\t//??????\n\t\tfor (int ri = 0; ri <= r; ri++) {\n\t\t\tfor (int ci = 0; ci <= c; ci++) {\n\t\t\t\tSystem.out.print(rc[ri][ci]);\n\t\t\t\tif (ci < c) {\n\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t} else {\n\t\t\t\t\tSystem.out.println(\"\");\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[][] rc = new int[r+1][c+1];
//?¨????
for (int ri = 0; ri < r; ri++) {
for (int ci = 0; ci < c; ci++) {
rc[ri][ci] = sc.nextInt();
rc[r][ci] += rc[ri][ci];
rc[ri][c] += rc[ri][ci];
}
rc[r][c] += rc[ri][c];
}
//??????
for (int ri = 0; ri <= r; ri++) {
for (int ci = 0; ci <= c; ci++) {
System.out.print(rc[ri][ci]);
if (ci < c) {
System.out.print(" ");
} else {
System.out.println("");
}
}
}
}
} |
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
41,
13,
20,
2,
13,
17,
2,
13,
17,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
41,
13,
4,
18,
13,
0,
18,
18,
13,
13,
13,
13,
0,
18,
18,
13,
13,
13,
13,
0,
18,
18,
13,
13,
13,
13,
0,
13,
13,
0,
18,
18,
13,
13,
13,
13,
11,
1,
41,
13,
17,
2,
13,
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
],
[
145,
5
],
[
145,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
8,
17
],
[
17,
18
],
[
17,
19
],
[
19,
20
],
[
20,
21
],
[
8,
22
],
[
22,
23
],
[
22,
24
],
[
25,
26
],
[
25,
27
],
[
28,
29
],
[
28,
30
],
[
8,
31
],
[
31,
32
],
[
31,
33
],
[
8,
34
],
[
34,
35
],
[
35,
36
],
[
36,
37
],
[
36,
38
],
[
34,
39
],
[
39,
40
],
[
39,
41
],
[
34,
42
],
[
42,
43
],
[
43,
44
],
[
34,
45
],
[
46,
46
],
[
46,
47
],
[
47,
48
],
[
48,
49
],
[
49,
50
],
[
49,
51
],
[
47,
52
],
[
52,
53
],
[
52,
54
],
[
47,
55
],
[
55,
56
],
[
56,
57
],
[
47,
58
],
[
59,
59
],
[
59,
60
],
[
60,
61
],
[
60,
62
],
[
62,
63
],
[
63,
64
],
[
59,
65
],
[
65,
66
],
[
66,
67
],
[
67,
68
],
[
67,
69
],
[
66,
70
],
[
65,
71
],
[
59,
72
],
[
72,
73
],
[
73,
74
],
[
74,
75
],
[
74,
76
],
[
73,
77
],
[
72,
78
],
[
59,
79
],
[
79,
80
],
[
80,
81
],
[
81,
82
],
[
81,
83
],
[
80,
84
],
[
79,
85
],
[
59,
86
],
[
86,
87
],
[
86,
88
],
[
8,
89
],
[
89,
90
],
[
90,
91
],
[
91,
92
],
[
91,
93
],
[
90,
94
],
[
89,
95
],
[
8,
96
],
[
96,
97
],
[
97,
98
],
[
98,
99
],
[
98,
100
],
[
96,
101
],
[
101,
102
],
[
101,
103
],
[
103,
104
],
[
103,
105
],
[
96,
106
],
[
106,
107
],
[
107,
108
],
[
96,
109
],
[
110,
110
],
[
110,
111
],
[
111,
112
],
[
112,
113
],
[
113,
114
],
[
113,
115
],
[
111,
116
],
[
116,
117
],
[
116,
118
],
[
118,
119
],
[
118,
120
],
[
111,
121
],
[
121,
122
],
[
122,
123
],
[
111,
124
],
[
125,
125
],
[
125,
126
],
[
126,
127
],
[
127,
128
],
[
128,
129
],
[
128,
130
],
[
126,
131
],
[
131,
132
],
[
132,
133
],
[
132,
134
],
[
131,
135
],
[
131,
136
],
[
126,
137
],
[
137,
138
],
[
138,
139
],
[
138,
140
],
[
137,
141
],
[
6,
142
],
[
142,
143
],
[
0,
144
],
[
144,
145
],
[
144,
146
]
] | [
"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 sum = 0;\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\ttable[i][c] += n;\n\t\t\t\ttable[r][j] += n;\n\t\t\t\tsum += n;\n\t\t\t}\n\t\t}\n\t\ttable[r][c] = sum;\n\n\t\tfor(int i = 0; i < r + 1; i++){\n\t\t\tfor(int j = 0; j < c + 1; j++){\n\t\t\t\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 sum = 0;\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\ttable[i][c] += n;\n\t\t\t\ttable[r][j] += n;\n\t\t\t\tsum += n;\n\t\t\t}\n\t\t}\n\t\ttable[r][c] = sum;\n\n\t\tfor(int i = 0; i < r + 1; i++){\n\t\t\tfor(int j = 0; j < c + 1; j++){\n\t\t\t\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 sum = 0;\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\ttable[i][c] += n;\n\t\t\t\ttable[r][j] += n;\n\t\t\t\tsum += n;\n\t\t\t}\n\t\t}\n\t\ttable[r][c] = sum;\n\n\t\tfor(int i = 0; i < r + 1; i++){\n\t\t\tfor(int j = 0; j < c + 1; j++){\n\t\t\t\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 sum = 0;\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\ttable[i][c] += n;\n\t\t\t\ttable[r][j] += n;\n\t\t\t\tsum += n;\n\t\t\t}\n\t\t}\n\t\ttable[r][c] = sum;\n\n\t\tfor(int i = 0; i < r + 1; i++){\n\t\t\tfor(int j = 0; j < c + 1; j++){\n\t\t\t\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 sum = 0;",
"sum",
"0",
"for(int i = 0; i < r; i++){\n\t\t\tfor(int j = 0; j < c; j++){\n\t\t\t\tint n = scan.nextInt();\n\t\t\t\ttable[i][j] = n;\n\t\t\t\ttable[i][c] += n;\n\t\t\t\ttable[r][j] += n;\n\t\t\t\tsum += 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\ttable[i][c] += n;\n\t\t\t\ttable[r][j] += n;\n\t\t\t\tsum += 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\ttable[i][c] += n;\n\t\t\t\ttable[r][j] += n;\n\t\t\t\tsum += 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\ttable[i][c] += n;\n\t\t\t\ttable[r][j] += n;\n\t\t\t\tsum += 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\ttable[i][c] += n;\n\t\t\t\ttable[r][j] += n;\n\t\t\t\tsum += 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\ttable[i][c] += n;\n\t\t\t\ttable[r][j] += n;\n\t\t\t\tsum += 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",
"table[i][c] += n",
"table[i][c]",
"table[i]",
"table",
"i",
"c",
"n",
"table[r][j] += n",
"table[r][j]",
"table[r]",
"table",
"r",
"j",
"n",
"sum += n",
"sum",
"n",
"table[r][c] = sum",
"table[r][c]",
"table[r]",
"table",
"r",
"c",
"sum",
"for(int i = 0; i < r + 1; i++){\n\t\t\tfor(int j = 0; j < c + 1; j++){\n\t\t\t\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 sum = 0;\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\ttable[i][c] += n;\n\t\t\t\ttable[r][j] += n;\n\t\t\t\tsum += n;\n\t\t\t}\n\t\t}\n\t\ttable[r][c] = sum;\n\n\t\tfor(int i = 0; i < r + 1; i++){\n\t\t\tfor(int j = 0; j < c + 1; j++){\n\t\t\t\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 sum = 0;\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\ttable[i][c] += n;\n\t\t\t\ttable[r][j] += n;\n\t\t\t\tsum += n;\n\t\t\t}\n\t\t}\n\t\ttable[r][c] = sum;\n\n\t\tfor(int i = 0; i < r + 1; i++){\n\t\t\tfor(int j = 0; j < c + 1; j++){\n\t\t\t\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 sum = 0;
for(int i = 0; i < r; i++){
for(int j = 0; j < c; j++){
int n = scan.nextInt();
table[i][j] = n;
table[i][c] += n;
table[r][j] += n;
sum += n;
}
}
table[r][c] = sum;
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,
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,
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,
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
],
[
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
],
[
8,
102
],
[
102,
103
],
[
103,
104
],
[
104,
105
],
[
104,
106
],
[
102,
107
],
[
107,
108
],
[
107,
109
],
[
109,
110
],
[
109,
111
],
[
102,
112
],
[
112,
113
],
[
113,
114
],
[
102,
115
],
[
116,
116
],
[
116,
117
],
[
117,
118
],
[
118,
119
],
[
119,
120
],
[
119,
121
],
[
117,
122
],
[
122,
123
],
[
122,
124
],
[
124,
125
],
[
124,
126
],
[
117,
127
],
[
127,
128
],
[
128,
129
],
[
117,
130
],
[
131,
131
],
[
131,
132
],
[
132,
133
],
[
133,
134
],
[
134,
135
],
[
134,
136
],
[
132,
137
],
[
137,
138
],
[
138,
139
],
[
138,
140
],
[
137,
141
],
[
131,
142
],
[
142,
143
],
[
143,
144
],
[
143,
145
],
[
142,
146
],
[
146,
147
],
[
147,
148
],
[
148,
149
],
[
149,
150
],
[
149,
151
],
[
147,
152
],
[
116,
153
],
[
153,
154
],
[
154,
155
],
[
155,
156
],
[
155,
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 stdIn = new Scanner(System.in);\n\t\tint r= stdIn.nextInt();\n\t\tint c= stdIn.nextInt();\n\t\tint x[][] = 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\tx[i][j] = stdIn.nextInt();\n\t\t\t\tx[i][c] +=x[i][j];\n\t\t\t\tx[r][j] +=x[i][j];\n\t\t\t\tx[r][c] +=x[i][j];\n\t\t\t}\n\t\t}\n\t\tstdIn.close();\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(x[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}\n",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n\tpublic static void main(String[] args) {\n\t\tScanner stdIn = new Scanner(System.in);\n\t\tint r= stdIn.nextInt();\n\t\tint c= stdIn.nextInt();\n\t\tint x[][] = 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\tx[i][j] = stdIn.nextInt();\n\t\t\t\tx[i][c] +=x[i][j];\n\t\t\t\tx[r][j] +=x[i][j];\n\t\t\t\tx[r][c] +=x[i][j];\n\t\t\t}\n\t\t}\n\t\tstdIn.close();\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(x[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 stdIn = new Scanner(System.in);\n\t\tint r= stdIn.nextInt();\n\t\tint c= stdIn.nextInt();\n\t\tint x[][] = 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\tx[i][j] = stdIn.nextInt();\n\t\t\t\tx[i][c] +=x[i][j];\n\t\t\t\tx[r][j] +=x[i][j];\n\t\t\t\tx[r][c] +=x[i][j];\n\t\t\t}\n\t\t}\n\t\tstdIn.close();\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(x[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 stdIn = new Scanner(System.in);\n\t\tint r= stdIn.nextInt();\n\t\tint c= stdIn.nextInt();\n\t\tint x[][] = 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\tx[i][j] = stdIn.nextInt();\n\t\t\t\tx[i][c] +=x[i][j];\n\t\t\t\tx[r][j] +=x[i][j];\n\t\t\t\tx[r][c] +=x[i][j];\n\t\t\t}\n\t\t}\n\t\tstdIn.close();\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(x[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 stdIn = new Scanner(System.in);",
"stdIn",
"new Scanner(System.in)",
"int r= stdIn.nextInt();",
"r",
"stdIn.nextInt()",
"stdIn.nextInt",
"stdIn",
"int c= stdIn.nextInt();",
"c",
"stdIn.nextInt()",
"stdIn.nextInt",
"stdIn",
"int 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\t\tfor(int j=0;j<c; j++) {\n\t\t\t\tx[i][j] = stdIn.nextInt();\n\t\t\t\tx[i][c] +=x[i][j];\n\t\t\t\tx[r][j] +=x[i][j];\n\t\t\t\tx[r][c] +=x[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\tx[i][j] = stdIn.nextInt();\n\t\t\t\tx[i][c] +=x[i][j];\n\t\t\t\tx[r][j] +=x[i][j];\n\t\t\t\tx[r][c] +=x[i][j];\n\t\t\t}\n\t\t}",
"{\n\t\t\tfor(int j=0;j<c; j++) {\n\t\t\t\tx[i][j] = stdIn.nextInt();\n\t\t\t\tx[i][c] +=x[i][j];\n\t\t\t\tx[r][j] +=x[i][j];\n\t\t\t\tx[r][c] +=x[i][j];\n\t\t\t}\n\t\t}",
"for(int j=0;j<c; j++) {\n\t\t\t\tx[i][j] = stdIn.nextInt();\n\t\t\t\tx[i][c] +=x[i][j];\n\t\t\t\tx[r][j] +=x[i][j];\n\t\t\t\tx[r][c] +=x[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\tx[i][j] = stdIn.nextInt();\n\t\t\t\tx[i][c] +=x[i][j];\n\t\t\t\tx[r][j] +=x[i][j];\n\t\t\t\tx[r][c] +=x[i][j];\n\t\t\t}",
"{\n\t\t\t\tx[i][j] = stdIn.nextInt();\n\t\t\t\tx[i][c] +=x[i][j];\n\t\t\t\tx[r][j] +=x[i][j];\n\t\t\t\tx[r][c] +=x[i][j];\n\t\t\t}",
"x[i][j] = stdIn.nextInt()",
"x[i][j]",
"x[i]",
"x",
"i",
"j",
"stdIn.nextInt()",
"stdIn.nextInt",
"stdIn",
"x[i][c] +=x[i][j]",
"x[i][c]",
"x[i]",
"x",
"i",
"c",
"x[i][j]",
"x[i]",
"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",
"x[r][c] +=x[i][j]",
"x[r][c]",
"x[r]",
"x",
"r",
"c",
"x[i][j]",
"x[i]",
"x",
"i",
"j",
"stdIn.close()",
"stdIn.close",
"stdIn",
"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(x[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(x[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(x[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(x[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(x[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(x[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(x[i][j])",
"System.out.print",
"System.out",
"System",
"System.out",
"x[i][j]",
"x[i]",
"x",
"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 stdIn = new Scanner(System.in);\n\t\tint r= stdIn.nextInt();\n\t\tint c= stdIn.nextInt();\n\t\tint x[][] = 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\tx[i][j] = stdIn.nextInt();\n\t\t\t\tx[i][c] +=x[i][j];\n\t\t\t\tx[r][j] +=x[i][j];\n\t\t\t\tx[r][c] +=x[i][j];\n\t\t\t}\n\t\t}\n\t\tstdIn.close();\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(x[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 stdIn = new Scanner(System.in);\n\t\tint r= stdIn.nextInt();\n\t\tint c= stdIn.nextInt();\n\t\tint x[][] = 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\tx[i][j] = stdIn.nextInt();\n\t\t\t\tx[i][c] +=x[i][j];\n\t\t\t\tx[r][j] +=x[i][j];\n\t\t\t\tx[r][c] +=x[i][j];\n\t\t\t}\n\t\t}\n\t\tstdIn.close();\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(x[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 stdIn = new Scanner(System.in);
int r= stdIn.nextInt();
int c= stdIn.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] = stdIn.nextInt();
x[i][c] +=x[i][j];
x[r][j] +=x[i][j];
x[r][c] +=x[i][j];
}
}
stdIn.close();
for(int i=0;i<r+1; i++) {
for(int j=0;j<c+1; j++) {
System.out.print(x[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,
20,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
41,
13,
20,
2,
13,
17,
2,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
18,
18,
13,
13,
13,
4,
18,
13,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
18,
18,
13,
13,
13,
0,
18,
18,
13,
13,
13,
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,
18,
18,
13,
13,
13,
13,
0,
13,
17,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
18,
18,
13,
13,
13,
0,
18,
18,
13,
13,
13,
13,
11,
1,
41,
13,
17,
2,
13,
2,
13,
17,
1,
40,
13,
30,
30,
4,
18,
13,
18,
18,
13,
13,
17,
11,
1,
41,
13,
17,
2,
13,
2,
13,
17,
1,
40,
13,
30,
30,
4,
18,
4,
18,
13,
17,
18,
18,
13,
13,
13,
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
],
[
256,
5
],
[
256,
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
],
[
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
],
[
69,
71
],
[
8,
72
],
[
72,
73
],
[
73,
74
],
[
74,
75
],
[
74,
76
],
[
72,
77
],
[
77,
78
],
[
77,
79
],
[
72,
80
],
[
80,
81
],
[
81,
82
],
[
72,
83
],
[
84,
84
],
[
84,
85
],
[
85,
86
],
[
86,
87
],
[
87,
88
],
[
87,
89
],
[
85,
90
],
[
90,
91
],
[
90,
92
],
[
85,
93
],
[
93,
94
],
[
94,
95
],
[
85,
96
],
[
97,
97
],
[
97,
98
],
[
98,
99
],
[
98,
100
],
[
100,
101
],
[
101,
102
],
[
101,
103
],
[
100,
104
],
[
84,
105
],
[
105,
106
],
[
106,
107
],
[
107,
108
],
[
107,
109
],
[
106,
110
],
[
105,
111
],
[
84,
112
],
[
112,
113
],
[
112,
114
],
[
8,
115
],
[
115,
116
],
[
115,
117
],
[
8,
118
],
[
118,
119
],
[
119,
120
],
[
120,
121
],
[
120,
122
],
[
118,
123
],
[
123,
124
],
[
123,
125
],
[
118,
126
],
[
126,
127
],
[
127,
128
],
[
118,
129
],
[
130,
130
],
[
130,
131
],
[
131,
132
],
[
132,
133
],
[
133,
134
],
[
133,
135
],
[
131,
136
],
[
136,
137
],
[
136,
138
],
[
131,
139
],
[
139,
140
],
[
140,
141
],
[
131,
142
],
[
143,
143
],
[
143,
144
],
[
144,
145
],
[
144,
146
],
[
146,
147
],
[
147,
148
],
[
147,
149
],
[
146,
150
],
[
130,
151
],
[
151,
152
],
[
152,
153
],
[
153,
154
],
[
153,
155
],
[
152,
156
],
[
151,
157
],
[
130,
158
],
[
158,
159
],
[
158,
160
],
[
8,
161
],
[
161,
162
],
[
161,
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
],
[
177,
179
],
[
179,
180
],
[
180,
181
],
[
180,
182
],
[
179,
183
],
[
8,
184
],
[
184,
185
],
[
185,
186
],
[
186,
187
],
[
186,
188
],
[
185,
189
],
[
184,
190
],
[
8,
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
],
[
206,
209
],
[
209,
210
],
[
210,
211
],
[
210,
212
],
[
209,
213
],
[
205,
214
],
[
214,
215
],
[
215,
216
],
[
216,
217
],
[
216,
218
],
[
214,
219
],
[
219,
220
],
[
219,
221
],
[
221,
222
],
[
221,
223
],
[
214,
224
],
[
224,
225
],
[
225,
226
],
[
214,
227
],
[
228,
228
],
[
228,
229
],
[
229,
230
],
[
230,
231
],
[
231,
232
],
[
232,
233
],
[
231,
234
],
[
229,
235
],
[
235,
236
],
[
236,
237
],
[
236,
238
],
[
235,
239
],
[
205,
240
],
[
240,
241
],
[
241,
242
],
[
240,
243
],
[
8,
244
],
[
244,
245
],
[
245,
246
],
[
246,
247
],
[
246,
248
],
[
244,
249
],
[
8,
250
],
[
250,
251
],
[
251,
252
],
[
6,
253
],
[
253,
254
],
[
0,
255
],
[
255,
256
],
[
255,
257
]
] | [
"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 output = new StringBuilder();\n\t\tint r = scan.nextInt();\n\t\tint c = scan.nextInt();\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\tsheet[i][j] = scan.nextInt();\n\t\t\t}\n\t\t}\n\t\t\n\t\t// 表の端に合計を記録\n\t\tint sum_r = 0;\n\t\tfor (int i = 0; i < r; i++) {\n\t\t\tfor (int j = 0; j < c; j++) {\n\t\t\t\tsum_r += sheet[i][j];\n\t\t\t}\n\t\t\tsheet[i][c] = sum_r;\n\t\t\tsum_r = 0;\n\t\t}\n\t\tint sum_c = 0;\n\t\tfor (int j = 0; j < c; j++) {\n\t\t\tfor (int i = 0; i < r; i++) {\n\t\t\t\tsum_c += sheet[i][j];\n\t\t\t}\n\t\t\tsheet[r][j] = sum_c;\n\t\t\tsum_c = 0;\n\t\t}\n\t\tint sum_all = 0;\n\t\tfor (int i = 0; i < r; i++) {\n\t\t\tsum_all += sheet[i][c];\n\t\t}\n\t\tsheet[r][c] = sum_all;\n\t\t\n\t\t// 出力\n\t\tfor (int i = 0; i < r+1; i++) {\n\t\t\toutput.append(sheet[i][0]);\n\t\t\tfor (int j = 1; j < c+1; j++) {\n\t\t\t\toutput.append(\" \").append(sheet[i][j]);\n\t\t\t}\n\t\t\toutput.append('\\n');\n\t\t}\n\t\tSystem.out.print(output);\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\tStringBuilder output = new StringBuilder();\n\t\tint r = scan.nextInt();\n\t\tint c = scan.nextInt();\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\tsheet[i][j] = scan.nextInt();\n\t\t\t}\n\t\t}\n\t\t\n\t\t// 表の端に合計を記録\n\t\tint sum_r = 0;\n\t\tfor (int i = 0; i < r; i++) {\n\t\t\tfor (int j = 0; j < c; j++) {\n\t\t\t\tsum_r += sheet[i][j];\n\t\t\t}\n\t\t\tsheet[i][c] = sum_r;\n\t\t\tsum_r = 0;\n\t\t}\n\t\tint sum_c = 0;\n\t\tfor (int j = 0; j < c; j++) {\n\t\t\tfor (int i = 0; i < r; i++) {\n\t\t\t\tsum_c += sheet[i][j];\n\t\t\t}\n\t\t\tsheet[r][j] = sum_c;\n\t\t\tsum_c = 0;\n\t\t}\n\t\tint sum_all = 0;\n\t\tfor (int i = 0; i < r; i++) {\n\t\t\tsum_all += sheet[i][c];\n\t\t}\n\t\tsheet[r][c] = sum_all;\n\t\t\n\t\t// 出力\n\t\tfor (int i = 0; i < r+1; i++) {\n\t\t\toutput.append(sheet[i][0]);\n\t\t\tfor (int j = 1; j < c+1; j++) {\n\t\t\t\toutput.append(\" \").append(sheet[i][j]);\n\t\t\t}\n\t\t\toutput.append('\\n');\n\t\t}\n\t\tSystem.out.print(output);\n\t\tscan.close();\n\t}\n}",
"Main",
"public static void main(String[] args) {\n\t\tScanner scan = new Scanner(System.in);\n\t\tStringBuilder output = new StringBuilder();\n\t\tint r = scan.nextInt();\n\t\tint c = scan.nextInt();\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\tsheet[i][j] = scan.nextInt();\n\t\t\t}\n\t\t}\n\t\t\n\t\t// 表の端に合計を記録\n\t\tint sum_r = 0;\n\t\tfor (int i = 0; i < r; i++) {\n\t\t\tfor (int j = 0; j < c; j++) {\n\t\t\t\tsum_r += sheet[i][j];\n\t\t\t}\n\t\t\tsheet[i][c] = sum_r;\n\t\t\tsum_r = 0;\n\t\t}\n\t\tint sum_c = 0;\n\t\tfor (int j = 0; j < c; j++) {\n\t\t\tfor (int i = 0; i < r; i++) {\n\t\t\t\tsum_c += sheet[i][j];\n\t\t\t}\n\t\t\tsheet[r][j] = sum_c;\n\t\t\tsum_c = 0;\n\t\t}\n\t\tint sum_all = 0;\n\t\tfor (int i = 0; i < r; i++) {\n\t\t\tsum_all += sheet[i][c];\n\t\t}\n\t\tsheet[r][c] = sum_all;\n\t\t\n\t\t// 出力\n\t\tfor (int i = 0; i < r+1; i++) {\n\t\t\toutput.append(sheet[i][0]);\n\t\t\tfor (int j = 1; j < c+1; j++) {\n\t\t\t\toutput.append(\" \").append(sheet[i][j]);\n\t\t\t}\n\t\t\toutput.append('\\n');\n\t\t}\n\t\tSystem.out.print(output);\n\t\tscan.close();\n\t}",
"main",
"{\n\t\tScanner scan = new Scanner(System.in);\n\t\tStringBuilder output = new StringBuilder();\n\t\tint r = scan.nextInt();\n\t\tint c = scan.nextInt();\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\tsheet[i][j] = scan.nextInt();\n\t\t\t}\n\t\t}\n\t\t\n\t\t// 表の端に合計を記録\n\t\tint sum_r = 0;\n\t\tfor (int i = 0; i < r; i++) {\n\t\t\tfor (int j = 0; j < c; j++) {\n\t\t\t\tsum_r += sheet[i][j];\n\t\t\t}\n\t\t\tsheet[i][c] = sum_r;\n\t\t\tsum_r = 0;\n\t\t}\n\t\tint sum_c = 0;\n\t\tfor (int j = 0; j < c; j++) {\n\t\t\tfor (int i = 0; i < r; i++) {\n\t\t\t\tsum_c += sheet[i][j];\n\t\t\t}\n\t\t\tsheet[r][j] = sum_c;\n\t\t\tsum_c = 0;\n\t\t}\n\t\tint sum_all = 0;\n\t\tfor (int i = 0; i < r; i++) {\n\t\t\tsum_all += sheet[i][c];\n\t\t}\n\t\tsheet[r][c] = sum_all;\n\t\t\n\t\t// 出力\n\t\tfor (int i = 0; i < r+1; i++) {\n\t\t\toutput.append(sheet[i][0]);\n\t\t\tfor (int j = 1; j < c+1; j++) {\n\t\t\t\toutput.append(\" \").append(sheet[i][j]);\n\t\t\t}\n\t\t\toutput.append('\\n');\n\t\t}\n\t\tSystem.out.print(output);\n\t\tscan.close();\n\t}",
"Scanner scan = new Scanner(System.in);",
"scan",
"new Scanner(System.in)",
"StringBuilder output = new StringBuilder();",
"output",
"new StringBuilder()",
"int r = scan.nextInt();",
"r",
"scan.nextInt()",
"scan.nextInt",
"scan",
"int c = scan.nextInt();",
"c",
"scan.nextInt()",
"scan.nextInt",
"scan",
"int[][] sheet = new int[r+1][c+1];",
"sheet",
"new int[r+1][c+1]",
"r+1",
"r",
"1",
"c+1",
"c",
"1",
"for (int i = 0; i < r; i++) {\n\t\t\tfor (int j = 0; j < c; j++) {\n\t\t\t\tsheet[i][j] = scan.nextInt();\n\t\t\t}\n\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < r",
"i",
"r",
"i++",
"i++",
"i",
"{\n\t\t\tfor (int j = 0; j < c; j++) {\n\t\t\t\tsheet[i][j] = scan.nextInt();\n\t\t\t}\n\t\t}",
"{\n\t\t\tfor (int j = 0; j < c; j++) {\n\t\t\t\tsheet[i][j] = scan.nextInt();\n\t\t\t}\n\t\t}",
"for (int j = 0; j < c; j++) {\n\t\t\t\tsheet[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\tsheet[i][j] = scan.nextInt();\n\t\t\t}",
"{\n\t\t\t\tsheet[i][j] = scan.nextInt();\n\t\t\t}",
"sheet[i][j] = scan.nextInt()",
"sheet[i][j]",
"sheet[i]",
"sheet",
"i",
"j",
"scan.nextInt()",
"scan.nextInt",
"scan",
"int sum_r = 0;",
"sum_r",
"0",
"for (int i = 0; i < r; i++) {\n\t\t\tfor (int j = 0; j < c; j++) {\n\t\t\t\tsum_r += sheet[i][j];\n\t\t\t}\n\t\t\tsheet[i][c] = sum_r;\n\t\t\tsum_r = 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\tsum_r += sheet[i][j];\n\t\t\t}\n\t\t\tsheet[i][c] = sum_r;\n\t\t\tsum_r = 0;\n\t\t}",
"{\n\t\t\tfor (int j = 0; j < c; j++) {\n\t\t\t\tsum_r += sheet[i][j];\n\t\t\t}\n\t\t\tsheet[i][c] = sum_r;\n\t\t\tsum_r = 0;\n\t\t}",
"for (int j = 0; j < c; j++) {\n\t\t\t\tsum_r += 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\tsum_r += sheet[i][j];\n\t\t\t}",
"{\n\t\t\t\tsum_r += sheet[i][j];\n\t\t\t}",
"sum_r += sheet[i][j]",
"sum_r",
"sheet[i][j]",
"sheet[i]",
"sheet",
"i",
"j",
"sheet[i][c] = sum_r",
"sheet[i][c]",
"sheet[i]",
"sheet",
"i",
"c",
"sum_r",
"sum_r = 0",
"sum_r",
"0",
"int sum_c = 0;",
"sum_c",
"0",
"for (int j = 0; j < c; j++) {\n\t\t\tfor (int i = 0; i < r; i++) {\n\t\t\t\tsum_c += sheet[i][j];\n\t\t\t}\n\t\t\tsheet[r][j] = sum_c;\n\t\t\tsum_c = 0;\n\t\t}",
"int j = 0;",
"int j = 0;",
"j",
"0",
"j < c",
"j",
"c",
"j++",
"j++",
"j",
"{\n\t\t\tfor (int i = 0; i < r; i++) {\n\t\t\t\tsum_c += sheet[i][j];\n\t\t\t}\n\t\t\tsheet[r][j] = sum_c;\n\t\t\tsum_c = 0;\n\t\t}",
"{\n\t\t\tfor (int i = 0; i < r; i++) {\n\t\t\t\tsum_c += sheet[i][j];\n\t\t\t}\n\t\t\tsheet[r][j] = sum_c;\n\t\t\tsum_c = 0;\n\t\t}",
"for (int i = 0; i < r; i++) {\n\t\t\t\tsum_c += sheet[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\tsum_c += sheet[i][j];\n\t\t\t}",
"{\n\t\t\t\tsum_c += sheet[i][j];\n\t\t\t}",
"sum_c += sheet[i][j]",
"sum_c",
"sheet[i][j]",
"sheet[i]",
"sheet",
"i",
"j",
"sheet[r][j] = sum_c",
"sheet[r][j]",
"sheet[r]",
"sheet",
"r",
"j",
"sum_c",
"sum_c = 0",
"sum_c",
"0",
"int sum_all = 0;",
"sum_all",
"0",
"for (int i = 0; i < r; i++) {\n\t\t\tsum_all += sheet[i][c];\n\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < r",
"i",
"r",
"i++",
"i++",
"i",
"{\n\t\t\tsum_all += sheet[i][c];\n\t\t}",
"{\n\t\t\tsum_all += sheet[i][c];\n\t\t}",
"sum_all += sheet[i][c]",
"sum_all",
"sheet[i][c]",
"sheet[i]",
"sheet",
"i",
"c",
"sheet[r][c] = sum_all",
"sheet[r][c]",
"sheet[r]",
"sheet",
"r",
"c",
"sum_all",
"for (int i = 0; i < r+1; i++) {\n\t\t\toutput.append(sheet[i][0]);\n\t\t\tfor (int j = 1; j < c+1; j++) {\n\t\t\t\toutput.append(\" \").append(sheet[i][j]);\n\t\t\t}\n\t\t\toutput.append('\\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\toutput.append(sheet[i][0]);\n\t\t\tfor (int j = 1; j < c+1; j++) {\n\t\t\t\toutput.append(\" \").append(sheet[i][j]);\n\t\t\t}\n\t\t\toutput.append('\\n');\n\t\t}",
"{\n\t\t\toutput.append(sheet[i][0]);\n\t\t\tfor (int j = 1; j < c+1; j++) {\n\t\t\t\toutput.append(\" \").append(sheet[i][j]);\n\t\t\t}\n\t\t\toutput.append('\\n');\n\t\t}",
"output.append(sheet[i][0])",
"output.append",
"output",
"sheet[i][0]",
"sheet[i]",
"sheet",
"i",
"0",
"for (int j = 1; j < c+1; j++) {\n\t\t\t\toutput.append(\" \").append(sheet[i][j]);\n\t\t\t}",
"int j = 1;",
"int j = 1;",
"j",
"1",
"j < c+1",
"j",
"c+1",
"c",
"1",
"j++",
"j++",
"j",
"{\n\t\t\t\toutput.append(\" \").append(sheet[i][j]);\n\t\t\t}",
"{\n\t\t\t\toutput.append(\" \").append(sheet[i][j]);\n\t\t\t}",
"output.append(\" \").append(sheet[i][j])",
"output.append(\" \").append",
"output.append(\" \")",
"output.append",
"output",
"\" \"",
"sheet[i][j]",
"sheet[i]",
"sheet",
"i",
"j",
"output.append('\\n')",
"output.append",
"output",
"'\\n'",
"System.out.print(output)",
"System.out.print",
"System.out",
"System",
"System.out",
"output",
"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\tStringBuilder output = new StringBuilder();\n\t\tint r = scan.nextInt();\n\t\tint c = scan.nextInt();\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\tsheet[i][j] = scan.nextInt();\n\t\t\t}\n\t\t}\n\t\t\n\t\t// 表の端に合計を記録\n\t\tint sum_r = 0;\n\t\tfor (int i = 0; i < r; i++) {\n\t\t\tfor (int j = 0; j < c; j++) {\n\t\t\t\tsum_r += sheet[i][j];\n\t\t\t}\n\t\t\tsheet[i][c] = sum_r;\n\t\t\tsum_r = 0;\n\t\t}\n\t\tint sum_c = 0;\n\t\tfor (int j = 0; j < c; j++) {\n\t\t\tfor (int i = 0; i < r; i++) {\n\t\t\t\tsum_c += sheet[i][j];\n\t\t\t}\n\t\t\tsheet[r][j] = sum_c;\n\t\t\tsum_c = 0;\n\t\t}\n\t\tint sum_all = 0;\n\t\tfor (int i = 0; i < r; i++) {\n\t\t\tsum_all += sheet[i][c];\n\t\t}\n\t\tsheet[r][c] = sum_all;\n\t\t\n\t\t// 出力\n\t\tfor (int i = 0; i < r+1; i++) {\n\t\t\toutput.append(sheet[i][0]);\n\t\t\tfor (int j = 1; j < c+1; j++) {\n\t\t\t\toutput.append(\" \").append(sheet[i][j]);\n\t\t\t}\n\t\t\toutput.append('\\n');\n\t\t}\n\t\tSystem.out.print(output);\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\tStringBuilder output = new StringBuilder();\n\t\tint r = scan.nextInt();\n\t\tint c = scan.nextInt();\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\tsheet[i][j] = scan.nextInt();\n\t\t\t}\n\t\t}\n\t\t\n\t\t// 表の端に合計を記録\n\t\tint sum_r = 0;\n\t\tfor (int i = 0; i < r; i++) {\n\t\t\tfor (int j = 0; j < c; j++) {\n\t\t\t\tsum_r += sheet[i][j];\n\t\t\t}\n\t\t\tsheet[i][c] = sum_r;\n\t\t\tsum_r = 0;\n\t\t}\n\t\tint sum_c = 0;\n\t\tfor (int j = 0; j < c; j++) {\n\t\t\tfor (int i = 0; i < r; i++) {\n\t\t\t\tsum_c += sheet[i][j];\n\t\t\t}\n\t\t\tsheet[r][j] = sum_c;\n\t\t\tsum_c = 0;\n\t\t}\n\t\tint sum_all = 0;\n\t\tfor (int i = 0; i < r; i++) {\n\t\t\tsum_all += sheet[i][c];\n\t\t}\n\t\tsheet[r][c] = sum_all;\n\t\t\n\t\t// 出力\n\t\tfor (int i = 0; i < r+1; i++) {\n\t\t\toutput.append(sheet[i][0]);\n\t\t\tfor (int j = 1; j < c+1; j++) {\n\t\t\t\toutput.append(\" \").append(sheet[i][j]);\n\t\t\t}\n\t\t\toutput.append('\\n');\n\t\t}\n\t\tSystem.out.print(output);\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);
StringBuilder output = new StringBuilder();
int r = scan.nextInt();
int c = scan.nextInt();
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] = scan.nextInt();
}
}
// 表の端に合計を記録
int sum_r = 0;
for (int i = 0; i < r; i++) {
for (int j = 0; j < c; j++) {
sum_r += sheet[i][j];
}
sheet[i][c] = sum_r;
sum_r = 0;
}
int sum_c = 0;
for (int j = 0; j < c; j++) {
for (int i = 0; i < r; i++) {
sum_c += sheet[i][j];
}
sheet[r][j] = sum_c;
sum_c = 0;
}
int sum_all = 0;
for (int i = 0; i < r; i++) {
sum_all += sheet[i][c];
}
sheet[r][c] = sum_all;
// 出力
for (int i = 0; i < r+1; i++) {
output.append(sheet[i][0]);
for (int j = 1; j < c+1; j++) {
output.append(" ").append(sheet[i][j]);
}
output.append('\n');
}
System.out.print(output);
scan.close();
}
} |
[
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,
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,
18,
18,
13,
13,
13,
4,
18,
13,
18,
13,
13,
4,
18,
13,
2,
18,
18,
13,
13,
13,
17,
0,
13,
18,
18,
13,
13,
13,
4,
18,
13,
2,
13,
17,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
18,
18,
13,
13,
13,
0,
13,
18,
18,
13,
13,
13,
4,
18,
13,
2,
13,
17,
4,
18,
13,
13,
4,
18,
18,
13,
13,
13,
23,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
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
],
[
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
],
[
61,
62
],
[
62,
63
],
[
59,
64
],
[
56,
65
],
[
65,
66
],
[
65,
67
],
[
56,
68
],
[
68,
69
],
[
69,
70
],
[
70,
71
],
[
70,
72
],
[
68,
73
],
[
73,
74
],
[
73,
75
],
[
68,
76
],
[
76,
77
],
[
77,
78
],
[
68,
79
],
[
80,
80
],
[
80,
81
],
[
81,
82
],
[
82,
83
],
[
83,
84
],
[
83,
85
],
[
82,
86
],
[
81,
87
],
[
87,
88
],
[
88,
89
],
[
87,
90
],
[
90,
91
],
[
90,
92
],
[
80,
93
],
[
93,
94
],
[
94,
95
],
[
93,
96
],
[
96,
97
],
[
97,
98
],
[
98,
99
],
[
98,
100
],
[
97,
101
],
[
96,
102
],
[
80,
103
],
[
103,
104
],
[
103,
105
],
[
105,
106
],
[
106,
107
],
[
106,
108
],
[
105,
109
],
[
56,
110
],
[
110,
111
],
[
111,
112
],
[
110,
113
],
[
113,
114
],
[
113,
115
],
[
8,
116
],
[
116,
117
],
[
116,
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
],
[
147,
155
],
[
155,
156
],
[
155,
157
],
[
157,
158
],
[
158,
159
],
[
158,
160
],
[
157,
161
],
[
131,
162
],
[
162,
163
],
[
163,
164
],
[
162,
165
],
[
165,
166
],
[
165,
167
],
[
8,
168
],
[
168,
169
],
[
169,
170
],
[
168,
171
],
[
8,
172
],
[
172,
173
],
[
173,
174
],
[
174,
175
],
[
174,
176
],
[
172,
177
],
[
6,
178
],
[
178,
179
]
] | [
"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 String[] rc=br.readLine().split(\" \");\n int r=Integer.parseInt(rc[0]);\n int c=Integer.parseInt(rc[1]);\n int[][] h=new int[r][c];\n \n for(int i=0;i<r;i++){\n \tString[] row=br.readLine().split(\" \");\n \tint s=0;\n \tfor(int j=0;j<c;j++){\n \t\th[i][j]=Integer.parseInt(row[j]);\n \t\tsb.append(h[i][j]+\" \");\n \t\ts+=h[i][j];\n \t}\n \tsb.append(s+\"\\n\");\n }\n int ts=0;\n for(int j=0;j<c;j++){\n \tint s=0;\n \tfor(int i=0;i<r;i++){\n \t\ts+=h[i][j];\n \t\tts+=h[i][j];\n \t}\n \tsb.append(s+\" \");\n }\n sb.append(ts);\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 String[] rc=br.readLine().split(\" \");\n int r=Integer.parseInt(rc[0]);\n int c=Integer.parseInt(rc[1]);\n int[][] h=new int[r][c];\n \n for(int i=0;i<r;i++){\n \tString[] row=br.readLine().split(\" \");\n \tint s=0;\n \tfor(int j=0;j<c;j++){\n \t\th[i][j]=Integer.parseInt(row[j]);\n \t\tsb.append(h[i][j]+\" \");\n \t\ts+=h[i][j];\n \t}\n \tsb.append(s+\"\\n\");\n }\n int ts=0;\n for(int j=0;j<c;j++){\n \tint s=0;\n \tfor(int i=0;i<r;i++){\n \t\ts+=h[i][j];\n \t\tts+=h[i][j];\n \t}\n \tsb.append(s+\" \");\n }\n sb.append(ts);\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 String[] rc=br.readLine().split(\" \");\n int r=Integer.parseInt(rc[0]);\n int c=Integer.parseInt(rc[1]);\n int[][] h=new int[r][c];\n \n for(int i=0;i<r;i++){\n \tString[] row=br.readLine().split(\" \");\n \tint s=0;\n \tfor(int j=0;j<c;j++){\n \t\th[i][j]=Integer.parseInt(row[j]);\n \t\tsb.append(h[i][j]+\" \");\n \t\ts+=h[i][j];\n \t}\n \tsb.append(s+\"\\n\");\n }\n int ts=0;\n for(int j=0;j<c;j++){\n \tint s=0;\n \tfor(int i=0;i<r;i++){\n \t\ts+=h[i][j];\n \t\tts+=h[i][j];\n \t}\n \tsb.append(s+\" \");\n }\n sb.append(ts);\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 String[] rc=br.readLine().split(\" \");\n int r=Integer.parseInt(rc[0]);\n int c=Integer.parseInt(rc[1]);\n int[][] h=new int[r][c];\n \n for(int i=0;i<r;i++){\n \tString[] row=br.readLine().split(\" \");\n \tint s=0;\n \tfor(int j=0;j<c;j++){\n \t\th[i][j]=Integer.parseInt(row[j]);\n \t\tsb.append(h[i][j]+\" \");\n \t\ts+=h[i][j];\n \t}\n \tsb.append(s+\"\\n\");\n }\n int ts=0;\n for(int j=0;j<c;j++){\n \tint s=0;\n \tfor(int i=0;i<r;i++){\n \t\ts+=h[i][j];\n \t\tts+=h[i][j];\n \t}\n \tsb.append(s+\" \");\n }\n sb.append(ts);\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[] 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[][] h=new int[r][c];",
"h",
"new int[r][c]",
"r",
"c",
"for(int i=0;i<r;i++){\n \tString[] row=br.readLine().split(\" \");\n \tint s=0;\n \tfor(int j=0;j<c;j++){\n \t\th[i][j]=Integer.parseInt(row[j]);\n \t\tsb.append(h[i][j]+\" \");\n \t\ts+=h[i][j];\n \t}\n \tsb.append(s+\"\\n\");\n }",
"int i=0;",
"int i=0;",
"i",
"0",
"i<r",
"i",
"r",
"i++",
"i++",
"i",
"{\n \tString[] row=br.readLine().split(\" \");\n \tint s=0;\n \tfor(int j=0;j<c;j++){\n \t\th[i][j]=Integer.parseInt(row[j]);\n \t\tsb.append(h[i][j]+\" \");\n \t\ts+=h[i][j];\n \t}\n \tsb.append(s+\"\\n\");\n }",
"{\n \tString[] row=br.readLine().split(\" \");\n \tint s=0;\n \tfor(int j=0;j<c;j++){\n \t\th[i][j]=Integer.parseInt(row[j]);\n \t\tsb.append(h[i][j]+\" \");\n \t\ts+=h[i][j];\n \t}\n \tsb.append(s+\"\\n\");\n }",
"String[] row=br.readLine().split(\" \");",
"row",
"br.readLine().split(\" \")",
"br.readLine().split",
"br.readLine()",
"br.readLine",
"br",
"\" \"",
"int s=0;",
"s",
"0",
"for(int j=0;j<c;j++){\n \t\th[i][j]=Integer.parseInt(row[j]);\n \t\tsb.append(h[i][j]+\" \");\n \t\ts+=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]+\" \");\n \t\ts+=h[i][j];\n \t}",
"{\n \t\th[i][j]=Integer.parseInt(row[j]);\n \t\tsb.append(h[i][j]+\" \");\n \t\ts+=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]+\" \")",
"sb.append",
"sb",
"h[i][j]+\" \"",
"h[i][j]",
"h[i]",
"h",
"i",
"j",
"\" \"",
"s+=h[i][j]",
"s",
"h[i][j]",
"h[i]",
"h",
"i",
"j",
"sb.append(s+\"\\n\")",
"sb.append",
"sb",
"s+\"\\n\"",
"s",
"\"\\n\"",
"int ts=0;",
"ts",
"0",
"for(int j=0;j<c;j++){\n \tint s=0;\n \tfor(int i=0;i<r;i++){\n \t\ts+=h[i][j];\n \t\tts+=h[i][j];\n \t}\n \tsb.append(s+\" \");\n }",
"int j=0;",
"int j=0;",
"j",
"0",
"j<c",
"j",
"c",
"j++",
"j++",
"j",
"{\n \tint s=0;\n \tfor(int i=0;i<r;i++){\n \t\ts+=h[i][j];\n \t\tts+=h[i][j];\n \t}\n \tsb.append(s+\" \");\n }",
"{\n \tint s=0;\n \tfor(int i=0;i<r;i++){\n \t\ts+=h[i][j];\n \t\tts+=h[i][j];\n \t}\n \tsb.append(s+\" \");\n }",
"int s=0;",
"s",
"0",
"for(int i=0;i<r;i++){\n \t\ts+=h[i][j];\n \t\tts+=h[i][j];\n \t}",
"int i=0;",
"int i=0;",
"i",
"0",
"i<r",
"i",
"r",
"i++",
"i++",
"i",
"{\n \t\ts+=h[i][j];\n \t\tts+=h[i][j];\n \t}",
"{\n \t\ts+=h[i][j];\n \t\tts+=h[i][j];\n \t}",
"s+=h[i][j]",
"s",
"h[i][j]",
"h[i]",
"h",
"i",
"j",
"ts+=h[i][j]",
"ts",
"h[i][j]",
"h[i]",
"h",
"i",
"j",
"sb.append(s+\" \")",
"sb.append",
"sb",
"s+\" \"",
"s",
"\" \"",
"sb.append(ts)",
"sb.append",
"sb",
"ts",
"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[] rc=br.readLine().split(" ");
int r=Integer.parseInt(rc[0]);
int c=Integer.parseInt(rc[1]);
int[][] h=new int[r][c];
for(int i=0;i<r;i++){
String[] row=br.readLine().split(" ");
int s=0;
for(int j=0;j<c;j++){
h[i][j]=Integer.parseInt(row[j]);
sb.append(h[i][j]+" ");
s+=h[i][j];
}
sb.append(s+"\n");
}
int ts=0;
for(int j=0;j<c;j++){
int s=0;
for(int i=0;i<r;i++){
s+=h[i][j];
ts+=h[i][j];
}
sb.append(s+" ");
}
sb.append(ts);
System.out.println(sb);
}
} |
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
41,
13,
41,
13,
0,
13,
4,
18,
13,
0,
13,
4,
18,
13,
0,
13,
20,
13,
41,
13,
41,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
4,
18,
13,
0,
18,
13,
13,
13,
0,
13,
13,
4,
18,
18,
13,
13,
2,
13,
17,
4,
18,
18,
13,
13,
13,
0,
13,
17,
28,
13,
13,
30,
30,
0,
13,
13,
4,
18,
18,
13,
13,
2,
13,
17,
4,
18,
18,
13,
13,
13,
4,
18,
13,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
123,
5
],
[
123,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
8,
14
],
[
14,
15
],
[
8,
16
],
[
16,
17
],
[
8,
18
],
[
18,
19
],
[
18,
20
],
[
20,
21
],
[
21,
22
],
[
8,
23
],
[
23,
24
],
[
23,
25
],
[
25,
26
],
[
26,
27
],
[
8,
28
],
[
28,
29
],
[
28,
30
],
[
8,
32
],
[
32,
33
],
[
8,
34
],
[
34,
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
],
[
49,
51
],
[
48,
52
],
[
52,
53
],
[
53,
54
],
[
54,
55
],
[
54,
56
],
[
52,
57
],
[
57,
58
],
[
57,
59
],
[
52,
60
],
[
60,
61
],
[
61,
62
],
[
52,
63
],
[
64,
64
],
[
64,
65
],
[
65,
66
],
[
65,
67
],
[
67,
68
],
[
68,
69
],
[
64,
70
],
[
70,
71
],
[
71,
72
],
[
71,
73
],
[
70,
74
],
[
64,
75
],
[
75,
76
],
[
75,
77
],
[
64,
78
],
[
78,
79
],
[
79,
80
],
[
80,
81
],
[
80,
82
],
[
78,
83
],
[
83,
84
],
[
83,
85
],
[
48,
86
],
[
86,
87
],
[
87,
88
],
[
88,
89
],
[
88,
90
],
[
86,
91
],
[
8,
92
],
[
92,
93
],
[
92,
94
],
[
8,
95
],
[
95,
96
],
[
95,
97
],
[
95,
98
],
[
99,
99
],
[
99,
100
],
[
100,
101
],
[
100,
102
],
[
99,
103
],
[
103,
104
],
[
104,
105
],
[
105,
106
],
[
105,
107
],
[
103,
108
],
[
108,
109
],
[
108,
110
],
[
8,
111
],
[
111,
112
],
[
112,
113
],
[
113,
114
],
[
113,
115
],
[
111,
116
],
[
8,
117
],
[
117,
118
],
[
118,
119
],
[
6,
120
],
[
120,
121
],
[
0,
122
],
[
122,
123
],
[
122,
124
]
] | [
"import java.util.Scanner;\n\npublic class Main {\n public static void main(String[] args){\n Scanner scanner = new Scanner(System.in);\n\n int row, col;\n int[] matrix;\n\n row = scanner.nextInt();\n col = scanner.nextInt();\n\n matrix = new int[col];\n\n int in, sum;\n for(int rowi = 0; rowi < row; rowi++){\n sum = 0;\n for(int coli = 0; coli < col; coli++){\n in = scanner.nextInt();\n matrix[coli] += in;\n sum += in;\n System.out.print(in + \" \");\n }\n System.out.println(sum);\n }\n\n sum = 0;\n for(int i:matrix){\n sum += i;\n System.out.print(i + \" \");\n }\n System.out.println(sum);\n\n scanner.close();\n }\n}\n",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n public static void main(String[] args){\n Scanner scanner = new Scanner(System.in);\n\n int row, col;\n int[] matrix;\n\n row = scanner.nextInt();\n col = scanner.nextInt();\n\n matrix = new int[col];\n\n int in, sum;\n for(int rowi = 0; rowi < row; rowi++){\n sum = 0;\n for(int coli = 0; coli < col; coli++){\n in = scanner.nextInt();\n matrix[coli] += in;\n sum += in;\n System.out.print(in + \" \");\n }\n System.out.println(sum);\n }\n\n sum = 0;\n for(int i:matrix){\n sum += i;\n System.out.print(i + \" \");\n }\n System.out.println(sum);\n\n scanner.close();\n }\n}",
"Main",
"public static void main(String[] args){\n Scanner scanner = new Scanner(System.in);\n\n int row, col;\n int[] matrix;\n\n row = scanner.nextInt();\n col = scanner.nextInt();\n\n matrix = new int[col];\n\n int in, sum;\n for(int rowi = 0; rowi < row; rowi++){\n sum = 0;\n for(int coli = 0; coli < col; coli++){\n in = scanner.nextInt();\n matrix[coli] += in;\n sum += in;\n System.out.print(in + \" \");\n }\n System.out.println(sum);\n }\n\n sum = 0;\n for(int i:matrix){\n sum += i;\n System.out.print(i + \" \");\n }\n System.out.println(sum);\n\n scanner.close();\n }",
"main",
"{\n Scanner scanner = new Scanner(System.in);\n\n int row, col;\n int[] matrix;\n\n row = scanner.nextInt();\n col = scanner.nextInt();\n\n matrix = new int[col];\n\n int in, sum;\n for(int rowi = 0; rowi < row; rowi++){\n sum = 0;\n for(int coli = 0; coli < col; coli++){\n in = scanner.nextInt();\n matrix[coli] += in;\n sum += in;\n System.out.print(in + \" \");\n }\n System.out.println(sum);\n }\n\n sum = 0;\n for(int i:matrix){\n sum += i;\n System.out.print(i + \" \");\n }\n System.out.println(sum);\n\n scanner.close();\n }",
"Scanner scanner = new Scanner(System.in);",
"scanner",
"new Scanner(System.in)",
"int row",
"row",
"col;",
"col",
"int[] matrix;",
"matrix",
"row = scanner.nextInt()",
"row",
"scanner.nextInt()",
"scanner.nextInt",
"scanner",
"col = scanner.nextInt()",
"col",
"scanner.nextInt()",
"scanner.nextInt",
"scanner",
"matrix = new int[col]",
"matrix",
"new int[col]",
"col",
"int in",
"in",
"sum;",
"sum",
"for(int rowi = 0; rowi < row; rowi++){\n sum = 0;\n for(int coli = 0; coli < col; coli++){\n in = scanner.nextInt();\n matrix[coli] += in;\n sum += in;\n System.out.print(in + \" \");\n }\n System.out.println(sum);\n }",
"int rowi = 0;",
"int rowi = 0;",
"rowi",
"0",
"rowi < row",
"rowi",
"row",
"rowi++",
"rowi++",
"rowi",
"{\n sum = 0;\n for(int coli = 0; coli < col; coli++){\n in = scanner.nextInt();\n matrix[coli] += in;\n sum += in;\n System.out.print(in + \" \");\n }\n System.out.println(sum);\n }",
"{\n sum = 0;\n for(int coli = 0; coli < col; coli++){\n in = scanner.nextInt();\n matrix[coli] += in;\n sum += in;\n System.out.print(in + \" \");\n }\n System.out.println(sum);\n }",
"sum = 0",
"sum",
"0",
"for(int coli = 0; coli < col; coli++){\n in = scanner.nextInt();\n matrix[coli] += in;\n sum += in;\n System.out.print(in + \" \");\n }",
"int coli = 0;",
"int coli = 0;",
"coli",
"0",
"coli < col",
"coli",
"col",
"coli++",
"coli++",
"coli",
"{\n in = scanner.nextInt();\n matrix[coli] += in;\n sum += in;\n System.out.print(in + \" \");\n }",
"{\n in = scanner.nextInt();\n matrix[coli] += in;\n sum += in;\n System.out.print(in + \" \");\n }",
"in = scanner.nextInt()",
"in",
"scanner.nextInt()",
"scanner.nextInt",
"scanner",
"matrix[coli] += in",
"matrix[coli]",
"matrix",
"coli",
"in",
"sum += in",
"sum",
"in",
"System.out.print(in + \" \")",
"System.out.print",
"System.out",
"System",
"System.out",
"in + \" \"",
"in",
"\" \"",
"System.out.println(sum)",
"System.out.println",
"System.out",
"System",
"System.out",
"sum",
"sum = 0",
"sum",
"0",
"for(int i:matrix){\n sum += i;\n System.out.print(i + \" \");\n }",
"int i",
"matrix",
"{\n sum += i;\n System.out.print(i + \" \");\n }",
"{\n sum += i;\n System.out.print(i + \" \");\n }",
"sum += i",
"sum",
"i",
"System.out.print(i + \" \")",
"System.out.print",
"System.out",
"System",
"System.out",
"i + \" \"",
"i",
"\" \"",
"System.out.println(sum)",
"System.out.println",
"System.out",
"System",
"System.out",
"sum",
"scanner.close()",
"scanner.close",
"scanner",
"String[] args",
"args",
"public class Main {\n public static void main(String[] args){\n Scanner scanner = new Scanner(System.in);\n\n int row, col;\n int[] matrix;\n\n row = scanner.nextInt();\n col = scanner.nextInt();\n\n matrix = new int[col];\n\n int in, sum;\n for(int rowi = 0; rowi < row; rowi++){\n sum = 0;\n for(int coli = 0; coli < col; coli++){\n in = scanner.nextInt();\n matrix[coli] += in;\n sum += in;\n System.out.print(in + \" \");\n }\n System.out.println(sum);\n }\n\n sum = 0;\n for(int i:matrix){\n sum += i;\n System.out.print(i + \" \");\n }\n System.out.println(sum);\n\n scanner.close();\n }\n}",
"public class Main {\n public static void main(String[] args){\n Scanner scanner = new Scanner(System.in);\n\n int row, col;\n int[] matrix;\n\n row = scanner.nextInt();\n col = scanner.nextInt();\n\n matrix = new int[col];\n\n int in, sum;\n for(int rowi = 0; rowi < row; rowi++){\n sum = 0;\n for(int coli = 0; coli < col; coli++){\n in = scanner.nextInt();\n matrix[coli] += in;\n sum += in;\n System.out.print(in + \" \");\n }\n System.out.println(sum);\n }\n\n sum = 0;\n for(int i:matrix){\n sum += i;\n System.out.print(i + \" \");\n }\n System.out.println(sum);\n\n scanner.close();\n }\n}",
"Main"
] | import java.util.Scanner;
public class Main {
public static void main(String[] args){
Scanner scanner = new Scanner(System.in);
int row, col;
int[] matrix;
row = scanner.nextInt();
col = scanner.nextInt();
matrix = new int[col];
int in, sum;
for(int rowi = 0; rowi < row; rowi++){
sum = 0;
for(int coli = 0; coli < col; coli++){
in = scanner.nextInt();
matrix[coli] += in;
sum += in;
System.out.print(in + " ");
}
System.out.println(sum);
}
sum = 0;
for(int i:matrix){
sum += i;
System.out.print(i + " ");
}
System.out.println(sum);
scanner.close();
}
}
|
[
7,
15,
13,
17,
6,
13,
41,
13,
20,
12,
13,
30,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
4,
13,
4,
13,
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,
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,
29,
13,
23,
13,
23,
13,
12,
13,
30,
28,
13,
13,
30,
30,
41,
13,
20,
28,
13,
13,
30,
30,
4,
18,
13,
2,
13,
17,
4,
18,
18,
13,
13,
4,
18,
4,
18,
13,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
142,
5
],
[
142,
6
],
[
6,
7
],
[
6,
8
],
[
142,
9
],
[
9,
10
],
[
9,
11
],
[
11,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
11,
17
],
[
17,
18
],
[
17,
19
],
[
19,
20
],
[
20,
21
],
[
11,
22
],
[
22,
23
],
[
22,
24
],
[
24,
25
],
[
24,
26
],
[
24,
27
],
[
9,
28
],
[
28,
29
],
[
142,
30
],
[
30,
31
],
[
30,
32
],
[
32,
33
],
[
33,
34
],
[
33,
35
],
[
36,
37
],
[
36,
38
],
[
39,
40
],
[
39,
41
],
[
32,
42
],
[
42,
43
],
[
43,
44
],
[
44,
45
],
[
44,
46
],
[
42,
47
],
[
47,
48
],
[
47,
49
],
[
42,
50
],
[
50,
51
],
[
51,
52
],
[
42,
53
],
[
54,
54
],
[
54,
55
],
[
55,
56
],
[
56,
57
],
[
57,
58
],
[
57,
59
],
[
55,
60
],
[
60,
61
],
[
60,
62
],
[
55,
63
],
[
63,
64
],
[
64,
65
],
[
55,
66
],
[
67,
67
],
[
67,
68
],
[
68,
69
],
[
68,
70
],
[
70,
71
],
[
71,
72
],
[
67,
73
],
[
73,
74
],
[
74,
75
],
[
75,
76
],
[
75,
77
],
[
74,
78
],
[
73,
79
],
[
67,
80
],
[
80,
81
],
[
81,
82
],
[
82,
83
],
[
82,
84
],
[
81,
85
],
[
80,
86
],
[
67,
87
],
[
87,
88
],
[
88,
89
],
[
89,
90
],
[
89,
91
],
[
88,
92
],
[
87,
93
],
[
67,
94
],
[
94,
95
],
[
95,
96
],
[
96,
97
],
[
96,
98
],
[
95,
99
],
[
94,
100
],
[
32,
101
],
[
101,
102
],
[
30,
103
],
[
103,
104
],
[
30,
105
],
[
105,
106
],
[
142,
107
],
[
107,
108
],
[
107,
109
],
[
109,
110
],
[
110,
111
],
[
110,
112
],
[
110,
113
],
[
114,
114
],
[
114,
115
],
[
115,
116
],
[
115,
117
],
[
114,
118
],
[
118,
119
],
[
118,
120
],
[
118,
121
],
[
122,
122
],
[
122,
123
],
[
123,
124
],
[
124,
125
],
[
123,
126
],
[
126,
127
],
[
126,
128
],
[
114,
129
],
[
129,
130
],
[
130,
131
],
[
131,
132
],
[
131,
133
],
[
129,
134
],
[
134,
135
],
[
135,
136
],
[
136,
137
],
[
137,
138
],
[
107,
139
],
[
139,
140
],
[
0,
141
],
[
141,
142
],
[
141,
143
]
] | [
"import java.util.*;\n\npublic class Main {\n private static final Scanner scn = new Scanner(System.in);\n \n public static void main(String[] args) {\n int r = scn.nextInt(), c = scn.nextInt();\n showTable(createTable(r, c));\n }\n \n private static int[][] createTable(int r, int c) {\n int[][] tbl = new int[r + 1][c + 1];\n for(int i = 0; i < r; i++) {\n for(int j = 0; j < c; j++) {\n int v = scn.nextInt();\n tbl[i][j] += v;\n tbl[i][c] += v;\n tbl[r][j] += v;\n tbl[r][c] += v;\n }\n }\n return tbl;\n }\n \n private static void showTable(int[][] tbl) {\n for(int[] ary : tbl) {\n StringBuilder sb = new StringBuilder();\n for(int elm : ary) {\n sb.append(elm + \" \");\n }\n System.out.println(sb.toString().trim());\n }\n }\n}",
"import java.util.*;",
"util.*",
"java",
"public class Main {\n private static final Scanner scn = new Scanner(System.in);\n \n public static void main(String[] args) {\n int r = scn.nextInt(), c = scn.nextInt();\n showTable(createTable(r, c));\n }\n \n private static int[][] createTable(int r, int c) {\n int[][] tbl = new int[r + 1][c + 1];\n for(int i = 0; i < r; i++) {\n for(int j = 0; j < c; j++) {\n int v = scn.nextInt();\n tbl[i][j] += v;\n tbl[i][c] += v;\n tbl[r][j] += v;\n tbl[r][c] += v;\n }\n }\n return tbl;\n }\n \n private static void showTable(int[][] tbl) {\n for(int[] ary : tbl) {\n StringBuilder sb = new StringBuilder();\n for(int elm : ary) {\n sb.append(elm + \" \");\n }\n System.out.println(sb.toString().trim());\n }\n }\n}",
"Main",
"private static final Scanner scn = new Scanner(System.in);",
"scn",
"new Scanner(System.in)",
"public static void main(String[] args) {\n int r = scn.nextInt(), c = scn.nextInt();\n showTable(createTable(r, c));\n }",
"main",
"{\n int r = scn.nextInt(), c = scn.nextInt();\n showTable(createTable(r, c));\n }",
"int r = scn.nextInt()",
"r",
"scn.nextInt()",
"scn.nextInt",
"scn",
"c = scn.nextInt();",
"c",
"scn.nextInt()",
"scn.nextInt",
"scn",
"showTable(createTable(r, c))",
"showTable",
"createTable(r, c)",
"createTable",
"r",
"c",
"String[] args",
"args",
"private static int[][] createTable(int r, int c) {\n int[][] tbl = new int[r + 1][c + 1];\n for(int i = 0; i < r; i++) {\n for(int j = 0; j < c; j++) {\n int v = scn.nextInt();\n tbl[i][j] += v;\n tbl[i][c] += v;\n tbl[r][j] += v;\n tbl[r][c] += v;\n }\n }\n return tbl;\n }",
"createTable",
"{\n int[][] tbl = new int[r + 1][c + 1];\n for(int i = 0; i < r; i++) {\n for(int j = 0; j < c; j++) {\n int v = scn.nextInt();\n tbl[i][j] += v;\n tbl[i][c] += v;\n tbl[r][j] += v;\n tbl[r][c] += v;\n }\n }\n return tbl;\n }",
"int[][] tbl = new int[r + 1][c + 1];",
"tbl",
"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 int v = scn.nextInt();\n tbl[i][j] += v;\n tbl[i][c] += v;\n tbl[r][j] += v;\n tbl[r][c] += v;\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 v = scn.nextInt();\n tbl[i][j] += v;\n tbl[i][c] += v;\n tbl[r][j] += v;\n tbl[r][c] += v;\n }\n }",
"{\n for(int j = 0; j < c; j++) {\n int v = scn.nextInt();\n tbl[i][j] += v;\n tbl[i][c] += v;\n tbl[r][j] += v;\n tbl[r][c] += v;\n }\n }",
"for(int j = 0; j < c; j++) {\n int v = scn.nextInt();\n tbl[i][j] += v;\n tbl[i][c] += v;\n tbl[r][j] += v;\n tbl[r][c] += v;\n }",
"int j = 0;",
"int j = 0;",
"j",
"0",
"j < c",
"j",
"c",
"j++",
"j++",
"j",
"{\n int v = scn.nextInt();\n tbl[i][j] += v;\n tbl[i][c] += v;\n tbl[r][j] += v;\n tbl[r][c] += v;\n }",
"{\n int v = scn.nextInt();\n tbl[i][j] += v;\n tbl[i][c] += v;\n tbl[r][j] += v;\n tbl[r][c] += v;\n }",
"int v = scn.nextInt();",
"v",
"scn.nextInt()",
"scn.nextInt",
"scn",
"tbl[i][j] += v",
"tbl[i][j]",
"tbl[i]",
"tbl",
"i",
"j",
"v",
"tbl[i][c] += v",
"tbl[i][c]",
"tbl[i]",
"tbl",
"i",
"c",
"v",
"tbl[r][j] += v",
"tbl[r][j]",
"tbl[r]",
"tbl",
"r",
"j",
"v",
"tbl[r][c] += v",
"tbl[r][c]",
"tbl[r]",
"tbl",
"r",
"c",
"v",
"return tbl;",
"tbl",
"int r",
"r",
"int c",
"c",
"private static void showTable(int[][] tbl) {\n for(int[] ary : tbl) {\n StringBuilder sb = new StringBuilder();\n for(int elm : ary) {\n sb.append(elm + \" \");\n }\n System.out.println(sb.toString().trim());\n }\n }",
"showTable",
"{\n for(int[] ary : tbl) {\n StringBuilder sb = new StringBuilder();\n for(int elm : ary) {\n sb.append(elm + \" \");\n }\n System.out.println(sb.toString().trim());\n }\n }",
"for(int[] ary : tbl) {\n StringBuilder sb = new StringBuilder();\n for(int elm : ary) {\n sb.append(elm + \" \");\n }\n System.out.println(sb.toString().trim());\n }",
"int[] ary",
"tbl",
"{\n StringBuilder sb = new StringBuilder();\n for(int elm : ary) {\n sb.append(elm + \" \");\n }\n System.out.println(sb.toString().trim());\n }",
"{\n StringBuilder sb = new StringBuilder();\n for(int elm : ary) {\n sb.append(elm + \" \");\n }\n System.out.println(sb.toString().trim());\n }",
"StringBuilder sb = new StringBuilder();",
"sb",
"new StringBuilder()",
"for(int elm : ary) {\n sb.append(elm + \" \");\n }",
"int elm",
"ary",
"{\n sb.append(elm + \" \");\n }",
"{\n sb.append(elm + \" \");\n }",
"sb.append(elm + \" \")",
"sb.append",
"sb",
"elm + \" \"",
"elm",
"\" \"",
"System.out.println(sb.toString().trim())",
"System.out.println",
"System.out",
"System",
"System.out",
"sb.toString().trim()",
"sb.toString().trim",
"sb.toString()",
"sb.toString",
"sb",
"int[][] tbl",
"tbl",
"public class Main {\n private static final Scanner scn = new Scanner(System.in);\n \n public static void main(String[] args) {\n int r = scn.nextInt(), c = scn.nextInt();\n showTable(createTable(r, c));\n }\n \n private static int[][] createTable(int r, int c) {\n int[][] tbl = new int[r + 1][c + 1];\n for(int i = 0; i < r; i++) {\n for(int j = 0; j < c; j++) {\n int v = scn.nextInt();\n tbl[i][j] += v;\n tbl[i][c] += v;\n tbl[r][j] += v;\n tbl[r][c] += v;\n }\n }\n return tbl;\n }\n \n private static void showTable(int[][] tbl) {\n for(int[] ary : tbl) {\n StringBuilder sb = new StringBuilder();\n for(int elm : ary) {\n sb.append(elm + \" \");\n }\n System.out.println(sb.toString().trim());\n }\n }\n}",
"public class Main {\n private static final Scanner scn = new Scanner(System.in);\n \n public static void main(String[] args) {\n int r = scn.nextInt(), c = scn.nextInt();\n showTable(createTable(r, c));\n }\n \n private static int[][] createTable(int r, int c) {\n int[][] tbl = new int[r + 1][c + 1];\n for(int i = 0; i < r; i++) {\n for(int j = 0; j < c; j++) {\n int v = scn.nextInt();\n tbl[i][j] += v;\n tbl[i][c] += v;\n tbl[r][j] += v;\n tbl[r][c] += v;\n }\n }\n return tbl;\n }\n \n private static void showTable(int[][] tbl) {\n for(int[] ary : tbl) {\n StringBuilder sb = new StringBuilder();\n for(int elm : ary) {\n sb.append(elm + \" \");\n }\n System.out.println(sb.toString().trim());\n }\n }\n}",
"Main"
] | import java.util.*;
public class Main {
private static final Scanner scn = new Scanner(System.in);
public static void main(String[] args) {
int r = scn.nextInt(), c = scn.nextInt();
showTable(createTable(r, c));
}
private static int[][] createTable(int r, int c) {
int[][] tbl = new int[r + 1][c + 1];
for(int i = 0; i < r; i++) {
for(int j = 0; j < c; j++) {
int v = scn.nextInt();
tbl[i][j] += v;
tbl[i][c] += v;
tbl[r][j] += v;
tbl[r][c] += v;
}
}
return tbl;
}
private static void showTable(int[][] tbl) {
for(int[] ary : tbl) {
StringBuilder sb = new StringBuilder();
for(int elm : ary) {
sb.append(elm + " ");
}
System.out.println(sb.toString().trim());
}
}
} |
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
20,
41,
13,
4,
18,
4,
18,
13,
17,
41,
13,
4,
18,
13,
18,
13,
17,
41,
13,
4,
18,
13,
18,
13,
17,
41,
13,
41,
13,
17,
41,
13,
20,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
17,
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,
18,
13,
13,
4,
18,
13,
18,
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,
30,
4,
18,
13,
2,
18,
13,
13,
17,
4,
18,
18,
13,
13,
4,
18,
13,
13,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
158,
11
],
[
158,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
15,
17
],
[
14,
18
],
[
18,
19
],
[
18,
20
],
[
14,
21
],
[
21,
22
],
[
21,
23
],
[
23,
24
],
[
24,
25
],
[
25,
26
],
[
26,
27
],
[
23,
28
],
[
14,
29
],
[
29,
30
],
[
29,
31
],
[
31,
32
],
[
32,
33
],
[
31,
34
],
[
34,
35
],
[
34,
36
],
[
14,
37
],
[
37,
38
],
[
37,
39
],
[
39,
40
],
[
40,
41
],
[
39,
42
],
[
42,
43
],
[
42,
44
],
[
14,
45
],
[
45,
46
],
[
14,
47
],
[
47,
48
],
[
47,
49
],
[
14,
50
],
[
50,
51
],
[
50,
52
],
[
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
],
[
78,
80
],
[
66,
81
],
[
81,
82
],
[
82,
83
],
[
83,
84
],
[
83,
85
],
[
81,
86
],
[
86,
87
],
[
86,
88
],
[
81,
89
],
[
89,
90
],
[
90,
91
],
[
81,
92
],
[
93,
93
],
[
93,
94
],
[
94,
95
],
[
94,
96
],
[
96,
97
],
[
97,
98
],
[
96,
99
],
[
99,
100
],
[
99,
101
],
[
93,
102
],
[
102,
103
],
[
103,
104
],
[
103,
105
],
[
102,
106
],
[
106,
107
],
[
107,
108
],
[
106,
109
],
[
109,
110
],
[
109,
111
],
[
66,
112
],
[
112,
113
],
[
112,
114
],
[
66,
115
],
[
115,
116
],
[
116,
117
],
[
115,
118
],
[
120,
119
],
[
119,
120
],
[
120,
121
],
[
120,
122
],
[
119,
123
],
[
120,
124
],
[
14,
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
],
[
138,
141
],
[
141,
142
],
[
142,
143
],
[
142,
144
],
[
141,
145
],
[
14,
146
],
[
146,
147
],
[
147,
148
],
[
148,
149
],
[
148,
150
],
[
146,
151
],
[
151,
152
],
[
152,
153
],
[
151,
154
],
[
12,
155
],
[
155,
156
],
[
0,
157
],
[
157,
158
],
[
157,
159
]
] | [
"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\tStringBuilder sb = new StringBuilder();\n\n\t\tString[] rc = br.readLine().split(\" \");\n\t\tint r = Integer.parseInt(rc[0]);\n\t\tint c = Integer.parseInt(rc[1]);\n\t\tint sumOfRow, total = 0;\n\t\tint[] sumOfCol = new int[c];\n\n\t\tfor(int i = 0; i < r; i++) {\n\t\t\tString row = br.readLine();\n\t\t\tString[] elem = row.split(\" \");\n\t\t\tsumOfRow = 0;\n\t\t\tfor(int j = 0; j < c; j++) {\n\t\t\t\tsumOfRow += Integer.parseInt(elem[j]);\n\t\t\t\tsumOfCol[j] += Integer.parseInt(elem[j]);\n\t\t\t}\n\t\t\ttotal += sumOfRow;\n\t\t\tsb.append(row + \" \" + sumOfRow + \"\\n\");\n\t\t}\n\n\t\tfor(int j = 0; j < c; j++) {\n\t\t\tsb.append(sumOfCol[j] + \" \");\n\t\t}\n\n\t\tSystem.out.println(sb.append(total));\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\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\t\tStringBuilder sb = new StringBuilder();\n\n\t\tString[] rc = br.readLine().split(\" \");\n\t\tint r = Integer.parseInt(rc[0]);\n\t\tint c = Integer.parseInt(rc[1]);\n\t\tint sumOfRow, total = 0;\n\t\tint[] sumOfCol = new int[c];\n\n\t\tfor(int i = 0; i < r; i++) {\n\t\t\tString row = br.readLine();\n\t\t\tString[] elem = row.split(\" \");\n\t\t\tsumOfRow = 0;\n\t\t\tfor(int j = 0; j < c; j++) {\n\t\t\t\tsumOfRow += Integer.parseInt(elem[j]);\n\t\t\t\tsumOfCol[j] += Integer.parseInt(elem[j]);\n\t\t\t}\n\t\t\ttotal += sumOfRow;\n\t\t\tsb.append(row + \" \" + sumOfRow + \"\\n\");\n\t\t}\n\n\t\tfor(int j = 0; j < c; j++) {\n\t\t\tsb.append(sumOfCol[j] + \" \");\n\t\t}\n\n\t\tSystem.out.println(sb.append(total));\n\n\t}\n}",
"Main",
"public static void main(String[] args) throws IOException {\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\t\tStringBuilder sb = new StringBuilder();\n\n\t\tString[] rc = br.readLine().split(\" \");\n\t\tint r = Integer.parseInt(rc[0]);\n\t\tint c = Integer.parseInt(rc[1]);\n\t\tint sumOfRow, total = 0;\n\t\tint[] sumOfCol = new int[c];\n\n\t\tfor(int i = 0; i < r; i++) {\n\t\t\tString row = br.readLine();\n\t\t\tString[] elem = row.split(\" \");\n\t\t\tsumOfRow = 0;\n\t\t\tfor(int j = 0; j < c; j++) {\n\t\t\t\tsumOfRow += Integer.parseInt(elem[j]);\n\t\t\t\tsumOfCol[j] += Integer.parseInt(elem[j]);\n\t\t\t}\n\t\t\ttotal += sumOfRow;\n\t\t\tsb.append(row + \" \" + sumOfRow + \"\\n\");\n\t\t}\n\n\t\tfor(int j = 0; j < c; j++) {\n\t\t\tsb.append(sumOfCol[j] + \" \");\n\t\t}\n\n\t\tSystem.out.println(sb.append(total));\n\n\t}",
"main",
"{\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\t\tStringBuilder sb = new StringBuilder();\n\n\t\tString[] rc = br.readLine().split(\" \");\n\t\tint r = Integer.parseInt(rc[0]);\n\t\tint c = Integer.parseInt(rc[1]);\n\t\tint sumOfRow, total = 0;\n\t\tint[] sumOfCol = new int[c];\n\n\t\tfor(int i = 0; i < r; i++) {\n\t\t\tString row = br.readLine();\n\t\t\tString[] elem = row.split(\" \");\n\t\t\tsumOfRow = 0;\n\t\t\tfor(int j = 0; j < c; j++) {\n\t\t\t\tsumOfRow += Integer.parseInt(elem[j]);\n\t\t\t\tsumOfCol[j] += Integer.parseInt(elem[j]);\n\t\t\t}\n\t\t\ttotal += sumOfRow;\n\t\t\tsb.append(row + \" \" + sumOfRow + \"\\n\");\n\t\t}\n\n\t\tfor(int j = 0; j < c; j++) {\n\t\t\tsb.append(sumOfCol[j] + \" \");\n\t\t}\n\n\t\tSystem.out.println(sb.append(total));\n\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[] 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 sumOfRow",
"sumOfRow",
"total = 0;",
"total",
"0",
"int[] sumOfCol = new int[c];",
"sumOfCol",
"new int[c]",
"c",
"for(int i = 0; i < r; i++) {\n\t\t\tString row = br.readLine();\n\t\t\tString[] elem = row.split(\" \");\n\t\t\tsumOfRow = 0;\n\t\t\tfor(int j = 0; j < c; j++) {\n\t\t\t\tsumOfRow += Integer.parseInt(elem[j]);\n\t\t\t\tsumOfCol[j] += Integer.parseInt(elem[j]);\n\t\t\t}\n\t\t\ttotal += sumOfRow;\n\t\t\tsb.append(row + \" \" + sumOfRow + \"\\n\");\n\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < r",
"i",
"r",
"i++",
"i++",
"i",
"{\n\t\t\tString row = br.readLine();\n\t\t\tString[] elem = row.split(\" \");\n\t\t\tsumOfRow = 0;\n\t\t\tfor(int j = 0; j < c; j++) {\n\t\t\t\tsumOfRow += Integer.parseInt(elem[j]);\n\t\t\t\tsumOfCol[j] += Integer.parseInt(elem[j]);\n\t\t\t}\n\t\t\ttotal += sumOfRow;\n\t\t\tsb.append(row + \" \" + sumOfRow + \"\\n\");\n\t\t}",
"{\n\t\t\tString row = br.readLine();\n\t\t\tString[] elem = row.split(\" \");\n\t\t\tsumOfRow = 0;\n\t\t\tfor(int j = 0; j < c; j++) {\n\t\t\t\tsumOfRow += Integer.parseInt(elem[j]);\n\t\t\t\tsumOfCol[j] += Integer.parseInt(elem[j]);\n\t\t\t}\n\t\t\ttotal += sumOfRow;\n\t\t\tsb.append(row + \" \" + sumOfRow + \"\\n\");\n\t\t}",
"String row = br.readLine();",
"row",
"br.readLine()",
"br.readLine",
"br",
"String[] elem = row.split(\" \");",
"elem",
"row.split(\" \")",
"row.split",
"row",
"\" \"",
"sumOfRow = 0",
"sumOfRow",
"0",
"for(int j = 0; j < c; j++) {\n\t\t\t\tsumOfRow += Integer.parseInt(elem[j]);\n\t\t\t\tsumOfCol[j] += Integer.parseInt(elem[j]);\n\t\t\t}",
"int j = 0;",
"int j = 0;",
"j",
"0",
"j < c",
"j",
"c",
"j++",
"j++",
"j",
"{\n\t\t\t\tsumOfRow += Integer.parseInt(elem[j]);\n\t\t\t\tsumOfCol[j] += Integer.parseInt(elem[j]);\n\t\t\t}",
"{\n\t\t\t\tsumOfRow += Integer.parseInt(elem[j]);\n\t\t\t\tsumOfCol[j] += Integer.parseInt(elem[j]);\n\t\t\t}",
"sumOfRow += Integer.parseInt(elem[j])",
"sumOfRow",
"Integer.parseInt(elem[j])",
"Integer.parseInt",
"Integer",
"elem[j]",
"elem",
"j",
"sumOfCol[j] += Integer.parseInt(elem[j])",
"sumOfCol[j]",
"sumOfCol",
"j",
"Integer.parseInt(elem[j])",
"Integer.parseInt",
"Integer",
"elem[j]",
"elem",
"j",
"total += sumOfRow",
"total",
"sumOfRow",
"sb.append(row + \" \" + sumOfRow + \"\\n\")",
"sb.append",
"sb",
"row + \" \" + sumOfRow + \"\\n\"",
"sumOfRow",
"row + \" \" + sumOfRow + \"\\n\"",
"row",
"\" \"",
"sumOfRow",
"\"\\n\"",
"for(int j = 0; j < c; j++) {\n\t\t\tsb.append(sumOfCol[j] + \" \");\n\t\t}",
"int j = 0;",
"int j = 0;",
"j",
"0",
"j < c",
"j",
"c",
"j++",
"j++",
"j",
"{\n\t\t\tsb.append(sumOfCol[j] + \" \");\n\t\t}",
"{\n\t\t\tsb.append(sumOfCol[j] + \" \");\n\t\t}",
"sb.append(sumOfCol[j] + \" \")",
"sb.append",
"sb",
"sumOfCol[j] + \" \"",
"sumOfCol[j]",
"sumOfCol",
"j",
"\" \"",
"System.out.println(sb.append(total))",
"System.out.println",
"System.out",
"System",
"System.out",
"sb.append(total)",
"sb.append",
"sb",
"total",
"String[] args",
"args",
"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\tStringBuilder sb = new StringBuilder();\n\n\t\tString[] rc = br.readLine().split(\" \");\n\t\tint r = Integer.parseInt(rc[0]);\n\t\tint c = Integer.parseInt(rc[1]);\n\t\tint sumOfRow, total = 0;\n\t\tint[] sumOfCol = new int[c];\n\n\t\tfor(int i = 0; i < r; i++) {\n\t\t\tString row = br.readLine();\n\t\t\tString[] elem = row.split(\" \");\n\t\t\tsumOfRow = 0;\n\t\t\tfor(int j = 0; j < c; j++) {\n\t\t\t\tsumOfRow += Integer.parseInt(elem[j]);\n\t\t\t\tsumOfCol[j] += Integer.parseInt(elem[j]);\n\t\t\t}\n\t\t\ttotal += sumOfRow;\n\t\t\tsb.append(row + \" \" + sumOfRow + \"\\n\");\n\t\t}\n\n\t\tfor(int j = 0; j < c; j++) {\n\t\t\tsb.append(sumOfCol[j] + \" \");\n\t\t}\n\n\t\tSystem.out.println(sb.append(total));\n\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\tStringBuilder sb = new StringBuilder();\n\n\t\tString[] rc = br.readLine().split(\" \");\n\t\tint r = Integer.parseInt(rc[0]);\n\t\tint c = Integer.parseInt(rc[1]);\n\t\tint sumOfRow, total = 0;\n\t\tint[] sumOfCol = new int[c];\n\n\t\tfor(int i = 0; i < r; i++) {\n\t\t\tString row = br.readLine();\n\t\t\tString[] elem = row.split(\" \");\n\t\t\tsumOfRow = 0;\n\t\t\tfor(int j = 0; j < c; j++) {\n\t\t\t\tsumOfRow += Integer.parseInt(elem[j]);\n\t\t\t\tsumOfCol[j] += Integer.parseInt(elem[j]);\n\t\t\t}\n\t\t\ttotal += sumOfRow;\n\t\t\tsb.append(row + \" \" + sumOfRow + \"\\n\");\n\t\t}\n\n\t\tfor(int j = 0; j < c; j++) {\n\t\t\tsb.append(sumOfCol[j] + \" \");\n\t\t}\n\n\t\tSystem.out.println(sb.append(total));\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));
StringBuilder sb = new StringBuilder();
String[] rc = br.readLine().split(" ");
int r = Integer.parseInt(rc[0]);
int c = Integer.parseInt(rc[1]);
int sumOfRow, total = 0;
int[] sumOfCol = new int[c];
for(int i = 0; i < r; i++) {
String row = br.readLine();
String[] elem = row.split(" ");
sumOfRow = 0;
for(int j = 0; j < c; j++) {
sumOfRow += Integer.parseInt(elem[j]);
sumOfCol[j] += Integer.parseInt(elem[j]);
}
total += sumOfRow;
sb.append(row + " " + sumOfRow + "\n");
}
for(int j = 0; j < c; j++) {
sb.append(sumOfCol[j] + " ");
}
System.out.println(sb.append(total));
}
} |
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
17,
41,
13,
4,
18,
13,
18,
13,
17,
41,
13,
4,
18,
13,
18,
13,
17,
41,
13,
20,
2,
13,
17,
2,
13,
17,
41,
13,
20,
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,
0,
18,
18,
13,
13,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
18,
18,
13,
13,
13,
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,
0,
18,
18,
13,
13,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
18,
18,
13,
13,
13,
18,
18,
13,
13,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
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,
17,
23,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
8,
17
],
[
17,
18
],
[
17,
19
],
[
19,
20
],
[
20,
21
],
[
19,
22
],
[
8,
23
],
[
23,
24
],
[
23,
25
],
[
25,
26
],
[
26,
27
],
[
25,
28
],
[
28,
29
],
[
28,
30
],
[
8,
31
],
[
31,
32
],
[
31,
33
],
[
33,
34
],
[
34,
35
],
[
33,
36
],
[
36,
37
],
[
36,
38
],
[
8,
39
],
[
39,
40
],
[
39,
41
],
[
42,
43
],
[
42,
44
],
[
45,
46
],
[
45,
47
],
[
8,
48
],
[
48,
49
],
[
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
],
[
66,
72
],
[
72,
73
],
[
72,
74
],
[
74,
75
],
[
75,
76
],
[
74,
77
],
[
66,
78
],
[
78,
79
],
[
79,
80
],
[
80,
81
],
[
80,
82
],
[
79,
83
],
[
78,
84
],
[
66,
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
],
[
104,
107
],
[
107,
108
],
[
107,
109
],
[
97,
110
],
[
110,
111
],
[
111,
112
],
[
112,
113
],
[
112,
114
],
[
111,
115
],
[
110,
116
],
[
116,
117
],
[
117,
118
],
[
117,
119
],
[
116,
120
],
[
8,
121
],
[
121,
122
],
[
122,
123
],
[
123,
124
],
[
123,
125
],
[
121,
126
],
[
126,
127
],
[
126,
128
],
[
121,
129
],
[
129,
130
],
[
130,
131
],
[
121,
132
],
[
133,
133
],
[
133,
134
],
[
134,
135
],
[
135,
136
],
[
136,
137
],
[
136,
138
],
[
135,
139
],
[
134,
140
],
[
133,
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
],
[
155,
159
],
[
154,
160
],
[
160,
161
],
[
161,
162
],
[
161,
163
],
[
160,
164
],
[
8,
165
],
[
165,
166
],
[
166,
167
],
[
167,
168
],
[
167,
169
],
[
165,
170
],
[
170,
171
],
[
170,
172
],
[
165,
173
],
[
173,
174
],
[
174,
175
],
[
165,
176
],
[
177,
177
],
[
177,
178
],
[
178,
179
],
[
179,
180
],
[
180,
181
],
[
180,
182
],
[
178,
183
],
[
183,
184
],
[
183,
185
],
[
178,
186
],
[
186,
187
],
[
187,
188
],
[
178,
189
],
[
190,
190
],
[
190,
191
],
[
191,
192
],
[
192,
193
],
[
193,
194
],
[
193,
195
],
[
191,
196
],
[
196,
197
],
[
197,
198
],
[
197,
199
],
[
196,
200
],
[
190,
201
],
[
201,
202
],
[
202,
203
],
[
202,
204
],
[
201,
205
],
[
205,
206
],
[
206,
207
],
[
207,
208
],
[
208,
209
],
[
208,
210
],
[
206,
211
],
[
177,
212
],
[
212,
213
],
[
213,
214
],
[
214,
215
],
[
214,
216
],
[
212,
217
],
[
6,
218
],
[
218,
219
]
] | [
"import java.io.*;\n \nclass Main {\n public static void main(String[] args) throws IOException {\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n String line = br.readLine();\n String[] rc = line.split(\" \");\n int r = Integer.parseInt(rc[0]);\n int c = Integer.parseInt(rc[1]);\n int[][] matrix = new int[r+1][c+1];\t//????¨???§?????\\??????\n int[] s = new int[c+1];\n for(int i=0; i<r; i++) {\n line = br.readLine();\n String[] inputs = line.split(\" \");\n matrix[i][c] = 0;\t\t\t\t//????¨?\n for(int j=0; j<c; j++) {\n matrix[i][j] = Integer.parseInt(inputs[j]);\n matrix[i][c] += matrix[i][j];\n }\n }\n for(int i=0; i <= c; i++) {\t//????¨????????¨?????¨??????????\n\t\t\tmatrix[r][i] = 0;\n\t\t\tfor( int j = 0 ; j < r ; j++ ) {\n\t\t\t\tmatrix[r][i] += matrix[j][i];\n\t\t\t}\n }\n 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\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 }\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 String line = br.readLine();\n String[] rc = line.split(\" \");\n int r = Integer.parseInt(rc[0]);\n int c = Integer.parseInt(rc[1]);\n int[][] matrix = new int[r+1][c+1];\t//????¨???§?????\\??????\n int[] s = new int[c+1];\n for(int i=0; i<r; i++) {\n line = br.readLine();\n String[] inputs = line.split(\" \");\n matrix[i][c] = 0;\t\t\t\t//????¨?\n for(int j=0; j<c; j++) {\n matrix[i][j] = Integer.parseInt(inputs[j]);\n matrix[i][c] += matrix[i][j];\n }\n }\n for(int i=0; i <= c; i++) {\t//????¨????????¨?????¨??????????\n\t\t\tmatrix[r][i] = 0;\n\t\t\tfor( int j = 0 ; j < r ; j++ ) {\n\t\t\t\tmatrix[r][i] += matrix[j][i];\n\t\t\t}\n }\n 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\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 }\n}",
"Main",
"public static void main(String[] args) throws IOException {\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n String line = br.readLine();\n String[] rc = line.split(\" \");\n int r = Integer.parseInt(rc[0]);\n int c = Integer.parseInt(rc[1]);\n int[][] matrix = new int[r+1][c+1];\t//????¨???§?????\\??????\n int[] s = new int[c+1];\n for(int i=0; i<r; i++) {\n line = br.readLine();\n String[] inputs = line.split(\" \");\n matrix[i][c] = 0;\t\t\t\t//????¨?\n for(int j=0; j<c; j++) {\n matrix[i][j] = Integer.parseInt(inputs[j]);\n matrix[i][c] += matrix[i][j];\n }\n }\n for(int i=0; i <= c; i++) {\t//????¨????????¨?????¨??????????\n\t\t\tmatrix[r][i] = 0;\n\t\t\tfor( int j = 0 ; j < r ; j++ ) {\n\t\t\t\tmatrix[r][i] += matrix[j][i];\n\t\t\t}\n }\n 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\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 }",
"main",
"{\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n String line = br.readLine();\n String[] rc = line.split(\" \");\n int r = Integer.parseInt(rc[0]);\n int c = Integer.parseInt(rc[1]);\n int[][] matrix = new int[r+1][c+1];\t//????¨???§?????\\??????\n int[] s = new int[c+1];\n for(int i=0; i<r; i++) {\n line = br.readLine();\n String[] inputs = line.split(\" \");\n matrix[i][c] = 0;\t\t\t\t//????¨?\n for(int j=0; j<c; j++) {\n matrix[i][j] = Integer.parseInt(inputs[j]);\n matrix[i][c] += matrix[i][j];\n }\n }\n for(int i=0; i <= c; i++) {\t//????¨????????¨?????¨??????????\n\t\t\tmatrix[r][i] = 0;\n\t\t\tfor( int j = 0 ; j < r ; j++ ) {\n\t\t\t\tmatrix[r][i] += matrix[j][i];\n\t\t\t}\n }\n 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\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 }",
"BufferedReader br = new BufferedReader(new InputStreamReader(System.in));",
"br",
"new BufferedReader(new InputStreamReader(System.in))",
"String line = br.readLine();",
"line",
"br.readLine()",
"br.readLine",
"br",
"String[] rc = line.split(\" \");",
"rc",
"line.split(\" \")",
"line.split",
"line",
"\" \"",
"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[][] matrix = new int[r+1][c+1];",
"matrix",
"new int[r+1][c+1]",
"r+1",
"r",
"1",
"c+1",
"c",
"1",
"int[] s = new int[c+1];",
"s",
"new int[c+1]",
"c+1",
"c",
"1",
"for(int i=0; i<r; i++) {\n line = br.readLine();\n String[] inputs = line.split(\" \");\n matrix[i][c] = 0;\t\t\t\t//????¨?\n for(int j=0; j<c; j++) {\n matrix[i][j] = Integer.parseInt(inputs[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 line = br.readLine();\n String[] inputs = line.split(\" \");\n matrix[i][c] = 0;\t\t\t\t//????¨?\n for(int j=0; j<c; j++) {\n matrix[i][j] = Integer.parseInt(inputs[j]);\n matrix[i][c] += matrix[i][j];\n }\n }",
"{\n line = br.readLine();\n String[] inputs = line.split(\" \");\n matrix[i][c] = 0;\t\t\t\t//????¨?\n for(int j=0; j<c; j++) {\n matrix[i][j] = Integer.parseInt(inputs[j]);\n matrix[i][c] += matrix[i][j];\n }\n }",
"line = br.readLine()",
"line",
"br.readLine()",
"br.readLine",
"br",
"String[] inputs = line.split(\" \");",
"inputs",
"line.split(\" \")",
"line.split",
"line",
"\" \"",
"matrix[i][c] = 0",
"matrix[i][c]",
"matrix[i]",
"matrix",
"i",
"c",
"0",
"for(int j=0; j<c; j++) {\n matrix[i][j] = Integer.parseInt(inputs[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][j] = Integer.parseInt(inputs[j]);\n matrix[i][c] += matrix[i][j];\n }",
"{\n matrix[i][j] = Integer.parseInt(inputs[j]);\n matrix[i][c] += matrix[i][j];\n }",
"matrix[i][j] = Integer.parseInt(inputs[j])",
"matrix[i][j]",
"matrix[i]",
"matrix",
"i",
"j",
"Integer.parseInt(inputs[j])",
"Integer.parseInt",
"Integer",
"inputs[j]",
"inputs",
"j",
"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; i++) {\t//????¨????????¨?????¨??????????\n\t\t\tmatrix[r][i] = 0;\n\t\t\tfor( int j = 0 ; j < r ; j++ ) {\n\t\t\t\tmatrix[r][i] += matrix[j][i];\n\t\t\t}\n }",
"int i=0;",
"int i=0;",
"i",
"0",
"i <= c",
"i",
"c",
"i++",
"i++",
"i",
"{\t//????¨????????¨?????¨??????????\n\t\t\tmatrix[r][i] = 0;\n\t\t\tfor( int j = 0 ; j < r ; j++ ) {\n\t\t\t\tmatrix[r][i] += matrix[j][i];\n\t\t\t}\n }",
"{\t//????¨????????¨?????¨??????????\n\t\t\tmatrix[r][i] = 0;\n\t\t\tfor( int j = 0 ; j < r ; j++ ) {\n\t\t\t\tmatrix[r][i] += matrix[j][i];\n\t\t\t}\n }",
"matrix[r][i] = 0",
"matrix[r][i]",
"matrix[r]",
"matrix",
"r",
"i",
"0",
"for( int j = 0 ; j < r ; j++ ) {\n\t\t\t\tmatrix[r][i] += 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\tmatrix[r][i] += matrix[j][i];\n\t\t\t}",
"{\n\t\t\t\tmatrix[r][i] += matrix[j][i];\n\t\t\t}",
"matrix[r][i] += matrix[j][i]",
"matrix[r][i]",
"matrix[r]",
"matrix",
"r",
"i",
"matrix[j][i]",
"matrix[j]",
"matrix",
"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( matrix[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",
"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\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 ; j++ ) {\n\t\t\t\tSystem.out.print( matrix[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 ; j++ ) {\n\t\t\t\tSystem.out.print( matrix[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",
"j",
"c",
"j++",
"j++",
"j",
"{\n\t\t\t\tSystem.out.print( matrix[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( matrix[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( matrix[i][j])",
"System.out.print",
"System.out",
"System",
"System.out",
"matrix[i][j]",
"matrix[i]",
"matrix",
"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"
] | import java.io.*;
class Main {
public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
String line = br.readLine();
String[] rc = line.split(" ");
int r = Integer.parseInt(rc[0]);
int c = Integer.parseInt(rc[1]);
int[][] matrix = new int[r+1][c+1]; //????¨???§?????\??????
int[] s = new int[c+1];
for(int i=0; i<r; i++) {
line = br.readLine();
String[] inputs = line.split(" ");
matrix[i][c] = 0; //????¨?
for(int j=0; j<c; j++) {
matrix[i][j] = Integer.parseInt(inputs[j]);
matrix[i][c] += matrix[i][j];
}
}
for(int i=0; i <= c; i++) { //????¨????????¨?????¨??????????
matrix[r][i] = 0;
for( int j = 0 ; j < r ; j++ ) {
matrix[r][i] += matrix[j][i];
}
}
for(int i = 0 ; i <= r ; i++ ) {
for( int j = 0 ; j <= c ; j++ ) {
System.out.print( matrix[i][j]) ;
if ( j < c ) {
System.out.print( " " ) ;
}
}
System.out.println("");
}
}
} |
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
41,
13,
20,
2,
13,
17,
2,
13,
17,
41,
13,
20,
41,
13,
20,
41,
13,
17,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
18,
18,
13,
13,
13,
4,
18,
13,
0,
18,
18,
13,
13,
13,
18,
18,
13,
13,
13,
0,
18,
18,
13,
13,
13,
18,
18,
13,
13,
13,
0,
18,
18,
13,
13,
13,
18,
18,
13,
13,
13,
4,
18,
13,
2,
18,
18,
13,
13,
13,
13,
14,
2,
13,
2,
13,
17,
4,
18,
13,
2,
18,
18,
13,
13,
13,
13,
4,
18,
13,
2,
18,
18,
13,
13,
13,
13,
4,
18,
13,
18,
18,
13,
13,
13,
4,
18,
18,
13,
13,
13,
4,
18,
18,
13,
13,
13,
23,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
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
],
[
34,
36
],
[
8,
37
],
[
37,
38
],
[
37,
39
],
[
8,
40
],
[
40,
41
],
[
40,
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
],
[
57,
58
],
[
58,
59
],
[
58,
60
],
[
56,
61
],
[
61,
62
],
[
61,
63
],
[
56,
64
],
[
64,
65
],
[
65,
66
],
[
56,
67
],
[
68,
68
],
[
68,
69
],
[
69,
70
],
[
70,
71
],
[
71,
72
],
[
71,
73
],
[
70,
74
],
[
69,
75
],
[
75,
76
],
[
76,
77
],
[
68,
78
],
[
78,
79
],
[
79,
80
],
[
80,
81
],
[
80,
82
],
[
79,
83
],
[
78,
84
],
[
84,
85
],
[
85,
86
],
[
85,
87
],
[
84,
88
],
[
68,
89
],
[
89,
90
],
[
90,
91
],
[
91,
92
],
[
91,
93
],
[
90,
94
],
[
89,
95
],
[
95,
96
],
[
96,
97
],
[
96,
98
],
[
95,
99
],
[
68,
100
],
[
100,
101
],
[
101,
102
],
[
102,
103
],
[
102,
104
],
[
101,
105
],
[
100,
106
],
[
106,
107
],
[
107,
108
],
[
107,
109
],
[
106,
110
],
[
68,
111
],
[
111,
112
],
[
112,
113
],
[
111,
114
],
[
114,
115
],
[
115,
116
],
[
116,
117
],
[
116,
118
],
[
115,
119
],
[
114,
120
],
[
68,
121
],
[
121,
122
],
[
122,
123
],
[
122,
124
],
[
124,
125
],
[
124,
126
],
[
121,
127
],
[
127,
128
],
[
128,
129
],
[
127,
130
],
[
130,
131
],
[
131,
132
],
[
132,
133
],
[
132,
134
],
[
131,
135
],
[
130,
136
],
[
55,
137
],
[
137,
138
],
[
138,
139
],
[
137,
140
],
[
140,
141
],
[
141,
142
],
[
142,
143
],
[
142,
144
],
[
141,
145
],
[
140,
146
],
[
8,
147
],
[
147,
148
],
[
148,
149
],
[
147,
150
],
[
150,
151
],
[
151,
152
],
[
151,
153
],
[
150,
154
],
[
8,
155
],
[
155,
156
],
[
156,
157
],
[
157,
158
],
[
157,
159
],
[
155,
160
],
[
8,
161
],
[
161,
162
],
[
162,
163
],
[
163,
164
],
[
163,
165
],
[
161,
166
],
[
6,
167
],
[
167,
168
]
] | [
"import java.util.Scanner;\n\nclass Main {\n\tpublic static void main(String[] args) throws Exception {\n\t\tScanner sc=new Scanner(System.in);\n\t\tint r=sc.nextInt();\n\t\tint c=sc.nextInt();\n int[][] h=new int[r+1][c+1];\n\t\tStringBuilder sb1=new StringBuilder();\n\t\tStringBuilder sb2=new StringBuilder();\n\t\tString b=\" \",n=\"\\n\";\n for(int i=0;i<r;i++){\n \tfor(int j=0;j<c;j++){\n \t\th[i][j]=sc.nextInt();\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\tsb1.append(h[i][j]+b);\n \t\tif(i==r-1) sb2.append(h[r][j]+b);\n \t}\n \tsb1.append(h[i][c]+n);\n }\n sb2.append(h[r][c]);\n System.out.print(sb1);\n System.out.println(sb2);\n\t}\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"class Main {\n\tpublic static void main(String[] args) throws Exception {\n\t\tScanner sc=new Scanner(System.in);\n\t\tint r=sc.nextInt();\n\t\tint c=sc.nextInt();\n int[][] h=new int[r+1][c+1];\n\t\tStringBuilder sb1=new StringBuilder();\n\t\tStringBuilder sb2=new StringBuilder();\n\t\tString b=\" \",n=\"\\n\";\n for(int i=0;i<r;i++){\n \tfor(int j=0;j<c;j++){\n \t\th[i][j]=sc.nextInt();\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\tsb1.append(h[i][j]+b);\n \t\tif(i==r-1) sb2.append(h[r][j]+b);\n \t}\n \tsb1.append(h[i][c]+n);\n }\n sb2.append(h[r][c]);\n System.out.print(sb1);\n System.out.println(sb2);\n\t}\n}",
"Main",
"public static void main(String[] args) throws Exception {\n\t\tScanner sc=new Scanner(System.in);\n\t\tint r=sc.nextInt();\n\t\tint c=sc.nextInt();\n int[][] h=new int[r+1][c+1];\n\t\tStringBuilder sb1=new StringBuilder();\n\t\tStringBuilder sb2=new StringBuilder();\n\t\tString b=\" \",n=\"\\n\";\n for(int i=0;i<r;i++){\n \tfor(int j=0;j<c;j++){\n \t\th[i][j]=sc.nextInt();\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\tsb1.append(h[i][j]+b);\n \t\tif(i==r-1) sb2.append(h[r][j]+b);\n \t}\n \tsb1.append(h[i][c]+n);\n }\n sb2.append(h[r][c]);\n System.out.print(sb1);\n System.out.println(sb2);\n\t}",
"main",
"{\n\t\tScanner sc=new Scanner(System.in);\n\t\tint r=sc.nextInt();\n\t\tint c=sc.nextInt();\n int[][] h=new int[r+1][c+1];\n\t\tStringBuilder sb1=new StringBuilder();\n\t\tStringBuilder sb2=new StringBuilder();\n\t\tString b=\" \",n=\"\\n\";\n for(int i=0;i<r;i++){\n \tfor(int j=0;j<c;j++){\n \t\th[i][j]=sc.nextInt();\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\tsb1.append(h[i][j]+b);\n \t\tif(i==r-1) sb2.append(h[r][j]+b);\n \t}\n \tsb1.append(h[i][c]+n);\n }\n sb2.append(h[r][c]);\n System.out.print(sb1);\n System.out.println(sb2);\n\t}",
"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[][] h=new int[r+1][c+1];",
"h",
"new int[r+1][c+1]",
"r+1",
"r",
"1",
"c+1",
"c",
"1",
"StringBuilder sb1=new StringBuilder();",
"sb1",
"new StringBuilder()",
"StringBuilder sb2=new StringBuilder();",
"sb2",
"new StringBuilder()",
"String b=\" \"",
"b",
"\" \"",
"n=\"\\n\";",
"n",
"\"\\n\"",
"for(int i=0;i<r;i++){\n \tfor(int j=0;j<c;j++){\n \t\th[i][j]=sc.nextInt();\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\tsb1.append(h[i][j]+b);\n \t\tif(i==r-1) sb2.append(h[r][j]+b);\n \t}\n \tsb1.append(h[i][c]+n);\n }",
"int i=0;",
"int i=0;",
"i",
"0",
"i<r",
"i",
"r",
"i++",
"i++",
"i",
"{\n \tfor(int j=0;j<c;j++){\n \t\th[i][j]=sc.nextInt();\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\tsb1.append(h[i][j]+b);\n \t\tif(i==r-1) sb2.append(h[r][j]+b);\n \t}\n \tsb1.append(h[i][c]+n);\n }",
"{\n \tfor(int j=0;j<c;j++){\n \t\th[i][j]=sc.nextInt();\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\tsb1.append(h[i][j]+b);\n \t\tif(i==r-1) sb2.append(h[r][j]+b);\n \t}\n \tsb1.append(h[i][c]+n);\n }",
"for(int j=0;j<c;j++){\n \t\th[i][j]=sc.nextInt();\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\tsb1.append(h[i][j]+b);\n \t\tif(i==r-1) sb2.append(h[r][j]+b);\n \t}",
"int j=0;",
"int j=0;",
"j",
"0",
"j<c",
"j",
"c",
"j++",
"j++",
"j",
"{\n \t\th[i][j]=sc.nextInt();\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\tsb1.append(h[i][j]+b);\n \t\tif(i==r-1) sb2.append(h[r][j]+b);\n \t}",
"{\n \t\th[i][j]=sc.nextInt();\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\tsb1.append(h[i][j]+b);\n \t\tif(i==r-1) sb2.append(h[r][j]+b);\n \t}",
"h[i][j]=sc.nextInt()",
"h[i][j]",
"h[i]",
"h",
"i",
"j",
"sc.nextInt()",
"sc.nextInt",
"sc",
"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",
"sb1.append(h[i][j]+b)",
"sb1.append",
"sb1",
"h[i][j]+b",
"h[i][j]",
"h[i]",
"h",
"i",
"j",
"b",
"if(i==r-1) sb2.append(h[r][j]+b);",
"i==r-1",
"i",
"r-1",
"r",
"1",
"sb2.append(h[r][j]+b)",
"sb2.append",
"sb2",
"h[r][j]+b",
"h[r][j]",
"h[r]",
"h",
"r",
"j",
"b",
"sb1.append(h[i][c]+n)",
"sb1.append",
"sb1",
"h[i][c]+n",
"h[i][c]",
"h[i]",
"h",
"i",
"c",
"n",
"sb2.append(h[r][c])",
"sb2.append",
"sb2",
"h[r][c]",
"h[r]",
"h",
"r",
"c",
"System.out.print(sb1)",
"System.out.print",
"System.out",
"System",
"System.out",
"sb1",
"System.out.println(sb2)",
"System.out.println",
"System.out",
"System",
"System.out",
"sb2",
"String[] args",
"args"
] | import java.util.Scanner;
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[][] h=new int[r+1][c+1];
StringBuilder sb1=new StringBuilder();
StringBuilder sb2=new StringBuilder();
String b=" ",n="\n";
for(int i=0;i<r;i++){
for(int j=0;j<c;j++){
h[i][j]=sc.nextInt();
h[i][c]+=h[i][j];
h[r][j]+=h[i][j];
h[r][c]+=h[i][j];
sb1.append(h[i][j]+b);
if(i==r-1) sb2.append(h[r][j]+b);
}
sb1.append(h[i][c]+n);
}
sb2.append(h[r][c]);
System.out.print(sb1);
System.out.println(sb2);
}
} |
[
7,
15,
13,
17,
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,
2,
13,
17,
2,
13,
17,
41,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
20,
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,
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,
0,
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,
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
],
[
11,
18
],
[
18,
19
],
[
18,
20
],
[
20,
21
],
[
21,
22
],
[
20,
23
],
[
23,
24
],
[
24,
25
],
[
11,
26
],
[
26,
27
],
[
26,
28
],
[
28,
29
],
[
29,
30
],
[
28,
31
],
[
31,
32
],
[
32,
33
],
[
11,
34
],
[
34,
35
],
[
34,
36
],
[
37,
38
],
[
37,
39
],
[
40,
41
],
[
40,
42
],
[
11,
43
],
[
43,
44
],
[
11,
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
],
[
61,
63
],
[
57,
64
],
[
64,
65
],
[
65,
66
],
[
66,
67
],
[
66,
68
],
[
64,
69
],
[
69,
70
],
[
69,
71
],
[
64,
72
],
[
72,
73
],
[
73,
74
],
[
64,
75
],
[
76,
76
],
[
76,
77
],
[
77,
78
],
[
78,
79
],
[
79,
80
],
[
79,
81
],
[
78,
82
],
[
77,
83
],
[
83,
84
],
[
84,
85
],
[
83,
86
],
[
86,
87
],
[
87,
88
],
[
76,
89
],
[
89,
90
],
[
89,
91
],
[
91,
92
],
[
92,
93
],
[
92,
94
],
[
91,
95
],
[
57,
96
],
[
96,
97
],
[
97,
98
],
[
98,
99
],
[
98,
100
],
[
97,
101
],
[
96,
102
],
[
11,
103
],
[
103,
104
],
[
104,
105
],
[
105,
106
],
[
105,
107
],
[
103,
108
],
[
108,
109
],
[
108,
110
],
[
110,
111
],
[
110,
112
],
[
103,
113
],
[
113,
114
],
[
114,
115
],
[
103,
116
],
[
117,
117
],
[
117,
118
],
[
118,
119
],
[
118,
120
],
[
117,
121
],
[
121,
122
],
[
122,
123
],
[
123,
124
],
[
123,
125
],
[
121,
126
],
[
126,
127
],
[
126,
128
],
[
121,
129
],
[
129,
130
],
[
130,
131
],
[
121,
132
],
[
133,
133
],
[
133,
134
],
[
134,
135
],
[
134,
136
],
[
136,
137
],
[
137,
138
],
[
137,
139
],
[
136,
140
],
[
117,
141
],
[
141,
142
],
[
142,
143
],
[
143,
144
],
[
143,
145
],
[
142,
146
],
[
141,
147
],
[
11,
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
],
[
165,
166
],
[
165,
167
],
[
163,
168
],
[
168,
169
],
[
168,
170
],
[
163,
171
],
[
171,
172
],
[
172,
173
],
[
163,
174
],
[
175,
175
],
[
175,
176
],
[
176,
177
],
[
177,
178
],
[
178,
179
],
[
178,
180
],
[
176,
181
],
[
181,
182
],
[
182,
183
],
[
183,
184
],
[
183,
185
],
[
182,
186
],
[
181,
187
],
[
162,
188
],
[
188,
189
],
[
189,
190
],
[
190,
191
],
[
190,
192
],
[
188,
193
],
[
193,
194
],
[
194,
195
],
[
194,
196
],
[
193,
197
],
[
9,
198
],
[
198,
199
]
] | [
"import java.io.*;\nimport java.util.*;\n\nclass Main {\n\n public static void main(String[] args) throws IOException {\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n StringTokenizer st=new StringTokenizer(br.readLine());\n int r=Integer.parseInt(st.nextToken());\n int c=Integer.parseInt(st.nextToken());\n int[][] matrix=new int[r+1][c+1];\n int sum;\n for(int i=0;i<r;i++){\n st=new StringTokenizer(br.readLine());\n sum=0;\n for(int j=0;j<c;j++){\n matrix[i][j]=Integer.parseInt(st.nextToken());\n sum+=matrix[i][j];\n }matrix[i][c]=sum;\n }for(int i=0;i<c+1;i++){\n sum=0;\n for(int j=0;j<r;j++){\n sum+=matrix[j][i];\n }matrix[r][i]=sum;\n }\n for(int i=0;i<r+1;i++){\n for(int j=0;j<c;j++){\n System.out.print(matrix[i][j]+\" \");\n }System.out.println(matrix[i][c]);\n }\n }\n}",
"import java.io.*;",
"io.*",
"java",
"import java.util.*;",
"util.*",
"java",
"class Main {\n\n public static void main(String[] args) throws IOException {\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n StringTokenizer st=new StringTokenizer(br.readLine());\n int r=Integer.parseInt(st.nextToken());\n int c=Integer.parseInt(st.nextToken());\n int[][] matrix=new int[r+1][c+1];\n int sum;\n for(int i=0;i<r;i++){\n st=new StringTokenizer(br.readLine());\n sum=0;\n for(int j=0;j<c;j++){\n matrix[i][j]=Integer.parseInt(st.nextToken());\n sum+=matrix[i][j];\n }matrix[i][c]=sum;\n }for(int i=0;i<c+1;i++){\n sum=0;\n for(int j=0;j<r;j++){\n sum+=matrix[j][i];\n }matrix[r][i]=sum;\n }\n for(int i=0;i<r+1;i++){\n for(int j=0;j<c;j++){\n System.out.print(matrix[i][j]+\" \");\n }System.out.println(matrix[i][c]);\n }\n }\n}",
"Main",
"public static void main(String[] args) throws IOException {\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n StringTokenizer st=new StringTokenizer(br.readLine());\n int r=Integer.parseInt(st.nextToken());\n int c=Integer.parseInt(st.nextToken());\n int[][] matrix=new int[r+1][c+1];\n int sum;\n for(int i=0;i<r;i++){\n st=new StringTokenizer(br.readLine());\n sum=0;\n for(int j=0;j<c;j++){\n matrix[i][j]=Integer.parseInt(st.nextToken());\n sum+=matrix[i][j];\n }matrix[i][c]=sum;\n }for(int i=0;i<c+1;i++){\n sum=0;\n for(int j=0;j<r;j++){\n sum+=matrix[j][i];\n }matrix[r][i]=sum;\n }\n for(int i=0;i<r+1;i++){\n for(int j=0;j<c;j++){\n System.out.print(matrix[i][j]+\" \");\n }System.out.println(matrix[i][c]);\n }\n }",
"main",
"{\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n StringTokenizer st=new StringTokenizer(br.readLine());\n int r=Integer.parseInt(st.nextToken());\n int c=Integer.parseInt(st.nextToken());\n int[][] matrix=new int[r+1][c+1];\n int sum;\n for(int i=0;i<r;i++){\n st=new StringTokenizer(br.readLine());\n sum=0;\n for(int j=0;j<c;j++){\n matrix[i][j]=Integer.parseInt(st.nextToken());\n sum+=matrix[i][j];\n }matrix[i][c]=sum;\n }for(int i=0;i<c+1;i++){\n sum=0;\n for(int j=0;j<r;j++){\n sum+=matrix[j][i];\n }matrix[r][i]=sum;\n }\n for(int i=0;i<r+1;i++){\n for(int j=0;j<c;j++){\n System.out.print(matrix[i][j]+\" \");\n }System.out.println(matrix[i][c]);\n }\n }",
"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[][] matrix=new int[r+1][c+1];",
"matrix",
"new int[r+1][c+1]",
"r+1",
"r",
"1",
"c+1",
"c",
"1",
"int sum;",
"sum",
"for(int i=0;i<r;i++){\n st=new StringTokenizer(br.readLine());\n sum=0;\n for(int j=0;j<c;j++){\n matrix[i][j]=Integer.parseInt(st.nextToken());\n sum+=matrix[i][j];\n }matrix[i][c]=sum;\n }",
"int i=0;",
"int i=0;",
"i",
"0",
"i<r",
"i",
"r",
"i++",
"i++",
"i",
"{\n st=new StringTokenizer(br.readLine());\n sum=0;\n for(int j=0;j<c;j++){\n matrix[i][j]=Integer.parseInt(st.nextToken());\n sum+=matrix[i][j];\n }matrix[i][c]=sum;\n }",
"{\n st=new StringTokenizer(br.readLine());\n sum=0;\n for(int j=0;j<c;j++){\n matrix[i][j]=Integer.parseInt(st.nextToken());\n sum+=matrix[i][j];\n }matrix[i][c]=sum;\n }",
"st=new StringTokenizer(br.readLine())",
"st",
"new StringTokenizer(br.readLine())",
"sum=0",
"sum",
"0",
"for(int j=0;j<c;j++){\n matrix[i][j]=Integer.parseInt(st.nextToken());\n sum+=matrix[i][j];\n }",
"int j=0;",
"int j=0;",
"j",
"0",
"j<c",
"j",
"c",
"j++",
"j++",
"j",
"{\n matrix[i][j]=Integer.parseInt(st.nextToken());\n sum+=matrix[i][j];\n }",
"{\n matrix[i][j]=Integer.parseInt(st.nextToken());\n sum+=matrix[i][j];\n }",
"matrix[i][j]=Integer.parseInt(st.nextToken())",
"matrix[i][j]",
"matrix[i]",
"matrix",
"i",
"j",
"Integer.parseInt(st.nextToken())",
"Integer.parseInt",
"Integer",
"st.nextToken()",
"st.nextToken",
"st",
"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+1;i++){\n sum=0;\n for(int j=0;j<r;j++){\n sum+=matrix[j][i];\n }matrix[r][i]=sum;\n }",
"int i=0;",
"int i=0;",
"i",
"0",
"i<c+1",
"i",
"c+1",
"c",
"1",
"i++",
"i++",
"i",
"{\n sum=0;\n for(int j=0;j<r;j++){\n sum+=matrix[j][i];\n }matrix[r][i]=sum;\n }",
"{\n sum=0;\n for(int j=0;j<r;j++){\n sum+=matrix[j][i];\n }matrix[r][i]=sum;\n }",
"sum=0",
"sum",
"0",
"for(int j=0;j<r;j++){\n sum+=matrix[j][i];\n }",
"int j=0;",
"int j=0;",
"j",
"0",
"j<r",
"j",
"r",
"j++",
"j++",
"j",
"{\n sum+=matrix[j][i];\n }",
"{\n sum+=matrix[j][i];\n }",
"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<r+1;i++){\n for(int j=0;j<c;j++){\n System.out.print(matrix[i][j]+\" \");\n }System.out.println(matrix[i][c]);\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;j++){\n System.out.print(matrix[i][j]+\" \");\n }System.out.println(matrix[i][c]);\n }",
"{\n for(int j=0;j<c;j++){\n System.out.print(matrix[i][j]+\" \");\n }System.out.println(matrix[i][c]);\n }",
"for(int j=0;j<c;j++){\n System.out.print(matrix[i][j]+\" \");\n }",
"int j=0;",
"int j=0;",
"j",
"0",
"j<c",
"j",
"c",
"j++",
"j++",
"j",
"{\n System.out.print(matrix[i][j]+\" \");\n }",
"{\n System.out.print(matrix[i][j]+\" \");\n }",
"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(matrix[i][c])",
"System.out.println",
"System.out",
"System",
"System.out",
"matrix[i][c]",
"matrix[i]",
"matrix",
"i",
"c",
"String[] args",
"args"
] | import java.io.*;
import java.util.*;
class Main {
public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
StringTokenizer st=new StringTokenizer(br.readLine());
int r=Integer.parseInt(st.nextToken());
int c=Integer.parseInt(st.nextToken());
int[][] matrix=new int[r+1][c+1];
int sum;
for(int i=0;i<r;i++){
st=new StringTokenizer(br.readLine());
sum=0;
for(int j=0;j<c;j++){
matrix[i][j]=Integer.parseInt(st.nextToken());
sum+=matrix[i][j];
}matrix[i][c]=sum;
}for(int i=0;i<c+1;i++){
sum=0;
for(int j=0;j<r;j++){
sum+=matrix[j][i];
}matrix[r][i]=sum;
}
for(int i=0;i<r+1;i++){
for(int j=0;j<c;j++){
System.out.print(matrix[i][j]+" ");
}System.out.println(matrix[i][c]);
}
}
} |
[
7,
15,
13,
17,
15,
13,
17,
6,
13,
41,
13,
17,
12,
13,
30,
38,
5,
13,
30,
4,
18,
13,
40,
17,
30,
41,
13,
20,
41,
13,
41,
13,
17,
41,
13,
17,
41,
13,
17,
42,
2,
0,
13,
4,
18,
13,
17,
30,
14,
2,
4,
18,
13,
17,
30,
41,
13,
4,
18,
13,
13,
0,
13,
4,
18,
13,
18,
13,
17,
0,
13,
4,
18,
13,
18,
13,
17,
0,
13,
20,
2,
13,
17,
2,
13,
17,
14,
2,
4,
18,
13,
17,
30,
41,
13,
4,
18,
13,
13,
41,
13,
17,
41,
13,
2,
4,
18,
13,
17,
28,
13,
13,
30,
30,
0,
18,
18,
13,
13,
13,
4,
18,
13,
13,
40,
13,
14,
2,
4,
18,
13,
2,
13,
17,
3,
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,
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,
13,
40,
13,
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
],
[
264,
8
],
[
264,
9
],
[
9,
10
],
[
9,
11
],
[
264,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
16,
17
],
[
16,
18
],
[
18,
19
],
[
19,
20
],
[
20,
21
],
[
19,
22
],
[
22,
23
],
[
15,
24
],
[
24,
25
],
[
25,
26
],
[
25,
27
],
[
24,
28
],
[
28,
29
],
[
24,
30
],
[
30,
31
],
[
30,
32
],
[
24,
33
],
[
33,
34
],
[
33,
35
],
[
24,
36
],
[
36,
37
],
[
36,
38
],
[
24,
39
],
[
39,
40
],
[
40,
41
],
[
41,
42
],
[
41,
43
],
[
43,
44
],
[
44,
45
],
[
40,
46
],
[
39,
47
],
[
47,
48
],
[
48,
49
],
[
49,
50
],
[
50,
51
],
[
51,
52
],
[
49,
53
],
[
48,
54
],
[
54,
55
],
[
55,
56
],
[
55,
57
],
[
57,
58
],
[
58,
59
],
[
57,
60
],
[
54,
61
],
[
61,
62
],
[
61,
63
],
[
63,
64
],
[
64,
65
],
[
63,
66
],
[
66,
67
],
[
66,
68
],
[
54,
69
],
[
69,
70
],
[
69,
71
],
[
71,
72
],
[
72,
73
],
[
71,
74
],
[
74,
75
],
[
74,
76
],
[
54,
77
],
[
77,
78
],
[
77,
79
],
[
80,
81
],
[
80,
82
],
[
83,
84
],
[
83,
85
],
[
47,
86
],
[
86,
87
],
[
87,
88
],
[
88,
89
],
[
89,
90
],
[
87,
91
],
[
86,
92
],
[
92,
93
],
[
93,
94
],
[
93,
95
],
[
95,
96
],
[
96,
97
],
[
95,
98
],
[
92,
99
],
[
99,
100
],
[
99,
101
],
[
92,
102
],
[
102,
103
],
[
102,
104
],
[
104,
105
],
[
105,
106
],
[
106,
107
],
[
104,
108
],
[
92,
109
],
[
109,
110
],
[
109,
111
],
[
109,
112
],
[
113,
113
],
[
113,
114
],
[
114,
115
],
[
115,
116
],
[
116,
117
],
[
116,
118
],
[
115,
119
],
[
114,
120
],
[
120,
121
],
[
121,
122
],
[
120,
123
],
[
113,
124
],
[
124,
125
],
[
92,
126
],
[
126,
127
],
[
127,
128
],
[
128,
129
],
[
129,
130
],
[
127,
131
],
[
131,
132
],
[
131,
133
],
[
126,
134
],
[
24,
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
],
[
147,
151
],
[
151,
152
],
[
152,
153
],
[
153,
154
],
[
153,
155
],
[
151,
156
],
[
156,
157
],
[
156,
158
],
[
151,
159
],
[
159,
160
],
[
160,
161
],
[
151,
162
],
[
163,
163
],
[
163,
164
],
[
164,
165
],
[
164,
166
],
[
166,
167
],
[
167,
168
],
[
167,
169
],
[
166,
170
],
[
147,
171
],
[
171,
172
],
[
172,
173
],
[
173,
174
],
[
173,
175
],
[
172,
176
],
[
171,
177
],
[
24,
178
],
[
178,
179
],
[
179,
180
],
[
180,
181
],
[
180,
182
],
[
178,
183
],
[
183,
184
],
[
183,
185
],
[
178,
186
],
[
186,
187
],
[
187,
188
],
[
178,
189
],
[
190,
190
],
[
190,
191
],
[
191,
192
],
[
191,
193
],
[
190,
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
],
[
209,
210
],
[
210,
211
],
[
210,
212
],
[
209,
213
],
[
190,
214
],
[
214,
215
],
[
215,
216
],
[
216,
217
],
[
216,
218
],
[
215,
219
],
[
214,
220
],
[
24,
221
],
[
221,
222
],
[
221,
223
],
[
221,
224
],
[
225,
225
],
[
225,
226
],
[
226,
227
],
[
226,
228
],
[
225,
229
],
[
229,
230
],
[
229,
231
],
[
229,
232
],
[
233,
233
],
[
233,
234
],
[
234,
235
],
[
235,
236
],
[
236,
237
],
[
236,
238
],
[
234,
239
],
[
233,
240
],
[
240,
241
],
[
241,
242
],
[
241,
243
],
[
240,
244
],
[
244,
245
],
[
245,
246
],
[
246,
247
],
[
247,
248
],
[
247,
249
],
[
245,
250
],
[
233,
251
],
[
251,
252
],
[
225,
253
],
[
253,
254
],
[
254,
255
],
[
255,
256
],
[
255,
257
],
[
24,
258
],
[
258,
259
],
[
259,
260
],
[
12,
261
],
[
261,
262
],
[
0,
263
],
[
263,
264
],
[
263,
265
]
] | [
"import java.io.InputStreamReader;\nimport java.io.LineNumberReader;\n\n/**\n * http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=ITP1_7_C\n * \n * @author eitatsuro\n * \n */\npublic class Main {\n private final static String SPACE = \" \";\n public static void main(String[] args) {\n try {\n LineNumberReader stdReader = new LineNumberReader(\n new InputStreamReader(System.in));\n \n String sStr;\n int r = 0;\n int c = 0;\n int an[] []= null;\n\n while ((sStr = stdReader.readLine()) != null) {\n // ??\\???????????°\n if (stdReader.getLineNumber() == 1) {\n String[] inputs = sStr.split(SPACE);\n r = Integer.valueOf(inputs[0]);\n c = Integer.valueOf(inputs[1]);\n \n // r??? x c?????????????¢????\n // ??????????´???¨????´?????¢????.\n an = new int[r+1][c+1];\n }\n\n // ???????????????\n // 0, 1, 2, 3, .... x 0, 1, 2, 3, ... (0??????????????°??????)\n if (stdReader.getLineNumber() >= 2){\n String[] matrix_row = sStr.split(SPACE);\n int i = 0;\n int row = stdReader.getLineNumber() - 2;\n for (String temp : matrix_row) {\n an[row][i] = Integer.valueOf(temp);\n i++;\n }\n \n if (stdReader.getLineNumber() == r+1) break;\n }\n\n }\n\n\n // ??¢????????????????¨????\n for (int i = 0; i<r; i++){\n int sumOfRow = 0;\n for (int j = 0; j<c; j++){\n sumOfRow += an[i][j];\n }\n an[i][c] = sumOfRow;\n }\n\n for (int i = 0; i<=c; i++){\n int sumOfColumn = 0;\n for (int j = 0; j<r; j++){\n sumOfColumn += an[j][i];\n }\n an[r][i] = sumOfColumn;\n }\n \n \n // ????????????\n for (int[] r_temp : an) {\n int i = 0;\n for (int c_temp : r_temp) {\n System.out.print(c_temp );\n if (i <c) {\n System.out.print(SPACE);\n }\n i++;\n }\n System.out.println();\n }\n\n stdReader.close();\n } catch (Exception e) {\n System.exit(-1);\n }\n \n }\n}",
"import java.io.InputStreamReader;",
"InputStreamReader",
"java.io",
"import java.io.LineNumberReader;",
"LineNumberReader",
"java.io",
"public class Main {\n private final static String SPACE = \" \";\n public static void main(String[] args) {\n try {\n LineNumberReader stdReader = new LineNumberReader(\n new InputStreamReader(System.in));\n \n String sStr;\n int r = 0;\n int c = 0;\n int an[] []= null;\n\n while ((sStr = stdReader.readLine()) != null) {\n // ??\\???????????°\n if (stdReader.getLineNumber() == 1) {\n String[] inputs = sStr.split(SPACE);\n r = Integer.valueOf(inputs[0]);\n c = Integer.valueOf(inputs[1]);\n \n // r??? x c?????????????¢????\n // ??????????´???¨????´?????¢????.\n an = new int[r+1][c+1];\n }\n\n // ???????????????\n // 0, 1, 2, 3, .... x 0, 1, 2, 3, ... (0??????????????°??????)\n if (stdReader.getLineNumber() >= 2){\n String[] matrix_row = sStr.split(SPACE);\n int i = 0;\n int row = stdReader.getLineNumber() - 2;\n for (String temp : matrix_row) {\n an[row][i] = Integer.valueOf(temp);\n i++;\n }\n \n if (stdReader.getLineNumber() == r+1) break;\n }\n\n }\n\n\n // ??¢????????????????¨????\n for (int i = 0; i<r; i++){\n int sumOfRow = 0;\n for (int j = 0; j<c; j++){\n sumOfRow += an[i][j];\n }\n an[i][c] = sumOfRow;\n }\n\n for (int i = 0; i<=c; i++){\n int sumOfColumn = 0;\n for (int j = 0; j<r; j++){\n sumOfColumn += an[j][i];\n }\n an[r][i] = sumOfColumn;\n }\n \n \n // ????????????\n for (int[] r_temp : an) {\n int i = 0;\n for (int c_temp : r_temp) {\n System.out.print(c_temp );\n if (i <c) {\n System.out.print(SPACE);\n }\n i++;\n }\n System.out.println();\n }\n\n stdReader.close();\n } catch (Exception e) {\n System.exit(-1);\n }\n \n }\n}",
"Main",
"private final static String SPACE = \" \";",
"SPACE",
"\" \"",
"public static void main(String[] args) {\n try {\n LineNumberReader stdReader = new LineNumberReader(\n new InputStreamReader(System.in));\n \n String sStr;\n int r = 0;\n int c = 0;\n int an[] []= null;\n\n while ((sStr = stdReader.readLine()) != null) {\n // ??\\???????????°\n if (stdReader.getLineNumber() == 1) {\n String[] inputs = sStr.split(SPACE);\n r = Integer.valueOf(inputs[0]);\n c = Integer.valueOf(inputs[1]);\n \n // r??? x c?????????????¢????\n // ??????????´???¨????´?????¢????.\n an = new int[r+1][c+1];\n }\n\n // ???????????????\n // 0, 1, 2, 3, .... x 0, 1, 2, 3, ... (0??????????????°??????)\n if (stdReader.getLineNumber() >= 2){\n String[] matrix_row = sStr.split(SPACE);\n int i = 0;\n int row = stdReader.getLineNumber() - 2;\n for (String temp : matrix_row) {\n an[row][i] = Integer.valueOf(temp);\n i++;\n }\n \n if (stdReader.getLineNumber() == r+1) break;\n }\n\n }\n\n\n // ??¢????????????????¨????\n for (int i = 0; i<r; i++){\n int sumOfRow = 0;\n for (int j = 0; j<c; j++){\n sumOfRow += an[i][j];\n }\n an[i][c] = sumOfRow;\n }\n\n for (int i = 0; i<=c; i++){\n int sumOfColumn = 0;\n for (int j = 0; j<r; j++){\n sumOfColumn += an[j][i];\n }\n an[r][i] = sumOfColumn;\n }\n \n \n // ????????????\n for (int[] r_temp : an) {\n int i = 0;\n for (int c_temp : r_temp) {\n System.out.print(c_temp );\n if (i <c) {\n System.out.print(SPACE);\n }\n i++;\n }\n System.out.println();\n }\n\n stdReader.close();\n } catch (Exception e) {\n System.exit(-1);\n }\n \n }",
"main",
"{\n try {\n LineNumberReader stdReader = new LineNumberReader(\n new InputStreamReader(System.in));\n \n String sStr;\n int r = 0;\n int c = 0;\n int an[] []= null;\n\n while ((sStr = stdReader.readLine()) != null) {\n // ??\\???????????°\n if (stdReader.getLineNumber() == 1) {\n String[] inputs = sStr.split(SPACE);\n r = Integer.valueOf(inputs[0]);\n c = Integer.valueOf(inputs[1]);\n \n // r??? x c?????????????¢????\n // ??????????´???¨????´?????¢????.\n an = new int[r+1][c+1];\n }\n\n // ???????????????\n // 0, 1, 2, 3, .... x 0, 1, 2, 3, ... (0??????????????°??????)\n if (stdReader.getLineNumber() >= 2){\n String[] matrix_row = sStr.split(SPACE);\n int i = 0;\n int row = stdReader.getLineNumber() - 2;\n for (String temp : matrix_row) {\n an[row][i] = Integer.valueOf(temp);\n i++;\n }\n \n if (stdReader.getLineNumber() == r+1) break;\n }\n\n }\n\n\n // ??¢????????????????¨????\n for (int i = 0; i<r; i++){\n int sumOfRow = 0;\n for (int j = 0; j<c; j++){\n sumOfRow += an[i][j];\n }\n an[i][c] = sumOfRow;\n }\n\n for (int i = 0; i<=c; i++){\n int sumOfColumn = 0;\n for (int j = 0; j<r; j++){\n sumOfColumn += an[j][i];\n }\n an[r][i] = sumOfColumn;\n }\n \n \n // ????????????\n for (int[] r_temp : an) {\n int i = 0;\n for (int c_temp : r_temp) {\n System.out.print(c_temp );\n if (i <c) {\n System.out.print(SPACE);\n }\n i++;\n }\n System.out.println();\n }\n\n stdReader.close();\n } catch (Exception e) {\n System.exit(-1);\n }\n \n }",
"try {\n LineNumberReader stdReader = new LineNumberReader(\n new InputStreamReader(System.in));\n \n String sStr;\n int r = 0;\n int c = 0;\n int an[] []= null;\n\n while ((sStr = stdReader.readLine()) != null) {\n // ??\\???????????°\n if (stdReader.getLineNumber() == 1) {\n String[] inputs = sStr.split(SPACE);\n r = Integer.valueOf(inputs[0]);\n c = Integer.valueOf(inputs[1]);\n \n // r??? x c?????????????¢????\n // ??????????´???¨????´?????¢????.\n an = new int[r+1][c+1];\n }\n\n // ???????????????\n // 0, 1, 2, 3, .... x 0, 1, 2, 3, ... (0??????????????°??????)\n if (stdReader.getLineNumber() >= 2){\n String[] matrix_row = sStr.split(SPACE);\n int i = 0;\n int row = stdReader.getLineNumber() - 2;\n for (String temp : matrix_row) {\n an[row][i] = Integer.valueOf(temp);\n i++;\n }\n \n if (stdReader.getLineNumber() == r+1) break;\n }\n\n }\n\n\n // ??¢????????????????¨????\n for (int i = 0; i<r; i++){\n int sumOfRow = 0;\n for (int j = 0; j<c; j++){\n sumOfRow += an[i][j];\n }\n an[i][c] = sumOfRow;\n }\n\n for (int i = 0; i<=c; i++){\n int sumOfColumn = 0;\n for (int j = 0; j<r; j++){\n sumOfColumn += an[j][i];\n }\n an[r][i] = sumOfColumn;\n }\n \n \n // ????????????\n for (int[] r_temp : an) {\n int i = 0;\n for (int c_temp : r_temp) {\n System.out.print(c_temp );\n if (i <c) {\n System.out.print(SPACE);\n }\n i++;\n }\n System.out.println();\n }\n\n stdReader.close();\n } catch (Exception e) {\n System.exit(-1);\n }",
"catch (Exception e) {\n System.exit(-1);\n }",
"Exception e",
"{\n System.exit(-1);\n }",
"System.exit(-1)",
"System.exit",
"System",
"-1",
"1",
"{\n LineNumberReader stdReader = new LineNumberReader(\n new InputStreamReader(System.in));\n \n String sStr;\n int r = 0;\n int c = 0;\n int an[] []= null;\n\n while ((sStr = stdReader.readLine()) != null) {\n // ??\\???????????°\n if (stdReader.getLineNumber() == 1) {\n String[] inputs = sStr.split(SPACE);\n r = Integer.valueOf(inputs[0]);\n c = Integer.valueOf(inputs[1]);\n \n // r??? x c?????????????¢????\n // ??????????´???¨????´?????¢????.\n an = new int[r+1][c+1];\n }\n\n // ???????????????\n // 0, 1, 2, 3, .... x 0, 1, 2, 3, ... (0??????????????°??????)\n if (stdReader.getLineNumber() >= 2){\n String[] matrix_row = sStr.split(SPACE);\n int i = 0;\n int row = stdReader.getLineNumber() - 2;\n for (String temp : matrix_row) {\n an[row][i] = Integer.valueOf(temp);\n i++;\n }\n \n if (stdReader.getLineNumber() == r+1) break;\n }\n\n }\n\n\n // ??¢????????????????¨????\n for (int i = 0; i<r; i++){\n int sumOfRow = 0;\n for (int j = 0; j<c; j++){\n sumOfRow += an[i][j];\n }\n an[i][c] = sumOfRow;\n }\n\n for (int i = 0; i<=c; i++){\n int sumOfColumn = 0;\n for (int j = 0; j<r; j++){\n sumOfColumn += an[j][i];\n }\n an[r][i] = sumOfColumn;\n }\n \n \n // ????????????\n for (int[] r_temp : an) {\n int i = 0;\n for (int c_temp : r_temp) {\n System.out.print(c_temp );\n if (i <c) {\n System.out.print(SPACE);\n }\n i++;\n }\n System.out.println();\n }\n\n stdReader.close();\n }",
"LineNumberReader stdReader = new LineNumberReader(\n new InputStreamReader(System.in));",
"stdReader",
"new LineNumberReader(\n new InputStreamReader(System.in))",
"String sStr;",
"sStr",
"int r = 0;",
"r",
"0",
"int c = 0;",
"c",
"0",
"int an[] []= null;",
"an",
"null",
"while ((sStr = stdReader.readLine()) != null) {\n // ??\\???????????°\n if (stdReader.getLineNumber() == 1) {\n String[] inputs = sStr.split(SPACE);\n r = Integer.valueOf(inputs[0]);\n c = Integer.valueOf(inputs[1]);\n \n // r??? x c?????????????¢????\n // ??????????´???¨????´?????¢????.\n an = new int[r+1][c+1];\n }\n\n // ???????????????\n // 0, 1, 2, 3, .... x 0, 1, 2, 3, ... (0??????????????°??????)\n if (stdReader.getLineNumber() >= 2){\n String[] matrix_row = sStr.split(SPACE);\n int i = 0;\n int row = stdReader.getLineNumber() - 2;\n for (String temp : matrix_row) {\n an[row][i] = Integer.valueOf(temp);\n i++;\n }\n \n if (stdReader.getLineNumber() == r+1) break;\n }\n\n }",
"(sStr = stdReader.readLine()) != null",
"(sStr = stdReader.readLine())",
"sStr",
"stdReader.readLine()",
"stdReader.readLine",
"stdReader",
"null",
"{\n // ??\\???????????°\n if (stdReader.getLineNumber() == 1) {\n String[] inputs = sStr.split(SPACE);\n r = Integer.valueOf(inputs[0]);\n c = Integer.valueOf(inputs[1]);\n \n // r??? x c?????????????¢????\n // ??????????´???¨????´?????¢????.\n an = new int[r+1][c+1];\n }\n\n // ???????????????\n // 0, 1, 2, 3, .... x 0, 1, 2, 3, ... (0??????????????°??????)\n if (stdReader.getLineNumber() >= 2){\n String[] matrix_row = sStr.split(SPACE);\n int i = 0;\n int row = stdReader.getLineNumber() - 2;\n for (String temp : matrix_row) {\n an[row][i] = Integer.valueOf(temp);\n i++;\n }\n \n if (stdReader.getLineNumber() == r+1) break;\n }\n\n }",
"if (stdReader.getLineNumber() == 1) {\n String[] inputs = sStr.split(SPACE);\n r = Integer.valueOf(inputs[0]);\n c = Integer.valueOf(inputs[1]);\n \n // r??? x c?????????????¢????\n // ??????????´???¨????´?????¢????.\n an = new int[r+1][c+1];\n }",
"stdReader.getLineNumber() == 1",
"stdReader.getLineNumber()",
"stdReader.getLineNumber",
"stdReader",
"1",
"{\n String[] inputs = sStr.split(SPACE);\n r = Integer.valueOf(inputs[0]);\n c = Integer.valueOf(inputs[1]);\n \n // r??? x c?????????????¢????\n // ??????????´???¨????´?????¢????.\n an = new int[r+1][c+1];\n }",
"String[] inputs = sStr.split(SPACE);",
"inputs",
"sStr.split(SPACE)",
"sStr.split",
"sStr",
"SPACE",
"r = Integer.valueOf(inputs[0])",
"r",
"Integer.valueOf(inputs[0])",
"Integer.valueOf",
"Integer",
"inputs[0]",
"inputs",
"0",
"c = Integer.valueOf(inputs[1])",
"c",
"Integer.valueOf(inputs[1])",
"Integer.valueOf",
"Integer",
"inputs[1]",
"inputs",
"1",
"an = new int[r+1][c+1]",
"an",
"new int[r+1][c+1]",
"r+1",
"r",
"1",
"c+1",
"c",
"1",
"if (stdReader.getLineNumber() >= 2){\n String[] matrix_row = sStr.split(SPACE);\n int i = 0;\n int row = stdReader.getLineNumber() - 2;\n for (String temp : matrix_row) {\n an[row][i] = Integer.valueOf(temp);\n i++;\n }\n \n if (stdReader.getLineNumber() == r+1) break;\n }",
"stdReader.getLineNumber() >= 2",
"stdReader.getLineNumber()",
"stdReader.getLineNumber",
"stdReader",
"2",
"{\n String[] matrix_row = sStr.split(SPACE);\n int i = 0;\n int row = stdReader.getLineNumber() - 2;\n for (String temp : matrix_row) {\n an[row][i] = Integer.valueOf(temp);\n i++;\n }\n \n if (stdReader.getLineNumber() == r+1) break;\n }",
"String[] matrix_row = sStr.split(SPACE);",
"matrix_row",
"sStr.split(SPACE)",
"sStr.split",
"sStr",
"SPACE",
"int i = 0;",
"i",
"0",
"int row = stdReader.getLineNumber() - 2;",
"row",
"stdReader.getLineNumber() - 2",
"stdReader.getLineNumber()",
"stdReader.getLineNumber",
"stdReader",
"2",
"for (String temp : matrix_row) {\n an[row][i] = Integer.valueOf(temp);\n i++;\n }",
"String temp",
"matrix_row",
"{\n an[row][i] = Integer.valueOf(temp);\n i++;\n }",
"{\n an[row][i] = Integer.valueOf(temp);\n i++;\n }",
"an[row][i] = Integer.valueOf(temp)",
"an[row][i]",
"an[row]",
"an",
"row",
"i",
"Integer.valueOf(temp)",
"Integer.valueOf",
"Integer",
"temp",
"i++",
"i",
"if (stdReader.getLineNumber() == r+1) break;",
"stdReader.getLineNumber() == r+1",
"stdReader.getLineNumber()",
"stdReader.getLineNumber",
"stdReader",
"r+1",
"r",
"1",
"break;",
"for (int i = 0; i<r; i++){\n int sumOfRow = 0;\n for (int j = 0; j<c; j++){\n sumOfRow += an[i][j];\n }\n an[i][c] = sumOfRow;\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i<r",
"i",
"r",
"i++",
"i++",
"i",
"{\n int sumOfRow = 0;\n for (int j = 0; j<c; j++){\n sumOfRow += an[i][j];\n }\n an[i][c] = sumOfRow;\n }",
"{\n int sumOfRow = 0;\n for (int j = 0; j<c; j++){\n sumOfRow += an[i][j];\n }\n an[i][c] = sumOfRow;\n }",
"int sumOfRow = 0;",
"sumOfRow",
"0",
"for (int j = 0; j<c; j++){\n sumOfRow += an[i][j];\n }",
"int j = 0;",
"int j = 0;",
"j",
"0",
"j<c",
"j",
"c",
"j++",
"j++",
"j",
"{\n sumOfRow += an[i][j];\n }",
"{\n sumOfRow += an[i][j];\n }",
"sumOfRow += an[i][j]",
"sumOfRow",
"an[i][j]",
"an[i]",
"an",
"i",
"j",
"an[i][c] = sumOfRow",
"an[i][c]",
"an[i]",
"an",
"i",
"c",
"sumOfRow",
"for (int i = 0; i<=c; i++){\n int sumOfColumn = 0;\n for (int j = 0; j<r; j++){\n sumOfColumn += an[j][i];\n }\n an[r][i] = sumOfColumn;\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i<=c",
"i",
"c",
"i++",
"i++",
"i",
"{\n int sumOfColumn = 0;\n for (int j = 0; j<r; j++){\n sumOfColumn += an[j][i];\n }\n an[r][i] = sumOfColumn;\n }",
"{\n int sumOfColumn = 0;\n for (int j = 0; j<r; j++){\n sumOfColumn += an[j][i];\n }\n an[r][i] = sumOfColumn;\n }",
"int sumOfColumn = 0;",
"sumOfColumn",
"0",
"for (int j = 0; j<r; j++){\n sumOfColumn += an[j][i];\n }",
"int j = 0;",
"int j = 0;",
"j",
"0",
"j<r",
"j",
"r",
"j++",
"j++",
"j",
"{\n sumOfColumn += an[j][i];\n }",
"{\n sumOfColumn += an[j][i];\n }",
"sumOfColumn += an[j][i]",
"sumOfColumn",
"an[j][i]",
"an[j]",
"an",
"j",
"i",
"an[r][i] = sumOfColumn",
"an[r][i]",
"an[r]",
"an",
"r",
"i",
"sumOfColumn",
"for (int[] r_temp : an) {\n int i = 0;\n for (int c_temp : r_temp) {\n System.out.print(c_temp );\n if (i <c) {\n System.out.print(SPACE);\n }\n i++;\n }\n System.out.println();\n }",
"int[] r_temp",
"an",
"{\n int i = 0;\n for (int c_temp : r_temp) {\n System.out.print(c_temp );\n if (i <c) {\n System.out.print(SPACE);\n }\n i++;\n }\n System.out.println();\n }",
"{\n int i = 0;\n for (int c_temp : r_temp) {\n System.out.print(c_temp );\n if (i <c) {\n System.out.print(SPACE);\n }\n i++;\n }\n System.out.println();\n }",
"int i = 0;",
"i",
"0",
"for (int c_temp : r_temp) {\n System.out.print(c_temp );\n if (i <c) {\n System.out.print(SPACE);\n }\n i++;\n }",
"int c_temp",
"r_temp",
"{\n System.out.print(c_temp );\n if (i <c) {\n System.out.print(SPACE);\n }\n i++;\n }",
"{\n System.out.print(c_temp );\n if (i <c) {\n System.out.print(SPACE);\n }\n i++;\n }",
"System.out.print(c_temp )",
"System.out.print",
"System.out",
"System",
"System.out",
"c_temp",
"if (i <c) {\n System.out.print(SPACE);\n }",
"i <c",
"i",
"c",
"{\n System.out.print(SPACE);\n }",
"System.out.print(SPACE)",
"System.out.print",
"System.out",
"System",
"System.out",
"SPACE",
"i++",
"i",
"System.out.println()",
"System.out.println",
"System.out",
"System",
"System.out",
"stdReader.close()",
"stdReader.close",
"stdReader",
"String[] args",
"args",
"public class Main {\n private final static String SPACE = \" \";\n public static void main(String[] args) {\n try {\n LineNumberReader stdReader = new LineNumberReader(\n new InputStreamReader(System.in));\n \n String sStr;\n int r = 0;\n int c = 0;\n int an[] []= null;\n\n while ((sStr = stdReader.readLine()) != null) {\n // ??\\???????????°\n if (stdReader.getLineNumber() == 1) {\n String[] inputs = sStr.split(SPACE);\n r = Integer.valueOf(inputs[0]);\n c = Integer.valueOf(inputs[1]);\n \n // r??? x c?????????????¢????\n // ??????????´???¨????´?????¢????.\n an = new int[r+1][c+1];\n }\n\n // ???????????????\n // 0, 1, 2, 3, .... x 0, 1, 2, 3, ... (0??????????????°??????)\n if (stdReader.getLineNumber() >= 2){\n String[] matrix_row = sStr.split(SPACE);\n int i = 0;\n int row = stdReader.getLineNumber() - 2;\n for (String temp : matrix_row) {\n an[row][i] = Integer.valueOf(temp);\n i++;\n }\n \n if (stdReader.getLineNumber() == r+1) break;\n }\n\n }\n\n\n // ??¢????????????????¨????\n for (int i = 0; i<r; i++){\n int sumOfRow = 0;\n for (int j = 0; j<c; j++){\n sumOfRow += an[i][j];\n }\n an[i][c] = sumOfRow;\n }\n\n for (int i = 0; i<=c; i++){\n int sumOfColumn = 0;\n for (int j = 0; j<r; j++){\n sumOfColumn += an[j][i];\n }\n an[r][i] = sumOfColumn;\n }\n \n \n // ????????????\n for (int[] r_temp : an) {\n int i = 0;\n for (int c_temp : r_temp) {\n System.out.print(c_temp );\n if (i <c) {\n System.out.print(SPACE);\n }\n i++;\n }\n System.out.println();\n }\n\n stdReader.close();\n } catch (Exception e) {\n System.exit(-1);\n }\n \n }\n}",
"public class Main {\n private final static String SPACE = \" \";\n public static void main(String[] args) {\n try {\n LineNumberReader stdReader = new LineNumberReader(\n new InputStreamReader(System.in));\n \n String sStr;\n int r = 0;\n int c = 0;\n int an[] []= null;\n\n while ((sStr = stdReader.readLine()) != null) {\n // ??\\???????????°\n if (stdReader.getLineNumber() == 1) {\n String[] inputs = sStr.split(SPACE);\n r = Integer.valueOf(inputs[0]);\n c = Integer.valueOf(inputs[1]);\n \n // r??? x c?????????????¢????\n // ??????????´???¨????´?????¢????.\n an = new int[r+1][c+1];\n }\n\n // ???????????????\n // 0, 1, 2, 3, .... x 0, 1, 2, 3, ... (0??????????????°??????)\n if (stdReader.getLineNumber() >= 2){\n String[] matrix_row = sStr.split(SPACE);\n int i = 0;\n int row = stdReader.getLineNumber() - 2;\n for (String temp : matrix_row) {\n an[row][i] = Integer.valueOf(temp);\n i++;\n }\n \n if (stdReader.getLineNumber() == r+1) break;\n }\n\n }\n\n\n // ??¢????????????????¨????\n for (int i = 0; i<r; i++){\n int sumOfRow = 0;\n for (int j = 0; j<c; j++){\n sumOfRow += an[i][j];\n }\n an[i][c] = sumOfRow;\n }\n\n for (int i = 0; i<=c; i++){\n int sumOfColumn = 0;\n for (int j = 0; j<r; j++){\n sumOfColumn += an[j][i];\n }\n an[r][i] = sumOfColumn;\n }\n \n \n // ????????????\n for (int[] r_temp : an) {\n int i = 0;\n for (int c_temp : r_temp) {\n System.out.print(c_temp );\n if (i <c) {\n System.out.print(SPACE);\n }\n i++;\n }\n System.out.println();\n }\n\n stdReader.close();\n } catch (Exception e) {\n System.exit(-1);\n }\n \n }\n}",
"Main"
] | import java.io.InputStreamReader;
import java.io.LineNumberReader;
/**
* http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=ITP1_7_C
*
* @author eitatsuro
*
*/
public class Main {
private final static String SPACE = " ";
public static void main(String[] args) {
try {
LineNumberReader stdReader = new LineNumberReader(
new InputStreamReader(System.in));
String sStr;
int r = 0;
int c = 0;
int an[] []= null;
while ((sStr = stdReader.readLine()) != null) {
// ??\???????????°
if (stdReader.getLineNumber() == 1) {
String[] inputs = sStr.split(SPACE);
r = Integer.valueOf(inputs[0]);
c = Integer.valueOf(inputs[1]);
// r??? x c?????????????¢????
// ??????????´???¨????´?????¢????.
an = new int[r+1][c+1];
}
// ???????????????
// 0, 1, 2, 3, .... x 0, 1, 2, 3, ... (0??????????????°??????)
if (stdReader.getLineNumber() >= 2){
String[] matrix_row = sStr.split(SPACE);
int i = 0;
int row = stdReader.getLineNumber() - 2;
for (String temp : matrix_row) {
an[row][i] = Integer.valueOf(temp);
i++;
}
if (stdReader.getLineNumber() == r+1) break;
}
}
// ??¢????????????????¨????
for (int i = 0; i<r; i++){
int sumOfRow = 0;
for (int j = 0; j<c; j++){
sumOfRow += an[i][j];
}
an[i][c] = sumOfRow;
}
for (int i = 0; i<=c; i++){
int sumOfColumn = 0;
for (int j = 0; j<r; j++){
sumOfColumn += an[j][i];
}
an[r][i] = sumOfColumn;
}
// ????????????
for (int[] r_temp : an) {
int i = 0;
for (int c_temp : r_temp) {
System.out.print(c_temp );
if (i <c) {
System.out.print(SPACE);
}
i++;
}
System.out.println();
}
stdReader.close();
} catch (Exception e) {
System.exit(-1);
}
}
} |
[
7,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
4,
18,
13,
17,
41,
13,
4,
18,
13,
18,
13,
17,
41,
13,
4,
18,
13,
18,
13,
17,
41,
13,
20,
2,
13,
17,
2,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
4,
18,
4,
18,
13,
17,
11,
1,
41,
13,
17,
2,
13,
18,
13,
13,
1,
40,
13,
30,
30,
0,
18,
18,
13,
13,
13,
4,
18,
13,
18,
13,
13,
0,
18,
18,
13,
13,
13,
18,
18,
13,
13,
13,
0,
18,
18,
13,
13,
13,
18,
18,
13,
13,
13,
14,
2,
13,
2,
18,
13,
13,
17,
30,
0,
18,
18,
13,
13,
13,
18,
18,
13,
13,
13,
11,
1,
41,
13,
17,
2,
13,
2,
13,
17,
1,
40,
13,
30,
30,
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,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
197,
8
],
[
197,
9
],
[
9,
10
],
[
9,
11
],
[
11,
12
],
[
12,
13
],
[
12,
14
],
[
11,
15
],
[
15,
16
],
[
15,
17
],
[
17,
18
],
[
18,
19
],
[
19,
20
],
[
20,
21
],
[
17,
22
],
[
11,
23
],
[
23,
24
],
[
23,
25
],
[
25,
26
],
[
26,
27
],
[
25,
28
],
[
28,
29
],
[
28,
30
],
[
11,
31
],
[
31,
32
],
[
31,
33
],
[
33,
34
],
[
34,
35
],
[
33,
36
],
[
36,
37
],
[
36,
38
],
[
11,
39
],
[
39,
40
],
[
39,
41
],
[
42,
43
],
[
42,
44
],
[
45,
46
],
[
45,
47
],
[
11,
48
],
[
48,
49
],
[
49,
50
],
[
50,
51
],
[
50,
52
],
[
48,
53
],
[
53,
54
],
[
53,
55
],
[
48,
56
],
[
56,
57
],
[
57,
58
],
[
48,
59
],
[
60,
60
],
[
60,
61
],
[
61,
62
],
[
61,
63
],
[
63,
64
],
[
64,
65
],
[
65,
66
],
[
66,
67
],
[
63,
68
],
[
60,
69
],
[
69,
70
],
[
70,
71
],
[
71,
72
],
[
71,
73
],
[
69,
74
],
[
74,
75
],
[
74,
76
],
[
76,
77
],
[
76,
78
],
[
69,
79
],
[
79,
80
],
[
80,
81
],
[
69,
82
],
[
83,
83
],
[
83,
84
],
[
84,
85
],
[
85,
86
],
[
86,
87
],
[
86,
88
],
[
85,
89
],
[
84,
90
],
[
90,
91
],
[
91,
92
],
[
90,
93
],
[
93,
94
],
[
93,
95
],
[
83,
96
],
[
96,
97
],
[
97,
98
],
[
98,
99
],
[
98,
100
],
[
97,
101
],
[
96,
102
],
[
102,
103
],
[
103,
104
],
[
103,
105
],
[
102,
106
],
[
83,
107
],
[
107,
108
],
[
108,
109
],
[
109,
110
],
[
109,
111
],
[
108,
112
],
[
107,
113
],
[
113,
114
],
[
114,
115
],
[
114,
116
],
[
113,
117
],
[
83,
118
],
[
118,
119
],
[
119,
120
],
[
119,
121
],
[
121,
122
],
[
122,
123
],
[
122,
124
],
[
121,
125
],
[
118,
126
],
[
126,
127
],
[
127,
128
],
[
128,
129
],
[
129,
130
],
[
129,
131
],
[
128,
132
],
[
127,
133
],
[
133,
134
],
[
134,
135
],
[
134,
136
],
[
133,
137
],
[
11,
138
],
[
138,
139
],
[
139,
140
],
[
140,
141
],
[
140,
142
],
[
138,
143
],
[
143,
144
],
[
143,
145
],
[
145,
146
],
[
145,
147
],
[
138,
148
],
[
148,
149
],
[
149,
150
],
[
138,
151
],
[
152,
152
],
[
152,
153
],
[
153,
154
],
[
154,
155
],
[
155,
156
],
[
155,
157
],
[
153,
158
],
[
158,
159
],
[
158,
160
],
[
160,
161
],
[
160,
162
],
[
153,
163
],
[
163,
164
],
[
164,
165
],
[
153,
166
],
[
167,
167
],
[
167,
168
],
[
168,
169
],
[
169,
170
],
[
170,
171
],
[
170,
172
],
[
168,
173
],
[
173,
174
],
[
174,
175
],
[
174,
176
],
[
173,
177
],
[
167,
178
],
[
178,
179
],
[
179,
180
],
[
179,
181
],
[
178,
182
],
[
182,
183
],
[
183,
184
],
[
184,
185
],
[
184,
186
],
[
182,
187
],
[
152,
188
],
[
188,
189
],
[
189,
190
],
[
190,
191
],
[
190,
192
],
[
188,
193
],
[
9,
194
],
[
194,
195
],
[
0,
196
],
[
196,
197
],
[
196,
198
]
] | [
"import java.io.BufferedReader;\nimport java.io.InputStreamReader;\n\npublic class Main {\n\tpublic static void main(String[] args) throws Exception {\n\t BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\n\t String[] line = br.readLine().split(\" \");\n\n\t int r = Integer.parseInt(line[0]);\n\t int c = Integer.parseInt(line[1]);\n\n\t int[][] matrix = new int[r + 1][c + 1];\n\n\t for (int i = 0; i < r; i++) {\n\t \tline = br.readLine().split(\" \");\n\n\t \tfor (int j = 0; j < line.length; j++) {\n\t\t \tmatrix[i][j] = Integer.parseInt(line[j]);\n\n\t\t \t// row sum\n\t\t \tmatrix[i][c] += matrix[i][j];\n\t\t \t// col sum\n\t\t \tmatrix[r][j] += matrix[i][j];\n\n\t\t \tif (j == line.length - 1) {\n\t\t\t \t// all sum\n\t\t\t \tmatrix[r][c] += matrix[i][c];\n\t\t \t}\n\t \t}\n\t }\n\n\t for (int i = 0; i < r + 1; i++) {\n\t \tfor (int j = 0; j < c + 1; j++) {\n\t \t\tSystem.out.print(matrix[i][j]);\n\t \t\tif (j < c) System.out.print(\" \");\n\t \t}\n\t \tSystem.out.println(\"\");\n\t }\n\t}\n}",
"import java.io.BufferedReader;",
"BufferedReader",
"java.io",
"import java.io.InputStreamReader;",
"InputStreamReader",
"java.io",
"public class Main {\n\tpublic static void main(String[] args) throws Exception {\n\t BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\n\t String[] line = br.readLine().split(\" \");\n\n\t int r = Integer.parseInt(line[0]);\n\t int c = Integer.parseInt(line[1]);\n\n\t int[][] matrix = new int[r + 1][c + 1];\n\n\t for (int i = 0; i < r; i++) {\n\t \tline = br.readLine().split(\" \");\n\n\t \tfor (int j = 0; j < line.length; j++) {\n\t\t \tmatrix[i][j] = Integer.parseInt(line[j]);\n\n\t\t \t// row sum\n\t\t \tmatrix[i][c] += matrix[i][j];\n\t\t \t// col sum\n\t\t \tmatrix[r][j] += matrix[i][j];\n\n\t\t \tif (j == line.length - 1) {\n\t\t\t \t// all sum\n\t\t\t \tmatrix[r][c] += matrix[i][c];\n\t\t \t}\n\t \t}\n\t }\n\n\t for (int i = 0; i < r + 1; i++) {\n\t \tfor (int j = 0; j < c + 1; j++) {\n\t \t\tSystem.out.print(matrix[i][j]);\n\t \t\tif (j < c) System.out.print(\" \");\n\t \t}\n\t \tSystem.out.println(\"\");\n\t }\n\t}\n}",
"Main",
"public static void main(String[] args) throws Exception {\n\t BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\n\t String[] line = br.readLine().split(\" \");\n\n\t int r = Integer.parseInt(line[0]);\n\t int c = Integer.parseInt(line[1]);\n\n\t int[][] matrix = new int[r + 1][c + 1];\n\n\t for (int i = 0; i < r; i++) {\n\t \tline = br.readLine().split(\" \");\n\n\t \tfor (int j = 0; j < line.length; j++) {\n\t\t \tmatrix[i][j] = Integer.parseInt(line[j]);\n\n\t\t \t// row sum\n\t\t \tmatrix[i][c] += matrix[i][j];\n\t\t \t// col sum\n\t\t \tmatrix[r][j] += matrix[i][j];\n\n\t\t \tif (j == line.length - 1) {\n\t\t\t \t// all sum\n\t\t\t \tmatrix[r][c] += matrix[i][c];\n\t\t \t}\n\t \t}\n\t }\n\n\t for (int i = 0; i < r + 1; i++) {\n\t \tfor (int j = 0; j < c + 1; j++) {\n\t \t\tSystem.out.print(matrix[i][j]);\n\t \t\tif (j < c) System.out.print(\" \");\n\t \t}\n\t \tSystem.out.println(\"\");\n\t }\n\t}",
"main",
"{\n\t BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\n\t String[] line = br.readLine().split(\" \");\n\n\t int r = Integer.parseInt(line[0]);\n\t int c = Integer.parseInt(line[1]);\n\n\t int[][] matrix = new int[r + 1][c + 1];\n\n\t for (int i = 0; i < r; i++) {\n\t \tline = br.readLine().split(\" \");\n\n\t \tfor (int j = 0; j < line.length; j++) {\n\t\t \tmatrix[i][j] = Integer.parseInt(line[j]);\n\n\t\t \t// row sum\n\t\t \tmatrix[i][c] += matrix[i][j];\n\t\t \t// col sum\n\t\t \tmatrix[r][j] += matrix[i][j];\n\n\t\t \tif (j == line.length - 1) {\n\t\t\t \t// all sum\n\t\t\t \tmatrix[r][c] += matrix[i][c];\n\t\t \t}\n\t \t}\n\t }\n\n\t for (int i = 0; i < r + 1; i++) {\n\t \tfor (int j = 0; j < c + 1; j++) {\n\t \t\tSystem.out.print(matrix[i][j]);\n\t \t\tif (j < c) System.out.print(\" \");\n\t \t}\n\t \tSystem.out.println(\"\");\n\t }\n\t}",
"BufferedReader br = new BufferedReader(new InputStreamReader(System.in));",
"br",
"new BufferedReader(new InputStreamReader(System.in))",
"String[] line = br.readLine().split(\" \");",
"line",
"br.readLine().split(\" \")",
"br.readLine().split",
"br.readLine()",
"br.readLine",
"br",
"\" \"",
"int r = Integer.parseInt(line[0]);",
"r",
"Integer.parseInt(line[0])",
"Integer.parseInt",
"Integer",
"line[0]",
"line",
"0",
"int c = Integer.parseInt(line[1]);",
"c",
"Integer.parseInt(line[1])",
"Integer.parseInt",
"Integer",
"line[1]",
"line",
"1",
"int[][] matrix = new int[r + 1][c + 1];",
"matrix",
"new int[r + 1][c + 1]",
"r + 1",
"r",
"1",
"c + 1",
"c",
"1",
"for (int i = 0; i < r; i++) {\n\t \tline = br.readLine().split(\" \");\n\n\t \tfor (int j = 0; j < line.length; j++) {\n\t\t \tmatrix[i][j] = Integer.parseInt(line[j]);\n\n\t\t \t// row sum\n\t\t \tmatrix[i][c] += matrix[i][j];\n\t\t \t// col sum\n\t\t \tmatrix[r][j] += matrix[i][j];\n\n\t\t \tif (j == line.length - 1) {\n\t\t\t \t// all sum\n\t\t\t \tmatrix[r][c] += matrix[i][c];\n\t\t \t}\n\t \t}\n\t }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < r",
"i",
"r",
"i++",
"i++",
"i",
"{\n\t \tline = br.readLine().split(\" \");\n\n\t \tfor (int j = 0; j < line.length; j++) {\n\t\t \tmatrix[i][j] = Integer.parseInt(line[j]);\n\n\t\t \t// row sum\n\t\t \tmatrix[i][c] += matrix[i][j];\n\t\t \t// col sum\n\t\t \tmatrix[r][j] += matrix[i][j];\n\n\t\t \tif (j == line.length - 1) {\n\t\t\t \t// all sum\n\t\t\t \tmatrix[r][c] += matrix[i][c];\n\t\t \t}\n\t \t}\n\t }",
"{\n\t \tline = br.readLine().split(\" \");\n\n\t \tfor (int j = 0; j < line.length; j++) {\n\t\t \tmatrix[i][j] = Integer.parseInt(line[j]);\n\n\t\t \t// row sum\n\t\t \tmatrix[i][c] += matrix[i][j];\n\t\t \t// col sum\n\t\t \tmatrix[r][j] += matrix[i][j];\n\n\t\t \tif (j == line.length - 1) {\n\t\t\t \t// all sum\n\t\t\t \tmatrix[r][c] += matrix[i][c];\n\t\t \t}\n\t \t}\n\t }",
"line = br.readLine().split(\" \")",
"line",
"br.readLine().split(\" \")",
"br.readLine().split",
"br.readLine()",
"br.readLine",
"br",
"\" \"",
"for (int j = 0; j < line.length; j++) {\n\t\t \tmatrix[i][j] = Integer.parseInt(line[j]);\n\n\t\t \t// row sum\n\t\t \tmatrix[i][c] += matrix[i][j];\n\t\t \t// col sum\n\t\t \tmatrix[r][j] += matrix[i][j];\n\n\t\t \tif (j == line.length - 1) {\n\t\t\t \t// all sum\n\t\t\t \tmatrix[r][c] += matrix[i][c];\n\t\t \t}\n\t \t}",
"int j = 0;",
"int j = 0;",
"j",
"0",
"j < line.length",
"j",
"line.length",
"line",
"line.length",
"j++",
"j++",
"j",
"{\n\t\t \tmatrix[i][j] = Integer.parseInt(line[j]);\n\n\t\t \t// row sum\n\t\t \tmatrix[i][c] += matrix[i][j];\n\t\t \t// col sum\n\t\t \tmatrix[r][j] += matrix[i][j];\n\n\t\t \tif (j == line.length - 1) {\n\t\t\t \t// all sum\n\t\t\t \tmatrix[r][c] += matrix[i][c];\n\t\t \t}\n\t \t}",
"{\n\t\t \tmatrix[i][j] = Integer.parseInt(line[j]);\n\n\t\t \t// row sum\n\t\t \tmatrix[i][c] += matrix[i][j];\n\t\t \t// col sum\n\t\t \tmatrix[r][j] += matrix[i][j];\n\n\t\t \tif (j == line.length - 1) {\n\t\t\t \t// all sum\n\t\t\t \tmatrix[r][c] += matrix[i][c];\n\t\t \t}\n\t \t}",
"matrix[i][j] = Integer.parseInt(line[j])",
"matrix[i][j]",
"matrix[i]",
"matrix",
"i",
"j",
"Integer.parseInt(line[j])",
"Integer.parseInt",
"Integer",
"line[j]",
"line",
"j",
"matrix[i][c] += matrix[i][j]",
"matrix[i][c]",
"matrix[i]",
"matrix",
"i",
"c",
"matrix[i][j]",
"matrix[i]",
"matrix",
"i",
"j",
"matrix[r][j] += matrix[i][j]",
"matrix[r][j]",
"matrix[r]",
"matrix",
"r",
"j",
"matrix[i][j]",
"matrix[i]",
"matrix",
"i",
"j",
"if (j == line.length - 1) {\n\t\t\t \t// all sum\n\t\t\t \tmatrix[r][c] += matrix[i][c];\n\t\t \t}",
"j == line.length - 1",
"j",
"line.length - 1",
"line.length",
"line",
"line.length",
"1",
"{\n\t\t\t \t// all sum\n\t\t\t \tmatrix[r][c] += matrix[i][c];\n\t\t \t}",
"matrix[r][c] += matrix[i][c]",
"matrix[r][c]",
"matrix[r]",
"matrix",
"r",
"c",
"matrix[i][c]",
"matrix[i]",
"matrix",
"i",
"c",
"for (int i = 0; i < r + 1; i++) {\n\t \tfor (int j = 0; j < c + 1; j++) {\n\t \t\tSystem.out.print(matrix[i][j]);\n\t \t\tif (j < c) System.out.print(\" \");\n\t \t}\n\t \tSystem.out.println(\"\");\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 + 1; j++) {\n\t \t\tSystem.out.print(matrix[i][j]);\n\t \t\tif (j < c) System.out.print(\" \");\n\t \t}\n\t \tSystem.out.println(\"\");\n\t }",
"{\n\t \tfor (int j = 0; j < c + 1; j++) {\n\t \t\tSystem.out.print(matrix[i][j]);\n\t \t\tif (j < c) System.out.print(\" \");\n\t \t}\n\t \tSystem.out.println(\"\");\n\t }",
"for (int j = 0; j < c + 1; j++) {\n\t \t\tSystem.out.print(matrix[i][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\tSystem.out.print(matrix[i][j]);\n\t \t\tif (j < c) System.out.print(\" \");\n\t \t}",
"{\n\t \t\tSystem.out.print(matrix[i][j]);\n\t \t\tif (j < c) System.out.print(\" \");\n\t \t}",
"System.out.print(matrix[i][j])",
"System.out.print",
"System.out",
"System",
"System.out",
"matrix[i][j]",
"matrix[i]",
"matrix",
"i",
"j",
"if (j < 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\tpublic static void main(String[] args) throws Exception {\n\t BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\n\t String[] line = br.readLine().split(\" \");\n\n\t int r = Integer.parseInt(line[0]);\n\t int c = Integer.parseInt(line[1]);\n\n\t int[][] matrix = new int[r + 1][c + 1];\n\n\t for (int i = 0; i < r; i++) {\n\t \tline = br.readLine().split(\" \");\n\n\t \tfor (int j = 0; j < line.length; j++) {\n\t\t \tmatrix[i][j] = Integer.parseInt(line[j]);\n\n\t\t \t// row sum\n\t\t \tmatrix[i][c] += matrix[i][j];\n\t\t \t// col sum\n\t\t \tmatrix[r][j] += matrix[i][j];\n\n\t\t \tif (j == line.length - 1) {\n\t\t\t \t// all sum\n\t\t\t \tmatrix[r][c] += matrix[i][c];\n\t\t \t}\n\t \t}\n\t }\n\n\t for (int i = 0; i < r + 1; i++) {\n\t \tfor (int j = 0; j < c + 1; j++) {\n\t \t\tSystem.out.print(matrix[i][j]);\n\t \t\tif (j < c) System.out.print(\" \");\n\t \t}\n\t \tSystem.out.println(\"\");\n\t }\n\t}\n}",
"public class Main {\n\tpublic static void main(String[] args) throws Exception {\n\t BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\n\t String[] line = br.readLine().split(\" \");\n\n\t int r = Integer.parseInt(line[0]);\n\t int c = Integer.parseInt(line[1]);\n\n\t int[][] matrix = new int[r + 1][c + 1];\n\n\t for (int i = 0; i < r; i++) {\n\t \tline = br.readLine().split(\" \");\n\n\t \tfor (int j = 0; j < line.length; j++) {\n\t\t \tmatrix[i][j] = Integer.parseInt(line[j]);\n\n\t\t \t// row sum\n\t\t \tmatrix[i][c] += matrix[i][j];\n\t\t \t// col sum\n\t\t \tmatrix[r][j] += matrix[i][j];\n\n\t\t \tif (j == line.length - 1) {\n\t\t\t \t// all sum\n\t\t\t \tmatrix[r][c] += matrix[i][c];\n\t\t \t}\n\t \t}\n\t }\n\n\t for (int i = 0; i < r + 1; i++) {\n\t \tfor (int j = 0; j < c + 1; j++) {\n\t \t\tSystem.out.print(matrix[i][j]);\n\t \t\tif (j < c) System.out.print(\" \");\n\t \t}\n\t \tSystem.out.println(\"\");\n\t }\n\t}\n}",
"Main"
] | import java.io.BufferedReader;
import java.io.InputStreamReader;
public class Main {
public static void main(String[] args) throws Exception {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
String[] line = br.readLine().split(" ");
int r = Integer.parseInt(line[0]);
int c = Integer.parseInt(line[1]);
int[][] matrix = new int[r + 1][c + 1];
for (int i = 0; i < r; i++) {
line = br.readLine().split(" ");
for (int j = 0; j < line.length; j++) {
matrix[i][j] = Integer.parseInt(line[j]);
// row sum
matrix[i][c] += matrix[i][j];
// col sum
matrix[r][j] += matrix[i][j];
if (j == line.length - 1) {
// all sum
matrix[r][c] += matrix[i][c];
}
}
}
for (int i = 0; i < r + 1; i++) {
for (int j = 0; j < c + 1; j++) {
System.out.print(matrix[i][j]);
if (j < c) System.out.print(" ");
}
System.out.println("");
}
}
} |
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
4,
13,
23,
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,
41,
13,
20,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
14,
2,
13,
13,
30,
0,
18,
18,
13,
13,
13,
18,
13,
13,
14,
2,
13,
13,
30,
0,
18,
18,
13,
13,
13,
18,
13,
13,
0,
18,
13,
13,
18,
18,
13,
13,
13,
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,
4,
13,
13,
12,
13,
30,
11,
1,
41,
13,
17,
2,
13,
18,
13,
13,
1,
40,
13,
30,
30,
11,
1,
41,
13,
17,
2,
13,
18,
18,
13,
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
],
[
6,
11
],
[
11,
12
],
[
4,
13
],
[
13,
14
],
[
13,
15
],
[
15,
16
],
[
16,
17
],
[
16,
18
],
[
15,
19
],
[
19,
20
],
[
19,
21
],
[
21,
22
],
[
22,
23
],
[
15,
24
],
[
24,
25
],
[
24,
26
],
[
26,
27
],
[
27,
28
],
[
15,
29
],
[
29,
30
],
[
29,
31
],
[
32,
33
],
[
32,
34
],
[
35,
36
],
[
35,
37
],
[
15,
38
],
[
38,
39
],
[
38,
40
],
[
41,
42
],
[
41,
43
],
[
15,
44
],
[
44,
45
],
[
44,
46
],
[
15,
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
],
[
75,
77
],
[
74,
78
],
[
78,
79
],
[
79,
80
],
[
80,
81
],
[
81,
82
],
[
81,
83
],
[
80,
84
],
[
79,
85
],
[
85,
86
],
[
85,
87
],
[
74,
88
],
[
88,
89
],
[
89,
90
],
[
89,
91
],
[
88,
92
],
[
92,
93
],
[
93,
94
],
[
94,
95
],
[
95,
96
],
[
95,
97
],
[
94,
98
],
[
93,
99
],
[
99,
100
],
[
99,
101
],
[
92,
102
],
[
102,
103
],
[
103,
104
],
[
103,
105
],
[
102,
106
],
[
106,
107
],
[
107,
108
],
[
107,
109
],
[
106,
110
],
[
88,
111
],
[
111,
112
],
[
112,
113
],
[
113,
114
],
[
114,
115
],
[
114,
116
],
[
113,
117
],
[
112,
118
],
[
118,
119
],
[
119,
120
],
[
111,
121
],
[
121,
122
],
[
122,
123
],
[
122,
124
],
[
121,
125
],
[
125,
126
],
[
126,
127
],
[
126,
128
],
[
125,
129
],
[
111,
130
],
[
130,
131
],
[
131,
132
],
[
131,
133
],
[
130,
134
],
[
134,
135
],
[
135,
136
],
[
135,
137
],
[
134,
138
],
[
15,
139
],
[
139,
140
],
[
139,
141
],
[
4,
142
],
[
142,
143
],
[
142,
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
],
[
162,
163
],
[
162,
164
],
[
160,
165
],
[
165,
166
],
[
165,
167
],
[
167,
168
],
[
168,
169
],
[
168,
170
],
[
167,
171
],
[
160,
172
],
[
172,
173
],
[
173,
174
],
[
160,
175
],
[
176,
176
],
[
176,
177
],
[
177,
178
],
[
178,
179
],
[
178,
180
],
[
177,
181
],
[
181,
182
],
[
182,
183
],
[
183,
184
],
[
183,
185
],
[
181,
186
],
[
176,
187
],
[
187,
188
],
[
188,
189
],
[
189,
190
],
[
189,
191
],
[
187,
192
],
[
192,
193
],
[
193,
194
],
[
193,
195
],
[
192,
196
],
[
159,
197
],
[
197,
198
],
[
198,
199
],
[
199,
200
],
[
199,
201
],
[
142,
202
],
[
202,
203
]
] | [
"import java.util.*;\n\n class Main\n {\n public static void main(String args[])\n { \n input();\n }\n static void input()\n {\n Scanner sc = new Scanner(System.in);\n \n int r = sc.nextInt();\n \n int c = sc.nextInt();\n \n int n[][] = new int[r + 1][c + 1];\n \n int rsum[] = new int[c + 1];\n \n int csum[] = new int[r];\n \n for(int i = 0; i <= r; i ++)\n {\n for(int j = 0; j <= c; j ++)\n {\n if(i == r)\n {\n n[i][j] = rsum[j];\n }\n else if(j == c)\n {\n n[i][j] = csum[i];\n \n rsum[j] += n[i][j];\n }\n else\n {\n n[i][j] = sc.nextInt();\n \n rsum[j] += n[i][j];\n \n csum[i] += n[i][j];\n }\n }\n }\n output(n);\n }\n static void output(int n[][])\n {\n for(int i = 0; i < n.length; i ++)\n {\n for(int j = 0; j < n[i].length; j ++)\n {\n if(j != 0)System.out.print(\" \");\n \n System.out.print(n[i][j]);\n }\n System.out.println();\n }\n }\n }\n ",
"import java.util.*;",
"util.*",
"java",
"class Main\n {\n public static void main(String args[])\n { \n input();\n }\n static void input()\n {\n Scanner sc = new Scanner(System.in);\n \n int r = sc.nextInt();\n \n int c = sc.nextInt();\n \n int n[][] = new int[r + 1][c + 1];\n \n int rsum[] = new int[c + 1];\n \n int csum[] = new int[r];\n \n for(int i = 0; i <= r; i ++)\n {\n for(int j = 0; j <= c; j ++)\n {\n if(i == r)\n {\n n[i][j] = rsum[j];\n }\n else if(j == c)\n {\n n[i][j] = csum[i];\n \n rsum[j] += n[i][j];\n }\n else\n {\n n[i][j] = sc.nextInt();\n \n rsum[j] += n[i][j];\n \n csum[i] += n[i][j];\n }\n }\n }\n output(n);\n }\n static void output(int n[][])\n {\n for(int i = 0; i < n.length; i ++)\n {\n for(int j = 0; j < n[i].length; j ++)\n {\n if(j != 0)System.out.print(\" \");\n \n System.out.print(n[i][j]);\n }\n System.out.println();\n }\n }\n }",
"Main",
"public static void main(String args[])\n { \n input();\n }",
"main",
"{ \n input();\n }",
"input()",
"input",
"String args[]",
"args",
"static void input()\n {\n Scanner sc = new Scanner(System.in);\n \n int r = sc.nextInt();\n \n int c = sc.nextInt();\n \n int n[][] = new int[r + 1][c + 1];\n \n int rsum[] = new int[c + 1];\n \n int csum[] = new int[r];\n \n for(int i = 0; i <= r; i ++)\n {\n for(int j = 0; j <= c; j ++)\n {\n if(i == r)\n {\n n[i][j] = rsum[j];\n }\n else if(j == c)\n {\n n[i][j] = csum[i];\n \n rsum[j] += n[i][j];\n }\n else\n {\n n[i][j] = sc.nextInt();\n \n rsum[j] += n[i][j];\n \n csum[i] += n[i][j];\n }\n }\n }\n output(n);\n }",
"input",
"{\n Scanner sc = new Scanner(System.in);\n \n int r = sc.nextInt();\n \n int c = sc.nextInt();\n \n int n[][] = new int[r + 1][c + 1];\n \n int rsum[] = new int[c + 1];\n \n int csum[] = new int[r];\n \n for(int i = 0; i <= r; i ++)\n {\n for(int j = 0; j <= c; j ++)\n {\n if(i == r)\n {\n n[i][j] = rsum[j];\n }\n else if(j == c)\n {\n n[i][j] = csum[i];\n \n rsum[j] += n[i][j];\n }\n else\n {\n n[i][j] = sc.nextInt();\n \n rsum[j] += n[i][j];\n \n csum[i] += n[i][j];\n }\n }\n }\n output(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 n[][] = new int[r + 1][c + 1];",
"n",
"new int[r + 1][c + 1]",
"r + 1",
"r",
"1",
"c + 1",
"c",
"1",
"int rsum[] = new int[c + 1];",
"rsum",
"new int[c + 1]",
"c + 1",
"c",
"1",
"int csum[] = new int[r];",
"csum",
"new int[r]",
"r",
"for(int i = 0; i <= r; i ++)\n {\n for(int j = 0; j <= c; j ++)\n {\n if(i == r)\n {\n n[i][j] = rsum[j];\n }\n else if(j == c)\n {\n n[i][j] = csum[i];\n \n rsum[j] += n[i][j];\n }\n else\n {\n n[i][j] = sc.nextInt();\n \n rsum[j] += n[i][j];\n \n csum[i] += n[i][j];\n }\n }\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i <= r",
"i",
"r",
"i ++",
"i ++",
"i",
"{\n for(int j = 0; j <= c; j ++)\n {\n if(i == r)\n {\n n[i][j] = rsum[j];\n }\n else if(j == c)\n {\n n[i][j] = csum[i];\n \n rsum[j] += n[i][j];\n }\n else\n {\n n[i][j] = sc.nextInt();\n \n rsum[j] += n[i][j];\n \n csum[i] += n[i][j];\n }\n }\n }",
"{\n for(int j = 0; j <= c; j ++)\n {\n if(i == r)\n {\n n[i][j] = rsum[j];\n }\n else if(j == c)\n {\n n[i][j] = csum[i];\n \n rsum[j] += n[i][j];\n }\n else\n {\n n[i][j] = sc.nextInt();\n \n rsum[j] += n[i][j];\n \n csum[i] += n[i][j];\n }\n }\n }",
"for(int j = 0; j <= c; j ++)\n {\n if(i == r)\n {\n n[i][j] = rsum[j];\n }\n else if(j == c)\n {\n n[i][j] = csum[i];\n \n rsum[j] += n[i][j];\n }\n else\n {\n n[i][j] = sc.nextInt();\n \n rsum[j] += n[i][j];\n \n csum[i] += n[i][j];\n }\n }",
"int j = 0;",
"int j = 0;",
"j",
"0",
"j <= c",
"j",
"c",
"j ++",
"j ++",
"j",
"{\n if(i == r)\n {\n n[i][j] = rsum[j];\n }\n else if(j == c)\n {\n n[i][j] = csum[i];\n \n rsum[j] += n[i][j];\n }\n else\n {\n n[i][j] = sc.nextInt();\n \n rsum[j] += n[i][j];\n \n csum[i] += n[i][j];\n }\n }",
"{\n if(i == r)\n {\n n[i][j] = rsum[j];\n }\n else if(j == c)\n {\n n[i][j] = csum[i];\n \n rsum[j] += n[i][j];\n }\n else\n {\n n[i][j] = sc.nextInt();\n \n rsum[j] += n[i][j];\n \n csum[i] += n[i][j];\n }\n }",
"if(i == r)\n {\n n[i][j] = rsum[j];\n }\n else if(j == c)\n {\n n[i][j] = csum[i];\n \n rsum[j] += n[i][j];\n }\n else\n {\n n[i][j] = sc.nextInt();\n \n rsum[j] += n[i][j];\n \n csum[i] += n[i][j];\n }",
"i == r",
"i",
"r",
"{\n n[i][j] = rsum[j];\n }",
"n[i][j] = rsum[j]",
"n[i][j]",
"n[i]",
"n",
"i",
"j",
"rsum[j]",
"rsum",
"j",
"if(j == c)\n {\n n[i][j] = csum[i];\n \n rsum[j] += n[i][j];\n }\n else\n {\n n[i][j] = sc.nextInt();\n \n rsum[j] += n[i][j];\n \n csum[i] += n[i][j];\n }",
"j == c",
"j",
"c",
"{\n n[i][j] = csum[i];\n \n rsum[j] += n[i][j];\n }",
"n[i][j] = csum[i]",
"n[i][j]",
"n[i]",
"n",
"i",
"j",
"csum[i]",
"csum",
"i",
"rsum[j] += n[i][j]",
"rsum[j]",
"rsum",
"j",
"n[i][j]",
"n[i]",
"n",
"i",
"j",
"{\n n[i][j] = sc.nextInt();\n \n rsum[j] += n[i][j];\n \n csum[i] += n[i][j];\n }",
"n[i][j] = sc.nextInt()",
"n[i][j]",
"n[i]",
"n",
"i",
"j",
"sc.nextInt()",
"sc.nextInt",
"sc",
"rsum[j] += n[i][j]",
"rsum[j]",
"rsum",
"j",
"n[i][j]",
"n[i]",
"n",
"i",
"j",
"csum[i] += n[i][j]",
"csum[i]",
"csum",
"i",
"n[i][j]",
"n[i]",
"n",
"i",
"j",
"output(n)",
"output",
"n",
"static void output(int n[][])\n {\n for(int i = 0; i < n.length; i ++)\n {\n for(int j = 0; j < n[i].length; j ++)\n {\n if(j != 0)System.out.print(\" \");\n \n System.out.print(n[i][j]);\n }\n System.out.println();\n }\n }",
"output",
"{\n for(int i = 0; i < n.length; i ++)\n {\n for(int j = 0; j < n[i].length; j ++)\n {\n if(j != 0)System.out.print(\" \");\n \n System.out.print(n[i][j]);\n }\n System.out.println();\n }\n }",
"for(int i = 0; i < n.length; i ++)\n {\n for(int j = 0; j < n[i].length; j ++)\n {\n if(j != 0)System.out.print(\" \");\n \n System.out.print(n[i][j]);\n }\n System.out.println();\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < n.length",
"i",
"n.length",
"n",
"n.length",
"i ++",
"i ++",
"i",
"{\n for(int j = 0; j < n[i].length; j ++)\n {\n if(j != 0)System.out.print(\" \");\n \n System.out.print(n[i][j]);\n }\n System.out.println();\n }",
"{\n for(int j = 0; j < n[i].length; j ++)\n {\n if(j != 0)System.out.print(\" \");\n \n System.out.print(n[i][j]);\n }\n System.out.println();\n }",
"for(int j = 0; j < n[i].length; j ++)\n {\n if(j != 0)System.out.print(\" \");\n \n System.out.print(n[i][j]);\n }",
"int j = 0;",
"int j = 0;",
"j",
"0",
"j < n[i].length",
"j",
"n[i].length",
"n[i]",
"n",
"i",
"n[i].length",
"j ++",
"j ++",
"j",
"{\n if(j != 0)System.out.print(\" \");\n \n System.out.print(n[i][j]);\n }",
"{\n if(j != 0)System.out.print(\" \");\n \n System.out.print(n[i][j]);\n }",
"if(j != 0)System.out.print(\" \");",
"j != 0",
"j",
"0",
"System.out.print(\" \")",
"System.out.print",
"System.out",
"System",
"System.out",
"\" \"",
"System.out.print(n[i][j])",
"System.out.print",
"System.out",
"System",
"System.out",
"n[i][j]",
"n[i]",
"n",
"i",
"j",
"System.out.println()",
"System.out.println",
"System.out",
"System",
"System.out",
"int n[][]",
"n"
] | import java.util.*;
class Main
{
public static void main(String args[])
{
input();
}
static void input()
{
Scanner sc = new Scanner(System.in);
int r = sc.nextInt();
int c = sc.nextInt();
int n[][] = new int[r + 1][c + 1];
int rsum[] = new int[c + 1];
int csum[] = new int[r];
for(int i = 0; i <= r; i ++)
{
for(int j = 0; j <= c; j ++)
{
if(i == r)
{
n[i][j] = rsum[j];
}
else if(j == c)
{
n[i][j] = csum[i];
rsum[j] += n[i][j];
}
else
{
n[i][j] = sc.nextInt();
rsum[j] += n[i][j];
csum[i] += n[i][j];
}
}
}
output(n);
}
static void output(int n[][])
{
for(int i = 0; i < n.length; i ++)
{
for(int j = 0; j < n[i].length; j ++)
{
if(j != 0)System.out.print(" ");
System.out.print(n[i][j]);
}
System.out.println();
}
}
}
|
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
41,
13,
17,
12,
13,
30,
4,
18,
20,
23,
13,
12,
13,
30,
41,
13,
8,
4,
18,
13,
20,
20,
41,
13,
20,
4,
13,
13,
13,
4,
18,
13,
12,
13,
30,
41,
13,
41,
13,
0,
13,
4,
18,
13,
0,
13,
4,
18,
13,
41,
13,
20,
13,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
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,
4,
18,
18,
13,
13,
2,
18,
18,
13,
13,
13,
17,
0,
13,
18,
18,
13,
13,
13,
4,
18,
18,
13,
13,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
18,
18,
13,
13,
13,
4,
18,
18,
13,
13,
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,
13,
18,
18,
13,
13,
13,
4,
18,
18,
13,
13,
13,
23,
13,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
246,
11
],
[
246,
12
],
[
12,
13
],
[
12,
14
],
[
246,
15
],
[
15,
16
],
[
15,
17
],
[
17,
18
],
[
18,
19
],
[
19,
20
],
[
15,
21
],
[
21,
22
],
[
246,
23
],
[
23,
24
],
[
23,
25
],
[
25,
26
],
[
26,
27
],
[
26,
28
],
[
28,
29
],
[
29,
30
],
[
30,
31
],
[
28,
32
],
[
28,
33
],
[
25,
34
],
[
34,
35
],
[
34,
36
],
[
25,
37
],
[
37,
38
],
[
37,
39
],
[
37,
40
],
[
25,
41
],
[
41,
42
],
[
42,
43
],
[
246,
44
],
[
44,
45
],
[
44,
46
],
[
46,
47
],
[
47,
48
],
[
46,
49
],
[
49,
50
],
[
46,
51
],
[
51,
52
],
[
51,
53
],
[
53,
54
],
[
54,
55
],
[
46,
56
],
[
56,
57
],
[
56,
58
],
[
58,
59
],
[
59,
60
],
[
46,
61
],
[
61,
62
],
[
61,
63
],
[
46,
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
],
[
46,
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
],
[
113,
117
],
[
117,
118
],
[
118,
119
],
[
119,
120
],
[
119,
121
],
[
117,
122
],
[
122,
123
],
[
122,
124
],
[
117,
125
],
[
125,
126
],
[
126,
127
],
[
117,
128
],
[
129,
129
],
[
129,
130
],
[
130,
131
],
[
131,
132
],
[
132,
133
],
[
132,
134
],
[
130,
135
],
[
135,
136
],
[
136,
137
],
[
137,
138
],
[
137,
139
],
[
136,
140
],
[
135,
141
],
[
129,
142
],
[
142,
143
],
[
142,
144
],
[
144,
145
],
[
145,
146
],
[
145,
147
],
[
144,
148
],
[
113,
149
],
[
149,
150
],
[
150,
151
],
[
151,
152
],
[
151,
153
],
[
149,
154
],
[
46,
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
],
[
167,
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
],
[
184,
186
],
[
186,
187
],
[
187,
188
],
[
187,
189
],
[
186,
190
],
[
167,
191
],
[
191,
192
],
[
192,
193
],
[
193,
194
],
[
193,
195
],
[
191,
196
],
[
196,
197
],
[
196,
198
],
[
46,
199
],
[
199,
200
],
[
199,
201
],
[
46,
202
],
[
202,
203
],
[
203,
204
],
[
204,
205
],
[
204,
206
],
[
202,
207
],
[
207,
208
],
[
207,
209
],
[
202,
210
],
[
210,
211
],
[
211,
212
],
[
202,
213
],
[
214,
214
],
[
214,
215
],
[
215,
216
],
[
216,
217
],
[
217,
218
],
[
217,
219
],
[
215,
220
],
[
220,
221
],
[
220,
222
],
[
215,
223
],
[
223,
224
],
[
224,
225
],
[
215,
226
],
[
227,
227
],
[
227,
228
],
[
228,
229
],
[
228,
230
],
[
230,
231
],
[
231,
232
],
[
231,
233
],
[
230,
234
],
[
46,
235
],
[
235,
236
],
[
236,
237
],
[
237,
238
],
[
237,
239
],
[
235,
240
],
[
44,
241
],
[
241,
242
],
[
44,
243
],
[
243,
244
],
[
0,
245
],
[
245,
246
],
[
245,
247
]
] | [
"import java.io.ByteArrayInputStream;\nimport java.io.PrintWriter;\nimport java.util.Scanner;\n\npublic class Main {\n\n String INPUT = \"\";\n\n public static void main(String[] args) throws Exception {\n new Main().run();\n }\n\n void run() {\n Scanner sc = INPUT.isEmpty() ? new Scanner(System.in) : new Scanner(new ByteArrayInputStream(INPUT.getBytes()));\n PrintWriter out = new PrintWriter(System.out);\n\n solve(sc, out);\n out.flush();\n }\n\n void solve(Scanner sc, PrintWriter out) {\n int r,c;\n \n r = sc.nextInt();\n c = sc.nextInt();\n \n int mat[][] = new int[r][c];\n \n for (int i = 0; i < r; i++) {\n\t\t\tfor (int j = 0; j < c; j++) {\n\t\t\t\tmat[i][j] = sc.nextInt();\n\t\t\t}\n\t\t}\n\t\n\t\tfor (int i = 0; i < r; i++) {\n \tint sum = 0;\n\t\t\tfor (int j = 0; j < c; j++) {\n\t\t\t\tSystem.out.print(mat[i][j] + \" \");\n\t\t\t\tsum += mat[i][j];\n\t\t\t}\n\t\t\tSystem.out.println(sum);\n\t\t}\n\t\tfor (int j = 0; j < c; j++) {\n \tint sum = 0;\n \tfor (int i = 0; i < r; i++) {\n \t\tsum += mat[i][j];\n\t\t\t}\n\t\t\tSystem.out.print(sum + \" \");\n\t\t}\n\t\t\n\t\tint sum = 0;\n\t\tfor (int i = 0; i < r; i++) {\n\t\t\tfor (int j = 0; j < c; j++) {\n\t\t\t\tsum += mat[i][j];\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(sum);\n }\n}\n",
"import java.io.ByteArrayInputStream;",
"ByteArrayInputStream",
"java.io",
"import java.io.PrintWriter;",
"PrintWriter",
"java.io",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n\n String INPUT = \"\";\n\n public static void main(String[] args) throws Exception {\n new Main().run();\n }\n\n void run() {\n Scanner sc = INPUT.isEmpty() ? new Scanner(System.in) : new Scanner(new ByteArrayInputStream(INPUT.getBytes()));\n PrintWriter out = new PrintWriter(System.out);\n\n solve(sc, out);\n out.flush();\n }\n\n void solve(Scanner sc, PrintWriter out) {\n int r,c;\n \n r = sc.nextInt();\n c = sc.nextInt();\n \n int mat[][] = new int[r][c];\n \n for (int i = 0; i < r; i++) {\n\t\t\tfor (int j = 0; j < c; j++) {\n\t\t\t\tmat[i][j] = sc.nextInt();\n\t\t\t}\n\t\t}\n\t\n\t\tfor (int i = 0; i < r; i++) {\n \tint sum = 0;\n\t\t\tfor (int j = 0; j < c; j++) {\n\t\t\t\tSystem.out.print(mat[i][j] + \" \");\n\t\t\t\tsum += mat[i][j];\n\t\t\t}\n\t\t\tSystem.out.println(sum);\n\t\t}\n\t\tfor (int j = 0; j < c; j++) {\n \tint sum = 0;\n \tfor (int i = 0; i < r; i++) {\n \t\tsum += mat[i][j];\n\t\t\t}\n\t\t\tSystem.out.print(sum + \" \");\n\t\t}\n\t\t\n\t\tint sum = 0;\n\t\tfor (int i = 0; i < r; i++) {\n\t\t\tfor (int j = 0; j < c; j++) {\n\t\t\t\tsum += mat[i][j];\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(sum);\n }\n}",
"Main",
"String INPUT = \"\";",
"INPUT",
"\"\"",
"public static void main(String[] args) throws Exception {\n new Main().run();\n }",
"main",
"{\n new Main().run();\n }",
"new Main().run()",
"new Main().run",
"new Main()",
"String[] args",
"args",
"void run() {\n Scanner sc = INPUT.isEmpty() ? new Scanner(System.in) : new Scanner(new ByteArrayInputStream(INPUT.getBytes()));\n PrintWriter out = new PrintWriter(System.out);\n\n solve(sc, out);\n out.flush();\n }",
"run",
"{\n Scanner sc = INPUT.isEmpty() ? new Scanner(System.in) : new Scanner(new ByteArrayInputStream(INPUT.getBytes()));\n PrintWriter out = new PrintWriter(System.out);\n\n solve(sc, out);\n out.flush();\n }",
"Scanner sc = INPUT.isEmpty() ? new Scanner(System.in) : new Scanner(new ByteArrayInputStream(INPUT.getBytes()));",
"sc",
"INPUT.isEmpty() ? new Scanner(System.in) : new Scanner(new ByteArrayInputStream(INPUT.getBytes()))",
"INPUT.isEmpty()",
"INPUT.isEmpty",
"INPUT",
"new Scanner(System.in)",
"new Scanner(new ByteArrayInputStream(INPUT.getBytes()))",
"PrintWriter out = new PrintWriter(System.out);",
"out",
"new PrintWriter(System.out)",
"solve(sc, out)",
"solve",
"sc",
"out",
"out.flush()",
"out.flush",
"out",
"void solve(Scanner sc, PrintWriter out) {\n int r,c;\n \n r = sc.nextInt();\n c = sc.nextInt();\n \n int mat[][] = new int[r][c];\n \n for (int i = 0; i < r; i++) {\n\t\t\tfor (int j = 0; j < c; j++) {\n\t\t\t\tmat[i][j] = sc.nextInt();\n\t\t\t}\n\t\t}\n\t\n\t\tfor (int i = 0; i < r; i++) {\n \tint sum = 0;\n\t\t\tfor (int j = 0; j < c; j++) {\n\t\t\t\tSystem.out.print(mat[i][j] + \" \");\n\t\t\t\tsum += mat[i][j];\n\t\t\t}\n\t\t\tSystem.out.println(sum);\n\t\t}\n\t\tfor (int j = 0; j < c; j++) {\n \tint sum = 0;\n \tfor (int i = 0; i < r; i++) {\n \t\tsum += mat[i][j];\n\t\t\t}\n\t\t\tSystem.out.print(sum + \" \");\n\t\t}\n\t\t\n\t\tint sum = 0;\n\t\tfor (int i = 0; i < r; i++) {\n\t\t\tfor (int j = 0; j < c; j++) {\n\t\t\t\tsum += mat[i][j];\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(sum);\n }",
"solve",
"{\n int r,c;\n \n r = sc.nextInt();\n c = sc.nextInt();\n \n int mat[][] = new int[r][c];\n \n for (int i = 0; i < r; i++) {\n\t\t\tfor (int j = 0; j < c; j++) {\n\t\t\t\tmat[i][j] = sc.nextInt();\n\t\t\t}\n\t\t}\n\t\n\t\tfor (int i = 0; i < r; i++) {\n \tint sum = 0;\n\t\t\tfor (int j = 0; j < c; j++) {\n\t\t\t\tSystem.out.print(mat[i][j] + \" \");\n\t\t\t\tsum += mat[i][j];\n\t\t\t}\n\t\t\tSystem.out.println(sum);\n\t\t}\n\t\tfor (int j = 0; j < c; j++) {\n \tint sum = 0;\n \tfor (int i = 0; i < r; i++) {\n \t\tsum += mat[i][j];\n\t\t\t}\n\t\t\tSystem.out.print(sum + \" \");\n\t\t}\n\t\t\n\t\tint sum = 0;\n\t\tfor (int i = 0; i < r; i++) {\n\t\t\tfor (int j = 0; j < c; j++) {\n\t\t\t\tsum += mat[i][j];\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(sum);\n }",
"int r",
"r",
"c;",
"c",
"r = sc.nextInt()",
"r",
"sc.nextInt()",
"sc.nextInt",
"sc",
"c = sc.nextInt()",
"c",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int mat[][] = new int[r][c];",
"mat",
"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\tmat[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\tmat[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\tmat[i][j] = sc.nextInt();\n\t\t\t}\n\t\t}",
"for (int j = 0; j < c; j++) {\n\t\t\t\tmat[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\tmat[i][j] = sc.nextInt();\n\t\t\t}",
"{\n\t\t\t\tmat[i][j] = sc.nextInt();\n\t\t\t}",
"mat[i][j] = sc.nextInt()",
"mat[i][j]",
"mat[i]",
"mat",
"i",
"j",
"sc.nextInt()",
"sc.nextInt",
"sc",
"for (int i = 0; i < r; i++) {\n \tint sum = 0;\n\t\t\tfor (int j = 0; j < c; j++) {\n\t\t\t\tSystem.out.print(mat[i][j] + \" \");\n\t\t\t\tsum += mat[i][j];\n\t\t\t}\n\t\t\tSystem.out.println(sum);\n\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < r",
"i",
"r",
"i++",
"i++",
"i",
"{\n \tint sum = 0;\n\t\t\tfor (int j = 0; j < c; j++) {\n\t\t\t\tSystem.out.print(mat[i][j] + \" \");\n\t\t\t\tsum += mat[i][j];\n\t\t\t}\n\t\t\tSystem.out.println(sum);\n\t\t}",
"{\n \tint sum = 0;\n\t\t\tfor (int j = 0; j < c; j++) {\n\t\t\t\tSystem.out.print(mat[i][j] + \" \");\n\t\t\t\tsum += mat[i][j];\n\t\t\t}\n\t\t\tSystem.out.println(sum);\n\t\t}",
"int sum = 0;",
"sum",
"0",
"for (int j = 0; j < c; j++) {\n\t\t\t\tSystem.out.print(mat[i][j] + \" \");\n\t\t\t\tsum += 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\tsum += mat[i][j];\n\t\t\t}",
"{\n\t\t\t\tSystem.out.print(mat[i][j] + \" \");\n\t\t\t\tsum += 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",
"\" \"",
"sum += mat[i][j]",
"sum",
"mat[i][j]",
"mat[i]",
"mat",
"i",
"j",
"System.out.println(sum)",
"System.out.println",
"System.out",
"System",
"System.out",
"sum",
"for (int j = 0; j < c; j++) {\n \tint sum = 0;\n \tfor (int i = 0; i < r; i++) {\n \t\tsum += mat[i][j];\n\t\t\t}\n\t\t\tSystem.out.print(sum + \" \");\n\t\t}",
"int j = 0;",
"int j = 0;",
"j",
"0",
"j < c",
"j",
"c",
"j++",
"j++",
"j",
"{\n \tint sum = 0;\n \tfor (int i = 0; i < r; i++) {\n \t\tsum += mat[i][j];\n\t\t\t}\n\t\t\tSystem.out.print(sum + \" \");\n\t\t}",
"{\n \tint sum = 0;\n \tfor (int i = 0; i < r; i++) {\n \t\tsum += mat[i][j];\n\t\t\t}\n\t\t\tSystem.out.print(sum + \" \");\n\t\t}",
"int sum = 0;",
"sum",
"0",
"for (int i = 0; i < r; i++) {\n \t\tsum += mat[i][j];\n\t\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < r",
"i",
"r",
"i++",
"i++",
"i",
"{\n \t\tsum += mat[i][j];\n\t\t\t}",
"{\n \t\tsum += mat[i][j];\n\t\t\t}",
"sum += mat[i][j]",
"sum",
"mat[i][j]",
"mat[i]",
"mat",
"i",
"j",
"System.out.print(sum + \" \")",
"System.out.print",
"System.out",
"System",
"System.out",
"sum + \" \"",
"sum",
"\" \"",
"int sum = 0;",
"sum",
"0",
"for (int i = 0; i < r; i++) {\n\t\t\tfor (int j = 0; j < c; j++) {\n\t\t\t\tsum += 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\tsum += mat[i][j];\n\t\t\t}\n\t\t}",
"{\n\t\t\tfor (int j = 0; j < c; j++) {\n\t\t\t\tsum += mat[i][j];\n\t\t\t}\n\t\t}",
"for (int j = 0; j < c; j++) {\n\t\t\t\tsum += 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\tsum += mat[i][j];\n\t\t\t}",
"{\n\t\t\t\tsum += mat[i][j];\n\t\t\t}",
"sum += mat[i][j]",
"sum",
"mat[i][j]",
"mat[i]",
"mat",
"i",
"j",
"System.out.println(sum)",
"System.out.println",
"System.out",
"System",
"System.out",
"sum",
"Scanner sc",
"sc",
"PrintWriter out",
"out",
"public class Main {\n\n String INPUT = \"\";\n\n public static void main(String[] args) throws Exception {\n new Main().run();\n }\n\n void run() {\n Scanner sc = INPUT.isEmpty() ? new Scanner(System.in) : new Scanner(new ByteArrayInputStream(INPUT.getBytes()));\n PrintWriter out = new PrintWriter(System.out);\n\n solve(sc, out);\n out.flush();\n }\n\n void solve(Scanner sc, PrintWriter out) {\n int r,c;\n \n r = sc.nextInt();\n c = sc.nextInt();\n \n int mat[][] = new int[r][c];\n \n for (int i = 0; i < r; i++) {\n\t\t\tfor (int j = 0; j < c; j++) {\n\t\t\t\tmat[i][j] = sc.nextInt();\n\t\t\t}\n\t\t}\n\t\n\t\tfor (int i = 0; i < r; i++) {\n \tint sum = 0;\n\t\t\tfor (int j = 0; j < c; j++) {\n\t\t\t\tSystem.out.print(mat[i][j] + \" \");\n\t\t\t\tsum += mat[i][j];\n\t\t\t}\n\t\t\tSystem.out.println(sum);\n\t\t}\n\t\tfor (int j = 0; j < c; j++) {\n \tint sum = 0;\n \tfor (int i = 0; i < r; i++) {\n \t\tsum += mat[i][j];\n\t\t\t}\n\t\t\tSystem.out.print(sum + \" \");\n\t\t}\n\t\t\n\t\tint sum = 0;\n\t\tfor (int i = 0; i < r; i++) {\n\t\t\tfor (int j = 0; j < c; j++) {\n\t\t\t\tsum += mat[i][j];\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(sum);\n }\n}",
"public class Main {\n\n String INPUT = \"\";\n\n public static void main(String[] args) throws Exception {\n new Main().run();\n }\n\n void run() {\n Scanner sc = INPUT.isEmpty() ? new Scanner(System.in) : new Scanner(new ByteArrayInputStream(INPUT.getBytes()));\n PrintWriter out = new PrintWriter(System.out);\n\n solve(sc, out);\n out.flush();\n }\n\n void solve(Scanner sc, PrintWriter out) {\n int r,c;\n \n r = sc.nextInt();\n c = sc.nextInt();\n \n int mat[][] = new int[r][c];\n \n for (int i = 0; i < r; i++) {\n\t\t\tfor (int j = 0; j < c; j++) {\n\t\t\t\tmat[i][j] = sc.nextInt();\n\t\t\t}\n\t\t}\n\t\n\t\tfor (int i = 0; i < r; i++) {\n \tint sum = 0;\n\t\t\tfor (int j = 0; j < c; j++) {\n\t\t\t\tSystem.out.print(mat[i][j] + \" \");\n\t\t\t\tsum += mat[i][j];\n\t\t\t}\n\t\t\tSystem.out.println(sum);\n\t\t}\n\t\tfor (int j = 0; j < c; j++) {\n \tint sum = 0;\n \tfor (int i = 0; i < r; i++) {\n \t\tsum += mat[i][j];\n\t\t\t}\n\t\t\tSystem.out.print(sum + \" \");\n\t\t}\n\t\t\n\t\tint sum = 0;\n\t\tfor (int i = 0; i < r; i++) {\n\t\t\tfor (int j = 0; j < c; j++) {\n\t\t\t\tsum += mat[i][j];\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(sum);\n }\n}",
"Main"
] | import java.io.ByteArrayInputStream;
import java.io.PrintWriter;
import java.util.Scanner;
public class Main {
String INPUT = "";
public static void main(String[] args) throws Exception {
new Main().run();
}
void run() {
Scanner sc = INPUT.isEmpty() ? new Scanner(System.in) : new Scanner(new ByteArrayInputStream(INPUT.getBytes()));
PrintWriter out = new PrintWriter(System.out);
solve(sc, out);
out.flush();
}
void solve(Scanner sc, PrintWriter out) {
int r,c;
r = sc.nextInt();
c = sc.nextInt();
int mat[][] = new int[r][c];
for (int i = 0; i < r; i++) {
for (int j = 0; j < c; j++) {
mat[i][j] = sc.nextInt();
}
}
for (int i = 0; i < r; i++) {
int sum = 0;
for (int j = 0; j < c; j++) {
System.out.print(mat[i][j] + " ");
sum += mat[i][j];
}
System.out.println(sum);
}
for (int j = 0; j < c; j++) {
int sum = 0;
for (int i = 0; i < r; i++) {
sum += mat[i][j];
}
System.out.print(sum + " ");
}
int sum = 0;
for (int i = 0; i < r; i++) {
for (int j = 0; j < c; j++) {
sum += mat[i][j];
}
}
System.out.println(sum);
}
}
|
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
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,
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,
30,
0,
18,
18,
13,
13,
13,
4,
18,
13,
0,
18,
18,
13,
13,
13,
18,
18,
13,
13,
13,
0,
18,
18,
13,
13,
13,
18,
18,
13,
13,
13,
0,
18,
18,
13,
13,
13,
18,
18,
13,
13,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
4,
18,
18,
13,
13,
18,
18,
13,
13,
13,
14,
2,
13,
13,
4,
18,
18,
13,
13,
17,
4,
18,
18,
13,
13,
17,
4,
18,
13,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
201,
5
],
[
201,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
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
],
[
48,
49
],
[
49,
50
],
[
50,
51
],
[
51,
52
],
[
51,
53
],
[
50,
54
],
[
49,
55
],
[
8,
56
],
[
56,
57
],
[
57,
58
],
[
58,
59
],
[
58,
60
],
[
56,
61
],
[
61,
62
],
[
61,
63
],
[
56,
64
],
[
64,
65
],
[
65,
66
],
[
56,
67
],
[
67,
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
],
[
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
],
[
175,
177
],
[
174,
178
],
[
168,
179
],
[
179,
180
],
[
180,
181
],
[
180,
182
],
[
179,
183
],
[
183,
184
],
[
184,
185
],
[
185,
186
],
[
185,
187
],
[
183,
188
],
[
155,
189
],
[
189,
190
],
[
190,
191
],
[
191,
192
],
[
191,
193
],
[
189,
194
],
[
8,
195
],
[
195,
196
],
[
196,
197
],
[
6,
198
],
[
198,
199
],
[
0,
200
],
[
200,
201
],
[
200,
202
]
] | [
"import java.util.*;\n\npublic class Main{\n public static void main(String[] args){\n Scanner sc = new Scanner(System.in);\n int r,c,count;\n r = sc.nextInt();\n c = sc.nextInt();\n int[][] cells = new int[r+1][c+1];\n for(int i=0;i <= r;i++)cells[i][c] = 0;\n for(int j=0;j <= c;j++)cells[r][j] = 0;\n for(int i=0;i < r;i++){\n for(int j=0;j < c;j++){\n cells[i][j] = sc.nextInt();\n cells[i][c] += cells[i][j];\n cells[r][j] += cells[i][j];\n cells[r][c] += cells[i][j];\n }\n }\n for(int i=0;i <= r;i++){\n for(int j=0;j <= c;j++){\n System.out.print(cells[i][j]);\n if(j != c)System.out.print(\" \");\n }\n System.out.println(\"\");\n }\n sc.close();\n }\n}\n",
"import java.util.*;",
"util.*",
"java",
"public class Main{\n public static void main(String[] args){\n Scanner sc = new Scanner(System.in);\n int r,c,count;\n r = sc.nextInt();\n c = sc.nextInt();\n int[][] cells = new int[r+1][c+1];\n for(int i=0;i <= r;i++)cells[i][c] = 0;\n for(int j=0;j <= c;j++)cells[r][j] = 0;\n for(int i=0;i < r;i++){\n for(int j=0;j < c;j++){\n cells[i][j] = sc.nextInt();\n cells[i][c] += cells[i][j];\n cells[r][j] += cells[i][j];\n cells[r][c] += cells[i][j];\n }\n }\n for(int i=0;i <= r;i++){\n for(int j=0;j <= c;j++){\n System.out.print(cells[i][j]);\n if(j != c)System.out.print(\" \");\n }\n System.out.println(\"\");\n }\n sc.close();\n }\n}",
"Main",
"public static void main(String[] args){\n Scanner sc = new Scanner(System.in);\n int r,c,count;\n r = sc.nextInt();\n c = sc.nextInt();\n int[][] cells = new int[r+1][c+1];\n for(int i=0;i <= r;i++)cells[i][c] = 0;\n for(int j=0;j <= c;j++)cells[r][j] = 0;\n for(int i=0;i < r;i++){\n for(int j=0;j < c;j++){\n cells[i][j] = sc.nextInt();\n cells[i][c] += cells[i][j];\n cells[r][j] += cells[i][j];\n cells[r][c] += cells[i][j];\n }\n }\n for(int i=0;i <= r;i++){\n for(int j=0;j <= c;j++){\n System.out.print(cells[i][j]);\n if(j != c)System.out.print(\" \");\n }\n System.out.println(\"\");\n }\n sc.close();\n }",
"main",
"{\n Scanner sc = new Scanner(System.in);\n int r,c,count;\n r = sc.nextInt();\n c = sc.nextInt();\n int[][] cells = new int[r+1][c+1];\n for(int i=0;i <= r;i++)cells[i][c] = 0;\n for(int j=0;j <= c;j++)cells[r][j] = 0;\n for(int i=0;i < r;i++){\n for(int j=0;j < c;j++){\n cells[i][j] = sc.nextInt();\n cells[i][c] += cells[i][j];\n cells[r][j] += cells[i][j];\n cells[r][c] += cells[i][j];\n }\n }\n for(int i=0;i <= r;i++){\n for(int j=0;j <= c;j++){\n System.out.print(cells[i][j]);\n if(j != c)System.out.print(\" \");\n }\n System.out.println(\"\");\n }\n sc.close();\n }",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"int r",
"r",
"c",
"c",
"count;",
"count",
"r = sc.nextInt()",
"r",
"sc.nextInt()",
"sc.nextInt",
"sc",
"c = sc.nextInt()",
"c",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int[][] cells = new int[r+1][c+1];",
"cells",
"new int[r+1][c+1]",
"r+1",
"r",
"1",
"c+1",
"c",
"1",
"for(int i=0;i <= r;i++)cells[i][c] = 0;",
"int i=0;",
"int i=0;",
"i",
"0",
"i <= r",
"i",
"r",
"i++",
"i++",
"i",
"cells[i][c] = 0;",
"cells[i][c] = 0",
"cells[i][c]",
"cells[i]",
"cells",
"i",
"c",
"0",
"for(int j=0;j <= c;j++)cells[r][j] = 0;",
"int j=0;",
"int j=0;",
"j",
"0",
"j <= c",
"j",
"c",
"j++",
"j++",
"j",
"cells[r][j] = 0;",
"cells[r][j] = 0",
"cells[r][j]",
"cells[r]",
"cells",
"r",
"j",
"0",
"for(int i=0;i < r;i++){\n for(int j=0;j < c;j++){\n cells[i][j] = sc.nextInt();\n cells[i][c] += cells[i][j];\n cells[r][j] += cells[i][j];\n cells[r][c] += cells[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 cells[i][j] = sc.nextInt();\n cells[i][c] += cells[i][j];\n cells[r][j] += cells[i][j];\n cells[r][c] += cells[i][j];\n }\n }",
"{\n for(int j=0;j < c;j++){\n cells[i][j] = sc.nextInt();\n cells[i][c] += cells[i][j];\n cells[r][j] += cells[i][j];\n cells[r][c] += cells[i][j];\n }\n }",
"for(int j=0;j < c;j++){\n cells[i][j] = sc.nextInt();\n cells[i][c] += cells[i][j];\n cells[r][j] += cells[i][j];\n cells[r][c] += cells[i][j];\n }",
"int j=0;",
"int j=0;",
"j",
"0",
"j < c",
"j",
"c",
"j++",
"j++",
"j",
"{\n cells[i][j] = sc.nextInt();\n cells[i][c] += cells[i][j];\n cells[r][j] += cells[i][j];\n cells[r][c] += cells[i][j];\n }",
"{\n cells[i][j] = sc.nextInt();\n cells[i][c] += cells[i][j];\n cells[r][j] += cells[i][j];\n cells[r][c] += cells[i][j];\n }",
"cells[i][j] = sc.nextInt()",
"cells[i][j]",
"cells[i]",
"cells",
"i",
"j",
"sc.nextInt()",
"sc.nextInt",
"sc",
"cells[i][c] += cells[i][j]",
"cells[i][c]",
"cells[i]",
"cells",
"i",
"c",
"cells[i][j]",
"cells[i]",
"cells",
"i",
"j",
"cells[r][j] += cells[i][j]",
"cells[r][j]",
"cells[r]",
"cells",
"r",
"j",
"cells[i][j]",
"cells[i]",
"cells",
"i",
"j",
"cells[r][c] += cells[i][j]",
"cells[r][c]",
"cells[r]",
"cells",
"r",
"c",
"cells[i][j]",
"cells[i]",
"cells",
"i",
"j",
"for(int i=0;i <= r;i++){\n for(int j=0;j <= c;j++){\n System.out.print(cells[i][j]);\n if(j != c)System.out.print(\" \");\n }\n System.out.println(\"\");\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(cells[i][j]);\n if(j != c)System.out.print(\" \");\n }\n System.out.println(\"\");\n }",
"{\n for(int j=0;j <= c;j++){\n System.out.print(cells[i][j]);\n if(j != c)System.out.print(\" \");\n }\n System.out.println(\"\");\n }",
"for(int j=0;j <= c;j++){\n System.out.print(cells[i][j]);\n if(j != c)System.out.print(\" \");\n }",
"int j=0;",
"int j=0;",
"j",
"0",
"j <= c",
"j",
"c",
"j++",
"j++",
"j",
"{\n System.out.print(cells[i][j]);\n if(j != c)System.out.print(\" \");\n }",
"{\n System.out.print(cells[i][j]);\n if(j != c)System.out.print(\" \");\n }",
"System.out.print(cells[i][j])",
"System.out.print",
"System.out",
"System",
"System.out",
"cells[i][j]",
"cells[i]",
"cells",
"i",
"j",
"if(j != c)System.out.print(\" \");",
"j != c",
"j",
"c",
"System.out.print(\" \")",
"System.out.print",
"System.out",
"System",
"System.out",
"\" \"",
"System.out.println(\"\")",
"System.out.println",
"System.out",
"System",
"System.out",
"\"\"",
"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 int r,c,count;\n r = sc.nextInt();\n c = sc.nextInt();\n int[][] cells = new int[r+1][c+1];\n for(int i=0;i <= r;i++)cells[i][c] = 0;\n for(int j=0;j <= c;j++)cells[r][j] = 0;\n for(int i=0;i < r;i++){\n for(int j=0;j < c;j++){\n cells[i][j] = sc.nextInt();\n cells[i][c] += cells[i][j];\n cells[r][j] += cells[i][j];\n cells[r][c] += cells[i][j];\n }\n }\n for(int i=0;i <= r;i++){\n for(int j=0;j <= c;j++){\n System.out.print(cells[i][j]);\n if(j != c)System.out.print(\" \");\n }\n System.out.println(\"\");\n }\n sc.close();\n }\n}",
"public class Main{\n public static void main(String[] args){\n Scanner sc = new Scanner(System.in);\n int r,c,count;\n r = sc.nextInt();\n c = sc.nextInt();\n int[][] cells = new int[r+1][c+1];\n for(int i=0;i <= r;i++)cells[i][c] = 0;\n for(int j=0;j <= c;j++)cells[r][j] = 0;\n for(int i=0;i < r;i++){\n for(int j=0;j < c;j++){\n cells[i][j] = sc.nextInt();\n cells[i][c] += cells[i][j];\n cells[r][j] += cells[i][j];\n cells[r][c] += cells[i][j];\n }\n }\n for(int i=0;i <= r;i++){\n for(int j=0;j <= c;j++){\n System.out.print(cells[i][j]);\n if(j != c)System.out.print(\" \");\n }\n System.out.println(\"\");\n }\n sc.close();\n }\n}",
"Main"
] | import java.util.*;
public class Main{
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
int r,c,count;
r = sc.nextInt();
c = sc.nextInt();
int[][] cells = new int[r+1][c+1];
for(int i=0;i <= r;i++)cells[i][c] = 0;
for(int j=0;j <= c;j++)cells[r][j] = 0;
for(int i=0;i < r;i++){
for(int j=0;j < c;j++){
cells[i][j] = sc.nextInt();
cells[i][c] += cells[i][j];
cells[r][j] += cells[i][j];
cells[r][c] += cells[i][j];
}
}
for(int i=0;i <= r;i++){
for(int j=0;j <= c;j++){
System.out.print(cells[i][j]);
if(j != c)System.out.print(" ");
}
System.out.println("");
}
sc.close();
}
}
|
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
41,
13,
20,
2,
13,
17,
2,
13,
17,
11,
1,
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,
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
],
[
178,
5
],
[
178,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
8,
17
],
[
17,
18
],
[
17,
19
],
[
19,
20
],
[
20,
21
],
[
8,
22
],
[
22,
23
],
[
22,
24
],
[
25,
26
],
[
25,
27
],
[
28,
29
],
[
28,
30
],
[
8,
31
],
[
31,
32
],
[
32,
33
],
[
33,
34
],
[
33,
35
],
[
31,
36
],
[
36,
37
],
[
36,
38
],
[
31,
39
],
[
39,
40
],
[
40,
41
],
[
31,
42
],
[
43,
43
],
[
43,
44
],
[
44,
45
],
[
45,
46
],
[
46,
47
],
[
46,
48
],
[
44,
49
],
[
49,
50
],
[
49,
51
],
[
44,
52
],
[
52,
53
],
[
53,
54
],
[
44,
55
],
[
56,
56
],
[
56,
57
],
[
57,
58
],
[
58,
59
],
[
59,
60
],
[
59,
61
],
[
58,
62
],
[
57,
63
],
[
63,
64
],
[
64,
65
],
[
8,
66
],
[
66,
67
],
[
67,
68
],
[
68,
69
],
[
68,
70
],
[
66,
71
],
[
71,
72
],
[
71,
73
],
[
66,
74
],
[
74,
75
],
[
75,
76
],
[
66,
77
],
[
78,
78
],
[
78,
79
],
[
79,
80
],
[
80,
81
],
[
81,
82
],
[
81,
83
],
[
79,
84
],
[
84,
85
],
[
84,
86
],
[
79,
87
],
[
87,
88
],
[
88,
89
],
[
79,
90
],
[
91,
91
],
[
91,
92
],
[
92,
93
],
[
93,
94
],
[
94,
95
],
[
94,
96
],
[
93,
97
],
[
92,
98
],
[
98,
99
],
[
99,
100
],
[
99,
101
],
[
98,
102
],
[
91,
103
],
[
103,
104
],
[
104,
105
],
[
105,
106
],
[
105,
107
],
[
104,
108
],
[
103,
109
],
[
109,
110
],
[
110,
111
],
[
110,
112
],
[
109,
113
],
[
78,
114
],
[
114,
115
],
[
115,
116
],
[
116,
117
],
[
116,
118
],
[
115,
119
],
[
114,
120
],
[
120,
121
],
[
121,
122
],
[
121,
123
],
[
120,
124
],
[
8,
125
],
[
125,
126
],
[
126,
127
],
[
127,
128
],
[
127,
129
],
[
125,
130
],
[
130,
131
],
[
130,
132
],
[
132,
133
],
[
132,
134
],
[
125,
135
],
[
135,
136
],
[
136,
137
],
[
125,
138
],
[
139,
139
],
[
139,
140
],
[
140,
141
],
[
141,
142
],
[
142,
143
],
[
142,
144
],
[
140,
145
],
[
145,
146
],
[
145,
147
],
[
140,
148
],
[
148,
149
],
[
149,
150
],
[
140,
151
],
[
152,
152
],
[
152,
153
],
[
153,
154
],
[
154,
155
],
[
155,
156
],
[
155,
157
],
[
153,
158
],
[
158,
159
],
[
159,
160
],
[
160,
161
],
[
160,
162
],
[
159,
163
],
[
158,
164
],
[
139,
165
],
[
165,
166
],
[
166,
167
],
[
167,
168
],
[
167,
169
],
[
165,
170
],
[
170,
171
],
[
171,
172
],
[
171,
173
],
[
170,
174
],
[
6,
175
],
[
175,
176
],
[
0,
177
],
[
177,
178
],
[
177,
179
]
] | [
"import java.util.Scanner;\n\npublic class Main {\n\tpublic static void main(String[] args) {\n\t\tScanner scn = new Scanner(System.in);\n\t\tint r = scn.nextInt();\n\t\tint c = scn.nextInt();\n\t\tint[][] sum = 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\tsum[i][j] = scn.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\tsum[i][c] += sum[i][j];\n\t\t\t\tsum[r][j] += sum[i][j];\n\t\t\t}\n\t\t\tsum[r][c] += sum[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; j++) {\n\t\t\t\tSystem.out.print(sum[i][j] + \" \");\n\t\t\t}\n\t\t\tSystem.out.println(sum[i][c]);\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 scn = new Scanner(System.in);\n\t\tint r = scn.nextInt();\n\t\tint c = scn.nextInt();\n\t\tint[][] sum = 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\tsum[i][j] = scn.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\tsum[i][c] += sum[i][j];\n\t\t\t\tsum[r][j] += sum[i][j];\n\t\t\t}\n\t\t\tsum[r][c] += sum[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; j++) {\n\t\t\t\tSystem.out.print(sum[i][j] + \" \");\n\t\t\t}\n\t\t\tSystem.out.println(sum[i][c]);\n\t\t}\n\t}\n}",
"Main",
"public static void main(String[] args) {\n\t\tScanner scn = new Scanner(System.in);\n\t\tint r = scn.nextInt();\n\t\tint c = scn.nextInt();\n\t\tint[][] sum = 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\tsum[i][j] = scn.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\tsum[i][c] += sum[i][j];\n\t\t\t\tsum[r][j] += sum[i][j];\n\t\t\t}\n\t\t\tsum[r][c] += sum[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; j++) {\n\t\t\t\tSystem.out.print(sum[i][j] + \" \");\n\t\t\t}\n\t\t\tSystem.out.println(sum[i][c]);\n\t\t}\n\t}",
"main",
"{\n\t\tScanner scn = new Scanner(System.in);\n\t\tint r = scn.nextInt();\n\t\tint c = scn.nextInt();\n\t\tint[][] sum = 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\tsum[i][j] = scn.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\tsum[i][c] += sum[i][j];\n\t\t\t\tsum[r][j] += sum[i][j];\n\t\t\t}\n\t\t\tsum[r][c] += sum[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; j++) {\n\t\t\t\tSystem.out.print(sum[i][j] + \" \");\n\t\t\t}\n\t\t\tSystem.out.println(sum[i][c]);\n\t\t}\n\t}",
"Scanner scn = new Scanner(System.in);",
"scn",
"new Scanner(System.in)",
"int r = scn.nextInt();",
"r",
"scn.nextInt()",
"scn.nextInt",
"scn",
"int c = scn.nextInt();",
"c",
"scn.nextInt()",
"scn.nextInt",
"scn",
"int[][] sum = new int[r + 1][c + 1];",
"sum",
"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\tsum[i][j] = scn.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\tsum[i][j] = scn.nextInt();\n\t\t\t}\n\t\t}",
"{\n\t\t\tfor (int j = 0; j < c; j++) {\n\t\t\t\tsum[i][j] = scn.nextInt();\n\t\t\t}\n\t\t}",
"for (int j = 0; j < c; j++) {\n\t\t\t\tsum[i][j] = scn.nextInt();\n\t\t\t}",
"int j = 0;",
"int j = 0;",
"j",
"0",
"j < c",
"j",
"c",
"j++",
"j++",
"j",
"{\n\t\t\t\tsum[i][j] = scn.nextInt();\n\t\t\t}",
"{\n\t\t\t\tsum[i][j] = scn.nextInt();\n\t\t\t}",
"sum[i][j] = scn.nextInt()",
"sum[i][j]",
"sum[i]",
"sum",
"i",
"j",
"scn.nextInt()",
"scn.nextInt",
"scn",
"for (int i = 0; i < r; i++) {\n\t\t\tfor (int j = 0; j < c; j++) {\n\t\t\t\tsum[i][c] += sum[i][j];\n\t\t\t\tsum[r][j] += sum[i][j];\n\t\t\t}\n\t\t\tsum[r][c] += sum[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\tsum[i][c] += sum[i][j];\n\t\t\t\tsum[r][j] += sum[i][j];\n\t\t\t}\n\t\t\tsum[r][c] += sum[i][c];\n\t\t}",
"{\n\t\t\tfor (int j = 0; j < c; j++) {\n\t\t\t\tsum[i][c] += sum[i][j];\n\t\t\t\tsum[r][j] += sum[i][j];\n\t\t\t}\n\t\t\tsum[r][c] += sum[i][c];\n\t\t}",
"for (int j = 0; j < c; j++) {\n\t\t\t\tsum[i][c] += sum[i][j];\n\t\t\t\tsum[r][j] += sum[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\tsum[i][c] += sum[i][j];\n\t\t\t\tsum[r][j] += sum[i][j];\n\t\t\t}",
"{\n\t\t\t\tsum[i][c] += sum[i][j];\n\t\t\t\tsum[r][j] += sum[i][j];\n\t\t\t}",
"sum[i][c] += sum[i][j]",
"sum[i][c]",
"sum[i]",
"sum",
"i",
"c",
"sum[i][j]",
"sum[i]",
"sum",
"i",
"j",
"sum[r][j] += sum[i][j]",
"sum[r][j]",
"sum[r]",
"sum",
"r",
"j",
"sum[i][j]",
"sum[i]",
"sum",
"i",
"j",
"sum[r][c] += sum[i][c]",
"sum[r][c]",
"sum[r]",
"sum",
"r",
"c",
"sum[i][c]",
"sum[i]",
"sum",
"i",
"c",
"for (int i = 0; i < r + 1; i++) {\n\t\t\tfor (int j = 0; j < c; j++) {\n\t\t\t\tSystem.out.print(sum[i][j] + \" \");\n\t\t\t}\n\t\t\tSystem.out.println(sum[i][c]);\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.print(sum[i][j] + \" \");\n\t\t\t}\n\t\t\tSystem.out.println(sum[i][c]);\n\t\t}",
"{\n\t\t\tfor (int j = 0; j < c; j++) {\n\t\t\t\tSystem.out.print(sum[i][j] + \" \");\n\t\t\t}\n\t\t\tSystem.out.println(sum[i][c]);\n\t\t}",
"for (int j = 0; j < c; j++) {\n\t\t\t\tSystem.out.print(sum[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(sum[i][j] + \" \");\n\t\t\t}",
"{\n\t\t\t\tSystem.out.print(sum[i][j] + \" \");\n\t\t\t}",
"System.out.print(sum[i][j] + \" \")",
"System.out.print",
"System.out",
"System",
"System.out",
"sum[i][j] + \" \"",
"sum[i][j]",
"sum[i]",
"sum",
"i",
"j",
"\" \"",
"System.out.println(sum[i][c])",
"System.out.println",
"System.out",
"System",
"System.out",
"sum[i][c]",
"sum[i]",
"sum",
"i",
"c",
"String[] args",
"args",
"public class Main {\n\tpublic static void main(String[] args) {\n\t\tScanner scn = new Scanner(System.in);\n\t\tint r = scn.nextInt();\n\t\tint c = scn.nextInt();\n\t\tint[][] sum = 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\tsum[i][j] = scn.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\tsum[i][c] += sum[i][j];\n\t\t\t\tsum[r][j] += sum[i][j];\n\t\t\t}\n\t\t\tsum[r][c] += sum[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; j++) {\n\t\t\t\tSystem.out.print(sum[i][j] + \" \");\n\t\t\t}\n\t\t\tSystem.out.println(sum[i][c]);\n\t\t}\n\t}\n}",
"public class Main {\n\tpublic static void main(String[] args) {\n\t\tScanner scn = new Scanner(System.in);\n\t\tint r = scn.nextInt();\n\t\tint c = scn.nextInt();\n\t\tint[][] sum = 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\tsum[i][j] = scn.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\tsum[i][c] += sum[i][j];\n\t\t\t\tsum[r][j] += sum[i][j];\n\t\t\t}\n\t\t\tsum[r][c] += sum[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; j++) {\n\t\t\t\tSystem.out.print(sum[i][j] + \" \");\n\t\t\t}\n\t\t\tSystem.out.println(sum[i][c]);\n\t\t}\n\t}\n}",
"Main"
] | import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner scn = new Scanner(System.in);
int r = scn.nextInt();
int c = scn.nextInt();
int[][] sum = new int[r + 1][c + 1];
for (int i = 0; i < r; i++) {
for (int j = 0; j < c; j++) {
sum[i][j] = scn.nextInt();
}
}
for (int i = 0; i < r; i++) {
for (int j = 0; j < c; j++) {
sum[i][c] += sum[i][j];
sum[r][j] += sum[i][j];
}
sum[r][c] += sum[i][c];
}
for (int i = 0; i < r + 1; i++) {
for (int j = 0; j < c; j++) {
System.out.print(sum[i][j] + " ");
}
System.out.println(sum[i][c]);
}
}
}
|
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
4,
18,
13,
23,
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,
41,
13,
20,
11,
1,
41,
13,
17,
2,
13,
2,
13,
17,
1,
40,
13,
30,
30,
4,
18,
4,
18,
13,
18,
18,
13,
13,
13,
17,
4,
18,
18,
13,
13,
4,
18,
4,
18,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
194,
5
],
[
194,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
13,
14
],
[
6,
15
],
[
15,
16
],
[
194,
17
],
[
17,
18
],
[
17,
19
],
[
19,
20
],
[
20,
21
],
[
20,
22
],
[
19,
23
],
[
23,
24
],
[
23,
25
],
[
25,
26
],
[
26,
27
],
[
19,
28
],
[
28,
29
],
[
28,
30
],
[
30,
31
],
[
31,
32
],
[
19,
33
],
[
33,
34
],
[
33,
35
],
[
36,
37
],
[
36,
38
],
[
39,
40
],
[
39,
41
],
[
19,
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
],
[
54,
87
],
[
87,
88
],
[
88,
89
],
[
89,
90
],
[
89,
91
],
[
88,
92
],
[
87,
93
],
[
19,
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
],
[
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
],
[
133,
137
],
[
132,
138
],
[
19,
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
],
[
173,
174
],
[
174,
175
],
[
175,
176
],
[
174,
177
],
[
177,
178
],
[
178,
179
],
[
178,
180
],
[
177,
181
],
[
172,
182
],
[
153,
183
],
[
183,
184
],
[
184,
185
],
[
185,
186
],
[
185,
187
],
[
183,
188
],
[
188,
189
],
[
189,
190
],
[
190,
191
],
[
191,
192
],
[
0,
193
],
[
193,
194
],
[
193,
195
]
] | [
"import java.util.*;\n\npublic class Main {\n \n public static void main(String[] args) {\n Main main = new Main();\n main.solv();\n }\n \n private void solv() {\n Scanner input = new Scanner(System.in);\n int r = input.nextInt();\n int c = input.nextInt();\n int[][] matrix = new int[r+1][c+1];\n for (int i = 0; i < r; i++) {\n int sum = 0;\n for (int j = 0; j < c; j++) {\n matrix[i][j] = input.nextInt();\n sum += matrix[i][j];\n }\n matrix[i][c] = sum;\n }\n for (int i = 0; i < c + 1; i++) {\n int sum = 0;\n for (int j = 0; j < r; j++) {\n sum += matrix[j][i];\n }\n matrix[r][i] = sum;\n }\n for (int i = 0; i < r + 1; i++) {\n StringBuilder sb = new StringBuilder();\n for (int j = 0; j < c + 1; j++) {\n sb.append(matrix[i][j]).append(' ');\n }\n System.out.println(sb.toString().trim());\n }\n }\n}",
"import java.util.*;",
"util.*",
"java",
"public class Main {\n \n public static void main(String[] args) {\n Main main = new Main();\n main.solv();\n }\n \n private void solv() {\n Scanner input = new Scanner(System.in);\n int r = input.nextInt();\n int c = input.nextInt();\n int[][] matrix = new int[r+1][c+1];\n for (int i = 0; i < r; i++) {\n int sum = 0;\n for (int j = 0; j < c; j++) {\n matrix[i][j] = input.nextInt();\n sum += matrix[i][j];\n }\n matrix[i][c] = sum;\n }\n for (int i = 0; i < c + 1; i++) {\n int sum = 0;\n for (int j = 0; j < r; j++) {\n sum += matrix[j][i];\n }\n matrix[r][i] = sum;\n }\n for (int i = 0; i < r + 1; i++) {\n StringBuilder sb = new StringBuilder();\n for (int j = 0; j < c + 1; j++) {\n sb.append(matrix[i][j]).append(' ');\n }\n System.out.println(sb.toString().trim());\n }\n }\n}",
"Main",
"public static void main(String[] args) {\n Main main = new Main();\n main.solv();\n }",
"main",
"{\n Main main = new Main();\n main.solv();\n }",
"Main main = new Main();",
"main",
"new Main()",
"main.solv()",
"main.solv",
"main",
"String[] args",
"args",
"private void solv() {\n Scanner input = new Scanner(System.in);\n int r = input.nextInt();\n int c = input.nextInt();\n int[][] matrix = new int[r+1][c+1];\n for (int i = 0; i < r; i++) {\n int sum = 0;\n for (int j = 0; j < c; j++) {\n matrix[i][j] = input.nextInt();\n sum += matrix[i][j];\n }\n matrix[i][c] = sum;\n }\n for (int i = 0; i < c + 1; i++) {\n int sum = 0;\n for (int j = 0; j < r; j++) {\n sum += matrix[j][i];\n }\n matrix[r][i] = sum;\n }\n for (int i = 0; i < r + 1; i++) {\n StringBuilder sb = new StringBuilder();\n for (int j = 0; j < c + 1; j++) {\n sb.append(matrix[i][j]).append(' ');\n }\n System.out.println(sb.toString().trim());\n }\n }",
"solv",
"{\n Scanner input = new Scanner(System.in);\n int r = input.nextInt();\n int c = input.nextInt();\n int[][] matrix = new int[r+1][c+1];\n for (int i = 0; i < r; i++) {\n int sum = 0;\n for (int j = 0; j < c; j++) {\n matrix[i][j] = input.nextInt();\n sum += matrix[i][j];\n }\n matrix[i][c] = sum;\n }\n for (int i = 0; i < c + 1; i++) {\n int sum = 0;\n for (int j = 0; j < r; j++) {\n sum += matrix[j][i];\n }\n matrix[r][i] = sum;\n }\n for (int i = 0; i < r + 1; i++) {\n StringBuilder sb = new StringBuilder();\n for (int j = 0; j < c + 1; j++) {\n sb.append(matrix[i][j]).append(' ');\n }\n System.out.println(sb.toString().trim());\n }\n }",
"Scanner input = new Scanner(System.in);",
"input",
"new Scanner(System.in)",
"int r = input.nextInt();",
"r",
"input.nextInt()",
"input.nextInt",
"input",
"int c = input.nextInt();",
"c",
"input.nextInt()",
"input.nextInt",
"input",
"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 int sum = 0;\n for (int j = 0; j < c; j++) {\n matrix[i][j] = input.nextInt();\n sum += matrix[i][j];\n }\n matrix[i][c] = sum;\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < r",
"i",
"r",
"i++",
"i++",
"i",
"{\n int sum = 0;\n for (int j = 0; j < c; j++) {\n matrix[i][j] = input.nextInt();\n sum += matrix[i][j];\n }\n matrix[i][c] = sum;\n }",
"{\n int sum = 0;\n for (int j = 0; j < c; j++) {\n matrix[i][j] = input.nextInt();\n sum += matrix[i][j];\n }\n matrix[i][c] = sum;\n }",
"int sum = 0;",
"sum",
"0",
"for (int j = 0; j < c; j++) {\n matrix[i][j] = input.nextInt();\n sum += matrix[i][j];\n }",
"int j = 0;",
"int j = 0;",
"j",
"0",
"j < c",
"j",
"c",
"j++",
"j++",
"j",
"{\n matrix[i][j] = input.nextInt();\n sum += matrix[i][j];\n }",
"{\n matrix[i][j] = input.nextInt();\n sum += matrix[i][j];\n }",
"matrix[i][j] = input.nextInt()",
"matrix[i][j]",
"matrix[i]",
"matrix",
"i",
"j",
"input.nextInt()",
"input.nextInt",
"input",
"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 + 1; i++) {\n int sum = 0;\n for (int j = 0; j < r; j++) {\n sum += matrix[j][i];\n }\n matrix[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 for (int j = 0; j < r; j++) {\n sum += matrix[j][i];\n }\n matrix[r][i] = sum;\n }",
"{\n int sum = 0;\n for (int j = 0; j < r; j++) {\n sum += matrix[j][i];\n }\n matrix[r][i] = sum;\n }",
"int sum = 0;",
"sum",
"0",
"for (int j = 0; j < r; j++) {\n sum += matrix[j][i];\n }",
"int j = 0;",
"int j = 0;",
"j",
"0",
"j < r",
"j",
"r",
"j++",
"j++",
"j",
"{\n sum += matrix[j][i];\n }",
"{\n sum += matrix[j][i];\n }",
"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 < r + 1; i++) {\n StringBuilder sb = new StringBuilder();\n for (int j = 0; j < c + 1; j++) {\n sb.append(matrix[i][j]).append(' ');\n }\n System.out.println(sb.toString().trim());\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < r + 1",
"i",
"r + 1",
"r",
"1",
"i++",
"i++",
"i",
"{\n StringBuilder sb = new StringBuilder();\n for (int j = 0; j < c + 1; j++) {\n sb.append(matrix[i][j]).append(' ');\n }\n System.out.println(sb.toString().trim());\n }",
"{\n StringBuilder sb = new StringBuilder();\n for (int j = 0; j < c + 1; j++) {\n sb.append(matrix[i][j]).append(' ');\n }\n System.out.println(sb.toString().trim());\n }",
"StringBuilder sb = new StringBuilder();",
"sb",
"new StringBuilder()",
"for (int j = 0; j < c + 1; j++) {\n sb.append(matrix[i][j]).append(' ');\n }",
"int j = 0;",
"int j = 0;",
"j",
"0",
"j < c + 1",
"j",
"c + 1",
"c",
"1",
"j++",
"j++",
"j",
"{\n sb.append(matrix[i][j]).append(' ');\n }",
"{\n sb.append(matrix[i][j]).append(' ');\n }",
"sb.append(matrix[i][j]).append(' ')",
"sb.append(matrix[i][j]).append",
"sb.append(matrix[i][j])",
"sb.append",
"sb",
"matrix[i][j]",
"matrix[i]",
"matrix",
"i",
"j",
"' '",
"System.out.println(sb.toString().trim())",
"System.out.println",
"System.out",
"System",
"System.out",
"sb.toString().trim()",
"sb.toString().trim",
"sb.toString()",
"sb.toString",
"sb",
"public class Main {\n \n public static void main(String[] args) {\n Main main = new Main();\n main.solv();\n }\n \n private void solv() {\n Scanner input = new Scanner(System.in);\n int r = input.nextInt();\n int c = input.nextInt();\n int[][] matrix = new int[r+1][c+1];\n for (int i = 0; i < r; i++) {\n int sum = 0;\n for (int j = 0; j < c; j++) {\n matrix[i][j] = input.nextInt();\n sum += matrix[i][j];\n }\n matrix[i][c] = sum;\n }\n for (int i = 0; i < c + 1; i++) {\n int sum = 0;\n for (int j = 0; j < r; j++) {\n sum += matrix[j][i];\n }\n matrix[r][i] = sum;\n }\n for (int i = 0; i < r + 1; i++) {\n StringBuilder sb = new StringBuilder();\n for (int j = 0; j < c + 1; j++) {\n sb.append(matrix[i][j]).append(' ');\n }\n System.out.println(sb.toString().trim());\n }\n }\n}",
"public class Main {\n \n public static void main(String[] args) {\n Main main = new Main();\n main.solv();\n }\n \n private void solv() {\n Scanner input = new Scanner(System.in);\n int r = input.nextInt();\n int c = input.nextInt();\n int[][] matrix = new int[r+1][c+1];\n for (int i = 0; i < r; i++) {\n int sum = 0;\n for (int j = 0; j < c; j++) {\n matrix[i][j] = input.nextInt();\n sum += matrix[i][j];\n }\n matrix[i][c] = sum;\n }\n for (int i = 0; i < c + 1; i++) {\n int sum = 0;\n for (int j = 0; j < r; j++) {\n sum += matrix[j][i];\n }\n matrix[r][i] = sum;\n }\n for (int i = 0; i < r + 1; i++) {\n StringBuilder sb = new StringBuilder();\n for (int j = 0; j < c + 1; j++) {\n sb.append(matrix[i][j]).append(' ');\n }\n System.out.println(sb.toString().trim());\n }\n }\n}",
"Main"
] | import java.util.*;
public class Main {
public static void main(String[] args) {
Main main = new Main();
main.solv();
}
private void solv() {
Scanner input = new Scanner(System.in);
int r = input.nextInt();
int c = input.nextInt();
int[][] matrix = new int[r+1][c+1];
for (int i = 0; i < r; i++) {
int sum = 0;
for (int j = 0; j < c; j++) {
matrix[i][j] = input.nextInt();
sum += matrix[i][j];
}
matrix[i][c] = sum;
}
for (int i = 0; i < c + 1; i++) {
int sum = 0;
for (int j = 0; j < r; j++) {
sum += matrix[j][i];
}
matrix[r][i] = sum;
}
for (int i = 0; i < r + 1; i++) {
StringBuilder sb = new StringBuilder();
for (int j = 0; j < c + 1; j++) {
sb.append(matrix[i][j]).append(' ');
}
System.out.println(sb.toString().trim());
}
}
} |
[
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,
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,
13,
1,
40,
13,
30,
30,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
14,
2,
13,
17,
4,
18,
18,
13,
13,
18,
18,
13,
13,
13,
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
],
[
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
],
[
79,
81
],
[
78,
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
],
[
78,
102
],
[
102,
103
],
[
103,
104
],
[
104,
105
],
[
104,
106
],
[
103,
107
],
[
102,
108
],
[
8,
109
],
[
109,
110
],
[
110,
111
],
[
111,
112
],
[
111,
113
],
[
109,
114
],
[
114,
115
],
[
114,
116
],
[
116,
117
],
[
116,
118
],
[
109,
119
],
[
119,
120
],
[
120,
121
],
[
109,
122
],
[
123,
123
],
[
123,
124
],
[
124,
125
],
[
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
],
[
8,
154
],
[
154,
155
],
[
155,
156
],
[
156,
157
],
[
156,
158
],
[
154,
159
],
[
159,
160
],
[
159,
161
],
[
154,
162
],
[
162,
163
],
[
163,
164
],
[
154,
165
],
[
166,
166
],
[
166,
167
],
[
167,
168
],
[
168,
169
],
[
169,
170
],
[
169,
171
],
[
167,
172
],
[
172,
173
],
[
172,
174
],
[
167,
175
],
[
175,
176
],
[
176,
177
],
[
167,
178
],
[
179,
179
],
[
179,
180
],
[
180,
181
],
[
181,
182
],
[
181,
183
],
[
180,
184
],
[
184,
185
],
[
185,
186
],
[
186,
187
],
[
186,
188
],
[
184,
189
],
[
189,
190
],
[
190,
191
],
[
190,
192
],
[
189,
193
],
[
180,
194
],
[
194,
195
],
[
195,
196
],
[
196,
197
],
[
196,
198
],
[
194,
199
],
[
199,
200
],
[
199,
201
],
[
201,
202
],
[
202,
203
],
[
202,
204
],
[
201,
205
],
[
166,
206
],
[
206,
207
],
[
207,
208
],
[
208,
209
],
[
208,
210
],
[
6,
211
],
[
211,
212
],
[
0,
213
],
[
213,
214
],
[
213,
215
]
] | [
"\nimport java.util.Scanner;\n\npublic class Main {\n\tpublic static void main(String[] args) {\n\t\tScanner scanner = new Scanner(System.in);\n\t\tint a = scanner.nextInt();\n\t\tint b = scanner.nextInt();\n\t\tint[][] list = new int[a + 1][b + 1];\n\t\tfor (int i = 0; i < a; i++) {\n\t\t\tfor (int j = 0; j < b; j++) {\n\t\t\t\tlist[i][j] = scanner.nextInt();\n\t\t\t}\n\t\t}\n\t\tfor (int i = 0; i < a; i++) {\n\t\t\tint sum = 0;\n\t\t\tfor (int j = 0; j < b; j++) {\n\t\t\t\tsum += list[i][j];\n\t\t\t}\n\t\t\tlist[i][b] = sum;\n\t\t}\n\t\tfor (int i = 0; i < b + 1; i++) {\n\t\t\tint sum = 0;\n\t\t\tfor (int j = 0; j < a; j++) {\n\t\t\t\tsum += list[j][i];\n\t\t\t}\n\t\t\tlist[a][i] = sum;\n\n\t\t}\n\n\t\tfor (int i = 0; i <= a; i++) {\n\t\t\tfor (int j = 0; j <= b; j++) {\n\t\t\t\tif (j == 0)\n\t\t\t\t\tSystem.out.print(list[i][j]);\n\t\t\t\telse\n\t\t\t\t\tSystem.out.print(\" \" + list[i][j]);\n\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 scanner = new Scanner(System.in);\n\t\tint a = scanner.nextInt();\n\t\tint b = scanner.nextInt();\n\t\tint[][] list = new int[a + 1][b + 1];\n\t\tfor (int i = 0; i < a; i++) {\n\t\t\tfor (int j = 0; j < b; j++) {\n\t\t\t\tlist[i][j] = scanner.nextInt();\n\t\t\t}\n\t\t}\n\t\tfor (int i = 0; i < a; i++) {\n\t\t\tint sum = 0;\n\t\t\tfor (int j = 0; j < b; j++) {\n\t\t\t\tsum += list[i][j];\n\t\t\t}\n\t\t\tlist[i][b] = sum;\n\t\t}\n\t\tfor (int i = 0; i < b + 1; i++) {\n\t\t\tint sum = 0;\n\t\t\tfor (int j = 0; j < a; j++) {\n\t\t\t\tsum += list[j][i];\n\t\t\t}\n\t\t\tlist[a][i] = sum;\n\n\t\t}\n\n\t\tfor (int i = 0; i <= a; i++) {\n\t\t\tfor (int j = 0; j <= b; j++) {\n\t\t\t\tif (j == 0)\n\t\t\t\t\tSystem.out.print(list[i][j]);\n\t\t\t\telse\n\t\t\t\t\tSystem.out.print(\" \" + list[i][j]);\n\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 scanner = new Scanner(System.in);\n\t\tint a = scanner.nextInt();\n\t\tint b = scanner.nextInt();\n\t\tint[][] list = new int[a + 1][b + 1];\n\t\tfor (int i = 0; i < a; i++) {\n\t\t\tfor (int j = 0; j < b; j++) {\n\t\t\t\tlist[i][j] = scanner.nextInt();\n\t\t\t}\n\t\t}\n\t\tfor (int i = 0; i < a; i++) {\n\t\t\tint sum = 0;\n\t\t\tfor (int j = 0; j < b; j++) {\n\t\t\t\tsum += list[i][j];\n\t\t\t}\n\t\t\tlist[i][b] = sum;\n\t\t}\n\t\tfor (int i = 0; i < b + 1; i++) {\n\t\t\tint sum = 0;\n\t\t\tfor (int j = 0; j < a; j++) {\n\t\t\t\tsum += list[j][i];\n\t\t\t}\n\t\t\tlist[a][i] = sum;\n\n\t\t}\n\n\t\tfor (int i = 0; i <= a; i++) {\n\t\t\tfor (int j = 0; j <= b; j++) {\n\t\t\t\tif (j == 0)\n\t\t\t\t\tSystem.out.print(list[i][j]);\n\t\t\t\telse\n\t\t\t\t\tSystem.out.print(\" \" + list[i][j]);\n\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}\n\t}",
"main",
"{\n\t\tScanner scanner = new Scanner(System.in);\n\t\tint a = scanner.nextInt();\n\t\tint b = scanner.nextInt();\n\t\tint[][] list = new int[a + 1][b + 1];\n\t\tfor (int i = 0; i < a; i++) {\n\t\t\tfor (int j = 0; j < b; j++) {\n\t\t\t\tlist[i][j] = scanner.nextInt();\n\t\t\t}\n\t\t}\n\t\tfor (int i = 0; i < a; i++) {\n\t\t\tint sum = 0;\n\t\t\tfor (int j = 0; j < b; j++) {\n\t\t\t\tsum += list[i][j];\n\t\t\t}\n\t\t\tlist[i][b] = sum;\n\t\t}\n\t\tfor (int i = 0; i < b + 1; i++) {\n\t\t\tint sum = 0;\n\t\t\tfor (int j = 0; j < a; j++) {\n\t\t\t\tsum += list[j][i];\n\t\t\t}\n\t\t\tlist[a][i] = sum;\n\n\t\t}\n\n\t\tfor (int i = 0; i <= a; i++) {\n\t\t\tfor (int j = 0; j <= b; j++) {\n\t\t\t\tif (j == 0)\n\t\t\t\t\tSystem.out.print(list[i][j]);\n\t\t\t\telse\n\t\t\t\t\tSystem.out.print(\" \" + list[i][j]);\n\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}\n\t}",
"Scanner scanner = new Scanner(System.in);",
"scanner",
"new Scanner(System.in)",
"int a = scanner.nextInt();",
"a",
"scanner.nextInt()",
"scanner.nextInt",
"scanner",
"int b = scanner.nextInt();",
"b",
"scanner.nextInt()",
"scanner.nextInt",
"scanner",
"int[][] list = new int[a + 1][b + 1];",
"list",
"new int[a + 1][b + 1]",
"a + 1",
"a",
"1",
"b + 1",
"b",
"1",
"for (int i = 0; i < a; i++) {\n\t\t\tfor (int j = 0; j < b; j++) {\n\t\t\t\tlist[i][j] = scanner.nextInt();\n\t\t\t}\n\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < a",
"i",
"a",
"i++",
"i++",
"i",
"{\n\t\t\tfor (int j = 0; j < b; j++) {\n\t\t\t\tlist[i][j] = scanner.nextInt();\n\t\t\t}\n\t\t}",
"{\n\t\t\tfor (int j = 0; j < b; j++) {\n\t\t\t\tlist[i][j] = scanner.nextInt();\n\t\t\t}\n\t\t}",
"for (int j = 0; j < b; j++) {\n\t\t\t\tlist[i][j] = scanner.nextInt();\n\t\t\t}",
"int j = 0;",
"int j = 0;",
"j",
"0",
"j < b",
"j",
"b",
"j++",
"j++",
"j",
"{\n\t\t\t\tlist[i][j] = scanner.nextInt();\n\t\t\t}",
"{\n\t\t\t\tlist[i][j] = scanner.nextInt();\n\t\t\t}",
"list[i][j] = scanner.nextInt()",
"list[i][j]",
"list[i]",
"list",
"i",
"j",
"scanner.nextInt()",
"scanner.nextInt",
"scanner",
"for (int i = 0; i < a; i++) {\n\t\t\tint sum = 0;\n\t\t\tfor (int j = 0; j < b; j++) {\n\t\t\t\tsum += list[i][j];\n\t\t\t}\n\t\t\tlist[i][b] = sum;\n\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < a",
"i",
"a",
"i++",
"i++",
"i",
"{\n\t\t\tint sum = 0;\n\t\t\tfor (int j = 0; j < b; j++) {\n\t\t\t\tsum += list[i][j];\n\t\t\t}\n\t\t\tlist[i][b] = sum;\n\t\t}",
"{\n\t\t\tint sum = 0;\n\t\t\tfor (int j = 0; j < b; j++) {\n\t\t\t\tsum += list[i][j];\n\t\t\t}\n\t\t\tlist[i][b] = sum;\n\t\t}",
"int sum = 0;",
"sum",
"0",
"for (int j = 0; j < b; j++) {\n\t\t\t\tsum += list[i][j];\n\t\t\t}",
"int j = 0;",
"int j = 0;",
"j",
"0",
"j < b",
"j",
"b",
"j++",
"j++",
"j",
"{\n\t\t\t\tsum += list[i][j];\n\t\t\t}",
"{\n\t\t\t\tsum += list[i][j];\n\t\t\t}",
"sum += list[i][j]",
"sum",
"list[i][j]",
"list[i]",
"list",
"i",
"j",
"list[i][b] = sum",
"list[i][b]",
"list[i]",
"list",
"i",
"b",
"sum",
"for (int i = 0; i < b + 1; i++) {\n\t\t\tint sum = 0;\n\t\t\tfor (int j = 0; j < a; j++) {\n\t\t\t\tsum += list[j][i];\n\t\t\t}\n\t\t\tlist[a][i] = sum;\n\n\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < b + 1",
"i",
"b + 1",
"b",
"1",
"i++",
"i++",
"i",
"{\n\t\t\tint sum = 0;\n\t\t\tfor (int j = 0; j < a; j++) {\n\t\t\t\tsum += list[j][i];\n\t\t\t}\n\t\t\tlist[a][i] = sum;\n\n\t\t}",
"{\n\t\t\tint sum = 0;\n\t\t\tfor (int j = 0; j < a; j++) {\n\t\t\t\tsum += list[j][i];\n\t\t\t}\n\t\t\tlist[a][i] = sum;\n\n\t\t}",
"int sum = 0;",
"sum",
"0",
"for (int j = 0; j < a; j++) {\n\t\t\t\tsum += list[j][i];\n\t\t\t}",
"int j = 0;",
"int j = 0;",
"j",
"0",
"j < a",
"j",
"a",
"j++",
"j++",
"j",
"{\n\t\t\t\tsum += list[j][i];\n\t\t\t}",
"{\n\t\t\t\tsum += list[j][i];\n\t\t\t}",
"sum += list[j][i]",
"sum",
"list[j][i]",
"list[j]",
"list",
"j",
"i",
"list[a][i] = sum",
"list[a][i]",
"list[a]",
"list",
"a",
"i",
"sum",
"for (int i = 0; i <= a; i++) {\n\t\t\tfor (int j = 0; j <= b; j++) {\n\t\t\t\tif (j == 0)\n\t\t\t\t\tSystem.out.print(list[i][j]);\n\t\t\t\telse\n\t\t\t\t\tSystem.out.print(\" \" + list[i][j]);\n\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i <= a",
"i",
"a",
"i++",
"i++",
"i",
"{\n\t\t\tfor (int j = 0; j <= b; j++) {\n\t\t\t\tif (j == 0)\n\t\t\t\t\tSystem.out.print(list[i][j]);\n\t\t\t\telse\n\t\t\t\t\tSystem.out.print(\" \" + list[i][j]);\n\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}",
"{\n\t\t\tfor (int j = 0; j <= b; j++) {\n\t\t\t\tif (j == 0)\n\t\t\t\t\tSystem.out.print(list[i][j]);\n\t\t\t\telse\n\t\t\t\t\tSystem.out.print(\" \" + list[i][j]);\n\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}",
"for (int j = 0; j <= b; j++) {\n\t\t\t\tif (j == 0)\n\t\t\t\t\tSystem.out.print(list[i][j]);\n\t\t\t\telse\n\t\t\t\t\tSystem.out.print(\" \" + list[i][j]);\n\n\t\t\t}",
"int j = 0;",
"int j = 0;",
"j",
"0",
"j <= b",
"j",
"b",
"j++",
"j++",
"j",
"{\n\t\t\t\tif (j == 0)\n\t\t\t\t\tSystem.out.print(list[i][j]);\n\t\t\t\telse\n\t\t\t\t\tSystem.out.print(\" \" + list[i][j]);\n\n\t\t\t}",
"{\n\t\t\t\tif (j == 0)\n\t\t\t\t\tSystem.out.print(list[i][j]);\n\t\t\t\telse\n\t\t\t\t\tSystem.out.print(\" \" + list[i][j]);\n\n\t\t\t}",
"if (j == 0)\n\t\t\t\t\tSystem.out.print(list[i][j]);\n\t\t\t\telse\n\t\t\t\t\tSystem.out.print(\" \" + list[i][j]);",
"j == 0",
"j",
"0",
"System.out.print(list[i][j])",
"System.out.print",
"System.out",
"System",
"System.out",
"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",
"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 scanner = new Scanner(System.in);\n\t\tint a = scanner.nextInt();\n\t\tint b = scanner.nextInt();\n\t\tint[][] list = new int[a + 1][b + 1];\n\t\tfor (int i = 0; i < a; i++) {\n\t\t\tfor (int j = 0; j < b; j++) {\n\t\t\t\tlist[i][j] = scanner.nextInt();\n\t\t\t}\n\t\t}\n\t\tfor (int i = 0; i < a; i++) {\n\t\t\tint sum = 0;\n\t\t\tfor (int j = 0; j < b; j++) {\n\t\t\t\tsum += list[i][j];\n\t\t\t}\n\t\t\tlist[i][b] = sum;\n\t\t}\n\t\tfor (int i = 0; i < b + 1; i++) {\n\t\t\tint sum = 0;\n\t\t\tfor (int j = 0; j < a; j++) {\n\t\t\t\tsum += list[j][i];\n\t\t\t}\n\t\t\tlist[a][i] = sum;\n\n\t\t}\n\n\t\tfor (int i = 0; i <= a; i++) {\n\t\t\tfor (int j = 0; j <= b; j++) {\n\t\t\t\tif (j == 0)\n\t\t\t\t\tSystem.out.print(list[i][j]);\n\t\t\t\telse\n\t\t\t\t\tSystem.out.print(\" \" + list[i][j]);\n\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 scanner = new Scanner(System.in);\n\t\tint a = scanner.nextInt();\n\t\tint b = scanner.nextInt();\n\t\tint[][] list = new int[a + 1][b + 1];\n\t\tfor (int i = 0; i < a; i++) {\n\t\t\tfor (int j = 0; j < b; j++) {\n\t\t\t\tlist[i][j] = scanner.nextInt();\n\t\t\t}\n\t\t}\n\t\tfor (int i = 0; i < a; i++) {\n\t\t\tint sum = 0;\n\t\t\tfor (int j = 0; j < b; j++) {\n\t\t\t\tsum += list[i][j];\n\t\t\t}\n\t\t\tlist[i][b] = sum;\n\t\t}\n\t\tfor (int i = 0; i < b + 1; i++) {\n\t\t\tint sum = 0;\n\t\t\tfor (int j = 0; j < a; j++) {\n\t\t\t\tsum += list[j][i];\n\t\t\t}\n\t\t\tlist[a][i] = sum;\n\n\t\t}\n\n\t\tfor (int i = 0; i <= a; i++) {\n\t\t\tfor (int j = 0; j <= b; j++) {\n\t\t\t\tif (j == 0)\n\t\t\t\t\tSystem.out.print(list[i][j]);\n\t\t\t\telse\n\t\t\t\t\tSystem.out.print(\" \" + list[i][j]);\n\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 scanner = new Scanner(System.in);
int a = scanner.nextInt();
int b = scanner.nextInt();
int[][] list = new int[a + 1][b + 1];
for (int i = 0; i < a; i++) {
for (int j = 0; j < b; j++) {
list[i][j] = scanner.nextInt();
}
}
for (int i = 0; i < a; i++) {
int sum = 0;
for (int j = 0; j < b; j++) {
sum += list[i][j];
}
list[i][b] = sum;
}
for (int i = 0; i < b + 1; i++) {
int sum = 0;
for (int j = 0; j < a; j++) {
sum += list[j][i];
}
list[a][i] = sum;
}
for (int i = 0; i <= a; i++) {
for (int j = 0; j <= b; j++) {
if (j == 0)
System.out.print(list[i][j]);
else
System.out.print(" " + list[i][j]);
}
System.out.println();
}
}
} |
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
20,
41,
13,
4,
18,
4,
18,
13,
17,
41,
13,
4,
18,
13,
18,
13,
17,
41,
13,
4,
18,
13,
18,
13,
17,
41,
13,
17,
41,
13,
17,
41,
13,
17,
41,
13,
17,
41,
13,
20,
13,
13,
11,
1,
0,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
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,
13,
2,
18,
18,
13,
13,
13,
13,
4,
18,
4,
18,
13,
4,
18,
13,
18,
18,
13,
13,
13,
17,
4,
18,
4,
18,
13,
4,
18,
13,
13,
17,
0,
13,
17,
11,
1,
0,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
11,
1,
0,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
2,
13,
18,
18,
13,
13,
13,
4,
18,
4,
18,
13,
4,
18,
13,
13,
17,
0,
13,
2,
13,
13,
0,
13,
17,
4,
18,
4,
18,
13,
4,
18,
13,
13,
17,
4,
18,
18,
13,
13,
13,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
242,
11
],
[
242,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
15,
17
],
[
14,
18
],
[
18,
19
],
[
18,
20
],
[
14,
21
],
[
21,
22
],
[
21,
23
],
[
23,
24
],
[
24,
25
],
[
25,
26
],
[
26,
27
],
[
23,
28
],
[
14,
29
],
[
29,
30
],
[
29,
31
],
[
31,
32
],
[
32,
33
],
[
31,
34
],
[
34,
35
],
[
34,
36
],
[
14,
37
],
[
37,
38
],
[
37,
39
],
[
39,
40
],
[
40,
41
],
[
39,
42
],
[
42,
43
],
[
42,
44
],
[
14,
45
],
[
45,
46
],
[
45,
47
],
[
14,
48
],
[
48,
49
],
[
48,
50
],
[
14,
51
],
[
51,
52
],
[
51,
53
],
[
14,
54
],
[
54,
55
],
[
54,
56
],
[
14,
57
],
[
57,
58
],
[
57,
59
],
[
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
],
[
134,
136
],
[
136,
137
],
[
137,
138
],
[
138,
139
],
[
138,
140
],
[
137,
141
],
[
136,
142
],
[
133,
143
],
[
143,
144
],
[
144,
145
],
[
145,
146
],
[
146,
147
],
[
145,
148
],
[
148,
149
],
[
149,
150
],
[
148,
151
],
[
151,
152
],
[
152,
153
],
[
152,
154
],
[
151,
155
],
[
143,
156
],
[
120,
157
],
[
157,
158
],
[
158,
159
],
[
159,
160
],
[
160,
161
],
[
159,
162
],
[
162,
163
],
[
163,
164
],
[
162,
165
],
[
157,
166
],
[
120,
167
],
[
167,
168
],
[
167,
169
],
[
14,
170
],
[
170,
171
],
[
171,
172
],
[
172,
173
],
[
172,
174
],
[
170,
175
],
[
175,
176
],
[
175,
177
],
[
170,
178
],
[
178,
179
],
[
179,
180
],
[
170,
181
],
[
182,
182
],
[
182,
183
],
[
183,
184
],
[
184,
185
],
[
185,
186
],
[
185,
187
],
[
183,
188
],
[
188,
189
],
[
188,
190
],
[
183,
191
],
[
191,
192
],
[
192,
193
],
[
183,
194
],
[
195,
195
],
[
195,
196
],
[
196,
197
],
[
196,
198
],
[
198,
199
],
[
198,
200
],
[
200,
201
],
[
201,
202
],
[
201,
203
],
[
200,
204
],
[
182,
205
],
[
205,
206
],
[
206,
207
],
[
207,
208
],
[
208,
209
],
[
207,
210
],
[
210,
211
],
[
211,
212
],
[
210,
213
],
[
205,
214
],
[
182,
215
],
[
215,
216
],
[
215,
217
],
[
217,
218
],
[
217,
219
],
[
182,
220
],
[
220,
221
],
[
220,
222
],
[
14,
223
],
[
223,
224
],
[
224,
225
],
[
225,
226
],
[
226,
227
],
[
225,
228
],
[
228,
229
],
[
229,
230
],
[
228,
231
],
[
223,
232
],
[
14,
233
],
[
233,
234
],
[
234,
235
],
[
235,
236
],
[
235,
237
],
[
233,
238
],
[
12,
239
],
[
239,
240
],
[
0,
241
],
[
241,
242
],
[
241,
243
]
] | [
"import java.io.BufferedReader;\nimport java.io.IOException;\nimport java.io.InputStreamReader;\n\npublic class Main {\n\tpublic static void main(String[] age)throws IOException{\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\t\tStringBuffer sb = new StringBuffer();\n\n\t\tString[] input = br.readLine().split(\" \");\n\t\tint r = Integer.parseInt(input[0]);\n\t\tint c = Integer.parseInt(input[1]);\n\t\tint i = 0;\n\t\tint j = 0;\n\t\tint a = 0;\n\t\tint b = 0;\n\t\tint matrix[][] = new int[r][c];\n\n\t\tfor( i=0 ; i<r ; i++ ){\n\t\t\tinput = br.readLine().split(\" \");\n\t\t\tfor( j=0 ; j<c ; j++ ){\n\t\t\t\tmatrix[i][j] = Integer.parseInt(input[j]);\n\t\t\t}\n\t\t}\n\n\t\tfor( i=0 ; i<r ; i++){\n\t\t\tfor( j=0 ; j<c ; j++ ){\n\t\t\t\ta = matrix[i][j] + a;\n\t\t\t\tsb.append(Integer.toString(matrix[i][j])).append(\" \");\n\t\t\t}\n\t\t\tsb.append(Integer.toString(a)).append(\"\\n\");\n\t\t\ta = 0;\n\t\t}\n\n\t\tfor( i=0 ; i<c ; i++ ){\n\t\t\tfor( j=0 ; j<r ; j++ ){\n\t\t\t\ta = a + matrix[j][i];\n\t\t\t}\n\t\t\tsb.append(Integer.toString(a)).append(\" \");\n\t\t\tb = b + a;\n\t\t\ta = 0;\n\t\t}\n\n\t\tsb.append(Integer.toString(b)).append(\"\\n\");\n\t\tSystem.out.print(sb);\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[] age)throws IOException{\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\t\tStringBuffer sb = new StringBuffer();\n\n\t\tString[] input = br.readLine().split(\" \");\n\t\tint r = Integer.parseInt(input[0]);\n\t\tint c = Integer.parseInt(input[1]);\n\t\tint i = 0;\n\t\tint j = 0;\n\t\tint a = 0;\n\t\tint b = 0;\n\t\tint matrix[][] = new int[r][c];\n\n\t\tfor( i=0 ; i<r ; i++ ){\n\t\t\tinput = br.readLine().split(\" \");\n\t\t\tfor( j=0 ; j<c ; j++ ){\n\t\t\t\tmatrix[i][j] = Integer.parseInt(input[j]);\n\t\t\t}\n\t\t}\n\n\t\tfor( i=0 ; i<r ; i++){\n\t\t\tfor( j=0 ; j<c ; j++ ){\n\t\t\t\ta = matrix[i][j] + a;\n\t\t\t\tsb.append(Integer.toString(matrix[i][j])).append(\" \");\n\t\t\t}\n\t\t\tsb.append(Integer.toString(a)).append(\"\\n\");\n\t\t\ta = 0;\n\t\t}\n\n\t\tfor( i=0 ; i<c ; i++ ){\n\t\t\tfor( j=0 ; j<r ; j++ ){\n\t\t\t\ta = a + matrix[j][i];\n\t\t\t}\n\t\t\tsb.append(Integer.toString(a)).append(\" \");\n\t\t\tb = b + a;\n\t\t\ta = 0;\n\t\t}\n\n\t\tsb.append(Integer.toString(b)).append(\"\\n\");\n\t\tSystem.out.print(sb);\n\t}\n}",
"Main",
"public static void main(String[] age)throws IOException{\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\t\tStringBuffer sb = new StringBuffer();\n\n\t\tString[] input = br.readLine().split(\" \");\n\t\tint r = Integer.parseInt(input[0]);\n\t\tint c = Integer.parseInt(input[1]);\n\t\tint i = 0;\n\t\tint j = 0;\n\t\tint a = 0;\n\t\tint b = 0;\n\t\tint matrix[][] = new int[r][c];\n\n\t\tfor( i=0 ; i<r ; i++ ){\n\t\t\tinput = br.readLine().split(\" \");\n\t\t\tfor( j=0 ; j<c ; j++ ){\n\t\t\t\tmatrix[i][j] = Integer.parseInt(input[j]);\n\t\t\t}\n\t\t}\n\n\t\tfor( i=0 ; i<r ; i++){\n\t\t\tfor( j=0 ; j<c ; j++ ){\n\t\t\t\ta = matrix[i][j] + a;\n\t\t\t\tsb.append(Integer.toString(matrix[i][j])).append(\" \");\n\t\t\t}\n\t\t\tsb.append(Integer.toString(a)).append(\"\\n\");\n\t\t\ta = 0;\n\t\t}\n\n\t\tfor( i=0 ; i<c ; i++ ){\n\t\t\tfor( j=0 ; j<r ; j++ ){\n\t\t\t\ta = a + matrix[j][i];\n\t\t\t}\n\t\t\tsb.append(Integer.toString(a)).append(\" \");\n\t\t\tb = b + a;\n\t\t\ta = 0;\n\t\t}\n\n\t\tsb.append(Integer.toString(b)).append(\"\\n\");\n\t\tSystem.out.print(sb);\n\t}",
"main",
"{\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\t\tStringBuffer sb = new StringBuffer();\n\n\t\tString[] input = br.readLine().split(\" \");\n\t\tint r = Integer.parseInt(input[0]);\n\t\tint c = Integer.parseInt(input[1]);\n\t\tint i = 0;\n\t\tint j = 0;\n\t\tint a = 0;\n\t\tint b = 0;\n\t\tint matrix[][] = new int[r][c];\n\n\t\tfor( i=0 ; i<r ; i++ ){\n\t\t\tinput = br.readLine().split(\" \");\n\t\t\tfor( j=0 ; j<c ; j++ ){\n\t\t\t\tmatrix[i][j] = Integer.parseInt(input[j]);\n\t\t\t}\n\t\t}\n\n\t\tfor( i=0 ; i<r ; i++){\n\t\t\tfor( j=0 ; j<c ; j++ ){\n\t\t\t\ta = matrix[i][j] + a;\n\t\t\t\tsb.append(Integer.toString(matrix[i][j])).append(\" \");\n\t\t\t}\n\t\t\tsb.append(Integer.toString(a)).append(\"\\n\");\n\t\t\ta = 0;\n\t\t}\n\n\t\tfor( i=0 ; i<c ; i++ ){\n\t\t\tfor( j=0 ; j<r ; j++ ){\n\t\t\t\ta = a + matrix[j][i];\n\t\t\t}\n\t\t\tsb.append(Integer.toString(a)).append(\" \");\n\t\t\tb = b + a;\n\t\t\ta = 0;\n\t\t}\n\n\t\tsb.append(Integer.toString(b)).append(\"\\n\");\n\t\tSystem.out.print(sb);\n\t}",
"BufferedReader br = new BufferedReader(new InputStreamReader(System.in));",
"br",
"new BufferedReader(new InputStreamReader(System.in))",
"StringBuffer sb = new StringBuffer();",
"sb",
"new StringBuffer()",
"String[] input = br.readLine().split(\" \");",
"input",
"br.readLine().split(\" \")",
"br.readLine().split",
"br.readLine()",
"br.readLine",
"br",
"\" \"",
"int r = Integer.parseInt(input[0]);",
"r",
"Integer.parseInt(input[0])",
"Integer.parseInt",
"Integer",
"input[0]",
"input",
"0",
"int c = Integer.parseInt(input[1]);",
"c",
"Integer.parseInt(input[1])",
"Integer.parseInt",
"Integer",
"input[1]",
"input",
"1",
"int i = 0;",
"i",
"0",
"int j = 0;",
"j",
"0",
"int a = 0;",
"a",
"0",
"int b = 0;",
"b",
"0",
"int matrix[][] = new int[r][c];",
"matrix",
"new int[r][c]",
"r",
"c",
"for( i=0 ; i<r ; i++ ){\n\t\t\tinput = br.readLine().split(\" \");\n\t\t\tfor( j=0 ; j<c ; j++ ){\n\t\t\t\tmatrix[i][j] = Integer.parseInt(input[j]);\n\t\t\t}\n\t\t}",
"i=0 ;",
"i=0",
"i",
"0",
"i<r",
"i",
"r",
"i++",
"i++",
"i",
"{\n\t\t\tinput = br.readLine().split(\" \");\n\t\t\tfor( j=0 ; j<c ; j++ ){\n\t\t\t\tmatrix[i][j] = Integer.parseInt(input[j]);\n\t\t\t}\n\t\t}",
"{\n\t\t\tinput = br.readLine().split(\" \");\n\t\t\tfor( j=0 ; j<c ; j++ ){\n\t\t\t\tmatrix[i][j] = Integer.parseInt(input[j]);\n\t\t\t}\n\t\t}",
"input = br.readLine().split(\" \")",
"input",
"br.readLine().split(\" \")",
"br.readLine().split",
"br.readLine()",
"br.readLine",
"br",
"\" \"",
"for( j=0 ; j<c ; j++ ){\n\t\t\t\tmatrix[i][j] = Integer.parseInt(input[j]);\n\t\t\t}",
"j=0 ;",
"j=0",
"j",
"0",
"j<c",
"j",
"c",
"j++",
"j++",
"j",
"{\n\t\t\t\tmatrix[i][j] = Integer.parseInt(input[j]);\n\t\t\t}",
"{\n\t\t\t\tmatrix[i][j] = Integer.parseInt(input[j]);\n\t\t\t}",
"matrix[i][j] = Integer.parseInt(input[j])",
"matrix[i][j]",
"matrix[i]",
"matrix",
"i",
"j",
"Integer.parseInt(input[j])",
"Integer.parseInt",
"Integer",
"input[j]",
"input",
"j",
"for( i=0 ; i<r ; i++){\n\t\t\tfor( j=0 ; j<c ; j++ ){\n\t\t\t\ta = matrix[i][j] + a;\n\t\t\t\tsb.append(Integer.toString(matrix[i][j])).append(\" \");\n\t\t\t}\n\t\t\tsb.append(Integer.toString(a)).append(\"\\n\");\n\t\t\ta = 0;\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 = matrix[i][j] + a;\n\t\t\t\tsb.append(Integer.toString(matrix[i][j])).append(\" \");\n\t\t\t}\n\t\t\tsb.append(Integer.toString(a)).append(\"\\n\");\n\t\t\ta = 0;\n\t\t}",
"{\n\t\t\tfor( j=0 ; j<c ; j++ ){\n\t\t\t\ta = matrix[i][j] + a;\n\t\t\t\tsb.append(Integer.toString(matrix[i][j])).append(\" \");\n\t\t\t}\n\t\t\tsb.append(Integer.toString(a)).append(\"\\n\");\n\t\t\ta = 0;\n\t\t}",
"for( j=0 ; j<c ; j++ ){\n\t\t\t\ta = matrix[i][j] + a;\n\t\t\t\tsb.append(Integer.toString(matrix[i][j])).append(\" \");\n\t\t\t}",
"j=0 ;",
"j=0",
"j",
"0",
"j<c",
"j",
"c",
"j++",
"j++",
"j",
"{\n\t\t\t\ta = matrix[i][j] + a;\n\t\t\t\tsb.append(Integer.toString(matrix[i][j])).append(\" \");\n\t\t\t}",
"{\n\t\t\t\ta = matrix[i][j] + a;\n\t\t\t\tsb.append(Integer.toString(matrix[i][j])).append(\" \");\n\t\t\t}",
"a = matrix[i][j] + a",
"a",
"matrix[i][j] + a",
"matrix[i][j]",
"matrix[i]",
"matrix",
"i",
"j",
"a",
"sb.append(Integer.toString(matrix[i][j])).append(\" \")",
"sb.append(Integer.toString(matrix[i][j])).append",
"sb.append(Integer.toString(matrix[i][j]))",
"sb.append",
"sb",
"Integer.toString(matrix[i][j])",
"Integer.toString",
"Integer",
"matrix[i][j]",
"matrix[i]",
"matrix",
"i",
"j",
"\" \"",
"sb.append(Integer.toString(a)).append(\"\\n\")",
"sb.append(Integer.toString(a)).append",
"sb.append(Integer.toString(a))",
"sb.append",
"sb",
"Integer.toString(a)",
"Integer.toString",
"Integer",
"a",
"\"\\n\"",
"a = 0",
"a",
"0",
"for( i=0 ; i<c ; i++ ){\n\t\t\tfor( j=0 ; j<r ; j++ ){\n\t\t\t\ta = a + matrix[j][i];\n\t\t\t}\n\t\t\tsb.append(Integer.toString(a)).append(\" \");\n\t\t\tb = b + a;\n\t\t\ta = 0;\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++ ){\n\t\t\t\ta = a + matrix[j][i];\n\t\t\t}\n\t\t\tsb.append(Integer.toString(a)).append(\" \");\n\t\t\tb = b + a;\n\t\t\ta = 0;\n\t\t}",
"{\n\t\t\tfor( j=0 ; j<r ; j++ ){\n\t\t\t\ta = a + matrix[j][i];\n\t\t\t}\n\t\t\tsb.append(Integer.toString(a)).append(\" \");\n\t\t\tb = b + a;\n\t\t\ta = 0;\n\t\t}",
"for( j=0 ; j<r ; j++ ){\n\t\t\t\ta = a + matrix[j][i];\n\t\t\t}",
"j=0 ;",
"j=0",
"j",
"0",
"j<r",
"j",
"r",
"j++",
"j++",
"j",
"{\n\t\t\t\ta = a + matrix[j][i];\n\t\t\t}",
"{\n\t\t\t\ta = a + matrix[j][i];\n\t\t\t}",
"a = a + matrix[j][i]",
"a",
"a + matrix[j][i]",
"a",
"matrix[j][i]",
"matrix[j]",
"matrix",
"j",
"i",
"sb.append(Integer.toString(a)).append(\" \")",
"sb.append(Integer.toString(a)).append",
"sb.append(Integer.toString(a))",
"sb.append",
"sb",
"Integer.toString(a)",
"Integer.toString",
"Integer",
"a",
"\" \"",
"b = b + a",
"b",
"b + a",
"b",
"a",
"a = 0",
"a",
"0",
"sb.append(Integer.toString(b)).append(\"\\n\")",
"sb.append(Integer.toString(b)).append",
"sb.append(Integer.toString(b))",
"sb.append",
"sb",
"Integer.toString(b)",
"Integer.toString",
"Integer",
"b",
"\"\\n\"",
"System.out.print(sb)",
"System.out.print",
"System.out",
"System",
"System.out",
"sb",
"String[] age",
"age",
"public class Main {\n\tpublic static void main(String[] age)throws IOException{\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\t\tStringBuffer sb = new StringBuffer();\n\n\t\tString[] input = br.readLine().split(\" \");\n\t\tint r = Integer.parseInt(input[0]);\n\t\tint c = Integer.parseInt(input[1]);\n\t\tint i = 0;\n\t\tint j = 0;\n\t\tint a = 0;\n\t\tint b = 0;\n\t\tint matrix[][] = new int[r][c];\n\n\t\tfor( i=0 ; i<r ; i++ ){\n\t\t\tinput = br.readLine().split(\" \");\n\t\t\tfor( j=0 ; j<c ; j++ ){\n\t\t\t\tmatrix[i][j] = Integer.parseInt(input[j]);\n\t\t\t}\n\t\t}\n\n\t\tfor( i=0 ; i<r ; i++){\n\t\t\tfor( j=0 ; j<c ; j++ ){\n\t\t\t\ta = matrix[i][j] + a;\n\t\t\t\tsb.append(Integer.toString(matrix[i][j])).append(\" \");\n\t\t\t}\n\t\t\tsb.append(Integer.toString(a)).append(\"\\n\");\n\t\t\ta = 0;\n\t\t}\n\n\t\tfor( i=0 ; i<c ; i++ ){\n\t\t\tfor( j=0 ; j<r ; j++ ){\n\t\t\t\ta = a + matrix[j][i];\n\t\t\t}\n\t\t\tsb.append(Integer.toString(a)).append(\" \");\n\t\t\tb = b + a;\n\t\t\ta = 0;\n\t\t}\n\n\t\tsb.append(Integer.toString(b)).append(\"\\n\");\n\t\tSystem.out.print(sb);\n\t}\n}",
"public class Main {\n\tpublic static void main(String[] age)throws IOException{\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\t\tStringBuffer sb = new StringBuffer();\n\n\t\tString[] input = br.readLine().split(\" \");\n\t\tint r = Integer.parseInt(input[0]);\n\t\tint c = Integer.parseInt(input[1]);\n\t\tint i = 0;\n\t\tint j = 0;\n\t\tint a = 0;\n\t\tint b = 0;\n\t\tint matrix[][] = new int[r][c];\n\n\t\tfor( i=0 ; i<r ; i++ ){\n\t\t\tinput = br.readLine().split(\" \");\n\t\t\tfor( j=0 ; j<c ; j++ ){\n\t\t\t\tmatrix[i][j] = Integer.parseInt(input[j]);\n\t\t\t}\n\t\t}\n\n\t\tfor( i=0 ; i<r ; i++){\n\t\t\tfor( j=0 ; j<c ; j++ ){\n\t\t\t\ta = matrix[i][j] + a;\n\t\t\t\tsb.append(Integer.toString(matrix[i][j])).append(\" \");\n\t\t\t}\n\t\t\tsb.append(Integer.toString(a)).append(\"\\n\");\n\t\t\ta = 0;\n\t\t}\n\n\t\tfor( i=0 ; i<c ; i++ ){\n\t\t\tfor( j=0 ; j<r ; j++ ){\n\t\t\t\ta = a + matrix[j][i];\n\t\t\t}\n\t\t\tsb.append(Integer.toString(a)).append(\" \");\n\t\t\tb = b + a;\n\t\t\ta = 0;\n\t\t}\n\n\t\tsb.append(Integer.toString(b)).append(\"\\n\");\n\t\tSystem.out.print(sb);\n\t}\n}",
"Main"
] | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class Main {
public static void main(String[] age)throws IOException{
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
StringBuffer sb = new StringBuffer();
String[] input = br.readLine().split(" ");
int r = Integer.parseInt(input[0]);
int c = Integer.parseInt(input[1]);
int i = 0;
int j = 0;
int a = 0;
int b = 0;
int matrix[][] = new int[r][c];
for( i=0 ; i<r ; i++ ){
input = br.readLine().split(" ");
for( j=0 ; j<c ; j++ ){
matrix[i][j] = Integer.parseInt(input[j]);
}
}
for( i=0 ; i<r ; i++){
for( j=0 ; j<c ; j++ ){
a = matrix[i][j] + a;
sb.append(Integer.toString(matrix[i][j])).append(" ");
}
sb.append(Integer.toString(a)).append("\n");
a = 0;
}
for( i=0 ; i<c ; i++ ){
for( j=0 ; j<r ; j++ ){
a = a + matrix[j][i];
}
sb.append(Integer.toString(a)).append(" ");
b = b + a;
a = 0;
}
sb.append(Integer.toString(b)).append("\n");
System.out.print(sb);
}
} |
[
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,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
18,
18,
13,
13,
13,
4,
18,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
18,
18,
13,
13,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
18,
18,
13,
13,
13,
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,
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,
0,
18,
18,
13,
13,
13,
18,
18,
13,
13,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
4,
18,
18,
13,
13,
18,
18,
13,
13,
13,
14,
2,
13,
13,
4,
18,
18,
13,
13,
17,
4,
18,
18,
13,
13,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
269,
5
],
[
269,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
8,
14
],
[
14,
15
],
[
8,
16
],
[
16,
17
],
[
16,
18
],
[
18,
19
],
[
19,
20
],
[
8,
21
],
[
21,
22
],
[
21,
23
],
[
23,
24
],
[
24,
25
],
[
8,
26
],
[
26,
27
],
[
26,
28
],
[
29,
30
],
[
29,
31
],
[
32,
33
],
[
32,
34
],
[
8,
35
],
[
35,
36
],
[
36,
37
],
[
37,
38
],
[
37,
39
],
[
35,
40
],
[
40,
41
],
[
40,
42
],
[
35,
43
],
[
43,
44
],
[
44,
45
],
[
35,
46
],
[
47,
47
],
[
47,
48
],
[
48,
49
],
[
49,
50
],
[
50,
51
],
[
50,
52
],
[
48,
53
],
[
53,
54
],
[
53,
55
],
[
48,
56
],
[
56,
57
],
[
57,
58
],
[
48,
59
],
[
60,
60
],
[
60,
61
],
[
61,
62
],
[
62,
63
],
[
63,
64
],
[
63,
65
],
[
62,
66
],
[
61,
67
],
[
67,
68
],
[
68,
69
],
[
8,
70
],
[
70,
71
],
[
71,
72
],
[
72,
73
],
[
72,
74
],
[
70,
75
],
[
75,
76
],
[
75,
77
],
[
70,
78
],
[
78,
79
],
[
79,
80
],
[
70,
81
],
[
82,
82
],
[
82,
83
],
[
83,
84
],
[
84,
85
],
[
85,
86
],
[
85,
87
],
[
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
],
[
104,
108
],
[
103,
109
],
[
8,
110
],
[
110,
111
],
[
111,
112
],
[
112,
113
],
[
112,
114
],
[
111,
115
],
[
110,
116
],
[
8,
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
],
[
132,
133
],
[
132,
134
],
[
130,
135
],
[
135,
136
],
[
135,
137
],
[
130,
138
],
[
138,
139
],
[
139,
140
],
[
130,
141
],
[
142,
142
],
[
142,
143
],
[
143,
144
],
[
144,
145
],
[
145,
146
],
[
145,
147
],
[
144,
148
],
[
143,
149
],
[
149,
150
],
[
150,
151
],
[
150,
152
],
[
149,
153
],
[
8,
154
],
[
154,
155
],
[
155,
156
],
[
156,
157
],
[
156,
158
],
[
154,
159
],
[
159,
160
],
[
159,
161
],
[
154,
162
],
[
162,
163
],
[
163,
164
],
[
154,
165
],
[
166,
166
],
[
166,
167
],
[
167,
168
],
[
168,
169
],
[
169,
170
],
[
169,
171
],
[
167,
172
],
[
172,
173
],
[
172,
174
],
[
167,
175
],
[
175,
176
],
[
176,
177
],
[
167,
178
],
[
179,
179
],
[
179,
180
],
[
180,
181
],
[
181,
182
],
[
182,
183
],
[
182,
184
],
[
181,
185
],
[
180,
186
],
[
186,
187
],
[
187,
188
],
[
187,
189
],
[
186,
190
],
[
8,
191
],
[
191,
192
],
[
192,
193
],
[
193,
194
],
[
193,
195
],
[
191,
196
],
[
196,
197
],
[
196,
198
],
[
191,
199
],
[
199,
200
],
[
200,
201
],
[
191,
202
],
[
203,
203
],
[
203,
204
],
[
204,
205
],
[
205,
206
],
[
206,
207
],
[
206,
208
],
[
205,
209
],
[
204,
210
],
[
210,
211
],
[
211,
212
],
[
211,
213
],
[
210,
214
],
[
8,
215
],
[
215,
216
],
[
216,
217
],
[
217,
218
],
[
217,
219
],
[
215,
220
],
[
220,
221
],
[
220,
222
],
[
215,
223
],
[
223,
224
],
[
224,
225
],
[
215,
226
],
[
227,
227
],
[
227,
228
],
[
228,
229
],
[
229,
230
],
[
230,
231
],
[
230,
232
],
[
228,
233
],
[
233,
234
],
[
233,
235
],
[
228,
236
],
[
236,
237
],
[
237,
238
],
[
228,
239
],
[
240,
240
],
[
240,
241
],
[
241,
242
],
[
242,
243
],
[
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
],
[
257,
259
],
[
255,
260
],
[
227,
261
],
[
261,
262
],
[
262,
263
],
[
263,
264
],
[
263,
265
],
[
6,
266
],
[
266,
267
],
[
0,
268
],
[
268,
269
],
[
268,
270
]
] | [
"import java.util.Scanner;\npublic class Main{\n public static void main(String args[]){\n\tScanner in =new Scanner(System.in);\n\n\tint r,c;\n\n\tr = in.nextInt();\n\tc = in.nextInt();\n\n\tint[][] table = new int[r+1][c+1];\n\n\tfor(int i=0;i<r;i++){\n\t for(int j=0;j<c;j++){\n\t\ttable[i][j] = in.nextInt();\n\t }\n\t}\n\n\t//0で初期化\n\tfor(int i=0;i<r;i++){\n\t table[i][c]=0;\n\t}\n\tfor(int j=0;j<c;j++){\n\t table[r][j]=0;\n\t}\n\ttable[r][c]=0;\n\t\n\t//行の合計\n\tfor(int i=0;i<r;i++){\n\t for(int j=0;j<c;j++){\n\t table[i][c]+=table[i][j];\n\t }\n\t}\n\t//列の合計\n\tfor(int j=0;j<c;j++){\n\t for(int i=0;i<r;i++){\n\t table[r][j]+=table[i][j];\n\t }\n\t}\n\t//全要素の合計\n\tfor(int i=0;i<r;i++){\n\t table[r][c]+=table[i][c];\n\t}\n\n\n\tfor(int i=0;i<=r;i++){\n\t for(int j=0;j<=c;j++){\n\t\tSystem.out.print(table[i][j]);\n\t\tif(j!=c)System.out.print(\" \");\n\t }\n\t System.out.println();\n\t}\n }\n}\n\t",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main{\n public static void main(String args[]){\n\tScanner in =new Scanner(System.in);\n\n\tint r,c;\n\n\tr = in.nextInt();\n\tc = in.nextInt();\n\n\tint[][] table = new int[r+1][c+1];\n\n\tfor(int i=0;i<r;i++){\n\t for(int j=0;j<c;j++){\n\t\ttable[i][j] = in.nextInt();\n\t }\n\t}\n\n\t//0で初期化\n\tfor(int i=0;i<r;i++){\n\t table[i][c]=0;\n\t}\n\tfor(int j=0;j<c;j++){\n\t table[r][j]=0;\n\t}\n\ttable[r][c]=0;\n\t\n\t//行の合計\n\tfor(int i=0;i<r;i++){\n\t for(int j=0;j<c;j++){\n\t table[i][c]+=table[i][j];\n\t }\n\t}\n\t//列の合計\n\tfor(int j=0;j<c;j++){\n\t for(int i=0;i<r;i++){\n\t table[r][j]+=table[i][j];\n\t }\n\t}\n\t//全要素の合計\n\tfor(int i=0;i<r;i++){\n\t table[r][c]+=table[i][c];\n\t}\n\n\n\tfor(int i=0;i<=r;i++){\n\t for(int j=0;j<=c;j++){\n\t\tSystem.out.print(table[i][j]);\n\t\tif(j!=c)System.out.print(\" \");\n\t }\n\t System.out.println();\n\t}\n }\n}",
"Main",
"public static void main(String args[]){\n\tScanner in =new Scanner(System.in);\n\n\tint r,c;\n\n\tr = in.nextInt();\n\tc = in.nextInt();\n\n\tint[][] table = new int[r+1][c+1];\n\n\tfor(int i=0;i<r;i++){\n\t for(int j=0;j<c;j++){\n\t\ttable[i][j] = in.nextInt();\n\t }\n\t}\n\n\t//0で初期化\n\tfor(int i=0;i<r;i++){\n\t table[i][c]=0;\n\t}\n\tfor(int j=0;j<c;j++){\n\t table[r][j]=0;\n\t}\n\ttable[r][c]=0;\n\t\n\t//行の合計\n\tfor(int i=0;i<r;i++){\n\t for(int j=0;j<c;j++){\n\t table[i][c]+=table[i][j];\n\t }\n\t}\n\t//列の合計\n\tfor(int j=0;j<c;j++){\n\t for(int i=0;i<r;i++){\n\t table[r][j]+=table[i][j];\n\t }\n\t}\n\t//全要素の合計\n\tfor(int i=0;i<r;i++){\n\t table[r][c]+=table[i][c];\n\t}\n\n\n\tfor(int i=0;i<=r;i++){\n\t for(int j=0;j<=c;j++){\n\t\tSystem.out.print(table[i][j]);\n\t\tif(j!=c)System.out.print(\" \");\n\t }\n\t System.out.println();\n\t}\n }",
"main",
"{\n\tScanner in =new Scanner(System.in);\n\n\tint r,c;\n\n\tr = in.nextInt();\n\tc = in.nextInt();\n\n\tint[][] table = new int[r+1][c+1];\n\n\tfor(int i=0;i<r;i++){\n\t for(int j=0;j<c;j++){\n\t\ttable[i][j] = in.nextInt();\n\t }\n\t}\n\n\t//0で初期化\n\tfor(int i=0;i<r;i++){\n\t table[i][c]=0;\n\t}\n\tfor(int j=0;j<c;j++){\n\t table[r][j]=0;\n\t}\n\ttable[r][c]=0;\n\t\n\t//行の合計\n\tfor(int i=0;i<r;i++){\n\t for(int j=0;j<c;j++){\n\t table[i][c]+=table[i][j];\n\t }\n\t}\n\t//列の合計\n\tfor(int j=0;j<c;j++){\n\t for(int i=0;i<r;i++){\n\t table[r][j]+=table[i][j];\n\t }\n\t}\n\t//全要素の合計\n\tfor(int i=0;i<r;i++){\n\t table[r][c]+=table[i][c];\n\t}\n\n\n\tfor(int i=0;i<=r;i++){\n\t for(int j=0;j<=c;j++){\n\t\tSystem.out.print(table[i][j]);\n\t\tif(j!=c)System.out.print(\" \");\n\t }\n\t System.out.println();\n\t}\n }",
"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 for(int j=0;j<c;j++){\n\t\ttable[i][j] = in.nextInt();\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\ttable[i][j] = in.nextInt();\n\t }\n\t}",
"{\n\t for(int j=0;j<c;j++){\n\t\ttable[i][j] = in.nextInt();\n\t }\n\t}",
"for(int j=0;j<c;j++){\n\t\ttable[i][j] = in.nextInt();\n\t }",
"int j=0;",
"int j=0;",
"j",
"0",
"j<c",
"j",
"c",
"j++",
"j++",
"j",
"{\n\t\ttable[i][j] = in.nextInt();\n\t }",
"{\n\t\ttable[i][j] = in.nextInt();\n\t }",
"table[i][j] = in.nextInt()",
"table[i][j]",
"table[i]",
"table",
"i",
"j",
"in.nextInt()",
"in.nextInt",
"in",
"for(int i=0;i<r;i++){\n\t table[i][c]=0;\n\t}",
"int i=0;",
"int i=0;",
"i",
"0",
"i<r",
"i",
"r",
"i++",
"i++",
"i",
"{\n\t table[i][c]=0;\n\t}",
"{\n\t table[i][c]=0;\n\t}",
"table[i][c]=0",
"table[i][c]",
"table[i]",
"table",
"i",
"c",
"0",
"for(int j=0;j<c;j++){\n\t table[r][j]=0;\n\t}",
"int j=0;",
"int j=0;",
"j",
"0",
"j<c",
"j",
"c",
"j++",
"j++",
"j",
"{\n\t table[r][j]=0;\n\t}",
"{\n\t table[r][j]=0;\n\t}",
"table[r][j]=0",
"table[r][j]",
"table[r]",
"table",
"r",
"j",
"0",
"table[r][c]=0",
"table[r][c]",
"table[r]",
"table",
"r",
"c",
"0",
"for(int i=0;i<r;i++){\n\t for(int j=0;j<c;j++){\n\t table[i][c]+=table[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 table[i][c]+=table[i][j];\n\t }\n\t}",
"{\n\t for(int j=0;j<c;j++){\n\t table[i][c]+=table[i][j];\n\t }\n\t}",
"for(int j=0;j<c;j++){\n\t table[i][c]+=table[i][j];\n\t }",
"int j=0;",
"int j=0;",
"j",
"0",
"j<c",
"j",
"c",
"j++",
"j++",
"j",
"{\n\t table[i][c]+=table[i][j];\n\t }",
"{\n\t table[i][c]+=table[i][j];\n\t }",
"table[i][c]+=table[i][j]",
"table[i][c]",
"table[i]",
"table",
"i",
"c",
"table[i][j]",
"table[i]",
"table",
"i",
"j",
"for(int j=0;j<c;j++){\n\t for(int i=0;i<r;i++){\n\t table[r][j]+=table[i][j];\n\t }\n\t}",
"int j=0;",
"int j=0;",
"j",
"0",
"j<c",
"j",
"c",
"j++",
"j++",
"j",
"{\n\t for(int i=0;i<r;i++){\n\t table[r][j]+=table[i][j];\n\t }\n\t}",
"{\n\t for(int i=0;i<r;i++){\n\t table[r][j]+=table[i][j];\n\t }\n\t}",
"for(int i=0;i<r;i++){\n\t table[r][j]+=table[i][j];\n\t }",
"int i=0;",
"int i=0;",
"i",
"0",
"i<r",
"i",
"r",
"i++",
"i++",
"i",
"{\n\t table[r][j]+=table[i][j];\n\t }",
"{\n\t table[r][j]+=table[i][j];\n\t }",
"table[r][j]+=table[i][j]",
"table[r][j]",
"table[r]",
"table",
"r",
"j",
"table[i][j]",
"table[i]",
"table",
"i",
"j",
"for(int i=0;i<r;i++){\n\t table[r][c]+=table[i][c];\n\t}",
"int i=0;",
"int i=0;",
"i",
"0",
"i<r",
"i",
"r",
"i++",
"i++",
"i",
"{\n\t table[r][c]+=table[i][c];\n\t}",
"{\n\t table[r][c]+=table[i][c];\n\t}",
"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 for(int j=0;j<=c;j++){\n\t\tSystem.out.print(table[i][j]);\n\t\tif(j!=c)System.out.print(\" \");\n\t }\n\t System.out.println();\n\t}",
"int i=0;",
"int i=0;",
"i",
"0",
"i<=r",
"i",
"r",
"i++",
"i++",
"i",
"{\n\t for(int j=0;j<=c;j++){\n\t\tSystem.out.print(table[i][j]);\n\t\tif(j!=c)System.out.print(\" \");\n\t }\n\t System.out.println();\n\t}",
"{\n\t for(int j=0;j<=c;j++){\n\t\tSystem.out.print(table[i][j]);\n\t\tif(j!=c)System.out.print(\" \");\n\t }\n\t System.out.println();\n\t}",
"for(int j=0;j<=c;j++){\n\t\tSystem.out.print(table[i][j]);\n\t\tif(j!=c)System.out.print(\" \");\n\t }",
"int j=0;",
"int j=0;",
"j",
"0",
"j<=c",
"j",
"c",
"j++",
"j++",
"j",
"{\n\t\tSystem.out.print(table[i][j]);\n\t\tif(j!=c)System.out.print(\" \");\n\t }",
"{\n\t\tSystem.out.print(table[i][j]);\n\t\tif(j!=c)System.out.print(\" \");\n\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!=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 public static void main(String args[]){\n\tScanner in =new Scanner(System.in);\n\n\tint r,c;\n\n\tr = in.nextInt();\n\tc = in.nextInt();\n\n\tint[][] table = new int[r+1][c+1];\n\n\tfor(int i=0;i<r;i++){\n\t for(int j=0;j<c;j++){\n\t\ttable[i][j] = in.nextInt();\n\t }\n\t}\n\n\t//0で初期化\n\tfor(int i=0;i<r;i++){\n\t table[i][c]=0;\n\t}\n\tfor(int j=0;j<c;j++){\n\t table[r][j]=0;\n\t}\n\ttable[r][c]=0;\n\t\n\t//行の合計\n\tfor(int i=0;i<r;i++){\n\t for(int j=0;j<c;j++){\n\t table[i][c]+=table[i][j];\n\t }\n\t}\n\t//列の合計\n\tfor(int j=0;j<c;j++){\n\t for(int i=0;i<r;i++){\n\t table[r][j]+=table[i][j];\n\t }\n\t}\n\t//全要素の合計\n\tfor(int i=0;i<r;i++){\n\t table[r][c]+=table[i][c];\n\t}\n\n\n\tfor(int i=0;i<=r;i++){\n\t for(int j=0;j<=c;j++){\n\t\tSystem.out.print(table[i][j]);\n\t\tif(j!=c)System.out.print(\" \");\n\t }\n\t System.out.println();\n\t}\n }\n}",
"public class Main{\n public static void main(String args[]){\n\tScanner in =new Scanner(System.in);\n\n\tint r,c;\n\n\tr = in.nextInt();\n\tc = in.nextInt();\n\n\tint[][] table = new int[r+1][c+1];\n\n\tfor(int i=0;i<r;i++){\n\t for(int j=0;j<c;j++){\n\t\ttable[i][j] = in.nextInt();\n\t }\n\t}\n\n\t//0で初期化\n\tfor(int i=0;i<r;i++){\n\t table[i][c]=0;\n\t}\n\tfor(int j=0;j<c;j++){\n\t table[r][j]=0;\n\t}\n\ttable[r][c]=0;\n\t\n\t//行の合計\n\tfor(int i=0;i<r;i++){\n\t for(int j=0;j<c;j++){\n\t table[i][c]+=table[i][j];\n\t }\n\t}\n\t//列の合計\n\tfor(int j=0;j<c;j++){\n\t for(int i=0;i<r;i++){\n\t table[r][j]+=table[i][j];\n\t }\n\t}\n\t//全要素の合計\n\tfor(int i=0;i<r;i++){\n\t table[r][c]+=table[i][c];\n\t}\n\n\n\tfor(int i=0;i<=r;i++){\n\t for(int j=0;j<=c;j++){\n\t\tSystem.out.print(table[i][j]);\n\t\tif(j!=c)System.out.print(\" \");\n\t }\n\t System.out.println();\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 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();
}
}
//0で初期化
for(int i=0;i<r;i++){
table[i][c]=0;
}
for(int j=0;j<c;j++){
table[r][j]=0;
}
table[r][c]=0;
//行の合計
for(int i=0;i<r;i++){
for(int j=0;j<c;j++){
table[i][c]+=table[i][j];
}
}
//列の合計
for(int j=0;j<c;j++){
for(int i=0;i<r;i++){
table[r][j]+=table[i][j];
}
}
//全要素の合計
for(int i=0;i<r;i++){
table[r][c]+=table[i][c];
}
for(int i=0;i<=r;i++){
for(int j=0;j<=c;j++){
System.out.print(table[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,
41,
13,
41,
13,
20,
2,
13,
17,
2,
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,
0,
18,
18,
13,
13,
13,
13,
11,
1,
41,
13,
17,
2,
13,
2,
13,
17,
1,
40,
13,
30,
30,
0,
13,
17,
11,
1,
41,
13,
17,
2,
13,
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,
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
],
[
193,
5
],
[
193,
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
],
[
29,
30
],
[
29,
31
],
[
32,
33
],
[
32,
34
],
[
8,
35
],
[
35,
36
],
[
36,
37
],
[
37,
38
],
[
37,
39
],
[
35,
40
],
[
40,
41
],
[
40,
42
],
[
35,
43
],
[
43,
44
],
[
44,
45
],
[
35,
46
],
[
47,
47
],
[
47,
48
],
[
48,
49
],
[
48,
50
],
[
47,
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
],
[
65,
69
],
[
64,
70
],
[
70,
71
],
[
71,
72
],
[
63,
73
],
[
73,
74
],
[
73,
75
],
[
75,
76
],
[
76,
77
],
[
76,
78
],
[
75,
79
],
[
47,
80
],
[
80,
81
],
[
81,
82
],
[
82,
83
],
[
82,
84
],
[
81,
85
],
[
80,
86
],
[
8,
87
],
[
87,
88
],
[
88,
89
],
[
89,
90
],
[
89,
91
],
[
87,
92
],
[
92,
93
],
[
92,
94
],
[
94,
95
],
[
94,
96
],
[
87,
97
],
[
97,
98
],
[
98,
99
],
[
87,
100
],
[
101,
101
],
[
101,
102
],
[
102,
103
],
[
102,
104
],
[
101,
105
],
[
105,
106
],
[
106,
107
],
[
107,
108
],
[
107,
109
],
[
105,
110
],
[
110,
111
],
[
110,
112
],
[
105,
113
],
[
113,
114
],
[
114,
115
],
[
105,
116
],
[
117,
117
],
[
117,
118
],
[
118,
119
],
[
118,
120
],
[
120,
121
],
[
121,
122
],
[
121,
123
],
[
120,
124
],
[
101,
125
],
[
125,
126
],
[
126,
127
],
[
127,
128
],
[
127,
129
],
[
126,
130
],
[
125,
131
],
[
8,
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
],
[
154,
156
],
[
147,
157
],
[
157,
158
],
[
158,
159
],
[
147,
160
],
[
161,
161
],
[
161,
162
],
[
162,
163
],
[
163,
164
],
[
163,
165
],
[
162,
166
],
[
166,
167
],
[
167,
168
],
[
168,
169
],
[
169,
170
],
[
169,
171
],
[
167,
172
],
[
172,
173
],
[
173,
174
],
[
173,
175
],
[
172,
176
],
[
162,
177
],
[
177,
178
],
[
178,
179
],
[
179,
180
],
[
180,
181
],
[
180,
182
],
[
178,
183
],
[
183,
184
],
[
184,
185
],
[
185,
186
],
[
185,
187
],
[
184,
188
],
[
183,
189
],
[
6,
190
],
[
190,
191
],
[
0,
192
],
[
192,
193
],
[
192,
194
]
] | [
"import java.util.*;\n\npublic class Main {\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n int r = sc.nextInt();\n int c = sc.nextInt();\n int line;\n int row;\n int[][] matrix = new int[r + 1][c + 1];\n for(int i = 0; i < r; i++) {\n line = 0;\n for(int j = 0; j < c; j++) {\n matrix[i][j] = sc.nextInt();\n line += matrix[i][j];\n }\n matrix[i][c] = line;\n }\n for(int i = 0; i < c + 1; i++) {\n row = 0;\n for(int j = 0; j < r; j++) {\n row += matrix[j][i];\n }\n matrix[r][i] = row;\n }\n for(int i = 0; i < r + 1; i++) {\n for(int j = 0; j < c + 1; j++) {\n if(j == c) {\n System.out.println(matrix[i][j]);\n } else {\n System.out.print(matrix[i][j] + \" \");\n }\n }\n }\n }\n}\n",
"import java.util.*;",
"util.*",
"java",
"public class Main {\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n int r = sc.nextInt();\n int c = sc.nextInt();\n int line;\n int row;\n int[][] matrix = new int[r + 1][c + 1];\n for(int i = 0; i < r; i++) {\n line = 0;\n for(int j = 0; j < c; j++) {\n matrix[i][j] = sc.nextInt();\n line += matrix[i][j];\n }\n matrix[i][c] = line;\n }\n for(int i = 0; i < c + 1; i++) {\n row = 0;\n for(int j = 0; j < r; j++) {\n row += matrix[j][i];\n }\n matrix[r][i] = row;\n }\n for(int i = 0; i < r + 1; i++) {\n for(int j = 0; j < c + 1; j++) {\n if(j == c) {\n System.out.println(matrix[i][j]);\n } else {\n System.out.print(matrix[i][j] + \" \");\n }\n }\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 line;\n int row;\n int[][] matrix = new int[r + 1][c + 1];\n for(int i = 0; i < r; i++) {\n line = 0;\n for(int j = 0; j < c; j++) {\n matrix[i][j] = sc.nextInt();\n line += matrix[i][j];\n }\n matrix[i][c] = line;\n }\n for(int i = 0; i < c + 1; i++) {\n row = 0;\n for(int j = 0; j < r; j++) {\n row += matrix[j][i];\n }\n matrix[r][i] = row;\n }\n for(int i = 0; i < r + 1; i++) {\n for(int j = 0; j < c + 1; j++) {\n if(j == c) {\n System.out.println(matrix[i][j]);\n } else {\n System.out.print(matrix[i][j] + \" \");\n }\n }\n }\n }",
"main",
"{\n Scanner sc = new Scanner(System.in);\n int r = sc.nextInt();\n int c = sc.nextInt();\n int line;\n int row;\n int[][] matrix = new int[r + 1][c + 1];\n for(int i = 0; i < r; i++) {\n line = 0;\n for(int j = 0; j < c; j++) {\n matrix[i][j] = sc.nextInt();\n line += matrix[i][j];\n }\n matrix[i][c] = line;\n }\n for(int i = 0; i < c + 1; i++) {\n row = 0;\n for(int j = 0; j < r; j++) {\n row += matrix[j][i];\n }\n matrix[r][i] = row;\n }\n for(int i = 0; i < r + 1; i++) {\n for(int j = 0; j < c + 1; j++) {\n if(j == c) {\n System.out.println(matrix[i][j]);\n } else {\n System.out.print(matrix[i][j] + \" \");\n }\n }\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 line;",
"line",
"int row;",
"row",
"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 line = 0;\n for(int j = 0; j < c; j++) {\n matrix[i][j] = sc.nextInt();\n line += matrix[i][j];\n }\n matrix[i][c] = line;\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < r",
"i",
"r",
"i++",
"i++",
"i",
"{\n line = 0;\n for(int j = 0; j < c; j++) {\n matrix[i][j] = sc.nextInt();\n line += matrix[i][j];\n }\n matrix[i][c] = line;\n }",
"{\n line = 0;\n for(int j = 0; j < c; j++) {\n matrix[i][j] = sc.nextInt();\n line += matrix[i][j];\n }\n matrix[i][c] = line;\n }",
"line = 0",
"line",
"0",
"for(int j = 0; j < c; j++) {\n matrix[i][j] = sc.nextInt();\n line += matrix[i][j];\n }",
"int j = 0;",
"int j = 0;",
"j",
"0",
"j < c",
"j",
"c",
"j++",
"j++",
"j",
"{\n matrix[i][j] = sc.nextInt();\n line += matrix[i][j];\n }",
"{\n matrix[i][j] = sc.nextInt();\n line += matrix[i][j];\n }",
"matrix[i][j] = sc.nextInt()",
"matrix[i][j]",
"matrix[i]",
"matrix",
"i",
"j",
"sc.nextInt()",
"sc.nextInt",
"sc",
"line += matrix[i][j]",
"line",
"matrix[i][j]",
"matrix[i]",
"matrix",
"i",
"j",
"matrix[i][c] = line",
"matrix[i][c]",
"matrix[i]",
"matrix",
"i",
"c",
"line",
"for(int i = 0; i < c + 1; i++) {\n row = 0;\n for(int j = 0; j < r; j++) {\n row += matrix[j][i];\n }\n matrix[r][i] = row;\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < c + 1",
"i",
"c + 1",
"c",
"1",
"i++",
"i++",
"i",
"{\n row = 0;\n for(int j = 0; j < r; j++) {\n row += matrix[j][i];\n }\n matrix[r][i] = row;\n }",
"{\n row = 0;\n for(int j = 0; j < r; j++) {\n row += matrix[j][i];\n }\n matrix[r][i] = row;\n }",
"row = 0",
"row",
"0",
"for(int j = 0; j < r; j++) {\n row += matrix[j][i];\n }",
"int j = 0;",
"int j = 0;",
"j",
"0",
"j < r",
"j",
"r",
"j++",
"j++",
"j",
"{\n row += matrix[j][i];\n }",
"{\n row += matrix[j][i];\n }",
"row += matrix[j][i]",
"row",
"matrix[j][i]",
"matrix[j]",
"matrix",
"j",
"i",
"matrix[r][i] = row",
"matrix[r][i]",
"matrix[r]",
"matrix",
"r",
"i",
"row",
"for(int i = 0; i < r + 1; i++) {\n for(int j = 0; j < c + 1; j++) {\n if(j == c) {\n System.out.println(matrix[i][j]);\n } else {\n System.out.print(matrix[i][j] + \" \");\n }\n }\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < r + 1",
"i",
"r + 1",
"r",
"1",
"i++",
"i++",
"i",
"{\n for(int j = 0; j < c + 1; j++) {\n if(j == c) {\n System.out.println(matrix[i][j]);\n } else {\n System.out.print(matrix[i][j] + \" \");\n }\n }\n }",
"{\n for(int j = 0; j < c + 1; j++) {\n if(j == c) {\n System.out.println(matrix[i][j]);\n } else {\n System.out.print(matrix[i][j] + \" \");\n }\n }\n }",
"for(int j = 0; j < c + 1; j++) {\n if(j == c) {\n System.out.println(matrix[i][j]);\n } else {\n System.out.print(matrix[i][j] + \" \");\n }\n }",
"int j = 0;",
"int j = 0;",
"j",
"0",
"j < c + 1",
"j",
"c + 1",
"c",
"1",
"j++",
"j++",
"j",
"{\n if(j == c) {\n System.out.println(matrix[i][j]);\n } else {\n System.out.print(matrix[i][j] + \" \");\n }\n }",
"{\n if(j == c) {\n System.out.println(matrix[i][j]);\n } else {\n System.out.print(matrix[i][j] + \" \");\n }\n }",
"if(j == c) {\n System.out.println(matrix[i][j]);\n } else {\n System.out.print(matrix[i][j] + \" \");\n }",
"j == c",
"j",
"c",
"{\n System.out.println(matrix[i][j]);\n }",
"System.out.println(matrix[i][j])",
"System.out.println",
"System.out",
"System",
"System.out",
"matrix[i][j]",
"matrix[i]",
"matrix",
"i",
"j",
"{\n System.out.print(matrix[i][j] + \" \");\n }",
"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",
"\" \"",
"String[] args",
"args",
"public class Main {\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n int r = sc.nextInt();\n int c = sc.nextInt();\n int line;\n int row;\n int[][] matrix = new int[r + 1][c + 1];\n for(int i = 0; i < r; i++) {\n line = 0;\n for(int j = 0; j < c; j++) {\n matrix[i][j] = sc.nextInt();\n line += matrix[i][j];\n }\n matrix[i][c] = line;\n }\n for(int i = 0; i < c + 1; i++) {\n row = 0;\n for(int j = 0; j < r; j++) {\n row += matrix[j][i];\n }\n matrix[r][i] = row;\n }\n for(int i = 0; i < r + 1; i++) {\n for(int j = 0; j < c + 1; j++) {\n if(j == c) {\n System.out.println(matrix[i][j]);\n } else {\n System.out.print(matrix[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 int r = sc.nextInt();\n int c = sc.nextInt();\n int line;\n int row;\n int[][] matrix = new int[r + 1][c + 1];\n for(int i = 0; i < r; i++) {\n line = 0;\n for(int j = 0; j < c; j++) {\n matrix[i][j] = sc.nextInt();\n line += matrix[i][j];\n }\n matrix[i][c] = line;\n }\n for(int i = 0; i < c + 1; i++) {\n row = 0;\n for(int j = 0; j < r; j++) {\n row += matrix[j][i];\n }\n matrix[r][i] = row;\n }\n for(int i = 0; i < r + 1; i++) {\n for(int j = 0; j < c + 1; j++) {\n if(j == c) {\n System.out.println(matrix[i][j]);\n } else {\n System.out.print(matrix[i][j] + \" \");\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 = sc.nextInt();
int c = sc.nextInt();
int line;
int row;
int[][] matrix = new int[r + 1][c + 1];
for(int i = 0; i < r; i++) {
line = 0;
for(int j = 0; j < c; j++) {
matrix[i][j] = sc.nextInt();
line += matrix[i][j];
}
matrix[i][c] = line;
}
for(int i = 0; i < c + 1; i++) {
row = 0;
for(int j = 0; j < r; j++) {
row += matrix[j][i];
}
matrix[r][i] = row;
}
for(int i = 0; i < r + 1; i++) {
for(int j = 0; j < c + 1; j++) {
if(j == c) {
System.out.println(matrix[i][j]);
} else {
System.out.print(matrix[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,
11,
1,
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,
11,
1,
41,
13,
17,
2,
13,
2,
13,
17,
1,
40,
13,
30,
30,
14,
2,
13,
13,
30,
4,
18,
18,
13,
13,
2,
18,
18,
13,
13,
13,
17,
30,
4,
18,
18,
13,
13,
18,
18,
13,
13,
13,
23,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
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
],
[
110,
111
],
[
110,
112
],
[
103,
113
],
[
113,
114
],
[
114,
115
],
[
103,
116
],
[
117,
117
],
[
117,
118
],
[
118,
119
],
[
119,
120
],
[
120,
121
],
[
120,
122
],
[
118,
123
],
[
123,
124
],
[
123,
125
],
[
118,
126
],
[
126,
127
],
[
127,
128
],
[
118,
129
],
[
130,
130
],
[
130,
131
],
[
131,
132
],
[
132,
133
],
[
133,
134
],
[
133,
135
],
[
132,
136
],
[
131,
137
],
[
137,
138
],
[
138,
139
],
[
138,
140
],
[
137,
141
],
[
8,
142
],
[
142,
143
],
[
143,
144
],
[
144,
145
],
[
144,
146
],
[
142,
147
],
[
147,
148
],
[
147,
149
],
[
149,
150
],
[
149,
151
],
[
142,
152
],
[
152,
153
],
[
153,
154
],
[
142,
155
],
[
156,
156
],
[
156,
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
],
[
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
]
] | [
"import java.util.Scanner;\n\nclass Main{\n public static void main(String[] args){\n \tScanner scan = new Scanner(System.in);\n \tint r = scan.nextInt();\n \tint c = scan.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\tnum[i][j] = scan.nextInt();\n \t}\n \t}\n \t\n \tfor(int i = 0; i < r; i++){\n \t\tfor(int j = 0; j < c; j++){\n \t\t\tnum[i][c] += num[i][j];\n \t\t}\n \t}\n \tfor(int j = 0; j < c + 1; j++){\n \t\tfor(int i = 0; i < r; i++){\n \t\t\tnum[r][j] += num[i][j];\n \t\t}\n \t}\n \t\n \tfor(int i = 0; i < r + 1; i++){\n \t\tfor(int j = 0; j < c + 1; j++){\n \t\t\tif(j != c){\n \t\t\t\tSystem.out.print(num[i][j] + \" \");\n \t\t\t}else{\n \t\t\t\tSystem.out.println(num[i][j]);\n \t\t\t}\n \t\t}\n \t}\n }\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"class Main{\n public static void main(String[] args){\n \tScanner scan = new Scanner(System.in);\n \tint r = scan.nextInt();\n \tint c = scan.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\tnum[i][j] = scan.nextInt();\n \t}\n \t}\n \t\n \tfor(int i = 0; i < r; i++){\n \t\tfor(int j = 0; j < c; j++){\n \t\t\tnum[i][c] += num[i][j];\n \t\t}\n \t}\n \tfor(int j = 0; j < c + 1; j++){\n \t\tfor(int i = 0; i < r; i++){\n \t\t\tnum[r][j] += num[i][j];\n \t\t}\n \t}\n \t\n \tfor(int i = 0; i < r + 1; i++){\n \t\tfor(int j = 0; j < c + 1; j++){\n \t\t\tif(j != c){\n \t\t\t\tSystem.out.print(num[i][j] + \" \");\n \t\t\t}else{\n \t\t\t\tSystem.out.println(num[i][j]);\n \t\t\t}\n \t\t}\n \t}\n }\n}",
"Main",
"public static void main(String[] args){\n \tScanner scan = new Scanner(System.in);\n \tint r = scan.nextInt();\n \tint c = scan.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\tnum[i][j] = scan.nextInt();\n \t}\n \t}\n \t\n \tfor(int i = 0; i < r; i++){\n \t\tfor(int j = 0; j < c; j++){\n \t\t\tnum[i][c] += num[i][j];\n \t\t}\n \t}\n \tfor(int j = 0; j < c + 1; j++){\n \t\tfor(int i = 0; i < r; i++){\n \t\t\tnum[r][j] += num[i][j];\n \t\t}\n \t}\n \t\n \tfor(int i = 0; i < r + 1; i++){\n \t\tfor(int j = 0; j < c + 1; j++){\n \t\t\tif(j != c){\n \t\t\t\tSystem.out.print(num[i][j] + \" \");\n \t\t\t}else{\n \t\t\t\tSystem.out.println(num[i][j]);\n \t\t\t}\n \t\t}\n \t}\n }",
"main",
"{\n \tScanner scan = new Scanner(System.in);\n \tint r = scan.nextInt();\n \tint c = scan.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\tnum[i][j] = scan.nextInt();\n \t}\n \t}\n \t\n \tfor(int i = 0; i < r; i++){\n \t\tfor(int j = 0; j < c; j++){\n \t\t\tnum[i][c] += num[i][j];\n \t\t}\n \t}\n \tfor(int j = 0; j < c + 1; j++){\n \t\tfor(int i = 0; i < r; i++){\n \t\t\tnum[r][j] += num[i][j];\n \t\t}\n \t}\n \t\n \tfor(int i = 0; i < r + 1; i++){\n \t\tfor(int j = 0; j < c + 1; j++){\n \t\t\tif(j != c){\n \t\t\t\tSystem.out.print(num[i][j] + \" \");\n \t\t\t}else{\n \t\t\t\tSystem.out.println(num[i][j]);\n \t\t\t}\n \t\t}\n \t}\n }",
"Scanner scan = new Scanner(System.in);",
"scan",
"new Scanner(System.in)",
"int r = scan.nextInt();",
"r",
"scan.nextInt()",
"scan.nextInt",
"scan",
"int c = scan.nextInt();",
"c",
"scan.nextInt()",
"scan.nextInt",
"scan",
"int[][] 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\tnum[i][j] = scan.nextInt();\n \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\tnum[i][j] = scan.nextInt();\n \t}\n \t}",
"{\n \t\tfor(int j = 0; j < c; j++){\n \t\tnum[i][j] = scan.nextInt();\n \t}\n \t}",
"for(int j = 0; j < c; j++){\n \t\tnum[i][j] = scan.nextInt();\n \t}",
"int j = 0;",
"int j = 0;",
"j",
"0",
"j < c",
"j",
"c",
"j++",
"j++",
"j",
"{\n \t\tnum[i][j] = scan.nextInt();\n \t}",
"{\n \t\tnum[i][j] = scan.nextInt();\n \t}",
"num[i][j] = scan.nextInt()",
"num[i][j]",
"num[i]",
"num",
"i",
"j",
"scan.nextInt()",
"scan.nextInt",
"scan",
"for(int i = 0; i < r; i++){\n \t\tfor(int j = 0; j < c; j++){\n \t\t\tnum[i][c] += num[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\tnum[i][c] += num[i][j];\n \t\t}\n \t}",
"{\n \t\tfor(int j = 0; j < c; j++){\n \t\t\tnum[i][c] += num[i][j];\n \t\t}\n \t}",
"for(int j = 0; j < c; j++){\n \t\t\tnum[i][c] += num[i][j];\n \t\t}",
"int j = 0;",
"int j = 0;",
"j",
"0",
"j < c",
"j",
"c",
"j++",
"j++",
"j",
"{\n \t\t\tnum[i][c] += num[i][j];\n \t\t}",
"{\n \t\t\tnum[i][c] += num[i][j];\n \t\t}",
"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 + 1; j++){\n \t\tfor(int i = 0; i < r; i++){\n \t\t\tnum[r][j] += num[i][j];\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\tfor(int i = 0; i < r; i++){\n \t\t\tnum[r][j] += num[i][j];\n \t\t}\n \t}",
"{\n \t\tfor(int i = 0; i < r; i++){\n \t\t\tnum[r][j] += num[i][j];\n \t\t}\n \t}",
"for(int i = 0; i < r; i++){\n \t\t\tnum[r][j] += num[i][j];\n \t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < r",
"i",
"r",
"i++",
"i++",
"i",
"{\n \t\t\tnum[r][j] += num[i][j];\n \t\t}",
"{\n \t\t\tnum[r][j] += num[i][j];\n \t\t}",
"num[r][j] += num[i][j]",
"num[r][j]",
"num[r]",
"num",
"r",
"j",
"num[i][j]",
"num[i]",
"num",
"i",
"j",
"for(int i = 0; i < r + 1; i++){\n \t\tfor(int j = 0; j < c + 1; j++){\n \t\t\tif(j != c){\n \t\t\t\tSystem.out.print(num[i][j] + \" \");\n \t\t\t}else{\n \t\t\t\tSystem.out.println(num[i][j]);\n \t\t\t}\n \t\t}\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 + 1; j++){\n \t\t\tif(j != c){\n \t\t\t\tSystem.out.print(num[i][j] + \" \");\n \t\t\t}else{\n \t\t\t\tSystem.out.println(num[i][j]);\n \t\t\t}\n \t\t}\n \t}",
"{\n \t\tfor(int j = 0; j < c + 1; j++){\n \t\t\tif(j != c){\n \t\t\t\tSystem.out.print(num[i][j] + \" \");\n \t\t\t}else{\n \t\t\t\tSystem.out.println(num[i][j]);\n \t\t\t}\n \t\t}\n \t}",
"for(int j = 0; j < c + 1; j++){\n \t\t\tif(j != c){\n \t\t\t\tSystem.out.print(num[i][j] + \" \");\n \t\t\t}else{\n \t\t\t\tSystem.out.println(num[i][j]);\n \t\t\t}\n \t\t}",
"int j = 0;",
"int j = 0;",
"j",
"0",
"j < c + 1",
"j",
"c + 1",
"c",
"1",
"j++",
"j++",
"j",
"{\n \t\t\tif(j != c){\n \t\t\t\tSystem.out.print(num[i][j] + \" \");\n \t\t\t}else{\n \t\t\t\tSystem.out.println(num[i][j]);\n \t\t\t}\n \t\t}",
"{\n \t\t\tif(j != c){\n \t\t\t\tSystem.out.print(num[i][j] + \" \");\n \t\t\t}else{\n \t\t\t\tSystem.out.println(num[i][j]);\n \t\t\t}\n \t\t}",
"if(j != c){\n \t\t\t\tSystem.out.print(num[i][j] + \" \");\n \t\t\t}else{\n \t\t\t\tSystem.out.println(num[i][j]);\n \t\t\t}",
"j != c",
"j",
"c",
"{\n \t\t\t\tSystem.out.print(num[i][j] + \" \");\n \t\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",
"\" \"",
"{\n \t\t\t\tSystem.out.println(num[i][j]);\n \t\t\t}",
"System.out.println(num[i][j])",
"System.out.println",
"System.out",
"System",
"System.out",
"num[i][j]",
"num[i]",
"num",
"i",
"j",
"String[] args",
"args"
] | import java.util.Scanner;
class Main{
public static void main(String[] args){
Scanner scan = new Scanner(System.in);
int r = scan.nextInt();
int c = scan.nextInt();
int[][] num = new int[r + 1][c + 1];
for(int i = 0; i < r; i++){
for(int j = 0; j < c; j++){
num[i][j] = scan.nextInt();
}
}
for(int i = 0; i < r; i++){
for(int j = 0; j < c; j++){
num[i][c] += num[i][j];
}
}
for(int j = 0; j < c + 1; j++){
for(int i = 0; i < r; i++){
num[r][j] += num[i][j];
}
}
for(int i = 0; i < r + 1; i++){
for(int j = 0; j < c + 1; j++){
if(j != c){
System.out.print(num[i][j] + " ");
}else{
System.out.println(num[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,
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,
18,
13,
13,
1,
40,
13,
30,
30,
11,
1,
41,
13,
17,
2,
13,
18,
18,
13,
13,
13,
1,
40,
13,
30,
30,
4,
18,
18,
13,
13,
18,
18,
13,
13,
13,
14,
2,
2,
13,
17,
2,
13,
2,
18,
18,
13,
13,
13,
17,
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
],
[
186,
5
],
[
186,
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
],
[
8,
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
],
[
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
],
[
134,
135
],
[
135,
136
],
[
135,
137
],
[
134,
138
],
[
127,
139
],
[
139,
140
],
[
140,
141
],
[
127,
142
],
[
143,
143
],
[
143,
144
],
[
144,
145
],
[
145,
146
],
[
146,
147
],
[
146,
148
],
[
144,
149
],
[
149,
150
],
[
150,
151
],
[
150,
152
],
[
149,
153
],
[
143,
154
],
[
154,
155
],
[
155,
156
],
[
156,
157
],
[
156,
158
],
[
155,
159
],
[
159,
160
],
[
159,
161
],
[
161,
162
],
[
162,
163
],
[
163,
164
],
[
163,
165
],
[
162,
166
],
[
161,
167
],
[
154,
168
],
[
168,
169
],
[
169,
170
],
[
170,
171
],
[
171,
172
],
[
171,
173
],
[
169,
174
],
[
126,
175
],
[
175,
176
],
[
176,
177
],
[
177,
178
],
[
177,
179
],
[
8,
180
],
[
180,
181
],
[
181,
182
],
[
6,
183
],
[
183,
184
],
[
0,
185
],
[
185,
186
],
[
185,
187
]
] | [
"import java.util.Scanner;\n\npublic class Main {\n\t/*\n\t * 表計算\n\t *\n\t * 表計算を行う簡単なプログラムを作成します。\n\t *\n\t * 表の行数rと列数c、r × c の要素を持つ表を読み込んで、各行と列の合計を挿入した新しい表を出力するプログラムを作成して下さい。\n\t *\n\t * Input 最初の行にrとcが空白区切りで与えられます。続くr行にそれぞれc個の整数が空白区切りで与えられます。\n\t *\n\t * Output (r+1) × (c+1)\n\t * の新しい表を出力して下さい。各行の隣り合う整数は1つの空白で区切って下さい。各行の最後の列としてその行の合計値を\n\t * 、各列の最後の行としてその列の合計値を、最後の行・列に表全体の合計値を挿入して下さい。\n\t *\n\t * Constraints 1 ? r, c ? 100\n\t */\n\tpublic static void main(String[] args) throws Exception {\n\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[][] array = 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\tarray[i][j] = sc.nextInt();\n\t\t\t\tarray[i][c] += array[i][j];\n\t\t\t\tarray[r][j] += array[i][j];\n\t\t\t}\n\t\t}\n\n\t\tfor (int i = 0; i < c; i++) {\n\t\t\tarray[r][c] += array[r][i];\n\t\t}\n\n\t\tfor (int i = 0; i < array.length; i++) {\n\t\t\tfor (int j = 0; j < array[i].length; j++) {\n\t\t\t\tSystem.out.print(array[i][j]);\n\t\t\t\tif (j >= 0 && j < array[i].length -1) {\n\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t}\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}\n\n\t\tsc.close();\n\t}\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n\t/*\n\t * 表計算\n\t *\n\t * 表計算を行う簡単なプログラムを作成します。\n\t *\n\t * 表の行数rと列数c、r × c の要素を持つ表を読み込んで、各行と列の合計を挿入した新しい表を出力するプログラムを作成して下さい。\n\t *\n\t * Input 最初の行にrとcが空白区切りで与えられます。続くr行にそれぞれc個の整数が空白区切りで与えられます。\n\t *\n\t * Output (r+1) × (c+1)\n\t * の新しい表を出力して下さい。各行の隣り合う整数は1つの空白で区切って下さい。各行の最後の列としてその行の合計値を\n\t * 、各列の最後の行としてその列の合計値を、最後の行・列に表全体の合計値を挿入して下さい。\n\t *\n\t * Constraints 1 ? r, c ? 100\n\t */\n\tpublic static void main(String[] args) throws Exception {\n\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[][] array = 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\tarray[i][j] = sc.nextInt();\n\t\t\t\tarray[i][c] += array[i][j];\n\t\t\t\tarray[r][j] += array[i][j];\n\t\t\t}\n\t\t}\n\n\t\tfor (int i = 0; i < c; i++) {\n\t\t\tarray[r][c] += array[r][i];\n\t\t}\n\n\t\tfor (int i = 0; i < array.length; i++) {\n\t\t\tfor (int j = 0; j < array[i].length; j++) {\n\t\t\t\tSystem.out.print(array[i][j]);\n\t\t\t\tif (j >= 0 && j < array[i].length -1) {\n\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t}\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}\n\n\t\tsc.close();\n\t}\n}",
"Main",
"/*\n\t * 表計算\n\t *\n\t * 表計算を行う簡単なプログラムを作成します。\n\t *\n\t * 表の行数rと列数c、r × c の要素を持つ表を読み込んで、各行と列の合計を挿入した新しい表を出力するプログラムを作成して下さい。\n\t *\n\t * Input 最初の行にrとcが空白区切りで与えられます。続くr行にそれぞれc個の整数が空白区切りで与えられます。\n\t *\n\t * Output (r+1) × (c+1)\n\t * の新しい表を出力して下さい。各行の隣り合う整数は1つの空白で区切って下さい。各行の最後の列としてその行の合計値を\n\t * 、各列の最後の行としてその列の合計値を、最後の行・列に表全体の合計値を挿入して下さい。\n\t *\n\t * Constraints 1 ? r, c ? 100\n\t */\n\tpublic static void main(String[] args) throws Exception {\n\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[][] array = 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\tarray[i][j] = sc.nextInt();\n\t\t\t\tarray[i][c] += array[i][j];\n\t\t\t\tarray[r][j] += array[i][j];\n\t\t\t}\n\t\t}\n\n\t\tfor (int i = 0; i < c; i++) {\n\t\t\tarray[r][c] += array[r][i];\n\t\t}\n\n\t\tfor (int i = 0; i < array.length; i++) {\n\t\t\tfor (int j = 0; j < array[i].length; j++) {\n\t\t\t\tSystem.out.print(array[i][j]);\n\t\t\t\tif (j >= 0 && j < array[i].length -1) {\n\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t}\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}\n\n\t\tsc.close();\n\t}",
"main",
"{\n\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[][] array = 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\tarray[i][j] = sc.nextInt();\n\t\t\t\tarray[i][c] += array[i][j];\n\t\t\t\tarray[r][j] += array[i][j];\n\t\t\t}\n\t\t}\n\n\t\tfor (int i = 0; i < c; i++) {\n\t\t\tarray[r][c] += array[r][i];\n\t\t}\n\n\t\tfor (int i = 0; i < array.length; i++) {\n\t\t\tfor (int j = 0; j < array[i].length; j++) {\n\t\t\t\tSystem.out.print(array[i][j]);\n\t\t\t\tif (j >= 0 && j < array[i].length -1) {\n\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t}\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}\n\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[][] array = new int[r + 1][c + 1];",
"array",
"new int[r + 1][c + 1]",
"r + 1",
"r",
"1",
"c + 1",
"c",
"1",
"for (int i = 0; i < r; i++) {\n\t\t\tfor (int j = 0; j < c; j++) {\n\t\t\t\tarray[i][j] = sc.nextInt();\n\t\t\t\tarray[i][c] += array[i][j];\n\t\t\t\tarray[r][j] += array[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\tarray[i][j] = sc.nextInt();\n\t\t\t\tarray[i][c] += array[i][j];\n\t\t\t\tarray[r][j] += array[i][j];\n\t\t\t}\n\t\t}",
"{\n\t\t\tfor (int j = 0; j < c; j++) {\n\t\t\t\tarray[i][j] = sc.nextInt();\n\t\t\t\tarray[i][c] += array[i][j];\n\t\t\t\tarray[r][j] += array[i][j];\n\t\t\t}\n\t\t}",
"for (int j = 0; j < c; j++) {\n\t\t\t\tarray[i][j] = sc.nextInt();\n\t\t\t\tarray[i][c] += array[i][j];\n\t\t\t\tarray[r][j] += 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] = sc.nextInt();\n\t\t\t\tarray[i][c] += array[i][j];\n\t\t\t\tarray[r][j] += array[i][j];\n\t\t\t}",
"{\n\t\t\t\tarray[i][j] = sc.nextInt();\n\t\t\t\tarray[i][c] += array[i][j];\n\t\t\t\tarray[r][j] += array[i][j];\n\t\t\t}",
"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",
"for (int i = 0; i < c; i++) {\n\t\t\tarray[r][c] += array[r][i];\n\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < c",
"i",
"c",
"i++",
"i++",
"i",
"{\n\t\t\tarray[r][c] += array[r][i];\n\t\t}",
"{\n\t\t\tarray[r][c] += array[r][i];\n\t\t}",
"array[r][c] += array[r][i]",
"array[r][c]",
"array[r]",
"array",
"r",
"c",
"array[r][i]",
"array[r]",
"array",
"r",
"i",
"for (int i = 0; i < array.length; i++) {\n\t\t\tfor (int j = 0; j < array[i].length; j++) {\n\t\t\t\tSystem.out.print(array[i][j]);\n\t\t\t\tif (j >= 0 && j < array[i].length -1) {\n\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t}\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < array.length",
"i",
"array.length",
"array",
"array.length",
"i++",
"i++",
"i",
"{\n\t\t\tfor (int j = 0; j < array[i].length; j++) {\n\t\t\t\tSystem.out.print(array[i][j]);\n\t\t\t\tif (j >= 0 && j < array[i].length -1) {\n\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t}\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}",
"{\n\t\t\tfor (int j = 0; j < array[i].length; j++) {\n\t\t\t\tSystem.out.print(array[i][j]);\n\t\t\t\tif (j >= 0 && j < array[i].length -1) {\n\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t}\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}",
"for (int j = 0; j < array[i].length; j++) {\n\t\t\t\tSystem.out.print(array[i][j]);\n\t\t\t\tif (j >= 0 && j < array[i].length -1) {\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 < array[i].length",
"j",
"array[i].length",
"array[i]",
"array",
"i",
"array[i].length",
"j++",
"j++",
"j",
"{\n\t\t\t\tSystem.out.print(array[i][j]);\n\t\t\t\tif (j >= 0 && j < array[i].length -1) {\n\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t}\n\t\t\t}",
"{\n\t\t\t\tSystem.out.print(array[i][j]);\n\t\t\t\tif (j >= 0 && j < array[i].length -1) {\n\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t}\n\t\t\t}",
"System.out.print(array[i][j])",
"System.out.print",
"System.out",
"System",
"System.out",
"array[i][j]",
"array[i]",
"array",
"i",
"j",
"if (j >= 0 && j < array[i].length -1) {\n\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t}",
"j >= 0 && j < array[i].length -1",
"j >= 0",
"j",
"0",
"j < array[i].length -1",
"j",
"array[i].length -1",
"array[i].length",
"array[i]",
"array",
"i",
"array[i].length",
"1",
"{\n\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t}",
"System.out.print(\" \")",
"System.out.print",
"System.out",
"System",
"System.out",
"\" \"",
"System.out.println()",
"System.out.println",
"System.out",
"System",
"System.out",
"sc.close()",
"sc.close",
"sc",
"String[] args",
"args",
"public class Main {\n\t/*\n\t * 表計算\n\t *\n\t * 表計算を行う簡単なプログラムを作成します。\n\t *\n\t * 表の行数rと列数c、r × c の要素を持つ表を読み込んで、各行と列の合計を挿入した新しい表を出力するプログラムを作成して下さい。\n\t *\n\t * Input 最初の行にrとcが空白区切りで与えられます。続くr行にそれぞれc個の整数が空白区切りで与えられます。\n\t *\n\t * Output (r+1) × (c+1)\n\t * の新しい表を出力して下さい。各行の隣り合う整数は1つの空白で区切って下さい。各行の最後の列としてその行の合計値を\n\t * 、各列の最後の行としてその列の合計値を、最後の行・列に表全体の合計値を挿入して下さい。\n\t *\n\t * Constraints 1 ? r, c ? 100\n\t */\n\tpublic static void main(String[] args) throws Exception {\n\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[][] array = 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\tarray[i][j] = sc.nextInt();\n\t\t\t\tarray[i][c] += array[i][j];\n\t\t\t\tarray[r][j] += array[i][j];\n\t\t\t}\n\t\t}\n\n\t\tfor (int i = 0; i < c; i++) {\n\t\t\tarray[r][c] += array[r][i];\n\t\t}\n\n\t\tfor (int i = 0; i < array.length; i++) {\n\t\t\tfor (int j = 0; j < array[i].length; j++) {\n\t\t\t\tSystem.out.print(array[i][j]);\n\t\t\t\tif (j >= 0 && j < array[i].length -1) {\n\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t}\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}\n\n\t\tsc.close();\n\t}\n}",
"public class Main {\n\t/*\n\t * 表計算\n\t *\n\t * 表計算を行う簡単なプログラムを作成します。\n\t *\n\t * 表の行数rと列数c、r × c の要素を持つ表を読み込んで、各行と列の合計を挿入した新しい表を出力するプログラムを作成して下さい。\n\t *\n\t * Input 最初の行にrとcが空白区切りで与えられます。続くr行にそれぞれc個の整数が空白区切りで与えられます。\n\t *\n\t * Output (r+1) × (c+1)\n\t * の新しい表を出力して下さい。各行の隣り合う整数は1つの空白で区切って下さい。各行の最後の列としてその行の合計値を\n\t * 、各列の最後の行としてその列の合計値を、最後の行・列に表全体の合計値を挿入して下さい。\n\t *\n\t * Constraints 1 ? r, c ? 100\n\t */\n\tpublic static void main(String[] args) throws Exception {\n\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[][] array = 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\tarray[i][j] = sc.nextInt();\n\t\t\t\tarray[i][c] += array[i][j];\n\t\t\t\tarray[r][j] += array[i][j];\n\t\t\t}\n\t\t}\n\n\t\tfor (int i = 0; i < c; i++) {\n\t\t\tarray[r][c] += array[r][i];\n\t\t}\n\n\t\tfor (int i = 0; i < array.length; i++) {\n\t\t\tfor (int j = 0; j < array[i].length; j++) {\n\t\t\t\tSystem.out.print(array[i][j]);\n\t\t\t\tif (j >= 0 && j < array[i].length -1) {\n\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t}\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}\n\n\t\tsc.close();\n\t}\n}",
"Main"
] | import java.util.Scanner;
public class Main {
/*
* 表計算
*
* 表計算を行う簡単なプログラムを作成します。
*
* 表の行数rと列数c、r × c の要素を持つ表を読み込んで、各行と列の合計を挿入した新しい表を出力するプログラムを作成して下さい。
*
* Input 最初の行にrとcが空白区切りで与えられます。続くr行にそれぞれc個の整数が空白区切りで与えられます。
*
* Output (r+1) × (c+1)
* の新しい表を出力して下さい。各行の隣り合う整数は1つの空白で区切って下さい。各行の最後の列としてその行の合計値を
* 、各列の最後の行としてその列の合計値を、最後の行・列に表全体の合計値を挿入して下さい。
*
* Constraints 1 ? r, c ? 100
*/
public static void main(String[] args) throws Exception {
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];
}
}
for (int i = 0; i < c; i++) {
array[r][c] += array[r][i];
}
for (int i = 0; i < array.length; i++) {
for (int j = 0; j < array[i].length; j++) {
System.out.print(array[i][j]);
if (j >= 0 && j < array[i].length -1) {
System.out.print(" ");
}
}
System.out.println();
}
sc.close();
}
} |
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
41,
13,
20,
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,
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,
14,
2,
13,
17,
0,
18,
18,
13,
13,
13,
18,
18,
13,
2,
13,
17,
13,
4,
18,
18,
13,
13,
13,
0,
13,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
4,
18,
18,
13,
13,
2,
18,
18,
13,
2,
13,
17,
13,
17,
4,
18,
18,
13,
13,
13,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
175,
5
],
[
175,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
8,
17
],
[
17,
18
],
[
17,
19
],
[
19,
20
],
[
20,
21
],
[
8,
22
],
[
22,
23
],
[
22,
24
],
[
8,
27
],
[
27,
28
],
[
28,
29
],
[
29,
30
],
[
29,
31
],
[
27,
32
],
[
32,
33
],
[
32,
34
],
[
27,
35
],
[
35,
36
],
[
36,
37
],
[
27,
38
],
[
39,
39
],
[
39,
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
],
[
54,
58
],
[
53,
59
],
[
59,
60
],
[
60,
61
],
[
8,
62
],
[
62,
63
],
[
62,
64
],
[
8,
65
],
[
65,
66
],
[
66,
67
],
[
67,
68
],
[
67,
69
],
[
65,
70
],
[
70,
71
],
[
70,
72
],
[
65,
73
],
[
73,
74
],
[
74,
75
],
[
65,
76
],
[
77,
77
],
[
77,
78
],
[
78,
79
],
[
78,
80
],
[
77,
81
],
[
81,
82
],
[
82,
83
],
[
83,
84
],
[
83,
85
],
[
81,
86
],
[
86,
87
],
[
86,
88
],
[
81,
89
],
[
89,
90
],
[
90,
91
],
[
81,
92
],
[
93,
93
],
[
93,
94
],
[
94,
95
],
[
95,
96
],
[
96,
97
],
[
96,
98
],
[
94,
99
],
[
99,
100
],
[
100,
101
],
[
101,
102
],
[
101,
103
],
[
100,
104
],
[
99,
105
],
[
93,
106
],
[
106,
107
],
[
106,
108
],
[
108,
109
],
[
109,
110
],
[
109,
111
],
[
108,
112
],
[
93,
113
],
[
113,
114
],
[
114,
115
],
[
114,
116
],
[
113,
117
],
[
117,
118
],
[
118,
119
],
[
119,
120
],
[
119,
121
],
[
118,
122
],
[
117,
123
],
[
123,
124
],
[
124,
125
],
[
124,
126
],
[
126,
127
],
[
126,
128
],
[
123,
129
],
[
77,
130
],
[
130,
131
],
[
131,
132
],
[
132,
133
],
[
132,
134
],
[
130,
135
],
[
77,
136
],
[
136,
137
],
[
136,
138
],
[
8,
139
],
[
139,
140
],
[
140,
141
],
[
141,
142
],
[
141,
143
],
[
139,
144
],
[
144,
145
],
[
144,
146
],
[
139,
147
],
[
147,
148
],
[
148,
149
],
[
139,
150
],
[
151,
151
],
[
151,
152
],
[
152,
153
],
[
153,
154
],
[
154,
155
],
[
154,
156
],
[
152,
157
],
[
157,
158
],
[
158,
159
],
[
159,
160
],
[
159,
161
],
[
161,
162
],
[
161,
163
],
[
158,
164
],
[
157,
165
],
[
8,
166
],
[
166,
167
],
[
167,
168
],
[
168,
169
],
[
168,
170
],
[
166,
171
],
[
6,
172
],
[
172,
173
],
[
0,
174
],
[
174,
175
],
[
174,
176
]
] | [
"import java.util.Scanner;\n\npublic class Main {\n 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 matrix[][]=new int[r][c];\n for(int i=0;i<r;i++){\n for(int j=0;j<c;j++){\n matrix[i][j]=sc.nextInt();\n }\n }\n int rc_sum=0;\n for(int i=0;i<r;i++){\n int c_sum=0;\n for(int j=0;j<c;j++){\n System.out.print(matrix[i][j]+\" \");\n c_sum+=matrix[i][j];\n if(i!=0)matrix[i][j]+=matrix[i-1][j];\n }\n System.out.println(c_sum);\n rc_sum+=c_sum;\n }\n for(int j=0;j<c;j++){\n System.out.print(matrix[r-1][j]+\" \");\n }\n System.out.println(rc_sum);\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 int matrix[][]=new int[r][c];\n for(int i=0;i<r;i++){\n for(int j=0;j<c;j++){\n matrix[i][j]=sc.nextInt();\n }\n }\n int rc_sum=0;\n for(int i=0;i<r;i++){\n int c_sum=0;\n for(int j=0;j<c;j++){\n System.out.print(matrix[i][j]+\" \");\n c_sum+=matrix[i][j];\n if(i!=0)matrix[i][j]+=matrix[i-1][j];\n }\n System.out.println(c_sum);\n rc_sum+=c_sum;\n }\n for(int j=0;j<c;j++){\n System.out.print(matrix[r-1][j]+\" \");\n }\n System.out.println(rc_sum);\n }\n}",
"Main",
"public static void main(String[] args){\n Scanner sc = new Scanner(System.in);\n int r=sc.nextInt();\n int c=sc.nextInt();\n int matrix[][]=new int[r][c];\n for(int i=0;i<r;i++){\n for(int j=0;j<c;j++){\n matrix[i][j]=sc.nextInt();\n }\n }\n int rc_sum=0;\n for(int i=0;i<r;i++){\n int c_sum=0;\n for(int j=0;j<c;j++){\n System.out.print(matrix[i][j]+\" \");\n c_sum+=matrix[i][j];\n if(i!=0)matrix[i][j]+=matrix[i-1][j];\n }\n System.out.println(c_sum);\n rc_sum+=c_sum;\n }\n for(int j=0;j<c;j++){\n System.out.print(matrix[r-1][j]+\" \");\n }\n System.out.println(rc_sum);\n }",
"main",
"{\n Scanner sc = new Scanner(System.in);\n int r=sc.nextInt();\n int c=sc.nextInt();\n int matrix[][]=new int[r][c];\n for(int i=0;i<r;i++){\n for(int j=0;j<c;j++){\n matrix[i][j]=sc.nextInt();\n }\n }\n int rc_sum=0;\n for(int i=0;i<r;i++){\n int c_sum=0;\n for(int j=0;j<c;j++){\n System.out.print(matrix[i][j]+\" \");\n c_sum+=matrix[i][j];\n if(i!=0)matrix[i][j]+=matrix[i-1][j];\n }\n System.out.println(c_sum);\n rc_sum+=c_sum;\n }\n for(int j=0;j<c;j++){\n System.out.print(matrix[r-1][j]+\" \");\n }\n System.out.println(rc_sum);\n }",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"int r=sc.nextInt();",
"r",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int c=sc.nextInt();",
"c",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int matrix[][]=new int[r][c];",
"matrix",
"new int[r][c]",
"r",
"c",
"for(int i=0;i<r;i++){\n for(int j=0;j<c;j++){\n matrix[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 matrix[i][j]=sc.nextInt();\n }\n }",
"{\n for(int j=0;j<c;j++){\n matrix[i][j]=sc.nextInt();\n }\n }",
"for(int j=0;j<c;j++){\n matrix[i][j]=sc.nextInt();\n }",
"int j=0;",
"int j=0;",
"j",
"0",
"j<c",
"j",
"c",
"j++",
"j++",
"j",
"{\n matrix[i][j]=sc.nextInt();\n }",
"{\n matrix[i][j]=sc.nextInt();\n }",
"matrix[i][j]=sc.nextInt()",
"matrix[i][j]",
"matrix[i]",
"matrix",
"i",
"j",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int rc_sum=0;",
"rc_sum",
"0",
"for(int i=0;i<r;i++){\n int c_sum=0;\n for(int j=0;j<c;j++){\n System.out.print(matrix[i][j]+\" \");\n c_sum+=matrix[i][j];\n if(i!=0)matrix[i][j]+=matrix[i-1][j];\n }\n System.out.println(c_sum);\n rc_sum+=c_sum;\n }",
"int i=0;",
"int i=0;",
"i",
"0",
"i<r",
"i",
"r",
"i++",
"i++",
"i",
"{\n int c_sum=0;\n for(int j=0;j<c;j++){\n System.out.print(matrix[i][j]+\" \");\n c_sum+=matrix[i][j];\n if(i!=0)matrix[i][j]+=matrix[i-1][j];\n }\n System.out.println(c_sum);\n rc_sum+=c_sum;\n }",
"{\n int c_sum=0;\n for(int j=0;j<c;j++){\n System.out.print(matrix[i][j]+\" \");\n c_sum+=matrix[i][j];\n if(i!=0)matrix[i][j]+=matrix[i-1][j];\n }\n System.out.println(c_sum);\n rc_sum+=c_sum;\n }",
"int c_sum=0;",
"c_sum",
"0",
"for(int j=0;j<c;j++){\n System.out.print(matrix[i][j]+\" \");\n c_sum+=matrix[i][j];\n if(i!=0)matrix[i][j]+=matrix[i-1][j];\n }",
"int j=0;",
"int j=0;",
"j",
"0",
"j<c",
"j",
"c",
"j++",
"j++",
"j",
"{\n System.out.print(matrix[i][j]+\" \");\n c_sum+=matrix[i][j];\n if(i!=0)matrix[i][j]+=matrix[i-1][j];\n }",
"{\n System.out.print(matrix[i][j]+\" \");\n c_sum+=matrix[i][j];\n if(i!=0)matrix[i][j]+=matrix[i-1][j];\n }",
"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",
"\" \"",
"c_sum+=matrix[i][j]",
"c_sum",
"matrix[i][j]",
"matrix[i]",
"matrix",
"i",
"j",
"if(i!=0)matrix[i][j]+=matrix[i-1][j];",
"i!=0",
"i",
"0",
"matrix[i][j]+=matrix[i-1][j]",
"matrix[i][j]",
"matrix[i]",
"matrix",
"i",
"j",
"matrix[i-1][j]",
"matrix[i-1]",
"matrix",
"i-1",
"i",
"1",
"j",
"System.out.println(c_sum)",
"System.out.println",
"System.out",
"System",
"System.out",
"c_sum",
"rc_sum+=c_sum",
"rc_sum",
"c_sum",
"for(int j=0;j<c;j++){\n System.out.print(matrix[r-1][j]+\" \");\n }",
"int j=0;",
"int j=0;",
"j",
"0",
"j<c",
"j",
"c",
"j++",
"j++",
"j",
"{\n System.out.print(matrix[r-1][j]+\" \");\n }",
"{\n System.out.print(matrix[r-1][j]+\" \");\n }",
"System.out.print(matrix[r-1][j]+\" \")",
"System.out.print",
"System.out",
"System",
"System.out",
"matrix[r-1][j]+\" \"",
"matrix[r-1][j]",
"matrix[r-1]",
"matrix",
"r-1",
"r",
"1",
"j",
"\" \"",
"System.out.println(rc_sum)",
"System.out.println",
"System.out",
"System",
"System.out",
"rc_sum",
"String[] args",
"args",
"public class Main {\n public static void main(String[] args){\n Scanner sc = new Scanner(System.in);\n int r=sc.nextInt();\n int c=sc.nextInt();\n int matrix[][]=new int[r][c];\n for(int i=0;i<r;i++){\n for(int j=0;j<c;j++){\n matrix[i][j]=sc.nextInt();\n }\n }\n int rc_sum=0;\n for(int i=0;i<r;i++){\n int c_sum=0;\n for(int j=0;j<c;j++){\n System.out.print(matrix[i][j]+\" \");\n c_sum+=matrix[i][j];\n if(i!=0)matrix[i][j]+=matrix[i-1][j];\n }\n System.out.println(c_sum);\n rc_sum+=c_sum;\n }\n for(int j=0;j<c;j++){\n System.out.print(matrix[r-1][j]+\" \");\n }\n System.out.println(rc_sum);\n }\n}",
"public class Main {\n public static void main(String[] args){\n Scanner sc = new Scanner(System.in);\n int r=sc.nextInt();\n int c=sc.nextInt();\n int matrix[][]=new int[r][c];\n for(int i=0;i<r;i++){\n for(int j=0;j<c;j++){\n matrix[i][j]=sc.nextInt();\n }\n }\n int rc_sum=0;\n for(int i=0;i<r;i++){\n int c_sum=0;\n for(int j=0;j<c;j++){\n System.out.print(matrix[i][j]+\" \");\n c_sum+=matrix[i][j];\n if(i!=0)matrix[i][j]+=matrix[i-1][j];\n }\n System.out.println(c_sum);\n rc_sum+=c_sum;\n }\n for(int j=0;j<c;j++){\n System.out.print(matrix[r-1][j]+\" \");\n }\n System.out.println(rc_sum);\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 matrix[][]=new int[r][c];
for(int i=0;i<r;i++){
for(int j=0;j<c;j++){
matrix[i][j]=sc.nextInt();
}
}
int rc_sum=0;
for(int i=0;i<r;i++){
int c_sum=0;
for(int j=0;j<c;j++){
System.out.print(matrix[i][j]+" ");
c_sum+=matrix[i][j];
if(i!=0)matrix[i][j]+=matrix[i-1][j];
}
System.out.println(c_sum);
rc_sum+=c_sum;
}
for(int j=0;j<c;j++){
System.out.print(matrix[r-1][j]+" ");
}
System.out.println(rc_sum);
}
}
|
[
7,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
41,
13,
20,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
41,
13,
20,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
4,
18,
13,
4,
18,
13,
4,
18,
13,
13,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
4,
18,
4,
18,
13,
13,
13,
4,
18,
4,
18,
13,
13,
13,
0,
13,
17,
41,
13,
20,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
4,
18,
4,
18,
13,
13,
13,
4,
18,
13,
13,
0,
13,
13,
0,
13,
17,
4,
18,
13,
13,
4,
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,
14,
2,
13,
17,
4,
18,
18,
13,
13,
4,
18,
4,
18,
13,
13,
13,
4,
18,
18,
13,
13,
2,
17,
4,
18,
4,
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
],
[
242,
8
],
[
242,
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,
28
],
[
28,
29
],
[
29,
30
],
[
30,
31
],
[
30,
32
],
[
28,
33
],
[
33,
34
],
[
33,
35
],
[
28,
36
],
[
36,
37
],
[
37,
38
],
[
28,
39
],
[
40,
40
],
[
40,
41
],
[
41,
42
],
[
41,
43
],
[
40,
44
],
[
44,
45
],
[
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
],
[
57,
60
],
[
60,
61
],
[
61,
62
],
[
40,
63
],
[
63,
64
],
[
64,
65
],
[
63,
66
],
[
11,
67
],
[
67,
68
],
[
67,
69
],
[
11,
70
],
[
70,
71
],
[
71,
72
],
[
72,
73
],
[
72,
74
],
[
70,
75
],
[
75,
76
],
[
75,
77
],
[
70,
78
],
[
78,
79
],
[
79,
80
],
[
70,
81
],
[
82,
82
],
[
82,
83
],
[
83,
84
],
[
84,
85
],
[
85,
86
],
[
85,
87
],
[
83,
88
],
[
88,
89
],
[
88,
90
],
[
83,
91
],
[
91,
92
],
[
92,
93
],
[
83,
94
],
[
95,
95
],
[
95,
96
],
[
96,
97
],
[
96,
98
],
[
98,
99
],
[
99,
100
],
[
100,
101
],
[
101,
102
],
[
100,
103
],
[
98,
104
],
[
82,
105
],
[
105,
106
],
[
106,
107
],
[
107,
108
],
[
108,
109
],
[
107,
110
],
[
105,
111
],
[
82,
112
],
[
112,
113
],
[
112,
114
],
[
11,
115
],
[
115,
116
],
[
115,
117
],
[
11,
118
],
[
118,
119
],
[
118,
120
],
[
11,
121
],
[
121,
122
],
[
122,
123
],
[
123,
124
],
[
123,
125
],
[
121,
126
],
[
126,
127
],
[
126,
128
],
[
121,
129
],
[
129,
130
],
[
130,
131
],
[
121,
132
],
[
133,
133
],
[
133,
134
],
[
134,
135
],
[
135,
136
],
[
136,
137
],
[
136,
138
],
[
134,
139
],
[
139,
140
],
[
139,
141
],
[
134,
142
],
[
142,
143
],
[
143,
144
],
[
134,
145
],
[
146,
146
],
[
146,
147
],
[
147,
148
],
[
147,
149
],
[
149,
150
],
[
150,
151
],
[
151,
152
],
[
152,
153
],
[
151,
154
],
[
149,
155
],
[
133,
156
],
[
156,
157
],
[
157,
158
],
[
156,
159
],
[
133,
160
],
[
160,
161
],
[
160,
162
],
[
133,
163
],
[
163,
164
],
[
163,
165
],
[
11,
166
],
[
166,
167
],
[
167,
168
],
[
166,
169
],
[
11,
170
],
[
170,
171
],
[
171,
172
],
[
170,
173
],
[
11,
174
],
[
174,
175
],
[
175,
176
],
[
176,
177
],
[
176,
178
],
[
174,
179
],
[
179,
180
],
[
179,
181
],
[
181,
182
],
[
181,
183
],
[
174,
184
],
[
184,
185
],
[
185,
186
],
[
174,
187
],
[
188,
188
],
[
188,
189
],
[
189,
190
],
[
190,
191
],
[
191,
192
],
[
191,
193
],
[
189,
194
],
[
194,
195
],
[
194,
196
],
[
196,
197
],
[
196,
198
],
[
189,
199
],
[
199,
200
],
[
200,
201
],
[
189,
202
],
[
203,
203
],
[
203,
204
],
[
204,
205
],
[
205,
206
],
[
205,
207
],
[
204,
208
],
[
208,
209
],
[
209,
210
],
[
210,
211
],
[
210,
212
],
[
208,
213
],
[
213,
214
],
[
214,
215
],
[
215,
216
],
[
216,
217
],
[
215,
218
],
[
213,
219
],
[
204,
220
],
[
220,
221
],
[
221,
222
],
[
222,
223
],
[
222,
224
],
[
220,
225
],
[
225,
226
],
[
225,
227
],
[
227,
228
],
[
228,
229
],
[
229,
230
],
[
230,
231
],
[
229,
232
],
[
227,
233
],
[
188,
234
],
[
234,
235
],
[
235,
236
],
[
236,
237
],
[
236,
238
],
[
9,
239
],
[
239,
240
],
[
0,
241
],
[
241,
242
],
[
241,
243
]
] | [
"import java.util.ArrayList;\nimport 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\tint r = scan.nextInt();\n\t\tint c = scan.nextInt();\n\t\t\n\t\tArrayList<ArrayList<Integer>> lists = new ArrayList<ArrayList<Integer>>(); \n\t\t\n\t\tfor(int i = 0; i < r; i++) {\n\t\t\tArrayList<Integer> list = new ArrayList<Integer>();\n\t\t\tfor(int j = 0; j < c; j++) {\n\t\t\t\tlist.add(scan.nextInt());\n\t\t\t}\n\t\t\tlists.add(list);\n\t\t}\n\t\t\n\t\tint temp = 0;\n\t\tfor(int i = 0; i < r; i++) {\n\t\t\tfor(int j = 0; j < c; j++) {\n\t\t\t\ttemp += lists.get(i).get(j);\n\t\t\t}\n\t\t\tlists.get(i).add(temp);\n\t\t\ttemp = 0;\n\t\t}\n\t\t\n\t\tArrayList<Integer> list_kari = new ArrayList<Integer>();\n\t\tint tempForAll = 0;\n\t\tfor(int i = 0; i < c; i++) {\n\t\t\tfor(int j = 0; j < r; j++) {\n\t\t\t\ttemp += lists.get(j).get(i);\n\t\t\t}\n\t\t\tlist_kari.add(temp);\n\t\t\ttempForAll += temp;\n\t\t\ttemp = 0;\n\t\t}\n\t\tlist_kari.add(tempForAll);\n\t\tlists.add(list_kari);\n\t\t\n\t\tfor(int i = 0; i < r + 1; i++) {\n\t\t\tfor(int j = 0; j < c + 1; j++) {\n\t\t\t\tif(j == 0) System.out.print(lists.get(i).get(j));\n\t\t\t\telse System.out.print(\" \" + lists.get(i).get(j));\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}\n\t\t\n\t}\n\n}\n",
"import java.util.ArrayList;",
"ArrayList",
"java.util",
"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\tint r = scan.nextInt();\n\t\tint c = scan.nextInt();\n\t\t\n\t\tArrayList<ArrayList<Integer>> lists = new ArrayList<ArrayList<Integer>>(); \n\t\t\n\t\tfor(int i = 0; i < r; i++) {\n\t\t\tArrayList<Integer> list = new ArrayList<Integer>();\n\t\t\tfor(int j = 0; j < c; j++) {\n\t\t\t\tlist.add(scan.nextInt());\n\t\t\t}\n\t\t\tlists.add(list);\n\t\t}\n\t\t\n\t\tint temp = 0;\n\t\tfor(int i = 0; i < r; i++) {\n\t\t\tfor(int j = 0; j < c; j++) {\n\t\t\t\ttemp += lists.get(i).get(j);\n\t\t\t}\n\t\t\tlists.get(i).add(temp);\n\t\t\ttemp = 0;\n\t\t}\n\t\t\n\t\tArrayList<Integer> list_kari = new ArrayList<Integer>();\n\t\tint tempForAll = 0;\n\t\tfor(int i = 0; i < c; i++) {\n\t\t\tfor(int j = 0; j < r; j++) {\n\t\t\t\ttemp += lists.get(j).get(i);\n\t\t\t}\n\t\t\tlist_kari.add(temp);\n\t\t\ttempForAll += temp;\n\t\t\ttemp = 0;\n\t\t}\n\t\tlist_kari.add(tempForAll);\n\t\tlists.add(list_kari);\n\t\t\n\t\tfor(int i = 0; i < r + 1; i++) {\n\t\t\tfor(int j = 0; j < c + 1; j++) {\n\t\t\t\tif(j == 0) System.out.print(lists.get(i).get(j));\n\t\t\t\telse System.out.print(\" \" + lists.get(i).get(j));\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}\n\t\t\n\t}\n\n}",
"Main",
"public static void main(String[] args) {\n\t\t// TODO 自動生成されたメソッド・スタブ\n\t\tScanner scan = new Scanner(System.in);\n\t\tint r = scan.nextInt();\n\t\tint c = scan.nextInt();\n\t\t\n\t\tArrayList<ArrayList<Integer>> lists = new ArrayList<ArrayList<Integer>>(); \n\t\t\n\t\tfor(int i = 0; i < r; i++) {\n\t\t\tArrayList<Integer> list = new ArrayList<Integer>();\n\t\t\tfor(int j = 0; j < c; j++) {\n\t\t\t\tlist.add(scan.nextInt());\n\t\t\t}\n\t\t\tlists.add(list);\n\t\t}\n\t\t\n\t\tint temp = 0;\n\t\tfor(int i = 0; i < r; i++) {\n\t\t\tfor(int j = 0; j < c; j++) {\n\t\t\t\ttemp += lists.get(i).get(j);\n\t\t\t}\n\t\t\tlists.get(i).add(temp);\n\t\t\ttemp = 0;\n\t\t}\n\t\t\n\t\tArrayList<Integer> list_kari = new ArrayList<Integer>();\n\t\tint tempForAll = 0;\n\t\tfor(int i = 0; i < c; i++) {\n\t\t\tfor(int j = 0; j < r; j++) {\n\t\t\t\ttemp += lists.get(j).get(i);\n\t\t\t}\n\t\t\tlist_kari.add(temp);\n\t\t\ttempForAll += temp;\n\t\t\ttemp = 0;\n\t\t}\n\t\tlist_kari.add(tempForAll);\n\t\tlists.add(list_kari);\n\t\t\n\t\tfor(int i = 0; i < r + 1; i++) {\n\t\t\tfor(int j = 0; j < c + 1; j++) {\n\t\t\t\tif(j == 0) System.out.print(lists.get(i).get(j));\n\t\t\t\telse System.out.print(\" \" + lists.get(i).get(j));\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}\n\t\t\n\t}",
"main",
"{\n\t\t// TODO 自動生成されたメソッド・スタブ\n\t\tScanner scan = new Scanner(System.in);\n\t\tint r = scan.nextInt();\n\t\tint c = scan.nextInt();\n\t\t\n\t\tArrayList<ArrayList<Integer>> lists = new ArrayList<ArrayList<Integer>>(); \n\t\t\n\t\tfor(int i = 0; i < r; i++) {\n\t\t\tArrayList<Integer> list = new ArrayList<Integer>();\n\t\t\tfor(int j = 0; j < c; j++) {\n\t\t\t\tlist.add(scan.nextInt());\n\t\t\t}\n\t\t\tlists.add(list);\n\t\t}\n\t\t\n\t\tint temp = 0;\n\t\tfor(int i = 0; i < r; i++) {\n\t\t\tfor(int j = 0; j < c; j++) {\n\t\t\t\ttemp += lists.get(i).get(j);\n\t\t\t}\n\t\t\tlists.get(i).add(temp);\n\t\t\ttemp = 0;\n\t\t}\n\t\t\n\t\tArrayList<Integer> list_kari = new ArrayList<Integer>();\n\t\tint tempForAll = 0;\n\t\tfor(int i = 0; i < c; i++) {\n\t\t\tfor(int j = 0; j < r; j++) {\n\t\t\t\ttemp += lists.get(j).get(i);\n\t\t\t}\n\t\t\tlist_kari.add(temp);\n\t\t\ttempForAll += temp;\n\t\t\ttemp = 0;\n\t\t}\n\t\tlist_kari.add(tempForAll);\n\t\tlists.add(list_kari);\n\t\t\n\t\tfor(int i = 0; i < r + 1; i++) {\n\t\t\tfor(int j = 0; j < c + 1; j++) {\n\t\t\t\tif(j == 0) System.out.print(lists.get(i).get(j));\n\t\t\t\telse System.out.print(\" \" + lists.get(i).get(j));\n\t\t\t}\n\t\t\tSystem.out.println();\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",
"ArrayList<ArrayList<Integer>> lists = new ArrayList<ArrayList<Integer>>();",
"lists",
"new ArrayList<ArrayList<Integer>>()",
"for(int i = 0; i < r; i++) {\n\t\t\tArrayList<Integer> list = new ArrayList<Integer>();\n\t\t\tfor(int j = 0; j < c; j++) {\n\t\t\t\tlist.add(scan.nextInt());\n\t\t\t}\n\t\t\tlists.add(list);\n\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < r",
"i",
"r",
"i++",
"i++",
"i",
"{\n\t\t\tArrayList<Integer> list = new ArrayList<Integer>();\n\t\t\tfor(int j = 0; j < c; j++) {\n\t\t\t\tlist.add(scan.nextInt());\n\t\t\t}\n\t\t\tlists.add(list);\n\t\t}",
"{\n\t\t\tArrayList<Integer> list = new ArrayList<Integer>();\n\t\t\tfor(int j = 0; j < c; j++) {\n\t\t\t\tlist.add(scan.nextInt());\n\t\t\t}\n\t\t\tlists.add(list);\n\t\t}",
"ArrayList<Integer> list = new ArrayList<Integer>();",
"list",
"new ArrayList<Integer>()",
"for(int j = 0; j < c; j++) {\n\t\t\t\tlist.add(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\tlist.add(scan.nextInt());\n\t\t\t}",
"{\n\t\t\t\tlist.add(scan.nextInt());\n\t\t\t}",
"list.add(scan.nextInt())",
"list.add",
"list",
"scan.nextInt()",
"scan.nextInt",
"scan",
"lists.add(list)",
"lists.add",
"lists",
"list",
"int temp = 0;",
"temp",
"0",
"for(int i = 0; i < r; i++) {\n\t\t\tfor(int j = 0; j < c; j++) {\n\t\t\t\ttemp += lists.get(i).get(j);\n\t\t\t}\n\t\t\tlists.get(i).add(temp);\n\t\t\ttemp = 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\ttemp += lists.get(i).get(j);\n\t\t\t}\n\t\t\tlists.get(i).add(temp);\n\t\t\ttemp = 0;\n\t\t}",
"{\n\t\t\tfor(int j = 0; j < c; j++) {\n\t\t\t\ttemp += lists.get(i).get(j);\n\t\t\t}\n\t\t\tlists.get(i).add(temp);\n\t\t\ttemp = 0;\n\t\t}",
"for(int j = 0; j < c; j++) {\n\t\t\t\ttemp += lists.get(i).get(j);\n\t\t\t}",
"int j = 0;",
"int j = 0;",
"j",
"0",
"j < c",
"j",
"c",
"j++",
"j++",
"j",
"{\n\t\t\t\ttemp += lists.get(i).get(j);\n\t\t\t}",
"{\n\t\t\t\ttemp += lists.get(i).get(j);\n\t\t\t}",
"temp += lists.get(i).get(j)",
"temp",
"lists.get(i).get(j)",
"lists.get(i).get",
"lists.get(i)",
"lists.get",
"lists",
"i",
"j",
"lists.get(i).add(temp)",
"lists.get(i).add",
"lists.get(i)",
"lists.get",
"lists",
"i",
"temp",
"temp = 0",
"temp",
"0",
"ArrayList<Integer> list_kari = new ArrayList<Integer>();",
"list_kari",
"new ArrayList<Integer>()",
"int tempForAll = 0;",
"tempForAll",
"0",
"for(int i = 0; i < c; i++) {\n\t\t\tfor(int j = 0; j < r; j++) {\n\t\t\t\ttemp += lists.get(j).get(i);\n\t\t\t}\n\t\t\tlist_kari.add(temp);\n\t\t\ttempForAll += temp;\n\t\t\ttemp = 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\ttemp += lists.get(j).get(i);\n\t\t\t}\n\t\t\tlist_kari.add(temp);\n\t\t\ttempForAll += temp;\n\t\t\ttemp = 0;\n\t\t}",
"{\n\t\t\tfor(int j = 0; j < r; j++) {\n\t\t\t\ttemp += lists.get(j).get(i);\n\t\t\t}\n\t\t\tlist_kari.add(temp);\n\t\t\ttempForAll += temp;\n\t\t\ttemp = 0;\n\t\t}",
"for(int j = 0; j < r; j++) {\n\t\t\t\ttemp += lists.get(j).get(i);\n\t\t\t}",
"int j = 0;",
"int j = 0;",
"j",
"0",
"j < r",
"j",
"r",
"j++",
"j++",
"j",
"{\n\t\t\t\ttemp += lists.get(j).get(i);\n\t\t\t}",
"{\n\t\t\t\ttemp += lists.get(j).get(i);\n\t\t\t}",
"temp += lists.get(j).get(i)",
"temp",
"lists.get(j).get(i)",
"lists.get(j).get",
"lists.get(j)",
"lists.get",
"lists",
"j",
"i",
"list_kari.add(temp)",
"list_kari.add",
"list_kari",
"temp",
"tempForAll += temp",
"tempForAll",
"temp",
"temp = 0",
"temp",
"0",
"list_kari.add(tempForAll)",
"list_kari.add",
"list_kari",
"tempForAll",
"lists.add(list_kari)",
"lists.add",
"lists",
"list_kari",
"for(int i = 0; i < r + 1; i++) {\n\t\t\tfor(int j = 0; j < c + 1; j++) {\n\t\t\t\tif(j == 0) System.out.print(lists.get(i).get(j));\n\t\t\t\telse System.out.print(\" \" + lists.get(i).get(j));\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < r + 1",
"i",
"r + 1",
"r",
"1",
"i++",
"i++",
"i",
"{\n\t\t\tfor(int j = 0; j < c + 1; j++) {\n\t\t\t\tif(j == 0) System.out.print(lists.get(i).get(j));\n\t\t\t\telse System.out.print(\" \" + lists.get(i).get(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) System.out.print(lists.get(i).get(j));\n\t\t\t\telse System.out.print(\" \" + lists.get(i).get(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) System.out.print(lists.get(i).get(j));\n\t\t\t\telse System.out.print(\" \" + lists.get(i).get(j));\n\t\t\t}",
"int j = 0;",
"int j = 0;",
"j",
"0",
"j < c + 1",
"j",
"c + 1",
"c",
"1",
"j++",
"j++",
"j",
"{\n\t\t\t\tif(j == 0) System.out.print(lists.get(i).get(j));\n\t\t\t\telse System.out.print(\" \" + lists.get(i).get(j));\n\t\t\t}",
"{\n\t\t\t\tif(j == 0) System.out.print(lists.get(i).get(j));\n\t\t\t\telse System.out.print(\" \" + lists.get(i).get(j));\n\t\t\t}",
"if(j == 0) System.out.print(lists.get(i).get(j));\n\t\t\t\telse System.out.print(\" \" + lists.get(i).get(j));",
"j == 0",
"j",
"0",
"System.out.print(lists.get(i).get(j))",
"System.out.print",
"System.out",
"System",
"System.out",
"lists.get(i).get(j)",
"lists.get(i).get",
"lists.get(i)",
"lists.get",
"lists",
"i",
"j",
"System.out.print(\" \" + lists.get(i).get(j))",
"System.out.print",
"System.out",
"System",
"System.out",
"\" \" + lists.get(i).get(j)",
"\" \"",
"lists.get(i).get(j)",
"lists.get(i).get",
"lists.get(i)",
"lists.get",
"lists",
"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\t// TODO 自動生成されたメソッド・スタブ\n\t\tScanner scan = new Scanner(System.in);\n\t\tint r = scan.nextInt();\n\t\tint c = scan.nextInt();\n\t\t\n\t\tArrayList<ArrayList<Integer>> lists = new ArrayList<ArrayList<Integer>>(); \n\t\t\n\t\tfor(int i = 0; i < r; i++) {\n\t\t\tArrayList<Integer> list = new ArrayList<Integer>();\n\t\t\tfor(int j = 0; j < c; j++) {\n\t\t\t\tlist.add(scan.nextInt());\n\t\t\t}\n\t\t\tlists.add(list);\n\t\t}\n\t\t\n\t\tint temp = 0;\n\t\tfor(int i = 0; i < r; i++) {\n\t\t\tfor(int j = 0; j < c; j++) {\n\t\t\t\ttemp += lists.get(i).get(j);\n\t\t\t}\n\t\t\tlists.get(i).add(temp);\n\t\t\ttemp = 0;\n\t\t}\n\t\t\n\t\tArrayList<Integer> list_kari = new ArrayList<Integer>();\n\t\tint tempForAll = 0;\n\t\tfor(int i = 0; i < c; i++) {\n\t\t\tfor(int j = 0; j < r; j++) {\n\t\t\t\ttemp += lists.get(j).get(i);\n\t\t\t}\n\t\t\tlist_kari.add(temp);\n\t\t\ttempForAll += temp;\n\t\t\ttemp = 0;\n\t\t}\n\t\tlist_kari.add(tempForAll);\n\t\tlists.add(list_kari);\n\t\t\n\t\tfor(int i = 0; i < r + 1; i++) {\n\t\t\tfor(int j = 0; j < c + 1; j++) {\n\t\t\t\tif(j == 0) System.out.print(lists.get(i).get(j));\n\t\t\t\telse System.out.print(\" \" + lists.get(i).get(j));\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}\n\t\t\n\t}\n\n}",
"public class Main {\n\n\tpublic static void main(String[] args) {\n\t\t// TODO 自動生成されたメソッド・スタブ\n\t\tScanner scan = new Scanner(System.in);\n\t\tint r = scan.nextInt();\n\t\tint c = scan.nextInt();\n\t\t\n\t\tArrayList<ArrayList<Integer>> lists = new ArrayList<ArrayList<Integer>>(); \n\t\t\n\t\tfor(int i = 0; i < r; i++) {\n\t\t\tArrayList<Integer> list = new ArrayList<Integer>();\n\t\t\tfor(int j = 0; j < c; j++) {\n\t\t\t\tlist.add(scan.nextInt());\n\t\t\t}\n\t\t\tlists.add(list);\n\t\t}\n\t\t\n\t\tint temp = 0;\n\t\tfor(int i = 0; i < r; i++) {\n\t\t\tfor(int j = 0; j < c; j++) {\n\t\t\t\ttemp += lists.get(i).get(j);\n\t\t\t}\n\t\t\tlists.get(i).add(temp);\n\t\t\ttemp = 0;\n\t\t}\n\t\t\n\t\tArrayList<Integer> list_kari = new ArrayList<Integer>();\n\t\tint tempForAll = 0;\n\t\tfor(int i = 0; i < c; i++) {\n\t\t\tfor(int j = 0; j < r; j++) {\n\t\t\t\ttemp += lists.get(j).get(i);\n\t\t\t}\n\t\t\tlist_kari.add(temp);\n\t\t\ttempForAll += temp;\n\t\t\ttemp = 0;\n\t\t}\n\t\tlist_kari.add(tempForAll);\n\t\tlists.add(list_kari);\n\t\t\n\t\tfor(int i = 0; i < r + 1; i++) {\n\t\t\tfor(int j = 0; j < c + 1; j++) {\n\t\t\t\tif(j == 0) System.out.print(lists.get(i).get(j));\n\t\t\t\telse System.out.print(\" \" + lists.get(i).get(j));\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}\n\t\t\n\t}\n\n}",
"Main"
] | import java.util.ArrayList;
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();
ArrayList<ArrayList<Integer>> lists = new ArrayList<ArrayList<Integer>>();
for(int i = 0; i < r; i++) {
ArrayList<Integer> list = new ArrayList<Integer>();
for(int j = 0; j < c; j++) {
list.add(scan.nextInt());
}
lists.add(list);
}
int temp = 0;
for(int i = 0; i < r; i++) {
for(int j = 0; j < c; j++) {
temp += lists.get(i).get(j);
}
lists.get(i).add(temp);
temp = 0;
}
ArrayList<Integer> list_kari = new ArrayList<Integer>();
int tempForAll = 0;
for(int i = 0; i < c; i++) {
for(int j = 0; j < r; j++) {
temp += lists.get(j).get(i);
}
list_kari.add(temp);
tempForAll += temp;
temp = 0;
}
list_kari.add(tempForAll);
lists.add(list_kari);
for(int i = 0; i < r + 1; i++) {
for(int j = 0; j < c + 1; j++) {
if(j == 0) System.out.print(lists.get(i).get(j));
else System.out.print(" " + lists.get(i).get(j));
}
System.out.println();
}
}
}
|
[
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,
20,
41,
13,
4,
18,
4,
18,
13,
17,
41,
13,
4,
18,
13,
18,
13,
17,
41,
13,
4,
18,
13,
18,
13,
17,
41,
13,
20,
2,
13,
17,
2,
13,
17,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
4,
18,
4,
18,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
18,
18,
13,
13,
13,
4,
18,
13,
18,
13,
13,
0,
18,
18,
13,
13,
13,
18,
18,
13,
13,
13,
0,
13,
18,
18,
13,
13,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
18,
18,
13,
13,
13,
18,
18,
13,
13,
13,
0,
18,
18,
13,
13,
13,
13,
11,
1,
41,
13,
17,
2,
13,
2,
13,
17,
1,
40,
13,
30,
30,
11,
1,
41,
13,
17,
2,
13,
2,
13,
17,
1,
40,
13,
30,
30,
14,
2,
13,
17,
4,
18,
13,
17,
4,
18,
13,
18,
18,
13,
13,
13,
4,
18,
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
],
[
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
],
[
19,
26
],
[
26,
27
],
[
26,
28
],
[
28,
29
],
[
29,
30
],
[
30,
31
],
[
31,
32
],
[
28,
33
],
[
19,
34
],
[
34,
35
],
[
34,
36
],
[
36,
37
],
[
37,
38
],
[
36,
39
],
[
39,
40
],
[
39,
41
],
[
19,
42
],
[
42,
43
],
[
42,
44
],
[
44,
45
],
[
45,
46
],
[
44,
47
],
[
47,
48
],
[
47,
49
],
[
19,
50
],
[
50,
51
],
[
50,
52
],
[
53,
54
],
[
53,
55
],
[
56,
57
],
[
56,
58
],
[
19,
59
],
[
59,
60
],
[
59,
61
],
[
19,
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
],
[
95,
108
],
[
108,
109
],
[
109,
110
],
[
110,
111
],
[
110,
112
],
[
109,
113
],
[
108,
114
],
[
114,
115
],
[
115,
116
],
[
115,
117
],
[
114,
118
],
[
95,
119
],
[
119,
120
],
[
119,
121
],
[
121,
122
],
[
122,
123
],
[
122,
124
],
[
121,
125
],
[
19,
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
],
[
153,
154
],
[
154,
155
],
[
154,
156
],
[
153,
157
],
[
152,
158
],
[
158,
159
],
[
159,
160
],
[
159,
161
],
[
158,
162
],
[
19,
163
],
[
163,
164
],
[
164,
165
],
[
165,
166
],
[
165,
167
],
[
164,
168
],
[
163,
169
],
[
19,
170
],
[
170,
171
],
[
171,
172
],
[
172,
173
],
[
172,
174
],
[
170,
175
],
[
175,
176
],
[
175,
177
],
[
177,
178
],
[
177,
179
],
[
170,
180
],
[
180,
181
],
[
181,
182
],
[
170,
183
],
[
184,
184
],
[
184,
185
],
[
185,
186
],
[
186,
187
],
[
187,
188
],
[
187,
189
],
[
185,
190
],
[
190,
191
],
[
190,
192
],
[
192,
193
],
[
192,
194
],
[
185,
195
],
[
195,
196
],
[
196,
197
],
[
185,
198
],
[
199,
199
],
[
199,
200
],
[
200,
201
],
[
201,
202
],
[
201,
203
],
[
200,
204
],
[
204,
205
],
[
205,
206
],
[
204,
207
],
[
199,
208
],
[
208,
209
],
[
209,
210
],
[
208,
211
],
[
211,
212
],
[
212,
213
],
[
212,
214
],
[
211,
215
],
[
184,
216
],
[
216,
217
],
[
217,
218
],
[
216,
219
],
[
19,
220
],
[
220,
221
],
[
221,
222
],
[
222,
223
],
[
222,
224
],
[
220,
225
],
[
6,
226
],
[
226,
227
]
] | [
"/* ITP1_7_C */\nimport java.io.*;\n\nclass Main\n{\n public static void main(String[] args)\n {\n try{\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n StringBuilder sb = new StringBuilder();\n\n String[] input = br.readLine().split(\" \");\n int row = Integer.parseInt(input[0]);\n int column = Integer.parseInt(input[1]);\n int[][] matrix = new int[row + 1][column + 1];\n int all_sum = 0;\n\n // input & row sum\n for(int i = 0; i < row; i++){\n input = br.readLine().split(\" \");\n for(int j = 0; j < column; j++){\n matrix[i][j] = Integer.parseInt(input[j]);\n matrix[i][column] += matrix[i][j];\n all_sum += matrix[i][j];\n }\n }\n // column sum\n for(int j = 0; j < column; j++){\n for(int i = 0; i < row; i++){\n matrix[row][j] += matrix[i][j];\n }\n }\n matrix[row][column] = all_sum;\n\n // output\n for(int i = 0; i < (row+1); i++){\n for(int j = 0; j < (column+1); j++){\n if(j != 0) sb.append(\" \");\n sb.append(matrix[i][j]);\n }\n sb.append(\"\\n\");\n }\n System.out.print(sb);\n\n }catch(Exception e){\n System.out.println(e);\n }\n }\n}",
"import java.io.*;",
"io.*",
"java",
"class Main\n{\n public static void main(String[] args)\n {\n try{\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n StringBuilder sb = new StringBuilder();\n\n String[] input = br.readLine().split(\" \");\n int row = Integer.parseInt(input[0]);\n int column = Integer.parseInt(input[1]);\n int[][] matrix = new int[row + 1][column + 1];\n int all_sum = 0;\n\n // input & row sum\n for(int i = 0; i < row; i++){\n input = br.readLine().split(\" \");\n for(int j = 0; j < column; j++){\n matrix[i][j] = Integer.parseInt(input[j]);\n matrix[i][column] += matrix[i][j];\n all_sum += matrix[i][j];\n }\n }\n // column sum\n for(int j = 0; j < column; j++){\n for(int i = 0; i < row; i++){\n matrix[row][j] += matrix[i][j];\n }\n }\n matrix[row][column] = all_sum;\n\n // output\n for(int i = 0; i < (row+1); i++){\n for(int j = 0; j < (column+1); j++){\n if(j != 0) sb.append(\" \");\n sb.append(matrix[i][j]);\n }\n sb.append(\"\\n\");\n }\n System.out.print(sb);\n\n }catch(Exception e){\n System.out.println(e);\n }\n }\n}",
"Main",
"public static void main(String[] args)\n {\n try{\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n StringBuilder sb = new StringBuilder();\n\n String[] input = br.readLine().split(\" \");\n int row = Integer.parseInt(input[0]);\n int column = Integer.parseInt(input[1]);\n int[][] matrix = new int[row + 1][column + 1];\n int all_sum = 0;\n\n // input & row sum\n for(int i = 0; i < row; i++){\n input = br.readLine().split(\" \");\n for(int j = 0; j < column; j++){\n matrix[i][j] = Integer.parseInt(input[j]);\n matrix[i][column] += matrix[i][j];\n all_sum += matrix[i][j];\n }\n }\n // column sum\n for(int j = 0; j < column; j++){\n for(int i = 0; i < row; i++){\n matrix[row][j] += matrix[i][j];\n }\n }\n matrix[row][column] = all_sum;\n\n // output\n for(int i = 0; i < (row+1); i++){\n for(int j = 0; j < (column+1); j++){\n if(j != 0) sb.append(\" \");\n sb.append(matrix[i][j]);\n }\n sb.append(\"\\n\");\n }\n System.out.print(sb);\n\n }catch(Exception e){\n System.out.println(e);\n }\n }",
"main",
"{\n try{\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n StringBuilder sb = new StringBuilder();\n\n String[] input = br.readLine().split(\" \");\n int row = Integer.parseInt(input[0]);\n int column = Integer.parseInt(input[1]);\n int[][] matrix = new int[row + 1][column + 1];\n int all_sum = 0;\n\n // input & row sum\n for(int i = 0; i < row; i++){\n input = br.readLine().split(\" \");\n for(int j = 0; j < column; j++){\n matrix[i][j] = Integer.parseInt(input[j]);\n matrix[i][column] += matrix[i][j];\n all_sum += matrix[i][j];\n }\n }\n // column sum\n for(int j = 0; j < column; j++){\n for(int i = 0; i < row; i++){\n matrix[row][j] += matrix[i][j];\n }\n }\n matrix[row][column] = all_sum;\n\n // output\n for(int i = 0; i < (row+1); i++){\n for(int j = 0; j < (column+1); j++){\n if(j != 0) sb.append(\" \");\n sb.append(matrix[i][j]);\n }\n sb.append(\"\\n\");\n }\n System.out.print(sb);\n\n }catch(Exception e){\n System.out.println(e);\n }\n }",
"try{\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n StringBuilder sb = new StringBuilder();\n\n String[] input = br.readLine().split(\" \");\n int row = Integer.parseInt(input[0]);\n int column = Integer.parseInt(input[1]);\n int[][] matrix = new int[row + 1][column + 1];\n int all_sum = 0;\n\n // input & row sum\n for(int i = 0; i < row; i++){\n input = br.readLine().split(\" \");\n for(int j = 0; j < column; j++){\n matrix[i][j] = Integer.parseInt(input[j]);\n matrix[i][column] += matrix[i][j];\n all_sum += matrix[i][j];\n }\n }\n // column sum\n for(int j = 0; j < column; j++){\n for(int i = 0; i < row; i++){\n matrix[row][j] += matrix[i][j];\n }\n }\n matrix[row][column] = all_sum;\n\n // output\n for(int i = 0; i < (row+1); i++){\n for(int j = 0; j < (column+1); j++){\n if(j != 0) sb.append(\" \");\n sb.append(matrix[i][j]);\n }\n sb.append(\"\\n\");\n }\n System.out.print(sb);\n\n }catch(Exception e){\n System.out.println(e);\n }",
"catch(Exception e){\n System.out.println(e);\n }",
"Exception e",
"{\n System.out.println(e);\n }",
"System.out.println(e)",
"System.out.println",
"System.out",
"System",
"System.out",
"e",
"{\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n StringBuilder sb = new StringBuilder();\n\n String[] input = br.readLine().split(\" \");\n int row = Integer.parseInt(input[0]);\n int column = Integer.parseInt(input[1]);\n int[][] matrix = new int[row + 1][column + 1];\n int all_sum = 0;\n\n // input & row sum\n for(int i = 0; i < row; i++){\n input = br.readLine().split(\" \");\n for(int j = 0; j < column; j++){\n matrix[i][j] = Integer.parseInt(input[j]);\n matrix[i][column] += matrix[i][j];\n all_sum += matrix[i][j];\n }\n }\n // column sum\n for(int j = 0; j < column; j++){\n for(int i = 0; i < row; i++){\n matrix[row][j] += matrix[i][j];\n }\n }\n matrix[row][column] = all_sum;\n\n // output\n for(int i = 0; i < (row+1); i++){\n for(int j = 0; j < (column+1); j++){\n if(j != 0) sb.append(\" \");\n sb.append(matrix[i][j]);\n }\n sb.append(\"\\n\");\n }\n System.out.print(sb);\n\n }",
"BufferedReader br = new BufferedReader(new InputStreamReader(System.in));",
"br",
"new BufferedReader(new InputStreamReader(System.in))",
"StringBuilder sb = new StringBuilder();",
"sb",
"new StringBuilder()",
"String[] input = br.readLine().split(\" \");",
"input",
"br.readLine().split(\" \")",
"br.readLine().split",
"br.readLine()",
"br.readLine",
"br",
"\" \"",
"int row = Integer.parseInt(input[0]);",
"row",
"Integer.parseInt(input[0])",
"Integer.parseInt",
"Integer",
"input[0]",
"input",
"0",
"int column = Integer.parseInt(input[1]);",
"column",
"Integer.parseInt(input[1])",
"Integer.parseInt",
"Integer",
"input[1]",
"input",
"1",
"int[][] matrix = new int[row + 1][column + 1];",
"matrix",
"new int[row + 1][column + 1]",
"row + 1",
"row",
"1",
"column + 1",
"column",
"1",
"int all_sum = 0;",
"all_sum",
"0",
"for(int i = 0; i < row; i++){\n input = br.readLine().split(\" \");\n for(int j = 0; j < column; j++){\n matrix[i][j] = Integer.parseInt(input[j]);\n matrix[i][column] += matrix[i][j];\n all_sum += matrix[i][j];\n }\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < row",
"i",
"row",
"i++",
"i++",
"i",
"{\n input = br.readLine().split(\" \");\n for(int j = 0; j < column; j++){\n matrix[i][j] = Integer.parseInt(input[j]);\n matrix[i][column] += matrix[i][j];\n all_sum += matrix[i][j];\n }\n }",
"{\n input = br.readLine().split(\" \");\n for(int j = 0; j < column; j++){\n matrix[i][j] = Integer.parseInt(input[j]);\n matrix[i][column] += matrix[i][j];\n all_sum += matrix[i][j];\n }\n }",
"input = br.readLine().split(\" \")",
"input",
"br.readLine().split(\" \")",
"br.readLine().split",
"br.readLine()",
"br.readLine",
"br",
"\" \"",
"for(int j = 0; j < column; j++){\n matrix[i][j] = Integer.parseInt(input[j]);\n matrix[i][column] += matrix[i][j];\n all_sum += matrix[i][j];\n }",
"int j = 0;",
"int j = 0;",
"j",
"0",
"j < column",
"j",
"column",
"j++",
"j++",
"j",
"{\n matrix[i][j] = Integer.parseInt(input[j]);\n matrix[i][column] += matrix[i][j];\n all_sum += matrix[i][j];\n }",
"{\n matrix[i][j] = Integer.parseInt(input[j]);\n matrix[i][column] += matrix[i][j];\n all_sum += matrix[i][j];\n }",
"matrix[i][j] = Integer.parseInt(input[j])",
"matrix[i][j]",
"matrix[i]",
"matrix",
"i",
"j",
"Integer.parseInt(input[j])",
"Integer.parseInt",
"Integer",
"input[j]",
"input",
"j",
"matrix[i][column] += matrix[i][j]",
"matrix[i][column]",
"matrix[i]",
"matrix",
"i",
"column",
"matrix[i][j]",
"matrix[i]",
"matrix",
"i",
"j",
"all_sum += matrix[i][j]",
"all_sum",
"matrix[i][j]",
"matrix[i]",
"matrix",
"i",
"j",
"for(int j = 0; j < column; j++){\n for(int i = 0; i < row; i++){\n matrix[row][j] += matrix[i][j];\n }\n }",
"int j = 0;",
"int j = 0;",
"j",
"0",
"j < column",
"j",
"column",
"j++",
"j++",
"j",
"{\n for(int i = 0; i < row; i++){\n matrix[row][j] += matrix[i][j];\n }\n }",
"{\n for(int i = 0; i < row; i++){\n matrix[row][j] += matrix[i][j];\n }\n }",
"for(int i = 0; i < row; i++){\n matrix[row][j] += matrix[i][j];\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < row",
"i",
"row",
"i++",
"i++",
"i",
"{\n matrix[row][j] += matrix[i][j];\n }",
"{\n matrix[row][j] += matrix[i][j];\n }",
"matrix[row][j] += matrix[i][j]",
"matrix[row][j]",
"matrix[row]",
"matrix",
"row",
"j",
"matrix[i][j]",
"matrix[i]",
"matrix",
"i",
"j",
"matrix[row][column] = all_sum",
"matrix[row][column]",
"matrix[row]",
"matrix",
"row",
"column",
"all_sum",
"for(int i = 0; i < (row+1); i++){\n for(int j = 0; j < (column+1); j++){\n if(j != 0) sb.append(\" \");\n sb.append(matrix[i][j]);\n }\n sb.append(\"\\n\");\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < (row+1)",
"i",
"(row+1)",
"row",
"1",
"i++",
"i++",
"i",
"{\n for(int j = 0; j < (column+1); j++){\n if(j != 0) sb.append(\" \");\n sb.append(matrix[i][j]);\n }\n sb.append(\"\\n\");\n }",
"{\n for(int j = 0; j < (column+1); j++){\n if(j != 0) sb.append(\" \");\n sb.append(matrix[i][j]);\n }\n sb.append(\"\\n\");\n }",
"for(int j = 0; j < (column+1); j++){\n if(j != 0) sb.append(\" \");\n sb.append(matrix[i][j]);\n }",
"int j = 0;",
"int j = 0;",
"j",
"0",
"j < (column+1)",
"j",
"(column+1)",
"column",
"1",
"j++",
"j++",
"j",
"{\n if(j != 0) sb.append(\" \");\n sb.append(matrix[i][j]);\n }",
"{\n if(j != 0) sb.append(\" \");\n sb.append(matrix[i][j]);\n }",
"if(j != 0) sb.append(\" \");",
"j != 0",
"j",
"0",
"sb.append(\" \")",
"sb.append",
"sb",
"\" \"",
"sb.append(matrix[i][j])",
"sb.append",
"sb",
"matrix[i][j]",
"matrix[i]",
"matrix",
"i",
"j",
"sb.append(\"\\n\")",
"sb.append",
"sb",
"\"\\n\"",
"System.out.print(sb)",
"System.out.print",
"System.out",
"System",
"System.out",
"sb",
"String[] args",
"args"
] | /* ITP1_7_C */
import java.io.*;
class Main
{
public static void main(String[] args)
{
try{
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
StringBuilder sb = new StringBuilder();
String[] input = br.readLine().split(" ");
int row = Integer.parseInt(input[0]);
int column = Integer.parseInt(input[1]);
int[][] matrix = new int[row + 1][column + 1];
int all_sum = 0;
// input & row sum
for(int i = 0; i < row; i++){
input = br.readLine().split(" ");
for(int j = 0; j < column; j++){
matrix[i][j] = Integer.parseInt(input[j]);
matrix[i][column] += matrix[i][j];
all_sum += matrix[i][j];
}
}
// column sum
for(int j = 0; j < column; j++){
for(int i = 0; i < row; i++){
matrix[row][j] += matrix[i][j];
}
}
matrix[row][column] = all_sum;
// output
for(int i = 0; i < (row+1); i++){
for(int j = 0; j < (column+1); j++){
if(j != 0) sb.append(" ");
sb.append(matrix[i][j]);
}
sb.append("\n");
}
System.out.print(sb);
}catch(Exception e){
System.out.println(e);
}
}
} |
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
41,
13,
41,
13,
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,
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,
0,
18,
18,
13,
13,
13,
13,
11,
1,
41,
13,
17,
2,
13,
2,
13,
17,
1,
40,
13,
30,
0,
18,
18,
13,
13,
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,
0,
18,
18,
13,
13,
13,
18,
18,
13,
13,
13,
14,
2,
13,
13,
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
],
[
8,
11
],
[
11,
12
],
[
8,
13
],
[
13,
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
],
[
52,
54
],
[
51,
55
],
[
55,
56
],
[
56,
57
],
[
57,
58
],
[
57,
59
],
[
55,
60
],
[
60,
61
],
[
60,
62
],
[
55,
63
],
[
63,
64
],
[
64,
65
],
[
55,
66
],
[
67,
67
],
[
67,
68
],
[
68,
69
],
[
69,
70
],
[
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
],
[
51,
84
],
[
84,
85
],
[
85,
86
],
[
86,
87
],
[
86,
88
],
[
85,
89
],
[
84,
90
],
[
8,
91
],
[
91,
92
],
[
92,
93
],
[
93,
94
],
[
93,
95
],
[
91,
96
],
[
96,
97
],
[
96,
98
],
[
98,
99
],
[
98,
100
],
[
91,
101
],
[
101,
102
],
[
102,
103
],
[
91,
104
],
[
104,
105
],
[
105,
106
],
[
106,
107
],
[
107,
108
],
[
107,
109
],
[
106,
110
],
[
105,
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
],
[
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
],
[
148,
149
],
[
148,
150
],
[
147,
151
],
[
141,
152
],
[
152,
153
],
[
153,
154
],
[
154,
155
],
[
154,
156
],
[
153,
157
],
[
152,
158
],
[
158,
159
],
[
159,
160
],
[
159,
161
],
[
158,
162
],
[
141,
163
],
[
163,
164
],
[
164,
165
],
[
164,
166
],
[
163,
167
],
[
167,
168
],
[
168,
169
],
[
169,
170
],
[
169,
171
],
[
167,
172
],
[
126,
173
],
[
173,
174
],
[
174,
175
],
[
175,
176
],
[
175,
177
],
[
6,
178
],
[
178,
179
]
] | [
"import java.util.Scanner;\n\nclass Main {\n public static void main(String[] args) {\n int r, c, sum;\n int[][] table;\n Scanner sc = new Scanner(System.in);\n r = sc.nextInt();\n c = sc.nextInt();\n table = new int[r + 1][c + 1];\n for (int i = 0; i < r; i++) {\n sum = 0;\n for (int j = 0; j < c; j++) {\n table[i][j] = sc.nextInt();\n sum += table[i][j];\n }\n table[i][c] = sum;\n }\n\n for (int i = 0; i < c + 1; i++) \n table[r][i] = 0;\n\n for (int i = 0; i < r + 1; i++) {\n for (int j = 0; j < c + 1; j++) {\n System.out.print(table[i][j]);\n table[r][j] += table[i][j];\n if (j != c)\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 int r, c, sum;\n int[][] table;\n Scanner sc = new Scanner(System.in);\n r = sc.nextInt();\n c = sc.nextInt();\n table = new int[r + 1][c + 1];\n for (int i = 0; i < r; i++) {\n sum = 0;\n for (int j = 0; j < c; j++) {\n table[i][j] = sc.nextInt();\n sum += table[i][j];\n }\n table[i][c] = sum;\n }\n\n for (int i = 0; i < c + 1; i++) \n table[r][i] = 0;\n\n for (int i = 0; i < r + 1; i++) {\n for (int j = 0; j < c + 1; j++) {\n System.out.print(table[i][j]);\n table[r][j] += table[i][j];\n if (j != c)\n System.out.print(\" \");\n }\n System.out.println();\n }\n }\n}",
"Main",
"public static void main(String[] args) {\n int r, c, sum;\n int[][] table;\n Scanner sc = new Scanner(System.in);\n r = sc.nextInt();\n c = sc.nextInt();\n table = new int[r + 1][c + 1];\n for (int i = 0; i < r; i++) {\n sum = 0;\n for (int j = 0; j < c; j++) {\n table[i][j] = sc.nextInt();\n sum += table[i][j];\n }\n table[i][c] = sum;\n }\n\n for (int i = 0; i < c + 1; i++) \n table[r][i] = 0;\n\n for (int i = 0; i < r + 1; i++) {\n for (int j = 0; j < c + 1; j++) {\n System.out.print(table[i][j]);\n table[r][j] += table[i][j];\n if (j != c)\n System.out.print(\" \");\n }\n System.out.println();\n }\n }",
"main",
"{\n int r, c, sum;\n int[][] table;\n Scanner sc = new Scanner(System.in);\n r = sc.nextInt();\n c = sc.nextInt();\n table = new int[r + 1][c + 1];\n for (int i = 0; i < r; i++) {\n sum = 0;\n for (int j = 0; j < c; j++) {\n table[i][j] = sc.nextInt();\n sum += table[i][j];\n }\n table[i][c] = sum;\n }\n\n for (int i = 0; i < c + 1; i++) \n table[r][i] = 0;\n\n for (int i = 0; i < r + 1; i++) {\n for (int j = 0; j < c + 1; j++) {\n System.out.print(table[i][j]);\n table[r][j] += table[i][j];\n if (j != c)\n System.out.print(\" \");\n }\n System.out.println();\n }\n }",
"int r",
"r",
"c",
"c",
"sum;",
"sum",
"int[][] table;",
"table",
"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",
"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 sum = 0;\n for (int j = 0; j < c; j++) {\n table[i][j] = sc.nextInt();\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 sum = 0;\n for (int j = 0; j < c; j++) {\n table[i][j] = sc.nextInt();\n sum += table[i][j];\n }\n table[i][c] = sum;\n }",
"{\n sum = 0;\n for (int j = 0; j < c; j++) {\n table[i][j] = sc.nextInt();\n sum += table[i][j];\n }\n table[i][c] = sum;\n }",
"sum = 0",
"sum",
"0",
"for (int j = 0; j < c; j++) {\n table[i][j] = sc.nextInt();\n sum += table[i][j];\n }",
"int j = 0;",
"int 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][c] = sum",
"table[i][c]",
"table[i]",
"table",
"i",
"c",
"sum",
"for (int i = 0; i < c + 1; i++) \n table[r][i] = 0;",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < c + 1",
"i",
"c + 1",
"c",
"1",
"i++",
"i++",
"i",
"table[r][i] = 0;",
"table[r][i] = 0",
"table[r][i]",
"table[r]",
"table",
"r",
"i",
"0",
"for (int i = 0; i < r + 1; i++) {\n for (int j = 0; j < c + 1; j++) {\n System.out.print(table[i][j]);\n table[r][j] += table[i][j];\n if (j != c)\n System.out.print(\" \");\n }\n System.out.println();\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < r + 1",
"i",
"r + 1",
"r",
"1",
"i++",
"i++",
"i",
"{\n for (int j = 0; j < c + 1; j++) {\n System.out.print(table[i][j]);\n table[r][j] += table[i][j];\n if (j != c)\n System.out.print(\" \");\n }\n System.out.println();\n }",
"{\n for (int j = 0; j < c + 1; j++) {\n System.out.print(table[i][j]);\n table[r][j] += table[i][j];\n if (j != c)\n System.out.print(\" \");\n }\n System.out.println();\n }",
"for (int j = 0; j < c + 1; j++) {\n System.out.print(table[i][j]);\n table[r][j] += table[i][j];\n if (j != c)\n System.out.print(\" \");\n }",
"int j = 0;",
"int j = 0;",
"j",
"0",
"j < c + 1",
"j",
"c + 1",
"c",
"1",
"j++",
"j++",
"j",
"{\n System.out.print(table[i][j]);\n table[r][j] += table[i][j];\n if (j != c)\n System.out.print(\" \");\n }",
"{\n System.out.print(table[i][j]);\n table[r][j] += table[i][j];\n if (j != c)\n System.out.print(\" \");\n }",
"System.out.print(table[i][j])",
"System.out.print",
"System.out",
"System",
"System.out",
"table[i][j]",
"table[i]",
"table",
"i",
"j",
"table[r][j] += table[i][j]",
"table[r][j]",
"table[r]",
"table",
"r",
"j",
"table[i][j]",
"table[i]",
"table",
"i",
"j",
"if (j != c)\n System.out.print(\" \");",
"j != c",
"j",
"c",
"System.out.print(\" \")",
"System.out.print",
"System.out",
"System",
"System.out",
"\" \"",
"System.out.println()",
"System.out.println",
"System.out",
"System",
"System.out",
"String[] args",
"args"
] | import java.util.Scanner;
class Main {
public static void main(String[] args) {
int r, c, sum;
int[][] table;
Scanner sc = new Scanner(System.in);
r = sc.nextInt();
c = sc.nextInt();
table = new int[r + 1][c + 1];
for (int i = 0; i < r; i++) {
sum = 0;
for (int j = 0; j < c; j++) {
table[i][j] = sc.nextInt();
sum += table[i][j];
}
table[i][c] = sum;
}
for (int i = 0; i < c + 1; i++)
table[r][i] = 0;
for (int i = 0; i < r + 1; i++) {
for (int j = 0; j < c + 1; j++) {
System.out.print(table[i][j]);
table[r][j] += table[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,
41,
13,
41,
13,
17,
41,
13,
17,
41,
13,
17,
41,
13,
17,
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,
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,
0,
13,
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,
13,
18,
18,
13,
13,
13,
0,
18,
18,
13,
13,
13,
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,
4,
18,
18,
13,
13,
18,
18,
13,
13,
13,
14,
2,
13,
13,
30,
3,
4,
18,
18,
13,
13,
17,
14,
2,
13,
13,
30,
4,
18,
18,
13,
13,
4,
18,
13,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
216,
5
],
[
216,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
8,
14
],
[
14,
15
],
[
8,
16
],
[
16,
17
],
[
16,
18
],
[
8,
19
],
[
19,
20
],
[
19,
21
],
[
8,
22
],
[
22,
23
],
[
22,
24
],
[
8,
25
],
[
25,
26
],
[
25,
27
],
[
8,
28
],
[
28,
29
],
[
28,
30
],
[
30,
31
],
[
31,
32
],
[
8,
33
],
[
33,
34
],
[
33,
35
],
[
35,
36
],
[
36,
37
],
[
8,
38
],
[
38,
39
],
[
38,
40
],
[
41,
42
],
[
41,
43
],
[
44,
45
],
[
44,
46
],
[
8,
47
],
[
47,
48
],
[
48,
49
],
[
49,
50
],
[
49,
51
],
[
47,
52
],
[
52,
53
],
[
52,
54
],
[
47,
55
],
[
55,
56
],
[
56,
57
],
[
47,
58
],
[
59,
59
],
[
59,
60
],
[
60,
61
],
[
60,
62
],
[
59,
63
],
[
63,
64
],
[
64,
65
],
[
65,
66
],
[
65,
67
],
[
63,
68
],
[
68,
69
],
[
68,
70
],
[
63,
71
],
[
71,
72
],
[
72,
73
],
[
63,
74
],
[
75,
75
],
[
75,
76
],
[
76,
77
],
[
77,
78
],
[
78,
79
],
[
78,
80
],
[
77,
81
],
[
76,
82
],
[
82,
83
],
[
83,
84
],
[
75,
85
],
[
85,
86
],
[
85,
87
],
[
87,
88
],
[
88,
89
],
[
88,
90
],
[
87,
91
],
[
59,
92
],
[
92,
93
],
[
93,
94
],
[
94,
95
],
[
94,
96
],
[
93,
97
],
[
92,
98
],
[
59,
99
],
[
99,
100
],
[
99,
101
],
[
8,
102
],
[
102,
103
],
[
103,
104
],
[
104,
105
],
[
104,
106
],
[
102,
107
],
[
107,
108
],
[
107,
109
],
[
102,
110
],
[
110,
111
],
[
111,
112
],
[
102,
113
],
[
114,
114
],
[
114,
115
],
[
115,
116
],
[
115,
117
],
[
114,
118
],
[
118,
119
],
[
119,
120
],
[
120,
121
],
[
120,
122
],
[
118,
123
],
[
123,
124
],
[
123,
125
],
[
118,
126
],
[
126,
127
],
[
127,
128
],
[
118,
129
],
[
130,
130
],
[
130,
131
],
[
131,
132
],
[
131,
133
],
[
133,
134
],
[
134,
135
],
[
134,
136
],
[
133,
137
],
[
114,
138
],
[
138,
139
],
[
139,
140
],
[
140,
141
],
[
140,
142
],
[
139,
143
],
[
138,
144
],
[
8,
145
],
[
145,
146
],
[
146,
147
],
[
147,
148
],
[
147,
149
],
[
146,
150
],
[
145,
151
],
[
8,
152
],
[
152,
153
],
[
153,
154
],
[
154,
155
],
[
154,
156
],
[
152,
157
],
[
157,
158
],
[
157,
159
],
[
152,
160
],
[
160,
161
],
[
161,
162
],
[
152,
163
],
[
164,
164
],
[
164,
165
],
[
165,
166
],
[
166,
167
],
[
167,
168
],
[
167,
169
],
[
165,
170
],
[
170,
171
],
[
170,
172
],
[
165,
173
],
[
173,
174
],
[
174,
175
],
[
165,
176
],
[
177,
177
],
[
177,
178
],
[
178,
179
],
[
179,
180
],
[
180,
181
],
[
180,
182
],
[
178,
183
],
[
183,
184
],
[
184,
185
],
[
184,
186
],
[
183,
187
],
[
177,
188
],
[
188,
189
],
[
189,
190
],
[
189,
191
],
[
188,
192
],
[
192,
193
],
[
177,
194
],
[
194,
195
],
[
195,
196
],
[
196,
197
],
[
196,
198
],
[
194,
199
],
[
164,
200
],
[
200,
201
],
[
201,
202
],
[
201,
203
],
[
200,
204
],
[
204,
205
],
[
205,
206
],
[
206,
207
],
[
207,
208
],
[
207,
209
],
[
164,
210
],
[
210,
211
],
[
211,
212
],
[
6,
213
],
[
213,
214
],
[
0,
215
],
[
215,
216
],
[
215,
217
]
] | [
"import java.util.Scanner;\n\n\npublic class Main{\n\n\tpublic static void main(String[] args) {\n\n\t\tScanner sc = new Scanner(System.in);\n\t\tint r,c,i=0,j=0,d=0;\n\t\tint sum=0;\n\n\t\tr = sc.nextInt();\n\t\tc = sc.nextInt();\n\t\tint table[][] = new int[r+1][c+1];\n\n\t\tfor(i=0;i<r;i++){\n\t\t\tsum = 0;\n\t\t\tfor(j=0;j<c;j++){\n\t\t\t\ttable[i][j] = sc.nextInt();\n\t\t\t\tsum += table[i][j];\n\t\t\t}\n\t\t\ttable[i][j] = sum;\n\t\t\td += sum;\n\t\t}\n\t\tfor(i=0;i<c;i++){\n\t\t\tsum = 0;\n\t\t\tfor(j=0;j<r;j++){\n\t\t\t\tsum += table[j][i];\n\t\t\t}\n\t\t\ttable[j][i] = sum;\n\t\t}\n\t\ttable[j][i] = d;\n\t\tfor(i=0;i<=r;i++){\n\t\t\tfor(j=0;j<=c;j++){\n\t\t\t\tSystem.out.print(table[i][j]);\n\t\t\t\tif(c == j){\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\tif(i<=r){\n\t\t\t\tSystem.out.println();\n\t\t\t}\n\t\t\t\n\t\t\tsc.close();\n\t\t}\n\t}\n\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main{\n\n\tpublic static void main(String[] args) {\n\n\t\tScanner sc = new Scanner(System.in);\n\t\tint r,c,i=0,j=0,d=0;\n\t\tint sum=0;\n\n\t\tr = sc.nextInt();\n\t\tc = sc.nextInt();\n\t\tint table[][] = new int[r+1][c+1];\n\n\t\tfor(i=0;i<r;i++){\n\t\t\tsum = 0;\n\t\t\tfor(j=0;j<c;j++){\n\t\t\t\ttable[i][j] = sc.nextInt();\n\t\t\t\tsum += table[i][j];\n\t\t\t}\n\t\t\ttable[i][j] = sum;\n\t\t\td += sum;\n\t\t}\n\t\tfor(i=0;i<c;i++){\n\t\t\tsum = 0;\n\t\t\tfor(j=0;j<r;j++){\n\t\t\t\tsum += table[j][i];\n\t\t\t}\n\t\t\ttable[j][i] = sum;\n\t\t}\n\t\ttable[j][i] = d;\n\t\tfor(i=0;i<=r;i++){\n\t\t\tfor(j=0;j<=c;j++){\n\t\t\t\tSystem.out.print(table[i][j]);\n\t\t\t\tif(c == j){\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\tif(i<=r){\n\t\t\t\tSystem.out.println();\n\t\t\t}\n\t\t\t\n\t\t\tsc.close();\n\t\t}\n\t}\n\n}",
"Main",
"public static void main(String[] args) {\n\n\t\tScanner sc = new Scanner(System.in);\n\t\tint r,c,i=0,j=0,d=0;\n\t\tint sum=0;\n\n\t\tr = sc.nextInt();\n\t\tc = sc.nextInt();\n\t\tint table[][] = new int[r+1][c+1];\n\n\t\tfor(i=0;i<r;i++){\n\t\t\tsum = 0;\n\t\t\tfor(j=0;j<c;j++){\n\t\t\t\ttable[i][j] = sc.nextInt();\n\t\t\t\tsum += table[i][j];\n\t\t\t}\n\t\t\ttable[i][j] = sum;\n\t\t\td += sum;\n\t\t}\n\t\tfor(i=0;i<c;i++){\n\t\t\tsum = 0;\n\t\t\tfor(j=0;j<r;j++){\n\t\t\t\tsum += table[j][i];\n\t\t\t}\n\t\t\ttable[j][i] = sum;\n\t\t}\n\t\ttable[j][i] = d;\n\t\tfor(i=0;i<=r;i++){\n\t\t\tfor(j=0;j<=c;j++){\n\t\t\t\tSystem.out.print(table[i][j]);\n\t\t\t\tif(c == j){\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\tif(i<=r){\n\t\t\t\tSystem.out.println();\n\t\t\t}\n\t\t\t\n\t\t\tsc.close();\n\t\t}\n\t}",
"main",
"{\n\n\t\tScanner sc = new Scanner(System.in);\n\t\tint r,c,i=0,j=0,d=0;\n\t\tint sum=0;\n\n\t\tr = sc.nextInt();\n\t\tc = sc.nextInt();\n\t\tint table[][] = new int[r+1][c+1];\n\n\t\tfor(i=0;i<r;i++){\n\t\t\tsum = 0;\n\t\t\tfor(j=0;j<c;j++){\n\t\t\t\ttable[i][j] = sc.nextInt();\n\t\t\t\tsum += table[i][j];\n\t\t\t}\n\t\t\ttable[i][j] = sum;\n\t\t\td += sum;\n\t\t}\n\t\tfor(i=0;i<c;i++){\n\t\t\tsum = 0;\n\t\t\tfor(j=0;j<r;j++){\n\t\t\t\tsum += table[j][i];\n\t\t\t}\n\t\t\ttable[j][i] = sum;\n\t\t}\n\t\ttable[j][i] = d;\n\t\tfor(i=0;i<=r;i++){\n\t\t\tfor(j=0;j<=c;j++){\n\t\t\t\tSystem.out.print(table[i][j]);\n\t\t\t\tif(c == j){\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\tif(i<=r){\n\t\t\t\tSystem.out.println();\n\t\t\t}\n\t\t\t\n\t\t\tsc.close();\n\t\t}\n\t}",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"int r",
"r",
"c",
"c",
"i=0",
"i",
"0",
"j=0",
"j",
"0",
"d=0;",
"d",
"0",
"int sum=0;",
"sum",
"0",
"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",
"for(i=0;i<r;i++){\n\t\t\tsum = 0;\n\t\t\tfor(j=0;j<c;j++){\n\t\t\t\ttable[i][j] = sc.nextInt();\n\t\t\t\tsum += table[i][j];\n\t\t\t}\n\t\t\ttable[i][j] = sum;\n\t\t\td += sum;\n\t\t}",
"i=0;",
"i=0",
"i",
"0",
"i<r",
"i",
"r",
"i++",
"i++",
"i",
"{\n\t\t\tsum = 0;\n\t\t\tfor(j=0;j<c;j++){\n\t\t\t\ttable[i][j] = sc.nextInt();\n\t\t\t\tsum += table[i][j];\n\t\t\t}\n\t\t\ttable[i][j] = sum;\n\t\t\td += sum;\n\t\t}",
"{\n\t\t\tsum = 0;\n\t\t\tfor(j=0;j<c;j++){\n\t\t\t\ttable[i][j] = sc.nextInt();\n\t\t\t\tsum += table[i][j];\n\t\t\t}\n\t\t\ttable[i][j] = sum;\n\t\t\td += sum;\n\t\t}",
"sum = 0",
"sum",
"0",
"for(j=0;j<c;j++){\n\t\t\t\ttable[i][j] = sc.nextInt();\n\t\t\t\tsum += table[i][j];\n\t\t\t}",
"j=0;",
"j=0",
"j",
"0",
"j<c",
"j",
"c",
"j++",
"j++",
"j",
"{\n\t\t\t\ttable[i][j] = sc.nextInt();\n\t\t\t\tsum += table[i][j];\n\t\t\t}",
"{\n\t\t\t\ttable[i][j] = sc.nextInt();\n\t\t\t\tsum += table[i][j];\n\t\t\t}",
"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",
"d += sum",
"d",
"sum",
"for(i=0;i<c;i++){\n\t\t\tsum = 0;\n\t\t\tfor(j=0;j<r;j++){\n\t\t\t\tsum += table[j][i];\n\t\t\t}\n\t\t\ttable[j][i] = sum;\n\t\t}",
"i=0;",
"i=0",
"i",
"0",
"i<c",
"i",
"c",
"i++",
"i++",
"i",
"{\n\t\t\tsum = 0;\n\t\t\tfor(j=0;j<r;j++){\n\t\t\t\tsum += table[j][i];\n\t\t\t}\n\t\t\ttable[j][i] = sum;\n\t\t}",
"{\n\t\t\tsum = 0;\n\t\t\tfor(j=0;j<r;j++){\n\t\t\t\tsum += table[j][i];\n\t\t\t}\n\t\t\ttable[j][i] = sum;\n\t\t}",
"sum = 0",
"sum",
"0",
"for(j=0;j<r;j++){\n\t\t\t\tsum += table[j][i];\n\t\t\t}",
"j=0;",
"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",
"table[j][i] = sum",
"table[j][i]",
"table[j]",
"table",
"j",
"i",
"sum",
"table[j][i] = d",
"table[j][i]",
"table[j]",
"table",
"j",
"i",
"d",
"for(i=0;i<=r;i++){\n\t\t\tfor(j=0;j<=c;j++){\n\t\t\t\tSystem.out.print(table[i][j]);\n\t\t\t\tif(c == j){\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\tif(i<=r){\n\t\t\t\tSystem.out.println();\n\t\t\t}\n\t\t\t\n\t\t\tsc.close();\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(table[i][j]);\n\t\t\t\tif(c == j){\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\tif(i<=r){\n\t\t\t\tSystem.out.println();\n\t\t\t}\n\t\t\t\n\t\t\tsc.close();\n\t\t}",
"{\n\t\t\tfor(j=0;j<=c;j++){\n\t\t\t\tSystem.out.print(table[i][j]);\n\t\t\t\tif(c == j){\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\tif(i<=r){\n\t\t\t\tSystem.out.println();\n\t\t\t}\n\t\t\t\n\t\t\tsc.close();\n\t\t}",
"for(j=0;j<=c;j++){\n\t\t\t\tSystem.out.print(table[i][j]);\n\t\t\t\tif(c == j){\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\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(table[i][j]);\n\t\t\t\tif(c == j){\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t\n\t\t\t}",
"{\n\t\t\t\tSystem.out.print(table[i][j]);\n\t\t\t\tif(c == j){\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t\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(c == j){\n\t\t\t\t\tbreak;\n\t\t\t\t}",
"c == j",
"c",
"j",
"{\n\t\t\t\t\tbreak;\n\t\t\t\t}",
"break;",
"System.out.print(\" \")",
"System.out.print",
"System.out",
"System",
"System.out",
"\" \"",
"if(i<=r){\n\t\t\t\tSystem.out.println();\n\t\t\t}",
"i<=r",
"i",
"r",
"{\n\t\t\t\tSystem.out.println();\n\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\n\tpublic static void main(String[] args) {\n\n\t\tScanner sc = new Scanner(System.in);\n\t\tint r,c,i=0,j=0,d=0;\n\t\tint sum=0;\n\n\t\tr = sc.nextInt();\n\t\tc = sc.nextInt();\n\t\tint table[][] = new int[r+1][c+1];\n\n\t\tfor(i=0;i<r;i++){\n\t\t\tsum = 0;\n\t\t\tfor(j=0;j<c;j++){\n\t\t\t\ttable[i][j] = sc.nextInt();\n\t\t\t\tsum += table[i][j];\n\t\t\t}\n\t\t\ttable[i][j] = sum;\n\t\t\td += sum;\n\t\t}\n\t\tfor(i=0;i<c;i++){\n\t\t\tsum = 0;\n\t\t\tfor(j=0;j<r;j++){\n\t\t\t\tsum += table[j][i];\n\t\t\t}\n\t\t\ttable[j][i] = sum;\n\t\t}\n\t\ttable[j][i] = d;\n\t\tfor(i=0;i<=r;i++){\n\t\t\tfor(j=0;j<=c;j++){\n\t\t\t\tSystem.out.print(table[i][j]);\n\t\t\t\tif(c == j){\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\tif(i<=r){\n\t\t\t\tSystem.out.println();\n\t\t\t}\n\t\t\t\n\t\t\tsc.close();\n\t\t}\n\t}\n\n}",
"public class Main{\n\n\tpublic static void main(String[] args) {\n\n\t\tScanner sc = new Scanner(System.in);\n\t\tint r,c,i=0,j=0,d=0;\n\t\tint sum=0;\n\n\t\tr = sc.nextInt();\n\t\tc = sc.nextInt();\n\t\tint table[][] = new int[r+1][c+1];\n\n\t\tfor(i=0;i<r;i++){\n\t\t\tsum = 0;\n\t\t\tfor(j=0;j<c;j++){\n\t\t\t\ttable[i][j] = sc.nextInt();\n\t\t\t\tsum += table[i][j];\n\t\t\t}\n\t\t\ttable[i][j] = sum;\n\t\t\td += sum;\n\t\t}\n\t\tfor(i=0;i<c;i++){\n\t\t\tsum = 0;\n\t\t\tfor(j=0;j<r;j++){\n\t\t\t\tsum += table[j][i];\n\t\t\t}\n\t\t\ttable[j][i] = sum;\n\t\t}\n\t\ttable[j][i] = d;\n\t\tfor(i=0;i<=r;i++){\n\t\t\tfor(j=0;j<=c;j++){\n\t\t\t\tSystem.out.print(table[i][j]);\n\t\t\t\tif(c == j){\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\tif(i<=r){\n\t\t\t\tSystem.out.println();\n\t\t\t}\n\t\t\t\n\t\t\tsc.close();\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,c,i=0,j=0,d=0;
int sum=0;
r = sc.nextInt();
c = sc.nextInt();
int table[][] = new int[r+1][c+1];
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;
d += sum;
}
for(i=0;i<c;i++){
sum = 0;
for(j=0;j<r;j++){
sum += table[j][i];
}
table[j][i] = sum;
}
table[j][i] = d;
for(i=0;i<=r;i++){
for(j=0;j<=c;j++){
System.out.print(table[i][j]);
if(c == j){
break;
}
System.out.print(" ");
}
if(i<=r){
System.out.println();
}
sc.close();
}
}
}
|
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
4,
18,
13,
17,
41,
13,
4,
18,
13,
18,
13,
17,
41,
13,
4,
18,
13,
18,
13,
17,
41,
13,
20,
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,
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,
18,
13,
13,
0,
13,
2,
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,
2,
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,
13,
1,
40,
13,
30,
30,
4,
18,
18,
13,
13,
2,
18,
18,
13,
13,
13,
17,
4,
18,
18,
13,
13,
18,
18,
13,
13,
13,
23,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
16,
17
],
[
17,
18
],
[
14,
19
],
[
8,
20
],
[
20,
21
],
[
20,
22
],
[
22,
23
],
[
23,
24
],
[
22,
25
],
[
25,
26
],
[
25,
27
],
[
8,
28
],
[
28,
29
],
[
28,
30
],
[
30,
31
],
[
31,
32
],
[
30,
33
],
[
33,
34
],
[
33,
35
],
[
8,
36
],
[
36,
37
],
[
36,
38
],
[
39,
40
],
[
39,
41
],
[
42,
43
],
[
42,
44
],
[
8,
45
],
[
45,
46
],
[
46,
47
],
[
47,
48
],
[
47,
49
],
[
45,
50
],
[
50,
51
],
[
50,
52
],
[
45,
53
],
[
53,
54
],
[
54,
55
],
[
45,
56
],
[
57,
57
],
[
57,
58
],
[
58,
59
],
[
58,
60
],
[
60,
61
],
[
61,
62
],
[
62,
63
],
[
63,
64
],
[
60,
65
],
[
57,
66
],
[
66,
67
],
[
66,
68
],
[
57,
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
],
[
81,
94
],
[
94,
95
],
[
94,
96
],
[
96,
97
],
[
96,
98
],
[
98,
99
],
[
99,
100
],
[
99,
101
],
[
98,
102
],
[
57,
103
],
[
103,
104
],
[
104,
105
],
[
105,
106
],
[
105,
107
],
[
104,
108
],
[
103,
109
],
[
8,
110
],
[
110,
111
],
[
111,
112
],
[
112,
113
],
[
112,
114
],
[
110,
115
],
[
115,
116
],
[
115,
117
],
[
117,
118
],
[
117,
119
],
[
110,
120
],
[
120,
121
],
[
121,
122
],
[
110,
123
],
[
124,
124
],
[
124,
125
],
[
125,
126
],
[
125,
127
],
[
124,
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
],
[
143,
145
],
[
145,
146
],
[
146,
147
],
[
146,
148
],
[
145,
149
],
[
124,
150
],
[
150,
151
],
[
151,
152
],
[
152,
153
],
[
152,
154
],
[
151,
155
],
[
150,
156
],
[
8,
157
],
[
157,
158
],
[
158,
159
],
[
159,
160
],
[
159,
161
],
[
157,
162
],
[
162,
163
],
[
162,
164
],
[
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
],
[
172,
180
],
[
180,
181
],
[
181,
182
],
[
172,
183
],
[
184,
184
],
[
184,
185
],
[
185,
186
],
[
186,
187
],
[
187,
188
],
[
187,
189
],
[
185,
190
],
[
190,
191
],
[
191,
192
],
[
192,
193
],
[
192,
194
],
[
191,
195
],
[
190,
196
],
[
171,
197
],
[
197,
198
],
[
198,
199
],
[
199,
200
],
[
199,
201
],
[
197,
202
],
[
202,
203
],
[
203,
204
],
[
203,
205
],
[
202,
206
],
[
6,
207
],
[
207,
208
]
] | [
"import java.util.*;\n\nclass Main{\n\tpublic static void main(String[] args){\n\t\tScanner sc = new Scanner(System.in);\n\t\tString[] input =sc.nextLine().split(\" \");\n\t\tint r = Integer.parseInt(input[0]);\n\t\tint c = Integer.parseInt(input[1]);\n\t\tint[][] sheet = new int[r+1][c+1];\n\t//in\t\n\t\tfor(int i=0;i<r;i++){\n\t\t\tString[] line = sc.nextLine().split(\" \");\n\t\t\tint sum=0;\n\t\t\tfor(int j=0;j<c;j++){\n\t\t\t\tsheet[i][j]=Integer.parseInt(line[j]);\n\t\t\t\tsum = sum+sheet[i][j];\n\t\t\t}\n\t\t\tsheet[i][c]=sum;\n\t\t}\t\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=sum+sheet[j][i];\n\t\t\t}\n\t\t\tsheet[r][i]=sum;\n\t\t}\n\t//out\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.print(sheet[i][j]+\" \");\n\t\t\t}\n\t\t\tSystem.out.println(sheet[i][c]);\n\t\t}\n\t}\n}",
"import java.util.*;",
"util.*",
"java",
"class Main{\n\tpublic static void main(String[] args){\n\t\tScanner sc = new Scanner(System.in);\n\t\tString[] input =sc.nextLine().split(\" \");\n\t\tint r = Integer.parseInt(input[0]);\n\t\tint c = Integer.parseInt(input[1]);\n\t\tint[][] sheet = new int[r+1][c+1];\n\t//in\t\n\t\tfor(int i=0;i<r;i++){\n\t\t\tString[] line = sc.nextLine().split(\" \");\n\t\t\tint sum=0;\n\t\t\tfor(int j=0;j<c;j++){\n\t\t\t\tsheet[i][j]=Integer.parseInt(line[j]);\n\t\t\t\tsum = sum+sheet[i][j];\n\t\t\t}\n\t\t\tsheet[i][c]=sum;\n\t\t}\t\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=sum+sheet[j][i];\n\t\t\t}\n\t\t\tsheet[r][i]=sum;\n\t\t}\n\t//out\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.print(sheet[i][j]+\" \");\n\t\t\t}\n\t\t\tSystem.out.println(sheet[i][c]);\n\t\t}\n\t}\n}",
"Main",
"public static void main(String[] args){\n\t\tScanner sc = new Scanner(System.in);\n\t\tString[] input =sc.nextLine().split(\" \");\n\t\tint r = Integer.parseInt(input[0]);\n\t\tint c = Integer.parseInt(input[1]);\n\t\tint[][] sheet = new int[r+1][c+1];\n\t//in\t\n\t\tfor(int i=0;i<r;i++){\n\t\t\tString[] line = sc.nextLine().split(\" \");\n\t\t\tint sum=0;\n\t\t\tfor(int j=0;j<c;j++){\n\t\t\t\tsheet[i][j]=Integer.parseInt(line[j]);\n\t\t\t\tsum = sum+sheet[i][j];\n\t\t\t}\n\t\t\tsheet[i][c]=sum;\n\t\t}\t\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=sum+sheet[j][i];\n\t\t\t}\n\t\t\tsheet[r][i]=sum;\n\t\t}\n\t//out\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.print(sheet[i][j]+\" \");\n\t\t\t}\n\t\t\tSystem.out.println(sheet[i][c]);\n\t\t}\n\t}",
"main",
"{\n\t\tScanner sc = new Scanner(System.in);\n\t\tString[] input =sc.nextLine().split(\" \");\n\t\tint r = Integer.parseInt(input[0]);\n\t\tint c = Integer.parseInt(input[1]);\n\t\tint[][] sheet = new int[r+1][c+1];\n\t//in\t\n\t\tfor(int i=0;i<r;i++){\n\t\t\tString[] line = sc.nextLine().split(\" \");\n\t\t\tint sum=0;\n\t\t\tfor(int j=0;j<c;j++){\n\t\t\t\tsheet[i][j]=Integer.parseInt(line[j]);\n\t\t\t\tsum = sum+sheet[i][j];\n\t\t\t}\n\t\t\tsheet[i][c]=sum;\n\t\t}\t\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=sum+sheet[j][i];\n\t\t\t}\n\t\t\tsheet[r][i]=sum;\n\t\t}\n\t//out\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.print(sheet[i][j]+\" \");\n\t\t\t}\n\t\t\tSystem.out.println(sheet[i][c]);\n\t\t}\n\t}",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"String[] input =sc.nextLine().split(\" \");",
"input",
"sc.nextLine().split(\" \")",
"sc.nextLine().split",
"sc.nextLine()",
"sc.nextLine",
"sc",
"\" \"",
"int r = Integer.parseInt(input[0]);",
"r",
"Integer.parseInt(input[0])",
"Integer.parseInt",
"Integer",
"input[0]",
"input",
"0",
"int c = Integer.parseInt(input[1]);",
"c",
"Integer.parseInt(input[1])",
"Integer.parseInt",
"Integer",
"input[1]",
"input",
"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\tString[] line = sc.nextLine().split(\" \");\n\t\t\tint sum=0;\n\t\t\tfor(int j=0;j<c;j++){\n\t\t\t\tsheet[i][j]=Integer.parseInt(line[j]);\n\t\t\t\tsum = sum+sheet[i][j];\n\t\t\t}\n\t\t\tsheet[i][c]=sum;\n\t\t}",
"int i=0;",
"int i=0;",
"i",
"0",
"i<r",
"i",
"r",
"i++",
"i++",
"i",
"{\n\t\t\tString[] line = sc.nextLine().split(\" \");\n\t\t\tint sum=0;\n\t\t\tfor(int j=0;j<c;j++){\n\t\t\t\tsheet[i][j]=Integer.parseInt(line[j]);\n\t\t\t\tsum = sum+sheet[i][j];\n\t\t\t}\n\t\t\tsheet[i][c]=sum;\n\t\t}",
"{\n\t\t\tString[] line = sc.nextLine().split(\" \");\n\t\t\tint sum=0;\n\t\t\tfor(int j=0;j<c;j++){\n\t\t\t\tsheet[i][j]=Integer.parseInt(line[j]);\n\t\t\t\tsum = sum+sheet[i][j];\n\t\t\t}\n\t\t\tsheet[i][c]=sum;\n\t\t}",
"String[] line = sc.nextLine().split(\" \");",
"line",
"sc.nextLine().split(\" \")",
"sc.nextLine().split",
"sc.nextLine()",
"sc.nextLine",
"sc",
"\" \"",
"int sum=0;",
"sum",
"0",
"for(int j=0;j<c;j++){\n\t\t\t\tsheet[i][j]=Integer.parseInt(line[j]);\n\t\t\t\tsum = sum+sheet[i][j];\n\t\t\t}",
"int j=0;",
"int j=0;",
"j",
"0",
"j<c",
"j",
"c",
"j++",
"j++",
"j",
"{\n\t\t\t\tsheet[i][j]=Integer.parseInt(line[j]);\n\t\t\t\tsum = sum+sheet[i][j];\n\t\t\t}",
"{\n\t\t\t\tsheet[i][j]=Integer.parseInt(line[j]);\n\t\t\t\tsum = sum+sheet[i][j];\n\t\t\t}",
"sheet[i][j]=Integer.parseInt(line[j])",
"sheet[i][j]",
"sheet[i]",
"sheet",
"i",
"j",
"Integer.parseInt(line[j])",
"Integer.parseInt",
"Integer",
"line[j]",
"line",
"j",
"sum = sum+sheet[i][j]",
"sum",
"sum+sheet[i][j]",
"sum",
"sheet[i][j]",
"sheet[i]",
"sheet",
"i",
"j",
"sheet[i][c]=sum",
"sheet[i][c]",
"sheet[i]",
"sheet",
"i",
"c",
"sum",
"for(int i=0;i<c+1;i++){\n\t\t\tint sum=0;\n\t\t\tfor(int j=0;j<r;j++){\n\t\t\t\tsum=sum+sheet[j][i];\n\t\t\t}\n\t\t\tsheet[r][i]=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=sum+sheet[j][i];\n\t\t\t}\n\t\t\tsheet[r][i]=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=sum+sheet[j][i];\n\t\t\t}\n\t\t\tsheet[r][i]=sum;\n\t\t}",
"int sum=0;",
"sum",
"0",
"for(int j=0;j<r;j++){\n\t\t\t\tsum=sum+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\tsum=sum+sheet[j][i];\n\t\t\t}",
"{\n\t\t\t\tsum=sum+sheet[j][i];\n\t\t\t}",
"sum=sum+sheet[j][i]",
"sum",
"sum+sheet[j][i]",
"sum",
"sheet[j][i]",
"sheet[j]",
"sheet",
"j",
"i",
"sheet[r][i]=sum",
"sheet[r][i]",
"sheet[r]",
"sheet",
"r",
"i",
"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.print(sheet[i][j]+\" \");\n\t\t\t}\n\t\t\tSystem.out.println(sheet[i][c]);\n\t\t}",
"int i=0;",
"int i=0;",
"i",
"0",
"i<r+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.print(sheet[i][j]+\" \");\n\t\t\t}\n\t\t\tSystem.out.println(sheet[i][c]);\n\t\t}",
"{\n\t\t\tfor(int j=0;j<c;j++){\n\t\t\t\tSystem.out.print(sheet[i][j]+\" \");\n\t\t\t}\n\t\t\tSystem.out.println(sheet[i][c]);\n\t\t}",
"for(int j=0;j<c;j++){\n\t\t\t\tSystem.out.print(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\tSystem.out.print(sheet[i][j]+\" \");\n\t\t\t}",
"{\n\t\t\t\tSystem.out.print(sheet[i][j]+\" \");\n\t\t\t}",
"System.out.print(sheet[i][j]+\" \")",
"System.out.print",
"System.out",
"System",
"System.out",
"sheet[i][j]+\" \"",
"sheet[i][j]",
"sheet[i]",
"sheet",
"i",
"j",
"\" \"",
"System.out.println(sheet[i][c])",
"System.out.println",
"System.out",
"System",
"System.out",
"sheet[i][c]",
"sheet[i]",
"sheet",
"i",
"c",
"String[] args",
"args"
] | import java.util.*;
class Main{
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
String[] input =sc.nextLine().split(" ");
int r = Integer.parseInt(input[0]);
int c = Integer.parseInt(input[1]);
int[][] sheet = new int[r+1][c+1];
//in
for(int i=0;i<r;i++){
String[] line = sc.nextLine().split(" ");
int sum=0;
for(int j=0;j<c;j++){
sheet[i][j]=Integer.parseInt(line[j]);
sum = sum+sheet[i][j];
}
sheet[i][c]=sum;
}
for(int i=0;i<c+1;i++){
int sum=0;
for(int j=0;j<r;j++){
sum=sum+sheet[j][i];
}
sheet[r][i]=sum;
}
//out
for(int i=0;i<r+1;i++){
for(int j=0;j<c;j++){
System.out.print(sheet[i][j]+" ");
}
System.out.println(sheet[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,
13,
13,
41,
13,
20,
13,
41,
13,
20,
13,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
41,
13,
4,
18,
13,
0,
18,
18,
13,
13,
13,
13,
0,
18,
13,
13,
13,
0,
18,
13,
13,
13,
0,
13,
13,
11,
1,
41,
13,
17,
2,
13,
2,
13,
17,
1,
40,
13,
30,
30,
14,
2,
13,
13,
11,
1,
41,
13,
17,
2,
13,
2,
13,
17,
1,
40,
13,
30,
30,
14,
2,
13,
13,
4,
18,
18,
13,
13,
2,
18,
18,
13,
13,
13,
17,
4,
18,
18,
13,
13,
18,
13,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
4,
18,
18,
13,
13,
2,
18,
13,
13,
17,
4,
18,
18,
13,
13,
13,
23,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
8,
17
],
[
17,
18
],
[
17,
19
],
[
19,
20
],
[
20,
21
],
[
8,
22
],
[
22,
23
],
[
22,
24
],
[
8,
27
],
[
27,
28
],
[
27,
29
],
[
8,
31
],
[
31,
32
],
[
31,
33
],
[
8,
35
],
[
35,
36
],
[
35,
37
],
[
8,
38
],
[
38,
39
],
[
39,
40
],
[
40,
41
],
[
40,
42
],
[
38,
43
],
[
43,
44
],
[
43,
45
],
[
38,
46
],
[
46,
47
],
[
47,
48
],
[
38,
49
],
[
50,
50
],
[
50,
51
],
[
51,
52
],
[
52,
53
],
[
53,
54
],
[
53,
55
],
[
51,
56
],
[
56,
57
],
[
56,
58
],
[
51,
59
],
[
59,
60
],
[
60,
61
],
[
51,
62
],
[
63,
63
],
[
63,
64
],
[
64,
65
],
[
64,
66
],
[
66,
67
],
[
67,
68
],
[
63,
69
],
[
69,
70
],
[
70,
71
],
[
71,
72
],
[
71,
73
],
[
70,
74
],
[
69,
75
],
[
63,
76
],
[
76,
77
],
[
77,
78
],
[
77,
79
],
[
76,
80
],
[
63,
81
],
[
81,
82
],
[
82,
83
],
[
82,
84
],
[
81,
85
],
[
63,
86
],
[
86,
87
],
[
86,
88
],
[
8,
89
],
[
89,
90
],
[
90,
91
],
[
91,
92
],
[
91,
93
],
[
89,
94
],
[
94,
95
],
[
94,
96
],
[
96,
97
],
[
96,
98
],
[
89,
99
],
[
99,
100
],
[
100,
101
],
[
89,
102
],
[
103,
103
],
[
103,
104
],
[
104,
105
],
[
105,
106
],
[
105,
107
],
[
104,
108
],
[
108,
109
],
[
109,
110
],
[
110,
111
],
[
110,
112
],
[
108,
113
],
[
113,
114
],
[
113,
115
],
[
115,
116
],
[
115,
117
],
[
108,
118
],
[
118,
119
],
[
119,
120
],
[
108,
121
],
[
122,
122
],
[
122,
123
],
[
123,
124
],
[
124,
125
],
[
124,
126
],
[
123,
127
],
[
127,
128
],
[
128,
129
],
[
129,
130
],
[
129,
131
],
[
127,
132
],
[
132,
133
],
[
133,
134
],
[
134,
135
],
[
134,
136
],
[
133,
137
],
[
132,
138
],
[
123,
139
],
[
139,
140
],
[
140,
141
],
[
141,
142
],
[
141,
143
],
[
139,
144
],
[
144,
145
],
[
144,
146
],
[
104,
147
],
[
147,
148
],
[
148,
149
],
[
149,
150
],
[
149,
151
],
[
147,
152
],
[
152,
153
],
[
152,
154
],
[
147,
155
],
[
155,
156
],
[
156,
157
],
[
147,
158
],
[
159,
159
],
[
159,
160
],
[
160,
161
],
[
161,
162
],
[
162,
163
],
[
162,
164
],
[
160,
165
],
[
165,
166
],
[
166,
167
],
[
166,
168
],
[
165,
169
],
[
8,
170
],
[
170,
171
],
[
171,
172
],
[
172,
173
],
[
172,
174
],
[
170,
175
],
[
6,
176
],
[
176,
177
]
] | [
"import java.util.*;\n\nclass Main {\n\tpublic static void main(String[] args) {\n\t\tScanner stdIn = new Scanner(System.in);\n\t\tint r = stdIn.nextInt();\n\t\tint c = stdIn.nextInt();\n\t\tint[][] A = new int[r][c];\n\t\tint[] b = new int[r];\n\t\tint[] b2 = new int[c];\n\t\tint sum = 0;\n\t\tfor (int i=0; i<r; i++) {\n\t\t\tfor (int j=0; j<c; j++) {\n\t\t\t\tint x = stdIn.nextInt();\n\t\t\t\tA[i][j] = x;\n\t\t\t\tb[i] += x;\n\t\t\t\tb2[j] += x;\n\t\t\t\tsum += x;\n\t\t\t}\n\t\t}\n\t\tfor (int i=0; i<r+1; i++) {\n\t\t\tif(i<r)\n\t\t\t\tfor (int j=0; j<c+1; j++) {\n\t\t\t\t\tif(j<c)\n\t\t\t\t\t\tSystem.out.print(A[i][j]+\" \");\n\t\t\t\t\telse\n\t\t\t\t\t\tSystem.out.println(b[i]);\n\t\t\t\t}\n\t\t\telse\n\t\t\t\tfor (int k=0; k<c; k++) {\n\t\t\t\t\tSystem.out.print(b2[k]+\" \");\n\t\t\t\t}\n\t\t}\n\t\tSystem.out.println(sum);\n\t}\n}",
"import java.util.*;",
"util.*",
"java",
"class Main {\n\tpublic static void main(String[] args) {\n\t\tScanner stdIn = new Scanner(System.in);\n\t\tint r = stdIn.nextInt();\n\t\tint c = stdIn.nextInt();\n\t\tint[][] A = new int[r][c];\n\t\tint[] b = new int[r];\n\t\tint[] b2 = new int[c];\n\t\tint sum = 0;\n\t\tfor (int i=0; i<r; i++) {\n\t\t\tfor (int j=0; j<c; j++) {\n\t\t\t\tint x = stdIn.nextInt();\n\t\t\t\tA[i][j] = x;\n\t\t\t\tb[i] += x;\n\t\t\t\tb2[j] += x;\n\t\t\t\tsum += x;\n\t\t\t}\n\t\t}\n\t\tfor (int i=0; i<r+1; i++) {\n\t\t\tif(i<r)\n\t\t\t\tfor (int j=0; j<c+1; j++) {\n\t\t\t\t\tif(j<c)\n\t\t\t\t\t\tSystem.out.print(A[i][j]+\" \");\n\t\t\t\t\telse\n\t\t\t\t\t\tSystem.out.println(b[i]);\n\t\t\t\t}\n\t\t\telse\n\t\t\t\tfor (int k=0; k<c; k++) {\n\t\t\t\t\tSystem.out.print(b2[k]+\" \");\n\t\t\t\t}\n\t\t}\n\t\tSystem.out.println(sum);\n\t}\n}",
"Main",
"public static void main(String[] args) {\n\t\tScanner stdIn = new Scanner(System.in);\n\t\tint r = stdIn.nextInt();\n\t\tint c = stdIn.nextInt();\n\t\tint[][] A = new int[r][c];\n\t\tint[] b = new int[r];\n\t\tint[] b2 = new int[c];\n\t\tint sum = 0;\n\t\tfor (int i=0; i<r; i++) {\n\t\t\tfor (int j=0; j<c; j++) {\n\t\t\t\tint x = stdIn.nextInt();\n\t\t\t\tA[i][j] = x;\n\t\t\t\tb[i] += x;\n\t\t\t\tb2[j] += x;\n\t\t\t\tsum += x;\n\t\t\t}\n\t\t}\n\t\tfor (int i=0; i<r+1; i++) {\n\t\t\tif(i<r)\n\t\t\t\tfor (int j=0; j<c+1; j++) {\n\t\t\t\t\tif(j<c)\n\t\t\t\t\t\tSystem.out.print(A[i][j]+\" \");\n\t\t\t\t\telse\n\t\t\t\t\t\tSystem.out.println(b[i]);\n\t\t\t\t}\n\t\t\telse\n\t\t\t\tfor (int k=0; k<c; k++) {\n\t\t\t\t\tSystem.out.print(b2[k]+\" \");\n\t\t\t\t}\n\t\t}\n\t\tSystem.out.println(sum);\n\t}",
"main",
"{\n\t\tScanner stdIn = new Scanner(System.in);\n\t\tint r = stdIn.nextInt();\n\t\tint c = stdIn.nextInt();\n\t\tint[][] A = new int[r][c];\n\t\tint[] b = new int[r];\n\t\tint[] b2 = new int[c];\n\t\tint sum = 0;\n\t\tfor (int i=0; i<r; i++) {\n\t\t\tfor (int j=0; j<c; j++) {\n\t\t\t\tint x = stdIn.nextInt();\n\t\t\t\tA[i][j] = x;\n\t\t\t\tb[i] += x;\n\t\t\t\tb2[j] += x;\n\t\t\t\tsum += x;\n\t\t\t}\n\t\t}\n\t\tfor (int i=0; i<r+1; i++) {\n\t\t\tif(i<r)\n\t\t\t\tfor (int j=0; j<c+1; j++) {\n\t\t\t\t\tif(j<c)\n\t\t\t\t\t\tSystem.out.print(A[i][j]+\" \");\n\t\t\t\t\telse\n\t\t\t\t\t\tSystem.out.println(b[i]);\n\t\t\t\t}\n\t\t\telse\n\t\t\t\tfor (int k=0; k<c; k++) {\n\t\t\t\t\tSystem.out.print(b2[k]+\" \");\n\t\t\t\t}\n\t\t}\n\t\tSystem.out.println(sum);\n\t}",
"Scanner stdIn = new Scanner(System.in);",
"stdIn",
"new Scanner(System.in)",
"int r = stdIn.nextInt();",
"r",
"stdIn.nextInt()",
"stdIn.nextInt",
"stdIn",
"int c = stdIn.nextInt();",
"c",
"stdIn.nextInt()",
"stdIn.nextInt",
"stdIn",
"int[][] A = new int[r][c];",
"A",
"new int[r][c]",
"r",
"c",
"int[] b = new int[r];",
"b",
"new int[r]",
"r",
"int[] b2 = new int[c];",
"b2",
"new int[c]",
"c",
"int sum = 0;",
"sum",
"0",
"for (int i=0; i<r; i++) {\n\t\t\tfor (int j=0; j<c; j++) {\n\t\t\t\tint x = stdIn.nextInt();\n\t\t\t\tA[i][j] = x;\n\t\t\t\tb[i] += x;\n\t\t\t\tb2[j] += x;\n\t\t\t\tsum += x;\n\t\t\t}\n\t\t}",
"int i=0;",
"int i=0;",
"i",
"0",
"i<r",
"i",
"r",
"i++",
"i++",
"i",
"{\n\t\t\tfor (int j=0; j<c; j++) {\n\t\t\t\tint x = stdIn.nextInt();\n\t\t\t\tA[i][j] = x;\n\t\t\t\tb[i] += x;\n\t\t\t\tb2[j] += x;\n\t\t\t\tsum += x;\n\t\t\t}\n\t\t}",
"{\n\t\t\tfor (int j=0; j<c; j++) {\n\t\t\t\tint x = stdIn.nextInt();\n\t\t\t\tA[i][j] = x;\n\t\t\t\tb[i] += x;\n\t\t\t\tb2[j] += x;\n\t\t\t\tsum += x;\n\t\t\t}\n\t\t}",
"for (int j=0; j<c; j++) {\n\t\t\t\tint x = stdIn.nextInt();\n\t\t\t\tA[i][j] = x;\n\t\t\t\tb[i] += x;\n\t\t\t\tb2[j] += x;\n\t\t\t\tsum += x;\n\t\t\t}",
"int j=0;",
"int j=0;",
"j",
"0",
"j<c",
"j",
"c",
"j++",
"j++",
"j",
"{\n\t\t\t\tint x = stdIn.nextInt();\n\t\t\t\tA[i][j] = x;\n\t\t\t\tb[i] += x;\n\t\t\t\tb2[j] += x;\n\t\t\t\tsum += x;\n\t\t\t}",
"{\n\t\t\t\tint x = stdIn.nextInt();\n\t\t\t\tA[i][j] = x;\n\t\t\t\tb[i] += x;\n\t\t\t\tb2[j] += x;\n\t\t\t\tsum += x;\n\t\t\t}",
"int x = stdIn.nextInt();",
"x",
"stdIn.nextInt()",
"stdIn.nextInt",
"stdIn",
"A[i][j] = x",
"A[i][j]",
"A[i]",
"A",
"i",
"j",
"x",
"b[i] += x",
"b[i]",
"b",
"i",
"x",
"b2[j] += x",
"b2[j]",
"b2",
"j",
"x",
"sum += x",
"sum",
"x",
"for (int i=0; i<r+1; i++) {\n\t\t\tif(i<r)\n\t\t\t\tfor (int j=0; j<c+1; j++) {\n\t\t\t\t\tif(j<c)\n\t\t\t\t\t\tSystem.out.print(A[i][j]+\" \");\n\t\t\t\t\telse\n\t\t\t\t\t\tSystem.out.println(b[i]);\n\t\t\t\t}\n\t\t\telse\n\t\t\t\tfor (int k=0; k<c; k++) {\n\t\t\t\t\tSystem.out.print(b2[k]+\" \");\n\t\t\t\t}\n\t\t}",
"int i=0;",
"int i=0;",
"i",
"0",
"i<r+1",
"i",
"r+1",
"r",
"1",
"i++",
"i++",
"i",
"{\n\t\t\tif(i<r)\n\t\t\t\tfor (int j=0; j<c+1; j++) {\n\t\t\t\t\tif(j<c)\n\t\t\t\t\t\tSystem.out.print(A[i][j]+\" \");\n\t\t\t\t\telse\n\t\t\t\t\t\tSystem.out.println(b[i]);\n\t\t\t\t}\n\t\t\telse\n\t\t\t\tfor (int k=0; k<c; k++) {\n\t\t\t\t\tSystem.out.print(b2[k]+\" \");\n\t\t\t\t}\n\t\t}",
"{\n\t\t\tif(i<r)\n\t\t\t\tfor (int j=0; j<c+1; j++) {\n\t\t\t\t\tif(j<c)\n\t\t\t\t\t\tSystem.out.print(A[i][j]+\" \");\n\t\t\t\t\telse\n\t\t\t\t\t\tSystem.out.println(b[i]);\n\t\t\t\t}\n\t\t\telse\n\t\t\t\tfor (int k=0; k<c; k++) {\n\t\t\t\t\tSystem.out.print(b2[k]+\" \");\n\t\t\t\t}\n\t\t}",
"if(i<r)\n\t\t\t\tfor (int j=0; j<c+1; j++) {\n\t\t\t\t\tif(j<c)\n\t\t\t\t\t\tSystem.out.print(A[i][j]+\" \");\n\t\t\t\t\telse\n\t\t\t\t\t\tSystem.out.println(b[i]);\n\t\t\t\t}\n\t\t\telse\n\t\t\t\tfor (int k=0; k<c; k++) {\n\t\t\t\t\tSystem.out.print(b2[k]+\" \");\n\t\t\t\t}",
"i<r",
"i",
"r",
"for (int j=0; j<c+1; j++) {\n\t\t\t\t\tif(j<c)\n\t\t\t\t\t\tSystem.out.print(A[i][j]+\" \");\n\t\t\t\t\telse\n\t\t\t\t\t\tSystem.out.println(b[i]);\n\t\t\t\t}",
"int j=0;",
"int j=0;",
"j",
"0",
"j<c+1",
"j",
"c+1",
"c",
"1",
"j++",
"j++",
"j",
"{\n\t\t\t\t\tif(j<c)\n\t\t\t\t\t\tSystem.out.print(A[i][j]+\" \");\n\t\t\t\t\telse\n\t\t\t\t\t\tSystem.out.println(b[i]);\n\t\t\t\t}",
"{\n\t\t\t\t\tif(j<c)\n\t\t\t\t\t\tSystem.out.print(A[i][j]+\" \");\n\t\t\t\t\telse\n\t\t\t\t\t\tSystem.out.println(b[i]);\n\t\t\t\t}",
"if(j<c)\n\t\t\t\t\t\tSystem.out.print(A[i][j]+\" \");\n\t\t\t\t\telse\n\t\t\t\t\t\tSystem.out.println(b[i]);",
"j<c",
"j",
"c",
"System.out.print(A[i][j]+\" \")",
"System.out.print",
"System.out",
"System",
"System.out",
"A[i][j]+\" \"",
"A[i][j]",
"A[i]",
"A",
"i",
"j",
"\" \"",
"System.out.println(b[i])",
"System.out.println",
"System.out",
"System",
"System.out",
"b[i]",
"b",
"i",
"for (int k=0; k<c; k++) {\n\t\t\t\t\tSystem.out.print(b2[k]+\" \");\n\t\t\t\t}",
"int k=0;",
"int k=0;",
"k",
"0",
"k<c",
"k",
"c",
"k++",
"k++",
"k",
"{\n\t\t\t\t\tSystem.out.print(b2[k]+\" \");\n\t\t\t\t}",
"{\n\t\t\t\t\tSystem.out.print(b2[k]+\" \");\n\t\t\t\t}",
"System.out.print(b2[k]+\" \")",
"System.out.print",
"System.out",
"System",
"System.out",
"b2[k]+\" \"",
"b2[k]",
"b2",
"k",
"\" \"",
"System.out.println(sum)",
"System.out.println",
"System.out",
"System",
"System.out",
"sum",
"String[] args",
"args"
] | import java.util.*;
class Main {
public static void main(String[] args) {
Scanner stdIn = new Scanner(System.in);
int r = stdIn.nextInt();
int c = stdIn.nextInt();
int[][] A = new int[r][c];
int[] b = new int[r];
int[] b2 = new int[c];
int sum = 0;
for (int i=0; i<r; i++) {
for (int j=0; j<c; j++) {
int x = stdIn.nextInt();
A[i][j] = x;
b[i] += x;
b2[j] += x;
sum += x;
}
}
for (int i=0; i<r+1; i++) {
if(i<r)
for (int j=0; j<c+1; j++) {
if(j<c)
System.out.print(A[i][j]+" ");
else
System.out.println(b[i]);
}
else
for (int k=0; k<c; k++) {
System.out.print(b2[k]+" ");
}
}
System.out.println(sum);
}
} |
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
41,
13,
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,
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,
0,
18,
18,
13,
13,
13,
18,
18,
13,
13,
13,
0,
18,
18,
13,
13,
13,
18,
18,
13,
13,
13,
0,
18,
18,
13,
13,
13,
18,
18,
13,
13,
13,
11,
1,
0,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
11,
1,
0,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
4,
18,
18,
13,
13,
18,
18,
13,
13,
13,
14,
2,
13,
13,
30,
4,
18,
18,
13,
13,
30,
4,
18,
18,
13,
13,
17,
23,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
8,
14
],
[
14,
15
],
[
8,
16
],
[
16,
17
],
[
16,
18
],
[
18,
19
],
[
19,
20
],
[
20,
21
],
[
21,
22
],
[
18,
23
],
[
8,
24
],
[
24,
25
],
[
24,
26
],
[
26,
27
],
[
27,
28
],
[
26,
29
],
[
29,
30
],
[
29,
31
],
[
8,
32
],
[
32,
33
],
[
32,
34
],
[
34,
35
],
[
35,
36
],
[
34,
37
],
[
37,
38
],
[
37,
39
],
[
8,
40
],
[
40,
41
],
[
40,
42
],
[
43,
44
],
[
43,
45
],
[
46,
47
],
[
46,
48
],
[
8,
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
],
[
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
],
[
84,
88
],
[
83,
89
],
[
89,
90
],
[
90,
91
],
[
89,
92
],
[
92,
93
],
[
92,
94
],
[
82,
95
],
[
95,
96
],
[
96,
97
],
[
97,
98
],
[
97,
99
],
[
96,
100
],
[
95,
101
],
[
101,
102
],
[
102,
103
],
[
102,
104
],
[
101,
105
],
[
82,
106
],
[
106,
107
],
[
107,
108
],
[
108,
109
],
[
108,
110
],
[
107,
111
],
[
106,
112
],
[
112,
113
],
[
113,
114
],
[
113,
115
],
[
112,
116
],
[
61,
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
],
[
156,
157
],
[
156,
158
],
[
154,
159
],
[
159,
160
],
[
160,
161
],
[
160,
162
],
[
159,
163
],
[
153,
164
],
[
164,
165
],
[
165,
166
],
[
165,
167
],
[
164,
168
],
[
168,
169
],
[
169,
170
],
[
170,
171
],
[
171,
172
],
[
171,
173
],
[
164,
174
],
[
174,
175
],
[
175,
176
],
[
176,
177
],
[
177,
178
],
[
177,
179
],
[
175,
180
],
[
6,
181
],
[
181,
182
]
] | [
"import java.io.*;\nclass Main{\n\tpublic static void main(String[]args)throws IOException{\n\t\tBufferedReader br=new BufferedReader(new InputStreamReader(System.in));\n\t\tint i,j;\n\t\tString[] rc=br.readLine().split(\" \");\n\t\tint r=Integer.parseInt(rc[0]);\n\t\tint c=Integer.parseInt(rc[1]);\n\t\t\n\t\tint[][] sheet=new int[r+1][c+1];\n\t\t\n\t\tfor(i=0;i<r;i++){\n\t\t\tString[] num=br.readLine().split(\" \");\n\t\t\tfor(j=0;j<c;j++){\n\t\t\t\tsheet[i][j]=Integer.parseInt(num[j]);\n\t\t\t\tsheet[i][c]+=sheet[i][j];\n\t\t\t\tsheet[r][j]+=sheet[i][j];\n\t\t\t}\n\t\t\tsheet[r][c]+=sheet[i][c];\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\tif(j==c){\n\t\t\t\t\tSystem.out.println();\n\t\t\t\t}\n\t\t\t\telse{\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.io.*;",
"io.*",
"java",
"class Main{\n\tpublic static void main(String[]args)throws IOException{\n\t\tBufferedReader br=new BufferedReader(new InputStreamReader(System.in));\n\t\tint i,j;\n\t\tString[] rc=br.readLine().split(\" \");\n\t\tint r=Integer.parseInt(rc[0]);\n\t\tint c=Integer.parseInt(rc[1]);\n\t\t\n\t\tint[][] sheet=new int[r+1][c+1];\n\t\t\n\t\tfor(i=0;i<r;i++){\n\t\t\tString[] num=br.readLine().split(\" \");\n\t\t\tfor(j=0;j<c;j++){\n\t\t\t\tsheet[i][j]=Integer.parseInt(num[j]);\n\t\t\t\tsheet[i][c]+=sheet[i][j];\n\t\t\t\tsheet[r][j]+=sheet[i][j];\n\t\t\t}\n\t\t\tsheet[r][c]+=sheet[i][c];\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\tif(j==c){\n\t\t\t\t\tSystem.out.println();\n\t\t\t\t}\n\t\t\t\telse{\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)throws IOException{\n\t\tBufferedReader br=new BufferedReader(new InputStreamReader(System.in));\n\t\tint i,j;\n\t\tString[] rc=br.readLine().split(\" \");\n\t\tint r=Integer.parseInt(rc[0]);\n\t\tint c=Integer.parseInt(rc[1]);\n\t\t\n\t\tint[][] sheet=new int[r+1][c+1];\n\t\t\n\t\tfor(i=0;i<r;i++){\n\t\t\tString[] num=br.readLine().split(\" \");\n\t\t\tfor(j=0;j<c;j++){\n\t\t\t\tsheet[i][j]=Integer.parseInt(num[j]);\n\t\t\t\tsheet[i][c]+=sheet[i][j];\n\t\t\t\tsheet[r][j]+=sheet[i][j];\n\t\t\t}\n\t\t\tsheet[r][c]+=sheet[i][c];\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\tif(j==c){\n\t\t\t\t\tSystem.out.println();\n\t\t\t\t}\n\t\t\t\telse{\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\tBufferedReader br=new BufferedReader(new InputStreamReader(System.in));\n\t\tint i,j;\n\t\tString[] rc=br.readLine().split(\" \");\n\t\tint r=Integer.parseInt(rc[0]);\n\t\tint c=Integer.parseInt(rc[1]);\n\t\t\n\t\tint[][] sheet=new int[r+1][c+1];\n\t\t\n\t\tfor(i=0;i<r;i++){\n\t\t\tString[] num=br.readLine().split(\" \");\n\t\t\tfor(j=0;j<c;j++){\n\t\t\t\tsheet[i][j]=Integer.parseInt(num[j]);\n\t\t\t\tsheet[i][c]+=sheet[i][j];\n\t\t\t\tsheet[r][j]+=sheet[i][j];\n\t\t\t}\n\t\t\tsheet[r][c]+=sheet[i][c];\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\tif(j==c){\n\t\t\t\t\tSystem.out.println();\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tSystem.out.print(\" \");\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))",
"int i",
"i",
"j;",
"j",
"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[][] sheet=new int[r+1][c+1];",
"sheet",
"new int[r+1][c+1]",
"r+1",
"r",
"1",
"c+1",
"c",
"1",
"for(i=0;i<r;i++){\n\t\t\tString[] num=br.readLine().split(\" \");\n\t\t\tfor(j=0;j<c;j++){\n\t\t\t\tsheet[i][j]=Integer.parseInt(num[j]);\n\t\t\t\tsheet[i][c]+=sheet[i][j];\n\t\t\t\tsheet[r][j]+=sheet[i][j];\n\t\t\t}\n\t\t\tsheet[r][c]+=sheet[i][c];\n\t\t}",
"i=0;",
"i=0",
"i",
"0",
"i<r",
"i",
"r",
"i++",
"i++",
"i",
"{\n\t\t\tString[] num=br.readLine().split(\" \");\n\t\t\tfor(j=0;j<c;j++){\n\t\t\t\tsheet[i][j]=Integer.parseInt(num[j]);\n\t\t\t\tsheet[i][c]+=sheet[i][j];\n\t\t\t\tsheet[r][j]+=sheet[i][j];\n\t\t\t}\n\t\t\tsheet[r][c]+=sheet[i][c];\n\t\t}",
"{\n\t\t\tString[] num=br.readLine().split(\" \");\n\t\t\tfor(j=0;j<c;j++){\n\t\t\t\tsheet[i][j]=Integer.parseInt(num[j]);\n\t\t\t\tsheet[i][c]+=sheet[i][j];\n\t\t\t\tsheet[r][j]+=sheet[i][j];\n\t\t\t}\n\t\t\tsheet[r][c]+=sheet[i][c];\n\t\t}",
"String[] num=br.readLine().split(\" \");",
"num",
"br.readLine().split(\" \")",
"br.readLine().split",
"br.readLine()",
"br.readLine",
"br",
"\" \"",
"for(j=0;j<c;j++){\n\t\t\t\tsheet[i][j]=Integer.parseInt(num[j]);\n\t\t\t\tsheet[i][c]+=sheet[i][j];\n\t\t\t\tsheet[r][j]+=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][j]=Integer.parseInt(num[j]);\n\t\t\t\tsheet[i][c]+=sheet[i][j];\n\t\t\t\tsheet[r][j]+=sheet[i][j];\n\t\t\t}",
"{\n\t\t\t\tsheet[i][j]=Integer.parseInt(num[j]);\n\t\t\t\tsheet[i][c]+=sheet[i][j];\n\t\t\t\tsheet[r][j]+=sheet[i][j];\n\t\t\t}",
"sheet[i][j]=Integer.parseInt(num[j])",
"sheet[i][j]",
"sheet[i]",
"sheet",
"i",
"j",
"Integer.parseInt(num[j])",
"Integer.parseInt",
"Integer",
"num[j]",
"num",
"j",
"sheet[i][c]+=sheet[i][j]",
"sheet[i][c]",
"sheet[i]",
"sheet",
"i",
"c",
"sheet[i][j]",
"sheet[i]",
"sheet",
"i",
"j",
"sheet[r][j]+=sheet[i][j]",
"sheet[r][j]",
"sheet[r]",
"sheet",
"r",
"j",
"sheet[i][j]",
"sheet[i]",
"sheet",
"i",
"j",
"sheet[r][c]+=sheet[i][c]",
"sheet[r][c]",
"sheet[r]",
"sheet",
"r",
"c",
"sheet[i][c]",
"sheet[i]",
"sheet",
"i",
"c",
"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\tif(j==c){\n\t\t\t\t\tSystem.out.println();\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tSystem.out.print(\" \");\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\tfor(j=0;j<=c;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}\n\t\t\t\telse{\n\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t}\n\t\t\t}\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\tif(j==c){\n\t\t\t\t\tSystem.out.println();\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"for(j=0;j<=c;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}\n\t\t\t\telse{\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\tif(j==c){\n\t\t\t\t\tSystem.out.println();\n\t\t\t\t}\n\t\t\t\telse{\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}\n\t\t\t\telse{\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}\n\t\t\t\telse{\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"
] | import java.io.*;
class Main{
public static void main(String[]args)throws IOException{
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
int i,j;
String[] rc=br.readLine().split(" ");
int r=Integer.parseInt(rc[0]);
int c=Integer.parseInt(rc[1]);
int[][] sheet=new int[r+1][c+1];
for(i=0;i<r;i++){
String[] num=br.readLine().split(" ");
for(j=0;j<c;j++){
sheet[i][j]=Integer.parseInt(num[j]);
sheet[i][c]+=sheet[i][j];
sheet[r][j]+=sheet[i][j];
}
sheet[r][c]+=sheet[i][c];
}
for(i=0;i<=r;i++){
for(j=0;j<=c;j++){
System.out.print(sheet[i][j]);
if(j==c){
System.out.println();
}
else{
System.out.print(" ");
}
}
}
}
} |
[
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,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
41,
13,
4,
18,
13,
0,
18,
18,
13,
13,
13,
13,
0,
18,
18,
13,
13,
13,
13,
11,
1,
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,
4,
18,
18,
13,
13,
17,
23,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
8,
17
],
[
17,
18
],
[
17,
19
],
[
19,
20
],
[
20,
21
],
[
8,
22
],
[
22,
23
],
[
22,
24
],
[
8,
27
],
[
27,
28
],
[
27,
29
],
[
30,
31
],
[
30,
32
],
[
33,
34
],
[
33,
35
],
[
8,
36
],
[
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
],
[
65,
67
],
[
67,
68
],
[
68,
69
],
[
64,
70
],
[
70,
71
],
[
71,
72
],
[
72,
73
],
[
72,
74
],
[
71,
75
],
[
70,
76
],
[
64,
77
],
[
77,
78
],
[
78,
79
],
[
79,
80
],
[
79,
81
],
[
78,
82
],
[
77,
83
],
[
8,
84
],
[
84,
85
],
[
85,
86
],
[
86,
87
],
[
86,
88
],
[
84,
89
],
[
89,
90
],
[
89,
91
],
[
84,
92
],
[
92,
93
],
[
93,
94
],
[
84,
95
],
[
96,
96
],
[
96,
97
],
[
97,
98
],
[
98,
99
],
[
99,
100
],
[
99,
101
],
[
97,
102
],
[
102,
103
],
[
102,
104
],
[
97,
105
],
[
105,
106
],
[
106,
107
],
[
97,
108
],
[
109,
109
],
[
109,
110
],
[
110,
111
],
[
110,
112
],
[
112,
113
],
[
113,
114
],
[
113,
115
],
[
112,
116
],
[
96,
117
],
[
117,
118
],
[
118,
119
],
[
119,
120
],
[
119,
121
],
[
118,
122
],
[
117,
123
],
[
96,
124
],
[
124,
125
],
[
124,
126
],
[
8,
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
],
[
155,
157
],
[
157,
158
],
[
158,
159
],
[
158,
160
],
[
157,
161
],
[
141,
162
],
[
162,
163
],
[
163,
164
],
[
164,
165
],
[
164,
166
],
[
163,
167
],
[
162,
168
],
[
141,
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
],
[
204,
205
],
[
204,
206
],
[
202,
207
],
[
207,
208
],
[
208,
209
],
[
208,
210
],
[
207,
211
],
[
201,
212
],
[
212,
213
],
[
213,
214
],
[
213,
215
],
[
212,
216
],
[
216,
217
],
[
217,
218
],
[
218,
219
],
[
219,
220
],
[
219,
221
],
[
217,
222
],
[
186,
223
],
[
223,
224
],
[
224,
225
],
[
225,
226
],
[
225,
227
],
[
223,
228
],
[
6,
229
],
[
229,
230
]
] | [
"import java.util.*;\n \nclass Main{\n public static void main(String[] args){\n\t\t\n\t\tScanner scan = new Scanner(System.in);\n\t\tint c = scan.nextInt();\n\t\tint r = scan.nextInt();\n\t\tint[][] arr1 = new int[c][r];\n\t\tint[][] arr2 = new int[c+1][r+1];\n\t\tint sum = 0;\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\tint p = scan.nextInt();\n\t\t\t\tarr1[i][j] = p;\n\t\t\t\tarr2[i][j] = p;\n\t\t\t}\n\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\tsum += arr2[i][j];\n\t\t\t}\n\t\t\tarr2[i][r] = sum;\n\t\t\tsum = 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; j++){\n\t\t\t\tsum += arr2[j][i];\n\t\t\t}\n\t\t\tarr2[c][i] = sum;\n\t\t\tsum = 0;\n\t\t}\n\t\t//???????????????\n\t\tfor(int i=0; i<c+1; i++){\n\t\t\tfor(int j=0; j<r+1; j++){\n\t\t\t\tSystem.out.print(arr2[i][j]);\n\t\t\t\tif(j < r){\n\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 }\n}",
"import java.util.*;",
"util.*",
"java",
"class Main{\n public static void main(String[] args){\n\t\t\n\t\tScanner scan = new Scanner(System.in);\n\t\tint c = scan.nextInt();\n\t\tint r = scan.nextInt();\n\t\tint[][] arr1 = new int[c][r];\n\t\tint[][] arr2 = new int[c+1][r+1];\n\t\tint sum = 0;\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\tint p = scan.nextInt();\n\t\t\t\tarr1[i][j] = p;\n\t\t\t\tarr2[i][j] = p;\n\t\t\t}\n\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\tsum += arr2[i][j];\n\t\t\t}\n\t\t\tarr2[i][r] = sum;\n\t\t\tsum = 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; j++){\n\t\t\t\tsum += arr2[j][i];\n\t\t\t}\n\t\t\tarr2[c][i] = sum;\n\t\t\tsum = 0;\n\t\t}\n\t\t//???????????????\n\t\tfor(int i=0; i<c+1; i++){\n\t\t\tfor(int j=0; j<r+1; j++){\n\t\t\t\tSystem.out.print(arr2[i][j]);\n\t\t\t\tif(j < r){\n\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 }\n}",
"Main",
"public static void main(String[] args){\n\t\t\n\t\tScanner scan = new Scanner(System.in);\n\t\tint c = scan.nextInt();\n\t\tint r = scan.nextInt();\n\t\tint[][] arr1 = new int[c][r];\n\t\tint[][] arr2 = new int[c+1][r+1];\n\t\tint sum = 0;\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\tint p = scan.nextInt();\n\t\t\t\tarr1[i][j] = p;\n\t\t\t\tarr2[i][j] = p;\n\t\t\t}\n\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\tsum += arr2[i][j];\n\t\t\t}\n\t\t\tarr2[i][r] = sum;\n\t\t\tsum = 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; j++){\n\t\t\t\tsum += arr2[j][i];\n\t\t\t}\n\t\t\tarr2[c][i] = sum;\n\t\t\tsum = 0;\n\t\t}\n\t\t//???????????????\n\t\tfor(int i=0; i<c+1; i++){\n\t\t\tfor(int j=0; j<r+1; j++){\n\t\t\t\tSystem.out.print(arr2[i][j]);\n\t\t\t\tif(j < r){\n\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 }",
"main",
"{\n\t\t\n\t\tScanner scan = new Scanner(System.in);\n\t\tint c = scan.nextInt();\n\t\tint r = scan.nextInt();\n\t\tint[][] arr1 = new int[c][r];\n\t\tint[][] arr2 = new int[c+1][r+1];\n\t\tint sum = 0;\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\tint p = scan.nextInt();\n\t\t\t\tarr1[i][j] = p;\n\t\t\t\tarr2[i][j] = p;\n\t\t\t}\n\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\tsum += arr2[i][j];\n\t\t\t}\n\t\t\tarr2[i][r] = sum;\n\t\t\tsum = 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; j++){\n\t\t\t\tsum += arr2[j][i];\n\t\t\t}\n\t\t\tarr2[c][i] = sum;\n\t\t\tsum = 0;\n\t\t}\n\t\t//???????????????\n\t\tfor(int i=0; i<c+1; i++){\n\t\t\tfor(int j=0; j<r+1; j++){\n\t\t\t\tSystem.out.print(arr2[i][j]);\n\t\t\t\tif(j < r){\n\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 }",
"Scanner scan = new Scanner(System.in);",
"scan",
"new Scanner(System.in)",
"int c = scan.nextInt();",
"c",
"scan.nextInt()",
"scan.nextInt",
"scan",
"int r = scan.nextInt();",
"r",
"scan.nextInt()",
"scan.nextInt",
"scan",
"int[][] arr1 = new int[c][r];",
"arr1",
"new int[c][r]",
"c",
"r",
"int[][] arr2 = new int[c+1][r+1];",
"arr2",
"new int[c+1][r+1]",
"c+1",
"c",
"1",
"r+1",
"r",
"1",
"int sum = 0;",
"sum",
"0",
"for(int i=0; i<c; i++){\n\t\t\tfor(int j=0; j<r; j++){\n\t\t\t\tint p = scan.nextInt();\n\t\t\t\tarr1[i][j] = p;\n\t\t\t\tarr2[i][j] = p;\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\tint p = scan.nextInt();\n\t\t\t\tarr1[i][j] = p;\n\t\t\t\tarr2[i][j] = p;\n\t\t\t}\n\t\t}",
"{\n\t\t\tfor(int j=0; j<r; j++){\n\t\t\t\tint p = scan.nextInt();\n\t\t\t\tarr1[i][j] = p;\n\t\t\t\tarr2[i][j] = p;\n\t\t\t}\n\t\t}",
"for(int j=0; j<r; j++){\n\t\t\t\tint p = scan.nextInt();\n\t\t\t\tarr1[i][j] = p;\n\t\t\t\tarr2[i][j] = p;\n\t\t\t}",
"int j=0;",
"int j=0;",
"j",
"0",
"j<r",
"j",
"r",
"j++",
"j++",
"j",
"{\n\t\t\t\tint p = scan.nextInt();\n\t\t\t\tarr1[i][j] = p;\n\t\t\t\tarr2[i][j] = p;\n\t\t\t}",
"{\n\t\t\t\tint p = scan.nextInt();\n\t\t\t\tarr1[i][j] = p;\n\t\t\t\tarr2[i][j] = p;\n\t\t\t}",
"int p = scan.nextInt();",
"p",
"scan.nextInt()",
"scan.nextInt",
"scan",
"arr1[i][j] = p",
"arr1[i][j]",
"arr1[i]",
"arr1",
"i",
"j",
"p",
"arr2[i][j] = p",
"arr2[i][j]",
"arr2[i]",
"arr2",
"i",
"j",
"p",
"for(int i=0; i<c; i++){\n\t\t\tfor(int j=0; j<r; j++){\n\t\t\t\tsum += arr2[i][j];\n\t\t\t}\n\t\t\tarr2[i][r] = sum;\n\t\t\tsum = 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\tsum += arr2[i][j];\n\t\t\t}\n\t\t\tarr2[i][r] = sum;\n\t\t\tsum = 0;\n\t\t}",
"{\n\t\t\tfor(int j=0; j<r; j++){\n\t\t\t\tsum += arr2[i][j];\n\t\t\t}\n\t\t\tarr2[i][r] = sum;\n\t\t\tsum = 0;\n\t\t}",
"for(int j=0; j<r; j++){\n\t\t\t\tsum += arr2[i][j];\n\t\t\t}",
"int j=0;",
"int j=0;",
"j",
"0",
"j<r",
"j",
"r",
"j++",
"j++",
"j",
"{\n\t\t\t\tsum += arr2[i][j];\n\t\t\t}",
"{\n\t\t\t\tsum += arr2[i][j];\n\t\t\t}",
"sum += arr2[i][j]",
"sum",
"arr2[i][j]",
"arr2[i]",
"arr2",
"i",
"j",
"arr2[i][r] = sum",
"arr2[i][r]",
"arr2[i]",
"arr2",
"i",
"r",
"sum",
"sum = 0",
"sum",
"0",
"for(int i=0; i<r+1; i++){\n\t\t\tfor(int j=0; j<c; j++){\n\t\t\t\tsum += arr2[j][i];\n\t\t\t}\n\t\t\tarr2[c][i] = sum;\n\t\t\tsum = 0;\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\tsum += arr2[j][i];\n\t\t\t}\n\t\t\tarr2[c][i] = sum;\n\t\t\tsum = 0;\n\t\t}",
"{\n\t\t\tfor(int j=0; j<c; j++){\n\t\t\t\tsum += arr2[j][i];\n\t\t\t}\n\t\t\tarr2[c][i] = sum;\n\t\t\tsum = 0;\n\t\t}",
"for(int j=0; j<c; j++){\n\t\t\t\tsum += arr2[j][i];\n\t\t\t}",
"int j=0;",
"int j=0;",
"j",
"0",
"j<c",
"j",
"c",
"j++",
"j++",
"j",
"{\n\t\t\t\tsum += arr2[j][i];\n\t\t\t}",
"{\n\t\t\t\tsum += arr2[j][i];\n\t\t\t}",
"sum += arr2[j][i]",
"sum",
"arr2[j][i]",
"arr2[j]",
"arr2",
"j",
"i",
"arr2[c][i] = sum",
"arr2[c][i]",
"arr2[c]",
"arr2",
"c",
"i",
"sum",
"sum = 0",
"sum",
"0",
"for(int i=0; i<c+1; i++){\n\t\t\tfor(int j=0; j<r+1; j++){\n\t\t\t\tSystem.out.print(arr2[i][j]);\n\t\t\t\tif(j < r){\n\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<c+1",
"i",
"c+1",
"c",
"1",
"i++",
"i++",
"i",
"{\n\t\t\tfor(int j=0; j<r+1; j++){\n\t\t\t\tSystem.out.print(arr2[i][j]);\n\t\t\t\tif(j < r){\n\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<r+1; j++){\n\t\t\t\tSystem.out.print(arr2[i][j]);\n\t\t\t\tif(j < r){\n\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<r+1; j++){\n\t\t\t\tSystem.out.print(arr2[i][j]);\n\t\t\t\tif(j < r){\n\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t}\n\t\t\t}",
"int j=0;",
"int j=0;",
"j",
"0",
"j<r+1",
"j",
"r+1",
"r",
"1",
"j++",
"j++",
"j",
"{\n\t\t\t\tSystem.out.print(arr2[i][j]);\n\t\t\t\tif(j < r){\n\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t}\n\t\t\t}",
"{\n\t\t\t\tSystem.out.print(arr2[i][j]);\n\t\t\t\tif(j < r){\n\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t}\n\t\t\t}",
"System.out.print(arr2[i][j])",
"System.out.print",
"System.out",
"System",
"System.out",
"arr2[i][j]",
"arr2[i]",
"arr2",
"i",
"j",
"if(j < r){\n\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t}",
"j < r",
"j",
"r",
"{\n\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.*;
class Main{
public static void main(String[] args){
Scanner scan = new Scanner(System.in);
int c = scan.nextInt();
int r = scan.nextInt();
int[][] arr1 = new int[c][r];
int[][] arr2 = new int[c+1][r+1];
int sum = 0;
//???????????????
for(int i=0; i<c; i++){
for(int j=0; j<r; j++){
int p = scan.nextInt();
arr1[i][j] = p;
arr2[i][j] = p;
}
}
//??????????¨????????´?
for(int i=0; i<c; i++){
for(int j=0; j<r; j++){
sum += arr2[i][j];
}
arr2[i][r] = sum;
sum = 0;
}
//??????????¨????????´?
for(int i=0; i<r+1; i++){
for(int j=0; j<c; j++){
sum += arr2[j][i];
}
arr2[c][i] = sum;
sum = 0;
}
//???????????????
for(int i=0; i<c+1; i++){
for(int j=0; j<r+1; j++){
System.out.print(arr2[i][j]);
if(j < r){
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,
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,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
2,
13,
18,
18,
13,
13,
13,
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,
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,
30,
4,
18,
18,
13,
13,
17,
14,
2,
13,
13,
30,
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
],
[
228,
5
],
[
228,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
8,
17
],
[
17,
18
],
[
17,
19
],
[
19,
20
],
[
20,
21
],
[
8,
22
],
[
22,
23
],
[
22,
24
],
[
25,
26
],
[
25,
27
],
[
28,
29
],
[
28,
30
],
[
8,
31
],
[
31,
32
],
[
32,
33
],
[
33,
34
],
[
33,
35
],
[
31,
36
],
[
36,
37
],
[
36,
38
],
[
31,
39
],
[
39,
40
],
[
40,
41
],
[
31,
42
],
[
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
],
[
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
],
[
100,
102
],
[
102,
103
],
[
103,
104
],
[
103,
105
],
[
102,
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
],
[
145,
147
],
[
147,
148
],
[
148,
149
],
[
148,
150
],
[
147,
151
],
[
126,
152
],
[
152,
153
],
[
153,
154
],
[
154,
155
],
[
154,
156
],
[
153,
157
],
[
152,
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
],
[
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
],
[
191,
192
],
[
191,
193
],
[
190,
194
],
[
184,
195
],
[
195,
196
],
[
196,
197
],
[
196,
198
],
[
195,
199
],
[
195,
200
],
[
200,
201
],
[
201,
202
],
[
202,
203
],
[
203,
204
],
[
203,
205
],
[
201,
206
],
[
171,
207
],
[
207,
208
],
[
208,
209
],
[
208,
210
],
[
207,
211
],
[
207,
212
],
[
212,
213
],
[
213,
214
],
[
214,
215
],
[
215,
216
],
[
215,
217
],
[
213,
218
],
[
8,
219
],
[
219,
220
],
[
220,
221
],
[
221,
222
],
[
221,
223
],
[
219,
224
],
[
6,
225
],
[
225,
226
],
[
0,
227
],
[
227,
228
],
[
227,
229
]
] | [
"import java.util.Scanner;\n\n\npublic class Main {\n\n\tpublic static void main(String [] args) {\n\t\t\n\t\tScanner sc = new Scanner(System.in);\n\t\t\n\t\tint r = sc.nextInt();\n\t\tint c = sc.nextInt();\n\t\t\n\t\tlong[][] cells = new long[r+1][c+1]; //+1は総和セル\n\t\t\n\t\tfor(int tate = 0;tate < r;tate++) {\n\t\t\tfor(int yoko = 0;yoko < c;yoko++) {\n\t\t\t\t\n\t\t\t\tlong num = sc.nextLong();\n\t\t\t\t\n\t\t\t\tcells[tate][yoko] = num; //すべてのセルに値を代入した\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t\t\n\t\tfor(int tate = 0;tate < r;tate++) {\n\t\t\t\n\t\t\tlong yokosum = 0;\n\t\t\t\n\t\t\t\n\t\t\tfor(int yoko = 0;yoko < c;yoko++) {\n\t\t\t\tyokosum = yokosum + cells[tate][yoko];\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\tcells[tate][c] = yokosum; //左の総和をセルに入れる\n\t\t\n\t\t\n\t\t}\n\t\t\n\t\tfor(int yoko = 0;yoko <= c;yoko++) {\n\t\t\t\n\t\t\t\n\t\t\tlong tatesum = 0;\n\t\t\t\n\t\t\t\n\t\t\tfor(int tate = 0;tate < r;tate++) {\n\t\t\t\ttatesum = tatesum + cells[tate][yoko];\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\tcells[r][yoko] = tatesum; //上の総和をセルに入れる\n\t\t\t\n\t\t\t\n\t\t}\n\t\t\n\t\tfor(int tate = 0;tate <= r;tate++) {\n\t\t\tfor(int yoko = 0;yoko <= c;yoko++) {\n\t\t\t\t\n\t\t\t\tSystem.out.print(cells[tate][yoko]);\n\t\t\t\t\n\t\t\t\tif(yoko == c) {\n\t\t\t\t\t\n\t\t\t\t}else {\n\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\tif(tate == r) {\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}\n\t\t\n\t\tSystem.out.println(\"\");\n\t\t\n\n\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\n\t\tScanner sc = new Scanner(System.in);\n\t\t\n\t\tint r = sc.nextInt();\n\t\tint c = sc.nextInt();\n\t\t\n\t\tlong[][] cells = new long[r+1][c+1]; //+1は総和セル\n\t\t\n\t\tfor(int tate = 0;tate < r;tate++) {\n\t\t\tfor(int yoko = 0;yoko < c;yoko++) {\n\t\t\t\t\n\t\t\t\tlong num = sc.nextLong();\n\t\t\t\t\n\t\t\t\tcells[tate][yoko] = num; //すべてのセルに値を代入した\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t\t\n\t\tfor(int tate = 0;tate < r;tate++) {\n\t\t\t\n\t\t\tlong yokosum = 0;\n\t\t\t\n\t\t\t\n\t\t\tfor(int yoko = 0;yoko < c;yoko++) {\n\t\t\t\tyokosum = yokosum + cells[tate][yoko];\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\tcells[tate][c] = yokosum; //左の総和をセルに入れる\n\t\t\n\t\t\n\t\t}\n\t\t\n\t\tfor(int yoko = 0;yoko <= c;yoko++) {\n\t\t\t\n\t\t\t\n\t\t\tlong tatesum = 0;\n\t\t\t\n\t\t\t\n\t\t\tfor(int tate = 0;tate < r;tate++) {\n\t\t\t\ttatesum = tatesum + cells[tate][yoko];\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\tcells[r][yoko] = tatesum; //上の総和をセルに入れる\n\t\t\t\n\t\t\t\n\t\t}\n\t\t\n\t\tfor(int tate = 0;tate <= r;tate++) {\n\t\t\tfor(int yoko = 0;yoko <= c;yoko++) {\n\t\t\t\t\n\t\t\t\tSystem.out.print(cells[tate][yoko]);\n\t\t\t\t\n\t\t\t\tif(yoko == c) {\n\t\t\t\t\t\n\t\t\t\t}else {\n\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\tif(tate == r) {\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}\n\t\t\n\t\tSystem.out.println(\"\");\n\t\t\n\n\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\tint r = sc.nextInt();\n\t\tint c = sc.nextInt();\n\t\t\n\t\tlong[][] cells = new long[r+1][c+1]; //+1は総和セル\n\t\t\n\t\tfor(int tate = 0;tate < r;tate++) {\n\t\t\tfor(int yoko = 0;yoko < c;yoko++) {\n\t\t\t\t\n\t\t\t\tlong num = sc.nextLong();\n\t\t\t\t\n\t\t\t\tcells[tate][yoko] = num; //すべてのセルに値を代入した\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t\t\n\t\tfor(int tate = 0;tate < r;tate++) {\n\t\t\t\n\t\t\tlong yokosum = 0;\n\t\t\t\n\t\t\t\n\t\t\tfor(int yoko = 0;yoko < c;yoko++) {\n\t\t\t\tyokosum = yokosum + cells[tate][yoko];\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\tcells[tate][c] = yokosum; //左の総和をセルに入れる\n\t\t\n\t\t\n\t\t}\n\t\t\n\t\tfor(int yoko = 0;yoko <= c;yoko++) {\n\t\t\t\n\t\t\t\n\t\t\tlong tatesum = 0;\n\t\t\t\n\t\t\t\n\t\t\tfor(int tate = 0;tate < r;tate++) {\n\t\t\t\ttatesum = tatesum + cells[tate][yoko];\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\tcells[r][yoko] = tatesum; //上の総和をセルに入れる\n\t\t\t\n\t\t\t\n\t\t}\n\t\t\n\t\tfor(int tate = 0;tate <= r;tate++) {\n\t\t\tfor(int yoko = 0;yoko <= c;yoko++) {\n\t\t\t\t\n\t\t\t\tSystem.out.print(cells[tate][yoko]);\n\t\t\t\t\n\t\t\t\tif(yoko == c) {\n\t\t\t\t\t\n\t\t\t\t}else {\n\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\tif(tate == r) {\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}\n\t\t\n\t\tSystem.out.println(\"\");\n\t\t\n\n\t}",
"main",
"{\n\t\t\n\t\tScanner sc = new Scanner(System.in);\n\t\t\n\t\tint r = sc.nextInt();\n\t\tint c = sc.nextInt();\n\t\t\n\t\tlong[][] cells = new long[r+1][c+1]; //+1は総和セル\n\t\t\n\t\tfor(int tate = 0;tate < r;tate++) {\n\t\t\tfor(int yoko = 0;yoko < c;yoko++) {\n\t\t\t\t\n\t\t\t\tlong num = sc.nextLong();\n\t\t\t\t\n\t\t\t\tcells[tate][yoko] = num; //すべてのセルに値を代入した\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t\t\n\t\tfor(int tate = 0;tate < r;tate++) {\n\t\t\t\n\t\t\tlong yokosum = 0;\n\t\t\t\n\t\t\t\n\t\t\tfor(int yoko = 0;yoko < c;yoko++) {\n\t\t\t\tyokosum = yokosum + cells[tate][yoko];\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\tcells[tate][c] = yokosum; //左の総和をセルに入れる\n\t\t\n\t\t\n\t\t}\n\t\t\n\t\tfor(int yoko = 0;yoko <= c;yoko++) {\n\t\t\t\n\t\t\t\n\t\t\tlong tatesum = 0;\n\t\t\t\n\t\t\t\n\t\t\tfor(int tate = 0;tate < r;tate++) {\n\t\t\t\ttatesum = tatesum + cells[tate][yoko];\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\tcells[r][yoko] = tatesum; //上の総和をセルに入れる\n\t\t\t\n\t\t\t\n\t\t}\n\t\t\n\t\tfor(int tate = 0;tate <= r;tate++) {\n\t\t\tfor(int yoko = 0;yoko <= c;yoko++) {\n\t\t\t\t\n\t\t\t\tSystem.out.print(cells[tate][yoko]);\n\t\t\t\t\n\t\t\t\tif(yoko == c) {\n\t\t\t\t\t\n\t\t\t\t}else {\n\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\tif(tate == r) {\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}\n\t\t\n\t\tSystem.out.println(\"\");\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",
"long[][] cells = new long[r+1][c+1];",
"cells",
"new long[r+1][c+1]",
"r+1",
"r",
"1",
"c+1",
"c",
"1",
"for(int tate = 0;tate < r;tate++) {\n\t\t\tfor(int yoko = 0;yoko < c;yoko++) {\n\t\t\t\t\n\t\t\t\tlong num = sc.nextLong();\n\t\t\t\t\n\t\t\t\tcells[tate][yoko] = num; //すべてのセルに値を代入した\n\t\t\t\t\n\t\t\t}\n\t\t}",
"int tate = 0;",
"int tate = 0;",
"tate",
"0",
"tate < r",
"tate",
"r",
"tate++",
"tate++",
"tate",
"{\n\t\t\tfor(int yoko = 0;yoko < c;yoko++) {\n\t\t\t\t\n\t\t\t\tlong num = sc.nextLong();\n\t\t\t\t\n\t\t\t\tcells[tate][yoko] = num; //すべてのセルに値を代入した\n\t\t\t\t\n\t\t\t}\n\t\t}",
"{\n\t\t\tfor(int yoko = 0;yoko < c;yoko++) {\n\t\t\t\t\n\t\t\t\tlong num = sc.nextLong();\n\t\t\t\t\n\t\t\t\tcells[tate][yoko] = num; //すべてのセルに値を代入した\n\t\t\t\t\n\t\t\t}\n\t\t}",
"for(int yoko = 0;yoko < c;yoko++) {\n\t\t\t\t\n\t\t\t\tlong num = sc.nextLong();\n\t\t\t\t\n\t\t\t\tcells[tate][yoko] = num; //すべてのセルに値を代入した\n\t\t\t\t\n\t\t\t}",
"int yoko = 0;",
"int yoko = 0;",
"yoko",
"0",
"yoko < c",
"yoko",
"c",
"yoko++",
"yoko++",
"yoko",
"{\n\t\t\t\t\n\t\t\t\tlong num = sc.nextLong();\n\t\t\t\t\n\t\t\t\tcells[tate][yoko] = num; //すべてのセルに値を代入した\n\t\t\t\t\n\t\t\t}",
"{\n\t\t\t\t\n\t\t\t\tlong num = sc.nextLong();\n\t\t\t\t\n\t\t\t\tcells[tate][yoko] = num; //すべてのセルに値を代入した\n\t\t\t\t\n\t\t\t}",
"long num = sc.nextLong();",
"num",
"sc.nextLong()",
"sc.nextLong",
"sc",
"cells[tate][yoko] = num",
"cells[tate][yoko]",
"cells[tate]",
"cells",
"tate",
"yoko",
"num",
"for(int tate = 0;tate < r;tate++) {\n\t\t\t\n\t\t\tlong yokosum = 0;\n\t\t\t\n\t\t\t\n\t\t\tfor(int yoko = 0;yoko < c;yoko++) {\n\t\t\t\tyokosum = yokosum + cells[tate][yoko];\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\tcells[tate][c] = yokosum; //左の総和をセルに入れる\n\t\t\n\t\t\n\t\t}",
"int tate = 0;",
"int tate = 0;",
"tate",
"0",
"tate < r",
"tate",
"r",
"tate++",
"tate++",
"tate",
"{\n\t\t\t\n\t\t\tlong yokosum = 0;\n\t\t\t\n\t\t\t\n\t\t\tfor(int yoko = 0;yoko < c;yoko++) {\n\t\t\t\tyokosum = yokosum + cells[tate][yoko];\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\tcells[tate][c] = yokosum; //左の総和をセルに入れる\n\t\t\n\t\t\n\t\t}",
"{\n\t\t\t\n\t\t\tlong yokosum = 0;\n\t\t\t\n\t\t\t\n\t\t\tfor(int yoko = 0;yoko < c;yoko++) {\n\t\t\t\tyokosum = yokosum + cells[tate][yoko];\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\tcells[tate][c] = yokosum; //左の総和をセルに入れる\n\t\t\n\t\t\n\t\t}",
"long yokosum = 0;",
"yokosum",
"0",
"for(int yoko = 0;yoko < c;yoko++) {\n\t\t\t\tyokosum = yokosum + cells[tate][yoko];\n\t\t\t\t\n\t\t\t}",
"int yoko = 0;",
"int yoko = 0;",
"yoko",
"0",
"yoko < c",
"yoko",
"c",
"yoko++",
"yoko++",
"yoko",
"{\n\t\t\t\tyokosum = yokosum + cells[tate][yoko];\n\t\t\t\t\n\t\t\t}",
"{\n\t\t\t\tyokosum = yokosum + cells[tate][yoko];\n\t\t\t\t\n\t\t\t}",
"yokosum = yokosum + cells[tate][yoko]",
"yokosum",
"yokosum + cells[tate][yoko]",
"yokosum",
"cells[tate][yoko]",
"cells[tate]",
"cells",
"tate",
"yoko",
"cells[tate][c] = yokosum",
"cells[tate][c]",
"cells[tate]",
"cells",
"tate",
"c",
"yokosum",
"for(int yoko = 0;yoko <= c;yoko++) {\n\t\t\t\n\t\t\t\n\t\t\tlong tatesum = 0;\n\t\t\t\n\t\t\t\n\t\t\tfor(int tate = 0;tate < r;tate++) {\n\t\t\t\ttatesum = tatesum + cells[tate][yoko];\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\tcells[r][yoko] = tatesum; //上の総和をセルに入れる\n\t\t\t\n\t\t\t\n\t\t}",
"int yoko = 0;",
"int yoko = 0;",
"yoko",
"0",
"yoko <= c",
"yoko",
"c",
"yoko++",
"yoko++",
"yoko",
"{\n\t\t\t\n\t\t\t\n\t\t\tlong tatesum = 0;\n\t\t\t\n\t\t\t\n\t\t\tfor(int tate = 0;tate < r;tate++) {\n\t\t\t\ttatesum = tatesum + cells[tate][yoko];\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\tcells[r][yoko] = tatesum; //上の総和をセルに入れる\n\t\t\t\n\t\t\t\n\t\t}",
"{\n\t\t\t\n\t\t\t\n\t\t\tlong tatesum = 0;\n\t\t\t\n\t\t\t\n\t\t\tfor(int tate = 0;tate < r;tate++) {\n\t\t\t\ttatesum = tatesum + cells[tate][yoko];\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\tcells[r][yoko] = tatesum; //上の総和をセルに入れる\n\t\t\t\n\t\t\t\n\t\t}",
"long tatesum = 0;",
"tatesum",
"0",
"for(int tate = 0;tate < r;tate++) {\n\t\t\t\ttatesum = tatesum + cells[tate][yoko];\n\t\t\t\t\n\t\t\t}",
"int tate = 0;",
"int tate = 0;",
"tate",
"0",
"tate < r",
"tate",
"r",
"tate++",
"tate++",
"tate",
"{\n\t\t\t\ttatesum = tatesum + cells[tate][yoko];\n\t\t\t\t\n\t\t\t}",
"{\n\t\t\t\ttatesum = tatesum + cells[tate][yoko];\n\t\t\t\t\n\t\t\t}",
"tatesum = tatesum + cells[tate][yoko]",
"tatesum",
"tatesum + cells[tate][yoko]",
"tatesum",
"cells[tate][yoko]",
"cells[tate]",
"cells",
"tate",
"yoko",
"cells[r][yoko] = tatesum",
"cells[r][yoko]",
"cells[r]",
"cells",
"r",
"yoko",
"tatesum",
"for(int tate = 0;tate <= r;tate++) {\n\t\t\tfor(int yoko = 0;yoko <= c;yoko++) {\n\t\t\t\t\n\t\t\t\tSystem.out.print(cells[tate][yoko]);\n\t\t\t\t\n\t\t\t\tif(yoko == c) {\n\t\t\t\t\t\n\t\t\t\t}else {\n\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\tif(tate == r) {\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}",
"int tate = 0;",
"int tate = 0;",
"tate",
"0",
"tate <= r",
"tate",
"r",
"tate++",
"tate++",
"tate",
"{\n\t\t\tfor(int yoko = 0;yoko <= c;yoko++) {\n\t\t\t\t\n\t\t\t\tSystem.out.print(cells[tate][yoko]);\n\t\t\t\t\n\t\t\t\tif(yoko == c) {\n\t\t\t\t\t\n\t\t\t\t}else {\n\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\tif(tate == r) {\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}",
"{\n\t\t\tfor(int yoko = 0;yoko <= c;yoko++) {\n\t\t\t\t\n\t\t\t\tSystem.out.print(cells[tate][yoko]);\n\t\t\t\t\n\t\t\t\tif(yoko == c) {\n\t\t\t\t\t\n\t\t\t\t}else {\n\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\tif(tate == r) {\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}",
"for(int yoko = 0;yoko <= c;yoko++) {\n\t\t\t\t\n\t\t\t\tSystem.out.print(cells[tate][yoko]);\n\t\t\t\t\n\t\t\t\tif(yoko == c) {\n\t\t\t\t\t\n\t\t\t\t}else {\n\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t}",
"int yoko = 0;",
"int yoko = 0;",
"yoko",
"0",
"yoko <= c",
"yoko",
"c",
"yoko++",
"yoko++",
"yoko",
"{\n\t\t\t\t\n\t\t\t\tSystem.out.print(cells[tate][yoko]);\n\t\t\t\t\n\t\t\t\tif(yoko == c) {\n\t\t\t\t\t\n\t\t\t\t}else {\n\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t}",
"{\n\t\t\t\t\n\t\t\t\tSystem.out.print(cells[tate][yoko]);\n\t\t\t\t\n\t\t\t\tif(yoko == c) {\n\t\t\t\t\t\n\t\t\t\t}else {\n\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t}",
"System.out.print(cells[tate][yoko])",
"System.out.print",
"System.out",
"System",
"System.out",
"cells[tate][yoko]",
"cells[tate]",
"cells",
"tate",
"yoko",
"if(yoko == c) {\n\t\t\t\t\t\n\t\t\t\t}else {\n\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t}",
"yoko == c",
"yoko",
"c",
"{\n\t\t\t\t\t\n\t\t\t\t}",
"{\n\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t}",
"System.out.print(\" \")",
"System.out.print",
"System.out",
"System",
"System.out",
"\" \"",
"if(tate == r) {\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}",
"tate == r",
"tate",
"r",
"{\n\t\t\t\t\t\n\t\t\t\t}",
"{\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",
"\"\"",
"System.out.println(\"\")",
"System.out.println",
"System.out",
"System",
"System.out",
"\"\"",
"String [] args",
"args",
"public class Main {\n\n\tpublic static void main(String [] args) {\n\t\t\n\t\tScanner sc = new Scanner(System.in);\n\t\t\n\t\tint r = sc.nextInt();\n\t\tint c = sc.nextInt();\n\t\t\n\t\tlong[][] cells = new long[r+1][c+1]; //+1は総和セル\n\t\t\n\t\tfor(int tate = 0;tate < r;tate++) {\n\t\t\tfor(int yoko = 0;yoko < c;yoko++) {\n\t\t\t\t\n\t\t\t\tlong num = sc.nextLong();\n\t\t\t\t\n\t\t\t\tcells[tate][yoko] = num; //すべてのセルに値を代入した\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t\t\n\t\tfor(int tate = 0;tate < r;tate++) {\n\t\t\t\n\t\t\tlong yokosum = 0;\n\t\t\t\n\t\t\t\n\t\t\tfor(int yoko = 0;yoko < c;yoko++) {\n\t\t\t\tyokosum = yokosum + cells[tate][yoko];\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\tcells[tate][c] = yokosum; //左の総和をセルに入れる\n\t\t\n\t\t\n\t\t}\n\t\t\n\t\tfor(int yoko = 0;yoko <= c;yoko++) {\n\t\t\t\n\t\t\t\n\t\t\tlong tatesum = 0;\n\t\t\t\n\t\t\t\n\t\t\tfor(int tate = 0;tate < r;tate++) {\n\t\t\t\ttatesum = tatesum + cells[tate][yoko];\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\tcells[r][yoko] = tatesum; //上の総和をセルに入れる\n\t\t\t\n\t\t\t\n\t\t}\n\t\t\n\t\tfor(int tate = 0;tate <= r;tate++) {\n\t\t\tfor(int yoko = 0;yoko <= c;yoko++) {\n\t\t\t\t\n\t\t\t\tSystem.out.print(cells[tate][yoko]);\n\t\t\t\t\n\t\t\t\tif(yoko == c) {\n\t\t\t\t\t\n\t\t\t\t}else {\n\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\tif(tate == r) {\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}\n\t\t\n\t\tSystem.out.println(\"\");\n\t\t\n\n\t}\n\t\n\n}",
"public class Main {\n\n\tpublic static void main(String [] args) {\n\t\t\n\t\tScanner sc = new Scanner(System.in);\n\t\t\n\t\tint r = sc.nextInt();\n\t\tint c = sc.nextInt();\n\t\t\n\t\tlong[][] cells = new long[r+1][c+1]; //+1は総和セル\n\t\t\n\t\tfor(int tate = 0;tate < r;tate++) {\n\t\t\tfor(int yoko = 0;yoko < c;yoko++) {\n\t\t\t\t\n\t\t\t\tlong num = sc.nextLong();\n\t\t\t\t\n\t\t\t\tcells[tate][yoko] = num; //すべてのセルに値を代入した\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t\t\n\t\tfor(int tate = 0;tate < r;tate++) {\n\t\t\t\n\t\t\tlong yokosum = 0;\n\t\t\t\n\t\t\t\n\t\t\tfor(int yoko = 0;yoko < c;yoko++) {\n\t\t\t\tyokosum = yokosum + cells[tate][yoko];\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\tcells[tate][c] = yokosum; //左の総和をセルに入れる\n\t\t\n\t\t\n\t\t}\n\t\t\n\t\tfor(int yoko = 0;yoko <= c;yoko++) {\n\t\t\t\n\t\t\t\n\t\t\tlong tatesum = 0;\n\t\t\t\n\t\t\t\n\t\t\tfor(int tate = 0;tate < r;tate++) {\n\t\t\t\ttatesum = tatesum + cells[tate][yoko];\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\tcells[r][yoko] = tatesum; //上の総和をセルに入れる\n\t\t\t\n\t\t\t\n\t\t}\n\t\t\n\t\tfor(int tate = 0;tate <= r;tate++) {\n\t\t\tfor(int yoko = 0;yoko <= c;yoko++) {\n\t\t\t\t\n\t\t\t\tSystem.out.print(cells[tate][yoko]);\n\t\t\t\t\n\t\t\t\tif(yoko == c) {\n\t\t\t\t\t\n\t\t\t\t}else {\n\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\tif(tate == r) {\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}\n\t\t\n\t\tSystem.out.println(\"\");\n\t\t\n\n\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();
long[][] cells = new long[r+1][c+1]; //+1は総和セル
for(int tate = 0;tate < r;tate++) {
for(int yoko = 0;yoko < c;yoko++) {
long num = sc.nextLong();
cells[tate][yoko] = num; //すべてのセルに値を代入した
}
}
for(int tate = 0;tate < r;tate++) {
long yokosum = 0;
for(int yoko = 0;yoko < c;yoko++) {
yokosum = yokosum + cells[tate][yoko];
}
cells[tate][c] = yokosum; //左の総和をセルに入れる
}
for(int yoko = 0;yoko <= c;yoko++) {
long tatesum = 0;
for(int tate = 0;tate < r;tate++) {
tatesum = tatesum + cells[tate][yoko];
}
cells[r][yoko] = tatesum; //上の総和をセルに入れる
}
for(int tate = 0;tate <= r;tate++) {
for(int yoko = 0;yoko <= c;yoko++) {
System.out.print(cells[tate][yoko]);
if(yoko == c) {
}else {
System.out.print(" ");
}
}
if(tate == r) {
}else {
System.out.println("");
}
}
System.out.println("");
}
}
|
[
7,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
41,
13,
17,
41,
13,
17,
41,
13,
17,
41,
13,
17,
38,
5,
13,
30,
4,
18,
13,
30,
42,
2,
0,
13,
4,
18,
13,
17,
30,
41,
13,
4,
18,
13,
17,
14,
2,
13,
17,
30,
0,
13,
4,
18,
13,
18,
13,
17,
0,
13,
4,
18,
13,
18,
13,
17,
0,
13,
20,
2,
13,
17,
2,
13,
17,
14,
2,
13,
13,
30,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
18,
18,
13,
2,
13,
17,
13,
4,
18,
13,
18,
13,
13,
14,
2,
13,
13,
30,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
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,
4,
18,
18,
13,
13,
2,
18,
18,
13,
13,
13,
17,
14,
2,
2,
13,
17,
13,
30,
4,
18,
18,
13,
13,
13,
40,
13,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
230,
8
],
[
230,
9
],
[
9,
10
],
[
9,
11
],
[
11,
12
],
[
12,
13
],
[
12,
14
],
[
11,
15
],
[
15,
16
],
[
11,
17
],
[
17,
18
],
[
17,
19
],
[
11,
20
],
[
20,
21
],
[
20,
22
],
[
11,
23
],
[
23,
24
],
[
23,
25
],
[
11,
26
],
[
26,
27
],
[
26,
28
],
[
11,
29
],
[
29,
30
],
[
30,
31
],
[
30,
32
],
[
32,
33
],
[
33,
34
],
[
34,
35
],
[
29,
36
],
[
36,
37
],
[
37,
38
],
[
38,
39
],
[
39,
40
],
[
39,
41
],
[
41,
42
],
[
42,
43
],
[
38,
44
],
[
37,
45
],
[
45,
46
],
[
46,
47
],
[
46,
48
],
[
48,
49
],
[
49,
50
],
[
48,
51
],
[
45,
52
],
[
52,
53
],
[
53,
54
],
[
53,
55
],
[
52,
56
],
[
56,
57
],
[
57,
58
],
[
57,
59
],
[
59,
60
],
[
60,
61
],
[
59,
62
],
[
62,
63
],
[
62,
64
],
[
56,
65
],
[
65,
66
],
[
65,
67
],
[
67,
68
],
[
68,
69
],
[
67,
70
],
[
70,
71
],
[
70,
72
],
[
56,
73
],
[
73,
74
],
[
73,
75
],
[
76,
77
],
[
76,
78
],
[
79,
80
],
[
79,
81
],
[
52,
82
],
[
82,
83
],
[
83,
84
],
[
83,
85
],
[
82,
86
],
[
86,
87
],
[
87,
88
],
[
88,
89
],
[
89,
90
],
[
89,
91
],
[
87,
92
],
[
92,
93
],
[
92,
94
],
[
87,
95
],
[
95,
96
],
[
96,
97
],
[
87,
98
],
[
99,
99
],
[
99,
100
],
[
100,
101
],
[
101,
102
],
[
102,
103
],
[
102,
104
],
[
104,
105
],
[
104,
106
],
[
101,
107
],
[
100,
108
],
[
108,
109
],
[
109,
110
],
[
108,
111
],
[
111,
112
],
[
111,
113
],
[
45,
114
],
[
114,
115
],
[
115,
116
],
[
115,
117
],
[
114,
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
],
[
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
],
[
118,
162
],
[
162,
163
],
[
163,
164
],
[
164,
165
],
[
164,
166
],
[
162,
167
],
[
167,
168
],
[
167,
169
],
[
169,
170
],
[
169,
171
],
[
162,
172
],
[
172,
173
],
[
173,
174
],
[
162,
175
],
[
176,
176
],
[
176,
177
],
[
177,
178
],
[
177,
179
],
[
176,
180
],
[
180,
181
],
[
181,
182
],
[
182,
183
],
[
182,
184
],
[
180,
185
],
[
185,
186
],
[
185,
187
],
[
180,
188
],
[
188,
189
],
[
189,
190
],
[
180,
191
],
[
192,
192
],
[
192,
193
],
[
193,
194
],
[
193,
195
],
[
195,
196
],
[
196,
197
],
[
196,
198
],
[
195,
199
],
[
192,
200
],
[
200,
201
],
[
201,
202
],
[
202,
203
],
[
202,
204
],
[
200,
205
],
[
205,
206
],
[
206,
207
],
[
207,
208
],
[
207,
209
],
[
206,
210
],
[
205,
211
],
[
192,
212
],
[
212,
213
],
[
213,
214
],
[
214,
215
],
[
214,
216
],
[
213,
217
],
[
212,
218
],
[
218,
219
],
[
219,
220
],
[
220,
221
],
[
221,
222
],
[
221,
223
],
[
219,
224
],
[
45,
225
],
[
225,
226
],
[
9,
227
],
[
227,
228
],
[
0,
229
],
[
229,
230
],
[
229,
231
]
] | [
"import java.io.BufferedReader;\nimport java.io.InputStreamReader;\n\npublic class Main {\n\n\tpublic static void main(String[] args) {\n\t\tBufferedReader reader = new BufferedReader(new InputStreamReader(System.in));\n\t\tString buffer;\n\n\t\tint count = 0;\n\t\tint r = 0;\n\t\tint c = 0;\n\t\tint[][] sheet = null;\n\t\ttry {\n\t\t\twhile ((buffer = reader.readLine()) != null) {\n\t\t\t\tString[] strings = buffer.split(\" \");\n\n\t\t\t\tif (count == 0) {\n\t\t\t\t\tr = Integer.valueOf(strings[0]);\n\t\t\t\t\tc = Integer.valueOf(strings[1]);\n\t\t\t\t\tsheet = new int[r + 1][c + 1];\n\t\t\t\t}\n\t\t\t\telse if (count <= r) {\n\t\t\t\t\tfor (int i = 0; i < c; i++) {\n\t\t\t\t\t\tsheet[count - 1][i] = Integer.valueOf(strings[i]);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (count == r) {\n\t\t\t\t\tfor (int w = 0; w < c; w++) {\n\t\t\t\t\t\tint sum = 0;\n\t\t\t\t\t\tfor (int h = 0; h < r; h++) {\n\t\t\t\t\t\t\tsum += sheet[h][w];\n\t\t\t\t\t\t}\n\t\t\t\t\t\tsheet[r][w] = sum;\n\t\t\t\t\t}\n\n\t\t\t\t\tfor (int h = 0; h < r + 1; h++) {\n\t\t\t\t\t\tint sum = 0;\n\t\t\t\t\t\tfor (int w = 0; w < c; w++) {\n\t\t\t\t\t\t\t\tsum += sheet[h][w];\n\t\t\t\t\t\t\t\tSystem.out.print(sheet[h][w] + \" \");\n\t\t\t\t\t\t\tif (w + 1 == c) {\n\t\t\t\t\t\t\t\tSystem.out.println(sum);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\tcount++;\n\t\t\t}\n\t\t} catch (Exception ex) {\n\t\t\tex.printStackTrace();\n\t\t}\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\tBufferedReader reader = new BufferedReader(new InputStreamReader(System.in));\n\t\tString buffer;\n\n\t\tint count = 0;\n\t\tint r = 0;\n\t\tint c = 0;\n\t\tint[][] sheet = null;\n\t\ttry {\n\t\t\twhile ((buffer = reader.readLine()) != null) {\n\t\t\t\tString[] strings = buffer.split(\" \");\n\n\t\t\t\tif (count == 0) {\n\t\t\t\t\tr = Integer.valueOf(strings[0]);\n\t\t\t\t\tc = Integer.valueOf(strings[1]);\n\t\t\t\t\tsheet = new int[r + 1][c + 1];\n\t\t\t\t}\n\t\t\t\telse if (count <= r) {\n\t\t\t\t\tfor (int i = 0; i < c; i++) {\n\t\t\t\t\t\tsheet[count - 1][i] = Integer.valueOf(strings[i]);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (count == r) {\n\t\t\t\t\tfor (int w = 0; w < c; w++) {\n\t\t\t\t\t\tint sum = 0;\n\t\t\t\t\t\tfor (int h = 0; h < r; h++) {\n\t\t\t\t\t\t\tsum += sheet[h][w];\n\t\t\t\t\t\t}\n\t\t\t\t\t\tsheet[r][w] = sum;\n\t\t\t\t\t}\n\n\t\t\t\t\tfor (int h = 0; h < r + 1; h++) {\n\t\t\t\t\t\tint sum = 0;\n\t\t\t\t\t\tfor (int w = 0; w < c; w++) {\n\t\t\t\t\t\t\t\tsum += sheet[h][w];\n\t\t\t\t\t\t\t\tSystem.out.print(sheet[h][w] + \" \");\n\t\t\t\t\t\t\tif (w + 1 == c) {\n\t\t\t\t\t\t\t\tSystem.out.println(sum);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\tcount++;\n\t\t\t}\n\t\t} catch (Exception ex) {\n\t\t\tex.printStackTrace();\n\t\t}\n\t}\n}",
"Main",
"public static void main(String[] args) {\n\t\tBufferedReader reader = new BufferedReader(new InputStreamReader(System.in));\n\t\tString buffer;\n\n\t\tint count = 0;\n\t\tint r = 0;\n\t\tint c = 0;\n\t\tint[][] sheet = null;\n\t\ttry {\n\t\t\twhile ((buffer = reader.readLine()) != null) {\n\t\t\t\tString[] strings = buffer.split(\" \");\n\n\t\t\t\tif (count == 0) {\n\t\t\t\t\tr = Integer.valueOf(strings[0]);\n\t\t\t\t\tc = Integer.valueOf(strings[1]);\n\t\t\t\t\tsheet = new int[r + 1][c + 1];\n\t\t\t\t}\n\t\t\t\telse if (count <= r) {\n\t\t\t\t\tfor (int i = 0; i < c; i++) {\n\t\t\t\t\t\tsheet[count - 1][i] = Integer.valueOf(strings[i]);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (count == r) {\n\t\t\t\t\tfor (int w = 0; w < c; w++) {\n\t\t\t\t\t\tint sum = 0;\n\t\t\t\t\t\tfor (int h = 0; h < r; h++) {\n\t\t\t\t\t\t\tsum += sheet[h][w];\n\t\t\t\t\t\t}\n\t\t\t\t\t\tsheet[r][w] = sum;\n\t\t\t\t\t}\n\n\t\t\t\t\tfor (int h = 0; h < r + 1; h++) {\n\t\t\t\t\t\tint sum = 0;\n\t\t\t\t\t\tfor (int w = 0; w < c; w++) {\n\t\t\t\t\t\t\t\tsum += sheet[h][w];\n\t\t\t\t\t\t\t\tSystem.out.print(sheet[h][w] + \" \");\n\t\t\t\t\t\t\tif (w + 1 == c) {\n\t\t\t\t\t\t\t\tSystem.out.println(sum);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\tcount++;\n\t\t\t}\n\t\t} catch (Exception ex) {\n\t\t\tex.printStackTrace();\n\t\t}\n\t}",
"main",
"{\n\t\tBufferedReader reader = new BufferedReader(new InputStreamReader(System.in));\n\t\tString buffer;\n\n\t\tint count = 0;\n\t\tint r = 0;\n\t\tint c = 0;\n\t\tint[][] sheet = null;\n\t\ttry {\n\t\t\twhile ((buffer = reader.readLine()) != null) {\n\t\t\t\tString[] strings = buffer.split(\" \");\n\n\t\t\t\tif (count == 0) {\n\t\t\t\t\tr = Integer.valueOf(strings[0]);\n\t\t\t\t\tc = Integer.valueOf(strings[1]);\n\t\t\t\t\tsheet = new int[r + 1][c + 1];\n\t\t\t\t}\n\t\t\t\telse if (count <= r) {\n\t\t\t\t\tfor (int i = 0; i < c; i++) {\n\t\t\t\t\t\tsheet[count - 1][i] = Integer.valueOf(strings[i]);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (count == r) {\n\t\t\t\t\tfor (int w = 0; w < c; w++) {\n\t\t\t\t\t\tint sum = 0;\n\t\t\t\t\t\tfor (int h = 0; h < r; h++) {\n\t\t\t\t\t\t\tsum += sheet[h][w];\n\t\t\t\t\t\t}\n\t\t\t\t\t\tsheet[r][w] = sum;\n\t\t\t\t\t}\n\n\t\t\t\t\tfor (int h = 0; h < r + 1; h++) {\n\t\t\t\t\t\tint sum = 0;\n\t\t\t\t\t\tfor (int w = 0; w < c; w++) {\n\t\t\t\t\t\t\t\tsum += sheet[h][w];\n\t\t\t\t\t\t\t\tSystem.out.print(sheet[h][w] + \" \");\n\t\t\t\t\t\t\tif (w + 1 == c) {\n\t\t\t\t\t\t\t\tSystem.out.println(sum);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\tcount++;\n\t\t\t}\n\t\t} catch (Exception ex) {\n\t\t\tex.printStackTrace();\n\t\t}\n\t}",
"BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));",
"reader",
"new BufferedReader(new InputStreamReader(System.in))",
"String buffer;",
"buffer",
"int count = 0;",
"count",
"0",
"int r = 0;",
"r",
"0",
"int c = 0;",
"c",
"0",
"int[][] sheet = null;",
"sheet",
"null",
"try {\n\t\t\twhile ((buffer = reader.readLine()) != null) {\n\t\t\t\tString[] strings = buffer.split(\" \");\n\n\t\t\t\tif (count == 0) {\n\t\t\t\t\tr = Integer.valueOf(strings[0]);\n\t\t\t\t\tc = Integer.valueOf(strings[1]);\n\t\t\t\t\tsheet = new int[r + 1][c + 1];\n\t\t\t\t}\n\t\t\t\telse if (count <= r) {\n\t\t\t\t\tfor (int i = 0; i < c; i++) {\n\t\t\t\t\t\tsheet[count - 1][i] = Integer.valueOf(strings[i]);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (count == r) {\n\t\t\t\t\tfor (int w = 0; w < c; w++) {\n\t\t\t\t\t\tint sum = 0;\n\t\t\t\t\t\tfor (int h = 0; h < r; h++) {\n\t\t\t\t\t\t\tsum += sheet[h][w];\n\t\t\t\t\t\t}\n\t\t\t\t\t\tsheet[r][w] = sum;\n\t\t\t\t\t}\n\n\t\t\t\t\tfor (int h = 0; h < r + 1; h++) {\n\t\t\t\t\t\tint sum = 0;\n\t\t\t\t\t\tfor (int w = 0; w < c; w++) {\n\t\t\t\t\t\t\t\tsum += sheet[h][w];\n\t\t\t\t\t\t\t\tSystem.out.print(sheet[h][w] + \" \");\n\t\t\t\t\t\t\tif (w + 1 == c) {\n\t\t\t\t\t\t\t\tSystem.out.println(sum);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\tcount++;\n\t\t\t}\n\t\t} catch (Exception ex) {\n\t\t\tex.printStackTrace();\n\t\t}",
"catch (Exception ex) {\n\t\t\tex.printStackTrace();\n\t\t}",
"Exception ex",
"{\n\t\t\tex.printStackTrace();\n\t\t}",
"ex.printStackTrace()",
"ex.printStackTrace",
"ex",
"{\n\t\t\twhile ((buffer = reader.readLine()) != null) {\n\t\t\t\tString[] strings = buffer.split(\" \");\n\n\t\t\t\tif (count == 0) {\n\t\t\t\t\tr = Integer.valueOf(strings[0]);\n\t\t\t\t\tc = Integer.valueOf(strings[1]);\n\t\t\t\t\tsheet = new int[r + 1][c + 1];\n\t\t\t\t}\n\t\t\t\telse if (count <= r) {\n\t\t\t\t\tfor (int i = 0; i < c; i++) {\n\t\t\t\t\t\tsheet[count - 1][i] = Integer.valueOf(strings[i]);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (count == r) {\n\t\t\t\t\tfor (int w = 0; w < c; w++) {\n\t\t\t\t\t\tint sum = 0;\n\t\t\t\t\t\tfor (int h = 0; h < r; h++) {\n\t\t\t\t\t\t\tsum += sheet[h][w];\n\t\t\t\t\t\t}\n\t\t\t\t\t\tsheet[r][w] = sum;\n\t\t\t\t\t}\n\n\t\t\t\t\tfor (int h = 0; h < r + 1; h++) {\n\t\t\t\t\t\tint sum = 0;\n\t\t\t\t\t\tfor (int w = 0; w < c; w++) {\n\t\t\t\t\t\t\t\tsum += sheet[h][w];\n\t\t\t\t\t\t\t\tSystem.out.print(sheet[h][w] + \" \");\n\t\t\t\t\t\t\tif (w + 1 == c) {\n\t\t\t\t\t\t\t\tSystem.out.println(sum);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\tcount++;\n\t\t\t}\n\t\t}",
"while ((buffer = reader.readLine()) != null) {\n\t\t\t\tString[] strings = buffer.split(\" \");\n\n\t\t\t\tif (count == 0) {\n\t\t\t\t\tr = Integer.valueOf(strings[0]);\n\t\t\t\t\tc = Integer.valueOf(strings[1]);\n\t\t\t\t\tsheet = new int[r + 1][c + 1];\n\t\t\t\t}\n\t\t\t\telse if (count <= r) {\n\t\t\t\t\tfor (int i = 0; i < c; i++) {\n\t\t\t\t\t\tsheet[count - 1][i] = Integer.valueOf(strings[i]);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (count == r) {\n\t\t\t\t\tfor (int w = 0; w < c; w++) {\n\t\t\t\t\t\tint sum = 0;\n\t\t\t\t\t\tfor (int h = 0; h < r; h++) {\n\t\t\t\t\t\t\tsum += sheet[h][w];\n\t\t\t\t\t\t}\n\t\t\t\t\t\tsheet[r][w] = sum;\n\t\t\t\t\t}\n\n\t\t\t\t\tfor (int h = 0; h < r + 1; h++) {\n\t\t\t\t\t\tint sum = 0;\n\t\t\t\t\t\tfor (int w = 0; w < c; w++) {\n\t\t\t\t\t\t\t\tsum += sheet[h][w];\n\t\t\t\t\t\t\t\tSystem.out.print(sheet[h][w] + \" \");\n\t\t\t\t\t\t\tif (w + 1 == c) {\n\t\t\t\t\t\t\t\tSystem.out.println(sum);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\tcount++;\n\t\t\t}",
"(buffer = reader.readLine()) != null",
"(buffer = reader.readLine())",
"buffer",
"reader.readLine()",
"reader.readLine",
"reader",
"null",
"{\n\t\t\t\tString[] strings = buffer.split(\" \");\n\n\t\t\t\tif (count == 0) {\n\t\t\t\t\tr = Integer.valueOf(strings[0]);\n\t\t\t\t\tc = Integer.valueOf(strings[1]);\n\t\t\t\t\tsheet = new int[r + 1][c + 1];\n\t\t\t\t}\n\t\t\t\telse if (count <= r) {\n\t\t\t\t\tfor (int i = 0; i < c; i++) {\n\t\t\t\t\t\tsheet[count - 1][i] = Integer.valueOf(strings[i]);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (count == r) {\n\t\t\t\t\tfor (int w = 0; w < c; w++) {\n\t\t\t\t\t\tint sum = 0;\n\t\t\t\t\t\tfor (int h = 0; h < r; h++) {\n\t\t\t\t\t\t\tsum += sheet[h][w];\n\t\t\t\t\t\t}\n\t\t\t\t\t\tsheet[r][w] = sum;\n\t\t\t\t\t}\n\n\t\t\t\t\tfor (int h = 0; h < r + 1; h++) {\n\t\t\t\t\t\tint sum = 0;\n\t\t\t\t\t\tfor (int w = 0; w < c; w++) {\n\t\t\t\t\t\t\t\tsum += sheet[h][w];\n\t\t\t\t\t\t\t\tSystem.out.print(sheet[h][w] + \" \");\n\t\t\t\t\t\t\tif (w + 1 == c) {\n\t\t\t\t\t\t\t\tSystem.out.println(sum);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\tcount++;\n\t\t\t}",
"String[] strings = buffer.split(\" \");",
"strings",
"buffer.split(\" \")",
"buffer.split",
"buffer",
"\" \"",
"if (count == 0) {\n\t\t\t\t\tr = Integer.valueOf(strings[0]);\n\t\t\t\t\tc = Integer.valueOf(strings[1]);\n\t\t\t\t\tsheet = new int[r + 1][c + 1];\n\t\t\t\t}\n\t\t\t\telse if (count <= r) {\n\t\t\t\t\tfor (int i = 0; i < c; i++) {\n\t\t\t\t\t\tsheet[count - 1][i] = Integer.valueOf(strings[i]);\n\t\t\t\t\t}\n\t\t\t\t}",
"count == 0",
"count",
"0",
"{\n\t\t\t\t\tr = Integer.valueOf(strings[0]);\n\t\t\t\t\tc = Integer.valueOf(strings[1]);\n\t\t\t\t\tsheet = new int[r + 1][c + 1];\n\t\t\t\t}",
"r = Integer.valueOf(strings[0])",
"r",
"Integer.valueOf(strings[0])",
"Integer.valueOf",
"Integer",
"strings[0]",
"strings",
"0",
"c = Integer.valueOf(strings[1])",
"c",
"Integer.valueOf(strings[1])",
"Integer.valueOf",
"Integer",
"strings[1]",
"strings",
"1",
"sheet = new int[r + 1][c + 1]",
"sheet",
"new int[r + 1][c + 1]",
"r + 1",
"r",
"1",
"c + 1",
"c",
"1",
"if (count <= r) {\n\t\t\t\t\tfor (int i = 0; i < c; i++) {\n\t\t\t\t\t\tsheet[count - 1][i] = Integer.valueOf(strings[i]);\n\t\t\t\t\t}\n\t\t\t\t}",
"count <= r",
"count",
"r",
"{\n\t\t\t\t\tfor (int i = 0; i < c; i++) {\n\t\t\t\t\t\tsheet[count - 1][i] = Integer.valueOf(strings[i]);\n\t\t\t\t\t}\n\t\t\t\t}",
"for (int i = 0; i < c; i++) {\n\t\t\t\t\t\tsheet[count - 1][i] = Integer.valueOf(strings[i]);\n\t\t\t\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < c",
"i",
"c",
"i++",
"i++",
"i",
"{\n\t\t\t\t\t\tsheet[count - 1][i] = Integer.valueOf(strings[i]);\n\t\t\t\t\t}",
"{\n\t\t\t\t\t\tsheet[count - 1][i] = Integer.valueOf(strings[i]);\n\t\t\t\t\t}",
"sheet[count - 1][i] = Integer.valueOf(strings[i])",
"sheet[count - 1][i]",
"sheet[count - 1]",
"sheet",
"count - 1",
"count",
"1",
"i",
"Integer.valueOf(strings[i])",
"Integer.valueOf",
"Integer",
"strings[i]",
"strings",
"i",
"if (count == r) {\n\t\t\t\t\tfor (int w = 0; w < c; w++) {\n\t\t\t\t\t\tint sum = 0;\n\t\t\t\t\t\tfor (int h = 0; h < r; h++) {\n\t\t\t\t\t\t\tsum += sheet[h][w];\n\t\t\t\t\t\t}\n\t\t\t\t\t\tsheet[r][w] = sum;\n\t\t\t\t\t}\n\n\t\t\t\t\tfor (int h = 0; h < r + 1; h++) {\n\t\t\t\t\t\tint sum = 0;\n\t\t\t\t\t\tfor (int w = 0; w < c; w++) {\n\t\t\t\t\t\t\t\tsum += sheet[h][w];\n\t\t\t\t\t\t\t\tSystem.out.print(sheet[h][w] + \" \");\n\t\t\t\t\t\t\tif (w + 1 == c) {\n\t\t\t\t\t\t\t\tSystem.out.println(sum);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t}",
"count == r",
"count",
"r",
"{\n\t\t\t\t\tfor (int w = 0; w < c; w++) {\n\t\t\t\t\t\tint sum = 0;\n\t\t\t\t\t\tfor (int h = 0; h < r; h++) {\n\t\t\t\t\t\t\tsum += sheet[h][w];\n\t\t\t\t\t\t}\n\t\t\t\t\t\tsheet[r][w] = sum;\n\t\t\t\t\t}\n\n\t\t\t\t\tfor (int h = 0; h < r + 1; h++) {\n\t\t\t\t\t\tint sum = 0;\n\t\t\t\t\t\tfor (int w = 0; w < c; w++) {\n\t\t\t\t\t\t\t\tsum += sheet[h][w];\n\t\t\t\t\t\t\t\tSystem.out.print(sheet[h][w] + \" \");\n\t\t\t\t\t\t\tif (w + 1 == c) {\n\t\t\t\t\t\t\t\tSystem.out.println(sum);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t}",
"for (int w = 0; w < c; w++) {\n\t\t\t\t\t\tint sum = 0;\n\t\t\t\t\t\tfor (int h = 0; h < r; h++) {\n\t\t\t\t\t\t\tsum += sheet[h][w];\n\t\t\t\t\t\t}\n\t\t\t\t\t\tsheet[r][w] = sum;\n\t\t\t\t\t}",
"int w = 0;",
"int w = 0;",
"w",
"0",
"w < c",
"w",
"c",
"w++",
"w++",
"w",
"{\n\t\t\t\t\t\tint sum = 0;\n\t\t\t\t\t\tfor (int h = 0; h < r; h++) {\n\t\t\t\t\t\t\tsum += sheet[h][w];\n\t\t\t\t\t\t}\n\t\t\t\t\t\tsheet[r][w] = sum;\n\t\t\t\t\t}",
"{\n\t\t\t\t\t\tint sum = 0;\n\t\t\t\t\t\tfor (int h = 0; h < r; h++) {\n\t\t\t\t\t\t\tsum += sheet[h][w];\n\t\t\t\t\t\t}\n\t\t\t\t\t\tsheet[r][w] = sum;\n\t\t\t\t\t}",
"int sum = 0;",
"sum",
"0",
"for (int h = 0; h < r; h++) {\n\t\t\t\t\t\t\tsum += sheet[h][w];\n\t\t\t\t\t\t}",
"int h = 0;",
"int h = 0;",
"h",
"0",
"h < r",
"h",
"r",
"h++",
"h++",
"h",
"{\n\t\t\t\t\t\t\tsum += sheet[h][w];\n\t\t\t\t\t\t}",
"{\n\t\t\t\t\t\t\tsum += sheet[h][w];\n\t\t\t\t\t\t}",
"sum += sheet[h][w]",
"sum",
"sheet[h][w]",
"sheet[h]",
"sheet",
"h",
"w",
"sheet[r][w] = sum",
"sheet[r][w]",
"sheet[r]",
"sheet",
"r",
"w",
"sum",
"for (int h = 0; h < r + 1; h++) {\n\t\t\t\t\t\tint sum = 0;\n\t\t\t\t\t\tfor (int w = 0; w < c; w++) {\n\t\t\t\t\t\t\t\tsum += sheet[h][w];\n\t\t\t\t\t\t\t\tSystem.out.print(sheet[h][w] + \" \");\n\t\t\t\t\t\t\tif (w + 1 == c) {\n\t\t\t\t\t\t\t\tSystem.out.println(sum);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}",
"int h = 0;",
"int h = 0;",
"h",
"0",
"h < r + 1",
"h",
"r + 1",
"r",
"1",
"h++",
"h++",
"h",
"{\n\t\t\t\t\t\tint sum = 0;\n\t\t\t\t\t\tfor (int w = 0; w < c; w++) {\n\t\t\t\t\t\t\t\tsum += sheet[h][w];\n\t\t\t\t\t\t\t\tSystem.out.print(sheet[h][w] + \" \");\n\t\t\t\t\t\t\tif (w + 1 == c) {\n\t\t\t\t\t\t\t\tSystem.out.println(sum);\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\tint sum = 0;\n\t\t\t\t\t\tfor (int w = 0; w < c; w++) {\n\t\t\t\t\t\t\t\tsum += sheet[h][w];\n\t\t\t\t\t\t\t\tSystem.out.print(sheet[h][w] + \" \");\n\t\t\t\t\t\t\tif (w + 1 == c) {\n\t\t\t\t\t\t\t\tSystem.out.println(sum);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}",
"int sum = 0;",
"sum",
"0",
"for (int w = 0; w < c; w++) {\n\t\t\t\t\t\t\t\tsum += sheet[h][w];\n\t\t\t\t\t\t\t\tSystem.out.print(sheet[h][w] + \" \");\n\t\t\t\t\t\t\tif (w + 1 == c) {\n\t\t\t\t\t\t\t\tSystem.out.println(sum);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}",
"int w = 0;",
"int w = 0;",
"w",
"0",
"w < c",
"w",
"c",
"w++",
"w++",
"w",
"{\n\t\t\t\t\t\t\t\tsum += sheet[h][w];\n\t\t\t\t\t\t\t\tSystem.out.print(sheet[h][w] + \" \");\n\t\t\t\t\t\t\tif (w + 1 == c) {\n\t\t\t\t\t\t\t\tSystem.out.println(sum);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}",
"{\n\t\t\t\t\t\t\t\tsum += sheet[h][w];\n\t\t\t\t\t\t\t\tSystem.out.print(sheet[h][w] + \" \");\n\t\t\t\t\t\t\tif (w + 1 == c) {\n\t\t\t\t\t\t\t\tSystem.out.println(sum);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}",
"sum += sheet[h][w]",
"sum",
"sheet[h][w]",
"sheet[h]",
"sheet",
"h",
"w",
"System.out.print(sheet[h][w] + \" \")",
"System.out.print",
"System.out",
"System",
"System.out",
"sheet[h][w] + \" \"",
"sheet[h][w]",
"sheet[h]",
"sheet",
"h",
"w",
"\" \"",
"if (w + 1 == c) {\n\t\t\t\t\t\t\t\tSystem.out.println(sum);\n\t\t\t\t\t\t\t}",
"w + 1 == c",
"w + 1",
"w",
"1",
"c",
"{\n\t\t\t\t\t\t\t\tSystem.out.println(sum);\n\t\t\t\t\t\t\t}",
"System.out.println(sum)",
"System.out.println",
"System.out",
"System",
"System.out",
"sum",
"count++",
"count",
"String[] args",
"args",
"public class Main {\n\n\tpublic static void main(String[] args) {\n\t\tBufferedReader reader = new BufferedReader(new InputStreamReader(System.in));\n\t\tString buffer;\n\n\t\tint count = 0;\n\t\tint r = 0;\n\t\tint c = 0;\n\t\tint[][] sheet = null;\n\t\ttry {\n\t\t\twhile ((buffer = reader.readLine()) != null) {\n\t\t\t\tString[] strings = buffer.split(\" \");\n\n\t\t\t\tif (count == 0) {\n\t\t\t\t\tr = Integer.valueOf(strings[0]);\n\t\t\t\t\tc = Integer.valueOf(strings[1]);\n\t\t\t\t\tsheet = new int[r + 1][c + 1];\n\t\t\t\t}\n\t\t\t\telse if (count <= r) {\n\t\t\t\t\tfor (int i = 0; i < c; i++) {\n\t\t\t\t\t\tsheet[count - 1][i] = Integer.valueOf(strings[i]);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (count == r) {\n\t\t\t\t\tfor (int w = 0; w < c; w++) {\n\t\t\t\t\t\tint sum = 0;\n\t\t\t\t\t\tfor (int h = 0; h < r; h++) {\n\t\t\t\t\t\t\tsum += sheet[h][w];\n\t\t\t\t\t\t}\n\t\t\t\t\t\tsheet[r][w] = sum;\n\t\t\t\t\t}\n\n\t\t\t\t\tfor (int h = 0; h < r + 1; h++) {\n\t\t\t\t\t\tint sum = 0;\n\t\t\t\t\t\tfor (int w = 0; w < c; w++) {\n\t\t\t\t\t\t\t\tsum += sheet[h][w];\n\t\t\t\t\t\t\t\tSystem.out.print(sheet[h][w] + \" \");\n\t\t\t\t\t\t\tif (w + 1 == c) {\n\t\t\t\t\t\t\t\tSystem.out.println(sum);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\tcount++;\n\t\t\t}\n\t\t} catch (Exception ex) {\n\t\t\tex.printStackTrace();\n\t\t}\n\t}\n}",
"public class Main {\n\n\tpublic static void main(String[] args) {\n\t\tBufferedReader reader = new BufferedReader(new InputStreamReader(System.in));\n\t\tString buffer;\n\n\t\tint count = 0;\n\t\tint r = 0;\n\t\tint c = 0;\n\t\tint[][] sheet = null;\n\t\ttry {\n\t\t\twhile ((buffer = reader.readLine()) != null) {\n\t\t\t\tString[] strings = buffer.split(\" \");\n\n\t\t\t\tif (count == 0) {\n\t\t\t\t\tr = Integer.valueOf(strings[0]);\n\t\t\t\t\tc = Integer.valueOf(strings[1]);\n\t\t\t\t\tsheet = new int[r + 1][c + 1];\n\t\t\t\t}\n\t\t\t\telse if (count <= r) {\n\t\t\t\t\tfor (int i = 0; i < c; i++) {\n\t\t\t\t\t\tsheet[count - 1][i] = Integer.valueOf(strings[i]);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (count == r) {\n\t\t\t\t\tfor (int w = 0; w < c; w++) {\n\t\t\t\t\t\tint sum = 0;\n\t\t\t\t\t\tfor (int h = 0; h < r; h++) {\n\t\t\t\t\t\t\tsum += sheet[h][w];\n\t\t\t\t\t\t}\n\t\t\t\t\t\tsheet[r][w] = sum;\n\t\t\t\t\t}\n\n\t\t\t\t\tfor (int h = 0; h < r + 1; h++) {\n\t\t\t\t\t\tint sum = 0;\n\t\t\t\t\t\tfor (int w = 0; w < c; w++) {\n\t\t\t\t\t\t\t\tsum += sheet[h][w];\n\t\t\t\t\t\t\t\tSystem.out.print(sheet[h][w] + \" \");\n\t\t\t\t\t\t\tif (w + 1 == c) {\n\t\t\t\t\t\t\t\tSystem.out.println(sum);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\tcount++;\n\t\t\t}\n\t\t} catch (Exception ex) {\n\t\t\tex.printStackTrace();\n\t\t}\n\t}\n}",
"Main"
] | import java.io.BufferedReader;
import java.io.InputStreamReader;
public class Main {
public static void main(String[] args) {
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
String buffer;
int count = 0;
int r = 0;
int c = 0;
int[][] sheet = null;
try {
while ((buffer = reader.readLine()) != null) {
String[] strings = buffer.split(" ");
if (count == 0) {
r = Integer.valueOf(strings[0]);
c = Integer.valueOf(strings[1]);
sheet = new int[r + 1][c + 1];
}
else if (count <= r) {
for (int i = 0; i < c; i++) {
sheet[count - 1][i] = Integer.valueOf(strings[i]);
}
}
if (count == r) {
for (int w = 0; w < c; w++) {
int sum = 0;
for (int h = 0; h < r; h++) {
sum += sheet[h][w];
}
sheet[r][w] = sum;
}
for (int h = 0; h < r + 1; h++) {
int sum = 0;
for (int w = 0; w < c; w++) {
sum += sheet[h][w];
System.out.print(sheet[h][w] + " ");
if (w + 1 == c) {
System.out.println(sum);
}
}
}
}
count++;
}
} catch (Exception ex) {
ex.printStackTrace();
}
}
}
|
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
38,
5,
13,
30,
4,
18,
13,
30,
38,
5,
13,
30,
30,
14,
2,
13,
17,
30,
4,
18,
13,
30,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
17,
41,
13,
4,
18,
13,
18,
13,
17,
41,
13,
4,
18,
13,
18,
13,
17,
41,
13,
20,
2,
13,
17,
2,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
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,
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,
18,
13,
13,
1,
40,
13,
30,
30,
11,
1,
41,
13,
17,
2,
13,
18,
18,
13,
13,
13,
1,
40,
13,
30,
30,
4,
18,
18,
13,
13,
18,
18,
13,
13,
13,
14,
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
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
218,
11
],
[
218,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
15,
17
],
[
14,
18
],
[
18,
19
],
[
19,
20
],
[
19,
21
],
[
21,
22
],
[
22,
23
],
[
23,
24
],
[
18,
25
],
[
25,
26
],
[
26,
27
],
[
27,
28
],
[
27,
29
],
[
26,
30
],
[
30,
31
],
[
31,
32
],
[
32,
33
],
[
32,
34
],
[
31,
35
],
[
35,
36
],
[
36,
37
],
[
37,
38
],
[
18,
39
],
[
39,
40
],
[
40,
41
],
[
40,
42
],
[
42,
43
],
[
43,
44
],
[
39,
45
],
[
45,
46
],
[
45,
47
],
[
47,
48
],
[
48,
49
],
[
47,
50
],
[
39,
51
],
[
51,
52
],
[
51,
53
],
[
53,
54
],
[
54,
55
],
[
53,
56
],
[
56,
57
],
[
56,
58
],
[
39,
59
],
[
59,
60
],
[
59,
61
],
[
61,
62
],
[
62,
63
],
[
61,
64
],
[
64,
65
],
[
64,
66
],
[
39,
67
],
[
67,
68
],
[
67,
69
],
[
70,
71
],
[
70,
72
],
[
73,
74
],
[
73,
75
],
[
39,
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
],
[
89,
91
],
[
91,
92
],
[
92,
93
],
[
88,
94
],
[
94,
95
],
[
94,
96
],
[
96,
97
],
[
97,
98
],
[
96,
99
],
[
88,
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
],
[
119,
122
],
[
122,
123
],
[
122,
124
],
[
112,
125
],
[
125,
126
],
[
126,
127
],
[
127,
128
],
[
127,
129
],
[
126,
130
],
[
125,
131
],
[
131,
132
],
[
132,
133
],
[
132,
134
],
[
131,
135
],
[
112,
136
],
[
136,
137
],
[
137,
138
],
[
138,
139
],
[
138,
140
],
[
137,
141
],
[
136,
142
],
[
142,
143
],
[
143,
144
],
[
143,
145
],
[
142,
146
],
[
112,
147
],
[
147,
148
],
[
148,
149
],
[
149,
150
],
[
149,
151
],
[
148,
152
],
[
147,
153
],
[
153,
154
],
[
154,
155
],
[
154,
156
],
[
153,
157
],
[
39,
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
],
[
178,
180
],
[
180,
181
],
[
181,
182
],
[
181,
183
],
[
180,
184
],
[
173,
185
],
[
185,
186
],
[
186,
187
],
[
173,
188
],
[
189,
189
],
[
189,
190
],
[
190,
191
],
[
191,
192
],
[
192,
193
],
[
192,
194
],
[
190,
195
],
[
195,
196
],
[
196,
197
],
[
196,
198
],
[
195,
199
],
[
189,
200
],
[
200,
201
],
[
201,
202
],
[
201,
203
],
[
200,
204
],
[
204,
205
],
[
205,
206
],
[
206,
207
],
[
206,
208
],
[
204,
209
],
[
172,
210
],
[
210,
211
],
[
211,
212
],
[
212,
213
],
[
212,
214
],
[
12,
215
],
[
215,
216
],
[
0,
217
],
[
217,
218
],
[
217,
219
]
] | [
"\nimport java.io.BufferedReader;\nimport java.io.IOException;\nimport java.io.InputStreamReader;\n\npublic class Main {\n\n\tpublic static void main(String[] args) {\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\n\t\ttry {\n\n\t\t\tString str = br.readLine();\n\t\t\tString[] strArr = str.split(\" \");\n\n\t\t\tint r = Integer.parseInt(strArr[0]);\n\t\t\tint c = Integer.parseInt(strArr[1]);\n\n\t\t\tint[][] set = new int[r + 1][c + 1];\n\t\t\tfor (int i = 0; i < r; i++) {\n\n\t\t\t\tstr = br.readLine();\n\t\t\t\tstrArr = str.split(\" \");\n\n\t\t\t\tfor (int j = 0; j < c; j++) {\n\t\t\t\t\tset[i][j] = Integer.parseInt(strArr[j]);\n\n\t\t\t\t\t// ????¨????????¨????\n\t\t\t\t\tset[i][c] += set[i][j]; // ???\n\t\t\t\t\tset[r][j] += set[i][j]; // ???\n\t\t\t\t\tset[r][c] += set[i][j]; // ?????????????¨?\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tfor (int i = 0; i < set.length; i++) {\n\t\t\t\tfor (int j = 0; j < set[i].length; j++) {\n\t\t\t\t\tSystem.out.print(set[i][j]);\n\t\t\t\t\tif (j < c)\n\t\t\t\t\t\tSystem.out.print(\" \");\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\te.printStackTrace();\n\t\t} finally {\n\t\t\ttry {\n\t\t\t\tif (br != null) {\n\t\t\t\t\tbr.close();\n\t\t\t\t}\n\t\t\t} catch (IOException ioe) {\n\t\t\t}\n\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\tpublic static void main(String[] args) {\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\n\t\ttry {\n\n\t\t\tString str = br.readLine();\n\t\t\tString[] strArr = str.split(\" \");\n\n\t\t\tint r = Integer.parseInt(strArr[0]);\n\t\t\tint c = Integer.parseInt(strArr[1]);\n\n\t\t\tint[][] set = new int[r + 1][c + 1];\n\t\t\tfor (int i = 0; i < r; i++) {\n\n\t\t\t\tstr = br.readLine();\n\t\t\t\tstrArr = str.split(\" \");\n\n\t\t\t\tfor (int j = 0; j < c; j++) {\n\t\t\t\t\tset[i][j] = Integer.parseInt(strArr[j]);\n\n\t\t\t\t\t// ????¨????????¨????\n\t\t\t\t\tset[i][c] += set[i][j]; // ???\n\t\t\t\t\tset[r][j] += set[i][j]; // ???\n\t\t\t\t\tset[r][c] += set[i][j]; // ?????????????¨?\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tfor (int i = 0; i < set.length; i++) {\n\t\t\t\tfor (int j = 0; j < set[i].length; j++) {\n\t\t\t\t\tSystem.out.print(set[i][j]);\n\t\t\t\t\tif (j < c)\n\t\t\t\t\t\tSystem.out.print(\" \");\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\te.printStackTrace();\n\t\t} finally {\n\t\t\ttry {\n\t\t\t\tif (br != null) {\n\t\t\t\t\tbr.close();\n\t\t\t\t}\n\t\t\t} catch (IOException ioe) {\n\t\t\t}\n\n\t\t}\n\t}\n}",
"Main",
"public static void main(String[] args) {\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\n\t\ttry {\n\n\t\t\tString str = br.readLine();\n\t\t\tString[] strArr = str.split(\" \");\n\n\t\t\tint r = Integer.parseInt(strArr[0]);\n\t\t\tint c = Integer.parseInt(strArr[1]);\n\n\t\t\tint[][] set = new int[r + 1][c + 1];\n\t\t\tfor (int i = 0; i < r; i++) {\n\n\t\t\t\tstr = br.readLine();\n\t\t\t\tstrArr = str.split(\" \");\n\n\t\t\t\tfor (int j = 0; j < c; j++) {\n\t\t\t\t\tset[i][j] = Integer.parseInt(strArr[j]);\n\n\t\t\t\t\t// ????¨????????¨????\n\t\t\t\t\tset[i][c] += set[i][j]; // ???\n\t\t\t\t\tset[r][j] += set[i][j]; // ???\n\t\t\t\t\tset[r][c] += set[i][j]; // ?????????????¨?\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tfor (int i = 0; i < set.length; i++) {\n\t\t\t\tfor (int j = 0; j < set[i].length; j++) {\n\t\t\t\t\tSystem.out.print(set[i][j]);\n\t\t\t\t\tif (j < c)\n\t\t\t\t\t\tSystem.out.print(\" \");\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\te.printStackTrace();\n\t\t} finally {\n\t\t\ttry {\n\t\t\t\tif (br != null) {\n\t\t\t\t\tbr.close();\n\t\t\t\t}\n\t\t\t} catch (IOException ioe) {\n\t\t\t}\n\n\t\t}\n\t}",
"main",
"{\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\n\t\ttry {\n\n\t\t\tString str = br.readLine();\n\t\t\tString[] strArr = str.split(\" \");\n\n\t\t\tint r = Integer.parseInt(strArr[0]);\n\t\t\tint c = Integer.parseInt(strArr[1]);\n\n\t\t\tint[][] set = new int[r + 1][c + 1];\n\t\t\tfor (int i = 0; i < r; i++) {\n\n\t\t\t\tstr = br.readLine();\n\t\t\t\tstrArr = str.split(\" \");\n\n\t\t\t\tfor (int j = 0; j < c; j++) {\n\t\t\t\t\tset[i][j] = Integer.parseInt(strArr[j]);\n\n\t\t\t\t\t// ????¨????????¨????\n\t\t\t\t\tset[i][c] += set[i][j]; // ???\n\t\t\t\t\tset[r][j] += set[i][j]; // ???\n\t\t\t\t\tset[r][c] += set[i][j]; // ?????????????¨?\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tfor (int i = 0; i < set.length; i++) {\n\t\t\t\tfor (int j = 0; j < set[i].length; j++) {\n\t\t\t\t\tSystem.out.print(set[i][j]);\n\t\t\t\t\tif (j < c)\n\t\t\t\t\t\tSystem.out.print(\" \");\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\te.printStackTrace();\n\t\t} finally {\n\t\t\ttry {\n\t\t\t\tif (br != null) {\n\t\t\t\t\tbr.close();\n\t\t\t\t}\n\t\t\t} catch (IOException ioe) {\n\t\t\t}\n\n\t\t}\n\t}",
"BufferedReader br = new BufferedReader(new InputStreamReader(System.in));",
"br",
"new BufferedReader(new InputStreamReader(System.in))",
"try {\n\n\t\t\tString str = br.readLine();\n\t\t\tString[] strArr = str.split(\" \");\n\n\t\t\tint r = Integer.parseInt(strArr[0]);\n\t\t\tint c = Integer.parseInt(strArr[1]);\n\n\t\t\tint[][] set = new int[r + 1][c + 1];\n\t\t\tfor (int i = 0; i < r; i++) {\n\n\t\t\t\tstr = br.readLine();\n\t\t\t\tstrArr = str.split(\" \");\n\n\t\t\t\tfor (int j = 0; j < c; j++) {\n\t\t\t\t\tset[i][j] = Integer.parseInt(strArr[j]);\n\n\t\t\t\t\t// ????¨????????¨????\n\t\t\t\t\tset[i][c] += set[i][j]; // ???\n\t\t\t\t\tset[r][j] += set[i][j]; // ???\n\t\t\t\t\tset[r][c] += set[i][j]; // ?????????????¨?\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tfor (int i = 0; i < set.length; i++) {\n\t\t\t\tfor (int j = 0; j < set[i].length; j++) {\n\t\t\t\t\tSystem.out.print(set[i][j]);\n\t\t\t\t\tif (j < c)\n\t\t\t\t\t\tSystem.out.print(\" \");\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\te.printStackTrace();\n\t\t} finally {\n\t\t\ttry {\n\t\t\t\tif (br != null) {\n\t\t\t\t\tbr.close();\n\t\t\t\t}\n\t\t\t} catch (IOException ioe) {\n\t\t\t}\n\n\t\t}",
"catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}",
"IOException e",
"{\n\t\t\te.printStackTrace();\n\t\t}",
"e.printStackTrace()",
"e.printStackTrace",
"e",
"{\n\t\t\ttry {\n\t\t\t\tif (br != null) {\n\t\t\t\t\tbr.close();\n\t\t\t\t}\n\t\t\t} catch (IOException ioe) {\n\t\t\t}\n\n\t\t}",
"try {\n\t\t\t\tif (br != null) {\n\t\t\t\t\tbr.close();\n\t\t\t\t}\n\t\t\t} catch (IOException ioe) {\n\t\t\t}",
"catch (IOException ioe) {\n\t\t\t}",
"IOException ioe",
"{\n\t\t\t}",
"{\n\t\t\t\tif (br != null) {\n\t\t\t\t\tbr.close();\n\t\t\t\t}\n\t\t\t}",
"if (br != null) {\n\t\t\t\t\tbr.close();\n\t\t\t\t}",
"br != null",
"br",
"null",
"{\n\t\t\t\t\tbr.close();\n\t\t\t\t}",
"br.close()",
"br.close",
"br",
"{\n\n\t\t\tString str = br.readLine();\n\t\t\tString[] strArr = str.split(\" \");\n\n\t\t\tint r = Integer.parseInt(strArr[0]);\n\t\t\tint c = Integer.parseInt(strArr[1]);\n\n\t\t\tint[][] set = new int[r + 1][c + 1];\n\t\t\tfor (int i = 0; i < r; i++) {\n\n\t\t\t\tstr = br.readLine();\n\t\t\t\tstrArr = str.split(\" \");\n\n\t\t\t\tfor (int j = 0; j < c; j++) {\n\t\t\t\t\tset[i][j] = Integer.parseInt(strArr[j]);\n\n\t\t\t\t\t// ????¨????????¨????\n\t\t\t\t\tset[i][c] += set[i][j]; // ???\n\t\t\t\t\tset[r][j] += set[i][j]; // ???\n\t\t\t\t\tset[r][c] += set[i][j]; // ?????????????¨?\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tfor (int i = 0; i < set.length; i++) {\n\t\t\t\tfor (int j = 0; j < set[i].length; j++) {\n\t\t\t\t\tSystem.out.print(set[i][j]);\n\t\t\t\t\tif (j < c)\n\t\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t}\n\t\t\t\tSystem.out.println();\n\t\t\t}\n\n\t\t}",
"String str = br.readLine();",
"str",
"br.readLine()",
"br.readLine",
"br",
"String[] strArr = str.split(\" \");",
"strArr",
"str.split(\" \")",
"str.split",
"str",
"\" \"",
"int r = Integer.parseInt(strArr[0]);",
"r",
"Integer.parseInt(strArr[0])",
"Integer.parseInt",
"Integer",
"strArr[0]",
"strArr",
"0",
"int c = Integer.parseInt(strArr[1]);",
"c",
"Integer.parseInt(strArr[1])",
"Integer.parseInt",
"Integer",
"strArr[1]",
"strArr",
"1",
"int[][] set = new int[r + 1][c + 1];",
"set",
"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\t\tstr = br.readLine();\n\t\t\t\tstrArr = str.split(\" \");\n\n\t\t\t\tfor (int j = 0; j < c; j++) {\n\t\t\t\t\tset[i][j] = Integer.parseInt(strArr[j]);\n\n\t\t\t\t\t// ????¨????????¨????\n\t\t\t\t\tset[i][c] += set[i][j]; // ???\n\t\t\t\t\tset[r][j] += set[i][j]; // ???\n\t\t\t\t\tset[r][c] += set[i][j]; // ?????????????¨?\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\n\t\t\t\tstr = br.readLine();\n\t\t\t\tstrArr = str.split(\" \");\n\n\t\t\t\tfor (int j = 0; j < c; j++) {\n\t\t\t\t\tset[i][j] = Integer.parseInt(strArr[j]);\n\n\t\t\t\t\t// ????¨????????¨????\n\t\t\t\t\tset[i][c] += set[i][j]; // ???\n\t\t\t\t\tset[r][j] += set[i][j]; // ???\n\t\t\t\t\tset[r][c] += set[i][j]; // ?????????????¨?\n\t\t\t\t}\n\t\t\t}",
"{\n\n\t\t\t\tstr = br.readLine();\n\t\t\t\tstrArr = str.split(\" \");\n\n\t\t\t\tfor (int j = 0; j < c; j++) {\n\t\t\t\t\tset[i][j] = Integer.parseInt(strArr[j]);\n\n\t\t\t\t\t// ????¨????????¨????\n\t\t\t\t\tset[i][c] += set[i][j]; // ???\n\t\t\t\t\tset[r][j] += set[i][j]; // ???\n\t\t\t\t\tset[r][c] += set[i][j]; // ?????????????¨?\n\t\t\t\t}\n\t\t\t}",
"str = br.readLine()",
"str",
"br.readLine()",
"br.readLine",
"br",
"strArr = str.split(\" \")",
"strArr",
"str.split(\" \")",
"str.split",
"str",
"\" \"",
"for (int j = 0; j < c; j++) {\n\t\t\t\t\tset[i][j] = Integer.parseInt(strArr[j]);\n\n\t\t\t\t\t// ????¨????????¨????\n\t\t\t\t\tset[i][c] += set[i][j]; // ???\n\t\t\t\t\tset[r][j] += set[i][j]; // ???\n\t\t\t\t\tset[r][c] += set[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\tset[i][j] = Integer.parseInt(strArr[j]);\n\n\t\t\t\t\t// ????¨????????¨????\n\t\t\t\t\tset[i][c] += set[i][j]; // ???\n\t\t\t\t\tset[r][j] += set[i][j]; // ???\n\t\t\t\t\tset[r][c] += set[i][j]; // ?????????????¨?\n\t\t\t\t}",
"{\n\t\t\t\t\tset[i][j] = Integer.parseInt(strArr[j]);\n\n\t\t\t\t\t// ????¨????????¨????\n\t\t\t\t\tset[i][c] += set[i][j]; // ???\n\t\t\t\t\tset[r][j] += set[i][j]; // ???\n\t\t\t\t\tset[r][c] += set[i][j]; // ?????????????¨?\n\t\t\t\t}",
"set[i][j] = Integer.parseInt(strArr[j])",
"set[i][j]",
"set[i]",
"set",
"i",
"j",
"Integer.parseInt(strArr[j])",
"Integer.parseInt",
"Integer",
"strArr[j]",
"strArr",
"j",
"set[i][c] += set[i][j]",
"set[i][c]",
"set[i]",
"set",
"i",
"c",
"set[i][j]",
"set[i]",
"set",
"i",
"j",
"set[r][j] += set[i][j]",
"set[r][j]",
"set[r]",
"set",
"r",
"j",
"set[i][j]",
"set[i]",
"set",
"i",
"j",
"set[r][c] += set[i][j]",
"set[r][c]",
"set[r]",
"set",
"r",
"c",
"set[i][j]",
"set[i]",
"set",
"i",
"j",
"for (int i = 0; i < set.length; i++) {\n\t\t\t\tfor (int j = 0; j < set[i].length; j++) {\n\t\t\t\t\tSystem.out.print(set[i][j]);\n\t\t\t\t\tif (j < c)\n\t\t\t\t\t\tSystem.out.print(\" \");\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 < set.length",
"i",
"set.length",
"set",
"set.length",
"i++",
"i++",
"i",
"{\n\t\t\t\tfor (int j = 0; j < set[i].length; j++) {\n\t\t\t\t\tSystem.out.print(set[i][j]);\n\t\t\t\t\tif (j < c)\n\t\t\t\t\t\tSystem.out.print(\" \");\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 < set[i].length; j++) {\n\t\t\t\t\tSystem.out.print(set[i][j]);\n\t\t\t\t\tif (j < c)\n\t\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t}\n\t\t\t\tSystem.out.println();\n\t\t\t}",
"for (int j = 0; j < set[i].length; j++) {\n\t\t\t\t\tSystem.out.print(set[i][j]);\n\t\t\t\t\tif (j < c)\n\t\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t}",
"int j = 0;",
"int j = 0;",
"j",
"0",
"j < set[i].length",
"j",
"set[i].length",
"set[i]",
"set",
"i",
"set[i].length",
"j++",
"j++",
"j",
"{\n\t\t\t\t\tSystem.out.print(set[i][j]);\n\t\t\t\t\tif (j < c)\n\t\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t}",
"{\n\t\t\t\t\tSystem.out.print(set[i][j]);\n\t\t\t\t\tif (j < c)\n\t\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t}",
"System.out.print(set[i][j])",
"System.out.print",
"System.out",
"System",
"System.out",
"set[i][j]",
"set[i]",
"set",
"i",
"j",
"if (j < c)\n\t\t\t\t\t\tSystem.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\tpublic static void main(String[] args) {\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\n\t\ttry {\n\n\t\t\tString str = br.readLine();\n\t\t\tString[] strArr = str.split(\" \");\n\n\t\t\tint r = Integer.parseInt(strArr[0]);\n\t\t\tint c = Integer.parseInt(strArr[1]);\n\n\t\t\tint[][] set = new int[r + 1][c + 1];\n\t\t\tfor (int i = 0; i < r; i++) {\n\n\t\t\t\tstr = br.readLine();\n\t\t\t\tstrArr = str.split(\" \");\n\n\t\t\t\tfor (int j = 0; j < c; j++) {\n\t\t\t\t\tset[i][j] = Integer.parseInt(strArr[j]);\n\n\t\t\t\t\t// ????¨????????¨????\n\t\t\t\t\tset[i][c] += set[i][j]; // ???\n\t\t\t\t\tset[r][j] += set[i][j]; // ???\n\t\t\t\t\tset[r][c] += set[i][j]; // ?????????????¨?\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tfor (int i = 0; i < set.length; i++) {\n\t\t\t\tfor (int j = 0; j < set[i].length; j++) {\n\t\t\t\t\tSystem.out.print(set[i][j]);\n\t\t\t\t\tif (j < c)\n\t\t\t\t\t\tSystem.out.print(\" \");\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\te.printStackTrace();\n\t\t} finally {\n\t\t\ttry {\n\t\t\t\tif (br != null) {\n\t\t\t\t\tbr.close();\n\t\t\t\t}\n\t\t\t} catch (IOException ioe) {\n\t\t\t}\n\n\t\t}\n\t}\n}",
"public class Main {\n\n\tpublic static void main(String[] args) {\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\n\t\ttry {\n\n\t\t\tString str = br.readLine();\n\t\t\tString[] strArr = str.split(\" \");\n\n\t\t\tint r = Integer.parseInt(strArr[0]);\n\t\t\tint c = Integer.parseInt(strArr[1]);\n\n\t\t\tint[][] set = new int[r + 1][c + 1];\n\t\t\tfor (int i = 0; i < r; i++) {\n\n\t\t\t\tstr = br.readLine();\n\t\t\t\tstrArr = str.split(\" \");\n\n\t\t\t\tfor (int j = 0; j < c; j++) {\n\t\t\t\t\tset[i][j] = Integer.parseInt(strArr[j]);\n\n\t\t\t\t\t// ????¨????????¨????\n\t\t\t\t\tset[i][c] += set[i][j]; // ???\n\t\t\t\t\tset[r][j] += set[i][j]; // ???\n\t\t\t\t\tset[r][c] += set[i][j]; // ?????????????¨?\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tfor (int i = 0; i < set.length; i++) {\n\t\t\t\tfor (int j = 0; j < set[i].length; j++) {\n\t\t\t\t\tSystem.out.print(set[i][j]);\n\t\t\t\t\tif (j < c)\n\t\t\t\t\t\tSystem.out.print(\" \");\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\te.printStackTrace();\n\t\t} finally {\n\t\t\ttry {\n\t\t\t\tif (br != null) {\n\t\t\t\t\tbr.close();\n\t\t\t\t}\n\t\t\t} catch (IOException ioe) {\n\t\t\t}\n\n\t\t}\n\t}\n}",
"Main"
] |
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class Main {
public static void main(String[] args) {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
try {
String str = br.readLine();
String[] strArr = str.split(" ");
int r = Integer.parseInt(strArr[0]);
int c = Integer.parseInt(strArr[1]);
int[][] set = new int[r + 1][c + 1];
for (int i = 0; i < r; i++) {
str = br.readLine();
strArr = str.split(" ");
for (int j = 0; j < c; j++) {
set[i][j] = Integer.parseInt(strArr[j]);
// ????¨????????¨????
set[i][c] += set[i][j]; // ???
set[r][j] += set[i][j]; // ???
set[r][c] += set[i][j]; // ?????????????¨?
}
}
for (int i = 0; i < set.length; i++) {
for (int j = 0; j < set[i].length; j++) {
System.out.print(set[i][j]);
if (j < c)
System.out.print(" ");
}
System.out.println();
}
} catch (IOException e) {
e.printStackTrace();
} finally {
try {
if (br != null) {
br.close();
}
} catch (IOException ioe) {
}
}
}
} |
[
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,
11,
1,
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,
4,
18,
18,
13,
13,
2,
18,
18,
13,
13,
13,
17,
14,
2,
13,
2,
13,
17,
30,
4,
18,
18,
13,
13,
2,
13,
17,
0,
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,
0,
13,
18,
18,
13,
13,
13,
4,
18,
18,
13,
13,
2,
13,
17,
14,
2,
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
],
[
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
],
[
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
],
[
8,
65
],
[
65,
66
],
[
66,
67
],
[
67,
68
],
[
67,
69
],
[
65,
70
],
[
70,
71
],
[
70,
72
],
[
65,
73
],
[
73,
74
],
[
74,
75
],
[
65,
76
],
[
77,
77
],
[
77,
78
],
[
78,
79
],
[
78,
80
],
[
77,
81
],
[
81,
82
],
[
82,
83
],
[
83,
84
],
[
83,
85
],
[
81,
86
],
[
86,
87
],
[
86,
88
],
[
81,
89
],
[
89,
90
],
[
90,
91
],
[
81,
92
],
[
93,
93
],
[
93,
94
],
[
94,
95
],
[
94,
96
],
[
96,
97
],
[
97,
98
],
[
97,
99
],
[
96,
100
],
[
93,
101
],
[
101,
102
],
[
102,
103
],
[
103,
104
],
[
103,
105
],
[
101,
106
],
[
106,
107
],
[
107,
108
],
[
108,
109
],
[
108,
110
],
[
107,
111
],
[
106,
112
],
[
93,
113
],
[
113,
114
],
[
114,
115
],
[
114,
116
],
[
116,
117
],
[
116,
118
],
[
113,
119
],
[
119,
120
],
[
120,
121
],
[
121,
122
],
[
122,
123
],
[
122,
124
],
[
120,
125
],
[
125,
126
],
[
125,
127
],
[
119,
128
],
[
128,
129
],
[
128,
130
],
[
8,
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
],
[
159,
167
],
[
167,
168
],
[
167,
169
],
[
169,
170
],
[
170,
171
],
[
170,
172
],
[
169,
173
],
[
143,
174
],
[
174,
175
],
[
175,
176
],
[
176,
177
],
[
176,
178
],
[
174,
179
],
[
179,
180
],
[
179,
181
],
[
143,
182
],
[
182,
183
],
[
183,
184
],
[
183,
185
],
[
185,
186
],
[
185,
187
],
[
182,
188
],
[
188,
189
],
[
189,
190
],
[
190,
191
],
[
190,
192
],
[
188,
193
],
[
193,
194
],
[
193,
195
],
[
6,
196
],
[
196,
197
]
] | [
"import java.util.Scanner;\n\nclass Main {\n\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 suma = 0;\n\t\tint[][] sheet = new int[r][c];\n\n\t\tfor(int i=0; i<r; i++){\n\t\t\tfor(int s=0; s<c; s++){\n\t\t\t\tsheet[i][s] = scan.nextInt();\n\t\t\t}\n\t\t}\n\t\tfor(int i=0; i<r; i++){\n\t\t\tint sumw = 0;\n\t\t\tfor(int s=0; s<c; s++){\n\t\t\t\tsumw += sheet[i][s];\n\t\t\t\tSystem.out.print(sheet[i][s] + \" \");\n\t\t\t\tif(s == c-1){\n\t\t\t\t\tSystem.out.print(sumw + \"\\n\");\n\t\t\t\t\tsumw = 0;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tfor(int i=0; i<c; i++){\n\t\t\tint sumh= 0;\n\t\t\tfor(int s=0; s<r; s++){\n\t\t\t\tsuma += sheet[s][i];\n\t\t\t\tsumh += sheet[s][i];\n\t\t\t}\n\t\t\tSystem.out.print(sumh + \" \");\n\t\t\tif(i == c-1)\n\t\t\t\tSystem.out.print(suma + \"\\n\");\n\t\t}\n\n\t}\n\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"class Main {\n\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 suma = 0;\n\t\tint[][] sheet = new int[r][c];\n\n\t\tfor(int i=0; i<r; i++){\n\t\t\tfor(int s=0; s<c; s++){\n\t\t\t\tsheet[i][s] = scan.nextInt();\n\t\t\t}\n\t\t}\n\t\tfor(int i=0; i<r; i++){\n\t\t\tint sumw = 0;\n\t\t\tfor(int s=0; s<c; s++){\n\t\t\t\tsumw += sheet[i][s];\n\t\t\t\tSystem.out.print(sheet[i][s] + \" \");\n\t\t\t\tif(s == c-1){\n\t\t\t\t\tSystem.out.print(sumw + \"\\n\");\n\t\t\t\t\tsumw = 0;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tfor(int i=0; i<c; i++){\n\t\t\tint sumh= 0;\n\t\t\tfor(int s=0; s<r; s++){\n\t\t\t\tsuma += sheet[s][i];\n\t\t\t\tsumh += sheet[s][i];\n\t\t\t}\n\t\t\tSystem.out.print(sumh + \" \");\n\t\t\tif(i == c-1)\n\t\t\t\tSystem.out.print(suma + \"\\n\");\n\t\t}\n\n\t}\n\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 suma = 0;\n\t\tint[][] sheet = new int[r][c];\n\n\t\tfor(int i=0; i<r; i++){\n\t\t\tfor(int s=0; s<c; s++){\n\t\t\t\tsheet[i][s] = scan.nextInt();\n\t\t\t}\n\t\t}\n\t\tfor(int i=0; i<r; i++){\n\t\t\tint sumw = 0;\n\t\t\tfor(int s=0; s<c; s++){\n\t\t\t\tsumw += sheet[i][s];\n\t\t\t\tSystem.out.print(sheet[i][s] + \" \");\n\t\t\t\tif(s == c-1){\n\t\t\t\t\tSystem.out.print(sumw + \"\\n\");\n\t\t\t\t\tsumw = 0;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tfor(int i=0; i<c; i++){\n\t\t\tint sumh= 0;\n\t\t\tfor(int s=0; s<r; s++){\n\t\t\t\tsuma += sheet[s][i];\n\t\t\t\tsumh += sheet[s][i];\n\t\t\t}\n\t\t\tSystem.out.print(sumh + \" \");\n\t\t\tif(i == c-1)\n\t\t\t\tSystem.out.print(suma + \"\\n\");\n\t\t}\n\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 suma = 0;\n\t\tint[][] sheet = new int[r][c];\n\n\t\tfor(int i=0; i<r; i++){\n\t\t\tfor(int s=0; s<c; s++){\n\t\t\t\tsheet[i][s] = scan.nextInt();\n\t\t\t}\n\t\t}\n\t\tfor(int i=0; i<r; i++){\n\t\t\tint sumw = 0;\n\t\t\tfor(int s=0; s<c; s++){\n\t\t\t\tsumw += sheet[i][s];\n\t\t\t\tSystem.out.print(sheet[i][s] + \" \");\n\t\t\t\tif(s == c-1){\n\t\t\t\t\tSystem.out.print(sumw + \"\\n\");\n\t\t\t\t\tsumw = 0;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tfor(int i=0; i<c; i++){\n\t\t\tint sumh= 0;\n\t\t\tfor(int s=0; s<r; s++){\n\t\t\t\tsuma += sheet[s][i];\n\t\t\t\tsumh += sheet[s][i];\n\t\t\t}\n\t\t\tSystem.out.print(sumh + \" \");\n\t\t\tif(i == c-1)\n\t\t\t\tSystem.out.print(suma + \"\\n\");\n\t\t}\n\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 suma = 0;",
"suma",
"0",
"int[][] sheet = new int[r][c];",
"sheet",
"new int[r][c]",
"r",
"c",
"for(int i=0; i<r; i++){\n\t\t\tfor(int s=0; s<c; s++){\n\t\t\t\tsheet[i][s] = 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 s=0; s<c; s++){\n\t\t\t\tsheet[i][s] = scan.nextInt();\n\t\t\t}\n\t\t}",
"{\n\t\t\tfor(int s=0; s<c; s++){\n\t\t\t\tsheet[i][s] = scan.nextInt();\n\t\t\t}\n\t\t}",
"for(int s=0; s<c; s++){\n\t\t\t\tsheet[i][s] = scan.nextInt();\n\t\t\t}",
"int s=0;",
"int s=0;",
"s",
"0",
"s<c",
"s",
"c",
"s++",
"s++",
"s",
"{\n\t\t\t\tsheet[i][s] = scan.nextInt();\n\t\t\t}",
"{\n\t\t\t\tsheet[i][s] = scan.nextInt();\n\t\t\t}",
"sheet[i][s] = scan.nextInt()",
"sheet[i][s]",
"sheet[i]",
"sheet",
"i",
"s",
"scan.nextInt()",
"scan.nextInt",
"scan",
"for(int i=0; i<r; i++){\n\t\t\tint sumw = 0;\n\t\t\tfor(int s=0; s<c; s++){\n\t\t\t\tsumw += sheet[i][s];\n\t\t\t\tSystem.out.print(sheet[i][s] + \" \");\n\t\t\t\tif(s == c-1){\n\t\t\t\t\tSystem.out.print(sumw + \"\\n\");\n\t\t\t\t\tsumw = 0;\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\tint sumw = 0;\n\t\t\tfor(int s=0; s<c; s++){\n\t\t\t\tsumw += sheet[i][s];\n\t\t\t\tSystem.out.print(sheet[i][s] + \" \");\n\t\t\t\tif(s == c-1){\n\t\t\t\t\tSystem.out.print(sumw + \"\\n\");\n\t\t\t\t\tsumw = 0;\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"{\n\t\t\tint sumw = 0;\n\t\t\tfor(int s=0; s<c; s++){\n\t\t\t\tsumw += sheet[i][s];\n\t\t\t\tSystem.out.print(sheet[i][s] + \" \");\n\t\t\t\tif(s == c-1){\n\t\t\t\t\tSystem.out.print(sumw + \"\\n\");\n\t\t\t\t\tsumw = 0;\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"int sumw = 0;",
"sumw",
"0",
"for(int s=0; s<c; s++){\n\t\t\t\tsumw += sheet[i][s];\n\t\t\t\tSystem.out.print(sheet[i][s] + \" \");\n\t\t\t\tif(s == c-1){\n\t\t\t\t\tSystem.out.print(sumw + \"\\n\");\n\t\t\t\t\tsumw = 0;\n\t\t\t\t}\n\t\t\t}",
"int s=0;",
"int s=0;",
"s",
"0",
"s<c",
"s",
"c",
"s++",
"s++",
"s",
"{\n\t\t\t\tsumw += sheet[i][s];\n\t\t\t\tSystem.out.print(sheet[i][s] + \" \");\n\t\t\t\tif(s == c-1){\n\t\t\t\t\tSystem.out.print(sumw + \"\\n\");\n\t\t\t\t\tsumw = 0;\n\t\t\t\t}\n\t\t\t}",
"{\n\t\t\t\tsumw += sheet[i][s];\n\t\t\t\tSystem.out.print(sheet[i][s] + \" \");\n\t\t\t\tif(s == c-1){\n\t\t\t\t\tSystem.out.print(sumw + \"\\n\");\n\t\t\t\t\tsumw = 0;\n\t\t\t\t}\n\t\t\t}",
"sumw += sheet[i][s]",
"sumw",
"sheet[i][s]",
"sheet[i]",
"sheet",
"i",
"s",
"System.out.print(sheet[i][s] + \" \")",
"System.out.print",
"System.out",
"System",
"System.out",
"sheet[i][s] + \" \"",
"sheet[i][s]",
"sheet[i]",
"sheet",
"i",
"s",
"\" \"",
"if(s == c-1){\n\t\t\t\t\tSystem.out.print(sumw + \"\\n\");\n\t\t\t\t\tsumw = 0;\n\t\t\t\t}",
"s == c-1",
"s",
"c-1",
"c",
"1",
"{\n\t\t\t\t\tSystem.out.print(sumw + \"\\n\");\n\t\t\t\t\tsumw = 0;\n\t\t\t\t}",
"System.out.print(sumw + \"\\n\")",
"System.out.print",
"System.out",
"System",
"System.out",
"sumw + \"\\n\"",
"sumw",
"\"\\n\"",
"sumw = 0",
"sumw",
"0",
"for(int i=0; i<c; i++){\n\t\t\tint sumh= 0;\n\t\t\tfor(int s=0; s<r; s++){\n\t\t\t\tsuma += sheet[s][i];\n\t\t\t\tsumh += sheet[s][i];\n\t\t\t}\n\t\t\tSystem.out.print(sumh + \" \");\n\t\t\tif(i == c-1)\n\t\t\t\tSystem.out.print(suma + \"\\n\");\n\t\t}",
"int i=0;",
"int i=0;",
"i",
"0",
"i<c",
"i",
"c",
"i++",
"i++",
"i",
"{\n\t\t\tint sumh= 0;\n\t\t\tfor(int s=0; s<r; s++){\n\t\t\t\tsuma += sheet[s][i];\n\t\t\t\tsumh += sheet[s][i];\n\t\t\t}\n\t\t\tSystem.out.print(sumh + \" \");\n\t\t\tif(i == c-1)\n\t\t\t\tSystem.out.print(suma + \"\\n\");\n\t\t}",
"{\n\t\t\tint sumh= 0;\n\t\t\tfor(int s=0; s<r; s++){\n\t\t\t\tsuma += sheet[s][i];\n\t\t\t\tsumh += sheet[s][i];\n\t\t\t}\n\t\t\tSystem.out.print(sumh + \" \");\n\t\t\tif(i == c-1)\n\t\t\t\tSystem.out.print(suma + \"\\n\");\n\t\t}",
"int sumh= 0;",
"sumh",
"0",
"for(int s=0; s<r; s++){\n\t\t\t\tsuma += sheet[s][i];\n\t\t\t\tsumh += sheet[s][i];\n\t\t\t}",
"int s=0;",
"int s=0;",
"s",
"0",
"s<r",
"s",
"r",
"s++",
"s++",
"s",
"{\n\t\t\t\tsuma += sheet[s][i];\n\t\t\t\tsumh += sheet[s][i];\n\t\t\t}",
"{\n\t\t\t\tsuma += sheet[s][i];\n\t\t\t\tsumh += sheet[s][i];\n\t\t\t}",
"suma += sheet[s][i]",
"suma",
"sheet[s][i]",
"sheet[s]",
"sheet",
"s",
"i",
"sumh += sheet[s][i]",
"sumh",
"sheet[s][i]",
"sheet[s]",
"sheet",
"s",
"i",
"System.out.print(sumh + \" \")",
"System.out.print",
"System.out",
"System",
"System.out",
"sumh + \" \"",
"sumh",
"\" \"",
"if(i == c-1)\n\t\t\t\tSystem.out.print(suma + \"\\n\");",
"i == c-1",
"i",
"c-1",
"c",
"1",
"System.out.print(suma + \"\\n\")",
"System.out.print",
"System.out",
"System",
"System.out",
"suma + \"\\n\"",
"suma",
"\"\\n\"",
"String[] args",
"args"
] | import java.util.Scanner;
class Main {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
int r = scan.nextInt();
int c = scan.nextInt();
int suma = 0;
int[][] sheet = new int[r][c];
for(int i=0; i<r; i++){
for(int s=0; s<c; s++){
sheet[i][s] = scan.nextInt();
}
}
for(int i=0; i<r; i++){
int sumw = 0;
for(int s=0; s<c; s++){
sumw += sheet[i][s];
System.out.print(sheet[i][s] + " ");
if(s == c-1){
System.out.print(sumw + "\n");
sumw = 0;
}
}
}
for(int i=0; i<c; i++){
int sumh= 0;
for(int s=0; s<r; s++){
suma += sheet[s][i];
sumh += sheet[s][i];
}
System.out.print(sumh + " ");
if(i == c-1)
System.out.print(suma + "\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,
11,
1,
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,
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,
2,
13,
18,
18,
13,
13,
13,
4,
18,
18,
13,
13,
13,
0,
13,
2,
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,
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
],
[
184,
5
],
[
184,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
8,
17
],
[
17,
18
],
[
17,
19
],
[
19,
20
],
[
20,
21
],
[
8,
22
],
[
22,
23
],
[
22,
24
],
[
8,
27
],
[
27,
28
],
[
28,
29
],
[
29,
30
],
[
29,
31
],
[
27,
32
],
[
32,
33
],
[
32,
34
],
[
27,
35
],
[
35,
36
],
[
36,
37
],
[
27,
38
],
[
39,
39
],
[
39,
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
],
[
53,
55
],
[
55,
56
],
[
56,
57
],
[
52,
58
],
[
58,
59
],
[
59,
60
],
[
60,
61
],
[
60,
62
],
[
59,
63
],
[
58,
64
],
[
8,
65
],
[
65,
66
],
[
65,
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
],
[
111,
113
],
[
113,
114
],
[
114,
115
],
[
114,
116
],
[
113,
117
],
[
80,
118
],
[
118,
119
],
[
119,
120
],
[
120,
121
],
[
120,
122
],
[
118,
123
],
[
80,
124
],
[
124,
125
],
[
124,
126
],
[
126,
127
],
[
126,
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
],
[
142,
144
],
[
141,
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
],
[
158,
160
],
[
160,
161
],
[
160,
162
],
[
162,
163
],
[
163,
164
],
[
163,
165
],
[
162,
166
],
[
141,
167
],
[
167,
168
],
[
168,
169
],
[
169,
170
],
[
169,
171
],
[
167,
172
],
[
172,
173
],
[
172,
174
],
[
8,
175
],
[
175,
176
],
[
176,
177
],
[
177,
178
],
[
177,
179
],
[
175,
180
],
[
6,
181
],
[
181,
182
],
[
0,
183
],
[
183,
184
],
[
183,
185
]
] | [
"import java.util.Scanner;\n\npublic class Main {\n\n\tpublic static void main(String[] args) {\n\t\t// TODO ?????????????????????????????????????????????\n\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\t\n\t\tint A[][] = new int[r][c];\n\t\t// ?????????????´?\n\t\tfor(int i=0; i<r; i++){\n\t\t\tfor(int i2=0; i2<c; i2++){\n\t\t\t\tint x = scan.nextInt();\n\t\t\t\tA[i][i2] = x;\n\t\t\t}\n\t\t}\n\t\t// ??????\n\t\tint total = 0;\n\t\tfor(int i=0; i<r; i++){\n\t\t\tint sumr = 0;\n\t\t\tfor(int i2=0; i2<c; i2++){\n\t\t\t\tSystem.out.print(A[i][i2] + \" \");\n\t\t\t\tsumr = sumr + A[i][i2];\n\t\t\t}\n\t\t\tSystem.out.println(sumr);\n\t\t\ttotal = total + sumr;\n\t\t}\n\t\tfor(int i=0; i<c; i++){\n\t\t\tint sumc = 0;\n\t\t\tfor(int i2=0; i2<r; i2++){\n\t\t\t\tsumc = sumc + A[i2][i];\n\t\t\t}\n\t\t\tSystem.out.print(sumc + \" \");\n\t\t}\n\t\tSystem.out.println(total);\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\t// TODO ?????????????????????????????????????????????\n\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\t\n\t\tint A[][] = new int[r][c];\n\t\t// ?????????????´?\n\t\tfor(int i=0; i<r; i++){\n\t\t\tfor(int i2=0; i2<c; i2++){\n\t\t\t\tint x = scan.nextInt();\n\t\t\t\tA[i][i2] = x;\n\t\t\t}\n\t\t}\n\t\t// ??????\n\t\tint total = 0;\n\t\tfor(int i=0; i<r; i++){\n\t\t\tint sumr = 0;\n\t\t\tfor(int i2=0; i2<c; i2++){\n\t\t\t\tSystem.out.print(A[i][i2] + \" \");\n\t\t\t\tsumr = sumr + A[i][i2];\n\t\t\t}\n\t\t\tSystem.out.println(sumr);\n\t\t\ttotal = total + sumr;\n\t\t}\n\t\tfor(int i=0; i<c; i++){\n\t\t\tint sumc = 0;\n\t\t\tfor(int i2=0; i2<r; i2++){\n\t\t\t\tsumc = sumc + A[i2][i];\n\t\t\t}\n\t\t\tSystem.out.print(sumc + \" \");\n\t\t}\n\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// TODO ?????????????????????????????????????????????\n\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\t\n\t\tint A[][] = new int[r][c];\n\t\t// ?????????????´?\n\t\tfor(int i=0; i<r; i++){\n\t\t\tfor(int i2=0; i2<c; i2++){\n\t\t\t\tint x = scan.nextInt();\n\t\t\t\tA[i][i2] = x;\n\t\t\t}\n\t\t}\n\t\t// ??????\n\t\tint total = 0;\n\t\tfor(int i=0; i<r; i++){\n\t\t\tint sumr = 0;\n\t\t\tfor(int i2=0; i2<c; i2++){\n\t\t\t\tSystem.out.print(A[i][i2] + \" \");\n\t\t\t\tsumr = sumr + A[i][i2];\n\t\t\t}\n\t\t\tSystem.out.println(sumr);\n\t\t\ttotal = total + sumr;\n\t\t}\n\t\tfor(int i=0; i<c; i++){\n\t\t\tint sumc = 0;\n\t\t\tfor(int i2=0; i2<r; i2++){\n\t\t\t\tsumc = sumc + A[i2][i];\n\t\t\t}\n\t\t\tSystem.out.print(sumc + \" \");\n\t\t}\n\t\tSystem.out.println(total);\n\t\t\t\n\t\t\n\t}",
"main",
"{\n\t\t// TODO ?????????????????????????????????????????????\n\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\t\n\t\tint A[][] = new int[r][c];\n\t\t// ?????????????´?\n\t\tfor(int i=0; i<r; i++){\n\t\t\tfor(int i2=0; i2<c; i2++){\n\t\t\t\tint x = scan.nextInt();\n\t\t\t\tA[i][i2] = x;\n\t\t\t}\n\t\t}\n\t\t// ??????\n\t\tint total = 0;\n\t\tfor(int i=0; i<r; i++){\n\t\t\tint sumr = 0;\n\t\t\tfor(int i2=0; i2<c; i2++){\n\t\t\t\tSystem.out.print(A[i][i2] + \" \");\n\t\t\t\tsumr = sumr + A[i][i2];\n\t\t\t}\n\t\t\tSystem.out.println(sumr);\n\t\t\ttotal = total + sumr;\n\t\t}\n\t\tfor(int i=0; i<c; i++){\n\t\t\tint sumc = 0;\n\t\t\tfor(int i2=0; i2<r; i2++){\n\t\t\t\tsumc = sumc + A[i2][i];\n\t\t\t}\n\t\t\tSystem.out.print(sumc + \" \");\n\t\t}\n\t\tSystem.out.println(total);\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 A[][] = new int[r][c];",
"A",
"new int[r][c]",
"r",
"c",
"for(int i=0; i<r; i++){\n\t\t\tfor(int i2=0; i2<c; i2++){\n\t\t\t\tint x = scan.nextInt();\n\t\t\t\tA[i][i2] = x;\n\t\t\t}\n\t\t}",
"int i=0;",
"int i=0;",
"i",
"0",
"i<r",
"i",
"r",
"i++",
"i++",
"i",
"{\n\t\t\tfor(int i2=0; i2<c; i2++){\n\t\t\t\tint x = scan.nextInt();\n\t\t\t\tA[i][i2] = x;\n\t\t\t}\n\t\t}",
"{\n\t\t\tfor(int i2=0; i2<c; i2++){\n\t\t\t\tint x = scan.nextInt();\n\t\t\t\tA[i][i2] = x;\n\t\t\t}\n\t\t}",
"for(int i2=0; i2<c; i2++){\n\t\t\t\tint x = scan.nextInt();\n\t\t\t\tA[i][i2] = x;\n\t\t\t}",
"int i2=0;",
"int i2=0;",
"i2",
"0",
"i2<c",
"i2",
"c",
"i2++",
"i2++",
"i2",
"{\n\t\t\t\tint x = scan.nextInt();\n\t\t\t\tA[i][i2] = x;\n\t\t\t}",
"{\n\t\t\t\tint x = scan.nextInt();\n\t\t\t\tA[i][i2] = x;\n\t\t\t}",
"int x = scan.nextInt();",
"x",
"scan.nextInt()",
"scan.nextInt",
"scan",
"A[i][i2] = x",
"A[i][i2]",
"A[i]",
"A",
"i",
"i2",
"x",
"int total = 0;",
"total",
"0",
"for(int i=0; i<r; i++){\n\t\t\tint sumr = 0;\n\t\t\tfor(int i2=0; i2<c; i2++){\n\t\t\t\tSystem.out.print(A[i][i2] + \" \");\n\t\t\t\tsumr = sumr + A[i][i2];\n\t\t\t}\n\t\t\tSystem.out.println(sumr);\n\t\t\ttotal = total + sumr;\n\t\t}",
"int i=0;",
"int i=0;",
"i",
"0",
"i<r",
"i",
"r",
"i++",
"i++",
"i",
"{\n\t\t\tint sumr = 0;\n\t\t\tfor(int i2=0; i2<c; i2++){\n\t\t\t\tSystem.out.print(A[i][i2] + \" \");\n\t\t\t\tsumr = sumr + A[i][i2];\n\t\t\t}\n\t\t\tSystem.out.println(sumr);\n\t\t\ttotal = total + sumr;\n\t\t}",
"{\n\t\t\tint sumr = 0;\n\t\t\tfor(int i2=0; i2<c; i2++){\n\t\t\t\tSystem.out.print(A[i][i2] + \" \");\n\t\t\t\tsumr = sumr + A[i][i2];\n\t\t\t}\n\t\t\tSystem.out.println(sumr);\n\t\t\ttotal = total + sumr;\n\t\t}",
"int sumr = 0;",
"sumr",
"0",
"for(int i2=0; i2<c; i2++){\n\t\t\t\tSystem.out.print(A[i][i2] + \" \");\n\t\t\t\tsumr = sumr + A[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\tSystem.out.print(A[i][i2] + \" \");\n\t\t\t\tsumr = sumr + A[i][i2];\n\t\t\t}",
"{\n\t\t\t\tSystem.out.print(A[i][i2] + \" \");\n\t\t\t\tsumr = sumr + A[i][i2];\n\t\t\t}",
"System.out.print(A[i][i2] + \" \")",
"System.out.print",
"System.out",
"System",
"System.out",
"A[i][i2] + \" \"",
"A[i][i2]",
"A[i]",
"A",
"i",
"i2",
"\" \"",
"sumr = sumr + A[i][i2]",
"sumr",
"sumr + A[i][i2]",
"sumr",
"A[i][i2]",
"A[i]",
"A",
"i",
"i2",
"System.out.println(sumr)",
"System.out.println",
"System.out",
"System",
"System.out",
"sumr",
"total = total + sumr",
"total",
"total + sumr",
"total",
"sumr",
"for(int i=0; i<c; i++){\n\t\t\tint sumc = 0;\n\t\t\tfor(int i2=0; i2<r; i2++){\n\t\t\t\tsumc = sumc + A[i2][i];\n\t\t\t}\n\t\t\tSystem.out.print(sumc + \" \");\n\t\t}",
"int i=0;",
"int i=0;",
"i",
"0",
"i<c",
"i",
"c",
"i++",
"i++",
"i",
"{\n\t\t\tint sumc = 0;\n\t\t\tfor(int i2=0; i2<r; i2++){\n\t\t\t\tsumc = sumc + A[i2][i];\n\t\t\t}\n\t\t\tSystem.out.print(sumc + \" \");\n\t\t}",
"{\n\t\t\tint sumc = 0;\n\t\t\tfor(int i2=0; i2<r; i2++){\n\t\t\t\tsumc = sumc + A[i2][i];\n\t\t\t}\n\t\t\tSystem.out.print(sumc + \" \");\n\t\t}",
"int sumc = 0;",
"sumc",
"0",
"for(int i2=0; i2<r; i2++){\n\t\t\t\tsumc = sumc + A[i2][i];\n\t\t\t}",
"int i2=0;",
"int i2=0;",
"i2",
"0",
"i2<r",
"i2",
"r",
"i2++",
"i2++",
"i2",
"{\n\t\t\t\tsumc = sumc + A[i2][i];\n\t\t\t}",
"{\n\t\t\t\tsumc = sumc + A[i2][i];\n\t\t\t}",
"sumc = sumc + A[i2][i]",
"sumc",
"sumc + A[i2][i]",
"sumc",
"A[i2][i]",
"A[i2]",
"A",
"i2",
"i",
"System.out.print(sumc + \" \")",
"System.out.print",
"System.out",
"System",
"System.out",
"sumc + \" \"",
"sumc",
"\" \"",
"System.out.println(total)",
"System.out.println",
"System.out",
"System",
"System.out",
"total",
"String[] args",
"args",
"public class Main {\n\n\tpublic static void main(String[] args) {\n\t\t// TODO ?????????????????????????????????????????????\n\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\t\n\t\tint A[][] = new int[r][c];\n\t\t// ?????????????´?\n\t\tfor(int i=0; i<r; i++){\n\t\t\tfor(int i2=0; i2<c; i2++){\n\t\t\t\tint x = scan.nextInt();\n\t\t\t\tA[i][i2] = x;\n\t\t\t}\n\t\t}\n\t\t// ??????\n\t\tint total = 0;\n\t\tfor(int i=0; i<r; i++){\n\t\t\tint sumr = 0;\n\t\t\tfor(int i2=0; i2<c; i2++){\n\t\t\t\tSystem.out.print(A[i][i2] + \" \");\n\t\t\t\tsumr = sumr + A[i][i2];\n\t\t\t}\n\t\t\tSystem.out.println(sumr);\n\t\t\ttotal = total + sumr;\n\t\t}\n\t\tfor(int i=0; i<c; i++){\n\t\t\tint sumc = 0;\n\t\t\tfor(int i2=0; i2<r; i2++){\n\t\t\t\tsumc = sumc + A[i2][i];\n\t\t\t}\n\t\t\tSystem.out.print(sumc + \" \");\n\t\t}\n\t\tSystem.out.println(total);\n\t\t\t\n\t\t\n\t}\n\n}",
"public class Main {\n\n\tpublic static void main(String[] args) {\n\t\t// TODO ?????????????????????????????????????????????\n\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\t\n\t\tint A[][] = new int[r][c];\n\t\t// ?????????????´?\n\t\tfor(int i=0; i<r; i++){\n\t\t\tfor(int i2=0; i2<c; i2++){\n\t\t\t\tint x = scan.nextInt();\n\t\t\t\tA[i][i2] = x;\n\t\t\t}\n\t\t}\n\t\t// ??????\n\t\tint total = 0;\n\t\tfor(int i=0; i<r; i++){\n\t\t\tint sumr = 0;\n\t\t\tfor(int i2=0; i2<c; i2++){\n\t\t\t\tSystem.out.print(A[i][i2] + \" \");\n\t\t\t\tsumr = sumr + A[i][i2];\n\t\t\t}\n\t\t\tSystem.out.println(sumr);\n\t\t\ttotal = total + sumr;\n\t\t}\n\t\tfor(int i=0; i<c; i++){\n\t\t\tint sumc = 0;\n\t\t\tfor(int i2=0; i2<r; i2++){\n\t\t\t\tsumc = sumc + A[i2][i];\n\t\t\t}\n\t\t\tSystem.out.print(sumc + \" \");\n\t\t}\n\t\tSystem.out.println(total);\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) {
// TODO ?????????????????????????????????????????????
Scanner scan = new Scanner(System.in);
int r = scan.nextInt();
int c = scan.nextInt();
int A[][] = new int[r][c];
// ?????????????´?
for(int i=0; i<r; i++){
for(int i2=0; i2<c; i2++){
int x = scan.nextInt();
A[i][i2] = x;
}
}
// ??????
int total = 0;
for(int i=0; i<r; i++){
int sumr = 0;
for(int i2=0; i2<c; i2++){
System.out.print(A[i][i2] + " ");
sumr = sumr + A[i][i2];
}
System.out.println(sumr);
total = total + sumr;
}
for(int i=0; i<c; i++){
int sumc = 0;
for(int i2=0; i2<r; i2++){
sumc = sumc + A[i2][i];
}
System.out.print(sumc + " ");
}
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,
20,
13,
13,
41,
13,
2,
13,
17,
41,
13,
2,
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,
41,
13,
17,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
14,
2,
40,
2,
2,
13,
17,
13,
40,
2,
2,
13,
17,
13,
30,
0,
18,
18,
13,
13,
13,
18,
18,
13,
13,
13,
14,
2,
2,
13,
17,
13,
30,
11,
1,
41,
13,
17,
2,
13,
2,
13,
17,
1,
40,
13,
30,
30,
0,
13,
18,
18,
13,
13,
13,
0,
13,
2,
13,
13,
0,
18,
18,
13,
13,
13,
13,
0,
13,
17,
0,
13,
17,
41,
13,
17,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
14,
2,
2,
13,
17,
13,
30,
11,
1,
41,
13,
17,
2,
13,
2,
13,
17,
1,
40,
13,
30,
30,
0,
13,
18,
18,
13,
13,
13,
0,
13,
2,
13,
13,
0,
18,
18,
13,
13,
13,
13,
0,
13,
17,
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,
14,
2,
2,
13,
17,
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,
17,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
326,
5
],
[
326,
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
],
[
29,
30
],
[
29,
31
],
[
8,
32
],
[
32,
33
],
[
32,
34
],
[
34,
35
],
[
34,
36
],
[
8,
37
],
[
37,
38
],
[
37,
39
],
[
8,
42
],
[
42,
43
],
[
43,
44
],
[
44,
45
],
[
44,
46
],
[
42,
47
],
[
47,
48
],
[
47,
49
],
[
42,
50
],
[
50,
51
],
[
51,
52
],
[
42,
53
],
[
54,
54
],
[
54,
55
],
[
55,
56
],
[
56,
57
],
[
57,
58
],
[
57,
59
],
[
55,
60
],
[
60,
61
],
[
60,
62
],
[
55,
63
],
[
63,
64
],
[
64,
65
],
[
55,
66
],
[
67,
67
],
[
67,
68
],
[
68,
69
],
[
69,
70
],
[
70,
71
],
[
70,
72
],
[
69,
73
],
[
68,
74
],
[
74,
75
],
[
75,
76
],
[
8,
77
],
[
77,
78
],
[
77,
79
],
[
8,
80
],
[
80,
81
],
[
80,
82
],
[
8,
83
],
[
83,
84
],
[
84,
85
],
[
85,
86
],
[
85,
87
],
[
83,
88
],
[
88,
89
],
[
88,
90
],
[
83,
91
],
[
91,
92
],
[
92,
93
],
[
83,
94
],
[
95,
95
],
[
95,
96
],
[
96,
97
],
[
97,
98
],
[
98,
99
],
[
98,
100
],
[
96,
101
],
[
101,
102
],
[
101,
103
],
[
96,
104
],
[
104,
105
],
[
105,
106
],
[
96,
107
],
[
108,
108
],
[
108,
109
],
[
109,
110
],
[
110,
111
],
[
111,
112
],
[
112,
113
],
[
113,
114
],
[
113,
115
],
[
112,
116
],
[
110,
117
],
[
117,
118
],
[
118,
119
],
[
119,
120
],
[
119,
121
],
[
118,
122
],
[
109,
123
],
[
123,
124
],
[
124,
125
],
[
125,
126
],
[
126,
127
],
[
126,
128
],
[
125,
129
],
[
124,
130
],
[
130,
131
],
[
131,
132
],
[
131,
133
],
[
130,
134
],
[
109,
135
],
[
135,
136
],
[
136,
137
],
[
137,
138
],
[
137,
139
],
[
136,
140
],
[
135,
141
],
[
141,
142
],
[
142,
143
],
[
143,
144
],
[
144,
145
],
[
144,
146
],
[
142,
147
],
[
147,
148
],
[
147,
149
],
[
149,
150
],
[
149,
151
],
[
142,
152
],
[
152,
153
],
[
153,
154
],
[
142,
155
],
[
156,
156
],
[
156,
157
],
[
157,
158
],
[
157,
159
],
[
159,
160
],
[
160,
161
],
[
160,
162
],
[
159,
163
],
[
156,
164
],
[
164,
165
],
[
164,
166
],
[
166,
167
],
[
166,
168
],
[
141,
169
],
[
169,
170
],
[
170,
171
],
[
171,
172
],
[
171,
173
],
[
170,
174
],
[
169,
175
],
[
141,
176
],
[
176,
177
],
[
176,
178
],
[
141,
179
],
[
179,
180
],
[
179,
181
],
[
8,
182
],
[
182,
183
],
[
182,
184
],
[
8,
185
],
[
185,
186
],
[
185,
187
],
[
8,
188
],
[
188,
189
],
[
189,
190
],
[
190,
191
],
[
190,
192
],
[
188,
193
],
[
193,
194
],
[
193,
195
],
[
188,
196
],
[
196,
197
],
[
197,
198
],
[
188,
199
],
[
200,
200
],
[
200,
201
],
[
201,
202
],
[
202,
203
],
[
203,
204
],
[
203,
205
],
[
201,
206
],
[
206,
207
],
[
206,
208
],
[
201,
209
],
[
209,
210
],
[
210,
211
],
[
201,
212
],
[
213,
213
],
[
213,
214
],
[
214,
215
],
[
215,
216
],
[
216,
217
],
[
216,
218
],
[
215,
219
],
[
214,
220
],
[
220,
221
],
[
221,
222
],
[
222,
223
],
[
223,
224
],
[
223,
225
],
[
221,
226
],
[
226,
227
],
[
226,
228
],
[
228,
229
],
[
228,
230
],
[
221,
231
],
[
231,
232
],
[
232,
233
],
[
221,
234
],
[
235,
235
],
[
235,
236
],
[
236,
237
],
[
236,
238
],
[
238,
239
],
[
239,
240
],
[
239,
241
],
[
238,
242
],
[
235,
243
],
[
243,
244
],
[
243,
245
],
[
245,
246
],
[
245,
247
],
[
220,
248
],
[
248,
249
],
[
249,
250
],
[
250,
251
],
[
250,
252
],
[
249,
253
],
[
248,
254
],
[
220,
255
],
[
255,
256
],
[
255,
257
],
[
220,
258
],
[
258,
259
],
[
258,
260
],
[
8,
261
],
[
261,
262
],
[
262,
263
],
[
263,
264
],
[
263,
265
],
[
261,
266
],
[
266,
267
],
[
266,
268
],
[
261,
269
],
[
269,
270
],
[
270,
271
],
[
261,
272
],
[
273,
273
],
[
273,
274
],
[
274,
275
],
[
275,
276
],
[
276,
277
],
[
276,
278
],
[
274,
279
],
[
279,
280
],
[
279,
281
],
[
274,
282
],
[
282,
283
],
[
283,
284
],
[
274,
285
],
[
286,
286
],
[
286,
287
],
[
287,
288
],
[
288,
289
],
[
289,
290
],
[
289,
291
],
[
288,
292
],
[
287,
293
],
[
293,
294
],
[
294,
295
],
[
295,
296
],
[
296,
297
],
[
296,
298
],
[
294,
299
],
[
299,
300
],
[
300,
301
],
[
300,
302
],
[
299,
303
],
[
287,
304
],
[
304,
305
],
[
305,
306
],
[
306,
307
],
[
307,
308
],
[
307,
309
],
[
305,
310
],
[
310,
311
],
[
311,
312
],
[
312,
313
],
[
312,
314
],
[
311,
315
],
[
310,
316
],
[
273,
317
],
[
317,
318
],
[
318,
319
],
[
319,
320
],
[
319,
321
],
[
317,
322
],
[
6,
323
],
[
323,
324
],
[
0,
325
],
[
325,
326
],
[
325,
327
]
] | [
"\nimport java.util.Scanner;\n\npublic class Main{\n\tpublic static void main(String[] args) {\n\n\t\tScanner sc = new Scanner(System.in);\n\n\t\tint r = sc.nextInt();\n\t\tint c = sc.nextInt();\n\t\tint[][] arrayInput = new int[r][c];\n\n\t\tint x = r+1;\n\t\tint y = c+1;\n\n\t\tint[][] arrayOutput = new int[x][y];\n\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\tarrayInput[i][j] = sc.nextInt();\n\t\t\t}\n\t\t}\n\n\n\t\t//??????????¨?????±???????\n\t\tint Sum = 0;\n\t\tint Num = 0;\n\t\tfor(int i = 0; i < x; i++) {\n\t\t\tfor(int j = 0; j < y; j++) {\n\n\t\t\t\tif(!(i+1 == x) && !( j+1 == y )) {\n\t\t\t\t\tarrayOutput[i][j] = arrayInput[i][j];\n\t\t\t\t}\n\n\t\t\t\telse if(j+1 == y) {\n\t\t\t\t\tfor(int k=0; k < y-1; k++) {\n\t\t\t\t\t\tNum = arrayOutput[i][k];\n\t\t\t\t\t\tSum = Sum + Num;\n\t\t\t\t\t}\n\t\t\t\t\tarrayOutput[i][j] = Sum;\n\t\t\t\t\tNum = 0;\n\t\t\t\t\tSum = 0;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t//??????????¨?????±???????\n\t\t\t\tint Sum1 = 0;\n\t\t\t\tint Num1 = 0;\n\t\t\t\tfor(int j = 0; j < y; j++) {\n\t\t\t\t\tfor(int i = 0; i < x; i++) {\n\n\t\t\t\t\t\tif(i+1 == x) {\n\t\t\t\t\t\t\tfor(int k=0; k < x-1; k++) {\n\t\t\t\t\t\t\t\tNum1 = arrayOutput[k][j];\n\t\t\t\t\t\t\t\tSum1 = Sum1 + Num1;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tarrayOutput[i][j] = Sum1;\n\t\t\t\t\t\t\tNum1 = 0;\n\t\t\t\t\t\t\tSum1 = 0;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t//?????????????????????\n\t\tfor(int i = 0; i < x; i++) {\n\t\t\tfor(int j = 0; j < y; j++) {\n\n\t\t\t\tif(j+1 == y) {\n\t\t\t\t\tSystem.out.print(arrayOutput[i][j]);\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tSystem.out.print(arrayOutput[i][j]+\" \");\n\t\t\t\t}\n\n\t\t\t}\n\t\t\tSystem.out.println(\"\");\n\t\t}\n\n\n\t}\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main{\n\tpublic static void main(String[] args) {\n\n\t\tScanner sc = new Scanner(System.in);\n\n\t\tint r = sc.nextInt();\n\t\tint c = sc.nextInt();\n\t\tint[][] arrayInput = new int[r][c];\n\n\t\tint x = r+1;\n\t\tint y = c+1;\n\n\t\tint[][] arrayOutput = new int[x][y];\n\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\tarrayInput[i][j] = sc.nextInt();\n\t\t\t}\n\t\t}\n\n\n\t\t//??????????¨?????±???????\n\t\tint Sum = 0;\n\t\tint Num = 0;\n\t\tfor(int i = 0; i < x; i++) {\n\t\t\tfor(int j = 0; j < y; j++) {\n\n\t\t\t\tif(!(i+1 == x) && !( j+1 == y )) {\n\t\t\t\t\tarrayOutput[i][j] = arrayInput[i][j];\n\t\t\t\t}\n\n\t\t\t\telse if(j+1 == y) {\n\t\t\t\t\tfor(int k=0; k < y-1; k++) {\n\t\t\t\t\t\tNum = arrayOutput[i][k];\n\t\t\t\t\t\tSum = Sum + Num;\n\t\t\t\t\t}\n\t\t\t\t\tarrayOutput[i][j] = Sum;\n\t\t\t\t\tNum = 0;\n\t\t\t\t\tSum = 0;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t//??????????¨?????±???????\n\t\t\t\tint Sum1 = 0;\n\t\t\t\tint Num1 = 0;\n\t\t\t\tfor(int j = 0; j < y; j++) {\n\t\t\t\t\tfor(int i = 0; i < x; i++) {\n\n\t\t\t\t\t\tif(i+1 == x) {\n\t\t\t\t\t\t\tfor(int k=0; k < x-1; k++) {\n\t\t\t\t\t\t\t\tNum1 = arrayOutput[k][j];\n\t\t\t\t\t\t\t\tSum1 = Sum1 + Num1;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tarrayOutput[i][j] = Sum1;\n\t\t\t\t\t\t\tNum1 = 0;\n\t\t\t\t\t\t\tSum1 = 0;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t//?????????????????????\n\t\tfor(int i = 0; i < x; i++) {\n\t\t\tfor(int j = 0; j < y; j++) {\n\n\t\t\t\tif(j+1 == y) {\n\t\t\t\t\tSystem.out.print(arrayOutput[i][j]);\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tSystem.out.print(arrayOutput[i][j]+\" \");\n\t\t\t\t}\n\n\t\t\t}\n\t\t\tSystem.out.println(\"\");\n\t\t}\n\n\n\t}\n}",
"Main",
"public static void main(String[] args) {\n\n\t\tScanner sc = new Scanner(System.in);\n\n\t\tint r = sc.nextInt();\n\t\tint c = sc.nextInt();\n\t\tint[][] arrayInput = new int[r][c];\n\n\t\tint x = r+1;\n\t\tint y = c+1;\n\n\t\tint[][] arrayOutput = new int[x][y];\n\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\tarrayInput[i][j] = sc.nextInt();\n\t\t\t}\n\t\t}\n\n\n\t\t//??????????¨?????±???????\n\t\tint Sum = 0;\n\t\tint Num = 0;\n\t\tfor(int i = 0; i < x; i++) {\n\t\t\tfor(int j = 0; j < y; j++) {\n\n\t\t\t\tif(!(i+1 == x) && !( j+1 == y )) {\n\t\t\t\t\tarrayOutput[i][j] = arrayInput[i][j];\n\t\t\t\t}\n\n\t\t\t\telse if(j+1 == y) {\n\t\t\t\t\tfor(int k=0; k < y-1; k++) {\n\t\t\t\t\t\tNum = arrayOutput[i][k];\n\t\t\t\t\t\tSum = Sum + Num;\n\t\t\t\t\t}\n\t\t\t\t\tarrayOutput[i][j] = Sum;\n\t\t\t\t\tNum = 0;\n\t\t\t\t\tSum = 0;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t//??????????¨?????±???????\n\t\t\t\tint Sum1 = 0;\n\t\t\t\tint Num1 = 0;\n\t\t\t\tfor(int j = 0; j < y; j++) {\n\t\t\t\t\tfor(int i = 0; i < x; i++) {\n\n\t\t\t\t\t\tif(i+1 == x) {\n\t\t\t\t\t\t\tfor(int k=0; k < x-1; k++) {\n\t\t\t\t\t\t\t\tNum1 = arrayOutput[k][j];\n\t\t\t\t\t\t\t\tSum1 = Sum1 + Num1;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tarrayOutput[i][j] = Sum1;\n\t\t\t\t\t\t\tNum1 = 0;\n\t\t\t\t\t\t\tSum1 = 0;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t//?????????????????????\n\t\tfor(int i = 0; i < x; i++) {\n\t\t\tfor(int j = 0; j < y; j++) {\n\n\t\t\t\tif(j+1 == y) {\n\t\t\t\t\tSystem.out.print(arrayOutput[i][j]);\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tSystem.out.print(arrayOutput[i][j]+\" \");\n\t\t\t\t}\n\n\t\t\t}\n\t\t\tSystem.out.println(\"\");\n\t\t}\n\n\n\t}",
"main",
"{\n\n\t\tScanner sc = new Scanner(System.in);\n\n\t\tint r = sc.nextInt();\n\t\tint c = sc.nextInt();\n\t\tint[][] arrayInput = new int[r][c];\n\n\t\tint x = r+1;\n\t\tint y = c+1;\n\n\t\tint[][] arrayOutput = new int[x][y];\n\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\tarrayInput[i][j] = sc.nextInt();\n\t\t\t}\n\t\t}\n\n\n\t\t//??????????¨?????±???????\n\t\tint Sum = 0;\n\t\tint Num = 0;\n\t\tfor(int i = 0; i < x; i++) {\n\t\t\tfor(int j = 0; j < y; j++) {\n\n\t\t\t\tif(!(i+1 == x) && !( j+1 == y )) {\n\t\t\t\t\tarrayOutput[i][j] = arrayInput[i][j];\n\t\t\t\t}\n\n\t\t\t\telse if(j+1 == y) {\n\t\t\t\t\tfor(int k=0; k < y-1; k++) {\n\t\t\t\t\t\tNum = arrayOutput[i][k];\n\t\t\t\t\t\tSum = Sum + Num;\n\t\t\t\t\t}\n\t\t\t\t\tarrayOutput[i][j] = Sum;\n\t\t\t\t\tNum = 0;\n\t\t\t\t\tSum = 0;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t//??????????¨?????±???????\n\t\t\t\tint Sum1 = 0;\n\t\t\t\tint Num1 = 0;\n\t\t\t\tfor(int j = 0; j < y; j++) {\n\t\t\t\t\tfor(int i = 0; i < x; i++) {\n\n\t\t\t\t\t\tif(i+1 == x) {\n\t\t\t\t\t\t\tfor(int k=0; k < x-1; k++) {\n\t\t\t\t\t\t\t\tNum1 = arrayOutput[k][j];\n\t\t\t\t\t\t\t\tSum1 = Sum1 + Num1;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tarrayOutput[i][j] = Sum1;\n\t\t\t\t\t\t\tNum1 = 0;\n\t\t\t\t\t\t\tSum1 = 0;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t//?????????????????????\n\t\tfor(int i = 0; i < x; i++) {\n\t\t\tfor(int j = 0; j < y; j++) {\n\n\t\t\t\tif(j+1 == y) {\n\t\t\t\t\tSystem.out.print(arrayOutput[i][j]);\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tSystem.out.print(arrayOutput[i][j]+\" \");\n\t\t\t\t}\n\n\t\t\t}\n\t\t\tSystem.out.println(\"\");\n\t\t}\n\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[][] arrayInput = new int[r][c];",
"arrayInput",
"new int[r][c]",
"r",
"c",
"int x = r+1;",
"x",
"r+1",
"r",
"1",
"int y = c+1;",
"y",
"c+1",
"c",
"1",
"int[][] arrayOutput = new int[x][y];",
"arrayOutput",
"new int[x][y]",
"x",
"y",
"for(int i = 0; i < r; i++) {\n\t\t\tfor(int j = 0; j < c; j++) {\n\t\t\t\tarrayInput[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\tarrayInput[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\tarrayInput[i][j] = sc.nextInt();\n\t\t\t}\n\t\t}",
"for(int j = 0; j < c; j++) {\n\t\t\t\tarrayInput[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\tarrayInput[i][j] = sc.nextInt();\n\t\t\t}",
"{\n\t\t\t\tarrayInput[i][j] = sc.nextInt();\n\t\t\t}",
"arrayInput[i][j] = sc.nextInt()",
"arrayInput[i][j]",
"arrayInput[i]",
"arrayInput",
"i",
"j",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int Sum = 0;",
"Sum",
"0",
"int Num = 0;",
"Num",
"0",
"for(int i = 0; i < x; i++) {\n\t\t\tfor(int j = 0; j < y; j++) {\n\n\t\t\t\tif(!(i+1 == x) && !( j+1 == y )) {\n\t\t\t\t\tarrayOutput[i][j] = arrayInput[i][j];\n\t\t\t\t}\n\n\t\t\t\telse if(j+1 == y) {\n\t\t\t\t\tfor(int k=0; k < y-1; k++) {\n\t\t\t\t\t\tNum = arrayOutput[i][k];\n\t\t\t\t\t\tSum = Sum + Num;\n\t\t\t\t\t}\n\t\t\t\t\tarrayOutput[i][j] = Sum;\n\t\t\t\t\tNum = 0;\n\t\t\t\t\tSum = 0;\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < x",
"i",
"x",
"i++",
"i++",
"i",
"{\n\t\t\tfor(int j = 0; j < y; j++) {\n\n\t\t\t\tif(!(i+1 == x) && !( j+1 == y )) {\n\t\t\t\t\tarrayOutput[i][j] = arrayInput[i][j];\n\t\t\t\t}\n\n\t\t\t\telse if(j+1 == y) {\n\t\t\t\t\tfor(int k=0; k < y-1; k++) {\n\t\t\t\t\t\tNum = arrayOutput[i][k];\n\t\t\t\t\t\tSum = Sum + Num;\n\t\t\t\t\t}\n\t\t\t\t\tarrayOutput[i][j] = Sum;\n\t\t\t\t\tNum = 0;\n\t\t\t\t\tSum = 0;\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"{\n\t\t\tfor(int j = 0; j < y; j++) {\n\n\t\t\t\tif(!(i+1 == x) && !( j+1 == y )) {\n\t\t\t\t\tarrayOutput[i][j] = arrayInput[i][j];\n\t\t\t\t}\n\n\t\t\t\telse if(j+1 == y) {\n\t\t\t\t\tfor(int k=0; k < y-1; k++) {\n\t\t\t\t\t\tNum = arrayOutput[i][k];\n\t\t\t\t\t\tSum = Sum + Num;\n\t\t\t\t\t}\n\t\t\t\t\tarrayOutput[i][j] = Sum;\n\t\t\t\t\tNum = 0;\n\t\t\t\t\tSum = 0;\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"for(int j = 0; j < y; j++) {\n\n\t\t\t\tif(!(i+1 == x) && !( j+1 == y )) {\n\t\t\t\t\tarrayOutput[i][j] = arrayInput[i][j];\n\t\t\t\t}\n\n\t\t\t\telse if(j+1 == y) {\n\t\t\t\t\tfor(int k=0; k < y-1; k++) {\n\t\t\t\t\t\tNum = arrayOutput[i][k];\n\t\t\t\t\t\tSum = Sum + Num;\n\t\t\t\t\t}\n\t\t\t\t\tarrayOutput[i][j] = Sum;\n\t\t\t\t\tNum = 0;\n\t\t\t\t\tSum = 0;\n\t\t\t\t}\n\t\t\t}",
"int j = 0;",
"int j = 0;",
"j",
"0",
"j < y",
"j",
"y",
"j++",
"j++",
"j",
"{\n\n\t\t\t\tif(!(i+1 == x) && !( j+1 == y )) {\n\t\t\t\t\tarrayOutput[i][j] = arrayInput[i][j];\n\t\t\t\t}\n\n\t\t\t\telse if(j+1 == y) {\n\t\t\t\t\tfor(int k=0; k < y-1; k++) {\n\t\t\t\t\t\tNum = arrayOutput[i][k];\n\t\t\t\t\t\tSum = Sum + Num;\n\t\t\t\t\t}\n\t\t\t\t\tarrayOutput[i][j] = Sum;\n\t\t\t\t\tNum = 0;\n\t\t\t\t\tSum = 0;\n\t\t\t\t}\n\t\t\t}",
"{\n\n\t\t\t\tif(!(i+1 == x) && !( j+1 == y )) {\n\t\t\t\t\tarrayOutput[i][j] = arrayInput[i][j];\n\t\t\t\t}\n\n\t\t\t\telse if(j+1 == y) {\n\t\t\t\t\tfor(int k=0; k < y-1; k++) {\n\t\t\t\t\t\tNum = arrayOutput[i][k];\n\t\t\t\t\t\tSum = Sum + Num;\n\t\t\t\t\t}\n\t\t\t\t\tarrayOutput[i][j] = Sum;\n\t\t\t\t\tNum = 0;\n\t\t\t\t\tSum = 0;\n\t\t\t\t}\n\t\t\t}",
"if(!(i+1 == x) && !( j+1 == y )) {\n\t\t\t\t\tarrayOutput[i][j] = arrayInput[i][j];\n\t\t\t\t}\n\n\t\t\t\telse if(j+1 == y) {\n\t\t\t\t\tfor(int k=0; k < y-1; k++) {\n\t\t\t\t\t\tNum = arrayOutput[i][k];\n\t\t\t\t\t\tSum = Sum + Num;\n\t\t\t\t\t}\n\t\t\t\t\tarrayOutput[i][j] = Sum;\n\t\t\t\t\tNum = 0;\n\t\t\t\t\tSum = 0;\n\t\t\t\t}",
"!(i+1 == x) && !( j+1 == y )",
"!(i+1 == x)",
"(i+1 == x)",
"i+1",
"i",
"1",
"x",
"!( j+1 == y )",
"( j+1 == y )",
"j+1",
"j",
"1",
"y",
"{\n\t\t\t\t\tarrayOutput[i][j] = arrayInput[i][j];\n\t\t\t\t}",
"arrayOutput[i][j] = arrayInput[i][j]",
"arrayOutput[i][j]",
"arrayOutput[i]",
"arrayOutput",
"i",
"j",
"arrayInput[i][j]",
"arrayInput[i]",
"arrayInput",
"i",
"j",
"if(j+1 == y) {\n\t\t\t\t\tfor(int k=0; k < y-1; k++) {\n\t\t\t\t\t\tNum = arrayOutput[i][k];\n\t\t\t\t\t\tSum = Sum + Num;\n\t\t\t\t\t}\n\t\t\t\t\tarrayOutput[i][j] = Sum;\n\t\t\t\t\tNum = 0;\n\t\t\t\t\tSum = 0;\n\t\t\t\t}",
"j+1 == y",
"j+1",
"j",
"1",
"y",
"{\n\t\t\t\t\tfor(int k=0; k < y-1; k++) {\n\t\t\t\t\t\tNum = arrayOutput[i][k];\n\t\t\t\t\t\tSum = Sum + Num;\n\t\t\t\t\t}\n\t\t\t\t\tarrayOutput[i][j] = Sum;\n\t\t\t\t\tNum = 0;\n\t\t\t\t\tSum = 0;\n\t\t\t\t}",
"for(int k=0; k < y-1; k++) {\n\t\t\t\t\t\tNum = arrayOutput[i][k];\n\t\t\t\t\t\tSum = Sum + Num;\n\t\t\t\t\t}",
"int k=0;",
"int k=0;",
"k",
"0",
"k < y-1",
"k",
"y-1",
"y",
"1",
"k++",
"k++",
"k",
"{\n\t\t\t\t\t\tNum = arrayOutput[i][k];\n\t\t\t\t\t\tSum = Sum + Num;\n\t\t\t\t\t}",
"{\n\t\t\t\t\t\tNum = arrayOutput[i][k];\n\t\t\t\t\t\tSum = Sum + Num;\n\t\t\t\t\t}",
"Num = arrayOutput[i][k]",
"Num",
"arrayOutput[i][k]",
"arrayOutput[i]",
"arrayOutput",
"i",
"k",
"Sum = Sum + Num",
"Sum",
"Sum + Num",
"Sum",
"Num",
"arrayOutput[i][j] = Sum",
"arrayOutput[i][j]",
"arrayOutput[i]",
"arrayOutput",
"i",
"j",
"Sum",
"Num = 0",
"Num",
"0",
"Sum = 0",
"Sum",
"0",
"int Sum1 = 0;",
"Sum1",
"0",
"int Num1 = 0;",
"Num1",
"0",
"for(int j = 0; j < y; j++) {\n\t\t\t\t\tfor(int i = 0; i < x; i++) {\n\n\t\t\t\t\t\tif(i+1 == x) {\n\t\t\t\t\t\t\tfor(int k=0; k < x-1; k++) {\n\t\t\t\t\t\t\t\tNum1 = arrayOutput[k][j];\n\t\t\t\t\t\t\t\tSum1 = Sum1 + Num1;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tarrayOutput[i][j] = Sum1;\n\t\t\t\t\t\t\tNum1 = 0;\n\t\t\t\t\t\t\tSum1 = 0;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}",
"int j = 0;",
"int j = 0;",
"j",
"0",
"j < y",
"j",
"y",
"j++",
"j++",
"j",
"{\n\t\t\t\t\tfor(int i = 0; i < x; i++) {\n\n\t\t\t\t\t\tif(i+1 == x) {\n\t\t\t\t\t\t\tfor(int k=0; k < x-1; k++) {\n\t\t\t\t\t\t\t\tNum1 = arrayOutput[k][j];\n\t\t\t\t\t\t\t\tSum1 = Sum1 + Num1;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tarrayOutput[i][j] = Sum1;\n\t\t\t\t\t\t\tNum1 = 0;\n\t\t\t\t\t\t\tSum1 = 0;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}",
"{\n\t\t\t\t\tfor(int i = 0; i < x; i++) {\n\n\t\t\t\t\t\tif(i+1 == x) {\n\t\t\t\t\t\t\tfor(int k=0; k < x-1; k++) {\n\t\t\t\t\t\t\t\tNum1 = arrayOutput[k][j];\n\t\t\t\t\t\t\t\tSum1 = Sum1 + Num1;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tarrayOutput[i][j] = Sum1;\n\t\t\t\t\t\t\tNum1 = 0;\n\t\t\t\t\t\t\tSum1 = 0;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}",
"for(int i = 0; i < x; i++) {\n\n\t\t\t\t\t\tif(i+1 == x) {\n\t\t\t\t\t\t\tfor(int k=0; k < x-1; k++) {\n\t\t\t\t\t\t\t\tNum1 = arrayOutput[k][j];\n\t\t\t\t\t\t\t\tSum1 = Sum1 + Num1;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tarrayOutput[i][j] = Sum1;\n\t\t\t\t\t\t\tNum1 = 0;\n\t\t\t\t\t\t\tSum1 = 0;\n\t\t\t\t\t\t}\n\t\t\t\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < x",
"i",
"x",
"i++",
"i++",
"i",
"{\n\n\t\t\t\t\t\tif(i+1 == x) {\n\t\t\t\t\t\t\tfor(int k=0; k < x-1; k++) {\n\t\t\t\t\t\t\t\tNum1 = arrayOutput[k][j];\n\t\t\t\t\t\t\t\tSum1 = Sum1 + Num1;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tarrayOutput[i][j] = Sum1;\n\t\t\t\t\t\t\tNum1 = 0;\n\t\t\t\t\t\t\tSum1 = 0;\n\t\t\t\t\t\t}\n\t\t\t\t\t}",
"{\n\n\t\t\t\t\t\tif(i+1 == x) {\n\t\t\t\t\t\t\tfor(int k=0; k < x-1; k++) {\n\t\t\t\t\t\t\t\tNum1 = arrayOutput[k][j];\n\t\t\t\t\t\t\t\tSum1 = Sum1 + Num1;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tarrayOutput[i][j] = Sum1;\n\t\t\t\t\t\t\tNum1 = 0;\n\t\t\t\t\t\t\tSum1 = 0;\n\t\t\t\t\t\t}\n\t\t\t\t\t}",
"if(i+1 == x) {\n\t\t\t\t\t\t\tfor(int k=0; k < x-1; k++) {\n\t\t\t\t\t\t\t\tNum1 = arrayOutput[k][j];\n\t\t\t\t\t\t\t\tSum1 = Sum1 + Num1;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tarrayOutput[i][j] = Sum1;\n\t\t\t\t\t\t\tNum1 = 0;\n\t\t\t\t\t\t\tSum1 = 0;\n\t\t\t\t\t\t}",
"i+1 == x",
"i+1",
"i",
"1",
"x",
"{\n\t\t\t\t\t\t\tfor(int k=0; k < x-1; k++) {\n\t\t\t\t\t\t\t\tNum1 = arrayOutput[k][j];\n\t\t\t\t\t\t\t\tSum1 = Sum1 + Num1;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tarrayOutput[i][j] = Sum1;\n\t\t\t\t\t\t\tNum1 = 0;\n\t\t\t\t\t\t\tSum1 = 0;\n\t\t\t\t\t\t}",
"for(int k=0; k < x-1; k++) {\n\t\t\t\t\t\t\t\tNum1 = arrayOutput[k][j];\n\t\t\t\t\t\t\t\tSum1 = Sum1 + Num1;\n\t\t\t\t\t\t\t}",
"int k=0;",
"int k=0;",
"k",
"0",
"k < x-1",
"k",
"x-1",
"x",
"1",
"k++",
"k++",
"k",
"{\n\t\t\t\t\t\t\t\tNum1 = arrayOutput[k][j];\n\t\t\t\t\t\t\t\tSum1 = Sum1 + Num1;\n\t\t\t\t\t\t\t}",
"{\n\t\t\t\t\t\t\t\tNum1 = arrayOutput[k][j];\n\t\t\t\t\t\t\t\tSum1 = Sum1 + Num1;\n\t\t\t\t\t\t\t}",
"Num1 = arrayOutput[k][j]",
"Num1",
"arrayOutput[k][j]",
"arrayOutput[k]",
"arrayOutput",
"k",
"j",
"Sum1 = Sum1 + Num1",
"Sum1",
"Sum1 + Num1",
"Sum1",
"Num1",
"arrayOutput[i][j] = Sum1",
"arrayOutput[i][j]",
"arrayOutput[i]",
"arrayOutput",
"i",
"j",
"Sum1",
"Num1 = 0",
"Num1",
"0",
"Sum1 = 0",
"Sum1",
"0",
"for(int i = 0; i < x; i++) {\n\t\t\tfor(int j = 0; j < y; j++) {\n\n\t\t\t\tif(j+1 == y) {\n\t\t\t\t\tSystem.out.print(arrayOutput[i][j]);\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tSystem.out.print(arrayOutput[i][j]+\" \");\n\t\t\t\t}\n\n\t\t\t}\n\t\t\tSystem.out.println(\"\");\n\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < x",
"i",
"x",
"i++",
"i++",
"i",
"{\n\t\t\tfor(int j = 0; j < y; j++) {\n\n\t\t\t\tif(j+1 == y) {\n\t\t\t\t\tSystem.out.print(arrayOutput[i][j]);\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tSystem.out.print(arrayOutput[i][j]+\" \");\n\t\t\t\t}\n\n\t\t\t}\n\t\t\tSystem.out.println(\"\");\n\t\t}",
"{\n\t\t\tfor(int j = 0; j < y; j++) {\n\n\t\t\t\tif(j+1 == y) {\n\t\t\t\t\tSystem.out.print(arrayOutput[i][j]);\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tSystem.out.print(arrayOutput[i][j]+\" \");\n\t\t\t\t}\n\n\t\t\t}\n\t\t\tSystem.out.println(\"\");\n\t\t}",
"for(int j = 0; j < y; j++) {\n\n\t\t\t\tif(j+1 == y) {\n\t\t\t\t\tSystem.out.print(arrayOutput[i][j]);\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tSystem.out.print(arrayOutput[i][j]+\" \");\n\t\t\t\t}\n\n\t\t\t}",
"int j = 0;",
"int j = 0;",
"j",
"0",
"j < y",
"j",
"y",
"j++",
"j++",
"j",
"{\n\n\t\t\t\tif(j+1 == y) {\n\t\t\t\t\tSystem.out.print(arrayOutput[i][j]);\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tSystem.out.print(arrayOutput[i][j]+\" \");\n\t\t\t\t}\n\n\t\t\t}",
"{\n\n\t\t\t\tif(j+1 == y) {\n\t\t\t\t\tSystem.out.print(arrayOutput[i][j]);\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tSystem.out.print(arrayOutput[i][j]+\" \");\n\t\t\t\t}\n\n\t\t\t}",
"if(j+1 == y) {\n\t\t\t\t\tSystem.out.print(arrayOutput[i][j]);\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tSystem.out.print(arrayOutput[i][j]+\" \");\n\t\t\t\t}",
"j+1 == y",
"j+1",
"j",
"1",
"y",
"{\n\t\t\t\t\tSystem.out.print(arrayOutput[i][j]);\n\t\t\t\t}",
"System.out.print(arrayOutput[i][j])",
"System.out.print",
"System.out",
"System",
"System.out",
"arrayOutput[i][j]",
"arrayOutput[i]",
"arrayOutput",
"i",
"j",
"{\n\t\t\t\t\tSystem.out.print(arrayOutput[i][j]+\" \");\n\t\t\t\t}",
"System.out.print(arrayOutput[i][j]+\" \")",
"System.out.print",
"System.out",
"System",
"System.out",
"arrayOutput[i][j]+\" \"",
"arrayOutput[i][j]",
"arrayOutput[i]",
"arrayOutput",
"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\n\t\tScanner sc = new Scanner(System.in);\n\n\t\tint r = sc.nextInt();\n\t\tint c = sc.nextInt();\n\t\tint[][] arrayInput = new int[r][c];\n\n\t\tint x = r+1;\n\t\tint y = c+1;\n\n\t\tint[][] arrayOutput = new int[x][y];\n\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\tarrayInput[i][j] = sc.nextInt();\n\t\t\t}\n\t\t}\n\n\n\t\t//??????????¨?????±???????\n\t\tint Sum = 0;\n\t\tint Num = 0;\n\t\tfor(int i = 0; i < x; i++) {\n\t\t\tfor(int j = 0; j < y; j++) {\n\n\t\t\t\tif(!(i+1 == x) && !( j+1 == y )) {\n\t\t\t\t\tarrayOutput[i][j] = arrayInput[i][j];\n\t\t\t\t}\n\n\t\t\t\telse if(j+1 == y) {\n\t\t\t\t\tfor(int k=0; k < y-1; k++) {\n\t\t\t\t\t\tNum = arrayOutput[i][k];\n\t\t\t\t\t\tSum = Sum + Num;\n\t\t\t\t\t}\n\t\t\t\t\tarrayOutput[i][j] = Sum;\n\t\t\t\t\tNum = 0;\n\t\t\t\t\tSum = 0;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t//??????????¨?????±???????\n\t\t\t\tint Sum1 = 0;\n\t\t\t\tint Num1 = 0;\n\t\t\t\tfor(int j = 0; j < y; j++) {\n\t\t\t\t\tfor(int i = 0; i < x; i++) {\n\n\t\t\t\t\t\tif(i+1 == x) {\n\t\t\t\t\t\t\tfor(int k=0; k < x-1; k++) {\n\t\t\t\t\t\t\t\tNum1 = arrayOutput[k][j];\n\t\t\t\t\t\t\t\tSum1 = Sum1 + Num1;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tarrayOutput[i][j] = Sum1;\n\t\t\t\t\t\t\tNum1 = 0;\n\t\t\t\t\t\t\tSum1 = 0;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t//?????????????????????\n\t\tfor(int i = 0; i < x; i++) {\n\t\t\tfor(int j = 0; j < y; j++) {\n\n\t\t\t\tif(j+1 == y) {\n\t\t\t\t\tSystem.out.print(arrayOutput[i][j]);\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tSystem.out.print(arrayOutput[i][j]+\" \");\n\t\t\t\t}\n\n\t\t\t}\n\t\t\tSystem.out.println(\"\");\n\t\t}\n\n\n\t}\n}",
"public class Main{\n\tpublic static void main(String[] args) {\n\n\t\tScanner sc = new Scanner(System.in);\n\n\t\tint r = sc.nextInt();\n\t\tint c = sc.nextInt();\n\t\tint[][] arrayInput = new int[r][c];\n\n\t\tint x = r+1;\n\t\tint y = c+1;\n\n\t\tint[][] arrayOutput = new int[x][y];\n\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\tarrayInput[i][j] = sc.nextInt();\n\t\t\t}\n\t\t}\n\n\n\t\t//??????????¨?????±???????\n\t\tint Sum = 0;\n\t\tint Num = 0;\n\t\tfor(int i = 0; i < x; i++) {\n\t\t\tfor(int j = 0; j < y; j++) {\n\n\t\t\t\tif(!(i+1 == x) && !( j+1 == y )) {\n\t\t\t\t\tarrayOutput[i][j] = arrayInput[i][j];\n\t\t\t\t}\n\n\t\t\t\telse if(j+1 == y) {\n\t\t\t\t\tfor(int k=0; k < y-1; k++) {\n\t\t\t\t\t\tNum = arrayOutput[i][k];\n\t\t\t\t\t\tSum = Sum + Num;\n\t\t\t\t\t}\n\t\t\t\t\tarrayOutput[i][j] = Sum;\n\t\t\t\t\tNum = 0;\n\t\t\t\t\tSum = 0;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t//??????????¨?????±???????\n\t\t\t\tint Sum1 = 0;\n\t\t\t\tint Num1 = 0;\n\t\t\t\tfor(int j = 0; j < y; j++) {\n\t\t\t\t\tfor(int i = 0; i < x; i++) {\n\n\t\t\t\t\t\tif(i+1 == x) {\n\t\t\t\t\t\t\tfor(int k=0; k < x-1; k++) {\n\t\t\t\t\t\t\t\tNum1 = arrayOutput[k][j];\n\t\t\t\t\t\t\t\tSum1 = Sum1 + Num1;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tarrayOutput[i][j] = Sum1;\n\t\t\t\t\t\t\tNum1 = 0;\n\t\t\t\t\t\t\tSum1 = 0;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t//?????????????????????\n\t\tfor(int i = 0; i < x; i++) {\n\t\t\tfor(int j = 0; j < y; j++) {\n\n\t\t\t\tif(j+1 == y) {\n\t\t\t\t\tSystem.out.print(arrayOutput[i][j]);\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tSystem.out.print(arrayOutput[i][j]+\" \");\n\t\t\t\t}\n\n\t\t\t}\n\t\t\tSystem.out.println(\"\");\n\t\t}\n\n\n\t}\n}",
"Main"
] |
import java.util.Scanner;
public class Main{
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int r = sc.nextInt();
int c = sc.nextInt();
int[][] arrayInput = new int[r][c];
int x = r+1;
int y = c+1;
int[][] arrayOutput = new int[x][y];
//?????????????????\???????????????
for(int i = 0; i < r; i++) {
for(int j = 0; j < c; j++) {
arrayInput[i][j] = sc.nextInt();
}
}
//??????????¨?????±???????
int Sum = 0;
int Num = 0;
for(int i = 0; i < x; i++) {
for(int j = 0; j < y; j++) {
if(!(i+1 == x) && !( j+1 == y )) {
arrayOutput[i][j] = arrayInput[i][j];
}
else if(j+1 == y) {
for(int k=0; k < y-1; k++) {
Num = arrayOutput[i][k];
Sum = Sum + Num;
}
arrayOutput[i][j] = Sum;
Num = 0;
Sum = 0;
}
}
}
//??????????¨?????±???????
int Sum1 = 0;
int Num1 = 0;
for(int j = 0; j < y; j++) {
for(int i = 0; i < x; i++) {
if(i+1 == x) {
for(int k=0; k < x-1; k++) {
Num1 = arrayOutput[k][j];
Sum1 = Sum1 + Num1;
}
arrayOutput[i][j] = Sum1;
Num1 = 0;
Sum1 = 0;
}
}
}
//?????????????????????
for(int i = 0; i < x; i++) {
for(int j = 0; j < y; j++) {
if(j+1 == y) {
System.out.print(arrayOutput[i][j]);
}
else {
System.out.print(arrayOutput[i][j]+" ");
}
}
System.out.println("");
}
}
} |
[
7,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
20,
41,
13,
4,
18,
4,
18,
13,
17,
41,
13,
4,
18,
13,
18,
13,
17,
41,
13,
4,
18,
13,
18,
13,
17,
41,
13,
20,
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,
0,
18,
13,
13,
4,
18,
13,
18,
13,
13,
0,
18,
13,
13,
4,
18,
13,
18,
13,
13,
0,
13,
4,
18,
13,
18,
13,
13,
11,
1,
41,
13,
17,
2,
13,
2,
13,
17,
1,
40,
13,
30,
30,
11,
1,
41,
13,
17,
2,
13,
2,
13,
17,
1,
40,
13,
30,
30,
14,
2,
2,
13,
13,
2,
13,
13,
4,
18,
18,
13,
13,
2,
18,
18,
13,
13,
13,
17,
14,
2,
2,
13,
13,
2,
13,
13,
4,
18,
18,
13,
13,
18,
13,
13,
14,
2,
2,
13,
13,
2,
13,
13,
4,
18,
18,
13,
13,
2,
18,
13,
13,
17,
14,
2,
2,
13,
13,
2,
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
],
[
233,
8
],
[
233,
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
],
[
22,
23
],
[
23,
24
],
[
20,
25
],
[
11,
26
],
[
26,
27
],
[
26,
28
],
[
28,
29
],
[
29,
30
],
[
28,
31
],
[
31,
32
],
[
31,
33
],
[
11,
34
],
[
34,
35
],
[
34,
36
],
[
36,
37
],
[
37,
38
],
[
36,
39
],
[
39,
40
],
[
39,
41
],
[
11,
42
],
[
42,
43
],
[
42,
44
],
[
11,
47
],
[
47,
48
],
[
47,
49
],
[
11,
51
],
[
51,
52
],
[
51,
53
],
[
11,
55
],
[
55,
56
],
[
55,
57
],
[
11,
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
],
[
91,
104
],
[
104,
105
],
[
105,
106
],
[
105,
107
],
[
104,
108
],
[
108,
109
],
[
109,
110
],
[
108,
111
],
[
111,
112
],
[
111,
113
],
[
91,
114
],
[
114,
115
],
[
115,
116
],
[
115,
117
],
[
114,
118
],
[
118,
119
],
[
119,
120
],
[
118,
121
],
[
121,
122
],
[
121,
123
],
[
91,
124
],
[
124,
125
],
[
124,
126
],
[
126,
127
],
[
127,
128
],
[
126,
129
],
[
129,
130
],
[
129,
131
],
[
11,
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
],
[
154,
156
],
[
147,
157
],
[
157,
158
],
[
158,
159
],
[
147,
160
],
[
161,
161
],
[
161,
162
],
[
162,
163
],
[
163,
164
],
[
164,
165
],
[
164,
166
],
[
163,
167
],
[
167,
168
],
[
167,
169
],
[
162,
170
],
[
170,
171
],
[
171,
172
],
[
172,
173
],
[
172,
174
],
[
170,
175
],
[
175,
176
],
[
176,
177
],
[
177,
178
],
[
177,
179
],
[
176,
180
],
[
175,
181
],
[
162,
182
],
[
182,
183
],
[
183,
184
],
[
184,
185
],
[
184,
186
],
[
183,
187
],
[
187,
188
],
[
187,
189
],
[
182,
190
],
[
190,
191
],
[
191,
192
],
[
192,
193
],
[
192,
194
],
[
190,
195
],
[
195,
196
],
[
195,
197
],
[
182,
198
],
[
198,
199
],
[
199,
200
],
[
200,
201
],
[
200,
202
],
[
199,
203
],
[
203,
204
],
[
203,
205
],
[
198,
206
],
[
206,
207
],
[
207,
208
],
[
208,
209
],
[
208,
210
],
[
206,
211
],
[
211,
212
],
[
212,
213
],
[
212,
214
],
[
211,
215
],
[
198,
216
],
[
216,
217
],
[
217,
218
],
[
218,
219
],
[
218,
220
],
[
217,
221
],
[
221,
222
],
[
221,
223
],
[
216,
224
],
[
224,
225
],
[
225,
226
],
[
226,
227
],
[
226,
228
],
[
224,
229
],
[
9,
230
],
[
230,
231
],
[
0,
232
],
[
232,
233
],
[
232,
234
]
] | [
"import java.io.BufferedReader;\nimport java.io.InputStreamReader;\n\npublic class Main {\n\tpublic static void main(String[] args)throws Exception{\n\t\tInputStreamReader isr = new InputStreamReader(System.in);\n BufferedReader br = new BufferedReader(isr);\n \n \tString[] n = br.readLine().split(\" \");\n int r = Integer.parseInt(n[0]);\n int c = Integer.parseInt(n[1]);\n int[][] rc = new int[r][c];\n int[] yoko = new int[r];\n int[] tate = new int[c];\n int sum = 0;\n for (int i = 0; i < r; i++)\n {\n \tString[] rcinput = br.readLine().split(\" \");\n \tfor (int j = 0; j < c; j++)\n \t{\n \t\trc[i][j] = Integer.parseInt(rcinput[j]);\n \t\tyoko[i] += Integer.parseInt(rcinput[j]);\n \t\ttate[j] += Integer.parseInt(rcinput[j]);\n \t\tsum += Integer.parseInt(rcinput[j]);\n \t}\n }\n \n for (int i = 0; i < r + 1; i++)\n {\n \tfor (int j = 0; j < c + 1; j++)\n \t{\n \t\tif (i < r && j <c)\n \t\t\tSystem.out.print(rc[i][j] + \" \");\n \t\telse if (j == c && i != r)\n \t\t\tSystem.out.println(yoko[i]);\n \t\telse if (i == r && j != c)\n \t\t\tSystem.out.print(tate[j] + \" \");\n \t\telse if (i == r && j == c)\n \t\t\tSystem.out.println(sum);\n \t}\n }\n\t}\n\n}",
"import java.io.BufferedReader;",
"BufferedReader",
"java.io",
"import java.io.InputStreamReader;",
"InputStreamReader",
"java.io",
"public class Main {\n\tpublic static void main(String[] args)throws Exception{\n\t\tInputStreamReader isr = new InputStreamReader(System.in);\n BufferedReader br = new BufferedReader(isr);\n \n \tString[] n = br.readLine().split(\" \");\n int r = Integer.parseInt(n[0]);\n int c = Integer.parseInt(n[1]);\n int[][] rc = new int[r][c];\n int[] yoko = new int[r];\n int[] tate = new int[c];\n int sum = 0;\n for (int i = 0; i < r; i++)\n {\n \tString[] rcinput = br.readLine().split(\" \");\n \tfor (int j = 0; j < c; j++)\n \t{\n \t\trc[i][j] = Integer.parseInt(rcinput[j]);\n \t\tyoko[i] += Integer.parseInt(rcinput[j]);\n \t\ttate[j] += Integer.parseInt(rcinput[j]);\n \t\tsum += Integer.parseInt(rcinput[j]);\n \t}\n }\n \n for (int i = 0; i < r + 1; i++)\n {\n \tfor (int j = 0; j < c + 1; j++)\n \t{\n \t\tif (i < r && j <c)\n \t\t\tSystem.out.print(rc[i][j] + \" \");\n \t\telse if (j == c && i != r)\n \t\t\tSystem.out.println(yoko[i]);\n \t\telse if (i == r && j != c)\n \t\t\tSystem.out.print(tate[j] + \" \");\n \t\telse if (i == r && j == c)\n \t\t\tSystem.out.println(sum);\n \t}\n }\n\t}\n\n}",
"Main",
"public static void main(String[] args)throws Exception{\n\t\tInputStreamReader isr = new InputStreamReader(System.in);\n BufferedReader br = new BufferedReader(isr);\n \n \tString[] n = br.readLine().split(\" \");\n int r = Integer.parseInt(n[0]);\n int c = Integer.parseInt(n[1]);\n int[][] rc = new int[r][c];\n int[] yoko = new int[r];\n int[] tate = new int[c];\n int sum = 0;\n for (int i = 0; i < r; i++)\n {\n \tString[] rcinput = br.readLine().split(\" \");\n \tfor (int j = 0; j < c; j++)\n \t{\n \t\trc[i][j] = Integer.parseInt(rcinput[j]);\n \t\tyoko[i] += Integer.parseInt(rcinput[j]);\n \t\ttate[j] += Integer.parseInt(rcinput[j]);\n \t\tsum += Integer.parseInt(rcinput[j]);\n \t}\n }\n \n for (int i = 0; i < r + 1; i++)\n {\n \tfor (int j = 0; j < c + 1; j++)\n \t{\n \t\tif (i < r && j <c)\n \t\t\tSystem.out.print(rc[i][j] + \" \");\n \t\telse if (j == c && i != r)\n \t\t\tSystem.out.println(yoko[i]);\n \t\telse if (i == r && j != c)\n \t\t\tSystem.out.print(tate[j] + \" \");\n \t\telse if (i == r && j == c)\n \t\t\tSystem.out.println(sum);\n \t}\n }\n\t}",
"main",
"{\n\t\tInputStreamReader isr = new InputStreamReader(System.in);\n BufferedReader br = new BufferedReader(isr);\n \n \tString[] n = br.readLine().split(\" \");\n int r = Integer.parseInt(n[0]);\n int c = Integer.parseInt(n[1]);\n int[][] rc = new int[r][c];\n int[] yoko = new int[r];\n int[] tate = new int[c];\n int sum = 0;\n for (int i = 0; i < r; i++)\n {\n \tString[] rcinput = br.readLine().split(\" \");\n \tfor (int j = 0; j < c; j++)\n \t{\n \t\trc[i][j] = Integer.parseInt(rcinput[j]);\n \t\tyoko[i] += Integer.parseInt(rcinput[j]);\n \t\ttate[j] += Integer.parseInt(rcinput[j]);\n \t\tsum += Integer.parseInt(rcinput[j]);\n \t}\n }\n \n for (int i = 0; i < r + 1; i++)\n {\n \tfor (int j = 0; j < c + 1; j++)\n \t{\n \t\tif (i < r && j <c)\n \t\t\tSystem.out.print(rc[i][j] + \" \");\n \t\telse if (j == c && i != r)\n \t\t\tSystem.out.println(yoko[i]);\n \t\telse if (i == r && j != c)\n \t\t\tSystem.out.print(tate[j] + \" \");\n \t\telse if (i == r && j == c)\n \t\t\tSystem.out.println(sum);\n \t}\n }\n\t}",
"InputStreamReader isr = new InputStreamReader(System.in);",
"isr",
"new InputStreamReader(System.in)",
"BufferedReader br = new BufferedReader(isr);",
"br",
"new BufferedReader(isr)",
"String[] n = br.readLine().split(\" \");",
"n",
"br.readLine().split(\" \")",
"br.readLine().split",
"br.readLine()",
"br.readLine",
"br",
"\" \"",
"int r = Integer.parseInt(n[0]);",
"r",
"Integer.parseInt(n[0])",
"Integer.parseInt",
"Integer",
"n[0]",
"n",
"0",
"int c = Integer.parseInt(n[1]);",
"c",
"Integer.parseInt(n[1])",
"Integer.parseInt",
"Integer",
"n[1]",
"n",
"1",
"int[][] rc = new int[r][c];",
"rc",
"new int[r][c]",
"r",
"c",
"int[] yoko = new int[r];",
"yoko",
"new int[r]",
"r",
"int[] tate = new int[c];",
"tate",
"new int[c]",
"c",
"int sum = 0;",
"sum",
"0",
"for (int i = 0; i < r; i++)\n {\n \tString[] rcinput = br.readLine().split(\" \");\n \tfor (int j = 0; j < c; j++)\n \t{\n \t\trc[i][j] = Integer.parseInt(rcinput[j]);\n \t\tyoko[i] += Integer.parseInt(rcinput[j]);\n \t\ttate[j] += Integer.parseInt(rcinput[j]);\n \t\tsum += Integer.parseInt(rcinput[j]);\n \t}\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < r",
"i",
"r",
"i++",
"i++",
"i",
"{\n \tString[] rcinput = br.readLine().split(\" \");\n \tfor (int j = 0; j < c; j++)\n \t{\n \t\trc[i][j] = Integer.parseInt(rcinput[j]);\n \t\tyoko[i] += Integer.parseInt(rcinput[j]);\n \t\ttate[j] += Integer.parseInt(rcinput[j]);\n \t\tsum += Integer.parseInt(rcinput[j]);\n \t}\n }",
"{\n \tString[] rcinput = br.readLine().split(\" \");\n \tfor (int j = 0; j < c; j++)\n \t{\n \t\trc[i][j] = Integer.parseInt(rcinput[j]);\n \t\tyoko[i] += Integer.parseInt(rcinput[j]);\n \t\ttate[j] += Integer.parseInt(rcinput[j]);\n \t\tsum += Integer.parseInt(rcinput[j]);\n \t}\n }",
"String[] rcinput = br.readLine().split(\" \");",
"rcinput",
"br.readLine().split(\" \")",
"br.readLine().split",
"br.readLine()",
"br.readLine",
"br",
"\" \"",
"for (int j = 0; j < c; j++)\n \t{\n \t\trc[i][j] = Integer.parseInt(rcinput[j]);\n \t\tyoko[i] += Integer.parseInt(rcinput[j]);\n \t\ttate[j] += Integer.parseInt(rcinput[j]);\n \t\tsum += Integer.parseInt(rcinput[j]);\n \t}",
"int j = 0;",
"int j = 0;",
"j",
"0",
"j < c",
"j",
"c",
"j++",
"j++",
"j",
"{\n \t\trc[i][j] = Integer.parseInt(rcinput[j]);\n \t\tyoko[i] += Integer.parseInt(rcinput[j]);\n \t\ttate[j] += Integer.parseInt(rcinput[j]);\n \t\tsum += Integer.parseInt(rcinput[j]);\n \t}",
"{\n \t\trc[i][j] = Integer.parseInt(rcinput[j]);\n \t\tyoko[i] += Integer.parseInt(rcinput[j]);\n \t\ttate[j] += Integer.parseInt(rcinput[j]);\n \t\tsum += Integer.parseInt(rcinput[j]);\n \t}",
"rc[i][j] = Integer.parseInt(rcinput[j])",
"rc[i][j]",
"rc[i]",
"rc",
"i",
"j",
"Integer.parseInt(rcinput[j])",
"Integer.parseInt",
"Integer",
"rcinput[j]",
"rcinput",
"j",
"yoko[i] += Integer.parseInt(rcinput[j])",
"yoko[i]",
"yoko",
"i",
"Integer.parseInt(rcinput[j])",
"Integer.parseInt",
"Integer",
"rcinput[j]",
"rcinput",
"j",
"tate[j] += Integer.parseInt(rcinput[j])",
"tate[j]",
"tate",
"j",
"Integer.parseInt(rcinput[j])",
"Integer.parseInt",
"Integer",
"rcinput[j]",
"rcinput",
"j",
"sum += Integer.parseInt(rcinput[j])",
"sum",
"Integer.parseInt(rcinput[j])",
"Integer.parseInt",
"Integer",
"rcinput[j]",
"rcinput",
"j",
"for (int i = 0; i < r + 1; i++)\n {\n \tfor (int j = 0; j < c + 1; j++)\n \t{\n \t\tif (i < r && j <c)\n \t\t\tSystem.out.print(rc[i][j] + \" \");\n \t\telse if (j == c && i != r)\n \t\t\tSystem.out.println(yoko[i]);\n \t\telse if (i == r && j != c)\n \t\t\tSystem.out.print(tate[j] + \" \");\n \t\telse if (i == r && j == c)\n \t\t\tSystem.out.println(sum);\n \t}\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{\n \t\tif (i < r && j <c)\n \t\t\tSystem.out.print(rc[i][j] + \" \");\n \t\telse if (j == c && i != r)\n \t\t\tSystem.out.println(yoko[i]);\n \t\telse if (i == r && j != c)\n \t\t\tSystem.out.print(tate[j] + \" \");\n \t\telse if (i == r && j == c)\n \t\t\tSystem.out.println(sum);\n \t}\n }",
"{\n \tfor (int j = 0; j < c + 1; j++)\n \t{\n \t\tif (i < r && j <c)\n \t\t\tSystem.out.print(rc[i][j] + \" \");\n \t\telse if (j == c && i != r)\n \t\t\tSystem.out.println(yoko[i]);\n \t\telse if (i == r && j != c)\n \t\t\tSystem.out.print(tate[j] + \" \");\n \t\telse if (i == r && j == c)\n \t\t\tSystem.out.println(sum);\n \t}\n }",
"for (int j = 0; j < c + 1; j++)\n \t{\n \t\tif (i < r && j <c)\n \t\t\tSystem.out.print(rc[i][j] + \" \");\n \t\telse if (j == c && i != r)\n \t\t\tSystem.out.println(yoko[i]);\n \t\telse if (i == r && j != c)\n \t\t\tSystem.out.print(tate[j] + \" \");\n \t\telse if (i == r && j == c)\n \t\t\tSystem.out.println(sum);\n \t}",
"int j = 0;",
"int j = 0;",
"j",
"0",
"j < c + 1",
"j",
"c + 1",
"c",
"1",
"j++",
"j++",
"j",
"{\n \t\tif (i < r && j <c)\n \t\t\tSystem.out.print(rc[i][j] + \" \");\n \t\telse if (j == c && i != r)\n \t\t\tSystem.out.println(yoko[i]);\n \t\telse if (i == r && j != c)\n \t\t\tSystem.out.print(tate[j] + \" \");\n \t\telse if (i == r && j == c)\n \t\t\tSystem.out.println(sum);\n \t}",
"{\n \t\tif (i < r && j <c)\n \t\t\tSystem.out.print(rc[i][j] + \" \");\n \t\telse if (j == c && i != r)\n \t\t\tSystem.out.println(yoko[i]);\n \t\telse if (i == r && j != c)\n \t\t\tSystem.out.print(tate[j] + \" \");\n \t\telse if (i == r && j == c)\n \t\t\tSystem.out.println(sum);\n \t}",
"if (i < r && j <c)\n \t\t\tSystem.out.print(rc[i][j] + \" \");\n \t\telse if (j == c && i != r)\n \t\t\tSystem.out.println(yoko[i]);\n \t\telse if (i == r && j != c)\n \t\t\tSystem.out.print(tate[j] + \" \");\n \t\telse if (i == r && j == c)\n \t\t\tSystem.out.println(sum);",
"i < r && j <c",
"i < r",
"i",
"r",
"j <c",
"j",
"c",
"System.out.print(rc[i][j] + \" \")",
"System.out.print",
"System.out",
"System",
"System.out",
"rc[i][j] + \" \"",
"rc[i][j]",
"rc[i]",
"rc",
"i",
"j",
"\" \"",
"if (j == c && i != r)\n \t\t\tSystem.out.println(yoko[i]);\n \t\telse if (i == r && j != c)\n \t\t\tSystem.out.print(tate[j] + \" \");\n \t\telse if (i == r && j == c)\n \t\t\tSystem.out.println(sum);",
"j == c && i != r",
"j == c",
"j",
"c",
"i != r",
"i",
"r",
"System.out.println(yoko[i])",
"System.out.println",
"System.out",
"System",
"System.out",
"yoko[i]",
"yoko",
"i",
"if (i == r && j != c)\n \t\t\tSystem.out.print(tate[j] + \" \");\n \t\telse if (i == r && j == c)\n \t\t\tSystem.out.println(sum);",
"i == r && j != c",
"i == r",
"i",
"r",
"j != c",
"j",
"c",
"System.out.print(tate[j] + \" \")",
"System.out.print",
"System.out",
"System",
"System.out",
"tate[j] + \" \"",
"tate[j]",
"tate",
"j",
"\" \"",
"if (i == r && j == c)\n \t\t\tSystem.out.println(sum);",
"i == r && j == c",
"i == r",
"i",
"r",
"j == c",
"j",
"c",
"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)throws Exception{\n\t\tInputStreamReader isr = new InputStreamReader(System.in);\n BufferedReader br = new BufferedReader(isr);\n \n \tString[] n = br.readLine().split(\" \");\n int r = Integer.parseInt(n[0]);\n int c = Integer.parseInt(n[1]);\n int[][] rc = new int[r][c];\n int[] yoko = new int[r];\n int[] tate = new int[c];\n int sum = 0;\n for (int i = 0; i < r; i++)\n {\n \tString[] rcinput = br.readLine().split(\" \");\n \tfor (int j = 0; j < c; j++)\n \t{\n \t\trc[i][j] = Integer.parseInt(rcinput[j]);\n \t\tyoko[i] += Integer.parseInt(rcinput[j]);\n \t\ttate[j] += Integer.parseInt(rcinput[j]);\n \t\tsum += Integer.parseInt(rcinput[j]);\n \t}\n }\n \n for (int i = 0; i < r + 1; i++)\n {\n \tfor (int j = 0; j < c + 1; j++)\n \t{\n \t\tif (i < r && j <c)\n \t\t\tSystem.out.print(rc[i][j] + \" \");\n \t\telse if (j == c && i != r)\n \t\t\tSystem.out.println(yoko[i]);\n \t\telse if (i == r && j != c)\n \t\t\tSystem.out.print(tate[j] + \" \");\n \t\telse if (i == r && j == c)\n \t\t\tSystem.out.println(sum);\n \t}\n }\n\t}\n\n}",
"public class Main {\n\tpublic static void main(String[] args)throws Exception{\n\t\tInputStreamReader isr = new InputStreamReader(System.in);\n BufferedReader br = new BufferedReader(isr);\n \n \tString[] n = br.readLine().split(\" \");\n int r = Integer.parseInt(n[0]);\n int c = Integer.parseInt(n[1]);\n int[][] rc = new int[r][c];\n int[] yoko = new int[r];\n int[] tate = new int[c];\n int sum = 0;\n for (int i = 0; i < r; i++)\n {\n \tString[] rcinput = br.readLine().split(\" \");\n \tfor (int j = 0; j < c; j++)\n \t{\n \t\trc[i][j] = Integer.parseInt(rcinput[j]);\n \t\tyoko[i] += Integer.parseInt(rcinput[j]);\n \t\ttate[j] += Integer.parseInt(rcinput[j]);\n \t\tsum += Integer.parseInt(rcinput[j]);\n \t}\n }\n \n for (int i = 0; i < r + 1; i++)\n {\n \tfor (int j = 0; j < c + 1; j++)\n \t{\n \t\tif (i < r && j <c)\n \t\t\tSystem.out.print(rc[i][j] + \" \");\n \t\telse if (j == c && i != r)\n \t\t\tSystem.out.println(yoko[i]);\n \t\telse if (i == r && j != c)\n \t\t\tSystem.out.print(tate[j] + \" \");\n \t\telse if (i == r && j == c)\n \t\t\tSystem.out.println(sum);\n \t}\n }\n\t}\n\n}",
"Main"
] | import java.io.BufferedReader;
import java.io.InputStreamReader;
public class Main {
public static void main(String[] args)throws Exception{
InputStreamReader isr = new InputStreamReader(System.in);
BufferedReader br = new BufferedReader(isr);
String[] n = br.readLine().split(" ");
int r = Integer.parseInt(n[0]);
int c = Integer.parseInt(n[1]);
int[][] rc = new int[r][c];
int[] yoko = new int[r];
int[] tate = new int[c];
int sum = 0;
for (int i = 0; i < r; i++)
{
String[] rcinput = br.readLine().split(" ");
for (int j = 0; j < c; j++)
{
rc[i][j] = Integer.parseInt(rcinput[j]);
yoko[i] += Integer.parseInt(rcinput[j]);
tate[j] += Integer.parseInt(rcinput[j]);
sum += Integer.parseInt(rcinput[j]);
}
}
for (int i = 0; i < r + 1; i++)
{
for (int j = 0; j < c + 1; j++)
{
if (i < r && j <c)
System.out.print(rc[i][j] + " ");
else if (j == c && i != r)
System.out.println(yoko[i]);
else if (i == r && j != c)
System.out.print(tate[j] + " ");
else if (i == r && j == c)
System.out.println(sum);
}
}
}
} |
[
7,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
41,
13,
20,
2,
13,
17,
2,
13,
17,
41,
13,
41,
13,
20,
2,
13,
17,
4,
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,
2,
13,
17,
1,
40,
13,
30,
30,
14,
2,
13,
13,
30,
0,
18,
18,
13,
13,
13,
4,
18,
13,
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,
2,
13,
17,
1,
40,
13,
30,
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,
18,
18,
13,
13,
13,
14,
2,
13,
13,
30,
4,
18,
18,
13,
13,
17,
4,
18,
18,
13,
13,
4,
18,
13,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
206,
8
],
[
206,
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
],
[
11,
36
],
[
36,
37
],
[
36,
38
],
[
39,
40
],
[
39,
41
],
[
11,
42
],
[
42,
43
],
[
43,
44
],
[
42,
45
],
[
42,
46
],
[
11,
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
],
[
59,
63
],
[
63,
64
],
[
64,
65
],
[
65,
66
],
[
65,
67
],
[
63,
68
],
[
68,
69
],
[
68,
70
],
[
70,
71
],
[
70,
72
],
[
63,
73
],
[
73,
74
],
[
74,
75
],
[
63,
76
],
[
77,
77
],
[
77,
78
],
[
78,
79
],
[
79,
80
],
[
79,
81
],
[
78,
82
],
[
82,
83
],
[
83,
84
],
[
84,
85
],
[
85,
86
],
[
85,
87
],
[
84,
88
],
[
83,
89
],
[
89,
90
],
[
90,
91
],
[
82,
92
],
[
92,
93
],
[
92,
94
],
[
94,
95
],
[
95,
96
],
[
95,
97
],
[
94,
98
],
[
78,
99
],
[
99,
100
],
[
100,
101
],
[
100,
102
],
[
99,
103
],
[
103,
104
],
[
104,
105
],
[
105,
106
],
[
106,
107
],
[
106,
108
],
[
105,
109
],
[
104,
110
],
[
77,
111
],
[
111,
112
],
[
112,
113
],
[
112,
114
],
[
111,
115
],
[
115,
116
],
[
116,
117
],
[
116,
118
],
[
115,
119
],
[
11,
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
],
[
133,
134
],
[
134,
135
],
[
135,
136
],
[
136,
137
],
[
137,
138
],
[
137,
139
],
[
136,
140
],
[
135,
141
],
[
141,
142
],
[
141,
143
],
[
11,
144
],
[
144,
145
],
[
145,
146
],
[
146,
147
],
[
146,
148
],
[
144,
149
],
[
149,
150
],
[
149,
151
],
[
151,
152
],
[
151,
153
],
[
144,
154
],
[
154,
155
],
[
155,
156
],
[
144,
157
],
[
158,
158
],
[
158,
159
],
[
159,
160
],
[
160,
161
],
[
161,
162
],
[
161,
163
],
[
159,
164
],
[
164,
165
],
[
164,
166
],
[
166,
167
],
[
166,
168
],
[
159,
169
],
[
169,
170
],
[
170,
171
],
[
159,
172
],
[
173,
173
],
[
173,
174
],
[
174,
175
],
[
175,
176
],
[
176,
177
],
[
176,
178
],
[
174,
179
],
[
179,
180
],
[
180,
181
],
[
180,
182
],
[
179,
183
],
[
173,
184
],
[
184,
185
],
[
185,
186
],
[
185,
187
],
[
184,
188
],
[
188,
189
],
[
189,
190
],
[
190,
191
],
[
191,
192
],
[
191,
193
],
[
189,
194
],
[
158,
195
],
[
195,
196
],
[
196,
197
],
[
197,
198
],
[
197,
199
],
[
11,
200
],
[
200,
201
],
[
201,
202
],
[
9,
203
],
[
203,
204
],
[
0,
205
],
[
205,
206
],
[
205,
207
]
] | [
"import java.util.Arrays;\nimport java.util.Scanner;\n\n\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[][] matrix_rc=new int[r+1][c+1];\n\t\tint sum_r;\n\t\tint[] sum_c=new int[c+1];\n\t\tArrays.fill(sum_c, 0);\n\t\tfor(int i=0;i<r;i++){\n\t\t\tsum_r=0;//??????????????§?????????\n\t\t\tfor(int j=0;j<c+1;j++){\n\t\t\t\tif(j!=c){\n\t\t\t\tmatrix_rc[i][j]=scan.nextInt();\n\t\t\t\tsum_r+=matrix_rc[i][j];}\n\t\t\t\telse if(j==c){\n\t\t\t\t\tmatrix_rc[i][j]=sum_r;\n\t\t\t\t}//c+1????????§??????????????????\n\t\t\t\tsum_c[j]+=matrix_rc[i][j];//j????????????????¶???????????????????????????£??\\\n\t\t\t}\n\t\t}\n\t\tfor(int j=0;j<c+1;j++){\n\t\t\tmatrix_rc[r][j]=sum_c[j];\n\t\t}//r+1?????????????????£??\\\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(matrix_rc[i][j]);\n\t\t\t\tif(j<c){System.out.print(\" \");}\n\t\t\t}System.out.println();\n\t\t}\n\t\tscan.close();\n}\n\n\n}",
"import java.util.Arrays;",
"Arrays",
"java.util",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main{\n\tpublic static void main(String[] args){\n\t\tScanner scan=new Scanner(System.in);\n\t\tint r=scan.nextInt();\n\t\tint c=scan.nextInt();\n\t\tint[][] matrix_rc=new int[r+1][c+1];\n\t\tint sum_r;\n\t\tint[] sum_c=new int[c+1];\n\t\tArrays.fill(sum_c, 0);\n\t\tfor(int i=0;i<r;i++){\n\t\t\tsum_r=0;//??????????????§?????????\n\t\t\tfor(int j=0;j<c+1;j++){\n\t\t\t\tif(j!=c){\n\t\t\t\tmatrix_rc[i][j]=scan.nextInt();\n\t\t\t\tsum_r+=matrix_rc[i][j];}\n\t\t\t\telse if(j==c){\n\t\t\t\t\tmatrix_rc[i][j]=sum_r;\n\t\t\t\t}//c+1????????§??????????????????\n\t\t\t\tsum_c[j]+=matrix_rc[i][j];//j????????????????¶???????????????????????????£??\\\n\t\t\t}\n\t\t}\n\t\tfor(int j=0;j<c+1;j++){\n\t\t\tmatrix_rc[r][j]=sum_c[j];\n\t\t}//r+1?????????????????£??\\\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(matrix_rc[i][j]);\n\t\t\t\tif(j<c){System.out.print(\" \");}\n\t\t\t}System.out.println();\n\t\t}\n\t\tscan.close();\n}\n\n\n}",
"Main",
"public static void main(String[] args){\n\t\tScanner scan=new Scanner(System.in);\n\t\tint r=scan.nextInt();\n\t\tint c=scan.nextInt();\n\t\tint[][] matrix_rc=new int[r+1][c+1];\n\t\tint sum_r;\n\t\tint[] sum_c=new int[c+1];\n\t\tArrays.fill(sum_c, 0);\n\t\tfor(int i=0;i<r;i++){\n\t\t\tsum_r=0;//??????????????§?????????\n\t\t\tfor(int j=0;j<c+1;j++){\n\t\t\t\tif(j!=c){\n\t\t\t\tmatrix_rc[i][j]=scan.nextInt();\n\t\t\t\tsum_r+=matrix_rc[i][j];}\n\t\t\t\telse if(j==c){\n\t\t\t\t\tmatrix_rc[i][j]=sum_r;\n\t\t\t\t}//c+1????????§??????????????????\n\t\t\t\tsum_c[j]+=matrix_rc[i][j];//j????????????????¶???????????????????????????£??\\\n\t\t\t}\n\t\t}\n\t\tfor(int j=0;j<c+1;j++){\n\t\t\tmatrix_rc[r][j]=sum_c[j];\n\t\t}//r+1?????????????????£??\\\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(matrix_rc[i][j]);\n\t\t\t\tif(j<c){System.out.print(\" \");}\n\t\t\t}System.out.println();\n\t\t}\n\t\tscan.close();\n}",
"main",
"{\n\t\tScanner scan=new Scanner(System.in);\n\t\tint r=scan.nextInt();\n\t\tint c=scan.nextInt();\n\t\tint[][] matrix_rc=new int[r+1][c+1];\n\t\tint sum_r;\n\t\tint[] sum_c=new int[c+1];\n\t\tArrays.fill(sum_c, 0);\n\t\tfor(int i=0;i<r;i++){\n\t\t\tsum_r=0;//??????????????§?????????\n\t\t\tfor(int j=0;j<c+1;j++){\n\t\t\t\tif(j!=c){\n\t\t\t\tmatrix_rc[i][j]=scan.nextInt();\n\t\t\t\tsum_r+=matrix_rc[i][j];}\n\t\t\t\telse if(j==c){\n\t\t\t\t\tmatrix_rc[i][j]=sum_r;\n\t\t\t\t}//c+1????????§??????????????????\n\t\t\t\tsum_c[j]+=matrix_rc[i][j];//j????????????????¶???????????????????????????£??\\\n\t\t\t}\n\t\t}\n\t\tfor(int j=0;j<c+1;j++){\n\t\t\tmatrix_rc[r][j]=sum_c[j];\n\t\t}//r+1?????????????????£??\\\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(matrix_rc[i][j]);\n\t\t\t\tif(j<c){System.out.print(\" \");}\n\t\t\t}System.out.println();\n\t\t}\n\t\tscan.close();\n}",
"Scanner scan=new Scanner(System.in);",
"scan",
"new Scanner(System.in)",
"int r=scan.nextInt();",
"r",
"scan.nextInt()",
"scan.nextInt",
"scan",
"int c=scan.nextInt();",
"c",
"scan.nextInt()",
"scan.nextInt",
"scan",
"int[][] matrix_rc=new int[r+1][c+1];",
"matrix_rc",
"new int[r+1][c+1]",
"r+1",
"r",
"1",
"c+1",
"c",
"1",
"int sum_r;",
"sum_r",
"int[] sum_c=new int[c+1];",
"sum_c",
"new int[c+1]",
"c+1",
"c",
"1",
"Arrays.fill(sum_c, 0)",
"Arrays.fill",
"Arrays",
"sum_c",
"0",
"for(int i=0;i<r;i++){\n\t\t\tsum_r=0;//??????????????§?????????\n\t\t\tfor(int j=0;j<c+1;j++){\n\t\t\t\tif(j!=c){\n\t\t\t\tmatrix_rc[i][j]=scan.nextInt();\n\t\t\t\tsum_r+=matrix_rc[i][j];}\n\t\t\t\telse if(j==c){\n\t\t\t\t\tmatrix_rc[i][j]=sum_r;\n\t\t\t\t}//c+1????????§??????????????????\n\t\t\t\tsum_c[j]+=matrix_rc[i][j];//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\tsum_r=0;//??????????????§?????????\n\t\t\tfor(int j=0;j<c+1;j++){\n\t\t\t\tif(j!=c){\n\t\t\t\tmatrix_rc[i][j]=scan.nextInt();\n\t\t\t\tsum_r+=matrix_rc[i][j];}\n\t\t\t\telse if(j==c){\n\t\t\t\t\tmatrix_rc[i][j]=sum_r;\n\t\t\t\t}//c+1????????§??????????????????\n\t\t\t\tsum_c[j]+=matrix_rc[i][j];//j????????????????¶???????????????????????????£??\\\n\t\t\t}\n\t\t}",
"{\n\t\t\tsum_r=0;//??????????????§?????????\n\t\t\tfor(int j=0;j<c+1;j++){\n\t\t\t\tif(j!=c){\n\t\t\t\tmatrix_rc[i][j]=scan.nextInt();\n\t\t\t\tsum_r+=matrix_rc[i][j];}\n\t\t\t\telse if(j==c){\n\t\t\t\t\tmatrix_rc[i][j]=sum_r;\n\t\t\t\t}//c+1????????§??????????????????\n\t\t\t\tsum_c[j]+=matrix_rc[i][j];//j????????????????¶???????????????????????????£??\\\n\t\t\t}\n\t\t}",
"sum_r=0",
"sum_r",
"0",
"for(int j=0;j<c+1;j++){\n\t\t\t\tif(j!=c){\n\t\t\t\tmatrix_rc[i][j]=scan.nextInt();\n\t\t\t\tsum_r+=matrix_rc[i][j];}\n\t\t\t\telse if(j==c){\n\t\t\t\t\tmatrix_rc[i][j]=sum_r;\n\t\t\t\t}//c+1????????§??????????????????\n\t\t\t\tsum_c[j]+=matrix_rc[i][j];//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!=c){\n\t\t\t\tmatrix_rc[i][j]=scan.nextInt();\n\t\t\t\tsum_r+=matrix_rc[i][j];}\n\t\t\t\telse if(j==c){\n\t\t\t\t\tmatrix_rc[i][j]=sum_r;\n\t\t\t\t}//c+1????????§??????????????????\n\t\t\t\tsum_c[j]+=matrix_rc[i][j];//j????????????????¶???????????????????????????£??\\\n\t\t\t}",
"{\n\t\t\t\tif(j!=c){\n\t\t\t\tmatrix_rc[i][j]=scan.nextInt();\n\t\t\t\tsum_r+=matrix_rc[i][j];}\n\t\t\t\telse if(j==c){\n\t\t\t\t\tmatrix_rc[i][j]=sum_r;\n\t\t\t\t}//c+1????????§??????????????????\n\t\t\t\tsum_c[j]+=matrix_rc[i][j];//j????????????????¶???????????????????????????£??\\\n\t\t\t}",
"if(j!=c){\n\t\t\t\tmatrix_rc[i][j]=scan.nextInt();\n\t\t\t\tsum_r+=matrix_rc[i][j];}\n\t\t\t\telse if(j==c){\n\t\t\t\t\tmatrix_rc[i][j]=sum_r;\n\t\t\t\t}//c+1????????§??????????????????",
"j!=c",
"j",
"c",
"{\n\t\t\t\tmatrix_rc[i][j]=scan.nextInt();\n\t\t\t\tsum_r+=matrix_rc[i][j];}",
"matrix_rc[i][j]=scan.nextInt()",
"matrix_rc[i][j]",
"matrix_rc[i]",
"matrix_rc",
"i",
"j",
"scan.nextInt()",
"scan.nextInt",
"scan",
"sum_r+=matrix_rc[i][j]",
"sum_r",
"matrix_rc[i][j]",
"matrix_rc[i]",
"matrix_rc",
"i",
"j",
"if(j==c){\n\t\t\t\t\tmatrix_rc[i][j]=sum_r;\n\t\t\t\t}//c+1????????§??????????????????",
"j==c",
"j",
"c",
"{\n\t\t\t\t\tmatrix_rc[i][j]=sum_r;\n\t\t\t\t}",
"matrix_rc[i][j]=sum_r",
"matrix_rc[i][j]",
"matrix_rc[i]",
"matrix_rc",
"i",
"j",
"sum_r",
"sum_c[j]+=matrix_rc[i][j]",
"sum_c[j]",
"sum_c",
"j",
"matrix_rc[i][j]",
"matrix_rc[i]",
"matrix_rc",
"i",
"j",
"for(int j=0;j<c+1;j++){\n\t\t\tmatrix_rc[r][j]=sum_c[j];\n\t\t}//r+1?????????????????£??\\",
"int j=0;",
"int j=0;",
"j",
"0",
"j<c+1",
"j",
"c+1",
"c",
"1",
"j++",
"j++",
"j",
"{\n\t\t\tmatrix_rc[r][j]=sum_c[j];\n\t\t}//r+1?????????????????£??\\",
"{\n\t\t\tmatrix_rc[r][j]=sum_c[j];\n\t\t}",
"matrix_rc[r][j]=sum_c[j]",
"matrix_rc[r][j]",
"matrix_rc[r]",
"matrix_rc",
"r",
"j",
"sum_c[j]",
"sum_c",
"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(matrix_rc[i][j]);\n\t\t\t\tif(j<c){System.out.print(\" \");}\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\tSystem.out.print(matrix_rc[i][j]);\n\t\t\t\tif(j<c){System.out.print(\" \");}\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\tSystem.out.print(matrix_rc[i][j]);\n\t\t\t\tif(j<c){System.out.print(\" \");}\n\t\t\t}System.out.println();\n\t\t}",
"for(int j=0;j<c+1;j++){\n\t\t\t\tSystem.out.print(matrix_rc[i][j]);\n\t\t\t\tif(j<c){System.out.print(\" \");}\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(matrix_rc[i][j]);\n\t\t\t\tif(j<c){System.out.print(\" \");}\n\t\t\t}",
"{\n\t\t\t\tSystem.out.print(matrix_rc[i][j]);\n\t\t\t\tif(j<c){System.out.print(\" \");}\n\t\t\t}",
"System.out.print(matrix_rc[i][j])",
"System.out.print",
"System.out",
"System",
"System.out",
"matrix_rc[i][j]",
"matrix_rc[i]",
"matrix_rc",
"i",
"j",
"if(j<c){System.out.print(\" \");}",
"j<c",
"j",
"c",
"{System.out.print(\" \");}",
"System.out.print(\" \")",
"System.out.print",
"System.out",
"System",
"System.out",
"\" \"",
"System.out.println()",
"System.out.println",
"System.out",
"System",
"System.out",
"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[][] matrix_rc=new int[r+1][c+1];\n\t\tint sum_r;\n\t\tint[] sum_c=new int[c+1];\n\t\tArrays.fill(sum_c, 0);\n\t\tfor(int i=0;i<r;i++){\n\t\t\tsum_r=0;//??????????????§?????????\n\t\t\tfor(int j=0;j<c+1;j++){\n\t\t\t\tif(j!=c){\n\t\t\t\tmatrix_rc[i][j]=scan.nextInt();\n\t\t\t\tsum_r+=matrix_rc[i][j];}\n\t\t\t\telse if(j==c){\n\t\t\t\t\tmatrix_rc[i][j]=sum_r;\n\t\t\t\t}//c+1????????§??????????????????\n\t\t\t\tsum_c[j]+=matrix_rc[i][j];//j????????????????¶???????????????????????????£??\\\n\t\t\t}\n\t\t}\n\t\tfor(int j=0;j<c+1;j++){\n\t\t\tmatrix_rc[r][j]=sum_c[j];\n\t\t}//r+1?????????????????£??\\\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(matrix_rc[i][j]);\n\t\t\t\tif(j<c){System.out.print(\" \");}\n\t\t\t}System.out.println();\n\t\t}\n\t\tscan.close();\n}\n\n\n}",
"public class Main{\n\tpublic static void main(String[] args){\n\t\tScanner scan=new Scanner(System.in);\n\t\tint r=scan.nextInt();\n\t\tint c=scan.nextInt();\n\t\tint[][] matrix_rc=new int[r+1][c+1];\n\t\tint sum_r;\n\t\tint[] sum_c=new int[c+1];\n\t\tArrays.fill(sum_c, 0);\n\t\tfor(int i=0;i<r;i++){\n\t\t\tsum_r=0;//??????????????§?????????\n\t\t\tfor(int j=0;j<c+1;j++){\n\t\t\t\tif(j!=c){\n\t\t\t\tmatrix_rc[i][j]=scan.nextInt();\n\t\t\t\tsum_r+=matrix_rc[i][j];}\n\t\t\t\telse if(j==c){\n\t\t\t\t\tmatrix_rc[i][j]=sum_r;\n\t\t\t\t}//c+1????????§??????????????????\n\t\t\t\tsum_c[j]+=matrix_rc[i][j];//j????????????????¶???????????????????????????£??\\\n\t\t\t}\n\t\t}\n\t\tfor(int j=0;j<c+1;j++){\n\t\t\tmatrix_rc[r][j]=sum_c[j];\n\t\t}//r+1?????????????????£??\\\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(matrix_rc[i][j]);\n\t\t\t\tif(j<c){System.out.print(\" \");}\n\t\t\t}System.out.println();\n\t\t}\n\t\tscan.close();\n}\n\n\n}",
"Main"
] | import java.util.Arrays;
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[][] matrix_rc=new int[r+1][c+1];
int sum_r;
int[] sum_c=new int[c+1];
Arrays.fill(sum_c, 0);
for(int i=0;i<r;i++){
sum_r=0;//??????????????§?????????
for(int j=0;j<c+1;j++){
if(j!=c){
matrix_rc[i][j]=scan.nextInt();
sum_r+=matrix_rc[i][j];}
else if(j==c){
matrix_rc[i][j]=sum_r;
}//c+1????????§??????????????????
sum_c[j]+=matrix_rc[i][j];//j????????????????¶???????????????????????????£??\
}
}
for(int j=0;j<c+1;j++){
matrix_rc[r][j]=sum_c[j];
}//r+1?????????????????£??\
for(int i=0;i<r+1;i++){
for(int j=0;j<c+1;j++){
System.out.print(matrix_rc[i][j]);
if(j<c){System.out.print(" ");}
}System.out.println();
}
scan.close();
}
} |
[
7,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
17,
41,
13,
17,
0,
13,
4,
18,
13,
0,
13,
4,
18,
13,
41,
13,
20,
13,
13,
41,
13,
20,
13,
41,
13,
20,
13,
11,
1,
41,
13,
17,
2,
13,
18,
13,
13,
1,
40,
13,
30,
30,
11,
1,
41,
13,
17,
2,
13,
18,
18,
13,
17,
13,
1,
40,
13,
30,
30,
0,
18,
18,
13,
13,
13,
4,
18,
13,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
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
],
[
11,
18
],
[
18,
19
],
[
18,
20
],
[
11,
21
],
[
21,
22
],
[
21,
23
],
[
23,
24
],
[
24,
25
],
[
11,
26
],
[
26,
27
],
[
26,
28
],
[
28,
29
],
[
29,
30
],
[
11,
31
],
[
31,
32
],
[
31,
33
],
[
11,
36
],
[
36,
37
],
[
36,
38
],
[
11,
40
],
[
40,
41
],
[
40,
42
],
[
11,
44
],
[
44,
45
],
[
45,
46
],
[
46,
47
],
[
46,
48
],
[
44,
49
],
[
49,
50
],
[
49,
51
],
[
51,
52
],
[
51,
53
],
[
44,
54
],
[
54,
55
],
[
55,
56
],
[
44,
57
],
[
58,
58
],
[
58,
59
],
[
59,
60
],
[
60,
61
],
[
61,
62
],
[
61,
63
],
[
59,
64
],
[
64,
65
],
[
64,
66
],
[
66,
67
],
[
67,
68
],
[
67,
69
],
[
66,
70
],
[
59,
71
],
[
71,
72
],
[
72,
73
],
[
59,
74
],
[
75,
75
],
[
75,
76
],
[
76,
77
],
[
77,
78
],
[
78,
79
],
[
78,
80
],
[
77,
81
],
[
76,
82
],
[
82,
83
],
[
83,
84
],
[
11,
85
],
[
85,
86
],
[
85,
87
],
[
11,
88
],
[
88,
89
],
[
89,
90
],
[
90,
91
],
[
90,
92
],
[
88,
93
],
[
93,
94
],
[
93,
95
],
[
95,
96
],
[
95,
97
],
[
88,
98
],
[
98,
99
],
[
99,
100
],
[
88,
101
],
[
102,
102
],
[
102,
103
],
[
103,
104
],
[
104,
105
],
[
105,
106
],
[
105,
107
],
[
103,
108
],
[
108,
109
],
[
108,
110
],
[
110,
111
],
[
111,
112
],
[
111,
113
],
[
110,
114
],
[
103,
115
],
[
115,
116
],
[
116,
117
],
[
103,
118
],
[
119,
119
],
[
119,
120
],
[
120,
121
],
[
121,
122
],
[
121,
123
],
[
120,
124
],
[
124,
125
],
[
125,
126
],
[
125,
127
],
[
124,
128
],
[
11,
129
],
[
129,
130
],
[
130,
131
],
[
131,
132
],
[
131,
133
],
[
129,
134
],
[
134,
135
],
[
134,
136
],
[
136,
137
],
[
137,
138
],
[
137,
139
],
[
136,
140
],
[
129,
141
],
[
141,
142
],
[
142,
143
],
[
129,
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
],
[
166,
168
],
[
165,
169
],
[
145,
170
],
[
170,
171
],
[
170,
172
],
[
172,
173
],
[
172,
174
],
[
11,
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
],
[
198,
199
],
[
198,
200
],
[
197,
201
],
[
190,
202
],
[
202,
203
],
[
203,
204
],
[
190,
205
],
[
206,
206
],
[
206,
207
],
[
207,
208
],
[
208,
209
],
[
209,
210
],
[
209,
211
],
[
207,
212
],
[
212,
213
],
[
213,
214
],
[
214,
215
],
[
214,
216
],
[
213,
217
],
[
212,
218
],
[
189,
219
],
[
219,
220
],
[
220,
221
],
[
221,
222
],
[
221,
223
],
[
219,
224
],
[
224,
225
],
[
225,
226
],
[
225,
227
],
[
224,
228
],
[
11,
229
],
[
229,
230
],
[
229,
231
],
[
229,
232
],
[
233,
233
],
[
233,
234
],
[
234,
235
],
[
235,
236
],
[
236,
237
],
[
236,
238
],
[
234,
239
],
[
239,
240
],
[
239,
241
],
[
11,
242
],
[
242,
243
],
[
243,
244
],
[
244,
245
],
[
244,
246
],
[
242,
247
],
[
247,
248
],
[
247,
249
],
[
9,
250
],
[
250,
251
]
] | [
"import java.io.IOException;\nimport java.util.Scanner;\n\nclass Main {\n\n\tpublic static void main(String[] args) throws IOException {\n\n\t\tScanner scane = new Scanner(System.in);\n\n\t\tint r = 0, c = 0;\n\n\t\tr = scane.nextInt();\n\t\tc = scane.nextInt();\n\n\t\tint[][] rc = new int[r][c];\n\n\t\tint[] r1 = new int[r];\n\t\tint[] c1 = new int[c];\n\n\t\tfor(int i=0; i<rc.length; i++){\n\t\t\tfor(int j=0; j<rc[0].length; j++){\n\n\t\t\t\trc[i][j] = scane.nextInt();\n\t\t\t}\n\t\t}\n\t\tint nums =0;\n\n\t\tfor(int i=0; i<rc.length; i++){\n\t\t\tfor(int j=0; j<rc[0].length; j++){\n\n\t\t\t\tr1[i] += rc[i][j];\n\t\t\t}\n\t\t}\n\t\tfor(int i=0; i<rc[0].length; i++){\n\t\t\tfor(int j=0; j<rc.length; j++){\n\n\t\t\t\tc1[i] += rc[j][i];\n\t\t\t}\n\t\t\tnums += c1[i];\n\t\t}\n\n\n\t\tfor(int i=0; i<rc.length; i++){\n\t\t\tfor(int j=0; j<rc[0].length; j++){\n\n\t\t\t\tSystem.out.print(rc[i][j]+\" \");\n\t\t\t}\n\t\t\tSystem.out.println(r1[i]+\"\");\n\t\t}\n\t\tfor(int num : c1){\n\t\t\tSystem.out.print(num+\" \");\n\t\t}\n\t\tSystem.out.print(nums+\"\\n\");\n\n\t}\n}",
"import java.io.IOException;",
"IOException",
"java.io",
"import java.util.Scanner;",
"Scanner",
"java.util",
"class Main {\n\n\tpublic static void main(String[] args) throws IOException {\n\n\t\tScanner scane = new Scanner(System.in);\n\n\t\tint r = 0, c = 0;\n\n\t\tr = scane.nextInt();\n\t\tc = scane.nextInt();\n\n\t\tint[][] rc = new int[r][c];\n\n\t\tint[] r1 = new int[r];\n\t\tint[] c1 = new int[c];\n\n\t\tfor(int i=0; i<rc.length; i++){\n\t\t\tfor(int j=0; j<rc[0].length; j++){\n\n\t\t\t\trc[i][j] = scane.nextInt();\n\t\t\t}\n\t\t}\n\t\tint nums =0;\n\n\t\tfor(int i=0; i<rc.length; i++){\n\t\t\tfor(int j=0; j<rc[0].length; j++){\n\n\t\t\t\tr1[i] += rc[i][j];\n\t\t\t}\n\t\t}\n\t\tfor(int i=0; i<rc[0].length; i++){\n\t\t\tfor(int j=0; j<rc.length; j++){\n\n\t\t\t\tc1[i] += rc[j][i];\n\t\t\t}\n\t\t\tnums += c1[i];\n\t\t}\n\n\n\t\tfor(int i=0; i<rc.length; i++){\n\t\t\tfor(int j=0; j<rc[0].length; j++){\n\n\t\t\t\tSystem.out.print(rc[i][j]+\" \");\n\t\t\t}\n\t\t\tSystem.out.println(r1[i]+\"\");\n\t\t}\n\t\tfor(int num : c1){\n\t\t\tSystem.out.print(num+\" \");\n\t\t}\n\t\tSystem.out.print(nums+\"\\n\");\n\n\t}\n}",
"Main",
"public static void main(String[] args) throws IOException {\n\n\t\tScanner scane = new Scanner(System.in);\n\n\t\tint r = 0, c = 0;\n\n\t\tr = scane.nextInt();\n\t\tc = scane.nextInt();\n\n\t\tint[][] rc = new int[r][c];\n\n\t\tint[] r1 = new int[r];\n\t\tint[] c1 = new int[c];\n\n\t\tfor(int i=0; i<rc.length; i++){\n\t\t\tfor(int j=0; j<rc[0].length; j++){\n\n\t\t\t\trc[i][j] = scane.nextInt();\n\t\t\t}\n\t\t}\n\t\tint nums =0;\n\n\t\tfor(int i=0; i<rc.length; i++){\n\t\t\tfor(int j=0; j<rc[0].length; j++){\n\n\t\t\t\tr1[i] += rc[i][j];\n\t\t\t}\n\t\t}\n\t\tfor(int i=0; i<rc[0].length; i++){\n\t\t\tfor(int j=0; j<rc.length; j++){\n\n\t\t\t\tc1[i] += rc[j][i];\n\t\t\t}\n\t\t\tnums += c1[i];\n\t\t}\n\n\n\t\tfor(int i=0; i<rc.length; i++){\n\t\t\tfor(int j=0; j<rc[0].length; j++){\n\n\t\t\t\tSystem.out.print(rc[i][j]+\" \");\n\t\t\t}\n\t\t\tSystem.out.println(r1[i]+\"\");\n\t\t}\n\t\tfor(int num : c1){\n\t\t\tSystem.out.print(num+\" \");\n\t\t}\n\t\tSystem.out.print(nums+\"\\n\");\n\n\t}",
"main",
"{\n\n\t\tScanner scane = new Scanner(System.in);\n\n\t\tint r = 0, c = 0;\n\n\t\tr = scane.nextInt();\n\t\tc = scane.nextInt();\n\n\t\tint[][] rc = new int[r][c];\n\n\t\tint[] r1 = new int[r];\n\t\tint[] c1 = new int[c];\n\n\t\tfor(int i=0; i<rc.length; i++){\n\t\t\tfor(int j=0; j<rc[0].length; j++){\n\n\t\t\t\trc[i][j] = scane.nextInt();\n\t\t\t}\n\t\t}\n\t\tint nums =0;\n\n\t\tfor(int i=0; i<rc.length; i++){\n\t\t\tfor(int j=0; j<rc[0].length; j++){\n\n\t\t\t\tr1[i] += rc[i][j];\n\t\t\t}\n\t\t}\n\t\tfor(int i=0; i<rc[0].length; i++){\n\t\t\tfor(int j=0; j<rc.length; j++){\n\n\t\t\t\tc1[i] += rc[j][i];\n\t\t\t}\n\t\t\tnums += c1[i];\n\t\t}\n\n\n\t\tfor(int i=0; i<rc.length; i++){\n\t\t\tfor(int j=0; j<rc[0].length; j++){\n\n\t\t\t\tSystem.out.print(rc[i][j]+\" \");\n\t\t\t}\n\t\t\tSystem.out.println(r1[i]+\"\");\n\t\t}\n\t\tfor(int num : c1){\n\t\t\tSystem.out.print(num+\" \");\n\t\t}\n\t\tSystem.out.print(nums+\"\\n\");\n\n\t}",
"Scanner scane = new Scanner(System.in);",
"scane",
"new Scanner(System.in)",
"int r = 0",
"r",
"0",
"c = 0;",
"c",
"0",
"r = scane.nextInt()",
"r",
"scane.nextInt()",
"scane.nextInt",
"scane",
"c = scane.nextInt()",
"c",
"scane.nextInt()",
"scane.nextInt",
"scane",
"int[][] rc = new int[r][c];",
"rc",
"new int[r][c]",
"r",
"c",
"int[] r1 = new int[r];",
"r1",
"new int[r]",
"r",
"int[] c1 = new int[c];",
"c1",
"new int[c]",
"c",
"for(int i=0; i<rc.length; i++){\n\t\t\tfor(int j=0; j<rc[0].length; j++){\n\n\t\t\t\trc[i][j] = scane.nextInt();\n\t\t\t}\n\t\t}",
"int i=0;",
"int i=0;",
"i",
"0",
"i<rc.length",
"i",
"rc.length",
"rc",
"rc.length",
"i++",
"i++",
"i",
"{\n\t\t\tfor(int j=0; j<rc[0].length; j++){\n\n\t\t\t\trc[i][j] = scane.nextInt();\n\t\t\t}\n\t\t}",
"{\n\t\t\tfor(int j=0; j<rc[0].length; j++){\n\n\t\t\t\trc[i][j] = scane.nextInt();\n\t\t\t}\n\t\t}",
"for(int j=0; j<rc[0].length; j++){\n\n\t\t\t\trc[i][j] = scane.nextInt();\n\t\t\t}",
"int j=0;",
"int j=0;",
"j",
"0",
"j<rc[0].length",
"j",
"rc[0].length",
"rc[0]",
"rc",
"0",
"rc[0].length",
"j++",
"j++",
"j",
"{\n\n\t\t\t\trc[i][j] = scane.nextInt();\n\t\t\t}",
"{\n\n\t\t\t\trc[i][j] = scane.nextInt();\n\t\t\t}",
"rc[i][j] = scane.nextInt()",
"rc[i][j]",
"rc[i]",
"rc",
"i",
"j",
"scane.nextInt()",
"scane.nextInt",
"scane",
"int nums =0;",
"nums",
"0",
"for(int i=0; i<rc.length; i++){\n\t\t\tfor(int j=0; j<rc[0].length; j++){\n\n\t\t\t\tr1[i] += rc[i][j];\n\t\t\t}\n\t\t}",
"int i=0;",
"int i=0;",
"i",
"0",
"i<rc.length",
"i",
"rc.length",
"rc",
"rc.length",
"i++",
"i++",
"i",
"{\n\t\t\tfor(int j=0; j<rc[0].length; j++){\n\n\t\t\t\tr1[i] += rc[i][j];\n\t\t\t}\n\t\t}",
"{\n\t\t\tfor(int j=0; j<rc[0].length; j++){\n\n\t\t\t\tr1[i] += rc[i][j];\n\t\t\t}\n\t\t}",
"for(int j=0; j<rc[0].length; j++){\n\n\t\t\t\tr1[i] += rc[i][j];\n\t\t\t}",
"int j=0;",
"int j=0;",
"j",
"0",
"j<rc[0].length",
"j",
"rc[0].length",
"rc[0]",
"rc",
"0",
"rc[0].length",
"j++",
"j++",
"j",
"{\n\n\t\t\t\tr1[i] += rc[i][j];\n\t\t\t}",
"{\n\n\t\t\t\tr1[i] += rc[i][j];\n\t\t\t}",
"r1[i] += rc[i][j]",
"r1[i]",
"r1",
"i",
"rc[i][j]",
"rc[i]",
"rc",
"i",
"j",
"for(int i=0; i<rc[0].length; i++){\n\t\t\tfor(int j=0; j<rc.length; j++){\n\n\t\t\t\tc1[i] += rc[j][i];\n\t\t\t}\n\t\t\tnums += c1[i];\n\t\t}",
"int i=0;",
"int i=0;",
"i",
"0",
"i<rc[0].length",
"i",
"rc[0].length",
"rc[0]",
"rc",
"0",
"rc[0].length",
"i++",
"i++",
"i",
"{\n\t\t\tfor(int j=0; j<rc.length; j++){\n\n\t\t\t\tc1[i] += rc[j][i];\n\t\t\t}\n\t\t\tnums += c1[i];\n\t\t}",
"{\n\t\t\tfor(int j=0; j<rc.length; j++){\n\n\t\t\t\tc1[i] += rc[j][i];\n\t\t\t}\n\t\t\tnums += c1[i];\n\t\t}",
"for(int j=0; j<rc.length; j++){\n\n\t\t\t\tc1[i] += rc[j][i];\n\t\t\t}",
"int j=0;",
"int j=0;",
"j",
"0",
"j<rc.length",
"j",
"rc.length",
"rc",
"rc.length",
"j++",
"j++",
"j",
"{\n\n\t\t\t\tc1[i] += rc[j][i];\n\t\t\t}",
"{\n\n\t\t\t\tc1[i] += rc[j][i];\n\t\t\t}",
"c1[i] += rc[j][i]",
"c1[i]",
"c1",
"i",
"rc[j][i]",
"rc[j]",
"rc",
"j",
"i",
"nums += c1[i]",
"nums",
"c1[i]",
"c1",
"i",
"for(int i=0; i<rc.length; i++){\n\t\t\tfor(int j=0; j<rc[0].length; j++){\n\n\t\t\t\tSystem.out.print(rc[i][j]+\" \");\n\t\t\t}\n\t\t\tSystem.out.println(r1[i]+\"\");\n\t\t}",
"int i=0;",
"int i=0;",
"i",
"0",
"i<rc.length",
"i",
"rc.length",
"rc",
"rc.length",
"i++",
"i++",
"i",
"{\n\t\t\tfor(int j=0; j<rc[0].length; j++){\n\n\t\t\t\tSystem.out.print(rc[i][j]+\" \");\n\t\t\t}\n\t\t\tSystem.out.println(r1[i]+\"\");\n\t\t}",
"{\n\t\t\tfor(int j=0; j<rc[0].length; j++){\n\n\t\t\t\tSystem.out.print(rc[i][j]+\" \");\n\t\t\t}\n\t\t\tSystem.out.println(r1[i]+\"\");\n\t\t}",
"for(int j=0; j<rc[0].length; j++){\n\n\t\t\t\tSystem.out.print(rc[i][j]+\" \");\n\t\t\t}",
"int j=0;",
"int j=0;",
"j",
"0",
"j<rc[0].length",
"j",
"rc[0].length",
"rc[0]",
"rc",
"0",
"rc[0].length",
"j++",
"j++",
"j",
"{\n\n\t\t\t\tSystem.out.print(rc[i][j]+\" \");\n\t\t\t}",
"{\n\n\t\t\t\tSystem.out.print(rc[i][j]+\" \");\n\t\t\t}",
"System.out.print(rc[i][j]+\" \")",
"System.out.print",
"System.out",
"System",
"System.out",
"rc[i][j]+\" \"",
"rc[i][j]",
"rc[i]",
"rc",
"i",
"j",
"\" \"",
"System.out.println(r1[i]+\"\")",
"System.out.println",
"System.out",
"System",
"System.out",
"r1[i]+\"\"",
"r1[i]",
"r1",
"i",
"\"\"",
"for(int num : c1){\n\t\t\tSystem.out.print(num+\" \");\n\t\t}",
"int num",
"c1",
"{\n\t\t\tSystem.out.print(num+\" \");\n\t\t}",
"{\n\t\t\tSystem.out.print(num+\" \");\n\t\t}",
"System.out.print(num+\" \")",
"System.out.print",
"System.out",
"System",
"System.out",
"num+\" \"",
"num",
"\" \"",
"System.out.print(nums+\"\\n\")",
"System.out.print",
"System.out",
"System",
"System.out",
"nums+\"\\n\"",
"nums",
"\"\\n\"",
"String[] args",
"args"
] | import java.io.IOException;
import java.util.Scanner;
class Main {
public static void main(String[] args) throws IOException {
Scanner scane = new Scanner(System.in);
int r = 0, c = 0;
r = scane.nextInt();
c = scane.nextInt();
int[][] rc = new int[r][c];
int[] r1 = new int[r];
int[] c1 = new int[c];
for(int i=0; i<rc.length; i++){
for(int j=0; j<rc[0].length; j++){
rc[i][j] = scane.nextInt();
}
}
int nums =0;
for(int i=0; i<rc.length; i++){
for(int j=0; j<rc[0].length; j++){
r1[i] += rc[i][j];
}
}
for(int i=0; i<rc[0].length; i++){
for(int j=0; j<rc.length; j++){
c1[i] += rc[j][i];
}
nums += c1[i];
}
for(int i=0; i<rc.length; i++){
for(int j=0; j<rc[0].length; j++){
System.out.print(rc[i][j]+" ");
}
System.out.println(r1[i]+"");
}
for(int num : c1){
System.out.print(num+" ");
}
System.out.print(nums+"\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,
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
],
[
179,
5
],
[
179,
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
],
[
8,
39
],
[
39,
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
],
[
70,
70
],
[
70,
71
],
[
71,
72
],
[
72,
73
],
[
73,
74
],
[
73,
75
],
[
72,
76
],
[
71,
77
],
[
77,
78
],
[
78,
79
],
[
70,
80
],
[
80,
81
],
[
81,
82
],
[
82,
83
],
[
82,
84
],
[
81,
85
],
[
85,
86
],
[
85,
87
],
[
80,
88
],
[
88,
89
],
[
89,
90
],
[
89,
91
],
[
88,
92
],
[
70,
93
],
[
93,
94
],
[
94,
95
],
[
95,
96
],
[
95,
97
],
[
97,
98
],
[
97,
99
],
[
94,
100
],
[
93,
101
],
[
101,
102
],
[
102,
103
],
[
102,
104
],
[
101,
105
],
[
70,
106
],
[
106,
107
],
[
107,
108
],
[
108,
109
],
[
108,
110
],
[
110,
111
],
[
110,
112
],
[
107,
113
],
[
113,
114
],
[
113,
115
],
[
106,
116
],
[
116,
117
],
[
117,
118
],
[
117,
119
],
[
116,
120
],
[
8,
121
],
[
121,
122
],
[
122,
123
],
[
123,
124
],
[
123,
125
],
[
121,
126
],
[
126,
127
],
[
126,
128
],
[
121,
129
],
[
129,
130
],
[
130,
131
],
[
121,
132
],
[
133,
133
],
[
133,
134
],
[
134,
135
],
[
135,
136
],
[
136,
137
],
[
136,
138
],
[
134,
139
],
[
139,
140
],
[
139,
141
],
[
134,
142
],
[
142,
143
],
[
143,
144
],
[
134,
145
],
[
146,
146
],
[
146,
147
],
[
147,
148
],
[
148,
149
],
[
148,
150
],
[
150,
151
],
[
150,
152
],
[
147,
153
],
[
153,
154
],
[
154,
155
],
[
155,
156
],
[
156,
157
],
[
156,
158
],
[
154,
159
],
[
159,
160
],
[
160,
161
],
[
160,
162
],
[
159,
163
],
[
147,
164
],
[
164,
165
],
[
165,
166
],
[
166,
167
],
[
166,
168
],
[
164,
169
],
[
169,
170
],
[
170,
171
],
[
171,
172
],
[
171,
173
],
[
170,
174
],
[
169,
175
],
[
6,
176
],
[
176,
177
],
[
0,
178
],
[
178,
179
],
[
178,
180
]
] | [
"import java.util.Scanner;\npublic class Main {\n public static void main(String[] args){\n Scanner scan = new Scanner(System.in);\n int t = scan.nextInt();\n int u = scan.nextInt();\n int n = t + 1;\n int m = u + 1;\n int[][] a = new int[n][m];\n \n int i,r;\n for(i = 0; i < n - 1; ++i){\n for(r = 0; r < m - 1; ++r){\n a[i][r] = scan.nextInt();\n a[i][m - 1] += a[i][r];\n a[n - 1][r] += a[i][r];\n a[n - 1][m - 1] += a[i][r];\n }\n }\n for(i = 0; i < n; ++i){\n for(r = 0; r < m; ++r){\n if(r == m - 1){\n System.out.println(a[i][r]);\n }\n else\n System.out.print(a[i][r]+\" \");\n \n }\n }\n }\n}\n \n \n ",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n public static void main(String[] args){\n Scanner scan = new Scanner(System.in);\n int t = scan.nextInt();\n int u = scan.nextInt();\n int n = t + 1;\n int m = u + 1;\n int[][] a = new int[n][m];\n \n int i,r;\n for(i = 0; i < n - 1; ++i){\n for(r = 0; r < m - 1; ++r){\n a[i][r] = scan.nextInt();\n a[i][m - 1] += a[i][r];\n a[n - 1][r] += a[i][r];\n a[n - 1][m - 1] += a[i][r];\n }\n }\n for(i = 0; i < n; ++i){\n for(r = 0; r < m; ++r){\n if(r == m - 1){\n System.out.println(a[i][r]);\n }\n else\n System.out.print(a[i][r]+\" \");\n \n }\n }\n }\n}",
"Main",
"public static void main(String[] args){\n Scanner scan = new Scanner(System.in);\n int t = scan.nextInt();\n int u = scan.nextInt();\n int n = t + 1;\n int m = u + 1;\n int[][] a = new int[n][m];\n \n int i,r;\n for(i = 0; i < n - 1; ++i){\n for(r = 0; r < m - 1; ++r){\n a[i][r] = scan.nextInt();\n a[i][m - 1] += a[i][r];\n a[n - 1][r] += a[i][r];\n a[n - 1][m - 1] += a[i][r];\n }\n }\n for(i = 0; i < n; ++i){\n for(r = 0; r < m; ++r){\n if(r == m - 1){\n System.out.println(a[i][r]);\n }\n else\n System.out.print(a[i][r]+\" \");\n \n }\n }\n }",
"main",
"{\n Scanner scan = new Scanner(System.in);\n int t = scan.nextInt();\n int u = scan.nextInt();\n int n = t + 1;\n int m = u + 1;\n int[][] a = new int[n][m];\n \n int i,r;\n for(i = 0; i < n - 1; ++i){\n for(r = 0; r < m - 1; ++r){\n a[i][r] = scan.nextInt();\n a[i][m - 1] += a[i][r];\n a[n - 1][r] += a[i][r];\n a[n - 1][m - 1] += a[i][r];\n }\n }\n for(i = 0; i < n; ++i){\n for(r = 0; r < m; ++r){\n if(r == m - 1){\n System.out.println(a[i][r]);\n }\n else\n System.out.print(a[i][r]+\" \");\n \n }\n }\n }",
"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 i",
"i",
"r;",
"r",
"for(i = 0; i < n - 1; ++i){\n for(r = 0; r < m - 1; ++r){\n a[i][r] = scan.nextInt();\n a[i][m - 1] += a[i][r];\n a[n - 1][r] += a[i][r];\n a[n - 1][m - 1] += a[i][r];\n }\n }",
"i = 0;",
"i = 0",
"i",
"0",
"i < n - 1",
"i",
"n - 1",
"n",
"1",
"++i",
"++i",
"i",
"{\n for(r = 0; r < m - 1; ++r){\n a[i][r] = scan.nextInt();\n a[i][m - 1] += a[i][r];\n a[n - 1][r] += a[i][r];\n a[n - 1][m - 1] += a[i][r];\n }\n }",
"{\n for(r = 0; r < m - 1; ++r){\n a[i][r] = scan.nextInt();\n a[i][m - 1] += a[i][r];\n a[n - 1][r] += a[i][r];\n a[n - 1][m - 1] += a[i][r];\n }\n }",
"for(r = 0; r < m - 1; ++r){\n a[i][r] = scan.nextInt();\n a[i][m - 1] += a[i][r];\n a[n - 1][r] += a[i][r];\n a[n - 1][m - 1] += a[i][r];\n }",
"r = 0;",
"r = 0",
"r",
"0",
"r < m - 1",
"r",
"m - 1",
"m",
"1",
"++r",
"++r",
"r",
"{\n a[i][r] = scan.nextInt();\n a[i][m - 1] += a[i][r];\n a[n - 1][r] += a[i][r];\n a[n - 1][m - 1] += a[i][r];\n }",
"{\n a[i][r] = scan.nextInt();\n a[i][m - 1] += a[i][r];\n a[n - 1][r] += a[i][r];\n a[n - 1][m - 1] += a[i][r];\n }",
"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] += 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 for(r = 0; r < m; ++r){\n if(r == m - 1){\n System.out.println(a[i][r]);\n }\n else\n System.out.print(a[i][r]+\" \");\n \n }\n }",
"i = 0;",
"i = 0",
"i",
"0",
"i < n",
"i",
"n",
"++i",
"++i",
"i",
"{\n for(r = 0; r < m; ++r){\n if(r == m - 1){\n System.out.println(a[i][r]);\n }\n else\n System.out.print(a[i][r]+\" \");\n \n }\n }",
"{\n for(r = 0; r < m; ++r){\n if(r == m - 1){\n System.out.println(a[i][r]);\n }\n else\n System.out.print(a[i][r]+\" \");\n \n }\n }",
"for(r = 0; r < m; ++r){\n if(r == m - 1){\n System.out.println(a[i][r]);\n }\n else\n System.out.print(a[i][r]+\" \");\n \n }",
"r = 0;",
"r = 0",
"r",
"0",
"r < m",
"r",
"m",
"++r",
"++r",
"r",
"{\n if(r == m - 1){\n System.out.println(a[i][r]);\n }\n else\n System.out.print(a[i][r]+\" \");\n \n }",
"{\n if(r == m - 1){\n System.out.println(a[i][r]);\n }\n else\n System.out.print(a[i][r]+\" \");\n \n }",
"if(r == m - 1){\n System.out.println(a[i][r]);\n }\n else\n System.out.print(a[i][r]+\" \");",
"r == m - 1",
"r",
"m - 1",
"m",
"1",
"{\n System.out.println(a[i][r]);\n }",
"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 public static void main(String[] args){\n Scanner scan = new Scanner(System.in);\n int t = scan.nextInt();\n int u = scan.nextInt();\n int n = t + 1;\n int m = u + 1;\n int[][] a = new int[n][m];\n \n int i,r;\n for(i = 0; i < n - 1; ++i){\n for(r = 0; r < m - 1; ++r){\n a[i][r] = scan.nextInt();\n a[i][m - 1] += a[i][r];\n a[n - 1][r] += a[i][r];\n a[n - 1][m - 1] += a[i][r];\n }\n }\n for(i = 0; i < n; ++i){\n for(r = 0; r < m; ++r){\n if(r == m - 1){\n System.out.println(a[i][r]);\n }\n else\n System.out.print(a[i][r]+\" \");\n \n }\n }\n }\n}",
"public class Main {\n public static void main(String[] args){\n Scanner scan = new Scanner(System.in);\n int t = scan.nextInt();\n int u = scan.nextInt();\n int n = t + 1;\n int m = u + 1;\n int[][] a = new int[n][m];\n \n int i,r;\n for(i = 0; i < n - 1; ++i){\n for(r = 0; r < m - 1; ++r){\n a[i][r] = scan.nextInt();\n a[i][m - 1] += a[i][r];\n a[n - 1][r] += a[i][r];\n a[n - 1][m - 1] += a[i][r];\n }\n }\n for(i = 0; i < n; ++i){\n for(r = 0; r < m; ++r){\n if(r == m - 1){\n System.out.println(a[i][r]);\n }\n else\n System.out.print(a[i][r]+\" \");\n \n }\n }\n }\n}",
"Main"
] | import java.util.Scanner;
public class Main {
public static void main(String[] args){
Scanner scan = new Scanner(System.in);
int t = scan.nextInt();
int u = scan.nextInt();
int n = t + 1;
int m = u + 1;
int[][] a = new int[n][m];
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,
20,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
41,
13,
20,
2,
13,
17,
2,
13,
17,
12,
13,
30,
4,
13,
4,
13,
4,
13,
23,
13,
12,
13,
30,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
18,
18,
13,
13,
13,
4,
18,
13,
12,
13,
30,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
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,
12,
13,
30,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
4,
18,
18,
13,
13,
2,
18,
18,
13,
13,
13,
17,
4,
18,
18,
13,
13,
18,
18,
13,
13,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
220,
5
],
[
220,
6
],
[
6,
7
],
[
6,
8
],
[
220,
9
],
[
9,
10
],
[
9,
11
],
[
11,
12
],
[
12,
13
],
[
220,
14
],
[
14,
15
],
[
14,
16
],
[
16,
17
],
[
17,
18
],
[
220,
19
],
[
19,
20
],
[
19,
21
],
[
22,
23
],
[
22,
24
],
[
25,
26
],
[
25,
27
],
[
220,
28
],
[
28,
29
],
[
28,
30
],
[
30,
31
],
[
31,
32
],
[
30,
33
],
[
33,
34
],
[
30,
35
],
[
35,
36
],
[
28,
37
],
[
37,
38
],
[
220,
39
],
[
39,
40
],
[
39,
41
],
[
41,
42
],
[
42,
43
],
[
43,
44
],
[
44,
45
],
[
44,
46
],
[
42,
47
],
[
47,
48
],
[
47,
49
],
[
42,
50
],
[
50,
51
],
[
51,
52
],
[
42,
53
],
[
54,
54
],
[
54,
55
],
[
55,
56
],
[
56,
57
],
[
57,
58
],
[
57,
59
],
[
55,
60
],
[
60,
61
],
[
60,
62
],
[
55,
63
],
[
63,
64
],
[
64,
65
],
[
55,
66
],
[
67,
67
],
[
67,
68
],
[
68,
69
],
[
69,
70
],
[
70,
71
],
[
70,
72
],
[
69,
73
],
[
68,
74
],
[
74,
75
],
[
75,
76
],
[
220,
77
],
[
77,
78
],
[
77,
79
],
[
79,
80
],
[
80,
81
],
[
81,
82
],
[
82,
83
],
[
82,
84
],
[
80,
85
],
[
85,
86
],
[
85,
87
],
[
80,
88
],
[
88,
89
],
[
89,
90
],
[
80,
91
],
[
92,
92
],
[
92,
93
],
[
93,
94
],
[
93,
95
],
[
92,
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
],
[
111,
112
],
[
112,
113
],
[
112,
114
],
[
111,
115
],
[
92,
116
],
[
116,
117
],
[
117,
118
],
[
118,
119
],
[
118,
120
],
[
117,
121
],
[
116,
122
],
[
79,
123
],
[
123,
124
],
[
124,
125
],
[
125,
126
],
[
125,
127
],
[
123,
128
],
[
128,
129
],
[
128,
130
],
[
130,
131
],
[
130,
132
],
[
123,
133
],
[
133,
134
],
[
134,
135
],
[
123,
136
],
[
137,
137
],
[
137,
138
],
[
138,
139
],
[
138,
140
],
[
137,
141
],
[
141,
142
],
[
142,
143
],
[
143,
144
],
[
143,
145
],
[
141,
146
],
[
146,
147
],
[
146,
148
],
[
141,
149
],
[
149,
150
],
[
150,
151
],
[
141,
152
],
[
153,
153
],
[
153,
154
],
[
154,
155
],
[
154,
156
],
[
156,
157
],
[
157,
158
],
[
157,
159
],
[
156,
160
],
[
137,
161
],
[
161,
162
],
[
162,
163
],
[
163,
164
],
[
163,
165
],
[
162,
166
],
[
161,
167
],
[
220,
168
],
[
168,
169
],
[
168,
170
],
[
170,
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
],
[
189,
191
],
[
184,
192
],
[
192,
193
],
[
193,
194
],
[
184,
195
],
[
196,
196
],
[
196,
197
],
[
197,
198
],
[
198,
199
],
[
199,
200
],
[
199,
201
],
[
197,
202
],
[
202,
203
],
[
203,
204
],
[
204,
205
],
[
204,
206
],
[
203,
207
],
[
202,
208
],
[
183,
209
],
[
209,
210
],
[
210,
211
],
[
211,
212
],
[
211,
213
],
[
209,
214
],
[
214,
215
],
[
215,
216
],
[
215,
217
],
[
214,
218
],
[
0,
219
],
[
219,
220
],
[
219,
221
]
] | [
"import java.util.Scanner;\n\npublic class Main{\n\tprivate static Scanner sc=new Scanner(System.in);\n\tprivate static int r=sc.nextInt();\n\tprivate static int c=sc.nextInt();\n\tprivate static int[][] data=new int[r+1][c+1];\n\tpublic static void main(String args[]){\n\t\tinput();\n\t\tsetSum();\n\t\toutput();\n\t}\n\tprivate static void input(){\n\t\tfor(int i=0;i<r;i++){\n\t\t\tfor(int j=0;j<c;j++){\n\t\t\t\tdata[i][j]=sc.nextInt();\n\t\t\t}\n\t\t}\n\t}\n\tprivate static void setSum(){\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\tsum+=data[i][j];\n\t\t\t}\n\t\t\tdata[i][c]=sum;\n\t\t}\n\t\tfor(int j=0;j<c+1;j++){\n\t\t\tint sum=0;\n\t\t\tfor(int i=0;i<r;i++){\n\t\t\t\tsum+=data[i][j];\n\t\t\t}\n\t\t\tdata[r][j]=sum;\n\t\t}\n\t}\n\tprivate static void output(){\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(data[i][j]+\" \");\n\t\t\t}\n\t\t\tSystem.out.println(data[i][c]);\n\t\t}\n\t}\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main{\n\tprivate static Scanner sc=new Scanner(System.in);\n\tprivate static int r=sc.nextInt();\n\tprivate static int c=sc.nextInt();\n\tprivate static int[][] data=new int[r+1][c+1];\n\tpublic static void main(String args[]){\n\t\tinput();\n\t\tsetSum();\n\t\toutput();\n\t}\n\tprivate static void input(){\n\t\tfor(int i=0;i<r;i++){\n\t\t\tfor(int j=0;j<c;j++){\n\t\t\t\tdata[i][j]=sc.nextInt();\n\t\t\t}\n\t\t}\n\t}\n\tprivate static void setSum(){\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\tsum+=data[i][j];\n\t\t\t}\n\t\t\tdata[i][c]=sum;\n\t\t}\n\t\tfor(int j=0;j<c+1;j++){\n\t\t\tint sum=0;\n\t\t\tfor(int i=0;i<r;i++){\n\t\t\t\tsum+=data[i][j];\n\t\t\t}\n\t\t\tdata[r][j]=sum;\n\t\t}\n\t}\n\tprivate static void output(){\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(data[i][j]+\" \");\n\t\t\t}\n\t\t\tSystem.out.println(data[i][c]);\n\t\t}\n\t}\n}",
"Main",
"private static Scanner sc=new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"private static int r=sc.nextInt();",
"r",
"sc.nextInt()",
"sc.nextInt",
"sc",
"private static int c=sc.nextInt();",
"c",
"sc.nextInt()",
"sc.nextInt",
"sc",
"private static int[][] data=new int[r+1][c+1];",
"data",
"new int[r+1][c+1]",
"r+1",
"r",
"1",
"c+1",
"c",
"1",
"public static void main(String args[]){\n\t\tinput();\n\t\tsetSum();\n\t\toutput();\n\t}",
"main",
"{\n\t\tinput();\n\t\tsetSum();\n\t\toutput();\n\t}",
"input()",
"input",
"setSum()",
"setSum",
"output()",
"output",
"String args[]",
"args",
"private static void input(){\n\t\tfor(int i=0;i<r;i++){\n\t\t\tfor(int j=0;j<c;j++){\n\t\t\t\tdata[i][j]=sc.nextInt();\n\t\t\t}\n\t\t}\n\t}",
"input",
"{\n\t\tfor(int i=0;i<r;i++){\n\t\t\tfor(int j=0;j<c;j++){\n\t\t\t\tdata[i][j]=sc.nextInt();\n\t\t\t}\n\t\t}\n\t}",
"for(int i=0;i<r;i++){\n\t\t\tfor(int j=0;j<c;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<r",
"i",
"r",
"i++",
"i++",
"i",
"{\n\t\t\tfor(int j=0;j<c;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<c;j++){\n\t\t\t\tdata[i][j]=sc.nextInt();\n\t\t\t}\n\t\t}",
"for(int j=0;j<c;j++){\n\t\t\t\tdata[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\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",
"private static void setSum(){\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\tsum+=data[i][j];\n\t\t\t}\n\t\t\tdata[i][c]=sum;\n\t\t}\n\t\tfor(int j=0;j<c+1;j++){\n\t\t\tint sum=0;\n\t\t\tfor(int i=0;i<r;i++){\n\t\t\t\tsum+=data[i][j];\n\t\t\t}\n\t\t\tdata[r][j]=sum;\n\t\t}\n\t}",
"setSum",
"{\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\tsum+=data[i][j];\n\t\t\t}\n\t\t\tdata[i][c]=sum;\n\t\t}\n\t\tfor(int j=0;j<c+1;j++){\n\t\t\tint sum=0;\n\t\t\tfor(int i=0;i<r;i++){\n\t\t\t\tsum+=data[i][j];\n\t\t\t}\n\t\t\tdata[r][j]=sum;\n\t\t}\n\t}",
"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\tsum+=data[i][j];\n\t\t\t}\n\t\t\tdata[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\tsum+=data[i][j];\n\t\t\t}\n\t\t\tdata[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\tsum+=data[i][j];\n\t\t\t}\n\t\t\tdata[i][c]=sum;\n\t\t}",
"int sum=0;",
"sum",
"0",
"for(int j=0;j<c;j++){\n\t\t\t\tsum+=data[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\tsum+=data[i][j];\n\t\t\t}",
"{\n\t\t\t\tsum+=data[i][j];\n\t\t\t}",
"sum+=data[i][j]",
"sum",
"data[i][j]",
"data[i]",
"data",
"i",
"j",
"data[i][c]=sum",
"data[i][c]",
"data[i]",
"data",
"i",
"c",
"sum",
"for(int j=0;j<c+1;j++){\n\t\t\tint sum=0;\n\t\t\tfor(int i=0;i<r;i++){\n\t\t\t\tsum+=data[i][j];\n\t\t\t}\n\t\t\tdata[r][j]=sum;\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 sum=0;\n\t\t\tfor(int i=0;i<r;i++){\n\t\t\t\tsum+=data[i][j];\n\t\t\t}\n\t\t\tdata[r][j]=sum;\n\t\t}",
"{\n\t\t\tint sum=0;\n\t\t\tfor(int i=0;i<r;i++){\n\t\t\t\tsum+=data[i][j];\n\t\t\t}\n\t\t\tdata[r][j]=sum;\n\t\t}",
"int sum=0;",
"sum",
"0",
"for(int i=0;i<r;i++){\n\t\t\t\tsum+=data[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\tsum+=data[i][j];\n\t\t\t}",
"{\n\t\t\t\tsum+=data[i][j];\n\t\t\t}",
"sum+=data[i][j]",
"sum",
"data[i][j]",
"data[i]",
"data",
"i",
"j",
"data[r][j]=sum",
"data[r][j]",
"data[r]",
"data",
"r",
"j",
"sum",
"private static void output(){\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(data[i][j]+\" \");\n\t\t\t}\n\t\t\tSystem.out.println(data[i][c]);\n\t\t}\n\t}",
"output",
"{\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(data[i][j]+\" \");\n\t\t\t}\n\t\t\tSystem.out.println(data[i][c]);\n\t\t}\n\t}",
"for(int i=0;i<=r;i++){\n\t\t\tfor(int j=0;j<c;j++){\n\t\t\t\tSystem.out.print(data[i][j]+\" \");\n\t\t\t}\n\t\t\tSystem.out.println(data[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(data[i][j]+\" \");\n\t\t\t}\n\t\t\tSystem.out.println(data[i][c]);\n\t\t}",
"{\n\t\t\tfor(int j=0;j<c;j++){\n\t\t\t\tSystem.out.print(data[i][j]+\" \");\n\t\t\t}\n\t\t\tSystem.out.println(data[i][c]);\n\t\t}",
"for(int j=0;j<c;j++){\n\t\t\t\tSystem.out.print(data[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(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]",
"data",
"i",
"j",
"\" \"",
"System.out.println(data[i][c])",
"System.out.println",
"System.out",
"System",
"System.out",
"data[i][c]",
"data[i]",
"data",
"i",
"c",
"public class Main{\n\tprivate static Scanner sc=new Scanner(System.in);\n\tprivate static int r=sc.nextInt();\n\tprivate static int c=sc.nextInt();\n\tprivate static int[][] data=new int[r+1][c+1];\n\tpublic static void main(String args[]){\n\t\tinput();\n\t\tsetSum();\n\t\toutput();\n\t}\n\tprivate static void input(){\n\t\tfor(int i=0;i<r;i++){\n\t\t\tfor(int j=0;j<c;j++){\n\t\t\t\tdata[i][j]=sc.nextInt();\n\t\t\t}\n\t\t}\n\t}\n\tprivate static void setSum(){\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\tsum+=data[i][j];\n\t\t\t}\n\t\t\tdata[i][c]=sum;\n\t\t}\n\t\tfor(int j=0;j<c+1;j++){\n\t\t\tint sum=0;\n\t\t\tfor(int i=0;i<r;i++){\n\t\t\t\tsum+=data[i][j];\n\t\t\t}\n\t\t\tdata[r][j]=sum;\n\t\t}\n\t}\n\tprivate static void output(){\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(data[i][j]+\" \");\n\t\t\t}\n\t\t\tSystem.out.println(data[i][c]);\n\t\t}\n\t}\n}",
"public class Main{\n\tprivate static Scanner sc=new Scanner(System.in);\n\tprivate static int r=sc.nextInt();\n\tprivate static int c=sc.nextInt();\n\tprivate static int[][] data=new int[r+1][c+1];\n\tpublic static void main(String args[]){\n\t\tinput();\n\t\tsetSum();\n\t\toutput();\n\t}\n\tprivate static void input(){\n\t\tfor(int i=0;i<r;i++){\n\t\t\tfor(int j=0;j<c;j++){\n\t\t\t\tdata[i][j]=sc.nextInt();\n\t\t\t}\n\t\t}\n\t}\n\tprivate static void setSum(){\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\tsum+=data[i][j];\n\t\t\t}\n\t\t\tdata[i][c]=sum;\n\t\t}\n\t\tfor(int j=0;j<c+1;j++){\n\t\t\tint sum=0;\n\t\t\tfor(int i=0;i<r;i++){\n\t\t\t\tsum+=data[i][j];\n\t\t\t}\n\t\t\tdata[r][j]=sum;\n\t\t}\n\t}\n\tprivate static void output(){\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(data[i][j]+\" \");\n\t\t\t}\n\t\t\tSystem.out.println(data[i][c]);\n\t\t}\n\t}\n}",
"Main"
] | import java.util.Scanner;
public class Main{
private static Scanner sc=new Scanner(System.in);
private static int r=sc.nextInt();
private static int c=sc.nextInt();
private static int[][] data=new int[r+1][c+1];
public static void main(String args[]){
input();
setSum();
output();
}
private static void input(){
for(int i=0;i<r;i++){
for(int j=0;j<c;j++){
data[i][j]=sc.nextInt();
}
}
}
private static void setSum(){
for(int i=0;i<r;i++){
int sum=0;
for(int j=0;j<c;j++){
sum+=data[i][j];
}
data[i][c]=sum;
}
for(int j=0;j<c+1;j++){
int sum=0;
for(int i=0;i<r;i++){
sum+=data[i][j];
}
data[r][j]=sum;
}
}
private static void output(){
for(int i=0;i<=r;i++){
for(int j=0;j<c;j++){
System.out.print(data[i][j]+" ");
}
System.out.println(data[i][c]);
}
}
} |
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
41,
13,
20,
2,
13,
17,
2,
13,
17,
11,
1,
41,
13,
17,
2,
13,
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,
2,
13,
17,
1,
40,
13,
30,
30,
14,
2,
13,
13,
30,
0,
13,
18,
18,
13,
13,
13,
30,
0,
18,
18,
13,
13,
13,
13,
11,
1,
41,
13,
17,
2,
13,
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,
0,
13,
18,
18,
13,
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,
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
],
[
231,
5
],
[
231,
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
],
[
79,
81
],
[
78,
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
],
[
104,
105
],
[
105,
106
],
[
105,
107
],
[
104,
108
],
[
97,
109
],
[
109,
110
],
[
110,
111
],
[
111,
112
],
[
112,
113
],
[
112,
114
],
[
111,
115
],
[
110,
116
],
[
8,
117
],
[
117,
118
],
[
118,
119
],
[
119,
120
],
[
119,
121
],
[
117,
122
],
[
122,
123
],
[
122,
124
],
[
124,
125
],
[
124,
126
],
[
117,
127
],
[
127,
128
],
[
128,
129
],
[
117,
130
],
[
131,
131
],
[
131,
132
],
[
132,
133
],
[
132,
134
],
[
131,
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
],
[
155,
157
],
[
157,
158
],
[
158,
159
],
[
158,
160
],
[
157,
161
],
[
150,
162
],
[
162,
163
],
[
163,
164
],
[
164,
165
],
[
165,
166
],
[
165,
167
],
[
164,
168
],
[
163,
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
],
[
192,
193
],
[
192,
194
],
[
185,
195
],
[
195,
196
],
[
196,
197
],
[
185,
198
],
[
199,
199
],
[
199,
200
],
[
200,
201
],
[
201,
202
],
[
201,
203
],
[
200,
204
],
[
204,
205
],
[
205,
206
],
[
206,
207
],
[
207,
208
],
[
207,
209
],
[
205,
210
],
[
205,
211
],
[
211,
212
],
[
212,
213
],
[
212,
214
],
[
211,
215
],
[
200,
216
],
[
216,
217
],
[
217,
218
],
[
218,
219
],
[
219,
220
],
[
219,
221
],
[
217,
222
],
[
217,
223
],
[
223,
224
],
[
224,
225
],
[
224,
226
],
[
223,
227
],
[
6,
228
],
[
228,
229
],
[
0,
230
],
[
230,
231
],
[
230,
232
]
] | [
"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[][] su = new int[r+1][c+1];\n \n for (int i = 0; i < r; i++) {\n for (int j = 0; j < c; j++) {\n su[i][j] = sc.nextInt();\n }\n }\n \n for (int i = 0; i < r; i++) {\n int tmp = 0;\n \n for (int j = 0; j < c + 1; j++) {\n if (j != c) {\n tmp += su[i][j]; \n }\n else {\n su[i][j] = tmp;\n }\n }\n }\n \n for (int i = 0; i < c + 1; i++) {\n int tmp = 0;\n \n for (int j = 0; j < r + 1; j++) {\n if (j != r) {\n tmp += su[j][i];\n }\n else {\n su[j][i] = tmp;\n }\n }\n }\n \n for (int i = 0; i < r + 1; i++) {\n for (int j = 0; j < c + 1; j++) {\n if (j != c) {\n System.out.printf(\"%d \", su[i][j]);\n }\n else {\n System.out.printf(\"%d\\n\", su[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 = sc.nextInt();\n int c = sc.nextInt();\n \n int[][] su = new int[r+1][c+1];\n \n for (int i = 0; i < r; i++) {\n for (int j = 0; j < c; j++) {\n su[i][j] = sc.nextInt();\n }\n }\n \n for (int i = 0; i < r; i++) {\n int tmp = 0;\n \n for (int j = 0; j < c + 1; j++) {\n if (j != c) {\n tmp += su[i][j]; \n }\n else {\n su[i][j] = tmp;\n }\n }\n }\n \n for (int i = 0; i < c + 1; i++) {\n int tmp = 0;\n \n for (int j = 0; j < r + 1; j++) {\n if (j != r) {\n tmp += su[j][i];\n }\n else {\n su[j][i] = tmp;\n }\n }\n }\n \n for (int i = 0; i < r + 1; i++) {\n for (int j = 0; j < c + 1; j++) {\n if (j != c) {\n System.out.printf(\"%d \", su[i][j]);\n }\n else {\n System.out.printf(\"%d\\n\", su[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 = sc.nextInt();\n int c = sc.nextInt();\n \n int[][] su = new int[r+1][c+1];\n \n for (int i = 0; i < r; i++) {\n for (int j = 0; j < c; j++) {\n su[i][j] = sc.nextInt();\n }\n }\n \n for (int i = 0; i < r; i++) {\n int tmp = 0;\n \n for (int j = 0; j < c + 1; j++) {\n if (j != c) {\n tmp += su[i][j]; \n }\n else {\n su[i][j] = tmp;\n }\n }\n }\n \n for (int i = 0; i < c + 1; i++) {\n int tmp = 0;\n \n for (int j = 0; j < r + 1; j++) {\n if (j != r) {\n tmp += su[j][i];\n }\n else {\n su[j][i] = tmp;\n }\n }\n }\n \n for (int i = 0; i < r + 1; i++) {\n for (int j = 0; j < c + 1; j++) {\n if (j != c) {\n System.out.printf(\"%d \", su[i][j]);\n }\n else {\n System.out.printf(\"%d\\n\", su[i][j]);\n }\n }\n }\n }",
"main",
"{\n Scanner sc = new Scanner(System.in);\n \n int r = sc.nextInt();\n int c = sc.nextInt();\n \n int[][] su = new int[r+1][c+1];\n \n for (int i = 0; i < r; i++) {\n for (int j = 0; j < c; j++) {\n su[i][j] = sc.nextInt();\n }\n }\n \n for (int i = 0; i < r; i++) {\n int tmp = 0;\n \n for (int j = 0; j < c + 1; j++) {\n if (j != c) {\n tmp += su[i][j]; \n }\n else {\n su[i][j] = tmp;\n }\n }\n }\n \n for (int i = 0; i < c + 1; i++) {\n int tmp = 0;\n \n for (int j = 0; j < r + 1; j++) {\n if (j != r) {\n tmp += su[j][i];\n }\n else {\n su[j][i] = tmp;\n }\n }\n }\n \n for (int i = 0; i < r + 1; i++) {\n for (int j = 0; j < c + 1; j++) {\n if (j != c) {\n System.out.printf(\"%d \", su[i][j]);\n }\n else {\n System.out.printf(\"%d\\n\", su[i][j]);\n }\n }\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[][] su = new int[r+1][c+1];",
"su",
"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 su[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 su[i][j] = sc.nextInt();\n }\n }",
"{\n for (int j = 0; j < c; j++) {\n su[i][j] = sc.nextInt();\n }\n }",
"for (int j = 0; j < c; j++) {\n su[i][j] = sc.nextInt();\n }",
"int j = 0;",
"int j = 0;",
"j",
"0",
"j < c",
"j",
"c",
"j++",
"j++",
"j",
"{\n su[i][j] = sc.nextInt();\n }",
"{\n su[i][j] = sc.nextInt();\n }",
"su[i][j] = sc.nextInt()",
"su[i][j]",
"su[i]",
"su",
"i",
"j",
"sc.nextInt()",
"sc.nextInt",
"sc",
"for (int i = 0; i < r; i++) {\n int tmp = 0;\n \n for (int j = 0; j < c + 1; j++) {\n if (j != c) {\n tmp += su[i][j]; \n }\n else {\n su[i][j] = tmp;\n }\n }\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < r",
"i",
"r",
"i++",
"i++",
"i",
"{\n int tmp = 0;\n \n for (int j = 0; j < c + 1; j++) {\n if (j != c) {\n tmp += su[i][j]; \n }\n else {\n su[i][j] = tmp;\n }\n }\n }",
"{\n int tmp = 0;\n \n for (int j = 0; j < c + 1; j++) {\n if (j != c) {\n tmp += su[i][j]; \n }\n else {\n su[i][j] = tmp;\n }\n }\n }",
"int tmp = 0;",
"tmp",
"0",
"for (int j = 0; j < c + 1; j++) {\n if (j != c) {\n tmp += su[i][j]; \n }\n else {\n su[i][j] = tmp;\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 tmp += su[i][j]; \n }\n else {\n su[i][j] = tmp;\n }\n }",
"{\n if (j != c) {\n tmp += su[i][j]; \n }\n else {\n su[i][j] = tmp;\n }\n }",
"if (j != c) {\n tmp += su[i][j]; \n }\n else {\n su[i][j] = tmp;\n }",
"j != c",
"j",
"c",
"{\n tmp += su[i][j]; \n }",
"tmp += su[i][j]",
"tmp",
"su[i][j]",
"su[i]",
"su",
"i",
"j",
"{\n su[i][j] = tmp;\n }",
"su[i][j] = tmp",
"su[i][j]",
"su[i]",
"su",
"i",
"j",
"tmp",
"for (int i = 0; i < c + 1; i++) {\n int tmp = 0;\n \n for (int j = 0; j < r + 1; j++) {\n if (j != r) {\n tmp += su[j][i];\n }\n else {\n su[j][i] = tmp;\n }\n }\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < c + 1",
"i",
"c + 1",
"c",
"1",
"i++",
"i++",
"i",
"{\n int tmp = 0;\n \n for (int j = 0; j < r + 1; j++) {\n if (j != r) {\n tmp += su[j][i];\n }\n else {\n su[j][i] = tmp;\n }\n }\n }",
"{\n int tmp = 0;\n \n for (int j = 0; j < r + 1; j++) {\n if (j != r) {\n tmp += su[j][i];\n }\n else {\n su[j][i] = tmp;\n }\n }\n }",
"int tmp = 0;",
"tmp",
"0",
"for (int j = 0; j < r + 1; j++) {\n if (j != r) {\n tmp += su[j][i];\n }\n else {\n su[j][i] = tmp;\n }\n }",
"int j = 0;",
"int j = 0;",
"j",
"0",
"j < r + 1",
"j",
"r + 1",
"r",
"1",
"j++",
"j++",
"j",
"{\n if (j != r) {\n tmp += su[j][i];\n }\n else {\n su[j][i] = tmp;\n }\n }",
"{\n if (j != r) {\n tmp += su[j][i];\n }\n else {\n su[j][i] = tmp;\n }\n }",
"if (j != r) {\n tmp += su[j][i];\n }\n else {\n su[j][i] = tmp;\n }",
"j != r",
"j",
"r",
"{\n tmp += su[j][i];\n }",
"tmp += su[j][i]",
"tmp",
"su[j][i]",
"su[j]",
"su",
"j",
"i",
"{\n su[j][i] = tmp;\n }",
"su[j][i] = tmp",
"su[j][i]",
"su[j]",
"su",
"j",
"i",
"tmp",
"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 \", su[i][j]);\n }\n else {\n System.out.printf(\"%d\\n\", su[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 \", su[i][j]);\n }\n else {\n System.out.printf(\"%d\\n\", su[i][j]);\n }\n }\n }",
"{\n for (int j = 0; j < c + 1; j++) {\n if (j != c) {\n System.out.printf(\"%d \", su[i][j]);\n }\n else {\n System.out.printf(\"%d\\n\", su[i][j]);\n }\n }\n }",
"for (int j = 0; j < c + 1; j++) {\n if (j != c) {\n System.out.printf(\"%d \", su[i][j]);\n }\n else {\n System.out.printf(\"%d\\n\", su[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 \", su[i][j]);\n }\n else {\n System.out.printf(\"%d\\n\", su[i][j]);\n }\n }",
"{\n if (j != c) {\n System.out.printf(\"%d \", su[i][j]);\n }\n else {\n System.out.printf(\"%d\\n\", su[i][j]);\n }\n }",
"if (j != c) {\n System.out.printf(\"%d \", su[i][j]);\n }\n else {\n System.out.printf(\"%d\\n\", su[i][j]);\n }",
"j != c",
"j",
"c",
"{\n System.out.printf(\"%d \", su[i][j]);\n }",
"System.out.printf(\"%d \", su[i][j])",
"System.out.printf",
"System.out",
"System",
"System.out",
"\"%d \"",
"su[i][j]",
"su[i]",
"su",
"i",
"j",
"{\n System.out.printf(\"%d\\n\", su[i][j]);\n }",
"System.out.printf(\"%d\\n\", su[i][j])",
"System.out.printf",
"System.out",
"System",
"System.out",
"\"%d\\n\"",
"su[i][j]",
"su[i]",
"su",
"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 = sc.nextInt();\n int c = sc.nextInt();\n \n int[][] su = new int[r+1][c+1];\n \n for (int i = 0; i < r; i++) {\n for (int j = 0; j < c; j++) {\n su[i][j] = sc.nextInt();\n }\n }\n \n for (int i = 0; i < r; i++) {\n int tmp = 0;\n \n for (int j = 0; j < c + 1; j++) {\n if (j != c) {\n tmp += su[i][j]; \n }\n else {\n su[i][j] = tmp;\n }\n }\n }\n \n for (int i = 0; i < c + 1; i++) {\n int tmp = 0;\n \n for (int j = 0; j < r + 1; j++) {\n if (j != r) {\n tmp += su[j][i];\n }\n else {\n su[j][i] = tmp;\n }\n }\n }\n \n for (int i = 0; i < r + 1; i++) {\n for (int j = 0; j < c + 1; j++) {\n if (j != c) {\n System.out.printf(\"%d \", su[i][j]);\n }\n else {\n System.out.printf(\"%d\\n\", su[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 = sc.nextInt();\n int c = sc.nextInt();\n \n int[][] su = new int[r+1][c+1];\n \n for (int i = 0; i < r; i++) {\n for (int j = 0; j < c; j++) {\n su[i][j] = sc.nextInt();\n }\n }\n \n for (int i = 0; i < r; i++) {\n int tmp = 0;\n \n for (int j = 0; j < c + 1; j++) {\n if (j != c) {\n tmp += su[i][j]; \n }\n else {\n su[i][j] = tmp;\n }\n }\n }\n \n for (int i = 0; i < c + 1; i++) {\n int tmp = 0;\n \n for (int j = 0; j < r + 1; j++) {\n if (j != r) {\n tmp += su[j][i];\n }\n else {\n su[j][i] = tmp;\n }\n }\n }\n \n for (int i = 0; i < r + 1; i++) {\n for (int j = 0; j < c + 1; j++) {\n if (j != c) {\n System.out.printf(\"%d \", su[i][j]);\n }\n else {\n System.out.printf(\"%d\\n\", su[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 = sc.nextInt();
int c = sc.nextInt();
int[][] su = new int[r+1][c+1];
for (int i = 0; i < r; i++) {
for (int j = 0; j < c; j++) {
su[i][j] = sc.nextInt();
}
}
for (int i = 0; i < r; i++) {
int tmp = 0;
for (int j = 0; j < c + 1; j++) {
if (j != c) {
tmp += su[i][j];
}
else {
su[i][j] = tmp;
}
}
}
for (int i = 0; i < c + 1; i++) {
int tmp = 0;
for (int j = 0; j < r + 1; j++) {
if (j != r) {
tmp += su[j][i];
}
else {
su[j][i] = tmp;
}
}
}
for (int i = 0; i < r + 1; i++) {
for (int j = 0; j < c + 1; j++) {
if (j != c) {
System.out.printf("%d ", su[i][j]);
}
else {
System.out.printf("%d\n", su[i][j]);
}
}
}
}
}
|
[
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,
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,
4,
18,
13,
0,
18,
13,
13,
18,
18,
13,
13,
13,
0,
18,
13,
13,
18,
18,
13,
13,
13,
0,
13,
18,
18,
13,
13,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
4,
18,
18,
13,
13,
2,
18,
18,
13,
13,
13,
17,
4,
18,
18,
13,
13,
18,
13,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
4,
18,
18,
13,
13,
2,
18,
13,
13,
17,
4,
18,
18,
13,
13,
2,
13,
17,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
186,
5
],
[
186,
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
],
[
8,
33
],
[
33,
34
],
[
33,
35
],
[
8,
37
],
[
37,
38
],
[
37,
39
],
[
8,
41
],
[
41,
42
],
[
41,
43
],
[
8,
44
],
[
44,
45
],
[
45,
46
],
[
46,
47
],
[
46,
48
],
[
44,
49
],
[
49,
50
],
[
49,
51
],
[
44,
52
],
[
52,
53
],
[
53,
54
],
[
44,
55
],
[
56,
56
],
[
56,
57
],
[
57,
58
],
[
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
],
[
71,
75
],
[
70,
76
],
[
76,
77
],
[
77,
78
],
[
76,
79
],
[
79,
80
],
[
80,
81
],
[
69,
82
],
[
82,
83
],
[
83,
84
],
[
83,
85
],
[
82,
86
],
[
86,
87
],
[
87,
88
],
[
87,
89
],
[
86,
90
],
[
69,
91
],
[
91,
92
],
[
92,
93
],
[
92,
94
],
[
91,
95
],
[
95,
96
],
[
96,
97
],
[
96,
98
],
[
95,
99
],
[
69,
100
],
[
100,
101
],
[
100,
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
],
[
107,
115
],
[
115,
116
],
[
116,
117
],
[
107,
118
],
[
119,
119
],
[
119,
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
],
[
119,
145
],
[
145,
146
],
[
146,
147
],
[
147,
148
],
[
147,
149
],
[
145,
150
],
[
150,
151
],
[
150,
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
],
[
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
],
[
180,
181
],
[
180,
182
],
[
6,
183
],
[
183,
184
],
[
0,
185
],
[
185,
186
],
[
185,
187
]
] | [
"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 a = Integer.parseInt(scan.next());\n\t\tint b = Integer.parseInt(scan.next());\n\t\tint[][] c= new int[a][b];\n\t\tint[] asum = new int[b];\n\t\tint[] bsum = new int[a];\n\t\tint sumall = 0;\n\t\tfor(int i=0;i<a;i++){\n\t\t\tfor(int j=0;j<b;j++){\n\t\t\t\tc[i][j]=Integer.parseInt(scan.next());\n\t\t\t\tasum[j]+=c[i][j];\n\t\t\t\tbsum[i]+=c[i][j];\n\t\t\t\tsumall+=c[i][j];\n\t\t\t}\n\t\t}\n\t\tfor(int i=0;i<a;i++){\n\t\t\tfor(int j=0;j<b;j++){\n\t\t\t\tSystem.out.print(c[i][j]+\" \");\n\t\t\t}\n\t\t\tSystem.out.println(bsum[i]);\n\t\t}\n\t\tfor(int i=0;i<b;i++) \n\t\t\tSystem.out.print(asum[i]+\" \");\n\t\tSystem.out.print(sumall+\"\\r\\n\");\n\t}\t\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n\tpublic static void main(String[] args) {\n\t\tScanner scan = new Scanner(System.in);\n\t\tint a = Integer.parseInt(scan.next());\n\t\tint b = Integer.parseInt(scan.next());\n\t\tint[][] c= new int[a][b];\n\t\tint[] asum = new int[b];\n\t\tint[] bsum = new int[a];\n\t\tint sumall = 0;\n\t\tfor(int i=0;i<a;i++){\n\t\t\tfor(int j=0;j<b;j++){\n\t\t\t\tc[i][j]=Integer.parseInt(scan.next());\n\t\t\t\tasum[j]+=c[i][j];\n\t\t\t\tbsum[i]+=c[i][j];\n\t\t\t\tsumall+=c[i][j];\n\t\t\t}\n\t\t}\n\t\tfor(int i=0;i<a;i++){\n\t\t\tfor(int j=0;j<b;j++){\n\t\t\t\tSystem.out.print(c[i][j]+\" \");\n\t\t\t}\n\t\t\tSystem.out.println(bsum[i]);\n\t\t}\n\t\tfor(int i=0;i<b;i++) \n\t\t\tSystem.out.print(asum[i]+\" \");\n\t\tSystem.out.print(sumall+\"\\r\\n\");\n\t}\t\n}",
"Main",
"public static void main(String[] args) {\n\t\tScanner scan = new Scanner(System.in);\n\t\tint a = Integer.parseInt(scan.next());\n\t\tint b = Integer.parseInt(scan.next());\n\t\tint[][] c= new int[a][b];\n\t\tint[] asum = new int[b];\n\t\tint[] bsum = new int[a];\n\t\tint sumall = 0;\n\t\tfor(int i=0;i<a;i++){\n\t\t\tfor(int j=0;j<b;j++){\n\t\t\t\tc[i][j]=Integer.parseInt(scan.next());\n\t\t\t\tasum[j]+=c[i][j];\n\t\t\t\tbsum[i]+=c[i][j];\n\t\t\t\tsumall+=c[i][j];\n\t\t\t}\n\t\t}\n\t\tfor(int i=0;i<a;i++){\n\t\t\tfor(int j=0;j<b;j++){\n\t\t\t\tSystem.out.print(c[i][j]+\" \");\n\t\t\t}\n\t\t\tSystem.out.println(bsum[i]);\n\t\t}\n\t\tfor(int i=0;i<b;i++) \n\t\t\tSystem.out.print(asum[i]+\" \");\n\t\tSystem.out.print(sumall+\"\\r\\n\");\n\t}",
"main",
"{\n\t\tScanner scan = new Scanner(System.in);\n\t\tint a = Integer.parseInt(scan.next());\n\t\tint b = Integer.parseInt(scan.next());\n\t\tint[][] c= new int[a][b];\n\t\tint[] asum = new int[b];\n\t\tint[] bsum = new int[a];\n\t\tint sumall = 0;\n\t\tfor(int i=0;i<a;i++){\n\t\t\tfor(int j=0;j<b;j++){\n\t\t\t\tc[i][j]=Integer.parseInt(scan.next());\n\t\t\t\tasum[j]+=c[i][j];\n\t\t\t\tbsum[i]+=c[i][j];\n\t\t\t\tsumall+=c[i][j];\n\t\t\t}\n\t\t}\n\t\tfor(int i=0;i<a;i++){\n\t\t\tfor(int j=0;j<b;j++){\n\t\t\t\tSystem.out.print(c[i][j]+\" \");\n\t\t\t}\n\t\t\tSystem.out.println(bsum[i]);\n\t\t}\n\t\tfor(int i=0;i<b;i++) \n\t\t\tSystem.out.print(asum[i]+\" \");\n\t\tSystem.out.print(sumall+\"\\r\\n\");\n\t}",
"Scanner scan = new Scanner(System.in);",
"scan",
"new Scanner(System.in)",
"int a = Integer.parseInt(scan.next());",
"a",
"Integer.parseInt(scan.next())",
"Integer.parseInt",
"Integer",
"scan.next()",
"scan.next",
"scan",
"int b = Integer.parseInt(scan.next());",
"b",
"Integer.parseInt(scan.next())",
"Integer.parseInt",
"Integer",
"scan.next()",
"scan.next",
"scan",
"int[][] c= new int[a][b];",
"c",
"new int[a][b]",
"a",
"b",
"int[] asum = new int[b];",
"asum",
"new int[b]",
"b",
"int[] bsum = new int[a];",
"bsum",
"new int[a]",
"a",
"int sumall = 0;",
"sumall",
"0",
"for(int i=0;i<a;i++){\n\t\t\tfor(int j=0;j<b;j++){\n\t\t\t\tc[i][j]=Integer.parseInt(scan.next());\n\t\t\t\tasum[j]+=c[i][j];\n\t\t\t\tbsum[i]+=c[i][j];\n\t\t\t\tsumall+=c[i][j];\n\t\t\t}\n\t\t}",
"int i=0;",
"int i=0;",
"i",
"0",
"i<a",
"i",
"a",
"i++",
"i++",
"i",
"{\n\t\t\tfor(int j=0;j<b;j++){\n\t\t\t\tc[i][j]=Integer.parseInt(scan.next());\n\t\t\t\tasum[j]+=c[i][j];\n\t\t\t\tbsum[i]+=c[i][j];\n\t\t\t\tsumall+=c[i][j];\n\t\t\t}\n\t\t}",
"{\n\t\t\tfor(int j=0;j<b;j++){\n\t\t\t\tc[i][j]=Integer.parseInt(scan.next());\n\t\t\t\tasum[j]+=c[i][j];\n\t\t\t\tbsum[i]+=c[i][j];\n\t\t\t\tsumall+=c[i][j];\n\t\t\t}\n\t\t}",
"for(int j=0;j<b;j++){\n\t\t\t\tc[i][j]=Integer.parseInt(scan.next());\n\t\t\t\tasum[j]+=c[i][j];\n\t\t\t\tbsum[i]+=c[i][j];\n\t\t\t\tsumall+=c[i][j];\n\t\t\t}",
"int j=0;",
"int j=0;",
"j",
"0",
"j<b",
"j",
"b",
"j++",
"j++",
"j",
"{\n\t\t\t\tc[i][j]=Integer.parseInt(scan.next());\n\t\t\t\tasum[j]+=c[i][j];\n\t\t\t\tbsum[i]+=c[i][j];\n\t\t\t\tsumall+=c[i][j];\n\t\t\t}",
"{\n\t\t\t\tc[i][j]=Integer.parseInt(scan.next());\n\t\t\t\tasum[j]+=c[i][j];\n\t\t\t\tbsum[i]+=c[i][j];\n\t\t\t\tsumall+=c[i][j];\n\t\t\t}",
"c[i][j]=Integer.parseInt(scan.next())",
"c[i][j]",
"c[i]",
"c",
"i",
"j",
"Integer.parseInt(scan.next())",
"Integer.parseInt",
"Integer",
"scan.next()",
"scan.next",
"scan",
"asum[j]+=c[i][j]",
"asum[j]",
"asum",
"j",
"c[i][j]",
"c[i]",
"c",
"i",
"j",
"bsum[i]+=c[i][j]",
"bsum[i]",
"bsum",
"i",
"c[i][j]",
"c[i]",
"c",
"i",
"j",
"sumall+=c[i][j]",
"sumall",
"c[i][j]",
"c[i]",
"c",
"i",
"j",
"for(int i=0;i<a;i++){\n\t\t\tfor(int j=0;j<b;j++){\n\t\t\t\tSystem.out.print(c[i][j]+\" \");\n\t\t\t}\n\t\t\tSystem.out.println(bsum[i]);\n\t\t}",
"int i=0;",
"int i=0;",
"i",
"0",
"i<a",
"i",
"a",
"i++",
"i++",
"i",
"{\n\t\t\tfor(int j=0;j<b;j++){\n\t\t\t\tSystem.out.print(c[i][j]+\" \");\n\t\t\t}\n\t\t\tSystem.out.println(bsum[i]);\n\t\t}",
"{\n\t\t\tfor(int j=0;j<b;j++){\n\t\t\t\tSystem.out.print(c[i][j]+\" \");\n\t\t\t}\n\t\t\tSystem.out.println(bsum[i]);\n\t\t}",
"for(int j=0;j<b;j++){\n\t\t\t\tSystem.out.print(c[i][j]+\" \");\n\t\t\t}",
"int j=0;",
"int j=0;",
"j",
"0",
"j<b",
"j",
"b",
"j++",
"j++",
"j",
"{\n\t\t\t\tSystem.out.print(c[i][j]+\" \");\n\t\t\t}",
"{\n\t\t\t\tSystem.out.print(c[i][j]+\" \");\n\t\t\t}",
"System.out.print(c[i][j]+\" \")",
"System.out.print",
"System.out",
"System",
"System.out",
"c[i][j]+\" \"",
"c[i][j]",
"c[i]",
"c",
"i",
"j",
"\" \"",
"System.out.println(bsum[i])",
"System.out.println",
"System.out",
"System",
"System.out",
"bsum[i]",
"bsum",
"i",
"for(int i=0;i<b;i++) \n\t\t\tSystem.out.print(asum[i]+\" \");",
"int i=0;",
"int i=0;",
"i",
"0",
"i<b",
"i",
"b",
"i++",
"i++",
"i",
"System.out.print(asum[i]+\" \");",
"System.out.print(asum[i]+\" \")",
"System.out.print",
"System.out",
"System",
"System.out",
"asum[i]+\" \"",
"asum[i]",
"asum",
"i",
"\" \"",
"System.out.print(sumall+\"\\r\\n\")",
"System.out.print",
"System.out",
"System",
"System.out",
"sumall+\"\\r\\n\"",
"sumall",
"\"\\r\\n\"",
"String[] args",
"args",
"public class Main {\n\tpublic static void main(String[] args) {\n\t\tScanner scan = new Scanner(System.in);\n\t\tint a = Integer.parseInt(scan.next());\n\t\tint b = Integer.parseInt(scan.next());\n\t\tint[][] c= new int[a][b];\n\t\tint[] asum = new int[b];\n\t\tint[] bsum = new int[a];\n\t\tint sumall = 0;\n\t\tfor(int i=0;i<a;i++){\n\t\t\tfor(int j=0;j<b;j++){\n\t\t\t\tc[i][j]=Integer.parseInt(scan.next());\n\t\t\t\tasum[j]+=c[i][j];\n\t\t\t\tbsum[i]+=c[i][j];\n\t\t\t\tsumall+=c[i][j];\n\t\t\t}\n\t\t}\n\t\tfor(int i=0;i<a;i++){\n\t\t\tfor(int j=0;j<b;j++){\n\t\t\t\tSystem.out.print(c[i][j]+\" \");\n\t\t\t}\n\t\t\tSystem.out.println(bsum[i]);\n\t\t}\n\t\tfor(int i=0;i<b;i++) \n\t\t\tSystem.out.print(asum[i]+\" \");\n\t\tSystem.out.print(sumall+\"\\r\\n\");\n\t}\t\n}",
"public class Main {\n\tpublic static void main(String[] args) {\n\t\tScanner scan = new Scanner(System.in);\n\t\tint a = Integer.parseInt(scan.next());\n\t\tint b = Integer.parseInt(scan.next());\n\t\tint[][] c= new int[a][b];\n\t\tint[] asum = new int[b];\n\t\tint[] bsum = new int[a];\n\t\tint sumall = 0;\n\t\tfor(int i=0;i<a;i++){\n\t\t\tfor(int j=0;j<b;j++){\n\t\t\t\tc[i][j]=Integer.parseInt(scan.next());\n\t\t\t\tasum[j]+=c[i][j];\n\t\t\t\tbsum[i]+=c[i][j];\n\t\t\t\tsumall+=c[i][j];\n\t\t\t}\n\t\t}\n\t\tfor(int i=0;i<a;i++){\n\t\t\tfor(int j=0;j<b;j++){\n\t\t\t\tSystem.out.print(c[i][j]+\" \");\n\t\t\t}\n\t\t\tSystem.out.println(bsum[i]);\n\t\t}\n\t\tfor(int i=0;i<b;i++) \n\t\t\tSystem.out.print(asum[i]+\" \");\n\t\tSystem.out.print(sumall+\"\\r\\n\");\n\t}\t\n}",
"Main"
] | import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
int a = Integer.parseInt(scan.next());
int b = Integer.parseInt(scan.next());
int[][] c= new int[a][b];
int[] asum = new int[b];
int[] bsum = new int[a];
int sumall = 0;
for(int i=0;i<a;i++){
for(int j=0;j<b;j++){
c[i][j]=Integer.parseInt(scan.next());
asum[j]+=c[i][j];
bsum[i]+=c[i][j];
sumall+=c[i][j];
}
}
for(int i=0;i<a;i++){
for(int j=0;j<b;j++){
System.out.print(c[i][j]+" ");
}
System.out.println(bsum[i]);
}
for(int i=0;i<b;i++)
System.out.print(asum[i]+" ");
System.out.print(sumall+"\r\n");
}
} |
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
41,
13,
20,
2,
2,
13,
17,
2,
13,
17,
11,
1,
41,
13,
17,
2,
13,
2,
13,
13,
1,
40,
13,
30,
30,
0,
18,
13,
13,
4,
18,
13,
41,
13,
17,
41,
13,
17,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
41,
13,
17,
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,
0,
13,
2,
13,
18,
13,
13,
40,
13,
30,
4,
18,
18,
13,
13,
13,
0,
13,
2,
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,
13,
1,
40,
13,
30,
30,
14,
2,
2,
13,
13,
13,
30,
0,
13,
2,
13,
18,
13,
13,
4,
18,
18,
13,
13,
2,
13,
17,
0,
13,
17,
30,
4,
18,
18,
13,
13,
13,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
200,
5
],
[
200,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
8,
17
],
[
17,
18
],
[
17,
19
],
[
19,
20
],
[
20,
21
],
[
8,
22
],
[
22,
23
],
[
22,
24
],
[
25,
26
],
[
26,
27
],
[
26,
28
],
[
25,
29
],
[
29,
30
],
[
29,
31
],
[
8,
32
],
[
32,
33
],
[
33,
34
],
[
34,
35
],
[
34,
36
],
[
32,
37
],
[
37,
38
],
[
37,
39
],
[
39,
40
],
[
39,
41
],
[
32,
42
],
[
42,
43
],
[
43,
44
],
[
32,
45
],
[
46,
46
],
[
46,
47
],
[
47,
48
],
[
48,
49
],
[
48,
50
],
[
47,
51
],
[
51,
52
],
[
52,
53
],
[
8,
54
],
[
54,
55
],
[
54,
56
],
[
8,
57
],
[
57,
58
],
[
57,
59
],
[
8,
60
],
[
60,
61
],
[
60,
62
],
[
8,
63
],
[
63,
64
],
[
64,
65
],
[
65,
66
],
[
65,
67
],
[
63,
68
],
[
68,
69
],
[
68,
70
],
[
63,
71
],
[
71,
72
],
[
72,
73
],
[
63,
74
],
[
75,
75
],
[
75,
76
],
[
76,
77
],
[
76,
78
],
[
75,
79
],
[
79,
80
],
[
80,
81
],
[
81,
82
],
[
81,
83
],
[
79,
84
],
[
84,
85
],
[
84,
86
],
[
86,
87
],
[
86,
88
],
[
79,
89
],
[
89,
90
],
[
90,
91
],
[
79,
92
],
[
93,
93
],
[
93,
94
],
[
94,
95
],
[
95,
96
],
[
95,
97
],
[
94,
98
],
[
98,
99
],
[
99,
100
],
[
100,
101
],
[
101,
102
],
[
101,
103
],
[
99,
104
],
[
104,
105
],
[
105,
106
],
[
105,
107
],
[
104,
108
],
[
98,
109
],
[
109,
110
],
[
109,
111
],
[
111,
112
],
[
111,
113
],
[
113,
114
],
[
113,
115
],
[
98,
116
],
[
116,
117
],
[
94,
118
],
[
118,
119
],
[
119,
120
],
[
120,
121
],
[
121,
122
],
[
121,
123
],
[
119,
124
],
[
118,
125
],
[
125,
126
],
[
125,
127
],
[
127,
128
],
[
127,
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
],
[
146,
148
],
[
145,
149
],
[
149,
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
],
[
167,
168
],
[
167,
169
],
[
166,
170
],
[
165,
171
],
[
171,
172
],
[
172,
173
],
[
172,
174
],
[
174,
175
],
[
174,
176
],
[
176,
177
],
[
176,
178
],
[
149,
179
],
[
179,
180
],
[
180,
181
],
[
181,
182
],
[
181,
183
],
[
179,
184
],
[
184,
185
],
[
184,
186
],
[
149,
187
],
[
187,
188
],
[
187,
189
],
[
145,
190
],
[
190,
191
],
[
191,
192
],
[
192,
193
],
[
193,
194
],
[
193,
195
],
[
191,
196
],
[
6,
197
],
[
197,
198
],
[
0,
199
],
[
199,
200
],
[
199,
201
]
] | [
"import java.util.Scanner;\npublic class Main {\n\tpublic static void main(String[] args){\n\t\tScanner scan = new Scanner(System.in);\n\t\tint r = scan.nextInt();\n\t\tint c = scan.nextInt();\n\t\tint k[] = new int[(r+1)*(c+1)];\n\t\tfor(int a = 0;a<r*c;a++){\n\t\t\tk[a] = scan.nextInt();\n\t\t}\n\t\tint kaunto = 0;\n\t\tint tate = 0;\n\t\tint tateR = 0;\n\t\tfor(int b = 0;b<r;b++){\n\t\t\tint yoko = 0;\n\t\t\tfor(int d = 0;d<(c+1);d++){\n\t\t\t\tif(d != c){\n\t\t\t\t\tSystem.out.print(k[kaunto] + \" \");\n\t\t\t\t\tyoko = yoko + k[kaunto];\n\t\t\t\t\t++kaunto;\n\t\t\t\t}else{\n\t\t\t\t\tSystem.out.println(yoko);\n\t\t\t\t\ttateR = tateR + yoko;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tfor(int e = 0;e<(c+1);e++){\n\t\t\tif(e != c){\n\t\t\t\tfor(int f = 0;f<r*c;f++){\n\t\t\t\t\tif(f % c == e){\n\t\t\t\t\t\ttate = tate + k[f];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tSystem.out.print(tate + \" \");\n\t\t\t\ttate = 0;\n\t\t\t}else{\n\t\t\t\tSystem.out.println(tateR);\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\tint r = scan.nextInt();\n\t\tint c = scan.nextInt();\n\t\tint k[] = new int[(r+1)*(c+1)];\n\t\tfor(int a = 0;a<r*c;a++){\n\t\t\tk[a] = scan.nextInt();\n\t\t}\n\t\tint kaunto = 0;\n\t\tint tate = 0;\n\t\tint tateR = 0;\n\t\tfor(int b = 0;b<r;b++){\n\t\t\tint yoko = 0;\n\t\t\tfor(int d = 0;d<(c+1);d++){\n\t\t\t\tif(d != c){\n\t\t\t\t\tSystem.out.print(k[kaunto] + \" \");\n\t\t\t\t\tyoko = yoko + k[kaunto];\n\t\t\t\t\t++kaunto;\n\t\t\t\t}else{\n\t\t\t\t\tSystem.out.println(yoko);\n\t\t\t\t\ttateR = tateR + yoko;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tfor(int e = 0;e<(c+1);e++){\n\t\t\tif(e != c){\n\t\t\t\tfor(int f = 0;f<r*c;f++){\n\t\t\t\t\tif(f % c == e){\n\t\t\t\t\t\ttate = tate + k[f];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tSystem.out.print(tate + \" \");\n\t\t\t\ttate = 0;\n\t\t\t}else{\n\t\t\t\tSystem.out.println(tateR);\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 r = scan.nextInt();\n\t\tint c = scan.nextInt();\n\t\tint k[] = new int[(r+1)*(c+1)];\n\t\tfor(int a = 0;a<r*c;a++){\n\t\t\tk[a] = scan.nextInt();\n\t\t}\n\t\tint kaunto = 0;\n\t\tint tate = 0;\n\t\tint tateR = 0;\n\t\tfor(int b = 0;b<r;b++){\n\t\t\tint yoko = 0;\n\t\t\tfor(int d = 0;d<(c+1);d++){\n\t\t\t\tif(d != c){\n\t\t\t\t\tSystem.out.print(k[kaunto] + \" \");\n\t\t\t\t\tyoko = yoko + k[kaunto];\n\t\t\t\t\t++kaunto;\n\t\t\t\t}else{\n\t\t\t\t\tSystem.out.println(yoko);\n\t\t\t\t\ttateR = tateR + yoko;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tfor(int e = 0;e<(c+1);e++){\n\t\t\tif(e != c){\n\t\t\t\tfor(int f = 0;f<r*c;f++){\n\t\t\t\t\tif(f % c == e){\n\t\t\t\t\t\ttate = tate + k[f];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tSystem.out.print(tate + \" \");\n\t\t\t\ttate = 0;\n\t\t\t}else{\n\t\t\t\tSystem.out.println(tateR);\n\t\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 k[] = new int[(r+1)*(c+1)];\n\t\tfor(int a = 0;a<r*c;a++){\n\t\t\tk[a] = scan.nextInt();\n\t\t}\n\t\tint kaunto = 0;\n\t\tint tate = 0;\n\t\tint tateR = 0;\n\t\tfor(int b = 0;b<r;b++){\n\t\t\tint yoko = 0;\n\t\t\tfor(int d = 0;d<(c+1);d++){\n\t\t\t\tif(d != c){\n\t\t\t\t\tSystem.out.print(k[kaunto] + \" \");\n\t\t\t\t\tyoko = yoko + k[kaunto];\n\t\t\t\t\t++kaunto;\n\t\t\t\t}else{\n\t\t\t\t\tSystem.out.println(yoko);\n\t\t\t\t\ttateR = tateR + yoko;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tfor(int e = 0;e<(c+1);e++){\n\t\t\tif(e != c){\n\t\t\t\tfor(int f = 0;f<r*c;f++){\n\t\t\t\t\tif(f % c == e){\n\t\t\t\t\t\ttate = tate + k[f];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tSystem.out.print(tate + \" \");\n\t\t\t\ttate = 0;\n\t\t\t}else{\n\t\t\t\tSystem.out.println(tateR);\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 k[] = new int[(r+1)*(c+1)];",
"k",
"new int[(r+1)*(c+1)]",
"(r+1)*(c+1)",
"(r+1)",
"r",
"1",
"(c+1)",
"c",
"1",
"for(int a = 0;a<r*c;a++){\n\t\t\tk[a] = scan.nextInt();\n\t\t}",
"int a = 0;",
"int a = 0;",
"a",
"0",
"a<r*c",
"a",
"r*c",
"r",
"c",
"a++",
"a++",
"a",
"{\n\t\t\tk[a] = scan.nextInt();\n\t\t}",
"{\n\t\t\tk[a] = scan.nextInt();\n\t\t}",
"k[a] = scan.nextInt()",
"k[a]",
"k",
"a",
"scan.nextInt()",
"scan.nextInt",
"scan",
"int kaunto = 0;",
"kaunto",
"0",
"int tate = 0;",
"tate",
"0",
"int tateR = 0;",
"tateR",
"0",
"for(int b = 0;b<r;b++){\n\t\t\tint yoko = 0;\n\t\t\tfor(int d = 0;d<(c+1);d++){\n\t\t\t\tif(d != c){\n\t\t\t\t\tSystem.out.print(k[kaunto] + \" \");\n\t\t\t\t\tyoko = yoko + k[kaunto];\n\t\t\t\t\t++kaunto;\n\t\t\t\t}else{\n\t\t\t\t\tSystem.out.println(yoko);\n\t\t\t\t\ttateR = tateR + yoko;\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"int b = 0;",
"int b = 0;",
"b",
"0",
"b<r",
"b",
"r",
"b++",
"b++",
"b",
"{\n\t\t\tint yoko = 0;\n\t\t\tfor(int d = 0;d<(c+1);d++){\n\t\t\t\tif(d != c){\n\t\t\t\t\tSystem.out.print(k[kaunto] + \" \");\n\t\t\t\t\tyoko = yoko + k[kaunto];\n\t\t\t\t\t++kaunto;\n\t\t\t\t}else{\n\t\t\t\t\tSystem.out.println(yoko);\n\t\t\t\t\ttateR = tateR + yoko;\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"{\n\t\t\tint yoko = 0;\n\t\t\tfor(int d = 0;d<(c+1);d++){\n\t\t\t\tif(d != c){\n\t\t\t\t\tSystem.out.print(k[kaunto] + \" \");\n\t\t\t\t\tyoko = yoko + k[kaunto];\n\t\t\t\t\t++kaunto;\n\t\t\t\t}else{\n\t\t\t\t\tSystem.out.println(yoko);\n\t\t\t\t\ttateR = tateR + yoko;\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"int yoko = 0;",
"yoko",
"0",
"for(int d = 0;d<(c+1);d++){\n\t\t\t\tif(d != c){\n\t\t\t\t\tSystem.out.print(k[kaunto] + \" \");\n\t\t\t\t\tyoko = yoko + k[kaunto];\n\t\t\t\t\t++kaunto;\n\t\t\t\t}else{\n\t\t\t\t\tSystem.out.println(yoko);\n\t\t\t\t\ttateR = tateR + yoko;\n\t\t\t\t}\n\t\t\t}",
"int d = 0;",
"int d = 0;",
"d",
"0",
"d<(c+1)",
"d",
"(c+1)",
"c",
"1",
"d++",
"d++",
"d",
"{\n\t\t\t\tif(d != c){\n\t\t\t\t\tSystem.out.print(k[kaunto] + \" \");\n\t\t\t\t\tyoko = yoko + k[kaunto];\n\t\t\t\t\t++kaunto;\n\t\t\t\t}else{\n\t\t\t\t\tSystem.out.println(yoko);\n\t\t\t\t\ttateR = tateR + yoko;\n\t\t\t\t}\n\t\t\t}",
"{\n\t\t\t\tif(d != c){\n\t\t\t\t\tSystem.out.print(k[kaunto] + \" \");\n\t\t\t\t\tyoko = yoko + k[kaunto];\n\t\t\t\t\t++kaunto;\n\t\t\t\t}else{\n\t\t\t\t\tSystem.out.println(yoko);\n\t\t\t\t\ttateR = tateR + yoko;\n\t\t\t\t}\n\t\t\t}",
"if(d != c){\n\t\t\t\t\tSystem.out.print(k[kaunto] + \" \");\n\t\t\t\t\tyoko = yoko + k[kaunto];\n\t\t\t\t\t++kaunto;\n\t\t\t\t}else{\n\t\t\t\t\tSystem.out.println(yoko);\n\t\t\t\t\ttateR = tateR + yoko;\n\t\t\t\t}",
"d != c",
"d",
"c",
"{\n\t\t\t\t\tSystem.out.print(k[kaunto] + \" \");\n\t\t\t\t\tyoko = yoko + k[kaunto];\n\t\t\t\t\t++kaunto;\n\t\t\t\t}",
"System.out.print(k[kaunto] + \" \")",
"System.out.print",
"System.out",
"System",
"System.out",
"k[kaunto] + \" \"",
"k[kaunto]",
"k",
"kaunto",
"\" \"",
"yoko = yoko + k[kaunto]",
"yoko",
"yoko + k[kaunto]",
"yoko",
"k[kaunto]",
"k",
"kaunto",
"++kaunto",
"kaunto",
"{\n\t\t\t\t\tSystem.out.println(yoko);\n\t\t\t\t\ttateR = tateR + yoko;\n\t\t\t\t}",
"System.out.println(yoko)",
"System.out.println",
"System.out",
"System",
"System.out",
"yoko",
"tateR = tateR + yoko",
"tateR",
"tateR + yoko",
"tateR",
"yoko",
"for(int e = 0;e<(c+1);e++){\n\t\t\tif(e != c){\n\t\t\t\tfor(int f = 0;f<r*c;f++){\n\t\t\t\t\tif(f % c == e){\n\t\t\t\t\t\ttate = tate + k[f];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tSystem.out.print(tate + \" \");\n\t\t\t\ttate = 0;\n\t\t\t}else{\n\t\t\t\tSystem.out.println(tateR);\n\t\t\t}\n\t\t}",
"int e = 0;",
"int e = 0;",
"e",
"0",
"e<(c+1)",
"e",
"(c+1)",
"c",
"1",
"e++",
"e++",
"e",
"{\n\t\t\tif(e != c){\n\t\t\t\tfor(int f = 0;f<r*c;f++){\n\t\t\t\t\tif(f % c == e){\n\t\t\t\t\t\ttate = tate + k[f];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tSystem.out.print(tate + \" \");\n\t\t\t\ttate = 0;\n\t\t\t}else{\n\t\t\t\tSystem.out.println(tateR);\n\t\t\t}\n\t\t}",
"{\n\t\t\tif(e != c){\n\t\t\t\tfor(int f = 0;f<r*c;f++){\n\t\t\t\t\tif(f % c == e){\n\t\t\t\t\t\ttate = tate + k[f];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tSystem.out.print(tate + \" \");\n\t\t\t\ttate = 0;\n\t\t\t}else{\n\t\t\t\tSystem.out.println(tateR);\n\t\t\t}\n\t\t}",
"if(e != c){\n\t\t\t\tfor(int f = 0;f<r*c;f++){\n\t\t\t\t\tif(f % c == e){\n\t\t\t\t\t\ttate = tate + k[f];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tSystem.out.print(tate + \" \");\n\t\t\t\ttate = 0;\n\t\t\t}else{\n\t\t\t\tSystem.out.println(tateR);\n\t\t\t}",
"e != c",
"e",
"c",
"{\n\t\t\t\tfor(int f = 0;f<r*c;f++){\n\t\t\t\t\tif(f % c == e){\n\t\t\t\t\t\ttate = tate + k[f];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tSystem.out.print(tate + \" \");\n\t\t\t\ttate = 0;\n\t\t\t}",
"for(int f = 0;f<r*c;f++){\n\t\t\t\t\tif(f % c == e){\n\t\t\t\t\t\ttate = tate + k[f];\n\t\t\t\t\t}\n\t\t\t\t}",
"int f = 0;",
"int f = 0;",
"f",
"0",
"f<r*c",
"f",
"r*c",
"r",
"c",
"f++",
"f++",
"f",
"{\n\t\t\t\t\tif(f % c == e){\n\t\t\t\t\t\ttate = tate + k[f];\n\t\t\t\t\t}\n\t\t\t\t}",
"{\n\t\t\t\t\tif(f % c == e){\n\t\t\t\t\t\ttate = tate + k[f];\n\t\t\t\t\t}\n\t\t\t\t}",
"if(f % c == e){\n\t\t\t\t\t\ttate = tate + k[f];\n\t\t\t\t\t}",
"f % c == e",
"f % c",
"f",
"c",
"e",
"{\n\t\t\t\t\t\ttate = tate + k[f];\n\t\t\t\t\t}",
"tate = tate + k[f]",
"tate",
"tate + k[f]",
"tate",
"k[f]",
"k",
"f",
"System.out.print(tate + \" \")",
"System.out.print",
"System.out",
"System",
"System.out",
"tate + \" \"",
"tate",
"\" \"",
"tate = 0",
"tate",
"0",
"{\n\t\t\t\tSystem.out.println(tateR);\n\t\t\t}",
"System.out.println(tateR)",
"System.out.println",
"System.out",
"System",
"System.out",
"tateR",
"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 k[] = new int[(r+1)*(c+1)];\n\t\tfor(int a = 0;a<r*c;a++){\n\t\t\tk[a] = scan.nextInt();\n\t\t}\n\t\tint kaunto = 0;\n\t\tint tate = 0;\n\t\tint tateR = 0;\n\t\tfor(int b = 0;b<r;b++){\n\t\t\tint yoko = 0;\n\t\t\tfor(int d = 0;d<(c+1);d++){\n\t\t\t\tif(d != c){\n\t\t\t\t\tSystem.out.print(k[kaunto] + \" \");\n\t\t\t\t\tyoko = yoko + k[kaunto];\n\t\t\t\t\t++kaunto;\n\t\t\t\t}else{\n\t\t\t\t\tSystem.out.println(yoko);\n\t\t\t\t\ttateR = tateR + yoko;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tfor(int e = 0;e<(c+1);e++){\n\t\t\tif(e != c){\n\t\t\t\tfor(int f = 0;f<r*c;f++){\n\t\t\t\t\tif(f % c == e){\n\t\t\t\t\t\ttate = tate + k[f];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tSystem.out.print(tate + \" \");\n\t\t\t\ttate = 0;\n\t\t\t}else{\n\t\t\t\tSystem.out.println(tateR);\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 r = scan.nextInt();\n\t\tint c = scan.nextInt();\n\t\tint k[] = new int[(r+1)*(c+1)];\n\t\tfor(int a = 0;a<r*c;a++){\n\t\t\tk[a] = scan.nextInt();\n\t\t}\n\t\tint kaunto = 0;\n\t\tint tate = 0;\n\t\tint tateR = 0;\n\t\tfor(int b = 0;b<r;b++){\n\t\t\tint yoko = 0;\n\t\t\tfor(int d = 0;d<(c+1);d++){\n\t\t\t\tif(d != c){\n\t\t\t\t\tSystem.out.print(k[kaunto] + \" \");\n\t\t\t\t\tyoko = yoko + k[kaunto];\n\t\t\t\t\t++kaunto;\n\t\t\t\t}else{\n\t\t\t\t\tSystem.out.println(yoko);\n\t\t\t\t\ttateR = tateR + yoko;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tfor(int e = 0;e<(c+1);e++){\n\t\t\tif(e != c){\n\t\t\t\tfor(int f = 0;f<r*c;f++){\n\t\t\t\t\tif(f % c == e){\n\t\t\t\t\t\ttate = tate + k[f];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tSystem.out.print(tate + \" \");\n\t\t\t\ttate = 0;\n\t\t\t}else{\n\t\t\t\tSystem.out.println(tateR);\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 r = scan.nextInt();
int c = scan.nextInt();
int k[] = new int[(r+1)*(c+1)];
for(int a = 0;a<r*c;a++){
k[a] = scan.nextInt();
}
int kaunto = 0;
int tate = 0;
int tateR = 0;
for(int b = 0;b<r;b++){
int yoko = 0;
for(int d = 0;d<(c+1);d++){
if(d != c){
System.out.print(k[kaunto] + " ");
yoko = yoko + k[kaunto];
++kaunto;
}else{
System.out.println(yoko);
tateR = tateR + yoko;
}
}
}
for(int e = 0;e<(c+1);e++){
if(e != c){
for(int f = 0;f<r*c;f++){
if(f % c == e){
tate = tate + k[f];
}
}
System.out.print(tate + " ");
tate = 0;
}else{
System.out.println(tateR);
}
}
}
} |
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
17,
40,
17,
41,
13,
4,
18,
13,
18,
13,
17,
41,
13,
4,
18,
13,
18,
13,
17,
41,
13,
20,
2,
13,
17,
2,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
17,
40,
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,
42,
2,
13,
17,
30,
0,
18,
18,
13,
13,
13,
17,
3,
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,
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,
42,
2,
13,
17,
30,
0,
18,
18,
13,
13,
13,
18,
18,
13,
13,
13,
3,
11,
1,
41,
13,
17,
2,
13,
2,
13,
17,
1,
40,
13,
30,
30,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
4,
18,
18,
13,
13,
2,
18,
18,
13,
13,
13,
17,
4,
18,
18,
13,
13,
18,
18,
13,
13,
13,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
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
],
[
19,
23
],
[
23,
24
],
[
8,
25
],
[
25,
26
],
[
25,
27
],
[
27,
28
],
[
28,
29
],
[
27,
30
],
[
30,
31
],
[
30,
32
],
[
8,
33
],
[
33,
34
],
[
33,
35
],
[
35,
36
],
[
36,
37
],
[
35,
38
],
[
38,
39
],
[
38,
40
],
[
8,
41
],
[
41,
42
],
[
41,
43
],
[
44,
45
],
[
44,
46
],
[
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
],
[
65,
66
],
[
66,
67
],
[
62,
68
],
[
68,
69
],
[
68,
70
],
[
70,
71
],
[
71,
72
],
[
70,
73
],
[
70,
74
],
[
74,
75
],
[
62,
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
],
[
88,
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
],
[
62,
114
],
[
114,
115
],
[
115,
116
],
[
116,
117
],
[
116,
118
],
[
115,
119
],
[
114,
120
],
[
8,
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
],
[
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
],
[
156,
157
],
[
156,
158
],
[
155,
159
],
[
154,
160
],
[
160,
161
],
[
161,
162
],
[
161,
163
],
[
160,
164
],
[
8,
165
],
[
165,
166
],
[
166,
167
],
[
167,
168
],
[
167,
169
],
[
165,
170
],
[
170,
171
],
[
170,
172
],
[
165,
173
],
[
173,
174
],
[
174,
175
],
[
165,
176
],
[
177,
177
],
[
177,
178
],
[
178,
179
],
[
179,
180
],
[
180,
181
],
[
180,
182
],
[
178,
183
],
[
183,
184
],
[
183,
185
],
[
178,
186
],
[
186,
187
],
[
187,
188
],
[
178,
189
],
[
190,
190
],
[
190,
191
],
[
191,
192
],
[
192,
193
],
[
193,
194
],
[
193,
195
],
[
192,
196
],
[
191,
197
],
[
197,
198
],
[
198,
199
],
[
198,
200
],
[
197,
201
],
[
190,
202
],
[
202,
203
],
[
203,
204
],
[
203,
205
],
[
202,
206
],
[
206,
207
],
[
207,
208
],
[
208,
209
],
[
209,
210
],
[
209,
211
],
[
208,
212
],
[
207,
213
],
[
213,
214
],
[
214,
215
],
[
214,
216
],
[
213,
217
],
[
206,
218
],
[
8,
219
],
[
219,
220
],
[
220,
221
],
[
221,
222
],
[
221,
223
],
[
219,
224
],
[
224,
225
],
[
224,
226
],
[
226,
227
],
[
226,
228
],
[
219,
229
],
[
229,
230
],
[
230,
231
],
[
219,
232
],
[
233,
233
],
[
233,
234
],
[
234,
235
],
[
235,
236
],
[
236,
237
],
[
236,
238
],
[
234,
239
],
[
239,
240
],
[
239,
241
],
[
234,
242
],
[
242,
243
],
[
243,
244
],
[
234,
245
],
[
246,
246
],
[
246,
247
],
[
247,
248
],
[
248,
249
],
[
249,
250
],
[
249,
251
],
[
247,
252
],
[
252,
253
],
[
253,
254
],
[
254,
255
],
[
254,
256
],
[
253,
257
],
[
252,
258
],
[
233,
259
],
[
259,
260
],
[
260,
261
],
[
261,
262
],
[
261,
263
],
[
259,
264
],
[
264,
265
],
[
265,
266
],
[
265,
267
],
[
264,
268
],
[
6,
269
],
[
269,
270
],
[
0,
271
],
[
271,
272
],
[
271,
273
]
] | [
"import java.io.*;\npublic class Main {\n\tpublic static void main(String[] args) throws IOException{\n\t\tBufferedReader reader = new BufferedReader(new InputStreamReader(System.in));\n\t\tString line = reader.readLine();\n\t\tString[] sarray = line.split(\" \", -1);\n\t\tint n = Integer.parseInt(sarray[0]);//?????°\n\t\tint m = Integer.parseInt(sarray[1]);//?????°\n\t\tint matrix[][] = new int[n + 1][m + 1];\n\t\tfor(int i = 0; i < n; i++){//?????????????????????\n\t\t\tString str = reader.readLine();\n\t\t\tString[] mat = str.split(\" \", -1);\n\t\t\tfor(int j = 0; j < m; j++){\n\t\t\t\tmatrix[i][j] = Integer.parseInt(mat[j]);\n\t\t\t\twhile(i == 0){\n\t\t\t\t\tmatrix[n][j] = 0;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tmatrix[i][m] = 0;\n\t\t}\n\t\tmatrix[n][m] = 0;\n\t\tfor(int k = 0; k < n; k++){\n\t\t\tfor(int l = 0; l < m; l++){\n\t\t\t\tmatrix[k][m] += matrix[k][l];//??????????¨?\n\t\t\t}\n\t\t}\n\t\tfor(int p = 0; p < m; p++){\n\t\t\tfor(int q = 0; q < n; q++){\n\t\t\t\tmatrix[n][p] += matrix[q][p];//??????????¨?\n\t\t\t\twhile(p == 0){\n\t\t\t\t\tmatrix[n][m] += matrix[q][m];\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tfor(int r = 0; r < n + 1; r++){\n\t\t\tfor(int s = 0; s < m; s++){\n\t\t\t\tSystem.out.print(matrix[r][s] + \" \");\n\t\t\t}\n\t\t\tSystem.out.println(matrix[r][m]);\n\t\t}\n\t}\n}",
"import java.io.*;",
"io.*",
"java",
"public class Main {\n\tpublic static void main(String[] args) throws IOException{\n\t\tBufferedReader reader = new BufferedReader(new InputStreamReader(System.in));\n\t\tString line = reader.readLine();\n\t\tString[] sarray = line.split(\" \", -1);\n\t\tint n = Integer.parseInt(sarray[0]);//?????°\n\t\tint m = Integer.parseInt(sarray[1]);//?????°\n\t\tint matrix[][] = new int[n + 1][m + 1];\n\t\tfor(int i = 0; i < n; i++){//?????????????????????\n\t\t\tString str = reader.readLine();\n\t\t\tString[] mat = str.split(\" \", -1);\n\t\t\tfor(int j = 0; j < m; j++){\n\t\t\t\tmatrix[i][j] = Integer.parseInt(mat[j]);\n\t\t\t\twhile(i == 0){\n\t\t\t\t\tmatrix[n][j] = 0;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tmatrix[i][m] = 0;\n\t\t}\n\t\tmatrix[n][m] = 0;\n\t\tfor(int k = 0; k < n; k++){\n\t\t\tfor(int l = 0; l < m; l++){\n\t\t\t\tmatrix[k][m] += matrix[k][l];//??????????¨?\n\t\t\t}\n\t\t}\n\t\tfor(int p = 0; p < m; p++){\n\t\t\tfor(int q = 0; q < n; q++){\n\t\t\t\tmatrix[n][p] += matrix[q][p];//??????????¨?\n\t\t\t\twhile(p == 0){\n\t\t\t\t\tmatrix[n][m] += matrix[q][m];\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tfor(int r = 0; r < n + 1; r++){\n\t\t\tfor(int s = 0; s < m; s++){\n\t\t\t\tSystem.out.print(matrix[r][s] + \" \");\n\t\t\t}\n\t\t\tSystem.out.println(matrix[r][m]);\n\t\t}\n\t}\n}",
"Main",
"public static void main(String[] args) throws IOException{\n\t\tBufferedReader reader = new BufferedReader(new InputStreamReader(System.in));\n\t\tString line = reader.readLine();\n\t\tString[] sarray = line.split(\" \", -1);\n\t\tint n = Integer.parseInt(sarray[0]);//?????°\n\t\tint m = Integer.parseInt(sarray[1]);//?????°\n\t\tint matrix[][] = new int[n + 1][m + 1];\n\t\tfor(int i = 0; i < n; i++){//?????????????????????\n\t\t\tString str = reader.readLine();\n\t\t\tString[] mat = str.split(\" \", -1);\n\t\t\tfor(int j = 0; j < m; j++){\n\t\t\t\tmatrix[i][j] = Integer.parseInt(mat[j]);\n\t\t\t\twhile(i == 0){\n\t\t\t\t\tmatrix[n][j] = 0;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tmatrix[i][m] = 0;\n\t\t}\n\t\tmatrix[n][m] = 0;\n\t\tfor(int k = 0; k < n; k++){\n\t\t\tfor(int l = 0; l < m; l++){\n\t\t\t\tmatrix[k][m] += matrix[k][l];//??????????¨?\n\t\t\t}\n\t\t}\n\t\tfor(int p = 0; p < m; p++){\n\t\t\tfor(int q = 0; q < n; q++){\n\t\t\t\tmatrix[n][p] += matrix[q][p];//??????????¨?\n\t\t\t\twhile(p == 0){\n\t\t\t\t\tmatrix[n][m] += matrix[q][m];\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tfor(int r = 0; r < n + 1; r++){\n\t\t\tfor(int s = 0; s < m; s++){\n\t\t\t\tSystem.out.print(matrix[r][s] + \" \");\n\t\t\t}\n\t\t\tSystem.out.println(matrix[r][m]);\n\t\t}\n\t}",
"main",
"{\n\t\tBufferedReader reader = new BufferedReader(new InputStreamReader(System.in));\n\t\tString line = reader.readLine();\n\t\tString[] sarray = line.split(\" \", -1);\n\t\tint n = Integer.parseInt(sarray[0]);//?????°\n\t\tint m = Integer.parseInt(sarray[1]);//?????°\n\t\tint matrix[][] = new int[n + 1][m + 1];\n\t\tfor(int i = 0; i < n; i++){//?????????????????????\n\t\t\tString str = reader.readLine();\n\t\t\tString[] mat = str.split(\" \", -1);\n\t\t\tfor(int j = 0; j < m; j++){\n\t\t\t\tmatrix[i][j] = Integer.parseInt(mat[j]);\n\t\t\t\twhile(i == 0){\n\t\t\t\t\tmatrix[n][j] = 0;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tmatrix[i][m] = 0;\n\t\t}\n\t\tmatrix[n][m] = 0;\n\t\tfor(int k = 0; k < n; k++){\n\t\t\tfor(int l = 0; l < m; l++){\n\t\t\t\tmatrix[k][m] += matrix[k][l];//??????????¨?\n\t\t\t}\n\t\t}\n\t\tfor(int p = 0; p < m; p++){\n\t\t\tfor(int q = 0; q < n; q++){\n\t\t\t\tmatrix[n][p] += matrix[q][p];//??????????¨?\n\t\t\t\twhile(p == 0){\n\t\t\t\t\tmatrix[n][m] += matrix[q][m];\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tfor(int r = 0; r < n + 1; r++){\n\t\t\tfor(int s = 0; s < m; s++){\n\t\t\t\tSystem.out.print(matrix[r][s] + \" \");\n\t\t\t}\n\t\t\tSystem.out.println(matrix[r][m]);\n\t\t}\n\t}",
"BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));",
"reader",
"new BufferedReader(new InputStreamReader(System.in))",
"String line = reader.readLine();",
"line",
"reader.readLine()",
"reader.readLine",
"reader",
"String[] sarray = line.split(\" \", -1);",
"sarray",
"line.split(\" \", -1)",
"line.split",
"line",
"\" \"",
"-1",
"1",
"int n = Integer.parseInt(sarray[0]);",
"n",
"Integer.parseInt(sarray[0])",
"Integer.parseInt",
"Integer",
"sarray[0]",
"sarray",
"0",
"int m = Integer.parseInt(sarray[1]);",
"m",
"Integer.parseInt(sarray[1])",
"Integer.parseInt",
"Integer",
"sarray[1]",
"sarray",
"1",
"int matrix[][] = new int[n + 1][m + 1];",
"matrix",
"new int[n + 1][m + 1]",
"n + 1",
"n",
"1",
"m + 1",
"m",
"1",
"for(int i = 0; i < n; i++){//?????????????????????\n\t\t\tString str = reader.readLine();\n\t\t\tString[] mat = str.split(\" \", -1);\n\t\t\tfor(int j = 0; j < m; j++){\n\t\t\t\tmatrix[i][j] = Integer.parseInt(mat[j]);\n\t\t\t\twhile(i == 0){\n\t\t\t\t\tmatrix[n][j] = 0;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tmatrix[i][m] = 0;\n\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < n",
"i",
"n",
"i++",
"i++",
"i",
"{//?????????????????????\n\t\t\tString str = reader.readLine();\n\t\t\tString[] mat = str.split(\" \", -1);\n\t\t\tfor(int j = 0; j < m; j++){\n\t\t\t\tmatrix[i][j] = Integer.parseInt(mat[j]);\n\t\t\t\twhile(i == 0){\n\t\t\t\t\tmatrix[n][j] = 0;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tmatrix[i][m] = 0;\n\t\t}",
"{//?????????????????????\n\t\t\tString str = reader.readLine();\n\t\t\tString[] mat = str.split(\" \", -1);\n\t\t\tfor(int j = 0; j < m; j++){\n\t\t\t\tmatrix[i][j] = Integer.parseInt(mat[j]);\n\t\t\t\twhile(i == 0){\n\t\t\t\t\tmatrix[n][j] = 0;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tmatrix[i][m] = 0;\n\t\t}",
"String str = reader.readLine();",
"str",
"reader.readLine()",
"reader.readLine",
"reader",
"String[] mat = str.split(\" \", -1);",
"mat",
"str.split(\" \", -1)",
"str.split",
"str",
"\" \"",
"-1",
"1",
"for(int j = 0; j < m; j++){\n\t\t\t\tmatrix[i][j] = Integer.parseInt(mat[j]);\n\t\t\t\twhile(i == 0){\n\t\t\t\t\tmatrix[n][j] = 0;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}",
"int j = 0;",
"int j = 0;",
"j",
"0",
"j < m",
"j",
"m",
"j++",
"j++",
"j",
"{\n\t\t\t\tmatrix[i][j] = Integer.parseInt(mat[j]);\n\t\t\t\twhile(i == 0){\n\t\t\t\t\tmatrix[n][j] = 0;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}",
"{\n\t\t\t\tmatrix[i][j] = Integer.parseInt(mat[j]);\n\t\t\t\twhile(i == 0){\n\t\t\t\t\tmatrix[n][j] = 0;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}",
"matrix[i][j] = Integer.parseInt(mat[j])",
"matrix[i][j]",
"matrix[i]",
"matrix",
"i",
"j",
"Integer.parseInt(mat[j])",
"Integer.parseInt",
"Integer",
"mat[j]",
"mat",
"j",
"while(i == 0){\n\t\t\t\t\tmatrix[n][j] = 0;\n\t\t\t\t\tbreak;\n\t\t\t\t}",
"i == 0",
"i",
"0",
"{\n\t\t\t\t\tmatrix[n][j] = 0;\n\t\t\t\t\tbreak;\n\t\t\t\t}",
"matrix[n][j] = 0",
"matrix[n][j]",
"matrix[n]",
"matrix",
"n",
"j",
"0",
"break;",
"matrix[i][m] = 0",
"matrix[i][m]",
"matrix[i]",
"matrix",
"i",
"m",
"0",
"matrix[n][m] = 0",
"matrix[n][m]",
"matrix[n]",
"matrix",
"n",
"m",
"0",
"for(int k = 0; k < n; k++){\n\t\t\tfor(int l = 0; l < m; l++){\n\t\t\t\tmatrix[k][m] += matrix[k][l];//??????????¨?\n\t\t\t}\n\t\t}",
"int k = 0;",
"int k = 0;",
"k",
"0",
"k < n",
"k",
"n",
"k++",
"k++",
"k",
"{\n\t\t\tfor(int l = 0; l < m; l++){\n\t\t\t\tmatrix[k][m] += matrix[k][l];//??????????¨?\n\t\t\t}\n\t\t}",
"{\n\t\t\tfor(int l = 0; l < m; l++){\n\t\t\t\tmatrix[k][m] += matrix[k][l];//??????????¨?\n\t\t\t}\n\t\t}",
"for(int l = 0; l < m; l++){\n\t\t\t\tmatrix[k][m] += matrix[k][l];//??????????¨?\n\t\t\t}",
"int l = 0;",
"int l = 0;",
"l",
"0",
"l < m",
"l",
"m",
"l++",
"l++",
"l",
"{\n\t\t\t\tmatrix[k][m] += matrix[k][l];//??????????¨?\n\t\t\t}",
"{\n\t\t\t\tmatrix[k][m] += matrix[k][l];//??????????¨?\n\t\t\t}",
"matrix[k][m] += matrix[k][l]",
"matrix[k][m]",
"matrix[k]",
"matrix",
"k",
"m",
"matrix[k][l]",
"matrix[k]",
"matrix",
"k",
"l",
"for(int p = 0; p < m; p++){\n\t\t\tfor(int q = 0; q < n; q++){\n\t\t\t\tmatrix[n][p] += matrix[q][p];//??????????¨?\n\t\t\t\twhile(p == 0){\n\t\t\t\t\tmatrix[n][m] += matrix[q][m];\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"int p = 0;",
"int p = 0;",
"p",
"0",
"p < m",
"p",
"m",
"p++",
"p++",
"p",
"{\n\t\t\tfor(int q = 0; q < n; q++){\n\t\t\t\tmatrix[n][p] += matrix[q][p];//??????????¨?\n\t\t\t\twhile(p == 0){\n\t\t\t\t\tmatrix[n][m] += matrix[q][m];\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"{\n\t\t\tfor(int q = 0; q < n; q++){\n\t\t\t\tmatrix[n][p] += matrix[q][p];//??????????¨?\n\t\t\t\twhile(p == 0){\n\t\t\t\t\tmatrix[n][m] += matrix[q][m];\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"for(int q = 0; q < n; q++){\n\t\t\t\tmatrix[n][p] += matrix[q][p];//??????????¨?\n\t\t\t\twhile(p == 0){\n\t\t\t\t\tmatrix[n][m] += matrix[q][m];\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}",
"int q = 0;",
"int q = 0;",
"q",
"0",
"q < n",
"q",
"n",
"q++",
"q++",
"q",
"{\n\t\t\t\tmatrix[n][p] += matrix[q][p];//??????????¨?\n\t\t\t\twhile(p == 0){\n\t\t\t\t\tmatrix[n][m] += matrix[q][m];\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}",
"{\n\t\t\t\tmatrix[n][p] += matrix[q][p];//??????????¨?\n\t\t\t\twhile(p == 0){\n\t\t\t\t\tmatrix[n][m] += matrix[q][m];\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}",
"matrix[n][p] += matrix[q][p]",
"matrix[n][p]",
"matrix[n]",
"matrix",
"n",
"p",
"matrix[q][p]",
"matrix[q]",
"matrix",
"q",
"p",
"while(p == 0){\n\t\t\t\t\tmatrix[n][m] += matrix[q][m];\n\t\t\t\t\tbreak;\n\t\t\t\t}",
"p == 0",
"p",
"0",
"{\n\t\t\t\t\tmatrix[n][m] += matrix[q][m];\n\t\t\t\t\tbreak;\n\t\t\t\t}",
"matrix[n][m] += matrix[q][m]",
"matrix[n][m]",
"matrix[n]",
"matrix",
"n",
"m",
"matrix[q][m]",
"matrix[q]",
"matrix",
"q",
"m",
"break;",
"for(int r = 0; r < n + 1; r++){\n\t\t\tfor(int s = 0; s < m; s++){\n\t\t\t\tSystem.out.print(matrix[r][s] + \" \");\n\t\t\t}\n\t\t\tSystem.out.println(matrix[r][m]);\n\t\t}",
"int r = 0;",
"int r = 0;",
"r",
"0",
"r < n + 1",
"r",
"n + 1",
"n",
"1",
"r++",
"r++",
"r",
"{\n\t\t\tfor(int s = 0; s < m; s++){\n\t\t\t\tSystem.out.print(matrix[r][s] + \" \");\n\t\t\t}\n\t\t\tSystem.out.println(matrix[r][m]);\n\t\t}",
"{\n\t\t\tfor(int s = 0; s < m; s++){\n\t\t\t\tSystem.out.print(matrix[r][s] + \" \");\n\t\t\t}\n\t\t\tSystem.out.println(matrix[r][m]);\n\t\t}",
"for(int s = 0; s < m; s++){\n\t\t\t\tSystem.out.print(matrix[r][s] + \" \");\n\t\t\t}",
"int s = 0;",
"int s = 0;",
"s",
"0",
"s < m",
"s",
"m",
"s++",
"s++",
"s",
"{\n\t\t\t\tSystem.out.print(matrix[r][s] + \" \");\n\t\t\t}",
"{\n\t\t\t\tSystem.out.print(matrix[r][s] + \" \");\n\t\t\t}",
"System.out.print(matrix[r][s] + \" \")",
"System.out.print",
"System.out",
"System",
"System.out",
"matrix[r][s] + \" \"",
"matrix[r][s]",
"matrix[r]",
"matrix",
"r",
"s",
"\" \"",
"System.out.println(matrix[r][m])",
"System.out.println",
"System.out",
"System",
"System.out",
"matrix[r][m]",
"matrix[r]",
"matrix",
"r",
"m",
"String[] args",
"args",
"public class Main {\n\tpublic static void main(String[] args) throws IOException{\n\t\tBufferedReader reader = new BufferedReader(new InputStreamReader(System.in));\n\t\tString line = reader.readLine();\n\t\tString[] sarray = line.split(\" \", -1);\n\t\tint n = Integer.parseInt(sarray[0]);//?????°\n\t\tint m = Integer.parseInt(sarray[1]);//?????°\n\t\tint matrix[][] = new int[n + 1][m + 1];\n\t\tfor(int i = 0; i < n; i++){//?????????????????????\n\t\t\tString str = reader.readLine();\n\t\t\tString[] mat = str.split(\" \", -1);\n\t\t\tfor(int j = 0; j < m; j++){\n\t\t\t\tmatrix[i][j] = Integer.parseInt(mat[j]);\n\t\t\t\twhile(i == 0){\n\t\t\t\t\tmatrix[n][j] = 0;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tmatrix[i][m] = 0;\n\t\t}\n\t\tmatrix[n][m] = 0;\n\t\tfor(int k = 0; k < n; k++){\n\t\t\tfor(int l = 0; l < m; l++){\n\t\t\t\tmatrix[k][m] += matrix[k][l];//??????????¨?\n\t\t\t}\n\t\t}\n\t\tfor(int p = 0; p < m; p++){\n\t\t\tfor(int q = 0; q < n; q++){\n\t\t\t\tmatrix[n][p] += matrix[q][p];//??????????¨?\n\t\t\t\twhile(p == 0){\n\t\t\t\t\tmatrix[n][m] += matrix[q][m];\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tfor(int r = 0; r < n + 1; r++){\n\t\t\tfor(int s = 0; s < m; s++){\n\t\t\t\tSystem.out.print(matrix[r][s] + \" \");\n\t\t\t}\n\t\t\tSystem.out.println(matrix[r][m]);\n\t\t}\n\t}\n}",
"public class Main {\n\tpublic static void main(String[] args) throws IOException{\n\t\tBufferedReader reader = new BufferedReader(new InputStreamReader(System.in));\n\t\tString line = reader.readLine();\n\t\tString[] sarray = line.split(\" \", -1);\n\t\tint n = Integer.parseInt(sarray[0]);//?????°\n\t\tint m = Integer.parseInt(sarray[1]);//?????°\n\t\tint matrix[][] = new int[n + 1][m + 1];\n\t\tfor(int i = 0; i < n; i++){//?????????????????????\n\t\t\tString str = reader.readLine();\n\t\t\tString[] mat = str.split(\" \", -1);\n\t\t\tfor(int j = 0; j < m; j++){\n\t\t\t\tmatrix[i][j] = Integer.parseInt(mat[j]);\n\t\t\t\twhile(i == 0){\n\t\t\t\t\tmatrix[n][j] = 0;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tmatrix[i][m] = 0;\n\t\t}\n\t\tmatrix[n][m] = 0;\n\t\tfor(int k = 0; k < n; k++){\n\t\t\tfor(int l = 0; l < m; l++){\n\t\t\t\tmatrix[k][m] += matrix[k][l];//??????????¨?\n\t\t\t}\n\t\t}\n\t\tfor(int p = 0; p < m; p++){\n\t\t\tfor(int q = 0; q < n; q++){\n\t\t\t\tmatrix[n][p] += matrix[q][p];//??????????¨?\n\t\t\t\twhile(p == 0){\n\t\t\t\t\tmatrix[n][m] += matrix[q][m];\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tfor(int r = 0; r < n + 1; r++){\n\t\t\tfor(int s = 0; s < m; s++){\n\t\t\t\tSystem.out.print(matrix[r][s] + \" \");\n\t\t\t}\n\t\t\tSystem.out.println(matrix[r][m]);\n\t\t}\n\t}\n}",
"Main"
] | import java.io.*;
public class Main {
public static void main(String[] args) throws IOException{
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
String line = reader.readLine();
String[] sarray = line.split(" ", -1);
int n = Integer.parseInt(sarray[0]);//?????°
int m = Integer.parseInt(sarray[1]);//?????°
int matrix[][] = new int[n + 1][m + 1];
for(int i = 0; i < n; i++){//?????????????????????
String str = reader.readLine();
String[] mat = str.split(" ", -1);
for(int j = 0; j < m; j++){
matrix[i][j] = Integer.parseInt(mat[j]);
while(i == 0){
matrix[n][j] = 0;
break;
}
}
matrix[i][m] = 0;
}
matrix[n][m] = 0;
for(int k = 0; k < n; k++){
for(int l = 0; l < m; l++){
matrix[k][m] += matrix[k][l];//??????????¨?
}
}
for(int p = 0; p < m; p++){
for(int q = 0; q < n; q++){
matrix[n][p] += matrix[q][p];//??????????¨?
while(p == 0){
matrix[n][m] += matrix[q][m];
break;
}
}
}
for(int r = 0; r < n + 1; r++){
for(int s = 0; s < m; s++){
System.out.print(matrix[r][s] + " ");
}
System.out.println(matrix[r][m]);
}
}
} |
[
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,
0,
18,
18,
13,
13,
13,
4,
18,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
18,
18,
13,
13,
13,
2,
18,
18,
13,
13,
13,
18,
18,
13,
13,
13,
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,
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,
4,
18,
18,
13,
13,
17,
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
],
[
204,
5
],
[
204,
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
],
[
55,
56
],
[
56,
57
],
[
57,
58
],
[
58,
59
],
[
58,
60
],
[
57,
61
],
[
56,
62
],
[
62,
63
],
[
63,
64
],
[
8,
65
],
[
65,
66
],
[
66,
67
],
[
67,
68
],
[
67,
69
],
[
65,
70
],
[
70,
71
],
[
70,
72
],
[
65,
73
],
[
73,
74
],
[
74,
75
],
[
65,
76
],
[
77,
77
],
[
77,
78
],
[
78,
79
],
[
79,
80
],
[
80,
81
],
[
80,
82
],
[
78,
83
],
[
83,
84
],
[
83,
85
],
[
78,
86
],
[
86,
87
],
[
87,
88
],
[
78,
89
],
[
90,
90
],
[
90,
91
],
[
91,
92
],
[
92,
93
],
[
93,
94
],
[
93,
95
],
[
92,
96
],
[
91,
97
],
[
97,
98
],
[
98,
99
],
[
99,
100
],
[
99,
101
],
[
98,
102
],
[
97,
103
],
[
103,
104
],
[
104,
105
],
[
104,
106
],
[
103,
107
],
[
90,
108
],
[
108,
109
],
[
109,
110
],
[
110,
111
],
[
110,
112
],
[
109,
113
],
[
108,
114
],
[
114,
115
],
[
115,
116
],
[
116,
117
],
[
116,
118
],
[
115,
119
],
[
114,
120
],
[
120,
121
],
[
121,
122
],
[
121,
123
],
[
120,
124
],
[
77,
125
],
[
125,
126
],
[
126,
127
],
[
127,
128
],
[
127,
129
],
[
126,
130
],
[
125,
131
],
[
131,
132
],
[
132,
133
],
[
133,
134
],
[
133,
135
],
[
132,
136
],
[
131,
137
],
[
137,
138
],
[
138,
139
],
[
138,
140
],
[
137,
141
],
[
8,
142
],
[
142,
143
],
[
143,
144
],
[
144,
145
],
[
144,
146
],
[
142,
147
],
[
147,
148
],
[
147,
149
],
[
142,
150
],
[
150,
151
],
[
151,
152
],
[
142,
153
],
[
154,
154
],
[
154,
155
],
[
155,
156
],
[
156,
157
],
[
157,
158
],
[
157,
159
],
[
155,
160
],
[
160,
161
],
[
160,
162
],
[
155,
163
],
[
163,
164
],
[
164,
165
],
[
155,
166
],
[
167,
167
],
[
167,
168
],
[
168,
169
],
[
169,
170
],
[
169,
171
],
[
168,
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
],
[
185,
186
],
[
185,
187
],
[
183,
188
],
[
168,
189
],
[
189,
190
],
[
190,
191
],
[
191,
192
],
[
191,
193
],
[
189,
194
],
[
194,
195
],
[
195,
196
],
[
196,
197
],
[
196,
198
],
[
195,
199
],
[
194,
200
],
[
6,
201
],
[
201,
202
],
[
0,
203
],
[
203,
204
],
[
203,
205
]
] | [
"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 a=sc.nextInt();\n\t\tint b=sc.nextInt();\n\t\tint[][] ab=new int[a+1][b+1];\n\t\tfor(int i=0;i<a;i++){\n\t\t\tfor(int j=0;j<b;j++)\n\t\t\t\tab[i][j]=sc.nextInt();\n\t\t}\n\t\tfor(int i=0;i<a;i++){\n\t\t\tfor(int j=0;j<b;j++){\n\t\t\t\tab[i][b]=ab[i][b]+ab[i][j];\n\t\t\t\tab[a][j]=ab[a][j]+ab[i][j];\n\t\t\t}\n\t\t\tab[a][b]=ab[a][b]+ab[i][b];\n\t\t}\n\t\tfor(int i=0;i<=a;i++){\n\t\t\tfor(int j=0;j<=b;j++){\n\t\t\t\tif(j==b){\n\t\t\t\t\tSystem.out.print(ab[i][j]);\n\t\t\t\t\tSystem.out.print(\"\\n\");\n\t\t\t\t}else\n\t\t\t\t\tSystem.out.print(ab[i][j]+\" \");\n\t\t\t}\n\t\t}\n\t}\n}\n",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n\tpublic static void main(String[]args){\n\t\tScanner sc=new Scanner(System.in);\n\t\tint a=sc.nextInt();\n\t\tint b=sc.nextInt();\n\t\tint[][] ab=new int[a+1][b+1];\n\t\tfor(int i=0;i<a;i++){\n\t\t\tfor(int j=0;j<b;j++)\n\t\t\t\tab[i][j]=sc.nextInt();\n\t\t}\n\t\tfor(int i=0;i<a;i++){\n\t\t\tfor(int j=0;j<b;j++){\n\t\t\t\tab[i][b]=ab[i][b]+ab[i][j];\n\t\t\t\tab[a][j]=ab[a][j]+ab[i][j];\n\t\t\t}\n\t\t\tab[a][b]=ab[a][b]+ab[i][b];\n\t\t}\n\t\tfor(int i=0;i<=a;i++){\n\t\t\tfor(int j=0;j<=b;j++){\n\t\t\t\tif(j==b){\n\t\t\t\t\tSystem.out.print(ab[i][j]);\n\t\t\t\t\tSystem.out.print(\"\\n\");\n\t\t\t\t}else\n\t\t\t\t\tSystem.out.print(ab[i][j]+\" \");\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 a=sc.nextInt();\n\t\tint b=sc.nextInt();\n\t\tint[][] ab=new int[a+1][b+1];\n\t\tfor(int i=0;i<a;i++){\n\t\t\tfor(int j=0;j<b;j++)\n\t\t\t\tab[i][j]=sc.nextInt();\n\t\t}\n\t\tfor(int i=0;i<a;i++){\n\t\t\tfor(int j=0;j<b;j++){\n\t\t\t\tab[i][b]=ab[i][b]+ab[i][j];\n\t\t\t\tab[a][j]=ab[a][j]+ab[i][j];\n\t\t\t}\n\t\t\tab[a][b]=ab[a][b]+ab[i][b];\n\t\t}\n\t\tfor(int i=0;i<=a;i++){\n\t\t\tfor(int j=0;j<=b;j++){\n\t\t\t\tif(j==b){\n\t\t\t\t\tSystem.out.print(ab[i][j]);\n\t\t\t\t\tSystem.out.print(\"\\n\");\n\t\t\t\t}else\n\t\t\t\t\tSystem.out.print(ab[i][j]+\" \");\n\t\t\t}\n\t\t}\n\t}",
"main",
"{\n\t\tScanner sc=new Scanner(System.in);\n\t\tint a=sc.nextInt();\n\t\tint b=sc.nextInt();\n\t\tint[][] ab=new int[a+1][b+1];\n\t\tfor(int i=0;i<a;i++){\n\t\t\tfor(int j=0;j<b;j++)\n\t\t\t\tab[i][j]=sc.nextInt();\n\t\t}\n\t\tfor(int i=0;i<a;i++){\n\t\t\tfor(int j=0;j<b;j++){\n\t\t\t\tab[i][b]=ab[i][b]+ab[i][j];\n\t\t\t\tab[a][j]=ab[a][j]+ab[i][j];\n\t\t\t}\n\t\t\tab[a][b]=ab[a][b]+ab[i][b];\n\t\t}\n\t\tfor(int i=0;i<=a;i++){\n\t\t\tfor(int j=0;j<=b;j++){\n\t\t\t\tif(j==b){\n\t\t\t\t\tSystem.out.print(ab[i][j]);\n\t\t\t\t\tSystem.out.print(\"\\n\");\n\t\t\t\t}else\n\t\t\t\t\tSystem.out.print(ab[i][j]+\" \");\n\t\t\t}\n\t\t}\n\t}",
"Scanner sc=new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"int a=sc.nextInt();",
"a",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int b=sc.nextInt();",
"b",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int[][] ab=new int[a+1][b+1];",
"ab",
"new int[a+1][b+1]",
"a+1",
"a",
"1",
"b+1",
"b",
"1",
"for(int i=0;i<a;i++){\n\t\t\tfor(int j=0;j<b;j++)\n\t\t\t\tab[i][j]=sc.nextInt();\n\t\t}",
"int i=0;",
"int i=0;",
"i",
"0",
"i<a",
"i",
"a",
"i++",
"i++",
"i",
"{\n\t\t\tfor(int j=0;j<b;j++)\n\t\t\t\tab[i][j]=sc.nextInt();\n\t\t}",
"{\n\t\t\tfor(int j=0;j<b;j++)\n\t\t\t\tab[i][j]=sc.nextInt();\n\t\t}",
"for(int j=0;j<b;j++)\n\t\t\t\tab[i][j]=sc.nextInt();",
"int j=0;",
"int j=0;",
"j",
"0",
"j<b",
"j",
"b",
"j++",
"j++",
"j",
"ab[i][j]=sc.nextInt();",
"ab[i][j]=sc.nextInt()",
"ab[i][j]",
"ab[i]",
"ab",
"i",
"j",
"sc.nextInt()",
"sc.nextInt",
"sc",
"for(int i=0;i<a;i++){\n\t\t\tfor(int j=0;j<b;j++){\n\t\t\t\tab[i][b]=ab[i][b]+ab[i][j];\n\t\t\t\tab[a][j]=ab[a][j]+ab[i][j];\n\t\t\t}\n\t\t\tab[a][b]=ab[a][b]+ab[i][b];\n\t\t}",
"int i=0;",
"int i=0;",
"i",
"0",
"i<a",
"i",
"a",
"i++",
"i++",
"i",
"{\n\t\t\tfor(int j=0;j<b;j++){\n\t\t\t\tab[i][b]=ab[i][b]+ab[i][j];\n\t\t\t\tab[a][j]=ab[a][j]+ab[i][j];\n\t\t\t}\n\t\t\tab[a][b]=ab[a][b]+ab[i][b];\n\t\t}",
"{\n\t\t\tfor(int j=0;j<b;j++){\n\t\t\t\tab[i][b]=ab[i][b]+ab[i][j];\n\t\t\t\tab[a][j]=ab[a][j]+ab[i][j];\n\t\t\t}\n\t\t\tab[a][b]=ab[a][b]+ab[i][b];\n\t\t}",
"for(int j=0;j<b;j++){\n\t\t\t\tab[i][b]=ab[i][b]+ab[i][j];\n\t\t\t\tab[a][j]=ab[a][j]+ab[i][j];\n\t\t\t}",
"int j=0;",
"int j=0;",
"j",
"0",
"j<b",
"j",
"b",
"j++",
"j++",
"j",
"{\n\t\t\t\tab[i][b]=ab[i][b]+ab[i][j];\n\t\t\t\tab[a][j]=ab[a][j]+ab[i][j];\n\t\t\t}",
"{\n\t\t\t\tab[i][b]=ab[i][b]+ab[i][j];\n\t\t\t\tab[a][j]=ab[a][j]+ab[i][j];\n\t\t\t}",
"ab[i][b]=ab[i][b]+ab[i][j]",
"ab[i][b]",
"ab[i]",
"ab",
"i",
"b",
"ab[i][b]+ab[i][j]",
"ab[i][b]",
"ab[i]",
"ab",
"i",
"b",
"ab[i][j]",
"ab[i]",
"ab",
"i",
"j",
"ab[a][j]=ab[a][j]+ab[i][j]",
"ab[a][j]",
"ab[a]",
"ab",
"a",
"j",
"ab[a][j]+ab[i][j]",
"ab[a][j]",
"ab[a]",
"ab",
"a",
"j",
"ab[i][j]",
"ab[i]",
"ab",
"i",
"j",
"ab[a][b]=ab[a][b]+ab[i][b]",
"ab[a][b]",
"ab[a]",
"ab",
"a",
"b",
"ab[a][b]+ab[i][b]",
"ab[a][b]",
"ab[a]",
"ab",
"a",
"b",
"ab[i][b]",
"ab[i]",
"ab",
"i",
"b",
"for(int i=0;i<=a;i++){\n\t\t\tfor(int j=0;j<=b;j++){\n\t\t\t\tif(j==b){\n\t\t\t\t\tSystem.out.print(ab[i][j]);\n\t\t\t\t\tSystem.out.print(\"\\n\");\n\t\t\t\t}else\n\t\t\t\t\tSystem.out.print(ab[i][j]+\" \");\n\t\t\t}\n\t\t}",
"int i=0;",
"int i=0;",
"i",
"0",
"i<=a",
"i",
"a",
"i++",
"i++",
"i",
"{\n\t\t\tfor(int j=0;j<=b;j++){\n\t\t\t\tif(j==b){\n\t\t\t\t\tSystem.out.print(ab[i][j]);\n\t\t\t\t\tSystem.out.print(\"\\n\");\n\t\t\t\t}else\n\t\t\t\t\tSystem.out.print(ab[i][j]+\" \");\n\t\t\t}\n\t\t}",
"{\n\t\t\tfor(int j=0;j<=b;j++){\n\t\t\t\tif(j==b){\n\t\t\t\t\tSystem.out.print(ab[i][j]);\n\t\t\t\t\tSystem.out.print(\"\\n\");\n\t\t\t\t}else\n\t\t\t\t\tSystem.out.print(ab[i][j]+\" \");\n\t\t\t}\n\t\t}",
"for(int j=0;j<=b;j++){\n\t\t\t\tif(j==b){\n\t\t\t\t\tSystem.out.print(ab[i][j]);\n\t\t\t\t\tSystem.out.print(\"\\n\");\n\t\t\t\t}else\n\t\t\t\t\tSystem.out.print(ab[i][j]+\" \");\n\t\t\t}",
"int j=0;",
"int j=0;",
"j",
"0",
"j<=b",
"j",
"b",
"j++",
"j++",
"j",
"{\n\t\t\t\tif(j==b){\n\t\t\t\t\tSystem.out.print(ab[i][j]);\n\t\t\t\t\tSystem.out.print(\"\\n\");\n\t\t\t\t}else\n\t\t\t\t\tSystem.out.print(ab[i][j]+\" \");\n\t\t\t}",
"{\n\t\t\t\tif(j==b){\n\t\t\t\t\tSystem.out.print(ab[i][j]);\n\t\t\t\t\tSystem.out.print(\"\\n\");\n\t\t\t\t}else\n\t\t\t\t\tSystem.out.print(ab[i][j]+\" \");\n\t\t\t}",
"if(j==b){\n\t\t\t\t\tSystem.out.print(ab[i][j]);\n\t\t\t\t\tSystem.out.print(\"\\n\");\n\t\t\t\t}else\n\t\t\t\t\tSystem.out.print(ab[i][j]+\" \");",
"j==b",
"j",
"b",
"{\n\t\t\t\t\tSystem.out.print(ab[i][j]);\n\t\t\t\t\tSystem.out.print(\"\\n\");\n\t\t\t\t}",
"System.out.print(ab[i][j])",
"System.out.print",
"System.out",
"System",
"System.out",
"ab[i][j]",
"ab[i]",
"ab",
"i",
"j",
"System.out.print(\"\\n\")",
"System.out.print",
"System.out",
"System",
"System.out",
"\"\\n\"",
"System.out.print(ab[i][j]+\" \")",
"System.out.print",
"System.out",
"System",
"System.out",
"ab[i][j]+\" \"",
"ab[i][j]",
"ab[i]",
"ab",
"i",
"j",
"\" \"",
"String[]args",
"args",
"public class Main {\n\tpublic static void main(String[]args){\n\t\tScanner sc=new Scanner(System.in);\n\t\tint a=sc.nextInt();\n\t\tint b=sc.nextInt();\n\t\tint[][] ab=new int[a+1][b+1];\n\t\tfor(int i=0;i<a;i++){\n\t\t\tfor(int j=0;j<b;j++)\n\t\t\t\tab[i][j]=sc.nextInt();\n\t\t}\n\t\tfor(int i=0;i<a;i++){\n\t\t\tfor(int j=0;j<b;j++){\n\t\t\t\tab[i][b]=ab[i][b]+ab[i][j];\n\t\t\t\tab[a][j]=ab[a][j]+ab[i][j];\n\t\t\t}\n\t\t\tab[a][b]=ab[a][b]+ab[i][b];\n\t\t}\n\t\tfor(int i=0;i<=a;i++){\n\t\t\tfor(int j=0;j<=b;j++){\n\t\t\t\tif(j==b){\n\t\t\t\t\tSystem.out.print(ab[i][j]);\n\t\t\t\t\tSystem.out.print(\"\\n\");\n\t\t\t\t}else\n\t\t\t\t\tSystem.out.print(ab[i][j]+\" \");\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 a=sc.nextInt();\n\t\tint b=sc.nextInt();\n\t\tint[][] ab=new int[a+1][b+1];\n\t\tfor(int i=0;i<a;i++){\n\t\t\tfor(int j=0;j<b;j++)\n\t\t\t\tab[i][j]=sc.nextInt();\n\t\t}\n\t\tfor(int i=0;i<a;i++){\n\t\t\tfor(int j=0;j<b;j++){\n\t\t\t\tab[i][b]=ab[i][b]+ab[i][j];\n\t\t\t\tab[a][j]=ab[a][j]+ab[i][j];\n\t\t\t}\n\t\t\tab[a][b]=ab[a][b]+ab[i][b];\n\t\t}\n\t\tfor(int i=0;i<=a;i++){\n\t\t\tfor(int j=0;j<=b;j++){\n\t\t\t\tif(j==b){\n\t\t\t\t\tSystem.out.print(ab[i][j]);\n\t\t\t\t\tSystem.out.print(\"\\n\");\n\t\t\t\t}else\n\t\t\t\t\tSystem.out.print(ab[i][j]+\" \");\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 a=sc.nextInt();
int b=sc.nextInt();
int[][] ab=new int[a+1][b+1];
for(int i=0;i<a;i++){
for(int j=0;j<b;j++)
ab[i][j]=sc.nextInt();
}
for(int i=0;i<a;i++){
for(int j=0;j<b;j++){
ab[i][b]=ab[i][b]+ab[i][j];
ab[a][j]=ab[a][j]+ab[i][j];
}
ab[a][b]=ab[a][b]+ab[i][b];
}
for(int i=0;i<=a;i++){
for(int j=0;j<=b;j++){
if(j==b){
System.out.print(ab[i][j]);
System.out.print("\n");
}else
System.out.print(ab[i][j]+" ");
}
}
}
}
|
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
20,
41,
13,
4,
18,
4,
18,
13,
17,
41,
13,
4,
18,
13,
18,
13,
17,
41,
13,
4,
18,
13,
18,
13,
17,
41,
13,
20,
2,
13,
17,
2,
13,
17,
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,
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,
4,
18,
13,
18,
18,
13,
13,
13,
14,
2,
13,
13,
4,
18,
13,
17,
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
],
[
210,
11
],
[
210,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
15,
17
],
[
14,
18
],
[
18,
19
],
[
18,
20
],
[
14,
21
],
[
21,
22
],
[
21,
23
],
[
23,
24
],
[
24,
25
],
[
25,
26
],
[
26,
27
],
[
23,
28
],
[
14,
29
],
[
29,
30
],
[
29,
31
],
[
31,
32
],
[
32,
33
],
[
31,
34
],
[
34,
35
],
[
34,
36
],
[
14,
37
],
[
37,
38
],
[
37,
39
],
[
39,
40
],
[
40,
41
],
[
39,
42
],
[
42,
43
],
[
42,
44
],
[
14,
45
],
[
45,
46
],
[
45,
47
],
[
48,
49
],
[
48,
50
],
[
51,
52
],
[
51,
53
],
[
14,
54
],
[
54,
55
],
[
55,
56
],
[
56,
57
],
[
56,
58
],
[
54,
59
],
[
59,
60
],
[
59,
61
],
[
54,
62
],
[
62,
63
],
[
63,
64
],
[
54,
65
],
[
66,
66
],
[
66,
67
],
[
67,
68
],
[
67,
69
],
[
69,
70
],
[
70,
71
],
[
71,
72
],
[
72,
73
],
[
69,
74
],
[
66,
75
],
[
75,
76
],
[
76,
77
],
[
77,
78
],
[
77,
79
],
[
75,
80
],
[
80,
81
],
[
80,
82
],
[
75,
83
],
[
83,
84
],
[
84,
85
],
[
75,
86
],
[
87,
87
],
[
87,
88
],
[
88,
89
],
[
89,
90
],
[
90,
91
],
[
90,
92
],
[
89,
93
],
[
88,
94
],
[
94,
95
],
[
95,
96
],
[
94,
97
],
[
97,
98
],
[
97,
99
],
[
87,
100
],
[
100,
101
],
[
101,
102
],
[
102,
103
],
[
102,
104
],
[
101,
105
],
[
100,
106
],
[
106,
107
],
[
107,
108
],
[
106,
109
],
[
109,
110
],
[
109,
111
],
[
14,
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
],
[
141,
142
],
[
142,
143
],
[
142,
144
],
[
141,
145
],
[
140,
146
],
[
146,
147
],
[
147,
148
],
[
147,
149
],
[
146,
150
],
[
14,
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
],
[
181,
184
],
[
184,
185
],
[
185,
186
],
[
185,
187
],
[
184,
188
],
[
180,
189
],
[
189,
190
],
[
190,
191
],
[
190,
192
],
[
189,
193
],
[
193,
194
],
[
194,
195
],
[
193,
196
],
[
165,
197
],
[
197,
198
],
[
198,
199
],
[
197,
200
],
[
14,
201
],
[
201,
202
],
[
202,
203
],
[
203,
204
],
[
203,
205
],
[
201,
206
],
[
12,
207
],
[
207,
208
],
[
0,
209
],
[
209,
210
],
[
209,
211
]
] | [
"import java.io.BufferedReader;\nimport java.io.InputStreamReader;\nimport java.io.IOException;\npublic class Main{\n\tpublic static void main(String[] args) throws IOException{\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\t\tStringBuilder sb = new StringBuilder();\n\t\tString[] line = br.readLine().split(\" \");\n\t\tint r = Integer.parseInt(line[0]);\n\t\tint c = Integer.parseInt(line[1]);\n\t\tint[][] rc = new int[r+1][c+1];\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\trc[i][j] = Integer.parseInt(str[j]);\n\t\t\t\trc[i][c] += Integer.parseInt(str[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\trc[r][i] += rc[j][i];\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\t//System.out.print(rc[i][j]+\" \");\n\t\t\t\tsb.append(rc[i][j]);\n if(j != c) sb.append(\" \");\n\t\t\t}\n\t\t\t//System.out.println();\n\t\t\tsb.append(\"\\n\");\n\t\t}\n\t\tSystem.out.print(sb);\n\t\t\n\t}\n}",
"import java.io.BufferedReader;",
"BufferedReader",
"java.io",
"import java.io.InputStreamReader;",
"InputStreamReader",
"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\tStringBuilder sb = new StringBuilder();\n\t\tString[] line = br.readLine().split(\" \");\n\t\tint r = Integer.parseInt(line[0]);\n\t\tint c = Integer.parseInt(line[1]);\n\t\tint[][] rc = new int[r+1][c+1];\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\trc[i][j] = Integer.parseInt(str[j]);\n\t\t\t\trc[i][c] += Integer.parseInt(str[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\trc[r][i] += rc[j][i];\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\t//System.out.print(rc[i][j]+\" \");\n\t\t\t\tsb.append(rc[i][j]);\n if(j != c) sb.append(\" \");\n\t\t\t}\n\t\t\t//System.out.println();\n\t\t\tsb.append(\"\\n\");\n\t\t}\n\t\tSystem.out.print(sb);\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\tStringBuilder sb = new StringBuilder();\n\t\tString[] line = br.readLine().split(\" \");\n\t\tint r = Integer.parseInt(line[0]);\n\t\tint c = Integer.parseInt(line[1]);\n\t\tint[][] rc = new int[r+1][c+1];\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\trc[i][j] = Integer.parseInt(str[j]);\n\t\t\t\trc[i][c] += Integer.parseInt(str[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\trc[r][i] += rc[j][i];\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\t//System.out.print(rc[i][j]+\" \");\n\t\t\t\tsb.append(rc[i][j]);\n if(j != c) sb.append(\" \");\n\t\t\t}\n\t\t\t//System.out.println();\n\t\t\tsb.append(\"\\n\");\n\t\t}\n\t\tSystem.out.print(sb);\n\t\t\n\t}",
"main",
"{\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\t\tStringBuilder sb = new StringBuilder();\n\t\tString[] line = br.readLine().split(\" \");\n\t\tint r = Integer.parseInt(line[0]);\n\t\tint c = Integer.parseInt(line[1]);\n\t\tint[][] rc = new int[r+1][c+1];\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\trc[i][j] = Integer.parseInt(str[j]);\n\t\t\t\trc[i][c] += Integer.parseInt(str[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\trc[r][i] += rc[j][i];\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\t//System.out.print(rc[i][j]+\" \");\n\t\t\t\tsb.append(rc[i][j]);\n if(j != c) sb.append(\" \");\n\t\t\t}\n\t\t\t//System.out.println();\n\t\t\tsb.append(\"\\n\");\n\t\t}\n\t\tSystem.out.print(sb);\n\t\t\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[] line = br.readLine().split(\" \");",
"line",
"br.readLine().split(\" \")",
"br.readLine().split",
"br.readLine()",
"br.readLine",
"br",
"\" \"",
"int r = Integer.parseInt(line[0]);",
"r",
"Integer.parseInt(line[0])",
"Integer.parseInt",
"Integer",
"line[0]",
"line",
"0",
"int c = Integer.parseInt(line[1]);",
"c",
"Integer.parseInt(line[1])",
"Integer.parseInt",
"Integer",
"line[1]",
"line",
"1",
"int[][] 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\t\t\tString[] str =br.readLine().split(\" \");\n\t\t\tfor(int j = 0; j < c; j++){\n\t\t\t\trc[i][j] = Integer.parseInt(str[j]);\n\t\t\t\trc[i][c] += Integer.parseInt(str[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\tString[] str =br.readLine().split(\" \");\n\t\t\tfor(int j = 0; j < c; j++){\n\t\t\t\trc[i][j] = Integer.parseInt(str[j]);\n\t\t\t\trc[i][c] += Integer.parseInt(str[j]);\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\trc[i][j] = Integer.parseInt(str[j]);\n\t\t\t\trc[i][c] += 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(int j = 0; j < c; j++){\n\t\t\t\trc[i][j] = Integer.parseInt(str[j]);\n\t\t\t\trc[i][c] += Integer.parseInt(str[j]);\n\t\t\t}",
"int j = 0;",
"int j = 0;",
"j",
"0",
"j < c",
"j",
"c",
"j++",
"j++",
"j",
"{\n\t\t\t\trc[i][j] = Integer.parseInt(str[j]);\n\t\t\t\trc[i][c] += Integer.parseInt(str[j]);\n\t\t\t}",
"{\n\t\t\t\trc[i][j] = Integer.parseInt(str[j]);\n\t\t\t\trc[i][c] += Integer.parseInt(str[j]);\n\t\t\t}",
"rc[i][j] = Integer.parseInt(str[j])",
"rc[i][j]",
"rc[i]",
"rc",
"i",
"j",
"Integer.parseInt(str[j])",
"Integer.parseInt",
"Integer",
"str[j]",
"str",
"j",
"rc[i][c] += Integer.parseInt(str[j])",
"rc[i][c]",
"rc[i]",
"rc",
"i",
"c",
"Integer.parseInt(str[j])",
"Integer.parseInt",
"Integer",
"str[j]",
"str",
"j",
"for(int i = 0; i < c+1; i++){\n\t\t\tfor(int j = 0; j < r; j++){\n\t\t\t\trc[r][i] += rc[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\trc[r][i] += rc[j][i];\n\t\t\t}\n\t\t}",
"{\n\t\t\tfor(int j = 0; j < r; j++){\n\t\t\t\trc[r][i] += rc[j][i];\n\t\t\t}\n\t\t}",
"for(int j = 0; j < r; j++){\n\t\t\t\trc[r][i] += rc[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\trc[r][i] += rc[j][i];\n\t\t\t}",
"{\n\t\t\t\trc[r][i] += rc[j][i];\n\t\t\t}",
"rc[r][i] += rc[j][i]",
"rc[r][i]",
"rc[r]",
"rc",
"r",
"i",
"rc[j][i]",
"rc[j]",
"rc",
"j",
"i",
"for(int i = 0; i < r+1; i++){\n\t\t\tfor(int j = 0; j < c+1; j++){\n\t\t\t\t//System.out.print(rc[i][j]+\" \");\n\t\t\t\tsb.append(rc[i][j]);\n if(j != c) sb.append(\" \");\n\t\t\t}\n\t\t\t//System.out.println();\n\t\t\tsb.append(\"\\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\t//System.out.print(rc[i][j]+\" \");\n\t\t\t\tsb.append(rc[i][j]);\n if(j != c) sb.append(\" \");\n\t\t\t}\n\t\t\t//System.out.println();\n\t\t\tsb.append(\"\\n\");\n\t\t}",
"{\n\t\t\tfor(int j = 0; j < c+1; j++){\n\t\t\t\t//System.out.print(rc[i][j]+\" \");\n\t\t\t\tsb.append(rc[i][j]);\n if(j != c) sb.append(\" \");\n\t\t\t}\n\t\t\t//System.out.println();\n\t\t\tsb.append(\"\\n\");\n\t\t}",
"for(int j = 0; j < c+1; j++){\n\t\t\t\t//System.out.print(rc[i][j]+\" \");\n\t\t\t\tsb.append(rc[i][j]);\n if(j != c) sb.append(\" \");\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//System.out.print(rc[i][j]+\" \");\n\t\t\t\tsb.append(rc[i][j]);\n if(j != c) sb.append(\" \");\n\t\t\t}",
"{\n\t\t\t\t//System.out.print(rc[i][j]+\" \");\n\t\t\t\tsb.append(rc[i][j]);\n if(j != c) sb.append(\" \");\n\t\t\t}",
"sb.append(rc[i][j])",
"sb.append",
"sb",
"rc[i][j]",
"rc[i]",
"rc",
"i",
"j",
"if(j != c) sb.append(\" \");",
"j != c",
"j",
"c",
"sb.append(\" \")",
"sb.append",
"sb",
"\" \"",
"sb.append(\"\\n\")",
"sb.append",
"sb",
"\"\\n\"",
"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) throws IOException{\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\t\tStringBuilder sb = new StringBuilder();\n\t\tString[] line = br.readLine().split(\" \");\n\t\tint r = Integer.parseInt(line[0]);\n\t\tint c = Integer.parseInt(line[1]);\n\t\tint[][] rc = new int[r+1][c+1];\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\trc[i][j] = Integer.parseInt(str[j]);\n\t\t\t\trc[i][c] += Integer.parseInt(str[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\trc[r][i] += rc[j][i];\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\t//System.out.print(rc[i][j]+\" \");\n\t\t\t\tsb.append(rc[i][j]);\n if(j != c) sb.append(\" \");\n\t\t\t}\n\t\t\t//System.out.println();\n\t\t\tsb.append(\"\\n\");\n\t\t}\n\t\tSystem.out.print(sb);\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\tStringBuilder sb = new StringBuilder();\n\t\tString[] line = br.readLine().split(\" \");\n\t\tint r = Integer.parseInt(line[0]);\n\t\tint c = Integer.parseInt(line[1]);\n\t\tint[][] rc = new int[r+1][c+1];\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\trc[i][j] = Integer.parseInt(str[j]);\n\t\t\t\trc[i][c] += Integer.parseInt(str[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\trc[r][i] += rc[j][i];\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\t//System.out.print(rc[i][j]+\" \");\n\t\t\t\tsb.append(rc[i][j]);\n if(j != c) sb.append(\" \");\n\t\t\t}\n\t\t\t//System.out.println();\n\t\t\tsb.append(\"\\n\");\n\t\t}\n\t\tSystem.out.print(sb);\n\t\t\n\t}\n}",
"Main"
] | import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.IOException;
public class Main{
public static void main(String[] args) throws IOException{
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
StringBuilder sb = new StringBuilder();
String[] line = br.readLine().split(" ");
int r = Integer.parseInt(line[0]);
int c = Integer.parseInt(line[1]);
int[][] rc = new int[r+1][c+1];
for(int i = 0; i < r; i++){
String[] str =br.readLine().split(" ");
for(int j = 0; j < c; j++){
rc[i][j] = Integer.parseInt(str[j]);
rc[i][c] += Integer.parseInt(str[j]);
}
}
for(int i = 0; i < c+1; i++){
for(int j = 0; j < r; j++){
rc[r][i] += rc[j][i];
}
}
for(int i = 0; i < r+1; i++){
for(int j = 0; j < c+1; j++){
//System.out.print(rc[i][j]+" ");
sb.append(rc[i][j]);
if(j != c) sb.append(" ");
}
//System.out.println();
sb.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,
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,
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,
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,
2,
13,
17,
1,
40,
13,
30,
30,
11,
1,
41,
13,
17,
2,
13,
2,
13,
17,
1,
40,
13,
30,
30,
14,
2,
13,
13,
30,
4,
18,
18,
13,
13,
18,
18,
13,
13,
13,
30,
4,
18,
18,
13,
13,
2,
18,
18,
13,
13,
13,
17,
4,
18,
18,
13,
13,
4,
18,
13,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
288,
5
],
[
288,
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
],
[
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
],
[
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
],
[
99,
100
],
[
99,
101
],
[
98,
102
],
[
97,
103
],
[
103,
104
],
[
104,
105
],
[
104,
106
],
[
103,
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
],
[
133,
133
],
[
133,
134
],
[
134,
135
],
[
135,
136
],
[
136,
137
],
[
136,
138
],
[
135,
139
],
[
134,
140
],
[
140,
141
],
[
141,
142
],
[
141,
143
],
[
140,
144
],
[
8,
145
],
[
145,
146
],
[
146,
147
],
[
147,
148
],
[
147,
149
],
[
145,
150
],
[
150,
151
],
[
150,
152
],
[
145,
153
],
[
153,
154
],
[
154,
155
],
[
145,
156
],
[
157,
157
],
[
157,
158
],
[
158,
159
],
[
159,
160
],
[
160,
161
],
[
160,
162
],
[
158,
163
],
[
163,
164
],
[
163,
165
],
[
158,
166
],
[
166,
167
],
[
167,
168
],
[
158,
169
],
[
170,
170
],
[
170,
171
],
[
171,
172
],
[
172,
173
],
[
173,
174
],
[
173,
175
],
[
172,
176
],
[
171,
177
],
[
177,
178
],
[
178,
179
],
[
178,
180
],
[
177,
181
],
[
8,
182
],
[
182,
183
],
[
183,
184
],
[
184,
185
],
[
184,
186
],
[
182,
187
],
[
187,
188
],
[
187,
189
],
[
182,
190
],
[
190,
191
],
[
191,
192
],
[
182,
193
],
[
194,
194
],
[
194,
195
],
[
195,
196
],
[
196,
197
],
[
197,
198
],
[
197,
199
],
[
195,
200
],
[
200,
201
],
[
200,
202
],
[
195,
203
],
[
203,
204
],
[
204,
205
],
[
195,
206
],
[
207,
207
],
[
207,
208
],
[
208,
209
],
[
209,
210
],
[
210,
211
],
[
210,
212
],
[
209,
213
],
[
208,
214
],
[
214,
215
],
[
215,
216
],
[
215,
217
],
[
214,
218
],
[
8,
219
],
[
219,
220
],
[
220,
221
],
[
221,
222
],
[
221,
223
],
[
219,
224
],
[
224,
225
],
[
224,
226
],
[
226,
227
],
[
226,
228
],
[
219,
229
],
[
229,
230
],
[
230,
231
],
[
219,
232
],
[
233,
233
],
[
233,
234
],
[
234,
235
],
[
235,
236
],
[
236,
237
],
[
236,
238
],
[
234,
239
],
[
239,
240
],
[
239,
241
],
[
241,
242
],
[
241,
243
],
[
234,
244
],
[
244,
245
],
[
245,
246
],
[
234,
247
],
[
248,
248
],
[
248,
249
],
[
249,
250
],
[
250,
251
],
[
250,
252
],
[
249,
253
],
[
253,
254
],
[
254,
255
],
[
255,
256
],
[
256,
257
],
[
256,
258
],
[
254,
259
],
[
259,
260
],
[
260,
261
],
[
260,
262
],
[
259,
263
],
[
249,
264
],
[
264,
265
],
[
265,
266
],
[
266,
267
],
[
267,
268
],
[
267,
269
],
[
265,
270
],
[
270,
271
],
[
271,
272
],
[
272,
273
],
[
272,
274
],
[
271,
275
],
[
270,
276
],
[
233,
277
],
[
277,
278
],
[
278,
279
],
[
279,
280
],
[
279,
281
],
[
8,
282
],
[
282,
283
],
[
283,
284
],
[
6,
285
],
[
285,
286
],
[
0,
287
],
[
287,
288
],
[
287,
289
]
] | [
"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[][] spreadsheet = new int[r][c];\n\t\tint[][] sumSpreadsheet = 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\tspreadsheet[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\tsumSpreadsheet[i][j] = spreadsheet[i][j];\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\tsumSpreadsheet[i][c] += sumSpreadsheet[i][j];\n\t\t\t}\n\t\t}\n\t\tfor (int j = 0; j < c; j++) {\n\t\t\tfor (int i = 0; i < r; i++) {\n\t\t\t\tsumSpreadsheet[r][j] += sumSpreadsheet[i][j];\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\tsumSpreadsheet[r][c] += sumSpreadsheet[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\tif (j == c) {\n\t\t\t\t\tSystem.out.print(sumSpreadsheet[i][j]);\n\t\t\t\t} else {\n\t\t\t\t\tSystem.out.print(sumSpreadsheet[i][j] + \" \");\n\t\t\t\t}\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}\n\t\tsc.close();\n\t}\n}",
"import java.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[][] spreadsheet = new int[r][c];\n\t\tint[][] sumSpreadsheet = 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\tspreadsheet[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\tsumSpreadsheet[i][j] = spreadsheet[i][j];\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\tsumSpreadsheet[i][c] += sumSpreadsheet[i][j];\n\t\t\t}\n\t\t}\n\t\tfor (int j = 0; j < c; j++) {\n\t\t\tfor (int i = 0; i < r; i++) {\n\t\t\t\tsumSpreadsheet[r][j] += sumSpreadsheet[i][j];\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\tsumSpreadsheet[r][c] += sumSpreadsheet[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\tif (j == c) {\n\t\t\t\t\tSystem.out.print(sumSpreadsheet[i][j]);\n\t\t\t\t} else {\n\t\t\t\t\tSystem.out.print(sumSpreadsheet[i][j] + \" \");\n\t\t\t\t}\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}\n\t\tsc.close();\n\t}\n}",
"Main",
"public static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\tint r = sc.nextInt();\n\t\tint c = sc.nextInt();\n\t\tint[][] spreadsheet = new int[r][c];\n\t\tint[][] sumSpreadsheet = 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\tspreadsheet[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\tsumSpreadsheet[i][j] = spreadsheet[i][j];\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\tsumSpreadsheet[i][c] += sumSpreadsheet[i][j];\n\t\t\t}\n\t\t}\n\t\tfor (int j = 0; j < c; j++) {\n\t\t\tfor (int i = 0; i < r; i++) {\n\t\t\t\tsumSpreadsheet[r][j] += sumSpreadsheet[i][j];\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\tsumSpreadsheet[r][c] += sumSpreadsheet[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\tif (j == c) {\n\t\t\t\t\tSystem.out.print(sumSpreadsheet[i][j]);\n\t\t\t\t} else {\n\t\t\t\t\tSystem.out.print(sumSpreadsheet[i][j] + \" \");\n\t\t\t\t}\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}\n\t\tsc.close();\n\t}",
"main",
"{\n\t\tScanner sc = new Scanner(System.in);\n\t\tint r = sc.nextInt();\n\t\tint c = sc.nextInt();\n\t\tint[][] spreadsheet = new int[r][c];\n\t\tint[][] sumSpreadsheet = 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\tspreadsheet[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\tsumSpreadsheet[i][j] = spreadsheet[i][j];\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\tsumSpreadsheet[i][c] += sumSpreadsheet[i][j];\n\t\t\t}\n\t\t}\n\t\tfor (int j = 0; j < c; j++) {\n\t\t\tfor (int i = 0; i < r; i++) {\n\t\t\t\tsumSpreadsheet[r][j] += sumSpreadsheet[i][j];\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\tsumSpreadsheet[r][c] += sumSpreadsheet[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\tif (j == c) {\n\t\t\t\t\tSystem.out.print(sumSpreadsheet[i][j]);\n\t\t\t\t} else {\n\t\t\t\t\tSystem.out.print(sumSpreadsheet[i][j] + \" \");\n\t\t\t\t}\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}\n\t\tsc.close();\n\t}",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"int r = sc.nextInt();",
"r",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int c = sc.nextInt();",
"c",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int[][] spreadsheet = new int[r][c];",
"spreadsheet",
"new int[r][c]",
"r",
"c",
"int[][] sumSpreadsheet = new int[r + 1][c + 1];",
"sumSpreadsheet",
"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\tspreadsheet[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\tspreadsheet[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\tspreadsheet[i][j] = sc.nextInt();\n\t\t\t}\n\t\t}",
"for (int j = 0; j < c; j++) {\n\t\t\t\tspreadsheet[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\tspreadsheet[i][j] = sc.nextInt();\n\t\t\t}",
"{\n\t\t\t\tspreadsheet[i][j] = sc.nextInt();\n\t\t\t}",
"spreadsheet[i][j] = sc.nextInt()",
"spreadsheet[i][j]",
"spreadsheet[i]",
"spreadsheet",
"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\tsumSpreadsheet[i][j] = spreadsheet[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\tsumSpreadsheet[i][j] = spreadsheet[i][j];\n\t\t\t}\n\t\t}",
"{\n\t\t\tfor (int j = 0; j < c; j++) {\n\t\t\t\tsumSpreadsheet[i][j] = spreadsheet[i][j];\n\t\t\t}\n\t\t}",
"for (int j = 0; j < c; j++) {\n\t\t\t\tsumSpreadsheet[i][j] = spreadsheet[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\tsumSpreadsheet[i][j] = spreadsheet[i][j];\n\t\t\t}",
"{\n\t\t\t\tsumSpreadsheet[i][j] = spreadsheet[i][j];\n\t\t\t}",
"sumSpreadsheet[i][j] = spreadsheet[i][j]",
"sumSpreadsheet[i][j]",
"sumSpreadsheet[i]",
"sumSpreadsheet",
"i",
"j",
"spreadsheet[i][j]",
"spreadsheet[i]",
"spreadsheet",
"i",
"j",
"for (int i = 0; i < r; i++) {\n\t\t\tfor (int j = 0; j < c; j++) {\n\t\t\t\tsumSpreadsheet[i][c] += sumSpreadsheet[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\tsumSpreadsheet[i][c] += sumSpreadsheet[i][j];\n\t\t\t}\n\t\t}",
"{\n\t\t\tfor (int j = 0; j < c; j++) {\n\t\t\t\tsumSpreadsheet[i][c] += sumSpreadsheet[i][j];\n\t\t\t}\n\t\t}",
"for (int j = 0; j < c; j++) {\n\t\t\t\tsumSpreadsheet[i][c] += sumSpreadsheet[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\tsumSpreadsheet[i][c] += sumSpreadsheet[i][j];\n\t\t\t}",
"{\n\t\t\t\tsumSpreadsheet[i][c] += sumSpreadsheet[i][j];\n\t\t\t}",
"sumSpreadsheet[i][c] += sumSpreadsheet[i][j]",
"sumSpreadsheet[i][c]",
"sumSpreadsheet[i]",
"sumSpreadsheet",
"i",
"c",
"sumSpreadsheet[i][j]",
"sumSpreadsheet[i]",
"sumSpreadsheet",
"i",
"j",
"for (int j = 0; j < c; j++) {\n\t\t\tfor (int i = 0; i < r; i++) {\n\t\t\t\tsumSpreadsheet[r][j] += sumSpreadsheet[i][j];\n\t\t\t}\n\t\t}",
"int j = 0;",
"int j = 0;",
"j",
"0",
"j < c",
"j",
"c",
"j++",
"j++",
"j",
"{\n\t\t\tfor (int i = 0; i < r; i++) {\n\t\t\t\tsumSpreadsheet[r][j] += sumSpreadsheet[i][j];\n\t\t\t}\n\t\t}",
"{\n\t\t\tfor (int i = 0; i < r; i++) {\n\t\t\t\tsumSpreadsheet[r][j] += sumSpreadsheet[i][j];\n\t\t\t}\n\t\t}",
"for (int i = 0; i < r; i++) {\n\t\t\t\tsumSpreadsheet[r][j] += sumSpreadsheet[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\tsumSpreadsheet[r][j] += sumSpreadsheet[i][j];\n\t\t\t}",
"{\n\t\t\t\tsumSpreadsheet[r][j] += sumSpreadsheet[i][j];\n\t\t\t}",
"sumSpreadsheet[r][j] += sumSpreadsheet[i][j]",
"sumSpreadsheet[r][j]",
"sumSpreadsheet[r]",
"sumSpreadsheet",
"r",
"j",
"sumSpreadsheet[i][j]",
"sumSpreadsheet[i]",
"sumSpreadsheet",
"i",
"j",
"for (int i = 0; i < r; i++) {\n\t\t\tfor (int j = 0; j < c; j++) {\n\t\t\t\tsumSpreadsheet[r][c] += sumSpreadsheet[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\tsumSpreadsheet[r][c] += sumSpreadsheet[i][j];\n\t\t\t}\n\t\t}",
"{\n\t\t\tfor (int j = 0; j < c; j++) {\n\t\t\t\tsumSpreadsheet[r][c] += sumSpreadsheet[i][j];\n\t\t\t}\n\t\t}",
"for (int j = 0; j < c; j++) {\n\t\t\t\tsumSpreadsheet[r][c] += sumSpreadsheet[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\tsumSpreadsheet[r][c] += sumSpreadsheet[i][j];\n\t\t\t}",
"{\n\t\t\t\tsumSpreadsheet[r][c] += sumSpreadsheet[i][j];\n\t\t\t}",
"sumSpreadsheet[r][c] += sumSpreadsheet[i][j]",
"sumSpreadsheet[r][c]",
"sumSpreadsheet[r]",
"sumSpreadsheet",
"r",
"c",
"sumSpreadsheet[i][j]",
"sumSpreadsheet[i]",
"sumSpreadsheet",
"i",
"j",
"for (int i = 0; i < r + 1; i++) {\n\t\t\tfor (int j = 0; j < c + 1; j++) {\n\t\t\t\tif (j == c) {\n\t\t\t\t\tSystem.out.print(sumSpreadsheet[i][j]);\n\t\t\t\t} else {\n\t\t\t\t\tSystem.out.print(sumSpreadsheet[i][j] + \" \");\n\t\t\t\t}\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < r + 1",
"i",
"r + 1",
"r",
"1",
"i++",
"i++",
"i",
"{\n\t\t\tfor (int j = 0; j < c + 1; j++) {\n\t\t\t\tif (j == c) {\n\t\t\t\t\tSystem.out.print(sumSpreadsheet[i][j]);\n\t\t\t\t} else {\n\t\t\t\t\tSystem.out.print(sumSpreadsheet[i][j] + \" \");\n\t\t\t\t}\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}",
"{\n\t\t\tfor (int j = 0; j < c + 1; j++) {\n\t\t\t\tif (j == c) {\n\t\t\t\t\tSystem.out.print(sumSpreadsheet[i][j]);\n\t\t\t\t} else {\n\t\t\t\t\tSystem.out.print(sumSpreadsheet[i][j] + \" \");\n\t\t\t\t}\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}",
"for (int j = 0; j < c + 1; j++) {\n\t\t\t\tif (j == c) {\n\t\t\t\t\tSystem.out.print(sumSpreadsheet[i][j]);\n\t\t\t\t} else {\n\t\t\t\t\tSystem.out.print(sumSpreadsheet[i][j] + \" \");\n\t\t\t\t}\n\t\t\t}",
"int j = 0;",
"int j = 0;",
"j",
"0",
"j < c + 1",
"j",
"c + 1",
"c",
"1",
"j++",
"j++",
"j",
"{\n\t\t\t\tif (j == c) {\n\t\t\t\t\tSystem.out.print(sumSpreadsheet[i][j]);\n\t\t\t\t} else {\n\t\t\t\t\tSystem.out.print(sumSpreadsheet[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(sumSpreadsheet[i][j]);\n\t\t\t\t} else {\n\t\t\t\t\tSystem.out.print(sumSpreadsheet[i][j] + \" \");\n\t\t\t\t}\n\t\t\t}",
"if (j == c) {\n\t\t\t\t\tSystem.out.print(sumSpreadsheet[i][j]);\n\t\t\t\t} else {\n\t\t\t\t\tSystem.out.print(sumSpreadsheet[i][j] + \" \");\n\t\t\t\t}",
"j == c",
"j",
"c",
"{\n\t\t\t\t\tSystem.out.print(sumSpreadsheet[i][j]);\n\t\t\t\t}",
"System.out.print(sumSpreadsheet[i][j])",
"System.out.print",
"System.out",
"System",
"System.out",
"sumSpreadsheet[i][j]",
"sumSpreadsheet[i]",
"sumSpreadsheet",
"i",
"j",
"{\n\t\t\t\t\tSystem.out.print(sumSpreadsheet[i][j] + \" \");\n\t\t\t\t}",
"System.out.print(sumSpreadsheet[i][j] + \" \")",
"System.out.print",
"System.out",
"System",
"System.out",
"sumSpreadsheet[i][j] + \" \"",
"sumSpreadsheet[i][j]",
"sumSpreadsheet[i]",
"sumSpreadsheet",
"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\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[][] spreadsheet = new int[r][c];\n\t\tint[][] sumSpreadsheet = 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\tspreadsheet[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\tsumSpreadsheet[i][j] = spreadsheet[i][j];\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\tsumSpreadsheet[i][c] += sumSpreadsheet[i][j];\n\t\t\t}\n\t\t}\n\t\tfor (int j = 0; j < c; j++) {\n\t\t\tfor (int i = 0; i < r; i++) {\n\t\t\t\tsumSpreadsheet[r][j] += sumSpreadsheet[i][j];\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\tsumSpreadsheet[r][c] += sumSpreadsheet[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\tif (j == c) {\n\t\t\t\t\tSystem.out.print(sumSpreadsheet[i][j]);\n\t\t\t\t} else {\n\t\t\t\t\tSystem.out.print(sumSpreadsheet[i][j] + \" \");\n\t\t\t\t}\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}\n\t\tsc.close();\n\t}\n}",
"public class Main{\n\tpublic static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\tint r = sc.nextInt();\n\t\tint c = sc.nextInt();\n\t\tint[][] spreadsheet = new int[r][c];\n\t\tint[][] sumSpreadsheet = 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\tspreadsheet[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\tsumSpreadsheet[i][j] = spreadsheet[i][j];\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\tsumSpreadsheet[i][c] += sumSpreadsheet[i][j];\n\t\t\t}\n\t\t}\n\t\tfor (int j = 0; j < c; j++) {\n\t\t\tfor (int i = 0; i < r; i++) {\n\t\t\t\tsumSpreadsheet[r][j] += sumSpreadsheet[i][j];\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\tsumSpreadsheet[r][c] += sumSpreadsheet[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\tif (j == c) {\n\t\t\t\t\tSystem.out.print(sumSpreadsheet[i][j]);\n\t\t\t\t} else {\n\t\t\t\t\tSystem.out.print(sumSpreadsheet[i][j] + \" \");\n\t\t\t\t}\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}\n\t\tsc.close();\n\t}\n}",
"Main"
] | import java.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[][] spreadsheet = new int[r][c];
int[][] sumSpreadsheet = new int[r + 1][c + 1];
for (int i = 0; i < r; i++) {
for (int j = 0; j < c; j++) {
spreadsheet[i][j] = sc.nextInt();
}
}
for (int i = 0; i < r; i++) {
for (int j = 0; j < c; j++) {
sumSpreadsheet[i][j] = spreadsheet[i][j];
}
}
for (int i = 0; i < r; i++) {
for (int j = 0; j < c; j++) {
sumSpreadsheet[i][c] += sumSpreadsheet[i][j];
}
}
for (int j = 0; j < c; j++) {
for (int i = 0; i < r; i++) {
sumSpreadsheet[r][j] += sumSpreadsheet[i][j];
}
}
for (int i = 0; i < r; i++) {
for (int j = 0; j < c; j++) {
sumSpreadsheet[r][c] += sumSpreadsheet[i][j];
}
}
for (int i = 0; i < r + 1; i++) {
for (int j = 0; j < c + 1; j++) {
if (j == c) {
System.out.print(sumSpreadsheet[i][j]);
} else {
System.out.print(sumSpreadsheet[i][j] + " ");
}
}
System.out.println();
}
sc.close();
}
}
|
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
41,
13,
20,
2,
13,
17,
2,
13,
17,
11,
1,
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,
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,
14,
2,
13,
13,
30,
0,
18,
18,
13,
13,
13,
18,
18,
13,
13,
13,
0,
18,
18,
13,
13,
13,
18,
18,
13,
13,
13,
14,
2,
13,
13,
30,
4,
18,
18,
13,
13,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
160,
5
],
[
160,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
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
],
[
8,
69
],
[
69,
70
],
[
70,
71
],
[
71,
72
],
[
71,
73
],
[
69,
74
],
[
74,
75
],
[
74,
76
],
[
76,
77
],
[
76,
78
],
[
69,
79
],
[
79,
80
],
[
80,
81
],
[
69,
82
],
[
83,
83
],
[
83,
84
],
[
84,
85
],
[
85,
86
],
[
86,
87
],
[
86,
88
],
[
84,
89
],
[
89,
90
],
[
89,
91
],
[
91,
92
],
[
91,
93
],
[
84,
94
],
[
94,
95
],
[
95,
96
],
[
84,
97
],
[
98,
98
],
[
98,
99
],
[
99,
100
],
[
100,
101
],
[
101,
102
],
[
101,
103
],
[
99,
104
],
[
104,
105
],
[
105,
106
],
[
105,
107
],
[
104,
108
],
[
98,
109
],
[
109,
110
],
[
110,
111
],
[
110,
112
],
[
109,
113
],
[
113,
114
],
[
114,
115
],
[
115,
116
],
[
116,
117
],
[
116,
118
],
[
114,
119
],
[
98,
120
],
[
120,
121
],
[
121,
122
],
[
121,
123
],
[
120,
124
],
[
124,
125
],
[
125,
126
],
[
126,
127
],
[
127,
128
],
[
127,
129
],
[
126,
130
],
[
125,
131
],
[
131,
132
],
[
132,
133
],
[
132,
134
],
[
131,
135
],
[
124,
136
],
[
136,
137
],
[
137,
138
],
[
138,
139
],
[
138,
140
],
[
137,
141
],
[
136,
142
],
[
142,
143
],
[
143,
144
],
[
143,
145
],
[
142,
146
],
[
98,
147
],
[
147,
148
],
[
148,
149
],
[
148,
150
],
[
147,
151
],
[
151,
152
],
[
152,
153
],
[
153,
154
],
[
154,
155
],
[
154,
156
],
[
6,
157
],
[
157,
158
],
[
0,
159
],
[
159,
160
],
[
159,
161
]
] | [
"import java.util.*;\n\npublic class Main {\n public static void main(String[] args) throws Exception {\nScanner sc = new Scanner(System.in);\n\t\tint r = sc.nextInt();\n\t\tint c = sc.nextInt();\n\t\tint[][] nums = 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 a = sc.nextInt();\n\t\t\t\tnums[i][j] = a;\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.print(nums[i][j]);\n\t\t\t\tif (j != c) {\n\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t}\n\n\t\t\t\tif (r > i) {\n\t\t\t\t\tnums[r][j] += nums[i][j];\n\t\t\t\t\tnums[i][c] += nums[i][j];\n\t\t\t\t}\n\n\t\t\t\tif (j == c) {\n\t\t\t\t\tSystem.out.println();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n }\n}\n",
"import java.util.*;",
"util.*",
"java",
"public class Main {\n public static void main(String[] args) throws Exception {\nScanner sc = new Scanner(System.in);\n\t\tint r = sc.nextInt();\n\t\tint c = sc.nextInt();\n\t\tint[][] nums = 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 a = sc.nextInt();\n\t\t\t\tnums[i][j] = a;\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.print(nums[i][j]);\n\t\t\t\tif (j != c) {\n\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t}\n\n\t\t\t\tif (r > i) {\n\t\t\t\t\tnums[r][j] += nums[i][j];\n\t\t\t\t\tnums[i][c] += nums[i][j];\n\t\t\t\t}\n\n\t\t\t\tif (j == c) {\n\t\t\t\t\tSystem.out.println();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n }\n}",
"Main",
"public static void main(String[] args) throws Exception {\nScanner sc = new Scanner(System.in);\n\t\tint r = sc.nextInt();\n\t\tint c = sc.nextInt();\n\t\tint[][] nums = 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 a = sc.nextInt();\n\t\t\t\tnums[i][j] = a;\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.print(nums[i][j]);\n\t\t\t\tif (j != c) {\n\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t}\n\n\t\t\t\tif (r > i) {\n\t\t\t\t\tnums[r][j] += nums[i][j];\n\t\t\t\t\tnums[i][c] += nums[i][j];\n\t\t\t\t}\n\n\t\t\t\tif (j == c) {\n\t\t\t\t\tSystem.out.println();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n }",
"main",
"{\nScanner sc = new Scanner(System.in);\n\t\tint r = sc.nextInt();\n\t\tint c = sc.nextInt();\n\t\tint[][] nums = 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 a = sc.nextInt();\n\t\t\t\tnums[i][j] = a;\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.print(nums[i][j]);\n\t\t\t\tif (j != c) {\n\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t}\n\n\t\t\t\tif (r > i) {\n\t\t\t\t\tnums[r][j] += nums[i][j];\n\t\t\t\t\tnums[i][c] += nums[i][j];\n\t\t\t\t}\n\n\t\t\t\tif (j == c) {\n\t\t\t\t\tSystem.out.println();\n\t\t\t\t}\n\t\t\t}\n\t\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[][] nums = new int[r + 1][c + 1];",
"nums",
"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 a = sc.nextInt();\n\t\t\t\tnums[i][j] = a;\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 a = sc.nextInt();\n\t\t\t\tnums[i][j] = a;\n\t\t\t}\n\t\t}",
"{\n\t\t\tfor (int j = 0; j < c; j++) {\n\t\t\t\tint a = sc.nextInt();\n\t\t\t\tnums[i][j] = a;\n\t\t\t}\n\t\t}",
"for (int j = 0; j < c; j++) {\n\t\t\t\tint a = sc.nextInt();\n\t\t\t\tnums[i][j] = a;\n\t\t\t}",
"int j = 0;",
"int j = 0;",
"j",
"0",
"j < c",
"j",
"c",
"j++",
"j++",
"j",
"{\n\t\t\t\tint a = sc.nextInt();\n\t\t\t\tnums[i][j] = a;\n\t\t\t}",
"{\n\t\t\t\tint a = sc.nextInt();\n\t\t\t\tnums[i][j] = a;\n\t\t\t}",
"int a = sc.nextInt();",
"a",
"sc.nextInt()",
"sc.nextInt",
"sc",
"nums[i][j] = a",
"nums[i][j]",
"nums[i]",
"nums",
"i",
"j",
"a",
"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(nums[i][j]);\n\t\t\t\tif (j != c) {\n\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t}\n\n\t\t\t\tif (r > i) {\n\t\t\t\t\tnums[r][j] += nums[i][j];\n\t\t\t\t\tnums[i][c] += nums[i][j];\n\t\t\t\t}\n\n\t\t\t\tif (j == c) {\n\t\t\t\t\tSystem.out.println();\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(nums[i][j]);\n\t\t\t\tif (j != c) {\n\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t}\n\n\t\t\t\tif (r > i) {\n\t\t\t\t\tnums[r][j] += nums[i][j];\n\t\t\t\t\tnums[i][c] += nums[i][j];\n\t\t\t\t}\n\n\t\t\t\tif (j == c) {\n\t\t\t\t\tSystem.out.println();\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"{\n\t\t\tfor (int j = 0; j < c + 1; j++) {\n\t\t\t\tSystem.out.print(nums[i][j]);\n\t\t\t\tif (j != c) {\n\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t}\n\n\t\t\t\tif (r > i) {\n\t\t\t\t\tnums[r][j] += nums[i][j];\n\t\t\t\t\tnums[i][c] += nums[i][j];\n\t\t\t\t}\n\n\t\t\t\tif (j == c) {\n\t\t\t\t\tSystem.out.println();\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(nums[i][j]);\n\t\t\t\tif (j != c) {\n\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t}\n\n\t\t\t\tif (r > i) {\n\t\t\t\t\tnums[r][j] += nums[i][j];\n\t\t\t\t\tnums[i][c] += nums[i][j];\n\t\t\t\t}\n\n\t\t\t\tif (j == c) {\n\t\t\t\t\tSystem.out.println();\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(nums[i][j]);\n\t\t\t\tif (j != c) {\n\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t}\n\n\t\t\t\tif (r > i) {\n\t\t\t\t\tnums[r][j] += nums[i][j];\n\t\t\t\t\tnums[i][c] += nums[i][j];\n\t\t\t\t}\n\n\t\t\t\tif (j == c) {\n\t\t\t\t\tSystem.out.println();\n\t\t\t\t}\n\t\t\t}",
"{\n\t\t\t\tSystem.out.print(nums[i][j]);\n\t\t\t\tif (j != c) {\n\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t}\n\n\t\t\t\tif (r > i) {\n\t\t\t\t\tnums[r][j] += nums[i][j];\n\t\t\t\t\tnums[i][c] += nums[i][j];\n\t\t\t\t}\n\n\t\t\t\tif (j == c) {\n\t\t\t\t\tSystem.out.println();\n\t\t\t\t}\n\t\t\t}",
"System.out.print(nums[i][j])",
"System.out.print",
"System.out",
"System",
"System.out",
"nums[i][j]",
"nums[i]",
"nums",
"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",
"\" \"",
"if (r > i) {\n\t\t\t\t\tnums[r][j] += nums[i][j];\n\t\t\t\t\tnums[i][c] += nums[i][j];\n\t\t\t\t}",
"r > i",
"r",
"i",
"{\n\t\t\t\t\tnums[r][j] += nums[i][j];\n\t\t\t\t\tnums[i][c] += nums[i][j];\n\t\t\t\t}",
"nums[r][j] += nums[i][j]",
"nums[r][j]",
"nums[r]",
"nums",
"r",
"j",
"nums[i][j]",
"nums[i]",
"nums",
"i",
"j",
"nums[i][c] += nums[i][j]",
"nums[i][c]",
"nums[i]",
"nums",
"i",
"c",
"nums[i][j]",
"nums[i]",
"nums",
"i",
"j",
"if (j == c) {\n\t\t\t\t\tSystem.out.println();\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",
"String[] args",
"args",
"public class Main {\n public static void main(String[] args) throws Exception {\nScanner sc = new Scanner(System.in);\n\t\tint r = sc.nextInt();\n\t\tint c = sc.nextInt();\n\t\tint[][] nums = 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 a = sc.nextInt();\n\t\t\t\tnums[i][j] = a;\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.print(nums[i][j]);\n\t\t\t\tif (j != c) {\n\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t}\n\n\t\t\t\tif (r > i) {\n\t\t\t\t\tnums[r][j] += nums[i][j];\n\t\t\t\t\tnums[i][c] += nums[i][j];\n\t\t\t\t}\n\n\t\t\t\tif (j == c) {\n\t\t\t\t\tSystem.out.println();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n }\n}",
"public class Main {\n public static void main(String[] args) throws Exception {\nScanner sc = new Scanner(System.in);\n\t\tint r = sc.nextInt();\n\t\tint c = sc.nextInt();\n\t\tint[][] nums = 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 a = sc.nextInt();\n\t\t\t\tnums[i][j] = a;\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.print(nums[i][j]);\n\t\t\t\tif (j != c) {\n\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t}\n\n\t\t\t\tif (r > i) {\n\t\t\t\t\tnums[r][j] += nums[i][j];\n\t\t\t\t\tnums[i][c] += nums[i][j];\n\t\t\t\t}\n\n\t\t\t\tif (j == c) {\n\t\t\t\t\tSystem.out.println();\n\t\t\t\t}\n\t\t\t}\n\t\t}\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 = sc.nextInt();
int c = sc.nextInt();
int[][] nums = new int[r + 1][c + 1];
for (int i = 0; i < r; i++) {
for (int j = 0; j < c; j++) {
int a = sc.nextInt();
nums[i][j] = a;
}
}
for (int i = 0; i < r + 1; i++) {
for (int j = 0; j < c + 1; j++) {
System.out.print(nums[i][j]);
if (j != c) {
System.out.print(" ");
}
if (r > i) {
nums[r][j] += nums[i][j];
nums[i][c] += nums[i][j];
}
if (j == c) {
System.out.println();
}
}
}
}
}
|
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
17,
41,
13,
0,
13,
4,
18,
4,
18,
13,
17,
41,
13,
4,
18,
13,
18,
13,
17,
41,
13,
4,
18,
13,
18,
13,
17,
0,
13,
20,
2,
13,
17,
2,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
4,
18,
4,
18,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
18,
18,
13,
13,
13,
4,
18,
13,
18,
13,
13,
0,
18,
18,
13,
13,
13,
18,
18,
13,
13,
13,
0,
18,
18,
13,
13,
13,
18,
18,
13,
13,
13,
0,
18,
18,
13,
13,
13,
18,
18,
13,
13,
13,
11,
1,
41,
13,
17,
2,
13,
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,
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
],
[
8,
15
],
[
15,
16
],
[
8,
17
],
[
17,
18
],
[
17,
19
],
[
19,
20
],
[
20,
21
],
[
21,
22
],
[
22,
23
],
[
19,
24
],
[
8,
25
],
[
25,
26
],
[
25,
27
],
[
27,
28
],
[
28,
29
],
[
27,
30
],
[
30,
31
],
[
30,
32
],
[
8,
33
],
[
33,
34
],
[
33,
35
],
[
35,
36
],
[
36,
37
],
[
35,
38
],
[
38,
39
],
[
38,
40
],
[
8,
41
],
[
41,
42
],
[
41,
43
],
[
44,
45
],
[
44,
46
],
[
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
],
[
65,
66
],
[
66,
67
],
[
67,
68
],
[
68,
69
],
[
65,
70
],
[
62,
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
],
[
85,
89
],
[
84,
90
],
[
90,
91
],
[
91,
92
],
[
90,
93
],
[
93,
94
],
[
93,
95
],
[
83,
96
],
[
96,
97
],
[
97,
98
],
[
98,
99
],
[
98,
100
],
[
97,
101
],
[
96,
102
],
[
102,
103
],
[
103,
104
],
[
103,
105
],
[
102,
106
],
[
83,
107
],
[
107,
108
],
[
108,
109
],
[
109,
110
],
[
109,
111
],
[
108,
112
],
[
107,
113
],
[
113,
114
],
[
114,
115
],
[
114,
116
],
[
113,
117
],
[
62,
118
],
[
118,
119
],
[
119,
120
],
[
120,
121
],
[
120,
122
],
[
119,
123
],
[
118,
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
],
[
136,
137
],
[
136,
138
],
[
129,
139
],
[
139,
140
],
[
140,
141
],
[
129,
142
],
[
143,
143
],
[
143,
144
],
[
144,
145
],
[
145,
146
],
[
146,
147
],
[
146,
148
],
[
144,
149
],
[
149,
150
],
[
149,
151
],
[
151,
152
],
[
151,
153
],
[
144,
154
],
[
154,
155
],
[
155,
156
],
[
144,
157
],
[
158,
158
],
[
158,
159
],
[
159,
160
],
[
160,
161
],
[
161,
162
],
[
161,
163
],
[
159,
164
],
[
164,
165
],
[
165,
166
],
[
165,
167
],
[
164,
168
],
[
158,
169
],
[
169,
170
],
[
170,
171
],
[
170,
172
],
[
169,
173
],
[
173,
174
],
[
174,
175
],
[
175,
176
],
[
175,
177
],
[
173,
178
],
[
143,
179
],
[
179,
180
],
[
180,
181
],
[
181,
182
],
[
181,
183
],
[
6,
184
],
[
184,
185
],
[
0,
186
],
[
186,
187
],
[
186,
188
]
] | [
"import java.io.*;\n\npublic class Main {\n\n\tpublic static void main(String[] args) throws IOException {\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\t\tString[] strargs = null;\n\t\tint[][] iTable;\n\t\t\n\t\tstrargs = br.readLine().split(\"\\\\s+\");\n\t\tint x = Integer.parseInt(strargs[0]);\n\t\tint y = Integer.parseInt(strargs[1]);\n\t\t\n\t\tiTable = new int[x + 1][y + 1];\n\t\t\n\t\tfor (int i = 0; i < x; i++) {\n\t\t\tstrargs = br.readLine().split(\"\\\\s+\");\n\t\t\tfor (int j = 0; j < y; j++) {\n\t\t\t\tiTable[i][j] = Integer.parseInt(strargs[j]);\n\t\t\t\tiTable[i][y] += iTable[i][j];\n\t\t\t\tiTable[x][j] += iTable[i][j];\n\t\t\t}\n\t\t\tiTable[x][y] += iTable[i][y];\n\t\t}\n\t\t\n\t\tfor(int i = 0; i < x + 1; i++) {\n\t\t\tfor(int j = 0; j < y + 1; j++) {\n\t\t\t\tSystem.out.print(iTable[i][j]);\n\t\t\t\tif (j != y) System.out.print(\" \");\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}\n\t}\n}",
"import java.io.*;",
"io.*",
"java",
"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\tString[] strargs = null;\n\t\tint[][] iTable;\n\t\t\n\t\tstrargs = br.readLine().split(\"\\\\s+\");\n\t\tint x = Integer.parseInt(strargs[0]);\n\t\tint y = Integer.parseInt(strargs[1]);\n\t\t\n\t\tiTable = new int[x + 1][y + 1];\n\t\t\n\t\tfor (int i = 0; i < x; i++) {\n\t\t\tstrargs = br.readLine().split(\"\\\\s+\");\n\t\t\tfor (int j = 0; j < y; j++) {\n\t\t\t\tiTable[i][j] = Integer.parseInt(strargs[j]);\n\t\t\t\tiTable[i][y] += iTable[i][j];\n\t\t\t\tiTable[x][j] += iTable[i][j];\n\t\t\t}\n\t\t\tiTable[x][y] += iTable[i][y];\n\t\t}\n\t\t\n\t\tfor(int i = 0; i < x + 1; i++) {\n\t\t\tfor(int j = 0; j < y + 1; j++) {\n\t\t\t\tSystem.out.print(iTable[i][j]);\n\t\t\t\tif (j != y) System.out.print(\" \");\n\t\t\t}\n\t\t\tSystem.out.println();\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[] strargs = null;\n\t\tint[][] iTable;\n\t\t\n\t\tstrargs = br.readLine().split(\"\\\\s+\");\n\t\tint x = Integer.parseInt(strargs[0]);\n\t\tint y = Integer.parseInt(strargs[1]);\n\t\t\n\t\tiTable = new int[x + 1][y + 1];\n\t\t\n\t\tfor (int i = 0; i < x; i++) {\n\t\t\tstrargs = br.readLine().split(\"\\\\s+\");\n\t\t\tfor (int j = 0; j < y; j++) {\n\t\t\t\tiTable[i][j] = Integer.parseInt(strargs[j]);\n\t\t\t\tiTable[i][y] += iTable[i][j];\n\t\t\t\tiTable[x][j] += iTable[i][j];\n\t\t\t}\n\t\t\tiTable[x][y] += iTable[i][y];\n\t\t}\n\t\t\n\t\tfor(int i = 0; i < x + 1; i++) {\n\t\t\tfor(int j = 0; j < y + 1; j++) {\n\t\t\t\tSystem.out.print(iTable[i][j]);\n\t\t\t\tif (j != y) System.out.print(\" \");\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}\n\t}",
"main",
"{\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\t\tString[] strargs = null;\n\t\tint[][] iTable;\n\t\t\n\t\tstrargs = br.readLine().split(\"\\\\s+\");\n\t\tint x = Integer.parseInt(strargs[0]);\n\t\tint y = Integer.parseInt(strargs[1]);\n\t\t\n\t\tiTable = new int[x + 1][y + 1];\n\t\t\n\t\tfor (int i = 0; i < x; i++) {\n\t\t\tstrargs = br.readLine().split(\"\\\\s+\");\n\t\t\tfor (int j = 0; j < y; j++) {\n\t\t\t\tiTable[i][j] = Integer.parseInt(strargs[j]);\n\t\t\t\tiTable[i][y] += iTable[i][j];\n\t\t\t\tiTable[x][j] += iTable[i][j];\n\t\t\t}\n\t\t\tiTable[x][y] += iTable[i][y];\n\t\t}\n\t\t\n\t\tfor(int i = 0; i < x + 1; i++) {\n\t\t\tfor(int j = 0; j < y + 1; j++) {\n\t\t\t\tSystem.out.print(iTable[i][j]);\n\t\t\t\tif (j != y) System.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))",
"String[] strargs = null;",
"strargs",
"null",
"int[][] iTable;",
"iTable",
"strargs = br.readLine().split(\"\\\\s+\")",
"strargs",
"br.readLine().split(\"\\\\s+\")",
"br.readLine().split",
"br.readLine()",
"br.readLine",
"br",
"\"\\\\s+\"",
"int x = Integer.parseInt(strargs[0]);",
"x",
"Integer.parseInt(strargs[0])",
"Integer.parseInt",
"Integer",
"strargs[0]",
"strargs",
"0",
"int y = Integer.parseInt(strargs[1]);",
"y",
"Integer.parseInt(strargs[1])",
"Integer.parseInt",
"Integer",
"strargs[1]",
"strargs",
"1",
"iTable = new int[x + 1][y + 1]",
"iTable",
"new int[x + 1][y + 1]",
"x + 1",
"x",
"1",
"y + 1",
"y",
"1",
"for (int i = 0; i < x; i++) {\n\t\t\tstrargs = br.readLine().split(\"\\\\s+\");\n\t\t\tfor (int j = 0; j < y; j++) {\n\t\t\t\tiTable[i][j] = Integer.parseInt(strargs[j]);\n\t\t\t\tiTable[i][y] += iTable[i][j];\n\t\t\t\tiTable[x][j] += iTable[i][j];\n\t\t\t}\n\t\t\tiTable[x][y] += iTable[i][y];\n\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < x",
"i",
"x",
"i++",
"i++",
"i",
"{\n\t\t\tstrargs = br.readLine().split(\"\\\\s+\");\n\t\t\tfor (int j = 0; j < y; j++) {\n\t\t\t\tiTable[i][j] = Integer.parseInt(strargs[j]);\n\t\t\t\tiTable[i][y] += iTable[i][j];\n\t\t\t\tiTable[x][j] += iTable[i][j];\n\t\t\t}\n\t\t\tiTable[x][y] += iTable[i][y];\n\t\t}",
"{\n\t\t\tstrargs = br.readLine().split(\"\\\\s+\");\n\t\t\tfor (int j = 0; j < y; j++) {\n\t\t\t\tiTable[i][j] = Integer.parseInt(strargs[j]);\n\t\t\t\tiTable[i][y] += iTable[i][j];\n\t\t\t\tiTable[x][j] += iTable[i][j];\n\t\t\t}\n\t\t\tiTable[x][y] += iTable[i][y];\n\t\t}",
"strargs = br.readLine().split(\"\\\\s+\")",
"strargs",
"br.readLine().split(\"\\\\s+\")",
"br.readLine().split",
"br.readLine()",
"br.readLine",
"br",
"\"\\\\s+\"",
"for (int j = 0; j < y; j++) {\n\t\t\t\tiTable[i][j] = Integer.parseInt(strargs[j]);\n\t\t\t\tiTable[i][y] += iTable[i][j];\n\t\t\t\tiTable[x][j] += iTable[i][j];\n\t\t\t}",
"int j = 0;",
"int j = 0;",
"j",
"0",
"j < y",
"j",
"y",
"j++",
"j++",
"j",
"{\n\t\t\t\tiTable[i][j] = Integer.parseInt(strargs[j]);\n\t\t\t\tiTable[i][y] += iTable[i][j];\n\t\t\t\tiTable[x][j] += iTable[i][j];\n\t\t\t}",
"{\n\t\t\t\tiTable[i][j] = Integer.parseInt(strargs[j]);\n\t\t\t\tiTable[i][y] += iTable[i][j];\n\t\t\t\tiTable[x][j] += iTable[i][j];\n\t\t\t}",
"iTable[i][j] = Integer.parseInt(strargs[j])",
"iTable[i][j]",
"iTable[i]",
"iTable",
"i",
"j",
"Integer.parseInt(strargs[j])",
"Integer.parseInt",
"Integer",
"strargs[j]",
"strargs",
"j",
"iTable[i][y] += iTable[i][j]",
"iTable[i][y]",
"iTable[i]",
"iTable",
"i",
"y",
"iTable[i][j]",
"iTable[i]",
"iTable",
"i",
"j",
"iTable[x][j] += iTable[i][j]",
"iTable[x][j]",
"iTable[x]",
"iTable",
"x",
"j",
"iTable[i][j]",
"iTable[i]",
"iTable",
"i",
"j",
"iTable[x][y] += iTable[i][y]",
"iTable[x][y]",
"iTable[x]",
"iTable",
"x",
"y",
"iTable[i][y]",
"iTable[i]",
"iTable",
"i",
"y",
"for(int i = 0; i < x + 1; i++) {\n\t\t\tfor(int j = 0; j < y + 1; j++) {\n\t\t\t\tSystem.out.print(iTable[i][j]);\n\t\t\t\tif (j != y) System.out.print(\" \");\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < x + 1",
"i",
"x + 1",
"x",
"1",
"i++",
"i++",
"i",
"{\n\t\t\tfor(int j = 0; j < y + 1; j++) {\n\t\t\t\tSystem.out.print(iTable[i][j]);\n\t\t\t\tif (j != y) System.out.print(\" \");\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}",
"{\n\t\t\tfor(int j = 0; j < y + 1; j++) {\n\t\t\t\tSystem.out.print(iTable[i][j]);\n\t\t\t\tif (j != y) System.out.print(\" \");\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}",
"for(int j = 0; j < y + 1; j++) {\n\t\t\t\tSystem.out.print(iTable[i][j]);\n\t\t\t\tif (j != y) System.out.print(\" \");\n\t\t\t}",
"int j = 0;",
"int j = 0;",
"j",
"0",
"j < y + 1",
"j",
"y + 1",
"y",
"1",
"j++",
"j++",
"j",
"{\n\t\t\t\tSystem.out.print(iTable[i][j]);\n\t\t\t\tif (j != y) System.out.print(\" \");\n\t\t\t}",
"{\n\t\t\t\tSystem.out.print(iTable[i][j]);\n\t\t\t\tif (j != y) System.out.print(\" \");\n\t\t\t}",
"System.out.print(iTable[i][j])",
"System.out.print",
"System.out",
"System",
"System.out",
"iTable[i][j]",
"iTable[i]",
"iTable",
"i",
"j",
"if (j != y) System.out.print(\" \");",
"j != y",
"j",
"y",
"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\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\t\tString[] strargs = null;\n\t\tint[][] iTable;\n\t\t\n\t\tstrargs = br.readLine().split(\"\\\\s+\");\n\t\tint x = Integer.parseInt(strargs[0]);\n\t\tint y = Integer.parseInt(strargs[1]);\n\t\t\n\t\tiTable = new int[x + 1][y + 1];\n\t\t\n\t\tfor (int i = 0; i < x; i++) {\n\t\t\tstrargs = br.readLine().split(\"\\\\s+\");\n\t\t\tfor (int j = 0; j < y; j++) {\n\t\t\t\tiTable[i][j] = Integer.parseInt(strargs[j]);\n\t\t\t\tiTable[i][y] += iTable[i][j];\n\t\t\t\tiTable[x][j] += iTable[i][j];\n\t\t\t}\n\t\t\tiTable[x][y] += iTable[i][y];\n\t\t}\n\t\t\n\t\tfor(int i = 0; i < x + 1; i++) {\n\t\t\tfor(int j = 0; j < y + 1; j++) {\n\t\t\t\tSystem.out.print(iTable[i][j]);\n\t\t\t\tif (j != y) System.out.print(\" \");\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) throws IOException {\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\t\tString[] strargs = null;\n\t\tint[][] iTable;\n\t\t\n\t\tstrargs = br.readLine().split(\"\\\\s+\");\n\t\tint x = Integer.parseInt(strargs[0]);\n\t\tint y = Integer.parseInt(strargs[1]);\n\t\t\n\t\tiTable = new int[x + 1][y + 1];\n\t\t\n\t\tfor (int i = 0; i < x; i++) {\n\t\t\tstrargs = br.readLine().split(\"\\\\s+\");\n\t\t\tfor (int j = 0; j < y; j++) {\n\t\t\t\tiTable[i][j] = Integer.parseInt(strargs[j]);\n\t\t\t\tiTable[i][y] += iTable[i][j];\n\t\t\t\tiTable[x][j] += iTable[i][j];\n\t\t\t}\n\t\t\tiTable[x][y] += iTable[i][y];\n\t\t}\n\t\t\n\t\tfor(int i = 0; i < x + 1; i++) {\n\t\t\tfor(int j = 0; j < y + 1; j++) {\n\t\t\t\tSystem.out.print(iTable[i][j]);\n\t\t\t\tif (j != y) System.out.print(\" \");\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}\n\t}\n}",
"Main"
] | import java.io.*;
public class Main {
public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
String[] strargs = null;
int[][] iTable;
strargs = br.readLine().split("\\s+");
int x = Integer.parseInt(strargs[0]);
int y = Integer.parseInt(strargs[1]);
iTable = new int[x + 1][y + 1];
for (int i = 0; i < x; i++) {
strargs = br.readLine().split("\\s+");
for (int j = 0; j < y; j++) {
iTable[i][j] = Integer.parseInt(strargs[j]);
iTable[i][y] += iTable[i][j];
iTable[x][j] += iTable[i][j];
}
iTable[x][y] += iTable[i][y];
}
for(int i = 0; i < x + 1; i++) {
for(int j = 0; j < y + 1; j++) {
System.out.print(iTable[i][j]);
if (j != y) System.out.print(" ");
}
System.out.println();
}
}
} |
[
7,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
41,
13,
20,
2,
2,
2,
17,
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,
2,
2,
17,
13,
13,
4,
18,
13,
4,
18,
18,
13,
13,
2,
18,
13,
2,
2,
17,
13,
13,
17,
0,
18,
13,
2,
2,
17,
13,
13,
2,
18,
13,
2,
2,
17,
13,
13,
18,
13,
2,
2,
17,
13,
13,
0,
18,
13,
2,
2,
17,
13,
13,
2,
18,
13,
2,
2,
17,
13,
13,
18,
13,
2,
2,
17,
13,
13,
4,
18,
18,
13,
13,
18,
13,
2,
2,
17,
13,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
4,
18,
18,
13,
13,
2,
18,
13,
2,
2,
17,
13,
13,
17,
0,
18,
13,
2,
2,
17,
13,
13,
2,
18,
13,
2,
2,
17,
13,
13,
18,
13,
2,
2,
17,
13,
13,
4,
18,
18,
13,
13,
18,
13,
2,
2,
17,
13,
13,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
209,
8
],
[
209,
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
],
[
29,
29
],
[
29,
30
],
[
30,
31
],
[
30,
32
],
[
29,
33
],
[
29,
34
],
[
11,
35
],
[
35,
36
],
[
36,
37
],
[
37,
38
],
[
37,
39
],
[
35,
40
],
[
40,
41
],
[
40,
42
],
[
35,
43
],
[
43,
44
],
[
44,
45
],
[
35,
46
],
[
47,
47
],
[
47,
48
],
[
48,
49
],
[
49,
50
],
[
50,
51
],
[
50,
52
],
[
48,
53
],
[
53,
54
],
[
53,
55
],
[
48,
56
],
[
56,
57
],
[
57,
58
],
[
48,
59
],
[
60,
60
],
[
60,
61
],
[
61,
62
],
[
62,
63
],
[
62,
64
],
[
64,
65
],
[
65,
66
],
[
65,
67
],
[
64,
68
],
[
61,
69
],
[
69,
70
],
[
70,
71
],
[
60,
72
],
[
72,
73
],
[
73,
74
],
[
74,
75
],
[
74,
76
],
[
72,
77
],
[
77,
78
],
[
78,
79
],
[
78,
80
],
[
80,
81
],
[
81,
82
],
[
81,
83
],
[
80,
84
],
[
77,
85
],
[
60,
86
],
[
86,
87
],
[
87,
88
],
[
87,
89
],
[
89,
90
],
[
90,
91
],
[
90,
92
],
[
89,
93
],
[
86,
94
],
[
94,
95
],
[
95,
96
],
[
95,
97
],
[
97,
98
],
[
98,
99
],
[
98,
100
],
[
97,
101
],
[
94,
102
],
[
102,
103
],
[
102,
104
],
[
104,
105
],
[
105,
106
],
[
105,
107
],
[
104,
108
],
[
60,
109
],
[
109,
110
],
[
110,
111
],
[
110,
112
],
[
112,
113
],
[
113,
114
],
[
113,
115
],
[
112,
116
],
[
109,
117
],
[
117,
118
],
[
118,
119
],
[
118,
120
],
[
120,
121
],
[
121,
122
],
[
121,
123
],
[
120,
124
],
[
117,
125
],
[
125,
126
],
[
125,
127
],
[
127,
128
],
[
128,
129
],
[
128,
130
],
[
127,
131
],
[
47,
132
],
[
132,
133
],
[
133,
134
],
[
134,
135
],
[
134,
136
],
[
132,
137
],
[
137,
138
],
[
137,
139
],
[
139,
140
],
[
140,
141
],
[
140,
142
],
[
139,
143
],
[
11,
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
],
[
163,
164
],
[
163,
165
],
[
165,
166
],
[
166,
167
],
[
166,
168
],
[
165,
169
],
[
162,
170
],
[
156,
171
],
[
171,
172
],
[
172,
173
],
[
172,
174
],
[
174,
175
],
[
175,
176
],
[
175,
177
],
[
174,
178
],
[
171,
179
],
[
179,
180
],
[
180,
181
],
[
180,
182
],
[
182,
183
],
[
183,
184
],
[
183,
185
],
[
182,
186
],
[
179,
187
],
[
187,
188
],
[
187,
189
],
[
189,
190
],
[
190,
191
],
[
190,
192
],
[
189,
193
],
[
11,
194
],
[
194,
195
],
[
195,
196
],
[
196,
197
],
[
196,
198
],
[
194,
199
],
[
199,
200
],
[
199,
201
],
[
201,
202
],
[
202,
203
],
[
202,
204
],
[
201,
205
],
[
9,
206
],
[
206,
207
],
[
0,
208
],
[
208,
209
],
[
208,
210
]
] | [
"import java.io.IOException;\nimport java.util.Scanner;\npublic class Main {\n\n\tpublic static void main(String[] args) throws Exception {\n\t\t// TODO ?????????????????????????????????????????????\n\t\t\tScanner sc = new Scanner(System.in);\n\t\t\tint r = sc.nextInt();\n\t\t\tint c = sc.nextInt();\n\t\t\tint []a = new int[1000*r+c+1];\n\t\t\tfor(int b=0;b<r;++b){\n\t\t\t\tfor(int d=0;d<c;++d){\n\t\t\t\t\ta[1000*b+d] = sc.nextInt();\n\t\t\t\t\tSystem.out.print(a[1000*b+d]+\" \");\n\t\t\t\t\ta[1000*b+c]=a[1000*b+c]+a[1000*b+d];\n\t\t\t\t\ta[1000*r+d]=a[1000*r+d]+a[1000*b+d];\n\t\t\t\t}\n\t\t\t\tSystem.out.println(a[1000*b+c]);\n\t\t\t}\n\t\t\tfor(int d=0;d<c;++d){\n\t\t\t\tSystem.out.print(a[1000*r+d]+\" \");\n\t\t\t\ta[1000*r+c]=a[1000*r+c]+a[1000*r+d];\n\t\t\t}\n\t\t\tSystem.out.println(a[1000*r+c]);\n\t}\n\n}",
"import java.io.IOException;",
"IOException",
"java.io",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n\n\tpublic static void main(String[] args) throws Exception {\n\t\t// TODO ?????????????????????????????????????????????\n\t\t\tScanner sc = new Scanner(System.in);\n\t\t\tint r = sc.nextInt();\n\t\t\tint c = sc.nextInt();\n\t\t\tint []a = new int[1000*r+c+1];\n\t\t\tfor(int b=0;b<r;++b){\n\t\t\t\tfor(int d=0;d<c;++d){\n\t\t\t\t\ta[1000*b+d] = sc.nextInt();\n\t\t\t\t\tSystem.out.print(a[1000*b+d]+\" \");\n\t\t\t\t\ta[1000*b+c]=a[1000*b+c]+a[1000*b+d];\n\t\t\t\t\ta[1000*r+d]=a[1000*r+d]+a[1000*b+d];\n\t\t\t\t}\n\t\t\t\tSystem.out.println(a[1000*b+c]);\n\t\t\t}\n\t\t\tfor(int d=0;d<c;++d){\n\t\t\t\tSystem.out.print(a[1000*r+d]+\" \");\n\t\t\t\ta[1000*r+c]=a[1000*r+c]+a[1000*r+d];\n\t\t\t}\n\t\t\tSystem.out.println(a[1000*r+c]);\n\t}\n\n}",
"Main",
"public static void main(String[] args) throws Exception {\n\t\t// TODO ?????????????????????????????????????????????\n\t\t\tScanner sc = new Scanner(System.in);\n\t\t\tint r = sc.nextInt();\n\t\t\tint c = sc.nextInt();\n\t\t\tint []a = new int[1000*r+c+1];\n\t\t\tfor(int b=0;b<r;++b){\n\t\t\t\tfor(int d=0;d<c;++d){\n\t\t\t\t\ta[1000*b+d] = sc.nextInt();\n\t\t\t\t\tSystem.out.print(a[1000*b+d]+\" \");\n\t\t\t\t\ta[1000*b+c]=a[1000*b+c]+a[1000*b+d];\n\t\t\t\t\ta[1000*r+d]=a[1000*r+d]+a[1000*b+d];\n\t\t\t\t}\n\t\t\t\tSystem.out.println(a[1000*b+c]);\n\t\t\t}\n\t\t\tfor(int d=0;d<c;++d){\n\t\t\t\tSystem.out.print(a[1000*r+d]+\" \");\n\t\t\t\ta[1000*r+c]=a[1000*r+c]+a[1000*r+d];\n\t\t\t}\n\t\t\tSystem.out.println(a[1000*r+c]);\n\t}",
"main",
"{\n\t\t// TODO ?????????????????????????????????????????????\n\t\t\tScanner sc = new Scanner(System.in);\n\t\t\tint r = sc.nextInt();\n\t\t\tint c = sc.nextInt();\n\t\t\tint []a = new int[1000*r+c+1];\n\t\t\tfor(int b=0;b<r;++b){\n\t\t\t\tfor(int d=0;d<c;++d){\n\t\t\t\t\ta[1000*b+d] = sc.nextInt();\n\t\t\t\t\tSystem.out.print(a[1000*b+d]+\" \");\n\t\t\t\t\ta[1000*b+c]=a[1000*b+c]+a[1000*b+d];\n\t\t\t\t\ta[1000*r+d]=a[1000*r+d]+a[1000*b+d];\n\t\t\t\t}\n\t\t\t\tSystem.out.println(a[1000*b+c]);\n\t\t\t}\n\t\t\tfor(int d=0;d<c;++d){\n\t\t\t\tSystem.out.print(a[1000*r+d]+\" \");\n\t\t\t\ta[1000*r+c]=a[1000*r+c]+a[1000*r+d];\n\t\t\t}\n\t\t\tSystem.out.println(a[1000*r+c]);\n\t}",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"int r = sc.nextInt();",
"r",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int c = sc.nextInt();",
"c",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int []a = new int[1000*r+c+1];",
"a",
"new int[1000*r+c+1]",
"1000*r+c+1",
"1000*r+c+1",
"1000*r",
"1000",
"r",
"c",
"1",
"for(int b=0;b<r;++b){\n\t\t\t\tfor(int d=0;d<c;++d){\n\t\t\t\t\ta[1000*b+d] = sc.nextInt();\n\t\t\t\t\tSystem.out.print(a[1000*b+d]+\" \");\n\t\t\t\t\ta[1000*b+c]=a[1000*b+c]+a[1000*b+d];\n\t\t\t\t\ta[1000*r+d]=a[1000*r+d]+a[1000*b+d];\n\t\t\t\t}\n\t\t\t\tSystem.out.println(a[1000*b+c]);\n\t\t\t}",
"int b=0;",
"int b=0;",
"b",
"0",
"b<r",
"b",
"r",
"++b",
"++b",
"b",
"{\n\t\t\t\tfor(int d=0;d<c;++d){\n\t\t\t\t\ta[1000*b+d] = sc.nextInt();\n\t\t\t\t\tSystem.out.print(a[1000*b+d]+\" \");\n\t\t\t\t\ta[1000*b+c]=a[1000*b+c]+a[1000*b+d];\n\t\t\t\t\ta[1000*r+d]=a[1000*r+d]+a[1000*b+d];\n\t\t\t\t}\n\t\t\t\tSystem.out.println(a[1000*b+c]);\n\t\t\t}",
"{\n\t\t\t\tfor(int d=0;d<c;++d){\n\t\t\t\t\ta[1000*b+d] = sc.nextInt();\n\t\t\t\t\tSystem.out.print(a[1000*b+d]+\" \");\n\t\t\t\t\ta[1000*b+c]=a[1000*b+c]+a[1000*b+d];\n\t\t\t\t\ta[1000*r+d]=a[1000*r+d]+a[1000*b+d];\n\t\t\t\t}\n\t\t\t\tSystem.out.println(a[1000*b+c]);\n\t\t\t}",
"for(int d=0;d<c;++d){\n\t\t\t\t\ta[1000*b+d] = sc.nextInt();\n\t\t\t\t\tSystem.out.print(a[1000*b+d]+\" \");\n\t\t\t\t\ta[1000*b+c]=a[1000*b+c]+a[1000*b+d];\n\t\t\t\t\ta[1000*r+d]=a[1000*r+d]+a[1000*b+d];\n\t\t\t\t}",
"int d=0;",
"int d=0;",
"d",
"0",
"d<c",
"d",
"c",
"++d",
"++d",
"d",
"{\n\t\t\t\t\ta[1000*b+d] = sc.nextInt();\n\t\t\t\t\tSystem.out.print(a[1000*b+d]+\" \");\n\t\t\t\t\ta[1000*b+c]=a[1000*b+c]+a[1000*b+d];\n\t\t\t\t\ta[1000*r+d]=a[1000*r+d]+a[1000*b+d];\n\t\t\t\t}",
"{\n\t\t\t\t\ta[1000*b+d] = sc.nextInt();\n\t\t\t\t\tSystem.out.print(a[1000*b+d]+\" \");\n\t\t\t\t\ta[1000*b+c]=a[1000*b+c]+a[1000*b+d];\n\t\t\t\t\ta[1000*r+d]=a[1000*r+d]+a[1000*b+d];\n\t\t\t\t}",
"a[1000*b+d] = sc.nextInt()",
"a[1000*b+d]",
"a",
"1000*b+d",
"1000*b",
"1000",
"b",
"d",
"sc.nextInt()",
"sc.nextInt",
"sc",
"System.out.print(a[1000*b+d]+\" \")",
"System.out.print",
"System.out",
"System",
"System.out",
"a[1000*b+d]+\" \"",
"a[1000*b+d]",
"a",
"1000*b+d",
"1000*b",
"1000",
"b",
"d",
"\" \"",
"a[1000*b+c]=a[1000*b+c]+a[1000*b+d]",
"a[1000*b+c]",
"a",
"1000*b+c",
"1000*b",
"1000",
"b",
"c",
"a[1000*b+c]+a[1000*b+d]",
"a[1000*b+c]",
"a",
"1000*b+c",
"1000*b",
"1000",
"b",
"c",
"a[1000*b+d]",
"a",
"1000*b+d",
"1000*b",
"1000",
"b",
"d",
"a[1000*r+d]=a[1000*r+d]+a[1000*b+d]",
"a[1000*r+d]",
"a",
"1000*r+d",
"1000*r",
"1000",
"r",
"d",
"a[1000*r+d]+a[1000*b+d]",
"a[1000*r+d]",
"a",
"1000*r+d",
"1000*r",
"1000",
"r",
"d",
"a[1000*b+d]",
"a",
"1000*b+d",
"1000*b",
"1000",
"b",
"d",
"System.out.println(a[1000*b+c])",
"System.out.println",
"System.out",
"System",
"System.out",
"a[1000*b+c]",
"a",
"1000*b+c",
"1000*b",
"1000",
"b",
"c",
"for(int d=0;d<c;++d){\n\t\t\t\tSystem.out.print(a[1000*r+d]+\" \");\n\t\t\t\ta[1000*r+c]=a[1000*r+c]+a[1000*r+d];\n\t\t\t}",
"int d=0;",
"int d=0;",
"d",
"0",
"d<c",
"d",
"c",
"++d",
"++d",
"d",
"{\n\t\t\t\tSystem.out.print(a[1000*r+d]+\" \");\n\t\t\t\ta[1000*r+c]=a[1000*r+c]+a[1000*r+d];\n\t\t\t}",
"{\n\t\t\t\tSystem.out.print(a[1000*r+d]+\" \");\n\t\t\t\ta[1000*r+c]=a[1000*r+c]+a[1000*r+d];\n\t\t\t}",
"System.out.print(a[1000*r+d]+\" \")",
"System.out.print",
"System.out",
"System",
"System.out",
"a[1000*r+d]+\" \"",
"a[1000*r+d]",
"a",
"1000*r+d",
"1000*r",
"1000",
"r",
"d",
"\" \"",
"a[1000*r+c]=a[1000*r+c]+a[1000*r+d]",
"a[1000*r+c]",
"a",
"1000*r+c",
"1000*r",
"1000",
"r",
"c",
"a[1000*r+c]+a[1000*r+d]",
"a[1000*r+c]",
"a",
"1000*r+c",
"1000*r",
"1000",
"r",
"c",
"a[1000*r+d]",
"a",
"1000*r+d",
"1000*r",
"1000",
"r",
"d",
"System.out.println(a[1000*r+c])",
"System.out.println",
"System.out",
"System",
"System.out",
"a[1000*r+c]",
"a",
"1000*r+c",
"1000*r",
"1000",
"r",
"c",
"String[] args",
"args",
"public class Main {\n\n\tpublic static void main(String[] args) throws Exception {\n\t\t// TODO ?????????????????????????????????????????????\n\t\t\tScanner sc = new Scanner(System.in);\n\t\t\tint r = sc.nextInt();\n\t\t\tint c = sc.nextInt();\n\t\t\tint []a = new int[1000*r+c+1];\n\t\t\tfor(int b=0;b<r;++b){\n\t\t\t\tfor(int d=0;d<c;++d){\n\t\t\t\t\ta[1000*b+d] = sc.nextInt();\n\t\t\t\t\tSystem.out.print(a[1000*b+d]+\" \");\n\t\t\t\t\ta[1000*b+c]=a[1000*b+c]+a[1000*b+d];\n\t\t\t\t\ta[1000*r+d]=a[1000*r+d]+a[1000*b+d];\n\t\t\t\t}\n\t\t\t\tSystem.out.println(a[1000*b+c]);\n\t\t\t}\n\t\t\tfor(int d=0;d<c;++d){\n\t\t\t\tSystem.out.print(a[1000*r+d]+\" \");\n\t\t\t\ta[1000*r+c]=a[1000*r+c]+a[1000*r+d];\n\t\t\t}\n\t\t\tSystem.out.println(a[1000*r+c]);\n\t}\n\n}",
"public class Main {\n\n\tpublic static void main(String[] args) throws Exception {\n\t\t// TODO ?????????????????????????????????????????????\n\t\t\tScanner sc = new Scanner(System.in);\n\t\t\tint r = sc.nextInt();\n\t\t\tint c = sc.nextInt();\n\t\t\tint []a = new int[1000*r+c+1];\n\t\t\tfor(int b=0;b<r;++b){\n\t\t\t\tfor(int d=0;d<c;++d){\n\t\t\t\t\ta[1000*b+d] = sc.nextInt();\n\t\t\t\t\tSystem.out.print(a[1000*b+d]+\" \");\n\t\t\t\t\ta[1000*b+c]=a[1000*b+c]+a[1000*b+d];\n\t\t\t\t\ta[1000*r+d]=a[1000*r+d]+a[1000*b+d];\n\t\t\t\t}\n\t\t\t\tSystem.out.println(a[1000*b+c]);\n\t\t\t}\n\t\t\tfor(int d=0;d<c;++d){\n\t\t\t\tSystem.out.print(a[1000*r+d]+\" \");\n\t\t\t\ta[1000*r+c]=a[1000*r+c]+a[1000*r+d];\n\t\t\t}\n\t\t\tSystem.out.println(a[1000*r+c]);\n\t}\n\n}",
"Main"
] | import java.io.IOException;
import java.util.Scanner;
public class Main {
public static void main(String[] args) throws Exception {
// TODO ?????????????????????????????????????????????
Scanner sc = new Scanner(System.in);
int r = sc.nextInt();
int c = sc.nextInt();
int []a = new int[1000*r+c+1];
for(int b=0;b<r;++b){
for(int d=0;d<c;++d){
a[1000*b+d] = sc.nextInt();
System.out.print(a[1000*b+d]+" ");
a[1000*b+c]=a[1000*b+c]+a[1000*b+d];
a[1000*r+d]=a[1000*r+d]+a[1000*b+d];
}
System.out.println(a[1000*b+c]);
}
for(int d=0;d<c;++d){
System.out.print(a[1000*r+d]+" ");
a[1000*r+c]=a[1000*r+c]+a[1000*r+d];
}
System.out.println(a[1000*r+c]);
}
} |
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
41,
13,
41,
13,
41,
13,
17,
41,
13,
17,
41,
13,
41,
13,
41,
13,
20,
0,
13,
4,
18,
13,
0,
13,
4,
18,
13,
41,
13,
20,
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,
13,
4,
18,
13,
0,
13,
13,
0,
18,
13,
13,
13,
4,
18,
18,
13,
13,
2,
13,
17,
4,
18,
18,
13,
13,
13,
0,
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,
4,
18,
18,
13,
13,
13,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
133,
5
],
[
133,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
8,
11
],
[
11,
12
],
[
8,
13
],
[
13,
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
],
[
25,
27
],
[
8,
28
],
[
28,
29
],
[
28,
30
],
[
30,
31
],
[
31,
32
],
[
8,
33
],
[
33,
34
],
[
33,
35
],
[
35,
36
],
[
36,
37
],
[
8,
38
],
[
38,
39
],
[
38,
40
],
[
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
],
[
68,
70
],
[
70,
71
],
[
71,
72
],
[
67,
73
],
[
73,
74
],
[
73,
75
],
[
67,
76
],
[
76,
77
],
[
77,
78
],
[
77,
79
],
[
76,
80
],
[
67,
81
],
[
81,
82
],
[
82,
83
],
[
83,
84
],
[
83,
85
],
[
81,
86
],
[
86,
87
],
[
86,
88
],
[
54,
89
],
[
89,
90
],
[
90,
91
],
[
91,
92
],
[
91,
93
],
[
89,
94
],
[
54,
95
],
[
95,
96
],
[
95,
97
],
[
54,
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
],
[
120,
121
],
[
120,
122
],
[
119,
123
],
[
8,
124
],
[
124,
125
],
[
125,
126
],
[
126,
127
],
[
126,
128
],
[
124,
129
],
[
6,
130
],
[
130,
131
],
[
0,
132
],
[
132,
133
],
[
132,
134
]
] | [
"import java.util.Scanner;\n\npublic class Main {\n\tpublic static void main(String[] args) {\n\t\tint r, c, num, ssum = 0,total=0;\n\t\tint i, j;\n\t\tScanner scan = new Scanner(System.in);\n\t\tr = scan.nextInt();\n\t\tc = scan.nextInt();\n\t\tint[] vsum=new int[c];\n\t\tfor (i = 0; i < r; i++) {\n\t\t\tfor (j = 0; j < c; j++) {\n\t\t\t\tnum = scan.nextInt();\n\t\t\t\tssum += num;\n\t\t\t\tvsum[j]+=num;\n\t\t\t\tSystem.out.print(num+\" \");\n\t\t\t}\n\t\t\tSystem.out.println(ssum);\n\t\t\ttotal+=ssum;\n\t\t\tssum=0;\n\t\t}\n\t\tfor(i=0;i<c;i++) {\n\t\t\tSystem.out.print(vsum[i]+\" \");\n\t\t}\n\t\tSystem.out.println(total);\n\n\t}\n\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n\tpublic static void main(String[] args) {\n\t\tint r, c, num, ssum = 0,total=0;\n\t\tint i, j;\n\t\tScanner scan = new Scanner(System.in);\n\t\tr = scan.nextInt();\n\t\tc = scan.nextInt();\n\t\tint[] vsum=new int[c];\n\t\tfor (i = 0; i < r; i++) {\n\t\t\tfor (j = 0; j < c; j++) {\n\t\t\t\tnum = scan.nextInt();\n\t\t\t\tssum += num;\n\t\t\t\tvsum[j]+=num;\n\t\t\t\tSystem.out.print(num+\" \");\n\t\t\t}\n\t\t\tSystem.out.println(ssum);\n\t\t\ttotal+=ssum;\n\t\t\tssum=0;\n\t\t}\n\t\tfor(i=0;i<c;i++) {\n\t\t\tSystem.out.print(vsum[i]+\" \");\n\t\t}\n\t\tSystem.out.println(total);\n\n\t}\n\n}",
"Main",
"public static void main(String[] args) {\n\t\tint r, c, num, ssum = 0,total=0;\n\t\tint i, j;\n\t\tScanner scan = new Scanner(System.in);\n\t\tr = scan.nextInt();\n\t\tc = scan.nextInt();\n\t\tint[] vsum=new int[c];\n\t\tfor (i = 0; i < r; i++) {\n\t\t\tfor (j = 0; j < c; j++) {\n\t\t\t\tnum = scan.nextInt();\n\t\t\t\tssum += num;\n\t\t\t\tvsum[j]+=num;\n\t\t\t\tSystem.out.print(num+\" \");\n\t\t\t}\n\t\t\tSystem.out.println(ssum);\n\t\t\ttotal+=ssum;\n\t\t\tssum=0;\n\t\t}\n\t\tfor(i=0;i<c;i++) {\n\t\t\tSystem.out.print(vsum[i]+\" \");\n\t\t}\n\t\tSystem.out.println(total);\n\n\t}",
"main",
"{\n\t\tint r, c, num, ssum = 0,total=0;\n\t\tint i, j;\n\t\tScanner scan = new Scanner(System.in);\n\t\tr = scan.nextInt();\n\t\tc = scan.nextInt();\n\t\tint[] vsum=new int[c];\n\t\tfor (i = 0; i < r; i++) {\n\t\t\tfor (j = 0; j < c; j++) {\n\t\t\t\tnum = scan.nextInt();\n\t\t\t\tssum += num;\n\t\t\t\tvsum[j]+=num;\n\t\t\t\tSystem.out.print(num+\" \");\n\t\t\t}\n\t\t\tSystem.out.println(ssum);\n\t\t\ttotal+=ssum;\n\t\t\tssum=0;\n\t\t}\n\t\tfor(i=0;i<c;i++) {\n\t\t\tSystem.out.print(vsum[i]+\" \");\n\t\t}\n\t\tSystem.out.println(total);\n\n\t}",
"int r",
"r",
"c",
"c",
"num",
"num",
"ssum = 0",
"ssum",
"0",
"total=0;",
"total",
"0",
"int i",
"i",
"j;",
"j",
"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[] vsum=new int[c];",
"vsum",
"new int[c]",
"c",
"for (i = 0; i < r; i++) {\n\t\t\tfor (j = 0; j < c; j++) {\n\t\t\t\tnum = scan.nextInt();\n\t\t\t\tssum += num;\n\t\t\t\tvsum[j]+=num;\n\t\t\t\tSystem.out.print(num+\" \");\n\t\t\t}\n\t\t\tSystem.out.println(ssum);\n\t\t\ttotal+=ssum;\n\t\t\tssum=0;\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\tnum = scan.nextInt();\n\t\t\t\tssum += num;\n\t\t\t\tvsum[j]+=num;\n\t\t\t\tSystem.out.print(num+\" \");\n\t\t\t}\n\t\t\tSystem.out.println(ssum);\n\t\t\ttotal+=ssum;\n\t\t\tssum=0;\n\t\t}",
"{\n\t\t\tfor (j = 0; j < c; j++) {\n\t\t\t\tnum = scan.nextInt();\n\t\t\t\tssum += num;\n\t\t\t\tvsum[j]+=num;\n\t\t\t\tSystem.out.print(num+\" \");\n\t\t\t}\n\t\t\tSystem.out.println(ssum);\n\t\t\ttotal+=ssum;\n\t\t\tssum=0;\n\t\t}",
"for (j = 0; j < c; j++) {\n\t\t\t\tnum = scan.nextInt();\n\t\t\t\tssum += num;\n\t\t\t\tvsum[j]+=num;\n\t\t\t\tSystem.out.print(num+\" \");\n\t\t\t}",
"j = 0;",
"j = 0",
"j",
"0",
"j < c",
"j",
"c",
"j++",
"j++",
"j",
"{\n\t\t\t\tnum = scan.nextInt();\n\t\t\t\tssum += num;\n\t\t\t\tvsum[j]+=num;\n\t\t\t\tSystem.out.print(num+\" \");\n\t\t\t}",
"{\n\t\t\t\tnum = scan.nextInt();\n\t\t\t\tssum += num;\n\t\t\t\tvsum[j]+=num;\n\t\t\t\tSystem.out.print(num+\" \");\n\t\t\t}",
"num = scan.nextInt()",
"num",
"scan.nextInt()",
"scan.nextInt",
"scan",
"ssum += num",
"ssum",
"num",
"vsum[j]+=num",
"vsum[j]",
"vsum",
"j",
"num",
"System.out.print(num+\" \")",
"System.out.print",
"System.out",
"System",
"System.out",
"num+\" \"",
"num",
"\" \"",
"System.out.println(ssum)",
"System.out.println",
"System.out",
"System",
"System.out",
"ssum",
"total+=ssum",
"total",
"ssum",
"ssum=0",
"ssum",
"0",
"for(i=0;i<c;i++) {\n\t\t\tSystem.out.print(vsum[i]+\" \");\n\t\t}",
"i=0;",
"i=0",
"i",
"0",
"i<c",
"i",
"c",
"i++",
"i++",
"i",
"{\n\t\t\tSystem.out.print(vsum[i]+\" \");\n\t\t}",
"{\n\t\t\tSystem.out.print(vsum[i]+\" \");\n\t\t}",
"System.out.print(vsum[i]+\" \")",
"System.out.print",
"System.out",
"System",
"System.out",
"vsum[i]+\" \"",
"vsum[i]",
"vsum",
"i",
"\" \"",
"System.out.println(total)",
"System.out.println",
"System.out",
"System",
"System.out",
"total",
"String[] args",
"args",
"public class Main {\n\tpublic static void main(String[] args) {\n\t\tint r, c, num, ssum = 0,total=0;\n\t\tint i, j;\n\t\tScanner scan = new Scanner(System.in);\n\t\tr = scan.nextInt();\n\t\tc = scan.nextInt();\n\t\tint[] vsum=new int[c];\n\t\tfor (i = 0; i < r; i++) {\n\t\t\tfor (j = 0; j < c; j++) {\n\t\t\t\tnum = scan.nextInt();\n\t\t\t\tssum += num;\n\t\t\t\tvsum[j]+=num;\n\t\t\t\tSystem.out.print(num+\" \");\n\t\t\t}\n\t\t\tSystem.out.println(ssum);\n\t\t\ttotal+=ssum;\n\t\t\tssum=0;\n\t\t}\n\t\tfor(i=0;i<c;i++) {\n\t\t\tSystem.out.print(vsum[i]+\" \");\n\t\t}\n\t\tSystem.out.println(total);\n\n\t}\n\n}",
"public class Main {\n\tpublic static void main(String[] args) {\n\t\tint r, c, num, ssum = 0,total=0;\n\t\tint i, j;\n\t\tScanner scan = new Scanner(System.in);\n\t\tr = scan.nextInt();\n\t\tc = scan.nextInt();\n\t\tint[] vsum=new int[c];\n\t\tfor (i = 0; i < r; i++) {\n\t\t\tfor (j = 0; j < c; j++) {\n\t\t\t\tnum = scan.nextInt();\n\t\t\t\tssum += num;\n\t\t\t\tvsum[j]+=num;\n\t\t\t\tSystem.out.print(num+\" \");\n\t\t\t}\n\t\t\tSystem.out.println(ssum);\n\t\t\ttotal+=ssum;\n\t\t\tssum=0;\n\t\t}\n\t\tfor(i=0;i<c;i++) {\n\t\t\tSystem.out.print(vsum[i]+\" \");\n\t\t}\n\t\tSystem.out.println(total);\n\n\t}\n\n}",
"Main"
] | import java.util.Scanner;
public class Main {
public static void main(String[] args) {
int r, c, num, ssum = 0,total=0;
int i, j;
Scanner scan = new Scanner(System.in);
r = scan.nextInt();
c = scan.nextInt();
int[] vsum=new int[c];
for (i = 0; i < r; i++) {
for (j = 0; j < c; j++) {
num = scan.nextInt();
ssum += num;
vsum[j]+=num;
System.out.print(num+" ");
}
System.out.println(ssum);
total+=ssum;
ssum=0;
}
for(i=0;i<c;i++) {
System.out.print(vsum[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,
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,
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,
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
],
[
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
],
[
22,
24
],
[
25,
26
],
[
25,
27
],
[
28,
29
],
[
28,
30
],
[
8,
31
],
[
31,
32
],
[
32,
33
],
[
33,
34
],
[
33,
35
],
[
31,
36
],
[
36,
37
],
[
36,
38
],
[
31,
39
],
[
39,
40
],
[
40,
41
],
[
31,
42
],
[
43,
43
],
[
43,
44
],
[
44,
45
],
[
45,
46
],
[
46,
47
],
[
46,
48
],
[
44,
49
],
[
49,
50
],
[
49,
51
],
[
44,
52
],
[
52,
53
],
[
53,
54
],
[
44,
55
],
[
56,
56
],
[
56,
57
],
[
57,
58
],
[
58,
59
],
[
59,
60
],
[
59,
61
],
[
58,
62
],
[
57,
63
],
[
63,
64
],
[
64,
65
],
[
8,
66
],
[
66,
67
],
[
67,
68
],
[
68,
69
],
[
68,
70
],
[
66,
71
],
[
71,
72
],
[
71,
73
],
[
66,
74
],
[
74,
75
],
[
75,
76
],
[
66,
77
],
[
78,
78
],
[
78,
79
],
[
79,
80
],
[
80,
81
],
[
81,
82
],
[
81,
83
],
[
79,
84
],
[
84,
85
],
[
84,
86
],
[
79,
87
],
[
87,
88
],
[
88,
89
],
[
79,
90
],
[
91,
91
],
[
91,
92
],
[
92,
93
],
[
93,
94
],
[
94,
95
],
[
94,
96
],
[
93,
97
],
[
92,
98
],
[
98,
99
],
[
99,
100
],
[
99,
101
],
[
98,
102
],
[
91,
103
],
[
103,
104
],
[
104,
105
],
[
105,
106
],
[
105,
107
],
[
104,
108
],
[
103,
109
],
[
109,
110
],
[
110,
111
],
[
110,
112
],
[
109,
113
],
[
8,
114
],
[
114,
115
],
[
115,
116
],
[
116,
117
],
[
116,
118
],
[
114,
119
],
[
119,
120
],
[
119,
121
],
[
114,
122
],
[
122,
123
],
[
123,
124
],
[
114,
125
],
[
126,
126
],
[
126,
127
],
[
127,
128
],
[
128,
129
],
[
129,
130
],
[
129,
131
],
[
128,
132
],
[
127,
133
],
[
133,
134
],
[
134,
135
],
[
134,
136
],
[
133,
137
],
[
8,
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
],
[
155,
156
],
[
155,
157
],
[
153,
158
],
[
158,
159
],
[
159,
160
],
[
159,
161
],
[
158,
162
],
[
152,
163
],
[
163,
164
],
[
164,
165
],
[
165,
166
],
[
165,
167
],
[
163,
168
],
[
168,
169
],
[
168,
170
],
[
170,
171
],
[
170,
172
],
[
163,
173
],
[
173,
174
],
[
174,
175
],
[
163,
176
],
[
177,
177
],
[
177,
178
],
[
178,
179
],
[
179,
180
],
[
180,
181
],
[
180,
182
],
[
178,
183
],
[
183,
184
],
[
183,
185
],
[
185,
186
],
[
186,
187
],
[
186,
188
],
[
185,
189
],
[
152,
190
],
[
190,
191
],
[
191,
192
],
[
192,
193
],
[
192,
194
],
[
6,
195
],
[
195,
196
],
[
0,
197
],
[
197,
198
],
[
197,
199
]
] | [
"import java.util.Scanner;\npublic class Main{\n public static void main(String[] args) {\n\tScanner scan = new Scanner(System.in);\n\tint r = scan.nextInt();\n\tint c = scan.nextInt();\n\tint[][] sheet = 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\tsheet[i][j] = scan.nextInt();\n\t }\n\t}\n\tfor (int i = 0; i < r; i++) {\n\t for (int j = 0; j < c; j++) {\n\t\tsheet[i][c] += sheet[i][j];\n\t\tsheet[r][j] += sheet[i][j];\n\t }\n\t}\n\tfor (int i = 0; i < c; i++) {\n\t sheet[r][c] += sheet[r][i];\n\t}\n\tfor (int i = 0; i < r + 1; i++) {\n\t System.out.print(sheet[i][0]);\n\t for (int j = 1; j < c + 1; j++) {\n\t\tSystem.out.print(\" \" + sheet[i][j]);\n\t }\n\t System.out.println();\n\t}\n }\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main{\n public static void main(String[] args) {\n\tScanner scan = new Scanner(System.in);\n\tint r = scan.nextInt();\n\tint c = scan.nextInt();\n\tint[][] sheet = 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\tsheet[i][j] = scan.nextInt();\n\t }\n\t}\n\tfor (int i = 0; i < r; i++) {\n\t for (int j = 0; j < c; j++) {\n\t\tsheet[i][c] += sheet[i][j];\n\t\tsheet[r][j] += sheet[i][j];\n\t }\n\t}\n\tfor (int i = 0; i < c; i++) {\n\t sheet[r][c] += sheet[r][i];\n\t}\n\tfor (int i = 0; i < r + 1; i++) {\n\t System.out.print(sheet[i][0]);\n\t for (int j = 1; j < c + 1; j++) {\n\t\tSystem.out.print(\" \" + sheet[i][j]);\n\t }\n\t System.out.println();\n\t}\n }\n}",
"Main",
"public static void main(String[] args) {\n\tScanner scan = new Scanner(System.in);\n\tint r = scan.nextInt();\n\tint c = scan.nextInt();\n\tint[][] sheet = 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\tsheet[i][j] = scan.nextInt();\n\t }\n\t}\n\tfor (int i = 0; i < r; i++) {\n\t for (int j = 0; j < c; j++) {\n\t\tsheet[i][c] += sheet[i][j];\n\t\tsheet[r][j] += sheet[i][j];\n\t }\n\t}\n\tfor (int i = 0; i < c; i++) {\n\t sheet[r][c] += sheet[r][i];\n\t}\n\tfor (int i = 0; i < r + 1; i++) {\n\t System.out.print(sheet[i][0]);\n\t for (int j = 1; j < c + 1; j++) {\n\t\tSystem.out.print(\" \" + sheet[i][j]);\n\t }\n\t System.out.println();\n\t}\n }",
"main",
"{\n\tScanner scan = new Scanner(System.in);\n\tint r = scan.nextInt();\n\tint c = scan.nextInt();\n\tint[][] sheet = 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\tsheet[i][j] = scan.nextInt();\n\t }\n\t}\n\tfor (int i = 0; i < r; i++) {\n\t for (int j = 0; j < c; j++) {\n\t\tsheet[i][c] += sheet[i][j];\n\t\tsheet[r][j] += sheet[i][j];\n\t }\n\t}\n\tfor (int i = 0; i < c; i++) {\n\t sheet[r][c] += sheet[r][i];\n\t}\n\tfor (int i = 0; i < r + 1; i++) {\n\t System.out.print(sheet[i][0]);\n\t for (int j = 1; j < c + 1; j++) {\n\t\tSystem.out.print(\" \" + sheet[i][j]);\n\t }\n\t System.out.println();\n\t}\n }",
"Scanner scan = new Scanner(System.in);",
"scan",
"new Scanner(System.in)",
"int r = scan.nextInt();",
"r",
"scan.nextInt()",
"scan.nextInt",
"scan",
"int c = scan.nextInt();",
"c",
"scan.nextInt()",
"scan.nextInt",
"scan",
"int[][] 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 for (int j = 0; j < c; j++) {\n\t\tsheet[i][j] = scan.nextInt();\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\tsheet[i][j] = scan.nextInt();\n\t }\n\t}",
"{\n\t for (int j = 0; j < c; j++) {\n\t\tsheet[i][j] = scan.nextInt();\n\t }\n\t}",
"for (int j = 0; j < c; j++) {\n\t\tsheet[i][j] = scan.nextInt();\n\t }",
"int j = 0;",
"int j = 0;",
"j",
"0",
"j < c",
"j",
"c",
"j++",
"j++",
"j",
"{\n\t\tsheet[i][j] = scan.nextInt();\n\t }",
"{\n\t\tsheet[i][j] = scan.nextInt();\n\t }",
"sheet[i][j] = scan.nextInt()",
"sheet[i][j]",
"sheet[i]",
"sheet",
"i",
"j",
"scan.nextInt()",
"scan.nextInt",
"scan",
"for (int i = 0; i < r; i++) {\n\t for (int j = 0; j < c; j++) {\n\t\tsheet[i][c] += sheet[i][j];\n\t\tsheet[r][j] += sheet[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\tsheet[i][c] += sheet[i][j];\n\t\tsheet[r][j] += sheet[i][j];\n\t }\n\t}",
"{\n\t for (int j = 0; j < c; j++) {\n\t\tsheet[i][c] += sheet[i][j];\n\t\tsheet[r][j] += sheet[i][j];\n\t }\n\t}",
"for (int j = 0; j < c; j++) {\n\t\tsheet[i][c] += sheet[i][j];\n\t\tsheet[r][j] += sheet[i][j];\n\t }",
"int j = 0;",
"int j = 0;",
"j",
"0",
"j < c",
"j",
"c",
"j++",
"j++",
"j",
"{\n\t\tsheet[i][c] += sheet[i][j];\n\t\tsheet[r][j] += sheet[i][j];\n\t }",
"{\n\t\tsheet[i][c] += sheet[i][j];\n\t\tsheet[r][j] += sheet[i][j];\n\t }",
"sheet[i][c] += sheet[i][j]",
"sheet[i][c]",
"sheet[i]",
"sheet",
"i",
"c",
"sheet[i][j]",
"sheet[i]",
"sheet",
"i",
"j",
"sheet[r][j] += sheet[i][j]",
"sheet[r][j]",
"sheet[r]",
"sheet",
"r",
"j",
"sheet[i][j]",
"sheet[i]",
"sheet",
"i",
"j",
"for (int i = 0; i < c; i++) {\n\t sheet[r][c] += sheet[r][i];\n\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < c",
"i",
"c",
"i++",
"i++",
"i",
"{\n\t sheet[r][c] += sheet[r][i];\n\t}",
"{\n\t sheet[r][c] += sheet[r][i];\n\t}",
"sheet[r][c] += sheet[r][i]",
"sheet[r][c]",
"sheet[r]",
"sheet",
"r",
"c",
"sheet[r][i]",
"sheet[r]",
"sheet",
"r",
"i",
"for (int i = 0; i < r + 1; i++) {\n\t System.out.print(sheet[i][0]);\n\t for (int j = 1; j < c + 1; j++) {\n\t\tSystem.out.print(\" \" + sheet[i][j]);\n\t }\n\t System.out.println();\n\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < r + 1",
"i",
"r + 1",
"r",
"1",
"i++",
"i++",
"i",
"{\n\t System.out.print(sheet[i][0]);\n\t for (int j = 1; j < c + 1; j++) {\n\t\tSystem.out.print(\" \" + sheet[i][j]);\n\t }\n\t System.out.println();\n\t}",
"{\n\t System.out.print(sheet[i][0]);\n\t for (int j = 1; j < c + 1; j++) {\n\t\tSystem.out.print(\" \" + sheet[i][j]);\n\t }\n\t System.out.println();\n\t}",
"System.out.print(sheet[i][0])",
"System.out.print",
"System.out",
"System",
"System.out",
"sheet[i][0]",
"sheet[i]",
"sheet",
"i",
"0",
"for (int j = 1; j < c + 1; j++) {\n\t\tSystem.out.print(\" \" + sheet[i][j]);\n\t }",
"int j = 1;",
"int j = 1;",
"j",
"1",
"j < c + 1",
"j",
"c + 1",
"c",
"1",
"j++",
"j++",
"j",
"{\n\t\tSystem.out.print(\" \" + sheet[i][j]);\n\t }",
"{\n\t\tSystem.out.print(\" \" + sheet[i][j]);\n\t }",
"System.out.print(\" \" + sheet[i][j])",
"System.out.print",
"System.out",
"System",
"System.out",
"\" \" + sheet[i][j]",
"\" \"",
"sheet[i][j]",
"sheet[i]",
"sheet",
"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\tScanner scan = new Scanner(System.in);\n\tint r = scan.nextInt();\n\tint c = scan.nextInt();\n\tint[][] sheet = 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\tsheet[i][j] = scan.nextInt();\n\t }\n\t}\n\tfor (int i = 0; i < r; i++) {\n\t for (int j = 0; j < c; j++) {\n\t\tsheet[i][c] += sheet[i][j];\n\t\tsheet[r][j] += sheet[i][j];\n\t }\n\t}\n\tfor (int i = 0; i < c; i++) {\n\t sheet[r][c] += sheet[r][i];\n\t}\n\tfor (int i = 0; i < r + 1; i++) {\n\t System.out.print(sheet[i][0]);\n\t for (int j = 1; j < c + 1; j++) {\n\t\tSystem.out.print(\" \" + sheet[i][j]);\n\t }\n\t System.out.println();\n\t}\n }\n}",
"public class Main{\n public static void main(String[] args) {\n\tScanner scan = new Scanner(System.in);\n\tint r = scan.nextInt();\n\tint c = scan.nextInt();\n\tint[][] sheet = 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\tsheet[i][j] = scan.nextInt();\n\t }\n\t}\n\tfor (int i = 0; i < r; i++) {\n\t for (int j = 0; j < c; j++) {\n\t\tsheet[i][c] += sheet[i][j];\n\t\tsheet[r][j] += sheet[i][j];\n\t }\n\t}\n\tfor (int i = 0; i < c; i++) {\n\t sheet[r][c] += sheet[r][i];\n\t}\n\tfor (int i = 0; i < r + 1; i++) {\n\t System.out.print(sheet[i][0]);\n\t for (int j = 1; j < c + 1; j++) {\n\t\tSystem.out.print(\" \" + sheet[i][j]);\n\t }\n\t System.out.println();\n\t}\n }\n}",
"Main"
] | import java.util.Scanner;
public class Main{
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
int r = scan.nextInt();
int c = scan.nextInt();
int[][] sheet = new int[r+1][c+1];
for (int i = 0; i < r; i++) {
for (int j = 0; j < c; j++) {
sheet[i][j] = scan.nextInt();
}
}
for (int i = 0; i < r; i++) {
for (int j = 0; j < c; j++) {
sheet[i][c] += sheet[i][j];
sheet[r][j] += sheet[i][j];
}
}
for (int i = 0; i < c; i++) {
sheet[r][c] += sheet[r][i];
}
for (int i = 0; i < r + 1; i++) {
System.out.print(sheet[i][0]);
for (int j = 1; j < c + 1; j++) {
System.out.print(" " + sheet[i][j]);
}
System.out.println();
}
}
} |
[
7,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
17,
41,
13,
4,
18,
13,
18,
13,
17,
41,
13,
4,
18,
13,
18,
13,
17,
41,
13,
20,
2,
13,
17,
2,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
18,
18,
13,
13,
13,
4,
18,
13,
18,
13,
13,
0,
18,
18,
13,
13,
13,
4,
18,
13,
18,
13,
13,
0,
18,
18,
13,
13,
13,
4,
18,
13,
18,
13,
13,
0,
18,
18,
13,
13,
13,
4,
18,
13,
18,
13,
13,
11,
1,
41,
13,
17,
2,
13,
2,
13,
17,
1,
40,
13,
30,
30,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
4,
18,
18,
13,
13,
2,
18,
18,
13,
13,
13,
17,
4,
18,
18,
13,
13,
18,
18,
13,
13,
13,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
189,
8
],
[
189,
9
],
[
9,
10
],
[
9,
11
],
[
11,
12
],
[
12,
13
],
[
12,
14
],
[
11,
15
],
[
15,
16
],
[
15,
17
],
[
17,
18
],
[
18,
19
],
[
11,
20
],
[
20,
21
],
[
20,
22
],
[
22,
23
],
[
23,
24
],
[
22,
25
],
[
11,
26
],
[
26,
27
],
[
26,
28
],
[
28,
29
],
[
29,
30
],
[
28,
31
],
[
31,
32
],
[
31,
33
],
[
11,
34
],
[
34,
35
],
[
34,
36
],
[
36,
37
],
[
37,
38
],
[
36,
39
],
[
39,
40
],
[
39,
41
],
[
11,
42
],
[
42,
43
],
[
42,
44
],
[
45,
46
],
[
45,
47
],
[
48,
49
],
[
48,
50
],
[
11,
51
],
[
51,
52
],
[
52,
53
],
[
53,
54
],
[
53,
55
],
[
51,
56
],
[
56,
57
],
[
56,
58
],
[
51,
59
],
[
59,
60
],
[
60,
61
],
[
51,
62
],
[
63,
63
],
[
63,
64
],
[
64,
65
],
[
64,
66
],
[
66,
67
],
[
67,
68
],
[
63,
69
],
[
69,
70
],
[
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
],
[
89,
90
],
[
90,
91
],
[
90,
92
],
[
89,
93
],
[
88,
94
],
[
94,
95
],
[
95,
96
],
[
94,
97
],
[
97,
98
],
[
97,
99
],
[
87,
100
],
[
100,
101
],
[
101,
102
],
[
102,
103
],
[
102,
104
],
[
101,
105
],
[
100,
106
],
[
106,
107
],
[
107,
108
],
[
106,
109
],
[
109,
110
],
[
109,
111
],
[
87,
112
],
[
112,
113
],
[
113,
114
],
[
114,
115
],
[
114,
116
],
[
113,
117
],
[
112,
118
],
[
118,
119
],
[
119,
120
],
[
118,
121
],
[
121,
122
],
[
121,
123
],
[
87,
124
],
[
124,
125
],
[
125,
126
],
[
126,
127
],
[
126,
128
],
[
125,
129
],
[
124,
130
],
[
130,
131
],
[
131,
132
],
[
130,
133
],
[
133,
134
],
[
133,
135
],
[
11,
136
],
[
136,
137
],
[
137,
138
],
[
138,
139
],
[
138,
140
],
[
136,
141
],
[
141,
142
],
[
141,
143
],
[
143,
144
],
[
143,
145
],
[
136,
146
],
[
146,
147
],
[
147,
148
],
[
136,
149
],
[
150,
150
],
[
150,
151
],
[
151,
152
],
[
152,
153
],
[
153,
154
],
[
153,
155
],
[
151,
156
],
[
156,
157
],
[
156,
158
],
[
151,
159
],
[
159,
160
],
[
160,
161
],
[
151,
162
],
[
163,
163
],
[
163,
164
],
[
164,
165
],
[
165,
166
],
[
166,
167
],
[
166,
168
],
[
164,
169
],
[
169,
170
],
[
170,
171
],
[
171,
172
],
[
171,
173
],
[
170,
174
],
[
169,
175
],
[
150,
176
],
[
176,
177
],
[
177,
178
],
[
178,
179
],
[
178,
180
],
[
176,
181
],
[
181,
182
],
[
182,
183
],
[
182,
184
],
[
181,
185
],
[
9,
186
],
[
186,
187
],
[
0,
188
],
[
188,
189
],
[
188,
190
]
] | [
"import java.io.*;\nimport java.util.Arrays;\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 line1 = br.readLine();\n\t\tString[] spl = line1.split(\" \");\n\t\tint r = Integer.parseInt(spl[0]);\n\t\tint c = Integer.parseInt(spl[1]);\n\t\tint[][] a = new int[r+1][c+1];\n\t\tfor (int i = 0 ; i<r ; i++ ) {\n\t\t\tString line = br.readLine();\n\t\t\tString[] str = line.split(\" \");\n\t\t\tfor (int j = 0; j<c ; j++ ) {\n\t\t\t\ta[i][j] = Integer.parseInt(str[j]);\n\t\t\t\ta[i][c] += Integer.parseInt(str[j]);\n\t\t\t\ta[r][j] += Integer.parseInt(str[j]);\n\t\t\t\ta[r][c] += Integer.parseInt(str[j]);\n\t\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 ;j++ ) {\n\t\t\t\tSystem.out.print(a[i][j]+\" \");\n\t\t\t}\n\t\t\tSystem.out.println(a[i][c]);\n\t\t}\n\t\t\n\t\t\n\t}\n}",
"import java.io.*;",
"io.*",
"java",
"import java.util.Arrays;",
"Arrays",
"java.util",
"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 line1 = br.readLine();\n\t\tString[] spl = line1.split(\" \");\n\t\tint r = Integer.parseInt(spl[0]);\n\t\tint c = Integer.parseInt(spl[1]);\n\t\tint[][] a = new int[r+1][c+1];\n\t\tfor (int i = 0 ; i<r ; i++ ) {\n\t\t\tString line = br.readLine();\n\t\t\tString[] str = line.split(\" \");\n\t\t\tfor (int j = 0; j<c ; j++ ) {\n\t\t\t\ta[i][j] = Integer.parseInt(str[j]);\n\t\t\t\ta[i][c] += Integer.parseInt(str[j]);\n\t\t\t\ta[r][j] += Integer.parseInt(str[j]);\n\t\t\t\ta[r][c] += Integer.parseInt(str[j]);\n\t\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 ;j++ ) {\n\t\t\t\tSystem.out.print(a[i][j]+\" \");\n\t\t\t}\n\t\t\tSystem.out.println(a[i][c]);\n\t\t}\n\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 line1 = br.readLine();\n\t\tString[] spl = line1.split(\" \");\n\t\tint r = Integer.parseInt(spl[0]);\n\t\tint c = Integer.parseInt(spl[1]);\n\t\tint[][] a = new int[r+1][c+1];\n\t\tfor (int i = 0 ; i<r ; i++ ) {\n\t\t\tString line = br.readLine();\n\t\t\tString[] str = line.split(\" \");\n\t\t\tfor (int j = 0; j<c ; j++ ) {\n\t\t\t\ta[i][j] = Integer.parseInt(str[j]);\n\t\t\t\ta[i][c] += Integer.parseInt(str[j]);\n\t\t\t\ta[r][j] += Integer.parseInt(str[j]);\n\t\t\t\ta[r][c] += Integer.parseInt(str[j]);\n\t\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 ;j++ ) {\n\t\t\t\tSystem.out.print(a[i][j]+\" \");\n\t\t\t}\n\t\t\tSystem.out.println(a[i][c]);\n\t\t}\n\t\t\n\t\t\n\t}",
"main",
"{ \n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\t\tString line1 = br.readLine();\n\t\tString[] spl = line1.split(\" \");\n\t\tint r = Integer.parseInt(spl[0]);\n\t\tint c = Integer.parseInt(spl[1]);\n\t\tint[][] a = new int[r+1][c+1];\n\t\tfor (int i = 0 ; i<r ; i++ ) {\n\t\t\tString line = br.readLine();\n\t\t\tString[] str = line.split(\" \");\n\t\t\tfor (int j = 0; j<c ; j++ ) {\n\t\t\t\ta[i][j] = Integer.parseInt(str[j]);\n\t\t\t\ta[i][c] += Integer.parseInt(str[j]);\n\t\t\t\ta[r][j] += Integer.parseInt(str[j]);\n\t\t\t\ta[r][c] += Integer.parseInt(str[j]);\n\t\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 ;j++ ) {\n\t\t\t\tSystem.out.print(a[i][j]+\" \");\n\t\t\t}\n\t\t\tSystem.out.println(a[i][c]);\n\t\t}\n\t\t\n\t\t\n\t}",
"BufferedReader br = new BufferedReader(new InputStreamReader(System.in));",
"br",
"new BufferedReader(new InputStreamReader(System.in))",
"String line1 = br.readLine();",
"line1",
"br.readLine()",
"br.readLine",
"br",
"String[] spl = line1.split(\" \");",
"spl",
"line1.split(\" \")",
"line1.split",
"line1",
"\" \"",
"int r = Integer.parseInt(spl[0]);",
"r",
"Integer.parseInt(spl[0])",
"Integer.parseInt",
"Integer",
"spl[0]",
"spl",
"0",
"int c = Integer.parseInt(spl[1]);",
"c",
"Integer.parseInt(spl[1])",
"Integer.parseInt",
"Integer",
"spl[1]",
"spl",
"1",
"int[][] a = new int[r+1][c+1];",
"a",
"new int[r+1][c+1]",
"r+1",
"r",
"1",
"c+1",
"c",
"1",
"for (int i = 0 ; i<r ; i++ ) {\n\t\t\tString line = br.readLine();\n\t\t\tString[] str = line.split(\" \");\n\t\t\tfor (int j = 0; j<c ; j++ ) {\n\t\t\t\ta[i][j] = Integer.parseInt(str[j]);\n\t\t\t\ta[i][c] += Integer.parseInt(str[j]);\n\t\t\t\ta[r][j] += Integer.parseInt(str[j]);\n\t\t\t\ta[r][c] += Integer.parseInt(str[j]);\n\t\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 line = br.readLine();\n\t\t\tString[] str = line.split(\" \");\n\t\t\tfor (int j = 0; j<c ; j++ ) {\n\t\t\t\ta[i][j] = Integer.parseInt(str[j]);\n\t\t\t\ta[i][c] += Integer.parseInt(str[j]);\n\t\t\t\ta[r][j] += Integer.parseInt(str[j]);\n\t\t\t\ta[r][c] += Integer.parseInt(str[j]);\n\t\t\t}\t\n\t\t}",
"{\n\t\t\tString line = br.readLine();\n\t\t\tString[] str = line.split(\" \");\n\t\t\tfor (int j = 0; j<c ; j++ ) {\n\t\t\t\ta[i][j] = Integer.parseInt(str[j]);\n\t\t\t\ta[i][c] += Integer.parseInt(str[j]);\n\t\t\t\ta[r][j] += Integer.parseInt(str[j]);\n\t\t\t\ta[r][c] += Integer.parseInt(str[j]);\n\t\t\t}\t\n\t\t}",
"String line = br.readLine();",
"line",
"br.readLine()",
"br.readLine",
"br",
"String[] str = line.split(\" \");",
"str",
"line.split(\" \")",
"line.split",
"line",
"\" \"",
"for (int j = 0; j<c ; j++ ) {\n\t\t\t\ta[i][j] = Integer.parseInt(str[j]);\n\t\t\t\ta[i][c] += Integer.parseInt(str[j]);\n\t\t\t\ta[r][j] += Integer.parseInt(str[j]);\n\t\t\t\ta[r][c] += Integer.parseInt(str[j]);\n\t\t\t}",
"int j = 0;",
"int j = 0;",
"j",
"0",
"j<c",
"j",
"c",
"j++",
"j++",
"j",
"{\n\t\t\t\ta[i][j] = Integer.parseInt(str[j]);\n\t\t\t\ta[i][c] += Integer.parseInt(str[j]);\n\t\t\t\ta[r][j] += Integer.parseInt(str[j]);\n\t\t\t\ta[r][c] += Integer.parseInt(str[j]);\n\t\t\t}",
"{\n\t\t\t\ta[i][j] = Integer.parseInt(str[j]);\n\t\t\t\ta[i][c] += Integer.parseInt(str[j]);\n\t\t\t\ta[r][j] += Integer.parseInt(str[j]);\n\t\t\t\ta[r][c] += Integer.parseInt(str[j]);\n\t\t\t}",
"a[i][j] = Integer.parseInt(str[j])",
"a[i][j]",
"a[i]",
"a",
"i",
"j",
"Integer.parseInt(str[j])",
"Integer.parseInt",
"Integer",
"str[j]",
"str",
"j",
"a[i][c] += Integer.parseInt(str[j])",
"a[i][c]",
"a[i]",
"a",
"i",
"c",
"Integer.parseInt(str[j])",
"Integer.parseInt",
"Integer",
"str[j]",
"str",
"j",
"a[r][j] += Integer.parseInt(str[j])",
"a[r][j]",
"a[r]",
"a",
"r",
"j",
"Integer.parseInt(str[j])",
"Integer.parseInt",
"Integer",
"str[j]",
"str",
"j",
"a[r][c] += Integer.parseInt(str[j])",
"a[r][c]",
"a[r]",
"a",
"r",
"c",
"Integer.parseInt(str[j])",
"Integer.parseInt",
"Integer",
"str[j]",
"str",
"j",
"for (int i = 0; i<r+1 ;i++ ) {\n\t\t\tfor (int j = 0; j<c ;j++ ) {\n\t\t\t\tSystem.out.print(a[i][j]+\" \");\n\t\t\t}\n\t\t\tSystem.out.println(a[i][c]);\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.print(a[i][j]+\" \");\n\t\t\t}\n\t\t\tSystem.out.println(a[i][c]);\n\t\t}",
"{\n\t\t\tfor (int j = 0; j<c ;j++ ) {\n\t\t\t\tSystem.out.print(a[i][j]+\" \");\n\t\t\t}\n\t\t\tSystem.out.println(a[i][c]);\n\t\t}",
"for (int j = 0; j<c ;j++ ) {\n\t\t\t\tSystem.out.print(a[i][j]+\" \");\n\t\t\t}",
"int j = 0;",
"int j = 0;",
"j",
"0",
"j<c",
"j",
"c",
"j++",
"j++",
"j",
"{\n\t\t\t\tSystem.out.print(a[i][j]+\" \");\n\t\t\t}",
"{\n\t\t\t\tSystem.out.print(a[i][j]+\" \");\n\t\t\t}",
"System.out.print(a[i][j]+\" \")",
"System.out.print",
"System.out",
"System",
"System.out",
"a[i][j]+\" \"",
"a[i][j]",
"a[i]",
"a",
"i",
"j",
"\" \"",
"System.out.println(a[i][c])",
"System.out.println",
"System.out",
"System",
"System.out",
"a[i][c]",
"a[i]",
"a",
"i",
"c",
"String[] args",
"args",
"public class Main{\n\tpublic static void main(String[] args) throws IOException{ \n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\t\tString line1 = br.readLine();\n\t\tString[] spl = line1.split(\" \");\n\t\tint r = Integer.parseInt(spl[0]);\n\t\tint c = Integer.parseInt(spl[1]);\n\t\tint[][] a = new int[r+1][c+1];\n\t\tfor (int i = 0 ; i<r ; i++ ) {\n\t\t\tString line = br.readLine();\n\t\t\tString[] str = line.split(\" \");\n\t\t\tfor (int j = 0; j<c ; j++ ) {\n\t\t\t\ta[i][j] = Integer.parseInt(str[j]);\n\t\t\t\ta[i][c] += Integer.parseInt(str[j]);\n\t\t\t\ta[r][j] += Integer.parseInt(str[j]);\n\t\t\t\ta[r][c] += Integer.parseInt(str[j]);\n\t\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 ;j++ ) {\n\t\t\t\tSystem.out.print(a[i][j]+\" \");\n\t\t\t}\n\t\t\tSystem.out.println(a[i][c]);\n\t\t}\n\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 line1 = br.readLine();\n\t\tString[] spl = line1.split(\" \");\n\t\tint r = Integer.parseInt(spl[0]);\n\t\tint c = Integer.parseInt(spl[1]);\n\t\tint[][] a = new int[r+1][c+1];\n\t\tfor (int i = 0 ; i<r ; i++ ) {\n\t\t\tString line = br.readLine();\n\t\t\tString[] str = line.split(\" \");\n\t\t\tfor (int j = 0; j<c ; j++ ) {\n\t\t\t\ta[i][j] = Integer.parseInt(str[j]);\n\t\t\t\ta[i][c] += Integer.parseInt(str[j]);\n\t\t\t\ta[r][j] += Integer.parseInt(str[j]);\n\t\t\t\ta[r][c] += Integer.parseInt(str[j]);\n\t\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 ;j++ ) {\n\t\t\t\tSystem.out.print(a[i][j]+\" \");\n\t\t\t}\n\t\t\tSystem.out.println(a[i][c]);\n\t\t}\n\t\t\n\t\t\n\t}\n}",
"Main"
] | import java.io.*;
import java.util.Arrays;
public class Main{
public static void main(String[] args) throws IOException{
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
String line1 = br.readLine();
String[] spl = line1.split(" ");
int r = Integer.parseInt(spl[0]);
int c = Integer.parseInt(spl[1]);
int[][] a = new int[r+1][c+1];
for (int i = 0 ; i<r ; i++ ) {
String line = br.readLine();
String[] str = line.split(" ");
for (int j = 0; j<c ; j++ ) {
a[i][j] = Integer.parseInt(str[j]);
a[i][c] += Integer.parseInt(str[j]);
a[r][j] += Integer.parseInt(str[j]);
a[r][c] += Integer.parseInt(str[j]);
}
}
for (int i = 0; i<r+1 ;i++ ) {
for (int j = 0; j<c ;j++ ) {
System.out.print(a[i][j]+" ");
}
System.out.println(a[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,
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,
4,
18,
13,
41,
13,
20,
13,
11,
1,
41,
13,
17,
2,
13,
13,
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,
4,
18,
18,
13,
13,
13,
30,
0,
13,
18,
18,
13,
13,
13,
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,
17,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
18,
13,
13,
4,
18,
18,
13,
13,
2,
18,
13,
13,
17,
4,
18,
18,
13,
13,
13,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
186,
5
],
[
186,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
8,
17
],
[
17,
18
],
[
17,
19
],
[
19,
20
],
[
20,
21
],
[
8,
22
],
[
22,
23
],
[
22,
24
],
[
8,
27
],
[
27,
28
],
[
28,
29
],
[
29,
30
],
[
29,
31
],
[
27,
32
],
[
32,
33
],
[
32,
34
],
[
27,
35
],
[
35,
36
],
[
36,
37
],
[
27,
38
],
[
39,
39
],
[
39,
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
],
[
54,
58
],
[
53,
59
],
[
59,
60
],
[
60,
61
],
[
8,
62
],
[
62,
63
],
[
63,
64
],
[
8,
65
],
[
65,
66
],
[
65,
67
],
[
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
],
[
92,
93
],
[
92,
94
],
[
85,
95
],
[
95,
96
],
[
96,
97
],
[
85,
98
],
[
99,
99
],
[
99,
100
],
[
100,
101
],
[
101,
102
],
[
101,
103
],
[
100,
104
],
[
104,
105
],
[
105,
106
],
[
106,
107
],
[
107,
108
],
[
107,
109
],
[
105,
110
],
[
100,
111
],
[
111,
112
],
[
112,
113
],
[
112,
114
],
[
114,
115
],
[
115,
116
],
[
115,
117
],
[
114,
118
],
[
111,
119
],
[
119,
120
],
[
120,
121
],
[
120,
122
],
[
119,
123
],
[
123,
124
],
[
124,
125
],
[
124,
126
],
[
123,
127
],
[
111,
128
],
[
128,
129
],
[
129,
130
],
[
130,
131
],
[
130,
132
],
[
128,
133
],
[
133,
134
],
[
134,
135
],
[
135,
136
],
[
135,
137
],
[
134,
138
],
[
133,
139
],
[
81,
140
],
[
140,
141
],
[
141,
142
],
[
142,
143
],
[
142,
144
],
[
140,
145
],
[
8,
146
],
[
146,
147
],
[
146,
148
],
[
8,
149
],
[
149,
150
],
[
150,
151
],
[
151,
152
],
[
151,
153
],
[
149,
154
],
[
154,
155
],
[
154,
156
],
[
149,
157
],
[
157,
158
],
[
158,
159
],
[
149,
160
],
[
161,
161
],
[
161,
162
],
[
162,
163
],
[
162,
164
],
[
164,
165
],
[
164,
166
],
[
161,
167
],
[
167,
168
],
[
168,
169
],
[
169,
170
],
[
169,
171
],
[
167,
172
],
[
172,
173
],
[
173,
174
],
[
173,
175
],
[
172,
176
],
[
8,
177
],
[
177,
178
],
[
178,
179
],
[
179,
180
],
[
179,
181
],
[
177,
182
],
[
6,
183
],
[
183,
184
],
[
0,
185
],
[
185,
186
],
[
185,
187
]
] | [
"import java.util.Scanner;\n\npublic class Main {\n\n\tpublic static void main(String[] args) {\n\n\t\tScanner sc = new Scanner(System.in);\n\t\tint rowNum = sc.nextInt();\n\t\tint colNum = sc.nextInt();\n\n\t\tint sheet[][] = new int[rowNum][colNum];\n\n\n\t\t// 入力\n\t\tfor(int i=0; i<rowNum; i++) {\n\t\t\tfor(int j=0; j<colNum; j++) {\n\t\t\t\tsheet[i][j] = sc.nextInt();\n\t\t\t}\n\t\t}\n\n\t\tsc.close();\n\n\t\t// 出力\n\t\t// 1列ごとの合計値\n\t\tint colSum[] = new int[colNum];\n\t\tfor(int i=0; i<rowNum; i++) {\n\t\t\t// 1行ごとの合計値\n\t\t\tint rowSum = 0;\n\t\t\tfor(int j=0; j<colNum+1; j++) {\n\t\t\t\tif(j == colNum) {\n\t\t\t\t\tSystem.out.print(rowSum);\n\t\t\t\t} else {\n\t\t\t\t\trowSum += sheet[i][j];\n\t\t\t\t\tcolSum[j] += sheet[i][j];\n\t\t\t\t\tSystem.out.print(sheet[i][j] + \" \");\n\t\t\t\t}\n\t\t\t}\n\t\t\tSystem.out.println(\"\");\n\t\t}\n\t\tint totalSum = 0;\n\t\tfor(int i=0; i<colNum; i++) {\n\t\t\ttotalSum += colSum[i];\n\t\t\tSystem.out.print(colSum[i] + \" \");\n\t\t}\n\t\tSystem.out.println(totalSum);\n\n\n\t}\n\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n\n\tpublic static void main(String[] args) {\n\n\t\tScanner sc = new Scanner(System.in);\n\t\tint rowNum = sc.nextInt();\n\t\tint colNum = sc.nextInt();\n\n\t\tint sheet[][] = new int[rowNum][colNum];\n\n\n\t\t// 入力\n\t\tfor(int i=0; i<rowNum; i++) {\n\t\t\tfor(int j=0; j<colNum; j++) {\n\t\t\t\tsheet[i][j] = sc.nextInt();\n\t\t\t}\n\t\t}\n\n\t\tsc.close();\n\n\t\t// 出力\n\t\t// 1列ごとの合計値\n\t\tint colSum[] = new int[colNum];\n\t\tfor(int i=0; i<rowNum; i++) {\n\t\t\t// 1行ごとの合計値\n\t\t\tint rowSum = 0;\n\t\t\tfor(int j=0; j<colNum+1; j++) {\n\t\t\t\tif(j == colNum) {\n\t\t\t\t\tSystem.out.print(rowSum);\n\t\t\t\t} else {\n\t\t\t\t\trowSum += sheet[i][j];\n\t\t\t\t\tcolSum[j] += sheet[i][j];\n\t\t\t\t\tSystem.out.print(sheet[i][j] + \" \");\n\t\t\t\t}\n\t\t\t}\n\t\t\tSystem.out.println(\"\");\n\t\t}\n\t\tint totalSum = 0;\n\t\tfor(int i=0; i<colNum; i++) {\n\t\t\ttotalSum += colSum[i];\n\t\t\tSystem.out.print(colSum[i] + \" \");\n\t\t}\n\t\tSystem.out.println(totalSum);\n\n\n\t}\n\n}",
"Main",
"public static void main(String[] args) {\n\n\t\tScanner sc = new Scanner(System.in);\n\t\tint rowNum = sc.nextInt();\n\t\tint colNum = sc.nextInt();\n\n\t\tint sheet[][] = new int[rowNum][colNum];\n\n\n\t\t// 入力\n\t\tfor(int i=0; i<rowNum; i++) {\n\t\t\tfor(int j=0; j<colNum; j++) {\n\t\t\t\tsheet[i][j] = sc.nextInt();\n\t\t\t}\n\t\t}\n\n\t\tsc.close();\n\n\t\t// 出力\n\t\t// 1列ごとの合計値\n\t\tint colSum[] = new int[colNum];\n\t\tfor(int i=0; i<rowNum; i++) {\n\t\t\t// 1行ごとの合計値\n\t\t\tint rowSum = 0;\n\t\t\tfor(int j=0; j<colNum+1; j++) {\n\t\t\t\tif(j == colNum) {\n\t\t\t\t\tSystem.out.print(rowSum);\n\t\t\t\t} else {\n\t\t\t\t\trowSum += sheet[i][j];\n\t\t\t\t\tcolSum[j] += sheet[i][j];\n\t\t\t\t\tSystem.out.print(sheet[i][j] + \" \");\n\t\t\t\t}\n\t\t\t}\n\t\t\tSystem.out.println(\"\");\n\t\t}\n\t\tint totalSum = 0;\n\t\tfor(int i=0; i<colNum; i++) {\n\t\t\ttotalSum += colSum[i];\n\t\t\tSystem.out.print(colSum[i] + \" \");\n\t\t}\n\t\tSystem.out.println(totalSum);\n\n\n\t}",
"main",
"{\n\n\t\tScanner sc = new Scanner(System.in);\n\t\tint rowNum = sc.nextInt();\n\t\tint colNum = sc.nextInt();\n\n\t\tint sheet[][] = new int[rowNum][colNum];\n\n\n\t\t// 入力\n\t\tfor(int i=0; i<rowNum; i++) {\n\t\t\tfor(int j=0; j<colNum; j++) {\n\t\t\t\tsheet[i][j] = sc.nextInt();\n\t\t\t}\n\t\t}\n\n\t\tsc.close();\n\n\t\t// 出力\n\t\t// 1列ごとの合計値\n\t\tint colSum[] = new int[colNum];\n\t\tfor(int i=0; i<rowNum; i++) {\n\t\t\t// 1行ごとの合計値\n\t\t\tint rowSum = 0;\n\t\t\tfor(int j=0; j<colNum+1; j++) {\n\t\t\t\tif(j == colNum) {\n\t\t\t\t\tSystem.out.print(rowSum);\n\t\t\t\t} else {\n\t\t\t\t\trowSum += sheet[i][j];\n\t\t\t\t\tcolSum[j] += sheet[i][j];\n\t\t\t\t\tSystem.out.print(sheet[i][j] + \" \");\n\t\t\t\t}\n\t\t\t}\n\t\t\tSystem.out.println(\"\");\n\t\t}\n\t\tint totalSum = 0;\n\t\tfor(int i=0; i<colNum; i++) {\n\t\t\ttotalSum += colSum[i];\n\t\t\tSystem.out.print(colSum[i] + \" \");\n\t\t}\n\t\tSystem.out.println(totalSum);\n\n\n\t}",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"int rowNum = sc.nextInt();",
"rowNum",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int colNum = sc.nextInt();",
"colNum",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int sheet[][] = new int[rowNum][colNum];",
"sheet",
"new int[rowNum][colNum]",
"rowNum",
"colNum",
"for(int i=0; i<rowNum; i++) {\n\t\t\tfor(int j=0; j<colNum; 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<rowNum",
"i",
"rowNum",
"i++",
"i++",
"i",
"{\n\t\t\tfor(int j=0; j<colNum; 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<colNum; j++) {\n\t\t\t\tsheet[i][j] = sc.nextInt();\n\t\t\t}\n\t\t}",
"for(int j=0; j<colNum; j++) {\n\t\t\t\tsheet[i][j] = sc.nextInt();\n\t\t\t}",
"int j=0;",
"int j=0;",
"j",
"0",
"j<colNum",
"j",
"colNum",
"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",
"sc.close()",
"sc.close",
"sc",
"int colSum[] = new int[colNum];",
"colSum",
"new int[colNum]",
"colNum",
"for(int i=0; i<rowNum; i++) {\n\t\t\t// 1行ごとの合計値\n\t\t\tint rowSum = 0;\n\t\t\tfor(int j=0; j<colNum+1; j++) {\n\t\t\t\tif(j == colNum) {\n\t\t\t\t\tSystem.out.print(rowSum);\n\t\t\t\t} else {\n\t\t\t\t\trowSum += sheet[i][j];\n\t\t\t\t\tcolSum[j] += sheet[i][j];\n\t\t\t\t\tSystem.out.print(sheet[i][j] + \" \");\n\t\t\t\t}\n\t\t\t}\n\t\t\tSystem.out.println(\"\");\n\t\t}",
"int i=0;",
"int i=0;",
"i",
"0",
"i<rowNum",
"i",
"rowNum",
"i++",
"i++",
"i",
"{\n\t\t\t// 1行ごとの合計値\n\t\t\tint rowSum = 0;\n\t\t\tfor(int j=0; j<colNum+1; j++) {\n\t\t\t\tif(j == colNum) {\n\t\t\t\t\tSystem.out.print(rowSum);\n\t\t\t\t} else {\n\t\t\t\t\trowSum += sheet[i][j];\n\t\t\t\t\tcolSum[j] += sheet[i][j];\n\t\t\t\t\tSystem.out.print(sheet[i][j] + \" \");\n\t\t\t\t}\n\t\t\t}\n\t\t\tSystem.out.println(\"\");\n\t\t}",
"{\n\t\t\t// 1行ごとの合計値\n\t\t\tint rowSum = 0;\n\t\t\tfor(int j=0; j<colNum+1; j++) {\n\t\t\t\tif(j == colNum) {\n\t\t\t\t\tSystem.out.print(rowSum);\n\t\t\t\t} else {\n\t\t\t\t\trowSum += sheet[i][j];\n\t\t\t\t\tcolSum[j] += sheet[i][j];\n\t\t\t\t\tSystem.out.print(sheet[i][j] + \" \");\n\t\t\t\t}\n\t\t\t}\n\t\t\tSystem.out.println(\"\");\n\t\t}",
"int rowSum = 0;",
"rowSum",
"0",
"for(int j=0; j<colNum+1; j++) {\n\t\t\t\tif(j == colNum) {\n\t\t\t\t\tSystem.out.print(rowSum);\n\t\t\t\t} else {\n\t\t\t\t\trowSum += sheet[i][j];\n\t\t\t\t\tcolSum[j] += sheet[i][j];\n\t\t\t\t\tSystem.out.print(sheet[i][j] + \" \");\n\t\t\t\t}\n\t\t\t}",
"int j=0;",
"int j=0;",
"j",
"0",
"j<colNum+1",
"j",
"colNum+1",
"colNum",
"1",
"j++",
"j++",
"j",
"{\n\t\t\t\tif(j == colNum) {\n\t\t\t\t\tSystem.out.print(rowSum);\n\t\t\t\t} else {\n\t\t\t\t\trowSum += sheet[i][j];\n\t\t\t\t\tcolSum[j] += sheet[i][j];\n\t\t\t\t\tSystem.out.print(sheet[i][j] + \" \");\n\t\t\t\t}\n\t\t\t}",
"{\n\t\t\t\tif(j == colNum) {\n\t\t\t\t\tSystem.out.print(rowSum);\n\t\t\t\t} else {\n\t\t\t\t\trowSum += sheet[i][j];\n\t\t\t\t\tcolSum[j] += sheet[i][j];\n\t\t\t\t\tSystem.out.print(sheet[i][j] + \" \");\n\t\t\t\t}\n\t\t\t}",
"if(j == colNum) {\n\t\t\t\t\tSystem.out.print(rowSum);\n\t\t\t\t} else {\n\t\t\t\t\trowSum += sheet[i][j];\n\t\t\t\t\tcolSum[j] += sheet[i][j];\n\t\t\t\t\tSystem.out.print(sheet[i][j] + \" \");\n\t\t\t\t}",
"j == colNum",
"j",
"colNum",
"{\n\t\t\t\t\tSystem.out.print(rowSum);\n\t\t\t\t}",
"System.out.print(rowSum)",
"System.out.print",
"System.out",
"System",
"System.out",
"rowSum",
"{\n\t\t\t\t\trowSum += sheet[i][j];\n\t\t\t\t\tcolSum[j] += sheet[i][j];\n\t\t\t\t\tSystem.out.print(sheet[i][j] + \" \");\n\t\t\t\t}",
"rowSum += sheet[i][j]",
"rowSum",
"sheet[i][j]",
"sheet[i]",
"sheet",
"i",
"j",
"colSum[j] += sheet[i][j]",
"colSum[j]",
"colSum",
"j",
"sheet[i][j]",
"sheet[i]",
"sheet",
"i",
"j",
"System.out.print(sheet[i][j] + \" \")",
"System.out.print",
"System.out",
"System",
"System.out",
"sheet[i][j] + \" \"",
"sheet[i][j]",
"sheet[i]",
"sheet",
"i",
"j",
"\" \"",
"System.out.println(\"\")",
"System.out.println",
"System.out",
"System",
"System.out",
"\"\"",
"int totalSum = 0;",
"totalSum",
"0",
"for(int i=0; i<colNum; i++) {\n\t\t\ttotalSum += colSum[i];\n\t\t\tSystem.out.print(colSum[i] + \" \");\n\t\t}",
"int i=0;",
"int i=0;",
"i",
"0",
"i<colNum",
"i",
"colNum",
"i++",
"i++",
"i",
"{\n\t\t\ttotalSum += colSum[i];\n\t\t\tSystem.out.print(colSum[i] + \" \");\n\t\t}",
"{\n\t\t\ttotalSum += colSum[i];\n\t\t\tSystem.out.print(colSum[i] + \" \");\n\t\t}",
"totalSum += colSum[i]",
"totalSum",
"colSum[i]",
"colSum",
"i",
"System.out.print(colSum[i] + \" \")",
"System.out.print",
"System.out",
"System",
"System.out",
"colSum[i] + \" \"",
"colSum[i]",
"colSum",
"i",
"\" \"",
"System.out.println(totalSum)",
"System.out.println",
"System.out",
"System",
"System.out",
"totalSum",
"String[] args",
"args",
"public class Main {\n\n\tpublic static void main(String[] args) {\n\n\t\tScanner sc = new Scanner(System.in);\n\t\tint rowNum = sc.nextInt();\n\t\tint colNum = sc.nextInt();\n\n\t\tint sheet[][] = new int[rowNum][colNum];\n\n\n\t\t// 入力\n\t\tfor(int i=0; i<rowNum; i++) {\n\t\t\tfor(int j=0; j<colNum; j++) {\n\t\t\t\tsheet[i][j] = sc.nextInt();\n\t\t\t}\n\t\t}\n\n\t\tsc.close();\n\n\t\t// 出力\n\t\t// 1列ごとの合計値\n\t\tint colSum[] = new int[colNum];\n\t\tfor(int i=0; i<rowNum; i++) {\n\t\t\t// 1行ごとの合計値\n\t\t\tint rowSum = 0;\n\t\t\tfor(int j=0; j<colNum+1; j++) {\n\t\t\t\tif(j == colNum) {\n\t\t\t\t\tSystem.out.print(rowSum);\n\t\t\t\t} else {\n\t\t\t\t\trowSum += sheet[i][j];\n\t\t\t\t\tcolSum[j] += sheet[i][j];\n\t\t\t\t\tSystem.out.print(sheet[i][j] + \" \");\n\t\t\t\t}\n\t\t\t}\n\t\t\tSystem.out.println(\"\");\n\t\t}\n\t\tint totalSum = 0;\n\t\tfor(int i=0; i<colNum; i++) {\n\t\t\ttotalSum += colSum[i];\n\t\t\tSystem.out.print(colSum[i] + \" \");\n\t\t}\n\t\tSystem.out.println(totalSum);\n\n\n\t}\n\n}",
"public class Main {\n\n\tpublic static void main(String[] args) {\n\n\t\tScanner sc = new Scanner(System.in);\n\t\tint rowNum = sc.nextInt();\n\t\tint colNum = sc.nextInt();\n\n\t\tint sheet[][] = new int[rowNum][colNum];\n\n\n\t\t// 入力\n\t\tfor(int i=0; i<rowNum; i++) {\n\t\t\tfor(int j=0; j<colNum; j++) {\n\t\t\t\tsheet[i][j] = sc.nextInt();\n\t\t\t}\n\t\t}\n\n\t\tsc.close();\n\n\t\t// 出力\n\t\t// 1列ごとの合計値\n\t\tint colSum[] = new int[colNum];\n\t\tfor(int i=0; i<rowNum; i++) {\n\t\t\t// 1行ごとの合計値\n\t\t\tint rowSum = 0;\n\t\t\tfor(int j=0; j<colNum+1; j++) {\n\t\t\t\tif(j == colNum) {\n\t\t\t\t\tSystem.out.print(rowSum);\n\t\t\t\t} else {\n\t\t\t\t\trowSum += sheet[i][j];\n\t\t\t\t\tcolSum[j] += sheet[i][j];\n\t\t\t\t\tSystem.out.print(sheet[i][j] + \" \");\n\t\t\t\t}\n\t\t\t}\n\t\t\tSystem.out.println(\"\");\n\t\t}\n\t\tint totalSum = 0;\n\t\tfor(int i=0; i<colNum; i++) {\n\t\t\ttotalSum += colSum[i];\n\t\t\tSystem.out.print(colSum[i] + \" \");\n\t\t}\n\t\tSystem.out.println(totalSum);\n\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 rowNum = sc.nextInt();
int colNum = sc.nextInt();
int sheet[][] = new int[rowNum][colNum];
// 入力
for(int i=0; i<rowNum; i++) {
for(int j=0; j<colNum; j++) {
sheet[i][j] = sc.nextInt();
}
}
sc.close();
// 出力
// 1列ごとの合計値
int colSum[] = new int[colNum];
for(int i=0; i<rowNum; i++) {
// 1行ごとの合計値
int rowSum = 0;
for(int j=0; j<colNum+1; j++) {
if(j == colNum) {
System.out.print(rowSum);
} else {
rowSum += sheet[i][j];
colSum[j] += sheet[i][j];
System.out.print(sheet[i][j] + " ");
}
}
System.out.println("");
}
int totalSum = 0;
for(int i=0; i<colNum; i++) {
totalSum += colSum[i];
System.out.print(colSum[i] + " ");
}
System.out.println(totalSum);
}
}
|
[
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,
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
],
[
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
],
[
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
],
[
60,
81
],
[
81,
82
],
[
82,
83
],
[
83,
84
],
[
83,
85
],
[
82,
86
],
[
81,
87
],
[
87,
88
],
[
88,
89
],
[
88,
90
],
[
87,
91
],
[
60,
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
],
[
110,
111
],
[
110,
112
],
[
103,
113
],
[
113,
114
],
[
114,
115
],
[
103,
116
],
[
117,
117
],
[
117,
118
],
[
118,
119
],
[
119,
120
],
[
120,
121
],
[
120,
122
],
[
118,
123
],
[
123,
124
],
[
123,
125
],
[
125,
126
],
[
125,
127
],
[
118,
128
],
[
128,
129
],
[
129,
130
],
[
118,
131
],
[
132,
132
],
[
132,
133
],
[
133,
134
],
[
134,
135
],
[
135,
136
],
[
135,
137
],
[
133,
138
],
[
138,
139
],
[
139,
140
],
[
139,
141
],
[
138,
142
],
[
132,
143
],
[
143,
144
],
[
144,
145
],
[
144,
146
],
[
143,
147
],
[
147,
148
],
[
148,
149
],
[
149,
150
],
[
150,
151
],
[
150,
152
],
[
148,
153
],
[
117,
154
],
[
154,
155
],
[
155,
156
],
[
156,
157
],
[
156,
158
],
[
6,
159
],
[
159,
160
]
] | [
"import java.util.Scanner;\n\nclass Main {\n\n\tpublic static void main(String[] args) {\n\n\t\tint r, c;\n\t\tScanner stdIn = new Scanner(System.in);\n\n\t\tr = stdIn.nextInt();\n\t\tc = stdIn.nextInt();\n\n\t\tint[][] ss = 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\tss[i][j] = stdIn.nextInt();\n\t\t\t\tss[i][c] += ss[i][j];\n\t\t\t\tss[r][j] += ss[i][j];\n\t\t\t\tss[r][c] += ss[i][j];\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.print(ss[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\n\t\t\t\tSystem.out.println();\n\t\t\t\n\t\t}\n\n\t}\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"class Main {\n\n\tpublic static void main(String[] args) {\n\n\t\tint r, c;\n\t\tScanner stdIn = new Scanner(System.in);\n\n\t\tr = stdIn.nextInt();\n\t\tc = stdIn.nextInt();\n\n\t\tint[][] ss = 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\tss[i][j] = stdIn.nextInt();\n\t\t\t\tss[i][c] += ss[i][j];\n\t\t\t\tss[r][j] += ss[i][j];\n\t\t\t\tss[r][c] += ss[i][j];\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.print(ss[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\n\t\t\t\tSystem.out.println();\n\t\t\t\n\t\t}\n\n\t}\n}",
"Main",
"public static void main(String[] args) {\n\n\t\tint r, c;\n\t\tScanner stdIn = new Scanner(System.in);\n\n\t\tr = stdIn.nextInt();\n\t\tc = stdIn.nextInt();\n\n\t\tint[][] ss = 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\tss[i][j] = stdIn.nextInt();\n\t\t\t\tss[i][c] += ss[i][j];\n\t\t\t\tss[r][j] += ss[i][j];\n\t\t\t\tss[r][c] += ss[i][j];\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.print(ss[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\n\t\t\t\tSystem.out.println();\n\t\t\t\n\t\t}\n\n\t}",
"main",
"{\n\n\t\tint r, c;\n\t\tScanner stdIn = new Scanner(System.in);\n\n\t\tr = stdIn.nextInt();\n\t\tc = stdIn.nextInt();\n\n\t\tint[][] ss = 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\tss[i][j] = stdIn.nextInt();\n\t\t\t\tss[i][c] += ss[i][j];\n\t\t\t\tss[r][j] += ss[i][j];\n\t\t\t\tss[r][c] += ss[i][j];\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.print(ss[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\n\t\t\t\tSystem.out.println();\n\t\t\t\n\t\t}\n\n\t}",
"int r",
"r",
"c;",
"c",
"Scanner stdIn = new Scanner(System.in);",
"stdIn",
"new Scanner(System.in)",
"r = stdIn.nextInt()",
"r",
"stdIn.nextInt()",
"stdIn.nextInt",
"stdIn",
"c = stdIn.nextInt()",
"c",
"stdIn.nextInt()",
"stdIn.nextInt",
"stdIn",
"int[][] ss = new int[r + 1][c + 1];",
"ss",
"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\tss[i][j] = stdIn.nextInt();\n\t\t\t\tss[i][c] += ss[i][j];\n\t\t\t\tss[r][j] += ss[i][j];\n\t\t\t\tss[r][c] += ss[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\tss[i][j] = stdIn.nextInt();\n\t\t\t\tss[i][c] += ss[i][j];\n\t\t\t\tss[r][j] += ss[i][j];\n\t\t\t\tss[r][c] += ss[i][j];\n\t\t\t}\n\t\t}",
"{\n\t\t\tfor (int j = 0; j < c; j++) {\n\t\t\t\tss[i][j] = stdIn.nextInt();\n\t\t\t\tss[i][c] += ss[i][j];\n\t\t\t\tss[r][j] += ss[i][j];\n\t\t\t\tss[r][c] += ss[i][j];\n\t\t\t}\n\t\t}",
"for (int j = 0; j < c; j++) {\n\t\t\t\tss[i][j] = stdIn.nextInt();\n\t\t\t\tss[i][c] += ss[i][j];\n\t\t\t\tss[r][j] += ss[i][j];\n\t\t\t\tss[r][c] += ss[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\tss[i][j] = stdIn.nextInt();\n\t\t\t\tss[i][c] += ss[i][j];\n\t\t\t\tss[r][j] += ss[i][j];\n\t\t\t\tss[r][c] += ss[i][j];\n\t\t\t}",
"{\n\t\t\t\tss[i][j] = stdIn.nextInt();\n\t\t\t\tss[i][c] += ss[i][j];\n\t\t\t\tss[r][j] += ss[i][j];\n\t\t\t\tss[r][c] += ss[i][j];\n\t\t\t}",
"ss[i][j] = stdIn.nextInt()",
"ss[i][j]",
"ss[i]",
"ss",
"i",
"j",
"stdIn.nextInt()",
"stdIn.nextInt",
"stdIn",
"ss[i][c] += ss[i][j]",
"ss[i][c]",
"ss[i]",
"ss",
"i",
"c",
"ss[i][j]",
"ss[i]",
"ss",
"i",
"j",
"ss[r][j] += ss[i][j]",
"ss[r][j]",
"ss[r]",
"ss",
"r",
"j",
"ss[i][j]",
"ss[i]",
"ss",
"i",
"j",
"ss[r][c] += ss[i][j]",
"ss[r][c]",
"ss[r]",
"ss",
"r",
"c",
"ss[i][j]",
"ss[i]",
"ss",
"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(ss[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\n\t\t\t\tSystem.out.println();\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(ss[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\n\t\t\t\tSystem.out.println();\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(ss[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\n\t\t\t\tSystem.out.println();\n\t\t\t\n\t\t}",
"for (int j = 0; j < c + 1; j++) {\n\t\t\t\tSystem.out.print(ss[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(ss[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(ss[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(ss[i][j])",
"System.out.print",
"System.out",
"System",
"System.out",
"ss[i][j]",
"ss[i]",
"ss",
"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"
] | import java.util.Scanner;
class Main {
public static void main(String[] args) {
int r, c;
Scanner stdIn = new Scanner(System.in);
r = stdIn.nextInt();
c = stdIn.nextInt();
int[][] ss = new int[r + 1][c + 1];
for (int i = 0; i < r; i++) {
for (int j = 0; j < c; j++) {
ss[i][j] = stdIn.nextInt();
ss[i][c] += ss[i][j];
ss[r][j] += ss[i][j];
ss[r][c] += ss[i][j];
}
}
for (int i = 0; i < r + 1; i++) {
for (int j = 0; j < c + 1; j++) {
System.out.print(ss[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,
20,
17,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
41,
13,
41,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
4,
18,
13,
0,
13,
13,
0,
18,
13,
13,
13,
4,
18,
18,
13,
13,
2,
13,
17,
0,
18,
13,
13,
13,
4,
18,
18,
13,
13,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
4,
18,
18,
13,
13,
2,
18,
13,
13,
17,
4,
18,
18,
13,
13,
18,
13,
13,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
124,
5
],
[
124,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
8,
16
],
[
16,
17
],
[
16,
18
],
[
18,
19
],
[
19,
20
],
[
8,
21
],
[
21,
22
],
[
21,
23
],
[
23,
24
],
[
24,
25
],
[
8,
26
],
[
26,
27
],
[
8,
28
],
[
28,
29
],
[
8,
30
],
[
30,
31
],
[
31,
32
],
[
32,
33
],
[
32,
34
],
[
30,
35
],
[
35,
36
],
[
35,
37
],
[
30,
38
],
[
38,
39
],
[
39,
40
],
[
30,
41
],
[
42,
42
],
[
42,
43
],
[
43,
44
],
[
43,
45
],
[
42,
46
],
[
46,
47
],
[
47,
48
],
[
48,
49
],
[
48,
50
],
[
46,
51
],
[
51,
52
],
[
51,
53
],
[
46,
54
],
[
54,
55
],
[
55,
56
],
[
46,
57
],
[
58,
58
],
[
58,
59
],
[
59,
60
],
[
59,
61
],
[
61,
62
],
[
62,
63
],
[
58,
64
],
[
64,
65
],
[
64,
66
],
[
58,
67
],
[
67,
68
],
[
68,
69
],
[
68,
70
],
[
67,
71
],
[
58,
72
],
[
72,
73
],
[
73,
74
],
[
74,
75
],
[
74,
76
],
[
72,
77
],
[
77,
78
],
[
77,
79
],
[
42,
80
],
[
80,
81
],
[
81,
82
],
[
81,
83
],
[
80,
84
],
[
42,
85
],
[
85,
86
],
[
86,
87
],
[
87,
88
],
[
87,
89
],
[
85,
90
],
[
8,
91
],
[
91,
92
],
[
92,
93
],
[
93,
94
],
[
93,
95
],
[
91,
96
],
[
96,
97
],
[
96,
98
],
[
91,
99
],
[
99,
100
],
[
100,
101
],
[
91,
102
],
[
102,
103
],
[
103,
104
],
[
104,
105
],
[
105,
106
],
[
105,
107
],
[
103,
108
],
[
108,
109
],
[
109,
110
],
[
109,
111
],
[
108,
112
],
[
8,
113
],
[
113,
114
],
[
114,
115
],
[
115,
116
],
[
115,
117
],
[
113,
118
],
[
118,
119
],
[
118,
120
],
[
6,
121
],
[
121,
122
],
[
0,
123
],
[
123,
124
],
[
123,
125
]
] | [
"import java.util.*;\npublic class Main\n{\n\tpublic static void main(String args[])\n\t{\n\t\tScanner input = new Scanner(System.in);\n\t\tint[] s = new int[111];\n\t\tint r = input.nextInt();\n\t\tint c = input.nextInt();\n\t\tint t, sum;\n\t\tfor(int i = 0; i < r; i++)\n\t\t{\n\t\t\tsum = 0;\n\t\t\tfor(int k = 0; k < c; k++)\n\t\t\t{\n\t\t\t\tt = input.nextInt();\n\t\t\t\tsum += t;\n\t\t\t\ts[k] += t;\n\t\t\t\tSystem.out.print(t + \" \");\n\t\t\t}\n\t\t\ts[c] += sum;\n\t\t\tSystem.out.println(sum);\n\t\t}\n\t\tfor(int i = 0; i < c; i++)\n\t\t\tSystem.out.print(s[i] + \" \");\n\t\tSystem.out.println(s[c]);\n\t}\n}",
"import java.util.*;",
"util.*",
"java",
"public class Main\n{\n\tpublic static void main(String args[])\n\t{\n\t\tScanner input = new Scanner(System.in);\n\t\tint[] s = new int[111];\n\t\tint r = input.nextInt();\n\t\tint c = input.nextInt();\n\t\tint t, sum;\n\t\tfor(int i = 0; i < r; i++)\n\t\t{\n\t\t\tsum = 0;\n\t\t\tfor(int k = 0; k < c; k++)\n\t\t\t{\n\t\t\t\tt = input.nextInt();\n\t\t\t\tsum += t;\n\t\t\t\ts[k] += t;\n\t\t\t\tSystem.out.print(t + \" \");\n\t\t\t}\n\t\t\ts[c] += sum;\n\t\t\tSystem.out.println(sum);\n\t\t}\n\t\tfor(int i = 0; i < c; i++)\n\t\t\tSystem.out.print(s[i] + \" \");\n\t\tSystem.out.println(s[c]);\n\t}\n}",
"Main",
"public static void main(String args[])\n\t{\n\t\tScanner input = new Scanner(System.in);\n\t\tint[] s = new int[111];\n\t\tint r = input.nextInt();\n\t\tint c = input.nextInt();\n\t\tint t, sum;\n\t\tfor(int i = 0; i < r; i++)\n\t\t{\n\t\t\tsum = 0;\n\t\t\tfor(int k = 0; k < c; k++)\n\t\t\t{\n\t\t\t\tt = input.nextInt();\n\t\t\t\tsum += t;\n\t\t\t\ts[k] += t;\n\t\t\t\tSystem.out.print(t + \" \");\n\t\t\t}\n\t\t\ts[c] += sum;\n\t\t\tSystem.out.println(sum);\n\t\t}\n\t\tfor(int i = 0; i < c; i++)\n\t\t\tSystem.out.print(s[i] + \" \");\n\t\tSystem.out.println(s[c]);\n\t}",
"main",
"{\n\t\tScanner input = new Scanner(System.in);\n\t\tint[] s = new int[111];\n\t\tint r = input.nextInt();\n\t\tint c = input.nextInt();\n\t\tint t, sum;\n\t\tfor(int i = 0; i < r; i++)\n\t\t{\n\t\t\tsum = 0;\n\t\t\tfor(int k = 0; k < c; k++)\n\t\t\t{\n\t\t\t\tt = input.nextInt();\n\t\t\t\tsum += t;\n\t\t\t\ts[k] += t;\n\t\t\t\tSystem.out.print(t + \" \");\n\t\t\t}\n\t\t\ts[c] += sum;\n\t\t\tSystem.out.println(sum);\n\t\t}\n\t\tfor(int i = 0; i < c; i++)\n\t\t\tSystem.out.print(s[i] + \" \");\n\t\tSystem.out.println(s[c]);\n\t}",
"Scanner input = new Scanner(System.in);",
"input",
"new Scanner(System.in)",
"int[] s = new int[111];",
"s",
"new int[111]",
"111",
"int r = input.nextInt();",
"r",
"input.nextInt()",
"input.nextInt",
"input",
"int c = input.nextInt();",
"c",
"input.nextInt()",
"input.nextInt",
"input",
"int t",
"t",
"sum;",
"sum",
"for(int i = 0; i < r; i++)\n\t\t{\n\t\t\tsum = 0;\n\t\t\tfor(int k = 0; k < c; k++)\n\t\t\t{\n\t\t\t\tt = input.nextInt();\n\t\t\t\tsum += t;\n\t\t\t\ts[k] += t;\n\t\t\t\tSystem.out.print(t + \" \");\n\t\t\t}\n\t\t\ts[c] += sum;\n\t\t\tSystem.out.println(sum);\n\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < r",
"i",
"r",
"i++",
"i++",
"i",
"{\n\t\t\tsum = 0;\n\t\t\tfor(int k = 0; k < c; k++)\n\t\t\t{\n\t\t\t\tt = input.nextInt();\n\t\t\t\tsum += t;\n\t\t\t\ts[k] += t;\n\t\t\t\tSystem.out.print(t + \" \");\n\t\t\t}\n\t\t\ts[c] += sum;\n\t\t\tSystem.out.println(sum);\n\t\t}",
"{\n\t\t\tsum = 0;\n\t\t\tfor(int k = 0; k < c; k++)\n\t\t\t{\n\t\t\t\tt = input.nextInt();\n\t\t\t\tsum += t;\n\t\t\t\ts[k] += t;\n\t\t\t\tSystem.out.print(t + \" \");\n\t\t\t}\n\t\t\ts[c] += sum;\n\t\t\tSystem.out.println(sum);\n\t\t}",
"sum = 0",
"sum",
"0",
"for(int k = 0; k < c; k++)\n\t\t\t{\n\t\t\t\tt = input.nextInt();\n\t\t\t\tsum += t;\n\t\t\t\ts[k] += t;\n\t\t\t\tSystem.out.print(t + \" \");\n\t\t\t}",
"int k = 0;",
"int k = 0;",
"k",
"0",
"k < c",
"k",
"c",
"k++",
"k++",
"k",
"{\n\t\t\t\tt = input.nextInt();\n\t\t\t\tsum += t;\n\t\t\t\ts[k] += t;\n\t\t\t\tSystem.out.print(t + \" \");\n\t\t\t}",
"{\n\t\t\t\tt = input.nextInt();\n\t\t\t\tsum += t;\n\t\t\t\ts[k] += t;\n\t\t\t\tSystem.out.print(t + \" \");\n\t\t\t}",
"t = input.nextInt()",
"t",
"input.nextInt()",
"input.nextInt",
"input",
"sum += t",
"sum",
"t",
"s[k] += t",
"s[k]",
"s",
"k",
"t",
"System.out.print(t + \" \")",
"System.out.print",
"System.out",
"System",
"System.out",
"t + \" \"",
"t",
"\" \"",
"s[c] += sum",
"s[c]",
"s",
"c",
"sum",
"System.out.println(sum)",
"System.out.println",
"System.out",
"System",
"System.out",
"sum",
"for(int i = 0; i < c; i++)\n\t\t\tSystem.out.print(s[i] + \" \");",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < c",
"i",
"c",
"i++",
"i++",
"i",
"System.out.print(s[i] + \" \");",
"System.out.print(s[i] + \" \")",
"System.out.print",
"System.out",
"System",
"System.out",
"s[i] + \" \"",
"s[i]",
"s",
"i",
"\" \"",
"System.out.println(s[c])",
"System.out.println",
"System.out",
"System",
"System.out",
"s[c]",
"s",
"c",
"String args[]",
"args",
"public class Main\n{\n\tpublic static void main(String args[])\n\t{\n\t\tScanner input = new Scanner(System.in);\n\t\tint[] s = new int[111];\n\t\tint r = input.nextInt();\n\t\tint c = input.nextInt();\n\t\tint t, sum;\n\t\tfor(int i = 0; i < r; i++)\n\t\t{\n\t\t\tsum = 0;\n\t\t\tfor(int k = 0; k < c; k++)\n\t\t\t{\n\t\t\t\tt = input.nextInt();\n\t\t\t\tsum += t;\n\t\t\t\ts[k] += t;\n\t\t\t\tSystem.out.print(t + \" \");\n\t\t\t}\n\t\t\ts[c] += sum;\n\t\t\tSystem.out.println(sum);\n\t\t}\n\t\tfor(int i = 0; i < c; i++)\n\t\t\tSystem.out.print(s[i] + \" \");\n\t\tSystem.out.println(s[c]);\n\t}\n}",
"public class Main\n{\n\tpublic static void main(String args[])\n\t{\n\t\tScanner input = new Scanner(System.in);\n\t\tint[] s = new int[111];\n\t\tint r = input.nextInt();\n\t\tint c = input.nextInt();\n\t\tint t, sum;\n\t\tfor(int i = 0; i < r; i++)\n\t\t{\n\t\t\tsum = 0;\n\t\t\tfor(int k = 0; k < c; k++)\n\t\t\t{\n\t\t\t\tt = input.nextInt();\n\t\t\t\tsum += t;\n\t\t\t\ts[k] += t;\n\t\t\t\tSystem.out.print(t + \" \");\n\t\t\t}\n\t\t\ts[c] += sum;\n\t\t\tSystem.out.println(sum);\n\t\t}\n\t\tfor(int i = 0; i < c; i++)\n\t\t\tSystem.out.print(s[i] + \" \");\n\t\tSystem.out.println(s[c]);\n\t}\n}",
"Main"
] | import java.util.*;
public class Main
{
public static void main(String args[])
{
Scanner input = new Scanner(System.in);
int[] s = new int[111];
int r = input.nextInt();
int c = input.nextInt();
int t, sum;
for(int i = 0; i < r; i++)
{
sum = 0;
for(int k = 0; k < c; k++)
{
t = input.nextInt();
sum += t;
s[k] += t;
System.out.print(t + " ");
}
s[c] += sum;
System.out.println(sum);
}
for(int i = 0; i < c; i++)
System.out.print(s[i] + " ");
System.out.println(s[c]);
}
} |
[
7,
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 public static void main(String[] args) {\n\n // ??????????????????????????????.\n java.util.Scanner sc = new java.util.Scanner(System.in);\n\n // ???????????????????????´??° (??????????????°??¨?¨???°) ???????????????.\n int tate = sc.nextInt();\n int yoko = sc.nextInt();\n\n // ???????????????????????´??° (?????????????´?) ?????????????????§??¨?????????.\n // ?????????????????¨?????????.\n // ????????????????§???????????¨????????????????.\n int[][] matrix = new int[tate][yoko];\n int sum = 0;\n int kado = 0;\n for (int i = 0; i < tate; i ++) {\n sum = 0;\n for (int j = 0; j < yoko; j ++) {\n matrix[i][j] = sc.nextInt();\n System.out.print(matrix[i][j] + \" \");\n sum += matrix[i][j];\n }\n kado += sum;\n System.out.println(sum);\n }\n\n // ?????????????????¨?????????.\n for (int i = 0; i < yoko; i ++) {\n sum = 0;\n for (int j = 0; j < tate; j ++) { sum += matrix[j][i]; }\n System.out.print(sum + \" \");\n }\n System.out.println(kado);\n }\n}",
"public class Main {\n public static void main(String[] args) {\n\n // ??????????????????????????????.\n java.util.Scanner sc = new java.util.Scanner(System.in);\n\n // ???????????????????????´??° (??????????????°??¨?¨???°) ???????????????.\n int tate = sc.nextInt();\n int yoko = sc.nextInt();\n\n // ???????????????????????´??° (?????????????´?) ?????????????????§??¨?????????.\n // ?????????????????¨?????????.\n // ????????????????§???????????¨????????????????.\n int[][] matrix = new int[tate][yoko];\n int sum = 0;\n int kado = 0;\n for (int i = 0; i < tate; i ++) {\n sum = 0;\n for (int j = 0; j < yoko; j ++) {\n matrix[i][j] = sc.nextInt();\n System.out.print(matrix[i][j] + \" \");\n sum += matrix[i][j];\n }\n kado += sum;\n System.out.println(sum);\n }\n\n // ?????????????????¨?????????.\n for (int i = 0; i < yoko; i ++) {\n sum = 0;\n for (int j = 0; j < tate; j ++) { sum += matrix[j][i]; }\n System.out.print(sum + \" \");\n }\n System.out.println(kado);\n }\n}",
"Main",
"public static void main(String[] args) {\n\n // ??????????????????????????????.\n java.util.Scanner sc = new java.util.Scanner(System.in);\n\n // ???????????????????????´??° (??????????????°??¨?¨???°) ???????????????.\n int tate = sc.nextInt();\n int yoko = sc.nextInt();\n\n // ???????????????????????´??° (?????????????´?) ?????????????????§??¨?????????.\n // ?????????????????¨?????????.\n // ????????????????§???????????¨????????????????.\n int[][] matrix = new int[tate][yoko];\n int sum = 0;\n int kado = 0;\n for (int i = 0; i < tate; i ++) {\n sum = 0;\n for (int j = 0; j < yoko; j ++) {\n matrix[i][j] = sc.nextInt();\n System.out.print(matrix[i][j] + \" \");\n sum += matrix[i][j];\n }\n kado += sum;\n System.out.println(sum);\n }\n\n // ?????????????????¨?????????.\n for (int i = 0; i < yoko; i ++) {\n sum = 0;\n for (int j = 0; j < tate; j ++) { sum += matrix[j][i]; }\n System.out.print(sum + \" \");\n }\n System.out.println(kado);\n }",
"main",
"{\n\n // ??????????????????????????????.\n java.util.Scanner sc = new java.util.Scanner(System.in);\n\n // ???????????????????????´??° (??????????????°??¨?¨???°) ???????????????.\n int tate = sc.nextInt();\n int yoko = sc.nextInt();\n\n // ???????????????????????´??° (?????????????´?) ?????????????????§??¨?????????.\n // ?????????????????¨?????????.\n // ????????????????§???????????¨????????????????.\n int[][] matrix = new int[tate][yoko];\n int sum = 0;\n int kado = 0;\n for (int i = 0; i < tate; i ++) {\n sum = 0;\n for (int j = 0; j < yoko; j ++) {\n matrix[i][j] = sc.nextInt();\n System.out.print(matrix[i][j] + \" \");\n sum += matrix[i][j];\n }\n kado += sum;\n System.out.println(sum);\n }\n\n // ?????????????????¨?????????.\n for (int i = 0; i < yoko; i ++) {\n sum = 0;\n for (int j = 0; j < tate; j ++) { sum += matrix[j][i]; }\n System.out.print(sum + \" \");\n }\n System.out.println(kado);\n }",
"java.util.Scanner sc = new java.util.Scanner(System.in);",
"sc",
"new java.util.Scanner(System.in)",
"int tate = sc.nextInt();",
"tate",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int yoko = sc.nextInt();",
"yoko",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int[][] matrix = new int[tate][yoko];",
"matrix",
"new int[tate][yoko]",
"tate",
"yoko",
"int sum = 0;",
"sum",
"0",
"int kado = 0;",
"kado",
"0",
"for (int i = 0; i < tate; i ++) {\n sum = 0;\n for (int j = 0; j < yoko; j ++) {\n matrix[i][j] = sc.nextInt();\n System.out.print(matrix[i][j] + \" \");\n sum += matrix[i][j];\n }\n kado += sum;\n System.out.println(sum);\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < tate",
"i",
"tate",
"i ++",
"i ++",
"i",
"{\n sum = 0;\n for (int j = 0; j < yoko; j ++) {\n matrix[i][j] = sc.nextInt();\n System.out.print(matrix[i][j] + \" \");\n sum += matrix[i][j];\n }\n kado += sum;\n System.out.println(sum);\n }",
"{\n sum = 0;\n for (int j = 0; j < yoko; j ++) {\n matrix[i][j] = sc.nextInt();\n System.out.print(matrix[i][j] + \" \");\n sum += matrix[i][j];\n }\n kado += sum;\n System.out.println(sum);\n }",
"sum = 0",
"sum",
"0",
"for (int j = 0; j < yoko; j ++) {\n matrix[i][j] = sc.nextInt();\n System.out.print(matrix[i][j] + \" \");\n sum += matrix[i][j];\n }",
"int j = 0;",
"int j = 0;",
"j",
"0",
"j < yoko",
"j",
"yoko",
"j ++",
"j ++",
"j",
"{\n matrix[i][j] = sc.nextInt();\n System.out.print(matrix[i][j] + \" \");\n sum += matrix[i][j];\n }",
"{\n matrix[i][j] = sc.nextInt();\n System.out.print(matrix[i][j] + \" \");\n sum += matrix[i][j];\n }",
"matrix[i][j] = sc.nextInt()",
"matrix[i][j]",
"matrix[i]",
"matrix",
"i",
"j",
"sc.nextInt()",
"sc.nextInt",
"sc",
"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",
"kado += sum",
"kado",
"sum",
"System.out.println(sum)",
"System.out.println",
"System.out",
"System",
"System.out",
"sum",
"for (int i = 0; i < yoko; i ++) {\n sum = 0;\n for (int j = 0; j < tate; j ++) { sum += matrix[j][i]; }\n System.out.print(sum + \" \");\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < yoko",
"i",
"yoko",
"i ++",
"i ++",
"i",
"{\n sum = 0;\n for (int j = 0; j < tate; j ++) { sum += matrix[j][i]; }\n System.out.print(sum + \" \");\n }",
"{\n sum = 0;\n for (int j = 0; j < tate; j ++) { sum += matrix[j][i]; }\n System.out.print(sum + \" \");\n }",
"sum = 0",
"sum",
"0",
"for (int j = 0; j < tate; j ++) { sum += matrix[j][i]; }",
"int j = 0;",
"int j = 0;",
"j",
"0",
"j < tate",
"j",
"tate",
"j ++",
"j ++",
"j",
"{ sum += matrix[j][i]; }",
"{ sum += matrix[j][i]; }",
"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(kado)",
"System.out.println",
"System.out",
"System",
"System.out",
"kado",
"String[] args",
"args",
"public class Main {\n public static void main(String[] args) {\n\n // ??????????????????????????????.\n java.util.Scanner sc = new java.util.Scanner(System.in);\n\n // ???????????????????????´??° (??????????????°??¨?¨???°) ???????????????.\n int tate = sc.nextInt();\n int yoko = sc.nextInt();\n\n // ???????????????????????´??° (?????????????´?) ?????????????????§??¨?????????.\n // ?????????????????¨?????????.\n // ????????????????§???????????¨????????????????.\n int[][] matrix = new int[tate][yoko];\n int sum = 0;\n int kado = 0;\n for (int i = 0; i < tate; i ++) {\n sum = 0;\n for (int j = 0; j < yoko; j ++) {\n matrix[i][j] = sc.nextInt();\n System.out.print(matrix[i][j] + \" \");\n sum += matrix[i][j];\n }\n kado += sum;\n System.out.println(sum);\n }\n\n // ?????????????????¨?????????.\n for (int i = 0; i < yoko; i ++) {\n sum = 0;\n for (int j = 0; j < tate; j ++) { sum += matrix[j][i]; }\n System.out.print(sum + \" \");\n }\n System.out.println(kado);\n }\n}",
"public class Main {\n public static void main(String[] args) {\n\n // ??????????????????????????????.\n java.util.Scanner sc = new java.util.Scanner(System.in);\n\n // ???????????????????????´??° (??????????????°??¨?¨???°) ???????????????.\n int tate = sc.nextInt();\n int yoko = sc.nextInt();\n\n // ???????????????????????´??° (?????????????´?) ?????????????????§??¨?????????.\n // ?????????????????¨?????????.\n // ????????????????§???????????¨????????????????.\n int[][] matrix = new int[tate][yoko];\n int sum = 0;\n int kado = 0;\n for (int i = 0; i < tate; i ++) {\n sum = 0;\n for (int j = 0; j < yoko; j ++) {\n matrix[i][j] = sc.nextInt();\n System.out.print(matrix[i][j] + \" \");\n sum += matrix[i][j];\n }\n kado += sum;\n System.out.println(sum);\n }\n\n // ?????????????????¨?????????.\n for (int i = 0; i < yoko; i ++) {\n sum = 0;\n for (int j = 0; j < tate; j ++) { sum += matrix[j][i]; }\n System.out.print(sum + \" \");\n }\n System.out.println(kado);\n }\n}",
"Main"
] | public class Main {
public static void main(String[] args) {
// ??????????????????????????????.
java.util.Scanner sc = new java.util.Scanner(System.in);
// ???????????????????????´??° (??????????????°??¨?¨???°) ???????????????.
int tate = sc.nextInt();
int yoko = sc.nextInt();
// ???????????????????????´??° (?????????????´?) ?????????????????§??¨?????????.
// ?????????????????¨?????????.
// ????????????????§???????????¨????????????????.
int[][] matrix = new int[tate][yoko];
int sum = 0;
int kado = 0;
for (int i = 0; i < tate; i ++) {
sum = 0;
for (int j = 0; j < yoko; j ++) {
matrix[i][j] = sc.nextInt();
System.out.print(matrix[i][j] + " ");
sum += matrix[i][j];
}
kado += sum;
System.out.println(sum);
}
// ?????????????????¨?????????.
for (int i = 0; i < yoko; i ++) {
sum = 0;
for (int j = 0; j < tate; j ++) { sum += matrix[j][i]; }
System.out.print(sum + " ");
}
System.out.println(kado);
}
} |
[
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,
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,
17,
18,
18,
13,
13,
13,
4,
18,
18,
13,
13,
17,
13,
4,
18,
18,
13,
13,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
18,
18,
13,
13,
13,
4,
18,
18,
13,
13,
17,
13,
0,
13,
13,
4,
18,
18,
13,
13,
17,
13,
4,
18,
18,
13,
13,
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
],
[
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
],
[
79,
81
],
[
78,
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
],
[
94,
102
],
[
102,
103
],
[
103,
104
],
[
104,
105
],
[
104,
106
],
[
102,
107
],
[
102,
108
],
[
108,
109
],
[
109,
110
],
[
109,
111
],
[
108,
112
],
[
78,
113
],
[
113,
114
],
[
114,
115
],
[
115,
116
],
[
115,
117
],
[
113,
118
],
[
113,
119
],
[
78,
120
],
[
120,
121
],
[
121,
122
],
[
122,
123
],
[
122,
124
],
[
8,
125
],
[
125,
126
],
[
125,
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
],
[
141,
143
],
[
140,
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
],
[
157,
159
],
[
159,
160
],
[
160,
161
],
[
160,
162
],
[
159,
163
],
[
140,
164
],
[
164,
165
],
[
165,
166
],
[
166,
167
],
[
166,
168
],
[
164,
169
],
[
164,
170
],
[
140,
171
],
[
171,
172
],
[
171,
173
],
[
8,
174
],
[
174,
175
],
[
175,
176
],
[
176,
177
],
[
176,
178
],
[
174,
179
],
[
174,
180
],
[
8,
181
],
[
181,
182
],
[
182,
183
],
[
183,
184
],
[
183,
185
],
[
6,
186
],
[
186,
187
],
[
0,
188
],
[
188,
189
],
[
188,
190
]
] | [
"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\t\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\t\n\t\t\t}\n\t\t\t\n\t\t}\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\tsum += cell[i][j];\n\t\t\t\tSystem.out.printf(\"%d \",cell[i][j]);\n\t\t\t\t\n\t\t\t}\n\t\t\tSystem.out.printf(\"%d\",sum);\n\t\t\tSystem.out.println();\n\t\t}\n\t\t\n\t\tint total = 0;\n\t\tfor(int j = 0; j < c; j++) {\n\t\t\tint sum = 0;\n\t\t\tfor(int i = 0; i < r; i++) {\n\t\t\t\tsum += cell[i][j];\n\t\t\t\t}\n\t\t\tSystem.out.printf(\"%d \",sum);\n\t\t\ttotal += sum;\n\t\t}\n\t\tSystem.out.printf(\"%d\",total);\n\t\tSystem.out.println();\n\t\t\n\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\t\tint r = sc.nextInt();\n\t\tint c = sc.nextInt();\n\t\tint[][] cell = 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\tcell[i][j] = sc.nextInt();\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t}\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\tsum += cell[i][j];\n\t\t\t\tSystem.out.printf(\"%d \",cell[i][j]);\n\t\t\t\t\n\t\t\t}\n\t\t\tSystem.out.printf(\"%d\",sum);\n\t\t\tSystem.out.println();\n\t\t}\n\t\t\n\t\tint total = 0;\n\t\tfor(int j = 0; j < c; j++) {\n\t\t\tint sum = 0;\n\t\t\tfor(int i = 0; i < r; i++) {\n\t\t\t\tsum += cell[i][j];\n\t\t\t\t}\n\t\t\tSystem.out.printf(\"%d \",sum);\n\t\t\ttotal += sum;\n\t\t}\n\t\tSystem.out.printf(\"%d\",total);\n\t\tSystem.out.println();\n\t\t\n\n\t}\n}",
"Main",
"public static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\tint r = sc.nextInt();\n\t\tint c = sc.nextInt();\n\t\tint[][] cell = 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\tcell[i][j] = sc.nextInt();\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t}\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\tsum += cell[i][j];\n\t\t\t\tSystem.out.printf(\"%d \",cell[i][j]);\n\t\t\t\t\n\t\t\t}\n\t\t\tSystem.out.printf(\"%d\",sum);\n\t\t\tSystem.out.println();\n\t\t}\n\t\t\n\t\tint total = 0;\n\t\tfor(int j = 0; j < c; j++) {\n\t\t\tint sum = 0;\n\t\t\tfor(int i = 0; i < r; i++) {\n\t\t\t\tsum += cell[i][j];\n\t\t\t\t}\n\t\t\tSystem.out.printf(\"%d \",sum);\n\t\t\ttotal += sum;\n\t\t}\n\t\tSystem.out.printf(\"%d\",total);\n\t\tSystem.out.println();\n\t\t\n\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\t\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\t\n\t\t\t}\n\t\t\t\n\t\t}\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\tsum += cell[i][j];\n\t\t\t\tSystem.out.printf(\"%d \",cell[i][j]);\n\t\t\t\t\n\t\t\t}\n\t\t\tSystem.out.printf(\"%d\",sum);\n\t\t\tSystem.out.println();\n\t\t}\n\t\t\n\t\tint total = 0;\n\t\tfor(int j = 0; j < c; j++) {\n\t\t\tint sum = 0;\n\t\t\tfor(int i = 0; i < r; i++) {\n\t\t\t\tsum += cell[i][j];\n\t\t\t\t}\n\t\t\tSystem.out.printf(\"%d \",sum);\n\t\t\ttotal += sum;\n\t\t}\n\t\tSystem.out.printf(\"%d\",total);\n\t\tSystem.out.println();\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[][] 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\tfor(int j = 0; j < c; j++) {\n\t\t\t\tcell[i][j] = sc.nextInt();\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\tfor(int j = 0; j < c; j++) {\n\t\t\t\tcell[i][j] = sc.nextInt();\n\t\t\t\t\n\t\t\t}\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\t\n\t\t\t}\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\t\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\t\n\t\t\t}",
"{\n\t\t\t\tcell[i][j] = sc.nextInt();\n\t\t\t\t\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\tint sum = 0;\n\t\t\tfor(int j = 0; j < c; j++) {\n\t\t\t\tsum += cell[i][j];\n\t\t\t\tSystem.out.printf(\"%d \",cell[i][j]);\n\t\t\t\t\n\t\t\t}\n\t\t\tSystem.out.printf(\"%d\",sum);\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\tint sum = 0;\n\t\t\tfor(int j = 0; j < c; j++) {\n\t\t\t\tsum += cell[i][j];\n\t\t\t\tSystem.out.printf(\"%d \",cell[i][j]);\n\t\t\t\t\n\t\t\t}\n\t\t\tSystem.out.printf(\"%d\",sum);\n\t\t\tSystem.out.println();\n\t\t}",
"{\n\t\t\tint sum = 0;\n\t\t\tfor(int j = 0; j < c; j++) {\n\t\t\t\tsum += cell[i][j];\n\t\t\t\tSystem.out.printf(\"%d \",cell[i][j]);\n\t\t\t\t\n\t\t\t}\n\t\t\tSystem.out.printf(\"%d\",sum);\n\t\t\tSystem.out.println();\n\t\t}",
"int sum = 0;",
"sum",
"0",
"for(int j = 0; j < c; j++) {\n\t\t\t\tsum += cell[i][j];\n\t\t\t\tSystem.out.printf(\"%d \",cell[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\tsum += cell[i][j];\n\t\t\t\tSystem.out.printf(\"%d \",cell[i][j]);\n\t\t\t\t\n\t\t\t}",
"{\n\t\t\t\tsum += cell[i][j];\n\t\t\t\tSystem.out.printf(\"%d \",cell[i][j]);\n\t\t\t\t\n\t\t\t}",
"sum += cell[i][j]",
"sum",
"cell[i][j]",
"cell[i]",
"cell",
"i",
"j",
"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\",sum)",
"System.out.printf",
"System.out",
"System",
"System.out",
"\"%d\"",
"sum",
"System.out.println()",
"System.out.println",
"System.out",
"System",
"System.out",
"int total = 0;",
"total",
"0",
"for(int j = 0; j < c; j++) {\n\t\t\tint sum = 0;\n\t\t\tfor(int i = 0; i < r; i++) {\n\t\t\t\tsum += cell[i][j];\n\t\t\t\t}\n\t\t\tSystem.out.printf(\"%d \",sum);\n\t\t\ttotal += sum;\n\t\t}",
"int j = 0;",
"int j = 0;",
"j",
"0",
"j < c",
"j",
"c",
"j++",
"j++",
"j",
"{\n\t\t\tint sum = 0;\n\t\t\tfor(int i = 0; i < r; i++) {\n\t\t\t\tsum += cell[i][j];\n\t\t\t\t}\n\t\t\tSystem.out.printf(\"%d \",sum);\n\t\t\ttotal += sum;\n\t\t}",
"{\n\t\t\tint sum = 0;\n\t\t\tfor(int i = 0; i < r; i++) {\n\t\t\t\tsum += cell[i][j];\n\t\t\t\t}\n\t\t\tSystem.out.printf(\"%d \",sum);\n\t\t\ttotal += sum;\n\t\t}",
"int sum = 0;",
"sum",
"0",
"for(int i = 0; i < r; i++) {\n\t\t\t\tsum += cell[i][j];\n\t\t\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < r",
"i",
"r",
"i++",
"i++",
"i",
"{\n\t\t\t\tsum += cell[i][j];\n\t\t\t\t}",
"{\n\t\t\t\tsum += cell[i][j];\n\t\t\t\t}",
"sum += cell[i][j]",
"sum",
"cell[i][j]",
"cell[i]",
"cell",
"i",
"j",
"System.out.printf(\"%d \",sum)",
"System.out.printf",
"System.out",
"System",
"System.out",
"\"%d \"",
"sum",
"total += sum",
"total",
"sum",
"System.out.printf(\"%d\",total)",
"System.out.printf",
"System.out",
"System",
"System.out",
"\"%d\"",
"total",
"System.out.println()",
"System.out.println",
"System.out",
"System",
"System.out",
"String[] args",
"args",
"public class Main {\n\n\tpublic static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\tint r = sc.nextInt();\n\t\tint c = sc.nextInt();\n\t\tint[][] cell = 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\tcell[i][j] = sc.nextInt();\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t}\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\tsum += cell[i][j];\n\t\t\t\tSystem.out.printf(\"%d \",cell[i][j]);\n\t\t\t\t\n\t\t\t}\n\t\t\tSystem.out.printf(\"%d\",sum);\n\t\t\tSystem.out.println();\n\t\t}\n\t\t\n\t\tint total = 0;\n\t\tfor(int j = 0; j < c; j++) {\n\t\t\tint sum = 0;\n\t\t\tfor(int i = 0; i < r; i++) {\n\t\t\t\tsum += cell[i][j];\n\t\t\t\t}\n\t\t\tSystem.out.printf(\"%d \",sum);\n\t\t\ttotal += sum;\n\t\t}\n\t\tSystem.out.printf(\"%d\",total);\n\t\tSystem.out.println();\n\t\t\n\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\t\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\t\n\t\t\t}\n\t\t\t\n\t\t}\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\tsum += cell[i][j];\n\t\t\t\tSystem.out.printf(\"%d \",cell[i][j]);\n\t\t\t\t\n\t\t\t}\n\t\t\tSystem.out.printf(\"%d\",sum);\n\t\t\tSystem.out.println();\n\t\t}\n\t\t\n\t\tint total = 0;\n\t\tfor(int j = 0; j < c; j++) {\n\t\t\tint sum = 0;\n\t\t\tfor(int i = 0; i < r; i++) {\n\t\t\t\tsum += cell[i][j];\n\t\t\t\t}\n\t\t\tSystem.out.printf(\"%d \",sum);\n\t\t\ttotal += sum;\n\t\t}\n\t\tSystem.out.printf(\"%d\",total);\n\t\tSystem.out.println();\n\t\t\n\n\t}\n}",
"Main"
] | import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int r = sc.nextInt();
int c = sc.nextInt();
int[][] cell = new int[r+1][c+1];
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++) {
int sum = 0;
for(int j = 0; j < c; j++) {
sum += cell[i][j];
System.out.printf("%d ",cell[i][j]);
}
System.out.printf("%d",sum);
System.out.println();
}
int total = 0;
for(int j = 0; j < c; j++) {
int sum = 0;
for(int i = 0; i < r; i++) {
sum += cell[i][j];
}
System.out.printf("%d ",sum);
total += sum;
}
System.out.printf("%d",total);
System.out.println();
}
}
|
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
20,
41,
13,
41,
13,
41,
13,
41,
13,
0,
13,
4,
18,
13,
0,
13,
4,
18,
13,
0,
13,
17,
0,
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,
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,
3,
14,
2,
13,
13,
30,
11,
1,
41,
13,
17,
2,
13,
2,
13,
17,
1,
40,
13,
30,
30,
0,
13,
2,
13,
18,
18,
13,
13,
13,
4,
18,
13,
13,
4,
18,
13,
17,
0,
13,
17,
30,
4,
18,
13,
18,
18,
13,
13,
13,
4,
18,
13,
17,
0,
13,
17,
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,
0,
13,
2,
13,
18,
18,
13,
13,
13,
0,
13,
2,
13,
13,
4,
18,
13,
13,
4,
18,
13,
17,
0,
13,
17,
4,
18,
13,
13,
4,
18,
18,
13,
13,
20,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
244,
5
],
[
244,
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
],
[
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
],
[
8,
36
],
[
36,
37
],
[
36,
38
],
[
8,
39
],
[
39,
40
],
[
39,
41
],
[
42,
43
],
[
42,
44
],
[
45,
46
],
[
45,
47
],
[
8,
48
],
[
48,
49
],
[
49,
50
],
[
50,
51
],
[
50,
52
],
[
48,
53
],
[
53,
54
],
[
53,
55
],
[
48,
56
],
[
56,
57
],
[
57,
58
],
[
48,
59
],
[
60,
60
],
[
60,
61
],
[
61,
62
],
[
62,
63
],
[
63,
64
],
[
63,
65
],
[
61,
66
],
[
66,
67
],
[
66,
68
],
[
61,
69
],
[
69,
70
],
[
70,
71
],
[
61,
72
],
[
73,
73
],
[
73,
74
],
[
74,
75
],
[
75,
76
],
[
76,
77
],
[
76,
78
],
[
75,
79
],
[
74,
80
],
[
80,
81
],
[
81,
82
],
[
8,
83
],
[
83,
84
],
[
84,
85
],
[
85,
86
],
[
85,
87
],
[
83,
88
],
[
88,
89
],
[
88,
90
],
[
90,
91
],
[
90,
92
],
[
83,
93
],
[
93,
94
],
[
94,
95
],
[
83,
96
],
[
97,
97
],
[
97,
98
],
[
98,
99
],
[
99,
100
],
[
100,
101
],
[
100,
102
],
[
98,
103
],
[
103,
104
],
[
103,
105
],
[
105,
106
],
[
105,
107
],
[
98,
108
],
[
108,
109
],
[
109,
110
],
[
98,
111
],
[
112,
112
],
[
112,
113
],
[
113,
114
],
[
114,
115
],
[
114,
116
],
[
113,
117
],
[
117,
118
],
[
112,
119
],
[
119,
120
],
[
120,
121
],
[
120,
122
],
[
119,
123
],
[
123,
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
],
[
139,
141
],
[
141,
142
],
[
141,
143
],
[
143,
144
],
[
144,
145
],
[
144,
146
],
[
143,
147
],
[
123,
148
],
[
148,
149
],
[
149,
150
],
[
148,
151
],
[
123,
152
],
[
152,
153
],
[
153,
154
],
[
152,
155
],
[
123,
156
],
[
156,
157
],
[
156,
158
],
[
119,
159
],
[
159,
160
],
[
160,
161
],
[
161,
162
],
[
160,
163
],
[
163,
164
],
[
164,
165
],
[
164,
166
],
[
163,
167
],
[
159,
168
],
[
168,
169
],
[
169,
170
],
[
168,
171
],
[
97,
172
],
[
172,
173
],
[
172,
174
],
[
97,
175
],
[
175,
176
],
[
176,
177
],
[
176,
178
],
[
175,
179
],
[
179,
180
],
[
180,
181
],
[
181,
182
],
[
182,
183
],
[
182,
184
],
[
180,
185
],
[
185,
186
],
[
185,
187
],
[
180,
188
],
[
188,
189
],
[
189,
190
],
[
180,
191
],
[
192,
192
],
[
192,
193
],
[
193,
194
],
[
194,
195
],
[
195,
196
],
[
195,
197
],
[
193,
198
],
[
198,
199
],
[
198,
200
],
[
193,
201
],
[
201,
202
],
[
202,
203
],
[
193,
204
],
[
205,
205
],
[
205,
206
],
[
206,
207
],
[
206,
208
],
[
208,
209
],
[
208,
210
],
[
210,
211
],
[
211,
212
],
[
211,
213
],
[
210,
214
],
[
192,
215
],
[
215,
216
],
[
215,
217
],
[
217,
218
],
[
217,
219
],
[
192,
220
],
[
220,
221
],
[
221,
222
],
[
220,
223
],
[
192,
224
],
[
224,
225
],
[
225,
226
],
[
224,
227
],
[
192,
228
],
[
228,
229
],
[
228,
230
],
[
8,
231
],
[
231,
232
],
[
232,
233
],
[
231,
234
],
[
8,
235
],
[
235,
236
],
[
236,
237
],
[
237,
238
],
[
237,
239
],
[
235,
240
],
[
6,
241
],
[
241,
242
],
[
0,
243
],
[
243,
244
],
[
243,
245
]
] | [
"\nimport java.util.*;\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\tint r, c, sum,sum2;\n\t\tr = scan.nextInt();\n\t\tc = scan.nextInt();\n\t\tsum = 0;// ????¨????\n\t\tsum2 = 0;//??¨??????????¨????\n\t\t// ????¬???????????????????\n\t\tint num[][] = new int[r + 1][c + 1];\n\t\t// ?????????????´?\n\t\tfor (int count = 0; count < r; count++) {\n\t\t\tfor (int count2 = 0; count2 < c; count2++) {\n\t\t\t\tnum[count][count2] = scan.nextInt();\n\t\t\t}\n\t\t}\n\t\t\n\t\t// ?¨??????¨StringBuilder???????´??????????????????? r=1 c=8\n\t\tfor (int count3 = 0; count3 < (r + 1); count3++) {\n\t\t\tfor (int count4 = 0; count4 < (c + 1); count4++) {\n\t\t\t\tif(count3 == r){break;}//????????????????????????????????????\n\t\t\t\tif (count4 == c) {// ???????¨??????¨???\n\t\t\t\t\t// ????????¨??????????¨?\n\t\t\t\t\tfor (int count5 = 0; count5 < (c+1); count5++) {\n\t\t\t\t\t\tsum = sum + num[count3][count5];\n\t\t\t\t\t}\n\t\t\t\t\tsb.append(sum);\n\t\t\t\t\tsb.append(\"\\n\");\n\t\t\t\t\tsum = 0;// sum????????????\n\t\t\t\t} else {// ??????????????¨???\n\t\t\t\t\tsb.append(num[count3][count4]);\n\t\t\t\t\tsb.append(\" \");\n\t\t\t\t}\n\t\t\t}\n\t\t\tsum = 0;//sum ????????????\n\t\t\tif(count3 == r){//???????¨??????¨???\n\t\t\t\tfor(int count6=0;count6<c;count6++){\n\t\t\t\t\tfor(int count7=0;count7<r;count7++){\n\t\t\t\t\t\tsum = sum + num[count7][count6];\n\t\t\t\t\t}\n\t\t\t\t\tsum2 = sum2 + sum;\n\t\t\t\t\tsb.append(sum);\n\t\t\t\t\tsb.append(\" \");\n\t\t\t\t\tsum = 0;//sum????????????\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tsb.append(sum2);\n\t\tSystem.out.println(new String(sb));\n\n\t}\n}",
"import java.util.*;",
"util.*",
"java",
"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\tint r, c, sum,sum2;\n\t\tr = scan.nextInt();\n\t\tc = scan.nextInt();\n\t\tsum = 0;// ????¨????\n\t\tsum2 = 0;//??¨??????????¨????\n\t\t// ????¬???????????????????\n\t\tint num[][] = new int[r + 1][c + 1];\n\t\t// ?????????????´?\n\t\tfor (int count = 0; count < r; count++) {\n\t\t\tfor (int count2 = 0; count2 < c; count2++) {\n\t\t\t\tnum[count][count2] = scan.nextInt();\n\t\t\t}\n\t\t}\n\t\t\n\t\t// ?¨??????¨StringBuilder???????´??????????????????? r=1 c=8\n\t\tfor (int count3 = 0; count3 < (r + 1); count3++) {\n\t\t\tfor (int count4 = 0; count4 < (c + 1); count4++) {\n\t\t\t\tif(count3 == r){break;}//????????????????????????????????????\n\t\t\t\tif (count4 == c) {// ???????¨??????¨???\n\t\t\t\t\t// ????????¨??????????¨?\n\t\t\t\t\tfor (int count5 = 0; count5 < (c+1); count5++) {\n\t\t\t\t\t\tsum = sum + num[count3][count5];\n\t\t\t\t\t}\n\t\t\t\t\tsb.append(sum);\n\t\t\t\t\tsb.append(\"\\n\");\n\t\t\t\t\tsum = 0;// sum????????????\n\t\t\t\t} else {// ??????????????¨???\n\t\t\t\t\tsb.append(num[count3][count4]);\n\t\t\t\t\tsb.append(\" \");\n\t\t\t\t}\n\t\t\t}\n\t\t\tsum = 0;//sum ????????????\n\t\t\tif(count3 == r){//???????¨??????¨???\n\t\t\t\tfor(int count6=0;count6<c;count6++){\n\t\t\t\t\tfor(int count7=0;count7<r;count7++){\n\t\t\t\t\t\tsum = sum + num[count7][count6];\n\t\t\t\t\t}\n\t\t\t\t\tsum2 = sum2 + sum;\n\t\t\t\t\tsb.append(sum);\n\t\t\t\t\tsb.append(\" \");\n\t\t\t\t\tsum = 0;//sum????????????\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tsb.append(sum2);\n\t\tSystem.out.println(new String(sb));\n\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\tint r, c, sum,sum2;\n\t\tr = scan.nextInt();\n\t\tc = scan.nextInt();\n\t\tsum = 0;// ????¨????\n\t\tsum2 = 0;//??¨??????????¨????\n\t\t// ????¬???????????????????\n\t\tint num[][] = new int[r + 1][c + 1];\n\t\t// ?????????????´?\n\t\tfor (int count = 0; count < r; count++) {\n\t\t\tfor (int count2 = 0; count2 < c; count2++) {\n\t\t\t\tnum[count][count2] = scan.nextInt();\n\t\t\t}\n\t\t}\n\t\t\n\t\t// ?¨??????¨StringBuilder???????´??????????????????? r=1 c=8\n\t\tfor (int count3 = 0; count3 < (r + 1); count3++) {\n\t\t\tfor (int count4 = 0; count4 < (c + 1); count4++) {\n\t\t\t\tif(count3 == r){break;}//????????????????????????????????????\n\t\t\t\tif (count4 == c) {// ???????¨??????¨???\n\t\t\t\t\t// ????????¨??????????¨?\n\t\t\t\t\tfor (int count5 = 0; count5 < (c+1); count5++) {\n\t\t\t\t\t\tsum = sum + num[count3][count5];\n\t\t\t\t\t}\n\t\t\t\t\tsb.append(sum);\n\t\t\t\t\tsb.append(\"\\n\");\n\t\t\t\t\tsum = 0;// sum????????????\n\t\t\t\t} else {// ??????????????¨???\n\t\t\t\t\tsb.append(num[count3][count4]);\n\t\t\t\t\tsb.append(\" \");\n\t\t\t\t}\n\t\t\t}\n\t\t\tsum = 0;//sum ????????????\n\t\t\tif(count3 == r){//???????¨??????¨???\n\t\t\t\tfor(int count6=0;count6<c;count6++){\n\t\t\t\t\tfor(int count7=0;count7<r;count7++){\n\t\t\t\t\t\tsum = sum + num[count7][count6];\n\t\t\t\t\t}\n\t\t\t\t\tsum2 = sum2 + sum;\n\t\t\t\t\tsb.append(sum);\n\t\t\t\t\tsb.append(\" \");\n\t\t\t\t\tsum = 0;//sum????????????\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tsb.append(sum2);\n\t\tSystem.out.println(new String(sb));\n\n\t}",
"main",
"{\n\t\tScanner scan = new Scanner(System.in);\n\t\tStringBuilder sb = new StringBuilder();\n\t\tint r, c, sum,sum2;\n\t\tr = scan.nextInt();\n\t\tc = scan.nextInt();\n\t\tsum = 0;// ????¨????\n\t\tsum2 = 0;//??¨??????????¨????\n\t\t// ????¬???????????????????\n\t\tint num[][] = new int[r + 1][c + 1];\n\t\t// ?????????????´?\n\t\tfor (int count = 0; count < r; count++) {\n\t\t\tfor (int count2 = 0; count2 < c; count2++) {\n\t\t\t\tnum[count][count2] = scan.nextInt();\n\t\t\t}\n\t\t}\n\t\t\n\t\t// ?¨??????¨StringBuilder???????´??????????????????? r=1 c=8\n\t\tfor (int count3 = 0; count3 < (r + 1); count3++) {\n\t\t\tfor (int count4 = 0; count4 < (c + 1); count4++) {\n\t\t\t\tif(count3 == r){break;}//????????????????????????????????????\n\t\t\t\tif (count4 == c) {// ???????¨??????¨???\n\t\t\t\t\t// ????????¨??????????¨?\n\t\t\t\t\tfor (int count5 = 0; count5 < (c+1); count5++) {\n\t\t\t\t\t\tsum = sum + num[count3][count5];\n\t\t\t\t\t}\n\t\t\t\t\tsb.append(sum);\n\t\t\t\t\tsb.append(\"\\n\");\n\t\t\t\t\tsum = 0;// sum????????????\n\t\t\t\t} else {// ??????????????¨???\n\t\t\t\t\tsb.append(num[count3][count4]);\n\t\t\t\t\tsb.append(\" \");\n\t\t\t\t}\n\t\t\t}\n\t\t\tsum = 0;//sum ????????????\n\t\t\tif(count3 == r){//???????¨??????¨???\n\t\t\t\tfor(int count6=0;count6<c;count6++){\n\t\t\t\t\tfor(int count7=0;count7<r;count7++){\n\t\t\t\t\t\tsum = sum + num[count7][count6];\n\t\t\t\t\t}\n\t\t\t\t\tsum2 = sum2 + sum;\n\t\t\t\t\tsb.append(sum);\n\t\t\t\t\tsb.append(\" \");\n\t\t\t\t\tsum = 0;//sum????????????\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tsb.append(sum2);\n\t\tSystem.out.println(new String(sb));\n\n\t}",
"Scanner scan = new Scanner(System.in);",
"scan",
"new Scanner(System.in)",
"StringBuilder sb = new StringBuilder();",
"sb",
"new StringBuilder()",
"int r",
"r",
"c",
"c",
"sum",
"sum",
"sum2;",
"sum2",
"r = scan.nextInt()",
"r",
"scan.nextInt()",
"scan.nextInt",
"scan",
"c = scan.nextInt()",
"c",
"scan.nextInt()",
"scan.nextInt",
"scan",
"sum = 0",
"sum",
"0",
"sum2 = 0",
"sum2",
"0",
"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 count = 0; count < r; count++) {\n\t\t\tfor (int count2 = 0; count2 < c; count2++) {\n\t\t\t\tnum[count][count2] = scan.nextInt();\n\t\t\t}\n\t\t}",
"int count = 0;",
"int count = 0;",
"count",
"0",
"count < r",
"count",
"r",
"count++",
"count++",
"count",
"{\n\t\t\tfor (int count2 = 0; count2 < c; count2++) {\n\t\t\t\tnum[count][count2] = scan.nextInt();\n\t\t\t}\n\t\t}",
"{\n\t\t\tfor (int count2 = 0; count2 < c; count2++) {\n\t\t\t\tnum[count][count2] = scan.nextInt();\n\t\t\t}\n\t\t}",
"for (int count2 = 0; count2 < c; count2++) {\n\t\t\t\tnum[count][count2] = scan.nextInt();\n\t\t\t}",
"int count2 = 0;",
"int count2 = 0;",
"count2",
"0",
"count2 < c",
"count2",
"c",
"count2++",
"count2++",
"count2",
"{\n\t\t\t\tnum[count][count2] = scan.nextInt();\n\t\t\t}",
"{\n\t\t\t\tnum[count][count2] = scan.nextInt();\n\t\t\t}",
"num[count][count2] = scan.nextInt()",
"num[count][count2]",
"num[count]",
"num",
"count",
"count2",
"scan.nextInt()",
"scan.nextInt",
"scan",
"for (int count3 = 0; count3 < (r + 1); count3++) {\n\t\t\tfor (int count4 = 0; count4 < (c + 1); count4++) {\n\t\t\t\tif(count3 == r){break;}//????????????????????????????????????\n\t\t\t\tif (count4 == c) {// ???????¨??????¨???\n\t\t\t\t\t// ????????¨??????????¨?\n\t\t\t\t\tfor (int count5 = 0; count5 < (c+1); count5++) {\n\t\t\t\t\t\tsum = sum + num[count3][count5];\n\t\t\t\t\t}\n\t\t\t\t\tsb.append(sum);\n\t\t\t\t\tsb.append(\"\\n\");\n\t\t\t\t\tsum = 0;// sum????????????\n\t\t\t\t} else {// ??????????????¨???\n\t\t\t\t\tsb.append(num[count3][count4]);\n\t\t\t\t\tsb.append(\" \");\n\t\t\t\t}\n\t\t\t}\n\t\t\tsum = 0;//sum ????????????\n\t\t\tif(count3 == r){//???????¨??????¨???\n\t\t\t\tfor(int count6=0;count6<c;count6++){\n\t\t\t\t\tfor(int count7=0;count7<r;count7++){\n\t\t\t\t\t\tsum = sum + num[count7][count6];\n\t\t\t\t\t}\n\t\t\t\t\tsum2 = sum2 + sum;\n\t\t\t\t\tsb.append(sum);\n\t\t\t\t\tsb.append(\" \");\n\t\t\t\t\tsum = 0;//sum????????????\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"int count3 = 0;",
"int count3 = 0;",
"count3",
"0",
"count3 < (r + 1)",
"count3",
"(r + 1)",
"r",
"1",
"count3++",
"count3++",
"count3",
"{\n\t\t\tfor (int count4 = 0; count4 < (c + 1); count4++) {\n\t\t\t\tif(count3 == r){break;}//????????????????????????????????????\n\t\t\t\tif (count4 == c) {// ???????¨??????¨???\n\t\t\t\t\t// ????????¨??????????¨?\n\t\t\t\t\tfor (int count5 = 0; count5 < (c+1); count5++) {\n\t\t\t\t\t\tsum = sum + num[count3][count5];\n\t\t\t\t\t}\n\t\t\t\t\tsb.append(sum);\n\t\t\t\t\tsb.append(\"\\n\");\n\t\t\t\t\tsum = 0;// sum????????????\n\t\t\t\t} else {// ??????????????¨???\n\t\t\t\t\tsb.append(num[count3][count4]);\n\t\t\t\t\tsb.append(\" \");\n\t\t\t\t}\n\t\t\t}\n\t\t\tsum = 0;//sum ????????????\n\t\t\tif(count3 == r){//???????¨??????¨???\n\t\t\t\tfor(int count6=0;count6<c;count6++){\n\t\t\t\t\tfor(int count7=0;count7<r;count7++){\n\t\t\t\t\t\tsum = sum + num[count7][count6];\n\t\t\t\t\t}\n\t\t\t\t\tsum2 = sum2 + sum;\n\t\t\t\t\tsb.append(sum);\n\t\t\t\t\tsb.append(\" \");\n\t\t\t\t\tsum = 0;//sum????????????\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"{\n\t\t\tfor (int count4 = 0; count4 < (c + 1); count4++) {\n\t\t\t\tif(count3 == r){break;}//????????????????????????????????????\n\t\t\t\tif (count4 == c) {// ???????¨??????¨???\n\t\t\t\t\t// ????????¨??????????¨?\n\t\t\t\t\tfor (int count5 = 0; count5 < (c+1); count5++) {\n\t\t\t\t\t\tsum = sum + num[count3][count5];\n\t\t\t\t\t}\n\t\t\t\t\tsb.append(sum);\n\t\t\t\t\tsb.append(\"\\n\");\n\t\t\t\t\tsum = 0;// sum????????????\n\t\t\t\t} else {// ??????????????¨???\n\t\t\t\t\tsb.append(num[count3][count4]);\n\t\t\t\t\tsb.append(\" \");\n\t\t\t\t}\n\t\t\t}\n\t\t\tsum = 0;//sum ????????????\n\t\t\tif(count3 == r){//???????¨??????¨???\n\t\t\t\tfor(int count6=0;count6<c;count6++){\n\t\t\t\t\tfor(int count7=0;count7<r;count7++){\n\t\t\t\t\t\tsum = sum + num[count7][count6];\n\t\t\t\t\t}\n\t\t\t\t\tsum2 = sum2 + sum;\n\t\t\t\t\tsb.append(sum);\n\t\t\t\t\tsb.append(\" \");\n\t\t\t\t\tsum = 0;//sum????????????\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"for (int count4 = 0; count4 < (c + 1); count4++) {\n\t\t\t\tif(count3 == r){break;}//????????????????????????????????????\n\t\t\t\tif (count4 == c) {// ???????¨??????¨???\n\t\t\t\t\t// ????????¨??????????¨?\n\t\t\t\t\tfor (int count5 = 0; count5 < (c+1); count5++) {\n\t\t\t\t\t\tsum = sum + num[count3][count5];\n\t\t\t\t\t}\n\t\t\t\t\tsb.append(sum);\n\t\t\t\t\tsb.append(\"\\n\");\n\t\t\t\t\tsum = 0;// sum????????????\n\t\t\t\t} else {// ??????????????¨???\n\t\t\t\t\tsb.append(num[count3][count4]);\n\t\t\t\t\tsb.append(\" \");\n\t\t\t\t}\n\t\t\t}",
"int count4 = 0;",
"int count4 = 0;",
"count4",
"0",
"count4 < (c + 1)",
"count4",
"(c + 1)",
"c",
"1",
"count4++",
"count4++",
"count4",
"{\n\t\t\t\tif(count3 == r){break;}//????????????????????????????????????\n\t\t\t\tif (count4 == c) {// ???????¨??????¨???\n\t\t\t\t\t// ????????¨??????????¨?\n\t\t\t\t\tfor (int count5 = 0; count5 < (c+1); count5++) {\n\t\t\t\t\t\tsum = sum + num[count3][count5];\n\t\t\t\t\t}\n\t\t\t\t\tsb.append(sum);\n\t\t\t\t\tsb.append(\"\\n\");\n\t\t\t\t\tsum = 0;// sum????????????\n\t\t\t\t} else {// ??????????????¨???\n\t\t\t\t\tsb.append(num[count3][count4]);\n\t\t\t\t\tsb.append(\" \");\n\t\t\t\t}\n\t\t\t}",
"{\n\t\t\t\tif(count3 == r){break;}//????????????????????????????????????\n\t\t\t\tif (count4 == c) {// ???????¨??????¨???\n\t\t\t\t\t// ????????¨??????????¨?\n\t\t\t\t\tfor (int count5 = 0; count5 < (c+1); count5++) {\n\t\t\t\t\t\tsum = sum + num[count3][count5];\n\t\t\t\t\t}\n\t\t\t\t\tsb.append(sum);\n\t\t\t\t\tsb.append(\"\\n\");\n\t\t\t\t\tsum = 0;// sum????????????\n\t\t\t\t} else {// ??????????????¨???\n\t\t\t\t\tsb.append(num[count3][count4]);\n\t\t\t\t\tsb.append(\" \");\n\t\t\t\t}\n\t\t\t}",
"if(count3 == r){break;}//????????????????????????????????????",
"count3 == r",
"count3",
"r",
"{break;}",
"break;",
"if (count4 == c) {// ???????¨??????¨???\n\t\t\t\t\t// ????????¨??????????¨?\n\t\t\t\t\tfor (int count5 = 0; count5 < (c+1); count5++) {\n\t\t\t\t\t\tsum = sum + num[count3][count5];\n\t\t\t\t\t}\n\t\t\t\t\tsb.append(sum);\n\t\t\t\t\tsb.append(\"\\n\");\n\t\t\t\t\tsum = 0;// sum????????????\n\t\t\t\t} else {// ??????????????¨???\n\t\t\t\t\tsb.append(num[count3][count4]);\n\t\t\t\t\tsb.append(\" \");\n\t\t\t\t}",
"count4 == c",
"count4",
"c",
"{// ???????¨??????¨???\n\t\t\t\t\t// ????????¨??????????¨?\n\t\t\t\t\tfor (int count5 = 0; count5 < (c+1); count5++) {\n\t\t\t\t\t\tsum = sum + num[count3][count5];\n\t\t\t\t\t}\n\t\t\t\t\tsb.append(sum);\n\t\t\t\t\tsb.append(\"\\n\");\n\t\t\t\t\tsum = 0;// sum????????????\n\t\t\t\t}",
"for (int count5 = 0; count5 < (c+1); count5++) {\n\t\t\t\t\t\tsum = sum + num[count3][count5];\n\t\t\t\t\t}",
"int count5 = 0;",
"int count5 = 0;",
"count5",
"0",
"count5 < (c+1)",
"count5",
"(c+1)",
"c",
"1",
"count5++",
"count5++",
"count5",
"{\n\t\t\t\t\t\tsum = sum + num[count3][count5];\n\t\t\t\t\t}",
"{\n\t\t\t\t\t\tsum = sum + num[count3][count5];\n\t\t\t\t\t}",
"sum = sum + num[count3][count5]",
"sum",
"sum + num[count3][count5]",
"sum",
"num[count3][count5]",
"num[count3]",
"num",
"count3",
"count5",
"sb.append(sum)",
"sb.append",
"sb",
"sum",
"sb.append(\"\\n\")",
"sb.append",
"sb",
"\"\\n\"",
"sum = 0",
"sum",
"0",
"{// ??????????????¨???\n\t\t\t\t\tsb.append(num[count3][count4]);\n\t\t\t\t\tsb.append(\" \");\n\t\t\t\t}",
"sb.append(num[count3][count4])",
"sb.append",
"sb",
"num[count3][count4]",
"num[count3]",
"num",
"count3",
"count4",
"sb.append(\" \")",
"sb.append",
"sb",
"\" \"",
"sum = 0",
"sum",
"0",
"if(count3 == r){//???????¨??????¨???\n\t\t\t\tfor(int count6=0;count6<c;count6++){\n\t\t\t\t\tfor(int count7=0;count7<r;count7++){\n\t\t\t\t\t\tsum = sum + num[count7][count6];\n\t\t\t\t\t}\n\t\t\t\t\tsum2 = sum2 + sum;\n\t\t\t\t\tsb.append(sum);\n\t\t\t\t\tsb.append(\" \");\n\t\t\t\t\tsum = 0;//sum????????????\n\t\t\t\t}\n\t\t\t}",
"count3 == r",
"count3",
"r",
"{//???????¨??????¨???\n\t\t\t\tfor(int count6=0;count6<c;count6++){\n\t\t\t\t\tfor(int count7=0;count7<r;count7++){\n\t\t\t\t\t\tsum = sum + num[count7][count6];\n\t\t\t\t\t}\n\t\t\t\t\tsum2 = sum2 + sum;\n\t\t\t\t\tsb.append(sum);\n\t\t\t\t\tsb.append(\" \");\n\t\t\t\t\tsum = 0;//sum????????????\n\t\t\t\t}\n\t\t\t}",
"for(int count6=0;count6<c;count6++){\n\t\t\t\t\tfor(int count7=0;count7<r;count7++){\n\t\t\t\t\t\tsum = sum + num[count7][count6];\n\t\t\t\t\t}\n\t\t\t\t\tsum2 = sum2 + sum;\n\t\t\t\t\tsb.append(sum);\n\t\t\t\t\tsb.append(\" \");\n\t\t\t\t\tsum = 0;//sum????????????\n\t\t\t\t}",
"int count6=0;",
"int count6=0;",
"count6",
"0",
"count6<c",
"count6",
"c",
"count6++",
"count6++",
"count6",
"{\n\t\t\t\t\tfor(int count7=0;count7<r;count7++){\n\t\t\t\t\t\tsum = sum + num[count7][count6];\n\t\t\t\t\t}\n\t\t\t\t\tsum2 = sum2 + sum;\n\t\t\t\t\tsb.append(sum);\n\t\t\t\t\tsb.append(\" \");\n\t\t\t\t\tsum = 0;//sum????????????\n\t\t\t\t}",
"{\n\t\t\t\t\tfor(int count7=0;count7<r;count7++){\n\t\t\t\t\t\tsum = sum + num[count7][count6];\n\t\t\t\t\t}\n\t\t\t\t\tsum2 = sum2 + sum;\n\t\t\t\t\tsb.append(sum);\n\t\t\t\t\tsb.append(\" \");\n\t\t\t\t\tsum = 0;//sum????????????\n\t\t\t\t}",
"for(int count7=0;count7<r;count7++){\n\t\t\t\t\t\tsum = sum + num[count7][count6];\n\t\t\t\t\t}",
"int count7=0;",
"int count7=0;",
"count7",
"0",
"count7<r",
"count7",
"r",
"count7++",
"count7++",
"count7",
"{\n\t\t\t\t\t\tsum = sum + num[count7][count6];\n\t\t\t\t\t}",
"{\n\t\t\t\t\t\tsum = sum + num[count7][count6];\n\t\t\t\t\t}",
"sum = sum + num[count7][count6]",
"sum",
"sum + num[count7][count6]",
"sum",
"num[count7][count6]",
"num[count7]",
"num",
"count7",
"count6",
"sum2 = sum2 + sum",
"sum2",
"sum2 + sum",
"sum2",
"sum",
"sb.append(sum)",
"sb.append",
"sb",
"sum",
"sb.append(\" \")",
"sb.append",
"sb",
"\" \"",
"sum = 0",
"sum",
"0",
"sb.append(sum2)",
"sb.append",
"sb",
"sum2",
"System.out.println(new String(sb))",
"System.out.println",
"System.out",
"System",
"System.out",
"new String(sb)",
"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\tint r, c, sum,sum2;\n\t\tr = scan.nextInt();\n\t\tc = scan.nextInt();\n\t\tsum = 0;// ????¨????\n\t\tsum2 = 0;//??¨??????????¨????\n\t\t// ????¬???????????????????\n\t\tint num[][] = new int[r + 1][c + 1];\n\t\t// ?????????????´?\n\t\tfor (int count = 0; count < r; count++) {\n\t\t\tfor (int count2 = 0; count2 < c; count2++) {\n\t\t\t\tnum[count][count2] = scan.nextInt();\n\t\t\t}\n\t\t}\n\t\t\n\t\t// ?¨??????¨StringBuilder???????´??????????????????? r=1 c=8\n\t\tfor (int count3 = 0; count3 < (r + 1); count3++) {\n\t\t\tfor (int count4 = 0; count4 < (c + 1); count4++) {\n\t\t\t\tif(count3 == r){break;}//????????????????????????????????????\n\t\t\t\tif (count4 == c) {// ???????¨??????¨???\n\t\t\t\t\t// ????????¨??????????¨?\n\t\t\t\t\tfor (int count5 = 0; count5 < (c+1); count5++) {\n\t\t\t\t\t\tsum = sum + num[count3][count5];\n\t\t\t\t\t}\n\t\t\t\t\tsb.append(sum);\n\t\t\t\t\tsb.append(\"\\n\");\n\t\t\t\t\tsum = 0;// sum????????????\n\t\t\t\t} else {// ??????????????¨???\n\t\t\t\t\tsb.append(num[count3][count4]);\n\t\t\t\t\tsb.append(\" \");\n\t\t\t\t}\n\t\t\t}\n\t\t\tsum = 0;//sum ????????????\n\t\t\tif(count3 == r){//???????¨??????¨???\n\t\t\t\tfor(int count6=0;count6<c;count6++){\n\t\t\t\t\tfor(int count7=0;count7<r;count7++){\n\t\t\t\t\t\tsum = sum + num[count7][count6];\n\t\t\t\t\t}\n\t\t\t\t\tsum2 = sum2 + sum;\n\t\t\t\t\tsb.append(sum);\n\t\t\t\t\tsb.append(\" \");\n\t\t\t\t\tsum = 0;//sum????????????\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tsb.append(sum2);\n\t\tSystem.out.println(new String(sb));\n\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\tint r, c, sum,sum2;\n\t\tr = scan.nextInt();\n\t\tc = scan.nextInt();\n\t\tsum = 0;// ????¨????\n\t\tsum2 = 0;//??¨??????????¨????\n\t\t// ????¬???????????????????\n\t\tint num[][] = new int[r + 1][c + 1];\n\t\t// ?????????????´?\n\t\tfor (int count = 0; count < r; count++) {\n\t\t\tfor (int count2 = 0; count2 < c; count2++) {\n\t\t\t\tnum[count][count2] = scan.nextInt();\n\t\t\t}\n\t\t}\n\t\t\n\t\t// ?¨??????¨StringBuilder???????´??????????????????? r=1 c=8\n\t\tfor (int count3 = 0; count3 < (r + 1); count3++) {\n\t\t\tfor (int count4 = 0; count4 < (c + 1); count4++) {\n\t\t\t\tif(count3 == r){break;}//????????????????????????????????????\n\t\t\t\tif (count4 == c) {// ???????¨??????¨???\n\t\t\t\t\t// ????????¨??????????¨?\n\t\t\t\t\tfor (int count5 = 0; count5 < (c+1); count5++) {\n\t\t\t\t\t\tsum = sum + num[count3][count5];\n\t\t\t\t\t}\n\t\t\t\t\tsb.append(sum);\n\t\t\t\t\tsb.append(\"\\n\");\n\t\t\t\t\tsum = 0;// sum????????????\n\t\t\t\t} else {// ??????????????¨???\n\t\t\t\t\tsb.append(num[count3][count4]);\n\t\t\t\t\tsb.append(\" \");\n\t\t\t\t}\n\t\t\t}\n\t\t\tsum = 0;//sum ????????????\n\t\t\tif(count3 == r){//???????¨??????¨???\n\t\t\t\tfor(int count6=0;count6<c;count6++){\n\t\t\t\t\tfor(int count7=0;count7<r;count7++){\n\t\t\t\t\t\tsum = sum + num[count7][count6];\n\t\t\t\t\t}\n\t\t\t\t\tsum2 = sum2 + sum;\n\t\t\t\t\tsb.append(sum);\n\t\t\t\t\tsb.append(\" \");\n\t\t\t\t\tsum = 0;//sum????????????\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tsb.append(sum2);\n\t\tSystem.out.println(new String(sb));\n\n\t}\n}",
"Main"
] |
import java.util.*;
public class Main {
public static void main(String args[]) {
Scanner scan = new Scanner(System.in);
StringBuilder sb = new StringBuilder();
int r, c, sum,sum2;
r = scan.nextInt();
c = scan.nextInt();
sum = 0;// ????¨????
sum2 = 0;//??¨??????????¨????
// ????¬???????????????????
int num[][] = new int[r + 1][c + 1];
// ?????????????´?
for (int count = 0; count < r; count++) {
for (int count2 = 0; count2 < c; count2++) {
num[count][count2] = scan.nextInt();
}
}
// ?¨??????¨StringBuilder???????´??????????????????? r=1 c=8
for (int count3 = 0; count3 < (r + 1); count3++) {
for (int count4 = 0; count4 < (c + 1); count4++) {
if(count3 == r){break;}//????????????????????????????????????
if (count4 == c) {// ???????¨??????¨???
// ????????¨??????????¨?
for (int count5 = 0; count5 < (c+1); count5++) {
sum = sum + num[count3][count5];
}
sb.append(sum);
sb.append("\n");
sum = 0;// sum????????????
} else {// ??????????????¨???
sb.append(num[count3][count4]);
sb.append(" ");
}
}
sum = 0;//sum ????????????
if(count3 == r){//???????¨??????¨???
for(int count6=0;count6<c;count6++){
for(int count7=0;count7<r;count7++){
sum = sum + num[count7][count6];
}
sum2 = sum2 + sum;
sb.append(sum);
sb.append(" ");
sum = 0;//sum????????????
}
}
}
sb.append(sum2);
System.out.println(new String(sb));
}
} |
[
7,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
41,
13,
41,
13,
20,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
4,
18,
13,
13,
13,
4,
18,
13,
4,
18,
13,
4,
18,
13,
4,
18,
13,
23,
13,
6,
13,
41,
13,
41,
13,
41,
13,
12,
13,
30,
0,
13,
13,
0,
13,
13,
0,
13,
20,
2,
13,
17,
2,
13,
17,
23,
13,
23,
13,
12,
13,
30,
0,
18,
18,
13,
13,
13,
13,
23,
13,
23,
13,
23,
13,
12,
13,
30,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
0,
13,
18,
18,
13,
13,
13,
0,
18,
18,
13,
13,
13,
13,
12,
13,
30,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
0,
13,
18,
18,
13,
13,
13,
0,
18,
18,
13,
13,
13,
13,
12,
13,
30,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
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,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
263,
8
],
[
263,
9
],
[
9,
10
],
[
9,
11
],
[
11,
12
],
[
12,
13
],
[
12,
14
],
[
11,
15
],
[
15,
16
],
[
11,
17
],
[
17,
18
],
[
11,
19
],
[
19,
20
],
[
19,
21
],
[
11,
22
],
[
22,
23
],
[
23,
24
],
[
24,
25
],
[
24,
26
],
[
22,
27
],
[
27,
28
],
[
27,
29
],
[
22,
30
],
[
30,
31
],
[
31,
32
],
[
22,
33
],
[
33,
34
],
[
34,
35
],
[
35,
36
],
[
36,
37
],
[
36,
38
],
[
34,
39
],
[
39,
40
],
[
39,
41
],
[
34,
42
],
[
42,
43
],
[
43,
44
],
[
34,
45
],
[
45,
46
],
[
46,
47
],
[
47,
48
],
[
46,
49
],
[
46,
50
],
[
46,
51
],
[
51,
52
],
[
52,
53
],
[
11,
54
],
[
54,
55
],
[
55,
56
],
[
11,
57
],
[
57,
58
],
[
58,
59
],
[
11,
60
],
[
60,
61
],
[
61,
62
],
[
9,
63
],
[
63,
64
],
[
0,
65
],
[
65,
66
],
[
65,
67
],
[
67,
68
],
[
65,
69
],
[
69,
70
],
[
65,
71
],
[
71,
72
],
[
65,
73
],
[
73,
74
],
[
73,
75
],
[
75,
76
],
[
76,
77
],
[
76,
78
],
[
75,
79
],
[
79,
80
],
[
79,
81
],
[
75,
82
],
[
82,
83
],
[
82,
84
],
[
85,
86
],
[
85,
87
],
[
88,
89
],
[
88,
90
],
[
73,
91
],
[
91,
92
],
[
73,
93
],
[
93,
94
],
[
65,
95
],
[
95,
96
],
[
95,
97
],
[
97,
98
],
[
98,
99
],
[
99,
100
],
[
100,
101
],
[
100,
102
],
[
99,
103
],
[
98,
104
],
[
95,
105
],
[
105,
106
],
[
95,
107
],
[
107,
108
],
[
95,
109
],
[
109,
110
],
[
65,
111
],
[
111,
112
],
[
111,
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
],
[
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
],
[
141,
142
],
[
142,
143
],
[
142,
144
],
[
144,
145
],
[
145,
146
],
[
145,
147
],
[
144,
148
],
[
126,
149
],
[
149,
150
],
[
150,
151
],
[
151,
152
],
[
151,
153
],
[
150,
154
],
[
149,
155
],
[
65,
156
],
[
156,
157
],
[
156,
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
],
[
172,
174
],
[
171,
175
],
[
175,
176
],
[
176,
177
],
[
177,
178
],
[
177,
179
],
[
175,
180
],
[
180,
181
],
[
180,
182
],
[
175,
183
],
[
183,
184
],
[
184,
185
],
[
175,
186
],
[
186,
187
],
[
187,
188
],
[
187,
189
],
[
189,
190
],
[
190,
191
],
[
190,
192
],
[
189,
193
],
[
171,
194
],
[
194,
195
],
[
195,
196
],
[
196,
197
],
[
196,
198
],
[
195,
199
],
[
194,
200
],
[
65,
201
],
[
201,
202
],
[
201,
203
],
[
203,
204
],
[
204,
205
],
[
205,
206
],
[
206,
207
],
[
206,
208
],
[
204,
209
],
[
209,
210
],
[
209,
211
],
[
204,
212
],
[
212,
213
],
[
213,
214
],
[
204,
215
],
[
216,
216
],
[
216,
217
],
[
217,
218
],
[
218,
219
],
[
219,
220
],
[
219,
221
],
[
217,
222
],
[
222,
223
],
[
222,
224
],
[
217,
225
],
[
225,
226
],
[
226,
227
],
[
217,
228
],
[
229,
229
],
[
229,
230
],
[
230,
231
],
[
231,
232
],
[
231,
233
],
[
230,
234
],
[
234,
235
],
[
235,
236
],
[
236,
237
],
[
236,
238
],
[
234,
239
],
[
234,
240
],
[
240,
241
],
[
241,
242
],
[
241,
243
],
[
240,
244
],
[
230,
245
],
[
245,
246
],
[
246,
247
],
[
247,
248
],
[
247,
249
],
[
245,
250
],
[
245,
251
],
[
251,
252
],
[
252,
253
],
[
252,
254
],
[
251,
255
],
[
216,
256
],
[
256,
257
],
[
257,
258
],
[
258,
259
],
[
258,
260
],
[
256,
261
],
[
0,
262
],
[
262,
263
],
[
262,
264
]
] | [
"import java.*;\nimport java.util.*;\n\npublic class Main{\npublic static void main(String args[]){\n\tScanner scan = new Scanner(System.in);\n\tint nrow, ncol;\n\tspreadsheet sp=new spreadsheet(nrow=scan.nextInt(),ncol=scan.nextInt());\n\tfor(int i=0;i<nrow;i++)\n\t\tfor(int j=0;j<ncol;j++)\n\t\t\tsp.load(i,j,scan.nextInt());\n\tsp.rowSum();\n\tsp.colSum();\n\tsp.show();\n\t}\n}\nclass spreadsheet{\n\tint nrow;\n\tint ncol;\n\tint[][] cells;\n\tpublic spreadsheet(int r, int c){\n\t\tnrow=r;\n\t\tncol=c;\n\t\tcells = new int[nrow+1][ncol+1];\n\t}\n\tpublic void load(int i, int j, int n){\n\t\tcells[i][j]=n;\n\t}\n\tpublic void rowSum(){\n\t\tfor(int i=0; i< nrow; i++){\n\t\t\tint sum=0;\n\t\t\tfor(int j=0;j<ncol;j++)\n\t\t\t\tsum+=cells[i][j];\n\t\t\tcells[i][ncol]=sum;\n\t\t}\n\t}\n\tpublic void colSum(){\n\t\tfor(int j=0; j<= ncol; j++){\n\t\t\tint sum=0;\n\t\t\tfor(int i=0;i<nrow;i++)\n\t\t\t\tsum+=cells[i][j];\n\t\t\tcells[nrow][j]=sum;\n\t\t}\n\t}\n\tpublic void show(){\n\t\tfor(int i=0; i<= nrow; i++){\n\t\t\tfor(int j=0;j<=ncol;j++){\n\t\t\t\tif(j==0)\n\t\t\t\tSystem.out.printf(\"%d\",cells[i][j]);\n\t\t\t\telse\n\t\t\t\tSystem.out.printf(\" %d\",cells[i][j]);\n\t\t\t}\n\t\t\tSystem.out.printf(\"\\n\");\n\t\t}\n\t}\n}",
"import java.*;",
"java.*",
"import java.*;",
"import java.util.*;",
"util.*",
"java",
"public class Main{\npublic static void main(String args[]){\n\tScanner scan = new Scanner(System.in);\n\tint nrow, ncol;\n\tspreadsheet sp=new spreadsheet(nrow=scan.nextInt(),ncol=scan.nextInt());\n\tfor(int i=0;i<nrow;i++)\n\t\tfor(int j=0;j<ncol;j++)\n\t\t\tsp.load(i,j,scan.nextInt());\n\tsp.rowSum();\n\tsp.colSum();\n\tsp.show();\n\t}\n}",
"Main",
"public static void main(String args[]){\n\tScanner scan = new Scanner(System.in);\n\tint nrow, ncol;\n\tspreadsheet sp=new spreadsheet(nrow=scan.nextInt(),ncol=scan.nextInt());\n\tfor(int i=0;i<nrow;i++)\n\t\tfor(int j=0;j<ncol;j++)\n\t\t\tsp.load(i,j,scan.nextInt());\n\tsp.rowSum();\n\tsp.colSum();\n\tsp.show();\n\t}",
"main",
"{\n\tScanner scan = new Scanner(System.in);\n\tint nrow, ncol;\n\tspreadsheet sp=new spreadsheet(nrow=scan.nextInt(),ncol=scan.nextInt());\n\tfor(int i=0;i<nrow;i++)\n\t\tfor(int j=0;j<ncol;j++)\n\t\t\tsp.load(i,j,scan.nextInt());\n\tsp.rowSum();\n\tsp.colSum();\n\tsp.show();\n\t}",
"Scanner scan = new Scanner(System.in);",
"scan",
"new Scanner(System.in)",
"int nrow",
"nrow",
"ncol;",
"ncol",
"spreadsheet sp=new spreadsheet(nrow=scan.nextInt(),ncol=scan.nextInt());",
"sp",
"new spreadsheet(nrow=scan.nextInt(),ncol=scan.nextInt())",
"for(int i=0;i<nrow;i++)\n\t\tfor(int j=0;j<ncol;j++)\n\t\t\tsp.load(i,j,scan.nextInt());",
"int i=0;",
"int i=0;",
"i",
"0",
"i<nrow",
"i",
"nrow",
"i++",
"i++",
"i",
"for(int j=0;j<ncol;j++)\n\t\t\tsp.load(i,j,scan.nextInt());",
"for(int j=0;j<ncol;j++)\n\t\t\tsp.load(i,j,scan.nextInt());",
"int j=0;",
"int j=0;",
"j",
"0",
"j<ncol",
"j",
"ncol",
"j++",
"j++",
"j",
"sp.load(i,j,scan.nextInt());",
"sp.load(i,j,scan.nextInt())",
"sp.load",
"sp",
"i",
"j",
"scan.nextInt()",
"scan.nextInt",
"scan",
"sp.rowSum()",
"sp.rowSum",
"sp",
"sp.colSum()",
"sp.colSum",
"sp",
"sp.show()",
"sp.show",
"sp",
"String args[]",
"args",
"class spreadsheet{\n\tint nrow;\n\tint ncol;\n\tint[][] cells;\n\tpublic spreadsheet(int r, int c){\n\t\tnrow=r;\n\t\tncol=c;\n\t\tcells = new int[nrow+1][ncol+1];\n\t}\n\tpublic void load(int i, int j, int n){\n\t\tcells[i][j]=n;\n\t}\n\tpublic void rowSum(){\n\t\tfor(int i=0; i< nrow; i++){\n\t\t\tint sum=0;\n\t\t\tfor(int j=0;j<ncol;j++)\n\t\t\t\tsum+=cells[i][j];\n\t\t\tcells[i][ncol]=sum;\n\t\t}\n\t}\n\tpublic void colSum(){\n\t\tfor(int j=0; j<= ncol; j++){\n\t\t\tint sum=0;\n\t\t\tfor(int i=0;i<nrow;i++)\n\t\t\t\tsum+=cells[i][j];\n\t\t\tcells[nrow][j]=sum;\n\t\t}\n\t}\n\tpublic void show(){\n\t\tfor(int i=0; i<= nrow; i++){\n\t\t\tfor(int j=0;j<=ncol;j++){\n\t\t\t\tif(j==0)\n\t\t\t\tSystem.out.printf(\"%d\",cells[i][j]);\n\t\t\t\telse\n\t\t\t\tSystem.out.printf(\" %d\",cells[i][j]);\n\t\t\t}\n\t\t\tSystem.out.printf(\"\\n\");\n\t\t}\n\t}\n}",
"spreadsheet",
"int nrow;",
"nrow",
"int ncol;",
"ncol",
"int[][] cells;",
"cells",
"public spreadsheet(int r, int c){\n\t\tnrow=r;\n\t\tncol=c;\n\t\tcells = new int[nrow+1][ncol+1];\n\t}",
"spreadsheet",
"{\n\t\tnrow=r;\n\t\tncol=c;\n\t\tcells = new int[nrow+1][ncol+1];\n\t}",
"nrow=r",
"nrow",
"r",
"ncol=c",
"ncol",
"c",
"cells = new int[nrow+1][ncol+1]",
"cells",
"new int[nrow+1][ncol+1]",
"nrow+1",
"nrow",
"1",
"ncol+1",
"ncol",
"1",
"int r",
"r",
"int c",
"c",
"public void load(int i, int j, int n){\n\t\tcells[i][j]=n;\n\t}",
"load",
"{\n\t\tcells[i][j]=n;\n\t}",
"cells[i][j]=n",
"cells[i][j]",
"cells[i]",
"cells",
"i",
"j",
"n",
"int i",
"i",
"int j",
"j",
"int n",
"n",
"public void rowSum(){\n\t\tfor(int i=0; i< nrow; i++){\n\t\t\tint sum=0;\n\t\t\tfor(int j=0;j<ncol;j++)\n\t\t\t\tsum+=cells[i][j];\n\t\t\tcells[i][ncol]=sum;\n\t\t}\n\t}",
"rowSum",
"{\n\t\tfor(int i=0; i< nrow; i++){\n\t\t\tint sum=0;\n\t\t\tfor(int j=0;j<ncol;j++)\n\t\t\t\tsum+=cells[i][j];\n\t\t\tcells[i][ncol]=sum;\n\t\t}\n\t}",
"for(int i=0; i< nrow; i++){\n\t\t\tint sum=0;\n\t\t\tfor(int j=0;j<ncol;j++)\n\t\t\t\tsum+=cells[i][j];\n\t\t\tcells[i][ncol]=sum;\n\t\t}",
"int i=0;",
"int i=0;",
"i",
"0",
"i< nrow",
"i",
"nrow",
"i++",
"i++",
"i",
"{\n\t\t\tint sum=0;\n\t\t\tfor(int j=0;j<ncol;j++)\n\t\t\t\tsum+=cells[i][j];\n\t\t\tcells[i][ncol]=sum;\n\t\t}",
"{\n\t\t\tint sum=0;\n\t\t\tfor(int j=0;j<ncol;j++)\n\t\t\t\tsum+=cells[i][j];\n\t\t\tcells[i][ncol]=sum;\n\t\t}",
"int sum=0;",
"sum",
"0",
"for(int j=0;j<ncol;j++)\n\t\t\t\tsum+=cells[i][j];",
"int j=0;",
"int j=0;",
"j",
"0",
"j<ncol",
"j",
"ncol",
"j++",
"j++",
"j",
"sum+=cells[i][j];",
"sum+=cells[i][j]",
"sum",
"cells[i][j]",
"cells[i]",
"cells",
"i",
"j",
"cells[i][ncol]=sum",
"cells[i][ncol]",
"cells[i]",
"cells",
"i",
"ncol",
"sum",
"public void colSum(){\n\t\tfor(int j=0; j<= ncol; j++){\n\t\t\tint sum=0;\n\t\t\tfor(int i=0;i<nrow;i++)\n\t\t\t\tsum+=cells[i][j];\n\t\t\tcells[nrow][j]=sum;\n\t\t}\n\t}",
"colSum",
"{\n\t\tfor(int j=0; j<= ncol; j++){\n\t\t\tint sum=0;\n\t\t\tfor(int i=0;i<nrow;i++)\n\t\t\t\tsum+=cells[i][j];\n\t\t\tcells[nrow][j]=sum;\n\t\t}\n\t}",
"for(int j=0; j<= ncol; j++){\n\t\t\tint sum=0;\n\t\t\tfor(int i=0;i<nrow;i++)\n\t\t\t\tsum+=cells[i][j];\n\t\t\tcells[nrow][j]=sum;\n\t\t}",
"int j=0;",
"int j=0;",
"j",
"0",
"j<= ncol",
"j",
"ncol",
"j++",
"j++",
"j",
"{\n\t\t\tint sum=0;\n\t\t\tfor(int i=0;i<nrow;i++)\n\t\t\t\tsum+=cells[i][j];\n\t\t\tcells[nrow][j]=sum;\n\t\t}",
"{\n\t\t\tint sum=0;\n\t\t\tfor(int i=0;i<nrow;i++)\n\t\t\t\tsum+=cells[i][j];\n\t\t\tcells[nrow][j]=sum;\n\t\t}",
"int sum=0;",
"sum",
"0",
"for(int i=0;i<nrow;i++)\n\t\t\t\tsum+=cells[i][j];",
"int i=0;",
"int i=0;",
"i",
"0",
"i<nrow",
"i",
"nrow",
"i++",
"i++",
"i",
"sum+=cells[i][j];",
"sum+=cells[i][j]",
"sum",
"cells[i][j]",
"cells[i]",
"cells",
"i",
"j",
"cells[nrow][j]=sum",
"cells[nrow][j]",
"cells[nrow]",
"cells",
"nrow",
"j",
"sum",
"public void show(){\n\t\tfor(int i=0; i<= nrow; i++){\n\t\t\tfor(int j=0;j<=ncol;j++){\n\t\t\t\tif(j==0)\n\t\t\t\tSystem.out.printf(\"%d\",cells[i][j]);\n\t\t\t\telse\n\t\t\t\tSystem.out.printf(\" %d\",cells[i][j]);\n\t\t\t}\n\t\t\tSystem.out.printf(\"\\n\");\n\t\t}\n\t}",
"show",
"{\n\t\tfor(int i=0; i<= nrow; i++){\n\t\t\tfor(int j=0;j<=ncol;j++){\n\t\t\t\tif(j==0)\n\t\t\t\tSystem.out.printf(\"%d\",cells[i][j]);\n\t\t\t\telse\n\t\t\t\tSystem.out.printf(\" %d\",cells[i][j]);\n\t\t\t}\n\t\t\tSystem.out.printf(\"\\n\");\n\t\t}\n\t}",
"for(int i=0; i<= nrow; i++){\n\t\t\tfor(int j=0;j<=ncol;j++){\n\t\t\t\tif(j==0)\n\t\t\t\tSystem.out.printf(\"%d\",cells[i][j]);\n\t\t\t\telse\n\t\t\t\tSystem.out.printf(\" %d\",cells[i][j]);\n\t\t\t}\n\t\t\tSystem.out.printf(\"\\n\");\n\t\t}",
"int i=0;",
"int i=0;",
"i",
"0",
"i<= nrow",
"i",
"nrow",
"i++",
"i++",
"i",
"{\n\t\t\tfor(int j=0;j<=ncol;j++){\n\t\t\t\tif(j==0)\n\t\t\t\tSystem.out.printf(\"%d\",cells[i][j]);\n\t\t\t\telse\n\t\t\t\tSystem.out.printf(\" %d\",cells[i][j]);\n\t\t\t}\n\t\t\tSystem.out.printf(\"\\n\");\n\t\t}",
"{\n\t\t\tfor(int j=0;j<=ncol;j++){\n\t\t\t\tif(j==0)\n\t\t\t\tSystem.out.printf(\"%d\",cells[i][j]);\n\t\t\t\telse\n\t\t\t\tSystem.out.printf(\" %d\",cells[i][j]);\n\t\t\t}\n\t\t\tSystem.out.printf(\"\\n\");\n\t\t}",
"for(int j=0;j<=ncol;j++){\n\t\t\t\tif(j==0)\n\t\t\t\tSystem.out.printf(\"%d\",cells[i][j]);\n\t\t\t\telse\n\t\t\t\tSystem.out.printf(\" %d\",cells[i][j]);\n\t\t\t}",
"int j=0;",
"int j=0;",
"j",
"0",
"j<=ncol",
"j",
"ncol",
"j++",
"j++",
"j",
"{\n\t\t\t\tif(j==0)\n\t\t\t\tSystem.out.printf(\"%d\",cells[i][j]);\n\t\t\t\telse\n\t\t\t\tSystem.out.printf(\" %d\",cells[i][j]);\n\t\t\t}",
"{\n\t\t\t\tif(j==0)\n\t\t\t\tSystem.out.printf(\"%d\",cells[i][j]);\n\t\t\t\telse\n\t\t\t\tSystem.out.printf(\" %d\",cells[i][j]);\n\t\t\t}",
"if(j==0)\n\t\t\t\tSystem.out.printf(\"%d\",cells[i][j]);\n\t\t\t\telse\n\t\t\t\tSystem.out.printf(\" %d\",cells[i][j]);",
"j==0",
"j",
"0",
"System.out.printf(\"%d\",cells[i][j])",
"System.out.printf",
"System.out",
"System",
"System.out",
"\"%d\"",
"cells[i][j]",
"cells[i]",
"cells",
"i",
"j",
"System.out.printf(\" %d\",cells[i][j])",
"System.out.printf",
"System.out",
"System",
"System.out",
"\" %d\"",
"cells[i][j]",
"cells[i]",
"cells",
"i",
"j",
"System.out.printf(\"\\n\")",
"System.out.printf",
"System.out",
"System",
"System.out",
"\"\\n\"",
"public class Main{\npublic static void main(String args[]){\n\tScanner scan = new Scanner(System.in);\n\tint nrow, ncol;\n\tspreadsheet sp=new spreadsheet(nrow=scan.nextInt(),ncol=scan.nextInt());\n\tfor(int i=0;i<nrow;i++)\n\t\tfor(int j=0;j<ncol;j++)\n\t\t\tsp.load(i,j,scan.nextInt());\n\tsp.rowSum();\n\tsp.colSum();\n\tsp.show();\n\t}\n}",
"public class Main{\npublic static void main(String args[]){\n\tScanner scan = new Scanner(System.in);\n\tint nrow, ncol;\n\tspreadsheet sp=new spreadsheet(nrow=scan.nextInt(),ncol=scan.nextInt());\n\tfor(int i=0;i<nrow;i++)\n\t\tfor(int j=0;j<ncol;j++)\n\t\t\tsp.load(i,j,scan.nextInt());\n\tsp.rowSum();\n\tsp.colSum();\n\tsp.show();\n\t}\n}",
"Main"
] | import java.*;
import java.util.*;
public class Main{
public static void main(String args[]){
Scanner scan = new Scanner(System.in);
int nrow, ncol;
spreadsheet sp=new spreadsheet(nrow=scan.nextInt(),ncol=scan.nextInt());
for(int i=0;i<nrow;i++)
for(int j=0;j<ncol;j++)
sp.load(i,j,scan.nextInt());
sp.rowSum();
sp.colSum();
sp.show();
}
}
class spreadsheet{
int nrow;
int ncol;
int[][] cells;
public spreadsheet(int r, int c){
nrow=r;
ncol=c;
cells = new int[nrow+1][ncol+1];
}
public void load(int i, int j, int n){
cells[i][j]=n;
}
public void rowSum(){
for(int i=0; i< nrow; i++){
int sum=0;
for(int j=0;j<ncol;j++)
sum+=cells[i][j];
cells[i][ncol]=sum;
}
}
public void colSum(){
for(int j=0; j<= ncol; j++){
int sum=0;
for(int i=0;i<nrow;i++)
sum+=cells[i][j];
cells[nrow][j]=sum;
}
}
public void show(){
for(int i=0; i<= nrow; i++){
for(int j=0;j<=ncol;j++){
if(j==0)
System.out.printf("%d",cells[i][j]);
else
System.out.printf(" %d",cells[i][j]);
}
System.out.printf("\n");
}
}
} |
[
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,
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,
18,
18,
13,
13,
13,
4,
18,
13,
18,
13,
13,
0,
13,
2,
13,
18,
18,
13,
13,
13,
0,
18,
18,
13,
13,
13,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
2,
13,
18,
18,
13,
13,
13,
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,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
213,
8
],
[
213,
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
],
[
69,
71
],
[
60,
72
],
[
72,
73
],
[
73,
74
],
[
74,
75
],
[
74,
76
],
[
72,
77
],
[
77,
78
],
[
77,
79
],
[
72,
80
],
[
80,
81
],
[
81,
82
],
[
72,
83
],
[
84,
84
],
[
84,
85
],
[
85,
86
],
[
86,
87
],
[
87,
88
],
[
87,
89
],
[
86,
90
],
[
85,
91
],
[
91,
92
],
[
92,
93
],
[
91,
94
],
[
94,
95
],
[
94,
96
],
[
84,
97
],
[
97,
98
],
[
97,
99
],
[
99,
100
],
[
99,
101
],
[
101,
102
],
[
102,
103
],
[
102,
104
],
[
101,
105
],
[
60,
106
],
[
106,
107
],
[
107,
108
],
[
108,
109
],
[
108,
110
],
[
107,
111
],
[
106,
112
],
[
11,
113
],
[
113,
114
],
[
114,
115
],
[
115,
116
],
[
115,
117
],
[
113,
118
],
[
118,
119
],
[
118,
120
],
[
113,
121
],
[
121,
122
],
[
122,
123
],
[
113,
124
],
[
125,
125
],
[
125,
126
],
[
126,
127
],
[
126,
128
],
[
125,
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
],
[
142,
144
],
[
144,
145
],
[
144,
146
],
[
146,
147
],
[
147,
148
],
[
147,
149
],
[
146,
150
],
[
125,
151
],
[
151,
152
],
[
152,
153
],
[
153,
154
],
[
153,
155
],
[
152,
156
],
[
151,
157
],
[
11,
158
],
[
158,
159
],
[
159,
160
],
[
160,
161
],
[
160,
162
],
[
158,
163
],
[
163,
164
],
[
163,
165
],
[
158,
166
],
[
166,
167
],
[
167,
168
],
[
158,
169
],
[
170,
170
],
[
170,
171
],
[
171,
172
],
[
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
],
[
183,
194
],
[
194,
195
],
[
195,
196
],
[
195,
197
],
[
194,
198
],
[
198,
199
],
[
199,
200
],
[
200,
201
],
[
201,
202
],
[
201,
203
],
[
199,
204
],
[
170,
205
],
[
205,
206
],
[
206,
207
],
[
207,
208
],
[
207,
209
],
[
9,
210
],
[
210,
211
],
[
0,
212
],
[
212,
213
],
[
212,
214
]
] | [
"import java.io.BufferedReader;\nimport java.io.InputStreamReader;\n\npublic class Main {\n\tpublic static void main (String[] args) throws java.lang.Exception\n\t{\n\t\tBufferedReader input = new BufferedReader (new InputStreamReader (System.in));\n\t\t\n\t\tString[] matrixStr = input.readLine().split(\" \");\n\t\t\n\t\tint row = Integer.parseInt(matrixStr[0]);\n\t\t\n\t\tint column = Integer.parseInt(matrixStr[1]);\n\t\t\n\t\tint[][] spreadsheet = new int[row + 1][column +1];\n\t\t\n\t\tfor(int rowNum = 0; rowNum < row; rowNum++)\n\t\t{\n\t\t\tString[] rowStr = input.readLine().split(\" \");\n\t\t\t\n\t\t\tint rowSum = 0;\n\t\t\t\n\t\t\tfor(int columnNum = 0; columnNum < column; columnNum++)\n\t\t\t{\n\t\t\t\tspreadsheet[rowNum][columnNum] = Integer.parseInt(rowStr[columnNum]);\n\t\t\t\t\n\t\t\t\trowSum = rowSum + spreadsheet[rowNum][columnNum];\n\t\t\t}\n\t\t\t\n\t\t\tspreadsheet[rowNum][column] = rowSum;\n\t\t}\n\t\t\n\t\tfor(int columnNum = 0; columnNum <= column; columnNum++)\n\t\t{\n\t\t\tint columnSum = 0;\n\t\t\t\n\t\t\tfor(int rowNum = 0; rowNum < row; rowNum++)\n\t\t\t{\n\t\t\t\tcolumnSum = columnSum + spreadsheet[rowNum][columnNum];\n\t\t\t}\n\t\t\t\n\t\t\tspreadsheet[row][columnNum] = columnSum;\n\t\t}\n\t\t\n\t\tfor(int rowNum = 0; rowNum <= row; rowNum++)\n\t\t{\n\t\t\tfor(int columnNum = 0; columnNum <= column; columnNum++)\n\t\t\t{\n\t\t\t\tSystem.out.print(spreadsheet[rowNum][columnNum]);\n\t\t\t\t\n\t\t\t\tif(columnNum != column)\n\t\t\t\t{\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}\n",
"import java.io.BufferedReader;",
"BufferedReader",
"java.io",
"import java.io.InputStreamReader;",
"InputStreamReader",
"java.io",
"public class Main {\n\tpublic static void main (String[] args) throws java.lang.Exception\n\t{\n\t\tBufferedReader input = new BufferedReader (new InputStreamReader (System.in));\n\t\t\n\t\tString[] matrixStr = input.readLine().split(\" \");\n\t\t\n\t\tint row = Integer.parseInt(matrixStr[0]);\n\t\t\n\t\tint column = Integer.parseInt(matrixStr[1]);\n\t\t\n\t\tint[][] spreadsheet = new int[row + 1][column +1];\n\t\t\n\t\tfor(int rowNum = 0; rowNum < row; rowNum++)\n\t\t{\n\t\t\tString[] rowStr = input.readLine().split(\" \");\n\t\t\t\n\t\t\tint rowSum = 0;\n\t\t\t\n\t\t\tfor(int columnNum = 0; columnNum < column; columnNum++)\n\t\t\t{\n\t\t\t\tspreadsheet[rowNum][columnNum] = Integer.parseInt(rowStr[columnNum]);\n\t\t\t\t\n\t\t\t\trowSum = rowSum + spreadsheet[rowNum][columnNum];\n\t\t\t}\n\t\t\t\n\t\t\tspreadsheet[rowNum][column] = rowSum;\n\t\t}\n\t\t\n\t\tfor(int columnNum = 0; columnNum <= column; columnNum++)\n\t\t{\n\t\t\tint columnSum = 0;\n\t\t\t\n\t\t\tfor(int rowNum = 0; rowNum < row; rowNum++)\n\t\t\t{\n\t\t\t\tcolumnSum = columnSum + spreadsheet[rowNum][columnNum];\n\t\t\t}\n\t\t\t\n\t\t\tspreadsheet[row][columnNum] = columnSum;\n\t\t}\n\t\t\n\t\tfor(int rowNum = 0; rowNum <= row; rowNum++)\n\t\t{\n\t\t\tfor(int columnNum = 0; columnNum <= column; columnNum++)\n\t\t\t{\n\t\t\t\tSystem.out.print(spreadsheet[rowNum][columnNum]);\n\t\t\t\t\n\t\t\t\tif(columnNum != column)\n\t\t\t\t{\n\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t}\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}\n\t}\n}",
"Main",
"public static void main (String[] args) throws java.lang.Exception\n\t{\n\t\tBufferedReader input = new BufferedReader (new InputStreamReader (System.in));\n\t\t\n\t\tString[] matrixStr = input.readLine().split(\" \");\n\t\t\n\t\tint row = Integer.parseInt(matrixStr[0]);\n\t\t\n\t\tint column = Integer.parseInt(matrixStr[1]);\n\t\t\n\t\tint[][] spreadsheet = new int[row + 1][column +1];\n\t\t\n\t\tfor(int rowNum = 0; rowNum < row; rowNum++)\n\t\t{\n\t\t\tString[] rowStr = input.readLine().split(\" \");\n\t\t\t\n\t\t\tint rowSum = 0;\n\t\t\t\n\t\t\tfor(int columnNum = 0; columnNum < column; columnNum++)\n\t\t\t{\n\t\t\t\tspreadsheet[rowNum][columnNum] = Integer.parseInt(rowStr[columnNum]);\n\t\t\t\t\n\t\t\t\trowSum = rowSum + spreadsheet[rowNum][columnNum];\n\t\t\t}\n\t\t\t\n\t\t\tspreadsheet[rowNum][column] = rowSum;\n\t\t}\n\t\t\n\t\tfor(int columnNum = 0; columnNum <= column; columnNum++)\n\t\t{\n\t\t\tint columnSum = 0;\n\t\t\t\n\t\t\tfor(int rowNum = 0; rowNum < row; rowNum++)\n\t\t\t{\n\t\t\t\tcolumnSum = columnSum + spreadsheet[rowNum][columnNum];\n\t\t\t}\n\t\t\t\n\t\t\tspreadsheet[row][columnNum] = columnSum;\n\t\t}\n\t\t\n\t\tfor(int rowNum = 0; rowNum <= row; rowNum++)\n\t\t{\n\t\t\tfor(int columnNum = 0; columnNum <= column; columnNum++)\n\t\t\t{\n\t\t\t\tSystem.out.print(spreadsheet[rowNum][columnNum]);\n\t\t\t\t\n\t\t\t\tif(columnNum != column)\n\t\t\t\t{\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\tBufferedReader input = new BufferedReader (new InputStreamReader (System.in));\n\t\t\n\t\tString[] matrixStr = input.readLine().split(\" \");\n\t\t\n\t\tint row = Integer.parseInt(matrixStr[0]);\n\t\t\n\t\tint column = Integer.parseInt(matrixStr[1]);\n\t\t\n\t\tint[][] spreadsheet = new int[row + 1][column +1];\n\t\t\n\t\tfor(int rowNum = 0; rowNum < row; rowNum++)\n\t\t{\n\t\t\tString[] rowStr = input.readLine().split(\" \");\n\t\t\t\n\t\t\tint rowSum = 0;\n\t\t\t\n\t\t\tfor(int columnNum = 0; columnNum < column; columnNum++)\n\t\t\t{\n\t\t\t\tspreadsheet[rowNum][columnNum] = Integer.parseInt(rowStr[columnNum]);\n\t\t\t\t\n\t\t\t\trowSum = rowSum + spreadsheet[rowNum][columnNum];\n\t\t\t}\n\t\t\t\n\t\t\tspreadsheet[rowNum][column] = rowSum;\n\t\t}\n\t\t\n\t\tfor(int columnNum = 0; columnNum <= column; columnNum++)\n\t\t{\n\t\t\tint columnSum = 0;\n\t\t\t\n\t\t\tfor(int rowNum = 0; rowNum < row; rowNum++)\n\t\t\t{\n\t\t\t\tcolumnSum = columnSum + spreadsheet[rowNum][columnNum];\n\t\t\t}\n\t\t\t\n\t\t\tspreadsheet[row][columnNum] = columnSum;\n\t\t}\n\t\t\n\t\tfor(int rowNum = 0; rowNum <= row; rowNum++)\n\t\t{\n\t\t\tfor(int columnNum = 0; columnNum <= column; columnNum++)\n\t\t\t{\n\t\t\t\tSystem.out.print(spreadsheet[rowNum][columnNum]);\n\t\t\t\t\n\t\t\t\tif(columnNum != column)\n\t\t\t\t{\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}",
"BufferedReader input = new BufferedReader (new InputStreamReader (System.in));",
"input",
"new BufferedReader (new InputStreamReader (System.in))",
"String[] matrixStr = input.readLine().split(\" \");",
"matrixStr",
"input.readLine().split(\" \")",
"input.readLine().split",
"input.readLine()",
"input.readLine",
"input",
"\" \"",
"int row = Integer.parseInt(matrixStr[0]);",
"row",
"Integer.parseInt(matrixStr[0])",
"Integer.parseInt",
"Integer",
"matrixStr[0]",
"matrixStr",
"0",
"int column = Integer.parseInt(matrixStr[1]);",
"column",
"Integer.parseInt(matrixStr[1])",
"Integer.parseInt",
"Integer",
"matrixStr[1]",
"matrixStr",
"1",
"int[][] spreadsheet = new int[row + 1][column +1];",
"spreadsheet",
"new int[row + 1][column +1]",
"row + 1",
"row",
"1",
"column +1",
"column",
"1",
"for(int rowNum = 0; rowNum < row; rowNum++)\n\t\t{\n\t\t\tString[] rowStr = input.readLine().split(\" \");\n\t\t\t\n\t\t\tint rowSum = 0;\n\t\t\t\n\t\t\tfor(int columnNum = 0; columnNum < column; columnNum++)\n\t\t\t{\n\t\t\t\tspreadsheet[rowNum][columnNum] = Integer.parseInt(rowStr[columnNum]);\n\t\t\t\t\n\t\t\t\trowSum = rowSum + spreadsheet[rowNum][columnNum];\n\t\t\t}\n\t\t\t\n\t\t\tspreadsheet[rowNum][column] = rowSum;\n\t\t}",
"int rowNum = 0;",
"int rowNum = 0;",
"rowNum",
"0",
"rowNum < row",
"rowNum",
"row",
"rowNum++",
"rowNum++",
"rowNum",
"{\n\t\t\tString[] rowStr = input.readLine().split(\" \");\n\t\t\t\n\t\t\tint rowSum = 0;\n\t\t\t\n\t\t\tfor(int columnNum = 0; columnNum < column; columnNum++)\n\t\t\t{\n\t\t\t\tspreadsheet[rowNum][columnNum] = Integer.parseInt(rowStr[columnNum]);\n\t\t\t\t\n\t\t\t\trowSum = rowSum + spreadsheet[rowNum][columnNum];\n\t\t\t}\n\t\t\t\n\t\t\tspreadsheet[rowNum][column] = rowSum;\n\t\t}",
"{\n\t\t\tString[] rowStr = input.readLine().split(\" \");\n\t\t\t\n\t\t\tint rowSum = 0;\n\t\t\t\n\t\t\tfor(int columnNum = 0; columnNum < column; columnNum++)\n\t\t\t{\n\t\t\t\tspreadsheet[rowNum][columnNum] = Integer.parseInt(rowStr[columnNum]);\n\t\t\t\t\n\t\t\t\trowSum = rowSum + spreadsheet[rowNum][columnNum];\n\t\t\t}\n\t\t\t\n\t\t\tspreadsheet[rowNum][column] = rowSum;\n\t\t}",
"String[] rowStr = input.readLine().split(\" \");",
"rowStr",
"input.readLine().split(\" \")",
"input.readLine().split",
"input.readLine()",
"input.readLine",
"input",
"\" \"",
"int rowSum = 0;",
"rowSum",
"0",
"for(int columnNum = 0; columnNum < column; columnNum++)\n\t\t\t{\n\t\t\t\tspreadsheet[rowNum][columnNum] = Integer.parseInt(rowStr[columnNum]);\n\t\t\t\t\n\t\t\t\trowSum = rowSum + spreadsheet[rowNum][columnNum];\n\t\t\t}",
"int columnNum = 0;",
"int columnNum = 0;",
"columnNum",
"0",
"columnNum < column",
"columnNum",
"column",
"columnNum++",
"columnNum++",
"columnNum",
"{\n\t\t\t\tspreadsheet[rowNum][columnNum] = Integer.parseInt(rowStr[columnNum]);\n\t\t\t\t\n\t\t\t\trowSum = rowSum + spreadsheet[rowNum][columnNum];\n\t\t\t}",
"{\n\t\t\t\tspreadsheet[rowNum][columnNum] = Integer.parseInt(rowStr[columnNum]);\n\t\t\t\t\n\t\t\t\trowSum = rowSum + spreadsheet[rowNum][columnNum];\n\t\t\t}",
"spreadsheet[rowNum][columnNum] = Integer.parseInt(rowStr[columnNum])",
"spreadsheet[rowNum][columnNum]",
"spreadsheet[rowNum]",
"spreadsheet",
"rowNum",
"columnNum",
"Integer.parseInt(rowStr[columnNum])",
"Integer.parseInt",
"Integer",
"rowStr[columnNum]",
"rowStr",
"columnNum",
"rowSum = rowSum + spreadsheet[rowNum][columnNum]",
"rowSum",
"rowSum + spreadsheet[rowNum][columnNum]",
"rowSum",
"spreadsheet[rowNum][columnNum]",
"spreadsheet[rowNum]",
"spreadsheet",
"rowNum",
"columnNum",
"spreadsheet[rowNum][column] = rowSum",
"spreadsheet[rowNum][column]",
"spreadsheet[rowNum]",
"spreadsheet",
"rowNum",
"column",
"rowSum",
"for(int columnNum = 0; columnNum <= column; columnNum++)\n\t\t{\n\t\t\tint columnSum = 0;\n\t\t\t\n\t\t\tfor(int rowNum = 0; rowNum < row; rowNum++)\n\t\t\t{\n\t\t\t\tcolumnSum = columnSum + spreadsheet[rowNum][columnNum];\n\t\t\t}\n\t\t\t\n\t\t\tspreadsheet[row][columnNum] = columnSum;\n\t\t}",
"int columnNum = 0;",
"int columnNum = 0;",
"columnNum",
"0",
"columnNum <= column",
"columnNum",
"column",
"columnNum++",
"columnNum++",
"columnNum",
"{\n\t\t\tint columnSum = 0;\n\t\t\t\n\t\t\tfor(int rowNum = 0; rowNum < row; rowNum++)\n\t\t\t{\n\t\t\t\tcolumnSum = columnSum + spreadsheet[rowNum][columnNum];\n\t\t\t}\n\t\t\t\n\t\t\tspreadsheet[row][columnNum] = columnSum;\n\t\t}",
"{\n\t\t\tint columnSum = 0;\n\t\t\t\n\t\t\tfor(int rowNum = 0; rowNum < row; rowNum++)\n\t\t\t{\n\t\t\t\tcolumnSum = columnSum + spreadsheet[rowNum][columnNum];\n\t\t\t}\n\t\t\t\n\t\t\tspreadsheet[row][columnNum] = columnSum;\n\t\t}",
"int columnSum = 0;",
"columnSum",
"0",
"for(int rowNum = 0; rowNum < row; rowNum++)\n\t\t\t{\n\t\t\t\tcolumnSum = columnSum + spreadsheet[rowNum][columnNum];\n\t\t\t}",
"int rowNum = 0;",
"int rowNum = 0;",
"rowNum",
"0",
"rowNum < row",
"rowNum",
"row",
"rowNum++",
"rowNum++",
"rowNum",
"{\n\t\t\t\tcolumnSum = columnSum + spreadsheet[rowNum][columnNum];\n\t\t\t}",
"{\n\t\t\t\tcolumnSum = columnSum + spreadsheet[rowNum][columnNum];\n\t\t\t}",
"columnSum = columnSum + spreadsheet[rowNum][columnNum]",
"columnSum",
"columnSum + spreadsheet[rowNum][columnNum]",
"columnSum",
"spreadsheet[rowNum][columnNum]",
"spreadsheet[rowNum]",
"spreadsheet",
"rowNum",
"columnNum",
"spreadsheet[row][columnNum] = columnSum",
"spreadsheet[row][columnNum]",
"spreadsheet[row]",
"spreadsheet",
"row",
"columnNum",
"columnSum",
"for(int rowNum = 0; rowNum <= row; rowNum++)\n\t\t{\n\t\t\tfor(int columnNum = 0; columnNum <= column; columnNum++)\n\t\t\t{\n\t\t\t\tSystem.out.print(spreadsheet[rowNum][columnNum]);\n\t\t\t\t\n\t\t\t\tif(columnNum != column)\n\t\t\t\t{\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 rowNum = 0;",
"int rowNum = 0;",
"rowNum",
"0",
"rowNum <= row",
"rowNum",
"row",
"rowNum++",
"rowNum++",
"rowNum",
"{\n\t\t\tfor(int columnNum = 0; columnNum <= column; columnNum++)\n\t\t\t{\n\t\t\t\tSystem.out.print(spreadsheet[rowNum][columnNum]);\n\t\t\t\t\n\t\t\t\tif(columnNum != column)\n\t\t\t\t{\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 columnNum = 0; columnNum <= column; columnNum++)\n\t\t\t{\n\t\t\t\tSystem.out.print(spreadsheet[rowNum][columnNum]);\n\t\t\t\t\n\t\t\t\tif(columnNum != column)\n\t\t\t\t{\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 columnNum = 0; columnNum <= column; columnNum++)\n\t\t\t{\n\t\t\t\tSystem.out.print(spreadsheet[rowNum][columnNum]);\n\t\t\t\t\n\t\t\t\tif(columnNum != column)\n\t\t\t\t{\n\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t}\n\t\t\t}",
"int columnNum = 0;",
"int columnNum = 0;",
"columnNum",
"0",
"columnNum <= column",
"columnNum",
"column",
"columnNum++",
"columnNum++",
"columnNum",
"{\n\t\t\t\tSystem.out.print(spreadsheet[rowNum][columnNum]);\n\t\t\t\t\n\t\t\t\tif(columnNum != column)\n\t\t\t\t{\n\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t}\n\t\t\t}",
"{\n\t\t\t\tSystem.out.print(spreadsheet[rowNum][columnNum]);\n\t\t\t\t\n\t\t\t\tif(columnNum != column)\n\t\t\t\t{\n\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t}\n\t\t\t}",
"System.out.print(spreadsheet[rowNum][columnNum])",
"System.out.print",
"System.out",
"System",
"System.out",
"spreadsheet[rowNum][columnNum]",
"spreadsheet[rowNum]",
"spreadsheet",
"rowNum",
"columnNum",
"if(columnNum != column)\n\t\t\t\t{\n\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t}",
"columnNum != column",
"columnNum",
"column",
"{\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) throws java.lang.Exception\n\t{\n\t\tBufferedReader input = new BufferedReader (new InputStreamReader (System.in));\n\t\t\n\t\tString[] matrixStr = input.readLine().split(\" \");\n\t\t\n\t\tint row = Integer.parseInt(matrixStr[0]);\n\t\t\n\t\tint column = Integer.parseInt(matrixStr[1]);\n\t\t\n\t\tint[][] spreadsheet = new int[row + 1][column +1];\n\t\t\n\t\tfor(int rowNum = 0; rowNum < row; rowNum++)\n\t\t{\n\t\t\tString[] rowStr = input.readLine().split(\" \");\n\t\t\t\n\t\t\tint rowSum = 0;\n\t\t\t\n\t\t\tfor(int columnNum = 0; columnNum < column; columnNum++)\n\t\t\t{\n\t\t\t\tspreadsheet[rowNum][columnNum] = Integer.parseInt(rowStr[columnNum]);\n\t\t\t\t\n\t\t\t\trowSum = rowSum + spreadsheet[rowNum][columnNum];\n\t\t\t}\n\t\t\t\n\t\t\tspreadsheet[rowNum][column] = rowSum;\n\t\t}\n\t\t\n\t\tfor(int columnNum = 0; columnNum <= column; columnNum++)\n\t\t{\n\t\t\tint columnSum = 0;\n\t\t\t\n\t\t\tfor(int rowNum = 0; rowNum < row; rowNum++)\n\t\t\t{\n\t\t\t\tcolumnSum = columnSum + spreadsheet[rowNum][columnNum];\n\t\t\t}\n\t\t\t\n\t\t\tspreadsheet[row][columnNum] = columnSum;\n\t\t}\n\t\t\n\t\tfor(int rowNum = 0; rowNum <= row; rowNum++)\n\t\t{\n\t\t\tfor(int columnNum = 0; columnNum <= column; columnNum++)\n\t\t\t{\n\t\t\t\tSystem.out.print(spreadsheet[rowNum][columnNum]);\n\t\t\t\t\n\t\t\t\tif(columnNum != column)\n\t\t\t\t{\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) throws java.lang.Exception\n\t{\n\t\tBufferedReader input = new BufferedReader (new InputStreamReader (System.in));\n\t\t\n\t\tString[] matrixStr = input.readLine().split(\" \");\n\t\t\n\t\tint row = Integer.parseInt(matrixStr[0]);\n\t\t\n\t\tint column = Integer.parseInt(matrixStr[1]);\n\t\t\n\t\tint[][] spreadsheet = new int[row + 1][column +1];\n\t\t\n\t\tfor(int rowNum = 0; rowNum < row; rowNum++)\n\t\t{\n\t\t\tString[] rowStr = input.readLine().split(\" \");\n\t\t\t\n\t\t\tint rowSum = 0;\n\t\t\t\n\t\t\tfor(int columnNum = 0; columnNum < column; columnNum++)\n\t\t\t{\n\t\t\t\tspreadsheet[rowNum][columnNum] = Integer.parseInt(rowStr[columnNum]);\n\t\t\t\t\n\t\t\t\trowSum = rowSum + spreadsheet[rowNum][columnNum];\n\t\t\t}\n\t\t\t\n\t\t\tspreadsheet[rowNum][column] = rowSum;\n\t\t}\n\t\t\n\t\tfor(int columnNum = 0; columnNum <= column; columnNum++)\n\t\t{\n\t\t\tint columnSum = 0;\n\t\t\t\n\t\t\tfor(int rowNum = 0; rowNum < row; rowNum++)\n\t\t\t{\n\t\t\t\tcolumnSum = columnSum + spreadsheet[rowNum][columnNum];\n\t\t\t}\n\t\t\t\n\t\t\tspreadsheet[row][columnNum] = columnSum;\n\t\t}\n\t\t\n\t\tfor(int rowNum = 0; rowNum <= row; rowNum++)\n\t\t{\n\t\t\tfor(int columnNum = 0; columnNum <= column; columnNum++)\n\t\t\t{\n\t\t\t\tSystem.out.print(spreadsheet[rowNum][columnNum]);\n\t\t\t\t\n\t\t\t\tif(columnNum != column)\n\t\t\t\t{\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.io.BufferedReader;
import java.io.InputStreamReader;
public class Main {
public static void main (String[] args) throws java.lang.Exception
{
BufferedReader input = new BufferedReader (new InputStreamReader (System.in));
String[] matrixStr = input.readLine().split(" ");
int row = Integer.parseInt(matrixStr[0]);
int column = Integer.parseInt(matrixStr[1]);
int[][] spreadsheet = new int[row + 1][column +1];
for(int rowNum = 0; rowNum < row; rowNum++)
{
String[] rowStr = input.readLine().split(" ");
int rowSum = 0;
for(int columnNum = 0; columnNum < column; columnNum++)
{
spreadsheet[rowNum][columnNum] = Integer.parseInt(rowStr[columnNum]);
rowSum = rowSum + spreadsheet[rowNum][columnNum];
}
spreadsheet[rowNum][column] = rowSum;
}
for(int columnNum = 0; columnNum <= column; columnNum++)
{
int columnSum = 0;
for(int rowNum = 0; rowNum < row; rowNum++)
{
columnSum = columnSum + spreadsheet[rowNum][columnNum];
}
spreadsheet[row][columnNum] = columnSum;
}
for(int rowNum = 0; rowNum <= row; rowNum++)
{
for(int columnNum = 0; columnNum <= column; columnNum++)
{
System.out.print(spreadsheet[rowNum][columnNum]);
if(columnNum != column)
{
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,
17,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
18,
18,
13,
13,
13,
4,
18,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
18,
18,
13,
13,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
18,
18,
13,
13,
13,
18,
18,
13,
13,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
18,
18,
13,
13,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
18,
18,
13,
13,
13,
18,
18,
13,
13,
13,
0,
18,
18,
13,
13,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
18,
18,
13,
13,
13,
18,
18,
13,
13,
13,
11,
1,
41,
13,
17,
2,
13,
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
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
236,
5
],
[
236,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
8,
17
],
[
17,
18
],
[
17,
19
],
[
19,
20
],
[
20,
21
],
[
8,
22
],
[
22,
23
],
[
22,
24
],
[
8,
27
],
[
27,
28
],
[
28,
29
],
[
29,
30
],
[
29,
31
],
[
27,
32
],
[
32,
33
],
[
32,
34
],
[
27,
35
],
[
35,
36
],
[
36,
37
],
[
27,
38
],
[
39,
39
],
[
39,
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
],
[
54,
58
],
[
53,
59
],
[
59,
60
],
[
60,
61
],
[
8,
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
],
[
76,
77
],
[
77,
78
],
[
77,
79
],
[
76,
80
],
[
75,
81
],
[
74,
82
],
[
82,
83
],
[
83,
84
],
[
84,
85
],
[
84,
86
],
[
82,
87
],
[
87,
88
],
[
87,
89
],
[
82,
90
],
[
90,
91
],
[
91,
92
],
[
82,
93
],
[
94,
94
],
[
94,
95
],
[
95,
96
],
[
96,
97
],
[
97,
98
],
[
97,
99
],
[
96,
100
],
[
95,
101
],
[
101,
102
],
[
102,
103
],
[
102,
104
],
[
101,
105
],
[
8,
106
],
[
106,
107
],
[
107,
108
],
[
108,
109
],
[
108,
110
],
[
106,
111
],
[
111,
112
],
[
111,
113
],
[
106,
114
],
[
114,
115
],
[
115,
116
],
[
106,
117
],
[
118,
118
],
[
118,
119
],
[
119,
120
],
[
120,
121
],
[
121,
122
],
[
121,
123
],
[
120,
124
],
[
119,
125
],
[
118,
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
],
[
140,
144
],
[
139,
145
],
[
145,
146
],
[
146,
147
],
[
146,
148
],
[
145,
149
],
[
8,
150
],
[
150,
151
],
[
151,
152
],
[
152,
153
],
[
152,
154
],
[
151,
155
],
[
150,
156
],
[
8,
157
],
[
157,
158
],
[
158,
159
],
[
159,
160
],
[
159,
161
],
[
157,
162
],
[
162,
163
],
[
162,
164
],
[
157,
165
],
[
165,
166
],
[
166,
167
],
[
157,
168
],
[
169,
169
],
[
169,
170
],
[
170,
171
],
[
171,
172
],
[
172,
173
],
[
172,
174
],
[
171,
175
],
[
170,
176
],
[
176,
177
],
[
177,
178
],
[
177,
179
],
[
176,
180
],
[
8,
181
],
[
181,
182
],
[
182,
183
],
[
183,
184
],
[
183,
185
],
[
181,
186
],
[
186,
187
],
[
186,
188
],
[
188,
189
],
[
188,
190
],
[
181,
191
],
[
191,
192
],
[
192,
193
],
[
181,
194
],
[
195,
195
],
[
195,
196
],
[
196,
197
],
[
197,
198
],
[
198,
199
],
[
198,
200
],
[
196,
201
],
[
201,
202
],
[
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
],
[
216,
217
],
[
216,
218
],
[
215,
219
],
[
214,
220
],
[
195,
221
],
[
221,
222
],
[
222,
223
],
[
223,
224
],
[
223,
225
],
[
221,
226
],
[
226,
227
],
[
227,
228
],
[
228,
229
],
[
228,
230
],
[
227,
231
],
[
226,
232
],
[
6,
233
],
[
233,
234
],
[
0,
235
],
[
235,
236
],
[
235,
237
]
] | [
"\nimport java.util.Scanner;\n\n/**\n *\n * @author kids\n */\npublic class Main {\n \n public static void main(String[] args){\n Scanner scanner=new Scanner(System.in);\n int vert=scanner.nextInt();\n int horiz=scanner.nextInt();\n \n int table[][]=new int[101][101];\n \n for(int i=0;i<vert;i++){\n for(int j=0;j<horiz;j++){\n table[i][j]=scanner.nextInt();\n }\n }\n \n for(int i=0;i<vert;i++){\n table[i][horiz]=0;\n for(int j=0;j<horiz;j++){\n table[i][horiz]+=table[i][j];\n }\n }\n \n for(int i=0;i<horiz;i++){\n table[vert][i]=0;\n for(int j=0;j<vert;j++){\n table[vert][i]+=table[j][i];\n }\n }\n \n table[vert][horiz]=0;\n for(int i=0;i<horiz;i++){\n table[vert][horiz]+=table[vert][i];\n }\n \n for(int i=0;i<vert+1;i++){\n for(int j=0;j<horiz;j++){\n System.out.print(table[i][j]+\" \");\n }\n System.out.print(table[i][horiz]+\"\\n\");\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 vert=scanner.nextInt();\n int horiz=scanner.nextInt();\n \n int table[][]=new int[101][101];\n \n for(int i=0;i<vert;i++){\n for(int j=0;j<horiz;j++){\n table[i][j]=scanner.nextInt();\n }\n }\n \n for(int i=0;i<vert;i++){\n table[i][horiz]=0;\n for(int j=0;j<horiz;j++){\n table[i][horiz]+=table[i][j];\n }\n }\n \n for(int i=0;i<horiz;i++){\n table[vert][i]=0;\n for(int j=0;j<vert;j++){\n table[vert][i]+=table[j][i];\n }\n }\n \n table[vert][horiz]=0;\n for(int i=0;i<horiz;i++){\n table[vert][horiz]+=table[vert][i];\n }\n \n for(int i=0;i<vert+1;i++){\n for(int j=0;j<horiz;j++){\n System.out.print(table[i][j]+\" \");\n }\n System.out.print(table[i][horiz]+\"\\n\");\n }\n \n } \n \n}",
"Main",
"public static void main(String[] args){\n Scanner scanner=new Scanner(System.in);\n int vert=scanner.nextInt();\n int horiz=scanner.nextInt();\n \n int table[][]=new int[101][101];\n \n for(int i=0;i<vert;i++){\n for(int j=0;j<horiz;j++){\n table[i][j]=scanner.nextInt();\n }\n }\n \n for(int i=0;i<vert;i++){\n table[i][horiz]=0;\n for(int j=0;j<horiz;j++){\n table[i][horiz]+=table[i][j];\n }\n }\n \n for(int i=0;i<horiz;i++){\n table[vert][i]=0;\n for(int j=0;j<vert;j++){\n table[vert][i]+=table[j][i];\n }\n }\n \n table[vert][horiz]=0;\n for(int i=0;i<horiz;i++){\n table[vert][horiz]+=table[vert][i];\n }\n \n for(int i=0;i<vert+1;i++){\n for(int j=0;j<horiz;j++){\n System.out.print(table[i][j]+\" \");\n }\n System.out.print(table[i][horiz]+\"\\n\");\n }\n \n }",
"main",
"{\n Scanner scanner=new Scanner(System.in);\n int vert=scanner.nextInt();\n int horiz=scanner.nextInt();\n \n int table[][]=new int[101][101];\n \n for(int i=0;i<vert;i++){\n for(int j=0;j<horiz;j++){\n table[i][j]=scanner.nextInt();\n }\n }\n \n for(int i=0;i<vert;i++){\n table[i][horiz]=0;\n for(int j=0;j<horiz;j++){\n table[i][horiz]+=table[i][j];\n }\n }\n \n for(int i=0;i<horiz;i++){\n table[vert][i]=0;\n for(int j=0;j<vert;j++){\n table[vert][i]+=table[j][i];\n }\n }\n \n table[vert][horiz]=0;\n for(int i=0;i<horiz;i++){\n table[vert][horiz]+=table[vert][i];\n }\n \n for(int i=0;i<vert+1;i++){\n for(int j=0;j<horiz;j++){\n System.out.print(table[i][j]+\" \");\n }\n System.out.print(table[i][horiz]+\"\\n\");\n }\n \n }",
"Scanner scanner=new Scanner(System.in);",
"scanner",
"new Scanner(System.in)",
"int vert=scanner.nextInt();",
"vert",
"scanner.nextInt()",
"scanner.nextInt",
"scanner",
"int horiz=scanner.nextInt();",
"horiz",
"scanner.nextInt()",
"scanner.nextInt",
"scanner",
"int table[][]=new int[101][101];",
"table",
"new int[101][101]",
"101",
"101",
"for(int i=0;i<vert;i++){\n for(int j=0;j<horiz;j++){\n table[i][j]=scanner.nextInt();\n }\n }",
"int i=0;",
"int i=0;",
"i",
"0",
"i<vert",
"i",
"vert",
"i++",
"i++",
"i",
"{\n for(int j=0;j<horiz;j++){\n table[i][j]=scanner.nextInt();\n }\n }",
"{\n for(int j=0;j<horiz;j++){\n table[i][j]=scanner.nextInt();\n }\n }",
"for(int j=0;j<horiz;j++){\n table[i][j]=scanner.nextInt();\n }",
"int j=0;",
"int j=0;",
"j",
"0",
"j<horiz",
"j",
"horiz",
"j++",
"j++",
"j",
"{\n table[i][j]=scanner.nextInt();\n }",
"{\n table[i][j]=scanner.nextInt();\n }",
"table[i][j]=scanner.nextInt()",
"table[i][j]",
"table[i]",
"table",
"i",
"j",
"scanner.nextInt()",
"scanner.nextInt",
"scanner",
"for(int i=0;i<vert;i++){\n table[i][horiz]=0;\n for(int j=0;j<horiz;j++){\n table[i][horiz]+=table[i][j];\n }\n }",
"int i=0;",
"int i=0;",
"i",
"0",
"i<vert",
"i",
"vert",
"i++",
"i++",
"i",
"{\n table[i][horiz]=0;\n for(int j=0;j<horiz;j++){\n table[i][horiz]+=table[i][j];\n }\n }",
"{\n table[i][horiz]=0;\n for(int j=0;j<horiz;j++){\n table[i][horiz]+=table[i][j];\n }\n }",
"table[i][horiz]=0",
"table[i][horiz]",
"table[i]",
"table",
"i",
"horiz",
"0",
"for(int j=0;j<horiz;j++){\n table[i][horiz]+=table[i][j];\n }",
"int j=0;",
"int j=0;",
"j",
"0",
"j<horiz",
"j",
"horiz",
"j++",
"j++",
"j",
"{\n table[i][horiz]+=table[i][j];\n }",
"{\n table[i][horiz]+=table[i][j];\n }",
"table[i][horiz]+=table[i][j]",
"table[i][horiz]",
"table[i]",
"table",
"i",
"horiz",
"table[i][j]",
"table[i]",
"table",
"i",
"j",
"for(int i=0;i<horiz;i++){\n table[vert][i]=0;\n for(int j=0;j<vert;j++){\n table[vert][i]+=table[j][i];\n }\n }",
"int i=0;",
"int i=0;",
"i",
"0",
"i<horiz",
"i",
"horiz",
"i++",
"i++",
"i",
"{\n table[vert][i]=0;\n for(int j=0;j<vert;j++){\n table[vert][i]+=table[j][i];\n }\n }",
"{\n table[vert][i]=0;\n for(int j=0;j<vert;j++){\n table[vert][i]+=table[j][i];\n }\n }",
"table[vert][i]=0",
"table[vert][i]",
"table[vert]",
"table",
"vert",
"i",
"0",
"for(int j=0;j<vert;j++){\n table[vert][i]+=table[j][i];\n }",
"int j=0;",
"int j=0;",
"j",
"0",
"j<vert",
"j",
"vert",
"j++",
"j++",
"j",
"{\n table[vert][i]+=table[j][i];\n }",
"{\n table[vert][i]+=table[j][i];\n }",
"table[vert][i]+=table[j][i]",
"table[vert][i]",
"table[vert]",
"table",
"vert",
"i",
"table[j][i]",
"table[j]",
"table",
"j",
"i",
"table[vert][horiz]=0",
"table[vert][horiz]",
"table[vert]",
"table",
"vert",
"horiz",
"0",
"for(int i=0;i<horiz;i++){\n table[vert][horiz]+=table[vert][i];\n }",
"int i=0;",
"int i=0;",
"i",
"0",
"i<horiz",
"i",
"horiz",
"i++",
"i++",
"i",
"{\n table[vert][horiz]+=table[vert][i];\n }",
"{\n table[vert][horiz]+=table[vert][i];\n }",
"table[vert][horiz]+=table[vert][i]",
"table[vert][horiz]",
"table[vert]",
"table",
"vert",
"horiz",
"table[vert][i]",
"table[vert]",
"table",
"vert",
"i",
"for(int i=0;i<vert+1;i++){\n for(int j=0;j<horiz;j++){\n System.out.print(table[i][j]+\" \");\n }\n System.out.print(table[i][horiz]+\"\\n\");\n }",
"int i=0;",
"int i=0;",
"i",
"0",
"i<vert+1",
"i",
"vert+1",
"vert",
"1",
"i++",
"i++",
"i",
"{\n for(int j=0;j<horiz;j++){\n System.out.print(table[i][j]+\" \");\n }\n System.out.print(table[i][horiz]+\"\\n\");\n }",
"{\n for(int j=0;j<horiz;j++){\n System.out.print(table[i][j]+\" \");\n }\n System.out.print(table[i][horiz]+\"\\n\");\n }",
"for(int j=0;j<horiz;j++){\n System.out.print(table[i][j]+\" \");\n }",
"int j=0;",
"int j=0;",
"j",
"0",
"j<horiz",
"j",
"horiz",
"j++",
"j++",
"j",
"{\n System.out.print(table[i][j]+\" \");\n }",
"{\n System.out.print(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",
"\" \"",
"System.out.print(table[i][horiz]+\"\\n\")",
"System.out.print",
"System.out",
"System",
"System.out",
"table[i][horiz]+\"\\n\"",
"table[i][horiz]",
"table[i]",
"table",
"i",
"horiz",
"\"\\n\"",
"String[] args",
"args",
"public class Main {\n \n public static void main(String[] args){\n Scanner scanner=new Scanner(System.in);\n int vert=scanner.nextInt();\n int horiz=scanner.nextInt();\n \n int table[][]=new int[101][101];\n \n for(int i=0;i<vert;i++){\n for(int j=0;j<horiz;j++){\n table[i][j]=scanner.nextInt();\n }\n }\n \n for(int i=0;i<vert;i++){\n table[i][horiz]=0;\n for(int j=0;j<horiz;j++){\n table[i][horiz]+=table[i][j];\n }\n }\n \n for(int i=0;i<horiz;i++){\n table[vert][i]=0;\n for(int j=0;j<vert;j++){\n table[vert][i]+=table[j][i];\n }\n }\n \n table[vert][horiz]=0;\n for(int i=0;i<horiz;i++){\n table[vert][horiz]+=table[vert][i];\n }\n \n for(int i=0;i<vert+1;i++){\n for(int j=0;j<horiz;j++){\n System.out.print(table[i][j]+\" \");\n }\n System.out.print(table[i][horiz]+\"\\n\");\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 vert=scanner.nextInt();\n int horiz=scanner.nextInt();\n \n int table[][]=new int[101][101];\n \n for(int i=0;i<vert;i++){\n for(int j=0;j<horiz;j++){\n table[i][j]=scanner.nextInt();\n }\n }\n \n for(int i=0;i<vert;i++){\n table[i][horiz]=0;\n for(int j=0;j<horiz;j++){\n table[i][horiz]+=table[i][j];\n }\n }\n \n for(int i=0;i<horiz;i++){\n table[vert][i]=0;\n for(int j=0;j<vert;j++){\n table[vert][i]+=table[j][i];\n }\n }\n \n table[vert][horiz]=0;\n for(int i=0;i<horiz;i++){\n table[vert][horiz]+=table[vert][i];\n }\n \n for(int i=0;i<vert+1;i++){\n for(int j=0;j<horiz;j++){\n System.out.print(table[i][j]+\" \");\n }\n System.out.print(table[i][horiz]+\"\\n\");\n }\n \n } \n \n}",
"Main"
] |
import java.util.Scanner;
/**
*
* @author kids
*/
public class Main {
public static void main(String[] args){
Scanner scanner=new Scanner(System.in);
int vert=scanner.nextInt();
int horiz=scanner.nextInt();
int table[][]=new int[101][101];
for(int i=0;i<vert;i++){
for(int j=0;j<horiz;j++){
table[i][j]=scanner.nextInt();
}
}
for(int i=0;i<vert;i++){
table[i][horiz]=0;
for(int j=0;j<horiz;j++){
table[i][horiz]+=table[i][j];
}
}
for(int i=0;i<horiz;i++){
table[vert][i]=0;
for(int j=0;j<vert;j++){
table[vert][i]+=table[j][i];
}
}
table[vert][horiz]=0;
for(int i=0;i<horiz;i++){
table[vert][horiz]+=table[vert][i];
}
for(int i=0;i<vert+1;i++){
for(int j=0;j<horiz;j++){
System.out.print(table[i][j]+" ");
}
System.out.print(table[i][horiz]+"\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,
0,
13,
20,
13,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
18,
18,
13,
13,
13,
4,
18,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
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,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
2,
13,
18,
18,
13,
13,
13,
4,
18,
18,
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,
0,
13,
2,
13,
18,
18,
13,
13,
13,
0,
13,
2,
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
],
[
200,
5
],
[
200,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
8,
17
],
[
17,
18
],
[
17,
19
],
[
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
],
[
54,
54
],
[
54,
55
],
[
55,
56
],
[
56,
57
],
[
57,
58
],
[
57,
59
],
[
56,
60
],
[
55,
61
],
[
61,
62
],
[
62,
63
],
[
8,
64
],
[
64,
65
],
[
65,
66
],
[
66,
67
],
[
66,
68
],
[
64,
69
],
[
69,
70
],
[
69,
71
],
[
64,
72
],
[
72,
73
],
[
73,
74
],
[
64,
75
],
[
76,
76
],
[
76,
77
],
[
77,
78
],
[
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
],
[
96,
97
],
[
97,
98
],
[
97,
99
],
[
96,
100
],
[
95,
101
],
[
76,
102
],
[
102,
103
],
[
102,
104
],
[
76,
105
],
[
105,
106
],
[
106,
107
],
[
107,
108
],
[
107,
109
],
[
105,
110
],
[
110,
111
],
[
110,
112
],
[
105,
113
],
[
113,
114
],
[
114,
115
],
[
105,
116
],
[
117,
117
],
[
117,
118
],
[
118,
119
],
[
118,
120
],
[
120,
121
],
[
120,
122
],
[
122,
123
],
[
123,
124
],
[
123,
125
],
[
122,
126
],
[
76,
127
],
[
127,
128
],
[
128,
129
],
[
129,
130
],
[
129,
131
],
[
127,
132
],
[
8,
133
],
[
133,
134
],
[
133,
135
],
[
8,
136
],
[
136,
137
],
[
137,
138
],
[
138,
139
],
[
138,
140
],
[
136,
141
],
[
141,
142
],
[
141,
143
],
[
136,
144
],
[
144,
145
],
[
145,
146
],
[
136,
147
],
[
148,
148
],
[
148,
149
],
[
149,
150
],
[
149,
151
],
[
148,
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
],
[
165,
167
],
[
167,
168
],
[
167,
169
],
[
169,
170
],
[
170,
171
],
[
170,
172
],
[
169,
173
],
[
164,
174
],
[
174,
175
],
[
174,
176
],
[
176,
177
],
[
176,
178
],
[
178,
179
],
[
179,
180
],
[
179,
181
],
[
178,
182
],
[
148,
183
],
[
183,
184
],
[
184,
185
],
[
185,
186
],
[
185,
187
],
[
183,
188
],
[
188,
189
],
[
188,
190
],
[
8,
191
],
[
191,
192
],
[
192,
193
],
[
193,
194
],
[
193,
195
],
[
191,
196
],
[
6,
197
],
[
197,
198
],
[
0,
199
],
[
199,
200
],
[
199,
201
]
] | [
"import java.util.Scanner;\n\npublic class Main {\n\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\n\t\tint[][] Aay_rc;\n\t\tAay_rc = new int[r][c];\n\n\t\tfor (int i = 0; i < r; i++) {\n\t\t\tfor (int j = 0; j < c; j++) {\n\t\t\t\tAay_rc[i][j] = scan.nextInt();\n\t\t\t}\n\t\t}\n\n\t\tfor (int i = 0; i < r; i++) {\n\t\t\tfor (int j = 0; j < c; j++) {\n\t\t\t\tSystem.out.print(Aay_rc[i][j] + \" \");\n\t\t\t}\n\n\t\t\tint sum_r = 0;\n\t\t\tfor (int k = 0; k < c; k++) {\n\t\t\t\tsum_r = sum_r + Aay_rc[i][k];\n\t\t\t}\n\t\t\tSystem.out.println(sum_r);\n\t\t}\n\n\t\tint sum_all = 0;\n\t\tfor (int L = 0; L < c; L++) {\n\t\t\tint sum_c = 0;\n\t\t\tfor (int m = 0; m < r; m++) {\n\t\t\t\tsum_c = sum_c + Aay_rc[m][L];\n\t\t\t\tsum_all = sum_all + Aay_rc[m][L];\n\t\t\t}\n\t\t\tSystem.out.print(sum_c + \" \");\n\t\t}\n\t\tSystem.out.println(sum_all);\n\t}\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n\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\n\t\tint[][] Aay_rc;\n\t\tAay_rc = new int[r][c];\n\n\t\tfor (int i = 0; i < r; i++) {\n\t\t\tfor (int j = 0; j < c; j++) {\n\t\t\t\tAay_rc[i][j] = scan.nextInt();\n\t\t\t}\n\t\t}\n\n\t\tfor (int i = 0; i < r; i++) {\n\t\t\tfor (int j = 0; j < c; j++) {\n\t\t\t\tSystem.out.print(Aay_rc[i][j] + \" \");\n\t\t\t}\n\n\t\t\tint sum_r = 0;\n\t\t\tfor (int k = 0; k < c; k++) {\n\t\t\t\tsum_r = sum_r + Aay_rc[i][k];\n\t\t\t}\n\t\t\tSystem.out.println(sum_r);\n\t\t}\n\n\t\tint sum_all = 0;\n\t\tfor (int L = 0; L < c; L++) {\n\t\t\tint sum_c = 0;\n\t\t\tfor (int m = 0; m < r; m++) {\n\t\t\t\tsum_c = sum_c + Aay_rc[m][L];\n\t\t\t\tsum_all = sum_all + Aay_rc[m][L];\n\t\t\t}\n\t\t\tSystem.out.print(sum_c + \" \");\n\t\t}\n\t\tSystem.out.println(sum_all);\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\n\t\tint[][] Aay_rc;\n\t\tAay_rc = new int[r][c];\n\n\t\tfor (int i = 0; i < r; i++) {\n\t\t\tfor (int j = 0; j < c; j++) {\n\t\t\t\tAay_rc[i][j] = scan.nextInt();\n\t\t\t}\n\t\t}\n\n\t\tfor (int i = 0; i < r; i++) {\n\t\t\tfor (int j = 0; j < c; j++) {\n\t\t\t\tSystem.out.print(Aay_rc[i][j] + \" \");\n\t\t\t}\n\n\t\t\tint sum_r = 0;\n\t\t\tfor (int k = 0; k < c; k++) {\n\t\t\t\tsum_r = sum_r + Aay_rc[i][k];\n\t\t\t}\n\t\t\tSystem.out.println(sum_r);\n\t\t}\n\n\t\tint sum_all = 0;\n\t\tfor (int L = 0; L < c; L++) {\n\t\t\tint sum_c = 0;\n\t\t\tfor (int m = 0; m < r; m++) {\n\t\t\t\tsum_c = sum_c + Aay_rc[m][L];\n\t\t\t\tsum_all = sum_all + Aay_rc[m][L];\n\t\t\t}\n\t\t\tSystem.out.print(sum_c + \" \");\n\t\t}\n\t\tSystem.out.println(sum_all);\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\n\t\tint[][] Aay_rc;\n\t\tAay_rc = new int[r][c];\n\n\t\tfor (int i = 0; i < r; i++) {\n\t\t\tfor (int j = 0; j < c; j++) {\n\t\t\t\tAay_rc[i][j] = scan.nextInt();\n\t\t\t}\n\t\t}\n\n\t\tfor (int i = 0; i < r; i++) {\n\t\t\tfor (int j = 0; j < c; j++) {\n\t\t\t\tSystem.out.print(Aay_rc[i][j] + \" \");\n\t\t\t}\n\n\t\t\tint sum_r = 0;\n\t\t\tfor (int k = 0; k < c; k++) {\n\t\t\t\tsum_r = sum_r + Aay_rc[i][k];\n\t\t\t}\n\t\t\tSystem.out.println(sum_r);\n\t\t}\n\n\t\tint sum_all = 0;\n\t\tfor (int L = 0; L < c; L++) {\n\t\t\tint sum_c = 0;\n\t\t\tfor (int m = 0; m < r; m++) {\n\t\t\t\tsum_c = sum_c + Aay_rc[m][L];\n\t\t\t\tsum_all = sum_all + Aay_rc[m][L];\n\t\t\t}\n\t\t\tSystem.out.print(sum_c + \" \");\n\t\t}\n\t\tSystem.out.println(sum_all);\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[][] Aay_rc;",
"Aay_rc",
"Aay_rc = new int[r][c]",
"Aay_rc",
"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\tAay_rc[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\tAay_rc[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\tAay_rc[i][j] = scan.nextInt();\n\t\t\t}\n\t\t}",
"for (int j = 0; j < c; j++) {\n\t\t\t\tAay_rc[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\tAay_rc[i][j] = scan.nextInt();\n\t\t\t}",
"{\n\t\t\t\tAay_rc[i][j] = scan.nextInt();\n\t\t\t}",
"Aay_rc[i][j] = scan.nextInt()",
"Aay_rc[i][j]",
"Aay_rc[i]",
"Aay_rc",
"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\tSystem.out.print(Aay_rc[i][j] + \" \");\n\t\t\t}\n\n\t\t\tint sum_r = 0;\n\t\t\tfor (int k = 0; k < c; k++) {\n\t\t\t\tsum_r = sum_r + Aay_rc[i][k];\n\t\t\t}\n\t\t\tSystem.out.println(sum_r);\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(Aay_rc[i][j] + \" \");\n\t\t\t}\n\n\t\t\tint sum_r = 0;\n\t\t\tfor (int k = 0; k < c; k++) {\n\t\t\t\tsum_r = sum_r + Aay_rc[i][k];\n\t\t\t}\n\t\t\tSystem.out.println(sum_r);\n\t\t}",
"{\n\t\t\tfor (int j = 0; j < c; j++) {\n\t\t\t\tSystem.out.print(Aay_rc[i][j] + \" \");\n\t\t\t}\n\n\t\t\tint sum_r = 0;\n\t\t\tfor (int k = 0; k < c; k++) {\n\t\t\t\tsum_r = sum_r + Aay_rc[i][k];\n\t\t\t}\n\t\t\tSystem.out.println(sum_r);\n\t\t}",
"for (int j = 0; j < c; j++) {\n\t\t\t\tSystem.out.print(Aay_rc[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(Aay_rc[i][j] + \" \");\n\t\t\t}",
"{\n\t\t\t\tSystem.out.print(Aay_rc[i][j] + \" \");\n\t\t\t}",
"System.out.print(Aay_rc[i][j] + \" \")",
"System.out.print",
"System.out",
"System",
"System.out",
"Aay_rc[i][j] + \" \"",
"Aay_rc[i][j]",
"Aay_rc[i]",
"Aay_rc",
"i",
"j",
"\" \"",
"int sum_r = 0;",
"sum_r",
"0",
"for (int k = 0; k < c; k++) {\n\t\t\t\tsum_r = sum_r + Aay_rc[i][k];\n\t\t\t}",
"int k = 0;",
"int k = 0;",
"k",
"0",
"k < c",
"k",
"c",
"k++",
"k++",
"k",
"{\n\t\t\t\tsum_r = sum_r + Aay_rc[i][k];\n\t\t\t}",
"{\n\t\t\t\tsum_r = sum_r + Aay_rc[i][k];\n\t\t\t}",
"sum_r = sum_r + Aay_rc[i][k]",
"sum_r",
"sum_r + Aay_rc[i][k]",
"sum_r",
"Aay_rc[i][k]",
"Aay_rc[i]",
"Aay_rc",
"i",
"k",
"System.out.println(sum_r)",
"System.out.println",
"System.out",
"System",
"System.out",
"sum_r",
"int sum_all = 0;",
"sum_all",
"0",
"for (int L = 0; L < c; L++) {\n\t\t\tint sum_c = 0;\n\t\t\tfor (int m = 0; m < r; m++) {\n\t\t\t\tsum_c = sum_c + Aay_rc[m][L];\n\t\t\t\tsum_all = sum_all + Aay_rc[m][L];\n\t\t\t}\n\t\t\tSystem.out.print(sum_c + \" \");\n\t\t}",
"int L = 0;",
"int L = 0;",
"L",
"0",
"L < c",
"L",
"c",
"L++",
"L++",
"L",
"{\n\t\t\tint sum_c = 0;\n\t\t\tfor (int m = 0; m < r; m++) {\n\t\t\t\tsum_c = sum_c + Aay_rc[m][L];\n\t\t\t\tsum_all = sum_all + Aay_rc[m][L];\n\t\t\t}\n\t\t\tSystem.out.print(sum_c + \" \");\n\t\t}",
"{\n\t\t\tint sum_c = 0;\n\t\t\tfor (int m = 0; m < r; m++) {\n\t\t\t\tsum_c = sum_c + Aay_rc[m][L];\n\t\t\t\tsum_all = sum_all + Aay_rc[m][L];\n\t\t\t}\n\t\t\tSystem.out.print(sum_c + \" \");\n\t\t}",
"int sum_c = 0;",
"sum_c",
"0",
"for (int m = 0; m < r; m++) {\n\t\t\t\tsum_c = sum_c + Aay_rc[m][L];\n\t\t\t\tsum_all = sum_all + Aay_rc[m][L];\n\t\t\t}",
"int m = 0;",
"int m = 0;",
"m",
"0",
"m < r",
"m",
"r",
"m++",
"m++",
"m",
"{\n\t\t\t\tsum_c = sum_c + Aay_rc[m][L];\n\t\t\t\tsum_all = sum_all + Aay_rc[m][L];\n\t\t\t}",
"{\n\t\t\t\tsum_c = sum_c + Aay_rc[m][L];\n\t\t\t\tsum_all = sum_all + Aay_rc[m][L];\n\t\t\t}",
"sum_c = sum_c + Aay_rc[m][L]",
"sum_c",
"sum_c + Aay_rc[m][L]",
"sum_c",
"Aay_rc[m][L]",
"Aay_rc[m]",
"Aay_rc",
"m",
"L",
"sum_all = sum_all + Aay_rc[m][L]",
"sum_all",
"sum_all + Aay_rc[m][L]",
"sum_all",
"Aay_rc[m][L]",
"Aay_rc[m]",
"Aay_rc",
"m",
"L",
"System.out.print(sum_c + \" \")",
"System.out.print",
"System.out",
"System",
"System.out",
"sum_c + \" \"",
"sum_c",
"\" \"",
"System.out.println(sum_all)",
"System.out.println",
"System.out",
"System",
"System.out",
"sum_all",
"String[] args",
"args",
"public class Main {\n\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\n\t\tint[][] Aay_rc;\n\t\tAay_rc = new int[r][c];\n\n\t\tfor (int i = 0; i < r; i++) {\n\t\t\tfor (int j = 0; j < c; j++) {\n\t\t\t\tAay_rc[i][j] = scan.nextInt();\n\t\t\t}\n\t\t}\n\n\t\tfor (int i = 0; i < r; i++) {\n\t\t\tfor (int j = 0; j < c; j++) {\n\t\t\t\tSystem.out.print(Aay_rc[i][j] + \" \");\n\t\t\t}\n\n\t\t\tint sum_r = 0;\n\t\t\tfor (int k = 0; k < c; k++) {\n\t\t\t\tsum_r = sum_r + Aay_rc[i][k];\n\t\t\t}\n\t\t\tSystem.out.println(sum_r);\n\t\t}\n\n\t\tint sum_all = 0;\n\t\tfor (int L = 0; L < c; L++) {\n\t\t\tint sum_c = 0;\n\t\t\tfor (int m = 0; m < r; m++) {\n\t\t\t\tsum_c = sum_c + Aay_rc[m][L];\n\t\t\t\tsum_all = sum_all + Aay_rc[m][L];\n\t\t\t}\n\t\t\tSystem.out.print(sum_c + \" \");\n\t\t}\n\t\tSystem.out.println(sum_all);\n\t}\n}",
"public class Main {\n\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\n\t\tint[][] Aay_rc;\n\t\tAay_rc = new int[r][c];\n\n\t\tfor (int i = 0; i < r; i++) {\n\t\t\tfor (int j = 0; j < c; j++) {\n\t\t\t\tAay_rc[i][j] = scan.nextInt();\n\t\t\t}\n\t\t}\n\n\t\tfor (int i = 0; i < r; i++) {\n\t\t\tfor (int j = 0; j < c; j++) {\n\t\t\t\tSystem.out.print(Aay_rc[i][j] + \" \");\n\t\t\t}\n\n\t\t\tint sum_r = 0;\n\t\t\tfor (int k = 0; k < c; k++) {\n\t\t\t\tsum_r = sum_r + Aay_rc[i][k];\n\t\t\t}\n\t\t\tSystem.out.println(sum_r);\n\t\t}\n\n\t\tint sum_all = 0;\n\t\tfor (int L = 0; L < c; L++) {\n\t\t\tint sum_c = 0;\n\t\t\tfor (int m = 0; m < r; m++) {\n\t\t\t\tsum_c = sum_c + Aay_rc[m][L];\n\t\t\t\tsum_all = sum_all + Aay_rc[m][L];\n\t\t\t}\n\t\t\tSystem.out.print(sum_c + \" \");\n\t\t}\n\t\tSystem.out.println(sum_all);\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[][] Aay_rc;
Aay_rc = new int[r][c];
for (int i = 0; i < r; i++) {
for (int j = 0; j < c; j++) {
Aay_rc[i][j] = scan.nextInt();
}
}
for (int i = 0; i < r; i++) {
for (int j = 0; j < c; j++) {
System.out.print(Aay_rc[i][j] + " ");
}
int sum_r = 0;
for (int k = 0; k < c; k++) {
sum_r = sum_r + Aay_rc[i][k];
}
System.out.println(sum_r);
}
int sum_all = 0;
for (int L = 0; L < c; L++) {
int sum_c = 0;
for (int m = 0; m < r; m++) {
sum_c = sum_c + Aay_rc[m][L];
sum_all = sum_all + Aay_rc[m][L];
}
System.out.print(sum_c + " ");
}
System.out.println(sum_all);
}
} |
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
41,
13,
20,
13,
13,
11,
1,
41,
13,
17,
2,
13,
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,
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,
13,
13,
18,
18,
13,
13,
13,
4,
18,
18,
13,
13,
2,
18,
18,
13,
13,
13,
17,
4,
18,
18,
13,
13,
13,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
18,
13,
13,
4,
18,
18,
13,
13,
2,
18,
13,
13,
17,
4,
18,
18,
13,
13,
13,
23,
13
] | [
[
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
],
[
28,
29
],
[
29,
30
],
[
29,
31
],
[
27,
32
],
[
32,
33
],
[
32,
34
],
[
27,
35
],
[
35,
36
],
[
36,
37
],
[
27,
38
],
[
39,
39
],
[
39,
40
],
[
40,
41
],
[
41,
42
],
[
42,
43
],
[
42,
44
],
[
40,
45
],
[
45,
46
],
[
45,
47
],
[
40,
48
],
[
48,
49
],
[
49,
50
],
[
40,
51
],
[
51,
52
],
[
52,
53
],
[
53,
54
],
[
54,
55
],
[
54,
56
],
[
53,
57
],
[
52,
58
],
[
58,
59
],
[
59,
60
],
[
8,
61
],
[
61,
62
],
[
61,
63
],
[
8,
65
],
[
65,
66
],
[
66,
67
],
[
67,
68
],
[
67,
69
],
[
65,
70
],
[
70,
71
],
[
70,
72
],
[
65,
73
],
[
73,
74
],
[
74,
75
],
[
65,
76
],
[
77,
77
],
[
77,
78
],
[
78,
79
],
[
78,
80
],
[
77,
81
],
[
81,
82
],
[
82,
83
],
[
83,
84
],
[
83,
85
],
[
81,
86
],
[
86,
87
],
[
86,
88
],
[
81,
89
],
[
89,
90
],
[
90,
91
],
[
81,
92
],
[
93,
93
],
[
93,
94
],
[
94,
95
],
[
94,
96
],
[
96,
97
],
[
97,
98
],
[
97,
99
],
[
96,
100
],
[
93,
101
],
[
101,
102
],
[
102,
103
],
[
102,
104
],
[
101,
105
],
[
105,
106
],
[
106,
107
],
[
106,
108
],
[
105,
109
],
[
93,
110
],
[
110,
111
],
[
111,
112
],
[
112,
113
],
[
112,
114
],
[
110,
115
],
[
115,
116
],
[
116,
117
],
[
117,
118
],
[
117,
119
],
[
116,
120
],
[
115,
121
],
[
77,
122
],
[
122,
123
],
[
123,
124
],
[
124,
125
],
[
124,
126
],
[
122,
127
],
[
8,
128
],
[
128,
129
],
[
128,
130
],
[
8,
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
],
[
146,
147
],
[
146,
148
],
[
143,
149
],
[
149,
150
],
[
150,
151
],
[
151,
152
],
[
151,
153
],
[
149,
154
],
[
154,
155
],
[
155,
156
],
[
155,
157
],
[
154,
158
],
[
8,
159
],
[
159,
160
],
[
160,
161
],
[
161,
162
],
[
161,
163
],
[
159,
164
],
[
6,
165
],
[
165,
166
]
] | [
"import java.util.Scanner;\n\nclass Main {\n\n\tpublic static void main(String[] args) {\n\t\tScanner scanner = new Scanner(System.in);\n\t\t\n\t\tint r = scanner.nextInt();\n\t\tint c = scanner.nextInt();\n\t\t\n\t\tint[][] cell = new int[r][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\tcell[i][j] = scanner.nextInt();\n\t\t}\n\t\t\n\t\tint[] csum = new int[c];\n\t\t\n\t\tfor (int i = 0; i < r; i++) {\n\t\t\tint rsum = 0;\n\t\t\tfor (int j = 0; j < c; j++) {\n\t\t\t\trsum += cell[i][j];\n\t\t\t\tcsum[j] += cell[i][j];\n\t\t\t\tSystem.out.print(cell[i][j] + \" \");\n\t\t\t}\n\t\t\tSystem.out.println(rsum);\n\t\t}\n\t\tint sum = 0;\n\t\tfor (int i = 0; i < c; i++) {\n\t\t\tsum += csum[i];\n\t\t\tSystem.out.print(csum[i] + \" \");\n\t\t}\n\t\tSystem.out.println(sum);\n\n\t}\n\n}\n",
"import java.util.Scanner;",
"Scanner",
"java.util",
"class Main {\n\n\tpublic static void main(String[] args) {\n\t\tScanner scanner = new Scanner(System.in);\n\t\t\n\t\tint r = scanner.nextInt();\n\t\tint c = scanner.nextInt();\n\t\t\n\t\tint[][] cell = new int[r][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\tcell[i][j] = scanner.nextInt();\n\t\t}\n\t\t\n\t\tint[] csum = new int[c];\n\t\t\n\t\tfor (int i = 0; i < r; i++) {\n\t\t\tint rsum = 0;\n\t\t\tfor (int j = 0; j < c; j++) {\n\t\t\t\trsum += cell[i][j];\n\t\t\t\tcsum[j] += cell[i][j];\n\t\t\t\tSystem.out.print(cell[i][j] + \" \");\n\t\t\t}\n\t\t\tSystem.out.println(rsum);\n\t\t}\n\t\tint sum = 0;\n\t\tfor (int i = 0; i < c; i++) {\n\t\t\tsum += csum[i];\n\t\t\tSystem.out.print(csum[i] + \" \");\n\t\t}\n\t\tSystem.out.println(sum);\n\n\t}\n\n}",
"Main",
"public static void main(String[] args) {\n\t\tScanner scanner = new Scanner(System.in);\n\t\t\n\t\tint r = scanner.nextInt();\n\t\tint c = scanner.nextInt();\n\t\t\n\t\tint[][] cell = new int[r][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\tcell[i][j] = scanner.nextInt();\n\t\t}\n\t\t\n\t\tint[] csum = new int[c];\n\t\t\n\t\tfor (int i = 0; i < r; i++) {\n\t\t\tint rsum = 0;\n\t\t\tfor (int j = 0; j < c; j++) {\n\t\t\t\trsum += cell[i][j];\n\t\t\t\tcsum[j] += cell[i][j];\n\t\t\t\tSystem.out.print(cell[i][j] + \" \");\n\t\t\t}\n\t\t\tSystem.out.println(rsum);\n\t\t}\n\t\tint sum = 0;\n\t\tfor (int i = 0; i < c; i++) {\n\t\t\tsum += csum[i];\n\t\t\tSystem.out.print(csum[i] + \" \");\n\t\t}\n\t\tSystem.out.println(sum);\n\n\t}",
"main",
"{\n\t\tScanner scanner = new Scanner(System.in);\n\t\t\n\t\tint r = scanner.nextInt();\n\t\tint c = scanner.nextInt();\n\t\t\n\t\tint[][] cell = new int[r][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\tcell[i][j] = scanner.nextInt();\n\t\t}\n\t\t\n\t\tint[] csum = new int[c];\n\t\t\n\t\tfor (int i = 0; i < r; i++) {\n\t\t\tint rsum = 0;\n\t\t\tfor (int j = 0; j < c; j++) {\n\t\t\t\trsum += cell[i][j];\n\t\t\t\tcsum[j] += cell[i][j];\n\t\t\t\tSystem.out.print(cell[i][j] + \" \");\n\t\t\t}\n\t\t\tSystem.out.println(rsum);\n\t\t}\n\t\tint sum = 0;\n\t\tfor (int i = 0; i < c; i++) {\n\t\t\tsum += csum[i];\n\t\t\tSystem.out.print(csum[i] + \" \");\n\t\t}\n\t\tSystem.out.println(sum);\n\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[][] cell = new int[r][c];",
"cell",
"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\tcell[i][j] = scanner.nextInt();\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] = scanner.nextInt();\n\t\t}",
"{\n\t\t\tfor (int j = 0; j < c; j++)\n\t\t\t\tcell[i][j] = scanner.nextInt();\n\t\t}",
"for (int j = 0; j < c; j++)\n\t\t\t\tcell[i][j] = scanner.nextInt();",
"int j = 0;",
"int j = 0;",
"j",
"0",
"j < c",
"j",
"c",
"j++",
"j++",
"j",
"cell[i][j] = scanner.nextInt();",
"cell[i][j] = scanner.nextInt()",
"cell[i][j]",
"cell[i]",
"cell",
"i",
"j",
"scanner.nextInt()",
"scanner.nextInt",
"scanner",
"int[] csum = new int[c];",
"csum",
"new int[c]",
"c",
"for (int i = 0; i < r; i++) {\n\t\t\tint rsum = 0;\n\t\t\tfor (int j = 0; j < c; j++) {\n\t\t\t\trsum += cell[i][j];\n\t\t\t\tcsum[j] += cell[i][j];\n\t\t\t\tSystem.out.print(cell[i][j] + \" \");\n\t\t\t}\n\t\t\tSystem.out.println(rsum);\n\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < r",
"i",
"r",
"i++",
"i++",
"i",
"{\n\t\t\tint rsum = 0;\n\t\t\tfor (int j = 0; j < c; j++) {\n\t\t\t\trsum += cell[i][j];\n\t\t\t\tcsum[j] += cell[i][j];\n\t\t\t\tSystem.out.print(cell[i][j] + \" \");\n\t\t\t}\n\t\t\tSystem.out.println(rsum);\n\t\t}",
"{\n\t\t\tint rsum = 0;\n\t\t\tfor (int j = 0; j < c; j++) {\n\t\t\t\trsum += cell[i][j];\n\t\t\t\tcsum[j] += cell[i][j];\n\t\t\t\tSystem.out.print(cell[i][j] + \" \");\n\t\t\t}\n\t\t\tSystem.out.println(rsum);\n\t\t}",
"int rsum = 0;",
"rsum",
"0",
"for (int j = 0; j < c; j++) {\n\t\t\t\trsum += cell[i][j];\n\t\t\t\tcsum[j] += cell[i][j];\n\t\t\t\tSystem.out.print(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\trsum += cell[i][j];\n\t\t\t\tcsum[j] += cell[i][j];\n\t\t\t\tSystem.out.print(cell[i][j] + \" \");\n\t\t\t}",
"{\n\t\t\t\trsum += cell[i][j];\n\t\t\t\tcsum[j] += cell[i][j];\n\t\t\t\tSystem.out.print(cell[i][j] + \" \");\n\t\t\t}",
"rsum += cell[i][j]",
"rsum",
"cell[i][j]",
"cell[i]",
"cell",
"i",
"j",
"csum[j] += cell[i][j]",
"csum[j]",
"csum",
"j",
"cell[i][j]",
"cell[i]",
"cell",
"i",
"j",
"System.out.print(cell[i][j] + \" \")",
"System.out.print",
"System.out",
"System",
"System.out",
"cell[i][j] + \" \"",
"cell[i][j]",
"cell[i]",
"cell",
"i",
"j",
"\" \"",
"System.out.println(rsum)",
"System.out.println",
"System.out",
"System",
"System.out",
"rsum",
"int sum = 0;",
"sum",
"0",
"for (int i = 0; i < c; i++) {\n\t\t\tsum += csum[i];\n\t\t\tSystem.out.print(csum[i] + \" \");\n\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < c",
"i",
"c",
"i++",
"i++",
"i",
"{\n\t\t\tsum += csum[i];\n\t\t\tSystem.out.print(csum[i] + \" \");\n\t\t}",
"{\n\t\t\tsum += csum[i];\n\t\t\tSystem.out.print(csum[i] + \" \");\n\t\t}",
"sum += csum[i]",
"sum",
"csum[i]",
"csum",
"i",
"System.out.print(csum[i] + \" \")",
"System.out.print",
"System.out",
"System",
"System.out",
"csum[i] + \" \"",
"csum[i]",
"csum",
"i",
"\" \"",
"System.out.println(sum)",
"System.out.println",
"System.out",
"System",
"System.out",
"sum",
"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();
int c = scanner.nextInt();
int[][] cell = new int[r][c];
for (int i = 0; i < r; i++) {
for (int j = 0; j < c; j++)
cell[i][j] = scanner.nextInt();
}
int[] csum = new int[c];
for (int i = 0; i < r; i++) {
int rsum = 0;
for (int j = 0; j < c; j++) {
rsum += cell[i][j];
csum[j] += cell[i][j];
System.out.print(cell[i][j] + " ");
}
System.out.println(rsum);
}
int sum = 0;
for (int i = 0; i < c; i++) {
sum += csum[i];
System.out.print(csum[i] + " ");
}
System.out.println(sum);
}
}
|
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
41,
13,
20,
40,
40,
13,
40,
40,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
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,
18,
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
],
[
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
],
[
26,
27
],
[
28,
29
],
[
29,
30
],
[
8,
31
],
[
31,
32
],
[
32,
33
],
[
33,
34
],
[
33,
35
],
[
31,
36
],
[
36,
37
],
[
36,
38
],
[
31,
39
],
[
39,
40
],
[
40,
41
],
[
31,
42
],
[
43,
43
],
[
43,
44
],
[
44,
45
],
[
45,
46
],
[
46,
47
],
[
46,
48
],
[
44,
49
],
[
49,
50
],
[
49,
51
],
[
44,
52
],
[
52,
53
],
[
53,
54
],
[
44,
55
],
[
56,
56
],
[
56,
57
],
[
57,
58
],
[
58,
59
],
[
59,
60
],
[
59,
61
],
[
58,
62
],
[
57,
63
],
[
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
],
[
114,
122
],
[
122,
123
],
[
123,
124
],
[
114,
125
],
[
126,
126
],
[
126,
127
],
[
127,
128
],
[
128,
129
],
[
129,
130
],
[
129,
131
],
[
127,
132
],
[
132,
133
],
[
133,
134
],
[
134,
135
],
[
134,
136
],
[
133,
137
],
[
132,
138
],
[
113,
139
],
[
139,
140
],
[
140,
141
],
[
141,
142
],
[
141,
143
],
[
139,
144
],
[
144,
145
],
[
145,
146
],
[
145,
147
],
[
144,
148
],
[
6,
149
],
[
149,
150
],
[
0,
151
],
[
151,
152
],
[
151,
153
]
] | [
"import java.util.*;\n\npublic class Main {\n public static void main(String[] args) {\n Scanner scn = new Scanner(System.in);\n int r = scn.nextInt(), c = scn.nextInt();\n int[][] fld = new int[-~r][-~c];\n for(int i = 0; i < r; i++) {\n for(int j = 0; j < c; j++) {\n fld[i][j] = scn.nextInt();\n fld[r][j] += fld[i][j];\n fld[i][c] += fld[i][j];\n fld[r][c] += fld[i][j];\n }\n }\n for(int i = 0; i < fld.length; i++) {\n for(int j = 0; j < c; j++) {\n System.out.print(fld[i][j] + \" \");\n }\n System.out.println(fld[i][c]);\n }\n }\n}",
"import java.util.*;",
"util.*",
"java",
"public class Main {\n public static void main(String[] args) {\n Scanner scn = new Scanner(System.in);\n int r = scn.nextInt(), c = scn.nextInt();\n int[][] fld = new int[-~r][-~c];\n for(int i = 0; i < r; i++) {\n for(int j = 0; j < c; j++) {\n fld[i][j] = scn.nextInt();\n fld[r][j] += fld[i][j];\n fld[i][c] += fld[i][j];\n fld[r][c] += fld[i][j];\n }\n }\n for(int i = 0; i < fld.length; i++) {\n for(int j = 0; j < c; j++) {\n System.out.print(fld[i][j] + \" \");\n }\n System.out.println(fld[i][c]);\n }\n }\n}",
"Main",
"public static void main(String[] args) {\n Scanner scn = new Scanner(System.in);\n int r = scn.nextInt(), c = scn.nextInt();\n int[][] fld = new int[-~r][-~c];\n for(int i = 0; i < r; i++) {\n for(int j = 0; j < c; j++) {\n fld[i][j] = scn.nextInt();\n fld[r][j] += fld[i][j];\n fld[i][c] += fld[i][j];\n fld[r][c] += fld[i][j];\n }\n }\n for(int i = 0; i < fld.length; i++) {\n for(int j = 0; j < c; j++) {\n System.out.print(fld[i][j] + \" \");\n }\n System.out.println(fld[i][c]);\n }\n }",
"main",
"{\n Scanner scn = new Scanner(System.in);\n int r = scn.nextInt(), c = scn.nextInt();\n int[][] fld = new int[-~r][-~c];\n for(int i = 0; i < r; i++) {\n for(int j = 0; j < c; j++) {\n fld[i][j] = scn.nextInt();\n fld[r][j] += fld[i][j];\n fld[i][c] += fld[i][j];\n fld[r][c] += fld[i][j];\n }\n }\n for(int i = 0; i < fld.length; i++) {\n for(int j = 0; j < c; j++) {\n System.out.print(fld[i][j] + \" \");\n }\n System.out.println(fld[i][c]);\n }\n }",
"Scanner scn = new Scanner(System.in);",
"scn",
"new Scanner(System.in)",
"int r = scn.nextInt()",
"r",
"scn.nextInt()",
"scn.nextInt",
"scn",
"c = scn.nextInt();",
"c",
"scn.nextInt()",
"scn.nextInt",
"scn",
"int[][] fld = new int[-~r][-~c];",
"fld",
"new int[-~r][-~c]",
"-~r",
"~r",
"r",
"-~c",
"~c",
"c",
"for(int i = 0; i < r; i++) {\n for(int j = 0; j < c; j++) {\n fld[i][j] = scn.nextInt();\n fld[r][j] += fld[i][j];\n fld[i][c] += fld[i][j];\n fld[r][c] += fld[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 fld[i][j] = scn.nextInt();\n fld[r][j] += fld[i][j];\n fld[i][c] += fld[i][j];\n fld[r][c] += fld[i][j];\n }\n }",
"{\n for(int j = 0; j < c; j++) {\n fld[i][j] = scn.nextInt();\n fld[r][j] += fld[i][j];\n fld[i][c] += fld[i][j];\n fld[r][c] += fld[i][j];\n }\n }",
"for(int j = 0; j < c; j++) {\n fld[i][j] = scn.nextInt();\n fld[r][j] += fld[i][j];\n fld[i][c] += fld[i][j];\n fld[r][c] += fld[i][j];\n }",
"int j = 0;",
"int j = 0;",
"j",
"0",
"j < c",
"j",
"c",
"j++",
"j++",
"j",
"{\n fld[i][j] = scn.nextInt();\n fld[r][j] += fld[i][j];\n fld[i][c] += fld[i][j];\n fld[r][c] += fld[i][j];\n }",
"{\n fld[i][j] = scn.nextInt();\n fld[r][j] += fld[i][j];\n fld[i][c] += fld[i][j];\n fld[r][c] += fld[i][j];\n }",
"fld[i][j] = scn.nextInt()",
"fld[i][j]",
"fld[i]",
"fld",
"i",
"j",
"scn.nextInt()",
"scn.nextInt",
"scn",
"fld[r][j] += fld[i][j]",
"fld[r][j]",
"fld[r]",
"fld",
"r",
"j",
"fld[i][j]",
"fld[i]",
"fld",
"i",
"j",
"fld[i][c] += fld[i][j]",
"fld[i][c]",
"fld[i]",
"fld",
"i",
"c",
"fld[i][j]",
"fld[i]",
"fld",
"i",
"j",
"fld[r][c] += fld[i][j]",
"fld[r][c]",
"fld[r]",
"fld",
"r",
"c",
"fld[i][j]",
"fld[i]",
"fld",
"i",
"j",
"for(int i = 0; i < fld.length; i++) {\n for(int j = 0; j < c; j++) {\n System.out.print(fld[i][j] + \" \");\n }\n System.out.println(fld[i][c]);\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < fld.length",
"i",
"fld.length",
"fld",
"fld.length",
"i++",
"i++",
"i",
"{\n for(int j = 0; j < c; j++) {\n System.out.print(fld[i][j] + \" \");\n }\n System.out.println(fld[i][c]);\n }",
"{\n for(int j = 0; j < c; j++) {\n System.out.print(fld[i][j] + \" \");\n }\n System.out.println(fld[i][c]);\n }",
"for(int j = 0; j < c; j++) {\n System.out.print(fld[i][j] + \" \");\n }",
"int j = 0;",
"int j = 0;",
"j",
"0",
"j < c",
"j",
"c",
"j++",
"j++",
"j",
"{\n System.out.print(fld[i][j] + \" \");\n }",
"{\n System.out.print(fld[i][j] + \" \");\n }",
"System.out.print(fld[i][j] + \" \")",
"System.out.print",
"System.out",
"System",
"System.out",
"fld[i][j] + \" \"",
"fld[i][j]",
"fld[i]",
"fld",
"i",
"j",
"\" \"",
"System.out.println(fld[i][c])",
"System.out.println",
"System.out",
"System",
"System.out",
"fld[i][c]",
"fld[i]",
"fld",
"i",
"c",
"String[] args",
"args",
"public class Main {\n public static void main(String[] args) {\n Scanner scn = new Scanner(System.in);\n int r = scn.nextInt(), c = scn.nextInt();\n int[][] fld = new int[-~r][-~c];\n for(int i = 0; i < r; i++) {\n for(int j = 0; j < c; j++) {\n fld[i][j] = scn.nextInt();\n fld[r][j] += fld[i][j];\n fld[i][c] += fld[i][j];\n fld[r][c] += fld[i][j];\n }\n }\n for(int i = 0; i < fld.length; i++) {\n for(int j = 0; j < c; j++) {\n System.out.print(fld[i][j] + \" \");\n }\n System.out.println(fld[i][c]);\n }\n }\n}",
"public class Main {\n public static void main(String[] args) {\n Scanner scn = new Scanner(System.in);\n int r = scn.nextInt(), c = scn.nextInt();\n int[][] fld = new int[-~r][-~c];\n for(int i = 0; i < r; i++) {\n for(int j = 0; j < c; j++) {\n fld[i][j] = scn.nextInt();\n fld[r][j] += fld[i][j];\n fld[i][c] += fld[i][j];\n fld[r][c] += fld[i][j];\n }\n }\n for(int i = 0; i < fld.length; i++) {\n for(int j = 0; j < c; j++) {\n System.out.print(fld[i][j] + \" \");\n }\n System.out.println(fld[i][c]);\n }\n }\n}",
"Main"
] | import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner scn = new Scanner(System.in);
int r = scn.nextInt(), c = scn.nextInt();
int[][] fld = new int[-~r][-~c];
for(int i = 0; i < r; i++) {
for(int j = 0; j < c; j++) {
fld[i][j] = scn.nextInt();
fld[r][j] += fld[i][j];
fld[i][c] += fld[i][j];
fld[r][c] += fld[i][j];
}
}
for(int i = 0; i < fld.length; i++) {
for(int j = 0; j < c; j++) {
System.out.print(fld[i][j] + " ");
}
System.out.println(fld[i][c]);
}
}
} |
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
41,
13,
41,
13,
0,
13,
4,
18,
13,
4,
18,
13,
0,
13,
4,
18,
13,
4,
18,
13,
0,
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,
11,
1,
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,
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,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
210,
5
],
[
210,
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
],
[
20,
23
],
[
23,
24
],
[
24,
25
],
[
8,
26
],
[
26,
27
],
[
26,
28
],
[
28,
29
],
[
29,
30
],
[
28,
31
],
[
31,
32
],
[
32,
33
],
[
8,
34
],
[
34,
35
],
[
34,
36
],
[
37,
38
],
[
37,
39
],
[
40,
41
],
[
40,
42
],
[
8,
43
],
[
43,
44
],
[
44,
45
],
[
45,
46
],
[
45,
47
],
[
43,
48
],
[
48,
49
],
[
48,
50
],
[
50,
51
],
[
50,
52
],
[
43,
53
],
[
53,
54
],
[
54,
55
],
[
43,
56
],
[
57,
57
],
[
57,
58
],
[
58,
59
],
[
59,
60
],
[
60,
61
],
[
60,
62
],
[
58,
63
],
[
63,
64
],
[
63,
65
],
[
65,
66
],
[
65,
67
],
[
58,
68
],
[
68,
69
],
[
69,
70
],
[
58,
71
],
[
72,
72
],
[
72,
73
],
[
73,
74
],
[
74,
75
],
[
75,
76
],
[
75,
77
],
[
74,
78
],
[
73,
79
],
[
8,
80
],
[
80,
81
],
[
81,
82
],
[
82,
83
],
[
82,
84
],
[
80,
85
],
[
85,
86
],
[
85,
87
],
[
80,
88
],
[
88,
89
],
[
89,
90
],
[
80,
91
],
[
92,
92
],
[
92,
93
],
[
93,
94
],
[
94,
95
],
[
95,
96
],
[
95,
97
],
[
93,
98
],
[
98,
99
],
[
98,
100
],
[
93,
101
],
[
101,
102
],
[
102,
103
],
[
93,
104
],
[
105,
105
],
[
105,
106
],
[
106,
107
],
[
107,
108
],
[
108,
109
],
[
108,
110
],
[
107,
111
],
[
106,
112
],
[
112,
113
],
[
113,
114
],
[
112,
115
],
[
115,
116
],
[
116,
117
],
[
105,
118
],
[
118,
119
],
[
119,
120
],
[
120,
121
],
[
120,
122
],
[
119,
123
],
[
118,
124
],
[
124,
125
],
[
125,
126
],
[
125,
127
],
[
124,
128
],
[
105,
129
],
[
129,
130
],
[
130,
131
],
[
131,
132
],
[
131,
133
],
[
130,
134
],
[
129,
135
],
[
135,
136
],
[
136,
137
],
[
136,
138
],
[
135,
139
],
[
105,
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
],
[
197,
199
],
[
195,
200
],
[
165,
201
],
[
201,
202
],
[
202,
203
],
[
203,
204
],
[
203,
205
],
[
201,
206
],
[
6,
207
],
[
207,
208
],
[
0,
209
],
[
209,
210
],
[
209,
211
]
] | [
"import java.util.Scanner;\n\npublic class Main {\n\n public static void main(String[] args) {\n Scanner scan = new Scanner(System.in);\n int inR, inC;\n int[][] spd;\n\n inR = Integer.parseInt(scan.next());\n inC = Integer.parseInt(scan.next());\n\n spd = new int[inR + 1][inC + 1];\n\n for (int i = 0; i < inR + 1; i++) {\n for (int j = 0; j < inC + 1; j++) {\n spd[i][j] = 0;\n }\n }\n\n\n for (int i = 0; i < inR; i++) {\n for (int j = 0; j < inC; j++) {\n spd[i][j] = Integer.parseInt(scan.next());\n spd[inR][j] += spd[i][j];\n spd[i][inC] += spd[i][j];\n spd[inR][inC] += spd[i][j];\n }\n }\n for (int i = 0; i < inR + 1; i++) {\n for (int j = 0; j < inC + 1; j++) {\n System.out.print(spd[i][j]);\n if (j != inC) System.out.print(\" \");\n }\n System.out.print(\"\\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 scan = new Scanner(System.in);\n int inR, inC;\n int[][] spd;\n\n inR = Integer.parseInt(scan.next());\n inC = Integer.parseInt(scan.next());\n\n spd = new int[inR + 1][inC + 1];\n\n for (int i = 0; i < inR + 1; i++) {\n for (int j = 0; j < inC + 1; j++) {\n spd[i][j] = 0;\n }\n }\n\n\n for (int i = 0; i < inR; i++) {\n for (int j = 0; j < inC; j++) {\n spd[i][j] = Integer.parseInt(scan.next());\n spd[inR][j] += spd[i][j];\n spd[i][inC] += spd[i][j];\n spd[inR][inC] += spd[i][j];\n }\n }\n for (int i = 0; i < inR + 1; i++) {\n for (int j = 0; j < inC + 1; j++) {\n System.out.print(spd[i][j]);\n if (j != inC) System.out.print(\" \");\n }\n System.out.print(\"\\n\");\n }\n }\n}",
"Main",
"public static void main(String[] args) {\n Scanner scan = new Scanner(System.in);\n int inR, inC;\n int[][] spd;\n\n inR = Integer.parseInt(scan.next());\n inC = Integer.parseInt(scan.next());\n\n spd = new int[inR + 1][inC + 1];\n\n for (int i = 0; i < inR + 1; i++) {\n for (int j = 0; j < inC + 1; j++) {\n spd[i][j] = 0;\n }\n }\n\n\n for (int i = 0; i < inR; i++) {\n for (int j = 0; j < inC; j++) {\n spd[i][j] = Integer.parseInt(scan.next());\n spd[inR][j] += spd[i][j];\n spd[i][inC] += spd[i][j];\n spd[inR][inC] += spd[i][j];\n }\n }\n for (int i = 0; i < inR + 1; i++) {\n for (int j = 0; j < inC + 1; j++) {\n System.out.print(spd[i][j]);\n if (j != inC) System.out.print(\" \");\n }\n System.out.print(\"\\n\");\n }\n }",
"main",
"{\n Scanner scan = new Scanner(System.in);\n int inR, inC;\n int[][] spd;\n\n inR = Integer.parseInt(scan.next());\n inC = Integer.parseInt(scan.next());\n\n spd = new int[inR + 1][inC + 1];\n\n for (int i = 0; i < inR + 1; i++) {\n for (int j = 0; j < inC + 1; j++) {\n spd[i][j] = 0;\n }\n }\n\n\n for (int i = 0; i < inR; i++) {\n for (int j = 0; j < inC; j++) {\n spd[i][j] = Integer.parseInt(scan.next());\n spd[inR][j] += spd[i][j];\n spd[i][inC] += spd[i][j];\n spd[inR][inC] += spd[i][j];\n }\n }\n for (int i = 0; i < inR + 1; i++) {\n for (int j = 0; j < inC + 1; j++) {\n System.out.print(spd[i][j]);\n if (j != inC) System.out.print(\" \");\n }\n System.out.print(\"\\n\");\n }\n }",
"Scanner scan = new Scanner(System.in);",
"scan",
"new Scanner(System.in)",
"int inR",
"inR",
"inC;",
"inC",
"int[][] spd;",
"spd",
"inR = Integer.parseInt(scan.next())",
"inR",
"Integer.parseInt(scan.next())",
"Integer.parseInt",
"Integer",
"scan.next()",
"scan.next",
"scan",
"inC = Integer.parseInt(scan.next())",
"inC",
"Integer.parseInt(scan.next())",
"Integer.parseInt",
"Integer",
"scan.next()",
"scan.next",
"scan",
"spd = new int[inR + 1][inC + 1]",
"spd",
"new int[inR + 1][inC + 1]",
"inR + 1",
"inR",
"1",
"inC + 1",
"inC",
"1",
"for (int i = 0; i < inR + 1; i++) {\n for (int j = 0; j < inC + 1; j++) {\n spd[i][j] = 0;\n }\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < inR + 1",
"i",
"inR + 1",
"inR",
"1",
"i++",
"i++",
"i",
"{\n for (int j = 0; j < inC + 1; j++) {\n spd[i][j] = 0;\n }\n }",
"{\n for (int j = 0; j < inC + 1; j++) {\n spd[i][j] = 0;\n }\n }",
"for (int j = 0; j < inC + 1; j++) {\n spd[i][j] = 0;\n }",
"int j = 0;",
"int j = 0;",
"j",
"0",
"j < inC + 1",
"j",
"inC + 1",
"inC",
"1",
"j++",
"j++",
"j",
"{\n spd[i][j] = 0;\n }",
"{\n spd[i][j] = 0;\n }",
"spd[i][j] = 0",
"spd[i][j]",
"spd[i]",
"spd",
"i",
"j",
"0",
"for (int i = 0; i < inR; i++) {\n for (int j = 0; j < inC; j++) {\n spd[i][j] = Integer.parseInt(scan.next());\n spd[inR][j] += spd[i][j];\n spd[i][inC] += spd[i][j];\n spd[inR][inC] += spd[i][j];\n }\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < inR",
"i",
"inR",
"i++",
"i++",
"i",
"{\n for (int j = 0; j < inC; j++) {\n spd[i][j] = Integer.parseInt(scan.next());\n spd[inR][j] += spd[i][j];\n spd[i][inC] += spd[i][j];\n spd[inR][inC] += spd[i][j];\n }\n }",
"{\n for (int j = 0; j < inC; j++) {\n spd[i][j] = Integer.parseInt(scan.next());\n spd[inR][j] += spd[i][j];\n spd[i][inC] += spd[i][j];\n spd[inR][inC] += spd[i][j];\n }\n }",
"for (int j = 0; j < inC; j++) {\n spd[i][j] = Integer.parseInt(scan.next());\n spd[inR][j] += spd[i][j];\n spd[i][inC] += spd[i][j];\n spd[inR][inC] += spd[i][j];\n }",
"int j = 0;",
"int j = 0;",
"j",
"0",
"j < inC",
"j",
"inC",
"j++",
"j++",
"j",
"{\n spd[i][j] = Integer.parseInt(scan.next());\n spd[inR][j] += spd[i][j];\n spd[i][inC] += spd[i][j];\n spd[inR][inC] += spd[i][j];\n }",
"{\n spd[i][j] = Integer.parseInt(scan.next());\n spd[inR][j] += spd[i][j];\n spd[i][inC] += spd[i][j];\n spd[inR][inC] += spd[i][j];\n }",
"spd[i][j] = Integer.parseInt(scan.next())",
"spd[i][j]",
"spd[i]",
"spd",
"i",
"j",
"Integer.parseInt(scan.next())",
"Integer.parseInt",
"Integer",
"scan.next()",
"scan.next",
"scan",
"spd[inR][j] += spd[i][j]",
"spd[inR][j]",
"spd[inR]",
"spd",
"inR",
"j",
"spd[i][j]",
"spd[i]",
"spd",
"i",
"j",
"spd[i][inC] += spd[i][j]",
"spd[i][inC]",
"spd[i]",
"spd",
"i",
"inC",
"spd[i][j]",
"spd[i]",
"spd",
"i",
"j",
"spd[inR][inC] += spd[i][j]",
"spd[inR][inC]",
"spd[inR]",
"spd",
"inR",
"inC",
"spd[i][j]",
"spd[i]",
"spd",
"i",
"j",
"for (int i = 0; i < inR + 1; i++) {\n for (int j = 0; j < inC + 1; j++) {\n System.out.print(spd[i][j]);\n if (j != inC) System.out.print(\" \");\n }\n System.out.print(\"\\n\");\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < inR + 1",
"i",
"inR + 1",
"inR",
"1",
"i++",
"i++",
"i",
"{\n for (int j = 0; j < inC + 1; j++) {\n System.out.print(spd[i][j]);\n if (j != inC) System.out.print(\" \");\n }\n System.out.print(\"\\n\");\n }",
"{\n for (int j = 0; j < inC + 1; j++) {\n System.out.print(spd[i][j]);\n if (j != inC) System.out.print(\" \");\n }\n System.out.print(\"\\n\");\n }",
"for (int j = 0; j < inC + 1; j++) {\n System.out.print(spd[i][j]);\n if (j != inC) System.out.print(\" \");\n }",
"int j = 0;",
"int j = 0;",
"j",
"0",
"j < inC + 1",
"j",
"inC + 1",
"inC",
"1",
"j++",
"j++",
"j",
"{\n System.out.print(spd[i][j]);\n if (j != inC) System.out.print(\" \");\n }",
"{\n System.out.print(spd[i][j]);\n if (j != inC) System.out.print(\" \");\n }",
"System.out.print(spd[i][j])",
"System.out.print",
"System.out",
"System",
"System.out",
"spd[i][j]",
"spd[i]",
"spd",
"i",
"j",
"if (j != inC) System.out.print(\" \");",
"j != inC",
"j",
"inC",
"System.out.print(\" \")",
"System.out.print",
"System.out",
"System",
"System.out",
"\" \"",
"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) {\n Scanner scan = new Scanner(System.in);\n int inR, inC;\n int[][] spd;\n\n inR = Integer.parseInt(scan.next());\n inC = Integer.parseInt(scan.next());\n\n spd = new int[inR + 1][inC + 1];\n\n for (int i = 0; i < inR + 1; i++) {\n for (int j = 0; j < inC + 1; j++) {\n spd[i][j] = 0;\n }\n }\n\n\n for (int i = 0; i < inR; i++) {\n for (int j = 0; j < inC; j++) {\n spd[i][j] = Integer.parseInt(scan.next());\n spd[inR][j] += spd[i][j];\n spd[i][inC] += spd[i][j];\n spd[inR][inC] += spd[i][j];\n }\n }\n for (int i = 0; i < inR + 1; i++) {\n for (int j = 0; j < inC + 1; j++) {\n System.out.print(spd[i][j]);\n if (j != inC) System.out.print(\" \");\n }\n System.out.print(\"\\n\");\n }\n }\n}",
"public class Main {\n\n public static void main(String[] args) {\n Scanner scan = new Scanner(System.in);\n int inR, inC;\n int[][] spd;\n\n inR = Integer.parseInt(scan.next());\n inC = Integer.parseInt(scan.next());\n\n spd = new int[inR + 1][inC + 1];\n\n for (int i = 0; i < inR + 1; i++) {\n for (int j = 0; j < inC + 1; j++) {\n spd[i][j] = 0;\n }\n }\n\n\n for (int i = 0; i < inR; i++) {\n for (int j = 0; j < inC; j++) {\n spd[i][j] = Integer.parseInt(scan.next());\n spd[inR][j] += spd[i][j];\n spd[i][inC] += spd[i][j];\n spd[inR][inC] += spd[i][j];\n }\n }\n for (int i = 0; i < inR + 1; i++) {\n for (int j = 0; j < inC + 1; j++) {\n System.out.print(spd[i][j]);\n if (j != inC) System.out.print(\" \");\n }\n System.out.print(\"\\n\");\n }\n }\n}",
"Main"
] | import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
int inR, inC;
int[][] spd;
inR = Integer.parseInt(scan.next());
inC = Integer.parseInt(scan.next());
spd = new int[inR + 1][inC + 1];
for (int i = 0; i < inR + 1; i++) {
for (int j = 0; j < inC + 1; j++) {
spd[i][j] = 0;
}
}
for (int i = 0; i < inR; i++) {
for (int j = 0; j < inC; j++) {
spd[i][j] = Integer.parseInt(scan.next());
spd[inR][j] += spd[i][j];
spd[i][inC] += spd[i][j];
spd[inR][inC] += spd[i][j];
}
}
for (int i = 0; i < inR + 1; i++) {
for (int j = 0; j < inC + 1; j++) {
System.out.print(spd[i][j]);
if (j != inC) System.out.print(" ");
}
System.out.print("\n");
}
}
}
|
[
7,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
20,
17,
17,
41,
13,
4,
18,
13,
41,
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,
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,
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,
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,
14,
2,
13,
13,
30,
4,
18,
18,
13,
13,
2,
18,
18,
13,
13,
13,
13,
30,
4,
18,
18,
13,
13,
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
],
[
191,
8
],
[
191,
9
],
[
9,
10
],
[
9,
11
],
[
11,
12
],
[
12,
13
],
[
12,
14
],
[
11,
15
],
[
15,
16
],
[
15,
17
],
[
11,
20
],
[
20,
21
],
[
20,
22
],
[
22,
23
],
[
23,
24
],
[
11,
25
],
[
25,
26
],
[
25,
27
],
[
27,
28
],
[
28,
29
],
[
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
],
[
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
],
[
68,
70
],
[
70,
71
],
[
71,
72
],
[
71,
73
],
[
70,
74
],
[
42,
75
],
[
75,
76
],
[
76,
77
],
[
77,
78
],
[
77,
79
],
[
76,
80
],
[
75,
81
],
[
11,
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
],
[
94,
118
],
[
118,
119
],
[
119,
120
],
[
120,
121
],
[
120,
122
],
[
119,
123
],
[
118,
124
],
[
11,
125
],
[
125,
126
],
[
125,
127
],
[
11,
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
],
[
161,
162
],
[
161,
163
],
[
159,
164
],
[
164,
165
],
[
165,
166
],
[
166,
167
],
[
166,
168
],
[
165,
169
],
[
164,
170
],
[
154,
171
],
[
171,
172
],
[
172,
173
],
[
173,
174
],
[
174,
175
],
[
174,
176
],
[
172,
177
],
[
177,
178
],
[
178,
179
],
[
178,
180
],
[
177,
181
],
[
140,
182
],
[
182,
183
],
[
183,
184
],
[
184,
185
],
[
184,
186
],
[
182,
187
],
[
9,
188
],
[
188,
189
],
[
0,
190
],
[
190,
191
],
[
190,
192
]
] | [
"import java.io.IOException;\nimport java.util.Scanner;\n\npublic class Main {\n\n\tpublic static void main(String[] args) throws IOException {\n\n\t\tScanner sc = new Scanner(System.in);\n\t\tint[][] list = new int [101][101];\n\t\tint r = sc.nextInt();\n\t\tint c = sc.nextInt();\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\tlist[i][j] = sc.nextInt();\n\t\t\t\tsum += list[i][j];\n\t\t\t}\n\t\t\tlist[i][c] = sum;\n \t\t}\n\n\t\tfor (int i = 0; i <= c; i++) {\n\t\t\tint sum = 0;\n\t\t\tfor (int j = 0; j < r; j++) {\n\t\t\t\tsum += list[j][i];\n\t\t\t}\n\t\t\tlist[r][i] = sum;\n\t\t}\n\n\t\tString space = \" \";\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(list[i][j] + space);\n\t\t\t\t} else {\n\t\t\t\t\tSystem.out.print(list[i][j]);\n\t\t\t\t}\n\t\t\t}\n\t\t\tSystem.out.println(\"\");\n\t\t}\n\t}\n}",
"import java.io.IOException;",
"IOException",
"java.io",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n\n\tpublic static void main(String[] args) throws IOException {\n\n\t\tScanner sc = new Scanner(System.in);\n\t\tint[][] list = new int [101][101];\n\t\tint r = sc.nextInt();\n\t\tint c = sc.nextInt();\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\tlist[i][j] = sc.nextInt();\n\t\t\t\tsum += list[i][j];\n\t\t\t}\n\t\t\tlist[i][c] = sum;\n \t\t}\n\n\t\tfor (int i = 0; i <= c; i++) {\n\t\t\tint sum = 0;\n\t\t\tfor (int j = 0; j < r; j++) {\n\t\t\t\tsum += list[j][i];\n\t\t\t}\n\t\t\tlist[r][i] = sum;\n\t\t}\n\n\t\tString space = \" \";\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(list[i][j] + space);\n\t\t\t\t} else {\n\t\t\t\t\tSystem.out.print(list[i][j]);\n\t\t\t\t}\n\t\t\t}\n\t\t\tSystem.out.println(\"\");\n\t\t}\n\t}\n}",
"Main",
"public static void main(String[] args) throws IOException {\n\n\t\tScanner sc = new Scanner(System.in);\n\t\tint[][] list = new int [101][101];\n\t\tint r = sc.nextInt();\n\t\tint c = sc.nextInt();\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\tlist[i][j] = sc.nextInt();\n\t\t\t\tsum += list[i][j];\n\t\t\t}\n\t\t\tlist[i][c] = sum;\n \t\t}\n\n\t\tfor (int i = 0; i <= c; i++) {\n\t\t\tint sum = 0;\n\t\t\tfor (int j = 0; j < r; j++) {\n\t\t\t\tsum += list[j][i];\n\t\t\t}\n\t\t\tlist[r][i] = sum;\n\t\t}\n\n\t\tString space = \" \";\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(list[i][j] + space);\n\t\t\t\t} else {\n\t\t\t\t\tSystem.out.print(list[i][j]);\n\t\t\t\t}\n\t\t\t}\n\t\t\tSystem.out.println(\"\");\n\t\t}\n\t}",
"main",
"{\n\n\t\tScanner sc = new Scanner(System.in);\n\t\tint[][] list = new int [101][101];\n\t\tint r = sc.nextInt();\n\t\tint c = sc.nextInt();\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\tlist[i][j] = sc.nextInt();\n\t\t\t\tsum += list[i][j];\n\t\t\t}\n\t\t\tlist[i][c] = sum;\n \t\t}\n\n\t\tfor (int i = 0; i <= c; i++) {\n\t\t\tint sum = 0;\n\t\t\tfor (int j = 0; j < r; j++) {\n\t\t\t\tsum += list[j][i];\n\t\t\t}\n\t\t\tlist[r][i] = sum;\n\t\t}\n\n\t\tString space = \" \";\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(list[i][j] + space);\n\t\t\t\t} else {\n\t\t\t\t\tSystem.out.print(list[i][j]);\n\t\t\t\t}\n\t\t\t}\n\t\t\tSystem.out.println(\"\");\n\t\t}\n\t}",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"int[][] list = new int [101][101];",
"list",
"new int [101][101]",
"101",
"101",
"int r = sc.nextInt();",
"r",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int c = sc.nextInt();",
"c",
"sc.nextInt()",
"sc.nextInt",
"sc",
"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\tlist[i][j] = sc.nextInt();\n\t\t\t\tsum += list[i][j];\n\t\t\t}\n\t\t\tlist[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\tlist[i][j] = sc.nextInt();\n\t\t\t\tsum += list[i][j];\n\t\t\t}\n\t\t\tlist[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\tlist[i][j] = sc.nextInt();\n\t\t\t\tsum += list[i][j];\n\t\t\t}\n\t\t\tlist[i][c] = sum;\n \t\t}",
"int sum = 0;",
"sum",
"0",
"for (int j = 0; j < c; j++) {\n\t\t\t\tlist[i][j] = sc.nextInt();\n\t\t\t\tsum += list[i][j];\n\t\t\t}",
"int j = 0;",
"int j = 0;",
"j",
"0",
"j < c",
"j",
"c",
"j++",
"j++",
"j",
"{\n\t\t\t\tlist[i][j] = sc.nextInt();\n\t\t\t\tsum += list[i][j];\n\t\t\t}",
"{\n\t\t\t\tlist[i][j] = sc.nextInt();\n\t\t\t\tsum += list[i][j];\n\t\t\t}",
"list[i][j] = sc.nextInt()",
"list[i][j]",
"list[i]",
"list",
"i",
"j",
"sc.nextInt()",
"sc.nextInt",
"sc",
"sum += list[i][j]",
"sum",
"list[i][j]",
"list[i]",
"list",
"i",
"j",
"list[i][c] = sum",
"list[i][c]",
"list[i]",
"list",
"i",
"c",
"sum",
"for (int i = 0; i <= c; i++) {\n\t\t\tint sum = 0;\n\t\t\tfor (int j = 0; j < r; j++) {\n\t\t\t\tsum += list[j][i];\n\t\t\t}\n\t\t\tlist[r][i] = sum;\n\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i <= c",
"i",
"c",
"i++",
"i++",
"i",
"{\n\t\t\tint sum = 0;\n\t\t\tfor (int j = 0; j < r; j++) {\n\t\t\t\tsum += list[j][i];\n\t\t\t}\n\t\t\tlist[r][i] = 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 += list[j][i];\n\t\t\t}\n\t\t\tlist[r][i] = sum;\n\t\t}",
"int sum = 0;",
"sum",
"0",
"for (int j = 0; j < r; j++) {\n\t\t\t\tsum += list[j][i];\n\t\t\t}",
"int j = 0;",
"int j = 0;",
"j",
"0",
"j < r",
"j",
"r",
"j++",
"j++",
"j",
"{\n\t\t\t\tsum += list[j][i];\n\t\t\t}",
"{\n\t\t\t\tsum += list[j][i];\n\t\t\t}",
"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 space = \" \";",
"space",
"\" \"",
"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(list[i][j] + space);\n\t\t\t\t} else {\n\t\t\t\t\tSystem.out.print(list[i][j]);\n\t\t\t\t}\n\t\t\t}\n\t\t\tSystem.out.println(\"\");\n\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i <= r",
"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(list[i][j] + space);\n\t\t\t\t} else {\n\t\t\t\t\tSystem.out.print(list[i][j]);\n\t\t\t\t}\n\t\t\t}\n\t\t\tSystem.out.println(\"\");\n\t\t}",
"{\n\t\t\tfor (int j = 0; j <= c; j++) {\n\t\t\t\tif (j < c) {\n\t\t\t\t\tSystem.out.print(list[i][j] + space);\n\t\t\t\t} else {\n\t\t\t\t\tSystem.out.print(list[i][j]);\n\t\t\t\t}\n\t\t\t}\n\t\t\tSystem.out.println(\"\");\n\t\t}",
"for (int j = 0; j <= c; j++) {\n\t\t\t\tif (j < c) {\n\t\t\t\t\tSystem.out.print(list[i][j] + space);\n\t\t\t\t} else {\n\t\t\t\t\tSystem.out.print(list[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(list[i][j] + space);\n\t\t\t\t} else {\n\t\t\t\t\tSystem.out.print(list[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(list[i][j] + space);\n\t\t\t\t} else {\n\t\t\t\t\tSystem.out.print(list[i][j]);\n\t\t\t\t}\n\t\t\t}",
"if (j < c) {\n\t\t\t\t\tSystem.out.print(list[i][j] + space);\n\t\t\t\t} else {\n\t\t\t\t\tSystem.out.print(list[i][j]);\n\t\t\t\t}",
"j < c",
"j",
"c",
"{\n\t\t\t\t\tSystem.out.print(list[i][j] + space);\n\t\t\t\t}",
"System.out.print(list[i][j] + space)",
"System.out.print",
"System.out",
"System",
"System.out",
"list[i][j] + space",
"list[i][j]",
"list[i]",
"list",
"i",
"j",
"space",
"{\n\t\t\t\t\tSystem.out.print(list[i][j]);\n\t\t\t\t}",
"System.out.print(list[i][j])",
"System.out.print",
"System.out",
"System",
"System.out",
"list[i][j]",
"list[i]",
"list",
"i",
"j",
"System.out.println(\"\")",
"System.out.println",
"System.out",
"System",
"System.out",
"\"\"",
"String[] args",
"args",
"public class Main {\n\n\tpublic static void main(String[] args) throws IOException {\n\n\t\tScanner sc = new Scanner(System.in);\n\t\tint[][] list = new int [101][101];\n\t\tint r = sc.nextInt();\n\t\tint c = sc.nextInt();\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\tlist[i][j] = sc.nextInt();\n\t\t\t\tsum += list[i][j];\n\t\t\t}\n\t\t\tlist[i][c] = sum;\n \t\t}\n\n\t\tfor (int i = 0; i <= c; i++) {\n\t\t\tint sum = 0;\n\t\t\tfor (int j = 0; j < r; j++) {\n\t\t\t\tsum += list[j][i];\n\t\t\t}\n\t\t\tlist[r][i] = sum;\n\t\t}\n\n\t\tString space = \" \";\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(list[i][j] + space);\n\t\t\t\t} else {\n\t\t\t\t\tSystem.out.print(list[i][j]);\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) throws IOException {\n\n\t\tScanner sc = new Scanner(System.in);\n\t\tint[][] list = new int [101][101];\n\t\tint r = sc.nextInt();\n\t\tint c = sc.nextInt();\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\tlist[i][j] = sc.nextInt();\n\t\t\t\tsum += list[i][j];\n\t\t\t}\n\t\t\tlist[i][c] = sum;\n \t\t}\n\n\t\tfor (int i = 0; i <= c; i++) {\n\t\t\tint sum = 0;\n\t\t\tfor (int j = 0; j < r; j++) {\n\t\t\t\tsum += list[j][i];\n\t\t\t}\n\t\t\tlist[r][i] = sum;\n\t\t}\n\n\t\tString space = \" \";\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(list[i][j] + space);\n\t\t\t\t} else {\n\t\t\t\t\tSystem.out.print(list[i][j]);\n\t\t\t\t}\n\t\t\t}\n\t\t\tSystem.out.println(\"\");\n\t\t}\n\t}\n}",
"Main"
] | import java.io.IOException;
import java.util.Scanner;
public class Main {
public static void main(String[] args) throws IOException {
Scanner sc = new Scanner(System.in);
int[][] list = new int [101][101];
int r = sc.nextInt();
int c = sc.nextInt();
for (int i =0; i < r; i++) {
int sum = 0;
for (int j = 0; j < c; j++) {
list[i][j] = sc.nextInt();
sum += list[i][j];
}
list[i][c] = sum;
}
for (int i = 0; i <= c; i++) {
int sum = 0;
for (int j = 0; j < r; j++) {
sum += list[j][i];
}
list[r][i] = sum;
}
String space = " ";
for (int i = 0; i <= r; i++) {
for (int j = 0; j <= c; j++) {
if (j < c) {
System.out.print(list[i][j] + space);
} else {
System.out.print(list[i][j]);
}
}
System.out.println("");
}
}
} |
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
20,
17,
17,
41,
13,
20,
17,
41,
13,
20,
17,
41,
13,
17,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
18,
13,
13,
17,
0,
18,
13,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
18,
18,
13,
13,
13,
4,
18,
13,
0,
18,
13,
13,
18,
18,
13,
13,
13,
0,
18,
13,
13,
18,
18,
13,
13,
13,
0,
13,
18,
18,
13,
13,
13,
11,
1,
41,
13,
17,
2,
13,
2,
13,
17,
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,
4,
18,
18,
13,
13,
17,
14,
2,
13,
2,
13,
17,
4,
18,
18,
13,
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
],
[
8,
17
],
[
17,
18
],
[
17,
19
],
[
8,
21
],
[
21,
22
],
[
21,
23
],
[
8,
25
],
[
25,
26
],
[
25,
27
],
[
8,
28
],
[
28,
29
],
[
28,
30
],
[
30,
31
],
[
31,
32
],
[
8,
33
],
[
33,
34
],
[
33,
35
],
[
35,
36
],
[
36,
37
],
[
8,
38
],
[
38,
39
],
[
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
],
[
52,
54
],
[
51,
55
],
[
50,
56
],
[
56,
57
],
[
57,
58
],
[
57,
59
],
[
56,
60
],
[
8,
61
],
[
61,
62
],
[
62,
63
],
[
63,
64
],
[
63,
65
],
[
61,
66
],
[
66,
67
],
[
66,
68
],
[
61,
69
],
[
69,
70
],
[
70,
71
],
[
61,
72
],
[
73,
73
],
[
73,
74
],
[
74,
75
],
[
75,
76
],
[
76,
77
],
[
76,
78
],
[
74,
79
],
[
79,
80
],
[
79,
81
],
[
74,
82
],
[
82,
83
],
[
83,
84
],
[
74,
85
],
[
86,
86
],
[
86,
87
],
[
87,
88
],
[
88,
89
],
[
89,
90
],
[
89,
91
],
[
88,
92
],
[
87,
93
],
[
93,
94
],
[
94,
95
],
[
86,
96
],
[
96,
97
],
[
97,
98
],
[
97,
99
],
[
96,
100
],
[
100,
101
],
[
101,
102
],
[
101,
103
],
[
100,
104
],
[
86,
105
],
[
105,
106
],
[
106,
107
],
[
106,
108
],
[
105,
109
],
[
109,
110
],
[
110,
111
],
[
110,
112
],
[
109,
113
],
[
86,
114
],
[
114,
115
],
[
114,
116
],
[
116,
117
],
[
117,
118
],
[
117,
119
],
[
116,
120
],
[
8,
121
],
[
121,
122
],
[
122,
123
],
[
123,
124
],
[
123,
125
],
[
121,
126
],
[
126,
127
],
[
126,
128
],
[
128,
129
],
[
128,
130
],
[
121,
131
],
[
131,
132
],
[
132,
133
],
[
121,
134
],
[
135,
135
],
[
135,
136
],
[
136,
137
],
[
137,
138
],
[
138,
139
],
[
138,
140
],
[
136,
141
],
[
141,
142
],
[
141,
143
],
[
136,
144
],
[
144,
145
],
[
145,
146
],
[
136,
147
],
[
148,
148
],
[
148,
149
],
[
149,
150
],
[
150,
151
],
[
150,
152
],
[
149,
153
],
[
153,
154
],
[
154,
155
],
[
155,
156
],
[
156,
157
],
[
156,
158
],
[
154,
159
],
[
159,
160
],
[
160,
161
],
[
160,
162
],
[
159,
163
],
[
153,
164
],
[
164,
165
],
[
165,
166
],
[
166,
167
],
[
166,
168
],
[
164,
169
],
[
153,
170
],
[
170,
171
],
[
171,
172
],
[
171,
173
],
[
173,
174
],
[
173,
175
],
[
170,
176
],
[
176,
177
],
[
177,
178
],
[
178,
179
],
[
178,
180
],
[
176,
181
],
[
181,
182
],
[
181,
183
],
[
149,
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
],
[
6,
200
],
[
200,
201
]
] | [
"import java.util.Scanner;\nclass Main{\npublic static void main(String[] args){\nScanner scan=new Scanner(System.in);\nint[][] n=new int[101][101];\nint[] tate=new int[101];\nint[] yoko=new int[101];\n\nint sum=0;\nint x=scan.nextInt();\nint y=scan.nextInt();\nfor(int i=0;i<x;i++){\ntate[i]=0;\nyoko[i]=0;\n}\nfor(int i=0;i<x;i++){\nfor(int j=0;j<y;j++){\nn[i][j]=scan.nextInt();\ntate[j]+=n[i][j];\nyoko[i]+=n[i][j];\nsum+=n[i][j];\n}\n}\nfor(int i=0;i<x+1;i++){\nfor(int j=0;j<y;j++){\nif(i!=x){\nSystem.out.print(n[i][j]);\nSystem.out.print(\" \");\nif(j==y-1)\nSystem.out.println(yoko[i]);\n}\nelse\nSystem.out.print(tate[j]+\" \");\n}\n}\nSystem.out.println(sum);\n\n}\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"class Main{\npublic static void main(String[] args){\nScanner scan=new Scanner(System.in);\nint[][] n=new int[101][101];\nint[] tate=new int[101];\nint[] yoko=new int[101];\n\nint sum=0;\nint x=scan.nextInt();\nint y=scan.nextInt();\nfor(int i=0;i<x;i++){\ntate[i]=0;\nyoko[i]=0;\n}\nfor(int i=0;i<x;i++){\nfor(int j=0;j<y;j++){\nn[i][j]=scan.nextInt();\ntate[j]+=n[i][j];\nyoko[i]+=n[i][j];\nsum+=n[i][j];\n}\n}\nfor(int i=0;i<x+1;i++){\nfor(int j=0;j<y;j++){\nif(i!=x){\nSystem.out.print(n[i][j]);\nSystem.out.print(\" \");\nif(j==y-1)\nSystem.out.println(yoko[i]);\n}\nelse\nSystem.out.print(tate[j]+\" \");\n}\n}\nSystem.out.println(sum);\n\n}\n}",
"Main",
"public static void main(String[] args){\nScanner scan=new Scanner(System.in);\nint[][] n=new int[101][101];\nint[] tate=new int[101];\nint[] yoko=new int[101];\n\nint sum=0;\nint x=scan.nextInt();\nint y=scan.nextInt();\nfor(int i=0;i<x;i++){\ntate[i]=0;\nyoko[i]=0;\n}\nfor(int i=0;i<x;i++){\nfor(int j=0;j<y;j++){\nn[i][j]=scan.nextInt();\ntate[j]+=n[i][j];\nyoko[i]+=n[i][j];\nsum+=n[i][j];\n}\n}\nfor(int i=0;i<x+1;i++){\nfor(int j=0;j<y;j++){\nif(i!=x){\nSystem.out.print(n[i][j]);\nSystem.out.print(\" \");\nif(j==y-1)\nSystem.out.println(yoko[i]);\n}\nelse\nSystem.out.print(tate[j]+\" \");\n}\n}\nSystem.out.println(sum);\n\n}",
"main",
"{\nScanner scan=new Scanner(System.in);\nint[][] n=new int[101][101];\nint[] tate=new int[101];\nint[] yoko=new int[101];\n\nint sum=0;\nint x=scan.nextInt();\nint y=scan.nextInt();\nfor(int i=0;i<x;i++){\ntate[i]=0;\nyoko[i]=0;\n}\nfor(int i=0;i<x;i++){\nfor(int j=0;j<y;j++){\nn[i][j]=scan.nextInt();\ntate[j]+=n[i][j];\nyoko[i]+=n[i][j];\nsum+=n[i][j];\n}\n}\nfor(int i=0;i<x+1;i++){\nfor(int j=0;j<y;j++){\nif(i!=x){\nSystem.out.print(n[i][j]);\nSystem.out.print(\" \");\nif(j==y-1)\nSystem.out.println(yoko[i]);\n}\nelse\nSystem.out.print(tate[j]+\" \");\n}\n}\nSystem.out.println(sum);\n\n}",
"Scanner scan=new Scanner(System.in);",
"scan",
"new Scanner(System.in)",
"int[][] n=new int[101][101];",
"n",
"new int[101][101]",
"101",
"101",
"int[] tate=new int[101];",
"tate",
"new int[101]",
"101",
"int[] yoko=new int[101];",
"yoko",
"new int[101]",
"101",
"int sum=0;",
"sum",
"0",
"int x=scan.nextInt();",
"x",
"scan.nextInt()",
"scan.nextInt",
"scan",
"int y=scan.nextInt();",
"y",
"scan.nextInt()",
"scan.nextInt",
"scan",
"for(int i=0;i<x;i++){\ntate[i]=0;\nyoko[i]=0;\n}",
"int i=0;",
"int i=0;",
"i",
"0",
"i<x",
"i",
"x",
"i++",
"i++",
"i",
"{\ntate[i]=0;\nyoko[i]=0;\n}",
"{\ntate[i]=0;\nyoko[i]=0;\n}",
"tate[i]=0",
"tate[i]",
"tate",
"i",
"0",
"yoko[i]=0",
"yoko[i]",
"yoko",
"i",
"0",
"for(int i=0;i<x;i++){\nfor(int j=0;j<y;j++){\nn[i][j]=scan.nextInt();\ntate[j]+=n[i][j];\nyoko[i]+=n[i][j];\nsum+=n[i][j];\n}\n}",
"int i=0;",
"int i=0;",
"i",
"0",
"i<x",
"i",
"x",
"i++",
"i++",
"i",
"{\nfor(int j=0;j<y;j++){\nn[i][j]=scan.nextInt();\ntate[j]+=n[i][j];\nyoko[i]+=n[i][j];\nsum+=n[i][j];\n}\n}",
"{\nfor(int j=0;j<y;j++){\nn[i][j]=scan.nextInt();\ntate[j]+=n[i][j];\nyoko[i]+=n[i][j];\nsum+=n[i][j];\n}\n}",
"for(int j=0;j<y;j++){\nn[i][j]=scan.nextInt();\ntate[j]+=n[i][j];\nyoko[i]+=n[i][j];\nsum+=n[i][j];\n}",
"int j=0;",
"int j=0;",
"j",
"0",
"j<y",
"j",
"y",
"j++",
"j++",
"j",
"{\nn[i][j]=scan.nextInt();\ntate[j]+=n[i][j];\nyoko[i]+=n[i][j];\nsum+=n[i][j];\n}",
"{\nn[i][j]=scan.nextInt();\ntate[j]+=n[i][j];\nyoko[i]+=n[i][j];\nsum+=n[i][j];\n}",
"n[i][j]=scan.nextInt()",
"n[i][j]",
"n[i]",
"n",
"i",
"j",
"scan.nextInt()",
"scan.nextInt",
"scan",
"tate[j]+=n[i][j]",
"tate[j]",
"tate",
"j",
"n[i][j]",
"n[i]",
"n",
"i",
"j",
"yoko[i]+=n[i][j]",
"yoko[i]",
"yoko",
"i",
"n[i][j]",
"n[i]",
"n",
"i",
"j",
"sum+=n[i][j]",
"sum",
"n[i][j]",
"n[i]",
"n",
"i",
"j",
"for(int i=0;i<x+1;i++){\nfor(int j=0;j<y;j++){\nif(i!=x){\nSystem.out.print(n[i][j]);\nSystem.out.print(\" \");\nif(j==y-1)\nSystem.out.println(yoko[i]);\n}\nelse\nSystem.out.print(tate[j]+\" \");\n}\n}",
"int i=0;",
"int i=0;",
"i",
"0",
"i<x+1",
"i",
"x+1",
"x",
"1",
"i++",
"i++",
"i",
"{\nfor(int j=0;j<y;j++){\nif(i!=x){\nSystem.out.print(n[i][j]);\nSystem.out.print(\" \");\nif(j==y-1)\nSystem.out.println(yoko[i]);\n}\nelse\nSystem.out.print(tate[j]+\" \");\n}\n}",
"{\nfor(int j=0;j<y;j++){\nif(i!=x){\nSystem.out.print(n[i][j]);\nSystem.out.print(\" \");\nif(j==y-1)\nSystem.out.println(yoko[i]);\n}\nelse\nSystem.out.print(tate[j]+\" \");\n}\n}",
"for(int j=0;j<y;j++){\nif(i!=x){\nSystem.out.print(n[i][j]);\nSystem.out.print(\" \");\nif(j==y-1)\nSystem.out.println(yoko[i]);\n}\nelse\nSystem.out.print(tate[j]+\" \");\n}",
"int j=0;",
"int j=0;",
"j",
"0",
"j<y",
"j",
"y",
"j++",
"j++",
"j",
"{\nif(i!=x){\nSystem.out.print(n[i][j]);\nSystem.out.print(\" \");\nif(j==y-1)\nSystem.out.println(yoko[i]);\n}\nelse\nSystem.out.print(tate[j]+\" \");\n}",
"{\nif(i!=x){\nSystem.out.print(n[i][j]);\nSystem.out.print(\" \");\nif(j==y-1)\nSystem.out.println(yoko[i]);\n}\nelse\nSystem.out.print(tate[j]+\" \");\n}",
"if(i!=x){\nSystem.out.print(n[i][j]);\nSystem.out.print(\" \");\nif(j==y-1)\nSystem.out.println(yoko[i]);\n}\nelse\nSystem.out.print(tate[j]+\" \");",
"i!=x",
"i",
"x",
"{\nSystem.out.print(n[i][j]);\nSystem.out.print(\" \");\nif(j==y-1)\nSystem.out.println(yoko[i]);\n}",
"System.out.print(n[i][j])",
"System.out.print",
"System.out",
"System",
"System.out",
"n[i][j]",
"n[i]",
"n",
"i",
"j",
"System.out.print(\" \")",
"System.out.print",
"System.out",
"System",
"System.out",
"\" \"",
"if(j==y-1)\nSystem.out.println(yoko[i]);",
"j==y-1",
"j",
"y-1",
"y",
"1",
"System.out.println(yoko[i])",
"System.out.println",
"System.out",
"System",
"System.out",
"yoko[i]",
"yoko",
"i",
"System.out.print(tate[j]+\" \")",
"System.out.print",
"System.out",
"System",
"System.out",
"tate[j]+\" \"",
"tate[j]",
"tate",
"j",
"\" \"",
"System.out.println(sum)",
"System.out.println",
"System.out",
"System",
"System.out",
"sum",
"String[] args",
"args"
] | import java.util.Scanner;
class Main{
public static void main(String[] args){
Scanner scan=new Scanner(System.in);
int[][] n=new int[101][101];
int[] tate=new int[101];
int[] yoko=new int[101];
int sum=0;
int x=scan.nextInt();
int y=scan.nextInt();
for(int i=0;i<x;i++){
tate[i]=0;
yoko[i]=0;
}
for(int i=0;i<x;i++){
for(int j=0;j<y;j++){
n[i][j]=scan.nextInt();
tate[j]+=n[i][j];
yoko[i]+=n[i][j];
sum+=n[i][j];
}
}
for(int i=0;i<x+1;i++){
for(int j=0;j<y;j++){
if(i!=x){
System.out.print(n[i][j]);
System.out.print(" ");
if(j==y-1)
System.out.println(yoko[i]);
}
else
System.out.print(tate[j]+" ");
}
}
System.out.println(sum);
}
} |
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
41,
13,
20,
2,
13,
17,
2,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
18,
18,
13,
13,
13,
4,
18,
13,
0,
18,
18,
13,
13,
13,
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,
11,
1,
41,
13,
17,
2,
13,
2,
13,
17,
1,
40,
13,
30,
30,
11,
1,
41,
13,
17,
2,
13,
2,
13,
17,
1,
40,
13,
30,
30,
14,
2,
13,
13,
30,
4,
18,
18,
13,
13,
18,
18,
13,
13,
13,
30,
4,
18,
18,
13,
13,
2,
18,
18,
13,
13,
13,
17,
4,
18,
18,
13,
13,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
183,
5
],
[
183,
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
],
[
56,
100
],
[
100,
101
],
[
101,
102
],
[
102,
103
],
[
102,
104
],
[
101,
105
],
[
100,
106
],
[
106,
107
],
[
107,
108
],
[
108,
109
],
[
108,
110
],
[
107,
111
],
[
106,
112
],
[
112,
113
],
[
113,
114
],
[
113,
115
],
[
112,
116
],
[
8,
117
],
[
117,
118
],
[
118,
119
],
[
119,
120
],
[
119,
121
],
[
117,
122
],
[
122,
123
],
[
122,
124
],
[
124,
125
],
[
124,
126
],
[
117,
127
],
[
127,
128
],
[
128,
129
],
[
117,
130
],
[
131,
131
],
[
131,
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
],
[
148,
150
],
[
147,
151
],
[
151,
152
],
[
152,
153
],
[
153,
154
],
[
154,
155
],
[
154,
156
],
[
152,
157
],
[
157,
158
],
[
158,
159
],
[
158,
160
],
[
157,
161
],
[
147,
162
],
[
162,
163
],
[
163,
164
],
[
164,
165
],
[
165,
166
],
[
165,
167
],
[
163,
168
],
[
168,
169
],
[
169,
170
],
[
170,
171
],
[
170,
172
],
[
169,
173
],
[
168,
174
],
[
131,
175
],
[
175,
176
],
[
176,
177
],
[
177,
178
],
[
177,
179
],
[
6,
180
],
[
180,
181
],
[
0,
182
],
[
182,
183
],
[
182,
184
]
] | [
"import java.util.Scanner;\n\npublic class Main {\n\n\tpublic static void main(String[] args) {\n\t\tScanner scanner = new Scanner(System.in);\n\t\tint r = scanner.nextInt();\n\t\tint c = scanner.nextInt();\n\t\tint[][] SP = new int[r+1][c+1];\n\n\t\tfor(int x = 0 ; x < r ; x++){\n\t\t\tfor(int y = 0; y < c ; y++){\n\t\t\t\tSP[x][y] = scanner.nextInt();\n\t\t\t\tSP[x][c] = SP[x][c] + SP[x][y];\n\t\t\t\tSP[r][y] = SP[r][y] + SP[x][y];\n\t\t\t\tSP[r][c] = SP[r][c] + SP[x][y];\n\t\t\t}\n\t\t}\n\t\tfor(int x = 0 ; x < r+1 ; x++){\n\t\t\tfor(int y = 0; y < c+1 ; y++){\n\t\t\t\tif(y==c){\n\t\t\t\t\tSystem.out.print(SP[x][y] );\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tSystem.out.print(SP[x][y] + \" \");\n\t\t\t\t}\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}\n\t}\n\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n\n\tpublic static void main(String[] args) {\n\t\tScanner scanner = new Scanner(System.in);\n\t\tint r = scanner.nextInt();\n\t\tint c = scanner.nextInt();\n\t\tint[][] SP = new int[r+1][c+1];\n\n\t\tfor(int x = 0 ; x < r ; x++){\n\t\t\tfor(int y = 0; y < c ; y++){\n\t\t\t\tSP[x][y] = scanner.nextInt();\n\t\t\t\tSP[x][c] = SP[x][c] + SP[x][y];\n\t\t\t\tSP[r][y] = SP[r][y] + SP[x][y];\n\t\t\t\tSP[r][c] = SP[r][c] + SP[x][y];\n\t\t\t}\n\t\t}\n\t\tfor(int x = 0 ; x < r+1 ; x++){\n\t\t\tfor(int y = 0; y < c+1 ; y++){\n\t\t\t\tif(y==c){\n\t\t\t\t\tSystem.out.print(SP[x][y] );\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tSystem.out.print(SP[x][y] + \" \");\n\t\t\t\t}\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 scanner = new Scanner(System.in);\n\t\tint r = scanner.nextInt();\n\t\tint c = scanner.nextInt();\n\t\tint[][] SP = new int[r+1][c+1];\n\n\t\tfor(int x = 0 ; x < r ; x++){\n\t\t\tfor(int y = 0; y < c ; y++){\n\t\t\t\tSP[x][y] = scanner.nextInt();\n\t\t\t\tSP[x][c] = SP[x][c] + SP[x][y];\n\t\t\t\tSP[r][y] = SP[r][y] + SP[x][y];\n\t\t\t\tSP[r][c] = SP[r][c] + SP[x][y];\n\t\t\t}\n\t\t}\n\t\tfor(int x = 0 ; x < r+1 ; x++){\n\t\t\tfor(int y = 0; y < c+1 ; y++){\n\t\t\t\tif(y==c){\n\t\t\t\t\tSystem.out.print(SP[x][y] );\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tSystem.out.print(SP[x][y] + \" \");\n\t\t\t\t}\n\t\t\t}\n\t\t\tSystem.out.println();\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[][] SP = new int[r+1][c+1];\n\n\t\tfor(int x = 0 ; x < r ; x++){\n\t\t\tfor(int y = 0; y < c ; y++){\n\t\t\t\tSP[x][y] = scanner.nextInt();\n\t\t\t\tSP[x][c] = SP[x][c] + SP[x][y];\n\t\t\t\tSP[r][y] = SP[r][y] + SP[x][y];\n\t\t\t\tSP[r][c] = SP[r][c] + SP[x][y];\n\t\t\t}\n\t\t}\n\t\tfor(int x = 0 ; x < r+1 ; x++){\n\t\t\tfor(int y = 0; y < c+1 ; y++){\n\t\t\t\tif(y==c){\n\t\t\t\t\tSystem.out.print(SP[x][y] );\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tSystem.out.print(SP[x][y] + \" \");\n\t\t\t\t}\n\t\t\t}\n\t\t\tSystem.out.println();\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[][] SP = new int[r+1][c+1];",
"SP",
"new int[r+1][c+1]",
"r+1",
"r",
"1",
"c+1",
"c",
"1",
"for(int x = 0 ; x < r ; x++){\n\t\t\tfor(int y = 0; y < c ; y++){\n\t\t\t\tSP[x][y] = scanner.nextInt();\n\t\t\t\tSP[x][c] = SP[x][c] + SP[x][y];\n\t\t\t\tSP[r][y] = SP[r][y] + SP[x][y];\n\t\t\t\tSP[r][c] = SP[r][c] + SP[x][y];\n\t\t\t}\n\t\t}",
"int x = 0 ;",
"int x = 0 ;",
"x",
"0",
"x < r",
"x",
"r",
"x++",
"x++",
"x",
"{\n\t\t\tfor(int y = 0; y < c ; y++){\n\t\t\t\tSP[x][y] = scanner.nextInt();\n\t\t\t\tSP[x][c] = SP[x][c] + SP[x][y];\n\t\t\t\tSP[r][y] = SP[r][y] + SP[x][y];\n\t\t\t\tSP[r][c] = SP[r][c] + SP[x][y];\n\t\t\t}\n\t\t}",
"{\n\t\t\tfor(int y = 0; y < c ; y++){\n\t\t\t\tSP[x][y] = scanner.nextInt();\n\t\t\t\tSP[x][c] = SP[x][c] + SP[x][y];\n\t\t\t\tSP[r][y] = SP[r][y] + SP[x][y];\n\t\t\t\tSP[r][c] = SP[r][c] + SP[x][y];\n\t\t\t}\n\t\t}",
"for(int y = 0; y < c ; y++){\n\t\t\t\tSP[x][y] = scanner.nextInt();\n\t\t\t\tSP[x][c] = SP[x][c] + SP[x][y];\n\t\t\t\tSP[r][y] = SP[r][y] + SP[x][y];\n\t\t\t\tSP[r][c] = SP[r][c] + SP[x][y];\n\t\t\t}",
"int y = 0;",
"int y = 0;",
"y",
"0",
"y < c",
"y",
"c",
"y++",
"y++",
"y",
"{\n\t\t\t\tSP[x][y] = scanner.nextInt();\n\t\t\t\tSP[x][c] = SP[x][c] + SP[x][y];\n\t\t\t\tSP[r][y] = SP[r][y] + SP[x][y];\n\t\t\t\tSP[r][c] = SP[r][c] + SP[x][y];\n\t\t\t}",
"{\n\t\t\t\tSP[x][y] = scanner.nextInt();\n\t\t\t\tSP[x][c] = SP[x][c] + SP[x][y];\n\t\t\t\tSP[r][y] = SP[r][y] + SP[x][y];\n\t\t\t\tSP[r][c] = SP[r][c] + SP[x][y];\n\t\t\t}",
"SP[x][y] = scanner.nextInt()",
"SP[x][y]",
"SP[x]",
"SP",
"x",
"y",
"scanner.nextInt()",
"scanner.nextInt",
"scanner",
"SP[x][c] = SP[x][c] + SP[x][y]",
"SP[x][c]",
"SP[x]",
"SP",
"x",
"c",
"SP[x][c] + SP[x][y]",
"SP[x][c]",
"SP[x]",
"SP",
"x",
"c",
"SP[x][y]",
"SP[x]",
"SP",
"x",
"y",
"SP[r][y] = SP[r][y] + SP[x][y]",
"SP[r][y]",
"SP[r]",
"SP",
"r",
"y",
"SP[r][y] + SP[x][y]",
"SP[r][y]",
"SP[r]",
"SP",
"r",
"y",
"SP[x][y]",
"SP[x]",
"SP",
"x",
"y",
"SP[r][c] = SP[r][c] + SP[x][y]",
"SP[r][c]",
"SP[r]",
"SP",
"r",
"c",
"SP[r][c] + SP[x][y]",
"SP[r][c]",
"SP[r]",
"SP",
"r",
"c",
"SP[x][y]",
"SP[x]",
"SP",
"x",
"y",
"for(int x = 0 ; x < r+1 ; x++){\n\t\t\tfor(int y = 0; y < c+1 ; y++){\n\t\t\t\tif(y==c){\n\t\t\t\t\tSystem.out.print(SP[x][y] );\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tSystem.out.print(SP[x][y] + \" \");\n\t\t\t\t}\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}",
"int x = 0 ;",
"int x = 0 ;",
"x",
"0",
"x < r+1",
"x",
"r+1",
"r",
"1",
"x++",
"x++",
"x",
"{\n\t\t\tfor(int y = 0; y < c+1 ; y++){\n\t\t\t\tif(y==c){\n\t\t\t\t\tSystem.out.print(SP[x][y] );\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tSystem.out.print(SP[x][y] + \" \");\n\t\t\t\t}\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}",
"{\n\t\t\tfor(int y = 0; y < c+1 ; y++){\n\t\t\t\tif(y==c){\n\t\t\t\t\tSystem.out.print(SP[x][y] );\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tSystem.out.print(SP[x][y] + \" \");\n\t\t\t\t}\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}",
"for(int y = 0; y < c+1 ; y++){\n\t\t\t\tif(y==c){\n\t\t\t\t\tSystem.out.print(SP[x][y] );\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tSystem.out.print(SP[x][y] + \" \");\n\t\t\t\t}\n\t\t\t}",
"int y = 0;",
"int y = 0;",
"y",
"0",
"y < c+1",
"y",
"c+1",
"c",
"1",
"y++",
"y++",
"y",
"{\n\t\t\t\tif(y==c){\n\t\t\t\t\tSystem.out.print(SP[x][y] );\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tSystem.out.print(SP[x][y] + \" \");\n\t\t\t\t}\n\t\t\t}",
"{\n\t\t\t\tif(y==c){\n\t\t\t\t\tSystem.out.print(SP[x][y] );\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tSystem.out.print(SP[x][y] + \" \");\n\t\t\t\t}\n\t\t\t}",
"if(y==c){\n\t\t\t\t\tSystem.out.print(SP[x][y] );\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tSystem.out.print(SP[x][y] + \" \");\n\t\t\t\t}",
"y==c",
"y",
"c",
"{\n\t\t\t\t\tSystem.out.print(SP[x][y] );\n\t\t\t\t}",
"System.out.print(SP[x][y] )",
"System.out.print",
"System.out",
"System",
"System.out",
"SP[x][y]",
"SP[x]",
"SP",
"x",
"y",
"{\n\t\t\t\t\tSystem.out.print(SP[x][y] + \" \");\n\t\t\t\t}",
"System.out.print(SP[x][y] + \" \")",
"System.out.print",
"System.out",
"System",
"System.out",
"SP[x][y] + \" \"",
"SP[x][y]",
"SP[x]",
"SP",
"x",
"y",
"\" \"",
"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 scanner = new Scanner(System.in);\n\t\tint r = scanner.nextInt();\n\t\tint c = scanner.nextInt();\n\t\tint[][] SP = new int[r+1][c+1];\n\n\t\tfor(int x = 0 ; x < r ; x++){\n\t\t\tfor(int y = 0; y < c ; y++){\n\t\t\t\tSP[x][y] = scanner.nextInt();\n\t\t\t\tSP[x][c] = SP[x][c] + SP[x][y];\n\t\t\t\tSP[r][y] = SP[r][y] + SP[x][y];\n\t\t\t\tSP[r][c] = SP[r][c] + SP[x][y];\n\t\t\t}\n\t\t}\n\t\tfor(int x = 0 ; x < r+1 ; x++){\n\t\t\tfor(int y = 0; y < c+1 ; y++){\n\t\t\t\tif(y==c){\n\t\t\t\t\tSystem.out.print(SP[x][y] );\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tSystem.out.print(SP[x][y] + \" \");\n\t\t\t\t}\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}\n\t}\n\n}",
"public class Main {\n\n\tpublic static void main(String[] args) {\n\t\tScanner scanner = new Scanner(System.in);\n\t\tint r = scanner.nextInt();\n\t\tint c = scanner.nextInt();\n\t\tint[][] SP = new int[r+1][c+1];\n\n\t\tfor(int x = 0 ; x < r ; x++){\n\t\t\tfor(int y = 0; y < c ; y++){\n\t\t\t\tSP[x][y] = scanner.nextInt();\n\t\t\t\tSP[x][c] = SP[x][c] + SP[x][y];\n\t\t\t\tSP[r][y] = SP[r][y] + SP[x][y];\n\t\t\t\tSP[r][c] = SP[r][c] + SP[x][y];\n\t\t\t}\n\t\t}\n\t\tfor(int x = 0 ; x < r+1 ; x++){\n\t\t\tfor(int y = 0; y < c+1 ; y++){\n\t\t\t\tif(y==c){\n\t\t\t\t\tSystem.out.print(SP[x][y] );\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tSystem.out.print(SP[x][y] + \" \");\n\t\t\t\t}\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}\n\t}\n\n}",
"Main"
] | import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
int r = scanner.nextInt();
int c = scanner.nextInt();
int[][] SP = new int[r+1][c+1];
for(int x = 0 ; x < r ; x++){
for(int y = 0; y < c ; y++){
SP[x][y] = scanner.nextInt();
SP[x][c] = SP[x][c] + SP[x][y];
SP[r][y] = SP[r][y] + SP[x][y];
SP[r][c] = SP[r][c] + SP[x][y];
}
}
for(int x = 0 ; x < r+1 ; x++){
for(int y = 0; y < c+1 ; y++){
if(y==c){
System.out.print(SP[x][y] );
}
else{
System.out.print(SP[x][y] + " ");
}
}
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,
2,
13,
17,
41,
13,
2,
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,
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,
4,
18,
18,
13,
13,
2,
8,
2,
13,
17,
17,
17,
18,
18,
13,
13,
13,
4,
18,
18,
13,
13,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
151,
5
],
[
151,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
8,
17
],
[
17,
18
],
[
17,
19
],
[
19,
20
],
[
20,
21
],
[
8,
22
],
[
22,
23
],
[
22,
24
],
[
24,
25
],
[
24,
26
],
[
8,
27
],
[
27,
28
],
[
27,
29
],
[
29,
30
],
[
29,
31
],
[
8,
32
],
[
32,
33
],
[
32,
34
],
[
8,
37
],
[
37,
38
],
[
38,
39
],
[
39,
40
],
[
39,
41
],
[
37,
42
],
[
42,
43
],
[
42,
44
],
[
37,
45
],
[
45,
46
],
[
46,
47
],
[
37,
48
],
[
49,
49
],
[
49,
50
],
[
50,
51
],
[
51,
52
],
[
52,
53
],
[
52,
54
],
[
50,
55
],
[
55,
56
],
[
55,
57
],
[
50,
58
],
[
58,
59
],
[
59,
60
],
[
50,
61
],
[
62,
62
],
[
62,
63
],
[
63,
64
],
[
64,
65
],
[
65,
66
],
[
65,
67
],
[
64,
68
],
[
63,
69
],
[
69,
70
],
[
70,
71
],
[
71,
72
],
[
71,
73
],
[
70,
74
],
[
69,
75
],
[
75,
76
],
[
76,
77
],
[
62,
78
],
[
78,
79
],
[
79,
80
],
[
80,
81
],
[
80,
82
],
[
79,
83
],
[
78,
84
],
[
84,
85
],
[
85,
86
],
[
85,
87
],
[
84,
88
],
[
62,
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
],
[
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
],
[
132,
133
],
[
133,
134
],
[
133,
135
],
[
132,
136
],
[
132,
137
],
[
131,
138
],
[
138,
139
],
[
139,
140
],
[
139,
141
],
[
138,
142
],
[
112,
143
],
[
143,
144
],
[
144,
145
],
[
145,
146
],
[
145,
147
],
[
6,
148
],
[
148,
149
],
[
0,
150
],
[
150,
151
],
[
150,
152
]
] | [
"import java.util.Scanner;\n\npublic class Main {\n\tpublic static void main(String[] args) {\n\t\tScanner s = new Scanner(System.in);\n\t\tint r = s.nextInt();\n\t\tint c = s.nextInt();\n\t\tint rm = r + 1;\n\t\tint cm = c + 1;\n\t\tint[][] sheet = new int[rm][cm];\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] = s.nextInt();\n\t\t\t\tsheet[r][j] += sheet[i][j];\n\t\t\t\tsheet[r][c] += sheet[i][j];\n\t\t\t}\n\t\t}\n\t\tfor(int i = 0; i < rm; ++i) {\n\t\t\tfor (int j = 0; j < cm; ++j) {\n\t\t\t\tSystem.out.print(((j != 0)?\" \":\"\") + sheet[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",
"public class Main {\n\tpublic static void main(String[] args) {\n\t\tScanner s = new Scanner(System.in);\n\t\tint r = s.nextInt();\n\t\tint c = s.nextInt();\n\t\tint rm = r + 1;\n\t\tint cm = c + 1;\n\t\tint[][] sheet = new int[rm][cm];\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] = s.nextInt();\n\t\t\t\tsheet[r][j] += sheet[i][j];\n\t\t\t\tsheet[r][c] += sheet[i][j];\n\t\t\t}\n\t\t}\n\t\tfor(int i = 0; i < rm; ++i) {\n\t\t\tfor (int j = 0; j < cm; ++j) {\n\t\t\t\tSystem.out.print(((j != 0)?\" \":\"\") + sheet[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 s = new Scanner(System.in);\n\t\tint r = s.nextInt();\n\t\tint c = s.nextInt();\n\t\tint rm = r + 1;\n\t\tint cm = c + 1;\n\t\tint[][] sheet = new int[rm][cm];\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] = s.nextInt();\n\t\t\t\tsheet[r][j] += sheet[i][j];\n\t\t\t\tsheet[r][c] += sheet[i][j];\n\t\t\t}\n\t\t}\n\t\tfor(int i = 0; i < rm; ++i) {\n\t\t\tfor (int j = 0; j < cm; ++j) {\n\t\t\t\tSystem.out.print(((j != 0)?\" \":\"\") + sheet[i][j]);\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}\n\t}",
"main",
"{\n\t\tScanner s = new Scanner(System.in);\n\t\tint r = s.nextInt();\n\t\tint c = s.nextInt();\n\t\tint rm = r + 1;\n\t\tint cm = c + 1;\n\t\tint[][] sheet = new int[rm][cm];\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] = s.nextInt();\n\t\t\t\tsheet[r][j] += sheet[i][j];\n\t\t\t\tsheet[r][c] += sheet[i][j];\n\t\t\t}\n\t\t}\n\t\tfor(int i = 0; i < rm; ++i) {\n\t\t\tfor (int j = 0; j < cm; ++j) {\n\t\t\t\tSystem.out.print(((j != 0)?\" \":\"\") + sheet[i][j]);\n\t\t\t}\n\t\t\tSystem.out.println();\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 rm = r + 1;",
"rm",
"r + 1",
"r",
"1",
"int cm = c + 1;",
"cm",
"c + 1",
"c",
"1",
"int[][] sheet = new int[rm][cm];",
"sheet",
"new int[rm][cm]",
"rm",
"cm",
"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] = s.nextInt();\n\t\t\t\tsheet[r][j] += sheet[i][j];\n\t\t\t\tsheet[r][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] = s.nextInt();\n\t\t\t\tsheet[r][j] += sheet[i][j];\n\t\t\t\tsheet[r][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] = s.nextInt();\n\t\t\t\tsheet[r][j] += sheet[i][j];\n\t\t\t\tsheet[r][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] = s.nextInt();\n\t\t\t\tsheet[r][j] += sheet[i][j];\n\t\t\t\tsheet[r][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] = s.nextInt();\n\t\t\t\tsheet[r][j] += sheet[i][j];\n\t\t\t\tsheet[r][c] += sheet[i][j];\n\t\t\t}",
"{\n\t\t\t\tsheet[i][c] += sheet[i][j] = s.nextInt();\n\t\t\t\tsheet[r][j] += sheet[i][j];\n\t\t\t\tsheet[r][c] += sheet[i][j];\n\t\t\t}",
"sheet[i][c] += sheet[i][j] = s.nextInt()",
"sheet[i][c]",
"sheet[i]",
"sheet",
"i",
"c",
"sheet[i][j] = s.nextInt()",
"sheet[i][j]",
"sheet[i]",
"sheet",
"i",
"j",
"s.nextInt()",
"s.nextInt",
"s",
"sheet[r][j] += sheet[i][j]",
"sheet[r][j]",
"sheet[r]",
"sheet",
"r",
"j",
"sheet[i][j]",
"sheet[i]",
"sheet",
"i",
"j",
"sheet[r][c] += sheet[i][j]",
"sheet[r][c]",
"sheet[r]",
"sheet",
"r",
"c",
"sheet[i][j]",
"sheet[i]",
"sheet",
"i",
"j",
"for(int i = 0; i < rm; ++i) {\n\t\t\tfor (int j = 0; j < cm; ++j) {\n\t\t\t\tSystem.out.print(((j != 0)?\" \":\"\") + sheet[i][j]);\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < rm",
"i",
"rm",
"++i",
"++i",
"i",
"{\n\t\t\tfor (int j = 0; j < cm; ++j) {\n\t\t\t\tSystem.out.print(((j != 0)?\" \":\"\") + sheet[i][j]);\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}",
"{\n\t\t\tfor (int j = 0; j < cm; ++j) {\n\t\t\t\tSystem.out.print(((j != 0)?\" \":\"\") + sheet[i][j]);\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}",
"for (int j = 0; j < cm; ++j) {\n\t\t\t\tSystem.out.print(((j != 0)?\" \":\"\") + sheet[i][j]);\n\t\t\t}",
"int j = 0;",
"int j = 0;",
"j",
"0",
"j < cm",
"j",
"cm",
"++j",
"++j",
"j",
"{\n\t\t\t\tSystem.out.print(((j != 0)?\" \":\"\") + sheet[i][j]);\n\t\t\t}",
"{\n\t\t\t\tSystem.out.print(((j != 0)?\" \":\"\") + sheet[i][j]);\n\t\t\t}",
"System.out.print(((j != 0)?\" \":\"\") + sheet[i][j])",
"System.out.print",
"System.out",
"System",
"System.out",
"((j != 0)?\" \":\"\") + sheet[i][j]",
"((j != 0)?\" \":\"\")",
"(j != 0)",
"j",
"0",
"\" \"",
"\"\"",
"sheet[i][j]",
"sheet[i]",
"sheet",
"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 s = new Scanner(System.in);\n\t\tint r = s.nextInt();\n\t\tint c = s.nextInt();\n\t\tint rm = r + 1;\n\t\tint cm = c + 1;\n\t\tint[][] sheet = new int[rm][cm];\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] = s.nextInt();\n\t\t\t\tsheet[r][j] += sheet[i][j];\n\t\t\t\tsheet[r][c] += sheet[i][j];\n\t\t\t}\n\t\t}\n\t\tfor(int i = 0; i < rm; ++i) {\n\t\t\tfor (int j = 0; j < cm; ++j) {\n\t\t\t\tSystem.out.print(((j != 0)?\" \":\"\") + sheet[i][j]);\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 s = new Scanner(System.in);\n\t\tint r = s.nextInt();\n\t\tint c = s.nextInt();\n\t\tint rm = r + 1;\n\t\tint cm = c + 1;\n\t\tint[][] sheet = new int[rm][cm];\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] = s.nextInt();\n\t\t\t\tsheet[r][j] += sheet[i][j];\n\t\t\t\tsheet[r][c] += sheet[i][j];\n\t\t\t}\n\t\t}\n\t\tfor(int i = 0; i < rm; ++i) {\n\t\t\tfor (int j = 0; j < cm; ++j) {\n\t\t\t\tSystem.out.print(((j != 0)?\" \":\"\") + sheet[i][j]);\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 s = new Scanner(System.in);
int r = s.nextInt();
int c = s.nextInt();
int rm = r + 1;
int cm = c + 1;
int[][] sheet = new int[rm][cm];
for (int i = 0; i < r; ++i) {
for(int j = 0; j < c; ++j) {
sheet[i][c] += sheet[i][j] = s.nextInt();
sheet[r][j] += sheet[i][j];
sheet[r][c] += sheet[i][j];
}
}
for(int i = 0; i < rm; ++i) {
for (int j = 0; j < cm; ++j) {
System.out.print(((j != 0)?" ":"") + sheet[i][j]);
}
System.out.println();
}
}
} |
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
4,
18,
13,
17,
41,
13,
4,
18,
13,
18,
13,
17,
41,
13,
4,
18,
13,
18,
13,
17,
41,
13,
20,
2,
13,
17,
2,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
4,
18,
4,
18,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
18,
18,
13,
13,
13,
4,
18,
13,
18,
13,
13,
0,
18,
18,
13,
13,
13,
18,
18,
13,
13,
13,
0,
18,
18,
13,
13,
13,
18,
18,
13,
13,
13,
0,
18,
18,
13,
13,
13,
18,
18,
13,
13,
13,
11,
1,
41,
13,
17,
2,
13,
2,
13,
17,
1,
40,
13,
30,
30,
11,
1,
41,
13,
17,
2,
13,
2,
13,
17,
1,
40,
13,
30,
30,
14,
2,
13,
13,
4,
18,
18,
13,
13,
2,
18,
18,
13,
13,
13,
17,
4,
18,
18,
13,
13,
18,
18,
13,
13,
13,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
189,
11
],
[
189,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
15,
17
],
[
14,
18
],
[
18,
19
],
[
18,
20
],
[
20,
21
],
[
21,
22
],
[
22,
23
],
[
23,
24
],
[
20,
25
],
[
14,
26
],
[
26,
27
],
[
26,
28
],
[
28,
29
],
[
29,
30
],
[
28,
31
],
[
31,
32
],
[
31,
33
],
[
14,
34
],
[
34,
35
],
[
34,
36
],
[
36,
37
],
[
37,
38
],
[
36,
39
],
[
39,
40
],
[
39,
41
],
[
14,
42
],
[
42,
43
],
[
42,
44
],
[
45,
46
],
[
45,
47
],
[
48,
49
],
[
48,
50
],
[
14,
51
],
[
51,
52
],
[
52,
53
],
[
53,
54
],
[
53,
55
],
[
51,
56
],
[
56,
57
],
[
56,
58
],
[
51,
59
],
[
59,
60
],
[
60,
61
],
[
51,
62
],
[
63,
63
],
[
63,
64
],
[
64,
65
],
[
64,
66
],
[
66,
67
],
[
67,
68
],
[
68,
69
],
[
69,
70
],
[
66,
71
],
[
63,
72
],
[
72,
73
],
[
73,
74
],
[
74,
75
],
[
74,
76
],
[
72,
77
],
[
77,
78
],
[
77,
79
],
[
72,
80
],
[
80,
81
],
[
81,
82
],
[
72,
83
],
[
84,
84
],
[
84,
85
],
[
85,
86
],
[
86,
87
],
[
87,
88
],
[
87,
89
],
[
86,
90
],
[
85,
91
],
[
91,
92
],
[
92,
93
],
[
91,
94
],
[
94,
95
],
[
94,
96
],
[
84,
97
],
[
97,
98
],
[
98,
99
],
[
99,
100
],
[
99,
101
],
[
98,
102
],
[
97,
103
],
[
103,
104
],
[
104,
105
],
[
104,
106
],
[
103,
107
],
[
84,
108
],
[
108,
109
],
[
109,
110
],
[
110,
111
],
[
110,
112
],
[
109,
113
],
[
108,
114
],
[
114,
115
],
[
115,
116
],
[
115,
117
],
[
114,
118
],
[
63,
119
],
[
119,
120
],
[
120,
121
],
[
121,
122
],
[
121,
123
],
[
120,
124
],
[
119,
125
],
[
125,
126
],
[
126,
127
],
[
126,
128
],
[
125,
129
],
[
14,
130
],
[
130,
131
],
[
131,
132
],
[
132,
133
],
[
132,
134
],
[
130,
135
],
[
135,
136
],
[
135,
137
],
[
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
],
[
166,
168
],
[
164,
169
],
[
169,
170
],
[
170,
171
],
[
171,
172
],
[
171,
173
],
[
170,
174
],
[
169,
175
],
[
160,
176
],
[
176,
177
],
[
177,
178
],
[
178,
179
],
[
178,
180
],
[
176,
181
],
[
181,
182
],
[
182,
183
],
[
182,
184
],
[
181,
185
],
[
12,
186
],
[
186,
187
],
[
0,
188
],
[
188,
189
],
[
188,
190
]
] | [
"import java.io.BufferedReader;\nimport java.io.IOException;\nimport java.io.InputStreamReader;\n\npublic class Main {\n public static void main(String[] args) throws IOException {\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n String str[] = br.readLine().split(\" \");\n int r = Integer.parseInt(str[0]);\n int c = Integer.parseInt(str[1]);\n int[][] a = new int[r+1][c+1];\n for(int i=0;i<r;i++){\n str = br.readLine().split(\" \");\n for(int j=0;j<c;j++){\n a[i][j] = Integer.parseInt(str[j]);\n a[i][c] += a[i][j];\n a[r][j] += a[i][j];\n }\n a[r][c] += a[i][c];\n }\n for(int i=0;i<r+1;i++){\n for(int j=0;j<c+1;j++){\n if(j<c) System.out.print(a[i][j]+\" \");\n else System.out.println(a[i][j]);\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 public static void main(String[] args) throws IOException {\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n String str[] = br.readLine().split(\" \");\n int r = Integer.parseInt(str[0]);\n int c = Integer.parseInt(str[1]);\n int[][] a = new int[r+1][c+1];\n for(int i=0;i<r;i++){\n str = br.readLine().split(\" \");\n for(int j=0;j<c;j++){\n a[i][j] = Integer.parseInt(str[j]);\n a[i][c] += a[i][j];\n a[r][j] += a[i][j];\n }\n a[r][c] += a[i][c];\n }\n for(int i=0;i<r+1;i++){\n for(int j=0;j<c+1;j++){\n if(j<c) System.out.print(a[i][j]+\" \");\n else System.out.println(a[i][j]);\n }\n }\n }\n}",
"Main",
"public static void main(String[] args) throws IOException {\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n String str[] = br.readLine().split(\" \");\n int r = Integer.parseInt(str[0]);\n int c = Integer.parseInt(str[1]);\n int[][] a = new int[r+1][c+1];\n for(int i=0;i<r;i++){\n str = br.readLine().split(\" \");\n for(int j=0;j<c;j++){\n a[i][j] = Integer.parseInt(str[j]);\n a[i][c] += a[i][j];\n a[r][j] += a[i][j];\n }\n a[r][c] += a[i][c];\n }\n for(int i=0;i<r+1;i++){\n for(int j=0;j<c+1;j++){\n if(j<c) System.out.print(a[i][j]+\" \");\n else System.out.println(a[i][j]);\n }\n }\n }",
"main",
"{\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n String str[] = br.readLine().split(\" \");\n int r = Integer.parseInt(str[0]);\n int c = Integer.parseInt(str[1]);\n int[][] a = new int[r+1][c+1];\n for(int i=0;i<r;i++){\n str = br.readLine().split(\" \");\n for(int j=0;j<c;j++){\n a[i][j] = Integer.parseInt(str[j]);\n a[i][c] += a[i][j];\n a[r][j] += a[i][j];\n }\n a[r][c] += a[i][c];\n }\n for(int i=0;i<r+1;i++){\n for(int j=0;j<c+1;j++){\n if(j<c) System.out.print(a[i][j]+\" \");\n else System.out.println(a[i][j]);\n }\n }\n }",
"BufferedReader br = new BufferedReader(new InputStreamReader(System.in));",
"br",
"new BufferedReader(new InputStreamReader(System.in))",
"String str[] = br.readLine().split(\" \");",
"str",
"br.readLine().split(\" \")",
"br.readLine().split",
"br.readLine()",
"br.readLine",
"br",
"\" \"",
"int r = Integer.parseInt(str[0]);",
"r",
"Integer.parseInt(str[0])",
"Integer.parseInt",
"Integer",
"str[0]",
"str",
"0",
"int c = Integer.parseInt(str[1]);",
"c",
"Integer.parseInt(str[1])",
"Integer.parseInt",
"Integer",
"str[1]",
"str",
"1",
"int[][] a = new int[r+1][c+1];",
"a",
"new int[r+1][c+1]",
"r+1",
"r",
"1",
"c+1",
"c",
"1",
"for(int i=0;i<r;i++){\n str = br.readLine().split(\" \");\n for(int j=0;j<c;j++){\n a[i][j] = Integer.parseInt(str[j]);\n a[i][c] += a[i][j];\n a[r][j] += a[i][j];\n }\n a[r][c] += a[i][c];\n }",
"int i=0;",
"int i=0;",
"i",
"0",
"i<r",
"i",
"r",
"i++",
"i++",
"i",
"{\n str = br.readLine().split(\" \");\n for(int j=0;j<c;j++){\n a[i][j] = Integer.parseInt(str[j]);\n a[i][c] += a[i][j];\n a[r][j] += a[i][j];\n }\n a[r][c] += a[i][c];\n }",
"{\n str = br.readLine().split(\" \");\n for(int j=0;j<c;j++){\n a[i][j] = Integer.parseInt(str[j]);\n a[i][c] += a[i][j];\n a[r][j] += a[i][j];\n }\n a[r][c] += a[i][c];\n }",
"str = br.readLine().split(\" \")",
"str",
"br.readLine().split(\" \")",
"br.readLine().split",
"br.readLine()",
"br.readLine",
"br",
"\" \"",
"for(int j=0;j<c;j++){\n a[i][j] = Integer.parseInt(str[j]);\n a[i][c] += a[i][j];\n a[r][j] += a[i][j];\n }",
"int j=0;",
"int j=0;",
"j",
"0",
"j<c",
"j",
"c",
"j++",
"j++",
"j",
"{\n a[i][j] = Integer.parseInt(str[j]);\n a[i][c] += a[i][j];\n a[r][j] += a[i][j];\n }",
"{\n a[i][j] = Integer.parseInt(str[j]);\n a[i][c] += a[i][j];\n a[r][j] += a[i][j];\n }",
"a[i][j] = Integer.parseInt(str[j])",
"a[i][j]",
"a[i]",
"a",
"i",
"j",
"Integer.parseInt(str[j])",
"Integer.parseInt",
"Integer",
"str[j]",
"str",
"j",
"a[i][c] += a[i][j]",
"a[i][c]",
"a[i]",
"a",
"i",
"c",
"a[i][j]",
"a[i]",
"a",
"i",
"j",
"a[r][j] += a[i][j]",
"a[r][j]",
"a[r]",
"a",
"r",
"j",
"a[i][j]",
"a[i]",
"a",
"i",
"j",
"a[r][c] += a[i][c]",
"a[r][c]",
"a[r]",
"a",
"r",
"c",
"a[i][c]",
"a[i]",
"a",
"i",
"c",
"for(int i=0;i<r+1;i++){\n for(int j=0;j<c+1;j++){\n if(j<c) System.out.print(a[i][j]+\" \");\n else System.out.println(a[i][j]);\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) System.out.print(a[i][j]+\" \");\n else System.out.println(a[i][j]);\n }\n }",
"{\n for(int j=0;j<c+1;j++){\n if(j<c) System.out.print(a[i][j]+\" \");\n else System.out.println(a[i][j]);\n }\n }",
"for(int j=0;j<c+1;j++){\n if(j<c) System.out.print(a[i][j]+\" \");\n else System.out.println(a[i][j]);\n }",
"int j=0;",
"int j=0;",
"j",
"0",
"j<c+1",
"j",
"c+1",
"c",
"1",
"j++",
"j++",
"j",
"{\n if(j<c) System.out.print(a[i][j]+\" \");\n else System.out.println(a[i][j]);\n }",
"{\n if(j<c) System.out.print(a[i][j]+\" \");\n else System.out.println(a[i][j]);\n }",
"if(j<c) System.out.print(a[i][j]+\" \");\n else System.out.println(a[i][j]);",
"j<c",
"j",
"c",
"System.out.print(a[i][j]+\" \")",
"System.out.print",
"System.out",
"System",
"System.out",
"a[i][j]+\" \"",
"a[i][j]",
"a[i]",
"a",
"i",
"j",
"\" \"",
"System.out.println(a[i][j])",
"System.out.println",
"System.out",
"System",
"System.out",
"a[i][j]",
"a[i]",
"a",
"i",
"j",
"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 String str[] = br.readLine().split(\" \");\n int r = Integer.parseInt(str[0]);\n int c = Integer.parseInt(str[1]);\n int[][] a = new int[r+1][c+1];\n for(int i=0;i<r;i++){\n str = br.readLine().split(\" \");\n for(int j=0;j<c;j++){\n a[i][j] = Integer.parseInt(str[j]);\n a[i][c] += a[i][j];\n a[r][j] += a[i][j];\n }\n a[r][c] += a[i][c];\n }\n for(int i=0;i<r+1;i++){\n for(int j=0;j<c+1;j++){\n if(j<c) System.out.print(a[i][j]+\" \");\n else System.out.println(a[i][j]);\n }\n }\n }\n}",
"public class Main {\n public static void main(String[] args) throws IOException {\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n String str[] = br.readLine().split(\" \");\n int r = Integer.parseInt(str[0]);\n int c = Integer.parseInt(str[1]);\n int[][] a = new int[r+1][c+1];\n for(int i=0;i<r;i++){\n str = br.readLine().split(\" \");\n for(int j=0;j<c;j++){\n a[i][j] = Integer.parseInt(str[j]);\n a[i][c] += a[i][j];\n a[r][j] += a[i][j];\n }\n a[r][c] += a[i][c];\n }\n for(int i=0;i<r+1;i++){\n for(int j=0;j<c+1;j++){\n if(j<c) System.out.print(a[i][j]+\" \");\n else System.out.println(a[i][j]);\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 str[] = br.readLine().split(" ");
int r = Integer.parseInt(str[0]);
int c = Integer.parseInt(str[1]);
int[][] a = new int[r+1][c+1];
for(int i=0;i<r;i++){
str = br.readLine().split(" ");
for(int j=0;j<c;j++){
a[i][j] = Integer.parseInt(str[j]);
a[i][c] += a[i][j];
a[r][j] += a[i][j];
}
a[r][c] += a[i][c];
}
for(int i=0;i<r+1;i++){
for(int j=0;j<c+1;j++){
if(j<c) System.out.print(a[i][j]+" ");
else System.out.println(a[i][j]);
}
}
}
} |
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
4,
18,
13,
17,
41,
13,
4,
18,
13,
18,
13,
17,
41,
13,
4,
18,
13,
18,
13,
17,
41,
13,
20,
13,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
4,
18,
4,
18,
13,
17,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
18,
18,
13,
13,
13,
4,
18,
13,
18,
13,
13,
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,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
18,
18,
13,
13,
13,
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
],
[
16,
17
],
[
17,
18
],
[
14,
19
],
[
8,
20
],
[
20,
21
],
[
20,
22
],
[
22,
23
],
[
23,
24
],
[
22,
25
],
[
25,
26
],
[
25,
27
],
[
8,
28
],
[
28,
29
],
[
28,
30
],
[
30,
31
],
[
31,
32
],
[
30,
33
],
[
33,
34
],
[
33,
35
],
[
8,
36
],
[
36,
37
],
[
36,
38
],
[
8,
41
],
[
41,
42
],
[
42,
43
],
[
43,
44
],
[
43,
45
],
[
41,
46
],
[
46,
47
],
[
46,
48
],
[
41,
49
],
[
49,
50
],
[
50,
51
],
[
41,
52
],
[
53,
53
],
[
53,
54
],
[
54,
55
],
[
54,
56
],
[
56,
57
],
[
57,
58
],
[
58,
59
],
[
59,
60
],
[
56,
61
],
[
53,
62
],
[
62,
63
],
[
62,
64
],
[
53,
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
],
[
84,
87
],
[
87,
88
],
[
87,
89
],
[
77,
90
],
[
90,
91
],
[
91,
92
],
[
92,
93
],
[
92,
94
],
[
90,
95
],
[
95,
96
],
[
96,
97
],
[
97,
98
],
[
97,
99
],
[
96,
100
],
[
95,
101
],
[
77,
102
],
[
102,
103
],
[
102,
104
],
[
104,
105
],
[
105,
106
],
[
105,
107
],
[
104,
108
],
[
53,
109
],
[
109,
110
],
[
110,
111
],
[
111,
112
],
[
111,
113
],
[
109,
114
],
[
8,
115
],
[
115,
116
],
[
115,
117
],
[
8,
118
],
[
118,
119
],
[
119,
120
],
[
120,
121
],
[
120,
122
],
[
118,
123
],
[
123,
124
],
[
123,
125
],
[
118,
126
],
[
126,
127
],
[
127,
128
],
[
118,
129
],
[
130,
130
],
[
130,
131
],
[
131,
132
],
[
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
],
[
146,
154
],
[
154,
155
],
[
154,
156
],
[
156,
157
],
[
157,
158
],
[
157,
159
],
[
156,
160
],
[
130,
161
],
[
161,
162
],
[
162,
163
],
[
163,
164
],
[
163,
165
],
[
161,
166
],
[
166,
167
],
[
166,
168
],
[
8,
169
],
[
169,
170
],
[
170,
171
],
[
171,
172
],
[
171,
173
],
[
169,
174
],
[
6,
175
],
[
175,
176
]
] | [
"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 String[] a=br.readLine().split(\" \");\n int r=Integer.parseInt(a[0]);\n int c=Integer.parseInt(a[1]);\n int[][] h=new int[r][c];\n for(int i=0;i<r;i++){\n \ta=br.readLine().split(\" \");\n \tint s=0;\n \tfor(int j=0;j<c;j++){\n \t\th[i][j]=Integer.parseInt(a[j]);\n \t\tSystem.out.print(h[i][j]+\" \");\n \t\ts+=h[i][j];\n \t}\n \tSystem.out.println(s);\n }\n int ts=0;\n for(int j=0;j<c;j++){\n \tint s=0;\n \tfor(int i=0;i<r;i++){\n \t\ts+=h[i][j];\n \t\tts+=h[i][j];\n \t}\n \tSystem.out.print(s+\" \");\n }\n System.out.println(ts);\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 String[] a=br.readLine().split(\" \");\n int r=Integer.parseInt(a[0]);\n int c=Integer.parseInt(a[1]);\n int[][] h=new int[r][c];\n for(int i=0;i<r;i++){\n \ta=br.readLine().split(\" \");\n \tint s=0;\n \tfor(int j=0;j<c;j++){\n \t\th[i][j]=Integer.parseInt(a[j]);\n \t\tSystem.out.print(h[i][j]+\" \");\n \t\ts+=h[i][j];\n \t}\n \tSystem.out.println(s);\n }\n int ts=0;\n for(int j=0;j<c;j++){\n \tint s=0;\n \tfor(int i=0;i<r;i++){\n \t\ts+=h[i][j];\n \t\tts+=h[i][j];\n \t}\n \tSystem.out.print(s+\" \");\n }\n System.out.println(ts);\n\t}\n}",
"Main",
"public static void main(String[] args) throws Exception {\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n String[] a=br.readLine().split(\" \");\n int r=Integer.parseInt(a[0]);\n int c=Integer.parseInt(a[1]);\n int[][] h=new int[r][c];\n for(int i=0;i<r;i++){\n \ta=br.readLine().split(\" \");\n \tint s=0;\n \tfor(int j=0;j<c;j++){\n \t\th[i][j]=Integer.parseInt(a[j]);\n \t\tSystem.out.print(h[i][j]+\" \");\n \t\ts+=h[i][j];\n \t}\n \tSystem.out.println(s);\n }\n int ts=0;\n for(int j=0;j<c;j++){\n \tint s=0;\n \tfor(int i=0;i<r;i++){\n \t\ts+=h[i][j];\n \t\tts+=h[i][j];\n \t}\n \tSystem.out.print(s+\" \");\n }\n System.out.println(ts);\n\t}",
"main",
"{\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n String[] a=br.readLine().split(\" \");\n int r=Integer.parseInt(a[0]);\n int c=Integer.parseInt(a[1]);\n int[][] h=new int[r][c];\n for(int i=0;i<r;i++){\n \ta=br.readLine().split(\" \");\n \tint s=0;\n \tfor(int j=0;j<c;j++){\n \t\th[i][j]=Integer.parseInt(a[j]);\n \t\tSystem.out.print(h[i][j]+\" \");\n \t\ts+=h[i][j];\n \t}\n \tSystem.out.println(s);\n }\n int ts=0;\n for(int j=0;j<c;j++){\n \tint s=0;\n \tfor(int i=0;i<r;i++){\n \t\ts+=h[i][j];\n \t\tts+=h[i][j];\n \t}\n \tSystem.out.print(s+\" \");\n }\n System.out.println(ts);\n\t}",
"BufferedReader br = new BufferedReader(new InputStreamReader(System.in));",
"br",
"new BufferedReader(new InputStreamReader(System.in))",
"String[] a=br.readLine().split(\" \");",
"a",
"br.readLine().split(\" \")",
"br.readLine().split",
"br.readLine()",
"br.readLine",
"br",
"\" \"",
"int r=Integer.parseInt(a[0]);",
"r",
"Integer.parseInt(a[0])",
"Integer.parseInt",
"Integer",
"a[0]",
"a",
"0",
"int c=Integer.parseInt(a[1]);",
"c",
"Integer.parseInt(a[1])",
"Integer.parseInt",
"Integer",
"a[1]",
"a",
"1",
"int[][] h=new int[r][c];",
"h",
"new int[r][c]",
"r",
"c",
"for(int i=0;i<r;i++){\n \ta=br.readLine().split(\" \");\n \tint s=0;\n \tfor(int j=0;j<c;j++){\n \t\th[i][j]=Integer.parseInt(a[j]);\n \t\tSystem.out.print(h[i][j]+\" \");\n \t\ts+=h[i][j];\n \t}\n \tSystem.out.println(s);\n }",
"int i=0;",
"int i=0;",
"i",
"0",
"i<r",
"i",
"r",
"i++",
"i++",
"i",
"{\n \ta=br.readLine().split(\" \");\n \tint s=0;\n \tfor(int j=0;j<c;j++){\n \t\th[i][j]=Integer.parseInt(a[j]);\n \t\tSystem.out.print(h[i][j]+\" \");\n \t\ts+=h[i][j];\n \t}\n \tSystem.out.println(s);\n }",
"{\n \ta=br.readLine().split(\" \");\n \tint s=0;\n \tfor(int j=0;j<c;j++){\n \t\th[i][j]=Integer.parseInt(a[j]);\n \t\tSystem.out.print(h[i][j]+\" \");\n \t\ts+=h[i][j];\n \t}\n \tSystem.out.println(s);\n }",
"a=br.readLine().split(\" \")",
"a",
"br.readLine().split(\" \")",
"br.readLine().split",
"br.readLine()",
"br.readLine",
"br",
"\" \"",
"int s=0;",
"s",
"0",
"for(int j=0;j<c;j++){\n \t\th[i][j]=Integer.parseInt(a[j]);\n \t\tSystem.out.print(h[i][j]+\" \");\n \t\ts+=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(a[j]);\n \t\tSystem.out.print(h[i][j]+\" \");\n \t\ts+=h[i][j];\n \t}",
"{\n \t\th[i][j]=Integer.parseInt(a[j]);\n \t\tSystem.out.print(h[i][j]+\" \");\n \t\ts+=h[i][j];\n \t}",
"h[i][j]=Integer.parseInt(a[j])",
"h[i][j]",
"h[i]",
"h",
"i",
"j",
"Integer.parseInt(a[j])",
"Integer.parseInt",
"Integer",
"a[j]",
"a",
"j",
"System.out.print(h[i][j]+\" \")",
"System.out.print",
"System.out",
"System",
"System.out",
"h[i][j]+\" \"",
"h[i][j]",
"h[i]",
"h",
"i",
"j",
"\" \"",
"s+=h[i][j]",
"s",
"h[i][j]",
"h[i]",
"h",
"i",
"j",
"System.out.println(s)",
"System.out.println",
"System.out",
"System",
"System.out",
"s",
"int ts=0;",
"ts",
"0",
"for(int j=0;j<c;j++){\n \tint s=0;\n \tfor(int i=0;i<r;i++){\n \t\ts+=h[i][j];\n \t\tts+=h[i][j];\n \t}\n \tSystem.out.print(s+\" \");\n }",
"int j=0;",
"int j=0;",
"j",
"0",
"j<c",
"j",
"c",
"j++",
"j++",
"j",
"{\n \tint s=0;\n \tfor(int i=0;i<r;i++){\n \t\ts+=h[i][j];\n \t\tts+=h[i][j];\n \t}\n \tSystem.out.print(s+\" \");\n }",
"{\n \tint s=0;\n \tfor(int i=0;i<r;i++){\n \t\ts+=h[i][j];\n \t\tts+=h[i][j];\n \t}\n \tSystem.out.print(s+\" \");\n }",
"int s=0;",
"s",
"0",
"for(int i=0;i<r;i++){\n \t\ts+=h[i][j];\n \t\tts+=h[i][j];\n \t}",
"int i=0;",
"int i=0;",
"i",
"0",
"i<r",
"i",
"r",
"i++",
"i++",
"i",
"{\n \t\ts+=h[i][j];\n \t\tts+=h[i][j];\n \t}",
"{\n \t\ts+=h[i][j];\n \t\tts+=h[i][j];\n \t}",
"s+=h[i][j]",
"s",
"h[i][j]",
"h[i]",
"h",
"i",
"j",
"ts+=h[i][j]",
"ts",
"h[i][j]",
"h[i]",
"h",
"i",
"j",
"System.out.print(s+\" \")",
"System.out.print",
"System.out",
"System",
"System.out",
"s+\" \"",
"s",
"\" \"",
"System.out.println(ts)",
"System.out.println",
"System.out",
"System",
"System.out",
"ts",
"String[] args",
"args"
] | import java.io.*;
class Main {
public static void main(String[] args) throws Exception {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
String[] a=br.readLine().split(" ");
int r=Integer.parseInt(a[0]);
int c=Integer.parseInt(a[1]);
int[][] h=new int[r][c];
for(int i=0;i<r;i++){
a=br.readLine().split(" ");
int s=0;
for(int j=0;j<c;j++){
h[i][j]=Integer.parseInt(a[j]);
System.out.print(h[i][j]+" ");
s+=h[i][j];
}
System.out.println(s);
}
int ts=0;
for(int j=0;j<c;j++){
int s=0;
for(int i=0;i<r;i++){
s+=h[i][j];
ts+=h[i][j];
}
System.out.print(s+" ");
}
System.out.println(ts);
}
} |
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
41,
13,
0,
13,
20,
2,
13,
17,
2,
13,
17,
11,
1,
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,
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,
14,
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,
18,
18,
13,
13,
13,
14,
2,
2,
13,
13,
2,
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,
2,
13,
13,
2,
13,
13,
4,
18,
18,
13,
13,
18,
18,
13,
13,
13,
14,
2,
2,
13,
13,
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,
4,
18,
13,
23,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
8,
17
],
[
17,
18
],
[
17,
19
],
[
19,
20
],
[
20,
21
],
[
8,
22
],
[
22,
23
],
[
8,
24
],
[
24,
25
],
[
24,
26
],
[
27,
28
],
[
27,
29
],
[
30,
31
],
[
30,
32
],
[
8,
33
],
[
33,
34
],
[
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
],
[
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
],
[
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
],
[
133,
134
],
[
134,
135
],
[
134,
136
],
[
133,
137
],
[
132,
138
],
[
138,
139
],
[
139,
140
],
[
139,
141
],
[
138,
142
],
[
126,
143
],
[
143,
144
],
[
144,
145
],
[
144,
146
],
[
143,
147
],
[
147,
148
],
[
148,
149
],
[
149,
150
],
[
150,
151
],
[
150,
152
],
[
149,
153
],
[
148,
154
],
[
154,
155
],
[
155,
156
],
[
155,
157
],
[
154,
158
],
[
126,
159
],
[
159,
160
],
[
160,
161
],
[
161,
162
],
[
161,
163
],
[
160,
164
],
[
164,
165
],
[
164,
166
],
[
159,
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
],
[
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
],
[
192,
194
],
[
187,
195
],
[
195,
196
],
[
196,
197
],
[
187,
198
],
[
199,
199
],
[
199,
200
],
[
200,
201
],
[
201,
202
],
[
202,
203
],
[
202,
204
],
[
201,
205
],
[
205,
206
],
[
205,
207
],
[
200,
208
],
[
208,
209
],
[
209,
210
],
[
210,
211
],
[
210,
212
],
[
208,
213
],
[
213,
214
],
[
214,
215
],
[
214,
216
],
[
213,
217
],
[
200,
218
],
[
218,
219
],
[
219,
220
],
[
220,
221
],
[
220,
222
],
[
219,
223
],
[
223,
224
],
[
223,
225
],
[
218,
226
],
[
226,
227
],
[
227,
228
],
[
228,
229
],
[
228,
230
],
[
226,
231
],
[
231,
232
],
[
232,
233
],
[
232,
234
],
[
231,
235
],
[
218,
236
],
[
236,
237
],
[
237,
238
],
[
238,
239
],
[
238,
240
],
[
236,
241
],
[
241,
242
],
[
242,
243
],
[
243,
244
],
[
243,
245
],
[
242,
246
],
[
241,
247
],
[
8,
248
],
[
248,
249
],
[
249,
250
],
[
6,
251
],
[
251,
252
]
] | [
"import java.util.Scanner;\n\nclass Main {\n public static void main(String args[]) {\n\t \tScanner scanner = new Scanner(System.in);\n\t \tint r = scanner.nextInt();\n\t \tint c = scanner.nextInt();\n\t \tint[][] array;//配列確保\n array = new int[r + 5][c + 5];\n \n //初期化\n for (int i = 0; i <= r; i++) {\n \tfor (int j = 0; j <= c; j++) {\n \t\tarray[i][j] = 0;\n\t }\n }\n // データ入力\n for (int i = 0; i < r; i++) {\n \tfor (int j = 0; j < c; j++) {\n \t\tarray[i][j] = scanner.nextInt();\n\t }\n }\n \n // データ補完\n for (int i = 0; i <= r; i++) {\n \tfor (int j = 0; j <= c; j++) {\n\t if( j < c ) {\n\t \tarray[i][c] += array[i][j];\n\t }\n\t\t \n\t if( i < r ) {\n\t \tarray[r][j] += array[i][j];\n\t }\n\n\t if( i == r && j == c )\n\t \t \tarray[r][c] /= 2;\n\t \n \t}\n }\n \n for (int i = 0; i <= r; i++) {\n \tfor (int j = 0; j <= c; j++) {\n\t if( j == c && i < r )\n \t\t\tSystem.out.println(array[i][j] );\n\t else if( j == c && i == r )\n \t\t\tSystem.out.println(array[i][j]);\n\t else\n \t\t\tSystem.out.print(array[i][j] + \" \");\n\t }\n }\n scanner.close();\n }\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"class Main {\n public static void main(String args[]) {\n\t \tScanner scanner = new Scanner(System.in);\n\t \tint r = scanner.nextInt();\n\t \tint c = scanner.nextInt();\n\t \tint[][] array;//配列確保\n array = new int[r + 5][c + 5];\n \n //初期化\n for (int i = 0; i <= r; i++) {\n \tfor (int j = 0; j <= c; j++) {\n \t\tarray[i][j] = 0;\n\t }\n }\n // データ入力\n for (int i = 0; i < r; i++) {\n \tfor (int j = 0; j < c; j++) {\n \t\tarray[i][j] = scanner.nextInt();\n\t }\n }\n \n // データ補完\n for (int i = 0; i <= r; i++) {\n \tfor (int j = 0; j <= c; j++) {\n\t if( j < c ) {\n\t \tarray[i][c] += array[i][j];\n\t }\n\t\t \n\t if( i < r ) {\n\t \tarray[r][j] += array[i][j];\n\t }\n\n\t if( i == r && j == c )\n\t \t \tarray[r][c] /= 2;\n\t \n \t}\n }\n \n for (int i = 0; i <= r; i++) {\n \tfor (int j = 0; j <= c; j++) {\n\t if( j == c && i < r )\n \t\t\tSystem.out.println(array[i][j] );\n\t else if( j == c && i == r )\n \t\t\tSystem.out.println(array[i][j]);\n\t else\n \t\t\tSystem.out.print(array[i][j] + \" \");\n\t }\n }\n scanner.close();\n }\n}",
"Main",
"public static void main(String args[]) {\n\t \tScanner scanner = new Scanner(System.in);\n\t \tint r = scanner.nextInt();\n\t \tint c = scanner.nextInt();\n\t \tint[][] array;//配列確保\n array = new int[r + 5][c + 5];\n \n //初期化\n for (int i = 0; i <= r; i++) {\n \tfor (int j = 0; j <= c; j++) {\n \t\tarray[i][j] = 0;\n\t }\n }\n // データ入力\n for (int i = 0; i < r; i++) {\n \tfor (int j = 0; j < c; j++) {\n \t\tarray[i][j] = scanner.nextInt();\n\t }\n }\n \n // データ補完\n for (int i = 0; i <= r; i++) {\n \tfor (int j = 0; j <= c; j++) {\n\t if( j < c ) {\n\t \tarray[i][c] += array[i][j];\n\t }\n\t\t \n\t if( i < r ) {\n\t \tarray[r][j] += array[i][j];\n\t }\n\n\t if( i == r && j == c )\n\t \t \tarray[r][c] /= 2;\n\t \n \t}\n }\n \n for (int i = 0; i <= r; i++) {\n \tfor (int j = 0; j <= c; j++) {\n\t if( j == c && i < r )\n \t\t\tSystem.out.println(array[i][j] );\n\t else if( j == c && i == r )\n \t\t\tSystem.out.println(array[i][j]);\n\t else\n \t\t\tSystem.out.print(array[i][j] + \" \");\n\t }\n }\n scanner.close();\n }",
"main",
"{\n\t \tScanner scanner = new Scanner(System.in);\n\t \tint r = scanner.nextInt();\n\t \tint c = scanner.nextInt();\n\t \tint[][] array;//配列確保\n array = new int[r + 5][c + 5];\n \n //初期化\n for (int i = 0; i <= r; i++) {\n \tfor (int j = 0; j <= c; j++) {\n \t\tarray[i][j] = 0;\n\t }\n }\n // データ入力\n for (int i = 0; i < r; i++) {\n \tfor (int j = 0; j < c; j++) {\n \t\tarray[i][j] = scanner.nextInt();\n\t }\n }\n \n // データ補完\n for (int i = 0; i <= r; i++) {\n \tfor (int j = 0; j <= c; j++) {\n\t if( j < c ) {\n\t \tarray[i][c] += array[i][j];\n\t }\n\t\t \n\t if( i < r ) {\n\t \tarray[r][j] += array[i][j];\n\t }\n\n\t if( i == r && j == c )\n\t \t \tarray[r][c] /= 2;\n\t \n \t}\n }\n \n for (int i = 0; i <= r; i++) {\n \tfor (int j = 0; j <= c; j++) {\n\t if( j == c && i < r )\n \t\t\tSystem.out.println(array[i][j] );\n\t else if( j == c && i == r )\n \t\t\tSystem.out.println(array[i][j]);\n\t else\n \t\t\tSystem.out.print(array[i][j] + \" \");\n\t }\n }\n scanner.close();\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[][] array;",
"array",
"array = new int[r + 5][c + 5]",
"array",
"new int[r + 5][c + 5]",
"r + 5",
"r",
"5",
"c + 5",
"c",
"5",
"for (int i = 0; i <= r; i++) {\n \tfor (int j = 0; j <= c; j++) {\n \t\tarray[i][j] = 0;\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\tarray[i][j] = 0;\n\t }\n }",
"{\n \tfor (int j = 0; j <= c; j++) {\n \t\tarray[i][j] = 0;\n\t }\n }",
"for (int j = 0; j <= c; j++) {\n \t\tarray[i][j] = 0;\n\t }",
"int j = 0;",
"int j = 0;",
"j",
"0",
"j <= c",
"j",
"c",
"j++",
"j++",
"j",
"{\n \t\tarray[i][j] = 0;\n\t }",
"{\n \t\tarray[i][j] = 0;\n\t }",
"array[i][j] = 0",
"array[i][j]",
"array[i]",
"array",
"i",
"j",
"0",
"for (int i = 0; i < r; i++) {\n \tfor (int j = 0; j < c; j++) {\n \t\tarray[i][j] = scanner.nextInt();\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\tarray[i][j] = scanner.nextInt();\n\t }\n }",
"{\n \tfor (int j = 0; j < c; j++) {\n \t\tarray[i][j] = scanner.nextInt();\n\t }\n }",
"for (int j = 0; j < c; j++) {\n \t\tarray[i][j] = scanner.nextInt();\n\t }",
"int j = 0;",
"int j = 0;",
"j",
"0",
"j < c",
"j",
"c",
"j++",
"j++",
"j",
"{\n \t\tarray[i][j] = scanner.nextInt();\n\t }",
"{\n \t\tarray[i][j] = scanner.nextInt();\n\t }",
"array[i][j] = scanner.nextInt()",
"array[i][j]",
"array[i]",
"array",
"i",
"j",
"scanner.nextInt()",
"scanner.nextInt",
"scanner",
"for (int i = 0; i <= r; i++) {\n \tfor (int j = 0; j <= c; j++) {\n\t if( j < c ) {\n\t \tarray[i][c] += array[i][j];\n\t }\n\t\t \n\t if( i < r ) {\n\t \tarray[r][j] += array[i][j];\n\t }\n\n\t if( i == r && j == c )\n\t \t \tarray[r][c] /= 2;\n\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 if( j < c ) {\n\t \tarray[i][c] += array[i][j];\n\t }\n\t\t \n\t if( i < r ) {\n\t \tarray[r][j] += array[i][j];\n\t }\n\n\t if( i == r && j == c )\n\t \t \tarray[r][c] /= 2;\n\t \n \t}\n }",
"{\n \tfor (int j = 0; j <= c; j++) {\n\t if( j < c ) {\n\t \tarray[i][c] += array[i][j];\n\t }\n\t\t \n\t if( i < r ) {\n\t \tarray[r][j] += array[i][j];\n\t }\n\n\t if( i == r && j == c )\n\t \t \tarray[r][c] /= 2;\n\t \n \t}\n }",
"for (int j = 0; j <= c; j++) {\n\t if( j < c ) {\n\t \tarray[i][c] += array[i][j];\n\t }\n\t\t \n\t if( i < r ) {\n\t \tarray[r][j] += array[i][j];\n\t }\n\n\t if( i == r && j == c )\n\t \t \tarray[r][c] /= 2;\n\t \n \t}",
"int j = 0;",
"int j = 0;",
"j",
"0",
"j <= c",
"j",
"c",
"j++",
"j++",
"j",
"{\n\t if( j < c ) {\n\t \tarray[i][c] += array[i][j];\n\t }\n\t\t \n\t if( i < r ) {\n\t \tarray[r][j] += array[i][j];\n\t }\n\n\t if( i == r && j == c )\n\t \t \tarray[r][c] /= 2;\n\t \n \t}",
"{\n\t if( j < c ) {\n\t \tarray[i][c] += array[i][j];\n\t }\n\t\t \n\t if( i < r ) {\n\t \tarray[r][j] += array[i][j];\n\t }\n\n\t if( i == r && j == c )\n\t \t \tarray[r][c] /= 2;\n\t \n \t}",
"if( j < c ) {\n\t \tarray[i][c] += array[i][j];\n\t }",
"j < c",
"j",
"c",
"{\n\t \tarray[i][c] += array[i][j];\n\t }",
"array[i][c] += array[i][j]",
"array[i][c]",
"array[i]",
"array",
"i",
"c",
"array[i][j]",
"array[i]",
"array",
"i",
"j",
"if( i < r ) {\n\t \tarray[r][j] += array[i][j];\n\t }",
"i < r",
"i",
"r",
"{\n\t \tarray[r][j] += array[i][j];\n\t }",
"array[r][j] += array[i][j]",
"array[r][j]",
"array[r]",
"array",
"r",
"j",
"array[i][j]",
"array[i]",
"array",
"i",
"j",
"if( i == r && j == c )\n\t \t \tarray[r][c] /= 2;",
"i == r && j == c",
"i == r",
"i",
"r",
"j == c",
"j",
"c",
"array[r][c] /= 2",
"array[r][c]",
"array[r]",
"array",
"r",
"c",
"2",
"for (int i = 0; i <= r; i++) {\n \tfor (int j = 0; j <= c; j++) {\n\t if( j == c && i < r )\n \t\t\tSystem.out.println(array[i][j] );\n\t else if( j == c && i == r )\n \t\t\tSystem.out.println(array[i][j]);\n\t else\n \t\t\tSystem.out.print(array[i][j] + \" \");\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 if( j == c && i < r )\n \t\t\tSystem.out.println(array[i][j] );\n\t else if( j == c && i == r )\n \t\t\tSystem.out.println(array[i][j]);\n\t else\n \t\t\tSystem.out.print(array[i][j] + \" \");\n\t }\n }",
"{\n \tfor (int j = 0; j <= c; j++) {\n\t if( j == c && i < r )\n \t\t\tSystem.out.println(array[i][j] );\n\t else if( j == c && i == r )\n \t\t\tSystem.out.println(array[i][j]);\n\t else\n \t\t\tSystem.out.print(array[i][j] + \" \");\n\t }\n }",
"for (int j = 0; j <= c; j++) {\n\t if( j == c && i < r )\n \t\t\tSystem.out.println(array[i][j] );\n\t else if( j == c && i == r )\n \t\t\tSystem.out.println(array[i][j]);\n\t else\n \t\t\tSystem.out.print(array[i][j] + \" \");\n\t }",
"int j = 0;",
"int j = 0;",
"j",
"0",
"j <= c",
"j",
"c",
"j++",
"j++",
"j",
"{\n\t if( j == c && i < r )\n \t\t\tSystem.out.println(array[i][j] );\n\t else if( j == c && i == r )\n \t\t\tSystem.out.println(array[i][j]);\n\t else\n \t\t\tSystem.out.print(array[i][j] + \" \");\n\t }",
"{\n\t if( j == c && i < r )\n \t\t\tSystem.out.println(array[i][j] );\n\t else if( j == c && i == r )\n \t\t\tSystem.out.println(array[i][j]);\n\t else\n \t\t\tSystem.out.print(array[i][j] + \" \");\n\t }",
"if( j == c && i < r )\n \t\t\tSystem.out.println(array[i][j] );\n\t else if( j == c && i == r )\n \t\t\tSystem.out.println(array[i][j]);\n\t else\n \t\t\tSystem.out.print(array[i][j] + \" \");",
"j == c && i < r",
"j == c",
"j",
"c",
"i < r",
"i",
"r",
"System.out.println(array[i][j] )",
"System.out.println",
"System.out",
"System",
"System.out",
"array[i][j]",
"array[i]",
"array",
"i",
"j",
"if( j == c && i == r )\n \t\t\tSystem.out.println(array[i][j]);\n\t else\n \t\t\tSystem.out.print(array[i][j] + \" \");",
"j == c && i == r",
"j == c",
"j",
"c",
"i == r",
"i",
"r",
"System.out.println(array[i][j])",
"System.out.println",
"System.out",
"System",
"System.out",
"array[i][j]",
"array[i]",
"array",
"i",
"j",
"System.out.print(array[i][j] + \" \")",
"System.out.print",
"System.out",
"System",
"System.out",
"array[i][j] + \" \"",
"array[i][j]",
"array[i]",
"array",
"i",
"j",
"\" \"",
"scanner.close()",
"scanner.close",
"scanner",
"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();
int c = scanner.nextInt();
int[][] array;//配列確保
array = new int[r + 5][c + 5];
//初期化
for (int i = 0; i <= r; i++) {
for (int j = 0; j <= c; j++) {
array[i][j] = 0;
}
}
// データ入力
for (int i = 0; i < r; i++) {
for (int j = 0; j < c; j++) {
array[i][j] = scanner.nextInt();
}
}
// データ補完
for (int i = 0; i <= r; i++) {
for (int j = 0; j <= c; j++) {
if( j < c ) {
array[i][c] += array[i][j];
}
if( i < r ) {
array[r][j] += array[i][j];
}
if( i == r && j == c )
array[r][c] /= 2;
}
}
for (int i = 0; i <= r; i++) {
for (int j = 0; j <= c; j++) {
if( j == c && i < r )
System.out.println(array[i][j] );
else if( j == c && i == r )
System.out.println(array[i][j]);
else
System.out.print(array[i][j] + " ");
}
}
scanner.close();
}
}
|
[
7,
15,
13,
17,
15,
13,
17,
6,
13,
41,
13,
20,
12,
13,
30,
4,
18,
20,
23,
13,
12,
13,
30,
41,
13,
41,
13,
41,
13,
41,
13,
0,
13,
4,
18,
13,
0,
13,
4,
18,
13,
0,
13,
20,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
18,
13,
13,
20,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
18,
18,
13,
13,
13,
4,
18,
13,
0,
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,
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,
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,
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,
2,
18,
18,
13,
13,
13,
17,
4,
18,
18,
13,
13,
18,
18,
13,
13,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
284,
8
],
[
284,
9
],
[
9,
10
],
[
9,
11
],
[
284,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
16,
17
],
[
12,
18
],
[
18,
19
],
[
284,
20
],
[
20,
21
],
[
20,
22
],
[
22,
23
],
[
23,
24
],
[
22,
25
],
[
25,
26
],
[
22,
27
],
[
27,
28
],
[
22,
29
],
[
29,
30
],
[
22,
31
],
[
31,
32
],
[
31,
33
],
[
33,
34
],
[
34,
35
],
[
22,
36
],
[
36,
37
],
[
36,
38
],
[
38,
39
],
[
39,
40
],
[
22,
41
],
[
41,
42
],
[
41,
43
],
[
22,
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
],
[
59,
61
],
[
58,
62
],
[
57,
64
],
[
64,
65
],
[
65,
66
],
[
66,
67
],
[
66,
68
],
[
64,
69
],
[
69,
70
],
[
69,
71
],
[
64,
72
],
[
72,
73
],
[
73,
74
],
[
64,
75
],
[
76,
76
],
[
76,
77
],
[
77,
78
],
[
78,
79
],
[
79,
80
],
[
79,
81
],
[
78,
82
],
[
77,
83
],
[
83,
84
],
[
84,
85
],
[
22,
86
],
[
86,
87
],
[
86,
88
],
[
89,
90
],
[
89,
91
],
[
92,
93
],
[
92,
94
],
[
22,
95
],
[
95,
96
],
[
95,
97
],
[
22,
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
],
[
123,
135
],
[
135,
136
],
[
135,
137
],
[
137,
138
],
[
138,
139
],
[
138,
140
],
[
137,
141
],
[
22,
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
],
[
154,
158
],
[
158,
159
],
[
159,
160
],
[
160,
161
],
[
160,
162
],
[
158,
163
],
[
163,
164
],
[
163,
165
],
[
158,
166
],
[
166,
167
],
[
167,
168
],
[
158,
169
],
[
170,
170
],
[
170,
171
],
[
171,
172
],
[
171,
173
],
[
173,
174
],
[
174,
175
],
[
174,
176
],
[
173,
177
],
[
154,
178
],
[
178,
179
],
[
179,
180
],
[
180,
181
],
[
180,
182
],
[
179,
183
],
[
178,
184
],
[
22,
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
],
[
198,
200
],
[
197,
201
],
[
201,
202
],
[
202,
203
],
[
203,
204
],
[
203,
205
],
[
201,
206
],
[
206,
207
],
[
206,
208
],
[
201,
209
],
[
209,
210
],
[
210,
211
],
[
201,
212
],
[
213,
213
],
[
213,
214
],
[
214,
215
],
[
214,
216
],
[
216,
217
],
[
217,
218
],
[
217,
219
],
[
216,
220
],
[
197,
221
],
[
221,
222
],
[
222,
223
],
[
223,
224
],
[
223,
225
],
[
222,
226
],
[
221,
227
],
[
22,
228
],
[
228,
229
],
[
229,
230
],
[
230,
231
],
[
230,
232
],
[
229,
233
],
[
228,
234
],
[
22,
235
],
[
235,
236
],
[
236,
237
],
[
237,
238
],
[
237,
239
],
[
235,
240
],
[
240,
241
],
[
240,
242
],
[
235,
243
],
[
243,
244
],
[
244,
245
],
[
235,
246
],
[
247,
247
],
[
247,
248
],
[
248,
249
],
[
249,
250
],
[
250,
251
],
[
250,
252
],
[
248,
253
],
[
253,
254
],
[
253,
255
],
[
248,
256
],
[
256,
257
],
[
257,
258
],
[
248,
259
],
[
260,
260
],
[
260,
261
],
[
261,
262
],
[
262,
263
],
[
263,
264
],
[
263,
265
],
[
261,
266
],
[
266,
267
],
[
267,
268
],
[
268,
269
],
[
268,
270
],
[
267,
271
],
[
266,
272
],
[
247,
273
],
[
273,
274
],
[
274,
275
],
[
275,
276
],
[
275,
277
],
[
273,
278
],
[
278,
279
],
[
279,
280
],
[
279,
281
],
[
278,
282
],
[
0,
283
],
[
283,
284
],
[
283,
285
]
] | [
"import java.util.Scanner;\nimport java.util.function.Function;\n\npublic class Main {\n\n public static void main(String[] args) {\n new Main().solve();\n }\n\n Scanner sc = new Scanner(System.in);\n\n void solve() {\n int r, c;\n int[][] input, output;\n r = sc.nextInt();\n c = sc.nextInt();\n input = new int[r][];\n for (int i = 0; i < r; ++i) {\n input[i] = new int[c];\n for (int j = 0; j < c; ++j) {\n input[i][j] = sc.nextInt();\n }\n }\n\n output = new int[r + 1][c + 1];\n int sum = 0;\n for (int i = 0; i < r; ++i) {\n for (int j = 0; j < c; ++j) {\n output[i][j] = input[i][j];\n sum += input[i][j];\n }\n }\n\n //h sum\n for (int i = 0; i < r; ++i) {\n int hsum = 0;\n for (int j = 0; j < c; ++j) {\n hsum += output[i][j];\n }\n output[i][c] = hsum;\n }\n\n //v sum\n for (int j = 0; j < c; ++j) {\n int vsum = 0;\n for (int i = 0; i < r; ++i) {\n vsum += output[i][j];\n }\n output[r][j] = vsum;\n }\n\n //sum\n output[r][c] = sum;\n\n for (int i = 0; i <= r; ++i) {\n for (int j = 0; j < c; ++j) {\n System.out.print(output[i][j] + \" \");\n }\n System.out.println(output[i][c]);\n }\n\n }\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"import java.util.function.Function;",
"Function",
"java.util.function",
"public class Main {\n\n public static void main(String[] args) {\n new Main().solve();\n }\n\n Scanner sc = new Scanner(System.in);\n\n void solve() {\n int r, c;\n int[][] input, output;\n r = sc.nextInt();\n c = sc.nextInt();\n input = new int[r][];\n for (int i = 0; i < r; ++i) {\n input[i] = new int[c];\n for (int j = 0; j < c; ++j) {\n input[i][j] = sc.nextInt();\n }\n }\n\n output = new int[r + 1][c + 1];\n int sum = 0;\n for (int i = 0; i < r; ++i) {\n for (int j = 0; j < c; ++j) {\n output[i][j] = input[i][j];\n sum += input[i][j];\n }\n }\n\n //h sum\n for (int i = 0; i < r; ++i) {\n int hsum = 0;\n for (int j = 0; j < c; ++j) {\n hsum += output[i][j];\n }\n output[i][c] = hsum;\n }\n\n //v sum\n for (int j = 0; j < c; ++j) {\n int vsum = 0;\n for (int i = 0; i < r; ++i) {\n vsum += output[i][j];\n }\n output[r][j] = vsum;\n }\n\n //sum\n output[r][c] = sum;\n\n for (int i = 0; i <= r; ++i) {\n for (int j = 0; j < c; ++j) {\n System.out.print(output[i][j] + \" \");\n }\n System.out.println(output[i][c]);\n }\n\n }\n}",
"Main",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"public static void main(String[] args) {\n new Main().solve();\n }",
"main",
"{\n new Main().solve();\n }",
"new Main().solve()",
"new Main().solve",
"new Main()",
"String[] args",
"args",
"void solve() {\n int r, c;\n int[][] input, output;\n r = sc.nextInt();\n c = sc.nextInt();\n input = new int[r][];\n for (int i = 0; i < r; ++i) {\n input[i] = new int[c];\n for (int j = 0; j < c; ++j) {\n input[i][j] = sc.nextInt();\n }\n }\n\n output = new int[r + 1][c + 1];\n int sum = 0;\n for (int i = 0; i < r; ++i) {\n for (int j = 0; j < c; ++j) {\n output[i][j] = input[i][j];\n sum += input[i][j];\n }\n }\n\n //h sum\n for (int i = 0; i < r; ++i) {\n int hsum = 0;\n for (int j = 0; j < c; ++j) {\n hsum += output[i][j];\n }\n output[i][c] = hsum;\n }\n\n //v sum\n for (int j = 0; j < c; ++j) {\n int vsum = 0;\n for (int i = 0; i < r; ++i) {\n vsum += output[i][j];\n }\n output[r][j] = vsum;\n }\n\n //sum\n output[r][c] = sum;\n\n for (int i = 0; i <= r; ++i) {\n for (int j = 0; j < c; ++j) {\n System.out.print(output[i][j] + \" \");\n }\n System.out.println(output[i][c]);\n }\n\n }",
"solve",
"{\n int r, c;\n int[][] input, output;\n r = sc.nextInt();\n c = sc.nextInt();\n input = new int[r][];\n for (int i = 0; i < r; ++i) {\n input[i] = new int[c];\n for (int j = 0; j < c; ++j) {\n input[i][j] = sc.nextInt();\n }\n }\n\n output = new int[r + 1][c + 1];\n int sum = 0;\n for (int i = 0; i < r; ++i) {\n for (int j = 0; j < c; ++j) {\n output[i][j] = input[i][j];\n sum += input[i][j];\n }\n }\n\n //h sum\n for (int i = 0; i < r; ++i) {\n int hsum = 0;\n for (int j = 0; j < c; ++j) {\n hsum += output[i][j];\n }\n output[i][c] = hsum;\n }\n\n //v sum\n for (int j = 0; j < c; ++j) {\n int vsum = 0;\n for (int i = 0; i < r; ++i) {\n vsum += output[i][j];\n }\n output[r][j] = vsum;\n }\n\n //sum\n output[r][c] = sum;\n\n for (int i = 0; i <= r; ++i) {\n for (int j = 0; j < c; ++j) {\n System.out.print(output[i][j] + \" \");\n }\n System.out.println(output[i][c]);\n }\n\n }",
"int r",
"r",
"c;",
"c",
"int[][] input",
"input",
"output;",
"output",
"r = sc.nextInt()",
"r",
"sc.nextInt()",
"sc.nextInt",
"sc",
"c = sc.nextInt()",
"c",
"sc.nextInt()",
"sc.nextInt",
"sc",
"input = new int[r][]",
"input",
"new int[r][]",
"r",
"for (int i = 0; i < r; ++i) {\n input[i] = new int[c];\n for (int j = 0; j < c; ++j) {\n input[i][j] = sc.nextInt();\n }\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < r",
"i",
"r",
"++i",
"++i",
"i",
"{\n input[i] = new int[c];\n for (int j = 0; j < c; ++j) {\n input[i][j] = sc.nextInt();\n }\n }",
"{\n input[i] = new int[c];\n for (int j = 0; j < c; ++j) {\n input[i][j] = sc.nextInt();\n }\n }",
"input[i] = new int[c]",
"input[i]",
"input",
"i",
"new int[c]",
"c",
"for (int j = 0; j < c; ++j) {\n input[i][j] = sc.nextInt();\n }",
"int j = 0;",
"int j = 0;",
"j",
"0",
"j < c",
"j",
"c",
"++j",
"++j",
"j",
"{\n input[i][j] = sc.nextInt();\n }",
"{\n input[i][j] = sc.nextInt();\n }",
"input[i][j] = sc.nextInt()",
"input[i][j]",
"input[i]",
"input",
"i",
"j",
"sc.nextInt()",
"sc.nextInt",
"sc",
"output = new int[r + 1][c + 1]",
"output",
"new int[r + 1][c + 1]",
"r + 1",
"r",
"1",
"c + 1",
"c",
"1",
"int sum = 0;",
"sum",
"0",
"for (int i = 0; i < r; ++i) {\n for (int j = 0; j < c; ++j) {\n output[i][j] = input[i][j];\n sum += input[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 output[i][j] = input[i][j];\n sum += input[i][j];\n }\n }",
"{\n for (int j = 0; j < c; ++j) {\n output[i][j] = input[i][j];\n sum += input[i][j];\n }\n }",
"for (int j = 0; j < c; ++j) {\n output[i][j] = input[i][j];\n sum += input[i][j];\n }",
"int j = 0;",
"int j = 0;",
"j",
"0",
"j < c",
"j",
"c",
"++j",
"++j",
"j",
"{\n output[i][j] = input[i][j];\n sum += input[i][j];\n }",
"{\n output[i][j] = input[i][j];\n sum += input[i][j];\n }",
"output[i][j] = input[i][j]",
"output[i][j]",
"output[i]",
"output",
"i",
"j",
"input[i][j]",
"input[i]",
"input",
"i",
"j",
"sum += input[i][j]",
"sum",
"input[i][j]",
"input[i]",
"input",
"i",
"j",
"for (int i = 0; i < r; ++i) {\n int hsum = 0;\n for (int j = 0; j < c; ++j) {\n hsum += output[i][j];\n }\n output[i][c] = hsum;\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < r",
"i",
"r",
"++i",
"++i",
"i",
"{\n int hsum = 0;\n for (int j = 0; j < c; ++j) {\n hsum += output[i][j];\n }\n output[i][c] = hsum;\n }",
"{\n int hsum = 0;\n for (int j = 0; j < c; ++j) {\n hsum += output[i][j];\n }\n output[i][c] = hsum;\n }",
"int hsum = 0;",
"hsum",
"0",
"for (int j = 0; j < c; ++j) {\n hsum += output[i][j];\n }",
"int j = 0;",
"int j = 0;",
"j",
"0",
"j < c",
"j",
"c",
"++j",
"++j",
"j",
"{\n hsum += output[i][j];\n }",
"{\n hsum += output[i][j];\n }",
"hsum += output[i][j]",
"hsum",
"output[i][j]",
"output[i]",
"output",
"i",
"j",
"output[i][c] = hsum",
"output[i][c]",
"output[i]",
"output",
"i",
"c",
"hsum",
"for (int j = 0; j < c; ++j) {\n int vsum = 0;\n for (int i = 0; i < r; ++i) {\n vsum += output[i][j];\n }\n output[r][j] = vsum;\n }",
"int j = 0;",
"int j = 0;",
"j",
"0",
"j < c",
"j",
"c",
"++j",
"++j",
"j",
"{\n int vsum = 0;\n for (int i = 0; i < r; ++i) {\n vsum += output[i][j];\n }\n output[r][j] = vsum;\n }",
"{\n int vsum = 0;\n for (int i = 0; i < r; ++i) {\n vsum += output[i][j];\n }\n output[r][j] = vsum;\n }",
"int vsum = 0;",
"vsum",
"0",
"for (int i = 0; i < r; ++i) {\n vsum += output[i][j];\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < r",
"i",
"r",
"++i",
"++i",
"i",
"{\n vsum += output[i][j];\n }",
"{\n vsum += output[i][j];\n }",
"vsum += output[i][j]",
"vsum",
"output[i][j]",
"output[i]",
"output",
"i",
"j",
"output[r][j] = vsum",
"output[r][j]",
"output[r]",
"output",
"r",
"j",
"vsum",
"output[r][c] = sum",
"output[r][c]",
"output[r]",
"output",
"r",
"c",
"sum",
"for (int i = 0; i <= r; ++i) {\n for (int j = 0; j < c; ++j) {\n System.out.print(output[i][j] + \" \");\n }\n System.out.println(output[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 System.out.print(output[i][j] + \" \");\n }\n System.out.println(output[i][c]);\n }",
"{\n for (int j = 0; j < c; ++j) {\n System.out.print(output[i][j] + \" \");\n }\n System.out.println(output[i][c]);\n }",
"for (int j = 0; j < c; ++j) {\n System.out.print(output[i][j] + \" \");\n }",
"int j = 0;",
"int j = 0;",
"j",
"0",
"j < c",
"j",
"c",
"++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.println(output[i][c])",
"System.out.println",
"System.out",
"System",
"System.out",
"output[i][c]",
"output[i]",
"output",
"i",
"c",
"public class Main {\n\n public static void main(String[] args) {\n new Main().solve();\n }\n\n Scanner sc = new Scanner(System.in);\n\n void solve() {\n int r, c;\n int[][] input, output;\n r = sc.nextInt();\n c = sc.nextInt();\n input = new int[r][];\n for (int i = 0; i < r; ++i) {\n input[i] = new int[c];\n for (int j = 0; j < c; ++j) {\n input[i][j] = sc.nextInt();\n }\n }\n\n output = new int[r + 1][c + 1];\n int sum = 0;\n for (int i = 0; i < r; ++i) {\n for (int j = 0; j < c; ++j) {\n output[i][j] = input[i][j];\n sum += input[i][j];\n }\n }\n\n //h sum\n for (int i = 0; i < r; ++i) {\n int hsum = 0;\n for (int j = 0; j < c; ++j) {\n hsum += output[i][j];\n }\n output[i][c] = hsum;\n }\n\n //v sum\n for (int j = 0; j < c; ++j) {\n int vsum = 0;\n for (int i = 0; i < r; ++i) {\n vsum += output[i][j];\n }\n output[r][j] = vsum;\n }\n\n //sum\n output[r][c] = sum;\n\n for (int i = 0; i <= r; ++i) {\n for (int j = 0; j < c; ++j) {\n System.out.print(output[i][j] + \" \");\n }\n System.out.println(output[i][c]);\n }\n\n }\n}",
"public class Main {\n\n public static void main(String[] args) {\n new Main().solve();\n }\n\n Scanner sc = new Scanner(System.in);\n\n void solve() {\n int r, c;\n int[][] input, output;\n r = sc.nextInt();\n c = sc.nextInt();\n input = new int[r][];\n for (int i = 0; i < r; ++i) {\n input[i] = new int[c];\n for (int j = 0; j < c; ++j) {\n input[i][j] = sc.nextInt();\n }\n }\n\n output = new int[r + 1][c + 1];\n int sum = 0;\n for (int i = 0; i < r; ++i) {\n for (int j = 0; j < c; ++j) {\n output[i][j] = input[i][j];\n sum += input[i][j];\n }\n }\n\n //h sum\n for (int i = 0; i < r; ++i) {\n int hsum = 0;\n for (int j = 0; j < c; ++j) {\n hsum += output[i][j];\n }\n output[i][c] = hsum;\n }\n\n //v sum\n for (int j = 0; j < c; ++j) {\n int vsum = 0;\n for (int i = 0; i < r; ++i) {\n vsum += output[i][j];\n }\n output[r][j] = vsum;\n }\n\n //sum\n output[r][c] = sum;\n\n for (int i = 0; i <= r; ++i) {\n for (int j = 0; j < c; ++j) {\n System.out.print(output[i][j] + \" \");\n }\n System.out.println(output[i][c]);\n }\n\n }\n}",
"Main"
] | import java.util.Scanner;
import java.util.function.Function;
public class Main {
public static void main(String[] args) {
new Main().solve();
}
Scanner sc = new Scanner(System.in);
void solve() {
int r, c;
int[][] input, output;
r = sc.nextInt();
c = sc.nextInt();
input = new int[r][];
for (int i = 0; i < r; ++i) {
input[i] = new int[c];
for (int j = 0; j < c; ++j) {
input[i][j] = sc.nextInt();
}
}
output = new int[r + 1][c + 1];
int sum = 0;
for (int i = 0; i < r; ++i) {
for (int j = 0; j < c; ++j) {
output[i][j] = input[i][j];
sum += input[i][j];
}
}
//h sum
for (int i = 0; i < r; ++i) {
int hsum = 0;
for (int j = 0; j < c; ++j) {
hsum += output[i][j];
}
output[i][c] = hsum;
}
//v sum
for (int j = 0; j < c; ++j) {
int vsum = 0;
for (int i = 0; i < r; ++i) {
vsum += output[i][j];
}
output[r][j] = vsum;
}
//sum
output[r][c] = sum;
for (int i = 0; i <= r; ++i) {
for (int j = 0; j < c; ++j) {
System.out.print(output[i][j] + " ");
}
System.out.println(output[i][c]);
}
}
}
|
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
41,
13,
20,
2,
13,
17,
2,
13,
17,
41,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
17,
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,
13,
0,
13,
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,
2,
13,
17,
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,
41,
13,
17,
2,
13,
2,
13,
17,
1,
40,
13,
30,
30,
11,
1,
41,
13,
17,
2,
13,
2,
13,
17,
1,
40,
13,
30,
30,
14,
2,
13,
17,
4,
18,
18,
13,
13,
18,
18,
13,
13,
17,
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
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
10,
11
],
[
10,
12
],
[
0,
13
],
[
211,
14
],
[
211,
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
],
[
17,
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
],
[
65,
66
],
[
65,
67
],
[
58,
68
],
[
68,
69
],
[
69,
70
],
[
58,
71
],
[
72,
72
],
[
72,
73
],
[
73,
74
],
[
74,
75
],
[
74,
76
],
[
73,
77
],
[
77,
78
],
[
78,
79
],
[
79,
80
],
[
80,
81
],
[
80,
82
],
[
79,
83
],
[
78,
84
],
[
73,
85
],
[
85,
86
],
[
85,
87
],
[
87,
88
],
[
88,
89
],
[
89,
90
],
[
89,
91
],
[
88,
92
],
[
87,
93
],
[
93,
94
],
[
94,
95
],
[
17,
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
],
[
119,
120
],
[
119,
121
],
[
112,
122
],
[
122,
123
],
[
123,
124
],
[
112,
125
],
[
126,
126
],
[
126,
127
],
[
127,
128
],
[
128,
129
],
[
128,
130
],
[
127,
131
],
[
131,
132
],
[
132,
133
],
[
133,
134
],
[
134,
135
],
[
134,
136
],
[
133,
137
],
[
132,
138
],
[
127,
139
],
[
139,
140
],
[
140,
141
],
[
140,
142
],
[
142,
143
],
[
143,
144
],
[
143,
145
],
[
142,
146
],
[
17,
147
],
[
147,
148
],
[
148,
149
],
[
149,
150
],
[
149,
151
],
[
147,
152
],
[
152,
153
],
[
152,
154
],
[
154,
155
],
[
154,
156
],
[
147,
157
],
[
157,
158
],
[
158,
159
],
[
147,
160
],
[
161,
161
],
[
161,
162
],
[
162,
163
],
[
163,
164
],
[
164,
165
],
[
164,
166
],
[
162,
167
],
[
167,
168
],
[
167,
169
],
[
169,
170
],
[
169,
171
],
[
162,
172
],
[
172,
173
],
[
173,
174
],
[
162,
175
],
[
176,
176
],
[
176,
177
],
[
177,
178
],
[
178,
179
],
[
178,
180
],
[
177,
181
],
[
181,
182
],
[
182,
183
],
[
183,
184
],
[
183,
185
],
[
181,
186
],
[
186,
187
],
[
187,
188
],
[
187,
189
],
[
186,
190
],
[
177,
191
],
[
191,
192
],
[
192,
193
],
[
193,
194
],
[
193,
195
],
[
191,
196
],
[
196,
197
],
[
196,
198
],
[
198,
199
],
[
199,
200
],
[
199,
201
],
[
198,
202
],
[
161,
203
],
[
203,
204
],
[
204,
205
],
[
205,
206
],
[
205,
207
],
[
15,
208
],
[
208,
209
],
[
0,
210
],
[
210,
211
],
[
210,
212
]
] | [
"import java.io.BufferedReader;\nimport java.io.FileNotFoundException;\nimport java.io.FileReader;\nimport java.util.Scanner;\n\n\npublic class Main {\n\n\tpublic static void main(String[] args) {\n\t\t//入力導入部\n\t\tScanner sc=new Scanner(System.in);\n\t\t\n\t\t\tint r=sc.nextInt();\n\t\t\tint c=sc.nextInt();\n\t\t\tint[][] box=new int[r+1][c+1];\n\t\t\t///////////////////////////////////////////////////////////////////\n\t\t\t//計算部\t\t\tx=n+n-i+n-l\n\t\t\tint total;\n\t\t\n\t\t\tfor(int i=0;i<r;i++){total=0;\n\t\t\t\tfor(int l=0;l<c+1;l++){\n\t\t\t\t\tif(l==c){box[i][c]=total;\n\t\t\t\t\t}else total+=box[i][l]=sc.nextInt();\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\tfor(int l=0;l<=c;l++){total=0;\n\t\t\t\tfor(int i=0;i<r+1;i++){\n\t\t\t\t\tif(i==r){box[r][l]=total;}\n\t\t\t\t\telse{total+=box[i][l];}\n\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor(int i=0;i<r+1;i++){\n\t\t\t\tfor(int l=0;l<c+1;l++){\n\t\t\t\t\tif(l==0)System.out.print(box[i][0]);\n\t\t\t\t\telse System.out.print(\" \"+box[i][l]);\n\t\t\t\t}System.out.println();\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t}}\t",
"import java.io.BufferedReader;",
"BufferedReader",
"java.io",
"import java.io.FileNotFoundException;",
"FileNotFoundException",
"java.io",
"import java.io.FileReader;",
"FileReader",
"java.io",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n\n\tpublic static void main(String[] args) {\n\t\t//入力導入部\n\t\tScanner sc=new Scanner(System.in);\n\t\t\n\t\t\tint r=sc.nextInt();\n\t\t\tint c=sc.nextInt();\n\t\t\tint[][] box=new int[r+1][c+1];\n\t\t\t///////////////////////////////////////////////////////////////////\n\t\t\t//計算部\t\t\tx=n+n-i+n-l\n\t\t\tint total;\n\t\t\n\t\t\tfor(int i=0;i<r;i++){total=0;\n\t\t\t\tfor(int l=0;l<c+1;l++){\n\t\t\t\t\tif(l==c){box[i][c]=total;\n\t\t\t\t\t}else total+=box[i][l]=sc.nextInt();\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\tfor(int l=0;l<=c;l++){total=0;\n\t\t\t\tfor(int i=0;i<r+1;i++){\n\t\t\t\t\tif(i==r){box[r][l]=total;}\n\t\t\t\t\telse{total+=box[i][l];}\n\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor(int i=0;i<r+1;i++){\n\t\t\t\tfor(int l=0;l<c+1;l++){\n\t\t\t\t\tif(l==0)System.out.print(box[i][0]);\n\t\t\t\t\telse System.out.print(\" \"+box[i][l]);\n\t\t\t\t}System.out.println();\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t}}",
"Main",
"public static void main(String[] args) {\n\t\t//入力導入部\n\t\tScanner sc=new Scanner(System.in);\n\t\t\n\t\t\tint r=sc.nextInt();\n\t\t\tint c=sc.nextInt();\n\t\t\tint[][] box=new int[r+1][c+1];\n\t\t\t///////////////////////////////////////////////////////////////////\n\t\t\t//計算部\t\t\tx=n+n-i+n-l\n\t\t\tint total;\n\t\t\n\t\t\tfor(int i=0;i<r;i++){total=0;\n\t\t\t\tfor(int l=0;l<c+1;l++){\n\t\t\t\t\tif(l==c){box[i][c]=total;\n\t\t\t\t\t}else total+=box[i][l]=sc.nextInt();\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\tfor(int l=0;l<=c;l++){total=0;\n\t\t\t\tfor(int i=0;i<r+1;i++){\n\t\t\t\t\tif(i==r){box[r][l]=total;}\n\t\t\t\t\telse{total+=box[i][l];}\n\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor(int i=0;i<r+1;i++){\n\t\t\t\tfor(int l=0;l<c+1;l++){\n\t\t\t\t\tif(l==0)System.out.print(box[i][0]);\n\t\t\t\t\telse System.out.print(\" \"+box[i][l]);\n\t\t\t\t}System.out.println();\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t}",
"main",
"{\n\t\t//入力導入部\n\t\tScanner sc=new Scanner(System.in);\n\t\t\n\t\t\tint r=sc.nextInt();\n\t\t\tint c=sc.nextInt();\n\t\t\tint[][] box=new int[r+1][c+1];\n\t\t\t///////////////////////////////////////////////////////////////////\n\t\t\t//計算部\t\t\tx=n+n-i+n-l\n\t\t\tint total;\n\t\t\n\t\t\tfor(int i=0;i<r;i++){total=0;\n\t\t\t\tfor(int l=0;l<c+1;l++){\n\t\t\t\t\tif(l==c){box[i][c]=total;\n\t\t\t\t\t}else total+=box[i][l]=sc.nextInt();\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\tfor(int l=0;l<=c;l++){total=0;\n\t\t\t\tfor(int i=0;i<r+1;i++){\n\t\t\t\t\tif(i==r){box[r][l]=total;}\n\t\t\t\t\telse{total+=box[i][l];}\n\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor(int i=0;i<r+1;i++){\n\t\t\t\tfor(int l=0;l<c+1;l++){\n\t\t\t\t\tif(l==0)System.out.print(box[i][0]);\n\t\t\t\t\telse System.out.print(\" \"+box[i][l]);\n\t\t\t\t}System.out.println();\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\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[][] box=new int[r+1][c+1];",
"box",
"new int[r+1][c+1]",
"r+1",
"r",
"1",
"c+1",
"c",
"1",
"int total;",
"total",
"for(int i=0;i<r;i++){total=0;\n\t\t\t\tfor(int l=0;l<c+1;l++){\n\t\t\t\t\tif(l==c){box[i][c]=total;\n\t\t\t\t\t}else total+=box[i][l]=sc.nextInt();\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}",
"int i=0;",
"int i=0;",
"i",
"0",
"i<r",
"i",
"r",
"i++",
"i++",
"i",
"{total=0;\n\t\t\t\tfor(int l=0;l<c+1;l++){\n\t\t\t\t\tif(l==c){box[i][c]=total;\n\t\t\t\t\t}else total+=box[i][l]=sc.nextInt();\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}",
"{total=0;\n\t\t\t\tfor(int l=0;l<c+1;l++){\n\t\t\t\t\tif(l==c){box[i][c]=total;\n\t\t\t\t\t}else total+=box[i][l]=sc.nextInt();\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}",
"total=0",
"total",
"0",
"for(int l=0;l<c+1;l++){\n\t\t\t\t\tif(l==c){box[i][c]=total;\n\t\t\t\t\t}else total+=box[i][l]=sc.nextInt();\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t}",
"int l=0;",
"int l=0;",
"l",
"0",
"l<c+1",
"l",
"c+1",
"c",
"1",
"l++",
"l++",
"l",
"{\n\t\t\t\t\tif(l==c){box[i][c]=total;\n\t\t\t\t\t}else total+=box[i][l]=sc.nextInt();\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t}",
"{\n\t\t\t\t\tif(l==c){box[i][c]=total;\n\t\t\t\t\t}else total+=box[i][l]=sc.nextInt();\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t}",
"if(l==c){box[i][c]=total;\n\t\t\t\t\t}else total+=box[i][l]=sc.nextInt();",
"l==c",
"l",
"c",
"{box[i][c]=total;\n\t\t\t\t\t}",
"box[i][c]=total",
"box[i][c]",
"box[i]",
"box",
"i",
"c",
"total",
"total+=box[i][l]=sc.nextInt()",
"total",
"box[i][l]=sc.nextInt()",
"box[i][l]",
"box[i]",
"box",
"i",
"l",
"sc.nextInt()",
"sc.nextInt",
"sc",
"for(int l=0;l<=c;l++){total=0;\n\t\t\t\tfor(int i=0;i<r+1;i++){\n\t\t\t\t\tif(i==r){box[r][l]=total;}\n\t\t\t\t\telse{total+=box[i][l];}\n\t\t\t\n\t\t\t\t}\n\t\t\t}",
"int l=0;",
"int l=0;",
"l",
"0",
"l<=c",
"l",
"c",
"l++",
"l++",
"l",
"{total=0;\n\t\t\t\tfor(int i=0;i<r+1;i++){\n\t\t\t\t\tif(i==r){box[r][l]=total;}\n\t\t\t\t\telse{total+=box[i][l];}\n\t\t\t\n\t\t\t\t}\n\t\t\t}",
"{total=0;\n\t\t\t\tfor(int i=0;i<r+1;i++){\n\t\t\t\t\tif(i==r){box[r][l]=total;}\n\t\t\t\t\telse{total+=box[i][l];}\n\t\t\t\n\t\t\t\t}\n\t\t\t}",
"total=0",
"total",
"0",
"for(int i=0;i<r+1;i++){\n\t\t\t\t\tif(i==r){box[r][l]=total;}\n\t\t\t\t\telse{total+=box[i][l];}\n\t\t\t\n\t\t\t\t}",
"int i=0;",
"int i=0;",
"i",
"0",
"i<r+1",
"i",
"r+1",
"r",
"1",
"i++",
"i++",
"i",
"{\n\t\t\t\t\tif(i==r){box[r][l]=total;}\n\t\t\t\t\telse{total+=box[i][l];}\n\t\t\t\n\t\t\t\t}",
"{\n\t\t\t\t\tif(i==r){box[r][l]=total;}\n\t\t\t\t\telse{total+=box[i][l];}\n\t\t\t\n\t\t\t\t}",
"if(i==r){box[r][l]=total;}\n\t\t\t\t\telse{total+=box[i][l];}",
"i==r",
"i",
"r",
"{box[r][l]=total;}",
"box[r][l]=total",
"box[r][l]",
"box[r]",
"box",
"r",
"l",
"total",
"{total+=box[i][l];}",
"total+=box[i][l]",
"total",
"box[i][l]",
"box[i]",
"box",
"i",
"l",
"for(int i=0;i<r+1;i++){\n\t\t\t\tfor(int l=0;l<c+1;l++){\n\t\t\t\t\tif(l==0)System.out.print(box[i][0]);\n\t\t\t\t\telse System.out.print(\" \"+box[i][l]);\n\t\t\t\t}System.out.println();\n\t\t\t}",
"int i=0;",
"int i=0;",
"i",
"0",
"i<r+1",
"i",
"r+1",
"r",
"1",
"i++",
"i++",
"i",
"{\n\t\t\t\tfor(int l=0;l<c+1;l++){\n\t\t\t\t\tif(l==0)System.out.print(box[i][0]);\n\t\t\t\t\telse System.out.print(\" \"+box[i][l]);\n\t\t\t\t}System.out.println();\n\t\t\t}",
"{\n\t\t\t\tfor(int l=0;l<c+1;l++){\n\t\t\t\t\tif(l==0)System.out.print(box[i][0]);\n\t\t\t\t\telse System.out.print(\" \"+box[i][l]);\n\t\t\t\t}System.out.println();\n\t\t\t}",
"for(int l=0;l<c+1;l++){\n\t\t\t\t\tif(l==0)System.out.print(box[i][0]);\n\t\t\t\t\telse System.out.print(\" \"+box[i][l]);\n\t\t\t\t}",
"int l=0;",
"int l=0;",
"l",
"0",
"l<c+1",
"l",
"c+1",
"c",
"1",
"l++",
"l++",
"l",
"{\n\t\t\t\t\tif(l==0)System.out.print(box[i][0]);\n\t\t\t\t\telse System.out.print(\" \"+box[i][l]);\n\t\t\t\t}",
"{\n\t\t\t\t\tif(l==0)System.out.print(box[i][0]);\n\t\t\t\t\telse System.out.print(\" \"+box[i][l]);\n\t\t\t\t}",
"if(l==0)System.out.print(box[i][0]);\n\t\t\t\t\telse System.out.print(\" \"+box[i][l]);",
"l==0",
"l",
"0",
"System.out.print(box[i][0])",
"System.out.print",
"System.out",
"System",
"System.out",
"box[i][0]",
"box[i]",
"box",
"i",
"0",
"System.out.print(\" \"+box[i][l])",
"System.out.print",
"System.out",
"System",
"System.out",
"\" \"+box[i][l]",
"\" \"",
"box[i][l]",
"box[i]",
"box",
"i",
"l",
"System.out.println()",
"System.out.println",
"System.out",
"System",
"System.out",
"String[] args",
"args",
"public class Main {\n\n\tpublic static void main(String[] args) {\n\t\t//入力導入部\n\t\tScanner sc=new Scanner(System.in);\n\t\t\n\t\t\tint r=sc.nextInt();\n\t\t\tint c=sc.nextInt();\n\t\t\tint[][] box=new int[r+1][c+1];\n\t\t\t///////////////////////////////////////////////////////////////////\n\t\t\t//計算部\t\t\tx=n+n-i+n-l\n\t\t\tint total;\n\t\t\n\t\t\tfor(int i=0;i<r;i++){total=0;\n\t\t\t\tfor(int l=0;l<c+1;l++){\n\t\t\t\t\tif(l==c){box[i][c]=total;\n\t\t\t\t\t}else total+=box[i][l]=sc.nextInt();\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\tfor(int l=0;l<=c;l++){total=0;\n\t\t\t\tfor(int i=0;i<r+1;i++){\n\t\t\t\t\tif(i==r){box[r][l]=total;}\n\t\t\t\t\telse{total+=box[i][l];}\n\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor(int i=0;i<r+1;i++){\n\t\t\t\tfor(int l=0;l<c+1;l++){\n\t\t\t\t\tif(l==0)System.out.print(box[i][0]);\n\t\t\t\t\telse System.out.print(\" \"+box[i][l]);\n\t\t\t\t}System.out.println();\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t}}",
"public class Main {\n\n\tpublic static void main(String[] args) {\n\t\t//入力導入部\n\t\tScanner sc=new Scanner(System.in);\n\t\t\n\t\t\tint r=sc.nextInt();\n\t\t\tint c=sc.nextInt();\n\t\t\tint[][] box=new int[r+1][c+1];\n\t\t\t///////////////////////////////////////////////////////////////////\n\t\t\t//計算部\t\t\tx=n+n-i+n-l\n\t\t\tint total;\n\t\t\n\t\t\tfor(int i=0;i<r;i++){total=0;\n\t\t\t\tfor(int l=0;l<c+1;l++){\n\t\t\t\t\tif(l==c){box[i][c]=total;\n\t\t\t\t\t}else total+=box[i][l]=sc.nextInt();\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\tfor(int l=0;l<=c;l++){total=0;\n\t\t\t\tfor(int i=0;i<r+1;i++){\n\t\t\t\t\tif(i==r){box[r][l]=total;}\n\t\t\t\t\telse{total+=box[i][l];}\n\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor(int i=0;i<r+1;i++){\n\t\t\t\tfor(int l=0;l<c+1;l++){\n\t\t\t\t\tif(l==0)System.out.print(box[i][0]);\n\t\t\t\t\telse System.out.print(\" \"+box[i][l]);\n\t\t\t\t}System.out.println();\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t}}",
"Main"
] | import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
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[][] box=new int[r+1][c+1];
///////////////////////////////////////////////////////////////////
//計算部 x=n+n-i+n-l
int total;
for(int i=0;i<r;i++){total=0;
for(int l=0;l<c+1;l++){
if(l==c){box[i][c]=total;
}else total+=box[i][l]=sc.nextInt();
}
}
for(int l=0;l<=c;l++){total=0;
for(int i=0;i<r+1;i++){
if(i==r){box[r][l]=total;}
else{total+=box[i][l];}
}
}
for(int i=0;i<r+1;i++){
for(int l=0;l<c+1;l++){
if(l==0)System.out.print(box[i][0]);
else System.out.print(" "+box[i][l]);
}System.out.println();
}
}} |
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
41,
13,
41,
13,
41,
13,
41,
13,
0,
13,
4,
18,
13,
0,
13,
4,
18,
13,
41,
13,
20,
13,
13,
41,
13,
20,
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,
13,
13,
18,
18,
13,
13,
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,
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,
14,
2,
13,
2,
13,
17,
30,
4,
18,
18,
13,
13,
13,
4,
18,
13,
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
],
[
8,
14
],
[
14,
15
],
[
8,
16
],
[
16,
17
],
[
8,
18
],
[
18,
19
],
[
8,
20
],
[
20,
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
],
[
8,
37
],
[
37,
38
],
[
37,
39
],
[
8,
41
],
[
41,
42
],
[
42,
43
],
[
43,
44
],
[
43,
45
],
[
41,
46
],
[
46,
47
],
[
46,
48
],
[
41,
49
],
[
49,
50
],
[
50,
51
],
[
41,
52
],
[
53,
53
],
[
53,
54
],
[
54,
55
],
[
55,
56
],
[
56,
57
],
[
56,
58
],
[
54,
59
],
[
59,
60
],
[
59,
61
],
[
54,
62
],
[
62,
63
],
[
63,
64
],
[
54,
65
],
[
66,
66
],
[
66,
67
],
[
67,
68
],
[
68,
69
],
[
69,
70
],
[
69,
71
],
[
68,
72
],
[
67,
73
],
[
73,
74
],
[
74,
75
],
[
66,
76
],
[
76,
77
],
[
77,
78
],
[
77,
79
],
[
76,
80
],
[
80,
81
],
[
81,
82
],
[
81,
83
],
[
80,
84
],
[
8,
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
],
[
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
],
[
115,
116
],
[
116,
117
],
[
116,
118
],
[
114,
119
],
[
119,
120
],
[
120,
121
],
[
121,
122
],
[
121,
123
],
[
120,
124
],
[
119,
125
],
[
113,
126
],
[
126,
127
],
[
126,
128
],
[
128,
129
],
[
129,
130
],
[
129,
131
],
[
128,
132
],
[
97,
133
],
[
133,
134
],
[
134,
135
],
[
135,
136
],
[
135,
137
],
[
133,
138
],
[
8,
139
],
[
139,
140
],
[
139,
141
],
[
8,
142
],
[
142,
143
],
[
143,
144
],
[
144,
145
],
[
144,
146
],
[
142,
147
],
[
147,
148
],
[
147,
149
],
[
142,
150
],
[
150,
151
],
[
151,
152
],
[
142,
153
],
[
154,
154
],
[
154,
155
],
[
155,
156
],
[
156,
157
],
[
157,
158
],
[
157,
159
],
[
155,
160
],
[
160,
161
],
[
161,
162
],
[
161,
163
],
[
160,
164
],
[
154,
165
],
[
165,
166
],
[
165,
167
],
[
167,
168
],
[
167,
169
],
[
154,
170
],
[
170,
171
],
[
171,
172
],
[
171,
173
],
[
173,
174
],
[
173,
175
],
[
170,
176
],
[
176,
177
],
[
177,
178
],
[
178,
179
],
[
179,
180
],
[
179,
181
],
[
177,
182
],
[
8,
183
],
[
183,
184
],
[
184,
185
],
[
6,
186
],
[
186,
187
],
[
0,
188
],
[
188,
189
],
[
188,
190
]
] | [
"import java.util.Scanner;\n\npublic class Main {\n\tpublic static void main(String[] args) {\n\t\tScanner stdIn = new Scanner(System.in);\n\t\tint r, c, i, j, sum1;\n\t\tr = stdIn.nextInt();\n\t\tc = stdIn.nextInt();\n\t\tint[][] a = new int[r][c];\n\t\tint[] sum = new int[c];\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\tsum[j] += a[i][j];\n\t\t\t}\n\t\t}\n\t\tfor (i = 0; i < r; i++) {\n\t\t\tsum1 = 0;\n\t\t\tfor (j = 0; j < c; j++) {\n\t\t\t\tSystem.out.print(a[i][j] + \" \");\n\t\t\t\tsum1 += a[i][j];\n\t\t\t}\n\t\t\tSystem.out.println(sum1);\n\t\t}\n\t\tsum1=0;\n\t\tfor (j = 0; j < c; j++) {\n\t\t\tSystem.out.print(sum[j] + \" \");\n\t\t\tsum1 += sum[j];\n\t\t\tif(j==c-1){\n\t\t\t\tSystem.out.println(sum1);\n\t\t\t}\n\t\t}\n\t\tstdIn.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 stdIn = new Scanner(System.in);\n\t\tint r, c, i, j, sum1;\n\t\tr = stdIn.nextInt();\n\t\tc = stdIn.nextInt();\n\t\tint[][] a = new int[r][c];\n\t\tint[] sum = new int[c];\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\tsum[j] += a[i][j];\n\t\t\t}\n\t\t}\n\t\tfor (i = 0; i < r; i++) {\n\t\t\tsum1 = 0;\n\t\t\tfor (j = 0; j < c; j++) {\n\t\t\t\tSystem.out.print(a[i][j] + \" \");\n\t\t\t\tsum1 += a[i][j];\n\t\t\t}\n\t\t\tSystem.out.println(sum1);\n\t\t}\n\t\tsum1=0;\n\t\tfor (j = 0; j < c; j++) {\n\t\t\tSystem.out.print(sum[j] + \" \");\n\t\t\tsum1 += sum[j];\n\t\t\tif(j==c-1){\n\t\t\t\tSystem.out.println(sum1);\n\t\t\t}\n\t\t}\n\t\tstdIn.close();\n\t}\n}",
"Main",
"public static void main(String[] args) {\n\t\tScanner stdIn = new Scanner(System.in);\n\t\tint r, c, i, j, sum1;\n\t\tr = stdIn.nextInt();\n\t\tc = stdIn.nextInt();\n\t\tint[][] a = new int[r][c];\n\t\tint[] sum = new int[c];\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\tsum[j] += a[i][j];\n\t\t\t}\n\t\t}\n\t\tfor (i = 0; i < r; i++) {\n\t\t\tsum1 = 0;\n\t\t\tfor (j = 0; j < c; j++) {\n\t\t\t\tSystem.out.print(a[i][j] + \" \");\n\t\t\t\tsum1 += a[i][j];\n\t\t\t}\n\t\t\tSystem.out.println(sum1);\n\t\t}\n\t\tsum1=0;\n\t\tfor (j = 0; j < c; j++) {\n\t\t\tSystem.out.print(sum[j] + \" \");\n\t\t\tsum1 += sum[j];\n\t\t\tif(j==c-1){\n\t\t\t\tSystem.out.println(sum1);\n\t\t\t}\n\t\t}\n\t\tstdIn.close();\n\t}",
"main",
"{\n\t\tScanner stdIn = new Scanner(System.in);\n\t\tint r, c, i, j, sum1;\n\t\tr = stdIn.nextInt();\n\t\tc = stdIn.nextInt();\n\t\tint[][] a = new int[r][c];\n\t\tint[] sum = new int[c];\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\tsum[j] += a[i][j];\n\t\t\t}\n\t\t}\n\t\tfor (i = 0; i < r; i++) {\n\t\t\tsum1 = 0;\n\t\t\tfor (j = 0; j < c; j++) {\n\t\t\t\tSystem.out.print(a[i][j] + \" \");\n\t\t\t\tsum1 += a[i][j];\n\t\t\t}\n\t\t\tSystem.out.println(sum1);\n\t\t}\n\t\tsum1=0;\n\t\tfor (j = 0; j < c; j++) {\n\t\t\tSystem.out.print(sum[j] + \" \");\n\t\t\tsum1 += sum[j];\n\t\t\tif(j==c-1){\n\t\t\t\tSystem.out.println(sum1);\n\t\t\t}\n\t\t}\n\t\tstdIn.close();\n\t}",
"Scanner stdIn = new Scanner(System.in);",
"stdIn",
"new Scanner(System.in)",
"int r",
"r",
"c",
"c",
"i",
"i",
"j",
"j",
"sum1;",
"sum1",
"r = stdIn.nextInt()",
"r",
"stdIn.nextInt()",
"stdIn.nextInt",
"stdIn",
"c = stdIn.nextInt()",
"c",
"stdIn.nextInt()",
"stdIn.nextInt",
"stdIn",
"int[][] a = new int[r][c];",
"a",
"new int[r][c]",
"r",
"c",
"int[] sum = new int[c];",
"sum",
"new int[c]",
"c",
"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\tsum[j] += 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\tsum[j] += 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\tsum[j] += 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\tsum[j] += a[i][j];\n\t\t\t}",
"j = 0;",
"j = 0",
"j",
"0",
"j < c",
"j",
"c",
"j++",
"j++",
"j",
"{\n\t\t\t\ta[i][j] = stdIn.nextInt();\n\t\t\t\tsum[j] += a[i][j];\n\t\t\t}",
"{\n\t\t\t\ta[i][j] = stdIn.nextInt();\n\t\t\t\tsum[j] += 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",
"sum[j] += a[i][j]",
"sum[j]",
"sum",
"j",
"a[i][j]",
"a[i]",
"a",
"i",
"j",
"for (i = 0; i < r; i++) {\n\t\t\tsum1 = 0;\n\t\t\tfor (j = 0; j < c; j++) {\n\t\t\t\tSystem.out.print(a[i][j] + \" \");\n\t\t\t\tsum1 += a[i][j];\n\t\t\t}\n\t\t\tSystem.out.println(sum1);\n\t\t}",
"i = 0;",
"i = 0",
"i",
"0",
"i < r",
"i",
"r",
"i++",
"i++",
"i",
"{\n\t\t\tsum1 = 0;\n\t\t\tfor (j = 0; j < c; j++) {\n\t\t\t\tSystem.out.print(a[i][j] + \" \");\n\t\t\t\tsum1 += a[i][j];\n\t\t\t}\n\t\t\tSystem.out.println(sum1);\n\t\t}",
"{\n\t\t\tsum1 = 0;\n\t\t\tfor (j = 0; j < c; j++) {\n\t\t\t\tSystem.out.print(a[i][j] + \" \");\n\t\t\t\tsum1 += a[i][j];\n\t\t\t}\n\t\t\tSystem.out.println(sum1);\n\t\t}",
"sum1 = 0",
"sum1",
"0",
"for (j = 0; j < c; j++) {\n\t\t\t\tSystem.out.print(a[i][j] + \" \");\n\t\t\t\tsum1 += a[i][j];\n\t\t\t}",
"j = 0;",
"j = 0",
"j",
"0",
"j < c",
"j",
"c",
"j++",
"j++",
"j",
"{\n\t\t\t\tSystem.out.print(a[i][j] + \" \");\n\t\t\t\tsum1 += a[i][j];\n\t\t\t}",
"{\n\t\t\t\tSystem.out.print(a[i][j] + \" \");\n\t\t\t\tsum1 += a[i][j];\n\t\t\t}",
"System.out.print(a[i][j] + \" \")",
"System.out.print",
"System.out",
"System",
"System.out",
"a[i][j] + \" \"",
"a[i][j]",
"a[i]",
"a",
"i",
"j",
"\" \"",
"sum1 += a[i][j]",
"sum1",
"a[i][j]",
"a[i]",
"a",
"i",
"j",
"System.out.println(sum1)",
"System.out.println",
"System.out",
"System",
"System.out",
"sum1",
"sum1=0",
"sum1",
"0",
"for (j = 0; j < c; j++) {\n\t\t\tSystem.out.print(sum[j] + \" \");\n\t\t\tsum1 += sum[j];\n\t\t\tif(j==c-1){\n\t\t\t\tSystem.out.println(sum1);\n\t\t\t}\n\t\t}",
"j = 0;",
"j = 0",
"j",
"0",
"j < c",
"j",
"c",
"j++",
"j++",
"j",
"{\n\t\t\tSystem.out.print(sum[j] + \" \");\n\t\t\tsum1 += sum[j];\n\t\t\tif(j==c-1){\n\t\t\t\tSystem.out.println(sum1);\n\t\t\t}\n\t\t}",
"{\n\t\t\tSystem.out.print(sum[j] + \" \");\n\t\t\tsum1 += sum[j];\n\t\t\tif(j==c-1){\n\t\t\t\tSystem.out.println(sum1);\n\t\t\t}\n\t\t}",
"System.out.print(sum[j] + \" \")",
"System.out.print",
"System.out",
"System",
"System.out",
"sum[j] + \" \"",
"sum[j]",
"sum",
"j",
"\" \"",
"sum1 += sum[j]",
"sum1",
"sum[j]",
"sum",
"j",
"if(j==c-1){\n\t\t\t\tSystem.out.println(sum1);\n\t\t\t}",
"j==c-1",
"j",
"c-1",
"c",
"1",
"{\n\t\t\t\tSystem.out.println(sum1);\n\t\t\t}",
"System.out.println(sum1)",
"System.out.println",
"System.out",
"System",
"System.out",
"sum1",
"stdIn.close()",
"stdIn.close",
"stdIn",
"String[] args",
"args",
"public class Main {\n\tpublic static void main(String[] args) {\n\t\tScanner stdIn = new Scanner(System.in);\n\t\tint r, c, i, j, sum1;\n\t\tr = stdIn.nextInt();\n\t\tc = stdIn.nextInt();\n\t\tint[][] a = new int[r][c];\n\t\tint[] sum = new int[c];\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\tsum[j] += a[i][j];\n\t\t\t}\n\t\t}\n\t\tfor (i = 0; i < r; i++) {\n\t\t\tsum1 = 0;\n\t\t\tfor (j = 0; j < c; j++) {\n\t\t\t\tSystem.out.print(a[i][j] + \" \");\n\t\t\t\tsum1 += a[i][j];\n\t\t\t}\n\t\t\tSystem.out.println(sum1);\n\t\t}\n\t\tsum1=0;\n\t\tfor (j = 0; j < c; j++) {\n\t\t\tSystem.out.print(sum[j] + \" \");\n\t\t\tsum1 += sum[j];\n\t\t\tif(j==c-1){\n\t\t\t\tSystem.out.println(sum1);\n\t\t\t}\n\t\t}\n\t\tstdIn.close();\n\t}\n}",
"public class Main {\n\tpublic static void main(String[] args) {\n\t\tScanner stdIn = new Scanner(System.in);\n\t\tint r, c, i, j, sum1;\n\t\tr = stdIn.nextInt();\n\t\tc = stdIn.nextInt();\n\t\tint[][] a = new int[r][c];\n\t\tint[] sum = new int[c];\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\tsum[j] += a[i][j];\n\t\t\t}\n\t\t}\n\t\tfor (i = 0; i < r; i++) {\n\t\t\tsum1 = 0;\n\t\t\tfor (j = 0; j < c; j++) {\n\t\t\t\tSystem.out.print(a[i][j] + \" \");\n\t\t\t\tsum1 += a[i][j];\n\t\t\t}\n\t\t\tSystem.out.println(sum1);\n\t\t}\n\t\tsum1=0;\n\t\tfor (j = 0; j < c; j++) {\n\t\t\tSystem.out.print(sum[j] + \" \");\n\t\t\tsum1 += sum[j];\n\t\t\tif(j==c-1){\n\t\t\t\tSystem.out.println(sum1);\n\t\t\t}\n\t\t}\n\t\tstdIn.close();\n\t}\n}",
"Main"
] | import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner stdIn = new Scanner(System.in);
int r, c, i, j, sum1;
r = stdIn.nextInt();
c = stdIn.nextInt();
int[][] a = new int[r][c];
int[] sum = new int[c];
for (i = 0; i < r; i++) {
for (j = 0; j < c; j++) {
a[i][j] = stdIn.nextInt();
sum[j] += a[i][j];
}
}
for (i = 0; i < r; i++) {
sum1 = 0;
for (j = 0; j < c; j++) {
System.out.print(a[i][j] + " ");
sum1 += a[i][j];
}
System.out.println(sum1);
}
sum1=0;
for (j = 0; j < c; j++) {
System.out.print(sum[j] + " ");
sum1 += sum[j];
if(j==c-1){
System.out.println(sum1);
}
}
stdIn.close();
}
}
|
[
7,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
17,
38,
30,
41,
13,
20,
41,
13,
41,
13,
17,
41,
13,
17,
41,
13,
17,
41,
13,
17,
42,
2,
0,
13,
4,
18,
13,
17,
30,
41,
13,
4,
18,
13,
17,
14,
13,
30,
0,
13,
4,
18,
13,
18,
13,
17,
0,
13,
4,
18,
13,
18,
13,
17,
0,
13,
20,
2,
13,
17,
2,
13,
17,
0,
13,
17,
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,
18,
13,
13,
0,
18,
18,
13,
13,
13,
4,
18,
13,
18,
13,
13,
0,
13,
18,
18,
13,
13,
13,
0,
18,
18,
13,
13,
13,
13,
40,
13,
14,
2,
13,
13,
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,
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
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
224,
8
],
[
224,
9
],
[
9,
10
],
[
9,
11
],
[
11,
12
],
[
12,
13
],
[
12,
14
],
[
11,
15
],
[
15,
16
],
[
16,
17
],
[
17,
18
],
[
17,
19
],
[
16,
20
],
[
20,
21
],
[
16,
22
],
[
22,
23
],
[
22,
24
],
[
16,
25
],
[
25,
26
],
[
25,
27
],
[
16,
28
],
[
28,
29
],
[
28,
30
],
[
16,
31
],
[
31,
32
],
[
31,
33
],
[
16,
34
],
[
34,
35
],
[
35,
36
],
[
36,
37
],
[
36,
38
],
[
38,
39
],
[
39,
40
],
[
35,
41
],
[
34,
42
],
[
42,
43
],
[
43,
44
],
[
43,
45
],
[
45,
46
],
[
46,
47
],
[
45,
48
],
[
42,
49
],
[
49,
50
],
[
49,
51
],
[
51,
52
],
[
52,
53
],
[
52,
54
],
[
54,
55
],
[
55,
56
],
[
54,
57
],
[
57,
58
],
[
57,
59
],
[
51,
60
],
[
60,
61
],
[
60,
62
],
[
62,
63
],
[
63,
64
],
[
62,
65
],
[
65,
66
],
[
65,
67
],
[
51,
68
],
[
68,
69
],
[
68,
70
],
[
71,
72
],
[
71,
73
],
[
74,
75
],
[
74,
76
],
[
51,
77
],
[
77,
78
],
[
77,
79
],
[
49,
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
],
[
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
],
[
115,
118
],
[
118,
119
],
[
118,
120
],
[
96,
121
],
[
121,
122
],
[
121,
123
],
[
123,
124
],
[
124,
125
],
[
124,
126
],
[
123,
127
],
[
80,
128
],
[
128,
129
],
[
129,
130
],
[
130,
131
],
[
130,
132
],
[
129,
133
],
[
128,
134
],
[
80,
135
],
[
135,
136
],
[
80,
137
],
[
137,
138
],
[
138,
139
],
[
138,
140
],
[
137,
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
],
[
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
],
[
186,
188
],
[
188,
189
],
[
188,
190
],
[
181,
191
],
[
191,
192
],
[
192,
193
],
[
181,
194
],
[
195,
195
],
[
195,
196
],
[
196,
197
],
[
197,
198
],
[
198,
199
],
[
198,
200
],
[
196,
201
],
[
201,
202
],
[
202,
203
],
[
202,
204
],
[
201,
205
],
[
195,
206
],
[
206,
207
],
[
207,
208
],
[
207,
209
],
[
206,
210
],
[
210,
211
],
[
211,
212
],
[
212,
213
],
[
212,
214
],
[
210,
215
],
[
180,
216
],
[
216,
217
],
[
217,
218
],
[
218,
219
],
[
218,
220
],
[
9,
221
],
[
221,
222
],
[
0,
223
],
[
223,
224
],
[
223,
225
]
] | [
"import java.io.BufferedReader;\nimport java.io.InputStreamReader;\n\npublic class Main {\n\n\tpublic static void main(String[] args) throws Exception {\n // TODO ?????????????????????????????????????????????\n \n boolean first=true;\n try (BufferedReader br = new BufferedReader(new InputStreamReader(System.in))) {\n String line;\n int i=0,n=0,m=0;\n int[][] card=null;\n while ((line = br.readLine()) != null) {\n \tString[] str=line.split(\" \");\n \tif(first){\n \t\tn=Integer.parseInt(str[0]);\n \t\tm=Integer.parseInt(str[1]);\n \t\tcard=new int[n+1][m+1];\n \t\tfirst=false;\n \t}else{\n \t\tint sum=0;\n \t\tfor(int j=0;j<m;j++){\n \t\t\tcard[i][j]=Integer.parseInt(str[j]);\n \t\t\tcard[n][j]+=Integer.parseInt(str[j]);\n \t\t\tsum+=card[i][j];\n \t\t}\n \t\tcard[i][m]=sum;\n \t\t\n \t\ti++;\n \t\tif(i==n){\n \t\t\tfor(int j=0;j<n;j++){\n \t\t\t\tcard[n][m]+=card[j][m];\n \t\t\t}\n \t\t\tfor(int j=0;j<n+1;j++){\n \t\t\t\tfor(int k=0;k<m+1;k++){\n \t\t\tSystem.out.print(card[j][k]);\n \t\t\tif(k!=m)System.out.print(\" \");\n \t\t}\n \t\t\t\tSystem.out.println();\n \t\t}\n \t\t}\n \t}\n }\n }\n }\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) throws Exception {\n // TODO ?????????????????????????????????????????????\n \n boolean first=true;\n try (BufferedReader br = new BufferedReader(new InputStreamReader(System.in))) {\n String line;\n int i=0,n=0,m=0;\n int[][] card=null;\n while ((line = br.readLine()) != null) {\n \tString[] str=line.split(\" \");\n \tif(first){\n \t\tn=Integer.parseInt(str[0]);\n \t\tm=Integer.parseInt(str[1]);\n \t\tcard=new int[n+1][m+1];\n \t\tfirst=false;\n \t}else{\n \t\tint sum=0;\n \t\tfor(int j=0;j<m;j++){\n \t\t\tcard[i][j]=Integer.parseInt(str[j]);\n \t\t\tcard[n][j]+=Integer.parseInt(str[j]);\n \t\t\tsum+=card[i][j];\n \t\t}\n \t\tcard[i][m]=sum;\n \t\t\n \t\ti++;\n \t\tif(i==n){\n \t\t\tfor(int j=0;j<n;j++){\n \t\t\t\tcard[n][m]+=card[j][m];\n \t\t\t}\n \t\t\tfor(int j=0;j<n+1;j++){\n \t\t\t\tfor(int k=0;k<m+1;k++){\n \t\t\tSystem.out.print(card[j][k]);\n \t\t\tif(k!=m)System.out.print(\" \");\n \t\t}\n \t\t\t\tSystem.out.println();\n \t\t}\n \t\t}\n \t}\n }\n }\n }\n\n}",
"Main",
"public static void main(String[] args) throws Exception {\n // TODO ?????????????????????????????????????????????\n \n boolean first=true;\n try (BufferedReader br = new BufferedReader(new InputStreamReader(System.in))) {\n String line;\n int i=0,n=0,m=0;\n int[][] card=null;\n while ((line = br.readLine()) != null) {\n \tString[] str=line.split(\" \");\n \tif(first){\n \t\tn=Integer.parseInt(str[0]);\n \t\tm=Integer.parseInt(str[1]);\n \t\tcard=new int[n+1][m+1];\n \t\tfirst=false;\n \t}else{\n \t\tint sum=0;\n \t\tfor(int j=0;j<m;j++){\n \t\t\tcard[i][j]=Integer.parseInt(str[j]);\n \t\t\tcard[n][j]+=Integer.parseInt(str[j]);\n \t\t\tsum+=card[i][j];\n \t\t}\n \t\tcard[i][m]=sum;\n \t\t\n \t\ti++;\n \t\tif(i==n){\n \t\t\tfor(int j=0;j<n;j++){\n \t\t\t\tcard[n][m]+=card[j][m];\n \t\t\t}\n \t\t\tfor(int j=0;j<n+1;j++){\n \t\t\t\tfor(int k=0;k<m+1;k++){\n \t\t\tSystem.out.print(card[j][k]);\n \t\t\tif(k!=m)System.out.print(\" \");\n \t\t}\n \t\t\t\tSystem.out.println();\n \t\t}\n \t\t}\n \t}\n }\n }\n }",
"main",
"{\n // TODO ?????????????????????????????????????????????\n \n boolean first=true;\n try (BufferedReader br = new BufferedReader(new InputStreamReader(System.in))) {\n String line;\n int i=0,n=0,m=0;\n int[][] card=null;\n while ((line = br.readLine()) != null) {\n \tString[] str=line.split(\" \");\n \tif(first){\n \t\tn=Integer.parseInt(str[0]);\n \t\tm=Integer.parseInt(str[1]);\n \t\tcard=new int[n+1][m+1];\n \t\tfirst=false;\n \t}else{\n \t\tint sum=0;\n \t\tfor(int j=0;j<m;j++){\n \t\t\tcard[i][j]=Integer.parseInt(str[j]);\n \t\t\tcard[n][j]+=Integer.parseInt(str[j]);\n \t\t\tsum+=card[i][j];\n \t\t}\n \t\tcard[i][m]=sum;\n \t\t\n \t\ti++;\n \t\tif(i==n){\n \t\t\tfor(int j=0;j<n;j++){\n \t\t\t\tcard[n][m]+=card[j][m];\n \t\t\t}\n \t\t\tfor(int j=0;j<n+1;j++){\n \t\t\t\tfor(int k=0;k<m+1;k++){\n \t\t\tSystem.out.print(card[j][k]);\n \t\t\tif(k!=m)System.out.print(\" \");\n \t\t}\n \t\t\t\tSystem.out.println();\n \t\t}\n \t\t}\n \t}\n }\n }\n }",
"boolean first=true;",
"first",
"true",
"try (BufferedReader br = new BufferedReader(new InputStreamReader(System.in))) {\n String line;\n int i=0,n=0,m=0;\n int[][] card=null;\n while ((line = br.readLine()) != null) {\n \tString[] str=line.split(\" \");\n \tif(first){\n \t\tn=Integer.parseInt(str[0]);\n \t\tm=Integer.parseInt(str[1]);\n \t\tcard=new int[n+1][m+1];\n \t\tfirst=false;\n \t}else{\n \t\tint sum=0;\n \t\tfor(int j=0;j<m;j++){\n \t\t\tcard[i][j]=Integer.parseInt(str[j]);\n \t\t\tcard[n][j]+=Integer.parseInt(str[j]);\n \t\t\tsum+=card[i][j];\n \t\t}\n \t\tcard[i][m]=sum;\n \t\t\n \t\ti++;\n \t\tif(i==n){\n \t\t\tfor(int j=0;j<n;j++){\n \t\t\t\tcard[n][m]+=card[j][m];\n \t\t\t}\n \t\t\tfor(int j=0;j<n+1;j++){\n \t\t\t\tfor(int k=0;k<m+1;k++){\n \t\t\tSystem.out.print(card[j][k]);\n \t\t\tif(k!=m)System.out.print(\" \");\n \t\t}\n \t\t\t\tSystem.out.println();\n \t\t}\n \t\t}\n \t}\n }\n }",
"{\n String line;\n int i=0,n=0,m=0;\n int[][] card=null;\n while ((line = br.readLine()) != null) {\n \tString[] str=line.split(\" \");\n \tif(first){\n \t\tn=Integer.parseInt(str[0]);\n \t\tm=Integer.parseInt(str[1]);\n \t\tcard=new int[n+1][m+1];\n \t\tfirst=false;\n \t}else{\n \t\tint sum=0;\n \t\tfor(int j=0;j<m;j++){\n \t\t\tcard[i][j]=Integer.parseInt(str[j]);\n \t\t\tcard[n][j]+=Integer.parseInt(str[j]);\n \t\t\tsum+=card[i][j];\n \t\t}\n \t\tcard[i][m]=sum;\n \t\t\n \t\ti++;\n \t\tif(i==n){\n \t\t\tfor(int j=0;j<n;j++){\n \t\t\t\tcard[n][m]+=card[j][m];\n \t\t\t}\n \t\t\tfor(int j=0;j<n+1;j++){\n \t\t\t\tfor(int k=0;k<m+1;k++){\n \t\t\tSystem.out.print(card[j][k]);\n \t\t\tif(k!=m)System.out.print(\" \");\n \t\t}\n \t\t\t\tSystem.out.println();\n \t\t}\n \t\t}\n \t}\n }\n }",
"BufferedReader br = new BufferedReader(new InputStreamReader(System.in))",
"BufferedReader br = new BufferedReader(new InputStreamReader(System.in))",
"new BufferedReader(new InputStreamReader(System.in))",
"String line;",
"line",
"int i=0",
"i",
"0",
"n=0",
"n",
"0",
"m=0;",
"m",
"0",
"int[][] card=null;",
"card",
"null",
"while ((line = br.readLine()) != null) {\n \tString[] str=line.split(\" \");\n \tif(first){\n \t\tn=Integer.parseInt(str[0]);\n \t\tm=Integer.parseInt(str[1]);\n \t\tcard=new int[n+1][m+1];\n \t\tfirst=false;\n \t}else{\n \t\tint sum=0;\n \t\tfor(int j=0;j<m;j++){\n \t\t\tcard[i][j]=Integer.parseInt(str[j]);\n \t\t\tcard[n][j]+=Integer.parseInt(str[j]);\n \t\t\tsum+=card[i][j];\n \t\t}\n \t\tcard[i][m]=sum;\n \t\t\n \t\ti++;\n \t\tif(i==n){\n \t\t\tfor(int j=0;j<n;j++){\n \t\t\t\tcard[n][m]+=card[j][m];\n \t\t\t}\n \t\t\tfor(int j=0;j<n+1;j++){\n \t\t\t\tfor(int k=0;k<m+1;k++){\n \t\t\tSystem.out.print(card[j][k]);\n \t\t\tif(k!=m)System.out.print(\" \");\n \t\t}\n \t\t\t\tSystem.out.println();\n \t\t}\n \t\t}\n \t}\n }",
"(line = br.readLine()) != null",
"(line = br.readLine())",
"line",
"br.readLine()",
"br.readLine",
"br",
"null",
"{\n \tString[] str=line.split(\" \");\n \tif(first){\n \t\tn=Integer.parseInt(str[0]);\n \t\tm=Integer.parseInt(str[1]);\n \t\tcard=new int[n+1][m+1];\n \t\tfirst=false;\n \t}else{\n \t\tint sum=0;\n \t\tfor(int j=0;j<m;j++){\n \t\t\tcard[i][j]=Integer.parseInt(str[j]);\n \t\t\tcard[n][j]+=Integer.parseInt(str[j]);\n \t\t\tsum+=card[i][j];\n \t\t}\n \t\tcard[i][m]=sum;\n \t\t\n \t\ti++;\n \t\tif(i==n){\n \t\t\tfor(int j=0;j<n;j++){\n \t\t\t\tcard[n][m]+=card[j][m];\n \t\t\t}\n \t\t\tfor(int j=0;j<n+1;j++){\n \t\t\t\tfor(int k=0;k<m+1;k++){\n \t\t\tSystem.out.print(card[j][k]);\n \t\t\tif(k!=m)System.out.print(\" \");\n \t\t}\n \t\t\t\tSystem.out.println();\n \t\t}\n \t\t}\n \t}\n }",
"String[] str=line.split(\" \");",
"str",
"line.split(\" \")",
"line.split",
"line",
"\" \"",
"if(first){\n \t\tn=Integer.parseInt(str[0]);\n \t\tm=Integer.parseInt(str[1]);\n \t\tcard=new int[n+1][m+1];\n \t\tfirst=false;\n \t}else{\n \t\tint sum=0;\n \t\tfor(int j=0;j<m;j++){\n \t\t\tcard[i][j]=Integer.parseInt(str[j]);\n \t\t\tcard[n][j]+=Integer.parseInt(str[j]);\n \t\t\tsum+=card[i][j];\n \t\t}\n \t\tcard[i][m]=sum;\n \t\t\n \t\ti++;\n \t\tif(i==n){\n \t\t\tfor(int j=0;j<n;j++){\n \t\t\t\tcard[n][m]+=card[j][m];\n \t\t\t}\n \t\t\tfor(int j=0;j<n+1;j++){\n \t\t\t\tfor(int k=0;k<m+1;k++){\n \t\t\tSystem.out.print(card[j][k]);\n \t\t\tif(k!=m)System.out.print(\" \");\n \t\t}\n \t\t\t\tSystem.out.println();\n \t\t}\n \t\t}\n \t}",
"first",
"{\n \t\tn=Integer.parseInt(str[0]);\n \t\tm=Integer.parseInt(str[1]);\n \t\tcard=new int[n+1][m+1];\n \t\tfirst=false;\n \t}",
"n=Integer.parseInt(str[0])",
"n",
"Integer.parseInt(str[0])",
"Integer.parseInt",
"Integer",
"str[0]",
"str",
"0",
"m=Integer.parseInt(str[1])",
"m",
"Integer.parseInt(str[1])",
"Integer.parseInt",
"Integer",
"str[1]",
"str",
"1",
"card=new int[n+1][m+1]",
"card",
"new int[n+1][m+1]",
"n+1",
"n",
"1",
"m+1",
"m",
"1",
"first=false",
"first",
"false",
"{\n \t\tint sum=0;\n \t\tfor(int j=0;j<m;j++){\n \t\t\tcard[i][j]=Integer.parseInt(str[j]);\n \t\t\tcard[n][j]+=Integer.parseInt(str[j]);\n \t\t\tsum+=card[i][j];\n \t\t}\n \t\tcard[i][m]=sum;\n \t\t\n \t\ti++;\n \t\tif(i==n){\n \t\t\tfor(int j=0;j<n;j++){\n \t\t\t\tcard[n][m]+=card[j][m];\n \t\t\t}\n \t\t\tfor(int j=0;j<n+1;j++){\n \t\t\t\tfor(int k=0;k<m+1;k++){\n \t\t\tSystem.out.print(card[j][k]);\n \t\t\tif(k!=m)System.out.print(\" \");\n \t\t}\n \t\t\t\tSystem.out.println();\n \t\t}\n \t\t}\n \t}",
"int sum=0;",
"sum",
"0",
"for(int j=0;j<m;j++){\n \t\t\tcard[i][j]=Integer.parseInt(str[j]);\n \t\t\tcard[n][j]+=Integer.parseInt(str[j]);\n \t\t\tsum+=card[i][j];\n \t\t}",
"int j=0;",
"int j=0;",
"j",
"0",
"j<m",
"j",
"m",
"j++",
"j++",
"j",
"{\n \t\t\tcard[i][j]=Integer.parseInt(str[j]);\n \t\t\tcard[n][j]+=Integer.parseInt(str[j]);\n \t\t\tsum+=card[i][j];\n \t\t}",
"{\n \t\t\tcard[i][j]=Integer.parseInt(str[j]);\n \t\t\tcard[n][j]+=Integer.parseInt(str[j]);\n \t\t\tsum+=card[i][j];\n \t\t}",
"card[i][j]=Integer.parseInt(str[j])",
"card[i][j]",
"card[i]",
"card",
"i",
"j",
"Integer.parseInt(str[j])",
"Integer.parseInt",
"Integer",
"str[j]",
"str",
"j",
"card[n][j]+=Integer.parseInt(str[j])",
"card[n][j]",
"card[n]",
"card",
"n",
"j",
"Integer.parseInt(str[j])",
"Integer.parseInt",
"Integer",
"str[j]",
"str",
"j",
"sum+=card[i][j]",
"sum",
"card[i][j]",
"card[i]",
"card",
"i",
"j",
"card[i][m]=sum",
"card[i][m]",
"card[i]",
"card",
"i",
"m",
"sum",
"i++",
"i",
"if(i==n){\n \t\t\tfor(int j=0;j<n;j++){\n \t\t\t\tcard[n][m]+=card[j][m];\n \t\t\t}\n \t\t\tfor(int j=0;j<n+1;j++){\n \t\t\t\tfor(int k=0;k<m+1;k++){\n \t\t\tSystem.out.print(card[j][k]);\n \t\t\tif(k!=m)System.out.print(\" \");\n \t\t}\n \t\t\t\tSystem.out.println();\n \t\t}\n \t\t}",
"i==n",
"i",
"n",
"{\n \t\t\tfor(int j=0;j<n;j++){\n \t\t\t\tcard[n][m]+=card[j][m];\n \t\t\t}\n \t\t\tfor(int j=0;j<n+1;j++){\n \t\t\t\tfor(int k=0;k<m+1;k++){\n \t\t\tSystem.out.print(card[j][k]);\n \t\t\tif(k!=m)System.out.print(\" \");\n \t\t}\n \t\t\t\tSystem.out.println();\n \t\t}\n \t\t}",
"for(int j=0;j<n;j++){\n \t\t\t\tcard[n][m]+=card[j][m];\n \t\t\t}",
"int j=0;",
"int j=0;",
"j",
"0",
"j<n",
"j",
"n",
"j++",
"j++",
"j",
"{\n \t\t\t\tcard[n][m]+=card[j][m];\n \t\t\t}",
"{\n \t\t\t\tcard[n][m]+=card[j][m];\n \t\t\t}",
"card[n][m]+=card[j][m]",
"card[n][m]",
"card[n]",
"card",
"n",
"m",
"card[j][m]",
"card[j]",
"card",
"j",
"m",
"for(int j=0;j<n+1;j++){\n \t\t\t\tfor(int k=0;k<m+1;k++){\n \t\t\tSystem.out.print(card[j][k]);\n \t\t\tif(k!=m)System.out.print(\" \");\n \t\t}\n \t\t\t\tSystem.out.println();\n \t\t}",
"int j=0;",
"int j=0;",
"j",
"0",
"j<n+1",
"j",
"n+1",
"n",
"1",
"j++",
"j++",
"j",
"{\n \t\t\t\tfor(int k=0;k<m+1;k++){\n \t\t\tSystem.out.print(card[j][k]);\n \t\t\tif(k!=m)System.out.print(\" \");\n \t\t}\n \t\t\t\tSystem.out.println();\n \t\t}",
"{\n \t\t\t\tfor(int k=0;k<m+1;k++){\n \t\t\tSystem.out.print(card[j][k]);\n \t\t\tif(k!=m)System.out.print(\" \");\n \t\t}\n \t\t\t\tSystem.out.println();\n \t\t}",
"for(int k=0;k<m+1;k++){\n \t\t\tSystem.out.print(card[j][k]);\n \t\t\tif(k!=m)System.out.print(\" \");\n \t\t}",
"int k=0;",
"int k=0;",
"k",
"0",
"k<m+1",
"k",
"m+1",
"m",
"1",
"k++",
"k++",
"k",
"{\n \t\t\tSystem.out.print(card[j][k]);\n \t\t\tif(k!=m)System.out.print(\" \");\n \t\t}",
"{\n \t\t\tSystem.out.print(card[j][k]);\n \t\t\tif(k!=m)System.out.print(\" \");\n \t\t}",
"System.out.print(card[j][k])",
"System.out.print",
"System.out",
"System",
"System.out",
"card[j][k]",
"card[j]",
"card",
"j",
"k",
"if(k!=m)System.out.print(\" \");",
"k!=m",
"k",
"m",
"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 Exception {\n // TODO ?????????????????????????????????????????????\n \n boolean first=true;\n try (BufferedReader br = new BufferedReader(new InputStreamReader(System.in))) {\n String line;\n int i=0,n=0,m=0;\n int[][] card=null;\n while ((line = br.readLine()) != null) {\n \tString[] str=line.split(\" \");\n \tif(first){\n \t\tn=Integer.parseInt(str[0]);\n \t\tm=Integer.parseInt(str[1]);\n \t\tcard=new int[n+1][m+1];\n \t\tfirst=false;\n \t}else{\n \t\tint sum=0;\n \t\tfor(int j=0;j<m;j++){\n \t\t\tcard[i][j]=Integer.parseInt(str[j]);\n \t\t\tcard[n][j]+=Integer.parseInt(str[j]);\n \t\t\tsum+=card[i][j];\n \t\t}\n \t\tcard[i][m]=sum;\n \t\t\n \t\ti++;\n \t\tif(i==n){\n \t\t\tfor(int j=0;j<n;j++){\n \t\t\t\tcard[n][m]+=card[j][m];\n \t\t\t}\n \t\t\tfor(int j=0;j<n+1;j++){\n \t\t\t\tfor(int k=0;k<m+1;k++){\n \t\t\tSystem.out.print(card[j][k]);\n \t\t\tif(k!=m)System.out.print(\" \");\n \t\t}\n \t\t\t\tSystem.out.println();\n \t\t}\n \t\t}\n \t}\n }\n }\n }\n\n}",
"public class Main {\n\n\tpublic static void main(String[] args) throws Exception {\n // TODO ?????????????????????????????????????????????\n \n boolean first=true;\n try (BufferedReader br = new BufferedReader(new InputStreamReader(System.in))) {\n String line;\n int i=0,n=0,m=0;\n int[][] card=null;\n while ((line = br.readLine()) != null) {\n \tString[] str=line.split(\" \");\n \tif(first){\n \t\tn=Integer.parseInt(str[0]);\n \t\tm=Integer.parseInt(str[1]);\n \t\tcard=new int[n+1][m+1];\n \t\tfirst=false;\n \t}else{\n \t\tint sum=0;\n \t\tfor(int j=0;j<m;j++){\n \t\t\tcard[i][j]=Integer.parseInt(str[j]);\n \t\t\tcard[n][j]+=Integer.parseInt(str[j]);\n \t\t\tsum+=card[i][j];\n \t\t}\n \t\tcard[i][m]=sum;\n \t\t\n \t\ti++;\n \t\tif(i==n){\n \t\t\tfor(int j=0;j<n;j++){\n \t\t\t\tcard[n][m]+=card[j][m];\n \t\t\t}\n \t\t\tfor(int j=0;j<n+1;j++){\n \t\t\t\tfor(int k=0;k<m+1;k++){\n \t\t\tSystem.out.print(card[j][k]);\n \t\t\tif(k!=m)System.out.print(\" \");\n \t\t}\n \t\t\t\tSystem.out.println();\n \t\t}\n \t\t}\n \t}\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 {
// TODO ?????????????????????????????????????????????
boolean first=true;
try (BufferedReader br = new BufferedReader(new InputStreamReader(System.in))) {
String line;
int i=0,n=0,m=0;
int[][] card=null;
while ((line = br.readLine()) != null) {
String[] str=line.split(" ");
if(first){
n=Integer.parseInt(str[0]);
m=Integer.parseInt(str[1]);
card=new int[n+1][m+1];
first=false;
}else{
int sum=0;
for(int j=0;j<m;j++){
card[i][j]=Integer.parseInt(str[j]);
card[n][j]+=Integer.parseInt(str[j]);
sum+=card[i][j];
}
card[i][m]=sum;
i++;
if(i==n){
for(int j=0;j<n;j++){
card[n][m]+=card[j][m];
}
for(int j=0;j<n+1;j++){
for(int k=0;k<m+1;k++){
System.out.print(card[j][k]);
if(k!=m)System.out.print(" ");
}
System.out.println();
}
}
}
}
}
}
} |
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
41,
13,
20,
2,
13,
17,
2,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
18,
18,
13,
13,
13,
4,
18,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
18,
18,
13,
13,
13,
18,
18,
13,
13,
13,
0,
18,
18,
13,
13,
13,
18,
18,
13,
13,
13,
4,
18,
18,
13,
13,
17,
18,
18,
13,
13,
13,
4,
18,
18,
13,
13,
18,
18,
13,
13,
13,
0,
18,
18,
13,
13,
13,
18,
18,
13,
13,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
4,
18,
18,
13,
13,
17,
18,
18,
13,
13,
13,
4,
18,
18,
13,
13,
18,
18,
13,
13,
13,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
183,
5
],
[
183,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
8,
17
],
[
17,
18
],
[
17,
19
],
[
19,
20
],
[
20,
21
],
[
8,
22
],
[
22,
23
],
[
22,
24
],
[
25,
26
],
[
25,
27
],
[
28,
29
],
[
28,
30
],
[
8,
31
],
[
31,
32
],
[
32,
33
],
[
33,
34
],
[
33,
35
],
[
31,
36
],
[
36,
37
],
[
36,
38
],
[
31,
39
],
[
39,
40
],
[
40,
41
],
[
31,
42
],
[
43,
43
],
[
43,
44
],
[
44,
45
],
[
45,
46
],
[
46,
47
],
[
46,
48
],
[
44,
49
],
[
49,
50
],
[
49,
51
],
[
44,
52
],
[
52,
53
],
[
53,
54
],
[
44,
55
],
[
56,
56
],
[
56,
57
],
[
57,
58
],
[
58,
59
],
[
59,
60
],
[
59,
61
],
[
58,
62
],
[
57,
63
],
[
63,
64
],
[
64,
65
],
[
8,
66
],
[
66,
67
],
[
67,
68
],
[
68,
69
],
[
68,
70
],
[
66,
71
],
[
71,
72
],
[
71,
73
],
[
66,
74
],
[
74,
75
],
[
75,
76
],
[
66,
77
],
[
78,
78
],
[
78,
79
],
[
79,
80
],
[
80,
81
],
[
81,
82
],
[
81,
83
],
[
79,
84
],
[
84,
85
],
[
84,
86
],
[
79,
87
],
[
87,
88
],
[
88,
89
],
[
79,
90
],
[
91,
91
],
[
91,
92
],
[
92,
93
],
[
93,
94
],
[
94,
95
],
[
94,
96
],
[
93,
97
],
[
92,
98
],
[
98,
99
],
[
99,
100
],
[
99,
101
],
[
98,
102
],
[
91,
103
],
[
103,
104
],
[
104,
105
],
[
105,
106
],
[
105,
107
],
[
104,
108
],
[
103,
109
],
[
109,
110
],
[
110,
111
],
[
110,
112
],
[
109,
113
],
[
91,
114
],
[
114,
115
],
[
115,
116
],
[
116,
117
],
[
116,
118
],
[
114,
119
],
[
114,
120
],
[
120,
121
],
[
121,
122
],
[
121,
123
],
[
120,
124
],
[
78,
125
],
[
125,
126
],
[
126,
127
],
[
127,
128
],
[
127,
129
],
[
125,
130
],
[
130,
131
],
[
131,
132
],
[
131,
133
],
[
130,
134
],
[
78,
135
],
[
135,
136
],
[
136,
137
],
[
137,
138
],
[
137,
139
],
[
136,
140
],
[
135,
141
],
[
141,
142
],
[
142,
143
],
[
142,
144
],
[
141,
145
],
[
8,
146
],
[
146,
147
],
[
147,
148
],
[
148,
149
],
[
148,
150
],
[
146,
151
],
[
151,
152
],
[
151,
153
],
[
146,
154
],
[
154,
155
],
[
155,
156
],
[
146,
157
],
[
158,
158
],
[
158,
159
],
[
159,
160
],
[
160,
161
],
[
161,
162
],
[
161,
163
],
[
159,
164
],
[
159,
165
],
[
165,
166
],
[
166,
167
],
[
166,
168
],
[
165,
169
],
[
8,
170
],
[
170,
171
],
[
171,
172
],
[
172,
173
],
[
172,
174
],
[
170,
175
],
[
175,
176
],
[
176,
177
],
[
176,
178
],
[
175,
179
],
[
6,
180
],
[
180,
181
],
[
0,
182
],
[
182,
183
],
[
182,
184
]
] | [
"import java.util.Scanner;\n\npublic class Main {\n\n\tpublic static void main(String[] args) {\n\t\t// TODO Auto-generated method stub\n\t\tScanner sc = new Scanner(System.in);\n\n\t\tint r = sc.nextInt();\n\t\tint c = sc.nextInt();\n\t\tint [][] cell = 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\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\tcell[i][c] += cell[i][j];\n\t\t\t\tcell[r][j] += cell[i][j];\n\t\t\t\tSystem.out.printf(\"%d \",cell[i][j]);\n\t\t\t}\n\t\t\tSystem.out.println(cell[i][c]);\n\t\t\tcell[r][c] += cell[i][c];\n\t\t}\n\t\tfor(int i = 0; i < c; i++) {\n\t\t\tSystem.out.printf(\"%d \",cell[r][i]);\n//\t\t\tcell[r][c] += cell[r][i];\n\t\t}\n\t\t\n\t\tSystem.out.println(cell[r][c]);\n\t\t\n\n\t}\n}\n",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n\n\tpublic static void main(String[] args) {\n\t\t// TODO Auto-generated method stub\n\t\tScanner sc = new Scanner(System.in);\n\n\t\tint r = sc.nextInt();\n\t\tint c = sc.nextInt();\n\t\tint [][] cell = 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\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\tcell[i][c] += cell[i][j];\n\t\t\t\tcell[r][j] += cell[i][j];\n\t\t\t\tSystem.out.printf(\"%d \",cell[i][j]);\n\t\t\t}\n\t\t\tSystem.out.println(cell[i][c]);\n\t\t\tcell[r][c] += cell[i][c];\n\t\t}\n\t\tfor(int i = 0; i < c; i++) {\n\t\t\tSystem.out.printf(\"%d \",cell[r][i]);\n//\t\t\tcell[r][c] += cell[r][i];\n\t\t}\n\t\t\n\t\tSystem.out.println(cell[r][c]);\n\t\t\n\n\t}\n}",
"Main",
"public static void main(String[] args) {\n\t\t// TODO Auto-generated method stub\n\t\tScanner sc = new Scanner(System.in);\n\n\t\tint r = sc.nextInt();\n\t\tint c = sc.nextInt();\n\t\tint [][] cell = 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\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\tcell[i][c] += cell[i][j];\n\t\t\t\tcell[r][j] += cell[i][j];\n\t\t\t\tSystem.out.printf(\"%d \",cell[i][j]);\n\t\t\t}\n\t\t\tSystem.out.println(cell[i][c]);\n\t\t\tcell[r][c] += cell[i][c];\n\t\t}\n\t\tfor(int i = 0; i < c; i++) {\n\t\t\tSystem.out.printf(\"%d \",cell[r][i]);\n//\t\t\tcell[r][c] += cell[r][i];\n\t\t}\n\t\t\n\t\tSystem.out.println(cell[r][c]);\n\t\t\n\n\t}",
"main",
"{\n\t\t// TODO Auto-generated method stub\n\t\tScanner sc = new Scanner(System.in);\n\n\t\tint r = sc.nextInt();\n\t\tint c = sc.nextInt();\n\t\tint [][] cell = 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\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\tcell[i][c] += cell[i][j];\n\t\t\t\tcell[r][j] += cell[i][j];\n\t\t\t\tSystem.out.printf(\"%d \",cell[i][j]);\n\t\t\t}\n\t\t\tSystem.out.println(cell[i][c]);\n\t\t\tcell[r][c] += cell[i][c];\n\t\t}\n\t\tfor(int i = 0; i < c; i++) {\n\t\t\tSystem.out.printf(\"%d \",cell[r][i]);\n//\t\t\tcell[r][c] += cell[r][i];\n\t\t}\n\t\t\n\t\tSystem.out.println(cell[r][c]);\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 [][] 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\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\tcell[i][c] += cell[i][j];\n\t\t\t\tcell[r][j] += cell[i][j];\n\t\t\t\tSystem.out.printf(\"%d \",cell[i][j]);\n\t\t\t}\n\t\t\tSystem.out.println(cell[i][c]);\n\t\t\tcell[r][c] += cell[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\tcell[i][c] += cell[i][j];\n\t\t\t\tcell[r][j] += cell[i][j];\n\t\t\t\tSystem.out.printf(\"%d \",cell[i][j]);\n\t\t\t}\n\t\t\tSystem.out.println(cell[i][c]);\n\t\t\tcell[r][c] += cell[i][c];\n\t\t}",
"{\n\t\t\tfor(int j = 0; j < c; j++) {\n\t\t\t\tcell[i][c] += cell[i][j];\n\t\t\t\tcell[r][j] += cell[i][j];\n\t\t\t\tSystem.out.printf(\"%d \",cell[i][j]);\n\t\t\t}\n\t\t\tSystem.out.println(cell[i][c]);\n\t\t\tcell[r][c] += cell[i][c];\n\t\t}",
"for(int j = 0; j < c; j++) {\n\t\t\t\tcell[i][c] += cell[i][j];\n\t\t\t\tcell[r][j] += cell[i][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\tcell[i][c] += cell[i][j];\n\t\t\t\tcell[r][j] += cell[i][j];\n\t\t\t\tSystem.out.printf(\"%d \",cell[i][j]);\n\t\t\t}",
"{\n\t\t\t\tcell[i][c] += cell[i][j];\n\t\t\t\tcell[r][j] += cell[i][j];\n\t\t\t\tSystem.out.printf(\"%d \",cell[i][j]);\n\t\t\t}",
"cell[i][c] += cell[i][j]",
"cell[i][c]",
"cell[i]",
"cell",
"i",
"c",
"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",
"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.println(cell[i][c])",
"System.out.println",
"System.out",
"System",
"System.out",
"cell[i][c]",
"cell[i]",
"cell",
"i",
"c",
"cell[r][c] += cell[i][c]",
"cell[r][c]",
"cell[r]",
"cell",
"r",
"c",
"cell[i][c]",
"cell[i]",
"cell",
"i",
"c",
"for(int i = 0; i < c; i++) {\n\t\t\tSystem.out.printf(\"%d \",cell[r][i]);\n//\t\t\tcell[r][c] += cell[r][i];\n\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < c",
"i",
"c",
"i++",
"i++",
"i",
"{\n\t\t\tSystem.out.printf(\"%d \",cell[r][i]);\n//\t\t\tcell[r][c] += cell[r][i];\n\t\t}",
"{\n\t\t\tSystem.out.printf(\"%d \",cell[r][i]);\n//\t\t\tcell[r][c] += cell[r][i];\n\t\t}",
"System.out.printf(\"%d \",cell[r][i])",
"System.out.printf",
"System.out",
"System",
"System.out",
"\"%d \"",
"cell[r][i]",
"cell[r]",
"cell",
"r",
"i",
"System.out.println(cell[r][c])",
"System.out.println",
"System.out",
"System",
"System.out",
"cell[r][c]",
"cell[r]",
"cell",
"r",
"c",
"String[] args",
"args",
"public class Main {\n\n\tpublic static void main(String[] args) {\n\t\t// TODO Auto-generated method stub\n\t\tScanner sc = new Scanner(System.in);\n\n\t\tint r = sc.nextInt();\n\t\tint c = sc.nextInt();\n\t\tint [][] cell = 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\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\tcell[i][c] += cell[i][j];\n\t\t\t\tcell[r][j] += cell[i][j];\n\t\t\t\tSystem.out.printf(\"%d \",cell[i][j]);\n\t\t\t}\n\t\t\tSystem.out.println(cell[i][c]);\n\t\t\tcell[r][c] += cell[i][c];\n\t\t}\n\t\tfor(int i = 0; i < c; i++) {\n\t\t\tSystem.out.printf(\"%d \",cell[r][i]);\n//\t\t\tcell[r][c] += cell[r][i];\n\t\t}\n\t\t\n\t\tSystem.out.println(cell[r][c]);\n\t\t\n\n\t}\n}",
"public class Main {\n\n\tpublic static void main(String[] args) {\n\t\t// TODO Auto-generated method stub\n\t\tScanner sc = new Scanner(System.in);\n\n\t\tint r = sc.nextInt();\n\t\tint c = sc.nextInt();\n\t\tint [][] cell = 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\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\tcell[i][c] += cell[i][j];\n\t\t\t\tcell[r][j] += cell[i][j];\n\t\t\t\tSystem.out.printf(\"%d \",cell[i][j]);\n\t\t\t}\n\t\t\tSystem.out.println(cell[i][c]);\n\t\t\tcell[r][c] += cell[i][c];\n\t\t}\n\t\tfor(int i = 0; i < c; i++) {\n\t\t\tSystem.out.printf(\"%d \",cell[r][i]);\n//\t\t\tcell[r][c] += cell[r][i];\n\t\t}\n\t\t\n\t\tSystem.out.println(cell[r][c]);\n\t\t\n\n\t}\n}",
"Main"
] | import java.util.Scanner;
public class Main {
public static void main(String[] args) {
// TODO Auto-generated method stub
Scanner sc = new Scanner(System.in);
int r = sc.nextInt();
int c = sc.nextInt();
int [][] cell = new int[r+1][c+1];
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++) {
cell[i][c] += cell[i][j];
cell[r][j] += cell[i][j];
System.out.printf("%d ",cell[i][j]);
}
System.out.println(cell[i][c]);
cell[r][c] += cell[i][c];
}
for(int i = 0; i < c; i++) {
System.out.printf("%d ",cell[r][i]);
// cell[r][c] += cell[r][i];
}
System.out.println(cell[r][c]);
}
}
|
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
4,
18,
13,
17,
41,
13,
4,
18,
13,
18,
13,
17,
41,
13,
4,
18,
13,
18,
13,
17,
41,
13,
2,
13,
17,
41,
13,
2,
13,
17,
41,
13,
20,
13,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
18,
18,
13,
13,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
18,
18,
13,
13,
13,
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,
14,
2,
13,
13,
30,
4,
18,
18,
13,
13,
2,
18,
18,
13,
13,
13,
17,
30,
4,
18,
18,
13,
13,
18,
18,
13,
13,
13,
23,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
16,
17
],
[
17,
18
],
[
14,
19
],
[
8,
20
],
[
20,
21
],
[
20,
22
],
[
22,
23
],
[
23,
24
],
[
22,
25
],
[
25,
26
],
[
25,
27
],
[
8,
28
],
[
28,
29
],
[
28,
30
],
[
30,
31
],
[
31,
32
],
[
30,
33
],
[
33,
34
],
[
33,
35
],
[
8,
36
],
[
36,
37
],
[
36,
38
],
[
38,
39
],
[
38,
40
],
[
8,
41
],
[
41,
42
],
[
41,
43
],
[
43,
44
],
[
43,
45
],
[
8,
46
],
[
46,
47
],
[
46,
48
],
[
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
],
[
65,
69
],
[
64,
70
],
[
63,
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
],
[
85,
89
],
[
84,
90
],
[
90,
91
],
[
91,
92
],
[
83,
93
],
[
93,
94
],
[
94,
95
],
[
95,
96
],
[
95,
97
],
[
94,
98
],
[
93,
99
],
[
99,
100
],
[
100,
101
],
[
100,
102
],
[
99,
103
],
[
83,
104
],
[
104,
105
],
[
105,
106
],
[
106,
107
],
[
106,
108
],
[
105,
109
],
[
104,
110
],
[
110,
111
],
[
111,
112
],
[
111,
113
],
[
110,
114
],
[
83,
115
],
[
115,
116
],
[
116,
117
],
[
117,
118
],
[
117,
119
],
[
116,
120
],
[
115,
121
],
[
121,
122
],
[
122,
123
],
[
122,
124
],
[
121,
125
],
[
8,
126
],
[
126,
127
],
[
127,
128
],
[
128,
129
],
[
128,
130
],
[
126,
131
],
[
131,
132
],
[
131,
133
],
[
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
],
[
153,
154
],
[
153,
155
],
[
152,
156
],
[
156,
157
],
[
157,
158
],
[
158,
159
],
[
159,
160
],
[
159,
161
],
[
157,
162
],
[
162,
163
],
[
163,
164
],
[
164,
165
],
[
164,
166
],
[
163,
167
],
[
162,
168
],
[
152,
169
],
[
169,
170
],
[
170,
171
],
[
171,
172
],
[
172,
173
],
[
172,
174
],
[
170,
175
],
[
175,
176
],
[
176,
177
],
[
176,
178
],
[
175,
179
],
[
6,
180
],
[
180,
181
]
] | [
"import java.util.*;\n\nclass Main {\n public static void main(String args[]) {\n Scanner sc = new Scanner(System.in);\n String[] s = sc.nextLine().split(\" \");\n int r = Integer.parseInt(s[0]);\n int c = Integer.parseInt(s[1]);\n int rPlus1 = r + 1;\n int cPlus1 = c + 1;\n int t[][] = new int[rPlus1][cPlus1];\n for (int i = 0; i < r; i++) {\n t[i][c] = 0;\n for (int j = 0; j < c; j++) {\n t[i][j] = sc.nextInt();\n t[i][c] += t[i][j];\n t[r][j] += t[i][j];\n t[r][c] += t[i][j];\n }\n }\n for (int i = 0; i < rPlus1; i++) {\n for (int j = 0; j < cPlus1; j++) {\n if (j != c) {\n System.out.print(t[i][j] + \" \");\n } else {\n System.out.println(t[i][j]);\n }\n }\n }\n }\n}",
"import java.util.*;",
"util.*",
"java",
"class Main {\n public static void main(String args[]) {\n Scanner sc = new Scanner(System.in);\n String[] s = sc.nextLine().split(\" \");\n int r = Integer.parseInt(s[0]);\n int c = Integer.parseInt(s[1]);\n int rPlus1 = r + 1;\n int cPlus1 = c + 1;\n int t[][] = new int[rPlus1][cPlus1];\n for (int i = 0; i < r; i++) {\n t[i][c] = 0;\n for (int j = 0; j < c; j++) {\n t[i][j] = sc.nextInt();\n t[i][c] += t[i][j];\n t[r][j] += t[i][j];\n t[r][c] += t[i][j];\n }\n }\n for (int i = 0; i < rPlus1; i++) {\n for (int j = 0; j < cPlus1; j++) {\n if (j != c) {\n System.out.print(t[i][j] + \" \");\n } else {\n System.out.println(t[i][j]);\n }\n }\n }\n }\n}",
"Main",
"public static void main(String args[]) {\n Scanner sc = new Scanner(System.in);\n String[] s = sc.nextLine().split(\" \");\n int r = Integer.parseInt(s[0]);\n int c = Integer.parseInt(s[1]);\n int rPlus1 = r + 1;\n int cPlus1 = c + 1;\n int t[][] = new int[rPlus1][cPlus1];\n for (int i = 0; i < r; i++) {\n t[i][c] = 0;\n for (int j = 0; j < c; j++) {\n t[i][j] = sc.nextInt();\n t[i][c] += t[i][j];\n t[r][j] += t[i][j];\n t[r][c] += t[i][j];\n }\n }\n for (int i = 0; i < rPlus1; i++) {\n for (int j = 0; j < cPlus1; j++) {\n if (j != c) {\n System.out.print(t[i][j] + \" \");\n } else {\n System.out.println(t[i][j]);\n }\n }\n }\n }",
"main",
"{\n Scanner sc = new Scanner(System.in);\n String[] s = sc.nextLine().split(\" \");\n int r = Integer.parseInt(s[0]);\n int c = Integer.parseInt(s[1]);\n int rPlus1 = r + 1;\n int cPlus1 = c + 1;\n int t[][] = new int[rPlus1][cPlus1];\n for (int i = 0; i < r; i++) {\n t[i][c] = 0;\n for (int j = 0; j < c; j++) {\n t[i][j] = sc.nextInt();\n t[i][c] += t[i][j];\n t[r][j] += t[i][j];\n t[r][c] += t[i][j];\n }\n }\n for (int i = 0; i < rPlus1; i++) {\n for (int j = 0; j < cPlus1; j++) {\n if (j != c) {\n System.out.print(t[i][j] + \" \");\n } else {\n System.out.println(t[i][j]);\n }\n }\n }\n }",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"String[] s = sc.nextLine().split(\" \");",
"s",
"sc.nextLine().split(\" \")",
"sc.nextLine().split",
"sc.nextLine()",
"sc.nextLine",
"sc",
"\" \"",
"int r = Integer.parseInt(s[0]);",
"r",
"Integer.parseInt(s[0])",
"Integer.parseInt",
"Integer",
"s[0]",
"s",
"0",
"int c = Integer.parseInt(s[1]);",
"c",
"Integer.parseInt(s[1])",
"Integer.parseInt",
"Integer",
"s[1]",
"s",
"1",
"int rPlus1 = r + 1;",
"rPlus1",
"r + 1",
"r",
"1",
"int cPlus1 = c + 1;",
"cPlus1",
"c + 1",
"c",
"1",
"int t[][] = new int[rPlus1][cPlus1];",
"t",
"new int[rPlus1][cPlus1]",
"rPlus1",
"cPlus1",
"for (int i = 0; i < r; i++) {\n t[i][c] = 0;\n for (int j = 0; j < c; j++) {\n t[i][j] = sc.nextInt();\n t[i][c] += t[i][j];\n t[r][j] += t[i][j];\n t[r][c] += t[i][j];\n }\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < r",
"i",
"r",
"i++",
"i++",
"i",
"{\n t[i][c] = 0;\n for (int j = 0; j < c; j++) {\n t[i][j] = sc.nextInt();\n t[i][c] += t[i][j];\n t[r][j] += t[i][j];\n t[r][c] += t[i][j];\n }\n }",
"{\n t[i][c] = 0;\n for (int j = 0; j < c; j++) {\n t[i][j] = sc.nextInt();\n t[i][c] += t[i][j];\n t[r][j] += t[i][j];\n t[r][c] += t[i][j];\n }\n }",
"t[i][c] = 0",
"t[i][c]",
"t[i]",
"t",
"i",
"c",
"0",
"for (int j = 0; j < c; j++) {\n t[i][j] = sc.nextInt();\n t[i][c] += t[i][j];\n t[r][j] += t[i][j];\n t[r][c] += t[i][j];\n }",
"int j = 0;",
"int j = 0;",
"j",
"0",
"j < c",
"j",
"c",
"j++",
"j++",
"j",
"{\n t[i][j] = sc.nextInt();\n t[i][c] += t[i][j];\n t[r][j] += t[i][j];\n t[r][c] += t[i][j];\n }",
"{\n t[i][j] = sc.nextInt();\n t[i][c] += t[i][j];\n t[r][j] += t[i][j];\n t[r][c] += t[i][j];\n }",
"t[i][j] = sc.nextInt()",
"t[i][j]",
"t[i]",
"t",
"i",
"j",
"sc.nextInt()",
"sc.nextInt",
"sc",
"t[i][c] += t[i][j]",
"t[i][c]",
"t[i]",
"t",
"i",
"c",
"t[i][j]",
"t[i]",
"t",
"i",
"j",
"t[r][j] += t[i][j]",
"t[r][j]",
"t[r]",
"t",
"r",
"j",
"t[i][j]",
"t[i]",
"t",
"i",
"j",
"t[r][c] += t[i][j]",
"t[r][c]",
"t[r]",
"t",
"r",
"c",
"t[i][j]",
"t[i]",
"t",
"i",
"j",
"for (int i = 0; i < rPlus1; i++) {\n for (int j = 0; j < cPlus1; j++) {\n if (j != c) {\n System.out.print(t[i][j] + \" \");\n } else {\n System.out.println(t[i][j]);\n }\n }\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < rPlus1",
"i",
"rPlus1",
"i++",
"i++",
"i",
"{\n for (int j = 0; j < cPlus1; j++) {\n if (j != c) {\n System.out.print(t[i][j] + \" \");\n } else {\n System.out.println(t[i][j]);\n }\n }\n }",
"{\n for (int j = 0; j < cPlus1; j++) {\n if (j != c) {\n System.out.print(t[i][j] + \" \");\n } else {\n System.out.println(t[i][j]);\n }\n }\n }",
"for (int j = 0; j < cPlus1; j++) {\n if (j != c) {\n System.out.print(t[i][j] + \" \");\n } else {\n System.out.println(t[i][j]);\n }\n }",
"int j = 0;",
"int j = 0;",
"j",
"0",
"j < cPlus1",
"j",
"cPlus1",
"j++",
"j++",
"j",
"{\n if (j != c) {\n System.out.print(t[i][j] + \" \");\n } else {\n System.out.println(t[i][j]);\n }\n }",
"{\n if (j != c) {\n System.out.print(t[i][j] + \" \");\n } else {\n System.out.println(t[i][j]);\n }\n }",
"if (j != c) {\n System.out.print(t[i][j] + \" \");\n } else {\n System.out.println(t[i][j]);\n }",
"j != c",
"j",
"c",
"{\n System.out.print(t[i][j] + \" \");\n }",
"System.out.print(t[i][j] + \" \")",
"System.out.print",
"System.out",
"System",
"System.out",
"t[i][j] + \" \"",
"t[i][j]",
"t[i]",
"t",
"i",
"j",
"\" \"",
"{\n System.out.println(t[i][j]);\n }",
"System.out.println(t[i][j])",
"System.out.println",
"System.out",
"System",
"System.out",
"t[i][j]",
"t[i]",
"t",
"i",
"j",
"String args[]",
"args"
] | import java.util.*;
class Main {
public static void main(String args[]) {
Scanner sc = new Scanner(System.in);
String[] s = sc.nextLine().split(" ");
int r = Integer.parseInt(s[0]);
int c = Integer.parseInt(s[1]);
int rPlus1 = r + 1;
int cPlus1 = c + 1;
int t[][] = new int[rPlus1][cPlus1];
for (int i = 0; i < r; i++) {
t[i][c] = 0;
for (int j = 0; j < c; j++) {
t[i][j] = sc.nextInt();
t[i][c] += t[i][j];
t[r][j] += t[i][j];
t[r][c] += t[i][j];
}
}
for (int i = 0; i < rPlus1; i++) {
for (int j = 0; j < cPlus1; j++) {
if (j != c) {
System.out.print(t[i][j] + " ");
} else {
System.out.println(t[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,
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,
0,
18,
18,
13,
13,
13,
13,
14,
2,
13,
13,
30,
0,
18,
18,
13,
13,
13,
13,
14,
2,
13,
13,
30,
0,
18,
18,
13,
13,
13,
18,
13,
13,
30,
41,
13,
4,
18,
13,
0,
13,
13,
0,
13,
13,
0,
18,
13,
13,
13,
0,
18,
18,
13,
13,
13,
13,
4,
13,
13,
23,
13,
12,
13,
30,
11,
1,
41,
13,
17,
2,
13,
18,
13,
13,
1,
40,
13,
30,
30,
11,
1,
41,
13,
17,
2,
13,
18,
18,
13,
17,
13,
1,
40,
13,
30,
30,
4,
18,
18,
13,
13,
18,
18,
13,
13,
13,
14,
2,
13,
2,
18,
18,
13,
17,
13,
17,
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
],
[
212,
5
],
[
212,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
8,
17
],
[
17,
18
],
[
17,
19
],
[
19,
20
],
[
20,
21
],
[
8,
22
],
[
22,
23
],
[
22,
24
],
[
25,
26
],
[
25,
27
],
[
28,
29
],
[
28,
30
],
[
8,
31
],
[
31,
32
],
[
31,
33
],
[
8,
35
],
[
35,
36
],
[
35,
37
],
[
8,
38
],
[
38,
39
],
[
39,
40
],
[
40,
41
],
[
40,
42
],
[
38,
43
],
[
43,
44
],
[
43,
45
],
[
45,
46
],
[
45,
47
],
[
38,
48
],
[
48,
49
],
[
49,
50
],
[
38,
51
],
[
52,
52
],
[
52,
53
],
[
53,
54
],
[
53,
55
],
[
52,
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
],
[
70,
70
],
[
70,
71
],
[
71,
72
],
[
72,
73
],
[
73,
74
],
[
73,
75
],
[
72,
76
],
[
76,
77
],
[
76,
78
],
[
71,
79
],
[
79,
80
],
[
80,
81
],
[
81,
82
],
[
82,
83
],
[
82,
84
],
[
81,
85
],
[
80,
86
],
[
71,
87
],
[
87,
88
],
[
88,
89
],
[
88,
90
],
[
87,
91
],
[
91,
92
],
[
92,
93
],
[
93,
94
],
[
94,
95
],
[
94,
96
],
[
93,
97
],
[
92,
98
],
[
87,
99
],
[
99,
100
],
[
100,
101
],
[
100,
102
],
[
99,
103
],
[
103,
104
],
[
104,
105
],
[
105,
106
],
[
106,
107
],
[
106,
108
],
[
105,
109
],
[
104,
110
],
[
110,
111
],
[
110,
112
],
[
99,
113
],
[
113,
114
],
[
114,
115
],
[
114,
116
],
[
116,
117
],
[
117,
118
],
[
113,
119
],
[
119,
120
],
[
119,
121
],
[
113,
122
],
[
122,
123
],
[
122,
124
],
[
113,
125
],
[
125,
126
],
[
126,
127
],
[
126,
128
],
[
125,
129
],
[
113,
130
],
[
130,
131
],
[
131,
132
],
[
132,
133
],
[
132,
134
],
[
131,
135
],
[
130,
136
],
[
8,
137
],
[
137,
138
],
[
137,
139
],
[
6,
140
],
[
140,
141
],
[
212,
142
],
[
142,
143
],
[
142,
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
],
[
162,
163
],
[
162,
164
],
[
160,
165
],
[
165,
166
],
[
165,
167
],
[
167,
168
],
[
168,
169
],
[
168,
170
],
[
167,
171
],
[
160,
172
],
[
172,
173
],
[
173,
174
],
[
160,
175
],
[
176,
176
],
[
176,
177
],
[
177,
178
],
[
178,
179
],
[
179,
180
],
[
179,
181
],
[
177,
182
],
[
182,
183
],
[
183,
184
],
[
183,
185
],
[
182,
186
],
[
176,
187
],
[
187,
188
],
[
188,
189
],
[
188,
190
],
[
190,
191
],
[
191,
192
],
[
192,
193
],
[
192,
194
],
[
191,
195
],
[
190,
196
],
[
187,
197
],
[
197,
198
],
[
198,
199
],
[
199,
200
],
[
199,
201
],
[
197,
202
],
[
159,
203
],
[
203,
204
],
[
204,
205
],
[
205,
206
],
[
205,
207
],
[
203,
208
],
[
142,
209
],
[
209,
210
],
[
0,
211
],
[
211,
212
],
[
211,
213
]
] | [
"import java.util.Scanner;\n\npublic class Main {\n public static void main(String[] args) {\n Scanner input = new Scanner(System.in);\n\n // Grab the row and col data\n int rows = input.nextInt();\n int cols = input.nextInt();\n\n // build the matrix and add 1 to the cols and rows for the result matrix\n int[][] result = new int[rows +1][cols+1];\n\n // Create the storage contains for the running total\n int[] colTot = new int[cols]; // only column totals are needed since row totals can be done while read in\n int total = 0;\n\n // Compute totals in line\n for(int row = 0; row < rows+1; row++) {\n int rowTemp = 0;\n for(int col = 0; col < cols+1; col++){\n // nested if-else structure that handles the three border cases:\n // 1 - on the end of the row\n // 2 - at the bottom of a column\n // 3 - at the bottom right hand corner of the matrix\n // These cases need special handling otherwise grab the next entry from the input and calculate the\n // appropriate values\n if(col == cols && row == rows){\n result[row][col] = total;\n } else if(col == cols){\n result[row][col] = rowTemp;\n } else if(row == rows) {\n result[row][col] = colTot[col];\n } else {\n // Compute the rest of the values\n int temp = input.nextInt();\n total += temp;\n rowTemp += temp;\n colTot[col] += temp;\n result[row][col] = temp;\n }\n }\n }\n // display output\n showSheet(result);\n\n }\n\n private static void showSheet(int[][] result){\n for(int i = 0; i < result.length; i++){\n for(int j = 0; j < result[0].length; j++){\n System.out.print(result[i][j]);\n if( j < result[0].length - 1) System.out.print(\" \");\n }\n System.out.print(\"\\n\");\n }\n }\n}\n",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n public static void main(String[] args) {\n Scanner input = new Scanner(System.in);\n\n // Grab the row and col data\n int rows = input.nextInt();\n int cols = input.nextInt();\n\n // build the matrix and add 1 to the cols and rows for the result matrix\n int[][] result = new int[rows +1][cols+1];\n\n // Create the storage contains for the running total\n int[] colTot = new int[cols]; // only column totals are needed since row totals can be done while read in\n int total = 0;\n\n // Compute totals in line\n for(int row = 0; row < rows+1; row++) {\n int rowTemp = 0;\n for(int col = 0; col < cols+1; col++){\n // nested if-else structure that handles the three border cases:\n // 1 - on the end of the row\n // 2 - at the bottom of a column\n // 3 - at the bottom right hand corner of the matrix\n // These cases need special handling otherwise grab the next entry from the input and calculate the\n // appropriate values\n if(col == cols && row == rows){\n result[row][col] = total;\n } else if(col == cols){\n result[row][col] = rowTemp;\n } else if(row == rows) {\n result[row][col] = colTot[col];\n } else {\n // Compute the rest of the values\n int temp = input.nextInt();\n total += temp;\n rowTemp += temp;\n colTot[col] += temp;\n result[row][col] = temp;\n }\n }\n }\n // display output\n showSheet(result);\n\n }\n\n private static void showSheet(int[][] result){\n for(int i = 0; i < result.length; i++){\n for(int j = 0; j < result[0].length; j++){\n System.out.print(result[i][j]);\n if( j < result[0].length - 1) System.out.print(\" \");\n }\n System.out.print(\"\\n\");\n }\n }\n}",
"Main",
"public static void main(String[] args) {\n Scanner input = new Scanner(System.in);\n\n // Grab the row and col data\n int rows = input.nextInt();\n int cols = input.nextInt();\n\n // build the matrix and add 1 to the cols and rows for the result matrix\n int[][] result = new int[rows +1][cols+1];\n\n // Create the storage contains for the running total\n int[] colTot = new int[cols]; // only column totals are needed since row totals can be done while read in\n int total = 0;\n\n // Compute totals in line\n for(int row = 0; row < rows+1; row++) {\n int rowTemp = 0;\n for(int col = 0; col < cols+1; col++){\n // nested if-else structure that handles the three border cases:\n // 1 - on the end of the row\n // 2 - at the bottom of a column\n // 3 - at the bottom right hand corner of the matrix\n // These cases need special handling otherwise grab the next entry from the input and calculate the\n // appropriate values\n if(col == cols && row == rows){\n result[row][col] = total;\n } else if(col == cols){\n result[row][col] = rowTemp;\n } else if(row == rows) {\n result[row][col] = colTot[col];\n } else {\n // Compute the rest of the values\n int temp = input.nextInt();\n total += temp;\n rowTemp += temp;\n colTot[col] += temp;\n result[row][col] = temp;\n }\n }\n }\n // display output\n showSheet(result);\n\n }",
"main",
"{\n Scanner input = new Scanner(System.in);\n\n // Grab the row and col data\n int rows = input.nextInt();\n int cols = input.nextInt();\n\n // build the matrix and add 1 to the cols and rows for the result matrix\n int[][] result = new int[rows +1][cols+1];\n\n // Create the storage contains for the running total\n int[] colTot = new int[cols]; // only column totals are needed since row totals can be done while read in\n int total = 0;\n\n // Compute totals in line\n for(int row = 0; row < rows+1; row++) {\n int rowTemp = 0;\n for(int col = 0; col < cols+1; col++){\n // nested if-else structure that handles the three border cases:\n // 1 - on the end of the row\n // 2 - at the bottom of a column\n // 3 - at the bottom right hand corner of the matrix\n // These cases need special handling otherwise grab the next entry from the input and calculate the\n // appropriate values\n if(col == cols && row == rows){\n result[row][col] = total;\n } else if(col == cols){\n result[row][col] = rowTemp;\n } else if(row == rows) {\n result[row][col] = colTot[col];\n } else {\n // Compute the rest of the values\n int temp = input.nextInt();\n total += temp;\n rowTemp += temp;\n colTot[col] += temp;\n result[row][col] = temp;\n }\n }\n }\n // display output\n showSheet(result);\n\n }",
"Scanner input = new Scanner(System.in);",
"input",
"new Scanner(System.in)",
"int rows = input.nextInt();",
"rows",
"input.nextInt()",
"input.nextInt",
"input",
"int cols = input.nextInt();",
"cols",
"input.nextInt()",
"input.nextInt",
"input",
"int[][] result = new int[rows +1][cols+1];",
"result",
"new int[rows +1][cols+1]",
"rows +1",
"rows",
"1",
"cols+1",
"cols",
"1",
"int[] colTot = new int[cols];",
"colTot",
"new int[cols]",
"cols",
"int total = 0;",
"total",
"0",
"for(int row = 0; row < rows+1; row++) {\n int rowTemp = 0;\n for(int col = 0; col < cols+1; col++){\n // nested if-else structure that handles the three border cases:\n // 1 - on the end of the row\n // 2 - at the bottom of a column\n // 3 - at the bottom right hand corner of the matrix\n // These cases need special handling otherwise grab the next entry from the input and calculate the\n // appropriate values\n if(col == cols && row == rows){\n result[row][col] = total;\n } else if(col == cols){\n result[row][col] = rowTemp;\n } else if(row == rows) {\n result[row][col] = colTot[col];\n } else {\n // Compute the rest of the values\n int temp = input.nextInt();\n total += temp;\n rowTemp += temp;\n colTot[col] += temp;\n result[row][col] = temp;\n }\n }\n }",
"int row = 0;",
"int row = 0;",
"row",
"0",
"row < rows+1",
"row",
"rows+1",
"rows",
"1",
"row++",
"row++",
"row",
"{\n int rowTemp = 0;\n for(int col = 0; col < cols+1; col++){\n // nested if-else structure that handles the three border cases:\n // 1 - on the end of the row\n // 2 - at the bottom of a column\n // 3 - at the bottom right hand corner of the matrix\n // These cases need special handling otherwise grab the next entry from the input and calculate the\n // appropriate values\n if(col == cols && row == rows){\n result[row][col] = total;\n } else if(col == cols){\n result[row][col] = rowTemp;\n } else if(row == rows) {\n result[row][col] = colTot[col];\n } else {\n // Compute the rest of the values\n int temp = input.nextInt();\n total += temp;\n rowTemp += temp;\n colTot[col] += temp;\n result[row][col] = temp;\n }\n }\n }",
"{\n int rowTemp = 0;\n for(int col = 0; col < cols+1; col++){\n // nested if-else structure that handles the three border cases:\n // 1 - on the end of the row\n // 2 - at the bottom of a column\n // 3 - at the bottom right hand corner of the matrix\n // These cases need special handling otherwise grab the next entry from the input and calculate the\n // appropriate values\n if(col == cols && row == rows){\n result[row][col] = total;\n } else if(col == cols){\n result[row][col] = rowTemp;\n } else if(row == rows) {\n result[row][col] = colTot[col];\n } else {\n // Compute the rest of the values\n int temp = input.nextInt();\n total += temp;\n rowTemp += temp;\n colTot[col] += temp;\n result[row][col] = temp;\n }\n }\n }",
"int rowTemp = 0;",
"rowTemp",
"0",
"for(int col = 0; col < cols+1; col++){\n // nested if-else structure that handles the three border cases:\n // 1 - on the end of the row\n // 2 - at the bottom of a column\n // 3 - at the bottom right hand corner of the matrix\n // These cases need special handling otherwise grab the next entry from the input and calculate the\n // appropriate values\n if(col == cols && row == rows){\n result[row][col] = total;\n } else if(col == cols){\n result[row][col] = rowTemp;\n } else if(row == rows) {\n result[row][col] = colTot[col];\n } else {\n // Compute the rest of the values\n int temp = input.nextInt();\n total += temp;\n rowTemp += temp;\n colTot[col] += temp;\n result[row][col] = temp;\n }\n }",
"int col = 0;",
"int col = 0;",
"col",
"0",
"col < cols+1",
"col",
"cols+1",
"cols",
"1",
"col++",
"col++",
"col",
"{\n // nested if-else structure that handles the three border cases:\n // 1 - on the end of the row\n // 2 - at the bottom of a column\n // 3 - at the bottom right hand corner of the matrix\n // These cases need special handling otherwise grab the next entry from the input and calculate the\n // appropriate values\n if(col == cols && row == rows){\n result[row][col] = total;\n } else if(col == cols){\n result[row][col] = rowTemp;\n } else if(row == rows) {\n result[row][col] = colTot[col];\n } else {\n // Compute the rest of the values\n int temp = input.nextInt();\n total += temp;\n rowTemp += temp;\n colTot[col] += temp;\n result[row][col] = temp;\n }\n }",
"{\n // nested if-else structure that handles the three border cases:\n // 1 - on the end of the row\n // 2 - at the bottom of a column\n // 3 - at the bottom right hand corner of the matrix\n // These cases need special handling otherwise grab the next entry from the input and calculate the\n // appropriate values\n if(col == cols && row == rows){\n result[row][col] = total;\n } else if(col == cols){\n result[row][col] = rowTemp;\n } else if(row == rows) {\n result[row][col] = colTot[col];\n } else {\n // Compute the rest of the values\n int temp = input.nextInt();\n total += temp;\n rowTemp += temp;\n colTot[col] += temp;\n result[row][col] = temp;\n }\n }",
"if(col == cols && row == rows){\n result[row][col] = total;\n } else if(col == cols){\n result[row][col] = rowTemp;\n } else if(row == rows) {\n result[row][col] = colTot[col];\n } else {\n // Compute the rest of the values\n int temp = input.nextInt();\n total += temp;\n rowTemp += temp;\n colTot[col] += temp;\n result[row][col] = temp;\n }",
"col == cols && row == rows",
"col == cols",
"col",
"cols",
"row == rows",
"row",
"rows",
"{\n result[row][col] = total;\n }",
"result[row][col] = total",
"result[row][col]",
"result[row]",
"result",
"row",
"col",
"total",
"if(col == cols){\n result[row][col] = rowTemp;\n } else if(row == rows) {\n result[row][col] = colTot[col];\n } else {\n // Compute the rest of the values\n int temp = input.nextInt();\n total += temp;\n rowTemp += temp;\n colTot[col] += temp;\n result[row][col] = temp;\n }",
"col == cols",
"col",
"cols",
"{\n result[row][col] = rowTemp;\n }",
"result[row][col] = rowTemp",
"result[row][col]",
"result[row]",
"result",
"row",
"col",
"rowTemp",
"if(row == rows) {\n result[row][col] = colTot[col];\n } else {\n // Compute the rest of the values\n int temp = input.nextInt();\n total += temp;\n rowTemp += temp;\n colTot[col] += temp;\n result[row][col] = temp;\n }",
"row == rows",
"row",
"rows",
"{\n result[row][col] = colTot[col];\n }",
"result[row][col] = colTot[col]",
"result[row][col]",
"result[row]",
"result",
"row",
"col",
"colTot[col]",
"colTot",
"col",
"{\n // Compute the rest of the values\n int temp = input.nextInt();\n total += temp;\n rowTemp += temp;\n colTot[col] += temp;\n result[row][col] = temp;\n }",
"int temp = input.nextInt();",
"temp",
"input.nextInt()",
"input.nextInt",
"input",
"total += temp",
"total",
"temp",
"rowTemp += temp",
"rowTemp",
"temp",
"colTot[col] += temp",
"colTot[col]",
"colTot",
"col",
"temp",
"result[row][col] = temp",
"result[row][col]",
"result[row]",
"result",
"row",
"col",
"temp",
"showSheet(result)",
"showSheet",
"result",
"String[] args",
"args",
"private static void showSheet(int[][] result){\n for(int i = 0; i < result.length; i++){\n for(int j = 0; j < result[0].length; j++){\n System.out.print(result[i][j]);\n if( j < result[0].length - 1) System.out.print(\" \");\n }\n System.out.print(\"\\n\");\n }\n }",
"showSheet",
"{\n for(int i = 0; i < result.length; i++){\n for(int j = 0; j < result[0].length; j++){\n System.out.print(result[i][j]);\n if( j < result[0].length - 1) System.out.print(\" \");\n }\n System.out.print(\"\\n\");\n }\n }",
"for(int i = 0; i < result.length; i++){\n for(int j = 0; j < result[0].length; j++){\n System.out.print(result[i][j]);\n if( j < result[0].length - 1) System.out.print(\" \");\n }\n System.out.print(\"\\n\");\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < result.length",
"i",
"result.length",
"result",
"result.length",
"i++",
"i++",
"i",
"{\n for(int j = 0; j < result[0].length; j++){\n System.out.print(result[i][j]);\n if( j < result[0].length - 1) System.out.print(\" \");\n }\n System.out.print(\"\\n\");\n }",
"{\n for(int j = 0; j < result[0].length; j++){\n System.out.print(result[i][j]);\n if( j < result[0].length - 1) System.out.print(\" \");\n }\n System.out.print(\"\\n\");\n }",
"for(int j = 0; j < result[0].length; j++){\n System.out.print(result[i][j]);\n if( j < result[0].length - 1) System.out.print(\" \");\n }",
"int j = 0;",
"int j = 0;",
"j",
"0",
"j < result[0].length",
"j",
"result[0].length",
"result[0]",
"result",
"0",
"result[0].length",
"j++",
"j++",
"j",
"{\n System.out.print(result[i][j]);\n if( j < result[0].length - 1) System.out.print(\" \");\n }",
"{\n System.out.print(result[i][j]);\n if( j < result[0].length - 1) System.out.print(\" \");\n }",
"System.out.print(result[i][j])",
"System.out.print",
"System.out",
"System",
"System.out",
"result[i][j]",
"result[i]",
"result",
"i",
"j",
"if( j < result[0].length - 1) System.out.print(\" \");",
"j < result[0].length - 1",
"j",
"result[0].length - 1",
"result[0].length",
"result[0]",
"result",
"0",
"result[0].length",
"1",
"System.out.print(\" \")",
"System.out.print",
"System.out",
"System",
"System.out",
"\" \"",
"System.out.print(\"\\n\")",
"System.out.print",
"System.out",
"System",
"System.out",
"\"\\n\"",
"int[][] result",
"result",
"public class Main {\n public static void main(String[] args) {\n Scanner input = new Scanner(System.in);\n\n // Grab the row and col data\n int rows = input.nextInt();\n int cols = input.nextInt();\n\n // build the matrix and add 1 to the cols and rows for the result matrix\n int[][] result = new int[rows +1][cols+1];\n\n // Create the storage contains for the running total\n int[] colTot = new int[cols]; // only column totals are needed since row totals can be done while read in\n int total = 0;\n\n // Compute totals in line\n for(int row = 0; row < rows+1; row++) {\n int rowTemp = 0;\n for(int col = 0; col < cols+1; col++){\n // nested if-else structure that handles the three border cases:\n // 1 - on the end of the row\n // 2 - at the bottom of a column\n // 3 - at the bottom right hand corner of the matrix\n // These cases need special handling otherwise grab the next entry from the input and calculate the\n // appropriate values\n if(col == cols && row == rows){\n result[row][col] = total;\n } else if(col == cols){\n result[row][col] = rowTemp;\n } else if(row == rows) {\n result[row][col] = colTot[col];\n } else {\n // Compute the rest of the values\n int temp = input.nextInt();\n total += temp;\n rowTemp += temp;\n colTot[col] += temp;\n result[row][col] = temp;\n }\n }\n }\n // display output\n showSheet(result);\n\n }\n\n private static void showSheet(int[][] result){\n for(int i = 0; i < result.length; i++){\n for(int j = 0; j < result[0].length; j++){\n System.out.print(result[i][j]);\n if( j < result[0].length - 1) System.out.print(\" \");\n }\n System.out.print(\"\\n\");\n }\n }\n}",
"public class Main {\n public static void main(String[] args) {\n Scanner input = new Scanner(System.in);\n\n // Grab the row and col data\n int rows = input.nextInt();\n int cols = input.nextInt();\n\n // build the matrix and add 1 to the cols and rows for the result matrix\n int[][] result = new int[rows +1][cols+1];\n\n // Create the storage contains for the running total\n int[] colTot = new int[cols]; // only column totals are needed since row totals can be done while read in\n int total = 0;\n\n // Compute totals in line\n for(int row = 0; row < rows+1; row++) {\n int rowTemp = 0;\n for(int col = 0; col < cols+1; col++){\n // nested if-else structure that handles the three border cases:\n // 1 - on the end of the row\n // 2 - at the bottom of a column\n // 3 - at the bottom right hand corner of the matrix\n // These cases need special handling otherwise grab the next entry from the input and calculate the\n // appropriate values\n if(col == cols && row == rows){\n result[row][col] = total;\n } else if(col == cols){\n result[row][col] = rowTemp;\n } else if(row == rows) {\n result[row][col] = colTot[col];\n } else {\n // Compute the rest of the values\n int temp = input.nextInt();\n total += temp;\n rowTemp += temp;\n colTot[col] += temp;\n result[row][col] = temp;\n }\n }\n }\n // display output\n showSheet(result);\n\n }\n\n private static void showSheet(int[][] result){\n for(int i = 0; i < result.length; i++){\n for(int j = 0; j < result[0].length; j++){\n System.out.print(result[i][j]);\n if( j < result[0].length - 1) System.out.print(\" \");\n }\n System.out.print(\"\\n\");\n }\n }\n}",
"Main"
] | import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
// Grab the row and col data
int rows = input.nextInt();
int cols = input.nextInt();
// build the matrix and add 1 to the cols and rows for the result matrix
int[][] result = new int[rows +1][cols+1];
// Create the storage contains for the running total
int[] colTot = new int[cols]; // only column totals are needed since row totals can be done while read in
int total = 0;
// Compute totals in line
for(int row = 0; row < rows+1; row++) {
int rowTemp = 0;
for(int col = 0; col < cols+1; col++){
// nested if-else structure that handles the three border cases:
// 1 - on the end of the row
// 2 - at the bottom of a column
// 3 - at the bottom right hand corner of the matrix
// These cases need special handling otherwise grab the next entry from the input and calculate the
// appropriate values
if(col == cols && row == rows){
result[row][col] = total;
} else if(col == cols){
result[row][col] = rowTemp;
} else if(row == rows) {
result[row][col] = colTot[col];
} else {
// Compute the rest of the values
int temp = input.nextInt();
total += temp;
rowTemp += temp;
colTot[col] += temp;
result[row][col] = temp;
}
}
}
// display output
showSheet(result);
}
private static void showSheet(int[][] result){
for(int i = 0; i < result.length; i++){
for(int j = 0; j < result[0].length; j++){
System.out.print(result[i][j]);
if( j < result[0].length - 1) System.out.print(" ");
}
System.out.print("\n");
}
}
}
|
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
41,
13,
41,
13,
41,
13,
41,
13,
0,
13,
4,
18,
13,
0,
13,
4,
18,
13,
41,
13,
20,
13,
13,
41,
13,
20,
2,
13,
17,
11,
1,
0,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
18,
13,
13,
17,
11,
1,
0,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
11,
1,
0,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
18,
18,
13,
13,
13,
4,
18,
13,
11,
1,
0,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
17,
14,
2,
13,
13,
30,
11,
1,
0,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
14,
2,
13,
13,
30,
4,
18,
18,
13,
13,
2,
18,
18,
13,
13,
13,
17,
0,
13,
18,
18,
13,
13,
13,
0,
18,
13,
13,
18,
18,
13,
13,
13,
30,
4,
18,
18,
13,
13,
13,
0,
18,
13,
13,
13,
30,
11,
1,
0,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
14,
2,
13,
13,
30,
4,
18,
18,
13,
13,
2,
18,
13,
13,
17,
30,
4,
18,
18,
13,
13,
18,
13,
13,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
216,
5
],
[
216,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
8,
14
],
[
14,
15
],
[
8,
16
],
[
16,
17
],
[
8,
18
],
[
18,
19
],
[
8,
20
],
[
20,
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
],
[
8,
37
],
[
37,
38
],
[
37,
39
],
[
40,
41
],
[
40,
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
],
[
57,
58
],
[
57,
59
],
[
56,
60
],
[
8,
61
],
[
61,
62
],
[
62,
63
],
[
63,
64
],
[
63,
65
],
[
61,
66
],
[
66,
67
],
[
66,
68
],
[
61,
69
],
[
69,
70
],
[
70,
71
],
[
61,
72
],
[
73,
73
],
[
73,
74
],
[
74,
75
],
[
75,
76
],
[
76,
77
],
[
76,
78
],
[
74,
79
],
[
79,
80
],
[
79,
81
],
[
74,
82
],
[
82,
83
],
[
83,
84
],
[
74,
85
],
[
86,
86
],
[
86,
87
],
[
87,
88
],
[
88,
89
],
[
89,
90
],
[
89,
91
],
[
88,
92
],
[
87,
93
],
[
93,
94
],
[
94,
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
],
[
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
],
[
131,
132
],
[
131,
133
],
[
130,
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
],
[
134,
147
],
[
147,
148
],
[
147,
149
],
[
149,
150
],
[
150,
151
],
[
150,
152
],
[
149,
153
],
[
134,
154
],
[
154,
155
],
[
155,
156
],
[
155,
157
],
[
154,
158
],
[
158,
159
],
[
159,
160
],
[
159,
161
],
[
158,
162
],
[
130,
163
],
[
163,
164
],
[
164,
165
],
[
165,
166
],
[
166,
167
],
[
166,
168
],
[
164,
169
],
[
163,
170
],
[
170,
171
],
[
171,
172
],
[
171,
173
],
[
170,
174
],
[
112,
175
],
[
175,
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
],
[
190,
192
],
[
189,
193
],
[
193,
194
],
[
194,
195
],
[
195,
196
],
[
196,
197
],
[
196,
198
],
[
194,
199
],
[
199,
200
],
[
200,
201
],
[
200,
202
],
[
199,
203
],
[
189,
204
],
[
204,
205
],
[
205,
206
],
[
206,
207
],
[
207,
208
],
[
207,
209
],
[
205,
210
],
[
210,
211
],
[
210,
212
],
[
6,
213
],
[
213,
214
],
[
0,
215
],
[
215,
216
],
[
215,
217
]
] | [
"import java.util.Scanner;\n\npublic class Main {\n\n public static void main(String[] args) {\n Scanner scan=new Scanner(System.in);\n int r,c,i,j,csum;\n r=scan.nextInt();\n c=scan.nextInt();\n int array[][]=new int[r][c],rsum[]=new int[c+1];\n for(i=0;i<c;i++) {\n \trsum[i]=0;\n }\n for(i=0;i<r;i++) {\n \tfor(j=0;j<c;j++) {\n \t\tarray[i][j]=scan.nextInt();\n \t}\n }\n for(i=0;i<=r;i++) {\n \tcsum=0;\n \tif(i<r) {\n \t\tfor(j=0;j<=c;j++) {\n \t\t\tif(j<c) {\n \t\t\t\tSystem.out.print(array[i][j] + \" \");\n \t\t\t\tcsum+=array[i][j];\n \t\t\t\trsum[j]+=array[i][j];\n \t\t\t}\n \t\t\telse {\n \t\t\t\tSystem.out.println(csum);\n \t\t\t\trsum[j]+=csum;\n \t\t\t}\n \t\t}\n \t}\n \telse {\n \t\tfor(j=0;j<=c;j++) {\n \t\t\tif(j<c) {\n \t\t\t\tSystem.out.print(rsum[j] + \" \");\n \t\t\t}\n \t\t\telse {\n \t\t\t\tSystem.out.println(rsum[j]);\n \t\t\t}\n \t\t}\n \t}\n }\n }\n}\n",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n\n public static void main(String[] args) {\n Scanner scan=new Scanner(System.in);\n int r,c,i,j,csum;\n r=scan.nextInt();\n c=scan.nextInt();\n int array[][]=new int[r][c],rsum[]=new int[c+1];\n for(i=0;i<c;i++) {\n \trsum[i]=0;\n }\n for(i=0;i<r;i++) {\n \tfor(j=0;j<c;j++) {\n \t\tarray[i][j]=scan.nextInt();\n \t}\n }\n for(i=0;i<=r;i++) {\n \tcsum=0;\n \tif(i<r) {\n \t\tfor(j=0;j<=c;j++) {\n \t\t\tif(j<c) {\n \t\t\t\tSystem.out.print(array[i][j] + \" \");\n \t\t\t\tcsum+=array[i][j];\n \t\t\t\trsum[j]+=array[i][j];\n \t\t\t}\n \t\t\telse {\n \t\t\t\tSystem.out.println(csum);\n \t\t\t\trsum[j]+=csum;\n \t\t\t}\n \t\t}\n \t}\n \telse {\n \t\tfor(j=0;j<=c;j++) {\n \t\t\tif(j<c) {\n \t\t\t\tSystem.out.print(rsum[j] + \" \");\n \t\t\t}\n \t\t\telse {\n \t\t\t\tSystem.out.println(rsum[j]);\n \t\t\t}\n \t\t}\n \t}\n }\n }\n}",
"Main",
"public static void main(String[] args) {\n Scanner scan=new Scanner(System.in);\n int r,c,i,j,csum;\n r=scan.nextInt();\n c=scan.nextInt();\n int array[][]=new int[r][c],rsum[]=new int[c+1];\n for(i=0;i<c;i++) {\n \trsum[i]=0;\n }\n for(i=0;i<r;i++) {\n \tfor(j=0;j<c;j++) {\n \t\tarray[i][j]=scan.nextInt();\n \t}\n }\n for(i=0;i<=r;i++) {\n \tcsum=0;\n \tif(i<r) {\n \t\tfor(j=0;j<=c;j++) {\n \t\t\tif(j<c) {\n \t\t\t\tSystem.out.print(array[i][j] + \" \");\n \t\t\t\tcsum+=array[i][j];\n \t\t\t\trsum[j]+=array[i][j];\n \t\t\t}\n \t\t\telse {\n \t\t\t\tSystem.out.println(csum);\n \t\t\t\trsum[j]+=csum;\n \t\t\t}\n \t\t}\n \t}\n \telse {\n \t\tfor(j=0;j<=c;j++) {\n \t\t\tif(j<c) {\n \t\t\t\tSystem.out.print(rsum[j] + \" \");\n \t\t\t}\n \t\t\telse {\n \t\t\t\tSystem.out.println(rsum[j]);\n \t\t\t}\n \t\t}\n \t}\n }\n }",
"main",
"{\n Scanner scan=new Scanner(System.in);\n int r,c,i,j,csum;\n r=scan.nextInt();\n c=scan.nextInt();\n int array[][]=new int[r][c],rsum[]=new int[c+1];\n for(i=0;i<c;i++) {\n \trsum[i]=0;\n }\n for(i=0;i<r;i++) {\n \tfor(j=0;j<c;j++) {\n \t\tarray[i][j]=scan.nextInt();\n \t}\n }\n for(i=0;i<=r;i++) {\n \tcsum=0;\n \tif(i<r) {\n \t\tfor(j=0;j<=c;j++) {\n \t\t\tif(j<c) {\n \t\t\t\tSystem.out.print(array[i][j] + \" \");\n \t\t\t\tcsum+=array[i][j];\n \t\t\t\trsum[j]+=array[i][j];\n \t\t\t}\n \t\t\telse {\n \t\t\t\tSystem.out.println(csum);\n \t\t\t\trsum[j]+=csum;\n \t\t\t}\n \t\t}\n \t}\n \telse {\n \t\tfor(j=0;j<=c;j++) {\n \t\t\tif(j<c) {\n \t\t\t\tSystem.out.print(rsum[j] + \" \");\n \t\t\t}\n \t\t\telse {\n \t\t\t\tSystem.out.println(rsum[j]);\n \t\t\t}\n \t\t}\n \t}\n }\n }",
"Scanner scan=new Scanner(System.in);",
"scan",
"new Scanner(System.in)",
"int r",
"r",
"c",
"c",
"i",
"i",
"j",
"j",
"csum;",
"csum",
"r=scan.nextInt()",
"r",
"scan.nextInt()",
"scan.nextInt",
"scan",
"c=scan.nextInt()",
"c",
"scan.nextInt()",
"scan.nextInt",
"scan",
"int array[][]=new int[r][c]",
"array",
"new int[r][c]",
"r",
"c",
"rsum[]=new int[c+1];",
"rsum",
"new int[c+1]",
"c+1",
"c",
"1",
"for(i=0;i<c;i++) {\n \trsum[i]=0;\n }",
"i=0;",
"i=0",
"i",
"0",
"i<c",
"i",
"c",
"i++",
"i++",
"i",
"{\n \trsum[i]=0;\n }",
"{\n \trsum[i]=0;\n }",
"rsum[i]=0",
"rsum[i]",
"rsum",
"i",
"0",
"for(i=0;i<r;i++) {\n \tfor(j=0;j<c;j++) {\n \t\tarray[i][j]=scan.nextInt();\n \t}\n }",
"i=0;",
"i=0",
"i",
"0",
"i<r",
"i",
"r",
"i++",
"i++",
"i",
"{\n \tfor(j=0;j<c;j++) {\n \t\tarray[i][j]=scan.nextInt();\n \t}\n }",
"{\n \tfor(j=0;j<c;j++) {\n \t\tarray[i][j]=scan.nextInt();\n \t}\n }",
"for(j=0;j<c;j++) {\n \t\tarray[i][j]=scan.nextInt();\n \t}",
"j=0;",
"j=0",
"j",
"0",
"j<c",
"j",
"c",
"j++",
"j++",
"j",
"{\n \t\tarray[i][j]=scan.nextInt();\n \t}",
"{\n \t\tarray[i][j]=scan.nextInt();\n \t}",
"array[i][j]=scan.nextInt()",
"array[i][j]",
"array[i]",
"array",
"i",
"j",
"scan.nextInt()",
"scan.nextInt",
"scan",
"for(i=0;i<=r;i++) {\n \tcsum=0;\n \tif(i<r) {\n \t\tfor(j=0;j<=c;j++) {\n \t\t\tif(j<c) {\n \t\t\t\tSystem.out.print(array[i][j] + \" \");\n \t\t\t\tcsum+=array[i][j];\n \t\t\t\trsum[j]+=array[i][j];\n \t\t\t}\n \t\t\telse {\n \t\t\t\tSystem.out.println(csum);\n \t\t\t\trsum[j]+=csum;\n \t\t\t}\n \t\t}\n \t}\n \telse {\n \t\tfor(j=0;j<=c;j++) {\n \t\t\tif(j<c) {\n \t\t\t\tSystem.out.print(rsum[j] + \" \");\n \t\t\t}\n \t\t\telse {\n \t\t\t\tSystem.out.println(rsum[j]);\n \t\t\t}\n \t\t}\n \t}\n }",
"i=0;",
"i=0",
"i",
"0",
"i<=r",
"i",
"r",
"i++",
"i++",
"i",
"{\n \tcsum=0;\n \tif(i<r) {\n \t\tfor(j=0;j<=c;j++) {\n \t\t\tif(j<c) {\n \t\t\t\tSystem.out.print(array[i][j] + \" \");\n \t\t\t\tcsum+=array[i][j];\n \t\t\t\trsum[j]+=array[i][j];\n \t\t\t}\n \t\t\telse {\n \t\t\t\tSystem.out.println(csum);\n \t\t\t\trsum[j]+=csum;\n \t\t\t}\n \t\t}\n \t}\n \telse {\n \t\tfor(j=0;j<=c;j++) {\n \t\t\tif(j<c) {\n \t\t\t\tSystem.out.print(rsum[j] + \" \");\n \t\t\t}\n \t\t\telse {\n \t\t\t\tSystem.out.println(rsum[j]);\n \t\t\t}\n \t\t}\n \t}\n }",
"{\n \tcsum=0;\n \tif(i<r) {\n \t\tfor(j=0;j<=c;j++) {\n \t\t\tif(j<c) {\n \t\t\t\tSystem.out.print(array[i][j] + \" \");\n \t\t\t\tcsum+=array[i][j];\n \t\t\t\trsum[j]+=array[i][j];\n \t\t\t}\n \t\t\telse {\n \t\t\t\tSystem.out.println(csum);\n \t\t\t\trsum[j]+=csum;\n \t\t\t}\n \t\t}\n \t}\n \telse {\n \t\tfor(j=0;j<=c;j++) {\n \t\t\tif(j<c) {\n \t\t\t\tSystem.out.print(rsum[j] + \" \");\n \t\t\t}\n \t\t\telse {\n \t\t\t\tSystem.out.println(rsum[j]);\n \t\t\t}\n \t\t}\n \t}\n }",
"csum=0",
"csum",
"0",
"if(i<r) {\n \t\tfor(j=0;j<=c;j++) {\n \t\t\tif(j<c) {\n \t\t\t\tSystem.out.print(array[i][j] + \" \");\n \t\t\t\tcsum+=array[i][j];\n \t\t\t\trsum[j]+=array[i][j];\n \t\t\t}\n \t\t\telse {\n \t\t\t\tSystem.out.println(csum);\n \t\t\t\trsum[j]+=csum;\n \t\t\t}\n \t\t}\n \t}\n \telse {\n \t\tfor(j=0;j<=c;j++) {\n \t\t\tif(j<c) {\n \t\t\t\tSystem.out.print(rsum[j] + \" \");\n \t\t\t}\n \t\t\telse {\n \t\t\t\tSystem.out.println(rsum[j]);\n \t\t\t}\n \t\t}\n \t}",
"i<r",
"i",
"r",
"{\n \t\tfor(j=0;j<=c;j++) {\n \t\t\tif(j<c) {\n \t\t\t\tSystem.out.print(array[i][j] + \" \");\n \t\t\t\tcsum+=array[i][j];\n \t\t\t\trsum[j]+=array[i][j];\n \t\t\t}\n \t\t\telse {\n \t\t\t\tSystem.out.println(csum);\n \t\t\t\trsum[j]+=csum;\n \t\t\t}\n \t\t}\n \t}",
"for(j=0;j<=c;j++) {\n \t\t\tif(j<c) {\n \t\t\t\tSystem.out.print(array[i][j] + \" \");\n \t\t\t\tcsum+=array[i][j];\n \t\t\t\trsum[j]+=array[i][j];\n \t\t\t}\n \t\t\telse {\n \t\t\t\tSystem.out.println(csum);\n \t\t\t\trsum[j]+=csum;\n \t\t\t}\n \t\t}",
"j=0;",
"j=0",
"j",
"0",
"j<=c",
"j",
"c",
"j++",
"j++",
"j",
"{\n \t\t\tif(j<c) {\n \t\t\t\tSystem.out.print(array[i][j] + \" \");\n \t\t\t\tcsum+=array[i][j];\n \t\t\t\trsum[j]+=array[i][j];\n \t\t\t}\n \t\t\telse {\n \t\t\t\tSystem.out.println(csum);\n \t\t\t\trsum[j]+=csum;\n \t\t\t}\n \t\t}",
"{\n \t\t\tif(j<c) {\n \t\t\t\tSystem.out.print(array[i][j] + \" \");\n \t\t\t\tcsum+=array[i][j];\n \t\t\t\trsum[j]+=array[i][j];\n \t\t\t}\n \t\t\telse {\n \t\t\t\tSystem.out.println(csum);\n \t\t\t\trsum[j]+=csum;\n \t\t\t}\n \t\t}",
"if(j<c) {\n \t\t\t\tSystem.out.print(array[i][j] + \" \");\n \t\t\t\tcsum+=array[i][j];\n \t\t\t\trsum[j]+=array[i][j];\n \t\t\t}\n \t\t\telse {\n \t\t\t\tSystem.out.println(csum);\n \t\t\t\trsum[j]+=csum;\n \t\t\t}",
"j<c",
"j",
"c",
"{\n \t\t\t\tSystem.out.print(array[i][j] + \" \");\n \t\t\t\tcsum+=array[i][j];\n \t\t\t\trsum[j]+=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",
"\" \"",
"csum+=array[i][j]",
"csum",
"array[i][j]",
"array[i]",
"array",
"i",
"j",
"rsum[j]+=array[i][j]",
"rsum[j]",
"rsum",
"j",
"array[i][j]",
"array[i]",
"array",
"i",
"j",
"{\n \t\t\t\tSystem.out.println(csum);\n \t\t\t\trsum[j]+=csum;\n \t\t\t}",
"System.out.println(csum)",
"System.out.println",
"System.out",
"System",
"System.out",
"csum",
"rsum[j]+=csum",
"rsum[j]",
"rsum",
"j",
"csum",
"{\n \t\tfor(j=0;j<=c;j++) {\n \t\t\tif(j<c) {\n \t\t\t\tSystem.out.print(rsum[j] + \" \");\n \t\t\t}\n \t\t\telse {\n \t\t\t\tSystem.out.println(rsum[j]);\n \t\t\t}\n \t\t}\n \t}",
"for(j=0;j<=c;j++) {\n \t\t\tif(j<c) {\n \t\t\t\tSystem.out.print(rsum[j] + \" \");\n \t\t\t}\n \t\t\telse {\n \t\t\t\tSystem.out.println(rsum[j]);\n \t\t\t}\n \t\t}",
"j=0;",
"j=0",
"j",
"0",
"j<=c",
"j",
"c",
"j++",
"j++",
"j",
"{\n \t\t\tif(j<c) {\n \t\t\t\tSystem.out.print(rsum[j] + \" \");\n \t\t\t}\n \t\t\telse {\n \t\t\t\tSystem.out.println(rsum[j]);\n \t\t\t}\n \t\t}",
"{\n \t\t\tif(j<c) {\n \t\t\t\tSystem.out.print(rsum[j] + \" \");\n \t\t\t}\n \t\t\telse {\n \t\t\t\tSystem.out.println(rsum[j]);\n \t\t\t}\n \t\t}",
"if(j<c) {\n \t\t\t\tSystem.out.print(rsum[j] + \" \");\n \t\t\t}\n \t\t\telse {\n \t\t\t\tSystem.out.println(rsum[j]);\n \t\t\t}",
"j<c",
"j",
"c",
"{\n \t\t\t\tSystem.out.print(rsum[j] + \" \");\n \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\tSystem.out.println(rsum[j]);\n \t\t\t}",
"System.out.println(rsum[j])",
"System.out.println",
"System.out",
"System",
"System.out",
"rsum[j]",
"rsum",
"j",
"String[] args",
"args",
"public class Main {\n\n public static void main(String[] args) {\n Scanner scan=new Scanner(System.in);\n int r,c,i,j,csum;\n r=scan.nextInt();\n c=scan.nextInt();\n int array[][]=new int[r][c],rsum[]=new int[c+1];\n for(i=0;i<c;i++) {\n \trsum[i]=0;\n }\n for(i=0;i<r;i++) {\n \tfor(j=0;j<c;j++) {\n \t\tarray[i][j]=scan.nextInt();\n \t}\n }\n for(i=0;i<=r;i++) {\n \tcsum=0;\n \tif(i<r) {\n \t\tfor(j=0;j<=c;j++) {\n \t\t\tif(j<c) {\n \t\t\t\tSystem.out.print(array[i][j] + \" \");\n \t\t\t\tcsum+=array[i][j];\n \t\t\t\trsum[j]+=array[i][j];\n \t\t\t}\n \t\t\telse {\n \t\t\t\tSystem.out.println(csum);\n \t\t\t\trsum[j]+=csum;\n \t\t\t}\n \t\t}\n \t}\n \telse {\n \t\tfor(j=0;j<=c;j++) {\n \t\t\tif(j<c) {\n \t\t\t\tSystem.out.print(rsum[j] + \" \");\n \t\t\t}\n \t\t\telse {\n \t\t\t\tSystem.out.println(rsum[j]);\n \t\t\t}\n \t\t}\n \t}\n }\n }\n}",
"public class Main {\n\n public static void main(String[] args) {\n Scanner scan=new Scanner(System.in);\n int r,c,i,j,csum;\n r=scan.nextInt();\n c=scan.nextInt();\n int array[][]=new int[r][c],rsum[]=new int[c+1];\n for(i=0;i<c;i++) {\n \trsum[i]=0;\n }\n for(i=0;i<r;i++) {\n \tfor(j=0;j<c;j++) {\n \t\tarray[i][j]=scan.nextInt();\n \t}\n }\n for(i=0;i<=r;i++) {\n \tcsum=0;\n \tif(i<r) {\n \t\tfor(j=0;j<=c;j++) {\n \t\t\tif(j<c) {\n \t\t\t\tSystem.out.print(array[i][j] + \" \");\n \t\t\t\tcsum+=array[i][j];\n \t\t\t\trsum[j]+=array[i][j];\n \t\t\t}\n \t\t\telse {\n \t\t\t\tSystem.out.println(csum);\n \t\t\t\trsum[j]+=csum;\n \t\t\t}\n \t\t}\n \t}\n \telse {\n \t\tfor(j=0;j<=c;j++) {\n \t\t\tif(j<c) {\n \t\t\t\tSystem.out.print(rsum[j] + \" \");\n \t\t\t}\n \t\t\telse {\n \t\t\t\tSystem.out.println(rsum[j]);\n \t\t\t}\n \t\t}\n \t}\n }\n }\n}",
"Main"
] | import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner scan=new Scanner(System.in);
int r,c,i,j,csum;
r=scan.nextInt();
c=scan.nextInt();
int array[][]=new int[r][c],rsum[]=new int[c+1];
for(i=0;i<c;i++) {
rsum[i]=0;
}
for(i=0;i<r;i++) {
for(j=0;j<c;j++) {
array[i][j]=scan.nextInt();
}
}
for(i=0;i<=r;i++) {
csum=0;
if(i<r) {
for(j=0;j<=c;j++) {
if(j<c) {
System.out.print(array[i][j] + " ");
csum+=array[i][j];
rsum[j]+=array[i][j];
}
else {
System.out.println(csum);
rsum[j]+=csum;
}
}
}
else {
for(j=0;j<=c;j++) {
if(j<c) {
System.out.print(rsum[j] + " ");
}
else {
System.out.println(rsum[j]);
}
}
}
}
}
}
|
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
38,
5,
13,
30,
4,
18,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
17,
41,
13,
4,
18,
13,
18,
13,
17,
41,
13,
4,
18,
13,
18,
13,
17,
41,
13,
20,
13,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
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,
41,
13,
17,
41,
13,
20,
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,
4,
18,
18,
13,
13,
2,
18,
18,
13,
13,
13,
17,
0,
13,
18,
18,
13,
13,
13,
0,
18,
13,
13,
18,
18,
13,
13,
13,
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,
4,
18,
18,
13,
13,
2,
18,
13,
13,
17,
4,
18,
18,
13,
13,
13,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
217,
11
],
[
217,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
16,
17
],
[
16,
18
],
[
18,
19
],
[
19,
20
],
[
20,
21
],
[
15,
22
],
[
22,
23
],
[
23,
24
],
[
23,
25
],
[
22,
26
],
[
26,
27
],
[
26,
28
],
[
28,
29
],
[
29,
30
],
[
22,
31
],
[
31,
32
],
[
31,
33
],
[
33,
34
],
[
34,
35
],
[
33,
36
],
[
22,
37
],
[
37,
38
],
[
37,
39
],
[
39,
40
],
[
40,
41
],
[
39,
42
],
[
42,
43
],
[
42,
44
],
[
22,
45
],
[
45,
46
],
[
45,
47
],
[
47,
48
],
[
48,
49
],
[
47,
50
],
[
50,
51
],
[
50,
52
],
[
22,
53
],
[
53,
54
],
[
53,
55
],
[
22,
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
],
[
70,
76
],
[
76,
77
],
[
76,
78
],
[
78,
79
],
[
79,
80
],
[
78,
81
],
[
70,
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
],
[
101,
104
],
[
104,
105
],
[
104,
106
],
[
22,
107
],
[
107,
108
],
[
107,
109
],
[
22,
110
],
[
110,
111
],
[
110,
112
],
[
113,
114
],
[
113,
115
],
[
22,
116
],
[
116,
117
],
[
116,
118
],
[
22,
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
],
[
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
],
[
151,
152
],
[
152,
153
],
[
152,
154
],
[
151,
155
],
[
150,
156
],
[
144,
157
],
[
157,
158
],
[
157,
159
],
[
159,
160
],
[
160,
161
],
[
160,
162
],
[
159,
163
],
[
144,
164
],
[
164,
165
],
[
165,
166
],
[
165,
167
],
[
164,
168
],
[
168,
169
],
[
169,
170
],
[
169,
171
],
[
168,
172
],
[
131,
173
],
[
173,
174
],
[
174,
175
],
[
175,
176
],
[
175,
177
],
[
173,
178
],
[
131,
179
],
[
179,
180
],
[
179,
181
],
[
131,
182
],
[
182,
183
],
[
182,
184
],
[
22,
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
],
[
22,
208
],
[
208,
209
],
[
209,
210
],
[
210,
211
],
[
210,
212
],
[
208,
213
],
[
12,
214
],
[
214,
215
],
[
0,
216
],
[
216,
217
],
[
216,
218
]
] | [
"import java.io.BufferedReader;\nimport java.io.IOException;\nimport java.io.InputStreamReader;\n\npublic class Main {\n\t\n\tpublic static void main(String[] args) {\n\t\ttry {\n\t\t\tBufferedReader reader = new BufferedReader(new InputStreamReader(System.in));\n\t\t\tString input = reader.readLine();\n\t\t\tString[] array = input.split(\" \");\n\t\t\tint r = Integer.parseInt(array[0]);\n\t\t\tint c = Integer.parseInt(array[1]);\n\t\t\t\n\t\t\tint[][] cell = new int[r][c];\n\t\t\tfor (int i = 0; i < r; i++) {\n\t\t\t\tinput = reader.readLine();\n\t\t\t\tarray = input.split(\" \");\n\t\t\t\tfor (int j = 0; j < c; j++) {\n\t\t\t\t\tcell[i][j] = Integer.parseInt(array[j]);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tint sumRow = 0;\n\t\t\tint sumCol[] = new int[c + 1];\n\t\t\tint sum = 0;\n\t\t\tfor (int k = 0; k < r; k++) {\n\t\t\t\tfor (int l = 0; l < c; l++) {\n\t\t\t\t\tSystem.out.print(cell[k][l] + \" \"); \n\t\t\t\t\tsumRow += cell[k][l];\n\t\t\t\t\tsumCol[l] += cell[k][l];\n\t\t\t\t}\n\t\t\t\tSystem.out.println(sumRow);\n\t\t\t\tsum += sumRow;\n\t\t\t\tsumRow = 0;\n\t\t\t}\n\t\t\t\n\t\t\tfor (int m = 0; m < c; m++) {\n\t\t\t\tSystem.out.print(sumCol[m] + \" \");\n\t\t\t}\n\t\t\tSystem.out.println(sum);\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}\n\n}",
"import java.io.BufferedReader;",
"BufferedReader",
"java.io",
"import java.io.IOException;",
"IOException",
"java.io",
"import java.io.InputStreamReader;",
"InputStreamReader",
"java.io",
"public class Main {\n\t\n\tpublic static void main(String[] args) {\n\t\ttry {\n\t\t\tBufferedReader reader = new BufferedReader(new InputStreamReader(System.in));\n\t\t\tString input = reader.readLine();\n\t\t\tString[] array = input.split(\" \");\n\t\t\tint r = Integer.parseInt(array[0]);\n\t\t\tint c = Integer.parseInt(array[1]);\n\t\t\t\n\t\t\tint[][] cell = new int[r][c];\n\t\t\tfor (int i = 0; i < r; i++) {\n\t\t\t\tinput = reader.readLine();\n\t\t\t\tarray = input.split(\" \");\n\t\t\t\tfor (int j = 0; j < c; j++) {\n\t\t\t\t\tcell[i][j] = Integer.parseInt(array[j]);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tint sumRow = 0;\n\t\t\tint sumCol[] = new int[c + 1];\n\t\t\tint sum = 0;\n\t\t\tfor (int k = 0; k < r; k++) {\n\t\t\t\tfor (int l = 0; l < c; l++) {\n\t\t\t\t\tSystem.out.print(cell[k][l] + \" \"); \n\t\t\t\t\tsumRow += cell[k][l];\n\t\t\t\t\tsumCol[l] += cell[k][l];\n\t\t\t\t}\n\t\t\t\tSystem.out.println(sumRow);\n\t\t\t\tsum += sumRow;\n\t\t\t\tsumRow = 0;\n\t\t\t}\n\t\t\t\n\t\t\tfor (int m = 0; m < c; m++) {\n\t\t\t\tSystem.out.print(sumCol[m] + \" \");\n\t\t\t}\n\t\t\tSystem.out.println(sum);\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}\n\n}",
"Main",
"public static void main(String[] args) {\n\t\ttry {\n\t\t\tBufferedReader reader = new BufferedReader(new InputStreamReader(System.in));\n\t\t\tString input = reader.readLine();\n\t\t\tString[] array = input.split(\" \");\n\t\t\tint r = Integer.parseInt(array[0]);\n\t\t\tint c = Integer.parseInt(array[1]);\n\t\t\t\n\t\t\tint[][] cell = new int[r][c];\n\t\t\tfor (int i = 0; i < r; i++) {\n\t\t\t\tinput = reader.readLine();\n\t\t\t\tarray = input.split(\" \");\n\t\t\t\tfor (int j = 0; j < c; j++) {\n\t\t\t\t\tcell[i][j] = Integer.parseInt(array[j]);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tint sumRow = 0;\n\t\t\tint sumCol[] = new int[c + 1];\n\t\t\tint sum = 0;\n\t\t\tfor (int k = 0; k < r; k++) {\n\t\t\t\tfor (int l = 0; l < c; l++) {\n\t\t\t\t\tSystem.out.print(cell[k][l] + \" \"); \n\t\t\t\t\tsumRow += cell[k][l];\n\t\t\t\t\tsumCol[l] += cell[k][l];\n\t\t\t\t}\n\t\t\t\tSystem.out.println(sumRow);\n\t\t\t\tsum += sumRow;\n\t\t\t\tsumRow = 0;\n\t\t\t}\n\t\t\t\n\t\t\tfor (int m = 0; m < c; m++) {\n\t\t\t\tSystem.out.print(sumCol[m] + \" \");\n\t\t\t}\n\t\t\tSystem.out.println(sum);\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}",
"main",
"{\n\t\ttry {\n\t\t\tBufferedReader reader = new BufferedReader(new InputStreamReader(System.in));\n\t\t\tString input = reader.readLine();\n\t\t\tString[] array = input.split(\" \");\n\t\t\tint r = Integer.parseInt(array[0]);\n\t\t\tint c = Integer.parseInt(array[1]);\n\t\t\t\n\t\t\tint[][] cell = new int[r][c];\n\t\t\tfor (int i = 0; i < r; i++) {\n\t\t\t\tinput = reader.readLine();\n\t\t\t\tarray = input.split(\" \");\n\t\t\t\tfor (int j = 0; j < c; j++) {\n\t\t\t\t\tcell[i][j] = Integer.parseInt(array[j]);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tint sumRow = 0;\n\t\t\tint sumCol[] = new int[c + 1];\n\t\t\tint sum = 0;\n\t\t\tfor (int k = 0; k < r; k++) {\n\t\t\t\tfor (int l = 0; l < c; l++) {\n\t\t\t\t\tSystem.out.print(cell[k][l] + \" \"); \n\t\t\t\t\tsumRow += cell[k][l];\n\t\t\t\t\tsumCol[l] += cell[k][l];\n\t\t\t\t}\n\t\t\t\tSystem.out.println(sumRow);\n\t\t\t\tsum += sumRow;\n\t\t\t\tsumRow = 0;\n\t\t\t}\n\t\t\t\n\t\t\tfor (int m = 0; m < c; m++) {\n\t\t\t\tSystem.out.print(sumCol[m] + \" \");\n\t\t\t}\n\t\t\tSystem.out.println(sum);\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}",
"try {\n\t\t\tBufferedReader reader = new BufferedReader(new InputStreamReader(System.in));\n\t\t\tString input = reader.readLine();\n\t\t\tString[] array = input.split(\" \");\n\t\t\tint r = Integer.parseInt(array[0]);\n\t\t\tint c = Integer.parseInt(array[1]);\n\t\t\t\n\t\t\tint[][] cell = new int[r][c];\n\t\t\tfor (int i = 0; i < r; i++) {\n\t\t\t\tinput = reader.readLine();\n\t\t\t\tarray = input.split(\" \");\n\t\t\t\tfor (int j = 0; j < c; j++) {\n\t\t\t\t\tcell[i][j] = Integer.parseInt(array[j]);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tint sumRow = 0;\n\t\t\tint sumCol[] = new int[c + 1];\n\t\t\tint sum = 0;\n\t\t\tfor (int k = 0; k < r; k++) {\n\t\t\t\tfor (int l = 0; l < c; l++) {\n\t\t\t\t\tSystem.out.print(cell[k][l] + \" \"); \n\t\t\t\t\tsumRow += cell[k][l];\n\t\t\t\t\tsumCol[l] += cell[k][l];\n\t\t\t\t}\n\t\t\t\tSystem.out.println(sumRow);\n\t\t\t\tsum += sumRow;\n\t\t\t\tsumRow = 0;\n\t\t\t}\n\t\t\t\n\t\t\tfor (int m = 0; m < c; m++) {\n\t\t\t\tSystem.out.print(sumCol[m] + \" \");\n\t\t\t}\n\t\t\tSystem.out.println(sum);\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}",
"catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}",
"IOException e",
"{\n\t\t\te.printStackTrace();\n\t\t}",
"e.printStackTrace()",
"e.printStackTrace",
"e",
"{\n\t\t\tBufferedReader reader = new BufferedReader(new InputStreamReader(System.in));\n\t\t\tString input = reader.readLine();\n\t\t\tString[] array = input.split(\" \");\n\t\t\tint r = Integer.parseInt(array[0]);\n\t\t\tint c = Integer.parseInt(array[1]);\n\t\t\t\n\t\t\tint[][] cell = new int[r][c];\n\t\t\tfor (int i = 0; i < r; i++) {\n\t\t\t\tinput = reader.readLine();\n\t\t\t\tarray = input.split(\" \");\n\t\t\t\tfor (int j = 0; j < c; j++) {\n\t\t\t\t\tcell[i][j] = Integer.parseInt(array[j]);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tint sumRow = 0;\n\t\t\tint sumCol[] = new int[c + 1];\n\t\t\tint sum = 0;\n\t\t\tfor (int k = 0; k < r; k++) {\n\t\t\t\tfor (int l = 0; l < c; l++) {\n\t\t\t\t\tSystem.out.print(cell[k][l] + \" \"); \n\t\t\t\t\tsumRow += cell[k][l];\n\t\t\t\t\tsumCol[l] += cell[k][l];\n\t\t\t\t}\n\t\t\t\tSystem.out.println(sumRow);\n\t\t\t\tsum += sumRow;\n\t\t\t\tsumRow = 0;\n\t\t\t}\n\t\t\t\n\t\t\tfor (int m = 0; m < c; m++) {\n\t\t\t\tSystem.out.print(sumCol[m] + \" \");\n\t\t\t}\n\t\t\tSystem.out.println(sum);\n\t\t}",
"BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));",
"reader",
"new BufferedReader(new InputStreamReader(System.in))",
"String input = reader.readLine();",
"input",
"reader.readLine()",
"reader.readLine",
"reader",
"String[] array = input.split(\" \");",
"array",
"input.split(\" \")",
"input.split",
"input",
"\" \"",
"int r = Integer.parseInt(array[0]);",
"r",
"Integer.parseInt(array[0])",
"Integer.parseInt",
"Integer",
"array[0]",
"array",
"0",
"int c = Integer.parseInt(array[1]);",
"c",
"Integer.parseInt(array[1])",
"Integer.parseInt",
"Integer",
"array[1]",
"array",
"1",
"int[][] cell = new int[r][c];",
"cell",
"new int[r][c]",
"r",
"c",
"for (int i = 0; i < r; i++) {\n\t\t\t\tinput = reader.readLine();\n\t\t\t\tarray = input.split(\" \");\n\t\t\t\tfor (int j = 0; j < c; j++) {\n\t\t\t\t\tcell[i][j] = Integer.parseInt(array[j]);\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\tinput = reader.readLine();\n\t\t\t\tarray = input.split(\" \");\n\t\t\t\tfor (int j = 0; j < c; j++) {\n\t\t\t\t\tcell[i][j] = Integer.parseInt(array[j]);\n\t\t\t\t}\n\t\t\t}",
"{\n\t\t\t\tinput = reader.readLine();\n\t\t\t\tarray = input.split(\" \");\n\t\t\t\tfor (int j = 0; j < c; j++) {\n\t\t\t\t\tcell[i][j] = Integer.parseInt(array[j]);\n\t\t\t\t}\n\t\t\t}",
"input = reader.readLine()",
"input",
"reader.readLine()",
"reader.readLine",
"reader",
"array = input.split(\" \")",
"array",
"input.split(\" \")",
"input.split",
"input",
"\" \"",
"for (int j = 0; j < c; j++) {\n\t\t\t\t\tcell[i][j] = Integer.parseInt(array[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\tcell[i][j] = Integer.parseInt(array[j]);\n\t\t\t\t}",
"{\n\t\t\t\t\tcell[i][j] = Integer.parseInt(array[j]);\n\t\t\t\t}",
"cell[i][j] = Integer.parseInt(array[j])",
"cell[i][j]",
"cell[i]",
"cell",
"i",
"j",
"Integer.parseInt(array[j])",
"Integer.parseInt",
"Integer",
"array[j]",
"array",
"j",
"int sumRow = 0;",
"sumRow",
"0",
"int sumCol[] = new int[c + 1];",
"sumCol",
"new int[c + 1]",
"c + 1",
"c",
"1",
"int sum = 0;",
"sum",
"0",
"for (int k = 0; k < r; k++) {\n\t\t\t\tfor (int l = 0; l < c; l++) {\n\t\t\t\t\tSystem.out.print(cell[k][l] + \" \"); \n\t\t\t\t\tsumRow += cell[k][l];\n\t\t\t\t\tsumCol[l] += cell[k][l];\n\t\t\t\t}\n\t\t\t\tSystem.out.println(sumRow);\n\t\t\t\tsum += sumRow;\n\t\t\t\tsumRow = 0;\n\t\t\t}",
"int k = 0;",
"int k = 0;",
"k",
"0",
"k < r",
"k",
"r",
"k++",
"k++",
"k",
"{\n\t\t\t\tfor (int l = 0; l < c; l++) {\n\t\t\t\t\tSystem.out.print(cell[k][l] + \" \"); \n\t\t\t\t\tsumRow += cell[k][l];\n\t\t\t\t\tsumCol[l] += cell[k][l];\n\t\t\t\t}\n\t\t\t\tSystem.out.println(sumRow);\n\t\t\t\tsum += sumRow;\n\t\t\t\tsumRow = 0;\n\t\t\t}",
"{\n\t\t\t\tfor (int l = 0; l < c; l++) {\n\t\t\t\t\tSystem.out.print(cell[k][l] + \" \"); \n\t\t\t\t\tsumRow += cell[k][l];\n\t\t\t\t\tsumCol[l] += cell[k][l];\n\t\t\t\t}\n\t\t\t\tSystem.out.println(sumRow);\n\t\t\t\tsum += sumRow;\n\t\t\t\tsumRow = 0;\n\t\t\t}",
"for (int l = 0; l < c; l++) {\n\t\t\t\t\tSystem.out.print(cell[k][l] + \" \"); \n\t\t\t\t\tsumRow += cell[k][l];\n\t\t\t\t\tsumCol[l] += cell[k][l];\n\t\t\t\t}",
"int l = 0;",
"int l = 0;",
"l",
"0",
"l < c",
"l",
"c",
"l++",
"l++",
"l",
"{\n\t\t\t\t\tSystem.out.print(cell[k][l] + \" \"); \n\t\t\t\t\tsumRow += cell[k][l];\n\t\t\t\t\tsumCol[l] += cell[k][l];\n\t\t\t\t}",
"{\n\t\t\t\t\tSystem.out.print(cell[k][l] + \" \"); \n\t\t\t\t\tsumRow += cell[k][l];\n\t\t\t\t\tsumCol[l] += cell[k][l];\n\t\t\t\t}",
"System.out.print(cell[k][l] + \" \")",
"System.out.print",
"System.out",
"System",
"System.out",
"cell[k][l] + \" \"",
"cell[k][l]",
"cell[k]",
"cell",
"k",
"l",
"\" \"",
"sumRow += cell[k][l]",
"sumRow",
"cell[k][l]",
"cell[k]",
"cell",
"k",
"l",
"sumCol[l] += cell[k][l]",
"sumCol[l]",
"sumCol",
"l",
"cell[k][l]",
"cell[k]",
"cell",
"k",
"l",
"System.out.println(sumRow)",
"System.out.println",
"System.out",
"System",
"System.out",
"sumRow",
"sum += sumRow",
"sum",
"sumRow",
"sumRow = 0",
"sumRow",
"0",
"for (int m = 0; m < c; m++) {\n\t\t\t\tSystem.out.print(sumCol[m] + \" \");\n\t\t\t}",
"int m = 0;",
"int m = 0;",
"m",
"0",
"m < c",
"m",
"c",
"m++",
"m++",
"m",
"{\n\t\t\t\tSystem.out.print(sumCol[m] + \" \");\n\t\t\t}",
"{\n\t\t\t\tSystem.out.print(sumCol[m] + \" \");\n\t\t\t}",
"System.out.print(sumCol[m] + \" \")",
"System.out.print",
"System.out",
"System",
"System.out",
"sumCol[m] + \" \"",
"sumCol[m]",
"sumCol",
"m",
"\" \"",
"System.out.println(sum)",
"System.out.println",
"System.out",
"System",
"System.out",
"sum",
"String[] args",
"args",
"public class Main {\n\t\n\tpublic static void main(String[] args) {\n\t\ttry {\n\t\t\tBufferedReader reader = new BufferedReader(new InputStreamReader(System.in));\n\t\t\tString input = reader.readLine();\n\t\t\tString[] array = input.split(\" \");\n\t\t\tint r = Integer.parseInt(array[0]);\n\t\t\tint c = Integer.parseInt(array[1]);\n\t\t\t\n\t\t\tint[][] cell = new int[r][c];\n\t\t\tfor (int i = 0; i < r; i++) {\n\t\t\t\tinput = reader.readLine();\n\t\t\t\tarray = input.split(\" \");\n\t\t\t\tfor (int j = 0; j < c; j++) {\n\t\t\t\t\tcell[i][j] = Integer.parseInt(array[j]);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tint sumRow = 0;\n\t\t\tint sumCol[] = new int[c + 1];\n\t\t\tint sum = 0;\n\t\t\tfor (int k = 0; k < r; k++) {\n\t\t\t\tfor (int l = 0; l < c; l++) {\n\t\t\t\t\tSystem.out.print(cell[k][l] + \" \"); \n\t\t\t\t\tsumRow += cell[k][l];\n\t\t\t\t\tsumCol[l] += cell[k][l];\n\t\t\t\t}\n\t\t\t\tSystem.out.println(sumRow);\n\t\t\t\tsum += sumRow;\n\t\t\t\tsumRow = 0;\n\t\t\t}\n\t\t\t\n\t\t\tfor (int m = 0; m < c; m++) {\n\t\t\t\tSystem.out.print(sumCol[m] + \" \");\n\t\t\t}\n\t\t\tSystem.out.println(sum);\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}\n\n}",
"public class Main {\n\t\n\tpublic static void main(String[] args) {\n\t\ttry {\n\t\t\tBufferedReader reader = new BufferedReader(new InputStreamReader(System.in));\n\t\t\tString input = reader.readLine();\n\t\t\tString[] array = input.split(\" \");\n\t\t\tint r = Integer.parseInt(array[0]);\n\t\t\tint c = Integer.parseInt(array[1]);\n\t\t\t\n\t\t\tint[][] cell = new int[r][c];\n\t\t\tfor (int i = 0; i < r; i++) {\n\t\t\t\tinput = reader.readLine();\n\t\t\t\tarray = input.split(\" \");\n\t\t\t\tfor (int j = 0; j < c; j++) {\n\t\t\t\t\tcell[i][j] = Integer.parseInt(array[j]);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tint sumRow = 0;\n\t\t\tint sumCol[] = new int[c + 1];\n\t\t\tint sum = 0;\n\t\t\tfor (int k = 0; k < r; k++) {\n\t\t\t\tfor (int l = 0; l < c; l++) {\n\t\t\t\t\tSystem.out.print(cell[k][l] + \" \"); \n\t\t\t\t\tsumRow += cell[k][l];\n\t\t\t\t\tsumCol[l] += cell[k][l];\n\t\t\t\t}\n\t\t\t\tSystem.out.println(sumRow);\n\t\t\t\tsum += sumRow;\n\t\t\t\tsumRow = 0;\n\t\t\t}\n\t\t\t\n\t\t\tfor (int m = 0; m < c; m++) {\n\t\t\t\tSystem.out.print(sumCol[m] + \" \");\n\t\t\t}\n\t\t\tSystem.out.println(sum);\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}\n\n}",
"Main"
] | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class Main {
public static void main(String[] args) {
try {
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
String input = reader.readLine();
String[] array = input.split(" ");
int r = Integer.parseInt(array[0]);
int c = Integer.parseInt(array[1]);
int[][] cell = new int[r][c];
for (int i = 0; i < r; i++) {
input = reader.readLine();
array = input.split(" ");
for (int j = 0; j < c; j++) {
cell[i][j] = Integer.parseInt(array[j]);
}
}
int sumRow = 0;
int sumCol[] = new int[c + 1];
int sum = 0;
for (int k = 0; k < r; k++) {
for (int l = 0; l < c; l++) {
System.out.print(cell[k][l] + " ");
sumRow += cell[k][l];
sumCol[l] += cell[k][l];
}
System.out.println(sumRow);
sum += sumRow;
sumRow = 0;
}
for (int m = 0; m < c; m++) {
System.out.print(sumCol[m] + " ");
}
System.out.println(sum);
} catch (IOException e) {
e.printStackTrace();
}
}
} |
[
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,
20,
2,
13,
17,
2,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
41,
13,
4,
18,
13,
4,
18,
13,
0,
18,
18,
13,
13,
13,
13,
0,
18,
18,
13,
13,
13,
13,
0,
18,
18,
13,
13,
13,
13,
0,
18,
18,
13,
13,
13,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
4,
18,
13,
2,
18,
18,
13,
13,
13,
17,
4,
18,
13,
18,
18,
13,
13,
13,
4,
18,
13,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
148,
8
],
[
148,
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
],
[
31,
32
],
[
31,
33
],
[
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
],
[
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
],
[
65,
68
],
[
68,
69
],
[
69,
70
],
[
62,
71
],
[
71,
72
],
[
72,
73
],
[
73,
74
],
[
73,
75
],
[
72,
76
],
[
71,
77
],
[
62,
78
],
[
78,
79
],
[
79,
80
],
[
80,
81
],
[
80,
82
],
[
79,
83
],
[
78,
84
],
[
62,
85
],
[
85,
86
],
[
86,
87
],
[
87,
88
],
[
87,
89
],
[
86,
90
],
[
85,
91
],
[
62,
92
],
[
92,
93
],
[
93,
94
],
[
94,
95
],
[
94,
96
],
[
93,
97
],
[
92,
98
],
[
11,
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
],
[
123,
124
],
[
124,
125
],
[
125,
126
],
[
124,
127
],
[
127,
128
],
[
128,
129
],
[
129,
130
],
[
129,
131
],
[
128,
132
],
[
127,
133
],
[
111,
134
],
[
134,
135
],
[
135,
136
],
[
134,
137
],
[
137,
138
],
[
138,
139
],
[
138,
140
],
[
137,
141
],
[
11,
142
],
[
142,
143
],
[
143,
144
],
[
9,
145
],
[
145,
146
],
[
0,
147
],
[
147,
148
],
[
147,
149
]
] | [
"import java.util.*;\nimport java.io.*;\n\npublic class Main {\n\n\tpublic static void main(String[] args) {\n\t\tScanner in=new Scanner(System.in);\n\t\tPrintWriter out=new PrintWriter(System.out);\n\t\tint r=in.nextInt(),c=in.nextInt(),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\tint n=Integer.parseInt(in.next());\n\t\t\t\tM[i][j]=n; M[i][c]+=n; M[r][j]+=n; M[r][c]+=n;\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++)out.print(M[i][j]+\" \");\n\t\t\tout.println(M[i][c]);\n\t\t}\n\t\tout.flush();\n\t}\n\n}\n",
"import java.util.*;",
"util.*",
"java",
"import java.io.*;",
"io.*",
"java",
"public class Main {\n\n\tpublic static void main(String[] args) {\n\t\tScanner in=new Scanner(System.in);\n\t\tPrintWriter out=new PrintWriter(System.out);\n\t\tint r=in.nextInt(),c=in.nextInt(),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\tint n=Integer.parseInt(in.next());\n\t\t\t\tM[i][j]=n; M[i][c]+=n; M[r][j]+=n; M[r][c]+=n;\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++)out.print(M[i][j]+\" \");\n\t\t\tout.println(M[i][c]);\n\t\t}\n\t\tout.flush();\n\t}\n\n}",
"Main",
"public static void main(String[] args) {\n\t\tScanner in=new Scanner(System.in);\n\t\tPrintWriter out=new PrintWriter(System.out);\n\t\tint r=in.nextInt(),c=in.nextInt(),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\tint n=Integer.parseInt(in.next());\n\t\t\t\tM[i][j]=n; M[i][c]+=n; M[r][j]+=n; M[r][c]+=n;\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++)out.print(M[i][j]+\" \");\n\t\t\tout.println(M[i][c]);\n\t\t}\n\t\tout.flush();\n\t}",
"main",
"{\n\t\tScanner in=new Scanner(System.in);\n\t\tPrintWriter out=new PrintWriter(System.out);\n\t\tint r=in.nextInt(),c=in.nextInt(),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\tint n=Integer.parseInt(in.next());\n\t\t\t\tM[i][j]=n; M[i][c]+=n; M[r][j]+=n; M[r][c]+=n;\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++)out.print(M[i][j]+\" \");\n\t\t\tout.println(M[i][c]);\n\t\t}\n\t\tout.flush();\n\t}",
"Scanner in=new Scanner(System.in);",
"in",
"new Scanner(System.in)",
"PrintWriter out=new PrintWriter(System.out);",
"out",
"new PrintWriter(System.out)",
"int r=in.nextInt()",
"r",
"in.nextInt()",
"in.nextInt",
"in",
"c=in.nextInt()",
"c",
"in.nextInt()",
"in.nextInt",
"in",
"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\tint n=Integer.parseInt(in.next());\n\t\t\t\tM[i][j]=n; M[i][c]+=n; M[r][j]+=n; M[r][c]+=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=Integer.parseInt(in.next());\n\t\t\t\tM[i][j]=n; M[i][c]+=n; M[r][j]+=n; M[r][c]+=n;\n\t\t\t}\n\t\t}",
"{\n\t\t\tfor(int j=0;j<c;j++) {\n\t\t\t\tint n=Integer.parseInt(in.next());\n\t\t\t\tM[i][j]=n; M[i][c]+=n; M[r][j]+=n; M[r][c]+=n;\n\t\t\t}\n\t\t}",
"for(int j=0;j<c;j++) {\n\t\t\t\tint n=Integer.parseInt(in.next());\n\t\t\t\tM[i][j]=n; M[i][c]+=n; M[r][j]+=n; M[r][c]+=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=Integer.parseInt(in.next());\n\t\t\t\tM[i][j]=n; M[i][c]+=n; M[r][j]+=n; M[r][c]+=n;\n\t\t\t}",
"{\n\t\t\t\tint n=Integer.parseInt(in.next());\n\t\t\t\tM[i][j]=n; M[i][c]+=n; M[r][j]+=n; M[r][c]+=n;\n\t\t\t}",
"int n=Integer.parseInt(in.next());",
"n",
"Integer.parseInt(in.next())",
"Integer.parseInt",
"Integer",
"in.next()",
"in.next",
"in",
"M[i][j]=n",
"M[i][j]",
"M[i]",
"M",
"i",
"j",
"n",
"M[i][c]+=n",
"M[i][c]",
"M[i]",
"M",
"i",
"c",
"n",
"M[r][j]+=n",
"M[r][j]",
"M[r]",
"M",
"r",
"j",
"n",
"M[r][c]+=n",
"M[r][c]",
"M[r]",
"M",
"r",
"c",
"n",
"for(int i=0;i<=r;i++) {\n\t\t\tfor(int j=0;j<c;j++)out.print(M[i][j]+\" \");\n\t\t\tout.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++)out.print(M[i][j]+\" \");\n\t\t\tout.println(M[i][c]);\n\t\t}",
"{\n\t\t\tfor(int j=0;j<c;j++)out.print(M[i][j]+\" \");\n\t\t\tout.println(M[i][c]);\n\t\t}",
"for(int j=0;j<c;j++)out.print(M[i][j]+\" \");",
"int j=0;",
"int j=0;",
"j",
"0",
"j<c",
"j",
"c",
"j++",
"j++",
"j",
"out.print(M[i][j]+\" \");",
"out.print(M[i][j]+\" \")",
"out.print",
"out",
"M[i][j]+\" \"",
"M[i][j]",
"M[i]",
"M",
"i",
"j",
"\" \"",
"out.println(M[i][c])",
"out.println",
"out",
"M[i][c]",
"M[i]",
"M",
"i",
"c",
"out.flush()",
"out.flush",
"out",
"String[] args",
"args",
"public class Main {\n\n\tpublic static void main(String[] args) {\n\t\tScanner in=new Scanner(System.in);\n\t\tPrintWriter out=new PrintWriter(System.out);\n\t\tint r=in.nextInt(),c=in.nextInt(),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\tint n=Integer.parseInt(in.next());\n\t\t\t\tM[i][j]=n; M[i][c]+=n; M[r][j]+=n; M[r][c]+=n;\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++)out.print(M[i][j]+\" \");\n\t\t\tout.println(M[i][c]);\n\t\t}\n\t\tout.flush();\n\t}\n\n}",
"public class Main {\n\n\tpublic static void main(String[] args) {\n\t\tScanner in=new Scanner(System.in);\n\t\tPrintWriter out=new PrintWriter(System.out);\n\t\tint r=in.nextInt(),c=in.nextInt(),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\tint n=Integer.parseInt(in.next());\n\t\t\t\tM[i][j]=n; M[i][c]+=n; M[r][j]+=n; M[r][c]+=n;\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++)out.print(M[i][j]+\" \");\n\t\t\tout.println(M[i][c]);\n\t\t}\n\t\tout.flush();\n\t}\n\n}",
"Main"
] | import java.util.*;
import java.io.*;
public class Main {
public static void main(String[] args) {
Scanner in=new Scanner(System.in);
PrintWriter out=new PrintWriter(System.out);
int r=in.nextInt(),c=in.nextInt(),M[][]=new int[r+1][c+1];
for(int i=0;i<r;i++) {
for(int j=0;j<c;j++) {
int n=Integer.parseInt(in.next());
M[i][j]=n; M[i][c]+=n; M[r][j]+=n; M[r][c]+=n;
}
}
for(int i=0;i<=r;i++) {
for(int j=0;j<c;j++)out.print(M[i][j]+" ");
out.println(M[i][c]);
}
out.flush();
}
}
|
[
7,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
17,
41,
13,
4,
18,
13,
18,
13,
17,
41,
13,
4,
18,
13,
18,
13,
17,
41,
13,
20,
2,
13,
17,
2,
13,
17,
41,
13,
17,
42,
2,
0,
13,
4,
18,
13,
17,
30,
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,
18,
18,
13,
13,
13,
13,
0,
18,
18,
13,
13,
13,
13,
0,
18,
18,
13,
13,
13,
13,
40,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
14,
2,
13,
17,
4,
18,
18,
13,
13,
17,
4,
18,
18,
13,
13,
18,
18,
13,
13,
13,
4,
18,
18,
13,
13,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
174,
8
],
[
174,
9
],
[
9,
10
],
[
9,
11
],
[
11,
12
],
[
12,
13
],
[
12,
14
],
[
11,
15
],
[
15,
16
],
[
15,
17
],
[
17,
18
],
[
18,
19
],
[
11,
20
],
[
20,
21
],
[
20,
22
],
[
22,
23
],
[
23,
24
],
[
22,
25
],
[
11,
26
],
[
26,
27
],
[
26,
28
],
[
28,
29
],
[
29,
30
],
[
28,
31
],
[
31,
32
],
[
31,
33
],
[
11,
34
],
[
34,
35
],
[
34,
36
],
[
36,
37
],
[
37,
38
],
[
36,
39
],
[
39,
40
],
[
39,
41
],
[
11,
42
],
[
42,
43
],
[
42,
44
],
[
45,
46
],
[
45,
47
],
[
48,
49
],
[
48,
50
],
[
11,
51
],
[
51,
52
],
[
51,
53
],
[
11,
54
],
[
54,
55
],
[
55,
56
],
[
56,
57
],
[
56,
58
],
[
58,
59
],
[
59,
60
],
[
55,
61
],
[
54,
62
],
[
62,
63
],
[
63,
64
],
[
63,
65
],
[
65,
66
],
[
66,
67
],
[
65,
68
],
[
62,
69
],
[
69,
70
],
[
70,
71
],
[
71,
72
],
[
71,
73
],
[
69,
74
],
[
74,
75
],
[
74,
76
],
[
69,
77
],
[
77,
78
],
[
78,
79
],
[
69,
80
],
[
81,
81
],
[
81,
82
],
[
82,
83
],
[
82,
84
],
[
84,
85
],
[
85,
86
],
[
84,
87
],
[
87,
88
],
[
87,
89
],
[
81,
90
],
[
90,
91
],
[
91,
92
],
[
92,
93
],
[
92,
94
],
[
91,
95
],
[
90,
96
],
[
81,
97
],
[
97,
98
],
[
98,
99
],
[
99,
100
],
[
99,
101
],
[
98,
102
],
[
97,
103
],
[
81,
104
],
[
104,
105
],
[
105,
106
],
[
106,
107
],
[
106,
108
],
[
105,
109
],
[
104,
110
],
[
81,
111
],
[
111,
112
],
[
112,
113
],
[
113,
114
],
[
113,
115
],
[
112,
116
],
[
111,
117
],
[
62,
118
],
[
118,
119
],
[
11,
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
],
[
138,
140
],
[
133,
141
],
[
141,
142
],
[
142,
143
],
[
133,
144
],
[
145,
145
],
[
145,
146
],
[
146,
147
],
[
147,
148
],
[
147,
149
],
[
146,
150
],
[
150,
151
],
[
151,
152
],
[
152,
153
],
[
152,
154
],
[
150,
155
],
[
145,
156
],
[
156,
157
],
[
157,
158
],
[
158,
159
],
[
158,
160
],
[
156,
161
],
[
161,
162
],
[
162,
163
],
[
162,
164
],
[
161,
165
],
[
132,
166
],
[
166,
167
],
[
167,
168
],
[
168,
169
],
[
168,
170
],
[
9,
171
],
[
171,
172
],
[
0,
173
],
[
173,
174
],
[
173,
175
]
] | [
"import java.io.BufferedReader;\nimport java.io.InputStreamReader;\n\npublic class Main {\n\tpublic static void main(String[] args) throws Exception {\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\t\tString line = br.readLine();\n\t\tString[] arr = line.split(\" \");\n\t\tint r = Integer.parseInt(arr[0]);\n\t\tint c = Integer.parseInt(arr[1]);\n\n\t\tint[][] spreadsheet = new int[r + 1][c + 1];\n\t\tint row = 0;\n\t\twhile ((line = br.readLine()) != null) {\n\t\t\tString[] cols = line.split(\" \");\n\t\t\tfor (int col = 0; col < c; col++) {\n\t\t\t\tfinal int val = Integer.parseInt(cols[col]);\n\t\t\t\tspreadsheet[row][col] = val;\n\t\t\t\tspreadsheet[row][c] += val;\n\t\t\t\tspreadsheet[r][col] += val;\n\t\t\t\tspreadsheet[r][c] += val;\n\t\t\t}\n\t\t\trow++;\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\tif (j != 0)\n\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\tSystem.out.print(spreadsheet[i][j]);\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}\n\t}\n}",
"import java.io.BufferedReader;",
"BufferedReader",
"java.io",
"import java.io.InputStreamReader;",
"InputStreamReader",
"java.io",
"public class Main {\n\tpublic static void main(String[] args) throws Exception {\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\t\tString line = br.readLine();\n\t\tString[] arr = line.split(\" \");\n\t\tint r = Integer.parseInt(arr[0]);\n\t\tint c = Integer.parseInt(arr[1]);\n\n\t\tint[][] spreadsheet = new int[r + 1][c + 1];\n\t\tint row = 0;\n\t\twhile ((line = br.readLine()) != null) {\n\t\t\tString[] cols = line.split(\" \");\n\t\t\tfor (int col = 0; col < c; col++) {\n\t\t\t\tfinal int val = Integer.parseInt(cols[col]);\n\t\t\t\tspreadsheet[row][col] = val;\n\t\t\t\tspreadsheet[row][c] += val;\n\t\t\t\tspreadsheet[r][col] += val;\n\t\t\t\tspreadsheet[r][c] += val;\n\t\t\t}\n\t\t\trow++;\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\tif (j != 0)\n\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\tSystem.out.print(spreadsheet[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) throws Exception {\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\t\tString line = br.readLine();\n\t\tString[] arr = line.split(\" \");\n\t\tint r = Integer.parseInt(arr[0]);\n\t\tint c = Integer.parseInt(arr[1]);\n\n\t\tint[][] spreadsheet = new int[r + 1][c + 1];\n\t\tint row = 0;\n\t\twhile ((line = br.readLine()) != null) {\n\t\t\tString[] cols = line.split(\" \");\n\t\t\tfor (int col = 0; col < c; col++) {\n\t\t\t\tfinal int val = Integer.parseInt(cols[col]);\n\t\t\t\tspreadsheet[row][col] = val;\n\t\t\t\tspreadsheet[row][c] += val;\n\t\t\t\tspreadsheet[r][col] += val;\n\t\t\t\tspreadsheet[r][c] += val;\n\t\t\t}\n\t\t\trow++;\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\tif (j != 0)\n\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\tSystem.out.print(spreadsheet[i][j]);\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}\n\t}",
"main",
"{\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\t\tString line = br.readLine();\n\t\tString[] arr = line.split(\" \");\n\t\tint r = Integer.parseInt(arr[0]);\n\t\tint c = Integer.parseInt(arr[1]);\n\n\t\tint[][] spreadsheet = new int[r + 1][c + 1];\n\t\tint row = 0;\n\t\twhile ((line = br.readLine()) != null) {\n\t\t\tString[] cols = line.split(\" \");\n\t\t\tfor (int col = 0; col < c; col++) {\n\t\t\t\tfinal int val = Integer.parseInt(cols[col]);\n\t\t\t\tspreadsheet[row][col] = val;\n\t\t\t\tspreadsheet[row][c] += val;\n\t\t\t\tspreadsheet[r][col] += val;\n\t\t\t\tspreadsheet[r][c] += val;\n\t\t\t}\n\t\t\trow++;\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\tif (j != 0)\n\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\tSystem.out.print(spreadsheet[i][j]);\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}\n\t}",
"BufferedReader br = new BufferedReader(new InputStreamReader(System.in));",
"br",
"new BufferedReader(new InputStreamReader(System.in))",
"String line = br.readLine();",
"line",
"br.readLine()",
"br.readLine",
"br",
"String[] arr = line.split(\" \");",
"arr",
"line.split(\" \")",
"line.split",
"line",
"\" \"",
"int r = Integer.parseInt(arr[0]);",
"r",
"Integer.parseInt(arr[0])",
"Integer.parseInt",
"Integer",
"arr[0]",
"arr",
"0",
"int c = Integer.parseInt(arr[1]);",
"c",
"Integer.parseInt(arr[1])",
"Integer.parseInt",
"Integer",
"arr[1]",
"arr",
"1",
"int[][] spreadsheet = new int[r + 1][c + 1];",
"spreadsheet",
"new int[r + 1][c + 1]",
"r + 1",
"r",
"1",
"c + 1",
"c",
"1",
"int row = 0;",
"row",
"0",
"while ((line = br.readLine()) != null) {\n\t\t\tString[] cols = line.split(\" \");\n\t\t\tfor (int col = 0; col < c; col++) {\n\t\t\t\tfinal int val = Integer.parseInt(cols[col]);\n\t\t\t\tspreadsheet[row][col] = val;\n\t\t\t\tspreadsheet[row][c] += val;\n\t\t\t\tspreadsheet[r][col] += val;\n\t\t\t\tspreadsheet[r][c] += val;\n\t\t\t}\n\t\t\trow++;\n\t\t}",
"(line = br.readLine()) != null",
"(line = br.readLine())",
"line",
"br.readLine()",
"br.readLine",
"br",
"null",
"{\n\t\t\tString[] cols = line.split(\" \");\n\t\t\tfor (int col = 0; col < c; col++) {\n\t\t\t\tfinal int val = Integer.parseInt(cols[col]);\n\t\t\t\tspreadsheet[row][col] = val;\n\t\t\t\tspreadsheet[row][c] += val;\n\t\t\t\tspreadsheet[r][col] += val;\n\t\t\t\tspreadsheet[r][c] += val;\n\t\t\t}\n\t\t\trow++;\n\t\t}",
"String[] cols = line.split(\" \");",
"cols",
"line.split(\" \")",
"line.split",
"line",
"\" \"",
"for (int col = 0; col < c; col++) {\n\t\t\t\tfinal int val = Integer.parseInt(cols[col]);\n\t\t\t\tspreadsheet[row][col] = val;\n\t\t\t\tspreadsheet[row][c] += val;\n\t\t\t\tspreadsheet[r][col] += val;\n\t\t\t\tspreadsheet[r][c] += val;\n\t\t\t}",
"int col = 0;",
"int col = 0;",
"col",
"0",
"col < c",
"col",
"c",
"col++",
"col++",
"col",
"{\n\t\t\t\tfinal int val = Integer.parseInt(cols[col]);\n\t\t\t\tspreadsheet[row][col] = val;\n\t\t\t\tspreadsheet[row][c] += val;\n\t\t\t\tspreadsheet[r][col] += val;\n\t\t\t\tspreadsheet[r][c] += val;\n\t\t\t}",
"{\n\t\t\t\tfinal int val = Integer.parseInt(cols[col]);\n\t\t\t\tspreadsheet[row][col] = val;\n\t\t\t\tspreadsheet[row][c] += val;\n\t\t\t\tspreadsheet[r][col] += val;\n\t\t\t\tspreadsheet[r][c] += val;\n\t\t\t}",
"final int val = Integer.parseInt(cols[col]);",
"val",
"Integer.parseInt(cols[col])",
"Integer.parseInt",
"Integer",
"cols[col]",
"cols",
"col",
"spreadsheet[row][col] = val",
"spreadsheet[row][col]",
"spreadsheet[row]",
"spreadsheet",
"row",
"col",
"val",
"spreadsheet[row][c] += val",
"spreadsheet[row][c]",
"spreadsheet[row]",
"spreadsheet",
"row",
"c",
"val",
"spreadsheet[r][col] += val",
"spreadsheet[r][col]",
"spreadsheet[r]",
"spreadsheet",
"r",
"col",
"val",
"spreadsheet[r][c] += val",
"spreadsheet[r][c]",
"spreadsheet[r]",
"spreadsheet",
"r",
"c",
"val",
"row++",
"row",
"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\tSystem.out.print(spreadsheet[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\tSystem.out.print(spreadsheet[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\tSystem.out.print(spreadsheet[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\tSystem.out.print(spreadsheet[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\tSystem.out.print(spreadsheet[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\tSystem.out.print(spreadsheet[i][j]);\n\t\t\t}",
"if (j != 0)\n\t\t\t\t\tSystem.out.print(\" \");",
"j != 0",
"j",
"0",
"System.out.print(\" \")",
"System.out.print",
"System.out",
"System",
"System.out",
"\" \"",
"System.out.print(spreadsheet[i][j])",
"System.out.print",
"System.out",
"System",
"System.out",
"spreadsheet[i][j]",
"spreadsheet[i]",
"spreadsheet",
"i",
"j",
"System.out.println()",
"System.out.println",
"System.out",
"System",
"System.out",
"String[] args",
"args",
"public class Main {\n\tpublic static void main(String[] args) throws Exception {\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\t\tString line = br.readLine();\n\t\tString[] arr = line.split(\" \");\n\t\tint r = Integer.parseInt(arr[0]);\n\t\tint c = Integer.parseInt(arr[1]);\n\n\t\tint[][] spreadsheet = new int[r + 1][c + 1];\n\t\tint row = 0;\n\t\twhile ((line = br.readLine()) != null) {\n\t\t\tString[] cols = line.split(\" \");\n\t\t\tfor (int col = 0; col < c; col++) {\n\t\t\t\tfinal int val = Integer.parseInt(cols[col]);\n\t\t\t\tspreadsheet[row][col] = val;\n\t\t\t\tspreadsheet[row][c] += val;\n\t\t\t\tspreadsheet[r][col] += val;\n\t\t\t\tspreadsheet[r][c] += val;\n\t\t\t}\n\t\t\trow++;\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\tif (j != 0)\n\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\tSystem.out.print(spreadsheet[i][j]);\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) throws Exception {\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\t\tString line = br.readLine();\n\t\tString[] arr = line.split(\" \");\n\t\tint r = Integer.parseInt(arr[0]);\n\t\tint c = Integer.parseInt(arr[1]);\n\n\t\tint[][] spreadsheet = new int[r + 1][c + 1];\n\t\tint row = 0;\n\t\twhile ((line = br.readLine()) != null) {\n\t\t\tString[] cols = line.split(\" \");\n\t\t\tfor (int col = 0; col < c; col++) {\n\t\t\t\tfinal int val = Integer.parseInt(cols[col]);\n\t\t\t\tspreadsheet[row][col] = val;\n\t\t\t\tspreadsheet[row][c] += val;\n\t\t\t\tspreadsheet[r][col] += val;\n\t\t\t\tspreadsheet[r][c] += val;\n\t\t\t}\n\t\t\trow++;\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\tif (j != 0)\n\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\tSystem.out.print(spreadsheet[i][j]);\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}\n\t}\n}",
"Main"
] | import java.io.BufferedReader;
import java.io.InputStreamReader;
public class Main {
public static void main(String[] args) throws Exception {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
String line = br.readLine();
String[] arr = line.split(" ");
int r = Integer.parseInt(arr[0]);
int c = Integer.parseInt(arr[1]);
int[][] spreadsheet = new int[r + 1][c + 1];
int row = 0;
while ((line = br.readLine()) != null) {
String[] cols = line.split(" ");
for (int col = 0; col < c; col++) {
final int val = Integer.parseInt(cols[col]);
spreadsheet[row][col] = val;
spreadsheet[row][c] += val;
spreadsheet[r][col] += val;
spreadsheet[r][c] += val;
}
row++;
}
for (int i = 0; i <= r; i++) {
for (int j = 0; j <= c; j++) {
if (j != 0)
System.out.print(" ");
System.out.print(spreadsheet[i][j]);
}
System.out.println();
}
}
} |
[
7,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
41,
13,
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,
28,
13,
13,
30,
30,
41,
13,
20,
28,
13,
13,
30,
30,
4,
18,
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
],
[
125,
8
],
[
125,
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
],
[
60,
62
],
[
62,
63
],
[
63,
64
],
[
59,
65
],
[
65,
66
],
[
66,
67
],
[
67,
68
],
[
67,
69
],
[
66,
70
],
[
65,
71
],
[
59,
72
],
[
72,
73
],
[
73,
74
],
[
74,
75
],
[
74,
76
],
[
73,
77
],
[
72,
78
],
[
59,
79
],
[
79,
80
],
[
80,
81
],
[
81,
82
],
[
81,
83
],
[
80,
84
],
[
79,
85
],
[
59,
86
],
[
86,
87
],
[
87,
88
],
[
88,
89
],
[
88,
90
],
[
87,
91
],
[
86,
92
],
[
11,
93
],
[
93,
94
],
[
94,
95
],
[
11,
96
],
[
96,
97
],
[
96,
98
],
[
96,
99
],
[
100,
100
],
[
100,
101
],
[
101,
102
],
[
101,
103
],
[
100,
104
],
[
104,
105
],
[
104,
106
],
[
104,
107
],
[
108,
108
],
[
108,
109
],
[
109,
110
],
[
110,
111
],
[
109,
112
],
[
112,
113
],
[
113,
114
],
[
112,
115
],
[
100,
116
],
[
116,
117
],
[
117,
118
],
[
118,
119
],
[
118,
120
],
[
116,
121
],
[
9,
122
],
[
122,
123
],
[
0,
124
],
[
124,
125
],
[
124,
126
]
] | [
"import java.util.Scanner;\nimport java.util.StringJoiner;\n\npublic class Main {\n\n\tpublic static void main(String[] args) {\n\n\t\tScanner sc = new Scanner(System.in);\n\n\t\tint r = sc.nextInt();\n\t\tint c = sc.nextInt();\n\n\t\tint[][] table = new int[r+1][c+1];\n\n\t\tfor (int row = 0; row < r; row++) {\n\t\t\tfor (int col = 0; col < c; col++) {\n\t\t\t\tint now = sc.nextInt();\n\n\t\t\t\ttable[row][col] = now;\n\n\t\t\t\ttable[row][c] += now;\n\t\t\t\ttable[r][col] += now;\n\t\t\t\ttable[r][c] += now;\n\t\t\t}\n\t\t}\n\t\tsc.close();\n\n\t\tfor(int[] col : table) {\n\t\t\tStringJoiner sj = new StringJoiner(\" \");\n\t\t\tfor(int val : col) {\n\t\t\t\tsj.add(String.valueOf(val));\n\t\t\t}\n\t\t\tSystem.out.println(sj);\n\t\t}\n\t}\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"import java.util.StringJoiner;",
"StringJoiner",
"java.util",
"public class Main {\n\n\tpublic static void main(String[] args) {\n\n\t\tScanner sc = new Scanner(System.in);\n\n\t\tint r = sc.nextInt();\n\t\tint c = sc.nextInt();\n\n\t\tint[][] table = new int[r+1][c+1];\n\n\t\tfor (int row = 0; row < r; row++) {\n\t\t\tfor (int col = 0; col < c; col++) {\n\t\t\t\tint now = sc.nextInt();\n\n\t\t\t\ttable[row][col] = now;\n\n\t\t\t\ttable[row][c] += now;\n\t\t\t\ttable[r][col] += now;\n\t\t\t\ttable[r][c] += now;\n\t\t\t}\n\t\t}\n\t\tsc.close();\n\n\t\tfor(int[] col : table) {\n\t\t\tStringJoiner sj = new StringJoiner(\" \");\n\t\t\tfor(int val : col) {\n\t\t\t\tsj.add(String.valueOf(val));\n\t\t\t}\n\t\t\tSystem.out.println(sj);\n\t\t}\n\t}\n}",
"Main",
"public static void main(String[] args) {\n\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[][] table = new int[r+1][c+1];\n\n\t\tfor (int row = 0; row < r; row++) {\n\t\t\tfor (int col = 0; col < c; col++) {\n\t\t\t\tint now = sc.nextInt();\n\n\t\t\t\ttable[row][col] = now;\n\n\t\t\t\ttable[row][c] += now;\n\t\t\t\ttable[r][col] += now;\n\t\t\t\ttable[r][c] += now;\n\t\t\t}\n\t\t}\n\t\tsc.close();\n\n\t\tfor(int[] col : table) {\n\t\t\tStringJoiner sj = new StringJoiner(\" \");\n\t\t\tfor(int val : col) {\n\t\t\t\tsj.add(String.valueOf(val));\n\t\t\t}\n\t\t\tSystem.out.println(sj);\n\t\t}\n\t}",
"main",
"{\n\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[][] table = new int[r+1][c+1];\n\n\t\tfor (int row = 0; row < r; row++) {\n\t\t\tfor (int col = 0; col < c; col++) {\n\t\t\t\tint now = sc.nextInt();\n\n\t\t\t\ttable[row][col] = now;\n\n\t\t\t\ttable[row][c] += now;\n\t\t\t\ttable[r][col] += now;\n\t\t\t\ttable[r][c] += now;\n\t\t\t}\n\t\t}\n\t\tsc.close();\n\n\t\tfor(int[] col : table) {\n\t\t\tStringJoiner sj = new StringJoiner(\" \");\n\t\t\tfor(int val : col) {\n\t\t\t\tsj.add(String.valueOf(val));\n\t\t\t}\n\t\t\tSystem.out.println(sj);\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 row = 0; row < r; row++) {\n\t\t\tfor (int col = 0; col < c; col++) {\n\t\t\t\tint now = sc.nextInt();\n\n\t\t\t\ttable[row][col] = now;\n\n\t\t\t\ttable[row][c] += now;\n\t\t\t\ttable[r][col] += now;\n\t\t\t\ttable[r][c] += now;\n\t\t\t}\n\t\t}",
"int row = 0;",
"int row = 0;",
"row",
"0",
"row < r",
"row",
"r",
"row++",
"row++",
"row",
"{\n\t\t\tfor (int col = 0; col < c; col++) {\n\t\t\t\tint now = sc.nextInt();\n\n\t\t\t\ttable[row][col] = now;\n\n\t\t\t\ttable[row][c] += now;\n\t\t\t\ttable[r][col] += now;\n\t\t\t\ttable[r][c] += now;\n\t\t\t}\n\t\t}",
"{\n\t\t\tfor (int col = 0; col < c; col++) {\n\t\t\t\tint now = sc.nextInt();\n\n\t\t\t\ttable[row][col] = now;\n\n\t\t\t\ttable[row][c] += now;\n\t\t\t\ttable[r][col] += now;\n\t\t\t\ttable[r][c] += now;\n\t\t\t}\n\t\t}",
"for (int col = 0; col < c; col++) {\n\t\t\t\tint now = sc.nextInt();\n\n\t\t\t\ttable[row][col] = now;\n\n\t\t\t\ttable[row][c] += now;\n\t\t\t\ttable[r][col] += now;\n\t\t\t\ttable[r][c] += now;\n\t\t\t}",
"int col = 0;",
"int col = 0;",
"col",
"0",
"col < c",
"col",
"c",
"col++",
"col++",
"col",
"{\n\t\t\t\tint now = sc.nextInt();\n\n\t\t\t\ttable[row][col] = now;\n\n\t\t\t\ttable[row][c] += now;\n\t\t\t\ttable[r][col] += now;\n\t\t\t\ttable[r][c] += now;\n\t\t\t}",
"{\n\t\t\t\tint now = sc.nextInt();\n\n\t\t\t\ttable[row][col] = now;\n\n\t\t\t\ttable[row][c] += now;\n\t\t\t\ttable[r][col] += now;\n\t\t\t\ttable[r][c] += now;\n\t\t\t}",
"int now = sc.nextInt();",
"now",
"sc.nextInt()",
"sc.nextInt",
"sc",
"table[row][col] = now",
"table[row][col]",
"table[row]",
"table",
"row",
"col",
"now",
"table[row][c] += now",
"table[row][c]",
"table[row]",
"table",
"row",
"c",
"now",
"table[r][col] += now",
"table[r][col]",
"table[r]",
"table",
"r",
"col",
"now",
"table[r][c] += now",
"table[r][c]",
"table[r]",
"table",
"r",
"c",
"now",
"sc.close()",
"sc.close",
"sc",
"for(int[] col : table) {\n\t\t\tStringJoiner sj = new StringJoiner(\" \");\n\t\t\tfor(int val : col) {\n\t\t\t\tsj.add(String.valueOf(val));\n\t\t\t}\n\t\t\tSystem.out.println(sj);\n\t\t}",
"int[] col",
"table",
"{\n\t\t\tStringJoiner sj = new StringJoiner(\" \");\n\t\t\tfor(int val : col) {\n\t\t\t\tsj.add(String.valueOf(val));\n\t\t\t}\n\t\t\tSystem.out.println(sj);\n\t\t}",
"{\n\t\t\tStringJoiner sj = new StringJoiner(\" \");\n\t\t\tfor(int val : col) {\n\t\t\t\tsj.add(String.valueOf(val));\n\t\t\t}\n\t\t\tSystem.out.println(sj);\n\t\t}",
"StringJoiner sj = new StringJoiner(\" \");",
"sj",
"new StringJoiner(\" \")",
"for(int val : col) {\n\t\t\t\tsj.add(String.valueOf(val));\n\t\t\t}",
"int val",
"col",
"{\n\t\t\t\tsj.add(String.valueOf(val));\n\t\t\t}",
"{\n\t\t\t\tsj.add(String.valueOf(val));\n\t\t\t}",
"sj.add(String.valueOf(val))",
"sj.add",
"sj",
"String.valueOf(val)",
"String.valueOf",
"String",
"val",
"System.out.println(sj)",
"System.out.println",
"System.out",
"System",
"System.out",
"sj",
"String[] args",
"args",
"public class Main {\n\n\tpublic static void main(String[] args) {\n\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[][] table = new int[r+1][c+1];\n\n\t\tfor (int row = 0; row < r; row++) {\n\t\t\tfor (int col = 0; col < c; col++) {\n\t\t\t\tint now = sc.nextInt();\n\n\t\t\t\ttable[row][col] = now;\n\n\t\t\t\ttable[row][c] += now;\n\t\t\t\ttable[r][col] += now;\n\t\t\t\ttable[r][c] += now;\n\t\t\t}\n\t\t}\n\t\tsc.close();\n\n\t\tfor(int[] col : table) {\n\t\t\tStringJoiner sj = new StringJoiner(\" \");\n\t\t\tfor(int val : col) {\n\t\t\t\tsj.add(String.valueOf(val));\n\t\t\t}\n\t\t\tSystem.out.println(sj);\n\t\t}\n\t}\n}",
"public class Main {\n\n\tpublic static void main(String[] args) {\n\n\t\tScanner sc = new Scanner(System.in);\n\n\t\tint r = sc.nextInt();\n\t\tint c = sc.nextInt();\n\n\t\tint[][] table = new int[r+1][c+1];\n\n\t\tfor (int row = 0; row < r; row++) {\n\t\t\tfor (int col = 0; col < c; col++) {\n\t\t\t\tint now = sc.nextInt();\n\n\t\t\t\ttable[row][col] = now;\n\n\t\t\t\ttable[row][c] += now;\n\t\t\t\ttable[r][col] += now;\n\t\t\t\ttable[r][c] += now;\n\t\t\t}\n\t\t}\n\t\tsc.close();\n\n\t\tfor(int[] col : table) {\n\t\t\tStringJoiner sj = new StringJoiner(\" \");\n\t\t\tfor(int val : col) {\n\t\t\t\tsj.add(String.valueOf(val));\n\t\t\t}\n\t\t\tSystem.out.println(sj);\n\t\t}\n\t}\n}",
"Main"
] | import java.util.Scanner;
import java.util.StringJoiner;
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 row = 0; row < r; row++) {
for (int col = 0; col < c; col++) {
int now = sc.nextInt();
table[row][col] = now;
table[row][c] += now;
table[r][col] += now;
table[r][c] += now;
}
}
sc.close();
for(int[] col : table) {
StringJoiner sj = new StringJoiner(" ");
for(int val : col) {
sj.add(String.valueOf(val));
}
System.out.println(sj);
}
}
} |
[
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,
13,
13,
41,
13,
20,
13,
41,
13,
20,
13,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
41,
13,
4,
18,
13,
4,
18,
13,
0,
18,
18,
13,
13,
13,
13,
0,
18,
13,
13,
13,
0,
18,
13,
13,
13,
0,
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,
14,
2,
2,
13,
13,
2,
13,
13,
30,
4,
18,
18,
13,
13,
13,
14,
2,
13,
13,
30,
4,
18,
18,
13,
13,
18,
13,
13,
14,
2,
13,
13,
30,
4,
18,
18,
13,
13,
18,
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
],
[
195,
5
],
[
195,
6
],
[
6,
7
],
[
6,
8
],
[
195,
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
],
[
11,
27
],
[
27,
28
],
[
27,
29
],
[
11,
31
],
[
31,
32
],
[
31,
33
],
[
11,
35
],
[
35,
36
],
[
35,
37
],
[
11,
38
],
[
38,
39
],
[
39,
40
],
[
40,
41
],
[
40,
42
],
[
38,
43
],
[
43,
44
],
[
43,
45
],
[
38,
46
],
[
46,
47
],
[
47,
48
],
[
38,
49
],
[
50,
50
],
[
50,
51
],
[
51,
52
],
[
52,
53
],
[
53,
54
],
[
53,
55
],
[
51,
56
],
[
56,
57
],
[
56,
58
],
[
51,
59
],
[
59,
60
],
[
60,
61
],
[
51,
62
],
[
63,
63
],
[
63,
64
],
[
64,
65
],
[
64,
66
],
[
66,
67
],
[
67,
68
],
[
66,
69
],
[
69,
70
],
[
70,
71
],
[
63,
72
],
[
72,
73
],
[
73,
74
],
[
74,
75
],
[
74,
76
],
[
73,
77
],
[
72,
78
],
[
63,
79
],
[
79,
80
],
[
80,
81
],
[
80,
82
],
[
79,
83
],
[
63,
84
],
[
84,
85
],
[
85,
86
],
[
85,
87
],
[
84,
88
],
[
50,
89
],
[
89,
90
],
[
89,
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
],
[
116,
118
],
[
109,
119
],
[
119,
120
],
[
120,
121
],
[
109,
122
],
[
123,
123
],
[
123,
124
],
[
124,
125
],
[
125,
126
],
[
126,
127
],
[
126,
128
],
[
125,
129
],
[
129,
130
],
[
129,
131
],
[
124,
132
],
[
132,
133
],
[
133,
134
],
[
134,
135
],
[
135,
136
],
[
135,
137
],
[
133,
138
],
[
124,
139
],
[
139,
140
],
[
140,
141
],
[
140,
142
],
[
139,
143
],
[
143,
144
],
[
144,
145
],
[
145,
146
],
[
146,
147
],
[
146,
148
],
[
144,
149
],
[
149,
150
],
[
149,
151
],
[
139,
152
],
[
152,
153
],
[
153,
154
],
[
153,
155
],
[
152,
156
],
[
156,
157
],
[
157,
158
],
[
158,
159
],
[
159,
160
],
[
159,
161
],
[
157,
162
],
[
162,
163
],
[
162,
164
],
[
152,
165
],
[
165,
166
],
[
166,
167
],
[
167,
168
],
[
168,
169
],
[
168,
170
],
[
166,
171
],
[
171,
172
],
[
172,
173
],
[
172,
174
],
[
171,
175
],
[
123,
176
],
[
176,
177
],
[
177,
178
],
[
177,
179
],
[
176,
180
],
[
180,
181
],
[
181,
182
],
[
182,
183
],
[
183,
184
],
[
183,
185
],
[
181,
186
],
[
108,
187
],
[
187,
188
],
[
188,
189
],
[
189,
190
],
[
189,
191
],
[
9,
192
],
[
192,
193
],
[
0,
194
],
[
194,
195
],
[
194,
196
]
] | [
"import java.util.*;\n\npublic class Main {\n\tstatic Scanner sc = new Scanner(System.in);\n\tpublic static void main(String[] args) {\n\t\tint n = sc.nextInt();\n\t\tint m = sc.nextInt();\n\t\tint[][] ints = new int[n][m];\n\t\tint[] line = new int[n];\n\t\tint[] row = new int[m]; \n\t\tint sum = 0;\n\t\tfor (int i=0; i<n; i++) {\n\t\t\tfor (int j=0; j<m; j++) {\n\t\t\t\t int temp = Integer.parseInt(sc.next());\n\t\t\t\t ints[i][j] = temp;\n\t\t\t\t line[i] += temp;\n\t\t\t\t row[j] += temp;\n\t\t\t}\n\t\t\tsum += line[i];\n\t\t}\n\t\t\n\t\tfor (int i=0; i<n+1; i++) {\n\t\t\tfor (int j=0; j<m+1; j++) {\n\t\t\t\tif (i==n && j==m) {System.out.print(sum);}\n\t\t\t\telse if (j==m) {System.out.print(line[i]);}\n\t\t\t\telse if (i==n) {System.out.print(row[j]);}\n\t\t\t\telse {System.out.print(ints[i][j]);}\n\t\t\t\tif (j!=m) {System.out.print(\" \");}\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\tstatic Scanner sc = new Scanner(System.in);\n\tpublic static void main(String[] args) {\n\t\tint n = sc.nextInt();\n\t\tint m = sc.nextInt();\n\t\tint[][] ints = new int[n][m];\n\t\tint[] line = new int[n];\n\t\tint[] row = new int[m]; \n\t\tint sum = 0;\n\t\tfor (int i=0; i<n; i++) {\n\t\t\tfor (int j=0; j<m; j++) {\n\t\t\t\t int temp = Integer.parseInt(sc.next());\n\t\t\t\t ints[i][j] = temp;\n\t\t\t\t line[i] += temp;\n\t\t\t\t row[j] += temp;\n\t\t\t}\n\t\t\tsum += line[i];\n\t\t}\n\t\t\n\t\tfor (int i=0; i<n+1; i++) {\n\t\t\tfor (int j=0; j<m+1; j++) {\n\t\t\t\tif (i==n && j==m) {System.out.print(sum);}\n\t\t\t\telse if (j==m) {System.out.print(line[i]);}\n\t\t\t\telse if (i==n) {System.out.print(row[j]);}\n\t\t\t\telse {System.out.print(ints[i][j]);}\n\t\t\t\tif (j!=m) {System.out.print(\" \");}\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}\n\t}\n}",
"Main",
"static Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"public static void main(String[] args) {\n\t\tint n = sc.nextInt();\n\t\tint m = sc.nextInt();\n\t\tint[][] ints = new int[n][m];\n\t\tint[] line = new int[n];\n\t\tint[] row = new int[m]; \n\t\tint sum = 0;\n\t\tfor (int i=0; i<n; i++) {\n\t\t\tfor (int j=0; j<m; j++) {\n\t\t\t\t int temp = Integer.parseInt(sc.next());\n\t\t\t\t ints[i][j] = temp;\n\t\t\t\t line[i] += temp;\n\t\t\t\t row[j] += temp;\n\t\t\t}\n\t\t\tsum += line[i];\n\t\t}\n\t\t\n\t\tfor (int i=0; i<n+1; i++) {\n\t\t\tfor (int j=0; j<m+1; j++) {\n\t\t\t\tif (i==n && j==m) {System.out.print(sum);}\n\t\t\t\telse if (j==m) {System.out.print(line[i]);}\n\t\t\t\telse if (i==n) {System.out.print(row[j]);}\n\t\t\t\telse {System.out.print(ints[i][j]);}\n\t\t\t\tif (j!=m) {System.out.print(\" \");}\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}\n\t}",
"main",
"{\n\t\tint n = sc.nextInt();\n\t\tint m = sc.nextInt();\n\t\tint[][] ints = new int[n][m];\n\t\tint[] line = new int[n];\n\t\tint[] row = new int[m]; \n\t\tint sum = 0;\n\t\tfor (int i=0; i<n; i++) {\n\t\t\tfor (int j=0; j<m; j++) {\n\t\t\t\t int temp = Integer.parseInt(sc.next());\n\t\t\t\t ints[i][j] = temp;\n\t\t\t\t line[i] += temp;\n\t\t\t\t row[j] += temp;\n\t\t\t}\n\t\t\tsum += line[i];\n\t\t}\n\t\t\n\t\tfor (int i=0; i<n+1; i++) {\n\t\t\tfor (int j=0; j<m+1; j++) {\n\t\t\t\tif (i==n && j==m) {System.out.print(sum);}\n\t\t\t\telse if (j==m) {System.out.print(line[i]);}\n\t\t\t\telse if (i==n) {System.out.print(row[j]);}\n\t\t\t\telse {System.out.print(ints[i][j]);}\n\t\t\t\tif (j!=m) {System.out.print(\" \");}\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}\n\t}",
"int n = sc.nextInt();",
"n",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int m = sc.nextInt();",
"m",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int[][] ints = new int[n][m];",
"ints",
"new int[n][m]",
"n",
"m",
"int[] line = new int[n];",
"line",
"new int[n]",
"n",
"int[] row = new int[m];",
"row",
"new int[m]",
"m",
"int sum = 0;",
"sum",
"0",
"for (int i=0; i<n; i++) {\n\t\t\tfor (int j=0; j<m; j++) {\n\t\t\t\t int temp = Integer.parseInt(sc.next());\n\t\t\t\t ints[i][j] = temp;\n\t\t\t\t line[i] += temp;\n\t\t\t\t row[j] += temp;\n\t\t\t}\n\t\t\tsum += line[i];\n\t\t}",
"int i=0;",
"int i=0;",
"i",
"0",
"i<n",
"i",
"n",
"i++",
"i++",
"i",
"{\n\t\t\tfor (int j=0; j<m; j++) {\n\t\t\t\t int temp = Integer.parseInt(sc.next());\n\t\t\t\t ints[i][j] = temp;\n\t\t\t\t line[i] += temp;\n\t\t\t\t row[j] += temp;\n\t\t\t}\n\t\t\tsum += line[i];\n\t\t}",
"{\n\t\t\tfor (int j=0; j<m; j++) {\n\t\t\t\t int temp = Integer.parseInt(sc.next());\n\t\t\t\t ints[i][j] = temp;\n\t\t\t\t line[i] += temp;\n\t\t\t\t row[j] += temp;\n\t\t\t}\n\t\t\tsum += line[i];\n\t\t}",
"for (int j=0; j<m; j++) {\n\t\t\t\t int temp = Integer.parseInt(sc.next());\n\t\t\t\t ints[i][j] = temp;\n\t\t\t\t line[i] += temp;\n\t\t\t\t row[j] += temp;\n\t\t\t}",
"int j=0;",
"int j=0;",
"j",
"0",
"j<m",
"j",
"m",
"j++",
"j++",
"j",
"{\n\t\t\t\t int temp = Integer.parseInt(sc.next());\n\t\t\t\t ints[i][j] = temp;\n\t\t\t\t line[i] += temp;\n\t\t\t\t row[j] += temp;\n\t\t\t}",
"{\n\t\t\t\t int temp = Integer.parseInt(sc.next());\n\t\t\t\t ints[i][j] = temp;\n\t\t\t\t line[i] += temp;\n\t\t\t\t row[j] += temp;\n\t\t\t}",
"int temp = Integer.parseInt(sc.next());",
"temp",
"Integer.parseInt(sc.next())",
"Integer.parseInt",
"Integer",
"sc.next()",
"sc.next",
"sc",
"ints[i][j] = temp",
"ints[i][j]",
"ints[i]",
"ints",
"i",
"j",
"temp",
"line[i] += temp",
"line[i]",
"line",
"i",
"temp",
"row[j] += temp",
"row[j]",
"row",
"j",
"temp",
"sum += line[i]",
"sum",
"line[i]",
"line",
"i",
"for (int i=0; i<n+1; i++) {\n\t\t\tfor (int j=0; j<m+1; j++) {\n\t\t\t\tif (i==n && j==m) {System.out.print(sum);}\n\t\t\t\telse if (j==m) {System.out.print(line[i]);}\n\t\t\t\telse if (i==n) {System.out.print(row[j]);}\n\t\t\t\telse {System.out.print(ints[i][j]);}\n\t\t\t\tif (j!=m) {System.out.print(\" \");}\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}",
"int i=0;",
"int i=0;",
"i",
"0",
"i<n+1",
"i",
"n+1",
"n",
"1",
"i++",
"i++",
"i",
"{\n\t\t\tfor (int j=0; j<m+1; j++) {\n\t\t\t\tif (i==n && j==m) {System.out.print(sum);}\n\t\t\t\telse if (j==m) {System.out.print(line[i]);}\n\t\t\t\telse if (i==n) {System.out.print(row[j]);}\n\t\t\t\telse {System.out.print(ints[i][j]);}\n\t\t\t\tif (j!=m) {System.out.print(\" \");}\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}",
"{\n\t\t\tfor (int j=0; j<m+1; j++) {\n\t\t\t\tif (i==n && j==m) {System.out.print(sum);}\n\t\t\t\telse if (j==m) {System.out.print(line[i]);}\n\t\t\t\telse if (i==n) {System.out.print(row[j]);}\n\t\t\t\telse {System.out.print(ints[i][j]);}\n\t\t\t\tif (j!=m) {System.out.print(\" \");}\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}",
"for (int j=0; j<m+1; j++) {\n\t\t\t\tif (i==n && j==m) {System.out.print(sum);}\n\t\t\t\telse if (j==m) {System.out.print(line[i]);}\n\t\t\t\telse if (i==n) {System.out.print(row[j]);}\n\t\t\t\telse {System.out.print(ints[i][j]);}\n\t\t\t\tif (j!=m) {System.out.print(\" \");}\n\t\t\t}",
"int j=0;",
"int j=0;",
"j",
"0",
"j<m+1",
"j",
"m+1",
"m",
"1",
"j++",
"j++",
"j",
"{\n\t\t\t\tif (i==n && j==m) {System.out.print(sum);}\n\t\t\t\telse if (j==m) {System.out.print(line[i]);}\n\t\t\t\telse if (i==n) {System.out.print(row[j]);}\n\t\t\t\telse {System.out.print(ints[i][j]);}\n\t\t\t\tif (j!=m) {System.out.print(\" \");}\n\t\t\t}",
"{\n\t\t\t\tif (i==n && j==m) {System.out.print(sum);}\n\t\t\t\telse if (j==m) {System.out.print(line[i]);}\n\t\t\t\telse if (i==n) {System.out.print(row[j]);}\n\t\t\t\telse {System.out.print(ints[i][j]);}\n\t\t\t\tif (j!=m) {System.out.print(\" \");}\n\t\t\t}",
"if (i==n && j==m) {System.out.print(sum);}\n\t\t\t\telse if (j==m) {System.out.print(line[i]);}\n\t\t\t\telse if (i==n) {System.out.print(row[j]);}\n\t\t\t\telse {System.out.print(ints[i][j]);}",
"i==n && j==m",
"i==n",
"i",
"n",
"j==m",
"j",
"m",
"{System.out.print(sum);}",
"System.out.print(sum)",
"System.out.print",
"System.out",
"System",
"System.out",
"sum",
"if (j==m) {System.out.print(line[i]);}\n\t\t\t\telse if (i==n) {System.out.print(row[j]);}\n\t\t\t\telse {System.out.print(ints[i][j]);}",
"j==m",
"j",
"m",
"{System.out.print(line[i]);}",
"System.out.print(line[i])",
"System.out.print",
"System.out",
"System",
"System.out",
"line[i]",
"line",
"i",
"if (i==n) {System.out.print(row[j]);}\n\t\t\t\telse {System.out.print(ints[i][j]);}",
"i==n",
"i",
"n",
"{System.out.print(row[j]);}",
"System.out.print(row[j])",
"System.out.print",
"System.out",
"System",
"System.out",
"row[j]",
"row",
"j",
"{System.out.print(ints[i][j]);}",
"System.out.print(ints[i][j])",
"System.out.print",
"System.out",
"System",
"System.out",
"ints[i][j]",
"ints[i]",
"ints",
"i",
"j",
"if (j!=m) {System.out.print(\" \");}",
"j!=m",
"j",
"m",
"{System.out.print(\" \");}",
"System.out.print(\" \")",
"System.out.print",
"System.out",
"System",
"System.out",
"\" \"",
"System.out.println()",
"System.out.println",
"System.out",
"System",
"System.out",
"String[] args",
"args",
"public class Main {\n\tstatic Scanner sc = new Scanner(System.in);\n\tpublic static void main(String[] args) {\n\t\tint n = sc.nextInt();\n\t\tint m = sc.nextInt();\n\t\tint[][] ints = new int[n][m];\n\t\tint[] line = new int[n];\n\t\tint[] row = new int[m]; \n\t\tint sum = 0;\n\t\tfor (int i=0; i<n; i++) {\n\t\t\tfor (int j=0; j<m; j++) {\n\t\t\t\t int temp = Integer.parseInt(sc.next());\n\t\t\t\t ints[i][j] = temp;\n\t\t\t\t line[i] += temp;\n\t\t\t\t row[j] += temp;\n\t\t\t}\n\t\t\tsum += line[i];\n\t\t}\n\t\t\n\t\tfor (int i=0; i<n+1; i++) {\n\t\t\tfor (int j=0; j<m+1; j++) {\n\t\t\t\tif (i==n && j==m) {System.out.print(sum);}\n\t\t\t\telse if (j==m) {System.out.print(line[i]);}\n\t\t\t\telse if (i==n) {System.out.print(row[j]);}\n\t\t\t\telse {System.out.print(ints[i][j]);}\n\t\t\t\tif (j!=m) {System.out.print(\" \");}\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}\n\t}\n}",
"public class Main {\n\tstatic Scanner sc = new Scanner(System.in);\n\tpublic static void main(String[] args) {\n\t\tint n = sc.nextInt();\n\t\tint m = sc.nextInt();\n\t\tint[][] ints = new int[n][m];\n\t\tint[] line = new int[n];\n\t\tint[] row = new int[m]; \n\t\tint sum = 0;\n\t\tfor (int i=0; i<n; i++) {\n\t\t\tfor (int j=0; j<m; j++) {\n\t\t\t\t int temp = Integer.parseInt(sc.next());\n\t\t\t\t ints[i][j] = temp;\n\t\t\t\t line[i] += temp;\n\t\t\t\t row[j] += temp;\n\t\t\t}\n\t\t\tsum += line[i];\n\t\t}\n\t\t\n\t\tfor (int i=0; i<n+1; i++) {\n\t\t\tfor (int j=0; j<m+1; j++) {\n\t\t\t\tif (i==n && j==m) {System.out.print(sum);}\n\t\t\t\telse if (j==m) {System.out.print(line[i]);}\n\t\t\t\telse if (i==n) {System.out.print(row[j]);}\n\t\t\t\telse {System.out.print(ints[i][j]);}\n\t\t\t\tif (j!=m) {System.out.print(\" \");}\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}\n\t}\n}",
"Main"
] | import java.util.*;
public class Main {
static Scanner sc = new Scanner(System.in);
public static void main(String[] args) {
int n = sc.nextInt();
int m = sc.nextInt();
int[][] ints = new int[n][m];
int[] line = new int[n];
int[] row = new int[m];
int sum = 0;
for (int i=0; i<n; i++) {
for (int j=0; j<m; j++) {
int temp = Integer.parseInt(sc.next());
ints[i][j] = temp;
line[i] += temp;
row[j] += temp;
}
sum += line[i];
}
for (int i=0; i<n+1; i++) {
for (int j=0; j<m+1; j++) {
if (i==n && j==m) {System.out.print(sum);}
else if (j==m) {System.out.print(line[i]);}
else if (i==n) {System.out.print(row[j]);}
else {System.out.print(ints[i][j]);}
if (j!=m) {System.out.print(" ");}
}
System.out.println();
}
}
}
|
[
7,
15,
13,
17,
6,
13,
41,
13,
20,
12,
13,
30,
41,
13,
41,
13,
41,
13,
17,
41,
13,
17,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
41,
13,
20,
13,
13,
11,
1,
0,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
11,
1,
0,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
18,
18,
13,
13,
13,
4,
18,
13,
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,
0,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
11,
1,
0,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
18,
18,
13,
13,
13,
4,
18,
18,
13,
13,
2,
13,
17,
0,
13,
13,
0,
13,
17,
4,
18,
18,
13,
13,
13,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
156,
5
],
[
156,
6
],
[
6,
7
],
[
6,
8
],
[
156,
9
],
[
9,
10
],
[
9,
11
],
[
11,
12
],
[
12,
13
],
[
11,
14
],
[
14,
15
],
[
11,
16
],
[
16,
17
],
[
16,
18
],
[
11,
19
],
[
19,
20
],
[
19,
21
],
[
11,
22
],
[
22,
23
],
[
22,
24
],
[
24,
25
],
[
25,
26
],
[
11,
27
],
[
27,
28
],
[
27,
29
],
[
29,
30
],
[
30,
31
],
[
11,
32
],
[
32,
33
],
[
32,
34
],
[
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
],
[
51,
52
],
[
52,
53
],
[
52,
54
],
[
50,
55
],
[
55,
56
],
[
55,
57
],
[
50,
58
],
[
58,
59
],
[
59,
60
],
[
50,
61
],
[
62,
62
],
[
62,
63
],
[
63,
64
],
[
64,
65
],
[
65,
66
],
[
65,
67
],
[
64,
68
],
[
63,
69
],
[
69,
70
],
[
70,
71
],
[
62,
72
],
[
72,
73
],
[
72,
74
],
[
74,
75
],
[
75,
76
],
[
75,
77
],
[
74,
78
],
[
62,
79
],
[
79,
80
],
[
80,
81
],
[
81,
82
],
[
81,
83
],
[
79,
84
],
[
84,
85
],
[
85,
86
],
[
86,
87
],
[
86,
88
],
[
85,
89
],
[
84,
90
],
[
49,
91
],
[
91,
92
],
[
92,
93
],
[
93,
94
],
[
93,
95
],
[
91,
96
],
[
49,
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
],
[
126,
128
],
[
128,
129
],
[
129,
130
],
[
129,
131
],
[
128,
132
],
[
112,
133
],
[
133,
134
],
[
134,
135
],
[
135,
136
],
[
135,
137
],
[
133,
138
],
[
138,
139
],
[
138,
140
],
[
112,
141
],
[
141,
142
],
[
141,
143
],
[
112,
144
],
[
144,
145
],
[
144,
146
],
[
11,
147
],
[
147,
148
],
[
148,
149
],
[
149,
150
],
[
149,
151
],
[
147,
152
],
[
9,
153
],
[
153,
154
],
[
0,
155
],
[
155,
156
],
[
155,
157
]
] | [
"import java.util.*;\npublic class Main {\n public static Scanner sc = new Scanner(System.in);\n public static void main(String[] args) throws Exception {\n \tint i, j;\n \tint sum = 0, sum2 = 0;\n \tint r = sc.nextInt();\n \tint c = sc.nextInt();\n \tint rc[][] = new int[r][c];\n \t\t\n \tfor(i = 0; i < r; i++) {\n \t\tfor(j = 0; j < c; j++) {\n \t\t\trc[i][j] = sc.nextInt();\n \t\t\tsum += rc[i][j];\n \t\t\tSystem.out.print(rc[i][j] + \" \");\n \t\t}\n \t\tSystem.out.println(sum);\n \t\tsum = 0;\n \t}\n \tfor(j = 0; j < c; j++) {\n \t\tfor(i = 0; i < r; i++) {\n \t\t\tsum += rc[i][j];\n \t\t}\n \t\tSystem.out.print(sum + \" \");\n \t\tsum2 += sum;\n \t\tsum = 0;\n \t}\n \tSystem.out.println(sum2);\n }\n}",
"import java.util.*;",
"util.*",
"java",
"public class Main {\n public static Scanner sc = new Scanner(System.in);\n public static void main(String[] args) throws Exception {\n \tint i, j;\n \tint sum = 0, sum2 = 0;\n \tint r = sc.nextInt();\n \tint c = sc.nextInt();\n \tint rc[][] = new int[r][c];\n \t\t\n \tfor(i = 0; i < r; i++) {\n \t\tfor(j = 0; j < c; j++) {\n \t\t\trc[i][j] = sc.nextInt();\n \t\t\tsum += rc[i][j];\n \t\t\tSystem.out.print(rc[i][j] + \" \");\n \t\t}\n \t\tSystem.out.println(sum);\n \t\tsum = 0;\n \t}\n \tfor(j = 0; j < c; j++) {\n \t\tfor(i = 0; i < r; i++) {\n \t\t\tsum += rc[i][j];\n \t\t}\n \t\tSystem.out.print(sum + \" \");\n \t\tsum2 += sum;\n \t\tsum = 0;\n \t}\n \tSystem.out.println(sum2);\n }\n}",
"Main",
"public static Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"public static void main(String[] args) throws Exception {\n \tint i, j;\n \tint sum = 0, sum2 = 0;\n \tint r = sc.nextInt();\n \tint c = sc.nextInt();\n \tint rc[][] = new int[r][c];\n \t\t\n \tfor(i = 0; i < r; i++) {\n \t\tfor(j = 0; j < c; j++) {\n \t\t\trc[i][j] = sc.nextInt();\n \t\t\tsum += rc[i][j];\n \t\t\tSystem.out.print(rc[i][j] + \" \");\n \t\t}\n \t\tSystem.out.println(sum);\n \t\tsum = 0;\n \t}\n \tfor(j = 0; j < c; j++) {\n \t\tfor(i = 0; i < r; i++) {\n \t\t\tsum += rc[i][j];\n \t\t}\n \t\tSystem.out.print(sum + \" \");\n \t\tsum2 += sum;\n \t\tsum = 0;\n \t}\n \tSystem.out.println(sum2);\n }",
"main",
"{\n \tint i, j;\n \tint sum = 0, sum2 = 0;\n \tint r = sc.nextInt();\n \tint c = sc.nextInt();\n \tint rc[][] = new int[r][c];\n \t\t\n \tfor(i = 0; i < r; i++) {\n \t\tfor(j = 0; j < c; j++) {\n \t\t\trc[i][j] = sc.nextInt();\n \t\t\tsum += rc[i][j];\n \t\t\tSystem.out.print(rc[i][j] + \" \");\n \t\t}\n \t\tSystem.out.println(sum);\n \t\tsum = 0;\n \t}\n \tfor(j = 0; j < c; j++) {\n \t\tfor(i = 0; i < r; i++) {\n \t\t\tsum += rc[i][j];\n \t\t}\n \t\tSystem.out.print(sum + \" \");\n \t\tsum2 += sum;\n \t\tsum = 0;\n \t}\n \tSystem.out.println(sum2);\n }",
"int i",
"i",
"j;",
"j",
"int sum = 0",
"sum",
"0",
"sum2 = 0;",
"sum2",
"0",
"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",
"for(i = 0; i < r; i++) {\n \t\tfor(j = 0; j < c; j++) {\n \t\t\trc[i][j] = sc.nextInt();\n \t\t\tsum += rc[i][j];\n \t\t\tSystem.out.print(rc[i][j] + \" \");\n \t\t}\n \t\tSystem.out.println(sum);\n \t\tsum = 0;\n \t}",
"i = 0;",
"i = 0",
"i",
"0",
"i < r",
"i",
"r",
"i++",
"i++",
"i",
"{\n \t\tfor(j = 0; j < c; j++) {\n \t\t\trc[i][j] = sc.nextInt();\n \t\t\tsum += rc[i][j];\n \t\t\tSystem.out.print(rc[i][j] + \" \");\n \t\t}\n \t\tSystem.out.println(sum);\n \t\tsum = 0;\n \t}",
"{\n \t\tfor(j = 0; j < c; j++) {\n \t\t\trc[i][j] = sc.nextInt();\n \t\t\tsum += rc[i][j];\n \t\t\tSystem.out.print(rc[i][j] + \" \");\n \t\t}\n \t\tSystem.out.println(sum);\n \t\tsum = 0;\n \t}",
"for(j = 0; j < c; j++) {\n \t\t\trc[i][j] = sc.nextInt();\n \t\t\tsum += rc[i][j];\n \t\t\tSystem.out.print(rc[i][j] + \" \");\n \t\t}",
"j = 0;",
"j = 0",
"j",
"0",
"j < c",
"j",
"c",
"j++",
"j++",
"j",
"{\n \t\t\trc[i][j] = sc.nextInt();\n \t\t\tsum += rc[i][j];\n \t\t\tSystem.out.print(rc[i][j] + \" \");\n \t\t}",
"{\n \t\t\trc[i][j] = sc.nextInt();\n \t\t\tsum += rc[i][j];\n \t\t\tSystem.out.print(rc[i][j] + \" \");\n \t\t}",
"rc[i][j] = sc.nextInt()",
"rc[i][j]",
"rc[i]",
"rc",
"i",
"j",
"sc.nextInt()",
"sc.nextInt",
"sc",
"sum += rc[i][j]",
"sum",
"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][j]",
"rc[i]",
"rc",
"i",
"j",
"\" \"",
"System.out.println(sum)",
"System.out.println",
"System.out",
"System",
"System.out",
"sum",
"sum = 0",
"sum",
"0",
"for(j = 0; j < c; j++) {\n \t\tfor(i = 0; i < r; i++) {\n \t\t\tsum += rc[i][j];\n \t\t}\n \t\tSystem.out.print(sum + \" \");\n \t\tsum2 += sum;\n \t\tsum = 0;\n \t}",
"j = 0;",
"j = 0",
"j",
"0",
"j < c",
"j",
"c",
"j++",
"j++",
"j",
"{\n \t\tfor(i = 0; i < r; i++) {\n \t\t\tsum += rc[i][j];\n \t\t}\n \t\tSystem.out.print(sum + \" \");\n \t\tsum2 += sum;\n \t\tsum = 0;\n \t}",
"{\n \t\tfor(i = 0; i < r; i++) {\n \t\t\tsum += rc[i][j];\n \t\t}\n \t\tSystem.out.print(sum + \" \");\n \t\tsum2 += sum;\n \t\tsum = 0;\n \t}",
"for(i = 0; i < r; i++) {\n \t\t\tsum += rc[i][j];\n \t\t}",
"i = 0;",
"i = 0",
"i",
"0",
"i < r",
"i",
"r",
"i++",
"i++",
"i",
"{\n \t\t\tsum += rc[i][j];\n \t\t}",
"{\n \t\t\tsum += rc[i][j];\n \t\t}",
"sum += rc[i][j]",
"sum",
"rc[i][j]",
"rc[i]",
"rc",
"i",
"j",
"System.out.print(sum + \" \")",
"System.out.print",
"System.out",
"System",
"System.out",
"sum + \" \"",
"sum",
"\" \"",
"sum2 += sum",
"sum2",
"sum",
"sum = 0",
"sum",
"0",
"System.out.println(sum2)",
"System.out.println",
"System.out",
"System",
"System.out",
"sum2",
"String[] args",
"args",
"public class Main {\n public static Scanner sc = new Scanner(System.in);\n public static void main(String[] args) throws Exception {\n \tint i, j;\n \tint sum = 0, sum2 = 0;\n \tint r = sc.nextInt();\n \tint c = sc.nextInt();\n \tint rc[][] = new int[r][c];\n \t\t\n \tfor(i = 0; i < r; i++) {\n \t\tfor(j = 0; j < c; j++) {\n \t\t\trc[i][j] = sc.nextInt();\n \t\t\tsum += rc[i][j];\n \t\t\tSystem.out.print(rc[i][j] + \" \");\n \t\t}\n \t\tSystem.out.println(sum);\n \t\tsum = 0;\n \t}\n \tfor(j = 0; j < c; j++) {\n \t\tfor(i = 0; i < r; i++) {\n \t\t\tsum += rc[i][j];\n \t\t}\n \t\tSystem.out.print(sum + \" \");\n \t\tsum2 += sum;\n \t\tsum = 0;\n \t}\n \tSystem.out.println(sum2);\n }\n}",
"public class Main {\n public static Scanner sc = new Scanner(System.in);\n public static void main(String[] args) throws Exception {\n \tint i, j;\n \tint sum = 0, sum2 = 0;\n \tint r = sc.nextInt();\n \tint c = sc.nextInt();\n \tint rc[][] = new int[r][c];\n \t\t\n \tfor(i = 0; i < r; i++) {\n \t\tfor(j = 0; j < c; j++) {\n \t\t\trc[i][j] = sc.nextInt();\n \t\t\tsum += rc[i][j];\n \t\t\tSystem.out.print(rc[i][j] + \" \");\n \t\t}\n \t\tSystem.out.println(sum);\n \t\tsum = 0;\n \t}\n \tfor(j = 0; j < c; j++) {\n \t\tfor(i = 0; i < r; i++) {\n \t\t\tsum += rc[i][j];\n \t\t}\n \t\tSystem.out.print(sum + \" \");\n \t\tsum2 += sum;\n \t\tsum = 0;\n \t}\n \tSystem.out.println(sum2);\n }\n}",
"Main"
] | import java.util.*;
public class Main {
public static Scanner sc = new Scanner(System.in);
public static void main(String[] args) throws Exception {
int i, j;
int sum = 0, sum2 = 0;
int r = sc.nextInt();
int c = sc.nextInt();
int rc[][] = new int[r][c];
for(i = 0; i < r; i++) {
for(j = 0; j < c; j++) {
rc[i][j] = sc.nextInt();
sum += rc[i][j];
System.out.print(rc[i][j] + " ");
}
System.out.println(sum);
sum = 0;
}
for(j = 0; j < c; j++) {
for(i = 0; i < r; i++) {
sum += rc[i][j];
}
System.out.print(sum + " ");
sum2 += sum;
sum = 0;
}
System.out.println(sum2);
}
}
|
[
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,
41,
13,
4,
18,
13,
0,
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,
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,
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
],
[
180,
5
],
[
180,
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
],
[
60,
62
],
[
62,
63
],
[
63,
64
],
[
59,
65
],
[
65,
66
],
[
65,
67
],
[
59,
68
],
[
68,
69
],
[
69,
70
],
[
70,
71
],
[
70,
72
],
[
69,
73
],
[
68,
74
],
[
43,
75
],
[
75,
76
],
[
76,
77
],
[
77,
78
],
[
77,
79
],
[
76,
80
],
[
75,
81
],
[
8,
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
],
[
97,
99
],
[
96,
100
],
[
100,
101
],
[
101,
102
],
[
102,
103
],
[
102,
104
],
[
100,
105
],
[
105,
106
],
[
105,
107
],
[
100,
108
],
[
108,
109
],
[
109,
110
],
[
100,
111
],
[
112,
112
],
[
112,
113
],
[
113,
114
],
[
113,
115
],
[
115,
116
],
[
116,
117
],
[
116,
118
],
[
115,
119
],
[
96,
120
],
[
120,
121
],
[
121,
122
],
[
122,
123
],
[
122,
124
],
[
121,
125
],
[
120,
126
],
[
8,
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
],
[
155,
160
],
[
160,
161
],
[
161,
162
],
[
162,
163
],
[
162,
164
],
[
161,
165
],
[
160,
166
],
[
141,
167
],
[
167,
168
],
[
168,
169
],
[
169,
170
],
[
169,
171
],
[
167,
172
],
[
172,
173
],
[
173,
174
],
[
173,
175
],
[
172,
176
],
[
6,
177
],
[
177,
178
],
[
0,
179
],
[
179,
180
],
[
179,
181
]
] | [
"import java.util.Scanner;\npublic class Main {\n\tpublic static void main(String[] args) {\n\t\tScanner stdIn = new Scanner(System.in);\n\t\t\n\t\tint r = stdIn.nextInt();\n\t\tint c = stdIn.nextInt();\n\t\t\n\t\tint[][] h = new int[r+1][c+1];\n\t\t\n\t\tfor(int i = 0; i < r; i++) {\n\t\t\tint rsum = 0;\n\t\t\tfor(int j = 0; j < c; j++) {\n\t\t\t\tint tmp = stdIn.nextInt();\n\t\t\t\trsum += tmp;\n\t\t\t\th[i][j] = tmp;\n\t\t\t}\n\t\t\th[i][c] = rsum;\n\t\t}\n\t\t\n\t\tfor(int i = 0; i < c+1; i++) {\n\t\t\tint rsum = 0;\n\t\t\tfor(int j = 0; j < r; j++) {\n\t\t\t\trsum += h[j][i];\n\t\t\t}\n\t\t\th[r][i] = rsum;\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; j++) {\n\t\t\t\tSystem.out.print(h[i][j] + \" \");\n\t\t\t}\n\t\t\tSystem.out.println(h[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\tScanner stdIn = new Scanner(System.in);\n\t\t\n\t\tint r = stdIn.nextInt();\n\t\tint c = stdIn.nextInt();\n\t\t\n\t\tint[][] h = new int[r+1][c+1];\n\t\t\n\t\tfor(int i = 0; i < r; i++) {\n\t\t\tint rsum = 0;\n\t\t\tfor(int j = 0; j < c; j++) {\n\t\t\t\tint tmp = stdIn.nextInt();\n\t\t\t\trsum += tmp;\n\t\t\t\th[i][j] = tmp;\n\t\t\t}\n\t\t\th[i][c] = rsum;\n\t\t}\n\t\t\n\t\tfor(int i = 0; i < c+1; i++) {\n\t\t\tint rsum = 0;\n\t\t\tfor(int j = 0; j < r; j++) {\n\t\t\t\trsum += h[j][i];\n\t\t\t}\n\t\t\th[r][i] = rsum;\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; j++) {\n\t\t\t\tSystem.out.print(h[i][j] + \" \");\n\t\t\t}\n\t\t\tSystem.out.println(h[i][c]);\n\t\t}\n\t}\n}",
"Main",
"public static void main(String[] args) {\n\t\tScanner stdIn = new Scanner(System.in);\n\t\t\n\t\tint r = stdIn.nextInt();\n\t\tint c = stdIn.nextInt();\n\t\t\n\t\tint[][] h = new int[r+1][c+1];\n\t\t\n\t\tfor(int i = 0; i < r; i++) {\n\t\t\tint rsum = 0;\n\t\t\tfor(int j = 0; j < c; j++) {\n\t\t\t\tint tmp = stdIn.nextInt();\n\t\t\t\trsum += tmp;\n\t\t\t\th[i][j] = tmp;\n\t\t\t}\n\t\t\th[i][c] = rsum;\n\t\t}\n\t\t\n\t\tfor(int i = 0; i < c+1; i++) {\n\t\t\tint rsum = 0;\n\t\t\tfor(int j = 0; j < r; j++) {\n\t\t\t\trsum += h[j][i];\n\t\t\t}\n\t\t\th[r][i] = rsum;\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; j++) {\n\t\t\t\tSystem.out.print(h[i][j] + \" \");\n\t\t\t}\n\t\t\tSystem.out.println(h[i][c]);\n\t\t}\n\t}",
"main",
"{\n\t\tScanner stdIn = new Scanner(System.in);\n\t\t\n\t\tint r = stdIn.nextInt();\n\t\tint c = stdIn.nextInt();\n\t\t\n\t\tint[][] h = new int[r+1][c+1];\n\t\t\n\t\tfor(int i = 0; i < r; i++) {\n\t\t\tint rsum = 0;\n\t\t\tfor(int j = 0; j < c; j++) {\n\t\t\t\tint tmp = stdIn.nextInt();\n\t\t\t\trsum += tmp;\n\t\t\t\th[i][j] = tmp;\n\t\t\t}\n\t\t\th[i][c] = rsum;\n\t\t}\n\t\t\n\t\tfor(int i = 0; i < c+1; i++) {\n\t\t\tint rsum = 0;\n\t\t\tfor(int j = 0; j < r; j++) {\n\t\t\t\trsum += h[j][i];\n\t\t\t}\n\t\t\th[r][i] = rsum;\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; j++) {\n\t\t\t\tSystem.out.print(h[i][j] + \" \");\n\t\t\t}\n\t\t\tSystem.out.println(h[i][c]);\n\t\t}\n\t}",
"Scanner stdIn = new Scanner(System.in);",
"stdIn",
"new Scanner(System.in)",
"int r = stdIn.nextInt();",
"r",
"stdIn.nextInt()",
"stdIn.nextInt",
"stdIn",
"int c = stdIn.nextInt();",
"c",
"stdIn.nextInt()",
"stdIn.nextInt",
"stdIn",
"int[][] 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\t\t\tint rsum = 0;\n\t\t\tfor(int j = 0; j < c; j++) {\n\t\t\t\tint tmp = stdIn.nextInt();\n\t\t\t\trsum += tmp;\n\t\t\t\th[i][j] = tmp;\n\t\t\t}\n\t\t\th[i][c] = rsum;\n\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < r",
"i",
"r",
"i++",
"i++",
"i",
"{\n\t\t\tint rsum = 0;\n\t\t\tfor(int j = 0; j < c; j++) {\n\t\t\t\tint tmp = stdIn.nextInt();\n\t\t\t\trsum += tmp;\n\t\t\t\th[i][j] = tmp;\n\t\t\t}\n\t\t\th[i][c] = rsum;\n\t\t}",
"{\n\t\t\tint rsum = 0;\n\t\t\tfor(int j = 0; j < c; j++) {\n\t\t\t\tint tmp = stdIn.nextInt();\n\t\t\t\trsum += tmp;\n\t\t\t\th[i][j] = tmp;\n\t\t\t}\n\t\t\th[i][c] = rsum;\n\t\t}",
"int rsum = 0;",
"rsum",
"0",
"for(int j = 0; j < c; j++) {\n\t\t\t\tint tmp = stdIn.nextInt();\n\t\t\t\trsum += tmp;\n\t\t\t\th[i][j] = tmp;\n\t\t\t}",
"int j = 0;",
"int j = 0;",
"j",
"0",
"j < c",
"j",
"c",
"j++",
"j++",
"j",
"{\n\t\t\t\tint tmp = stdIn.nextInt();\n\t\t\t\trsum += tmp;\n\t\t\t\th[i][j] = tmp;\n\t\t\t}",
"{\n\t\t\t\tint tmp = stdIn.nextInt();\n\t\t\t\trsum += tmp;\n\t\t\t\th[i][j] = tmp;\n\t\t\t}",
"int tmp = stdIn.nextInt();",
"tmp",
"stdIn.nextInt()",
"stdIn.nextInt",
"stdIn",
"rsum += tmp",
"rsum",
"tmp",
"h[i][j] = tmp",
"h[i][j]",
"h[i]",
"h",
"i",
"j",
"tmp",
"h[i][c] = rsum",
"h[i][c]",
"h[i]",
"h",
"i",
"c",
"rsum",
"for(int i = 0; i < c+1; i++) {\n\t\t\tint rsum = 0;\n\t\t\tfor(int j = 0; j < r; j++) {\n\t\t\t\trsum += h[j][i];\n\t\t\t}\n\t\t\th[r][i] = rsum;\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 rsum = 0;\n\t\t\tfor(int j = 0; j < r; j++) {\n\t\t\t\trsum += h[j][i];\n\t\t\t}\n\t\t\th[r][i] = rsum;\n\t\t}",
"{\n\t\t\tint rsum = 0;\n\t\t\tfor(int j = 0; j < r; j++) {\n\t\t\t\trsum += h[j][i];\n\t\t\t}\n\t\t\th[r][i] = rsum;\n\t\t}",
"int rsum = 0;",
"rsum",
"0",
"for(int j = 0; j < r; j++) {\n\t\t\t\trsum += h[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\trsum += h[j][i];\n\t\t\t}",
"{\n\t\t\t\trsum += h[j][i];\n\t\t\t}",
"rsum += h[j][i]",
"rsum",
"h[j][i]",
"h[j]",
"h",
"j",
"i",
"h[r][i] = rsum",
"h[r][i]",
"h[r]",
"h",
"r",
"i",
"rsum",
"for(int i = 0; i < r+1; i++) {\n\t\t\tfor(int j = 0; j < c; j++) {\n\t\t\t\tSystem.out.print(h[i][j] + \" \");\n\t\t\t}\n\t\t\tSystem.out.println(h[i][c]);\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.print(h[i][j] + \" \");\n\t\t\t}\n\t\t\tSystem.out.println(h[i][c]);\n\t\t}",
"{\n\t\t\tfor(int j = 0; j < c; j++) {\n\t\t\t\tSystem.out.print(h[i][j] + \" \");\n\t\t\t}\n\t\t\tSystem.out.println(h[i][c]);\n\t\t}",
"for(int j = 0; j < c; j++) {\n\t\t\t\tSystem.out.print(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\tSystem.out.print(h[i][j] + \" \");\n\t\t\t}",
"{\n\t\t\t\tSystem.out.print(h[i][j] + \" \");\n\t\t\t}",
"System.out.print(h[i][j] + \" \")",
"System.out.print",
"System.out",
"System",
"System.out",
"h[i][j] + \" \"",
"h[i][j]",
"h[i]",
"h",
"i",
"j",
"\" \"",
"System.out.println(h[i][c])",
"System.out.println",
"System.out",
"System",
"System.out",
"h[i][c]",
"h[i]",
"h",
"i",
"c",
"String[] args",
"args",
"public class Main {\n\tpublic static void main(String[] args) {\n\t\tScanner stdIn = new Scanner(System.in);\n\t\t\n\t\tint r = stdIn.nextInt();\n\t\tint c = stdIn.nextInt();\n\t\t\n\t\tint[][] h = new int[r+1][c+1];\n\t\t\n\t\tfor(int i = 0; i < r; i++) {\n\t\t\tint rsum = 0;\n\t\t\tfor(int j = 0; j < c; j++) {\n\t\t\t\tint tmp = stdIn.nextInt();\n\t\t\t\trsum += tmp;\n\t\t\t\th[i][j] = tmp;\n\t\t\t}\n\t\t\th[i][c] = rsum;\n\t\t}\n\t\t\n\t\tfor(int i = 0; i < c+1; i++) {\n\t\t\tint rsum = 0;\n\t\t\tfor(int j = 0; j < r; j++) {\n\t\t\t\trsum += h[j][i];\n\t\t\t}\n\t\t\th[r][i] = rsum;\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; j++) {\n\t\t\t\tSystem.out.print(h[i][j] + \" \");\n\t\t\t}\n\t\t\tSystem.out.println(h[i][c]);\n\t\t}\n\t}\n}",
"public class Main {\n\tpublic static void main(String[] args) {\n\t\tScanner stdIn = new Scanner(System.in);\n\t\t\n\t\tint r = stdIn.nextInt();\n\t\tint c = stdIn.nextInt();\n\t\t\n\t\tint[][] h = new int[r+1][c+1];\n\t\t\n\t\tfor(int i = 0; i < r; i++) {\n\t\t\tint rsum = 0;\n\t\t\tfor(int j = 0; j < c; j++) {\n\t\t\t\tint tmp = stdIn.nextInt();\n\t\t\t\trsum += tmp;\n\t\t\t\th[i][j] = tmp;\n\t\t\t}\n\t\t\th[i][c] = rsum;\n\t\t}\n\t\t\n\t\tfor(int i = 0; i < c+1; i++) {\n\t\t\tint rsum = 0;\n\t\t\tfor(int j = 0; j < r; j++) {\n\t\t\t\trsum += h[j][i];\n\t\t\t}\n\t\t\th[r][i] = rsum;\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; j++) {\n\t\t\t\tSystem.out.print(h[i][j] + \" \");\n\t\t\t}\n\t\t\tSystem.out.println(h[i][c]);\n\t\t}\n\t}\n}",
"Main"
] | import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner stdIn = new Scanner(System.in);
int r = stdIn.nextInt();
int c = stdIn.nextInt();
int[][] h = new int[r+1][c+1];
for(int i = 0; i < r; i++) {
int rsum = 0;
for(int j = 0; j < c; j++) {
int tmp = stdIn.nextInt();
rsum += tmp;
h[i][j] = tmp;
}
h[i][c] = rsum;
}
for(int i = 0; i < c+1; i++) {
int rsum = 0;
for(int j = 0; j < r; j++) {
rsum += h[j][i];
}
h[r][i] = rsum;
}
for(int i = 0; i < r+1; i++) {
for(int j = 0; j < c; j++) {
System.out.print(h[i][j] + " ");
}
System.out.println(h[i][c]);
}
}
} |
[
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,
41,
13,
20,
41,
13,
20,
11,
1,
41,
13,
17,
2,
13,
17,
1,
40,
13,
30,
30,
4,
18,
13,
4,
18,
13,
0,
13,
4,
18,
13,
17,
0,
13,
4,
18,
13,
17,
14,
2,
2,
2,
2,
13,
17,
2,
13,
17,
2,
13,
17,
2,
13,
17,
30,
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,
18,
18,
13,
13,
13,
17,
11,
1,
0,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
11,
1,
0,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
18,
18,
13,
13,
13,
4,
18,
13,
0,
18,
18,
13,
13,
13,
18,
18,
13,
13,
13,
0,
18,
18,
13,
13,
13,
18,
18,
13,
13,
13,
0,
18,
18,
13,
13,
13,
18,
18,
13,
13,
13,
11,
1,
0,
13,
17,
2,
13,
2,
13,
17,
1,
40,
13,
30,
30,
11,
1,
0,
13,
17,
2,
13,
2,
13,
17,
1,
40,
13,
30,
30,
4,
18,
18,
13,
13,
18,
18,
13,
13,
13,
14,
2,
13,
13,
30,
4,
18,
18,
13,
13,
17,
4,
18,
18,
13,
13,
17,
4,
18,
13,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
254,
11
],
[
254,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
15,
17
],
[
14,
18
],
[
18,
19
],
[
18,
20
],
[
14,
21
],
[
21,
22
],
[
21,
23
],
[
14,
24
],
[
24,
25
],
[
24,
26
],
[
14,
27
],
[
27,
28
],
[
27,
29
],
[
14,
30
],
[
30,
31
],
[
30,
32
],
[
14,
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
],
[
46,
49
],
[
49,
50
],
[
50,
51
],
[
14,
52
],
[
52,
53
],
[
52,
54
],
[
54,
55
],
[
55,
56
],
[
54,
57
],
[
14,
58
],
[
58,
59
],
[
58,
60
],
[
60,
61
],
[
61,
62
],
[
60,
63
],
[
14,
64
],
[
64,
65
],
[
67,
66
],
[
74,
67
],
[
67,
68
],
[
68,
69
],
[
68,
70
],
[
67,
71
],
[
71,
72
],
[
71,
73
],
[
74,
74
],
[
74,
75
],
[
74,
76
],
[
67,
77
],
[
77,
78
],
[
77,
79
],
[
64,
80
],
[
80,
81
],
[
81,
82
],
[
81,
83
],
[
84,
85
],
[
84,
86
],
[
87,
88
],
[
87,
89
],
[
80,
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
],
[
80,
123
],
[
123,
124
],
[
124,
125
],
[
125,
126
],
[
125,
127
],
[
123,
128
],
[
128,
129
],
[
128,
130
],
[
123,
131
],
[
131,
132
],
[
132,
133
],
[
123,
134
],
[
135,
135
],
[
135,
136
],
[
136,
137
],
[
137,
138
],
[
138,
139
],
[
138,
140
],
[
136,
141
],
[
141,
142
],
[
141,
143
],
[
136,
144
],
[
144,
145
],
[
145,
146
],
[
136,
147
],
[
148,
148
],
[
148,
149
],
[
149,
150
],
[
150,
151
],
[
151,
152
],
[
151,
153
],
[
150,
154
],
[
149,
155
],
[
155,
156
],
[
156,
157
],
[
148,
158
],
[
158,
159
],
[
159,
160
],
[
160,
161
],
[
160,
162
],
[
159,
163
],
[
158,
164
],
[
164,
165
],
[
165,
166
],
[
165,
167
],
[
164,
168
],
[
148,
169
],
[
169,
170
],
[
170,
171
],
[
171,
172
],
[
171,
173
],
[
170,
174
],
[
169,
175
],
[
175,
176
],
[
176,
177
],
[
176,
178
],
[
175,
179
],
[
148,
180
],
[
180,
181
],
[
181,
182
],
[
182,
183
],
[
182,
184
],
[
181,
185
],
[
180,
186
],
[
186,
187
],
[
187,
188
],
[
187,
189
],
[
186,
190
],
[
80,
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
],
[
205,
242
],
[
242,
243
],
[
243,
244
],
[
244,
245
],
[
244,
246
],
[
242,
247
],
[
14,
248
],
[
248,
249
],
[
249,
250
],
[
12,
251
],
[
251,
252
],
[
0,
253
],
[
253,
254
],
[
253,
255
]
] | [
"import java.io.IOException;\nimport java.util.ArrayList;\nimport java.util.Scanner;\n\npublic class Main {\n\n\tpublic static void main(String[] args) throws IOException {\n\t\tint r = 0, c = 0;\n\t\tint i = 0, j = 0;\n\t\tArrayList<Integer> elements = new ArrayList<Integer>();\n\n\t\tScanner sc = new Scanner(System.in);\n\t\tfor (int t = 0; t < 2; ++t) {\n\t\t\telements.add(sc.nextInt()); // ?????????????´???°?±????\n\t\t}\n\t\tr = elements.get(0);\n\t\tc = elements.get(1);\n\t\tif (r >= 1 && r <= 100 && c >= 1 && c <= 100) { // ??¶?´??????¶\n\t\t\tint[][] mat = new int[r + 1][c + 1]; // ?¨?????????????????????????????????????????????¨???????????????[r+1][c+1]\n\t\t\tfor (i = 0; i < r; ++i) {\n\t\t\t\tfor (j = 0; j < c; ++j) {\n\t\t\t\t\tmat[i][j] = 0; // ??????????????????\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tfor (i = 0; i < r; ++i) {\n\t\t\t\tfor (j = 0; j < c; ++j) {\n\t\t\t\t\tmat[i][j] = sc.nextInt(); // ????´????????????????\n\t\t\t\t\tmat[i][c] += mat[i][j]; // ???????????????????????????\n\t\t\t\t\tmat[r][j] += mat[i][j]; // ??????????????????\n\t\t\t\t\tmat[r][c] += mat[i][j]; // ?????????????¨?\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor (i = 0; i < r + 1; ++i) {\n\t\t\t\tfor (j = 0; j < c + 1; ++j) {\n\t\t\t\t\tSystem.out.print(mat[i][j]);\n\t\t\t\t\tif (j != c) { // ?????????????????????????????????AOJ??§?????¬?????????????????§?????¨??????????????????????????????\n\t\t\t\t\t\tSystem.out.print(\" \");\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}\n\t\tsc.close();\n\t}\n\n}",
"import java.io.IOException;",
"IOException",
"java.io",
"import java.util.ArrayList;",
"ArrayList",
"java.util",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n\n\tpublic static void main(String[] args) throws IOException {\n\t\tint r = 0, c = 0;\n\t\tint i = 0, j = 0;\n\t\tArrayList<Integer> elements = new ArrayList<Integer>();\n\n\t\tScanner sc = new Scanner(System.in);\n\t\tfor (int t = 0; t < 2; ++t) {\n\t\t\telements.add(sc.nextInt()); // ?????????????´???°?±????\n\t\t}\n\t\tr = elements.get(0);\n\t\tc = elements.get(1);\n\t\tif (r >= 1 && r <= 100 && c >= 1 && c <= 100) { // ??¶?´??????¶\n\t\t\tint[][] mat = new int[r + 1][c + 1]; // ?¨?????????????????????????????????????????????¨???????????????[r+1][c+1]\n\t\t\tfor (i = 0; i < r; ++i) {\n\t\t\t\tfor (j = 0; j < c; ++j) {\n\t\t\t\t\tmat[i][j] = 0; // ??????????????????\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tfor (i = 0; i < r; ++i) {\n\t\t\t\tfor (j = 0; j < c; ++j) {\n\t\t\t\t\tmat[i][j] = sc.nextInt(); // ????´????????????????\n\t\t\t\t\tmat[i][c] += mat[i][j]; // ???????????????????????????\n\t\t\t\t\tmat[r][j] += mat[i][j]; // ??????????????????\n\t\t\t\t\tmat[r][c] += mat[i][j]; // ?????????????¨?\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor (i = 0; i < r + 1; ++i) {\n\t\t\t\tfor (j = 0; j < c + 1; ++j) {\n\t\t\t\t\tSystem.out.print(mat[i][j]);\n\t\t\t\t\tif (j != c) { // ?????????????????????????????????AOJ??§?????¬?????????????????§?????¨??????????????????????????????\n\t\t\t\t\t\tSystem.out.print(\" \");\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}\n\t\tsc.close();\n\t}\n\n}",
"Main",
"public static void main(String[] args) throws IOException {\n\t\tint r = 0, c = 0;\n\t\tint i = 0, j = 0;\n\t\tArrayList<Integer> elements = new ArrayList<Integer>();\n\n\t\tScanner sc = new Scanner(System.in);\n\t\tfor (int t = 0; t < 2; ++t) {\n\t\t\telements.add(sc.nextInt()); // ?????????????´???°?±????\n\t\t}\n\t\tr = elements.get(0);\n\t\tc = elements.get(1);\n\t\tif (r >= 1 && r <= 100 && c >= 1 && c <= 100) { // ??¶?´??????¶\n\t\t\tint[][] mat = new int[r + 1][c + 1]; // ?¨?????????????????????????????????????????????¨???????????????[r+1][c+1]\n\t\t\tfor (i = 0; i < r; ++i) {\n\t\t\t\tfor (j = 0; j < c; ++j) {\n\t\t\t\t\tmat[i][j] = 0; // ??????????????????\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tfor (i = 0; i < r; ++i) {\n\t\t\t\tfor (j = 0; j < c; ++j) {\n\t\t\t\t\tmat[i][j] = sc.nextInt(); // ????´????????????????\n\t\t\t\t\tmat[i][c] += mat[i][j]; // ???????????????????????????\n\t\t\t\t\tmat[r][j] += mat[i][j]; // ??????????????????\n\t\t\t\t\tmat[r][c] += mat[i][j]; // ?????????????¨?\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor (i = 0; i < r + 1; ++i) {\n\t\t\t\tfor (j = 0; j < c + 1; ++j) {\n\t\t\t\t\tSystem.out.print(mat[i][j]);\n\t\t\t\t\tif (j != c) { // ?????????????????????????????????AOJ??§?????¬?????????????????§?????¨??????????????????????????????\n\t\t\t\t\t\tSystem.out.print(\" \");\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}\n\t\tsc.close();\n\t}",
"main",
"{\n\t\tint r = 0, c = 0;\n\t\tint i = 0, j = 0;\n\t\tArrayList<Integer> elements = new ArrayList<Integer>();\n\n\t\tScanner sc = new Scanner(System.in);\n\t\tfor (int t = 0; t < 2; ++t) {\n\t\t\telements.add(sc.nextInt()); // ?????????????´???°?±????\n\t\t}\n\t\tr = elements.get(0);\n\t\tc = elements.get(1);\n\t\tif (r >= 1 && r <= 100 && c >= 1 && c <= 100) { // ??¶?´??????¶\n\t\t\tint[][] mat = new int[r + 1][c + 1]; // ?¨?????????????????????????????????????????????¨???????????????[r+1][c+1]\n\t\t\tfor (i = 0; i < r; ++i) {\n\t\t\t\tfor (j = 0; j < c; ++j) {\n\t\t\t\t\tmat[i][j] = 0; // ??????????????????\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tfor (i = 0; i < r; ++i) {\n\t\t\t\tfor (j = 0; j < c; ++j) {\n\t\t\t\t\tmat[i][j] = sc.nextInt(); // ????´????????????????\n\t\t\t\t\tmat[i][c] += mat[i][j]; // ???????????????????????????\n\t\t\t\t\tmat[r][j] += mat[i][j]; // ??????????????????\n\t\t\t\t\tmat[r][c] += mat[i][j]; // ?????????????¨?\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor (i = 0; i < r + 1; ++i) {\n\t\t\t\tfor (j = 0; j < c + 1; ++j) {\n\t\t\t\t\tSystem.out.print(mat[i][j]);\n\t\t\t\t\tif (j != c) { // ?????????????????????????????????AOJ??§?????¬?????????????????§?????¨??????????????????????????????\n\t\t\t\t\t\tSystem.out.print(\" \");\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}\n\t\tsc.close();\n\t}",
"int r = 0",
"r",
"0",
"c = 0;",
"c",
"0",
"int i = 0",
"i",
"0",
"j = 0;",
"j",
"0",
"ArrayList<Integer> elements = new ArrayList<Integer>();",
"elements",
"new ArrayList<Integer>()",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"for (int t = 0; t < 2; ++t) {\n\t\t\telements.add(sc.nextInt()); // ?????????????´???°?±????\n\t\t}",
"int t = 0;",
"int t = 0;",
"t",
"0",
"t < 2",
"t",
"2",
"++t",
"++t",
"t",
"{\n\t\t\telements.add(sc.nextInt()); // ?????????????´???°?±????\n\t\t}",
"{\n\t\t\telements.add(sc.nextInt()); // ?????????????´???°?±????\n\t\t}",
"elements.add(sc.nextInt())",
"elements.add",
"elements",
"sc.nextInt()",
"sc.nextInt",
"sc",
"r = elements.get(0)",
"r",
"elements.get(0)",
"elements.get",
"elements",
"0",
"c = elements.get(1)",
"c",
"elements.get(1)",
"elements.get",
"elements",
"1",
"if (r >= 1 && r <= 100 && c >= 1 && c <= 100) { // ??¶?´??????¶\n\t\t\tint[][] mat = new int[r + 1][c + 1]; // ?¨?????????????????????????????????????????????¨???????????????[r+1][c+1]\n\t\t\tfor (i = 0; i < r; ++i) {\n\t\t\t\tfor (j = 0; j < c; ++j) {\n\t\t\t\t\tmat[i][j] = 0; // ??????????????????\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tfor (i = 0; i < r; ++i) {\n\t\t\t\tfor (j = 0; j < c; ++j) {\n\t\t\t\t\tmat[i][j] = sc.nextInt(); // ????´????????????????\n\t\t\t\t\tmat[i][c] += mat[i][j]; // ???????????????????????????\n\t\t\t\t\tmat[r][j] += mat[i][j]; // ??????????????????\n\t\t\t\t\tmat[r][c] += mat[i][j]; // ?????????????¨?\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor (i = 0; i < r + 1; ++i) {\n\t\t\t\tfor (j = 0; j < c + 1; ++j) {\n\t\t\t\t\tSystem.out.print(mat[i][j]);\n\t\t\t\t\tif (j != c) { // ?????????????????????????????????AOJ??§?????¬?????????????????§?????¨??????????????????????????????\n\t\t\t\t\t\tSystem.out.print(\" \");\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}",
"r >= 1 && r <= 100 && c >= 1 && c <= 100",
"c >= 1",
"r >= 1 && r <= 100 && c >= 1 && c <= 100",
"r >= 1",
"r",
"1",
"r <= 100",
"r",
"100",
"c >= 1",
"c",
"1",
"c <= 100",
"c",
"100",
"{ // ??¶?´??????¶\n\t\t\tint[][] mat = new int[r + 1][c + 1]; // ?¨?????????????????????????????????????????????¨???????????????[r+1][c+1]\n\t\t\tfor (i = 0; i < r; ++i) {\n\t\t\t\tfor (j = 0; j < c; ++j) {\n\t\t\t\t\tmat[i][j] = 0; // ??????????????????\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tfor (i = 0; i < r; ++i) {\n\t\t\t\tfor (j = 0; j < c; ++j) {\n\t\t\t\t\tmat[i][j] = sc.nextInt(); // ????´????????????????\n\t\t\t\t\tmat[i][c] += mat[i][j]; // ???????????????????????????\n\t\t\t\t\tmat[r][j] += mat[i][j]; // ??????????????????\n\t\t\t\t\tmat[r][c] += mat[i][j]; // ?????????????¨?\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor (i = 0; i < r + 1; ++i) {\n\t\t\t\tfor (j = 0; j < c + 1; ++j) {\n\t\t\t\t\tSystem.out.print(mat[i][j]);\n\t\t\t\t\tif (j != c) { // ?????????????????????????????????AOJ??§?????¬?????????????????§?????¨??????????????????????????????\n\t\t\t\t\t\tSystem.out.print(\" \");\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}",
"int[][] mat = new int[r + 1][c + 1];",
"mat",
"new int[r + 1][c + 1]",
"r + 1",
"r",
"1",
"c + 1",
"c",
"1",
"for (i = 0; i < r; ++i) {\n\t\t\t\tfor (j = 0; j < c; ++j) {\n\t\t\t\t\tmat[i][j] = 0; // ??????????????????\n\t\t\t\t}\n\t\t\t}",
"i = 0;",
"i = 0",
"i",
"0",
"i < r",
"i",
"r",
"++i",
"++i",
"i",
"{\n\t\t\t\tfor (j = 0; j < c; ++j) {\n\t\t\t\t\tmat[i][j] = 0; // ??????????????????\n\t\t\t\t}\n\t\t\t}",
"{\n\t\t\t\tfor (j = 0; j < c; ++j) {\n\t\t\t\t\tmat[i][j] = 0; // ??????????????????\n\t\t\t\t}\n\t\t\t}",
"for (j = 0; j < c; ++j) {\n\t\t\t\t\tmat[i][j] = 0; // ??????????????????\n\t\t\t\t}",
"j = 0;",
"j = 0",
"j",
"0",
"j < c",
"j",
"c",
"++j",
"++j",
"j",
"{\n\t\t\t\t\tmat[i][j] = 0; // ??????????????????\n\t\t\t\t}",
"{\n\t\t\t\t\tmat[i][j] = 0; // ??????????????????\n\t\t\t\t}",
"mat[i][j] = 0",
"mat[i][j]",
"mat[i]",
"mat",
"i",
"j",
"0",
"for (i = 0; i < r; ++i) {\n\t\t\t\tfor (j = 0; j < c; ++j) {\n\t\t\t\t\tmat[i][j] = sc.nextInt(); // ????´????????????????\n\t\t\t\t\tmat[i][c] += mat[i][j]; // ???????????????????????????\n\t\t\t\t\tmat[r][j] += mat[i][j]; // ??????????????????\n\t\t\t\t\tmat[r][c] += mat[i][j]; // ?????????????¨?\n\t\t\t\t}\n\t\t\t}",
"i = 0;",
"i = 0",
"i",
"0",
"i < r",
"i",
"r",
"++i",
"++i",
"i",
"{\n\t\t\t\tfor (j = 0; j < c; ++j) {\n\t\t\t\t\tmat[i][j] = sc.nextInt(); // ????´????????????????\n\t\t\t\t\tmat[i][c] += mat[i][j]; // ???????????????????????????\n\t\t\t\t\tmat[r][j] += mat[i][j]; // ??????????????????\n\t\t\t\t\tmat[r][c] += mat[i][j]; // ?????????????¨?\n\t\t\t\t}\n\t\t\t}",
"{\n\t\t\t\tfor (j = 0; j < c; ++j) {\n\t\t\t\t\tmat[i][j] = sc.nextInt(); // ????´????????????????\n\t\t\t\t\tmat[i][c] += mat[i][j]; // ???????????????????????????\n\t\t\t\t\tmat[r][j] += mat[i][j]; // ??????????????????\n\t\t\t\t\tmat[r][c] += mat[i][j]; // ?????????????¨?\n\t\t\t\t}\n\t\t\t}",
"for (j = 0; j < c; ++j) {\n\t\t\t\t\tmat[i][j] = sc.nextInt(); // ????´????????????????\n\t\t\t\t\tmat[i][c] += mat[i][j]; // ???????????????????????????\n\t\t\t\t\tmat[r][j] += mat[i][j]; // ??????????????????\n\t\t\t\t\tmat[r][c] += mat[i][j]; // ?????????????¨?\n\t\t\t\t}",
"j = 0;",
"j = 0",
"j",
"0",
"j < c",
"j",
"c",
"++j",
"++j",
"j",
"{\n\t\t\t\t\tmat[i][j] = sc.nextInt(); // ????´????????????????\n\t\t\t\t\tmat[i][c] += mat[i][j]; // ???????????????????????????\n\t\t\t\t\tmat[r][j] += mat[i][j]; // ??????????????????\n\t\t\t\t\tmat[r][c] += mat[i][j]; // ?????????????¨?\n\t\t\t\t}",
"{\n\t\t\t\t\tmat[i][j] = sc.nextInt(); // ????´????????????????\n\t\t\t\t\tmat[i][c] += mat[i][j]; // ???????????????????????????\n\t\t\t\t\tmat[r][j] += mat[i][j]; // ??????????????????\n\t\t\t\t\tmat[r][c] += mat[i][j]; // ?????????????¨?\n\t\t\t\t}",
"mat[i][j] = sc.nextInt()",
"mat[i][j]",
"mat[i]",
"mat",
"i",
"j",
"sc.nextInt()",
"sc.nextInt",
"sc",
"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 (i = 0; i < r + 1; ++i) {\n\t\t\t\tfor (j = 0; j < c + 1; ++j) {\n\t\t\t\t\tSystem.out.print(mat[i][j]);\n\t\t\t\t\tif (j != c) { // ?????????????????????????????????AOJ??§?????¬?????????????????§?????¨??????????????????????????????\n\t\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tSystem.out.println(\"\");\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\tfor (j = 0; j < c + 1; ++j) {\n\t\t\t\t\tSystem.out.print(mat[i][j]);\n\t\t\t\t\tif (j != c) { // ?????????????????????????????????AOJ??§?????¬?????????????????§?????¨??????????????????????????????\n\t\t\t\t\t\tSystem.out.print(\" \");\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 (j = 0; j < c + 1; ++j) {\n\t\t\t\t\tSystem.out.print(mat[i][j]);\n\t\t\t\t\tif (j != c) { // ?????????????????????????????????AOJ??§?????¬?????????????????§?????¨??????????????????????????????\n\t\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tSystem.out.println(\"\");\n\t\t\t}",
"for (j = 0; j < c + 1; ++j) {\n\t\t\t\t\tSystem.out.print(mat[i][j]);\n\t\t\t\t\tif (j != c) { // ?????????????????????????????????AOJ??§?????¬?????????????????§?????¨??????????????????????????????\n\t\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t\t}\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\tSystem.out.print(mat[i][j]);\n\t\t\t\t\tif (j != c) { // ?????????????????????????????????AOJ??§?????¬?????????????????§?????¨??????????????????????????????\n\t\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t\t}\n\t\t\t\t}",
"{\n\t\t\t\t\tSystem.out.print(mat[i][j]);\n\t\t\t\t\tif (j != c) { // ?????????????????????????????????AOJ??§?????¬?????????????????§?????¨??????????????????????????????\n\t\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t\t}\n\t\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) { // ?????????????????????????????????AOJ??§?????¬?????????????????§?????¨??????????????????????????????\n\t\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t\t}",
"j != c",
"j",
"c",
"{ // ?????????????????????????????????AOJ??§?????¬?????????????????§?????¨??????????????????????????????\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",
"\"\"",
"sc.close()",
"sc.close",
"sc",
"String[] args",
"args",
"public class Main {\n\n\tpublic static void main(String[] args) throws IOException {\n\t\tint r = 0, c = 0;\n\t\tint i = 0, j = 0;\n\t\tArrayList<Integer> elements = new ArrayList<Integer>();\n\n\t\tScanner sc = new Scanner(System.in);\n\t\tfor (int t = 0; t < 2; ++t) {\n\t\t\telements.add(sc.nextInt()); // ?????????????´???°?±????\n\t\t}\n\t\tr = elements.get(0);\n\t\tc = elements.get(1);\n\t\tif (r >= 1 && r <= 100 && c >= 1 && c <= 100) { // ??¶?´??????¶\n\t\t\tint[][] mat = new int[r + 1][c + 1]; // ?¨?????????????????????????????????????????????¨???????????????[r+1][c+1]\n\t\t\tfor (i = 0; i < r; ++i) {\n\t\t\t\tfor (j = 0; j < c; ++j) {\n\t\t\t\t\tmat[i][j] = 0; // ??????????????????\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tfor (i = 0; i < r; ++i) {\n\t\t\t\tfor (j = 0; j < c; ++j) {\n\t\t\t\t\tmat[i][j] = sc.nextInt(); // ????´????????????????\n\t\t\t\t\tmat[i][c] += mat[i][j]; // ???????????????????????????\n\t\t\t\t\tmat[r][j] += mat[i][j]; // ??????????????????\n\t\t\t\t\tmat[r][c] += mat[i][j]; // ?????????????¨?\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor (i = 0; i < r + 1; ++i) {\n\t\t\t\tfor (j = 0; j < c + 1; ++j) {\n\t\t\t\t\tSystem.out.print(mat[i][j]);\n\t\t\t\t\tif (j != c) { // ?????????????????????????????????AOJ??§?????¬?????????????????§?????¨??????????????????????????????\n\t\t\t\t\t\tSystem.out.print(\" \");\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}\n\t\tsc.close();\n\t}\n\n}",
"public class Main {\n\n\tpublic static void main(String[] args) throws IOException {\n\t\tint r = 0, c = 0;\n\t\tint i = 0, j = 0;\n\t\tArrayList<Integer> elements = new ArrayList<Integer>();\n\n\t\tScanner sc = new Scanner(System.in);\n\t\tfor (int t = 0; t < 2; ++t) {\n\t\t\telements.add(sc.nextInt()); // ?????????????´???°?±????\n\t\t}\n\t\tr = elements.get(0);\n\t\tc = elements.get(1);\n\t\tif (r >= 1 && r <= 100 && c >= 1 && c <= 100) { // ??¶?´??????¶\n\t\t\tint[][] mat = new int[r + 1][c + 1]; // ?¨?????????????????????????????????????????????¨???????????????[r+1][c+1]\n\t\t\tfor (i = 0; i < r; ++i) {\n\t\t\t\tfor (j = 0; j < c; ++j) {\n\t\t\t\t\tmat[i][j] = 0; // ??????????????????\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tfor (i = 0; i < r; ++i) {\n\t\t\t\tfor (j = 0; j < c; ++j) {\n\t\t\t\t\tmat[i][j] = sc.nextInt(); // ????´????????????????\n\t\t\t\t\tmat[i][c] += mat[i][j]; // ???????????????????????????\n\t\t\t\t\tmat[r][j] += mat[i][j]; // ??????????????????\n\t\t\t\t\tmat[r][c] += mat[i][j]; // ?????????????¨?\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor (i = 0; i < r + 1; ++i) {\n\t\t\t\tfor (j = 0; j < c + 1; ++j) {\n\t\t\t\t\tSystem.out.print(mat[i][j]);\n\t\t\t\t\tif (j != c) { // ?????????????????????????????????AOJ??§?????¬?????????????????§?????¨??????????????????????????????\n\t\t\t\t\t\tSystem.out.print(\" \");\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}\n\t\tsc.close();\n\t}\n\n}",
"Main"
] | import java.io.IOException;
import java.util.ArrayList;
import java.util.Scanner;
public class Main {
public static void main(String[] args) throws IOException {
int r = 0, c = 0;
int i = 0, j = 0;
ArrayList<Integer> elements = new ArrayList<Integer>();
Scanner sc = new Scanner(System.in);
for (int t = 0; t < 2; ++t) {
elements.add(sc.nextInt()); // ?????????????´???°?±????
}
r = elements.get(0);
c = elements.get(1);
if (r >= 1 && r <= 100 && c >= 1 && c <= 100) { // ??¶?´??????¶
int[][] mat = new int[r + 1][c + 1]; // ?¨?????????????????????????????????????????????¨???????????????[r+1][c+1]
for (i = 0; i < r; ++i) {
for (j = 0; j < c; ++j) {
mat[i][j] = 0; // ??????????????????
}
}
for (i = 0; i < r; ++i) {
for (j = 0; j < c; ++j) {
mat[i][j] = sc.nextInt(); // ????´????????????????
mat[i][c] += mat[i][j]; // ???????????????????????????
mat[r][j] += mat[i][j]; // ??????????????????
mat[r][c] += mat[i][j]; // ?????????????¨?
}
}
for (i = 0; i < r + 1; ++i) {
for (j = 0; j < c + 1; ++j) {
System.out.print(mat[i][j]);
if (j != c) { // ?????????????????????????????????AOJ??§?????¬?????????????????§?????¨??????????????????????????????
System.out.print(" ");
}
}
System.out.println("");
}
}
sc.close();
}
} |
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
41,
13,
20,
2,
13,
17,
2,
13,
17,
41,
13,
17,
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,
14,
2,
2,
13,
13,
2,
13,
13,
30,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
18,
18,
13,
13,
13,
18,
18,
13,
13,
13,
0,
13,
18,
18,
13,
13,
13,
14,
2,
13,
13,
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,
14,
2,
13,
13,
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,
30,
0,
13,
4,
18,
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,
2,
13,
17,
1,
40,
13,
30,
30,
14,
2,
13,
13,
30,
4,
18,
18,
13,
13,
18,
18,
13,
13,
13,
30,
4,
18,
18,
13,
13,
2,
18,
18,
13,
13,
13,
17,
4,
18,
13,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
254,
5
],
[
254,
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
],
[
34,
36
],
[
8,
37
],
[
37,
38
],
[
37,
39
],
[
8,
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
],
[
53,
55
],
[
52,
56
],
[
56,
57
],
[
57,
58
],
[
58,
59
],
[
58,
60
],
[
56,
61
],
[
61,
62
],
[
61,
63
],
[
56,
64
],
[
64,
65
],
[
65,
66
],
[
56,
67
],
[
68,
68
],
[
68,
69
],
[
69,
70
],
[
70,
71
],
[
71,
72
],
[
71,
73
],
[
70,
74
],
[
74,
75
],
[
74,
76
],
[
69,
77
],
[
77,
78
],
[
78,
79
],
[
79,
80
],
[
80,
81
],
[
80,
82
],
[
78,
83
],
[
83,
84
],
[
83,
85
],
[
78,
86
],
[
86,
87
],
[
87,
88
],
[
78,
89
],
[
90,
90
],
[
90,
91
],
[
91,
92
],
[
92,
93
],
[
93,
94
],
[
93,
95
],
[
92,
96
],
[
91,
97
],
[
97,
98
],
[
98,
99
],
[
98,
100
],
[
97,
101
],
[
90,
102
],
[
102,
103
],
[
102,
104
],
[
104,
105
],
[
105,
106
],
[
105,
107
],
[
104,
108
],
[
69,
109
],
[
109,
110
],
[
110,
111
],
[
110,
112
],
[
109,
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
],
[
128,
132
],
[
127,
133
],
[
133,
134
],
[
134,
135
],
[
134,
136
],
[
133,
137
],
[
109,
138
],
[
138,
139
],
[
139,
140
],
[
139,
141
],
[
138,
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
],
[
138,
167
],
[
167,
168
],
[
168,
169
],
[
168,
170
],
[
170,
171
],
[
171,
172
],
[
167,
173
],
[
173,
174
],
[
174,
175
],
[
175,
176
],
[
175,
177
],
[
174,
178
],
[
173,
179
],
[
167,
180
],
[
180,
181
],
[
180,
182
],
[
68,
183
],
[
183,
184
],
[
184,
185
],
[
185,
186
],
[
185,
187
],
[
184,
188
],
[
183,
189
],
[
8,
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
],
[
210,
212
],
[
212,
213
],
[
212,
214
],
[
205,
215
],
[
215,
216
],
[
216,
217
],
[
205,
218
],
[
219,
219
],
[
219,
220
],
[
220,
221
],
[
221,
222
],
[
221,
223
],
[
220,
224
],
[
224,
225
],
[
225,
226
],
[
226,
227
],
[
227,
228
],
[
227,
229
],
[
225,
230
],
[
230,
231
],
[
231,
232
],
[
231,
233
],
[
230,
234
],
[
220,
235
],
[
235,
236
],
[
236,
237
],
[
237,
238
],
[
238,
239
],
[
238,
240
],
[
236,
241
],
[
241,
242
],
[
242,
243
],
[
243,
244
],
[
243,
245
],
[
242,
246
],
[
241,
247
],
[
8,
248
],
[
248,
249
],
[
249,
250
],
[
6,
251
],
[
251,
252
],
[
0,
253
],
[
253,
254
],
[
253,
255
]
] | [
"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[][] array = new int[r+1][c+1];\n\t\tint intTemp = 0;\n\t\tint intSumC = 0;\n\t\tint intSumR = 0;\n\t\tfor(int i = 0; i <= r; i++){\n\t\t\tintSumC = 0;\n\t\t\tfor(int j = 0; j <= c; j++){\n\t\t\t\tif(i == r && j == c){\n\t\t\t\t\tfor(int k = 0; k < c; k++){\n\t\t\t\t\t\tarray[r][c] += array[r][k];\n\t\t\t\t\t\tintSumC = array[r][c];\n\t\t\t\t\t}\n\t\t\t\t}else if(i == r){\n\t\t\t\t\tfor(int k = 0; k < r; k++){\n\t\t\t\t\t\tarray[r][j] += array[k][j];\n\t\t\t\t\t}\n\t\t\t\t}else if(j == c){\n\t\t\t\t\tfor(int k = 0; k < c; k++){\n\t\t\t\t\t\tarray[i][c] += array[i][k];\n\t\t\t\t\t}\n\t\t\t\t}else{\n\t\t\t\t\tintTemp = scan.nextInt();\n\t\t\t\t\tarray[i][j] = intTemp;\n\t\t\t\t\tintSumC += intTemp;\n\t\t\t\t}\n\t\t\t\tarray[i][c] = intSumC;\n\n\t\t\t}\n\n\t\t}\n\t\tfor(int i = 0; i < r + 1; i++){\n\t\t\tfor(int j = 0; j < c + 1; j++){\n\t\t\t\tif(j == c){\n\t\t\t\t\tSystem.out.println(array[i][j]);\n\t\t\t\t}else{\n\t\t\t\t\tSystem.out.print(array[i][j] + \" \");\n\t\t\t\t}\n\t\t\t}\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[][] array = new int[r+1][c+1];\n\t\tint intTemp = 0;\n\t\tint intSumC = 0;\n\t\tint intSumR = 0;\n\t\tfor(int i = 0; i <= r; i++){\n\t\t\tintSumC = 0;\n\t\t\tfor(int j = 0; j <= c; j++){\n\t\t\t\tif(i == r && j == c){\n\t\t\t\t\tfor(int k = 0; k < c; k++){\n\t\t\t\t\t\tarray[r][c] += array[r][k];\n\t\t\t\t\t\tintSumC = array[r][c];\n\t\t\t\t\t}\n\t\t\t\t}else if(i == r){\n\t\t\t\t\tfor(int k = 0; k < r; k++){\n\t\t\t\t\t\tarray[r][j] += array[k][j];\n\t\t\t\t\t}\n\t\t\t\t}else if(j == c){\n\t\t\t\t\tfor(int k = 0; k < c; k++){\n\t\t\t\t\t\tarray[i][c] += array[i][k];\n\t\t\t\t\t}\n\t\t\t\t}else{\n\t\t\t\t\tintTemp = scan.nextInt();\n\t\t\t\t\tarray[i][j] = intTemp;\n\t\t\t\t\tintSumC += intTemp;\n\t\t\t\t}\n\t\t\t\tarray[i][c] = intSumC;\n\n\t\t\t}\n\n\t\t}\n\t\tfor(int i = 0; i < r + 1; i++){\n\t\t\tfor(int j = 0; j < c + 1; j++){\n\t\t\t\tif(j == c){\n\t\t\t\t\tSystem.out.println(array[i][j]);\n\t\t\t\t}else{\n\t\t\t\t\tSystem.out.print(array[i][j] + \" \");\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tscan.close();\n\t}\n}",
"Main",
"public static void main(String[] args){\n\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\tint intTemp = 0;\n\t\tint intSumC = 0;\n\t\tint intSumR = 0;\n\t\tfor(int i = 0; i <= r; i++){\n\t\t\tintSumC = 0;\n\t\t\tfor(int j = 0; j <= c; j++){\n\t\t\t\tif(i == r && j == c){\n\t\t\t\t\tfor(int k = 0; k < c; k++){\n\t\t\t\t\t\tarray[r][c] += array[r][k];\n\t\t\t\t\t\tintSumC = array[r][c];\n\t\t\t\t\t}\n\t\t\t\t}else if(i == r){\n\t\t\t\t\tfor(int k = 0; k < r; k++){\n\t\t\t\t\t\tarray[r][j] += array[k][j];\n\t\t\t\t\t}\n\t\t\t\t}else if(j == c){\n\t\t\t\t\tfor(int k = 0; k < c; k++){\n\t\t\t\t\t\tarray[i][c] += array[i][k];\n\t\t\t\t\t}\n\t\t\t\t}else{\n\t\t\t\t\tintTemp = scan.nextInt();\n\t\t\t\t\tarray[i][j] = intTemp;\n\t\t\t\t\tintSumC += intTemp;\n\t\t\t\t}\n\t\t\t\tarray[i][c] = intSumC;\n\n\t\t\t}\n\n\t\t}\n\t\tfor(int i = 0; i < r + 1; i++){\n\t\t\tfor(int j = 0; j < c + 1; j++){\n\t\t\t\tif(j == c){\n\t\t\t\t\tSystem.out.println(array[i][j]);\n\t\t\t\t}else{\n\t\t\t\t\tSystem.out.print(array[i][j] + \" \");\n\t\t\t\t}\n\t\t\t}\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[][] array = new int[r+1][c+1];\n\t\tint intTemp = 0;\n\t\tint intSumC = 0;\n\t\tint intSumR = 0;\n\t\tfor(int i = 0; i <= r; i++){\n\t\t\tintSumC = 0;\n\t\t\tfor(int j = 0; j <= c; j++){\n\t\t\t\tif(i == r && j == c){\n\t\t\t\t\tfor(int k = 0; k < c; k++){\n\t\t\t\t\t\tarray[r][c] += array[r][k];\n\t\t\t\t\t\tintSumC = array[r][c];\n\t\t\t\t\t}\n\t\t\t\t}else if(i == r){\n\t\t\t\t\tfor(int k = 0; k < r; k++){\n\t\t\t\t\t\tarray[r][j] += array[k][j];\n\t\t\t\t\t}\n\t\t\t\t}else if(j == c){\n\t\t\t\t\tfor(int k = 0; k < c; k++){\n\t\t\t\t\t\tarray[i][c] += array[i][k];\n\t\t\t\t\t}\n\t\t\t\t}else{\n\t\t\t\t\tintTemp = scan.nextInt();\n\t\t\t\t\tarray[i][j] = intTemp;\n\t\t\t\t\tintSumC += intTemp;\n\t\t\t\t}\n\t\t\t\tarray[i][c] = intSumC;\n\n\t\t\t}\n\n\t\t}\n\t\tfor(int i = 0; i < r + 1; i++){\n\t\t\tfor(int j = 0; j < c + 1; j++){\n\t\t\t\tif(j == c){\n\t\t\t\t\tSystem.out.println(array[i][j]);\n\t\t\t\t}else{\n\t\t\t\t\tSystem.out.print(array[i][j] + \" \");\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tscan.close();\n\t}",
"Scanner scan = new Scanner(System.in);",
"scan",
"new Scanner(System.in)",
"int 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",
"int intTemp = 0;",
"intTemp",
"0",
"int intSumC = 0;",
"intSumC",
"0",
"int intSumR = 0;",
"intSumR",
"0",
"for(int i = 0; i <= r; i++){\n\t\t\tintSumC = 0;\n\t\t\tfor(int j = 0; j <= c; j++){\n\t\t\t\tif(i == r && j == c){\n\t\t\t\t\tfor(int k = 0; k < c; k++){\n\t\t\t\t\t\tarray[r][c] += array[r][k];\n\t\t\t\t\t\tintSumC = array[r][c];\n\t\t\t\t\t}\n\t\t\t\t}else if(i == r){\n\t\t\t\t\tfor(int k = 0; k < r; k++){\n\t\t\t\t\t\tarray[r][j] += array[k][j];\n\t\t\t\t\t}\n\t\t\t\t}else if(j == c){\n\t\t\t\t\tfor(int k = 0; k < c; k++){\n\t\t\t\t\t\tarray[i][c] += array[i][k];\n\t\t\t\t\t}\n\t\t\t\t}else{\n\t\t\t\t\tintTemp = scan.nextInt();\n\t\t\t\t\tarray[i][j] = intTemp;\n\t\t\t\t\tintSumC += intTemp;\n\t\t\t\t}\n\t\t\t\tarray[i][c] = intSumC;\n\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\tintSumC = 0;\n\t\t\tfor(int j = 0; j <= c; j++){\n\t\t\t\tif(i == r && j == c){\n\t\t\t\t\tfor(int k = 0; k < c; k++){\n\t\t\t\t\t\tarray[r][c] += array[r][k];\n\t\t\t\t\t\tintSumC = array[r][c];\n\t\t\t\t\t}\n\t\t\t\t}else if(i == r){\n\t\t\t\t\tfor(int k = 0; k < r; k++){\n\t\t\t\t\t\tarray[r][j] += array[k][j];\n\t\t\t\t\t}\n\t\t\t\t}else if(j == c){\n\t\t\t\t\tfor(int k = 0; k < c; k++){\n\t\t\t\t\t\tarray[i][c] += array[i][k];\n\t\t\t\t\t}\n\t\t\t\t}else{\n\t\t\t\t\tintTemp = scan.nextInt();\n\t\t\t\t\tarray[i][j] = intTemp;\n\t\t\t\t\tintSumC += intTemp;\n\t\t\t\t}\n\t\t\t\tarray[i][c] = intSumC;\n\n\t\t\t}\n\n\t\t}",
"{\n\t\t\tintSumC = 0;\n\t\t\tfor(int j = 0; j <= c; j++){\n\t\t\t\tif(i == r && j == c){\n\t\t\t\t\tfor(int k = 0; k < c; k++){\n\t\t\t\t\t\tarray[r][c] += array[r][k];\n\t\t\t\t\t\tintSumC = array[r][c];\n\t\t\t\t\t}\n\t\t\t\t}else if(i == r){\n\t\t\t\t\tfor(int k = 0; k < r; k++){\n\t\t\t\t\t\tarray[r][j] += array[k][j];\n\t\t\t\t\t}\n\t\t\t\t}else if(j == c){\n\t\t\t\t\tfor(int k = 0; k < c; k++){\n\t\t\t\t\t\tarray[i][c] += array[i][k];\n\t\t\t\t\t}\n\t\t\t\t}else{\n\t\t\t\t\tintTemp = scan.nextInt();\n\t\t\t\t\tarray[i][j] = intTemp;\n\t\t\t\t\tintSumC += intTemp;\n\t\t\t\t}\n\t\t\t\tarray[i][c] = intSumC;\n\n\t\t\t}\n\n\t\t}",
"intSumC = 0",
"intSumC",
"0",
"for(int j = 0; j <= c; j++){\n\t\t\t\tif(i == r && j == c){\n\t\t\t\t\tfor(int k = 0; k < c; k++){\n\t\t\t\t\t\tarray[r][c] += array[r][k];\n\t\t\t\t\t\tintSumC = array[r][c];\n\t\t\t\t\t}\n\t\t\t\t}else if(i == r){\n\t\t\t\t\tfor(int k = 0; k < r; k++){\n\t\t\t\t\t\tarray[r][j] += array[k][j];\n\t\t\t\t\t}\n\t\t\t\t}else if(j == c){\n\t\t\t\t\tfor(int k = 0; k < c; k++){\n\t\t\t\t\t\tarray[i][c] += array[i][k];\n\t\t\t\t\t}\n\t\t\t\t}else{\n\t\t\t\t\tintTemp = scan.nextInt();\n\t\t\t\t\tarray[i][j] = intTemp;\n\t\t\t\t\tintSumC += intTemp;\n\t\t\t\t}\n\t\t\t\tarray[i][c] = intSumC;\n\n\t\t\t}",
"int j = 0;",
"int j = 0;",
"j",
"0",
"j <= c",
"j",
"c",
"j++",
"j++",
"j",
"{\n\t\t\t\tif(i == r && j == c){\n\t\t\t\t\tfor(int k = 0; k < c; k++){\n\t\t\t\t\t\tarray[r][c] += array[r][k];\n\t\t\t\t\t\tintSumC = array[r][c];\n\t\t\t\t\t}\n\t\t\t\t}else if(i == r){\n\t\t\t\t\tfor(int k = 0; k < r; k++){\n\t\t\t\t\t\tarray[r][j] += array[k][j];\n\t\t\t\t\t}\n\t\t\t\t}else if(j == c){\n\t\t\t\t\tfor(int k = 0; k < c; k++){\n\t\t\t\t\t\tarray[i][c] += array[i][k];\n\t\t\t\t\t}\n\t\t\t\t}else{\n\t\t\t\t\tintTemp = scan.nextInt();\n\t\t\t\t\tarray[i][j] = intTemp;\n\t\t\t\t\tintSumC += intTemp;\n\t\t\t\t}\n\t\t\t\tarray[i][c] = intSumC;\n\n\t\t\t}",
"{\n\t\t\t\tif(i == r && j == c){\n\t\t\t\t\tfor(int k = 0; k < c; k++){\n\t\t\t\t\t\tarray[r][c] += array[r][k];\n\t\t\t\t\t\tintSumC = array[r][c];\n\t\t\t\t\t}\n\t\t\t\t}else if(i == r){\n\t\t\t\t\tfor(int k = 0; k < r; k++){\n\t\t\t\t\t\tarray[r][j] += array[k][j];\n\t\t\t\t\t}\n\t\t\t\t}else if(j == c){\n\t\t\t\t\tfor(int k = 0; k < c; k++){\n\t\t\t\t\t\tarray[i][c] += array[i][k];\n\t\t\t\t\t}\n\t\t\t\t}else{\n\t\t\t\t\tintTemp = scan.nextInt();\n\t\t\t\t\tarray[i][j] = intTemp;\n\t\t\t\t\tintSumC += intTemp;\n\t\t\t\t}\n\t\t\t\tarray[i][c] = intSumC;\n\n\t\t\t}",
"if(i == r && j == c){\n\t\t\t\t\tfor(int k = 0; k < c; k++){\n\t\t\t\t\t\tarray[r][c] += array[r][k];\n\t\t\t\t\t\tintSumC = array[r][c];\n\t\t\t\t\t}\n\t\t\t\t}else if(i == r){\n\t\t\t\t\tfor(int k = 0; k < r; k++){\n\t\t\t\t\t\tarray[r][j] += array[k][j];\n\t\t\t\t\t}\n\t\t\t\t}else if(j == c){\n\t\t\t\t\tfor(int k = 0; k < c; k++){\n\t\t\t\t\t\tarray[i][c] += array[i][k];\n\t\t\t\t\t}\n\t\t\t\t}else{\n\t\t\t\t\tintTemp = scan.nextInt();\n\t\t\t\t\tarray[i][j] = intTemp;\n\t\t\t\t\tintSumC += intTemp;\n\t\t\t\t}",
"i == r && j == c",
"i == r",
"i",
"r",
"j == c",
"j",
"c",
"{\n\t\t\t\t\tfor(int k = 0; k < c; k++){\n\t\t\t\t\t\tarray[r][c] += array[r][k];\n\t\t\t\t\t\tintSumC = array[r][c];\n\t\t\t\t\t}\n\t\t\t\t}",
"for(int k = 0; k < c; k++){\n\t\t\t\t\t\tarray[r][c] += array[r][k];\n\t\t\t\t\t\tintSumC = array[r][c];\n\t\t\t\t\t}",
"int k = 0;",
"int k = 0;",
"k",
"0",
"k < c",
"k",
"c",
"k++",
"k++",
"k",
"{\n\t\t\t\t\t\tarray[r][c] += array[r][k];\n\t\t\t\t\t\tintSumC = array[r][c];\n\t\t\t\t\t}",
"{\n\t\t\t\t\t\tarray[r][c] += array[r][k];\n\t\t\t\t\t\tintSumC = array[r][c];\n\t\t\t\t\t}",
"array[r][c] += array[r][k]",
"array[r][c]",
"array[r]",
"array",
"r",
"c",
"array[r][k]",
"array[r]",
"array",
"r",
"k",
"intSumC = array[r][c]",
"intSumC",
"array[r][c]",
"array[r]",
"array",
"r",
"c",
"if(i == r){\n\t\t\t\t\tfor(int k = 0; k < r; k++){\n\t\t\t\t\t\tarray[r][j] += array[k][j];\n\t\t\t\t\t}\n\t\t\t\t}else if(j == c){\n\t\t\t\t\tfor(int k = 0; k < c; k++){\n\t\t\t\t\t\tarray[i][c] += array[i][k];\n\t\t\t\t\t}\n\t\t\t\t}else{\n\t\t\t\t\tintTemp = scan.nextInt();\n\t\t\t\t\tarray[i][j] = intTemp;\n\t\t\t\t\tintSumC += intTemp;\n\t\t\t\t}",
"i == r",
"i",
"r",
"{\n\t\t\t\t\tfor(int k = 0; k < r; k++){\n\t\t\t\t\t\tarray[r][j] += array[k][j];\n\t\t\t\t\t}\n\t\t\t\t}",
"for(int k = 0; k < r; k++){\n\t\t\t\t\t\tarray[r][j] += array[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\tarray[r][j] += array[k][j];\n\t\t\t\t\t}",
"{\n\t\t\t\t\t\tarray[r][j] += array[k][j];\n\t\t\t\t\t}",
"array[r][j] += array[k][j]",
"array[r][j]",
"array[r]",
"array",
"r",
"j",
"array[k][j]",
"array[k]",
"array",
"k",
"j",
"if(j == c){\n\t\t\t\t\tfor(int k = 0; k < c; k++){\n\t\t\t\t\t\tarray[i][c] += array[i][k];\n\t\t\t\t\t}\n\t\t\t\t}else{\n\t\t\t\t\tintTemp = scan.nextInt();\n\t\t\t\t\tarray[i][j] = intTemp;\n\t\t\t\t\tintSumC += intTemp;\n\t\t\t\t}",
"j == c",
"j",
"c",
"{\n\t\t\t\t\tfor(int k = 0; k < c; k++){\n\t\t\t\t\t\tarray[i][c] += array[i][k];\n\t\t\t\t\t}\n\t\t\t\t}",
"for(int k = 0; k < c; k++){\n\t\t\t\t\t\tarray[i][c] += array[i][k];\n\t\t\t\t\t}",
"int k = 0;",
"int k = 0;",
"k",
"0",
"k < c",
"k",
"c",
"k++",
"k++",
"k",
"{\n\t\t\t\t\t\tarray[i][c] += array[i][k];\n\t\t\t\t\t}",
"{\n\t\t\t\t\t\tarray[i][c] += array[i][k];\n\t\t\t\t\t}",
"array[i][c] += array[i][k]",
"array[i][c]",
"array[i]",
"array",
"i",
"c",
"array[i][k]",
"array[i]",
"array",
"i",
"k",
"{\n\t\t\t\t\tintTemp = scan.nextInt();\n\t\t\t\t\tarray[i][j] = intTemp;\n\t\t\t\t\tintSumC += intTemp;\n\t\t\t\t}",
"intTemp = scan.nextInt()",
"intTemp",
"scan.nextInt()",
"scan.nextInt",
"scan",
"array[i][j] = intTemp",
"array[i][j]",
"array[i]",
"array",
"i",
"j",
"intTemp",
"intSumC += intTemp",
"intSumC",
"intTemp",
"array[i][c] = intSumC",
"array[i][c]",
"array[i]",
"array",
"i",
"c",
"intSumC",
"for(int i = 0; i < r + 1; i++){\n\t\t\tfor(int j = 0; j < c + 1; j++){\n\t\t\t\tif(j == c){\n\t\t\t\t\tSystem.out.println(array[i][j]);\n\t\t\t\t}else{\n\t\t\t\t\tSystem.out.print(array[i][j] + \" \");\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < r + 1",
"i",
"r + 1",
"r",
"1",
"i++",
"i++",
"i",
"{\n\t\t\tfor(int j = 0; j < c + 1; j++){\n\t\t\t\tif(j == c){\n\t\t\t\t\tSystem.out.println(array[i][j]);\n\t\t\t\t}else{\n\t\t\t\t\tSystem.out.print(array[i][j] + \" \");\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"{\n\t\t\tfor(int j = 0; j < c + 1; j++){\n\t\t\t\tif(j == c){\n\t\t\t\t\tSystem.out.println(array[i][j]);\n\t\t\t\t}else{\n\t\t\t\t\tSystem.out.print(array[i][j] + \" \");\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"for(int j = 0; j < c + 1; j++){\n\t\t\t\tif(j == c){\n\t\t\t\t\tSystem.out.println(array[i][j]);\n\t\t\t\t}else{\n\t\t\t\t\tSystem.out.print(array[i][j] + \" \");\n\t\t\t\t}\n\t\t\t}",
"int j = 0;",
"int j = 0;",
"j",
"0",
"j < c + 1",
"j",
"c + 1",
"c",
"1",
"j++",
"j++",
"j",
"{\n\t\t\t\tif(j == c){\n\t\t\t\t\tSystem.out.println(array[i][j]);\n\t\t\t\t}else{\n\t\t\t\t\tSystem.out.print(array[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(array[i][j]);\n\t\t\t\t}else{\n\t\t\t\t\tSystem.out.print(array[i][j] + \" \");\n\t\t\t\t}\n\t\t\t}",
"if(j == c){\n\t\t\t\t\tSystem.out.println(array[i][j]);\n\t\t\t\t}else{\n\t\t\t\t\tSystem.out.print(array[i][j] + \" \");\n\t\t\t\t}",
"j == c",
"j",
"c",
"{\n\t\t\t\t\tSystem.out.println(array[i][j]);\n\t\t\t\t}",
"System.out.println(array[i][j])",
"System.out.println",
"System.out",
"System",
"System.out",
"array[i][j]",
"array[i]",
"array",
"i",
"j",
"{\n\t\t\t\t\tSystem.out.print(array[i][j] + \" \");\n\t\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",
"\" \"",
"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[][] array = new int[r+1][c+1];\n\t\tint intTemp = 0;\n\t\tint intSumC = 0;\n\t\tint intSumR = 0;\n\t\tfor(int i = 0; i <= r; i++){\n\t\t\tintSumC = 0;\n\t\t\tfor(int j = 0; j <= c; j++){\n\t\t\t\tif(i == r && j == c){\n\t\t\t\t\tfor(int k = 0; k < c; k++){\n\t\t\t\t\t\tarray[r][c] += array[r][k];\n\t\t\t\t\t\tintSumC = array[r][c];\n\t\t\t\t\t}\n\t\t\t\t}else if(i == r){\n\t\t\t\t\tfor(int k = 0; k < r; k++){\n\t\t\t\t\t\tarray[r][j] += array[k][j];\n\t\t\t\t\t}\n\t\t\t\t}else if(j == c){\n\t\t\t\t\tfor(int k = 0; k < c; k++){\n\t\t\t\t\t\tarray[i][c] += array[i][k];\n\t\t\t\t\t}\n\t\t\t\t}else{\n\t\t\t\t\tintTemp = scan.nextInt();\n\t\t\t\t\tarray[i][j] = intTemp;\n\t\t\t\t\tintSumC += intTemp;\n\t\t\t\t}\n\t\t\t\tarray[i][c] = intSumC;\n\n\t\t\t}\n\n\t\t}\n\t\tfor(int i = 0; i < r + 1; i++){\n\t\t\tfor(int j = 0; j < c + 1; j++){\n\t\t\t\tif(j == c){\n\t\t\t\t\tSystem.out.println(array[i][j]);\n\t\t\t\t}else{\n\t\t\t\t\tSystem.out.print(array[i][j] + \" \");\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tscan.close();\n\t}\n}",
"public class Main {\n\tpublic static void main(String[] args){\n\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\tint intTemp = 0;\n\t\tint intSumC = 0;\n\t\tint intSumR = 0;\n\t\tfor(int i = 0; i <= r; i++){\n\t\t\tintSumC = 0;\n\t\t\tfor(int j = 0; j <= c; j++){\n\t\t\t\tif(i == r && j == c){\n\t\t\t\t\tfor(int k = 0; k < c; k++){\n\t\t\t\t\t\tarray[r][c] += array[r][k];\n\t\t\t\t\t\tintSumC = array[r][c];\n\t\t\t\t\t}\n\t\t\t\t}else if(i == r){\n\t\t\t\t\tfor(int k = 0; k < r; k++){\n\t\t\t\t\t\tarray[r][j] += array[k][j];\n\t\t\t\t\t}\n\t\t\t\t}else if(j == c){\n\t\t\t\t\tfor(int k = 0; k < c; k++){\n\t\t\t\t\t\tarray[i][c] += array[i][k];\n\t\t\t\t\t}\n\t\t\t\t}else{\n\t\t\t\t\tintTemp = scan.nextInt();\n\t\t\t\t\tarray[i][j] = intTemp;\n\t\t\t\t\tintSumC += intTemp;\n\t\t\t\t}\n\t\t\t\tarray[i][c] = intSumC;\n\n\t\t\t}\n\n\t\t}\n\t\tfor(int i = 0; i < r + 1; i++){\n\t\t\tfor(int j = 0; j < c + 1; j++){\n\t\t\t\tif(j == c){\n\t\t\t\t\tSystem.out.println(array[i][j]);\n\t\t\t\t}else{\n\t\t\t\t\tSystem.out.print(array[i][j] + \" \");\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tscan.close();\n\t}\n}",
"Main"
] | import java.util.Scanner;
public class Main {
public static void main(String[] args){
Scanner scan = new Scanner(System.in);
int r = scan.nextInt();
int c = scan.nextInt();
int[][] array = new int[r+1][c+1];
int intTemp = 0;
int intSumC = 0;
int intSumR = 0;
for(int i = 0; i <= r; i++){
intSumC = 0;
for(int j = 0; j <= c; j++){
if(i == r && j == c){
for(int k = 0; k < c; k++){
array[r][c] += array[r][k];
intSumC = array[r][c];
}
}else if(i == r){
for(int k = 0; k < r; k++){
array[r][j] += array[k][j];
}
}else if(j == c){
for(int k = 0; k < c; k++){
array[i][c] += array[i][k];
}
}else{
intTemp = scan.nextInt();
array[i][j] = intTemp;
intSumC += intTemp;
}
array[i][c] = intSumC;
}
}
for(int i = 0; i < r + 1; i++){
for(int j = 0; j < c + 1; j++){
if(j == c){
System.out.println(array[i][j]);
}else{
System.out.print(array[i][j] + " ");
}
}
}
scan.close();
}
} |
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
4,
18,
13,
17,
41,
13,
4,
18,
13,
18,
13,
17,
41,
13,
4,
18,
13,
18,
13,
17,
41,
13,
20,
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,
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,
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,
23,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
16,
17
],
[
17,
18
],
[
14,
19
],
[
8,
20
],
[
20,
21
],
[
20,
22
],
[
22,
23
],
[
23,
24
],
[
22,
25
],
[
25,
26
],
[
25,
27
],
[
8,
28
],
[
28,
29
],
[
28,
30
],
[
30,
31
],
[
31,
32
],
[
30,
33
],
[
33,
34
],
[
33,
35
],
[
8,
36
],
[
36,
37
],
[
36,
38
],
[
39,
40
],
[
39,
41
],
[
42,
43
],
[
42,
44
],
[
8,
45
],
[
45,
46
],
[
46,
47
],
[
47,
48
],
[
47,
49
],
[
45,
50
],
[
50,
51
],
[
50,
52
],
[
45,
53
],
[
53,
54
],
[
54,
55
],
[
45,
56
],
[
57,
57
],
[
57,
58
],
[
58,
59
],
[
58,
60
],
[
60,
61
],
[
61,
62
],
[
62,
63
],
[
63,
64
],
[
60,
65
],
[
57,
66
],
[
66,
67
],
[
67,
68
],
[
68,
69
],
[
68,
70
],
[
66,
71
],
[
71,
72
],
[
71,
73
],
[
66,
74
],
[
74,
75
],
[
75,
76
],
[
66,
77
],
[
78,
78
],
[
78,
79
],
[
79,
80
],
[
80,
81
],
[
81,
82
],
[
81,
83
],
[
80,
84
],
[
79,
85
],
[
85,
86
],
[
86,
87
],
[
85,
88
],
[
88,
89
],
[
88,
90
],
[
8,
91
],
[
91,
92
],
[
92,
93
],
[
93,
94
],
[
93,
95
],
[
91,
96
],
[
96,
97
],
[
96,
98
],
[
91,
99
],
[
99,
100
],
[
100,
101
],
[
91,
102
],
[
103,
103
],
[
103,
104
],
[
104,
105
],
[
105,
106
],
[
106,
107
],
[
106,
108
],
[
104,
109
],
[
109,
110
],
[
109,
111
],
[
104,
112
],
[
112,
113
],
[
113,
114
],
[
104,
115
],
[
116,
116
],
[
116,
117
],
[
117,
118
],
[
118,
119
],
[
119,
120
],
[
119,
121
],
[
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
],
[
156,
157
],
[
156,
158
],
[
155,
159
],
[
154,
160
],
[
160,
161
],
[
161,
162
],
[
161,
163
],
[
160,
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
],
[
185,
187
],
[
187,
188
],
[
187,
189
],
[
180,
190
],
[
190,
191
],
[
191,
192
],
[
180,
193
],
[
194,
194
],
[
194,
195
],
[
195,
196
],
[
196,
197
],
[
197,
198
],
[
197,
199
],
[
195,
200
],
[
200,
201
],
[
201,
202
],
[
201,
203
],
[
200,
204
],
[
194,
205
],
[
205,
206
],
[
206,
207
],
[
206,
208
],
[
205,
209
],
[
209,
210
],
[
210,
211
],
[
211,
212
],
[
211,
213
],
[
209,
214
],
[
179,
215
],
[
215,
216
],
[
216,
217
],
[
217,
218
],
[
217,
219
],
[
6,
220
],
[
220,
221
]
] | [
"import java.io.*;\n\nclass Main{\n\tpublic static void main(String args[]) throws IOException{\n\t\tBufferedReader buf = new BufferedReader(new InputStreamReader(System.in));\n\t\tString[] str = buf.readLine().split(\" \");\n\t\tint r = Integer.parseInt(str[0]);\n\t\tint c = Integer.parseInt(str[1]);\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\tstr = buf.readLine().split(\" \");\n\t\t\tfor(int j=0; j<c; j++){\n\t\t\t\tarray[i][j] = Integer.parseInt(str[j]);\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\tarray[i][c] += array[i][j];\n\t\t\t}\n\t\t}\n\t\tfor(int j=0; j<=c; j++){\n\t\t\tfor(int i=0; i<r; i++){\n\t\t\t\tarray[r][j] += array[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(array[i][j]);\n\t\t\t\tif(j!=c)\n\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}\t\t\n\t}\n}",
"import java.io.*;",
"io.*",
"java",
"class Main{\n\tpublic static void main(String args[]) throws IOException{\n\t\tBufferedReader buf = new BufferedReader(new InputStreamReader(System.in));\n\t\tString[] str = buf.readLine().split(\" \");\n\t\tint r = Integer.parseInt(str[0]);\n\t\tint c = Integer.parseInt(str[1]);\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\tstr = buf.readLine().split(\" \");\n\t\t\tfor(int j=0; j<c; j++){\n\t\t\t\tarray[i][j] = Integer.parseInt(str[j]);\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\tarray[i][c] += array[i][j];\n\t\t\t}\n\t\t}\n\t\tfor(int j=0; j<=c; j++){\n\t\t\tfor(int i=0; i<r; i++){\n\t\t\t\tarray[r][j] += array[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(array[i][j]);\n\t\t\t\tif(j!=c)\n\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}\t\t\n\t}\n}",
"Main",
"public static void main(String args[]) throws IOException{\n\t\tBufferedReader buf = new BufferedReader(new InputStreamReader(System.in));\n\t\tString[] str = buf.readLine().split(\" \");\n\t\tint r = Integer.parseInt(str[0]);\n\t\tint c = Integer.parseInt(str[1]);\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\tstr = buf.readLine().split(\" \");\n\t\t\tfor(int j=0; j<c; j++){\n\t\t\t\tarray[i][j] = Integer.parseInt(str[j]);\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\tarray[i][c] += array[i][j];\n\t\t\t}\n\t\t}\n\t\tfor(int j=0; j<=c; j++){\n\t\t\tfor(int i=0; i<r; i++){\n\t\t\t\tarray[r][j] += array[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(array[i][j]);\n\t\t\t\tif(j!=c)\n\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}\t\t\n\t}",
"main",
"{\n\t\tBufferedReader buf = new BufferedReader(new InputStreamReader(System.in));\n\t\tString[] str = buf.readLine().split(\" \");\n\t\tint r = Integer.parseInt(str[0]);\n\t\tint c = Integer.parseInt(str[1]);\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\tstr = buf.readLine().split(\" \");\n\t\t\tfor(int j=0; j<c; j++){\n\t\t\t\tarray[i][j] = Integer.parseInt(str[j]);\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\tarray[i][c] += array[i][j];\n\t\t\t}\n\t\t}\n\t\tfor(int j=0; j<=c; j++){\n\t\t\tfor(int i=0; i<r; i++){\n\t\t\t\tarray[r][j] += array[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(array[i][j]);\n\t\t\t\tif(j!=c)\n\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}\t\t\n\t}",
"BufferedReader buf = new BufferedReader(new InputStreamReader(System.in));",
"buf",
"new BufferedReader(new InputStreamReader(System.in))",
"String[] str = buf.readLine().split(\" \");",
"str",
"buf.readLine().split(\" \")",
"buf.readLine().split",
"buf.readLine()",
"buf.readLine",
"buf",
"\" \"",
"int r = Integer.parseInt(str[0]);",
"r",
"Integer.parseInt(str[0])",
"Integer.parseInt",
"Integer",
"str[0]",
"str",
"0",
"int c = Integer.parseInt(str[1]);",
"c",
"Integer.parseInt(str[1])",
"Integer.parseInt",
"Integer",
"str[1]",
"str",
"1",
"int[][] 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\tstr = buf.readLine().split(\" \");\n\t\t\tfor(int j=0; j<c; j++){\n\t\t\t\tarray[i][j] = Integer.parseInt(str[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\tstr = buf.readLine().split(\" \");\n\t\t\tfor(int j=0; j<c; j++){\n\t\t\t\tarray[i][j] = Integer.parseInt(str[j]);\n\t\t\t}\n\t\t}",
"{\n\t\t\tstr = buf.readLine().split(\" \");\n\t\t\tfor(int j=0; j<c; j++){\n\t\t\t\tarray[i][j] = Integer.parseInt(str[j]);\n\t\t\t}\n\t\t}",
"str = buf.readLine().split(\" \")",
"str",
"buf.readLine().split(\" \")",
"buf.readLine().split",
"buf.readLine()",
"buf.readLine",
"buf",
"\" \"",
"for(int j=0; j<c; j++){\n\t\t\t\tarray[i][j] = Integer.parseInt(str[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] = Integer.parseInt(str[j]);\n\t\t\t}",
"{\n\t\t\t\tarray[i][j] = Integer.parseInt(str[j]);\n\t\t\t}",
"array[i][j] = Integer.parseInt(str[j])",
"array[i][j]",
"array[i]",
"array",
"i",
"j",
"Integer.parseInt(str[j])",
"Integer.parseInt",
"Integer",
"str[j]",
"str",
"j",
"for(int i=0; i<r; i++){\n\t\t\tfor(int j=0; j<c; j++){\n\t\t\t\tarray[i][c] += array[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\tarray[i][c] += array[i][j];\n\t\t\t}\n\t\t}",
"{\n\t\t\tfor(int j=0; j<c; j++){\n\t\t\t\tarray[i][c] += array[i][j];\n\t\t\t}\n\t\t}",
"for(int j=0; j<c; 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][c] += array[i][j];\n\t\t\t}",
"{\n\t\t\t\tarray[i][c] += array[i][j];\n\t\t\t}",
"array[i][c] += array[i][j]",
"array[i][c]",
"array[i]",
"array",
"i",
"c",
"array[i][j]",
"array[i]",
"array",
"i",
"j",
"for(int j=0; j<=c; j++){\n\t\t\tfor(int i=0; i<r; i++){\n\t\t\t\tarray[r][j] += array[i][j];\n\t\t\t}\n\t\t}",
"int j=0;",
"int j=0;",
"j",
"0",
"j<=c",
"j",
"c",
"j++",
"j++",
"j",
"{\n\t\t\tfor(int i=0; i<r; i++){\n\t\t\t\tarray[r][j] += array[i][j];\n\t\t\t}\n\t\t}",
"{\n\t\t\tfor(int i=0; i<r; i++){\n\t\t\t\tarray[r][j] += array[i][j];\n\t\t\t}\n\t\t}",
"for(int i=0; i<r; i++){\n\t\t\t\tarray[r][j] += array[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\tarray[r][j] += array[i][j];\n\t\t\t}",
"{\n\t\t\t\tarray[r][j] += array[i][j];\n\t\t\t}",
"array[r][j] += array[i][j]",
"array[r][j]",
"array[r]",
"array",
"r",
"j",
"array[i][j]",
"array[i]",
"array",
"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(array[i][j]);\n\t\t\t\tif(j!=c)\n\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}",
"int i=0;",
"int i=0;",
"i",
"0",
"i<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(array[i][j]);\n\t\t\t\tif(j!=c)\n\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}",
"{\n\t\t\tfor(int j=0; j<c+1; j++){\n\t\t\t\tSystem.out.print(array[i][j]);\n\t\t\t\tif(j!=c)\n\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}",
"for(int j=0; j<c+1; j++){\n\t\t\t\tSystem.out.print(array[i][j]);\n\t\t\t\tif(j!=c)\n\t\t\t\t\tSystem.out.print(\" \");\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(array[i][j]);\n\t\t\t\tif(j!=c)\n\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t}",
"{\n\t\t\t\tSystem.out.print(array[i][j]);\n\t\t\t\tif(j!=c)\n\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t}",
"System.out.print(array[i][j])",
"System.out.print",
"System.out",
"System",
"System.out",
"array[i][j]",
"array[i]",
"array",
"i",
"j",
"if(j!=c)\n\t\t\t\t\tSystem.out.print(\" \");",
"j!=c",
"j",
"c",
"System.out.print(\" \")",
"System.out.print",
"System.out",
"System",
"System.out",
"\" \"",
"System.out.println()",
"System.out.println",
"System.out",
"System",
"System.out",
"String args[]",
"args"
] | import java.io.*;
class Main{
public static void main(String args[]) throws IOException{
BufferedReader buf = new BufferedReader(new InputStreamReader(System.in));
String[] str = buf.readLine().split(" ");
int r = Integer.parseInt(str[0]);
int c = Integer.parseInt(str[1]);
int[][] array = new int[r+1][c+1];
for(int i=0; i<r; i++){
str = buf.readLine().split(" ");
for(int j=0; j<c; j++){
array[i][j] = Integer.parseInt(str[j]);
}
}
for(int i=0; i<r; i++){
for(int j=0; j<c; j++){
array[i][c] += array[i][j];
}
}
for(int j=0; j<=c; j++){
for(int i=0; i<r; i++){
array[r][j] += array[i][j];
}
}
for(int i=0; i<r+1; i++){
for(int j=0; j<c+1; j++){
System.out.print(array[i][j]);
if(j!=c)
System.out.print(" ");
}
System.out.println();
}
}
} |
[
7,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
41,
13,
41,
13,
41,
13,
20,
17,
17,
41,
13,
20,
17,
41,
13,
20,
17,
41,
13,
20,
0,
13,
4,
18,
4,
18,
13,
17,
11,
1,
0,
13,
17,
2,
13,
17,
1,
40,
13,
30,
30,
0,
18,
13,
13,
4,
18,
13,
18,
13,
13,
11,
1,
0,
13,
17,
2,
13,
18,
13,
17,
1,
40,
13,
30,
30,
0,
13,
4,
18,
4,
18,
13,
17,
11,
1,
0,
13,
17,
2,
13,
18,
13,
17,
1,
40,
13,
30,
30,
0,
13,
4,
18,
13,
18,
13,
13,
0,
18,
18,
13,
13,
13,
13,
0,
18,
18,
13,
18,
13,
17,
13,
13,
0,
18,
18,
13,
13,
18,
13,
17,
13,
0,
18,
18,
13,
18,
13,
17,
18,
13,
17,
13,
11,
1,
0,
13,
17,
2,
13,
18,
13,
17,
1,
40,
13,
30,
30,
11,
1,
0,
13,
17,
2,
13,
18,
13,
17,
1,
40,
13,
30,
30,
14,
2,
13,
17,
4,
18,
18,
13,
13,
17,
4,
18,
18,
13,
13,
18,
18,
13,
13,
13,
4,
18,
18,
13,
13,
4,
18,
18,
13,
13,
23,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
9,
10
],
[
9,
11
],
[
11,
12
],
[
12,
13
],
[
11,
14
],
[
14,
15
],
[
11,
16
],
[
16,
17
],
[
11,
18
],
[
18,
19
],
[
18,
20
],
[
11,
23
],
[
23,
24
],
[
23,
25
],
[
11,
27
],
[
27,
28
],
[
27,
29
],
[
11,
31
],
[
31,
32
],
[
31,
33
],
[
11,
34
],
[
34,
35
],
[
34,
36
],
[
36,
37
],
[
37,
38
],
[
38,
39
],
[
39,
40
],
[
36,
41
],
[
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
],
[
56,
58
],
[
55,
59
],
[
59,
60
],
[
60,
61
],
[
59,
62
],
[
62,
63
],
[
62,
64
],
[
11,
65
],
[
65,
66
],
[
66,
67
],
[
67,
68
],
[
67,
69
],
[
65,
70
],
[
70,
71
],
[
70,
72
],
[
72,
73
],
[
72,
74
],
[
65,
75
],
[
75,
76
],
[
76,
77
],
[
65,
78
],
[
79,
79
],
[
79,
80
],
[
80,
81
],
[
80,
82
],
[
82,
83
],
[
83,
84
],
[
84,
85
],
[
85,
86
],
[
82,
87
],
[
79,
88
],
[
88,
89
],
[
89,
90
],
[
90,
91
],
[
90,
92
],
[
88,
93
],
[
93,
94
],
[
93,
95
],
[
95,
96
],
[
95,
97
],
[
88,
98
],
[
98,
99
],
[
99,
100
],
[
88,
101
],
[
102,
102
],
[
102,
103
],
[
103,
104
],
[
103,
105
],
[
105,
106
],
[
106,
107
],
[
105,
108
],
[
108,
109
],
[
108,
110
],
[
102,
111
],
[
111,
112
],
[
112,
113
],
[
113,
114
],
[
113,
115
],
[
112,
116
],
[
111,
117
],
[
102,
118
],
[
118,
119
],
[
119,
120
],
[
120,
121
],
[
120,
122
],
[
122,
123
],
[
122,
124
],
[
119,
125
],
[
118,
126
],
[
102,
127
],
[
127,
128
],
[
128,
129
],
[
129,
130
],
[
129,
131
],
[
128,
132
],
[
132,
133
],
[
132,
134
],
[
127,
135
],
[
102,
136
],
[
136,
137
],
[
137,
138
],
[
138,
139
],
[
138,
140
],
[
140,
141
],
[
140,
142
],
[
137,
143
],
[
143,
144
],
[
143,
145
],
[
136,
146
],
[
11,
147
],
[
147,
148
],
[
148,
149
],
[
149,
150
],
[
149,
151
],
[
147,
152
],
[
152,
153
],
[
152,
154
],
[
154,
155
],
[
154,
156
],
[
147,
157
],
[
157,
158
],
[
158,
159
],
[
147,
160
],
[
161,
161
],
[
161,
162
],
[
162,
163
],
[
163,
164
],
[
164,
165
],
[
164,
166
],
[
162,
167
],
[
167,
168
],
[
167,
169
],
[
169,
170
],
[
169,
171
],
[
162,
172
],
[
172,
173
],
[
173,
174
],
[
162,
175
],
[
176,
176
],
[
176,
177
],
[
177,
178
],
[
178,
179
],
[
178,
180
],
[
177,
181
],
[
181,
182
],
[
182,
183
],
[
183,
184
],
[
183,
185
],
[
181,
186
],
[
176,
187
],
[
187,
188
],
[
188,
189
],
[
189,
190
],
[
189,
191
],
[
187,
192
],
[
192,
193
],
[
193,
194
],
[
193,
195
],
[
192,
196
],
[
161,
197
],
[
197,
198
],
[
198,
199
],
[
199,
200
],
[
199,
201
],
[
11,
202
],
[
202,
203
],
[
203,
204
],
[
204,
205
],
[
204,
206
],
[
9,
207
],
[
207,
208
]
] | [
"import java.io.*;\nimport java.util.Arrays;\nclass Main{\n public static void main(String[] args) throws IOException {\n int i,j,tmp;\n int[][] A = new int[101][101];\n int[] n = new int[990];\n String[] str = new String[990];\n BufferedReader in = new BufferedReader(new InputStreamReader(System.in));\n str = in.readLine().split(\" \");\n for(i=0;i<2;i++){\n n[i]=Integer.parseInt(str[i]); \n } \n for(i=0;i<n[0];i++){\n str = in.readLine().split(\" \");\n for(j=0;j<n[1];j++){\n tmp = Integer.parseInt(str[j]);\n A[i][j]+=tmp; A[n[0]][j]+=tmp; A[i][n[1]]+=tmp; A[n[0]][n[1]]+=tmp;\n }\n }\n for(i=0;i<=n[0];i++){\n for(j=0;j<=n[1];j++){\n if(j!=0) System.out.print(\" \");\n System.out.print(A[i][j]);\n }\n System.out.println();\n } \n System.out.flush();\n }\n}",
"import java.io.*;",
"io.*",
"java",
"import java.util.Arrays;",
"Arrays",
"java.util",
"class Main{\n public static void main(String[] args) throws IOException {\n int i,j,tmp;\n int[][] A = new int[101][101];\n int[] n = new int[990];\n String[] str = new String[990];\n BufferedReader in = new BufferedReader(new InputStreamReader(System.in));\n str = in.readLine().split(\" \");\n for(i=0;i<2;i++){\n n[i]=Integer.parseInt(str[i]); \n } \n for(i=0;i<n[0];i++){\n str = in.readLine().split(\" \");\n for(j=0;j<n[1];j++){\n tmp = Integer.parseInt(str[j]);\n A[i][j]+=tmp; A[n[0]][j]+=tmp; A[i][n[1]]+=tmp; A[n[0]][n[1]]+=tmp;\n }\n }\n for(i=0;i<=n[0];i++){\n for(j=0;j<=n[1];j++){\n if(j!=0) System.out.print(\" \");\n System.out.print(A[i][j]);\n }\n System.out.println();\n } \n System.out.flush();\n }\n}",
"Main",
"public static void main(String[] args) throws IOException {\n int i,j,tmp;\n int[][] A = new int[101][101];\n int[] n = new int[990];\n String[] str = new String[990];\n BufferedReader in = new BufferedReader(new InputStreamReader(System.in));\n str = in.readLine().split(\" \");\n for(i=0;i<2;i++){\n n[i]=Integer.parseInt(str[i]); \n } \n for(i=0;i<n[0];i++){\n str = in.readLine().split(\" \");\n for(j=0;j<n[1];j++){\n tmp = Integer.parseInt(str[j]);\n A[i][j]+=tmp; A[n[0]][j]+=tmp; A[i][n[1]]+=tmp; A[n[0]][n[1]]+=tmp;\n }\n }\n for(i=0;i<=n[0];i++){\n for(j=0;j<=n[1];j++){\n if(j!=0) System.out.print(\" \");\n System.out.print(A[i][j]);\n }\n System.out.println();\n } \n System.out.flush();\n }",
"main",
"{\n int i,j,tmp;\n int[][] A = new int[101][101];\n int[] n = new int[990];\n String[] str = new String[990];\n BufferedReader in = new BufferedReader(new InputStreamReader(System.in));\n str = in.readLine().split(\" \");\n for(i=0;i<2;i++){\n n[i]=Integer.parseInt(str[i]); \n } \n for(i=0;i<n[0];i++){\n str = in.readLine().split(\" \");\n for(j=0;j<n[1];j++){\n tmp = Integer.parseInt(str[j]);\n A[i][j]+=tmp; A[n[0]][j]+=tmp; A[i][n[1]]+=tmp; A[n[0]][n[1]]+=tmp;\n }\n }\n for(i=0;i<=n[0];i++){\n for(j=0;j<=n[1];j++){\n if(j!=0) System.out.print(\" \");\n System.out.print(A[i][j]);\n }\n System.out.println();\n } \n System.out.flush();\n }",
"int i",
"i",
"j",
"j",
"tmp;",
"tmp",
"int[][] A = new int[101][101];",
"A",
"new int[101][101]",
"101",
"101",
"int[] n = new int[990];",
"n",
"new int[990]",
"990",
"String[] str = new String[990];",
"str",
"new String[990]",
"990",
"BufferedReader in = new BufferedReader(new InputStreamReader(System.in));",
"in",
"new BufferedReader(new InputStreamReader(System.in))",
"str = in.readLine().split(\" \")",
"str",
"in.readLine().split(\" \")",
"in.readLine().split",
"in.readLine()",
"in.readLine",
"in",
"\" \"",
"for(i=0;i<2;i++){\n n[i]=Integer.parseInt(str[i]); \n }",
"i=0;",
"i=0",
"i",
"0",
"i<2",
"i",
"2",
"i++",
"i++",
"i",
"{\n n[i]=Integer.parseInt(str[i]); \n }",
"{\n n[i]=Integer.parseInt(str[i]); \n }",
"n[i]=Integer.parseInt(str[i])",
"n[i]",
"n",
"i",
"Integer.parseInt(str[i])",
"Integer.parseInt",
"Integer",
"str[i]",
"str",
"i",
"for(i=0;i<n[0];i++){\n str = in.readLine().split(\" \");\n for(j=0;j<n[1];j++){\n tmp = Integer.parseInt(str[j]);\n A[i][j]+=tmp; A[n[0]][j]+=tmp; A[i][n[1]]+=tmp; A[n[0]][n[1]]+=tmp;\n }\n }",
"i=0;",
"i=0",
"i",
"0",
"i<n[0]",
"i",
"n[0]",
"n",
"0",
"i++",
"i++",
"i",
"{\n str = in.readLine().split(\" \");\n for(j=0;j<n[1];j++){\n tmp = Integer.parseInt(str[j]);\n A[i][j]+=tmp; A[n[0]][j]+=tmp; A[i][n[1]]+=tmp; A[n[0]][n[1]]+=tmp;\n }\n }",
"{\n str = in.readLine().split(\" \");\n for(j=0;j<n[1];j++){\n tmp = Integer.parseInt(str[j]);\n A[i][j]+=tmp; A[n[0]][j]+=tmp; A[i][n[1]]+=tmp; A[n[0]][n[1]]+=tmp;\n }\n }",
"str = in.readLine().split(\" \")",
"str",
"in.readLine().split(\" \")",
"in.readLine().split",
"in.readLine()",
"in.readLine",
"in",
"\" \"",
"for(j=0;j<n[1];j++){\n tmp = Integer.parseInt(str[j]);\n A[i][j]+=tmp; A[n[0]][j]+=tmp; A[i][n[1]]+=tmp; A[n[0]][n[1]]+=tmp;\n }",
"j=0;",
"j=0",
"j",
"0",
"j<n[1]",
"j",
"n[1]",
"n",
"1",
"j++",
"j++",
"j",
"{\n tmp = Integer.parseInt(str[j]);\n A[i][j]+=tmp; A[n[0]][j]+=tmp; A[i][n[1]]+=tmp; A[n[0]][n[1]]+=tmp;\n }",
"{\n tmp = Integer.parseInt(str[j]);\n A[i][j]+=tmp; A[n[0]][j]+=tmp; A[i][n[1]]+=tmp; A[n[0]][n[1]]+=tmp;\n }",
"tmp = Integer.parseInt(str[j])",
"tmp",
"Integer.parseInt(str[j])",
"Integer.parseInt",
"Integer",
"str[j]",
"str",
"j",
"A[i][j]+=tmp",
"A[i][j]",
"A[i]",
"A",
"i",
"j",
"tmp",
"A[n[0]][j]+=tmp",
"A[n[0]][j]",
"A[n[0]]",
"A",
"n[0]",
"n",
"0",
"j",
"tmp",
"A[i][n[1]]+=tmp",
"A[i][n[1]]",
"A[i]",
"A",
"i",
"n[1]",
"n",
"1",
"tmp",
"A[n[0]][n[1]]+=tmp",
"A[n[0]][n[1]]",
"A[n[0]]",
"A",
"n[0]",
"n",
"0",
"n[1]",
"n",
"1",
"tmp",
"for(i=0;i<=n[0];i++){\n for(j=0;j<=n[1];j++){\n if(j!=0) System.out.print(\" \");\n System.out.print(A[i][j]);\n }\n System.out.println();\n }",
"i=0;",
"i=0",
"i",
"0",
"i<=n[0]",
"i",
"n[0]",
"n",
"0",
"i++",
"i++",
"i",
"{\n for(j=0;j<=n[1];j++){\n if(j!=0) System.out.print(\" \");\n System.out.print(A[i][j]);\n }\n System.out.println();\n }",
"{\n for(j=0;j<=n[1];j++){\n if(j!=0) System.out.print(\" \");\n System.out.print(A[i][j]);\n }\n System.out.println();\n }",
"for(j=0;j<=n[1];j++){\n if(j!=0) System.out.print(\" \");\n System.out.print(A[i][j]);\n }",
"j=0;",
"j=0",
"j",
"0",
"j<=n[1]",
"j",
"n[1]",
"n",
"1",
"j++",
"j++",
"j",
"{\n if(j!=0) System.out.print(\" \");\n System.out.print(A[i][j]);\n }",
"{\n if(j!=0) System.out.print(\" \");\n System.out.print(A[i][j]);\n }",
"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",
"System.out.flush()",
"System.out.flush",
"System.out",
"System",
"System.out",
"String[] args",
"args"
] | import java.io.*;
import java.util.Arrays;
class Main{
public static void main(String[] args) throws IOException {
int i,j,tmp;
int[][] A = new int[101][101];
int[] n = new int[990];
String[] str = new String[990];
BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
str = in.readLine().split(" ");
for(i=0;i<2;i++){
n[i]=Integer.parseInt(str[i]);
}
for(i=0;i<n[0];i++){
str = in.readLine().split(" ");
for(j=0;j<n[1];j++){
tmp = Integer.parseInt(str[j]);
A[i][j]+=tmp; A[n[0]][j]+=tmp; A[i][n[1]]+=tmp; A[n[0]][n[1]]+=tmp;
}
}
for(i=0;i<=n[0];i++){
for(j=0;j<=n[1];j++){
if(j!=0) System.out.print(" ");
System.out.print(A[i][j]);
}
System.out.println();
}
System.out.flush();
}
} |
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
20,
17,
41,
13,
41,
13,
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,
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,
41,
13,
20,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
4,
18,
4,
18,
13,
17,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
4,
18,
13,
18,
13,
13,
0,
18,
18,
13,
13,
13,
13,
0,
18,
18,
13,
13,
13,
13,
0,
18,
18,
13,
13,
13,
13,
0,
18,
18,
13,
13,
13,
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,
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
],
[
235,
11
],
[
235,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
15,
17
],
[
14,
18
],
[
18,
19
],
[
18,
20
],
[
14,
22
],
[
22,
23
],
[
14,
24
],
[
24,
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
],
[
53,
54
],
[
53,
55
],
[
56,
57
],
[
56,
58
],
[
14,
59
],
[
59,
60
],
[
60,
61
],
[
61,
62
],
[
61,
63
],
[
59,
64
],
[
64,
65
],
[
64,
66
],
[
66,
67
],
[
66,
68
],
[
59,
69
],
[
69,
70
],
[
70,
71
],
[
59,
72
],
[
73,
73
],
[
73,
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
],
[
90,
91
],
[
91,
92
],
[
91,
93
],
[
90,
94
],
[
89,
95
],
[
14,
96
],
[
96,
97
],
[
96,
98
],
[
14,
100
],
[
100,
101
],
[
101,
102
],
[
102,
103
],
[
102,
104
],
[
100,
105
],
[
105,
106
],
[
105,
107
],
[
100,
108
],
[
108,
109
],
[
109,
110
],
[
100,
111
],
[
112,
112
],
[
112,
113
],
[
113,
114
],
[
113,
115
],
[
115,
116
],
[
116,
117
],
[
117,
118
],
[
118,
119
],
[
115,
120
],
[
112,
121
],
[
121,
122
],
[
121,
123
],
[
112,
124
],
[
124,
125
],
[
125,
126
],
[
126,
127
],
[
126,
128
],
[
124,
129
],
[
129,
130
],
[
129,
131
],
[
124,
132
],
[
132,
133
],
[
133,
134
],
[
124,
135
],
[
136,
136
],
[
136,
137
],
[
137,
138
],
[
137,
139
],
[
139,
140
],
[
140,
141
],
[
139,
142
],
[
142,
143
],
[
142,
144
],
[
136,
145
],
[
145,
146
],
[
146,
147
],
[
147,
148
],
[
147,
149
],
[
146,
150
],
[
145,
151
],
[
136,
152
],
[
152,
153
],
[
153,
154
],
[
154,
155
],
[
154,
156
],
[
153,
157
],
[
152,
158
],
[
136,
159
],
[
159,
160
],
[
160,
161
],
[
161,
162
],
[
161,
163
],
[
160,
164
],
[
159,
165
],
[
112,
166
],
[
166,
167
],
[
167,
168
],
[
168,
169
],
[
168,
170
],
[
167,
171
],
[
166,
172
],
[
172,
173
],
[
173,
174
],
[
173,
175
],
[
172,
176
],
[
14,
177
],
[
177,
178
],
[
178,
179
],
[
179,
180
],
[
179,
181
],
[
177,
182
],
[
182,
183
],
[
182,
184
],
[
184,
185
],
[
184,
186
],
[
177,
187
],
[
187,
188
],
[
188,
189
],
[
177,
190
],
[
191,
191
],
[
191,
192
],
[
192,
193
],
[
193,
194
],
[
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
],
[
209,
210
],
[
209,
211
],
[
207,
212
],
[
212,
213
],
[
213,
214
],
[
213,
215
],
[
212,
216
],
[
206,
217
],
[
217,
218
],
[
218,
219
],
[
218,
220
],
[
217,
221
],
[
221,
222
],
[
222,
223
],
[
223,
224
],
[
223,
225
],
[
221,
226
],
[
217,
227
],
[
227,
228
],
[
228,
229
],
[
229,
230
],
[
229,
231
],
[
12,
232
],
[
232,
233
],
[
0,
234
],
[
234,
235
],
[
234,
236
]
] | [
"import java.io.BufferedReader;\nimport java.io.IOException;\nimport java.io.InputStreamReader;\npublic class Main\n{\n\tpublic static void main(String[] args)throws IOException\n\t{\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\t\tString[] str = new String[2];\n\t\tint r, c;\n\t\tstr = br.readLine().split(\" \");\n\t\tr = Integer.parseInt(str[0]);\n\t\tc = Integer.parseInt(str[1]);\n\t\tint[][] mat = new int[r+1][c+1];\n//\t\tmat????????????\n\t\tfor(int i=0;i<r+1;i++)\n\t\t{\n\t\t\tfor(int j=0;j<c+1;j++)\n\t\t\t{\n\t\t\t\tmat[i][j] = 0;\n\t\t\t}\n\t\t}\n\t\tString[] str2 = new String[c];\n\t\tfor(int i=0; i<r; i++)\n\t\t{\n\t\t\tstr2 = br.readLine().split(\" \");\n\t\t\tint buf = 0;\n\t\t\tfor(int j=0; j<c; j++)\n\t\t\t{\n\t\t\t\tbuf = Integer.parseInt(str2[j]);\n\t\t\t\tmat[i][j] = buf;\n\t\t\t\tmat[i][c] += buf;\n\t\t\t\tmat[r][j] += buf;\n\t\t\t}\n\t\t\tmat[r][c] += mat[i][c];\n\t\t}\n\t\tfor(int i=0; i<r+1; i++)\n\t\t{\n\t\t\tfor(int j=0; j<c+1; j++)\n\t\t\t{\n\t\t\t\tSystem.out.print(mat[i][j]);\n\t\t\t\tif(j!=c) System.out.print(\" \");\n\t\t\t\telse System.out.println();\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{\n\tpublic static void main(String[] args)throws IOException\n\t{\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\t\tString[] str = new String[2];\n\t\tint r, c;\n\t\tstr = br.readLine().split(\" \");\n\t\tr = Integer.parseInt(str[0]);\n\t\tc = Integer.parseInt(str[1]);\n\t\tint[][] mat = new int[r+1][c+1];\n//\t\tmat????????????\n\t\tfor(int i=0;i<r+1;i++)\n\t\t{\n\t\t\tfor(int j=0;j<c+1;j++)\n\t\t\t{\n\t\t\t\tmat[i][j] = 0;\n\t\t\t}\n\t\t}\n\t\tString[] str2 = new String[c];\n\t\tfor(int i=0; i<r; i++)\n\t\t{\n\t\t\tstr2 = br.readLine().split(\" \");\n\t\t\tint buf = 0;\n\t\t\tfor(int j=0; j<c; j++)\n\t\t\t{\n\t\t\t\tbuf = Integer.parseInt(str2[j]);\n\t\t\t\tmat[i][j] = buf;\n\t\t\t\tmat[i][c] += buf;\n\t\t\t\tmat[r][j] += buf;\n\t\t\t}\n\t\t\tmat[r][c] += mat[i][c];\n\t\t}\n\t\tfor(int i=0; i<r+1; i++)\n\t\t{\n\t\t\tfor(int j=0; j<c+1; j++)\n\t\t\t{\n\t\t\t\tSystem.out.print(mat[i][j]);\n\t\t\t\tif(j!=c) System.out.print(\" \");\n\t\t\t\telse System.out.println();\n\t\t\t}\n\t\t}\n\t}\n}",
"Main",
"public static void main(String[] args)throws IOException\n\t{\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\t\tString[] str = new String[2];\n\t\tint r, c;\n\t\tstr = br.readLine().split(\" \");\n\t\tr = Integer.parseInt(str[0]);\n\t\tc = Integer.parseInt(str[1]);\n\t\tint[][] mat = new int[r+1][c+1];\n//\t\tmat????????????\n\t\tfor(int i=0;i<r+1;i++)\n\t\t{\n\t\t\tfor(int j=0;j<c+1;j++)\n\t\t\t{\n\t\t\t\tmat[i][j] = 0;\n\t\t\t}\n\t\t}\n\t\tString[] str2 = new String[c];\n\t\tfor(int i=0; i<r; i++)\n\t\t{\n\t\t\tstr2 = br.readLine().split(\" \");\n\t\t\tint buf = 0;\n\t\t\tfor(int j=0; j<c; j++)\n\t\t\t{\n\t\t\t\tbuf = Integer.parseInt(str2[j]);\n\t\t\t\tmat[i][j] = buf;\n\t\t\t\tmat[i][c] += buf;\n\t\t\t\tmat[r][j] += buf;\n\t\t\t}\n\t\t\tmat[r][c] += mat[i][c];\n\t\t}\n\t\tfor(int i=0; i<r+1; i++)\n\t\t{\n\t\t\tfor(int j=0; j<c+1; j++)\n\t\t\t{\n\t\t\t\tSystem.out.print(mat[i][j]);\n\t\t\t\tif(j!=c) System.out.print(\" \");\n\t\t\t\telse System.out.println();\n\t\t\t}\n\t\t}\n\t}",
"main",
"{\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\t\tString[] str = new String[2];\n\t\tint r, c;\n\t\tstr = br.readLine().split(\" \");\n\t\tr = Integer.parseInt(str[0]);\n\t\tc = Integer.parseInt(str[1]);\n\t\tint[][] mat = new int[r+1][c+1];\n//\t\tmat????????????\n\t\tfor(int i=0;i<r+1;i++)\n\t\t{\n\t\t\tfor(int j=0;j<c+1;j++)\n\t\t\t{\n\t\t\t\tmat[i][j] = 0;\n\t\t\t}\n\t\t}\n\t\tString[] str2 = new String[c];\n\t\tfor(int i=0; i<r; i++)\n\t\t{\n\t\t\tstr2 = br.readLine().split(\" \");\n\t\t\tint buf = 0;\n\t\t\tfor(int j=0; j<c; j++)\n\t\t\t{\n\t\t\t\tbuf = Integer.parseInt(str2[j]);\n\t\t\t\tmat[i][j] = buf;\n\t\t\t\tmat[i][c] += buf;\n\t\t\t\tmat[r][j] += buf;\n\t\t\t}\n\t\t\tmat[r][c] += mat[i][c];\n\t\t}\n\t\tfor(int i=0; i<r+1; i++)\n\t\t{\n\t\t\tfor(int j=0; j<c+1; j++)\n\t\t\t{\n\t\t\t\tSystem.out.print(mat[i][j]);\n\t\t\t\tif(j!=c) System.out.print(\" \");\n\t\t\t\telse System.out.println();\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 = new String[2];",
"str",
"new String[2]",
"2",
"int r",
"r",
"c;",
"c",
"str = br.readLine().split(\" \")",
"str",
"br.readLine().split(\" \")",
"br.readLine().split",
"br.readLine()",
"br.readLine",
"br",
"\" \"",
"r = Integer.parseInt(str[0])",
"r",
"Integer.parseInt(str[0])",
"Integer.parseInt",
"Integer",
"str[0]",
"str",
"0",
"c = Integer.parseInt(str[1])",
"c",
"Integer.parseInt(str[1])",
"Integer.parseInt",
"Integer",
"str[1]",
"str",
"1",
"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+1;i++)\n\t\t{\n\t\t\tfor(int j=0;j<c+1;j++)\n\t\t\t{\n\t\t\t\tmat[i][j] = 0;\n\t\t\t}\n\t\t}",
"int i=0;",
"int i=0;",
"i",
"0",
"i<r+1",
"i",
"r+1",
"r",
"1",
"i++",
"i++",
"i",
"{\n\t\t\tfor(int j=0;j<c+1;j++)\n\t\t\t{\n\t\t\t\tmat[i][j] = 0;\n\t\t\t}\n\t\t}",
"{\n\t\t\tfor(int j=0;j<c+1;j++)\n\t\t\t{\n\t\t\t\tmat[i][j] = 0;\n\t\t\t}\n\t\t}",
"for(int j=0;j<c+1;j++)\n\t\t\t{\n\t\t\t\tmat[i][j] = 0;\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\tmat[i][j] = 0;\n\t\t\t}",
"{\n\t\t\t\tmat[i][j] = 0;\n\t\t\t}",
"mat[i][j] = 0",
"mat[i][j]",
"mat[i]",
"mat",
"i",
"j",
"0",
"String[] str2 = new String[c];",
"str2",
"new String[c]",
"c",
"for(int i=0; i<r; i++)\n\t\t{\n\t\t\tstr2 = br.readLine().split(\" \");\n\t\t\tint buf = 0;\n\t\t\tfor(int j=0; j<c; j++)\n\t\t\t{\n\t\t\t\tbuf = Integer.parseInt(str2[j]);\n\t\t\t\tmat[i][j] = buf;\n\t\t\t\tmat[i][c] += buf;\n\t\t\t\tmat[r][j] += buf;\n\t\t\t}\n\t\t\tmat[r][c] += mat[i][c];\n\t\t}",
"int i=0;",
"int i=0;",
"i",
"0",
"i<r",
"i",
"r",
"i++",
"i++",
"i",
"{\n\t\t\tstr2 = br.readLine().split(\" \");\n\t\t\tint buf = 0;\n\t\t\tfor(int j=0; j<c; j++)\n\t\t\t{\n\t\t\t\tbuf = Integer.parseInt(str2[j]);\n\t\t\t\tmat[i][j] = buf;\n\t\t\t\tmat[i][c] += buf;\n\t\t\t\tmat[r][j] += buf;\n\t\t\t}\n\t\t\tmat[r][c] += mat[i][c];\n\t\t}",
"{\n\t\t\tstr2 = br.readLine().split(\" \");\n\t\t\tint buf = 0;\n\t\t\tfor(int j=0; j<c; j++)\n\t\t\t{\n\t\t\t\tbuf = Integer.parseInt(str2[j]);\n\t\t\t\tmat[i][j] = buf;\n\t\t\t\tmat[i][c] += buf;\n\t\t\t\tmat[r][j] += buf;\n\t\t\t}\n\t\t\tmat[r][c] += mat[i][c];\n\t\t}",
"str2 = br.readLine().split(\" \")",
"str2",
"br.readLine().split(\" \")",
"br.readLine().split",
"br.readLine()",
"br.readLine",
"br",
"\" \"",
"int buf = 0;",
"buf",
"0",
"for(int j=0; j<c; j++)\n\t\t\t{\n\t\t\t\tbuf = Integer.parseInt(str2[j]);\n\t\t\t\tmat[i][j] = buf;\n\t\t\t\tmat[i][c] += buf;\n\t\t\t\tmat[r][j] += buf;\n\t\t\t}",
"int j=0;",
"int j=0;",
"j",
"0",
"j<c",
"j",
"c",
"j++",
"j++",
"j",
"{\n\t\t\t\tbuf = Integer.parseInt(str2[j]);\n\t\t\t\tmat[i][j] = buf;\n\t\t\t\tmat[i][c] += buf;\n\t\t\t\tmat[r][j] += buf;\n\t\t\t}",
"{\n\t\t\t\tbuf = Integer.parseInt(str2[j]);\n\t\t\t\tmat[i][j] = buf;\n\t\t\t\tmat[i][c] += buf;\n\t\t\t\tmat[r][j] += buf;\n\t\t\t}",
"buf = Integer.parseInt(str2[j])",
"buf",
"Integer.parseInt(str2[j])",
"Integer.parseInt",
"Integer",
"str2[j]",
"str2",
"j",
"mat[i][j] = buf",
"mat[i][j]",
"mat[i]",
"mat",
"i",
"j",
"buf",
"mat[i][c] += buf",
"mat[i][c]",
"mat[i]",
"mat",
"i",
"c",
"buf",
"mat[r][j] += buf",
"mat[r][j]",
"mat[r]",
"mat",
"r",
"j",
"buf",
"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\t\t{\n\t\t\tfor(int j=0; j<c+1; j++)\n\t\t\t{\n\t\t\t\tSystem.out.print(mat[i][j]);\n\t\t\t\tif(j!=c) System.out.print(\" \");\n\t\t\t\telse System.out.println();\n\t\t\t}\n\t\t}",
"int i=0;",
"int i=0;",
"i",
"0",
"i<r+1",
"i",
"r+1",
"r",
"1",
"i++",
"i++",
"i",
"{\n\t\t\tfor(int j=0; j<c+1; j++)\n\t\t\t{\n\t\t\t\tSystem.out.print(mat[i][j]);\n\t\t\t\tif(j!=c) System.out.print(\" \");\n\t\t\t\telse System.out.println();\n\t\t\t}\n\t\t}",
"{\n\t\t\tfor(int j=0; j<c+1; j++)\n\t\t\t{\n\t\t\t\tSystem.out.print(mat[i][j]);\n\t\t\t\tif(j!=c) System.out.print(\" \");\n\t\t\t\telse System.out.println();\n\t\t\t}\n\t\t}",
"for(int j=0; j<c+1; j++)\n\t\t\t{\n\t\t\t\tSystem.out.print(mat[i][j]);\n\t\t\t\tif(j!=c) System.out.print(\" \");\n\t\t\t\telse System.out.println();\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) System.out.print(\" \");\n\t\t\t\telse System.out.println();\n\t\t\t}",
"{\n\t\t\t\tSystem.out.print(mat[i][j]);\n\t\t\t\tif(j!=c) System.out.print(\" \");\n\t\t\t\telse System.out.println();\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) System.out.print(\" \");\n\t\t\t\telse System.out.println();",
"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\tpublic static void main(String[] args)throws IOException\n\t{\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\t\tString[] str = new String[2];\n\t\tint r, c;\n\t\tstr = br.readLine().split(\" \");\n\t\tr = Integer.parseInt(str[0]);\n\t\tc = Integer.parseInt(str[1]);\n\t\tint[][] mat = new int[r+1][c+1];\n//\t\tmat????????????\n\t\tfor(int i=0;i<r+1;i++)\n\t\t{\n\t\t\tfor(int j=0;j<c+1;j++)\n\t\t\t{\n\t\t\t\tmat[i][j] = 0;\n\t\t\t}\n\t\t}\n\t\tString[] str2 = new String[c];\n\t\tfor(int i=0; i<r; i++)\n\t\t{\n\t\t\tstr2 = br.readLine().split(\" \");\n\t\t\tint buf = 0;\n\t\t\tfor(int j=0; j<c; j++)\n\t\t\t{\n\t\t\t\tbuf = Integer.parseInt(str2[j]);\n\t\t\t\tmat[i][j] = buf;\n\t\t\t\tmat[i][c] += buf;\n\t\t\t\tmat[r][j] += buf;\n\t\t\t}\n\t\t\tmat[r][c] += mat[i][c];\n\t\t}\n\t\tfor(int i=0; i<r+1; i++)\n\t\t{\n\t\t\tfor(int j=0; j<c+1; j++)\n\t\t\t{\n\t\t\t\tSystem.out.print(mat[i][j]);\n\t\t\t\tif(j!=c) System.out.print(\" \");\n\t\t\t\telse System.out.println();\n\t\t\t}\n\t\t}\n\t}\n}",
"public class Main\n{\n\tpublic static void main(String[] args)throws IOException\n\t{\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\t\tString[] str = new String[2];\n\t\tint r, c;\n\t\tstr = br.readLine().split(\" \");\n\t\tr = Integer.parseInt(str[0]);\n\t\tc = Integer.parseInt(str[1]);\n\t\tint[][] mat = new int[r+1][c+1];\n//\t\tmat????????????\n\t\tfor(int i=0;i<r+1;i++)\n\t\t{\n\t\t\tfor(int j=0;j<c+1;j++)\n\t\t\t{\n\t\t\t\tmat[i][j] = 0;\n\t\t\t}\n\t\t}\n\t\tString[] str2 = new String[c];\n\t\tfor(int i=0; i<r; i++)\n\t\t{\n\t\t\tstr2 = br.readLine().split(\" \");\n\t\t\tint buf = 0;\n\t\t\tfor(int j=0; j<c; j++)\n\t\t\t{\n\t\t\t\tbuf = Integer.parseInt(str2[j]);\n\t\t\t\tmat[i][j] = buf;\n\t\t\t\tmat[i][c] += buf;\n\t\t\t\tmat[r][j] += buf;\n\t\t\t}\n\t\t\tmat[r][c] += mat[i][c];\n\t\t}\n\t\tfor(int i=0; i<r+1; i++)\n\t\t{\n\t\t\tfor(int j=0; j<c+1; j++)\n\t\t\t{\n\t\t\t\tSystem.out.print(mat[i][j]);\n\t\t\t\tif(j!=c) System.out.print(\" \");\n\t\t\t\telse System.out.println();\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 = new String[2];
int r, c;
str = br.readLine().split(" ");
r = Integer.parseInt(str[0]);
c = Integer.parseInt(str[1]);
int[][] mat = new int[r+1][c+1];
// mat????????????
for(int i=0;i<r+1;i++)
{
for(int j=0;j<c+1;j++)
{
mat[i][j] = 0;
}
}
String[] str2 = new String[c];
for(int i=0; i<r; i++)
{
str2 = br.readLine().split(" ");
int buf = 0;
for(int j=0; j<c; j++)
{
buf = Integer.parseInt(str2[j]);
mat[i][j] = buf;
mat[i][c] += buf;
mat[r][j] += buf;
}
mat[r][c] += mat[i][c];
}
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(" ");
else System.out.println();
}
}
}
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.