node_ids
listlengths 4
1.4k
| edge_index
listlengths 1
2.22k
| text
listlengths 4
1.4k
| source
stringlengths 14
427k
|
---|---|---|---|
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
41,
13,
17,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
41,
13,
4,
18,
13,
0,
13,
13,
14,
2,
13,
13,
30,
0,
13,
40,
17,
30,
0,
13,
2,
13,
13,
4,
18,
18,
13,
13,
13,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
73,
5
],
[
73,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
8,
17
],
[
17,
18
],
[
17,
19
],
[
19,
20
],
[
20,
21
],
[
8,
22
],
[
22,
23
],
[
22,
24
],
[
8,
25
],
[
25,
26
],
[
25,
27
],
[
8,
28
],
[
28,
29
],
[
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
],
[
43,
44
],
[
44,
45
],
[
40,
46
],
[
46,
47
],
[
46,
48
],
[
40,
49
],
[
49,
50
],
[
50,
51
],
[
50,
52
],
[
49,
53
],
[
53,
54
],
[
54,
55
],
[
54,
56
],
[
56,
57
],
[
49,
58
],
[
58,
59
],
[
59,
60
],
[
59,
61
],
[
61,
62
],
[
61,
63
],
[
8,
64
],
[
64,
65
],
[
65,
66
],
[
66,
67
],
[
66,
68
],
[
64,
69
],
[
6,
70
],
[
70,
71
],
[
0,
72
],
[
72,
73
],
[
72,
74
]
] |
[
"import java.util.Scanner;\npublic class Main{\n\n\n public static void main(String[] args) {\n\n\n Scanner reader = new Scanner(System.in);\n\n int N = reader.nextInt();\n int M = reader.nextInt();\n int Total =0;\n int b=0;\n\n for (int i = 0; i <M; i++) {\n int A = reader.nextInt();\n\n Total +=A;\n\n if (Total>N){\n\n b=-1;\n } else {\n b = N-Total;\n\n\n }\n\n }\n\n System.out.println(b);\n\n\n }\n\n}\n\n",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main{\n\n\n public static void main(String[] args) {\n\n\n Scanner reader = new Scanner(System.in);\n\n int N = reader.nextInt();\n int M = reader.nextInt();\n int Total =0;\n int b=0;\n\n for (int i = 0; i <M; i++) {\n int A = reader.nextInt();\n\n Total +=A;\n\n if (Total>N){\n\n b=-1;\n } else {\n b = N-Total;\n\n\n }\n\n }\n\n System.out.println(b);\n\n\n }\n\n}",
"Main",
"public static void main(String[] args) {\n\n\n Scanner reader = new Scanner(System.in);\n\n int N = reader.nextInt();\n int M = reader.nextInt();\n int Total =0;\n int b=0;\n\n for (int i = 0; i <M; i++) {\n int A = reader.nextInt();\n\n Total +=A;\n\n if (Total>N){\n\n b=-1;\n } else {\n b = N-Total;\n\n\n }\n\n }\n\n System.out.println(b);\n\n\n }",
"main",
"{\n\n\n Scanner reader = new Scanner(System.in);\n\n int N = reader.nextInt();\n int M = reader.nextInt();\n int Total =0;\n int b=0;\n\n for (int i = 0; i <M; i++) {\n int A = reader.nextInt();\n\n Total +=A;\n\n if (Total>N){\n\n b=-1;\n } else {\n b = N-Total;\n\n\n }\n\n }\n\n System.out.println(b);\n\n\n }",
"Scanner reader = new Scanner(System.in);",
"reader",
"new Scanner(System.in)",
"int N = reader.nextInt();",
"N",
"reader.nextInt()",
"reader.nextInt",
"reader",
"int M = reader.nextInt();",
"M",
"reader.nextInt()",
"reader.nextInt",
"reader",
"int Total =0;",
"Total",
"0",
"int b=0;",
"b",
"0",
"for (int i = 0; i <M; i++) {\n int A = reader.nextInt();\n\n Total +=A;\n\n if (Total>N){\n\n b=-1;\n } else {\n b = N-Total;\n\n\n }\n\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i <M",
"i",
"M",
"i++",
"i++",
"i",
"{\n int A = reader.nextInt();\n\n Total +=A;\n\n if (Total>N){\n\n b=-1;\n } else {\n b = N-Total;\n\n\n }\n\n }",
"{\n int A = reader.nextInt();\n\n Total +=A;\n\n if (Total>N){\n\n b=-1;\n } else {\n b = N-Total;\n\n\n }\n\n }",
"int A = reader.nextInt();",
"A",
"reader.nextInt()",
"reader.nextInt",
"reader",
"Total +=A",
"Total",
"A",
"if (Total>N){\n\n b=-1;\n } else {\n b = N-Total;\n\n\n }",
"Total>N",
"Total",
"N",
"{\n\n b=-1;\n }",
"b=-1",
"b",
"-1",
"1",
"{\n b = N-Total;\n\n\n }",
"b = N-Total",
"b",
"N-Total",
"N",
"Total",
"System.out.println(b)",
"System.out.println",
"System.out",
"System",
"System.out",
"b",
"String[] args",
"args",
"public class Main{\n\n\n public static void main(String[] args) {\n\n\n Scanner reader = new Scanner(System.in);\n\n int N = reader.nextInt();\n int M = reader.nextInt();\n int Total =0;\n int b=0;\n\n for (int i = 0; i <M; i++) {\n int A = reader.nextInt();\n\n Total +=A;\n\n if (Total>N){\n\n b=-1;\n } else {\n b = N-Total;\n\n\n }\n\n }\n\n System.out.println(b);\n\n\n }\n\n}",
"public class Main{\n\n\n public static void main(String[] args) {\n\n\n Scanner reader = new Scanner(System.in);\n\n int N = reader.nextInt();\n int M = reader.nextInt();\n int Total =0;\n int b=0;\n\n for (int i = 0; i <M; i++) {\n int A = reader.nextInt();\n\n Total +=A;\n\n if (Total>N){\n\n b=-1;\n } else {\n b = N-Total;\n\n\n }\n\n }\n\n System.out.println(b);\n\n\n }\n\n}",
"Main"
] |
import java.util.Scanner;
public class Main{
public static void main(String[] args) {
Scanner reader = new Scanner(System.in);
int N = reader.nextInt();
int M = reader.nextInt();
int Total =0;
int b=0;
for (int i = 0; i <M; i++) {
int A = reader.nextInt();
Total +=A;
if (Total>N){
b=-1;
} else {
b = N-Total;
}
}
System.out.println(b);
}
}
|
[
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,
13,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
18,
13,
13,
4,
18,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
18,
13,
13,
0,
13,
2,
13,
13,
14,
2,
13,
17,
30,
4,
18,
18,
13,
13,
40,
17,
14,
2,
13,
17,
30,
4,
18,
18,
13,
13,
13,
23,
13,
6,
13,
41,
13,
41,
13,
12,
13,
30,
0,
13,
20,
12,
13,
30,
42,
2,
2,
13,
17,
40,
4,
18,
13,
30,
38,
5,
13,
30,
4,
18,
13,
30,
0,
13,
20,
29,
4,
18,
13,
12,
13,
30,
29,
4,
18,
13,
4,
13,
12,
13,
30,
29,
4,
18,
13,
4,
13,
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
],
[
165,
14
],
[
165,
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
],
[
17,
35
],
[
35,
36
],
[
35,
37
],
[
17,
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
],
[
55,
56
],
[
56,
57
],
[
17,
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
],
[
73,
75
],
[
70,
76
],
[
76,
77
],
[
76,
78
],
[
78,
79
],
[
78,
80
],
[
17,
81
],
[
81,
82
],
[
82,
83
],
[
82,
84
],
[
81,
85
],
[
85,
86
],
[
86,
87
],
[
87,
88
],
[
88,
89
],
[
88,
90
],
[
86,
91
],
[
91,
92
],
[
81,
93
],
[
93,
94
],
[
94,
95
],
[
94,
96
],
[
93,
97
],
[
97,
98
],
[
98,
99
],
[
99,
100
],
[
100,
101
],
[
100,
102
],
[
98,
103
],
[
15,
104
],
[
104,
105
],
[
0,
106
],
[
106,
107
],
[
106,
108
],
[
108,
109
],
[
106,
110
],
[
110,
111
],
[
106,
112
],
[
112,
113
],
[
112,
114
],
[
114,
115
],
[
115,
116
],
[
115,
117
],
[
106,
118
],
[
118,
119
],
[
118,
120
],
[
120,
121
],
[
121,
122
],
[
122,
123
],
[
123,
124
],
[
123,
125
],
[
122,
126
],
[
126,
127
],
[
127,
128
],
[
128,
129
],
[
121,
130
],
[
130,
131
],
[
131,
132
],
[
132,
133
],
[
132,
134
],
[
134,
135
],
[
135,
136
],
[
136,
137
],
[
131,
138
],
[
138,
139
],
[
139,
140
],
[
139,
141
],
[
120,
142
],
[
142,
143
],
[
143,
144
],
[
144,
145
],
[
106,
146
],
[
146,
147
],
[
146,
148
],
[
148,
149
],
[
149,
150
],
[
150,
151
],
[
151,
152
],
[
150,
153
],
[
153,
154
],
[
106,
155
],
[
155,
156
],
[
155,
157
],
[
157,
158
],
[
158,
159
],
[
159,
160
],
[
160,
161
],
[
159,
162
],
[
162,
163
],
[
0,
164
],
[
164,
165
],
[
164,
166
]
] |
[
"import java.io.BufferedReader;\nimport java.io.IOException;\nimport java.io.InputStreamReader;\nimport java.util.StringTokenizer;\n\npublic class Main {\n\n\n\tpublic static void main(String[] args) {\n\t\tFastScanner fsc = new FastScanner();\n\n\t\tint SV = fsc.nextInt();\n\t\tint HW = fsc.nextInt();\n\t\tint[] HW_count = new int[HW];\n\t\tint Total = 0;\n\t\tfor(int i = 0; HW > i; i++) {\n\t\t\tHW_count[i] = fsc.nextInt();\n\t\t}\n\t\t//้ในใๆฎๆฅๆฐ่จ็ฎ\n\t\tfor(int num = 0; HW > num; num++ ) {\n\t\t\tTotal = HW_count[num];\n\t\t\tSV = SV - Total;\n\t\t}\n\n\t\t//ๅฎฟ้กใ้ใซๅใใชใ\n\t\tif(SV < 0) {\n\t\t\tSystem.out.println(-1);\n\t\t}\n\t\t//้ในใๆฅๆฐใๅบๅ\n\t\telse if(SV >= 0) {\n\t\t\tSystem.out.println(SV);\n\t\t}\n\t}\n}\n\n\n\n\nclass FastScanner {\n\n\tBufferedReader br;\n\n\tStringTokenizer st;\n\n\n\n\tpublic FastScanner() {\n\n\t\tbr = new BufferedReader(new InputStreamReader(System.in));\n\n\t}\n\n\n\n\tString next() {\n\n\t\twhile (st == null || !st.hasMoreElements()) {\n\n\t\t\ttry {\n\n\t\t\t\tst = new StringTokenizer(br.readLine());\n\n\t\t\t} catch (IOException e) {\n\n\t\t\t\te.printStackTrace();\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn st.nextToken();\n\n\t}\n\n\n\n\tint nextInt() {\n\n\t\treturn Integer.parseInt(next());\n\n\t}\n\n\n\n\tlong nextLong() {\n\n\t\treturn Long.parseLong(next());\n\n\t}\n\n}",
"import java.io.BufferedReader;",
"BufferedReader",
"java.io",
"import java.io.IOException;",
"IOException",
"java.io",
"import java.io.InputStreamReader;",
"InputStreamReader",
"java.io",
"import java.util.StringTokenizer;",
"StringTokenizer",
"java.util",
"public class Main {\n\n\n\tpublic static void main(String[] args) {\n\t\tFastScanner fsc = new FastScanner();\n\n\t\tint SV = fsc.nextInt();\n\t\tint HW = fsc.nextInt();\n\t\tint[] HW_count = new int[HW];\n\t\tint Total = 0;\n\t\tfor(int i = 0; HW > i; i++) {\n\t\t\tHW_count[i] = fsc.nextInt();\n\t\t}\n\t\t//้ในใๆฎๆฅๆฐ่จ็ฎ\n\t\tfor(int num = 0; HW > num; num++ ) {\n\t\t\tTotal = HW_count[num];\n\t\t\tSV = SV - Total;\n\t\t}\n\n\t\t//ๅฎฟ้กใ้ใซๅใใชใ\n\t\tif(SV < 0) {\n\t\t\tSystem.out.println(-1);\n\t\t}\n\t\t//้ในใๆฅๆฐใๅบๅ\n\t\telse if(SV >= 0) {\n\t\t\tSystem.out.println(SV);\n\t\t}\n\t}\n}",
"Main",
"public static void main(String[] args) {\n\t\tFastScanner fsc = new FastScanner();\n\n\t\tint SV = fsc.nextInt();\n\t\tint HW = fsc.nextInt();\n\t\tint[] HW_count = new int[HW];\n\t\tint Total = 0;\n\t\tfor(int i = 0; HW > i; i++) {\n\t\t\tHW_count[i] = fsc.nextInt();\n\t\t}\n\t\t//้ในใๆฎๆฅๆฐ่จ็ฎ\n\t\tfor(int num = 0; HW > num; num++ ) {\n\t\t\tTotal = HW_count[num];\n\t\t\tSV = SV - Total;\n\t\t}\n\n\t\t//ๅฎฟ้กใ้ใซๅใใชใ\n\t\tif(SV < 0) {\n\t\t\tSystem.out.println(-1);\n\t\t}\n\t\t//้ในใๆฅๆฐใๅบๅ\n\t\telse if(SV >= 0) {\n\t\t\tSystem.out.println(SV);\n\t\t}\n\t}",
"main",
"{\n\t\tFastScanner fsc = new FastScanner();\n\n\t\tint SV = fsc.nextInt();\n\t\tint HW = fsc.nextInt();\n\t\tint[] HW_count = new int[HW];\n\t\tint Total = 0;\n\t\tfor(int i = 0; HW > i; i++) {\n\t\t\tHW_count[i] = fsc.nextInt();\n\t\t}\n\t\t//้ในใๆฎๆฅๆฐ่จ็ฎ\n\t\tfor(int num = 0; HW > num; num++ ) {\n\t\t\tTotal = HW_count[num];\n\t\t\tSV = SV - Total;\n\t\t}\n\n\t\t//ๅฎฟ้กใ้ใซๅใใชใ\n\t\tif(SV < 0) {\n\t\t\tSystem.out.println(-1);\n\t\t}\n\t\t//้ในใๆฅๆฐใๅบๅ\n\t\telse if(SV >= 0) {\n\t\t\tSystem.out.println(SV);\n\t\t}\n\t}",
"FastScanner fsc = new FastScanner();",
"fsc",
"new FastScanner()",
"int SV = fsc.nextInt();",
"SV",
"fsc.nextInt()",
"fsc.nextInt",
"fsc",
"int HW = fsc.nextInt();",
"HW",
"fsc.nextInt()",
"fsc.nextInt",
"fsc",
"int[] HW_count = new int[HW];",
"HW_count",
"new int[HW]",
"HW",
"int Total = 0;",
"Total",
"0",
"for(int i = 0; HW > i; i++) {\n\t\t\tHW_count[i] = fsc.nextInt();\n\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"HW > i",
"HW",
"i",
"i++",
"i++",
"i",
"{\n\t\t\tHW_count[i] = fsc.nextInt();\n\t\t}",
"{\n\t\t\tHW_count[i] = fsc.nextInt();\n\t\t}",
"HW_count[i] = fsc.nextInt()",
"HW_count[i]",
"HW_count",
"i",
"fsc.nextInt()",
"fsc.nextInt",
"fsc",
"for(int num = 0; HW > num; num++ ) {\n\t\t\tTotal = HW_count[num];\n\t\t\tSV = SV - Total;\n\t\t}",
"int num = 0;",
"int num = 0;",
"num",
"0",
"HW > num",
"HW",
"num",
"num++",
"num++",
"num",
"{\n\t\t\tTotal = HW_count[num];\n\t\t\tSV = SV - Total;\n\t\t}",
"{\n\t\t\tTotal = HW_count[num];\n\t\t\tSV = SV - Total;\n\t\t}",
"Total = HW_count[num]",
"Total",
"HW_count[num]",
"HW_count",
"num",
"SV = SV - Total",
"SV",
"SV - Total",
"SV",
"Total",
"if(SV < 0) {\n\t\t\tSystem.out.println(-1);\n\t\t}\n\t\t//้ในใๆฅๆฐใๅบๅ\n\t\telse if(SV >= 0) {\n\t\t\tSystem.out.println(SV);\n\t\t}",
"SV < 0",
"SV",
"0",
"{\n\t\t\tSystem.out.println(-1);\n\t\t}",
"System.out.println(-1)",
"System.out.println",
"System.out",
"System",
"System.out",
"-1",
"1",
"if(SV >= 0) {\n\t\t\tSystem.out.println(SV);\n\t\t}",
"SV >= 0",
"SV",
"0",
"{\n\t\t\tSystem.out.println(SV);\n\t\t}",
"System.out.println(SV)",
"System.out.println",
"System.out",
"System",
"System.out",
"SV",
"String[] args",
"args",
"class FastScanner {\n\n\tBufferedReader br;\n\n\tStringTokenizer st;\n\n\n\n\tpublic FastScanner() {\n\n\t\tbr = new BufferedReader(new InputStreamReader(System.in));\n\n\t}\n\n\n\n\tString next() {\n\n\t\twhile (st == null || !st.hasMoreElements()) {\n\n\t\t\ttry {\n\n\t\t\t\tst = new StringTokenizer(br.readLine());\n\n\t\t\t} catch (IOException e) {\n\n\t\t\t\te.printStackTrace();\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn st.nextToken();\n\n\t}\n\n\n\n\tint nextInt() {\n\n\t\treturn Integer.parseInt(next());\n\n\t}\n\n\n\n\tlong nextLong() {\n\n\t\treturn Long.parseLong(next());\n\n\t}\n\n}",
"FastScanner",
"BufferedReader br;",
"br",
"StringTokenizer st;",
"st",
"public FastScanner() {\n\n\t\tbr = new BufferedReader(new InputStreamReader(System.in));\n\n\t}",
"FastScanner",
"{\n\n\t\tbr = new BufferedReader(new InputStreamReader(System.in));\n\n\t}",
"br = new BufferedReader(new InputStreamReader(System.in))",
"br",
"new BufferedReader(new InputStreamReader(System.in))",
"String next() {\n\n\t\twhile (st == null || !st.hasMoreElements()) {\n\n\t\t\ttry {\n\n\t\t\t\tst = new StringTokenizer(br.readLine());\n\n\t\t\t} catch (IOException e) {\n\n\t\t\t\te.printStackTrace();\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn st.nextToken();\n\n\t}",
"next",
"{\n\n\t\twhile (st == null || !st.hasMoreElements()) {\n\n\t\t\ttry {\n\n\t\t\t\tst = new StringTokenizer(br.readLine());\n\n\t\t\t} catch (IOException e) {\n\n\t\t\t\te.printStackTrace();\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn st.nextToken();\n\n\t}",
"while (st == null || !st.hasMoreElements()) {\n\n\t\t\ttry {\n\n\t\t\t\tst = new StringTokenizer(br.readLine());\n\n\t\t\t} catch (IOException e) {\n\n\t\t\t\te.printStackTrace();\n\n\t\t\t}\n\n\t\t}",
"st == null || !st.hasMoreElements()",
"st == null",
"st",
"null",
"!st.hasMoreElements()",
"st.hasMoreElements()",
"st.hasMoreElements",
"st",
"{\n\n\t\t\ttry {\n\n\t\t\t\tst = new StringTokenizer(br.readLine());\n\n\t\t\t} catch (IOException e) {\n\n\t\t\t\te.printStackTrace();\n\n\t\t\t}\n\n\t\t}",
"try {\n\n\t\t\t\tst = new StringTokenizer(br.readLine());\n\n\t\t\t} catch (IOException e) {\n\n\t\t\t\te.printStackTrace();\n\n\t\t\t}",
"catch (IOException e) {\n\n\t\t\t\te.printStackTrace();\n\n\t\t\t}",
"IOException e",
"{\n\n\t\t\t\te.printStackTrace();\n\n\t\t\t}",
"e.printStackTrace()",
"e.printStackTrace",
"e",
"{\n\n\t\t\t\tst = new StringTokenizer(br.readLine());\n\n\t\t\t}",
"st = new StringTokenizer(br.readLine())",
"st",
"new StringTokenizer(br.readLine())",
"return st.nextToken();",
"st.nextToken()",
"st.nextToken",
"st",
"int nextInt() {\n\n\t\treturn Integer.parseInt(next());\n\n\t}",
"nextInt",
"{\n\n\t\treturn Integer.parseInt(next());\n\n\t}",
"return Integer.parseInt(next());",
"Integer.parseInt(next())",
"Integer.parseInt",
"Integer",
"next()",
"next",
"long nextLong() {\n\n\t\treturn Long.parseLong(next());\n\n\t}",
"nextLong",
"{\n\n\t\treturn Long.parseLong(next());\n\n\t}",
"return Long.parseLong(next());",
"Long.parseLong(next())",
"Long.parseLong",
"Long",
"next()",
"next",
"public class Main {\n\n\n\tpublic static void main(String[] args) {\n\t\tFastScanner fsc = new FastScanner();\n\n\t\tint SV = fsc.nextInt();\n\t\tint HW = fsc.nextInt();\n\t\tint[] HW_count = new int[HW];\n\t\tint Total = 0;\n\t\tfor(int i = 0; HW > i; i++) {\n\t\t\tHW_count[i] = fsc.nextInt();\n\t\t}\n\t\t//้ในใๆฎๆฅๆฐ่จ็ฎ\n\t\tfor(int num = 0; HW > num; num++ ) {\n\t\t\tTotal = HW_count[num];\n\t\t\tSV = SV - Total;\n\t\t}\n\n\t\t//ๅฎฟ้กใ้ใซๅใใชใ\n\t\tif(SV < 0) {\n\t\t\tSystem.out.println(-1);\n\t\t}\n\t\t//้ในใๆฅๆฐใๅบๅ\n\t\telse if(SV >= 0) {\n\t\t\tSystem.out.println(SV);\n\t\t}\n\t}\n}",
"public class Main {\n\n\n\tpublic static void main(String[] args) {\n\t\tFastScanner fsc = new FastScanner();\n\n\t\tint SV = fsc.nextInt();\n\t\tint HW = fsc.nextInt();\n\t\tint[] HW_count = new int[HW];\n\t\tint Total = 0;\n\t\tfor(int i = 0; HW > i; i++) {\n\t\t\tHW_count[i] = fsc.nextInt();\n\t\t}\n\t\t//้ในใๆฎๆฅๆฐ่จ็ฎ\n\t\tfor(int num = 0; HW > num; num++ ) {\n\t\t\tTotal = HW_count[num];\n\t\t\tSV = SV - Total;\n\t\t}\n\n\t\t//ๅฎฟ้กใ้ใซๅใใชใ\n\t\tif(SV < 0) {\n\t\t\tSystem.out.println(-1);\n\t\t}\n\t\t//้ในใๆฅๆฐใๅบๅ\n\t\telse if(SV >= 0) {\n\t\t\tSystem.out.println(SV);\n\t\t}\n\t}\n}",
"Main"
] |
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.StringTokenizer;
public class Main {
public static void main(String[] args) {
FastScanner fsc = new FastScanner();
int SV = fsc.nextInt();
int HW = fsc.nextInt();
int[] HW_count = new int[HW];
int Total = 0;
for(int i = 0; HW > i; i++) {
HW_count[i] = fsc.nextInt();
}
//้ในใๆฎๆฅๆฐ่จ็ฎ
for(int num = 0; HW > num; num++ ) {
Total = HW_count[num];
SV = SV - Total;
}
//ๅฎฟ้กใ้ใซๅใใชใ
if(SV < 0) {
System.out.println(-1);
}
//้ในใๆฅๆฐใๅบๅ
else if(SV >= 0) {
System.out.println(SV);
}
}
}
class FastScanner {
BufferedReader br;
StringTokenizer st;
public FastScanner() {
br = new BufferedReader(new InputStreamReader(System.in));
}
String next() {
while (st == null || !st.hasMoreElements()) {
try {
st = new StringTokenizer(br.readLine());
} catch (IOException e) {
e.printStackTrace();
}
}
return st.nextToken();
}
int nextInt() {
return Integer.parseInt(next());
}
long nextLong() {
return Long.parseLong(next());
}
}
|
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
4,
18,
13,
14,
2,
13,
17,
30,
4,
18,
18,
13,
13,
40,
17,
29,
4,
18,
18,
13,
13,
13,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
62,
5
],
[
62,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
8,
17
],
[
17,
18
],
[
17,
19
],
[
19,
20
],
[
20,
21
],
[
8,
22
],
[
22,
23
],
[
23,
24
],
[
24,
25
],
[
24,
26
],
[
22,
27
],
[
27,
28
],
[
27,
29
],
[
22,
30
],
[
30,
31
],
[
31,
32
],
[
22,
33
],
[
34,
34
],
[
34,
35
],
[
35,
36
],
[
35,
37
],
[
37,
38
],
[
38,
39
],
[
34,
40
],
[
40,
41
],
[
41,
42
],
[
41,
43
],
[
40,
44
],
[
44,
45
],
[
45,
46
],
[
46,
47
],
[
47,
48
],
[
47,
49
],
[
45,
50
],
[
50,
51
],
[
44,
52
],
[
8,
53
],
[
53,
54
],
[
54,
55
],
[
55,
56
],
[
55,
57
],
[
53,
58
],
[
6,
59
],
[
59,
60
],
[
0,
61
],
[
61,
62
],
[
61,
63
]
] |
[
"import java.util.Scanner;\n\npublic class Main {\n public static void main(String[] args) {\n Scanner scanner = new Scanner(System.in);\n int holiday = scanner.nextInt();\n int num = scanner.nextInt();\n\n for (int i = 0; i < num; i++) {\n holiday -= scanner.nextInt();\n if (holiday < 0) {\n System.out.println(-1);\n return;\n }\n }\n System.out.println(holiday);\n }\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n public static void main(String[] args) {\n Scanner scanner = new Scanner(System.in);\n int holiday = scanner.nextInt();\n int num = scanner.nextInt();\n\n for (int i = 0; i < num; i++) {\n holiday -= scanner.nextInt();\n if (holiday < 0) {\n System.out.println(-1);\n return;\n }\n }\n System.out.println(holiday);\n }\n}",
"Main",
"public static void main(String[] args) {\n Scanner scanner = new Scanner(System.in);\n int holiday = scanner.nextInt();\n int num = scanner.nextInt();\n\n for (int i = 0; i < num; i++) {\n holiday -= scanner.nextInt();\n if (holiday < 0) {\n System.out.println(-1);\n return;\n }\n }\n System.out.println(holiday);\n }",
"main",
"{\n Scanner scanner = new Scanner(System.in);\n int holiday = scanner.nextInt();\n int num = scanner.nextInt();\n\n for (int i = 0; i < num; i++) {\n holiday -= scanner.nextInt();\n if (holiday < 0) {\n System.out.println(-1);\n return;\n }\n }\n System.out.println(holiday);\n }",
"Scanner scanner = new Scanner(System.in);",
"scanner",
"new Scanner(System.in)",
"int holiday = scanner.nextInt();",
"holiday",
"scanner.nextInt()",
"scanner.nextInt",
"scanner",
"int num = scanner.nextInt();",
"num",
"scanner.nextInt()",
"scanner.nextInt",
"scanner",
"for (int i = 0; i < num; i++) {\n holiday -= scanner.nextInt();\n if (holiday < 0) {\n System.out.println(-1);\n return;\n }\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < num",
"i",
"num",
"i++",
"i++",
"i",
"{\n holiday -= scanner.nextInt();\n if (holiday < 0) {\n System.out.println(-1);\n return;\n }\n }",
"{\n holiday -= scanner.nextInt();\n if (holiday < 0) {\n System.out.println(-1);\n return;\n }\n }",
"holiday -= scanner.nextInt()",
"holiday",
"scanner.nextInt()",
"scanner.nextInt",
"scanner",
"if (holiday < 0) {\n System.out.println(-1);\n return;\n }",
"holiday < 0",
"holiday",
"0",
"{\n System.out.println(-1);\n return;\n }",
"System.out.println(-1)",
"System.out.println",
"System.out",
"System",
"System.out",
"-1",
"1",
"return;",
"System.out.println(holiday)",
"System.out.println",
"System.out",
"System",
"System.out",
"holiday",
"String[] args",
"args",
"public class Main {\n public static void main(String[] args) {\n Scanner scanner = new Scanner(System.in);\n int holiday = scanner.nextInt();\n int num = scanner.nextInt();\n\n for (int i = 0; i < num; i++) {\n holiday -= scanner.nextInt();\n if (holiday < 0) {\n System.out.println(-1);\n return;\n }\n }\n System.out.println(holiday);\n }\n}",
"public class Main {\n public static void main(String[] args) {\n Scanner scanner = new Scanner(System.in);\n int holiday = scanner.nextInt();\n int num = scanner.nextInt();\n\n for (int i = 0; i < num; i++) {\n holiday -= scanner.nextInt();\n if (holiday < 0) {\n System.out.println(-1);\n return;\n }\n }\n System.out.println(holiday);\n }\n}",
"Main"
] |
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
int holiday = scanner.nextInt();
int num = scanner.nextInt();
for (int i = 0; i < num; i++) {
holiday -= scanner.nextInt();
if (holiday < 0) {
System.out.println(-1);
return;
}
}
System.out.println(holiday);
}
}
|
[
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,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
41,
13,
4,
18,
13,
0,
13,
13,
4,
18,
18,
13,
13,
8,
2,
2,
13,
13,
17,
40,
17,
2,
13,
13,
4,
18,
13,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
68,
5
],
[
68,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
8,
17
],
[
17,
18
],
[
17,
19
],
[
19,
20
],
[
20,
21
],
[
8,
22
],
[
22,
23
],
[
22,
24
],
[
8,
25
],
[
25,
26
],
[
26,
27
],
[
27,
28
],
[
27,
29
],
[
25,
30
],
[
30,
31
],
[
30,
32
],
[
25,
33
],
[
33,
34
],
[
34,
35
],
[
25,
36
],
[
37,
37
],
[
37,
38
],
[
38,
39
],
[
38,
40
],
[
40,
41
],
[
41,
42
],
[
37,
43
],
[
43,
44
],
[
43,
45
],
[
8,
46
],
[
46,
47
],
[
47,
48
],
[
48,
49
],
[
48,
50
],
[
46,
51
],
[
51,
52
],
[
52,
53
],
[
53,
54
],
[
53,
55
],
[
52,
56
],
[
51,
57
],
[
57,
58
],
[
51,
59
],
[
59,
60
],
[
59,
61
],
[
8,
62
],
[
62,
63
],
[
63,
64
],
[
6,
65
],
[
65,
66
],
[
0,
67
],
[
67,
68
],
[
67,
69
]
] |
[
"import java.util.*;\n\npublic class Main {\n\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n int n = sc.nextInt();\n int m = sc.nextInt();\n int sum = 0;\n for (int i = 0; i < m; i++) {\n int x = sc.nextInt();\n sum += x;\n }\n System.out.println(n-sum < 0 ? -1 : n-sum);\n sc.close();\n\n }\n\n}",
"import java.util.*;",
"util.*",
"java",
"public class Main {\n\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n int n = sc.nextInt();\n int m = sc.nextInt();\n int sum = 0;\n for (int i = 0; i < m; i++) {\n int x = sc.nextInt();\n sum += x;\n }\n System.out.println(n-sum < 0 ? -1 : n-sum);\n sc.close();\n\n }\n\n}",
"Main",
"public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n int n = sc.nextInt();\n int m = sc.nextInt();\n int sum = 0;\n for (int i = 0; i < m; i++) {\n int x = sc.nextInt();\n sum += x;\n }\n System.out.println(n-sum < 0 ? -1 : n-sum);\n sc.close();\n\n }",
"main",
"{\n Scanner sc = new Scanner(System.in);\n int n = sc.nextInt();\n int m = sc.nextInt();\n int sum = 0;\n for (int i = 0; i < m; i++) {\n int x = sc.nextInt();\n sum += x;\n }\n System.out.println(n-sum < 0 ? -1 : n-sum);\n sc.close();\n\n }",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"int n = sc.nextInt();",
"n",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int m = sc.nextInt();",
"m",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int sum = 0;",
"sum",
"0",
"for (int i = 0; i < m; i++) {\n int x = sc.nextInt();\n sum += x;\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < m",
"i",
"m",
"i++",
"i++",
"i",
"{\n int x = sc.nextInt();\n sum += x;\n }",
"{\n int x = sc.nextInt();\n sum += x;\n }",
"int x = sc.nextInt();",
"x",
"sc.nextInt()",
"sc.nextInt",
"sc",
"sum += x",
"sum",
"x",
"System.out.println(n-sum < 0 ? -1 : n-sum)",
"System.out.println",
"System.out",
"System",
"System.out",
"n-sum < 0 ? -1 : n-sum",
"n-sum < 0",
"n-sum",
"n",
"sum",
"0",
"-1",
"1",
"n-sum",
"n",
"sum",
"sc.close()",
"sc.close",
"sc",
"String[] args",
"args",
"public class Main {\n\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n int n = sc.nextInt();\n int m = sc.nextInt();\n int sum = 0;\n for (int i = 0; i < m; i++) {\n int x = sc.nextInt();\n sum += x;\n }\n System.out.println(n-sum < 0 ? -1 : n-sum);\n sc.close();\n\n }\n\n}",
"public class Main {\n\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n int n = sc.nextInt();\n int m = sc.nextInt();\n int sum = 0;\n for (int i = 0; i < m; i++) {\n int x = sc.nextInt();\n sum += x;\n }\n System.out.println(n-sum < 0 ? -1 : n-sum);\n sc.close();\n\n }\n\n}",
"Main"
] |
import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
int m = sc.nextInt();
int sum = 0;
for (int i = 0; i < m; i++) {
int x = sc.nextInt();
sum += x;
}
System.out.println(n-sum < 0 ? -1 : n-sum);
sc.close();
}
}
|
[
7,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
20,
41,
13,
4,
18,
4,
18,
4,
18,
13,
17,
41,
13,
4,
18,
13,
18,
13,
17,
41,
13,
4,
18,
13,
18,
13,
17,
41,
13,
4,
18,
4,
18,
4,
18,
13,
17,
41,
13,
41,
13,
20,
13,
41,
13,
20,
13,
11,
1,
0,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
18,
13,
13,
4,
18,
13,
18,
13,
13,
0,
18,
13,
17,
18,
13,
17,
11,
1,
0,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
18,
13,
13,
2,
18,
13,
2,
13,
17,
18,
13,
13,
41,
13,
2,
13,
18,
13,
2,
13,
17,
14,
2,
13,
17,
4,
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
],
[
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
],
[
22,
23
],
[
23,
24
],
[
24,
25
],
[
25,
26
],
[
20,
27
],
[
11,
28
],
[
28,
29
],
[
28,
30
],
[
30,
31
],
[
31,
32
],
[
30,
33
],
[
33,
34
],
[
33,
35
],
[
11,
36
],
[
36,
37
],
[
36,
38
],
[
38,
39
],
[
39,
40
],
[
38,
41
],
[
41,
42
],
[
41,
43
],
[
11,
44
],
[
44,
45
],
[
44,
46
],
[
46,
47
],
[
47,
48
],
[
48,
49
],
[
49,
50
],
[
50,
51
],
[
51,
52
],
[
46,
53
],
[
11,
54
],
[
54,
55
],
[
11,
56
],
[
56,
57
],
[
56,
58
],
[
11,
60
],
[
60,
61
],
[
60,
62
],
[
11,
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
],
[
78,
80
],
[
77,
81
],
[
81,
82
],
[
82,
83
],
[
81,
84
],
[
84,
85
],
[
84,
86
],
[
11,
87
],
[
87,
88
],
[
88,
89
],
[
88,
90
],
[
87,
91
],
[
91,
92
],
[
91,
93
],
[
11,
94
],
[
94,
95
],
[
95,
96
],
[
96,
97
],
[
96,
98
],
[
94,
99
],
[
99,
100
],
[
99,
101
],
[
94,
102
],
[
102,
103
],
[
103,
104
],
[
94,
105
],
[
106,
106
],
[
106,
107
],
[
107,
108
],
[
108,
109
],
[
108,
110
],
[
107,
111
],
[
111,
112
],
[
112,
113
],
[
112,
114
],
[
114,
115
],
[
114,
116
],
[
111,
117
],
[
117,
118
],
[
117,
119
],
[
11,
120
],
[
120,
121
],
[
120,
122
],
[
122,
123
],
[
122,
124
],
[
124,
125
],
[
124,
126
],
[
126,
127
],
[
126,
128
],
[
11,
129
],
[
129,
130
],
[
130,
131
],
[
130,
132
],
[
129,
133
],
[
133,
134
],
[
134,
135
],
[
135,
136
],
[
135,
137
],
[
133,
138
],
[
129,
139
],
[
139,
140
],
[
140,
141
],
[
141,
142
],
[
141,
143
],
[
139,
144
],
[
9,
145
],
[
145,
146
],
[
0,
147
],
[
147,
148
],
[
147,
149
]
] |
[
"import java.io.*;\nimport java.util.*;\npublic class Main\n{\n public static void main(String args[])throws IOException\n {\n InputStreamReader read = new InputStreamReader(System.in);\n BufferedReader in = new BufferedReader(read);\n String line[]=in.readLine().trim().split(\" \");\n int n=Integer.parseInt(line[0]);\n int m=Integer.parseInt(line[1]);\n String arr[]=in.readLine().trim().split(\" \");\n int i;\n int a[]=new int[m];\n int sum[]=new int[m];\n for(i=0;i<m;i++)\n {\n a[i]=Integer.parseInt(arr[i]);\n }\n sum[0]=a[0];\n for(i=1;i<m;i++)\n {\n sum[i]=sum[i-1]+a[i];\n }\n int ans=n-sum[m-1];\n if(ans>=0)\n System.out.println(ans);\n else\n System.out.println(\"-1\");\n }\n}",
"import java.io.*;",
"io.*",
"java",
"import java.util.*;",
"util.*",
"java",
"public class Main\n{\n public static void main(String args[])throws IOException\n {\n InputStreamReader read = new InputStreamReader(System.in);\n BufferedReader in = new BufferedReader(read);\n String line[]=in.readLine().trim().split(\" \");\n int n=Integer.parseInt(line[0]);\n int m=Integer.parseInt(line[1]);\n String arr[]=in.readLine().trim().split(\" \");\n int i;\n int a[]=new int[m];\n int sum[]=new int[m];\n for(i=0;i<m;i++)\n {\n a[i]=Integer.parseInt(arr[i]);\n }\n sum[0]=a[0];\n for(i=1;i<m;i++)\n {\n sum[i]=sum[i-1]+a[i];\n }\n int ans=n-sum[m-1];\n if(ans>=0)\n System.out.println(ans);\n else\n System.out.println(\"-1\");\n }\n}",
"Main",
"public static void main(String args[])throws IOException\n {\n InputStreamReader read = new InputStreamReader(System.in);\n BufferedReader in = new BufferedReader(read);\n String line[]=in.readLine().trim().split(\" \");\n int n=Integer.parseInt(line[0]);\n int m=Integer.parseInt(line[1]);\n String arr[]=in.readLine().trim().split(\" \");\n int i;\n int a[]=new int[m];\n int sum[]=new int[m];\n for(i=0;i<m;i++)\n {\n a[i]=Integer.parseInt(arr[i]);\n }\n sum[0]=a[0];\n for(i=1;i<m;i++)\n {\n sum[i]=sum[i-1]+a[i];\n }\n int ans=n-sum[m-1];\n if(ans>=0)\n System.out.println(ans);\n else\n System.out.println(\"-1\");\n }",
"main",
"{\n InputStreamReader read = new InputStreamReader(System.in);\n BufferedReader in = new BufferedReader(read);\n String line[]=in.readLine().trim().split(\" \");\n int n=Integer.parseInt(line[0]);\n int m=Integer.parseInt(line[1]);\n String arr[]=in.readLine().trim().split(\" \");\n int i;\n int a[]=new int[m];\n int sum[]=new int[m];\n for(i=0;i<m;i++)\n {\n a[i]=Integer.parseInt(arr[i]);\n }\n sum[0]=a[0];\n for(i=1;i<m;i++)\n {\n sum[i]=sum[i-1]+a[i];\n }\n int ans=n-sum[m-1];\n if(ans>=0)\n System.out.println(ans);\n else\n System.out.println(\"-1\");\n }",
"InputStreamReader read = new InputStreamReader(System.in);",
"read",
"new InputStreamReader(System.in)",
"BufferedReader in = new BufferedReader(read);",
"in",
"new BufferedReader(read)",
"String line[]=in.readLine().trim().split(\" \");",
"line",
"in.readLine().trim().split(\" \")",
"in.readLine().trim().split",
"in.readLine().trim()",
"in.readLine().trim",
"in.readLine()",
"in.readLine",
"in",
"\" \"",
"int n=Integer.parseInt(line[0]);",
"n",
"Integer.parseInt(line[0])",
"Integer.parseInt",
"Integer",
"line[0]",
"line",
"0",
"int m=Integer.parseInt(line[1]);",
"m",
"Integer.parseInt(line[1])",
"Integer.parseInt",
"Integer",
"line[1]",
"line",
"1",
"String arr[]=in.readLine().trim().split(\" \");",
"arr",
"in.readLine().trim().split(\" \")",
"in.readLine().trim().split",
"in.readLine().trim()",
"in.readLine().trim",
"in.readLine()",
"in.readLine",
"in",
"\" \"",
"int i;",
"i",
"int a[]=new int[m];",
"a",
"new int[m]",
"m",
"int sum[]=new int[m];",
"sum",
"new int[m]",
"m",
"for(i=0;i<m;i++)\n {\n a[i]=Integer.parseInt(arr[i]);\n }",
"i=0;",
"i=0",
"i",
"0",
"i<m",
"i",
"m",
"i++",
"i++",
"i",
"{\n a[i]=Integer.parseInt(arr[i]);\n }",
"{\n a[i]=Integer.parseInt(arr[i]);\n }",
"a[i]=Integer.parseInt(arr[i])",
"a[i]",
"a",
"i",
"Integer.parseInt(arr[i])",
"Integer.parseInt",
"Integer",
"arr[i]",
"arr",
"i",
"sum[0]=a[0]",
"sum[0]",
"sum",
"0",
"a[0]",
"a",
"0",
"for(i=1;i<m;i++)\n {\n sum[i]=sum[i-1]+a[i];\n }",
"i=1;",
"i=1",
"i",
"1",
"i<m",
"i",
"m",
"i++",
"i++",
"i",
"{\n sum[i]=sum[i-1]+a[i];\n }",
"{\n sum[i]=sum[i-1]+a[i];\n }",
"sum[i]=sum[i-1]+a[i]",
"sum[i]",
"sum",
"i",
"sum[i-1]+a[i]",
"sum[i-1]",
"sum",
"i-1",
"i",
"1",
"a[i]",
"a",
"i",
"int ans=n-sum[m-1];",
"ans",
"n-sum[m-1]",
"n",
"sum[m-1]",
"sum",
"m-1",
"m",
"1",
"if(ans>=0)\n System.out.println(ans);\n else\n System.out.println(\"-1\");",
"ans>=0",
"ans",
"0",
"System.out.println(ans)",
"System.out.println",
"System.out",
"System",
"System.out",
"ans",
"System.out.println(\"-1\")",
"System.out.println",
"System.out",
"System",
"System.out",
"\"-1\"",
"String args[]",
"args",
"public class Main\n{\n public static void main(String args[])throws IOException\n {\n InputStreamReader read = new InputStreamReader(System.in);\n BufferedReader in = new BufferedReader(read);\n String line[]=in.readLine().trim().split(\" \");\n int n=Integer.parseInt(line[0]);\n int m=Integer.parseInt(line[1]);\n String arr[]=in.readLine().trim().split(\" \");\n int i;\n int a[]=new int[m];\n int sum[]=new int[m];\n for(i=0;i<m;i++)\n {\n a[i]=Integer.parseInt(arr[i]);\n }\n sum[0]=a[0];\n for(i=1;i<m;i++)\n {\n sum[i]=sum[i-1]+a[i];\n }\n int ans=n-sum[m-1];\n if(ans>=0)\n System.out.println(ans);\n else\n System.out.println(\"-1\");\n }\n}",
"public class Main\n{\n public static void main(String args[])throws IOException\n {\n InputStreamReader read = new InputStreamReader(System.in);\n BufferedReader in = new BufferedReader(read);\n String line[]=in.readLine().trim().split(\" \");\n int n=Integer.parseInt(line[0]);\n int m=Integer.parseInt(line[1]);\n String arr[]=in.readLine().trim().split(\" \");\n int i;\n int a[]=new int[m];\n int sum[]=new int[m];\n for(i=0;i<m;i++)\n {\n a[i]=Integer.parseInt(arr[i]);\n }\n sum[0]=a[0];\n for(i=1;i<m;i++)\n {\n sum[i]=sum[i-1]+a[i];\n }\n int ans=n-sum[m-1];\n if(ans>=0)\n System.out.println(ans);\n else\n System.out.println(\"-1\");\n }\n}",
"Main"
] |
import java.io.*;
import java.util.*;
public class Main
{
public static void main(String args[])throws IOException
{
InputStreamReader read = new InputStreamReader(System.in);
BufferedReader in = new BufferedReader(read);
String line[]=in.readLine().trim().split(" ");
int n=Integer.parseInt(line[0]);
int m=Integer.parseInt(line[1]);
String arr[]=in.readLine().trim().split(" ");
int i;
int a[]=new int[m];
int sum[]=new int[m];
for(i=0;i<m;i++)
{
a[i]=Integer.parseInt(arr[i]);
}
sum[0]=a[0];
for(i=1;i<m;i++)
{
sum[i]=sum[i-1]+a[i];
}
int ans=n-sum[m-1];
if(ans>=0)
System.out.println(ans);
else
System.out.println("-1");
}
}
|
[
7,
15,
13,
17,
6,
13,
41,
13,
41,
13,
41,
13,
41,
13,
41,
13,
41,
13,
41,
13,
41,
13,
41,
13,
41,
13,
41,
13,
41,
13,
41,
13,
41,
13,
41,
13,
41,
13,
41,
13,
41,
13,
41,
13,
41,
13,
41,
13,
41,
13,
41,
13,
41,
13,
41,
13,
41,
13,
41,
13,
41,
13,
41,
13,
41,
13,
41,
13,
20,
12,
13,
30,
12,
13,
30,
12,
13,
30,
41,
13,
20,
17,
11,
1,
0,
13,
17,
2,
13,
17,
1,
40,
13,
30,
30,
0,
18,
13,
13,
4,
18,
13,
41,
13,
20,
18,
13,
17,
11,
1,
0,
13,
17,
2,
13,
18,
13,
17,
1,
40,
13,
30,
30,
0,
18,
13,
13,
4,
18,
13,
0,
13,
18,
13,
13,
14,
2,
2,
18,
13,
17,
13,
40,
17,
30,
4,
18,
18,
13,
13,
2,
18,
13,
17,
13,
30,
4,
18,
18,
13,
13,
17,
12,
13,
30,
41,
13,
20,
4,
18,
13,
4,
18,
13,
4,
18,
13,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
180,
5
],
[
180,
6
],
[
6,
7
],
[
180,
8
],
[
8,
9
],
[
180,
10
],
[
10,
11
],
[
180,
12
],
[
12,
13
],
[
180,
14
],
[
14,
15
],
[
180,
16
],
[
16,
17
],
[
180,
18
],
[
18,
19
],
[
180,
20
],
[
20,
21
],
[
180,
22
],
[
22,
23
],
[
180,
24
],
[
24,
25
],
[
180,
26
],
[
26,
27
],
[
180,
28
],
[
28,
29
],
[
180,
30
],
[
30,
31
],
[
180,
32
],
[
32,
33
],
[
180,
34
],
[
34,
35
],
[
180,
36
],
[
36,
37
],
[
180,
38
],
[
38,
39
],
[
180,
40
],
[
40,
41
],
[
180,
42
],
[
42,
43
],
[
180,
44
],
[
44,
45
],
[
180,
46
],
[
46,
47
],
[
180,
48
],
[
48,
49
],
[
180,
50
],
[
50,
51
],
[
180,
52
],
[
52,
53
],
[
180,
54
],
[
54,
55
],
[
180,
56
],
[
56,
57
],
[
180,
58
],
[
58,
59
],
[
180,
60
],
[
60,
61
],
[
180,
62
],
[
62,
63
],
[
180,
64
],
[
64,
65
],
[
180,
66
],
[
66,
67
],
[
66,
68
],
[
180,
69
],
[
69,
70
],
[
69,
71
],
[
180,
72
],
[
72,
73
],
[
72,
74
],
[
180,
75
],
[
75,
76
],
[
75,
77
],
[
77,
78
],
[
78,
79
],
[
78,
80
],
[
77,
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
],
[
96,
98
],
[
95,
99
],
[
99,
100
],
[
100,
101
],
[
77,
102
],
[
102,
103
],
[
102,
104
],
[
105,
106
],
[
105,
107
],
[
77,
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
],
[
122,
130
],
[
130,
131
],
[
130,
132
],
[
132,
133
],
[
132,
134
],
[
77,
135
],
[
135,
136
],
[
136,
137
],
[
137,
138
],
[
138,
139
],
[
138,
140
],
[
137,
141
],
[
136,
142
],
[
142,
143
],
[
135,
144
],
[
144,
145
],
[
145,
146
],
[
146,
147
],
[
147,
148
],
[
147,
149
],
[
145,
150
],
[
150,
151
],
[
151,
152
],
[
151,
153
],
[
150,
154
],
[
135,
155
],
[
155,
156
],
[
156,
157
],
[
157,
158
],
[
158,
159
],
[
158,
160
],
[
156,
161
],
[
180,
162
],
[
162,
163
],
[
162,
164
],
[
164,
165
],
[
165,
166
],
[
165,
167
],
[
164,
168
],
[
168,
169
],
[
169,
170
],
[
164,
171
],
[
171,
172
],
[
172,
173
],
[
164,
174
],
[
174,
175
],
[
175,
176
],
[
162,
177
],
[
177,
178
],
[
0,
179
],
[
179,
180
],
[
179,
181
]
] |
[
"import java.util.Scanner;\n//int[] date=new int[2];\npublic class Main {\nint i,o,sum,h,s,e,u,ty,yu,ui,n,num,qw;\ndouble m,t,r,j,k,f,d,g,w;\nstatic double l;\nString b,c,z,x,v,a,q;\nScanner scan =new Scanner(System.in);\n//ๅ
ฅๅ\n\tpublic void input() {\t\n\t\n\t}\n\t//ๆผ็ฎ\n\tpublic void compute() {\n\t\n\t\t}\n//ๅบๅ\n\tpublic void output() {\n\tint[]\tdate=new int[2];\n\t\tfor(o=0;o<2;o++) {\n\t\tdate[o]=scan.nextInt();\n\t\t}\n\t\tint[] dat=new int[date[1]];\n\t\tfor(h=0;h<date[1];h++) {\n\t\t\tdat[h]=scan.nextInt();\n\t\t\tsum+=dat[h];\n\t\t}\n\t\tif(date[0]-sum>-1) {\n\t\t\tSystem.out.println(date[0]-sum);\n\t\t}else {\n\t\t\tSystem.out.println(\"-1\");\n\t\t}\n\t\t}\n\tpublic static void main(String [ ] args) {\n\t\tMain p = new Main ();\n\t\tp.input();\n\t\tp.compute();\n\t\tp.output();\n\t\t}\n\t}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\nint i,o,sum,h,s,e,u,ty,yu,ui,n,num,qw;\ndouble m,t,r,j,k,f,d,g,w;\nstatic double l;\nString b,c,z,x,v,a,q;\nScanner scan =new Scanner(System.in);\n//ๅ
ฅๅ\n\tpublic void input() {\t\n\t\n\t}\n\t//ๆผ็ฎ\n\tpublic void compute() {\n\t\n\t\t}\n//ๅบๅ\n\tpublic void output() {\n\tint[]\tdate=new int[2];\n\t\tfor(o=0;o<2;o++) {\n\t\tdate[o]=scan.nextInt();\n\t\t}\n\t\tint[] dat=new int[date[1]];\n\t\tfor(h=0;h<date[1];h++) {\n\t\t\tdat[h]=scan.nextInt();\n\t\t\tsum+=dat[h];\n\t\t}\n\t\tif(date[0]-sum>-1) {\n\t\t\tSystem.out.println(date[0]-sum);\n\t\t}else {\n\t\t\tSystem.out.println(\"-1\");\n\t\t}\n\t\t}\n\tpublic static void main(String [ ] args) {\n\t\tMain p = new Main ();\n\t\tp.input();\n\t\tp.compute();\n\t\tp.output();\n\t\t}\n\t}",
"Main",
"int i",
"i",
"o",
"o",
"sum",
"sum",
"h",
"h",
"s",
"s",
"e",
"e",
"u",
"u",
"ty",
"ty",
"yu",
"yu",
"ui",
"ui",
"n",
"n",
"num",
"num",
"qw;",
"qw",
"double m",
"m",
"t",
"t",
"r",
"r",
"j",
"j",
"k",
"k",
"f",
"f",
"d",
"d",
"g",
"g",
"w;",
"w",
"static double l;",
"l",
"String b",
"b",
"c",
"c",
"z",
"z",
"x",
"x",
"v",
"v",
"a",
"a",
"q;",
"q",
"Scanner scan =new Scanner(System.in);",
"scan",
"new Scanner(System.in)",
"//ๅ
ฅๅ\n\tpublic void input() {\t\n\t\n\t}",
"input",
"{\t\n\t\n\t}",
"//ๆผ็ฎ\n\tpublic void compute() {\n\t\n\t\t}",
"compute",
"{\n\t\n\t\t}",
"//ๅบๅ\n\tpublic void output() {\n\tint[]\tdate=new int[2];\n\t\tfor(o=0;o<2;o++) {\n\t\tdate[o]=scan.nextInt();\n\t\t}\n\t\tint[] dat=new int[date[1]];\n\t\tfor(h=0;h<date[1];h++) {\n\t\t\tdat[h]=scan.nextInt();\n\t\t\tsum+=dat[h];\n\t\t}\n\t\tif(date[0]-sum>-1) {\n\t\t\tSystem.out.println(date[0]-sum);\n\t\t}else {\n\t\t\tSystem.out.println(\"-1\");\n\t\t}\n\t\t}",
"output",
"{\n\tint[]\tdate=new int[2];\n\t\tfor(o=0;o<2;o++) {\n\t\tdate[o]=scan.nextInt();\n\t\t}\n\t\tint[] dat=new int[date[1]];\n\t\tfor(h=0;h<date[1];h++) {\n\t\t\tdat[h]=scan.nextInt();\n\t\t\tsum+=dat[h];\n\t\t}\n\t\tif(date[0]-sum>-1) {\n\t\t\tSystem.out.println(date[0]-sum);\n\t\t}else {\n\t\t\tSystem.out.println(\"-1\");\n\t\t}\n\t\t}",
"int[]\tdate=new int[2];",
"date",
"new int[2]",
"2",
"for(o=0;o<2;o++) {\n\t\tdate[o]=scan.nextInt();\n\t\t}",
"o=0;",
"o=0",
"o",
"0",
"o<2",
"o",
"2",
"o++",
"o++",
"o",
"{\n\t\tdate[o]=scan.nextInt();\n\t\t}",
"{\n\t\tdate[o]=scan.nextInt();\n\t\t}",
"date[o]=scan.nextInt()",
"date[o]",
"date",
"o",
"scan.nextInt()",
"scan.nextInt",
"scan",
"int[] dat=new int[date[1]];",
"dat",
"new int[date[1]]",
"date[1]",
"date",
"1",
"for(h=0;h<date[1];h++) {\n\t\t\tdat[h]=scan.nextInt();\n\t\t\tsum+=dat[h];\n\t\t}",
"h=0;",
"h=0",
"h",
"0",
"h<date[1]",
"h",
"date[1]",
"date",
"1",
"h++",
"h++",
"h",
"{\n\t\t\tdat[h]=scan.nextInt();\n\t\t\tsum+=dat[h];\n\t\t}",
"{\n\t\t\tdat[h]=scan.nextInt();\n\t\t\tsum+=dat[h];\n\t\t}",
"dat[h]=scan.nextInt()",
"dat[h]",
"dat",
"h",
"scan.nextInt()",
"scan.nextInt",
"scan",
"sum+=dat[h]",
"sum",
"dat[h]",
"dat",
"h",
"if(date[0]-sum>-1) {\n\t\t\tSystem.out.println(date[0]-sum);\n\t\t}else {\n\t\t\tSystem.out.println(\"-1\");\n\t\t}",
"date[0]-sum>-1",
"date[0]-sum",
"date[0]",
"date",
"0",
"sum",
"-1",
"1",
"{\n\t\t\tSystem.out.println(date[0]-sum);\n\t\t}",
"System.out.println(date[0]-sum)",
"System.out.println",
"System.out",
"System",
"System.out",
"date[0]-sum",
"date[0]",
"date",
"0",
"sum",
"{\n\t\t\tSystem.out.println(\"-1\");\n\t\t}",
"System.out.println(\"-1\")",
"System.out.println",
"System.out",
"System",
"System.out",
"\"-1\"",
"public static void main(String [ ] args) {\n\t\tMain p = new Main ();\n\t\tp.input();\n\t\tp.compute();\n\t\tp.output();\n\t\t}",
"main",
"{\n\t\tMain p = new Main ();\n\t\tp.input();\n\t\tp.compute();\n\t\tp.output();\n\t\t}",
"Main p = new Main ();",
"p",
"new Main ()",
"p.input()",
"p.input",
"p",
"p.compute()",
"p.compute",
"p",
"p.output()",
"p.output",
"p",
"String [ ] args",
"args",
"public class Main {\nint i,o,sum,h,s,e,u,ty,yu,ui,n,num,qw;\ndouble m,t,r,j,k,f,d,g,w;\nstatic double l;\nString b,c,z,x,v,a,q;\nScanner scan =new Scanner(System.in);\n//ๅ
ฅๅ\n\tpublic void input() {\t\n\t\n\t}\n\t//ๆผ็ฎ\n\tpublic void compute() {\n\t\n\t\t}\n//ๅบๅ\n\tpublic void output() {\n\tint[]\tdate=new int[2];\n\t\tfor(o=0;o<2;o++) {\n\t\tdate[o]=scan.nextInt();\n\t\t}\n\t\tint[] dat=new int[date[1]];\n\t\tfor(h=0;h<date[1];h++) {\n\t\t\tdat[h]=scan.nextInt();\n\t\t\tsum+=dat[h];\n\t\t}\n\t\tif(date[0]-sum>-1) {\n\t\t\tSystem.out.println(date[0]-sum);\n\t\t}else {\n\t\t\tSystem.out.println(\"-1\");\n\t\t}\n\t\t}\n\tpublic static void main(String [ ] args) {\n\t\tMain p = new Main ();\n\t\tp.input();\n\t\tp.compute();\n\t\tp.output();\n\t\t}\n\t}",
"public class Main {\nint i,o,sum,h,s,e,u,ty,yu,ui,n,num,qw;\ndouble m,t,r,j,k,f,d,g,w;\nstatic double l;\nString b,c,z,x,v,a,q;\nScanner scan =new Scanner(System.in);\n//ๅ
ฅๅ\n\tpublic void input() {\t\n\t\n\t}\n\t//ๆผ็ฎ\n\tpublic void compute() {\n\t\n\t\t}\n//ๅบๅ\n\tpublic void output() {\n\tint[]\tdate=new int[2];\n\t\tfor(o=0;o<2;o++) {\n\t\tdate[o]=scan.nextInt();\n\t\t}\n\t\tint[] dat=new int[date[1]];\n\t\tfor(h=0;h<date[1];h++) {\n\t\t\tdat[h]=scan.nextInt();\n\t\t\tsum+=dat[h];\n\t\t}\n\t\tif(date[0]-sum>-1) {\n\t\t\tSystem.out.println(date[0]-sum);\n\t\t}else {\n\t\t\tSystem.out.println(\"-1\");\n\t\t}\n\t\t}\n\tpublic static void main(String [ ] args) {\n\t\tMain p = new Main ();\n\t\tp.input();\n\t\tp.compute();\n\t\tp.output();\n\t\t}\n\t}",
"Main"
] |
import java.util.Scanner;
//int[] date=new int[2];
public class Main {
int i,o,sum,h,s,e,u,ty,yu,ui,n,num,qw;
double m,t,r,j,k,f,d,g,w;
static double l;
String b,c,z,x,v,a,q;
Scanner scan =new Scanner(System.in);
//ๅ
ฅๅ
public void input() {
}
//ๆผ็ฎ
public void compute() {
}
//ๅบๅ
public void output() {
int[] date=new int[2];
for(o=0;o<2;o++) {
date[o]=scan.nextInt();
}
int[] dat=new int[date[1]];
for(h=0;h<date[1];h++) {
dat[h]=scan.nextInt();
sum+=dat[h];
}
if(date[0]-sum>-1) {
System.out.println(date[0]-sum);
}else {
System.out.println("-1");
}
}
public static void main(String [ ] args) {
Main p = new Main ();
p.input();
p.compute();
p.output();
}
}
|
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
41,
13,
20,
13,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
18,
13,
13,
4,
18,
13,
0,
13,
2,
13,
18,
13,
13,
14,
2,
13,
13,
30,
4,
18,
18,
13,
13,
40,
17,
30,
41,
13,
2,
13,
13,
4,
18,
18,
13,
13,
13,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
83,
5
],
[
83,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
8,
17
],
[
17,
18
],
[
17,
19
],
[
19,
20
],
[
20,
21
],
[
8,
22
],
[
22,
23
],
[
22,
24
],
[
8,
26
],
[
26,
27
],
[
26,
28
],
[
8,
29
],
[
29,
30
],
[
30,
31
],
[
31,
32
],
[
31,
33
],
[
29,
34
],
[
34,
35
],
[
34,
36
],
[
29,
37
],
[
37,
38
],
[
38,
39
],
[
29,
40
],
[
41,
41
],
[
41,
42
],
[
42,
43
],
[
43,
44
],
[
43,
45
],
[
42,
46
],
[
46,
47
],
[
47,
48
],
[
41,
49
],
[
49,
50
],
[
49,
51
],
[
51,
52
],
[
51,
53
],
[
53,
54
],
[
53,
55
],
[
8,
56
],
[
56,
57
],
[
57,
58
],
[
57,
59
],
[
56,
60
],
[
60,
61
],
[
61,
62
],
[
62,
63
],
[
63,
64
],
[
63,
65
],
[
61,
66
],
[
66,
67
],
[
56,
68
],
[
68,
69
],
[
69,
70
],
[
69,
71
],
[
71,
72
],
[
71,
73
],
[
68,
74
],
[
74,
75
],
[
75,
76
],
[
76,
77
],
[
76,
78
],
[
74,
79
],
[
6,
80
],
[
80,
81
],
[
0,
82
],
[
82,
83
],
[
82,
84
]
] |
[
"import java.util.Scanner;\npublic class Main {\n public static void main(String[] args) throws Exception {\n Scanner sc = new Scanner(System.in);\n int N = sc.nextInt();\n int M = sc.nextInt();\n int[] A = new int[(int)(M)];\n int a = 0;\n for(int i = 0 ; i < M ; i++){\n A[i] = sc.nextInt();\n a = a + A[i];\n }\n if(a > N){\n System.out.print(-1);\n }else{\n int b = N - a;\n System.out.print(b);\n }\n }\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n public static void main(String[] args) throws Exception {\n Scanner sc = new Scanner(System.in);\n int N = sc.nextInt();\n int M = sc.nextInt();\n int[] A = new int[(int)(M)];\n int a = 0;\n for(int i = 0 ; i < M ; i++){\n A[i] = sc.nextInt();\n a = a + A[i];\n }\n if(a > N){\n System.out.print(-1);\n }else{\n int b = N - a;\n System.out.print(b);\n }\n }\n}",
"Main",
"public static void main(String[] args) throws Exception {\n Scanner sc = new Scanner(System.in);\n int N = sc.nextInt();\n int M = sc.nextInt();\n int[] A = new int[(int)(M)];\n int a = 0;\n for(int i = 0 ; i < M ; i++){\n A[i] = sc.nextInt();\n a = a + A[i];\n }\n if(a > N){\n System.out.print(-1);\n }else{\n int b = N - a;\n System.out.print(b);\n }\n }",
"main",
"{\n Scanner sc = new Scanner(System.in);\n int N = sc.nextInt();\n int M = sc.nextInt();\n int[] A = new int[(int)(M)];\n int a = 0;\n for(int i = 0 ; i < M ; i++){\n A[i] = sc.nextInt();\n a = a + A[i];\n }\n if(a > N){\n System.out.print(-1);\n }else{\n int b = N - a;\n System.out.print(b);\n }\n }",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"int N = sc.nextInt();",
"N",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int M = sc.nextInt();",
"M",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int[] A = new int[(int)(M)];",
"A",
"new int[(int)(M)]",
"(int)(M)",
"int a = 0;",
"a",
"0",
"for(int i = 0 ; i < M ; i++){\n A[i] = sc.nextInt();\n a = a + A[i];\n }",
"int i = 0 ;",
"int i = 0 ;",
"i",
"0",
"i < M",
"i",
"M",
"i++",
"i++",
"i",
"{\n A[i] = sc.nextInt();\n a = a + A[i];\n }",
"{\n A[i] = sc.nextInt();\n a = a + A[i];\n }",
"A[i] = sc.nextInt()",
"A[i]",
"A",
"i",
"sc.nextInt()",
"sc.nextInt",
"sc",
"a = a + A[i]",
"a",
"a + A[i]",
"a",
"A[i]",
"A",
"i",
"if(a > N){\n System.out.print(-1);\n }else{\n int b = N - a;\n System.out.print(b);\n }",
"a > N",
"a",
"N",
"{\n System.out.print(-1);\n }",
"System.out.print(-1)",
"System.out.print",
"System.out",
"System",
"System.out",
"-1",
"1",
"{\n int b = N - a;\n System.out.print(b);\n }",
"int b = N - a;",
"b",
"N - a",
"N",
"a",
"System.out.print(b)",
"System.out.print",
"System.out",
"System",
"System.out",
"b",
"String[] args",
"args",
"public class Main {\n public static void main(String[] args) throws Exception {\n Scanner sc = new Scanner(System.in);\n int N = sc.nextInt();\n int M = sc.nextInt();\n int[] A = new int[(int)(M)];\n int a = 0;\n for(int i = 0 ; i < M ; i++){\n A[i] = sc.nextInt();\n a = a + A[i];\n }\n if(a > N){\n System.out.print(-1);\n }else{\n int b = N - a;\n System.out.print(b);\n }\n }\n}",
"public class Main {\n public static void main(String[] args) throws Exception {\n Scanner sc = new Scanner(System.in);\n int N = sc.nextInt();\n int M = sc.nextInt();\n int[] A = new int[(int)(M)];\n int a = 0;\n for(int i = 0 ; i < M ; i++){\n A[i] = sc.nextInt();\n a = a + A[i];\n }\n if(a > N){\n System.out.print(-1);\n }else{\n int b = N - a;\n System.out.print(b);\n }\n }\n}",
"Main"
] |
import java.util.Scanner;
public class Main {
public static void main(String[] args) throws Exception {
Scanner sc = new Scanner(System.in);
int N = sc.nextInt();
int M = sc.nextInt();
int[] A = new int[(int)(M)];
int a = 0;
for(int i = 0 ; i < M ; i++){
A[i] = sc.nextInt();
a = a + A[i];
}
if(a > N){
System.out.print(-1);
}else{
int b = N - a;
System.out.print(b);
}
}
}
|
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
41,
13,
41,
13,
12,
13,
30,
0,
13,
20,
12,
13,
30,
42,
2,
2,
13,
17,
40,
4,
18,
13,
30,
38,
5,
13,
30,
29,
17,
30,
0,
13,
20,
29,
17,
12,
13,
30,
14,
4,
13,
29,
4,
18,
13,
29,
17,
12,
13,
30,
29,
4,
18,
13,
4,
13,
12,
13,
30,
29,
4,
18,
13,
4,
13,
12,
13,
30,
29,
4,
18,
13,
4,
13,
12,
13,
30,
29,
20,
12,
13,
30,
29,
20,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
41,
13,
17,
41,
13,
20,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
18,
13,
13,
4,
18,
13,
0,
13,
18,
13,
13,
4,
18,
13,
8,
2,
13,
13,
40,
17,
2,
13,
13,
4,
18,
13,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
10,
11
],
[
10,
12
],
[
0,
13
],
[
13,
14
],
[
13,
15
],
[
0,
16
],
[
16,
17
],
[
16,
18
],
[
0,
19
],
[
19,
20
],
[
19,
21
],
[
0,
22
],
[
22,
23
],
[
22,
24
],
[
24,
25
],
[
22,
26
],
[
26,
27
],
[
22,
28
],
[
28,
29
],
[
28,
30
],
[
30,
31
],
[
31,
32
],
[
31,
33
],
[
22,
34
],
[
34,
35
],
[
34,
36
],
[
36,
37
],
[
37,
38
],
[
38,
39
],
[
39,
40
],
[
39,
41
],
[
38,
42
],
[
42,
43
],
[
43,
44
],
[
44,
45
],
[
37,
46
],
[
46,
47
],
[
47,
48
],
[
48,
49
],
[
48,
50
],
[
50,
51
],
[
51,
52
],
[
47,
53
],
[
53,
54
],
[
54,
55
],
[
54,
56
],
[
36,
57
],
[
57,
58
],
[
22,
59
],
[
59,
60
],
[
59,
61
],
[
61,
62
],
[
62,
63
],
[
63,
64
],
[
62,
65
],
[
65,
66
],
[
66,
67
],
[
67,
68
],
[
61,
69
],
[
69,
70
],
[
22,
71
],
[
71,
72
],
[
71,
73
],
[
73,
74
],
[
74,
75
],
[
75,
76
],
[
76,
77
],
[
75,
78
],
[
78,
79
],
[
22,
80
],
[
80,
81
],
[
80,
82
],
[
82,
83
],
[
83,
84
],
[
84,
85
],
[
85,
86
],
[
84,
87
],
[
87,
88
],
[
22,
89
],
[
89,
90
],
[
89,
91
],
[
91,
92
],
[
92,
93
],
[
93,
94
],
[
94,
95
],
[
93,
96
],
[
96,
97
],
[
22,
98
],
[
98,
99
],
[
98,
100
],
[
100,
101
],
[
101,
102
],
[
22,
103
],
[
103,
104
],
[
103,
105
],
[
105,
106
],
[
106,
107
],
[
0,
108
],
[
179,
109
],
[
179,
110
],
[
110,
111
],
[
110,
112
],
[
112,
113
],
[
113,
114
],
[
113,
115
],
[
112,
116
],
[
116,
117
],
[
116,
118
],
[
112,
119
],
[
119,
120
],
[
119,
121
],
[
121,
122
],
[
122,
123
],
[
112,
124
],
[
124,
125
],
[
124,
126
],
[
126,
127
],
[
127,
128
],
[
112,
129
],
[
129,
130
],
[
129,
131
],
[
112,
132
],
[
132,
133
],
[
132,
134
],
[
112,
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
],
[
148,
156
],
[
156,
157
],
[
156,
158
],
[
158,
159
],
[
158,
160
],
[
112,
161
],
[
161,
162
],
[
162,
163
],
[
161,
164
],
[
164,
165
],
[
165,
166
],
[
165,
167
],
[
164,
168
],
[
168,
169
],
[
164,
170
],
[
170,
171
],
[
170,
172
],
[
112,
173
],
[
173,
174
],
[
174,
175
],
[
110,
176
],
[
176,
177
],
[
0,
178
],
[
178,
179
],
[
178,
180
]
] |
[
"import java.io.BufferedReader;\nimport java.io.InputStreamReader;\nimport java.io.PrintWriter;\nimport java.math.BigDecimal;\nimport java.math.BigInteger;\nimport java.util.Arrays;\nimport java.util.StringTokenizer;\nclass InputReader {\n BufferedReader buf;\n StringTokenizer tok;\n \n public InputReader() {\n buf = new BufferedReader(new InputStreamReader(System.in));\n// try {\n// Path currentRelativePath = Paths.get(\"\");\n// String s = currentRelativePath.toAbsolutePath().toString();\n// String curDir = System.getProperty(\"user.dir\");\n// System.out.println(\"current dir: \" + s);\n// buf = new BufferedReader(new FileReader(\"/Users/wangdong/Dropbox/LC_Java/src/test/resources/testA.txt\"));\n// } catch (FileNotFoundException e) {\n// e.printStackTrace();\n// }\n }\n \n public boolean hasNext() {\n while (tok == null || !tok.hasMoreElements()) {\n try {\n tok = new StringTokenizer(buf.readLine());\n } catch (Exception e) {\n return false;\n }\n }\n return true;\n }\n \n public String next() {\n if (hasNext()) return tok.nextToken();\n return null;\n }\n \n public int nextInt() {\n return Integer.parseInt(next());\n }\n \n public long nextLong() {\n return Long.parseLong(next());\n }\n \n public Double nextDouble() {\n return Double.parseDouble(next());\n }\n \n public BigInteger nextBigInteger() {\n return new BigInteger(next());\n }\n \n public BigDecimal nextBigDecimal() {\n return new BigDecimal(next());\n }\n}\n \n \npublic class Main {\n public static void main(String[] args) {\n InputReader in = new InputReader();\n PrintWriter out = new PrintWriter(System.out);\n int n = in.nextInt(), m = in.nextInt();\n\t// \tout.println(n + \" , \" + m);\n \tint tot = 0; \n \tint[] times = new int[m];\n \tfor (int i = 0; i < m; i++){\n \n times[i] = in.nextInt();\n \t\t tot += times[i];\n //out.print(times[i] + \" , \");\n }\n\t\tout.println(tot > n ? -1 : n-tot);\n out.close();\n }\n \n}",
"import java.io.BufferedReader;",
"BufferedReader",
"java.io",
"import java.io.InputStreamReader;",
"InputStreamReader",
"java.io",
"import java.io.PrintWriter;",
"PrintWriter",
"java.io",
"import java.math.BigDecimal;",
"BigDecimal",
"java.math",
"import java.math.BigInteger;",
"BigInteger",
"java.math",
"import java.util.Arrays;",
"Arrays",
"java.util",
"import java.util.StringTokenizer;",
"StringTokenizer",
"java.util",
"class InputReader {\n BufferedReader buf;\n StringTokenizer tok;\n \n public InputReader() {\n buf = new BufferedReader(new InputStreamReader(System.in));\n// try {\n// Path currentRelativePath = Paths.get(\"\");\n// String s = currentRelativePath.toAbsolutePath().toString();\n// String curDir = System.getProperty(\"user.dir\");\n// System.out.println(\"current dir: \" + s);\n// buf = new BufferedReader(new FileReader(\"/Users/wangdong/Dropbox/LC_Java/src/test/resources/testA.txt\"));\n// } catch (FileNotFoundException e) {\n// e.printStackTrace();\n// }\n }\n \n public boolean hasNext() {\n while (tok == null || !tok.hasMoreElements()) {\n try {\n tok = new StringTokenizer(buf.readLine());\n } catch (Exception e) {\n return false;\n }\n }\n return true;\n }\n \n public String next() {\n if (hasNext()) return tok.nextToken();\n return null;\n }\n \n public int nextInt() {\n return Integer.parseInt(next());\n }\n \n public long nextLong() {\n return Long.parseLong(next());\n }\n \n public Double nextDouble() {\n return Double.parseDouble(next());\n }\n \n public BigInteger nextBigInteger() {\n return new BigInteger(next());\n }\n \n public BigDecimal nextBigDecimal() {\n return new BigDecimal(next());\n }\n}",
"InputReader",
"BufferedReader buf;",
"buf",
"StringTokenizer tok;",
"tok",
"public InputReader() {\n buf = new BufferedReader(new InputStreamReader(System.in));\n// try {\n// Path currentRelativePath = Paths.get(\"\");\n// String s = currentRelativePath.toAbsolutePath().toString();\n// String curDir = System.getProperty(\"user.dir\");\n// System.out.println(\"current dir: \" + s);\n// buf = new BufferedReader(new FileReader(\"/Users/wangdong/Dropbox/LC_Java/src/test/resources/testA.txt\"));\n// } catch (FileNotFoundException e) {\n// e.printStackTrace();\n// }\n }",
"InputReader",
"{\n buf = new BufferedReader(new InputStreamReader(System.in));\n// try {\n// Path currentRelativePath = Paths.get(\"\");\n// String s = currentRelativePath.toAbsolutePath().toString();\n// String curDir = System.getProperty(\"user.dir\");\n// System.out.println(\"current dir: \" + s);\n// buf = new BufferedReader(new FileReader(\"/Users/wangdong/Dropbox/LC_Java/src/test/resources/testA.txt\"));\n// } catch (FileNotFoundException e) {\n// e.printStackTrace();\n// }\n }",
"buf = new BufferedReader(new InputStreamReader(System.in))",
"buf",
"new BufferedReader(new InputStreamReader(System.in))",
"public boolean hasNext() {\n while (tok == null || !tok.hasMoreElements()) {\n try {\n tok = new StringTokenizer(buf.readLine());\n } catch (Exception e) {\n return false;\n }\n }\n return true;\n }",
"hasNext",
"{\n while (tok == null || !tok.hasMoreElements()) {\n try {\n tok = new StringTokenizer(buf.readLine());\n } catch (Exception e) {\n return false;\n }\n }\n return true;\n }",
"while (tok == null || !tok.hasMoreElements()) {\n try {\n tok = new StringTokenizer(buf.readLine());\n } catch (Exception e) {\n return false;\n }\n }",
"tok == null || !tok.hasMoreElements()",
"tok == null",
"tok",
"null",
"!tok.hasMoreElements()",
"tok.hasMoreElements()",
"tok.hasMoreElements",
"tok",
"{\n try {\n tok = new StringTokenizer(buf.readLine());\n } catch (Exception e) {\n return false;\n }\n }",
"try {\n tok = new StringTokenizer(buf.readLine());\n } catch (Exception e) {\n return false;\n }",
"catch (Exception e) {\n return false;\n }",
"Exception e",
"{\n return false;\n }",
"return false;",
"false",
"{\n tok = new StringTokenizer(buf.readLine());\n }",
"tok = new StringTokenizer(buf.readLine())",
"tok",
"new StringTokenizer(buf.readLine())",
"return true;",
"true",
"public String next() {\n if (hasNext()) return tok.nextToken();\n return null;\n }",
"next",
"{\n if (hasNext()) return tok.nextToken();\n return null;\n }",
"if (hasNext()) return tok.nextToken();",
"hasNext()",
"hasNext",
"return tok.nextToken();",
"tok.nextToken()",
"tok.nextToken",
"tok",
"return null;",
"null",
"public int nextInt() {\n return Integer.parseInt(next());\n }",
"nextInt",
"{\n return Integer.parseInt(next());\n }",
"return Integer.parseInt(next());",
"Integer.parseInt(next())",
"Integer.parseInt",
"Integer",
"next()",
"next",
"public long nextLong() {\n return Long.parseLong(next());\n }",
"nextLong",
"{\n return Long.parseLong(next());\n }",
"return Long.parseLong(next());",
"Long.parseLong(next())",
"Long.parseLong",
"Long",
"next()",
"next",
"public Double nextDouble() {\n return Double.parseDouble(next());\n }",
"nextDouble",
"{\n return Double.parseDouble(next());\n }",
"return Double.parseDouble(next());",
"Double.parseDouble(next())",
"Double.parseDouble",
"Double",
"next()",
"next",
"public BigInteger nextBigInteger() {\n return new BigInteger(next());\n }",
"nextBigInteger",
"{\n return new BigInteger(next());\n }",
"return new BigInteger(next());",
"new BigInteger(next())",
"public BigDecimal nextBigDecimal() {\n return new BigDecimal(next());\n }",
"nextBigDecimal",
"{\n return new BigDecimal(next());\n }",
"return new BigDecimal(next());",
"new BigDecimal(next())",
"public class Main {\n public static void main(String[] args) {\n InputReader in = new InputReader();\n PrintWriter out = new PrintWriter(System.out);\n int n = in.nextInt(), m = in.nextInt();\n\t// \tout.println(n + \" , \" + m);\n \tint tot = 0; \n \tint[] times = new int[m];\n \tfor (int i = 0; i < m; i++){\n \n times[i] = in.nextInt();\n \t\t tot += times[i];\n //out.print(times[i] + \" , \");\n }\n\t\tout.println(tot > n ? -1 : n-tot);\n out.close();\n }\n \n}",
"Main",
"public static void main(String[] args) {\n InputReader in = new InputReader();\n PrintWriter out = new PrintWriter(System.out);\n int n = in.nextInt(), m = in.nextInt();\n\t// \tout.println(n + \" , \" + m);\n \tint tot = 0; \n \tint[] times = new int[m];\n \tfor (int i = 0; i < m; i++){\n \n times[i] = in.nextInt();\n \t\t tot += times[i];\n //out.print(times[i] + \" , \");\n }\n\t\tout.println(tot > n ? -1 : n-tot);\n out.close();\n }",
"main",
"{\n InputReader in = new InputReader();\n PrintWriter out = new PrintWriter(System.out);\n int n = in.nextInt(), m = in.nextInt();\n\t// \tout.println(n + \" , \" + m);\n \tint tot = 0; \n \tint[] times = new int[m];\n \tfor (int i = 0; i < m; i++){\n \n times[i] = in.nextInt();\n \t\t tot += times[i];\n //out.print(times[i] + \" , \");\n }\n\t\tout.println(tot > n ? -1 : n-tot);\n out.close();\n }",
"InputReader in = new InputReader();",
"in",
"new InputReader()",
"PrintWriter out = new PrintWriter(System.out);",
"out",
"new PrintWriter(System.out)",
"int n = in.nextInt()",
"n",
"in.nextInt()",
"in.nextInt",
"in",
"m = in.nextInt();",
"m",
"in.nextInt()",
"in.nextInt",
"in",
"int tot = 0;",
"tot",
"0",
"int[] times = new int[m];",
"times",
"new int[m]",
"m",
"for (int i = 0; i < m; i++){\n \n times[i] = in.nextInt();\n \t\t tot += times[i];\n //out.print(times[i] + \" , \");\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < m",
"i",
"m",
"i++",
"i++",
"i",
"{\n \n times[i] = in.nextInt();\n \t\t tot += times[i];\n //out.print(times[i] + \" , \");\n }",
"{\n \n times[i] = in.nextInt();\n \t\t tot += times[i];\n //out.print(times[i] + \" , \");\n }",
"times[i] = in.nextInt()",
"times[i]",
"times",
"i",
"in.nextInt()",
"in.nextInt",
"in",
"tot += times[i]",
"tot",
"times[i]",
"times",
"i",
"out.println(tot > n ? -1 : n-tot)",
"out.println",
"out",
"tot > n ? -1 : n-tot",
"tot > n",
"tot",
"n",
"-1",
"1",
"n-tot",
"n",
"tot",
"out.close()",
"out.close",
"out",
"String[] args",
"args",
"public class Main {\n public static void main(String[] args) {\n InputReader in = new InputReader();\n PrintWriter out = new PrintWriter(System.out);\n int n = in.nextInt(), m = in.nextInt();\n\t// \tout.println(n + \" , \" + m);\n \tint tot = 0; \n \tint[] times = new int[m];\n \tfor (int i = 0; i < m; i++){\n \n times[i] = in.nextInt();\n \t\t tot += times[i];\n //out.print(times[i] + \" , \");\n }\n\t\tout.println(tot > n ? -1 : n-tot);\n out.close();\n }\n \n}",
"public class Main {\n public static void main(String[] args) {\n InputReader in = new InputReader();\n PrintWriter out = new PrintWriter(System.out);\n int n = in.nextInt(), m = in.nextInt();\n\t// \tout.println(n + \" , \" + m);\n \tint tot = 0; \n \tint[] times = new int[m];\n \tfor (int i = 0; i < m; i++){\n \n times[i] = in.nextInt();\n \t\t tot += times[i];\n //out.print(times[i] + \" , \");\n }\n\t\tout.println(tot > n ? -1 : n-tot);\n out.close();\n }\n \n}",
"Main"
] |
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.util.Arrays;
import java.util.StringTokenizer;
class InputReader {
BufferedReader buf;
StringTokenizer tok;
public InputReader() {
buf = new BufferedReader(new InputStreamReader(System.in));
// try {
// Path currentRelativePath = Paths.get("");
// String s = currentRelativePath.toAbsolutePath().toString();
// String curDir = System.getProperty("user.dir");
// System.out.println("current dir: " + s);
// buf = new BufferedReader(new FileReader("/Users/wangdong/Dropbox/LC_Java/src/test/resources/testA.txt"));
// } catch (FileNotFoundException e) {
// e.printStackTrace();
// }
}
public boolean hasNext() {
while (tok == null || !tok.hasMoreElements()) {
try {
tok = new StringTokenizer(buf.readLine());
} catch (Exception e) {
return false;
}
}
return true;
}
public String next() {
if (hasNext()) return tok.nextToken();
return null;
}
public int nextInt() {
return Integer.parseInt(next());
}
public long nextLong() {
return Long.parseLong(next());
}
public Double nextDouble() {
return Double.parseDouble(next());
}
public BigInteger nextBigInteger() {
return new BigInteger(next());
}
public BigDecimal nextBigDecimal() {
return new BigDecimal(next());
}
}
public class Main {
public static void main(String[] args) {
InputReader in = new InputReader();
PrintWriter out = new PrintWriter(System.out);
int n = in.nextInt(), m = in.nextInt();
// out.println(n + " , " + m);
int tot = 0;
int[] times = new int[m];
for (int i = 0; i < m; i++){
times[i] = in.nextInt();
tot += times[i];
//out.print(times[i] + " , ");
}
out.println(tot > n ? -1 : n-tot);
out.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,
41,
13,
17,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
18,
13,
13,
4,
18,
13,
0,
13,
18,
13,
13,
0,
13,
2,
13,
13,
14,
2,
13,
17,
30,
0,
13,
40,
17,
4,
18,
18,
13,
13,
13,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
80,
5
],
[
80,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
8,
17
],
[
17,
18
],
[
17,
19
],
[
19,
20
],
[
20,
21
],
[
8,
22
],
[
22,
23
],
[
22,
24
],
[
8,
26
],
[
26,
27
],
[
26,
28
],
[
8,
29
],
[
29,
30
],
[
29,
31
],
[
8,
32
],
[
32,
33
],
[
33,
34
],
[
34,
35
],
[
34,
36
],
[
32,
37
],
[
37,
38
],
[
37,
39
],
[
32,
40
],
[
40,
41
],
[
41,
42
],
[
32,
43
],
[
44,
44
],
[
44,
45
],
[
45,
46
],
[
46,
47
],
[
46,
48
],
[
45,
49
],
[
49,
50
],
[
50,
51
],
[
44,
52
],
[
52,
53
],
[
52,
54
],
[
54,
55
],
[
54,
56
],
[
8,
57
],
[
57,
58
],
[
57,
59
],
[
59,
60
],
[
59,
61
],
[
8,
62
],
[
62,
63
],
[
63,
64
],
[
63,
65
],
[
62,
66
],
[
66,
67
],
[
67,
68
],
[
67,
69
],
[
69,
70
],
[
8,
71
],
[
71,
72
],
[
72,
73
],
[
73,
74
],
[
73,
75
],
[
71,
76
],
[
6,
77
],
[
77,
78
],
[
0,
79
],
[
79,
80
],
[
79,
81
]
] |
[
"import java.util.Scanner;\n\npublic class Main {\n\n\tpublic static void main(String[] args) {\n\t\t// TODO ่ชๅ็ๆใใใใกใฝใใใปในใฟใ\n\n\t\tScanner sc = new Scanner(System.in);\n\n\t\tint N = sc.nextInt(); //ๅคไผใฟใฎๆฅๆฐ\n\t\tint M = sc.nextInt(); //ๅฎฟ้กใฎๆฐ\n\n\t\tint A[] = new int[M];//ๅฎฟ้กใซใใใๆฅๆฐ\n\t\tint sum = 0; //ๅฎฟ้กใซใใใๆฅๆฐใฎๅ่จ\n\t\tint result = 0; //้ในใๆฅๆฐ\n\n\t\tfor(int i=0; i<M; i++) {\n\n\t\t\tA[i] = sc.nextInt();\n\n\t\t\tsum += A[i];\n\t\t}\n\n\t\tresult = N - sum;\n\t\tif(result < 0) {\n\t\t\tresult = -1;\n\t\t}\n\n\t\tSystem.out.print(result);\n\t}\n\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n\n\tpublic static void main(String[] args) {\n\t\t// TODO ่ชๅ็ๆใใใใกใฝใใใปในใฟใ\n\n\t\tScanner sc = new Scanner(System.in);\n\n\t\tint N = sc.nextInt(); //ๅคไผใฟใฎๆฅๆฐ\n\t\tint M = sc.nextInt(); //ๅฎฟ้กใฎๆฐ\n\n\t\tint A[] = new int[M];//ๅฎฟ้กใซใใใๆฅๆฐ\n\t\tint sum = 0; //ๅฎฟ้กใซใใใๆฅๆฐใฎๅ่จ\n\t\tint result = 0; //้ในใๆฅๆฐ\n\n\t\tfor(int i=0; i<M; i++) {\n\n\t\t\tA[i] = sc.nextInt();\n\n\t\t\tsum += A[i];\n\t\t}\n\n\t\tresult = N - sum;\n\t\tif(result < 0) {\n\t\t\tresult = -1;\n\t\t}\n\n\t\tSystem.out.print(result);\n\t}\n\n}",
"Main",
"public static void main(String[] args) {\n\t\t// TODO ่ชๅ็ๆใใใใกใฝใใใปในใฟใ\n\n\t\tScanner sc = new Scanner(System.in);\n\n\t\tint N = sc.nextInt(); //ๅคไผใฟใฎๆฅๆฐ\n\t\tint M = sc.nextInt(); //ๅฎฟ้กใฎๆฐ\n\n\t\tint A[] = new int[M];//ๅฎฟ้กใซใใใๆฅๆฐ\n\t\tint sum = 0; //ๅฎฟ้กใซใใใๆฅๆฐใฎๅ่จ\n\t\tint result = 0; //้ในใๆฅๆฐ\n\n\t\tfor(int i=0; i<M; i++) {\n\n\t\t\tA[i] = sc.nextInt();\n\n\t\t\tsum += A[i];\n\t\t}\n\n\t\tresult = N - sum;\n\t\tif(result < 0) {\n\t\t\tresult = -1;\n\t\t}\n\n\t\tSystem.out.print(result);\n\t}",
"main",
"{\n\t\t// TODO ่ชๅ็ๆใใใใกใฝใใใปในใฟใ\n\n\t\tScanner sc = new Scanner(System.in);\n\n\t\tint N = sc.nextInt(); //ๅคไผใฟใฎๆฅๆฐ\n\t\tint M = sc.nextInt(); //ๅฎฟ้กใฎๆฐ\n\n\t\tint A[] = new int[M];//ๅฎฟ้กใซใใใๆฅๆฐ\n\t\tint sum = 0; //ๅฎฟ้กใซใใใๆฅๆฐใฎๅ่จ\n\t\tint result = 0; //้ในใๆฅๆฐ\n\n\t\tfor(int i=0; i<M; i++) {\n\n\t\t\tA[i] = sc.nextInt();\n\n\t\t\tsum += A[i];\n\t\t}\n\n\t\tresult = N - sum;\n\t\tif(result < 0) {\n\t\t\tresult = -1;\n\t\t}\n\n\t\tSystem.out.print(result);\n\t}",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"int N = sc.nextInt();",
"N",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int M = sc.nextInt();",
"M",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int A[] = new int[M];",
"A",
"new int[M]",
"M",
"int sum = 0;",
"sum",
"0",
"int result = 0;",
"result",
"0",
"for(int i=0; i<M; i++) {\n\n\t\t\tA[i] = sc.nextInt();\n\n\t\t\tsum += A[i];\n\t\t}",
"int i=0;",
"int i=0;",
"i",
"0",
"i<M",
"i",
"M",
"i++",
"i++",
"i",
"{\n\n\t\t\tA[i] = sc.nextInt();\n\n\t\t\tsum += A[i];\n\t\t}",
"{\n\n\t\t\tA[i] = sc.nextInt();\n\n\t\t\tsum += A[i];\n\t\t}",
"A[i] = sc.nextInt()",
"A[i]",
"A",
"i",
"sc.nextInt()",
"sc.nextInt",
"sc",
"sum += A[i]",
"sum",
"A[i]",
"A",
"i",
"result = N - sum",
"result",
"N - sum",
"N",
"sum",
"if(result < 0) {\n\t\t\tresult = -1;\n\t\t}",
"result < 0",
"result",
"0",
"{\n\t\t\tresult = -1;\n\t\t}",
"result = -1",
"result",
"-1",
"1",
"System.out.print(result)",
"System.out.print",
"System.out",
"System",
"System.out",
"result",
"String[] args",
"args",
"public class Main {\n\n\tpublic static void main(String[] args) {\n\t\t// TODO ่ชๅ็ๆใใใใกใฝใใใปในใฟใ\n\n\t\tScanner sc = new Scanner(System.in);\n\n\t\tint N = sc.nextInt(); //ๅคไผใฟใฎๆฅๆฐ\n\t\tint M = sc.nextInt(); //ๅฎฟ้กใฎๆฐ\n\n\t\tint A[] = new int[M];//ๅฎฟ้กใซใใใๆฅๆฐ\n\t\tint sum = 0; //ๅฎฟ้กใซใใใๆฅๆฐใฎๅ่จ\n\t\tint result = 0; //้ในใๆฅๆฐ\n\n\t\tfor(int i=0; i<M; i++) {\n\n\t\t\tA[i] = sc.nextInt();\n\n\t\t\tsum += A[i];\n\t\t}\n\n\t\tresult = N - sum;\n\t\tif(result < 0) {\n\t\t\tresult = -1;\n\t\t}\n\n\t\tSystem.out.print(result);\n\t}\n\n}",
"public class Main {\n\n\tpublic static void main(String[] args) {\n\t\t// TODO ่ชๅ็ๆใใใใกใฝใใใปในใฟใ\n\n\t\tScanner sc = new Scanner(System.in);\n\n\t\tint N = sc.nextInt(); //ๅคไผใฟใฎๆฅๆฐ\n\t\tint M = sc.nextInt(); //ๅฎฟ้กใฎๆฐ\n\n\t\tint A[] = new int[M];//ๅฎฟ้กใซใใใๆฅๆฐ\n\t\tint sum = 0; //ๅฎฟ้กใซใใใๆฅๆฐใฎๅ่จ\n\t\tint result = 0; //้ในใๆฅๆฐ\n\n\t\tfor(int i=0; i<M; i++) {\n\n\t\t\tA[i] = sc.nextInt();\n\n\t\t\tsum += A[i];\n\t\t}\n\n\t\tresult = N - sum;\n\t\tif(result < 0) {\n\t\t\tresult = -1;\n\t\t}\n\n\t\tSystem.out.print(result);\n\t}\n\n}",
"Main"
] |
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
// TODO ่ชๅ็ๆใใใใกใฝใใใปในใฟใ
Scanner sc = new Scanner(System.in);
int N = sc.nextInt(); //ๅคไผใฟใฎๆฅๆฐ
int M = sc.nextInt(); //ๅฎฟ้กใฎๆฐ
int A[] = new int[M];//ๅฎฟ้กใซใใใๆฅๆฐ
int sum = 0; //ๅฎฟ้กใซใใใๆฅๆฐใฎๅ่จ
int result = 0; //้ในใๆฅๆฐ
for(int i=0; i<M; i++) {
A[i] = sc.nextInt();
sum += A[i];
}
result = N - sum;
if(result < 0) {
result = -1;
}
System.out.print(result);
}
}
|
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
41,
13,
41,
13,
17,
41,
13,
17,
41,
13,
20,
0,
13,
4,
18,
13,
0,
13,
4,
18,
13,
41,
13,
20,
13,
42,
2,
13,
13,
30,
0,
18,
13,
13,
4,
18,
13,
0,
13,
2,
13,
18,
13,
13,
0,
13,
2,
13,
17,
41,
13,
2,
13,
13,
14,
2,
13,
17,
30,
4,
18,
18,
13,
13,
17,
30,
4,
18,
18,
13,
13,
13,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
86,
5
],
[
86,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
8,
11
],
[
11,
12
],
[
8,
13
],
[
13,
14
],
[
13,
15
],
[
8,
16
],
[
16,
17
],
[
16,
18
],
[
8,
19
],
[
19,
20
],
[
19,
21
],
[
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,
36
],
[
36,
37
],
[
37,
38
],
[
37,
39
],
[
36,
40
],
[
40,
41
],
[
41,
42
],
[
42,
43
],
[
42,
44
],
[
41,
45
],
[
45,
46
],
[
46,
47
],
[
40,
48
],
[
48,
49
],
[
48,
50
],
[
50,
51
],
[
50,
52
],
[
52,
53
],
[
52,
54
],
[
40,
55
],
[
55,
56
],
[
55,
57
],
[
57,
58
],
[
57,
59
],
[
8,
60
],
[
60,
61
],
[
60,
62
],
[
62,
63
],
[
62,
64
],
[
8,
65
],
[
65,
66
],
[
66,
67
],
[
66,
68
],
[
65,
69
],
[
69,
70
],
[
70,
71
],
[
71,
72
],
[
72,
73
],
[
72,
74
],
[
70,
75
],
[
65,
76
],
[
76,
77
],
[
77,
78
],
[
78,
79
],
[
79,
80
],
[
79,
81
],
[
77,
82
],
[
6,
83
],
[
83,
84
],
[
0,
85
],
[
85,
86
],
[
85,
87
]
] |
[
"import java.util.Scanner;\n\npublic class Main {\n\n public static void main(String[] args) {\n // write your code here\n int N;\n int M;\n int i = 0;\n int Sum = 0;\n\n\n Scanner scan = new Scanner(System.in);\n N = scan.nextInt();\n\n M = scan.nextInt();\n\n int[] A = new int[M];\n\n while (i < M) {\n \n A[i] = scan.nextInt();\n Sum = Sum + A[i];\n i = i + 1;\n }\n int Days = N - Sum;\n\n if (Days < 0) {\n System.out.println(\"-1\");\n } else {\n System.out.println(Days);\n\n }\n }\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n\n public static void main(String[] args) {\n // write your code here\n int N;\n int M;\n int i = 0;\n int Sum = 0;\n\n\n Scanner scan = new Scanner(System.in);\n N = scan.nextInt();\n\n M = scan.nextInt();\n\n int[] A = new int[M];\n\n while (i < M) {\n \n A[i] = scan.nextInt();\n Sum = Sum + A[i];\n i = i + 1;\n }\n int Days = N - Sum;\n\n if (Days < 0) {\n System.out.println(\"-1\");\n } else {\n System.out.println(Days);\n\n }\n }\n}",
"Main",
"public static void main(String[] args) {\n // write your code here\n int N;\n int M;\n int i = 0;\n int Sum = 0;\n\n\n Scanner scan = new Scanner(System.in);\n N = scan.nextInt();\n\n M = scan.nextInt();\n\n int[] A = new int[M];\n\n while (i < M) {\n \n A[i] = scan.nextInt();\n Sum = Sum + A[i];\n i = i + 1;\n }\n int Days = N - Sum;\n\n if (Days < 0) {\n System.out.println(\"-1\");\n } else {\n System.out.println(Days);\n\n }\n }",
"main",
"{\n // write your code here\n int N;\n int M;\n int i = 0;\n int Sum = 0;\n\n\n Scanner scan = new Scanner(System.in);\n N = scan.nextInt();\n\n M = scan.nextInt();\n\n int[] A = new int[M];\n\n while (i < M) {\n \n A[i] = scan.nextInt();\n Sum = Sum + A[i];\n i = i + 1;\n }\n int Days = N - Sum;\n\n if (Days < 0) {\n System.out.println(\"-1\");\n } else {\n System.out.println(Days);\n\n }\n }",
"int N;",
"N",
"int M;",
"M",
"int i = 0;",
"i",
"0",
"int Sum = 0;",
"Sum",
"0",
"Scanner scan = new Scanner(System.in);",
"scan",
"new Scanner(System.in)",
"N = scan.nextInt()",
"N",
"scan.nextInt()",
"scan.nextInt",
"scan",
"M = scan.nextInt()",
"M",
"scan.nextInt()",
"scan.nextInt",
"scan",
"int[] A = new int[M];",
"A",
"new int[M]",
"M",
"while (i < M) {\n \n A[i] = scan.nextInt();\n Sum = Sum + A[i];\n i = i + 1;\n }",
"i < M",
"i",
"M",
"{\n \n A[i] = scan.nextInt();\n Sum = Sum + A[i];\n i = i + 1;\n }",
"A[i] = scan.nextInt()",
"A[i]",
"A",
"i",
"scan.nextInt()",
"scan.nextInt",
"scan",
"Sum = Sum + A[i]",
"Sum",
"Sum + A[i]",
"Sum",
"A[i]",
"A",
"i",
"i = i + 1",
"i",
"i + 1",
"i",
"1",
"int Days = N - Sum;",
"Days",
"N - Sum",
"N",
"Sum",
"if (Days < 0) {\n System.out.println(\"-1\");\n } else {\n System.out.println(Days);\n\n }",
"Days < 0",
"Days",
"0",
"{\n System.out.println(\"-1\");\n }",
"System.out.println(\"-1\")",
"System.out.println",
"System.out",
"System",
"System.out",
"\"-1\"",
"{\n System.out.println(Days);\n\n }",
"System.out.println(Days)",
"System.out.println",
"System.out",
"System",
"System.out",
"Days",
"String[] args",
"args",
"public class Main {\n\n public static void main(String[] args) {\n // write your code here\n int N;\n int M;\n int i = 0;\n int Sum = 0;\n\n\n Scanner scan = new Scanner(System.in);\n N = scan.nextInt();\n\n M = scan.nextInt();\n\n int[] A = new int[M];\n\n while (i < M) {\n \n A[i] = scan.nextInt();\n Sum = Sum + A[i];\n i = i + 1;\n }\n int Days = N - Sum;\n\n if (Days < 0) {\n System.out.println(\"-1\");\n } else {\n System.out.println(Days);\n\n }\n }\n}",
"public class Main {\n\n public static void main(String[] args) {\n // write your code here\n int N;\n int M;\n int i = 0;\n int Sum = 0;\n\n\n Scanner scan = new Scanner(System.in);\n N = scan.nextInt();\n\n M = scan.nextInt();\n\n int[] A = new int[M];\n\n while (i < M) {\n \n A[i] = scan.nextInt();\n Sum = Sum + A[i];\n i = i + 1;\n }\n int Days = N - Sum;\n\n if (Days < 0) {\n System.out.println(\"-1\");\n } else {\n System.out.println(Days);\n\n }\n }\n}",
"Main"
] |
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
// write your code here
int N;
int M;
int i = 0;
int Sum = 0;
Scanner scan = new Scanner(System.in);
N = scan.nextInt();
M = scan.nextInt();
int[] A = new int[M];
while (i < M) {
A[i] = scan.nextInt();
Sum = Sum + A[i];
i = i + 1;
}
int Days = N - Sum;
if (Days < 0) {
System.out.println("-1");
} else {
System.out.println(Days);
}
}
}
|
[
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,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
4,
18,
13,
14,
2,
13,
13,
30,
4,
18,
18,
13,
13,
40,
17,
30,
4,
18,
18,
13,
13,
2,
13,
13,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
67,
5
],
[
67,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
8,
17
],
[
17,
18
],
[
17,
19
],
[
19,
20
],
[
20,
21
],
[
8,
22
],
[
22,
23
],
[
22,
24
],
[
8,
25
],
[
25,
26
],
[
26,
27
],
[
27,
28
],
[
27,
29
],
[
25,
30
],
[
30,
31
],
[
30,
32
],
[
25,
33
],
[
33,
34
],
[
34,
35
],
[
25,
36
],
[
37,
37
],
[
37,
38
],
[
38,
39
],
[
38,
40
],
[
40,
41
],
[
41,
42
],
[
8,
43
],
[
43,
44
],
[
44,
45
],
[
44,
46
],
[
43,
47
],
[
47,
48
],
[
48,
49
],
[
49,
50
],
[
50,
51
],
[
50,
52
],
[
48,
53
],
[
53,
54
],
[
43,
55
],
[
55,
56
],
[
56,
57
],
[
57,
58
],
[
58,
59
],
[
58,
60
],
[
56,
61
],
[
61,
62
],
[
61,
63
],
[
6,
64
],
[
64,
65
],
[
0,
66
],
[
66,
67
],
[
66,
68
]
] |
[
"import java.util.Scanner;\n\npublic class Main {\n\n\tpublic static void main(String[] args) {\n\t\tScanner s = new Scanner(System.in);\n\t\tint a = s.nextInt();\n\t\tint b = s.nextInt();\n\t\tint c = 0;\n\t\tfor (int i = 0; i < b ;i++) {\n\t\t\tc += s.nextInt();\n\t\t}\n\n\t\tif(a < c) {\n\t\t\tSystem.out.println(-1);\n\t\t} else {\n\t\t\tSystem.out.println(a - 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\tScanner s = new Scanner(System.in);\n\t\tint a = s.nextInt();\n\t\tint b = s.nextInt();\n\t\tint c = 0;\n\t\tfor (int i = 0; i < b ;i++) {\n\t\t\tc += s.nextInt();\n\t\t}\n\n\t\tif(a < c) {\n\t\t\tSystem.out.println(-1);\n\t\t} else {\n\t\t\tSystem.out.println(a - c);\n\t\t}\n\n\t}\n\n}",
"Main",
"public static void main(String[] args) {\n\t\tScanner s = new Scanner(System.in);\n\t\tint a = s.nextInt();\n\t\tint b = s.nextInt();\n\t\tint c = 0;\n\t\tfor (int i = 0; i < b ;i++) {\n\t\t\tc += s.nextInt();\n\t\t}\n\n\t\tif(a < c) {\n\t\t\tSystem.out.println(-1);\n\t\t} else {\n\t\t\tSystem.out.println(a - c);\n\t\t}\n\n\t}",
"main",
"{\n\t\tScanner s = new Scanner(System.in);\n\t\tint a = s.nextInt();\n\t\tint b = s.nextInt();\n\t\tint c = 0;\n\t\tfor (int i = 0; i < b ;i++) {\n\t\t\tc += s.nextInt();\n\t\t}\n\n\t\tif(a < c) {\n\t\t\tSystem.out.println(-1);\n\t\t} else {\n\t\t\tSystem.out.println(a - c);\n\t\t}\n\n\t}",
"Scanner s = new Scanner(System.in);",
"s",
"new Scanner(System.in)",
"int a = s.nextInt();",
"a",
"s.nextInt()",
"s.nextInt",
"s",
"int b = s.nextInt();",
"b",
"s.nextInt()",
"s.nextInt",
"s",
"int c = 0;",
"c",
"0",
"for (int i = 0; i < b ;i++) {\n\t\t\tc += s.nextInt();\n\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < b",
"i",
"b",
"i++",
"i++",
"i",
"{\n\t\t\tc += s.nextInt();\n\t\t}",
"{\n\t\t\tc += s.nextInt();\n\t\t}",
"c += s.nextInt()",
"c",
"s.nextInt()",
"s.nextInt",
"s",
"if(a < c) {\n\t\t\tSystem.out.println(-1);\n\t\t} else {\n\t\t\tSystem.out.println(a - c);\n\t\t}",
"a < c",
"a",
"c",
"{\n\t\t\tSystem.out.println(-1);\n\t\t}",
"System.out.println(-1)",
"System.out.println",
"System.out",
"System",
"System.out",
"-1",
"1",
"{\n\t\t\tSystem.out.println(a - c);\n\t\t}",
"System.out.println(a - c)",
"System.out.println",
"System.out",
"System",
"System.out",
"a - c",
"a",
"c",
"String[] args",
"args",
"public class Main {\n\n\tpublic static void main(String[] args) {\n\t\tScanner s = new Scanner(System.in);\n\t\tint a = s.nextInt();\n\t\tint b = s.nextInt();\n\t\tint c = 0;\n\t\tfor (int i = 0; i < b ;i++) {\n\t\t\tc += s.nextInt();\n\t\t}\n\n\t\tif(a < c) {\n\t\t\tSystem.out.println(-1);\n\t\t} else {\n\t\t\tSystem.out.println(a - c);\n\t\t}\n\n\t}\n\n}",
"public class Main {\n\n\tpublic static void main(String[] args) {\n\t\tScanner s = new Scanner(System.in);\n\t\tint a = s.nextInt();\n\t\tint b = s.nextInt();\n\t\tint c = 0;\n\t\tfor (int i = 0; i < b ;i++) {\n\t\t\tc += s.nextInt();\n\t\t}\n\n\t\tif(a < c) {\n\t\t\tSystem.out.println(-1);\n\t\t} else {\n\t\t\tSystem.out.println(a - c);\n\t\t}\n\n\t}\n\n}",
"Main"
] |
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner s = new Scanner(System.in);
int a = s.nextInt();
int b = s.nextInt();
int c = 0;
for (int i = 0; i < b ;i++) {
c += s.nextInt();
}
if(a < c) {
System.out.println(-1);
} else {
System.out.println(a - 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,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
18,
13,
13,
4,
18,
13,
0,
13,
18,
13,
13,
14,
2,
13,
13,
30,
4,
18,
18,
13,
13,
2,
13,
13,
30,
4,
18,
18,
13,
13,
40,
17,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
78,
5
],
[
78,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
8,
17
],
[
17,
18
],
[
17,
19
],
[
19,
20
],
[
20,
21
],
[
8,
22
],
[
22,
23
],
[
22,
24
],
[
8,
26
],
[
26,
27
],
[
26,
28
],
[
8,
29
],
[
29,
30
],
[
30,
31
],
[
31,
32
],
[
31,
33
],
[
29,
34
],
[
34,
35
],
[
34,
36
],
[
29,
37
],
[
37,
38
],
[
38,
39
],
[
29,
40
],
[
41,
41
],
[
41,
42
],
[
42,
43
],
[
43,
44
],
[
43,
45
],
[
42,
46
],
[
46,
47
],
[
47,
48
],
[
41,
49
],
[
49,
50
],
[
49,
51
],
[
51,
52
],
[
51,
53
],
[
8,
54
],
[
54,
55
],
[
55,
56
],
[
55,
57
],
[
54,
58
],
[
58,
59
],
[
59,
60
],
[
60,
61
],
[
61,
62
],
[
61,
63
],
[
59,
64
],
[
64,
65
],
[
64,
66
],
[
54,
67
],
[
67,
68
],
[
68,
69
],
[
69,
70
],
[
70,
71
],
[
70,
72
],
[
68,
73
],
[
73,
74
],
[
6,
75
],
[
75,
76
],
[
0,
77
],
[
77,
78
],
[
77,
79
]
] |
[
"import java.util.Scanner;\npublic class Main {\n\n\tpublic static void main(String[] args) {\n\t\tScanner scan = new Scanner(System.in);\n\t\tint n = scan.nextInt();\n\t\tint m = scan.nextInt();\n\t\tint[] a = new int[m];\n\t\tint count = 0;\n\t\t\n\t\tfor(int i=0;i<m;i++) {\n\t\t\ta[i] = scan.nextInt();\n\t\t\tcount += a[i];\n\t\t}\n\t\t\n\t\tif(n >= count) {\n\t\t\tSystem.out.println(n-count);\n\t\t}else {\n\t\t\tSystem.out.println(-1);\n\t\t}\n\n\t}\n\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n\n\tpublic static void main(String[] args) {\n\t\tScanner scan = new Scanner(System.in);\n\t\tint n = scan.nextInt();\n\t\tint m = scan.nextInt();\n\t\tint[] a = new int[m];\n\t\tint count = 0;\n\t\t\n\t\tfor(int i=0;i<m;i++) {\n\t\t\ta[i] = scan.nextInt();\n\t\t\tcount += a[i];\n\t\t}\n\t\t\n\t\tif(n >= count) {\n\t\t\tSystem.out.println(n-count);\n\t\t}else {\n\t\t\tSystem.out.println(-1);\n\t\t}\n\n\t}\n\n}",
"Main",
"public static void main(String[] args) {\n\t\tScanner scan = new Scanner(System.in);\n\t\tint n = scan.nextInt();\n\t\tint m = scan.nextInt();\n\t\tint[] a = new int[m];\n\t\tint count = 0;\n\t\t\n\t\tfor(int i=0;i<m;i++) {\n\t\t\ta[i] = scan.nextInt();\n\t\t\tcount += a[i];\n\t\t}\n\t\t\n\t\tif(n >= count) {\n\t\t\tSystem.out.println(n-count);\n\t\t}else {\n\t\t\tSystem.out.println(-1);\n\t\t}\n\n\t}",
"main",
"{\n\t\tScanner scan = new Scanner(System.in);\n\t\tint n = scan.nextInt();\n\t\tint m = scan.nextInt();\n\t\tint[] a = new int[m];\n\t\tint count = 0;\n\t\t\n\t\tfor(int i=0;i<m;i++) {\n\t\t\ta[i] = scan.nextInt();\n\t\t\tcount += a[i];\n\t\t}\n\t\t\n\t\tif(n >= count) {\n\t\t\tSystem.out.println(n-count);\n\t\t}else {\n\t\t\tSystem.out.println(-1);\n\t\t}\n\n\t}",
"Scanner scan = new Scanner(System.in);",
"scan",
"new Scanner(System.in)",
"int n = scan.nextInt();",
"n",
"scan.nextInt()",
"scan.nextInt",
"scan",
"int m = scan.nextInt();",
"m",
"scan.nextInt()",
"scan.nextInt",
"scan",
"int[] a = new int[m];",
"a",
"new int[m]",
"m",
"int count = 0;",
"count",
"0",
"for(int i=0;i<m;i++) {\n\t\t\ta[i] = scan.nextInt();\n\t\t\tcount += a[i];\n\t\t}",
"int i=0;",
"int i=0;",
"i",
"0",
"i<m",
"i",
"m",
"i++",
"i++",
"i",
"{\n\t\t\ta[i] = scan.nextInt();\n\t\t\tcount += a[i];\n\t\t}",
"{\n\t\t\ta[i] = scan.nextInt();\n\t\t\tcount += a[i];\n\t\t}",
"a[i] = scan.nextInt()",
"a[i]",
"a",
"i",
"scan.nextInt()",
"scan.nextInt",
"scan",
"count += a[i]",
"count",
"a[i]",
"a",
"i",
"if(n >= count) {\n\t\t\tSystem.out.println(n-count);\n\t\t}else {\n\t\t\tSystem.out.println(-1);\n\t\t}",
"n >= count",
"n",
"count",
"{\n\t\t\tSystem.out.println(n-count);\n\t\t}",
"System.out.println(n-count)",
"System.out.println",
"System.out",
"System",
"System.out",
"n-count",
"n",
"count",
"{\n\t\t\tSystem.out.println(-1);\n\t\t}",
"System.out.println(-1)",
"System.out.println",
"System.out",
"System",
"System.out",
"-1",
"1",
"String[] args",
"args",
"public class Main {\n\n\tpublic static void main(String[] args) {\n\t\tScanner scan = new Scanner(System.in);\n\t\tint n = scan.nextInt();\n\t\tint m = scan.nextInt();\n\t\tint[] a = new int[m];\n\t\tint count = 0;\n\t\t\n\t\tfor(int i=0;i<m;i++) {\n\t\t\ta[i] = scan.nextInt();\n\t\t\tcount += a[i];\n\t\t}\n\t\t\n\t\tif(n >= count) {\n\t\t\tSystem.out.println(n-count);\n\t\t}else {\n\t\t\tSystem.out.println(-1);\n\t\t}\n\n\t}\n\n}",
"public class Main {\n\n\tpublic static void main(String[] args) {\n\t\tScanner scan = new Scanner(System.in);\n\t\tint n = scan.nextInt();\n\t\tint m = scan.nextInt();\n\t\tint[] a = new int[m];\n\t\tint count = 0;\n\t\t\n\t\tfor(int i=0;i<m;i++) {\n\t\t\ta[i] = scan.nextInt();\n\t\t\tcount += a[i];\n\t\t}\n\t\t\n\t\tif(n >= count) {\n\t\t\tSystem.out.println(n-count);\n\t\t}else {\n\t\t\tSystem.out.println(-1);\n\t\t}\n\n\t}\n\n}",
"Main"
] |
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
int n = scan.nextInt();
int m = scan.nextInt();
int[] a = new int[m];
int count = 0;
for(int i=0;i<m;i++) {
a[i] = scan.nextInt();
count += a[i];
}
if(n >= count) {
System.out.println(n-count);
}else {
System.out.println(-1);
}
}
}
|
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
41,
13,
20,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
18,
13,
13,
4,
18,
13,
0,
13,
2,
13,
18,
13,
13,
14,
2,
13,
17,
30,
4,
18,
18,
13,
13,
13,
30,
4,
18,
18,
13,
13,
17,
23,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
8,
17
],
[
17,
18
],
[
17,
19
],
[
19,
20
],
[
20,
21
],
[
8,
22
],
[
22,
23
],
[
22,
24
],
[
8,
26
],
[
26,
27
],
[
27,
28
],
[
28,
29
],
[
28,
30
],
[
26,
31
],
[
31,
32
],
[
31,
33
],
[
26,
34
],
[
34,
35
],
[
35,
36
],
[
26,
37
],
[
38,
38
],
[
38,
39
],
[
39,
40
],
[
40,
41
],
[
40,
42
],
[
39,
43
],
[
43,
44
],
[
44,
45
],
[
38,
46
],
[
46,
47
],
[
46,
48
],
[
48,
49
],
[
48,
50
],
[
50,
51
],
[
50,
52
],
[
8,
53
],
[
53,
54
],
[
54,
55
],
[
54,
56
],
[
53,
57
],
[
57,
58
],
[
58,
59
],
[
59,
60
],
[
60,
61
],
[
60,
62
],
[
58,
63
],
[
53,
64
],
[
64,
65
],
[
65,
66
],
[
66,
67
],
[
67,
68
],
[
67,
69
],
[
65,
70
],
[
6,
71
],
[
71,
72
]
] |
[
"import java.util.*;\n\nclass Main {\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n int N = sc.nextInt();\n int M = sc.nextInt();\n int[] A = new int[M];\n for(int n = 0; n < M; n++) {\n A[n] = sc.nextInt();\n N = N - A[n];\n }\n\n if(N >= 0) {\n System.out.println(N);\n } else {\n System.out.println(\"-1\");\n }\n }\n}",
"import java.util.*;",
"util.*",
"java",
"class Main {\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n int N = sc.nextInt();\n int M = sc.nextInt();\n int[] A = new int[M];\n for(int n = 0; n < M; n++) {\n A[n] = sc.nextInt();\n N = N - A[n];\n }\n\n if(N >= 0) {\n System.out.println(N);\n } else {\n System.out.println(\"-1\");\n }\n }\n}",
"Main",
"public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n int N = sc.nextInt();\n int M = sc.nextInt();\n int[] A = new int[M];\n for(int n = 0; n < M; n++) {\n A[n] = sc.nextInt();\n N = N - A[n];\n }\n\n if(N >= 0) {\n System.out.println(N);\n } else {\n System.out.println(\"-1\");\n }\n }",
"main",
"{\n Scanner sc = new Scanner(System.in);\n int N = sc.nextInt();\n int M = sc.nextInt();\n int[] A = new int[M];\n for(int n = 0; n < M; n++) {\n A[n] = sc.nextInt();\n N = N - A[n];\n }\n\n if(N >= 0) {\n System.out.println(N);\n } else {\n System.out.println(\"-1\");\n }\n }",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"int N = sc.nextInt();",
"N",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int M = sc.nextInt();",
"M",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int[] A = new int[M];",
"A",
"new int[M]",
"M",
"for(int n = 0; n < M; n++) {\n A[n] = sc.nextInt();\n N = N - A[n];\n }",
"int n = 0;",
"int n = 0;",
"n",
"0",
"n < M",
"n",
"M",
"n++",
"n++",
"n",
"{\n A[n] = sc.nextInt();\n N = N - A[n];\n }",
"{\n A[n] = sc.nextInt();\n N = N - A[n];\n }",
"A[n] = sc.nextInt()",
"A[n]",
"A",
"n",
"sc.nextInt()",
"sc.nextInt",
"sc",
"N = N - A[n]",
"N",
"N - A[n]",
"N",
"A[n]",
"A",
"n",
"if(N >= 0) {\n System.out.println(N);\n } else {\n System.out.println(\"-1\");\n }",
"N >= 0",
"N",
"0",
"{\n System.out.println(N);\n }",
"System.out.println(N)",
"System.out.println",
"System.out",
"System",
"System.out",
"N",
"{\n System.out.println(\"-1\");\n }",
"System.out.println(\"-1\")",
"System.out.println",
"System.out",
"System",
"System.out",
"\"-1\"",
"String[] args",
"args"
] |
import java.util.*;
class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int N = sc.nextInt();
int M = sc.nextInt();
int[] A = new int[M];
for(int n = 0; n < M; n++) {
A[n] = sc.nextInt();
N = N - A[n];
}
if(N >= 0) {
System.out.println(N);
} else {
System.out.println("-1");
}
}
}
|
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
41,
13,
17,
41,
13,
20,
13,
42,
2,
40,
13,
17,
30,
0,
18,
13,
13,
4,
18,
13,
0,
13,
18,
13,
13,
41,
13,
2,
13,
13,
4,
18,
18,
13,
13,
8,
2,
13,
17,
13,
17,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
66,
5
],
[
66,
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,
29
],
[
29,
30
],
[
30,
31
],
[
31,
32
],
[
30,
33
],
[
29,
34
],
[
34,
35
],
[
35,
36
],
[
36,
37
],
[
36,
38
],
[
35,
39
],
[
39,
40
],
[
40,
41
],
[
34,
42
],
[
42,
43
],
[
42,
44
],
[
44,
45
],
[
44,
46
],
[
8,
47
],
[
47,
48
],
[
47,
49
],
[
49,
50
],
[
49,
51
],
[
8,
52
],
[
52,
53
],
[
53,
54
],
[
54,
55
],
[
54,
56
],
[
52,
57
],
[
57,
58
],
[
58,
59
],
[
58,
60
],
[
57,
61
],
[
57,
62
],
[
6,
63
],
[
63,
64
],
[
0,
65
],
[
65,
66
],
[
65,
67
]
] |
[
"import java.util.*;\n \npublic class Main {\n\tpublic static void main (String[] args) {\n\t\tScanner sc = new Scanner (System.in);\n\t\tint n = sc.nextInt(); int m = sc.nextInt(); int s = 0;\n\t\tint[] a = new int[m];\n\t\twhile (m-- > 0) {\n\t\t\ta[m] = sc.nextInt();\n\t\t\ts+=a[m];\n\t\t}\n\t\t\tint v = n-s;\n\t\t\tSystem.out.println(v >= 0 ? v : \"-1\");\n\t}\n}",
"import java.util.*;",
"util.*",
"java",
"public class Main {\n\tpublic static void main (String[] args) {\n\t\tScanner sc = new Scanner (System.in);\n\t\tint n = sc.nextInt(); int m = sc.nextInt(); int s = 0;\n\t\tint[] a = new int[m];\n\t\twhile (m-- > 0) {\n\t\t\ta[m] = sc.nextInt();\n\t\t\ts+=a[m];\n\t\t}\n\t\t\tint v = n-s;\n\t\t\tSystem.out.println(v >= 0 ? v : \"-1\");\n\t}\n}",
"Main",
"public static void main (String[] args) {\n\t\tScanner sc = new Scanner (System.in);\n\t\tint n = sc.nextInt(); int m = sc.nextInt(); int s = 0;\n\t\tint[] a = new int[m];\n\t\twhile (m-- > 0) {\n\t\t\ta[m] = sc.nextInt();\n\t\t\ts+=a[m];\n\t\t}\n\t\t\tint v = n-s;\n\t\t\tSystem.out.println(v >= 0 ? v : \"-1\");\n\t}",
"main",
"{\n\t\tScanner sc = new Scanner (System.in);\n\t\tint n = sc.nextInt(); int m = sc.nextInt(); int s = 0;\n\t\tint[] a = new int[m];\n\t\twhile (m-- > 0) {\n\t\t\ta[m] = sc.nextInt();\n\t\t\ts+=a[m];\n\t\t}\n\t\t\tint v = n-s;\n\t\t\tSystem.out.println(v >= 0 ? v : \"-1\");\n\t}",
"Scanner sc = new Scanner (System.in);",
"sc",
"new Scanner (System.in)",
"int n = sc.nextInt();",
"n",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int m = sc.nextInt();",
"m",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int s = 0;",
"s",
"0",
"int[] a = new int[m];",
"a",
"new int[m]",
"m",
"while (m-- > 0) {\n\t\t\ta[m] = sc.nextInt();\n\t\t\ts+=a[m];\n\t\t}",
"m-- > 0",
"m--",
"m",
"0",
"{\n\t\t\ta[m] = sc.nextInt();\n\t\t\ts+=a[m];\n\t\t}",
"a[m] = sc.nextInt()",
"a[m]",
"a",
"m",
"sc.nextInt()",
"sc.nextInt",
"sc",
"s+=a[m]",
"s",
"a[m]",
"a",
"m",
"int v = n-s;",
"v",
"n-s",
"n",
"s",
"System.out.println(v >= 0 ? v : \"-1\")",
"System.out.println",
"System.out",
"System",
"System.out",
"v >= 0 ? v : \"-1\"",
"v >= 0",
"v",
"0",
"v",
"\"-1\"",
"String[] args",
"args",
"public class Main {\n\tpublic static void main (String[] args) {\n\t\tScanner sc = new Scanner (System.in);\n\t\tint n = sc.nextInt(); int m = sc.nextInt(); int s = 0;\n\t\tint[] a = new int[m];\n\t\twhile (m-- > 0) {\n\t\t\ta[m] = sc.nextInt();\n\t\t\ts+=a[m];\n\t\t}\n\t\t\tint v = n-s;\n\t\t\tSystem.out.println(v >= 0 ? v : \"-1\");\n\t}\n}",
"public class Main {\n\tpublic static void main (String[] args) {\n\t\tScanner sc = new Scanner (System.in);\n\t\tint n = sc.nextInt(); int m = sc.nextInt(); int s = 0;\n\t\tint[] a = new int[m];\n\t\twhile (m-- > 0) {\n\t\t\ta[m] = sc.nextInt();\n\t\t\ts+=a[m];\n\t\t}\n\t\t\tint v = n-s;\n\t\t\tSystem.out.println(v >= 0 ? v : \"-1\");\n\t}\n}",
"Main"
] |
import java.util.*;
public class Main {
public static void main (String[] args) {
Scanner sc = new Scanner (System.in);
int n = sc.nextInt(); int m = sc.nextInt(); int s = 0;
int[] a = new int[m];
while (m-- > 0) {
a[m] = sc.nextInt();
s+=a[m];
}
int v = n-s;
System.out.println(v >= 0 ? v : "-1");
}
}
|
[
7,
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,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
41,
13,
4,
18,
13,
4,
18,
13,
13,
41,
13,
17,
28,
13,
13,
30,
30,
0,
13,
13,
14,
2,
13,
17,
30,
0,
13,
40,
17,
4,
18,
18,
13,
13,
13,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
85,
5
],
[
85,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
8,
15
],
[
15,
16
],
[
15,
17
],
[
17,
18
],
[
18,
19
],
[
17,
20
],
[
20,
21
],
[
21,
22
],
[
8,
23
],
[
23,
24
],
[
23,
25
],
[
25,
26
],
[
26,
27
],
[
25,
28
],
[
28,
29
],
[
29,
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
],
[
47,
49
],
[
49,
50
],
[
50,
51
],
[
46,
52
],
[
52,
53
],
[
53,
54
],
[
52,
55
],
[
8,
56
],
[
56,
57
],
[
56,
58
],
[
8,
59
],
[
59,
60
],
[
59,
61
],
[
59,
62
],
[
63,
63
],
[
63,
64
],
[
64,
65
],
[
64,
66
],
[
8,
67
],
[
67,
68
],
[
68,
69
],
[
68,
70
],
[
67,
71
],
[
71,
72
],
[
72,
73
],
[
72,
74
],
[
74,
75
],
[
8,
76
],
[
76,
77
],
[
77,
78
],
[
78,
79
],
[
78,
80
],
[
76,
81
],
[
6,
82
],
[
82,
83
],
[
0,
84
],
[
84,
85
],
[
84,
86
]
] |
[
"import java.util.*;\n \npublic class Main { //ใฏใฉในๅใฏMain\n public static void main(String[] args) {\n //ๆดๆฐใฎๅ
ฅๅ\n List<String> list = new ArrayList<String>();\n Scanner sc = new Scanner(System.in);\n Integer ndate = Integer.parseInt(sc.next());\n Integer msyuku = Integer.parseInt(sc.next());\n \n //ๅฎฟ้กใฎๆฅๆฐใฎ่จ้ฒ\n List<Integer> num = new ArrayList<>();\n for (int i=0; i<msyuku; i++) {\n int di = sc.nextInt();\n num.add(di);\n }\n\n int asobu = 0;\n //ๆฅๆฐใๆธใใ\n for (int n : num){\n ndate -= n;\n }\n\n //ๅฎฟ้กใ็ตใใใใใใชใใใฐ-1\n if(ndate < 0){\n ndate = -1;\n }\n\n System.out.println(ndate);\n }\n \n}",
"import java.util.*;",
"util.*",
"java",
"public class Main { //ใฏใฉในๅใฏMain\n public static void main(String[] args) {\n //ๆดๆฐใฎๅ
ฅๅ\n List<String> list = new ArrayList<String>();\n Scanner sc = new Scanner(System.in);\n Integer ndate = Integer.parseInt(sc.next());\n Integer msyuku = Integer.parseInt(sc.next());\n \n //ๅฎฟ้กใฎๆฅๆฐใฎ่จ้ฒ\n List<Integer> num = new ArrayList<>();\n for (int i=0; i<msyuku; i++) {\n int di = sc.nextInt();\n num.add(di);\n }\n\n int asobu = 0;\n //ๆฅๆฐใๆธใใ\n for (int n : num){\n ndate -= n;\n }\n\n //ๅฎฟ้กใ็ตใใใใใใชใใใฐ-1\n if(ndate < 0){\n ndate = -1;\n }\n\n System.out.println(ndate);\n }\n \n}",
"Main",
"public static void main(String[] args) {\n //ๆดๆฐใฎๅ
ฅๅ\n List<String> list = new ArrayList<String>();\n Scanner sc = new Scanner(System.in);\n Integer ndate = Integer.parseInt(sc.next());\n Integer msyuku = Integer.parseInt(sc.next());\n \n //ๅฎฟ้กใฎๆฅๆฐใฎ่จ้ฒ\n List<Integer> num = new ArrayList<>();\n for (int i=0; i<msyuku; i++) {\n int di = sc.nextInt();\n num.add(di);\n }\n\n int asobu = 0;\n //ๆฅๆฐใๆธใใ\n for (int n : num){\n ndate -= n;\n }\n\n //ๅฎฟ้กใ็ตใใใใใใชใใใฐ-1\n if(ndate < 0){\n ndate = -1;\n }\n\n System.out.println(ndate);\n }",
"main",
"{\n //ๆดๆฐใฎๅ
ฅๅ\n List<String> list = new ArrayList<String>();\n Scanner sc = new Scanner(System.in);\n Integer ndate = Integer.parseInt(sc.next());\n Integer msyuku = Integer.parseInt(sc.next());\n \n //ๅฎฟ้กใฎๆฅๆฐใฎ่จ้ฒ\n List<Integer> num = new ArrayList<>();\n for (int i=0; i<msyuku; i++) {\n int di = sc.nextInt();\n num.add(di);\n }\n\n int asobu = 0;\n //ๆฅๆฐใๆธใใ\n for (int n : num){\n ndate -= n;\n }\n\n //ๅฎฟ้กใ็ตใใใใใใชใใใฐ-1\n if(ndate < 0){\n ndate = -1;\n }\n\n System.out.println(ndate);\n }",
"List<String> list = new ArrayList<String>();",
"list",
"new ArrayList<String>()",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"Integer ndate = Integer.parseInt(sc.next());",
"ndate",
"Integer.parseInt(sc.next())",
"Integer.parseInt",
"Integer",
"sc.next()",
"sc.next",
"sc",
"Integer msyuku = Integer.parseInt(sc.next());",
"msyuku",
"Integer.parseInt(sc.next())",
"Integer.parseInt",
"Integer",
"sc.next()",
"sc.next",
"sc",
"List<Integer> num = new ArrayList<>();",
"num",
"new ArrayList<>()",
"for (int i=0; i<msyuku; i++) {\n int di = sc.nextInt();\n num.add(di);\n }",
"int i=0;",
"int i=0;",
"i",
"0",
"i<msyuku",
"i",
"msyuku",
"i++",
"i++",
"i",
"{\n int di = sc.nextInt();\n num.add(di);\n }",
"{\n int di = sc.nextInt();\n num.add(di);\n }",
"int di = sc.nextInt();",
"di",
"sc.nextInt()",
"sc.nextInt",
"sc",
"num.add(di)",
"num.add",
"num",
"di",
"int asobu = 0;",
"asobu",
"0",
"for (int n : num){\n ndate -= n;\n }",
"int n",
"num",
"{\n ndate -= n;\n }",
"{\n ndate -= n;\n }",
"ndate -= n",
"ndate",
"n",
"if(ndate < 0){\n ndate = -1;\n }",
"ndate < 0",
"ndate",
"0",
"{\n ndate = -1;\n }",
"ndate = -1",
"ndate",
"-1",
"1",
"System.out.println(ndate)",
"System.out.println",
"System.out",
"System",
"System.out",
"ndate",
"String[] args",
"args",
"public class Main { //ใฏใฉในๅใฏMain\n public static void main(String[] args) {\n //ๆดๆฐใฎๅ
ฅๅ\n List<String> list = new ArrayList<String>();\n Scanner sc = new Scanner(System.in);\n Integer ndate = Integer.parseInt(sc.next());\n Integer msyuku = Integer.parseInt(sc.next());\n \n //ๅฎฟ้กใฎๆฅๆฐใฎ่จ้ฒ\n List<Integer> num = new ArrayList<>();\n for (int i=0; i<msyuku; i++) {\n int di = sc.nextInt();\n num.add(di);\n }\n\n int asobu = 0;\n //ๆฅๆฐใๆธใใ\n for (int n : num){\n ndate -= n;\n }\n\n //ๅฎฟ้กใ็ตใใใใใใชใใใฐ-1\n if(ndate < 0){\n ndate = -1;\n }\n\n System.out.println(ndate);\n }\n \n}",
"public class Main { //ใฏใฉในๅใฏMain\n public static void main(String[] args) {\n //ๆดๆฐใฎๅ
ฅๅ\n List<String> list = new ArrayList<String>();\n Scanner sc = new Scanner(System.in);\n Integer ndate = Integer.parseInt(sc.next());\n Integer msyuku = Integer.parseInt(sc.next());\n \n //ๅฎฟ้กใฎๆฅๆฐใฎ่จ้ฒ\n List<Integer> num = new ArrayList<>();\n for (int i=0; i<msyuku; i++) {\n int di = sc.nextInt();\n num.add(di);\n }\n\n int asobu = 0;\n //ๆฅๆฐใๆธใใ\n for (int n : num){\n ndate -= n;\n }\n\n //ๅฎฟ้กใ็ตใใใใใใชใใใฐ-1\n if(ndate < 0){\n ndate = -1;\n }\n\n System.out.println(ndate);\n }\n \n}",
"Main"
] |
import java.util.*;
public class Main { //ใฏใฉในๅใฏMain
public static void main(String[] args) {
//ๆดๆฐใฎๅ
ฅๅ
List<String> list = new ArrayList<String>();
Scanner sc = new Scanner(System.in);
Integer ndate = Integer.parseInt(sc.next());
Integer msyuku = Integer.parseInt(sc.next());
//ๅฎฟ้กใฎๆฅๆฐใฎ่จ้ฒ
List<Integer> num = new ArrayList<>();
for (int i=0; i<msyuku; i++) {
int di = sc.nextInt();
num.add(di);
}
int asobu = 0;
//ๆฅๆฐใๆธใใ
for (int n : num){
ndate -= n;
}
//ๅฎฟ้กใ็ตใใใใใใชใใใฐ-1
if(ndate < 0){
ndate = -1;
}
System.out.println(ndate);
}
}
|
[
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,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
0,
18,
13,
13,
4,
18,
13,
41,
13,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
0,
13,
2,
13,
18,
13,
13,
14,
2,
13,
17,
30,
4,
18,
18,
13,
13,
40,
17,
30,
4,
18,
18,
13,
13,
13,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
89,
5
],
[
89,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
8,
17
],
[
17,
18
],
[
17,
19
],
[
19,
20
],
[
20,
21
],
[
8,
22
],
[
22,
23
],
[
22,
24
],
[
8,
26
],
[
26,
27
],
[
27,
28
],
[
28,
29
],
[
28,
30
],
[
26,
31
],
[
31,
32
],
[
31,
33
],
[
26,
34
],
[
34,
35
],
[
35,
36
],
[
26,
37
],
[
37,
38
],
[
38,
39
],
[
39,
40
],
[
39,
41
],
[
38,
42
],
[
42,
43
],
[
43,
44
],
[
8,
45
],
[
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
],
[
59,
60
],
[
60,
61
],
[
60,
62
],
[
62,
63
],
[
62,
64
],
[
64,
65
],
[
64,
66
],
[
8,
67
],
[
67,
68
],
[
68,
69
],
[
68,
70
],
[
67,
71
],
[
71,
72
],
[
72,
73
],
[
73,
74
],
[
74,
75
],
[
74,
76
],
[
72,
77
],
[
77,
78
],
[
67,
79
],
[
79,
80
],
[
80,
81
],
[
81,
82
],
[
82,
83
],
[
82,
84
],
[
80,
85
],
[
6,
86
],
[
86,
87
],
[
0,
88
],
[
88,
89
],
[
88,
90
]
] |
[
"import java.util.*;\n\npublic class Main {\n public static void main(String[] args){\n Scanner sc = new Scanner(System.in);\n\n int n = sc.nextInt();\n int m = sc.nextInt();\n\n int[] a = new int[m];\n\n for(int i = 0; i < m; i++)\n a[i] = sc.nextInt();\n\n int ans = n;\n for(int i = 0; i < m; i++)\n ans = ans - a[i];\n\n if(ans < 0){\n System.out.println(-1);\n }else{\n System.out.println(ans);\n }\n }\n}",
"import java.util.*;",
"util.*",
"java",
"public class Main {\n public static void main(String[] args){\n Scanner sc = new Scanner(System.in);\n\n int n = sc.nextInt();\n int m = sc.nextInt();\n\n int[] a = new int[m];\n\n for(int i = 0; i < m; i++)\n a[i] = sc.nextInt();\n\n int ans = n;\n for(int i = 0; i < m; i++)\n ans = ans - a[i];\n\n if(ans < 0){\n System.out.println(-1);\n }else{\n System.out.println(ans);\n }\n }\n}",
"Main",
"public static void main(String[] args){\n Scanner sc = new Scanner(System.in);\n\n int n = sc.nextInt();\n int m = sc.nextInt();\n\n int[] a = new int[m];\n\n for(int i = 0; i < m; i++)\n a[i] = sc.nextInt();\n\n int ans = n;\n for(int i = 0; i < m; i++)\n ans = ans - a[i];\n\n if(ans < 0){\n System.out.println(-1);\n }else{\n System.out.println(ans);\n }\n }",
"main",
"{\n Scanner sc = new Scanner(System.in);\n\n int n = sc.nextInt();\n int m = sc.nextInt();\n\n int[] a = new int[m];\n\n for(int i = 0; i < m; i++)\n a[i] = sc.nextInt();\n\n int ans = n;\n for(int i = 0; i < m; i++)\n ans = ans - a[i];\n\n if(ans < 0){\n System.out.println(-1);\n }else{\n System.out.println(ans);\n }\n }",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"int n = sc.nextInt();",
"n",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int m = sc.nextInt();",
"m",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int[] a = new int[m];",
"a",
"new int[m]",
"m",
"for(int i = 0; i < m; i++)\n a[i] = sc.nextInt();",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < m",
"i",
"m",
"i++",
"i++",
"i",
"a[i] = sc.nextInt();",
"a[i] = sc.nextInt()",
"a[i]",
"a",
"i",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int ans = n;",
"ans",
"n",
"for(int i = 0; i < m; i++)\n ans = ans - a[i];",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < m",
"i",
"m",
"i++",
"i++",
"i",
"ans = ans - a[i];",
"ans = ans - a[i]",
"ans",
"ans - a[i]",
"ans",
"a[i]",
"a",
"i",
"if(ans < 0){\n System.out.println(-1);\n }else{\n System.out.println(ans);\n }",
"ans < 0",
"ans",
"0",
"{\n System.out.println(-1);\n }",
"System.out.println(-1)",
"System.out.println",
"System.out",
"System",
"System.out",
"-1",
"1",
"{\n System.out.println(ans);\n }",
"System.out.println(ans)",
"System.out.println",
"System.out",
"System",
"System.out",
"ans",
"String[] args",
"args",
"public class Main {\n public static void main(String[] args){\n Scanner sc = new Scanner(System.in);\n\n int n = sc.nextInt();\n int m = sc.nextInt();\n\n int[] a = new int[m];\n\n for(int i = 0; i < m; i++)\n a[i] = sc.nextInt();\n\n int ans = n;\n for(int i = 0; i < m; i++)\n ans = ans - a[i];\n\n if(ans < 0){\n System.out.println(-1);\n }else{\n System.out.println(ans);\n }\n }\n}",
"public class Main {\n public static void main(String[] args){\n Scanner sc = new Scanner(System.in);\n\n int n = sc.nextInt();\n int m = sc.nextInt();\n\n int[] a = new int[m];\n\n for(int i = 0; i < m; i++)\n a[i] = sc.nextInt();\n\n int ans = n;\n for(int i = 0; i < m; i++)\n ans = ans - a[i];\n\n if(ans < 0){\n System.out.println(-1);\n }else{\n System.out.println(ans);\n }\n }\n}",
"Main"
] |
import java.util.*;
public class Main {
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
int m = sc.nextInt();
int[] a = new int[m];
for(int i = 0; i < m; i++)
a[i] = sc.nextInt();
int ans = n;
for(int i = 0; i < m; i++)
ans = ans - a[i];
if(ans < 0){
System.out.println(-1);
}else{
System.out.println(ans);
}
}
}
|
[
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,
11,
1,
41,
13,
17,
2,
13,
18,
13,
13,
1,
40,
13,
30,
30,
0,
18,
13,
13,
4,
18,
13,
0,
13,
2,
13,
18,
13,
13,
14,
2,
13,
13,
30,
4,
18,
18,
13,
13,
2,
13,
13,
30,
4,
18,
18,
13,
13,
40,
17,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
82,
5
],
[
82,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
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,
29
],
[
29,
30
],
[
30,
31
],
[
31,
32
],
[
31,
33
],
[
29,
34
],
[
34,
35
],
[
34,
36
],
[
36,
37
],
[
36,
38
],
[
29,
39
],
[
39,
40
],
[
40,
41
],
[
29,
42
],
[
43,
43
],
[
43,
44
],
[
44,
45
],
[
45,
46
],
[
45,
47
],
[
44,
48
],
[
48,
49
],
[
49,
50
],
[
43,
51
],
[
51,
52
],
[
51,
53
],
[
53,
54
],
[
53,
55
],
[
55,
56
],
[
55,
57
],
[
8,
58
],
[
58,
59
],
[
59,
60
],
[
59,
61
],
[
58,
62
],
[
62,
63
],
[
63,
64
],
[
64,
65
],
[
65,
66
],
[
65,
67
],
[
63,
68
],
[
68,
69
],
[
68,
70
],
[
58,
71
],
[
71,
72
],
[
72,
73
],
[
73,
74
],
[
74,
75
],
[
74,
76
],
[
72,
77
],
[
77,
78
],
[
6,
79
],
[
79,
80
],
[
0,
81
],
[
81,
82
],
[
81,
83
]
] |
[
"import java.util.Scanner;\npublic class Main {\n\n public static void main(String[] args){\n Scanner sc=new Scanner(System.in);\n int n=sc.nextInt();\n int m=sc.nextInt();\n int sum=0;\n int[] arr=new int[m];\n for (int i = 0; i <arr.length ; i++) {\n arr[i]=sc.nextInt();\n sum=sum+arr[i];\n }\n if(sum<=n) {\n System.out.println(n - sum);\n }else {\n System.out.println(-1);\n }\n\n\n\n\n\n\n\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 sc=new Scanner(System.in);\n int n=sc.nextInt();\n int m=sc.nextInt();\n int sum=0;\n int[] arr=new int[m];\n for (int i = 0; i <arr.length ; i++) {\n arr[i]=sc.nextInt();\n sum=sum+arr[i];\n }\n if(sum<=n) {\n System.out.println(n - sum);\n }else {\n System.out.println(-1);\n }\n\n\n\n\n\n\n\n\n }\n}",
"Main",
"public static void main(String[] args){\n Scanner sc=new Scanner(System.in);\n int n=sc.nextInt();\n int m=sc.nextInt();\n int sum=0;\n int[] arr=new int[m];\n for (int i = 0; i <arr.length ; i++) {\n arr[i]=sc.nextInt();\n sum=sum+arr[i];\n }\n if(sum<=n) {\n System.out.println(n - sum);\n }else {\n System.out.println(-1);\n }\n\n\n\n\n\n\n\n\n }",
"main",
"{\n Scanner sc=new Scanner(System.in);\n int n=sc.nextInt();\n int m=sc.nextInt();\n int sum=0;\n int[] arr=new int[m];\n for (int i = 0; i <arr.length ; i++) {\n arr[i]=sc.nextInt();\n sum=sum+arr[i];\n }\n if(sum<=n) {\n System.out.println(n - sum);\n }else {\n System.out.println(-1);\n }\n\n\n\n\n\n\n\n\n }",
"Scanner sc=new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"int n=sc.nextInt();",
"n",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int m=sc.nextInt();",
"m",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int sum=0;",
"sum",
"0",
"int[] arr=new int[m];",
"arr",
"new int[m]",
"m",
"for (int i = 0; i <arr.length ; i++) {\n arr[i]=sc.nextInt();\n sum=sum+arr[i];\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i <arr.length",
"i",
"arr.length",
"arr",
"arr.length",
"i++",
"i++",
"i",
"{\n arr[i]=sc.nextInt();\n sum=sum+arr[i];\n }",
"{\n arr[i]=sc.nextInt();\n sum=sum+arr[i];\n }",
"arr[i]=sc.nextInt()",
"arr[i]",
"arr",
"i",
"sc.nextInt()",
"sc.nextInt",
"sc",
"sum=sum+arr[i]",
"sum",
"sum+arr[i]",
"sum",
"arr[i]",
"arr",
"i",
"if(sum<=n) {\n System.out.println(n - sum);\n }else {\n System.out.println(-1);\n }",
"sum<=n",
"sum",
"n",
"{\n System.out.println(n - sum);\n }",
"System.out.println(n - sum)",
"System.out.println",
"System.out",
"System",
"System.out",
"n - sum",
"n",
"sum",
"{\n System.out.println(-1);\n }",
"System.out.println(-1)",
"System.out.println",
"System.out",
"System",
"System.out",
"-1",
"1",
"String[] args",
"args",
"public class Main {\n\n public static void main(String[] args){\n Scanner sc=new Scanner(System.in);\n int n=sc.nextInt();\n int m=sc.nextInt();\n int sum=0;\n int[] arr=new int[m];\n for (int i = 0; i <arr.length ; i++) {\n arr[i]=sc.nextInt();\n sum=sum+arr[i];\n }\n if(sum<=n) {\n System.out.println(n - sum);\n }else {\n System.out.println(-1);\n }\n\n\n\n\n\n\n\n\n }\n}",
"public class Main {\n\n public static void main(String[] args){\n Scanner sc=new Scanner(System.in);\n int n=sc.nextInt();\n int m=sc.nextInt();\n int sum=0;\n int[] arr=new int[m];\n for (int i = 0; i <arr.length ; i++) {\n arr[i]=sc.nextInt();\n sum=sum+arr[i];\n }\n if(sum<=n) {\n System.out.println(n - sum);\n }else {\n System.out.println(-1);\n }\n\n\n\n\n\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 n=sc.nextInt();
int m=sc.nextInt();
int sum=0;
int[] arr=new int[m];
for (int i = 0; i <arr.length ; i++) {
arr[i]=sc.nextInt();
sum=sum+arr[i];
}
if(sum<=n) {
System.out.println(n - sum);
}else {
System.out.println(-1);
}
}
}
|
[
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,
13,
41,
13,
4,
18,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
4,
18,
13,
4,
18,
13,
0,
13,
4,
18,
13,
13,
4,
18,
18,
13,
13,
8,
2,
13,
17,
40,
17,
13,
23,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
10,
11
],
[
10,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
15,
17
],
[
14,
18
],
[
18,
19
],
[
18,
20
],
[
14,
21
],
[
21,
22
],
[
21,
23
],
[
23,
24
],
[
24,
25
],
[
14,
26
],
[
26,
27
],
[
26,
28
],
[
28,
29
],
[
29,
30
],
[
14,
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
],
[
44,
47
],
[
47,
48
],
[
48,
49
],
[
43,
50
],
[
50,
51
],
[
50,
52
],
[
52,
53
],
[
53,
54
],
[
52,
55
],
[
14,
56
],
[
56,
57
],
[
57,
58
],
[
58,
59
],
[
58,
60
],
[
56,
61
],
[
61,
62
],
[
62,
63
],
[
62,
64
],
[
61,
65
],
[
65,
66
],
[
61,
67
],
[
12,
68
],
[
68,
69
]
] |
[
"import java.util.*;\nimport java.util.stream.IntStream;\nimport java.util.stream.Stream;\n\nclass Main {\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n List<Long> list = new ArrayList<>();\n int h = sc.nextInt(), w = sc.nextInt();\n for (int i = 0; i < w; i++) {\n list.add(sc.nextLong());\n h -=list.get(i);\n }\n System.out.println (h < 0 ? -1 : h);\n }\n}",
"import java.util.*;",
"util.*",
"java",
"import java.util.stream.IntStream;",
"IntStream",
"java.util.stream",
"import java.util.stream.Stream;",
"Stream",
"java.util.stream",
"class Main {\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n List<Long> list = new ArrayList<>();\n int h = sc.nextInt(), w = sc.nextInt();\n for (int i = 0; i < w; i++) {\n list.add(sc.nextLong());\n h -=list.get(i);\n }\n System.out.println (h < 0 ? -1 : h);\n }\n}",
"Main",
"public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n List<Long> list = new ArrayList<>();\n int h = sc.nextInt(), w = sc.nextInt();\n for (int i = 0; i < w; i++) {\n list.add(sc.nextLong());\n h -=list.get(i);\n }\n System.out.println (h < 0 ? -1 : h);\n }",
"main",
"{\n Scanner sc = new Scanner(System.in);\n List<Long> list = new ArrayList<>();\n int h = sc.nextInt(), w = sc.nextInt();\n for (int i = 0; i < w; i++) {\n list.add(sc.nextLong());\n h -=list.get(i);\n }\n System.out.println (h < 0 ? -1 : h);\n }",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"List<Long> list = new ArrayList<>();",
"list",
"new ArrayList<>()",
"int h = sc.nextInt()",
"h",
"sc.nextInt()",
"sc.nextInt",
"sc",
"w = sc.nextInt();",
"w",
"sc.nextInt()",
"sc.nextInt",
"sc",
"for (int i = 0; i < w; i++) {\n list.add(sc.nextLong());\n h -=list.get(i);\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < w",
"i",
"w",
"i++",
"i++",
"i",
"{\n list.add(sc.nextLong());\n h -=list.get(i);\n }",
"{\n list.add(sc.nextLong());\n h -=list.get(i);\n }",
"list.add(sc.nextLong())",
"list.add",
"list",
"sc.nextLong()",
"sc.nextLong",
"sc",
"h -=list.get(i)",
"h",
"list.get(i)",
"list.get",
"list",
"i",
"System.out.println (h < 0 ? -1 : h)",
"System.out.println",
"System.out",
"System",
"System.out",
"h < 0 ? -1 : h",
"h < 0",
"h",
"0",
"-1",
"1",
"h",
"String[] args",
"args"
] |
import java.util.*;
import java.util.stream.IntStream;
import java.util.stream.Stream;
class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
List<Long> list = new ArrayList<>();
int h = sc.nextInt(), w = sc.nextInt();
for (int i = 0; i < w; i++) {
list.add(sc.nextLong());
h -=list.get(i);
}
System.out.println (h < 0 ? -1 : h);
}
}
|
[
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,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
18,
13,
13,
4,
18,
13,
11,
1,
41,
13,
17,
2,
13,
18,
13,
13,
1,
40,
13,
30,
30,
0,
13,
18,
13,
13,
14,
2,
17,
13,
30,
4,
18,
18,
13,
13,
13,
30,
4,
18,
18,
13,
13,
17,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
87,
5
],
[
87,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
8,
17
],
[
17,
18
],
[
17,
19
],
[
19,
20
],
[
20,
21
],
[
8,
22
],
[
22,
23
],
[
22,
24
],
[
8,
26
],
[
26,
27
],
[
27,
28
],
[
28,
29
],
[
28,
30
],
[
26,
31
],
[
31,
32
],
[
31,
33
],
[
26,
34
],
[
34,
35
],
[
35,
36
],
[
26,
37
],
[
38,
38
],
[
38,
39
],
[
39,
40
],
[
40,
41
],
[
40,
42
],
[
39,
43
],
[
43,
44
],
[
44,
45
],
[
8,
46
],
[
46,
47
],
[
47,
48
],
[
48,
49
],
[
48,
50
],
[
46,
51
],
[
51,
52
],
[
51,
53
],
[
53,
54
],
[
53,
55
],
[
46,
56
],
[
56,
57
],
[
57,
58
],
[
46,
59
],
[
60,
60
],
[
60,
61
],
[
61,
62
],
[
61,
63
],
[
63,
64
],
[
63,
65
],
[
8,
66
],
[
66,
67
],
[
67,
68
],
[
67,
69
],
[
66,
70
],
[
70,
71
],
[
71,
72
],
[
72,
73
],
[
73,
74
],
[
73,
75
],
[
71,
76
],
[
66,
77
],
[
77,
78
],
[
78,
79
],
[
79,
80
],
[
80,
81
],
[
80,
82
],
[
78,
83
],
[
6,
84
],
[
84,
85
],
[
0,
86
],
[
86,
87
],
[
86,
88
]
] |
[
"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 stdIn = new Scanner(System.in);\n\t\tint N = stdIn.nextInt();\n\t\tint M = stdIn.nextInt();\n\t\tint[] A = new int[M];\n\t\tfor(int i = 0; i < M; i ++) {\n\t\t\tA[i] = stdIn.nextInt();\n\t\t}\n\t\tfor(int i = 0; i < A.length; i ++) {\n\t\t\tN -= A[i];\n\t\t}\n\t\tif(0 <= N) {\n\t\t\tSystem.out.println(N);\n\t\t}else {\n\t\t\tSystem.out.println(\"-1\");\n\t\t}\n\t}\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n\n\tpublic static void main(String[] args) {\n\t\t// TODO Auto-generated method stub\n\t\tScanner stdIn = new Scanner(System.in);\n\t\tint N = stdIn.nextInt();\n\t\tint M = stdIn.nextInt();\n\t\tint[] A = new int[M];\n\t\tfor(int i = 0; i < M; i ++) {\n\t\t\tA[i] = stdIn.nextInt();\n\t\t}\n\t\tfor(int i = 0; i < A.length; i ++) {\n\t\t\tN -= A[i];\n\t\t}\n\t\tif(0 <= N) {\n\t\t\tSystem.out.println(N);\n\t\t}else {\n\t\t\tSystem.out.println(\"-1\");\n\t\t}\n\t}\n}",
"Main",
"public static void main(String[] args) {\n\t\t// TODO Auto-generated method stub\n\t\tScanner stdIn = new Scanner(System.in);\n\t\tint N = stdIn.nextInt();\n\t\tint M = stdIn.nextInt();\n\t\tint[] A = new int[M];\n\t\tfor(int i = 0; i < M; i ++) {\n\t\t\tA[i] = stdIn.nextInt();\n\t\t}\n\t\tfor(int i = 0; i < A.length; i ++) {\n\t\t\tN -= A[i];\n\t\t}\n\t\tif(0 <= N) {\n\t\t\tSystem.out.println(N);\n\t\t}else {\n\t\t\tSystem.out.println(\"-1\");\n\t\t}\n\t}",
"main",
"{\n\t\t// TODO Auto-generated method stub\n\t\tScanner stdIn = new Scanner(System.in);\n\t\tint N = stdIn.nextInt();\n\t\tint M = stdIn.nextInt();\n\t\tint[] A = new int[M];\n\t\tfor(int i = 0; i < M; i ++) {\n\t\t\tA[i] = stdIn.nextInt();\n\t\t}\n\t\tfor(int i = 0; i < A.length; i ++) {\n\t\t\tN -= A[i];\n\t\t}\n\t\tif(0 <= N) {\n\t\t\tSystem.out.println(N);\n\t\t}else {\n\t\t\tSystem.out.println(\"-1\");\n\t\t}\n\t}",
"Scanner stdIn = new Scanner(System.in);",
"stdIn",
"new Scanner(System.in)",
"int N = stdIn.nextInt();",
"N",
"stdIn.nextInt()",
"stdIn.nextInt",
"stdIn",
"int M = stdIn.nextInt();",
"M",
"stdIn.nextInt()",
"stdIn.nextInt",
"stdIn",
"int[] A = new int[M];",
"A",
"new int[M]",
"M",
"for(int i = 0; i < M; i ++) {\n\t\t\tA[i] = stdIn.nextInt();\n\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < M",
"i",
"M",
"i ++",
"i ++",
"i",
"{\n\t\t\tA[i] = stdIn.nextInt();\n\t\t}",
"{\n\t\t\tA[i] = stdIn.nextInt();\n\t\t}",
"A[i] = stdIn.nextInt()",
"A[i]",
"A",
"i",
"stdIn.nextInt()",
"stdIn.nextInt",
"stdIn",
"for(int i = 0; i < A.length; i ++) {\n\t\t\tN -= A[i];\n\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < A.length",
"i",
"A.length",
"A",
"A.length",
"i ++",
"i ++",
"i",
"{\n\t\t\tN -= A[i];\n\t\t}",
"{\n\t\t\tN -= A[i];\n\t\t}",
"N -= A[i]",
"N",
"A[i]",
"A",
"i",
"if(0 <= N) {\n\t\t\tSystem.out.println(N);\n\t\t}else {\n\t\t\tSystem.out.println(\"-1\");\n\t\t}",
"0 <= N",
"0",
"N",
"{\n\t\t\tSystem.out.println(N);\n\t\t}",
"System.out.println(N)",
"System.out.println",
"System.out",
"System",
"System.out",
"N",
"{\n\t\t\tSystem.out.println(\"-1\");\n\t\t}",
"System.out.println(\"-1\")",
"System.out.println",
"System.out",
"System",
"System.out",
"\"-1\"",
"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 stdIn = new Scanner(System.in);\n\t\tint N = stdIn.nextInt();\n\t\tint M = stdIn.nextInt();\n\t\tint[] A = new int[M];\n\t\tfor(int i = 0; i < M; i ++) {\n\t\t\tA[i] = stdIn.nextInt();\n\t\t}\n\t\tfor(int i = 0; i < A.length; i ++) {\n\t\t\tN -= A[i];\n\t\t}\n\t\tif(0 <= N) {\n\t\t\tSystem.out.println(N);\n\t\t}else {\n\t\t\tSystem.out.println(\"-1\");\n\t\t}\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 stdIn = new Scanner(System.in);\n\t\tint N = stdIn.nextInt();\n\t\tint M = stdIn.nextInt();\n\t\tint[] A = new int[M];\n\t\tfor(int i = 0; i < M; i ++) {\n\t\t\tA[i] = stdIn.nextInt();\n\t\t}\n\t\tfor(int i = 0; i < A.length; i ++) {\n\t\t\tN -= A[i];\n\t\t}\n\t\tif(0 <= N) {\n\t\t\tSystem.out.println(N);\n\t\t}else {\n\t\t\tSystem.out.println(\"-1\");\n\t\t}\n\t}\n}",
"Main"
] |
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
// TODO Auto-generated method stub
Scanner stdIn = new Scanner(System.in);
int N = stdIn.nextInt();
int M = stdIn.nextInt();
int[] A = new int[M];
for(int i = 0; i < M; i ++) {
A[i] = stdIn.nextInt();
}
for(int i = 0; i < A.length; i ++) {
N -= A[i];
}
if(0 <= N) {
System.out.println(N);
}else {
System.out.println("-1");
}
}
}
|
[
7,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
41,
13,
20,
13,
11,
1,
41,
13,
17,
2,
13,
18,
13,
13,
1,
40,
13,
30,
30,
0,
18,
13,
13,
4,
18,
13,
41,
13,
4,
18,
4,
18,
13,
13,
14,
2,
2,
13,
13,
17,
30,
4,
18,
18,
13,
13,
17,
30,
4,
18,
18,
13,
13,
2,
13,
13,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
84,
8
],
[
84,
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,
29
],
[
29,
30
],
[
30,
31
],
[
31,
32
],
[
31,
33
],
[
29,
34
],
[
34,
35
],
[
34,
36
],
[
36,
37
],
[
36,
38
],
[
29,
39
],
[
39,
40
],
[
40,
41
],
[
29,
42
],
[
43,
43
],
[
43,
44
],
[
44,
45
],
[
45,
46
],
[
45,
47
],
[
44,
48
],
[
48,
49
],
[
49,
50
],
[
11,
51
],
[
51,
52
],
[
51,
53
],
[
53,
54
],
[
54,
55
],
[
55,
56
],
[
56,
57
],
[
55,
58
],
[
11,
59
],
[
59,
60
],
[
60,
61
],
[
61,
62
],
[
61,
63
],
[
60,
64
],
[
59,
65
],
[
65,
66
],
[
66,
67
],
[
67,
68
],
[
68,
69
],
[
68,
70
],
[
66,
71
],
[
59,
72
],
[
72,
73
],
[
73,
74
],
[
74,
75
],
[
75,
76
],
[
75,
77
],
[
73,
78
],
[
78,
79
],
[
78,
80
],
[
9,
81
],
[
81,
82
],
[
0,
83
],
[
83,
84
],
[
83,
85
]
] |
[
"\nimport java.util.Arrays;\nimport java.util.Scanner;\npublic class Main {\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n int n = sc.nextInt();\n int m = sc.nextInt();\n int[] arr = new int[m];\n for (int i = 0; i < arr.length; i++) {\n arr[i] = sc.nextInt();\n }\n long sum = Arrays.stream(arr).sum();\n if (n - sum < 0) {\n System.out.println(\"-1\");\n } else {\n System.out.println(n - sum);\n }\n }\n}\n",
"import java.util.Arrays;",
"Arrays",
"java.util",
"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 n = sc.nextInt();\n int m = sc.nextInt();\n int[] arr = new int[m];\n for (int i = 0; i < arr.length; i++) {\n arr[i] = sc.nextInt();\n }\n long sum = Arrays.stream(arr).sum();\n if (n - sum < 0) {\n System.out.println(\"-1\");\n } else {\n System.out.println(n - sum);\n }\n }\n}",
"Main",
"public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n int n = sc.nextInt();\n int m = sc.nextInt();\n int[] arr = new int[m];\n for (int i = 0; i < arr.length; i++) {\n arr[i] = sc.nextInt();\n }\n long sum = Arrays.stream(arr).sum();\n if (n - sum < 0) {\n System.out.println(\"-1\");\n } else {\n System.out.println(n - sum);\n }\n }",
"main",
"{\n Scanner sc = new Scanner(System.in);\n int n = sc.nextInt();\n int m = sc.nextInt();\n int[] arr = new int[m];\n for (int i = 0; i < arr.length; i++) {\n arr[i] = sc.nextInt();\n }\n long sum = Arrays.stream(arr).sum();\n if (n - sum < 0) {\n System.out.println(\"-1\");\n } else {\n System.out.println(n - sum);\n }\n }",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"int n = sc.nextInt();",
"n",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int m = sc.nextInt();",
"m",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int[] arr = new int[m];",
"arr",
"new int[m]",
"m",
"for (int i = 0; i < arr.length; i++) {\n arr[i] = sc.nextInt();\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < arr.length",
"i",
"arr.length",
"arr",
"arr.length",
"i++",
"i++",
"i",
"{\n arr[i] = sc.nextInt();\n }",
"{\n arr[i] = sc.nextInt();\n }",
"arr[i] = sc.nextInt()",
"arr[i]",
"arr",
"i",
"sc.nextInt()",
"sc.nextInt",
"sc",
"long sum = Arrays.stream(arr).sum();",
"sum",
"Arrays.stream(arr).sum()",
"Arrays.stream(arr).sum",
"Arrays.stream(arr)",
"Arrays.stream",
"Arrays",
"arr",
"if (n - sum < 0) {\n System.out.println(\"-1\");\n } else {\n System.out.println(n - sum);\n }",
"n - sum < 0",
"n - sum",
"n",
"sum",
"0",
"{\n System.out.println(\"-1\");\n }",
"System.out.println(\"-1\")",
"System.out.println",
"System.out",
"System",
"System.out",
"\"-1\"",
"{\n System.out.println(n - sum);\n }",
"System.out.println(n - sum)",
"System.out.println",
"System.out",
"System",
"System.out",
"n - sum",
"n",
"sum",
"String[] args",
"args",
"public class Main {\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n int n = sc.nextInt();\n int m = sc.nextInt();\n int[] arr = new int[m];\n for (int i = 0; i < arr.length; i++) {\n arr[i] = sc.nextInt();\n }\n long sum = Arrays.stream(arr).sum();\n if (n - sum < 0) {\n System.out.println(\"-1\");\n } else {\n System.out.println(n - sum);\n }\n }\n}",
"public class Main {\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n int n = sc.nextInt();\n int m = sc.nextInt();\n int[] arr = new int[m];\n for (int i = 0; i < arr.length; i++) {\n arr[i] = sc.nextInt();\n }\n long sum = Arrays.stream(arr).sum();\n if (n - sum < 0) {\n System.out.println(\"-1\");\n } else {\n System.out.println(n - sum);\n }\n }\n}",
"Main"
] |
import java.util.Arrays;
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
int m = sc.nextInt();
int[] arr = new int[m];
for (int i = 0; i < arr.length; i++) {
arr[i] = sc.nextInt();
}
long sum = Arrays.stream(arr).sum();
if (n - sum < 0) {
System.out.println("-1");
} else {
System.out.println(n - sum);
}
}
}
|
[
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,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
4,
18,
13,
41,
13,
2,
13,
13,
14,
2,
13,
17,
30,
4,
18,
18,
13,
13,
40,
17,
30,
4,
18,
18,
13,
13,
13,
23,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
8,
14
],
[
14,
15
],
[
8,
16
],
[
16,
17
],
[
16,
18
],
[
18,
19
],
[
19,
20
],
[
8,
21
],
[
21,
22
],
[
21,
23
],
[
23,
24
],
[
24,
25
],
[
8,
26
],
[
26,
27
],
[
26,
28
],
[
8,
29
],
[
29,
30
],
[
30,
31
],
[
31,
32
],
[
31,
33
],
[
29,
34
],
[
34,
35
],
[
34,
36
],
[
29,
37
],
[
37,
38
],
[
38,
39
],
[
29,
40
],
[
41,
41
],
[
41,
42
],
[
42,
43
],
[
42,
44
],
[
44,
45
],
[
45,
46
],
[
8,
47
],
[
47,
48
],
[
47,
49
],
[
49,
50
],
[
49,
51
],
[
8,
52
],
[
52,
53
],
[
53,
54
],
[
53,
55
],
[
52,
56
],
[
56,
57
],
[
57,
58
],
[
58,
59
],
[
59,
60
],
[
59,
61
],
[
57,
62
],
[
62,
63
],
[
52,
64
],
[
64,
65
],
[
65,
66
],
[
66,
67
],
[
67,
68
],
[
67,
69
],
[
65,
70
],
[
6,
71
],
[
71,
72
]
] |
[
"import java.util.*;\n\nclass Main\n{\n public static void main(String[] args)\n {\n Scanner stdIn = new Scanner(System.in);\n int N;\n int M;\n \n N = stdIn.nextInt();\n M = stdIn.nextInt();\n \n int sum = 0;\n for(int i = 0; i < M; i++)\n {\n sum += stdIn.nextInt();\n }\n \n int ans = N - sum;\n if(ans < 0)\n {\n System.out.println(-1);\n }\n else\n {\n System.out.println(ans);\n }\n \n }\n}",
"import java.util.*;",
"util.*",
"java",
"class Main\n{\n public static void main(String[] args)\n {\n Scanner stdIn = new Scanner(System.in);\n int N;\n int M;\n \n N = stdIn.nextInt();\n M = stdIn.nextInt();\n \n int sum = 0;\n for(int i = 0; i < M; i++)\n {\n sum += stdIn.nextInt();\n }\n \n int ans = N - sum;\n if(ans < 0)\n {\n System.out.println(-1);\n }\n else\n {\n System.out.println(ans);\n }\n \n }\n}",
"Main",
"public static void main(String[] args)\n {\n Scanner stdIn = new Scanner(System.in);\n int N;\n int M;\n \n N = stdIn.nextInt();\n M = stdIn.nextInt();\n \n int sum = 0;\n for(int i = 0; i < M; i++)\n {\n sum += stdIn.nextInt();\n }\n \n int ans = N - sum;\n if(ans < 0)\n {\n System.out.println(-1);\n }\n else\n {\n System.out.println(ans);\n }\n \n }",
"main",
"{\n Scanner stdIn = new Scanner(System.in);\n int N;\n int M;\n \n N = stdIn.nextInt();\n M = stdIn.nextInt();\n \n int sum = 0;\n for(int i = 0; i < M; i++)\n {\n sum += stdIn.nextInt();\n }\n \n int ans = N - sum;\n if(ans < 0)\n {\n System.out.println(-1);\n }\n else\n {\n System.out.println(ans);\n }\n \n }",
"Scanner stdIn = new Scanner(System.in);",
"stdIn",
"new Scanner(System.in)",
"int N;",
"N",
"int M;",
"M",
"N = stdIn.nextInt()",
"N",
"stdIn.nextInt()",
"stdIn.nextInt",
"stdIn",
"M = stdIn.nextInt()",
"M",
"stdIn.nextInt()",
"stdIn.nextInt",
"stdIn",
"int sum = 0;",
"sum",
"0",
"for(int i = 0; i < M; i++)\n {\n sum += stdIn.nextInt();\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < M",
"i",
"M",
"i++",
"i++",
"i",
"{\n sum += stdIn.nextInt();\n }",
"{\n sum += stdIn.nextInt();\n }",
"sum += stdIn.nextInt()",
"sum",
"stdIn.nextInt()",
"stdIn.nextInt",
"stdIn",
"int ans = N - sum;",
"ans",
"N - sum",
"N",
"sum",
"if(ans < 0)\n {\n System.out.println(-1);\n }\n else\n {\n System.out.println(ans);\n }",
"ans < 0",
"ans",
"0",
"{\n System.out.println(-1);\n }",
"System.out.println(-1)",
"System.out.println",
"System.out",
"System",
"System.out",
"-1",
"1",
"{\n System.out.println(ans);\n }",
"System.out.println(ans)",
"System.out.println",
"System.out",
"System",
"System.out",
"ans",
"String[] args",
"args"
] |
import java.util.*;
class Main
{
public static void main(String[] args)
{
Scanner stdIn = new Scanner(System.in);
int N;
int M;
N = stdIn.nextInt();
M = stdIn.nextInt();
int sum = 0;
for(int i = 0; i < M; i++)
{
sum += stdIn.nextInt();
}
int ans = N - sum;
if(ans < 0)
{
System.out.println(-1);
}
else
{
System.out.println(ans);
}
}
}
|
[
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,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
18,
13,
13,
4,
18,
13,
41,
13,
17,
28,
13,
13,
30,
30,
0,
13,
13,
14,
2,
2,
13,
13,
17,
30,
4,
18,
18,
13,
13,
17,
30,
4,
18,
18,
13,
13,
2,
13,
13,
4,
18,
13,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
85,
5
],
[
85,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
8,
17
],
[
17,
18
],
[
17,
19
],
[
19,
20
],
[
20,
21
],
[
8,
22
],
[
22,
23
],
[
22,
24
],
[
8,
26
],
[
26,
27
],
[
27,
28
],
[
28,
29
],
[
28,
30
],
[
26,
31
],
[
31,
32
],
[
31,
33
],
[
26,
34
],
[
34,
35
],
[
35,
36
],
[
26,
37
],
[
38,
38
],
[
38,
39
],
[
39,
40
],
[
40,
41
],
[
40,
42
],
[
39,
43
],
[
43,
44
],
[
44,
45
],
[
8,
46
],
[
46,
47
],
[
46,
48
],
[
8,
49
],
[
49,
50
],
[
49,
51
],
[
49,
52
],
[
53,
53
],
[
53,
54
],
[
54,
55
],
[
54,
56
],
[
8,
57
],
[
57,
58
],
[
58,
59
],
[
59,
60
],
[
59,
61
],
[
58,
62
],
[
57,
63
],
[
63,
64
],
[
64,
65
],
[
65,
66
],
[
66,
67
],
[
66,
68
],
[
64,
69
],
[
57,
70
],
[
70,
71
],
[
71,
72
],
[
72,
73
],
[
73,
74
],
[
73,
75
],
[
71,
76
],
[
76,
77
],
[
76,
78
],
[
8,
79
],
[
79,
80
],
[
80,
81
],
[
6,
82
],
[
82,
83
],
[
0,
84
],
[
84,
85
],
[
84,
86
]
] |
[
"import java.util.Scanner;\n\npublic class Main {\n\n\tpublic static void main(String[] args) {\n\t\t// TODO ่ชๅ็ๆใใใใกใฝใใใปในใฟใ\n\t\tScanner sc = new Scanner(System.in);\n\t\tint n = sc.nextInt();\n\t\tint m = sc.nextInt();\n\t\tint []a = new int[m];\n\t\tfor (int i = 0; i < m; i++) {\n\t\t\ta[i] = sc.nextInt();\n\t\t}\n\t\tint sum = 0;\n\t\tfor (int val:a) {\n\t\t\tsum += val;\n\t\t}\n\t\tif (n-sum < 0) {\n\t\t\tSystem.out.println(\"-1\");\n\t\t} else {\n\t\t\tSystem.out.println(n-sum);\n\t\t}\n\t\tsc.close();\n\n\t}\n\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n\n\tpublic static void main(String[] args) {\n\t\t// TODO ่ชๅ็ๆใใใใกใฝใใใปในใฟใ\n\t\tScanner sc = new Scanner(System.in);\n\t\tint n = sc.nextInt();\n\t\tint m = sc.nextInt();\n\t\tint []a = new int[m];\n\t\tfor (int i = 0; i < m; i++) {\n\t\t\ta[i] = sc.nextInt();\n\t\t}\n\t\tint sum = 0;\n\t\tfor (int val:a) {\n\t\t\tsum += val;\n\t\t}\n\t\tif (n-sum < 0) {\n\t\t\tSystem.out.println(\"-1\");\n\t\t} else {\n\t\t\tSystem.out.println(n-sum);\n\t\t}\n\t\tsc.close();\n\n\t}\n\n}",
"Main",
"public static void main(String[] args) {\n\t\t// TODO ่ชๅ็ๆใใใใกใฝใใใปในใฟใ\n\t\tScanner sc = new Scanner(System.in);\n\t\tint n = sc.nextInt();\n\t\tint m = sc.nextInt();\n\t\tint []a = new int[m];\n\t\tfor (int i = 0; i < m; i++) {\n\t\t\ta[i] = sc.nextInt();\n\t\t}\n\t\tint sum = 0;\n\t\tfor (int val:a) {\n\t\t\tsum += val;\n\t\t}\n\t\tif (n-sum < 0) {\n\t\t\tSystem.out.println(\"-1\");\n\t\t} else {\n\t\t\tSystem.out.println(n-sum);\n\t\t}\n\t\tsc.close();\n\n\t}",
"main",
"{\n\t\t// TODO ่ชๅ็ๆใใใใกใฝใใใปในใฟใ\n\t\tScanner sc = new Scanner(System.in);\n\t\tint n = sc.nextInt();\n\t\tint m = sc.nextInt();\n\t\tint []a = new int[m];\n\t\tfor (int i = 0; i < m; i++) {\n\t\t\ta[i] = sc.nextInt();\n\t\t}\n\t\tint sum = 0;\n\t\tfor (int val:a) {\n\t\t\tsum += val;\n\t\t}\n\t\tif (n-sum < 0) {\n\t\t\tSystem.out.println(\"-1\");\n\t\t} else {\n\t\t\tSystem.out.println(n-sum);\n\t\t}\n\t\tsc.close();\n\n\t}",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"int n = sc.nextInt();",
"n",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int m = sc.nextInt();",
"m",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int []a = new int[m];",
"a",
"new int[m]",
"m",
"for (int i = 0; i < m; i++) {\n\t\t\ta[i] = sc.nextInt();\n\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < m",
"i",
"m",
"i++",
"i++",
"i",
"{\n\t\t\ta[i] = sc.nextInt();\n\t\t}",
"{\n\t\t\ta[i] = sc.nextInt();\n\t\t}",
"a[i] = sc.nextInt()",
"a[i]",
"a",
"i",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int sum = 0;",
"sum",
"0",
"for (int val:a) {\n\t\t\tsum += val;\n\t\t}",
"int val",
"a",
"{\n\t\t\tsum += val;\n\t\t}",
"{\n\t\t\tsum += val;\n\t\t}",
"sum += val",
"sum",
"val",
"if (n-sum < 0) {\n\t\t\tSystem.out.println(\"-1\");\n\t\t} else {\n\t\t\tSystem.out.println(n-sum);\n\t\t}",
"n-sum < 0",
"n-sum",
"n",
"sum",
"0",
"{\n\t\t\tSystem.out.println(\"-1\");\n\t\t}",
"System.out.println(\"-1\")",
"System.out.println",
"System.out",
"System",
"System.out",
"\"-1\"",
"{\n\t\t\tSystem.out.println(n-sum);\n\t\t}",
"System.out.println(n-sum)",
"System.out.println",
"System.out",
"System",
"System.out",
"n-sum",
"n",
"sum",
"sc.close()",
"sc.close",
"sc",
"String[] args",
"args",
"public class Main {\n\n\tpublic static void main(String[] args) {\n\t\t// TODO ่ชๅ็ๆใใใใกใฝใใใปในใฟใ\n\t\tScanner sc = new Scanner(System.in);\n\t\tint n = sc.nextInt();\n\t\tint m = sc.nextInt();\n\t\tint []a = new int[m];\n\t\tfor (int i = 0; i < m; i++) {\n\t\t\ta[i] = sc.nextInt();\n\t\t}\n\t\tint sum = 0;\n\t\tfor (int val:a) {\n\t\t\tsum += val;\n\t\t}\n\t\tif (n-sum < 0) {\n\t\t\tSystem.out.println(\"-1\");\n\t\t} else {\n\t\t\tSystem.out.println(n-sum);\n\t\t}\n\t\tsc.close();\n\n\t}\n\n}",
"public class Main {\n\n\tpublic static void main(String[] args) {\n\t\t// TODO ่ชๅ็ๆใใใใกใฝใใใปในใฟใ\n\t\tScanner sc = new Scanner(System.in);\n\t\tint n = sc.nextInt();\n\t\tint m = sc.nextInt();\n\t\tint []a = new int[m];\n\t\tfor (int i = 0; i < m; i++) {\n\t\t\ta[i] = sc.nextInt();\n\t\t}\n\t\tint sum = 0;\n\t\tfor (int val:a) {\n\t\t\tsum += val;\n\t\t}\n\t\tif (n-sum < 0) {\n\t\t\tSystem.out.println(\"-1\");\n\t\t} else {\n\t\t\tSystem.out.println(n-sum);\n\t\t}\n\t\tsc.close();\n\n\t}\n\n}",
"Main"
] |
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
// TODO ่ชๅ็ๆใใใใกใฝใใใปในใฟใ
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
int m = sc.nextInt();
int []a = new int[m];
for (int i = 0; i < m; i++) {
a[i] = sc.nextInt();
}
int sum = 0;
for (int val:a) {
sum += val;
}
if (n-sum < 0) {
System.out.println("-1");
} else {
System.out.println(n-sum);
}
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,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
4,
18,
13,
41,
13,
4,
18,
13,
2,
13,
13,
40,
17,
4,
18,
18,
13,
13,
13,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
62,
5
],
[
62,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
8,
17
],
[
17,
18
],
[
17,
19
],
[
19,
20
],
[
20,
21
],
[
8,
22
],
[
22,
23
],
[
22,
24
],
[
8,
25
],
[
25,
26
],
[
26,
27
],
[
27,
28
],
[
27,
29
],
[
25,
30
],
[
30,
31
],
[
30,
32
],
[
25,
33
],
[
33,
34
],
[
34,
35
],
[
25,
36
],
[
37,
37
],
[
37,
38
],
[
38,
39
],
[
38,
40
],
[
40,
41
],
[
41,
42
],
[
8,
43
],
[
43,
44
],
[
43,
45
],
[
45,
46
],
[
46,
47
],
[
45,
48
],
[
48,
49
],
[
48,
50
],
[
45,
51
],
[
51,
52
],
[
8,
53
],
[
53,
54
],
[
54,
55
],
[
55,
56
],
[
55,
57
],
[
53,
58
],
[
6,
59
],
[
59,
60
],
[
0,
61
],
[
61,
62
],
[
61,
63
]
] |
[
"import java.util.Scanner;\n\npublic class Main {\n\n\tpublic static void main(String[] args) {\n\t\t// TODO ่ชๅ็ๆใใใใกใฝใใใปในใฟใ\n\t\tScanner sc = new Scanner(System.in);\n\t\tint n = sc.nextInt();\n\t\tint m = sc.nextInt();\n\t\tint working = 0;\n\t\tfor (int i = 0; i < m; ++i) {\n\t\t\tworking += sc.nextInt();\n\t\t}\n\n\t\tint vacation = Math.max(n - working, -1);\n\t\tSystem.out.println(vacation);\n\t}\n\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n\n\tpublic static void main(String[] args) {\n\t\t// TODO ่ชๅ็ๆใใใใกใฝใใใปในใฟใ\n\t\tScanner sc = new Scanner(System.in);\n\t\tint n = sc.nextInt();\n\t\tint m = sc.nextInt();\n\t\tint working = 0;\n\t\tfor (int i = 0; i < m; ++i) {\n\t\t\tworking += sc.nextInt();\n\t\t}\n\n\t\tint vacation = Math.max(n - working, -1);\n\t\tSystem.out.println(vacation);\n\t}\n\n}",
"Main",
"public static void main(String[] args) {\n\t\t// TODO ่ชๅ็ๆใใใใกใฝใใใปในใฟใ\n\t\tScanner sc = new Scanner(System.in);\n\t\tint n = sc.nextInt();\n\t\tint m = sc.nextInt();\n\t\tint working = 0;\n\t\tfor (int i = 0; i < m; ++i) {\n\t\t\tworking += sc.nextInt();\n\t\t}\n\n\t\tint vacation = Math.max(n - working, -1);\n\t\tSystem.out.println(vacation);\n\t}",
"main",
"{\n\t\t// TODO ่ชๅ็ๆใใใใกใฝใใใปในใฟใ\n\t\tScanner sc = new Scanner(System.in);\n\t\tint n = sc.nextInt();\n\t\tint m = sc.nextInt();\n\t\tint working = 0;\n\t\tfor (int i = 0; i < m; ++i) {\n\t\t\tworking += sc.nextInt();\n\t\t}\n\n\t\tint vacation = Math.max(n - working, -1);\n\t\tSystem.out.println(vacation);\n\t}",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"int n = sc.nextInt();",
"n",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int m = sc.nextInt();",
"m",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int working = 0;",
"working",
"0",
"for (int i = 0; i < m; ++i) {\n\t\t\tworking += sc.nextInt();\n\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < m",
"i",
"m",
"++i",
"++i",
"i",
"{\n\t\t\tworking += sc.nextInt();\n\t\t}",
"{\n\t\t\tworking += sc.nextInt();\n\t\t}",
"working += sc.nextInt()",
"working",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int vacation = Math.max(n - working, -1);",
"vacation",
"Math.max(n - working, -1)",
"Math.max",
"Math",
"n - working",
"n",
"working",
"-1",
"1",
"System.out.println(vacation)",
"System.out.println",
"System.out",
"System",
"System.out",
"vacation",
"String[] args",
"args",
"public class Main {\n\n\tpublic static void main(String[] args) {\n\t\t// TODO ่ชๅ็ๆใใใใกใฝใใใปในใฟใ\n\t\tScanner sc = new Scanner(System.in);\n\t\tint n = sc.nextInt();\n\t\tint m = sc.nextInt();\n\t\tint working = 0;\n\t\tfor (int i = 0; i < m; ++i) {\n\t\t\tworking += sc.nextInt();\n\t\t}\n\n\t\tint vacation = Math.max(n - working, -1);\n\t\tSystem.out.println(vacation);\n\t}\n\n}",
"public class Main {\n\n\tpublic static void main(String[] args) {\n\t\t// TODO ่ชๅ็ๆใใใใกใฝใใใปในใฟใ\n\t\tScanner sc = new Scanner(System.in);\n\t\tint n = sc.nextInt();\n\t\tint m = sc.nextInt();\n\t\tint working = 0;\n\t\tfor (int i = 0; i < m; ++i) {\n\t\t\tworking += sc.nextInt();\n\t\t}\n\n\t\tint vacation = Math.max(n - working, -1);\n\t\tSystem.out.println(vacation);\n\t}\n\n}",
"Main"
] |
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
// TODO ่ชๅ็ๆใใใใกใฝใใใปในใฟใ
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
int m = sc.nextInt();
int working = 0;
for (int i = 0; i < m; ++i) {
working += sc.nextInt();
}
int vacation = Math.max(n - working, -1);
System.out.println(vacation);
}
}
|
[
7,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
41,
13,
20,
13,
11,
1,
41,
13,
17,
2,
13,
18,
13,
13,
1,
40,
13,
30,
30,
0,
18,
13,
13,
4,
18,
13,
4,
18,
18,
13,
13,
4,
13,
13,
13,
4,
18,
13,
23,
13,
12,
13,
30,
41,
13,
4,
18,
4,
18,
13,
13,
29,
8,
2,
13,
13,
2,
13,
13,
40,
17,
23,
13,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
91,
8
],
[
91,
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,
29
],
[
29,
30
],
[
30,
31
],
[
31,
32
],
[
31,
33
],
[
29,
34
],
[
34,
35
],
[
34,
36
],
[
36,
37
],
[
36,
38
],
[
29,
39
],
[
39,
40
],
[
40,
41
],
[
29,
42
],
[
43,
43
],
[
43,
44
],
[
44,
45
],
[
45,
46
],
[
45,
47
],
[
44,
48
],
[
48,
49
],
[
49,
50
],
[
11,
51
],
[
51,
52
],
[
52,
53
],
[
53,
54
],
[
53,
55
],
[
51,
56
],
[
56,
57
],
[
56,
58
],
[
56,
59
],
[
11,
60
],
[
60,
61
],
[
61,
62
],
[
9,
63
],
[
63,
64
],
[
91,
65
],
[
65,
66
],
[
65,
67
],
[
67,
68
],
[
68,
69
],
[
68,
70
],
[
70,
71
],
[
71,
72
],
[
72,
73
],
[
73,
74
],
[
72,
75
],
[
67,
76
],
[
76,
77
],
[
77,
78
],
[
78,
79
],
[
78,
80
],
[
77,
81
],
[
81,
82
],
[
81,
83
],
[
77,
84
],
[
84,
85
],
[
65,
86
],
[
86,
87
],
[
65,
88
],
[
88,
89
],
[
0,
90
],
[
90,
91
],
[
90,
92
]
] |
[
"import java.util.Arrays;\nimport java.util.Scanner;\n\npublic class Main {\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n\n int N = sc.nextInt();\n int M = sc.nextInt();\n int[] A = new int[M];\n for (int i = 0; i < A.length; ++i) {\n A[i] = sc.nextInt();\n }\n\n System.out.println(solve(N, A));\n\n sc.close();\n }\n\n static int solve(int N, int[] A) {\n int total = Arrays.stream(A).sum();\n\n return (total <= N) ? (N - total) : -1;\n }\n}",
"import java.util.Arrays;",
"Arrays",
"java.util",
"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 N = sc.nextInt();\n int M = sc.nextInt();\n int[] A = new int[M];\n for (int i = 0; i < A.length; ++i) {\n A[i] = sc.nextInt();\n }\n\n System.out.println(solve(N, A));\n\n sc.close();\n }\n\n static int solve(int N, int[] A) {\n int total = Arrays.stream(A).sum();\n\n return (total <= N) ? (N - total) : -1;\n }\n}",
"Main",
"public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n\n int N = sc.nextInt();\n int M = sc.nextInt();\n int[] A = new int[M];\n for (int i = 0; i < A.length; ++i) {\n A[i] = sc.nextInt();\n }\n\n System.out.println(solve(N, A));\n\n sc.close();\n }",
"main",
"{\n Scanner sc = new Scanner(System.in);\n\n int N = sc.nextInt();\n int M = sc.nextInt();\n int[] A = new int[M];\n for (int i = 0; i < A.length; ++i) {\n A[i] = sc.nextInt();\n }\n\n System.out.println(solve(N, A));\n\n sc.close();\n }",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"int N = sc.nextInt();",
"N",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int M = sc.nextInt();",
"M",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int[] A = new int[M];",
"A",
"new int[M]",
"M",
"for (int i = 0; i < A.length; ++i) {\n A[i] = sc.nextInt();\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < A.length",
"i",
"A.length",
"A",
"A.length",
"++i",
"++i",
"i",
"{\n A[i] = sc.nextInt();\n }",
"{\n A[i] = sc.nextInt();\n }",
"A[i] = sc.nextInt()",
"A[i]",
"A",
"i",
"sc.nextInt()",
"sc.nextInt",
"sc",
"System.out.println(solve(N, A))",
"System.out.println",
"System.out",
"System",
"System.out",
"solve(N, A)",
"solve",
"N",
"A",
"sc.close()",
"sc.close",
"sc",
"String[] args",
"args",
"static int solve(int N, int[] A) {\n int total = Arrays.stream(A).sum();\n\n return (total <= N) ? (N - total) : -1;\n }",
"solve",
"{\n int total = Arrays.stream(A).sum();\n\n return (total <= N) ? (N - total) : -1;\n }",
"int total = Arrays.stream(A).sum();",
"total",
"Arrays.stream(A).sum()",
"Arrays.stream(A).sum",
"Arrays.stream(A)",
"Arrays.stream",
"Arrays",
"A",
"return (total <= N) ? (N - total) : -1;",
"(total <= N) ? (N - total) : -1",
"(total <= N)",
"total",
"N",
"(N - total)",
"N",
"total",
"-1",
"1",
"int N",
"N",
"int[] A",
"A",
"public class Main {\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n\n int N = sc.nextInt();\n int M = sc.nextInt();\n int[] A = new int[M];\n for (int i = 0; i < A.length; ++i) {\n A[i] = sc.nextInt();\n }\n\n System.out.println(solve(N, A));\n\n sc.close();\n }\n\n static int solve(int N, int[] A) {\n int total = Arrays.stream(A).sum();\n\n return (total <= N) ? (N - total) : -1;\n }\n}",
"public class Main {\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n\n int N = sc.nextInt();\n int M = sc.nextInt();\n int[] A = new int[M];\n for (int i = 0; i < A.length; ++i) {\n A[i] = sc.nextInt();\n }\n\n System.out.println(solve(N, A));\n\n sc.close();\n }\n\n static int solve(int N, int[] A) {\n int total = Arrays.stream(A).sum();\n\n return (total <= N) ? (N - total) : -1;\n }\n}",
"Main"
] |
import java.util.Arrays;
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int N = sc.nextInt();
int M = sc.nextInt();
int[] A = new int[M];
for (int i = 0; i < A.length; ++i) {
A[i] = sc.nextInt();
}
System.out.println(solve(N, A));
sc.close();
}
static int solve(int N, int[] A) {
int total = Arrays.stream(A).sum();
return (total <= N) ? (N - total) : -1;
}
}
|
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
41,
13,
20,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
18,
13,
13,
4,
18,
13,
11,
1,
41,
13,
17,
2,
13,
18,
13,
13,
1,
40,
13,
30,
30,
0,
13,
18,
13,
13,
14,
2,
13,
17,
30,
4,
18,
18,
13,
13,
13,
30,
4,
18,
18,
13,
13,
40,
17,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
88,
5
],
[
88,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
8,
17
],
[
17,
18
],
[
17,
19
],
[
19,
20
],
[
20,
21
],
[
8,
22
],
[
22,
23
],
[
22,
24
],
[
8,
26
],
[
26,
27
],
[
27,
28
],
[
28,
29
],
[
28,
30
],
[
26,
31
],
[
31,
32
],
[
31,
33
],
[
26,
34
],
[
34,
35
],
[
35,
36
],
[
26,
37
],
[
38,
38
],
[
38,
39
],
[
39,
40
],
[
40,
41
],
[
40,
42
],
[
39,
43
],
[
43,
44
],
[
44,
45
],
[
8,
46
],
[
46,
47
],
[
47,
48
],
[
48,
49
],
[
48,
50
],
[
46,
51
],
[
51,
52
],
[
51,
53
],
[
53,
54
],
[
53,
55
],
[
46,
56
],
[
56,
57
],
[
57,
58
],
[
46,
59
],
[
60,
60
],
[
60,
61
],
[
61,
62
],
[
61,
63
],
[
63,
64
],
[
63,
65
],
[
8,
66
],
[
66,
67
],
[
67,
68
],
[
67,
69
],
[
66,
70
],
[
70,
71
],
[
71,
72
],
[
72,
73
],
[
73,
74
],
[
73,
75
],
[
71,
76
],
[
66,
77
],
[
77,
78
],
[
78,
79
],
[
79,
80
],
[
80,
81
],
[
80,
82
],
[
78,
83
],
[
83,
84
],
[
6,
85
],
[
85,
86
],
[
0,
87
],
[
87,
88
],
[
87,
89
]
] |
[
"import java.util.*;\n public class Main {\n\tpublic static void main(String[] args){\n Scanner sc = new Scanner(System.in);\n\n int N = sc.nextInt();\n int M = sc.nextInt();\n int[] a = new int[M];\n \n\n for(int i = 0;i < M;i++){\n a[i] = sc.nextInt();\n }\n\n for(int i = 0;i < a.length;i++){\n N -= a[i];\n }\n if(N >= 0){\n System.out.println(N);\n }else{\n System.out.println(-1);\n }\n \n \n }\n }",
"import java.util.*;",
"util.*",
"java",
"public class Main {\n\tpublic static void main(String[] args){\n Scanner sc = new Scanner(System.in);\n\n int N = sc.nextInt();\n int M = sc.nextInt();\n int[] a = new int[M];\n \n\n for(int i = 0;i < M;i++){\n a[i] = sc.nextInt();\n }\n\n for(int i = 0;i < a.length;i++){\n N -= a[i];\n }\n if(N >= 0){\n System.out.println(N);\n }else{\n System.out.println(-1);\n }\n \n \n }\n }",
"Main",
"public static void main(String[] args){\n Scanner sc = new Scanner(System.in);\n\n int N = sc.nextInt();\n int M = sc.nextInt();\n int[] a = new int[M];\n \n\n for(int i = 0;i < M;i++){\n a[i] = sc.nextInt();\n }\n\n for(int i = 0;i < a.length;i++){\n N -= a[i];\n }\n if(N >= 0){\n System.out.println(N);\n }else{\n System.out.println(-1);\n }\n \n \n }",
"main",
"{\n Scanner sc = new Scanner(System.in);\n\n int N = sc.nextInt();\n int M = sc.nextInt();\n int[] a = new int[M];\n \n\n for(int i = 0;i < M;i++){\n a[i] = sc.nextInt();\n }\n\n for(int i = 0;i < a.length;i++){\n N -= a[i];\n }\n if(N >= 0){\n System.out.println(N);\n }else{\n System.out.println(-1);\n }\n \n \n }",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"int N = sc.nextInt();",
"N",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int M = sc.nextInt();",
"M",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int[] a = new int[M];",
"a",
"new int[M]",
"M",
"for(int i = 0;i < M;i++){\n a[i] = sc.nextInt();\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < M",
"i",
"M",
"i++",
"i++",
"i",
"{\n a[i] = sc.nextInt();\n }",
"{\n a[i] = sc.nextInt();\n }",
"a[i] = sc.nextInt()",
"a[i]",
"a",
"i",
"sc.nextInt()",
"sc.nextInt",
"sc",
"for(int i = 0;i < a.length;i++){\n N -= a[i];\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < a.length",
"i",
"a.length",
"a",
"a.length",
"i++",
"i++",
"i",
"{\n N -= a[i];\n }",
"{\n N -= a[i];\n }",
"N -= a[i]",
"N",
"a[i]",
"a",
"i",
"if(N >= 0){\n System.out.println(N);\n }else{\n System.out.println(-1);\n }",
"N >= 0",
"N",
"0",
"{\n System.out.println(N);\n }",
"System.out.println(N)",
"System.out.println",
"System.out",
"System",
"System.out",
"N",
"{\n System.out.println(-1);\n }",
"System.out.println(-1)",
"System.out.println",
"System.out",
"System",
"System.out",
"-1",
"1",
"String[] args",
"args",
"public class Main {\n\tpublic static void main(String[] args){\n Scanner sc = new Scanner(System.in);\n\n int N = sc.nextInt();\n int M = sc.nextInt();\n int[] a = new int[M];\n \n\n for(int i = 0;i < M;i++){\n a[i] = sc.nextInt();\n }\n\n for(int i = 0;i < a.length;i++){\n N -= a[i];\n }\n if(N >= 0){\n System.out.println(N);\n }else{\n System.out.println(-1);\n }\n \n \n }\n }",
"public class Main {\n\tpublic static void main(String[] args){\n Scanner sc = new Scanner(System.in);\n\n int N = sc.nextInt();\n int M = sc.nextInt();\n int[] a = new int[M];\n \n\n for(int i = 0;i < M;i++){\n a[i] = sc.nextInt();\n }\n\n for(int i = 0;i < a.length;i++){\n N -= a[i];\n }\n if(N >= 0){\n System.out.println(N);\n }else{\n System.out.println(-1);\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 N = sc.nextInt();
int M = sc.nextInt();
int[] a = new int[M];
for(int i = 0;i < M;i++){
a[i] = sc.nextInt();
}
for(int i = 0;i < a.length;i++){
N -= a[i];
}
if(N >= 0){
System.out.println(N);
}else{
System.out.println(-1);
}
}
}
|
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
18,
13,
13,
41,
13,
18,
13,
13,
41,
13,
20,
41,
13,
20,
41,
13,
20,
4,
18,
13,
17,
13,
13,
4,
18,
13,
23,
13,
6,
13,
12,
13,
30,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
4,
18,
13,
4,
18,
13,
8,
2,
13,
13,
40,
17,
2,
13,
13,
23,
13,
23,
13,
23,
13,
6,
13,
41,
13,
41,
13,
20,
17,
41,
13,
41,
13,
41,
13,
12,
13,
30,
0,
18,
36,
13,
13,
23,
13,
12,
13,
30,
14,
2,
13,
40,
17,
37,
20,
14,
2,
13,
13,
30,
0,
13,
17,
38,
5,
13,
30,
37,
20,
30,
0,
13,
4,
18,
13,
13,
14,
2,
13,
17,
29,
40,
17,
29,
18,
13,
40,
13,
12,
13,
30,
41,
13,
4,
13,
42,
4,
13,
13,
0,
13,
4,
13,
41,
13,
17,
14,
2,
13,
17,
30,
0,
13,
40,
17,
0,
13,
4,
13,
41,
13,
17,
42,
40,
4,
13,
13,
30,
14,
2,
2,
13,
17,
2,
13,
17,
37,
20,
0,
13,
17,
0,
13,
2,
13,
17,
0,
13,
4,
13,
29,
2,
13,
13,
12,
13,
30,
14,
2,
13,
17,
29,
4,
18,
13,
13,
29,
2,
2,
2,
2,
2,
13,
17,
2,
13,
17,
2,
13,
17,
2,
13,
17,
2,
13,
40,
17,
23,
13,
6,
13,
12,
13,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
10,
11
],
[
10,
12
],
[
0,
13
],
[
13,
14
],
[
13,
15
],
[
0,
16
],
[
16,
17
],
[
16,
18
],
[
0,
19
],
[
19,
20
],
[
19,
21
],
[
0,
22
],
[
286,
23
],
[
286,
24
],
[
24,
25
],
[
24,
26
],
[
26,
27
],
[
27,
28
],
[
27,
29
],
[
29,
30
],
[
29,
31
],
[
26,
32
],
[
32,
33
],
[
32,
34
],
[
34,
35
],
[
34,
36
],
[
26,
37
],
[
37,
38
],
[
37,
39
],
[
26,
40
],
[
40,
41
],
[
40,
42
],
[
26,
43
],
[
43,
44
],
[
43,
45
],
[
26,
46
],
[
46,
47
],
[
47,
48
],
[
46,
49
],
[
46,
50
],
[
46,
51
],
[
26,
52
],
[
52,
53
],
[
53,
54
],
[
24,
55
],
[
55,
56
],
[
286,
57
],
[
57,
58
],
[
57,
59
],
[
59,
60
],
[
59,
61
],
[
61,
62
],
[
62,
63
],
[
62,
64
],
[
64,
65
],
[
65,
66
],
[
61,
67
],
[
67,
68
],
[
67,
69
],
[
69,
70
],
[
70,
71
],
[
61,
72
],
[
72,
73
],
[
72,
74
],
[
61,
75
],
[
75,
76
],
[
76,
77
],
[
77,
78
],
[
77,
79
],
[
75,
80
],
[
80,
81
],
[
80,
82
],
[
75,
83
],
[
83,
84
],
[
84,
85
],
[
75,
86
],
[
87,
87
],
[
87,
88
],
[
88,
89
],
[
88,
90
],
[
90,
91
],
[
91,
92
],
[
61,
93
],
[
93,
94
],
[
94,
95
],
[
93,
96
],
[
96,
97
],
[
97,
98
],
[
97,
99
],
[
96,
100
],
[
100,
101
],
[
96,
102
],
[
102,
103
],
[
102,
104
],
[
59,
105
],
[
105,
106
],
[
59,
107
],
[
107,
108
],
[
59,
109
],
[
109,
110
],
[
286,
111
],
[
111,
112
],
[
111,
113
],
[
113,
114
],
[
111,
115
],
[
115,
116
],
[
115,
117
],
[
111,
119
],
[
119,
120
],
[
111,
121
],
[
121,
122
],
[
111,
123
],
[
123,
124
],
[
111,
125
],
[
125,
126
],
[
125,
127
],
[
127,
128
],
[
128,
129
],
[
129,
130
],
[
129,
131
],
[
128,
132
],
[
125,
133
],
[
133,
134
],
[
111,
135
],
[
135,
136
],
[
135,
137
],
[
137,
138
],
[
138,
139
],
[
139,
140
],
[
139,
141
],
[
141,
142
],
[
138,
143
],
[
143,
144
],
[
137,
145
],
[
145,
146
],
[
146,
147
],
[
146,
148
],
[
145,
149
],
[
149,
150
],
[
150,
151
],
[
150,
152
],
[
149,
153
],
[
153,
154
],
[
154,
155
],
[
154,
156
],
[
156,
157
],
[
157,
158
],
[
153,
159
],
[
159,
160
],
[
160,
161
],
[
160,
162
],
[
162,
163
],
[
163,
164
],
[
162,
165
],
[
149,
166
],
[
166,
167
],
[
167,
168
],
[
167,
169
],
[
166,
170
],
[
170,
171
],
[
171,
172
],
[
137,
173
],
[
173,
174
],
[
174,
175
],
[
174,
176
],
[
176,
177
],
[
111,
178
],
[
178,
179
],
[
178,
180
],
[
180,
181
],
[
181,
182
],
[
181,
183
],
[
183,
184
],
[
180,
185
],
[
185,
186
],
[
186,
187
],
[
186,
188
],
[
185,
189
],
[
189,
190
],
[
189,
191
],
[
191,
192
],
[
180,
193
],
[
193,
194
],
[
193,
195
],
[
180,
196
],
[
196,
197
],
[
197,
198
],
[
197,
199
],
[
196,
200
],
[
200,
201
],
[
201,
202
],
[
201,
203
],
[
203,
204
],
[
200,
205
],
[
205,
206
],
[
205,
207
],
[
207,
208
],
[
180,
209
],
[
209,
210
],
[
209,
211
],
[
180,
212
],
[
212,
213
],
[
213,
214
],
[
214,
215
],
[
214,
216
],
[
212,
217
],
[
217,
218
],
[
218,
219
],
[
219,
220
],
[
220,
221
],
[
220,
222
],
[
219,
223
],
[
223,
224
],
[
223,
225
],
[
218,
226
],
[
226,
227
],
[
217,
228
],
[
228,
229
],
[
228,
230
],
[
217,
231
],
[
231,
232
],
[
231,
233
],
[
233,
234
],
[
233,
235
],
[
217,
236
],
[
236,
237
],
[
236,
238
],
[
238,
239
],
[
180,
240
],
[
240,
241
],
[
241,
242
],
[
241,
243
],
[
111,
244
],
[
244,
245
],
[
244,
246
],
[
246,
247
],
[
247,
248
],
[
248,
249
],
[
248,
250
],
[
247,
251
],
[
251,
252
],
[
252,
253
],
[
253,
254
],
[
252,
255
],
[
246,
256
],
[
256,
257
],
[
260,
258
],
[
270,
259
],
[
267,
260
],
[
260,
261
],
[
261,
262
],
[
261,
263
],
[
260,
264
],
[
264,
265
],
[
264,
266
],
[
267,
267
],
[
267,
268
],
[
267,
269
],
[
270,
270
],
[
270,
271
],
[
270,
272
],
[
260,
273
],
[
273,
274
],
[
273,
275
],
[
275,
276
],
[
244,
277
],
[
277,
278
],
[
111,
279
],
[
279,
280
],
[
279,
281
],
[
281,
282
],
[
281,
283
],
[
283,
284
],
[
0,
285
],
[
285,
286
],
[
285,
287
]
] |
[
"import java.io.OutputStream;\nimport java.io.IOException;\nimport java.io.InputStream;\nimport java.io.PrintWriter;\nimport java.util.InputMismatchException;\nimport java.io.IOException;\nimport java.io.InputStream;\n\n/**\n * Built using CHelper plug-in\n * Actual solution is at the top\n *\n * @author Pranay2516\n */\npublic class Main {\n public static void main(String[] args) {\n InputStream inputStream = System.in;\n OutputStream outputStream = System.out;\n FastReader in = new FastReader(inputStream);\n PrintWriter out = new PrintWriter(outputStream);\n Task solver = new Task();\n solver.solve(1, in, out);\n out.close();\n }\n\n static class Task {\n public void solve(int testNumber, FastReader in, PrintWriter out) {\n int n = in.nextInt(), m = in.nextInt();\n int sum = 0;\n for (int i = 0; i < m; ++i) {\n sum += in.nextInt();\n }\n out.println(sum > n ? -1 : n - sum);\n }\n\n }\n\n static class FastReader {\n private InputStream stream;\n private byte[] buf = new byte[1024];\n private int curChar;\n private int numChars;\n private FastReader.SpaceCharFilter filter;\n\n public FastReader(InputStream stream) {\n this.stream = stream;\n }\n\n public int read() {\n\n if (numChars == -1)\n throw new InputMismatchException();\n\n if (curChar >= numChars) {\n\n curChar = 0;\n\n try {\n numChars = stream.read(buf);\n } catch (IOException e) {\n throw new InputMismatchException();\n }\n\n if (numChars <= 0)\n return -1;\n }\n\n return buf[curChar++];\n }\n\n public int nextInt() {\n\n int c = read();\n\n while (isSpaceChar(c))\n c = read();\n\n int sgn = 1;\n\n if (c == '-') {\n sgn = -1;\n c = read();\n }\n\n int res = 0;\n\n do {\n if (c < '0' || c > '9')\n throw new InputMismatchException();\n\n res *= 10;\n res += c - '0';\n c = read();\n }\n while (!isSpaceChar(c));\n\n return res * sgn;\n }\n\n public boolean isSpaceChar(int c) {\n\n if (filter != null)\n return filter.isSpaceChar(c);\n\n return c == ' ' || c == '\\n' || c == '\\r' || c == '\\t' || c == -1;\n }\n\n public interface SpaceCharFilter {\n public boolean isSpaceChar(int ch);\n\n }\n\n }\n}\n",
"import java.io.OutputStream;",
"OutputStream",
"java.io",
"import java.io.IOException;",
"IOException",
"java.io",
"import java.io.InputStream;",
"InputStream",
"java.io",
"import java.io.PrintWriter;",
"PrintWriter",
"java.io",
"import java.util.InputMismatchException;",
"InputMismatchException",
"java.util",
"import java.io.IOException;",
"IOException",
"java.io",
"import java.io.InputStream;",
"InputStream",
"java.io",
"public class Main {\n public static void main(String[] args) {\n InputStream inputStream = System.in;\n OutputStream outputStream = System.out;\n FastReader in = new FastReader(inputStream);\n PrintWriter out = new PrintWriter(outputStream);\n Task solver = new Task();\n solver.solve(1, in, out);\n out.close();\n }\n\n static class Task {\n public void solve(int testNumber, FastReader in, PrintWriter out) {\n int n = in.nextInt(), m = in.nextInt();\n int sum = 0;\n for (int i = 0; i < m; ++i) {\n sum += in.nextInt();\n }\n out.println(sum > n ? -1 : n - sum);\n }\n\n }\n\n static class FastReader {\n private InputStream stream;\n private byte[] buf = new byte[1024];\n private int curChar;\n private int numChars;\n private FastReader.SpaceCharFilter filter;\n\n public FastReader(InputStream stream) {\n this.stream = stream;\n }\n\n public int read() {\n\n if (numChars == -1)\n throw new InputMismatchException();\n\n if (curChar >= numChars) {\n\n curChar = 0;\n\n try {\n numChars = stream.read(buf);\n } catch (IOException e) {\n throw new InputMismatchException();\n }\n\n if (numChars <= 0)\n return -1;\n }\n\n return buf[curChar++];\n }\n\n public int nextInt() {\n\n int c = read();\n\n while (isSpaceChar(c))\n c = read();\n\n int sgn = 1;\n\n if (c == '-') {\n sgn = -1;\n c = read();\n }\n\n int res = 0;\n\n do {\n if (c < '0' || c > '9')\n throw new InputMismatchException();\n\n res *= 10;\n res += c - '0';\n c = read();\n }\n while (!isSpaceChar(c));\n\n return res * sgn;\n }\n\n public boolean isSpaceChar(int c) {\n\n if (filter != null)\n return filter.isSpaceChar(c);\n\n return c == ' ' || c == '\\n' || c == '\\r' || c == '\\t' || c == -1;\n }\n\n public interface SpaceCharFilter {\n public boolean isSpaceChar(int ch);\n\n }\n\n }\n}",
"Main",
"public static void main(String[] args) {\n InputStream inputStream = System.in;\n OutputStream outputStream = System.out;\n FastReader in = new FastReader(inputStream);\n PrintWriter out = new PrintWriter(outputStream);\n Task solver = new Task();\n solver.solve(1, in, out);\n out.close();\n }",
"main",
"{\n InputStream inputStream = System.in;\n OutputStream outputStream = System.out;\n FastReader in = new FastReader(inputStream);\n PrintWriter out = new PrintWriter(outputStream);\n Task solver = new Task();\n solver.solve(1, in, out);\n out.close();\n }",
"InputStream inputStream = System.in;",
"inputStream",
"System.in",
"System",
"System.in",
"OutputStream outputStream = System.out;",
"outputStream",
"System.out",
"System",
"System.out",
"FastReader in = new FastReader(inputStream);",
"in",
"new FastReader(inputStream)",
"PrintWriter out = new PrintWriter(outputStream);",
"out",
"new PrintWriter(outputStream)",
"Task solver = new Task();",
"solver",
"new Task()",
"solver.solve(1, in, out)",
"solver.solve",
"solver",
"1",
"in",
"out",
"out.close()",
"out.close",
"out",
"String[] args",
"args",
"static class Task {\n public void solve(int testNumber, FastReader in, PrintWriter out) {\n int n = in.nextInt(), m = in.nextInt();\n int sum = 0;\n for (int i = 0; i < m; ++i) {\n sum += in.nextInt();\n }\n out.println(sum > n ? -1 : n - sum);\n }\n\n }",
"Task",
"public void solve(int testNumber, FastReader in, PrintWriter out) {\n int n = in.nextInt(), m = in.nextInt();\n int sum = 0;\n for (int i = 0; i < m; ++i) {\n sum += in.nextInt();\n }\n out.println(sum > n ? -1 : n - sum);\n }",
"solve",
"{\n int n = in.nextInt(), m = in.nextInt();\n int sum = 0;\n for (int i = 0; i < m; ++i) {\n sum += in.nextInt();\n }\n out.println(sum > n ? -1 : n - sum);\n }",
"int n = in.nextInt()",
"n",
"in.nextInt()",
"in.nextInt",
"in",
"m = in.nextInt();",
"m",
"in.nextInt()",
"in.nextInt",
"in",
"int sum = 0;",
"sum",
"0",
"for (int i = 0; i < m; ++i) {\n sum += in.nextInt();\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < m",
"i",
"m",
"++i",
"++i",
"i",
"{\n sum += in.nextInt();\n }",
"{\n sum += in.nextInt();\n }",
"sum += in.nextInt()",
"sum",
"in.nextInt()",
"in.nextInt",
"in",
"out.println(sum > n ? -1 : n - sum)",
"out.println",
"out",
"sum > n ? -1 : n - sum",
"sum > n",
"sum",
"n",
"-1",
"1",
"n - sum",
"n",
"sum",
"int testNumber",
"testNumber",
"FastReader in",
"in",
"PrintWriter out",
"out",
"static class FastReader {\n private InputStream stream;\n private byte[] buf = new byte[1024];\n private int curChar;\n private int numChars;\n private FastReader.SpaceCharFilter filter;\n\n public FastReader(InputStream stream) {\n this.stream = stream;\n }\n\n public int read() {\n\n if (numChars == -1)\n throw new InputMismatchException();\n\n if (curChar >= numChars) {\n\n curChar = 0;\n\n try {\n numChars = stream.read(buf);\n } catch (IOException e) {\n throw new InputMismatchException();\n }\n\n if (numChars <= 0)\n return -1;\n }\n\n return buf[curChar++];\n }\n\n public int nextInt() {\n\n int c = read();\n\n while (isSpaceChar(c))\n c = read();\n\n int sgn = 1;\n\n if (c == '-') {\n sgn = -1;\n c = read();\n }\n\n int res = 0;\n\n do {\n if (c < '0' || c > '9')\n throw new InputMismatchException();\n\n res *= 10;\n res += c - '0';\n c = read();\n }\n while (!isSpaceChar(c));\n\n return res * sgn;\n }\n\n public boolean isSpaceChar(int c) {\n\n if (filter != null)\n return filter.isSpaceChar(c);\n\n return c == ' ' || c == '\\n' || c == '\\r' || c == '\\t' || c == -1;\n }\n\n public interface SpaceCharFilter {\n public boolean isSpaceChar(int ch);\n\n }\n\n }",
"FastReader",
"private InputStream stream;",
"stream",
"private byte[] buf = new byte[1024];",
"buf",
"new byte[1024]",
"1024",
"private int curChar;",
"curChar",
"private int numChars;",
"numChars",
"private FastReader.SpaceCharFilter filter;",
"filter",
"public FastReader(InputStream stream) {\n this.stream = stream;\n }",
"FastReader",
"{\n this.stream = stream;\n }",
"this.stream = stream",
"this.stream",
"this",
"this.stream",
"stream",
"InputStream stream",
"stream",
"public int read() {\n\n if (numChars == -1)\n throw new InputMismatchException();\n\n if (curChar >= numChars) {\n\n curChar = 0;\n\n try {\n numChars = stream.read(buf);\n } catch (IOException e) {\n throw new InputMismatchException();\n }\n\n if (numChars <= 0)\n return -1;\n }\n\n return buf[curChar++];\n }",
"read",
"{\n\n if (numChars == -1)\n throw new InputMismatchException();\n\n if (curChar >= numChars) {\n\n curChar = 0;\n\n try {\n numChars = stream.read(buf);\n } catch (IOException e) {\n throw new InputMismatchException();\n }\n\n if (numChars <= 0)\n return -1;\n }\n\n return buf[curChar++];\n }",
"if (numChars == -1)\n throw new InputMismatchException();",
"numChars == -1",
"numChars",
"-1",
"1",
"throw new InputMismatchException();",
"new InputMismatchException()",
"if (curChar >= numChars) {\n\n curChar = 0;\n\n try {\n numChars = stream.read(buf);\n } catch (IOException e) {\n throw new InputMismatchException();\n }\n\n if (numChars <= 0)\n return -1;\n }",
"curChar >= numChars",
"curChar",
"numChars",
"{\n\n curChar = 0;\n\n try {\n numChars = stream.read(buf);\n } catch (IOException e) {\n throw new InputMismatchException();\n }\n\n if (numChars <= 0)\n return -1;\n }",
"curChar = 0",
"curChar",
"0",
"try {\n numChars = stream.read(buf);\n } catch (IOException e) {\n throw new InputMismatchException();\n }",
"catch (IOException e) {\n throw new InputMismatchException();\n }",
"IOException e",
"{\n throw new InputMismatchException();\n }",
"throw new InputMismatchException();",
"new InputMismatchException()",
"{\n numChars = stream.read(buf);\n }",
"numChars = stream.read(buf)",
"numChars",
"stream.read(buf)",
"stream.read",
"stream",
"buf",
"if (numChars <= 0)\n return -1;",
"numChars <= 0",
"numChars",
"0",
"return -1;",
"-1",
"1",
"return buf[curChar++];",
"buf[curChar++]",
"buf",
"curChar++",
"curChar",
"public int nextInt() {\n\n int c = read();\n\n while (isSpaceChar(c))\n c = read();\n\n int sgn = 1;\n\n if (c == '-') {\n sgn = -1;\n c = read();\n }\n\n int res = 0;\n\n do {\n if (c < '0' || c > '9')\n throw new InputMismatchException();\n\n res *= 10;\n res += c - '0';\n c = read();\n }\n while (!isSpaceChar(c));\n\n return res * sgn;\n }",
"nextInt",
"{\n\n int c = read();\n\n while (isSpaceChar(c))\n c = read();\n\n int sgn = 1;\n\n if (c == '-') {\n sgn = -1;\n c = read();\n }\n\n int res = 0;\n\n do {\n if (c < '0' || c > '9')\n throw new InputMismatchException();\n\n res *= 10;\n res += c - '0';\n c = read();\n }\n while (!isSpaceChar(c));\n\n return res * sgn;\n }",
"int c = read();",
"c",
"read()",
"read",
"while (isSpaceChar(c))\n c = read();",
"isSpaceChar(c)",
"isSpaceChar",
"c",
"c = read()",
"c",
"read()",
"read",
"int sgn = 1;",
"sgn",
"1",
"if (c == '-') {\n sgn = -1;\n c = read();\n }",
"c == '-'",
"c",
"'-'",
"{\n sgn = -1;\n c = read();\n }",
"sgn = -1",
"sgn",
"-1",
"1",
"c = read()",
"c",
"read()",
"read",
"int res = 0;",
"res",
"0",
"do {\n if (c < '0' || c > '9')\n throw new InputMismatchException();\n\n res *= 10;\n res += c - '0';\n c = read();\n }\n while (!isSpaceChar(c));",
"!isSpaceChar(c)",
"isSpaceChar(c)",
"isSpaceChar",
"c",
"{\n if (c < '0' || c > '9')\n throw new InputMismatchException();\n\n res *= 10;\n res += c - '0';\n c = read();\n }",
"if (c < '0' || c > '9')\n throw new InputMismatchException();",
"c < '0' || c > '9'",
"c < '0'",
"c",
"'0'",
"c > '9'",
"c",
"'9'",
"throw new InputMismatchException();",
"new InputMismatchException()",
"res *= 10",
"res",
"10",
"res += c - '0'",
"res",
"c - '0'",
"c",
"'0'",
"c = read()",
"c",
"read()",
"read",
"return res * sgn;",
"res * sgn",
"res",
"sgn",
"public boolean isSpaceChar(int c) {\n\n if (filter != null)\n return filter.isSpaceChar(c);\n\n return c == ' ' || c == '\\n' || c == '\\r' || c == '\\t' || c == -1;\n }",
"isSpaceChar",
"{\n\n if (filter != null)\n return filter.isSpaceChar(c);\n\n return c == ' ' || c == '\\n' || c == '\\r' || c == '\\t' || c == -1;\n }",
"if (filter != null)\n return filter.isSpaceChar(c);",
"filter != null",
"filter",
"null",
"return filter.isSpaceChar(c);",
"filter.isSpaceChar(c)",
"filter.isSpaceChar",
"filter",
"c",
"return c == ' ' || c == '\\n' || c == '\\r' || c == '\\t' || c == -1;",
"c == ' ' || c == '\\n' || c == '\\r' || c == '\\t' || c == -1",
"c == '\\t'",
"c == '\\r'",
"c == ' ' || c == '\\n' || c == '\\r' || c == '\\t' || c == -1",
"c == ' '",
"c",
"' '",
"c == '\\n'",
"c",
"'\\n'",
"c == '\\r'",
"c",
"'\\r'",
"c == '\\t'",
"c",
"'\\t'",
"c == -1",
"c",
"-1",
"1",
"int c",
"c",
"public interface SpaceCharFilter {\n public boolean isSpaceChar(int ch);\n\n }",
"SpaceCharFilter",
"public boolean isSpaceChar(int ch);",
"isSpaceChar",
"int ch",
"ch",
"public class Main {\n public static void main(String[] args) {\n InputStream inputStream = System.in;\n OutputStream outputStream = System.out;\n FastReader in = new FastReader(inputStream);\n PrintWriter out = new PrintWriter(outputStream);\n Task solver = new Task();\n solver.solve(1, in, out);\n out.close();\n }\n\n static class Task {\n public void solve(int testNumber, FastReader in, PrintWriter out) {\n int n = in.nextInt(), m = in.nextInt();\n int sum = 0;\n for (int i = 0; i < m; ++i) {\n sum += in.nextInt();\n }\n out.println(sum > n ? -1 : n - sum);\n }\n\n }\n\n static class FastReader {\n private InputStream stream;\n private byte[] buf = new byte[1024];\n private int curChar;\n private int numChars;\n private FastReader.SpaceCharFilter filter;\n\n public FastReader(InputStream stream) {\n this.stream = stream;\n }\n\n public int read() {\n\n if (numChars == -1)\n throw new InputMismatchException();\n\n if (curChar >= numChars) {\n\n curChar = 0;\n\n try {\n numChars = stream.read(buf);\n } catch (IOException e) {\n throw new InputMismatchException();\n }\n\n if (numChars <= 0)\n return -1;\n }\n\n return buf[curChar++];\n }\n\n public int nextInt() {\n\n int c = read();\n\n while (isSpaceChar(c))\n c = read();\n\n int sgn = 1;\n\n if (c == '-') {\n sgn = -1;\n c = read();\n }\n\n int res = 0;\n\n do {\n if (c < '0' || c > '9')\n throw new InputMismatchException();\n\n res *= 10;\n res += c - '0';\n c = read();\n }\n while (!isSpaceChar(c));\n\n return res * sgn;\n }\n\n public boolean isSpaceChar(int c) {\n\n if (filter != null)\n return filter.isSpaceChar(c);\n\n return c == ' ' || c == '\\n' || c == '\\r' || c == '\\t' || c == -1;\n }\n\n public interface SpaceCharFilter {\n public boolean isSpaceChar(int ch);\n\n }\n\n }\n}",
"public class Main {\n public static void main(String[] args) {\n InputStream inputStream = System.in;\n OutputStream outputStream = System.out;\n FastReader in = new FastReader(inputStream);\n PrintWriter out = new PrintWriter(outputStream);\n Task solver = new Task();\n solver.solve(1, in, out);\n out.close();\n }\n\n static class Task {\n public void solve(int testNumber, FastReader in, PrintWriter out) {\n int n = in.nextInt(), m = in.nextInt();\n int sum = 0;\n for (int i = 0; i < m; ++i) {\n sum += in.nextInt();\n }\n out.println(sum > n ? -1 : n - sum);\n }\n\n }\n\n static class FastReader {\n private InputStream stream;\n private byte[] buf = new byte[1024];\n private int curChar;\n private int numChars;\n private FastReader.SpaceCharFilter filter;\n\n public FastReader(InputStream stream) {\n this.stream = stream;\n }\n\n public int read() {\n\n if (numChars == -1)\n throw new InputMismatchException();\n\n if (curChar >= numChars) {\n\n curChar = 0;\n\n try {\n numChars = stream.read(buf);\n } catch (IOException e) {\n throw new InputMismatchException();\n }\n\n if (numChars <= 0)\n return -1;\n }\n\n return buf[curChar++];\n }\n\n public int nextInt() {\n\n int c = read();\n\n while (isSpaceChar(c))\n c = read();\n\n int sgn = 1;\n\n if (c == '-') {\n sgn = -1;\n c = read();\n }\n\n int res = 0;\n\n do {\n if (c < '0' || c > '9')\n throw new InputMismatchException();\n\n res *= 10;\n res += c - '0';\n c = read();\n }\n while (!isSpaceChar(c));\n\n return res * sgn;\n }\n\n public boolean isSpaceChar(int c) {\n\n if (filter != null)\n return filter.isSpaceChar(c);\n\n return c == ' ' || c == '\\n' || c == '\\r' || c == '\\t' || c == -1;\n }\n\n public interface SpaceCharFilter {\n public boolean isSpaceChar(int ch);\n\n }\n\n }\n}",
"Main"
] |
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.InputMismatchException;
import java.io.IOException;
import java.io.InputStream;
/**
* Built using CHelper plug-in
* Actual solution is at the top
*
* @author Pranay2516
*/
public class Main {
public static void main(String[] args) {
InputStream inputStream = System.in;
OutputStream outputStream = System.out;
FastReader in = new FastReader(inputStream);
PrintWriter out = new PrintWriter(outputStream);
Task solver = new Task();
solver.solve(1, in, out);
out.close();
}
static class Task {
public void solve(int testNumber, FastReader in, PrintWriter out) {
int n = in.nextInt(), m = in.nextInt();
int sum = 0;
for (int i = 0; i < m; ++i) {
sum += in.nextInt();
}
out.println(sum > n ? -1 : n - sum);
}
}
static class FastReader {
private InputStream stream;
private byte[] buf = new byte[1024];
private int curChar;
private int numChars;
private FastReader.SpaceCharFilter filter;
public FastReader(InputStream stream) {
this.stream = stream;
}
public int read() {
if (numChars == -1)
throw new InputMismatchException();
if (curChar >= numChars) {
curChar = 0;
try {
numChars = stream.read(buf);
} catch (IOException e) {
throw new InputMismatchException();
}
if (numChars <= 0)
return -1;
}
return buf[curChar++];
}
public int nextInt() {
int c = read();
while (isSpaceChar(c))
c = read();
int sgn = 1;
if (c == '-') {
sgn = -1;
c = read();
}
int res = 0;
do {
if (c < '0' || c > '9')
throw new InputMismatchException();
res *= 10;
res += c - '0';
c = read();
}
while (!isSpaceChar(c));
return res * sgn;
}
public boolean isSpaceChar(int c) {
if (filter != null)
return filter.isSpaceChar(c);
return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
}
public interface SpaceCharFilter {
public boolean isSpaceChar(int ch);
}
}
}
|
[
7,
15,
13,
17,
15,
13,
17,
6,
13,
41,
13,
41,
13,
12,
13,
30,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
4,
18,
13,
4,
18,
13,
4,
18,
13,
2,
13,
13,
40,
17,
12,
13,
30,
0,
13,
20,
0,
13,
20,
4,
18,
20,
4,
18,
13,
23,
13,
6,
13,
41,
13,
41,
13,
12,
13,
30,
0,
13,
20,
12,
13,
30,
42,
2,
2,
13,
17,
40,
4,
18,
13,
30,
38,
5,
13,
30,
4,
18,
13,
30,
0,
13,
20,
29,
4,
18,
13,
12,
13,
30,
29,
4,
18,
13,
4,
13,
12,
13,
30,
29,
4,
18,
13,
4,
13,
12,
13,
30,
29,
4,
18,
13,
4,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
143,
8
],
[
143,
9
],
[
9,
10
],
[
143,
11
],
[
11,
12
],
[
143,
13
],
[
13,
14
],
[
13,
15
],
[
15,
16
],
[
16,
17
],
[
16,
18
],
[
18,
19
],
[
19,
20
],
[
15,
21
],
[
21,
22
],
[
21,
23
],
[
23,
24
],
[
24,
25
],
[
15,
26
],
[
26,
27
],
[
26,
28
],
[
15,
29
],
[
29,
30
],
[
30,
31
],
[
31,
32
],
[
31,
33
],
[
29,
34
],
[
34,
35
],
[
34,
36
],
[
29,
37
],
[
37,
38
],
[
38,
39
],
[
29,
40
],
[
41,
41
],
[
41,
42
],
[
42,
43
],
[
42,
44
],
[
44,
45
],
[
45,
46
],
[
15,
47
],
[
47,
48
],
[
48,
49
],
[
47,
50
],
[
50,
51
],
[
51,
52
],
[
50,
53
],
[
53,
54
],
[
53,
55
],
[
50,
56
],
[
56,
57
],
[
143,
58
],
[
58,
59
],
[
58,
60
],
[
60,
61
],
[
61,
62
],
[
61,
63
],
[
60,
64
],
[
64,
65
],
[
64,
66
],
[
60,
67
],
[
67,
68
],
[
68,
69
],
[
60,
70
],
[
70,
71
],
[
71,
72
],
[
58,
73
],
[
73,
74
],
[
143,
75
],
[
75,
76
],
[
75,
77
],
[
77,
78
],
[
75,
79
],
[
79,
80
],
[
75,
81
],
[
81,
82
],
[
81,
83
],
[
83,
84
],
[
84,
85
],
[
84,
86
],
[
75,
87
],
[
87,
88
],
[
87,
89
],
[
89,
90
],
[
90,
91
],
[
91,
92
],
[
92,
93
],
[
92,
94
],
[
91,
95
],
[
95,
96
],
[
96,
97
],
[
97,
98
],
[
90,
99
],
[
99,
100
],
[
100,
101
],
[
101,
102
],
[
101,
103
],
[
103,
104
],
[
104,
105
],
[
105,
106
],
[
100,
107
],
[
107,
108
],
[
108,
109
],
[
108,
110
],
[
89,
111
],
[
111,
112
],
[
112,
113
],
[
113,
114
],
[
75,
115
],
[
115,
116
],
[
115,
117
],
[
117,
118
],
[
118,
119
],
[
119,
120
],
[
120,
121
],
[
119,
122
],
[
122,
123
],
[
75,
124
],
[
124,
125
],
[
124,
126
],
[
126,
127
],
[
127,
128
],
[
128,
129
],
[
129,
130
],
[
128,
131
],
[
131,
132
],
[
75,
133
],
[
133,
134
],
[
133,
135
],
[
135,
136
],
[
136,
137
],
[
137,
138
],
[
138,
139
],
[
137,
140
],
[
140,
141
],
[
0,
142
],
[
142,
143
],
[
142,
144
]
] |
[
"\nimport java.io.*;\nimport java.util.*;\n\npublic class Main {\n private void solve() {\n int n = sc.nextInt();\n int m = sc.nextInt();\n\n int sum = 0;\n for (int i = 0; i < m; i++) {\n sum += sc.nextInt();\n }\n\n out.println(Math.max(n - sum, -1));\n }\n\n private static PrintWriter out;\n private static MyScanner sc;\n\n private static class MyScanner {\n BufferedReader br;\n StringTokenizer st;\n\n private MyScanner() {\n br = new BufferedReader(new InputStreamReader(System.in));\n }\n\n String next() {\n while (st == null || !st.hasMoreElements()) {\n try {\n st = new StringTokenizer(br.readLine());\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n return st.nextToken();\n }\n\n int nextInt() {\n return Integer.parseInt(next());\n }\n\n long nextLong() {\n return Long.parseLong(next());\n }\n\n double nextDouble() {\n return Double.parseDouble(next());\n }\n }\n\n public static void main(String[] args) {\n out = new PrintWriter(new BufferedOutputStream(System.out));\n sc = new MyScanner();\n new Main().solve();\n out.close();\n }\n}",
"import java.io.*;",
"io.*",
"java",
"import java.util.*;",
"util.*",
"java",
"public class Main {\n private void solve() {\n int n = sc.nextInt();\n int m = sc.nextInt();\n\n int sum = 0;\n for (int i = 0; i < m; i++) {\n sum += sc.nextInt();\n }\n\n out.println(Math.max(n - sum, -1));\n }\n\n private static PrintWriter out;\n private static MyScanner sc;\n\n private static class MyScanner {\n BufferedReader br;\n StringTokenizer st;\n\n private MyScanner() {\n br = new BufferedReader(new InputStreamReader(System.in));\n }\n\n String next() {\n while (st == null || !st.hasMoreElements()) {\n try {\n st = new StringTokenizer(br.readLine());\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n return st.nextToken();\n }\n\n int nextInt() {\n return Integer.parseInt(next());\n }\n\n long nextLong() {\n return Long.parseLong(next());\n }\n\n double nextDouble() {\n return Double.parseDouble(next());\n }\n }\n\n public static void main(String[] args) {\n out = new PrintWriter(new BufferedOutputStream(System.out));\n sc = new MyScanner();\n new Main().solve();\n out.close();\n }\n}",
"Main",
"private static PrintWriter out;",
"out",
"private static MyScanner sc;",
"sc",
"private void solve() {\n int n = sc.nextInt();\n int m = sc.nextInt();\n\n int sum = 0;\n for (int i = 0; i < m; i++) {\n sum += sc.nextInt();\n }\n\n out.println(Math.max(n - sum, -1));\n }",
"solve",
"{\n int n = sc.nextInt();\n int m = sc.nextInt();\n\n int sum = 0;\n for (int i = 0; i < m; i++) {\n sum += sc.nextInt();\n }\n\n out.println(Math.max(n - sum, -1));\n }",
"int n = sc.nextInt();",
"n",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int m = sc.nextInt();",
"m",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int sum = 0;",
"sum",
"0",
"for (int i = 0; i < m; i++) {\n sum += sc.nextInt();\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < m",
"i",
"m",
"i++",
"i++",
"i",
"{\n sum += sc.nextInt();\n }",
"{\n sum += sc.nextInt();\n }",
"sum += sc.nextInt()",
"sum",
"sc.nextInt()",
"sc.nextInt",
"sc",
"out.println(Math.max(n - sum, -1))",
"out.println",
"out",
"Math.max(n - sum, -1)",
"Math.max",
"Math",
"n - sum",
"n",
"sum",
"-1",
"1",
"public static void main(String[] args) {\n out = new PrintWriter(new BufferedOutputStream(System.out));\n sc = new MyScanner();\n new Main().solve();\n out.close();\n }",
"main",
"{\n out = new PrintWriter(new BufferedOutputStream(System.out));\n sc = new MyScanner();\n new Main().solve();\n out.close();\n }",
"out = new PrintWriter(new BufferedOutputStream(System.out))",
"out",
"new PrintWriter(new BufferedOutputStream(System.out))",
"sc = new MyScanner()",
"sc",
"new MyScanner()",
"new Main().solve()",
"new Main().solve",
"new Main()",
"out.close()",
"out.close",
"out",
"String[] args",
"args",
"private static class MyScanner {\n BufferedReader br;\n StringTokenizer st;\n\n private MyScanner() {\n br = new BufferedReader(new InputStreamReader(System.in));\n }\n\n String next() {\n while (st == null || !st.hasMoreElements()) {\n try {\n st = new StringTokenizer(br.readLine());\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n return st.nextToken();\n }\n\n int nextInt() {\n return Integer.parseInt(next());\n }\n\n long nextLong() {\n return Long.parseLong(next());\n }\n\n double nextDouble() {\n return Double.parseDouble(next());\n }\n }",
"MyScanner",
"BufferedReader br;",
"br",
"StringTokenizer st;",
"st",
"private MyScanner() {\n br = new BufferedReader(new InputStreamReader(System.in));\n }",
"MyScanner",
"{\n br = new BufferedReader(new InputStreamReader(System.in));\n }",
"br = new BufferedReader(new InputStreamReader(System.in))",
"br",
"new BufferedReader(new InputStreamReader(System.in))",
"String next() {\n while (st == null || !st.hasMoreElements()) {\n try {\n st = new StringTokenizer(br.readLine());\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n return st.nextToken();\n }",
"next",
"{\n while (st == null || !st.hasMoreElements()) {\n try {\n st = new StringTokenizer(br.readLine());\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n return st.nextToken();\n }",
"while (st == null || !st.hasMoreElements()) {\n try {\n st = new StringTokenizer(br.readLine());\n } catch (IOException e) {\n e.printStackTrace();\n }\n }",
"st == null || !st.hasMoreElements()",
"st == null",
"st",
"null",
"!st.hasMoreElements()",
"st.hasMoreElements()",
"st.hasMoreElements",
"st",
"{\n try {\n st = new StringTokenizer(br.readLine());\n } catch (IOException e) {\n e.printStackTrace();\n }\n }",
"try {\n st = new StringTokenizer(br.readLine());\n } catch (IOException e) {\n e.printStackTrace();\n }",
"catch (IOException e) {\n e.printStackTrace();\n }",
"IOException e",
"{\n e.printStackTrace();\n }",
"e.printStackTrace()",
"e.printStackTrace",
"e",
"{\n st = new StringTokenizer(br.readLine());\n }",
"st = new StringTokenizer(br.readLine())",
"st",
"new StringTokenizer(br.readLine())",
"return st.nextToken();",
"st.nextToken()",
"st.nextToken",
"st",
"int nextInt() {\n return Integer.parseInt(next());\n }",
"nextInt",
"{\n return Integer.parseInt(next());\n }",
"return Integer.parseInt(next());",
"Integer.parseInt(next())",
"Integer.parseInt",
"Integer",
"next()",
"next",
"long nextLong() {\n return Long.parseLong(next());\n }",
"nextLong",
"{\n return Long.parseLong(next());\n }",
"return Long.parseLong(next());",
"Long.parseLong(next())",
"Long.parseLong",
"Long",
"next()",
"next",
"double nextDouble() {\n return Double.parseDouble(next());\n }",
"nextDouble",
"{\n return Double.parseDouble(next());\n }",
"return Double.parseDouble(next());",
"Double.parseDouble(next())",
"Double.parseDouble",
"Double",
"next()",
"next",
"public class Main {\n private void solve() {\n int n = sc.nextInt();\n int m = sc.nextInt();\n\n int sum = 0;\n for (int i = 0; i < m; i++) {\n sum += sc.nextInt();\n }\n\n out.println(Math.max(n - sum, -1));\n }\n\n private static PrintWriter out;\n private static MyScanner sc;\n\n private static class MyScanner {\n BufferedReader br;\n StringTokenizer st;\n\n private MyScanner() {\n br = new BufferedReader(new InputStreamReader(System.in));\n }\n\n String next() {\n while (st == null || !st.hasMoreElements()) {\n try {\n st = new StringTokenizer(br.readLine());\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n return st.nextToken();\n }\n\n int nextInt() {\n return Integer.parseInt(next());\n }\n\n long nextLong() {\n return Long.parseLong(next());\n }\n\n double nextDouble() {\n return Double.parseDouble(next());\n }\n }\n\n public static void main(String[] args) {\n out = new PrintWriter(new BufferedOutputStream(System.out));\n sc = new MyScanner();\n new Main().solve();\n out.close();\n }\n}",
"public class Main {\n private void solve() {\n int n = sc.nextInt();\n int m = sc.nextInt();\n\n int sum = 0;\n for (int i = 0; i < m; i++) {\n sum += sc.nextInt();\n }\n\n out.println(Math.max(n - sum, -1));\n }\n\n private static PrintWriter out;\n private static MyScanner sc;\n\n private static class MyScanner {\n BufferedReader br;\n StringTokenizer st;\n\n private MyScanner() {\n br = new BufferedReader(new InputStreamReader(System.in));\n }\n\n String next() {\n while (st == null || !st.hasMoreElements()) {\n try {\n st = new StringTokenizer(br.readLine());\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n return st.nextToken();\n }\n\n int nextInt() {\n return Integer.parseInt(next());\n }\n\n long nextLong() {\n return Long.parseLong(next());\n }\n\n double nextDouble() {\n return Double.parseDouble(next());\n }\n }\n\n public static void main(String[] args) {\n out = new PrintWriter(new BufferedOutputStream(System.out));\n sc = new MyScanner();\n new Main().solve();\n out.close();\n }\n}",
"Main"
] |
import java.io.*;
import java.util.*;
public class Main {
private void solve() {
int n = sc.nextInt();
int m = sc.nextInt();
int sum = 0;
for (int i = 0; i < m; i++) {
sum += sc.nextInt();
}
out.println(Math.max(n - sum, -1));
}
private static PrintWriter out;
private static MyScanner sc;
private static class MyScanner {
BufferedReader br;
StringTokenizer st;
private MyScanner() {
br = new BufferedReader(new InputStreamReader(System.in));
}
String next() {
while (st == null || !st.hasMoreElements()) {
try {
st = new StringTokenizer(br.readLine());
} catch (IOException e) {
e.printStackTrace();
}
}
return st.nextToken();
}
int nextInt() {
return Integer.parseInt(next());
}
long nextLong() {
return Long.parseLong(next());
}
double nextDouble() {
return Double.parseDouble(next());
}
}
public static void main(String[] args) {
out = new PrintWriter(new BufferedOutputStream(System.out));
sc = new MyScanner();
new Main().solve();
out.close();
}
}
|
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
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,
4,
18,
13,
0,
13,
13,
14,
2,
13,
17,
30,
4,
18,
18,
13,
13,
13,
30,
4,
18,
18,
13,
13,
40,
17,
4,
18,
13,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
68,
5
],
[
68,
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
],
[
23,
24
],
[
24,
25
],
[
24,
26
],
[
22,
27
],
[
27,
28
],
[
27,
29
],
[
22,
30
],
[
30,
31
],
[
31,
32
],
[
22,
33
],
[
34,
34
],
[
34,
35
],
[
35,
36
],
[
35,
37
],
[
37,
38
],
[
38,
39
],
[
34,
40
],
[
40,
41
],
[
40,
42
],
[
8,
43
],
[
43,
44
],
[
44,
45
],
[
44,
46
],
[
43,
47
],
[
47,
48
],
[
48,
49
],
[
49,
50
],
[
50,
51
],
[
50,
52
],
[
48,
53
],
[
43,
54
],
[
54,
55
],
[
55,
56
],
[
56,
57
],
[
57,
58
],
[
57,
59
],
[
55,
60
],
[
60,
61
],
[
8,
62
],
[
62,
63
],
[
63,
64
],
[
6,
65
],
[
65,
66
],
[
0,
67
],
[
67,
68
],
[
67,
69
]
] |
[
"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 kb = new Scanner(System.in);\n\t\tint n = kb.nextInt();\n\t\tint m = kb.nextInt();\n\t\tfor (int i = 0; i < m; i++) {\n\t\t\tint j = kb.nextInt();\n\t\t\tn -= j;\n\t\t}\n\t\tif (n >= 0) {\n\t\t\tSystem.out.println(n);\n\t\t} else {\n\t\t\tSystem.out.println(-1);\n\t\t}\n\t\tkb.close();\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 kb = new Scanner(System.in);\n\t\tint n = kb.nextInt();\n\t\tint m = kb.nextInt();\n\t\tfor (int i = 0; i < m; i++) {\n\t\t\tint j = kb.nextInt();\n\t\t\tn -= j;\n\t\t}\n\t\tif (n >= 0) {\n\t\t\tSystem.out.println(n);\n\t\t} else {\n\t\t\tSystem.out.println(-1);\n\t\t}\n\t\tkb.close();\n\t}\n\n}",
"Main",
"public static void main(String[] args) {\n\t\t// TODO Auto-generated method stub\n\t\tScanner kb = new Scanner(System.in);\n\t\tint n = kb.nextInt();\n\t\tint m = kb.nextInt();\n\t\tfor (int i = 0; i < m; i++) {\n\t\t\tint j = kb.nextInt();\n\t\t\tn -= j;\n\t\t}\n\t\tif (n >= 0) {\n\t\t\tSystem.out.println(n);\n\t\t} else {\n\t\t\tSystem.out.println(-1);\n\t\t}\n\t\tkb.close();\n\t}",
"main",
"{\n\t\t// TODO Auto-generated method stub\n\t\tScanner kb = new Scanner(System.in);\n\t\tint n = kb.nextInt();\n\t\tint m = kb.nextInt();\n\t\tfor (int i = 0; i < m; i++) {\n\t\t\tint j = kb.nextInt();\n\t\t\tn -= j;\n\t\t}\n\t\tif (n >= 0) {\n\t\t\tSystem.out.println(n);\n\t\t} else {\n\t\t\tSystem.out.println(-1);\n\t\t}\n\t\tkb.close();\n\t}",
"Scanner kb = new Scanner(System.in);",
"kb",
"new Scanner(System.in)",
"int n = kb.nextInt();",
"n",
"kb.nextInt()",
"kb.nextInt",
"kb",
"int m = kb.nextInt();",
"m",
"kb.nextInt()",
"kb.nextInt",
"kb",
"for (int i = 0; i < m; i++) {\n\t\t\tint j = kb.nextInt();\n\t\t\tn -= j;\n\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < m",
"i",
"m",
"i++",
"i++",
"i",
"{\n\t\t\tint j = kb.nextInt();\n\t\t\tn -= j;\n\t\t}",
"{\n\t\t\tint j = kb.nextInt();\n\t\t\tn -= j;\n\t\t}",
"int j = kb.nextInt();",
"j",
"kb.nextInt()",
"kb.nextInt",
"kb",
"n -= j",
"n",
"j",
"if (n >= 0) {\n\t\t\tSystem.out.println(n);\n\t\t} else {\n\t\t\tSystem.out.println(-1);\n\t\t}",
"n >= 0",
"n",
"0",
"{\n\t\t\tSystem.out.println(n);\n\t\t}",
"System.out.println(n)",
"System.out.println",
"System.out",
"System",
"System.out",
"n",
"{\n\t\t\tSystem.out.println(-1);\n\t\t}",
"System.out.println(-1)",
"System.out.println",
"System.out",
"System",
"System.out",
"-1",
"1",
"kb.close()",
"kb.close",
"kb",
"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 kb = new Scanner(System.in);\n\t\tint n = kb.nextInt();\n\t\tint m = kb.nextInt();\n\t\tfor (int i = 0; i < m; i++) {\n\t\t\tint j = kb.nextInt();\n\t\t\tn -= j;\n\t\t}\n\t\tif (n >= 0) {\n\t\t\tSystem.out.println(n);\n\t\t} else {\n\t\t\tSystem.out.println(-1);\n\t\t}\n\t\tkb.close();\n\t}\n\n}",
"public class Main {\n\n\tpublic static void main(String[] args) {\n\t\t// TODO Auto-generated method stub\n\t\tScanner kb = new Scanner(System.in);\n\t\tint n = kb.nextInt();\n\t\tint m = kb.nextInt();\n\t\tfor (int i = 0; i < m; i++) {\n\t\t\tint j = kb.nextInt();\n\t\t\tn -= j;\n\t\t}\n\t\tif (n >= 0) {\n\t\t\tSystem.out.println(n);\n\t\t} else {\n\t\t\tSystem.out.println(-1);\n\t\t}\n\t\tkb.close();\n\t}\n\n}",
"Main"
] |
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
// TODO Auto-generated method stub
Scanner kb = new Scanner(System.in);
int n = kb.nextInt();
int m = kb.nextInt();
for (int i = 0; i < m; i++) {
int j = kb.nextInt();
n -= j;
}
if (n >= 0) {
System.out.println(n);
} else {
System.out.println(-1);
}
kb.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,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
0,
13,
4,
18,
13,
14,
2,
13,
13,
4,
18,
18,
13,
13,
40,
17,
4,
18,
18,
13,
13,
2,
13,
13,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
67,
5
],
[
67,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
8,
17
],
[
17,
18
],
[
17,
19
],
[
19,
20
],
[
20,
21
],
[
8,
22
],
[
22,
23
],
[
22,
24
],
[
8,
25
],
[
25,
26
],
[
25,
27
],
[
8,
28
],
[
28,
29
],
[
29,
30
],
[
30,
31
],
[
30,
32
],
[
28,
33
],
[
33,
34
],
[
33,
35
],
[
28,
36
],
[
36,
37
],
[
37,
38
],
[
28,
39
],
[
39,
40
],
[
40,
41
],
[
40,
42
],
[
42,
43
],
[
43,
44
],
[
8,
45
],
[
45,
46
],
[
46,
47
],
[
46,
48
],
[
45,
49
],
[
49,
50
],
[
50,
51
],
[
51,
52
],
[
51,
53
],
[
49,
54
],
[
54,
55
],
[
45,
56
],
[
56,
57
],
[
57,
58
],
[
58,
59
],
[
58,
60
],
[
56,
61
],
[
61,
62
],
[
61,
63
],
[
6,
64
],
[
64,
65
],
[
0,
66
],
[
66,
67
],
[
66,
68
]
] |
[
"import java.util.*;\n\npublic class Main {\n\n\tpublic static void main(String[] args) {\n\n\tScanner s = new Scanner(System.in);\n\t\tint m = s.nextInt();\n\t\tint n = s.nextInt();\n\n\t\tArrayList<Integer> arr = new ArrayList<Integer>();\n\t\tint sum = 0;\n\t\tfor (int i = 0; i < n; i++)\n\t\t\tsum += s.nextInt();\n\n\t\tif (sum > m)\n\t\t\tSystem.out.println(-1);\n\t\telse\n\t\t\tSystem.out.println(m - sum);\n}\n\n}",
"import java.util.*;",
"util.*",
"java",
"public class Main {\n\n\tpublic static void main(String[] args) {\n\n\tScanner s = new Scanner(System.in);\n\t\tint m = s.nextInt();\n\t\tint n = s.nextInt();\n\n\t\tArrayList<Integer> arr = new ArrayList<Integer>();\n\t\tint sum = 0;\n\t\tfor (int i = 0; i < n; i++)\n\t\t\tsum += s.nextInt();\n\n\t\tif (sum > m)\n\t\t\tSystem.out.println(-1);\n\t\telse\n\t\t\tSystem.out.println(m - sum);\n}\n\n}",
"Main",
"public static void main(String[] args) {\n\n\tScanner s = new Scanner(System.in);\n\t\tint m = s.nextInt();\n\t\tint n = s.nextInt();\n\n\t\tArrayList<Integer> arr = new ArrayList<Integer>();\n\t\tint sum = 0;\n\t\tfor (int i = 0; i < n; i++)\n\t\t\tsum += s.nextInt();\n\n\t\tif (sum > m)\n\t\t\tSystem.out.println(-1);\n\t\telse\n\t\t\tSystem.out.println(m - sum);\n}",
"main",
"{\n\n\tScanner s = new Scanner(System.in);\n\t\tint m = s.nextInt();\n\t\tint n = s.nextInt();\n\n\t\tArrayList<Integer> arr = new ArrayList<Integer>();\n\t\tint sum = 0;\n\t\tfor (int i = 0; i < n; i++)\n\t\t\tsum += s.nextInt();\n\n\t\tif (sum > m)\n\t\t\tSystem.out.println(-1);\n\t\telse\n\t\t\tSystem.out.println(m - sum);\n}",
"Scanner s = new Scanner(System.in);",
"s",
"new Scanner(System.in)",
"int m = s.nextInt();",
"m",
"s.nextInt()",
"s.nextInt",
"s",
"int n = s.nextInt();",
"n",
"s.nextInt()",
"s.nextInt",
"s",
"ArrayList<Integer> arr = new ArrayList<Integer>();",
"arr",
"new ArrayList<Integer>()",
"int sum = 0;",
"sum",
"0",
"for (int i = 0; i < n; i++)\n\t\t\tsum += s.nextInt();",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < n",
"i",
"n",
"i++",
"i++",
"i",
"sum += s.nextInt();",
"sum += s.nextInt()",
"sum",
"s.nextInt()",
"s.nextInt",
"s",
"if (sum > m)\n\t\t\tSystem.out.println(-1);\n\t\telse\n\t\t\tSystem.out.println(m - sum);",
"sum > m",
"sum",
"m",
"System.out.println(-1)",
"System.out.println",
"System.out",
"System",
"System.out",
"-1",
"1",
"System.out.println(m - sum)",
"System.out.println",
"System.out",
"System",
"System.out",
"m - sum",
"m",
"sum",
"String[] args",
"args",
"public class Main {\n\n\tpublic static void main(String[] args) {\n\n\tScanner s = new Scanner(System.in);\n\t\tint m = s.nextInt();\n\t\tint n = s.nextInt();\n\n\t\tArrayList<Integer> arr = new ArrayList<Integer>();\n\t\tint sum = 0;\n\t\tfor (int i = 0; i < n; i++)\n\t\t\tsum += s.nextInt();\n\n\t\tif (sum > m)\n\t\t\tSystem.out.println(-1);\n\t\telse\n\t\t\tSystem.out.println(m - sum);\n}\n\n}",
"public class Main {\n\n\tpublic static void main(String[] args) {\n\n\tScanner s = new Scanner(System.in);\n\t\tint m = s.nextInt();\n\t\tint n = s.nextInt();\n\n\t\tArrayList<Integer> arr = new ArrayList<Integer>();\n\t\tint sum = 0;\n\t\tfor (int i = 0; i < n; i++)\n\t\t\tsum += s.nextInt();\n\n\t\tif (sum > m)\n\t\t\tSystem.out.println(-1);\n\t\telse\n\t\t\tSystem.out.println(m - sum);\n}\n\n}",
"Main"
] |
import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner s = new Scanner(System.in);
int m = s.nextInt();
int n = s.nextInt();
ArrayList<Integer> arr = new ArrayList<Integer>();
int sum = 0;
for (int i = 0; i < n; i++)
sum += s.nextInt();
if (sum > m)
System.out.println(-1);
else
System.out.println(m - sum);
}
}
|
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
4,
18,
18,
13,
13,
41,
13,
20,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
18,
13,
13,
4,
18,
13,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
18,
13,
13,
1,
40,
13,
30,
30,
0,
13,
18,
13,
13,
41,
13,
2,
13,
13,
14,
2,
13,
17,
30,
4,
18,
18,
13,
13,
13,
30,
4,
18,
18,
13,
13,
40,
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
],
[
23,
24
],
[
24,
25
],
[
24,
26
],
[
8,
27
],
[
27,
28
],
[
27,
29
],
[
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
],
[
45,
47
],
[
44,
48
],
[
48,
49
],
[
49,
50
],
[
8,
51
],
[
51,
52
],
[
51,
53
],
[
8,
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
],
[
69,
71
],
[
71,
72
],
[
71,
73
],
[
8,
74
],
[
74,
75
],
[
74,
76
],
[
76,
77
],
[
76,
78
],
[
8,
79
],
[
79,
80
],
[
80,
81
],
[
80,
82
],
[
79,
83
],
[
83,
84
],
[
84,
85
],
[
85,
86
],
[
86,
87
],
[
86,
88
],
[
84,
89
],
[
79,
90
],
[
90,
91
],
[
91,
92
],
[
92,
93
],
[
93,
94
],
[
93,
95
],
[
91,
96
],
[
96,
97
],
[
6,
98
],
[
98,
99
]
] |
[
"import java.util.Scanner;\n\nclass Main {\n\n public static void main(String[] args) {\n Scanner stdIn=new Scanner(System.in);\n\n int date=stdIn.nextInt();\n int homework=stdIn.nextInt();\n System.out.println();\n\n int [] a=new int[homework];\n for(int i=0; i<homework; i++){\n a[i]=stdIn.nextInt();\n }\n int sum=0;\n for(int i=0; i<a.length; i++){\n sum+=a[i];\n }\n int free=date-sum;\n if(free>=0){\n System.out.print(free);\n }\n else{\n System.out.print(-1);\n \n }\n }\n\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"class Main {\n\n public static void main(String[] args) {\n Scanner stdIn=new Scanner(System.in);\n\n int date=stdIn.nextInt();\n int homework=stdIn.nextInt();\n System.out.println();\n\n int [] a=new int[homework];\n for(int i=0; i<homework; i++){\n a[i]=stdIn.nextInt();\n }\n int sum=0;\n for(int i=0; i<a.length; i++){\n sum+=a[i];\n }\n int free=date-sum;\n if(free>=0){\n System.out.print(free);\n }\n else{\n System.out.print(-1);\n \n }\n }\n\n}",
"Main",
"public static void main(String[] args) {\n Scanner stdIn=new Scanner(System.in);\n\n int date=stdIn.nextInt();\n int homework=stdIn.nextInt();\n System.out.println();\n\n int [] a=new int[homework];\n for(int i=0; i<homework; i++){\n a[i]=stdIn.nextInt();\n }\n int sum=0;\n for(int i=0; i<a.length; i++){\n sum+=a[i];\n }\n int free=date-sum;\n if(free>=0){\n System.out.print(free);\n }\n else{\n System.out.print(-1);\n \n }\n }",
"main",
"{\n Scanner stdIn=new Scanner(System.in);\n\n int date=stdIn.nextInt();\n int homework=stdIn.nextInt();\n System.out.println();\n\n int [] a=new int[homework];\n for(int i=0; i<homework; i++){\n a[i]=stdIn.nextInt();\n }\n int sum=0;\n for(int i=0; i<a.length; i++){\n sum+=a[i];\n }\n int free=date-sum;\n if(free>=0){\n System.out.print(free);\n }\n else{\n System.out.print(-1);\n \n }\n }",
"Scanner stdIn=new Scanner(System.in);",
"stdIn",
"new Scanner(System.in)",
"int date=stdIn.nextInt();",
"date",
"stdIn.nextInt()",
"stdIn.nextInt",
"stdIn",
"int homework=stdIn.nextInt();",
"homework",
"stdIn.nextInt()",
"stdIn.nextInt",
"stdIn",
"System.out.println()",
"System.out.println",
"System.out",
"System",
"System.out",
"int [] a=new int[homework];",
"a",
"new int[homework]",
"homework",
"for(int i=0; i<homework; i++){\n a[i]=stdIn.nextInt();\n }",
"int i=0;",
"int i=0;",
"i",
"0",
"i<homework",
"i",
"homework",
"i++",
"i++",
"i",
"{\n a[i]=stdIn.nextInt();\n }",
"{\n a[i]=stdIn.nextInt();\n }",
"a[i]=stdIn.nextInt()",
"a[i]",
"a",
"i",
"stdIn.nextInt()",
"stdIn.nextInt",
"stdIn",
"int sum=0;",
"sum",
"0",
"for(int i=0; i<a.length; i++){\n sum+=a[i];\n }",
"int i=0;",
"int i=0;",
"i",
"0",
"i<a.length",
"i",
"a.length",
"a",
"a.length",
"i++",
"i++",
"i",
"{\n sum+=a[i];\n }",
"{\n sum+=a[i];\n }",
"sum+=a[i]",
"sum",
"a[i]",
"a",
"i",
"int free=date-sum;",
"free",
"date-sum",
"date",
"sum",
"if(free>=0){\n System.out.print(free);\n }\n else{\n System.out.print(-1);\n \n }",
"free>=0",
"free",
"0",
"{\n System.out.print(free);\n }",
"System.out.print(free)",
"System.out.print",
"System.out",
"System",
"System.out",
"free",
"{\n System.out.print(-1);\n \n }",
"System.out.print(-1)",
"System.out.print",
"System.out",
"System",
"System.out",
"-1",
"1",
"String[] args",
"args"
] |
import java.util.Scanner;
class Main {
public static void main(String[] args) {
Scanner stdIn=new Scanner(System.in);
int date=stdIn.nextInt();
int homework=stdIn.nextInt();
System.out.println();
int [] a=new int[homework];
for(int i=0; i<homework; i++){
a[i]=stdIn.nextInt();
}
int sum=0;
for(int i=0; i<a.length; i++){
sum+=a[i];
}
int free=date-sum;
if(free>=0){
System.out.print(free);
}
else{
System.out.print(-1);
}
}
}
|
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
41,
13,
0,
13,
20,
13,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
18,
13,
13,
1,
40,
13,
30,
30,
0,
18,
13,
13,
4,
18,
13,
0,
13,
18,
13,
13,
41,
13,
2,
13,
13,
14,
2,
13,
17,
30,
4,
18,
18,
13,
13,
13,
30,
4,
18,
18,
13,
13,
17,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
84,
5
],
[
84,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
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,
28
],
[
28,
29
],
[
28,
30
],
[
8,
31
],
[
31,
32
],
[
32,
33
],
[
33,
34
],
[
33,
35
],
[
31,
36
],
[
36,
37
],
[
36,
38
],
[
38,
39
],
[
38,
40
],
[
31,
41
],
[
41,
42
],
[
42,
43
],
[
31,
44
],
[
45,
45
],
[
45,
46
],
[
46,
47
],
[
47,
48
],
[
47,
49
],
[
46,
50
],
[
50,
51
],
[
51,
52
],
[
45,
53
],
[
53,
54
],
[
53,
55
],
[
55,
56
],
[
55,
57
],
[
8,
58
],
[
58,
59
],
[
58,
60
],
[
60,
61
],
[
60,
62
],
[
8,
63
],
[
63,
64
],
[
64,
65
],
[
64,
66
],
[
63,
67
],
[
67,
68
],
[
68,
69
],
[
69,
70
],
[
70,
71
],
[
70,
72
],
[
68,
73
],
[
63,
74
],
[
74,
75
],
[
75,
76
],
[
76,
77
],
[
77,
78
],
[
77,
79
],
[
75,
80
],
[
6,
81
],
[
81,
82
],
[
0,
83
],
[
83,
84
],
[
83,
85
]
] |
[
"import java.util.Scanner;\n \npublic class Main {\n public static void main(String[] args){\n Scanner sc = new Scanner(System.in);\n int N=sc.nextInt();\n int M=sc.nextInt();\n int X[];\n X=new int[M];\n int total=0;\n for (int i=0; i<X.length; i++) {\n \tX[i]=sc.nextInt();\n \ttotal += X[i];\n }\n int Y=N-total;\n if(Y>=0) {\n \tSystem.out.println(Y);\n }else {\n \tSystem.out.println(\"-1\");\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 N=sc.nextInt();\n int M=sc.nextInt();\n int X[];\n X=new int[M];\n int total=0;\n for (int i=0; i<X.length; i++) {\n \tX[i]=sc.nextInt();\n \ttotal += X[i];\n }\n int Y=N-total;\n if(Y>=0) {\n \tSystem.out.println(Y);\n }else {\n \tSystem.out.println(\"-1\");\n }\n }\n}",
"Main",
"public static void main(String[] args){\n Scanner sc = new Scanner(System.in);\n int N=sc.nextInt();\n int M=sc.nextInt();\n int X[];\n X=new int[M];\n int total=0;\n for (int i=0; i<X.length; i++) {\n \tX[i]=sc.nextInt();\n \ttotal += X[i];\n }\n int Y=N-total;\n if(Y>=0) {\n \tSystem.out.println(Y);\n }else {\n \tSystem.out.println(\"-1\");\n }\n }",
"main",
"{\n Scanner sc = new Scanner(System.in);\n int N=sc.nextInt();\n int M=sc.nextInt();\n int X[];\n X=new int[M];\n int total=0;\n for (int i=0; i<X.length; i++) {\n \tX[i]=sc.nextInt();\n \ttotal += X[i];\n }\n int Y=N-total;\n if(Y>=0) {\n \tSystem.out.println(Y);\n }else {\n \tSystem.out.println(\"-1\");\n }\n }",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"int N=sc.nextInt();",
"N",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int M=sc.nextInt();",
"M",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int X[];",
"X",
"X=new int[M]",
"X",
"new int[M]",
"M",
"int total=0;",
"total",
"0",
"for (int i=0; i<X.length; i++) {\n \tX[i]=sc.nextInt();\n \ttotal += X[i];\n }",
"int i=0;",
"int i=0;",
"i",
"0",
"i<X.length",
"i",
"X.length",
"X",
"X.length",
"i++",
"i++",
"i",
"{\n \tX[i]=sc.nextInt();\n \ttotal += X[i];\n }",
"{\n \tX[i]=sc.nextInt();\n \ttotal += X[i];\n }",
"X[i]=sc.nextInt()",
"X[i]",
"X",
"i",
"sc.nextInt()",
"sc.nextInt",
"sc",
"total += X[i]",
"total",
"X[i]",
"X",
"i",
"int Y=N-total;",
"Y",
"N-total",
"N",
"total",
"if(Y>=0) {\n \tSystem.out.println(Y);\n }else {\n \tSystem.out.println(\"-1\");\n }",
"Y>=0",
"Y",
"0",
"{\n \tSystem.out.println(Y);\n }",
"System.out.println(Y)",
"System.out.println",
"System.out",
"System",
"System.out",
"Y",
"{\n \tSystem.out.println(\"-1\");\n }",
"System.out.println(\"-1\")",
"System.out.println",
"System.out",
"System",
"System.out",
"\"-1\"",
"String[] args",
"args",
"public class Main {\n public static void main(String[] args){\n Scanner sc = new Scanner(System.in);\n int N=sc.nextInt();\n int M=sc.nextInt();\n int X[];\n X=new int[M];\n int total=0;\n for (int i=0; i<X.length; i++) {\n \tX[i]=sc.nextInt();\n \ttotal += X[i];\n }\n int Y=N-total;\n if(Y>=0) {\n \tSystem.out.println(Y);\n }else {\n \tSystem.out.println(\"-1\");\n }\n }\n}",
"public class Main {\n public static void main(String[] args){\n Scanner sc = new Scanner(System.in);\n int N=sc.nextInt();\n int M=sc.nextInt();\n int X[];\n X=new int[M];\n int total=0;\n for (int i=0; i<X.length; i++) {\n \tX[i]=sc.nextInt();\n \ttotal += X[i];\n }\n int Y=N-total;\n if(Y>=0) {\n \tSystem.out.println(Y);\n }else {\n \tSystem.out.println(\"-1\");\n }\n }\n}",
"Main"
] |
import java.util.Scanner;
public class Main {
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
int N=sc.nextInt();
int M=sc.nextInt();
int X[];
X=new int[M];
int total=0;
for (int i=0; i<X.length; i++) {
X[i]=sc.nextInt();
total += X[i];
}
int Y=N-total;
if(Y>=0) {
System.out.println(Y);
}else {
System.out.println("-1");
}
}
}
|
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
4,
18,
13,
41,
13,
4,
18,
13,
4,
18,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
4,
18,
13,
4,
18,
13,
14,
2,
13,
40,
17,
30,
4,
18,
18,
13,
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
],
[
74,
5
],
[
74,
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
],
[
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
],
[
43,
44
],
[
44,
45
],
[
43,
46
],
[
46,
47
],
[
47,
48
],
[
8,
49
],
[
49,
50
],
[
50,
51
],
[
50,
52
],
[
52,
53
],
[
49,
54
],
[
54,
55
],
[
55,
56
],
[
56,
57
],
[
57,
58
],
[
57,
59
],
[
55,
60
],
[
49,
61
],
[
61,
62
],
[
62,
63
],
[
63,
64
],
[
64,
65
],
[
64,
66
],
[
62,
67
],
[
8,
68
],
[
68,
69
],
[
69,
70
],
[
6,
71
],
[
71,
72
],
[
0,
73
],
[
73,
74
],
[
73,
75
]
] |
[
"import java.util.Scanner;\n\npublic class Main {\n\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n int n = Integer.parseInt(sc.next());\n int m = Integer.parseInt(sc.next());\n for (int i = 0; i < m; i++) {\n n -= Integer.parseInt(sc.next());\n }\n if (n <= -1) {\n System.out.println(\"-1\");\n } else {\n System.out.println(n);\n }\n sc.close();\n }\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n int n = Integer.parseInt(sc.next());\n int m = Integer.parseInt(sc.next());\n for (int i = 0; i < m; i++) {\n n -= Integer.parseInt(sc.next());\n }\n if (n <= -1) {\n System.out.println(\"-1\");\n } else {\n System.out.println(n);\n }\n sc.close();\n }\n}",
"Main",
"public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n int n = Integer.parseInt(sc.next());\n int m = Integer.parseInt(sc.next());\n for (int i = 0; i < m; i++) {\n n -= Integer.parseInt(sc.next());\n }\n if (n <= -1) {\n System.out.println(\"-1\");\n } else {\n System.out.println(n);\n }\n sc.close();\n }",
"main",
"{\n Scanner sc = new Scanner(System.in);\n int n = Integer.parseInt(sc.next());\n int m = Integer.parseInt(sc.next());\n for (int i = 0; i < m; i++) {\n n -= Integer.parseInt(sc.next());\n }\n if (n <= -1) {\n System.out.println(\"-1\");\n } else {\n System.out.println(n);\n }\n sc.close();\n }",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"int n = Integer.parseInt(sc.next());",
"n",
"Integer.parseInt(sc.next())",
"Integer.parseInt",
"Integer",
"sc.next()",
"sc.next",
"sc",
"int m = Integer.parseInt(sc.next());",
"m",
"Integer.parseInt(sc.next())",
"Integer.parseInt",
"Integer",
"sc.next()",
"sc.next",
"sc",
"for (int i = 0; i < m; i++) {\n n -= Integer.parseInt(sc.next());\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < m",
"i",
"m",
"i++",
"i++",
"i",
"{\n n -= Integer.parseInt(sc.next());\n }",
"{\n n -= Integer.parseInt(sc.next());\n }",
"n -= Integer.parseInt(sc.next())",
"n",
"Integer.parseInt(sc.next())",
"Integer.parseInt",
"Integer",
"sc.next()",
"sc.next",
"sc",
"if (n <= -1) {\n System.out.println(\"-1\");\n } else {\n System.out.println(n);\n }",
"n <= -1",
"n",
"-1",
"1",
"{\n System.out.println(\"-1\");\n }",
"System.out.println(\"-1\")",
"System.out.println",
"System.out",
"System",
"System.out",
"\"-1\"",
"{\n System.out.println(n);\n }",
"System.out.println(n)",
"System.out.println",
"System.out",
"System",
"System.out",
"n",
"sc.close()",
"sc.close",
"sc",
"String[] args",
"args",
"public class Main {\n\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n int n = Integer.parseInt(sc.next());\n int m = Integer.parseInt(sc.next());\n for (int i = 0; i < m; i++) {\n n -= Integer.parseInt(sc.next());\n }\n if (n <= -1) {\n System.out.println(\"-1\");\n } else {\n System.out.println(n);\n }\n sc.close();\n }\n}",
"public class Main {\n\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n int n = Integer.parseInt(sc.next());\n int m = Integer.parseInt(sc.next());\n for (int i = 0; i < m; i++) {\n n -= Integer.parseInt(sc.next());\n }\n if (n <= -1) {\n System.out.println(\"-1\");\n } else {\n System.out.println(n);\n }\n sc.close();\n }\n}",
"Main"
] |
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int n = Integer.parseInt(sc.next());
int m = Integer.parseInt(sc.next());
for (int i = 0; i < m; i++) {
n -= Integer.parseInt(sc.next());
}
if (n <= -1) {
System.out.println("-1");
} else {
System.out.println(n);
}
sc.close();
}
}
|
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
0,
13,
4,
18,
13,
4,
18,
18,
13,
13,
8,
2,
13,
17,
13,
40,
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
],
[
23,
24
],
[
24,
25
],
[
24,
26
],
[
22,
27
],
[
27,
28
],
[
27,
29
],
[
22,
30
],
[
30,
31
],
[
31,
32
],
[
22,
33
],
[
33,
34
],
[
34,
35
],
[
34,
36
],
[
36,
37
],
[
37,
38
],
[
8,
39
],
[
39,
40
],
[
40,
41
],
[
41,
42
],
[
41,
43
],
[
39,
44
],
[
44,
45
],
[
45,
46
],
[
45,
47
],
[
44,
48
],
[
44,
49
],
[
49,
50
],
[
6,
51
],
[
51,
52
]
] |
[
"import java.util.*;\nclass Main{\npublic static void main(String[]args){\nScanner sc=new Scanner(System.in);\n int n=sc.nextInt();\n int m=sc.nextInt();\n for(int i=0;i<m;i++)n-=sc.nextInt();\n System.out.println(n>=0?n:-1);\n}\n}",
"import java.util.*;",
"util.*",
"java",
"class Main{\npublic static void main(String[]args){\nScanner sc=new Scanner(System.in);\n int n=sc.nextInt();\n int m=sc.nextInt();\n for(int i=0;i<m;i++)n-=sc.nextInt();\n System.out.println(n>=0?n:-1);\n}\n}",
"Main",
"public static void main(String[]args){\nScanner sc=new Scanner(System.in);\n int n=sc.nextInt();\n int m=sc.nextInt();\n for(int i=0;i<m;i++)n-=sc.nextInt();\n System.out.println(n>=0?n:-1);\n}",
"main",
"{\nScanner sc=new Scanner(System.in);\n int n=sc.nextInt();\n int m=sc.nextInt();\n for(int i=0;i<m;i++)n-=sc.nextInt();\n System.out.println(n>=0?n:-1);\n}",
"Scanner sc=new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"int n=sc.nextInt();",
"n",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int m=sc.nextInt();",
"m",
"sc.nextInt()",
"sc.nextInt",
"sc",
"for(int i=0;i<m;i++)n-=sc.nextInt();",
"int i=0;",
"int i=0;",
"i",
"0",
"i<m",
"i",
"m",
"i++",
"i++",
"i",
"n-=sc.nextInt();",
"n-=sc.nextInt()",
"n",
"sc.nextInt()",
"sc.nextInt",
"sc",
"System.out.println(n>=0?n:-1)",
"System.out.println",
"System.out",
"System",
"System.out",
"n>=0?n:-1",
"n>=0",
"n",
"0",
"n",
"-1",
"1",
"String[]args",
"args"
] |
import java.util.*;
class Main{
public static void main(String[]args){
Scanner sc=new Scanner(System.in);
int n=sc.nextInt();
int m=sc.nextInt();
for(int i=0;i<m;i++)n-=sc.nextInt();
System.out.println(n>=0?n:-1);
}
}
|
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
38,
5,
13,
30,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
4,
18,
13,
0,
13,
2,
13,
13,
14,
2,
13,
17,
4,
18,
18,
13,
13,
40,
17,
4,
18,
18,
13,
13,
13,
23,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
10,
11
],
[
10,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
16,
17
],
[
16,
18
],
[
15,
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
],
[
19,
36
],
[
36,
37
],
[
37,
38
],
[
38,
39
],
[
38,
40
],
[
36,
41
],
[
41,
42
],
[
41,
43
],
[
36,
44
],
[
44,
45
],
[
45,
46
],
[
36,
47
],
[
48,
48
],
[
48,
49
],
[
49,
50
],
[
49,
51
],
[
51,
52
],
[
52,
53
],
[
19,
54
],
[
54,
55
],
[
54,
56
],
[
56,
57
],
[
56,
58
],
[
19,
59
],
[
59,
60
],
[
60,
61
],
[
60,
62
],
[
59,
63
],
[
63,
64
],
[
64,
65
],
[
65,
66
],
[
65,
67
],
[
63,
68
],
[
68,
69
],
[
59,
70
],
[
70,
71
],
[
71,
72
],
[
72,
73
],
[
72,
74
],
[
70,
75
],
[
12,
76
],
[
76,
77
]
] |
[
"import java.util.*;\nimport java.lang.*;\nimport java.io.*;\n\n/* Name of the class has to be \"Main\" only if the class is public. */\nclass Main\n{\n\tpublic static void main (String[] args) throws java.lang.Exception\n\t{\n\t\t// your code goes here\n\t\ttry {\n\t\t Scanner sc=new Scanner(System.in);\n\t\t int n=sc.nextInt();\n\t\t int m=sc.nextInt();\n\t\t int sum=0;\n\t\t for(int i=0;i<m;i++)\n\t\t {\n\t\t sum+=sc.nextInt();\n\t\t }\n\t\t n=n-sum;\n\t\t if(n<0)\n\t\t System.out.println(-1);\n\t\t else\n\t\t System.out.println(n);\n\t\t} catch(Exception e) {\n\t\t}\n\t}\n}",
"import java.util.*;",
"util.*",
"java",
"import java.lang.*;",
"lang.*",
"java",
"import java.io.*;",
"io.*",
"java",
"class Main\n{\n\tpublic static void main (String[] args) throws java.lang.Exception\n\t{\n\t\t// your code goes here\n\t\ttry {\n\t\t Scanner sc=new Scanner(System.in);\n\t\t int n=sc.nextInt();\n\t\t int m=sc.nextInt();\n\t\t int sum=0;\n\t\t for(int i=0;i<m;i++)\n\t\t {\n\t\t sum+=sc.nextInt();\n\t\t }\n\t\t n=n-sum;\n\t\t if(n<0)\n\t\t System.out.println(-1);\n\t\t else\n\t\t System.out.println(n);\n\t\t} catch(Exception e) {\n\t\t}\n\t}\n}",
"Main",
"public static void main (String[] args) throws java.lang.Exception\n\t{\n\t\t// your code goes here\n\t\ttry {\n\t\t Scanner sc=new Scanner(System.in);\n\t\t int n=sc.nextInt();\n\t\t int m=sc.nextInt();\n\t\t int sum=0;\n\t\t for(int i=0;i<m;i++)\n\t\t {\n\t\t sum+=sc.nextInt();\n\t\t }\n\t\t n=n-sum;\n\t\t if(n<0)\n\t\t System.out.println(-1);\n\t\t else\n\t\t System.out.println(n);\n\t\t} catch(Exception e) {\n\t\t}\n\t}",
"main",
"{\n\t\t// your code goes here\n\t\ttry {\n\t\t Scanner sc=new Scanner(System.in);\n\t\t int n=sc.nextInt();\n\t\t int m=sc.nextInt();\n\t\t int sum=0;\n\t\t for(int i=0;i<m;i++)\n\t\t {\n\t\t sum+=sc.nextInt();\n\t\t }\n\t\t n=n-sum;\n\t\t if(n<0)\n\t\t System.out.println(-1);\n\t\t else\n\t\t System.out.println(n);\n\t\t} catch(Exception e) {\n\t\t}\n\t}",
"try {\n\t\t Scanner sc=new Scanner(System.in);\n\t\t int n=sc.nextInt();\n\t\t int m=sc.nextInt();\n\t\t int sum=0;\n\t\t for(int i=0;i<m;i++)\n\t\t {\n\t\t sum+=sc.nextInt();\n\t\t }\n\t\t n=n-sum;\n\t\t if(n<0)\n\t\t System.out.println(-1);\n\t\t else\n\t\t System.out.println(n);\n\t\t} catch(Exception e) {\n\t\t}",
"catch(Exception e) {\n\t\t}",
"Exception e",
"{\n\t\t}",
"{\n\t\t Scanner sc=new Scanner(System.in);\n\t\t int n=sc.nextInt();\n\t\t int m=sc.nextInt();\n\t\t int sum=0;\n\t\t for(int i=0;i<m;i++)\n\t\t {\n\t\t sum+=sc.nextInt();\n\t\t }\n\t\t n=n-sum;\n\t\t if(n<0)\n\t\t System.out.println(-1);\n\t\t else\n\t\t System.out.println(n);\n\t\t}",
"Scanner sc=new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"int n=sc.nextInt();",
"n",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int m=sc.nextInt();",
"m",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int sum=0;",
"sum",
"0",
"for(int i=0;i<m;i++)\n\t\t {\n\t\t sum+=sc.nextInt();\n\t\t }",
"int i=0;",
"int i=0;",
"i",
"0",
"i<m",
"i",
"m",
"i++",
"i++",
"i",
"{\n\t\t sum+=sc.nextInt();\n\t\t }",
"{\n\t\t sum+=sc.nextInt();\n\t\t }",
"sum+=sc.nextInt()",
"sum",
"sc.nextInt()",
"sc.nextInt",
"sc",
"n=n-sum",
"n",
"n-sum",
"n",
"sum",
"if(n<0)\n\t\t System.out.println(-1);\n\t\t else\n\t\t System.out.println(n);",
"n<0",
"n",
"0",
"System.out.println(-1)",
"System.out.println",
"System.out",
"System",
"System.out",
"-1",
"1",
"System.out.println(n)",
"System.out.println",
"System.out",
"System",
"System.out",
"n",
"String[] args",
"args"
] |
import java.util.*;
import java.lang.*;
import java.io.*;
/* Name of the class has to be "Main" only if the class is public. */
class Main
{
public static void main (String[] args) throws java.lang.Exception
{
// your code goes here
try {
Scanner sc=new Scanner(System.in);
int n=sc.nextInt();
int m=sc.nextInt();
int sum=0;
for(int i=0;i<m;i++)
{
sum+=sc.nextInt();
}
n=n-sum;
if(n<0)
System.out.println(-1);
else
System.out.println(n);
} catch(Exception e) {
}
}
}
|
[
7,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
41,
13,
0,
13,
20,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
0,
18,
13,
13,
4,
18,
13,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
0,
13,
18,
13,
13,
4,
18,
18,
13,
13,
4,
18,
13,
40,
17,
2,
13,
13,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
86,
8
],
[
86,
9
],
[
9,
10
],
[
9,
11
],
[
11,
12
],
[
12,
13
],
[
12,
14
],
[
11,
15
],
[
15,
16
],
[
15,
17
],
[
17,
18
],
[
18,
19
],
[
11,
20
],
[
20,
21
],
[
20,
22
],
[
22,
23
],
[
23,
24
],
[
11,
25
],
[
25,
26
],
[
11,
27
],
[
27,
28
],
[
27,
29
],
[
11,
31
],
[
31,
32
],
[
32,
33
],
[
33,
34
],
[
33,
35
],
[
31,
36
],
[
36,
37
],
[
36,
38
],
[
31,
39
],
[
39,
40
],
[
40,
41
],
[
31,
42
],
[
42,
43
],
[
43,
44
],
[
44,
45
],
[
44,
46
],
[
43,
47
],
[
47,
48
],
[
48,
49
],
[
11,
50
],
[
50,
51
],
[
50,
52
],
[
11,
53
],
[
53,
54
],
[
54,
55
],
[
55,
56
],
[
55,
57
],
[
53,
58
],
[
58,
59
],
[
58,
60
],
[
53,
61
],
[
61,
62
],
[
62,
63
],
[
53,
64
],
[
64,
65
],
[
65,
66
],
[
65,
67
],
[
67,
68
],
[
67,
69
],
[
11,
70
],
[
70,
71
],
[
71,
72
],
[
72,
73
],
[
72,
74
],
[
70,
75
],
[
75,
76
],
[
76,
77
],
[
75,
78
],
[
78,
79
],
[
75,
80
],
[
80,
81
],
[
80,
82
],
[
9,
83
],
[
83,
84
],
[
0,
85
],
[
85,
86
],
[
85,
87
]
] |
[
"import java.util.*;\nimport java.lang.Math;\npublic class Main{\n public static void main(String[] args){\n Scanner sc=new Scanner(System.in);\n int N=sc.nextInt();\n int M=sc.nextInt();\n int A[];\n A=new int[M];\n for(int i=0;i<M;i++) A[i]=sc.nextInt();\n int sum=0;\n for(int i=0;i<M;i++) sum+=A[i];\n System.out.println(Math.max(-1,N-sum));\n }\n}",
"import java.util.*;",
"util.*",
"java",
"import java.lang.Math;",
"Math",
"java.lang",
"public class Main{\n public static void main(String[] args){\n Scanner sc=new Scanner(System.in);\n int N=sc.nextInt();\n int M=sc.nextInt();\n int A[];\n A=new int[M];\n for(int i=0;i<M;i++) A[i]=sc.nextInt();\n int sum=0;\n for(int i=0;i<M;i++) sum+=A[i];\n System.out.println(Math.max(-1,N-sum));\n }\n}",
"Main",
"public static void main(String[] args){\n Scanner sc=new Scanner(System.in);\n int N=sc.nextInt();\n int M=sc.nextInt();\n int A[];\n A=new int[M];\n for(int i=0;i<M;i++) A[i]=sc.nextInt();\n int sum=0;\n for(int i=0;i<M;i++) sum+=A[i];\n System.out.println(Math.max(-1,N-sum));\n }",
"main",
"{\n Scanner sc=new Scanner(System.in);\n int N=sc.nextInt();\n int M=sc.nextInt();\n int A[];\n A=new int[M];\n for(int i=0;i<M;i++) A[i]=sc.nextInt();\n int sum=0;\n for(int i=0;i<M;i++) sum+=A[i];\n System.out.println(Math.max(-1,N-sum));\n }",
"Scanner sc=new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"int N=sc.nextInt();",
"N",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int M=sc.nextInt();",
"M",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int A[];",
"A",
"A=new int[M]",
"A",
"new int[M]",
"M",
"for(int i=0;i<M;i++) A[i]=sc.nextInt();",
"int i=0;",
"int i=0;",
"i",
"0",
"i<M",
"i",
"M",
"i++",
"i++",
"i",
"A[i]=sc.nextInt();",
"A[i]=sc.nextInt()",
"A[i]",
"A",
"i",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int sum=0;",
"sum",
"0",
"for(int i=0;i<M;i++) sum+=A[i];",
"int i=0;",
"int i=0;",
"i",
"0",
"i<M",
"i",
"M",
"i++",
"i++",
"i",
"sum+=A[i];",
"sum+=A[i]",
"sum",
"A[i]",
"A",
"i",
"System.out.println(Math.max(-1,N-sum))",
"System.out.println",
"System.out",
"System",
"System.out",
"Math.max(-1,N-sum)",
"Math.max",
"Math",
"-1",
"1",
"N-sum",
"N",
"sum",
"String[] args",
"args",
"public class Main{\n public static void main(String[] args){\n Scanner sc=new Scanner(System.in);\n int N=sc.nextInt();\n int M=sc.nextInt();\n int A[];\n A=new int[M];\n for(int i=0;i<M;i++) A[i]=sc.nextInt();\n int sum=0;\n for(int i=0;i<M;i++) sum+=A[i];\n System.out.println(Math.max(-1,N-sum));\n }\n}",
"public class Main{\n public static void main(String[] args){\n Scanner sc=new Scanner(System.in);\n int N=sc.nextInt();\n int M=sc.nextInt();\n int A[];\n A=new int[M];\n for(int i=0;i<M;i++) A[i]=sc.nextInt();\n int sum=0;\n for(int i=0;i<M;i++) sum+=A[i];\n System.out.println(Math.max(-1,N-sum));\n }\n}",
"Main"
] |
import java.util.*;
import java.lang.Math;
public class Main{
public static void main(String[] args){
Scanner sc=new Scanner(System.in);
int N=sc.nextInt();
int M=sc.nextInt();
int A[];
A=new int[M];
for(int i=0;i<M;i++) A[i]=sc.nextInt();
int sum=0;
for(int i=0;i<M;i++) sum+=A[i];
System.out.println(Math.max(-1,N-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,
13,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
18,
13,
13,
4,
18,
13,
0,
13,
18,
13,
13,
14,
2,
2,
13,
13,
17,
4,
18,
18,
13,
13,
2,
13,
13,
4,
18,
18,
13,
13,
40,
17,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
78,
5
],
[
78,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
8,
17
],
[
17,
18
],
[
17,
19
],
[
19,
20
],
[
20,
21
],
[
8,
22
],
[
22,
23
],
[
22,
24
],
[
8,
26
],
[
26,
27
],
[
26,
28
],
[
8,
29
],
[
29,
30
],
[
30,
31
],
[
31,
32
],
[
31,
33
],
[
29,
34
],
[
34,
35
],
[
34,
36
],
[
29,
37
],
[
37,
38
],
[
38,
39
],
[
29,
40
],
[
41,
41
],
[
41,
42
],
[
42,
43
],
[
43,
44
],
[
43,
45
],
[
42,
46
],
[
46,
47
],
[
47,
48
],
[
41,
49
],
[
49,
50
],
[
49,
51
],
[
51,
52
],
[
51,
53
],
[
8,
54
],
[
54,
55
],
[
55,
56
],
[
56,
57
],
[
56,
58
],
[
55,
59
],
[
54,
60
],
[
60,
61
],
[
61,
62
],
[
62,
63
],
[
62,
64
],
[
60,
65
],
[
65,
66
],
[
65,
67
],
[
54,
68
],
[
68,
69
],
[
69,
70
],
[
70,
71
],
[
70,
72
],
[
68,
73
],
[
73,
74
],
[
6,
75
],
[
75,
76
],
[
0,
77
],
[
77,
78
],
[
77,
79
]
] |
[
"import java.util.Scanner;\n\npublic class Main{\n public static void main(String[] args){\n\tScanner sc = new Scanner(System.in);\n\tint N = sc.nextInt();\n\tint M = sc.nextInt();\n\tint[] A = new int[M];\n\tint sNum = 0;\n\tfor(int i=0;i<M;i++){\n\t A[i] = sc.nextInt();\n\t sNum += A[i];\n\t}\n\tif(N - sNum >= 0) System.out.print(N - sNum);\n\telse System.out.print(-1);\n\t\n }\t\t\t \n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main{\n public static void main(String[] args){\n\tScanner sc = new Scanner(System.in);\n\tint N = sc.nextInt();\n\tint M = sc.nextInt();\n\tint[] A = new int[M];\n\tint sNum = 0;\n\tfor(int i=0;i<M;i++){\n\t A[i] = sc.nextInt();\n\t sNum += A[i];\n\t}\n\tif(N - sNum >= 0) System.out.print(N - sNum);\n\telse System.out.print(-1);\n\t\n }\t\t\t \n}",
"Main",
"public static void main(String[] args){\n\tScanner sc = new Scanner(System.in);\n\tint N = sc.nextInt();\n\tint M = sc.nextInt();\n\tint[] A = new int[M];\n\tint sNum = 0;\n\tfor(int i=0;i<M;i++){\n\t A[i] = sc.nextInt();\n\t sNum += A[i];\n\t}\n\tif(N - sNum >= 0) System.out.print(N - sNum);\n\telse System.out.print(-1);\n\t\n }",
"main",
"{\n\tScanner sc = new Scanner(System.in);\n\tint N = sc.nextInt();\n\tint M = sc.nextInt();\n\tint[] A = new int[M];\n\tint sNum = 0;\n\tfor(int i=0;i<M;i++){\n\t A[i] = sc.nextInt();\n\t sNum += A[i];\n\t}\n\tif(N - sNum >= 0) System.out.print(N - sNum);\n\telse System.out.print(-1);\n\t\n }",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"int N = sc.nextInt();",
"N",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int M = sc.nextInt();",
"M",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int[] A = new int[M];",
"A",
"new int[M]",
"M",
"int sNum = 0;",
"sNum",
"0",
"for(int i=0;i<M;i++){\n\t A[i] = sc.nextInt();\n\t sNum += A[i];\n\t}",
"int i=0;",
"int i=0;",
"i",
"0",
"i<M",
"i",
"M",
"i++",
"i++",
"i",
"{\n\t A[i] = sc.nextInt();\n\t sNum += A[i];\n\t}",
"{\n\t A[i] = sc.nextInt();\n\t sNum += A[i];\n\t}",
"A[i] = sc.nextInt()",
"A[i]",
"A",
"i",
"sc.nextInt()",
"sc.nextInt",
"sc",
"sNum += A[i]",
"sNum",
"A[i]",
"A",
"i",
"if(N - sNum >= 0) System.out.print(N - sNum);\n\telse System.out.print(-1);",
"N - sNum >= 0",
"N - sNum",
"N",
"sNum",
"0",
"System.out.print(N - sNum)",
"System.out.print",
"System.out",
"System",
"System.out",
"N - sNum",
"N",
"sNum",
"System.out.print(-1)",
"System.out.print",
"System.out",
"System",
"System.out",
"-1",
"1",
"String[] args",
"args",
"public class Main{\n public static void main(String[] args){\n\tScanner sc = new Scanner(System.in);\n\tint N = sc.nextInt();\n\tint M = sc.nextInt();\n\tint[] A = new int[M];\n\tint sNum = 0;\n\tfor(int i=0;i<M;i++){\n\t A[i] = sc.nextInt();\n\t sNum += A[i];\n\t}\n\tif(N - sNum >= 0) System.out.print(N - sNum);\n\telse System.out.print(-1);\n\t\n }\t\t\t \n}",
"public class Main{\n public static void main(String[] args){\n\tScanner sc = new Scanner(System.in);\n\tint N = sc.nextInt();\n\tint M = sc.nextInt();\n\tint[] A = new int[M];\n\tint sNum = 0;\n\tfor(int i=0;i<M;i++){\n\t A[i] = sc.nextInt();\n\t sNum += A[i];\n\t}\n\tif(N - sNum >= 0) System.out.print(N - sNum);\n\telse System.out.print(-1);\n\t\n }\t\t\t \n}",
"Main"
] |
import java.util.Scanner;
public class Main{
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
int N = sc.nextInt();
int M = sc.nextInt();
int[] A = new int[M];
int sNum = 0;
for(int i=0;i<M;i++){
A[i] = sc.nextInt();
sNum += A[i];
}
if(N - sNum >= 0) System.out.print(N - sNum);
else System.out.print(-1);
}
}
|
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
41,
13,
20,
13,
11,
1,
41,
13,
17,
2,
13,
18,
13,
13,
1,
40,
13,
30,
30,
0,
18,
13,
13,
4,
18,
13,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
18,
13,
13,
1,
40,
13,
30,
30,
0,
13,
18,
13,
13,
14,
2,
2,
13,
13,
17,
4,
18,
18,
13,
13,
2,
13,
13,
4,
18,
18,
13,
13,
17,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
94,
5
],
[
94,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
8,
17
],
[
17,
18
],
[
17,
19
],
[
19,
20
],
[
20,
21
],
[
8,
22
],
[
22,
23
],
[
22,
24
],
[
8,
26
],
[
26,
27
],
[
27,
28
],
[
28,
29
],
[
28,
30
],
[
26,
31
],
[
31,
32
],
[
31,
33
],
[
33,
34
],
[
33,
35
],
[
26,
36
],
[
36,
37
],
[
37,
38
],
[
26,
39
],
[
40,
40
],
[
40,
41
],
[
41,
42
],
[
42,
43
],
[
42,
44
],
[
41,
45
],
[
45,
46
],
[
46,
47
],
[
8,
48
],
[
48,
49
],
[
48,
50
],
[
8,
51
],
[
51,
52
],
[
52,
53
],
[
53,
54
],
[
53,
55
],
[
51,
56
],
[
56,
57
],
[
56,
58
],
[
58,
59
],
[
58,
60
],
[
51,
61
],
[
61,
62
],
[
62,
63
],
[
51,
64
],
[
65,
65
],
[
65,
66
],
[
66,
67
],
[
66,
68
],
[
68,
69
],
[
68,
70
],
[
8,
71
],
[
71,
72
],
[
72,
73
],
[
73,
74
],
[
73,
75
],
[
72,
76
],
[
71,
77
],
[
77,
78
],
[
78,
79
],
[
79,
80
],
[
79,
81
],
[
77,
82
],
[
82,
83
],
[
82,
84
],
[
71,
85
],
[
85,
86
],
[
86,
87
],
[
87,
88
],
[
87,
89
],
[
85,
90
],
[
6,
91
],
[
91,
92
],
[
0,
93
],
[
93,
94
],
[
93,
95
]
] |
[
"import java.util.Scanner;\npublic class Main{\n\tpublic static void main(String[] args){\n\t\tScanner input = new Scanner(System.in);\n\t\tint num = input.nextInt();\n\t\tint n = input.nextInt();\n\t\tint[] arr = new int[n];\n\t\tfor (int i = 0; i < arr.length; i++){\n\t\t\tarr[i] = input.nextInt();\n\t\t}\n\t\tint sum = 0;\n\t\tfor(int i = 0; i < arr.length;i++){\n\t\t\tsum +=arr[i];\n\t\t}\n\t\tif (num - sum >= 0)\n\t\t\tSystem.out.println(num - sum);\n\t\telse\n\t\t\tSystem.out.println(\"-1\");\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 input = new Scanner(System.in);\n\t\tint num = input.nextInt();\n\t\tint n = input.nextInt();\n\t\tint[] arr = new int[n];\n\t\tfor (int i = 0; i < arr.length; i++){\n\t\t\tarr[i] = input.nextInt();\n\t\t}\n\t\tint sum = 0;\n\t\tfor(int i = 0; i < arr.length;i++){\n\t\t\tsum +=arr[i];\n\t\t}\n\t\tif (num - sum >= 0)\n\t\t\tSystem.out.println(num - sum);\n\t\telse\n\t\t\tSystem.out.println(\"-1\");\n\t\t\n\t}\n}",
"Main",
"public static void main(String[] args){\n\t\tScanner input = new Scanner(System.in);\n\t\tint num = input.nextInt();\n\t\tint n = input.nextInt();\n\t\tint[] arr = new int[n];\n\t\tfor (int i = 0; i < arr.length; i++){\n\t\t\tarr[i] = input.nextInt();\n\t\t}\n\t\tint sum = 0;\n\t\tfor(int i = 0; i < arr.length;i++){\n\t\t\tsum +=arr[i];\n\t\t}\n\t\tif (num - sum >= 0)\n\t\t\tSystem.out.println(num - sum);\n\t\telse\n\t\t\tSystem.out.println(\"-1\");\n\t\t\n\t}",
"main",
"{\n\t\tScanner input = new Scanner(System.in);\n\t\tint num = input.nextInt();\n\t\tint n = input.nextInt();\n\t\tint[] arr = new int[n];\n\t\tfor (int i = 0; i < arr.length; i++){\n\t\t\tarr[i] = input.nextInt();\n\t\t}\n\t\tint sum = 0;\n\t\tfor(int i = 0; i < arr.length;i++){\n\t\t\tsum +=arr[i];\n\t\t}\n\t\tif (num - sum >= 0)\n\t\t\tSystem.out.println(num - sum);\n\t\telse\n\t\t\tSystem.out.println(\"-1\");\n\t\t\n\t}",
"Scanner input = new Scanner(System.in);",
"input",
"new Scanner(System.in)",
"int num = input.nextInt();",
"num",
"input.nextInt()",
"input.nextInt",
"input",
"int n = input.nextInt();",
"n",
"input.nextInt()",
"input.nextInt",
"input",
"int[] arr = new int[n];",
"arr",
"new int[n]",
"n",
"for (int i = 0; i < arr.length; i++){\n\t\t\tarr[i] = input.nextInt();\n\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < arr.length",
"i",
"arr.length",
"arr",
"arr.length",
"i++",
"i++",
"i",
"{\n\t\t\tarr[i] = input.nextInt();\n\t\t}",
"{\n\t\t\tarr[i] = input.nextInt();\n\t\t}",
"arr[i] = input.nextInt()",
"arr[i]",
"arr",
"i",
"input.nextInt()",
"input.nextInt",
"input",
"int sum = 0;",
"sum",
"0",
"for(int i = 0; i < arr.length;i++){\n\t\t\tsum +=arr[i];\n\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < arr.length",
"i",
"arr.length",
"arr",
"arr.length",
"i++",
"i++",
"i",
"{\n\t\t\tsum +=arr[i];\n\t\t}",
"{\n\t\t\tsum +=arr[i];\n\t\t}",
"sum +=arr[i]",
"sum",
"arr[i]",
"arr",
"i",
"if (num - sum >= 0)\n\t\t\tSystem.out.println(num - sum);\n\t\telse\n\t\t\tSystem.out.println(\"-1\");",
"num - sum >= 0",
"num - sum",
"num",
"sum",
"0",
"System.out.println(num - sum)",
"System.out.println",
"System.out",
"System",
"System.out",
"num - sum",
"num",
"sum",
"System.out.println(\"-1\")",
"System.out.println",
"System.out",
"System",
"System.out",
"\"-1\"",
"String[] args",
"args",
"public class Main{\n\tpublic static void main(String[] args){\n\t\tScanner input = new Scanner(System.in);\n\t\tint num = input.nextInt();\n\t\tint n = input.nextInt();\n\t\tint[] arr = new int[n];\n\t\tfor (int i = 0; i < arr.length; i++){\n\t\t\tarr[i] = input.nextInt();\n\t\t}\n\t\tint sum = 0;\n\t\tfor(int i = 0; i < arr.length;i++){\n\t\t\tsum +=arr[i];\n\t\t}\n\t\tif (num - sum >= 0)\n\t\t\tSystem.out.println(num - sum);\n\t\telse\n\t\t\tSystem.out.println(\"-1\");\n\t\t\n\t}\n}",
"public class Main{\n\tpublic static void main(String[] args){\n\t\tScanner input = new Scanner(System.in);\n\t\tint num = input.nextInt();\n\t\tint n = input.nextInt();\n\t\tint[] arr = new int[n];\n\t\tfor (int i = 0; i < arr.length; i++){\n\t\t\tarr[i] = input.nextInt();\n\t\t}\n\t\tint sum = 0;\n\t\tfor(int i = 0; i < arr.length;i++){\n\t\t\tsum +=arr[i];\n\t\t}\n\t\tif (num - sum >= 0)\n\t\t\tSystem.out.println(num - sum);\n\t\telse\n\t\t\tSystem.out.println(\"-1\");\n\t\t\n\t}\n}",
"Main"
] |
import java.util.Scanner;
public class Main{
public static void main(String[] args){
Scanner input = new Scanner(System.in);
int num = input.nextInt();
int n = input.nextInt();
int[] arr = new int[n];
for (int i = 0; i < arr.length; i++){
arr[i] = input.nextInt();
}
int sum = 0;
for(int i = 0; i < arr.length;i++){
sum +=arr[i];
}
if (num - sum >= 0)
System.out.println(num - sum);
else
System.out.println("-1");
}
}
|
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
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,
4,
18,
13,
0,
13,
2,
13,
13,
14,
2,
13,
17,
30,
4,
18,
18,
13,
13,
17,
30,
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
],
[
23,
24
],
[
24,
25
],
[
24,
26
],
[
22,
27
],
[
27,
28
],
[
27,
29
],
[
22,
30
],
[
30,
31
],
[
31,
32
],
[
22,
33
],
[
34,
34
],
[
34,
35
],
[
35,
36
],
[
35,
37
],
[
37,
38
],
[
38,
39
],
[
34,
40
],
[
40,
41
],
[
40,
42
],
[
42,
43
],
[
42,
44
],
[
8,
45
],
[
45,
46
],
[
46,
47
],
[
46,
48
],
[
45,
49
],
[
49,
50
],
[
50,
51
],
[
51,
52
],
[
52,
53
],
[
52,
54
],
[
50,
55
],
[
45,
56
],
[
56,
57
],
[
57,
58
],
[
58,
59
],
[
59,
60
],
[
59,
61
],
[
57,
62
],
[
6,
63
],
[
63,
64
]
] |
[
"import java.util.Scanner;\nclass Main {\n\tpublic static void main(String[] args) {\n\t\t// TODO Auto-generated method stub\n\t\tScanner input = new Scanner(System.in); \n int a = input.nextInt();\n int b =input.nextInt();\n for(int i =0; i<b; i++){\n \tint c = input.nextInt();\n \t\ta = a-c;\n }\n if(a<0){\n System.out.println (\"-1\");\n }\n else{\n System.out.println(a);\n }\n }\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"class Main {\n\tpublic static void main(String[] args) {\n\t\t// TODO Auto-generated method stub\n\t\tScanner input = new Scanner(System.in); \n int a = input.nextInt();\n int b =input.nextInt();\n for(int i =0; i<b; i++){\n \tint c = input.nextInt();\n \t\ta = a-c;\n }\n if(a<0){\n System.out.println (\"-1\");\n }\n else{\n System.out.println(a);\n }\n }\n}",
"Main",
"public static void main(String[] args) {\n\t\t// TODO Auto-generated method stub\n\t\tScanner input = new Scanner(System.in); \n int a = input.nextInt();\n int b =input.nextInt();\n for(int i =0; i<b; i++){\n \tint c = input.nextInt();\n \t\ta = a-c;\n }\n if(a<0){\n System.out.println (\"-1\");\n }\n else{\n System.out.println(a);\n }\n }",
"main",
"{\n\t\t// TODO Auto-generated method stub\n\t\tScanner input = new Scanner(System.in); \n int a = input.nextInt();\n int b =input.nextInt();\n for(int i =0; i<b; i++){\n \tint c = input.nextInt();\n \t\ta = a-c;\n }\n if(a<0){\n System.out.println (\"-1\");\n }\n else{\n System.out.println(a);\n }\n }",
"Scanner input = new Scanner(System.in);",
"input",
"new Scanner(System.in)",
"int a = input.nextInt();",
"a",
"input.nextInt()",
"input.nextInt",
"input",
"int b =input.nextInt();",
"b",
"input.nextInt()",
"input.nextInt",
"input",
"for(int i =0; i<b; i++){\n \tint c = input.nextInt();\n \t\ta = a-c;\n }",
"int i =0;",
"int i =0;",
"i",
"0",
"i<b",
"i",
"b",
"i++",
"i++",
"i",
"{\n \tint c = input.nextInt();\n \t\ta = a-c;\n }",
"{\n \tint c = input.nextInt();\n \t\ta = a-c;\n }",
"int c = input.nextInt();",
"c",
"input.nextInt()",
"input.nextInt",
"input",
"a = a-c",
"a",
"a-c",
"a",
"c",
"if(a<0){\n System.out.println (\"-1\");\n }\n else{\n System.out.println(a);\n }",
"a<0",
"a",
"0",
"{\n System.out.println (\"-1\");\n }",
"System.out.println (\"-1\")",
"System.out.println",
"System.out",
"System",
"System.out",
"\"-1\"",
"{\n System.out.println(a);\n }",
"System.out.println(a)",
"System.out.println",
"System.out",
"System",
"System.out",
"a",
"String[] args",
"args"
] |
import java.util.Scanner;
class Main {
public static void main(String[] args) {
// TODO Auto-generated method stub
Scanner input = new Scanner(System.in);
int a = input.nextInt();
int b =input.nextInt();
for(int i =0; i<b; i++){
int c = input.nextInt();
a = a-c;
}
if(a<0){
System.out.println ("-1");
}
else{
System.out.println(a);
}
}
}
|
[
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,
11,
1,
41,
13,
17,
2,
13,
18,
13,
13,
1,
40,
13,
30,
30,
0,
18,
13,
13,
4,
18,
13,
0,
13,
18,
13,
13,
14,
2,
13,
17,
30,
4,
18,
18,
13,
13,
13,
30,
4,
18,
18,
13,
13,
40,
17,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
75,
5
],
[
75,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
8,
17
],
[
17,
18
],
[
17,
19
],
[
19,
20
],
[
20,
21
],
[
8,
22
],
[
22,
23
],
[
22,
24
],
[
8,
26
],
[
26,
27
],
[
27,
28
],
[
28,
29
],
[
28,
30
],
[
26,
31
],
[
31,
32
],
[
31,
33
],
[
33,
34
],
[
33,
35
],
[
26,
36
],
[
36,
37
],
[
37,
38
],
[
26,
39
],
[
40,
40
],
[
40,
41
],
[
41,
42
],
[
42,
43
],
[
42,
44
],
[
41,
45
],
[
45,
46
],
[
46,
47
],
[
40,
48
],
[
48,
49
],
[
48,
50
],
[
50,
51
],
[
50,
52
],
[
8,
53
],
[
53,
54
],
[
54,
55
],
[
54,
56
],
[
53,
57
],
[
57,
58
],
[
58,
59
],
[
59,
60
],
[
60,
61
],
[
60,
62
],
[
58,
63
],
[
53,
64
],
[
64,
65
],
[
65,
66
],
[
66,
67
],
[
67,
68
],
[
67,
69
],
[
65,
70
],
[
70,
71
],
[
6,
72
],
[
72,
73
],
[
0,
74
],
[
74,
75
],
[
74,
76
]
] |
[
"import java.util.Scanner;\n\npublic class Main {\n public static void main(String args[]) {\n Scanner scanner = new Scanner(System.in);\n int N = scanner.nextInt();\n int M = scanner.nextInt();\n\n int[] A = new int[M];\n for(int i = 0; i < A.length; i++) {\n A[i] = scanner.nextInt();\n N -= A[i];\n }\n\n if(N >= 0) {\n System.out.println(N);\n } else {\n System.out.println(-1);\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 int N = scanner.nextInt();\n int M = scanner.nextInt();\n\n int[] A = new int[M];\n for(int i = 0; i < A.length; i++) {\n A[i] = scanner.nextInt();\n N -= A[i];\n }\n\n if(N >= 0) {\n System.out.println(N);\n } else {\n System.out.println(-1);\n }\n }\n}",
"Main",
"public static void main(String args[]) {\n Scanner scanner = new Scanner(System.in);\n int N = scanner.nextInt();\n int M = scanner.nextInt();\n\n int[] A = new int[M];\n for(int i = 0; i < A.length; i++) {\n A[i] = scanner.nextInt();\n N -= A[i];\n }\n\n if(N >= 0) {\n System.out.println(N);\n } else {\n System.out.println(-1);\n }\n }",
"main",
"{\n Scanner scanner = new Scanner(System.in);\n int N = scanner.nextInt();\n int M = scanner.nextInt();\n\n int[] A = new int[M];\n for(int i = 0; i < A.length; i++) {\n A[i] = scanner.nextInt();\n N -= A[i];\n }\n\n if(N >= 0) {\n System.out.println(N);\n } else {\n System.out.println(-1);\n }\n }",
"Scanner scanner = new Scanner(System.in);",
"scanner",
"new Scanner(System.in)",
"int N = scanner.nextInt();",
"N",
"scanner.nextInt()",
"scanner.nextInt",
"scanner",
"int M = scanner.nextInt();",
"M",
"scanner.nextInt()",
"scanner.nextInt",
"scanner",
"int[] A = new int[M];",
"A",
"new int[M]",
"M",
"for(int i = 0; i < A.length; i++) {\n A[i] = scanner.nextInt();\n N -= A[i];\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < A.length",
"i",
"A.length",
"A",
"A.length",
"i++",
"i++",
"i",
"{\n A[i] = scanner.nextInt();\n N -= A[i];\n }",
"{\n A[i] = scanner.nextInt();\n N -= A[i];\n }",
"A[i] = scanner.nextInt()",
"A[i]",
"A",
"i",
"scanner.nextInt()",
"scanner.nextInt",
"scanner",
"N -= A[i]",
"N",
"A[i]",
"A",
"i",
"if(N >= 0) {\n System.out.println(N);\n } else {\n System.out.println(-1);\n }",
"N >= 0",
"N",
"0",
"{\n System.out.println(N);\n }",
"System.out.println(N)",
"System.out.println",
"System.out",
"System",
"System.out",
"N",
"{\n System.out.println(-1);\n }",
"System.out.println(-1)",
"System.out.println",
"System.out",
"System",
"System.out",
"-1",
"1",
"String args[]",
"args",
"public class Main {\n public static void main(String args[]) {\n Scanner scanner = new Scanner(System.in);\n int N = scanner.nextInt();\n int M = scanner.nextInt();\n\n int[] A = new int[M];\n for(int i = 0; i < A.length; i++) {\n A[i] = scanner.nextInt();\n N -= A[i];\n }\n\n if(N >= 0) {\n System.out.println(N);\n } else {\n System.out.println(-1);\n }\n }\n}",
"public class Main {\n public static void main(String args[]) {\n Scanner scanner = new Scanner(System.in);\n int N = scanner.nextInt();\n int M = scanner.nextInt();\n\n int[] A = new int[M];\n for(int i = 0; i < A.length; i++) {\n A[i] = scanner.nextInt();\n N -= A[i];\n }\n\n if(N >= 0) {\n System.out.println(N);\n } else {\n System.out.println(-1);\n }\n }\n}",
"Main"
] |
import java.util.Scanner;
public class Main {
public static void main(String args[]) {
Scanner scanner = new Scanner(System.in);
int N = scanner.nextInt();
int M = scanner.nextInt();
int[] A = new int[M];
for(int i = 0; i < A.length; i++) {
A[i] = scanner.nextInt();
N -= A[i];
}
if(N >= 0) {
System.out.println(N);
} else {
System.out.println(-1);
}
}
}
|
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
20,
41,
13,
20,
4,
18,
13,
4,
18,
13,
23,
13,
12,
13,
30,
41,
13,
4,
18,
4,
18,
13,
17,
41,
13,
4,
18,
13,
18,
13,
17,
41,
13,
4,
18,
13,
18,
13,
17,
41,
13,
20,
13,
0,
13,
4,
18,
4,
18,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
18,
13,
13,
4,
18,
13,
18,
13,
13,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
18,
13,
13,
14,
2,
13,
13,
30,
4,
18,
18,
13,
13,
17,
30,
4,
18,
18,
13,
13,
2,
13,
13,
23,
13,
12,
13,
30,
12,
13,
30,
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
],
[
147,
14
],
[
147,
15
],
[
15,
16
],
[
15,
17
],
[
17,
18
],
[
18,
19
],
[
18,
20
],
[
17,
21
],
[
21,
22
],
[
21,
23
],
[
17,
24
],
[
24,
25
],
[
24,
26
],
[
17,
27
],
[
27,
28
],
[
28,
29
],
[
17,
30
],
[
30,
31
],
[
31,
32
],
[
15,
33
],
[
33,
34
],
[
147,
35
],
[
35,
36
],
[
35,
37
],
[
37,
38
],
[
38,
39
],
[
38,
40
],
[
40,
41
],
[
41,
42
],
[
42,
43
],
[
43,
44
],
[
40,
45
],
[
37,
46
],
[
46,
47
],
[
46,
48
],
[
48,
49
],
[
49,
50
],
[
48,
51
],
[
51,
52
],
[
51,
53
],
[
37,
54
],
[
54,
55
],
[
54,
56
],
[
56,
57
],
[
57,
58
],
[
56,
59
],
[
59,
60
],
[
59,
61
],
[
37,
62
],
[
62,
63
],
[
62,
64
],
[
37,
66
],
[
66,
67
],
[
66,
68
],
[
68,
69
],
[
69,
70
],
[
70,
71
],
[
71,
72
],
[
68,
73
],
[
37,
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
],
[
88,
90
],
[
87,
91
],
[
91,
92
],
[
92,
93
],
[
91,
94
],
[
94,
95
],
[
94,
96
],
[
37,
97
],
[
97,
98
],
[
97,
99
],
[
37,
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
],
[
115,
117
],
[
37,
118
],
[
118,
119
],
[
119,
120
],
[
119,
121
],
[
118,
122
],
[
122,
123
],
[
123,
124
],
[
124,
125
],
[
125,
126
],
[
125,
127
],
[
123,
128
],
[
118,
129
],
[
129,
130
],
[
130,
131
],
[
131,
132
],
[
132,
133
],
[
132,
134
],
[
130,
135
],
[
135,
136
],
[
135,
137
],
[
35,
138
],
[
138,
139
],
[
147,
140
],
[
140,
141
],
[
140,
142
],
[
147,
143
],
[
143,
144
],
[
143,
145
],
[
0,
146
],
[
146,
147
],
[
146,
148
]
] |
[
"import java.util.*;\nimport java.util.stream.Collectors;\nimport java.io.*;\nimport java.nio.charset.StandardCharsets;\n\npublic class Main {\n\n\tpublic static void main(String[] args) throws IOException {\n\t\tInputStreamReader reader = new InputStreamReader(System.in, StandardCharsets.UTF_8);\n\t\tBufferedReader in = new BufferedReader(reader);\n\t\tMain ins = new Main(in);\n\t\tins.calc();\n\t\tins.showResult();\n\t}\n\n\tMain(BufferedReader in) throws IOException {\n\t\tString[] tokens = in.readLine().split(\" \");\n\t\tint N = Integer.parseInt(tokens[0]);\n\t\tint M = Integer.parseInt(tokens[1]);\n\t\tint[] A = new int[M];\n\t\ttokens = in.readLine().split(\" \");\n\t\tfor (int i = 0; i < M; ++i) {\n\t\t\tA[i] = Integer.parseInt(tokens[i]);\n\t\t}\n\t\tlong sum = 0;\n\t\tfor (int i = 0; i < M; ++i) {\n\t\t\tsum += A[i];\n\t\t}\n\t\tif (sum > N) {\n\t\t\tSystem.out.println(\"-1\");\n\t\t} else {\n\t\t\tSystem.out.println((N - sum));\n\t\t}\n\t}\n\n\tvoid calc() {\n\t}\n\n\tvoid showResult() {\n\t}\n}",
"import java.util.*;",
"util.*",
"java",
"import java.util.stream.Collectors;",
"Collectors",
"java.util.stream",
"import java.io.*;",
"io.*",
"java",
"import java.nio.charset.StandardCharsets;",
"StandardCharsets",
"java.nio.charset",
"public class Main {\n\n\tpublic static void main(String[] args) throws IOException {\n\t\tInputStreamReader reader = new InputStreamReader(System.in, StandardCharsets.UTF_8);\n\t\tBufferedReader in = new BufferedReader(reader);\n\t\tMain ins = new Main(in);\n\t\tins.calc();\n\t\tins.showResult();\n\t}\n\n\tMain(BufferedReader in) throws IOException {\n\t\tString[] tokens = in.readLine().split(\" \");\n\t\tint N = Integer.parseInt(tokens[0]);\n\t\tint M = Integer.parseInt(tokens[1]);\n\t\tint[] A = new int[M];\n\t\ttokens = in.readLine().split(\" \");\n\t\tfor (int i = 0; i < M; ++i) {\n\t\t\tA[i] = Integer.parseInt(tokens[i]);\n\t\t}\n\t\tlong sum = 0;\n\t\tfor (int i = 0; i < M; ++i) {\n\t\t\tsum += A[i];\n\t\t}\n\t\tif (sum > N) {\n\t\t\tSystem.out.println(\"-1\");\n\t\t} else {\n\t\t\tSystem.out.println((N - sum));\n\t\t}\n\t}\n\n\tvoid calc() {\n\t}\n\n\tvoid showResult() {\n\t}\n}",
"Main",
"public static void main(String[] args) throws IOException {\n\t\tInputStreamReader reader = new InputStreamReader(System.in, StandardCharsets.UTF_8);\n\t\tBufferedReader in = new BufferedReader(reader);\n\t\tMain ins = new Main(in);\n\t\tins.calc();\n\t\tins.showResult();\n\t}",
"main",
"{\n\t\tInputStreamReader reader = new InputStreamReader(System.in, StandardCharsets.UTF_8);\n\t\tBufferedReader in = new BufferedReader(reader);\n\t\tMain ins = new Main(in);\n\t\tins.calc();\n\t\tins.showResult();\n\t}",
"InputStreamReader reader = new InputStreamReader(System.in, StandardCharsets.UTF_8);",
"reader",
"new InputStreamReader(System.in, StandardCharsets.UTF_8)",
"BufferedReader in = new BufferedReader(reader);",
"in",
"new BufferedReader(reader)",
"Main ins = new Main(in);",
"ins",
"new Main(in)",
"ins.calc()",
"ins.calc",
"ins",
"ins.showResult()",
"ins.showResult",
"ins",
"String[] args",
"args",
"Main(BufferedReader in) throws IOException {\n\t\tString[] tokens = in.readLine().split(\" \");\n\t\tint N = Integer.parseInt(tokens[0]);\n\t\tint M = Integer.parseInt(tokens[1]);\n\t\tint[] A = new int[M];\n\t\ttokens = in.readLine().split(\" \");\n\t\tfor (int i = 0; i < M; ++i) {\n\t\t\tA[i] = Integer.parseInt(tokens[i]);\n\t\t}\n\t\tlong sum = 0;\n\t\tfor (int i = 0; i < M; ++i) {\n\t\t\tsum += A[i];\n\t\t}\n\t\tif (sum > N) {\n\t\t\tSystem.out.println(\"-1\");\n\t\t} else {\n\t\t\tSystem.out.println((N - sum));\n\t\t}\n\t}",
"Main",
"{\n\t\tString[] tokens = in.readLine().split(\" \");\n\t\tint N = Integer.parseInt(tokens[0]);\n\t\tint M = Integer.parseInt(tokens[1]);\n\t\tint[] A = new int[M];\n\t\ttokens = in.readLine().split(\" \");\n\t\tfor (int i = 0; i < M; ++i) {\n\t\t\tA[i] = Integer.parseInt(tokens[i]);\n\t\t}\n\t\tlong sum = 0;\n\t\tfor (int i = 0; i < M; ++i) {\n\t\t\tsum += A[i];\n\t\t}\n\t\tif (sum > N) {\n\t\t\tSystem.out.println(\"-1\");\n\t\t} else {\n\t\t\tSystem.out.println((N - sum));\n\t\t}\n\t}",
"String[] tokens = in.readLine().split(\" \");",
"tokens",
"in.readLine().split(\" \")",
"in.readLine().split",
"in.readLine()",
"in.readLine",
"in",
"\" \"",
"int N = Integer.parseInt(tokens[0]);",
"N",
"Integer.parseInt(tokens[0])",
"Integer.parseInt",
"Integer",
"tokens[0]",
"tokens",
"0",
"int M = Integer.parseInt(tokens[1]);",
"M",
"Integer.parseInt(tokens[1])",
"Integer.parseInt",
"Integer",
"tokens[1]",
"tokens",
"1",
"int[] A = new int[M];",
"A",
"new int[M]",
"M",
"tokens = in.readLine().split(\" \")",
"tokens",
"in.readLine().split(\" \")",
"in.readLine().split",
"in.readLine()",
"in.readLine",
"in",
"\" \"",
"for (int i = 0; i < M; ++i) {\n\t\t\tA[i] = Integer.parseInt(tokens[i]);\n\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < M",
"i",
"M",
"++i",
"++i",
"i",
"{\n\t\t\tA[i] = Integer.parseInt(tokens[i]);\n\t\t}",
"{\n\t\t\tA[i] = Integer.parseInt(tokens[i]);\n\t\t}",
"A[i] = Integer.parseInt(tokens[i])",
"A[i]",
"A",
"i",
"Integer.parseInt(tokens[i])",
"Integer.parseInt",
"Integer",
"tokens[i]",
"tokens",
"i",
"long sum = 0;",
"sum",
"0",
"for (int i = 0; i < M; ++i) {\n\t\t\tsum += A[i];\n\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < M",
"i",
"M",
"++i",
"++i",
"i",
"{\n\t\t\tsum += A[i];\n\t\t}",
"{\n\t\t\tsum += A[i];\n\t\t}",
"sum += A[i]",
"sum",
"A[i]",
"A",
"i",
"if (sum > N) {\n\t\t\tSystem.out.println(\"-1\");\n\t\t} else {\n\t\t\tSystem.out.println((N - sum));\n\t\t}",
"sum > N",
"sum",
"N",
"{\n\t\t\tSystem.out.println(\"-1\");\n\t\t}",
"System.out.println(\"-1\")",
"System.out.println",
"System.out",
"System",
"System.out",
"\"-1\"",
"{\n\t\t\tSystem.out.println((N - sum));\n\t\t}",
"System.out.println((N - sum))",
"System.out.println",
"System.out",
"System",
"System.out",
"(N - sum)",
"N",
"sum",
"BufferedReader in",
"in",
"void calc() {\n\t}",
"calc",
"{\n\t}",
"void showResult() {\n\t}",
"showResult",
"{\n\t}",
"public class Main {\n\n\tpublic static void main(String[] args) throws IOException {\n\t\tInputStreamReader reader = new InputStreamReader(System.in, StandardCharsets.UTF_8);\n\t\tBufferedReader in = new BufferedReader(reader);\n\t\tMain ins = new Main(in);\n\t\tins.calc();\n\t\tins.showResult();\n\t}\n\n\tMain(BufferedReader in) throws IOException {\n\t\tString[] tokens = in.readLine().split(\" \");\n\t\tint N = Integer.parseInt(tokens[0]);\n\t\tint M = Integer.parseInt(tokens[1]);\n\t\tint[] A = new int[M];\n\t\ttokens = in.readLine().split(\" \");\n\t\tfor (int i = 0; i < M; ++i) {\n\t\t\tA[i] = Integer.parseInt(tokens[i]);\n\t\t}\n\t\tlong sum = 0;\n\t\tfor (int i = 0; i < M; ++i) {\n\t\t\tsum += A[i];\n\t\t}\n\t\tif (sum > N) {\n\t\t\tSystem.out.println(\"-1\");\n\t\t} else {\n\t\t\tSystem.out.println((N - sum));\n\t\t}\n\t}\n\n\tvoid calc() {\n\t}\n\n\tvoid showResult() {\n\t}\n}",
"public class Main {\n\n\tpublic static void main(String[] args) throws IOException {\n\t\tInputStreamReader reader = new InputStreamReader(System.in, StandardCharsets.UTF_8);\n\t\tBufferedReader in = new BufferedReader(reader);\n\t\tMain ins = new Main(in);\n\t\tins.calc();\n\t\tins.showResult();\n\t}\n\n\tMain(BufferedReader in) throws IOException {\n\t\tString[] tokens = in.readLine().split(\" \");\n\t\tint N = Integer.parseInt(tokens[0]);\n\t\tint M = Integer.parseInt(tokens[1]);\n\t\tint[] A = new int[M];\n\t\ttokens = in.readLine().split(\" \");\n\t\tfor (int i = 0; i < M; ++i) {\n\t\t\tA[i] = Integer.parseInt(tokens[i]);\n\t\t}\n\t\tlong sum = 0;\n\t\tfor (int i = 0; i < M; ++i) {\n\t\t\tsum += A[i];\n\t\t}\n\t\tif (sum > N) {\n\t\t\tSystem.out.println(\"-1\");\n\t\t} else {\n\t\t\tSystem.out.println((N - sum));\n\t\t}\n\t}\n\n\tvoid calc() {\n\t}\n\n\tvoid showResult() {\n\t}\n}",
"Main"
] |
import java.util.*;
import java.util.stream.Collectors;
import java.io.*;
import java.nio.charset.StandardCharsets;
public class Main {
public static void main(String[] args) throws IOException {
InputStreamReader reader = new InputStreamReader(System.in, StandardCharsets.UTF_8);
BufferedReader in = new BufferedReader(reader);
Main ins = new Main(in);
ins.calc();
ins.showResult();
}
Main(BufferedReader in) throws IOException {
String[] tokens = in.readLine().split(" ");
int N = Integer.parseInt(tokens[0]);
int M = Integer.parseInt(tokens[1]);
int[] A = new int[M];
tokens = in.readLine().split(" ");
for (int i = 0; i < M; ++i) {
A[i] = Integer.parseInt(tokens[i]);
}
long sum = 0;
for (int i = 0; i < M; ++i) {
sum += A[i];
}
if (sum > N) {
System.out.println("-1");
} else {
System.out.println((N - sum));
}
}
void calc() {
}
void showResult() {
}
}
|
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
41,
13,
20,
41,
13,
20,
12,
13,
30,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
4,
18,
13,
4,
18,
13,
4,
18,
13,
40,
17,
13,
12,
13,
30,
4,
18,
13,
4,
18,
13,
12,
13,
30,
38,
30,
41,
13,
20,
4,
18,
13,
23,
13,
6,
13,
41,
13,
41,
13,
12,
13,
30,
0,
13,
20,
0,
13,
17,
23,
13,
12,
13,
30,
42,
2,
2,
13,
17,
40,
4,
18,
13,
30,
38,
5,
13,
30,
37,
20,
30,
0,
13,
20,
29,
4,
18,
13,
12,
13,
30,
29,
4,
18,
13,
4,
13,
12,
13,
30,
29,
4,
18,
13,
4,
13,
12,
13,
30,
4,
18,
13,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
10,
11
],
[
10,
12
],
[
0,
13
],
[
13,
14
],
[
13,
15
],
[
0,
16
],
[
16,
17
],
[
16,
18
],
[
0,
19
],
[
19,
20
],
[
19,
21
],
[
0,
22
],
[
162,
23
],
[
162,
24
],
[
24,
25
],
[
24,
26
],
[
162,
27
],
[
27,
28
],
[
27,
29
],
[
162,
30
],
[
30,
31
],
[
30,
32
],
[
32,
33
],
[
33,
34
],
[
33,
35
],
[
35,
36
],
[
36,
37
],
[
32,
38
],
[
38,
39
],
[
38,
40
],
[
40,
41
],
[
41,
42
],
[
32,
43
],
[
43,
44
],
[
44,
45
],
[
45,
46
],
[
45,
47
],
[
43,
48
],
[
48,
49
],
[
48,
50
],
[
43,
51
],
[
51,
52
],
[
52,
53
],
[
43,
54
],
[
55,
55
],
[
55,
56
],
[
56,
57
],
[
56,
58
],
[
58,
59
],
[
59,
60
],
[
32,
61
],
[
61,
62
],
[
62,
63
],
[
61,
64
],
[
64,
65
],
[
65,
66
],
[
64,
67
],
[
67,
68
],
[
64,
69
],
[
162,
70
],
[
70,
71
],
[
70,
72
],
[
72,
73
],
[
73,
74
],
[
74,
75
],
[
72,
76
],
[
76,
77
],
[
77,
78
],
[
162,
79
],
[
79,
80
],
[
79,
81
],
[
81,
82
],
[
82,
83
],
[
83,
84
],
[
84,
85
],
[
84,
86
],
[
83,
87
],
[
87,
88
],
[
88,
89
],
[
79,
90
],
[
90,
91
],
[
162,
92
],
[
92,
93
],
[
92,
94
],
[
94,
95
],
[
92,
96
],
[
96,
97
],
[
92,
98
],
[
98,
99
],
[
98,
100
],
[
100,
101
],
[
101,
102
],
[
101,
103
],
[
100,
104
],
[
104,
105
],
[
104,
106
],
[
98,
107
],
[
107,
108
],
[
92,
109
],
[
109,
110
],
[
109,
111
],
[
111,
112
],
[
112,
113
],
[
113,
114
],
[
114,
115
],
[
114,
116
],
[
113,
117
],
[
117,
118
],
[
118,
119
],
[
119,
120
],
[
112,
121
],
[
121,
122
],
[
122,
123
],
[
123,
124
],
[
123,
125
],
[
125,
126
],
[
126,
127
],
[
122,
128
],
[
128,
129
],
[
129,
130
],
[
129,
131
],
[
111,
132
],
[
132,
133
],
[
133,
134
],
[
134,
135
],
[
92,
136
],
[
136,
137
],
[
136,
138
],
[
138,
139
],
[
139,
140
],
[
140,
141
],
[
141,
142
],
[
140,
143
],
[
143,
144
],
[
92,
145
],
[
145,
146
],
[
145,
147
],
[
147,
148
],
[
148,
149
],
[
149,
150
],
[
150,
151
],
[
149,
152
],
[
152,
153
],
[
92,
154
],
[
154,
155
],
[
154,
156
],
[
156,
157
],
[
157,
158
],
[
158,
159
],
[
162,
160
],
[
0,
161
],
[
161,
162
],
[
161,
163
]
] |
[
"\nimport java.io.BufferedReader;\nimport java.io.Closeable;\nimport java.io.IOException;\nimport java.io.InputStream;\nimport java.io.InputStreamReader;\nimport java.io.PrintWriter;\nimport java.util.StringTokenizer;\n\npublic class Main implements Closeable {\n\n private InputReader in = new InputReader(System.in);\n private PrintWriter out = new PrintWriter(System.out);\n\n public void solve() {\n int n = in.ni(), m = in.ni();\n for (int i = 0; i < m; i++) {\n n -= in.ni();\n }\n out.println(Math.max(-1, n));\n }\n\n @Override\n public void close() throws IOException {\n in.close();\n out.close();\n }\n\n static class InputReader {\n public BufferedReader reader;\n public StringTokenizer tokenizer;\n\n public InputReader(InputStream stream) {\n reader = new BufferedReader(new InputStreamReader(stream), 32768);\n tokenizer = null;\n }\n\n public String next() {\n while (tokenizer == null || !tokenizer.hasMoreTokens()) {\n try {\n tokenizer = new StringTokenizer(reader.readLine());\n } catch (IOException e) {\n throw new RuntimeException(e);\n }\n }\n return tokenizer.nextToken();\n }\n\n public int ni() {\n return Integer.parseInt(next());\n }\n\n public long nl() {\n return Long.parseLong(next());\n }\n\n public void close() throws IOException {\n reader.close();\n }\n }\n\n public static void main(String[] args) throws IOException {\n try (Main instance = new Main()) {\n instance.solve();\n }\n }\n}",
"import java.io.BufferedReader;",
"BufferedReader",
"java.io",
"import java.io.Closeable;",
"Closeable",
"java.io",
"import java.io.IOException;",
"IOException",
"java.io",
"import java.io.InputStream;",
"InputStream",
"java.io",
"import java.io.InputStreamReader;",
"InputStreamReader",
"java.io",
"import java.io.PrintWriter;",
"PrintWriter",
"java.io",
"import java.util.StringTokenizer;",
"StringTokenizer",
"java.util",
"public class Main implements Closeable {\n\n private InputReader in = new InputReader(System.in);\n private PrintWriter out = new PrintWriter(System.out);\n\n public void solve() {\n int n = in.ni(), m = in.ni();\n for (int i = 0; i < m; i++) {\n n -= in.ni();\n }\n out.println(Math.max(-1, n));\n }\n\n @Override\n public void close() throws IOException {\n in.close();\n out.close();\n }\n\n static class InputReader {\n public BufferedReader reader;\n public StringTokenizer tokenizer;\n\n public InputReader(InputStream stream) {\n reader = new BufferedReader(new InputStreamReader(stream), 32768);\n tokenizer = null;\n }\n\n public String next() {\n while (tokenizer == null || !tokenizer.hasMoreTokens()) {\n try {\n tokenizer = new StringTokenizer(reader.readLine());\n } catch (IOException e) {\n throw new RuntimeException(e);\n }\n }\n return tokenizer.nextToken();\n }\n\n public int ni() {\n return Integer.parseInt(next());\n }\n\n public long nl() {\n return Long.parseLong(next());\n }\n\n public void close() throws IOException {\n reader.close();\n }\n }\n\n public static void main(String[] args) throws IOException {\n try (Main instance = new Main()) {\n instance.solve();\n }\n }\n}",
"Main",
"private InputReader in = new InputReader(System.in);",
"in",
"new InputReader(System.in)",
"private PrintWriter out = new PrintWriter(System.out);",
"out",
"new PrintWriter(System.out)",
"public void solve() {\n int n = in.ni(), m = in.ni();\n for (int i = 0; i < m; i++) {\n n -= in.ni();\n }\n out.println(Math.max(-1, n));\n }",
"solve",
"{\n int n = in.ni(), m = in.ni();\n for (int i = 0; i < m; i++) {\n n -= in.ni();\n }\n out.println(Math.max(-1, n));\n }",
"int n = in.ni()",
"n",
"in.ni()",
"in.ni",
"in",
"m = in.ni();",
"m",
"in.ni()",
"in.ni",
"in",
"for (int i = 0; i < m; i++) {\n n -= in.ni();\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < m",
"i",
"m",
"i++",
"i++",
"i",
"{\n n -= in.ni();\n }",
"{\n n -= in.ni();\n }",
"n -= in.ni()",
"n",
"in.ni()",
"in.ni",
"in",
"out.println(Math.max(-1, n))",
"out.println",
"out",
"Math.max(-1, n)",
"Math.max",
"Math",
"-1",
"1",
"n",
"@Override\n public void close() throws IOException {\n in.close();\n out.close();\n }",
"close",
"{\n in.close();\n out.close();\n }",
"in.close()",
"in.close",
"in",
"out.close()",
"out.close",
"out",
"public static void main(String[] args) throws IOException {\n try (Main instance = new Main()) {\n instance.solve();\n }\n }",
"main",
"{\n try (Main instance = new Main()) {\n instance.solve();\n }\n }",
"try (Main instance = new Main()) {\n instance.solve();\n }",
"{\n instance.solve();\n }",
"Main instance = new Main()",
"Main instance = new Main()",
"new Main()",
"instance.solve()",
"instance.solve",
"instance",
"String[] args",
"args",
"static class InputReader {\n public BufferedReader reader;\n public StringTokenizer tokenizer;\n\n public InputReader(InputStream stream) {\n reader = new BufferedReader(new InputStreamReader(stream), 32768);\n tokenizer = null;\n }\n\n public String next() {\n while (tokenizer == null || !tokenizer.hasMoreTokens()) {\n try {\n tokenizer = new StringTokenizer(reader.readLine());\n } catch (IOException e) {\n throw new RuntimeException(e);\n }\n }\n return tokenizer.nextToken();\n }\n\n public int ni() {\n return Integer.parseInt(next());\n }\n\n public long nl() {\n return Long.parseLong(next());\n }\n\n public void close() throws IOException {\n reader.close();\n }\n }",
"InputReader",
"public BufferedReader reader;",
"reader",
"public StringTokenizer tokenizer;",
"tokenizer",
"public InputReader(InputStream stream) {\n reader = new BufferedReader(new InputStreamReader(stream), 32768);\n tokenizer = null;\n }",
"InputReader",
"{\n reader = new BufferedReader(new InputStreamReader(stream), 32768);\n tokenizer = null;\n }",
"reader = new BufferedReader(new InputStreamReader(stream), 32768)",
"reader",
"new BufferedReader(new InputStreamReader(stream), 32768)",
"tokenizer = null",
"tokenizer",
"null",
"InputStream stream",
"stream",
"public String next() {\n while (tokenizer == null || !tokenizer.hasMoreTokens()) {\n try {\n tokenizer = new StringTokenizer(reader.readLine());\n } catch (IOException e) {\n throw new RuntimeException(e);\n }\n }\n return tokenizer.nextToken();\n }",
"next",
"{\n while (tokenizer == null || !tokenizer.hasMoreTokens()) {\n try {\n tokenizer = new StringTokenizer(reader.readLine());\n } catch (IOException e) {\n throw new RuntimeException(e);\n }\n }\n return tokenizer.nextToken();\n }",
"while (tokenizer == null || !tokenizer.hasMoreTokens()) {\n try {\n tokenizer = new StringTokenizer(reader.readLine());\n } catch (IOException e) {\n throw new RuntimeException(e);\n }\n }",
"tokenizer == null || !tokenizer.hasMoreTokens()",
"tokenizer == null",
"tokenizer",
"null",
"!tokenizer.hasMoreTokens()",
"tokenizer.hasMoreTokens()",
"tokenizer.hasMoreTokens",
"tokenizer",
"{\n try {\n tokenizer = new StringTokenizer(reader.readLine());\n } catch (IOException e) {\n throw new RuntimeException(e);\n }\n }",
"try {\n tokenizer = new StringTokenizer(reader.readLine());\n } catch (IOException e) {\n throw new RuntimeException(e);\n }",
"catch (IOException e) {\n throw new RuntimeException(e);\n }",
"IOException e",
"{\n throw new RuntimeException(e);\n }",
"throw new RuntimeException(e);",
"new RuntimeException(e)",
"{\n tokenizer = new StringTokenizer(reader.readLine());\n }",
"tokenizer = new StringTokenizer(reader.readLine())",
"tokenizer",
"new StringTokenizer(reader.readLine())",
"return tokenizer.nextToken();",
"tokenizer.nextToken()",
"tokenizer.nextToken",
"tokenizer",
"public int ni() {\n return Integer.parseInt(next());\n }",
"ni",
"{\n return Integer.parseInt(next());\n }",
"return Integer.parseInt(next());",
"Integer.parseInt(next())",
"Integer.parseInt",
"Integer",
"next()",
"next",
"public long nl() {\n return Long.parseLong(next());\n }",
"nl",
"{\n return Long.parseLong(next());\n }",
"return Long.parseLong(next());",
"Long.parseLong(next())",
"Long.parseLong",
"Long",
"next()",
"next",
"public void close() throws IOException {\n reader.close();\n }",
"close",
"{\n reader.close();\n }",
"reader.close()",
"reader.close",
"reader",
"Closeable",
"public class Main implements Closeable {\n\n private InputReader in = new InputReader(System.in);\n private PrintWriter out = new PrintWriter(System.out);\n\n public void solve() {\n int n = in.ni(), m = in.ni();\n for (int i = 0; i < m; i++) {\n n -= in.ni();\n }\n out.println(Math.max(-1, n));\n }\n\n @Override\n public void close() throws IOException {\n in.close();\n out.close();\n }\n\n static class InputReader {\n public BufferedReader reader;\n public StringTokenizer tokenizer;\n\n public InputReader(InputStream stream) {\n reader = new BufferedReader(new InputStreamReader(stream), 32768);\n tokenizer = null;\n }\n\n public String next() {\n while (tokenizer == null || !tokenizer.hasMoreTokens()) {\n try {\n tokenizer = new StringTokenizer(reader.readLine());\n } catch (IOException e) {\n throw new RuntimeException(e);\n }\n }\n return tokenizer.nextToken();\n }\n\n public int ni() {\n return Integer.parseInt(next());\n }\n\n public long nl() {\n return Long.parseLong(next());\n }\n\n public void close() throws IOException {\n reader.close();\n }\n }\n\n public static void main(String[] args) throws IOException {\n try (Main instance = new Main()) {\n instance.solve();\n }\n }\n}",
"public class Main implements Closeable {\n\n private InputReader in = new InputReader(System.in);\n private PrintWriter out = new PrintWriter(System.out);\n\n public void solve() {\n int n = in.ni(), m = in.ni();\n for (int i = 0; i < m; i++) {\n n -= in.ni();\n }\n out.println(Math.max(-1, n));\n }\n\n @Override\n public void close() throws IOException {\n in.close();\n out.close();\n }\n\n static class InputReader {\n public BufferedReader reader;\n public StringTokenizer tokenizer;\n\n public InputReader(InputStream stream) {\n reader = new BufferedReader(new InputStreamReader(stream), 32768);\n tokenizer = null;\n }\n\n public String next() {\n while (tokenizer == null || !tokenizer.hasMoreTokens()) {\n try {\n tokenizer = new StringTokenizer(reader.readLine());\n } catch (IOException e) {\n throw new RuntimeException(e);\n }\n }\n return tokenizer.nextToken();\n }\n\n public int ni() {\n return Integer.parseInt(next());\n }\n\n public long nl() {\n return Long.parseLong(next());\n }\n\n public void close() throws IOException {\n reader.close();\n }\n }\n\n public static void main(String[] args) throws IOException {\n try (Main instance = new Main()) {\n instance.solve();\n }\n }\n}",
"Main"
] |
import java.io.BufferedReader;
import java.io.Closeable;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.StringTokenizer;
public class Main implements Closeable {
private InputReader in = new InputReader(System.in);
private PrintWriter out = new PrintWriter(System.out);
public void solve() {
int n = in.ni(), m = in.ni();
for (int i = 0; i < m; i++) {
n -= in.ni();
}
out.println(Math.max(-1, n));
}
@Override
public void close() throws IOException {
in.close();
out.close();
}
static class InputReader {
public BufferedReader reader;
public StringTokenizer tokenizer;
public InputReader(InputStream stream) {
reader = new BufferedReader(new InputStreamReader(stream), 32768);
tokenizer = null;
}
public String next() {
while (tokenizer == null || !tokenizer.hasMoreTokens()) {
try {
tokenizer = new StringTokenizer(reader.readLine());
} catch (IOException e) {
throw new RuntimeException(e);
}
}
return tokenizer.nextToken();
}
public int ni() {
return Integer.parseInt(next());
}
public long nl() {
return Long.parseLong(next());
}
public void close() throws IOException {
reader.close();
}
}
public static void main(String[] args) throws IOException {
try (Main instance = new Main()) {
instance.solve();
}
}
}
|
[
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,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
4,
18,
13,
14,
2,
17,
2,
13,
13,
30,
4,
18,
18,
13,
13,
2,
13,
13,
30,
4,
18,
18,
13,
13,
40,
17,
4,
18,
13,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
72,
5
],
[
72,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
8,
17
],
[
17,
18
],
[
17,
19
],
[
19,
20
],
[
20,
21
],
[
8,
22
],
[
22,
23
],
[
22,
24
],
[
8,
25
],
[
25,
26
],
[
26,
27
],
[
27,
28
],
[
27,
29
],
[
25,
30
],
[
30,
31
],
[
30,
32
],
[
25,
33
],
[
33,
34
],
[
34,
35
],
[
25,
36
],
[
37,
37
],
[
37,
38
],
[
38,
39
],
[
38,
40
],
[
40,
41
],
[
41,
42
],
[
8,
43
],
[
43,
44
],
[
44,
45
],
[
44,
46
],
[
46,
47
],
[
46,
48
],
[
43,
49
],
[
49,
50
],
[
50,
51
],
[
51,
52
],
[
52,
53
],
[
52,
54
],
[
50,
55
],
[
55,
56
],
[
55,
57
],
[
43,
58
],
[
58,
59
],
[
59,
60
],
[
60,
61
],
[
61,
62
],
[
61,
63
],
[
59,
64
],
[
64,
65
],
[
8,
66
],
[
66,
67
],
[
67,
68
],
[
6,
69
],
[
69,
70
],
[
0,
71
],
[
71,
72
],
[
71,
73
]
] |
[
"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\tint n = sc.nextInt();\n\t\tint m = sc.nextInt();\n\t\tint sum = 0;\n\t\tfor(int i = 0; i < m; i++) {\n\t\t\tsum += sc.nextInt();\n\t\t}\n\n\t\tif(0 <= n - sum) {\n\t\t\tSystem.out.println(n - sum);\n\t\t}else {\n\t\t\tSystem.out.println(-1);\n\t\t}\n\t\tsc.close();\n\t}\n\t\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n \n\tpublic static void main(String[] args) {\n\t\t\n\t\tScanner sc = new Scanner(System.in);\n\t\tint n = sc.nextInt();\n\t\tint m = sc.nextInt();\n\t\tint sum = 0;\n\t\tfor(int i = 0; i < m; i++) {\n\t\t\tsum += sc.nextInt();\n\t\t}\n\n\t\tif(0 <= n - sum) {\n\t\t\tSystem.out.println(n - sum);\n\t\t}else {\n\t\t\tSystem.out.println(-1);\n\t\t}\n\t\tsc.close();\n\t}\n\t\n}",
"Main",
"public static void main(String[] args) {\n\t\t\n\t\tScanner sc = new Scanner(System.in);\n\t\tint n = sc.nextInt();\n\t\tint m = sc.nextInt();\n\t\tint sum = 0;\n\t\tfor(int i = 0; i < m; i++) {\n\t\t\tsum += sc.nextInt();\n\t\t}\n\n\t\tif(0 <= n - sum) {\n\t\t\tSystem.out.println(n - sum);\n\t\t}else {\n\t\t\tSystem.out.println(-1);\n\t\t}\n\t\tsc.close();\n\t}",
"main",
"{\n\t\t\n\t\tScanner sc = new Scanner(System.in);\n\t\tint n = sc.nextInt();\n\t\tint m = sc.nextInt();\n\t\tint sum = 0;\n\t\tfor(int i = 0; i < m; i++) {\n\t\t\tsum += sc.nextInt();\n\t\t}\n\n\t\tif(0 <= n - sum) {\n\t\t\tSystem.out.println(n - sum);\n\t\t}else {\n\t\t\tSystem.out.println(-1);\n\t\t}\n\t\tsc.close();\n\t}",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"int n = sc.nextInt();",
"n",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int m = sc.nextInt();",
"m",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int sum = 0;",
"sum",
"0",
"for(int i = 0; i < m; i++) {\n\t\t\tsum += sc.nextInt();\n\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < m",
"i",
"m",
"i++",
"i++",
"i",
"{\n\t\t\tsum += sc.nextInt();\n\t\t}",
"{\n\t\t\tsum += sc.nextInt();\n\t\t}",
"sum += sc.nextInt()",
"sum",
"sc.nextInt()",
"sc.nextInt",
"sc",
"if(0 <= n - sum) {\n\t\t\tSystem.out.println(n - sum);\n\t\t}else {\n\t\t\tSystem.out.println(-1);\n\t\t}",
"0 <= n - sum",
"0",
"n - sum",
"n",
"sum",
"{\n\t\t\tSystem.out.println(n - sum);\n\t\t}",
"System.out.println(n - sum)",
"System.out.println",
"System.out",
"System",
"System.out",
"n - sum",
"n",
"sum",
"{\n\t\t\tSystem.out.println(-1);\n\t\t}",
"System.out.println(-1)",
"System.out.println",
"System.out",
"System",
"System.out",
"-1",
"1",
"sc.close()",
"sc.close",
"sc",
"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 n = sc.nextInt();\n\t\tint m = sc.nextInt();\n\t\tint sum = 0;\n\t\tfor(int i = 0; i < m; i++) {\n\t\t\tsum += sc.nextInt();\n\t\t}\n\n\t\tif(0 <= n - sum) {\n\t\t\tSystem.out.println(n - sum);\n\t\t}else {\n\t\t\tSystem.out.println(-1);\n\t\t}\n\t\tsc.close();\n\t}\n\t\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 n = sc.nextInt();\n\t\tint m = sc.nextInt();\n\t\tint sum = 0;\n\t\tfor(int i = 0; i < m; i++) {\n\t\t\tsum += sc.nextInt();\n\t\t}\n\n\t\tif(0 <= n - sum) {\n\t\t\tSystem.out.println(n - sum);\n\t\t}else {\n\t\t\tSystem.out.println(-1);\n\t\t}\n\t\tsc.close();\n\t}\n\t\n}",
"Main"
] |
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
int m = sc.nextInt();
int sum = 0;
for(int i = 0; i < m; i++) {
sum += sc.nextInt();
}
if(0 <= n - sum) {
System.out.println(n - sum);
}else {
System.out.println(-1);
}
sc.close();
}
}
|
[
7,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
18,
13,
13,
41,
13,
18,
13,
13,
41,
13,
20,
41,
13,
20,
41,
13,
20,
4,
18,
13,
17,
13,
13,
4,
18,
13,
23,
13,
6,
13,
12,
13,
30,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
4,
18,
13,
4,
18,
13,
8,
2,
2,
13,
13,
17,
2,
13,
13,
40,
17,
23,
13,
23,
13,
23,
13,
6,
13,
41,
13,
41,
13,
12,
13,
30,
0,
13,
20,
0,
13,
17,
23,
13,
12,
13,
30,
42,
2,
2,
13,
17,
40,
4,
18,
13,
30,
38,
5,
13,
30,
37,
20,
30,
0,
13,
20,
29,
4,
18,
13,
12,
13,
30,
29,
4,
18,
13,
4,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
152,
8
],
[
152,
9
],
[
9,
10
],
[
9,
11
],
[
11,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
14,
16
],
[
11,
17
],
[
17,
18
],
[
17,
19
],
[
19,
20
],
[
19,
21
],
[
11,
22
],
[
22,
23
],
[
22,
24
],
[
11,
25
],
[
25,
26
],
[
25,
27
],
[
11,
28
],
[
28,
29
],
[
28,
30
],
[
11,
31
],
[
31,
32
],
[
32,
33
],
[
31,
34
],
[
31,
35
],
[
31,
36
],
[
11,
37
],
[
37,
38
],
[
38,
39
],
[
9,
40
],
[
40,
41
],
[
152,
42
],
[
42,
43
],
[
42,
44
],
[
44,
45
],
[
44,
46
],
[
46,
47
],
[
47,
48
],
[
47,
49
],
[
49,
50
],
[
50,
51
],
[
46,
52
],
[
52,
53
],
[
52,
54
],
[
54,
55
],
[
55,
56
],
[
46,
57
],
[
57,
58
],
[
57,
59
],
[
46,
60
],
[
60,
61
],
[
61,
62
],
[
62,
63
],
[
62,
64
],
[
60,
65
],
[
65,
66
],
[
65,
67
],
[
60,
68
],
[
68,
69
],
[
69,
70
],
[
60,
71
],
[
72,
72
],
[
72,
73
],
[
73,
74
],
[
73,
75
],
[
75,
76
],
[
76,
77
],
[
46,
78
],
[
78,
79
],
[
79,
80
],
[
78,
81
],
[
81,
82
],
[
82,
83
],
[
83,
84
],
[
83,
85
],
[
82,
86
],
[
81,
87
],
[
87,
88
],
[
87,
89
],
[
81,
90
],
[
90,
91
],
[
44,
92
],
[
92,
93
],
[
44,
94
],
[
94,
95
],
[
44,
96
],
[
96,
97
],
[
152,
98
],
[
98,
99
],
[
98,
100
],
[
100,
101
],
[
98,
102
],
[
102,
103
],
[
98,
104
],
[
104,
105
],
[
104,
106
],
[
106,
107
],
[
107,
108
],
[
107,
109
],
[
106,
110
],
[
110,
111
],
[
110,
112
],
[
104,
113
],
[
113,
114
],
[
98,
115
],
[
115,
116
],
[
115,
117
],
[
117,
118
],
[
118,
119
],
[
119,
120
],
[
120,
121
],
[
120,
122
],
[
119,
123
],
[
123,
124
],
[
124,
125
],
[
125,
126
],
[
118,
127
],
[
127,
128
],
[
128,
129
],
[
129,
130
],
[
129,
131
],
[
131,
132
],
[
132,
133
],
[
128,
134
],
[
134,
135
],
[
135,
136
],
[
135,
137
],
[
117,
138
],
[
138,
139
],
[
139,
140
],
[
140,
141
],
[
98,
142
],
[
142,
143
],
[
142,
144
],
[
144,
145
],
[
145,
146
],
[
146,
147
],
[
147,
148
],
[
146,
149
],
[
149,
150
],
[
0,
151
],
[
151,
152
],
[
151,
153
]
] |
[
"//package beginner163.b;\n\nimport java.io.*;\nimport java.util.StringTokenizer;\n\npublic class Main {\n public static void main(String[] args) {\n InputStream inputStream = System.in;\n OutputStream outputStream = System.out;\n InputReader in = new InputReader(inputStream);\n PrintWriter out = new PrintWriter(outputStream);\n TaskB solver = new TaskB();\n solver.solve(1, in, out);\n out.close();\n }\n\n static class TaskB {\n public void solve(int testNumber, InputReader in, PrintWriter out) {\n int n = in.nextInt();\n int m = in.nextInt();\n\n int totalAssignmentTime = 0;\n for (int i = 0; i < m; ++i) {\n totalAssignmentTime += in.nextInt();\n }\n\n out.println(n - totalAssignmentTime >= 0 ? n - totalAssignmentTime : -1);\n }\n }\n\n static class InputReader {\n public BufferedReader reader;\n public StringTokenizer tokenizer;\n\n public InputReader(InputStream stream) {\n reader = new BufferedReader(new InputStreamReader(stream), 32768);\n tokenizer = null;\n }\n\n public String next() {\n while (tokenizer == null || !tokenizer.hasMoreTokens()) {\n try {\n tokenizer = new StringTokenizer(reader.readLine());\n } catch (IOException e) {\n throw new RuntimeException(e);\n }\n }\n return tokenizer.nextToken();\n }\n\n public int nextInt() {\n return Integer.parseInt(next());\n }\n\n }\n}",
"import java.io.*;",
"io.*",
"java",
"import java.util.StringTokenizer;",
"StringTokenizer",
"java.util",
"public class Main {\n public static void main(String[] args) {\n InputStream inputStream = System.in;\n OutputStream outputStream = System.out;\n InputReader in = new InputReader(inputStream);\n PrintWriter out = new PrintWriter(outputStream);\n TaskB solver = new TaskB();\n solver.solve(1, in, out);\n out.close();\n }\n\n static class TaskB {\n public void solve(int testNumber, InputReader in, PrintWriter out) {\n int n = in.nextInt();\n int m = in.nextInt();\n\n int totalAssignmentTime = 0;\n for (int i = 0; i < m; ++i) {\n totalAssignmentTime += in.nextInt();\n }\n\n out.println(n - totalAssignmentTime >= 0 ? n - totalAssignmentTime : -1);\n }\n }\n\n static class InputReader {\n public BufferedReader reader;\n public StringTokenizer tokenizer;\n\n public InputReader(InputStream stream) {\n reader = new BufferedReader(new InputStreamReader(stream), 32768);\n tokenizer = null;\n }\n\n public String next() {\n while (tokenizer == null || !tokenizer.hasMoreTokens()) {\n try {\n tokenizer = new StringTokenizer(reader.readLine());\n } catch (IOException e) {\n throw new RuntimeException(e);\n }\n }\n return tokenizer.nextToken();\n }\n\n public int nextInt() {\n return Integer.parseInt(next());\n }\n\n }\n}",
"Main",
"public static void main(String[] args) {\n InputStream inputStream = System.in;\n OutputStream outputStream = System.out;\n InputReader in = new InputReader(inputStream);\n PrintWriter out = new PrintWriter(outputStream);\n TaskB solver = new TaskB();\n solver.solve(1, in, out);\n out.close();\n }",
"main",
"{\n InputStream inputStream = System.in;\n OutputStream outputStream = System.out;\n InputReader in = new InputReader(inputStream);\n PrintWriter out = new PrintWriter(outputStream);\n TaskB solver = new TaskB();\n solver.solve(1, in, out);\n out.close();\n }",
"InputStream inputStream = System.in;",
"inputStream",
"System.in",
"System",
"System.in",
"OutputStream outputStream = System.out;",
"outputStream",
"System.out",
"System",
"System.out",
"InputReader in = new InputReader(inputStream);",
"in",
"new InputReader(inputStream)",
"PrintWriter out = new PrintWriter(outputStream);",
"out",
"new PrintWriter(outputStream)",
"TaskB solver = new TaskB();",
"solver",
"new TaskB()",
"solver.solve(1, in, out)",
"solver.solve",
"solver",
"1",
"in",
"out",
"out.close()",
"out.close",
"out",
"String[] args",
"args",
"static class TaskB {\n public void solve(int testNumber, InputReader in, PrintWriter out) {\n int n = in.nextInt();\n int m = in.nextInt();\n\n int totalAssignmentTime = 0;\n for (int i = 0; i < m; ++i) {\n totalAssignmentTime += in.nextInt();\n }\n\n out.println(n - totalAssignmentTime >= 0 ? n - totalAssignmentTime : -1);\n }\n }",
"TaskB",
"public void solve(int testNumber, InputReader in, PrintWriter out) {\n int n = in.nextInt();\n int m = in.nextInt();\n\n int totalAssignmentTime = 0;\n for (int i = 0; i < m; ++i) {\n totalAssignmentTime += in.nextInt();\n }\n\n out.println(n - totalAssignmentTime >= 0 ? n - totalAssignmentTime : -1);\n }",
"solve",
"{\n int n = in.nextInt();\n int m = in.nextInt();\n\n int totalAssignmentTime = 0;\n for (int i = 0; i < m; ++i) {\n totalAssignmentTime += in.nextInt();\n }\n\n out.println(n - totalAssignmentTime >= 0 ? n - totalAssignmentTime : -1);\n }",
"int n = in.nextInt();",
"n",
"in.nextInt()",
"in.nextInt",
"in",
"int m = in.nextInt();",
"m",
"in.nextInt()",
"in.nextInt",
"in",
"int totalAssignmentTime = 0;",
"totalAssignmentTime",
"0",
"for (int i = 0; i < m; ++i) {\n totalAssignmentTime += in.nextInt();\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < m",
"i",
"m",
"++i",
"++i",
"i",
"{\n totalAssignmentTime += in.nextInt();\n }",
"{\n totalAssignmentTime += in.nextInt();\n }",
"totalAssignmentTime += in.nextInt()",
"totalAssignmentTime",
"in.nextInt()",
"in.nextInt",
"in",
"out.println(n - totalAssignmentTime >= 0 ? n - totalAssignmentTime : -1)",
"out.println",
"out",
"n - totalAssignmentTime >= 0 ? n - totalAssignmentTime : -1",
"n - totalAssignmentTime >= 0",
"n - totalAssignmentTime",
"n",
"totalAssignmentTime",
"0",
"n - totalAssignmentTime",
"n",
"totalAssignmentTime",
"-1",
"1",
"int testNumber",
"testNumber",
"InputReader in",
"in",
"PrintWriter out",
"out",
"static class InputReader {\n public BufferedReader reader;\n public StringTokenizer tokenizer;\n\n public InputReader(InputStream stream) {\n reader = new BufferedReader(new InputStreamReader(stream), 32768);\n tokenizer = null;\n }\n\n public String next() {\n while (tokenizer == null || !tokenizer.hasMoreTokens()) {\n try {\n tokenizer = new StringTokenizer(reader.readLine());\n } catch (IOException e) {\n throw new RuntimeException(e);\n }\n }\n return tokenizer.nextToken();\n }\n\n public int nextInt() {\n return Integer.parseInt(next());\n }\n\n }",
"InputReader",
"public BufferedReader reader;",
"reader",
"public StringTokenizer tokenizer;",
"tokenizer",
"public InputReader(InputStream stream) {\n reader = new BufferedReader(new InputStreamReader(stream), 32768);\n tokenizer = null;\n }",
"InputReader",
"{\n reader = new BufferedReader(new InputStreamReader(stream), 32768);\n tokenizer = null;\n }",
"reader = new BufferedReader(new InputStreamReader(stream), 32768)",
"reader",
"new BufferedReader(new InputStreamReader(stream), 32768)",
"tokenizer = null",
"tokenizer",
"null",
"InputStream stream",
"stream",
"public String next() {\n while (tokenizer == null || !tokenizer.hasMoreTokens()) {\n try {\n tokenizer = new StringTokenizer(reader.readLine());\n } catch (IOException e) {\n throw new RuntimeException(e);\n }\n }\n return tokenizer.nextToken();\n }",
"next",
"{\n while (tokenizer == null || !tokenizer.hasMoreTokens()) {\n try {\n tokenizer = new StringTokenizer(reader.readLine());\n } catch (IOException e) {\n throw new RuntimeException(e);\n }\n }\n return tokenizer.nextToken();\n }",
"while (tokenizer == null || !tokenizer.hasMoreTokens()) {\n try {\n tokenizer = new StringTokenizer(reader.readLine());\n } catch (IOException e) {\n throw new RuntimeException(e);\n }\n }",
"tokenizer == null || !tokenizer.hasMoreTokens()",
"tokenizer == null",
"tokenizer",
"null",
"!tokenizer.hasMoreTokens()",
"tokenizer.hasMoreTokens()",
"tokenizer.hasMoreTokens",
"tokenizer",
"{\n try {\n tokenizer = new StringTokenizer(reader.readLine());\n } catch (IOException e) {\n throw new RuntimeException(e);\n }\n }",
"try {\n tokenizer = new StringTokenizer(reader.readLine());\n } catch (IOException e) {\n throw new RuntimeException(e);\n }",
"catch (IOException e) {\n throw new RuntimeException(e);\n }",
"IOException e",
"{\n throw new RuntimeException(e);\n }",
"throw new RuntimeException(e);",
"new RuntimeException(e)",
"{\n tokenizer = new StringTokenizer(reader.readLine());\n }",
"tokenizer = new StringTokenizer(reader.readLine())",
"tokenizer",
"new StringTokenizer(reader.readLine())",
"return tokenizer.nextToken();",
"tokenizer.nextToken()",
"tokenizer.nextToken",
"tokenizer",
"public int nextInt() {\n return Integer.parseInt(next());\n }",
"nextInt",
"{\n return Integer.parseInt(next());\n }",
"return Integer.parseInt(next());",
"Integer.parseInt(next())",
"Integer.parseInt",
"Integer",
"next()",
"next",
"public class Main {\n public static void main(String[] args) {\n InputStream inputStream = System.in;\n OutputStream outputStream = System.out;\n InputReader in = new InputReader(inputStream);\n PrintWriter out = new PrintWriter(outputStream);\n TaskB solver = new TaskB();\n solver.solve(1, in, out);\n out.close();\n }\n\n static class TaskB {\n public void solve(int testNumber, InputReader in, PrintWriter out) {\n int n = in.nextInt();\n int m = in.nextInt();\n\n int totalAssignmentTime = 0;\n for (int i = 0; i < m; ++i) {\n totalAssignmentTime += in.nextInt();\n }\n\n out.println(n - totalAssignmentTime >= 0 ? n - totalAssignmentTime : -1);\n }\n }\n\n static class InputReader {\n public BufferedReader reader;\n public StringTokenizer tokenizer;\n\n public InputReader(InputStream stream) {\n reader = new BufferedReader(new InputStreamReader(stream), 32768);\n tokenizer = null;\n }\n\n public String next() {\n while (tokenizer == null || !tokenizer.hasMoreTokens()) {\n try {\n tokenizer = new StringTokenizer(reader.readLine());\n } catch (IOException e) {\n throw new RuntimeException(e);\n }\n }\n return tokenizer.nextToken();\n }\n\n public int nextInt() {\n return Integer.parseInt(next());\n }\n\n }\n}",
"public class Main {\n public static void main(String[] args) {\n InputStream inputStream = System.in;\n OutputStream outputStream = System.out;\n InputReader in = new InputReader(inputStream);\n PrintWriter out = new PrintWriter(outputStream);\n TaskB solver = new TaskB();\n solver.solve(1, in, out);\n out.close();\n }\n\n static class TaskB {\n public void solve(int testNumber, InputReader in, PrintWriter out) {\n int n = in.nextInt();\n int m = in.nextInt();\n\n int totalAssignmentTime = 0;\n for (int i = 0; i < m; ++i) {\n totalAssignmentTime += in.nextInt();\n }\n\n out.println(n - totalAssignmentTime >= 0 ? n - totalAssignmentTime : -1);\n }\n }\n\n static class InputReader {\n public BufferedReader reader;\n public StringTokenizer tokenizer;\n\n public InputReader(InputStream stream) {\n reader = new BufferedReader(new InputStreamReader(stream), 32768);\n tokenizer = null;\n }\n\n public String next() {\n while (tokenizer == null || !tokenizer.hasMoreTokens()) {\n try {\n tokenizer = new StringTokenizer(reader.readLine());\n } catch (IOException e) {\n throw new RuntimeException(e);\n }\n }\n return tokenizer.nextToken();\n }\n\n public int nextInt() {\n return Integer.parseInt(next());\n }\n\n }\n}",
"Main"
] |
//package beginner163.b;
import java.io.*;
import java.util.StringTokenizer;
public class Main {
public static void main(String[] args) {
InputStream inputStream = System.in;
OutputStream outputStream = System.out;
InputReader in = new InputReader(inputStream);
PrintWriter out = new PrintWriter(outputStream);
TaskB solver = new TaskB();
solver.solve(1, in, out);
out.close();
}
static class TaskB {
public void solve(int testNumber, InputReader in, PrintWriter out) {
int n = in.nextInt();
int m = in.nextInt();
int totalAssignmentTime = 0;
for (int i = 0; i < m; ++i) {
totalAssignmentTime += in.nextInt();
}
out.println(n - totalAssignmentTime >= 0 ? n - totalAssignmentTime : -1);
}
}
static class InputReader {
public BufferedReader reader;
public StringTokenizer tokenizer;
public InputReader(InputStream stream) {
reader = new BufferedReader(new InputStreamReader(stream), 32768);
tokenizer = null;
}
public String next() {
while (tokenizer == null || !tokenizer.hasMoreTokens()) {
try {
tokenizer = new StringTokenizer(reader.readLine());
} catch (IOException e) {
throw new RuntimeException(e);
}
}
return tokenizer.nextToken();
}
public int nextInt() {
return Integer.parseInt(next());
}
}
}
|
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
41,
13,
41,
13,
0,
13,
4,
18,
13,
41,
13,
20,
13,
0,
13,
17,
11,
1,
0,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
18,
13,
13,
4,
18,
13,
0,
13,
2,
13,
18,
13,
13,
41,
13,
2,
13,
13,
14,
2,
13,
17,
30,
4,
18,
18,
13,
13,
13,
30,
4,
18,
18,
13,
13,
17,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
88,
5
],
[
88,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
8,
17
],
[
17,
18
],
[
8,
19
],
[
19,
20
],
[
8,
21
],
[
21,
22
],
[
8,
23
],
[
23,
24
],
[
23,
25
],
[
25,
26
],
[
26,
27
],
[
8,
28
],
[
28,
29
],
[
28,
30
],
[
8,
32
],
[
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
],
[
49,
51
],
[
48,
52
],
[
52,
53
],
[
53,
54
],
[
47,
55
],
[
55,
56
],
[
55,
57
],
[
57,
58
],
[
57,
59
],
[
59,
60
],
[
59,
61
],
[
8,
62
],
[
62,
63
],
[
62,
64
],
[
64,
65
],
[
64,
66
],
[
8,
67
],
[
67,
68
],
[
68,
69
],
[
68,
70
],
[
67,
71
],
[
71,
72
],
[
72,
73
],
[
73,
74
],
[
74,
75
],
[
74,
76
],
[
72,
77
],
[
67,
78
],
[
78,
79
],
[
79,
80
],
[
80,
81
],
[
81,
82
],
[
81,
83
],
[
79,
84
],
[
6,
85
],
[
85,
86
],
[
0,
87
],
[
87,
88
],
[
87,
89
]
] |
[
"import java.util.Scanner;\npublic class Main{\n public static void main(String[] args){\n Scanner sc = new Scanner(System.in);\n int c = sc.nextInt();\n int a,b,d;\n a = sc.nextInt();\n int x[] = new int [a];\n d = 0;\n for(b =0;b < a;b++){\n x[b] = sc.nextInt();\n d = d + x[b];\n }\n int e = c-d;\n if(e >= 0){\n System.out.println(e);\n }else{\n System.out.println(\"-1\");\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 c = sc.nextInt();\n int a,b,d;\n a = sc.nextInt();\n int x[] = new int [a];\n d = 0;\n for(b =0;b < a;b++){\n x[b] = sc.nextInt();\n d = d + x[b];\n }\n int e = c-d;\n if(e >= 0){\n System.out.println(e);\n }else{\n System.out.println(\"-1\");\n }\n }\n}",
"Main",
"public static void main(String[] args){\n Scanner sc = new Scanner(System.in);\n int c = sc.nextInt();\n int a,b,d;\n a = sc.nextInt();\n int x[] = new int [a];\n d = 0;\n for(b =0;b < a;b++){\n x[b] = sc.nextInt();\n d = d + x[b];\n }\n int e = c-d;\n if(e >= 0){\n System.out.println(e);\n }else{\n System.out.println(\"-1\");\n }\n }",
"main",
"{\n Scanner sc = new Scanner(System.in);\n int c = sc.nextInt();\n int a,b,d;\n a = sc.nextInt();\n int x[] = new int [a];\n d = 0;\n for(b =0;b < a;b++){\n x[b] = sc.nextInt();\n d = d + x[b];\n }\n int e = c-d;\n if(e >= 0){\n System.out.println(e);\n }else{\n System.out.println(\"-1\");\n }\n }",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"int c = sc.nextInt();",
"c",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int a",
"a",
"b",
"b",
"d;",
"d",
"a = sc.nextInt()",
"a",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int x[] = new int [a];",
"x",
"new int [a]",
"a",
"d = 0",
"d",
"0",
"for(b =0;b < a;b++){\n x[b] = sc.nextInt();\n d = d + x[b];\n }",
"b =0;",
"b =0",
"b",
"0",
"b < a",
"b",
"a",
"b++",
"b++",
"b",
"{\n x[b] = sc.nextInt();\n d = d + x[b];\n }",
"{\n x[b] = sc.nextInt();\n d = d + x[b];\n }",
"x[b] = sc.nextInt()",
"x[b]",
"x",
"b",
"sc.nextInt()",
"sc.nextInt",
"sc",
"d = d + x[b]",
"d",
"d + x[b]",
"d",
"x[b]",
"x",
"b",
"int e = c-d;",
"e",
"c-d",
"c",
"d",
"if(e >= 0){\n System.out.println(e);\n }else{\n System.out.println(\"-1\");\n }",
"e >= 0",
"e",
"0",
"{\n System.out.println(e);\n }",
"System.out.println(e)",
"System.out.println",
"System.out",
"System",
"System.out",
"e",
"{\n System.out.println(\"-1\");\n }",
"System.out.println(\"-1\")",
"System.out.println",
"System.out",
"System",
"System.out",
"\"-1\"",
"String[] args",
"args",
"public class Main{\n public static void main(String[] args){\n Scanner sc = new Scanner(System.in);\n int c = sc.nextInt();\n int a,b,d;\n a = sc.nextInt();\n int x[] = new int [a];\n d = 0;\n for(b =0;b < a;b++){\n x[b] = sc.nextInt();\n d = d + x[b];\n }\n int e = c-d;\n if(e >= 0){\n System.out.println(e);\n }else{\n System.out.println(\"-1\");\n }\n }\n}",
"public class Main{\n public static void main(String[] args){\n Scanner sc = new Scanner(System.in);\n int c = sc.nextInt();\n int a,b,d;\n a = sc.nextInt();\n int x[] = new int [a];\n d = 0;\n for(b =0;b < a;b++){\n x[b] = sc.nextInt();\n d = d + x[b];\n }\n int e = c-d;\n if(e >= 0){\n System.out.println(e);\n }else{\n System.out.println(\"-1\");\n }\n }\n}",
"Main"
] |
import java.util.Scanner;
public class Main{
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
int c = sc.nextInt();
int a,b,d;
a = sc.nextInt();
int x[] = new int [a];
d = 0;
for(b =0;b < a;b++){
x[b] = sc.nextInt();
d = d + x[b];
}
int e = c-d;
if(e >= 0){
System.out.println(e);
}else{
System.out.println("-1");
}
}
}
|
[
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,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
41,
13,
4,
18,
13,
0,
13,
2,
13,
13,
14,
2,
2,
13,
13,
17,
30,
4,
18,
18,
13,
13,
2,
13,
13,
30,
4,
18,
18,
13,
13,
17,
23,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
8,
15
],
[
15,
16
],
[
15,
17
],
[
17,
18
],
[
18,
19
],
[
8,
20
],
[
20,
21
],
[
20,
22
],
[
22,
23
],
[
23,
24
],
[
8,
25
],
[
25,
26
],
[
26,
27
],
[
27,
28
],
[
27,
29
],
[
25,
30
],
[
30,
31
],
[
30,
32
],
[
25,
33
],
[
33,
34
],
[
34,
35
],
[
25,
36
],
[
37,
37
],
[
37,
38
],
[
38,
39
],
[
38,
40
],
[
40,
41
],
[
41,
42
],
[
37,
43
],
[
43,
44
],
[
43,
45
],
[
45,
46
],
[
45,
47
],
[
8,
48
],
[
48,
49
],
[
49,
50
],
[
50,
51
],
[
50,
52
],
[
49,
53
],
[
48,
54
],
[
54,
55
],
[
55,
56
],
[
56,
57
],
[
57,
58
],
[
57,
59
],
[
55,
60
],
[
60,
61
],
[
60,
62
],
[
48,
63
],
[
63,
64
],
[
64,
65
],
[
65,
66
],
[
66,
67
],
[
66,
68
],
[
64,
69
],
[
6,
70
],
[
70,
71
]
] |
[
"import java.util.Scanner;\nclass Main{\npublic static void main(String[] args){\n Scanner scan = new Scanner(System.in);\n \n int b = 0;\n int N = scan.nextInt();\n int M = scan.nextInt(); \n\tfor (int i = 0; i < M; i++){\n int a = scan.nextInt();\n b = a + b;\n }\n if (N - b >= 0){\n System.out.println(N-b);\n }\n else{\n System.out.println(\"-1\");\n }\n \n }\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"class Main{\npublic static void main(String[] args){\n Scanner scan = new Scanner(System.in);\n \n int b = 0;\n int N = scan.nextInt();\n int M = scan.nextInt(); \n\tfor (int i = 0; i < M; i++){\n int a = scan.nextInt();\n b = a + b;\n }\n if (N - b >= 0){\n System.out.println(N-b);\n }\n else{\n System.out.println(\"-1\");\n }\n \n }\n}",
"Main",
"public static void main(String[] args){\n Scanner scan = new Scanner(System.in);\n \n int b = 0;\n int N = scan.nextInt();\n int M = scan.nextInt(); \n\tfor (int i = 0; i < M; i++){\n int a = scan.nextInt();\n b = a + b;\n }\n if (N - b >= 0){\n System.out.println(N-b);\n }\n else{\n System.out.println(\"-1\");\n }\n \n }",
"main",
"{\n Scanner scan = new Scanner(System.in);\n \n int b = 0;\n int N = scan.nextInt();\n int M = scan.nextInt(); \n\tfor (int i = 0; i < M; i++){\n int a = scan.nextInt();\n b = a + b;\n }\n if (N - b >= 0){\n System.out.println(N-b);\n }\n else{\n System.out.println(\"-1\");\n }\n \n }",
"Scanner scan = new Scanner(System.in);",
"scan",
"new Scanner(System.in)",
"int b = 0;",
"b",
"0",
"int N = scan.nextInt();",
"N",
"scan.nextInt()",
"scan.nextInt",
"scan",
"int M = scan.nextInt();",
"M",
"scan.nextInt()",
"scan.nextInt",
"scan",
"for (int i = 0; i < M; i++){\n int a = scan.nextInt();\n b = a + b;\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < M",
"i",
"M",
"i++",
"i++",
"i",
"{\n int a = scan.nextInt();\n b = a + b;\n }",
"{\n int a = scan.nextInt();\n b = a + b;\n }",
"int a = scan.nextInt();",
"a",
"scan.nextInt()",
"scan.nextInt",
"scan",
"b = a + b",
"b",
"a + b",
"a",
"b",
"if (N - b >= 0){\n System.out.println(N-b);\n }\n else{\n System.out.println(\"-1\");\n }",
"N - b >= 0",
"N - b",
"N",
"b",
"0",
"{\n System.out.println(N-b);\n }",
"System.out.println(N-b)",
"System.out.println",
"System.out",
"System",
"System.out",
"N-b",
"N",
"b",
"{\n System.out.println(\"-1\");\n }",
"System.out.println(\"-1\")",
"System.out.println",
"System.out",
"System",
"System.out",
"\"-1\"",
"String[] args",
"args"
] |
import java.util.Scanner;
class Main{
public static void main(String[] args){
Scanner scan = new Scanner(System.in);
int b = 0;
int N = scan.nextInt();
int M = scan.nextInt();
for (int i = 0; i < M; i++){
int a = scan.nextInt();
b = a + b;
}
if (N - b >= 0){
System.out.println(N-b);
}
else{
System.out.println("-1");
}
}
}
|
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
4,
18,
13,
14,
2,
13,
13,
30,
4,
18,
18,
13,
13,
2,
13,
13,
30,
4,
18,
18,
13,
13,
17,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
72,
11
],
[
72,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
15,
17
],
[
14,
18
],
[
18,
19
],
[
18,
20
],
[
20,
21
],
[
21,
22
],
[
14,
23
],
[
23,
24
],
[
23,
25
],
[
25,
26
],
[
26,
27
],
[
14,
28
],
[
28,
29
],
[
28,
30
],
[
14,
31
],
[
31,
32
],
[
32,
33
],
[
33,
34
],
[
33,
35
],
[
31,
36
],
[
36,
37
],
[
36,
38
],
[
31,
39
],
[
39,
40
],
[
40,
41
],
[
31,
42
],
[
43,
43
],
[
43,
44
],
[
44,
45
],
[
44,
46
],
[
46,
47
],
[
47,
48
],
[
14,
49
],
[
49,
50
],
[
50,
51
],
[
50,
52
],
[
49,
53
],
[
53,
54
],
[
54,
55
],
[
55,
56
],
[
56,
57
],
[
56,
58
],
[
54,
59
],
[
59,
60
],
[
59,
61
],
[
49,
62
],
[
62,
63
],
[
63,
64
],
[
64,
65
],
[
65,
66
],
[
65,
67
],
[
63,
68
],
[
12,
69
],
[
69,
70
],
[
0,
71
],
[
71,
72
],
[
71,
73
]
] |
[
"import java.util.*;\nimport java.math.*;\nimport java.io.*;\n\npublic class Main{\n\tpublic static void main(String[] args) {\n\t\tScanner in = new Scanner(System.in);\n\t\tint n = in.nextInt();\n\t\tint tt = in.nextInt();\n\t\tint sum = 0;\n\t\tfor(int qq=1; qq<=tt; qq++){\n\t\t\tsum += in.nextInt();\n\t\t}\n\t\tif(sum<=n){\n\t\t\tSystem.out.println(n-sum);\n\t\t}else{\n\t\t\tSystem.out.println(\"-1\");\n\t\t}\n\t}\n}",
"import java.util.*;",
"util.*",
"java",
"import java.math.*;",
"math.*",
"java",
"import java.io.*;",
"io.*",
"java",
"public class Main{\n\tpublic static void main(String[] args) {\n\t\tScanner in = new Scanner(System.in);\n\t\tint n = in.nextInt();\n\t\tint tt = in.nextInt();\n\t\tint sum = 0;\n\t\tfor(int qq=1; qq<=tt; qq++){\n\t\t\tsum += in.nextInt();\n\t\t}\n\t\tif(sum<=n){\n\t\t\tSystem.out.println(n-sum);\n\t\t}else{\n\t\t\tSystem.out.println(\"-1\");\n\t\t}\n\t}\n}",
"Main",
"public static void main(String[] args) {\n\t\tScanner in = new Scanner(System.in);\n\t\tint n = in.nextInt();\n\t\tint tt = in.nextInt();\n\t\tint sum = 0;\n\t\tfor(int qq=1; qq<=tt; qq++){\n\t\t\tsum += in.nextInt();\n\t\t}\n\t\tif(sum<=n){\n\t\t\tSystem.out.println(n-sum);\n\t\t}else{\n\t\t\tSystem.out.println(\"-1\");\n\t\t}\n\t}",
"main",
"{\n\t\tScanner in = new Scanner(System.in);\n\t\tint n = in.nextInt();\n\t\tint tt = in.nextInt();\n\t\tint sum = 0;\n\t\tfor(int qq=1; qq<=tt; qq++){\n\t\t\tsum += in.nextInt();\n\t\t}\n\t\tif(sum<=n){\n\t\t\tSystem.out.println(n-sum);\n\t\t}else{\n\t\t\tSystem.out.println(\"-1\");\n\t\t}\n\t}",
"Scanner in = new Scanner(System.in);",
"in",
"new Scanner(System.in)",
"int n = in.nextInt();",
"n",
"in.nextInt()",
"in.nextInt",
"in",
"int tt = in.nextInt();",
"tt",
"in.nextInt()",
"in.nextInt",
"in",
"int sum = 0;",
"sum",
"0",
"for(int qq=1; qq<=tt; qq++){\n\t\t\tsum += in.nextInt();\n\t\t}",
"int qq=1;",
"int qq=1;",
"qq",
"1",
"qq<=tt",
"qq",
"tt",
"qq++",
"qq++",
"qq",
"{\n\t\t\tsum += in.nextInt();\n\t\t}",
"{\n\t\t\tsum += in.nextInt();\n\t\t}",
"sum += in.nextInt()",
"sum",
"in.nextInt()",
"in.nextInt",
"in",
"if(sum<=n){\n\t\t\tSystem.out.println(n-sum);\n\t\t}else{\n\t\t\tSystem.out.println(\"-1\");\n\t\t}",
"sum<=n",
"sum",
"n",
"{\n\t\t\tSystem.out.println(n-sum);\n\t\t}",
"System.out.println(n-sum)",
"System.out.println",
"System.out",
"System",
"System.out",
"n-sum",
"n",
"sum",
"{\n\t\t\tSystem.out.println(\"-1\");\n\t\t}",
"System.out.println(\"-1\")",
"System.out.println",
"System.out",
"System",
"System.out",
"\"-1\"",
"String[] args",
"args",
"public class Main{\n\tpublic static void main(String[] args) {\n\t\tScanner in = new Scanner(System.in);\n\t\tint n = in.nextInt();\n\t\tint tt = in.nextInt();\n\t\tint sum = 0;\n\t\tfor(int qq=1; qq<=tt; qq++){\n\t\t\tsum += in.nextInt();\n\t\t}\n\t\tif(sum<=n){\n\t\t\tSystem.out.println(n-sum);\n\t\t}else{\n\t\t\tSystem.out.println(\"-1\");\n\t\t}\n\t}\n}",
"public class Main{\n\tpublic static void main(String[] args) {\n\t\tScanner in = new Scanner(System.in);\n\t\tint n = in.nextInt();\n\t\tint tt = in.nextInt();\n\t\tint sum = 0;\n\t\tfor(int qq=1; qq<=tt; qq++){\n\t\t\tsum += in.nextInt();\n\t\t}\n\t\tif(sum<=n){\n\t\t\tSystem.out.println(n-sum);\n\t\t}else{\n\t\t\tSystem.out.println(\"-1\");\n\t\t}\n\t}\n}",
"Main"
] |
import java.util.*;
import java.math.*;
import java.io.*;
public class Main{
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
int n = in.nextInt();
int tt = in.nextInt();
int sum = 0;
for(int qq=1; qq<=tt; qq++){
sum += in.nextInt();
}
if(sum<=n){
System.out.println(n-sum);
}else{
System.out.println("-1");
}
}
}
|
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
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,
4,
18,
13,
0,
13,
2,
13,
13,
4,
18,
18,
13,
13,
8,
2,
13,
17,
40,
17,
13,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
60,
5
],
[
60,
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
],
[
23,
24
],
[
24,
25
],
[
24,
26
],
[
22,
27
],
[
27,
28
],
[
27,
29
],
[
22,
30
],
[
30,
31
],
[
31,
32
],
[
22,
33
],
[
34,
34
],
[
34,
35
],
[
35,
36
],
[
35,
37
],
[
37,
38
],
[
38,
39
],
[
34,
40
],
[
40,
41
],
[
40,
42
],
[
42,
43
],
[
42,
44
],
[
8,
45
],
[
45,
46
],
[
46,
47
],
[
47,
48
],
[
47,
49
],
[
45,
50
],
[
50,
51
],
[
51,
52
],
[
51,
53
],
[
50,
54
],
[
54,
55
],
[
50,
56
],
[
6,
57
],
[
57,
58
],
[
0,
59
],
[
59,
60
],
[
59,
61
]
] |
[
"\nimport java.util.Scanner;\n\npublic class Main {\n\n public static void main(String[] args) {\n\n Scanner sc = new Scanner(System.in);\n // ๆดๆฐใฎๅ
ฅๅ\n int N = sc.nextInt();\n int M = sc.nextInt();\n\n for (int i = 0; i < M; i++) {\n int ai = sc.nextInt();\n N = N - ai;\n }\n\n // ๅบๅ\n System.out.println(N < 0 ? -1 : N);\n }\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n\n public static void main(String[] args) {\n\n Scanner sc = new Scanner(System.in);\n // ๆดๆฐใฎๅ
ฅๅ\n int N = sc.nextInt();\n int M = sc.nextInt();\n\n for (int i = 0; i < M; i++) {\n int ai = sc.nextInt();\n N = N - ai;\n }\n\n // ๅบๅ\n System.out.println(N < 0 ? -1 : N);\n }\n}",
"Main",
"public static void main(String[] args) {\n\n Scanner sc = new Scanner(System.in);\n // ๆดๆฐใฎๅ
ฅๅ\n int N = sc.nextInt();\n int M = sc.nextInt();\n\n for (int i = 0; i < M; i++) {\n int ai = sc.nextInt();\n N = N - ai;\n }\n\n // ๅบๅ\n System.out.println(N < 0 ? -1 : N);\n }",
"main",
"{\n\n Scanner sc = new Scanner(System.in);\n // ๆดๆฐใฎๅ
ฅๅ\n int N = sc.nextInt();\n int M = sc.nextInt();\n\n for (int i = 0; i < M; i++) {\n int ai = sc.nextInt();\n N = N - ai;\n }\n\n // ๅบๅ\n System.out.println(N < 0 ? -1 : N);\n }",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"int N = sc.nextInt();",
"N",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int M = sc.nextInt();",
"M",
"sc.nextInt()",
"sc.nextInt",
"sc",
"for (int i = 0; i < M; i++) {\n int ai = sc.nextInt();\n N = N - ai;\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < M",
"i",
"M",
"i++",
"i++",
"i",
"{\n int ai = sc.nextInt();\n N = N - ai;\n }",
"{\n int ai = sc.nextInt();\n N = N - ai;\n }",
"int ai = sc.nextInt();",
"ai",
"sc.nextInt()",
"sc.nextInt",
"sc",
"N = N - ai",
"N",
"N - ai",
"N",
"ai",
"System.out.println(N < 0 ? -1 : N)",
"System.out.println",
"System.out",
"System",
"System.out",
"N < 0 ? -1 : N",
"N < 0",
"N",
"0",
"-1",
"1",
"N",
"String[] args",
"args",
"public class Main {\n\n public static void main(String[] args) {\n\n Scanner sc = new Scanner(System.in);\n // ๆดๆฐใฎๅ
ฅๅ\n int N = sc.nextInt();\n int M = sc.nextInt();\n\n for (int i = 0; i < M; i++) {\n int ai = sc.nextInt();\n N = N - ai;\n }\n\n // ๅบๅ\n System.out.println(N < 0 ? -1 : N);\n }\n}",
"public class Main {\n\n public static void main(String[] args) {\n\n Scanner sc = new Scanner(System.in);\n // ๆดๆฐใฎๅ
ฅๅ\n int N = sc.nextInt();\n int M = sc.nextInt();\n\n for (int i = 0; i < M; i++) {\n int ai = sc.nextInt();\n N = N - ai;\n }\n\n // ๅบๅ\n System.out.println(N < 0 ? -1 : N);\n }\n}",
"Main"
] |
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
// ๆดๆฐใฎๅ
ฅๅ
int N = sc.nextInt();
int M = sc.nextInt();
for (int i = 0; i < M; i++) {
int ai = sc.nextInt();
N = N - ai;
}
// ๅบๅ
System.out.println(N < 0 ? -1 : N);
}
}
|
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
17,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
42,
2,
13,
17,
30,
0,
13,
2,
13,
4,
18,
13,
40,
13,
14,
2,
13,
13,
4,
18,
18,
13,
13,
2,
13,
13,
4,
18,
18,
13,
13,
40,
17,
23,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
10,
11
],
[
10,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
15,
17
],
[
14,
18
],
[
18,
19
],
[
18,
20
],
[
14,
21
],
[
21,
22
],
[
21,
23
],
[
23,
24
],
[
24,
25
],
[
14,
26
],
[
26,
27
],
[
26,
28
],
[
28,
29
],
[
29,
30
],
[
14,
31
],
[
31,
32
],
[
32,
33
],
[
32,
34
],
[
31,
35
],
[
35,
36
],
[
36,
37
],
[
36,
38
],
[
38,
39
],
[
38,
40
],
[
40,
41
],
[
41,
42
],
[
35,
43
],
[
43,
44
],
[
14,
45
],
[
45,
46
],
[
46,
47
],
[
46,
48
],
[
45,
49
],
[
49,
50
],
[
50,
51
],
[
51,
52
],
[
51,
53
],
[
49,
54
],
[
54,
55
],
[
54,
56
],
[
45,
57
],
[
57,
58
],
[
58,
59
],
[
59,
60
],
[
59,
61
],
[
57,
62
],
[
62,
63
],
[
12,
64
],
[
64,
65
]
] |
[
"/* package codechef; // don't place package name! */\n\nimport java.util.*;\nimport java.lang.*;\nimport java.io.*;\n\n/* Name of the class has to be \"Main\" only if the class is public. */\nclass Main\n{\n\tpublic static void main (String[] args) throws java.lang.Exception\n\t{\n\t\t// your code goes here\n\t\t\t\tScanner sc=new Scanner (System.in);\n\t\t\n\t\tint ass=0;\n\t\tint nod=sc.nextInt();\n\t\tint t=sc.nextInt();\n\t\twhile (t>0)\n\t\t{\n\t\t ass=ass+sc.nextInt();\n\t\t t--;\n\t\t}\n\t\tif(nod>=ass)\n\t\tSystem.out.println(nod-ass);\n\t\telse System.out.println(-1);\n\t\t\n\t}\n}",
"import java.util.*;",
"util.*",
"java",
"import java.lang.*;",
"lang.*",
"java",
"import java.io.*;",
"io.*",
"java",
"class Main\n{\n\tpublic static void main (String[] args) throws java.lang.Exception\n\t{\n\t\t// your code goes here\n\t\t\t\tScanner sc=new Scanner (System.in);\n\t\t\n\t\tint ass=0;\n\t\tint nod=sc.nextInt();\n\t\tint t=sc.nextInt();\n\t\twhile (t>0)\n\t\t{\n\t\t ass=ass+sc.nextInt();\n\t\t t--;\n\t\t}\n\t\tif(nod>=ass)\n\t\tSystem.out.println(nod-ass);\n\t\telse System.out.println(-1);\n\t\t\n\t}\n}",
"Main",
"public static void main (String[] args) throws java.lang.Exception\n\t{\n\t\t// your code goes here\n\t\t\t\tScanner sc=new Scanner (System.in);\n\t\t\n\t\tint ass=0;\n\t\tint nod=sc.nextInt();\n\t\tint t=sc.nextInt();\n\t\twhile (t>0)\n\t\t{\n\t\t ass=ass+sc.nextInt();\n\t\t t--;\n\t\t}\n\t\tif(nod>=ass)\n\t\tSystem.out.println(nod-ass);\n\t\telse System.out.println(-1);\n\t\t\n\t}",
"main",
"{\n\t\t// your code goes here\n\t\t\t\tScanner sc=new Scanner (System.in);\n\t\t\n\t\tint ass=0;\n\t\tint nod=sc.nextInt();\n\t\tint t=sc.nextInt();\n\t\twhile (t>0)\n\t\t{\n\t\t ass=ass+sc.nextInt();\n\t\t t--;\n\t\t}\n\t\tif(nod>=ass)\n\t\tSystem.out.println(nod-ass);\n\t\telse System.out.println(-1);\n\t\t\n\t}",
"Scanner sc=new Scanner (System.in);",
"sc",
"new Scanner (System.in)",
"int ass=0;",
"ass",
"0",
"int nod=sc.nextInt();",
"nod",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int t=sc.nextInt();",
"t",
"sc.nextInt()",
"sc.nextInt",
"sc",
"while (t>0)\n\t\t{\n\t\t ass=ass+sc.nextInt();\n\t\t t--;\n\t\t}",
"t>0",
"t",
"0",
"{\n\t\t ass=ass+sc.nextInt();\n\t\t t--;\n\t\t}",
"ass=ass+sc.nextInt()",
"ass",
"ass+sc.nextInt()",
"ass",
"sc.nextInt()",
"sc.nextInt",
"sc",
"t--",
"t",
"if(nod>=ass)\n\t\tSystem.out.println(nod-ass);\n\t\telse System.out.println(-1);",
"nod>=ass",
"nod",
"ass",
"System.out.println(nod-ass)",
"System.out.println",
"System.out",
"System",
"System.out",
"nod-ass",
"nod",
"ass",
"System.out.println(-1)",
"System.out.println",
"System.out",
"System",
"System.out",
"-1",
"1",
"String[] args",
"args"
] |
/* package codechef; // don't place package name! */
import java.util.*;
import java.lang.*;
import java.io.*;
/* Name of the class has to be "Main" only if the class is public. */
class Main
{
public static void main (String[] args) throws java.lang.Exception
{
// your code goes here
Scanner sc=new Scanner (System.in);
int ass=0;
int nod=sc.nextInt();
int t=sc.nextInt();
while (t>0)
{
ass=ass+sc.nextInt();
t--;
}
if(nod>=ass)
System.out.println(nod-ass);
else System.out.println(-1);
}
}
|
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
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,
41,
13,
4,
18,
4,
18,
13,
17,
17,
17,
41,
13,
4,
18,
4,
18,
13,
17,
17,
17,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
18,
13,
13,
1,
40,
13,
30,
30,
0,
13,
4,
18,
13,
18,
13,
13,
14,
2,
4,
18,
13,
18,
13,
17,
13,
30,
4,
18,
18,
13,
13,
17,
30,
4,
18,
18,
13,
13,
2,
4,
18,
13,
18,
13,
17,
13,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
113,
5
],
[
113,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
8,
15
],
[
15,
16
],
[
16,
17
],
[
17,
18
],
[
17,
19
],
[
15,
20
],
[
20,
21
],
[
20,
22
],
[
15,
23
],
[
23,
24
],
[
24,
25
],
[
15,
26
],
[
27,
27
],
[
27,
28
],
[
28,
29
],
[
29,
30
],
[
28,
31
],
[
31,
32
],
[
32,
33
],
[
8,
34
],
[
34,
35
],
[
34,
36
],
[
36,
37
],
[
37,
38
],
[
38,
39
],
[
39,
40
],
[
38,
41
],
[
36,
42
],
[
36,
43
],
[
8,
44
],
[
44,
45
],
[
44,
46
],
[
46,
47
],
[
47,
48
],
[
48,
49
],
[
49,
50
],
[
48,
51
],
[
46,
52
],
[
46,
53
],
[
8,
54
],
[
54,
55
],
[
54,
56
],
[
8,
57
],
[
57,
58
],
[
58,
59
],
[
59,
60
],
[
59,
61
],
[
57,
62
],
[
62,
63
],
[
62,
64
],
[
64,
65
],
[
64,
66
],
[
57,
67
],
[
67,
68
],
[
68,
69
],
[
57,
70
],
[
71,
71
],
[
71,
72
],
[
72,
73
],
[
72,
74
],
[
74,
75
],
[
75,
76
],
[
74,
77
],
[
77,
78
],
[
77,
79
],
[
8,
80
],
[
80,
81
],
[
81,
82
],
[
82,
83
],
[
83,
84
],
[
82,
85
],
[
85,
86
],
[
85,
87
],
[
81,
88
],
[
80,
89
],
[
89,
90
],
[
90,
91
],
[
91,
92
],
[
92,
93
],
[
92,
94
],
[
90,
95
],
[
80,
96
],
[
96,
97
],
[
97,
98
],
[
98,
99
],
[
99,
100
],
[
99,
101
],
[
97,
102
],
[
102,
103
],
[
103,
104
],
[
104,
105
],
[
103,
106
],
[
106,
107
],
[
106,
108
],
[
102,
109
],
[
6,
110
],
[
110,
111
],
[
0,
112
],
[
112,
113
],
[
112,
114
]
] |
[
"import java.util.*;\n\npublic class Main{\n public static void main(String[] args){\n Scanner scan = new Scanner(System.in);\n List<String> str = new ArrayList<>();\n \n for (int i=0;i<2;i++){\n str.add(scan.nextLine());\n }\n \n String[] a = str.get(0).split(\" \",0);\n String[] b = str.get(1).split(\" \",0);\n int workD = 0;\n for(int i=0;i<b.length;i++){\n workD += Integer.parseInt(b[i]);\n }\n if(Integer.parseInt(a[0]) < workD ){\n System.out.println(\"-1\");\n } else {\n System.out.println(Integer.parseInt(a[0]) - workD);\n }\n }\n }",
"import java.util.*;",
"util.*",
"java",
"public class Main{\n public static void main(String[] args){\n Scanner scan = new Scanner(System.in);\n List<String> str = new ArrayList<>();\n \n for (int i=0;i<2;i++){\n str.add(scan.nextLine());\n }\n \n String[] a = str.get(0).split(\" \",0);\n String[] b = str.get(1).split(\" \",0);\n int workD = 0;\n for(int i=0;i<b.length;i++){\n workD += Integer.parseInt(b[i]);\n }\n if(Integer.parseInt(a[0]) < workD ){\n System.out.println(\"-1\");\n } else {\n System.out.println(Integer.parseInt(a[0]) - workD);\n }\n }\n }",
"Main",
"public static void main(String[] args){\n Scanner scan = new Scanner(System.in);\n List<String> str = new ArrayList<>();\n \n for (int i=0;i<2;i++){\n str.add(scan.nextLine());\n }\n \n String[] a = str.get(0).split(\" \",0);\n String[] b = str.get(1).split(\" \",0);\n int workD = 0;\n for(int i=0;i<b.length;i++){\n workD += Integer.parseInt(b[i]);\n }\n if(Integer.parseInt(a[0]) < workD ){\n System.out.println(\"-1\");\n } else {\n System.out.println(Integer.parseInt(a[0]) - workD);\n }\n }",
"main",
"{\n Scanner scan = new Scanner(System.in);\n List<String> str = new ArrayList<>();\n \n for (int i=0;i<2;i++){\n str.add(scan.nextLine());\n }\n \n String[] a = str.get(0).split(\" \",0);\n String[] b = str.get(1).split(\" \",0);\n int workD = 0;\n for(int i=0;i<b.length;i++){\n workD += Integer.parseInt(b[i]);\n }\n if(Integer.parseInt(a[0]) < workD ){\n System.out.println(\"-1\");\n } else {\n System.out.println(Integer.parseInt(a[0]) - workD);\n }\n }",
"Scanner scan = new Scanner(System.in);",
"scan",
"new Scanner(System.in)",
"List<String> str = new ArrayList<>();",
"str",
"new ArrayList<>()",
"for (int i=0;i<2;i++){\n str.add(scan.nextLine());\n }",
"int i=0;",
"int i=0;",
"i",
"0",
"i<2",
"i",
"2",
"i++",
"i++",
"i",
"{\n str.add(scan.nextLine());\n }",
"{\n str.add(scan.nextLine());\n }",
"str.add(scan.nextLine())",
"str.add",
"str",
"scan.nextLine()",
"scan.nextLine",
"scan",
"String[] a = str.get(0).split(\" \",0);",
"a",
"str.get(0).split(\" \",0)",
"str.get(0).split",
"str.get(0)",
"str.get",
"str",
"0",
"\" \"",
"0",
"String[] b = str.get(1).split(\" \",0);",
"b",
"str.get(1).split(\" \",0)",
"str.get(1).split",
"str.get(1)",
"str.get",
"str",
"1",
"\" \"",
"0",
"int workD = 0;",
"workD",
"0",
"for(int i=0;i<b.length;i++){\n workD += Integer.parseInt(b[i]);\n }",
"int i=0;",
"int i=0;",
"i",
"0",
"i<b.length",
"i",
"b.length",
"b",
"b.length",
"i++",
"i++",
"i",
"{\n workD += Integer.parseInt(b[i]);\n }",
"{\n workD += Integer.parseInt(b[i]);\n }",
"workD += Integer.parseInt(b[i])",
"workD",
"Integer.parseInt(b[i])",
"Integer.parseInt",
"Integer",
"b[i]",
"b",
"i",
"if(Integer.parseInt(a[0]) < workD ){\n System.out.println(\"-1\");\n } else {\n System.out.println(Integer.parseInt(a[0]) - workD);\n }",
"Integer.parseInt(a[0]) < workD",
"Integer.parseInt(a[0])",
"Integer.parseInt",
"Integer",
"a[0]",
"a",
"0",
"workD",
"{\n System.out.println(\"-1\");\n }",
"System.out.println(\"-1\")",
"System.out.println",
"System.out",
"System",
"System.out",
"\"-1\"",
"{\n System.out.println(Integer.parseInt(a[0]) - workD);\n }",
"System.out.println(Integer.parseInt(a[0]) - workD)",
"System.out.println",
"System.out",
"System",
"System.out",
"Integer.parseInt(a[0]) - workD",
"Integer.parseInt(a[0])",
"Integer.parseInt",
"Integer",
"a[0]",
"a",
"0",
"workD",
"String[] args",
"args",
"public class Main{\n public static void main(String[] args){\n Scanner scan = new Scanner(System.in);\n List<String> str = new ArrayList<>();\n \n for (int i=0;i<2;i++){\n str.add(scan.nextLine());\n }\n \n String[] a = str.get(0).split(\" \",0);\n String[] b = str.get(1).split(\" \",0);\n int workD = 0;\n for(int i=0;i<b.length;i++){\n workD += Integer.parseInt(b[i]);\n }\n if(Integer.parseInt(a[0]) < workD ){\n System.out.println(\"-1\");\n } else {\n System.out.println(Integer.parseInt(a[0]) - workD);\n }\n }\n }",
"public class Main{\n public static void main(String[] args){\n Scanner scan = new Scanner(System.in);\n List<String> str = new ArrayList<>();\n \n for (int i=0;i<2;i++){\n str.add(scan.nextLine());\n }\n \n String[] a = str.get(0).split(\" \",0);\n String[] b = str.get(1).split(\" \",0);\n int workD = 0;\n for(int i=0;i<b.length;i++){\n workD += Integer.parseInt(b[i]);\n }\n if(Integer.parseInt(a[0]) < workD ){\n System.out.println(\"-1\");\n } else {\n System.out.println(Integer.parseInt(a[0]) - workD);\n }\n }\n }",
"Main"
] |
import java.util.*;
public class Main{
public static void main(String[] args){
Scanner scan = new Scanner(System.in);
List<String> str = new ArrayList<>();
for (int i=0;i<2;i++){
str.add(scan.nextLine());
}
String[] a = str.get(0).split(" ",0);
String[] b = str.get(1).split(" ",0);
int workD = 0;
for(int i=0;i<b.length;i++){
workD += Integer.parseInt(b[i]);
}
if(Integer.parseInt(a[0]) < workD ){
System.out.println("-1");
} else {
System.out.println(Integer.parseInt(a[0]) - workD);
}
}
}
|
[
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,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
41,
13,
4,
18,
13,
0,
13,
2,
13,
13,
0,
13,
2,
13,
13,
14,
2,
13,
17,
30,
4,
18,
18,
13,
13,
13,
30,
4,
18,
18,
13,
13,
40,
17,
4,
18,
13,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
78,
5
],
[
78,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
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
],
[
26,
27
],
[
27,
28
],
[
27,
29
],
[
25,
30
],
[
30,
31
],
[
30,
32
],
[
25,
33
],
[
33,
34
],
[
34,
35
],
[
25,
36
],
[
37,
37
],
[
37,
38
],
[
38,
39
],
[
38,
40
],
[
40,
41
],
[
41,
42
],
[
37,
43
],
[
43,
44
],
[
43,
45
],
[
45,
46
],
[
45,
47
],
[
8,
48
],
[
48,
49
],
[
48,
50
],
[
50,
51
],
[
50,
52
],
[
8,
53
],
[
53,
54
],
[
54,
55
],
[
54,
56
],
[
53,
57
],
[
57,
58
],
[
58,
59
],
[
59,
60
],
[
60,
61
],
[
60,
62
],
[
58,
63
],
[
53,
64
],
[
64,
65
],
[
65,
66
],
[
66,
67
],
[
67,
68
],
[
67,
69
],
[
65,
70
],
[
70,
71
],
[
8,
72
],
[
72,
73
],
[
73,
74
],
[
6,
75
],
[
75,
76
],
[
0,
77
],
[
77,
78
],
[
77,
79
]
] |
[
"\nimport java.util.Scanner;\npublic class Main {\n\n\tpublic static void main(String[] args) {\n\n\t\tScanner scanner = new Scanner(System.in);\n\t\tint ans=0;\n\t\tint N = scanner.nextInt();\n\t\tint M = scanner.nextInt();\n\t\tfor(int i=0; i<M; i++) {\n\t\t\tint A = scanner.nextInt();\n\t\t\tans = ans + A;\n\t\t}\n\n\t\tans = N - ans;\n\t\tif(ans >= 0) {\n\t\t\tSystem.out.println(ans);\n\t\t}else {\n\t\t\tSystem.out.println(-1);\n\t\t}\n\n\t\tscanner.close();\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 scanner = new Scanner(System.in);\n\t\tint ans=0;\n\t\tint N = scanner.nextInt();\n\t\tint M = scanner.nextInt();\n\t\tfor(int i=0; i<M; i++) {\n\t\t\tint A = scanner.nextInt();\n\t\t\tans = ans + A;\n\t\t}\n\n\t\tans = N - ans;\n\t\tif(ans >= 0) {\n\t\t\tSystem.out.println(ans);\n\t\t}else {\n\t\t\tSystem.out.println(-1);\n\t\t}\n\n\t\tscanner.close();\n\n\n\t}\n\n}",
"Main",
"public static void main(String[] args) {\n\n\t\tScanner scanner = new Scanner(System.in);\n\t\tint ans=0;\n\t\tint N = scanner.nextInt();\n\t\tint M = scanner.nextInt();\n\t\tfor(int i=0; i<M; i++) {\n\t\t\tint A = scanner.nextInt();\n\t\t\tans = ans + A;\n\t\t}\n\n\t\tans = N - ans;\n\t\tif(ans >= 0) {\n\t\t\tSystem.out.println(ans);\n\t\t}else {\n\t\t\tSystem.out.println(-1);\n\t\t}\n\n\t\tscanner.close();\n\n\n\t}",
"main",
"{\n\n\t\tScanner scanner = new Scanner(System.in);\n\t\tint ans=0;\n\t\tint N = scanner.nextInt();\n\t\tint M = scanner.nextInt();\n\t\tfor(int i=0; i<M; i++) {\n\t\t\tint A = scanner.nextInt();\n\t\t\tans = ans + A;\n\t\t}\n\n\t\tans = N - ans;\n\t\tif(ans >= 0) {\n\t\t\tSystem.out.println(ans);\n\t\t}else {\n\t\t\tSystem.out.println(-1);\n\t\t}\n\n\t\tscanner.close();\n\n\n\t}",
"Scanner scanner = new Scanner(System.in);",
"scanner",
"new Scanner(System.in)",
"int ans=0;",
"ans",
"0",
"int N = scanner.nextInt();",
"N",
"scanner.nextInt()",
"scanner.nextInt",
"scanner",
"int M = scanner.nextInt();",
"M",
"scanner.nextInt()",
"scanner.nextInt",
"scanner",
"for(int i=0; i<M; i++) {\n\t\t\tint A = scanner.nextInt();\n\t\t\tans = ans + A;\n\t\t}",
"int i=0;",
"int i=0;",
"i",
"0",
"i<M",
"i",
"M",
"i++",
"i++",
"i",
"{\n\t\t\tint A = scanner.nextInt();\n\t\t\tans = ans + A;\n\t\t}",
"{\n\t\t\tint A = scanner.nextInt();\n\t\t\tans = ans + A;\n\t\t}",
"int A = scanner.nextInt();",
"A",
"scanner.nextInt()",
"scanner.nextInt",
"scanner",
"ans = ans + A",
"ans",
"ans + A",
"ans",
"A",
"ans = N - ans",
"ans",
"N - ans",
"N",
"ans",
"if(ans >= 0) {\n\t\t\tSystem.out.println(ans);\n\t\t}else {\n\t\t\tSystem.out.println(-1);\n\t\t}",
"ans >= 0",
"ans",
"0",
"{\n\t\t\tSystem.out.println(ans);\n\t\t}",
"System.out.println(ans)",
"System.out.println",
"System.out",
"System",
"System.out",
"ans",
"{\n\t\t\tSystem.out.println(-1);\n\t\t}",
"System.out.println(-1)",
"System.out.println",
"System.out",
"System",
"System.out",
"-1",
"1",
"scanner.close()",
"scanner.close",
"scanner",
"String[] args",
"args",
"public class Main {\n\n\tpublic static void main(String[] args) {\n\n\t\tScanner scanner = new Scanner(System.in);\n\t\tint ans=0;\n\t\tint N = scanner.nextInt();\n\t\tint M = scanner.nextInt();\n\t\tfor(int i=0; i<M; i++) {\n\t\t\tint A = scanner.nextInt();\n\t\t\tans = ans + A;\n\t\t}\n\n\t\tans = N - ans;\n\t\tif(ans >= 0) {\n\t\t\tSystem.out.println(ans);\n\t\t}else {\n\t\t\tSystem.out.println(-1);\n\t\t}\n\n\t\tscanner.close();\n\n\n\t}\n\n}",
"public class Main {\n\n\tpublic static void main(String[] args) {\n\n\t\tScanner scanner = new Scanner(System.in);\n\t\tint ans=0;\n\t\tint N = scanner.nextInt();\n\t\tint M = scanner.nextInt();\n\t\tfor(int i=0; i<M; i++) {\n\t\t\tint A = scanner.nextInt();\n\t\t\tans = ans + A;\n\t\t}\n\n\t\tans = N - ans;\n\t\tif(ans >= 0) {\n\t\t\tSystem.out.println(ans);\n\t\t}else {\n\t\t\tSystem.out.println(-1);\n\t\t}\n\n\t\tscanner.close();\n\n\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 ans=0;
int N = scanner.nextInt();
int M = scanner.nextInt();
for(int i=0; i<M; i++) {
int A = scanner.nextInt();
ans = ans + A;
}
ans = N - ans;
if(ans >= 0) {
System.out.println(ans);
}else {
System.out.println(-1);
}
scanner.close();
}
}
|
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
41,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
41,
13,
20,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
0,
18,
13,
13,
4,
18,
13,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
18,
13,
13,
14,
2,
13,
13,
4,
18,
18,
13,
13,
2,
13,
13,
4,
18,
18,
13,
13,
40,
17,
23,
13,
6,
13,
41,
13,
41,
13,
12,
13,
30,
0,
13,
20,
12,
13,
30,
42,
2,
2,
13,
17,
40,
4,
18,
13,
30,
38,
5,
13,
30,
4,
18,
13,
30,
0,
13,
20,
29,
4,
18,
13,
12,
13,
30,
29,
4,
18,
13,
4,
13,
12,
13,
30,
29,
4,
18,
13,
4,
13,
12,
13,
30,
29,
4,
18,
13,
4,
13,
12,
13,
30,
41,
13,
17,
38,
5,
13,
30,
4,
18,
13,
30,
0,
13,
4,
18,
13,
29,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
10,
11
],
[
10,
12
],
[
0,
13
],
[
187,
14
],
[
187,
15
],
[
15,
16
],
[
187,
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
],
[
19,
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
],
[
50,
52
],
[
49,
53
],
[
53,
54
],
[
54,
55
],
[
19,
56
],
[
56,
57
],
[
56,
58
],
[
19,
59
],
[
59,
60
],
[
60,
61
],
[
61,
62
],
[
61,
63
],
[
59,
64
],
[
64,
65
],
[
64,
66
],
[
59,
67
],
[
67,
68
],
[
68,
69
],
[
59,
70
],
[
71,
71
],
[
71,
72
],
[
72,
73
],
[
72,
74
],
[
74,
75
],
[
74,
76
],
[
19,
77
],
[
77,
78
],
[
78,
79
],
[
78,
80
],
[
77,
81
],
[
81,
82
],
[
82,
83
],
[
83,
84
],
[
83,
85
],
[
81,
86
],
[
86,
87
],
[
86,
88
],
[
77,
89
],
[
89,
90
],
[
90,
91
],
[
91,
92
],
[
91,
93
],
[
89,
94
],
[
94,
95
],
[
17,
96
],
[
96,
97
],
[
187,
98
],
[
98,
99
],
[
98,
100
],
[
100,
101
],
[
98,
102
],
[
102,
103
],
[
98,
104
],
[
104,
105
],
[
104,
106
],
[
106,
107
],
[
107,
108
],
[
107,
109
],
[
98,
110
],
[
110,
111
],
[
110,
112
],
[
112,
113
],
[
113,
114
],
[
114,
115
],
[
115,
116
],
[
115,
117
],
[
114,
118
],
[
118,
119
],
[
119,
120
],
[
120,
121
],
[
113,
122
],
[
122,
123
],
[
123,
124
],
[
124,
125
],
[
124,
126
],
[
126,
127
],
[
127,
128
],
[
128,
129
],
[
123,
130
],
[
130,
131
],
[
131,
132
],
[
131,
133
],
[
112,
134
],
[
134,
135
],
[
135,
136
],
[
136,
137
],
[
98,
138
],
[
138,
139
],
[
138,
140
],
[
140,
141
],
[
141,
142
],
[
142,
143
],
[
143,
144
],
[
142,
145
],
[
145,
146
],
[
98,
147
],
[
147,
148
],
[
147,
149
],
[
149,
150
],
[
150,
151
],
[
151,
152
],
[
152,
153
],
[
151,
154
],
[
154,
155
],
[
98,
156
],
[
156,
157
],
[
156,
158
],
[
158,
159
],
[
159,
160
],
[
160,
161
],
[
161,
162
],
[
160,
163
],
[
163,
164
],
[
98,
165
],
[
165,
166
],
[
165,
167
],
[
167,
168
],
[
168,
169
],
[
168,
170
],
[
167,
171
],
[
171,
172
],
[
172,
173
],
[
172,
174
],
[
174,
175
],
[
175,
176
],
[
176,
177
],
[
171,
178
],
[
178,
179
],
[
179,
180
],
[
179,
181
],
[
181,
182
],
[
182,
183
],
[
167,
184
],
[
184,
185
],
[
0,
186
],
[
186,
187
],
[
186,
188
]
] |
[
"\nimport java.io.BufferedReader;\nimport java.io.IOException;\nimport java.io.InputStreamReader;\nimport java.util.StringTokenizer;\n\npublic class Main{\n static int dp[];\n static class FastReader {\n BufferedReader br;\n StringTokenizer st;\n\n\n public FastReader() {\n br = new BufferedReader(new InputStreamReader(System.in));\n }\n\n String next() {\n while (st == null || !st.hasMoreElements()) {\n try {\n st = new StringTokenizer(br.readLine());\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n return st.nextToken();\n }\n\n int nextInt() {\n return Integer.parseInt(next());\n }\n\n long nextLong() {\n return Long.parseLong(next());\n }\n\n double nextDouble() {\n return Double.parseDouble(next());\n }\n\n String nextLine() {\n String str = \"\";\n try {\n str = br.readLine();\n } catch (IOException e) {\n e.printStackTrace();\n }\n return str;\n }\n }\n\n public static void main(String[] args) {\n FastReader sc = new FastReader();\n int N=sc.nextInt(),M=sc.nextInt();\n int arr[]=new int[N];\n for (int i=0;i<M;i++) arr[i]=sc.nextInt();\n int sum=0;\n for (int i=0;i<M;i++)\n {\n sum+=arr[i];\n }\n if ( sum<=N ) System.out.println(N-sum);\n else System.out.println(-1);\n }\n}\n/*\n\n */",
"import java.io.BufferedReader;",
"BufferedReader",
"java.io",
"import java.io.IOException;",
"IOException",
"java.io",
"import java.io.InputStreamReader;",
"InputStreamReader",
"java.io",
"import java.util.StringTokenizer;",
"StringTokenizer",
"java.util",
"public class Main{\n static int dp[];\n static class FastReader {\n BufferedReader br;\n StringTokenizer st;\n\n\n public FastReader() {\n br = new BufferedReader(new InputStreamReader(System.in));\n }\n\n String next() {\n while (st == null || !st.hasMoreElements()) {\n try {\n st = new StringTokenizer(br.readLine());\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n return st.nextToken();\n }\n\n int nextInt() {\n return Integer.parseInt(next());\n }\n\n long nextLong() {\n return Long.parseLong(next());\n }\n\n double nextDouble() {\n return Double.parseDouble(next());\n }\n\n String nextLine() {\n String str = \"\";\n try {\n str = br.readLine();\n } catch (IOException e) {\n e.printStackTrace();\n }\n return str;\n }\n }\n\n public static void main(String[] args) {\n FastReader sc = new FastReader();\n int N=sc.nextInt(),M=sc.nextInt();\n int arr[]=new int[N];\n for (int i=0;i<M;i++) arr[i]=sc.nextInt();\n int sum=0;\n for (int i=0;i<M;i++)\n {\n sum+=arr[i];\n }\n if ( sum<=N ) System.out.println(N-sum);\n else System.out.println(-1);\n }\n}",
"Main",
"static int dp[];",
"dp",
"public static void main(String[] args) {\n FastReader sc = new FastReader();\n int N=sc.nextInt(),M=sc.nextInt();\n int arr[]=new int[N];\n for (int i=0;i<M;i++) arr[i]=sc.nextInt();\n int sum=0;\n for (int i=0;i<M;i++)\n {\n sum+=arr[i];\n }\n if ( sum<=N ) System.out.println(N-sum);\n else System.out.println(-1);\n }",
"main",
"{\n FastReader sc = new FastReader();\n int N=sc.nextInt(),M=sc.nextInt();\n int arr[]=new int[N];\n for (int i=0;i<M;i++) arr[i]=sc.nextInt();\n int sum=0;\n for (int i=0;i<M;i++)\n {\n sum+=arr[i];\n }\n if ( sum<=N ) System.out.println(N-sum);\n else System.out.println(-1);\n }",
"FastReader sc = new FastReader();",
"sc",
"new FastReader()",
"int N=sc.nextInt()",
"N",
"sc.nextInt()",
"sc.nextInt",
"sc",
"M=sc.nextInt();",
"M",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int arr[]=new int[N];",
"arr",
"new int[N]",
"N",
"for (int i=0;i<M;i++) arr[i]=sc.nextInt();",
"int i=0;",
"int i=0;",
"i",
"0",
"i<M",
"i",
"M",
"i++",
"i++",
"i",
"arr[i]=sc.nextInt();",
"arr[i]=sc.nextInt()",
"arr[i]",
"arr",
"i",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int sum=0;",
"sum",
"0",
"for (int i=0;i<M;i++)\n {\n sum+=arr[i];\n }",
"int i=0;",
"int i=0;",
"i",
"0",
"i<M",
"i",
"M",
"i++",
"i++",
"i",
"{\n sum+=arr[i];\n }",
"{\n sum+=arr[i];\n }",
"sum+=arr[i]",
"sum",
"arr[i]",
"arr",
"i",
"if ( sum<=N ) System.out.println(N-sum);\n else System.out.println(-1);",
"sum<=N",
"sum",
"N",
"System.out.println(N-sum)",
"System.out.println",
"System.out",
"System",
"System.out",
"N-sum",
"N",
"sum",
"System.out.println(-1)",
"System.out.println",
"System.out",
"System",
"System.out",
"-1",
"1",
"String[] args",
"args",
"static class FastReader {\n BufferedReader br;\n StringTokenizer st;\n\n\n public FastReader() {\n br = new BufferedReader(new InputStreamReader(System.in));\n }\n\n String next() {\n while (st == null || !st.hasMoreElements()) {\n try {\n st = new StringTokenizer(br.readLine());\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n return st.nextToken();\n }\n\n int nextInt() {\n return Integer.parseInt(next());\n }\n\n long nextLong() {\n return Long.parseLong(next());\n }\n\n double nextDouble() {\n return Double.parseDouble(next());\n }\n\n String nextLine() {\n String str = \"\";\n try {\n str = br.readLine();\n } catch (IOException e) {\n e.printStackTrace();\n }\n return str;\n }\n }",
"FastReader",
"BufferedReader br;",
"br",
"StringTokenizer st;",
"st",
"public FastReader() {\n br = new BufferedReader(new InputStreamReader(System.in));\n }",
"FastReader",
"{\n br = new BufferedReader(new InputStreamReader(System.in));\n }",
"br = new BufferedReader(new InputStreamReader(System.in))",
"br",
"new BufferedReader(new InputStreamReader(System.in))",
"String next() {\n while (st == null || !st.hasMoreElements()) {\n try {\n st = new StringTokenizer(br.readLine());\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n return st.nextToken();\n }",
"next",
"{\n while (st == null || !st.hasMoreElements()) {\n try {\n st = new StringTokenizer(br.readLine());\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n return st.nextToken();\n }",
"while (st == null || !st.hasMoreElements()) {\n try {\n st = new StringTokenizer(br.readLine());\n } catch (IOException e) {\n e.printStackTrace();\n }\n }",
"st == null || !st.hasMoreElements()",
"st == null",
"st",
"null",
"!st.hasMoreElements()",
"st.hasMoreElements()",
"st.hasMoreElements",
"st",
"{\n try {\n st = new StringTokenizer(br.readLine());\n } catch (IOException e) {\n e.printStackTrace();\n }\n }",
"try {\n st = new StringTokenizer(br.readLine());\n } catch (IOException e) {\n e.printStackTrace();\n }",
"catch (IOException e) {\n e.printStackTrace();\n }",
"IOException e",
"{\n e.printStackTrace();\n }",
"e.printStackTrace()",
"e.printStackTrace",
"e",
"{\n st = new StringTokenizer(br.readLine());\n }",
"st = new StringTokenizer(br.readLine())",
"st",
"new StringTokenizer(br.readLine())",
"return st.nextToken();",
"st.nextToken()",
"st.nextToken",
"st",
"int nextInt() {\n return Integer.parseInt(next());\n }",
"nextInt",
"{\n return Integer.parseInt(next());\n }",
"return Integer.parseInt(next());",
"Integer.parseInt(next())",
"Integer.parseInt",
"Integer",
"next()",
"next",
"long nextLong() {\n return Long.parseLong(next());\n }",
"nextLong",
"{\n return Long.parseLong(next());\n }",
"return Long.parseLong(next());",
"Long.parseLong(next())",
"Long.parseLong",
"Long",
"next()",
"next",
"double nextDouble() {\n return Double.parseDouble(next());\n }",
"nextDouble",
"{\n return Double.parseDouble(next());\n }",
"return Double.parseDouble(next());",
"Double.parseDouble(next())",
"Double.parseDouble",
"Double",
"next()",
"next",
"String nextLine() {\n String str = \"\";\n try {\n str = br.readLine();\n } catch (IOException e) {\n e.printStackTrace();\n }\n return str;\n }",
"nextLine",
"{\n String str = \"\";\n try {\n str = br.readLine();\n } catch (IOException e) {\n e.printStackTrace();\n }\n return str;\n }",
"String str = \"\";",
"str",
"\"\"",
"try {\n str = br.readLine();\n } catch (IOException e) {\n e.printStackTrace();\n }",
"catch (IOException e) {\n e.printStackTrace();\n }",
"IOException e",
"{\n e.printStackTrace();\n }",
"e.printStackTrace()",
"e.printStackTrace",
"e",
"{\n str = br.readLine();\n }",
"str = br.readLine()",
"str",
"br.readLine()",
"br.readLine",
"br",
"return str;",
"str",
"public class Main{\n static int dp[];\n static class FastReader {\n BufferedReader br;\n StringTokenizer st;\n\n\n public FastReader() {\n br = new BufferedReader(new InputStreamReader(System.in));\n }\n\n String next() {\n while (st == null || !st.hasMoreElements()) {\n try {\n st = new StringTokenizer(br.readLine());\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n return st.nextToken();\n }\n\n int nextInt() {\n return Integer.parseInt(next());\n }\n\n long nextLong() {\n return Long.parseLong(next());\n }\n\n double nextDouble() {\n return Double.parseDouble(next());\n }\n\n String nextLine() {\n String str = \"\";\n try {\n str = br.readLine();\n } catch (IOException e) {\n e.printStackTrace();\n }\n return str;\n }\n }\n\n public static void main(String[] args) {\n FastReader sc = new FastReader();\n int N=sc.nextInt(),M=sc.nextInt();\n int arr[]=new int[N];\n for (int i=0;i<M;i++) arr[i]=sc.nextInt();\n int sum=0;\n for (int i=0;i<M;i++)\n {\n sum+=arr[i];\n }\n if ( sum<=N ) System.out.println(N-sum);\n else System.out.println(-1);\n }\n}",
"public class Main{\n static int dp[];\n static class FastReader {\n BufferedReader br;\n StringTokenizer st;\n\n\n public FastReader() {\n br = new BufferedReader(new InputStreamReader(System.in));\n }\n\n String next() {\n while (st == null || !st.hasMoreElements()) {\n try {\n st = new StringTokenizer(br.readLine());\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n return st.nextToken();\n }\n\n int nextInt() {\n return Integer.parseInt(next());\n }\n\n long nextLong() {\n return Long.parseLong(next());\n }\n\n double nextDouble() {\n return Double.parseDouble(next());\n }\n\n String nextLine() {\n String str = \"\";\n try {\n str = br.readLine();\n } catch (IOException e) {\n e.printStackTrace();\n }\n return str;\n }\n }\n\n public static void main(String[] args) {\n FastReader sc = new FastReader();\n int N=sc.nextInt(),M=sc.nextInt();\n int arr[]=new int[N];\n for (int i=0;i<M;i++) arr[i]=sc.nextInt();\n int sum=0;\n for (int i=0;i<M;i++)\n {\n sum+=arr[i];\n }\n if ( sum<=N ) System.out.println(N-sum);\n else System.out.println(-1);\n }\n}",
"Main"
] |
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.StringTokenizer;
public class Main{
static int dp[];
static class FastReader {
BufferedReader br;
StringTokenizer st;
public FastReader() {
br = new BufferedReader(new InputStreamReader(System.in));
}
String next() {
while (st == null || !st.hasMoreElements()) {
try {
st = new StringTokenizer(br.readLine());
} catch (IOException e) {
e.printStackTrace();
}
}
return st.nextToken();
}
int nextInt() {
return Integer.parseInt(next());
}
long nextLong() {
return Long.parseLong(next());
}
double nextDouble() {
return Double.parseDouble(next());
}
String nextLine() {
String str = "";
try {
str = br.readLine();
} catch (IOException e) {
e.printStackTrace();
}
return str;
}
}
public static void main(String[] args) {
FastReader sc = new FastReader();
int N=sc.nextInt(),M=sc.nextInt();
int arr[]=new int[N];
for (int i=0;i<M;i++) arr[i]=sc.nextInt();
int sum=0;
for (int i=0;i<M;i++)
{
sum+=arr[i];
}
if ( sum<=N ) System.out.println(N-sum);
else System.out.println(-1);
}
}
/*
*/
|
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
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,
4,
18,
13,
0,
13,
13,
14,
2,
13,
17,
30,
4,
18,
18,
13,
13,
13,
30,
4,
18,
18,
13,
13,
40,
17,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
65,
5
],
[
65,
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
],
[
23,
24
],
[
24,
25
],
[
24,
26
],
[
22,
27
],
[
27,
28
],
[
27,
29
],
[
22,
30
],
[
30,
31
],
[
31,
32
],
[
22,
33
],
[
34,
34
],
[
34,
35
],
[
35,
36
],
[
35,
37
],
[
37,
38
],
[
38,
39
],
[
34,
40
],
[
40,
41
],
[
40,
42
],
[
8,
43
],
[
43,
44
],
[
44,
45
],
[
44,
46
],
[
43,
47
],
[
47,
48
],
[
48,
49
],
[
49,
50
],
[
50,
51
],
[
50,
52
],
[
48,
53
],
[
43,
54
],
[
54,
55
],
[
55,
56
],
[
56,
57
],
[
57,
58
],
[
57,
59
],
[
55,
60
],
[
60,
61
],
[
6,
62
],
[
62,
63
],
[
0,
64
],
[
64,
65
],
[
64,
66
]
] |
[
"import java.util.*;\n\npublic class Main {\n public static void main(String[] args) throws Exception {\n \n Scanner scanner = new Scanner(System.in);\n int N = scanner.nextInt();\n int M = scanner.nextInt();\n \n for(int i=0; i<M; i++){\n \n int A = scanner.nextInt();\n N -= A;\n }\n \n if(N>=0){\n System.out.println(N);\n }else{\n System.out.println(-1);\n }\n \n }\n}",
"import java.util.*;",
"util.*",
"java",
"public class Main {\n public static void main(String[] args) throws Exception {\n \n Scanner scanner = new Scanner(System.in);\n int N = scanner.nextInt();\n int M = scanner.nextInt();\n \n for(int i=0; i<M; i++){\n \n int A = scanner.nextInt();\n N -= A;\n }\n \n if(N>=0){\n System.out.println(N);\n }else{\n System.out.println(-1);\n }\n \n }\n}",
"Main",
"public static void main(String[] args) throws Exception {\n \n Scanner scanner = new Scanner(System.in);\n int N = scanner.nextInt();\n int M = scanner.nextInt();\n \n for(int i=0; i<M; i++){\n \n int A = scanner.nextInt();\n N -= A;\n }\n \n if(N>=0){\n System.out.println(N);\n }else{\n System.out.println(-1);\n }\n \n }",
"main",
"{\n \n Scanner scanner = new Scanner(System.in);\n int N = scanner.nextInt();\n int M = scanner.nextInt();\n \n for(int i=0; i<M; i++){\n \n int A = scanner.nextInt();\n N -= A;\n }\n \n if(N>=0){\n System.out.println(N);\n }else{\n System.out.println(-1);\n }\n \n }",
"Scanner scanner = new Scanner(System.in);",
"scanner",
"new Scanner(System.in)",
"int N = scanner.nextInt();",
"N",
"scanner.nextInt()",
"scanner.nextInt",
"scanner",
"int M = scanner.nextInt();",
"M",
"scanner.nextInt()",
"scanner.nextInt",
"scanner",
"for(int i=0; i<M; i++){\n \n int A = scanner.nextInt();\n N -= A;\n }",
"int i=0;",
"int i=0;",
"i",
"0",
"i<M",
"i",
"M",
"i++",
"i++",
"i",
"{\n \n int A = scanner.nextInt();\n N -= A;\n }",
"{\n \n int A = scanner.nextInt();\n N -= A;\n }",
"int A = scanner.nextInt();",
"A",
"scanner.nextInt()",
"scanner.nextInt",
"scanner",
"N -= A",
"N",
"A",
"if(N>=0){\n System.out.println(N);\n }else{\n System.out.println(-1);\n }",
"N>=0",
"N",
"0",
"{\n System.out.println(N);\n }",
"System.out.println(N)",
"System.out.println",
"System.out",
"System",
"System.out",
"N",
"{\n System.out.println(-1);\n }",
"System.out.println(-1)",
"System.out.println",
"System.out",
"System",
"System.out",
"-1",
"1",
"String[] args",
"args",
"public class Main {\n public static void main(String[] args) throws Exception {\n \n Scanner scanner = new Scanner(System.in);\n int N = scanner.nextInt();\n int M = scanner.nextInt();\n \n for(int i=0; i<M; i++){\n \n int A = scanner.nextInt();\n N -= A;\n }\n \n if(N>=0){\n System.out.println(N);\n }else{\n System.out.println(-1);\n }\n \n }\n}",
"public class Main {\n public static void main(String[] args) throws Exception {\n \n Scanner scanner = new Scanner(System.in);\n int N = scanner.nextInt();\n int M = scanner.nextInt();\n \n for(int i=0; i<M; i++){\n \n int A = scanner.nextInt();\n N -= A;\n }\n \n if(N>=0){\n System.out.println(N);\n }else{\n System.out.println(-1);\n }\n \n }\n}",
"Main"
] |
import java.util.*;
public class Main {
public static void main(String[] args) throws Exception {
Scanner scanner = new Scanner(System.in);
int N = scanner.nextInt();
int M = scanner.nextInt();
for(int i=0; i<M; i++){
int A = scanner.nextInt();
N -= A;
}
if(N>=0){
System.out.println(N);
}else{
System.out.println(-1);
}
}
}
|
[
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,
17,
0,
13,
4,
18,
4,
18,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
0,
13,
4,
18,
13,
18,
13,
13,
14,
2,
13,
13,
4,
18,
13,
40,
17,
4,
18,
13,
2,
13,
13,
4,
18,
13,
4,
18,
13,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
97,
8
],
[
97,
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,
45
],
[
45,
46
],
[
45,
47
],
[
47,
48
],
[
48,
49
],
[
49,
50
],
[
50,
51
],
[
47,
52
],
[
11,
53
],
[
53,
54
],
[
54,
55
],
[
55,
56
],
[
55,
57
],
[
53,
58
],
[
58,
59
],
[
58,
60
],
[
53,
61
],
[
61,
62
],
[
62,
63
],
[
53,
64
],
[
64,
65
],
[
65,
66
],
[
65,
67
],
[
67,
68
],
[
68,
69
],
[
67,
70
],
[
70,
71
],
[
70,
72
],
[
11,
73
],
[
73,
74
],
[
74,
75
],
[
74,
76
],
[
73,
77
],
[
77,
78
],
[
78,
79
],
[
77,
80
],
[
80,
81
],
[
73,
82
],
[
82,
83
],
[
83,
84
],
[
82,
85
],
[
85,
86
],
[
85,
87
],
[
11,
88
],
[
88,
89
],
[
89,
90
],
[
11,
91
],
[
91,
92
],
[
92,
93
],
[
9,
94
],
[
94,
95
],
[
0,
96
],
[
96,
97
],
[
96,
98
]
] |
[
"import java.util.*;\nimport java.io.*;\npublic class Main\n{\n public static void main(String args[])throws Exception\n {\n BufferedReader br=new BufferedReader(new InputStreamReader(System.in));\n PrintWriter pw=new PrintWriter(System.out);\n String str[]=br.readLine().split(\" \");\n int n=Integer.parseInt(str[0]);\n int m=Integer.parseInt(str[1]);\n int hw=0;\n str=br.readLine().split(\" \");\n for(int i=0;i<m;i++)\n hw+=Integer.parseInt(str[i]);\n if(hw>n)\n pw.println(-1);\n else\n pw.println(n-hw);\n pw.flush();\n pw.close();\n }\n}",
"import java.util.*;",
"util.*",
"java",
"import java.io.*;",
"io.*",
"java",
"public class Main\n{\n public static void main(String args[])throws Exception\n {\n BufferedReader br=new BufferedReader(new InputStreamReader(System.in));\n PrintWriter pw=new PrintWriter(System.out);\n String str[]=br.readLine().split(\" \");\n int n=Integer.parseInt(str[0]);\n int m=Integer.parseInt(str[1]);\n int hw=0;\n str=br.readLine().split(\" \");\n for(int i=0;i<m;i++)\n hw+=Integer.parseInt(str[i]);\n if(hw>n)\n pw.println(-1);\n else\n pw.println(n-hw);\n pw.flush();\n pw.close();\n }\n}",
"Main",
"public static void main(String args[])throws Exception\n {\n BufferedReader br=new BufferedReader(new InputStreamReader(System.in));\n PrintWriter pw=new PrintWriter(System.out);\n String str[]=br.readLine().split(\" \");\n int n=Integer.parseInt(str[0]);\n int m=Integer.parseInt(str[1]);\n int hw=0;\n str=br.readLine().split(\" \");\n for(int i=0;i<m;i++)\n hw+=Integer.parseInt(str[i]);\n if(hw>n)\n pw.println(-1);\n else\n pw.println(n-hw);\n pw.flush();\n pw.close();\n }",
"main",
"{\n BufferedReader br=new BufferedReader(new InputStreamReader(System.in));\n PrintWriter pw=new PrintWriter(System.out);\n String str[]=br.readLine().split(\" \");\n int n=Integer.parseInt(str[0]);\n int m=Integer.parseInt(str[1]);\n int hw=0;\n str=br.readLine().split(\" \");\n for(int i=0;i<m;i++)\n hw+=Integer.parseInt(str[i]);\n if(hw>n)\n pw.println(-1);\n else\n pw.println(n-hw);\n pw.flush();\n pw.close();\n }",
"BufferedReader br=new BufferedReader(new InputStreamReader(System.in));",
"br",
"new BufferedReader(new InputStreamReader(System.in))",
"PrintWriter pw=new PrintWriter(System.out);",
"pw",
"new PrintWriter(System.out)",
"String str[]=br.readLine().split(\" \");",
"str",
"br.readLine().split(\" \")",
"br.readLine().split",
"br.readLine()",
"br.readLine",
"br",
"\" \"",
"int n=Integer.parseInt(str[0]);",
"n",
"Integer.parseInt(str[0])",
"Integer.parseInt",
"Integer",
"str[0]",
"str",
"0",
"int m=Integer.parseInt(str[1]);",
"m",
"Integer.parseInt(str[1])",
"Integer.parseInt",
"Integer",
"str[1]",
"str",
"1",
"int hw=0;",
"hw",
"0",
"str=br.readLine().split(\" \")",
"str",
"br.readLine().split(\" \")",
"br.readLine().split",
"br.readLine()",
"br.readLine",
"br",
"\" \"",
"for(int i=0;i<m;i++)\n hw+=Integer.parseInt(str[i]);",
"int i=0;",
"int i=0;",
"i",
"0",
"i<m",
"i",
"m",
"i++",
"i++",
"i",
"hw+=Integer.parseInt(str[i]);",
"hw+=Integer.parseInt(str[i])",
"hw",
"Integer.parseInt(str[i])",
"Integer.parseInt",
"Integer",
"str[i]",
"str",
"i",
"if(hw>n)\n pw.println(-1);\n else\n pw.println(n-hw);",
"hw>n",
"hw",
"n",
"pw.println(-1)",
"pw.println",
"pw",
"-1",
"1",
"pw.println(n-hw)",
"pw.println",
"pw",
"n-hw",
"n",
"hw",
"pw.flush()",
"pw.flush",
"pw",
"pw.close()",
"pw.close",
"pw",
"String args[]",
"args",
"public class Main\n{\n public static void main(String args[])throws Exception\n {\n BufferedReader br=new BufferedReader(new InputStreamReader(System.in));\n PrintWriter pw=new PrintWriter(System.out);\n String str[]=br.readLine().split(\" \");\n int n=Integer.parseInt(str[0]);\n int m=Integer.parseInt(str[1]);\n int hw=0;\n str=br.readLine().split(\" \");\n for(int i=0;i<m;i++)\n hw+=Integer.parseInt(str[i]);\n if(hw>n)\n pw.println(-1);\n else\n pw.println(n-hw);\n pw.flush();\n pw.close();\n }\n}",
"public class Main\n{\n public static void main(String args[])throws Exception\n {\n BufferedReader br=new BufferedReader(new InputStreamReader(System.in));\n PrintWriter pw=new PrintWriter(System.out);\n String str[]=br.readLine().split(\" \");\n int n=Integer.parseInt(str[0]);\n int m=Integer.parseInt(str[1]);\n int hw=0;\n str=br.readLine().split(\" \");\n for(int i=0;i<m;i++)\n hw+=Integer.parseInt(str[i]);\n if(hw>n)\n pw.println(-1);\n else\n pw.println(n-hw);\n pw.flush();\n pw.close();\n }\n}",
"Main"
] |
import java.util.*;
import java.io.*;
public class Main
{
public static void main(String args[])throws Exception
{
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
PrintWriter pw=new PrintWriter(System.out);
String str[]=br.readLine().split(" ");
int n=Integer.parseInt(str[0]);
int m=Integer.parseInt(str[1]);
int hw=0;
str=br.readLine().split(" ");
for(int i=0;i<m;i++)
hw+=Integer.parseInt(str[i]);
if(hw>n)
pw.println(-1);
else
pw.println(n-hw);
pw.flush();
pw.close();
}
}
|
[
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,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
18,
13,
13,
4,
18,
13,
4,
18,
13,
0,
13,
18,
13,
13,
4,
18,
13,
4,
18,
18,
13,
13,
8,
2,
13,
17,
13,
40,
17,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
78,
5
],
[
78,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
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,
32
],
[
32,
33
],
[
33,
34
],
[
34,
35
],
[
34,
36
],
[
32,
37
],
[
37,
38
],
[
37,
39
],
[
32,
40
],
[
40,
41
],
[
41,
42
],
[
32,
43
],
[
44,
44
],
[
44,
45
],
[
45,
46
],
[
46,
47
],
[
46,
48
],
[
45,
49
],
[
49,
50
],
[
50,
51
],
[
49,
52
],
[
52,
53
],
[
53,
54
],
[
44,
55
],
[
55,
56
],
[
55,
57
],
[
57,
58
],
[
57,
59
],
[
8,
60
],
[
60,
61
],
[
61,
62
],
[
8,
63
],
[
63,
64
],
[
64,
65
],
[
65,
66
],
[
65,
67
],
[
63,
68
],
[
68,
69
],
[
69,
70
],
[
69,
71
],
[
68,
72
],
[
68,
73
],
[
73,
74
],
[
6,
75
],
[
75,
76
],
[
0,
77
],
[
77,
78
],
[
77,
79
]
] |
[
"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 N = Integer.parseInt(sc.next());\n\t\tint M = Integer.parseInt(sc.next());\n\t\tint[] arrayHomework = new int[M];\n\n\t\tfor (int i = 0; i < M; i++) {\n\t\t\tarrayHomework[i] = Integer.parseInt(sc.next());\n\t\t\tN -= arrayHomework[i];\n\t\t}\n\t\tsc.close();\n\n\t\tSystem.out.println(N >= 0 ? N : -1);\n\n\t}\n\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n\n\tpublic static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\tint N = Integer.parseInt(sc.next());\n\t\tint M = Integer.parseInt(sc.next());\n\t\tint[] arrayHomework = new int[M];\n\n\t\tfor (int i = 0; i < M; i++) {\n\t\t\tarrayHomework[i] = Integer.parseInt(sc.next());\n\t\t\tN -= arrayHomework[i];\n\t\t}\n\t\tsc.close();\n\n\t\tSystem.out.println(N >= 0 ? N : -1);\n\n\t}\n\n}",
"Main",
"public static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\tint N = Integer.parseInt(sc.next());\n\t\tint M = Integer.parseInt(sc.next());\n\t\tint[] arrayHomework = new int[M];\n\n\t\tfor (int i = 0; i < M; i++) {\n\t\t\tarrayHomework[i] = Integer.parseInt(sc.next());\n\t\t\tN -= arrayHomework[i];\n\t\t}\n\t\tsc.close();\n\n\t\tSystem.out.println(N >= 0 ? N : -1);\n\n\t}",
"main",
"{\n\t\tScanner sc = new Scanner(System.in);\n\t\tint N = Integer.parseInt(sc.next());\n\t\tint M = Integer.parseInt(sc.next());\n\t\tint[] arrayHomework = new int[M];\n\n\t\tfor (int i = 0; i < M; i++) {\n\t\t\tarrayHomework[i] = Integer.parseInt(sc.next());\n\t\t\tN -= arrayHomework[i];\n\t\t}\n\t\tsc.close();\n\n\t\tSystem.out.println(N >= 0 ? N : -1);\n\n\t}",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"int N = Integer.parseInt(sc.next());",
"N",
"Integer.parseInt(sc.next())",
"Integer.parseInt",
"Integer",
"sc.next()",
"sc.next",
"sc",
"int M = Integer.parseInt(sc.next());",
"M",
"Integer.parseInt(sc.next())",
"Integer.parseInt",
"Integer",
"sc.next()",
"sc.next",
"sc",
"int[] arrayHomework = new int[M];",
"arrayHomework",
"new int[M]",
"M",
"for (int i = 0; i < M; i++) {\n\t\t\tarrayHomework[i] = Integer.parseInt(sc.next());\n\t\t\tN -= arrayHomework[i];\n\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < M",
"i",
"M",
"i++",
"i++",
"i",
"{\n\t\t\tarrayHomework[i] = Integer.parseInt(sc.next());\n\t\t\tN -= arrayHomework[i];\n\t\t}",
"{\n\t\t\tarrayHomework[i] = Integer.parseInt(sc.next());\n\t\t\tN -= arrayHomework[i];\n\t\t}",
"arrayHomework[i] = Integer.parseInt(sc.next())",
"arrayHomework[i]",
"arrayHomework",
"i",
"Integer.parseInt(sc.next())",
"Integer.parseInt",
"Integer",
"sc.next()",
"sc.next",
"sc",
"N -= arrayHomework[i]",
"N",
"arrayHomework[i]",
"arrayHomework",
"i",
"sc.close()",
"sc.close",
"sc",
"System.out.println(N >= 0 ? N : -1)",
"System.out.println",
"System.out",
"System",
"System.out",
"N >= 0 ? N : -1",
"N >= 0",
"N",
"0",
"N",
"-1",
"1",
"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 N = Integer.parseInt(sc.next());\n\t\tint M = Integer.parseInt(sc.next());\n\t\tint[] arrayHomework = new int[M];\n\n\t\tfor (int i = 0; i < M; i++) {\n\t\t\tarrayHomework[i] = Integer.parseInt(sc.next());\n\t\t\tN -= arrayHomework[i];\n\t\t}\n\t\tsc.close();\n\n\t\tSystem.out.println(N >= 0 ? N : -1);\n\n\t}\n\n}",
"public class Main {\n\n\tpublic static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\tint N = Integer.parseInt(sc.next());\n\t\tint M = Integer.parseInt(sc.next());\n\t\tint[] arrayHomework = new int[M];\n\n\t\tfor (int i = 0; i < M; i++) {\n\t\t\tarrayHomework[i] = Integer.parseInt(sc.next());\n\t\t\tN -= arrayHomework[i];\n\t\t}\n\t\tsc.close();\n\n\t\tSystem.out.println(N >= 0 ? N : -1);\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 N = Integer.parseInt(sc.next());
int M = Integer.parseInt(sc.next());
int[] arrayHomework = new int[M];
for (int i = 0; i < M; i++) {
arrayHomework[i] = Integer.parseInt(sc.next());
N -= arrayHomework[i];
}
sc.close();
System.out.println(N >= 0 ? N : -1);
}
}
|
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
41,
13,
4,
18,
13,
0,
13,
2,
13,
13,
14,
2,
13,
13,
30,
4,
18,
18,
13,
13,
17,
30,
4,
18,
18,
13,
13,
2,
13,
13,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
71,
5
],
[
71,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
8,
17
],
[
17,
18
],
[
17,
19
],
[
19,
20
],
[
20,
21
],
[
8,
22
],
[
22,
23
],
[
22,
24
],
[
8,
25
],
[
25,
26
],
[
26,
27
],
[
27,
28
],
[
27,
29
],
[
25,
30
],
[
30,
31
],
[
30,
32
],
[
25,
33
],
[
33,
34
],
[
34,
35
],
[
25,
36
],
[
37,
37
],
[
37,
38
],
[
38,
39
],
[
38,
40
],
[
40,
41
],
[
41,
42
],
[
37,
43
],
[
43,
44
],
[
43,
45
],
[
45,
46
],
[
45,
47
],
[
8,
48
],
[
48,
49
],
[
49,
50
],
[
49,
51
],
[
48,
52
],
[
52,
53
],
[
53,
54
],
[
54,
55
],
[
55,
56
],
[
55,
57
],
[
53,
58
],
[
48,
59
],
[
59,
60
],
[
60,
61
],
[
61,
62
],
[
62,
63
],
[
62,
64
],
[
60,
65
],
[
65,
66
],
[
65,
67
],
[
6,
68
],
[
68,
69
],
[
0,
70
],
[
70,
71
],
[
70,
72
]
] |
[
"import java.util.*;\npublic class Main {\n\tpublic static void main(String[] args){\n\t\tScanner sc = new Scanner(System.in);\n\t\t// ๆดๆฐใฎๅ
ฅๅ\n\t\tint n = sc.nextInt();\n\t\tint m = sc.nextInt();\n\t\tint sum = 0;\n\t\tfor (int i = 0; i < m; i++) {\n\t\t\tint a = sc.nextInt();\n\t\t\tsum = sum + a;\n\t\t}\n\t\t\n\t\tif (n < sum) {\n\t\t\tSystem.out.println(\"-1\");\n\t\t} else {\n\t\t\tSystem.out.println(n - sum);\n\t\t}\n\t}\n}",
"import java.util.*;",
"util.*",
"java",
"public class Main {\n\tpublic static void main(String[] args){\n\t\tScanner sc = new Scanner(System.in);\n\t\t// ๆดๆฐใฎๅ
ฅๅ\n\t\tint n = sc.nextInt();\n\t\tint m = sc.nextInt();\n\t\tint sum = 0;\n\t\tfor (int i = 0; i < m; i++) {\n\t\t\tint a = sc.nextInt();\n\t\t\tsum = sum + a;\n\t\t}\n\t\t\n\t\tif (n < sum) {\n\t\t\tSystem.out.println(\"-1\");\n\t\t} else {\n\t\t\tSystem.out.println(n - sum);\n\t\t}\n\t}\n}",
"Main",
"public static void main(String[] args){\n\t\tScanner sc = new Scanner(System.in);\n\t\t// ๆดๆฐใฎๅ
ฅๅ\n\t\tint n = sc.nextInt();\n\t\tint m = sc.nextInt();\n\t\tint sum = 0;\n\t\tfor (int i = 0; i < m; i++) {\n\t\t\tint a = sc.nextInt();\n\t\t\tsum = sum + a;\n\t\t}\n\t\t\n\t\tif (n < sum) {\n\t\t\tSystem.out.println(\"-1\");\n\t\t} else {\n\t\t\tSystem.out.println(n - sum);\n\t\t}\n\t}",
"main",
"{\n\t\tScanner sc = new Scanner(System.in);\n\t\t// ๆดๆฐใฎๅ
ฅๅ\n\t\tint n = sc.nextInt();\n\t\tint m = sc.nextInt();\n\t\tint sum = 0;\n\t\tfor (int i = 0; i < m; i++) {\n\t\t\tint a = sc.nextInt();\n\t\t\tsum = sum + a;\n\t\t}\n\t\t\n\t\tif (n < sum) {\n\t\t\tSystem.out.println(\"-1\");\n\t\t} else {\n\t\t\tSystem.out.println(n - sum);\n\t\t}\n\t}",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"int n = sc.nextInt();",
"n",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int m = sc.nextInt();",
"m",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int sum = 0;",
"sum",
"0",
"for (int i = 0; i < m; i++) {\n\t\t\tint a = sc.nextInt();\n\t\t\tsum = sum + a;\n\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < m",
"i",
"m",
"i++",
"i++",
"i",
"{\n\t\t\tint a = sc.nextInt();\n\t\t\tsum = sum + a;\n\t\t}",
"{\n\t\t\tint a = sc.nextInt();\n\t\t\tsum = sum + a;\n\t\t}",
"int a = sc.nextInt();",
"a",
"sc.nextInt()",
"sc.nextInt",
"sc",
"sum = sum + a",
"sum",
"sum + a",
"sum",
"a",
"if (n < sum) {\n\t\t\tSystem.out.println(\"-1\");\n\t\t} else {\n\t\t\tSystem.out.println(n - sum);\n\t\t}",
"n < sum",
"n",
"sum",
"{\n\t\t\tSystem.out.println(\"-1\");\n\t\t}",
"System.out.println(\"-1\")",
"System.out.println",
"System.out",
"System",
"System.out",
"\"-1\"",
"{\n\t\t\tSystem.out.println(n - sum);\n\t\t}",
"System.out.println(n - sum)",
"System.out.println",
"System.out",
"System",
"System.out",
"n - sum",
"n",
"sum",
"String[] args",
"args",
"public class Main {\n\tpublic static void main(String[] args){\n\t\tScanner sc = new Scanner(System.in);\n\t\t// ๆดๆฐใฎๅ
ฅๅ\n\t\tint n = sc.nextInt();\n\t\tint m = sc.nextInt();\n\t\tint sum = 0;\n\t\tfor (int i = 0; i < m; i++) {\n\t\t\tint a = sc.nextInt();\n\t\t\tsum = sum + a;\n\t\t}\n\t\t\n\t\tif (n < sum) {\n\t\t\tSystem.out.println(\"-1\");\n\t\t} else {\n\t\t\tSystem.out.println(n - sum);\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\t// ๆดๆฐใฎๅ
ฅๅ\n\t\tint n = sc.nextInt();\n\t\tint m = sc.nextInt();\n\t\tint sum = 0;\n\t\tfor (int i = 0; i < m; i++) {\n\t\t\tint a = sc.nextInt();\n\t\t\tsum = sum + a;\n\t\t}\n\t\t\n\t\tif (n < sum) {\n\t\t\tSystem.out.println(\"-1\");\n\t\t} else {\n\t\t\tSystem.out.println(n - sum);\n\t\t}\n\t}\n}",
"Main"
] |
import java.util.*;
public class Main {
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
// ๆดๆฐใฎๅ
ฅๅ
int n = sc.nextInt();
int m = sc.nextInt();
int sum = 0;
for (int i = 0; i < m; i++) {
int a = sc.nextInt();
sum = sum + a;
}
if (n < sum) {
System.out.println("-1");
} else {
System.out.println(n - sum);
}
}
}
|
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
41,
13,
41,
13,
41,
13,
20,
0,
13,
4,
18,
13,
0,
13,
4,
18,
13,
0,
13,
13,
41,
13,
20,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
4,
18,
13,
4,
18,
13,
0,
13,
4,
18,
13,
13,
14,
2,
13,
17,
30,
4,
18,
18,
13,
13,
17,
30,
4,
18,
18,
13,
13,
13,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
80,
5
],
[
80,
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
],
[
20,
21
],
[
21,
22
],
[
8,
23
],
[
23,
24
],
[
23,
25
],
[
25,
26
],
[
26,
27
],
[
8,
28
],
[
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
],
[
47,
50
],
[
50,
51
],
[
51,
52
],
[
46,
53
],
[
53,
54
],
[
53,
55
],
[
55,
56
],
[
56,
57
],
[
55,
58
],
[
8,
59
],
[
59,
60
],
[
60,
61
],
[
60,
62
],
[
59,
63
],
[
63,
64
],
[
64,
65
],
[
65,
66
],
[
66,
67
],
[
66,
68
],
[
64,
69
],
[
59,
70
],
[
70,
71
],
[
71,
72
],
[
72,
73
],
[
73,
74
],
[
73,
75
],
[
71,
76
],
[
6,
77
],
[
77,
78
],
[
0,
79
],
[
79,
80
],
[
79,
81
]
] |
[
"import java.util.*;\n\npublic class Main{\n public static void main(String[] args){\n Long N, M, result;\n Scanner sc = new Scanner(System.in);\n N =sc.nextLong();\n M =sc.nextLong();\n result = N;\n ArrayList<Long> studyDays = new ArrayList<Long>();\n for(int i = 0; i < M; i ++){\n studyDays.add(sc.nextLong());\n result -= studyDays.get(i);\n }\n if(result < 0){\n System.out.println(\"-1\"); \n }else{\n System.out.println(result);\n }\n }\n}\n",
"import java.util.*;",
"util.*",
"java",
"public class Main{\n public static void main(String[] args){\n Long N, M, result;\n Scanner sc = new Scanner(System.in);\n N =sc.nextLong();\n M =sc.nextLong();\n result = N;\n ArrayList<Long> studyDays = new ArrayList<Long>();\n for(int i = 0; i < M; i ++){\n studyDays.add(sc.nextLong());\n result -= studyDays.get(i);\n }\n if(result < 0){\n System.out.println(\"-1\"); \n }else{\n System.out.println(result);\n }\n }\n}",
"Main",
"public static void main(String[] args){\n Long N, M, result;\n Scanner sc = new Scanner(System.in);\n N =sc.nextLong();\n M =sc.nextLong();\n result = N;\n ArrayList<Long> studyDays = new ArrayList<Long>();\n for(int i = 0; i < M; i ++){\n studyDays.add(sc.nextLong());\n result -= studyDays.get(i);\n }\n if(result < 0){\n System.out.println(\"-1\"); \n }else{\n System.out.println(result);\n }\n }",
"main",
"{\n Long N, M, result;\n Scanner sc = new Scanner(System.in);\n N =sc.nextLong();\n M =sc.nextLong();\n result = N;\n ArrayList<Long> studyDays = new ArrayList<Long>();\n for(int i = 0; i < M; i ++){\n studyDays.add(sc.nextLong());\n result -= studyDays.get(i);\n }\n if(result < 0){\n System.out.println(\"-1\"); \n }else{\n System.out.println(result);\n }\n }",
"Long N",
"N",
"M",
"M",
"result;",
"result",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"N =sc.nextLong()",
"N",
"sc.nextLong()",
"sc.nextLong",
"sc",
"M =sc.nextLong()",
"M",
"sc.nextLong()",
"sc.nextLong",
"sc",
"result = N",
"result",
"N",
"ArrayList<Long> studyDays = new ArrayList<Long>();",
"studyDays",
"new ArrayList<Long>()",
"for(int i = 0; i < M; i ++){\n studyDays.add(sc.nextLong());\n result -= studyDays.get(i);\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < M",
"i",
"M",
"i ++",
"i ++",
"i",
"{\n studyDays.add(sc.nextLong());\n result -= studyDays.get(i);\n }",
"{\n studyDays.add(sc.nextLong());\n result -= studyDays.get(i);\n }",
"studyDays.add(sc.nextLong())",
"studyDays.add",
"studyDays",
"sc.nextLong()",
"sc.nextLong",
"sc",
"result -= studyDays.get(i)",
"result",
"studyDays.get(i)",
"studyDays.get",
"studyDays",
"i",
"if(result < 0){\n System.out.println(\"-1\"); \n }else{\n System.out.println(result);\n }",
"result < 0",
"result",
"0",
"{\n System.out.println(\"-1\"); \n }",
"System.out.println(\"-1\")",
"System.out.println",
"System.out",
"System",
"System.out",
"\"-1\"",
"{\n System.out.println(result);\n }",
"System.out.println(result)",
"System.out.println",
"System.out",
"System",
"System.out",
"result",
"String[] args",
"args",
"public class Main{\n public static void main(String[] args){\n Long N, M, result;\n Scanner sc = new Scanner(System.in);\n N =sc.nextLong();\n M =sc.nextLong();\n result = N;\n ArrayList<Long> studyDays = new ArrayList<Long>();\n for(int i = 0; i < M; i ++){\n studyDays.add(sc.nextLong());\n result -= studyDays.get(i);\n }\n if(result < 0){\n System.out.println(\"-1\"); \n }else{\n System.out.println(result);\n }\n }\n}",
"public class Main{\n public static void main(String[] args){\n Long N, M, result;\n Scanner sc = new Scanner(System.in);\n N =sc.nextLong();\n M =sc.nextLong();\n result = N;\n ArrayList<Long> studyDays = new ArrayList<Long>();\n for(int i = 0; i < M; i ++){\n studyDays.add(sc.nextLong());\n result -= studyDays.get(i);\n }\n if(result < 0){\n System.out.println(\"-1\"); \n }else{\n System.out.println(result);\n }\n }\n}",
"Main"
] |
import java.util.*;
public class Main{
public static void main(String[] args){
Long N, M, result;
Scanner sc = new Scanner(System.in);
N =sc.nextLong();
M =sc.nextLong();
result = N;
ArrayList<Long> studyDays = new ArrayList<Long>();
for(int i = 0; i < M; i ++){
studyDays.add(sc.nextLong());
result -= studyDays.get(i);
}
if(result < 0){
System.out.println("-1");
}else{
System.out.println(result);
}
}
}
|
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
4,
18,
13,
4,
18,
18,
13,
13,
8,
2,
13,
17,
13,
40,
17,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
55,
5
],
[
55,
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
],
[
23,
24
],
[
24,
25
],
[
24,
26
],
[
22,
27
],
[
27,
28
],
[
27,
29
],
[
22,
30
],
[
30,
31
],
[
31,
32
],
[
22,
33
],
[
34,
34
],
[
34,
35
],
[
35,
36
],
[
35,
37
],
[
37,
38
],
[
38,
39
],
[
8,
40
],
[
40,
41
],
[
41,
42
],
[
42,
43
],
[
42,
44
],
[
40,
45
],
[
45,
46
],
[
46,
47
],
[
46,
48
],
[
45,
49
],
[
45,
50
],
[
50,
51
],
[
6,
52
],
[
52,
53
],
[
0,
54
],
[
54,
55
],
[
54,
56
]
] |
[
"import java.util.*;\n\npublic class Main {\n public static void main(String[] args) throws Exception {\n Scanner sc = new Scanner(System.in);\n int n = sc.nextInt();\n int m = sc.nextInt();\n \n for(int i=0; i<m; i++){\n n -= sc.nextInt();\n }\n \n System.out.println(n>=0?n:-1);\n }\n}",
"import java.util.*;",
"util.*",
"java",
"public class Main {\n public static void main(String[] args) throws Exception {\n Scanner sc = new Scanner(System.in);\n int n = sc.nextInt();\n int m = sc.nextInt();\n \n for(int i=0; i<m; i++){\n n -= sc.nextInt();\n }\n \n System.out.println(n>=0?n:-1);\n }\n}",
"Main",
"public static void main(String[] args) throws Exception {\n Scanner sc = new Scanner(System.in);\n int n = sc.nextInt();\n int m = sc.nextInt();\n \n for(int i=0; i<m; i++){\n n -= sc.nextInt();\n }\n \n System.out.println(n>=0?n:-1);\n }",
"main",
"{\n Scanner sc = new Scanner(System.in);\n int n = sc.nextInt();\n int m = sc.nextInt();\n \n for(int i=0; i<m; i++){\n n -= sc.nextInt();\n }\n \n System.out.println(n>=0?n:-1);\n }",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"int n = sc.nextInt();",
"n",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int m = sc.nextInt();",
"m",
"sc.nextInt()",
"sc.nextInt",
"sc",
"for(int i=0; i<m; i++){\n n -= sc.nextInt();\n }",
"int i=0;",
"int i=0;",
"i",
"0",
"i<m",
"i",
"m",
"i++",
"i++",
"i",
"{\n n -= sc.nextInt();\n }",
"{\n n -= sc.nextInt();\n }",
"n -= sc.nextInt()",
"n",
"sc.nextInt()",
"sc.nextInt",
"sc",
"System.out.println(n>=0?n:-1)",
"System.out.println",
"System.out",
"System",
"System.out",
"n>=0?n:-1",
"n>=0",
"n",
"0",
"n",
"-1",
"1",
"String[] args",
"args",
"public class Main {\n public static void main(String[] args) throws Exception {\n Scanner sc = new Scanner(System.in);\n int n = sc.nextInt();\n int m = sc.nextInt();\n \n for(int i=0; i<m; i++){\n n -= sc.nextInt();\n }\n \n System.out.println(n>=0?n:-1);\n }\n}",
"public class Main {\n public static void main(String[] args) throws Exception {\n Scanner sc = new Scanner(System.in);\n int n = sc.nextInt();\n int m = sc.nextInt();\n \n for(int i=0; i<m; i++){\n n -= sc.nextInt();\n }\n \n System.out.println(n>=0?n:-1);\n }\n}",
"Main"
] |
import java.util.*;
public class Main {
public static void main(String[] args) throws Exception {
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
int m = sc.nextInt();
for(int i=0; i<m; i++){
n -= sc.nextInt();
}
System.out.println(n>=0?n:-1);
}
}
|
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
41,
13,
20,
13,
41,
13,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
18,
13,
13,
4,
18,
13,
0,
13,
18,
13,
13,
4,
18,
18,
13,
13,
8,
2,
13,
17,
13,
40,
17,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
69,
5
],
[
69,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
8,
17
],
[
17,
18
],
[
17,
19
],
[
19,
20
],
[
20,
21
],
[
8,
22
],
[
22,
23
],
[
22,
24
],
[
8,
26
],
[
26,
27
],
[
26,
28
],
[
8,
29
],
[
29,
30
],
[
30,
31
],
[
31,
32
],
[
31,
33
],
[
29,
34
],
[
34,
35
],
[
34,
36
],
[
29,
37
],
[
37,
38
],
[
38,
39
],
[
29,
40
],
[
41,
41
],
[
41,
42
],
[
42,
43
],
[
43,
44
],
[
43,
45
],
[
42,
46
],
[
46,
47
],
[
47,
48
],
[
41,
49
],
[
49,
50
],
[
49,
51
],
[
51,
52
],
[
51,
53
],
[
8,
54
],
[
54,
55
],
[
55,
56
],
[
56,
57
],
[
56,
58
],
[
54,
59
],
[
59,
60
],
[
60,
61
],
[
60,
62
],
[
59,
63
],
[
59,
64
],
[
64,
65
],
[
6,
66
],
[
66,
67
],
[
0,
68
],
[
68,
69
],
[
68,
70
]
] |
[
"\nimport java.util.Scanner;\n\npublic class Main {\n\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n long N = sc.nextLong();\n int M = sc.nextInt();\n long[] A = new long[M];\n long ans = N;\n for(int i=0;i<M;i++){\n A[i] = sc.nextInt();\n ans -= A[i];\n }\n System.out.println(ans >= 0 ? ans : -1);\n }\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n long N = sc.nextLong();\n int M = sc.nextInt();\n long[] A = new long[M];\n long ans = N;\n for(int i=0;i<M;i++){\n A[i] = sc.nextInt();\n ans -= A[i];\n }\n System.out.println(ans >= 0 ? ans : -1);\n }\n}",
"Main",
"public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n long N = sc.nextLong();\n int M = sc.nextInt();\n long[] A = new long[M];\n long ans = N;\n for(int i=0;i<M;i++){\n A[i] = sc.nextInt();\n ans -= A[i];\n }\n System.out.println(ans >= 0 ? ans : -1);\n }",
"main",
"{\n Scanner sc = new Scanner(System.in);\n long N = sc.nextLong();\n int M = sc.nextInt();\n long[] A = new long[M];\n long ans = N;\n for(int i=0;i<M;i++){\n A[i] = sc.nextInt();\n ans -= A[i];\n }\n System.out.println(ans >= 0 ? ans : -1);\n }",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"long N = sc.nextLong();",
"N",
"sc.nextLong()",
"sc.nextLong",
"sc",
"int M = sc.nextInt();",
"M",
"sc.nextInt()",
"sc.nextInt",
"sc",
"long[] A = new long[M];",
"A",
"new long[M]",
"M",
"long ans = N;",
"ans",
"N",
"for(int i=0;i<M;i++){\n A[i] = sc.nextInt();\n ans -= A[i];\n }",
"int i=0;",
"int i=0;",
"i",
"0",
"i<M",
"i",
"M",
"i++",
"i++",
"i",
"{\n A[i] = sc.nextInt();\n ans -= A[i];\n }",
"{\n A[i] = sc.nextInt();\n ans -= A[i];\n }",
"A[i] = sc.nextInt()",
"A[i]",
"A",
"i",
"sc.nextInt()",
"sc.nextInt",
"sc",
"ans -= A[i]",
"ans",
"A[i]",
"A",
"i",
"System.out.println(ans >= 0 ? ans : -1)",
"System.out.println",
"System.out",
"System",
"System.out",
"ans >= 0 ? ans : -1",
"ans >= 0",
"ans",
"0",
"ans",
"-1",
"1",
"String[] args",
"args",
"public class Main {\n\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n long N = sc.nextLong();\n int M = sc.nextInt();\n long[] A = new long[M];\n long ans = N;\n for(int i=0;i<M;i++){\n A[i] = sc.nextInt();\n ans -= A[i];\n }\n System.out.println(ans >= 0 ? ans : -1);\n }\n}",
"public class Main {\n\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n long N = sc.nextLong();\n int M = sc.nextInt();\n long[] A = new long[M];\n long ans = N;\n for(int i=0;i<M;i++){\n A[i] = sc.nextInt();\n ans -= A[i];\n }\n System.out.println(ans >= 0 ? ans : -1);\n }\n}",
"Main"
] |
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
long N = sc.nextLong();
int M = sc.nextInt();
long[] A = new long[M];
long ans = N;
for(int i=0;i<M;i++){
A[i] = sc.nextInt();
ans -= A[i];
}
System.out.println(ans >= 0 ? ans : -1);
}
}
|
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
4,
18,
13,
14,
2,
13,
13,
4,
18,
18,
13,
13,
40,
17,
4,
18,
18,
13,
13,
2,
13,
13,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
65,
5
],
[
65,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
8,
17
],
[
17,
18
],
[
17,
19
],
[
19,
20
],
[
20,
21
],
[
8,
22
],
[
22,
23
],
[
22,
24
],
[
8,
25
],
[
25,
26
],
[
26,
27
],
[
27,
28
],
[
27,
29
],
[
25,
30
],
[
30,
31
],
[
30,
32
],
[
25,
33
],
[
33,
34
],
[
34,
35
],
[
25,
36
],
[
37,
37
],
[
37,
38
],
[
38,
39
],
[
38,
40
],
[
40,
41
],
[
41,
42
],
[
8,
43
],
[
43,
44
],
[
44,
45
],
[
44,
46
],
[
43,
47
],
[
47,
48
],
[
48,
49
],
[
49,
50
],
[
49,
51
],
[
47,
52
],
[
52,
53
],
[
43,
54
],
[
54,
55
],
[
55,
56
],
[
56,
57
],
[
56,
58
],
[
54,
59
],
[
59,
60
],
[
59,
61
],
[
6,
62
],
[
62,
63
],
[
0,
64
],
[
64,
65
],
[
64,
66
]
] |
[
"import java.util.*;\n\npublic class Main{\n public static void main(String[] args){\n\tScanner sc = new Scanner(System.in);\n int N = sc.nextInt();\n int M = sc.nextInt();\n\tint sum = 0;\n for(int i = 0 ; i < M ; i++){\n sum += sc.nextInt();\n }\n if(N < sum)\n System.out.println(-1);\n else \n System.out.println(N - sum);\n \n\t\n\t}\n}",
"import java.util.*;",
"util.*",
"java",
"public class Main{\n public static void main(String[] args){\n\tScanner sc = new Scanner(System.in);\n int N = sc.nextInt();\n int M = sc.nextInt();\n\tint sum = 0;\n for(int i = 0 ; i < M ; i++){\n sum += sc.nextInt();\n }\n if(N < sum)\n System.out.println(-1);\n else \n System.out.println(N - sum);\n \n\t\n\t}\n}",
"Main",
"public static void main(String[] args){\n\tScanner sc = new Scanner(System.in);\n int N = sc.nextInt();\n int M = sc.nextInt();\n\tint sum = 0;\n for(int i = 0 ; i < M ; i++){\n sum += sc.nextInt();\n }\n if(N < sum)\n System.out.println(-1);\n else \n System.out.println(N - sum);\n \n\t\n\t}",
"main",
"{\n\tScanner sc = new Scanner(System.in);\n int N = sc.nextInt();\n int M = sc.nextInt();\n\tint sum = 0;\n for(int i = 0 ; i < M ; i++){\n sum += sc.nextInt();\n }\n if(N < sum)\n System.out.println(-1);\n else \n System.out.println(N - sum);\n \n\t\n\t}",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"int N = sc.nextInt();",
"N",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int M = sc.nextInt();",
"M",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int sum = 0;",
"sum",
"0",
"for(int i = 0 ; i < M ; i++){\n sum += sc.nextInt();\n }",
"int i = 0 ;",
"int i = 0 ;",
"i",
"0",
"i < M",
"i",
"M",
"i++",
"i++",
"i",
"{\n sum += sc.nextInt();\n }",
"{\n sum += sc.nextInt();\n }",
"sum += sc.nextInt()",
"sum",
"sc.nextInt()",
"sc.nextInt",
"sc",
"if(N < sum)\n System.out.println(-1);\n else \n System.out.println(N - sum);",
"N < sum",
"N",
"sum",
"System.out.println(-1)",
"System.out.println",
"System.out",
"System",
"System.out",
"-1",
"1",
"System.out.println(N - sum)",
"System.out.println",
"System.out",
"System",
"System.out",
"N - sum",
"N",
"sum",
"String[] args",
"args",
"public class Main{\n public static void main(String[] args){\n\tScanner sc = new Scanner(System.in);\n int N = sc.nextInt();\n int M = sc.nextInt();\n\tint sum = 0;\n for(int i = 0 ; i < M ; i++){\n sum += sc.nextInt();\n }\n if(N < sum)\n System.out.println(-1);\n else \n System.out.println(N - sum);\n \n\t\n\t}\n}",
"public class Main{\n public static void main(String[] args){\n\tScanner sc = new Scanner(System.in);\n int N = sc.nextInt();\n int M = sc.nextInt();\n\tint sum = 0;\n for(int i = 0 ; i < M ; i++){\n sum += sc.nextInt();\n }\n if(N < sum)\n System.out.println(-1);\n else \n System.out.println(N - sum);\n \n\t\n\t}\n}",
"Main"
] |
import java.util.*;
public class Main{
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
int N = sc.nextInt();
int M = sc.nextInt();
int sum = 0;
for(int i = 0 ; i < M ; i++){
sum += sc.nextInt();
}
if(N < sum)
System.out.println(-1);
else
System.out.println(N - sum);
}
}
|
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
41,
13,
17,
41,
13,
20,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
18,
13,
13,
4,
18,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
2,
13,
18,
13,
13,
14,
2,
13,
13,
30,
4,
18,
18,
13,
13,
17,
30,
4,
18,
18,
13,
13,
2,
13,
13,
23,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
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,
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
],
[
43,
45
],
[
42,
46
],
[
46,
47
],
[
47,
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
],
[
64,
66
],
[
66,
67
],
[
66,
68
],
[
8,
69
],
[
69,
70
],
[
70,
71
],
[
70,
72
],
[
69,
73
],
[
73,
74
],
[
74,
75
],
[
75,
76
],
[
76,
77
],
[
76,
78
],
[
74,
79
],
[
69,
80
],
[
80,
81
],
[
81,
82
],
[
82,
83
],
[
83,
84
],
[
83,
85
],
[
81,
86
],
[
86,
87
],
[
86,
88
],
[
6,
89
],
[
89,
90
]
] |
[
"import java.util.*;\nclass Main\n{\n public static void main(String args[])\n {\n Scanner sc=new Scanner(System.in);\n\t \n int n=sc.nextInt();\n int m=sc.nextInt();\n int sum=0;\n int a[]=new int[m];\n for(int i=0;i<m;i++)\n {\n a[i]=sc.nextInt();\n }\n for(int i=0;i<m;i++)\n {\n sum=sum+a[i];\n }\n if(sum > n)\n {\n System.out.println(\"-1\");\n }\n else\n {\n System.out.println(n-sum);\n }\n }\n}\n \n ",
"import java.util.*;",
"util.*",
"java",
"class Main\n{\n public static void main(String args[])\n {\n Scanner sc=new Scanner(System.in);\n\t \n int n=sc.nextInt();\n int m=sc.nextInt();\n int sum=0;\n int a[]=new int[m];\n for(int i=0;i<m;i++)\n {\n a[i]=sc.nextInt();\n }\n for(int i=0;i<m;i++)\n {\n sum=sum+a[i];\n }\n if(sum > n)\n {\n System.out.println(\"-1\");\n }\n else\n {\n System.out.println(n-sum);\n }\n }\n}",
"Main",
"public static void main(String args[])\n {\n Scanner sc=new Scanner(System.in);\n\t \n int n=sc.nextInt();\n int m=sc.nextInt();\n int sum=0;\n int a[]=new int[m];\n for(int i=0;i<m;i++)\n {\n a[i]=sc.nextInt();\n }\n for(int i=0;i<m;i++)\n {\n sum=sum+a[i];\n }\n if(sum > n)\n {\n System.out.println(\"-1\");\n }\n else\n {\n System.out.println(n-sum);\n }\n }",
"main",
"{\n Scanner sc=new Scanner(System.in);\n\t \n int n=sc.nextInt();\n int m=sc.nextInt();\n int sum=0;\n int a[]=new int[m];\n for(int i=0;i<m;i++)\n {\n a[i]=sc.nextInt();\n }\n for(int i=0;i<m;i++)\n {\n sum=sum+a[i];\n }\n if(sum > n)\n {\n System.out.println(\"-1\");\n }\n else\n {\n System.out.println(n-sum);\n }\n }",
"Scanner sc=new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"int n=sc.nextInt();",
"n",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int m=sc.nextInt();",
"m",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int sum=0;",
"sum",
"0",
"int a[]=new int[m];",
"a",
"new int[m]",
"m",
"for(int i=0;i<m;i++)\n {\n a[i]=sc.nextInt();\n }",
"int i=0;",
"int i=0;",
"i",
"0",
"i<m",
"i",
"m",
"i++",
"i++",
"i",
"{\n a[i]=sc.nextInt();\n }",
"{\n a[i]=sc.nextInt();\n }",
"a[i]=sc.nextInt()",
"a[i]",
"a",
"i",
"sc.nextInt()",
"sc.nextInt",
"sc",
"for(int i=0;i<m;i++)\n {\n sum=sum+a[i];\n }",
"int i=0;",
"int i=0;",
"i",
"0",
"i<m",
"i",
"m",
"i++",
"i++",
"i",
"{\n sum=sum+a[i];\n }",
"{\n sum=sum+a[i];\n }",
"sum=sum+a[i]",
"sum",
"sum+a[i]",
"sum",
"a[i]",
"a",
"i",
"if(sum > n)\n {\n System.out.println(\"-1\");\n }\n else\n {\n System.out.println(n-sum);\n }",
"sum > n",
"sum",
"n",
"{\n System.out.println(\"-1\");\n }",
"System.out.println(\"-1\")",
"System.out.println",
"System.out",
"System",
"System.out",
"\"-1\"",
"{\n System.out.println(n-sum);\n }",
"System.out.println(n-sum)",
"System.out.println",
"System.out",
"System",
"System.out",
"n-sum",
"n",
"sum",
"String args[]",
"args"
] |
import java.util.*;
class Main
{
public static void main(String args[])
{
Scanner sc=new Scanner(System.in);
int n=sc.nextInt();
int m=sc.nextInt();
int sum=0;
int a[]=new int[m];
for(int i=0;i<m;i++)
{
a[i]=sc.nextInt();
}
for(int i=0;i<m;i++)
{
sum=sum+a[i];
}
if(sum > n)
{
System.out.println("-1");
}
else
{
System.out.println(n-sum);
}
}
}
|
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
4,
18,
13,
17,
41,
13,
4,
18,
4,
18,
13,
17,
41,
13,
4,
18,
13,
18,
13,
17,
41,
13,
4,
18,
13,
18,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
4,
18,
13,
18,
13,
13,
14,
2,
13,
17,
30,
0,
13,
40,
17,
4,
18,
18,
13,
13,
13,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
83,
5
],
[
83,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
16,
17
],
[
17,
18
],
[
14,
19
],
[
8,
20
],
[
20,
21
],
[
20,
22
],
[
22,
23
],
[
23,
24
],
[
24,
25
],
[
25,
26
],
[
22,
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
],
[
39,
40
],
[
38,
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
],
[
57,
59
],
[
59,
60
],
[
60,
61
],
[
59,
62
],
[
62,
63
],
[
62,
64
],
[
8,
65
],
[
65,
66
],
[
66,
67
],
[
66,
68
],
[
65,
69
],
[
69,
70
],
[
70,
71
],
[
70,
72
],
[
72,
73
],
[
8,
74
],
[
74,
75
],
[
75,
76
],
[
76,
77
],
[
76,
78
],
[
74,
79
],
[
6,
80
],
[
80,
81
],
[
0,
82
],
[
82,
83
],
[
82,
84
]
] |
[
"import java.util.Scanner;\n\npublic class Main {\n\tpublic static void main(String[] args) {\n \tScanner scan = new Scanner(System.in);\n \tString[] nm = scan.nextLine().split(\" \");\n \tString[] a = scan.nextLine().split(\" \");\n \tint n = Integer.parseInt(nm[0]);\n \tint m = Integer.parseInt(nm[1]);\n \tfor (int i = 0; i < m; i++) {\n \t\tn -= Integer.parseInt(a[i]);\n \t}\n \tif (n < 0) {\n \t\tn = -1;\n \t}\n \tSystem.out.println(n);\n }\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n\tpublic static void main(String[] args) {\n \tScanner scan = new Scanner(System.in);\n \tString[] nm = scan.nextLine().split(\" \");\n \tString[] a = scan.nextLine().split(\" \");\n \tint n = Integer.parseInt(nm[0]);\n \tint m = Integer.parseInt(nm[1]);\n \tfor (int i = 0; i < m; i++) {\n \t\tn -= Integer.parseInt(a[i]);\n \t}\n \tif (n < 0) {\n \t\tn = -1;\n \t}\n \tSystem.out.println(n);\n }\n}",
"Main",
"public static void main(String[] args) {\n \tScanner scan = new Scanner(System.in);\n \tString[] nm = scan.nextLine().split(\" \");\n \tString[] a = scan.nextLine().split(\" \");\n \tint n = Integer.parseInt(nm[0]);\n \tint m = Integer.parseInt(nm[1]);\n \tfor (int i = 0; i < m; i++) {\n \t\tn -= Integer.parseInt(a[i]);\n \t}\n \tif (n < 0) {\n \t\tn = -1;\n \t}\n \tSystem.out.println(n);\n }",
"main",
"{\n \tScanner scan = new Scanner(System.in);\n \tString[] nm = scan.nextLine().split(\" \");\n \tString[] a = scan.nextLine().split(\" \");\n \tint n = Integer.parseInt(nm[0]);\n \tint m = Integer.parseInt(nm[1]);\n \tfor (int i = 0; i < m; i++) {\n \t\tn -= Integer.parseInt(a[i]);\n \t}\n \tif (n < 0) {\n \t\tn = -1;\n \t}\n \tSystem.out.println(n);\n }",
"Scanner scan = new Scanner(System.in);",
"scan",
"new Scanner(System.in)",
"String[] nm = scan.nextLine().split(\" \");",
"nm",
"scan.nextLine().split(\" \")",
"scan.nextLine().split",
"scan.nextLine()",
"scan.nextLine",
"scan",
"\" \"",
"String[] a = scan.nextLine().split(\" \");",
"a",
"scan.nextLine().split(\" \")",
"scan.nextLine().split",
"scan.nextLine()",
"scan.nextLine",
"scan",
"\" \"",
"int n = Integer.parseInt(nm[0]);",
"n",
"Integer.parseInt(nm[0])",
"Integer.parseInt",
"Integer",
"nm[0]",
"nm",
"0",
"int m = Integer.parseInt(nm[1]);",
"m",
"Integer.parseInt(nm[1])",
"Integer.parseInt",
"Integer",
"nm[1]",
"nm",
"1",
"for (int i = 0; i < m; i++) {\n \t\tn -= Integer.parseInt(a[i]);\n \t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < m",
"i",
"m",
"i++",
"i++",
"i",
"{\n \t\tn -= Integer.parseInt(a[i]);\n \t}",
"{\n \t\tn -= Integer.parseInt(a[i]);\n \t}",
"n -= Integer.parseInt(a[i])",
"n",
"Integer.parseInt(a[i])",
"Integer.parseInt",
"Integer",
"a[i]",
"a",
"i",
"if (n < 0) {\n \t\tn = -1;\n \t}",
"n < 0",
"n",
"0",
"{\n \t\tn = -1;\n \t}",
"n = -1",
"n",
"-1",
"1",
"System.out.println(n)",
"System.out.println",
"System.out",
"System",
"System.out",
"n",
"String[] args",
"args",
"public class Main {\n\tpublic static void main(String[] args) {\n \tScanner scan = new Scanner(System.in);\n \tString[] nm = scan.nextLine().split(\" \");\n \tString[] a = scan.nextLine().split(\" \");\n \tint n = Integer.parseInt(nm[0]);\n \tint m = Integer.parseInt(nm[1]);\n \tfor (int i = 0; i < m; i++) {\n \t\tn -= Integer.parseInt(a[i]);\n \t}\n \tif (n < 0) {\n \t\tn = -1;\n \t}\n \tSystem.out.println(n);\n }\n}",
"public class Main {\n\tpublic static void main(String[] args) {\n \tScanner scan = new Scanner(System.in);\n \tString[] nm = scan.nextLine().split(\" \");\n \tString[] a = scan.nextLine().split(\" \");\n \tint n = Integer.parseInt(nm[0]);\n \tint m = Integer.parseInt(nm[1]);\n \tfor (int i = 0; i < m; i++) {\n \t\tn -= Integer.parseInt(a[i]);\n \t}\n \tif (n < 0) {\n \t\tn = -1;\n \t}\n \tSystem.out.println(n);\n }\n}",
"Main"
] |
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
String[] nm = scan.nextLine().split(" ");
String[] a = scan.nextLine().split(" ");
int n = Integer.parseInt(nm[0]);
int m = Integer.parseInt(nm[1]);
for (int i = 0; i < m; i++) {
n -= Integer.parseInt(a[i]);
}
if (n < 0) {
n = -1;
}
System.out.println(n);
}
}
|
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
20,
23,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
4,
18,
13,
14,
2,
13,
17,
4,
18,
18,
13,
13,
13,
4,
18,
18,
13,
13,
40,
17,
4,
18,
13,
6,
13,
41,
13,
41,
13,
20,
17,
41,
13,
41,
13,
12,
13,
30,
4,
13,
18,
13,
13,
12,
13,
30,
0,
13,
13,
23,
13,
12,
13,
30,
14,
2,
13,
40,
17,
37,
20,
14,
2,
13,
13,
30,
0,
13,
17,
38,
5,
13,
30,
37,
20,
30,
0,
13,
4,
18,
13,
13,
14,
2,
13,
17,
29,
40,
17,
29,
18,
13,
40,
13,
12,
13,
30,
41,
13,
4,
13,
42,
4,
13,
13,
0,
13,
4,
13,
41,
13,
20,
42,
40,
4,
13,
13,
30,
4,
18,
13,
13,
0,
13,
4,
13,
29,
4,
18,
13,
12,
13,
30,
41,
13,
4,
13,
42,
4,
13,
13,
0,
13,
4,
13,
41,
13,
20,
42,
40,
4,
13,
13,
30,
4,
18,
13,
13,
0,
13,
4,
13,
29,
4,
18,
13,
12,
13,
30,
41,
13,
4,
13,
42,
4,
13,
13,
0,
13,
4,
13,
41,
13,
17,
14,
2,
13,
17,
30,
0,
13,
40,
17,
0,
13,
4,
13,
41,
13,
17,
42,
40,
4,
13,
13,
30,
14,
2,
2,
13,
17,
2,
13,
17,
37,
20,
0,
13,
17,
0,
13,
2,
13,
17,
0,
13,
4,
13,
29,
2,
13,
13,
12,
13,
30,
41,
13,
4,
13,
42,
4,
13,
13,
0,
13,
4,
13,
41,
13,
17,
14,
2,
13,
17,
30,
0,
13,
40,
17,
0,
13,
4,
13,
41,
13,
17,
42,
40,
4,
13,
13,
30,
14,
2,
2,
13,
17,
2,
13,
17,
37,
20,
0,
13,
17,
0,
13,
2,
13,
17,
0,
13,
4,
13,
29,
2,
13,
13,
12,
13,
30,
29,
2,
2,
2,
2,
2,
13,
17,
2,
13,
17,
2,
13,
17,
2,
13,
17,
2,
13,
40,
17,
23,
13,
12,
13,
30,
29,
2,
2,
2,
13,
17,
2,
13,
17,
2,
13,
40,
17,
23,
13,
12,
13,
30,
38,
5,
13,
30,
4,
18,
13,
30,
4,
18,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
406,
11
],
[
406,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
12,
16
],
[
16,
17
],
[
406,
18
],
[
18,
19
],
[
18,
20
],
[
20,
21
],
[
21,
22
],
[
21,
23
],
[
20,
24
],
[
24,
25
],
[
24,
26
],
[
26,
27
],
[
27,
28
],
[
20,
29
],
[
29,
30
],
[
29,
31
],
[
31,
32
],
[
32,
33
],
[
20,
34
],
[
34,
35
],
[
35,
36
],
[
36,
37
],
[
36,
38
],
[
34,
39
],
[
39,
40
],
[
39,
41
],
[
34,
42
],
[
42,
43
],
[
43,
44
],
[
34,
45
],
[
46,
46
],
[
46,
47
],
[
47,
48
],
[
47,
49
],
[
49,
50
],
[
50,
51
],
[
20,
52
],
[
52,
53
],
[
53,
54
],
[
53,
55
],
[
52,
56
],
[
56,
57
],
[
57,
58
],
[
58,
59
],
[
58,
60
],
[
56,
61
],
[
52,
62
],
[
62,
63
],
[
63,
64
],
[
64,
65
],
[
64,
66
],
[
62,
67
],
[
67,
68
],
[
20,
69
],
[
69,
70
],
[
70,
71
],
[
406,
72
],
[
72,
73
],
[
72,
74
],
[
74,
75
],
[
72,
76
],
[
76,
77
],
[
76,
78
],
[
72,
80
],
[
80,
81
],
[
72,
82
],
[
82,
83
],
[
72,
84
],
[
84,
85
],
[
84,
86
],
[
86,
87
],
[
87,
88
],
[
87,
89
],
[
89,
90
],
[
89,
91
],
[
72,
92
],
[
92,
93
],
[
92,
94
],
[
94,
95
],
[
95,
96
],
[
95,
97
],
[
92,
98
],
[
98,
99
],
[
72,
100
],
[
100,
101
],
[
100,
102
],
[
102,
103
],
[
103,
104
],
[
104,
105
],
[
104,
106
],
[
106,
107
],
[
103,
108
],
[
108,
109
],
[
102,
110
],
[
110,
111
],
[
111,
112
],
[
111,
113
],
[
110,
114
],
[
114,
115
],
[
115,
116
],
[
115,
117
],
[
114,
118
],
[
118,
119
],
[
119,
120
],
[
119,
121
],
[
121,
122
],
[
122,
123
],
[
118,
124
],
[
124,
125
],
[
125,
126
],
[
125,
127
],
[
127,
128
],
[
128,
129
],
[
127,
130
],
[
114,
131
],
[
131,
132
],
[
132,
133
],
[
132,
134
],
[
131,
135
],
[
135,
136
],
[
136,
137
],
[
102,
138
],
[
138,
139
],
[
139,
140
],
[
139,
141
],
[
141,
142
],
[
72,
143
],
[
143,
144
],
[
143,
145
],
[
145,
146
],
[
146,
147
],
[
146,
148
],
[
148,
149
],
[
145,
150
],
[
150,
151
],
[
151,
152
],
[
151,
153
],
[
150,
154
],
[
154,
155
],
[
154,
156
],
[
156,
157
],
[
145,
158
],
[
158,
159
],
[
158,
160
],
[
145,
161
],
[
161,
162
],
[
162,
163
],
[
163,
164
],
[
163,
165
],
[
161,
166
],
[
166,
167
],
[
167,
168
],
[
168,
169
],
[
167,
170
],
[
166,
171
],
[
171,
172
],
[
171,
173
],
[
173,
174
],
[
145,
175
],
[
175,
176
],
[
176,
177
],
[
177,
178
],
[
72,
179
],
[
179,
180
],
[
179,
181
],
[
181,
182
],
[
182,
183
],
[
182,
184
],
[
184,
185
],
[
181,
186
],
[
186,
187
],
[
187,
188
],
[
187,
189
],
[
186,
190
],
[
190,
191
],
[
190,
192
],
[
192,
193
],
[
181,
194
],
[
194,
195
],
[
194,
196
],
[
181,
197
],
[
197,
198
],
[
198,
199
],
[
199,
200
],
[
199,
201
],
[
197,
202
],
[
202,
203
],
[
203,
204
],
[
204,
205
],
[
203,
206
],
[
202,
207
],
[
207,
208
],
[
207,
209
],
[
209,
210
],
[
181,
211
],
[
211,
212
],
[
212,
213
],
[
213,
214
],
[
72,
215
],
[
215,
216
],
[
215,
217
],
[
217,
218
],
[
218,
219
],
[
218,
220
],
[
220,
221
],
[
217,
222
],
[
222,
223
],
[
223,
224
],
[
223,
225
],
[
222,
226
],
[
226,
227
],
[
226,
228
],
[
228,
229
],
[
217,
230
],
[
230,
231
],
[
230,
232
],
[
217,
233
],
[
233,
234
],
[
234,
235
],
[
234,
236
],
[
233,
237
],
[
237,
238
],
[
238,
239
],
[
238,
240
],
[
240,
241
],
[
237,
242
],
[
242,
243
],
[
242,
244
],
[
244,
245
],
[
217,
246
],
[
246,
247
],
[
246,
248
],
[
217,
249
],
[
249,
250
],
[
250,
251
],
[
251,
252
],
[
251,
253
],
[
249,
254
],
[
254,
255
],
[
255,
256
],
[
256,
257
],
[
257,
258
],
[
257,
259
],
[
256,
260
],
[
260,
261
],
[
260,
262
],
[
255,
263
],
[
263,
264
],
[
254,
265
],
[
265,
266
],
[
265,
267
],
[
254,
268
],
[
268,
269
],
[
268,
270
],
[
270,
271
],
[
270,
272
],
[
254,
273
],
[
273,
274
],
[
273,
275
],
[
275,
276
],
[
217,
277
],
[
277,
278
],
[
278,
279
],
[
278,
280
],
[
72,
281
],
[
281,
282
],
[
281,
283
],
[
283,
284
],
[
284,
285
],
[
284,
286
],
[
286,
287
],
[
283,
288
],
[
288,
289
],
[
289,
290
],
[
289,
291
],
[
288,
292
],
[
292,
293
],
[
292,
294
],
[
294,
295
],
[
283,
296
],
[
296,
297
],
[
296,
298
],
[
283,
299
],
[
299,
300
],
[
300,
301
],
[
300,
302
],
[
299,
303
],
[
303,
304
],
[
304,
305
],
[
304,
306
],
[
306,
307
],
[
303,
308
],
[
308,
309
],
[
308,
310
],
[
310,
311
],
[
283,
312
],
[
312,
313
],
[
312,
314
],
[
283,
315
],
[
315,
316
],
[
316,
317
],
[
317,
318
],
[
317,
319
],
[
315,
320
],
[
320,
321
],
[
321,
322
],
[
322,
323
],
[
323,
324
],
[
323,
325
],
[
322,
326
],
[
326,
327
],
[
326,
328
],
[
321,
329
],
[
329,
330
],
[
320,
331
],
[
331,
332
],
[
331,
333
],
[
320,
334
],
[
334,
335
],
[
334,
336
],
[
336,
337
],
[
336,
338
],
[
320,
339
],
[
339,
340
],
[
339,
341
],
[
341,
342
],
[
283,
343
],
[
343,
344
],
[
344,
345
],
[
344,
346
],
[
72,
347
],
[
347,
348
],
[
347,
349
],
[
349,
350
],
[
350,
351
],
[
354,
352
],
[
364,
353
],
[
361,
354
],
[
354,
355
],
[
355,
356
],
[
355,
357
],
[
354,
358
],
[
358,
359
],
[
358,
360
],
[
361,
361
],
[
361,
362
],
[
361,
363
],
[
364,
364
],
[
364,
365
],
[
364,
366
],
[
354,
367
],
[
367,
368
],
[
367,
369
],
[
369,
370
],
[
347,
371
],
[
371,
372
],
[
72,
373
],
[
373,
374
],
[
373,
375
],
[
375,
376
],
[
376,
377
],
[
378,
378
],
[
378,
379
],
[
379,
380
],
[
379,
381
],
[
378,
382
],
[
382,
383
],
[
382,
384
],
[
378,
385
],
[
385,
386
],
[
385,
387
],
[
387,
388
],
[
373,
389
],
[
389,
390
],
[
72,
391
],
[
391,
392
],
[
391,
393
],
[
393,
394
],
[
394,
395
],
[
395,
396
],
[
395,
397
],
[
397,
398
],
[
398,
399
],
[
399,
400
],
[
394,
401
],
[
401,
402
],
[
402,
403
],
[
403,
404
],
[
0,
405
],
[
405,
406
],
[
405,
407
]
] |
[
"import java.io.IOException;\nimport java.io.InputStream;\nimport java.util.InputMismatchException;\n\npublic class Main {\n\tpublic static void main(String[] args) {\n\t\tnew Main();\n\t}\n\n\tpublic Main() {\n\t\tFasterScanner sc = new FasterScanner(System.in);\n\n\t\tint n = sc.nextInt();\n\t\tint m = sc.nextInt();\n\t\tfor (int i = 0; i < m; i++) {\n\t\t\tn -= sc.nextInt();\n\t\t}\n\t\tif (n >= 0) System.out.println(n);\n\t\telse System.out.println(-1);\n\t\t\n\t\tsc.close();\n\t}\n\t\n\tclass FasterScanner {\n\t\tprivate InputStream mIs;\n\t\tprivate byte[] buf = new byte[1024];\n\t\tprivate int curChar;\n\t\tprivate int numChars;\n\n\t\tpublic FasterScanner() {\n\t\t\tthis(System.in);\n\t\t}\n\n\t\tpublic FasterScanner(InputStream is) {\n\t\t\tmIs = is;\n\t\t}\n\n\t\tpublic int read() {\n\t\t\tif (numChars == -1)\n\t\t\t\tthrow new InputMismatchException();\n\t\t\tif (curChar >= numChars) {\n\t\t\t\tcurChar = 0;\n\t\t\t\ttry {\n\t\t\t\t\tnumChars = mIs.read(buf);\n\t\t\t\t} catch (IOException e) {\n\t\t\t\t\tthrow new InputMismatchException();\n\t\t\t\t}\n\t\t\t\tif (numChars <= 0)\n\t\t\t\t\treturn -1;\n\t\t\t}\n\t\t\treturn buf[curChar++];\n\t\t}\n\n\t\tpublic String nextLine() {\n\t\t\tint c = read();\n\t\t\twhile (isSpaceChar(c))\n\t\t\t\tc = read();\n\t\t\tStringBuilder res = new StringBuilder();\n\t\t\tdo {\n\t\t\t\tres.appendCodePoint(c);\n\t\t\t\tc = read();\n\t\t\t} while (!isEndOfLine(c));\n\t\t\treturn res.toString();\n\t\t}\n\n\t\tpublic String nextString() {\n\t\t\tint c = read();\n\t\t\twhile (isSpaceChar(c))\n\t\t\t\tc = read();\n\t\t\tStringBuilder res = new StringBuilder();\n\t\t\tdo {\n\t\t\t\tres.appendCodePoint(c);\n\t\t\t\tc = read();\n\t\t\t} while (!isSpaceChar(c));\n\t\t\treturn res.toString();\n\t\t}\n\n\t\tpublic long nextLong() {\n\t\t\tint c = read();\n\t\t\twhile (isSpaceChar(c))\n\t\t\t\tc = read();\n\t\t\tint sgn = 1;\n\t\t\tif (c == '-') {\n\t\t\t\tsgn = -1;\n\t\t\t\tc = read();\n\t\t\t}\n\t\t\tlong res = 0;\n\t\t\tdo {\n\t\t\t\tif (c < '0' || c > '9')\n\t\t\t\t\tthrow new InputMismatchException();\n\t\t\t\tres *= 10;\n\t\t\t\tres += c - '0';\n\t\t\t\tc = read();\n\t\t\t} while (!isSpaceChar(c));\n\t\t\treturn res * sgn;\n\t\t}\n\n\t\tpublic int nextInt() {\n\t\t\tint c = read();\n\t\t\twhile (isSpaceChar(c))\n\t\t\t\tc = read();\n\t\t\tint sgn = 1;\n\t\t\tif (c == '-') {\n\t\t\t\tsgn = -1;\n\t\t\t\tc = read();\n\t\t\t}\n\t\t\tint res = 0;\n\t\t\tdo {\n\t\t\t\tif (c < '0' || c > '9')\n\t\t\t\t\tthrow new InputMismatchException();\n\t\t\t\tres *= 10;\n\t\t\t\tres += c - '0';\n\t\t\t\tc = read();\n\t\t\t} while (!isSpaceChar(c));\n\t\t\treturn res * sgn;\n\t\t}\n\n\t\tpublic boolean isSpaceChar(int c) {\n\t\t\treturn c == ' ' || c == '\\n' || c == '\\r' || c == '\\t' || c == -1;\n\t\t}\n\n\t\tpublic boolean isEndOfLine(int c) {\n\t\t\treturn c == '\\n' || c == '\\r' || c == -1;\n\t\t}\n\n\t\tpublic void close() {\n\t\t\ttry {\n\t\t\t\tmIs.close();\n\t\t\t} catch (IOException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\n\t}\n}",
"import java.io.IOException;",
"IOException",
"java.io",
"import java.io.InputStream;",
"InputStream",
"java.io",
"import java.util.InputMismatchException;",
"InputMismatchException",
"java.util",
"public class Main {\n\tpublic static void main(String[] args) {\n\t\tnew Main();\n\t}\n\n\tpublic Main() {\n\t\tFasterScanner sc = new FasterScanner(System.in);\n\n\t\tint n = sc.nextInt();\n\t\tint m = sc.nextInt();\n\t\tfor (int i = 0; i < m; i++) {\n\t\t\tn -= sc.nextInt();\n\t\t}\n\t\tif (n >= 0) System.out.println(n);\n\t\telse System.out.println(-1);\n\t\t\n\t\tsc.close();\n\t}\n\t\n\tclass FasterScanner {\n\t\tprivate InputStream mIs;\n\t\tprivate byte[] buf = new byte[1024];\n\t\tprivate int curChar;\n\t\tprivate int numChars;\n\n\t\tpublic FasterScanner() {\n\t\t\tthis(System.in);\n\t\t}\n\n\t\tpublic FasterScanner(InputStream is) {\n\t\t\tmIs = is;\n\t\t}\n\n\t\tpublic int read() {\n\t\t\tif (numChars == -1)\n\t\t\t\tthrow new InputMismatchException();\n\t\t\tif (curChar >= numChars) {\n\t\t\t\tcurChar = 0;\n\t\t\t\ttry {\n\t\t\t\t\tnumChars = mIs.read(buf);\n\t\t\t\t} catch (IOException e) {\n\t\t\t\t\tthrow new InputMismatchException();\n\t\t\t\t}\n\t\t\t\tif (numChars <= 0)\n\t\t\t\t\treturn -1;\n\t\t\t}\n\t\t\treturn buf[curChar++];\n\t\t}\n\n\t\tpublic String nextLine() {\n\t\t\tint c = read();\n\t\t\twhile (isSpaceChar(c))\n\t\t\t\tc = read();\n\t\t\tStringBuilder res = new StringBuilder();\n\t\t\tdo {\n\t\t\t\tres.appendCodePoint(c);\n\t\t\t\tc = read();\n\t\t\t} while (!isEndOfLine(c));\n\t\t\treturn res.toString();\n\t\t}\n\n\t\tpublic String nextString() {\n\t\t\tint c = read();\n\t\t\twhile (isSpaceChar(c))\n\t\t\t\tc = read();\n\t\t\tStringBuilder res = new StringBuilder();\n\t\t\tdo {\n\t\t\t\tres.appendCodePoint(c);\n\t\t\t\tc = read();\n\t\t\t} while (!isSpaceChar(c));\n\t\t\treturn res.toString();\n\t\t}\n\n\t\tpublic long nextLong() {\n\t\t\tint c = read();\n\t\t\twhile (isSpaceChar(c))\n\t\t\t\tc = read();\n\t\t\tint sgn = 1;\n\t\t\tif (c == '-') {\n\t\t\t\tsgn = -1;\n\t\t\t\tc = read();\n\t\t\t}\n\t\t\tlong res = 0;\n\t\t\tdo {\n\t\t\t\tif (c < '0' || c > '9')\n\t\t\t\t\tthrow new InputMismatchException();\n\t\t\t\tres *= 10;\n\t\t\t\tres += c - '0';\n\t\t\t\tc = read();\n\t\t\t} while (!isSpaceChar(c));\n\t\t\treturn res * sgn;\n\t\t}\n\n\t\tpublic int nextInt() {\n\t\t\tint c = read();\n\t\t\twhile (isSpaceChar(c))\n\t\t\t\tc = read();\n\t\t\tint sgn = 1;\n\t\t\tif (c == '-') {\n\t\t\t\tsgn = -1;\n\t\t\t\tc = read();\n\t\t\t}\n\t\t\tint res = 0;\n\t\t\tdo {\n\t\t\t\tif (c < '0' || c > '9')\n\t\t\t\t\tthrow new InputMismatchException();\n\t\t\t\tres *= 10;\n\t\t\t\tres += c - '0';\n\t\t\t\tc = read();\n\t\t\t} while (!isSpaceChar(c));\n\t\t\treturn res * sgn;\n\t\t}\n\n\t\tpublic boolean isSpaceChar(int c) {\n\t\t\treturn c == ' ' || c == '\\n' || c == '\\r' || c == '\\t' || c == -1;\n\t\t}\n\n\t\tpublic boolean isEndOfLine(int c) {\n\t\t\treturn c == '\\n' || c == '\\r' || c == -1;\n\t\t}\n\n\t\tpublic void close() {\n\t\t\ttry {\n\t\t\t\tmIs.close();\n\t\t\t} catch (IOException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\n\t}\n}",
"Main",
"public static void main(String[] args) {\n\t\tnew Main();\n\t}",
"main",
"{\n\t\tnew Main();\n\t}",
"new Main()",
"String[] args",
"args",
"public Main() {\n\t\tFasterScanner sc = new FasterScanner(System.in);\n\n\t\tint n = sc.nextInt();\n\t\tint m = sc.nextInt();\n\t\tfor (int i = 0; i < m; i++) {\n\t\t\tn -= sc.nextInt();\n\t\t}\n\t\tif (n >= 0) System.out.println(n);\n\t\telse System.out.println(-1);\n\t\t\n\t\tsc.close();\n\t}",
"Main",
"{\n\t\tFasterScanner sc = new FasterScanner(System.in);\n\n\t\tint n = sc.nextInt();\n\t\tint m = sc.nextInt();\n\t\tfor (int i = 0; i < m; i++) {\n\t\t\tn -= sc.nextInt();\n\t\t}\n\t\tif (n >= 0) System.out.println(n);\n\t\telse System.out.println(-1);\n\t\t\n\t\tsc.close();\n\t}",
"FasterScanner sc = new FasterScanner(System.in);",
"sc",
"new FasterScanner(System.in)",
"int n = sc.nextInt();",
"n",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int m = sc.nextInt();",
"m",
"sc.nextInt()",
"sc.nextInt",
"sc",
"for (int i = 0; i < m; i++) {\n\t\t\tn -= sc.nextInt();\n\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < m",
"i",
"m",
"i++",
"i++",
"i",
"{\n\t\t\tn -= sc.nextInt();\n\t\t}",
"{\n\t\t\tn -= sc.nextInt();\n\t\t}",
"n -= sc.nextInt()",
"n",
"sc.nextInt()",
"sc.nextInt",
"sc",
"if (n >= 0) System.out.println(n);\n\t\telse System.out.println(-1);",
"n >= 0",
"n",
"0",
"System.out.println(n)",
"System.out.println",
"System.out",
"System",
"System.out",
"n",
"System.out.println(-1)",
"System.out.println",
"System.out",
"System",
"System.out",
"-1",
"1",
"sc.close()",
"sc.close",
"sc",
"class FasterScanner {\n\t\tprivate InputStream mIs;\n\t\tprivate byte[] buf = new byte[1024];\n\t\tprivate int curChar;\n\t\tprivate int numChars;\n\n\t\tpublic FasterScanner() {\n\t\t\tthis(System.in);\n\t\t}\n\n\t\tpublic FasterScanner(InputStream is) {\n\t\t\tmIs = is;\n\t\t}\n\n\t\tpublic int read() {\n\t\t\tif (numChars == -1)\n\t\t\t\tthrow new InputMismatchException();\n\t\t\tif (curChar >= numChars) {\n\t\t\t\tcurChar = 0;\n\t\t\t\ttry {\n\t\t\t\t\tnumChars = mIs.read(buf);\n\t\t\t\t} catch (IOException e) {\n\t\t\t\t\tthrow new InputMismatchException();\n\t\t\t\t}\n\t\t\t\tif (numChars <= 0)\n\t\t\t\t\treturn -1;\n\t\t\t}\n\t\t\treturn buf[curChar++];\n\t\t}\n\n\t\tpublic String nextLine() {\n\t\t\tint c = read();\n\t\t\twhile (isSpaceChar(c))\n\t\t\t\tc = read();\n\t\t\tStringBuilder res = new StringBuilder();\n\t\t\tdo {\n\t\t\t\tres.appendCodePoint(c);\n\t\t\t\tc = read();\n\t\t\t} while (!isEndOfLine(c));\n\t\t\treturn res.toString();\n\t\t}\n\n\t\tpublic String nextString() {\n\t\t\tint c = read();\n\t\t\twhile (isSpaceChar(c))\n\t\t\t\tc = read();\n\t\t\tStringBuilder res = new StringBuilder();\n\t\t\tdo {\n\t\t\t\tres.appendCodePoint(c);\n\t\t\t\tc = read();\n\t\t\t} while (!isSpaceChar(c));\n\t\t\treturn res.toString();\n\t\t}\n\n\t\tpublic long nextLong() {\n\t\t\tint c = read();\n\t\t\twhile (isSpaceChar(c))\n\t\t\t\tc = read();\n\t\t\tint sgn = 1;\n\t\t\tif (c == '-') {\n\t\t\t\tsgn = -1;\n\t\t\t\tc = read();\n\t\t\t}\n\t\t\tlong res = 0;\n\t\t\tdo {\n\t\t\t\tif (c < '0' || c > '9')\n\t\t\t\t\tthrow new InputMismatchException();\n\t\t\t\tres *= 10;\n\t\t\t\tres += c - '0';\n\t\t\t\tc = read();\n\t\t\t} while (!isSpaceChar(c));\n\t\t\treturn res * sgn;\n\t\t}\n\n\t\tpublic int nextInt() {\n\t\t\tint c = read();\n\t\t\twhile (isSpaceChar(c))\n\t\t\t\tc = read();\n\t\t\tint sgn = 1;\n\t\t\tif (c == '-') {\n\t\t\t\tsgn = -1;\n\t\t\t\tc = read();\n\t\t\t}\n\t\t\tint res = 0;\n\t\t\tdo {\n\t\t\t\tif (c < '0' || c > '9')\n\t\t\t\t\tthrow new InputMismatchException();\n\t\t\t\tres *= 10;\n\t\t\t\tres += c - '0';\n\t\t\t\tc = read();\n\t\t\t} while (!isSpaceChar(c));\n\t\t\treturn res * sgn;\n\t\t}\n\n\t\tpublic boolean isSpaceChar(int c) {\n\t\t\treturn c == ' ' || c == '\\n' || c == '\\r' || c == '\\t' || c == -1;\n\t\t}\n\n\t\tpublic boolean isEndOfLine(int c) {\n\t\t\treturn c == '\\n' || c == '\\r' || c == -1;\n\t\t}\n\n\t\tpublic void close() {\n\t\t\ttry {\n\t\t\t\tmIs.close();\n\t\t\t} catch (IOException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\n\t}",
"FasterScanner",
"private InputStream mIs;",
"mIs",
"private byte[] buf = new byte[1024];",
"buf",
"new byte[1024]",
"1024",
"private int curChar;",
"curChar",
"private int numChars;",
"numChars",
"public FasterScanner() {\n\t\t\tthis(System.in);\n\t\t}",
"FasterScanner",
"{\n\t\t\tthis(System.in);\n\t\t}",
"this(System.in)",
"this",
"System.in",
"System",
"System.in",
"public FasterScanner(InputStream is) {\n\t\t\tmIs = is;\n\t\t}",
"FasterScanner",
"{\n\t\t\tmIs = is;\n\t\t}",
"mIs = is",
"mIs",
"is",
"InputStream is",
"is",
"public int read() {\n\t\t\tif (numChars == -1)\n\t\t\t\tthrow new InputMismatchException();\n\t\t\tif (curChar >= numChars) {\n\t\t\t\tcurChar = 0;\n\t\t\t\ttry {\n\t\t\t\t\tnumChars = mIs.read(buf);\n\t\t\t\t} catch (IOException e) {\n\t\t\t\t\tthrow new InputMismatchException();\n\t\t\t\t}\n\t\t\t\tif (numChars <= 0)\n\t\t\t\t\treturn -1;\n\t\t\t}\n\t\t\treturn buf[curChar++];\n\t\t}",
"read",
"{\n\t\t\tif (numChars == -1)\n\t\t\t\tthrow new InputMismatchException();\n\t\t\tif (curChar >= numChars) {\n\t\t\t\tcurChar = 0;\n\t\t\t\ttry {\n\t\t\t\t\tnumChars = mIs.read(buf);\n\t\t\t\t} catch (IOException e) {\n\t\t\t\t\tthrow new InputMismatchException();\n\t\t\t\t}\n\t\t\t\tif (numChars <= 0)\n\t\t\t\t\treturn -1;\n\t\t\t}\n\t\t\treturn buf[curChar++];\n\t\t}",
"if (numChars == -1)\n\t\t\t\tthrow new InputMismatchException();",
"numChars == -1",
"numChars",
"-1",
"1",
"throw new InputMismatchException();",
"new InputMismatchException()",
"if (curChar >= numChars) {\n\t\t\t\tcurChar = 0;\n\t\t\t\ttry {\n\t\t\t\t\tnumChars = mIs.read(buf);\n\t\t\t\t} catch (IOException e) {\n\t\t\t\t\tthrow new InputMismatchException();\n\t\t\t\t}\n\t\t\t\tif (numChars <= 0)\n\t\t\t\t\treturn -1;\n\t\t\t}",
"curChar >= numChars",
"curChar",
"numChars",
"{\n\t\t\t\tcurChar = 0;\n\t\t\t\ttry {\n\t\t\t\t\tnumChars = mIs.read(buf);\n\t\t\t\t} catch (IOException e) {\n\t\t\t\t\tthrow new InputMismatchException();\n\t\t\t\t}\n\t\t\t\tif (numChars <= 0)\n\t\t\t\t\treturn -1;\n\t\t\t}",
"curChar = 0",
"curChar",
"0",
"try {\n\t\t\t\t\tnumChars = mIs.read(buf);\n\t\t\t\t} catch (IOException e) {\n\t\t\t\t\tthrow new InputMismatchException();\n\t\t\t\t}",
"catch (IOException e) {\n\t\t\t\t\tthrow new InputMismatchException();\n\t\t\t\t}",
"IOException e",
"{\n\t\t\t\t\tthrow new InputMismatchException();\n\t\t\t\t}",
"throw new InputMismatchException();",
"new InputMismatchException()",
"{\n\t\t\t\t\tnumChars = mIs.read(buf);\n\t\t\t\t}",
"numChars = mIs.read(buf)",
"numChars",
"mIs.read(buf)",
"mIs.read",
"mIs",
"buf",
"if (numChars <= 0)\n\t\t\t\t\treturn -1;",
"numChars <= 0",
"numChars",
"0",
"return -1;",
"-1",
"1",
"return buf[curChar++];",
"buf[curChar++]",
"buf",
"curChar++",
"curChar",
"public String nextLine() {\n\t\t\tint c = read();\n\t\t\twhile (isSpaceChar(c))\n\t\t\t\tc = read();\n\t\t\tStringBuilder res = new StringBuilder();\n\t\t\tdo {\n\t\t\t\tres.appendCodePoint(c);\n\t\t\t\tc = read();\n\t\t\t} while (!isEndOfLine(c));\n\t\t\treturn res.toString();\n\t\t}",
"nextLine",
"{\n\t\t\tint c = read();\n\t\t\twhile (isSpaceChar(c))\n\t\t\t\tc = read();\n\t\t\tStringBuilder res = new StringBuilder();\n\t\t\tdo {\n\t\t\t\tres.appendCodePoint(c);\n\t\t\t\tc = read();\n\t\t\t} while (!isEndOfLine(c));\n\t\t\treturn res.toString();\n\t\t}",
"int c = read();",
"c",
"read()",
"read",
"while (isSpaceChar(c))\n\t\t\t\tc = read();",
"isSpaceChar(c)",
"isSpaceChar",
"c",
"c = read()",
"c",
"read()",
"read",
"StringBuilder res = new StringBuilder();",
"res",
"new StringBuilder()",
"do {\n\t\t\t\tres.appendCodePoint(c);\n\t\t\t\tc = read();\n\t\t\t} while (!isEndOfLine(c));",
"!isEndOfLine(c)",
"isEndOfLine(c)",
"isEndOfLine",
"c",
"{\n\t\t\t\tres.appendCodePoint(c);\n\t\t\t\tc = read();\n\t\t\t}",
"res.appendCodePoint(c)",
"res.appendCodePoint",
"res",
"c",
"c = read()",
"c",
"read()",
"read",
"return res.toString();",
"res.toString()",
"res.toString",
"res",
"public String nextString() {\n\t\t\tint c = read();\n\t\t\twhile (isSpaceChar(c))\n\t\t\t\tc = read();\n\t\t\tStringBuilder res = new StringBuilder();\n\t\t\tdo {\n\t\t\t\tres.appendCodePoint(c);\n\t\t\t\tc = read();\n\t\t\t} while (!isSpaceChar(c));\n\t\t\treturn res.toString();\n\t\t}",
"nextString",
"{\n\t\t\tint c = read();\n\t\t\twhile (isSpaceChar(c))\n\t\t\t\tc = read();\n\t\t\tStringBuilder res = new StringBuilder();\n\t\t\tdo {\n\t\t\t\tres.appendCodePoint(c);\n\t\t\t\tc = read();\n\t\t\t} while (!isSpaceChar(c));\n\t\t\treturn res.toString();\n\t\t}",
"int c = read();",
"c",
"read()",
"read",
"while (isSpaceChar(c))\n\t\t\t\tc = read();",
"isSpaceChar(c)",
"isSpaceChar",
"c",
"c = read()",
"c",
"read()",
"read",
"StringBuilder res = new StringBuilder();",
"res",
"new StringBuilder()",
"do {\n\t\t\t\tres.appendCodePoint(c);\n\t\t\t\tc = read();\n\t\t\t} while (!isSpaceChar(c));",
"!isSpaceChar(c)",
"isSpaceChar(c)",
"isSpaceChar",
"c",
"{\n\t\t\t\tres.appendCodePoint(c);\n\t\t\t\tc = read();\n\t\t\t}",
"res.appendCodePoint(c)",
"res.appendCodePoint",
"res",
"c",
"c = read()",
"c",
"read()",
"read",
"return res.toString();",
"res.toString()",
"res.toString",
"res",
"public long nextLong() {\n\t\t\tint c = read();\n\t\t\twhile (isSpaceChar(c))\n\t\t\t\tc = read();\n\t\t\tint sgn = 1;\n\t\t\tif (c == '-') {\n\t\t\t\tsgn = -1;\n\t\t\t\tc = read();\n\t\t\t}\n\t\t\tlong res = 0;\n\t\t\tdo {\n\t\t\t\tif (c < '0' || c > '9')\n\t\t\t\t\tthrow new InputMismatchException();\n\t\t\t\tres *= 10;\n\t\t\t\tres += c - '0';\n\t\t\t\tc = read();\n\t\t\t} while (!isSpaceChar(c));\n\t\t\treturn res * sgn;\n\t\t}",
"nextLong",
"{\n\t\t\tint c = read();\n\t\t\twhile (isSpaceChar(c))\n\t\t\t\tc = read();\n\t\t\tint sgn = 1;\n\t\t\tif (c == '-') {\n\t\t\t\tsgn = -1;\n\t\t\t\tc = read();\n\t\t\t}\n\t\t\tlong res = 0;\n\t\t\tdo {\n\t\t\t\tif (c < '0' || c > '9')\n\t\t\t\t\tthrow new InputMismatchException();\n\t\t\t\tres *= 10;\n\t\t\t\tres += c - '0';\n\t\t\t\tc = read();\n\t\t\t} while (!isSpaceChar(c));\n\t\t\treturn res * sgn;\n\t\t}",
"int c = read();",
"c",
"read()",
"read",
"while (isSpaceChar(c))\n\t\t\t\tc = read();",
"isSpaceChar(c)",
"isSpaceChar",
"c",
"c = read()",
"c",
"read()",
"read",
"int sgn = 1;",
"sgn",
"1",
"if (c == '-') {\n\t\t\t\tsgn = -1;\n\t\t\t\tc = read();\n\t\t\t}",
"c == '-'",
"c",
"'-'",
"{\n\t\t\t\tsgn = -1;\n\t\t\t\tc = read();\n\t\t\t}",
"sgn = -1",
"sgn",
"-1",
"1",
"c = read()",
"c",
"read()",
"read",
"long res = 0;",
"res",
"0",
"do {\n\t\t\t\tif (c < '0' || c > '9')\n\t\t\t\t\tthrow new InputMismatchException();\n\t\t\t\tres *= 10;\n\t\t\t\tres += c - '0';\n\t\t\t\tc = read();\n\t\t\t} while (!isSpaceChar(c));",
"!isSpaceChar(c)",
"isSpaceChar(c)",
"isSpaceChar",
"c",
"{\n\t\t\t\tif (c < '0' || c > '9')\n\t\t\t\t\tthrow new InputMismatchException();\n\t\t\t\tres *= 10;\n\t\t\t\tres += c - '0';\n\t\t\t\tc = read();\n\t\t\t}",
"if (c < '0' || c > '9')\n\t\t\t\t\tthrow new InputMismatchException();",
"c < '0' || c > '9'",
"c < '0'",
"c",
"'0'",
"c > '9'",
"c",
"'9'",
"throw new InputMismatchException();",
"new InputMismatchException()",
"res *= 10",
"res",
"10",
"res += c - '0'",
"res",
"c - '0'",
"c",
"'0'",
"c = read()",
"c",
"read()",
"read",
"return res * sgn;",
"res * sgn",
"res",
"sgn",
"public int nextInt() {\n\t\t\tint c = read();\n\t\t\twhile (isSpaceChar(c))\n\t\t\t\tc = read();\n\t\t\tint sgn = 1;\n\t\t\tif (c == '-') {\n\t\t\t\tsgn = -1;\n\t\t\t\tc = read();\n\t\t\t}\n\t\t\tint res = 0;\n\t\t\tdo {\n\t\t\t\tif (c < '0' || c > '9')\n\t\t\t\t\tthrow new InputMismatchException();\n\t\t\t\tres *= 10;\n\t\t\t\tres += c - '0';\n\t\t\t\tc = read();\n\t\t\t} while (!isSpaceChar(c));\n\t\t\treturn res * sgn;\n\t\t}",
"nextInt",
"{\n\t\t\tint c = read();\n\t\t\twhile (isSpaceChar(c))\n\t\t\t\tc = read();\n\t\t\tint sgn = 1;\n\t\t\tif (c == '-') {\n\t\t\t\tsgn = -1;\n\t\t\t\tc = read();\n\t\t\t}\n\t\t\tint res = 0;\n\t\t\tdo {\n\t\t\t\tif (c < '0' || c > '9')\n\t\t\t\t\tthrow new InputMismatchException();\n\t\t\t\tres *= 10;\n\t\t\t\tres += c - '0';\n\t\t\t\tc = read();\n\t\t\t} while (!isSpaceChar(c));\n\t\t\treturn res * sgn;\n\t\t}",
"int c = read();",
"c",
"read()",
"read",
"while (isSpaceChar(c))\n\t\t\t\tc = read();",
"isSpaceChar(c)",
"isSpaceChar",
"c",
"c = read()",
"c",
"read()",
"read",
"int sgn = 1;",
"sgn",
"1",
"if (c == '-') {\n\t\t\t\tsgn = -1;\n\t\t\t\tc = read();\n\t\t\t}",
"c == '-'",
"c",
"'-'",
"{\n\t\t\t\tsgn = -1;\n\t\t\t\tc = read();\n\t\t\t}",
"sgn = -1",
"sgn",
"-1",
"1",
"c = read()",
"c",
"read()",
"read",
"int res = 0;",
"res",
"0",
"do {\n\t\t\t\tif (c < '0' || c > '9')\n\t\t\t\t\tthrow new InputMismatchException();\n\t\t\t\tres *= 10;\n\t\t\t\tres += c - '0';\n\t\t\t\tc = read();\n\t\t\t} while (!isSpaceChar(c));",
"!isSpaceChar(c)",
"isSpaceChar(c)",
"isSpaceChar",
"c",
"{\n\t\t\t\tif (c < '0' || c > '9')\n\t\t\t\t\tthrow new InputMismatchException();\n\t\t\t\tres *= 10;\n\t\t\t\tres += c - '0';\n\t\t\t\tc = read();\n\t\t\t}",
"if (c < '0' || c > '9')\n\t\t\t\t\tthrow new InputMismatchException();",
"c < '0' || c > '9'",
"c < '0'",
"c",
"'0'",
"c > '9'",
"c",
"'9'",
"throw new InputMismatchException();",
"new InputMismatchException()",
"res *= 10",
"res",
"10",
"res += c - '0'",
"res",
"c - '0'",
"c",
"'0'",
"c = read()",
"c",
"read()",
"read",
"return res * sgn;",
"res * sgn",
"res",
"sgn",
"public boolean isSpaceChar(int c) {\n\t\t\treturn c == ' ' || c == '\\n' || c == '\\r' || c == '\\t' || c == -1;\n\t\t}",
"isSpaceChar",
"{\n\t\t\treturn c == ' ' || c == '\\n' || c == '\\r' || c == '\\t' || c == -1;\n\t\t}",
"return c == ' ' || c == '\\n' || c == '\\r' || c == '\\t' || c == -1;",
"c == ' ' || c == '\\n' || c == '\\r' || c == '\\t' || c == -1",
"c == '\\t'",
"c == '\\r'",
"c == ' ' || c == '\\n' || c == '\\r' || c == '\\t' || c == -1",
"c == ' '",
"c",
"' '",
"c == '\\n'",
"c",
"'\\n'",
"c == '\\r'",
"c",
"'\\r'",
"c == '\\t'",
"c",
"'\\t'",
"c == -1",
"c",
"-1",
"1",
"int c",
"c",
"public boolean isEndOfLine(int c) {\n\t\t\treturn c == '\\n' || c == '\\r' || c == -1;\n\t\t}",
"isEndOfLine",
"{\n\t\t\treturn c == '\\n' || c == '\\r' || c == -1;\n\t\t}",
"return c == '\\n' || c == '\\r' || c == -1;",
"c == '\\n' || c == '\\r' || c == -1",
"c == '\\n' || c == '\\r' || c == -1",
"c == '\\n'",
"c",
"'\\n'",
"c == '\\r'",
"c",
"'\\r'",
"c == -1",
"c",
"-1",
"1",
"int c",
"c",
"public void close() {\n\t\t\ttry {\n\t\t\t\tmIs.close();\n\t\t\t} catch (IOException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}",
"close",
"{\n\t\t\ttry {\n\t\t\t\tmIs.close();\n\t\t\t} catch (IOException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}",
"try {\n\t\t\t\tmIs.close();\n\t\t\t} catch (IOException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}",
"catch (IOException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}",
"IOException e",
"{\n\t\t\t\te.printStackTrace();\n\t\t\t}",
"e.printStackTrace()",
"e.printStackTrace",
"e",
"{\n\t\t\t\tmIs.close();\n\t\t\t}",
"mIs.close()",
"mIs.close",
"mIs",
"public class Main {\n\tpublic static void main(String[] args) {\n\t\tnew Main();\n\t}\n\n\tpublic Main() {\n\t\tFasterScanner sc = new FasterScanner(System.in);\n\n\t\tint n = sc.nextInt();\n\t\tint m = sc.nextInt();\n\t\tfor (int i = 0; i < m; i++) {\n\t\t\tn -= sc.nextInt();\n\t\t}\n\t\tif (n >= 0) System.out.println(n);\n\t\telse System.out.println(-1);\n\t\t\n\t\tsc.close();\n\t}\n\t\n\tclass FasterScanner {\n\t\tprivate InputStream mIs;\n\t\tprivate byte[] buf = new byte[1024];\n\t\tprivate int curChar;\n\t\tprivate int numChars;\n\n\t\tpublic FasterScanner() {\n\t\t\tthis(System.in);\n\t\t}\n\n\t\tpublic FasterScanner(InputStream is) {\n\t\t\tmIs = is;\n\t\t}\n\n\t\tpublic int read() {\n\t\t\tif (numChars == -1)\n\t\t\t\tthrow new InputMismatchException();\n\t\t\tif (curChar >= numChars) {\n\t\t\t\tcurChar = 0;\n\t\t\t\ttry {\n\t\t\t\t\tnumChars = mIs.read(buf);\n\t\t\t\t} catch (IOException e) {\n\t\t\t\t\tthrow new InputMismatchException();\n\t\t\t\t}\n\t\t\t\tif (numChars <= 0)\n\t\t\t\t\treturn -1;\n\t\t\t}\n\t\t\treturn buf[curChar++];\n\t\t}\n\n\t\tpublic String nextLine() {\n\t\t\tint c = read();\n\t\t\twhile (isSpaceChar(c))\n\t\t\t\tc = read();\n\t\t\tStringBuilder res = new StringBuilder();\n\t\t\tdo {\n\t\t\t\tres.appendCodePoint(c);\n\t\t\t\tc = read();\n\t\t\t} while (!isEndOfLine(c));\n\t\t\treturn res.toString();\n\t\t}\n\n\t\tpublic String nextString() {\n\t\t\tint c = read();\n\t\t\twhile (isSpaceChar(c))\n\t\t\t\tc = read();\n\t\t\tStringBuilder res = new StringBuilder();\n\t\t\tdo {\n\t\t\t\tres.appendCodePoint(c);\n\t\t\t\tc = read();\n\t\t\t} while (!isSpaceChar(c));\n\t\t\treturn res.toString();\n\t\t}\n\n\t\tpublic long nextLong() {\n\t\t\tint c = read();\n\t\t\twhile (isSpaceChar(c))\n\t\t\t\tc = read();\n\t\t\tint sgn = 1;\n\t\t\tif (c == '-') {\n\t\t\t\tsgn = -1;\n\t\t\t\tc = read();\n\t\t\t}\n\t\t\tlong res = 0;\n\t\t\tdo {\n\t\t\t\tif (c < '0' || c > '9')\n\t\t\t\t\tthrow new InputMismatchException();\n\t\t\t\tres *= 10;\n\t\t\t\tres += c - '0';\n\t\t\t\tc = read();\n\t\t\t} while (!isSpaceChar(c));\n\t\t\treturn res * sgn;\n\t\t}\n\n\t\tpublic int nextInt() {\n\t\t\tint c = read();\n\t\t\twhile (isSpaceChar(c))\n\t\t\t\tc = read();\n\t\t\tint sgn = 1;\n\t\t\tif (c == '-') {\n\t\t\t\tsgn = -1;\n\t\t\t\tc = read();\n\t\t\t}\n\t\t\tint res = 0;\n\t\t\tdo {\n\t\t\t\tif (c < '0' || c > '9')\n\t\t\t\t\tthrow new InputMismatchException();\n\t\t\t\tres *= 10;\n\t\t\t\tres += c - '0';\n\t\t\t\tc = read();\n\t\t\t} while (!isSpaceChar(c));\n\t\t\treturn res * sgn;\n\t\t}\n\n\t\tpublic boolean isSpaceChar(int c) {\n\t\t\treturn c == ' ' || c == '\\n' || c == '\\r' || c == '\\t' || c == -1;\n\t\t}\n\n\t\tpublic boolean isEndOfLine(int c) {\n\t\t\treturn c == '\\n' || c == '\\r' || c == -1;\n\t\t}\n\n\t\tpublic void close() {\n\t\t\ttry {\n\t\t\t\tmIs.close();\n\t\t\t} catch (IOException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\n\t}\n}",
"public class Main {\n\tpublic static void main(String[] args) {\n\t\tnew Main();\n\t}\n\n\tpublic Main() {\n\t\tFasterScanner sc = new FasterScanner(System.in);\n\n\t\tint n = sc.nextInt();\n\t\tint m = sc.nextInt();\n\t\tfor (int i = 0; i < m; i++) {\n\t\t\tn -= sc.nextInt();\n\t\t}\n\t\tif (n >= 0) System.out.println(n);\n\t\telse System.out.println(-1);\n\t\t\n\t\tsc.close();\n\t}\n\t\n\tclass FasterScanner {\n\t\tprivate InputStream mIs;\n\t\tprivate byte[] buf = new byte[1024];\n\t\tprivate int curChar;\n\t\tprivate int numChars;\n\n\t\tpublic FasterScanner() {\n\t\t\tthis(System.in);\n\t\t}\n\n\t\tpublic FasterScanner(InputStream is) {\n\t\t\tmIs = is;\n\t\t}\n\n\t\tpublic int read() {\n\t\t\tif (numChars == -1)\n\t\t\t\tthrow new InputMismatchException();\n\t\t\tif (curChar >= numChars) {\n\t\t\t\tcurChar = 0;\n\t\t\t\ttry {\n\t\t\t\t\tnumChars = mIs.read(buf);\n\t\t\t\t} catch (IOException e) {\n\t\t\t\t\tthrow new InputMismatchException();\n\t\t\t\t}\n\t\t\t\tif (numChars <= 0)\n\t\t\t\t\treturn -1;\n\t\t\t}\n\t\t\treturn buf[curChar++];\n\t\t}\n\n\t\tpublic String nextLine() {\n\t\t\tint c = read();\n\t\t\twhile (isSpaceChar(c))\n\t\t\t\tc = read();\n\t\t\tStringBuilder res = new StringBuilder();\n\t\t\tdo {\n\t\t\t\tres.appendCodePoint(c);\n\t\t\t\tc = read();\n\t\t\t} while (!isEndOfLine(c));\n\t\t\treturn res.toString();\n\t\t}\n\n\t\tpublic String nextString() {\n\t\t\tint c = read();\n\t\t\twhile (isSpaceChar(c))\n\t\t\t\tc = read();\n\t\t\tStringBuilder res = new StringBuilder();\n\t\t\tdo {\n\t\t\t\tres.appendCodePoint(c);\n\t\t\t\tc = read();\n\t\t\t} while (!isSpaceChar(c));\n\t\t\treturn res.toString();\n\t\t}\n\n\t\tpublic long nextLong() {\n\t\t\tint c = read();\n\t\t\twhile (isSpaceChar(c))\n\t\t\t\tc = read();\n\t\t\tint sgn = 1;\n\t\t\tif (c == '-') {\n\t\t\t\tsgn = -1;\n\t\t\t\tc = read();\n\t\t\t}\n\t\t\tlong res = 0;\n\t\t\tdo {\n\t\t\t\tif (c < '0' || c > '9')\n\t\t\t\t\tthrow new InputMismatchException();\n\t\t\t\tres *= 10;\n\t\t\t\tres += c - '0';\n\t\t\t\tc = read();\n\t\t\t} while (!isSpaceChar(c));\n\t\t\treturn res * sgn;\n\t\t}\n\n\t\tpublic int nextInt() {\n\t\t\tint c = read();\n\t\t\twhile (isSpaceChar(c))\n\t\t\t\tc = read();\n\t\t\tint sgn = 1;\n\t\t\tif (c == '-') {\n\t\t\t\tsgn = -1;\n\t\t\t\tc = read();\n\t\t\t}\n\t\t\tint res = 0;\n\t\t\tdo {\n\t\t\t\tif (c < '0' || c > '9')\n\t\t\t\t\tthrow new InputMismatchException();\n\t\t\t\tres *= 10;\n\t\t\t\tres += c - '0';\n\t\t\t\tc = read();\n\t\t\t} while (!isSpaceChar(c));\n\t\t\treturn res * sgn;\n\t\t}\n\n\t\tpublic boolean isSpaceChar(int c) {\n\t\t\treturn c == ' ' || c == '\\n' || c == '\\r' || c == '\\t' || c == -1;\n\t\t}\n\n\t\tpublic boolean isEndOfLine(int c) {\n\t\t\treturn c == '\\n' || c == '\\r' || c == -1;\n\t\t}\n\n\t\tpublic void close() {\n\t\t\ttry {\n\t\t\t\tmIs.close();\n\t\t\t} catch (IOException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\n\t}\n}",
"Main"
] |
import java.io.IOException;
import java.io.InputStream;
import java.util.InputMismatchException;
public class Main {
public static void main(String[] args) {
new Main();
}
public Main() {
FasterScanner sc = new FasterScanner(System.in);
int n = sc.nextInt();
int m = sc.nextInt();
for (int i = 0; i < m; i++) {
n -= sc.nextInt();
}
if (n >= 0) System.out.println(n);
else System.out.println(-1);
sc.close();
}
class FasterScanner {
private InputStream mIs;
private byte[] buf = new byte[1024];
private int curChar;
private int numChars;
public FasterScanner() {
this(System.in);
}
public FasterScanner(InputStream is) {
mIs = is;
}
public int read() {
if (numChars == -1)
throw new InputMismatchException();
if (curChar >= numChars) {
curChar = 0;
try {
numChars = mIs.read(buf);
} catch (IOException e) {
throw new InputMismatchException();
}
if (numChars <= 0)
return -1;
}
return buf[curChar++];
}
public String nextLine() {
int c = read();
while (isSpaceChar(c))
c = read();
StringBuilder res = new StringBuilder();
do {
res.appendCodePoint(c);
c = read();
} while (!isEndOfLine(c));
return res.toString();
}
public String nextString() {
int c = read();
while (isSpaceChar(c))
c = read();
StringBuilder res = new StringBuilder();
do {
res.appendCodePoint(c);
c = read();
} while (!isSpaceChar(c));
return res.toString();
}
public long nextLong() {
int c = read();
while (isSpaceChar(c))
c = read();
int sgn = 1;
if (c == '-') {
sgn = -1;
c = read();
}
long res = 0;
do {
if (c < '0' || c > '9')
throw new InputMismatchException();
res *= 10;
res += c - '0';
c = read();
} while (!isSpaceChar(c));
return res * sgn;
}
public int nextInt() {
int c = read();
while (isSpaceChar(c))
c = read();
int sgn = 1;
if (c == '-') {
sgn = -1;
c = read();
}
int res = 0;
do {
if (c < '0' || c > '9')
throw new InputMismatchException();
res *= 10;
res += c - '0';
c = read();
} while (!isSpaceChar(c));
return res * sgn;
}
public boolean isSpaceChar(int c) {
return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
}
public boolean isEndOfLine(int c) {
return c == '\n' || c == '\r' || c == -1;
}
public void close() {
try {
mIs.close();
} catch (IOException e) {
e.printStackTrace();
}
}
}
}
|
[
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,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
4,
18,
13,
41,
13,
2,
13,
13,
14,
2,
13,
17,
30,
4,
18,
18,
13,
13,
17,
30,
4,
18,
18,
13,
13,
13,
23,
13,
6,
13,
41,
13,
41,
13,
12,
13,
30,
0,
13,
20,
12,
13,
30,
42,
2,
2,
13,
17,
40,
4,
18,
13,
30,
38,
5,
13,
30,
4,
18,
13,
30,
0,
13,
20,
29,
4,
18,
13,
12,
13,
30,
29,
4,
18,
13,
4,
13,
12,
13,
30,
29,
4,
18,
13,
4,
13,
12,
13,
30,
29,
4,
18,
13,
4,
13,
12,
13,
30,
41,
13,
17,
38,
5,
13,
30,
4,
18,
13,
30,
0,
13,
4,
18,
13,
29,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
10,
11
],
[
10,
12
],
[
0,
13
],
[
166,
14
],
[
166,
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
],
[
17,
34
],
[
34,
35
],
[
35,
36
],
[
36,
37
],
[
36,
38
],
[
34,
39
],
[
39,
40
],
[
39,
41
],
[
34,
42
],
[
42,
43
],
[
43,
44
],
[
34,
45
],
[
46,
46
],
[
46,
47
],
[
47,
48
],
[
47,
49
],
[
49,
50
],
[
50,
51
],
[
17,
52
],
[
52,
53
],
[
52,
54
],
[
54,
55
],
[
54,
56
],
[
17,
57
],
[
57,
58
],
[
58,
59
],
[
58,
60
],
[
57,
61
],
[
61,
62
],
[
62,
63
],
[
63,
64
],
[
64,
65
],
[
64,
66
],
[
62,
67
],
[
57,
68
],
[
68,
69
],
[
69,
70
],
[
70,
71
],
[
71,
72
],
[
71,
73
],
[
69,
74
],
[
15,
75
],
[
75,
76
],
[
166,
77
],
[
77,
78
],
[
77,
79
],
[
79,
80
],
[
77,
81
],
[
81,
82
],
[
77,
83
],
[
83,
84
],
[
83,
85
],
[
85,
86
],
[
86,
87
],
[
86,
88
],
[
77,
89
],
[
89,
90
],
[
89,
91
],
[
91,
92
],
[
92,
93
],
[
93,
94
],
[
94,
95
],
[
94,
96
],
[
93,
97
],
[
97,
98
],
[
98,
99
],
[
99,
100
],
[
92,
101
],
[
101,
102
],
[
102,
103
],
[
103,
104
],
[
103,
105
],
[
105,
106
],
[
106,
107
],
[
107,
108
],
[
102,
109
],
[
109,
110
],
[
110,
111
],
[
110,
112
],
[
91,
113
],
[
113,
114
],
[
114,
115
],
[
115,
116
],
[
77,
117
],
[
117,
118
],
[
117,
119
],
[
119,
120
],
[
120,
121
],
[
121,
122
],
[
122,
123
],
[
121,
124
],
[
124,
125
],
[
77,
126
],
[
126,
127
],
[
126,
128
],
[
128,
129
],
[
129,
130
],
[
130,
131
],
[
131,
132
],
[
130,
133
],
[
133,
134
],
[
77,
135
],
[
135,
136
],
[
135,
137
],
[
137,
138
],
[
138,
139
],
[
139,
140
],
[
140,
141
],
[
139,
142
],
[
142,
143
],
[
77,
144
],
[
144,
145
],
[
144,
146
],
[
146,
147
],
[
147,
148
],
[
147,
149
],
[
146,
150
],
[
150,
151
],
[
151,
152
],
[
151,
153
],
[
153,
154
],
[
154,
155
],
[
155,
156
],
[
150,
157
],
[
157,
158
],
[
158,
159
],
[
158,
160
],
[
160,
161
],
[
161,
162
],
[
146,
163
],
[
163,
164
],
[
0,
165
],
[
165,
166
],
[
165,
167
]
] |
[
"import java.io.BufferedReader;\nimport java.io.IOException;\nimport java.io.InputStreamReader;\nimport java.util.StringTokenizer;\n\npublic class Main {\n public static void main(String[] args) {\n FastReader s=new FastReader();\n int n = s.nextInt();\n int m = s.nextInt();\n\n long total = 0;\n for (int i = 0; i < m; i++) {\n total += s.nextInt();\n }\n long diff = n - total;\n if(diff <0){\n System.out.println(\"-1\");\n }else{\n System.out.println(diff);\n }\n }\n\n static class FastReader\n {\n BufferedReader br;\n StringTokenizer st;\n\n public FastReader()\n {\n br = new BufferedReader(new\n InputStreamReader(System.in));\n }\n\n String next()\n {\n while (st == null || !st.hasMoreElements())\n {\n try\n {\n st = new StringTokenizer(br.readLine());\n }\n catch (IOException e)\n {\n e.printStackTrace();\n }\n }\n return st.nextToken();\n }\n\n int nextInt()\n {\n return Integer.parseInt(next());\n }\n\n long nextLong()\n {\n return Long.parseLong(next());\n }\n\n double nextDouble()\n {\n return Double.parseDouble(next());\n }\n\n String nextLine()\n {\n String str = \"\";\n try\n {\n str = br.readLine();\n }\n catch (IOException e)\n {\n e.printStackTrace();\n }\n return str;\n }\n }\n}\n",
"import java.io.BufferedReader;",
"BufferedReader",
"java.io",
"import java.io.IOException;",
"IOException",
"java.io",
"import java.io.InputStreamReader;",
"InputStreamReader",
"java.io",
"import java.util.StringTokenizer;",
"StringTokenizer",
"java.util",
"public class Main {\n public static void main(String[] args) {\n FastReader s=new FastReader();\n int n = s.nextInt();\n int m = s.nextInt();\n\n long total = 0;\n for (int i = 0; i < m; i++) {\n total += s.nextInt();\n }\n long diff = n - total;\n if(diff <0){\n System.out.println(\"-1\");\n }else{\n System.out.println(diff);\n }\n }\n\n static class FastReader\n {\n BufferedReader br;\n StringTokenizer st;\n\n public FastReader()\n {\n br = new BufferedReader(new\n InputStreamReader(System.in));\n }\n\n String next()\n {\n while (st == null || !st.hasMoreElements())\n {\n try\n {\n st = new StringTokenizer(br.readLine());\n }\n catch (IOException e)\n {\n e.printStackTrace();\n }\n }\n return st.nextToken();\n }\n\n int nextInt()\n {\n return Integer.parseInt(next());\n }\n\n long nextLong()\n {\n return Long.parseLong(next());\n }\n\n double nextDouble()\n {\n return Double.parseDouble(next());\n }\n\n String nextLine()\n {\n String str = \"\";\n try\n {\n str = br.readLine();\n }\n catch (IOException e)\n {\n e.printStackTrace();\n }\n return str;\n }\n }\n}",
"Main",
"public static void main(String[] args) {\n FastReader s=new FastReader();\n int n = s.nextInt();\n int m = s.nextInt();\n\n long total = 0;\n for (int i = 0; i < m; i++) {\n total += s.nextInt();\n }\n long diff = n - total;\n if(diff <0){\n System.out.println(\"-1\");\n }else{\n System.out.println(diff);\n }\n }",
"main",
"{\n FastReader s=new FastReader();\n int n = s.nextInt();\n int m = s.nextInt();\n\n long total = 0;\n for (int i = 0; i < m; i++) {\n total += s.nextInt();\n }\n long diff = n - total;\n if(diff <0){\n System.out.println(\"-1\");\n }else{\n System.out.println(diff);\n }\n }",
"FastReader s=new FastReader();",
"s",
"new FastReader()",
"int n = s.nextInt();",
"n",
"s.nextInt()",
"s.nextInt",
"s",
"int m = s.nextInt();",
"m",
"s.nextInt()",
"s.nextInt",
"s",
"long total = 0;",
"total",
"0",
"for (int i = 0; i < m; i++) {\n total += s.nextInt();\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < m",
"i",
"m",
"i++",
"i++",
"i",
"{\n total += s.nextInt();\n }",
"{\n total += s.nextInt();\n }",
"total += s.nextInt()",
"total",
"s.nextInt()",
"s.nextInt",
"s",
"long diff = n - total;",
"diff",
"n - total",
"n",
"total",
"if(diff <0){\n System.out.println(\"-1\");\n }else{\n System.out.println(diff);\n }",
"diff <0",
"diff",
"0",
"{\n System.out.println(\"-1\");\n }",
"System.out.println(\"-1\")",
"System.out.println",
"System.out",
"System",
"System.out",
"\"-1\"",
"{\n System.out.println(diff);\n }",
"System.out.println(diff)",
"System.out.println",
"System.out",
"System",
"System.out",
"diff",
"String[] args",
"args",
"static class FastReader\n {\n BufferedReader br;\n StringTokenizer st;\n\n public FastReader()\n {\n br = new BufferedReader(new\n InputStreamReader(System.in));\n }\n\n String next()\n {\n while (st == null || !st.hasMoreElements())\n {\n try\n {\n st = new StringTokenizer(br.readLine());\n }\n catch (IOException e)\n {\n e.printStackTrace();\n }\n }\n return st.nextToken();\n }\n\n int nextInt()\n {\n return Integer.parseInt(next());\n }\n\n long nextLong()\n {\n return Long.parseLong(next());\n }\n\n double nextDouble()\n {\n return Double.parseDouble(next());\n }\n\n String nextLine()\n {\n String str = \"\";\n try\n {\n str = br.readLine();\n }\n catch (IOException e)\n {\n e.printStackTrace();\n }\n return str;\n }\n }",
"FastReader",
"BufferedReader br;",
"br",
"StringTokenizer st;",
"st",
"public FastReader()\n {\n br = new BufferedReader(new\n InputStreamReader(System.in));\n }",
"FastReader",
"{\n br = new BufferedReader(new\n InputStreamReader(System.in));\n }",
"br = new BufferedReader(new\n InputStreamReader(System.in))",
"br",
"new BufferedReader(new\n InputStreamReader(System.in))",
"String next()\n {\n while (st == null || !st.hasMoreElements())\n {\n try\n {\n st = new StringTokenizer(br.readLine());\n }\n catch (IOException e)\n {\n e.printStackTrace();\n }\n }\n return st.nextToken();\n }",
"next",
"{\n while (st == null || !st.hasMoreElements())\n {\n try\n {\n st = new StringTokenizer(br.readLine());\n }\n catch (IOException e)\n {\n e.printStackTrace();\n }\n }\n return st.nextToken();\n }",
"while (st == null || !st.hasMoreElements())\n {\n try\n {\n st = new StringTokenizer(br.readLine());\n }\n catch (IOException e)\n {\n e.printStackTrace();\n }\n }",
"st == null || !st.hasMoreElements()",
"st == null",
"st",
"null",
"!st.hasMoreElements()",
"st.hasMoreElements()",
"st.hasMoreElements",
"st",
"{\n try\n {\n st = new StringTokenizer(br.readLine());\n }\n catch (IOException e)\n {\n e.printStackTrace();\n }\n }",
"try\n {\n st = new StringTokenizer(br.readLine());\n }\n catch (IOException e)\n {\n e.printStackTrace();\n }",
"catch (IOException e)\n {\n e.printStackTrace();\n }",
"IOException e",
"{\n e.printStackTrace();\n }",
"e.printStackTrace()",
"e.printStackTrace",
"e",
"{\n st = new StringTokenizer(br.readLine());\n }",
"st = new StringTokenizer(br.readLine())",
"st",
"new StringTokenizer(br.readLine())",
"return st.nextToken();",
"st.nextToken()",
"st.nextToken",
"st",
"int nextInt()\n {\n return Integer.parseInt(next());\n }",
"nextInt",
"{\n return Integer.parseInt(next());\n }",
"return Integer.parseInt(next());",
"Integer.parseInt(next())",
"Integer.parseInt",
"Integer",
"next()",
"next",
"long nextLong()\n {\n return Long.parseLong(next());\n }",
"nextLong",
"{\n return Long.parseLong(next());\n }",
"return Long.parseLong(next());",
"Long.parseLong(next())",
"Long.parseLong",
"Long",
"next()",
"next",
"double nextDouble()\n {\n return Double.parseDouble(next());\n }",
"nextDouble",
"{\n return Double.parseDouble(next());\n }",
"return Double.parseDouble(next());",
"Double.parseDouble(next())",
"Double.parseDouble",
"Double",
"next()",
"next",
"String nextLine()\n {\n String str = \"\";\n try\n {\n str = br.readLine();\n }\n catch (IOException e)\n {\n e.printStackTrace();\n }\n return str;\n }",
"nextLine",
"{\n String str = \"\";\n try\n {\n str = br.readLine();\n }\n catch (IOException e)\n {\n e.printStackTrace();\n }\n return str;\n }",
"String str = \"\";",
"str",
"\"\"",
"try\n {\n str = br.readLine();\n }\n catch (IOException e)\n {\n e.printStackTrace();\n }",
"catch (IOException e)\n {\n e.printStackTrace();\n }",
"IOException e",
"{\n e.printStackTrace();\n }",
"e.printStackTrace()",
"e.printStackTrace",
"e",
"{\n str = br.readLine();\n }",
"str = br.readLine()",
"str",
"br.readLine()",
"br.readLine",
"br",
"return str;",
"str",
"public class Main {\n public static void main(String[] args) {\n FastReader s=new FastReader();\n int n = s.nextInt();\n int m = s.nextInt();\n\n long total = 0;\n for (int i = 0; i < m; i++) {\n total += s.nextInt();\n }\n long diff = n - total;\n if(diff <0){\n System.out.println(\"-1\");\n }else{\n System.out.println(diff);\n }\n }\n\n static class FastReader\n {\n BufferedReader br;\n StringTokenizer st;\n\n public FastReader()\n {\n br = new BufferedReader(new\n InputStreamReader(System.in));\n }\n\n String next()\n {\n while (st == null || !st.hasMoreElements())\n {\n try\n {\n st = new StringTokenizer(br.readLine());\n }\n catch (IOException e)\n {\n e.printStackTrace();\n }\n }\n return st.nextToken();\n }\n\n int nextInt()\n {\n return Integer.parseInt(next());\n }\n\n long nextLong()\n {\n return Long.parseLong(next());\n }\n\n double nextDouble()\n {\n return Double.parseDouble(next());\n }\n\n String nextLine()\n {\n String str = \"\";\n try\n {\n str = br.readLine();\n }\n catch (IOException e)\n {\n e.printStackTrace();\n }\n return str;\n }\n }\n}",
"public class Main {\n public static void main(String[] args) {\n FastReader s=new FastReader();\n int n = s.nextInt();\n int m = s.nextInt();\n\n long total = 0;\n for (int i = 0; i < m; i++) {\n total += s.nextInt();\n }\n long diff = n - total;\n if(diff <0){\n System.out.println(\"-1\");\n }else{\n System.out.println(diff);\n }\n }\n\n static class FastReader\n {\n BufferedReader br;\n StringTokenizer st;\n\n public FastReader()\n {\n br = new BufferedReader(new\n InputStreamReader(System.in));\n }\n\n String next()\n {\n while (st == null || !st.hasMoreElements())\n {\n try\n {\n st = new StringTokenizer(br.readLine());\n }\n catch (IOException e)\n {\n e.printStackTrace();\n }\n }\n return st.nextToken();\n }\n\n int nextInt()\n {\n return Integer.parseInt(next());\n }\n\n long nextLong()\n {\n return Long.parseLong(next());\n }\n\n double nextDouble()\n {\n return Double.parseDouble(next());\n }\n\n String nextLine()\n {\n String str = \"\";\n try\n {\n str = br.readLine();\n }\n catch (IOException e)\n {\n e.printStackTrace();\n }\n return str;\n }\n }\n}",
"Main"
] |
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.StringTokenizer;
public class Main {
public static void main(String[] args) {
FastReader s=new FastReader();
int n = s.nextInt();
int m = s.nextInt();
long total = 0;
for (int i = 0; i < m; i++) {
total += s.nextInt();
}
long diff = n - total;
if(diff <0){
System.out.println("-1");
}else{
System.out.println(diff);
}
}
static class FastReader
{
BufferedReader br;
StringTokenizer st;
public FastReader()
{
br = new BufferedReader(new
InputStreamReader(System.in));
}
String next()
{
while (st == null || !st.hasMoreElements())
{
try
{
st = new StringTokenizer(br.readLine());
}
catch (IOException e)
{
e.printStackTrace();
}
}
return st.nextToken();
}
int nextInt()
{
return Integer.parseInt(next());
}
long nextLong()
{
return Long.parseLong(next());
}
double nextDouble()
{
return Double.parseDouble(next());
}
String nextLine()
{
String str = "";
try
{
str = br.readLine();
}
catch (IOException e)
{
e.printStackTrace();
}
return str;
}
}
}
|
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
4,
18,
13,
14,
2,
13,
13,
30,
4,
18,
18,
13,
13,
2,
13,
13,
30,
4,
18,
18,
13,
13,
40,
17,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
67,
5
],
[
67,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
8,
17
],
[
17,
18
],
[
17,
19
],
[
19,
20
],
[
20,
21
],
[
8,
22
],
[
22,
23
],
[
22,
24
],
[
8,
25
],
[
25,
26
],
[
26,
27
],
[
27,
28
],
[
27,
29
],
[
25,
30
],
[
30,
31
],
[
30,
32
],
[
25,
33
],
[
33,
34
],
[
34,
35
],
[
25,
36
],
[
37,
37
],
[
37,
38
],
[
38,
39
],
[
38,
40
],
[
40,
41
],
[
41,
42
],
[
8,
43
],
[
43,
44
],
[
44,
45
],
[
44,
46
],
[
43,
47
],
[
47,
48
],
[
48,
49
],
[
49,
50
],
[
50,
51
],
[
50,
52
],
[
48,
53
],
[
53,
54
],
[
53,
55
],
[
43,
56
],
[
56,
57
],
[
57,
58
],
[
58,
59
],
[
59,
60
],
[
59,
61
],
[
57,
62
],
[
62,
63
],
[
6,
64
],
[
64,
65
],
[
0,
66
],
[
66,
67
],
[
66,
68
]
] |
[
"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 n = scan.nextInt();\n\t\tint m = scan.nextInt();\n\t\tint aSum = 0;\n\t\tfor (int i = 0; i < m; i++) {\n\t\t\taSum += scan.nextInt();\n\t\t}\n\t\tif (n >= aSum) {\n\t\t\tSystem.out.println(n - aSum);\n\t\t} else {\n\t\t\tSystem.out.println(-1);\n\t\t}\n\n\t}\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n\tpublic static void main(String[] args) {\n\t\tScanner scan = new Scanner(System.in);\n\t\tint n = scan.nextInt();\n\t\tint m = scan.nextInt();\n\t\tint aSum = 0;\n\t\tfor (int i = 0; i < m; i++) {\n\t\t\taSum += scan.nextInt();\n\t\t}\n\t\tif (n >= aSum) {\n\t\t\tSystem.out.println(n - aSum);\n\t\t} else {\n\t\t\tSystem.out.println(-1);\n\t\t}\n\n\t}\n}",
"Main",
"public static void main(String[] args) {\n\t\tScanner scan = new Scanner(System.in);\n\t\tint n = scan.nextInt();\n\t\tint m = scan.nextInt();\n\t\tint aSum = 0;\n\t\tfor (int i = 0; i < m; i++) {\n\t\t\taSum += scan.nextInt();\n\t\t}\n\t\tif (n >= aSum) {\n\t\t\tSystem.out.println(n - aSum);\n\t\t} else {\n\t\t\tSystem.out.println(-1);\n\t\t}\n\n\t}",
"main",
"{\n\t\tScanner scan = new Scanner(System.in);\n\t\tint n = scan.nextInt();\n\t\tint m = scan.nextInt();\n\t\tint aSum = 0;\n\t\tfor (int i = 0; i < m; i++) {\n\t\t\taSum += scan.nextInt();\n\t\t}\n\t\tif (n >= aSum) {\n\t\t\tSystem.out.println(n - aSum);\n\t\t} else {\n\t\t\tSystem.out.println(-1);\n\t\t}\n\n\t}",
"Scanner scan = new Scanner(System.in);",
"scan",
"new Scanner(System.in)",
"int n = scan.nextInt();",
"n",
"scan.nextInt()",
"scan.nextInt",
"scan",
"int m = scan.nextInt();",
"m",
"scan.nextInt()",
"scan.nextInt",
"scan",
"int aSum = 0;",
"aSum",
"0",
"for (int i = 0; i < m; i++) {\n\t\t\taSum += scan.nextInt();\n\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < m",
"i",
"m",
"i++",
"i++",
"i",
"{\n\t\t\taSum += scan.nextInt();\n\t\t}",
"{\n\t\t\taSum += scan.nextInt();\n\t\t}",
"aSum += scan.nextInt()",
"aSum",
"scan.nextInt()",
"scan.nextInt",
"scan",
"if (n >= aSum) {\n\t\t\tSystem.out.println(n - aSum);\n\t\t} else {\n\t\t\tSystem.out.println(-1);\n\t\t}",
"n >= aSum",
"n",
"aSum",
"{\n\t\t\tSystem.out.println(n - aSum);\n\t\t}",
"System.out.println(n - aSum)",
"System.out.println",
"System.out",
"System",
"System.out",
"n - aSum",
"n",
"aSum",
"{\n\t\t\tSystem.out.println(-1);\n\t\t}",
"System.out.println(-1)",
"System.out.println",
"System.out",
"System",
"System.out",
"-1",
"1",
"String[] args",
"args",
"public class Main {\n\tpublic static void main(String[] args) {\n\t\tScanner scan = new Scanner(System.in);\n\t\tint n = scan.nextInt();\n\t\tint m = scan.nextInt();\n\t\tint aSum = 0;\n\t\tfor (int i = 0; i < m; i++) {\n\t\t\taSum += scan.nextInt();\n\t\t}\n\t\tif (n >= aSum) {\n\t\t\tSystem.out.println(n - aSum);\n\t\t} else {\n\t\t\tSystem.out.println(-1);\n\t\t}\n\n\t}\n}",
"public class Main {\n\tpublic static void main(String[] args) {\n\t\tScanner scan = new Scanner(System.in);\n\t\tint n = scan.nextInt();\n\t\tint m = scan.nextInt();\n\t\tint aSum = 0;\n\t\tfor (int i = 0; i < m; i++) {\n\t\t\taSum += scan.nextInt();\n\t\t}\n\t\tif (n >= aSum) {\n\t\t\tSystem.out.println(n - aSum);\n\t\t} else {\n\t\t\tSystem.out.println(-1);\n\t\t}\n\n\t}\n}",
"Main"
] |
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
int n = scan.nextInt();
int m = scan.nextInt();
int aSum = 0;
for (int i = 0; i < m; i++) {
aSum += scan.nextInt();
}
if (n >= aSum) {
System.out.println(n - aSum);
} else {
System.out.println(-1);
}
}
}
|
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
41,
13,
20,
13,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
18,
13,
13,
4,
18,
13,
0,
13,
18,
13,
13,
14,
2,
2,
13,
13,
17,
30,
4,
18,
18,
13,
13,
2,
13,
13,
30,
4,
18,
18,
13,
13,
40,
17,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
80,
5
],
[
80,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
8,
17
],
[
17,
18
],
[
17,
19
],
[
19,
20
],
[
20,
21
],
[
8,
22
],
[
22,
23
],
[
22,
24
],
[
8,
26
],
[
26,
27
],
[
26,
28
],
[
8,
29
],
[
29,
30
],
[
30,
31
],
[
31,
32
],
[
31,
33
],
[
29,
34
],
[
34,
35
],
[
34,
36
],
[
29,
37
],
[
37,
38
],
[
38,
39
],
[
29,
40
],
[
41,
41
],
[
41,
42
],
[
42,
43
],
[
43,
44
],
[
43,
45
],
[
42,
46
],
[
46,
47
],
[
47,
48
],
[
41,
49
],
[
49,
50
],
[
49,
51
],
[
51,
52
],
[
51,
53
],
[
8,
54
],
[
54,
55
],
[
55,
56
],
[
56,
57
],
[
56,
58
],
[
55,
59
],
[
54,
60
],
[
60,
61
],
[
61,
62
],
[
62,
63
],
[
63,
64
],
[
63,
65
],
[
61,
66
],
[
66,
67
],
[
66,
68
],
[
54,
69
],
[
69,
70
],
[
70,
71
],
[
71,
72
],
[
72,
73
],
[
72,
74
],
[
70,
75
],
[
75,
76
],
[
6,
77
],
[
77,
78
],
[
0,
79
],
[
79,
80
],
[
79,
81
]
] |
[
"import java.util.*;\n\npublic class Main {\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n int N = sc.nextInt();\n int M = sc.nextInt();\n int[] A = new int[M];\n int total =0;\n for (int i =0; i<M; i++) {\n A[i] = sc.nextInt();\n total += A[i];\n }\n if (N - total >= 0) {\n System.out.println(N - total);\n } else {\n System.out.println(-1);\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 N = sc.nextInt();\n int M = sc.nextInt();\n int[] A = new int[M];\n int total =0;\n for (int i =0; i<M; i++) {\n A[i] = sc.nextInt();\n total += A[i];\n }\n if (N - total >= 0) {\n System.out.println(N - total);\n } else {\n System.out.println(-1);\n }\n }\n}",
"Main",
"public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n int N = sc.nextInt();\n int M = sc.nextInt();\n int[] A = new int[M];\n int total =0;\n for (int i =0; i<M; i++) {\n A[i] = sc.nextInt();\n total += A[i];\n }\n if (N - total >= 0) {\n System.out.println(N - total);\n } else {\n System.out.println(-1);\n }\n }",
"main",
"{\n Scanner sc = new Scanner(System.in);\n int N = sc.nextInt();\n int M = sc.nextInt();\n int[] A = new int[M];\n int total =0;\n for (int i =0; i<M; i++) {\n A[i] = sc.nextInt();\n total += A[i];\n }\n if (N - total >= 0) {\n System.out.println(N - total);\n } else {\n System.out.println(-1);\n }\n }",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"int N = sc.nextInt();",
"N",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int M = sc.nextInt();",
"M",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int[] A = new int[M];",
"A",
"new int[M]",
"M",
"int total =0;",
"total",
"0",
"for (int i =0; i<M; i++) {\n A[i] = sc.nextInt();\n total += A[i];\n }",
"int i =0;",
"int i =0;",
"i",
"0",
"i<M",
"i",
"M",
"i++",
"i++",
"i",
"{\n A[i] = sc.nextInt();\n total += A[i];\n }",
"{\n A[i] = sc.nextInt();\n total += A[i];\n }",
"A[i] = sc.nextInt()",
"A[i]",
"A",
"i",
"sc.nextInt()",
"sc.nextInt",
"sc",
"total += A[i]",
"total",
"A[i]",
"A",
"i",
"if (N - total >= 0) {\n System.out.println(N - total);\n } else {\n System.out.println(-1);\n }",
"N - total >= 0",
"N - total",
"N",
"total",
"0",
"{\n System.out.println(N - total);\n }",
"System.out.println(N - total)",
"System.out.println",
"System.out",
"System",
"System.out",
"N - total",
"N",
"total",
"{\n System.out.println(-1);\n }",
"System.out.println(-1)",
"System.out.println",
"System.out",
"System",
"System.out",
"-1",
"1",
"String[] args",
"args",
"public class Main {\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n int N = sc.nextInt();\n int M = sc.nextInt();\n int[] A = new int[M];\n int total =0;\n for (int i =0; i<M; i++) {\n A[i] = sc.nextInt();\n total += A[i];\n }\n if (N - total >= 0) {\n System.out.println(N - total);\n } else {\n System.out.println(-1);\n }\n }\n}",
"public class Main {\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n int N = sc.nextInt();\n int M = sc.nextInt();\n int[] A = new int[M];\n int total =0;\n for (int i =0; i<M; i++) {\n A[i] = sc.nextInt();\n total += A[i];\n }\n if (N - total >= 0) {\n System.out.println(N - total);\n } else {\n System.out.println(-1);\n }\n }\n}",
"Main"
] |
import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int N = sc.nextInt();
int M = sc.nextInt();
int[] A = new int[M];
int total =0;
for (int i =0; i<M; i++) {
A[i] = sc.nextInt();
total += A[i];
}
if (N - total >= 0) {
System.out.println(N - total);
} else {
System.out.println(-1);
}
}
}
|
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
4,
18,
13,
14,
2,
2,
13,
13,
17,
30,
4,
18,
18,
13,
13,
2,
13,
13,
30,
4,
18,
18,
13,
13,
40,
17,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
69,
5
],
[
69,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
8,
17
],
[
17,
18
],
[
17,
19
],
[
19,
20
],
[
20,
21
],
[
8,
22
],
[
22,
23
],
[
22,
24
],
[
8,
25
],
[
25,
26
],
[
26,
27
],
[
27,
28
],
[
27,
29
],
[
25,
30
],
[
30,
31
],
[
30,
32
],
[
25,
33
],
[
33,
34
],
[
34,
35
],
[
25,
36
],
[
37,
37
],
[
37,
38
],
[
38,
39
],
[
38,
40
],
[
40,
41
],
[
41,
42
],
[
8,
43
],
[
43,
44
],
[
44,
45
],
[
45,
46
],
[
45,
47
],
[
44,
48
],
[
43,
49
],
[
49,
50
],
[
50,
51
],
[
51,
52
],
[
52,
53
],
[
52,
54
],
[
50,
55
],
[
55,
56
],
[
55,
57
],
[
43,
58
],
[
58,
59
],
[
59,
60
],
[
60,
61
],
[
61,
62
],
[
61,
63
],
[
59,
64
],
[
64,
65
],
[
6,
66
],
[
66,
67
],
[
0,
68
],
[
68,
69
],
[
68,
70
]
] |
[
"import java.util.*;\n\npublic class Main {\n\n\tpublic static void main(String[] args) {\n\t\n\t\tScanner sc = new Scanner(System.in);\n\t\tint N = sc.nextInt();\n\t\tint M = sc.nextInt();\n\t\tint sum = 0;\n\t\tfor(int i = 0; i < M; i++) {\n\t\t\tsum += sc.nextInt();\n\t\t}\n\t\tif(N - sum >= 0) {\n\t\t\tSystem.out.println(N - sum);\n\t\t} else {\n\t\t\tSystem.out.println(-1);\n\t\t}\n\n\t}\n\t\n}",
"import java.util.*;",
"util.*",
"java",
"public class Main {\n\n\tpublic static void main(String[] args) {\n\t\n\t\tScanner sc = new Scanner(System.in);\n\t\tint N = sc.nextInt();\n\t\tint M = sc.nextInt();\n\t\tint sum = 0;\n\t\tfor(int i = 0; i < M; i++) {\n\t\t\tsum += sc.nextInt();\n\t\t}\n\t\tif(N - sum >= 0) {\n\t\t\tSystem.out.println(N - sum);\n\t\t} else {\n\t\t\tSystem.out.println(-1);\n\t\t}\n\n\t}\n\t\n}",
"Main",
"public static void main(String[] args) {\n\t\n\t\tScanner sc = new Scanner(System.in);\n\t\tint N = sc.nextInt();\n\t\tint M = sc.nextInt();\n\t\tint sum = 0;\n\t\tfor(int i = 0; i < M; i++) {\n\t\t\tsum += sc.nextInt();\n\t\t}\n\t\tif(N - sum >= 0) {\n\t\t\tSystem.out.println(N - sum);\n\t\t} else {\n\t\t\tSystem.out.println(-1);\n\t\t}\n\n\t}",
"main",
"{\n\t\n\t\tScanner sc = new Scanner(System.in);\n\t\tint N = sc.nextInt();\n\t\tint M = sc.nextInt();\n\t\tint sum = 0;\n\t\tfor(int i = 0; i < M; i++) {\n\t\t\tsum += sc.nextInt();\n\t\t}\n\t\tif(N - sum >= 0) {\n\t\t\tSystem.out.println(N - sum);\n\t\t} else {\n\t\t\tSystem.out.println(-1);\n\t\t}\n\n\t}",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"int N = sc.nextInt();",
"N",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int M = sc.nextInt();",
"M",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int sum = 0;",
"sum",
"0",
"for(int i = 0; i < M; i++) {\n\t\t\tsum += sc.nextInt();\n\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < M",
"i",
"M",
"i++",
"i++",
"i",
"{\n\t\t\tsum += sc.nextInt();\n\t\t}",
"{\n\t\t\tsum += sc.nextInt();\n\t\t}",
"sum += sc.nextInt()",
"sum",
"sc.nextInt()",
"sc.nextInt",
"sc",
"if(N - sum >= 0) {\n\t\t\tSystem.out.println(N - sum);\n\t\t} else {\n\t\t\tSystem.out.println(-1);\n\t\t}",
"N - sum >= 0",
"N - sum",
"N",
"sum",
"0",
"{\n\t\t\tSystem.out.println(N - sum);\n\t\t}",
"System.out.println(N - sum)",
"System.out.println",
"System.out",
"System",
"System.out",
"N - sum",
"N",
"sum",
"{\n\t\t\tSystem.out.println(-1);\n\t\t}",
"System.out.println(-1)",
"System.out.println",
"System.out",
"System",
"System.out",
"-1",
"1",
"String[] args",
"args",
"public class Main {\n\n\tpublic static void main(String[] args) {\n\t\n\t\tScanner sc = new Scanner(System.in);\n\t\tint N = sc.nextInt();\n\t\tint M = sc.nextInt();\n\t\tint sum = 0;\n\t\tfor(int i = 0; i < M; i++) {\n\t\t\tsum += sc.nextInt();\n\t\t}\n\t\tif(N - sum >= 0) {\n\t\t\tSystem.out.println(N - sum);\n\t\t} else {\n\t\t\tSystem.out.println(-1);\n\t\t}\n\n\t}\n\t\n}",
"public class Main {\n\n\tpublic static void main(String[] args) {\n\t\n\t\tScanner sc = new Scanner(System.in);\n\t\tint N = sc.nextInt();\n\t\tint M = sc.nextInt();\n\t\tint sum = 0;\n\t\tfor(int i = 0; i < M; i++) {\n\t\t\tsum += sc.nextInt();\n\t\t}\n\t\tif(N - sum >= 0) {\n\t\t\tSystem.out.println(N - sum);\n\t\t} else {\n\t\t\tSystem.out.println(-1);\n\t\t}\n\n\t}\n\t\n}",
"Main"
] |
import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int N = sc.nextInt();
int M = sc.nextInt();
int sum = 0;
for(int i = 0; i < M; i++) {
sum += sc.nextInt();
}
if(N - sum >= 0) {
System.out.println(N - sum);
} else {
System.out.println(-1);
}
}
}
|
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
41,
13,
20,
13,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
18,
13,
13,
1,
40,
13,
30,
30,
0,
18,
13,
13,
4,
18,
13,
0,
13,
18,
13,
13,
0,
13,
13,
14,
2,
13,
17,
30,
4,
18,
18,
13,
13,
13,
30,
4,
18,
18,
13,
13,
40,
17,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
81,
5
],
[
81,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
8,
17
],
[
17,
18
],
[
17,
19
],
[
19,
20
],
[
20,
21
],
[
8,
22
],
[
22,
23
],
[
22,
24
],
[
8,
26
],
[
26,
27
],
[
26,
28
],
[
8,
29
],
[
29,
30
],
[
30,
31
],
[
31,
32
],
[
31,
33
],
[
29,
34
],
[
34,
35
],
[
34,
36
],
[
36,
37
],
[
36,
38
],
[
29,
39
],
[
39,
40
],
[
40,
41
],
[
29,
42
],
[
43,
43
],
[
43,
44
],
[
44,
45
],
[
45,
46
],
[
45,
47
],
[
44,
48
],
[
48,
49
],
[
49,
50
],
[
43,
51
],
[
51,
52
],
[
51,
53
],
[
53,
54
],
[
53,
55
],
[
8,
56
],
[
56,
57
],
[
56,
58
],
[
8,
59
],
[
59,
60
],
[
60,
61
],
[
60,
62
],
[
59,
63
],
[
63,
64
],
[
64,
65
],
[
65,
66
],
[
66,
67
],
[
66,
68
],
[
64,
69
],
[
59,
70
],
[
70,
71
],
[
71,
72
],
[
72,
73
],
[
73,
74
],
[
73,
75
],
[
71,
76
],
[
76,
77
],
[
6,
78
],
[
78,
79
],
[
0,
80
],
[
80,
81
],
[
80,
82
]
] |
[
"import java.util.Scanner;\n\npublic class Main {\n\n\tpublic static void main(String[] args) {\n\t\t// TODO ่ชๅ็ๆใใใใกใฝใใใปในใฟใ\n\t\tScanner scan = new Scanner(System.in);\n\n\t\tint n = scan.nextInt();\n\t\tint m = scan.nextInt();\n\t\tint[] a = new int[m];\n\t\t\n\t\tint total = 0;\n\t\tfor(int i = 0; i < a.length; i++) {\n\t\t\ta[i] = scan.nextInt();\n\t\t\ttotal += a[i];\n\t\t}\n\t\t\n\t\tn -= total;\n\t\t\n\t\tif(n >= 0) {\n\t\t\tSystem.out.print(n);\n\t\t}else {\n\t\t\tSystem.out.print(-1);\n\t\t}\n\t\t\n\n\t}\n\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n\n\tpublic static void main(String[] args) {\n\t\t// TODO ่ชๅ็ๆใใใใกใฝใใใปในใฟใ\n\t\tScanner scan = new Scanner(System.in);\n\n\t\tint n = scan.nextInt();\n\t\tint m = scan.nextInt();\n\t\tint[] a = new int[m];\n\t\t\n\t\tint total = 0;\n\t\tfor(int i = 0; i < a.length; i++) {\n\t\t\ta[i] = scan.nextInt();\n\t\t\ttotal += a[i];\n\t\t}\n\t\t\n\t\tn -= total;\n\t\t\n\t\tif(n >= 0) {\n\t\t\tSystem.out.print(n);\n\t\t}else {\n\t\t\tSystem.out.print(-1);\n\t\t}\n\t\t\n\n\t}\n\n}",
"Main",
"public static void main(String[] args) {\n\t\t// TODO ่ชๅ็ๆใใใใกใฝใใใปในใฟใ\n\t\tScanner scan = new Scanner(System.in);\n\n\t\tint n = scan.nextInt();\n\t\tint m = scan.nextInt();\n\t\tint[] a = new int[m];\n\t\t\n\t\tint total = 0;\n\t\tfor(int i = 0; i < a.length; i++) {\n\t\t\ta[i] = scan.nextInt();\n\t\t\ttotal += a[i];\n\t\t}\n\t\t\n\t\tn -= total;\n\t\t\n\t\tif(n >= 0) {\n\t\t\tSystem.out.print(n);\n\t\t}else {\n\t\t\tSystem.out.print(-1);\n\t\t}\n\t\t\n\n\t}",
"main",
"{\n\t\t// TODO ่ชๅ็ๆใใใใกใฝใใใปในใฟใ\n\t\tScanner scan = new Scanner(System.in);\n\n\t\tint n = scan.nextInt();\n\t\tint m = scan.nextInt();\n\t\tint[] a = new int[m];\n\t\t\n\t\tint total = 0;\n\t\tfor(int i = 0; i < a.length; i++) {\n\t\t\ta[i] = scan.nextInt();\n\t\t\ttotal += a[i];\n\t\t}\n\t\t\n\t\tn -= total;\n\t\t\n\t\tif(n >= 0) {\n\t\t\tSystem.out.print(n);\n\t\t}else {\n\t\t\tSystem.out.print(-1);\n\t\t}\n\t\t\n\n\t}",
"Scanner scan = new Scanner(System.in);",
"scan",
"new Scanner(System.in)",
"int n = scan.nextInt();",
"n",
"scan.nextInt()",
"scan.nextInt",
"scan",
"int m = scan.nextInt();",
"m",
"scan.nextInt()",
"scan.nextInt",
"scan",
"int[] a = new int[m];",
"a",
"new int[m]",
"m",
"int total = 0;",
"total",
"0",
"for(int i = 0; i < a.length; i++) {\n\t\t\ta[i] = scan.nextInt();\n\t\t\ttotal += a[i];\n\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < a.length",
"i",
"a.length",
"a",
"a.length",
"i++",
"i++",
"i",
"{\n\t\t\ta[i] = scan.nextInt();\n\t\t\ttotal += a[i];\n\t\t}",
"{\n\t\t\ta[i] = scan.nextInt();\n\t\t\ttotal += a[i];\n\t\t}",
"a[i] = scan.nextInt()",
"a[i]",
"a",
"i",
"scan.nextInt()",
"scan.nextInt",
"scan",
"total += a[i]",
"total",
"a[i]",
"a",
"i",
"n -= total",
"n",
"total",
"if(n >= 0) {\n\t\t\tSystem.out.print(n);\n\t\t}else {\n\t\t\tSystem.out.print(-1);\n\t\t}",
"n >= 0",
"n",
"0",
"{\n\t\t\tSystem.out.print(n);\n\t\t}",
"System.out.print(n)",
"System.out.print",
"System.out",
"System",
"System.out",
"n",
"{\n\t\t\tSystem.out.print(-1);\n\t\t}",
"System.out.print(-1)",
"System.out.print",
"System.out",
"System",
"System.out",
"-1",
"1",
"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\n\t\tint n = scan.nextInt();\n\t\tint m = scan.nextInt();\n\t\tint[] a = new int[m];\n\t\t\n\t\tint total = 0;\n\t\tfor(int i = 0; i < a.length; i++) {\n\t\t\ta[i] = scan.nextInt();\n\t\t\ttotal += a[i];\n\t\t}\n\t\t\n\t\tn -= total;\n\t\t\n\t\tif(n >= 0) {\n\t\t\tSystem.out.print(n);\n\t\t}else {\n\t\t\tSystem.out.print(-1);\n\t\t}\n\t\t\n\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\n\t\tint n = scan.nextInt();\n\t\tint m = scan.nextInt();\n\t\tint[] a = new int[m];\n\t\t\n\t\tint total = 0;\n\t\tfor(int i = 0; i < a.length; i++) {\n\t\t\ta[i] = scan.nextInt();\n\t\t\ttotal += a[i];\n\t\t}\n\t\t\n\t\tn -= total;\n\t\t\n\t\tif(n >= 0) {\n\t\t\tSystem.out.print(n);\n\t\t}else {\n\t\t\tSystem.out.print(-1);\n\t\t}\n\t\t\n\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 n = scan.nextInt();
int m = scan.nextInt();
int[] a = new int[m];
int total = 0;
for(int i = 0; i < a.length; i++) {
a[i] = scan.nextInt();
total += a[i];
}
n -= total;
if(n >= 0) {
System.out.print(n);
}else {
System.out.print(-1);
}
}
}
|
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
41,
13,
4,
18,
13,
0,
13,
13,
14,
2,
2,
13,
13,
17,
30,
4,
18,
18,
13,
13,
40,
17,
30,
4,
18,
18,
13,
13,
2,
13,
13,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
72,
5
],
[
72,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
8,
17
],
[
17,
18
],
[
17,
19
],
[
19,
20
],
[
20,
21
],
[
8,
22
],
[
22,
23
],
[
22,
24
],
[
8,
25
],
[
25,
26
],
[
26,
27
],
[
27,
28
],
[
27,
29
],
[
25,
30
],
[
30,
31
],
[
30,
32
],
[
25,
33
],
[
33,
34
],
[
34,
35
],
[
25,
36
],
[
37,
37
],
[
37,
38
],
[
38,
39
],
[
38,
40
],
[
40,
41
],
[
41,
42
],
[
37,
43
],
[
43,
44
],
[
43,
45
],
[
8,
46
],
[
46,
47
],
[
47,
48
],
[
48,
49
],
[
48,
50
],
[
47,
51
],
[
46,
52
],
[
52,
53
],
[
53,
54
],
[
54,
55
],
[
55,
56
],
[
55,
57
],
[
53,
58
],
[
58,
59
],
[
46,
60
],
[
60,
61
],
[
61,
62
],
[
62,
63
],
[
63,
64
],
[
63,
65
],
[
61,
66
],
[
66,
67
],
[
66,
68
],
[
6,
69
],
[
69,
70
],
[
0,
71
],
[
71,
72
],
[
71,
73
]
] |
[
"import java.util.*;\n\npublic class Main{\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n int days = sc.nextInt();\n int work = sc.nextInt();\n int sum = 0;\n for(int i = 0; i < work; i++){\n int j = sc.nextInt();\n sum += j;\n }\n if(days - sum < 0){\n System.out.println(-1);\n } else {\n System.out.println(days - sum);\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 days = sc.nextInt();\n int work = sc.nextInt();\n int sum = 0;\n for(int i = 0; i < work; i++){\n int j = sc.nextInt();\n sum += j;\n }\n if(days - sum < 0){\n System.out.println(-1);\n } else {\n System.out.println(days - sum);\n }\n }\n}",
"Main",
"public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n int days = sc.nextInt();\n int work = sc.nextInt();\n int sum = 0;\n for(int i = 0; i < work; i++){\n int j = sc.nextInt();\n sum += j;\n }\n if(days - sum < 0){\n System.out.println(-1);\n } else {\n System.out.println(days - sum);\n }\n }",
"main",
"{\n Scanner sc = new Scanner(System.in);\n int days = sc.nextInt();\n int work = sc.nextInt();\n int sum = 0;\n for(int i = 0; i < work; i++){\n int j = sc.nextInt();\n sum += j;\n }\n if(days - sum < 0){\n System.out.println(-1);\n } else {\n System.out.println(days - sum);\n }\n }",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"int days = sc.nextInt();",
"days",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int work = sc.nextInt();",
"work",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int sum = 0;",
"sum",
"0",
"for(int i = 0; i < work; i++){\n int j = sc.nextInt();\n sum += j;\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < work",
"i",
"work",
"i++",
"i++",
"i",
"{\n int j = sc.nextInt();\n sum += j;\n }",
"{\n int j = sc.nextInt();\n sum += j;\n }",
"int j = sc.nextInt();",
"j",
"sc.nextInt()",
"sc.nextInt",
"sc",
"sum += j",
"sum",
"j",
"if(days - sum < 0){\n System.out.println(-1);\n } else {\n System.out.println(days - sum);\n }",
"days - sum < 0",
"days - sum",
"days",
"sum",
"0",
"{\n System.out.println(-1);\n }",
"System.out.println(-1)",
"System.out.println",
"System.out",
"System",
"System.out",
"-1",
"1",
"{\n System.out.println(days - sum);\n }",
"System.out.println(days - sum)",
"System.out.println",
"System.out",
"System",
"System.out",
"days - sum",
"days",
"sum",
"String[] args",
"args",
"public class Main{\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n int days = sc.nextInt();\n int work = sc.nextInt();\n int sum = 0;\n for(int i = 0; i < work; i++){\n int j = sc.nextInt();\n sum += j;\n }\n if(days - sum < 0){\n System.out.println(-1);\n } else {\n System.out.println(days - sum);\n }\n }\n}",
"public class Main{\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n int days = sc.nextInt();\n int work = sc.nextInt();\n int sum = 0;\n for(int i = 0; i < work; i++){\n int j = sc.nextInt();\n sum += j;\n }\n if(days - sum < 0){\n System.out.println(-1);\n } else {\n System.out.println(days - sum);\n }\n }\n}",
"Main"
] |
import java.util.*;
public class Main{
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int days = sc.nextInt();
int work = sc.nextInt();
int sum = 0;
for(int i = 0; i < work; i++){
int j = sc.nextInt();
sum += j;
}
if(days - sum < 0){
System.out.println(-1);
} else {
System.out.println(days - sum);
}
}
}
|
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
41,
13,
4,
18,
13,
0,
13,
13,
14,
2,
13,
13,
30,
4,
18,
18,
13,
13,
40,
17,
30,
4,
18,
18,
13,
13,
2,
13,
13,
4,
18,
18,
13,
13,
4,
18,
13,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
78,
5
],
[
78,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
8,
17
],
[
17,
18
],
[
17,
19
],
[
19,
20
],
[
20,
21
],
[
8,
22
],
[
22,
23
],
[
22,
24
],
[
8,
25
],
[
25,
26
],
[
26,
27
],
[
27,
28
],
[
27,
29
],
[
25,
30
],
[
30,
31
],
[
30,
32
],
[
25,
33
],
[
33,
34
],
[
34,
35
],
[
25,
36
],
[
37,
37
],
[
37,
38
],
[
38,
39
],
[
38,
40
],
[
40,
41
],
[
41,
42
],
[
37,
43
],
[
43,
44
],
[
43,
45
],
[
8,
46
],
[
46,
47
],
[
47,
48
],
[
47,
49
],
[
46,
50
],
[
50,
51
],
[
51,
52
],
[
52,
53
],
[
53,
54
],
[
53,
55
],
[
51,
56
],
[
56,
57
],
[
46,
58
],
[
58,
59
],
[
59,
60
],
[
60,
61
],
[
61,
62
],
[
61,
63
],
[
59,
64
],
[
64,
65
],
[
64,
66
],
[
8,
67
],
[
67,
68
],
[
68,
69
],
[
69,
70
],
[
69,
71
],
[
8,
72
],
[
72,
73
],
[
73,
74
],
[
6,
75
],
[
75,
76
],
[
0,
77
],
[
77,
78
],
[
77,
79
]
] |
[
"import java.util.Scanner;\n\npublic class Main {\n\n\tpublic static void main(String[] args) {\n\t\t// TODO ่ชๅ็ๆใใใใกใฝใใใปในใฟใ\n\n\t\tScanner sc = new Scanner(System.in);\n\n\t\tint n = sc.nextInt();\n\t\tint m = sc.nextInt();\n\t\tint sum = 0;\n\n\t\t//ๅ
ฅๅใใmๅๆฐๅ็นฐใ่ฟใ\n\t\tfor(int i = 0;i < m;i++) {\n\t\t\tint a = sc.nextInt();\n\t\t\t\tsum += a;\n\t\t}\n\t\t//ๅ่จใๆฅๆฐใใๅคงใใใใฐ\n\t\tif(sum > n) {\n\t\t\tSystem.out.println(-1);\n\t\t}\n\t\telse {\n\t\t\tSystem.out.println(n-sum);\n\t\t}\n\t\tSystem.out.println();\n\t\tsc.close();\n\n\t}\n\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n\n\tpublic static void main(String[] args) {\n\t\t// TODO ่ชๅ็ๆใใใใกใฝใใใปในใฟใ\n\n\t\tScanner sc = new Scanner(System.in);\n\n\t\tint n = sc.nextInt();\n\t\tint m = sc.nextInt();\n\t\tint sum = 0;\n\n\t\t//ๅ
ฅๅใใmๅๆฐๅ็นฐใ่ฟใ\n\t\tfor(int i = 0;i < m;i++) {\n\t\t\tint a = sc.nextInt();\n\t\t\t\tsum += a;\n\t\t}\n\t\t//ๅ่จใๆฅๆฐใใๅคงใใใใฐ\n\t\tif(sum > n) {\n\t\t\tSystem.out.println(-1);\n\t\t}\n\t\telse {\n\t\t\tSystem.out.println(n-sum);\n\t\t}\n\t\tSystem.out.println();\n\t\tsc.close();\n\n\t}\n\n}",
"Main",
"public static void main(String[] args) {\n\t\t// TODO ่ชๅ็ๆใใใใกใฝใใใปในใฟใ\n\n\t\tScanner sc = new Scanner(System.in);\n\n\t\tint n = sc.nextInt();\n\t\tint m = sc.nextInt();\n\t\tint sum = 0;\n\n\t\t//ๅ
ฅๅใใmๅๆฐๅ็นฐใ่ฟใ\n\t\tfor(int i = 0;i < m;i++) {\n\t\t\tint a = sc.nextInt();\n\t\t\t\tsum += a;\n\t\t}\n\t\t//ๅ่จใๆฅๆฐใใๅคงใใใใฐ\n\t\tif(sum > n) {\n\t\t\tSystem.out.println(-1);\n\t\t}\n\t\telse {\n\t\t\tSystem.out.println(n-sum);\n\t\t}\n\t\tSystem.out.println();\n\t\tsc.close();\n\n\t}",
"main",
"{\n\t\t// TODO ่ชๅ็ๆใใใใกใฝใใใปในใฟใ\n\n\t\tScanner sc = new Scanner(System.in);\n\n\t\tint n = sc.nextInt();\n\t\tint m = sc.nextInt();\n\t\tint sum = 0;\n\n\t\t//ๅ
ฅๅใใmๅๆฐๅ็นฐใ่ฟใ\n\t\tfor(int i = 0;i < m;i++) {\n\t\t\tint a = sc.nextInt();\n\t\t\t\tsum += a;\n\t\t}\n\t\t//ๅ่จใๆฅๆฐใใๅคงใใใใฐ\n\t\tif(sum > n) {\n\t\t\tSystem.out.println(-1);\n\t\t}\n\t\telse {\n\t\t\tSystem.out.println(n-sum);\n\t\t}\n\t\tSystem.out.println();\n\t\tsc.close();\n\n\t}",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"int n = sc.nextInt();",
"n",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int m = sc.nextInt();",
"m",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int sum = 0;",
"sum",
"0",
"for(int i = 0;i < m;i++) {\n\t\t\tint a = sc.nextInt();\n\t\t\t\tsum += a;\n\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < m",
"i",
"m",
"i++",
"i++",
"i",
"{\n\t\t\tint a = sc.nextInt();\n\t\t\t\tsum += a;\n\t\t}",
"{\n\t\t\tint a = sc.nextInt();\n\t\t\t\tsum += a;\n\t\t}",
"int a = sc.nextInt();",
"a",
"sc.nextInt()",
"sc.nextInt",
"sc",
"sum += a",
"sum",
"a",
"if(sum > n) {\n\t\t\tSystem.out.println(-1);\n\t\t}\n\t\telse {\n\t\t\tSystem.out.println(n-sum);\n\t\t}",
"sum > n",
"sum",
"n",
"{\n\t\t\tSystem.out.println(-1);\n\t\t}",
"System.out.println(-1)",
"System.out.println",
"System.out",
"System",
"System.out",
"-1",
"1",
"{\n\t\t\tSystem.out.println(n-sum);\n\t\t}",
"System.out.println(n-sum)",
"System.out.println",
"System.out",
"System",
"System.out",
"n-sum",
"n",
"sum",
"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\t\t// TODO ่ชๅ็ๆใใใใกใฝใใใปในใฟใ\n\n\t\tScanner sc = new Scanner(System.in);\n\n\t\tint n = sc.nextInt();\n\t\tint m = sc.nextInt();\n\t\tint sum = 0;\n\n\t\t//ๅ
ฅๅใใmๅๆฐๅ็นฐใ่ฟใ\n\t\tfor(int i = 0;i < m;i++) {\n\t\t\tint a = sc.nextInt();\n\t\t\t\tsum += a;\n\t\t}\n\t\t//ๅ่จใๆฅๆฐใใๅคงใใใใฐ\n\t\tif(sum > n) {\n\t\t\tSystem.out.println(-1);\n\t\t}\n\t\telse {\n\t\t\tSystem.out.println(n-sum);\n\t\t}\n\t\tSystem.out.println();\n\t\tsc.close();\n\n\t}\n\n}",
"public class Main {\n\n\tpublic static void main(String[] args) {\n\t\t// TODO ่ชๅ็ๆใใใใกใฝใใใปในใฟใ\n\n\t\tScanner sc = new Scanner(System.in);\n\n\t\tint n = sc.nextInt();\n\t\tint m = sc.nextInt();\n\t\tint sum = 0;\n\n\t\t//ๅ
ฅๅใใmๅๆฐๅ็นฐใ่ฟใ\n\t\tfor(int i = 0;i < m;i++) {\n\t\t\tint a = sc.nextInt();\n\t\t\t\tsum += a;\n\t\t}\n\t\t//ๅ่จใๆฅๆฐใใๅคงใใใใฐ\n\t\tif(sum > n) {\n\t\t\tSystem.out.println(-1);\n\t\t}\n\t\telse {\n\t\t\tSystem.out.println(n-sum);\n\t\t}\n\t\tSystem.out.println();\n\t\tsc.close();\n\n\t}\n\n}",
"Main"
] |
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
// TODO ่ชๅ็ๆใใใใกใฝใใใปในใฟใ
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
int m = sc.nextInt();
int sum = 0;
//ๅ
ฅๅใใmๅๆฐๅ็นฐใ่ฟใ
for(int i = 0;i < m;i++) {
int a = sc.nextInt();
sum += a;
}
//ๅ่จใๆฅๆฐใใๅคงใใใใฐ
if(sum > n) {
System.out.println(-1);
}
else {
System.out.println(n-sum);
}
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,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
41,
13,
4,
18,
13,
0,
13,
13,
41,
13,
2,
13,
13,
14,
2,
13,
17,
30,
0,
13,
40,
17,
4,
18,
18,
13,
13,
13,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
69,
5
],
[
69,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
8,
17
],
[
17,
18
],
[
17,
19
],
[
19,
20
],
[
20,
21
],
[
8,
22
],
[
22,
23
],
[
22,
24
],
[
8,
25
],
[
25,
26
],
[
26,
27
],
[
27,
28
],
[
27,
29
],
[
25,
30
],
[
30,
31
],
[
30,
32
],
[
25,
33
],
[
33,
34
],
[
34,
35
],
[
25,
36
],
[
37,
37
],
[
37,
38
],
[
38,
39
],
[
38,
40
],
[
40,
41
],
[
41,
42
],
[
37,
43
],
[
43,
44
],
[
43,
45
],
[
8,
46
],
[
46,
47
],
[
46,
48
],
[
48,
49
],
[
48,
50
],
[
8,
51
],
[
51,
52
],
[
52,
53
],
[
52,
54
],
[
51,
55
],
[
55,
56
],
[
56,
57
],
[
56,
58
],
[
58,
59
],
[
8,
60
],
[
60,
61
],
[
61,
62
],
[
62,
63
],
[
62,
64
],
[
60,
65
],
[
6,
66
],
[
66,
67
],
[
0,
68
],
[
68,
69
],
[
68,
70
]
] |
[
"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 N = sc.nextInt();\n \t\tint M = sc.nextInt();\n \t\tint sum = 0;\n \t\tfor(int i = 0; i < M; i++){\n \t \tint A = sc.nextInt();\n \t \tsum += A;\n \t}\n \t\tint freeDays = N - sum;\n \t\tif(freeDays < 0){\n \t \tfreeDays = -1;\n \t}\n \t\tSystem.out.println(freeDays);\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 N = sc.nextInt();\n \t\tint M = sc.nextInt();\n \t\tint sum = 0;\n \t\tfor(int i = 0; i < M; i++){\n \t \tint A = sc.nextInt();\n \t \tsum += A;\n \t}\n \t\tint freeDays = N - sum;\n \t\tif(freeDays < 0){\n \t \tfreeDays = -1;\n \t}\n \t\tSystem.out.println(freeDays);\n }\n}",
"Main",
"public static void main(String[] args){\n \t\tScanner sc = new Scanner(System.in);\n \t\tint N = sc.nextInt();\n \t\tint M = sc.nextInt();\n \t\tint sum = 0;\n \t\tfor(int i = 0; i < M; i++){\n \t \tint A = sc.nextInt();\n \t \tsum += A;\n \t}\n \t\tint freeDays = N - sum;\n \t\tif(freeDays < 0){\n \t \tfreeDays = -1;\n \t}\n \t\tSystem.out.println(freeDays);\n }",
"main",
"{\n \t\tScanner sc = new Scanner(System.in);\n \t\tint N = sc.nextInt();\n \t\tint M = sc.nextInt();\n \t\tint sum = 0;\n \t\tfor(int i = 0; i < M; i++){\n \t \tint A = sc.nextInt();\n \t \tsum += A;\n \t}\n \t\tint freeDays = N - sum;\n \t\tif(freeDays < 0){\n \t \tfreeDays = -1;\n \t}\n \t\tSystem.out.println(freeDays);\n }",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"int N = sc.nextInt();",
"N",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int M = sc.nextInt();",
"M",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int sum = 0;",
"sum",
"0",
"for(int i = 0; i < M; i++){\n \t \tint A = sc.nextInt();\n \t \tsum += A;\n \t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < M",
"i",
"M",
"i++",
"i++",
"i",
"{\n \t \tint A = sc.nextInt();\n \t \tsum += A;\n \t}",
"{\n \t \tint A = sc.nextInt();\n \t \tsum += A;\n \t}",
"int A = sc.nextInt();",
"A",
"sc.nextInt()",
"sc.nextInt",
"sc",
"sum += A",
"sum",
"A",
"int freeDays = N - sum;",
"freeDays",
"N - sum",
"N",
"sum",
"if(freeDays < 0){\n \t \tfreeDays = -1;\n \t}",
"freeDays < 0",
"freeDays",
"0",
"{\n \t \tfreeDays = -1;\n \t}",
"freeDays = -1",
"freeDays",
"-1",
"1",
"System.out.println(freeDays)",
"System.out.println",
"System.out",
"System",
"System.out",
"freeDays",
"String[] args",
"args",
"public class Main{\n \tpublic static void main(String[] args){\n \t\tScanner sc = new Scanner(System.in);\n \t\tint N = sc.nextInt();\n \t\tint M = sc.nextInt();\n \t\tint sum = 0;\n \t\tfor(int i = 0; i < M; i++){\n \t \tint A = sc.nextInt();\n \t \tsum += A;\n \t}\n \t\tint freeDays = N - sum;\n \t\tif(freeDays < 0){\n \t \tfreeDays = -1;\n \t}\n \t\tSystem.out.println(freeDays);\n }\n}",
"public class Main{\n \tpublic static void main(String[] args){\n \t\tScanner sc = new Scanner(System.in);\n \t\tint N = sc.nextInt();\n \t\tint M = sc.nextInt();\n \t\tint sum = 0;\n \t\tfor(int i = 0; i < M; i++){\n \t \tint A = sc.nextInt();\n \t \tsum += A;\n \t}\n \t\tint freeDays = N - sum;\n \t\tif(freeDays < 0){\n \t \tfreeDays = -1;\n \t}\n \t\tSystem.out.println(freeDays);\n }\n}",
"Main"
] |
import java.util.Scanner;
public class Main{
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
int N = sc.nextInt();
int M = sc.nextInt();
int sum = 0;
for(int i = 0; i < M; i++){
int A = sc.nextInt();
sum += A;
}
int freeDays = N - sum;
if(freeDays < 0){
freeDays = -1;
}
System.out.println(freeDays);
}
}
|
[
7,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
20,
41,
13,
20,
41,
13,
4,
18,
13,
4,
18,
13,
41,
13,
4,
18,
13,
4,
18,
13,
0,
13,
20,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
4,
18,
13,
4,
18,
13,
14,
2,
13,
17,
0,
13,
40,
17,
4,
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
],
[
79,
8
],
[
79,
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
],
[
23,
26
],
[
26,
27
],
[
27,
28
],
[
11,
29
],
[
29,
30
],
[
29,
31
],
[
31,
32
],
[
32,
33
],
[
31,
34
],
[
34,
35
],
[
35,
36
],
[
11,
37
],
[
37,
38
],
[
37,
39
],
[
11,
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
],
[
55,
58
],
[
58,
59
],
[
59,
60
],
[
11,
61
],
[
61,
62
],
[
62,
63
],
[
62,
64
],
[
61,
65
],
[
65,
66
],
[
65,
67
],
[
67,
68
],
[
11,
69
],
[
69,
70
],
[
70,
71
],
[
69,
72
],
[
11,
73
],
[
73,
74
],
[
74,
75
],
[
9,
76
],
[
76,
77
],
[
0,
78
],
[
78,
79
],
[
78,
80
]
] |
[
"import java.util.*;\nimport java.io.*;\n\npublic class Main {\n public static void main(String[] args) throws IOException{\n BufferedReader f = new BufferedReader(new InputStreamReader(System.in));\n PrintWriter out = new PrintWriter(new OutputStreamWriter(System.out));\n StringTokenizer st = new StringTokenizer(f.readLine());\n int n = Integer.parseInt(st.nextToken());\n int k = Integer.parseInt(st.nextToken());\n st = new StringTokenizer(f.readLine());\n for(int i = 0; i < k; i++){\n n-=Integer.parseInt(st.nextToken());\n }\n if(n < 0) n = -1;\n out.println(n);\n\n out.close();\n }\n}",
"import java.util.*;",
"util.*",
"java",
"import java.io.*;",
"io.*",
"java",
"public class Main {\n public static void main(String[] args) throws IOException{\n BufferedReader f = new BufferedReader(new InputStreamReader(System.in));\n PrintWriter out = new PrintWriter(new OutputStreamWriter(System.out));\n StringTokenizer st = new StringTokenizer(f.readLine());\n int n = Integer.parseInt(st.nextToken());\n int k = Integer.parseInt(st.nextToken());\n st = new StringTokenizer(f.readLine());\n for(int i = 0; i < k; i++){\n n-=Integer.parseInt(st.nextToken());\n }\n if(n < 0) n = -1;\n out.println(n);\n\n out.close();\n }\n}",
"Main",
"public static void main(String[] args) throws IOException{\n BufferedReader f = new BufferedReader(new InputStreamReader(System.in));\n PrintWriter out = new PrintWriter(new OutputStreamWriter(System.out));\n StringTokenizer st = new StringTokenizer(f.readLine());\n int n = Integer.parseInt(st.nextToken());\n int k = Integer.parseInt(st.nextToken());\n st = new StringTokenizer(f.readLine());\n for(int i = 0; i < k; i++){\n n-=Integer.parseInt(st.nextToken());\n }\n if(n < 0) n = -1;\n out.println(n);\n\n out.close();\n }",
"main",
"{\n BufferedReader f = new BufferedReader(new InputStreamReader(System.in));\n PrintWriter out = new PrintWriter(new OutputStreamWriter(System.out));\n StringTokenizer st = new StringTokenizer(f.readLine());\n int n = Integer.parseInt(st.nextToken());\n int k = Integer.parseInt(st.nextToken());\n st = new StringTokenizer(f.readLine());\n for(int i = 0; i < k; i++){\n n-=Integer.parseInt(st.nextToken());\n }\n if(n < 0) n = -1;\n out.println(n);\n\n out.close();\n }",
"BufferedReader f = new BufferedReader(new InputStreamReader(System.in));",
"f",
"new BufferedReader(new InputStreamReader(System.in))",
"PrintWriter out = new PrintWriter(new OutputStreamWriter(System.out));",
"out",
"new PrintWriter(new OutputStreamWriter(System.out))",
"StringTokenizer st = new StringTokenizer(f.readLine());",
"st",
"new StringTokenizer(f.readLine())",
"int n = Integer.parseInt(st.nextToken());",
"n",
"Integer.parseInt(st.nextToken())",
"Integer.parseInt",
"Integer",
"st.nextToken()",
"st.nextToken",
"st",
"int k = Integer.parseInt(st.nextToken());",
"k",
"Integer.parseInt(st.nextToken())",
"Integer.parseInt",
"Integer",
"st.nextToken()",
"st.nextToken",
"st",
"st = new StringTokenizer(f.readLine())",
"st",
"new StringTokenizer(f.readLine())",
"for(int i = 0; i < k; i++){\n n-=Integer.parseInt(st.nextToken());\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < k",
"i",
"k",
"i++",
"i++",
"i",
"{\n n-=Integer.parseInt(st.nextToken());\n }",
"{\n n-=Integer.parseInt(st.nextToken());\n }",
"n-=Integer.parseInt(st.nextToken())",
"n",
"Integer.parseInt(st.nextToken())",
"Integer.parseInt",
"Integer",
"st.nextToken()",
"st.nextToken",
"st",
"if(n < 0) n = -1;",
"n < 0",
"n",
"0",
"n = -1",
"n",
"-1",
"1",
"out.println(n)",
"out.println",
"out",
"n",
"out.close()",
"out.close",
"out",
"String[] args",
"args",
"public class Main {\n public static void main(String[] args) throws IOException{\n BufferedReader f = new BufferedReader(new InputStreamReader(System.in));\n PrintWriter out = new PrintWriter(new OutputStreamWriter(System.out));\n StringTokenizer st = new StringTokenizer(f.readLine());\n int n = Integer.parseInt(st.nextToken());\n int k = Integer.parseInt(st.nextToken());\n st = new StringTokenizer(f.readLine());\n for(int i = 0; i < k; i++){\n n-=Integer.parseInt(st.nextToken());\n }\n if(n < 0) n = -1;\n out.println(n);\n\n out.close();\n }\n}",
"public class Main {\n public static void main(String[] args) throws IOException{\n BufferedReader f = new BufferedReader(new InputStreamReader(System.in));\n PrintWriter out = new PrintWriter(new OutputStreamWriter(System.out));\n StringTokenizer st = new StringTokenizer(f.readLine());\n int n = Integer.parseInt(st.nextToken());\n int k = Integer.parseInt(st.nextToken());\n st = new StringTokenizer(f.readLine());\n for(int i = 0; i < k; i++){\n n-=Integer.parseInt(st.nextToken());\n }\n if(n < 0) n = -1;\n out.println(n);\n\n out.close();\n }\n}",
"Main"
] |
import java.util.*;
import java.io.*;
public class Main {
public static void main(String[] args) throws IOException{
BufferedReader f = new BufferedReader(new InputStreamReader(System.in));
PrintWriter out = new PrintWriter(new OutputStreamWriter(System.out));
StringTokenizer st = new StringTokenizer(f.readLine());
int n = Integer.parseInt(st.nextToken());
int k = Integer.parseInt(st.nextToken());
st = new StringTokenizer(f.readLine());
for(int i = 0; i < k; i++){
n-=Integer.parseInt(st.nextToken());
}
if(n < 0) n = -1;
out.println(n);
out.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,
41,
13,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
18,
13,
13,
4,
18,
13,
0,
13,
18,
13,
13,
14,
2,
13,
17,
30,
4,
18,
18,
13,
13,
40,
17,
30,
4,
18,
18,
13,
13,
13,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
76,
5
],
[
76,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
8,
17
],
[
17,
18
],
[
17,
19
],
[
19,
20
],
[
20,
21
],
[
8,
22
],
[
22,
23
],
[
22,
24
],
[
8,
26
],
[
26,
27
],
[
26,
28
],
[
8,
29
],
[
29,
30
],
[
30,
31
],
[
31,
32
],
[
31,
33
],
[
29,
34
],
[
34,
35
],
[
34,
36
],
[
29,
37
],
[
37,
38
],
[
38,
39
],
[
29,
40
],
[
41,
41
],
[
41,
42
],
[
42,
43
],
[
43,
44
],
[
43,
45
],
[
42,
46
],
[
46,
47
],
[
47,
48
],
[
41,
49
],
[
49,
50
],
[
49,
51
],
[
51,
52
],
[
51,
53
],
[
8,
54
],
[
54,
55
],
[
55,
56
],
[
55,
57
],
[
54,
58
],
[
58,
59
],
[
59,
60
],
[
60,
61
],
[
61,
62
],
[
61,
63
],
[
59,
64
],
[
64,
65
],
[
54,
66
],
[
66,
67
],
[
67,
68
],
[
68,
69
],
[
69,
70
],
[
69,
71
],
[
67,
72
],
[
6,
73
],
[
73,
74
],
[
0,
75
],
[
75,
76
],
[
75,
77
]
] |
[
"import java.util.Scanner;\n\n/**\n * Main\n */\npublic class Main {\n\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n\n int N = sc.nextInt();\n int M = sc.nextInt();\n int[] A = new int[M];\n\n int rest = N;\n for(int i = 0; i < M; i++){\n A[i] = sc.nextInt();\n rest -= A[i];\n }\n\n if(rest < 0){\n System.out.println(-1);\n }else{\n System.out.println(rest);\n }\n }\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n\n int N = sc.nextInt();\n int M = sc.nextInt();\n int[] A = new int[M];\n\n int rest = N;\n for(int i = 0; i < M; i++){\n A[i] = sc.nextInt();\n rest -= A[i];\n }\n\n if(rest < 0){\n System.out.println(-1);\n }else{\n System.out.println(rest);\n }\n }\n}",
"Main",
"public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n\n int N = sc.nextInt();\n int M = sc.nextInt();\n int[] A = new int[M];\n\n int rest = N;\n for(int i = 0; i < M; i++){\n A[i] = sc.nextInt();\n rest -= A[i];\n }\n\n if(rest < 0){\n System.out.println(-1);\n }else{\n System.out.println(rest);\n }\n }",
"main",
"{\n Scanner sc = new Scanner(System.in);\n\n int N = sc.nextInt();\n int M = sc.nextInt();\n int[] A = new int[M];\n\n int rest = N;\n for(int i = 0; i < M; i++){\n A[i] = sc.nextInt();\n rest -= A[i];\n }\n\n if(rest < 0){\n System.out.println(-1);\n }else{\n System.out.println(rest);\n }\n }",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"int N = sc.nextInt();",
"N",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int M = sc.nextInt();",
"M",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int[] A = new int[M];",
"A",
"new int[M]",
"M",
"int rest = N;",
"rest",
"N",
"for(int i = 0; i < M; i++){\n A[i] = sc.nextInt();\n rest -= A[i];\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < M",
"i",
"M",
"i++",
"i++",
"i",
"{\n A[i] = sc.nextInt();\n rest -= A[i];\n }",
"{\n A[i] = sc.nextInt();\n rest -= A[i];\n }",
"A[i] = sc.nextInt()",
"A[i]",
"A",
"i",
"sc.nextInt()",
"sc.nextInt",
"sc",
"rest -= A[i]",
"rest",
"A[i]",
"A",
"i",
"if(rest < 0){\n System.out.println(-1);\n }else{\n System.out.println(rest);\n }",
"rest < 0",
"rest",
"0",
"{\n System.out.println(-1);\n }",
"System.out.println(-1)",
"System.out.println",
"System.out",
"System",
"System.out",
"-1",
"1",
"{\n System.out.println(rest);\n }",
"System.out.println(rest)",
"System.out.println",
"System.out",
"System",
"System.out",
"rest",
"String[] args",
"args",
"public class Main {\n\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n\n int N = sc.nextInt();\n int M = sc.nextInt();\n int[] A = new int[M];\n\n int rest = N;\n for(int i = 0; i < M; i++){\n A[i] = sc.nextInt();\n rest -= A[i];\n }\n\n if(rest < 0){\n System.out.println(-1);\n }else{\n System.out.println(rest);\n }\n }\n}",
"public class Main {\n\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n\n int N = sc.nextInt();\n int M = sc.nextInt();\n int[] A = new int[M];\n\n int rest = N;\n for(int i = 0; i < M; i++){\n A[i] = sc.nextInt();\n rest -= A[i];\n }\n\n if(rest < 0){\n System.out.println(-1);\n }else{\n System.out.println(rest);\n }\n }\n}",
"Main"
] |
import java.util.Scanner;
/**
* Main
*/
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int N = sc.nextInt();
int M = sc.nextInt();
int[] A = new int[M];
int rest = N;
for(int i = 0; i < M; i++){
A[i] = sc.nextInt();
rest -= A[i];
}
if(rest < 0){
System.out.println(-1);
}else{
System.out.println(rest);
}
}
}
|
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
41,
13,
17,
41,
13,
17,
12,
13,
30,
14,
2,
13,
17,
29,
13,
29,
4,
13,
2,
13,
13,
13,
23,
13,
23,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
41,
13,
20,
13,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
18,
13,
13,
4,
18,
13,
0,
13,
18,
13,
13,
14,
2,
13,
13,
4,
18,
18,
13,
13,
40,
17,
30,
4,
18,
18,
13,
13,
2,
13,
13,
23,
13,
6,
13,
41,
13,
41,
13,
12,
13,
30,
0,
13,
20,
12,
13,
30,
42,
2,
2,
13,
17,
40,
4,
18,
13,
30,
38,
5,
13,
30,
4,
18,
13,
30,
0,
13,
20,
29,
4,
18,
13,
12,
13,
30,
29,
4,
18,
13,
4,
13,
12,
13,
30,
29,
4,
18,
13,
4,
13,
12,
13,
30,
29,
4,
18,
13,
4,
13,
12,
13,
30,
41,
13,
17,
38,
5,
13,
30,
4,
18,
13,
30,
0,
13,
4,
18,
13,
29,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
10,
11
],
[
10,
12
],
[
0,
13
],
[
13,
14
],
[
13,
15
],
[
0,
16
],
[
203,
17
],
[
203,
18
],
[
18,
19
],
[
18,
20
],
[
203,
21
],
[
21,
22
],
[
21,
23
],
[
203,
24
],
[
24,
25
],
[
24,
26
],
[
26,
27
],
[
27,
28
],
[
28,
29
],
[
28,
30
],
[
27,
31
],
[
31,
32
],
[
26,
33
],
[
33,
34
],
[
34,
35
],
[
34,
36
],
[
36,
37
],
[
36,
38
],
[
34,
39
],
[
24,
40
],
[
40,
41
],
[
24,
42
],
[
42,
43
],
[
203,
44
],
[
44,
45
],
[
44,
46
],
[
46,
47
],
[
47,
48
],
[
47,
49
],
[
46,
50
],
[
50,
51
],
[
50,
52
],
[
52,
53
],
[
53,
54
],
[
46,
55
],
[
55,
56
],
[
55,
57
],
[
57,
58
],
[
58,
59
],
[
46,
60
],
[
60,
61
],
[
60,
62
],
[
46,
64
],
[
64,
65
],
[
64,
66
],
[
46,
67
],
[
67,
68
],
[
68,
69
],
[
69,
70
],
[
69,
71
],
[
67,
72
],
[
72,
73
],
[
72,
74
],
[
67,
75
],
[
75,
76
],
[
76,
77
],
[
67,
78
],
[
79,
79
],
[
79,
80
],
[
80,
81
],
[
81,
82
],
[
81,
83
],
[
80,
84
],
[
84,
85
],
[
85,
86
],
[
79,
87
],
[
87,
88
],
[
87,
89
],
[
89,
90
],
[
89,
91
],
[
46,
92
],
[
92,
93
],
[
93,
94
],
[
93,
95
],
[
92,
96
],
[
96,
97
],
[
97,
98
],
[
98,
99
],
[
98,
100
],
[
96,
101
],
[
101,
102
],
[
92,
103
],
[
103,
104
],
[
104,
105
],
[
105,
106
],
[
106,
107
],
[
106,
108
],
[
104,
109
],
[
109,
110
],
[
109,
111
],
[
44,
112
],
[
112,
113
],
[
203,
114
],
[
114,
115
],
[
114,
116
],
[
116,
117
],
[
114,
118
],
[
118,
119
],
[
114,
120
],
[
120,
121
],
[
120,
122
],
[
122,
123
],
[
123,
124
],
[
123,
125
],
[
114,
126
],
[
126,
127
],
[
126,
128
],
[
128,
129
],
[
129,
130
],
[
130,
131
],
[
131,
132
],
[
131,
133
],
[
130,
134
],
[
134,
135
],
[
135,
136
],
[
136,
137
],
[
129,
138
],
[
138,
139
],
[
139,
140
],
[
140,
141
],
[
140,
142
],
[
142,
143
],
[
143,
144
],
[
144,
145
],
[
139,
146
],
[
146,
147
],
[
147,
148
],
[
147,
149
],
[
128,
150
],
[
150,
151
],
[
151,
152
],
[
152,
153
],
[
114,
154
],
[
154,
155
],
[
154,
156
],
[
156,
157
],
[
157,
158
],
[
158,
159
],
[
159,
160
],
[
158,
161
],
[
161,
162
],
[
114,
163
],
[
163,
164
],
[
163,
165
],
[
165,
166
],
[
166,
167
],
[
167,
168
],
[
168,
169
],
[
167,
170
],
[
170,
171
],
[
114,
172
],
[
172,
173
],
[
172,
174
],
[
174,
175
],
[
175,
176
],
[
176,
177
],
[
177,
178
],
[
176,
179
],
[
179,
180
],
[
114,
181
],
[
181,
182
],
[
181,
183
],
[
183,
184
],
[
184,
185
],
[
184,
186
],
[
183,
187
],
[
187,
188
],
[
188,
189
],
[
188,
190
],
[
190,
191
],
[
191,
192
],
[
192,
193
],
[
187,
194
],
[
194,
195
],
[
195,
196
],
[
195,
197
],
[
197,
198
],
[
198,
199
],
[
183,
200
],
[
200,
201
],
[
0,
202
],
[
202,
203
],
[
202,
204
]
] |
[
"\nimport java.io.*;\n\nimport java.math.BigInteger;\nimport java.util.*;\n\nimport java.util.ArrayList;\n\nimport java.util.Scanner;\n\n\npublic class Main {\n\n static class FastReader {\n BufferedReader br;\n StringTokenizer st;\n\n public FastReader() {\n br = new BufferedReader(new\n InputStreamReader(System.in));\n }\n\n String next() {\n while (st == null || !st.hasMoreElements()) {\n try {\n st = new StringTokenizer(br.readLine());\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n return st.nextToken();\n }\n\n int nextInt() {\n return Integer.parseInt(next());\n }\n\n long nextLong() {\n return Long.parseLong(next());\n }\n\n double nextDouble() {\n return Double.parseDouble(next());\n }\n\n String nextLine() {\n String str = \"\";\n try {\n str = br.readLine();\n } catch (IOException e) {\n e.printStackTrace();\n }\n return str;\n }\n }\n\n static final int mod = 1000000007;\n static final int mod1=1073741824;\n\n public static int gcd(int a, int b) {\n if (a == 0)\n return b;\n return gcd(b % a, a);\n }\n public static void main(String[] args)\n {\n Scanner sc = new Scanner(System.in);\n int n=sc.nextInt();\n int m=sc.nextInt();\n int a[]=new int[m];\n int s=0;\n\n for(int j=0;j<m;j++)\n {\n a[j]=sc.nextInt();\n s+=a[j];\n }\n if(s>n)\n System.out.println(-1);\n else\n {\n System.out.println(n-s);\n }\n\n\n\n }\n\n}\n\n\n\n\n\n\n\n",
"import java.io.*;",
"io.*",
"java",
"import java.math.BigInteger;",
"BigInteger",
"java.math",
"import java.util.*;",
"util.*",
"java",
"import java.util.ArrayList;",
"ArrayList",
"java.util",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n\n static class FastReader {\n BufferedReader br;\n StringTokenizer st;\n\n public FastReader() {\n br = new BufferedReader(new\n InputStreamReader(System.in));\n }\n\n String next() {\n while (st == null || !st.hasMoreElements()) {\n try {\n st = new StringTokenizer(br.readLine());\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n return st.nextToken();\n }\n\n int nextInt() {\n return Integer.parseInt(next());\n }\n\n long nextLong() {\n return Long.parseLong(next());\n }\n\n double nextDouble() {\n return Double.parseDouble(next());\n }\n\n String nextLine() {\n String str = \"\";\n try {\n str = br.readLine();\n } catch (IOException e) {\n e.printStackTrace();\n }\n return str;\n }\n }\n\n static final int mod = 1000000007;\n static final int mod1=1073741824;\n\n public static int gcd(int a, int b) {\n if (a == 0)\n return b;\n return gcd(b % a, a);\n }\n public static void main(String[] args)\n {\n Scanner sc = new Scanner(System.in);\n int n=sc.nextInt();\n int m=sc.nextInt();\n int a[]=new int[m];\n int s=0;\n\n for(int j=0;j<m;j++)\n {\n a[j]=sc.nextInt();\n s+=a[j];\n }\n if(s>n)\n System.out.println(-1);\n else\n {\n System.out.println(n-s);\n }\n\n\n\n }\n\n}",
"Main",
"static final int mod = 1000000007;",
"mod",
"1000000007",
"static final int mod1=1073741824;",
"mod1",
"1073741824",
"public static int gcd(int a, int b) {\n if (a == 0)\n return b;\n return gcd(b % a, a);\n }",
"gcd",
"{\n if (a == 0)\n return b;\n return gcd(b % a, a);\n }",
"if (a == 0)\n return b;",
"a == 0",
"a",
"0",
"return b;",
"b",
"return gcd(b % a, a);",
"gcd(b % a, a)",
"gcd",
"b % a",
"b",
"a",
"a",
"int a",
"a",
"int b",
"b",
"public static void main(String[] args)\n {\n Scanner sc = new Scanner(System.in);\n int n=sc.nextInt();\n int m=sc.nextInt();\n int a[]=new int[m];\n int s=0;\n\n for(int j=0;j<m;j++)\n {\n a[j]=sc.nextInt();\n s+=a[j];\n }\n if(s>n)\n System.out.println(-1);\n else\n {\n System.out.println(n-s);\n }\n\n\n\n }",
"main",
"{\n Scanner sc = new Scanner(System.in);\n int n=sc.nextInt();\n int m=sc.nextInt();\n int a[]=new int[m];\n int s=0;\n\n for(int j=0;j<m;j++)\n {\n a[j]=sc.nextInt();\n s+=a[j];\n }\n if(s>n)\n System.out.println(-1);\n else\n {\n System.out.println(n-s);\n }\n\n\n\n }",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"int n=sc.nextInt();",
"n",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int m=sc.nextInt();",
"m",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int a[]=new int[m];",
"a",
"new int[m]",
"m",
"int s=0;",
"s",
"0",
"for(int j=0;j<m;j++)\n {\n a[j]=sc.nextInt();\n s+=a[j];\n }",
"int j=0;",
"int j=0;",
"j",
"0",
"j<m",
"j",
"m",
"j++",
"j++",
"j",
"{\n a[j]=sc.nextInt();\n s+=a[j];\n }",
"{\n a[j]=sc.nextInt();\n s+=a[j];\n }",
"a[j]=sc.nextInt()",
"a[j]",
"a",
"j",
"sc.nextInt()",
"sc.nextInt",
"sc",
"s+=a[j]",
"s",
"a[j]",
"a",
"j",
"if(s>n)\n System.out.println(-1);\n else\n {\n System.out.println(n-s);\n }",
"s>n",
"s",
"n",
"System.out.println(-1)",
"System.out.println",
"System.out",
"System",
"System.out",
"-1",
"1",
"{\n System.out.println(n-s);\n }",
"System.out.println(n-s)",
"System.out.println",
"System.out",
"System",
"System.out",
"n-s",
"n",
"s",
"String[] args",
"args",
"static class FastReader {\n BufferedReader br;\n StringTokenizer st;\n\n public FastReader() {\n br = new BufferedReader(new\n InputStreamReader(System.in));\n }\n\n String next() {\n while (st == null || !st.hasMoreElements()) {\n try {\n st = new StringTokenizer(br.readLine());\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n return st.nextToken();\n }\n\n int nextInt() {\n return Integer.parseInt(next());\n }\n\n long nextLong() {\n return Long.parseLong(next());\n }\n\n double nextDouble() {\n return Double.parseDouble(next());\n }\n\n String nextLine() {\n String str = \"\";\n try {\n str = br.readLine();\n } catch (IOException e) {\n e.printStackTrace();\n }\n return str;\n }\n }",
"FastReader",
"BufferedReader br;",
"br",
"StringTokenizer st;",
"st",
"public FastReader() {\n br = new BufferedReader(new\n InputStreamReader(System.in));\n }",
"FastReader",
"{\n br = new BufferedReader(new\n InputStreamReader(System.in));\n }",
"br = new BufferedReader(new\n InputStreamReader(System.in))",
"br",
"new BufferedReader(new\n InputStreamReader(System.in))",
"String next() {\n while (st == null || !st.hasMoreElements()) {\n try {\n st = new StringTokenizer(br.readLine());\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n return st.nextToken();\n }",
"next",
"{\n while (st == null || !st.hasMoreElements()) {\n try {\n st = new StringTokenizer(br.readLine());\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n return st.nextToken();\n }",
"while (st == null || !st.hasMoreElements()) {\n try {\n st = new StringTokenizer(br.readLine());\n } catch (IOException e) {\n e.printStackTrace();\n }\n }",
"st == null || !st.hasMoreElements()",
"st == null",
"st",
"null",
"!st.hasMoreElements()",
"st.hasMoreElements()",
"st.hasMoreElements",
"st",
"{\n try {\n st = new StringTokenizer(br.readLine());\n } catch (IOException e) {\n e.printStackTrace();\n }\n }",
"try {\n st = new StringTokenizer(br.readLine());\n } catch (IOException e) {\n e.printStackTrace();\n }",
"catch (IOException e) {\n e.printStackTrace();\n }",
"IOException e",
"{\n e.printStackTrace();\n }",
"e.printStackTrace()",
"e.printStackTrace",
"e",
"{\n st = new StringTokenizer(br.readLine());\n }",
"st = new StringTokenizer(br.readLine())",
"st",
"new StringTokenizer(br.readLine())",
"return st.nextToken();",
"st.nextToken()",
"st.nextToken",
"st",
"int nextInt() {\n return Integer.parseInt(next());\n }",
"nextInt",
"{\n return Integer.parseInt(next());\n }",
"return Integer.parseInt(next());",
"Integer.parseInt(next())",
"Integer.parseInt",
"Integer",
"next()",
"next",
"long nextLong() {\n return Long.parseLong(next());\n }",
"nextLong",
"{\n return Long.parseLong(next());\n }",
"return Long.parseLong(next());",
"Long.parseLong(next())",
"Long.parseLong",
"Long",
"next()",
"next",
"double nextDouble() {\n return Double.parseDouble(next());\n }",
"nextDouble",
"{\n return Double.parseDouble(next());\n }",
"return Double.parseDouble(next());",
"Double.parseDouble(next())",
"Double.parseDouble",
"Double",
"next()",
"next",
"String nextLine() {\n String str = \"\";\n try {\n str = br.readLine();\n } catch (IOException e) {\n e.printStackTrace();\n }\n return str;\n }",
"nextLine",
"{\n String str = \"\";\n try {\n str = br.readLine();\n } catch (IOException e) {\n e.printStackTrace();\n }\n return str;\n }",
"String str = \"\";",
"str",
"\"\"",
"try {\n str = br.readLine();\n } catch (IOException e) {\n e.printStackTrace();\n }",
"catch (IOException e) {\n e.printStackTrace();\n }",
"IOException e",
"{\n e.printStackTrace();\n }",
"e.printStackTrace()",
"e.printStackTrace",
"e",
"{\n str = br.readLine();\n }",
"str = br.readLine()",
"str",
"br.readLine()",
"br.readLine",
"br",
"return str;",
"str",
"public class Main {\n\n static class FastReader {\n BufferedReader br;\n StringTokenizer st;\n\n public FastReader() {\n br = new BufferedReader(new\n InputStreamReader(System.in));\n }\n\n String next() {\n while (st == null || !st.hasMoreElements()) {\n try {\n st = new StringTokenizer(br.readLine());\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n return st.nextToken();\n }\n\n int nextInt() {\n return Integer.parseInt(next());\n }\n\n long nextLong() {\n return Long.parseLong(next());\n }\n\n double nextDouble() {\n return Double.parseDouble(next());\n }\n\n String nextLine() {\n String str = \"\";\n try {\n str = br.readLine();\n } catch (IOException e) {\n e.printStackTrace();\n }\n return str;\n }\n }\n\n static final int mod = 1000000007;\n static final int mod1=1073741824;\n\n public static int gcd(int a, int b) {\n if (a == 0)\n return b;\n return gcd(b % a, a);\n }\n public static void main(String[] args)\n {\n Scanner sc = new Scanner(System.in);\n int n=sc.nextInt();\n int m=sc.nextInt();\n int a[]=new int[m];\n int s=0;\n\n for(int j=0;j<m;j++)\n {\n a[j]=sc.nextInt();\n s+=a[j];\n }\n if(s>n)\n System.out.println(-1);\n else\n {\n System.out.println(n-s);\n }\n\n\n\n }\n\n}",
"public class Main {\n\n static class FastReader {\n BufferedReader br;\n StringTokenizer st;\n\n public FastReader() {\n br = new BufferedReader(new\n InputStreamReader(System.in));\n }\n\n String next() {\n while (st == null || !st.hasMoreElements()) {\n try {\n st = new StringTokenizer(br.readLine());\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n return st.nextToken();\n }\n\n int nextInt() {\n return Integer.parseInt(next());\n }\n\n long nextLong() {\n return Long.parseLong(next());\n }\n\n double nextDouble() {\n return Double.parseDouble(next());\n }\n\n String nextLine() {\n String str = \"\";\n try {\n str = br.readLine();\n } catch (IOException e) {\n e.printStackTrace();\n }\n return str;\n }\n }\n\n static final int mod = 1000000007;\n static final int mod1=1073741824;\n\n public static int gcd(int a, int b) {\n if (a == 0)\n return b;\n return gcd(b % a, a);\n }\n public static void main(String[] args)\n {\n Scanner sc = new Scanner(System.in);\n int n=sc.nextInt();\n int m=sc.nextInt();\n int a[]=new int[m];\n int s=0;\n\n for(int j=0;j<m;j++)\n {\n a[j]=sc.nextInt();\n s+=a[j];\n }\n if(s>n)\n System.out.println(-1);\n else\n {\n System.out.println(n-s);\n }\n\n\n\n }\n\n}",
"Main"
] |
import java.io.*;
import java.math.BigInteger;
import java.util.*;
import java.util.ArrayList;
import java.util.Scanner;
public class Main {
static class FastReader {
BufferedReader br;
StringTokenizer st;
public FastReader() {
br = new BufferedReader(new
InputStreamReader(System.in));
}
String next() {
while (st == null || !st.hasMoreElements()) {
try {
st = new StringTokenizer(br.readLine());
} catch (IOException e) {
e.printStackTrace();
}
}
return st.nextToken();
}
int nextInt() {
return Integer.parseInt(next());
}
long nextLong() {
return Long.parseLong(next());
}
double nextDouble() {
return Double.parseDouble(next());
}
String nextLine() {
String str = "";
try {
str = br.readLine();
} catch (IOException e) {
e.printStackTrace();
}
return str;
}
}
static final int mod = 1000000007;
static final int mod1=1073741824;
public static int gcd(int a, int b) {
if (a == 0)
return b;
return gcd(b % a, a);
}
public static void main(String[] args)
{
Scanner sc = new Scanner(System.in);
int n=sc.nextInt();
int m=sc.nextInt();
int a[]=new int[m];
int s=0;
for(int j=0;j<m;j++)
{
a[j]=sc.nextInt();
s+=a[j];
}
if(s>n)
System.out.println(-1);
else
{
System.out.println(n-s);
}
}
}
|
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
41,
13,
17,
41,
13,
20,
13,
11,
1,
41,
13,
17,
2,
13,
18,
13,
13,
1,
40,
13,
30,
30,
0,
18,
13,
13,
4,
18,
13,
11,
1,
41,
13,
17,
2,
13,
18,
13,
13,
1,
40,
13,
30,
30,
0,
13,
18,
13,
13,
41,
13,
0,
13,
2,
13,
13,
14,
2,
13,
17,
30,
4,
18,
18,
13,
13,
13,
30,
4,
18,
18,
13,
13,
40,
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,
29
],
[
29,
30
],
[
30,
31
],
[
31,
32
],
[
31,
33
],
[
29,
34
],
[
34,
35
],
[
34,
36
],
[
36,
37
],
[
36,
38
],
[
29,
39
],
[
39,
40
],
[
40,
41
],
[
29,
42
],
[
43,
43
],
[
43,
44
],
[
44,
45
],
[
45,
46
],
[
45,
47
],
[
44,
48
],
[
48,
49
],
[
49,
50
],
[
8,
51
],
[
51,
52
],
[
52,
53
],
[
53,
54
],
[
53,
55
],
[
51,
56
],
[
56,
57
],
[
56,
58
],
[
58,
59
],
[
58,
60
],
[
51,
61
],
[
61,
62
],
[
62,
63
],
[
51,
64
],
[
65,
65
],
[
65,
66
],
[
66,
67
],
[
66,
68
],
[
68,
69
],
[
68,
70
],
[
8,
71
],
[
71,
72
],
[
8,
73
],
[
73,
74
],
[
73,
75
],
[
75,
76
],
[
75,
77
],
[
8,
78
],
[
78,
79
],
[
79,
80
],
[
79,
81
],
[
78,
82
],
[
82,
83
],
[
83,
84
],
[
84,
85
],
[
85,
86
],
[
85,
87
],
[
83,
88
],
[
78,
89
],
[
89,
90
],
[
90,
91
],
[
91,
92
],
[
92,
93
],
[
92,
94
],
[
90,
95
],
[
95,
96
],
[
6,
97
],
[
97,
98
]
] |
[
"import java.util.Scanner;\nclass Main{\n public static void main(String args[]){\n Scanner scan = new Scanner(System.in);\n int day = scan.nextInt();\n int homework = scan.nextInt();\n int sum = 0;\n int suji[] = new int[homework];\n for(int j = 0; j < suji.length; j++){\n suji[j] = scan.nextInt();\n }\n for(int i = 0; i < suji.length; i++){\n sum += suji[i];\n }\n int canPlay;\n canPlay = day - sum; \n if(canPlay >=0){\n System.out.println(canPlay);\n }else{\n System.out.println(-1);\n }\n }\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"class Main{\n public static void main(String args[]){\n Scanner scan = new Scanner(System.in);\n int day = scan.nextInt();\n int homework = scan.nextInt();\n int sum = 0;\n int suji[] = new int[homework];\n for(int j = 0; j < suji.length; j++){\n suji[j] = scan.nextInt();\n }\n for(int i = 0; i < suji.length; i++){\n sum += suji[i];\n }\n int canPlay;\n canPlay = day - sum; \n if(canPlay >=0){\n System.out.println(canPlay);\n }else{\n System.out.println(-1);\n }\n }\n}",
"Main",
"public static void main(String args[]){\n Scanner scan = new Scanner(System.in);\n int day = scan.nextInt();\n int homework = scan.nextInt();\n int sum = 0;\n int suji[] = new int[homework];\n for(int j = 0; j < suji.length; j++){\n suji[j] = scan.nextInt();\n }\n for(int i = 0; i < suji.length; i++){\n sum += suji[i];\n }\n int canPlay;\n canPlay = day - sum; \n if(canPlay >=0){\n System.out.println(canPlay);\n }else{\n System.out.println(-1);\n }\n }",
"main",
"{\n Scanner scan = new Scanner(System.in);\n int day = scan.nextInt();\n int homework = scan.nextInt();\n int sum = 0;\n int suji[] = new int[homework];\n for(int j = 0; j < suji.length; j++){\n suji[j] = scan.nextInt();\n }\n for(int i = 0; i < suji.length; i++){\n sum += suji[i];\n }\n int canPlay;\n canPlay = day - sum; \n if(canPlay >=0){\n System.out.println(canPlay);\n }else{\n System.out.println(-1);\n }\n }",
"Scanner scan = new Scanner(System.in);",
"scan",
"new Scanner(System.in)",
"int day = scan.nextInt();",
"day",
"scan.nextInt()",
"scan.nextInt",
"scan",
"int homework = scan.nextInt();",
"homework",
"scan.nextInt()",
"scan.nextInt",
"scan",
"int sum = 0;",
"sum",
"0",
"int suji[] = new int[homework];",
"suji",
"new int[homework]",
"homework",
"for(int j = 0; j < suji.length; j++){\n suji[j] = scan.nextInt();\n }",
"int j = 0;",
"int j = 0;",
"j",
"0",
"j < suji.length",
"j",
"suji.length",
"suji",
"suji.length",
"j++",
"j++",
"j",
"{\n suji[j] = scan.nextInt();\n }",
"{\n suji[j] = scan.nextInt();\n }",
"suji[j] = scan.nextInt()",
"suji[j]",
"suji",
"j",
"scan.nextInt()",
"scan.nextInt",
"scan",
"for(int i = 0; i < suji.length; i++){\n sum += suji[i];\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < suji.length",
"i",
"suji.length",
"suji",
"suji.length",
"i++",
"i++",
"i",
"{\n sum += suji[i];\n }",
"{\n sum += suji[i];\n }",
"sum += suji[i]",
"sum",
"suji[i]",
"suji",
"i",
"int canPlay;",
"canPlay",
"canPlay = day - sum",
"canPlay",
"day - sum",
"day",
"sum",
"if(canPlay >=0){\n System.out.println(canPlay);\n }else{\n System.out.println(-1);\n }",
"canPlay >=0",
"canPlay",
"0",
"{\n System.out.println(canPlay);\n }",
"System.out.println(canPlay)",
"System.out.println",
"System.out",
"System",
"System.out",
"canPlay",
"{\n System.out.println(-1);\n }",
"System.out.println(-1)",
"System.out.println",
"System.out",
"System",
"System.out",
"-1",
"1",
"String args[]",
"args"
] |
import java.util.Scanner;
class Main{
public static void main(String args[]){
Scanner scan = new Scanner(System.in);
int day = scan.nextInt();
int homework = scan.nextInt();
int sum = 0;
int suji[] = new int[homework];
for(int j = 0; j < suji.length; j++){
suji[j] = scan.nextInt();
}
for(int i = 0; i < suji.length; i++){
sum += suji[i];
}
int canPlay;
canPlay = day - sum;
if(canPlay >=0){
System.out.println(canPlay);
}else{
System.out.println(-1);
}
}
}
|
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
41,
13,
20,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
18,
13,
13,
4,
18,
13,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
18,
13,
13,
14,
2,
2,
13,
13,
17,
30,
4,
18,
18,
13,
13,
17,
30,
4,
18,
18,
13,
13,
2,
13,
13,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
92,
5
],
[
92,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
8,
17
],
[
17,
18
],
[
17,
19
],
[
19,
20
],
[
20,
21
],
[
8,
22
],
[
22,
23
],
[
22,
24
],
[
8,
26
],
[
26,
27
],
[
27,
28
],
[
28,
29
],
[
28,
30
],
[
26,
31
],
[
31,
32
],
[
31,
33
],
[
26,
34
],
[
34,
35
],
[
35,
36
],
[
26,
37
],
[
38,
38
],
[
38,
39
],
[
39,
40
],
[
40,
41
],
[
40,
42
],
[
39,
43
],
[
43,
44
],
[
44,
45
],
[
8,
46
],
[
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
],
[
64,
66
],
[
8,
67
],
[
67,
68
],
[
68,
69
],
[
69,
70
],
[
69,
71
],
[
68,
72
],
[
67,
73
],
[
73,
74
],
[
74,
75
],
[
75,
76
],
[
76,
77
],
[
76,
78
],
[
74,
79
],
[
67,
80
],
[
80,
81
],
[
81,
82
],
[
82,
83
],
[
83,
84
],
[
83,
85
],
[
81,
86
],
[
86,
87
],
[
86,
88
],
[
6,
89
],
[
89,
90
],
[
0,
91
],
[
91,
92
],
[
91,
93
]
] |
[
"import java.util.Scanner;\npublic class Main {\n\n\tpublic static void main(String[] args) {\n\t\tScanner scan=new Scanner(System.in);\n\t\tint N=scan.nextInt();\n\t\tint M=scan.nextInt();\n\t\tint A[]=new int[M];\n\t\tfor(int i=0;i<M;i++) {\n\t\t\tA[i]=scan.nextInt();\n\t\t}\n\t\tint day=0;\n\t\tfor(int i=0;i<M;i++) {\n\t\t\tday+=A[i];\n\t\t}\n\t\tif(N-day<0) {\n\t\t\tSystem.out.println(\"-1\");\n\t\t}\n\t\telse {\n\t\t\tSystem.out.println(N-day);\n\t\t}\n\n\t}\n\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n\n\tpublic static void main(String[] args) {\n\t\tScanner scan=new Scanner(System.in);\n\t\tint N=scan.nextInt();\n\t\tint M=scan.nextInt();\n\t\tint A[]=new int[M];\n\t\tfor(int i=0;i<M;i++) {\n\t\t\tA[i]=scan.nextInt();\n\t\t}\n\t\tint day=0;\n\t\tfor(int i=0;i<M;i++) {\n\t\t\tday+=A[i];\n\t\t}\n\t\tif(N-day<0) {\n\t\t\tSystem.out.println(\"-1\");\n\t\t}\n\t\telse {\n\t\t\tSystem.out.println(N-day);\n\t\t}\n\n\t}\n\n}",
"Main",
"public static void main(String[] args) {\n\t\tScanner scan=new Scanner(System.in);\n\t\tint N=scan.nextInt();\n\t\tint M=scan.nextInt();\n\t\tint A[]=new int[M];\n\t\tfor(int i=0;i<M;i++) {\n\t\t\tA[i]=scan.nextInt();\n\t\t}\n\t\tint day=0;\n\t\tfor(int i=0;i<M;i++) {\n\t\t\tday+=A[i];\n\t\t}\n\t\tif(N-day<0) {\n\t\t\tSystem.out.println(\"-1\");\n\t\t}\n\t\telse {\n\t\t\tSystem.out.println(N-day);\n\t\t}\n\n\t}",
"main",
"{\n\t\tScanner scan=new Scanner(System.in);\n\t\tint N=scan.nextInt();\n\t\tint M=scan.nextInt();\n\t\tint A[]=new int[M];\n\t\tfor(int i=0;i<M;i++) {\n\t\t\tA[i]=scan.nextInt();\n\t\t}\n\t\tint day=0;\n\t\tfor(int i=0;i<M;i++) {\n\t\t\tday+=A[i];\n\t\t}\n\t\tif(N-day<0) {\n\t\t\tSystem.out.println(\"-1\");\n\t\t}\n\t\telse {\n\t\t\tSystem.out.println(N-day);\n\t\t}\n\n\t}",
"Scanner scan=new Scanner(System.in);",
"scan",
"new Scanner(System.in)",
"int N=scan.nextInt();",
"N",
"scan.nextInt()",
"scan.nextInt",
"scan",
"int M=scan.nextInt();",
"M",
"scan.nextInt()",
"scan.nextInt",
"scan",
"int A[]=new int[M];",
"A",
"new int[M]",
"M",
"for(int i=0;i<M;i++) {\n\t\t\tA[i]=scan.nextInt();\n\t\t}",
"int i=0;",
"int i=0;",
"i",
"0",
"i<M",
"i",
"M",
"i++",
"i++",
"i",
"{\n\t\t\tA[i]=scan.nextInt();\n\t\t}",
"{\n\t\t\tA[i]=scan.nextInt();\n\t\t}",
"A[i]=scan.nextInt()",
"A[i]",
"A",
"i",
"scan.nextInt()",
"scan.nextInt",
"scan",
"int day=0;",
"day",
"0",
"for(int i=0;i<M;i++) {\n\t\t\tday+=A[i];\n\t\t}",
"int i=0;",
"int i=0;",
"i",
"0",
"i<M",
"i",
"M",
"i++",
"i++",
"i",
"{\n\t\t\tday+=A[i];\n\t\t}",
"{\n\t\t\tday+=A[i];\n\t\t}",
"day+=A[i]",
"day",
"A[i]",
"A",
"i",
"if(N-day<0) {\n\t\t\tSystem.out.println(\"-1\");\n\t\t}\n\t\telse {\n\t\t\tSystem.out.println(N-day);\n\t\t}",
"N-day<0",
"N-day",
"N",
"day",
"0",
"{\n\t\t\tSystem.out.println(\"-1\");\n\t\t}",
"System.out.println(\"-1\")",
"System.out.println",
"System.out",
"System",
"System.out",
"\"-1\"",
"{\n\t\t\tSystem.out.println(N-day);\n\t\t}",
"System.out.println(N-day)",
"System.out.println",
"System.out",
"System",
"System.out",
"N-day",
"N",
"day",
"String[] args",
"args",
"public class Main {\n\n\tpublic static void main(String[] args) {\n\t\tScanner scan=new Scanner(System.in);\n\t\tint N=scan.nextInt();\n\t\tint M=scan.nextInt();\n\t\tint A[]=new int[M];\n\t\tfor(int i=0;i<M;i++) {\n\t\t\tA[i]=scan.nextInt();\n\t\t}\n\t\tint day=0;\n\t\tfor(int i=0;i<M;i++) {\n\t\t\tday+=A[i];\n\t\t}\n\t\tif(N-day<0) {\n\t\t\tSystem.out.println(\"-1\");\n\t\t}\n\t\telse {\n\t\t\tSystem.out.println(N-day);\n\t\t}\n\n\t}\n\n}",
"public class Main {\n\n\tpublic static void main(String[] args) {\n\t\tScanner scan=new Scanner(System.in);\n\t\tint N=scan.nextInt();\n\t\tint M=scan.nextInt();\n\t\tint A[]=new int[M];\n\t\tfor(int i=0;i<M;i++) {\n\t\t\tA[i]=scan.nextInt();\n\t\t}\n\t\tint day=0;\n\t\tfor(int i=0;i<M;i++) {\n\t\t\tday+=A[i];\n\t\t}\n\t\tif(N-day<0) {\n\t\t\tSystem.out.println(\"-1\");\n\t\t}\n\t\telse {\n\t\t\tSystem.out.println(N-day);\n\t\t}\n\n\t}\n\n}",
"Main"
] |
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner scan=new Scanner(System.in);
int N=scan.nextInt();
int M=scan.nextInt();
int A[]=new int[M];
for(int i=0;i<M;i++) {
A[i]=scan.nextInt();
}
int day=0;
for(int i=0;i<M;i++) {
day+=A[i];
}
if(N-day<0) {
System.out.println("-1");
}
else {
System.out.println(N-day);
}
}
}
|
[
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,
17,
42,
2,
13,
18,
13,
13,
30,
0,
18,
13,
13,
4,
18,
13,
40,
13,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
18,
13,
13,
1,
40,
13,
30,
30,
0,
13,
18,
13,
13,
41,
13,
2,
13,
13,
14,
2,
13,
17,
30,
4,
18,
18,
13,
13,
40,
17,
30,
4,
18,
18,
13,
13,
13,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
101,
5
],
[
101,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
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
],
[
32,
34
],
[
8,
35
],
[
35,
36
],
[
36,
37
],
[
36,
38
],
[
38,
39
],
[
38,
40
],
[
35,
41
],
[
41,
42
],
[
42,
43
],
[
43,
44
],
[
43,
45
],
[
42,
46
],
[
46,
47
],
[
47,
48
],
[
41,
49
],
[
49,
50
],
[
8,
51
],
[
51,
52
],
[
51,
53
],
[
8,
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
],
[
69,
71
],
[
71,
72
],
[
71,
73
],
[
8,
74
],
[
74,
75
],
[
74,
76
],
[
76,
77
],
[
76,
78
],
[
8,
79
],
[
79,
80
],
[
80,
81
],
[
80,
82
],
[
79,
83
],
[
83,
84
],
[
84,
85
],
[
85,
86
],
[
86,
87
],
[
86,
88
],
[
84,
89
],
[
89,
90
],
[
79,
91
],
[
91,
92
],
[
92,
93
],
[
93,
94
],
[
94,
95
],
[
94,
96
],
[
92,
97
],
[
6,
98
],
[
98,
99
],
[
0,
100
],
[
100,
101
],
[
100,
102
]
] |
[
"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 day;\n\t\tint num;\n\t\tint[] array;\n\n\t\tday = scan.nextInt();\n\t\tnum = scan.nextInt();\n\n\t\tarray = new int[num];\n\n\t\tint n = 0;\n\t\twhile(n < array.length) {\n\t\t\tarray[n] = scan.nextInt();\n\t\t\tn++;\n\t\t}\n\n\t\tint sum = 0;\n\t\tfor(int i = 0; i < array.length; i++) {\n\t\t\tsum += array[i];\n\t\t}\n\n\t\tint minus = day - sum;\n\t\tif(minus < 0) {\n\t\t\tSystem.out.println(-1);\n\t\t} else {\n\t\t\tSystem.out.println(minus);\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 day;\n\t\tint num;\n\t\tint[] array;\n\n\t\tday = scan.nextInt();\n\t\tnum = scan.nextInt();\n\n\t\tarray = new int[num];\n\n\t\tint n = 0;\n\t\twhile(n < array.length) {\n\t\t\tarray[n] = scan.nextInt();\n\t\t\tn++;\n\t\t}\n\n\t\tint sum = 0;\n\t\tfor(int i = 0; i < array.length; i++) {\n\t\t\tsum += array[i];\n\t\t}\n\n\t\tint minus = day - sum;\n\t\tif(minus < 0) {\n\t\t\tSystem.out.println(-1);\n\t\t} else {\n\t\t\tSystem.out.println(minus);\n\t\t}\n\t}\n}",
"Main",
"public static void main(String[] args) {\n\t\tScanner scan = new Scanner(System.in);\n\t\tint day;\n\t\tint num;\n\t\tint[] array;\n\n\t\tday = scan.nextInt();\n\t\tnum = scan.nextInt();\n\n\t\tarray = new int[num];\n\n\t\tint n = 0;\n\t\twhile(n < array.length) {\n\t\t\tarray[n] = scan.nextInt();\n\t\t\tn++;\n\t\t}\n\n\t\tint sum = 0;\n\t\tfor(int i = 0; i < array.length; i++) {\n\t\t\tsum += array[i];\n\t\t}\n\n\t\tint minus = day - sum;\n\t\tif(minus < 0) {\n\t\t\tSystem.out.println(-1);\n\t\t} else {\n\t\t\tSystem.out.println(minus);\n\t\t}\n\t}",
"main",
"{\n\t\tScanner scan = new Scanner(System.in);\n\t\tint day;\n\t\tint num;\n\t\tint[] array;\n\n\t\tday = scan.nextInt();\n\t\tnum = scan.nextInt();\n\n\t\tarray = new int[num];\n\n\t\tint n = 0;\n\t\twhile(n < array.length) {\n\t\t\tarray[n] = scan.nextInt();\n\t\t\tn++;\n\t\t}\n\n\t\tint sum = 0;\n\t\tfor(int i = 0; i < array.length; i++) {\n\t\t\tsum += array[i];\n\t\t}\n\n\t\tint minus = day - sum;\n\t\tif(minus < 0) {\n\t\t\tSystem.out.println(-1);\n\t\t} else {\n\t\t\tSystem.out.println(minus);\n\t\t}\n\t}",
"Scanner scan = new Scanner(System.in);",
"scan",
"new Scanner(System.in)",
"int day;",
"day",
"int num;",
"num",
"int[] array;",
"array",
"day = scan.nextInt()",
"day",
"scan.nextInt()",
"scan.nextInt",
"scan",
"num = scan.nextInt()",
"num",
"scan.nextInt()",
"scan.nextInt",
"scan",
"array = new int[num]",
"array",
"new int[num]",
"num",
"int n = 0;",
"n",
"0",
"while(n < array.length) {\n\t\t\tarray[n] = scan.nextInt();\n\t\t\tn++;\n\t\t}",
"n < array.length",
"n",
"array.length",
"array",
"array.length",
"{\n\t\t\tarray[n] = scan.nextInt();\n\t\t\tn++;\n\t\t}",
"array[n] = scan.nextInt()",
"array[n]",
"array",
"n",
"scan.nextInt()",
"scan.nextInt",
"scan",
"n++",
"n",
"int sum = 0;",
"sum",
"0",
"for(int i = 0; i < array.length; i++) {\n\t\t\tsum += array[i];\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\tsum += array[i];\n\t\t}",
"{\n\t\t\tsum += array[i];\n\t\t}",
"sum += array[i]",
"sum",
"array[i]",
"array",
"i",
"int minus = day - sum;",
"minus",
"day - sum",
"day",
"sum",
"if(minus < 0) {\n\t\t\tSystem.out.println(-1);\n\t\t} else {\n\t\t\tSystem.out.println(minus);\n\t\t}",
"minus < 0",
"minus",
"0",
"{\n\t\t\tSystem.out.println(-1);\n\t\t}",
"System.out.println(-1)",
"System.out.println",
"System.out",
"System",
"System.out",
"-1",
"1",
"{\n\t\t\tSystem.out.println(minus);\n\t\t}",
"System.out.println(minus)",
"System.out.println",
"System.out",
"System",
"System.out",
"minus",
"String[] args",
"args",
"public class Main {\n\tpublic static void main(String[] args) {\n\t\tScanner scan = new Scanner(System.in);\n\t\tint day;\n\t\tint num;\n\t\tint[] array;\n\n\t\tday = scan.nextInt();\n\t\tnum = scan.nextInt();\n\n\t\tarray = new int[num];\n\n\t\tint n = 0;\n\t\twhile(n < array.length) {\n\t\t\tarray[n] = scan.nextInt();\n\t\t\tn++;\n\t\t}\n\n\t\tint sum = 0;\n\t\tfor(int i = 0; i < array.length; i++) {\n\t\t\tsum += array[i];\n\t\t}\n\n\t\tint minus = day - sum;\n\t\tif(minus < 0) {\n\t\t\tSystem.out.println(-1);\n\t\t} else {\n\t\t\tSystem.out.println(minus);\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 day;\n\t\tint num;\n\t\tint[] array;\n\n\t\tday = scan.nextInt();\n\t\tnum = scan.nextInt();\n\n\t\tarray = new int[num];\n\n\t\tint n = 0;\n\t\twhile(n < array.length) {\n\t\t\tarray[n] = scan.nextInt();\n\t\t\tn++;\n\t\t}\n\n\t\tint sum = 0;\n\t\tfor(int i = 0; i < array.length; i++) {\n\t\t\tsum += array[i];\n\t\t}\n\n\t\tint minus = day - sum;\n\t\tif(minus < 0) {\n\t\t\tSystem.out.println(-1);\n\t\t} else {\n\t\t\tSystem.out.println(minus);\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 day;
int num;
int[] array;
day = scan.nextInt();
num = scan.nextInt();
array = new int[num];
int n = 0;
while(n < array.length) {
array[n] = scan.nextInt();
n++;
}
int sum = 0;
for(int i = 0; i < array.length; i++) {
sum += array[i];
}
int minus = day - sum;
if(minus < 0) {
System.out.println(-1);
} else {
System.out.println(minus);
}
}
}
|
[
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,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
41,
13,
4,
18,
13,
0,
13,
2,
13,
13,
41,
13,
2,
13,
13,
14,
2,
13,
17,
30,
4,
18,
18,
13,
13,
40,
17,
30,
4,
18,
18,
13,
13,
13,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
75,
5
],
[
75,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
8,
17
],
[
17,
18
],
[
17,
19
],
[
19,
20
],
[
20,
21
],
[
8,
22
],
[
22,
23
],
[
22,
24
],
[
8,
25
],
[
25,
26
],
[
26,
27
],
[
27,
28
],
[
27,
29
],
[
25,
30
],
[
30,
31
],
[
30,
32
],
[
25,
33
],
[
33,
34
],
[
34,
35
],
[
25,
36
],
[
37,
37
],
[
37,
38
],
[
38,
39
],
[
38,
40
],
[
40,
41
],
[
41,
42
],
[
37,
43
],
[
43,
44
],
[
43,
45
],
[
45,
46
],
[
45,
47
],
[
8,
48
],
[
48,
49
],
[
48,
50
],
[
50,
51
],
[
50,
52
],
[
8,
53
],
[
53,
54
],
[
54,
55
],
[
54,
56
],
[
53,
57
],
[
57,
58
],
[
58,
59
],
[
59,
60
],
[
60,
61
],
[
60,
62
],
[
58,
63
],
[
63,
64
],
[
53,
65
],
[
65,
66
],
[
66,
67
],
[
67,
68
],
[
68,
69
],
[
68,
70
],
[
66,
71
],
[
6,
72
],
[
72,
73
],
[
0,
74
],
[
74,
75
],
[
74,
76
]
] |
[
"import java.util.Scanner;\npublic class Main {\n public static void main(String[] args) {\n Scanner in=new Scanner(System.in);\n int num=in.nextInt();\n int hw=in.nextInt();\n int sum=0;\n for (int i = 0; i <hw; i++) {\n int x=in.nextInt();\n sum=sum+x;\n }\n int ans=num-sum;\n if(ans<0){\n System.out.println(-1);\n }else{\n System.out.println(ans);\n }\n }\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n public static void main(String[] args) {\n Scanner in=new Scanner(System.in);\n int num=in.nextInt();\n int hw=in.nextInt();\n int sum=0;\n for (int i = 0; i <hw; i++) {\n int x=in.nextInt();\n sum=sum+x;\n }\n int ans=num-sum;\n if(ans<0){\n System.out.println(-1);\n }else{\n System.out.println(ans);\n }\n }\n}",
"Main",
"public static void main(String[] args) {\n Scanner in=new Scanner(System.in);\n int num=in.nextInt();\n int hw=in.nextInt();\n int sum=0;\n for (int i = 0; i <hw; i++) {\n int x=in.nextInt();\n sum=sum+x;\n }\n int ans=num-sum;\n if(ans<0){\n System.out.println(-1);\n }else{\n System.out.println(ans);\n }\n }",
"main",
"{\n Scanner in=new Scanner(System.in);\n int num=in.nextInt();\n int hw=in.nextInt();\n int sum=0;\n for (int i = 0; i <hw; i++) {\n int x=in.nextInt();\n sum=sum+x;\n }\n int ans=num-sum;\n if(ans<0){\n System.out.println(-1);\n }else{\n System.out.println(ans);\n }\n }",
"Scanner in=new Scanner(System.in);",
"in",
"new Scanner(System.in)",
"int num=in.nextInt();",
"num",
"in.nextInt()",
"in.nextInt",
"in",
"int hw=in.nextInt();",
"hw",
"in.nextInt()",
"in.nextInt",
"in",
"int sum=0;",
"sum",
"0",
"for (int i = 0; i <hw; i++) {\n int x=in.nextInt();\n sum=sum+x;\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i <hw",
"i",
"hw",
"i++",
"i++",
"i",
"{\n int x=in.nextInt();\n sum=sum+x;\n }",
"{\n int x=in.nextInt();\n sum=sum+x;\n }",
"int x=in.nextInt();",
"x",
"in.nextInt()",
"in.nextInt",
"in",
"sum=sum+x",
"sum",
"sum+x",
"sum",
"x",
"int ans=num-sum;",
"ans",
"num-sum",
"num",
"sum",
"if(ans<0){\n System.out.println(-1);\n }else{\n System.out.println(ans);\n }",
"ans<0",
"ans",
"0",
"{\n System.out.println(-1);\n }",
"System.out.println(-1)",
"System.out.println",
"System.out",
"System",
"System.out",
"-1",
"1",
"{\n System.out.println(ans);\n }",
"System.out.println(ans)",
"System.out.println",
"System.out",
"System",
"System.out",
"ans",
"String[] args",
"args",
"public class Main {\n public static void main(String[] args) {\n Scanner in=new Scanner(System.in);\n int num=in.nextInt();\n int hw=in.nextInt();\n int sum=0;\n for (int i = 0; i <hw; i++) {\n int x=in.nextInt();\n sum=sum+x;\n }\n int ans=num-sum;\n if(ans<0){\n System.out.println(-1);\n }else{\n System.out.println(ans);\n }\n }\n}",
"public class Main {\n public static void main(String[] args) {\n Scanner in=new Scanner(System.in);\n int num=in.nextInt();\n int hw=in.nextInt();\n int sum=0;\n for (int i = 0; i <hw; i++) {\n int x=in.nextInt();\n sum=sum+x;\n }\n int ans=num-sum;\n if(ans<0){\n System.out.println(-1);\n }else{\n System.out.println(ans);\n }\n }\n}",
"Main"
] |
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner in=new Scanner(System.in);
int num=in.nextInt();
int hw=in.nextInt();
int sum=0;
for (int i = 0; i <hw; i++) {
int x=in.nextInt();
sum=sum+x;
}
int ans=num-sum;
if(ans<0){
System.out.println(-1);
}else{
System.out.println(ans);
}
}
}
|
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
41,
13,
20,
13,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
18,
13,
13,
4,
18,
13,
0,
13,
18,
13,
13,
14,
2,
2,
13,
13,
17,
30,
4,
18,
18,
13,
13,
40,
17,
30,
4,
18,
18,
13,
13,
2,
13,
13,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
80,
5
],
[
80,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
8,
17
],
[
17,
18
],
[
17,
19
],
[
19,
20
],
[
20,
21
],
[
8,
22
],
[
22,
23
],
[
22,
24
],
[
8,
26
],
[
26,
27
],
[
26,
28
],
[
8,
29
],
[
29,
30
],
[
30,
31
],
[
31,
32
],
[
31,
33
],
[
29,
34
],
[
34,
35
],
[
34,
36
],
[
29,
37
],
[
37,
38
],
[
38,
39
],
[
29,
40
],
[
41,
41
],
[
41,
42
],
[
42,
43
],
[
43,
44
],
[
43,
45
],
[
42,
46
],
[
46,
47
],
[
47,
48
],
[
41,
49
],
[
49,
50
],
[
49,
51
],
[
51,
52
],
[
51,
53
],
[
8,
54
],
[
54,
55
],
[
55,
56
],
[
56,
57
],
[
56,
58
],
[
55,
59
],
[
54,
60
],
[
60,
61
],
[
61,
62
],
[
62,
63
],
[
63,
64
],
[
63,
65
],
[
61,
66
],
[
66,
67
],
[
54,
68
],
[
68,
69
],
[
69,
70
],
[
70,
71
],
[
71,
72
],
[
71,
73
],
[
69,
74
],
[
74,
75
],
[
74,
76
],
[
6,
77
],
[
77,
78
],
[
0,
79
],
[
79,
80
],
[
79,
81
]
] |
[
"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\t\n\t\tint n = sc.nextInt();\n\t\tint m = sc.nextInt();\n\t\t\n\t\tint[] sum = new int[m];\n\t\t\n\t\tint ans = 0;\n\t\t\n\t\tfor (int i=0;i<m;i++) {\n\t\t\tsum[i] = sc.nextInt();\n\t\t\tans+=sum[i];\n\t\t}\n\n\t\tif(n-ans < 0) {\n\t\t\tSystem.out.println(-1);\n\t\t} else {\n\t\t\tSystem.out.println(n-ans);\n\t\t}\n\t\t\n\n\t}\n}\n",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n\n\tpublic static void main(String[] args) {\n\n\t\tScanner sc = new Scanner(System.in);\n\t\t\n\t\tint n = sc.nextInt();\n\t\tint m = sc.nextInt();\n\t\t\n\t\tint[] sum = new int[m];\n\t\t\n\t\tint ans = 0;\n\t\t\n\t\tfor (int i=0;i<m;i++) {\n\t\t\tsum[i] = sc.nextInt();\n\t\t\tans+=sum[i];\n\t\t}\n\n\t\tif(n-ans < 0) {\n\t\t\tSystem.out.println(-1);\n\t\t} else {\n\t\t\tSystem.out.println(n-ans);\n\t\t}\n\t\t\n\n\t}\n}",
"Main",
"public static void main(String[] args) {\n\n\t\tScanner sc = new Scanner(System.in);\n\t\t\n\t\tint n = sc.nextInt();\n\t\tint m = sc.nextInt();\n\t\t\n\t\tint[] sum = new int[m];\n\t\t\n\t\tint ans = 0;\n\t\t\n\t\tfor (int i=0;i<m;i++) {\n\t\t\tsum[i] = sc.nextInt();\n\t\t\tans+=sum[i];\n\t\t}\n\n\t\tif(n-ans < 0) {\n\t\t\tSystem.out.println(-1);\n\t\t} else {\n\t\t\tSystem.out.println(n-ans);\n\t\t}\n\t\t\n\n\t}",
"main",
"{\n\n\t\tScanner sc = new Scanner(System.in);\n\t\t\n\t\tint n = sc.nextInt();\n\t\tint m = sc.nextInt();\n\t\t\n\t\tint[] sum = new int[m];\n\t\t\n\t\tint ans = 0;\n\t\t\n\t\tfor (int i=0;i<m;i++) {\n\t\t\tsum[i] = sc.nextInt();\n\t\t\tans+=sum[i];\n\t\t}\n\n\t\tif(n-ans < 0) {\n\t\t\tSystem.out.println(-1);\n\t\t} else {\n\t\t\tSystem.out.println(n-ans);\n\t\t}\n\t\t\n\n\t}",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"int n = sc.nextInt();",
"n",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int m = sc.nextInt();",
"m",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int[] sum = new int[m];",
"sum",
"new int[m]",
"m",
"int ans = 0;",
"ans",
"0",
"for (int i=0;i<m;i++) {\n\t\t\tsum[i] = sc.nextInt();\n\t\t\tans+=sum[i];\n\t\t}",
"int i=0;",
"int i=0;",
"i",
"0",
"i<m",
"i",
"m",
"i++",
"i++",
"i",
"{\n\t\t\tsum[i] = sc.nextInt();\n\t\t\tans+=sum[i];\n\t\t}",
"{\n\t\t\tsum[i] = sc.nextInt();\n\t\t\tans+=sum[i];\n\t\t}",
"sum[i] = sc.nextInt()",
"sum[i]",
"sum",
"i",
"sc.nextInt()",
"sc.nextInt",
"sc",
"ans+=sum[i]",
"ans",
"sum[i]",
"sum",
"i",
"if(n-ans < 0) {\n\t\t\tSystem.out.println(-1);\n\t\t} else {\n\t\t\tSystem.out.println(n-ans);\n\t\t}",
"n-ans < 0",
"n-ans",
"n",
"ans",
"0",
"{\n\t\t\tSystem.out.println(-1);\n\t\t}",
"System.out.println(-1)",
"System.out.println",
"System.out",
"System",
"System.out",
"-1",
"1",
"{\n\t\t\tSystem.out.println(n-ans);\n\t\t}",
"System.out.println(n-ans)",
"System.out.println",
"System.out",
"System",
"System.out",
"n-ans",
"n",
"ans",
"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\t\n\t\tint n = sc.nextInt();\n\t\tint m = sc.nextInt();\n\t\t\n\t\tint[] sum = new int[m];\n\t\t\n\t\tint ans = 0;\n\t\t\n\t\tfor (int i=0;i<m;i++) {\n\t\t\tsum[i] = sc.nextInt();\n\t\t\tans+=sum[i];\n\t\t}\n\n\t\tif(n-ans < 0) {\n\t\t\tSystem.out.println(-1);\n\t\t} else {\n\t\t\tSystem.out.println(n-ans);\n\t\t}\n\t\t\n\n\t}\n}",
"public class Main {\n\n\tpublic static void main(String[] args) {\n\n\t\tScanner sc = new Scanner(System.in);\n\t\t\n\t\tint n = sc.nextInt();\n\t\tint m = sc.nextInt();\n\t\t\n\t\tint[] sum = new int[m];\n\t\t\n\t\tint ans = 0;\n\t\t\n\t\tfor (int i=0;i<m;i++) {\n\t\t\tsum[i] = sc.nextInt();\n\t\t\tans+=sum[i];\n\t\t}\n\n\t\tif(n-ans < 0) {\n\t\t\tSystem.out.println(-1);\n\t\t} else {\n\t\t\tSystem.out.println(n-ans);\n\t\t}\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 n = sc.nextInt();
int m = sc.nextInt();
int[] sum = new int[m];
int ans = 0;
for (int i=0;i<m;i++) {
sum[i] = sc.nextInt();
ans+=sum[i];
}
if(n-ans < 0) {
System.out.println(-1);
} else {
System.out.println(n-ans);
}
}
}
|
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
38,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
41,
13,
20,
13,
11,
1,
41,
13,
17,
2,
13,
18,
13,
13,
1,
40,
13,
30,
30,
0,
18,
13,
13,
4,
18,
13,
41,
13,
13,
11,
1,
41,
13,
17,
2,
13,
18,
13,
13,
1,
40,
13,
30,
30,
0,
13,
18,
13,
13,
4,
18,
18,
13,
13,
8,
2,
13,
17,
40,
17,
13,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
88,
5
],
[
88,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
10,
11
],
[
11,
12
],
[
11,
13
],
[
10,
14
],
[
14,
15
],
[
14,
16
],
[
16,
17
],
[
17,
18
],
[
10,
19
],
[
19,
20
],
[
19,
21
],
[
21,
22
],
[
22,
23
],
[
10,
24
],
[
24,
25
],
[
24,
26
],
[
10,
28
],
[
28,
29
],
[
29,
30
],
[
30,
31
],
[
30,
32
],
[
28,
33
],
[
33,
34
],
[
33,
35
],
[
35,
36
],
[
35,
37
],
[
28,
38
],
[
38,
39
],
[
39,
40
],
[
28,
41
],
[
42,
42
],
[
42,
43
],
[
43,
44
],
[
44,
45
],
[
44,
46
],
[
43,
47
],
[
47,
48
],
[
48,
49
],
[
10,
50
],
[
50,
51
],
[
50,
52
],
[
10,
53
],
[
53,
54
],
[
54,
55
],
[
55,
56
],
[
55,
57
],
[
53,
58
],
[
58,
59
],
[
58,
60
],
[
60,
61
],
[
60,
62
],
[
53,
63
],
[
63,
64
],
[
64,
65
],
[
53,
66
],
[
67,
67
],
[
67,
68
],
[
68,
69
],
[
68,
70
],
[
70,
71
],
[
70,
72
],
[
10,
73
],
[
73,
74
],
[
74,
75
],
[
75,
76
],
[
75,
77
],
[
73,
78
],
[
78,
79
],
[
79,
80
],
[
79,
81
],
[
78,
82
],
[
82,
83
],
[
78,
84
],
[
6,
85
],
[
85,
86
],
[
0,
87
],
[
87,
88
],
[
87,
89
]
] |
[
"import java.util.Scanner;\n\npublic class Main {\n public static void main(String[] args) {\n try (Scanner sc = new Scanner(System.in)) {\n int N = sc.nextInt();\n int M = sc.nextInt();\n int[] A = new int[M];\n for (int i = 0; i < A.length; i++) {\n A[i] = sc.nextInt();\n }\n\n int rest = N;\n for (int i = 0; i < A.length; i++) {\n rest -= A[i];\n }\n System.out.println(rest < 0 ? -1 : rest);\n }\n }\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n public static void main(String[] args) {\n try (Scanner sc = new Scanner(System.in)) {\n int N = sc.nextInt();\n int M = sc.nextInt();\n int[] A = new int[M];\n for (int i = 0; i < A.length; i++) {\n A[i] = sc.nextInt();\n }\n\n int rest = N;\n for (int i = 0; i < A.length; i++) {\n rest -= A[i];\n }\n System.out.println(rest < 0 ? -1 : rest);\n }\n }\n}",
"Main",
"public static void main(String[] args) {\n try (Scanner sc = new Scanner(System.in)) {\n int N = sc.nextInt();\n int M = sc.nextInt();\n int[] A = new int[M];\n for (int i = 0; i < A.length; i++) {\n A[i] = sc.nextInt();\n }\n\n int rest = N;\n for (int i = 0; i < A.length; i++) {\n rest -= A[i];\n }\n System.out.println(rest < 0 ? -1 : rest);\n }\n }",
"main",
"{\n try (Scanner sc = new Scanner(System.in)) {\n int N = sc.nextInt();\n int M = sc.nextInt();\n int[] A = new int[M];\n for (int i = 0; i < A.length; i++) {\n A[i] = sc.nextInt();\n }\n\n int rest = N;\n for (int i = 0; i < A.length; i++) {\n rest -= A[i];\n }\n System.out.println(rest < 0 ? -1 : rest);\n }\n }",
"try (Scanner sc = new Scanner(System.in)) {\n int N = sc.nextInt();\n int M = sc.nextInt();\n int[] A = new int[M];\n for (int i = 0; i < A.length; i++) {\n A[i] = sc.nextInt();\n }\n\n int rest = N;\n for (int i = 0; i < A.length; i++) {\n rest -= A[i];\n }\n System.out.println(rest < 0 ? -1 : rest);\n }",
"{\n int N = sc.nextInt();\n int M = sc.nextInt();\n int[] A = new int[M];\n for (int i = 0; i < A.length; i++) {\n A[i] = sc.nextInt();\n }\n\n int rest = N;\n for (int i = 0; i < A.length; i++) {\n rest -= A[i];\n }\n System.out.println(rest < 0 ? -1 : rest);\n }",
"Scanner sc = new Scanner(System.in)",
"Scanner sc = new Scanner(System.in)",
"new Scanner(System.in)",
"int N = sc.nextInt();",
"N",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int M = sc.nextInt();",
"M",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int[] A = new int[M];",
"A",
"new int[M]",
"M",
"for (int i = 0; i < A.length; i++) {\n A[i] = sc.nextInt();\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < A.length",
"i",
"A.length",
"A",
"A.length",
"i++",
"i++",
"i",
"{\n A[i] = sc.nextInt();\n }",
"{\n A[i] = sc.nextInt();\n }",
"A[i] = sc.nextInt()",
"A[i]",
"A",
"i",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int rest = N;",
"rest",
"N",
"for (int i = 0; i < A.length; i++) {\n rest -= A[i];\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < A.length",
"i",
"A.length",
"A",
"A.length",
"i++",
"i++",
"i",
"{\n rest -= A[i];\n }",
"{\n rest -= A[i];\n }",
"rest -= A[i]",
"rest",
"A[i]",
"A",
"i",
"System.out.println(rest < 0 ? -1 : rest)",
"System.out.println",
"System.out",
"System",
"System.out",
"rest < 0 ? -1 : rest",
"rest < 0",
"rest",
"0",
"-1",
"1",
"rest",
"String[] args",
"args",
"public class Main {\n public static void main(String[] args) {\n try (Scanner sc = new Scanner(System.in)) {\n int N = sc.nextInt();\n int M = sc.nextInt();\n int[] A = new int[M];\n for (int i = 0; i < A.length; i++) {\n A[i] = sc.nextInt();\n }\n\n int rest = N;\n for (int i = 0; i < A.length; i++) {\n rest -= A[i];\n }\n System.out.println(rest < 0 ? -1 : rest);\n }\n }\n}",
"public class Main {\n public static void main(String[] args) {\n try (Scanner sc = new Scanner(System.in)) {\n int N = sc.nextInt();\n int M = sc.nextInt();\n int[] A = new int[M];\n for (int i = 0; i < A.length; i++) {\n A[i] = sc.nextInt();\n }\n\n int rest = N;\n for (int i = 0; i < A.length; i++) {\n rest -= A[i];\n }\n System.out.println(rest < 0 ? -1 : rest);\n }\n }\n}",
"Main"
] |
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
try (Scanner sc = new Scanner(System.in)) {
int N = sc.nextInt();
int M = sc.nextInt();
int[] A = new int[M];
for (int i = 0; i < A.length; i++) {
A[i] = sc.nextInt();
}
int rest = N;
for (int i = 0; i < A.length; i++) {
rest -= A[i];
}
System.out.println(rest < 0 ? -1 : rest);
}
}
}
|
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
41,
13,
4,
18,
13,
17,
17,
41,
13,
39,
39,
17,
17,
39,
17,
40,
17,
39,
17,
17,
39,
40,
17,
17,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
4,
18,
13,
14,
2,
13,
13,
30,
4,
13,
17,
30,
4,
13,
2,
17,
2,
13,
13,
4,
18,
13,
17,
23,
13,
12,
13,
30,
41,
13,
18,
13,
13,
0,
18,
13,
13,
18,
13,
13,
0,
18,
13,
13,
13,
23,
13,
23,
13,
23,
13,
12,
13,
30,
42,
2,
13,
13,
30,
4,
13,
13,
13,
13,
40,
13,
40,
13,
23,
13,
23,
13,
23,
13,
12,
13,
30,
14,
2,
18,
13,
13,
17,
30,
29,
17,
41,
13,
2,
18,
13,
13,
17,
42,
2,
13,
17,
30,
14,
2,
18,
13,
13,
18,
13,
2,
13,
17,
30,
3,
40,
13,
14,
2,
13,
17,
30,
29,
17,
41,
13,
2,
18,
13,
13,
17,
11,
1,
41,
13,
2,
18,
13,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
14,
2,
18,
13,
13,
18,
13,
13,
30,
0,
13,
13,
3,
4,
13,
13,
13,
13,
4,
13,
13,
2,
13,
17,
2,
18,
13,
13,
17,
29,
17,
23,
13,
12,
13,
30,
41,
13,
20,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
18,
13,
13,
2,
13,
17,
29,
13,
23,
13,
12,
13,
30,
4,
18,
18,
13,
13,
13,
23,
13,
12,
13,
30,
28,
13,
13,
30,
30,
4,
18,
18,
13,
13,
2,
13,
17,
4,
13,
17,
23,
13,
12,
13,
30,
29,
2,
4,
18,
13,
13,
4,
18,
13,
17,
23,
13,
12,
13,
30,
14,
2,
13,
13,
30,
29,
4,
13,
13,
13,
14,
2,
2,
13,
13,
17,
30,
29,
13,
29,
4,
13,
13,
2,
13,
13,
23,
13,
23,
13,
6,
13,
41,
13,
41,
13,
12,
13,
30,
0,
13,
20,
12,
13,
30,
42,
2,
2,
13,
17,
40,
4,
18,
13,
30,
38,
5,
13,
30,
4,
18,
13,
30,
0,
13,
20,
29,
4,
18,
13,
12,
13,
30,
29,
4,
18,
13,
4,
13,
12,
13,
30,
29,
4,
18,
13,
4,
13,
12,
13,
30,
29,
4,
18,
13,
4,
13,
12,
13,
30,
41,
13,
17,
38,
5,
13,
30,
4,
18,
13,
30,
0,
13,
4,
18,
13,
29,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
10,
11
],
[
10,
12
],
[
0,
13
],
[
449,
14
],
[
449,
15
],
[
15,
16
],
[
15,
17
],
[
17,
18
],
[
18,
19
],
[
17,
20
],
[
17,
21
],
[
449,
22
],
[
22,
23
],
[
22,
24
],
[
24,
25
],
[
25,
26
],
[
25,
27
],
[
24,
28
],
[
28,
29
],
[
28,
30
],
[
30,
31
],
[
24,
32
],
[
32,
33
],
[
32,
34
],
[
24,
35
],
[
35,
36
],
[
36,
37
],
[
35,
38
],
[
449,
39
],
[
39,
40
],
[
39,
41
],
[
41,
42
],
[
42,
43
],
[
42,
44
],
[
41,
45
],
[
45,
46
],
[
45,
47
],
[
47,
48
],
[
48,
49
],
[
41,
50
],
[
50,
51
],
[
50,
52
],
[
52,
53
],
[
53,
54
],
[
41,
55
],
[
55,
56
],
[
55,
57
],
[
41,
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
],
[
41,
76
],
[
76,
77
],
[
77,
78
],
[
77,
79
],
[
76,
80
],
[
80,
81
],
[
81,
82
],
[
81,
83
],
[
76,
84
],
[
84,
85
],
[
85,
86
],
[
85,
87
],
[
87,
88
],
[
87,
89
],
[
89,
90
],
[
89,
91
],
[
41,
92
],
[
92,
93
],
[
93,
94
],
[
92,
95
],
[
39,
96
],
[
96,
97
],
[
449,
98
],
[
98,
99
],
[
98,
100
],
[
100,
101
],
[
101,
102
],
[
101,
103
],
[
103,
104
],
[
103,
105
],
[
100,
106
],
[
106,
107
],
[
107,
108
],
[
107,
109
],
[
106,
110
],
[
110,
111
],
[
110,
112
],
[
100,
113
],
[
113,
114
],
[
114,
115
],
[
114,
116
],
[
113,
117
],
[
98,
118
],
[
118,
119
],
[
98,
120
],
[
120,
121
],
[
98,
122
],
[
122,
123
],
[
449,
124
],
[
124,
125
],
[
124,
126
],
[
126,
127
],
[
127,
128
],
[
128,
129
],
[
128,
130
],
[
127,
131
],
[
131,
132
],
[
132,
133
],
[
132,
134
],
[
132,
135
],
[
132,
136
],
[
131,
137
],
[
137,
138
],
[
131,
139
],
[
139,
140
],
[
124,
141
],
[
141,
142
],
[
124,
143
],
[
143,
144
],
[
124,
145
],
[
145,
146
],
[
449,
147
],
[
147,
148
],
[
147,
149
],
[
149,
150
],
[
150,
151
],
[
151,
152
],
[
152,
153
],
[
152,
154
],
[
151,
155
],
[
150,
156
],
[
156,
157
],
[
157,
158
],
[
149,
159
],
[
159,
160
],
[
159,
161
],
[
161,
162
],
[
162,
163
],
[
162,
164
],
[
161,
165
],
[
149,
166
],
[
166,
167
],
[
167,
168
],
[
167,
169
],
[
166,
170
],
[
170,
171
],
[
171,
172
],
[
172,
173
],
[
173,
174
],
[
173,
175
],
[
172,
176
],
[
176,
177
],
[
176,
178
],
[
178,
179
],
[
178,
180
],
[
171,
181
],
[
181,
182
],
[
170,
183
],
[
183,
184
],
[
149,
185
],
[
185,
186
],
[
186,
187
],
[
186,
188
],
[
185,
189
],
[
189,
190
],
[
190,
191
],
[
149,
192
],
[
192,
193
],
[
192,
194
],
[
194,
195
],
[
195,
196
],
[
195,
197
],
[
194,
198
],
[
149,
199
],
[
199,
200
],
[
200,
201
],
[
201,
202
],
[
201,
203
],
[
203,
204
],
[
204,
205
],
[
204,
206
],
[
203,
207
],
[
199,
208
],
[
208,
209
],
[
208,
210
],
[
199,
211
],
[
211,
212
],
[
212,
213
],
[
199,
214
],
[
215,
215
],
[
215,
216
],
[
216,
217
],
[
217,
218
],
[
218,
219
],
[
218,
220
],
[
217,
221
],
[
221,
222
],
[
221,
223
],
[
216,
224
],
[
224,
225
],
[
225,
226
],
[
225,
227
],
[
224,
228
],
[
149,
229
],
[
229,
230
],
[
229,
231
],
[
229,
232
],
[
229,
233
],
[
149,
234
],
[
234,
235
],
[
234,
236
],
[
234,
237
],
[
237,
238
],
[
237,
239
],
[
234,
240
],
[
240,
241
],
[
241,
242
],
[
241,
243
],
[
240,
244
],
[
149,
245
],
[
245,
246
],
[
147,
247
],
[
247,
248
],
[
449,
249
],
[
249,
250
],
[
249,
251
],
[
251,
252
],
[
252,
253
],
[
252,
254
],
[
251,
256
],
[
256,
257
],
[
257,
258
],
[
258,
259
],
[
258,
260
],
[
256,
261
],
[
261,
262
],
[
261,
263
],
[
256,
264
],
[
264,
265
],
[
265,
266
],
[
256,
267
],
[
268,
268
],
[
268,
269
],
[
269,
270
],
[
270,
271
],
[
270,
272
],
[
269,
273
],
[
273,
274
],
[
273,
275
],
[
251,
276
],
[
276,
277
],
[
249,
278
],
[
278,
279
],
[
449,
280
],
[
280,
281
],
[
280,
282
],
[
282,
283
],
[
283,
284
],
[
284,
285
],
[
285,
286
],
[
285,
287
],
[
283,
288
],
[
280,
289
],
[
289,
290
],
[
449,
291
],
[
291,
292
],
[
291,
293
],
[
293,
294
],
[
294,
295
],
[
294,
296
],
[
294,
297
],
[
298,
298
],
[
298,
299
],
[
299,
300
],
[
300,
301
],
[
301,
302
],
[
301,
303
],
[
299,
304
],
[
304,
305
],
[
304,
306
],
[
293,
307
],
[
307,
308
],
[
307,
309
],
[
291,
310
],
[
310,
311
],
[
449,
312
],
[
312,
313
],
[
312,
314
],
[
314,
315
],
[
315,
316
],
[
316,
317
],
[
317,
318
],
[
318,
319
],
[
317,
320
],
[
316,
321
],
[
321,
322
],
[
322,
323
],
[
321,
324
],
[
312,
325
],
[
325,
326
],
[
449,
327
],
[
327,
328
],
[
327,
329
],
[
329,
330
],
[
330,
331
],
[
331,
332
],
[
331,
333
],
[
330,
334
],
[
334,
335
],
[
335,
336
],
[
336,
337
],
[
336,
338
],
[
336,
339
],
[
329,
340
],
[
340,
341
],
[
341,
342
],
[
342,
343
],
[
342,
344
],
[
341,
345
],
[
340,
346
],
[
346,
347
],
[
347,
348
],
[
329,
349
],
[
349,
350
],
[
350,
351
],
[
350,
352
],
[
350,
353
],
[
353,
354
],
[
353,
355
],
[
327,
356
],
[
356,
357
],
[
327,
358
],
[
358,
359
],
[
449,
360
],
[
360,
361
],
[
360,
362
],
[
362,
363
],
[
360,
364
],
[
364,
365
],
[
360,
366
],
[
366,
367
],
[
366,
368
],
[
368,
369
],
[
369,
370
],
[
369,
371
],
[
360,
372
],
[
372,
373
],
[
372,
374
],
[
374,
375
],
[
375,
376
],
[
376,
377
],
[
377,
378
],
[
377,
379
],
[
376,
380
],
[
380,
381
],
[
381,
382
],
[
382,
383
],
[
375,
384
],
[
384,
385
],
[
385,
386
],
[
386,
387
],
[
386,
388
],
[
388,
389
],
[
389,
390
],
[
390,
391
],
[
385,
392
],
[
392,
393
],
[
393,
394
],
[
393,
395
],
[
374,
396
],
[
396,
397
],
[
397,
398
],
[
398,
399
],
[
360,
400
],
[
400,
401
],
[
400,
402
],
[
402,
403
],
[
403,
404
],
[
404,
405
],
[
405,
406
],
[
404,
407
],
[
407,
408
],
[
360,
409
],
[
409,
410
],
[
409,
411
],
[
411,
412
],
[
412,
413
],
[
413,
414
],
[
414,
415
],
[
413,
416
],
[
416,
417
],
[
360,
418
],
[
418,
419
],
[
418,
420
],
[
420,
421
],
[
421,
422
],
[
422,
423
],
[
423,
424
],
[
422,
425
],
[
425,
426
],
[
360,
427
],
[
427,
428
],
[
427,
429
],
[
429,
430
],
[
430,
431
],
[
430,
432
],
[
429,
433
],
[
433,
434
],
[
434,
435
],
[
434,
436
],
[
436,
437
],
[
437,
438
],
[
438,
439
],
[
433,
440
],
[
440,
441
],
[
441,
442
],
[
441,
443
],
[
443,
444
],
[
444,
445
],
[
429,
446
],
[
446,
447
],
[
0,
448
],
[
448,
449
],
[
448,
450
]
] |
[
"\nimport java.io.BufferedReader;\nimport java.io.IOException;\nimport java.io.InputStreamReader;\nimport java.util.*;\n\npublic class Main {\n private static final int MOD = (int) Math.pow(10, 9);\n private static final int[][] DIRS = {{0, 1}, {0, -1}, {1, 0}, {-1, 0}};\n\n public static void main(String[] args) {\n FastReader sc = new FastReader();\n int n = sc.nextInt();\n int m = sc.nextInt();\n int sum = 0;\n\n for (int i = 0; i < m;i++){\n sum += sc.nextInt();\n }\n\n if (sum > n) {\n print(\"-1\");\n } else {\n print(\"\" + (n - sum));\n }\n //print(\"\"+res);\n System.exit(0);\n }\n\n static private void swap(int[] nums, int x, int y) {\n int tmp = nums[x];\n nums[x] = nums[y];\n nums[y] = tmp;\n }\n\n static private void reverse(int[] nums, int left, int right) {\n while (left < right) {\n swap(nums, left, right);\n left++;\n right--;\n }\n }\n\n static private boolean findNextPermutation(int[] nums) {\n if (nums.length <= 1) {\n return false;\n }\n\n int last = nums.length - 2;\n\n while (last >= 0) {\n if (nums[last] < nums[last + 1]){\n break;\n }\n last--;\n }\n\n if (last < 0) { return false; }\n int nextGenerater = nums.length - 1;\n\n for (int i = nums.length - 1; i > last; i--) {\n if (nums[i] > nums[last]) {\n nextGenerater = i;\n break;\n }\n }\n\n swap(nums, nextGenerater, last);\n reverse(nums, last + 1, nums.length - 1);\n return true;\n }\n\n static private int[] generateNArray(int n) {\n int[] res = new int[n];\n\n for (int i = 0; i < n; i++) {\n res[i] = i + 1;\n }\n\n return res;\n }\n\n static private void print(String s) {\n System.out.println(s);\n }\n\n static private void printArray(int[] e) {\n for (int s: e) {\n System.out.print(s + \" \");\n }\n print(\"\");\n }\n\n static private int log2(int x) {\n return (int)(Math.log(x) / Math.log(2));\n }\n\n static private long gcd(long m, long n) {\n if (m < n) { return gcd(n, m); }\n if (m % n == 0) { return n; }\n return gcd(n, m%n);\n }\n\n static class FastReader {\n BufferedReader br;\n StringTokenizer st;\n\n public FastReader() {\n br = new BufferedReader(new InputStreamReader(System.in));\n }\n\n String next() {\n while (st == null || !st.hasMoreElements()) {\n try {\n st = new StringTokenizer(br.readLine());\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n return st.nextToken();\n }\n\n int nextInt() {\n return Integer.parseInt(next());\n }\n\n long nextLong() {\n return Long.parseLong(next());\n }\n\n double nextDouble() {\n return Double.parseDouble(next());\n }\n\n String nextLine() {\n String str = \"\";\n try{\n str = br.readLine();\n } catch (IOException e) {\n e.printStackTrace();\n }\n return str;\n }\n }\n}",
"import java.io.BufferedReader;",
"BufferedReader",
"java.io",
"import java.io.IOException;",
"IOException",
"java.io",
"import java.io.InputStreamReader;",
"InputStreamReader",
"java.io",
"import java.util.*;",
"util.*",
"java",
"public class Main {\n private static final int MOD = (int) Math.pow(10, 9);\n private static final int[][] DIRS = {{0, 1}, {0, -1}, {1, 0}, {-1, 0}};\n\n public static void main(String[] args) {\n FastReader sc = new FastReader();\n int n = sc.nextInt();\n int m = sc.nextInt();\n int sum = 0;\n\n for (int i = 0; i < m;i++){\n sum += sc.nextInt();\n }\n\n if (sum > n) {\n print(\"-1\");\n } else {\n print(\"\" + (n - sum));\n }\n //print(\"\"+res);\n System.exit(0);\n }\n\n static private void swap(int[] nums, int x, int y) {\n int tmp = nums[x];\n nums[x] = nums[y];\n nums[y] = tmp;\n }\n\n static private void reverse(int[] nums, int left, int right) {\n while (left < right) {\n swap(nums, left, right);\n left++;\n right--;\n }\n }\n\n static private boolean findNextPermutation(int[] nums) {\n if (nums.length <= 1) {\n return false;\n }\n\n int last = nums.length - 2;\n\n while (last >= 0) {\n if (nums[last] < nums[last + 1]){\n break;\n }\n last--;\n }\n\n if (last < 0) { return false; }\n int nextGenerater = nums.length - 1;\n\n for (int i = nums.length - 1; i > last; i--) {\n if (nums[i] > nums[last]) {\n nextGenerater = i;\n break;\n }\n }\n\n swap(nums, nextGenerater, last);\n reverse(nums, last + 1, nums.length - 1);\n return true;\n }\n\n static private int[] generateNArray(int n) {\n int[] res = new int[n];\n\n for (int i = 0; i < n; i++) {\n res[i] = i + 1;\n }\n\n return res;\n }\n\n static private void print(String s) {\n System.out.println(s);\n }\n\n static private void printArray(int[] e) {\n for (int s: e) {\n System.out.print(s + \" \");\n }\n print(\"\");\n }\n\n static private int log2(int x) {\n return (int)(Math.log(x) / Math.log(2));\n }\n\n static private long gcd(long m, long n) {\n if (m < n) { return gcd(n, m); }\n if (m % n == 0) { return n; }\n return gcd(n, m%n);\n }\n\n static class FastReader {\n BufferedReader br;\n StringTokenizer st;\n\n public FastReader() {\n br = new BufferedReader(new InputStreamReader(System.in));\n }\n\n String next() {\n while (st == null || !st.hasMoreElements()) {\n try {\n st = new StringTokenizer(br.readLine());\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n return st.nextToken();\n }\n\n int nextInt() {\n return Integer.parseInt(next());\n }\n\n long nextLong() {\n return Long.parseLong(next());\n }\n\n double nextDouble() {\n return Double.parseDouble(next());\n }\n\n String nextLine() {\n String str = \"\";\n try{\n str = br.readLine();\n } catch (IOException e) {\n e.printStackTrace();\n }\n return str;\n }\n }\n}",
"Main",
"private static final int MOD = (int) Math.pow(10, 9);",
"MOD",
"(int) Math.pow(10, 9)",
"Math.pow",
"Math",
"10",
"9",
"private static final int[][] DIRS = {{0, 1}, {0, -1}, {1, 0}, {-1, 0}};",
"DIRS",
"{{0, 1}, {0, -1}, {1, 0}, {-1, 0}}",
"{0, 1}",
"0",
"1",
"{0, -1}",
"0",
"-1",
"1",
"{1, 0}",
"1",
"0",
"{-1, 0}",
"-1",
"1",
"0",
"public static void main(String[] args) {\n FastReader sc = new FastReader();\n int n = sc.nextInt();\n int m = sc.nextInt();\n int sum = 0;\n\n for (int i = 0; i < m;i++){\n sum += sc.nextInt();\n }\n\n if (sum > n) {\n print(\"-1\");\n } else {\n print(\"\" + (n - sum));\n }\n //print(\"\"+res);\n System.exit(0);\n }",
"main",
"{\n FastReader sc = new FastReader();\n int n = sc.nextInt();\n int m = sc.nextInt();\n int sum = 0;\n\n for (int i = 0; i < m;i++){\n sum += sc.nextInt();\n }\n\n if (sum > n) {\n print(\"-1\");\n } else {\n print(\"\" + (n - sum));\n }\n //print(\"\"+res);\n System.exit(0);\n }",
"FastReader sc = new FastReader();",
"sc",
"new FastReader()",
"int n = sc.nextInt();",
"n",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int m = sc.nextInt();",
"m",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int sum = 0;",
"sum",
"0",
"for (int i = 0; i < m;i++){\n sum += sc.nextInt();\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < m",
"i",
"m",
"i++",
"i++",
"i",
"{\n sum += sc.nextInt();\n }",
"{\n sum += sc.nextInt();\n }",
"sum += sc.nextInt()",
"sum",
"sc.nextInt()",
"sc.nextInt",
"sc",
"if (sum > n) {\n print(\"-1\");\n } else {\n print(\"\" + (n - sum));\n }",
"sum > n",
"sum",
"n",
"{\n print(\"-1\");\n }",
"print(\"-1\")",
"print",
"\"-1\"",
"{\n print(\"\" + (n - sum));\n }",
"print(\"\" + (n - sum))",
"print",
"\"\" + (n - sum)",
"\"\"",
"(n - sum)",
"n",
"sum",
"System.exit(0)",
"System.exit",
"System",
"0",
"String[] args",
"args",
"static private void swap(int[] nums, int x, int y) {\n int tmp = nums[x];\n nums[x] = nums[y];\n nums[y] = tmp;\n }",
"swap",
"{\n int tmp = nums[x];\n nums[x] = nums[y];\n nums[y] = tmp;\n }",
"int tmp = nums[x];",
"tmp",
"nums[x]",
"nums",
"x",
"nums[x] = nums[y]",
"nums[x]",
"nums",
"x",
"nums[y]",
"nums",
"y",
"nums[y] = tmp",
"nums[y]",
"nums",
"y",
"tmp",
"int[] nums",
"nums",
"int x",
"x",
"int y",
"y",
"static private void reverse(int[] nums, int left, int right) {\n while (left < right) {\n swap(nums, left, right);\n left++;\n right--;\n }\n }",
"reverse",
"{\n while (left < right) {\n swap(nums, left, right);\n left++;\n right--;\n }\n }",
"while (left < right) {\n swap(nums, left, right);\n left++;\n right--;\n }",
"left < right",
"left",
"right",
"{\n swap(nums, left, right);\n left++;\n right--;\n }",
"swap(nums, left, right)",
"swap",
"nums",
"left",
"right",
"left++",
"left",
"right--",
"right",
"int[] nums",
"nums",
"int left",
"left",
"int right",
"right",
"static private boolean findNextPermutation(int[] nums) {\n if (nums.length <= 1) {\n return false;\n }\n\n int last = nums.length - 2;\n\n while (last >= 0) {\n if (nums[last] < nums[last + 1]){\n break;\n }\n last--;\n }\n\n if (last < 0) { return false; }\n int nextGenerater = nums.length - 1;\n\n for (int i = nums.length - 1; i > last; i--) {\n if (nums[i] > nums[last]) {\n nextGenerater = i;\n break;\n }\n }\n\n swap(nums, nextGenerater, last);\n reverse(nums, last + 1, nums.length - 1);\n return true;\n }",
"findNextPermutation",
"{\n if (nums.length <= 1) {\n return false;\n }\n\n int last = nums.length - 2;\n\n while (last >= 0) {\n if (nums[last] < nums[last + 1]){\n break;\n }\n last--;\n }\n\n if (last < 0) { return false; }\n int nextGenerater = nums.length - 1;\n\n for (int i = nums.length - 1; i > last; i--) {\n if (nums[i] > nums[last]) {\n nextGenerater = i;\n break;\n }\n }\n\n swap(nums, nextGenerater, last);\n reverse(nums, last + 1, nums.length - 1);\n return true;\n }",
"if (nums.length <= 1) {\n return false;\n }",
"nums.length <= 1",
"nums.length",
"nums",
"nums.length",
"1",
"{\n return false;\n }",
"return false;",
"false",
"int last = nums.length - 2;",
"last",
"nums.length - 2",
"nums.length",
"nums",
"nums.length",
"2",
"while (last >= 0) {\n if (nums[last] < nums[last + 1]){\n break;\n }\n last--;\n }",
"last >= 0",
"last",
"0",
"{\n if (nums[last] < nums[last + 1]){\n break;\n }\n last--;\n }",
"if (nums[last] < nums[last + 1]){\n break;\n }",
"nums[last] < nums[last + 1]",
"nums[last]",
"nums",
"last",
"nums[last + 1]",
"nums",
"last + 1",
"last",
"1",
"{\n break;\n }",
"break;",
"last--",
"last",
"if (last < 0) { return false; }",
"last < 0",
"last",
"0",
"{ return false; }",
"return false;",
"false",
"int nextGenerater = nums.length - 1;",
"nextGenerater",
"nums.length - 1",
"nums.length",
"nums",
"nums.length",
"1",
"for (int i = nums.length - 1; i > last; i--) {\n if (nums[i] > nums[last]) {\n nextGenerater = i;\n break;\n }\n }",
"int i = nums.length - 1;",
"int i = nums.length - 1;",
"i",
"nums.length - 1",
"nums.length",
"nums",
"nums.length",
"1",
"i > last",
"i",
"last",
"i--",
"i--",
"i",
"{\n if (nums[i] > nums[last]) {\n nextGenerater = i;\n break;\n }\n }",
"{\n if (nums[i] > nums[last]) {\n nextGenerater = i;\n break;\n }\n }",
"if (nums[i] > nums[last]) {\n nextGenerater = i;\n break;\n }",
"nums[i] > nums[last]",
"nums[i]",
"nums",
"i",
"nums[last]",
"nums",
"last",
"{\n nextGenerater = i;\n break;\n }",
"nextGenerater = i",
"nextGenerater",
"i",
"break;",
"swap(nums, nextGenerater, last)",
"swap",
"nums",
"nextGenerater",
"last",
"reverse(nums, last + 1, nums.length - 1)",
"reverse",
"nums",
"last + 1",
"last",
"1",
"nums.length - 1",
"nums.length",
"nums",
"nums.length",
"1",
"return true;",
"true",
"int[] nums",
"nums",
"static private int[] generateNArray(int n) {\n int[] res = new int[n];\n\n for (int i = 0; i < n; i++) {\n res[i] = i + 1;\n }\n\n return res;\n }",
"generateNArray",
"{\n int[] res = new int[n];\n\n for (int i = 0; i < n; i++) {\n res[i] = i + 1;\n }\n\n return res;\n }",
"int[] res = new int[n];",
"res",
"new int[n]",
"n",
"for (int i = 0; i < n; i++) {\n res[i] = i + 1;\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < n",
"i",
"n",
"i++",
"i++",
"i",
"{\n res[i] = i + 1;\n }",
"{\n res[i] = i + 1;\n }",
"res[i] = i + 1",
"res[i]",
"res",
"i",
"i + 1",
"i",
"1",
"return res;",
"res",
"int n",
"n",
"static private void print(String s) {\n System.out.println(s);\n }",
"print",
"{\n System.out.println(s);\n }",
"System.out.println(s)",
"System.out.println",
"System.out",
"System",
"System.out",
"s",
"String s",
"s",
"static private void printArray(int[] e) {\n for (int s: e) {\n System.out.print(s + \" \");\n }\n print(\"\");\n }",
"printArray",
"{\n for (int s: e) {\n System.out.print(s + \" \");\n }\n print(\"\");\n }",
"for (int s: e) {\n System.out.print(s + \" \");\n }",
"int s",
"e",
"{\n System.out.print(s + \" \");\n }",
"{\n System.out.print(s + \" \");\n }",
"System.out.print(s + \" \")",
"System.out.print",
"System.out",
"System",
"System.out",
"s + \" \"",
"s",
"\" \"",
"print(\"\")",
"print",
"\"\"",
"int[] e",
"e",
"static private int log2(int x) {\n return (int)(Math.log(x) / Math.log(2));\n }",
"log2",
"{\n return (int)(Math.log(x) / Math.log(2));\n }",
"return (int)(Math.log(x) / Math.log(2));",
"(int)(Math.log(x) / Math.log(2))",
"Math.log(x)",
"Math.log",
"Math",
"x",
"Math.log(2)",
"Math.log",
"Math",
"2",
"int x",
"x",
"static private long gcd(long m, long n) {\n if (m < n) { return gcd(n, m); }\n if (m % n == 0) { return n; }\n return gcd(n, m%n);\n }",
"gcd",
"{\n if (m < n) { return gcd(n, m); }\n if (m % n == 0) { return n; }\n return gcd(n, m%n);\n }",
"if (m < n) { return gcd(n, m); }",
"m < n",
"m",
"n",
"{ return gcd(n, m); }",
"return gcd(n, m);",
"gcd(n, m)",
"gcd",
"n",
"m",
"if (m % n == 0) { return n; }",
"m % n == 0",
"m % n",
"m",
"n",
"0",
"{ return n; }",
"return n;",
"n",
"return gcd(n, m%n);",
"gcd(n, m%n)",
"gcd",
"n",
"m%n",
"m",
"n",
"long m",
"m",
"long n",
"n",
"static class FastReader {\n BufferedReader br;\n StringTokenizer st;\n\n public FastReader() {\n br = new BufferedReader(new InputStreamReader(System.in));\n }\n\n String next() {\n while (st == null || !st.hasMoreElements()) {\n try {\n st = new StringTokenizer(br.readLine());\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n return st.nextToken();\n }\n\n int nextInt() {\n return Integer.parseInt(next());\n }\n\n long nextLong() {\n return Long.parseLong(next());\n }\n\n double nextDouble() {\n return Double.parseDouble(next());\n }\n\n String nextLine() {\n String str = \"\";\n try{\n str = br.readLine();\n } catch (IOException e) {\n e.printStackTrace();\n }\n return str;\n }\n }",
"FastReader",
"BufferedReader br;",
"br",
"StringTokenizer st;",
"st",
"public FastReader() {\n br = new BufferedReader(new InputStreamReader(System.in));\n }",
"FastReader",
"{\n br = new BufferedReader(new InputStreamReader(System.in));\n }",
"br = new BufferedReader(new InputStreamReader(System.in))",
"br",
"new BufferedReader(new InputStreamReader(System.in))",
"String next() {\n while (st == null || !st.hasMoreElements()) {\n try {\n st = new StringTokenizer(br.readLine());\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n return st.nextToken();\n }",
"next",
"{\n while (st == null || !st.hasMoreElements()) {\n try {\n st = new StringTokenizer(br.readLine());\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n return st.nextToken();\n }",
"while (st == null || !st.hasMoreElements()) {\n try {\n st = new StringTokenizer(br.readLine());\n } catch (IOException e) {\n e.printStackTrace();\n }\n }",
"st == null || !st.hasMoreElements()",
"st == null",
"st",
"null",
"!st.hasMoreElements()",
"st.hasMoreElements()",
"st.hasMoreElements",
"st",
"{\n try {\n st = new StringTokenizer(br.readLine());\n } catch (IOException e) {\n e.printStackTrace();\n }\n }",
"try {\n st = new StringTokenizer(br.readLine());\n } catch (IOException e) {\n e.printStackTrace();\n }",
"catch (IOException e) {\n e.printStackTrace();\n }",
"IOException e",
"{\n e.printStackTrace();\n }",
"e.printStackTrace()",
"e.printStackTrace",
"e",
"{\n st = new StringTokenizer(br.readLine());\n }",
"st = new StringTokenizer(br.readLine())",
"st",
"new StringTokenizer(br.readLine())",
"return st.nextToken();",
"st.nextToken()",
"st.nextToken",
"st",
"int nextInt() {\n return Integer.parseInt(next());\n }",
"nextInt",
"{\n return Integer.parseInt(next());\n }",
"return Integer.parseInt(next());",
"Integer.parseInt(next())",
"Integer.parseInt",
"Integer",
"next()",
"next",
"long nextLong() {\n return Long.parseLong(next());\n }",
"nextLong",
"{\n return Long.parseLong(next());\n }",
"return Long.parseLong(next());",
"Long.parseLong(next())",
"Long.parseLong",
"Long",
"next()",
"next",
"double nextDouble() {\n return Double.parseDouble(next());\n }",
"nextDouble",
"{\n return Double.parseDouble(next());\n }",
"return Double.parseDouble(next());",
"Double.parseDouble(next())",
"Double.parseDouble",
"Double",
"next()",
"next",
"String nextLine() {\n String str = \"\";\n try{\n str = br.readLine();\n } catch (IOException e) {\n e.printStackTrace();\n }\n return str;\n }",
"nextLine",
"{\n String str = \"\";\n try{\n str = br.readLine();\n } catch (IOException e) {\n e.printStackTrace();\n }\n return str;\n }",
"String str = \"\";",
"str",
"\"\"",
"try{\n str = br.readLine();\n } catch (IOException e) {\n e.printStackTrace();\n }",
"catch (IOException e) {\n e.printStackTrace();\n }",
"IOException e",
"{\n e.printStackTrace();\n }",
"e.printStackTrace()",
"e.printStackTrace",
"e",
"{\n str = br.readLine();\n }",
"str = br.readLine()",
"str",
"br.readLine()",
"br.readLine",
"br",
"return str;",
"str",
"public class Main {\n private static final int MOD = (int) Math.pow(10, 9);\n private static final int[][] DIRS = {{0, 1}, {0, -1}, {1, 0}, {-1, 0}};\n\n public static void main(String[] args) {\n FastReader sc = new FastReader();\n int n = sc.nextInt();\n int m = sc.nextInt();\n int sum = 0;\n\n for (int i = 0; i < m;i++){\n sum += sc.nextInt();\n }\n\n if (sum > n) {\n print(\"-1\");\n } else {\n print(\"\" + (n - sum));\n }\n //print(\"\"+res);\n System.exit(0);\n }\n\n static private void swap(int[] nums, int x, int y) {\n int tmp = nums[x];\n nums[x] = nums[y];\n nums[y] = tmp;\n }\n\n static private void reverse(int[] nums, int left, int right) {\n while (left < right) {\n swap(nums, left, right);\n left++;\n right--;\n }\n }\n\n static private boolean findNextPermutation(int[] nums) {\n if (nums.length <= 1) {\n return false;\n }\n\n int last = nums.length - 2;\n\n while (last >= 0) {\n if (nums[last] < nums[last + 1]){\n break;\n }\n last--;\n }\n\n if (last < 0) { return false; }\n int nextGenerater = nums.length - 1;\n\n for (int i = nums.length - 1; i > last; i--) {\n if (nums[i] > nums[last]) {\n nextGenerater = i;\n break;\n }\n }\n\n swap(nums, nextGenerater, last);\n reverse(nums, last + 1, nums.length - 1);\n return true;\n }\n\n static private int[] generateNArray(int n) {\n int[] res = new int[n];\n\n for (int i = 0; i < n; i++) {\n res[i] = i + 1;\n }\n\n return res;\n }\n\n static private void print(String s) {\n System.out.println(s);\n }\n\n static private void printArray(int[] e) {\n for (int s: e) {\n System.out.print(s + \" \");\n }\n print(\"\");\n }\n\n static private int log2(int x) {\n return (int)(Math.log(x) / Math.log(2));\n }\n\n static private long gcd(long m, long n) {\n if (m < n) { return gcd(n, m); }\n if (m % n == 0) { return n; }\n return gcd(n, m%n);\n }\n\n static class FastReader {\n BufferedReader br;\n StringTokenizer st;\n\n public FastReader() {\n br = new BufferedReader(new InputStreamReader(System.in));\n }\n\n String next() {\n while (st == null || !st.hasMoreElements()) {\n try {\n st = new StringTokenizer(br.readLine());\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n return st.nextToken();\n }\n\n int nextInt() {\n return Integer.parseInt(next());\n }\n\n long nextLong() {\n return Long.parseLong(next());\n }\n\n double nextDouble() {\n return Double.parseDouble(next());\n }\n\n String nextLine() {\n String str = \"\";\n try{\n str = br.readLine();\n } catch (IOException e) {\n e.printStackTrace();\n }\n return str;\n }\n }\n}",
"public class Main {\n private static final int MOD = (int) Math.pow(10, 9);\n private static final int[][] DIRS = {{0, 1}, {0, -1}, {1, 0}, {-1, 0}};\n\n public static void main(String[] args) {\n FastReader sc = new FastReader();\n int n = sc.nextInt();\n int m = sc.nextInt();\n int sum = 0;\n\n for (int i = 0; i < m;i++){\n sum += sc.nextInt();\n }\n\n if (sum > n) {\n print(\"-1\");\n } else {\n print(\"\" + (n - sum));\n }\n //print(\"\"+res);\n System.exit(0);\n }\n\n static private void swap(int[] nums, int x, int y) {\n int tmp = nums[x];\n nums[x] = nums[y];\n nums[y] = tmp;\n }\n\n static private void reverse(int[] nums, int left, int right) {\n while (left < right) {\n swap(nums, left, right);\n left++;\n right--;\n }\n }\n\n static private boolean findNextPermutation(int[] nums) {\n if (nums.length <= 1) {\n return false;\n }\n\n int last = nums.length - 2;\n\n while (last >= 0) {\n if (nums[last] < nums[last + 1]){\n break;\n }\n last--;\n }\n\n if (last < 0) { return false; }\n int nextGenerater = nums.length - 1;\n\n for (int i = nums.length - 1; i > last; i--) {\n if (nums[i] > nums[last]) {\n nextGenerater = i;\n break;\n }\n }\n\n swap(nums, nextGenerater, last);\n reverse(nums, last + 1, nums.length - 1);\n return true;\n }\n\n static private int[] generateNArray(int n) {\n int[] res = new int[n];\n\n for (int i = 0; i < n; i++) {\n res[i] = i + 1;\n }\n\n return res;\n }\n\n static private void print(String s) {\n System.out.println(s);\n }\n\n static private void printArray(int[] e) {\n for (int s: e) {\n System.out.print(s + \" \");\n }\n print(\"\");\n }\n\n static private int log2(int x) {\n return (int)(Math.log(x) / Math.log(2));\n }\n\n static private long gcd(long m, long n) {\n if (m < n) { return gcd(n, m); }\n if (m % n == 0) { return n; }\n return gcd(n, m%n);\n }\n\n static class FastReader {\n BufferedReader br;\n StringTokenizer st;\n\n public FastReader() {\n br = new BufferedReader(new InputStreamReader(System.in));\n }\n\n String next() {\n while (st == null || !st.hasMoreElements()) {\n try {\n st = new StringTokenizer(br.readLine());\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n return st.nextToken();\n }\n\n int nextInt() {\n return Integer.parseInt(next());\n }\n\n long nextLong() {\n return Long.parseLong(next());\n }\n\n double nextDouble() {\n return Double.parseDouble(next());\n }\n\n String nextLine() {\n String str = \"\";\n try{\n str = br.readLine();\n } catch (IOException e) {\n e.printStackTrace();\n }\n return str;\n }\n }\n}",
"Main"
] |
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.*;
public class Main {
private static final int MOD = (int) Math.pow(10, 9);
private static final int[][] DIRS = {{0, 1}, {0, -1}, {1, 0}, {-1, 0}};
public static void main(String[] args) {
FastReader sc = new FastReader();
int n = sc.nextInt();
int m = sc.nextInt();
int sum = 0;
for (int i = 0; i < m;i++){
sum += sc.nextInt();
}
if (sum > n) {
print("-1");
} else {
print("" + (n - sum));
}
//print(""+res);
System.exit(0);
}
static private void swap(int[] nums, int x, int y) {
int tmp = nums[x];
nums[x] = nums[y];
nums[y] = tmp;
}
static private void reverse(int[] nums, int left, int right) {
while (left < right) {
swap(nums, left, right);
left++;
right--;
}
}
static private boolean findNextPermutation(int[] nums) {
if (nums.length <= 1) {
return false;
}
int last = nums.length - 2;
while (last >= 0) {
if (nums[last] < nums[last + 1]){
break;
}
last--;
}
if (last < 0) { return false; }
int nextGenerater = nums.length - 1;
for (int i = nums.length - 1; i > last; i--) {
if (nums[i] > nums[last]) {
nextGenerater = i;
break;
}
}
swap(nums, nextGenerater, last);
reverse(nums, last + 1, nums.length - 1);
return true;
}
static private int[] generateNArray(int n) {
int[] res = new int[n];
for (int i = 0; i < n; i++) {
res[i] = i + 1;
}
return res;
}
static private void print(String s) {
System.out.println(s);
}
static private void printArray(int[] e) {
for (int s: e) {
System.out.print(s + " ");
}
print("");
}
static private int log2(int x) {
return (int)(Math.log(x) / Math.log(2));
}
static private long gcd(long m, long n) {
if (m < n) { return gcd(n, m); }
if (m % n == 0) { return n; }
return gcd(n, m%n);
}
static class FastReader {
BufferedReader br;
StringTokenizer st;
public FastReader() {
br = new BufferedReader(new InputStreamReader(System.in));
}
String next() {
while (st == null || !st.hasMoreElements()) {
try {
st = new StringTokenizer(br.readLine());
} catch (IOException e) {
e.printStackTrace();
}
}
return st.nextToken();
}
int nextInt() {
return Integer.parseInt(next());
}
long nextLong() {
return Long.parseLong(next());
}
double nextDouble() {
return Double.parseDouble(next());
}
String nextLine() {
String str = "";
try{
str = br.readLine();
} catch (IOException e) {
e.printStackTrace();
}
return str;
}
}
}
|
[
7,
15,
13,
17,
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,
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,
14,
2,
13,
13,
30,
4,
18,
18,
13,
13,
17,
30,
4,
18,
18,
13,
13,
2,
13,
13,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
91,
5
],
[
91,
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
],
[
39,
40
],
[
40,
41
],
[
41,
42
],
[
38,
43
],
[
8,
44
],
[
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
],
[
62,
63
],
[
63,
64
],
[
62,
65
],
[
65,
66
],
[
65,
67
],
[
8,
68
],
[
68,
69
],
[
69,
70
],
[
69,
71
],
[
68,
72
],
[
72,
73
],
[
73,
74
],
[
74,
75
],
[
75,
76
],
[
75,
77
],
[
73,
78
],
[
68,
79
],
[
79,
80
],
[
80,
81
],
[
81,
82
],
[
82,
83
],
[
82,
84
],
[
80,
85
],
[
85,
86
],
[
85,
87
],
[
6,
88
],
[
88,
89
],
[
0,
90
],
[
90,
91
],
[
90,
92
]
] |
[
"import java.util.Scanner;\n\npublic class Main {\n public static void main(String[] main) {\n Scanner input = new Scanner(System.in);\n String[] ss = input.nextLine().split(\" \");\n int n = Integer.parseInt(ss[0]);\n int m = Integer.parseInt(ss[1]);\n ss = input.nextLine().split(\" \");\n int total = 0;\n for (int i = 0; i < m; i++) {\n total += Integer.parseInt(ss[i]);\n }\n if (n < total) {\n System.out.println(\"-1\");\n } else {\n System.out.println(n - total);\n }\n }\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n public static void main(String[] main) {\n Scanner input = new Scanner(System.in);\n String[] ss = input.nextLine().split(\" \");\n int n = Integer.parseInt(ss[0]);\n int m = Integer.parseInt(ss[1]);\n ss = input.nextLine().split(\" \");\n int total = 0;\n for (int i = 0; i < m; i++) {\n total += Integer.parseInt(ss[i]);\n }\n if (n < total) {\n System.out.println(\"-1\");\n } else {\n System.out.println(n - total);\n }\n }\n}",
"Main",
"public static void main(String[] main) {\n Scanner input = new Scanner(System.in);\n String[] ss = input.nextLine().split(\" \");\n int n = Integer.parseInt(ss[0]);\n int m = Integer.parseInt(ss[1]);\n ss = input.nextLine().split(\" \");\n int total = 0;\n for (int i = 0; i < m; i++) {\n total += Integer.parseInt(ss[i]);\n }\n if (n < total) {\n System.out.println(\"-1\");\n } else {\n System.out.println(n - total);\n }\n }",
"main",
"{\n Scanner input = new Scanner(System.in);\n String[] ss = input.nextLine().split(\" \");\n int n = Integer.parseInt(ss[0]);\n int m = Integer.parseInt(ss[1]);\n ss = input.nextLine().split(\" \");\n int total = 0;\n for (int i = 0; i < m; i++) {\n total += Integer.parseInt(ss[i]);\n }\n if (n < total) {\n System.out.println(\"-1\");\n } else {\n System.out.println(n - total);\n }\n }",
"Scanner input = new Scanner(System.in);",
"input",
"new Scanner(System.in)",
"String[] ss = input.nextLine().split(\" \");",
"ss",
"input.nextLine().split(\" \")",
"input.nextLine().split",
"input.nextLine()",
"input.nextLine",
"input",
"\" \"",
"int n = Integer.parseInt(ss[0]);",
"n",
"Integer.parseInt(ss[0])",
"Integer.parseInt",
"Integer",
"ss[0]",
"ss",
"0",
"int m = Integer.parseInt(ss[1]);",
"m",
"Integer.parseInt(ss[1])",
"Integer.parseInt",
"Integer",
"ss[1]",
"ss",
"1",
"ss = input.nextLine().split(\" \")",
"ss",
"input.nextLine().split(\" \")",
"input.nextLine().split",
"input.nextLine()",
"input.nextLine",
"input",
"\" \"",
"int total = 0;",
"total",
"0",
"for (int i = 0; i < m; i++) {\n total += Integer.parseInt(ss[i]);\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < m",
"i",
"m",
"i++",
"i++",
"i",
"{\n total += Integer.parseInt(ss[i]);\n }",
"{\n total += Integer.parseInt(ss[i]);\n }",
"total += Integer.parseInt(ss[i])",
"total",
"Integer.parseInt(ss[i])",
"Integer.parseInt",
"Integer",
"ss[i]",
"ss",
"i",
"if (n < total) {\n System.out.println(\"-1\");\n } else {\n System.out.println(n - total);\n }",
"n < total",
"n",
"total",
"{\n System.out.println(\"-1\");\n }",
"System.out.println(\"-1\")",
"System.out.println",
"System.out",
"System",
"System.out",
"\"-1\"",
"{\n System.out.println(n - total);\n }",
"System.out.println(n - total)",
"System.out.println",
"System.out",
"System",
"System.out",
"n - total",
"n",
"total",
"String[] main",
"main",
"public class Main {\n public static void main(String[] main) {\n Scanner input = new Scanner(System.in);\n String[] ss = input.nextLine().split(\" \");\n int n = Integer.parseInt(ss[0]);\n int m = Integer.parseInt(ss[1]);\n ss = input.nextLine().split(\" \");\n int total = 0;\n for (int i = 0; i < m; i++) {\n total += Integer.parseInt(ss[i]);\n }\n if (n < total) {\n System.out.println(\"-1\");\n } else {\n System.out.println(n - total);\n }\n }\n}",
"public class Main {\n public static void main(String[] main) {\n Scanner input = new Scanner(System.in);\n String[] ss = input.nextLine().split(\" \");\n int n = Integer.parseInt(ss[0]);\n int m = Integer.parseInt(ss[1]);\n ss = input.nextLine().split(\" \");\n int total = 0;\n for (int i = 0; i < m; i++) {\n total += Integer.parseInt(ss[i]);\n }\n if (n < total) {\n System.out.println(\"-1\");\n } else {\n System.out.println(n - total);\n }\n }\n}",
"Main"
] |
import java.util.Scanner;
public class Main {
public static void main(String[] main) {
Scanner input = new Scanner(System.in);
String[] ss = input.nextLine().split(" ");
int n = Integer.parseInt(ss[0]);
int m = Integer.parseInt(ss[1]);
ss = input.nextLine().split(" ");
int total = 0;
for (int i = 0; i < m; i++) {
total += Integer.parseInt(ss[i]);
}
if (n < total) {
System.out.println("-1");
} else {
System.out.println(n - total);
}
}
}
|
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
41,
13,
41,
13,
17,
41,
13,
17,
41,
13,
13,
41,
13,
17,
41,
13,
41,
13,
12,
13,
30,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
13,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
18,
13,
13,
4,
18,
18,
13,
13,
4,
18,
13,
40,
17,
2,
13,
13,
12,
13,
30,
14,
2,
13,
13,
30,
38,
5,
13,
30,
4,
18,
13,
30,
0,
13,
20,
4,
18,
18,
13,
13,
17,
30,
0,
13,
18,
13,
13,
0,
13,
20,
0,
13,
20,
4,
13,
12,
13,
30,
4,
18,
20,
23,
13,
6,
13,
41,
13,
41,
13,
20,
17,
41,
13,
41,
13,
12,
13,
30,
0,
18,
36,
13,
13,
23,
13,
12,
13,
30,
14,
2,
13,
40,
17,
37,
20,
14,
2,
13,
13,
30,
0,
13,
17,
38,
5,
13,
30,
37,
20,
30,
0,
13,
4,
18,
13,
13,
14,
2,
13,
17,
29,
40,
17,
29,
18,
13,
40,
13,
12,
13,
30,
29,
2,
2,
2,
2,
2,
13,
17,
2,
13,
17,
2,
13,
17,
2,
13,
17,
2,
13,
40,
17,
23,
13,
12,
13,
30,
29,
2,
2,
2,
13,
17,
2,
13,
17,
2,
13,
40,
17,
23,
13,
12,
13,
30,
29,
4,
18,
13,
4,
13,
12,
13,
30,
41,
13,
20,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
0,
18,
13,
13,
4,
13,
29,
13,
23,
13,
12,
13,
30,
41,
13,
20,
13,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
18,
13,
13,
4,
13,
13,
29,
13,
23,
13,
23,
13,
12,
13,
30,
29,
4,
18,
13,
4,
13,
12,
13,
30,
41,
13,
20,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
0,
18,
13,
13,
4,
13,
29,
13,
23,
13,
12,
13,
30,
41,
13,
20,
13,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
18,
13,
13,
4,
13,
13,
29,
13,
23,
13,
23,
13,
12,
13,
30,
29,
4,
18,
13,
4,
13,
12,
13,
30,
41,
13,
20,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
0,
18,
13,
13,
4,
13,
29,
13,
23,
13,
12,
13,
30,
41,
13,
20,
13,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
18,
13,
13,
4,
13,
13,
29,
13,
23,
13,
23,
13,
12,
13,
30,
41,
13,
4,
13,
42,
4,
13,
13,
0,
13,
4,
13,
41,
13,
20,
42,
40,
4,
13,
13,
30,
4,
18,
13,
13,
0,
13,
4,
13,
29,
4,
18,
13,
12,
13,
30,
41,
13,
20,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
0,
18,
13,
13,
4,
13,
29,
13,
23,
13,
12,
13,
30,
41,
13,
4,
13,
42,
4,
13,
13,
0,
13,
4,
13,
41,
13,
20,
42,
40,
4,
13,
13,
30,
4,
18,
13,
13,
0,
13,
4,
13,
29,
4,
18,
13,
12,
13,
30,
41,
13,
20,
13,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
18,
18,
13,
13,
13,
4,
13,
29,
13,
23,
13,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
10,
11
],
[
10,
12
],
[
0,
13
],
[
13,
14
],
[
13,
15
],
[
0,
16
],
[
16,
17
],
[
16,
18
],
[
0,
19
],
[
614,
20
],
[
614,
21
],
[
21,
22
],
[
614,
23
],
[
23,
24
],
[
23,
25
],
[
614,
26
],
[
26,
27
],
[
26,
28
],
[
614,
29
],
[
29,
30
],
[
29,
31
],
[
614,
32
],
[
32,
33
],
[
32,
34
],
[
614,
35
],
[
35,
36
],
[
614,
37
],
[
37,
38
],
[
614,
39
],
[
39,
40
],
[
39,
41
],
[
41,
42
],
[
42,
43
],
[
42,
44
],
[
44,
45
],
[
45,
46
],
[
41,
47
],
[
47,
48
],
[
47,
49
],
[
49,
50
],
[
50,
51
],
[
41,
52
],
[
52,
53
],
[
52,
54
],
[
54,
55
],
[
55,
56
],
[
54,
57
],
[
41,
58
],
[
58,
59
],
[
58,
60
],
[
41,
61
],
[
61,
62
],
[
62,
63
],
[
63,
64
],
[
63,
65
],
[
61,
66
],
[
66,
67
],
[
66,
68
],
[
61,
69
],
[
69,
70
],
[
70,
71
],
[
61,
72
],
[
73,
73
],
[
73,
74
],
[
74,
75
],
[
74,
76
],
[
76,
77
],
[
76,
78
],
[
41,
79
],
[
79,
80
],
[
80,
81
],
[
81,
82
],
[
81,
83
],
[
79,
84
],
[
84,
85
],
[
85,
86
],
[
84,
87
],
[
87,
88
],
[
84,
89
],
[
89,
90
],
[
89,
91
],
[
614,
92
],
[
92,
93
],
[
92,
94
],
[
94,
95
],
[
95,
96
],
[
96,
97
],
[
96,
98
],
[
95,
99
],
[
99,
100
],
[
100,
101
],
[
101,
102
],
[
101,
103
],
[
103,
104
],
[
104,
105
],
[
105,
106
],
[
100,
107
],
[
107,
108
],
[
108,
109
],
[
108,
110
],
[
99,
111
],
[
111,
112
],
[
112,
113
],
[
113,
114
],
[
113,
115
],
[
111,
116
],
[
95,
117
],
[
117,
118
],
[
118,
119
],
[
118,
120
],
[
120,
121
],
[
120,
122
],
[
94,
123
],
[
123,
124
],
[
123,
125
],
[
94,
126
],
[
126,
127
],
[
126,
128
],
[
94,
129
],
[
129,
130
],
[
614,
131
],
[
131,
132
],
[
131,
133
],
[
133,
134
],
[
134,
135
],
[
135,
136
],
[
131,
137
],
[
137,
138
],
[
0,
139
],
[
139,
140
],
[
139,
141
],
[
141,
142
],
[
139,
143
],
[
143,
144
],
[
143,
145
],
[
139,
147
],
[
147,
148
],
[
139,
149
],
[
149,
150
],
[
139,
151
],
[
151,
152
],
[
151,
153
],
[
153,
154
],
[
154,
155
],
[
155,
156
],
[
155,
157
],
[
154,
158
],
[
151,
159
],
[
159,
160
],
[
139,
161
],
[
161,
162
],
[
161,
163
],
[
163,
164
],
[
164,
165
],
[
165,
166
],
[
165,
167
],
[
167,
168
],
[
164,
169
],
[
169,
170
],
[
163,
171
],
[
171,
172
],
[
172,
173
],
[
172,
174
],
[
171,
175
],
[
175,
176
],
[
176,
177
],
[
176,
178
],
[
175,
179
],
[
179,
180
],
[
180,
181
],
[
180,
182
],
[
182,
183
],
[
183,
184
],
[
179,
185
],
[
185,
186
],
[
186,
187
],
[
186,
188
],
[
188,
189
],
[
189,
190
],
[
188,
191
],
[
175,
192
],
[
192,
193
],
[
193,
194
],
[
193,
195
],
[
192,
196
],
[
196,
197
],
[
197,
198
],
[
163,
199
],
[
199,
200
],
[
200,
201
],
[
200,
202
],
[
202,
203
],
[
139,
204
],
[
204,
205
],
[
204,
206
],
[
206,
207
],
[
207,
208
],
[
211,
209
],
[
221,
210
],
[
218,
211
],
[
211,
212
],
[
212,
213
],
[
212,
214
],
[
211,
215
],
[
215,
216
],
[
215,
217
],
[
218,
218
],
[
218,
219
],
[
218,
220
],
[
221,
221
],
[
221,
222
],
[
221,
223
],
[
211,
224
],
[
224,
225
],
[
224,
226
],
[
226,
227
],
[
204,
228
],
[
228,
229
],
[
139,
230
],
[
230,
231
],
[
230,
232
],
[
232,
233
],
[
233,
234
],
[
235,
235
],
[
235,
236
],
[
236,
237
],
[
236,
238
],
[
235,
239
],
[
239,
240
],
[
239,
241
],
[
235,
242
],
[
242,
243
],
[
242,
244
],
[
244,
245
],
[
230,
246
],
[
246,
247
],
[
139,
248
],
[
248,
249
],
[
248,
250
],
[
250,
251
],
[
251,
252
],
[
252,
253
],
[
253,
254
],
[
252,
255
],
[
255,
256
],
[
139,
257
],
[
257,
258
],
[
257,
259
],
[
259,
260
],
[
260,
261
],
[
260,
262
],
[
259,
264
],
[
264,
265
],
[
265,
266
],
[
266,
267
],
[
266,
268
],
[
264,
269
],
[
269,
270
],
[
269,
271
],
[
264,
272
],
[
272,
273
],
[
273,
274
],
[
264,
275
],
[
275,
276
],
[
276,
277
],
[
277,
278
],
[
277,
279
],
[
276,
280
],
[
280,
281
],
[
259,
282
],
[
282,
283
],
[
257,
284
],
[
284,
285
],
[
139,
286
],
[
286,
287
],
[
286,
288
],
[
288,
289
],
[
289,
290
],
[
289,
291
],
[
288,
294
],
[
294,
295
],
[
295,
296
],
[
296,
297
],
[
296,
298
],
[
294,
299
],
[
299,
300
],
[
299,
301
],
[
294,
302
],
[
302,
303
],
[
303,
304
],
[
294,
305
],
[
306,
306
],
[
306,
307
],
[
307,
308
],
[
308,
309
],
[
308,
310
],
[
307,
311
],
[
311,
312
],
[
311,
313
],
[
288,
314
],
[
314,
315
],
[
286,
316
],
[
316,
317
],
[
286,
318
],
[
318,
319
],
[
139,
320
],
[
320,
321
],
[
320,
322
],
[
322,
323
],
[
323,
324
],
[
324,
325
],
[
325,
326
],
[
324,
327
],
[
327,
328
],
[
139,
329
],
[
329,
330
],
[
329,
331
],
[
331,
332
],
[
332,
333
],
[
332,
334
],
[
331,
336
],
[
336,
337
],
[
337,
338
],
[
338,
339
],
[
338,
340
],
[
336,
341
],
[
341,
342
],
[
341,
343
],
[
336,
344
],
[
344,
345
],
[
345,
346
],
[
336,
347
],
[
347,
348
],
[
348,
349
],
[
349,
350
],
[
349,
351
],
[
348,
352
],
[
352,
353
],
[
331,
354
],
[
354,
355
],
[
329,
356
],
[
356,
357
],
[
139,
358
],
[
358,
359
],
[
358,
360
],
[
360,
361
],
[
361,
362
],
[
361,
363
],
[
360,
366
],
[
366,
367
],
[
367,
368
],
[
368,
369
],
[
368,
370
],
[
366,
371
],
[
371,
372
],
[
371,
373
],
[
366,
374
],
[
374,
375
],
[
375,
376
],
[
366,
377
],
[
378,
378
],
[
378,
379
],
[
379,
380
],
[
380,
381
],
[
380,
382
],
[
379,
383
],
[
383,
384
],
[
383,
385
],
[
360,
386
],
[
386,
387
],
[
358,
388
],
[
388,
389
],
[
358,
390
],
[
390,
391
],
[
139,
392
],
[
392,
393
],
[
392,
394
],
[
394,
395
],
[
395,
396
],
[
396,
397
],
[
397,
398
],
[
396,
399
],
[
399,
400
],
[
139,
401
],
[
401,
402
],
[
401,
403
],
[
403,
404
],
[
404,
405
],
[
404,
406
],
[
403,
408
],
[
408,
409
],
[
409,
410
],
[
410,
411
],
[
410,
412
],
[
408,
413
],
[
413,
414
],
[
413,
415
],
[
408,
416
],
[
416,
417
],
[
417,
418
],
[
408,
419
],
[
419,
420
],
[
420,
421
],
[
421,
422
],
[
421,
423
],
[
420,
424
],
[
424,
425
],
[
403,
426
],
[
426,
427
],
[
401,
428
],
[
428,
429
],
[
139,
430
],
[
430,
431
],
[
430,
432
],
[
432,
433
],
[
433,
434
],
[
433,
435
],
[
432,
438
],
[
438,
439
],
[
439,
440
],
[
440,
441
],
[
440,
442
],
[
438,
443
],
[
443,
444
],
[
443,
445
],
[
438,
446
],
[
446,
447
],
[
447,
448
],
[
438,
449
],
[
450,
450
],
[
450,
451
],
[
451,
452
],
[
452,
453
],
[
452,
454
],
[
451,
455
],
[
455,
456
],
[
455,
457
],
[
432,
458
],
[
458,
459
],
[
430,
460
],
[
460,
461
],
[
430,
462
],
[
462,
463
],
[
139,
464
],
[
464,
465
],
[
464,
466
],
[
466,
467
],
[
467,
468
],
[
467,
469
],
[
469,
470
],
[
466,
471
],
[
471,
472
],
[
472,
473
],
[
472,
474
],
[
471,
475
],
[
475,
476
],
[
475,
477
],
[
477,
478
],
[
466,
479
],
[
479,
480
],
[
479,
481
],
[
466,
482
],
[
482,
483
],
[
483,
484
],
[
484,
485
],
[
484,
486
],
[
482,
487
],
[
487,
488
],
[
488,
489
],
[
489,
490
],
[
488,
491
],
[
487,
492
],
[
492,
493
],
[
492,
494
],
[
494,
495
],
[
466,
496
],
[
496,
497
],
[
497,
498
],
[
498,
499
],
[
139,
500
],
[
500,
501
],
[
500,
502
],
[
502,
503
],
[
503,
504
],
[
503,
505
],
[
502,
507
],
[
507,
508
],
[
508,
509
],
[
509,
510
],
[
509,
511
],
[
507,
512
],
[
512,
513
],
[
512,
514
],
[
507,
515
],
[
515,
516
],
[
516,
517
],
[
507,
518
],
[
518,
519
],
[
519,
520
],
[
520,
521
],
[
520,
522
],
[
519,
523
],
[
523,
524
],
[
502,
525
],
[
525,
526
],
[
500,
527
],
[
527,
528
],
[
139,
529
],
[
529,
530
],
[
529,
531
],
[
531,
532
],
[
532,
533
],
[
532,
534
],
[
534,
535
],
[
531,
536
],
[
536,
537
],
[
537,
538
],
[
537,
539
],
[
536,
540
],
[
540,
541
],
[
540,
542
],
[
542,
543
],
[
531,
544
],
[
544,
545
],
[
544,
546
],
[
531,
547
],
[
547,
548
],
[
548,
549
],
[
549,
550
],
[
549,
551
],
[
547,
552
],
[
552,
553
],
[
553,
554
],
[
554,
555
],
[
553,
556
],
[
552,
557
],
[
557,
558
],
[
557,
559
],
[
559,
560
],
[
531,
561
],
[
561,
562
],
[
562,
563
],
[
563,
564
],
[
139,
565
],
[
565,
566
],
[
565,
567
],
[
567,
568
],
[
568,
569
],
[
568,
570
],
[
567,
573
],
[
573,
574
],
[
574,
575
],
[
575,
576
],
[
575,
577
],
[
573,
578
],
[
578,
579
],
[
578,
580
],
[
573,
581
],
[
581,
582
],
[
582,
583
],
[
573,
584
],
[
585,
585
],
[
585,
586
],
[
586,
587
],
[
587,
588
],
[
588,
589
],
[
588,
590
],
[
586,
591
],
[
591,
592
],
[
591,
593
],
[
586,
594
],
[
594,
595
],
[
595,
596
],
[
586,
597
],
[
598,
598
],
[
598,
599
],
[
599,
600
],
[
600,
601
],
[
601,
602
],
[
601,
603
],
[
600,
604
],
[
599,
605
],
[
605,
606
],
[
567,
607
],
[
607,
608
],
[
565,
609
],
[
609,
610
],
[
565,
611
],
[
611,
612
],
[
0,
613
],
[
613,
614
],
[
613,
615
]
] |
[
"import java.io.InputStream;\nimport java.io.IOException;\nimport java.util.InputMismatchException;\nimport java.io.FileNotFoundException;\nimport java.io.PrintWriter;\nimport java.io.FileInputStream;\n\npublic class Main {\n InputStream is;\n\n int __t__ = 1;\n int __f__ = 0;\n int __FILE_DEBUG_FLAG__ = __f__;\n String __DEBUG_FILE_NAME__ = \"src/F5\";\n\n FastScanner in;\n PrintWriter out;\n\n public void solve() {\n int n = in.nextInt();\n int m = in.nextInt();\n int[] a = in.nextIntArray(m);\n int sum = 0;\n for (int i = 0; i < m; i++) {\n sum += a[i];\n }\n System.out.println(Math.max(-1, n - sum));\n }\n\n public void run() {\n if (__FILE_DEBUG_FLAG__ == __t__) {\n try {\n is = new FileInputStream(__DEBUG_FILE_NAME__);\n } catch (FileNotFoundException e) {\n e.printStackTrace();\n }\n System.out.println(\"FILE_INPUT!\");\n } else {\n is = System.in;\n }\n in = new FastScanner(is);\n out = new PrintWriter(System.out);\n\n solve();\n }\n\n public static void main(final String[] args) {\n new Main().run();\n }\n}\n\n\nclass FastScanner {\n private InputStream stream;\n private byte[] buf = new byte[1024];\n private int curChar;\n private int numChars;\n\n public FastScanner(InputStream stream) {\n this.stream = stream;\n // stream = new FileInputStream(new File(\"dec.in\"));\n }\n\n int read() {\n if (numChars == -1)\n throw new InputMismatchException();\n if (curChar >= numChars) {\n curChar = 0;\n try {\n numChars = stream.read(buf);\n } catch (IOException e) {\n throw new InputMismatchException();\n }\n if (numChars <= 0)\n return -1;\n }\n return buf[curChar++];\n }\n\n public boolean isSpaceChar(int c) {\n return c == ' ' || c == '\\n' || c == '\\r' || c == '\\t' || c == -1;\n }\n\n public boolean isEndline(int c) {\n return c == '\\n' || c == '\\r' || c == -1;\n }\n\n public int nextInt() {\n return Integer.parseInt(next());\n }\n\n public int[] nextIntArray(int n) {\n int[] array = new int[n];\n for (int i = 0; i < n; i++)\n array[i] = nextInt();\n\n return array;\n }\n\n public int[][] nextIntMap(int n, int m) {\n int[][] map = new int[n][m];\n for (int i = 0; i < n; i++) {\n map[i] = nextIntArray(m);\n }\n return map;\n }\n\n public long nextLong() {\n return Long.parseLong(next());\n }\n\n public long[] nextLongArray(int n) {\n long[] array = new long[n];\n for (int i = 0; i < n; i++)\n array[i] = nextLong();\n\n return array;\n }\n\n public long[][] nextLongMap(int n, int m) {\n long[][] map = new long[n][m];\n for (int i = 0; i < n; i++) {\n map[i] = nextLongArray(m);\n }\n return map;\n }\n\n public double nextDouble() {\n return Double.parseDouble(next());\n }\n\n public double[] nextDoubleArray(int n) {\n double[] array = new double[n];\n for (int i = 0; i < n; i++)\n array[i] = nextDouble();\n\n return array;\n }\n\n public double[][] nextDoubleMap(int n, int m) {\n double[][] map = new double[n][m];\n for (int i = 0; i < n; i++) {\n map[i] = nextDoubleArray(m);\n }\n return map;\n }\n\n public String next() {\n int c = read();\n while (isSpaceChar(c))\n c = read();\n StringBuilder res = new StringBuilder();\n do {\n res.appendCodePoint(c);\n c = read();\n } while (!isSpaceChar(c));\n return res.toString();\n }\n\n public String[] nextStringArray(int n) {\n String[] array = new String[n];\n for (int i = 0; i < n; i++)\n array[i] = next();\n\n return array;\n }\n\n public String nextLine() {\n int c = read();\n while (isEndline(c))\n c = read();\n StringBuilder res = new StringBuilder();\n do {\n res.appendCodePoint(c);\n c = read();\n } while (!isEndline(c));\n return res.toString();\n }\n\n public int[][] nextPackedIntArrays(int packN, int size) {\n int[][] res = new int[packN][size];\n for (int i = 0; i < size; i++) {\n for (int j = 0; j < packN; j++) {\n res[j][i] = nextInt();\n }\n }\n return res;\n }\n}",
"import java.io.InputStream;",
"InputStream",
"java.io",
"import java.io.IOException;",
"IOException",
"java.io",
"import java.util.InputMismatchException;",
"InputMismatchException",
"java.util",
"import java.io.FileNotFoundException;",
"FileNotFoundException",
"java.io",
"import java.io.PrintWriter;",
"PrintWriter",
"java.io",
"import java.io.FileInputStream;",
"FileInputStream",
"java.io",
"public class Main {\n InputStream is;\n\n int __t__ = 1;\n int __f__ = 0;\n int __FILE_DEBUG_FLAG__ = __f__;\n String __DEBUG_FILE_NAME__ = \"src/F5\";\n\n FastScanner in;\n PrintWriter out;\n\n public void solve() {\n int n = in.nextInt();\n int m = in.nextInt();\n int[] a = in.nextIntArray(m);\n int sum = 0;\n for (int i = 0; i < m; i++) {\n sum += a[i];\n }\n System.out.println(Math.max(-1, n - sum));\n }\n\n public void run() {\n if (__FILE_DEBUG_FLAG__ == __t__) {\n try {\n is = new FileInputStream(__DEBUG_FILE_NAME__);\n } catch (FileNotFoundException e) {\n e.printStackTrace();\n }\n System.out.println(\"FILE_INPUT!\");\n } else {\n is = System.in;\n }\n in = new FastScanner(is);\n out = new PrintWriter(System.out);\n\n solve();\n }\n\n public static void main(final String[] args) {\n new Main().run();\n }\n}",
"Main",
"InputStream is;",
"is",
"int __t__ = 1;",
"__t__",
"1",
"int __f__ = 0;",
"__f__",
"0",
"int __FILE_DEBUG_FLAG__ = __f__;",
"__FILE_DEBUG_FLAG__",
"__f__",
"String __DEBUG_FILE_NAME__ = \"src/F5\";",
"__DEBUG_FILE_NAME__",
"\"src/F5\"",
"FastScanner in;",
"in",
"PrintWriter out;",
"out",
"public void solve() {\n int n = in.nextInt();\n int m = in.nextInt();\n int[] a = in.nextIntArray(m);\n int sum = 0;\n for (int i = 0; i < m; i++) {\n sum += a[i];\n }\n System.out.println(Math.max(-1, n - sum));\n }",
"solve",
"{\n int n = in.nextInt();\n int m = in.nextInt();\n int[] a = in.nextIntArray(m);\n int sum = 0;\n for (int i = 0; i < m; i++) {\n sum += a[i];\n }\n System.out.println(Math.max(-1, n - sum));\n }",
"int n = in.nextInt();",
"n",
"in.nextInt()",
"in.nextInt",
"in",
"int m = in.nextInt();",
"m",
"in.nextInt()",
"in.nextInt",
"in",
"int[] a = in.nextIntArray(m);",
"a",
"in.nextIntArray(m)",
"in.nextIntArray",
"in",
"m",
"int sum = 0;",
"sum",
"0",
"for (int i = 0; i < m; i++) {\n sum += a[i];\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < m",
"i",
"m",
"i++",
"i++",
"i",
"{\n sum += a[i];\n }",
"{\n sum += a[i];\n }",
"sum += a[i]",
"sum",
"a[i]",
"a",
"i",
"System.out.println(Math.max(-1, n - sum))",
"System.out.println",
"System.out",
"System",
"System.out",
"Math.max(-1, n - sum)",
"Math.max",
"Math",
"-1",
"1",
"n - sum",
"n",
"sum",
"public void run() {\n if (__FILE_DEBUG_FLAG__ == __t__) {\n try {\n is = new FileInputStream(__DEBUG_FILE_NAME__);\n } catch (FileNotFoundException e) {\n e.printStackTrace();\n }\n System.out.println(\"FILE_INPUT!\");\n } else {\n is = System.in;\n }\n in = new FastScanner(is);\n out = new PrintWriter(System.out);\n\n solve();\n }",
"run",
"{\n if (__FILE_DEBUG_FLAG__ == __t__) {\n try {\n is = new FileInputStream(__DEBUG_FILE_NAME__);\n } catch (FileNotFoundException e) {\n e.printStackTrace();\n }\n System.out.println(\"FILE_INPUT!\");\n } else {\n is = System.in;\n }\n in = new FastScanner(is);\n out = new PrintWriter(System.out);\n\n solve();\n }",
"if (__FILE_DEBUG_FLAG__ == __t__) {\n try {\n is = new FileInputStream(__DEBUG_FILE_NAME__);\n } catch (FileNotFoundException e) {\n e.printStackTrace();\n }\n System.out.println(\"FILE_INPUT!\");\n } else {\n is = System.in;\n }",
"__FILE_DEBUG_FLAG__ == __t__",
"__FILE_DEBUG_FLAG__",
"__t__",
"{\n try {\n is = new FileInputStream(__DEBUG_FILE_NAME__);\n } catch (FileNotFoundException e) {\n e.printStackTrace();\n }\n System.out.println(\"FILE_INPUT!\");\n }",
"try {\n is = new FileInputStream(__DEBUG_FILE_NAME__);\n } catch (FileNotFoundException e) {\n e.printStackTrace();\n }",
"catch (FileNotFoundException e) {\n e.printStackTrace();\n }",
"FileNotFoundException e",
"{\n e.printStackTrace();\n }",
"e.printStackTrace()",
"e.printStackTrace",
"e",
"{\n is = new FileInputStream(__DEBUG_FILE_NAME__);\n }",
"is = new FileInputStream(__DEBUG_FILE_NAME__)",
"is",
"new FileInputStream(__DEBUG_FILE_NAME__)",
"System.out.println(\"FILE_INPUT!\")",
"System.out.println",
"System.out",
"System",
"System.out",
"\"FILE_INPUT!\"",
"{\n is = System.in;\n }",
"is = System.in",
"is",
"System.in",
"System",
"System.in",
"in = new FastScanner(is)",
"in",
"new FastScanner(is)",
"out = new PrintWriter(System.out)",
"out",
"new PrintWriter(System.out)",
"solve()",
"solve",
"public static void main(final String[] args) {\n new Main().run();\n }",
"main",
"{\n new Main().run();\n }",
"new Main().run()",
"new Main().run",
"new Main()",
"final String[] args",
"args",
"class FastScanner {\n private InputStream stream;\n private byte[] buf = new byte[1024];\n private int curChar;\n private int numChars;\n\n public FastScanner(InputStream stream) {\n this.stream = stream;\n // stream = new FileInputStream(new File(\"dec.in\"));\n }\n\n int read() {\n if (numChars == -1)\n throw new InputMismatchException();\n if (curChar >= numChars) {\n curChar = 0;\n try {\n numChars = stream.read(buf);\n } catch (IOException e) {\n throw new InputMismatchException();\n }\n if (numChars <= 0)\n return -1;\n }\n return buf[curChar++];\n }\n\n public boolean isSpaceChar(int c) {\n return c == ' ' || c == '\\n' || c == '\\r' || c == '\\t' || c == -1;\n }\n\n public boolean isEndline(int c) {\n return c == '\\n' || c == '\\r' || c == -1;\n }\n\n public int nextInt() {\n return Integer.parseInt(next());\n }\n\n public int[] nextIntArray(int n) {\n int[] array = new int[n];\n for (int i = 0; i < n; i++)\n array[i] = nextInt();\n\n return array;\n }\n\n public int[][] nextIntMap(int n, int m) {\n int[][] map = new int[n][m];\n for (int i = 0; i < n; i++) {\n map[i] = nextIntArray(m);\n }\n return map;\n }\n\n public long nextLong() {\n return Long.parseLong(next());\n }\n\n public long[] nextLongArray(int n) {\n long[] array = new long[n];\n for (int i = 0; i < n; i++)\n array[i] = nextLong();\n\n return array;\n }\n\n public long[][] nextLongMap(int n, int m) {\n long[][] map = new long[n][m];\n for (int i = 0; i < n; i++) {\n map[i] = nextLongArray(m);\n }\n return map;\n }\n\n public double nextDouble() {\n return Double.parseDouble(next());\n }\n\n public double[] nextDoubleArray(int n) {\n double[] array = new double[n];\n for (int i = 0; i < n; i++)\n array[i] = nextDouble();\n\n return array;\n }\n\n public double[][] nextDoubleMap(int n, int m) {\n double[][] map = new double[n][m];\n for (int i = 0; i < n; i++) {\n map[i] = nextDoubleArray(m);\n }\n return map;\n }\n\n public String next() {\n int c = read();\n while (isSpaceChar(c))\n c = read();\n StringBuilder res = new StringBuilder();\n do {\n res.appendCodePoint(c);\n c = read();\n } while (!isSpaceChar(c));\n return res.toString();\n }\n\n public String[] nextStringArray(int n) {\n String[] array = new String[n];\n for (int i = 0; i < n; i++)\n array[i] = next();\n\n return array;\n }\n\n public String nextLine() {\n int c = read();\n while (isEndline(c))\n c = read();\n StringBuilder res = new StringBuilder();\n do {\n res.appendCodePoint(c);\n c = read();\n } while (!isEndline(c));\n return res.toString();\n }\n\n public int[][] nextPackedIntArrays(int packN, int size) {\n int[][] res = new int[packN][size];\n for (int i = 0; i < size; i++) {\n for (int j = 0; j < packN; j++) {\n res[j][i] = nextInt();\n }\n }\n return res;\n }\n}",
"FastScanner",
"private InputStream stream;",
"stream",
"private byte[] buf = new byte[1024];",
"buf",
"new byte[1024]",
"1024",
"private int curChar;",
"curChar",
"private int numChars;",
"numChars",
"public FastScanner(InputStream stream) {\n this.stream = stream;\n // stream = new FileInputStream(new File(\"dec.in\"));\n }",
"FastScanner",
"{\n this.stream = stream;\n // stream = new FileInputStream(new File(\"dec.in\"));\n }",
"this.stream = stream",
"this.stream",
"this",
"this.stream",
"stream",
"InputStream stream",
"stream",
"int read() {\n if (numChars == -1)\n throw new InputMismatchException();\n if (curChar >= numChars) {\n curChar = 0;\n try {\n numChars = stream.read(buf);\n } catch (IOException e) {\n throw new InputMismatchException();\n }\n if (numChars <= 0)\n return -1;\n }\n return buf[curChar++];\n }",
"read",
"{\n if (numChars == -1)\n throw new InputMismatchException();\n if (curChar >= numChars) {\n curChar = 0;\n try {\n numChars = stream.read(buf);\n } catch (IOException e) {\n throw new InputMismatchException();\n }\n if (numChars <= 0)\n return -1;\n }\n return buf[curChar++];\n }",
"if (numChars == -1)\n throw new InputMismatchException();",
"numChars == -1",
"numChars",
"-1",
"1",
"throw new InputMismatchException();",
"new InputMismatchException()",
"if (curChar >= numChars) {\n curChar = 0;\n try {\n numChars = stream.read(buf);\n } catch (IOException e) {\n throw new InputMismatchException();\n }\n if (numChars <= 0)\n return -1;\n }",
"curChar >= numChars",
"curChar",
"numChars",
"{\n curChar = 0;\n try {\n numChars = stream.read(buf);\n } catch (IOException e) {\n throw new InputMismatchException();\n }\n if (numChars <= 0)\n return -1;\n }",
"curChar = 0",
"curChar",
"0",
"try {\n numChars = stream.read(buf);\n } catch (IOException e) {\n throw new InputMismatchException();\n }",
"catch (IOException e) {\n throw new InputMismatchException();\n }",
"IOException e",
"{\n throw new InputMismatchException();\n }",
"throw new InputMismatchException();",
"new InputMismatchException()",
"{\n numChars = stream.read(buf);\n }",
"numChars = stream.read(buf)",
"numChars",
"stream.read(buf)",
"stream.read",
"stream",
"buf",
"if (numChars <= 0)\n return -1;",
"numChars <= 0",
"numChars",
"0",
"return -1;",
"-1",
"1",
"return buf[curChar++];",
"buf[curChar++]",
"buf",
"curChar++",
"curChar",
"public boolean isSpaceChar(int c) {\n return c == ' ' || c == '\\n' || c == '\\r' || c == '\\t' || c == -1;\n }",
"isSpaceChar",
"{\n return c == ' ' || c == '\\n' || c == '\\r' || c == '\\t' || c == -1;\n }",
"return c == ' ' || c == '\\n' || c == '\\r' || c == '\\t' || c == -1;",
"c == ' ' || c == '\\n' || c == '\\r' || c == '\\t' || c == -1",
"c == '\\t'",
"c == '\\r'",
"c == ' ' || c == '\\n' || c == '\\r' || c == '\\t' || c == -1",
"c == ' '",
"c",
"' '",
"c == '\\n'",
"c",
"'\\n'",
"c == '\\r'",
"c",
"'\\r'",
"c == '\\t'",
"c",
"'\\t'",
"c == -1",
"c",
"-1",
"1",
"int c",
"c",
"public boolean isEndline(int c) {\n return c == '\\n' || c == '\\r' || c == -1;\n }",
"isEndline",
"{\n return c == '\\n' || c == '\\r' || c == -1;\n }",
"return c == '\\n' || c == '\\r' || c == -1;",
"c == '\\n' || c == '\\r' || c == -1",
"c == '\\n' || c == '\\r' || c == -1",
"c == '\\n'",
"c",
"'\\n'",
"c == '\\r'",
"c",
"'\\r'",
"c == -1",
"c",
"-1",
"1",
"int c",
"c",
"public int nextInt() {\n return Integer.parseInt(next());\n }",
"nextInt",
"{\n return Integer.parseInt(next());\n }",
"return Integer.parseInt(next());",
"Integer.parseInt(next())",
"Integer.parseInt",
"Integer",
"next()",
"next",
"public int[] nextIntArray(int n) {\n int[] array = new int[n];\n for (int i = 0; i < n; i++)\n array[i] = nextInt();\n\n return array;\n }",
"nextIntArray",
"{\n int[] array = new int[n];\n for (int i = 0; i < n; i++)\n array[i] = nextInt();\n\n return array;\n }",
"int[] array = new int[n];",
"array",
"new int[n]",
"n",
"for (int i = 0; i < n; i++)\n array[i] = nextInt();",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < n",
"i",
"n",
"i++",
"i++",
"i",
"array[i] = nextInt();",
"array[i] = nextInt()",
"array[i]",
"array",
"i",
"nextInt()",
"nextInt",
"return array;",
"array",
"int n",
"n",
"public int[][] nextIntMap(int n, int m) {\n int[][] map = new int[n][m];\n for (int i = 0; i < n; i++) {\n map[i] = nextIntArray(m);\n }\n return map;\n }",
"nextIntMap",
"{\n int[][] map = new int[n][m];\n for (int i = 0; i < n; i++) {\n map[i] = nextIntArray(m);\n }\n return map;\n }",
"int[][] map = new int[n][m];",
"map",
"new int[n][m]",
"n",
"m",
"for (int i = 0; i < n; i++) {\n map[i] = nextIntArray(m);\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < n",
"i",
"n",
"i++",
"i++",
"i",
"{\n map[i] = nextIntArray(m);\n }",
"{\n map[i] = nextIntArray(m);\n }",
"map[i] = nextIntArray(m)",
"map[i]",
"map",
"i",
"nextIntArray(m)",
"nextIntArray",
"m",
"return map;",
"map",
"int n",
"n",
"int m",
"m",
"public long nextLong() {\n return Long.parseLong(next());\n }",
"nextLong",
"{\n return Long.parseLong(next());\n }",
"return Long.parseLong(next());",
"Long.parseLong(next())",
"Long.parseLong",
"Long",
"next()",
"next",
"public long[] nextLongArray(int n) {\n long[] array = new long[n];\n for (int i = 0; i < n; i++)\n array[i] = nextLong();\n\n return array;\n }",
"nextLongArray",
"{\n long[] array = new long[n];\n for (int i = 0; i < n; i++)\n array[i] = nextLong();\n\n return array;\n }",
"long[] array = new long[n];",
"array",
"new long[n]",
"n",
"for (int i = 0; i < n; i++)\n array[i] = nextLong();",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < n",
"i",
"n",
"i++",
"i++",
"i",
"array[i] = nextLong();",
"array[i] = nextLong()",
"array[i]",
"array",
"i",
"nextLong()",
"nextLong",
"return array;",
"array",
"int n",
"n",
"public long[][] nextLongMap(int n, int m) {\n long[][] map = new long[n][m];\n for (int i = 0; i < n; i++) {\n map[i] = nextLongArray(m);\n }\n return map;\n }",
"nextLongMap",
"{\n long[][] map = new long[n][m];\n for (int i = 0; i < n; i++) {\n map[i] = nextLongArray(m);\n }\n return map;\n }",
"long[][] map = new long[n][m];",
"map",
"new long[n][m]",
"n",
"m",
"for (int i = 0; i < n; i++) {\n map[i] = nextLongArray(m);\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < n",
"i",
"n",
"i++",
"i++",
"i",
"{\n map[i] = nextLongArray(m);\n }",
"{\n map[i] = nextLongArray(m);\n }",
"map[i] = nextLongArray(m)",
"map[i]",
"map",
"i",
"nextLongArray(m)",
"nextLongArray",
"m",
"return map;",
"map",
"int n",
"n",
"int m",
"m",
"public double nextDouble() {\n return Double.parseDouble(next());\n }",
"nextDouble",
"{\n return Double.parseDouble(next());\n }",
"return Double.parseDouble(next());",
"Double.parseDouble(next())",
"Double.parseDouble",
"Double",
"next()",
"next",
"public double[] nextDoubleArray(int n) {\n double[] array = new double[n];\n for (int i = 0; i < n; i++)\n array[i] = nextDouble();\n\n return array;\n }",
"nextDoubleArray",
"{\n double[] array = new double[n];\n for (int i = 0; i < n; i++)\n array[i] = nextDouble();\n\n return array;\n }",
"double[] array = new double[n];",
"array",
"new double[n]",
"n",
"for (int i = 0; i < n; i++)\n array[i] = nextDouble();",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < n",
"i",
"n",
"i++",
"i++",
"i",
"array[i] = nextDouble();",
"array[i] = nextDouble()",
"array[i]",
"array",
"i",
"nextDouble()",
"nextDouble",
"return array;",
"array",
"int n",
"n",
"public double[][] nextDoubleMap(int n, int m) {\n double[][] map = new double[n][m];\n for (int i = 0; i < n; i++) {\n map[i] = nextDoubleArray(m);\n }\n return map;\n }",
"nextDoubleMap",
"{\n double[][] map = new double[n][m];\n for (int i = 0; i < n; i++) {\n map[i] = nextDoubleArray(m);\n }\n return map;\n }",
"double[][] map = new double[n][m];",
"map",
"new double[n][m]",
"n",
"m",
"for (int i = 0; i < n; i++) {\n map[i] = nextDoubleArray(m);\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < n",
"i",
"n",
"i++",
"i++",
"i",
"{\n map[i] = nextDoubleArray(m);\n }",
"{\n map[i] = nextDoubleArray(m);\n }",
"map[i] = nextDoubleArray(m)",
"map[i]",
"map",
"i",
"nextDoubleArray(m)",
"nextDoubleArray",
"m",
"return map;",
"map",
"int n",
"n",
"int m",
"m",
"public String next() {\n int c = read();\n while (isSpaceChar(c))\n c = read();\n StringBuilder res = new StringBuilder();\n do {\n res.appendCodePoint(c);\n c = read();\n } while (!isSpaceChar(c));\n return res.toString();\n }",
"next",
"{\n int c = read();\n while (isSpaceChar(c))\n c = read();\n StringBuilder res = new StringBuilder();\n do {\n res.appendCodePoint(c);\n c = read();\n } while (!isSpaceChar(c));\n return res.toString();\n }",
"int c = read();",
"c",
"read()",
"read",
"while (isSpaceChar(c))\n c = read();",
"isSpaceChar(c)",
"isSpaceChar",
"c",
"c = read()",
"c",
"read()",
"read",
"StringBuilder res = new StringBuilder();",
"res",
"new StringBuilder()",
"do {\n res.appendCodePoint(c);\n c = read();\n } while (!isSpaceChar(c));",
"!isSpaceChar(c)",
"isSpaceChar(c)",
"isSpaceChar",
"c",
"{\n res.appendCodePoint(c);\n c = read();\n }",
"res.appendCodePoint(c)",
"res.appendCodePoint",
"res",
"c",
"c = read()",
"c",
"read()",
"read",
"return res.toString();",
"res.toString()",
"res.toString",
"res",
"public String[] nextStringArray(int n) {\n String[] array = new String[n];\n for (int i = 0; i < n; i++)\n array[i] = next();\n\n return array;\n }",
"nextStringArray",
"{\n String[] array = new String[n];\n for (int i = 0; i < n; i++)\n array[i] = next();\n\n return array;\n }",
"String[] array = new String[n];",
"array",
"new String[n]",
"n",
"for (int i = 0; i < n; i++)\n array[i] = next();",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < n",
"i",
"n",
"i++",
"i++",
"i",
"array[i] = next();",
"array[i] = next()",
"array[i]",
"array",
"i",
"next()",
"next",
"return array;",
"array",
"int n",
"n",
"public String nextLine() {\n int c = read();\n while (isEndline(c))\n c = read();\n StringBuilder res = new StringBuilder();\n do {\n res.appendCodePoint(c);\n c = read();\n } while (!isEndline(c));\n return res.toString();\n }",
"nextLine",
"{\n int c = read();\n while (isEndline(c))\n c = read();\n StringBuilder res = new StringBuilder();\n do {\n res.appendCodePoint(c);\n c = read();\n } while (!isEndline(c));\n return res.toString();\n }",
"int c = read();",
"c",
"read()",
"read",
"while (isEndline(c))\n c = read();",
"isEndline(c)",
"isEndline",
"c",
"c = read()",
"c",
"read()",
"read",
"StringBuilder res = new StringBuilder();",
"res",
"new StringBuilder()",
"do {\n res.appendCodePoint(c);\n c = read();\n } while (!isEndline(c));",
"!isEndline(c)",
"isEndline(c)",
"isEndline",
"c",
"{\n res.appendCodePoint(c);\n c = read();\n }",
"res.appendCodePoint(c)",
"res.appendCodePoint",
"res",
"c",
"c = read()",
"c",
"read()",
"read",
"return res.toString();",
"res.toString()",
"res.toString",
"res",
"public int[][] nextPackedIntArrays(int packN, int size) {\n int[][] res = new int[packN][size];\n for (int i = 0; i < size; i++) {\n for (int j = 0; j < packN; j++) {\n res[j][i] = nextInt();\n }\n }\n return res;\n }",
"nextPackedIntArrays",
"{\n int[][] res = new int[packN][size];\n for (int i = 0; i < size; i++) {\n for (int j = 0; j < packN; j++) {\n res[j][i] = nextInt();\n }\n }\n return res;\n }",
"int[][] res = new int[packN][size];",
"res",
"new int[packN][size]",
"packN",
"size",
"for (int i = 0; i < size; i++) {\n for (int j = 0; j < packN; j++) {\n res[j][i] = nextInt();\n }\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < size",
"i",
"size",
"i++",
"i++",
"i",
"{\n for (int j = 0; j < packN; j++) {\n res[j][i] = nextInt();\n }\n }",
"{\n for (int j = 0; j < packN; j++) {\n res[j][i] = nextInt();\n }\n }",
"for (int j = 0; j < packN; j++) {\n res[j][i] = nextInt();\n }",
"int j = 0;",
"int j = 0;",
"j",
"0",
"j < packN",
"j",
"packN",
"j++",
"j++",
"j",
"{\n res[j][i] = nextInt();\n }",
"{\n res[j][i] = nextInt();\n }",
"res[j][i] = nextInt()",
"res[j][i]",
"res[j]",
"res",
"j",
"i",
"nextInt()",
"nextInt",
"return res;",
"res",
"int packN",
"packN",
"int size",
"size",
"public class Main {\n InputStream is;\n\n int __t__ = 1;\n int __f__ = 0;\n int __FILE_DEBUG_FLAG__ = __f__;\n String __DEBUG_FILE_NAME__ = \"src/F5\";\n\n FastScanner in;\n PrintWriter out;\n\n public void solve() {\n int n = in.nextInt();\n int m = in.nextInt();\n int[] a = in.nextIntArray(m);\n int sum = 0;\n for (int i = 0; i < m; i++) {\n sum += a[i];\n }\n System.out.println(Math.max(-1, n - sum));\n }\n\n public void run() {\n if (__FILE_DEBUG_FLAG__ == __t__) {\n try {\n is = new FileInputStream(__DEBUG_FILE_NAME__);\n } catch (FileNotFoundException e) {\n e.printStackTrace();\n }\n System.out.println(\"FILE_INPUT!\");\n } else {\n is = System.in;\n }\n in = new FastScanner(is);\n out = new PrintWriter(System.out);\n\n solve();\n }\n\n public static void main(final String[] args) {\n new Main().run();\n }\n}",
"public class Main {\n InputStream is;\n\n int __t__ = 1;\n int __f__ = 0;\n int __FILE_DEBUG_FLAG__ = __f__;\n String __DEBUG_FILE_NAME__ = \"src/F5\";\n\n FastScanner in;\n PrintWriter out;\n\n public void solve() {\n int n = in.nextInt();\n int m = in.nextInt();\n int[] a = in.nextIntArray(m);\n int sum = 0;\n for (int i = 0; i < m; i++) {\n sum += a[i];\n }\n System.out.println(Math.max(-1, n - sum));\n }\n\n public void run() {\n if (__FILE_DEBUG_FLAG__ == __t__) {\n try {\n is = new FileInputStream(__DEBUG_FILE_NAME__);\n } catch (FileNotFoundException e) {\n e.printStackTrace();\n }\n System.out.println(\"FILE_INPUT!\");\n } else {\n is = System.in;\n }\n in = new FastScanner(is);\n out = new PrintWriter(System.out);\n\n solve();\n }\n\n public static void main(final String[] args) {\n new Main().run();\n }\n}",
"Main"
] |
import java.io.InputStream;
import java.io.IOException;
import java.util.InputMismatchException;
import java.io.FileNotFoundException;
import java.io.PrintWriter;
import java.io.FileInputStream;
public class Main {
InputStream is;
int __t__ = 1;
int __f__ = 0;
int __FILE_DEBUG_FLAG__ = __f__;
String __DEBUG_FILE_NAME__ = "src/F5";
FastScanner in;
PrintWriter out;
public void solve() {
int n = in.nextInt();
int m = in.nextInt();
int[] a = in.nextIntArray(m);
int sum = 0;
for (int i = 0; i < m; i++) {
sum += a[i];
}
System.out.println(Math.max(-1, n - sum));
}
public void run() {
if (__FILE_DEBUG_FLAG__ == __t__) {
try {
is = new FileInputStream(__DEBUG_FILE_NAME__);
} catch (FileNotFoundException e) {
e.printStackTrace();
}
System.out.println("FILE_INPUT!");
} else {
is = System.in;
}
in = new FastScanner(is);
out = new PrintWriter(System.out);
solve();
}
public static void main(final String[] args) {
new Main().run();
}
}
class FastScanner {
private InputStream stream;
private byte[] buf = new byte[1024];
private int curChar;
private int numChars;
public FastScanner(InputStream stream) {
this.stream = stream;
// stream = new FileInputStream(new File("dec.in"));
}
int read() {
if (numChars == -1)
throw new InputMismatchException();
if (curChar >= numChars) {
curChar = 0;
try {
numChars = stream.read(buf);
} catch (IOException e) {
throw new InputMismatchException();
}
if (numChars <= 0)
return -1;
}
return buf[curChar++];
}
public boolean isSpaceChar(int c) {
return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
}
public boolean isEndline(int c) {
return c == '\n' || c == '\r' || c == -1;
}
public int nextInt() {
return Integer.parseInt(next());
}
public int[] nextIntArray(int n) {
int[] array = new int[n];
for (int i = 0; i < n; i++)
array[i] = nextInt();
return array;
}
public int[][] nextIntMap(int n, int m) {
int[][] map = new int[n][m];
for (int i = 0; i < n; i++) {
map[i] = nextIntArray(m);
}
return map;
}
public long nextLong() {
return Long.parseLong(next());
}
public long[] nextLongArray(int n) {
long[] array = new long[n];
for (int i = 0; i < n; i++)
array[i] = nextLong();
return array;
}
public long[][] nextLongMap(int n, int m) {
long[][] map = new long[n][m];
for (int i = 0; i < n; i++) {
map[i] = nextLongArray(m);
}
return map;
}
public double nextDouble() {
return Double.parseDouble(next());
}
public double[] nextDoubleArray(int n) {
double[] array = new double[n];
for (int i = 0; i < n; i++)
array[i] = nextDouble();
return array;
}
public double[][] nextDoubleMap(int n, int m) {
double[][] map = new double[n][m];
for (int i = 0; i < n; i++) {
map[i] = nextDoubleArray(m);
}
return map;
}
public String next() {
int c = read();
while (isSpaceChar(c))
c = read();
StringBuilder res = new StringBuilder();
do {
res.appendCodePoint(c);
c = read();
} while (!isSpaceChar(c));
return res.toString();
}
public String[] nextStringArray(int n) {
String[] array = new String[n];
for (int i = 0; i < n; i++)
array[i] = next();
return array;
}
public String nextLine() {
int c = read();
while (isEndline(c))
c = read();
StringBuilder res = new StringBuilder();
do {
res.appendCodePoint(c);
c = read();
} while (!isEndline(c));
return res.toString();
}
public int[][] nextPackedIntArrays(int packN, int size) {
int[][] res = new int[packN][size];
for (int i = 0; i < size; i++) {
for (int j = 0; j < packN; j++) {
res[j][i] = nextInt();
}
}
return res;
}
}
|
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
41,
13,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
4,
18,
13,
0,
13,
13,
14,
2,
13,
13,
30,
4,
18,
18,
13,
13,
2,
13,
13,
30,
4,
18,
18,
13,
13,
40,
17,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
72,
5
],
[
72,
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,
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
],
[
40,
42
],
[
42,
43
],
[
43,
44
],
[
39,
45
],
[
45,
46
],
[
45,
47
],
[
8,
48
],
[
48,
49
],
[
49,
50
],
[
49,
51
],
[
48,
52
],
[
52,
53
],
[
53,
54
],
[
54,
55
],
[
55,
56
],
[
55,
57
],
[
53,
58
],
[
58,
59
],
[
58,
60
],
[
48,
61
],
[
61,
62
],
[
62,
63
],
[
63,
64
],
[
64,
65
],
[
64,
66
],
[
62,
67
],
[
67,
68
],
[
6,
69
],
[
69,
70
],
[
0,
71
],
[
71,
72
],
[
71,
73
]
] |
[
"import java.util.*;\npublic class Main {\n\tpublic static void main(String[] args){\n\t\tScanner sc = new Scanner(System.in);\n int n = sc.nextInt();\n int m = sc.nextInt();\n int a;\n int sum = 0;\n for(int i = 0;i<m;i++){\n a = sc.nextInt();\n sum += a;\n }\n if(n>=sum){\n System.out.println(n-sum);\n }else{\n System.out.println(-1);\n }\n\t}\n}",
"import java.util.*;",
"util.*",
"java",
"public class Main {\n\tpublic static void main(String[] args){\n\t\tScanner sc = new Scanner(System.in);\n int n = sc.nextInt();\n int m = sc.nextInt();\n int a;\n int sum = 0;\n for(int i = 0;i<m;i++){\n a = sc.nextInt();\n sum += a;\n }\n if(n>=sum){\n System.out.println(n-sum);\n }else{\n System.out.println(-1);\n }\n\t}\n}",
"Main",
"public static void main(String[] args){\n\t\tScanner sc = new Scanner(System.in);\n int n = sc.nextInt();\n int m = sc.nextInt();\n int a;\n int sum = 0;\n for(int i = 0;i<m;i++){\n a = sc.nextInt();\n sum += a;\n }\n if(n>=sum){\n System.out.println(n-sum);\n }else{\n System.out.println(-1);\n }\n\t}",
"main",
"{\n\t\tScanner sc = new Scanner(System.in);\n int n = sc.nextInt();\n int m = sc.nextInt();\n int a;\n int sum = 0;\n for(int i = 0;i<m;i++){\n a = sc.nextInt();\n sum += a;\n }\n if(n>=sum){\n System.out.println(n-sum);\n }else{\n System.out.println(-1);\n }\n\t}",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"int n = sc.nextInt();",
"n",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int m = sc.nextInt();",
"m",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int a;",
"a",
"int sum = 0;",
"sum",
"0",
"for(int i = 0;i<m;i++){\n a = sc.nextInt();\n sum += a;\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i<m",
"i",
"m",
"i++",
"i++",
"i",
"{\n a = sc.nextInt();\n sum += a;\n }",
"{\n a = sc.nextInt();\n sum += a;\n }",
"a = sc.nextInt()",
"a",
"sc.nextInt()",
"sc.nextInt",
"sc",
"sum += a",
"sum",
"a",
"if(n>=sum){\n System.out.println(n-sum);\n }else{\n System.out.println(-1);\n }",
"n>=sum",
"n",
"sum",
"{\n System.out.println(n-sum);\n }",
"System.out.println(n-sum)",
"System.out.println",
"System.out",
"System",
"System.out",
"n-sum",
"n",
"sum",
"{\n System.out.println(-1);\n }",
"System.out.println(-1)",
"System.out.println",
"System.out",
"System",
"System.out",
"-1",
"1",
"String[] args",
"args",
"public class Main {\n\tpublic static void main(String[] args){\n\t\tScanner sc = new Scanner(System.in);\n int n = sc.nextInt();\n int m = sc.nextInt();\n int a;\n int sum = 0;\n for(int i = 0;i<m;i++){\n a = sc.nextInt();\n sum += a;\n }\n if(n>=sum){\n System.out.println(n-sum);\n }else{\n System.out.println(-1);\n }\n\t}\n}",
"public class Main {\n\tpublic static void main(String[] args){\n\t\tScanner sc = new Scanner(System.in);\n int n = sc.nextInt();\n int m = sc.nextInt();\n int a;\n int sum = 0;\n for(int i = 0;i<m;i++){\n a = sc.nextInt();\n sum += a;\n }\n if(n>=sum){\n System.out.println(n-sum);\n }else{\n System.out.println(-1);\n }\n\t}\n}",
"Main"
] |
import java.util.*;
public class Main {
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
int m = sc.nextInt();
int a;
int sum = 0;
for(int i = 0;i<m;i++){
a = sc.nextInt();
sum += a;
}
if(n>=sum){
System.out.println(n-sum);
}else{
System.out.println(-1);
}
}
}
|
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
41,
13,
20,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
18,
13,
13,
4,
18,
13,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
18,
13,
13,
14,
2,
13,
13,
30,
4,
18,
18,
13,
13,
2,
13,
13,
30,
4,
18,
18,
13,
13,
40,
17,
29,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
92,
5
],
[
92,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
8,
17
],
[
17,
18
],
[
17,
19
],
[
19,
20
],
[
20,
21
],
[
8,
22
],
[
22,
23
],
[
22,
24
],
[
8,
26
],
[
26,
27
],
[
27,
28
],
[
28,
29
],
[
28,
30
],
[
26,
31
],
[
31,
32
],
[
31,
33
],
[
26,
34
],
[
34,
35
],
[
35,
36
],
[
26,
37
],
[
38,
38
],
[
38,
39
],
[
39,
40
],
[
40,
41
],
[
40,
42
],
[
39,
43
],
[
43,
44
],
[
44,
45
],
[
8,
46
],
[
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
],
[
64,
66
],
[
8,
67
],
[
67,
68
],
[
68,
69
],
[
68,
70
],
[
67,
71
],
[
71,
72
],
[
72,
73
],
[
73,
74
],
[
74,
75
],
[
74,
76
],
[
72,
77
],
[
77,
78
],
[
77,
79
],
[
67,
80
],
[
80,
81
],
[
81,
82
],
[
82,
83
],
[
83,
84
],
[
83,
85
],
[
81,
86
],
[
86,
87
],
[
8,
88
],
[
6,
89
],
[
89,
90
],
[
0,
91
],
[
91,
92
],
[
91,
93
]
] |
[
"import java.util.Scanner;\n\npublic class Main {\n\tpublic static void main(String[] args){\n\n\t\tScanner sc = new Scanner(System.in);\n\n\t\tint day = sc.nextInt();\n\t\tint work_count = sc.nextInt();\n\n\t\tint homework [] = new int[work_count];\n\n\t\tfor (int i = 0; i < work_count; i++) {\n\t\t\thomework[i] = sc.nextInt();\n\t\t}\n\n\t\tint sum = 0;\n\n\t\tfor (int i = 0; i < work_count; i++) {\n\t\t\tsum += homework[i];\n\t\t}\n\n\t\tif (day >= sum) {\n\t\t\tSystem.out.print(day - sum);\n\t\t} else {\n\t\t\tSystem.out.print(-1);\n\t\t}\n\n\treturn;\n\n\t}\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n\tpublic static void main(String[] args){\n\n\t\tScanner sc = new Scanner(System.in);\n\n\t\tint day = sc.nextInt();\n\t\tint work_count = sc.nextInt();\n\n\t\tint homework [] = new int[work_count];\n\n\t\tfor (int i = 0; i < work_count; i++) {\n\t\t\thomework[i] = sc.nextInt();\n\t\t}\n\n\t\tint sum = 0;\n\n\t\tfor (int i = 0; i < work_count; i++) {\n\t\t\tsum += homework[i];\n\t\t}\n\n\t\tif (day >= sum) {\n\t\t\tSystem.out.print(day - sum);\n\t\t} else {\n\t\t\tSystem.out.print(-1);\n\t\t}\n\n\treturn;\n\n\t}\n}",
"Main",
"public static void main(String[] args){\n\n\t\tScanner sc = new Scanner(System.in);\n\n\t\tint day = sc.nextInt();\n\t\tint work_count = sc.nextInt();\n\n\t\tint homework [] = new int[work_count];\n\n\t\tfor (int i = 0; i < work_count; i++) {\n\t\t\thomework[i] = sc.nextInt();\n\t\t}\n\n\t\tint sum = 0;\n\n\t\tfor (int i = 0; i < work_count; i++) {\n\t\t\tsum += homework[i];\n\t\t}\n\n\t\tif (day >= sum) {\n\t\t\tSystem.out.print(day - sum);\n\t\t} else {\n\t\t\tSystem.out.print(-1);\n\t\t}\n\n\treturn;\n\n\t}",
"main",
"{\n\n\t\tScanner sc = new Scanner(System.in);\n\n\t\tint day = sc.nextInt();\n\t\tint work_count = sc.nextInt();\n\n\t\tint homework [] = new int[work_count];\n\n\t\tfor (int i = 0; i < work_count; i++) {\n\t\t\thomework[i] = sc.nextInt();\n\t\t}\n\n\t\tint sum = 0;\n\n\t\tfor (int i = 0; i < work_count; i++) {\n\t\t\tsum += homework[i];\n\t\t}\n\n\t\tif (day >= sum) {\n\t\t\tSystem.out.print(day - sum);\n\t\t} else {\n\t\t\tSystem.out.print(-1);\n\t\t}\n\n\treturn;\n\n\t}",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"int day = sc.nextInt();",
"day",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int work_count = sc.nextInt();",
"work_count",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int homework [] = new int[work_count];",
"homework",
"new int[work_count]",
"work_count",
"for (int i = 0; i < work_count; i++) {\n\t\t\thomework[i] = sc.nextInt();\n\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < work_count",
"i",
"work_count",
"i++",
"i++",
"i",
"{\n\t\t\thomework[i] = sc.nextInt();\n\t\t}",
"{\n\t\t\thomework[i] = sc.nextInt();\n\t\t}",
"homework[i] = sc.nextInt()",
"homework[i]",
"homework",
"i",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int sum = 0;",
"sum",
"0",
"for (int i = 0; i < work_count; i++) {\n\t\t\tsum += homework[i];\n\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < work_count",
"i",
"work_count",
"i++",
"i++",
"i",
"{\n\t\t\tsum += homework[i];\n\t\t}",
"{\n\t\t\tsum += homework[i];\n\t\t}",
"sum += homework[i]",
"sum",
"homework[i]",
"homework",
"i",
"if (day >= sum) {\n\t\t\tSystem.out.print(day - sum);\n\t\t} else {\n\t\t\tSystem.out.print(-1);\n\t\t}",
"day >= sum",
"day",
"sum",
"{\n\t\t\tSystem.out.print(day - sum);\n\t\t}",
"System.out.print(day - sum)",
"System.out.print",
"System.out",
"System",
"System.out",
"day - sum",
"day",
"sum",
"{\n\t\t\tSystem.out.print(-1);\n\t\t}",
"System.out.print(-1)",
"System.out.print",
"System.out",
"System",
"System.out",
"-1",
"1",
"return;",
"String[] args",
"args",
"public class Main {\n\tpublic static void main(String[] args){\n\n\t\tScanner sc = new Scanner(System.in);\n\n\t\tint day = sc.nextInt();\n\t\tint work_count = sc.nextInt();\n\n\t\tint homework [] = new int[work_count];\n\n\t\tfor (int i = 0; i < work_count; i++) {\n\t\t\thomework[i] = sc.nextInt();\n\t\t}\n\n\t\tint sum = 0;\n\n\t\tfor (int i = 0; i < work_count; i++) {\n\t\t\tsum += homework[i];\n\t\t}\n\n\t\tif (day >= sum) {\n\t\t\tSystem.out.print(day - sum);\n\t\t} else {\n\t\t\tSystem.out.print(-1);\n\t\t}\n\n\treturn;\n\n\t}\n}",
"public class Main {\n\tpublic static void main(String[] args){\n\n\t\tScanner sc = new Scanner(System.in);\n\n\t\tint day = sc.nextInt();\n\t\tint work_count = sc.nextInt();\n\n\t\tint homework [] = new int[work_count];\n\n\t\tfor (int i = 0; i < work_count; i++) {\n\t\t\thomework[i] = sc.nextInt();\n\t\t}\n\n\t\tint sum = 0;\n\n\t\tfor (int i = 0; i < work_count; i++) {\n\t\t\tsum += homework[i];\n\t\t}\n\n\t\tif (day >= sum) {\n\t\t\tSystem.out.print(day - sum);\n\t\t} else {\n\t\t\tSystem.out.print(-1);\n\t\t}\n\n\treturn;\n\n\t}\n}",
"Main"
] |
import java.util.Scanner;
public class Main {
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
int day = sc.nextInt();
int work_count = sc.nextInt();
int homework [] = new int[work_count];
for (int i = 0; i < work_count; i++) {
homework[i] = sc.nextInt();
}
int sum = 0;
for (int i = 0; i < work_count; i++) {
sum += homework[i];
}
if (day >= sum) {
System.out.print(day - sum);
} else {
System.out.print(-1);
}
return;
}
}
|
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
4,
18,
13,
4,
18,
18,
13,
13,
8,
2,
13,
17,
13,
40,
17,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
55,
5
],
[
55,
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
],
[
23,
24
],
[
24,
25
],
[
24,
26
],
[
22,
27
],
[
27,
28
],
[
27,
29
],
[
22,
30
],
[
30,
31
],
[
31,
32
],
[
22,
33
],
[
34,
34
],
[
34,
35
],
[
35,
36
],
[
35,
37
],
[
37,
38
],
[
38,
39
],
[
8,
40
],
[
40,
41
],
[
41,
42
],
[
42,
43
],
[
42,
44
],
[
40,
45
],
[
45,
46
],
[
46,
47
],
[
46,
48
],
[
45,
49
],
[
45,
50
],
[
50,
51
],
[
6,
52
],
[
52,
53
],
[
0,
54
],
[
54,
55
],
[
54,
56
]
] |
[
"import java.util.Scanner;\n\npublic class Main {\n public static void main(String[] args) {\n Scanner scan = new Scanner(System.in);\n int N = scan.nextInt();\n int M = scan.nextInt();\n for(int i=0; i<M; i++) {\n N -= scan.nextInt();\n }\n System.out.println(N>=0?N:-1);\n }\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n public static void main(String[] args) {\n Scanner scan = new Scanner(System.in);\n int N = scan.nextInt();\n int M = scan.nextInt();\n for(int i=0; i<M; i++) {\n N -= scan.nextInt();\n }\n System.out.println(N>=0?N:-1);\n }\n}",
"Main",
"public static void main(String[] args) {\n Scanner scan = new Scanner(System.in);\n int N = scan.nextInt();\n int M = scan.nextInt();\n for(int i=0; i<M; i++) {\n N -= scan.nextInt();\n }\n System.out.println(N>=0?N:-1);\n }",
"main",
"{\n Scanner scan = new Scanner(System.in);\n int N = scan.nextInt();\n int M = scan.nextInt();\n for(int i=0; i<M; i++) {\n N -= scan.nextInt();\n }\n System.out.println(N>=0?N:-1);\n }",
"Scanner scan = new Scanner(System.in);",
"scan",
"new Scanner(System.in)",
"int N = scan.nextInt();",
"N",
"scan.nextInt()",
"scan.nextInt",
"scan",
"int M = scan.nextInt();",
"M",
"scan.nextInt()",
"scan.nextInt",
"scan",
"for(int i=0; i<M; i++) {\n N -= scan.nextInt();\n }",
"int i=0;",
"int i=0;",
"i",
"0",
"i<M",
"i",
"M",
"i++",
"i++",
"i",
"{\n N -= scan.nextInt();\n }",
"{\n N -= scan.nextInt();\n }",
"N -= scan.nextInt()",
"N",
"scan.nextInt()",
"scan.nextInt",
"scan",
"System.out.println(N>=0?N:-1)",
"System.out.println",
"System.out",
"System",
"System.out",
"N>=0?N:-1",
"N>=0",
"N",
"0",
"N",
"-1",
"1",
"String[] args",
"args",
"public class Main {\n public static void main(String[] args) {\n Scanner scan = new Scanner(System.in);\n int N = scan.nextInt();\n int M = scan.nextInt();\n for(int i=0; i<M; i++) {\n N -= scan.nextInt();\n }\n System.out.println(N>=0?N:-1);\n }\n}",
"public class Main {\n public static void main(String[] args) {\n Scanner scan = new Scanner(System.in);\n int N = scan.nextInt();\n int M = scan.nextInt();\n for(int i=0; i<M; i++) {\n N -= scan.nextInt();\n }\n System.out.println(N>=0?N:-1);\n }\n}",
"Main"
] |
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
int N = scan.nextInt();
int M = scan.nextInt();
for(int i=0; i<M; i++) {
N -= scan.nextInt();
}
System.out.println(N>=0?N:-1);
}
}
|
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
41,
13,
20,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
18,
13,
13,
4,
18,
13,
0,
13,
18,
13,
13,
14,
2,
13,
17,
30,
4,
18,
18,
13,
13,
40,
17,
30,
4,
18,
18,
13,
13,
13,
4,
18,
13,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
76,
5
],
[
76,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
8,
17
],
[
17,
18
],
[
17,
19
],
[
19,
20
],
[
20,
21
],
[
8,
22
],
[
22,
23
],
[
22,
24
],
[
8,
26
],
[
26,
27
],
[
27,
28
],
[
28,
29
],
[
28,
30
],
[
26,
31
],
[
31,
32
],
[
31,
33
],
[
26,
34
],
[
34,
35
],
[
35,
36
],
[
26,
37
],
[
38,
38
],
[
38,
39
],
[
39,
40
],
[
40,
41
],
[
40,
42
],
[
39,
43
],
[
43,
44
],
[
44,
45
],
[
38,
46
],
[
46,
47
],
[
46,
48
],
[
48,
49
],
[
48,
50
],
[
8,
51
],
[
51,
52
],
[
52,
53
],
[
52,
54
],
[
51,
55
],
[
55,
56
],
[
56,
57
],
[
57,
58
],
[
58,
59
],
[
58,
60
],
[
56,
61
],
[
61,
62
],
[
51,
63
],
[
63,
64
],
[
64,
65
],
[
65,
66
],
[
66,
67
],
[
66,
68
],
[
64,
69
],
[
8,
70
],
[
70,
71
],
[
71,
72
],
[
6,
73
],
[
73,
74
],
[
0,
75
],
[
75,
76
],
[
75,
77
]
] |
[
"import java.util.Scanner;\npublic class Main {\n public static void main(String[] args){\n Scanner sc = new Scanner(System.in);\n int n = sc.nextInt();\n int m = sc.nextInt();\n int[] a = new int[m];\n for(int i = 0 ; i < m ; i++ ){\n a[i] = sc.nextInt();\n n -= a[i];\n }\n if(n < 0){\n System.out.println(-1);\n }else{\n System.out.println(n);\n }\n sc.close();\n }\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n public static void main(String[] args){\n Scanner sc = new Scanner(System.in);\n int n = sc.nextInt();\n int m = sc.nextInt();\n int[] a = new int[m];\n for(int i = 0 ; i < m ; i++ ){\n a[i] = sc.nextInt();\n n -= a[i];\n }\n if(n < 0){\n System.out.println(-1);\n }else{\n System.out.println(n);\n }\n sc.close();\n }\n}",
"Main",
"public static void main(String[] args){\n Scanner sc = new Scanner(System.in);\n int n = sc.nextInt();\n int m = sc.nextInt();\n int[] a = new int[m];\n for(int i = 0 ; i < m ; i++ ){\n a[i] = sc.nextInt();\n n -= a[i];\n }\n if(n < 0){\n System.out.println(-1);\n }else{\n System.out.println(n);\n }\n sc.close();\n }",
"main",
"{\n Scanner sc = new Scanner(System.in);\n int n = sc.nextInt();\n int m = sc.nextInt();\n int[] a = new int[m];\n for(int i = 0 ; i < m ; i++ ){\n a[i] = sc.nextInt();\n n -= a[i];\n }\n if(n < 0){\n System.out.println(-1);\n }else{\n System.out.println(n);\n }\n sc.close();\n }",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"int n = sc.nextInt();",
"n",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int m = sc.nextInt();",
"m",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int[] a = new int[m];",
"a",
"new int[m]",
"m",
"for(int i = 0 ; i < m ; i++ ){\n a[i] = sc.nextInt();\n n -= a[i];\n }",
"int i = 0 ;",
"int i = 0 ;",
"i",
"0",
"i < m",
"i",
"m",
"i++",
"i++",
"i",
"{\n a[i] = sc.nextInt();\n n -= a[i];\n }",
"{\n a[i] = sc.nextInt();\n n -= a[i];\n }",
"a[i] = sc.nextInt()",
"a[i]",
"a",
"i",
"sc.nextInt()",
"sc.nextInt",
"sc",
"n -= a[i]",
"n",
"a[i]",
"a",
"i",
"if(n < 0){\n System.out.println(-1);\n }else{\n System.out.println(n);\n }",
"n < 0",
"n",
"0",
"{\n System.out.println(-1);\n }",
"System.out.println(-1)",
"System.out.println",
"System.out",
"System",
"System.out",
"-1",
"1",
"{\n System.out.println(n);\n }",
"System.out.println(n)",
"System.out.println",
"System.out",
"System",
"System.out",
"n",
"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 n = sc.nextInt();\n int m = sc.nextInt();\n int[] a = new int[m];\n for(int i = 0 ; i < m ; i++ ){\n a[i] = sc.nextInt();\n n -= a[i];\n }\n if(n < 0){\n System.out.println(-1);\n }else{\n System.out.println(n);\n }\n sc.close();\n }\n}",
"public class Main {\n public static void main(String[] args){\n Scanner sc = new Scanner(System.in);\n int n = sc.nextInt();\n int m = sc.nextInt();\n int[] a = new int[m];\n for(int i = 0 ; i < m ; i++ ){\n a[i] = sc.nextInt();\n n -= a[i];\n }\n if(n < 0){\n System.out.println(-1);\n }else{\n System.out.println(n);\n }\n sc.close();\n }\n}",
"Main"
] |
import java.util.Scanner;
public class Main {
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
int m = sc.nextInt();
int[] a = new int[m];
for(int i = 0 ; i < m ; i++ ){
a[i] = sc.nextInt();
n -= a[i];
}
if(n < 0){
System.out.println(-1);
}else{
System.out.println(n);
}
sc.close();
}
}
|
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
41,
13,
20,
13,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
18,
13,
13,
1,
40,
13,
30,
30,
0,
18,
13,
13,
4,
18,
13,
0,
13,
18,
13,
13,
14,
2,
13,
13,
30,
4,
18,
18,
13,
13,
40,
17,
30,
4,
18,
18,
13,
13,
2,
13,
13,
4,
18,
13,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
83,
5
],
[
83,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
8,
17
],
[
17,
18
],
[
17,
19
],
[
19,
20
],
[
20,
21
],
[
8,
22
],
[
22,
23
],
[
22,
24
],
[
8,
26
],
[
26,
27
],
[
26,
28
],
[
8,
29
],
[
29,
30
],
[
30,
31
],
[
31,
32
],
[
31,
33
],
[
29,
34
],
[
34,
35
],
[
34,
36
],
[
36,
37
],
[
36,
38
],
[
29,
39
],
[
39,
40
],
[
40,
41
],
[
29,
42
],
[
43,
43
],
[
43,
44
],
[
44,
45
],
[
45,
46
],
[
45,
47
],
[
44,
48
],
[
48,
49
],
[
49,
50
],
[
43,
51
],
[
51,
52
],
[
51,
53
],
[
53,
54
],
[
53,
55
],
[
8,
56
],
[
56,
57
],
[
57,
58
],
[
57,
59
],
[
56,
60
],
[
60,
61
],
[
61,
62
],
[
62,
63
],
[
63,
64
],
[
63,
65
],
[
61,
66
],
[
66,
67
],
[
56,
68
],
[
68,
69
],
[
69,
70
],
[
70,
71
],
[
71,
72
],
[
71,
73
],
[
69,
74
],
[
74,
75
],
[
74,
76
],
[
8,
77
],
[
77,
78
],
[
78,
79
],
[
6,
80
],
[
80,
81
],
[
0,
82
],
[
82,
83
],
[
82,
84
]
] |
[
"import java.util.*;\npublic class Main {\n\tpublic static void main(String[] args){\n \t\n\t\tScanner sc = new Scanner(System.in);\n\t\tint N = sc.nextInt();\n\t\tint M = sc.nextInt();\n\t\tint arr[] = new int[M];\n\t\tint sumday = 0;\n\t\tfor (int i = 0; i < arr.length; i++) {\n\t\t\tarr[i] = sc.nextInt();\n\t\t\tsumday += arr[i];\n\t\t}\n\n\t\tif (sumday>N) {\n\t\t\tSystem.out.println(-1);\n\t\t} else {\n\t\t\tSystem.out.println(N-sumday);\n\t\t}\n\t\tsc.close();\n }\t\n\t\t\n}",
"import java.util.*;",
"util.*",
"java",
"public class Main {\n\tpublic static void main(String[] args){\n \t\n\t\tScanner sc = new Scanner(System.in);\n\t\tint N = sc.nextInt();\n\t\tint M = sc.nextInt();\n\t\tint arr[] = new int[M];\n\t\tint sumday = 0;\n\t\tfor (int i = 0; i < arr.length; i++) {\n\t\t\tarr[i] = sc.nextInt();\n\t\t\tsumday += arr[i];\n\t\t}\n\n\t\tif (sumday>N) {\n\t\t\tSystem.out.println(-1);\n\t\t} else {\n\t\t\tSystem.out.println(N-sumday);\n\t\t}\n\t\tsc.close();\n }\t\n\t\t\n}",
"Main",
"public static void main(String[] args){\n \t\n\t\tScanner sc = new Scanner(System.in);\n\t\tint N = sc.nextInt();\n\t\tint M = sc.nextInt();\n\t\tint arr[] = new int[M];\n\t\tint sumday = 0;\n\t\tfor (int i = 0; i < arr.length; i++) {\n\t\t\tarr[i] = sc.nextInt();\n\t\t\tsumday += arr[i];\n\t\t}\n\n\t\tif (sumday>N) {\n\t\t\tSystem.out.println(-1);\n\t\t} else {\n\t\t\tSystem.out.println(N-sumday);\n\t\t}\n\t\tsc.close();\n }",
"main",
"{\n \t\n\t\tScanner sc = new Scanner(System.in);\n\t\tint N = sc.nextInt();\n\t\tint M = sc.nextInt();\n\t\tint arr[] = new int[M];\n\t\tint sumday = 0;\n\t\tfor (int i = 0; i < arr.length; i++) {\n\t\t\tarr[i] = sc.nextInt();\n\t\t\tsumday += arr[i];\n\t\t}\n\n\t\tif (sumday>N) {\n\t\t\tSystem.out.println(-1);\n\t\t} else {\n\t\t\tSystem.out.println(N-sumday);\n\t\t}\n\t\tsc.close();\n }",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"int N = sc.nextInt();",
"N",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int M = sc.nextInt();",
"M",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int arr[] = new int[M];",
"arr",
"new int[M]",
"M",
"int sumday = 0;",
"sumday",
"0",
"for (int i = 0; i < arr.length; i++) {\n\t\t\tarr[i] = sc.nextInt();\n\t\t\tsumday += arr[i];\n\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < arr.length",
"i",
"arr.length",
"arr",
"arr.length",
"i++",
"i++",
"i",
"{\n\t\t\tarr[i] = sc.nextInt();\n\t\t\tsumday += arr[i];\n\t\t}",
"{\n\t\t\tarr[i] = sc.nextInt();\n\t\t\tsumday += arr[i];\n\t\t}",
"arr[i] = sc.nextInt()",
"arr[i]",
"arr",
"i",
"sc.nextInt()",
"sc.nextInt",
"sc",
"sumday += arr[i]",
"sumday",
"arr[i]",
"arr",
"i",
"if (sumday>N) {\n\t\t\tSystem.out.println(-1);\n\t\t} else {\n\t\t\tSystem.out.println(N-sumday);\n\t\t}",
"sumday>N",
"sumday",
"N",
"{\n\t\t\tSystem.out.println(-1);\n\t\t}",
"System.out.println(-1)",
"System.out.println",
"System.out",
"System",
"System.out",
"-1",
"1",
"{\n\t\t\tSystem.out.println(N-sumday);\n\t\t}",
"System.out.println(N-sumday)",
"System.out.println",
"System.out",
"System",
"System.out",
"N-sumday",
"N",
"sumday",
"sc.close()",
"sc.close",
"sc",
"String[] args",
"args",
"public class Main {\n\tpublic static void main(String[] args){\n \t\n\t\tScanner sc = new Scanner(System.in);\n\t\tint N = sc.nextInt();\n\t\tint M = sc.nextInt();\n\t\tint arr[] = new int[M];\n\t\tint sumday = 0;\n\t\tfor (int i = 0; i < arr.length; i++) {\n\t\t\tarr[i] = sc.nextInt();\n\t\t\tsumday += arr[i];\n\t\t}\n\n\t\tif (sumday>N) {\n\t\t\tSystem.out.println(-1);\n\t\t} else {\n\t\t\tSystem.out.println(N-sumday);\n\t\t}\n\t\tsc.close();\n }\t\n\t\t\n}",
"public class Main {\n\tpublic static void main(String[] args){\n \t\n\t\tScanner sc = new Scanner(System.in);\n\t\tint N = sc.nextInt();\n\t\tint M = sc.nextInt();\n\t\tint arr[] = new int[M];\n\t\tint sumday = 0;\n\t\tfor (int i = 0; i < arr.length; i++) {\n\t\t\tarr[i] = sc.nextInt();\n\t\t\tsumday += arr[i];\n\t\t}\n\n\t\tif (sumday>N) {\n\t\t\tSystem.out.println(-1);\n\t\t} else {\n\t\t\tSystem.out.println(N-sumday);\n\t\t}\n\t\tsc.close();\n }\t\n\t\t\n}",
"Main"
] |
import java.util.*;
public class Main {
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
int N = sc.nextInt();
int M = sc.nextInt();
int arr[] = new int[M];
int sumday = 0;
for (int i = 0; i < arr.length; i++) {
arr[i] = sc.nextInt();
sumday += arr[i];
}
if (sumday>N) {
System.out.println(-1);
} else {
System.out.println(N-sumday);
}
sc.close();
}
}
|
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
4,
13,
41,
13,
4,
18,
18,
13,
17,
17,
41,
13,
4,
18,
13,
18,
13,
17,
41,
13,
4,
18,
13,
18,
13,
17,
41,
13,
4,
18,
18,
13,
17,
17,
41,
13,
20,
18,
13,
13,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
18,
13,
13,
4,
18,
13,
18,
13,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
2,
13,
18,
13,
13,
14,
2,
13,
13,
30,
4,
18,
18,
13,
13,
2,
13,
13,
30,
4,
18,
18,
13,
13,
40,
17,
23,
13,
12,
13,
30,
41,
13,
20,
41,
13,
20,
42,
4,
18,
13,
30,
4,
18,
13,
4,
18,
13,
29,
4,
18,
13,
20,
4,
18,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
149,
5
],
[
149,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
11,
12
],
[
8,
13
],
[
13,
14
],
[
13,
15
],
[
15,
16
],
[
16,
17
],
[
17,
18
],
[
17,
19
],
[
15,
20
],
[
8,
21
],
[
21,
22
],
[
21,
23
],
[
23,
24
],
[
24,
25
],
[
23,
26
],
[
26,
27
],
[
26,
28
],
[
8,
29
],
[
29,
30
],
[
29,
31
],
[
31,
32
],
[
32,
33
],
[
31,
34
],
[
34,
35
],
[
34,
36
],
[
8,
37
],
[
37,
38
],
[
37,
39
],
[
39,
40
],
[
40,
41
],
[
41,
42
],
[
41,
43
],
[
39,
44
],
[
8,
45
],
[
45,
46
],
[
45,
47
],
[
48,
49
],
[
48,
50
],
[
8,
51
],
[
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
],
[
68,
69
],
[
68,
70
],
[
67,
71
],
[
71,
72
],
[
72,
73
],
[
71,
74
],
[
74,
75
],
[
74,
76
],
[
8,
77
],
[
77,
78
],
[
78,
79
],
[
79,
80
],
[
79,
81
],
[
77,
82
],
[
82,
83
],
[
82,
84
],
[
77,
85
],
[
85,
86
],
[
86,
87
],
[
77,
88
],
[
89,
89
],
[
89,
90
],
[
90,
91
],
[
90,
92
],
[
92,
93
],
[
92,
94
],
[
94,
95
],
[
94,
96
],
[
8,
97
],
[
97,
98
],
[
98,
99
],
[
98,
100
],
[
97,
101
],
[
101,
102
],
[
102,
103
],
[
103,
104
],
[
104,
105
],
[
104,
106
],
[
102,
107
],
[
107,
108
],
[
107,
109
],
[
97,
110
],
[
110,
111
],
[
111,
112
],
[
112,
113
],
[
113,
114
],
[
113,
115
],
[
111,
116
],
[
116,
117
],
[
6,
118
],
[
118,
119
],
[
149,
120
],
[
120,
121
],
[
120,
122
],
[
122,
123
],
[
123,
124
],
[
123,
125
],
[
122,
126
],
[
126,
127
],
[
126,
128
],
[
122,
129
],
[
129,
130
],
[
130,
131
],
[
131,
132
],
[
129,
133
],
[
133,
134
],
[
134,
135
],
[
135,
136
],
[
134,
137
],
[
137,
138
],
[
138,
139
],
[
122,
140
],
[
140,
141
],
[
141,
142
],
[
142,
143
],
[
141,
144
],
[
145,
146
],
[
146,
147
],
[
0,
148
],
[
148,
149
],
[
148,
150
]
] |
[
"import java.util.*;\npublic class Main {\n public static void main(String[] args) throws Exception {\n String[] lines = getStdin();\n String[] str = lines[0].split(\" \");\n int n = Integer.parseInt(str[0]);\n int m = Integer.parseInt(str[1]);\n String[] a = lines[1].split(\" \");\n int[] aa = new int[a.length];\n int plus = 0;\n \n for (int i = 0; i < m; i++){\n aa[i] = Integer.parseInt(a[i]);\n }\n for(int i = 0; i < m; i++){\n plus = plus + aa[i];\n }\n if(n >= plus){\n System.out.println(n - plus);\n } else {\n System.out.println(-1);\n }\n }\n private static String[] getStdin() {\n Scanner scanner = new Scanner(System.in);\n ArrayList<String> lines = new ArrayList<>();\n while (scanner.hasNext()) {\n lines.add(scanner.nextLine());\n }\n return lines.toArray(new String[lines.size()]);\n }\n}",
"import java.util.*;",
"util.*",
"java",
"public class Main {\n public static void main(String[] args) throws Exception {\n String[] lines = getStdin();\n String[] str = lines[0].split(\" \");\n int n = Integer.parseInt(str[0]);\n int m = Integer.parseInt(str[1]);\n String[] a = lines[1].split(\" \");\n int[] aa = new int[a.length];\n int plus = 0;\n \n for (int i = 0; i < m; i++){\n aa[i] = Integer.parseInt(a[i]);\n }\n for(int i = 0; i < m; i++){\n plus = plus + aa[i];\n }\n if(n >= plus){\n System.out.println(n - plus);\n } else {\n System.out.println(-1);\n }\n }\n private static String[] getStdin() {\n Scanner scanner = new Scanner(System.in);\n ArrayList<String> lines = new ArrayList<>();\n while (scanner.hasNext()) {\n lines.add(scanner.nextLine());\n }\n return lines.toArray(new String[lines.size()]);\n }\n}",
"Main",
"public static void main(String[] args) throws Exception {\n String[] lines = getStdin();\n String[] str = lines[0].split(\" \");\n int n = Integer.parseInt(str[0]);\n int m = Integer.parseInt(str[1]);\n String[] a = lines[1].split(\" \");\n int[] aa = new int[a.length];\n int plus = 0;\n \n for (int i = 0; i < m; i++){\n aa[i] = Integer.parseInt(a[i]);\n }\n for(int i = 0; i < m; i++){\n plus = plus + aa[i];\n }\n if(n >= plus){\n System.out.println(n - plus);\n } else {\n System.out.println(-1);\n }\n }",
"main",
"{\n String[] lines = getStdin();\n String[] str = lines[0].split(\" \");\n int n = Integer.parseInt(str[0]);\n int m = Integer.parseInt(str[1]);\n String[] a = lines[1].split(\" \");\n int[] aa = new int[a.length];\n int plus = 0;\n \n for (int i = 0; i < m; i++){\n aa[i] = Integer.parseInt(a[i]);\n }\n for(int i = 0; i < m; i++){\n plus = plus + aa[i];\n }\n if(n >= plus){\n System.out.println(n - plus);\n } else {\n System.out.println(-1);\n }\n }",
"String[] lines = getStdin();",
"lines",
"getStdin()",
"getStdin",
"String[] str = lines[0].split(\" \");",
"str",
"lines[0].split(\" \")",
"lines[0].split",
"lines[0]",
"lines",
"0",
"\" \"",
"int n = Integer.parseInt(str[0]);",
"n",
"Integer.parseInt(str[0])",
"Integer.parseInt",
"Integer",
"str[0]",
"str",
"0",
"int m = Integer.parseInt(str[1]);",
"m",
"Integer.parseInt(str[1])",
"Integer.parseInt",
"Integer",
"str[1]",
"str",
"1",
"String[] a = lines[1].split(\" \");",
"a",
"lines[1].split(\" \")",
"lines[1].split",
"lines[1]",
"lines",
"1",
"\" \"",
"int[] aa = new int[a.length];",
"aa",
"new int[a.length]",
"a.length",
"a",
"a.length",
"int plus = 0;",
"plus",
"0",
"for (int i = 0; i < m; i++){\n aa[i] = Integer.parseInt(a[i]);\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < m",
"i",
"m",
"i++",
"i++",
"i",
"{\n aa[i] = Integer.parseInt(a[i]);\n }",
"{\n aa[i] = Integer.parseInt(a[i]);\n }",
"aa[i] = Integer.parseInt(a[i])",
"aa[i]",
"aa",
"i",
"Integer.parseInt(a[i])",
"Integer.parseInt",
"Integer",
"a[i]",
"a",
"i",
"for(int i = 0; i < m; i++){\n plus = plus + aa[i];\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < m",
"i",
"m",
"i++",
"i++",
"i",
"{\n plus = plus + aa[i];\n }",
"{\n plus = plus + aa[i];\n }",
"plus = plus + aa[i]",
"plus",
"plus + aa[i]",
"plus",
"aa[i]",
"aa",
"i",
"if(n >= plus){\n System.out.println(n - plus);\n } else {\n System.out.println(-1);\n }",
"n >= plus",
"n",
"plus",
"{\n System.out.println(n - plus);\n }",
"System.out.println(n - plus)",
"System.out.println",
"System.out",
"System",
"System.out",
"n - plus",
"n",
"plus",
"{\n System.out.println(-1);\n }",
"System.out.println(-1)",
"System.out.println",
"System.out",
"System",
"System.out",
"-1",
"1",
"String[] args",
"args",
"private static String[] getStdin() {\n Scanner scanner = new Scanner(System.in);\n ArrayList<String> lines = new ArrayList<>();\n while (scanner.hasNext()) {\n lines.add(scanner.nextLine());\n }\n return lines.toArray(new String[lines.size()]);\n }",
"getStdin",
"{\n Scanner scanner = new Scanner(System.in);\n ArrayList<String> lines = new ArrayList<>();\n while (scanner.hasNext()) {\n lines.add(scanner.nextLine());\n }\n return lines.toArray(new String[lines.size()]);\n }",
"Scanner scanner = new Scanner(System.in);",
"scanner",
"new Scanner(System.in)",
"ArrayList<String> lines = new ArrayList<>();",
"lines",
"new ArrayList<>()",
"while (scanner.hasNext()) {\n lines.add(scanner.nextLine());\n }",
"scanner.hasNext()",
"scanner.hasNext",
"scanner",
"{\n lines.add(scanner.nextLine());\n }",
"lines.add(scanner.nextLine())",
"lines.add",
"lines",
"scanner.nextLine()",
"scanner.nextLine",
"scanner",
"return lines.toArray(new String[lines.size()]);",
"lines.toArray(new String[lines.size()])",
"lines.toArray",
"lines",
"new String[lines.size()]",
"lines.size()",
"lines.size",
"lines",
"public class Main {\n public static void main(String[] args) throws Exception {\n String[] lines = getStdin();\n String[] str = lines[0].split(\" \");\n int n = Integer.parseInt(str[0]);\n int m = Integer.parseInt(str[1]);\n String[] a = lines[1].split(\" \");\n int[] aa = new int[a.length];\n int plus = 0;\n \n for (int i = 0; i < m; i++){\n aa[i] = Integer.parseInt(a[i]);\n }\n for(int i = 0; i < m; i++){\n plus = plus + aa[i];\n }\n if(n >= plus){\n System.out.println(n - plus);\n } else {\n System.out.println(-1);\n }\n }\n private static String[] getStdin() {\n Scanner scanner = new Scanner(System.in);\n ArrayList<String> lines = new ArrayList<>();\n while (scanner.hasNext()) {\n lines.add(scanner.nextLine());\n }\n return lines.toArray(new String[lines.size()]);\n }\n}",
"public class Main {\n public static void main(String[] args) throws Exception {\n String[] lines = getStdin();\n String[] str = lines[0].split(\" \");\n int n = Integer.parseInt(str[0]);\n int m = Integer.parseInt(str[1]);\n String[] a = lines[1].split(\" \");\n int[] aa = new int[a.length];\n int plus = 0;\n \n for (int i = 0; i < m; i++){\n aa[i] = Integer.parseInt(a[i]);\n }\n for(int i = 0; i < m; i++){\n plus = plus + aa[i];\n }\n if(n >= plus){\n System.out.println(n - plus);\n } else {\n System.out.println(-1);\n }\n }\n private static String[] getStdin() {\n Scanner scanner = new Scanner(System.in);\n ArrayList<String> lines = new ArrayList<>();\n while (scanner.hasNext()) {\n lines.add(scanner.nextLine());\n }\n return lines.toArray(new String[lines.size()]);\n }\n}",
"Main"
] |
import java.util.*;
public class Main {
public static void main(String[] args) throws Exception {
String[] lines = getStdin();
String[] str = lines[0].split(" ");
int n = Integer.parseInt(str[0]);
int m = Integer.parseInt(str[1]);
String[] a = lines[1].split(" ");
int[] aa = new int[a.length];
int plus = 0;
for (int i = 0; i < m; i++){
aa[i] = Integer.parseInt(a[i]);
}
for(int i = 0; i < m; i++){
plus = plus + aa[i];
}
if(n >= plus){
System.out.println(n - plus);
} else {
System.out.println(-1);
}
}
private static String[] getStdin() {
Scanner scanner = new Scanner(System.in);
ArrayList<String> lines = new ArrayList<>();
while (scanner.hasNext()) {
lines.add(scanner.nextLine());
}
return lines.toArray(new String[lines.size()]);
}
}
|
[
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,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
41,
13,
4,
18,
13,
0,
13,
13,
14,
2,
2,
13,
13,
17,
30,
4,
18,
18,
13,
13,
2,
13,
13,
30,
4,
18,
18,
13,
13,
40,
17,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
72,
5
],
[
72,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
8,
17
],
[
17,
18
],
[
17,
19
],
[
19,
20
],
[
20,
21
],
[
8,
22
],
[
22,
23
],
[
22,
24
],
[
8,
25
],
[
25,
26
],
[
26,
27
],
[
27,
28
],
[
27,
29
],
[
25,
30
],
[
30,
31
],
[
30,
32
],
[
25,
33
],
[
33,
34
],
[
34,
35
],
[
25,
36
],
[
37,
37
],
[
37,
38
],
[
38,
39
],
[
38,
40
],
[
40,
41
],
[
41,
42
],
[
37,
43
],
[
43,
44
],
[
43,
45
],
[
8,
46
],
[
46,
47
],
[
47,
48
],
[
48,
49
],
[
48,
50
],
[
47,
51
],
[
46,
52
],
[
52,
53
],
[
53,
54
],
[
54,
55
],
[
55,
56
],
[
55,
57
],
[
53,
58
],
[
58,
59
],
[
58,
60
],
[
46,
61
],
[
61,
62
],
[
62,
63
],
[
63,
64
],
[
64,
65
],
[
64,
66
],
[
62,
67
],
[
67,
68
],
[
6,
69
],
[
69,
70
],
[
0,
71
],
[
71,
72
],
[
71,
73
]
] |
[
"import java.util.Scanner;\npublic class Main {\n\tpublic static void main(String[] args){\n\n//\tๅ
ฅๅใฎ่ชญใฟ่พผใฟ\n\t\tScanner sc = new Scanner(System.in);\n\t\tint natsuyasumi = sc.nextInt();\n\t\tint kazu = sc.nextInt();\n\t\tint shukudaiyaruhi = 0;\n\n//\tๅฎฟ้กใฎๆฐๅใๅฎฟ้กใใๆฅใๅฎฟ้ก็ชๅทๅใ ใๅขใใ\n\t\tfor(int i=0 ; i<kazu ; i++) {\n\t\t\tint bangou = sc.nextInt();\n\t\t\tshukudaiyaruhi += bangou;\n\t\t}\n\n//\t้ในใๆฅๆฐใ0ๆฅไปฅไธใใฉใใๅคๆญ\n\t\tif(natsuyasumi-shukudaiyaruhi>=0) {\n\t\t\tSystem.out.print(natsuyasumi-shukudaiyaruhi);\n\t\t}\n\t\telse {\n\t\t\tSystem.out.print(-1);\n\t\t}\n\t}\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n\tpublic static void main(String[] args){\n\n//\tๅ
ฅๅใฎ่ชญใฟ่พผใฟ\n\t\tScanner sc = new Scanner(System.in);\n\t\tint natsuyasumi = sc.nextInt();\n\t\tint kazu = sc.nextInt();\n\t\tint shukudaiyaruhi = 0;\n\n//\tๅฎฟ้กใฎๆฐๅใๅฎฟ้กใใๆฅใๅฎฟ้ก็ชๅทๅใ ใๅขใใ\n\t\tfor(int i=0 ; i<kazu ; i++) {\n\t\t\tint bangou = sc.nextInt();\n\t\t\tshukudaiyaruhi += bangou;\n\t\t}\n\n//\t้ในใๆฅๆฐใ0ๆฅไปฅไธใใฉใใๅคๆญ\n\t\tif(natsuyasumi-shukudaiyaruhi>=0) {\n\t\t\tSystem.out.print(natsuyasumi-shukudaiyaruhi);\n\t\t}\n\t\telse {\n\t\t\tSystem.out.print(-1);\n\t\t}\n\t}\n}",
"Main",
"public static void main(String[] args){\n\n//\tๅ
ฅๅใฎ่ชญใฟ่พผใฟ\n\t\tScanner sc = new Scanner(System.in);\n\t\tint natsuyasumi = sc.nextInt();\n\t\tint kazu = sc.nextInt();\n\t\tint shukudaiyaruhi = 0;\n\n//\tๅฎฟ้กใฎๆฐๅใๅฎฟ้กใใๆฅใๅฎฟ้ก็ชๅทๅใ ใๅขใใ\n\t\tfor(int i=0 ; i<kazu ; i++) {\n\t\t\tint bangou = sc.nextInt();\n\t\t\tshukudaiyaruhi += bangou;\n\t\t}\n\n//\t้ในใๆฅๆฐใ0ๆฅไปฅไธใใฉใใๅคๆญ\n\t\tif(natsuyasumi-shukudaiyaruhi>=0) {\n\t\t\tSystem.out.print(natsuyasumi-shukudaiyaruhi);\n\t\t}\n\t\telse {\n\t\t\tSystem.out.print(-1);\n\t\t}\n\t}",
"main",
"{\n\n//\tๅ
ฅๅใฎ่ชญใฟ่พผใฟ\n\t\tScanner sc = new Scanner(System.in);\n\t\tint natsuyasumi = sc.nextInt();\n\t\tint kazu = sc.nextInt();\n\t\tint shukudaiyaruhi = 0;\n\n//\tๅฎฟ้กใฎๆฐๅใๅฎฟ้กใใๆฅใๅฎฟ้ก็ชๅทๅใ ใๅขใใ\n\t\tfor(int i=0 ; i<kazu ; i++) {\n\t\t\tint bangou = sc.nextInt();\n\t\t\tshukudaiyaruhi += bangou;\n\t\t}\n\n//\t้ในใๆฅๆฐใ0ๆฅไปฅไธใใฉใใๅคๆญ\n\t\tif(natsuyasumi-shukudaiyaruhi>=0) {\n\t\t\tSystem.out.print(natsuyasumi-shukudaiyaruhi);\n\t\t}\n\t\telse {\n\t\t\tSystem.out.print(-1);\n\t\t}\n\t}",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"int natsuyasumi = sc.nextInt();",
"natsuyasumi",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int kazu = sc.nextInt();",
"kazu",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int shukudaiyaruhi = 0;",
"shukudaiyaruhi",
"0",
"for(int i=0 ; i<kazu ; i++) {\n\t\t\tint bangou = sc.nextInt();\n\t\t\tshukudaiyaruhi += bangou;\n\t\t}",
"int i=0 ;",
"int i=0 ;",
"i",
"0",
"i<kazu",
"i",
"kazu",
"i++",
"i++",
"i",
"{\n\t\t\tint bangou = sc.nextInt();\n\t\t\tshukudaiyaruhi += bangou;\n\t\t}",
"{\n\t\t\tint bangou = sc.nextInt();\n\t\t\tshukudaiyaruhi += bangou;\n\t\t}",
"int bangou = sc.nextInt();",
"bangou",
"sc.nextInt()",
"sc.nextInt",
"sc",
"shukudaiyaruhi += bangou",
"shukudaiyaruhi",
"bangou",
"if(natsuyasumi-shukudaiyaruhi>=0) {\n\t\t\tSystem.out.print(natsuyasumi-shukudaiyaruhi);\n\t\t}\n\t\telse {\n\t\t\tSystem.out.print(-1);\n\t\t}",
"natsuyasumi-shukudaiyaruhi>=0",
"natsuyasumi-shukudaiyaruhi",
"natsuyasumi",
"shukudaiyaruhi",
"0",
"{\n\t\t\tSystem.out.print(natsuyasumi-shukudaiyaruhi);\n\t\t}",
"System.out.print(natsuyasumi-shukudaiyaruhi)",
"System.out.print",
"System.out",
"System",
"System.out",
"natsuyasumi-shukudaiyaruhi",
"natsuyasumi",
"shukudaiyaruhi",
"{\n\t\t\tSystem.out.print(-1);\n\t\t}",
"System.out.print(-1)",
"System.out.print",
"System.out",
"System",
"System.out",
"-1",
"1",
"String[] args",
"args",
"public class Main {\n\tpublic static void main(String[] args){\n\n//\tๅ
ฅๅใฎ่ชญใฟ่พผใฟ\n\t\tScanner sc = new Scanner(System.in);\n\t\tint natsuyasumi = sc.nextInt();\n\t\tint kazu = sc.nextInt();\n\t\tint shukudaiyaruhi = 0;\n\n//\tๅฎฟ้กใฎๆฐๅใๅฎฟ้กใใๆฅใๅฎฟ้ก็ชๅทๅใ ใๅขใใ\n\t\tfor(int i=0 ; i<kazu ; i++) {\n\t\t\tint bangou = sc.nextInt();\n\t\t\tshukudaiyaruhi += bangou;\n\t\t}\n\n//\t้ในใๆฅๆฐใ0ๆฅไปฅไธใใฉใใๅคๆญ\n\t\tif(natsuyasumi-shukudaiyaruhi>=0) {\n\t\t\tSystem.out.print(natsuyasumi-shukudaiyaruhi);\n\t\t}\n\t\telse {\n\t\t\tSystem.out.print(-1);\n\t\t}\n\t}\n}",
"public class Main {\n\tpublic static void main(String[] args){\n\n//\tๅ
ฅๅใฎ่ชญใฟ่พผใฟ\n\t\tScanner sc = new Scanner(System.in);\n\t\tint natsuyasumi = sc.nextInt();\n\t\tint kazu = sc.nextInt();\n\t\tint shukudaiyaruhi = 0;\n\n//\tๅฎฟ้กใฎๆฐๅใๅฎฟ้กใใๆฅใๅฎฟ้ก็ชๅทๅใ ใๅขใใ\n\t\tfor(int i=0 ; i<kazu ; i++) {\n\t\t\tint bangou = sc.nextInt();\n\t\t\tshukudaiyaruhi += bangou;\n\t\t}\n\n//\t้ในใๆฅๆฐใ0ๆฅไปฅไธใใฉใใๅคๆญ\n\t\tif(natsuyasumi-shukudaiyaruhi>=0) {\n\t\t\tSystem.out.print(natsuyasumi-shukudaiyaruhi);\n\t\t}\n\t\telse {\n\t\t\tSystem.out.print(-1);\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 natsuyasumi = sc.nextInt();
int kazu = sc.nextInt();
int shukudaiyaruhi = 0;
// ๅฎฟ้กใฎๆฐๅใๅฎฟ้กใใๆฅใๅฎฟ้ก็ชๅทๅใ ใๅขใใ
for(int i=0 ; i<kazu ; i++) {
int bangou = sc.nextInt();
shukudaiyaruhi += bangou;
}
// ้ในใๆฅๆฐใ0ๆฅไปฅไธใใฉใใๅคๆญ
if(natsuyasumi-shukudaiyaruhi>=0) {
System.out.print(natsuyasumi-shukudaiyaruhi);
}
else {
System.out.print(-1);
}
}
}
|
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
41,
13,
17,
41,
13,
41,
13,
41,
13,
17,
12,
13,
30,
41,
13,
4,
13,
41,
13,
4,
13,
41,
13,
17,
42,
2,
40,
13,
17,
30,
41,
13,
4,
13,
0,
13,
13,
14,
2,
13,
13,
4,
13,
2,
13,
13,
4,
13,
40,
17,
12,
13,
30,
0,
13,
20,
0,
13,
20,
41,
13,
17,
14,
40,
13,
0,
13,
20,
41,
13,
4,
18,
13,
4,
13,
4,
18,
13,
14,
40,
13,
4,
18,
18,
13,
13,
2,
2,
4,
18,
13,
13,
17,
4,
18,
18,
13,
13,
23,
13,
12,
13,
30,
4,
18,
13,
13,
23,
13,
12,
13,
30,
4,
18,
13,
13,
23,
13,
12,
13,
30,
4,
18,
13,
13,
4,
18,
18,
13,
13,
23,
13,
12,
13,
30,
29,
4,
18,
13,
12,
13,
30,
29,
4,
18,
13,
12,
13,
30,
29,
4,
18,
13,
12,
13,
30,
29,
4,
18,
13,
12,
13,
30,
29,
4,
18,
13,
12,
13,
30,
29,
8,
2,
13,
17,
13,
4,
13,
13,
2,
13,
13,
23,
13,
23,
13,
12,
13,
30,
29,
8,
2,
13,
17,
13,
4,
13,
13,
2,
13,
13,
23,
13,
23,
13,
12,
13,
30,
29,
8,
2,
13,
17,
17,
2,
17,
4,
13,
2,
13,
2,
13,
17,
23,
13,
6,
13,
41,
13,
41,
13,
12,
13,
30,
0,
13,
20,
12,
13,
30,
0,
13,
20,
23,
13,
12,
13,
30,
42,
2,
2,
13,
17,
40,
4,
18,
13,
30,
38,
5,
13,
30,
4,
18,
13,
30,
0,
13,
20,
29,
4,
18,
13,
12,
13,
30,
29,
4,
18,
13,
4,
13,
12,
13,
30,
29,
4,
18,
13,
4,
13,
12,
13,
30,
29,
4,
18,
13,
4,
13,
12,
13,
30,
41,
13,
17,
38,
5,
13,
30,
4,
18,
13,
30,
0,
13,
4,
18,
13,
29,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
334,
11
],
[
334,
12
],
[
12,
13
],
[
12,
14
],
[
334,
15
],
[
15,
16
],
[
334,
17
],
[
17,
18
],
[
334,
19
],
[
19,
20
],
[
19,
21
],
[
334,
22
],
[
22,
23
],
[
22,
24
],
[
24,
25
],
[
25,
26
],
[
25,
27
],
[
27,
28
],
[
24,
29
],
[
29,
30
],
[
29,
31
],
[
31,
32
],
[
24,
33
],
[
33,
34
],
[
33,
35
],
[
24,
36
],
[
36,
37
],
[
37,
38
],
[
38,
39
],
[
37,
40
],
[
36,
41
],
[
41,
42
],
[
42,
43
],
[
42,
44
],
[
44,
45
],
[
41,
46
],
[
46,
47
],
[
46,
48
],
[
24,
49
],
[
49,
50
],
[
50,
51
],
[
50,
52
],
[
49,
53
],
[
53,
54
],
[
53,
55
],
[
55,
56
],
[
55,
57
],
[
49,
58
],
[
58,
59
],
[
58,
60
],
[
60,
61
],
[
334,
62
],
[
62,
63
],
[
62,
64
],
[
64,
65
],
[
65,
66
],
[
65,
67
],
[
64,
68
],
[
68,
69
],
[
68,
70
],
[
64,
71
],
[
71,
72
],
[
71,
73
],
[
64,
74
],
[
74,
75
],
[
75,
76
],
[
74,
77
],
[
77,
78
],
[
77,
79
],
[
64,
80
],
[
80,
81
],
[
80,
82
],
[
82,
83
],
[
83,
84
],
[
64,
85
],
[
85,
86
],
[
64,
87
],
[
87,
88
],
[
88,
89
],
[
64,
90
],
[
90,
91
],
[
91,
92
],
[
90,
93
],
[
93,
94
],
[
94,
95
],
[
95,
96
],
[
95,
97
],
[
93,
98
],
[
98,
99
],
[
99,
100
],
[
100,
101
],
[
101,
102
],
[
99,
103
],
[
98,
104
],
[
64,
105
],
[
105,
106
],
[
106,
107
],
[
107,
108
],
[
107,
109
],
[
62,
110
],
[
110,
111
],
[
334,
112
],
[
112,
113
],
[
112,
114
],
[
114,
115
],
[
115,
116
],
[
116,
117
],
[
115,
118
],
[
112,
119
],
[
119,
120
],
[
334,
121
],
[
121,
122
],
[
121,
123
],
[
123,
124
],
[
124,
125
],
[
125,
126
],
[
124,
127
],
[
121,
128
],
[
128,
129
],
[
334,
130
],
[
130,
131
],
[
130,
132
],
[
132,
133
],
[
133,
134
],
[
134,
135
],
[
133,
136
],
[
132,
137
],
[
137,
138
],
[
138,
139
],
[
139,
140
],
[
139,
141
],
[
130,
142
],
[
142,
143
],
[
334,
144
],
[
144,
145
],
[
144,
146
],
[
146,
147
],
[
147,
148
],
[
148,
149
],
[
149,
150
],
[
334,
151
],
[
151,
152
],
[
151,
153
],
[
153,
154
],
[
154,
155
],
[
155,
156
],
[
156,
157
],
[
334,
158
],
[
158,
159
],
[
158,
160
],
[
160,
161
],
[
161,
162
],
[
162,
163
],
[
163,
164
],
[
334,
165
],
[
165,
166
],
[
165,
167
],
[
167,
168
],
[
168,
169
],
[
169,
170
],
[
170,
171
],
[
334,
172
],
[
172,
173
],
[
172,
174
],
[
174,
175
],
[
175,
176
],
[
176,
177
],
[
177,
178
],
[
334,
179
],
[
179,
180
],
[
179,
181
],
[
181,
182
],
[
182,
183
],
[
183,
184
],
[
184,
185
],
[
184,
186
],
[
183,
187
],
[
183,
188
],
[
188,
189
],
[
188,
190
],
[
188,
191
],
[
191,
192
],
[
191,
193
],
[
179,
194
],
[
194,
195
],
[
179,
196
],
[
196,
197
],
[
334,
198
],
[
198,
199
],
[
198,
200
],
[
200,
201
],
[
201,
202
],
[
202,
203
],
[
203,
204
],
[
203,
205
],
[
202,
206
],
[
202,
207
],
[
207,
208
],
[
207,
209
],
[
207,
210
],
[
210,
211
],
[
210,
212
],
[
198,
213
],
[
213,
214
],
[
198,
215
],
[
215,
216
],
[
334,
217
],
[
217,
218
],
[
217,
219
],
[
219,
220
],
[
220,
221
],
[
221,
222
],
[
222,
223
],
[
222,
224
],
[
221,
225
],
[
221,
226
],
[
226,
227
],
[
226,
228
],
[
228,
229
],
[
228,
230
],
[
230,
231
],
[
230,
232
],
[
232,
233
],
[
232,
234
],
[
217,
235
],
[
235,
236
],
[
334,
237
],
[
237,
238
],
[
237,
239
],
[
239,
240
],
[
237,
241
],
[
241,
242
],
[
237,
243
],
[
243,
244
],
[
243,
245
],
[
245,
246
],
[
246,
247
],
[
246,
248
],
[
237,
249
],
[
249,
250
],
[
249,
251
],
[
251,
252
],
[
252,
253
],
[
252,
254
],
[
249,
255
],
[
255,
256
],
[
237,
257
],
[
257,
258
],
[
257,
259
],
[
259,
260
],
[
260,
261
],
[
261,
262
],
[
262,
263
],
[
262,
264
],
[
261,
265
],
[
265,
266
],
[
266,
267
],
[
267,
268
],
[
260,
269
],
[
269,
270
],
[
270,
271
],
[
271,
272
],
[
271,
273
],
[
273,
274
],
[
274,
275
],
[
275,
276
],
[
270,
277
],
[
277,
278
],
[
278,
279
],
[
278,
280
],
[
259,
281
],
[
281,
282
],
[
282,
283
],
[
283,
284
],
[
237,
285
],
[
285,
286
],
[
285,
287
],
[
287,
288
],
[
288,
289
],
[
289,
290
],
[
290,
291
],
[
289,
292
],
[
292,
293
],
[
237,
294
],
[
294,
295
],
[
294,
296
],
[
296,
297
],
[
297,
298
],
[
298,
299
],
[
299,
300
],
[
298,
301
],
[
301,
302
],
[
237,
303
],
[
303,
304
],
[
303,
305
],
[
305,
306
],
[
306,
307
],
[
307,
308
],
[
308,
309
],
[
307,
310
],
[
310,
311
],
[
237,
312
],
[
312,
313
],
[
312,
314
],
[
314,
315
],
[
315,
316
],
[
315,
317
],
[
314,
318
],
[
318,
319
],
[
319,
320
],
[
319,
321
],
[
321,
322
],
[
322,
323
],
[
323,
324
],
[
318,
325
],
[
325,
326
],
[
326,
327
],
[
326,
328
],
[
328,
329
],
[
329,
330
],
[
314,
331
],
[
331,
332
],
[
0,
333
],
[
333,
334
],
[
333,
335
]
] |
[
"import java.util.*;\nimport java.io.*;\nimport java.math.*;\npublic class Main\n{\n static double pi=3.14285714;\n public static void process()throws IOException\n {\n long n=nl();\n long m=nl();\n long sum=0;\n while(m-->0)\n {\n long x=nl();\n sum+=x;\n }\n if(sum<=n)\n pn(n-sum);\n else\n pn(-1);\n \n }\n\n static AnotherReader sc;\n static PrintWriter out;\n public static void main(String[]args)throws IOException\n {\n out = new PrintWriter(System.out);\n sc=new AnotherReader();\n boolean oj = true;\n\n // oj = System.getProperty(\"ONLINE_JUDGE\") != null;\n if(!oj) sc=new AnotherReader(100);\n\n long s = System.currentTimeMillis();\n \n //int t=ni();\n //while(t-->0)\n process();\n out.flush();\n if(!oj)\n System.out.println(System.currentTimeMillis()-s+\"ms\");\n System.out.close(); \n }\n\n static void pn(Object o){out.println(o);}\n static void p(Object o){out.print(o);}\n static void pni(Object o){out.println(o);System.out.flush();}\n static int ni()throws IOException{return sc.nextInt();}\n static long nl()throws IOException{return sc.nextLong();}\n static double nd()throws IOException{return sc.nextDouble();}\n static String nln()throws IOException{return sc.nextLine();}\n static String nn()throws IOException{return sc.next();}\n static long gcd(long a, long b)throws IOException{return (b==0)?a:gcd(b,a%b);}\n static int gcd(int a, int b)throws IOException{return (b==0)?a:gcd(b,a%b);}\n static int bit(long n)throws IOException{return (n==0)?0:(1+bit(n&(n-1)));}\n static boolean multipleTC=false;\n\n/////////////////////////////////////////////////////////////////////////////////////////////////////////\n static class AnotherReader{BufferedReader br; StringTokenizer st;\n AnotherReader()throws FileNotFoundException{\n br=new BufferedReader(new InputStreamReader(System.in));}\n AnotherReader(int a)throws FileNotFoundException{\n br = new BufferedReader(new FileReader(\"input.txt\"));}\n String next()throws IOException{\n while (st == null || !st.hasMoreElements()) {try{\n st = new StringTokenizer(br.readLine());}\n catch (IOException e){ e.printStackTrace(); }}\n return st.nextToken(); } int nextInt() throws IOException{\n return Integer.parseInt(next());}\n long nextLong() throws IOException\n {return Long.parseLong(next());}\n double nextDouble()throws IOException { return Double.parseDouble(next()); }\n String nextLine() throws IOException{ String str = \"\"; try{\n str = br.readLine();} catch (IOException e){\n e.printStackTrace();} return str;}}\n \n/////////////////////////////////////////////////////////////////////////////////////////////////////////////\n}\n \n \n \n\n ",
"import java.util.*;",
"util.*",
"java",
"import java.io.*;",
"io.*",
"java",
"import java.math.*;",
"math.*",
"java",
"public class Main\n{\n static double pi=3.14285714;\n public static void process()throws IOException\n {\n long n=nl();\n long m=nl();\n long sum=0;\n while(m-->0)\n {\n long x=nl();\n sum+=x;\n }\n if(sum<=n)\n pn(n-sum);\n else\n pn(-1);\n \n }\n\n static AnotherReader sc;\n static PrintWriter out;\n public static void main(String[]args)throws IOException\n {\n out = new PrintWriter(System.out);\n sc=new AnotherReader();\n boolean oj = true;\n\n // oj = System.getProperty(\"ONLINE_JUDGE\") != null;\n if(!oj) sc=new AnotherReader(100);\n\n long s = System.currentTimeMillis();\n \n //int t=ni();\n //while(t-->0)\n process();\n out.flush();\n if(!oj)\n System.out.println(System.currentTimeMillis()-s+\"ms\");\n System.out.close(); \n }\n\n static void pn(Object o){out.println(o);}\n static void p(Object o){out.print(o);}\n static void pni(Object o){out.println(o);System.out.flush();}\n static int ni()throws IOException{return sc.nextInt();}\n static long nl()throws IOException{return sc.nextLong();}\n static double nd()throws IOException{return sc.nextDouble();}\n static String nln()throws IOException{return sc.nextLine();}\n static String nn()throws IOException{return sc.next();}\n static long gcd(long a, long b)throws IOException{return (b==0)?a:gcd(b,a%b);}\n static int gcd(int a, int b)throws IOException{return (b==0)?a:gcd(b,a%b);}\n static int bit(long n)throws IOException{return (n==0)?0:(1+bit(n&(n-1)));}\n static boolean multipleTC=false;\n\n/////////////////////////////////////////////////////////////////////////////////////////////////////////\n static class AnotherReader{BufferedReader br; StringTokenizer st;\n AnotherReader()throws FileNotFoundException{\n br=new BufferedReader(new InputStreamReader(System.in));}\n AnotherReader(int a)throws FileNotFoundException{\n br = new BufferedReader(new FileReader(\"input.txt\"));}\n String next()throws IOException{\n while (st == null || !st.hasMoreElements()) {try{\n st = new StringTokenizer(br.readLine());}\n catch (IOException e){ e.printStackTrace(); }}\n return st.nextToken(); } int nextInt() throws IOException{\n return Integer.parseInt(next());}\n long nextLong() throws IOException\n {return Long.parseLong(next());}\n double nextDouble()throws IOException { return Double.parseDouble(next()); }\n String nextLine() throws IOException{ String str = \"\"; try{\n str = br.readLine();} catch (IOException e){\n e.printStackTrace();} return str;}}\n \n/////////////////////////////////////////////////////////////////////////////////////////////////////////////\n}",
"Main",
"static double pi=3.14285714;",
"pi",
"3.14285714",
"static AnotherReader sc;",
"sc",
"static PrintWriter out;",
"out",
"static boolean multipleTC=false;",
"multipleTC",
"false",
"public static void process()throws IOException\n {\n long n=nl();\n long m=nl();\n long sum=0;\n while(m-->0)\n {\n long x=nl();\n sum+=x;\n }\n if(sum<=n)\n pn(n-sum);\n else\n pn(-1);\n \n }",
"process",
"{\n long n=nl();\n long m=nl();\n long sum=0;\n while(m-->0)\n {\n long x=nl();\n sum+=x;\n }\n if(sum<=n)\n pn(n-sum);\n else\n pn(-1);\n \n }",
"long n=nl();",
"n",
"nl()",
"nl",
"long m=nl();",
"m",
"nl()",
"nl",
"long sum=0;",
"sum",
"0",
"while(m-->0)\n {\n long x=nl();\n sum+=x;\n }",
"m-->0",
"m--",
"m",
"0",
"{\n long x=nl();\n sum+=x;\n }",
"long x=nl();",
"x",
"nl()",
"nl",
"sum+=x",
"sum",
"x",
"if(sum<=n)\n pn(n-sum);\n else\n pn(-1);",
"sum<=n",
"sum",
"n",
"pn(n-sum)",
"pn",
"n-sum",
"n",
"sum",
"pn(-1)",
"pn",
"-1",
"1",
"public static void main(String[]args)throws IOException\n {\n out = new PrintWriter(System.out);\n sc=new AnotherReader();\n boolean oj = true;\n\n // oj = System.getProperty(\"ONLINE_JUDGE\") != null;\n if(!oj) sc=new AnotherReader(100);\n\n long s = System.currentTimeMillis();\n \n //int t=ni();\n //while(t-->0)\n process();\n out.flush();\n if(!oj)\n System.out.println(System.currentTimeMillis()-s+\"ms\");\n System.out.close(); \n }",
"main",
"{\n out = new PrintWriter(System.out);\n sc=new AnotherReader();\n boolean oj = true;\n\n // oj = System.getProperty(\"ONLINE_JUDGE\") != null;\n if(!oj) sc=new AnotherReader(100);\n\n long s = System.currentTimeMillis();\n \n //int t=ni();\n //while(t-->0)\n process();\n out.flush();\n if(!oj)\n System.out.println(System.currentTimeMillis()-s+\"ms\");\n System.out.close(); \n }",
"out = new PrintWriter(System.out)",
"out",
"new PrintWriter(System.out)",
"sc=new AnotherReader()",
"sc",
"new AnotherReader()",
"boolean oj = true;",
"oj",
"true",
"if(!oj) sc=new AnotherReader(100);",
"!oj",
"oj",
"sc=new AnotherReader(100)",
"sc",
"new AnotherReader(100)",
"long s = System.currentTimeMillis();",
"s",
"System.currentTimeMillis()",
"System.currentTimeMillis",
"System",
"process()",
"process",
"out.flush()",
"out.flush",
"out",
"if(!oj)\n System.out.println(System.currentTimeMillis()-s+\"ms\");",
"!oj",
"oj",
"System.out.println(System.currentTimeMillis()-s+\"ms\")",
"System.out.println",
"System.out",
"System",
"System.out",
"System.currentTimeMillis()-s+\"ms\"",
"System.currentTimeMillis()-s",
"System.currentTimeMillis()",
"System.currentTimeMillis",
"System",
"s",
"\"ms\"",
"System.out.close()",
"System.out.close",
"System.out",
"System",
"System.out",
"String[]args",
"args",
"static void pn(Object o){out.println(o);}",
"pn",
"{out.println(o);}",
"out.println(o)",
"out.println",
"out",
"o",
"Object o",
"o",
"static void p(Object o){out.print(o);}",
"p",
"{out.print(o);}",
"out.print(o)",
"out.print",
"out",
"o",
"Object o",
"o",
"static void pni(Object o){out.println(o);System.out.flush();}",
"pni",
"{out.println(o);System.out.flush();}",
"out.println(o)",
"out.println",
"out",
"o",
"System.out.flush()",
"System.out.flush",
"System.out",
"System",
"System.out",
"Object o",
"o",
"static int ni()throws IOException{return sc.nextInt();}",
"ni",
"{return sc.nextInt();}",
"return sc.nextInt();",
"sc.nextInt()",
"sc.nextInt",
"sc",
"static long nl()throws IOException{return sc.nextLong();}",
"nl",
"{return sc.nextLong();}",
"return sc.nextLong();",
"sc.nextLong()",
"sc.nextLong",
"sc",
"static double nd()throws IOException{return sc.nextDouble();}",
"nd",
"{return sc.nextDouble();}",
"return sc.nextDouble();",
"sc.nextDouble()",
"sc.nextDouble",
"sc",
"static String nln()throws IOException{return sc.nextLine();}",
"nln",
"{return sc.nextLine();}",
"return sc.nextLine();",
"sc.nextLine()",
"sc.nextLine",
"sc",
"static String nn()throws IOException{return sc.next();}",
"nn",
"{return sc.next();}",
"return sc.next();",
"sc.next()",
"sc.next",
"sc",
"static long gcd(long a, long b)throws IOException{return (b==0)?a:gcd(b,a%b);}",
"gcd",
"{return (b==0)?a:gcd(b,a%b);}",
"return (b==0)?a:gcd(b,a%b);",
"(b==0)?a:gcd(b,a%b)",
"(b==0)",
"b",
"0",
"a",
"gcd(b,a%b)",
"gcd",
"b",
"a%b",
"a",
"b",
"long a",
"a",
"long b",
"b",
"static int gcd(int a, int b)throws IOException{return (b==0)?a:gcd(b,a%b);}",
"gcd",
"{return (b==0)?a:gcd(b,a%b);}",
"return (b==0)?a:gcd(b,a%b);",
"(b==0)?a:gcd(b,a%b)",
"(b==0)",
"b",
"0",
"a",
"gcd(b,a%b)",
"gcd",
"b",
"a%b",
"a",
"b",
"int a",
"a",
"int b",
"b",
"static int bit(long n)throws IOException{return (n==0)?0:(1+bit(n&(n-1)));}",
"bit",
"{return (n==0)?0:(1+bit(n&(n-1)));}",
"return (n==0)?0:(1+bit(n&(n-1)));",
"(n==0)?0:(1+bit(n&(n-1)))",
"(n==0)",
"n",
"0",
"0",
"(1+bit(n&(n-1)))",
"1",
"bit(n&(n-1))",
"bit",
"n&(n-1)",
"n",
"(n-1)",
"n",
"1",
"long n",
"n",
" static class AnotherReader{BufferedReader br; StringTokenizer st;\n AnotherReader()throws FileNotFoundException{\n br=new BufferedReader(new InputStreamReader(System.in));}\n AnotherReader(int a)throws FileNotFoundException{\n br = new BufferedReader(new FileReader(\"input.txt\"));}\n String next()throws IOException{\n while (st == null || !st.hasMoreElements()) {try{\n st = new StringTokenizer(br.readLine());}\n catch (IOException e){ e.printStackTrace(); }}\n return st.nextToken(); } int nextInt() throws IOException{\n return Integer.parseInt(next());}\n long nextLong() throws IOException\n {return Long.parseLong(next());}\n double nextDouble()throws IOException { return Double.parseDouble(next()); }\n String nextLine() throws IOException{ String str = \"\"; try{\n str = br.readLine();} catch (IOException e){\n e.printStackTrace();} return str;}}",
"AnotherReader",
"BufferedReader br;",
"br",
"StringTokenizer st;",
"st",
"AnotherReader()throws FileNotFoundException{\n br=new BufferedReader(new InputStreamReader(System.in));}",
"AnotherReader",
"{\n br=new BufferedReader(new InputStreamReader(System.in));}",
"br=new BufferedReader(new InputStreamReader(System.in))",
"br",
"new BufferedReader(new InputStreamReader(System.in))",
"AnotherReader(int a)throws FileNotFoundException{\n br = new BufferedReader(new FileReader(\"input.txt\"));}",
"AnotherReader",
"{\n br = new BufferedReader(new FileReader(\"input.txt\"));}",
"br = new BufferedReader(new FileReader(\"input.txt\"))",
"br",
"new BufferedReader(new FileReader(\"input.txt\"))",
"int a",
"a",
"String next()throws IOException{\n while (st == null || !st.hasMoreElements()) {try{\n st = new StringTokenizer(br.readLine());}\n catch (IOException e){ e.printStackTrace(); }}\n return st.nextToken(); }",
"next",
"{\n while (st == null || !st.hasMoreElements()) {try{\n st = new StringTokenizer(br.readLine());}\n catch (IOException e){ e.printStackTrace(); }}\n return st.nextToken(); }",
"while (st == null || !st.hasMoreElements()) {try{\n st = new StringTokenizer(br.readLine());}\n catch (IOException e){ e.printStackTrace(); }}",
"st == null || !st.hasMoreElements()",
"st == null",
"st",
"null",
"!st.hasMoreElements()",
"st.hasMoreElements()",
"st.hasMoreElements",
"st",
"{try{\n st = new StringTokenizer(br.readLine());}\n catch (IOException e){ e.printStackTrace(); }}",
"try{\n st = new StringTokenizer(br.readLine());}\n catch (IOException e){ e.printStackTrace(); }",
"catch (IOException e){ e.printStackTrace(); }",
"IOException e",
"{ e.printStackTrace(); }",
"e.printStackTrace()",
"e.printStackTrace",
"e",
"{\n st = new StringTokenizer(br.readLine());}",
"st = new StringTokenizer(br.readLine())",
"st",
"new StringTokenizer(br.readLine())",
"return st.nextToken();",
"st.nextToken()",
"st.nextToken",
"st",
"int nextInt() throws IOException{\n return Integer.parseInt(next());}",
"nextInt",
"{\n return Integer.parseInt(next());}",
"return Integer.parseInt(next());",
"Integer.parseInt(next())",
"Integer.parseInt",
"Integer",
"next()",
"next",
"long nextLong() throws IOException\n {return Long.parseLong(next());}",
"nextLong",
"{return Long.parseLong(next());}",
"return Long.parseLong(next());",
"Long.parseLong(next())",
"Long.parseLong",
"Long",
"next()",
"next",
"double nextDouble()throws IOException { return Double.parseDouble(next()); }",
"nextDouble",
"{ return Double.parseDouble(next()); }",
"return Double.parseDouble(next());",
"Double.parseDouble(next())",
"Double.parseDouble",
"Double",
"next()",
"next",
"String nextLine() throws IOException{ String str = \"\"; try{\n str = br.readLine();} catch (IOException e){\n e.printStackTrace();} return str;}",
"nextLine",
"{ String str = \"\"; try{\n str = br.readLine();} catch (IOException e){\n e.printStackTrace();} return str;}",
"String str = \"\";",
"str",
"\"\"",
"try{\n str = br.readLine();} catch (IOException e){\n e.printStackTrace();}",
"catch (IOException e){\n e.printStackTrace();}",
"IOException e",
"{\n e.printStackTrace();}",
"e.printStackTrace()",
"e.printStackTrace",
"e",
"{\n str = br.readLine();}",
"str = br.readLine()",
"str",
"br.readLine()",
"br.readLine",
"br",
"return str;",
"str",
"public class Main\n{\n static double pi=3.14285714;\n public static void process()throws IOException\n {\n long n=nl();\n long m=nl();\n long sum=0;\n while(m-->0)\n {\n long x=nl();\n sum+=x;\n }\n if(sum<=n)\n pn(n-sum);\n else\n pn(-1);\n \n }\n\n static AnotherReader sc;\n static PrintWriter out;\n public static void main(String[]args)throws IOException\n {\n out = new PrintWriter(System.out);\n sc=new AnotherReader();\n boolean oj = true;\n\n // oj = System.getProperty(\"ONLINE_JUDGE\") != null;\n if(!oj) sc=new AnotherReader(100);\n\n long s = System.currentTimeMillis();\n \n //int t=ni();\n //while(t-->0)\n process();\n out.flush();\n if(!oj)\n System.out.println(System.currentTimeMillis()-s+\"ms\");\n System.out.close(); \n }\n\n static void pn(Object o){out.println(o);}\n static void p(Object o){out.print(o);}\n static void pni(Object o){out.println(o);System.out.flush();}\n static int ni()throws IOException{return sc.nextInt();}\n static long nl()throws IOException{return sc.nextLong();}\n static double nd()throws IOException{return sc.nextDouble();}\n static String nln()throws IOException{return sc.nextLine();}\n static String nn()throws IOException{return sc.next();}\n static long gcd(long a, long b)throws IOException{return (b==0)?a:gcd(b,a%b);}\n static int gcd(int a, int b)throws IOException{return (b==0)?a:gcd(b,a%b);}\n static int bit(long n)throws IOException{return (n==0)?0:(1+bit(n&(n-1)));}\n static boolean multipleTC=false;\n\n/////////////////////////////////////////////////////////////////////////////////////////////////////////\n static class AnotherReader{BufferedReader br; StringTokenizer st;\n AnotherReader()throws FileNotFoundException{\n br=new BufferedReader(new InputStreamReader(System.in));}\n AnotherReader(int a)throws FileNotFoundException{\n br = new BufferedReader(new FileReader(\"input.txt\"));}\n String next()throws IOException{\n while (st == null || !st.hasMoreElements()) {try{\n st = new StringTokenizer(br.readLine());}\n catch (IOException e){ e.printStackTrace(); }}\n return st.nextToken(); } int nextInt() throws IOException{\n return Integer.parseInt(next());}\n long nextLong() throws IOException\n {return Long.parseLong(next());}\n double nextDouble()throws IOException { return Double.parseDouble(next()); }\n String nextLine() throws IOException{ String str = \"\"; try{\n str = br.readLine();} catch (IOException e){\n e.printStackTrace();} return str;}}\n \n/////////////////////////////////////////////////////////////////////////////////////////////////////////////\n}",
"public class Main\n{\n static double pi=3.14285714;\n public static void process()throws IOException\n {\n long n=nl();\n long m=nl();\n long sum=0;\n while(m-->0)\n {\n long x=nl();\n sum+=x;\n }\n if(sum<=n)\n pn(n-sum);\n else\n pn(-1);\n \n }\n\n static AnotherReader sc;\n static PrintWriter out;\n public static void main(String[]args)throws IOException\n {\n out = new PrintWriter(System.out);\n sc=new AnotherReader();\n boolean oj = true;\n\n // oj = System.getProperty(\"ONLINE_JUDGE\") != null;\n if(!oj) sc=new AnotherReader(100);\n\n long s = System.currentTimeMillis();\n \n //int t=ni();\n //while(t-->0)\n process();\n out.flush();\n if(!oj)\n System.out.println(System.currentTimeMillis()-s+\"ms\");\n System.out.close(); \n }\n\n static void pn(Object o){out.println(o);}\n static void p(Object o){out.print(o);}\n static void pni(Object o){out.println(o);System.out.flush();}\n static int ni()throws IOException{return sc.nextInt();}\n static long nl()throws IOException{return sc.nextLong();}\n static double nd()throws IOException{return sc.nextDouble();}\n static String nln()throws IOException{return sc.nextLine();}\n static String nn()throws IOException{return sc.next();}\n static long gcd(long a, long b)throws IOException{return (b==0)?a:gcd(b,a%b);}\n static int gcd(int a, int b)throws IOException{return (b==0)?a:gcd(b,a%b);}\n static int bit(long n)throws IOException{return (n==0)?0:(1+bit(n&(n-1)));}\n static boolean multipleTC=false;\n\n/////////////////////////////////////////////////////////////////////////////////////////////////////////\n static class AnotherReader{BufferedReader br; StringTokenizer st;\n AnotherReader()throws FileNotFoundException{\n br=new BufferedReader(new InputStreamReader(System.in));}\n AnotherReader(int a)throws FileNotFoundException{\n br = new BufferedReader(new FileReader(\"input.txt\"));}\n String next()throws IOException{\n while (st == null || !st.hasMoreElements()) {try{\n st = new StringTokenizer(br.readLine());}\n catch (IOException e){ e.printStackTrace(); }}\n return st.nextToken(); } int nextInt() throws IOException{\n return Integer.parseInt(next());}\n long nextLong() throws IOException\n {return Long.parseLong(next());}\n double nextDouble()throws IOException { return Double.parseDouble(next()); }\n String nextLine() throws IOException{ String str = \"\"; try{\n str = br.readLine();} catch (IOException e){\n e.printStackTrace();} return str;}}\n \n/////////////////////////////////////////////////////////////////////////////////////////////////////////////\n}",
"Main"
] |
import java.util.*;
import java.io.*;
import java.math.*;
public class Main
{
static double pi=3.14285714;
public static void process()throws IOException
{
long n=nl();
long m=nl();
long sum=0;
while(m-->0)
{
long x=nl();
sum+=x;
}
if(sum<=n)
pn(n-sum);
else
pn(-1);
}
static AnotherReader sc;
static PrintWriter out;
public static void main(String[]args)throws IOException
{
out = new PrintWriter(System.out);
sc=new AnotherReader();
boolean oj = true;
// oj = System.getProperty("ONLINE_JUDGE") != null;
if(!oj) sc=new AnotherReader(100);
long s = System.currentTimeMillis();
//int t=ni();
//while(t-->0)
process();
out.flush();
if(!oj)
System.out.println(System.currentTimeMillis()-s+"ms");
System.out.close();
}
static void pn(Object o){out.println(o);}
static void p(Object o){out.print(o);}
static void pni(Object o){out.println(o);System.out.flush();}
static int ni()throws IOException{return sc.nextInt();}
static long nl()throws IOException{return sc.nextLong();}
static double nd()throws IOException{return sc.nextDouble();}
static String nln()throws IOException{return sc.nextLine();}
static String nn()throws IOException{return sc.next();}
static long gcd(long a, long b)throws IOException{return (b==0)?a:gcd(b,a%b);}
static int gcd(int a, int b)throws IOException{return (b==0)?a:gcd(b,a%b);}
static int bit(long n)throws IOException{return (n==0)?0:(1+bit(n&(n-1)));}
static boolean multipleTC=false;
/////////////////////////////////////////////////////////////////////////////////////////////////////////
static class AnotherReader{BufferedReader br; StringTokenizer st;
AnotherReader()throws FileNotFoundException{
br=new BufferedReader(new InputStreamReader(System.in));}
AnotherReader(int a)throws FileNotFoundException{
br = new BufferedReader(new FileReader("input.txt"));}
String next()throws IOException{
while (st == null || !st.hasMoreElements()) {try{
st = new StringTokenizer(br.readLine());}
catch (IOException e){ e.printStackTrace(); }}
return st.nextToken(); } int nextInt() throws IOException{
return Integer.parseInt(next());}
long nextLong() throws IOException
{return Long.parseLong(next());}
double nextDouble()throws IOException { return Double.parseDouble(next()); }
String nextLine() throws IOException{ String str = ""; try{
str = br.readLine();} catch (IOException e){
e.printStackTrace();} return str;}}
/////////////////////////////////////////////////////////////////////////////////////////////////////////////
}
|
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
41,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
4,
18,
13,
0,
13,
13,
14,
2,
13,
17,
4,
18,
18,
13,
13,
40,
17,
4,
18,
18,
13,
13,
13,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
65,
5
],
[
65,
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
],
[
25,
26
],
[
26,
27
],
[
26,
28
],
[
24,
29
],
[
29,
30
],
[
29,
31
],
[
24,
32
],
[
32,
33
],
[
33,
34
],
[
24,
35
],
[
36,
36
],
[
36,
37
],
[
37,
38
],
[
37,
39
],
[
39,
40
],
[
40,
41
],
[
36,
42
],
[
42,
43
],
[
42,
44
],
[
8,
45
],
[
45,
46
],
[
46,
47
],
[
46,
48
],
[
45,
49
],
[
49,
50
],
[
50,
51
],
[
51,
52
],
[
51,
53
],
[
49,
54
],
[
54,
55
],
[
45,
56
],
[
56,
57
],
[
57,
58
],
[
58,
59
],
[
58,
60
],
[
56,
61
],
[
6,
62
],
[
62,
63
],
[
0,
64
],
[
64,
65
],
[
64,
66
]
] |
[
"import java.util.*;\npublic class Main{\n\tpublic static void main(String[] args){\n \tScanner sc = new Scanner(System.in);\n \tint n = sc.nextInt();\n \tint m = sc.nextInt();\n \tint a;\n \tfor(int i = 0; i < m; i++){\n \ta = sc.nextInt();\n \tn -= a;\n }\n \tif(n < 0) System.out.println(-1);\n \telse System.out.println(n);\n }\n}",
"import java.util.*;",
"util.*",
"java",
"public class Main{\n\tpublic static void main(String[] args){\n \tScanner sc = new Scanner(System.in);\n \tint n = sc.nextInt();\n \tint m = sc.nextInt();\n \tint a;\n \tfor(int i = 0; i < m; i++){\n \ta = sc.nextInt();\n \tn -= a;\n }\n \tif(n < 0) System.out.println(-1);\n \telse System.out.println(n);\n }\n}",
"Main",
"public static void main(String[] args){\n \tScanner sc = new Scanner(System.in);\n \tint n = sc.nextInt();\n \tint m = sc.nextInt();\n \tint a;\n \tfor(int i = 0; i < m; i++){\n \ta = sc.nextInt();\n \tn -= a;\n }\n \tif(n < 0) System.out.println(-1);\n \telse System.out.println(n);\n }",
"main",
"{\n \tScanner sc = new Scanner(System.in);\n \tint n = sc.nextInt();\n \tint m = sc.nextInt();\n \tint a;\n \tfor(int i = 0; i < m; i++){\n \ta = sc.nextInt();\n \tn -= a;\n }\n \tif(n < 0) System.out.println(-1);\n \telse System.out.println(n);\n }",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"int n = sc.nextInt();",
"n",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int m = sc.nextInt();",
"m",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int a;",
"a",
"for(int i = 0; i < m; i++){\n \ta = sc.nextInt();\n \tn -= a;\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < m",
"i",
"m",
"i++",
"i++",
"i",
"{\n \ta = sc.nextInt();\n \tn -= a;\n }",
"{\n \ta = sc.nextInt();\n \tn -= a;\n }",
"a = sc.nextInt()",
"a",
"sc.nextInt()",
"sc.nextInt",
"sc",
"n -= a",
"n",
"a",
"if(n < 0) System.out.println(-1);\n \telse System.out.println(n);",
"n < 0",
"n",
"0",
"System.out.println(-1)",
"System.out.println",
"System.out",
"System",
"System.out",
"-1",
"1",
"System.out.println(n)",
"System.out.println",
"System.out",
"System",
"System.out",
"n",
"String[] args",
"args",
"public class Main{\n\tpublic static void main(String[] args){\n \tScanner sc = new Scanner(System.in);\n \tint n = sc.nextInt();\n \tint m = sc.nextInt();\n \tint a;\n \tfor(int i = 0; i < m; i++){\n \ta = sc.nextInt();\n \tn -= a;\n }\n \tif(n < 0) System.out.println(-1);\n \telse System.out.println(n);\n }\n}",
"public class Main{\n\tpublic static void main(String[] args){\n \tScanner sc = new Scanner(System.in);\n \tint n = sc.nextInt();\n \tint m = sc.nextInt();\n \tint a;\n \tfor(int i = 0; i < m; i++){\n \ta = sc.nextInt();\n \tn -= a;\n }\n \tif(n < 0) System.out.println(-1);\n \telse System.out.println(n);\n }\n}",
"Main"
] |
import java.util.*;
public class Main{
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
int m = sc.nextInt();
int a;
for(int i = 0; i < m; i++){
a = sc.nextInt();
n -= a;
}
if(n < 0) System.out.println(-1);
else System.out.println(n);
}
}
|
[
7,
15,
13,
17,
15,
13,
17,
6,
13,
41,
13,
41,
13,
17,
12,
13,
30,
41,
13,
4,
13,
41,
13,
4,
13,
41,
13,
4,
13,
13,
4,
18,
13,
13,
41,
13,
17,
42,
2,
13,
13,
30,
14,
2,
2,
13,
18,
13,
13,
17,
30,
0,
13,
18,
13,
13,
40,
13,
30,
3,
4,
18,
18,
13,
13,
8,
2,
13,
13,
13,
40,
17,
12,
13,
30,
0,
13,
20,
41,
13,
4,
18,
13,
17,
14,
2,
13,
17,
30,
38,
5,
13,
30,
37,
20,
30,
0,
13,
20,
41,
13,
17,
42,
13,
30,
4,
13,
38,
5,
13,
30,
37,
20,
30,
4,
18,
13,
17,
14,
2,
4,
18,
13,
17,
30,
4,
18,
13,
4,
18,
18,
13,
13,
17,
30,
0,
13,
17,
23,
13,
12,
13,
30,
42,
2,
2,
13,
17,
40,
4,
18,
13,
30,
38,
5,
13,
30,
37,
20,
30,
0,
13,
20,
29,
4,
18,
13,
12,
13,
30,
29,
4,
18,
13,
4,
13,
12,
13,
30,
29,
4,
18,
13,
4,
13,
12,
13,
30,
29,
4,
18,
13,
4,
13,
12,
13,
30,
41,
13,
20,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
0,
18,
13,
13,
4,
13,
29,
13,
23,
13,
12,
13,
30,
29,
4,
18,
4,
13,
12,
13,
30,
41,
13,
20,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
0,
18,
13,
13,
4,
13,
29,
13,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
261,
8
],
[
261,
9
],
[
9,
10
],
[
261,
11
],
[
11,
12
],
[
11,
13
],
[
261,
14
],
[
14,
15
],
[
14,
16
],
[
16,
17
],
[
17,
18
],
[
17,
19
],
[
19,
20
],
[
16,
21
],
[
21,
22
],
[
21,
23
],
[
23,
24
],
[
16,
25
],
[
25,
26
],
[
25,
27
],
[
27,
28
],
[
27,
29
],
[
16,
30
],
[
30,
31
],
[
31,
32
],
[
30,
33
],
[
16,
34
],
[
34,
35
],
[
34,
36
],
[
16,
37
],
[
37,
38
],
[
38,
39
],
[
38,
40
],
[
37,
41
],
[
41,
42
],
[
42,
43
],
[
43,
44
],
[
44,
45
],
[
44,
46
],
[
46,
47
],
[
46,
48
],
[
43,
49
],
[
42,
50
],
[
50,
51
],
[
51,
52
],
[
51,
53
],
[
53,
54
],
[
53,
55
],
[
50,
56
],
[
56,
57
],
[
42,
58
],
[
58,
59
],
[
16,
60
],
[
60,
61
],
[
61,
62
],
[
62,
63
],
[
62,
64
],
[
60,
65
],
[
65,
66
],
[
66,
67
],
[
66,
68
],
[
65,
69
],
[
65,
70
],
[
70,
71
],
[
261,
72
],
[
72,
73
],
[
72,
74
],
[
74,
75
],
[
75,
76
],
[
75,
77
],
[
74,
78
],
[
78,
79
],
[
78,
80
],
[
80,
81
],
[
81,
82
],
[
80,
83
],
[
74,
84
],
[
84,
85
],
[
85,
86
],
[
85,
87
],
[
84,
88
],
[
88,
89
],
[
89,
90
],
[
90,
91
],
[
90,
92
],
[
92,
93
],
[
93,
94
],
[
89,
95
],
[
95,
96
],
[
96,
97
],
[
96,
98
],
[
74,
99
],
[
99,
100
],
[
99,
101
],
[
74,
102
],
[
102,
103
],
[
102,
104
],
[
104,
105
],
[
105,
106
],
[
104,
107
],
[
107,
108
],
[
108,
109
],
[
108,
110
],
[
110,
111
],
[
111,
112
],
[
107,
113
],
[
113,
114
],
[
114,
115
],
[
115,
116
],
[
114,
117
],
[
113,
118
],
[
118,
119
],
[
119,
120
],
[
120,
121
],
[
121,
122
],
[
119,
123
],
[
118,
124
],
[
124,
125
],
[
125,
126
],
[
126,
127
],
[
124,
128
],
[
128,
129
],
[
129,
130
],
[
130,
131
],
[
130,
132
],
[
128,
133
],
[
118,
134
],
[
134,
135
],
[
135,
136
],
[
135,
137
],
[
72,
138
],
[
138,
139
],
[
261,
140
],
[
140,
141
],
[
140,
142
],
[
142,
143
],
[
143,
144
],
[
144,
145
],
[
145,
146
],
[
145,
147
],
[
144,
148
],
[
148,
149
],
[
149,
150
],
[
150,
151
],
[
143,
152
],
[
152,
153
],
[
153,
154
],
[
154,
155
],
[
154,
156
],
[
156,
157
],
[
157,
158
],
[
153,
159
],
[
159,
160
],
[
160,
161
],
[
160,
162
],
[
142,
163
],
[
163,
164
],
[
164,
165
],
[
165,
166
],
[
261,
167
],
[
167,
168
],
[
167,
169
],
[
169,
170
],
[
170,
171
],
[
171,
172
],
[
172,
173
],
[
171,
174
],
[
174,
175
],
[
261,
176
],
[
176,
177
],
[
176,
178
],
[
178,
179
],
[
179,
180
],
[
180,
181
],
[
181,
182
],
[
180,
183
],
[
183,
184
],
[
261,
185
],
[
185,
186
],
[
185,
187
],
[
187,
188
],
[
188,
189
],
[
189,
190
],
[
190,
191
],
[
189,
192
],
[
192,
193
],
[
261,
194
],
[
194,
195
],
[
194,
196
],
[
196,
197
],
[
197,
198
],
[
197,
199
],
[
196,
201
],
[
201,
202
],
[
202,
203
],
[
203,
204
],
[
203,
205
],
[
201,
206
],
[
206,
207
],
[
206,
208
],
[
201,
209
],
[
209,
210
],
[
210,
211
],
[
201,
212
],
[
212,
213
],
[
213,
214
],
[
214,
215
],
[
214,
216
],
[
213,
217
],
[
217,
218
],
[
196,
219
],
[
219,
220
],
[
194,
221
],
[
221,
222
],
[
261,
223
],
[
223,
224
],
[
223,
225
],
[
225,
226
],
[
226,
227
],
[
227,
228
],
[
228,
229
],
[
229,
230
],
[
261,
231
],
[
231,
232
],
[
231,
233
],
[
233,
234
],
[
234,
235
],
[
234,
236
],
[
233,
238
],
[
238,
239
],
[
239,
240
],
[
240,
241
],
[
240,
242
],
[
238,
243
],
[
243,
244
],
[
243,
245
],
[
238,
246
],
[
246,
247
],
[
247,
248
],
[
238,
249
],
[
249,
250
],
[
250,
251
],
[
251,
252
],
[
251,
253
],
[
250,
254
],
[
254,
255
],
[
233,
256
],
[
256,
257
],
[
231,
258
],
[
258,
259
],
[
0,
260
],
[
260,
261
],
[
260,
262
]
] |
[
"import java.util.*;\nimport java.io.*;\n\npublic class Main {\t\n\n\tprivate static void solve(){\n\t\t//Implement solution here.\n\t\tint N = ni();\n\t\tint M = ni();\t\t\n\t\tint[] A = na(M);\n\n\t\tArrays.sort(A);\n\t\tint idx = 0;\t\t\n\t\twhile(idx < M) {\n\t\t\tif(N - A[idx] >= 0) {\n\t\t\t\tN -= A[idx];\n\t\t\t\tidx++;\n\t\t\t} else {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\t\t\t\n\t\tSystem.out.println(idx == M ? N : -1);\n\t}\n\n\t//Switch input source (stdin/file)\n\tprivate static BufferedReader br;\n\tpublic static void main(String[] args){\n\t\tbr = new BufferedReader(new InputStreamReader(System.in));\n\t\tString debugDataPath = System.getenv(\"DD_PATH\"); \n\t\tif(debugDataPath != null){\n\t\t\ttry{\n\t\t\t\tbr = new BufferedReader(new InputStreamReader(new FileInputStream(new File(debugDataPath))));\n\t\t\t}catch(Exception e){\n\t\t\t\tthrow new RuntimeException(e);\n\t\t\t}\n\t\t}\n\t\tboolean hasNext = true;\n\t\twhile(hasNext){\n\t\t\tsolve();\t\n\t\t\ttry{\n\t\t\t\tbr.mark(1);\n\t\t\t\tif(br.read() > 0){\n\t\t\t\t\tbr.reset();\t\t\t\n\t\t\t\t\tSystem.out.println(\"---\");\n\t\t\t\t} else {\n\t\t\t\t\thasNext = false;\n\t\t\t\t}\n\t\t\t}catch(Exception e){\n\t\t\t\tthrow new RuntimeException(e);\n\t\t\t} \n\t\t}\n\t}\n\n\t//Input read utility\n\tprivate static StringTokenizer tokenizer = null;\n\tpublic static String next() {\n\t\twhile (tokenizer == null || !tokenizer.hasMoreTokens()) {\n\t\t\ttry {\n\t\t\t\ttokenizer = new StringTokenizer(br.readLine());\n\t\t\t} catch (Exception e) {\n\t\t\t\tthrow new RuntimeException(e);\n\t\t\t}\n\t\t}\n\t\treturn tokenizer.nextToken();\n\t}\n\t//Get next single int\n\tprivate static int ni() {\n\t\treturn Integer.parseInt(next());\n\t}\n\t//Get next single long\n\tprivate static long nl() {\n\t\treturn Long.parseLong(next());\n\t}\n\t//Get next single double\n\tprivate static double nd() {\n\t\treturn Double.parseDouble(next());\n\t}\n\t//Get next int array from one line\n\tprivate static int[] na(int n) {\n\t\tint[] a = new int[n];\n\t\tfor (int i = 0; i < n; i++)\n\t\t\ta[i] = ni();\n\t\treturn a;\n\t}\n\t//Get next char array from one line\n\tprivate static char[] ns() {\n\t\treturn next().toCharArray();\n\t}\n\t//Get next long array from one line\n\tprivate static long[] nal(int n) {\n\t\tlong[] a = new long[n];\n\t\tfor (int i = 0; i < n; i++)\n\t\t\ta[i] = nl();\n\t\treturn a;\n\t}\n}",
"import java.util.*;",
"util.*",
"java",
"import java.io.*;",
"io.*",
"java",
"public class Main {\t\n\n\tprivate static void solve(){\n\t\t//Implement solution here.\n\t\tint N = ni();\n\t\tint M = ni();\t\t\n\t\tint[] A = na(M);\n\n\t\tArrays.sort(A);\n\t\tint idx = 0;\t\t\n\t\twhile(idx < M) {\n\t\t\tif(N - A[idx] >= 0) {\n\t\t\t\tN -= A[idx];\n\t\t\t\tidx++;\n\t\t\t} else {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\t\t\t\n\t\tSystem.out.println(idx == M ? N : -1);\n\t}\n\n\t//Switch input source (stdin/file)\n\tprivate static BufferedReader br;\n\tpublic static void main(String[] args){\n\t\tbr = new BufferedReader(new InputStreamReader(System.in));\n\t\tString debugDataPath = System.getenv(\"DD_PATH\"); \n\t\tif(debugDataPath != null){\n\t\t\ttry{\n\t\t\t\tbr = new BufferedReader(new InputStreamReader(new FileInputStream(new File(debugDataPath))));\n\t\t\t}catch(Exception e){\n\t\t\t\tthrow new RuntimeException(e);\n\t\t\t}\n\t\t}\n\t\tboolean hasNext = true;\n\t\twhile(hasNext){\n\t\t\tsolve();\t\n\t\t\ttry{\n\t\t\t\tbr.mark(1);\n\t\t\t\tif(br.read() > 0){\n\t\t\t\t\tbr.reset();\t\t\t\n\t\t\t\t\tSystem.out.println(\"---\");\n\t\t\t\t} else {\n\t\t\t\t\thasNext = false;\n\t\t\t\t}\n\t\t\t}catch(Exception e){\n\t\t\t\tthrow new RuntimeException(e);\n\t\t\t} \n\t\t}\n\t}\n\n\t//Input read utility\n\tprivate static StringTokenizer tokenizer = null;\n\tpublic static String next() {\n\t\twhile (tokenizer == null || !tokenizer.hasMoreTokens()) {\n\t\t\ttry {\n\t\t\t\ttokenizer = new StringTokenizer(br.readLine());\n\t\t\t} catch (Exception e) {\n\t\t\t\tthrow new RuntimeException(e);\n\t\t\t}\n\t\t}\n\t\treturn tokenizer.nextToken();\n\t}\n\t//Get next single int\n\tprivate static int ni() {\n\t\treturn Integer.parseInt(next());\n\t}\n\t//Get next single long\n\tprivate static long nl() {\n\t\treturn Long.parseLong(next());\n\t}\n\t//Get next single double\n\tprivate static double nd() {\n\t\treturn Double.parseDouble(next());\n\t}\n\t//Get next int array from one line\n\tprivate static int[] na(int n) {\n\t\tint[] a = new int[n];\n\t\tfor (int i = 0; i < n; i++)\n\t\t\ta[i] = ni();\n\t\treturn a;\n\t}\n\t//Get next char array from one line\n\tprivate static char[] ns() {\n\t\treturn next().toCharArray();\n\t}\n\t//Get next long array from one line\n\tprivate static long[] nal(int n) {\n\t\tlong[] a = new long[n];\n\t\tfor (int i = 0; i < n; i++)\n\t\t\ta[i] = nl();\n\t\treturn a;\n\t}\n}",
"Main",
"//Switch input source (stdin/file)\n\tprivate static BufferedReader br;",
"br",
"//Input read utility\n\tprivate static StringTokenizer tokenizer = null;",
"tokenizer",
"null",
"private static void solve(){\n\t\t//Implement solution here.\n\t\tint N = ni();\n\t\tint M = ni();\t\t\n\t\tint[] A = na(M);\n\n\t\tArrays.sort(A);\n\t\tint idx = 0;\t\t\n\t\twhile(idx < M) {\n\t\t\tif(N - A[idx] >= 0) {\n\t\t\t\tN -= A[idx];\n\t\t\t\tidx++;\n\t\t\t} else {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\t\t\t\n\t\tSystem.out.println(idx == M ? N : -1);\n\t}",
"solve",
"{\n\t\t//Implement solution here.\n\t\tint N = ni();\n\t\tint M = ni();\t\t\n\t\tint[] A = na(M);\n\n\t\tArrays.sort(A);\n\t\tint idx = 0;\t\t\n\t\twhile(idx < M) {\n\t\t\tif(N - A[idx] >= 0) {\n\t\t\t\tN -= A[idx];\n\t\t\t\tidx++;\n\t\t\t} else {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\t\t\t\n\t\tSystem.out.println(idx == M ? N : -1);\n\t}",
"int N = ni();",
"N",
"ni()",
"ni",
"int M = ni();",
"M",
"ni()",
"ni",
"int[] A = na(M);",
"A",
"na(M)",
"na",
"M",
"Arrays.sort(A)",
"Arrays.sort",
"Arrays",
"A",
"int idx = 0;",
"idx",
"0",
"while(idx < M) {\n\t\t\tif(N - A[idx] >= 0) {\n\t\t\t\tN -= A[idx];\n\t\t\t\tidx++;\n\t\t\t} else {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}",
"idx < M",
"idx",
"M",
"{\n\t\t\tif(N - A[idx] >= 0) {\n\t\t\t\tN -= A[idx];\n\t\t\t\tidx++;\n\t\t\t} else {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}",
"if(N - A[idx] >= 0) {\n\t\t\t\tN -= A[idx];\n\t\t\t\tidx++;\n\t\t\t} else {\n\t\t\t\tbreak;\n\t\t\t}",
"N - A[idx] >= 0",
"N - A[idx]",
"N",
"A[idx]",
"A",
"idx",
"0",
"{\n\t\t\t\tN -= A[idx];\n\t\t\t\tidx++;\n\t\t\t}",
"N -= A[idx]",
"N",
"A[idx]",
"A",
"idx",
"idx++",
"idx",
"{\n\t\t\t\tbreak;\n\t\t\t}",
"break;",
"System.out.println(idx == M ? N : -1)",
"System.out.println",
"System.out",
"System",
"System.out",
"idx == M ? N : -1",
"idx == M",
"idx",
"M",
"N",
"-1",
"1",
"public static void main(String[] args){\n\t\tbr = new BufferedReader(new InputStreamReader(System.in));\n\t\tString debugDataPath = System.getenv(\"DD_PATH\"); \n\t\tif(debugDataPath != null){\n\t\t\ttry{\n\t\t\t\tbr = new BufferedReader(new InputStreamReader(new FileInputStream(new File(debugDataPath))));\n\t\t\t}catch(Exception e){\n\t\t\t\tthrow new RuntimeException(e);\n\t\t\t}\n\t\t}\n\t\tboolean hasNext = true;\n\t\twhile(hasNext){\n\t\t\tsolve();\t\n\t\t\ttry{\n\t\t\t\tbr.mark(1);\n\t\t\t\tif(br.read() > 0){\n\t\t\t\t\tbr.reset();\t\t\t\n\t\t\t\t\tSystem.out.println(\"---\");\n\t\t\t\t} else {\n\t\t\t\t\thasNext = false;\n\t\t\t\t}\n\t\t\t}catch(Exception e){\n\t\t\t\tthrow new RuntimeException(e);\n\t\t\t} \n\t\t}\n\t}",
"main",
"{\n\t\tbr = new BufferedReader(new InputStreamReader(System.in));\n\t\tString debugDataPath = System.getenv(\"DD_PATH\"); \n\t\tif(debugDataPath != null){\n\t\t\ttry{\n\t\t\t\tbr = new BufferedReader(new InputStreamReader(new FileInputStream(new File(debugDataPath))));\n\t\t\t}catch(Exception e){\n\t\t\t\tthrow new RuntimeException(e);\n\t\t\t}\n\t\t}\n\t\tboolean hasNext = true;\n\t\twhile(hasNext){\n\t\t\tsolve();\t\n\t\t\ttry{\n\t\t\t\tbr.mark(1);\n\t\t\t\tif(br.read() > 0){\n\t\t\t\t\tbr.reset();\t\t\t\n\t\t\t\t\tSystem.out.println(\"---\");\n\t\t\t\t} else {\n\t\t\t\t\thasNext = false;\n\t\t\t\t}\n\t\t\t}catch(Exception e){\n\t\t\t\tthrow new RuntimeException(e);\n\t\t\t} \n\t\t}\n\t}",
"br = new BufferedReader(new InputStreamReader(System.in))",
"br",
"new BufferedReader(new InputStreamReader(System.in))",
"String debugDataPath = System.getenv(\"DD_PATH\");",
"debugDataPath",
"System.getenv(\"DD_PATH\")",
"System.getenv",
"System",
"\"DD_PATH\"",
"if(debugDataPath != null){\n\t\t\ttry{\n\t\t\t\tbr = new BufferedReader(new InputStreamReader(new FileInputStream(new File(debugDataPath))));\n\t\t\t}catch(Exception e){\n\t\t\t\tthrow new RuntimeException(e);\n\t\t\t}\n\t\t}",
"debugDataPath != null",
"debugDataPath",
"null",
"{\n\t\t\ttry{\n\t\t\t\tbr = new BufferedReader(new InputStreamReader(new FileInputStream(new File(debugDataPath))));\n\t\t\t}catch(Exception e){\n\t\t\t\tthrow new RuntimeException(e);\n\t\t\t}\n\t\t}",
"try{\n\t\t\t\tbr = new BufferedReader(new InputStreamReader(new FileInputStream(new File(debugDataPath))));\n\t\t\t}catch(Exception e){\n\t\t\t\tthrow new RuntimeException(e);\n\t\t\t}",
"catch(Exception e){\n\t\t\t\tthrow new RuntimeException(e);\n\t\t\t}",
"Exception e",
"{\n\t\t\t\tthrow new RuntimeException(e);\n\t\t\t}",
"throw new RuntimeException(e);",
"new RuntimeException(e)",
"{\n\t\t\t\tbr = new BufferedReader(new InputStreamReader(new FileInputStream(new File(debugDataPath))));\n\t\t\t}",
"br = new BufferedReader(new InputStreamReader(new FileInputStream(new File(debugDataPath))))",
"br",
"new BufferedReader(new InputStreamReader(new FileInputStream(new File(debugDataPath))))",
"boolean hasNext = true;",
"hasNext",
"true",
"while(hasNext){\n\t\t\tsolve();\t\n\t\t\ttry{\n\t\t\t\tbr.mark(1);\n\t\t\t\tif(br.read() > 0){\n\t\t\t\t\tbr.reset();\t\t\t\n\t\t\t\t\tSystem.out.println(\"---\");\n\t\t\t\t} else {\n\t\t\t\t\thasNext = false;\n\t\t\t\t}\n\t\t\t}catch(Exception e){\n\t\t\t\tthrow new RuntimeException(e);\n\t\t\t} \n\t\t}",
"hasNext",
"{\n\t\t\tsolve();\t\n\t\t\ttry{\n\t\t\t\tbr.mark(1);\n\t\t\t\tif(br.read() > 0){\n\t\t\t\t\tbr.reset();\t\t\t\n\t\t\t\t\tSystem.out.println(\"---\");\n\t\t\t\t} else {\n\t\t\t\t\thasNext = false;\n\t\t\t\t}\n\t\t\t}catch(Exception e){\n\t\t\t\tthrow new RuntimeException(e);\n\t\t\t} \n\t\t}",
"solve()",
"solve",
"try{\n\t\t\t\tbr.mark(1);\n\t\t\t\tif(br.read() > 0){\n\t\t\t\t\tbr.reset();\t\t\t\n\t\t\t\t\tSystem.out.println(\"---\");\n\t\t\t\t} else {\n\t\t\t\t\thasNext = false;\n\t\t\t\t}\n\t\t\t}catch(Exception e){\n\t\t\t\tthrow new RuntimeException(e);\n\t\t\t}",
"catch(Exception e){\n\t\t\t\tthrow new RuntimeException(e);\n\t\t\t}",
"Exception e",
"{\n\t\t\t\tthrow new RuntimeException(e);\n\t\t\t}",
"throw new RuntimeException(e);",
"new RuntimeException(e)",
"{\n\t\t\t\tbr.mark(1);\n\t\t\t\tif(br.read() > 0){\n\t\t\t\t\tbr.reset();\t\t\t\n\t\t\t\t\tSystem.out.println(\"---\");\n\t\t\t\t} else {\n\t\t\t\t\thasNext = false;\n\t\t\t\t}\n\t\t\t}",
"br.mark(1)",
"br.mark",
"br",
"1",
"if(br.read() > 0){\n\t\t\t\t\tbr.reset();\t\t\t\n\t\t\t\t\tSystem.out.println(\"---\");\n\t\t\t\t} else {\n\t\t\t\t\thasNext = false;\n\t\t\t\t}",
"br.read() > 0",
"br.read()",
"br.read",
"br",
"0",
"{\n\t\t\t\t\tbr.reset();\t\t\t\n\t\t\t\t\tSystem.out.println(\"---\");\n\t\t\t\t}",
"br.reset()",
"br.reset",
"br",
"System.out.println(\"---\")",
"System.out.println",
"System.out",
"System",
"System.out",
"\"---\"",
"{\n\t\t\t\t\thasNext = false;\n\t\t\t\t}",
"hasNext = false",
"hasNext",
"false",
"String[] args",
"args",
"public static String next() {\n\t\twhile (tokenizer == null || !tokenizer.hasMoreTokens()) {\n\t\t\ttry {\n\t\t\t\ttokenizer = new StringTokenizer(br.readLine());\n\t\t\t} catch (Exception e) {\n\t\t\t\tthrow new RuntimeException(e);\n\t\t\t}\n\t\t}\n\t\treturn tokenizer.nextToken();\n\t}",
"next",
"{\n\t\twhile (tokenizer == null || !tokenizer.hasMoreTokens()) {\n\t\t\ttry {\n\t\t\t\ttokenizer = new StringTokenizer(br.readLine());\n\t\t\t} catch (Exception e) {\n\t\t\t\tthrow new RuntimeException(e);\n\t\t\t}\n\t\t}\n\t\treturn tokenizer.nextToken();\n\t}",
"while (tokenizer == null || !tokenizer.hasMoreTokens()) {\n\t\t\ttry {\n\t\t\t\ttokenizer = new StringTokenizer(br.readLine());\n\t\t\t} catch (Exception e) {\n\t\t\t\tthrow new RuntimeException(e);\n\t\t\t}\n\t\t}",
"tokenizer == null || !tokenizer.hasMoreTokens()",
"tokenizer == null",
"tokenizer",
"null",
"!tokenizer.hasMoreTokens()",
"tokenizer.hasMoreTokens()",
"tokenizer.hasMoreTokens",
"tokenizer",
"{\n\t\t\ttry {\n\t\t\t\ttokenizer = new StringTokenizer(br.readLine());\n\t\t\t} catch (Exception e) {\n\t\t\t\tthrow new RuntimeException(e);\n\t\t\t}\n\t\t}",
"try {\n\t\t\t\ttokenizer = new StringTokenizer(br.readLine());\n\t\t\t} catch (Exception e) {\n\t\t\t\tthrow new RuntimeException(e);\n\t\t\t}",
"catch (Exception e) {\n\t\t\t\tthrow new RuntimeException(e);\n\t\t\t}",
"Exception e",
"{\n\t\t\t\tthrow new RuntimeException(e);\n\t\t\t}",
"throw new RuntimeException(e);",
"new RuntimeException(e)",
"{\n\t\t\t\ttokenizer = new StringTokenizer(br.readLine());\n\t\t\t}",
"tokenizer = new StringTokenizer(br.readLine())",
"tokenizer",
"new StringTokenizer(br.readLine())",
"return tokenizer.nextToken();",
"tokenizer.nextToken()",
"tokenizer.nextToken",
"tokenizer",
"//Get next single int\n\tprivate static int ni() {\n\t\treturn Integer.parseInt(next());\n\t}",
"ni",
"{\n\t\treturn Integer.parseInt(next());\n\t}",
"return Integer.parseInt(next());",
"Integer.parseInt(next())",
"Integer.parseInt",
"Integer",
"next()",
"next",
"//Get next single long\n\tprivate static long nl() {\n\t\treturn Long.parseLong(next());\n\t}",
"nl",
"{\n\t\treturn Long.parseLong(next());\n\t}",
"return Long.parseLong(next());",
"Long.parseLong(next())",
"Long.parseLong",
"Long",
"next()",
"next",
"//Get next single double\n\tprivate static double nd() {\n\t\treturn Double.parseDouble(next());\n\t}",
"nd",
"{\n\t\treturn Double.parseDouble(next());\n\t}",
"return Double.parseDouble(next());",
"Double.parseDouble(next())",
"Double.parseDouble",
"Double",
"next()",
"next",
"//Get next int array from one line\n\tprivate static int[] na(int n) {\n\t\tint[] a = new int[n];\n\t\tfor (int i = 0; i < n; i++)\n\t\t\ta[i] = ni();\n\t\treturn a;\n\t}",
"na",
"{\n\t\tint[] a = new int[n];\n\t\tfor (int i = 0; i < n; i++)\n\t\t\ta[i] = ni();\n\t\treturn a;\n\t}",
"int[] a = new int[n];",
"a",
"new int[n]",
"n",
"for (int i = 0; i < n; i++)\n\t\t\ta[i] = ni();",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < n",
"i",
"n",
"i++",
"i++",
"i",
"a[i] = ni();",
"a[i] = ni()",
"a[i]",
"a",
"i",
"ni()",
"ni",
"return a;",
"a",
"int n",
"n",
"//Get next char array from one line\n\tprivate static char[] ns() {\n\t\treturn next().toCharArray();\n\t}",
"ns",
"{\n\t\treturn next().toCharArray();\n\t}",
"return next().toCharArray();",
"next().toCharArray()",
"next().toCharArray",
"next()",
"next",
"//Get next long array from one line\n\tprivate static long[] nal(int n) {\n\t\tlong[] a = new long[n];\n\t\tfor (int i = 0; i < n; i++)\n\t\t\ta[i] = nl();\n\t\treturn a;\n\t}",
"nal",
"{\n\t\tlong[] a = new long[n];\n\t\tfor (int i = 0; i < n; i++)\n\t\t\ta[i] = nl();\n\t\treturn a;\n\t}",
"long[] a = new long[n];",
"a",
"new long[n]",
"n",
"for (int i = 0; i < n; i++)\n\t\t\ta[i] = nl();",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < n",
"i",
"n",
"i++",
"i++",
"i",
"a[i] = nl();",
"a[i] = nl()",
"a[i]",
"a",
"i",
"nl()",
"nl",
"return a;",
"a",
"int n",
"n",
"public class Main {\t\n\n\tprivate static void solve(){\n\t\t//Implement solution here.\n\t\tint N = ni();\n\t\tint M = ni();\t\t\n\t\tint[] A = na(M);\n\n\t\tArrays.sort(A);\n\t\tint idx = 0;\t\t\n\t\twhile(idx < M) {\n\t\t\tif(N - A[idx] >= 0) {\n\t\t\t\tN -= A[idx];\n\t\t\t\tidx++;\n\t\t\t} else {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\t\t\t\n\t\tSystem.out.println(idx == M ? N : -1);\n\t}\n\n\t//Switch input source (stdin/file)\n\tprivate static BufferedReader br;\n\tpublic static void main(String[] args){\n\t\tbr = new BufferedReader(new InputStreamReader(System.in));\n\t\tString debugDataPath = System.getenv(\"DD_PATH\"); \n\t\tif(debugDataPath != null){\n\t\t\ttry{\n\t\t\t\tbr = new BufferedReader(new InputStreamReader(new FileInputStream(new File(debugDataPath))));\n\t\t\t}catch(Exception e){\n\t\t\t\tthrow new RuntimeException(e);\n\t\t\t}\n\t\t}\n\t\tboolean hasNext = true;\n\t\twhile(hasNext){\n\t\t\tsolve();\t\n\t\t\ttry{\n\t\t\t\tbr.mark(1);\n\t\t\t\tif(br.read() > 0){\n\t\t\t\t\tbr.reset();\t\t\t\n\t\t\t\t\tSystem.out.println(\"---\");\n\t\t\t\t} else {\n\t\t\t\t\thasNext = false;\n\t\t\t\t}\n\t\t\t}catch(Exception e){\n\t\t\t\tthrow new RuntimeException(e);\n\t\t\t} \n\t\t}\n\t}\n\n\t//Input read utility\n\tprivate static StringTokenizer tokenizer = null;\n\tpublic static String next() {\n\t\twhile (tokenizer == null || !tokenizer.hasMoreTokens()) {\n\t\t\ttry {\n\t\t\t\ttokenizer = new StringTokenizer(br.readLine());\n\t\t\t} catch (Exception e) {\n\t\t\t\tthrow new RuntimeException(e);\n\t\t\t}\n\t\t}\n\t\treturn tokenizer.nextToken();\n\t}\n\t//Get next single int\n\tprivate static int ni() {\n\t\treturn Integer.parseInt(next());\n\t}\n\t//Get next single long\n\tprivate static long nl() {\n\t\treturn Long.parseLong(next());\n\t}\n\t//Get next single double\n\tprivate static double nd() {\n\t\treturn Double.parseDouble(next());\n\t}\n\t//Get next int array from one line\n\tprivate static int[] na(int n) {\n\t\tint[] a = new int[n];\n\t\tfor (int i = 0; i < n; i++)\n\t\t\ta[i] = ni();\n\t\treturn a;\n\t}\n\t//Get next char array from one line\n\tprivate static char[] ns() {\n\t\treturn next().toCharArray();\n\t}\n\t//Get next long array from one line\n\tprivate static long[] nal(int n) {\n\t\tlong[] a = new long[n];\n\t\tfor (int i = 0; i < n; i++)\n\t\t\ta[i] = nl();\n\t\treturn a;\n\t}\n}",
"public class Main {\t\n\n\tprivate static void solve(){\n\t\t//Implement solution here.\n\t\tint N = ni();\n\t\tint M = ni();\t\t\n\t\tint[] A = na(M);\n\n\t\tArrays.sort(A);\n\t\tint idx = 0;\t\t\n\t\twhile(idx < M) {\n\t\t\tif(N - A[idx] >= 0) {\n\t\t\t\tN -= A[idx];\n\t\t\t\tidx++;\n\t\t\t} else {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\t\t\t\n\t\tSystem.out.println(idx == M ? N : -1);\n\t}\n\n\t//Switch input source (stdin/file)\n\tprivate static BufferedReader br;\n\tpublic static void main(String[] args){\n\t\tbr = new BufferedReader(new InputStreamReader(System.in));\n\t\tString debugDataPath = System.getenv(\"DD_PATH\"); \n\t\tif(debugDataPath != null){\n\t\t\ttry{\n\t\t\t\tbr = new BufferedReader(new InputStreamReader(new FileInputStream(new File(debugDataPath))));\n\t\t\t}catch(Exception e){\n\t\t\t\tthrow new RuntimeException(e);\n\t\t\t}\n\t\t}\n\t\tboolean hasNext = true;\n\t\twhile(hasNext){\n\t\t\tsolve();\t\n\t\t\ttry{\n\t\t\t\tbr.mark(1);\n\t\t\t\tif(br.read() > 0){\n\t\t\t\t\tbr.reset();\t\t\t\n\t\t\t\t\tSystem.out.println(\"---\");\n\t\t\t\t} else {\n\t\t\t\t\thasNext = false;\n\t\t\t\t}\n\t\t\t}catch(Exception e){\n\t\t\t\tthrow new RuntimeException(e);\n\t\t\t} \n\t\t}\n\t}\n\n\t//Input read utility\n\tprivate static StringTokenizer tokenizer = null;\n\tpublic static String next() {\n\t\twhile (tokenizer == null || !tokenizer.hasMoreTokens()) {\n\t\t\ttry {\n\t\t\t\ttokenizer = new StringTokenizer(br.readLine());\n\t\t\t} catch (Exception e) {\n\t\t\t\tthrow new RuntimeException(e);\n\t\t\t}\n\t\t}\n\t\treturn tokenizer.nextToken();\n\t}\n\t//Get next single int\n\tprivate static int ni() {\n\t\treturn Integer.parseInt(next());\n\t}\n\t//Get next single long\n\tprivate static long nl() {\n\t\treturn Long.parseLong(next());\n\t}\n\t//Get next single double\n\tprivate static double nd() {\n\t\treturn Double.parseDouble(next());\n\t}\n\t//Get next int array from one line\n\tprivate static int[] na(int n) {\n\t\tint[] a = new int[n];\n\t\tfor (int i = 0; i < n; i++)\n\t\t\ta[i] = ni();\n\t\treturn a;\n\t}\n\t//Get next char array from one line\n\tprivate static char[] ns() {\n\t\treturn next().toCharArray();\n\t}\n\t//Get next long array from one line\n\tprivate static long[] nal(int n) {\n\t\tlong[] a = new long[n];\n\t\tfor (int i = 0; i < n; i++)\n\t\t\ta[i] = nl();\n\t\treturn a;\n\t}\n}",
"Main"
] |
import java.util.*;
import java.io.*;
public class Main {
private static void solve(){
//Implement solution here.
int N = ni();
int M = ni();
int[] A = na(M);
Arrays.sort(A);
int idx = 0;
while(idx < M) {
if(N - A[idx] >= 0) {
N -= A[idx];
idx++;
} else {
break;
}
}
System.out.println(idx == M ? N : -1);
}
//Switch input source (stdin/file)
private static BufferedReader br;
public static void main(String[] args){
br = new BufferedReader(new InputStreamReader(System.in));
String debugDataPath = System.getenv("DD_PATH");
if(debugDataPath != null){
try{
br = new BufferedReader(new InputStreamReader(new FileInputStream(new File(debugDataPath))));
}catch(Exception e){
throw new RuntimeException(e);
}
}
boolean hasNext = true;
while(hasNext){
solve();
try{
br.mark(1);
if(br.read() > 0){
br.reset();
System.out.println("---");
} else {
hasNext = false;
}
}catch(Exception e){
throw new RuntimeException(e);
}
}
}
//Input read utility
private static StringTokenizer tokenizer = null;
public static String next() {
while (tokenizer == null || !tokenizer.hasMoreTokens()) {
try {
tokenizer = new StringTokenizer(br.readLine());
} catch (Exception e) {
throw new RuntimeException(e);
}
}
return tokenizer.nextToken();
}
//Get next single int
private static int ni() {
return Integer.parseInt(next());
}
//Get next single long
private static long nl() {
return Long.parseLong(next());
}
//Get next single double
private static double nd() {
return Double.parseDouble(next());
}
//Get next int array from one line
private static int[] na(int n) {
int[] a = new int[n];
for (int i = 0; i < n; i++)
a[i] = ni();
return a;
}
//Get next char array from one line
private static char[] ns() {
return next().toCharArray();
}
//Get next long array from one line
private static long[] nal(int n) {
long[] a = new long[n];
for (int i = 0; i < n; i++)
a[i] = nl();
return a;
}
}
|
[
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,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
4,
18,
13,
4,
18,
13,
14,
2,
13,
13,
30,
4,
18,
18,
13,
13,
2,
13,
13,
30,
4,
18,
18,
13,
13,
40,
17,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
76,
5
],
[
76,
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,
31
],
[
31,
32
],
[
32,
33
],
[
33,
34
],
[
33,
35
],
[
31,
36
],
[
36,
37
],
[
36,
38
],
[
31,
39
],
[
39,
40
],
[
40,
41
],
[
31,
42
],
[
43,
43
],
[
43,
44
],
[
44,
45
],
[
44,
46
],
[
46,
47
],
[
47,
48
],
[
46,
49
],
[
49,
50
],
[
50,
51
],
[
8,
52
],
[
52,
53
],
[
53,
54
],
[
53,
55
],
[
52,
56
],
[
56,
57
],
[
57,
58
],
[
58,
59
],
[
59,
60
],
[
59,
61
],
[
57,
62
],
[
62,
63
],
[
62,
64
],
[
52,
65
],
[
65,
66
],
[
66,
67
],
[
67,
68
],
[
68,
69
],
[
68,
70
],
[
66,
71
],
[
71,
72
],
[
6,
73
],
[
73,
74
],
[
0,
75
],
[
75,
76
],
[
75,
77
]
] |
[
"import java.util.Scanner;\n\npublic class Main {\n\n public static void main(String[] args) {\n \n Scanner sc = new Scanner(System.in);\n \n int n = Integer.parseInt(sc.next());\n int m = Integer.parseInt(sc.next());\n int sum = 0;\n for(int i = 0; i < m; i++){\n sum += Integer.parseInt(sc.next());\n }\n \n if(n >= sum){\n System.out.println(n - sum);\n }else{\n System.out.println(-1);\n }\n }\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n\n public static void main(String[] args) {\n \n Scanner sc = new Scanner(System.in);\n \n int n = Integer.parseInt(sc.next());\n int m = Integer.parseInt(sc.next());\n int sum = 0;\n for(int i = 0; i < m; i++){\n sum += Integer.parseInt(sc.next());\n }\n \n if(n >= sum){\n System.out.println(n - sum);\n }else{\n System.out.println(-1);\n }\n }\n}",
"Main",
"public static void main(String[] args) {\n \n Scanner sc = new Scanner(System.in);\n \n int n = Integer.parseInt(sc.next());\n int m = Integer.parseInt(sc.next());\n int sum = 0;\n for(int i = 0; i < m; i++){\n sum += Integer.parseInt(sc.next());\n }\n \n if(n >= sum){\n System.out.println(n - sum);\n }else{\n System.out.println(-1);\n }\n }",
"main",
"{\n \n Scanner sc = new Scanner(System.in);\n \n int n = Integer.parseInt(sc.next());\n int m = Integer.parseInt(sc.next());\n int sum = 0;\n for(int i = 0; i < m; i++){\n sum += Integer.parseInt(sc.next());\n }\n \n if(n >= sum){\n System.out.println(n - sum);\n }else{\n System.out.println(-1);\n }\n }",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"int n = Integer.parseInt(sc.next());",
"n",
"Integer.parseInt(sc.next())",
"Integer.parseInt",
"Integer",
"sc.next()",
"sc.next",
"sc",
"int m = Integer.parseInt(sc.next());",
"m",
"Integer.parseInt(sc.next())",
"Integer.parseInt",
"Integer",
"sc.next()",
"sc.next",
"sc",
"int sum = 0;",
"sum",
"0",
"for(int i = 0; i < m; i++){\n sum += Integer.parseInt(sc.next());\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < m",
"i",
"m",
"i++",
"i++",
"i",
"{\n sum += Integer.parseInt(sc.next());\n }",
"{\n sum += Integer.parseInt(sc.next());\n }",
"sum += Integer.parseInt(sc.next())",
"sum",
"Integer.parseInt(sc.next())",
"Integer.parseInt",
"Integer",
"sc.next()",
"sc.next",
"sc",
"if(n >= sum){\n System.out.println(n - sum);\n }else{\n System.out.println(-1);\n }",
"n >= sum",
"n",
"sum",
"{\n System.out.println(n - sum);\n }",
"System.out.println(n - sum)",
"System.out.println",
"System.out",
"System",
"System.out",
"n - sum",
"n",
"sum",
"{\n System.out.println(-1);\n }",
"System.out.println(-1)",
"System.out.println",
"System.out",
"System",
"System.out",
"-1",
"1",
"String[] args",
"args",
"public class Main {\n\n public static void main(String[] args) {\n \n Scanner sc = new Scanner(System.in);\n \n int n = Integer.parseInt(sc.next());\n int m = Integer.parseInt(sc.next());\n int sum = 0;\n for(int i = 0; i < m; i++){\n sum += Integer.parseInt(sc.next());\n }\n \n if(n >= sum){\n System.out.println(n - sum);\n }else{\n System.out.println(-1);\n }\n }\n}",
"public class Main {\n\n public static void main(String[] args) {\n \n Scanner sc = new Scanner(System.in);\n \n int n = Integer.parseInt(sc.next());\n int m = Integer.parseInt(sc.next());\n int sum = 0;\n for(int i = 0; i < m; i++){\n sum += Integer.parseInt(sc.next());\n }\n \n if(n >= sum){\n System.out.println(n - sum);\n }else{\n System.out.println(-1);\n }\n }\n}",
"Main"
] |
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int n = Integer.parseInt(sc.next());
int m = Integer.parseInt(sc.next());
int sum = 0;
for(int i = 0; i < m; i++){
sum += Integer.parseInt(sc.next());
}
if(n >= sum){
System.out.println(n - sum);
}else{
System.out.println(-1);
}
}
}
|
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
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,
4,
18,
13,
0,
13,
13,
4,
18,
18,
13,
13,
8,
2,
13,
17,
40,
17,
13,
4,
18,
13,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
61,
5
],
[
61,
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
],
[
23,
24
],
[
24,
25
],
[
24,
26
],
[
22,
27
],
[
27,
28
],
[
27,
29
],
[
22,
30
],
[
30,
31
],
[
31,
32
],
[
22,
33
],
[
34,
34
],
[
34,
35
],
[
35,
36
],
[
35,
37
],
[
37,
38
],
[
38,
39
],
[
34,
40
],
[
40,
41
],
[
40,
42
],
[
8,
43
],
[
43,
44
],
[
44,
45
],
[
45,
46
],
[
45,
47
],
[
43,
48
],
[
48,
49
],
[
49,
50
],
[
49,
51
],
[
48,
52
],
[
52,
53
],
[
48,
54
],
[
8,
55
],
[
55,
56
],
[
56,
57
],
[
6,
58
],
[
58,
59
],
[
0,
60
],
[
60,
61
],
[
60,
62
]
] |
[
"import java.util.Scanner;\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\tlong n = scan.nextLong();\n\t\tint m = scan.nextInt();\n\n\t\tfor(int i = 0;i<m;i++) {\n\n\t\t\tint a = scan.nextInt();\n\t\t\tn -= a;\n\t\t}\n\n\n\t\t\tSystem.out.println(n<0?-1:n);\n\n\n\t\tscan.close();\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\n\t\tlong n = scan.nextLong();\n\t\tint m = scan.nextInt();\n\n\t\tfor(int i = 0;i<m;i++) {\n\n\t\t\tint a = scan.nextInt();\n\t\t\tn -= a;\n\t\t}\n\n\n\t\t\tSystem.out.println(n<0?-1:n);\n\n\n\t\tscan.close();\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\n\t\tlong n = scan.nextLong();\n\t\tint m = scan.nextInt();\n\n\t\tfor(int i = 0;i<m;i++) {\n\n\t\t\tint a = scan.nextInt();\n\t\t\tn -= a;\n\t\t}\n\n\n\t\t\tSystem.out.println(n<0?-1:n);\n\n\n\t\tscan.close();\n\t}",
"main",
"{\n\t\t// TODO ่ชๅ็ๆใใใใกใฝใใใปในใฟใ\n\n\t\tScanner scan = new Scanner(System.in);\n\n\t\tlong n = scan.nextLong();\n\t\tint m = scan.nextInt();\n\n\t\tfor(int i = 0;i<m;i++) {\n\n\t\t\tint a = scan.nextInt();\n\t\t\tn -= a;\n\t\t}\n\n\n\t\t\tSystem.out.println(n<0?-1:n);\n\n\n\t\tscan.close();\n\t}",
"Scanner scan = new Scanner(System.in);",
"scan",
"new Scanner(System.in)",
"long n = scan.nextLong();",
"n",
"scan.nextLong()",
"scan.nextLong",
"scan",
"int m = scan.nextInt();",
"m",
"scan.nextInt()",
"scan.nextInt",
"scan",
"for(int i = 0;i<m;i++) {\n\n\t\t\tint a = scan.nextInt();\n\t\t\tn -= a;\n\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i<m",
"i",
"m",
"i++",
"i++",
"i",
"{\n\n\t\t\tint a = scan.nextInt();\n\t\t\tn -= a;\n\t\t}",
"{\n\n\t\t\tint a = scan.nextInt();\n\t\t\tn -= a;\n\t\t}",
"int a = scan.nextInt();",
"a",
"scan.nextInt()",
"scan.nextInt",
"scan",
"n -= a",
"n",
"a",
"System.out.println(n<0?-1:n)",
"System.out.println",
"System.out",
"System",
"System.out",
"n<0?-1:n",
"n<0",
"n",
"0",
"-1",
"1",
"n",
"scan.close()",
"scan.close",
"scan",
"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\tlong n = scan.nextLong();\n\t\tint m = scan.nextInt();\n\n\t\tfor(int i = 0;i<m;i++) {\n\n\t\t\tint a = scan.nextInt();\n\t\t\tn -= a;\n\t\t}\n\n\n\t\t\tSystem.out.println(n<0?-1:n);\n\n\n\t\tscan.close();\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\n\t\tlong n = scan.nextLong();\n\t\tint m = scan.nextInt();\n\n\t\tfor(int i = 0;i<m;i++) {\n\n\t\t\tint a = scan.nextInt();\n\t\t\tn -= a;\n\t\t}\n\n\n\t\t\tSystem.out.println(n<0?-1:n);\n\n\n\t\tscan.close();\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);
long n = scan.nextLong();
int m = scan.nextInt();
for(int i = 0;i<m;i++) {
int a = scan.nextInt();
n -= a;
}
System.out.println(n<0?-1:n);
scan.close();
}
}
|
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
41,
13,
41,
13,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
17,
0,
13,
4,
18,
13,
18,
13,
17,
0,
13,
4,
18,
13,
18,
13,
17,
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,
13,
2,
13,
4,
18,
13,
18,
13,
13,
14,
2,
13,
17,
30,
4,
18,
18,
13,
13,
40,
17,
30,
4,
18,
18,
13,
13,
13,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
101,
5
],
[
101,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
8,
11
],
[
11,
12
],
[
8,
13
],
[
13,
14
],
[
8,
15
],
[
15,
16
],
[
15,
17
],
[
8,
18
],
[
18,
19
],
[
18,
20
],
[
20,
21
],
[
21,
22
],
[
8,
23
],
[
23,
24
],
[
23,
25
],
[
25,
26
],
[
26,
27
],
[
25,
28
],
[
8,
29
],
[
29,
30
],
[
29,
31
],
[
31,
32
],
[
32,
33
],
[
31,
34
],
[
34,
35
],
[
34,
36
],
[
8,
37
],
[
37,
38
],
[
37,
39
],
[
39,
40
],
[
40,
41
],
[
39,
42
],
[
42,
43
],
[
42,
44
],
[
8,
45
],
[
45,
46
],
[
45,
47
],
[
47,
48
],
[
48,
49
],
[
8,
50
],
[
50,
51
],
[
50,
52
],
[
52,
53
],
[
53,
54
],
[
52,
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
],
[
68,
68
],
[
68,
69
],
[
69,
70
],
[
69,
71
],
[
71,
72
],
[
71,
73
],
[
73,
74
],
[
74,
75
],
[
73,
76
],
[
76,
77
],
[
76,
78
],
[
8,
79
],
[
79,
80
],
[
80,
81
],
[
80,
82
],
[
79,
83
],
[
83,
84
],
[
84,
85
],
[
85,
86
],
[
86,
87
],
[
86,
88
],
[
84,
89
],
[
89,
90
],
[
79,
91
],
[
91,
92
],
[
92,
93
],
[
93,
94
],
[
94,
95
],
[
94,
96
],
[
92,
97
],
[
6,
98
],
[
98,
99
],
[
0,
100
],
[
100,
101
],
[
100,
102
]
] |
[
"\nimport java.util.Scanner;\n\npublic class Main {\n\tpublic static void main (String[] args) {\n\t\tint x;\n\t\tint y;\n\t\tint z;\n\t\tScanner scan = new Scanner(System.in);\n\t\tString num = scan.nextLine();\n\t\tString[] numbers = num.split(\" \");\n\t\tx = Integer.parseInt(numbers[0]);\n\t\ty = Integer.parseInt(numbers[1]);\n//\t\tz = Integer.parseInt(numbers[2]);\n\n\t\tString A = scan.nextLine();\n\t\tString[] a = A.split(\" \");\n\n\t\tfor(int i=0; i<y; i++) {\n\t\t\tx = x-Integer.parseInt(a[i]);\n\t\t}\n\n\t\tif(x<0) {\n\t\t\tSystem.out.println(-1);\n\t\t}else {\n\t\t\tSystem.out.println(x);\n\t\t}\n\n\t}\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n\tpublic static void main (String[] args) {\n\t\tint x;\n\t\tint y;\n\t\tint z;\n\t\tScanner scan = new Scanner(System.in);\n\t\tString num = scan.nextLine();\n\t\tString[] numbers = num.split(\" \");\n\t\tx = Integer.parseInt(numbers[0]);\n\t\ty = Integer.parseInt(numbers[1]);\n//\t\tz = Integer.parseInt(numbers[2]);\n\n\t\tString A = scan.nextLine();\n\t\tString[] a = A.split(\" \");\n\n\t\tfor(int i=0; i<y; i++) {\n\t\t\tx = x-Integer.parseInt(a[i]);\n\t\t}\n\n\t\tif(x<0) {\n\t\t\tSystem.out.println(-1);\n\t\t}else {\n\t\t\tSystem.out.println(x);\n\t\t}\n\n\t}\n}",
"Main",
"public static void main (String[] args) {\n\t\tint x;\n\t\tint y;\n\t\tint z;\n\t\tScanner scan = new Scanner(System.in);\n\t\tString num = scan.nextLine();\n\t\tString[] numbers = num.split(\" \");\n\t\tx = Integer.parseInt(numbers[0]);\n\t\ty = Integer.parseInt(numbers[1]);\n//\t\tz = Integer.parseInt(numbers[2]);\n\n\t\tString A = scan.nextLine();\n\t\tString[] a = A.split(\" \");\n\n\t\tfor(int i=0; i<y; i++) {\n\t\t\tx = x-Integer.parseInt(a[i]);\n\t\t}\n\n\t\tif(x<0) {\n\t\t\tSystem.out.println(-1);\n\t\t}else {\n\t\t\tSystem.out.println(x);\n\t\t}\n\n\t}",
"main",
"{\n\t\tint x;\n\t\tint y;\n\t\tint z;\n\t\tScanner scan = new Scanner(System.in);\n\t\tString num = scan.nextLine();\n\t\tString[] numbers = num.split(\" \");\n\t\tx = Integer.parseInt(numbers[0]);\n\t\ty = Integer.parseInt(numbers[1]);\n//\t\tz = Integer.parseInt(numbers[2]);\n\n\t\tString A = scan.nextLine();\n\t\tString[] a = A.split(\" \");\n\n\t\tfor(int i=0; i<y; i++) {\n\t\t\tx = x-Integer.parseInt(a[i]);\n\t\t}\n\n\t\tif(x<0) {\n\t\t\tSystem.out.println(-1);\n\t\t}else {\n\t\t\tSystem.out.println(x);\n\t\t}\n\n\t}",
"int x;",
"x",
"int y;",
"y",
"int z;",
"z",
"Scanner scan = new Scanner(System.in);",
"scan",
"new Scanner(System.in)",
"String num = scan.nextLine();",
"num",
"scan.nextLine()",
"scan.nextLine",
"scan",
"String[] numbers = num.split(\" \");",
"numbers",
"num.split(\" \")",
"num.split",
"num",
"\" \"",
"x = Integer.parseInt(numbers[0])",
"x",
"Integer.parseInt(numbers[0])",
"Integer.parseInt",
"Integer",
"numbers[0]",
"numbers",
"0",
"y = Integer.parseInt(numbers[1])",
"y",
"Integer.parseInt(numbers[1])",
"Integer.parseInt",
"Integer",
"numbers[1]",
"numbers",
"1",
"String A = scan.nextLine();",
"A",
"scan.nextLine()",
"scan.nextLine",
"scan",
"String[] a = A.split(\" \");",
"a",
"A.split(\" \")",
"A.split",
"A",
"\" \"",
"for(int i=0; i<y; i++) {\n\t\t\tx = x-Integer.parseInt(a[i]);\n\t\t}",
"int i=0;",
"int i=0;",
"i",
"0",
"i<y",
"i",
"y",
"i++",
"i++",
"i",
"{\n\t\t\tx = x-Integer.parseInt(a[i]);\n\t\t}",
"{\n\t\t\tx = x-Integer.parseInt(a[i]);\n\t\t}",
"x = x-Integer.parseInt(a[i])",
"x",
"x-Integer.parseInt(a[i])",
"x",
"Integer.parseInt(a[i])",
"Integer.parseInt",
"Integer",
"a[i]",
"a",
"i",
"if(x<0) {\n\t\t\tSystem.out.println(-1);\n\t\t}else {\n\t\t\tSystem.out.println(x);\n\t\t}",
"x<0",
"x",
"0",
"{\n\t\t\tSystem.out.println(-1);\n\t\t}",
"System.out.println(-1)",
"System.out.println",
"System.out",
"System",
"System.out",
"-1",
"1",
"{\n\t\t\tSystem.out.println(x);\n\t\t}",
"System.out.println(x)",
"System.out.println",
"System.out",
"System",
"System.out",
"x",
"String[] args",
"args",
"public class Main {\n\tpublic static void main (String[] args) {\n\t\tint x;\n\t\tint y;\n\t\tint z;\n\t\tScanner scan = new Scanner(System.in);\n\t\tString num = scan.nextLine();\n\t\tString[] numbers = num.split(\" \");\n\t\tx = Integer.parseInt(numbers[0]);\n\t\ty = Integer.parseInt(numbers[1]);\n//\t\tz = Integer.parseInt(numbers[2]);\n\n\t\tString A = scan.nextLine();\n\t\tString[] a = A.split(\" \");\n\n\t\tfor(int i=0; i<y; i++) {\n\t\t\tx = x-Integer.parseInt(a[i]);\n\t\t}\n\n\t\tif(x<0) {\n\t\t\tSystem.out.println(-1);\n\t\t}else {\n\t\t\tSystem.out.println(x);\n\t\t}\n\n\t}\n}",
"public class Main {\n\tpublic static void main (String[] args) {\n\t\tint x;\n\t\tint y;\n\t\tint z;\n\t\tScanner scan = new Scanner(System.in);\n\t\tString num = scan.nextLine();\n\t\tString[] numbers = num.split(\" \");\n\t\tx = Integer.parseInt(numbers[0]);\n\t\ty = Integer.parseInt(numbers[1]);\n//\t\tz = Integer.parseInt(numbers[2]);\n\n\t\tString A = scan.nextLine();\n\t\tString[] a = A.split(\" \");\n\n\t\tfor(int i=0; i<y; i++) {\n\t\t\tx = x-Integer.parseInt(a[i]);\n\t\t}\n\n\t\tif(x<0) {\n\t\t\tSystem.out.println(-1);\n\t\t}else {\n\t\t\tSystem.out.println(x);\n\t\t}\n\n\t}\n}",
"Main"
] |
import java.util.Scanner;
public class Main {
public static void main (String[] args) {
int x;
int y;
int z;
Scanner scan = new Scanner(System.in);
String num = scan.nextLine();
String[] numbers = num.split(" ");
x = Integer.parseInt(numbers[0]);
y = Integer.parseInt(numbers[1]);
// z = Integer.parseInt(numbers[2]);
String A = scan.nextLine();
String[] a = A.split(" ");
for(int i=0; i<y; i++) {
x = x-Integer.parseInt(a[i]);
}
if(x<0) {
System.out.println(-1);
}else {
System.out.println(x);
}
}
}
|
[
7,
15,
13,
17,
6,
13,
41,
13,
20,
41,
13,
20,
12,
13,
30,
41,
13,
4,
13,
41,
13,
4,
13,
41,
13,
20,
13,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
18,
13,
13,
4,
13,
0,
13,
18,
13,
13,
14,
2,
13,
13,
30,
4,
18,
18,
13,
13,
17,
30,
4,
18,
18,
13,
13,
2,
13,
13,
23,
13,
12,
13,
30,
29,
4,
18,
13,
23,
13,
12,
13,
30,
29,
4,
18,
13,
23,
13,
12,
13,
30,
29,
4,
18,
13,
12,
13,
30,
29,
4,
18,
13,
4,
18,
13,
12,
13,
30,
29,
4,
18,
13,
4,
18,
13,
12,
13,
30,
29,
4,
18,
13,
4,
18,
13,
12,
13,
30,
29,
4,
18,
13,
17,
23,
13,
12,
13,
30,
29,
4,
18,
13,
23,
13,
12,
13,
30,
29,
2,
13,
17,
23,
13,
12,
13,
30,
41,
13,
18,
13,
13,
41,
13,
18,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
4,
18,
13,
13,
18,
13,
13,
29,
13,
23,
13,
12,
13,
30,
41,
13,
18,
13,
13,
41,
13,
18,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
4,
18,
13,
13,
18,
13,
13,
29,
13,
23,
13,
12,
13,
30,
41,
13,
18,
13,
13,
41,
13,
18,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
4,
18,
13,
13,
18,
13,
13,
29,
13,
23,
13,
12,
13,
30,
41,
13,
18,
13,
13,
41,
13,
18,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
4,
18,
13,
13,
18,
13,
13,
29,
13,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
316,
5
],
[
316,
6
],
[
6,
7
],
[
6,
8
],
[
316,
9
],
[
9,
10
],
[
9,
11
],
[
316,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
15,
17
],
[
17,
18
],
[
14,
19
],
[
19,
20
],
[
19,
21
],
[
21,
22
],
[
14,
23
],
[
23,
24
],
[
23,
25
],
[
14,
27
],
[
27,
28
],
[
27,
29
],
[
14,
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
],
[
44,
46
],
[
43,
47
],
[
47,
48
],
[
42,
49
],
[
49,
50
],
[
49,
51
],
[
51,
52
],
[
51,
53
],
[
14,
54
],
[
54,
55
],
[
55,
56
],
[
55,
57
],
[
54,
58
],
[
58,
59
],
[
59,
60
],
[
60,
61
],
[
61,
62
],
[
61,
63
],
[
59,
64
],
[
54,
65
],
[
65,
66
],
[
66,
67
],
[
67,
68
],
[
68,
69
],
[
68,
70
],
[
66,
71
],
[
71,
72
],
[
71,
73
],
[
12,
74
],
[
74,
75
],
[
316,
76
],
[
76,
77
],
[
76,
78
],
[
78,
79
],
[
79,
80
],
[
80,
81
],
[
81,
82
],
[
76,
83
],
[
83,
84
],
[
316,
85
],
[
85,
86
],
[
85,
87
],
[
87,
88
],
[
88,
89
],
[
89,
90
],
[
90,
91
],
[
85,
92
],
[
92,
93
],
[
316,
94
],
[
94,
95
],
[
94,
96
],
[
96,
97
],
[
97,
98
],
[
98,
99
],
[
99,
100
],
[
316,
101
],
[
101,
102
],
[
101,
103
],
[
103,
104
],
[
104,
105
],
[
105,
106
],
[
106,
107
],
[
105,
108
],
[
108,
109
],
[
109,
110
],
[
316,
111
],
[
111,
112
],
[
111,
113
],
[
113,
114
],
[
114,
115
],
[
115,
116
],
[
116,
117
],
[
115,
118
],
[
118,
119
],
[
119,
120
],
[
316,
121
],
[
121,
122
],
[
121,
123
],
[
123,
124
],
[
124,
125
],
[
125,
126
],
[
126,
127
],
[
125,
128
],
[
128,
129
],
[
129,
130
],
[
316,
131
],
[
131,
132
],
[
131,
133
],
[
133,
134
],
[
134,
135
],
[
135,
136
],
[
136,
137
],
[
135,
138
],
[
131,
139
],
[
139,
140
],
[
316,
141
],
[
141,
142
],
[
141,
143
],
[
143,
144
],
[
144,
145
],
[
145,
146
],
[
146,
147
],
[
141,
148
],
[
148,
149
],
[
316,
150
],
[
150,
151
],
[
150,
152
],
[
152,
153
],
[
153,
154
],
[
154,
155
],
[
154,
156
],
[
150,
157
],
[
157,
158
],
[
316,
159
],
[
159,
160
],
[
159,
161
],
[
161,
162
],
[
162,
163
],
[
162,
164
],
[
164,
165
],
[
164,
166
],
[
161,
167
],
[
167,
168
],
[
167,
169
],
[
169,
170
],
[
169,
171
],
[
161,
172
],
[
172,
173
],
[
173,
174
],
[
174,
175
],
[
174,
176
],
[
172,
177
],
[
177,
178
],
[
177,
179
],
[
172,
180
],
[
180,
181
],
[
181,
182
],
[
172,
183
],
[
184,
184
],
[
184,
185
],
[
185,
186
],
[
185,
187
],
[
187,
188
],
[
188,
189
],
[
187,
190
],
[
187,
191
],
[
191,
192
],
[
191,
193
],
[
161,
194
],
[
194,
195
],
[
159,
196
],
[
196,
197
],
[
316,
198
],
[
198,
199
],
[
198,
200
],
[
200,
201
],
[
201,
202
],
[
201,
203
],
[
203,
204
],
[
203,
205
],
[
200,
206
],
[
206,
207
],
[
206,
208
],
[
208,
209
],
[
208,
210
],
[
200,
211
],
[
211,
212
],
[
212,
213
],
[
213,
214
],
[
213,
215
],
[
211,
216
],
[
216,
217
],
[
216,
218
],
[
211,
219
],
[
219,
220
],
[
220,
221
],
[
211,
222
],
[
223,
223
],
[
223,
224
],
[
224,
225
],
[
224,
226
],
[
226,
227
],
[
227,
228
],
[
226,
229
],
[
226,
230
],
[
230,
231
],
[
230,
232
],
[
200,
233
],
[
233,
234
],
[
198,
235
],
[
235,
236
],
[
316,
237
],
[
237,
238
],
[
237,
239
],
[
239,
240
],
[
240,
241
],
[
240,
242
],
[
242,
243
],
[
242,
244
],
[
239,
245
],
[
245,
246
],
[
245,
247
],
[
247,
248
],
[
247,
249
],
[
239,
250
],
[
250,
251
],
[
251,
252
],
[
252,
253
],
[
252,
254
],
[
250,
255
],
[
255,
256
],
[
255,
257
],
[
250,
258
],
[
258,
259
],
[
259,
260
],
[
250,
261
],
[
262,
262
],
[
262,
263
],
[
263,
264
],
[
263,
265
],
[
265,
266
],
[
266,
267
],
[
265,
268
],
[
265,
269
],
[
269,
270
],
[
269,
271
],
[
239,
272
],
[
272,
273
],
[
237,
274
],
[
274,
275
],
[
316,
276
],
[
276,
277
],
[
276,
278
],
[
278,
279
],
[
279,
280
],
[
279,
281
],
[
281,
282
],
[
281,
283
],
[
278,
284
],
[
284,
285
],
[
284,
286
],
[
286,
287
],
[
286,
288
],
[
278,
289
],
[
289,
290
],
[
290,
291
],
[
291,
292
],
[
291,
293
],
[
289,
294
],
[
294,
295
],
[
294,
296
],
[
289,
297
],
[
297,
298
],
[
298,
299
],
[
289,
300
],
[
301,
301
],
[
301,
302
],
[
302,
303
],
[
302,
304
],
[
304,
305
],
[
305,
306
],
[
304,
307
],
[
304,
308
],
[
308,
309
],
[
308,
310
],
[
278,
311
],
[
311,
312
],
[
276,
313
],
[
313,
314
],
[
0,
315
],
[
315,
316
],
[
315,
317
]
] |
[
"import java.util.*;\n\n//update 2020/1/1 23:01\n\npublic class Main{\n\n static Scanner sc = new Scanner(System.in);\n static StringBuilder sb = new StringBuilder();\n\n public static void main(String[] args) {\n\n int n = nextInt();\n int m = nextInt();\n int[] a = new int[m];\n int sum = 0;\n for(int i=0;i<m;i++){\n a[i] = nextInt();\n sum += a[i];\n }\n\n if(sum>n){\n System.out.println(\"-1\");\n }\n else{\n System.out.println(n-sum);\n }\n\n //System.out.println();\n\n }\n /*\n static String toSmall(String s){\n char c = s.charAt(0);\n //if(Character.isUpperCase(c)){\n if(c<=90){\n c += 32;\n }\n return String.valueOf(c);\n }\n static String toBig(String s){\n char c = s.charAt(0);\n //if(Character.isLowerCase(c)){\n if(c>=97){\n c -= 32;\n }\n return String.valueOf(c);\n }\n */\n\n static String toSmall(String s){\n return s.toLowerCase();\n }\n\n static String toBig(String s){\n return s.toUpperCase();\n }\n\n static String next(){\n return sc.next();\n }\n\n static int nextInt(){\n return Integer.parseInt(sc.next());\n }\n\n static long nextLong(){\n return Long.parseLong(sc.next());\n }\n\n static double nextDouble(){\n return Double.parseDouble(sc.next());\n }\n\n static String[] splitString(String s){\n return s.split(\"\");\n }\n\n static char[] splitChar(String s){\n return s.toCharArray();\n }\n\n static int charToInt(char a){\n return a - 48;\n }\n\n////////////////////////////////////////////\n public static int max(int[] a){\n int lng = a.length;\n int max = a[0];\n for(int i=1;i<lng;i++){\n max = Math.max(max,a[i]);\n }\n return max;\n }\n public static long max(long[] a){\n int lng = a.length;\n long max = a[0];\n for(int i=1;i<lng;i++){\n max = Math.max(max,a[i]);\n }\n return max;\n }\n////////////////////////////////////////////\n\n////////////////////////////////////////////\n public static int min(int[] a){\n int lng = a.length;\n int min = a[0];\n for(int i=1;i<lng;i++){\n min = Math.min(min,a[i]);\n }\n return min;\n }\n public static long min(long[] a){\n int lng = a.length;\n long min = a[0];\n for(int i=1;i<lng;i++){\n min = Math.min(min,a[i]);\n }\n return min;\n }\n////////////////////////////////////////////\n\n}",
"import java.util.*;",
"util.*",
"java",
"public class Main{\n\n static Scanner sc = new Scanner(System.in);\n static StringBuilder sb = new StringBuilder();\n\n public static void main(String[] args) {\n\n int n = nextInt();\n int m = nextInt();\n int[] a = new int[m];\n int sum = 0;\n for(int i=0;i<m;i++){\n a[i] = nextInt();\n sum += a[i];\n }\n\n if(sum>n){\n System.out.println(\"-1\");\n }\n else{\n System.out.println(n-sum);\n }\n\n //System.out.println();\n\n }\n /*\n static String toSmall(String s){\n char c = s.charAt(0);\n //if(Character.isUpperCase(c)){\n if(c<=90){\n c += 32;\n }\n return String.valueOf(c);\n }\n static String toBig(String s){\n char c = s.charAt(0);\n //if(Character.isLowerCase(c)){\n if(c>=97){\n c -= 32;\n }\n return String.valueOf(c);\n }\n */\n\n static String toSmall(String s){\n return s.toLowerCase();\n }\n\n static String toBig(String s){\n return s.toUpperCase();\n }\n\n static String next(){\n return sc.next();\n }\n\n static int nextInt(){\n return Integer.parseInt(sc.next());\n }\n\n static long nextLong(){\n return Long.parseLong(sc.next());\n }\n\n static double nextDouble(){\n return Double.parseDouble(sc.next());\n }\n\n static String[] splitString(String s){\n return s.split(\"\");\n }\n\n static char[] splitChar(String s){\n return s.toCharArray();\n }\n\n static int charToInt(char a){\n return a - 48;\n }\n\n////////////////////////////////////////////\n public static int max(int[] a){\n int lng = a.length;\n int max = a[0];\n for(int i=1;i<lng;i++){\n max = Math.max(max,a[i]);\n }\n return max;\n }\n public static long max(long[] a){\n int lng = a.length;\n long max = a[0];\n for(int i=1;i<lng;i++){\n max = Math.max(max,a[i]);\n }\n return max;\n }\n////////////////////////////////////////////\n\n////////////////////////////////////////////\n public static int min(int[] a){\n int lng = a.length;\n int min = a[0];\n for(int i=1;i<lng;i++){\n min = Math.min(min,a[i]);\n }\n return min;\n }\n public static long min(long[] a){\n int lng = a.length;\n long min = a[0];\n for(int i=1;i<lng;i++){\n min = Math.min(min,a[i]);\n }\n return min;\n }\n////////////////////////////////////////////\n\n}",
"Main",
"static Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"static StringBuilder sb = new StringBuilder();",
"sb",
"new StringBuilder()",
"public static void main(String[] args) {\n\n int n = nextInt();\n int m = nextInt();\n int[] a = new int[m];\n int sum = 0;\n for(int i=0;i<m;i++){\n a[i] = nextInt();\n sum += a[i];\n }\n\n if(sum>n){\n System.out.println(\"-1\");\n }\n else{\n System.out.println(n-sum);\n }\n\n //System.out.println();\n\n }",
"main",
"{\n\n int n = nextInt();\n int m = nextInt();\n int[] a = new int[m];\n int sum = 0;\n for(int i=0;i<m;i++){\n a[i] = nextInt();\n sum += a[i];\n }\n\n if(sum>n){\n System.out.println(\"-1\");\n }\n else{\n System.out.println(n-sum);\n }\n\n //System.out.println();\n\n }",
"int n = nextInt();",
"n",
"nextInt()",
"nextInt",
"int m = nextInt();",
"m",
"nextInt()",
"nextInt",
"int[] a = new int[m];",
"a",
"new int[m]",
"m",
"int sum = 0;",
"sum",
"0",
"for(int i=0;i<m;i++){\n a[i] = nextInt();\n sum += a[i];\n }",
"int i=0;",
"int i=0;",
"i",
"0",
"i<m",
"i",
"m",
"i++",
"i++",
"i",
"{\n a[i] = nextInt();\n sum += a[i];\n }",
"{\n a[i] = nextInt();\n sum += a[i];\n }",
"a[i] = nextInt()",
"a[i]",
"a",
"i",
"nextInt()",
"nextInt",
"sum += a[i]",
"sum",
"a[i]",
"a",
"i",
"if(sum>n){\n System.out.println(\"-1\");\n }\n else{\n System.out.println(n-sum);\n }",
"sum>n",
"sum",
"n",
"{\n System.out.println(\"-1\");\n }",
"System.out.println(\"-1\")",
"System.out.println",
"System.out",
"System",
"System.out",
"\"-1\"",
"{\n System.out.println(n-sum);\n }",
"System.out.println(n-sum)",
"System.out.println",
"System.out",
"System",
"System.out",
"n-sum",
"n",
"sum",
"String[] args",
"args",
"static String toSmall(String s){\n return s.toLowerCase();\n }",
"toSmall",
"{\n return s.toLowerCase();\n }",
"return s.toLowerCase();",
"s.toLowerCase()",
"s.toLowerCase",
"s",
"String s",
"s",
"static String toBig(String s){\n return s.toUpperCase();\n }",
"toBig",
"{\n return s.toUpperCase();\n }",
"return s.toUpperCase();",
"s.toUpperCase()",
"s.toUpperCase",
"s",
"String s",
"s",
"static String next(){\n return sc.next();\n }",
"next",
"{\n return sc.next();\n }",
"return sc.next();",
"sc.next()",
"sc.next",
"sc",
"static int nextInt(){\n return Integer.parseInt(sc.next());\n }",
"nextInt",
"{\n return Integer.parseInt(sc.next());\n }",
"return Integer.parseInt(sc.next());",
"Integer.parseInt(sc.next())",
"Integer.parseInt",
"Integer",
"sc.next()",
"sc.next",
"sc",
"static long nextLong(){\n return Long.parseLong(sc.next());\n }",
"nextLong",
"{\n return Long.parseLong(sc.next());\n }",
"return Long.parseLong(sc.next());",
"Long.parseLong(sc.next())",
"Long.parseLong",
"Long",
"sc.next()",
"sc.next",
"sc",
"static double nextDouble(){\n return Double.parseDouble(sc.next());\n }",
"nextDouble",
"{\n return Double.parseDouble(sc.next());\n }",
"return Double.parseDouble(sc.next());",
"Double.parseDouble(sc.next())",
"Double.parseDouble",
"Double",
"sc.next()",
"sc.next",
"sc",
"static String[] splitString(String s){\n return s.split(\"\");\n }",
"splitString",
"{\n return s.split(\"\");\n }",
"return s.split(\"\");",
"s.split(\"\")",
"s.split",
"s",
"\"\"",
"String s",
"s",
"static char[] splitChar(String s){\n return s.toCharArray();\n }",
"splitChar",
"{\n return s.toCharArray();\n }",
"return s.toCharArray();",
"s.toCharArray()",
"s.toCharArray",
"s",
"String s",
"s",
"static int charToInt(char a){\n return a - 48;\n }",
"charToInt",
"{\n return a - 48;\n }",
"return a - 48;",
"a - 48",
"a",
"48",
"char a",
"a",
"////////////////////////////////////////////\n public static int max(int[] a){\n int lng = a.length;\n int max = a[0];\n for(int i=1;i<lng;i++){\n max = Math.max(max,a[i]);\n }\n return max;\n }",
"max",
"{\n int lng = a.length;\n int max = a[0];\n for(int i=1;i<lng;i++){\n max = Math.max(max,a[i]);\n }\n return max;\n }",
"int lng = a.length;",
"lng",
"a.length",
"a",
"a.length",
"int max = a[0];",
"max",
"a[0]",
"a",
"0",
"for(int i=1;i<lng;i++){\n max = Math.max(max,a[i]);\n }",
"int i=1;",
"int i=1;",
"i",
"1",
"i<lng",
"i",
"lng",
"i++",
"i++",
"i",
"{\n max = Math.max(max,a[i]);\n }",
"{\n max = Math.max(max,a[i]);\n }",
"max = Math.max(max,a[i])",
"max",
"Math.max(max,a[i])",
"Math.max",
"Math",
"max",
"a[i]",
"a",
"i",
"return max;",
"max",
"int[] a",
"a",
"public static long max(long[] a){\n int lng = a.length;\n long max = a[0];\n for(int i=1;i<lng;i++){\n max = Math.max(max,a[i]);\n }\n return max;\n }",
"max",
"{\n int lng = a.length;\n long max = a[0];\n for(int i=1;i<lng;i++){\n max = Math.max(max,a[i]);\n }\n return max;\n }",
"int lng = a.length;",
"lng",
"a.length",
"a",
"a.length",
"long max = a[0];",
"max",
"a[0]",
"a",
"0",
"for(int i=1;i<lng;i++){\n max = Math.max(max,a[i]);\n }",
"int i=1;",
"int i=1;",
"i",
"1",
"i<lng",
"i",
"lng",
"i++",
"i++",
"i",
"{\n max = Math.max(max,a[i]);\n }",
"{\n max = Math.max(max,a[i]);\n }",
"max = Math.max(max,a[i])",
"max",
"Math.max(max,a[i])",
"Math.max",
"Math",
"max",
"a[i]",
"a",
"i",
"return max;",
"max",
"long[] a",
"a",
"////////////////////////////////////////////\n public static int min(int[] a){\n int lng = a.length;\n int min = a[0];\n for(int i=1;i<lng;i++){\n min = Math.min(min,a[i]);\n }\n return min;\n }",
"min",
"{\n int lng = a.length;\n int min = a[0];\n for(int i=1;i<lng;i++){\n min = Math.min(min,a[i]);\n }\n return min;\n }",
"int lng = a.length;",
"lng",
"a.length",
"a",
"a.length",
"int min = a[0];",
"min",
"a[0]",
"a",
"0",
"for(int i=1;i<lng;i++){\n min = Math.min(min,a[i]);\n }",
"int i=1;",
"int i=1;",
"i",
"1",
"i<lng",
"i",
"lng",
"i++",
"i++",
"i",
"{\n min = Math.min(min,a[i]);\n }",
"{\n min = Math.min(min,a[i]);\n }",
"min = Math.min(min,a[i])",
"min",
"Math.min(min,a[i])",
"Math.min",
"Math",
"min",
"a[i]",
"a",
"i",
"return min;",
"min",
"int[] a",
"a",
"public static long min(long[] a){\n int lng = a.length;\n long min = a[0];\n for(int i=1;i<lng;i++){\n min = Math.min(min,a[i]);\n }\n return min;\n }",
"min",
"{\n int lng = a.length;\n long min = a[0];\n for(int i=1;i<lng;i++){\n min = Math.min(min,a[i]);\n }\n return min;\n }",
"int lng = a.length;",
"lng",
"a.length",
"a",
"a.length",
"long min = a[0];",
"min",
"a[0]",
"a",
"0",
"for(int i=1;i<lng;i++){\n min = Math.min(min,a[i]);\n }",
"int i=1;",
"int i=1;",
"i",
"1",
"i<lng",
"i",
"lng",
"i++",
"i++",
"i",
"{\n min = Math.min(min,a[i]);\n }",
"{\n min = Math.min(min,a[i]);\n }",
"min = Math.min(min,a[i])",
"min",
"Math.min(min,a[i])",
"Math.min",
"Math",
"min",
"a[i]",
"a",
"i",
"return min;",
"min",
"long[] a",
"a",
"public class Main{\n\n static Scanner sc = new Scanner(System.in);\n static StringBuilder sb = new StringBuilder();\n\n public static void main(String[] args) {\n\n int n = nextInt();\n int m = nextInt();\n int[] a = new int[m];\n int sum = 0;\n for(int i=0;i<m;i++){\n a[i] = nextInt();\n sum += a[i];\n }\n\n if(sum>n){\n System.out.println(\"-1\");\n }\n else{\n System.out.println(n-sum);\n }\n\n //System.out.println();\n\n }\n /*\n static String toSmall(String s){\n char c = s.charAt(0);\n //if(Character.isUpperCase(c)){\n if(c<=90){\n c += 32;\n }\n return String.valueOf(c);\n }\n static String toBig(String s){\n char c = s.charAt(0);\n //if(Character.isLowerCase(c)){\n if(c>=97){\n c -= 32;\n }\n return String.valueOf(c);\n }\n */\n\n static String toSmall(String s){\n return s.toLowerCase();\n }\n\n static String toBig(String s){\n return s.toUpperCase();\n }\n\n static String next(){\n return sc.next();\n }\n\n static int nextInt(){\n return Integer.parseInt(sc.next());\n }\n\n static long nextLong(){\n return Long.parseLong(sc.next());\n }\n\n static double nextDouble(){\n return Double.parseDouble(sc.next());\n }\n\n static String[] splitString(String s){\n return s.split(\"\");\n }\n\n static char[] splitChar(String s){\n return s.toCharArray();\n }\n\n static int charToInt(char a){\n return a - 48;\n }\n\n////////////////////////////////////////////\n public static int max(int[] a){\n int lng = a.length;\n int max = a[0];\n for(int i=1;i<lng;i++){\n max = Math.max(max,a[i]);\n }\n return max;\n }\n public static long max(long[] a){\n int lng = a.length;\n long max = a[0];\n for(int i=1;i<lng;i++){\n max = Math.max(max,a[i]);\n }\n return max;\n }\n////////////////////////////////////////////\n\n////////////////////////////////////////////\n public static int min(int[] a){\n int lng = a.length;\n int min = a[0];\n for(int i=1;i<lng;i++){\n min = Math.min(min,a[i]);\n }\n return min;\n }\n public static long min(long[] a){\n int lng = a.length;\n long min = a[0];\n for(int i=1;i<lng;i++){\n min = Math.min(min,a[i]);\n }\n return min;\n }\n////////////////////////////////////////////\n\n}",
"public class Main{\n\n static Scanner sc = new Scanner(System.in);\n static StringBuilder sb = new StringBuilder();\n\n public static void main(String[] args) {\n\n int n = nextInt();\n int m = nextInt();\n int[] a = new int[m];\n int sum = 0;\n for(int i=0;i<m;i++){\n a[i] = nextInt();\n sum += a[i];\n }\n\n if(sum>n){\n System.out.println(\"-1\");\n }\n else{\n System.out.println(n-sum);\n }\n\n //System.out.println();\n\n }\n /*\n static String toSmall(String s){\n char c = s.charAt(0);\n //if(Character.isUpperCase(c)){\n if(c<=90){\n c += 32;\n }\n return String.valueOf(c);\n }\n static String toBig(String s){\n char c = s.charAt(0);\n //if(Character.isLowerCase(c)){\n if(c>=97){\n c -= 32;\n }\n return String.valueOf(c);\n }\n */\n\n static String toSmall(String s){\n return s.toLowerCase();\n }\n\n static String toBig(String s){\n return s.toUpperCase();\n }\n\n static String next(){\n return sc.next();\n }\n\n static int nextInt(){\n return Integer.parseInt(sc.next());\n }\n\n static long nextLong(){\n return Long.parseLong(sc.next());\n }\n\n static double nextDouble(){\n return Double.parseDouble(sc.next());\n }\n\n static String[] splitString(String s){\n return s.split(\"\");\n }\n\n static char[] splitChar(String s){\n return s.toCharArray();\n }\n\n static int charToInt(char a){\n return a - 48;\n }\n\n////////////////////////////////////////////\n public static int max(int[] a){\n int lng = a.length;\n int max = a[0];\n for(int i=1;i<lng;i++){\n max = Math.max(max,a[i]);\n }\n return max;\n }\n public static long max(long[] a){\n int lng = a.length;\n long max = a[0];\n for(int i=1;i<lng;i++){\n max = Math.max(max,a[i]);\n }\n return max;\n }\n////////////////////////////////////////////\n\n////////////////////////////////////////////\n public static int min(int[] a){\n int lng = a.length;\n int min = a[0];\n for(int i=1;i<lng;i++){\n min = Math.min(min,a[i]);\n }\n return min;\n }\n public static long min(long[] a){\n int lng = a.length;\n long min = a[0];\n for(int i=1;i<lng;i++){\n min = Math.min(min,a[i]);\n }\n return min;\n }\n////////////////////////////////////////////\n\n}",
"Main"
] |
import java.util.*;
//update 2020/1/1 23:01
public class Main{
static Scanner sc = new Scanner(System.in);
static StringBuilder sb = new StringBuilder();
public static void main(String[] args) {
int n = nextInt();
int m = nextInt();
int[] a = new int[m];
int sum = 0;
for(int i=0;i<m;i++){
a[i] = nextInt();
sum += a[i];
}
if(sum>n){
System.out.println("-1");
}
else{
System.out.println(n-sum);
}
//System.out.println();
}
/*
static String toSmall(String s){
char c = s.charAt(0);
//if(Character.isUpperCase(c)){
if(c<=90){
c += 32;
}
return String.valueOf(c);
}
static String toBig(String s){
char c = s.charAt(0);
//if(Character.isLowerCase(c)){
if(c>=97){
c -= 32;
}
return String.valueOf(c);
}
*/
static String toSmall(String s){
return s.toLowerCase();
}
static String toBig(String s){
return s.toUpperCase();
}
static String next(){
return sc.next();
}
static int nextInt(){
return Integer.parseInt(sc.next());
}
static long nextLong(){
return Long.parseLong(sc.next());
}
static double nextDouble(){
return Double.parseDouble(sc.next());
}
static String[] splitString(String s){
return s.split("");
}
static char[] splitChar(String s){
return s.toCharArray();
}
static int charToInt(char a){
return a - 48;
}
////////////////////////////////////////////
public static int max(int[] a){
int lng = a.length;
int max = a[0];
for(int i=1;i<lng;i++){
max = Math.max(max,a[i]);
}
return max;
}
public static long max(long[] a){
int lng = a.length;
long max = a[0];
for(int i=1;i<lng;i++){
max = Math.max(max,a[i]);
}
return max;
}
////////////////////////////////////////////
////////////////////////////////////////////
public static int min(int[] a){
int lng = a.length;
int min = a[0];
for(int i=1;i<lng;i++){
min = Math.min(min,a[i]);
}
return min;
}
public static long min(long[] a){
int lng = a.length;
long min = a[0];
for(int i=1;i<lng;i++){
min = Math.min(min,a[i]);
}
return min;
}
////////////////////////////////////////////
}
|
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
41,
13,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
4,
18,
13,
4,
18,
13,
4,
18,
18,
13,
13,
8,
2,
13,
17,
13,
40,
17,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
61,
5
],
[
61,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
8,
17
],
[
17,
18
],
[
17,
19
],
[
19,
20
],
[
20,
21
],
[
8,
22
],
[
22,
23
],
[
22,
24
],
[
8,
25
],
[
25,
26
],
[
26,
27
],
[
27,
28
],
[
27,
29
],
[
25,
30
],
[
30,
31
],
[
30,
32
],
[
25,
33
],
[
33,
34
],
[
34,
35
],
[
25,
36
],
[
37,
37
],
[
37,
38
],
[
38,
39
],
[
38,
40
],
[
40,
41
],
[
41,
42
],
[
8,
43
],
[
43,
44
],
[
44,
45
],
[
8,
46
],
[
46,
47
],
[
47,
48
],
[
48,
49
],
[
48,
50
],
[
46,
51
],
[
51,
52
],
[
52,
53
],
[
52,
54
],
[
51,
55
],
[
51,
56
],
[
56,
57
],
[
6,
58
],
[
58,
59
],
[
0,
60
],
[
60,
61
],
[
60,
62
]
] |
[
"import java.util.Scanner;\n\npublic class Main {\n\tpublic static void main(String[] args) {\n\n\t\tScanner stdIn = new Scanner(System.in);\n\n\t\tint summerVacationCnt = stdIn.nextInt();\n\t\tint homeworkCnt = stdIn.nextInt();\n\n\t\tint resultCnt = summerVacationCnt;\n\n\t\tfor (int i = 0; i < homeworkCnt; i++) {\n\t\t\tresultCnt -= stdIn.nextInt();\n\t\t}\n\n\t\tstdIn.close();\n\n\t\tSystem.out.println(resultCnt >= 0 ? resultCnt : -1);\n\t}\n\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n\tpublic static void main(String[] args) {\n\n\t\tScanner stdIn = new Scanner(System.in);\n\n\t\tint summerVacationCnt = stdIn.nextInt();\n\t\tint homeworkCnt = stdIn.nextInt();\n\n\t\tint resultCnt = summerVacationCnt;\n\n\t\tfor (int i = 0; i < homeworkCnt; i++) {\n\t\t\tresultCnt -= stdIn.nextInt();\n\t\t}\n\n\t\tstdIn.close();\n\n\t\tSystem.out.println(resultCnt >= 0 ? resultCnt : -1);\n\t}\n\n}",
"Main",
"public static void main(String[] args) {\n\n\t\tScanner stdIn = new Scanner(System.in);\n\n\t\tint summerVacationCnt = stdIn.nextInt();\n\t\tint homeworkCnt = stdIn.nextInt();\n\n\t\tint resultCnt = summerVacationCnt;\n\n\t\tfor (int i = 0; i < homeworkCnt; i++) {\n\t\t\tresultCnt -= stdIn.nextInt();\n\t\t}\n\n\t\tstdIn.close();\n\n\t\tSystem.out.println(resultCnt >= 0 ? resultCnt : -1);\n\t}",
"main",
"{\n\n\t\tScanner stdIn = new Scanner(System.in);\n\n\t\tint summerVacationCnt = stdIn.nextInt();\n\t\tint homeworkCnt = stdIn.nextInt();\n\n\t\tint resultCnt = summerVacationCnt;\n\n\t\tfor (int i = 0; i < homeworkCnt; i++) {\n\t\t\tresultCnt -= stdIn.nextInt();\n\t\t}\n\n\t\tstdIn.close();\n\n\t\tSystem.out.println(resultCnt >= 0 ? resultCnt : -1);\n\t}",
"Scanner stdIn = new Scanner(System.in);",
"stdIn",
"new Scanner(System.in)",
"int summerVacationCnt = stdIn.nextInt();",
"summerVacationCnt",
"stdIn.nextInt()",
"stdIn.nextInt",
"stdIn",
"int homeworkCnt = stdIn.nextInt();",
"homeworkCnt",
"stdIn.nextInt()",
"stdIn.nextInt",
"stdIn",
"int resultCnt = summerVacationCnt;",
"resultCnt",
"summerVacationCnt",
"for (int i = 0; i < homeworkCnt; i++) {\n\t\t\tresultCnt -= stdIn.nextInt();\n\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < homeworkCnt",
"i",
"homeworkCnt",
"i++",
"i++",
"i",
"{\n\t\t\tresultCnt -= stdIn.nextInt();\n\t\t}",
"{\n\t\t\tresultCnt -= stdIn.nextInt();\n\t\t}",
"resultCnt -= stdIn.nextInt()",
"resultCnt",
"stdIn.nextInt()",
"stdIn.nextInt",
"stdIn",
"stdIn.close()",
"stdIn.close",
"stdIn",
"System.out.println(resultCnt >= 0 ? resultCnt : -1)",
"System.out.println",
"System.out",
"System",
"System.out",
"resultCnt >= 0 ? resultCnt : -1",
"resultCnt >= 0",
"resultCnt",
"0",
"resultCnt",
"-1",
"1",
"String[] args",
"args",
"public class Main {\n\tpublic static void main(String[] args) {\n\n\t\tScanner stdIn = new Scanner(System.in);\n\n\t\tint summerVacationCnt = stdIn.nextInt();\n\t\tint homeworkCnt = stdIn.nextInt();\n\n\t\tint resultCnt = summerVacationCnt;\n\n\t\tfor (int i = 0; i < homeworkCnt; i++) {\n\t\t\tresultCnt -= stdIn.nextInt();\n\t\t}\n\n\t\tstdIn.close();\n\n\t\tSystem.out.println(resultCnt >= 0 ? resultCnt : -1);\n\t}\n\n}",
"public class Main {\n\tpublic static void main(String[] args) {\n\n\t\tScanner stdIn = new Scanner(System.in);\n\n\t\tint summerVacationCnt = stdIn.nextInt();\n\t\tint homeworkCnt = stdIn.nextInt();\n\n\t\tint resultCnt = summerVacationCnt;\n\n\t\tfor (int i = 0; i < homeworkCnt; i++) {\n\t\t\tresultCnt -= stdIn.nextInt();\n\t\t}\n\n\t\tstdIn.close();\n\n\t\tSystem.out.println(resultCnt >= 0 ? resultCnt : -1);\n\t}\n\n}",
"Main"
] |
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner stdIn = new Scanner(System.in);
int summerVacationCnt = stdIn.nextInt();
int homeworkCnt = stdIn.nextInt();
int resultCnt = summerVacationCnt;
for (int i = 0; i < homeworkCnt; i++) {
resultCnt -= stdIn.nextInt();
}
stdIn.close();
System.out.println(resultCnt >= 0 ? resultCnt : -1);
}
}
|
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
41,
13,
41,
13,
41,
13,
17,
41,
13,
20,
17,
41,
13,
17,
41,
13,
17,
12,
13,
30,
41,
13,
4,
13,
41,
13,
4,
13,
41,
13,
4,
13,
13,
41,
13,
17,
28,
13,
13,
30,
0,
13,
13,
14,
2,
13,
13,
30,
4,
18,
13,
40,
17,
30,
4,
18,
13,
2,
13,
13,
12,
13,
30,
0,
13,
8,
4,
18,
13,
18,
13,
13,
20,
0,
13,
20,
41,
13,
4,
18,
13,
4,
13,
4,
18,
13,
14,
40,
4,
18,
13,
4,
13,
2,
2,
4,
18,
13,
13,
17,
12,
13,
30,
4,
18,
20,
23,
13,
12,
13,
30,
14,
2,
13,
40,
17,
37,
20,
14,
2,
13,
13,
30,
0,
13,
17,
38,
5,
13,
30,
37,
20,
30,
0,
13,
4,
18,
13,
13,
14,
2,
13,
17,
29,
40,
17,
29,
18,
13,
40,
13,
12,
13,
30,
29,
40,
2,
2,
13,
17,
2,
13,
17,
23,
13,
12,
13,
30,
41,
13,
42,
2,
2,
0,
13,
4,
13,
40,
17,
4,
13,
13,
29,
13,
12,
13,
30,
29,
4,
18,
13,
4,
13,
12,
13,
30,
29,
4,
13,
12,
13,
30,
41,
13,
4,
13,
41,
13,
20,
42,
40,
4,
13,
13,
30,
4,
18,
13,
13,
0,
13,
4,
13,
29,
4,
18,
13,
12,
13,
30,
41,
13,
20,
13,
41,
13,
4,
13,
41,
13,
17,
42,
2,
2,
13,
13,
40,
4,
13,
13,
30,
0,
18,
13,
40,
13,
13,
0,
13,
4,
13,
29,
8,
2,
13,
13,
13,
4,
18,
13,
13,
13,
23,
13,
12,
13,
30,
41,
13,
20,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
0,
18,
13,
13,
4,
13,
13,
29,
13,
23,
13,
23,
13,
12,
13,
30,
41,
13,
20,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
0,
18,
13,
13,
4,
13,
29,
13,
23,
13,
12,
13,
30,
41,
13,
17,
41,
13,
41,
13,
17,
42,
2,
2,
0,
13,
4,
13,
40,
17,
40,
2,
2,
2,
13,
17,
2,
13,
17,
2,
13,
17,
14,
2,
13,
17,
30,
0,
13,
17,
0,
13,
4,
13,
42,
17,
30,
14,
2,
2,
13,
17,
2,
13,
17,
30,
0,
13,
2,
2,
13,
17,
2,
13,
17,
30,
29,
8,
13,
40,
13,
13,
0,
13,
4,
13,
12,
13,
30,
41,
13,
17,
41,
13,
41,
13,
17,
42,
2,
2,
0,
13,
4,
13,
40,
17,
40,
2,
2,
2,
13,
17,
2,
13,
17,
2,
13,
17,
14,
2,
13,
17,
30,
0,
13,
17,
0,
13,
4,
13,
42,
17,
30,
14,
2,
2,
13,
17,
2,
13,
17,
30,
0,
13,
2,
2,
13,
17,
2,
13,
17,
30,
29,
8,
13,
40,
13,
13,
0,
13,
4,
13,
12,
13,
30,
4,
18,
18,
13,
13,
4,
18,
13,
13,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
10,
11
],
[
10,
12
],
[
0,
13
],
[
13,
14
],
[
13,
15
],
[
0,
16
],
[
16,
17
],
[
16,
18
],
[
0,
19
],
[
19,
20
],
[
19,
21
],
[
0,
22
],
[
22,
23
],
[
22,
24
],
[
0,
25
],
[
25,
26
],
[
25,
27
],
[
0,
28
],
[
28,
29
],
[
28,
30
],
[
0,
31
],
[
31,
32
],
[
31,
33
],
[
0,
34
],
[
538,
35
],
[
538,
36
],
[
36,
37
],
[
538,
38
],
[
38,
39
],
[
538,
40
],
[
40,
41
],
[
40,
42
],
[
538,
43
],
[
43,
44
],
[
43,
45
],
[
538,
47
],
[
47,
48
],
[
47,
49
],
[
538,
50
],
[
50,
51
],
[
50,
52
],
[
538,
53
],
[
53,
54
],
[
53,
55
],
[
55,
56
],
[
56,
57
],
[
56,
58
],
[
58,
59
],
[
55,
60
],
[
60,
61
],
[
60,
62
],
[
62,
63
],
[
55,
64
],
[
64,
65
],
[
64,
66
],
[
66,
67
],
[
66,
68
],
[
55,
69
],
[
69,
70
],
[
69,
71
],
[
55,
72
],
[
72,
73
],
[
72,
74
],
[
72,
75
],
[
75,
76
],
[
76,
77
],
[
76,
78
],
[
55,
79
],
[
79,
80
],
[
80,
81
],
[
80,
82
],
[
79,
83
],
[
83,
84
],
[
84,
85
],
[
85,
86
],
[
84,
87
],
[
87,
88
],
[
79,
89
],
[
89,
90
],
[
90,
91
],
[
91,
92
],
[
90,
93
],
[
93,
94
],
[
93,
95
],
[
538,
96
],
[
96,
97
],
[
96,
98
],
[
98,
99
],
[
99,
100
],
[
99,
101
],
[
101,
102
],
[
102,
103
],
[
103,
104
],
[
101,
105
],
[
105,
106
],
[
105,
107
],
[
101,
108
],
[
98,
109
],
[
109,
110
],
[
109,
111
],
[
98,
112
],
[
112,
113
],
[
112,
114
],
[
114,
115
],
[
115,
116
],
[
98,
117
],
[
117,
118
],
[
98,
119
],
[
119,
120
],
[
120,
121
],
[
98,
122
],
[
122,
123
],
[
123,
124
],
[
124,
125
],
[
125,
126
],
[
122,
127
],
[
127,
128
],
[
127,
129
],
[
129,
130
],
[
130,
131
],
[
131,
132
],
[
132,
133
],
[
130,
134
],
[
129,
135
],
[
538,
136
],
[
136,
137
],
[
136,
138
],
[
138,
139
],
[
139,
140
],
[
140,
141
],
[
136,
142
],
[
142,
143
],
[
538,
144
],
[
144,
145
],
[
144,
146
],
[
146,
147
],
[
147,
148
],
[
148,
149
],
[
148,
150
],
[
150,
151
],
[
147,
152
],
[
152,
153
],
[
146,
154
],
[
154,
155
],
[
155,
156
],
[
155,
157
],
[
154,
158
],
[
158,
159
],
[
159,
160
],
[
159,
161
],
[
158,
162
],
[
162,
163
],
[
163,
164
],
[
163,
165
],
[
165,
166
],
[
166,
167
],
[
162,
168
],
[
168,
169
],
[
169,
170
],
[
169,
171
],
[
171,
172
],
[
172,
173
],
[
171,
174
],
[
158,
175
],
[
175,
176
],
[
176,
177
],
[
176,
178
],
[
175,
179
],
[
179,
180
],
[
180,
181
],
[
146,
182
],
[
182,
183
],
[
183,
184
],
[
183,
185
],
[
185,
186
],
[
538,
187
],
[
187,
188
],
[
187,
189
],
[
189,
190
],
[
190,
191
],
[
191,
192
],
[
192,
193
],
[
193,
194
],
[
193,
195
],
[
192,
196
],
[
196,
197
],
[
196,
198
],
[
187,
199
],
[
199,
200
],
[
538,
201
],
[
201,
202
],
[
201,
203
],
[
203,
204
],
[
204,
205
],
[
203,
206
],
[
206,
207
],
[
207,
208
],
[
208,
209
],
[
209,
210
],
[
209,
211
],
[
211,
212
],
[
208,
213
],
[
213,
214
],
[
207,
215
],
[
215,
216
],
[
215,
217
],
[
203,
218
],
[
218,
219
],
[
538,
220
],
[
220,
221
],
[
220,
222
],
[
222,
223
],
[
223,
224
],
[
224,
225
],
[
225,
226
],
[
224,
227
],
[
227,
228
],
[
538,
229
],
[
229,
230
],
[
229,
231
],
[
231,
232
],
[
232,
233
],
[
233,
234
],
[
538,
235
],
[
235,
236
],
[
235,
237
],
[
237,
238
],
[
238,
239
],
[
238,
240
],
[
240,
241
],
[
237,
242
],
[
242,
243
],
[
242,
244
],
[
237,
245
],
[
245,
246
],
[
246,
247
],
[
247,
248
],
[
247,
249
],
[
245,
250
],
[
250,
251
],
[
251,
252
],
[
252,
253
],
[
251,
254
],
[
250,
255
],
[
255,
256
],
[
255,
257
],
[
257,
258
],
[
237,
259
],
[
259,
260
],
[
260,
261
],
[
261,
262
],
[
538,
263
],
[
263,
264
],
[
263,
265
],
[
265,
266
],
[
266,
267
],
[
266,
268
],
[
265,
270
],
[
270,
271
],
[
270,
272
],
[
272,
273
],
[
265,
274
],
[
274,
275
],
[
274,
276
],
[
265,
277
],
[
277,
278
],
[
278,
279
],
[
279,
280
],
[
279,
281
],
[
278,
282
],
[
282,
283
],
[
283,
284
],
[
283,
285
],
[
277,
286
],
[
286,
287
],
[
287,
288
],
[
288,
289
],
[
288,
290
],
[
290,
291
],
[
287,
292
],
[
286,
293
],
[
293,
294
],
[
293,
295
],
[
295,
296
],
[
265,
297
],
[
297,
298
],
[
298,
299
],
[
299,
300
],
[
299,
301
],
[
298,
302
],
[
298,
303
],
[
303,
304
],
[
304,
305
],
[
303,
306
],
[
303,
307
],
[
263,
308
],
[
308,
309
],
[
538,
310
],
[
310,
311
],
[
310,
312
],
[
312,
313
],
[
313,
314
],
[
313,
315
],
[
312,
317
],
[
317,
318
],
[
318,
319
],
[
319,
320
],
[
319,
321
],
[
317,
322
],
[
322,
323
],
[
322,
324
],
[
317,
325
],
[
325,
326
],
[
326,
327
],
[
317,
328
],
[
328,
329
],
[
329,
330
],
[
330,
331
],
[
330,
332
],
[
329,
333
],
[
333,
334
],
[
333,
335
],
[
312,
336
],
[
336,
337
],
[
310,
338
],
[
338,
339
],
[
310,
340
],
[
340,
341
],
[
538,
342
],
[
342,
343
],
[
342,
344
],
[
344,
345
],
[
345,
346
],
[
345,
347
],
[
344,
349
],
[
349,
350
],
[
350,
351
],
[
351,
352
],
[
351,
353
],
[
349,
354
],
[
354,
355
],
[
354,
356
],
[
349,
357
],
[
357,
358
],
[
358,
359
],
[
349,
360
],
[
360,
361
],
[
361,
362
],
[
362,
363
],
[
362,
364
],
[
361,
365
],
[
365,
366
],
[
344,
367
],
[
367,
368
],
[
342,
369
],
[
369,
370
],
[
538,
371
],
[
371,
372
],
[
371,
373
],
[
373,
374
],
[
374,
375
],
[
374,
376
],
[
373,
377
],
[
377,
378
],
[
373,
379
],
[
379,
380
],
[
379,
381
],
[
373,
382
],
[
382,
383
],
[
383,
384
],
[
384,
385
],
[
385,
386
],
[
385,
387
],
[
387,
388
],
[
384,
389
],
[
389,
390
],
[
383,
391
],
[
391,
392
],
[
392,
393
],
[
393,
394
],
[
394,
395
],
[
394,
396
],
[
393,
397
],
[
397,
398
],
[
397,
399
],
[
392,
400
],
[
400,
401
],
[
400,
402
],
[
373,
403
],
[
403,
404
],
[
404,
405
],
[
404,
406
],
[
403,
407
],
[
407,
408
],
[
408,
409
],
[
408,
410
],
[
407,
411
],
[
411,
412
],
[
411,
413
],
[
413,
414
],
[
373,
415
],
[
415,
416
],
[
415,
417
],
[
417,
418
],
[
418,
419
],
[
419,
420
],
[
420,
421
],
[
420,
422
],
[
419,
423
],
[
423,
424
],
[
423,
425
],
[
418,
426
],
[
426,
427
],
[
427,
428
],
[
427,
429
],
[
429,
430
],
[
430,
431
],
[
430,
432
],
[
429,
433
],
[
433,
434
],
[
433,
435
],
[
418,
436
],
[
436,
437
],
[
437,
438
],
[
438,
439
],
[
438,
440
],
[
440,
441
],
[
438,
442
],
[
417,
443
],
[
443,
444
],
[
443,
445
],
[
445,
446
],
[
538,
447
],
[
447,
448
],
[
447,
449
],
[
449,
450
],
[
450,
451
],
[
450,
452
],
[
449,
453
],
[
453,
454
],
[
449,
455
],
[
455,
456
],
[
455,
457
],
[
449,
458
],
[
458,
459
],
[
459,
460
],
[
460,
461
],
[
461,
462
],
[
461,
463
],
[
463,
464
],
[
460,
465
],
[
465,
466
],
[
459,
467
],
[
467,
468
],
[
468,
469
],
[
469,
470
],
[
470,
471
],
[
470,
472
],
[
469,
473
],
[
473,
474
],
[
473,
475
],
[
468,
476
],
[
476,
477
],
[
476,
478
],
[
449,
479
],
[
479,
480
],
[
480,
481
],
[
480,
482
],
[
479,
483
],
[
483,
484
],
[
484,
485
],
[
484,
486
],
[
483,
487
],
[
487,
488
],
[
487,
489
],
[
489,
490
],
[
449,
491
],
[
491,
492
],
[
491,
493
],
[
493,
494
],
[
494,
495
],
[
495,
496
],
[
496,
497
],
[
496,
498
],
[
495,
499
],
[
499,
500
],
[
499,
501
],
[
494,
502
],
[
502,
503
],
[
503,
504
],
[
503,
505
],
[
505,
506
],
[
506,
507
],
[
506,
508
],
[
505,
509
],
[
509,
510
],
[
509,
511
],
[
494,
512
],
[
512,
513
],
[
513,
514
],
[
514,
515
],
[
514,
516
],
[
516,
517
],
[
514,
518
],
[
493,
519
],
[
519,
520
],
[
519,
521
],
[
521,
522
],
[
538,
523
],
[
523,
524
],
[
523,
525
],
[
525,
526
],
[
526,
527
],
[
527,
528
],
[
528,
529
],
[
528,
530
],
[
526,
531
],
[
531,
532
],
[
532,
533
],
[
531,
534
],
[
523,
535
],
[
535,
536
],
[
0,
537
],
[
537,
538
],
[
537,
539
]
] |
[
"import java.io.ByteArrayInputStream;\nimport java.io.IOException;\nimport java.io.InputStream;\nimport java.io.PrintWriter;\nimport java.util.ArrayList;\nimport java.util.Arrays;\nimport java.util.HashMap;\nimport java.util.InputMismatchException;\nimport java.util.List;\nimport java.util.Map;\nimport java.util.TreeSet;\n\npublic class Main {\n\tInputStream is;\n\tPrintWriter out;\n\tString INPUT = \"\";\n\n\tvoid solve() {\n\t\tint n = ni(), m = ni();\n\t\tint[] a = na(m);\n\t\tint s = 0;\n\t\tfor(int v : a) s += v;\n\t\tif(s > n) {\n\t\t\tout.println(-1);\n\t\t}\n\t\telse {\n\t\t\tout.println(n - s);\n\t\t}\n\t}\n\t\t\n\tvoid run() throws Exception {\n\t\tis = INPUT.isEmpty() ? System.in : new ByteArrayInputStream(INPUT.getBytes());\n\t\tout = new PrintWriter(System.out);\n\n\t\tlong s = System.currentTimeMillis();\n\t\tsolve();\n\t\tout.flush();\n\t\tif (!INPUT.isEmpty())\n\t\t\ttr(System.currentTimeMillis() - s + \"ms\");\n\t}\n\n\tpublic static void main(String[] args) throws Exception {\n\t\tnew Main().run();\n\t}\n\n\tprivate byte[] inbuf = new byte[1024];\n\tpublic int lenbuf = 0, ptrbuf = 0;\n\n\tprivate int readByte() {\n\t\tif (lenbuf == -1)\n\t\t\tthrow new InputMismatchException();\n\t\tif (ptrbuf >= lenbuf) {\n\t\t\tptrbuf = 0;\n\t\t\ttry {\n\t\t\t\tlenbuf = is.read(inbuf);\n\t\t\t} catch (IOException e) {\n\t\t\t\tthrow new InputMismatchException();\n\t\t\t}\n\t\t\tif (lenbuf <= 0)\n\t\t\t\treturn -1;\n\t\t}\n\t\treturn inbuf[ptrbuf++];\n\t}\n\n\tprivate boolean isSpaceChar(int c) {\n\t\treturn !(c >= 33 && c <= 126);\n\t}\n\n\tprivate int skip() {\n\t\tint b;\n\t\twhile ((b = readByte()) != -1 && isSpaceChar(b))\n\t\t\t;\n\t\treturn b;\n\t}\n\n\tprivate double nd() {\n\t\treturn Double.parseDouble(ns());\n\t}\n\n\tprivate char nc() {\n\t\treturn (char) skip();\n\t}\n\n\tprivate String ns() {\n\t\tint b = skip();\n\t\tStringBuilder sb = new StringBuilder();\n\t\twhile (!(isSpaceChar(b))) { // when nextLine, (isSpaceChar(b) && b != ' ')\n\t\t\tsb.appendCodePoint(b);\n\t\t\tb = readByte();\n\t\t}\n\t\treturn sb.toString();\n\t}\n\n\tprivate char[] ns(int n) {\n\t\tchar[] buf = new char[n];\n\t\tint b = skip(), p = 0;\n\t\twhile (p < n && !(isSpaceChar(b))) {\n\t\t\tbuf[p++] = (char) b;\n\t\t\tb = readByte();\n\t\t}\n\t\treturn n == p ? buf : Arrays.copyOf(buf, p);\n\t}\n\n\tprivate char[][] nm(int n, int m) {\n\t\tchar[][] map = new char[n][];\n\t\tfor (int i = 0; i < n; i++)\n\t\t\tmap[i] = ns(m);\n\t\treturn map;\n\t}\n\n\tprivate int[] na(int n) {\n\t\tint[] a = new int[n];\n\t\tfor (int i = 0; i < n; i++)\n\t\t\ta[i] = ni();\n\t\treturn a;\n\t}\n\n\tprivate int ni() {\n\t\tint num = 0, b;\n\t\tboolean minus = false;\n\t\twhile ((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-'))\n\t\t\t;\n\t\tif (b == '-') {\n\t\t\tminus = true;\n\t\t\tb = readByte();\n\t\t}\n\n\t\twhile (true) {\n\t\t\tif (b >= '0' && b <= '9') {\n\t\t\t\tnum = num * 10 + (b - '0');\n\t\t\t} else {\n\t\t\t\treturn minus ? -num : num;\n\t\t\t}\n\t\t\tb = readByte();\n\t\t}\n\t}\n\n\tprivate long nl() {\n\t\tlong num = 0;\n\t\tint b;\n\t\tboolean minus = false;\n\t\twhile ((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-'))\n\t\t\t;\n\t\tif (b == '-') {\n\t\t\tminus = true;\n\t\t\tb = readByte();\n\t\t}\n\n\t\twhile (true) {\n\t\t\tif (b >= '0' && b <= '9') {\n\t\t\t\tnum = num * 10 + (b - '0');\n\t\t\t} else {\n\t\t\t\treturn minus ? -num : num;\n\t\t\t}\n\t\t\tb = readByte();\n\t\t}\n\t}\n\n\tprivate static void tr(Object... o) {\n\t\tSystem.out.println(Arrays.deepToString(o));\n\t}\n}",
"import java.io.ByteArrayInputStream;",
"ByteArrayInputStream",
"java.io",
"import java.io.IOException;",
"IOException",
"java.io",
"import java.io.InputStream;",
"InputStream",
"java.io",
"import java.io.PrintWriter;",
"PrintWriter",
"java.io",
"import java.util.ArrayList;",
"ArrayList",
"java.util",
"import java.util.Arrays;",
"Arrays",
"java.util",
"import java.util.HashMap;",
"HashMap",
"java.util",
"import java.util.InputMismatchException;",
"InputMismatchException",
"java.util",
"import java.util.List;",
"List",
"java.util",
"import java.util.Map;",
"Map",
"java.util",
"import java.util.TreeSet;",
"TreeSet",
"java.util",
"public class Main {\n\tInputStream is;\n\tPrintWriter out;\n\tString INPUT = \"\";\n\n\tvoid solve() {\n\t\tint n = ni(), m = ni();\n\t\tint[] a = na(m);\n\t\tint s = 0;\n\t\tfor(int v : a) s += v;\n\t\tif(s > n) {\n\t\t\tout.println(-1);\n\t\t}\n\t\telse {\n\t\t\tout.println(n - s);\n\t\t}\n\t}\n\t\t\n\tvoid run() throws Exception {\n\t\tis = INPUT.isEmpty() ? System.in : new ByteArrayInputStream(INPUT.getBytes());\n\t\tout = new PrintWriter(System.out);\n\n\t\tlong s = System.currentTimeMillis();\n\t\tsolve();\n\t\tout.flush();\n\t\tif (!INPUT.isEmpty())\n\t\t\ttr(System.currentTimeMillis() - s + \"ms\");\n\t}\n\n\tpublic static void main(String[] args) throws Exception {\n\t\tnew Main().run();\n\t}\n\n\tprivate byte[] inbuf = new byte[1024];\n\tpublic int lenbuf = 0, ptrbuf = 0;\n\n\tprivate int readByte() {\n\t\tif (lenbuf == -1)\n\t\t\tthrow new InputMismatchException();\n\t\tif (ptrbuf >= lenbuf) {\n\t\t\tptrbuf = 0;\n\t\t\ttry {\n\t\t\t\tlenbuf = is.read(inbuf);\n\t\t\t} catch (IOException e) {\n\t\t\t\tthrow new InputMismatchException();\n\t\t\t}\n\t\t\tif (lenbuf <= 0)\n\t\t\t\treturn -1;\n\t\t}\n\t\treturn inbuf[ptrbuf++];\n\t}\n\n\tprivate boolean isSpaceChar(int c) {\n\t\treturn !(c >= 33 && c <= 126);\n\t}\n\n\tprivate int skip() {\n\t\tint b;\n\t\twhile ((b = readByte()) != -1 && isSpaceChar(b))\n\t\t\t;\n\t\treturn b;\n\t}\n\n\tprivate double nd() {\n\t\treturn Double.parseDouble(ns());\n\t}\n\n\tprivate char nc() {\n\t\treturn (char) skip();\n\t}\n\n\tprivate String ns() {\n\t\tint b = skip();\n\t\tStringBuilder sb = new StringBuilder();\n\t\twhile (!(isSpaceChar(b))) { // when nextLine, (isSpaceChar(b) && b != ' ')\n\t\t\tsb.appendCodePoint(b);\n\t\t\tb = readByte();\n\t\t}\n\t\treturn sb.toString();\n\t}\n\n\tprivate char[] ns(int n) {\n\t\tchar[] buf = new char[n];\n\t\tint b = skip(), p = 0;\n\t\twhile (p < n && !(isSpaceChar(b))) {\n\t\t\tbuf[p++] = (char) b;\n\t\t\tb = readByte();\n\t\t}\n\t\treturn n == p ? buf : Arrays.copyOf(buf, p);\n\t}\n\n\tprivate char[][] nm(int n, int m) {\n\t\tchar[][] map = new char[n][];\n\t\tfor (int i = 0; i < n; i++)\n\t\t\tmap[i] = ns(m);\n\t\treturn map;\n\t}\n\n\tprivate int[] na(int n) {\n\t\tint[] a = new int[n];\n\t\tfor (int i = 0; i < n; i++)\n\t\t\ta[i] = ni();\n\t\treturn a;\n\t}\n\n\tprivate int ni() {\n\t\tint num = 0, b;\n\t\tboolean minus = false;\n\t\twhile ((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-'))\n\t\t\t;\n\t\tif (b == '-') {\n\t\t\tminus = true;\n\t\t\tb = readByte();\n\t\t}\n\n\t\twhile (true) {\n\t\t\tif (b >= '0' && b <= '9') {\n\t\t\t\tnum = num * 10 + (b - '0');\n\t\t\t} else {\n\t\t\t\treturn minus ? -num : num;\n\t\t\t}\n\t\t\tb = readByte();\n\t\t}\n\t}\n\n\tprivate long nl() {\n\t\tlong num = 0;\n\t\tint b;\n\t\tboolean minus = false;\n\t\twhile ((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-'))\n\t\t\t;\n\t\tif (b == '-') {\n\t\t\tminus = true;\n\t\t\tb = readByte();\n\t\t}\n\n\t\twhile (true) {\n\t\t\tif (b >= '0' && b <= '9') {\n\t\t\t\tnum = num * 10 + (b - '0');\n\t\t\t} else {\n\t\t\t\treturn minus ? -num : num;\n\t\t\t}\n\t\t\tb = readByte();\n\t\t}\n\t}\n\n\tprivate static void tr(Object... o) {\n\t\tSystem.out.println(Arrays.deepToString(o));\n\t}\n}",
"Main",
"InputStream is;",
"is",
"PrintWriter out;",
"out",
"String INPUT = \"\";",
"INPUT",
"\"\"",
"private byte[] inbuf = new byte[1024];",
"inbuf",
"new byte[1024]",
"1024",
"public int lenbuf = 0",
"lenbuf",
"0",
"ptrbuf = 0;",
"ptrbuf",
"0",
"void solve() {\n\t\tint n = ni(), m = ni();\n\t\tint[] a = na(m);\n\t\tint s = 0;\n\t\tfor(int v : a) s += v;\n\t\tif(s > n) {\n\t\t\tout.println(-1);\n\t\t}\n\t\telse {\n\t\t\tout.println(n - s);\n\t\t}\n\t}",
"solve",
"{\n\t\tint n = ni(), m = ni();\n\t\tint[] a = na(m);\n\t\tint s = 0;\n\t\tfor(int v : a) s += v;\n\t\tif(s > n) {\n\t\t\tout.println(-1);\n\t\t}\n\t\telse {\n\t\t\tout.println(n - s);\n\t\t}\n\t}",
"int n = ni()",
"n",
"ni()",
"ni",
"m = ni();",
"m",
"ni()",
"ni",
"int[] a = na(m);",
"a",
"na(m)",
"na",
"m",
"int s = 0;",
"s",
"0",
"for(int v : a) s += v;",
"int v",
"a",
"s += v;",
"s += v",
"s",
"v",
"if(s > n) {\n\t\t\tout.println(-1);\n\t\t}\n\t\telse {\n\t\t\tout.println(n - s);\n\t\t}",
"s > n",
"s",
"n",
"{\n\t\t\tout.println(-1);\n\t\t}",
"out.println(-1)",
"out.println",
"out",
"-1",
"1",
"{\n\t\t\tout.println(n - s);\n\t\t}",
"out.println(n - s)",
"out.println",
"out",
"n - s",
"n",
"s",
"void run() throws Exception {\n\t\tis = INPUT.isEmpty() ? System.in : new ByteArrayInputStream(INPUT.getBytes());\n\t\tout = new PrintWriter(System.out);\n\n\t\tlong s = System.currentTimeMillis();\n\t\tsolve();\n\t\tout.flush();\n\t\tif (!INPUT.isEmpty())\n\t\t\ttr(System.currentTimeMillis() - s + \"ms\");\n\t}",
"run",
"{\n\t\tis = INPUT.isEmpty() ? System.in : new ByteArrayInputStream(INPUT.getBytes());\n\t\tout = new PrintWriter(System.out);\n\n\t\tlong s = System.currentTimeMillis();\n\t\tsolve();\n\t\tout.flush();\n\t\tif (!INPUT.isEmpty())\n\t\t\ttr(System.currentTimeMillis() - s + \"ms\");\n\t}",
"is = INPUT.isEmpty() ? System.in : new ByteArrayInputStream(INPUT.getBytes())",
"is",
"INPUT.isEmpty() ? System.in : new ByteArrayInputStream(INPUT.getBytes())",
"INPUT.isEmpty()",
"INPUT.isEmpty",
"INPUT",
"System.in",
"System",
"System.in",
"new ByteArrayInputStream(INPUT.getBytes())",
"out = new PrintWriter(System.out)",
"out",
"new PrintWriter(System.out)",
"long s = System.currentTimeMillis();",
"s",
"System.currentTimeMillis()",
"System.currentTimeMillis",
"System",
"solve()",
"solve",
"out.flush()",
"out.flush",
"out",
"if (!INPUT.isEmpty())\n\t\t\ttr(System.currentTimeMillis() - s + \"ms\");",
"!INPUT.isEmpty()",
"INPUT.isEmpty()",
"INPUT.isEmpty",
"INPUT",
"tr(System.currentTimeMillis() - s + \"ms\")",
"tr",
"System.currentTimeMillis() - s + \"ms\"",
"System.currentTimeMillis() - s",
"System.currentTimeMillis()",
"System.currentTimeMillis",
"System",
"s",
"\"ms\"",
"public static void main(String[] args) throws Exception {\n\t\tnew Main().run();\n\t}",
"main",
"{\n\t\tnew Main().run();\n\t}",
"new Main().run()",
"new Main().run",
"new Main()",
"String[] args",
"args",
"private int readByte() {\n\t\tif (lenbuf == -1)\n\t\t\tthrow new InputMismatchException();\n\t\tif (ptrbuf >= lenbuf) {\n\t\t\tptrbuf = 0;\n\t\t\ttry {\n\t\t\t\tlenbuf = is.read(inbuf);\n\t\t\t} catch (IOException e) {\n\t\t\t\tthrow new InputMismatchException();\n\t\t\t}\n\t\t\tif (lenbuf <= 0)\n\t\t\t\treturn -1;\n\t\t}\n\t\treturn inbuf[ptrbuf++];\n\t}",
"readByte",
"{\n\t\tif (lenbuf == -1)\n\t\t\tthrow new InputMismatchException();\n\t\tif (ptrbuf >= lenbuf) {\n\t\t\tptrbuf = 0;\n\t\t\ttry {\n\t\t\t\tlenbuf = is.read(inbuf);\n\t\t\t} catch (IOException e) {\n\t\t\t\tthrow new InputMismatchException();\n\t\t\t}\n\t\t\tif (lenbuf <= 0)\n\t\t\t\treturn -1;\n\t\t}\n\t\treturn inbuf[ptrbuf++];\n\t}",
"if (lenbuf == -1)\n\t\t\tthrow new InputMismatchException();",
"lenbuf == -1",
"lenbuf",
"-1",
"1",
"throw new InputMismatchException();",
"new InputMismatchException()",
"if (ptrbuf >= lenbuf) {\n\t\t\tptrbuf = 0;\n\t\t\ttry {\n\t\t\t\tlenbuf = is.read(inbuf);\n\t\t\t} catch (IOException e) {\n\t\t\t\tthrow new InputMismatchException();\n\t\t\t}\n\t\t\tif (lenbuf <= 0)\n\t\t\t\treturn -1;\n\t\t}",
"ptrbuf >= lenbuf",
"ptrbuf",
"lenbuf",
"{\n\t\t\tptrbuf = 0;\n\t\t\ttry {\n\t\t\t\tlenbuf = is.read(inbuf);\n\t\t\t} catch (IOException e) {\n\t\t\t\tthrow new InputMismatchException();\n\t\t\t}\n\t\t\tif (lenbuf <= 0)\n\t\t\t\treturn -1;\n\t\t}",
"ptrbuf = 0",
"ptrbuf",
"0",
"try {\n\t\t\t\tlenbuf = is.read(inbuf);\n\t\t\t} catch (IOException e) {\n\t\t\t\tthrow new InputMismatchException();\n\t\t\t}",
"catch (IOException e) {\n\t\t\t\tthrow new InputMismatchException();\n\t\t\t}",
"IOException e",
"{\n\t\t\t\tthrow new InputMismatchException();\n\t\t\t}",
"throw new InputMismatchException();",
"new InputMismatchException()",
"{\n\t\t\t\tlenbuf = is.read(inbuf);\n\t\t\t}",
"lenbuf = is.read(inbuf)",
"lenbuf",
"is.read(inbuf)",
"is.read",
"is",
"inbuf",
"if (lenbuf <= 0)\n\t\t\t\treturn -1;",
"lenbuf <= 0",
"lenbuf",
"0",
"return -1;",
"-1",
"1",
"return inbuf[ptrbuf++];",
"inbuf[ptrbuf++]",
"inbuf",
"ptrbuf++",
"ptrbuf",
"private boolean isSpaceChar(int c) {\n\t\treturn !(c >= 33 && c <= 126);\n\t}",
"isSpaceChar",
"{\n\t\treturn !(c >= 33 && c <= 126);\n\t}",
"return !(c >= 33 && c <= 126);",
"!(c >= 33 && c <= 126)",
"(c >= 33 && c <= 126)",
"c >= 33",
"c",
"33",
"c <= 126",
"c",
"126",
"int c",
"c",
"private int skip() {\n\t\tint b;\n\t\twhile ((b = readByte()) != -1 && isSpaceChar(b))\n\t\t\t;\n\t\treturn b;\n\t}",
"skip",
"{\n\t\tint b;\n\t\twhile ((b = readByte()) != -1 && isSpaceChar(b))\n\t\t\t;\n\t\treturn b;\n\t}",
"int b;",
"b",
"while ((b = readByte()) != -1 && isSpaceChar(b))\n\t\t\t;",
"(b = readByte()) != -1 && isSpaceChar(b)",
"(b = readByte()) != -1",
"(b = readByte())",
"b",
"readByte()",
"readByte",
"-1",
"1",
"isSpaceChar(b)",
"isSpaceChar",
"b",
"return b;",
"b",
"private double nd() {\n\t\treturn Double.parseDouble(ns());\n\t}",
"nd",
"{\n\t\treturn Double.parseDouble(ns());\n\t}",
"return Double.parseDouble(ns());",
"Double.parseDouble(ns())",
"Double.parseDouble",
"Double",
"ns()",
"ns",
"private char nc() {\n\t\treturn (char) skip();\n\t}",
"nc",
"{\n\t\treturn (char) skip();\n\t}",
"return (char) skip();",
"(char) skip()",
"skip",
"private String ns() {\n\t\tint b = skip();\n\t\tStringBuilder sb = new StringBuilder();\n\t\twhile (!(isSpaceChar(b))) { // when nextLine, (isSpaceChar(b) && b != ' ')\n\t\t\tsb.appendCodePoint(b);\n\t\t\tb = readByte();\n\t\t}\n\t\treturn sb.toString();\n\t}",
"ns",
"{\n\t\tint b = skip();\n\t\tStringBuilder sb = new StringBuilder();\n\t\twhile (!(isSpaceChar(b))) { // when nextLine, (isSpaceChar(b) && b != ' ')\n\t\t\tsb.appendCodePoint(b);\n\t\t\tb = readByte();\n\t\t}\n\t\treturn sb.toString();\n\t}",
"int b = skip();",
"b",
"skip()",
"skip",
"StringBuilder sb = new StringBuilder();",
"sb",
"new StringBuilder()",
"while (!(isSpaceChar(b))) { // when nextLine, (isSpaceChar(b) && b != ' ')\n\t\t\tsb.appendCodePoint(b);\n\t\t\tb = readByte();\n\t\t}",
"!(isSpaceChar(b))",
"(isSpaceChar(b))",
"isSpaceChar",
"b",
"{ // when nextLine, (isSpaceChar(b) && b != ' ')\n\t\t\tsb.appendCodePoint(b);\n\t\t\tb = readByte();\n\t\t}",
"sb.appendCodePoint(b)",
"sb.appendCodePoint",
"sb",
"b",
"b = readByte()",
"b",
"readByte()",
"readByte",
"return sb.toString();",
"sb.toString()",
"sb.toString",
"sb",
"private char[] ns(int n) {\n\t\tchar[] buf = new char[n];\n\t\tint b = skip(), p = 0;\n\t\twhile (p < n && !(isSpaceChar(b))) {\n\t\t\tbuf[p++] = (char) b;\n\t\t\tb = readByte();\n\t\t}\n\t\treturn n == p ? buf : Arrays.copyOf(buf, p);\n\t}",
"ns",
"{\n\t\tchar[] buf = new char[n];\n\t\tint b = skip(), p = 0;\n\t\twhile (p < n && !(isSpaceChar(b))) {\n\t\t\tbuf[p++] = (char) b;\n\t\t\tb = readByte();\n\t\t}\n\t\treturn n == p ? buf : Arrays.copyOf(buf, p);\n\t}",
"char[] buf = new char[n];",
"buf",
"new char[n]",
"n",
"int b = skip()",
"b",
"skip()",
"skip",
"p = 0;",
"p",
"0",
"while (p < n && !(isSpaceChar(b))) {\n\t\t\tbuf[p++] = (char) b;\n\t\t\tb = readByte();\n\t\t}",
"p < n && !(isSpaceChar(b))",
"p < n",
"p",
"n",
"!(isSpaceChar(b))",
"(isSpaceChar(b))",
"isSpaceChar",
"b",
"{\n\t\t\tbuf[p++] = (char) b;\n\t\t\tb = readByte();\n\t\t}",
"buf[p++] = (char) b",
"buf[p++]",
"buf",
"p++",
"p",
"(char) b",
"b = readByte()",
"b",
"readByte()",
"readByte",
"return n == p ? buf : Arrays.copyOf(buf, p);",
"n == p ? buf : Arrays.copyOf(buf, p)",
"n == p",
"n",
"p",
"buf",
"Arrays.copyOf(buf, p)",
"Arrays.copyOf",
"Arrays",
"buf",
"p",
"int n",
"n",
"private char[][] nm(int n, int m) {\n\t\tchar[][] map = new char[n][];\n\t\tfor (int i = 0; i < n; i++)\n\t\t\tmap[i] = ns(m);\n\t\treturn map;\n\t}",
"nm",
"{\n\t\tchar[][] map = new char[n][];\n\t\tfor (int i = 0; i < n; i++)\n\t\t\tmap[i] = ns(m);\n\t\treturn map;\n\t}",
"char[][] map = new char[n][];",
"map",
"new char[n][]",
"n",
"for (int i = 0; i < n; i++)\n\t\t\tmap[i] = ns(m);",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < n",
"i",
"n",
"i++",
"i++",
"i",
"map[i] = ns(m);",
"map[i] = ns(m)",
"map[i]",
"map",
"i",
"ns(m)",
"ns",
"m",
"return map;",
"map",
"int n",
"n",
"int m",
"m",
"private int[] na(int n) {\n\t\tint[] a = new int[n];\n\t\tfor (int i = 0; i < n; i++)\n\t\t\ta[i] = ni();\n\t\treturn a;\n\t}",
"na",
"{\n\t\tint[] a = new int[n];\n\t\tfor (int i = 0; i < n; i++)\n\t\t\ta[i] = ni();\n\t\treturn a;\n\t}",
"int[] a = new int[n];",
"a",
"new int[n]",
"n",
"for (int i = 0; i < n; i++)\n\t\t\ta[i] = ni();",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < n",
"i",
"n",
"i++",
"i++",
"i",
"a[i] = ni();",
"a[i] = ni()",
"a[i]",
"a",
"i",
"ni()",
"ni",
"return a;",
"a",
"int n",
"n",
"private int ni() {\n\t\tint num = 0, b;\n\t\tboolean minus = false;\n\t\twhile ((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-'))\n\t\t\t;\n\t\tif (b == '-') {\n\t\t\tminus = true;\n\t\t\tb = readByte();\n\t\t}\n\n\t\twhile (true) {\n\t\t\tif (b >= '0' && b <= '9') {\n\t\t\t\tnum = num * 10 + (b - '0');\n\t\t\t} else {\n\t\t\t\treturn minus ? -num : num;\n\t\t\t}\n\t\t\tb = readByte();\n\t\t}\n\t}",
"ni",
"{\n\t\tint num = 0, b;\n\t\tboolean minus = false;\n\t\twhile ((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-'))\n\t\t\t;\n\t\tif (b == '-') {\n\t\t\tminus = true;\n\t\t\tb = readByte();\n\t\t}\n\n\t\twhile (true) {\n\t\t\tif (b >= '0' && b <= '9') {\n\t\t\t\tnum = num * 10 + (b - '0');\n\t\t\t} else {\n\t\t\t\treturn minus ? -num : num;\n\t\t\t}\n\t\t\tb = readByte();\n\t\t}\n\t}",
"int num = 0",
"num",
"0",
"b;",
"b",
"boolean minus = false;",
"minus",
"false",
"while ((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-'))\n\t\t\t;",
"(b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-')",
"(b = readByte()) != -1",
"(b = readByte())",
"b",
"readByte()",
"readByte",
"-1",
"1",
"!((b >= '0' && b <= '9') || b == '-')",
"((b >= '0' && b <= '9') || b == '-')",
"(b >= '0' && b <= '9')",
"b >= '0'",
"b",
"'0'",
"b <= '9'",
"b",
"'9'",
"b == '-'",
"b",
"'-'",
"if (b == '-') {\n\t\t\tminus = true;\n\t\t\tb = readByte();\n\t\t}",
"b == '-'",
"b",
"'-'",
"{\n\t\t\tminus = true;\n\t\t\tb = readByte();\n\t\t}",
"minus = true",
"minus",
"true",
"b = readByte()",
"b",
"readByte()",
"readByte",
"while (true) {\n\t\t\tif (b >= '0' && b <= '9') {\n\t\t\t\tnum = num * 10 + (b - '0');\n\t\t\t} else {\n\t\t\t\treturn minus ? -num : num;\n\t\t\t}\n\t\t\tb = readByte();\n\t\t}",
"true",
"{\n\t\t\tif (b >= '0' && b <= '9') {\n\t\t\t\tnum = num * 10 + (b - '0');\n\t\t\t} else {\n\t\t\t\treturn minus ? -num : num;\n\t\t\t}\n\t\t\tb = readByte();\n\t\t}",
"if (b >= '0' && b <= '9') {\n\t\t\t\tnum = num * 10 + (b - '0');\n\t\t\t} else {\n\t\t\t\treturn minus ? -num : num;\n\t\t\t}",
"b >= '0' && b <= '9'",
"b >= '0'",
"b",
"'0'",
"b <= '9'",
"b",
"'9'",
"{\n\t\t\t\tnum = num * 10 + (b - '0');\n\t\t\t}",
"num = num * 10 + (b - '0')",
"num",
"num * 10 + (b - '0')",
"num * 10",
"num",
"10",
"(b - '0')",
"b",
"'0'",
"{\n\t\t\t\treturn minus ? -num : num;\n\t\t\t}",
"return minus ? -num : num;",
"minus ? -num : num",
"minus",
"-num",
"num",
"num",
"b = readByte()",
"b",
"readByte()",
"readByte",
"private long nl() {\n\t\tlong num = 0;\n\t\tint b;\n\t\tboolean minus = false;\n\t\twhile ((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-'))\n\t\t\t;\n\t\tif (b == '-') {\n\t\t\tminus = true;\n\t\t\tb = readByte();\n\t\t}\n\n\t\twhile (true) {\n\t\t\tif (b >= '0' && b <= '9') {\n\t\t\t\tnum = num * 10 + (b - '0');\n\t\t\t} else {\n\t\t\t\treturn minus ? -num : num;\n\t\t\t}\n\t\t\tb = readByte();\n\t\t}\n\t}",
"nl",
"{\n\t\tlong num = 0;\n\t\tint b;\n\t\tboolean minus = false;\n\t\twhile ((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-'))\n\t\t\t;\n\t\tif (b == '-') {\n\t\t\tminus = true;\n\t\t\tb = readByte();\n\t\t}\n\n\t\twhile (true) {\n\t\t\tif (b >= '0' && b <= '9') {\n\t\t\t\tnum = num * 10 + (b - '0');\n\t\t\t} else {\n\t\t\t\treturn minus ? -num : num;\n\t\t\t}\n\t\t\tb = readByte();\n\t\t}\n\t}",
"long num = 0;",
"num",
"0",
"int b;",
"b",
"boolean minus = false;",
"minus",
"false",
"while ((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-'))\n\t\t\t;",
"(b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-')",
"(b = readByte()) != -1",
"(b = readByte())",
"b",
"readByte()",
"readByte",
"-1",
"1",
"!((b >= '0' && b <= '9') || b == '-')",
"((b >= '0' && b <= '9') || b == '-')",
"(b >= '0' && b <= '9')",
"b >= '0'",
"b",
"'0'",
"b <= '9'",
"b",
"'9'",
"b == '-'",
"b",
"'-'",
"if (b == '-') {\n\t\t\tminus = true;\n\t\t\tb = readByte();\n\t\t}",
"b == '-'",
"b",
"'-'",
"{\n\t\t\tminus = true;\n\t\t\tb = readByte();\n\t\t}",
"minus = true",
"minus",
"true",
"b = readByte()",
"b",
"readByte()",
"readByte",
"while (true) {\n\t\t\tif (b >= '0' && b <= '9') {\n\t\t\t\tnum = num * 10 + (b - '0');\n\t\t\t} else {\n\t\t\t\treturn minus ? -num : num;\n\t\t\t}\n\t\t\tb = readByte();\n\t\t}",
"true",
"{\n\t\t\tif (b >= '0' && b <= '9') {\n\t\t\t\tnum = num * 10 + (b - '0');\n\t\t\t} else {\n\t\t\t\treturn minus ? -num : num;\n\t\t\t}\n\t\t\tb = readByte();\n\t\t}",
"if (b >= '0' && b <= '9') {\n\t\t\t\tnum = num * 10 + (b - '0');\n\t\t\t} else {\n\t\t\t\treturn minus ? -num : num;\n\t\t\t}",
"b >= '0' && b <= '9'",
"b >= '0'",
"b",
"'0'",
"b <= '9'",
"b",
"'9'",
"{\n\t\t\t\tnum = num * 10 + (b - '0');\n\t\t\t}",
"num = num * 10 + (b - '0')",
"num",
"num * 10 + (b - '0')",
"num * 10",
"num",
"10",
"(b - '0')",
"b",
"'0'",
"{\n\t\t\t\treturn minus ? -num : num;\n\t\t\t}",
"return minus ? -num : num;",
"minus ? -num : num",
"minus",
"-num",
"num",
"num",
"b = readByte()",
"b",
"readByte()",
"readByte",
"private static void tr(Object... o) {\n\t\tSystem.out.println(Arrays.deepToString(o));\n\t}",
"tr",
"{\n\t\tSystem.out.println(Arrays.deepToString(o));\n\t}",
"System.out.println(Arrays.deepToString(o))",
"System.out.println",
"System.out",
"System",
"System.out",
"Arrays.deepToString(o)",
"Arrays.deepToString",
"Arrays",
"o",
"Object... o",
"o",
"public class Main {\n\tInputStream is;\n\tPrintWriter out;\n\tString INPUT = \"\";\n\n\tvoid solve() {\n\t\tint n = ni(), m = ni();\n\t\tint[] a = na(m);\n\t\tint s = 0;\n\t\tfor(int v : a) s += v;\n\t\tif(s > n) {\n\t\t\tout.println(-1);\n\t\t}\n\t\telse {\n\t\t\tout.println(n - s);\n\t\t}\n\t}\n\t\t\n\tvoid run() throws Exception {\n\t\tis = INPUT.isEmpty() ? System.in : new ByteArrayInputStream(INPUT.getBytes());\n\t\tout = new PrintWriter(System.out);\n\n\t\tlong s = System.currentTimeMillis();\n\t\tsolve();\n\t\tout.flush();\n\t\tif (!INPUT.isEmpty())\n\t\t\ttr(System.currentTimeMillis() - s + \"ms\");\n\t}\n\n\tpublic static void main(String[] args) throws Exception {\n\t\tnew Main().run();\n\t}\n\n\tprivate byte[] inbuf = new byte[1024];\n\tpublic int lenbuf = 0, ptrbuf = 0;\n\n\tprivate int readByte() {\n\t\tif (lenbuf == -1)\n\t\t\tthrow new InputMismatchException();\n\t\tif (ptrbuf >= lenbuf) {\n\t\t\tptrbuf = 0;\n\t\t\ttry {\n\t\t\t\tlenbuf = is.read(inbuf);\n\t\t\t} catch (IOException e) {\n\t\t\t\tthrow new InputMismatchException();\n\t\t\t}\n\t\t\tif (lenbuf <= 0)\n\t\t\t\treturn -1;\n\t\t}\n\t\treturn inbuf[ptrbuf++];\n\t}\n\n\tprivate boolean isSpaceChar(int c) {\n\t\treturn !(c >= 33 && c <= 126);\n\t}\n\n\tprivate int skip() {\n\t\tint b;\n\t\twhile ((b = readByte()) != -1 && isSpaceChar(b))\n\t\t\t;\n\t\treturn b;\n\t}\n\n\tprivate double nd() {\n\t\treturn Double.parseDouble(ns());\n\t}\n\n\tprivate char nc() {\n\t\treturn (char) skip();\n\t}\n\n\tprivate String ns() {\n\t\tint b = skip();\n\t\tStringBuilder sb = new StringBuilder();\n\t\twhile (!(isSpaceChar(b))) { // when nextLine, (isSpaceChar(b) && b != ' ')\n\t\t\tsb.appendCodePoint(b);\n\t\t\tb = readByte();\n\t\t}\n\t\treturn sb.toString();\n\t}\n\n\tprivate char[] ns(int n) {\n\t\tchar[] buf = new char[n];\n\t\tint b = skip(), p = 0;\n\t\twhile (p < n && !(isSpaceChar(b))) {\n\t\t\tbuf[p++] = (char) b;\n\t\t\tb = readByte();\n\t\t}\n\t\treturn n == p ? buf : Arrays.copyOf(buf, p);\n\t}\n\n\tprivate char[][] nm(int n, int m) {\n\t\tchar[][] map = new char[n][];\n\t\tfor (int i = 0; i < n; i++)\n\t\t\tmap[i] = ns(m);\n\t\treturn map;\n\t}\n\n\tprivate int[] na(int n) {\n\t\tint[] a = new int[n];\n\t\tfor (int i = 0; i < n; i++)\n\t\t\ta[i] = ni();\n\t\treturn a;\n\t}\n\n\tprivate int ni() {\n\t\tint num = 0, b;\n\t\tboolean minus = false;\n\t\twhile ((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-'))\n\t\t\t;\n\t\tif (b == '-') {\n\t\t\tminus = true;\n\t\t\tb = readByte();\n\t\t}\n\n\t\twhile (true) {\n\t\t\tif (b >= '0' && b <= '9') {\n\t\t\t\tnum = num * 10 + (b - '0');\n\t\t\t} else {\n\t\t\t\treturn minus ? -num : num;\n\t\t\t}\n\t\t\tb = readByte();\n\t\t}\n\t}\n\n\tprivate long nl() {\n\t\tlong num = 0;\n\t\tint b;\n\t\tboolean minus = false;\n\t\twhile ((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-'))\n\t\t\t;\n\t\tif (b == '-') {\n\t\t\tminus = true;\n\t\t\tb = readByte();\n\t\t}\n\n\t\twhile (true) {\n\t\t\tif (b >= '0' && b <= '9') {\n\t\t\t\tnum = num * 10 + (b - '0');\n\t\t\t} else {\n\t\t\t\treturn minus ? -num : num;\n\t\t\t}\n\t\t\tb = readByte();\n\t\t}\n\t}\n\n\tprivate static void tr(Object... o) {\n\t\tSystem.out.println(Arrays.deepToString(o));\n\t}\n}",
"public class Main {\n\tInputStream is;\n\tPrintWriter out;\n\tString INPUT = \"\";\n\n\tvoid solve() {\n\t\tint n = ni(), m = ni();\n\t\tint[] a = na(m);\n\t\tint s = 0;\n\t\tfor(int v : a) s += v;\n\t\tif(s > n) {\n\t\t\tout.println(-1);\n\t\t}\n\t\telse {\n\t\t\tout.println(n - s);\n\t\t}\n\t}\n\t\t\n\tvoid run() throws Exception {\n\t\tis = INPUT.isEmpty() ? System.in : new ByteArrayInputStream(INPUT.getBytes());\n\t\tout = new PrintWriter(System.out);\n\n\t\tlong s = System.currentTimeMillis();\n\t\tsolve();\n\t\tout.flush();\n\t\tif (!INPUT.isEmpty())\n\t\t\ttr(System.currentTimeMillis() - s + \"ms\");\n\t}\n\n\tpublic static void main(String[] args) throws Exception {\n\t\tnew Main().run();\n\t}\n\n\tprivate byte[] inbuf = new byte[1024];\n\tpublic int lenbuf = 0, ptrbuf = 0;\n\n\tprivate int readByte() {\n\t\tif (lenbuf == -1)\n\t\t\tthrow new InputMismatchException();\n\t\tif (ptrbuf >= lenbuf) {\n\t\t\tptrbuf = 0;\n\t\t\ttry {\n\t\t\t\tlenbuf = is.read(inbuf);\n\t\t\t} catch (IOException e) {\n\t\t\t\tthrow new InputMismatchException();\n\t\t\t}\n\t\t\tif (lenbuf <= 0)\n\t\t\t\treturn -1;\n\t\t}\n\t\treturn inbuf[ptrbuf++];\n\t}\n\n\tprivate boolean isSpaceChar(int c) {\n\t\treturn !(c >= 33 && c <= 126);\n\t}\n\n\tprivate int skip() {\n\t\tint b;\n\t\twhile ((b = readByte()) != -1 && isSpaceChar(b))\n\t\t\t;\n\t\treturn b;\n\t}\n\n\tprivate double nd() {\n\t\treturn Double.parseDouble(ns());\n\t}\n\n\tprivate char nc() {\n\t\treturn (char) skip();\n\t}\n\n\tprivate String ns() {\n\t\tint b = skip();\n\t\tStringBuilder sb = new StringBuilder();\n\t\twhile (!(isSpaceChar(b))) { // when nextLine, (isSpaceChar(b) && b != ' ')\n\t\t\tsb.appendCodePoint(b);\n\t\t\tb = readByte();\n\t\t}\n\t\treturn sb.toString();\n\t}\n\n\tprivate char[] ns(int n) {\n\t\tchar[] buf = new char[n];\n\t\tint b = skip(), p = 0;\n\t\twhile (p < n && !(isSpaceChar(b))) {\n\t\t\tbuf[p++] = (char) b;\n\t\t\tb = readByte();\n\t\t}\n\t\treturn n == p ? buf : Arrays.copyOf(buf, p);\n\t}\n\n\tprivate char[][] nm(int n, int m) {\n\t\tchar[][] map = new char[n][];\n\t\tfor (int i = 0; i < n; i++)\n\t\t\tmap[i] = ns(m);\n\t\treturn map;\n\t}\n\n\tprivate int[] na(int n) {\n\t\tint[] a = new int[n];\n\t\tfor (int i = 0; i < n; i++)\n\t\t\ta[i] = ni();\n\t\treturn a;\n\t}\n\n\tprivate int ni() {\n\t\tint num = 0, b;\n\t\tboolean minus = false;\n\t\twhile ((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-'))\n\t\t\t;\n\t\tif (b == '-') {\n\t\t\tminus = true;\n\t\t\tb = readByte();\n\t\t}\n\n\t\twhile (true) {\n\t\t\tif (b >= '0' && b <= '9') {\n\t\t\t\tnum = num * 10 + (b - '0');\n\t\t\t} else {\n\t\t\t\treturn minus ? -num : num;\n\t\t\t}\n\t\t\tb = readByte();\n\t\t}\n\t}\n\n\tprivate long nl() {\n\t\tlong num = 0;\n\t\tint b;\n\t\tboolean minus = false;\n\t\twhile ((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-'))\n\t\t\t;\n\t\tif (b == '-') {\n\t\t\tminus = true;\n\t\t\tb = readByte();\n\t\t}\n\n\t\twhile (true) {\n\t\t\tif (b >= '0' && b <= '9') {\n\t\t\t\tnum = num * 10 + (b - '0');\n\t\t\t} else {\n\t\t\t\treturn minus ? -num : num;\n\t\t\t}\n\t\t\tb = readByte();\n\t\t}\n\t}\n\n\tprivate static void tr(Object... o) {\n\t\tSystem.out.println(Arrays.deepToString(o));\n\t}\n}",
"Main"
] |
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.InputMismatchException;
import java.util.List;
import java.util.Map;
import java.util.TreeSet;
public class Main {
InputStream is;
PrintWriter out;
String INPUT = "";
void solve() {
int n = ni(), m = ni();
int[] a = na(m);
int s = 0;
for(int v : a) s += v;
if(s > n) {
out.println(-1);
}
else {
out.println(n - s);
}
}
void run() throws Exception {
is = INPUT.isEmpty() ? System.in : new ByteArrayInputStream(INPUT.getBytes());
out = new PrintWriter(System.out);
long s = System.currentTimeMillis();
solve();
out.flush();
if (!INPUT.isEmpty())
tr(System.currentTimeMillis() - s + "ms");
}
public static void main(String[] args) throws Exception {
new Main().run();
}
private byte[] inbuf = new byte[1024];
public int lenbuf = 0, ptrbuf = 0;
private int readByte() {
if (lenbuf == -1)
throw new InputMismatchException();
if (ptrbuf >= lenbuf) {
ptrbuf = 0;
try {
lenbuf = is.read(inbuf);
} catch (IOException e) {
throw new InputMismatchException();
}
if (lenbuf <= 0)
return -1;
}
return inbuf[ptrbuf++];
}
private boolean isSpaceChar(int c) {
return !(c >= 33 && c <= 126);
}
private int skip() {
int b;
while ((b = readByte()) != -1 && isSpaceChar(b))
;
return b;
}
private double nd() {
return Double.parseDouble(ns());
}
private char nc() {
return (char) skip();
}
private String ns() {
int b = skip();
StringBuilder sb = new StringBuilder();
while (!(isSpaceChar(b))) { // when nextLine, (isSpaceChar(b) && b != ' ')
sb.appendCodePoint(b);
b = readByte();
}
return sb.toString();
}
private char[] ns(int n) {
char[] buf = new char[n];
int b = skip(), p = 0;
while (p < n && !(isSpaceChar(b))) {
buf[p++] = (char) b;
b = readByte();
}
return n == p ? buf : Arrays.copyOf(buf, p);
}
private char[][] nm(int n, int m) {
char[][] map = new char[n][];
for (int i = 0; i < n; i++)
map[i] = ns(m);
return map;
}
private int[] na(int n) {
int[] a = new int[n];
for (int i = 0; i < n; i++)
a[i] = ni();
return a;
}
private int ni() {
int num = 0, b;
boolean minus = false;
while ((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-'))
;
if (b == '-') {
minus = true;
b = readByte();
}
while (true) {
if (b >= '0' && b <= '9') {
num = num * 10 + (b - '0');
} else {
return minus ? -num : num;
}
b = readByte();
}
}
private long nl() {
long num = 0;
int b;
boolean minus = false;
while ((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-'))
;
if (b == '-') {
minus = true;
b = readByte();
}
while (true) {
if (b >= '0' && b <= '9') {
num = num * 10 + (b - '0');
} else {
return minus ? -num : num;
}
b = readByte();
}
}
private static void tr(Object... o) {
System.out.println(Arrays.deepToString(o));
}
}
|
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
20,
41,
13,
20,
41,
13,
4,
18,
13,
4,
18,
13,
41,
13,
4,
18,
13,
4,
18,
13,
41,
13,
20,
13,
41,
13,
17,
41,
13,
17,
0,
13,
20,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
18,
13,
13,
4,
18,
13,
4,
18,
13,
0,
13,
18,
13,
13,
0,
13,
2,
13,
13,
14,
2,
13,
17,
4,
18,
13,
2,
40,
17,
17,
4,
18,
13,
2,
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
],
[
10,
11
],
[
10,
12
],
[
0,
13
],
[
13,
14
],
[
13,
15
],
[
0,
16
],
[
16,
17
],
[
16,
18
],
[
0,
19
],
[
118,
20
],
[
118,
21
],
[
21,
22
],
[
21,
23
],
[
23,
24
],
[
24,
25
],
[
24,
26
],
[
23,
27
],
[
27,
28
],
[
27,
29
],
[
23,
30
],
[
30,
31
],
[
30,
32
],
[
23,
33
],
[
33,
34
],
[
33,
35
],
[
35,
36
],
[
36,
37
],
[
35,
38
],
[
38,
39
],
[
39,
40
],
[
23,
41
],
[
41,
42
],
[
41,
43
],
[
43,
44
],
[
44,
45
],
[
43,
46
],
[
46,
47
],
[
47,
48
],
[
23,
49
],
[
49,
50
],
[
49,
51
],
[
23,
53
],
[
53,
54
],
[
53,
55
],
[
23,
56
],
[
56,
57
],
[
56,
58
],
[
23,
59
],
[
59,
60
],
[
59,
61
],
[
23,
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
],
[
76,
78
],
[
75,
79
],
[
79,
80
],
[
80,
81
],
[
79,
82
],
[
82,
83
],
[
83,
84
],
[
74,
85
],
[
85,
86
],
[
85,
87
],
[
87,
88
],
[
87,
89
],
[
23,
90
],
[
90,
91
],
[
90,
92
],
[
92,
93
],
[
92,
94
],
[
23,
95
],
[
95,
96
],
[
96,
97
],
[
96,
98
],
[
95,
99
],
[
99,
100
],
[
100,
101
],
[
99,
102
],
[
102,
103
],
[
103,
104
],
[
102,
105
],
[
95,
106
],
[
106,
107
],
[
107,
108
],
[
106,
109
],
[
109,
110
],
[
109,
111
],
[
23,
112
],
[
112,
113
],
[
113,
114
],
[
21,
115
],
[
115,
116
],
[
0,
117
],
[
117,
118
],
[
117,
119
]
] |
[
"import java.io.BufferedReader;\nimport java.io.BufferedWriter;\nimport java.io.IOException;\nimport java.io.InputStreamReader;\nimport java.io.OutputStreamWriter;\nimport java.util.StringTokenizer;\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\tBufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out));\n\t\t\n\t\tStringTokenizer st = new StringTokenizer(br.readLine());\n\t\t\n\t\tint N = Integer.parseInt(st.nextToken());\n\t\tint M = Integer.parseInt(st.nextToken());\n\t\t\n\t\tint[] assign = new int[M];\n\t\tint vacation = 0, sum = 0;\n\t\tst = new StringTokenizer(br.readLine());\n\t\tfor(int i=0; i<M; i++) {\n\t\t\tassign[i] = Integer.parseInt(st.nextToken());\n\t\t\tsum += assign[i];\n\t\t}\n\t\t\n\t\tvacation = N - sum;\n\t\tif(vacation < 0)\n\t\t\tbw.write(-1 + \"\\n\");\n\t\telse\n\t\t\tbw.write(vacation + \"\\n\");\n\t\tbw.flush();\n\t}\n\n}",
"import java.io.BufferedReader;",
"BufferedReader",
"java.io",
"import java.io.BufferedWriter;",
"BufferedWriter",
"java.io",
"import java.io.IOException;",
"IOException",
"java.io",
"import java.io.InputStreamReader;",
"InputStreamReader",
"java.io",
"import java.io.OutputStreamWriter;",
"OutputStreamWriter",
"java.io",
"import java.util.StringTokenizer;",
"StringTokenizer",
"java.util",
"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\tBufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out));\n\t\t\n\t\tStringTokenizer st = new StringTokenizer(br.readLine());\n\t\t\n\t\tint N = Integer.parseInt(st.nextToken());\n\t\tint M = Integer.parseInt(st.nextToken());\n\t\t\n\t\tint[] assign = new int[M];\n\t\tint vacation = 0, sum = 0;\n\t\tst = new StringTokenizer(br.readLine());\n\t\tfor(int i=0; i<M; i++) {\n\t\t\tassign[i] = Integer.parseInt(st.nextToken());\n\t\t\tsum += assign[i];\n\t\t}\n\t\t\n\t\tvacation = N - sum;\n\t\tif(vacation < 0)\n\t\t\tbw.write(-1 + \"\\n\");\n\t\telse\n\t\t\tbw.write(vacation + \"\\n\");\n\t\tbw.flush();\n\t}\n\n}",
"Main",
"public static void main(String[] args) throws IOException {\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\t\tBufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out));\n\t\t\n\t\tStringTokenizer st = new StringTokenizer(br.readLine());\n\t\t\n\t\tint N = Integer.parseInt(st.nextToken());\n\t\tint M = Integer.parseInt(st.nextToken());\n\t\t\n\t\tint[] assign = new int[M];\n\t\tint vacation = 0, sum = 0;\n\t\tst = new StringTokenizer(br.readLine());\n\t\tfor(int i=0; i<M; i++) {\n\t\t\tassign[i] = Integer.parseInt(st.nextToken());\n\t\t\tsum += assign[i];\n\t\t}\n\t\t\n\t\tvacation = N - sum;\n\t\tif(vacation < 0)\n\t\t\tbw.write(-1 + \"\\n\");\n\t\telse\n\t\t\tbw.write(vacation + \"\\n\");\n\t\tbw.flush();\n\t}",
"main",
"{\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\t\tBufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out));\n\t\t\n\t\tStringTokenizer st = new StringTokenizer(br.readLine());\n\t\t\n\t\tint N = Integer.parseInt(st.nextToken());\n\t\tint M = Integer.parseInt(st.nextToken());\n\t\t\n\t\tint[] assign = new int[M];\n\t\tint vacation = 0, sum = 0;\n\t\tst = new StringTokenizer(br.readLine());\n\t\tfor(int i=0; i<M; i++) {\n\t\t\tassign[i] = Integer.parseInt(st.nextToken());\n\t\t\tsum += assign[i];\n\t\t}\n\t\t\n\t\tvacation = N - sum;\n\t\tif(vacation < 0)\n\t\t\tbw.write(-1 + \"\\n\");\n\t\telse\n\t\t\tbw.write(vacation + \"\\n\");\n\t\tbw.flush();\n\t}",
"BufferedReader br = new BufferedReader(new InputStreamReader(System.in));",
"br",
"new BufferedReader(new InputStreamReader(System.in))",
"BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out));",
"bw",
"new BufferedWriter(new OutputStreamWriter(System.out))",
"StringTokenizer st = new StringTokenizer(br.readLine());",
"st",
"new StringTokenizer(br.readLine())",
"int N = Integer.parseInt(st.nextToken());",
"N",
"Integer.parseInt(st.nextToken())",
"Integer.parseInt",
"Integer",
"st.nextToken()",
"st.nextToken",
"st",
"int M = Integer.parseInt(st.nextToken());",
"M",
"Integer.parseInt(st.nextToken())",
"Integer.parseInt",
"Integer",
"st.nextToken()",
"st.nextToken",
"st",
"int[] assign = new int[M];",
"assign",
"new int[M]",
"M",
"int vacation = 0",
"vacation",
"0",
"sum = 0;",
"sum",
"0",
"st = new StringTokenizer(br.readLine())",
"st",
"new StringTokenizer(br.readLine())",
"for(int i=0; i<M; i++) {\n\t\t\tassign[i] = Integer.parseInt(st.nextToken());\n\t\t\tsum += assign[i];\n\t\t}",
"int i=0;",
"int i=0;",
"i",
"0",
"i<M",
"i",
"M",
"i++",
"i++",
"i",
"{\n\t\t\tassign[i] = Integer.parseInt(st.nextToken());\n\t\t\tsum += assign[i];\n\t\t}",
"{\n\t\t\tassign[i] = Integer.parseInt(st.nextToken());\n\t\t\tsum += assign[i];\n\t\t}",
"assign[i] = Integer.parseInt(st.nextToken())",
"assign[i]",
"assign",
"i",
"Integer.parseInt(st.nextToken())",
"Integer.parseInt",
"Integer",
"st.nextToken()",
"st.nextToken",
"st",
"sum += assign[i]",
"sum",
"assign[i]",
"assign",
"i",
"vacation = N - sum",
"vacation",
"N - sum",
"N",
"sum",
"if(vacation < 0)\n\t\t\tbw.write(-1 + \"\\n\");\n\t\telse\n\t\t\tbw.write(vacation + \"\\n\");",
"vacation < 0",
"vacation",
"0",
"bw.write(-1 + \"\\n\")",
"bw.write",
"bw",
"-1 + \"\\n\"",
"-1",
"1",
"\"\\n\"",
"bw.write(vacation + \"\\n\")",
"bw.write",
"bw",
"vacation + \"\\n\"",
"vacation",
"\"\\n\"",
"bw.flush()",
"bw.flush",
"bw",
"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\tBufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out));\n\t\t\n\t\tStringTokenizer st = new StringTokenizer(br.readLine());\n\t\t\n\t\tint N = Integer.parseInt(st.nextToken());\n\t\tint M = Integer.parseInt(st.nextToken());\n\t\t\n\t\tint[] assign = new int[M];\n\t\tint vacation = 0, sum = 0;\n\t\tst = new StringTokenizer(br.readLine());\n\t\tfor(int i=0; i<M; i++) {\n\t\t\tassign[i] = Integer.parseInt(st.nextToken());\n\t\t\tsum += assign[i];\n\t\t}\n\t\t\n\t\tvacation = N - sum;\n\t\tif(vacation < 0)\n\t\t\tbw.write(-1 + \"\\n\");\n\t\telse\n\t\t\tbw.write(vacation + \"\\n\");\n\t\tbw.flush();\n\t}\n\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\tBufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out));\n\t\t\n\t\tStringTokenizer st = new StringTokenizer(br.readLine());\n\t\t\n\t\tint N = Integer.parseInt(st.nextToken());\n\t\tint M = Integer.parseInt(st.nextToken());\n\t\t\n\t\tint[] assign = new int[M];\n\t\tint vacation = 0, sum = 0;\n\t\tst = new StringTokenizer(br.readLine());\n\t\tfor(int i=0; i<M; i++) {\n\t\t\tassign[i] = Integer.parseInt(st.nextToken());\n\t\t\tsum += assign[i];\n\t\t}\n\t\t\n\t\tvacation = N - sum;\n\t\tif(vacation < 0)\n\t\t\tbw.write(-1 + \"\\n\");\n\t\telse\n\t\t\tbw.write(vacation + \"\\n\");\n\t\tbw.flush();\n\t}\n\n}",
"Main"
] |
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.util.StringTokenizer;
public class Main {
public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out));
StringTokenizer st = new StringTokenizer(br.readLine());
int N = Integer.parseInt(st.nextToken());
int M = Integer.parseInt(st.nextToken());
int[] assign = new int[M];
int vacation = 0, sum = 0;
st = new StringTokenizer(br.readLine());
for(int i=0; i<M; i++) {
assign[i] = Integer.parseInt(st.nextToken());
sum += assign[i];
}
vacation = N - sum;
if(vacation < 0)
bw.write(-1 + "\n");
else
bw.write(vacation + "\n");
bw.flush();
}
}
|
[
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,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
18,
13,
13,
4,
18,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
2,
13,
18,
13,
13,
14,
2,
13,
17,
30,
4,
18,
18,
13,
13,
17,
30,
4,
18,
18,
13,
13,
13,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
87,
5
],
[
87,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
8,
17
],
[
17,
18
],
[
17,
19
],
[
19,
20
],
[
20,
21
],
[
8,
22
],
[
22,
23
],
[
22,
24
],
[
8,
26
],
[
26,
27
],
[
27,
28
],
[
28,
29
],
[
28,
30
],
[
26,
31
],
[
31,
32
],
[
31,
33
],
[
26,
34
],
[
34,
35
],
[
35,
36
],
[
26,
37
],
[
38,
38
],
[
38,
39
],
[
39,
40
],
[
40,
41
],
[
40,
42
],
[
39,
43
],
[
43,
44
],
[
44,
45
],
[
8,
46
],
[
46,
47
],
[
47,
48
],
[
48,
49
],
[
48,
50
],
[
46,
51
],
[
51,
52
],
[
51,
53
],
[
46,
54
],
[
54,
55
],
[
55,
56
],
[
46,
57
],
[
58,
58
],
[
58,
59
],
[
59,
60
],
[
59,
61
],
[
61,
62
],
[
61,
63
],
[
63,
64
],
[
63,
65
],
[
8,
66
],
[
66,
67
],
[
67,
68
],
[
67,
69
],
[
66,
70
],
[
70,
71
],
[
71,
72
],
[
72,
73
],
[
73,
74
],
[
73,
75
],
[
71,
76
],
[
66,
77
],
[
77,
78
],
[
78,
79
],
[
79,
80
],
[
80,
81
],
[
80,
82
],
[
78,
83
],
[
6,
84
],
[
84,
85
],
[
0,
86
],
[
86,
87
],
[
86,
88
]
] |
[
"import java.util.*;\npublic class Main {\n public static void main(String[] args){\n Scanner scan = new Scanner(System.in);\n int n = scan.nextInt();\n int m = scan.nextInt();\n int a[] = new int[m];\n for(int i = 0; i < m; i++){\n a[i] = scan.nextInt();\n }\n \n for(int i = 0; i < m; i++){\n n = n - a[i];\n }\n\n if(n < 0){\n System.out.println(\"-1\");\n }else{\n System.out.println(n);\n }\n }\n}",
"import java.util.*;",
"util.*",
"java",
"public class Main {\n public static void main(String[] args){\n Scanner scan = new Scanner(System.in);\n int n = scan.nextInt();\n int m = scan.nextInt();\n int a[] = new int[m];\n for(int i = 0; i < m; i++){\n a[i] = scan.nextInt();\n }\n \n for(int i = 0; i < m; i++){\n n = n - a[i];\n }\n\n if(n < 0){\n System.out.println(\"-1\");\n }else{\n System.out.println(n);\n }\n }\n}",
"Main",
"public static void main(String[] args){\n Scanner scan = new Scanner(System.in);\n int n = scan.nextInt();\n int m = scan.nextInt();\n int a[] = new int[m];\n for(int i = 0; i < m; i++){\n a[i] = scan.nextInt();\n }\n \n for(int i = 0; i < m; i++){\n n = n - a[i];\n }\n\n if(n < 0){\n System.out.println(\"-1\");\n }else{\n System.out.println(n);\n }\n }",
"main",
"{\n Scanner scan = new Scanner(System.in);\n int n = scan.nextInt();\n int m = scan.nextInt();\n int a[] = new int[m];\n for(int i = 0; i < m; i++){\n a[i] = scan.nextInt();\n }\n \n for(int i = 0; i < m; i++){\n n = n - a[i];\n }\n\n if(n < 0){\n System.out.println(\"-1\");\n }else{\n System.out.println(n);\n }\n }",
"Scanner scan = new Scanner(System.in);",
"scan",
"new Scanner(System.in)",
"int n = scan.nextInt();",
"n",
"scan.nextInt()",
"scan.nextInt",
"scan",
"int m = scan.nextInt();",
"m",
"scan.nextInt()",
"scan.nextInt",
"scan",
"int a[] = new int[m];",
"a",
"new int[m]",
"m",
"for(int i = 0; i < m; i++){\n a[i] = scan.nextInt();\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < m",
"i",
"m",
"i++",
"i++",
"i",
"{\n a[i] = scan.nextInt();\n }",
"{\n a[i] = scan.nextInt();\n }",
"a[i] = scan.nextInt()",
"a[i]",
"a",
"i",
"scan.nextInt()",
"scan.nextInt",
"scan",
"for(int i = 0; i < m; i++){\n n = n - a[i];\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < m",
"i",
"m",
"i++",
"i++",
"i",
"{\n n = n - a[i];\n }",
"{\n n = n - a[i];\n }",
"n = n - a[i]",
"n",
"n - a[i]",
"n",
"a[i]",
"a",
"i",
"if(n < 0){\n System.out.println(\"-1\");\n }else{\n System.out.println(n);\n }",
"n < 0",
"n",
"0",
"{\n System.out.println(\"-1\");\n }",
"System.out.println(\"-1\")",
"System.out.println",
"System.out",
"System",
"System.out",
"\"-1\"",
"{\n System.out.println(n);\n }",
"System.out.println(n)",
"System.out.println",
"System.out",
"System",
"System.out",
"n",
"String[] args",
"args",
"public class Main {\n public static void main(String[] args){\n Scanner scan = new Scanner(System.in);\n int n = scan.nextInt();\n int m = scan.nextInt();\n int a[] = new int[m];\n for(int i = 0; i < m; i++){\n a[i] = scan.nextInt();\n }\n \n for(int i = 0; i < m; i++){\n n = n - a[i];\n }\n\n if(n < 0){\n System.out.println(\"-1\");\n }else{\n System.out.println(n);\n }\n }\n}",
"public class Main {\n public static void main(String[] args){\n Scanner scan = new Scanner(System.in);\n int n = scan.nextInt();\n int m = scan.nextInt();\n int a[] = new int[m];\n for(int i = 0; i < m; i++){\n a[i] = scan.nextInt();\n }\n \n for(int i = 0; i < m; i++){\n n = n - a[i];\n }\n\n if(n < 0){\n System.out.println(\"-1\");\n }else{\n System.out.println(n);\n }\n }\n}",
"Main"
] |
import java.util.*;
public class Main {
public static void main(String[] args){
Scanner scan = new Scanner(System.in);
int n = scan.nextInt();
int m = scan.nextInt();
int a[] = new int[m];
for(int i = 0; i < m; i++){
a[i] = scan.nextInt();
}
for(int i = 0; i < m; i++){
n = n - a[i];
}
if(n < 0){
System.out.println("-1");
}else{
System.out.println(n);
}
}
}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.