QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#774505#9788. Shrecklessucup-team2045#AC ✓180ms25436kbC++202.7kb2024-11-23 13:21:062024-11-23 13:21:08

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

input:

3
2 2
69 69
2024 42
3 3
1 1 1
1 1 1
2 2 2
3 4
1 1 1 1
1 1 1 1
2 2 2 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: 3620kb

input:

3
2 2
69 69
2024 42
3 3
1 1 1
1 1 1
2 2 2
3 4
1 1 1 1
1 1 1 1
2 2 2 2

output:

YES
NO
YES

result:

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

Test #3:

score: 0
Accepted
time: 35ms
memory: 3560kb

input:

20000
6 2
12 4
8 24
2 10
1 22
3 15
18 20
3 3
3 8 18
2 17 15
13 4 6
3 3
7 17 15
8 6 3
18 13 9
3 3
2 3 14
1 7 17
4 6 13
3 3
6 10 14
3 9 13
1 7 15
2 4
1 3 16 14
6 10 4 2
3 3
3 2 17
7 11 13
16 5 18
2 3
2 3 6
4 1 5
2 4
4 6 13 14
2 11 12 16
3 3
2 8 12
4 9 17
5 7 18
3 2
5 10
8 9
1 6
2 2
2 4
1 3
2 3
12 6 1
...

output:

NO
YES
YES
NO
NO
YES
YES
YES
NO
NO
NO
NO
YES
YES
YES
YES
NO
NO
YES
NO
NO
NO
YES
NO
YES
YES
YES
YES
YES
NO
NO
YES
NO
YES
NO
NO
YES
NO
YES
YES
NO
NO
YES
NO
YES
NO
NO
YES
YES
YES
NO
NO
NO
YES
YES
YES
NO
NO
NO
YES
NO
NO
YES
NO
NO
NO
YES
YES
YES
YES
NO
NO
YES
NO
NO
NO
NO
NO
YES
YES
YES
NO
NO
YES
YES
NO
N...

result:

ok 20000 token(s): yes count is 10263, no count is 9737

Test #4:

score: 0
Accepted
time: 35ms
memory: 3764kb

input:

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

output:

NO
YES
YES
YES
NO
YES
NO
NO
YES
NO
YES
YES
YES
YES
YES
NO
YES
YES
YES
YES
NO
NO
NO
YES
NO
NO
NO
YES
YES
YES
NO
NO
YES
NO
YES
YES
NO
NO
YES
NO
NO
YES
YES
NO
YES
YES
NO
NO
YES
NO
NO
NO
NO
YES
NO
NO
YES
YES
YES
NO
NO
YES
NO
YES
YES
NO
NO
YES
YES
NO
NO
YES
YES
NO
YES
YES
NO
NO
YES
NO
NO
NO
NO
YES
NO
NO
...

result:

ok 20000 token(s): yes count is 10265, no count is 9735

Test #5:

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

input:

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

output:

YES
YES
NO
NO
YES
NO
NO
YES
NO
YES
NO
YES
YES
YES
YES
YES
NO
NO
YES
NO
NO
YES
NO
YES
YES
NO
NO
NO
NO
YES
YES
YES
NO
NO
YES
YES
NO
YES
YES
NO
NO
YES
NO
YES
YES
NO
YES
NO
NO
YES
YES
NO
YES
YES
NO
YES
YES
YES
NO
NO
YES
NO
NO
NO
YES
NO
YES
YES
NO
NO
NO
NO
NO
YES
NO
YES
YES
NO
YES
NO
NO
YES
YES
YES
YES
Y...

result:

ok 20000 token(s): yes count is 10239, no count is 9761

Test #6:

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

input:

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

output:

NO
NO
YES
YES
YES
YES
NO
NO
YES
NO
NO
YES
YES
NO
YES
NO
NO
NO
YES
NO
YES
NO
YES
YES
YES
YES
YES
NO
NO
NO
NO
NO
NO
NO
NO
YES
YES
YES
YES
NO
YES
YES
YES
NO
YES
NO
NO
NO
NO
YES
YES
NO
YES
NO
YES
NO
YES
YES
NO
YES
NO
YES
YES
YES
NO
YES
NO
YES
NO
YES
NO
YES
YES
YES
YES
NO
YES
YES
YES
NO
YES
YES
YES
YES
N...

result:

ok 20000 token(s): yes count is 10265, no count is 9735

Test #7:

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

input:

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

output:

NO
YES
NO
NO
YES
YES
YES
NO
NO
YES
NO
NO
YES
YES
NO
NO
NO
YES
NO
YES
NO
NO
YES
NO
NO
NO
YES
YES
YES
YES
YES
NO
NO
NO
NO
NO
NO
YES
YES
YES
NO
NO
YES
YES
NO
YES
NO
NO
YES
NO
NO
YES
YES
YES
NO
NO
NO
NO
YES
NO
NO
NO
NO
YES
NO
NO
YES
YES
NO
YES
NO
YES
YES
NO
NO
YES
YES
NO
YES
NO
YES
YES
YES
YES
YES
YES
N...

result:

ok 20000 token(s): yes count is 10355, no count is 9645

Test #8:

score: 0
Accepted
time: 59ms
memory: 3852kb

input:

1000
56 3
22 260 202
59 232 256
12 84 309
129 171 317
93 238 313
46 237 174
53 272 310
37 95 229
141 161 327
50 146 216
32 203 262
85 219 320
13 207 332
43 86 284
65 230 336
9 210 271
68 263 205
48 193 240
145 64 235
15 269 322
126 223 162
3 70 281
120 110 246
104 155 267
102 159 331
134 139 253
20 ...

output:

NO
NO
YES
YES
NO
NO
NO
YES
YES
YES
YES
NO
NO
NO
YES
YES
NO
NO
YES
NO
YES
NO
YES
NO
NO
NO
NO
YES
YES
YES
NO
YES
YES
NO
YES
YES
NO
NO
NO
NO
NO
NO
YES
NO
NO
YES
YES
YES
NO
YES
NO
NO
YES
NO
YES
YES
YES
NO
NO
YES
NO
NO
NO
NO
YES
YES
YES
YES
NO
YES
NO
YES
NO
YES
NO
YES
NO
NO
NO
NO
NO
NO
YES
YES
YES
NO
NO
...

result:

ok 1000 token(s): yes count is 469, no count is 531

Test #9:

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

input:

1000
56 3
168 90 271
147 230 233
44 113 327
32 214 333
57 251 298
13 117 312
109 61 293
165 137 273
99 248 187
171 183 326
55 227 217
75 263 264
6 104 242
15 265 278
139 84 292
48 122 252
154 218 296
37 131 284
19 181 294
89 211 285
69 172 318
11 260 212
33 234 308
142 180 309
49 53 208
178 270 282
...

output:

NO
NO
YES
NO
YES
YES
NO
YES
YES
YES
YES
NO
YES
YES
NO
NO
YES
YES
NO
YES
YES
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
YES
YES
NO
YES
YES
YES
NO
YES
NO
NO
YES
YES
NO
NO
YES
NO
NO
YES
NO
NO
NO
NO
NO
YES
YES
NO
YES
YES
YES
NO
YES
YES
YES
YES
NO
NO
NO
NO
YES
NO
NO
NO
YES
NO
NO
YES
NO
YES
NO
NO
YES
NO
YES
N...

result:

ok 1000 token(s): yes count is 497, no count is 503

Test #10:

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

input:

1000
28 7
35 110 142 174 274 311 378
41 56 113 221 265 297 383
20 76 129 245 242 347 353
10 89 128 194 249 301 389
55 97 119 202 231 302 381
65 73 150 216 268 339 364
45 75 126 235 282 338 343
9 102 136 187 229 328 391
62 127 170 171 277 344 350
32 96 144 186 256 309 375
42 64 139 179 279 336 368
26...

output:

NO
YES
YES
NO
NO
NO
YES
YES
YES
NO
NO
NO
NO
NO
NO
NO
NO
YES
NO
NO
NO
YES
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
YES
YES
NO
YES
YES
YES
NO
NO
NO
YES
YES
NO
NO
NO
NO
YES
YES
NO
NO
NO
YES
NO
YES
YES
NO
NO
NO
NO
YES
NO
NO
YES
YES
NO
NO
YES
YES
YES
YES
NO
YES
YES
NO
YES
NO
YES
YES
YES
YES
NO
YES
NO
YES
YES
NO
NO
...

result:

ok 1000 token(s): yes count is 441, no count is 559

Test #11:

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

input:

1000
52 3
2 187 257
104 159 268
40 117 293
95 128 170
116 240 311
78 137 236
99 237 279
65 196 289
48 191 156
133 254 219
53 218 182
20 79 244
29 123 209
33 174 296
17 94 306
74 96 283
147 132 201
118 202 292
112 171 281
16 121 172
129 63 146
43 83 301
127 109 275
25 233 274
18 200 305
27 157 269
97...

output:

NO
NO
NO
NO
NO
YES
NO
YES
YES
NO
NO
NO
NO
YES
YES
YES
NO
NO
NO
YES
YES
NO
YES
NO
NO
NO
YES
NO
YES
NO
NO
YES
NO
YES
NO
YES
YES
NO
YES
YES
YES
NO
YES
YES
NO
NO
YES
YES
YES
YES
NO
YES
YES
NO
NO
NO
NO
NO
NO
YES
NO
YES
NO
YES
YES
YES
NO
NO
NO
NO
YES
NO
YES
NO
YES
NO
YES
YES
YES
NO
NO
NO
YES
NO
NO
NO
NO
Y...

result:

ok 1000 token(s): yes count is 450, no count is 550

Test #12:

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

input:

1000
14 15
5 46 76 94 132 146 170 203 222 275 297 321 360 364 416
21 22 71 103 124 142 160 190 237 262 287 320 349 394 404
9 31 53 108 113 138 179 188 233 260 300 326 347 377 411
1 51 52 96 117 155 181 213 241 252 285 310 362 385 396
19 38 73 106 131 151 169 200 234 270 284 318 337 380 399
11 32 66 ...

output:

NO
YES
YES
YES
NO
YES
YES
NO
NO
NO
YES
YES
YES
YES
YES
YES
NO
NO
YES
YES
NO
YES
NO
YES
YES
YES
NO
YES
YES
NO
NO
YES
NO
NO
NO
NO
YES
NO
NO
NO
NO
NO
YES
NO
NO
NO
YES
YES
NO
NO
NO
YES
NO
NO
YES
NO
NO
NO
YES
NO
NO
YES
NO
NO
YES
NO
YES
NO
YES
YES
NO
NO
YES
YES
NO
NO
NO
NO
YES
NO
NO
YES
NO
YES
YES
YES
YES...

result:

ok 1000 token(s): yes count is 473, no count is 527

Test #13:

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

input:

1000
33 6
56 132 215 277 315 361
36 138 204 299 325 386
6 94 192 240 321 375
3 75 156 238 284 378
52 98 177 232 309 370
44 127 174 249 311 385
70 111 142 252 333 353
99 165 227 211 297 343
41 115 231 207 273 345
37 120 221 229 323 396
51 109 200 218 308 340
40 107 171 272 316 377
67 168 196 282 266 ...

output:

YES
YES
NO
NO
NO
YES
NO
NO
NO
YES
YES
NO
YES
YES
YES
NO
NO
YES
YES
YES
NO
YES
NO
YES
NO
YES
NO
NO
YES
YES
NO
YES
YES
NO
YES
YES
NO
YES
NO
NO
NO
YES
YES
NO
YES
YES
YES
YES
NO
NO
YES
NO
YES
NO
NO
YES
NO
NO
NO
NO
NO
YES
YES
YES
NO
NO
YES
NO
YES
NO
NO
YES
NO
NO
YES
NO
NO
NO
NO
NO
YES
NO
YES
YES
YES
NO
N...

result:

ok 1000 token(s): yes count is 489, no count is 511

Test #14:

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

input:

1000
13 14
4 28 58 79 104 125 152 169 211 266 273 297 323 358
15 25 71 88 102 133 154 187 203 260 294 301 324 348
6 49 68 81 118 146 168 193 243 239 277 296 337 342
24 44 59 82 99 122 163 202 231 255 269 303 316 344
17 41 62 93 108 143 144 182 224 253 289 295 315 347
21 34 52 70 105 142 151 200 226 ...

output:

NO
NO
NO
YES
YES
NO
YES
YES
YES
NO
NO
YES
NO
YES
YES
YES
NO
YES
YES
YES
NO
NO
NO
YES
YES
YES
NO
YES
YES
NO
YES
NO
NO
NO
NO
YES
NO
YES
YES
YES
YES
YES
NO
YES
YES
NO
YES
YES
NO
NO
YES
YES
NO
YES
NO
NO
YES
NO
NO
NO
NO
YES
YES
YES
YES
NO
NO
YES
NO
NO
NO
NO
YES
YES
NO
NO
NO
NO
NO
NO
NO
YES
NO
YES
YES
NO
...

result:

ok 1000 token(s): yes count is 473, no count is 527

Test #15:

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

input:

1000
14 14
41 45 76 113 144 145 200 232 241 279 298 299 357 380
3 51 67 119 146 164 179 214 243 272 289 306 333 391
21 43 91 114 127 160 190 231 245 266 292 313 352 389
4 42 87 118 128 174 189 218 234 273 293 315 348 382
24 68 86 108 139 163 204 217 264 269 282 318 353 383
31 44 84 88 151 156 196 22...

output:

YES
NO
NO
NO
NO
NO
NO
NO
YES
NO
NO
YES
NO
YES
YES
NO
NO
NO
YES
NO
YES
NO
YES
YES
NO
YES
NO
YES
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
YES
NO
YES
NO
NO
NO
YES
NO
YES
NO
NO
YES
YES
YES
YES
YES
NO
NO
YES
NO
NO
YES
YES
YES
NO
NO
YES
YES
NO
YES
NO
NO
NO
NO
YES
YES
YES
NO
YES
YES
NO
NO
NO
YES
NO
NO
NO
NO
NO
...

result:

ok 1000 token(s): yes count is 425, no count is 575

Test #16:

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

input:

1000
21 9
45 74 131 177 185 263 282 337 344
33 84 114 164 211 249 277 352 353
31 69 97 149 176 254 283 302 363
14 82 105 145 168 242 284 325 375
7 64 121 147 195 258 285 343 362
38 78 90 165 208 269 265 318 357
15 70 116 179 206 231 305 347 355
32 39 130 175 180 238 298 328 351
11 43 83 161 217 261 ...

output:

NO
NO
YES
YES
NO
NO
NO
YES
YES
NO
YES
NO
NO
YES
NO
NO
YES
YES
YES
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
YES
YES
NO
NO
NO
YES
NO
YES
NO
YES
YES
YES
NO
NO
NO
YES
YES
YES
YES
NO
NO
YES
NO
NO
YES
YES
YES
YES
YES
NO
NO
YES
YES
NO
NO
YES
YES
NO
YES
NO
NO
NO
NO
NO
NO
NO
YES
YES
NO
NO
YES
NO
NO
NO
NO
NO
YES
N...

result:

ok 1000 token(s): yes count is 457, no count is 543

Test #17:

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

input:

1000
6 36
4 28 34 52 63 70 77 89 95 107 125 128 145 159 175 187 194 212 230 240 251 258 272 287 303 311 328 340 335 349 364 381 384 398 403 426
8 30 42 49 56 65 75 87 98 114 127 137 144 170 179 185 196 207 232 244 254 260 277 289 297 319 329 334 343 350 363 371 388 401 405 432
1 32 37 55 61 69 79 91...

output:

NO
NO
YES
NO
NO
NO
NO
NO
YES
NO
NO
YES
YES
NO
NO
NO
NO
NO
NO
YES
NO
NO
NO
YES
NO
YES
NO
NO
YES
YES
YES
YES
NO
NO
YES
NO
YES
YES
YES
NO
NO
YES
YES
YES
YES
YES
NO
NO
YES
NO
NO
YES
NO
YES
NO
NO
NO
YES
YES
YES
NO
NO
NO
NO
NO
NO
YES
YES
NO
NO
YES
YES
NO
YES
YES
YES
YES
YES
YES
YES
YES
NO
YES
NO
NO
NO
NO
...

result:

ok 1000 token(s): yes count is 464, no count is 536

Test #18:

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

input:

50
62 62
34 198 257 495 599 702 807 942 1102 1224 1296 1407 1560 1623 1771 1894 1978 2125 2203 2361 2539 2684 2749 2887 3017 3104 3261 3333 3528 3590 3752 3878 3921 4063 4194 4395 4522 4565 4702 4841 4971 5083 5265 5443 5532 5691 5739 5909 6052 6198 6315 6419 6545 6731 6836 6956 7009 7204 7278 7345 ...

output:

NO
YES
YES
NO
NO
YES
NO
YES
NO
NO
YES
YES
YES
NO
NO
YES
YES
NO
YES
NO
NO
NO
YES
NO
NO
NO
NO
NO
YES
NO
YES
NO
YES
NO
YES
NO
YES
NO
NO
YES
YES
YES
YES
YES
NO
YES
NO
YES
NO
NO

result:

ok 50 token(s): yes count is 23, no count is 27

Test #19:

score: 0
Accepted
time: 87ms
memory: 4052kb

input:

50
63 63
115 189 304 375 570 662 753 889 941 1119 1259 1361 1395 1575 1761 1878 2017 2108 2224 2351 2435 2603 2816 2926 2965 3097 3284 3388 3512 3731 3845 3931 4031 4145 4339 4475 4593 4638 4778 4910 5032 5234 5321 5451 5571 5753 5855 5960 6145 6182 6412 6553 6590 6773 6889 7034 7135 7291 7355 7455 ...

output:

NO
YES
YES
YES
YES
NO
NO
NO
YES
YES
NO
NO
NO
NO
NO
NO
NO
YES
NO
NO
YES
YES
YES
YES
NO
NO
NO
YES
YES
YES
NO
YES
YES
YES
NO
NO
NO
YES
YES
NO
YES
YES
YES
NO
NO
YES
NO
YES
YES
NO

result:

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

Test #20:

score: 0
Accepted
time: 82ms
memory: 4008kb

input:

50
315 12
385 1013 1757 2325 2584 3524 4154 4338 4939 6166 6819 7231
288 798 1283 1921 2732 3457 3926 4867 5283 5557 6641 7464
162 641 1728 1911 2366 3395 3814 4823 5189 6129 6476 6949
110 864 1497 1886 2482 3574 4105 4626 5577 5904 6910 7000
394 989 1593 2022 2972 3225 3801 4584 5256 5976 6399 6879...

output:

YES
NO
YES
NO
NO
YES
NO
YES
YES
NO
YES
NO
NO
NO
NO
NO
NO
NO
YES
YES
YES
NO
NO
NO
YES
NO
YES
YES
YES
YES
NO
YES
YES
YES
NO
NO
YES
NO
YES
NO
NO
YES
NO
NO
YES
YES
NO
YES
YES
YES

result:

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

Test #21:

score: 0
Accepted
time: 86ms
memory: 3956kb

input:

50
441 9
543 1572 2713 3054 3720 5123 5376 6901 7710
876 1343 2413 3656 3605 5072 5923 6246 7336
305 1399 2258 2705 4191 5327 5736 6887 7527
121 1109 2402 2859 3920 4826 5867 6685 7323
213 1528 1808 3327 4205 4375 5790 6745 7457
790 1083 2399 3266 3736 4910 6075 6322 7853
189 1848 1926 3278 4217 495...

output:

YES
NO
YES
YES
YES
YES
NO
NO
YES
NO
YES
YES
YES
NO
YES
NO
YES
YES
YES
NO
YES
YES
NO
NO
NO
NO
NO
NO
NO
YES
NO
YES
NO
YES
NO
NO
YES
YES
NO
NO
YES
YES
YES
NO
YES
YES
NO
NO
NO
NO

result:

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

Test #22:

score: 0
Accepted
time: 86ms
memory: 4048kb

input:

50
63 63
67 217 278 432 643 733 811 964 1144 1229 1322 1443 1507 1638 1882 1926 2084 2227 2356 2448 2601 2664 2792 3014 3021 3220 3335 3463 3622 3768 3846 4025 4192 4277 4431 4549 4645 4795 4786 4936 5105 5178 5413 5526 5558 5793 5921 5933 6132 6197 6416 6551 6617 6791 6820 6957 7146 7244 7344 7459 ...

output:

NO
NO
YES
YES
YES
NO
NO
YES
YES
NO
YES
NO
YES
YES
NO
NO
YES
NO
NO
NO
NO
NO
NO
NO
YES
YES
YES
YES
YES
YES
YES
NO
YES
YES
NO
NO
YES
YES
YES
NO
YES
YES
NO
NO
YES
YES
NO
NO
YES
YES

result:

ok 50 token(s): yes count is 27, no count is 23

Test #23:

score: 0
Accepted
time: 87ms
memory: 4064kb

input:

50
378 10
201 1163 2312 2200 3221 3881 4950 6071 6047 7159
403 978 2149 2406 3268 4195 5260 5817 6134 7463
696 1204 2210 2365 3460 3699 4703 5759 6175 7497
249 1175 2026 2831 3329 4173 5154 5506 6506 7413
644 776 1886 2605 3778 4228 4987 5677 6843 6822
546 971 1840 2993 3531 3891 4983 5133 6001 7395...

output:

NO
YES
NO
NO
YES
YES
NO
YES
NO
YES
NO
NO
YES
YES
NO
YES
NO
YES
YES
NO
NO
NO
NO
YES
YES
YES
YES
NO
YES
NO
NO
NO
YES
YES
YES
NO
YES
NO
NO
YES
YES
YES
NO
YES
YES
NO
NO
YES
YES
NO

result:

ok 50 token(s): yes count is 26, no count is 24

Test #24:

score: 0
Accepted
time: 86ms
memory: 4012kb

input:

50
10 395
14 30 75 78 103 113 151 158 198 209 225 252 267 292 313 322 350 378 392 399 436 453 468 494 531 534 586 600 606 628 656 674 701 717 734 742 761 809 813 833 846 863 892 913 919 954 974 989 997 1029 1045 1052 1079 1103 1119 1129 1162 1181 1198 1214 1240 1257 1275 1293 1303 1335 1346 1377 138...

output:

NO
YES
YES
YES
NO
NO
NO
YES
YES
NO
YES
NO
YES
YES
YES
YES
NO
NO
YES
NO
YES
YES
YES
NO
YES
NO
NO
NO
NO
YES
NO
YES
NO
NO
NO
YES
NO
NO
YES
NO
YES
YES
NO
YES
YES
NO
YES
YES
NO
YES

result:

ok 50 token(s): yes count is 26, no count is 24

Test #25:

score: 0
Accepted
time: 87ms
memory: 4296kb

input:

50
372 10
47 830 1739 2183 3176 4172 5058 5700 6016 7120
259 811 1730 2731 2981 3861 4819 5856 6584 7254
266 907 1392 2261 3163 3954 4607 5757 6382 6817
565 1393 1922 2256 2972 3667 5141 5825 6342 7043
123 1411 1719 2703 3484 3794 4543 5532 5963 6802
148 1146 2131 2904 3456 4381 4517 5875 6586 7438
...

output:

NO
YES
YES
NO
YES
YES
NO
YES
NO
YES
YES
YES
NO
NO
YES
NO
NO
YES
YES
YES
YES
YES
YES
YES
YES
NO
YES
YES
YES
NO
NO
YES
YES
YES
NO
NO
NO
YES
YES
NO
NO
NO
NO
YES
YES
YES
NO
YES
NO
NO

result:

ok 50 token(s): yes count is 29, no count is 21

Test #26:

score: 0
Accepted
time: 86ms
memory: 3936kb

input:

50
189 21
52 577 868 1218 1715 2034 2453 2868 3184 3396 3783 4326 4563 4991 5301 5644 6228 6626 6949 7352 7876
256 611 1029 1424 1821 2235 2543 2661 3042 3651 3837 4387 4684 5149 5329 5817 6337 6549 7117 7516 7653
248 566 1126 1138 1660 2188 2358 2739 3130 3543 4030 4410 4901 5103 5636 5845 6073 653...

output:

NO
YES
NO
NO
NO
YES
NO
YES
NO
NO
YES
NO
NO
YES
YES
NO
NO
YES
NO
NO
NO
NO
YES
YES
YES
YES
YES
YES
YES
NO
YES
YES
NO
NO
YES
YES
NO
NO
YES
YES
YES
NO
NO
YES
NO
NO
NO
NO
YES
NO

result:

ok 50 token(s): yes count is 23, no count is 27

Test #27:

score: 0
Accepted
time: 86ms
memory: 4028kb

input:

50
5 803
8 22 30 42 57 58 65 84 93 100 102 108 122 149 160 162 174 190 198 206 209 219 228 237 252 265 273 286 289 295 300 308 327 336 345 349 365 372 391 399 411 418 426 442 455 459 465 479 493 507 525 526 533 552 553 569 576 579 588 596 604 610 619 629 633 642 652 657 674 681 698 711 726 731 740 7...

output:

NO
NO
YES
YES
NO
YES
NO
YES
NO
YES
NO
NO
NO
YES
YES
NO
NO
YES
YES
YES
YES
YES
YES
YES
YES
NO
NO
NO
NO
YES
YES
YES
YES
YES
YES
YES
NO
YES
NO
NO
YES
NO
YES
NO
YES
NO
YES
YES
YES
YES

result:

ok 50 token(s): yes count is 30, no count is 20

Test #28:

score: 0
Accepted
time: 101ms
memory: 8044kb

input:

5
200 200
15 671 1037 1476 2036 2395 2736 2886 3297 3666 4279 4636 5033 5595 5835 6251 6823 7097 7350 7744 8170 8644 8844 9470 10025 10324 10637 10978 11216 11856 12158 12640 13177 13514 13850 14355 14579 15062 15338 15719 16357 16504 17121 17539 18025 18310 18553 19133 19519 19764 20293 20658 21213...

output:

NO
YES
YES
NO
YES

result:

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

Test #29:

score: 0
Accepted
time: 118ms
memory: 8028kb

input:

5
199 200
18 381 972 1353 1713 2366 2728 2933 3568 3688 4114 4621 5137 5488 5656 6099 6424 6851 7441 7804 8163 8670 8846 9301 9663 10176 10318 11052 11396 11789 12264 12417 13085 13246 13733 14200 14519 15103 15261 15826 16123 16590 16801 17270 17814 17991 18595 18810 19522 19838 20116 20585 20793 2...

output:

YES
NO
NO
YES
NO

result:

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

Test #30:

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

input:

5
1200 33
1109 3084 6343 7352 11845 13407 16744 17637 20075 23140 25875 28335 30532 32845 33836 37168 40118 40577 43809 46887 48735 51417 54133 56582 59691 60809 63687 65320 67861 70140 73310 74862 79046
1854 4538 5276 8213 9605 14236 15800 17677 19669 21926 24613 28540 28946 32185 34395 37012 40297...

output:

YES
NO
YES
NO
NO

result:

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

Test #31:

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

input:

5
3 13370
6 8 13 19 21 30 37 40 48 52 53 57 60 65 69 78 82 85 87 95 107 118 121 123 128 132 137 141 152 156 165 173 178 188 191 196 203 209 213 223 232 233 245 248 258 267 271 278 281 284 293 299 302 306 323 328 335 336 344 348 352 360 369 377 389 392 394 404 413 417 419 424 431 436 437 448 457 465 ...

output:

NO
NO
YES
YES
YES

result:

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

Test #32:

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

input:

5
199 200
322 717 873 1330 1689 2388 2640 2893 3501 3803 4298 4425 5045 5448 5605 5979 6417 6862 7482 7715 7923 8594 8944 9414 9705 9895 10539 10863 11338 11514 12100 12383 12895 13417 13466 13981 14386 15052 15223 15691 15929 16432 16671 17427 17491 18135 18320 18691 19180 19689 20061 20704 21138 2...

output:

NO
YES
YES
NO
YES

result:

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

Test #33:

score: 0
Accepted
time: 118ms
memory: 8088kb

input:

5
200 200
319 416 984 1379 1640 2382 2581 3152 3343 3900 4061 4538 5034 5598 5872 6246 6703 7125 7262 7761 8098 8766 8821 9556 9793 10057 10383 10825 11476 11622 11972 12722 12835 13133 13599 14198 14607 14798 15248 15686 15902 16444 16882 17388 17740 17919 18532 18734 19228 19817 19966 20496 21054 ...

output:

YES
NO
NO
YES
YES

result:

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

Test #34:

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

input:

5
199 199
85 604 880 1275 1554 2320 2534 2962 3300 3714 4033 4721 4930 5298 5939 6064 6559 6999 7266 7923 8050 8739 9178 9308 9926 10136 10821 11059 11408 11924 12160 12754 13196 13255 13893 14079 14596 14882 15380 15855 16121 16519 17170 17224 17629 18346 18380 18844 19179 19926 20273 20664 20878 2...

output:

NO
YES
YES
NO
NO

result:

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

Test #35:

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

input:

5
4004 10
7592 16501 22358 26746 39214 39330 54628 62444 68924 71720
3720 8802 15946 28293 32586 48525 50881 63175 71662 72527
5349 13113 19647 28946 35497 46905 54548 57980 65260 78383
8225 12311 23742 28406 31895 41807 53676 61619 69053 79939
1855 14892 21743 32291 39498 47078 53674 62031 70851 79...

output:

YES
NO
YES
YES
YES

result:

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

Test #36:

score: 0
Accepted
time: 98ms
memory: 8160kb

input:

5
2 20046
3 7 10 12 15 16 19 25 26 30 33 38 40 49 51 56 66 68 72 74 79 80 85 90 92 94 96 106 110 114 116 123 124 130 134 138 146 149 153 157 160 172 176 183 192 201 204 208 209 211 214 217 221 222 229 230 234 240 242 245 247 254 256 257 261 267 270 274 279 290 299 304 310 314 317 319 322 326 327 331...

output:

NO
YES
YES
YES
NO

result:

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

Test #37:

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

input:

5
8 4939
12 36 61 73 88 98 123 133 142 171 175 192 225 239 251 280 300 316 324 339 372 386 396 415 422 447 466 488 492 502 527 548 554 581 593 611 614 628 651 661 682 698 721 735 763 770 781 792 806 819 835 849 874 890 906 916 939 952 976 988 997 1016 1031 1054 1060 1073 1096 1103 1123 1144 1157 117...

output:

NO
YES
NO
NO
YES

result:

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

Test #38:

score: 0
Accepted
time: 83ms
memory: 25208kb

input:

1
5 39985
7 16 24 33 35 43 61 78 79 93 100 110 111 130 138 147 162 175 187 200 204 219 224 230 241 254 275 278 295 303 326 332 345 352 363 373 376 383 402 409 435 442 451 460 466 470 483 488 499 504 514 523 532 543 563 573 580 582 597 612 625 635 640 646 659 668 685 695 703 708 715 719 740 747 759 7...

output:

YES

result:

ok YES

Test #39:

score: 0
Accepted
time: 80ms
memory: 24976kb

input:

1
9 22219
14 20 52 56 82 98 115 133 150 159 185 204 213 232 243 262 280 293 313 327 346 382 396 423 434 449 458 484 501 512 524 551 571 596 601 630 639 661 671 712 725 745 758 766 783 816 820 858 875 888 905 918 926 952 980 989 999 1023 1037 1067 1079 1095 1109 1131 1138 1176 1183 1199 1219 1234 125...

output:

YES

result:

ok YES

Test #40:

score: 0
Accepted
time: 86ms
memory: 25316kb

input:

1
3 66636
7 12 18 23 28 30 42 51 64 65 73 78 82 87 94 97 108 115 122 125 126 136 139 144 150 155 162 163 171 192 196 204 212 215 221 223 228 235 241 251 257 265 273 277 284 288 301 309 310 321 324 330 337 340 348 355 364 370 373 375 379 381 389 395 398 402 406 412 415 421 434 440 443 444 455 460 462...

output:

YES

result:

ok YES

Test #41:

score: 0
Accepted
time: 140ms
memory: 24976kb

input:

1
1341 149
1638 3562 7834 8104 12335 15034 18037 20840 24107 24991 27977 32317 32838 36542 39532 42306 45137 47555 50063 52482 55272 57429 61058 61635 65720 69101 69434 72417 77044 80051 80561 83979 85990 90274 93401 95258 96848 99666 103580 104750 107933 111302 112880 115868 118635 120707 123127 12...

output:

YES

result:

ok YES

Test #42:

score: 0
Accepted
time: 169ms
memory: 25152kb

input:

1
24995 8
16336 60188 95252 157925 225820 266446 309927 369860
12411 65982 114433 203762 219751 274497 356705 363271
6978 75814 111675 160477 208004 297662 317708 383270
15346 99014 107532 166173 195352 292236 330065 358540
20470 100633 117083 183529 249398 284570 336134 351224
4088 92530 121085 175...

output:

NO

result:

ok NO

Test #43:

score: 0
Accepted
time: 141ms
memory: 24704kb

input:

1
4470 44
7402 12277 21647 30339 44398 53159 54652 64263 79061 83487 93811 104025 110157 123878 126386 139826 142937 161166 162087 172236 184174 196334 200355 206231 221374 225816 233138 247789 252883 261646 268272 279095 294289 301582 306973 320053 323700 335027 345087 348593 363844 370840 377555 3...

output:

NO

result:

ok NO

Test #44:

score: 0
Accepted
time: 129ms
memory: 24924kb

input:

1
447 447
178 1334 2434 2999 4129 4638 5621 7206 7879 8837 9708 10138 11087 11847 13374 14284 14878 15853 17038 17177 18762 19072 19885 20789 22113 22904 23596 24505 25959 26620 27746 27894 29575 29889 31377 31839 32414 33987 34651 35137 36603 36934 37855 39220 39887 40482 41349 42510 43354 44150 45...

output:

YES

result:

ok YES

Test #45:

score: 0
Accepted
time: 141ms
memory: 25060kb

input:

1
447 447
336 1105 2178 2882 3826 4642 5537 6454 7320 7938 9389 10475 10804 11966 12628 13202 14914 15194 16202 16692 18385 18634 20130 20692 21266 22395 23208 24167 24958 26191 27479 27631 28691 29856 30254 31853 32837 32953 33835 35304 36215 36549 38084 38970 39375 40021 41058 42383 43340 43752 44...

output:

NO

result:

ok NO

Test #46:

score: 0
Accepted
time: 128ms
memory: 24924kb

input:

1
447 447
625 1156 2431 2897 3997 5022 6054 6756 7320 8811 9565 10468 10969 11893 12810 14261 14541 15537 16943 17758 18134 19532 20105 21072 21553 23106 23353 24343 25260 25937 27138 27650 28623 30352 31248 31886 32996 33310 34818 35188 36252 37474 38241 39061 39715 40569 41474 42594 43255 44294 45...

output:

NO

result:

ok NO

Test #47:

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

input:

1
5 39983
1 13 17 41 52 60 67 71 87 100 113 128 133 144 154 162 179 199 205 212 226 234 244 262 267 283 291 303 313 325 331 350 358 364 375 388 401 417 424 434 451 460 464 480 493 506 516 521 524 539 548 561 563 572 584 597 602 616 622 626 643 655 657 667 675 678 699 711 716 732 733 754 762 769 776 ...

output:

NO

result:

ok NO

Test #48:

score: 0
Accepted
time: 130ms
memory: 24908kb

input:

1
447 447
725 907 2235 2830 4085 4956 5547 6693 7086 8360 9600 9949 10857 11890 12753 14022 14608 15457 16639 17071 18445 19206 19739 20497 21780 22178 23732 24092 24978 25695 27348 27981 28759 29993 30349 31776 32169 33503 33978 34985 35776 36435 38023 38442 39795 40264 41638 42472 43242 44253 4488...

output:

YES

result:

ok YES

Test #49:

score: 0
Accepted
time: 142ms
memory: 24920kb

input:

1
447 447
651 1294 1834 3364 3699 5072 5681 6346 7188 8433 9685 10133 11578 12113 13261 13657 14999 15848 16591 17112 18402 19378 19657 21106 21571 22811 23258 24598 25335 26108 27256 28122 29036 29833 30535 31345 32105 33477 33879 34871 35604 37043 38045 38747 39741 40078 40926 42191 42992 43720 45...

output:

YES

result:

ok YES

Test #50:

score: 0
Accepted
time: 138ms
memory: 24916kb

input:

1
894 223
1251 2978 5462 5685 7578 9230 11634 13715 15734 17356 18132 21063 23051 24146 26589 28307 29552 31907 32373 34748 36274 37828 39991 42976 44382 45128 46886 50096 51519 52313 55331 56852 57925 60814 61393 64289 66377 68167 70073 71258 72914 73832 77039 78030 79757 82259 82693 86176 86341 89...

output:

YES

result:

ok YES

Test #51:

score: 0
Accepted
time: 137ms
memory: 24900kb

input:

1
447 447
267 1432 2195 2850 4002 4823 6007 6715 7334 8310 9515 10579 11014 12092 13524 13912 14480 16132 17094 17514 18314 19061 20711 21218 22303 22721 23492 25008 25782 26174 27781 28249 29512 30272 30878 31730 32919 33280 34855 35588 36189 37493 37673 39185 39706 40741 41370 42229 43140 44133 45...

output:

YES

result:

ok YES

Test #52:

score: 0
Accepted
time: 176ms
memory: 25164kb

input:

1
28563 7
24603 79433 131844 209256 260772 277355 371634
34749 104228 151413 211920 271207 309363 378154
15126 76420 143380 196336 246925 309473 339089
9743 84348 168106 214012 263143 319079 358639
15952 72182 179647 207141 254814 319116 392030
34288 97200 155475 193049 235737 330950 374691
52649 75...

output:

YES

result:

ok YES

Test #53:

score: 0
Accepted
time: 131ms
memory: 25056kb

input:

1
447 447
221 942 2249 2933 3930 4608 5603 6513 7949 8215 9789 10613 11474 12032 13045 13988 14729 15641 16774 17388 18513 18930 19692 20683 22106 22846 23606 24196 25036 26249 27178 27759 29027 29654 31085 31796 32563 33333 34167 35572 35672 36668 37975 39142 40043 40579 41639 42443 42994 44225 453...

output:

NO

result:

ok NO

Test #54:

score: 0
Accepted
time: 90ms
memory: 25096kb

input:

1
4 49999
3 12 19 28 34 41 50 54 63 71 74 83 89 98 105 119 125 132 135 154 161 163 171 177 183 191 197 202 217 224 238 246 254 265 270 284 294 303 310 322 324 331 341 346 355 364 376 383 407 417 420 422 441 446 452 459 468 476 480 489 494 500 509 514 523 524 533 536 547 564 569 573 583 587 595 605 6...

output:

NO

result:

ok NO

Test #55:

score: 0
Accepted
time: 146ms
memory: 24868kb

input:

1
1788 111
3502 3653 7299 13640 16712 20844 23434 25792 30352 33781 38723 39596 45131 47682 50861 54878 57322 61396 66778 70907 73001 76750 80119 83362 87438 92717 93459 97047 103814 105731 110611 112388 116916 120137 122167 127254 131314 135181 138022 140746 144798 148164 151362 155350 161220 16262...

output:

NO

result:

ok NO

Test #56:

score: 0
Accepted
time: 82ms
memory: 25084kb

input:

1
7 28561
14 28 34 54 67 79 90 101 117 130 133 143 155 169 178 195 224 245 247 269 282 297 310 332 344 350 365 383 394 418 419 437 457 470 487 488 506 524 536 556 562 576 600 604 621 639 641 658 669 689 695 704 721 756 759 790 792 820 834 840 844 863 881 912 915 935 940 957 971 985 990 1012 1017 102...

output:

YES

result:

ok YES

Test #57:

score: 0
Accepted
time: 180ms
memory: 25436kb

input:

1
99956 2
81060 130817
24037 43766
112921 123148
355884 182868
353413 26061
283940 185242
338594 171196
257123 311086
174828 167890
315531 398971
174166 201667
303089 258479
110372 127028
341670 386490
81363 44587
235276 73367
152005 163209
355123 88168
368100 155239
66409 304203
149786 252469
15865...

output:

NO

result:

ok NO

Extra Test:

score: 0
Extra Test Passed