QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#54168#4927. Bounded Spanning Treelarryzhong37 2763ms61036kbC++173.0kb2022-10-07 10:44:592022-10-07 10:45:02

详细

Subtask #1:

score: 0
Memory Limit Exceeded

Test #1:

score: 0
Memory Limit Exceeded

input:

1
500001 500000
254401 281557 349855 349855
181158 183050 7695 7695
168649 393239 182447 182447
275491 426002 407013 407013
412840 430191 81351 81351
180729 474744 468590 468590
167128 233022 352396 352396
56562 410078 411755 411755
28611 28934 27783 27783
250615 303207 495889 495889
348947 377767 2...

output:


result:


Subtask #2:

score: 6
Accepted

Test #22:

score: 6
Accepted
time: 1ms
memory: 3664kb

input:

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

output:

YES
3 8 5 2 1 6 10 9 7 4

result:

ok all is ok (1 test case)

Test #23:

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

input:

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

output:

YES
1 7 2 3 4 5 6 8 9

result:

ok all is ok (1 test case)

Test #24:

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

input:

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

output:

YES
8 1 6 3 4 2 9 5 10 7

result:

ok all is ok (1 test case)

Test #25:

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

input:

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

output:

YES
6 2 5 3 1 4 9 7 8

result:

ok all is ok (1 test case)

Test #26:

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

input:

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

output:

YES
2 9 3 5 1 6 10 7 8 4

result:

ok all is ok (1 test case)

Test #27:

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

input:

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

output:

YES
8 5 1 4 2 9 3 6 7

result:

ok all is ok (1 test case)

Test #28:

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

input:

2
4 5
2 3 1 1
2 4 2 3
1 2 5 5
2 3 3 3
2 4 4 5
4 5
2 3 1 2
1 2 1 2
1 4 3 3
3 4 4 4
1 3 5 5

output:

YES
1 2 5 3 4
YES
1 2 3 4 5

result:

ok all is ok (2 test cases)

Test #29:

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

input:

3
3 3
1 3 1 2
1 2 3 3
1 2 1 2
3 3
1 2 1 1
1 3 2 3
2 3 3 3
3 3
2 3 3 3
1 2 2 3
2 3 1 1

output:

NO
YES
1 2 3
NO

result:

ok all is ok (3 test cases)

Test #30:

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

input:

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

output:

YES
3 1 4 2

result:

ok all is ok (1 test case)

Test #31:

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

input:

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

output:

YES
10 3 2 1 8 6 4 9 5 7

result:

ok all is ok (1 test case)

Test #32:

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

input:

1
5 10
2 3 4 8
1 3 1 5
3 5 1 4
3 4 5 8
4 5 8 10
3 5 4 6
1 3 1 2
2 4 9 9
2 3 8 9
3 4 4 6

output:

YES
7 1 3 5 10 4 2 9 8 6

result:

ok all is ok (1 test case)

Subtask #3:

score: 10
Accepted

Dependency #2:

100%
Accepted

Test #33:

score: 10
Accepted
time: 2ms
memory: 3672kb

input:

3
4 6
1 2 1 3
1 3 2 6
3 4 1 2
1 4 2 5
2 3 2 4
2 4 4 6
4 4
1 2 2 2
2 3 3 3
3 4 4 4
1 4 1 4
5 6
1 2 1 1
2 3 1 2
3 4 2 4
4 5 6 6
1 4 4 6
1 4 5 6

output:

YES
1 3 2 5 4 6
NO
YES
1 2 3 6 4 5

result:

ok all is ok (3 test cases)

Test #34:

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

input:

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

output:

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

result:

ok all is ok (1 test case)

Test #35:

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

input:

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

output:

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

result:

ok all is ok (1 test case)

Test #36:

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

input:

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

output:

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

result:

ok all is ok (1 test case)

Test #37:

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

input:

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

output:

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

result:

ok all is ok (1 test case)

Test #38:

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

input:

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

output:

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

result:

ok all is ok (1 test case)

Test #39:

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

input:

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

output:

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

result:

ok all is ok (1 test case)

Test #40:

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

input:

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

output:

YES
6 3 4 2 7 5 1 8 10 9
YES
2 10 3 5 8 1 4 9 6 7

result:

ok all is ok (2 test cases)

Test #41:

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

input:

3
5 6
4 5 1 2
1 4 6 6
1 3 3 3
2 4 4 4
2 5 2 3
3 5 4 5
5 6
4 5 6 6
3 5 2 3
2 5 2 3
1 5 1 2
1 5 5 5
2 5 4 4
4 5
1 3 4 4
2 3 5 5
1 4 2 2
1 4 3 3
1 4 1 1

output:

NO
YES
6 2 3 1 5 4
NO

result:

ok all is ok (3 test cases)

Test #42:

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

input:

1
12 20
3 8 12 20
3 10 2 2
3 4 1 1
1 3 4 8
3 11 9 9
3 5 1 8
3 7 1 8
3 6 10 16
3 9 16 20
2 3 8 16
3 12 9 13
4 6 14 15
8 11 16 20
3 11 13 13
4 5 4 7
1 10 2 10
2 12 5 13
3 9 16 20
4 7 8 8
2 9 20 20

output:

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

result:

ok all is ok (1 test case)

Test #43:

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

input:

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

output:

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

result:

ok all is ok (1 test case)

Test #44:

score: 0
Accepted
time: 3ms
memory: 3700kb

input:

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

output:

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

result:

ok all is ok (1 test case)

Subtask #4:

score: 10
Accepted

Test #45:

score: 10
Accepted
time: 31ms
memory: 3840kb

input:

1
501 500
127 170 433 434
26 98 284 285
179 379 82 82
136 270 253 254
100 391 474 476
175 393 170 171
247 311 223 225
32 318 270 270
87 434 294 294
335 417 308 310
249 356 292 294
327 331 42 44
325 498 334 336
73 133 260 262
276 394 493 495
74 289 330 331
29 83 244 245
7 486 482 483
115 368 90 90
22...

output:

YES
433 284 82 254 476 170 223 270 294 308 293 44 336 261 493 331 244 482 90 277 32 115 416 106 240 386 479 444 125 500 487 305 399 86 474 408 455 458 15 87 41 141 24 128 33 383 29 342 333 381 448 214 346 365 2 25 397 13 499 357 326 310 391 139 366 488 449 361 498 285 436 153 481 412 83 328 84 187 3...

result:

ok all is ok (1 test case)

Test #46:

score: 0
Accepted
time: 32ms
memory: 3772kb

input:

1
501 500
129 176 247 250
72 179 289 289
170 435 422 422
135 320 255 256
126 397 150 150
25 112 29 29
341 422 112 112
68 176 419 421
83 208 266 267
111 470 144 149
212 488 163 165
109 261 468 468
457 478 500 500
298 426 427 432
61 408 459 464
235 440 297 302
114 117 307 307
132 448 37 38
128 380 219...

output:

YES
247 289 422 255 150 29 112 419 266 144 163 468 500 428 459 297 307 37 219 429 358 164 10 122 66 265 416 413 435 483 12 316 83 406 452 241 52 94 393 202 195 2 56 62 291 455 134 309 143 250 264 487 53 363 118 364 256 467 284 244 1 21 73 178 196 229 386 472 474 383 252 238 153 49 104 233 484 414 23...

result:

ok all is ok (1 test case)

Test #47:

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

input:

1
501 500
277 399 197 204
33 426 390 390
202 417 268 272
223 466 15 23
195 379 85 94
100 203 16 22
184 245 142 144
188 474 117 122
195 353 139 143
62 373 412 416
383 390 319 327
40 108 143 153
67 366 53 56
18 325 172 182
272 314 135 137
51 86 237 247
77 313 399 408
22 199 29 36
18 132 422 423
97 345...

output:

YES
197 390 268 15 85 16 142 117 139 414 319 143 53 172 135 237 399 29 422 353 12 313 38 464 286 121 95 487 206 289 88 165 437 32 497 370 203 314 1 18 180 125 292 3 331 420 101 222 359 240 486 141 64 212 468 119 367 252 158 385 281 482 219 347 483 368 341 473 477 271 242 339 405 438 264 226 332 400 ...

result:

ok all is ok (1 test case)

Test #48:

score: 0
Accepted
time: 29ms
memory: 3952kb

input:

1
501 500
212 481 169 188
28 427 404 420
339 466 43 62
229 281 111 126
89 143 234 238
333 444 160 168
288 484 431 451
177 432 441 453
384 407 418 427
146 340 118 118
92 249 467 479
53 469 396 398
63 70 174 180
54 367 8 19
285 360 153 164
67 389 286 291
91 442 99 104
1 455 58 67
207 309 453 472
286 4...

output:

YES
169 404 43 111 234 160 431 441 418 118 467 396 174 8 153 286 99 58 453 12 78 44 479 432 167 154 2 401 21 473 345 119 145 202 261 490 192 216 296 190 223 477 244 65 394 193 112 386 101 221 229 351 143 72 97 276 433 245 400 478 336 410 158 342 4 470 226 45 144 313 297 218 175 416 360 387 319 434 3...

result:

ok all is ok (1 test case)

Test #49:

score: 0
Accepted
time: 23ms
memory: 3964kb

input:

1
501 500
183 475 152 172
6 264 94 97
102 116 454 461
332 436 250 258
275 339 11 23
109 383 491 500
12 251 156 165
409 496 253 282
319 386 465 469
130 292 121 123
30 333 21 23
40 194 254 255
86 345 338 348
73 434 99 118
119 450 221 228
246 350 35 51
186 255 99 102
182 279 392 413
206 332 247 250
128...

output:

YES
152 94 454 250 11 491 156 264 465 121 21 254 338 99 221 35 101 392 247 197 478 248 404 194 161 269 146 345 410 371 453 443 477 417 281 271 73 316 189 291 238 352 157 246 341 488 427 241 448 277 178 220 500 68 2 3 298 347 227 385 332 96 437 33 374 51 411 236 142 71 475 59 365 323 265 289 78 309 1...

result:

ok all is ok (1 test case)

Test #50:

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

input:

1
501 500
56 261 38 63
139 152 248 251
173 435 92 131
254 445 21 36
74 246 202 208
52 442 422 447
328 340 434 466
179 434 92 126
200 241 127 132
48 294 183 203
72 271 147 172
42 382 245 265
330 466 349 368
59 216 120 125
279 443 359 381
469 478 292 309
51 100 21 39
186 475 275 299
94 495 420 429
323...

output:

YES
38 248 92 21 202 422 434 93 127 183 147 245 349 120 359 292 22 275 420 308 167 457 445 378 219 341 3 301 440 242 75 12 61 427 82 59 425 252 395 137 488 24 428 477 372 2 322 70 389 211 433 499 99 133 467 306 205 190 9 266 41 405 193 469 470 458 4 223 373 261 350 382 156 5 459 310 409 272 42 160 4...

result:

ok all is ok (1 test case)

Test #51:

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

input:

1
501 500
317 393 166 174
219 415 120 143
11 28 409 436
197 470 35 76
401 460 189 236
201 230 45 94
211 461 319 359
211 220 246 255
283 343 81 125
211 258 121 162
261 270 350 376
210 226 405 411
449 477 131 167
360 464 161 204
35 416 237 247
85 408 272 306
105 437 163 194
110 267 167 196
17 237 482 ...

output:

YES
166 120 409 35 189 45 319 246 81 121 350 405 131 161 237 272 163 167 482 474 145 318 321 385 223 269 287 457 395 453 79 229 337 187 176 464 108 197 280 322 340 288 32 1 162 225 463 266 258 454 37 274 213 313 232 76 202 396 293 170 204 228 183 298 353 153 406 438 434 367 46 234 18 312 7 227 323 3...

result:

ok all is ok (1 test case)

Test #52:

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

input:

1
501 500
66 362 223 231
19 173 108 146
267 468 15 84
269 309 295 302
438 462 348 415
132 187 474 498
91 416 92 191
141 161 71 169
142 309 153 177
59 390 139 220
57 203 359 449
172 362 463 466
226 463 444 495
344 369 1 68
122 266 320 336
293 326 316 358
108 207 34 114
14 140 153 182
339 383 363 383
...

output:

YES
223 108 15 295 348 474 92 71 153 139 359 463 444 1 320 316 34 154 363 123 124 204 385 78 125 423 2 218 3 412 336 270 397 224 402 369 413 306 360 98 296 425 314 282 4 5 8 10 12 104 95 399 325 382 279 188 66 252 475 302 35 353 366 350 418 248 193 18 482 97 352 379 315 177 432 155 464 453 487 162 2...

result:

ok all is ok (1 test case)

Test #53:

score: 0
Accepted
time: 30ms
memory: 3960kb

input:

1
501 500
419 457 238 270
52 410 93 141
101 172 97 163
146 274 112 149
277 448 127 325
435 440 46 195
375 380 159 299
107 306 326 359
31 441 188 346
6 55 174 197
74 340 16 123
38 437 1 72
265 366 178 255
203 442 1 105
42 119 215 281
54 65 1 85
72 213 14 208
358 392 301 302
210 359 125 197
142 293 27...

output:

YES
238 93 97 112 127 46 159 326 188 174 16 1 178 2 215 3 14 301 125 271 211 315 121 15 325 232 281 41 148 368 4 83 447 401 5 385 282 6 316 169 323 10 50 259 420 264 176 17 393 157 58 78 417 303 354 47 235 304 318 295 414 7 351 199 216 313 126 82 173 74 317 24 390 342 395 327 179 308 439 182 379 63 ...

result:

ok all is ok (1 test case)

Test #54:

score: 0
Accepted
time: 32ms
memory: 3888kb

input:

1
501 500
153 365 163 163
123 153 196 196
123 282 30 33
282 361 105 110
85 361 466 471
85 126 290 290
43 126 8 9
43 273 423 425
273 357 101 101
142 357 62 63
142 499 336 341
22 499 493 495
22 408 125 127
54 408 124 129
54 355 85 88
315 355 113 116
60 315 198 200
60 309 37 42
309 369 53 57
95 369 144...

output:

YES
163 196 30 105 469 290 8 424 101 62 341 493 125 124 85 113 198 37 54 144 130 70 222 488 221 202 388 245 213 339 16 465 9 4 298 72 429 360 165 42 183 55 333 328 172 82 335 306 407 317 495 219 229 291 373 462 46 160 56 274 104 347 297 91 226 309 303 155 10 243 467 180 208 438 107 302 98 453 440 16...

result:

ok all is ok (1 test case)

Test #55:

score: 0
Accepted
time: 28ms
memory: 3804kb

input:

1
501 500
23 115 137 146
23 68 233 249
53 68 53 59
53 342 321 335
11 342 342 356
11 279 281 295
76 279 401 414
76 236 441 448
236 454 468 484
325 454 240 253
287 325 418 423
287 351 423 435
14 351 318 331
14 141 206 208
141 404 309 312
166 404 53 64
84 166 270 283
84 311 42 57
205 311 347 357
161 20...

output:

YES
137 235 53 321 342 281 401 441 468 240 418 423 318 206 309 54 270 42 347 263 35 246 220 39 440 61 373 24 333 349 454 377 65 393 298 456 80 116 253 449 151 412 83 149 98 192 27 489 306 452 259 1 165 416 417 75 25 176 112 392 139 384 307 287 135 282 493 356 389 175 346 91 445 395 413 250 378 180 3...

result:

ok all is ok (1 test case)

Test #56:

score: 0
Accepted
time: 25ms
memory: 3876kb

input:

1
501 500
106 202 458 492
36 202 180 230
36 327 245 293
133 327 448 463
133 174 211 216
174 256 73 89
256 278 82 113
111 278 242 292
111 194 15 42
194 480 188 211
432 480 473 500
161 432 191 193
55 161 290 320
7 55 347 390
7 28 17 25
28 418 188 197
408 418 48 91
389 408 52 69
297 389 459 486
268 297...

output:

YES
458 180 245 448 211 73 82 242 15 189 473 191 290 347 17 190 48 52 459 221 309 61 288 217 339 395 382 40 446 34 213 348 271 269 241 474 203 63 270 194 140 10 486 94 478 129 64 243 1 492 144 141 273 69 470 90 461 36 260 118 389 283 377 405 195 120 205 83 136 151 304 333 65 225 280 491 252 167 84 9...

result:

ok all is ok (1 test case)

Test #57:

score: 0
Accepted
time: 22ms
memory: 3796kb

input:

1
501 500
128 431 134 232
62 431 214 243
118 431 68 159
194 431 157 213
422 431 297 355
226 431 377 461
208 431 112 196
179 431 202 288
46 431 1 72
302 431 68 110
353 431 313 313
197 431 1 17
233 431 111 162
12 431 443 500
234 431 167 234
387 431 466 500
35 431 244 332
397 431 487 500
204 431 430 49...

output:

YES
134 214 68 157 297 377 112 202 1 69 313 2 111 443 167 466 244 487 430 17 254 342 3 51 305 15 399 33 5 494 36 6 198 9 397 11 113 495 59 245 275 12 90 408 367 416 288 175 65 102 352 475 13 194 24 391 298 317 26 57 173 291 337 52 136 193 449 171 368 388 14 29 345 269 215 363 255 289 247 58 216 351 ...

result:

ok all is ok (1 test case)

Test #58:

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

input:

1
501 500
22 209 135 163
22 127 290 314
22 45 167 197
22 333 178 195
22 275 131 163
22 346 137 139
22 382 177 202
22 48 126 154
22 253 405 440
22 415 466 492
22 168 112 119
22 252 445 465
22 337 46 68
22 98 170 192
22 87 314 338
22 448 473 488
22 93 276 287
22 259 459 488
22 77 194 222
22 277 208 21...

output:

YES
135 290 167 178 131 137 177 126 405 466 112 445 46 170 314 473 276 459 194 208 104 455 431 475 101 243 500 200 420 202 14 165 7 460 188 154 132 244 278 345 430 427 313 74 76 123 191 82 337 245 391 467 265 241 130 83 49 362 363 168 129 327 301 480 379 180 139 387 50 319 24 474 370 468 432 239 221...

result:

ok all is ok (1 test case)

Test #59:

score: 0
Accepted
time: 22ms
memory: 3880kb

input:

1
501 500
124 342 261 323
7 124 103 106
124 439 303 341
124 443 316 342
81 124 456 458
124 429 24 53
124 413 205 262
75 124 54 91
124 336 348 382
124 433 412 452
124 147 349 401
124 180 91 150
124 501 385 434
124 133 191 247
124 447 152 220
18 124 469 493
124 271 67 76
124 316 395 457
124 279 260 29...

output:

YES
261 103 303 316 456 24 206 54 348 412 349 91 385 191 152 469 67 395 260 311 374 27 294 177 339 424 185 471 140 451 265 472 269 354 93 36 88 317 3 165 49 306 408 114 355 453 220 94 205 377 274 211 115 433 331 98 81 387 204 198 443 121 314 376 142 170 166 25 110 299 63 21 358 341 337 14 184 99 189...

result:

ok all is ok (1 test case)

Test #60:

score: 0
Accepted
time: 21ms
memory: 3952kb

input:

1
501 500
233 402 267 276
144 233 313 315
156 233 23 33
233 266 9 15
19 233 297 310
233 324 106 116
233 493 402 402
233 323 357 372
16 233 142 147
134 233 448 455
171 233 164 164
37 233 150 159
233 245 387 397
233 432 229 230
233 272 275 276
145 233 188 201
109 233 166 172
233 482 476 477
233 464 24...

output:

YES
267 313 23 9 297 106 402 357 142 448 164 150 387 229 275 188 166 476 247 151 231 135 163 468 276 335 41 1 246 428 190 45 270 496 20 15 366 471 441 344 105 290 485 65 399 345 125 118 49 17 426 308 156 495 192 375 314 98 139 82 348 318 2 278 440 404 367 334 252 99 131 479 200 5 16 240 353 27 293 4...

result:

ok all is ok (1 test case)

Test #61:

score: 0
Accepted
time: 18ms
memory: 3868kb

input:

1
501 500
156 217 398 408
56 217 92 93
145 217 57 62
217 399 350 355
82 217 470 474
217 308 311 321
31 217 227 227
217 476 314 324
217 289 386 398
122 217 289 296
217 501 217 229
217 398 328 329
217 458 462 472
217 357 192 199
132 217 266 271
131 217 136 137
152 217 365 374
121 217 375 386
217 358 2...

output:

YES
398 92 57 350 470 311 227 315 386 289 217 328 462 196 266 136 367 375 270 257 347 107 331 85 100 416 43 135 197 338 35 300 459 161 479 81 434 312 49 219 6 313 256 339 118 218 42 108 454 22 314 359 413 377 373 344 399 221 292 418 252 142 243 309 149 265 405 323 353 93 378 374 26 175 61 101 332 43...

result:

ok all is ok (1 test case)

Test #62:

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

input:

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

output:

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

result:

ok all is ok (20 test cases)

Test #63:

score: 0
Accepted
time: 3ms
memory: 3568kb

input:

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

output:

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

result:

ok all is ok (20 test cases)

Test #64:

score: 0
Accepted
time: 3ms
memory: 3660kb

input:

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

output:

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

result:

ok all is ok (20 test cases)

Test #65:

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

input:

50
11 10
5 10 1 3
7 10 3 6
3 10 6 6
8 10 4 7
10 11 10 10
1 10 1 1
2 10 8 9
6 10 5 5
9 10 7 9
4 10 1 3
11 10
1 4 7 10
4 7 9 10
4 10 5 5
4 5 3 4
4 9 8 8
4 11 2 4
4 6 4 6
2 4 1 1
4 8 6 9
3 4 7 9
11 10
2 5 4 4
5 11 2 3
1 5 4 7
5 9 7 7
5 8 7 10
5 6 1 1
5 10 6 8
3 5 2 3
5 7 5 5
4 5 10 10
11 10
4 10 10 10
...

output:

YES
2 4 6 7 10 1 8 5 9 3
YES
7 10 5 3 8 2 4 1 6 9
YES
4 2 6 7 9 1 8 3 5 10
YES
10 4 1 9 6 5 8 7 3 2
YES
4 9 8 1 6 7 3 10 2 5
YES
9 1 6 2 8 3 5 4 10 7
YES
9 1 10 6 7 4 8 5 2 3
YES
8 7 4 1 5 9 2 10 3 6
YES
5 2 9 7 3 4 10 1 6 8
YES
10 4 1 9 6 7 8 2 3 5
YES
4 7 8 3 5 1 2 9 6 10
YES
3 7 6 8 4 10 2 5 1 9
...

result:

ok all is ok (50 test cases)

Test #66:

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

input:

50
11 10
5 9 9 10
9 11 5 5
4 10 4 6
1 5 7 10
5 7 4 4
8 9 8 9
6 8 6 7
1 2 1 2
3 10 1 2
5 10 3 4
11 10
4 6 8 8
3 4 4 4
4 8 4 6
4 10 5 5
4 11 1 1
2 4 8 9
4 5 2 3
1 4 3 4
4 9 5 7
4 7 9 10
11 10
5 8 8 9
1 3 2 2
10 11 6 7
4 5 5 5
2 7 10 10
7 11 2 4
5 9 6 7
6 11 1 1
4 11 2 4
3 9 9 10
11 10
6 7 7 9
7 8 5 7
...

output:

YES
9 5 6 10 4 8 7 1 2 3
YES
8 4 6 5 1 9 2 3 7 10
YES
8 2 6 5 10 3 7 1 4 9
YES
7 5 4 9 2 10 1 6 3 8
YES
5 6 1 8 9 2 7 10 3 4
YES
9 5 1 3 6 4 10 2 8 7
YES
8 10 7 6 4 1 3 5 2 9
YES
6 7 9 3 8 4 2 5 1 10
YES
6 5 4 2 3 7 1 9 8 10
YES
8 3 10 4 5 6 9 2 1 7
YES
6 3 8 7 5 9 10 4 1 2
YES
1 7 4 2 5 10 8 6 9 3
...

result:

ok all is ok (50 test cases)

Test #67:

score: 0
Accepted
time: 4ms
memory: 3748kb

input:

10
51 50
13 32 47 48
3 32 46 50
3 35 13 22
32 40 8 8
22 35 42 50
3 16 31 42
15 22 1 11
22 25 37 50
16 41 5 10
17 22 8 15
34 41 36 37
3 51 10 13
4 16 1 6
35 48 44 50
28 40 26 33
24 32 49 50
4 20 24 24
27 40 20 25
8 25 16 26
40 46 30 41
8 36 4 17
17 18 3 3
19 28 29 37
6 48 5 16
6 7 1 12
20 47 43 49
17...

output:

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

result:

ok all is ok (10 test cases)

Subtask #5:

score: 0
Time Limit Exceeded

Dependency #4:

100%
Accepted

Test #68:

score: 0
Time Limit Exceeded

input:

1000
501 500
95 327 464 470
95 380 339 349
95 427 301 306
95 188 258 269
95 498 142 151
95 436 484 485
95 171 166 167
95 388 230 237
95 293 258 269
95 247 131 142
95 445 38 44
95 334 329 330
95 238 120 131
95 196 20 23
95 100 406 406
47 95 167 174
35 95 329 333
95 452 122 129
95 492 217 226
95 237 2...

output:

YES
464 339 301 258 142 484 166 230 263 131 38 329 120 20 406 167 330 122 217 257 366 204 127 66 70 440 193 347 268 472 357 47 429 297 367 372 473 201 129 79 1 285 488 351 382 299 145 156 7 265 243 321 492 128 101 211 169 13 132 10 176 133 77 249 73 395 343 319 52 411 274 302 480 224 92 29 159 332 3...

result:


Subtask #6:

score: 0
Time Limit Exceeded

Test #93:

score: 0
Time Limit Exceeded

input:

1000
500 500
100 331 2 8
162 182 272 276
133 415 393 397
144 176 499 500
64 273 47 55
37 463 424 428
96 481 127 127
115 341 333 336
79 95 246 248
266 473 473 476
117 140 113 120
112 309 323 330
251 438 39 45
22 339 275 285
83 474 264 266
185 212 282 291
377 425 25 31
42 436 351 357
35 69 173 182
159...

output:

YES
2 272 393 499 50 424 127 333 246 473 114 323 39 275 266 282 25 351 173 485 147 10 9 346 359 267 18 81 343 371 194 480 454 401 213 86 482 111 276 192 153 487 124 224 155 268 356 367 315 394 29 103 444 396 284 94 202 335 181 240 379 198 303 362 215 95 372 19 300 115 373 347 165 399 82 311 38 363 2...

result:


Subtask #7:

score: 11
Accepted

Dependency #3:

100%
Accepted

Dependency #4:

100%
Accepted

Test #119:

score: 11
Accepted
time: 16ms
memory: 3676kb

input:

100
26 50
9 15 7 10
10 26 11 14
18 26 9 13
4 19 8 9
11 20 17 21
12 15 27 27
14 20 22 27
19 24 9 11
7 10 1 3
1 6 9 14
19 20 3 4
15 26 4 5
16 23 19 24
1 19 17 17
2 19 35 39
21 23 39 39
6 26 6 6
7 25 11 11
5 24 4 6
9 16 11 15
8 19 31 33
3 5 21 22
13 23 35 37
6 22 41 43
5 17 1 3
13 26 38 38
4 5 16 18
18...

output:

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

result:

ok all is ok (100 test cases)

Test #120:

score: 0
Accepted
time: 16ms
memory: 3672kb

input:

100
26 50
11 18 17 18
16 20 13 14
7 9 23 23
21 22 3 4
4 20 7 8
11 23 19 19
1 20 24 25
12 15 15 15
7 21 9 9
15 24 1 2
17 18 11 11
8 22 22 22
5 18 7 7
5 26 20 21
3 12 5 6
13 23 33 33
1 18 32 33
14 25 10 10
12 19 29 29
10 21 1 2
5 21 6 6
14 22 30 30
2 5 16 16
3 6 12 12
2 3 4 4
2 20 46 47
3 6 49 49
11 2...

output:

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

result:

ok all is ok (100 test cases)

Test #121:

score: 0
Accepted
time: 198ms
memory: 3792kb

input:

10
251 500
28 246 256 275
16 246 304 304
71 246 163 169
34 246 389 407
115 246 298 299
73 246 259 279
225 246 33 35
56 246 442 448
76 246 10 10
30 246 151 166
18 246 55 55
55 246 185 195
15 246 211 212
239 246 360 366
177 246 201 215
4 246 368 385
104 246 158 161
9 246 90 102
93 246 285 288
2 246 16...

output:

YES
256 304 163 390 298 259 33 442 10 151 55 185 211 360 201 368 158 90 285 167 64 486 26 339 147 94 446 268 248 1 53 197 274 441 443 76 348 79 223 484 215 20 430 3 125 89 373 60 340 419 345 237 97 475 27 175 54 168 251 321 460 210 129 467 101 306 141 104 75 257 499 459 469 311 218 7 28 44 110 349 2...

result:

ok all is ok (10 test cases)

Test #122:

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

input:

10
251 500
31 58 98 116
31 148 319 325
31 37 71 80
31 169 486 500
31 221 385 390
13 31 389 390
31 247 332 339
31 239 61 65
31 64 144 151
31 88 238 248
31 202 381 389
31 68 461 481
31 108 194 213
31 179 465 484
31 53 340 356
31 131 444 449
22 31 313 322
26 31 1 4
25 31 278 279
31 113 407 408
31 233 4...

output:

YES
98 319 71 486 385 389 332 61 144 238 381 461 194 465 340 444 314 1 278 407 489 423 492 322 100 13 375 28 409 83 370 21 56 363 109 34 95 247 454 267 376 213 212 174 128 297 279 257 467 163 184 154 142 85 171 473 29 283 495 336 362 182 196 2 43 282 226 236 379 491 386 474 469 205 86 249 274 215 34...

result:

ok all is ok (10 test cases)

Test #123:

score: 0
Accepted
time: 9ms
memory: 7112kb

input:

1
2501 5000
2212 2301 1 5000
173 2301 1 4955
781 2301 800 5000
781 1932 2455 4096
1500 1932 1 5000
173 182 896 2532
182 1962 208 5000
867 2212 61 5000
264 1962 1 536
264 1591 1 5000
173 219 1 5000
1500 2435 1 2260
814 1962 1 5000
867 1568 2830 5000
173 950 1 5000
620 950 697 3292
264 613 3459 3551
7...

output:

NO

result:

ok all is ok (1 test case)

Test #124:

score: 0
Accepted
time: 6ms
memory: 7324kb

input:

1
3501 5000
2323 3344 1 759
1433 2323 461 5000
141 3344 724 4315
1556 2323 1 1735
1085 2323 1 3173
2112 2323 817 4396
1085 1332 4625 5000
1433 2526 735 5000
602 1085 1 2174
1541 3344 2108 5000
1332 2325 385 5000
110 3344 2947 4502
1213 1433 3823 4903
846 3344 1 2161
602 1237 1031 5000
1855 2112 4521...

output:

NO

result:

ok all is ok (1 test case)

Test #125:

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

input:

10
251 500
63 213 223 224
91 96 216 216
52 88 47 52
75 125 290 297
199 244 122 123
35 49 107 110
7 34 125 131
35 80 134 134
183 244 11 16
93 173 490 497
45 114 75 75
80 237 168 174
102 191 10 16
148 192 55 60
117 191 225 228
13 140 121 122
13 146 51 56
85 221 296 300
121 251 218 218
16 97 146 149
13...

output:

YES
223 216 47 290 122 107 125 134 11 490 75 168 14 55 225 121 51 296 218 147 276 34 36 76 249 60 103 222 61 16 65 365 42 94 37 99 20 148 1 4 328 43 62 48 27 267 192 77 45 35 179 278 213 53 73 259 175 13 86 21 139 87 32 120 18 58 95 291 67 127 56 346 15 52 131 226 101 150 195 104 74 90 118 466 22 3 ...

result:

ok all is ok (10 test cases)

Test #126:

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

input:

10
251 500
84 174 362 370
84 99 364 366
44 99 303 307
8 44 247 253
8 249 159 169
162 249 247 256
162 231 14 19
171 231 254 254
144 171 95 97
144 223 124 127
222 223 2 11
209 222 227 237
209 211 69 70
187 211 132 144
32 187 209 219
32 206 102 113
133 206 169 169
73 133 215 227
73 83 95 102
83 177 163...

output:

YES
362 364 303 247 159 248 14 254 95 124 2 227 69 132 209 102 169 216 96 163 231 201 127 142 179 21 128 202 48 99 116 217 35 211 229 140 31 59 218 104 148 37 1 111 133 50 13 178 220 154 147 109 177 129 36 183 90 97 150 197 39 103 156 86 85 184 145 173 100 120 233 200 105 135 20 119 79 204 170 141 6...

result:

ok all is ok (10 test cases)

Test #127:

score: 0
Accepted
time: 215ms
memory: 3828kb

input:

10
251 500
92 228 179 181
92 163 197 202
82 92 67 71
92 186 279 285
92 184 297 300
1 92 58 61
92 143 99 106
92 211 101 101
92 145 227 227
92 206 495 500
92 146 208 208
92 157 218 221
66 92 54 58
92 141 4 8
76 92 376 382
75 92 237 243
4 92 196 202
92 197 157 158
92 242 291 295
92 227 451 453
79 92 24...

output:

YES
180 197 67 279 297 58 102 101 227 495 208 218 54 4 379 237 199 157 291 451 249 84 203 15 85 304 319 188 138 48 103 422 95 133 256 69 352 404 33 381 272 131 146 23 206 89 371 419 219 47 430 66 286 65 373 285 169 123 330 17 18 432 10 104 427 119 318 51 55 1 241 124 465 438 82 394 305 435 468 159 3...

result:

ok all is ok (10 test cases)

Test #128:

score: 0
Accepted
time: 2763ms
memory: 7728kb

input:

1
2501 5000
1920 2314 3823 3834
1250 2314 117 130
1387 2314 4074 4090
2314 2353 4741 4751
2278 2314 2244 2259
697 2314 126 142
2105 2314 3413 3440
2310 2314 277 304
1794 2314 292 309
1195 2314 3742 3783
867 2314 2941 2950
1207 2314 1203 1235
491 2314 4421 4427
1991 2314 1556 1573
664 2314 873 888
10...

output:

YES
3823 117 4074 4741 2244 126 3413 277 292 3742 2941 1203 4421 1556 873 1404 4710 4242 2725 1984 323 1807 2126 4088 4188 546 1861 3485 1312 1740 492 83 3777 4857 2262 3118 559 4945 52 3176 123 1344 623 11 4488 1734 3937 4048 1897 3603 2687 2574 3153 4572 3091 407 2129 3983 537 1899 3358 4366 1916 ...

result:

ok all is ok (1 test case)

Test #129:

score: 0
Accepted
time: 198ms
memory: 3856kb

input:

10
251 500
38 225 90 103
99 225 21 36
23 38 80 90
38 91 32 36
19 99 96 105
99 147 73 80
23 195 26 34
23 157 11 17
91 189 96 106
91 95 1 2
19 232 59 64
19 200 64 64
81 147 87 89
4 147 44 59
77 195 21 22
193 195 23 26
44 157 10 12
135 157 19 19
87 189 1 5
79 189 40 40
93 95 2 11
95 235 84 97
116 232 3...

output:

YES
90 21 81 32 96 73 26 11 97 1 59 64 87 50 22 23 10 19 3 40 6 84 41 98 74 78 9 103 56 12 63 104 24 7 86 156 69 225 106 142 47 209 28 75 13 51 31 14 52 68 53 25 88 105 20 172 8 76 70 15 39 35 100 195 205 77 123 129 65 17 173 79 147 196 333 111 276 228 4 167 143 140 44 109 207 300 137 361 102 60 114...

result:

ok all is ok (10 test cases)

Test #130:

score: 0
Accepted
time: 2580ms
memory: 7500kb

input:

1
2501 5000
554 764 278 302
554 2366 11 43
764 1536 473 497
764 2439 164 199
616 2366 349 368
363 2366 482 515
1536 2179 405 427
1536 2481 205 211
2208 2439 784 784
1437 2439 498 519
616 1271 824 858
616 2075 543 548
363 881 299 303
363 725 404 416
1531 2179 109 123
2179 2377 428 457
912 2481 5 27
1...

output:

YES
278 11 473 164 349 482 405 205 784 498 824 543 299 404 109 428 5 873 867 789 835 435 811 6 28 604 25 309 324 214 495 364 146 947 871 311 197 322 262 881 542 90 684 74 297 118 199 890 301 973 790 990 887 882 125 613 373 143 257 42 14 793 440 180 738 393 20 891 388 279 372 937 479 242 414 355 158 ...

result:

ok all is ok (1 test case)

Test #131:

score: 0
Accepted
time: 2540ms
memory: 7764kb

input:

1
2501 5000
119 611 3092 3112
119 1774 3092 3092
130 1774 3096 3111
130 2213 3087 3099
1020 2213 3092 3096
1020 1346 2849 2866
1346 1946 2853 2864
522 1946 2847 2853
522 2161 2841 2862
2161 2371 2852 2853
126 2371 2853 2873
126 440 2742 2754
208 440 2511 2514
54 208 1231 1248
54 1918 29 48
1860 1918...

output:

YES
3094 3092 3096 3087 3095 2849 2853 2847 2841 2852 2854 2742 2511 1231 29 643 131 2496 2508 1993 2512 1737 2504 1208 2487 2474 2488 2505 2495 2371 2475 2509 2489 2499 2491 2451 562 469 2500 2030 1897 2483 2427 2445 2506 1061 2466 135 863 271 2480 1565 593 2097 2492 2481 2387 1426 2493 277 2494 22...

result:

ok all is ok (1 test case)

Test #132:

score: 0
Accepted
time: 2698ms
memory: 7796kb

input:

1
4001 5000
2624 3672 4999 5000
1196 3672 4989 5000
1194 1196 4968 4969
1194 3346 4620 4625
1269 3346 4617 4628
1269 3911 4622 4622
800 3911 4623 4630
800 1964 4235 4246
1964 2296 4233 4244
1393 2296 4239 4246
1393 3589 4189 4195
1302 3589 4192 4201
1302 3560 4186 4188
3537 3560 4049 4052
2946 3537 ...

output:

YES
4999 4989 4968 4620 4619 4622 4623 4235 4233 4240 4189 4192 4187 4049 4051 4043 4044 4003 3980 4016 4023 4022 4017 3998 4005 3996 4024 4011 4006 4009 4014 3997 3989 3995 4025 4013 3991 3982 4000 3988 1970 3944 2351 1517 2090 607 233 2922 420 3744 371 1345 1008 323 1309 878 2630 192 1652 995 1017...

result:

ok all is ok (1 test case)

Test #133:

score: 0
Accepted
time: 2562ms
memory: 7668kb

input:

1
3001 5000
539 987 4992 4998
987 2070 4990 4994
750 2070 3932 3933
587 750 3929 3935
587 2851 3102 3105
401 2851 3079 3085
401 596 3070 3072
596 2073 3079 3080
586 2073 3069 3070
586 2197 3063 3064
1469 2197 3082 3084
797 1469 3103 3108
797 1691 3098 3104
611 1691 3101 3107
412 611 3066 3072
412 22...

output:

YES
4997 4990 3932 3933 3102 3079 3070 3080 3069 3063 3082 3103 3098 3101 3072 3068 3064 3065 3055 3062 2984 2976 2985 1396 2649 2677 607 2216 916 2652 2674 2924 1046 1288 146 2373 2462 1310 285 2323 2011 1286 1657 2866 1938 970 1005 806 2731 1711 535 295 1641 823 2058 1887 493 171 733 2006 2111 197...

result:

ok all is ok (1 test case)

Test #134:

score: 0
Accepted
time: 2464ms
memory: 7476kb

input:

1
2001 5000
625 1894 2505 2505
1046 1894 2419 2425
1046 1212 2419 2420
1212 1683 2158 2164
1031 1683 2036 2036
139 1031 2036 2038
139 1229 2041 2043
168 1229 2014 2020
168 583 2023 2026
247 583 1988 1994
247 796 2009 2015
143 796 1652 1652
120 143 2019 2021
120 1375 2030 2034
1228 1375 2034 2034
278...

output:

YES
2505 2419 2420 2159 2036 2037 2043 2014 2026 1990 2011 1652 2019 2030 2034 2018 2005 2027 1343 2003 1992 2023 2015 2040 1998 2025 2020 1999 324 761 2038 2010 1677 641 812 1167 963 1773 190 1272 1953 318 225 30 279 1032 707 1618 475 477 397 1156 1554 17 1277 548 928 1853 1115 1824 1774 440 1948 1...

result:

ok all is ok (1 test case)

Test #135:

score: 0
Accepted
time: 2374ms
memory: 7512kb

input:

1
1001 5000
467 645 1495 1498
189 645 800 800
189 944 617 619
523 944 980 983
387 523 386 387
387 983 364 365
658 983 733 734
658 939 978 981
573 939 634 636
207 573 187 188
147 207 308 310
147 184 902 905
184 213 776 779
213 386 269 272
386 483 787 787
483 604 803 804
586 604 174 175
98 586 943 945...

output:

YES
1495 800 619 980 386 364 733 981 635 187 308 902 776 269 787 804 174 945 620 52 135 822 879 293 368 359 39 743 687 565 186 728 259 8 566 716 454 284 563 136 120 885 192 374 299 485 509 689 261 891 788 883 410 87 77 142 209 801 67 357 448 612 949 316 459 537 7 331 517 170 430 307 594 934 832 199 ...

result:

ok all is ok (1 test case)

Test #136:

score: 0
Accepted
time: 2709ms
memory: 8572kb

input:

1
2501 5000
1046 2160 4999 5000
867 2160 3311 3329
867 1214 3208 3284
1214 1902 3078 3167
1653 1902 2659 2766
1653 1935 2643 2816
4 1935 2592 2742
4 628 2591 2716
628 2130 2452 2657
2130 2359 2481 2676
1444 2359 2531 2536
274 1444 2397 2561
105 274 2444 2664
105 1607 2520 2638
1607 1826 2457 2667
18...

output:

YES
4999 3311 3208 3078 2659 2643 2592 2591 2452 2481 2531 2397 2444 2520 2457 2525 2426 2533 2337 330 2405 1278 2387 2458 132 804 1642 1573 2443 2412 1410 1 201 1888 339 913 1187 1247 2308 438 903 158 147 2227 1349 1970 2442 1542 218 932 1863 1808 653 1248 54 1496 2070 781 207 654 870 2455 2286 285...

result:

ok all is ok (1 test case)

Test #137:

score: 0
Accepted
time: 2648ms
memory: 8192kb

input:

1
3501 5000
1304 3311 4878 4893
1301 3311 4879 4911
953 1301 4884 4934
953 1058 3921 3973
1058 1558 3929 3986
1558 2634 3935 3990
2634 3187 3941 3959
98 3187 3941 3946
98 3477 3591 3646
848 3477 3611 3612
1 848 3614 3616
1 3312 3622 3637
467 3312 3605 3662
239 467 3609 3637
239 2409 3608 3663
2409 2...

output:

YES
4878 4879 4884 3921 3929 3935 3941 3942 3591 3611 3614 3622 3605 3609 3608 3624 3615 3597 3625 3586 3603 3606 3620 3584 3515 3502 3507 3530 3496 3522 3488 3503 3510 3494 3476 3497 3506 3523 3524 3495 3498 3512 3480 3516 3508 3518 3519 3444 3420 3458 3411 3453 3445 3441 3428 3437 3469 3416 3448 3...

result:

ok all is ok (1 test case)

Test #138:

score: 0
Accepted
time: 2682ms
memory: 14892kb

input:

1
2501 5000
1955 2193 4263 5000
1374 2193 2941 3434
679 1374 2737 3526
679 1632 2494 3633
1632 1645 2602 2610
1645 2197 1898 2643
1130 2197 2531 2548
1130 2151 2561 2571
440 2151 2050 2885
440 775 2411 2552
775 1831 2450 3290
1524 1831 2277 2805
1523 1524 2362 2567
195 1523 2183 2932
195 1106 2242 3...

output:

YES
4263 2941 2737 2494 2602 1898 2531 2561 2050 2411 2450 2277 2362 2183 2242 2339 1062 558 1 1715 2213 761 2369 1464 2435 884 320 1362 2047 2431 114 2383 2406 2300 2260 78 2065 1941 2 2090 135 667 1702 815 2140 402 2063 683 2259 1999 161 115 1103 607 1363 3 1634 421 4 2044 1282 5 1520 171 1283 173...

result:

ok all is ok (1 test case)

Test #139:

score: 0
Accepted
time: 2756ms
memory: 12264kb

input:

1
3501 5000
2024 2275 4162 4307
681 2275 3743 4378
681 2224 3370 3927
1380 2224 3598 3865
876 1380 3682 4039
876 2288 3240 3899
833 2288 3554 3757
833 2766 3344 3786
1421 2766 3310 3622
1421 2260 3336 3771
1293 2260 3527 3538
1293 1812 3441 3674
1812 3226 3340 3599
2719 3226 3324 3549
2600 2719 3505...

output:

YES
4162 3743 3370 3598 3682 3240 3554 3344 3310 3336 3527 3441 3340 3324 3505 3222 3497 3343 3433 3530 2973 3182 3467 3217 3453 3492 3180 3531 3440 3382 3458 1832 219 1996 1863 2743 1849 2713 2360 1651 1 3384 1773 2386 1864 3337 1966 249 1282 2925 2678 1264 2076 375 799 2084 374 3445 2369 1810 3442...

result:

ok all is ok (1 test case)

Test #140:

score: 0
Accepted
time: 2553ms
memory: 7768kb

input:

1
2501 5000
2155 2364 2395 2410
2155 2225 1864 1866
2225 2386 2234 2244
1897 2386 2505 2508
1414 1897 2516 2520
1025 1414 1995 2010
1025 2228 1307 1316
1913 2228 2513 2525
1913 2409 2496 2508
2178 2409 474 481
2025 2178 732 733
1887 2025 2492 2492
1090 1887 1762 1765
517 1090 2519 2528
517 2260 2477...

output:

YES
2395 1864 2234 2505 2516 1995 1310 2514 2496 474 732 2492 1762 2519 2477 2507 1231 2495 2499 2216 1007 119 2515 737 44 746 2520 191 1533 1851 1031 2108 785 65 2500 1478 1158 64 2523 322 2524 779 2486 1357 1277 95 1711 1246 2022 544 1401 1198 2480 534 277 1058 2060 2517 459 2035 1448 438 1251 167...

result:

ok all is ok (1 test case)

Test #141:

score: 0
Accepted
time: 2694ms
memory: 24156kb

input:

1
3501 5000
1677 2949 4845 5000
2949 3374 3687 4424
1883 3374 4202 4471
1883 3119 3165 4445
3022 3119 3454 5000
945 3022 3383 4159
945 3309 2812 3756
527 3309 2409 4254
527 1159 3487 3627
1159 2506 2335 3645
2395 2506 2570 4225
2275 2395 3403 4591
2275 2330 3414 4237
727 2330 3289 3784
727 1719 3116...

output:

YES
4845 3687 4202 3165 3454 3383 2812 2409 3487 2335 2570 3403 3414 3289 3116 3523 3142 3135 3252 3362 2103 1719 2929 36 2162 2742 2863 835 2781 1808 3110 2567 3415 3124 1999 3266 3392 3196 3225 2500 1875 3136 2644 2937 591 2181 1340 884 3049 2243 1654 666 3096 2783 1422 1 746 99 836 2754 2 1350 59...

result:

ok all is ok (1 test case)

Test #142:

score: 0
Accepted
time: 2084ms
memory: 61036kb

input:

1
2501 5000
230 1156 1 5000
230 1620 955 5000
1302 1620 1 5000
1302 1713 1 5000
104 1713 1 5000
104 1961 1 5000
673 1961 1 5000
391 673 1 5000
391 433 1 5000
433 873 1 5000
873 2374 1 5000
1340 2374 1 2816
1340 2419 1 5000
302 2419 1 5000
302 2379 1 5000
784 2379 1 5000
699 784 1 5000
699 2148 1 500...

output:

YES
1 955 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 189 19 20 21 22 23 24 2510 25 26 27 28 29 30 31 32 33 34 35 36 42 37 38 39 40 41 2170 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 1640 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 457 86 87 1049 88 89 90 91 ...

result:

ok all is ok (1 test case)

Subtask #8:

score: 0
Time Limit Exceeded

Test #143:

score: 0
Time Limit Exceeded

input:

1000
251 500
1 2 280 287
2 3 251 256
3 4 249 249
4 5 252 253
5 6 252 256
6 7 250 250
7 8 254 261
8 9 245 256
9 10 123 127
10 11 45 49
11 12 122 128
12 13 164 167
13 14 153 156
14 15 210 217
15 16 53 64
16 17 205 208
17 18 136 149
18 19 132 135
19 20 24 27
20 21 45 51
21 22 21 30
22 23 5 7
23 24 178 ...

output:

YES
280 251 249 252 253 250 254 256 123 45 122 164 153 210 53 205 136 132 24 46 21 5 179 83 78 207 187 103 216 20 180 107 23 29 121 7 221 26 126 206 140 32 217 35 11 183 149 61 68 143 166 202 162 144 90 159 128 62 28 163 85 110 130 54 76 167 31 145 95 1 105 75 141 172 188 3 9 69 211 36 190 34 124 10...

result:


Subtask #9:

score: 0
Time Limit Exceeded

Dependency #7:

100%
Accepted

Test #170:

score: 0
Time Limit Exceeded

input:

100
501 1000
59 300 426 438
15 166 59 90
58 306 424 441
183 451 328 330
56 496 380 411
12 387 212 230
250 410 191 212
282 460 123 132
169 392 647 676
74 362 269 286
273 459 154 177
187 420 204 232
52 180 515 529
178 498 774 777
93 310 607 608
78 344 162 196
186 498 122 130
240 425 395 399
190 501 22...

output:

YES
426 59 424 328 380 212 191 123 647 269 154 204 515 774 607 162 122 395 223 279 197 256 438 34 105 42 513 181 147 71 208 38 258 214 144 432 116 60 47 30 336 369 293 189 604 337 137 573 325 173 527 77 63 150 373 333 257 319 239 294 106 487 164 146 283 44 494 124 585 362 125 14 458 681 12 343 78 45...

result:


Subtask #10:

score: 0
Skipped

Dependency #1:

0%