QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#615893#3124. Art Exhibitionisirazeev100 ✓209ms42200kbC++23793b2024-10-05 20:51:552024-10-05 20:51:56

Judging History

This is the latest submission verdict.

  • [2024-10-05 20:51:56]
  • Judged
  • Verdict: 100
  • Time: 209ms
  • Memory: 42200kb
  • [2024-10-05 20:51:55]
  • Submitted

answer

#include <bits/stdc++.h>

using namespace std;
#define int long long

signed main() {
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr), cout.tie(nullptr);
    int n;
    cin >> n;
    int a[n], b[n], res = 0;
    for (int i = 0; i < n; i++) cin >> a[i] >> b[i];
    vector<int> ord(n);
    iota(ord.begin(), ord.end(), 0);
    sort(ord.begin(), ord.end(), [&](int i, int j) {
        return a[i] < a[j];
    });
    int pref[n];
    for (int i = 0; i < n; i++)
        pref[i] = b[ord[i]] + (i > 0 ? pref[i - 1] : 0);
    set<int> st;
    for (int i = n - 1; i >= 0; i--) {
        st.insert(pref[i] - a[ord[i]]);
        int val = a[ord[i]] - (i > 0 ? pref[i - 1] : 0);
        res = max(res, val + *st.rbegin());
    }
    cout << res;
    return 0;
}

詳細信息

Subtask #1:

score: 10
Accepted

Test #1:

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

input:

16
424039412972844 71773468
424047387770346 26400022
424043879695133 49939269
424045145849769 54390570
424038875910621 34018889
424038655870114 61067485
424045078966990 64251951
424041801243910 78272796
424040606595268 1426227
424044911968214 12358490
424041570364210 32790763
424045322871069 9309659...

output:

93096598

result:

ok single line: '93096598'

Test #2:

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

input:

16
779012152863164 89520884
779007435198057 70146094
779008394157076 63344324
779006348415936 26976600
779008023703393 15978470
779006972603100 51719314
779009370798778 26121183
779004959169091 70329808
779005994351226 15975515
779007777160430 81161
779009977873380 23799142
779005194053926 580987
77...

output:

106997172

result:

ok single line: '106997172'

Test #3:

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

input:

16
750122397452189 65022555
750119150514910 83523570
750120624371650 50217832
750118395752077 16515032
750118980194602 63590213
750120124899283 43197152
750121588508186 82511489
750120503334165 35008787
750121528832405 69094316
750119701380275 36753241
750122379340643 1779115
750119029848186 5374514...

output:

91930024

result:

ok single line: '91930024'

Test #4:

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

input:

16
57386327788012 97669872
57386133068860 68729525
57387811584130 44440185
57387354676457 77444151
57386538560611 38981042
57387725337048 90466110
57386557773593 46265968
57386796121254 8686326
57387685726353 37722674
57388755799064 21561568
57387997403296 66106551
57386063298224 20592558
5738615100...

output:

147747599

result:

ok single line: '147747599'

Test #5:

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

input:

16
366643515544547 5438036
366642924638042 95798183
366643462917058 38883427
366642891242019 30380108
366642838230966 5956182
366643166973193 20897221
366643002680963 60575102
366643054342133 78017261
366643243692413 67937273
366643531843528 61925404
366642846357754 57252113
366643521400364 36110697...

output:

124258198

result:

ok single line: '124258198'

Test #6:

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

input:

16
897866725041299 92935003
897866676617537 1001539
897867058110711 2801088
897867038905670 60003994
897867016194293 84345810
897866709690531 32504551
897866702647555 76241726
897866893696535 22434493
897866713724901 23667166
897866613342943 7488282
897867028749450 99919080
897866879848779 93208237
...

output:

498261064

result:

ok single line: '498261064'

Test #7:

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

input:

16
214638133813735 98651929
214638208043189 4330216
214638173990456 36179823
214638187912369 25819451
214638131560281 27763168
214638157167703 96678717
214638223206553 71256869
214638205597161 29195253
214638129357202 4752331
214638162585972 95783075
214638227534760 29429549
214638164130805 65560211...

output:

774088772

result:

ok single line: '774088772'

Test #8:

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

input:

16
946654230286736 72534786
435085587587528 78364177
28989838769234 88709912
324347027610529 70174658
543314000224768 65898429
971389719097080 49715076
335336213705863 27151426
420021171795002 82367916
26931770236371 41026973
450291765302603 56134962
141025913395631 94562434
132507745268227 16044638...

output:

94562434

result:

ok single line: '94562434'

Test #9:

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

input:

16
363677828997119 32147678
351435327213585 48262435
845837622755104 99154391
435062583374695 58237232
546085955741669 49154917
537971020690648 92065693
345752846904696 3520868
322492955669871 57134213
874723433081847 546159
44709053982881 79847251
486910474613124 42136647
56268639464087 62545089
11...

output:

99154391

result:

ok single line: '99154391'

Test #10:

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

input:

16
272571533838248 95388803
272571533840997 84732049
272571533913345 94400923
272571533607848 50461722
272571534237173 42774906
272571534374598 55746382
272571534453557 61104441
272571533788747 54580574
272571533858814 35275549
272571533843052 32669005
272571534319789 58805605
272571533569466 703582...

output:

798666787

result:

ok single line: '798666787'

Test #11:

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

input:

16
85985069857777 20386479
85985069252941 73477137
85985069290290 41409382
85985069113015 75042541
85985069696279 15859010
85985069492128 89076894
85985069534810 73452082
85985069415767 69100287
85985069302019 79428120
85985069167645 95834998
85985069890350 49270905
85985069064915 22425347
859850700...

output:

998576365

result:

ok single line: '998576365'

Subtask #2:

score: 20
Accepted

Dependency #1:

100%
Accepted

Test #12:

score: 20
Accepted
time: 0ms
memory: 3544kb

input:

300
878737577766523 964724154
878199878311500 323708432
878865777778435 137326139
878089487224461 530775082
878407061094424 121111765
878353642045017 349862595
878531105564581 863339473
878475951573617 250203354
878982997981849 78119225
878032561537204 196849398
878612157257786 508336074
87808516314...

output:

1840120174

result:

ok single line: '1840120174'

Test #13:

score: 20
Accepted
time: 0ms
memory: 3828kb

input:

300
276736844584771 784662046
276842742510701 739400425
277205076073288 758999523
277231097825182 596868924
277082651728087 925227485
277148142221842 23118807
277002979074714 358373076
277006538801084 160478280
276930770902037 477017172
277129253968014 476174874
276493978784736 466194054
27682640572...

output:

1795059370

result:

ok single line: '1795059370'

Test #14:

score: 20
Accepted
time: 0ms
memory: 3580kb

input:

300
294605061944112 737691436
294790790784758 451995439
294541704565272 997022939
294418899620438 454030154
294470428298044 529938163
294295827681815 804225420
294610633924337 410916054
294330399308616 903421495
294796506226159 19902439
294631236997348 411797017
294359349412927 734762359
29472574988...

output:

1709777953

result:

ok single line: '1709777953'

Test #15:

score: 20
Accepted
time: 0ms
memory: 3808kb

input:

300
873063397640915 305950716
872890164780220 402934740
873009711568038 551255059
872966406274681 465150990
873047710825957 673060197
872804353919470 574455543
872935857184494 375937183
872875962936670 999552253
872820498280279 160901764
872972776478838 980450898
872916787885169 333186321
8727523235...

output:

3111552564

result:

ok single line: '3111552564'

Test #16:

score: 20
Accepted
time: 0ms
memory: 3516kb

input:

300
157823420293264 496288238
157833308409505 131292503
157830179713243 286716361
157771371702713 827524549
157799488742792 605012286
157826521055023 565203664
157816991897683 488531912
157800561802469 746680328
157798609869477 675799962
157782096399007 897393402
157756532857280 699100402
1578188042...

output:

47692802363

result:

ok single line: '47692802363'

Test #17:

score: 20
Accepted
time: 0ms
memory: 3756kb

input:

300
498467647315603 280705438
498413643018459 147361311
498442822873734 615896776
498462635714861 43490534
498441685620993 527835597
498437123170104 485963394
498468781665223 407209396
498403339382869 634724859
498415591913895 671381619
498425509331860 736077185
498434024579246 346098914
49843086393...

output:

72077309612

result:

ok single line: '72077309612'

Test #18:

score: 20
Accepted
time: 0ms
memory: 3760kb

input:

300
20198332651911 50719381
20205666793632 948023975
20175835410392 175950031
20220556759181 748768353
20193490606180 926701208
20206883743985 971965521
20207753568157 57845745
20219522299547 507652386
20203811534030 437013173
20225313073559 38312440
20182448319023 579447736
20222468389329 473363371...

output:

91248448779

result:

ok single line: '91248448779'

Test #19:

score: 20
Accepted
time: 0ms
memory: 3640kb

input:

300
968364186154002 750463276
968367065348868 134482067
968362922071182 548366827
968371033205696 559495579
968368660333950 73709853
968367506661618 985780603
968369460583691 805645909
968367778574036 347436912
968363101470256 958779957
968364648001656 109942188
968376926950157 329894835
96837688272...

output:

113386066792

result:

ok single line: '113386066792'

Test #20:

score: 20
Accepted
time: 0ms
memory: 3584kb

input:

300
437547617470180 787038593
437551499419433 886891182
437549589672557 905485424
437560029282309 362035091
437544761984984 68776057
437546649026522 968687857
437554713796236 983142078
437543978098711 18914383
437550148364092 53169636
437544004770512 707266630
437548594141349 423807643
4375439319609...

output:

126763705879

result:

ok single line: '126763705879'

Test #21:

score: 20
Accepted
time: 0ms
memory: 3488kb

input:

300
170690344550864 852126065
170694017521993 298883150
170699594578095 192248891
170691785821679 948631891
170693526715297 311048489
170691574468810 689583295
170695676827928 679655255
170691437873412 488695729
170692176745508 316431284
170697337596197 53065465
170699364959226 304556470
17069896291...

output:

144652842791

result:

ok single line: '144652842791'

Test #22:

score: 20
Accepted
time: 0ms
memory: 3764kb

input:

300
166803344880263 564294260
166802010108185 836259022
166805785972152 256697584
166803855025439 567157435
166804335492999 762390471
166808910812562 709545845
166804830212439 791866841
166806646334286 760050285
166806969726187 971871351
166805498404107 951954842
166808910850109 618404617
1668049053...

output:

148606016007

result:

ok single line: '148606016007'

Test #23:

score: 20
Accepted
time: 0ms
memory: 3508kb

input:

300
173122018796157 435787756
173124662095562 401156892
173125035844394 281498845
173123275280264 768906716
173125758368595 610449211
173124421413382 231064976
173123310117563 557936059
173124794526359 859262916
173125187017392 676906135
173125025718629 974984371
173123726237652 550974785
1731229063...

output:

151051743423

result:

ok single line: '151051743423'

Test #24:

score: 20
Accepted
time: 0ms
memory: 3528kb

input:

300
21447803360551 116910520
21448283356105 373045868
21448468644996 497669850
21448054482011 671623017
21447712508203 547623110
21448080628402 374663040
21448436453553 439541758
21448015935140 182922256
21448098402470 13653117
21447667184532 476067478
21448125324537 611674195
21448346281608 1128887...

output:

146940723824

result:

ok single line: '146940723824'

Test #25:

score: 20
Accepted
time: 0ms
memory: 3812kb

input:

300
953513262300528 860837084
953513187475953 60241291
953513297333289 858097449
953513215533552 327982059
953513569899622 160037143
953513373128554 42813924
953513412433162 797844677
953513409922650 659645038
953513539232859 128457476
953513145967508 96159601
953513293545647 536373297
9535134325983...

output:

143808321353

result:

ok single line: '143808321353'

Test #26:

score: 20
Accepted
time: 0ms
memory: 3544kb

input:

300
652609562993473 885780242
652609580991726 198799232
652609524696658 624771541
652609524643610 880596269
652609563191287 57130671
652609517736693 417346973
652609579723508 728210682
652609568362389 415718121
652609571887983 81985373
652609549274537 515914387
652609520771612 997794786
652609545326...

output:

157510763842

result:

ok single line: '157510763842'

Subtask #3:

score: 20
Accepted

Dependency #1:

100%
Accepted

Dependency #2:

100%
Accepted

Test #27:

score: 20
Accepted
time: 0ms
memory: 3908kb

input:

5000
553708987594692 565437624
554399661138589 932485822
552796542801644 212284413
551235876311771 702272954
550093331956045 612975050
551876700435773 336807544
555225445168316 380701048
554724317597322 971877629
552907715848682 475704443
556422064639175 366522941
556569026950077 939547925
551093637...

output:

2632842109

result:

ok single line: '2632842109'

Test #28:

score: 20
Accepted
time: 2ms
memory: 3948kb

input:

5000
153526690284511 584519753
150826529757927 866256273
148072947874406 502980581
150723144643035 676668033
145980882906013 593143508
146386338653639 797476098
148515755721960 828907323
152316948665756 524613905
152550327384304 611000097
146699179174428 896203231
148789965845032 871208644
151201863...

output:

3497450773

result:

ok single line: '3497450773'

Test #29:

score: 20
Accepted
time: 2ms
memory: 4176kb

input:

5000
125455002154178 973123796
123153708334420 983123354
122746067803070 13577098
123553333512296 546106383
122150973578505 658917483
124480361883848 479833849
124859112740996 825229772
126190290299190 812012080
124986998577083 351179912
124185750363874 116996331
125648275296891 662117902
1251726745...

output:

4405532438

result:

ok single line: '4405532438'

Test #30:

score: 20
Accepted
time: 2ms
memory: 4188kb

input:

5000
465248971707978 141269145
466369627342325 730065088
465963965215215 442463570
465900327827106 907249995
467583504389589 321998422
464991028857376 628382820
467996645744701 168462427
464873102604389 443170836
466731229078879 662741496
465778303107022 545195355
467813940443628 462756556
469827750...

output:

4216782620

result:

ok single line: '4216782620'

Test #31:

score: 20
Accepted
time: 0ms
memory: 4148kb

input:

5000
683456101107801 705571197
686228038794737 223567540
683723867760283 224926558
683465604101236 741442770
682852933312904 92201685
683388701223092 140142305
684895066987685 277838273
684910446278859 296671142
682556957556474 967409526
684351939050844 191692820
683719425468117 175893518
6820556936...

output:

4627906427

result:

ok single line: '4627906427'

Test #32:

score: 20
Accepted
time: 2ms
memory: 3880kb

input:

5000
877319523287579 451488085
878245643290256 799229047
875622800958222 279137299
877293091976926 237213735
875843228412447 832862920
876246520416322 913770198
878377111700146 524373636
876771122789386 455401992
877115331575374 350332839
875842501103751 311324229
878312022296339 538898071
876170899...

output:

5770200998

result:

ok single line: '5770200998'

Test #33:

score: 20
Accepted
time: 2ms
memory: 3912kb

input:

5000
446819612574492 480272432
446288820969752 921242240
444200364591975 358958608
445689140866537 107670236
445784735493481 234473595
443520004784527 950773452
445221580928814 912339155
446437101785599 772181628
445092783376570 964271571
443387017065282 800665335
444800578850605 291388919
444133087...

output:

5671064625

result:

ok single line: '5671064625'

Test #34:

score: 20
Accepted
time: 2ms
memory: 4148kb

input:

5000
708083725495128 42075897
711157792042442 462539317
710619131922546 349738661
710256680368656 611795654
710885580825014 428987486
709354605599902 269964052
710870369525894 728110220
709313180852240 587980201
708465552141869 679998772
707674424718957 372481518
708794915198979 564545217
7091088051...

output:

4973418764

result:

ok single line: '4973418764'

Test #35:

score: 20
Accepted
time: 0ms
memory: 3892kb

input:

5000
200538738330193 741317654
202953653498697 78766039
201301967790935 952565626
200632790387050 335512851
202251527761014 509224133
200998606492923 385217264
200807231660154 60342895
200045735076434 19977055
200020890564331 464340977
201589051700676 315016495
201318873634374 705669881
200634860945...

output:

7950733078

result:

ok single line: '7950733078'

Test #36:

score: 20
Accepted
time: 2ms
memory: 3880kb

input:

5000
746079940323795 732654468
746256198641232 23565965
743808809682034 663302230
744707382184761 320281865
744770028088484 281339191
746370793605260 413504323
745605630575287 543032947
744562349067907 465981659
745877813740302 563970029
744337013033100 389034417
745938737326511 425340949
7438391911...

output:

14451231785

result:

ok single line: '14451231785'

Test #37:

score: 20
Accepted
time: 2ms
memory: 3880kb

input:

5000
359093929081350 356138632
361286326508412 441536602
360372823866215 826983768
358991470712060 731237450
361358755827087 936154685
358931757336474 142838042
360932400591406 723790126
359190064283282 428631262
359682349276504 524103348
361086102210183 661988386
361542531959625 513588101
359352902...

output:

14120699222

result:

ok single line: '14120699222'

Test #38:

score: 20
Accepted
time: 0ms
memory: 4180kb

input:

5000
744881534630605 975350057
745531109127993 187205226
744560248137045 166988388
745525993832647 385943799
745455758464110 160896734
744367290116588 501028376
746560760872480 120410992
746629341230890 784460810
746324603433098 753696695
746635198015620 249832939
744255433930408 811888982
746005044...

output:

26451553350

result:

ok single line: '26451553350'

Test #39:

score: 20
Accepted
time: 2ms
memory: 3944kb

input:

5000
442525356075946 348288713
444645687525962 674752544
444391787893240 550359914
444547135090479 750686301
442348648256740 567477816
443937316834019 94941973
443244458577191 813990346
443636720684974 24305742
443497612055498 664657408
442242956526373 787177446
442884351277406 824739383
44345903017...

output:

35763139516

result:

ok single line: '35763139516'

Test #40:

score: 20
Accepted
time: 2ms
memory: 3968kb

input:

5000
855625681344290 600908267
855723611310225 972672061
857195461104804 720114804
857478066871978 770674656
857846102205221 26909735
856399980258429 694060350
855944695255889 387110237
856132069176440 247653629
856979768289897 476963700
855640989398205 817245977
855621318748403 279821413
8570633238...

output:

49127102611

result:

ok single line: '49127102611'

Test #41:

score: 20
Accepted
time: 2ms
memory: 3912kb

input:

5000
54166032409570 797552827
54185524095948 745053367
53961882799779 126163231
54651340268844 24743298
54393061383410 585340369
55659997644506 780515917
54670328180616 486836148
56246585810396 913348555
54928037884213 236992956
55958211832052 653366840
55010857298449 284126140
55981661035206 927563...

output:

112418514277

result:

ok single line: '112418514277'

Test #42:

score: 20
Accepted
time: 2ms
memory: 4156kb

input:

5000
796641550944143 531358512
798010698785634 800357123
797846520072211 721982553
797248392188133 456583142
798360925143770 299588356
796907628175985 965921701
798333882332968 715367941
797545592753885 661934914
797157191232328 670610540
796606064083215 421932497
797598654706488 107154618
797736822...

output:

263771199089

result:

ok single line: '263771199089'

Test #43:

score: 20
Accepted
time: 2ms
memory: 4172kb

input:

5000
154772848963618 236841343
155638067545569 460284074
155612581217860 812636583
154074369183487 544830925
154702660816126 619180811
155266531537653 782658029
154271438959656 242376348
155621168005117 195530556
156222517767466 300622977
155732932464859 527452349
155367517481474 692285538
154997008...

output:

330320701225

result:

ok single line: '330320701225'

Test #44:

score: 20
Accepted
time: 2ms
memory: 3876kb

input:

5000
818928810990573 713406011
818697512699118 749090023
819315592489486 192754409
818794456095297 467487834
818756778376881 455400828
819472264290904 490098790
819406436716173 463998745
818994041540588 647360985
818898088187108 655997685
819612735723056 277311307
819570471929058 286933238
820032701...

output:

391684951573

result:

ok single line: '391684951573'

Test #45:

score: 20
Accepted
time: 2ms
memory: 3972kb

input:

5000
464962906296675 328183209
463127761616796 488642159
464321073699485 29885276
463657255493388 77885576
463477550594306 422521781
463255421187197 381007179
464874574231658 496685249
463327656568945 662908628
463421168037877 511637952
464600324405930 731500037
463955670560551 787910164
46458851979...

output:

514689142595

result:

ok single line: '514689142595'

Test #46:

score: 20
Accepted
time: 2ms
memory: 3976kb

input:

5000
524870261305206 568212422
524853090839389 880456572
523217539655724 479054557
524036237262718 196846202
524592224907658 103342032
524305786576351 26489030
524932230689531 69183336
524618754737019 865192956
523507940379258 692622335
524972988354239 921544519
524016291446550 932389314
52389752233...

output:

629826858162

result:

ok single line: '629826858162'

Test #47:

score: 20
Accepted
time: 0ms
memory: 3956kb

input:

5000
772674211484976 744019836
773012079507990 964776804
773305846899615 832015221
772878162426876 330175024
772545015483821 124786364
772971480193303 817892716
772246444639911 324835987
773260882743957 302628183
771936237759055 741100882
772084997310227 390678656
772532648679758 538040271
773000307...

output:

974058757034

result:

ok single line: '974058757034'

Test #48:

score: 20
Accepted
time: 2ms
memory: 3876kb

input:

5000
414442732758375 108949658
414571060076681 899377861
414300136228296 248152136
414374362337883 49113510
415030372001431 244474163
414444669336725 574985891
414759581057426 740669859
415197292141849 614404987
414536197322845 238349691
414606663275191 769877160
414586709998848 965960172
4149921011...

output:

1551305439573

result:

ok single line: '1551305439573'

Test #49:

score: 20
Accepted
time: 2ms
memory: 3952kb

input:

5000
803723568937345 542946662
803732277527081 546243350
803771468009681 911819398
803708183713946 994347772
803754058220449 666995738
803717526539842 616167864
803757453182609 251085085
803718966236770 134699724
803720579736142 736868737
803782264798089 616697399
803788414605147 177225462
803745624...

output:

2351990277372

result:

ok single line: '2351990277372'

Test #50:

score: 20
Accepted
time: 2ms
memory: 3900kb

input:

5000
223676573568570 437008849
223681088454305 925777584
223684648476644 421090682
223676712988987 728362272
223683462329988 750760020
223677497994103 974138008
223682147194509 863061952
223681588754540 499321983
223682833210724 337094836
223678378108702 784052626
223677054059958 752097164
223677705...

output:

2463441816934

result:

ok single line: '2463441816934'

Test #51:

score: 20
Accepted
time: 2ms
memory: 3976kb

input:

5000
859027184434393 321505681
588563423495368 634406487
631227590801208 238284631
160795885412606 718952518
721121073382428 743283974
19713548333294 41565439
147919700828206 851443659
319407255978832 758110620
691902920715886 804967382
809967280880051 642045915
166846018246797 187250624
61823574844...

output:

1612288589

result:

ok single line: '1612288589'

Subtask #4:

score: 50
Accepted

Dependency #1:

100%
Accepted

Dependency #2:

100%
Accepted

Dependency #3:

100%
Accepted

Test #52:

score: 50
Accepted
time: 184ms
memory: 42012kb

input:

500000
801031472642499 66360370
615266167632971 690007975
70858087140519 285850172
444028868027699 270227150
269580420315204 610987764
269685097866548 703503840
967837266044415 101976475
493747889681364 74476495
125063276867058 513026133
671174651924505 314985692
739580231734579 532160130
3190902229...

output:

4167695564

result:

ok single line: '4167695564'

Test #53:

score: 50
Accepted
time: 196ms
memory: 42084kb

input:

500000
552301651793539 720815213
519851764293217 259813782
365942251539664 391485148
379029587008370 543368307
620606469233526 601719475
402147190990952 594153630
280864471938199 124730376
269068225108819 613583128
252074583344773 63242006
453262325013334 442896810
501041528694270 81325958
625394365...

output:

9547796668

result:

ok single line: '9547796668'

Test #54:

score: 50
Accepted
time: 188ms
memory: 42032kb

input:

500000
546151610822517 532945088
283038139289557 762263488
426815684746384 24499141
371559881966025 636588620
341901252893262 695326654
499598442336698 311656620
309846062930046 986809727
320343012372787 742707909
459816658667973 874470119
522085075630095 912838560
458439604697470 199738304
45613057...

output:

26019134884

result:

ok single line: '26019134884'

Test #55:

score: 50
Accepted
time: 191ms
memory: 41996kb

input:

500000
798359082546731 464887532
705960221530911 420644382
603437418111598 76327402
639394030270771 708522385
668489743981430 84303943
647119997740806 714061969
811440971089263 375220397
807982879500006 314003519
759488943908601 825631667
685106755460084 216598151
811130342648181 119741779
718780120...

output:

108625644704

result:

ok single line: '108625644704'

Test #56:

score: 50
Accepted
time: 208ms
memory: 42092kb

input:

500000
762498135526529 368624781
735841191943592 881008036
846059342813163 358006353
893580231485193 371925286
773410071325159 314517058
784437129136248 866189129
729112202363656 52526598
903563796496144 883754231
707299991654276 180021694
842310303610255 64110830
690461283498637 358843768
813424710...

output:

317758794107

result:

ok single line: '317758794107'

Test #57:

score: 50
Accepted
time: 207ms
memory: 42200kb

input:

500000
156186203454389 798286780
161773387777369 257536383
286584820305593 104779281
233944766969114 569610672
242303889508417 989086745
248650872317041 265756488
224132276921241 54044869
392932284615594 982604190
384741536296410 426918002
391299890560251 876589021
392024398500786 649454081
37394693...

output:

397585057168

result:

ok single line: '397585057168'

Test #58:

score: 50
Accepted
time: 189ms
memory: 42160kb

input:

500000
535564597978685 334201400
364658527438824 668642294
594002584994682 955760574
483939255560624 150463100
510418156104992 431697659
438022255720004 685845641
554595594707472 648067824
383435728013660 70994681
516965769567831 354534288
434670883132861 112875535
422769649167076 264227265
55156612...

output:

1576490225487

result:

ok single line: '1576490225487'

Test #59:

score: 50
Accepted
time: 193ms
memory: 42140kb

input:

500000
530940767417341 92006792
492021779966210 785782756
496356072923726 565478018
398807937672173 919109153
478987774097186 589900460
520259854365094 840657748
361629174025720 400060081
566781781634231 40687098
416098754908451 600152132
451417245781149 718258180
542580494229868 102758079
511669841...

output:

3279005135698

result:

ok single line: '3279005135698'

Test #60:

score: 50
Accepted
time: 201ms
memory: 41996kb

input:

500000
220657335706693 990687399
326039460560147 249287374
275513973757313 362685760
383776630225367 470231018
285424670864908 267310016
311560300567044 710450444
396463709972109 510840728
367479019848526 845752284
308549566363383 324990516
272480256753332 483590907
331841683239274 149233249
3157722...

output:

5077255794989

result:

ok single line: '5077255794989'

Test #61:

score: 50
Accepted
time: 196ms
memory: 42160kb

input:

500000
212700667730029 664845254
174749960762900 888752620
85633497742649 544631664
270107690085753 487647355
97339784867156 703217773
202173931201920 74377600
212284077864595 129872767
208568666751290 586378343
125117744065396 698957134
79716177487546 571223644
199506597043467 700495131
23258544085...

output:

7087371799654

result:

ok single line: '7087371799654'

Test #62:

score: 50
Accepted
time: 167ms
memory: 42192kb

input:

500000
651438338052508 353592037
751276531994321 150786934
560196163041507 976211069
618888166333271 822822266
750648132994678 633541634
743755769648548 858773441
743247903807064 356420083
566182561172869 753015682
752295928486476 159355203
675350153313795 317997714
727396742741237 865116062
6644276...

output:

9022217215639

result:

ok single line: '9022217215639'

Test #63:

score: 50
Accepted
time: 200ms
memory: 42012kb

input:

500000
663646534114395 409758901
632770345120099 89207995
527185570215093 155417566
585768801198340 428772218
613274396881835 284216466
698307144943156 408785500
511916204973234 968716573
560157307753397 233927256
585402141681731 95072370
586926680129022 55413627
680347957800988 64140863
60637638599...

output:

13185041342297

result:

ok single line: '13185041342297'

Test #64:

score: 50
Accepted
time: 205ms
memory: 42144kb

input:

500000
382166624443515 564935877
537186874059866 393023504
555716862698702 214958145
373228905308818 595953084
377416311536271 661492104
445476305711172 88563961
473936817315535 786440187
458422801122749 970725210
523509386725003 757917274
375762355231910 751894276
446851643898452 629176189
39464820...

output:

20055400451693

result:

ok single line: '20055400451693'

Test #65:

score: 50
Accepted
time: 182ms
memory: 41996kb

input:

500000
394497393932358 539813457
474010866105574 649221513
349142533649569 441011691
317880187417034 280035266
319521354014762 818157098
346715776187726 804109923
420865187356930 881130373
410877126971335 456777618
409231378610299 494792839
386637963371745 828567513
461207030347366 1173114
438621206...

output:

80049236231120

result:

ok single line: '80049236231120'

Test #66:

score: 50
Accepted
time: 179ms
memory: 42076kb

input:

500000
934601340597667 981451663
913656013689049 890340776
878514619502388 908568087
853095354446762 812553177
928746418561488 125377614
863328004667258 324509941
888346473117478 276488255
857904533902515 857633464
840805707150648 705601403
888769727090882 566813254
860372991971725 292511195
8710650...

output:

149781736419999

result:

ok single line: '149781736419999'

Test #67:

score: 50
Accepted
time: 183ms
memory: 42008kb

input:

500000
359359941734613 90734878
355991351289684 830945436
360450702673786 613837282
362724243438319 679938486
364550149190027 175740505
363228244367971 31101506
360419625648219 297595850
364438885267193 470412105
358341175588706 836667742
357670321483697 66500259
357556853252528 788057077
3652354943...

output:

239989111026665

result:

ok single line: '239989111026665'

Test #68:

score: 50
Accepted
time: 209ms
memory: 41996kb

input:

500000
945747031791821 540015443
945689085633815 739386122
945770891677619 964386073
945695688098324 839316813
945769161972460 641230297
945745610446432 736750729
945752580271411 458807901
945712232122722 829135234
945724788035176 692598110
945777151690281 837404671
945743213707177 89976418
94576309...

output:

250032194259869

result:

ok single line: '250032194259869'

Extra Test:

score: 0
Extra Test Passed