QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#248517#7684. Sweet Sugarucup-team456#AC ✓639ms172584kbC++202.1kb2023-11-11 19:40:452023-11-11 19:40:46

詳細信息

Test #1:

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

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: 3656kb

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: 187ms
memory: 3576kb

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: 191ms
memory: 3640kb

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: 210ms
memory: 3680kb

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: 3652kb

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: 218ms
memory: 3700kb

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: 230ms
memory: 4656kb

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: 310ms
memory: 14240kb

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: 587ms
memory: 169840kb

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: 595ms
memory: 142360kb

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: 594ms
memory: 167300kb

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: 604ms
memory: 149204kb

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: 554ms
memory: 141012kb

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: 591ms
memory: 140416kb

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: 565ms
memory: 171900kb

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: 585ms
memory: 172252kb

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: 587ms
memory: 172584kb

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: 580ms
memory: 135812kb

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: 593ms
memory: 168092kb

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: 592ms
memory: 170972kb

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: 574ms
memory: 172120kb

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: 566ms
memory: 171336kb

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: 599ms
memory: 166080kb

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: 573ms
memory: 168544kb

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: 577ms
memory: 172128kb

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: 600ms
memory: 169988kb

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: 561ms
memory: 171344kb

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: 582ms
memory: 171572kb

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: 559ms
memory: 169516kb

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: 598ms
memory: 172156kb

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: 576ms
memory: 159764kb

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: 567ms
memory: 163052kb

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: 593ms
memory: 171564kb

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: 550ms
memory: 172292kb

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: 573ms
memory: 170396kb

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: 609ms
memory: 137520kb

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: 629ms
memory: 132712kb

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: 553ms
memory: 170328kb

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: 572ms
memory: 135808kb

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: 575ms
memory: 170068kb

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: 639ms
memory: 164856kb

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: 606ms
memory: 134684kb

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: 602ms
memory: 150756kb

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: 581ms
memory: 136764kb

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: 608ms
memory: 143620kb

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: 624ms
memory: 157008kb

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: 621ms
memory: 170856kb

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: 573ms
memory: 171100kb

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: 575ms
memory: 157888kb

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: 582ms
memory: 151248kb

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: 594ms
memory: 171572kb

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: 635ms
memory: 172228kb

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: 464ms
memory: 98436kb

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: 462ms
memory: 98600kb

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: 461ms
memory: 98572kb

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: 465ms
memory: 98328kb

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: 443ms
memory: 98636kb

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: 467ms
memory: 98504kb

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: 459ms
memory: 98448kb

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: 468ms
memory: 98516kb

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: 471ms
memory: 98372kb

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: 437ms
memory: 98508kb

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: 426ms
memory: 98436kb

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: 449ms
memory: 98460kb

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: 431ms
memory: 98536kb

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: 441ms
memory: 98640kb

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: 432ms
memory: 98648kb

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: 444ms
memory: 98424kb

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: 427ms
memory: 98412kb

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: 479ms
memory: 98420kb

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: 447ms
memory: 98412kb

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: 440ms
memory: 98512kb

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: 436ms
memory: 98572kb

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: 439ms
memory: 98636kb

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: 422ms
memory: 98376kb

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: 438ms
memory: 98488kb

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: 482ms
memory: 98356kb

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: 460ms
memory: 98476kb

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: 454ms
memory: 98276kb

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: 411ms
memory: 98476kb

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: 3820kb

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: 185ms
memory: 3832kb

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: 338ms
memory: 88456kb

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: 230ms
memory: 3668kb

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