QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#147369#4657. 众数qwq97 412ms95372kbC++232.7kb2023-08-23 01:44:572023-08-25 01:24:30

详细

Test #1:

score: 5
Accepted
time: 3ms
memory: 12040kb

input:

35 300
27 2 116 2 2 1 2 10 2 229 5 2 2 172 2 2 8 2 2 2 15 2 2 2 5 2 2 2
3 6 14 6
13 9 2 9 9 11 3 9 9 9 9 9 9 9
4 9 9 9 9
17 3 3 3 3 3 8 8 3 5 13 3 11 3 3 3 224 3
17 5 5 5 5 5 5 186 5 5 1 5 5 5 5 14 5 12
2 10 10
67 6 6 6 6 6 6 6 10 6 6 2 6 9 6 6 6 8 6 6 6 6 6 14 6 6 6 6 6 6 6 189 6 13 6 10 6 7 6 14 6...

output:

-1
-1
-1
6
6
11
12
6
6
6
-1
6
15
-1
2
6
2
-1
6
-1
-1
-1
6
2
6
6
-1
2
2
15
9
-1
-1
-1
-1

result:

ok 35 numbers

Test #2:

score: 5
Accepted
time: 1ms
memory: 12040kb

input:

34 300
10 257 7 7 7 2 13 7 13 273 7
4 13 13 13 13
2 149 15
25 4 3 4 4 9 4 4 6 4 4 4 4 4 4 4 4 4 4 4 4 4 128 4 4 4
25 5 5 5 1 5 5 129 5 5 5 5 5 5 5 5 5 15 5 5 5 5 5 5 11 5
62 15 15 15 15 15 15 15 15 15 15 15 15 14 147 15 15 15 15 15 161 15 15 11 15 15 1 15 15 15 15 115 15 15 8 15 15 15 241 15 15 15 7...

output:

-1
-1
15
-1
15
15
15
-1
15
-1
-1
2
-1
-1
4
15
4
6
-1
-1
-1
-1
4
15
6
-1
5
1
-1
-1
-1
6
-1
9
-1

result:

ok 35 numbers

Test #3:

score: 5
Accepted
time: 3ms
memory: 12040kb

input:

36 300
4 13 1 208 6
1 3
47 7 80 7 7 7 7 8 7 7 193 13 7 7 7 4 10 7 7 7 7 13 62 5 7 7 7 7 138 13 7 7 207 7 7 7 7 7 124 7 14 7 7 179 6 7 7 7
11 9 146 9 9 9 9 9 9 9 9 106
12 1 1 1 1 1 1 1 1 2 1 1 1
8 15 15 15 149 2 15 15 12
62 8 8 8 14 8 8 8 8 8 8 5 8 8 226 8 8 14 8 8 8 155 13 10 8 8 267 195 8 8 8 54 8 ...

output:

7
7
2
7
8
14
9
9
5
-1
-1
8
-1
8
7
8
-1
-1
8
-1
-1
8
8
8
8
8
-1
13
-1
-1
8
-1
8
8
-1

result:

ok 35 numbers

Test #4:

score: 5
Accepted
time: 4ms
memory: 14192kb

input:

386 4000
166 5 5 5 9 9 5 8 5 5 5 5 3 5 5 5 5 12 2 5 220 5 11 5 13 5 5 5 5 5 278 5 5 5 5 5 1 5 52 5 170 5 139 9 8 5 5 5 27 5 9 5 5 5 5 5 1 5 231 5 5 5 93 5 5 5 5 268 5 5 5 5 5 5 7 5 6 5 5 195 15 5 5 5 15 5 5 5 5 5 5 269 5 67 5 14 5 208 5 5 5 59 5 5 5 5 5 5 6 3 5 5 274 5 7 5 5 5 5 5 201 5 5 3 5 8 190 ...

output:

4
-1
6
11
-1
11
11
1
12
5
-1
5
-1
9
11
6
14
1
5
11
-1
2
12
-1
11
-1
10
5
11
11
13
-1
4
9
11
11
11
11
11
4
-1
8
11
7
5
6
2
-1
11
10
11
8
11
11
8
1
11
10
11
11
-1
11
-1
11
11
11
11
11
-1
-1
-1
11
-1
-1
-1
15
11
2
4
9
9
-1
6
-1
11
11
10
5
13
11
11
11
3
11
5
11
11
11
-1
11
15
11
11
11
1
11
9
11
11
5
9
1...

result:

ok 383 numbers

Test #5:

score: 5
Accepted
time: 5ms
memory: 12168kb

input:

384 4000
165 7 7 7 7 7 152 7 7 10 9 236 7 7 10 7 7 232 4 7 7 7 8 7 7 7 7 3 7 7 73 7 120 7 7 7 7 7 15 4 7 7 7 7 7 7 23 1 13 7 7 7 7 7 7 7 7 2 7 7 65 15 7 7 28 7 7 7 7 7 7 7 7 7 7 7 81 7 7 7 11 7 7 7 7 12 7 11 7 7 7 7 281 7 7 7 7 3 115 3 7 7 140 7 13 299 7 7 7 7 7 2 7 7 7 7 6 14 7 7 7 7 7 7 7 3 11 11 ...

output:

12
8
10
3
9
-1
13
8
-1
10
8
-1
3
8
13
8
7
7
8
9
8
-1
-1
8
8
-1
8
8
15
7
7
6
8
15
8
-1
8
-1
-1
-1
13
7
8
-1
-1
8
7
8
13
-1
4
8
1
8
8
10
8
13
-1
8
-1
8
8
2
12
8
-1
11
7
8
8
-1
13
8
8
8
8
-1
8
13
13
8
8
8
-1
-1
8
-1
5
8
11
8
8
1
8
8
12
8
11
12
-1
8
-1
8
8
7
8
13
13
8
-1
8
8
-1
10
8
1
9
8
6
2
1
2
8
8
8
...

result:

ok 412 numbers

Test #6:

score: 5
Accepted
time: 5ms
memory: 12028kb

input:

378 4000
11 102 14 14 1 14 14 14 5 1 2 14
38 12 5 15 12 12 12 12 12 14 9 12 12 221 12 12 6 12 15 12 12 12 12 12 12 12 12 12 12 12 12 263 12 7 12 2 12 280 12
50 14 14 14 2 3 14 14 14 14 14 14 14 14 14 14 14 14 14 14 63 14 148 14 14 14 12 14 14 68 14 14 14 14 14 13 14 14 3 14 14 14 14 14 5 14 14 14 14...

output:

-1
2
13
13
-1
1
3
-1
3
3
13
-1
6
-1
-1
-1
3
3
2
13
15
1
13
3
1
-1
-1
3
15
1
3
3
13
13
-1
-1
13
-1
-1
2
15
2
3
1
13
13
3
13
3
3
12
6
3
11
3
4
4
3
2
-1
3
13
3
13
-1
3
-1
3
4
-1
4
13
13
3
9
11
3
13
15
11
-1
3
13
-1
3
13
2
13
6
3
2
-1
2
-1
13
13
3
13
1
13
-1
3
-1
-1
15
-1
3
3
-1
3
3
5
13
7
6
3
12
13
1
3...

result:

ok 403 numbers

Test #7:

score: 5
Accepted
time: 2ms
memory: 12144kb

input:

381 4000
35 3 115 3 14 14 140 14 13 299 14 14 14 14 14 2 14 14 14 14 6 14 14 14 14 14 14 14 14 3 11 11 14 14 14 1
76 5 72 5 5 4 5 12 5 5 5 52 5 5 5 5 13 6 3 5 5 148 184 5 5 4 175 3 8 5 15 4 5 9 5 5 5 7 5 5 141 172 5 5 5 5 5 5 5 5 5 5 5 268 5 3 5 5 5 5 5 90 5 5 5 5 5 5 5 4 5 5 5 5 5 5 5
46 12 15 12 1...

output:

-1
-1
14
14
14
14
3
3
-1
14
6
4
15
-1
5
13
-1
5
-1
15
14
2
14
-1
1
-1
14
-1
-1
12
12
14
-1
-1
-1
-1
15
-1
-1
4
14
-1
15
12
-1
14
2
4
-1
14
-1
14
14
15
2
14
10
1
11
-1
12
-1
14
4
9
15
15
2
4
14
14
11
-1
-1
14
4
12
-1
-1
-1
15
11
4
12
15
11
-1
14
14
14
14
15
14
14
2
2
14
-1
9
14
8
14
4
14
14
14
14
-1
...

result:

ok 405 numbers

Test #8:

score: 5
Accepted
time: 27ms
memory: 12260kb

input:

1 100000
100 2 2 1 2 1 1 2 2 1 1 1 1 1 1 2 1 1 2 2 2 1 2 1 2 2 2 1 2 1 2 2 2 1 1 1 1 1 2 2 2 2 2 2 2 2 2 1 2 2 2 1 1 1 2 2 1 1 2 2 2 2 1 1 2 2 1 1 1 2 1 1 2 2 2 2 1 2 2 1 1 1 2 2 2 2 1 1 1 1 2 2 1 1 1 2 1 1 1 2 2
1 1 2
3 1 1
1 1 1
1 1 2
3 1 1
1 1 1
1 1 1
3 1 1
1 1 2
1 1 2
3 1 1
1 1 1
1 1 1
3 1 1
1 1...

output:

2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
-1
1
1
1
1
1
1
1
1
1
1
-1
1
1
2
2
-1
2
2
2
2
2
2
1
2
2
-1
1
2
2
-1
1
-1
-1
-1
2
2
2
2
2
2
2
-1
2
2
2
-1
1
1
1
-1
2
-1
2
2
2
2
2
2
-1
-1
-1
2
2
-1
2
-1
-1
1
1
1
1
-1
-1
2
-1
2
2
2
1
1
1
-1
2
2
2
2
2
2
...

result:

ok 33303 numbers

Test #9:

score: 5
Accepted
time: 27ms
memory: 12288kb

input:

1 100000
25 71320 11703 98808 17909 85610 98808 98808 98808 71320 71320 98808 71320 98808 71320 98808 71320 85610 98808 71320 11703 98808 71320 85610 98808 71320
1 1 73838
1 1 73838
1 1 73838
3 1 1
1 1 71320
3 1 1
1 1 73838
3 1 1
1 1 11703
3 1 1
1 1 85610
1 1 71320
3 1 1
1 1 71320
3 1 1
1 1 73838
3 ...

output:

-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
98503
98503
98503
98503
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
...

result:

ok 34834 numbers

Test #10:

score: 5
Accepted
time: 47ms
memory: 16444kb

input:

9388 100000
37 1 2 2 1 2 2 1 2 2 1 1 2 2 1 2 2 1 2 1 1 1 2 2 1 1 1 2 1 1 2 2 1 2 2 1 2 2
1 2
130 1 1 1 2 1 1 1 2 2 1 2 1 1 2 1 1 1 1 2 2 1 1 1 1 1 1 2 2 2 2 1 1 1 2 1 2 2 2 2 1 1 2 1 1 1 1 1 1 2 1 2 2 2 1 1 1 2 2 2 1 2 1 1 2 2 2 1 1 1 1 1 1 2 2 2 1 1 2 1 1 1 2 2 2 1 1 1 2 1 1 2 2 2 2 1 1 2 2 1 2 1 1...

output:

1
2
1
1
2
1
2
1
1
1
1
1
2
1
2
2
1
-1
2
1
1
2
2
1
1
2
2
2
2
2
1
2
2
1
1
1
1
1
1
2
1
2
2
2
2
2
2
1
1
1
2
1
1
2
1
2
1
2
1
2
2
1
1
1
2
1
2
1
2
1
1
-1
2
1
1
2
1
1
1
-1
1
2
1
2
1
1
2
1
2
2
2
2
1
1
1
2
1
1
1
1
2
1
2
2
2
1
2
2
2
2
2
2
1
1
1
1
2
1
1
2
2
2
1
-1
2
1
1
1
2
2
2
1
2
1
1
2
1
1
2
1
2
1
2
1
1
2
2
1
...

result:

ok 8750 numbers

Test #11:

score: 5
Accepted
time: 78ms
memory: 36484kb

input:

100000 100000
0
1 20457
1 18800
0
1 20457
0
1 20457
1 20457
1 35346
1 109035
0
1 141225
1 78957
0
0
1 195258
0
0
0
1 20457
1 66545
0
0
0
0
0
1 154562
1 8501
0
0
0
1 20457
0
0
0
0
0
0
0
0
0
0
1 83496
0
0
1 20457
0
0
0
1 194430
1 136041
0
1 39187
0
0
0
1 185472
0
0
0
0
1 70673
0
0
0
0
0
0
0
0
0
1 2045...

output:

39187
-1
-1
130067
39187
-1
178547
20457
20457
20457
39187
35346
20457
123691
182527
131395
35346
77616
20457
55105
106974
20457
-1
39187
60976
-1
39187
-1
87865
-1
99376
20457
35346
126833
-1
20457
20457
109815
77616
-1
115399
20457
77616
39187
-1
20457
20457
20457
-1
35346
40420
-1
126833
17124
19...

result:

ok 53971 numbers

Test #12:

score: 5
Accepted
time: 74ms
memory: 34328kb

input:

100000 100000
0
0
0
0
0
0
0
0
0
0
0
1 130771
0
0
0
1 6079
0
1 54424
0
0
1 51569
0
0
0
1 165398
0
0
1 184348
0
1 54424
0
0
0
1 107570
1 60576
1 10546
0
1 124211
0
1 101730
0
0
1 54424
0
0
0
1 54424
0
1 37947
0
0
0
1 124211
0
0
1 54424
0
0
1 114512
0
1 124211
0
2 184348 184348
0
0
16 123199 123199 123...

output:

51569
-1
51317
51569
123199
51317
-1
-1
-1
59778
59876
94389
104655
184348
-1
124211
51317
-1
124211
124211
-1
-1
51569
51317
6924
23128
124211
-1
-1
51569
184348
130771
54814
-1
124211
-1
97368
44578
130771
-1
-1
-1
-1
51317
155326
51317
124211
124211
51317
130771
51317
124211
134940
23506
-1
11895...

result:

ok 54622 numbers

Test #13:

score: 5
Accepted
time: 64ms
memory: 27708kb

input:

100000 100000
1 26501
0
0
1 105771
1 35002
0
0
0
0
1 189819
1 105771
1 136309
1 125683
1 174662
0
0
0
0
1 58412
0
0
0
1 105771
0
0
1 134730
1 105771
0
0
0
0
0
1 105771
0
0
0
1 105771
0
0
0
1 105771
0
0
0
0
0
0
1 105771
0
0
0
0
0
0
0
0
0
0
1 105771
0
0
0
0
0
0
1 105771
0
0
0
0
0
0
1 3669
0
1 134486
0...

output:

-1
-1
-1
-1
33459
97208
-1
105771
199076
134730
105771
97208
-1
113770
-1
105771
-1
-1
105771
134730
134730
-1
105771
199076
-1
65146
138402
199691
127025
105771
-1
33459
156270
105168
-1
33459
-1
-1
82170
-1
97208
-1
-1
199076
105771
105771
-1
105771
-1
33459
-1
169165
105771
-1
129271
105771
-1
10...

result:

ok 52275 numbers

Test #14:

score: 5
Accepted
time: 114ms
memory: 16932kb

input:

1 500000
100 1 2 1 2 2 2 1 1 2 1 2 2 1 2 1 2 1 2 1 1 2 2 1 1 2 1 1 2 1 2 2 1 2 2 2 2 2 1 2 1 1 1 1 2 2 1 1 2 2 1 2 2 2 2 1 1 2 2 1 2 1 1 2 2 1 2 2 2 1 1 2 2 1 1 2 2 2 2 2 1 1 1 1 1 1 2 1 2 1 1 1 1 2 2 1 1 1 2 2 2
1 1 1
1 1 2
3 1 1
1 1 2
3 1 1
1 1 2
1 1 2
1 1 1
1 1 1
1 1 1
3 1 1
1 1 1
3 1 1
1 1 2
1 1...

output:

2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
-1
1
-1
-1
2
2
2
2
2
-1
2
2
2
-1
-1
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
-1
2
1
-1
2
-1
2
2
2
2
-1
1
1
1
1
1
1
1
1
1
1
...

result:

ok 166637 numbers

Test #15:

score: 5
Accepted
time: 113ms
memory: 14896kb

input:

1 500000
25 20697 7735 99071 18982 61848 61848 99071 61848 7735 18982 20697 61848 18982 18982 7735 61848 7735 18982 20697 99071 18982 61848 18982 7735 20697
1 1 7735
3 1 1
1 1 68524
3 1 1
1 1 68524
1 1 68524
3 1 1
1 1 68524
1 1 7735
3 1 1
1 1 68524
1 1 68524
3 1 1
1 1 68524
3 1 1
1 1 68524
3 1 1
1 1...

output:

-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
68524
68524
68524
68524
68524
68524
68524
68524
68524
68524
68524
68524
68524
68524
68524
-1
68524
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
...

result:

ok 164071 numbers

Test #16:

score: 5
Accepted
time: 279ms
memory: 36032kb

input:

45518 500000
23 1 1 1 1 1 2 2 2 2 1 2 1 1 2 1 2 1 1 2 1 1 1 2
68 1 1 2 2 1 1 2 2 2 2 2 1 2 2 1 1 1 1 1 1 2 2 1 2 1 2 1 1 2 2 2 2 1 2 1 2 1 1 2 1 2 1 1 1 1 1 2 2 1 2 2 2 1 1 1 1 2 2 2 2 1 1 2 2 1 2 2 1
104 1 2 1 1 2 2 1 2 2 1 2 2 1 1 1 2 2 1 2 2 1 1 2 1 2 1 2 2 1 1 1 1 1 1 2 1 2 1 2 2 2 1 2 2 1 2 1 1...

output:

2
1
1
1
1
1
2
1
1
2
1
1
1
2
1
2
1
2
2
2
2
1
1
1
2
1
1
2
2
2
2
2
1
1
2
2
1
1
2
1
1
2
1
2
1
2
2
1
1
2
1
2
2
1
1
1
-1
1
1
1
1
1
1
1
2
2
2
2
2
2
1
1
1
1
1
2
1
2
1
1
1
2
1
1
2
1
1
1
1
2
1
1
1
1
2
1
2
2
1
1
1
1
1
1
2
2
1
1
1
1
1
2
1
1
2
1
2
1
1
1
2
1
2
1
1
1
1
1
1
2
1
2
1
1
2
1
1
1
2
1
1
1
1
1
1
1
2
2
1
1...

result:

ok 43458 numbers

Test #17:

score: 5
Accepted
time: 385ms
memory: 93448kb

input:

500000 494773
1 790361
0
0
0
1 767127
0
0
0
0
0
0
0
1 549708
1 68298
0
0
0
0
0
0
0
0
0
0
0
0
1 12404
0
0
0
0
0
0
0
0
0
1 124843
0
0
0
0
0
0
0
0
0
0
0
0
0
1 767127
0
0
0
0
0
0
0
0
0
0
1 612420
0
0
0
1 472564
0
0
0
0
0
1 767127
0
0
0
0
0
0
0
1 313933
1 270986
0
0
0
0
1 767127
1 120039
0
0
1 287222
0
0...

output:

-1
435210
-1
-1
-1
164689
560565
560565
767127
560565
786876
-1
767127
170410
406327
472354
767127
370211
-1
767127
68088
-1
560565
767127
454376
323142
41654
767127
612420
472354
140868
755256
767127
700035
594833
594355
595102
-1
700035
767127
454376
645392
-1
787848
767127
560565
-1
595102
767127...

result:

ok 289312 numbers

Test #18:

score: 5
Accepted
time: 412ms
memory: 95372kb

input:

500000 494293
0
0
0
0
1 763268
0
0
0
0
0
0
1 441927
1 280159
2 591022 373561
0
0
0
0
0
0
0
0
0
0
1 171246
0
0
0
0
0
0
0
0
0
0
1 643914
0
1 269027
0
0
0
0
0
0
1 373561
0
0
0
0
0
0
1 280159
0
0
0
0
0
0
0
0
0
0
0
1 373561
0
0
0
0
0
0
0
0
0
0
1 579727
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
64 163666 280159 28015...

output:

1684
373561
373561
-1
254250
703442
-1
373561
-1
373561
693857
373561
-1
380784
-1
373561
579727
790174
790174
-1
579727
373561
-1
-1
-1
526155
579727
373561
695297
501635
373561
-1
579727
-1
373561
373561
373561
175596
404407
671851
-1
721279
373561
-1
-1
643914
27102
460013
-1
142542
-1
-1
373561
...

result:

ok 280147 numbers

Test #19:

score: 5
Accepted
time: 326ms
memory: 80448kb

input:

500000 497018
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1 178080
0
0
0
0
0
0
0
0
0
0
0
0
1 150992
0
0
0
0
0
0
0
0
0
0
0
0
1 701726
1 488752
0
0
0
0
0
0
0
0
1 407657
0
0
0
0
0
0
1 689386
0
0
0
0
0
0
0
0
0
0
0
1 178080
0
0
0
0
1 407657
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1 407657
0
0
1 165808
0
0
0
0
1 13498
0
1 ...

output:

-1
-1
-1
-1
-1
-1
795586
346854
-1
-1
237461
216907
150992
168315
-1
-1
216907
409496
150992
-1
-1
216907
178080
267844
301697
178080
216907
216907
-1
-1
-1
169339
-1
216907
216907
542327
216907
150992
-1
572147
-1
344663
178080
-1
478421
-1
267844
150992
-1
118451
283070
-1
216907
216907
-1
150992
...

result:

ok 267308 numbers

Test #20:

score: 5
Accepted
time: 347ms
memory: 86984kb

input:

500000 496676
0
0
1 741181
0
0
0
0
0
0
0
0
2 583535 583535
0
1 583535
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1 583535
0
0
0
0
0
0
0
0
0
0
0
0
0
1 551308
0
0
1 583535
0
0
0
0
1 204041
0
0
0
0
0
0
0
0
1 583535
0
0
0
1 160336
0
0
1 583535
0
0
0
0
0
0
0
1 82707
0
0
0
0
0
0
0
1 583535
1 583535
1 583535
1 ...

output:

-1
-1
-1
-1
-1
-1
583535
110799
-1
-1
-1
9758
583535
-1
-1
-1
160336
466577
-1
-1
-1
583535
741181
615686
-1
741181
-1
-1
284406
511938
-1
583535
795657
392619
253964
392619
-1
-1
583535
238232
741181
-1
583535
741181
466577
741181
764011
-1
583535
251837
-1
583535
-1
686297
-1
583535
583535
-1
1603...

result:

ok 262938 numbers

Extra Test:

score: -3
Extra Test Failed : Wrong Answer on 5
time: 15ms
memory: 14328kb

input:

65536 1
65536 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 ...

output:

-1

result:

wrong answer 1st numbers differ - expected: '1', found: '-1'