QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#449798#71. Cake 3egypt_ioi2024_0524 44ms18112kbC++173.3kb2024-06-21 17:24:432024-06-21 17:24:44

Details

Tip: Click on the bar to expand more detailed information

Subtask #1:

score: 5
Accepted

Test #1:

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

input:

100 32
671208774 266481733
115497791 342597239
326245300 76223942
528973483 754205900
437996819 995535247
100582194 42402057
771100621 351934207
89058009 81951602
768935397 186435060
842907845 376386254
187943947 59424920
997369107 493642356
455078419 68850493
542835555 938351581
970171972 611243076...

output:

25580474644

result:

ok single line: '25580474644'

Test #2:

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

input:

96 26
654901552 458347153
165510759 938829925
195217130 507375330
505924632 413472221
654752848 711653336
843934470 721570198
773665886 401710037
234904469 980379861
955790468 908963841
767941919 649831102
551860594 482287589
445315312 465411688
121261567 38031091
85608696 831434175
898543690 533481...

output:

20912597347

result:

ok single line: '20912597347'

Test #3:

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

input:

97 50
601727246 586947184
629061466 495053188
908476392 789027930
127214423 866336725
518731382 132785533
113489768 827723755
985313205 850125600
651615014 585565934
7844301 974793551
821451342 503266415
191392244 172018292
811053096 980886405
414007158 116164410
749815864 858185057
809840877 654635...

output:

35572528711

result:

ok single line: '35572528711'

Test #4:

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

input:

95 53
149550762 262774006
70645562 988470529
951317142 587455395
640797744 881023050
152099375 109591790
42073955 240106850
787394186 32306392
690229700 154829125
612427906 799230609
529294971 846139787
399369072 840851479
258683206 624167919
933584741 989196725
928112368 809131208
742906726 7228213...

output:

38104623964

result:

ok single line: '38104623964'

Test #5:

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

input:

95 67
219655106 209971230
684228500 55963835
376681839 957451928
44063570 464399636
244459351 255445846
926539875 699539831
624720901 149661354
268068448 124041530
391618918 196971593
259894666 522352998
72651673 750483217
418558834 288939175
987660441 756241680
290013706 540390088
672554190 1595528...

output:

42726885227

result:

ok single line: '42726885227'

Test #6:

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

input:

98 83
144189007 599184430
955720138 430137031
46813950 337012077
284624496 923370172
585878255 277696686
458874123 25220195
65996741 918738892
536999214 420249860
124871436 785740035
524616035 321557657
377122912 363899088
800060966 799482628
704695498 739563311
385588901 543586072
594428502 6483895...

output:

47720376527

result:

ok single line: '47720376527'

Test #7:

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

input:

96 38
37921502 265183642
30462271 269145614
51895518 29824956
44764507 681512686
47724467 815499441
6427327 591731270
46504734 436644698
2223048 132007665
40380520 511674250
43917077 653531209
17511337 975498424
1931641 115779401
16884852 128795730
14731353 429591965
5850509 790146440
15255306 77070...

output:

399264493

result:

ok single line: '399264493'

Test #8:

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

input:

96 25
57401007 493943697
29527957 714663679
29545307 647011203
41025179 566266756
58441740 117870293
27412280 422916085
33052858 310233747
9411800 715114198
15661682 773129023
49930623 903197292
4733526 653650922
36089642 500031319
1389486 444206729
19886177 397683562
2903725 764846753
84795 2145521...

output:

719815801

result:

ok single line: '719815801'

Test #9:

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

input:

99 21
59657805 652963568
80731103 249217474
67765017 136600735
30669693 235796790
38336275 333697289
9339946 754166690
69051138 182211402
93041255 259466527
71372493 445676674
67165121 840321934
33766102 430254036
18248715 148433501
38354832 282537749
64069877 131281615
39361263 592884334
18160924 9...

output:

888797889

result:

ok single line: '888797889'

Test #10:

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

input:

93 28
19252348 834865987
35189109 821648351
47848765 934801179
33900007 907328375
45481720 478428955
4292036 880931858
36991135 956842947
49181931 583677473
36889879 714660270
20737289 866325358
65602596 635999283
70856516 855441876
54559432 319956854
47217522 132918942
55127890 62037126
53412038 84...

output:

597761343

result:

ok single line: '597761343'

Test #11:

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

input:

92 18
17034692 311412535
75067760 700238328
85371763 32662981
90417142 594066624
34625146 420051930
46026136 298353430
71930456 679253686
94901612 553915166
10855990 339449028
10327620 444733804
51133091 802733614
95838938 276886845
22327317 53898064
29910663 881733161
74599342 280465633
8898777 221...

output:

963264484

result:

ok single line: '963264484'

Test #12:

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

input:

96 46
3613091 48226953
17333738 315657491
33499557 905024
21585984 973060800
42148202 275277748
25892629 489251559
31604703 888333915
13970358 799610574
33246317 54304803
7114447 61375639
5669373 697687696
1575366 350398758
16667098 747366614
7839377 799378407
18868553 430864652
41883674 476142622
1...

output:

217389025

result:

ok single line: '217389025'

Test #13:

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

input:

100 45
43924230 212784715
43573365 390630448
36356410 302155896
8834549 369231487
23914662 209393152
8961292 339488011
11770598 98213199
41391432 553642288
33929359 654885451
15834215 243511760
32889505 785116193
40157572 806063390
41729010 657312356
24502770 98898149
33168308 379445567
25788178 737...

output:

284124804

result:

ok single line: '284124804'

Test #14:

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

input:

94 44
18278964 59117371
1121774 674793869
44776633 866596597
3672456 43798662
18327992 258671822
26820827 436747027
10741961 269663794
4454544 235521073
2959148 111403543
17994812 431349737
44808537 631076314
1072950 366206930
37219572 987766907
33824148 367550034
18542970 307178475
1386716 33940913...

output:

308368925

result:

ok single line: '308368925'

Test #15:

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

input:

96 41
36332583 8569405
20284590 704164692
26169208 400229170
32850340 485895095
44691003 149746532
5684161 537586304
3545889 108210000
26693523 480026681
38944140 61394964
34125662 576589094
10604727 179814783
12192083 364751818
37385170 791694556
20134304 90024835
19149660 168146967
11032310 183184...

output:

344295172

result:

ok single line: '344295172'

Test #16:

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

input:

90 38
8869730 76738045
32276119 757676479
5091410 369590827
35491028 689930909
20025995 127998287
49111097 975894312
16776797 690236150
14603906 430533164
6638017 768678637
583367 277491929
43583227 197845857
19225748 735413656
39437324 641580882
43275662 785441666
50322818 734853329
35990613 997504...

output:

418654054

result:

ok single line: '418654054'

Test #17:

score: 0
Accepted
time: 1ms
memory: 15904kb

input:

97 63
17888788 608002691
16142900 885752870
1364666 365868015
4878248 624150124
18576418 704242346
17020617 375882628
21749764 987510302
23736619 444353886
19722113 954714013
9275566 579405076
31641382 557924314
28779133 996785377
24059182 892591765
26116965 249236656
15958669 36018002
12783153 4066...

output:

-324021706

result:

ok single line: '-324021706'

Test #18:

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

input:

100 71
14246084 541505816
9994802 994431615
1482902 185840951
26468202 241171629
17716658 549877382
25340166 772809756
18151090 18915661
10164740 748716089
12552723 56489026
6069755 574352885
23096929 778200711
24642227 384490457
4716312 797733167
23906409 557004993
197262 5593534
27176008 844798422...

output:

-276543166

result:

ok single line: '-276543166'

Test #19:

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

input:

97 65
4386932 310542657
23651846 24902512
17872222 432076283
12688150 320458048
13294064 783055998
24489246 667018801
26933633 303216574
20987206 894751368
6946734 18906053
4725483 816674619
11278516 963601520
1714355 137847174
16817734 79470468
7807193 972225264
15832623 861238054
11363869 91575309...

output:

-174786613

result:

ok single line: '-174786613'

Test #20:

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

input:

100 76
19363945 999230932
6565531 340746079
17098814 481571520
15063962 562888079
16400153 379641015
22687207 473072780
13205572 315563624
4971425 266006726
25882141 800667318
16425184 781371894
10021910 67574149
19963913 96397646
26310382 585714937
7145348 578506544
4794238 790460340
7285540 645057...

output:

-310560206

result:

ok single line: '-310560206'

Test #21:

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

input:

95 66
12740392 44322988
23072578 479866996
28690034 991246669
23341774 816240165
5356957 510095701
6993836 351625358
16797983 601213241
16864568 335398045
13997193 909507175
27087288 982552754
26886506 169380803
3047418 849902451
1896289 226928494
1306707 244984996
13019901 587922276
11247618 716796...

output:

-28999886

result:

ok single line: '-28999886'

Test #22:

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

input:

94 22
17729830 195028137
17729832 195028150
17729830 195028178
17729832 195028140
17729832 195028118
17729836 195028176
17729835 195028180
17729829 195028198
17729829 195028141
17729835 195028132
17729834 195028115
17729829 195028197
17729829 195028160
17729829 195028137
17729834 195028161
17729836 ...

output:

390056298

result:

ok single line: '390056298'

Test #23:

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

input:

100 25
15180379 189754751
15180379 189754772
15180385 189754771
15180385 189754771
15180379 189754773
15180385 189754781
15180383 189754741
15180381 189754720
15180381 189754791
15180385 189754788
15180381 189754771
15180384 189754718
15180379 189754738
15180384 189754779
15180386 189754788
15180379...

output:

379509524

result:

ok single line: '379509524'

Test #24:

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

input:

92 37
6917252 127969112
6917251 127969122
6917248 127969158
6917252 127969121
6917249 127969098
6917249 127969063
6917252 127969064
6917251 127969071
6917250 127969096
6917249 127969144
6917250 127969080
6917251 127969129
6917248 127969134
6917248 127969134
6917251 127969112
6917248 127969112
691724...

output:

255938190

result:

ok single line: '255938190'

Test #25:

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

input:

100 42
8947720 187902126
8947719 187902145
8947719 187902174
8947722 187902111
8947720 187902164
8947722 187902148
8947723 187902141
8947721 187902138
8947719 187902143
8947720 187902154
8947722 187902170
8947721 187902162
8947721 187902079
8947719 187902111
8947719 187902094
8947721 187902129
89477...

output:

375804228

result:

ok single line: '375804228'

Test #26:

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

input:

93 42
5450766 114466000
5450765 114466073
5450765 114466092
5450763 114466006
5450765 114466065
5450764 114466073
5450764 114466016
5450764 114466092
5450765 114466060
5450764 114466069
5450765 114466002
5450763 114466020
5450766 114466040
5450766 114466051
5450767 114466080
5450763 114466002
545076...

output:

228932048

result:

ok single line: '228932048'

Test #27:

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

input:

96 42
6481674 136115141
6481674 136115143
6481674 136115200
6481677 136115104
6481674 136115173
6481673 136115198
6481672 136115171
6481674 136115171
6481674 136115198
6481676 136115115
6481674 136115159
6481673 136115179
6481674 136115123
6481674 136115116
6481676 136115173
6481673 136115132
648167...

output:

272230243

result:

ok single line: '272230243'

Test #28:

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

input:

91 35
7078729 127852986
6976330 199120225
7918266 101649053
9886390 174239569
8680498 181231369
10147698 178133237
6550286 188440017
10998842 176674437
11338474 163404734
9928237 144614674
10813308 119730850
8490207 177630658
7666339 125985790
8842506 161567810
7545945 172836768
7244339 151363289
88...

output:

257081558

result:

ok single line: '257081558'

Test #29:

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

input:

90 22
14286146 154004991
16643150 170148576
14468260 179044873
11596207 178516095
16788739 193967231
12440449 168662547
14797798 174924503
11195707 136243477
12044575 129447384
9432188 100337673
17144187 104480992
11072522 110866789
13775415 155063112
17184094 100533600
12446867 176287486
11478110 1...

output:

281555721

result:

ok single line: '281555721'

Test #30:

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

input:

100 29
9531137 158342198
10547622 178461072
11919343 157206544
9587137 162255834
8112842 138118096
7650771 117964254
7497546 137803698
9171970 168188367
13214044 159075986
13332882 177627982
13251626 191514575
8195217 135984932
10266960 188825369
8135290 153570161
12177239 158413233
10303999 1774730...

output:

281996167

result:

ok single line: '281996167'

Test #31:

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

input:

95 49
5324636 179288160
5409006 130652095
6846457 160463725
4338673 104140314
5324593 179288197
5322187 185899122
6179346 148685923
7003579 184887841
6834578 172632756
5094797 186909136
6317848 135586449
5356447 183268322
5803751 184007780
6846531 160463782
5414770 141547042
5398293 191301500
631790...

output:

231995752

result:

ok single line: '231995752'

Test #32:

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

input:

92 47
8061822 136846833
6642446 166843406
4261250 160921666
4489059 151015120
4601597 135229263
4824447 154004434
6525893 153559993
7417252 146176344
6153011 191410359
4464747 159984984
8343467 111098444
4504883 137911904
5927740 185005343
8351538 181377851
4489006 151015089
4824407 154004364
842467...

output:

218822483

result:

ok single line: '218822483'

Test #33:

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

input:

92 39
9027696 183506931
5961251 142108073
7720700 110598847
5648540 196652092
6501150 189219306
5746162 187475921
8410833 143213540
9004401 141124014
7671741 174085402
9961580 141717536
8226371 157513143
9747707 179135409
9740001 118326279
9281457 126779638
9945648 114139725
9747637 179135416
722782...

output:

274033436

result:

ok single line: '274033436'

Test #34:

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

input:

92 55
1 1
10 490
6 979
2 1468
4 1957
2 2446
6 2935
7 3424
9 3913
3 4402
3 4891
5 5380
1 5869
2 6358
8 6847
1 7336
5 7825
9 8314
1 8803
10 9292
8 9781
1 10270
6 10759
7 11248
4 11737
4 12226
3 12715
5 13204
10 13693
3 14182
8 14671
8 15160
5 15649
2 16138
9 16627
4 17116
2 17605
6 18094
7 18583
10 19...

output:

-52489

result:

ok single line: '-52489'

Test #35:

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

input:

90 27
2 1
5 466
2 931
7 1396
10 1861
10 2326
4 2791
1 3256
10 3721
4 4186
2 4651
4 5116
10 5581
9 6046
5 6511
10 6976
4 7441
6 7906
9 8371
4 8836
10 9301
8 9766
10 10231
2 10696
9 11161
1 11626
5 12091
6 12556
3 13021
7 13486
4 13951
10 14416
8 14881
4 15346
6 15811
5 16276
3 16741
4 17206
10 17671
...

output:

-24008

result:

ok single line: '-24008'

Test #36:

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

input:

96 23
466703636 1
685964430 1
94138746 1
260865796 1
671061690 1
342965956 1
70077955 1
353576592 1
647102711 1
381407841 1
160479125 1
532426710 1
606287881 1
815834411 1
154155710 1
173295822 1
79893082 1
977723022 1
449558013 1
697003683 1
409420108 1
18515297 1
663646483 1
396590913 1
184119427 ...

output:

20219731188

result:

ok single line: '20219731188'

Test #37:

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

input:

100 100
865613444 566253861
658651559 846380264
825752153 192037838
448174355 534315715
739996438 168524064
81511958 137624584
852893078 662698922
719896249 803133529
562555332 7146132
266184989 611936568
885582195 736804493
521264825 67715872
474677299 497782030
224795664 930773965
613758079 961250...

output:

45696374824

result:

ok single line: '45696374824'

Subtask #2:

score: 19
Accepted

Dependency #1:

100%
Accepted

Test #38:

score: 19
Accepted
time: 44ms
memory: 16064kb

input:

1855 501
338527451 578733742
703170142 682868070
16985949 852452962
662029309 680590695
717678423 220285590
961443168 146607690
278716170 683348763
238103085 414255420
332431596 320585514
501489988 647737182
293979999 420745717
402085021 831124117
569170680 735252719
136204202 448222008
296743227 74...

output:

428322190418

result:

ok single line: '428322190418'

Test #39:

score: 0
Accepted
time: 42ms
memory: 15952kb

input:

1964 645
686547414 723477566
963686617 50764327
111556192 186211733
899272728 802880430
153008970 843446090
930194466 133178740
575628133 334745573
286939234 115658401
857618618 677208982
204399846 852814117
726963800 48889210
75520118 940965095
216538172 226333728
37484464 257822964
176963532 40551...

output:

534497281344

result:

ok single line: '534497281344'

Test #40:

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

input:

1903 1081
136321384 177045011
796640569 963025423
624771025 56754376
88434181 928784397
570746021 944498906
881777377 676053540
974447206 743357317
185663511 568296411
165819206 475544857
27684915 536242166
937720091 887394471
174150162 908997153
844162016 650974548
877504388 964018292
216747329 982...

output:

780675823641

result:

ok single line: '780675823641'

Test #41:

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

input:

1844 934
674645872 767487197
149534365 477619004
842528138 909954194
896404992 296469563
599914334 163247581
344198027 548638994
831681272 389074144
433448521 853794142
571381395 791261992
329908759 34258628
784706958 622618804
7318097 200476931
718785037 616606604
790881514 567196599
658959476 9328...

output:

709878567556

result:

ok single line: '709878567556'

Test #42:

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

input:

1918 1422
296006954 746513821
505229061 478343420
816970753 985873192
381104413 782261712
471363589 120004333
796344005 697597569
425984727 488945205
704137911 391352166
250134053 384691207
269081918 129598416
283118797 880704946
981186898 343618893
310003762 491065265
616486801 353515771
27394709 3...

output:

892524947093

result:

ok single line: '892524947093'

Test #43:

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

input:

1800 1134
201231552 596778623
284377510 620146533
765426627 995350461
311396636 132073344
880523480 146156505
688353895 166547491
318553146 315219568
118852858 301065346
345751180 869953283
758437960 32184247
156204811 456017850
78106750 835201682
765369391 485175572
799617556 709947652
266786224 27...

output:

776535582089

result:

ok single line: '776535582089'

Test #44:

score: 0
Accepted
time: 4ms
memory: 16064kb

input:

1830 634
2969316 607026352
2691383 575132298
1571535 231920412
3029351 600807014
1051982 828408912
2542367 664018902
89397 867236510
2233743 202011042
1848214 156128926
1223237 490370593
2427517 744764983
438588 941753187
1583445 138250039
1795639 329784680
1308452 416272921
2639047 591878612
201102...

output:

448545322

result:

ok single line: '448545322'

Test #45:

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

input:

1942 637
899972 198218167
2954931 201040683
800277 506846680
788344 690139558
1034835 423416648
1471517 979809400
66475 822476314
1069083 393746162
3126436 890639168
2308309 880870004
1684513 595591425
2478896 523422225
172187 454207131
3018584 984485331
272550 53856343
1806418 808004788
1570652 815...

output:

421393038

result:

ok single line: '421393038'

Test #46:

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

input:

1991 622
1903253 705726893
954828 331797251
2651308 622083500
2535210 195911148
1942702 739333619
350283 170006790
814791 61191131
1973917 596558679
2314418 241248273
765446 663798637
1866018 560922246
162140 957633422
2313191 156143413
21613 854793063
2575225 4115342
2065086 208644885
1360123 97682...

output:

444591527

result:

ok single line: '444591527'

Test #47:

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

input:

1912 442
2262478 241661936
264240 661230245
1126672 416953596
3300016 44487587
3571356 525933857
4183756 458453415
4384495 254439161
401990 83228929
3501343 225825402
4126554 629367514
1275055 487124008
1048648 682937638
1096229 137908092
1403342 765982390
1371649 518348469
2644238 21495069
1335266 ...

output:

716905677

result:

ok single line: '716905677'

Test #48:

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

input:

1833 507
1716100 276726491
2842064 404977692
2465364 988118546
2801761 463229032
3934006 217746157
2638107 267104306
2647025 291694218
2863162 880333544
3074441 93924055
2508411 470199917
2033640 478044618
2085914 484761991
1598564 357810034
316812 613587379
1411262 668769397
1576780 489383020
11588...

output:

559444531

result:

ok single line: '559444531'

Test #49:

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

input:

1972 910
1558653 582887455
1375783 45782678
1419915 146261052
2154961 541723768
1163354 809755510
274964 868972503
1457043 912833641
435195 551818443
1850579 930020476
1385588 258592426
704381 956098142
1260829 464081671
1885459 950287673
873543 229078971
1690252 526781928
1332792 61844443
793950 46...

output:

117411795

result:

ok single line: '117411795'

Test #50:

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

input:

1946 851
324958 894415142
268099 533924488
529482 968042988
2211082 650722507
915457 699295068
1030661 942796135
686132 549443206
1365252 167776082
1495108 54948530
1971055 354910777
300621 195485190
1476709 26176346
1184396 210571019
543104 631102069
108498 728967639
862062 947346391
2088651 426838...

output:

164245809

result:

ok single line: '164245809'

Test #51:

score: 0
Accepted
time: 4ms
memory: 15944kb

input:

1935 899
1317250 689197885
134170 103924595
410102 306568671
240139 386035422
122789 617529011
2130665 684653704
1551610 466891902
1790198 541299784
360207 693529049
2020065 138167576
2004911 584765518
926153 345541552
995030 290242472
1119514 11681818
1281703 351926830
1934545 442318726
1834881 634...

output:

129847123

result:

ok single line: '129847123'

Test #52:

score: 0
Accepted
time: 4ms
memory: 18044kb

input:

1876 924
175745 244975794
1992757 130008836
1683484 19788024
1769247 567069963
1064826 178024105
1764315 648257650
2073501 837737536
358805 645348058
905166 809976952
479969 684636851
895943 31756483
1874702 625567337
2053669 517660013
1115605 195288329
2044918 383788081
788012 99654975
960117 75588...

output:

86497670

result:

ok single line: '86497670'

Test #53:

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

input:

1925 932
1392710 874745405
1482884 100318581
808325 622210203
424027 292889774
1462577 792296668
1900271 496010388
1164988 200804619
1654518 450232469
1188794 286412106
942192 333833477
1793162 981198171
897912 799890279
672832 286793563
25898 100715813
575777 184481843
961047 857529038
1247683 7947...

output:

112093854

result:

ok single line: '112093854'

Test #54:

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

input:

1962 1270
828306 688821211
409821 195395885
1234858 676847824
808367 351243591
288237 949222945
703558 656487532
701931 523190784
427820 498184904
469930 837368612
1390568 422025575
741561 842285962
143438 751039915
1295872 958175543
1037305 889196637
221175 233758439
1442238 675946953
1445805 19429...

output:

-260355185

result:

ok single line: '-260355185'

Test #55:

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

input:

1914 1408
868093 183892432
430527 435253023
745232 312812928
1027253 773788276
1037010 715384122
562801 201300097
1315430 95424837
1103172 102155034
1279909 371391762
737287 804153623
171101 476208378
1162390 634832262
103523 566568237
998347 827020774
545060 651311381
641287 639445678
966545 852911...

output:

-476655281

result:

ok single line: '-476655281'

Test #56:

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

input:

1890 1404
992695 660701853
608018 295587456
1109242 457340151
636938 166544520
31810 670239069
215094 874670003
1375890 30343203
967266 976285185
315206 162288196
532827 436391724
886869 196968670
850668 117501954
867147 588045323
302774 189293185
907667 285723337
1111996 294105106
1111805 920193502...

output:

-446740925

result:

ok single line: '-446740925'

Test #57:

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

input:

1873 1309
85090 875530166
434985 910617529
1451846 97775344
682421 81291523
131437 543572249
1193865 540096854
687963 287234375
1174502 358331717
94821 619447443
723130 896786899
1385117 527465684
321115 52998637
1051098 928729406
1444533 90303708
1079014 495507030
455135 474426380
204310 883744498
...

output:

-353115374

result:

ok single line: '-353115374'

Test #58:

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

input:

1872 1342
362368 77481885
343115 427567054
1302173 997997769
446510 954762782
1347226 352567056
34444 450812477
1063223 519680552
140045 888786129
622484 914585196
1325929 923595857
771725 273776137
652124 929321375
859695 789507500
695958 776625533
1132902 185097965
619453 599112724
1087991 6651240...

output:

-400986453

result:

ok single line: '-400986453'

Test #59:

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

input:

1835 719
292833 105273343
292833 105273357
292833 105273330
292833 105273378
292833 105273296
292833 105273358
292833 105273372
292833 105273346
292833 105273328
292833 105273369
292833 105273376
292833 105273392
292833 105273352
292833 105273300
292833 105273324
292833 105273355
292833 105273393
29...

output:

210546861

result:

ok single line: '210546861'

Test #60:

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

input:

1894 597
599281 178885100
599281 178885116
599281 178885089
599281 178885094
599281 178885079
599281 178885076
599281 178885151
599281 178885169
599281 178885110
599281 178885165
599281 178885095
599281 178885129
599281 178885143
599281 178885144
599280 178885117
599281 178885117
599281 178885169
59...

output:

357770707

result:

ok single line: '357770707'

Test #61:

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

input:

1910 728
442850 161197327
442850 161197288
442850 161197330
442850 161197276
442850 161197305
442850 161197252
442850 161197266
442850 161197248
442850 161197320
442850 161197257
442850 161197267
442850 161197333
442850 161197317
442850 161197275
442850 161197334
442850 161197317
442850 161197327
44...

output:

322394746

result:

ok single line: '322394746'

Test #62:

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

input:

1965 1070
284217 152055620
284217 152055631
284217 152055665
284217 152055704
284217 152055618
284217 152055614
284217 152055649
284217 152055667
284217 152055637
284217 152055623
284217 152055667
284217 152055661
284217 152055644
284217 152055678
284217 152055641
284217 152055641
284217 152055671
2...

output:

304112102

result:

ok single line: '304112102'

Test #63:

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

input:

1984 1080
264337 142741976
264338 142741914
264337 142741932
264337 142741912
264337 142741969
264337 142741944
264338 142741977
264338 142741990
264337 142741964
264337 142741908
264337 142741933
264337 142741965
264337 142741937
264337 142741912
264337 142741965
264338 142741972
264338 142741975
2...

output:

285484186

result:

ok single line: '285484186'

Test #64:

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

input:

1959 932
424605 197865503
424605 197865487
424605 197865557
424605 197865547
424605 197865549
424605 197865565
424605 197865510
424605 197865573
424605 197865476
424605 197865545
424605 197865539
424605 197865521
424605 197865483
424605 197865527
424605 197865550
424605 197865534
424605 197865520
42...

output:

395731784

result:

ok single line: '395731784'

Test #65:

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

input:

1904 528
623266 153157682
396934 125289853
552122 141559905
614352 182137831
626283 139511676
623220 153157691
555571 113491549
543665 158955198
390475 107955672
452618 181690982
554696 107429859
731474 165461342
457794 177484774
740719 194183076
455092 135450708
454838 114642962
595286 149883825
41...

output:

279977239

result:

ok single line: '279977239'

Test #66:

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

input:

1886 636
398199 127140840
433359 110271164
496114 186001837
566769 113675462
345180 152799694
459312 114766539
319129 102024643
614922 196086322
442477 191774184
488886 196195254
450247 125657897
390983 155672876
391873 194294891
450239 125657908
383214 194963218
317072 152315954
518990 118421514
35...

output:

255225170

result:

ok single line: '255225170'

Test #67:

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

input:

1934 497
677107 119135150
687160 195859863
515845 100049512
687199 195859832
461292 192495967
535348 183245951
768846 129205855
776481 110311024
553716 196585178
535280 183245907
747473 102434568
553879 134292180
484379 184662505
769705 180646363
717200 133003751
484371 184662511
407880 152392591
48...

output:

293622716

result:

ok single line: '293622716'

Test #68:

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

input:

1991 831
419605 186006811
346332 134464400
309714 111982925
351814 108295218
279316 136366566
331764 154376816
293902 178773100
370417 117959781
467290 127591317
460552 190636597
331759 154376814
271721 163665147
368542 183706884
470154 123515531
414935 128606450
368536 183706900
351889 108295285
41...

output:

248291304

result:

ok single line: '248291304'

Test #69:

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

input:

1895 865
397230 138651356
357309 191417384
304317 133850645
311714 117495455
283365 160203113
342564 128440999
338389 160126750
442582 127139908
341204 186988953
422518 114511410
294602 133708202
388768 133766585
440082 187421058
306742 185167536
450622 198938467
422558 114511405
351790 117011277
29...

output:

251043368

result:

ok single line: '251043368'

Test #70:

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

input:

1936 843
336648 197631798
246238 103061951
257266 144643819
426433 135148121
283053 196182684
335012 177287118
429234 189416003
463897 195265699
463897 195265710
393462 124202992
363849 199540198
283511 117249169
368565 156028071
456060 175503916
248338 181615832
336555 182722251
293322 144217396
47...

output:

246660794

result:

ok single line: '246660794'

Test #71:

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

input:

1911 413
3 1
5 10537
2 21073
8 31609
2 42145
2 52681
1 63217
5 73753
2 84289
10 94825
4 105361
9 115897
2 126433
10 136969
3 147505
4 158041
5 168577
3 179113
9 189649
7 200185
9 210721
8 221257
3 231793
1 242329
7 252865
2 263401
2 273937
2 284473
8 295009
2 305545
7 316081
7 326617
9 337153
10 347...

output:

-8679289

result:

ok single line: '-8679289'

Test #72:

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

input:

1982 1183
8 1
6 10944
5 21887
9 32830
4 43773
2 54716
2 65659
5 76602
5 87545
5 98488
6 109431
6 120374
6 131317
10 142260
7 153203
3 164146
3 175089
8 186032
6 196975
1 207918
7 218861
6 229804
6 240747
2 251690
4 262633
10 273576
9 284519
10 295462
8 306405
5 317348
8 328291
6 339234
6 350177
6 36...

output:

-25862535

result:

ok single line: '-25862535'

Test #73:

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

input:

1893 554
965216224 1
561924860 1
209493556 1
688911582 1
941907389 1
149224201 1
834808067 1
611896226 1
926611030 1
227238961 1
662922743 1
969673097 1
738968296 1
828034760 1
231387600 1
40187866 1
375158983 1
57423050 1
995076873 1
318755563 1
786086885 1
82655789 1
460279018 1
602367800 1
759775...

output:

470655279525

result:

ok single line: '470655279525'

Test #74:

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

input:

2000 2000
629072683 577857961
845364699 7537138
726536200 654427193
986957660 960915027
329622997 429777148
919912622 749856782
462945831 268399314
621097203 370540692
611438868 251578734
199626595 514547379
938414839 830984249
573354495 770234264
959946128 292709849
333062505 153270061
320702823 40...

output:

985658174474

result:

ok single line: '985658174474'

Subtask #3:

score: 0
Time Limit Exceeded

Dependency #1:

100%
Accepted

Dependency #2:

100%
Accepted

Test #75:

score: 0
Time Limit Exceeded

input:

186309 63889
870114140 55959266
286041175 118431791
832697141 327699683
770814026 875735883
839744128 267497093
169127351 165801123
857896391 977047691
278013870 916411205
598748477 991635138
764637970 366124123
221267468 669697237
409116360 189874150
886395302 919461729
196660688 747934278
71214059...

output:


result: