QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#811810#2176. Snowballsichengzhou#100 ✓154ms11472kbC++171.2kb2024-12-13 01:45:122024-12-13 01:45:13

Judging History

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

  • [2024-12-13 01:45:13]
  • 评测
  • 测评结果:100
  • 用时:154ms
  • 内存:11472kb
  • [2024-12-13 01:45:12]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
const int N=2e5+5;
typedef long long LL;
int n,m;
LL a[N],w[N],ans[N];
struct node{
    int i;
    LL d;
    bool operator <(const node &t)const
    {
        return d<t.d;
    }
}b[N];
int main()
{
    cin>>n>>m;
    for(int i=1;i<=n;i++)
    {
        cin>>a[i];
    }
    for(int i=1;i<=m;i++)
    {
        cin>>w[i];
        w[i]+=w[i-1];
    }
    for(int i=1;i<n;i++)
    {
        b[i]={i,a[i+1]-a[i]};
    }
    sort(b+1,b+n);
    int j=1;
    LL mn=0,mx=0;
    for(int i=1;i<=m;i++)
    {
        if(w[i]>mx)
        {
            while(j<n&&b[j].d<=w[i]-mn)
            {
                ans[b[j].i+1]-=mn;
                ans[b[j].i]+=b[j].d+mn;
                j++;
            }
            mx=w[i];
        }else if(w[i]<mn)
        {
            while(j<n&&b[j].d<=mx-w[i])
            {
                ans[b[j].i+1]+=b[j].d-mx;
                ans[b[j].i]+=mx;
                j++;
            }
            mn=w[i];
        }
    }
    while(j<n)
    {
        ans[b[j].i+1]-=mn;
        ans[b[j].i]+=mx;
        j++;
    }
    ans[1]-=mn;
    ans[n]+=mx;
    for(int i=1;i<=n;i++)
    {
        cout<<ans[i]<<'\n';
    }
    return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Subtask #1:

score: 33
Accepted

Test #1:

score: 33
Accepted
time: 0ms
memory: 5672kb

input:

3 2000
-13285512001 107049481011 962796126480
409354526
207089328
-892257157
-257225467
2373896326
197366364
93722810
-2869757400
-1766447235
6504807072
-7374657037
-35354007
8106006914
405112795
-8883467444
9089120022
367203349
273416542
177046230
-10095309043
-1051955703
-323641104
-5777467
-76872...

output:

560847591622
486219618967
928102774708

result:

ok 3 lines

Test #2:

score: 33
Accepted
time: 2ms
memory: 7712kb

input:

20 2000
-356782371368 -295176335617 -206126616895 -113597968223 -52176008191 -22549142313 -4132043344 3527767144 101799274299 177568591698 255082836997 341209460706 383704468371 409821598016 446695581572 476216794784 543207968505 545545797888 569436860125 628063926949
-24177308
45213212
79110428
211...

output:

82028168319
73880534008
91424943198
77694850220
45827549106
23381586674
13096941716
52036894119
87349193506
76658926563
81607009045
65590645449
34460779676
31479151713
33210461302
48221166743
34336196913
13421641237
40766516548
78366049306

result:

ok 20 lines

Test #3:

score: 33
Accepted
time: 2ms
memory: 7768kb

input:

200 2000
-921138433473 -917280171022 -914157226416 -907362431228 -901088965108 -892453252281 -887191066298 -883863903946 -875232872979 -866493151330 -862180318474 -858976018570 -854878436579 -849854106907 -845601086381 -840503016000 -832340346513 -831900311895 -826487230187 -822004695700 -8160667520...

output:

7106417654
3533366544
4842785268
6511317653
7447650491
7021656075
4373100237
5830304850
8673184789
6616599280
3809402518
3628335699
4544073211
4635548895
4693344968
6563552070
4512263606
2755777627
4946208398
5140837138
7253155680
6829422325
6503899876
5146506292
2319356603
2135695832
4133270871
574...

result:

ok 200 lines

Test #4:

score: 33
Accepted
time: 0ms
memory: 7788kb

input:

2000 2000
-87203006859 -86579549970 -85922705537 -85421269317 -85400036584 -84842629512 -84841726776 -84138967472 -84135420215 -83655956369 -83579472354 -83362216629 -82976497433 -82047427582 -81590407800 -81432946321 -80493603767 -79868773285 -79671795413 -79519510362 -78809679241 -77933094961 -773...

output:

803092531
639678137
580467781
279272741
267649512
298516641
339009557
365407667
225700331
292607426
139479141
299940318
657212727
685746302
320153334
542129570
776431907
420841345
178661415
421442444
796353699
709465404
604263720
538552185
276382841
351040560
450079643
187263290
310010480
465704346
...

result:

ok 2000 lines

Test #5:

score: 33
Accepted
time: 2ms
memory: 5720kb

input:

2000 2000
354190187139 354194687386 354197218843 354203807584 354213643633 354215514741 354222181159 354230536450 354234433529 354239558978 354240526626 354245093944 354247506357 354255216102 354264819196 354270942264 354279981691 354280673954 354280776443 354283266876 354285003929 354289649619 3542...

output:

7413264
3387095
4576330
8185928
5869379
4292617
7460292
6214517
4566819
2956083
2857006
3382659
4995576
8741929
7871299
7552822
4878513
389717
1289136
2093413
3313476
5313346
5366652
4191825
3834043
4216491
5694554
6245450
2928321
2004008
5158211
6297793
4485740
3881140
2714448
1565221
1398309
48701...

result:

ok 2000 lines

Test #6:

score: 33
Accepted
time: 2ms
memory: 5748kb

input:

2000 2000
89415001842 89415046549 89415104558 89415162609 89415169198 89415212016 89415254864 89415330984 89415372384 89415381818 89415401522 89415403964 89415433847 89415487329 89415583062 89415667144 89415711279 89415747061 89415823185 89415848082 89415858434 89415864228 89415914759 89416013106 89...

output:

71137
52552
58025
31306
24428
42825
61307
57076
25540
14761
10468
16829
41733
75718
89988
62400
40852
56832
49128
17521
7700
28502
75263
92843
76808
50888
45595
39422
25194
60194
81726
66915
62259
66276
83494
91659
69985
34589
24614
45501
69763
87855
88616
78985
52743
30191
31660
64952
66733
37681
6...

result:

ok 2000 lines

Test #7:

score: 33
Accepted
time: 2ms
memory: 5728kb

input:

2000 2000
562410979442 562410987330 562410993138 562410996773 562410997481 562411002183 562411003198 562411011387 562411018118 562411019915 562411026471 562411030821 562411040499 562411046304 562411049434 562411057029 562411057306 562411059989 562411061029 562411070021 562411073889 562411083355 5624...

output:

8891
6720
4835
2197
2693
2898
4583
7380
4417
4005
5536
7050
7575
4630
5331
3906
1562
1856
5010
6388
6742
8467
5714
6113
8083
8264
6753
4033
5560
8532
6815
6019
3654
1301
4426
7110
4891
2961
2568
1503
1604
4072
6242
5913
6065
3776
1900
1617
2972
4622
3992
6469
7597
8067
4901
2798
2658
593
3312
3340
4...

result:

ok 2000 lines

Test #8:

score: 33
Accepted
time: 2ms
memory: 5720kb

input:

2000 2000
546765610003 546765614107 546765616591 546765618815 546765621959 546765622241 546765624606 546765627941 546765628058 546765629852 546765634764 546765638479 546765639549 546765641239 546765641725 546765646495 546765647600 546765651616 546765654835 546765656554 546765659218 546765659611 5467...

output:

4525
3256
2416
2608
1750
1329
2812
1787
972
3351
4249
2429
1436
1021
2658
2931
2541
3574
2572
2109
1557
255
1638
2072
2762
3273
936
1170
3551
3585
1994
789
2296
2556
2604
4345
2816
1452
2353
1981
2088
2350
740
2131
3790
4146
4111
2946
2789
3342
3932
3040
2157
2188
1519
1280
1124
1536
1366
1868
3017
...

result:

ok 2000 lines

Test #9:

score: 33
Accepted
time: 2ms
memory: 5720kb

input:

2000 2000
404415039639 404415040485 404415041192 404415041471 404415041564 404415042353 404415043170 404415044157 404415044903 404415045180 404415045420 404415045739 404415046725 404415047109 404415047248 404415048091 404415048504 404415048579 404415049332 404415049339 404415049928 404415050466 4044...

output:

922
778
497
185
438
800
906
867
514
257
283
648
690
259
485
635
240
413
370
303
569
490
274
241
272
288
615
768
819
666
415
437
301
262
443
781
897
822
845
870
918
779
448
422
436
271
439
816
921
797
461
399
489
658
922
843
551
355
474
544
573
529
713
959
941
682
398
355
639
444
18
199
317
234
446
6...

result:

ok 2000 lines

Test #10:

score: 33
Accepted
time: 2ms
memory: 5680kb

input:

2000 2000
-461844103657 -461844103656 -461844103652 -461844103644 -461844103636 -461844103630 -461844103620 -461844103612 -461844103606 -461844103604 -461844103595 -461844103593 -461844103584 -461844103578 -461844103571 -461844103565 -461844103558 -461844103552 -461844103551 -461844103541 -461844103...

output:

7
2
5
8
7
8
9
7
5
4
7
4
8
6
7
6
7
5
4
8
5
3
8
7
5
2
3
4
1
2
4
5
6
8
3
2
1
2
9
8
5
2
4
7
8
6
3
5
8
10
7
4
7
8
4
5
5
7
5
7
7
9
7
3
5
5
3
6
3
4
4
7
5
7
6
3
4
8
9
9
9
10
7
4
3
2
6
8
6
5
2
4
4
8
7
8
8
7
5
8
6
7
6
5
7
4
7
6
7
7
8
5
8
8
7
7
6
1
5
7
3
9
6
2
6
3
2
7
6
10
7
3
8
6
2
8
9
7
4
7
4
4
4
8
7
5
7
8
4...

result:

ok 2000 lines

Test #11:

score: 33
Accepted
time: 0ms
memory: 7696kb

input:

2000 2000
228747903581 228747903582 228747903583 228747903584 228747903585 228747903586 228747903587 228747903588 228747903589 228747903590 228747903591 228747903592 228747903593 228747903594 228747903595 228747903596 228747903597 228747903598 228747903599 228747903600 228747903601 228747903602 2287...

output:

1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
...

result:

ok 2000 lines

Test #12:

score: 33
Accepted
time: 1ms
memory: 5620kb

input:

3 3
-521966674540 -230288341367 210773828837
291678333173
149383837031
-441062170207

output:

291678333176
441062170204
441062170204

result:

ok 3 lines

Test #13:

score: 33
Accepted
time: 1ms
memory: 5680kb

input:

20 20
-844959868165 -838549702001 -740142913904 -646051587081 -607233531378 -544844846693 -532085870801 -522382063879 -436138884105 -418562374129 -401408135228 -357890343258 -315622035843 -255712796229 -188884108380 -122927484364 -49670389672 -15591108708 8766324221 45263094698
6410166161
-970380692...

output:

76084097501
28732856767
94091326823
83222916809
38818055705
55249865372
12758975888
27711036247
73053484537
17154238901
19897795205
43517791970
42268307415
64349242778
65956624016
73257094692
60067399458
34079280964
24357432929
54001926993

result:

ok 20 lines

Test #14:

score: 33
Accepted
time: 1ms
memory: 7708kb

input:

200 200
-188123975516 -182064957061 -175564425824 -174345467136 -166448874284 -157834744076 -150863000842 -143579964730 -134630456592 -125502693520 -117644984185 -114481219904 -105217303166 -98594161767 -95858748617 -87173201661 -79977966054 -76588124205 -72467488728 -64654201407 -60624503452 -55840...

output:

8103975373
6214007214
4170574758
4015123820
8381544507
7878170951
6973922864
8302694859
8990568646
8276988272
5805372268
6113818345
7953787834
4860228124
5505990252
7880350581
5504343449
3693824584
5673067350
6189362950
4412612535
4771991750
3965463961
2232859756
4818650088
6447211779
4299788861
751...

result:

ok 200 lines

Test #15:

score: 33
Accepted
time: 2ms
memory: 5800kb

input:

2000 2000
-12028114135 -11556150171 -10742204452 -10523234059 -9598382645 -9247326426 -8767418617 -7843265100 -7617833906 -7321242153 -7085937744 -6599653894 -6187791860 -5275297867 -5103814702 -4619859142 -3783255181 -3249444672 -2521734160 -2403342487 -1468465323 -1149034730 -787464423 89624830 71...

output:

733239596
642427655
526661363
569141511
634422358
414168719
706526468
576048399
260214734
268429700
355613993
448194721
664281754
541327817
325990460
657203749
689169719
630313934
421145662
531011288
625513494
337581151
622997411
750359164
695842030
516309846
178958089
336479014
592330237
590616178
...

result:

ok 2000 lines

Test #16:

score: 33
Accepted
time: 0ms
memory: 7808kb

input:

2000 2000
-377428421523 -377339035064 -377292589970 -377272966117 -377187353590 -377137422194 -377051866309 -377027216760 -376933716092 -376890747708 -376813341784 -376741426776 -376728109166 -376651617963 -376571679618 -376551703329 -376539438216 -376498462002 -376446692064 -376366566288 -376301416...

output:

94342625
67465053
33089179
52821999
67443577
68043906
54939239
59710187
67136967
60595840
74544439
42875288
44787362
78560811
49533611
16409592
26382231
46233385
66408140
71912486
58900051
50104768
57515770
78076832
80777347
65625218
44738983
40637260
43640194
59417794
63333649
54318967
69681066
586...

result:

ok 2000 lines

Test #17:

score: 33
Accepted
time: 0ms
memory: 7748kb

input:

2000 2000
10996423994 11076546815 11118599868 11153569587 11163912471 11184265784 11230355346 11287474306 11301668195 11336209963 11345175627 11354141291 11374494604 11431613564 11451966877 11462309761 11482663074 11562785895 11604838948 11613804612 11659894174 11680247487 11714789255 11725132139 11...

output:

90599972
61861474
38213650
23379684
15220152
32809720
51227882
36648400
23599363
22281505
8965664
14696286
37948040
39524233
15476045
15220152
49166830
61861474
25770261
27152693
33633155
26882954
23134859
44033669
51309304
27066080
57070469
46432036
9489530
25248456
60314400
57838945
34541768
38564...

result:

ok 2000 lines

Test #18:

score: 33
Accepted
time: 1ms
memory: 9760kb

input:

1 1
0
0

output:

0

result:

ok single line: '0'

Test #19:

score: 33
Accepted
time: 0ms
memory: 7744kb

input:

2000 2000
-1000000000000 -999999999057 -999999997966 -999999996674 -999999995151 -999999993857 -999999993035 -999999991059 -999999989817 -999999989624 -999999987882 -999999986935 -999999986073 -999999984780 -999999983300 -999999982942 -999999982521 -999999981446 -999999980159 -999999979286 -99999997...

output:

0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
...

result:

ok 2000 lines

Subtask #2:

score: 67
Accepted

Test #20:

score: 67
Accepted
time: 56ms
memory: 5676kb

input:

3 200000
-156569451094 248189336031 548174789683
-4485706
8485150
13337402
12540754
8075444
-51693482
-5728069
-1118827
61979505
1317375
3545147
-73741130
-1197753
78071111
1787486
4367796
-99992360
-491715
-6864397
111050656
3367774
5965916
929587
-123736857
-1959520
-13263378
-9315679
-3810664
156...

output:

701532933638
351584060513
651622936938

result:

ok 3 lines

Test #21:

score: 67
Accepted
time: 52ms
memory: 5664kb

input:

20 200000
-675085555792 -634718457628 -552311526488 -512545133662 -506086780996 -417976961735 -359193682837 -277145430531 -213476433458 -179453672483 -122759686507 -90202201486 -74698779181 18264925770 70610180875 160603223141 211238113725 232564685523 311154102506 360576744949
1536022
-1838763
-201...

output:

70171845637
61376175470
61114808084
23156418002
47202819573
73437882007
70434058712
72877077625
48908109292
45273242696
44699189235
24102276344
54120416203
72672640076
71111358440
70327210623
36129187159
49850566976
63962089746
74734435722

result:

ok 20 lines

Test #22:

score: 67
Accepted
time: 49ms
memory: 7704kb

input:

200 200000
-787162347912 -778336424885 -774196211252 -767788142680 -767178166848 -765671874639 -763061270072 -756945704680 -753135677400 -743969981274 -736282190987 -728447851670 -728042262252 -723094240379 -714634783279 -707447624715 -701195412872 -693218994228 -688620287597 -686560763004 -68535952...

output:

9412157510
6473899031
5277575584
3502318367
1056768026
2063639764
4366822301
4962941547
6491900842
8431415055
7760698734
4107143029
2677665556
6712319481
7817465159
6718488463
7123496734
6275351729
3327300280
1633332349
4831595063
8264529265
6461740170
4100923361
4213385065
7406684831
8352639511
807...

result:

ok 200 lines

Test #23:

score: 67
Accepted
time: 46ms
memory: 5716kb

input:

2000 200000
-562166072741 -561180790897 -560987462070 -560768111336 -559774416721 -558918741542 -558597788745 -558357084228 -558089331975 -557859225334 -557506710453 -557499843687 -556506266476 -555975468394 -555088671514 -554483778845 -553490072509 -552913418357 -552146375077 -551991912520 -5516391...

output:

992759450
591198260
206319426
604615732
925325822
589346519
281024524
254033299
249169935
291068039
180763516
497487631
764806543
706315990
747318601
797681012
787344346
671234315
461495849
252953108
208755750
205612431
339876014
564015812
885215318
780139504
359204252
124783430
197653218
286129547
...

result:

ok 2000 lines

Test #24:

score: 67
Accepted
time: 45ms
memory: 8136kb

input:

20000 200000
-558690628250 -558681949989 -558629087406 -558571558390 -558509465843 -558467168509 -558451209865 -558358294642 -558320238951 -558230456699 -558207419177 -558155320563 -558146578101 -558092262121 -558090869756 -558080311541 -558066878791 -558066297920 -557987320621 -557975921809 -557970...

output:

54350961
30796855
55136532
59810739
52306714
29104986
54325469
65585694
63826175
56571640
37500480
30371734
31544875
27847666
5955861
12013726
7008896
39730954
45201250
8628549
42582717
43035761
45082644
49909894
36610901
69809017
77271221
47323828
30922797
52091794
32841096
35844102
58557910
611766...

result:

ok 20000 lines

Test #25:

score: 67
Accepted
time: 124ms
memory: 11424kb

input:

200000 200000
-391630298899 -391624570720 -391618221396 -391615107577 -391605184983 -391596010812 -391589746258 -391584168087 -391576901961 -391570497599 -391567966219 -391565262351 -391559831745 -391554840617 -391552481791 -391551493032 -391546110318 -391544611506 -391539839654 -391536642853 -39153...

output:

7872328
6033060
4730990
6513017
9550154
7724451
5927029
6412972
6836498
4462823
2617498
4081724
5213357
3656164
1667057
3208728
3423278
3154691
3975736
4399942
4302336
2330768
2932670
6022360
5362821
1549915
1544835
3672160
5318304
4939130
6278700
4444756
944194
1637663
2711654
5029580
6392482
42127...

result:

ok 200000 lines

Test #26:

score: 67
Accepted
time: 118ms
memory: 11364kb

input:

200000 200000
128604908420 128605262270 128607793310 128610995138 128612190567 128612931463 128615958503 128616876367 128621704005 128625088876 128625837858 128629089372 128629834580 128631239807 128634716054 128635600788 128639224986 128640015512 128641574488 128646043243 128649462873 128654246872 ...

output:

2669373
1439572
2869761
2195934
968779
1883939
1971706
2881272
4100146
2065520
2000996
1997674
1076916
2441042
2177565
2256807
2205315
1176223
3015309
3943450
4106448
3426336
3068008
2160841
444730
998183
3050811
3126151
1640089
1201751
1440429
1240439
881233
1003346
1815454
3537098
3034966
3223420
...

result:

ok 200000 lines

Test #27:

score: 67
Accepted
time: 118ms
memory: 11424kb

input:

200000 200000
627164019389 627164269201 627164715250 627165335522 627165473173 627165600583 627165994024 627166642548 627167156033 627167806847 627167813165 627168259294 627168592635 627169264309 627169949403 627170358554 627170588955 627171304130 627171846524 627172272998 627173205093 627173593293 ...

output:

624826
346915
532854
380341
132355
259373
520517
582144
581102
330523
224794
389896
501860
678607
547525
320315
471996
628835
484427
679590
659753
204473
352840
707575
566106
344535
331824
302757
295126
666528
525420
134567
390132
765632
525603
202651
501859
750983
789875
611975
669063
627922
515763...

result:

ok 200000 lines

Test #28:

score: 67
Accepted
time: 122ms
memory: 11436kb

input:

200000 200000
-943434948903 -943434692341 -943434465668 -943434390747 -943434322248 -943434202625 -943434173587 -943434046757 -943433609869 -943433529259 -943433069021 -943432751634 -943432705812 -943432355540 -943431940495 -943431593127 -943431471101 -943431205194 -943430799422 -943430632901 -94343...

output:

378898
241402
151189
71660
94220
73962
78183
281227
259467
269831
388838
181919
197613
382664
381218
235274
194000
335242
286625
245034
200137
82051
153458
290727
428440
444817
227809
33145
221577
351597
375374
466542
274574
233354
227321
218671
363843
355582
190689
112055
334135
380728
266620
22793...

result:

ok 200000 lines

Test #29:

score: 67
Accepted
time: 110ms
memory: 11436kb

input:

200000 200000
452407618440 452407669026 452407697449 452407740288 452407770276 452407785061 452407800830 452407844881 452407871714 452407876266 452407975028 452408017712 452408031461 452408092893 452408138369 452408169289 452408224144 452408255501 452408333561 452408333835 452408347916 452408397749 ...

output:

75275
39413
35753
36275
22450
15248
30013
35315
15738
51734
70722
28159
37670
53444
38047
43030
42967
54879
39029
7213
32017
31224
49018
57132
59043
74297
44082
15197
37272
43110
47111
76704
57269
34317
58684
67097
28628
23001
28799
32005
64022
47845
23521
40658
51018
67086
62544
29605
52932
80759
5...

result:

ok 200000 lines

Test #30:

score: 67
Accepted
time: 103ms
memory: 11380kb

input:

200000 200000
-21468096475 -21468096284 -21468095557 -21468095130 -21468094683 -21468094145 -21468093889 -21468092916 -21468092446 -21468092275 -21468092146 -21468091164 -21468090736 -21468090216 -21468090198 -21468089436 -21468088487 -21468087933 -21468087014 -21468086117 -21468085771 -21468085130 ...

output:

589
468
582
440
494
379
620
738
300
146
564
712
482
255
386
856
764
720
910
631
496
583
276
429
743
659
484
529
856
843
664
496
625
483
529
782
563
365
484
398
178
397
676
514
456
784
622
453
598
508
324
524
780
700
294
133
460
679
737
951
797
491
304
328
411
237
155
142
517
677
675
786
340
561
764
...

result:

ok 200000 lines

Test #31:

score: 67
Accepted
time: 94ms
memory: 11368kb

input:

200000 200000
264361719789 264361719791 264361719799 264361719806 264361719810 264361719815 264361719825 264361719826 264361719828 264361719836 264361719838 264361719847 264361719853 264361719863 264361719867 264361719869 264361719870 264361719880 264361719890 264361719894 264361719903 264361719911 ...

output:

6
4
8
6
4
8
6
1
4
6
5
8
8
7
3
2
5
10
7
6
8
10
8
5
2
4
7
7
9
7
5
2
3
6
2
5
9
7
4
2
2
5
7
3
3
6
6
8
6
10
7
2
4
4
2
3
7
10
7
6
7
2
5
6
3
8
8
8
9
7
5
10
10
6
3
5
5
6
3
8
7
5
2
4
9
8
6
3
5
1
5
9
8
4
2
3
6
1
6
7
4
6
4
2
2
4
6
2
3
2
2
4
3
6
7
5
2
2
4
7
7
7
7
7
4
6
7
5
7
6
7
2
4
6
1
4
7
5
6
6
3
5
7
5
4
2
3
...

result:

ok 200000 lines

Test #32:

score: 67
Accepted
time: 95ms
memory: 11436kb

input:

200000 200000
-403639766802 -403639766801 -403639766800 -403639766799 -403639766798 -403639766797 -403639766796 -403639766795 -403639766794 -403639766793 -403639766792 -403639766791 -403639766790 -403639766789 -403639766788 -403639766787 -403639766786 -403639766785 -403639766784 -403639766783 -40363...

output:

1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
...

result:

ok 200000 lines

Test #33:

score: 67
Accepted
time: 14ms
memory: 6084kb

input:

20000 20000
-812649458266 -812555534327 -812544401411 -812528232777 -812466067413 -812423957797 -812367097298 -812274308832 -812259228617 -812164371982 -812092782562 -812000668650 -811993328566 -811893468349 -811880162141 -811823226012 -811768913339 -811683718227 -811596426898 -811538397321 -8114930...

output:

97053468
52815304
13549392
39283329
51846615
49495132
74872467
54045609
54845323
83356309
81792170
49793163
53293540
56940412
34886747
55726885
69797227
86271512
72600832
51609040
62082305
88355057
72587252
45546377
41605819
29578983
22939139
30575739
44531789
61913973
59246963
34700193
54682467
894...

result:

ok 20000 lines

Test #34:

score: 67
Accepted
time: 120ms
memory: 11408kb

input:

200000 200000
-713217515751 -713207910672 -713199347922 -713193543998 -713186663499 -713179202676 -713176267007 -713174737501 -713170487479 -713162076533 -713157834665 -713152911638 -713146347616 -713144680094 -713135655472 -713126967721 -713117011498 -713108015871 -713102518586 -713100522978 -71309...

output:

9897128
9088660
7190028
6363056
7183862
5183073
2197530
2909695
6336386
6321958
4586847
5750961
4100921
5313941
8870822
9321561
9458970
7275305
3742505
2191374
3271493
2406498
4328825
4202758
803612
2022189
6024154
7967457
6618589
6564780
4129863
4331954
7173158
3974958
2436112
5191974
7843209
94373...

result:

ok 200000 lines

Test #35:

score: 67
Accepted
time: 114ms
memory: 11376kb

input:

200000 200000
758540773374 758541653418 758542116017 758542429851 758542708664 758543043899 758543883351 758544639218 758545397548 758545749478 758546473920 758546524309 758546841912 758547355007 758547940218 758548895672 758549160628 758549232899 758550147729 758551017312 758551252018 758551652734 ...

output:

942345
673432
391673
296305
306143
583721
799610
756887
555268
538178
386752
187018
411857
551002
765872
615291
164967
492290
892969
554680
317970
620787
425828
419335
843592
852897
819027
598073
666435
550498
373776
470622
596634
576905
358138
477940
300212
501177
785335
744264
774815
602432
285493...

result:

ok 200000 lines

Test #36:

score: 67
Accepted
time: 122ms
memory: 11376kb

input:

200000 200000
-322646231003 -322641455451 -322641312978 -322634105501 -322628724553 -322621518966 -322618679039 -322618497492 -322610738202 -322602354238 -322596120609 -322590291443 -322582977765 -322577491050 -322569200000 -322562382616 -322557157511 -322553465853 -322552244924 -322546827629 -32253...

output:

7397126
2456781
3667791
6299168
6288180
5036027
1504375
3962994
8074624
7314295
6033797
6562850
6404631
6882706
7555113
6030472
4462502
2455910
3311187
7023107
7503236
6923511
7192708
4713874
4470151
4145155
5519647
9379007
8434390
7620074
4588673
4524423
7392611
4746658
5246366
8184986
8862822
5603...

result:

ok 200000 lines

Test #37:

score: 67
Accepted
time: 117ms
memory: 11376kb

input:

200000 200000
-172671174397 -172670820050 -172669871271 -172669466467 -172668484075 -172668375348 -172667618024 -172667174096 -172666685389 -172666102491 -172665247515 -172664490123 -172664288446 -172664193112 -172663959120 -172663162598 -172663067200 -172662738857 -172661837241 -172661832878 -17266...

output:

677063
651280
676794
693976
546389
430976
601115
466118
535985
718878
805752
480809
149225
163926
514378
447575
210890
614440
454906
71360
105681
166731
598102
934244
927742
843347
501795
187782
393923
575796
398665
524573
629551
642118
732638
533778
419346
380663
480732
639672
677426
507401
190596
...

result:

ok 200000 lines

Test #38:

score: 67
Accepted
time: 114ms
memory: 11416kb

input:

200000 200000
478354588691 478355545678 478356249437 478357010323 478357825118 478358096817 478358855309 478359791490 478360570940 478361257788 478361554634 478362259042 478362937535 478363049053 478363583471 478364558293 478364673593 478364681011 478365393442 478365763263 478366190808 478366540825 ...

output:

978237
830718
732748
787625
542973
515434
846827
858424
732733
491950
500639
691221
395634
323246
753641
545831
61386
359669
541048
398606
388945
614816
542515
592743
889022
620311
290407
313036
536585
730378
737802
614082
353076
118988
141743
104170
72043
238671
642347
665961
296270
534644
621227
3...

result:

ok 200000 lines

Test #39:

score: 67
Accepted
time: 110ms
memory: 11472kb

input:

200000 200000
-703199650747 -703199004458 -703198852801 -703198486178 -703198439862 -703197958773 -703197262837 -703196454929 -703195897616 -703195173539 -703194515623 -703193972591 -703193416505 -703192699045 -703192318615 -703192264180 -703191644149 -703191369253 -703190792093 -703190050248 -70318...

output:

824678
398894
260199
205059
265409
586688
751346
683906
640187
691090
601037
549400
636425
550352
215854
337587
447991
425831
658421
837123
789352
583391
568715
660382
574178
362459
297010
507657
682986
337065
40371
42584
465657
854886
856808
919612
681561
318884
164824
255668
355557
316324
219661
5...

result:

ok 200000 lines

Test #40:

score: 67
Accepted
time: 110ms
memory: 11420kb

input:

200000 200000
-809730054194 -809729100726 -809729081162 -809728709896 -809728080361 -809727841005 -809727752274 -809726970433 -809726453611 -809726206971 -809725529134 -809725282494 -809724500653 -809723983831 -809723964267 -809723724911 -809723485555 -809723396824 -809723377260 -809722860438 -80972...

output:

977069
487708
194238
501432
433412
165293
433910
649971
381398
462408
462069
513934
649971
268859
128281
239356
165293
54077
267527
734619
735671
381398
513934
514547
382064
648692
649971
648692
781841
510725
130639
54218
88731
433910
510725
243178
134101
128281
130639
267527
377576
165293
228751
30...

result:

ok 200000 lines

Test #41:

score: 67
Accepted
time: 62ms
memory: 7756kb

input:

1 200000
1000000000000
1000000000000
1000000000000
1000000000000
1000000000000
1000000000000
1000000000000
1000000000000
1000000000000
1000000000000
1000000000000
1000000000000
1000000000000
1000000000000
1000000000000
1000000000000
1000000000000
1000000000000
1000000000000
1000000000000
10000000000...

output:

200000000000000000

result:

ok single line: '200000000000000000'

Test #42:

score: 67
Accepted
time: 99ms
memory: 11428kb

input:

200000 200000
-1000000000000 -999999899871 -999999818120 -999999676049 -999999644935 -999999452426 -999999293017 -999999265654 -999999079234 -999998993517 -999998834764 -999998739154 -999998580101 -999998448323 -999998310316 -999998213030 -999998066254 -999998066184 -999998004710 -999997869508 -9999...

output:

0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
...

result:

ok 200000 lines

Test #43:

score: 67
Accepted
time: 142ms
memory: 11424kb

input:

200000 200000
-1000000000000 -999990000001 -999980000003 -999970000006 -999960000010 -999950000015 -999940000021 -999930000028 -999920000036 -999910000045 -999900000055 -999890000066 -999880000078 -999870000091 -999860000105 -999850000120 -999840000136 -999830000153 -999820000171 -999810000190 -9998...

output:

400008000000
9999999
9999998
9999997
9999996
9999995
9999994
9999993
9999992
9999991
9999990
9999989
9999988
9999987
9999986
9999985
9999984
9999983
9999982
9999981
9999980
9999979
9999978
9999977
9999976
9999975
9999974
9999973
9999972
9999971
9999970
9999969
9999968
9999967
9999966
9999965
9999964...

result:

ok 200000 lines

Test #44:

score: 67
Accepted
time: 67ms
memory: 7728kb

input:

2 200000
-500000000000 499999999999
5000000
-10000000
15000000
-20000000
25000000
-30000000
35000000
-40000000
45000000
-50000000
55000000
-60000000
65000000
-70000000
75000000
-80000000
85000000
-90000000
95000000
-100000000
105000000
-110000000
115000000
-120000000
125000000
-130000000
135000000
-...

output:

1000000000000
999999999999

result:

ok 2 lines

Test #45:

score: 67
Accepted
time: 119ms
memory: 11432kb

input:

200000 200000
-1000000000000 -999998832410 -999993640961 -999985462438 -999982508775 -999978329183 -999973263583 -999971659162 -999967809196 -999959537456 -999949761820 -999946644511 -999937198193 -999934650867 -999931080398 -999924238689 -999922681486 -999914364869 -999912916887 -999904924098 -9998...

output:

999989
999989
999989
999989
999989
999989
999989
999989
999989
999989
999989
999989
999989
999989
999989
999989
999989
999989
999989
999989
999989
999989
999989
999989
999989
999989
999989
999989
999989
999989
999989
999989
999989
999989
999989
999989
999989
999989
999989
999989
999989
999989
999989...

result:

ok 200000 lines

Test #46:

score: 67
Accepted
time: 142ms
memory: 11424kb

input:

200000 200000
-1000000000000 -999989999999 -999980000001 -999969999998 -999960000002 -999949999997 -999940000003 -999929999996 -999920000004 -999909999995 -999900000005 -999889999994 -999880000006 -999869999993 -999860000007 -999849999992 -999840000008 -999829999991 -999820000009 -999809999990 -9998...

output:

999999899999
10000001
9999998
10000003
9999996
10000005
9999994
10000007
9999992
10000009
9999990
10000011
9999988
10000013
9999986
10000015
9999984
10000017
9999982
10000019
9999980
10000021
9999978
10000023
9999976
10000025
9999974
10000027
9999972
10000029
9999970
10000031
9999968
10000033
999996...

result:

ok 200000 lines

Test #47:

score: 67
Accepted
time: 144ms
memory: 11380kb

input:

200000 200000
-1000000000000 -999989999999 -999980000001 -999969999998 -999960000002 -999949999997 -999940000003 -999929999996 -999920000004 -999909999995 -999900000005 -999889999994 -999880000006 -999869999993 -999860000007 -999849999992 -999840000008 -999829999991 -999820000009 -999809999990 -9998...

output:

66666000010000001
9999998
10000003
9999996
10000005
9999994
10000007
9999992
10000009
9999990
10000011
9999988
10000013
9999986
10000015
9999984
10000017
9999982
10000019
9999980
10000021
9999978
10000023
9999976
10000025
9999974
10000027
9999972
10000029
9999970
10000031
9999968
10000033
9999966
10...

result:

ok 200000 lines

Test #48:

score: 67
Accepted
time: 154ms
memory: 11360kb

input:

200000 200000
-1000000000000 -999989999999 -999980000001 -999969999998 -999960000002 -999949999997 -999940000003 -999929999996 -999920000004 -999909999995 -999900000005 -999889999994 -999880000006 -999869999993 -999860000007 -999849999992 -999840000008 -999829999991 -999820000009 -999809999990 -9998...

output:

200000000000000000
10000001
9999998
10000003
9999996
10000005
9999994
10000007
9999992
10000009
9999990
10000011
9999988
10000013
9999986
10000015
9999984
10000017
9999982
10000019
9999980
10000021
9999978
10000023
9999976
10000025
9999974
10000027
9999972
10000029
9999970
10000031
9999968
10000033
...

result:

ok 200000 lines

Extra Test:

score: 0
Extra Test Passed