QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#238473#7684. Sweet Sugarucup-team570#AC ✓490ms126740kbC++2017.0kb2023-11-04 16:49:082023-11-04 16:49:12

詳細信息

Test #1:

score: 100
Accepted
time: 0ms
memory: 3612kb

input:

4
7 5
1 2 1 2 2 1 2
1 2
2 3
3 4
3 5
5 6
5 7
2 2
1 0
1 2
1 1
1
1 2
1

output:

2
0
1
0

result:

ok 4 number(s): "2 0 1 0"

Test #2:

score: 0
Accepted
time: 0ms
memory: 3780kb

input:

12
1 1
0
1 1
1
1 1
2
1 2
0
1 2
1
1 2
2
1 3
0
1 3
1
1 3
2
1 2000000
0
1 2000000
1
1 2000000
2

output:

0
1
0
0
0
1
0
0
0
0
0
0

result:

ok 12 numbers

Test #3:

score: 0
Accepted
time: 152ms
memory: 3632kb

input:

200000
5 2
1 1 0 0 1
2 4
5 2
4 1
3 2
5 1
0 0 0 0 0
5 1
1 2
3 2
5 4
5 3
1 0 0 0 1
1 4
4 2
3 4
5 2
5 9
1 0 0 0 2
4 3
2 1
3 1
5 1
5 3
0 1 1 0 1
5 4
2 1
4 3
5 1
5 1
0 2 1 1 1
5 3
2 4
3 4
1 4
5 1
1 0 1 1 0
1 5
4 2
1 3
5 2
5 7
0 2 1 1 2
5 1
2 3
2 5
5 4
5 5
0 1 0 1 0
2 4
4 3
5 2
1 5
5 1
0 0 1 0 1
4 1
4 5
2...

output:

1
0
0
0
1
3
3
0
0
2
0
0
2
1
0
0
1
1
0
2
0
1
0
2
1
0
0
0
0
0
1
2
0
0
2
2
0
1
0
0
0
0
3
3
0
0
1
1
2
1
2
0
4
0
1
1
0
1
0
0
1
5
0
1
1
1
0
1
1
1
1
1
1
0
1
1
1
0
3
1
0
1
0
0
4
0
0
0
1
1
0
0
1
0
2
0
5
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
1
0
0
0
0
1
0
0
0
0
0
1
0
0
1
1
0
1
0
1
1
1
2
0
1
2
0
0
2
0
0
1
0
0
0
0
0
...

result:

ok 200000 numbers

Test #4:

score: 0
Accepted
time: 165ms
memory: 3624kb

input:

100000
10 16
0 1 0 1 0 1 1 0 1 1
4 10
3 10
9 1
4 7
5 2
9 5
6 9
2 3
8 4
10 18
1 0 0 1 0 0 1 1 0 2
5 1
4 2
5 3
3 4
2 10
4 9
3 8
7 3
6 5
10 13
0 1 0 1 0 1 1 0 1 1
5 2
4 3
1 6
8 9
1 8
3 5
9 4
7 6
3 10
10 16
1 0 1 0 1 1 1 0 1 1
6 8
2 4
9 6
2 6
4 10
5 3
1 6
8 7
3 6
10 13
0 0 0 0 1 0 1 0 1 0
2 1
2 7
7 9
7 ...

output:

0
0
0
0
0
0
1
0
0
1
0
0
0
0
0
1
0
1
1
0
1
1
0
0
0
1
0
0
0
0
0
0
2
1
2
1
0
2
0
0
1
0
0
2
5
1
0
2
1
0
0
1
0
0
1
1
0
1
0
1
7
0
1
1
0
0
1
1
8
1
0
1
1
1
1
0
1
1
4
0
1
0
0
0
3
0
0
2
1
10
1
1
0
2
0
1
0
0
0
0
1
0
0
0
0
1
0
0
0
0
0
0
0
7
0
0
2
1
0
0
0
0
0
0
0
0
0
0
0
1
0
0
5
0
6
1
2
0
1
0
0
0
0
4
1
0
0
0
7
0...

result:

ok 100000 numbers

Test #5:

score: 0
Accepted
time: 175ms
memory: 3552kb

input:

50000
20 37
2 1 0 1 1 0 0 0 1 1 1 1 1 1 0 1 1 1 0 1
3 17
14 8
8 16
18 4
14 20
7 10
10 6
2 10
13 11
5 3
6 5
6 13
11 18
1 6
12 9
9 8
15 16
19 5
9 5
20 13
0 0 0 0 1 2 1 1 0 1 0 0 0 0 0 0 1 0 0 1
17 2
3 5
11 13
12 14
13 2
19 3
1 7
12 15
6 10
17 8
20 7
1 3
3 6
13 15
16 6
3 9
9 4
13 18
3 2
20 13
0 0 0 2 0...

output:

0
0
0
0
0
0
0
0
5
1
0
1
17
3
0
0
0
1
0
1
0
0
0
1
1
0
1
0
0
0
0
1
0
1
0
1
0
1
1
0
2
3
0
1
2
1
1
0
1
1
0
0
2
0
2
0
1
1
5
1
0
1
0
15
2
3
1
0
1
2
1
1
1
2
0
1
1
1
1
1
18
1
1
2
1
2
4
0
2
1
5
0
1
0
1
1
9
0
0
0
0
1
0
8
0
0
0
1
0
3
0
0
3
1
0
0
0
1
0
0
1
0
5
0
0
0
0
0
0
0
9
0
1
0
3
0
0
0
0
0
0
3
1
1
1
1
0
2
1...

result:

ok 50000 numbers

Test #6:

score: 0
Accepted
time: 194ms
memory: 3604kb

input:

20000
50 81
1 0 1 0 0 1 0 2 1 1 0 1 1 0 0 0 1 1 1 1 1 0 1 0 1 1 1 0 1 0 1 0 1 0 1 0 0 1 0 1 0 1 1 0 1 1 0 1 0 1
45 6
43 7
29 38
3 27
42 50
27 32
50 24
41 6
12 32
17 18
6 31
44 5
2 9
2 32
28 26
2 20
40 47
34 27
16 43
4 23
36 43
9 13
19 47
4 50
25 48
37 19
49 22
42 11
46 25
1 15
10 16
8 23
6 39
30 8
2...

output:

0
3
0
0
0
0
23
0
0
0
0
0
1
0
0
1
1
0
0
0
8
0
2
4
0
6
0
0
1
0
0
1
0
1
0
0
0
0
1
0
0
1
1
1
0
0
1
0
3
1
1
1
1
3
0
0
1
2
1
1
3
1
1
1
1
0
5
1
0
0
0
1
2
1
7
4
3
2
1
0
1
0
1
0
3
1
3
1
1
1
1
1
1
0
1
1
0
0
1
0
1
0
0
0
0
0
1
0
0
0
1
0
11
0
0
1
0
0
17
3
0
4
2
0
0
2
1
2
0
0
3
1
0
0
0
0
1
0
2
0
0
2
0
0
2
1
1
1
7...

result:

ok 20000 numbers

Test #7:

score: 0
Accepted
time: 188ms
memory: 3628kb

input:

2000
500 895
1 2 0 0 1 0 1 1 0 0 0 0 1 1 0 0 1 0 1 0 1 0 1 0 0 1 0 0 0 0 1 1 1 0 0 0 0 1 1 1 0 1 1 1 0 1 0 0 1 1 0 0 1 0 0 1 1 1 1 1 0 1 1 1 0 1 1 1 1 0 0 0 0 0 1 1 0 0 0 0 0 1 1 1 1 0 0 1 1 0 0 1 0 1 0 1 1 1 0 0 1 1 0 0 1 1 0 1 0 0 0 0 0 1 1 1 1 0 0 1 0 0 1 1 2 0 0 0 1 1 0 0 0 0 0 1 1 0 1 0 1 0 0 1...

output:

0
0
6
0
0
1
0
0
1
0
1
0
35
0
0
1
0
0
0
1
0
0
1
1
4
5
0
0
0
0
0
1
0
0
0
0
3
0
0
0
0
134
0
0
3
1
12
6
9
9
1
0
0
2
2
0
1
3
0
4
11
0
1
26
0
0
3
0
2
1
0
3
5
2
3
0
1
1
12
1
1
2
36
15
1
1
0
0
2
1
1
4
1
2
0
1
0
1
1
3
0
2
0
2
0
0
0
0
0
2
1
0
0
3
3
4
0
0
0
1
0
0
0
0
0
2
0
2
1
0
0
0
0
0
0
0
0
0
2
1
4
0
1
2
9
2...

result:

ok 2000 numbers

Test #8:

score: 0
Accepted
time: 199ms
memory: 4768kb

input:

200
5000 3054
2 1 0 1 2 2 1 2 2 2 2 2 2 2 0 2 2 0 0 2 1 0 2 0 2 2 2 2 2 0 2 2 2 2 1 2 2 2 2 2 2 2 2 2 1 2 2 2 2 2 2 0 1 0 0 2 0 2 0 2 2 2 2 2 2 2 2 2 2 0 2 2 1 0 2 2 2 1 2 2 1 2 1 0 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 1 2 2 2 2 0 2 1 2 2 2 2 2 2 2 0 1 1 2 1 1 1 2 2 2 2 0 2 2 2 2 1 0 2 2 2 2 2 ...

output:

2
1
5
14
0
1
3
1
2
1
1
1
1
1
4
0
54
1
0
1
10
1
0
1
0
2
3
4
0
1
1
0
0
3
1
3
0
0
0
0
0
0
0
4
1
0
0
1
0
0
10
1
0
7
1
0
0
3
8
1
2
2
1
1
1
6
0
29
3
1
4
10
5
1
1
1
1
2
0
0
0
33
1
1
18
1
0
1
0
11
0
1
0
0
0
0
1
1
0
20
3
0
3
2
2
1
1
1
14
4
1
10
1
1
1
3
2
4
0
0
1
0
4
0
30
1
0
0
1
1
1
0
0
12
0
0
0
0
13
2
0
1
1...

result:

ok 200 numbers

Test #9:

score: 0
Accepted
time: 257ms
memory: 12032kb

input:

20
50000 24898
2 2 2 2 2 1 1 2 0 1 0 0 0 2 0 2 1 2 2 2 1 1 1 1 2 2 1 1 2 2 2 2 2 0 0 2 2 2 0 2 2 0 2 1 0 2 1 0 0 1 0 1 0 2 2 2 0 0 0 2 2 2 2 0 2 1 2 2 0 0 1 1 2 0 2 1 2 0 2 2 2 1 1 2 1 2 1 2 1 1 2 2 0 0 1 1 1 0 2 2 1 1 0 0 0 2 2 1 2 1 2 1 1 2 1 1 1 2 1 2 2 0 1 2 1 1 2 0 1 2 0 0 1 1 2 1 0 2 2 2 0 2 0...

output:

2
0
5
100
13
19
0
1
0
1
0
1
3
1
0
0
1
8
0
1

result:

ok 20 numbers

Test #10:

score: 0
Accepted
time: 438ms
memory: 124648kb

input:

1
1000000 3
1 1 2 0 2 1 2 2 1 0 0 1 0 2 2 0 2 2 2 2 2 2 2 2 2 2 2 2 2 0 2 2 2 2 0 1 2 1 2 2 1 2 0 2 2 0 1 2 0 2 1 2 0 2 2 1 0 2 2 2 2 0 2 0 2 0 0 0 2 0 0 0 2 2 0 2 0 1 0 0 0 1 2 1 2 2 2 1 0 1 0 1 2 2 2 2 0 1 1 0 2 2 2 1 1 2 2 0 1 0 1 2 1 2 0 0 1 2 0 2 0 2 0 2 2 2 0 1 0 2 2 1 2 0 2 0 2 1 2 0 1 2 1 1 ...

output:

206384

result:

ok 1 number(s): "206384"

Test #11:

score: 0
Accepted
time: 421ms
memory: 102608kb

input:

1
1000000 50
1 2 0 2 0 0 0 1 2 1 2 1 1 0 2 0 0 1 2 1 2 2 2 0 0 2 2 2 2 1 2 2 1 1 1 2 2 1 0 0 2 1 1 1 0 0 2 2 0 2 0 2 1 2 0 0 2 2 2 0 0 1 0 2 1 1 1 1 0 2 2 2 0 2 0 2 2 0 0 0 2 0 2 2 0 2 0 0 2 0 0 1 0 1 2 1 2 2 2 2 2 2 1 1 0 2 0 2 2 1 2 2 2 0 2 2 2 1 2 1 2 0 0 1 1 2 0 1 1 2 1 2 2 0 0 0 0 1 1 2 1 1 2 1...

output:

22653

result:

ok 1 number(s): "22653"

Test #12:

score: 0
Accepted
time: 456ms
memory: 122204kb

input:

1
1000000 51
1 1 2 0 0 2 2 1 2 0 0 1 2 0 0 0 0 2 1 1 2 2 2 2 2 0 1 1 1 0 2 1 1 1 0 2 2 2 0 0 2 1 2 2 2 1 0 2 1 1 0 2 2 1 2 1 1 0 0 2 2 1 0 1 1 1 2 2 0 1 2 2 1 0 1 0 2 2 2 1 2 2 0 2 0 0 1 1 1 1 2 2 1 2 2 2 1 2 2 1 0 0 2 1 2 2 2 0 2 2 2 1 1 2 0 2 2 2 1 0 1 1 2 1 0 0 1 0 0 0 2 2 1 2 2 1 0 0 1 0 2 2 1 1...

output:

22240

result:

ok 1 number(s): "22240"

Test #13:

score: 0
Accepted
time: 436ms
memory: 107896kb

input:

1
1000000 233
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 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 ...

output:

4027

result:

ok 1 number(s): "4027"

Test #14:

score: 0
Accepted
time: 453ms
memory: 101532kb

input:

1
1000000 233
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 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 ...

output:

0

result:

ok 1 number(s): "0"

Test #15:

score: 0
Accepted
time: 432ms
memory: 100972kb

input:

1
1000000 233
2 2 2 2 2 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 1 2 1 2 2 2 2 2 2 2 2 0 2 1 2 2 0 2 2 2 2 1 0 2 2 2 2 2 1 2 2 2 2 1 2 1 0 1 2 2 2 1 2 2 2 0 2 2 2 2 2 2 2 2 2 2 2 2 2 0 2 0 2 2 2 2 2 2 2 2 2 1 2 2 2 1 2 0 2 2 2 2 0 2 2 2 0 0 2 2 2 1 2 2 2 2 2 2 2 2 1 0 2 2 2 2 1 2 1 2 2 2 2 0 2 2 2 0 2 2 2 ...

output:

6671

result:

ok 1 number(s): "6671"

Test #16:

score: 0
Accepted
time: 435ms
memory: 126360kb

input:

1
1000000 233
1 0 2 1 1 0 0 1 1 0 2 2 0 2 0 0 1 2 2 0 2 1 0 0 0 2 2 2 0 0 2 2 2 1 2 0 1 1 2 2 2 0 1 2 2 0 2 2 0 1 0 2 1 0 2 2 1 1 2 1 1 1 2 2 0 2 2 2 2 2 2 2 1 0 0 1 2 1 2 0 2 2 0 2 2 2 1 2 2 2 2 2 2 2 2 2 0 1 2 2 0 1 1 1 0 0 2 2 1 0 0 2 2 1 2 1 0 1 2 2 1 0 1 2 2 1 1 2 1 0 1 2 2 0 1 0 2 2 2 1 0 0 2 ...

output:

4979

result:

ok 1 number(s): "4979"

Test #17:

score: 0
Accepted
time: 412ms
memory: 126436kb

input:

1
1000000 233
0 0 0 0 0 0 0 1 1 1 1 1 1 0 0 1 1 0 1 0 1 0 0 0 1 0 1 1 1 2 2 1 0 2 0 1 0 1 1 0 0 1 0 0 1 1 0 1 1 1 0 1 1 0 2 0 0 0 1 1 0 0 2 2 1 1 1 0 1 0 0 2 0 0 0 1 1 2 1 0 1 0 1 1 0 2 1 1 2 1 1 0 0 1 2 2 0 1 2 1 1 0 2 1 0 1 1 1 1 1 1 1 0 1 1 2 1 1 2 1 1 1 1 1 1 1 0 0 2 1 1 0 1 0 0 1 0 0 1 0 0 1 0 ...

output:

2642

result:

ok 1 number(s): "2642"

Test #18:

score: 0
Accepted
time: 434ms
memory: 126740kb

input:

1
1000000 234
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 0 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 ...

output:

7199

result:

ok 1 number(s): "7199"

Test #19:

score: 0
Accepted
time: 426ms
memory: 97128kb

input:

1
1000000 234
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 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 ...

output:

7880

result:

ok 1 number(s): "7880"

Test #20:

score: 0
Accepted
time: 457ms
memory: 122996kb

input:

1
1000000 234
2 2 2 2 2 1 2 2 2 2 2 1 2 1 2 2 2 2 2 2 2 2 1 2 2 2 2 2 1 2 2 2 2 2 2 1 2 2 2 2 2 2 2 2 2 1 0 0 1 1 2 2 2 2 1 2 2 2 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 0 0 2 0 0 2 2 2 2 1 2 2 0 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 0 1 2 2 2 1 2 2 2 2 2 2 2 2 1 2 2 0 2 2 0 1 2 ...

output:

6655

result:

ok 1 number(s): "6655"

Test #21:

score: 0
Accepted
time: 419ms
memory: 125320kb

input:

1
1000000 234
1 0 2 2 2 2 0 2 1 0 0 2 2 1 0 1 2 1 2 2 1 2 1 1 2 0 2 0 0 0 2 2 0 0 1 2 2 0 2 2 0 0 2 2 2 2 0 2 2 0 0 0 2 0 2 0 0 0 2 1 1 0 1 2 2 2 2 2 1 2 2 0 0 0 0 0 0 1 2 0 2 2 2 0 0 1 1 0 2 2 1 2 0 2 2 0 2 0 2 1 2 2 2 1 0 2 1 1 2 2 2 2 1 2 2 1 2 2 1 2 2 0 2 0 2 2 1 2 2 0 2 0 1 0 2 1 1 2 2 0 0 0 2 ...

output:

4951

result:

ok 1 number(s): "4951"

Test #22:

score: 0
Accepted
time: 436ms
memory: 126364kb

input:

1
1000000 234
2 1 0 0 1 1 1 0 1 2 2 0 0 0 1 2 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 1 0 0 0 0 0 0 1 1 1 0 1 1 0 0 1 2 0 1 1 2 2 2 1 0 1 0 1 1 0 0 1 1 1 1 0 1 0 1 0 1 1 1 1 1 0 1 0 2 1 0 2 1 1 1 1 1 1 1 1 1 1 1 0 0 1 0 1 1 1 1 0 1 1 0 0 0 1 1 0 0 1 1 1 0 1 0 0 2 1 0 1 1 1 0 0 0 0 1 0 0 1 0 1 0 1 1 1 0 1 1 ...

output:

2640

result:

ok 1 number(s): "2640"

Test #23:

score: 0
Accepted
time: 443ms
memory: 125832kb

input:

1
1000000 23333
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 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 ...

output:

84

result:

ok 1 number(s): "84"

Test #24:

score: 0
Accepted
time: 490ms
memory: 121536kb

input:

1
1000000 23333
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 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 ...

output:

0

result:

ok 1 number(s): "0"

Test #25:

score: 0
Accepted
time: 437ms
memory: 123452kb

input:

1
1000000 23334
2 2 2 2 2 2 2 1 1 2 2 2 2 2 2 2 2 2 2 2 2 2 1 2 0 1 0 0 2 2 0 1 2 2 2 0 2 2 0 2 2 2 0 1 0 2 2 2 2 2 2 0 0 2 0 2 2 0 0 2 2 2 2 0 2 2 2 1 2 2 2 0 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 0 2 0 2 2 1 2 2 2 1 2 2 2 2 2 2 1 2 2 2 2 0 2 2 0 1 2 2 1 2 2 2 0 2 2 2 2 2 2 0 2 0 2 2 2 1 2 2 2 2 2 0 2 2 ...

output:

72

result:

ok 1 number(s): "72"

Test #26:

score: 0
Accepted
time: 433ms
memory: 126356kb

input:

1
1000000 23334
2 2 1 2 2 2 2 0 0 1 0 2 2 0 2 1 2 2 1 2 2 1 1 2 2 1 0 2 2 2 0 2 2 2 2 0 2 0 1 1 2 0 0 1 1 2 1 2 0 2 2 2 1 0 2 0 0 1 1 1 0 0 1 2 2 2 1 1 2 2 2 2 1 0 2 1 2 2 1 2 2 0 2 0 2 1 0 1 0 1 2 1 2 2 2 2 2 2 1 2 0 2 1 1 1 0 1 2 2 2 0 1 1 1 2 1 2 2 0 1 2 0 0 2 2 1 1 1 1 2 2 1 2 1 2 2 2 1 2 1 2 0 ...

output:

53

result:

ok 1 number(s): "53"

Test #27:

score: 0
Accepted
time: 407ms
memory: 124464kb

input:

1
1000000 23333
0 1 0 0 0 0 2 0 0 2 0 0 0 0 1 1 1 1 0 1 1 2 1 0 0 1 1 2 1 1 0 0 0 0 1 1 1 0 1 1 0 0 1 1 0 0 0 0 1 1 1 1 1 1 1 1 0 0 0 0 1 1 0 1 1 0 1 0 2 2 0 2 1 2 2 1 2 0 1 0 0 1 0 0 1 1 0 1 1 1 0 1 0 0 1 1 1 0 1 0 0 1 0 0 1 1 1 0 1 0 0 0 0 1 0 0 1 1 1 2 1 1 0 2 0 2 0 1 1 2 2 0 1 2 0 0 1 1 0 0 1 1 ...

output:

28

result:

ok 1 number(s): "28"

Test #28:

score: 0
Accepted
time: 439ms
memory: 125644kb

input:

1
1000000 76545
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 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 0 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 ...

output:

25

result:

ok 1 number(s): "25"

Test #29:

score: 0
Accepted
time: 407ms
memory: 126044kb

input:

1
1000000 56757
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 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 ...

output:

0

result:

ok 1 number(s): "0"

Test #30:

score: 0
Accepted
time: 399ms
memory: 124588kb

input:

1
1000000 65766
2 2 2 2 2 2 2 2 0 2 2 1 2 2 1 2 2 2 2 2 2 2 0 2 2 0 2 2 2 2 2 2 2 0 2 2 2 2 1 2 2 2 1 2 2 2 2 1 2 2 2 2 2 2 2 2 2 2 2 2 0 2 2 2 2 2 2 2 0 2 2 2 1 2 1 1 2 2 2 2 2 2 2 2 2 1 2 1 2 1 2 0 2 2 2 2 1 2 2 2 1 2 2 1 2 2 1 2 2 2 2 2 2 2 2 2 2 1 2 2 2 2 2 2 2 0 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 ...

output:

25

result:

ok 1 number(s): "25"

Test #31:

score: 0
Accepted
time: 448ms
memory: 126632kb

input:

1
1000000 99824
0 2 2 0 1 0 2 0 2 0 2 1 0 2 2 2 0 1 0 1 0 0 2 2 2 2 2 2 2 2 0 2 1 1 2 2 2 1 2 2 1 2 2 2 0 1 2 2 2 2 0 2 2 1 0 2 1 2 2 2 1 1 0 1 2 2 2 0 2 2 1 2 2 2 0 2 2 0 0 2 0 2 2 2 1 0 0 2 2 2 2 1 2 2 2 1 2 2 2 0 0 1 1 2 0 1 1 2 0 0 0 0 0 2 1 2 0 2 2 2 0 2 2 2 2 1 2 0 2 2 1 0 2 2 0 2 1 1 2 0 2 2 ...

output:

12

result:

ok 1 number(s): "12"

Test #32:

score: 0
Accepted
time: 434ms
memory: 116524kb

input:

1
1000000 43530
0 0 1 0 1 1 1 2 1 0 0 0 0 0 1 0 0 1 1 1 0 0 1 1 0 0 1 0 0 1 0 0 1 0 1 0 0 0 0 0 0 0 0 0 0 1 0 0 2 1 0 1 0 0 1 0 0 1 2 2 1 0 1 0 1 1 1 1 0 1 1 0 1 1 1 0 1 0 1 1 0 0 1 1 1 0 1 0 0 0 1 0 2 2 1 1 1 0 2 0 0 0 2 1 2 1 0 0 1 1 1 0 0 0 1 0 1 1 1 0 0 0 0 0 0 0 1 0 1 1 2 1 0 1 1 0 0 2 0 0 0 1 ...

output:

15

result:

ok 1 number(s): "15"

Test #33:

score: 0
Accepted
time: 439ms
memory: 118968kb

input:

1
1000000 233334
2 2 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 1 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 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 0 2 2...

output:

8

result:

ok 1 number(s): "8"

Test #34:

score: 0
Accepted
time: 447ms
memory: 125852kb

input:

1
1000000 233333
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 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...

output:

0

result:

ok 1 number(s): "0"

Test #35:

score: 0
Accepted
time: 413ms
memory: 126432kb

input:

1
1000000 233334
2 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 1 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 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 2 2 0 2 2 2 0 2 1 2 1 2 2 0 0 2 2 2 2 2 2 2 2 2 1 2 1 2 0 2 2 2 2 2 2 2 0 2 2 2 1 2 2 2 2 2 2 2 2 2 2 0 2 1 2 2 2 2 2 2 2 2 2 2 2...

output:

7

result:

ok 1 number(s): "7"

Test #36:

score: 0
Accepted
time: 419ms
memory: 125020kb

input:

1
1000000 233333
2 1 2 2 0 2 2 1 2 0 2 1 0 1 0 2 2 2 2 2 2 2 0 2 2 2 1 2 2 1 0 1 1 2 0 0 1 2 2 2 2 0 0 2 1 0 0 2 0 1 1 2 2 1 0 0 1 2 2 2 2 0 1 2 2 2 1 2 0 1 0 0 2 2 2 0 0 0 1 2 0 1 1 0 2 2 2 2 0 2 2 0 2 2 1 0 0 1 2 0 2 2 2 2 2 2 2 1 2 0 1 0 2 2 2 2 2 1 2 2 2 2 1 0 2 2 2 2 1 1 0 2 2 2 2 1 1 2 0 1 1 1...

output:

5

result:

ok 1 number(s): "5"

Test #37:

score: 0
Accepted
time: 453ms
memory: 98840kb

input:

1
1000000 233334
0 1 2 1 1 1 0 0 1 1 1 1 1 0 1 0 1 1 1 0 0 1 2 0 1 1 0 0 1 0 0 0 1 0 1 1 0 1 0 2 1 1 1 1 0 1 0 1 2 1 0 1 2 1 0 2 1 0 0 0 0 0 1 0 2 1 0 0 1 0 0 0 0 2 1 1 1 2 0 0 0 1 0 2 0 2 0 1 1 0 0 1 0 1 1 1 1 0 0 2 1 0 1 1 1 1 0 0 1 2 0 0 0 1 1 1 0 0 1 0 1 0 0 0 1 1 1 1 1 1 1 0 1 0 1 2 2 1 0 1 2 2...

output:

2

result:

ok 1 number(s): "2"

Test #38:

score: 0
Accepted
time: 427ms
memory: 94820kb

input:

1
1000000 131072
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 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...

output:

15

result:

ok 1 number(s): "15"

Test #39:

score: 0
Accepted
time: 453ms
memory: 125040kb

input:

1
1000000 234234
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 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...

output:

8

result:

ok 1 number(s): "8"

Test #40:

score: 0
Accepted
time: 425ms
memory: 97460kb

input:

1
1000000 456459
1 2 2 2 1 2 2 2 2 2 2 2 2 2 2 1 2 0 2 0 2 2 2 1 2 2 2 0 0 0 2 2 2 2 2 0 2 1 0 1 2 2 2 0 2 2 2 2 1 2 2 2 2 2 1 2 2 2 2 1 2 2 2 2 0 2 2 2 2 2 2 2 2 2 0 0 2 2 1 2 2 0 2 2 2 2 2 2 2 2 0 2 2 2 2 2 2 2 2 1 1 2 2 2 1 2 2 2 2 1 2 0 2 2 1 1 2 2 2 2 2 2 1 2 2 2 2 2 2 2 2 2 2 2 2 0 2 2 0 2 2 2...

output:

3

result:

ok 1 number(s): "3"

Test #41:

score: 0
Accepted
time: 450ms
memory: 124848kb

input:

1
1000000 342461
0 2 2 0 1 2 1 2 2 2 2 0 0 1 1 1 2 2 2 2 2 0 2 1 2 2 2 2 0 2 2 2 2 2 0 0 1 2 2 0 2 0 2 0 2 2 2 2 2 2 2 2 0 2 1 2 2 0 2 0 1 1 0 1 1 2 0 1 2 2 0 2 2 1 2 0 2 0 0 0 2 2 0 0 2 2 1 2 2 2 2 0 1 0 2 1 2 0 0 2 1 1 0 2 2 2 1 1 2 1 2 0 0 0 2 1 1 1 0 2 2 2 2 1 0 2 0 2 2 2 0 1 1 0 2 1 2 0 2 2 2 2...

output:

3

result:

ok 1 number(s): "3"

Test #42:

score: 0
Accepted
time: 428ms
memory: 120552kb

input:

1
1000000 633537
1 1 0 0 2 0 0 1 1 1 0 1 1 2 0 1 0 1 1 1 0 0 1 1 1 1 0 1 0 1 0 0 1 0 0 0 1 1 1 0 1 0 1 2 1 1 0 1 0 1 0 0 0 0 1 0 0 1 1 0 1 0 1 2 1 2 2 1 1 1 0 2 0 1 1 0 0 0 0 0 1 0 0 0 1 1 0 2 0 1 1 1 0 0 1 2 1 2 1 0 1 0 0 1 1 0 0 1 0 0 0 1 0 0 0 1 0 0 0 0 1 1 1 1 1 1 1 1 1 1 0 1 0 1 1 0 0 2 0 2 1 0...

output:

1

result:

ok 1 number(s): "1"

Test #43:

score: 0
Accepted
time: 448ms
memory: 95220kb

input:

1
1000000 131072
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 0 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...

output:

15

result:

ok 1 number(s): "15"

Test #44:

score: 0
Accepted
time: 421ms
memory: 108124kb

input:

1
1000000 234234
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 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...

output:

8

result:

ok 1 number(s): "8"

Test #45:

score: 0
Accepted
time: 425ms
memory: 96932kb

input:

1
1000000 456459
2 0 2 2 2 2 2 0 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 1 2 2 2 0 2 2 0 1 2 2 2 0 2 2 2 2 2 2 2 2 2 2 0 2 2 0 2 2 0 2 2 2 0 2 2 2 0 2 2 2 2 2 0 0 2 2 0 2 2 2 2 2 2 2 1 2 0 2 2 2 2 2 2 2 2 2 2 2 0 2 2 2 1 2 2 2 2 2 1 2 2 2 2 2 2 0 1 2 2 2 2 1 2 2 2 0 0 2 2 1 2 0 2 2 2 2 1 2 2 2 2 2 2 2 2 2 2 2...

output:

3

result:

ok 1 number(s): "3"

Test #46:

score: 0
Accepted
time: 451ms
memory: 102148kb

input:

1
1000000 342461
2 2 0 2 1 1 2 0 2 1 2 0 2 2 2 1 2 0 1 2 0 2 2 1 2 2 2 1 2 2 0 2 2 0 2 0 1 1 2 2 2 1 2 1 1 0 1 1 0 2 2 1 0 2 2 0 1 2 0 0 1 2 1 2 2 1 2 2 2 2 0 1 1 1 2 2 0 2 2 2 0 2 2 0 2 1 2 1 2 2 1 1 0 2 1 2 0 0 2 2 2 1 0 1 2 0 2 2 2 0 1 2 1 2 2 2 1 2 0 2 2 1 2 2 2 2 2 0 2 2 2 2 2 2 2 2 1 2 0 1 2 2...

output:

3

result:

ok 1 number(s): "3"

Test #47:

score: 0
Accepted
time: 465ms
memory: 112824kb

input:

1
1000000 633537
1 2 0 2 1 1 1 2 1 2 1 0 0 0 2 1 0 1 1 0 0 2 0 0 0 0 1 1 1 0 1 2 0 1 0 1 1 1 1 1 0 1 0 0 1 0 0 0 1 1 2 0 1 1 1 1 1 1 0 1 0 1 2 1 0 1 0 1 1 0 1 0 0 1 1 0 0 1 1 0 1 2 1 1 2 1 0 0 0 0 1 1 0 0 0 1 0 1 0 2 1 1 0 1 0 0 0 0 2 2 2 1 0 1 0 0 2 1 2 0 1 0 1 1 0 0 1 1 1 0 1 0 1 0 0 1 1 2 1 1 2 0...

output:

1

result:

ok 1 number(s): "1"

Test #48:

score: 0
Accepted
time: 446ms
memory: 125384kb

input:

1
1000000 1234567
2 2 2 0 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 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 ...

output:

1

result:

ok 1 number(s): "1"

Test #49:

score: 0
Accepted
time: 443ms
memory: 125588kb

input:

1
1000000 1234568
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 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 ...

output:

1

result:

ok 1 number(s): "1"

Test #50:

score: 0
Accepted
time: 445ms
memory: 114948kb

input:

1
1000000 1234567
0 0 0 2 2 1 2 2 2 1 2 2 1 2 2 1 2 2 2 2 2 2 0 2 2 2 2 2 2 1 2 2 1 2 0 2 2 2 2 2 2 2 2 2 1 2 0 2 1 0 2 0 0 2 0 2 2 2 2 1 2 2 2 2 0 0 2 2 1 1 2 0 1 2 2 2 2 2 2 2 2 2 2 2 2 1 2 2 2 2 2 1 2 1 2 2 2 2 2 2 1 2 2 2 2 1 2 2 1 2 2 2 2 2 1 2 1 0 2 2 2 2 2 2 2 1 1 2 2 2 2 2 2 1 1 2 2 1 2 2 0 ...

output:

1

result:

ok 1 number(s): "1"

Test #51:

score: 0
Accepted
time: 414ms
memory: 109668kb

input:

1
1000000 1234568
0 1 0 2 1 1 2 2 2 0 0 1 2 2 1 2 2 2 2 1 2 0 2 2 2 0 2 0 0 0 0 1 2 2 0 0 2 2 0 0 1 1 1 1 0 2 1 1 2 2 0 1 1 2 1 2 0 0 2 2 1 1 0 0 1 1 1 1 2 2 2 2 2 1 1 2 0 0 0 2 1 2 1 2 2 2 1 2 1 0 2 2 2 2 2 2 2 2 2 1 0 1 1 2 0 2 2 1 2 2 1 1 2 2 2 1 2 0 2 0 0 1 2 1 0 2 0 1 1 1 0 1 1 1 2 2 1 2 2 0 2 ...

output:

1

result:

ok 1 number(s): "1"

Test #52:

score: 0
Accepted
time: 430ms
memory: 126108kb

input:

1
1000000 1234567
0 0 0 0 2 0 0 0 1 1 0 1 0 0 2 0 1 1 0 0 0 0 1 0 1 1 0 0 1 0 1 0 0 1 0 1 1 1 0 1 0 1 0 1 0 1 0 0 1 0 1 1 0 1 1 1 0 0 1 2 1 0 0 1 1 0 0 2 1 0 0 1 1 0 0 1 0 1 2 0 0 0 1 1 0 1 1 1 1 0 1 0 2 0 0 2 1 0 0 1 0 0 0 1 1 0 1 1 1 0 0 1 0 2 2 0 0 2 0 1 1 0 0 1 0 0 0 2 0 1 0 1 1 0 1 1 0 1 0 1 1 ...

output:

0

result:

ok 1 number(s): "0"

Test #53:

score: 0
Accepted
time: 409ms
memory: 126432kb

input:

1
1000000 2000000
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 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 ...

output:

1

result:

ok 1 number(s): "1"

Test #54:

score: 0
Accepted
time: 274ms
memory: 66916kb

input:

1
1000000 2000000
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 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 ...

output:

1

result:

ok 1 number(s): "1"

Test #55:

score: 0
Accepted
time: 252ms
memory: 66856kb

input:

1
1000000 233
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 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 ...

output:

0

result:

ok 1 number(s): "0"

Test #56:

score: 0
Accepted
time: 268ms
memory: 66984kb

input:

1
1000000 233
0 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 0 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 ...

output:

51

result:

ok 1 number(s): "51"

Test #57:

score: 0
Accepted
time: 283ms
memory: 66960kb

input:

1
1000000 233
1 2 2 1 2 0 2 0 2 2 2 1 1 2 0 2 2 2 2 2 0 2 2 0 2 0 2 0 0 0 1 2 0 2 2 2 1 2 2 0 1 1 0 0 0 2 1 1 1 1 2 0 0 2 1 1 2 2 2 2 0 2 2 1 1 2 0 0 2 2 1 2 0 0 1 2 2 1 0 2 2 1 2 2 0 2 0 1 2 2 2 1 1 1 2 0 2 2 2 0 0 0 2 2 2 2 0 2 0 2 1 0 2 1 0 2 2 2 0 2 2 0 0 1 1 0 1 2 2 1 2 1 1 2 1 2 2 1 2 1 0 1 0 ...

output:

64

result:

ok 1 number(s): "64"

Test #58:

score: 0
Accepted
time: 247ms
memory: 66984kb

input:

1
1000000 234
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 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 ...

output:

96

result:

ok 1 number(s): "96"

Test #59:

score: 0
Accepted
time: 288ms
memory: 66924kb

input:

1
1000000 234
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 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 0 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 ...

output:

83

result:

ok 1 number(s): "83"

Test #60:

score: 0
Accepted
time: 286ms
memory: 66988kb

input:

1
1000000 234
2 1 2 2 0 2 2 2 0 2 2 2 2 2 2 2 2 0 2 2 2 1 2 2 0 1 2 1 2 0 1 2 0 0 1 2 0 0 0 1 2 1 0 1 2 2 2 2 0 2 2 2 0 0 0 2 0 1 2 1 0 2 0 2 0 2 0 2 2 2 2 2 0 0 0 2 2 0 1 1 1 0 2 2 1 2 2 2 1 1 0 0 1 1 2 1 1 1 0 2 0 2 2 1 1 2 2 0 1 2 2 0 2 1 2 0 1 0 2 2 2 2 2 2 2 1 2 1 2 2 2 2 2 2 0 2 2 1 1 0 1 2 2 ...

output:

64

result:

ok 1 number(s): "64"

Test #61:

score: 0
Accepted
time: 266ms
memory: 66912kb

input:

1
1000000 34567
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 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 ...

output:

0

result:

ok 1 number(s): "0"

Test #62:

score: 0
Accepted
time: 297ms
memory: 66900kb

input:

1
1000000 34567
0 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 0 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 2 2 2 2 ...

output:

11

result:

ok 1 number(s): "11"

Test #63:

score: 0
Accepted
time: 269ms
memory: 66920kb

input:

1
1000000 34567
0 2 0 2 1 0 2 0 1 0 2 2 2 0 1 0 2 2 0 2 2 0 1 1 2 0 1 2 2 2 2 2 2 1 2 1 0 2 2 0 2 2 0 0 1 2 0 1 2 1 1 2 0 2 2 2 2 2 0 2 2 2 2 2 2 0 0 0 2 1 1 2 1 0 2 0 2 2 2 1 2 2 2 0 2 2 0 1 0 2 0 0 0 2 2 2 2 0 2 1 2 2 1 2 1 1 0 2 0 2 2 2 0 2 2 2 0 0 2 0 0 2 2 2 1 2 2 1 2 1 0 2 0 2 1 0 2 1 2 0 2 2 ...

output:

10

result:

ok 1 number(s): "10"

Test #64:

score: 0
Accepted
time: 233ms
memory: 66868kb

input:

1
1000000 34568
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 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 ...

output:

11

result:

ok 1 number(s): "11"

Test #65:

score: 0
Accepted
time: 274ms
memory: 66880kb

input:

1
1000000 34568
2 2 2 2 2 2 1 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 0 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 ...

output:

11

result:

ok 1 number(s): "11"

Test #66:

score: 0
Accepted
time: 307ms
memory: 66988kb

input:

1
1000000 34568
1 0 1 1 2 2 2 0 0 1 2 2 0 1 0 2 2 2 0 0 2 1 2 2 2 1 0 0 2 0 2 1 0 1 0 2 2 2 2 2 1 2 0 2 0 2 2 1 2 2 0 0 1 0 1 0 2 0 0 2 1 1 0 1 2 1 1 2 2 0 2 0 2 0 0 1 2 1 2 2 2 0 0 0 0 2 0 2 0 2 2 2 1 2 2 2 0 2 1 2 2 2 2 2 2 0 1 2 0 1 2 2 0 2 2 0 2 1 0 1 2 2 1 2 0 2 0 2 2 0 0 2 1 0 2 1 2 2 1 1 2 0 ...

output:

10

result:

ok 1 number(s): "10"

Test #67:

score: 0
Accepted
time: 268ms
memory: 67004kb

input:

1
1000000 432576
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 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...

output:

3

result:

ok 1 number(s): "3"

Test #68:

score: 0
Accepted
time: 267ms
memory: 66940kb

input:

1
1000000 432576
2 2 2 2 2 2 2 2 2 2 2 2 2 2 0 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 2 2 2 2 2 2 2 2 0 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...

output:

3

result:

ok 1 number(s): "3"

Test #69:

score: 0
Accepted
time: 243ms
memory: 66904kb

input:

1
1000000 432576
2 0 2 0 0 1 2 1 2 1 2 2 1 2 0 2 2 2 0 2 1 0 1 2 2 2 2 2 0 2 2 2 1 1 1 2 2 2 2 1 1 2 2 2 2 1 2 0 2 1 2 1 2 0 1 2 1 2 1 2 2 2 2 2 1 2 0 1 2 2 0 2 2 2 1 2 2 2 2 2 2 2 2 0 1 0 0 0 1 1 2 2 2 2 2 2 2 2 2 0 2 2 0 0 0 0 1 1 2 2 2 1 2 2 2 1 2 2 2 2 1 0 2 2 1 2 1 0 2 0 2 0 2 1 1 2 0 2 2 1 2 0...

output:

2

result:

ok 1 number(s): "2"

Test #70:

score: 0
Accepted
time: 265ms
memory: 66888kb

input:

1
1000000 432577
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 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...

output:

0

result:

ok 1 number(s): "0"

Test #71:

score: 0
Accepted
time: 307ms
memory: 66952kb

input:

1
1000000 432577
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 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 1 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 2 2 2 2 2 2 2 2 2 2 2 2 2...

output:

3

result:

ok 1 number(s): "3"

Test #72:

score: 0
Accepted
time: 260ms
memory: 66924kb

input:

1
1000000 432577
2 1 2 0 2 1 1 2 0 0 0 2 0 2 1 2 2 1 2 2 2 2 1 0 2 1 0 2 2 0 2 0 2 1 2 0 2 0 0 0 1 2 2 0 0 2 2 2 1 2 2 0 0 0 0 1 1 1 0 0 2 2 2 0 1 2 0 0 0 0 2 1 2 1 0 1 1 2 2 2 1 0 2 1 2 2 0 2 2 2 2 1 0 2 1 2 2 2 2 1 0 1 0 0 2 2 1 2 2 2 0 2 1 2 1 1 2 2 0 2 2 0 2 0 1 2 2 1 1 2 2 2 0 2 2 1 0 0 0 2 1 2...

output:

2

result:

ok 1 number(s): "2"

Test #73:

score: 0
Accepted
time: 264ms
memory: 66852kb

input:

1
1000000 876868
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 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...

output:

2

result:

ok 1 number(s): "2"

Test #74:

score: 0
Accepted
time: 279ms
memory: 67036kb

input:

1
1000000 876868
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 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 0 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...

output:

2

result:

ok 1 number(s): "2"

Test #75:

score: 0
Accepted
time: 278ms
memory: 66984kb

input:

1
1000000 876868
1 2 0 0 0 1 2 1 2 2 1 2 2 0 0 1 0 1 0 2 0 1 0 2 2 1 2 2 1 2 2 2 0 2 2 2 2 2 1 2 1 0 1 2 0 0 1 2 1 0 2 1 2 0 2 2 2 2 2 0 1 0 1 2 1 1 2 2 1 1 2 2 1 2 2 1 2 1 0 2 2 2 0 0 0 2 1 2 2 2 2 1 1 2 1 1 2 0 1 1 2 0 0 0 2 0 2 2 2 0 2 0 1 2 2 2 2 2 2 2 1 2 2 2 0 1 2 1 2 1 2 2 0 2 2 2 1 0 1 2 2 2...

output:

1

result:

ok 1 number(s): "1"

Test #76:

score: 0
Accepted
time: 246ms
memory: 66952kb

input:

1
1000000 876869
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 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...

output:

0

result:

ok 1 number(s): "0"

Test #77:

score: 0
Accepted
time: 261ms
memory: 66900kb

input:

1
1000000 876869
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 0 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 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...

output:

2

result:

ok 1 number(s): "2"

Test #78:

score: 0
Accepted
time: 329ms
memory: 66876kb

input:

1
1000000 876869
0 2 1 2 2 2 0 1 2 2 2 0 2 0 2 2 1 2 1 1 0 2 0 0 1 2 2 2 0 2 0 2 2 2 2 2 2 2 0 2 1 2 2 2 1 1 2 0 0 2 2 2 2 2 2 2 1 2 2 2 0 2 2 1 2 2 1 2 0 1 1 2 2 2 2 2 1 2 2 2 2 2 2 0 0 1 1 2 0 1 1 2 2 1 1 0 2 2 2 2 1 1 2 2 2 2 2 2 2 2 2 1 2 0 1 2 0 2 1 0 0 2 0 2 0 1 2 2 2 0 1 1 0 1 1 0 1 1 1 2 1 0...

output:

1

result:

ok 1 number(s): "1"

Test #79:

score: 0
Accepted
time: 314ms
memory: 66888kb

input:

1
1000000 876869
1 1 1 0 1 0 0 1 1 0 1 1 0 0 0 1 1 0 0 0 0 0 0 1 1 1 1 1 1 0 0 0 0 0 0 0 1 0 1 1 1 1 1 0 0 0 1 0 0 0 0 1 0 0 0 1 1 1 1 0 1 0 1 1 1 0 1 0 1 0 0 0 1 1 1 1 0 0 0 1 1 1 1 0 1 0 1 1 0 0 0 0 0 1 0 1 0 1 0 0 1 1 1 0 1 1 1 1 0 1 0 0 1 0 1 1 1 0 1 0 0 0 0 1 0 0 0 0 0 1 0 1 1 2 1 1 1 1 0 0 1 1...

output:

0

result:

ok 1 number(s): "0"

Test #80:

score: 0
Accepted
time: 322ms
memory: 66984kb

input:

1
1000000 876869
0 1 0 2 2 2 1 0 0 0 1 0 1 1 0 0 1 2 2 1 0 1 1 0 0 0 0 2 0 1 1 0 1 0 0 0 2 0 1 1 1 1 0 0 1 2 1 0 0 1 2 1 1 0 0 0 1 0 0 0 1 2 1 0 1 1 0 1 0 0 1 1 2 2 0 2 1 1 0 1 0 1 1 1 1 2 1 1 0 1 0 0 0 1 2 1 1 2 1 1 1 1 1 2 2 0 0 0 0 2 0 1 1 0 0 0 0 0 1 0 1 0 1 1 1 1 0 2 0 1 0 0 2 2 0 1 0 1 1 1 2 1...

output:

0

result:

ok 1 number(s): "0"

Test #81:

score: 0
Accepted
time: 264ms
memory: 66956kb

input:

1
1000000 876869
0 0 0 0 0 1 0 0 1 1 1 1 0 1 0 0 1 1 0 0 0 0 1 0 0 0 0 0 0 0 1 1 0 0 1 0 1 0 1 0 0 1 1 0 0 1 0 1 1 1 1 0 1 0 1 1 0 0 0 1 1 1 1 1 0 0 1 0 1 0 0 1 1 1 2 2 0 2 1 0 0 1 1 0 0 0 1 1 1 1 1 0 0 0 0 0 1 1 0 0 1 0 0 0 1 0 0 0 2 0 0 0 1 1 2 0 1 1 1 1 0 1 0 0 1 1 1 0 0 0 1 0 0 0 0 0 1 0 1 1 0 0...

output:

0

result:

ok 1 number(s): "0"

Test #82:

score: 0
Accepted
time: 0ms
memory: 3824kb

input:

12
2 2000000
1 0
1 2
2 2000000
1 1
2 1
2 2000000
1 2
2 1
1 2000000
0
1 2000000
1
2 2000000
2 0
1 2
2 2000000
2 1
2 1
2 2000000
2 2
2 1
1 2000000
2
2 2000000
0 0
1 2
2 2000000
0 1
2 1
2 2000000
0 2
2 1

output:

0
0
0
0
0
0
0
0
0
0
0
0

result:

ok 12 numbers

Test #83:

score: 0
Accepted
time: 152ms
memory: 3492kb

input:

200000
5 1914575
0 1 1 1 0
3 4
5 3
3 2
4 1
5 996221
1 0 1 1 0
2 3
2 5
4 1
1 2
5 723492
0 0 1 1 1
5 1
5 4
3 4
4 2
5 1189770
1 1 2 0 0
5 2
1 5
4 5
3 5
5 1469525
1 0 0 1 0
4 1
1 5
3 1
3 2
5 76763
1 0 1 1 0
1 3
2 5
5 3
3 4
5 407965
1 2 0 0 0
1 4
2 1
2 5
5 3
5 429447
0 1 0 0 0
1 3
4 1
4 5
2 1
5 765063
0 ...

output:

0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
...

result:

ok 200000 numbers

Test #84:

score: 0
Accepted
time: 231ms
memory: 65576kb

input:

100001
500000 36426
1 0 2 2 1 2 0 0 0 2 1 2 1 2 2 1 2 2 2 1 1 2 0 0 2 2 0 0 1 0 2 2 2 2 2 0 2 2 0 2 2 2 2 1 2 0 2 0 2 2 0 0 1 1 2 0 2 0 1 0 0 2 2 2 1 2 2 2 1 2 0 1 0 2 0 2 2 2 2 1 2 2 0 0 0 2 0 0 1 2 0 2 2 2 2 2 0 1 0 1 2 0 2 1 1 1 2 1 2 0 0 2 2 0 1 1 1 2 2 1 0 0 2 0 1 2 1 2 2 2 0 0 2 2 0 0 2 1 2 1 ...

output:

17
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0...

result:

ok 100001 numbers

Test #85:

score: 0
Accepted
time: 197ms
memory: 3616kb

input:

1000000
1 260522
0
1 1933447
0
1 1963982
1
1 895728
0
1 539679
1
1 287940
1
1 823355
1
1 1374934
1
1 1195922
1
1 284691
1
1 1381221
0
1 1229302
0
1 870607
0
1 1187475
1
1 1207354
0
1 1751951
0
1 472167
1
1 1976483
0
1 56553
0
1 309279
0
1 1708200
1
1 1226467
1
1 661473
0
1 383718
1
1 986530
1
1 1508...

output:

0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
...

result:

ok 1000000 numbers

Extra Test:

score: 0
Extra Test Passed