QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#107836#1884. Mission Impossible: Grand Theft AutojuruocjlAC ✓103ms28456kbC++203.6kb2023-05-22 21:53:522023-05-22 21:53:54

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 5ms
memory: 8088kb

input:

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

output:

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

result:

ok All OK (4 test cases)

Test #2:

score: 0
Accepted
time: 19ms
memory: 8908kb

input:

100
2000
494 1815
316 280
704 103
1627 787
475 1616
401 744
1003 1901
46 66
428 1703
1865 450
1645 852
146 1488
469 1825
104 332
1638 1941
127 468
1558 350
373 1492
1287 1809
76 1479
1653 1243
1292 1465
922 1497
1891 459
1347 176
1996 1377
1182 1570
1461 742
1972 984
355 1412
650 338
1708 121
1869 1...

output:

1586 824
492 1785
1234 1271
1224 1798
53 69
814 989
72 1170
1604 932
991 628
1255 367
298 681
1407 1498
267 260
164 380
851 1620
1572 1159
968 1353
1758 587
657 616
1268 1475
398 752
457 166
515 886
1401 189
112 1375
1663 668
1015 309
1963 747
1320 151
1710 1335
1179 168
971 1844
1075 572
1379 1613
...

result:

ok All OK (100 test cases)

Test #3:

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

input:

100
2000
1312 1335
1335 1706
1913 1335
1335 896
1335 990
892 1335
1592 1335
1335 213
808 1228
1228 999
1335 332
1430 1335
1335 145
1335 901
1335 1269
1335 564
1335 843
1335 138
493 1335
1707 1335
1335 1368
754 1335
293 1335
1095 1335
355 1335
341 1335
37 1335
1335 1881
1455 1335
605 1335
1335 1322
1...

output:

1312 837
1706 634
1913 1858
896 1738
990 469
892 1968
1592 1029
213 1294
332 1602
1430 1632
145 410
901 199
1269 1085
564 928
843 215
138 1409
493 323
1707 1214
1368 67
754 1895
293 423
1095 876
355 1243
341 1456
37 1930
1881 1740
1455 494
605 75
1322 90
104 660
59 348
1699 152
1596 682
1501 178
156...

result:

ok All OK (100 test cases)

Test #4:

score: 0
Accepted
time: 5ms
memory: 8356kb

input:

100
2000
478 1228
1201 702
874 1106
1043 1608
1010 1698
485 1592
1760 365
369 190
1268 104
250 1182
1530 1793
825 1236
1245 260
1818 551
626 652
979 1565
161 624
1302 1163
1109 1065
353 1342
1181 696
56 1061
905 396
411 1769
671 1715
1487 1906
761 1975
292 346
1889 175
527 1717
965 1780
1296 97
992 ...

output:

344 713
344 713
401 1059
401 1059
1569 289
1569 289
1072 1845
1072 1845
498 584
498 584
832 625
832 625
1656 400
1656 400
252 631
252 631
1451 297
1451 297
1379 540
1379 540
920 1475
920 1475
1598 1613
1598 1613
1645 853
1645 853
137 908
137 908
1204 140
1204 140
1460 454
1460 454
1678 1496
1678 149...

result:

ok All OK (100 test cases)

Test #5:

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

input:

100
2000
1631 317
85 1099
180 616
35 1047
1478 164
1433 959
410 1733
371 1716
1885 1962
217 433
981 872
564 942
1370 655
142 718
1513 1897
1694 683
373 686
1965 833
384 1195
1430 1316
770 787
1456 292
831 166
834 1221
288 716
252 311
1974 1497
391 1603
675 369
542 141
1542 225
741 558
1762 1612
701 ...

output:

1055 1863
772 1515
1922 501
1637 1470
918 1092
1978 1115
929 1472
520 356
495 511
1320 1622
1169 1739
1483 1037
186 526
1795 1384
1238 1288
1335 1324
427 1586
503 1560
563 1510
1607 1429
952 1460
132 1689
1673 800
950 1932
1424 1437
1774 1792
332 603
734 1940
1823 24
1917 943
1514 318
1865 419
82 11...

result:

ok All OK (100 test cases)

Test #6:

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

input:

100
2000
409 1935
85 1581
372 298
566 1538
462 1618
953 1566
1800 1220
1394 1061
553 318
1961 455
1318 168
935 339
1221 352
758 1219
1285 1093
889 948
1808 1849
446 801
1123 623
562 289
1923 5
1061 1276
618 523
865 1287
1143 1708
285 542
1545 1439
1350 72
2 999
956 1197
36 931
35 840
733 352
1481 39...

output:

63 1384
1383 104
773 16
420 663
1306 1633
1415 1440
135 69
217 1746
174 1944
1511 3
1032 190
1595 24
68 1074
525 1242
566 1001
1692 258
1842 1748
332 244
272 431
96 857
604 353
1925 1506
674 1079
1062 1071
557 1602
498 1467
128 1373
172 677
1392 752
214 1639
1790 471
369 593
1616 1812
1771 1253
1905...

result:

ok All OK (100 test cases)

Test #7:

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

input:

100
2000
360 1067
1071 386
1972 39
630 1817
68 777
91 353
683 1737
657 724
646 448
665 630
337 267
1274 769
977 1075
1177 93
122 1181
302 358
807 1078
1593 428
1301 563
485 1656
64 395
156 628
957 998
516 671
1809 556
765 1143
568 62
585 80
278 1533
38 373
593 1051
614 1262
929 1341
840 52
68 871
11...

output:

1593 1744
1827 1703
1984 1720
1180 1812
1945 1443
1413 1637
1964 1339
1495 1722
1519 1572
1736 1657
1873 1396
1621 1714
1822 1566
1968 1496
1914 1900
1630 1310
1825 1119
1230 1194
1212 1864
1606 1998
1368 1718
1903 1153
1512 1603
1454 1963
1709 1159
1468 1152
1371 1681
1830 1252
1458 1287
1140 1663
...

result:

ok All OK (100 test cases)

Test #8:

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

input:

1
200000
180867 117149
64957 96383
113663 34055
126334 46258
198365 156064
185941 135514
50922 102839
194187 170033
14353 188814
90500 114303
110852 84786
31360 45707
95366 181909
148219 102709
159594 15576
168829 128189
45621 36147
188648 157263
128090 120720
127728 147491
14102 46730
33752 29598
6...

output:

47315 127674
64680 178004
37192 13980
15211 153578
195427 191405
33401 198615
67425 197264
183013 32147
52430 137683
90113 100237
56714 193307
25220 189008
60928 56501
199706 41361
26569 89537
3033 172551
172551 94058
152407 94058
88098 37578
139037 25109
66604 181276
155586 173368
414 103567
197419...

result:

ok All OK (1 test case)

Test #9:

score: 0
Accepted
time: 96ms
memory: 20188kb

input:

1
200000
57440 116519
190896 104071
53012 156570
169755 24088
100818 109488
68779 96300
13283 199209
78123 93290
132729 23440
24264 45870
149108 173718
111047 115843
65821 56899
148506 51951
89726 142789
25286 193684
68947 178839
187345 179659
4349 165429
4425 40651
170136 128767
79833 30317
146012 ...

output:

154882 97533
145849 82187
42747 48443
46941 130620
189970 60922
115010 44678
15195 80561
199876 181197
53214 60262
90107 189955
53697 151360
193252 188703
143587 123516
119733 81857
149012 72220
186024 189921
39320 186308
159004 138707
81321 31699
76498 189664
112221 46720
46476 143584
147778 188017...

result:

ok All OK (1 test case)

Test #10:

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

input:

1
200000
135363 12419
12419 53087
12419 102176
12419 88147
12419 195924
12419 70946
12419 28021
12419 158923
143022 12419
12419 94981
111088 12419
12419 15202
12419 46491
128055 12419
12419 36839
167823 12419
12419 139603
12419 78361
85762 12419
117686 12419
88163 12419
153517 12419
72620 12419
5023...

output:

135363 61482
53087 55565
102176 10395
88147 159108
195924 139212
70946 198981
28021 105173
158923 176731
143022 197124
94981 80843
111088 48685
15202 71004
46491 154496
128055 160885
36839 41693
167823 100335
139603 189246
78361 138844
85762 137960
117686 154791
88163 22212
153517 175704
72620 37850...

result:

ok All OK (1 test case)

Test #11:

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

input:

1
200000
135705 108920
162642 126519
85128 45728
194271 180875
30763 93992
52969 151747
177074 20263
186614 109737
36694 190088
187500 16286
142641 75314
64550 33705
164299 102609
157504 28107
33788 158382
126297 44905
99420 168255
156403 81775
79011 196380
131864 94044
69591 100898
128825 102920
90...

output:

132040 114579
132040 114579

result:

ok All OK (1 test case)

Test #12:

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

input:

1
200000
165592 104127
37950 12293
64975 97946
93785 166716
164318 69986
196751 90865
23447 160715
54234 71862
85060 175999
184004 138041
150985 163147
85042 49367
159900 58574
85526 126934
144113 74917
11820 71982
98279 154765
15130 123668
24221 153534
45841 90041
76611 84919
102872 179527
184300 2...

output:

184589 34213
190448 37065
23642 152291
52969 39020
146554 30846
15294 111641
51288 68050
171547 56058
68022 78749
96699 193999
195349 118931
107542 10718
144120 10418
27294 83797
93289 147765
119848 88935
81230 43585
11528 86746
192572 176233
152030 177183
55097 108111
190779 141133
172980 102320
40...

result:

ok All OK (1 test case)

Test #13:

score: 0
Accepted
time: 81ms
memory: 18996kb

input:

1
200000
11163 181049
198878 80756
126047 10444
12318 170212
53148 108157
36484 184447
112205 28414
134930 72219
20670 20296
192695 128565
76596 10779
157783 84654
92158 63822
184965 173701
167017 53897
149981 198928
90046 175838
111705 34219
68811 89794
177259 199009
17328 121104
29446 68600
72687 ...

output:

132796 85922
6985 88348
43750 62649
37257 159052
131692 139864
41449 133935
36733 94730
70721 199142
115034 194814
10557 199144
75420 164867
90374 192010
131268 138766
108671 136595
92063 132329
91048 149484
9299 34952
83604 48830
23343 41651
77655 166179
117964 32002
155365 173524
88851 97848
82674...

result:

ok All OK (1 test case)

Test #14:

score: 0
Accepted
time: 64ms
memory: 18968kb

input:

1
200000
4575 157468
164012 29131
19086 4026
40781 82891
37731 171364
63302 48036
74202 63605
197957 9856
13617 144515
52209 38724
21317 198083
80992 109217
166602 47381
33797 138331
25902 180272
167967 4317
61778 14894
56463 176107
190512 68141
73749 194304
28584 199885
34348 147657
17957 34484
492...

output:

181709 121561
143876 182651
160916 102080
195303 147647
129790 115585
135393 105306
129458 183442
137330 176354
154490 194954
125505 141005
154132 130468
101663 110108
181162 177249
92832 110372
132802 150926
111289 105978
138785 175499
185871 155993
105710 170511
149655 141976
115125 140853
198564 ...

result:

ok All OK (1 test case)

Test #15:

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

input:

10
20000
16695 1396
13278 3074
12587 14482
7700 15666
17027 19304
8306 4095
18254 12845
3902 15666
14183 1654
4204 14818
17061 8366
4939 9287
10390 13577
18352 7584
2963 12724
16669 3812
11375 11829
1776 12158
13184 13187
4759 587
19649 6559
14340 18587
10756 18874
8109 5657
1744 9320
5211 2432
8530...

output:

18287 17989
17555 16812
8059 15729
1242 14819
162 17456
12977 9247
13818 6853
1505 1002
18382 13362
6961 18502
1687 11917
19610 17319
18153 2709
5051 15279
1770 13347
16095 19989
14614 5817
12892 5453
2825 18781
2643 15651
504 1627
3054 9994
12732 6132
8458 1310
10498 2454
13009 13907
12013 19456
19...

result:

ok All OK (10 test cases)

Test #16:

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

input:

10
20000
2348 3282
5666 6279
5192 9950
18034 567
7661 12644
174 3177
4119 2354
9049 17783
16454 17069
18214 8601
17570 12771
10226 14634
14460 9186
4607 15080
12090 9391
5717 14991
12948 9659
5416 18709
19886 14470
12463 15501
17018 11949
11693 15997
8454 18550
403 2082
14833 18785
11044 11985
16832...

output:

16821 13417
16821 13417
12180 3531
12180 3531
5855 16588
5855 16588
11685 14039
11685 14039
9995 17242
9995 17242
14871 2902
14871 2902
8286 654
8286 654
5659 14901
5659 14901
19044 6997
19044 6997
5298 14536
5298 14536

result:

ok All OK (10 test cases)

Test #17:

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

input:

10
20000
10174 13411
3604 8329
19065 11752
9275 11429
5176 4143
7231 7102
10510 4779
7622 17899
13285 10649
537 13311
12745 6710
7318 15748
3795 6401
4566 18704
2280 9793
10628 15036
2979 4111
5315 2728
15154 5630
10512 9624
4389 1280
15002 1310
17714 11820
14385 16888
8595 11794
15253 6282
15438 78...

output:

16131 12306
4175 5646
13389 5589
6845 9049
3484 7026
19666 12512
12751 10075
6327 19703
12830 19796
15463 18836
11314 7633
8057 3736
5839 8323
7480 18135
4839 10629
5680 4116
11259 17314
18871 15378
7573 16187
5065 3013
19 4586
3698 5191
17166 14762
16487 10561
17755 5151
15386 13230
18997 7243
1082...

result:

ok All OK (10 test cases)

Test #18:

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

input:

10
20000
6546 12178
8132 12698
9866 18394
4178 19311
18441 13775
13427 19385
9035 5234
18814 5897
13260 16823
240 19280
6194 12827
4971 193
12542 18512
18421 10994
1982 7222
17769 11520
19515 3324
7202 1207
11012 5144
9602 8684
11427 18573
4797 3230
10966 16392
331 4055
1990 9346
13 16133
12222 1776...

output:

9295 1437
15929 807
19420 7891
15904 12692
11603 16365
11753 17267
12265 9668
1070 4131
18863 7775
2579 1167
11302 10012
12175 8
16612 19740
13250 7208
14534 19868
6824 6143
9639 9687
1654 9908
11745 6595
4123 11554
17753 17821
4211 4104
3846 5837
2783 8529
1276 1707
17806 8551
14711 7527
17678 1448...

result:

ok All OK (10 test cases)

Test #19:

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

input:

10
20000
18936 14226
19263 5838
8618 484
11997 12065
7555 4853
11170 19861
10053 8023
4674 1225
5681 11205
15958 2512
19545 13874
13344 14575
12557 12982
62 18520
4294 6383
14307 12269
9064 3353
12435 8926
5232 17514
2223 12758
16561 9385
15839 3786
5596 10714
2554 2704
7760 824
4795 4020
2501 9033
...

output:

16058 16858
19684 17618
16577 19012
15318 15490
18033 15331
15984 15529
18331 16887
19110 15861
15397 17877
16449 17749
17486 17337
15886 17403
15464 19935
17483 15271
15233 18215
19793 17311
19795 18435
16755 19874
15605 15826
19964 15805
15749 16274
19763 16978
18876 16957
17723 19661
17743 17254
...

result:

ok All OK (10 test cases)

Test #20:

score: 0
Accepted
time: 17ms
memory: 9736kb

input:

10
11312
7739 10213
4181 1027
4170 7024
9225 10206
3822 145
3713 8243
8815 1327
9962 736
318 1662
8562 48
9326 1002
5043 6009
928 8908
3571 837
10470 5661
3748 5909
1152 187
9538 2676
10704 8317
10457 4962
6777 9326
4163 4816
9384 6962
10183 531
4923 10222
9244 1092
10966 4894
8100 2154
10098 10331
...

output:

5468 10706
9994 1350
8338 6245
72 10154
7080 8598
293 2367
7002 10722
10361 4344
7358 6524
10632 4526
5807 4041
9454 5362
10996 2621
8366 6947
3154 626
1261 925
2331 11202
25 2431
6792 10769
6402 5246
6382 5815
2028 184
8934 5769
9497 93
716 6806
1363 3463
2801 7751
3965 138
6835 7556
8045 9439
943 ...

result:

ok All OK (10 test cases)

Test #21:

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

input:

10
13449
12764 12936
5002 12959
8845 11434
4091 11415
4894 5002
5002 10608
8931 11149
5002 12709
9384 5473
690 8789
6033 4091
9384 6638
3921 853
9961 2907
3844 8931
7903 5040
4091 12458
8931 5188
5002 434
11434 3951
9380 11136
2487 8789
1878 8789
8931 12432
11095 11860
9380 9963
5457 9384
1460 3160
...

output:

10560 4618
10170 10800
2763 7111
4586 11994
7670 13310
6591 1909
7420 8674
10325 6083
12334 12190
1966 6861
10696 11605
11311 2985
7331 12180
6822 10479
13054 10939
10976 11925
10612 2046
13380 3037
7441 6605
7010 8769
8584 10129
8135 11532
605 6076
2064 4065
6174 1769
607 12913
9228 11118
7573 5842...

result:

ok All OK (10 test cases)

Test #22:

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

input:

10
14493
1833 13275
4628 13795
12867 5331
6564 9403
2075 824
4339 8792
7565 7906
3377 4104
4897 11749
4166 279
8310 8908
7842 11805
12951 8243
1363 10049
10426 6105
9824 3042
13787 4927
10620 13711
1528 8158
3726 7386
10532 13174
7863 5049
2000 10370
8750 10724
13438 11506
9107 1969
8538 9710
12047 ...

output:

8179 2864
8179 2864
3471 12882
3471 12882
14829 5072
14829 5072
8734 17332
8734 17332
8474 156
8474 156
18999 13894
18999 13894
6687 1990
6687 1990
292 7642
292 7642
7508 56
7508 56
4697 8655
4697 8655

result:

ok All OK (10 test cases)

Test #23:

score: 0
Accepted
time: 24ms
memory: 10040kb

input:

10
14128
4498 9745
468 10727
4183 2924
10397 10422
1609 3728
10527 7958
5257 11781
7375 7137
13836 9986
7752 10497
13775 5728
5447 5105
6533 1593
9563 6546
7393 5921
9997 4083
11092 6797
13298 4550
13289 13066
4846 12542
4781 9790
11309 12700
1777 205
3315 1167
8709 13799
10721 12965
10146 7479
4004...

output:

2080 5948
13945 9646
4873 6719
12678 13758
14000 14024
9848 12685
12202 7844
10089 13556
7821 13210
6968 1518
8553 5714
2166 810
2520 9368
3057 9269
2065 8702
7908 5080
4535 1513
9128 2620
2503 11115
3185 9424
13367 11069
6813 6256
5754 1125
1061 10612
6583 11631
7645 13119
8143 11137
4713 11317
605...

result:

ok All OK (10 test cases)

Test #24:

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

input:

10
14665
1098 13101
7459 8501
3771 4992
6274 13209
9606 1624
2135 2263
5347 1754
14289 503
10856 301
8122 3811
3486 4024
9088 13875
1278 5408
5225 11456
5308 1475
2986 11799
9520 13971
12003 4141
3747 7910
1139 3798
11481 864
9160 7180
388 12570
7448 9300
4447 4504
6907 8665
11666 12682
11943 12211
...

output:

5510 3914
12706 4661
7345 11350
977 840
14499 13392
2703 7338
9096 418
12440 6737
7662 6440
12616 5687
9554 3182
2591 9227
667 3935
5023 8247
4437 7676
998 4893
2002 11851
4551 1778
11306 12430
1348 3972
14327 11086
11963 13275
14070 4810
6809 13934
12351 8715
11550 14095
814 4196
10788 7648
589 535...

result:

ok All OK (10 test cases)

Test #25:

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

input:

10
14823
13851 10092
4469 5824
10539 681
5633 4009
11591 2052
9154 2692
2257 4439
7270 391
8135 8998
10371 6008
7953 1123
1917 13346
4253 8134
3141 13970
7216 8485
7217 8044
11904 9026
6879 6256
1758 5875
9127 13292
9266 3451
9418 956
5396 4746
12136 13171
438 5174
4770 8211
4249 10630
11931 7668
30...

output:

13038 13235
14051 13697
13878 13422
12818 13287
14264 14221
12678 13101
13051 14457
12982 13143
13482 12843
13282 14671
13458 14024
14214 13059
13926 13759
13843 13414
13361 13911
12725 13946
14265 14095
13511 14687
14508 13921
14084 14622
14742 12804
14272 12696
13603 13794
14584 14187
13170 14470
...

result:

ok All OK (10 test cases)

Test #26:

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

input:

10
17485
5940 14053
2276 5018
8057 1985
12859 3478
12866 1646
5885 12915
15736 3531
17200 2938
6878 13777
10761 6120
4713 14167
2618 16233
5813 6420
13393 4642
9632 2985
1342 16025
16026 6844
6319 1649
5802 1215
2849 11681
15859 413
7453 3222
9492 5313
2309 13965
1361 8932
8017 5935
2256 7595
3056 8...

output:

16246 16532
17443 16298
17470 16409
17001 17181
17392 16930
17459 16477
16331 17302
16827 16729
17276 16341
16753 16350
17071 17306
16525 16756
16419 16312
17374 17198
16359 17121
16788 16739
16407 16867
17269 17157
16544 16899
17150 16247
16498 16573
17126 16343
16705 17190
17204 16351
17036 16584
...

result:

ok All OK (10 test cases)

Test #27:

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

input:

10
20000
7885 7071
16024 2454
788 1532
9107 5396
863 18365
13559 14595
5682 17596
10277 5565
5429 9775
9651 1543
10997 1585
15843 98
11709 18346
18893 357
19664 6276
4638 4202
11311 4463
13733 1689
19245 7795
4812 13596
11676 16057
16039 7395
9202 12081
19418 3855
10091 15515
9706 18698
16415 17647
...

output:

19874 19393
19591 19107
19886 19206
19179 19876
18980 19770
19085 19502
19217 19995
19979 19883
19205 19163
18922 19323
19961 18831
19864 19291
19797 19364
19054 19866
18761 19862
18750 18914
18938 19830
19564 19617
19669 19658
19838 19116
18812 19538
19742 18878
19573 19520
18816 18885
19248 19639
...

result:

ok All OK (10 test cases)

Test #28:

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

input:

10
20000
13043 670
237 4915
10906 409
19253 711
16317 876
742 15465
12586 690
796 16349
6763 627
868 3775
13797 715
13416 216
6989 798
136 8115
17811 451
18310 626
8943 534
376 1364
629 17957
719 5463
4847 46
3220 704
735 19173
17824 290
803 12001
9695 326
3717 696
156 16563
394 6627
3829 779
267 14...

output:

1852 11579
10227 3605
9442 3346
6927 19729
4785 9323
18633 7405
15972 14639
18761 13865
7735 10417
13409 1923
7242 8405
15673 15797
1072 7386
2070 16096
18910 18823
2716 13309
12576 11681
13386 1947
16622 14900
7715 5471
16518 1129
14932 11333
9224 7790
16744 2290
4641 3175
5088 12741
11798 10415
42...

result:

ok All OK (10 test cases)

Test #29:

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

input:

100
2000
1527 25
35 1691
1381 12
1214 51
67 1058
67 1122
195 75
883 16
316 30
13 645
75 577
34 604
1988 32
86 9
47 579
1453 38
97 431
727 83
1939 26
1533 97
68 1142
80 1675
39 1352
45 1302
96 154
49 1402
26 1388
1091 93
70 1804
97 1577
77 28
1667 20
5 1602
189 21
545 42
10 1495
13 337
30 6
1799 7
52...

output:

614 1052
156 947
1336 1651
1399 974
1540 1481
287 255
1658 1442
168 983
1924 1021
388 1186
893 807
546 1129
149 505
925 413
1609 296
638 948
1182 1831
1582 1466
616 319
752 503
1360 258
1584 1740
2000 1126
1945 916
813 1437
1894 1220
582 1799
1258 270
1455 718
1192 787
1391 367
117 512
1931 1555
989...

result:

ok All OK (100 test cases)

Test #30:

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

input:

100
2000
420 1219
945 1001
574 759
1646 1989
741 1939
54 210
1344 1645
832 1111
1685 1932
1581 612
1481 640
1634 928
971 924
136 1844
813 1516
860 331
103 1243
381 1348
839 849
423 1443
1766 1675
1462 513
961 1563
793 1687
378 279
1305 1510
818 966
668 1327
1133 1012
1356 1630
819 1261
70 521
1314 6...

output:

1982 1979
1991 1997
1996 1988
1981 1992
1980 1995
1990 1985
1998 1978
1984 2000
1994 1989
1983 1993
1986 1987
1999 1987
1916 1939
1929 1948
1974 1989
1994 1926
1963 1918
1992 1946
1938 1956
1969 1936
1944 1951
1957 1977
1928 1981
1934 1982
1995 1943
1964 1966
1976 1985
1955 1968
1941 1940
1996 1984
...

result:

ok All OK (100 test cases)

Test #31:

score: 0
Accepted
time: 63ms
memory: 20424kb

input:

1
200000
75527 3156
2623 154626
2558 177113
146357 1358
2656 186051
187792 523
4363 90605
100704 4773
87808 3697
502 173074
86283 3548
197007 2319
2809 174049
52610 666
1359 164293
25456 2472
4304 188852
4561 165894
180375 3811
5190 90244
199525 659
23244 4464
142850 282
690 124332
164450 5136
15018...

output:

182007 23261
89001 186183
96798 137092
116071 101553
26537 55846
161385 59235
133597 155105
192313 77943
161586 83143
147998 48883
123364 10607
66217 103990
138209 34189
102567 33262
133404 161421
142061 90455
95348 125020
189174 178991
188080 44541
101673 183566
64799 156681
131472 190045
65751 163...

result:

ok All OK (1 test case)

Test #32:

score: 0
Accepted
time: 95ms
memory: 26092kb

input:

1
200000
83931 96937
32952 195907
78310 37108
176347 23132
188809 37384
140706 23700
17636 158568
5634 155262
58194 33410
47523 166455
128642 18909
178740 165831
85365 160502
187890 58358
25450 91847
140606 122655
63185 138517
189170 33052
136599 125275
91736 43965
108429 73952
40581 92844
147701 19...

output:

199992 199988
199991 199996
199997 199989
199990 199993
199994 199998
200000 199995
199999 199995

result:

ok All OK (1 test case)

Test #33:

score: 0
Accepted
time: 61ms
memory: 19160kb

input:

1
200000
193597 17230
27229 185684
159770 185467
10684 16681
197494 65016
145960 136670
147327 154108
79903 91787
146348 95359
23027 12513
23620 155067
337 181961
81189 147340
97553 64534
60153 114240
87847 125869
29991 186766
75418 153252
30768 107217
128834 162883
28777 29024
94836 138175
140266 1...

output:

199216 199836
199872 199754
199547 199878
199626 199497
199327 199553
199831 199538
199636 199496
199982 199652
199620 199624
199774 199108
199513 199362
199989 199650
199676 199709
199135 199746
199835 199751
199122 199608
199933 199730
199593 199646
199554 199997
199296 199217
199383 199202
199382...

result:

ok All OK (1 test case)