QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#149506#5480. New Year FestivalflowerAC ✓1858ms528472kbC++203.1kb2023-08-24 19:10:322023-08-24 19:10:33

详细

Test #1:

score: 100
Accepted
time: 51ms
memory: 393732kb

input:

3
3 50
300 2500
350 0
400 3000
2 120
380 0
400 2400
4 160
0 800
400 0
450 100
950 4600

output:

1460

result:

ok single line: '1460'

Test #2:

score: 0
Accepted
time: 43ms
memory: 393780kb

input:

4
2 160
384 0
1000 2464
3 280
0 2646
441 0
1000 2795
1 160
544 0
2 240
720 0
1220 2000

output:

2022

result:

ok single line: '2022'

Test #3:

score: 0
Accepted
time: 1092ms
memory: 482084kb

input:

11
6 192168
0 8547618
626988 33627138
706274 36560720
1103426 50858192
1399013 55291997
1418093 55559117
6 161415
0 58611901
321482 57647455
349707 57534555
550744 55524185
885629 50500910
1448846 27972230
6 195811
0 6825079
56106 8339941
78686 8836701
323216 12993711
525834 15627745
1414450 2095944...

output:

629407685

result:

ok single line: '629407685'

Test #4:

score: 0
Accepted
time: 1130ms
memory: 485952kb

input:

11
6 179446
0 62171637
917478 60336681
1352062 59032929
1368160 58566087
1370260 58503087
1473445 54375687
6 186773
0 2933427
20897 3748410
356883 13827990
1190424 27998187
1340354 29497487
1466118 29623251
6 185925
0 53735520
130212 51652128
582223 42611908
1090981 31419232
1380019 23326168
1466966...

output:

593944734

result:

ok single line: '593944734'

Test #5:

score: 0
Accepted
time: 1156ms
memory: 488264kb

input:

11
6 187590
0 512536
451768 16324416
582142 19714140
1060264 31667190
1212260 33491142
1463556 33742438
6 186786
0 39848792
254907 39084071
928124 31678684
1344556 21684316
1452774 18978866
1464360 18619700
6 177523
0 42981626
30401 42920824
495821 40593724
949343 37419070
1207056 33295662
1473623 2...

output:

568541879

result:

ok single line: '568541879'

Test #6:

score: 0
Accepted
time: 969ms
memory: 477280kb

input:

11
6 180328
0 70912449
593492 69725465
631349 69119753
934610 63357794
1254206 51852338
1281827 50747498
2 1
543152 90245567
543162 90245567
6 176608
0 46706614
512238 65147182
604236 67263136
771264 69935584
987683 71666936
1285547 72858392
6 169123
0 71973961
349057 70228676
742671 63930852
106384...

output:

728555275

result:

ok single line: '728555275'

Test #7:

score: 0
Accepted
time: 876ms
memory: 471456kb

input:

11
6 171004
0 62863146
53160 62703666
297997 60500133
928595 50410565
1047846 48383298
1196274 42891462
2 1
497649 90358616
497658 90358616
2 1
877017 61053965
877067 61053965
6 192851
0 73730741
188629 73542112
238857 72939376
589071 62432956
903490 52685967
1174427 43474109
6 165034
0 39275349
288...

output:

684905214

result:

ok single line: '684905214'

Test #8:

score: 0
Accepted
time: 954ms
memory: 477164kb

input:

11
6 170701
0 66082360
363625 79900110
500001 84400518
1033901 98815818
1139446 99237998
1267187 99493480
2 1
529976 58976463
530026 58976463
6 199596
0 39595850
278702 34857916
365221 32781460
531968 28112544
917360 15009216
1238292 3455664
2 1
729627 23545904
729649 23545904
6 195425
0 21131820
63...

output:

539418869

result:

ok single line: '539418869'

Test #9:

score: 0
Accepted
time: 902ms
memory: 475328kb

input:

11
2 1
731822 57736604
731847 57736604
6 177906
0 31265048
204117 29632112
367764 26686466
1053673 12282377
1153199 9694701
1266786 6059917
2 1
536410 26155530
536462 26155530
2 1
920218 89157371
920236 89157371
6 173499
0 5971470
368364 19969302
688960 30869566
1086522 43989112
1098619 44364119
127...

output:

615248718

result:

ok single line: '615248718'

Test #10:

score: 0
Accepted
time: 897ms
memory: 471212kb

input:

11
6 196632
0 70110348
384388 82026376
394546 82199062
763377 86993865
810963 87422139
1260374 90118605
2 1
933046 16939393
933100 16939393
6 173665
0 25812347
235451 34524034
294814 36661102
403393 40352788
999221 58227628
1283341 59648228
6 177710
0 58412603
233394 55145087
426572 50122459
430534 ...

output:

735311761

result:

ok single line: '735311761'

Test #11:

score: 0
Accepted
time: 703ms
memory: 458156kb

input:

11
2 1
327714 97173804
327766 97173804
6 174068
0 97264397
26713 97130832
179562 95143795
858948 81556075
987929 78460531
1015941 77704207
6 175212
0 64880924
252642 73976036
266800 74400776
390959 77132274
806405 81286734
1014797 82953870
6 163249
0 42044695
49476 41747839
197386 40120829
451676 35...

output:

558987902

result:

ok single line: '558987902'

Test #12:

score: 0
Accepted
time: 775ms
memory: 462012kb

input:

11
6 163829
0 31289574
130497 30376095
712717 16402815
753079 15232317
797225 13907937
1066319 3144177
6 168138
0 63124751
45649 64585519
810233 88287623
898033 90658223
905417 90842823
1062010 91312602
6 170025
0 53069325
321981 48561591
591234 41291760
942888 31093794
1024294 28488802
1060123 2705...

output:

569257965

result:

ok single line: '569257965'

Test #13:

score: 0
Accepted
time: 741ms
memory: 461488kb

input:

11
6 167138
0 51023002
165600 56984602
219698 58878032
339095 61146575
892576 71109233
1041644 72748981
2 1
689176 94343012
689249 94343012
6 178942
0 58650734
374 58663824
515755 76186778
947018 84812038
988564 85559866
1029840 85724970
6 173405
0 47201281
229648 55468609
308300 57434909
384679 588...

output:

675590982

result:

ok single line: '675590982'

Test #14:

score: 0
Accepted
time: 749ms
memory: 462040kb

input:

11
6 174305
0 94317116
156381 93066068
738860 83163925
801318 81914765
1058316 74461823
1076858 73738685
6 187492
0 57378030
357720 70255950
383079 70940643
538696 74519834
830802 80946166
1063671 84439201
6 179318
0 62479756
269535 70565806
281413 70874634
634924 74763255
916720 75608643
1071845 75...

output:

712616989

result:

ok single line: '712616989'

Test #15:

score: 0
Accepted
time: 693ms
memory: 456336kb

input:

11
6 181795
0 17122556
102744 21129572
299317 28009627
806065 45239059
921763 47553019
1095305 48420729
6 190533
0 42602682
10275 43003407
180188 48610536
865763 67806636
939173 69715296
1086567 71631418
2 1
529036 58707251
529083 58707251
2 1
917587 10593491
917630 10593491
6 166172
0 73743543
1369...

output:

542369675

result:

ok single line: '542369675'

Test #16:

score: 0
Accepted
time: 601ms
memory: 450740kb

input:

11
2 1
727800 20498697
727829 20498697
6 177706
0 21250146
38893 21133467
250783 20285907
792887 8359619
798142 8191459
884652 5163609
6 162623
0 14906340
379619 30091100
415655 31424432
559643 35888060
746934 39821171
899735 42571589
6 179608
0 11941388
203734 19479546
321997 23263962
444492 265713...

output:

432748635

result:

ok single line: '432748635'

Test #17:

score: 0
Accepted
time: 609ms
memory: 451372kb

input:

11
2 1
331882 64233485
331943 64233485
6 161328
0 26996144
322377 22805243
707171 16648539
771738 15357199
776897 15248860
867217 12448940
2 1
867971 91310630
867989 91310630
6 160555
0 78199529
86753 80715366
401127 88574716
504487 90848636
790264 95135291
867990 95290743
2 1
703673 27828123
703687...

output:

683878583

result:

ok single line: '683878583'

Test #18:

score: 0
Accepted
time: 593ms
memory: 450124kb

input:

11
6 174316
0 47897162
641806 72927596
644242 73010420
755581 76016573
811250 76628932
893211 76792854
6 166188
0 66549903
71840 66406223
119861 65877992
325611 62791742
616567 54644974
901339 44393182
6 165579
0 1031241
48042 2760753
196253 5724973
535978 10820848
581549 11003132
901948 11964329
2 ...

output:

619086324

result:

ok single line: '619086324'

Test #19:

score: 0
Accepted
time: 604ms
memory: 448056kb

input:

11
6 167704
0 58832679
370569 55868127
626169 53567727
663624 52781172
836807 47412499
898647 45309939
6 178808
0 88894906
243375 88164781
297907 87946653
335037 87315443
849159 75490637
887543 74032045
2 1
730898 45305194
730922 45305194
2 1
167710 57873219
167770 57873219
2 1
346582 81704091
34665...

output:

584549217

result:

ok single line: '584549217'

Test #20:

score: 0
Accepted
time: 621ms
memory: 450024kb

input:

11
6 172855
0 42531672
172560 42186552
638982 36123066
740826 34697250
880888 31896010
912058 30960910
2 1
172859 87907354
172901 87907354
2 1
913759 84347576
913770 84347576
2 1
737496 15253290
737524 15253290
2 1
550983 60643609
551035 60643609
6 194108
0 64902863
18457 64810578
217247 61431148
54...

output:

597390225

result:

ok single line: '597390225'

Test #21:

score: 0
Accepted
time: 210ms
memory: 416904kb

input:

11
2 1
531 70843885
615 70843885
2 1
343 58517596
443 58517596
2 1
215 65255473
306 65255473
2 1
1 85022551
78 85022551
2 1
308 25241720
339 25241720
2 1
451 26840810
529 26840810
2 1
209 65672580
210 65672580
2 1
658 10786993
725 10786993
2 1
139 59113224
207 59113224
2 1
88 31479467
130 31479467
2...

output:

529410596

result:

ok single line: '529410596'

Test #22:

score: 0
Accepted
time: 296ms
memory: 424956kb

input:

11
3 10
11 10000000
12 0
13 10000000
3 20
21 10000000
22 0
23 10000000
3 40
41 10000000
42 0
43 10000000
3 80
81 10000000
82 0
83 10000000
3 160
161 10000000
162 0
163 10000000
3 320
321 10000000
322 0
323 10000000
3 640
641 10000000
642 0
643 10000000
3 1280
1281 10000000
1282 0
1283 10000000
3 256...

output:

0

result:

ok single line: '0'

Test #23:

score: 0
Accepted
time: 454ms
memory: 446168kb

input:

11
3 100000
100100 10000000
100101 0
100102 10000000
4 1
99999 10000000
100000 101022
201022 0
201023 10000000
4 2
99999 10000000
100000 0
201021 101021
201022 10000000
4 4
99999 10000000
100000 101019
201019 0
201020 10000000
4 8
99999 10000000
100000 0
201015 101015
201016 10000000
4 16
99999 1000...

output:

1004939

result:

ok single line: '1004939'

Test #24:

score: 0
Accepted
time: 231ms
memory: 415516kb

input:

11
1 1
309 0
2 1
0 1023
1023 0
2 2
0 0
1022 1022
2 4
0 1020
1020 0
2 8
0 1016
1016 0
2 16
0 0
1008 1008
2 32
0 0
992 992
2 64
0 0
960 960
2 128
0 0
896 896
2 256
0 768
768 0
2 512
0 0
512 512

output:

3669

result:

ok single line: '3669'

Test #25:

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

input:

5
5 14740
0 98138440
83236395 98138440
83236396 35898835
83236397 98138440
100000000 98138440
5 18569
0 69878160
42264949 69878160
42264950 68129173
42264951 69878160
100000000 69878160
5 63770
0 65429428
25122042 65429428
25122043 24329432
25122044 65429428
100000000 65429428
5 92572
0 96131514
801...

output:

234464013

result:

ok single line: '234464013'

Test #26:

score: 0
Accepted
time: 966ms
memory: 489844kb

input:

11
5 89
0 84080533
74506841 84080533
74506842 83055856
74506843 84080533
100000000 84080533
5 18029
0 68815953
58287635 68815953
58287636 31497588
58287637 68815953
100000000 68815953
5 7715
0 79502447
7136910 79502447
7136911 13979205
7136912 79502447
100000000 79502447
5 11560
0 58769677
67015775 ...

output:

440961880

result:

ok single line: '440961880'

Test #27:

score: 0
Accepted
time: 903ms
memory: 482820kb

input:

11
5 2698
0 63263164
66665684 63263164
66665685 12537879
66665686 63263164
100000000 63263164
5 9253
0 70064791
71124688 70064791
71124689 12447768
71124690 70064791
100000000 70064791
5 9665
0 43423649
7917397 43423649
7917398 38665078
7917399 43423649
100000000 43423649
5 5215
0 82395135
51019869 ...

output:

359536961

result:

ok single line: '359536961'

Test #28:

score: 0
Accepted
time: 903ms
memory: 488140kb

input:

11
5 1287
0 99700224
43078236 99700224
43078237 32239297
43078238 99700224
100000000 99700224
5 646
0 84365409
92891364 84365409
92891365 83498178
92891366 84365409
100000000 84365409
5 1078
0 96232878
54897379 96232878
54897380 5160197
54897381 96232878
100000000 96232878
5 2004
0 89863504
10033003...

output:

431514624

result:

ok single line: '431514624'

Test #29:

score: 0
Accepted
time: 938ms
memory: 488672kb

input:

11
5 1857
0 10567270
12172120 10567270
12172121 5059407
12172122 10567270
100000000 10567270
5 2958
0 71107715
44938306 71107715
44938307 53838592
44938308 71107715
100000000 71107715
5 1581
0 22304137
62454662 22304137
62454663 21736631
62454664 22304137
100000000 22304137
5 3027
0 29690364
1835435...

output:

327642379

result:

ok single line: '327642379'

Test #30:

score: 0
Accepted
time: 51ms
memory: 393828kb

input:

2
42 405378
36496 5015
43771 979865
147119 8937661
159331 3039265
172427 5121529
192386 5460832
228141 6497727
243862 3935204
265484 0
269472 3130580
300411 1057667
304392 6065765
312785 8399019
379235 4810719
398643 2637023
404627 4869055
410171 2158039
411974 7823065
433397 2788660
443308 3175189
...

output:

1804577

result:

ok single line: '1804577'

Test #31:

score: 0
Accepted
time: 49ms
memory: 393828kb

input:

3
22 317500
255 7210390
8996 9491791
52506 4575161
93039 4250897
110938 2496795
127210 641787
192847 9043323
200707 625263
222630 4374096
252684 1158318
322292 2550478
354299 117946
392964 8237596
397040 0
453812 7210044
478158 7283082
708482 7283082
712198 8628274
771803 5886444
791054 6964500
8370...

output:

1057822

result:

ok single line: '1057822'

Test #32:

score: 0
Accepted
time: 59ms
memory: 393808kb

input:

4
13 107993
21446 2034716
117649 7229678
141188 5064090
268063 7728465
345299 6260981
491051 4074701
590292 7250413
821431 7943830
830513 6754088
903927 0
941793 5755632
941876 8147194
986049 4039105
9 95854
321155 5938108
396413 5561818
421102 5907464
470068 6152294
552962 3997050
576778 3997050
58...

output:

1121404

result:

ok single line: '1121404'

Test #33:

score: 0
Accepted
time: 56ms
memory: 394684kb

input:

5
2 225905
456408 3650768
539380 0
16 104849
40 7389926
471 1487381
100932 8620112
177348 1437008
431414 8042724
467448 4367256
487678 7806356
573358 5492996
589670 3910732
676057 9439500
730307 0
772102 1546415
775933 6304517
876605 1774277
910140 8783092
988999 2632090
23 26630
22225 6838610
49369...

output:

1525048

result:

ok single line: '1525048'

Test #34:

score: 0
Accepted
time: 44ms
memory: 394780kb

input:

6
15 49968
66893 5100254
417974 6504578
430686 6491866
458738 9128754
475590 9583758
531009 8586216
558233 1480752
561586 5524470
614296 1465800
684096 0
737656 5302440
763835 6271063
766533 208657
909458 6497357
970436 9363323
4 164622
93905 0
691830 5979250
806660 4027140
905184 4027140
5 109903
6...

output:

1769547

result:

ok single line: '1769547'

Test #35:

score: 0
Accepted
time: 74ms
memory: 395896kb

input:

7
5 74346
105005 1819846
252818 3002350
349668 0
487807 1381390
740821 2140432
8 152699
231162 5211097
248085 1961881
687966 5041048
799319 2479929
852393 3276039
857002 1796550
918952 0
999068 3925684
7 50811
293759 4444932
445835 5661540
458615 0
491668 8263250
579614 4745410
810087 9354870
940735...

output:

0

result:

ok single line: '0'

Test #36:

score: 0
Accepted
time: 93ms
memory: 399588kb

input:

8
1 37469
534670 0
10 35922
71851 0
100528 7914852
243973 5189397
296761 8198313
356888 682438
449022 1972314
607047 1498239
828831 832887
886215 5595759
986874 1166763
15 35368
4624 7893274
86286 6015048
123626 3251888
182560 4312700
406012 7441028
510197 7128473
568501 4329881
579765 2933145
60087...

output:

3443255

result:

ok single line: '3443255'

Test #37:

score: 0
Accepted
time: 217ms
memory: 410320kb

input:

9
6 40106
63839 4654148
172075 0
176476 3842073
274802 3547095
804770 3547095
959281 2156496
6 65481
150979 0
437256 0
501270 2176476
540662 1428028
624793 5129792
747239 3782886
2 107202
658940 0
752832 4319032
7 54836
373459 1390847
373970 4678110
479040 2156430
558823 6704061
745570 1661892
88406...

output:

1318930

result:

ok single line: '1318930'

Test #38:

score: 0
Accepted
time: 601ms
memory: 440092kb

input:

10
4 34244
80506 0
342904 5247960
890989 1959450
904247 2715156
2 62598
21700 0
768989 4483734
4 92371
732330 0
891383 6044014
931022 6400765
985380 4933099
1 110905
482882 0
3 65297
173067 3204616
264991 2285376
645887 0
20 104541
62453 794911
75744 7533448
208150 3428862
254887 6420030
260302 4865...

output:

4873647

result:

ok single line: '4873647'

Test #39:

score: 0
Accepted
time: 1393ms
memory: 499340kb

input:

11
1 60894
282075 0
8 71802
168015 6608472
336025 6944492
488316 3441799
546304 8544743
777243 0
849821 9217406
906124 321532
944011 5360503
7 21308
14119 100257
197219 1198857
306206 0
461150 464832
578791 935396
679071 5046876
933316 5301121
3 21604
72773 1209266
174162 6684272
412886 0
4 77207
72...

output:

2362383

result:

ok single line: '2362383'

Test #40:

score: 0
Accepted
time: 1621ms
memory: 509868kb

input:

11
9 80441
229094 1815190
243702 383606
282897 4616666
476936 1512042
824937 2904046
831273 3062446
889055 0
915728 1200285
981607 1661438
2 6925
126477 5334102
719155 0
2 20926
109365 2822724
815046 0
1 86930
353711 0
4 39324
395570 2680881
465734 5136621
514293 2611553
887372 0
1 93906
141343 0
12...

output:

437384

result:

ok single line: '437384'

Test #41:

score: 0
Accepted
time: 1825ms
memory: 525680kb

input:

11
3 2189
226125 2724304
263682 5203066
500185 0
9 75462
59229 0
175448 8135330
302615 505310
377749 4111742
574326 6470666
779631 6265361
809608 1978650
884965 2054007
916738 7042368
1 54436
187776 0
2 60806
193768 1106046
255215 0
2 95803
446060 2456796
650793 0
6 32220
183606 5897382
328639 48821...

output:

1264246

result:

ok single line: '1264246'

Test #42:

score: 0
Accepted
time: 1839ms
memory: 526028kb

input:

11
16 13518
14691 3212018
32090 5804469
32348 7968057
101948 4627257
172283 758832
231131 7232112
331577 0
389069 2759616
434782 2668190
461414 1363222
501999 4731777
561394 8117292
563959 5970387
712047 2268187
739981 759751
894146 451421
4 35482
174131 1161612
644927 1161612
660413 3608400
732581 ...

output:

3577366

result:

ok single line: '3577366'

Test #43:

score: 0
Accepted
time: 1858ms
memory: 525628kb

input:

11
3 74397
358466 0
895267 3220806
935675 7706094
5 84731
83713 7031280
250834 7031280
719586 0
867865 7117392
963092 9593294
5 37785
363491 3763425
384143 5518845
574448 0
844289 5396820
893664 4063695
4 14255
199650 4573700
291124 0
872485 0
891044 798037
2 3523
667765 955206
804223 0
10 33218
669...

output:

2358457

result:

ok single line: '2358457'

Test #44:

score: 0
Accepted
time: 58ms
memory: 393784kb

input:

3
3 50
300 2500
350 0
400 3000
2 120
380 0
400 2400
4 160
0 800
400 0
450 100
950 4600

output:

1460

result:

ok single line: '1460'

Test #45:

score: 0
Accepted
time: 52ms
memory: 393788kb

input:

4
2 160
384 0
1000 2464
3 280
0 2646
441 0
1000 2795
1 160
544 0
2 240
720 0
1220 2000

output:

2022

result:

ok single line: '2022'

Test #46:

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

input:

7
3 92
49885584 99999584
50000000 0
50114416 99999584
3 8
49780702 99999888
50000000 0
50219298 99999888
3 25
49741603 99999639
50000000 0
50258397 99999639
3 16
49824869 99999801
50000000 0
50175131 99999801
3 92
49774267 99999719
50000000 0
50225733 99999719
3 64
49866311 99999372
50000000 0
50133...

output:

164019

result:

ok single line: '164019'

Test #47:

score: 0
Accepted
time: 76ms
memory: 396164kb

input:

8
3 988
48214286 99999984
50000000 0
51785714 99999984
3 433
47142858 99999970
50000000 0
52857142 99999970
3 703
48936171 99999926
50000000 0
51063829 99999926
3 268
41666667 99999996
50000000 0
58333333 99999996
3 709
44444445 99999990
50000000 0
55555555 99999990
3 202
46875000 100000000
50000000...

output:

193734

result:

ok single line: '193734'

Test #48:

score: 0
Accepted
time: 792ms
memory: 459604kb

input:

11
3 9746
48734178 99999938
50000000 0
51265822 99999938
3 9782
46875000 100000000
50000000 0
53125000 100000000
3 3079
47560976 99999984
50000000 0
52439024 99999984
3 8855
48958334 99999936
50000000 0
51041666 99999936
3 371
47619048 99999984
50000000 0
52380952 99999984
3 9581
48611112 99999936
5...

output:

6278681

result:

ok single line: '6278681'

Test #49:

score: 0
Accepted
time: 536ms
memory: 449588kb

input:

11
3 233
45238096 99999984
50000000 0
54761904 99999984
3 41
49615385 99999900
50000000 0
50384615 99999900
3 701
47500000 100000000
50000000 0
52500000 100000000
3 69
0 50000000
50000000 0
100000000 50000000
3 2
49803922 99999780
50000000 0
50196078 99999780
3 2
35714286 99999998
50000000 0
6428571...

output:

109904

result:

ok single line: '109904'

Test #50:

score: 0
Accepted
time: 535ms
memory: 449904kb

input:

11
3 2911
49989581 99991143
50000000 0
50010419 99991143
3 159
16666667 99999999
50000000 0
83333333 99999999
3 54
49989553 99998684
50000000 0
50010447 99998684
3 284
40000000 100000000
50000000 0
60000000 100000000
3 1640
0 50000000
50000000 0
100000000 50000000
3 24
37500000 100000000
50000000 0
...

output:

526775

result:

ok single line: '526775'

Test #51:

score: 0
Accepted
time: 48ms
memory: 394360kb

input:

4
7 258218
88567 9076254
270732 8347594
340687 2821149
351496 0
566902 6892992
885992 8807532
950459 9258801
19 103570
49338 8020792
203951 6629275
215620 6325881
261896 5122705
273438 3668413
312171 2506423
330415 1940859
336983 1612459
383069 828997
446838 0
559005 1121670
562333 1787270
577947 19...

output:

8523653

result:

ok single line: '8523653'

Test #52:

score: 0
Accepted
time: 122ms
memory: 399840kb

input:

8
9 6592
125286 8342972
368260 6156206
669375 3145056
704671 1874400
779647 0
833748 2650949
840186 5007257
880346 7095577
949664 8343301
3 70532
653054 4976424
722171 0
932295 5253100
14 36713
239113 8763702
244560 8529481
280033 5620695
317799 4034523
349715 3236623
384105 726153
467250 393573
470...

output:

3193734

result:

ok single line: '3193734'

Test #53:

score: 0
Accepted
time: 1735ms
memory: 520436kb

input:

11
1 61363
204007 0
12 72894
123707 7727775
155102 6566160
239913 4700318
275948 3907548
439049 645528
477910 334640
519740 0
525339 397529
531928 3573427
761903 4033377
847665 5491331
997670 7291391
3 12159
152229 400025
552254 0
675174 5285560
2 99177
310846 7925587
777057 0
5 58657
20770 3562020
...

output:

2194927

result:

ok single line: '2194927'

Test #54:

score: 0
Accepted
time: 1851ms
memory: 528472kb

input:

11
11 98787
185550 8578060
343530 5418460
449626 2872156
481944 2096524
484491 191368
675859 0
856808 1628541
890984 2243709
914971 3371098
944924 6156727
984363 9154091
7 94400
61848 8729837
101174 943289
345157 699306
461708 0
516639 823965
823534 6961865
950068 8986409
4 25929
218655 6277798
7022...

output:

6167794

result:

ok single line: '6167794'

Test #55:

score: 0
Accepted
time: 1032ms
memory: 492280kb

input:

11
6 4109
1000000 0
1997861 997861
1997869 293
1997877 997877
2000000 1000000
3000000 0
6 1615
1000000 0
2000000 1000000
2004389 995611
2004391 121
2004393 995607
3000000 0
2 100000
2900001 0
2950001 0
6 2926
1000000 0
2000000 1000000
2005999 994001
2006006 666
2006013 993987
3000000 0
6 2413
100000...

output:

2659

result:

ok single line: '2659'

Test #56:

score: 0
Accepted
time: 988ms
memory: 491792kb

input:

11
6 74
1000000 0
2000000 1000000
2026182 973818
2026185 147
2026188 973812
3000000 0
2 100000
2900001 0
2950001 0
6 541
1000000 0
2000000 1000000
2017121 982879
2017128 219
2017135 982865
3000000 0
6 3327
1000000 0
2000000 1000000
2026252 973748
2026259 384
2026266 973734
3000000 0
6 2557
1000000 0...

output:

3227

result:

ok single line: '3227'

Test #57:

score: 0
Accepted
time: 917ms
memory: 485836kb

input:

11
2 100000
950000 0
1000000 0
6 1122
1000000 0
2000000 1000000
2025087 974913
2025088 4
2025089 974911
3000000 0
6 1943
1000000 0
2000000 1000000
2026209 973791
2026210 2
2026211 973789
3000000 0
6 4317
1000000 0
2000000 1000000
2031670 968330
2031671 7
2031672 968328
3000000 0
6 3518
1000000 0
200...

output:

58

result:

ok single line: '58'

Test #58:

score: 0
Accepted
time: 930ms
memory: 486248kb

input:

11
2 100000
950000 0
1000000 0
6 4967
1000000 0
2000000 1000000
2020464 979536
2020465 0
2020466 979534
3000000 0
6 3218
1000000 0
2000000 1000000
2014971 985029
2014972 6
2014973 985027
3000000 0
6 431
1000000 0
2000000 1000000
2020033 979967
2020034 2
2020035 979965
3000000 0
6 4504
1000000 0
2000...

output:

52

result:

ok single line: '52'

Test #59:

score: 0
Accepted
time: 915ms
memory: 486588kb

input:

11
6 4100
1000000 0
5000000 4000000
5040541 3959459
5040542 84
5040543 3959457
9000000 0
6 4393
1000000 0
5000000 4000000
5035139 3964861
5035140 84
5035141 3964859
9000000 0
6 364
1000000 0
5000000 4000000
5039532 3960468
5039533 91
5039534 3960466
9000000 0
6 3286
1000000 0
5000000 4000000
5023021...

output:

579

result:

ok single line: '579'

Test #60:

score: 0
Accepted
time: 927ms
memory: 484132kb

input:

11
6 4561
1000000 0
5000000 4000000
5015514 3984486
5015515 51
5015516 3984484
9000000 0
6 1579
1000000 0
5000000 4000000
5023659 3976341
5023660 27
5023661 3976339
9000000 0
2 100000
8900001 0
8950001 0
6 3321
1000000 0
5000000 4000000
5003952 3996048
5003953 13
5003954 3996046
9000000 0
6 3322
100...

output:

310

result:

ok single line: '310'

Test #61:

score: 0
Accepted
time: 931ms
memory: 486536kb

input:

11
6 3586
1000000 0
4992653 3992653
4992654 35
4992655 3992655
5000000 4000000
9000000 0
6 548
1000000 0
4997979 3997979
4997980 88
4997981 3997981
5000000 4000000
9000000 0
6 1740
1000000 0
4996239 3996239
4996240 33
4996241 3996241
5000000 4000000
9000000 0
6 4816
1000000 0
4986484 3986484
4986485...

output:

435

result:

ok single line: '435'

Test #62:

score: 0
Accepted
time: 916ms
memory: 486432kb

input:

11
2 100000
950000 0
1000000 0
2 100000
8900001 0
8950001 0
6 3197
1000000 0
5000000 4000000
5032815 3967185
5032816 71
5032817 3967183
9000000 0
6 4440
1000000 0
5000000 4000000
5046826 3953174
5046827 84
5046828 3953172
9000000 0
6 3828
1000000 0
5000000 4000000
5042946 3957054
5042947 53
5042948 ...

output:

664

result:

ok single line: '664'

Test #63:

score: 0
Accepted
time: 913ms
memory: 486192kb

input:

11
2 100000
950000 0
1000000 0
6 1395
1000000 0
5000000 4000000
5021175 3978825
5021176 75
5021177 3978823
9000000 0
6 3208
1000000 0
5000000 4000000
5012684 3987316
5012685 13
5012686 3987314
9000000 0
6 352
1000000 0
5000000 4000000
5027132 3972868
5027133 33
5027134 3972866
9000000 0
6 3817
10000...

output:

376

result:

ok single line: '376'