QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#865406#9873. Last Chance: Threads of Despairucup-team5082#AC ✓107ms7296kbC++201.8kb2025-01-21 18:00:352025-01-21 18:00:37

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

input:

3
3 2
1 1 4
2 6
3 2
1 1 4
2 7
2 1
100 100
2

output:

Yes
No
Yes

result:

ok 3 token(s): yes count is 2, no count is 1

Test #2:

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

input:

3
7 1
1 1 1 1 1 1 1
9
5 2
3 4 5 6 7
1 6
5 3
3 4 5 6 7
1 5 7

output:

No
No
Yes

result:

ok 3 token(s): yes count is 1, no count is 2

Test #3:

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

input:

4
1 1
1
1
1 1
1
2
1 1
2
1
1 1
2
2

output:

Yes
Yes
Yes
No

result:

ok 4 token(s): yes count is 3, no count is 1

Test #4:

score: 0
Accepted
time: 1ms
memory: 3712kb

input:

18
1 2
1
1 1
1 2
1
2 1
1 2
1
1 3
1 2
1
2 2
1 2
1
3 2
1 2
1
3 3
1 2
2
1 1
1 2
2
1 2
1 2
2
1 3
1 2
2
2 2
1 2
2
2 3
1 2
2
3 3
1 2
3
1 1
1 2
3
1 2
1 2
3
1 3
1 2
3
2 2
1 2
3
3 2
1 2
3
3 3

output:

Yes
Yes
Yes
Yes
No
No
Yes
Yes
No
No
No
No
Yes
No
No
No
No
No

result:

ok 18 token(s): yes count is 7, no count is 11

Test #5:

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

input:

18
2 1
1 1
1
2 1
1 1
2
2 1
1 1
3
2 1
1 2
1
2 1
2 1
2
2 1
2 1
3
2 1
1 3
1
2 1
1 3
2
2 1
3 1
3
2 1
2 2
1
2 1
2 2
2
2 1
2 2
3
2 1
2 3
1
2 1
3 2
2
2 1
2 3
3
2 1
3 3
1
2 1
3 3
2
2 1
3 3
3

output:

Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
No
Yes
Yes
No
Yes
Yes
No

result:

ok 18 token(s): yes count is 15, no count is 3

Test #6:

score: 0
Accepted
time: 1ms
memory: 3712kb

input:

525
2 3
1 1
1 1 1
2 3
1 1
1 2 1
2 3
1 1
1 3 1
2 3
1 1
1 4 1
2 3
1 1
5 1 1
2 3
1 1
2 2 1
2 3
1 1
3 1 2
2 3
1 1
1 2 4
2 3
1 1
2 1 5
2 3
1 1
3 3 1
2 3
1 1
4 3 1
2 3
1 1
3 5 1
2 3
1 1
4 4 1
2 3
1 1
4 5 1
2 3
1 1
1 5 5
2 3
1 1
2 2 2
2 3
1 1
2 3 2
2 3
1 1
2 2 4
2 3
1 1
2 5 2
2 3
1 1
3 2 3
2 3
1 1
3 2 4
2 ...

output:

Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
No
No
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
No
No
Yes
Yes
No
No
No
No
No
No
No
No
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
No
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
No
Yes
Yes
Yes
Yes
No
No
No
No
No
No
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
...

result:

ok 525 token(s): yes count is 202, no count is 323

Test #7:

score: 0
Accepted
time: 1ms
memory: 3712kb

input:

525
3 2
1 1 1
1 1
3 2
1 1 1
2 1
3 2
1 1 1
3 1
3 2
1 1 1
1 4
3 2
1 1 1
1 5
3 2
1 1 1
2 2
3 2
1 1 1
2 3
3 2
1 1 1
4 2
3 2
1 1 1
2 5
3 2
1 1 1
3 3
3 2
1 1 1
4 3
3 2
1 1 1
5 3
3 2
1 1 1
4 4
3 2
1 1 1
5 4
3 2
1 1 1
5 5
3 2
1 1 2
1 1
3 2
2 1 1
2 1
3 2
2 1 1
1 3
3 2
1 2 1
1 4
3 2
1 1 2
5 1
3 2
1 1 2
2 2
3 ...

output:

Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
No
No
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
No
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
No
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
No
No
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
No
No
No
No
Yes
Yes
Ye...

result:

ok 525 token(s): yes count is 317, no count is 208

Test #8:

score: 0
Accepted
time: 2ms
memory: 3712kb

input:

3136
3 3
1 1 1
1 1 1
3 3
1 1 1
2 1 1
3 3
1 1 1
3 1 1
3 3
1 1 1
1 1 4
3 3
1 1 1
5 1 1
3 3
1 1 1
1 1 6
3 3
1 1 1
2 1 2
3 3
1 1 1
2 1 3
3 3
1 1 1
1 4 2
3 3
1 1 1
2 5 1
3 3
1 1 1
1 6 2
3 3
1 1 1
3 3 1
3 3
1 1 1
4 1 3
3 3
1 1 1
1 5 3
3 3
1 1 1
1 3 6
3 3
1 1 1
4 1 4
3 3
1 1 1
4 1 5
3 3
1 1 1
4 1 6
3 3
1 1...

output:

Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
No
No
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
No
No
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
No
No
Yes
Yes
No
No
No
No
No
No
No
No
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
No
Yes
Yes...

result:

ok 3136 token(s): yes count is 1458, no count is 1678

Test #9:

score: 0
Accepted
time: 7ms
memory: 3712kb

input:

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

output:

Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
No
No
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
No
No
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
No
No
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
No
No
Yes
Yes
No
N...

result:

ok 17640 token(s): yes count is 6647, no count is 10993

Test #10:

score: 0
Accepted
time: 7ms
memory: 3712kb

input:

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

output:

Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
No
No
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
No
No
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
No
No
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
No
No
Yes
Yes
No
N...

result:

ok 17640 token(s): yes count is 8926, no count is 8714

Test #11:

score: 0
Accepted
time: 38ms
memory: 3584kb

input:

95040
3 5
1 1 1
1 1 1 1 1
3 5
1 1 1
2 1 1 1 1
3 5
1 1 1
1 3 1 1 1
3 5
1 1 1
1 1 4 1 1
3 5
1 1 1
1 5 1 1 1
3 5
1 1 1
1 1 6 1 1
3 5
1 1 1
7 1 1 1 1
3 5
1 1 1
1 1 1 8 1
3 5
1 1 1
2 1 2 1 1
3 5
1 1 1
1 1 2 1 3
3 5
1 1 1
1 4 2 1 1
3 5
1 1 1
2 5 1 1 1
3 5
1 1 1
6 1 2 1 1
3 5
1 1 1
1 7 2 1 1
3 5
1 1 1
1 8 ...

output:

Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
No
No
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
No
No
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
...

result:

ok 95040 token(s): yes count is 29907, no count is 65133

Test #12:

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

input:

95040
5 3
1 1 1 1 1
1 1 1
5 3
1 1 1 1 1
2 1 1
5 3
1 1 1 1 1
3 1 1
5 3
1 1 1 1 1
4 1 1
5 3
1 1 1 1 1
5 1 1
5 3
1 1 1 1 1
1 6 1
5 3
1 1 1 1 1
1 1 7
5 3
1 1 1 1 1
1 8 1
5 3
1 1 1 1 1
1 2 2
5 3
1 1 1 1 1
1 3 2
5 3
1 1 1 1 1
4 1 2
5 3
1 1 1 1 1
2 5 1
5 3
1 1 1 1 1
6 1 2
5 3
1 1 1 1 1
1 7 2
5 3
1 1 1 1 1
...

output:

Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
No
No
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
No
No
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
...

result:

ok 95040 token(s): yes count is 50357, no count is 44683

Test #13:

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

input:

108900
4 4
1 1 1 1
1 1 1 1
4 4
1 1 1 1
1 1 2 1
4 4
1 1 1 1
3 1 1 1
4 4
1 1 1 1
1 1 4 1
4 4
1 1 1 1
1 5 1 1
4 4
1 1 1 1
1 1 6 1
4 4
1 1 1 1
7 1 1 1
4 4
1 1 1 1
1 1 8 1
4 4
1 1 1 1
1 2 1 2
4 4
1 1 1 1
3 1 2 1
4 4
1 1 1 1
2 1 4 1
4 4
1 1 1 1
1 2 5 1
4 4
1 1 1 1
1 2 6 1
4 4
1 1 1 1
7 1 2 1
4 4
1 1 1 1
1...

output:

Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
No
No
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
No
No
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
...

result:

ok 108900 token(s): yes count is 46206, no count is 62694

Test #14:

score: 0
Accepted
time: 54ms
memory: 3584kb

input:

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

output:

Yes
No
No
Yes
No
Yes
No
No
No
No
No
No
No
Yes
Yes
Yes
No
No
Yes
Yes
No
Yes
No
No
Yes
No
No
No
Yes
No
Yes
No
Yes
Yes
No
No
Yes
Yes
No
No
No
Yes
Yes
No
Yes
Yes
No
Yes
Yes
Yes
No
No
Yes
Yes
No
No
No
No
Yes
No
No
No
Yes
No
No
No
Yes
Yes
No
Yes
Yes
No
Yes
Yes
No
Yes
No
No
Yes
Yes
Yes
Yes
No
No
Yes
No
No
...

result:

ok 50000 token(s): yes count is 19646, no count is 30354

Test #15:

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

input:

33333
12 15
9 7 15 17 13 18 8 14 10 25 11 22
9 6 14 17 15 17 8 13 9 24 13 22 26 1 21
12 15
8 20 15 25 6 24 23 4 26 13 18 5
7 19 16 27 5 23 24 3 25 14 17 4 9 1 16
12 15
26 16 14 8 20 11 1 5 2 15 12 4
26 16 15 8 19 10 1 4 3 14 12 5 9 24 12
12 15
17 13 15 19 4 25 1 22 6 2 27 16
17 13 15 18 3 24 2 23 5 ...

output:

No
No
Yes
No
Yes
Yes
No
No
No
Yes
Yes
No
No
No
No
No
Yes
No
Yes
No
Yes
No
No
Yes
No
Yes
No
Yes
No
Yes
Yes
Yes
No
Yes
Yes
No
Yes
No
No
No
No
No
No
No
No
No
No
No
Yes
Yes
No
No
No
No
Yes
No
No
No
Yes
No
Yes
Yes
Yes
Yes
No
No
No
Yes
No
No
No
No
No
No
No
Yes
No
Yes
No
No
No
No
Yes
No
No
Yes
No
No
Yes
No...

result:

ok 33333 token(s): yes count is 11692, no count is 21641

Test #16:

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

input:

33333
15 12
21 1 4 15 9 23 5 6 10 19 17 24 3 2 18
22 1 5 15 8 24 5 6 9 20 19 23
15 12
11 3 22 7 21 10 13 16 23 26 9 20 19 4 27
12 5 21 7 23 10 13 15 22 27 10 19
15 12
12 7 20 10 17 4 25 15 11 27 8 14 6 13 18
11 9 20 11 19 3 24 16 10 29 7 14
15 12
2 3 5 24 11 26 19 10 27 14 25 15 20 18 12
3 3 6 24 11...

output:

Yes
No
No
No
Yes
Yes
No
No
No
No
No
No
No
No
Yes
No
No
Yes
Yes
No
Yes
No
No
No
No
No
No
Yes
No
No
No
No
No
Yes
No
Yes
No
No
No
Yes
No
Yes
Yes
Yes
No
Yes
Yes
Yes
Yes
No
Yes
Yes
No
No
No
No
No
No
Yes
Yes
No
No
No
No
Yes
Yes
No
No
No
No
Yes
No
No
Yes
No
Yes
No
No
No
Yes
Yes
No
No
No
No
No
Yes
No
Yes
Ye...

result:

ok 33333 token(s): yes count is 13098, no count is 20235

Test #17:

score: 0
Accepted
time: 60ms
memory: 3584kb

input:

5000
100 100
133 5 137 121 30 141 27 123 178 128 171 21 67 74 175 47 26 82 125 48 65 102 106 89 179 43 60 164 136 46 9 159 111 144 59 198 157 93 28 169 12 186 42 29 183 87 56 8 139 22 154 161 109 101 168 130 17 182 103 147 132 33 129 158 23 195 53 35 138 185 51 114 126 10 57 7 62 99 55 191 176 199 1...

output:

No
No
No
Yes
Yes
No
No
No
No
No
No
No
No
No
Yes
No
No
No
No
Yes
No
No
No
Yes
No
No
No
Yes
No
No
No
No
No
No
No
No
Yes
No
No
No
No
No
Yes
Yes
No
Yes
No
No
No
Yes
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
Yes
Yes
No
No
No
Yes
No
No
Yes
Yes
No
No
No
Yes
Yes
No
Yes
Yes
No
No
No
No
No
No
No
N...

result:

ok 5000 token(s): yes count is 1091, no count is 3909

Test #18:

score: 0
Accepted
time: 72ms
memory: 3584kb

input:

500
1000 1000
410 461 57 202 1577 1597 994 944 1488 956 379 380 1486 1780 1244 1921 1794 265 1563 1679 243 65 1079 192 1839 762 1014 206 23 193 1185 1746 822 948 1397 1854 917 645 623 1726 809 1708 1765 1908 761 527 1603 1073 758 46 1592 203 1871 1873 1252 438 808 416 1128 1099 1107 735 151 1959 171...

output:

No
No
No
No
Yes
Yes
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
Yes
Yes
No
No
No
No
No
No
No
Yes
No
No
No
No
No
Yes
Yes
No
No
No
No
No
Yes
No
Yes
Yes
No
No
No
Yes
No
No
No
No
Yes
No
No
No
No
No
Yes
Yes
No
No
No
No
No
No
No
No
No
Yes
No
No
No
No
No
Yes
No
Yes
No
No
No
Yes
No
No
No
No
No
No
...

result:

ok 500 token(s): yes count is 70, no count is 430

Test #19:

score: 0
Accepted
time: 103ms
memory: 4224kb

input:

5
100000 100000
192348 43709 194484 134138 36415 165204 147428 196982 14278 195617 146117 168812 110270 1094 192657 135027 9041 181689 170958 162867 32338 18546 107477 98466 52702 82906 28257 89818 72376 34525 22246 170527 118863 160364 47995 153027 163962 98710 132547 38225 198231 78342 115823 4907...

output:

No
No
No
No
No

result:

ok 5 token(s): yes count is 0, no count is 5

Test #20:

score: 0
Accepted
time: 106ms
memory: 7296kb

input:

1
500000 500000
298323 92801 517022 733075 950589 442461 98931 873034 365485 969370 407317 138461 421780 932696 964828 249894 562117 873629 795988 841659 25700 657972 879460 790648 337233 96409 76314 442433 323234 93538 461415 502833 763238 606519 203793 398485 683063 957433 104205 604635 952026 185...

output:

No

result:

ok NO

Test #21:

score: 0
Accepted
time: 53ms
memory: 3712kb

input:

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

output:

No
Yes
No
Yes
No
No
Yes
Yes
No
No
No
No
Yes
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
Yes
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
Yes
No
No
No
No
No
No
No
No
No
No
No
No
No
Yes
Yes
No
No
No
No
No
No
No
No
No
No
No
No
No
Yes
Yes
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
N...

result:

ok 50000 token(s): yes count is 5971, no count is 44029

Test #22:

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

input:

33333
12 15
21 2 1 28 26 30 12 22 23 7 18 6
21 2 1 28 26 30 12 22 23 7 18 6 29 11 14
12 15
24 2 28 18 16 22 10 17 27 3 4 20
24 2 28 18 16 22 10 17 27 3 4 20 6 13 7
12 15
26 19 22 8 7 6 3 15 24 18 27 1
26 19 22 8 7 6 3 15 24 18 27 1 29 13 17
12 15
28 8 16 30 18 23 5 2 3 24 4 25
28 8 16 30 18 23 5 2 3...

output:

No
No
No
No
No
No
No
Yes
No
No
Yes
No
Yes
No
No
Yes
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
Yes
No
No
No
No
No
No
No
No
No
Yes
No
No
Yes
No
No
No
No
No
No
No
No
No
No
Yes
Yes
No
No
No
No
No
No
No
No
No
No
No
No
No
No
Yes
No
No
Yes
No
No
No
No
No
Yes
No
No
No
No
Yes
No
No...

result:

ok 33333 token(s): yes count is 2998, no count is 30335

Test #23:

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

input:

33333
15 12
3 11 17 19 23 9 29 22 14 27 5 26 20 2 6
3 11 17 19 23 9 29 22 14 27 5 26
15 12
25 29 1 22 13 5 24 26 3 9 23 6 4 12 17
25 29 1 22 13 5 24 26 3 9 23 6
15 12
26 16 20 2 6 8 29 7 4 19 27 12 13 28 21
26 16 20 2 6 8 29 7 4 19 27 12
15 12
13 2 4 6 29 28 25 27 15 10 19 16 18 14 5
13 2 4 6 29 28 ...

output:

No
No
No
No
No
No
No
No
No
No
No
Yes
Yes
No
Yes
No
No
No
No
No
Yes
No
No
No
No
Yes
No
No
No
No
No
No
Yes
Yes
No
No
Yes
No
Yes
No
No
No
No
No
No
No
No
Yes
Yes
No
No
No
No
Yes
No
No
No
No
Yes
No
No
No
No
No
No
No
No
No
No
No
Yes
No
No
No
No
No
No
No
No
No
Yes
No
No
No
No
No
No
No
Yes
No
No
Yes
No
No
N...

result:

ok 33333 token(s): yes count is 4670, no count is 28663

Test #24:

score: 0
Accepted
time: 60ms
memory: 3584kb

input:

5000
100 100
146 117 67 141 42 108 16 118 155 163 81 44 210 150 7 41 137 1 194 162 3 123 110 157 185 176 78 29 18 87 183 15 55 199 189 52 45 131 105 112 6 154 124 143 159 192 158 164 160 57 120 5 32 207 167 24 33 138 39 103 139 106 115 37 66 4 174 172 95 132 21 30 75 208 126 111 86 64 2 190 8 119 49...

output:

No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
Yes
Yes
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
Yes
...

result:

ok 5000 token(s): yes count is 69, no count is 4931

Test #25:

score: 0
Accepted
time: 69ms
memory: 3712kb

input:

500
1000 1000
304 1098 1190 308 1439 1576 1127 1618 1697 1859 539 879 1361 1989 184 1645 1324 1172 695 476 936 133 437 479 1670 1852 1327 50 1402 259 958 1101 1057 1148 1865 316 26 1363 1933 1486 188 1513 434 109 1095 669 478 256 1976 842 932 127 652 261 1158 250 1906 1654 712 1907 46 86 1969 291 16...

output:

No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
...

result:

ok 500 token(s): yes count is 0, no count is 500

Test #26:

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

input:

500
1000 1000
1338 1948 2347 2143 2632 740 1681 2113 304 1765 634 2862 1855 1467 1589 2805 414 246 288 2896 630 1340 493 2980 1852 2926 1380 472 1648 1778 10 2763 1257 2089 2960 1270 2498 1592 657 8 2263 1562 2573 2088 1314 1793 1842 1226 1586 436 1780 2217 1598 336 1274 1639 1457 2799 245 2175 350 ...

output:

No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
...

result:

ok 500 token(s): yes count is 0, no count is 500

Test #27:

score: 0
Accepted
time: 102ms
memory: 4096kb

input:

5
100000 100000
175884 69085 200780 163097 174782 176860 177635 108439 58331 201693 45443 69964 67629 51542 230151 107451 248468 57 186555 154640 152853 186240 135695 65587 169123 140867 135857 34026 170860 122007 115654 152583 215432 194107 13818 172316 190315 104947 188587 138904 228578 106436 170...

output:

No
No
No
No
No

result:

ok 5 token(s): yes count is 0, no count is 5

Test #28:

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

input:

5
100000 100000
664173 769141 1166 421665 157281 469088 467744 347428 125383 437372 170344 193734 178373 196363 532625 552680 59286 602040 621936 226773 333095 417999 564272 587755 178960 506514 402308 783593 180747 706116 285043 195160 214919 82095 148311 473751 189806 114149 798307 261957 232368 2...

output:

No
No
No
No
No

result:

ok 5 token(s): yes count is 0, no count is 5

Test #29:

score: 0
Accepted
time: 107ms
memory: 7296kb

input:

1
500000 500000
897353 54134 40691 951584 976264 1025905 347917 284873 732288 588924 133252 567712 1015728 838624 494019 976920 723742 956033 571446 728126 129344 1060046 20061 258469 792326 765380 362099 832962 588916 305636 156212 843017 304793 1031490 746460 93058 760791 45824 309328 820232 94416...

output:

No

result:

ok NO

Test #30:

score: 0
Accepted
time: 92ms
memory: 3712kb

input:

500000
1 1
2
2
1 1
4
5
1 1
5
2
1 1
5
5
1 1
4
4
1 1
1
4
1 1
3
6
1 1
2
3
1 1
4
2
1 1
2
5
1 1
5
3
1 1
2
4
1 1
1
6
1 1
3
5
1 1
5
4
1 1
2
4
1 1
5
5
1 1
6
4
1 1
4
5
1 1
5
4
1 1
2
1
1 1
4
2
1 1
5
1
1 1
6
5
1 1
4
5
1 1
5
2
1 1
2
5
1 1
2
1
1 1
5
1
1 1
3
5
1 1
2
2
1 1
1
4
1 1
4
5
1 1
2
3
1 1
6
3
1 1
6
3
1 1
2...

output:

No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
Yes
No
Yes
No
No
No
No
Yes
Yes
No
No
No
No
No
No
No
Yes
No
No
Yes
No
No
No
No
No
Yes
Yes
No
No
Yes
No
No
Yes
No
No
No
Yes
No
No
No
No
No
No
No
Yes
No
No
No
No
No
No
Yes
No
No
No
No
Yes
No
No
No
Yes
No
No
No
No
No
No
No
No
No
Yes
Yes
No
No
N...

result:

ok 500000 token(s): yes count is 97305, no count is 402695

Test #31:

score: 0
Accepted
time: 88ms
memory: 7296kb

input:

1
500000 500000
999999095 999999127 999999643 999999831 999999963 999999998 999999405 999999674 999999861 999999860 999999785 999999799 999999831 999999930 999999139 999999989 999999629 999999294 999999525 999999656 999999790 999999725 999999518 999999149 999999589 999999860 999999117 999999858 9999...

output:

No

result:

ok NO

Test #32:

score: 0
Accepted
time: 34ms
memory: 7296kb

input:

1
500000 500000
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 ...

output:

Yes

result:

ok YES

Test #33:

score: 0
Accepted
time: 53ms
memory: 3712kb

input:

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

output:

Yes
Yes
No
No
Yes
Yes
No
Yes
No
Yes
No
Yes
Yes
No
Yes
No
Yes
Yes
Yes
Yes
Yes
Yes
No
No
Yes
Yes
Yes
No
Yes
No
Yes
Yes
No
Yes
No
No
Yes
Yes
No
Yes
Yes
No
Yes
Yes
No
Yes
No
Yes
Yes
Yes
No
Yes
No
No
Yes
No
No
No
No
Yes
Yes
Yes
No
Yes
No
No
No
Yes
Yes
Yes
Yes
Yes
Yes
No
Yes
Yes
Yes
No
No
Yes
Yes
No
Yes
N...

result:

ok 71428 token(s): yes count is 40447, no count is 30981

Test #34:

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

input:

29411
12 17
16 9 12 9 16 17 10 9 6 5 11 14
7 4 6 17 16 8 17 8 12 7 4 10 16 5 5 18 9
12 17
11 6 18 15 4 13 6 7 8 5 16 8
11 8 13 17 8 16 4 7 14 18 7 8 14 6 15 17 10
12 17
9 5 5 6 16 8 17 10 18 15 12 7
10 14 14 10 9 8 16 9 18 7 13 10 6 9 17 5 17
12 17
12 17 5 6 5 13 16 9 4 13 15 18
7 14 15 14 10 13 18 ...

output:

Yes
No
No
Yes
Yes
No
No
Yes
No
No
No
Yes
Yes
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
Yes
No
Yes
No
Yes
No
No
Yes
Yes
No
Yes
No
No
No
No
Yes
Yes
No
No
No
Yes
Yes
Yes
No
No
No
No
No
No
No
Yes
Yes
Yes
No
No
No
Yes
Yes
No
No
No
Yes
No
Yes
No
Yes
No
No
No
No
No
Yes
No
No
No
No
Yes
No
No
No
Yes
No...

result:

ok 29411 token(s): yes count is 7455, no count is 21956

Test #35:

score: 0
Accepted
time: 57ms
memory: 3712kb

input:

4166
100 120
61 33 78 91 193 51 81 102 55 22 102 121 78 38 183 25 111 119 34 159 72 199 167 194 186 144 121 80 63 199 193 162 32 188 102 75 76 164 87 17 104 75 148 16 25 82 42 28 121 174 118 40 70 194 198 38 185 162 196 72 92 91 24 114 101 139 123 133 185 91 147 66 198 172 176 173 101 169 146 143 19...

output:

No
Yes
No
No
No
No
No
Yes
Yes
Yes
No
Yes
No
Yes
No
No
Yes
No
No
Yes
Yes
No
No
No
No
No
No
No
No
Yes
No
Yes
Yes
No
No
Yes
Yes
No
Yes
Yes
No
Yes
No
No
No
Yes
No
No
No
Yes
Yes
Yes
No
Yes
Yes
No
No
No
No
No
No
No
Yes
No
No
No
No
No
No
No
Yes
Yes
Yes
No
Yes
No
No
No
No
No
No
No
No
No
No
No
Yes
No
No
No
Y...

result:

ok 4166 token(s): yes count is 1475, no count is 2691

Test #36:

score: 0
Accepted
time: 58ms
memory: 3584kb

input:

4166
120 100
184 49 107 106 74 173 105 105 6 92 34 37 188 107 87 180 22 106 101 156 86 12 134 112 117 82 57 156 170 28 53 8 17 101 30 94 125 154 91 60 103 115 65 198 48 130 59 46 102 109 40 189 195 76 173 93 109 117 24 22 105 179 46 60 148 139 57 40 25 146 55 195 77 177 25 121 109 151 141 179 155 16...

output:

Yes
No
No
Yes
Yes
No
Yes
No
No
No
No
Yes
Yes
Yes
No
No
No
No
Yes
No
No
No
No
No
Yes
Yes
Yes
No
No
No
No
Yes
Yes
Yes
Yes
Yes
No
Yes
Yes
No
Yes
Yes
No
Yes
No
Yes
Yes
Yes
No
No
No
No
Yes
No
Yes
Yes
No
No
No
Yes
No
No
Yes
No
No
No
Yes
Yes
No
Yes
No
No
No
Yes
No
Yes
No
No
Yes
Yes
Yes
Yes
Yes
Yes
Yes
No
Y...

result:

ok 4166 token(s): yes count is 1704, no count is 2462

Test #37:

score: 0
Accepted
time: 77ms
memory: 3712kb

input:

500
1000 1000
1524 1161 1361 967 1364 413 627 230 510 1477 423 1918 1603 1803 114 957 934 423 1134 941 486 1809 602 1329 1434 1376 1473 1063 536 1209 315 736 1718 1653 1023 1360 1529 851 253 837 1634 577 1640 1306 1848 1694 204 203 1698 1320 1797 1062 1338 1720 158 1128 1159 966 1551 1069 1879 1525 ...

output:

Yes
No
Yes
Yes
Yes
No
No
Yes
No
Yes
No
No
No
Yes
No
No
No
No
Yes
No
No
Yes
Yes
No
No
Yes
No
Yes
Yes
No
No
No
No
Yes
Yes
Yes
Yes
No
No
No
No
Yes
Yes
Yes
Yes
Yes
No
No
No
No
No
No
Yes
No
No
No
No
No
No
Yes
No
No
Yes
No
Yes
No
Yes
No
Yes
No
Yes
Yes
No
No
Yes
Yes
No
No
Yes
No
Yes
No
No
No
Yes
No
No
Yes
...

result:

ok 500 token(s): yes count is 140, no count is 360

Test #38:

score: 0
Accepted
time: 89ms
memory: 3712kb

input:

50
10000 10000
13316 12271 9030 9937 15066 6648 4567 9204 13428 7471 2950 12781 5243 4144 7681 19222 7123 713 11026 874 8407 13294 10964 17013 8057 9448 2508 3925 15067 18361 10808 218 8234 16770 9784 9559 10931 5824 4004 13419 4737 12432 18659 6321 3029 9583 1691 14801 10830 19722 16935 13869 4213 ...

output:

No
Yes
No
No
No
Yes
No
Yes
No
No
Yes
No
No
No
Yes
Yes
Yes
No
No
Yes
No
Yes
Yes
No
No
Yes
Yes
No
No
No
No
Yes
Yes
No
No
No
No
No
No
No
No
Yes
Yes
No
No
No
No
No
No
Yes

result:

ok 50 token(s): yes count is 17, no count is 33

Test #39:

score: 0
Accepted
time: 104ms
memory: 4224kb

input:

5
100000 100000
122970 105132 73963 94056 162471 131489 127977 103341 183724 26954 41670 151195 56892 10053 21080 28850 190304 20043 117241 89267 119797 55539 108561 23056 20091 165212 29954 147580 11463 119678 62291 101815 133681 12538 131847 28883 103223 135397 52611 148690 187409 174746 139531 14...

output:

No
Yes
Yes
No
Yes

result:

ok 5 token(s): yes count is 3, no count is 2

Test #40:

score: 0
Accepted
time: 106ms
memory: 7296kb

input:

1
500000 500000
867258 801062 31398 297983 529800 204463 632746 528358 780489 978801 87747 163039 898993 981347 748097 513586 442207 71852 449573 470697 323858 879893 789120 917636 370721 774453 335019 810520 410906 233994 172997 597660 546060 432919 137913 677074 542588 763280 849052 262052 951948 ...

output:

No

result:

ok NO

Extra Test:

score: 0
Extra Test Passed