QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#743523#9743. 重心树dXqwqAC ✓34ms16692kbC++231.0kb2024-11-13 19:24:432024-11-13 19:24:45

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

input:

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

output:

2 3
1 2
1 4
2 3
1 2

result:

ok Accepted (2 test cases)

Test #2:

score: 0
Accepted
time: 12ms
memory: 5844kb

input:

40000
3
2 2 3
0
0
2
1 2
0
4
2 4 3
1 4
0
0
5
1 3
2 5 4
1 5
0
0
4
3 2 3 4
0
0
0
2
1 2
0
2
1 2
0
5
1 2
3 3 4 5
0
0
0
2
1 2
0
2
1 2
0
5
4 2 3 4 5
0
0
0
0
4
1 2
2 3 4
0
0
5
2 5 4
1 5
1 4
0
0
2
1 2
0
5
1 2
3 3 4 5
0
0
0
5
2 2 3
0
2 4 5
0
0
5
2 5 4
1 5
1 4
0
0
5
2 2 4
2 3 5
0
0
0
4
1 3
1 4
1 4
0
4
2 4 3
1 ...

output:

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

result:

ok Accepted (40000 test cases)

Test #3:

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

input:

10000
5
2 3 4
1 5
1 5
0
0
4
2 3 4
1 3
0
0
7
1 2
3 4 7 6
1 4
0
1 7
0
0
2
1 2
0
2
1 2
0
8
1 3
1 4
3 4 5 6
2 7 8
0
0
0
0
4
2 2 4
0
1 4
0
4
1 2
2 3 4
0
0
4
1 2
2 3 4
0
0
2
1 2
0
7
3 3 4 6
1 7
1 7
0
1 6
0
0
4
2 4 3
1 4
0
0
3
2 2 3
0
0
6
2 5 4
1 6
1 4
0
1 6
0
3
2 2 3
0
0
5
3 2 5 4
0
1 5
0
0
7
2 4 6
1 5
1 ...

output:

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

result:

ok Accepted (10000 test cases)

Test #4:

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

input:

10000
10
2 6 7
2 8 4
1 8
0
1 9
1 10
1 9
1 10
0
0
10
3 2 8 5
4 3 9 7 10
0
1 8
0
1 9
0
0
0
0
9
2 2 5
3 3 7 6
0
1 7
2 8 9
0
0
0
0
3
2 2 3
0
0
6
3 4 3 6
1 4
0
0
1 6
0
10
3 2 4 7
2 10 8
1 10
0
1 8
1 9
1 9
0
0
0
3
1 3
1 3
0
5
2 5 4
1 5
1 4
0
0
2
1 2
0
9
3 2 3 7
0
4 5 6 8 9
1 5
0
0
0
0
0
6
4 2 3 4 6
0
0
0
...

output:

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

result:

ok Accepted (10000 test cases)

Test #5:

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

input:

16
392
4 2 3 165 13
0
2 4 12
0
4 177 7 9 23
2 187 16
0
1 13
0
1 13
2 208 27
0
2 14 22
0
1 23
2 19 20
1 208
3 21 25 27
0
0
0
0
0
2 208 29
0
2 32 31
3 44 40 38
1 208
0
1 44
0
3 35 49 52
1 42
2 36 208
0
0
1 44
1 42
1 49
1 60
2 79 213
0
3 46 79 57
2 47 48
1 60
0
0
0
0
1 213
1 79
1 64
1 57
2 79 63
2 62 2...

output:

389 391
386 389
385 387
384 388
383 392
382 390
380 385
379 382
378 386
377 380
377 383
377 384
376 381
373 375
373 378
372 373
371 376
370 379
367 374
367 377
364 367
364 368
364 369
364 370
364 372
362 363
362 364
361 371
358 360
358 366
357 365
356 357
356 362
354 358
353 359
353 361
350 354
349 ...

result:

ok Accepted (16 test cases)

Test #6:

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

input:

4
502
3 3 253 10
3 7 8 13
2 15 18
1 15
2 6 253
0
1 24
0
1 18
0
2 23 20
2 258 21
1 33
2 24 17
1 24
1 20
0
2 25 26
3 27 42 264
0
2 22 31
0
1 33
2 30 34
0
0
0
1 42
2 265 37
0
0
1 45
0
0
2 269 52
2 269 44
0
1 45
1 56
2 51 58
3 43 47 269
2 54 50
0
0
1 60
1 51
0
1 58
2 53 269
0
0
2 61 63
0
1 60
2 278 67
1...

output:

498 501
498 502
497 500
493 495
493 499
492 498
490 493
489 491
489 492
489 496
488 490
488 497
485 488
485 494
481 489
479 484
479 485
477 483
477 487
476 486
475 482
472 476
472 481
471 479
470 471
470 478
470 480
469 472
469 477
466 475
465 468
464 465
464 470
464 474
463 467
463 469
463 473
462 ...

result:

ok Accepted (4 test cases)

Test #7:

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

input:

1
422
2 9 195
1 9
4 5 195 11 8
1 13
1 13
3 212 12 25
2 16 14
0
0
2 18 212
2 19 31
0
0
0
2 22 29
1 27
1 22
0
1 27
3 221 26 30
1 31
0
1 222
2 33 37
2 33 35
0
0
1 222
1 34
0
0
1 40
2 48 49
1 48
0
2 38 229
2 42 41
0
1 56
1 42
0
0
1 50
3 86 47 238
2 86 51
1 86
0
1 56
1 50
0
0
2 238 58
2 94 57
1 238
1 96
...

output:

419 422
417 419
414 415
414 416
414 418
413 417
412 420
411 414
411 421
410 412
410 413
409 411
405 409
405 410
404 405
403 407
401 406
398 400
398 408
397 398
395 396
395 397
395 404
393 403
392 395
392 399
392 402
391 401
390 392
388 390
387 393
386 389
386 394
382 391
380 387
380 388
377 382
377 ...

result:

ok Accepted (1 test case)

Test #8:

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

input:

100
509
3 21 3 252
1 21
0
2 23 18
3 252 8 25
2 252 14
2 11 26
0
1 18
1 252
0
1 252
1 26
0
1 34
2 42 22
1 28
1 28
2 24 252
1 51
2 72 39
2 30 31
1 72
0
1 34
1 75
1 39
0
1 252
0
0
1 75
1 252
0
4 37 40 266 46
2 38 39
0
0
3 41 44 48
0
0
1 75
1 266
0
1 53
2 59 62
3 49 266 56
0
0
1 266
1 75
1 266
1 60
1 56...

output:

508 509
504 505
503 506
503 507
503 508
501 503
500 501
496 504
494 502
492 495
492 497
491 500
489 494
489 496
489 499
488 498
485 492
484 486
484 487
484 489
484 490
484 493
482 484
482 491
481 483
480 488
479 482
477 479
475 478
475 481
475 485
474 480
471 475
471 477
469 476
468 471
466 474
465 ...

result:

ok Accepted (100 test cases)

Test #9:

score: 0
Accepted
time: 14ms
memory: 8016kb

input:

5
4174
3 9 15 2088
3 3 18 7
0
2 23 12
1 15
2 19 2088
0
1 19
1 23
2 11 2088
3 16 17 21
0
1 20
2 2088 38
0
0
0
2 28 27
1 20
0
0
2 2088 39
1 34
2 30 47
1 30
2 29 2088
0
1 34
0
0
1 39
1 47
1 2088
0
1 39
1 51
2 2088 44
2 42 51
2 46 49
2 55 2088
1 42
0
1 44
0
1 55
0
2 48 52
0
0
2 2088 58
2 59 53
1 63
0
2 ...

output:

4171 4172
4171 4174
4164 4167
4163 4169
4163 4173
4162 4168
4162 4171
4160 4164
4160 4170
4159 4160
4158 4165
4156 4159
4156 4166
4155 4158
4155 4163
4154 4162
4153 4157
4152 4156
4151 4153
4151 4161
4150 4152
4149 4151
4149 4155
4148 4149
4148 4154
4143 4144
4143 4150
4140 4148
4139 4143
4139 4147
...

result:

ok Accepted (5 test cases)

Test #10:

score: 0
Accepted
time: 15ms
memory: 8116kb

input:

4
32538
4 21 46 18 16255
2 14 22
1 46
1 17
1 18
2 8 50
2 16 11
1 16
1 16255
1 50
0
2 20 22
1 18
1 17
2 16272 33
0
0
2 23 27
1 50
0
2 32 28
2 30 36
0
1 16272
3 26 38 37
0
0
0
1 50
0
1 16272
1 36
2 42 53
1 39
1 50
0
1 39
3 51 44 48
0
1 50
1 16272
1 55
1 62
0
2 16299 78
1 59
1 16299
0
1 59
2 56 67
1 55...

output:

32531 32533
32530 32536
32530 32538
32529 32531
32529 32537
32527 32528
32527 32530
32526 32534
32525 32532
32525 32535
32521 32529
32520 32524
32518 32519
32517 32523
32517 32526
32517 32527
32516 32521
32516 32522
32516 32525
32515 32516
32515 32518
32513 32520
32511 32512
32511 32515
32511 32517
...

result:

ok Accepted (4 test cases)

Test #11:

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

input:

3
54304
3 7 27151 13
1 7
3 11 8 27158
2 6 11
1 22
2 9 12
0
0
0
1 27158
3 14 17 31
0
2 25 22
2 15 23
0
1 25
0
1 31
1 27158
1 26
2 36 27158
3 27 28 34
0
1 40
1 26
0
0
0
1 36
2 27158 48
1 40
1 34
2 41 27158
0
1 41
0
5 27175 42 45 46 73
1 48
1 27175
0
0
0
2 52 58
1 27175
0
0
2 50 73
2 49 57
0
0
3 54 56 ...

output:

54301 54303
54301 54304
54295 54296
54294 54300
54293 54298
54293 54301
54292 54297
54292 54302
54291 54293
54290 54299
54289 54294
54289 54295
54288 54290
54288 54292
54286 54289
54284 54288
54284 54291
54282 54284
54282 54286
54281 54283
54281 54287
54279 54280
54279 54285
54278 54282
54277 54281
...

result:

ok Accepted (3 test cases)

Test #12:

score: 0
Accepted
time: 10ms
memory: 8968kb

input:

2
64362
6 2 13 32175 17 6 18
0
3 15 11 23
2 32175 14
1 17
0
1 15
1 11
1 18
2 32175 20
0
2 22 21
1 28
0
0
1 32175
2 22 24
0
1 32175
0
0
2 27 32
2 25 33
0
0
2 31 32175
0
1 33
2 36 40
1 36
1 36
0
0
3 32175 48 42
1 32175
2 37 46
0
1 40
2 56 45
0
1 56
0
3 32182 80 60
3 32182 52 53
0
0
1 80
1 57
2 32192 7...

output:

64355 64361
64354 64355
64354 64362
64351 64357
64351 64360
64350 64358
64350 64359
64348 64356
64346 64352
64346 64353
64345 64346
64345 64354
64342 64344
64342 64350
64342 64351
64341 64343
64341 64348
64339 64341
64339 64349
64338 64339
64338 64340
64338 64347
64337 64345
64334 64336
64333 64342
...

result:

ok Accepted (2 test cases)

Test #13:

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

input:

1
194798
3 2 3 97357
0
0
3 6 8 97357
1 6
0
2 16 32
1 24
3 97357 14 19
2 97357 13
2 97357 20
1 32
0
0
2 97357 29
2 28 26
1 97357
2 97357 27
0
0
1 29
1 37
1 97357
1 28
2 35 97357
0
0
0
0
1 35
4 33 34 97357 45
1 37
0
0
0
2 38 97357
0
0
3 97357 48 67
1 45
1 50
1 97357
2 97361 47
3 106 97382 59
1 50
1 48...

output:

194794 194795
194793 194798
194792 194793
194792 194794
194792 194797
194789 194790
194787 194796
194786 194792
194785 194786
194784 194788
194784 194791
194781 194787
194781 194789
194779 194783
194778 194784
194776 194780
194776 194781
194776 194785
194773 194782
194772 194775
194771 194777
194770...

result:

ok Accepted (1 test case)

Test #14:

score: 0
Accepted
time: 10ms
memory: 5848kb

input:

10000
8
2 2 5
3 8 6 7
1 5
1 8
0
0
0
0
8
4 3 4 8 7
1 5
1 5
0
0
1 8
0
0
4
2 2 4
0
1 4
0
3
2 2 3
0
0
2
1 2
0
12
1 4
4 3 8 10 6
0
2 7 11
1 10
0
0
2 9 12
0
0
1 12
0
6
2 3 5
2 6 4
1 6
0
0
0
4
1 3
1 4
1 4
0
7
2 3 7
1 5
2 4 6
0
1 6
0
0
14
4 2 13 5 7
2 4 6
1 13
2 8 14
2 9 11
2 10 12
0
0
0
0
0
0
0
0
4
2 4 3
1...

output:

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

result:

ok Accepted (10000 test cases)

Test #15:

score: 0
Accepted
time: 11ms
memory: 5800kb

input:

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

output:

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

result:

ok Accepted (10000 test cases)

Test #16:

score: 0
Accepted
time: 12ms
memory: 5840kb

input:

10000
17
2 2 12
4 14 6 11 10
2 7 12
1 14
1 6
0
0
2 15 13
1 12
0
1 15
2 16 17
0
0
0
0
0
9
3 5 4 9
1 5
1 4
0
2 7 8
1 9
0
0
0
5
2 3 5
1 4
1 4
0
0
18
3 4 3 10
2 9 16
0
2 14 12
3 8 15 11
1 18
1 14
0
1 13
1 17
0
1 13
0
0
1 17
1 18
0
0
2
1 2
0
14
3 3 13 7
2 6 11
1 10
1 13
2 8 14
1 10
1 12
1 12
1 14
0
0
0
0...

output:

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

result:

ok Accepted (10000 test cases)

Test #17:

score: 0
Accepted
time: 10ms
memory: 5784kb

input:

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

output:

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

result:

ok Accepted (10000 test cases)

Test #18:

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

input:

100000
2
1 2
0
2
1 2
0
2
1 2
0
2
1 2
0
2
1 2
0
2
1 2
0
2
1 2
0
2
1 2
0
2
1 2
0
2
1 2
0
2
1 2
0
2
1 2
0
2
1 2
0
2
1 2
0
2
1 2
0
2
1 2
0
2
1 2
0
2
1 2
0
2
1 2
0
2
1 2
0
2
1 2
0
2
1 2
0
2
1 2
0
2
1 2
0
2
1 2
0
2
1 2
0
2
1 2
0
2
1 2
0
2
1 2
0
2
1 2
0
2
1 2
0
2
1 2
0
2
1 2
0
2
1 2
0
2
1 2
0
2
1 2
0
2
1 2...

output:

1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
...

result:

ok Accepted (100000 test cases)

Test #19:

score: 0
Accepted
time: 33ms
memory: 14792kb

input:

1
200000
1 66869
1 66869
1 66869
1 66869
1 66869
1 66869
1 66869
1 66869
1 66869
1 66869
1 66869
1 66869
1 66869
1 66869
1 66869
1 66869
1 66869
1 66869
1 66869
1 66869
1 66869
1 66869
1 66869
1 66869
1 66869
1 66869
1 66869
1 66869
1 66869
1 66869
1 66869
1 66869
1 66869
1 66869
1 66869
1 66869
1 6...

output:

199997 199998
199987 199988
199984 199985
199982 199983
199979 199980
199975 199976
199971 199972
199967 199968
199964 199965
199959 199960
199958 199959
199957 199958
199946 199947
199939 199940
199937 199938
199932 199933
199930 199931
199923 199924
199914 199915
199913 199914
199911 199912
199907...

result:

ok Accepted (1 test case)

Test #20:

score: 0
Accepted
time: 26ms
memory: 11836kb

input:

1
200000
5703 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 1374 1375 1440 1486 1487 1488 1489 1845 1846 1847 1848 1849 1850 1851 1860 1861 1862 1863 1864 1865 1866 1867 1868 1888 1889 3321 3322 3323 3324 3325 3326 3327 3328 3329 3330 3446 ...

output:

199907 199908
199907 199909
199907 199910
199907 199911
199907 199912
199907 199913
199907 199914
199907 199915
199907 199916
199907 199917
199907 199918
199907 199919
199907 199920
199907 199921
199907 199922
199907 199923
199907 199924
199907 199925
199907 199926
199907 199927
199907 199928
199907...

result:

ok Accepted (1 test case)

Test #21:

score: 0
Accepted
time: 33ms
memory: 14200kb

input:

1
200000
11 39 63012 63019 63148 63219 63220 63262 63263 130152 198563 199731
9 3 4 39 60342 60876 60977 62603 62911 62944
0
5 5 7 23 25 36
0
3 8 19 22
4 8 15 16 18
4 9 10 12 14
0
0
1 13
1 13
0
0
0
0
1 18
0
2 20 21
0
0
0
0
2 27 31
2 26 29
0
2 28 30
0
1 30
0
3 32 33 35
0
0
1 35
0
2 37 38
0
0
15 41 42...

output:

199999 200000
199997 199998
199997 199999
199994 199995
199994 199996
199991 199992
199988 199989
199985 199986
199980 199981
199980 199982
199979 199980
199978 199979
199978 199983
199977 199978
199977 199984
199977 199985
199977 199987
199977 199988
199977 199990
199974 199975
199974 199976
199974...

result:

ok Accepted (1 test case)

Test #22:

score: 0
Accepted
time: 26ms
memory: 13196kb

input:

2
100000
1 18907
1 18907
1 18907
1 18907
1 18907
1 18907
1 18907
1 18907
1 18907
1 18907
1 18907
1 18907
1 18907
1 18907
1 18907
1 18907
1 18907
1 18907
1 18907
1 18907
1 18907
1 18907
1 18907
1 18907
1 18907
1 18907
1 18907
1 18907
1 18907
1 18907
1 18907
1 18907
1 18907
1 18907
1 18907
1 18907
1 1...

output:

99992 99993
99986 99987
99985 99986
99982 99983
99981 99982
99979 99980
99976 99977
99968 99969
99962 99963
99958 99959
99954 99955
99953 99954
99952 99953
99949 99950
99946 99947
99941 99942
99934 99935
99933 99934
99933 99936
99932 99933
99931 99932
99927 99928
99923 99924
99922 99923
99921 99922
...

result:

ok Accepted (2 test cases)

Test #23:

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

input:

2
100000
2810 2 3 4 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 951 952 953 1008 1009 1010 1019 1020 1021 1046 1047 1048 1049 1050 1581 1582 1583 1584 1585 1586 1587 1588 1589 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1680 1693 1694 1711 1712 1713 1732 1733 1951 1952 2040 20...

output:

99815 99816
99815 99817
99815 99818
99815 99819
99815 99820
99815 99821
99815 99822
99815 99823
99815 99824
99815 99825
99815 99826
99815 99827
99815 99828
99815 99829
99815 99830
99815 99831
99815 99832
99815 99833
99815 99834
99815 99835
99815 99836
99815 99837
99815 99838
99815 99839
99815 99840
...

result:

ok Accepted (2 test cases)

Extra Test:

score: 0
Extra Test Passed