QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#689728#8597. Запити красот пiдмасивiвPVC100 ✓877ms76284kbC++203.1kb2024-10-30 18:19:532024-10-30 18:19:53

Details

Tip: Click on the bar to expand more detailed information

Subtask #1:

score: 4
Accepted

Test #1:

score: 4
Accepted
time: 877ms
memory: 59900kb

input:

1000000 1000000
548734664 631285694 511074814 185066089 177199147 524740185 143108778 954318193 103939390 194933972 126964310 977448144 188825490 775722231 460775045 254691982 436971964 566341931 148211711 74910105 923734998 440021758 474275150 717904448 680353276 612974499 712145218 300908726 34722...

output:

251801387395338
230985543990378
233364582761908
165509624203582
383254838720986
448483728625094
365779189638223
259921744673457
396032911262151
463175787332481
396490494773605
379294045009719
380905359946099
248640668979163
372751657582612
250611799614193
382671202614963
249747705028859
377678676465...

result:

ok 1000000 numbers

Test #2:

score: 4
Accepted
time: 862ms
memory: 61756kb

input:

1000000 1000000
990113895 993892498 998227668 999901378 999927530 999967151 999984400 999995999 999997829 999997900 999998862 999999773 999999868 999999949 999999971 999999980 999999984 999999997 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 10000...

output:

517388975548697
583250844300324
432944007956879
651986171831501
542238696573424
441761501786754
330123013631473
870241324122629
883396218117077
408105370042427
707816626704213
508232505211911
739818893951077
766666985527682
465224901247448
886122292332962
914658373213235
421779818564551
727905274312...

result:

ok 1000000 numbers

Test #3:

score: 4
Accepted
time: 833ms
memory: 61876kb

input:

1000000 1000000
141598548 830665328 993488224 999755561 999945155 999986513 999989333 999990586 999994476 999997209 999998165 999998359 999998707 999999473 999999852 999999930 999999938 999999963 999999965 999999981 999999996 999999998 1000000000 1000000000 1000000000 1000000000 1000000000 100000000...

output:

356173976182880
480636735678882
715649266153211
296099114480174
495577657145300
880164857057696
360829708390397
893190933168525
659770218871691
260229819810974
825160619301796
709264679095607
588830530083195
520438551091261
655451391395164
578240261246493
212576955707985
725338244461847
416476415692...

result:

ok 1000000 numbers

Test #4:

score: 4
Accepted
time: 853ms
memory: 59964kb

input:

1000000 1000000
777974618 985268992 996078973 997554180 997788695 999658168 999968830 999980473 999998143 999999812 999999826 999999905 999999953 999999974 999999990 999999992 999999996 999999998 999999999 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 100000...

output:

614388727692563
649626175674650
200543340460644
429537231405728
430189231405728
716472378936104
565372458226305
594699593996257
564844859199650
644148647862746
747289687203253
561010517064553
468050674466851
357068282778875
437757064198385
414636189013152
380245538829532
598461229740399
261190443589...

result:

ok 1000000 numbers

Test #5:

score: 4
Accepted
time: 835ms
memory: 59932kb

input:

1000000 1000000
377309365 894144488 921143445 991660683 995450636 995556635 999173866 999401820 999822658 999976711 999993812 999999725 999999817 999999968 999999992 999999996 999999998 999999999 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 10000...

output:

650552155322823
369803954654729
813016884061089
583669437559348
846050884061089
891397884061089
597163155322823
501082437559348
407475954654729
745849437559348
777099884061089
766289884061089
246508728738266
779717884061089
575586954654729
748072437559348
470318708821082
417518708821082
323575954654...

result:

ok 1000000 numbers

Test #6:

score: 4
Accepted
time: 839ms
memory: 59816kb

input:

1000000 1000000
607026608 839552936 931303147 946375702 979264955 989112811 991854785 994078939 997321934 997703417 999932023 999934524 999987158 999987867 999996003 999996883 999997617 999998635 999999062 999999992 999999995 999999997 1000000000 1000000000 1000000000 1000000000 1000000000 100000000...

output:

403158000000000
716622000000000
582130000000000
452232000000000
773107000000000
671339000000000
640401000000000
402688000000000
341097000000000
373220000000000
382028000000000
476739000000000
764869000000000
443808000000000
790093000000000
650563000000000
824479000000000
667243000000000
796546000000...

result:

ok 1000000 numbers

Subtask #2:

score: 14
Accepted

Test #7:

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

input:

1000 1000
-873807720 -737050877 797489760 406646247 -750849890 -581119106 43724194 -931326234 -9389547 -684003608 -926307185 -502569356 -461635706 -238087464 -83909772 -884633970 46721429 -576741985 -323890970 -855342249 -736506813 336516318 -4075924 -782227362 56799828 290931118 -471600723 81594380...

output:

9772834244
7971661681
7251185652
5902581650
12301584130
9137214347
10770040139
9693548841
12636393268
9951777555
8590138425
9126178404
8438322412
10469973494
9585010202
12336530829
12305905331
12818655084
9576894451
9228532410
10060968297
12060843219
8619457836
8862797014
12336530829
6408306273
9621...

result:

ok 1000 numbers

Test #8:

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

input:

1000 1000
692134706 979271447 980370950 994825542 999242327 999523358 999690467 999798408 999882013 999922869 -922596273 -659587774 640420971 986220997 990730649 999401779 999536875 999723478 999763458 999904584 42593372 653970020 930711142 994805382 996905450 997728548 998747773 999933140 999961560...

output:

508001236169
455677156350
464108965476
458984106243
591329464196
544306954522
606712940905
670216620925
467826054462
364402607562
478731198606
441359828061
589114661689
350571309943
538138574474
488313052986
406263573994
550962494917
490268630633
620941260144
452889284903
484667815820
398698987974
3...

result:

ok 1000 numbers

Test #9:

score: 14
Accepted
time: 2ms
memory: 12016kb

input:

1000 1000
580673741 925261058 993980536 997024573 999941913 999972191 999980883 999989783 999992331 999997282 999999063 999999150 999999272 999999338 999999726 999999825 999999870 999999902 999999977 999999989 999999993 999999999 999999999 999999999 999999999 999999999 999999999 999999999 999999999 ...

output:

560539190835
333464742334
628653998632
212079705817
586450009464
766145951766
886930541461
563384169825
438655875762
409072137159
571287452742
482618339702
532034732041
549824903600
640044000756
465785253221
406176201314
846137019311
349834504581
788697842607
451633268981
735398048343
645352016986
4...

result:

ok 1000 numbers

Test #10:

score: 14
Accepted
time: 2ms
memory: 12036kb

input:

1000 1000
113778409 616366980 758104758 774066845 884853572 946156080 949750283 973895123 986390312 994415418 998589686 998642039 999864578 999874539 999920293 999965949 999983998 999992235 999997899 999999234 999999892 999999964 999999978 999999980 999999995 999999999 999999999 1000000000 100000000...

output:

754778196417
695488349209
630480332057
412195393475
782679791114
602689765616
503897653789
488317363014
302782338384
348428051191
752051131798
432518915969
598010108356
663033550477
814335749262
318055380779
445729163692
336288091592
757027035466
821717471601
781958862262
718420655430
423109373010
7...

result:

ok 1000 numbers

Test #11:

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

input:

1000 1000
-353116922 418563102 940826827 988264316 988338236 996408365 999853601 999974320 999993971 999995926 999998121 999999678 999999755 999999806 999999971 999999972 999999984 999999991 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000...

output:

590373117158
732187641017
435372856316
652987578737
733292717761
248304131475
670498858492
259638664362
403406869931
653650856372
852594123641
787243880579
516800698532
428096472909
635223223388
485889309952
727613089170
694882124799
494270857759
434790317099
670088269609
797171569331
631514600863
5...

result:

ok 1000 numbers

Test #12:

score: 14
Accepted
time: 2ms
memory: 12096kb

input:

1000 1000
-221488095 587209633 872267838 890515934 994766025 997079143 998735303 998996787 999170582 999355457 999852598 999940425 999957014 999974875 999983770 999986290 999988558 999994493 999996741 999996805 999999341 999999837 999999856 999999954 999999972 999999976 999999987 999999999 100000000...

output:

622373476144
402153598108
672162651572
646493759749
595493759749
638404656027
692351281790
641769593147
748629283376
776968313017
699353081713
656395292200
334279316100
577911508843
812968313017
433174756274
514589630792
762110228713
321037336729
524645635375
823968313017
675363780989
764534665675
5...

result:

ok 1000 numbers

Test #13:

score: 14
Accepted
time: 2ms
memory: 11968kb

input:

1000 1000
-362722497 324046604 660730013 792835785 960138764 986476487 991231845 999524667 999598449 999843840 999869223 999914357 999934988 999969083 999972358 999998373 999999245 999999467 999999499 999999898 999999971 999999975 999999977 999999995 1000000000 1000000000 1000000000 1000000000 10000...

output:

382332552370
686345331368
424430112355
916112024283
630730004870
308325992400
438430299259
528912353216
896112024283
553216242505
661345331369
139766693095
447227200512
825112024283
799033892170
602150204024
524734124402
300625915893
438377837722
423712731278
557790198467
655345331368
802033892170
8...

result:

ok 1000 numbers

Subtask #3:

score: 10
Accepted

Test #14:

score: 10
Accepted
time: 125ms
memory: 27116kb

input:

200000 200000
580139218 -783262026 565291185 -701435432 -591602198 -342573855 -900284959 -10919966 -682899137 -282058183 963121871 491072571 691886927 761414760 -828585515 888361166 -790814084 145385324 214735368 388759807 -80339362 -975535748 522135695 301673442 36714481 785639770 319723485 1098009...

output:

351460487491
210343422436
312498498649
203192986383
287815765786
245818714404
213968420688
159327542896
169009698075
212975612931
197610853645
255310400798
318802499824
292657635865
313528174745
321957839407
262317902055
187559666100
220264896012
221468083688
294234309666
310907237863
189575747002
1...

result:

ok 200000 numbers

Test #15:

score: 10
Accepted
time: 127ms
memory: 24328kb

input:

200000 200000
216963970 895963907 970921505 973720179 985811250 998640537 999103413 999661484 999729609 999942450 -821783874 781997309 829131735 832477333 892292610 985929024 998231319 999101470 999204347 999373872 473465706 768624229 994843197 999760281 999881158 999973657 999988928 999993358 99999...

output:

112621847444942
101030183697291
63233054628753
80384063266952
115039837711512
95578572948651
143407295417810
60640420205729
72326537106317
97513628293662
111552624754764
88836367993245
60834804129630
81553727338901
100409741576180
65344377179665
95711093922326
112060888712228
73442129454981
65507735...

result:

ok 200000 numbers

Test #16:

score: 10
Accepted
time: 138ms
memory: 26080kb

input:

200000 200000
-824647563 -226311394 73090714 76436719 759867982 803623373 829644660 946127786 957102501 987106779 997539215 999943331 999979160 999991880 999996009 999997678 999999024 999999063 999999274 999999406 999999496 999999684 999999952 999999985 999999992 999999993 999999996 999999998 999999...

output:

107254718306887
59985268718865
160651387958961
113576472431692
94922328063875
159793953406254
103324138822766
134824989111115
123862745746950
169491678824442
91501549032165
99093005632887
139347712481764
122330217459374
84161090195491
89777898364239
162149696406419
120396086999264
88322334520469
615...

result:

ok 200000 numbers

Test #17:

score: 10
Accepted
time: 130ms
memory: 27744kb

input:

200000 200000
-282183530 -94945479 227825325 604182067 992536174 995235520 999623224 999831612 999944208 999969121 999974356 999980957 999988940 999994107 999995968 999998154 999999531 999999584 999999922 999999935 999999969 999999985 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000...

output:

123377619867900
100211431195321
145963538594998
190203444064019
64843966674700
77549625539887
184560557631975
39023969105634
110224991478919
60057393127515
82953877723644
86412104386226
160532783809484
121422800259115
193867540418057
93054646076494
162102767313085
35476495087574
102656767657861
8893...

result:

ok 200000 numbers

Test #18:

score: 10
Accepted
time: 123ms
memory: 26216kb

input:

200000 200000
895486773 904267709 971843319 989242035 997432691 998747539 999923993 999958496 999981782 999997130 999998160 999999003 999999967 999999992 999999996 999999997 999999999 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 100000...

output:

107947399476523
162249388524327
188244246063420
149188588881854
157732011675993
143224891836264
133208454676491
163999809906499
141125758850610
129080307951204
119938099343301
102187458820136
42426020657946
113901944910560
54823208026881
147838531324875
119767412026628
157136338370764
34461988892014...

result:

ok 200000 numbers

Test #19:

score: 10
Accepted
time: 130ms
memory: 25660kb

input:

200000 200000
15691546 982710368 991752623 996635863 999985515 999992516 999995094 999999596 999999991 999999999 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 ...

output:

72523839838926
125348292306559
156051487951881
110134134212103
157069281441772
82917291584024
119805834008914
161199487951881
118949623834329
129858684120921
104031770661480
135286708593556
136516858580023
60306452467633
70864365507686
134657502564275
83413848621308
164520131445345
125642684120921
1...

result:

ok 200000 numbers

Test #20:

score: 10
Accepted
time: 133ms
memory: 24436kb

input:

200000 200000
-90259554 929646040 932381231 965326126 992162797 999519149 999868148 999979048 999996345 999998606 999999942 999999998 999999998 999999999 999999999 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000...

output:

165849002394680
130735002394680
156026002394680
127391002394680
107616002394680
119917002394680
68572000000000
125579002394680
168319002394680
145634002394680
124946002394680
120901002394680
151983002394680
118365002394680
134173002394680
77681002394680
117765002394680
126867002394680
12318900239468...

result:

ok 200000 numbers

Subtask #4:

score: 10
Accepted

Test #21:

score: 10
Accepted
time: 60ms
memory: 24564kb

input:

200000 200000
128744308 920701830 -482412021 59142239 721167306 -622861403 165749748 -449445968 -760679479 -207234657 171482190 -239316743 75518499 -717652242 502074875 -731242646 -183939818 -625333917 -53052313 185734819 -780000096 -563390882 -690210905 596581513 764466021 776717157 -38544163 -7898...

output:

128744308
1049446138
567034117
626176356
1347343662
724482259
890232007
906557623
1347343662
1347343662
1347343662
1347343662
1347343662
1347343662
1347343662
1466264164
1650203982
2275537899
2328590212
2142855393
2922855489
3486246371
4176457276
3579875763
2815409742
2137764691
2099220528
286704480...

result:

ok 200000 numbers

Test #22:

score: 10
Accepted
time: 65ms
memory: 24496kb

input:

200000 200000
-763412911 313139114 535079082 989042081 993109117 995888077 998971206 999773517 999866478 999987134 777032268 990233656 992330606 996752593 998494028 998593842 998945960 999764312 999884287 999976973 653522695 919553000 971305283 988605240 995829044 997504762 999283178 999840628 99997...

output:

763412911
450273797
763412911
1073847366
2066956483
3062844560
4061815766
5061589283
6061455761
7061442895
7838475163
8828708819
9821039425
10817792018
11816286046
12814879888
13813825848
14813590160
15813474447
16813451420
17466974115
18386527115
19357832398
20346437638
21342266682
22339771444
2333...

result:

ok 200000 numbers

Test #23:

score: 10
Accepted
time: 59ms
memory: 25392kb

input:

200000 200000
-825716414 416551232 517318490 714074106 868865237 955360474 973766234 984001767 996937534 999327490 999449772 999632500 999833646 999907522 999933058 999950810 999961227 999993042 999993315 999999589 999999786 999999944 999999987 999999999 1000000000 1000000000 1000000000 1000000000 1...

output:

825716414
416551232
825716414
825716414
1691092651
2646453125
3620219359
4604221126
5601158660
6600486150
7599935922
8599568422
9599402068
10599309590
11599242648
12599193458
13599154685
14599147727
15599141042
16599140631
17599140417
18599140361
19599140348
20599140347
21599140347
22599140347
23599...

result:

ok 200000 numbers

Test #24:

score: 10
Accepted
time: 56ms
memory: 26988kb

input:

200000 200000
-151818563 160849335 914523434 941544657 957339565 971073750 998040223 998195659 999642984 999721721 999812380 999941098 999968574 999985544 999992595 999998006 999999673 999999850 999999978 999999997 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 10000000...

output:

151818563
151818563
923554206
1865098863
2822438428
3793512178
4791552401
5789748060
6789391044
7789112765
8788925145
9788866243
10788834817
11788820361
12788812956
13788810962
14788810635
15788810485
16788810463
17788810460
18788810460
19788810460
20788810460
21788810460
22788810460
23788810460
247...

result:

ok 200000 numbers

Test #25:

score: 10
Accepted
time: 63ms
memory: 27064kb

input:

200000 200000
-209681962 451691484 863486040 885986082 888701465 962559431 981013429 982403304 991652037 999501945 999723427 999924077 999928121 999964867 999985728 999998099 999999676 999999802 999999830 999999830 999999841 999999983 999999995 1000000000 1000000000 1000000000 1000000000 1000000000 ...

output:

209681962
242009522
1105495562
1991481644
2880183109
3842742540
4823755969
5806159273
6797811310
7797313255
8797036682
9796960759
10796888880
11796853747
12796839475
13796837574
14796837250
15796837052
16796836882
17796836712
18796836553
19796836536
20796836531
21796836531
22796836531
23796836531
24...

result:

ok 200000 numbers

Test #26:

score: 10
Accepted
time: 55ms
memory: 24400kb

input:

200000 200000
627252523 979366570 995764806 999831790 999935437 999969851 999979210 999989379 999991613 999995444 999999861 999999970 999999982 999999994 999999997 999999997 999999997 999999999 999999999 999999999 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 100000000...

output:

627252523
1606619093
2602383899
3602215689
4602151126
5602120977
6602100187
7602089566
8602081179
9602076623
10602076484
11602076454
12602076436
13602076430
14602076427
15602076424
16602076421
17602076420
18602076419
19602076418
20602076418
21602076418
22602076418
23602076418
24602076418
25602076418...

result:

ok 200000 numbers

Test #27:

score: 10
Accepted
time: 59ms
memory: 27836kb

input:

200000 200000
826496201 908165650 983143103 989914407 999690455 999884701 999972967 999976620 999990881 999996713 999997865 999999657 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1...

output:

826496201
1734661851
2717804954
3707719361
4707409816
5707294517
6707267484
7707244104
8707234985
9707231698
10707229563
11707229220
12707229220
13707229220
14707229220
15707229220
16707229220
17707229220
18707229220
19707229220
20707229220
21707229220
22707229220
23707229220
24707229220
25707229220...

result:

ok 200000 numbers

Subtask #5:

score: 11
Accepted

Test #28:

score: 11
Accepted
time: 109ms
memory: 24400kb

input:

200000 200000
3 -5 -3 3 3 -5 7 -2 2 -4 -4 9 0 -4 -2 2 -5 7 -2 3 -8 1 6 -7 9 -3 -2 4 -2 -2 3 -2 1 0 -3 6 0 -6 -2 6 -5 6 -4 3 2 -4 5 -2 -8 1 1 2 1 -3 3 5 -9 1 3 -2 0 1 -2 1 2 5 -1 -4 -1 -3 7 -7 7 1 -6 7 -1 -5 1 4 -7 6 -3 -4 -1 4 1 5 -7 -3 9 1 -6 2 -3 1 6 -1 -1 1 -1 -5 -3 9 -5 4 -1 3 -2 -4 -4 8 1 0 -9 ...

output:

9
7
8
7
8
6
5
7
9
9
7
9
6
6
9
6
8
9
9
5
6
7
5
7
6
6
5
7
8
6
6
7
5
7
7
7
5
9
7
6
9
5
8
10
5
8
7
8
5
5
8
7
7
6
6
8
6
6
9
7
8
5
6
5
8
6
6
5
5
9
8
5
7
6
7
7
6
6
5
7
6
6
6
6
6
7
9
9
8
9
7
6
6
9
9
7
8
5
9
6
7
8
9
8
9
9
8
8
5
6
8
8
6
6
6
6
6
5
9
6
6
8
9
5
9
6
6
5
7
5
10
7
5
5
6
8
6
8
7
5
6
9
6
5
10
8
8
6
6...

result:

ok 200000 numbers

Test #29:

score: 11
Accepted
time: 110ms
memory: 27064kb

input:

200000 200000
1 2 -5 0 5 -4 4 -3 -3 0 8 -2 -8 5 2 -6 3 1 -4 9 -8 -2 0 2 6 -2 -6 8 -5 1 4 -5 4 3 -3 -2 -3 6 -5 -1 3 5 -10 9 -3 4 -10 10 -2 -7 9 -6 5 -3 -1 2 -4 -1 0 1 3 2 -5 5 -4 3 2 1 -7 2 -5 7 -2 5 -9 5 0 -1 -4 6 -2 4 -1 0 -3 4 1 -3 2 -5 5 -5 -1 4 -7 3 0 6 -6 -2 8 -4 -3 4 0 -4 1 -2 3 1 4 -8 -1 8 -2...

output:

8
6
7
7
9
10
7
9
8
5
7
5
6
7
8
6
5
7
6
5
8
7
7
9
7
7
5
8
7
9
6
7
5
6
8
5
6
6
8
6
7
7
5
6
5
6
9
6
6
7
7
8
6
7
7
7
8
6
8
9
6
7
8
10
9
6
5
6
6
6
6
6
8
9
6
5
6
6
6
5
5
7
6
7
6
8
7
9
6
9
7
7
6
9
6
7
5
9
5
8
5
9
7
6
6
7
5
8
5
8
9
7
7
7
8
7
6
5
7
7
5
6
6
5
7
5
7
5
5
6
8
7
10
6
7
5
6
6
6
8
9
9
6
6
7
7
6
6
9...

result:

ok 200000 numbers

Test #30:

score: 11
Accepted
time: 111ms
memory: 26968kb

input:

200000 200000
-1 4 -2 -3 7 -3 2 -1 0 -7 0 9 -3 -6 -1 0 3 -1 -2 6 3 -5 0 4 -6 4 -5 6 -7 10 -6 5 1 -1 -5 -2 7 1 -9 0 6 1 -1 -1 -4 3 4 -9 9 -7 1 4 3 -7 6 -5 3 2 -2 3 -4 0 -2 1 1 2 -1 -3 -2 0 -1 9 -3 -7 4 -3 4 5 -3 -6 6 -2 3 -1 -2 -3 -1 3 1 -1 -4 5 0 -4 -1 7 -7 2 0 1 -3 7 -3 -2 2 0 4 -4 4 -2 2 -3 0 -4 6...

output:

9
6
8
6
9
7
8
6
6
9
5
10
9
7
5
6
7
6
5
7
6
6
6
5
7
6
5
6
8
10
7
5
6
7
9
6
9
6
6
8
5
5
8
5
6
7
7
7
5
6
7
7
7
5
5
7
6
6
9
7
7
9
9
9
6
6
5
9
6
7
10
8
7
7
6
10
8
6
6
8
6
5
9
6
7
7
10
6
6
7
5
7
10
8
9
7
8
8
6
7
5
8
5
8
6
5
5
9
5
7
6
8
6
5
9
6
6
8
6
7
5
6
8
6
5
6
6
7
6
5
8
6
7
7
6
8
6
7
9
8
6
7
9
6
8
8
6
...

result:

ok 200000 numbers

Test #31:

score: 11
Accepted
time: 112ms
memory: 25640kb

input:

200000 200000
4 -7 4 -3 -2 5 3 -6 -1 -2 2 7 -3 -2 1 -5 6 4 -1 -3 -6 0 5 -2 -3 0 9 -3 -2 2 -1 -1 3 2 -8 1 6 -3 5 -6 -1 -1 3 -1 2 -3 4 2 -1 -5 -3 0 3 -3 2 3 -4 8 -2 -2 0 -1 1 -3 3 -5 9 -5 0 6 -8 2 -3 0 1 3 0 2 -5 4 3 -3 -5 1 7 -1 -2 -4 -1 6 0 -1 -2 4 -4 -2 -1 8 -1 1 0 0 -9 6 1 -2 3 -2 -3 1 3 2 -1 0 -6...

output:

6
6
6
9
6
6
5
7
6
7
7
9
5
9
5
5
9
6
8
5
9
6
8
7
7
7
5
5
7
8
6
8
9
8
8
8
6
6
5
8
7
9
9
5
6
7
9
5
7
5
8
7
8
6
7
5
8
6
6
8
6
5
10
5
9
8
10
9
8
9
7
9
6
6
6
6
9
5
6
7
7
5
8
6
9
5
6
5
6
7
9
6
7
8
5
9
7
8
7
7
6
5
8
6
8
7
7
8
6
7
8
9
6
6
8
7
6
8
6
7
6
7
9
7
6
9
7
6
6
8
5
6
6
9
10
8
8
7
5
9
9
8
7
6
6
7
8
6
6...

result:

ok 200000 numbers

Test #32:

score: 11
Accepted
time: 110ms
memory: 24340kb

input:

200000 200000
-5 6 4 -7 1 -2 5 -5 7 -6 -2 0 5 2 -2 0 0 -6 1 0 6 1 1 -4 0 3 -2 0 -5 4 -3 0 6 1 -8 4 -4 2 -3 10 -7 5 -3 -4 4 -3 3 -1 1 -5 0 3 7 -10 7 -2 -2 2 -3 3 -4 8 -6 4 -2 3 -4 5 -5 -4 1 -1 9 1 -6 -3 7 -3 -4 3 0 3 -5 0 4 3 -5 -2 1 1 -4 0 3 -2 2 3 2 -7 9 -10 6 -2 6 -8 7 -2 1 0 -5 5 2 -6 5 -1 -5 -1 ...

output:

7
7
5
9
7
7
8
6
6
6
7
7
8
6
7
8
9
7
6
7
10
9
8
5
9
5
8
5
5
6
5
7
6
7
9
8
7
8
8
7
6
7
5
6
7
6
7
6
6
6
6
7
9
9
7
6
5
10
9
7
7
7
10
8
7
8
7
5
5
9
6
7
10
6
6
8
7
9
8
6
7
6
8
9
6
10
8
8
6
5
8
6
5
7
6
7
6
8
5
6
8
7
6
8
7
6
10
9
5
6
6
7
5
5
5
7
7
7
5
9
7
5
9
6
6
5
6
8
6
6
8
6
6
8
7
6
5
9
7
9
5
8
6
7
7
6
5
...

result:

ok 200000 numbers

Test #33:

score: 11
Accepted
time: 111ms
memory: 24520kb

input:

200000 200000
-4 9 -8 1 3 3 -2 -6 2 -2 9 -9 8 -5 -1 6 0 -5 0 4 -3 -5 3 4 -3 -3 5 -5 8 -9 2 5 -7 9 -4 -2 2 -4 8 -4 1 -3 5 2 -9 3 -1 -1 0 2 4 -5 -3 0 0 2 5 -2 2 -6 3 3 1 -1 -3 1 1 4 -4 2 -6 0 8 -10 2 3 -5 10 -2 1 1 -3 -5 6 -5 7 -1 -2 -5 -2 7 -2 1 0 1 -6 9 -5 -3 7 -1 -2 -1 5 -10 1 8 -7 7 -3 -1 3 -4 1 4...

output:

7
8
8
5
6
7
6
8
6
8
6
7
9
7
9
10
8
6
8
7
7
8
6
8
8
9
8
8
5
9
6
7
8
6
5
5
10
5
7
9
5
8
7
8
5
6
7
9
8
5
7
8
5
7
7
7
5
5
7
10
6
9
8
6
6
6
7
5
9
6
8
9
8
5
5
7
7
6
6
6
6
7
6
6
8
7
6
6
6
10
7
6
6
6
7
7
5
5
6
9
6
6
6
7
5
6
10
7
6
6
7
8
6
6
5
6
5
7
7
8
6
7
6
8
10
9
7
6
5
6
9
8
6
7
6
7
6
6
6
8
6
7
6
8
8
8
5
...

result:

ok 200000 numbers

Test #34:

score: 11
Accepted
time: 107ms
memory: 24708kb

input:

200000 200000
-2 5 -6 8 -2 -8 8 -8 2 5 -7 0 8 -1 0 -2 -4 4 -5 1 7 0 -8 6 -5 0 -1 9 -3 2 -8 5 -5 8 -6 8 -2 -2 -6 1 4 0 -5 7 -6 2 2 -2 5 -7 8 1 -6 1 -5 3 6 -8 -1 5 5 -10 5 0 1 0 -1 -2 2 -1 2 3 -9 1 2 -2 2 -3 10 -7 -2 3 2 4 -10 8 -1 0 1 -8 9 1 -9 9 -3 -2 -2 2 -1 -3 4 3 -4 5 1 -7 2 -1 5 -2 1 -7 5 2 2 -1...

output:

6
6
8
9
5
6
5
6
6
7
9
6
5
8
6
6
6
7
6
6
8
6
5
7
9
8
6
7
8
8
5
8
6
8
6
6
10
7
7
6
6
5
5
7
8
6
5
5
9
8
6
6
6
6
6
6
5
9
8
8
6
6
7
6
9
8
5
6
9
6
6
6
7
9
9
9
5
10
5
7
5
7
5
6
6
8
7
6
8
6
10
7
6
5
5
9
6
7
8
5
6
7
7
8
8
7
8
7
5
5
7
8
6
6
7
7
7
7
5
6
6
5
8
6
5
7
5
7
7
7
5
6
5
7
7
7
8
9
5
5
6
8
7
6
8
5
8
5
8...

result:

ok 200000 numbers

Subtask #6:

score: 18
Accepted

Dependency #1:

100%
Accepted

Dependency #2:

100%
Accepted

Dependency #3:

100%
Accepted

Dependency #4:

100%
Accepted

Dependency #5:

100%
Accepted

Test #35:

score: 18
Accepted
time: 131ms
memory: 24684kb

input:

200000 200000
911097195 759666565 -298940681 -461816755 -623482378 895328528 -887424521 -393101952 -134528926 -584733222 -148838492 -519115771 442933330 484531429 -8169453 -328595593 -999140807 97012147 468077762 -221988328 -402012490 -469834203 -828541609 369104454 490953616 915039600 921446710 317...

output:

158106699459
182549111465
119398152137
150984559715
189918759974
171518666001
160745265432
103021767033
169165736154
121604568475
173899491191
180322031063
179557111389
180410325054
137595096782
139068721339
70331468188
181347363487
207353475307
126450393451
218023041918
117595969603
147691487224
13...

result:

ok 200000 numbers

Test #36:

score: 18
Accepted
time: 136ms
memory: 27044kb

input:

200000 200000
-191934978 112540047 488888741 766653489 892385372 923991312 990412585 998858347 998967030 999675710 -462067770 501503098 849825178 937571082 954114470 955797415 962470082 981745288 995150435 997816252 -363874820 573188182 926624861 994091347 999981983 999991516 999996662 999998461 999...

output:

89865403700442
69170962229710
83276525135180
146833054306987
100492921165971
87575045085472
134834628921449
121757991291894
104951646978670
91890351692330
139589862871750
110331401483755
77912063169076
90721258437353
59695041170001
114253582369221
77203127319730
142016226819363
117885864271825
13478...

result:

ok 200000 numbers

Test #37:

score: 18
Accepted
time: 128ms
memory: 26492kb

input:

200000 200000
-986751678 -199921689 248631600 699703890 981898664 982780398 986383820 993142484 997524701 998745296 998817467 999769609 999817740 999951831 999960715 999962814 999981714 999984374 999997154 999997541 999998041 999999900 999999935 999999952 999999956 999999975 999999977 999999983 9999...

output:

133973366779958
170180460910610
86868889435111
80850821345885
62084686704733
167307653816205
143540429165306
113077000490131
161232931878934
97710735116789
117317170590143
87481302171889
142375160638528
113002549135237
58615107955980
174565278908791
150596426294802
136982000966286
139641898041627
13...

result:

ok 200000 numbers

Test #38:

score: 18
Accepted
time: 135ms
memory: 26196kb

input:

200000 200000
-104048669 32361420 621568769 802346229 875671235 990718928 991703905 996592621 998365027 999029977 999615491 999975319 999979124 999983273 999990520 999996592 999998476 999999176 999999624 999999629 999999842 999999952 999999980 999999980 999999982 999999985 999999996 999999996 999999...

output:

152969173780185
93794940621364
95320804779053
171272686026801
100675430864267
105949037241313
83183409526607
123396305863134
73924123990039
126854236175293
131848504591937
77745932155413
149869967459765
96180424789174
150977935874885
108130178559423
96618931826291
115469542995355
141592974546004
155...

result:

ok 200000 numbers

Test #39:

score: 18
Accepted
time: 128ms
memory: 25316kb

input:

200000 200000
-926378367 350757495 353479211 835929285 877499209 933317232 968237812 980199843 995500586 999474300 999890508 999926229 999932185 999942248 999968352 999980380 999990410 999997174 999998145 999998908 999998994 999999920 999999943 999999970 999999978 999999989 999999998 999999998 10000...

output:

174035968215186
137884258490457
99400610984401
106631626709515
101250538583574
161889599363231
113466320868473
81348789229127
127877925495566
163123901660966
119130922963282
158970894970691
118503004696053
96564619149707
178819306720977
117348612078898
154292771825796
106605817081677
143700708394120...

result:

ok 200000 numbers

Test #40:

score: 18
Accepted
time: 134ms
memory: 25976kb

input:

200000 200000
-289205488 328465475 379136476 703747349 924630074 932229892 963498453 974527449 999937706 999971297 999998623 999999933 999999962 999999964 999999987 999999991 999999995 999999998 999999999 999999999 999999999 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 100000000...

output:

138643246579289
146316404386772
107524901883513
150232083938588
78721640919879
101588359500325
76071965088832
125819797571139
132457481979259
159595282276979
145768783278463
146541109314826
153896868206276
87345483996988
82200975179590
182098196817299
84539848586962
154876704356896
130411850937052
1...

result:

ok 200000 numbers

Test #41:

score: 18
Accepted
time: 135ms
memory: 26588kb

input:

200000 200000
329129983 844167206 859941046 888946794 975672772 982646651 990596776 999435610 999535114 999660464 999938950 999996461 999998143 999998407 999999967 999999967 999999971 999999991 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000...

output:

91751032360564
161619176195305
163918735950399
145020400979605
151430691595348
93354888108350
73509908110521
92041693155102
136307529608590
57634456655489
153836845200067
86705461354307
123665565924625
160520176195305
122995267804112
116214279294910
94726998289006
165309276321754
106359876826982
137...

result:

ok 200000 numbers

Test #42:

score: 18
Accepted
time: 122ms
memory: 27648kb

input:

200000 200000
49205014 133854472 299506693 460136207 597170853 703734413 790624400 808517259 853664942 916184474 926906250 944241873 971869509 976606818 992806378 996154865 996695301 999010365 999616981 999832587 999979051 999986076 999997634 999998291 999999601 999999722 999999978 999999978 9999999...

output:

166004336808283
90758336808283
121568336808283
117292336808283
122982336808283
67560000000000
93920336808283
103615336808283
182087336808283
134581336808283
133776336808283
162769336808283
77880336808283
81253336808283
188209336808283
69503000000000
112204336808283
94424336808283
96218336808283
9205...

result:

ok 200000 numbers

Test #43:

score: 18
Accepted
time: 128ms
memory: 26960kb

input:

200000 200000
-46518602 899437547 971053265 999816768 999819250 999953781 999955230 999983951 999987788 999988021 999990611 999992295 999993052 999999121 999999740 999999921 999999953 999999960 999999978 999999982 999999984 999999998 999999998 999999998 1000000000 1000000000 1000000000 1000000000 10...

output:

125176000000000
116589000000000
186702000000000
116282000000000
184748000000000
113572000000000
181893000000000
75671000000000
149290000000000
87098000000000
147870000000000
169422000000000
90877000000000
97600000000000
95454000000000
166374000000000
117178000000000
99960000000000
68836000000000
151...

result:

ok 200000 numbers

Subtask #7:

score: 9
Accepted

Dependency #6:

100%
Accepted

Test #44:

score: 9
Accepted
time: 795ms
memory: 61948kb

input:

1000000 1000000
-276849376 156935582 -413581097 600965535 826636050 -391192716 257196324 744182112 372026289 222337541 110381931 -284599599 -106210960 243040086 956683367 124851196 -342618487 713531605 -424588471 -146151027 -894187628 22567645 70147454 583233826 134716598 -924613139 947768743 -56144...

output:

363073111893
517210543332
536547004650
363711123050
552354579249
610916325088
464518163753
444407866122
667101340114
474296865257
507402744695
395973212273
550671822962
592996439254
507592676883
486834607261
412520691847
550866081450
481630874969
420410817813
427351658329
457150627637
429724975281
5...

result:

ok 1000000 numbers

Test #45:

score: 9
Accepted
time: 869ms
memory: 59804kb

input:

1000000 1000000
783982783 918583407 953718233 976672381 980383902 988889757 993837359 997977010 998514306 999085480 -190066527 966146724 988317218 995038062 995710280 995987621 999241273 999536123 999543487 999872298 -505961221 113530769 897841445 907964284 913703237 962707234 994672477 997839648 99...

output:

349804777820572
508973760615619
698782698254246
617312826048692
596662569529227
310462638217931
434580186657868
177017026886333
497374591271883
559596309627330
609235152796021
565989663888078
648155365092138
415572054921623
302868858952627
412330590682982
498918488109712
593525400989096
424300295061...

result:

ok 1000000 numbers

Test #46:

score: 9
Accepted
time: 852ms
memory: 59752kb

input:

1000000 1000000
63672544 194770343 666626434 863083708 943221168 999303635 999973200 999982401 999989601 999997417 999999489 999999532 999999621 999999896 999999973 999999985 999999988 999999988 999999996 999999998 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 10000000...

output:

608664911158510
526336712831737
344685496353885
614362371339598
594862783935535
823635865125545
833009774560684
527625571663409
706113310781100
325933319108942
830226168489554
815232437572738
303972866748796
707564252113864
545238033117514
684650775009159
346587228092349
777174026854816
633870748857...

result:

ok 1000000 numbers

Test #47:

score: 9
Accepted
time: 842ms
memory: 59824kb

input:

1000000 1000000
-463689860 846446746 889189932 937932114 998798598 999255686 999688411 999903858 999928680 999948321 999966969 999977524 999981428 999999285 999999451 999999592 999999932 999999998 999999998 999999999 999999999 999999999 1000000000 1000000000 1000000000 1000000000 1000000000 10000000...

output:

320717789165573
380530388870354
656196102769097
737093085591468
393431420049229
303564981948685
749597952303539
454558513088679
451904380552554
328468784349324
434518582119250
669801872562964
727559332624014
544830179209585
377446329742317
713353895498185
854560709622116
610873554278070
673931991629...

result:

ok 1000000 numbers

Test #48:

score: 9
Accepted
time: 857ms
memory: 59760kb

input:

1000000 1000000
419013149 997765863 999577735 999986320 999995482 999996625 999997110 999997626 999997940 999998049 999999536 999999831 999999873 999999879 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1...

output:

535875566188355
600552246895885
803818189538195
586848324255754
378942275726071
253972276231594
538823307962884
763556677617294
867067397765007
481648705689728
692113552374291
803689456791286
798821652608692
626383920328241
476424093631286
417895801246522
459951426303359
664500194168875
660229797986...

result:

ok 1000000 numbers

Test #49:

score: 9
Accepted
time: 858ms
memory: 59816kb

input:

1000000 1000000
146956068 654024135 786465147 956325223 998895739 999993532 999997031 999999871 999999995 999999996 999999999 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 100000000...

output:

800278105792950
447698216676607
446524132803263
619770255328611
701401761486271
325396331774249
727207897728036
685882547683705
866449172975704
679321287610515
604533858668629
572652450840389
864487528431830
877077355536556
663618576953073
872029034676567
656189591330062
815319224156859
668009143320...

result:

ok 1000000 numbers

Test #50:

score: 9
Accepted
time: 846ms
memory: 59740kb

input:

1000000 1000000
-970340924 -207936057 681102574 926982165 974252741 983025825 992096657 994784525 997259261 999718504 999805290 999995580 999996629 999997605 999998823 999999065 999999473 999999910 999999953 999999981 999999996 999999996 1000000000 1000000000 1000000000 1000000000 1000000000 1000000...

output:

496547187986522
815746262299880
628362887583655
308959414144736
793679827189287
412086896657427
813713744515589
858762333340036
591684366983870
589214433698286
301850968268089
958154953035973
863522478330093
517608079991096
555922268504291
581401490399208
495525952526757
690771929921390
407743647436...

result:

ok 1000000 numbers

Test #51:

score: 9
Accepted
time: 824ms
memory: 62008kb

input:

1000000 1000000
207329379 627701614 957487455 958316620 969633659 975319518 979773259 983239141 983657884 990947746 999419514 999533480 999628032 999699210 999988709 999998152 999999231 999999494 999999924 999999999 999999999 999999999 1000000000 1000000000 1000000000 1000000000 1000000000 100000000...

output:

973381503705939
818762862971128
764368017475603
688872887893024
555881419627067
426270814318497
516046555509353
750677647954945
828440579595841
646771282509619
818610090450098
663769182369513
631274439196869
761002211369137
697014907709024
528096042722394
540658690996413
797768815703850
575043200032...

result:

ok 1000000 numbers

Test #52:

score: 9
Accepted
time: 807ms
memory: 59816kb

input:

1000000 1000000
274862879 689233013 924489673 929299715 958672988 974930850 982608264 995222686 997311246 998520583 999154562 999900623 999999702 999999845 999999952 999999965 999999968 999999988 999999990 999999993 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000...

output:

624131545506317
875905230816416
487956229126662
648364829417644
685301666954815
238862067486047
530449449731322
650547535962815
463498040878181
822919156623458
636403810378113
698755290379639
835403483603382
654966004202563
909481454702529
274992131557757
171203012670948
592515348802028
742866911493...

result:

ok 1000000 numbers

Test #53:

score: 9
Accepted
time: 826ms
memory: 59772kb

input:

1000000 1000000
-269183493 779274200 881507086 968503508 993181989 998826465 999309311 999712377 999804698 999998220 999998823 999999794 999999943 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000...

output:

572616210249973
635582796194284
631627214438110
704838435061235
280227782997707
901247867718467
712027291723459
759365291723459
535266650675741
526947210249973
600821214438110
592806208862186
750327642907205
936970867718467
617584435061235
829951433673448
620197796194284
704449642907205
741981725768...

result:

ok 1000000 numbers

Test #54:

score: 9
Accepted
time: 867ms
memory: 59772kb

input:

1000000 1000000
-173253028 441325089 730189506 816925006 838777937 867444523 879130071 978792846 995490529 998328328 999786821 999946119 999976540 999978590 999989671 999998251 999999384 999999487 999999846 999999950 999999985 999999998 999999999 999999999 999999999 1000000000 1000000000 1000000000 ...

output:

618163849268678
762458470421883
678082849268678
664673765132061
951014470421883
359060938241232
737208470421883
641516849268678
683097849268678
788505470421883
781997849268678
614803470421883
353932938241232
815411470421883
869376470421883
812558470421883
248982826890829
282257317088027
808722470421...

result:

ok 1000000 numbers

Test #55:

score: 9
Accepted
time: 865ms
memory: 59840kb

input:

1000000 1000000
538823919 740345216 811171709 973861694 996042390 999522175 999830012 999977028 999982792 999999120 999999725 999999976 999999999 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 ...

output:

498764000000000
866650000000000
479538000000000
460350000000000
646994000000000
225199000000000
632440000000000
671033000000000
686134000000000
516499000000000
670117000000000
747643000000000
664514000000000
911411000000000
516494000000000
486944000000000
450702000000000
251645000000000
559183000000...

result:

ok 1000000 numbers

Test #56:

score: 9
Accepted
time: 674ms
memory: 59772kb

input:

1000000 1000000
25907 -782458 92979 1113836 181411 -1509924 153825 999179 -493487 1040975 -353969 -84926 345605 185866 -520985 -699879 -32898 713202 -997470 1151022 -545932 -112800 831314 -170520 -1470138 940499 -222707 -511866 620746 445985 162575 -922390 343790 1061457 -1542551 470101 -291290 6862...

output:

1116595
1716060
1037060
1532319
1032813
1041263
1423561
1212172
1269005
1224415
1602363
1384972
1204091
1080667
1260244
1884689
1095187
1049038
1457858
1065205
1415113
1516103
1137812
1016782
1367936
1120178
1015765
1047449
1571361
1152304
1657094
1866818
1194966
1582622
1011533
1119580
1061768
1319...

result:

ok 1000000 numbers

Test #57:

score: 9
Accepted
time: 752ms
memory: 59904kb

input:

1000000 1000000
35281 -681904 1396855 58439 -1567722 1205071 -1007495 505649 637995 -1504039 1343993 -804441 224147 195329 916891 -278269 214156 -183365 8673 -1712906 823008 -656751 818441 799353 -775014 -676150 623847 977966 -1315188 -438650 231087 1180332 -276473 462227 -852524 50301 789175 -68813...

output:

1556372
1051939
1313251
1043083
1657513
1009405
1012013
1008523
1060061
1356655
1047976
1321657
1974160
1175945
1410710
1190268
1302298
1061065
1569748
1120648
1594446
1132498
1442628
1777797
1763200
1574185
1088521
1297228
1605000
1696405
1091168
1043800
1209885
1231707
1206207
1142131
1190919
1405...

result:

ok 1000000 numbers

Test #58:

score: 9
Accepted
time: 756ms
memory: 59756kb

input:

1000000 1000000
-29436 -41779 111065 -24915 2204 47179 -127445 116425 -1044 -59097 1657 73465 -158739 85124 27536 878 27352 1808 -10789 -85182 -48444 61806 112960 -84667 50335 -88664 -24446 113045 -135684 63220 -6604 30050 -97706 179204 15233 -19577 -101231 108720 -80800 15199 -45797 -25908 104180 -...

output:

111853
111249
169927
139398
122984
106521
126663
114778
109940
118928
160002
119395
159927
106712
138699
100877
111478
111953
103088
153354
108336
153866
168283
101588
150744
112496
113733
114079
142493
145282
145843
168498
101248
113683
106472
114420
176442
147225
139077
142147
107843
115168
109957...

result:

ok 1000000 numbers

Test #59:

score: 9
Accepted
time: 708ms
memory: 59776kb

input:

1000000 1000000
9497 -16581 9837 -9967 10548 -8482 10206 -3663 2285 -9260 6254 7443 -8847 -3383 2302 9323 -5876 -7790 627 -2325 12321 -4102 -1309 -345 -515 5275 -8816 13436 -17783 1809 1421 13946 -3088 1857 -1927 -11095 9909 -6508 277 -3429 11106 -3243 166 3631 1758 -14501 2086 11157 -7402 7200 -113...

output:

10760
11378
11423
17314
12104
15673
11622
11245
15446
13823
13030
10195
12553
13376
10607
10273
18867
16555
11600
14615
10503
12269
18165
14506
10711
14285
15304
10672
19675
14231
11973
12401
15874
11701
18870
14312
18204
11375
14555
10315
11854
12569
11122
13036
14941
10206
15158
12995
16246
10269
...

result:

ok 1000000 numbers

Subtask #8:

score: 16
Accepted

Dependency #6:

100%
Accepted

Test #60:

score: 16
Accepted
time: 105ms
memory: 27856kb

input:

200000 200000
-953342634 288986652 182479679 -193734042 288943276 728043487 -986599165 618404100 -493293116 -442546796 287566141 -500497874 -456878821 -616422639 315099213 717893556 -118061645 25808497 682437170 436663521 979484574 528174871 749734702 861677249 997761711 462402142 168400308 89511649...

output:

145851424520
204154350411
111026626626
71126454931
161151331635
177619285178
212859720743
163973310286
157624053048
187828811960
159136511991
238210852773
232685916620
130001796918
208513726437
189107057457
141017273414
211695603434
148570750163
160037661751
148660514803
149773525944
150918571076
19...

result:

ok 100345 numbers

Test #61:

score: 16
Accepted
time: 107ms
memory: 26296kb

input:

200000 200000
721917386 956312052 994866599 997080611 999119573 999582799 999933198 999942907 999971699 999983617 -776183044 682701923 914648954 995651086 996518579 998848138 999346775 999731810 999978408 999979893 376311948 717053401 953381149 976180772 991978812 993704278 997461262 999944521 99999...

output:

113457148096911
100426815840433
105947416875084
74775943929738
120038616754353
118755628025908
83685905773646
118131452491494
54935881707376
101946485475661
138155028396058
90579865858574
83833060342100
82019506156474
138355169061221
149489017248105
117644718771811
83213408222618
96171209034894
1176...

result:

ok 100381 numbers

Test #62:

score: 16
Accepted
time: 108ms
memory: 27072kb

input:

200000 200000
542568410 943163527 976880820 999857700 999925523 999958962 999965852 999972381 999986711 999989379 999990704 999995598 999999563 999999593 999999873 999999997 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 10000...

output:

128278936242108
152006946007628
175716240882251
189983889456552
159095613375413
63180665641075
90302418809325
118656467865052
117651837356109
137098324040649
82678405362693
57224506493161
127148497985886
67337846876120
37148054868849
134265853721594
147447029871603
143667830721316
113940271498743
17...

result:

ok 100362 numbers

Test #63:

score: 16
Accepted
time: 110ms
memory: 26616kb

input:

200000 200000
496374266 648252802 996570603 998069381 999972112 999989419 999992571 999995163 999997287 999998309 999998416 999998525 999999896 999999995 999999999 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000...

output:

107991177873775
112024834535650
166868265876586
132181453726745
119376277217957
135196505177925
61122599036497
93110814904713
162250903050591
133276896706255
69185386547314
127763796421963
133342770200502
117198612299497
132786514794091
139489722385802
122313723216702
157370226852591
84132208912083
...

result:

ok 100282 numbers

Test #64:

score: 16
Accepted
time: 120ms
memory: 29072kb

input:

200000 200000
55117401 480417951 922420151 934391499 973133572 986431972 992917596 998885826 999219888 999385375 999942632 999953862 999985158 999993009 999998993 999999889 999999975 999999991 999999998 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 100000000...

output:

139645252055162
92483256790533
146007875055047
188685895991977
111820842906587
84334779567969
89146353463961
118281881559239
123954878354780
88402035069352
140328697243627
92430322222829
144365339499155
56882322564926
86315918191290
172241115016161
136473806128114
147053960031012
188278989239041
131...

result:

ok 100520 numbers

Test #65:

score: 16
Accepted
time: 104ms
memory: 28716kb

input:

200000 200000
937820410 975681539 976014956 994425586 997412393 999709120 999715127 999812874 999865288 999940896 999995305 999997914 999999478 999999707 999999714 999999811 999999945 999999991 999999994 999999998 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 100000000...

output:

157222371865417
127316640147585
62212317886076
183219752480562
62189156204260
82935178565301
99937858686353
117430282457437
89991452997484
122642011225490
115158137826561
97124135317073
142640152901750
180994064595015
112516345887540
140686505390906
140094555342644
77718006736396
150507250796320
119...

result:

ok 100294 numbers

Test #66:

score: 16
Accepted
time: 113ms
memory: 30344kb

input:

200000 200000
810550343 963553210 981657900 991104301 992045292 996033463 996860714 996912266 998323042 999404832 999595659 999896302 999910569 999912724 999964791 999991078 999994875 999999807 999999994 999999996 999999999 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000...

output:

112725977120999
128946958095436
109050198686557
131618818166878
151373264277199
140256668748568
79736864894913
91775360952008
114744183231395
91163250946974
161027990892506
138169136494675
145874969028958
134991148340690
124647148340690
114293669138627
185270075713983
153341701625952
161255490953581...

result:

ok 100389 numbers

Test #67:

score: 16
Accepted
time: 109ms
memory: 31064kb

input:

200000 200000
-828729542 929397586 951591549 951631091 953318133 986795404 991243838 994530823 994555647 999003543 999048447 999112364 999262270 999941206 999999017 999999559 999999613 999999953 999999966 999999973 999999975 999999987 999999994 999999994 999999995 999999996 999999997 999999999 99999...

output:

166201529654233
97541529654233
126093815814207
128563068152828
59139293382708
124635476324358
78305735838424
69580778672058
120435502157054
116020934495500
150034660179968
141100486536203
153763798864921
157034274373176
113079598492177
149403139096418
164747762190725
180685762190725
109968405119863
...

result:

ok 100322 numbers

Test #68:

score: 16
Accepted
time: 101ms
memory: 30660kb

input:

200000 200000
53973467 964224111 973458363 979083803 982376035 988349593 995063021 995159449 997151199 997332881 998136617 998869484 999591962 999934791 999960483 999962610 999991686 999995334 999996895 999998204 999998991 999999296 999999348 999999905 999999971 999999976 999999978 999999979 9999999...

output:

116550235176818
166169235176818
129334235176818
107443216983686
182595259957580
94375515833385
74576709729112
131334558807279
86672558807279
137065558807279
43669000000000
109718456572109
138908828954136
95824402099008
175533332943636
117488534526156
165381814936049
105186887032932
100691390366860
1...

result:

ok 100472 numbers

Test #69:

score: 16
Accepted
time: 108ms
memory: 29416kb

input:

200000 200000
149344387 782258124 924385456 997168646 999779932 999941909 999949820 999997074 999999169 999999407 999999728 999999937 999999944 999999948 999999975 999999988 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 10000...

output:

183091000000000
116358000000000
192959854622194
163411854622194
160574019408104
149073637525713
85820959207416
164887458201604
56680416833115
63622266073066
63371564289139
109877976255281
121095420894344
112489807121799
78595892815760
141501605012235
139405544723005
148316415041832
139979072538535
1...

result:

ok 100482 numbers

Subtask #9:

score: 8
Accepted

Dependency #1:

100%
Accepted

Dependency #2:

100%
Accepted

Dependency #3:

100%
Accepted

Dependency #4:

100%
Accepted

Dependency #5:

100%
Accepted

Dependency #6:

100%
Accepted

Dependency #7:

100%
Accepted

Dependency #8:

100%
Accepted

Test #70:

score: 8
Accepted
time: 774ms
memory: 74500kb

input:

1000000 1000000
70042657 -735095588 28706646 353149301 -202794220 -909373527 280104259 -425981475 -111043104 563540759 -293009183 -176619128 234116051 -705293189 564212323 899426033 -677306231 -524749359 -272051869 -588570929 -936767032 334210967 -747553672 810634804 -482436430 -54132075 -693996691 ...

output:

268081340895
360331371711
299147845305
223051041771
851518727542
689346071554
197631720073
283272872978
714687241891
327309478487
311514168253
630485958967
933038452945
248764784604
888235274997
443690526714
951316962883
197374184056
879476859727
316288476543
418479579215
731734308782
320374331774
3...

result:

ok 501714 numbers

Test #71:

score: 8
Accepted
time: 816ms
memory: 76284kb

input:

1000000 1000000
-466029185 -195888923 31090788 51054919 343207464 546834482 882067129 998572915 999264230 999609184 -221995326 894579961 960669101 979824732 983169343 989422509 989581135 994618304 998120159 999060892 -705797778 280176054 558077137 728743695 751408835 812208856 967467878 971755949 97...

output:

601482777480122
551641574742453
451099868439293
313034710657091
702083934763085
437720424851101
230781726583631
441171559979607
508242004684142
667284713615666
446457210057462
383311080715208
392339789976985
697135449016579
520212870405133
335794533353545
240822400142136
393434258229462
733456721467...

result:

ok 501692 numbers

Test #72:

score: 8
Accepted
time: 805ms
memory: 74272kb

input:

1000000 1000000
51531931 790178037 858632401 902991712 995727633 997323724 999100768 999783852 999845833 999928664 999957070 999999816 999999921 999999933 999999977 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 100...

output:

246868913157301
534064494574202
606436353382561
491196129517024
268886503211193
818051427311149
785000189029747
571538793387020
422356317005237
346284675623533
720483338183159
579391223154351
854204693015160
668928045850204
729628984610938
933069049773097
445487575974102
589036499419819
771694728113...

result:

ok 502488 numbers

Test #73:

score: 8
Accepted
time: 761ms
memory: 74152kb

input:

1000000 1000000
147543482 973627797 986175336 998499850 999314521 999524461 999946755 999976572 999994501 999997667 999999352 999999956 999999967 999999987 999999987 999999997 999999998 999999999 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 10000...

output:

782063163394923
794453550189896
784231310567047
734074930467583
646572045301781
696187761104833
943566307013169
746321296029300
706169961112644
411032271996732
668454558027568
726374354279195
532608559289169
639865579599936
701547471513362
746126926552982
708119733135291
444373794009384
707574398838...

result:

ok 502467 numbers

Test #74:

score: 8
Accepted
time: 794ms
memory: 73232kb

input:

1000000 1000000
-842580875 472068480 520551582 548992185 986997113 997023406 998890431 999576183 999579266 999896365 999967655 999968702 999979325 999983469 999991760 999997859 999999474 999999580 999999682 999999877 999999910 999999918 1000000000 1000000000 1000000000 1000000000 1000000000 10000000...

output:

454248396710851
471521022023427
750749869751960
368578153304563
546539891489804
671143850923490
649452250907794
697398107821645
530426208679327
525936178102851
811708498734664
329115620918444
346151965922563
555006528899137
817826800820733
813743171840021
128027395180061
737634582545913
456339500504...

result:

ok 502464 numbers

Test #75:

score: 8
Accepted
time: 788ms
memory: 76208kb

input:

1000000 1000000
947216608 969844346 981284168 986867249 996139870 999885729 999909227 999921413 999971713 999984096 999992415 999996001 999998167 999998764 999998815 999999376 999999819 999999868 999999872 999999932 999999956 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 10000000...

output:

826564401915501
907626947656667
635085642449588
786468196903580
714900044318648
887402835569431
671301766798339
801572727859829
599774102551957
60818112877949
730716551053694
616579481697804
788812358313965
620385636407672
626727006248240
623191775672290
725009071202535
695094702347006
6070500380120...

result:

ok 502456 numbers

Test #76:

score: 8
Accepted
time: 787ms
memory: 73708kb

input:

1000000 1000000
-871755929 522583365 785326026 808081088 867501642 878653904 967007535 967450756 994272400 995291593 996895323 998666604 999777561 999888220 999897847 999995758 999997919 999999869 999999893 999999975 999999996 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000...

output:

449899480951437
759265057597296
688959517512632
916440945268986
879040183966653
517478309567621
507140026241960
421457899801681
599371371177867
527660474018974
500601670272441
826569582278543
833240249115834
640522023218324
448254543304552
812643723152710
564421651780201
797624946438988
756595210977...

result:

ok 502447 numbers

Test #77:

score: 8
Accepted
time: 806ms
memory: 73964kb

input:

1000000 1000000
129414907 240734085 432861422 738061371 754059220 790002621 825357050 959978531 986339450 992472093 993268962 994083827 997519561 999811356 999941183 999992459 999999848 999999923 999999952 999999987 999999990 999999992 1000000000 1000000000 1000000000 1000000000 1000000000 100000000...

output:

433850402215748
531467610058294
646099059526435
550458035054544
516263693392515
744282117427782
824726334206145
875878097564276
753953387297992
528478136409766
817045007922727
728900075637508
709342959627913
402392290240746
644030738072935
792855133226325
668421456224084
628038724156531
461403262556...

result:

ok 502453 numbers

Test #78:

score: 8
Accepted
time: 801ms
memory: 72528kb

input:

1000000 1000000
477390138 716992481 860739596 918673026 941447825 993327330 993880984 995368826 997994298 998125585 998143728 999666853 999712293 999892576 999956268 999958396 999985494 999996436 999998068 999999947 999999949 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 10000000...

output:

630233450227701
560630300452464
586887468767113
716418041910786
621728510401838
472998541630130
792227579546647
287433260922749
682576286522677
728958563691006
521122301375855
712576832046230
487554868853344
899511823568058
773097395889715
717018542584201
593505688706532
679215503922887
315756809227...

result:

ok 502472 numbers

Test #79:

score: 8
Accepted
time: 789ms
memory: 74156kb

input:

1000000 1000000
401260437 846345667 931230553 950595417 986805043 988264471 997856492 998357157 999076649 999671233 999799565 999897110 999930600 999972961 999991584 999992900 999997835 999999302 999999815 999999931 999999985 999999991 999999991 999999996 999999996 1000000000 1000000000 1000000000 1...

output:

228744319098919
570793852563922
797878280628001
796847865105372
494467273147393
871758851101115
325341866803034
291181112727293
493188386572140
638896087664663
748953080653141
898745919036898
460950870451262
846199224275450
731499960649687
574275301301231
730404687838092
688727026496114
548306482679...

result:

ok 502466 numbers

Test #80:

score: 8
Accepted
time: 730ms
memory: 59816kb

input:

1000000 1000000
27888528 51395299 -86765690 -87987405 156303084 -16595805 -45550116 -92120863 151994123 -44533679 9075614 64926786 -184017905 72879335 28343083 47288366 -124277900 -15602208 112089555 -9123181 -53905206 69652001 -1934577 -117635127 121117298 -116902428 -480709 -9442791 52120403 12074...

output:

130673577
119433047
187516379
122997764
107056007
102321725
133546437
107208547
183613014
119419194
133723296
104152926
169475134
144109381
114249706
123032940
155820926
154285714
103323388
153377492
159245011
137084715
101391039
115874352
165678990
133825337
129617062
111131116
130775641
117858471
...

result:

ok 1000000 numbers

Test #81:

score: 8
Accepted
time: 722ms
memory: 59828kb

input:

1000000 1000000
-1685755 3197422 -6980935 5489551 -3453251 6797148 -7347633 -2190442 185866 5770471 3494425 -7708304 -997470 13733934 -17435948 6952250 6805727 -1984409 2303078 -3887388 -691905 8943209 -10015659 -2388442 4880572 1094556 3120314 -480709 -9442791 11196968 -6098987 5495258 -7661060 525...

output:

11873916
10037337
10761166
13346874
12763147
17141883
16852744
17550018
10645213
10416034
10788553
10763539
15109373
12596350
15500652
13331438
19620811
12975185
12790070
11763628
19254001
15936720
13495828
10134234
11042599
14597344
12629281
13141093
12680878
11042872
14639082
11724342
12062018
161...

result:

ok 1000000 numbers

Test #82:

score: 8
Accepted
time: 803ms
memory: 76220kb

input:

1000000 1000000
-240013 719548728 987835402 990437418 990575729 994617432 995643608 997507516 997766561 998365969 998628764 999599125 999964454 999989148 999999618 999999935 999999987 999999993 999999994 999999995 999999997 999999999 999999999 1000000000 1000000000 1000000000 1000000000 1000000000 1...

output:

527827451464421
565511451464421
898709451464421
629507451464421
630644451464421
383107451464421
981426612649133
495660612649133
476670612649133
513265612649133
377825254454521
518483543413929
697748918889471
660060933472610
603192918889471
672348918889471
748018918889471
715807418507523
647872906479...

result:

ok 502452 numbers

Test #83:

score: 8
Accepted
time: 798ms
memory: 74104kb

input:

1000000 1000000
258278633 919166331 967936600 989950033 990365798 998519694 998910059 998910229 999067247 999718305 999824332 999869097 999977816 999997192 999999956 999999957 999999988 999999992 999999999 999999999 999999999 999999999 999999999 1000000000 1000000000 1000000000 1000000000 1000000000...

output:

944329000000000
602446000000000
710044000000000
403973000000000
496842221248540
700963791922208
505318569840373
663576569840373
683404556751565
824169658391984
891634658391984
437734591978219
399648829692574
422680132429025
351672932641156
864727381199582
569477254826460
946383799482185
889556799482...

result:

ok 502455 numbers

Test #84:

score: 8
Accepted
time: 740ms
memory: 59832kb

input:

1000000 1000000
5685018 -2531853 -9948864 5918514 -6095488 11980259 -11937913 6853445 -1169491 -3995503 -1169666 -2881762 10218633 2320510 -5975740 7827064 4193782 -17546741 17810623 -4301087 -5658535 -3154478 -5289268 5746835 -5239155 256959 16085780 -16510508 3107653 5739458 7399879 -12436370 1581...

output:

12814161
12238468
13529792
12618950
14959142
14445105
12503531
10304151
14383875
16131824
14865543
13022673
11806994
11445539
10189273
11997538
10004754
14614394
10139237
18949762
16153006
10461296
15074998
12776668
10212960
11215667
15135966
12292866
16216894
13109634
13058755
11466871
10519348
114...

result:

ok 1000000 numbers

Test #85:

score: 8
Accepted
time: 747ms
memory: 59816kb

input:

1000000 1000000
4799051 -14771702 -34546992 -39658856 151195865 -75047320 41448531 -43305545 -59944002 -11888478 119929357 -43135975 -70006498 37196281 -20415858 49103703 -84577607 147782880 -91584946 104116016 -114863610 -41201593 176881669 -145349366 77019707 80534678 -48958226 -114190779 12438292...

output:

138258783
118058654
124925267
115491120
103467619
145919990
127027148
100091848
107319166
185922367
113497884
126147730
138782420
126149816
174222426
128099673
103672628
115622921
113058013
163805785
131896787
193766671
119156621
115476819
128237583
113572214
109366952
145637070
106521641
194823233
...

result:

ok 1000000 numbers

Extra Test:

score: 0
Extra Test Passed