QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#358989#8196. Zapobiegliwy studentvan_Dijk100 ✓141ms29456kbC++171.6kb2024-03-20 10:21:312024-03-20 10:21:31

Details

Tip: Click on the bar to expand more detailed information

Subtask #1:

score: 40
Accepted

Test #1:

score: 40
Accepted
time: 2ms
memory: 5680kb

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: 0ms
memory: 5744kb

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: 5736kb

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: 5692kb

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: 5584kb

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: 1ms
memory: 5852kb

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: 5720kb

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: 0ms
memory: 5732kb

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: 5720kb

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: 5736kb

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: 5640kb

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: 5888kb

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: 40
Accepted
time: 1ms
memory: 5976kb

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:

711
147 1399
1808 314
663 1383
614 493
1454 1480
603 1377
1710 1702
893 297
1179 151
1024 171
1693 1647
468 1446
811 582
551 633
1847 764
101 552
411 227
419 166
211 16
198 1818
942 1519
83 132
1084 1890
1160 1376
285 45
562 127
1079 1819
1746 1884
1372 32
165 538
1680 1575
1065 1486
526 1572
318 13...

result:

ok 

Test #14:

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

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:

708
1422 124
825 717
455 1658
903 959
280 951
1554 907
891 1653
1295 722
1186 1258
201 1783
51 148
1372 1499
1897 1547
1707 1833
1692 552
1396 716
160 1039
1230 1019
943 1610
1262 1538
87 566
1073 655
294 1842
1102 291
1600 1623
1442 1500
981 1098
1411 848
1733 1314
1702 1047
457 705
1364 886
1675 1...

result:

ok 

Test #15:

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

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:

680
1092 1196
1267 759
1084 1167
1139 602
923 819
516 1221
510 915
1059 53
1455 596
1849 1770
1170 135
1827 1730
743 1500
1572 498
23 1652
642 202
1569 1409
105 526
1672 658
255 413
480 631
272 345
44 1052
871 1454
919 1065
675 68
269 80
954 1375
1035 1716
1548 447
643 1406
887 74
434 835
592 1294
7...

result:

ok 

Test #16:

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

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:

697
247 1807
875 525
1611 1829
1793 983
1159 79
350 414
1107 588
1000 355
483 1755
1213 516
176 5
503 1221
749 1158
64 1242
145 1751
1034 1105
302 148
139 873
1299 40
646 614
972 409
1663 668
1674 444
1015 633
1300 1439
1627 403
1204 598
1090 589
1389 1025
1548 1321
522 1679
664 1581
197 792
1356 25...

result:

ok 

Test #17:

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

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:

674
1630 1305
300 1117
184 99
215 491
642 817
857 494
829 164
620 465
1327 1757
838 1742
490 2
1442 1427
1486 1765
742 1028
1423 708
1334 1193
555 714
1297 1276
105 535
486 1220
912 450
342 190
674 101
823 407
920 1697
1013 695
664 1606
994 69
1812 1129
597 55
658 1130
208 547
1677 12
1370 1571
699 ...

result:

ok 

Test #18:

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

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:

697
842 1198
1569 1079
902 763
560 130
1670 548
496 1822
616 676
1232 170
1572 498
1593 753
328 1860
707 916
1047 1869
1735 1268
1835 792
615 1561
125 1481
492 320
1651 163
459 965
856 260
1431 387
573 895
1137 1594
1303 438
122 522
400 1546
1627 1309
1811 1747
744 1151
1842 1808
482 274
710 669
888...

result:

ok 

Test #19:

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

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: 5532kb

input:

2
1 4
2 3

output:

1
2 1

result:

ok 

Test #21:

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

input:

2
1 2
3 4

output:

1
1 2

result:

ok 

Test #22:

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

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: 60
Accepted

Dependency #1:

100%
Accepted

Test #23:

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

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: 125ms
memory: 20716kb

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: 122ms
memory: 21336kb

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: 128ms
memory: 21960kb

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: 104ms
memory: 19000kb

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: 79ms
memory: 18184kb

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 379175
170188 425286
266467 38639
296310 302884
90209 408259
489686 45501
476718 295041
76069 330503
92403 199945
304893 219852
42342 135552
80537 13496
405299 345702
243940 242845
103327 268985
244724 201686
140632 195040
491313 23666
353100 393024
16390 28094
419903 170059
48491 484003
2...

result:

ok 

Test #29:

score: 60
Accepted
time: 141ms
memory: 29456kb

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: 132ms
memory: 23264kb

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: 137ms
memory: 22408kb

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: 120ms
memory: 20356kb

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: 100ms
memory: 17184kb

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: 75ms
memory: 17668kb

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: 60
Accepted
time: 82ms
memory: 17100kb

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:

115875
280586 123677
261966 310191
242613 110972
234815 133436
110831 150390
122307 292800
224796 39618
251262 92761
115821 166234
152018 234343
58879 295539
177264 148665
275203 206280
247640 169750
128093 191589
116086 251073
143647 61661
213663 42619
152705 264844
27421 278644
10182 250312
40005 ...

result:

ok 

Test #36:

score: 60
Accepted
time: 83ms
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:

115983
108106 243340
133346 287829
174713 68349
169549 36444
119443 302094
256820 134041
260561 153972
22185 181009
166660 244010
98359 247369
166931 193119
111135 259327
39665 262136
8039 115478
17237 26484
244 165608
255101 92503
207767 12967
306284 121077
197369 211610
210129 284794
292162 26951
...

result:

ok 

Test #37:

score: 60
Accepted
time: 79ms
memory: 16376kb

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:

115630
51934 193191
177303 225878
170079 275649
88003 154975
70835 41024
202509 19231
253496 249226
151289 88638
31839 84869
247277 251123
227664 197239
22923 31640
56558 236672
309834 122187
259380 37250
301501 85533
48692 294973
93708 279352
76979 79676
279520 182151
80747 243988
142948 166300
224...

result:

ok 

Test #38:

score: 60
Accepted
time: 83ms
memory: 15112kb

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:

116002
171563 2615
143762 179548
224865 98083
253007 132054
287578 253249
210585 177014
78523 154370
26479 136896
45921 81970
23789 4862
306933 101552
96040 16940
183738 264599
14690 208672
297342 257526
234431 219741
263471 274073
303554 24148
35534 298250
192542 77816
99819 81810
175270 45246
1047...

result:

ok 

Test #39:

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

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:

115948
232190 9923
248384 303478
221189 13633
279469 180134
34634 142577
234065 121180
252284 16118
166609 43380
223533 53518
170025 248475
155192 215014
108288 211239
227751 146394
203378 258599
195396 299993
264151 270234
18016 237811
38296 89877
302587 262698
106903 145604
69122 78481
9419 49173
...

result:

ok 

Test #40:

score: 60
Accepted
time: 81ms
memory: 16772kb

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:

115900
276362 134285
192943 291204
134722 270018
214044 256994
107947 313109
103248 167356
153732 18851
109131 290758
291443 34141
12290 51423
128675 37022
118533 198845
106198 122241
16368 155773
275364 259510
286306 270098
309064 172983
30038 57579
35629 51347
38728 122762
13201 227496
84845 22638...

result:

ok 

Test #41:

score: 60
Accepted
time: 122ms
memory: 22652kb

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: 5644kb

input:

2
1 4
2 3

output:

1
2 1

result:

ok 

Test #43:

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

input:

2
1 2
3 4

output:

1
1 2

result:

ok 

Test #44:

score: 60
Accepted
time: 134ms
memory: 25852kb

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 

Extra Test:

score: 0
Extra Test Passed