QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#358966#8196. Zapobiegliwy studentvan_Dijk15 147ms26388kbC++171.3kb2024-03-20 09:59:482024-03-20 09:59:48

详细

Subtask #1:

score: 6
Acceptable Answer

Test #1:

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

input:

3000
3933353 70882522
431257009 431260553
90739306 181374877
122022862 131964741
563835356 563924377
118764371 334063455
26214655 62023860
40797538 289373132
85278264 154263043
559290951 559390997
140863766 181337311
30550198 99872053
53298927 164507323
398655954 398779690
454048567 454187653
256862...

output:

710
1489 1635
95 1635
2699 1635
19 1635
2552 1635
2346 1635
382 1635
798 1635
2951 1635
874 1635
480 1635
1223 1635
171 1635
2813 1635
2795 1635
1704 1635
2585 1635
1788 1635
21 1635
2926 1635
2382 1635
556 1635
2973 1635
2881 1635
2575 1635
1807 1635
1221 1635
1173 1635
2461 1635
1234 1635
1964 163...

result:

ok 

Test #2:

score: 40
Accepted
time: 1ms
memory: 5632kb

input:

3000
31030527 224953096
362558018 362950530
181784096 231354294
102853306 170479486
157957286 258809455
39420753 102841775
66680992 91375920
115393779 157957286
41333976 56861640
57405250 109915816
12325647 126099987
60106250 108557797
419465371 419502618
54901708 81479964
157718826 157957286
318294...

output:

1164
1829 1868
1633 1868
226 1868
436 1868
1984 1868
123 1868
1505 1868
2098 1868
2842 1868
1612 1868
309 1868
520 1868
2150 1868
79 1868
1198 1868
1258 1868
1200 1868
663 1868
172 1868
2355 1868
2396 1868
667 1868
252 1868
1672 1868
1703 1868
216 1868
1644 1868
2762 1868
1583 1868
46 1868
1866 1868...

result:

ok 

Test #3:

score: 40
Accepted
time: 1ms
memory: 5920kb

input:

3000
71012996 71094087
142103791 142153359
129250374 138842795
18535894 18554386
192995012 193103066
46363241 46370290
149525178 149638179
154963002 171398581
109691836 123828530
153720609 153864248
52639958 52757141
188195177 205887265
63643341 63689591
72539758 72605349
201057807 217241469
1334440...

output:

889
2954 2841
1457 2841
1562 2841
588 2841
685 2841
2455 2841
2485 2841
406 2841
75 2841
518 2841
2307 2841
1636 2841
2185 2841
1241 2841
2142 2841
1796 2841
2657 2841
2915 2841
2360 2841
74 2841
1870 2841
899 2841
972 2841
1567 2841
527 2841
1094 2841
2824 2841
2127 2841
2200 2841
2378 2841
503 284...

result:

ok 

Test #4:

score: 40
Accepted
time: 1ms
memory: 5732kb

input:

3000
74523187 74639447
69002241 74017833
38903521 53274148
27964195 28108909
90480259 90714386
80227337 80233197
74024120 74355868
87997733 91873572
115068358 115237960
81118691 82016815
71587720 71686990
54665074 79252306
83590436 83831492
101758617 102092854
11897307 12018869
83749552 83831331
775...

output:

950
759 659
1635 659
1313 659
1974 659
507 659
1162 659
1452 659
636 659
872 659
101 659
2327 659
230 659
1503 659
1519 659
877 659
1580 659
1508 659
1898 659
2869 659
2817 659
279 659
1487 659
2562 659
2222 659
1890 659
719 659
1478 659
52 659
2978 659
922 659
1616 659
1739 659
601 659
1631 659
224...

result:

ok 

Test #5:

score: 40
Accepted
time: 1ms
memory: 5768kb

input:

3000
7051210 8589811
18502361 18548147
10825587 10925453
10814101 11820256
6634997 7192161
8159514 9623111
6343123 9208117
11598681 13563271
15947954 16110829
11889628 11939148
8237287 8288595
18548147 18620522
9481884 10648149
8589811 8719610
11820256 11855114
14689173 16361212
10814101 10825530
65...

output:

196
2735 611
661 611
1014 611
2044 611
1785 611
2990 611
1788 611
2036 611
1256 611
1638 611
1000 611
2376 611
2509 611
919 611
2352 611
640 611
512 611
1957 611
982 611
734 611
1062 611
717 611
2897 611
1323 611
510 611
2700 611
1848 611
1933 611
234 611
2370 611
1922 611
1884 611
1390 611
1435 611...

result:

ok 

Test #6:

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

input:

3000
9666113 9699478
6965840 7841200
10055382 12219484
10288891 10367080
6969527 7162495
8594370 9548407
10250084 10288891
10420507 10762472
10055382 10123746
12068744 12162702
6969527 7162495
898461 1193510
12945038 12957489
8815357 8915885
10762472 10764220
11051606 11190103
10250084 10288891
1076...

output:

97
366 1235
1690 1235
2693 1235
1371 1235
53 1235
1900 1235
2674 1235
2049 1235
2806 1235
1301 1235
2590 1235
1265 1235
826 1235
2797 1235
2409 1235
1077 1235
239 1235
534 1235
2349 1235
1062 1235
2478 1235
2569 1235
1079 1235
1897 1235
78 1235
675 1235
1149 1235
2845 1235
68 1235
341 1235
1411 1235...

result:

ok 

Test #7:

score: 40
Accepted
time: 1ms
memory: 5620kb

input:

2990
50340082 121213456
3227228 116175285
424744925 424887740
31439322 277401622
336388021 336431031
15931482 29319341
75260985 231708778
185165107 185293971
67367703 141831559
17406456 49981991
49079607 445176184
94084419 94416531
265132826 265169936
107853545 320822230
62144003 123579437
377801615...

output:

989
1328 757
2221 757
1484 757
2429 757
1827 757
366 757
486 757
2687 757
755 757
2538 757
1563 757
488 757
686 757
820 757
166 757
1995 757
2568 757
2481 757
776 757
1150 757
2256 757
2450 757
2958 757
556 757
1725 757
1078 757
1425 757
12 757
2194 757
173 757
362 757
2945 757
2381 757
674 757
2276...

result:

ok 

Test #8:

score: 40
Accepted
time: 1ms
memory: 5932kb

input:

2990
250865254 250869884
286482343 431381520
67327525 67430639
51403719 51487566
289528053 289582672
423899248 490004400
258417153 458191427
461265317 465980729
394370749 491254041
403746044 408137448
290547180 290680587
319179787 323134772
223102834 223331806
432432647 436809367
213343887 357836802...

output:

1182
1793 1019
812 1019
1248 1019
2627 1019
278 1019
1946 1019
1448 1019
1562 1019
2740 1019
1431 1019
745 1019
440 1019
1364 1019
149 1019
1771 1019
1112 1019
2416 1019
954 1019
1784 1019
706 1019
1082 1019
1890 1019
218 1019
1725 1019
991 1019
996 1019
2053 1019
190 1019
426 1019
568 1019
1256 101...

result:

ok 

Test #9:

score: 40
Accepted
time: 1ms
memory: 5924kb

input:

2990
102788330 102925405
4878515 31638048
177455671 177533043
32255571 37544098
114232867 117557314
40689737 40719674
73751698 73933892
133909722 134297030
110647842 113985076
93078823 93091503
82870304 101468113
69527427 87652872
92822371 92926747
35890864 97925062
232144359 232402208
93726776 9656...

output:

813
1519 821
844 821
75 821
1516 821
404 821
2801 821
2867 821
582 821
2126 821
2356 821
2790 821
1459 821
2942 821
1134 821
114 821
2073 821
967 821
2462 821
1584 821
1068 821
2856 821
2226 821
933 821
2855 821
1542 821
1944 821
710 821
393 821
716 821
2077 821
2734 821
2169 821
2310 821
1947 821
2...

result:

ok 

Test #10:

score: 40
Accepted
time: 1ms
memory: 5604kb

input:

2990
35883857 36839641
17782252 51143143
68716248 76021874
76043743 76217639
33446237 33518833
39879049 41955106
44893112 73888169
38705671 40125877
53703222 64069313
60894195 61523325
25303122 25500733
37162379 45358432
10932450 11196880
33952191 34106194
86352421 87513151
21744478 28830372
8093553...

output:

714
1730 841
2664 841
1979 841
1414 841
2573 841
253 841
1191 841
2236 841
2889 841
1016 841
1176 841
2944 841
2010 841
2532 841
2165 841
2133 841
1920 841
2449 841
2505 841
31 841
1795 841
2890 841
354 841
263 841
796 841
1717 841
250 841
919 841
1573 841
1984 841
376 841
1727 841
2533 841
1238 841...

result:

ok 

Test #11:

score: 40
Accepted
time: 1ms
memory: 5896kb

input:

2990
15071564 16374160
14115610 15457074
18513886 18574399
16420710 16483561
14783931 15042254
12820856 13241099
14794431 15774071
20604285 20741904
8954839 8981274
13733211 13972852
11879070 14016942
19228344 21918959
23906126 24094967
11863974 11949391
18459398 18770708
14783931 15101427
12478133 ...

output:

214
511 1299
295 1299
425 1299
1864 1299
452 1299
1574 1299
1349 1299
709 1299
267 1299
1721 1299
1005 1299
777 1299
1526 1299
2669 1299
691 1299
1320 1299
2784 1299
2595 1299
2873 1299
2411 1299
1851 1299
635 1299
2405 1299
729 1299
1838 1299
205 1299
2716 1299
1633 1299
925 1299
1497 1299
2764 129...

result:

ok 

Test #12:

score: 40
Accepted
time: 1ms
memory: 5592kb

input:

2990
5940513 5985963
7319348 7434051
6644317 6874055
7206754 9269298
9652129 9752692
4832948 5795408
5910136 6545830
9752692 9773617
6644317 7434051
5116164 5365823
8410392 8568019
5116164 6874055
5985963 5998318
2093281 2454423
9218895 9269298
5795408 5796544
5795408 5796544
6545830 6644317
5940513...

output:

90
1036 1002
449 1002
1722 1002
123 1002
2470 1002
1280 1002
282 1002
2953 1002
1369 1002
1621 1002
1470 1002
1801 1002
423 1002
1616 1002
2108 1002
1159 1002
1032 1002
2068 1002
1664 1002
1098 1002
56 1002
37 1002
2770 1002
2282 1002
984 1002
2750 1002
2439 1002
2717 1002
2007 1002
2145 1002
1056 1...

result:

ok 

Test #13:

score: 6
Acceptable Answer
time: 1ms
memory: 5640kb

input:

1910
75202538 75470705
121439276 121919190
251206481 252242944
86382123 92860960
614158821 614579149
305272572 305846919
646930494 647247261
130693374 131191622
57240909 57310488
625780955 628286239
44326730 44369315
171865307 172643196
44326730 44895004
429513780 430793052
563643413 564501483
16883...

output:

710
147 1431
1808 1431
663 1431
614 1431
1480 1431
603 1431
1710 1431
893 1431
1179 1431
1024 1431
1693 1431
1446 1431
811 1431
551 1431
764 1431
101 1431
411 1431
419 1431
211 1431
1818 1431
942 1431
83 1431
1084 1431
1160 1431
285 1431
127 1431
1079 1431
1746 1431
1372 1431
165 1431
1575 1431
1065...

result:

points 0.150

Test #14:

score: 6
Acceptable Answer
time: 1ms
memory: 7920kb

input:

1898
184900554 185195808
596932543 597022839
135894103 136382082
254770095 255722821
628780718 629396361
89010691 89162557
642069578 643306766
229707657 230831841
274813298 276499996
135062542 136833638
204166458 206497511
683486146 685362282
149063878 149102082
229267785 230703363
72612168 73087843...

output:

707
1422 1647
825 1647
455 1647
903 1647
951 1647
1554 1647
891 1647
1295 1647
1186 1647
1783 1647
51 1647
1372 1647
1897 1647
1833 1647
1692 1647
1396 1647
160 1647
1230 1647
1610 1647
1262 1647
87 1647
1073 1647
1842 1647
1102 1647
1600 1647
1442 1647
981 1647
1411 1647
1733 1647
1047 1647
457 164...

result:

points 0.150

Test #15:

score: 6
Acceptable Answer
time: 1ms
memory: 5676kb

input:

1868
738941544 739319851
22325451 23612100
253148693 253538781
545244471 546518034
312379559 315502647
249862738 250436819
527886214 529214868
261028713 274340180
558238279 558989089
592442191 592639859
88075311 89041265
317641731 340661240
499536929 500333273
510190160 510669948
517022124 517833793...

output:

679
1092 454
1267 454
1167 454
1139 454
923 454
516 454
510 454
1059 454
596 454
1849 454
1170 454
1827 454
1500 454
1572 454
23 454
642 454
1409 454
105 454
1672 454
255 454
480 454
272 454
44 454
1454 454
919 454
675 454
269 454
954 454
1035 454
447 454
643 454
887 454
434 454
1294 454
789 454
487...

result:

points 0.150

Test #16:

score: 6
Acceptable Answer
time: 1ms
memory: 5600kb

input:

1898
593691572 593906544
419361221 419442981
731410217 731573761
19426567 25770341
7209560 7370309
177180275 178264189
456333304 456650631
276969920 280173683
53912270 54256982
328109128 328601378
309178445 309374144
422353313 422624521
101935776 102094019
738549151 738791815
353088558 354042200
585...

output:

696
247 1355
875 1355
1611 1355
1793 1355
79 1355
350 1355
1107 1355
1000 1355
483 1355
516 1355
176 1355
503 1355
749 1355
64 1355
145 1355
1105 1355
302 1355
139 1355
1299 1355
646 1355
409 1355
1663 1355
1674 1355
1015 1355
1300 1355
403 1355
1204 1355
1090 1355
1389 1355
1321 1355
522 1355
664 1...

result:

points 0.150

Test #17:

score: 6
Acceptable Answer
time: 1ms
memory: 5876kb

input:

1844
102448427 104401885
10812012 11147082
420064916 421813703
661768204 662311317
508103199 511664791
442978839 443498253
241119414 241242725
396935383 397076925
580250057 580771846
432700109 433367374
646020379 646247214
29751892 30362447
37993837 44589226
709057845 716237087
359343035 374738552
4...

output:

673
1630 456
300 456
184 456
215 456
817 456
857 456
829 456
465 456
1327 456
838 456
490 456
1442 456
1486 456
742 456
1423 456
1193 456
555 456
1297 456
535 456
486 456
912 456
342 456
101 456
823 456
920 456
1013 456
664 456
994 456
1812 456
55 456
658 456
208 456
1677 456
1370 456
699 456
373 45...

result:

points 0.150

Test #18:

score: 6
Acceptable Answer
time: 0ms
memory: 5784kb

input:

1889
564785915 566122852
519698913 520739863
435185494 435314066
645242669 645599840
28210897 28439640
593709195 593719822
565773316 566216270
519871611 521349793
378541513 425804871
578073871 578784796
48330689 48551496
604868766 604875993
138704249 138722239
38415541 39737338
230466551 231577842
7...

output:

696
842 1703
1569 1703
902 1703
130 1703
1670 1703
496 1703
616 1703
170 1703
1572 1703
1593 1703
328 1703
707 1703
1047 1703
1268 1703
1835 1703
615 1703
1481 1703
492 1703
1651 1703
459 1703
856 1703
1431 1703
895 1703
1137 1703
1303 1703
522 1703
400 1703
1627 1703
1811 1703
744 1703
1808 1703
48...

result:

points 0.150

Test #19:

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

input:

3000
924 2077
3806 3807
3479 3480
3061 3062
1205 1796
1351 1650
495 2506
4363 4364
4040 4041
4420 4421
957 2044
3885 3886
1315 1686
794 2207
3509 3510
3151 3152
4254 4255
3830 3831
1385 1616
748 2253
3121 3122
579 2422
623 2378
3645 3646
1484 1517
32 2969
439 2562
3210 3211
4183 4184
3683 3684
3598 ...

output:

1500
1062 619
575 619
2585 619
2123 619
1485 619
1628 619
2053 619
1276 619
917 619
2135 619
1531 619
1615 619
1194 619
2419 619
2709 619
1365 619
1139 619
546 619
2052 619
1478 619
1437 619
2744 619
1792 619
1524 619
1960 619
294 619
2346 619
1958 619
2348 619
460 619
936 619
38 619
1433 619
2252 6...

result:

ok 

Test #20:

score: 40
Accepted
time: 1ms
memory: 5672kb

input:

2
1 4
2 3

output:

1
2 1

result:

ok 

Test #21:

score: 40
Accepted
time: 1ms
memory: 5836kb

input:

2
1 2
3 4

output:

1
1 2

result:

ok 

Test #22:

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

input:

3000
65358258 65908047
385965515 386042234
37731087 38183736
299401409 300119156
454768183 454951855
312689188 312965778
304032771 304164881
217183822 217316878
174450942 174542630
451680500 452256646
75963152 76196904
86254155 86565208
40119130 40279303
370158759 370442706
396706744 397157378
30651...

output:

1499
113 929
95 929
2699 929
1413 929
1987 929
2180 929
2899 929
2689 929
1643 929
2254 929
1539 929
2955 929
203 929
2059 929
1711 929
1389 929
2740 929
1704 929
1652 929
518 929
2019 929
1918 929
2720 929
2996 929
1626 929
1851 929
363 929
1533 929
925 929
801 929
2233 929
1687 929
1815 929
1673 9...

result:

ok 

Subtask #2:

score: 9
Acceptable Answer

Dependency #1:

15%
Acceptable Answer

Test #23:

score: 60
Accepted
time: 139ms
memory: 21680kb

input:

500000
407892396 407894065
654503489 654503501
9066405 84391111
140987019 171563436
14057278 19781051
34941076 145785516
234766009 234766141
20335659 44712015
336459606 336460578
317292502 317292578
13283779 15008155
6484755 100390340
465647488 465647776
381908371 381910825
102485960 185427558
76325...

output:

254096
81832 474568
472970 474568
27474 474568
460177 474568
379375 474568
290327 474568
342403 474568
55528 474568
399190 474568
193080 474568
105813 474568
18538 474568
347640 474568
449138 474568
120979 474568
318397 474568
246530 474568
417484 474568
132745 474568
276830 474568
104176 474568
376...

result:

ok 

Test #24:

score: 60
Accepted
time: 131ms
memory: 20248kb

input:

500000
13002946 68701866
4733539 43995294
31492413 103830172
170770666 171815325
12805604 155553070
73232678 89080638
122151560 122802318
121601488 122265567
98532673 245103395
23340940 81165159
404593991 404594275
130046140 150732609
48079081 245423481
478588967 478589353
34762052 141554385
6826022...

output:

123907
70731 20502
307436 20502
87871 20502
474491 20502
369497 20502
256581 20502
161196 20502
43458 20502
156639 20502
186657 20502
117899 20502
9158 20502
231719 20502
379672 20502
120201 20502
60345 20502
330118 20502
317923 20502
52634 20502
171074 20502
70756 20502
490914 20502
30777 20502
216...

result:

ok 

Test #25:

score: 60
Accepted
time: 129ms
memory: 19252kb

input:

500000
26643253 26762939
124973874 124973924
104836056 139539875
95035682 101884314
107671424 114521776
105444682 105444834
46748925 46867583
41225663 63736637
177953802 177958013
149360101 159964168
145683623 155425562
41865427 41988301
107339428 114192197
192436713 192436745
77497028 79907719
2318...

output:

107589
236029 362037
308847 362037
113662 362037
284184 362037
124901 362037
22383 362037
419546 362037
341449 362037
2319 362037
448425 362037
61034 362037
436608 362037
131229 362037
469898 362037
377267 362037
274991 362037
331359 362037
64546 362037
213978 362037
450710 362037
27147 362037
33601...

result:

ok 

Test #26:

score: 60
Accepted
time: 125ms
memory: 20908kb

input:

500000
61971783 62075841
66131430 66132218
56238154 56238690
70076915 70077077
38011798 49115996
86388430 86388721
50785655 51197023
66314821 66335131
35347975 35348446
41895585 41924952
56721852 56721957
54523356 54571508
64943486 64943599
83965472 83965737
73610011 73748884
17824907 53135985
77041...

output:

109835
249364 143010
105984 143010
108924 143010
416949 143010
83065 143010
460647 143010
206530 143010
71657 143010
44577 143010
129412 143010
16635 143010
150160 143010
42958 143010
352509 143010
203690 143010
35266 143010
371192 143010
488146 143010
390606 143010
128511 143010
87334 143010
417551...

result:

ok 

Test #27:

score: 60
Accepted
time: 101ms
memory: 19436kb

input:

500000
549476 1024522
829710 830282
415118 417693
900627 900646
612307 612794
425978 1066159
225433 225749
536172 676316
681207 681756
1493301 1493744
970766 972749
669865 1121461
1232252 1234410
772478 848691
1292705 1294653
645110 645345
555103 831576
1290503 1291102
1289304 1294653
63538 294731
4...

output:

2633
63825 169318
102665 169318
224013 169318
346246 169318
224184 169318
93591 169318
87938 169318
421961 169318
296560 169318
137943 169318
441466 169318
400269 169318
382602 169318
1196 169318
127040 169318
212822 169318
22176 169318
314219 169318
308956 169318
40024 169318
172284 169318
176334 1...

result:

ok 

Test #28:

score: 60
Accepted
time: 78ms
memory: 18152kb

input:

500000
59055 59158
34450 35028
60662 60881
34182 34450
34450 39260
50981 51138
59055 59158
49699 52035
41744 41887
57978 58874
35028 41887
41887 42178
36810 53188
52355 53188
57793 57978
32988 33087
38381 42178
41697 41744
51138 51327
34182 41697
32286 38661
36602 47074
36810 37022
51327 52035
49699...

output:

115
82037 211482
170188 211482
266467 211482
296310 211482
90209 211482
489686 211482
476718 211482
76069 211482
92403 211482
304893 211482
42342 211482
80537 211482
405299 211482
243940 211482
103327 211482
244724 211482
140632 211482
491313 211482
353100 211482
16390 211482
419903 211482
48491 211...

result:

ok 

Test #29:

score: 60
Accepted
time: 147ms
memory: 26388kb

input:

499990
948742631 949003988
768464404 768464571
384190932 384193353
80112927 80114309
589096347 589097682
70759321 70760675
28970784 28971152
394499087 394499682
683566590 683568937
209192916 209193238
392085104 392085884
371213970 371215503
891551959 891552951
389814151 389814198
352166345 352167268...

output:

462714
241408 418397
307102 418397
153549 418397
200060 418397
415595 418397
379961 418397
361275 418397
166012 418397
366517 418397
360486 418397
41945 418397
148345 418397
427057 418397
214487 418397
177382 418397
26218 418397
416458 418397
494244 418397
59499 418397
266938 418397
159944 418397
31...

result:

ok 

Test #30:

score: 60
Accepted
time: 131ms
memory: 21840kb

input:

499990
429148896 429151777
8193013 218244899
219266522 219639868
4219530 37374453
106959371 107228024
99134307 99404667
143400334 143687917
41398062 88930525
82381795 114350328
32011271 125545161
72448978 216170891
88734159 117405370
87545495 201886821
471444790 471445433
13307185 64810927
166753731...

output:

136999
269016 361656
497467 361656
272484 361656
266871 361656
377527 361656
232107 361656
157096 361656
282529 361656
169497 361656
410673 361656
468644 361656
138986 361656
486432 361656
462709 361656
361380 361656
458331 361656
240103 361656
98057 361656
345910 361656
282896 361656
170582 361656
...

result:

ok 

Test #31:

score: 60
Accepted
time: 128ms
memory: 20568kb

input:

499990
23315946 27579365
40128118 40129415
122201100 122436620
156057106 156395362
5745239 24364747
15207076 15207801
84025083 84027386
210395536 210396027
39041366 39041750
109300727 109405655
131326726 131583213
131727123 131727805
42081188 46459629
165678828 165678937
91300895 91301245
112722726 ...

output:

193921
256770 395326
288264 395326
390019 395326
381771 395326
288364 395326
465373 395326
167243 395326
451895 395326
294047 395326
268818 395326
106245 395326
80627 395326
494954 395326
168690 395326
445729 395326
481018 395326
262437 395326
343640 395326
100026 395326
200056 395326
13224 395326
4...

result:

ok 

Test #32:

score: 60
Accepted
time: 126ms
memory: 20012kb

input:

499990
19455659 49619275
52349364 52350224
3529937 19390686
17301372 45920111
20272556 35225907
61461723 62247708
46884837 47695311
92020790 92023872
94218595 94219721
59105993 72668879
78211271 78211555
1544311 2791589
94958034 94958055
35529888 47505235
7271832 7272908
63636409 63637185
83764915 8...

output:

74447
472598 269238
325432 269238
387915 269238
100283 269238
74144 269238
453669 269238
302519 269238
55436 269238
342656 269238
370055 269238
435247 269238
331124 269238
196518 269238
391515 269238
53219 269238
472213 269238
402162 269238
472201 269238
142364 269238
166956 269238
49532 269238
9237...

result:

ok 

Test #33:

score: 60
Accepted
time: 96ms
memory: 18556kb

input:

499990
1151472 1152459
593018 594473
289315 788469
168692 237090
903501 904065
248851 249454
845938 846960
634849 911812
296612 697067
430952 431473
1146908 1147314
686201 686275
713130 781179
679476 845874
945092 945517
235256 295919
285724 285728
470234 584188
163959 237783
172934 272433
350474 35...

output:

2703
417557 321065
330480 321065
189534 321065
396039 321065
302221 321065
362432 321065
295567 321065
65118 321065
213986 321065
397070 321065
127719 321065
132583 321065
10343 321065
97696 321065
15724 321065
330687 321065
93507 321065
381167 321065
112983 321065
7370 321065
179379 321065
169709 3...

result:

ok 

Test #34:

score: 60
Accepted
time: 82ms
memory: 18428kb

input:

499990
57043 61353
61827 62133
74447 74553
57185 57707
53474 56355
53474 54680
39723 41557
38262 55213
59832 61282
61353 61827
50045 56355
49221 53141
41557 48901
48901 49221
50930 57185
62794 63258
50045 50062
13991 15757
58756 58961
51322 52678
50045 50062
53474 54680
53474 54680
51322 55213
55213...

output:

116
195937 79074
316062 311518
435112 238506
264084 85309
434592 365350
298502 340448
481173 282719
17735 367576
465073 415099
114970 438143
157953 485053
207690 332276
150495 427104
164960 247532
478948 343889
97104 408325
201544 136666
234519 255125
230273 216182
192366 112584
212144 405469
17707 ...

result:

ok 

Test #35:

score: 9
Acceptable Answer
time: 81ms
memory: 17792kb

input:

314300
524197415 524210323
496787896 496793207
82238259 82238773
251533834 251535738
662752628 662756074
305708987 305710968
553082058 553810952
426801990 427316637
700885978 700889113
324634315 324637427
172597379 172608941
621945256 621949200
689378341 689378842
590173930 590240692
204585773 20458...

output:

115874
280586 133863
261966 133863
242613 133863
234815 133863
110831 133863
292800 133863
224796 133863
251262 133863
115821 133863
152018 133863
58879 133863
177264 133863
275203 133863
247640 133863
191589 133863
116086 133863
143647 133863
213663 133863
264844 133863
27421 133863
10182 133863
40...

result:

points 0.150

Test #36:

score: 9
Acceptable Answer
time: 80ms
memory: 15364kb

input:

314891
313105072 313170057
87030149 87030975
229859890 229863423
732365163 732366171
357433917 357445674
35469970 35470819
172235014 172240393
650294966 650296073
131063544 131157054
739570398 739621168
499910260 499914127
639003360 639004212
224364032 224364999
201227273 201240314
562437749 5624382...

output:

115982
108106 305965
133346 305965
174713 305965
169549 305965
302094 305965
256820 305965
260561 305965
181009 305965
166660 305965
98359 305965
166931 305965
259327 305965
39665 305965
8039 305965
17237 305965
165608 305965
255101 305965
207767 305965
306284 305965
197369 305965
210129 305965
2921...

result:

points 0.150

Test #37:

score: 9
Acceptable Answer
time: 77ms
memory: 15988kb

input:

313988
371199163 371214227
393965363 393965725
709122126 709127065
475663022 475665087
233764642 233764949
326625060 326629570
374334307 374340009
342871007 342871349
75596724 75603086
4391767 4391826
230091427 230100616
371989094 371991773
288609870 288612889
13547924 13551501
441364388 441369905
7...

output:

115629
51934 103452
177303 103452
170079 103452
88003 103452
70835 103452
19231 103452
253496 103452
151289 103452
31839 103452
247277 103452
197239 103452
22923 103452
56558 103452
309834 103452
37250 103452
301501 103452
48692 103452
93708 103452
76979 103452
279520 103452
243988 103452
142948 103...

result:

points 0.150

Test #38:

score: 9
Acceptable Answer
time: 79ms
memory: 16896kb

input:

314720
127910026 127915340
44213788 44221005
415670340 415680822
267281528 267326436
662014024 662015886
79675208 79723878
419407728 419416799
312926269 312939470
642030849 642039591
705170049 705175015
651863414 651865844
660584439 660671580
756898987 756909683
554710169 554711107
504664750 5046772...

output:

116001
171563 103261
143762 103261
98083 103261
253007 103261
287578 103261
210585 103261
154370 103261
26479 103261
45921 103261
23789 103261
101552 103261
96040 103261
183738 103261
14690 103261
297342 103261
234431 103261
263471 103261
24148 103261
35534 103261
192542 103261
99819 103261
45246 10...

result:

points 0.150

Test #39:

score: 9
Acceptable Answer
time: 80ms
memory: 16232kb

input:

314720
347052617 347055339
724335968 724338799
750657412 750658553
615943191 615948897
663480371 663480534
439021379 439031125
201335524 201336439
713978966 713980236
69216691 69217406
303017614 303021225
350670549 350674031
215332258 215341384
45162666 45166153
423902103 423903988
429147104 4291483...

output:

115947
232190 78672
248384 78672
221189 78672
279469 78672
34634 78672
121180 78672
252284 78672
166609 78672
53518 78672
170025 78672
155192 78672
108288 78672
146394 78672
203378 78672
195396 78672
264151 78672
18016 78672
38296 78672
262698 78672
106903 78672
69122 78672
9419 78672
57635 78672
89...

result:

points 0.150

Test #40:

score: 9
Acceptable Answer
time: 84ms
memory: 16364kb

input:

314447
679834604 679834918
658898707 658902690
371281102 371419988
108638749 108639370
728623301 728676550
148515084 148519334
383249460 383249917
688976425 688988953
246712312 246758901
324468223 324632740
215454415 215457585
324225156 324292922
716083076 716191643
148316304 148326023
467091813 467...

output:

115899
276362 116858
192943 116858
134722 116858
214044 116858
107947 116858
103248 116858
153732 116858
290758 116858
291443 116858
12290 116858
128675 116858
118533 116858
122241 116858
16368 116858
275364 116858
270098 116858
309064 116858
30038 116858
35629 116858
38728 116858
13201 116858
84845...

result:

points 0.150

Test #41:

score: 60
Accepted
time: 120ms
memory: 22640kb

input:

500000
663930 663931
181262 318739
155097 344904
529821 529822
249900 250101
139591 360410
576099 576100
718720 718721
695797 695798
191707 308294
50250 449751
547024 547025
3527 496474
113290 386711
37128 462873
7336 492665
155485 344516
17961 482040
641728 641729
686672 686673
142381 357620
749763...

output:

250000
313514 17931
82151 17931
284743 17931
461549 17931
370029 17931
166360 17931
200855 17931
7494 17931
252098 17931
62352 17931
202343 17931
157436 17931
166381 17931
262894 17931
260855 17931
6331 17931
409823 17931
376769 17931
297753 17931
24000 17931
193352 17931
418581 17931
130478 17931
4...

result:

ok 

Test #42:

score: 60
Accepted
time: 1ms
memory: 5528kb

input:

2
1 4
2 3

output:

1
2 1

result:

ok 

Test #43:

score: 60
Accepted
time: 1ms
memory: 5536kb

input:

2
1 2
3 4

output:

1
1 2

result:

ok 

Test #44:

score: 60
Accepted
time: 128ms
memory: 25180kb

input:

500000
334052756 334053121
3441473 3441605
235556626 235557202
224036358 224037627
168105326 168106795
2918751 2919905
296780188 296781094
417453734 417454217
358680743 358685659
10891367 10892114
72332955 72333855
304396338 304397913
453299019 453301641
452531125 452531586
226391530 226394485
28647...

output:

249999
37486 479298
455922 479298
51092 479298
144426 479298
266016 479298
246034 479298
187750 479298
247720 479298
21661 479298
379576 479298
52298 479298
373798 479298
279542 479298
275779 479298
435127 479298
308663 479298
396417 479298
123056 479298
305974 479298
177079 479298
80901 479298
1843...

result:

ok