QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#831688#4. GapLYLAKIOIAKIOI100 ✓42ms7136kbC++14853b2024-12-25 16:07:162024-12-25 16:07:17

Judging History

你现在查看的是最新测评结果

  • [2024-12-25 16:07:17]
  • 评测
  • 测评结果:100
  • 用时:42ms
  • 内存:7136kb
  • [2024-12-25 16:07:16]
  • 提交

answer

#include<bits/stdc++.h>
#include "gap.h"
using namespace std;
const int N=1e5+10;
long long a[N];
long long findGap(int t,int n){
    if(t==1){
        int l=1,r=n;
        a[0]=-1,a[n+1]=(long long)1e18+1;
        while(l<=r){
            long long x,y;
            MinMax(a[l-1]+1,a[r+1]-1,&x,&y);
            a[l]=x,a[r]=y;
            l++,r--;
        }long long ans=0;
        for(int i=2;i<=n;i++) ans=max(ans,a[i]-a[i-1]);
        return ans;
    }else{
        MinMax(0,1e18,&a[1],&a[n]);
        long long B=(a[n]-a[1]+n-2)/(n-1);
        long long la=a[1],bl=a[1],ans=0;
        while(bl<a[n]){
            long long x,y;
            MinMax(bl+1,bl+B,&x,&y);
            bl+=B;
            if(x==-1||y==-1) continue;
            ans=max(ans,x-la);
            la=y;
        }return max(ans,a[n]-la);
    }
    
}

Details

Tip: Click on the bar to expand more detailed information

Subtask #1:

score: 30
Accepted

Test #1:

score: 30
Accepted
time: 0ms
memory: 3780kb

input:

1 2
29659227736649406 728704890713443211

output:

699045662976793805
1

result:

points 1 M = 1

Test #2:

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

input:

1 15
4910834401530995 82366510858893943 154224513006215114 167111470747458922 291518420333647381 360708376904159067 475438451423179257 514521822479974099 544779904916816505 631359818684602077 636047253191505154 815280682985156693 908104066692014481 977273719899584711 997330329109444588

output:

179233429793651539
8

result:

points 1 M = 8

Test #3:

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

input:

1 15
26822012613602297 83016336616322262 240236403235204784 251263501103080046 267418872581278273 283465011506182121 387188614324429897 405999856871910796 621222868183510412 705139383465288123 737738410068055892 825642738416654428 854722383986606367 855077944176184296 908358416490444978

output:

215223011311599616
8

result:

points 1 M = 8

Test #4:

score: 30
Accepted
time: 1ms
memory: 5944kb

input:

1 15
9924552505919890 20650946047777351 137465276238229613 316776581684046368 328799260840899945 352871104748474083 461843498111917783 467004768858109370 483649564461099301 522358288815328209 604961424367736207 741995299386981061 796141495301995014 806409479876611358 985852922191990473

output:

179443442315379115
8

result:

points 1 M = 8

Test #5:

score: 30
Accepted
time: 1ms
memory: 5820kb

input:

1 15
5829742 7847985 9866228 11884471 13902714 15920957 17939200 19957443 21975686 23993929 26012172 28030415 30048658 32066901 34085144

output:

2018243
8

result:

points 1 M = 8

Test #6:

score: 30
Accepted
time: 0ms
memory: 5884kb

input:

1 100
3343298378001251 17484402436127123 23692744930918786 26627871378097607 27094733652649548 36364042508477388 38440289626273354 51568172689743427 59547297792096252 69378457790067663 90898643112854066 126667262868037819 128409326258917243 151146480509633563 160238662778949922 169891116525178350 17...

output:

51057453672116406
50

result:

points 1 M = 50

Test #7:

score: 30
Accepted
time: 1ms
memory: 5820kb

input:

1 100
6615965004180765 13185207460451761 23734307750252029 24158382668441223 49162776469681165 50213865766220511 56584679171324873 72355935174261200 78534230832420118 86100851851862565 89979985531351472 98750915670727392 109538473420377753 110428987732941952 111325085136921829 114262413730167727 118...

output:

49328838642377492
50

result:

points 1 M = 50

Test #8:

score: 30
Accepted
time: 0ms
memory: 3792kb

input:

1 100
709357564623321 7712824696571068 24393851130421107 27005556867201291 28185446351046950 59253483486983895 66103734017093545 90874504779503203 94536894293511165 101066291988100224 132440848420581011 136611074783604734 139508009804041082 146397349745117579 155563877383458473 182718838546797030 19...

output:

44115425462423692
50

result:

points 1 M = 50

Test #9:

score: 30
Accepted
time: 1ms
memory: 5884kb

input:

1 100
14237546663715875 26898867314446811 32923852684187028 35501560148931192 42094588678535703 46313954319267128 46780297957478675 54140230845661659 69717122031105868 85227834377828719 87123433354912852 87694208848816839 100294949511635763 100640491384053889 117783048175404598 120498517471861537 12...

output:

45345737967249636
50

result:

points 1 M = 50

Test #10:

score: 30
Accepted
time: 1ms
memory: 5948kb

input:

1 100
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 482771 482772 482773 482774 482775 482776 482777 482778 482779 482780 482781 482782 482783 482784 482785 482786 482787 482788 482789 482790 482791 482792 482793 482794 965533 965534 965535 965536 965537 9...

output:

482739
50

result:

points 1 M = 50

Test #11:

score: 30
Accepted
time: 0ms
memory: 5900kb

input:

1 1500
393226341882178 1321649646861936 1364933587797097 1889765428846896 2456116238504757 2518733965088369 3825795947577367 5405580152527417 5570252473787754 6350713065107462 6581444896242136 6656726663294586 8363165203490333 9558500171039813 9586690516318136 9673890229897646 12861707206480546 1294...

output:

5607705563272188
750

result:

points 1 M = 750

Test #12:

score: 30
Accepted
time: 1ms
memory: 5944kb

input:

1 1500
276387254568267 348298566021308 1125215387592508 1923588239039903 2955434210783111 3356563093662062 3954646930267164 4075124529772830 5324942771348103 6615468346955442 6997348010487097 7438352604440139 8115335024997761 8684463607233403 8919700770029490 9110179826351266 9192758850283477 974192...

output:

5550787805329272
750

result:

points 1 M = 750

Test #13:

score: 30
Accepted
time: 1ms
memory: 5892kb

input:

1 1500
394502620394491 477595652087208 1780588042371800 2567382279231585 3433538158427605 5126964998146432 5540015402387536 5863708707865343 7204628472359887 7409780941504842 7460021205004392 7947558620073481 8773299171413406 8907935113700215 9502489274784574 9828824230085381 10250737830740541 10348...

output:

5773483938914314
750

result:

points 1 M = 750

Test #14:

score: 30
Accepted
time: 1ms
memory: 5868kb

input:

1 1500
232644703989174 914925623772208 1780788508756344 1942956344014084 1951540326583367 2705677420197432 3315127930499324 3530924082453323 4063095195421877 5878910158522313 6191425649884323 7474281913739540 8005162170319151 9689629284273377 10553282724580534 11302266974886461 11328427098980173 131...

output:

5130685060193677
750

result:

points 1 M = 750

Test #15:

score: 30
Accepted
time: 1ms
memory: 6028kb

input:

1 1500
5829742 7847985 9866228 11884471 13902714 15920957 17939200 19957443 21975686 23993929 26012172 28030415 30048658 32066901 34085144 36103387 38121630 40139873 42158116 44176359 46194602 48212845 50231088 52249331 54267574 56285817 58304060 60322303 62340546 64358789 66377032 68395275 70413518...

output:

2018243
750

result:

points 1 M = 750

Test #16:

score: 30
Accepted
time: 8ms
memory: 6008kb

input:

1 25000
9133780858698 37909498824529 46424274433061 70160050989590 125416618927966 131263384497746 138567320950042 147982747026601 169954574711772 416414702693488 521633254355739 604620659815966 630248301432581 636599651288513 649591523233109 673879027226892 743167222805134 1050284364947427 10667909...

output:

400443289050740
12500

result:

points 1 M = 12500

Test #17:

score: 30
Accepted
time: 7ms
memory: 6248kb

input:

1 25000
95371433023390 183850194127179 204901134589572 252754062343800 256294085315900 272877283746967 359297770213316 362185632533591 367274595807277 538035954679833 574635344070507 592259524690062 732544214561464 736176455194807 747090611983790 751067222940691 764188551907236 792924484902295 86134...

output:

505979566183486
12500

result:

points 1 M = 12500

Test #18:

score: 30
Accepted
time: 8ms
memory: 6100kb

input:

1 25000
7504645895952 60172453317399 82471651467385 101821286783379 128772758422292 142128421583576 176046308040656 189670285914911 195166891755926 332153022335956 337772092961783 445143919770092 471801980403459 521901385689244 557011875311943 657204669416734 693608324078908 720572981724339 72166032...

output:

509260497524918
12500

result:

points 1 M = 12500

Test #19:

score: 30
Accepted
time: 4ms
memory: 6304kb

input:

1 25000
39499604978204 102114332324801 160517211313931 188637308000017 238002860728363 287351974543450 335961801282777 396999481527880 415187881071623 450041544343299 462992172994970 499000116280155 510734447770100 522124078388134 558759362727955 583635064368750 586330026742164 637440358336379 68038...

output:

476196269160204
12500

result:

points 1 M = 12500

Test #20:

score: 30
Accepted
time: 7ms
memory: 6244kb

input:

1 25000
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 ...

output:

482739
12500

result:

points 1 M = 12500

Test #21:

score: 30
Accepted
time: 31ms
memory: 7032kb

input:

1 100000
4488179349610 16973330836139 44660350011287 46649694101657 54515631864687 62626048878225 77067984967371 77638306380215 86736649958265 106182394950493 109712006055182 112079135090560 120631618256852 131475831109715 132583034287859 147254369707135 149714669535946 158044969527118 1703406482415...

output:

113609171549866
50000

result:

points 1 M = 50000

Test #22:

score: 30
Accepted
time: 30ms
memory: 7064kb

input:

1 100000
13149709307416 18293717155215 25043623630885 44879400902614 49407376018350 52861802361795 53857880880850 58694832631466 63622284751967 66208436709721 73862222390267 79620705266666 94876232845299 132331415691214 153768757924367 164956420682250 180021859691119 182562169198074 188033608246735 ...

output:

127809210425414
50000

result:

points 1 M = 50000

Test #23:

score: 30
Accepted
time: 27ms
memory: 5480kb

input:

1 100000
5111699493996 19396274992433 20967237804327 32517505001678 37420536389187 42062575012054 52881565873541 55473734871126 96464144900326 102867496482900 108570627831112 121793007313548 125311330574962 133276275768191 148249097647989 152433525451301 152869309246267 153620613141705 1980527029859...

output:

145636692074772
50000

result:

points 1 M = 50000

Test #24:

score: 30
Accepted
time: 30ms
memory: 7136kb

input:

1 100000
12448126808805 14955287440308 18957486171700 26205108342440 35429821492473 37014077981695 37057923771744 56479710514435 74696614009460 79512505727286 81392393692907 83937107044022 86860753091654 90757682139231 97943450459170 100413143098496 104905348694766 111192555705468 137528216217108 14...

output:

124782173142764
50000

result:

points 1 M = 50000

Test #25:

score: 30
Accepted
time: 28ms
memory: 6996kb

input:

1 100000
5829742 7847985 9866228 11884471 13902714 15920957 17939200 19957443 21975686 23993929 26012172 28030415 30048658 32066901 34085144 36103387 38121630 40139873 42158116 44176359 46194602 48212845 50231088 52249331 54267574 56285817 58304060 60322303 62340546 64358789 66377032 68395275 704135...

output:

2018243
50000

result:

points 1 M = 50000

Test #26:

score: 30
Accepted
time: 31ms
memory: 6648kb

input:

1 100000
15609355723226 28246203120916 30534297616421 30860828332767 39610757317274 51747678705316 59431565063656 65334112957168 73755518304209 73983782735249 85678154678498 88615327621076 119910216575517 135696757222159 146948840815723 153918026203480 154953312049266 198110592039235 208594061499708...

output:

118147358961195
50000

result:

points 1 M = 50000

Test #27:

score: 30
Accepted
time: 30ms
memory: 6972kb

input:

1 100000
10126035265316 18812438778817 21939562196718 34894638833527 38854235463395 40111115712840 42519043571969 43016952934044 69976845297204 72056983241149 92536484920211 103356244768685 120903354118841 144620368621389 156984924786619 157738788406302 157904138655286 165482438928337 16686535822451...

output:

131778553155869
50000

result:

points 1 M = 50000

Test #28:

score: 30
Accepted
time: 30ms
memory: 7000kb

input:

1 100000
5196984998043 10787031331530 50135404987503 54792304198458 77983401426640 83070904825088 118151991355567 119230477408462 132306550794169 134404059623264 151597039637359 160097671531535 163732034708578 189765789913722 195170548694892 205393730407830 207208693338456 213544197686227 2144304840...

output:

125388883971902
50000

result:

points 1 M = 50000

Test #29:

score: 30
Accepted
time: 30ms
memory: 6940kb

input:

1 100000
19821024745776 35883956869682 37055128006390 73846930057178 74584703826867 75294939571297 79182722559431 79785889433372 82670507176415 106089250957212 112890558692026 127521606324433 174230033489231 177420213949701 184639822084732 195957538680526 209919488393415 209969657281950 213974569728...

output:

128742514930586
50000

result:

points 1 M = 50000

Test #30:

score: 30
Accepted
time: 27ms
memory: 6944kb

input:

1 100000
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100...

output:

482739
50000

result:

points 1 M = 50000

Test #31:

score: 30
Accepted
time: 1ms
memory: 5880kb

input:

1 118
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 62 68 81 108 163 273 494 937 1824 3599 7151 14255 28465 56886 113728 227414 454787 909533 1819027 3638015 7275993 14551950 ...

output:

500000000000000000
59

result:

points 1 M = 59

Test #32:

score: 30
Accepted
time: 1ms
memory: 5864kb

input:

1 118
1 500000000000000001 750000000000000000 874999999999999999 937499999999999998 968749999999999997 984374999999999996 992187499999999995 996093749999999994 998046874999999993 999023437499999992 999511718749999991 999755859374999990 999877929687499989 999938964843749988 999969482421874987 9999847...

output:

500000000000000000
59

result:

points 1 M = 59

Subtask #2:

score: 70
Accepted

Test #33:

score: 70
Accepted
time: 1ms
memory: 5824kb

input:

2 2
78103569500113815 605712887753065418

output:

527609318252951603
5

result:

points 1.0 M = 5

Test #34:

score: 70
Accepted
time: 1ms
memory: 5996kb

input:

2 15
61436558421029682 83429206007963488 214541359837684412 243514252712970384 305484811504551902 336434369562156870 338340290496962958 497057755642276106 550273649621370145 553677540845214422 598379388791730666 658501786507934652 711557595985663747 814649872154415032 878126866231709433

output:

158717465145313148
44

result:

points 1.0 M = 44

Test #35:

score: 70
Accepted
time: 0ms
memory: 5884kb

input:

2 15
59675445208809451 142100938168130731 142778750537911268 145878063040919916 228454814846027076 365849136864612457 425894246981391798 451929789636893609 579288599904950343 611917505913569401 621800386060296794 637514454221919688 778985075063038449 874668678652079318 889214302684617492

output:

141470620841118761
44

result:

points 1.0 M = 44

Test #36:

score: 70
Accepted
time: 1ms
memory: 5964kb

input:

2 15
57755783461204076 72549946137614447 179385293992102048 209990359510105993 301191691762496670 410470902706229658 430983119114331844 467619140342868405 748689830575686738 753404177880679738 837146843904735841 854384575303601726 891183470551146115 892712248087677608 971404558488464135

output:

281070690232818333
44

result:

points 1.0 M = 44

Test #37:

score: 70
Accepted
time: 1ms
memory: 6008kb

input:

2 15
5829742 7847985 9866228 11884471 13902714 15920957 17939200 19957443 21975686 23993929 26012172 28030415 30048658 32066901 34085144

output:

2018243
44

result:

points 1.0 M = 44

Test #38:

score: 70
Accepted
time: 0ms
memory: 6004kb

input:

2 100
4935323238097746 28534213362222140 37905204271928606 44835155959615084 46421753700280925 48315957519843128 62269291292786035 63677966833361016 66226051078537021 79200319592861218 92073281359962070 94698585949845662 96212735984345494 101730013130158889 108346369730603809 112048482398636871 1158...

output:

54067555940387079
299

result:

points 1.0 M = 299

Test #39:

score: 70
Accepted
time: 1ms
memory: 5904kb

input:

2 100
329840134021571 3524716673488504 14138718779423773 18864428727339342 46450227836078195 48967880893262489 56068731734091538 81008716200191803 87755612255127591 99979863565778359 103237562738020533 121702606144800766 133561647213804519 134821681550500923 171577745967038556 205671541794608303 216...

output:

59713872839546348
299

result:

points 1.0 M = 299

Test #40:

score: 70
Accepted
time: 1ms
memory: 5820kb

input:

2 100
20951091854749146 39386665336762106 65348999538428106 66362035795586210 81709370165386396 93863216036002253 94954124765945570 98416678462344831 100179150589549359 101661786858873791 105784523081581573 133226904081376290 140305891886384108 142435215842805186 147141020482961557 16014850887196140...

output:

63628383529967709
299

result:

points 1.0 M = 299

Test #41:

score: 70
Accepted
time: 0ms
memory: 3784kb

input:

2 100
8683327277022804 11525898743460835 21889838648491707 22672985361995142 22871403829960514 26185108082514386 32278252100720302 33089530954981957 40328531272599111 50378942708165318 52742999006847442 58686369529165391 59657257882342356 75920087864374263 77612399236626250 79374212457599324 9623783...

output:

40066697874077492
299

result:

points 1.0 M = 299

Test #42:

score: 70
Accepted
time: 1ms
memory: 6012kb

input:

2 100
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 482771 482772 482773 482774 482775 482776 482777 482778 482779 482780 482781 482782 482783 482784 482785 482786 482787 482788 482789 482790 482791 482792 482793 482794 965533 965534 965535 965536 965537 9...

output:

482739
299

result:

points 1.0 M = 299

Test #43:

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

input:

2 1500
1618213394018307 1726930763754608 2124196573509900 3188921652963049 5833539893163331 6250580943582345 8009567796404888 8108094926328577 8945400972051512 9068415002879990 9271557812428261 9341188699880057 9859270332344853 10606266273849543 11273652445272988 12445096047739936 13345617466280107 ...

output:

4966493272906105
4499

result:

points 1.0 M = 4499

Test #44:

score: 70
Accepted
time: 0ms
memory: 5880kb

input:

2 1500
423747667147233 1561287032774385 2815102099958249 2952899121610206 4640725990792096 5567835982926405 5959730234172331 6248117786743912 6405494934002246 6629771121755127 6875079844550057 6982182413663121 7694307063121361 7873901115883013 8269828576806131 8941612085736550 8993641910826693 10809...

output:

4541692825618767
4499

result:

points 1.0 M = 4499

Test #45:

score: 70
Accepted
time: 1ms
memory: 5972kb

input:

2 1500
64452176748519 1374238003151922 1481992832337076 1607611500442259 2524275411594920 2819805885128544 2999188890512186 3582137882865248 3714829534718349 3760219840453438 4193234657878435 5073579666080273 5329403710938273 5333319328123345 5417167916136217 5563144406337463 5672112941300640 627477...

output:

4642293045041442
4499

result:

points 1.0 M = 4499

Test #46:

score: 70
Accepted
time: 1ms
memory: 5824kb

input:

2 1500
324495733956306 332471995186936 1058899393043155 1314847657762888 1526581777794606 2625690753986526 2946426278678007 3064028147086651 3478433600054624 4490997176023002 4670521435154482 5418343765305672 5494527866902768 5746595830756539 6127626432201785 6434483331246781 7417569222871253 813523...

output:

6122034287537034
4499

result:

points 1.0 M = 4499

Test #47:

score: 70
Accepted
time: 1ms
memory: 6008kb

input:

2 1500
5829742 7847985 9866228 11884471 13902714 15920957 17939200 19957443 21975686 23993929 26012172 28030415 30048658 32066901 34085144 36103387 38121630 40139873 42158116 44176359 46194602 48212845 50231088 52249331 54267574 56285817 58304060 60322303 62340546 64358789 66377032 68395275 70413518...

output:

2018243
4499

result:

points 1.0 M = 4499

Test #48:

score: 70
Accepted
time: 10ms
memory: 4064kb

input:

2 25000
112605853915943 125305907674152 144506263929928 145048005466654 186625763697557 250970014919178 272013066291825 277464146092542 315028577810248 324826653633832 331628639654030 366116577518536 393799455295566 457306447540263 537970740820978 545132699389716 602258814216849 630828934540371 6329...

output:

410686271327381
74999

result:

points 1.0 M = 74999

Test #49:

score: 70
Accepted
time: 6ms
memory: 6012kb

input:

2 25000
53697824651228 59941694110355 105281841854384 140773815786506 195080124596830 205602872513176 232550393702661 250839320965836 357336305944960 445772327889742 458411558573039 480097388109225 589547835152279 654519812791613 657909554075110 658074250564130 660528980346543 681471369638132 706174...

output:

430267194921600
74999

result:

points 1.0 M = 74999

Test #50:

score: 70
Accepted
time: 6ms
memory: 6156kb

input:

2 25000
236383646331590 309738640102496 415679754080064 451409199781921 458344303144135 473319547754108 481873731528972 560017045057239 703680773731679 714643104611577 746043561795946 771747078040695 776656199478820 789505769224804 797742246243146 837185561400326 890024880459743 918825337944933 9516...

output:

487268024112545
74999

result:

points 1.0 M = 74999

Test #51:

score: 70
Accepted
time: 10ms
memory: 5912kb

input:

2 25000
52783945537122 62819045853889 103029326755590 127343774652669 145637982794158 212055356045416 335256425611226 451536398811681 453303675422389 475376257071292 489441103616660 533619294493363 562495294237103 572516073983838 583118994056080 619557063671801 625182087503880 692493046036241 716280...

output:

599893247137814
74999

result:

points 1.0 M = 74999

Test #52:

score: 70
Accepted
time: 4ms
memory: 4172kb

input:

2 25000
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 ...

output:

482739
74762

result:

points 1.0 M = 74762

Test #53:

score: 70
Accepted
time: 34ms
memory: 6556kb

input:

2 100000
3977422187752 9172657585884 24850889798563 26187011217882 31651873376550 75673343339240 79205495884761 88387369684010 105989931083541 141113143182522 143101275900551 148426692305199 150824146224816 176873845082992 202163514907605 213337134915131 214840001575911 221606598395231 2293864027207...

output:

130710364094545
299999

result:

points 1.0 M = 299999

Test #54:

score: 70
Accepted
time: 38ms
memory: 6268kb

input:

2 100000
13262637344137 25327517069541 37585568091323 38365340074891 47727605278793 58706463955550 61784803233883 80374709463294 87412393644839 88101573585840 90609123343133 101420152174745 105940140827265 106131254494335 115396943403518 132897981932105 156021235615380 164076967932544 16943555464990...

output:

120119470217307
299999

result:

points 1.0 M = 299999

Test #55:

score: 70
Accepted
time: 38ms
memory: 6136kb

input:

2 100000
18832120122902 29507339632281 39898560623404 40778639373134 41910660835777 43088996832597 51347744889484 56014606055243 90815300081822 108951223881642 112329690251402 116131225732135 121551899536730 127626505168556 147850636284574 148528364776400 157535250520691 173227762441871 191532776595...

output:

131100462117639
299999

result:

points 1.0 M = 299999

Test #56:

score: 70
Accepted
time: 38ms
memory: 6216kb

input:

2 100000
6181561812375 6378266039481 17448377100925 23317298637346 24337449409681 26044481406381 32692256431578 37974050602069 56379269012502 62795819601065 71760296467148 78440221129293 78930025852339 80931924595168 83701405144700 86908947992706 88064472595619 103912708748713 107984687050829 109849...

output:

147711566772217
299999

result:

points 1.0 M = 299999

Test #57:

score: 70
Accepted
time: 42ms
memory: 6016kb

input:

2 100000
5829742 7847985 9866228 11884471 13902714 15920957 17939200 19957443 21975686 23993929 26012172 28030415 30048658 32066901 34085144 36103387 38121630 40139873 42158116 44176359 46194602 48212845 50231088 52249331 54267574 56285817 58304060 60322303 62340546 64358789 66377032 68395275 704135...

output:

2018243
299999

result:

points 1.0 M = 299999

Test #58:

score: 70
Accepted
time: 34ms
memory: 6360kb

input:

2 100000
535929232534 21492335528903 25556131309717 28889553256515 38280084435606 57205171519054 63131861600620 78001720289062 80340150523608 83049214992797 84430304388156 102774222420109 112544520828566 117204763271484 147765688281362 153490305322347 153616558263633 155397223860355 165839368261394 ...

output:

162924923640912
299999

result:

points 1.0 M = 299999

Test #59:

score: 70
Accepted
time: 34ms
memory: 6164kb

input:

2 100000
9057012105366 20678972320055 21561791756347 39835717708647 54928587965288 55153553053797 68595004021437 81018678910692 97365149371768 103887761862034 115587676356349 130903585150729 133639436033175 141700198339591 159584386350410 172139818896137 173902145536266 183123687931554 1855949817876...

output:

117217672541541
299999

result:

points 1.0 M = 299999

Test #60:

score: 70
Accepted
time: 38ms
memory: 4568kb

input:

2 100000
7697039304820 22564329077790 23102661676835 30879851103816 41796239317938 52087405646978 59030372710103 68926959255910 71706259524723 83233183164047 83415881967147 100648405518975 120970003699941 139103178498777 143930857549424 145210161583126 165760166063479 168852347637729 181589636505000...

output:

109432203596644
299999

result:

points 1.0 M = 299999

Test #61:

score: 70
Accepted
time: 40ms
memory: 6384kb

input:

2 100000
39366590558911 39585546629301 66569120610179 81894310350738 87175880111275 89442953960573 96350792731838 102015133304594 104040476597055 137132585901068 147415403324850 157386830894481 171251327732554 177384689100207 178816731020000 184834516398044 190021715201563 205391984563936 2070227259...

output:

123267759045505
299999

result:

points 1.0 M = 299999

Test #62:

score: 70
Accepted
time: 20ms
memory: 6300kb

input:

2 100000
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100...

output:

482739
296862

result:

points 1.0 M = 296862

Test #63:

score: 70
Accepted
time: 1ms
memory: 5884kb

input:

2 118
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 62 68 81 108 163 273 494 937 1824 3599 7151 14255 28465 56886 113728 227414 454787 909533 1819027 3638015 7275993 14551950 ...

output:

500000000000000000
353

result:

points 1.0 M = 353

Test #64:

score: 70
Accepted
time: 1ms
memory: 6012kb

input:

2 118
1 500000000000000001 750000000000000000 874999999999999999 937499999999999998 968749999999999997 984374999999999996 992187499999999995 996093749999999994 998046874999999993 999023437499999992 999511718749999991 999755859374999990 999877929687499989 999938964843749988 999969482421874987 9999847...

output:

500000000000000000
353

result:

points 1.0 M = 353