QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#820717#9848. Paid Leaveucup-team902AC ✓22ms4852kbC++20985b2024-12-18 23:52:442024-12-18 23:52:45

Judging History

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

  • [2024-12-18 23:52:45]
  • 评测
  • 测评结果:AC
  • 用时:22ms
  • 内存:4852kb
  • [2024-12-18 23:52:44]
  • 提交

answer

#include <bits/stdc++.h>
using namespace std;
void solve() {
    long long n, m, x, y;
    cin >> n >> m >> x >> y;
    x = x + 1, y = y + 2;
    vector<long long> p(m + 2);
    p[0] = 0;
    p[m + 1] = n + 1;
    for (int i = 1; i <= m; ++i)
        cin >> p[i];

    long long s = 0;
    long long a = -1;
    for (int i = 0; i <= m; ++i) {
        long long b = p[i];
        long long c = min(a + y, b + x);
        long long d = b + y;
        long long r = p[i + 1];
        a = b;

        if (c < r) {
            s += (r - c - 1) / y + 1;
            c += (r - c - 1) / y * y;
            a = max(a, c);
        }

        if (d < r) {
            s += (r - d - 1) / y + 1;
            d += (r - d - 1) / y * y;
            a = max(a, d);
        }
    }
    cout << s << endl;
}
int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    int T = 1;
    // cin >> T;
    while (T--) solve();
    return 0;
}

这程序好像有点Bug,我给组数据试试?

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 0ms
memory: 3612kb

input:

8 0 3 3


output:

2

result:

ok single line: '2'

Test #2:

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

input:

11 1 2 4
6

output:

2

result:

ok single line: '2'

Test #3:

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

input:

17 2 5 7
6 12

output:

1

result:

ok single line: '1'

Test #4:

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

input:

30 2 5 6
7 21

output:

5

result:

ok single line: '5'

Test #5:

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

input:

38 1 6 6
20

output:

8

result:

ok single line: '8'

Test #6:

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

input:

1000000000000000000 200000 335 557
100001107740026995 100006839102156826 100022686256019614 100026614627087325 100028132190673912 100028139572417710 100034215622293235 100034900480199246 100036139505369203 100044008392310726 100044464248012860 100048368217638304 100053064689708568 100060255356679151...

output:

3577817531189003

result:

ok single line: '3577817531189003'

Test #7:

score: 0
Accepted
time: 8ms
memory: 3796kb

input:

359425126796044126 68013 72652123 104564477
12364747588532 15686712628578 18813370684281 25724948758873 44798252398370 46102702267960 47217527349110 48844320792601 54754265123103 54806360671978 62305720129343 63581566857034 65595780369827 70008379838832 70267866349567 73221506834291 75195943248778 7...

output:

6874665214

result:

ok single line: '6874665214'

Test #8:

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

input:

262596908761956329 168384 3636195729392389 4701187958082704
180856665012 2046521914925 4435875568321 7791606316598 7967918469337 10759374091980 13334965697210 13808557560157 14413058365948 15227606613351 15400179661925 16056774911176 16373092992406 16928423852148 17030158634019 20292485890472 215947...

output:

0

result:

ok single line: '0'

Test #9:

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

input:

182120752693123471 24446 5222 5444
10378437090275 11172570340677 22619272427490 28237570137025 32399061878139 40124230809350 66379513233883 73089169763850 75431308592943 88100676178136 96539264171131 99867522582249 105515696857693 116232680791280 134767581061788 139536195601494 141852652699289 14927...

output:

66882391718207

result:

ok single line: '66882391718207'

Test #10:

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

input:

618640706630768198 37828 924861983 1094084390
55588491214423 62355560535287 67750392137064 109318266217100 123464566398720 125659489407376 129347610524196 133193174843679 146627311659270 151005616010720 179065907374332 184701092167211 202528392053602 261456340065691 286222110380541 294706290720884 3...

output:

1130857948

result:

ok single line: '1130857948'

Test #11:

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

input:

881476573578831848 80000 44 79
72555691666351 77509757815395 77773472573826 85373990157744 105001415881452 120852205497925 133665977400854 148581475247014 154517553727045 154666328655777 158259473705257 167507631093982 168213472450675 171392265103406 180888502239034 184443004586547 186042947889942 1...

output:

21764853668568234

result:

ok single line: '21764853668568234'

Test #12:

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

input:

948792564573514502 80345 30 48
12219747242920 17356669824583 44069602100732 46377973555898 53345896270231 54805430465936 73797431460064 111520238316524 112122519910031 116081664232229 123444299301663 130982470457732 133685472691747 138570742852228 159540354743259 161368560794681 167481361723269 1697...

output:

37951702582891448

result:

ok single line: '37951702582891448'

Test #13:

score: 0
Accepted
time: 14ms
memory: 4088kb

input:

163909913845761226 128089 31568399 43751342
172575303713 3000457788686 3443571216852 6041654468031 6336287956263 7556706050361 8287340699183 11407915310552 15290759349375 16657391431982 18364662349755 18420051226665 18425441071023 20408417671615 20700764746286 21088661317622 21972011597907 223623682...

output:

7492712704

result:

ok single line: '7492712704'

Test #14:

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

input:

822899442500504878 194280 212635219453755143 379406979582891623
4775543983333 6791130266043 8631669216886 10093958291364 17653425498000 18295115670980 20977690939535 21337408539340 24508835889976 24520168455661 29475287800429 32023984008155 35484089213461 37439633876412 49612832954591 55041446601056...

output:

0

result:

ok single line: '0'

Test #15:

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

input:

96714032625698 24908 2863972027 2953205775
3308322170 5226111003 10797112295 18784108258 19822274598 30036705431 35535085260 38627912190 39662892043 51595495720 64489456745 66160370686 72413953194 78807937797 91378943741 91420659440 92238411576 93246917089 99853219993 101077681500 108948890860 11063...

output:

49943

result:

ok single line: '49943'

Test #16:

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

input:

169 3 16 26
35 105 143

output:

9

result:

ok single line: '9'

Test #17:

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

input:

306 23 13 20
3 23 29 33 67 79 81 84 85 89 93 108 113 150 166 168 186 189 211 212 245 266 272

output:

16

result:

ok single line: '16'

Test #18:

score: 0
Accepted
time: 17ms
memory: 4388kb

input:

47068761889208183 161631 42164418634 57749164246
323588936409 459190426757 594613056665 1287335372887 1395342146866 1556600544184 1939005844997 2234039862941 2844174625765 2905944541617 3384822970590 3953486117420 4166297457888 4206584397299 4241601292960 4268922330815 4339357464597 4660447927297 49...

output:

1528075

result:

ok single line: '1528075'

Test #19:

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

input:

30 3 8 15
10 27 28

output:

2

result:

ok single line: '2'

Test #20:

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

input:

230139667889709 140511 454059413 618147327
3907065618 3930556610 4233636571 4690661390 12995546974 13557207227 15075444276 16704142277 18415905760 22841691881 24082622049 25347413381 25712230868 30509796594 35783071041 37407465384 37411516778 39944239772 42260968171 44631433274 44927225548 464085699...

output:

657380

result:

ok single line: '657380'

Test #21:

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

input:

25745839358475954 129360 21387037534 25564520912
95346702917 131666169818 141339963167 165949673344 903984795740 1010405517379 1089856406571 1449548876690 1458143471489 1802105103000 1917505322647 1957338365277 2441703843517 2538801573859 2580333918790 3126248660846 3318594344648 3347470876904 39828...

output:

1929608

result:

ok single line: '1929608'

Test #22:

score: 0
Accepted
time: 14ms
memory: 4560kb

input:

13061306488076 153849 34959776 60602444
6810743 10530459 181327191 402480339 436519548 696874171 736464686 783035402 821316768 827004735 933278149 1026341292 1046777989 1100226815 1324529340 1618239301 1620284521 1829340398 1864972743 1924256817 2161230649 2285344893 2371724504 2412998270 2526199337...

output:

349143

result:

ok single line: '349143'

Test #23:

score: 0
Accepted
time: 22ms
memory: 4780kb

input:

1000000000000000000 199984 59 89
1392043484371 3774291509023 3880275353624 21138298694198 33633666060409 45682547880528 48171088596841 49654253279951 50409217429172 58932674345741 63832542576504 64531979969971 68581739068996 71471409248752 71815611575264 78497563942933 78570944302446 83032448375242 ...

output:

21978021977897119

result:

ok single line: '21978021977897119'

Test #24:

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

input:

1000000000000000000 199947 62 119
1768143964670 3551818283253 4417874115465 8632437464920 11167140437906 12441209858164 19311369703150 27432778562883 30180972948862 64083673275342 66930106105287 68783632713372 73536860547263 81549965503053 88075401898461 95213659819398 101535599446473 10375403546286...

output:

16528925619729160

result:

ok single line: '16528925619729160'

Test #25:

score: 0
Accepted
time: 22ms
memory: 4780kb

input:

1000000000000000000 199914 49 76
5310954831666 9686731572776 12061010528745 18372313562762 24579325382939 33008685549901 34439497754326 41811739285845 44530097521226 51631571257496 53922597763424 54810436287001 62422818828130 70348082074187 84828307401187 84914386996864 88083743204125 10162042787878...

output:

25641025640902369

result:

ok single line: '25641025640902369'

Test #26:

score: 0
Accepted
time: 14ms
memory: 4684kb

input:

1000000000000000000 199949 1690052 1774021
5850465264181 7720490744452 9519727141271 14527626378312 22470967929082 29559521461733 35017561475483 45923638705651 46529614128701 47143236294837 48255979746878 56334117617889 67545905625843 68252693336724 74281867574025 78783369155692 80692317859551 83519...

output:

1127380966058

result:

ok single line: '1127380966058'

Test #27:

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

input:

1 0 1 1


output:

0

result:

ok single line: '0'

Test #28:

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

input:

2 0 1 1


output:

1

result:

ok single line: '1'

Test #29:

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

input:

2 0 1 2


output:

1

result:

ok single line: '1'

Test #30:

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

input:

1 1 1 2
1

output:

0

result:

ok single line: '0'

Test #31:

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

input:

2 2 1 1
1 2

output:

0

result:

ok single line: '0'

Test #32:

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

input:

1000000000000000000 0 1 1


output:

666666666666666666

result:

ok single line: '666666666666666666'

Test #33:

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

input:

1000000000000000000 0 1 2


output:

500000000000000000

result:

ok single line: '500000000000000000'

Test #34:

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

input:

5 4 1000000000000000000 1000000000000000000
1 2 4 5

output:

0

result:

ok single line: '0'

Test #35:

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

input:

5 1 500000000000000000 1000000000000000000
3

output:

0

result:

ok single line: '0'

Test #36:

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

input:

1000000000000000000 199937 1504701 1997473
11561451796378 14430187380139 16423020464303 17734759862264 18678931246571 19467388505317 32602064077409 37884398858603 43797911697710 53567794306235 66343560073989 68500499450604 76591106085137 76929118621007 78962083561165 80693607913764 83627001753863 89...

output:

1001263966378

result:

ok single line: '1001263966378'

Test #37:

score: 0
Accepted
time: 22ms
memory: 4660kb

input:

1000000000000000000 199959 1089475 1893638
7754838734611 17449221347557 32406000789471 37496884320420 41243645091595 44363311511716 48044844615673 49009903291505 51147114330869 58218184109035 58512609502650 69354850004179 69809457024083 71513812318108 84464451142228 89010331597606 93197850965454 103...

output:

1056166846191

result:

ok single line: '1056166846191'

Test #38:

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

input:

1000000000000000000 199949 3229440727775 3643019740087
22513008746949 23069062883041 26164141466776 26975022842714 28590935830562 30870041789826 36399580751296 51531622370934 56119055988345 60149231328008 60982333162701 74917642353839 75196611787598 75988695523210 77788504111561 81292644258984 92226...

output:

424790

result:

ok single line: '424790'

Test #39:

score: 0
Accepted
time: 22ms
memory: 4708kb

input:

1000000000000000000 199905 3538923840370 6271274485369
5329967357530 8856096673095 17855369934992 18542641748287 21240635197775 30000948014274 33771165928346 34208160730199 39852774177080 50536035661978 54976484611998 55542577659119 55835793779785 57524155087895 60759725726162 67196320251787 6960278...

output:

219181

result:

ok single line: '219181'

Test #40:

score: 0
Accepted
time: 22ms
memory: 4708kb

input:

1000000000000000000 199956 3522274097203 4701199120463
2746558202561 13049869619879 16215094951483 27207197864006 37204844800107 43988498519692 52635436161855 74742515034238 74891613588750 78916538528949 79949631449838 85404947126844 97806426458246 99067826970318 112149287955476 112762741935347 1162...

output:

306700

result:

ok single line: '306700'

Test #41:

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

input:

1000000000000000000 100 1728306 2599044
11996847154642428 12087605526407024 20518444469636121 25563403156596850 26065534691577653 38243221746888430 77515816822994851 86457146386952196 108995570511172836 113214920692949906 124218753627601096 139598144731092081 146637898927971415 158220994072786870 16...

output:

769513121294

result:

ok single line: '769513121294'

Test #42:

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

input:

1000000000000000000 100 1431443 1712318
3228568841288096 5280520284951630 7058415258544990 9187921169852088 16348445760520954 31056137292136166 35855051174006532 42722999685481660 53061469975930758 86400712837417250 94109315299701392 98333812005596645 106190731848877900 113117241146918898 1289318024...

output:

1168005980129

result:

ok single line: '1168005980129'

Test #43:

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

input:

1000000000000000000 100 1174762 1891779
11616811726399784 24742031147488419 33326211585969817 46818539927769481 52525893411127849 53451810523760566 68074717599426285 81875310264807963 109492976324715957 123138890515361629 134755949595628968 145570612550304179 156946595815425640 163127791070556070 16...

output:

1057204824393

result:

ok single line: '1057204824393'

Test #44:

score: 0
Accepted
time: 19ms
memory: 4824kb

input:

1000000000000000000 199906 1234567 1234567
1731818490801 2122807652085 6736036960556 12927436934877 18826295352394 34307858707399 37337021260245 40452754693506 49817096344510 50366812225110 56821799348163 60851825722095 62867305791124 64631921750179 75433611988435 80207943996474 87238064243938 98313...

output:

1619998425032

result:

ok single line: '1619998425032'

Test #45:

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

input:

1000000000000000000 199991 1234567 2469134
6280610355519 15906769305529 21365794686592 24186088343943 27021020313261 28704076929298 31522118949484 42490635317097 42824572021342 48004868495661 49523894791526 50680040830506 55507784162387 56539457043467 60105462866064 60451862107886 61188588946907 621...

output:

809999835301

result:

ok single line: '809999835301'

Test #46:

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

input:

200000 200000 134 191
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...

output:

0

result:

ok single line: '0'

Test #47:

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

input:

10 10 134 191
1 2 3 4 5 6 7 8 9 10

output:

0

result:

ok single line: '0'

Test #48:

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

input:

840761157363669040 174 546605067911748 750396926178795
10332189812832358 11932140136734135 21152651031857350 22702326943137281 29209152438589745 41659057507735876 44743873491781355 47789635892953403 50447744265370836 59728593216689825 59911321104694047 60105974188290993 77002512541558093 77306075814...

output:

2134

result:

ok single line: '2134'

Test #49:

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

input:

79573069671956483 174 114007625 210710069
75720009541528 79421439338662 92080821186751 317143776822336 706731608519858 730263062216363 808573562873746 1460776366703072 1464732766008796 2293933911411311 4095954196988451 4125742927859673 4310921111013938 4597744530175896 5075651290699043 5701815174467...

output:

755284824

result:

ok single line: '755284824'

Test #50:

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

input:

376698978431729568 174 15 21
1719752919887528 4602948539675789 5036859451995575 5363477163127639 6437879335814540 7795179862065102 8935901473541292 10035275876991869 10283012166743229 11668866594768807 12836444500414840 13369963442698542 16035835054750929 24731662954097051 28967649198448587 30063542...

output:

32756432907106805

result:

ok single line: '32756432907106805'

Test #51:

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

input:

459005690724361261 174 1652 3042
2463758135008105 4253723265723222 6968029119221207 9335756721474367 10470907765581374 11232287948796586 15239230715100851 15846025160785950 16272970321940501 22316057550800146 27723654293499328 36143192146801943 36709422619275299 39085880846724634 39614689229943935 4...

output:

301580611513944

result:

ok single line: '301580611513944'

Test #52:

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

input:

22931396418858020 199941 79340070399 130564324373
55562319434 230872235990 301044358558 349345893309 381279899279 410054478793 655772931940 695353518783 703438087947 784511589013 865918633646 983949312747 1133878471479 1165761769205 1194733781987 1643031323289 1675070951846 1752348234931 18805356202...

output:

246999

result:

ok single line: '246999'

Test #53:

score: 0
Accepted
time: 22ms
memory: 4780kb

input:

501994612762131995 199941 704547 850961
3135085965446 6100314324886 7087368482662 8290643306518 8645497667199 12247156501734 12675545796671 15723518065691 20928810105973 22000080063613 22843516375994 24499414083271 26806032858414 28226436292637 30217573200892 32689442706535 35692707626796 3779204074...

output:

1179826990159

result:

ok single line: '1179826990159'

Test #54:

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

input:

431567252694888425 199941 14 14
2135137912239 3987912156405 4692655099786 10218502389185 10226444263525 10787038752526 11393749843772 12372481071013 13465615143101 18697305588804 20674363557990 24223328092084 32154571655807 32776105639795 37017942593529 38569079193891 39102590215463 40007909901226 4...

output:

53945906586721067

result:

ok single line: '53945906586721067'

Test #55:

score: 0
Accepted
time: 19ms
memory: 4848kb

input:

693838084964846677 199941 1976 3950
7865038929426 10587229082143 13409865998060 15210758656638 16097612000549 16269853836592 20462158829028 24433688270737 31456288360612 33916667790376 35966990542215 46995352440132 47980914757117 49827511474036 50001344474999 54307705858966 54559914798003 5560282067...

output:

351132633993361

result:

ok single line: '351132633993361'

Test #56:

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

input:

909715298762869476 111 301257104451232 440530234531731
122602586604262594 122602586604262595 122602586604262596 122602586604262597 122602586604262598 122602586604262599 122602586604262600 122602586604262601 122602586604262602 122602586604262603 122602586604262604 122602586604262605 12260258660426260...

output:

4128

result:

ok single line: '4128'

Test #57:

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

input:

204614057120218427 111 402173483 584643937
56796224964206492 56796224964206493 56796224964206494 56796224964206495 56796224964206496 56796224964206497 114603576824674924 114603576824674925 114603576824674926 114603576824674927 114603576824674928 114603576824674929 114603576824674930 1146035768246749...

output:

699961267

result:

ok single line: '699961267'

Test #58:

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

input:

51052015968614451 111 13 19
10295206968930624 10295206968930625 10295206968930626 10295206968930627 10295206968930628 10295206968930629 10295206968930630 10295206968930631 10295206968930632 10295206968930633 10295206968930634 10295206968930635 10295206968930636 10295206968930637 10295206968930638 10...

output:

4862096758915649

result:

ok single line: '4862096758915649'

Test #59:

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

input:

298762833375454921 111 1772 2341
2312766115340563 2312766115340564 2312766115340565 2312766115340566 2312766115340567 2312766115340568 2312766115340569 2312766115340570 2312766115340571 2312766115340572 2312766115340573 77110623143946237 77110623143946238 77110623143946239 77110623143946240 77110623...

output:

255025892766069

result:

ok single line: '255025892766069'

Test #60:

score: 0
Accepted
time: 16ms
memory: 4708kb

input:

111058503562218248 199990 361927070238 382375669757
40819589760283 40819589760284 40819589760285 40819589760286 40819589760287 40819589760288 40819589760289 40819589760290 40819589760291 40819589760292 40819589760293 40819589760294 40819589760295 40819589760296 40819589760297 40819589760298 40819589...

output:

577149

result:

ok single line: '577149'

Test #61:

score: 0
Accepted
time: 16ms
memory: 4848kb

input:

530019334723686142 199990 694737 765506
201545180699662 201545180699663 201545180699664 201545180699665 201545180699666 201545180699667 201545180699668 201545180699669 201545180699670 201545180699671 201545180699672 201545180699673 201545180699674 201545180699675 201545180699676 201545180699677 2015...

output:

1384751912137

result:

ok single line: '1384751912137'

Test #62:

score: 0
Accepted
time: 16ms
memory: 4824kb

input:

574500293264026672 199990 19 35
303689972818663 303689972818664 303689972818665 303689972818666 303689972818667 303689972818668 303689972818669 303689972818670 303689972818671 303689972818672 303689972818673 303689972818674 303689972818675 303689972818676 303689972818677 303689972818678 303689972818...

output:

31054069906150810

result:

ok single line: '31054069906150810'

Test #63:

score: 0
Accepted
time: 16ms
memory: 4680kb

input:

839741985805566684 199990 1385 2033
269401581002372 269401581002373 269401581002374 269401581002375 269401581002376 269401581002377 269401581002378 269401581002379 269401581002380 269401581002381 269401581002382 269401581002383 269401581002384 269401581002385 269401581002386 269401581002387 26940158...

output:

825299248946106

result:

ok single line: '825299248946106'

Test #64:

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

input:

438119715388537493 176 1331624249883785 1912296141697000
9561480708485011 17217143407932582 19526002191405285 19526002191405286 19526002191405287 23154580478304023 24486204728187809 24486204728187810 25497724378369891 26698312529123386 29508057147584899 29674396595264021 34830613128541811 4118293932...

output:

363

result:

ok single line: '363'

Test #65:

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

input:

767744142823670452 176 1489732812 1648093788
2748804541433511 6187403905827412 7896615605935773 17288434637160824 17802827623971907 17802827623971908 17931176224055739 19521756485066109 20946068067607833 45432417188902874 48825632994601545 51782159981139075 57513335728072896 60710388358268816 675203...

output:

931675207

result:

ok single line: '931675207'

Test #66:

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

input:

517591748616812914 176 18 20
637884789008011 4541419347741695 4969372064768959 4969372064768960 5442024505051356 5455022781966342 5455022781966343 5862661948611199 7202082699345559 11249287178917145 12204629093834293 12338881297022877 20705389400167665 20705389400167666 21561921425815140 21929264813...

output:

47053795328801061

result:

ok single line: '47053795328801061'

Test #67:

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

input:

594202715436445837 176 1722 1872
2067788666593932 11044600176713080 11044600176713081 12421407025747267 17416430823393378 19089088404505578 19089088404505579 21749960144754841 26337778148579530 27025379399183087 28822387662740013 32999622568206640 34925742519773496 36479042137876044 3862305691772073...

output:

634154445503041

result:

ok single line: '634154445503041'

Test #68:

score: 0
Accepted
time: 19ms
memory: 4620kb

input:

510472130177097469 199916 1261965343589 1647473432513
1 2 3 3294946865033 3294946865034 3810485910682 8237367162579 13695326505772 16474734325154 16474734325155 24326593398805 27370183447415 27840787987357 27840787987358 29973565315574 33918477639089 34893074065474 34893074065475 36540547497990 3780...

output:

513451

result:

ok single line: '513451'

Test #69:

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

input:

141220818992684624 199916 299659 515622
229726298450 420734053011 771620553723 1257801907699 1257801907700 1707949178097 1864009484809 1864009484810 1924510226850 1924510226851 2128069816444 2360452787636 2360452787637 3073794872933 3575807479722 3767803685490 4273571832391 6328273144383 63402959491...

output:

547766555224

result:

ok single line: '547766555224'

Test #70:

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

input:

654564702720342589 199916 18 33
132062960495 5179639510560 5179639510561 8964288755425 10251895360026 10251895360027 15269627090698 24947997825459 26403665843681 31263373943361 31851209518840 32425112682976 34716574453530 34716574453531 37087246293151 46313228385751 47629108060301 47629108060302 491...

output:

37403697298195003

result:

ok single line: '37403697298195003'

Test #71:

score: 0
Accepted
time: 22ms
memory: 4612kb

input:

641148891707365209 199916 1771 2949
15443671668165 15443671668166 15744478121923 21038097825400 24542845698234 26715608243824 26715608243825 27322849345162 27322849345163 31455319466294 33228175364147 37969462445994 37969462445995 47660625116704 47660625116705 49548363123116 54744600763832 599075918...

output:

434529916330393

result:

ok single line: '434529916330393'

Test #72:

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

input:

461060435816199851 185 2207482734940666 2323748370952701
2325959248819355 2325959248819356 8567874344634430 11620952732630168 13944701103582871 13944701103582872 14444211601130869 14444211601130870 17258877604018715 19582625974971418 21415456713988979 21415456713988980 22044643914917775 237392050849...

output:

260

result:

ok single line: '260'

Test #73:

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

input:

831698984627108861 187 1266522203 1881613715
5664525449016479 8926255787093054 15880610912357413 20667349654174431 23899008041825912 23899008041825913 24148839922255134 26295446943861395 26295446943861396 30752355968576460 34842584672134943 34842584672134944 36648270423396882 43183730150223341 49328...

output:

884027210

result:

ok single line: '884027210'

Test #74:

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

input:

805925429568734349 187 18 29
5389501526928939 6300265352208049 10503345235628376 10503345235628377 14120891692774356 21123032344467400 21123032344467401 21751749861739372 22403322093605787 24446092692358607 27204697422108291 28999240983088639 34428945154207112 37941240187320834 40864086488557175 408...

output:

51995189004434333

result:

ok single line: '51995189004434333'

Test #75:

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

input:

671553411078171593 187 1950 2421
1360131630473864 1801611042445110 3044301213017107 3044301213017108 23703633543161240 25577114634781279 28395397009525166 32159238819572823 32159238819572824 32693287330406442 32943454082765779 35012772254661342 35012772254661343 41106232103977555 43412312418097759 4...

output:

554315650910441

result:

ok single line: '554315650910441'

Test #76:

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

input:

741003315987736129 189713 3127839240918 5778622030068
2352504207384 5480343448303 8131126237454 8131126237455 17012822439584 22791444469654 22791444469655 28068855600069 36975316871058 36975316871059 40548622871389 40548622871390 42692512022584 48471134052654 63156217353713 63156217353714 6535941307...

output:

137713

result:

ok single line: '137713'

Test #77:

score: 0
Accepted
time: 22ms
memory: 4676kb

input:

487565411915248660 199949 870479 1058548
3344546061847 4799705107447 7952214145897 7952214145898 12225013801291 15252741336098 15252741336099 17784152421220 18019975131670 18531991532470 18531991532471 19590228668471 20347783151621 21324901608971 21324901608972 22197420594917 22450401342317 27482720...

output:

921194711935

result:

ok single line: '921194711935'

Test #78:

score: 0
Accepted
time: 19ms
memory: 4660kb

input:

543115151908494224 199949 17 34
7096696467488 7646769972314 10736288741978 10736288741979 10858531253821 15218055357001 19546559609227 22908044974021 22927439267917 22927439267918 26361782223617 31107174936779 36816385074491 36816385074492 38340189581037 38953631678127 38953631678128 38973961650811 ...

output:

30173063994773070

result:

ok single line: '30173063994773070'

Test #79:

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

input:

54133771122003993 199949 1005 1290
111784495417 201565932928 201565932929 578016370795 665885997519 822817274923 1047300579819 1058039415083 1262300880917 1694504214771 1781665801953 1781665801954 1798566227900 3134622657868 3555434918396 4138462633974 4281651783354 4281651783355 4660175801760 47385...

output:

83798407157549

result:

ok single line: '83798407157549'

Extra Test:

score: 0
Extra Test Passed