QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#38229#840. Just CountingZhangYiDeRE 99ms8740kbC++111.5kb2022-07-04 19:51:262022-07-04 19:51:29

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 2ms
memory: 7812kb

input:

3
1 0
3 3
1 2
2 3
3 1
4 4
1 2
2 3
3 4
4 1

output:

1
1
5

result:

ok 3 number(s): "1 1 5"

Test #2:

score: 0
Accepted
time: 99ms
memory: 7880kb

input:

500000
1 0
1 0
1 0
1 0
1 0
1 0
1 0
1 0
1 0
1 0
1 0
1 0
1 0
1 0
1 0
1 0
1 0
1 0
1 0
1 0
1 0
1 0
1 0
1 0
1 0
1 0
1 0
1 0
1 0
1 0
1 0
1 0
1 0
1 0
1 0
1 0
1 0
1 0
1 0
1 0
1 0
1 0
1 0
1 0
1 0
1 0
1 0
1 0
1 0
1 0
1 0
1 0
1 0
1 0
1 0
1 0
1 0
1 0
1 0
1 0
1 0
1 0
1 0
1 0
1 0
1 0
1 0
1 0
1 0
1 0
1 0
1 0
1 0
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
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
...

result:

ok 500000 numbers

Test #3:

score: 0
Accepted
time: 68ms
memory: 8420kb

input:

250000
2 0
2 0
2 0
2 0
2 0
2 0
2 0
2 0
2 0
2 0
2 0
2 0
2 0
2 0
2 0
2 0
2 0
2 0
2 0
2 0
2 0
2 0
2 0
2 0
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
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
...

result:

ok 166666 numbers

Test #5:

score: 0
Accepted
time: 51ms
memory: 8216kb

input:

166666
3 0
3 0
3 0
3 0
3 0
3 0
3 0
3 0
3 0
3 0
3 0
3 0
3 0
3 0
3 0
3 0
3 0
3 0
3 0
3 0
3 0
3 0
3 0
3 0
3 0
3 0
3 0
3 0
3 0
3 0
3 0
3 0
3 0
3 0
3 0
3 0
3 0
3 0
3 0
3 0
3 0
3 0
3 0
3 0
3 0
3 0
3 0
3 0
3 0
3 0
3 0
3 0
3 0
3 0
3 0
3 0
3 0
3 0
3 0
3 0
3 0
3 0
3 0
3 0
3 0
3 0
3 0
3 0
3 0
3 0
3 0
3 0
3 0
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
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
...

result:

ok 166666 numbers

Test #6:

score: 0
Accepted
time: 56ms
memory: 7932kb

input:

125000
3 1
1 2
3 1
2 3
3 1
1 2
3 1
1 2
3 1
2 3
3 1
1 2
3 1
2 3
3 1
1 3
3 1
1 2
3 1
1 2
3 1
1 2
3 1
1 3
3 1
1 3
3 1
2 3
3 1
1 2
3 1
2 3
3 1
1 2
3 1
1 3
3 1
1 3
3 1
1 3
3 1
1 2
3 1
1 2
3 1
1 2
3 1
1 3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1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
...

result:

ok 100000 numbers

Test #8:

score: 0
Accepted
time: 52ms
memory: 8616kb

input:

83333
3 3
1 3
2 3
1 2
3 3
1 3
1 2
2 3
3 3
2 3
1 2
1 3
3 3
1 3
2 3
1 2
3 3
1 2
2 3
1 3
3 3
1 3
2 3
1 2
3 3
2 3
1 2
1 3
3 3
2 3
1 2
1 3
3 3
2 3
1 2
1 3
3 3
2 3
1 2
1 3
3 3
1 2
1 3
2 3
3 3
2 3
1 2
1 3
3 3
2 3
1 3
1 2
3 3
1 3
2 3
1 2
3 3
2 3
1 2
1 3
3 3
1 3
2 3
1 2
3 3
1 3
1 2
2 3
3 3
1 3
2 3
1 2
3 3
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
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
...

result:

ok 83333 numbers

Test #9:

score: 0
Accepted
time: 43ms
memory: 8320kb

input:

125000
4 0
4 0
4 0
4 0
4 0
4 0
4 0
4 0
4 0
4 0
4 0
4 0
4 0
4 0
4 0
4 0
4 0
4 0
4 0
4 0
4 0
4 0
4 0
4 0
4 0
4 0
4 0
4 0
4 0
4 0
4 0
4 0
4 0
4 0
4 0
4 0
4 0
4 0
4 0
4 0
4 0
4 0
4 0
4 0
4 0
4 0
4 0
4 0
4 0
4 0
4 0
4 0
4 0
4 0
4 0
4 0
4 0
4 0
4 0
4 0
4 0
4 0
4 0
4 0
4 0
4 0
4 0
4 0
4 0
4 0
4 0
4 0
4 0
4...

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
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
...

result:

ok 125000 numbers

Test #10:

score: 0
Accepted
time: 36ms
memory: 7880kb

input:

100000
4 1
2 4
4 1
1 4
4 1
3 4
4 1
3 4
4 1
1 2
4 1
2 4
4 1
1 3
4 1
1 2
4 1
1 4
4 1
2 4
4 1
1 4
4 1
3 4
4 1
1 3
4 1
1 2
4 1
3 4
4 1
3 4
4 1
1 4
4 1
1 4
4 1
1 2
4 1
1 3
4 1
3 4
4 1
1 3
4 1
1 2
4 1
1 3
4 1
1 3
4 1
2 4
4 1
1 3
4 1
1 4
4 1
2 4
4 1
1 3
4 1
1 3
4 1
3 4
4 1
1 2
4 1
1 4
4 1
2 4
4 1
1 2
4 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
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
...

result:

ok 100000 numbers

Test #11:

score: 0
Accepted
time: 50ms
memory: 7852kb

input:

83333
4 2
1 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
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
...

result:

ok 71428 numbers

Test #13:

score: 0
Accepted
time: 45ms
memory: 7980kb

input:

62500
4 4
1 2
1 3
2 3
3 4
4 4
1 3
2 3
2 4
3 4
4 4
2 4
1 3
3 4
1 2
4 4
1 4
1 2
3 4
2 4
4 4
1 4
2 4
1 3
2 3
4 4
2 4
1 3
1 4
1 2
4 4
1 2
3 4
1 4
2 4
4 4
2 3
3 4
1 3
1 4
4 4
1 4
2 4
1 3
2 3
4 4
3 4
1 2
2 4
1 3
4 4
2 3
2 4
3 4
1 3
4 4
1 3
1 4
3 4
2 3
4 4
2 4
1 4
1 3
2 3
4 4
2 4
3 4
1 4
2 3
4 4
1 2
1 3
1 ...

output:

1
1
5
1
5
1
1
1
5
5
1
1
5
1
1
1
5
1
1
1
1
1
1
5
1
1
5
1
1
1
5
1
1
5
1
1
1
5
1
1
1
1
1
1
1
1
1
1
1
5
1
1
1
1
1
1
1
5
5
1
1
5
1
5
5
1
1
1
5
1
5
1
1
1
1
1
1
1
5
5
5
1
1
5
5
1
1
1
1
5
1
5
5
1
1
1
1
1
1
1
1
1
1
1
1
1
1
5
1
1
1
1
1
5
1
5
1
1
5
5
1
1
1
5
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
5
1
1
1
1
1
1
5
5
1
1
...

result:

ok 62500 numbers

Test #14:

score: 0
Accepted
time: 40ms
memory: 8376kb

input:

55555
4 5
1 3
2 4
2 3
1 4
3 4
4 5
2 4
3 4
1 4
2 3
1 3
4 5
1 2
3 4
1 4
2 3
1 3
4 5
2 4
1 4
1 3
2 3
3 4
4 5
3 4
1 2
1 3
2 4
2 3
4 5
1 2
1 3
3 4
1 4
2 4
4 5
1 3
1 4
2 3
3 4
2 4
4 5
1 3
1 2
3 4
2 4
1 4
4 5
1 3
2 4
3 4
1 2
2 3
4 5
1 3
3 4
1 2
2 3
1 4
4 5
1 3
1 4
3 4
1 2
2 3
4 5
1 3
2 4
1 4
2 3
1 2
4 5
3 ...

output:

5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
...

result:

ok 55555 numbers

Test #15:

score: 0
Accepted
time: 44ms
memory: 7880kb

input:

50000
4 6
1 3
2 4
1 4
3 4
1 2
2 3
4 6
1 3
1 4
1 2
3 4
2 4
2 3
4 6
1 4
2 3
2 4
3 4
1 3
1 2
4 6
2 4
2 3
1 2
3 4
1 4
1 3
4 6
1 3
1 4
3 4
2 4
1 2
2 3
4 6
2 3
2 4
3 4
1 2
1 3
1 4
4 6
1 3
2 3
3 4
1 4
2 4
1 2
4 6
1 4
2 4
1 3
3 4
1 2
2 3
4 6
3 4
1 4
1 3
1 2
2 3
2 4
4 6
2 4
2 3
3 4
1 3
1 4
1 2
4 6
1 4
1 3
2 ...

output:

25
25
25
25
25
25
25
25
25
25
25
25
25
25
25
25
25
25
25
25
25
25
25
25
25
25
25
25
25
25
25
25
25
25
25
25
25
25
25
25
25
25
25
25
25
25
25
25
25
25
25
25
25
25
25
25
25
25
25
25
25
25
25
25
25
25
25
25
25
25
25
25
25
25
25
25
25
25
25
25
25
25
25
25
25
25
25
25
25
25
25
25
25
25
25
25
25
25
25
25
...

result:

ok 50000 numbers

Test #16:

score: 0
Accepted
time: 42ms
memory: 8376kb

input:

100000
5 0
5 0
5 0
5 0
5 0
5 0
5 0
5 0
5 0
5 0
5 0
5 0
5 0
5 0
5 0
5 0
5 0
5 0
5 0
5 0
5 0
5 0
5 0
5 0
5 0
5 0
5 0
5 0
5 0
5 0
5 0
5 0
5 0
5 0
5 0
5 0
5 0
5 0
5 0
5 0
5 0
5 0
5 0
5 0
5 0
5 0
5 0
5 0
5 0
5 0
5 0
5 0
5 0
5 0
5 0
5 0
5 0
5 0
5 0
5 0
5 0
5 0
5 0
5 0
5 0
5 0
5 0
5 0
5 0
5 0
5 0
5 0
5 0
5...

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
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
...

result:

ok 100000 numbers

Test #17:

score: 0
Accepted
time: 41ms
memory: 7856kb

input:

83333
5 1
1 2
5 1
1 3
5 1
2 5
5 1
1 3
5 1
1 2
5 1
1 5
5 1
1 5
5 1
1 2
5 1
3 4
5 1
3 5
5 1
2 5
5 1
2 4
5 1
1 2
5 1
4 5
5 1
1 2
5 1
1 5
5 1
1 4
5 1
3 4
5 1
2 5
5 1
2 5
5 1
2 5
5 1
2 4
5 1
3 4
5 1
2 3
5 1
1 3
5 1
4 5
5 1
1 3
5 1
1 3
5 1
1 4
5 1
1 2
5 1
2 5
5 1
1 5
5 1
1 2
5 1
4 5
5 1
1 4
5 1
1 4
5 1
2 ...

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
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
...

result:

ok 83333 numbers

Test #18:

score: 0
Accepted
time: 41ms
memory: 8004kb

input:

71428
5 2
2 5
2 4
5 2
2 3
1 3
5 2
3 4
1 2
5 2
1 3
1 4
5 2
1 2
2 3
5 2
3 5
3 4
5 2
2 3
2 5
5 2
1 5
2 5
5 2
1 4
2 3
5 2
1 2
4 5
5 2
1 4
1 5
5 2
1 4
3 5
5 2
3 4
1 3
5 2
3 4
1 2
5 2
1 5
1 2
5 2
2 4
2 3
5 2
3 4
3 5
5 2
2 3
2 4
5 2
2 4
1 4
5 2
2 4
1 3
5 2
1 5
3 4
5 2
1 2
2 5
5 2
1 2
1 3
5 2
4 5
1 5
5 2
2 ...

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
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
...

result:

ok 71428 numbers

Test #19:

score: 0
Accepted
time: 41ms
memory: 8188kb

input:

62500
5 3
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
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
5
1
1
1
1
1
1
1
1
1
1
1
1
1
5
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
5
1
1
1
5
1
1
1
1
1
1
1
1
5
1
1
...

result:

ok 55555 numbers

Test #21:

score: 0
Accepted
time: 42ms
memory: 7948kb

input:

50000
5 5
2 4
2 5
1 4
1 2
4 5
5 5
1 2
3 5
2 5
3 4
1 4
5 5
2 4
3 4
2 3
1 5
3 5
5 5
3 4
3 5
2 3
1 5
2 4
5 5
2 4
3 4
1 2
2 5
1 3
5 5
1 2
2 4
1 3
2 5
2 3
5 5
4 5
3 5
2 4
1 2
3 4
5 5
1 3
1 5
2 4
3 5
1 4
5 5
1 3
2 5
2 4
1 4
4 5
5 5
2 3
1 5
3 5
1 4
3 4
5 5
2 3
2 5
4 5
3 5
1 5
5 5
3 4
2 5
2 4
1 3
1 2
5 5
2 ...

output:

5
1
1
1
5
1
1
1
1
5
1
5
1
1
1
1
5
1
1
1
1
5
1
1
1
5
5
1
5
1
1
5
5
1
1
5
5
5
1
5
5
1
1
5
1
5
5
5
1
1
1
1
1
1
5
1
1
1
5
5
5
1
5
1
1
1
1
1
1
5
1
1
5
5
5
5
1
1
1
5
1
1
1
1
1
1
5
5
5
1
1
1
1
5
5
1
1
5
1
5
1
1
5
1
5
5
1
1
1
5
5
5
5
5
1
5
1
1
1
1
5
5
5
5
1
1
1
1
1
5
5
1
5
5
1
1
5
5
1
5
1
1
1
5
5
5
5
1
1
1
...

result:

ok 50000 numbers

Test #22:

score: 0
Accepted
time: 41ms
memory: 8316kb

input:

45454
5 6
2 4
1 3
1 4
2 3
2 5
1 2
5 6
1 4
1 2
1 5
2 5
1 3
3 4
5 6
4 5
1 4
2 4
2 3
3 5
1 2
5 6
2 4
2 3
1 4
1 3
2 5
3 4
5 6
2 3
1 3
1 5
3 4
2 4
4 5
5 6
2 3
1 3
1 2
3 4
4 5
1 4
5 6
1 4
1 2
1 5
3 4
3 5
2 3
5 6
4 5
2 3
1 4
1 5
1 2
1 3
5 6
3 4
2 5
1 3
1 2
2 4
2 3
5 6
3 4
4 5
1 5
1 3
2 4
3 5
5 6
2 5
1 3
2 ...

output:

5
5
5
5
5
5
25
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
25
5
5
5
5
25
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
25
5
5
5
25
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
25
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
25
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
25
5
5
5
5
5
5
5
5
5
5
5
5
5
25
5
5
5
5
5
5
25
5
25
5
25
5
5
5
5
25...

result:

ok 45454 numbers

Test #23:

score: 0
Accepted
time: 43ms
memory: 8404kb

input:

41666
5 7
3 4
2 3
2 4
1 3
4 5
1 4
3 5
5 7
1 4
4 5
1 3
2 3
2 5
1 2
3 4
5 7
4 5
2 3
1 2
1 3
1 5
2 5
3 4
5 7
1 2
1 4
3 5
1 5
4 5
2 4
1 3
5 7
1 3
1 2
3 5
2 5
2 4
4 5
1 5
5 7
3 5
4 5
1 5
1 3
2 3
1 4
2 4
5 7
1 3
1 5
3 4
3 5
2 4
2 3
1 2
5 7
2 3
4 5
2 5
3 5
3 4
1 5
2 4
5 7
2 5
2 4
1 2
3 5
1 3
2 3
1 4
5 7
1 ...

output:

25
25
25
25
25
25
25
25
25
25
25
25
25
25
25
25
25
25
25
25
25
25
25
25
25
25
25
25
25
25
25
25
25
25
25
25
25
25
25
25
25
25
25
25
25
25
25
25
25
25
25
25
25
25
25
25
25
25
25
25
25
25
25
25
25
25
25
25
25
25
25
25
25
25
25
25
25
25
25
25
25
25
25
25
25
25
25
25
25
25
25
25
25
25
25
25
25
25
25
25
...

result:

ok 41666 numbers

Test #24:

score: 0
Accepted
time: 39ms
memory: 8516kb

input:

38461
5 8
2 3
1 5
2 4
1 3
3 5
1 2
3 4
2 5
5 8
3 5
2 4
4 5
3 4
1 4
1 2
2 5
1 5
5 8
1 3
1 5
2 3
3 5
4 5
3 4
2 4
2 5
5 8
2 5
3 4
1 5
2 4
4 5
1 3
3 5
2 3
5 8
3 4
4 5
1 3
2 4
1 2
2 5
1 5
2 3
5 8
1 3
3 5
1 5
1 2
2 4
4 5
2 3
1 4
5 8
2 5
4 5
1 2
3 4
1 3
2 3
1 4
2 4
5 8
1 2
2 5
3 5
1 4
3 4
2 4
1 3
4 5
5 8
4 ...

output:

125
125
125
125
125
125
125
125
125
125
125
125
125
125
125
125
125
125
125
125
125
125
125
125
125
125
125
125
125
125
125
125
125
125
125
125
125
125
125
125
125
125
125
125
125
125
125
125
125
125
125
125
125
125
125
125
125
125
125
125
125
125
125
125
125
125
125
125
125
125
125
125
125
125
125
...

result:

ok 38461 numbers

Test #25:

score: 0
Accepted
time: 44ms
memory: 7860kb

input:

35714
5 9
2 5
1 4
3 5
1 5
2 3
4 5
2 4
1 3
3 4
5 9
1 3
2 5
3 4
1 2
2 4
1 4
1 5
4 5
2 3
5 9
3 5
1 5
1 4
1 3
3 4
1 2
2 4
2 5
4 5
5 9
1 3
1 5
3 5
4 5
3 4
2 4
2 5
2 3
1 4
5 9
4 5
1 3
2 5
2 3
3 4
2 4
1 2
1 4
1 5
5 9
2 3
3 5
1 2
1 4
2 4
4 5
1 3
3 4
1 5
5 9
2 3
2 5
1 4
2 4
1 2
1 3
3 4
4 5
1 5
5 9
1 2
2 5
3 ...

output:

625
625
625
625
625
625
625
625
625
625
625
625
625
625
625
625
625
625
625
625
625
625
625
625
625
625
625
625
625
625
625
625
625
625
625
625
625
625
625
625
625
625
625
625
625
625
625
625
625
625
625
625
625
625
625
625
625
625
625
625
625
625
625
625
625
625
625
625
625
625
625
625
625
625
625
...

result:

ok 35714 numbers

Test #26:

score: 0
Accepted
time: 52ms
memory: 7880kb

input:

33333
5 10
2 3
3 4
2 5
4 5
1 3
2 4
3 5
1 2
1 5
1 4
5 10
1 4
1 2
2 3
3 5
2 4
1 5
1 3
4 5
3 4
2 5
5 10
2 5
2 4
4 5
1 4
2 3
1 3
1 5
3 4
3 5
1 2
5 10
1 2
2 5
2 3
3 5
4 5
1 4
1 5
2 4
1 3
3 4
5 10
1 3
2 3
1 2
2 4
1 5
3 5
1 4
3 4
4 5
2 5
5 10
2 3
3 5
3 4
1 2
4 5
2 4
1 5
1 4
1 3
2 5
5 10
1 2
2 3
1 4
1 3
2 4...

output:

3125
3125
3125
3125
3125
3125
3125
3125
3125
3125
3125
3125
3125
3125
3125
3125
3125
3125
3125
3125
3125
3125
3125
3125
3125
3125
3125
3125
3125
3125
3125
3125
3125
3125
3125
3125
3125
3125
3125
3125
3125
3125
3125
3125
3125
3125
3125
3125
3125
3125
3125
3125
3125
3125
3125
3125
3125
3125
3125
3125
...

result:

ok 33333 numbers

Test #27:

score: 0
Accepted
time: 31ms
memory: 8008kb

input:

83333
6 0
6 0
6 0
6 0
6 0
6 0
6 0
6 0
6 0
6 0
6 0
6 0
6 0
6 0
6 0
6 0
6 0
6 0
6 0
6 0
6 0
6 0
6 0
6 0
6 0
6 0
6 0
6 0
6 0
6 0
6 0
6 0
6 0
6 0
6 0
6 0
6 0
6 0
6 0
6 0
6 0
6 0
6 0
6 0
6 0
6 0
6 0
6 0
6 0
6 0
6 0
6 0
6 0
6 0
6 0
6 0
6 0
6 0
6 0
6 0
6 0
6 0
6 0
6 0
6 0
6 0
6 0
6 0
6 0
6 0
6 0
6 0
6 0
6 ...

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
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
...

result:

ok 83333 numbers

Test #28:

score: 0
Accepted
time: 37ms
memory: 8740kb

input:

71428
6 1
4 5
6 1
2 6
6 1
2 3
6 1
1 4
6 1
1 2
6 1
3 6
6 1
3 5
6 1
3 4
6 1
3 6
6 1
4 5
6 1
2 6
6 1
1 5
6 1
2 5
6 1
3 4
6 1
2 3
6 1
1 5
6 1
1 4
6 1
1 3
6 1
1 5
6 1
4 6
6 1
3 4
6 1
4 5
6 1
4 6
6 1
1 2
6 1
1 3
6 1
1 3
6 1
2 5
6 1
4 6
6 1
5 6
6 1
1 3
6 1
1 2
6 1
2 6
6 1
2 4
6 1
2 6
6 1
2 3
6 1
2 3
6 1
4 ...

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
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
...

result:

ok 71428 numbers

Test #29:

score: 0
Accepted
time: 45ms
memory: 7820kb

input:

62500
6 2
1 3
4 6
6 2
3 5
5 6
6 2
4 5
2 3
6 2
2 5
1 2
6 2
3 6
3 5
6 2
3 6
1 5
6 2
4 5
5 6
6 2
2 5
1 2
6 2
4 5
1 2
6 2
1 3
3 4
6 2
2 3
2 5
6 2
3 4
1 4
6 2
1 3
4 6
6 2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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 55555 numbers

Test #31:

score: 0
Accepted
time: 41ms
memory: 8676kb

input:

50000
6 4
2 3
1 6
5 6
1 4
6 4
1 5
2 4
3 4
1 3
6 4
1 4
1 3
1 2
3 4
6 4
2 6
1 3
3 4
2 3
6 4
4 5
1 3
1 6
5 6
6 4
1 3
3 6
4 5
5 6
6 4
2 6
1 4
2 4
4 5
6 4
1 4
3 5
2 3
5 6
6 4
3 4
3 5
1 5
5 6
6 4
1 4
2 4
3 5
3 4
6 4
4 5
5 6
1 6
2 5
6 4
1 4
1 3
3 6
2 3
6 4
1 3
3 4
2 5
3 5
6 4
3 4
4 6
1 3
2 3
6 4
2 6
5 6
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
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
5
1
5
5
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
5
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
5
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
5
1
1
1
1
1
1
...

result:

ok 50000 numbers

Test #32:

score: 0
Accepted
time: 47ms
memory: 7804kb

input:

45454
6 5
2 3
3 5
3 4
2 5
1 4
6 5
2 4
3 5
1 2
5 6
3 6
6 5
2 5
5 6
3 4
1 3
4 5
6 5
1 6
2 6
3 5
5 6
1 2
6 5
1 6
3 4
3 6
1 5
2 3
6 5
4 6
1 5
2 5
5 6
1 6
6 5
1 6
1 3
3 4
2 3
1 2
6 5
1 4
2 5
3 5
2 6
4 6
6 5
4 5
1 3
2 6
3 5
3 4
6 5
1 6
2 4
1 5
1 4
4 6
6 5
2 5
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: 0
Accepted
time: 29ms
memory: 7856kb

input:

38461
6 7
1 3
2 4
1 2
1 6
5 6
1 5
2 6
6 7
2 5
2 4
2 6
3 4
1 2
3 5
1 6
6 7
1 3
1 5
2 3
3 6
3 5
1 4
1 6
6 7
1 5
1 2
2 3
2 4
3 6
3 4
1 3
6 7
2 3
2 6
3 6
1 6
4 5
1 4
2 5
6 7
3 4
1 4
1 5
1 6
4 5
2 5
2 6
6 7
1 2
5 6
2 6
4 5
3 4
2 4
1 5
6 7
1 2
4 5
1 6
5 6
1 4
2 6
1 3
6 7
1 4
1 6
2 5
1 3
5 6
4 5
4 6
6 7
1 ...

output:

5
5
5
5
5
5
25
5
5
5
5
5
5
5
5
25
25
5
5
5
5
5
5
5
5
5
25
5
25
5
5
5
25
5
5
5
25
5
5
5
5
5
5
25
5
5
5
5
5
5
5
5
5
5
5
5
25
25
5
5
5
5
25
5
25
25
5
25
5
5
5
5
5
25
25
25
5
5
5
5
5
5
25
5
5
25
5
5
5
25
5
5
5
5
5
5
25
5
5
5
25
5
25
5
5
25
5
25
5
5
5
5
5
5
5
5
5
25
5
5
5
25
25
5
5
5
25
25
5
5
5
25
5
5
5...

result:

ok 38461 numbers

Test #35:

score: 0
Accepted
time: 37ms
memory: 8204kb

input:

35714
6 8
1 5
2 4
2 6
1 6
3 6
1 4
4 6
2 5
6 8
1 2
2 4
2 6
4 6
1 6
3 5
1 4
2 5
6 8
2 4
2 3
3 4
2 5
1 3
5 6
4 5
1 6
6 8
2 6
2 3
2 4
5 6
1 6
1 4
3 4
1 2
6 8
1 2
5 6
1 4
3 6
1 6
2 6
2 5
2 4
6 8
1 6
3 5
4 5
1 4
2 4
4 6
3 6
1 3
6 8
4 5
1 2
3 5
1 4
2 6
4 6
1 5
1 3
6 8
1 4
2 4
3 5
2 5
1 6
1 3
3 4
1 2
6 8
1 ...

output:

25
25
25
25
25
25
25
25
25
25
25
25
25
25
25
25
25
25
25
25
25
25
25
25
25
25
25
25
25
25
25
25
25
25
25
25
25
25
25
25
25
125
25
25
25
25
25
25
125
25
25
25
25
25
25
25
25
25
25
25
25
25
25
25
25
125
25
25
25
25
25
25
25
25
125
25
25
25
25
25
25
25
25
25
25
25
25
25
125
25
25
125
25
25
25
25
25
25
...

result:

ok 35714 numbers

Test #36:

score: 0
Accepted
time: 42ms
memory: 7784kb

input:

33333
6 9
1 4
3 4
4 6
2 4
3 5
2 6
2 5
1 5
2 3
6 9
1 3
2 5
4 6
3 4
4 5
2 4
1 5
5 6
1 4
6 9
2 5
5 6
1 5
3 6
1 6
4 6
3 5
2 3
2 4
6 9
5 6
1 3
1 2
3 6
3 4
2 6
1 4
3 5
2 5
6 9
2 5
3 5
1 2
4 6
2 6
4 5
2 3
1 6
2 4
6 9
3 4
1 2
5 6
4 5
2 6
1 5
3 6
4 6
1 3
6 9
4 5
3 6
2 5
3 4
5 6
1 5
1 6
2 3
2 6
6 9
2 6
1 5
4 ...

output:

125
125
125
125
125
125
125
125
125
125
125
125
125
125
125
125
125
125
125
125
125
125
125
125
125
125
125
125
125
125
125
125
125
125
125
125
125
625
125
125
125
125
125
125
125
125
125
125
125
125
125
125
125
125
125
125
125
125
125
125
125
125
125
125
125
125
125
125
125
125
125
125
125
125
125
...

result:

ok 33333 numbers

Test #37:

score: 0
Accepted
time: 47ms
memory: 7872kb

input:

31250
6 10
3 5
3 4
2 3
1 6
5 6
2 6
1 5
1 4
3 6
1 3
6 10
4 6
3 4
2 6
5 6
3 5
2 4
1 4
2 5
1 5
2 3
6 10
1 2
2 4
2 6
1 3
2 5
4 5
4 6
3 4
1 5
2 3
6 10
1 6
1 4
1 3
1 2
3 4
4 6
5 6
3 5
1 5
2 3
6 10
1 6
2 4
1 3
2 3
5 6
1 4
1 2
4 5
4 6
3 5
6 10
2 5
2 4
1 6
3 5
2 3
4 6
1 5
2 6
5 6
1 2
6 10
2 5
3 5
2 3
1 3
3 6...

output:

625
625
625
625
625
625
625
625
625
625
625
625
625
625
625
625
625
625
625
625
625
625
625
625
625
625
625
625
625
625
625
625
625
625
625
625
625
625
625
625
625
625
625
625
625
625
625
625
625
625
625
625
625
625
625
625
625
625
625
625
625
625
625
625
625
625
625
625
625
625
625
625
625
625
625
...

result:

ok 31250 numbers

Test #38:

score: 0
Accepted
time: 51ms
memory: 8340kb

input:

29411
6 11
1 3
4 5
4 6
1 4
5 6
3 5
1 5
2 3
3 6
1 2
3 4
6 11
2 6
1 3
5 6
4 5
1 5
3 5
2 5
1 4
3 4
2 3
1 2
6 11
4 5
1 6
1 4
1 3
3 4
5 6
3 5
2 4
1 2
1 5
2 6
6 11
1 4
1 3
1 6
4 5
2 3
1 5
3 4
2 5
1 2
2 4
5 6
6 11
1 6
2 5
5 6
1 2
4 5
3 4
1 3
1 4
2 4
2 6
2 3
6 11
1 3
3 6
1 5
3 5
5 6
1 2
2 3
1 4
1 6
2 5
2 4
...

output:

3125
3125
3125
3125
3125
3125
3125
3125
3125
3125
3125
3125
3125
3125
3125
3125
3125
3125
3125
3125
3125
3125
3125
3125
3125
3125
3125
3125
3125
3125
3125
3125
3125
3125
3125
3125
3125
3125
3125
3125
3125
3125
3125
3125
3125
3125
3125
3125
3125
3125
3125
3125
3125
3125
3125
3125
3125
3125
3125
3125
...

result:

ok 29411 numbers

Test #39:

score: 0
Accepted
time: 46ms
memory: 7892kb

input:

27777
6 12
1 5
2 3
1 3
4 5
3 4
4 6
2 5
1 2
2 4
2 6
1 6
1 4
6 12
2 6
1 6
2 4
4 5
1 2
2 3
4 6
3 4
2 5
3 5
5 6
1 3
6 12
1 2
2 4
4 5
3 5
1 6
3 4
1 5
1 3
5 6
3 6
1 4
4 6
6 12
1 2
1 5
5 6
4 5
1 4
1 3
2 4
1 6
4 6
2 6
2 3
3 4
6 12
5 6
3 6
3 5
1 6
2 3
1 3
2 5
2 4
3 4
4 6
1 5
2 6
6 12
2 3
2 4
1 5
4 6
1 2
3 5
...

output:

15625
15625
15625
15625
15625
15625
15625
15625
15625
15625
15625
15625
15625
15625
15625
15625
15625
15625
15625
15625
15625
15625
15625
15625
15625
15625
15625
15625
15625
15625
15625
15625
15625
15625
15625
15625
15625
15625
15625
15625
15625
15625
15625
15625
15625
15625
15625
15625
15625
15625
...

result:

ok 27777 numbers

Test #40:

score: 0
Accepted
time: 41ms
memory: 8468kb

input:

26315
6 13
3 4
4 5
2 4
2 6
1 2
1 5
2 3
1 4
1 6
3 5
2 5
3 6
4 6
6 13
3 5
3 6
1 6
1 4
3 4
5 6
2 3
1 2
2 5
2 4
4 5
1 5
2 6
6 13
3 5
2 3
1 5
3 6
1 3
5 6
1 6
2 6
2 4
4 5
2 5
4 6
3 4
6 13
3 5
1 6
4 5
2 4
1 4
1 5
4 6
2 5
3 6
5 6
2 3
1 2
1 3
6 13
3 5
1 4
2 5
1 2
4 5
2 3
3 4
3 6
4 6
1 5
2 6
5 6
1 6
6 13
1 4
...

output:

78125
78125
78125
78125
78125
78125
78125
78125
78125
78125
78125
78125
78125
78125
78125
78125
78125
78125
78125
78125
78125
78125
78125
78125
78125
78125
78125
78125
78125
78125
78125
78125
78125
78125
78125
78125
78125
78125
78125
78125
78125
78125
78125
78125
78125
78125
78125
78125
78125
78125
...

result:

ok 26315 numbers

Test #41:

score: 0
Accepted
time: 49ms
memory: 7848kb

input:

25000
6 14
2 5
2 6
3 4
4 6
1 2
1 3
1 5
5 6
2 4
2 3
1 6
3 6
1 4
4 5
6 14
4 6
2 5
2 6
1 5
1 4
3 6
1 2
2 4
1 3
5 6
2 3
1 6
4 5
3 5
6 14
3 6
4 5
2 5
5 6
3 4
2 4
1 4
2 3
1 3
3 5
1 5
1 6
4 6
1 2
6 14
2 4
1 3
2 5
3 6
1 6
1 4
4 5
5 6
2 6
1 5
4 6
3 4
1 2
2 3
6 14
1 5
2 5
5 6
1 2
4 5
2 6
3 5
4 6
1 4
2 3
2 4
3...

output:

390625
390625
390625
390625
390625
390625
390625
390625
390625
390625
390625
390625
390625
390625
390625
390625
390625
390625
390625
390625
390625
390625
390625
390625
390625
390625
390625
390625
390625
390625
390625
390625
390625
390625
390625
390625
390625
390625
390625
390625
390625
390625
390625...

result:

ok 25000 numbers

Test #42:

score: 0
Accepted
time: 41ms
memory: 7896kb

input:

23809
6 15
1 4
1 6
1 5
1 2
4 6
1 3
5 6
2 5
3 6
3 4
2 3
2 6
3 5
2 4
4 5
6 15
1 6
2 6
5 6
4 6
1 4
2 5
3 4
1 3
2 3
2 4
1 5
1 2
4 5
3 6
3 5
6 15
1 6
2 3
2 6
4 6
1 3
1 5
4 5
1 4
3 4
2 4
3 6
3 5
2 5
1 2
5 6
6 15
4 6
2 5
1 3
4 5
3 6
1 5
3 5
2 3
2 6
1 2
1 4
1 6
2 4
5 6
3 4
6 15
2 5
2 4
5 6
1 4
4 6
4 5
1 6
1...

output:

1953125
1953125
1953125
1953125
1953125
1953125
1953125
1953125
1953125
1953125
1953125
1953125
1953125
1953125
1953125
1953125
1953125
1953125
1953125
1953125
1953125
1953125
1953125
1953125
1953125
1953125
1953125
1953125
1953125
1953125
1953125
1953125
1953125
1953125
1953125
1953125
1953125
1953...

result:

ok 23809 numbers

Test #43:

score: -100
Dangerous Syscalls

input:

1
200000 200000
192033 197543
68698 92316
101105 108314
42287 167424
96873 198103
90054 181007
44902 63014
13121 39886
922 100673
101400 163828
48349 72261
114526 119401
103065 113604
154652 183011
109138 126652
30269 94974
94410 145851
40539 199281
36305 85891
125138 175226
47940 79444
33199 37866
...

output:


result: