QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#506925#4700. Sterilizing SprayTAhmed33#100 ✓101ms9960kbC++171.4kb2024-08-06 02:18:192024-08-06 02:18:20

Details

Tip: Click on the bar to expand more detailed information

Subtask #1:

score: 5
Accepted

Test #1:

score: 5
Accepted
time: 1ms
memory: 3564kb

input:

98 2959 8
289127345
375163829
493044923
558548413
105578794
19830455
146783115
191973991
346111134
940277147
721051584
406468192
163339499
520173205
336878531
667438316
593782642
932699479
638781317
512600069
959108679
138935718
872606197
136998605
479071342
3666575
965503007
823903175
737266452
547...

output:

410032395
2490972449
27392310
366461706
547934194
26556272
644071954
175233639
1295874125
272836385
93798055
3656387
316311940
24276031
1116213496
31239177
288
94280915
72180754
60515312
13817571
671735066
770203856
268441250
1118648832
1900861670
1451519626
775987262
1442420560
7633778
90464839
174...

result:

ok 991 lines

Test #2:

score: 5
Accepted
time: 1ms
memory: 3680kb

input:

728 1141 1
266223202
629927261
523338101
2213330
871110849
321588055
516032990
561877863
872887247
662619029
761856595
339232544
16588763
53191009
683143245
949198317
839560613
551866546
87062283
463993697
278943006
569080077
822061356
765062552
50010561
589266612
972690779
56709122
971834211
237522...

output:

289190300341
3185824564
26297220189
103159845569
76832625895
12253983051
2925937891
53380421630
72991596820
284507947562
27025099894
173222802414
149817909612
93049698172
160514966943
45569438326
79471107665
78951215976
71006414521
112945028397
11195342680
226088850268
118841951730
22667034875
86278...

result:

ok 376 lines

Test #3:

score: 5
Accepted
time: 1ms
memory: 3756kb

input:

1804 221 8
480949324
515293769
198316375
603802195
403687513
215505326
227936931
412093468
537093095
532142672
226137605
718978324
784244049
21055900
673446238
958958678
378541364
189723023
379704144
287984204
929402129
129125253
909840973
258468528
201713058
594373451
226923319
932375878
430743169
...

output:

30509282544
372529065035
516426946234
29698013101
2781366287
225924452600
22258159167
11300667685
160740914276
10905589585
38205268996
4268757250
27367297476
27403362481
919443921
173231527
359771188
1138796
549347323
324798723
18542956
657933030
22203820
1499111774
45213874
7034366397
118025834
189...

result:

ok 72 lines

Test #4:

score: 5
Accepted
time: 2ms
memory: 3796kb

input:

1357 2895 2
901079077
10917968
831598899
946813880
23640880
431864456
25398705
762433308
543439514
1965764
472272600
1174485
577835650
156268604
688107933
689169289
714167670
60160689
827673017
563931973
600792750
400393328
832925090
758694250
319436530
574557393
110306364
328987759
504094963
806690...

output:

5242295026
131795448999
420341181840
256327604070
5855221655
17230706966
68149841134
29050531554
19768071669
7273463710
373275031959
85968421797
28434134724
1077091371
22910717207
27603431836
70778511019
7913123296
19889304887
28528301639
9431035992
28184827567
10126755592
33701265031
6458287710
189...

result:

ok 978 lines

Test #5:

score: 5
Accepted
time: 2ms
memory: 3756kb

input:

3000 3000 4
244680535
458707995
295572344
396027999
419089775
859071397
355284183
48721701
30205981
40763623
77117532
366854676
196961575
907825819
573969287
757778115
743058804
744682925
97473890
148050464
227371099
883152612
140988866
584420152
388710546
181870199
683022093
533850758
481535482
362...

output:

1064028321365
57364286655
685068159032
679638631172
145153984123
394561785492
80529351321
6000703058
374719576333
2883204283
64996333216
42124844673
2657801687
178246511756
71940710065
410518261
47444703301
47958965
1603344670
66164908492
7945648414
3591587
74764438
9571014
331873780
4445228967
4615...

result:

ok 1012 lines

Test #6:

score: 5
Accepted
time: 2ms
memory: 3708kb

input:

3000 3000 10
889525138
50292219
511211897
92123653
239325671
505581438
353881401
400336460
945859392
257912061
356027375
858941650
271358526
930799253
933972751
624017244
595797887
338036445
153891205
794766948
13895199
946449939
640774427
615821587
103725396
138599278
605467681
973076348
683639445
...

output:

607809827516
9317040653
54786527570
3666705149
12567864069
5789765
1776376094
7899883909
25336127433
90709531
75286008325
13504046344
28621107389
12981944812
31302832852
10997213550
9958437568
1749815964
2612964466
2678068531
4477
1067146915
4411063470
42351
2350220455
111699040
3375306
262846399
20...

result:

ok 995 lines

Test #7:

score: 5
Accepted
time: 2ms
memory: 3704kb

input:

3000 3000 5
266715842
201003475
303440013
774652928
764578769
852864684
3846585
629216345
300978034
604363932
917482257
816182385
74602097
620478872
209204967
651078420
685317752
658922431
459499009
886934246
533097533
392860621
124514203
79047949
987509354
925224895
486338133
487584424
608367912
38...

output:

145246249654
450810037122
530491414010
47912605796
110091850685
35767841503
33305464902
27401387924
6879656353
1008519867
114138967541
67460632768
217811242442
10339209411
11956809766
21518035905
5451646090
2362
166947793
32462766
34413089134
1331858167
474003950
563833391
466542413
51772252930
3448...

result:

ok 1043 lines

Test #8:

score: 5
Accepted
time: 2ms
memory: 3808kb

input:

3000 3000 5
155666249
671318751
67367659
852420056
829255513
634712812
237387759
700559988
74631323
5229477
898749808
784630365
152660440
875464458
18411634
465621873
359080661
241247732
336364204
792562333
291818073
623386563
822220963
300725903
521417401
773809430
488284941
435378387
75491478
4654...

output:

69022489325
651217434554
35377093655
224431947633
80865304968
249726306614
18277161563
449560258801
3538492400
76203422
17352804
52105440
473593565
812487024
9096334
2816009387
36186110
6099346423
90081779
37390517
462485282
38285659
84190
563215903
26562723666
1195152
36036
624670121
134077268
1545...

result:

ok 1027 lines

Test #9:

score: 5
Accepted
time: 2ms
memory: 3776kb

input:

3000 3000 3
957973926
992122406
850313313
923113666
135243842
672922451
182311204
964427476
342325374
306378793
300882471
426681491
234126528
121267318
263369672
551820939
102173569
714382672
496085588
641252592
10064612
708049117
36059070
162300625
111508488
257347397
222806536
455704975
396423570
...

output:

638051097415
475353811845
189336583551
10995884501
6983359003
57388420315
23464757646
185083404151
54953914655
3365162849
37323833714
5044604112
64463248809
41434977867
1495558812
70255958201
713872239
1248063
672960202
7157096929
8543136769
7117167782
9492033248
33225145411
9899355052
15225605164
1...

result:

ok 1033 lines

Test #10:

score: 5
Accepted
time: 2ms
memory: 3760kb

input:

3000 3000 6
891034170
921973252
220392162
887697421
883666609
900508826
773770720
398621229
473536226
487333341
238593103
403920326
280088596
212169263
671593139
397922792
885441639
524554304
554831741
78187557
154517487
812188350
632727669
49618931
564995913
54075273
55819243
988077427
121050230
12...

output:

5500681699
104152905207
29760228243
2915693120
44039662
1894393201
307689363
1698179289
910535636
31815808
1088669891
2971896585
1019748218
427870843
5091201607
345231022
2180236
1811646285
304789572
633874907
117982945
28182786
312035
1008234566
1667893267
3284810
166669
536851
170886835
1696569672...

result:

ok 1016 lines

Test #11:

score: 5
Accepted
time: 2ms
memory: 3776kb

input:

3000 3000 6
883531154
537108555
957104294
251403088
769646582
476507448
641926127
839650539
576796660
201560205
643693215
659109389
90471527
299556827
822309437
815896755
366515823
64537290
317302396
567251485
844697294
913357833
546394003
699672026
276489441
994034041
579236226
283997363
50152825
8...

output:

121830221617
56267500423
30756662579
21210004938
26584706538
68107366492
17027551044
21355776178
16317210031
9557344431
8114043
42572100726
116979992028
790572785
21389961231
5229463877
2192743801
436714144
13691437476
159703698620
15708410319
70700159
639737713
451127564
4680001
938515141
71135994
...

result:

ok 990 lines

Test #12:

score: 5
Accepted
time: 2ms
memory: 3816kb

input:

3000 3000 5
580316808
601484379
367246875
160320036
523711808
195298033
378530617
525298801
627619054
854939070
179769252
630711086
619288914
539622946
895599806
107478227
931315686
479300468
611193874
452190782
405472582
628889345
336949418
477156244
121553324
495975029
68780999
876703726
338132002...

output:

11229379871
33862648958
47621007671
6193413618
934937792
85267850470
215669088223
50924977829
7758354345
1908728342
2224676441
4489825
102327237
217451360
180759733
36955196577
620695570
218307157
140859812
66363758
74089959
26172701
66119829
141359092
2154754488
30327330
4004403
2993096
1637729204
...

result:

ok 995 lines

Subtask #2:

score: 10
Accepted

Test #13:

score: 10
Accepted
time: 8ms
memory: 3964kb

input:

6415 41567 5
0
1
0
0
0
0
1
0
1
1
1
0
1
1
1
1
1
1
1
0
0
1
0
1
1
1
1
1
1
1
1
1
0
0
1
0
1
1
1
1
0
0
1
0
0
1
0
1
1
0
1
1
1
0
1
1
0
0
1
1
0
0
1
0
0
1
1
0
1
1
1
0
1
1
1
1
0
1
0
1
0
1
0
0
0
1
1
0
0
1
1
1
1
0
0
0
1
0
1
0
1
0
1
1
0
0
0
0
1
1
1
0
1
1
1
0
0
0
1
0
1
1
0
0
0
1
1
0
1
1
0
1
0
1
0
0
1
1
1
1
1
1
1
0...

output:

10
10
1
0
79
11
304
1
304
0
0
0
1
0
101
0
2
0
0
0
0
1
0
4
86
55
0
0
0
0
1
0
0
0
0
1
1
1
2
1
1
0
1
0
0
3
1
1
0
1
0
0
3
0
1
1
0
0
0
0
0
1
0
0
0
0
0
1
0
0
0
0
0
0
0
1
1
0
0
1
0
1
0
0
0
0
0
0
0
0
1
2
0
1
1
3
0
0
0
0
1
1
1
0
5
0
1
0
0
0
0
1
0
3
0
2
0
0
0
0
1
0
0
0
0
0
1
0
2
0
0
1
1
0
0
0
0
0
1
1
0
0
0
1
...

result:

ok 13800 lines

Test #14:

score: 10
Accepted
time: 6ms
memory: 5384kb

input:

44748 15281 3
1
1
0
0
1
1
0
0
0
0
0
1
1
0
0
1
0
1
0
1
0
1
1
1
0
1
1
1
0
0
1
1
1
1
0
1
1
1
1
1
0
1
0
1
0
0
0
1
0
1
1
1
1
1
1
1
0
0
1
0
1
1
1
0
0
1
0
1
1
0
1
1
1
0
1
1
0
1
0
1
1
0
1
1
0
1
0
0
0
1
1
1
1
1
1
0
1
1
1
0
0
0
1
0
1
1
0
1
0
0
1
1
1
1
1
1
0
0
0
1
1
1
0
0
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
0
1
0
0
...

output:

10719
6205
11363
4184
2324
2137
0
0
1
1
1
0
0
0
0
826
0
49
0
0
0
0
0
0
44
1
222
0
0
1
0
0
0
0
0
2
0
1
0
0
0
1
0
0
0
1
2
0
1
1
0
0
0
0
0
2
1
1
0
0
0
0
1
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
1
0
1
0
0
0
1
1
1
1
1
0
0
0
0
0
0
1
0
0
0
2
0
0
0
0
0
0
1
2
1
0
0
2
...

result:

ok 5014 lines

Test #15:

score: 10
Accepted
time: 11ms
memory: 5324kb

input:

44845 24914 9
1
1
1
1
0
0
0
0
1
1
0
0
1
1
1
1
1
0
0
0
1
1
1
0
0
0
0
0
1
0
0
0
1
1
1
1
1
1
1
0
1
1
0
0
0
1
0
0
0
1
0
1
0
0
1
1
1
0
0
0
1
0
1
1
0
1
0
1
1
1
1
1
0
0
1
0
1
1
1
0
1
1
1
1
1
0
0
1
0
1
0
0
1
1
0
1
0
0
1
1
0
0
0
1
0
1
0
1
0
0
0
1
1
0
0
1
1
0
1
0
0
0
0
0
1
1
0
0
1
1
0
0
0
1
0
1
1
0
0
1
1
1
1
...

output:

0
381
3085
0
0
0
1290
560
1911
1
0
0
173
0
1
0
0
2
0
0
0
0
0
0
0
0
0
82
0
0
28
0
0
0
0
0
0
0
0
0
1
0
0
309
0
0
1
0
0
0
0
0
71
0
0
0
0
0
0
0
0
0
0
0
1
0
0
2
2
0
0
1
134
0
1
0
2
0
0
2
0
0
0
0
0
2
0
3
0
1
1
1
0
0
1
1
1
1
0
0
0
0
0
60
0
1
0
1
0
1
15
0
0
0
0
0
0
1
0
0
0
1
0
0
0
0
0
0
0
1
0
0
0
2
0
0
1
1
...

result:

ok 8368 lines

Test #16:

score: 10
Accepted
time: 20ms
memory: 4592kb

input:

24562 97203 8
1
0
0
0
1
0
1
1
0
0
1
1
0
0
0
0
0
0
1
1
0
1
1
0
0
0
0
1
0
1
1
1
1
0
0
0
1
0
0
0
0
0
1
1
1
1
0
1
1
0
0
0
1
0
1
1
0
1
0
1
0
1
0
1
1
1
1
1
1
1
1
0
1
0
0
1
0
0
1
1
0
0
0
1
0
1
1
0
1
1
1
0
1
0
0
0
0
0
0
1
1
0
0
1
0
1
0
0
1
1
0
0
1
0
1
1
0
0
0
1
1
1
1
1
0
1
1
1
1
0
0
1
1
0
1
1
0
0
0
1
0
0
1
...

output:

2174
89
0
251
0
85
0
0
1691
0
0
106
401
0
0
0
144
0
0
0
0
144
1344
766
0
1
2
338
1
0
0
0
2
1
1
1
0
0
0
0
0
0
0
0
0
2
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
2
1
0
0
1
1
0
1
1
0
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
2
0
0
0
0
0
2
0
2
0
0
0
0
0
0
0
0
0
1
0
0
0
0
1
94
0
0
4
0
0
1
0
0
0
0
0
1
0
0
0
2
0
0
26
1
1
0
2...

result:

ok 32596 lines

Test #17:

score: 10
Accepted
time: 32ms
memory: 7528kb

input:

100000 100000 4
0
1
1
0
1
0
1
1
0
1
1
0
0
1
1
1
0
0
1
0
0
1
1
1
1
1
0
1
0
0
0
1
0
1
0
0
1
0
0
0
0
0
0
0
0
1
1
0
1
0
0
1
1
0
0
0
1
0
0
0
1
0
1
1
0
1
1
1
0
0
0
1
1
0
1
1
1
0
0
0
0
1
1
0
1
1
0
0
0
0
1
0
1
0
0
1
0
0
0
0
1
0
0
1
0
0
1
0
1
1
1
0
0
0
1
0
0
1
1
0
0
1
0
1
1
0
0
1
1
1
0
0
1
0
0
0
1
0
0
0
1
0
...

output:

6601
6237
0
5062
173
1143
2536
0
0
0
0
1832
0
1
0
0
0
0
0
0
0
1
0
1
0
0
2
0
0
0
0
1
0
0
351
0
0
0
0
0
1
1
1
1
1
0
0
1436
0
1
0
1
382
0
0
0
0
0
0
0
0
0
1121
0
0
0
0
0
1
0
0
0
620
0
0
1
0
0
0
0
0
0
0
0
0
2
0
1
2
1
2
0
0
0
1
0
1
0
3
3
0
2
0
0
0
0
0
0
0
0
1
0
1
0
0
606
0
2
1
3
1
0
0
2
0
0
0
0
0
0
0
0
1
...

result:

ok 33405 lines

Test #18:

score: 10
Accepted
time: 32ms
memory: 7468kb

input:

100000 100000 2
1
0
1
0
1
0
0
0
1
0
1
0
0
1
0
1
1
1
0
0
1
0
0
0
1
0
0
1
0
0
0
0
0
1
0
0
0
1
1
0
1
0
0
1
1
1
1
1
1
0
1
0
1
1
0
0
0
1
1
1
1
1
1
1
1
1
1
0
0
0
1
1
0
0
0
1
0
1
0
0
0
1
1
0
1
0
0
1
1
0
1
0
1
1
0
0
0
0
1
0
1
0
1
0
1
0
0
0
1
1
1
0
1
0
1
0
1
0
1
1
0
1
0
1
1
1
0
0
0
1
0
0
0
1
0
1
1
0
1
0
0
1
...

output:

41968
9846
0
1116
3904
0
1704
0
0
0
0
0
1023
0
0
2
2
0
1
1
979
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
1
0
1
1
0
552
0
1
2
0
2
0
0
1
2
2
0
2
5
2
4
2
0
1
0
1
1
0
1
1
0
0
0
2
1
0
2
0
0
0
0
1
0
0
0
0
0
0
0
0
1
4
1
0
0
0
0
0
0
1
0
0
0
2
0
1
2
0
63
2
0
1
0
1
2
0
3
0
0
1
0
0
0
1
0
0
0
1
1
0
0
0
27
0
1
0
0...

result:

ok 33296 lines

Test #19:

score: 10
Accepted
time: 28ms
memory: 7612kb

input:

100000 100000 6
0
0
0
0
1
1
1
0
1
0
1
1
0
1
0
0
0
1
1
1
0
0
0
1
0
1
1
1
1
1
0
0
0
1
0
1
0
1
1
1
1
1
1
0
0
0
0
0
0
0
1
1
0
1
0
0
0
1
1
0
0
1
0
0
1
1
0
1
0
0
0
0
0
1
1
0
1
0
0
1
1
0
1
0
0
0
1
0
0
1
0
0
0
1
0
0
0
1
1
0
1
0
1
1
1
1
1
0
1
0
0
0
0
1
1
0
1
0
1
0
0
0
1
0
1
0
0
0
1
1
0
1
0
1
0
0
1
0
0
0
1
1
...

output:

257
1905
0
2263
1
3888
2464
2264
2264
0
2
0
495
0
1
1587
0
0
0
1
104
2
0
2
2
0
0
0
0
0
0
1
2
1
0
0
0
0
0
0
2
1
0
0
0
0
0
0
0
0
0
0
0
73
0
1
1
0
0
0
0
0
2
0
0
4
2
0
0
2
3
0
0
3
1
0
4
0
0
0
0
0
0
3
4
2
0
1
2
0
0
2
0
0
0
0
2
2
2
2
2
0
0
4
2
0
0
0
1
1
3
0
0
0
0
1
0
2
0
0
0
0
0
0
0
0
0
1
2
0
1
2
2
12
6
1...

result:

ok 33194 lines

Test #20:

score: 10
Accepted
time: 30ms
memory: 7612kb

input:

100000 100000 10
1
1
0
0
0
0
0
0
1
1
0
1
0
0
1
1
0
1
0
0
1
1
1
0
0
0
0
0
1
0
0
0
1
0
0
1
0
0
1
0
0
1
0
0
1
1
0
0
1
0
1
1
0
1
1
0
1
0
1
1
1
0
1
0
0
0
1
1
0
0
1
1
1
1
0
1
0
1
0
1
1
1
1
0
0
0
0
0
1
1
0
0
1
1
1
1
0
1
0
0
0
1
0
0
1
0
1
1
0
0
1
1
0
0
0
1
1
0
0
1
1
0
0
0
0
0
1
1
1
1
1
0
0
1
0
1
0
1
0
1
1
1...

output:

26
15
1
1
1
0
0
0
0
0
3
1
5
0
0
0
0
0
0
0
0
0
4
0
10
0
2
0
0
1
1
1
0
0
2
0
0
1
0
1
1
1
0
1
0
0
0
0
0
0
1
0
0
0
0
2
1
1
0
0
0
0
1
1
1
1
1
1
2
0
0
0
0
2
0
1
2
2
0
1
0
0
0
0
0
0
1
2
2
2
2
0
1
0
0
1
1
0
1
1
0
0
0
0
0
0
2
2
2
2
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
1
0
0
0
0
1
0
1
1
1
1...

result:

ok 33518 lines

Test #21:

score: 10
Accepted
time: 26ms
memory: 7472kb

input:

100000 100000 6
1
0
0
1
0
0
0
0
1
1
0
0
0
0
0
1
1
0
1
0
0
0
0
0
1
1
0
0
1
0
0
1
0
1
0
0
0
1
0
1
0
0
1
0
0
0
1
1
0
0
1
0
0
1
0
0
0
1
1
0
0
1
1
0
0
0
1
1
1
0
0
1
0
0
1
0
0
0
1
1
1
0
1
1
0
0
0
0
0
1
1
1
1
0
0
1
1
1
1
1
1
0
0
0
1
0
0
0
1
1
0
0
0
0
1
1
1
1
1
0
1
0
1
1
1
0
0
1
0
0
0
1
0
0
1
1
1
1
0
1
1
0
...

output:

49634
49777
49608
49678
49673
0
23
0
1
11
3
37
3
6
13
5
17
0
0
6
0
0
1
0
3
0
0
0
0
0
1
0
1
1
0
0
0
1
0
0
0
1
0
0
0
0
2
2
0
1
1
0
0
1
1
0
0
0
0
0
3
0
0
0
1
2
0
0
1
0
1
1
0
0
0
0
0
0
0
0
0
1
0
1
1
1
0
0
0
0
2
0
1
1
0
1
1
0
0
1
0
0
0
0
1
1
0
0
0
1
1
1
1
1
1
1
0
1
1
0
0
1
2
0
0
1
1
1
1
1
0
0
0
0
0
0
1
1...

result:

ok 33327 lines

Test #22:

score: 10
Accepted
time: 29ms
memory: 7540kb

input:

100000 100000 8
0
1
0
0
0
1
0
0
0
1
1
0
0
1
0
0
1
1
0
0
1
1
1
1
0
0
1
0
1
1
1
0
1
0
1
1
0
0
1
1
1
1
0
0
1
1
1
0
0
0
0
1
1
0
1
0
1
1
0
1
0
1
1
1
1
1
1
0
1
1
1
0
1
0
1
1
1
0
0
0
1
1
0
0
1
1
0
0
1
0
1
0
1
1
1
1
0
0
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
0
0
1
0
1
0
1
1
1
1
0
0
1
1
1
0
0
0
0
0
0
1
1
1
1
1
1
1
0
...

output:

0
1
0
0
0
0
0
0
0
0
0
0
0
2
2
1
1
0
0
0
1
1
0
0
0
0
0
0
0
0
2
0
0
1
0
0
1
0
1
1
1
1
1
1
2
2
2
2
0
0
0
0
0
1
1
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
1
0
0
1
0
1
1
0
0
0
0
0
0
0
4
0
0
0
1
1
3
0
0
0
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
3
0
0
0
0
1
0
0
1
0
0
0
0
0
0
1
2
2
1
1
0
0
0
0
0
0
0
0
1
1
1
1
1
1
3
0
0
0
0
0
...

result:

ok 33429 lines

Test #23:

score: 10
Accepted
time: 29ms
memory: 7476kb

input:

100000 100000 4
0
0
0
0
1
0
0
0
1
0
0
0
1
0
1
1
1
0
0
0
1
1
1
0
0
0
0
1
1
1
1
1
1
0
1
1
0
1
1
1
0
0
0
0
0
1
0
0
1
1
1
1
1
0
1
1
0
0
1
1
0
1
0
1
0
1
0
1
1
0
0
1
0
0
0
0
0
0
0
0
0
0
1
1
1
1
1
0
1
0
1
1
0
1
1
1
1
0
1
0
1
0
0
1
0
0
0
0
1
0
1
0
1
1
0
0
1
1
0
0
0
0
0
0
1
1
1
1
1
1
0
0
1
0
0
1
0
0
1
0
1
0
...

output:

45
56
29
2
28
0
0
10
0
0
0
1
0
0
0
0
0
0
1
1
0
0
1
1
1
1
0
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
1
0
0
0
1
0
0
0
0
1
0
0
0
1
1
0
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
2
0
0
0
0
0
1
1
1
0
0
0
0
0
0
1
2
0
0
0
1
0
0
0
0
0
0
0
0
2
2
3
4
0
1
0
1
1
0
0
0
0
0
0
0
0
0
0
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0...

result:

ok 33229 lines

Subtask #3:

score: 10
Accepted

Test #24:

score: 10
Accepted
time: 33ms
memory: 6696kb

input:

48662 97584 1
457763223
567417990
547698382
404980899
508084856
321560469
213933122
320297256
414027160
513932586
465952405
966672664
308436451
687548803
961967519
806606189
202023199
607464833
405105242
985789609
601637490
206795649
496918689
675922382
904521205
585493621
179925259
918588820
384456...

output:

6220539208569
2728935996818
4177509499445
2355264037524
343138786324
12524297835955
460916897918
13085418188808
2559626931218
6788549715177
3806268160651
9205062956373
494665227673
6076213252428
3150939854848
4490440345136
138987469025
16959115978727
13656299036184
5035084345188
297466145992
1556689...

result:

ok 32591 lines

Test #25:

score: 10
Accepted
time: 30ms
memory: 5704kb

input:

33244 89483 1
233655286
133541314
340763575
602506206
877066542
572536402
31440309
948284759
165886570
125902742
263612107
346028141
137761162
148380305
803841710
20619466
247495175
753059035
919793351
365948805
765779722
508598625
606523260
303770742
912095744
852140190
456810641
220751906
36687903...

output:

4656949851708
316996421519
448208104516
8715246208872
302851438397
4333124183511
446833935012
2970974195360
9197053340853
6129972446089
9084289495572
483911114568
4212660672773
5189293213867
6878150490235
1030829132470
630023615177
7156576477003
384313238611
1682444716459
5478343143677
8398929049868...

result:

ok 29824 lines

Test #26:

score: 10
Accepted
time: 36ms
memory: 8464kb

input:

77193 61844 1
731850013
248830811
433375241
374780639
327230227
732265485
350007365
131676737
631431557
90011156
163269450
131103705
385844164
374940001
370732932
687430139
242875855
407031383
908063508
764907141
792447233
811448376
61895352
299849880
336595155
17558391
501644283
835061667
770686927...

output:

13701102459139
29114216076052
4009926935220
11113747156484
8187823184077
6358918737997
8066463970305
10084978970246
17815828083624
8831490325726
4241379739153
3723925634914
161216656520
382256339116
418878208752
9060275732272
2352982584464
2300116267565
2305640952121
3720372133466
2573558526023
1118...

result:

ok 20763 lines

Test #27:

score: 10
Accepted
time: 43ms
memory: 9732kb

input:

98632 78667 1
431093597
736211983
557943385
257627583
454192901
320344653
990378798
872000213
482320603
641947295
67553543
373478880
775382491
838026072
274297030
591357457
886887461
995148829
433711211
609867707
447733434
212274806
394519372
44163167
517533295
678450331
379115977
568150824
61824525...

output:

5237577170457
11198742667776
1731390436356
15620215192891
24747955637525
10470682460798
30930904802773
2329574783353
21842799534186
4132728589061
13526291849745
13543386471956
42866978626131
11465771882525
183464571787
2852803788237
24515991308552
33554877253160
21018151510561
6617137023773
49046647...

result:

ok 26272 lines

Test #28:

score: 10
Accepted
time: 53ms
memory: 9860kb

input:

100000 100000 1
622654507
434432775
443086457
418144342
510448587
215161387
942676097
505655086
170571298
344855648
981404932
111462263
55843920
364588792
506818839
208166870
925784589
945648958
928663915
791918395
418865879
763783283
640871755
552002631
863308771
191349838
555003267
368779841
33856...

output:

27226875955803
13096073061643
7043546348343
10332915949938
23746993149003
218022668125
20751954443778
2088198051594
6102313078520
8525832410516
11689205461497
10836556024865
23737814272450
6611374206717
10129008529341
3093721431850
8628176209989
25966784265757
10472902213718
2472342403664
8005052107...

result:

ok 33234 lines

Test #29:

score: 10
Accepted
time: 53ms
memory: 9936kb

input:

100000 100000 1
452230581
420865819
35801226
175302398
186256715
673444385
127128912
821521943
250348784
944023367
603615304
42059636
182233946
469686177
286429911
401716126
88867510
268690338
634351910
933095090
601880891
319096342
712675935
427509091
378837759
893578491
937469552
831293199
6819319...

output:

5639623024797
3361744371671
23905811782563
15613051352651
20405648587618
397660937240
12516410327589
6879305586084
23527130990121
7359371114004
41652678270170
35035443509714
8832817058487
8045065775144
8850946374308
19121166737037
68345625492
19514071894454
9102200930438
1911069540666
12050912873387...

result:

ok 33554 lines

Test #30:

score: 10
Accepted
time: 50ms
memory: 9892kb

input:

100000 100000 1
72444037
639835686
534607029
926915006
662027381
768358542
537251255
35690151
3835710
835407440
2141323
546357910
972745716
406783198
126561518
404672813
272784911
585467685
703067748
914563042
169756707
122596182
107503004
444571432
50257138
658978365
88093762
776171320
383938279
29...

output:

6787448868897
18370844800366
23149412797395
8161022817577
1223946308630
8804495936580
7700838326192
7606841919921
1427467029052
44944873575
7077137128292
8751880728022
15160170255749
10151368210375
18879451131553
16804107026467
37756565731863
24513279886651
5258963343464
1010993001610
7373026856374
...

result:

ok 33342 lines

Test #31:

score: 10
Accepted
time: 53ms
memory: 9960kb

input:

100000 100000 1
107096852
592564447
15258270
509759560
93502465
495914247
281278537
709963169
495472104
84736812
465416909
658828230
555629425
313663549
188001955
3180665
965316532
768558595
123547096
270444219
905263621
588836685
746833418
888312675
185710075
347163401
413122151
376311448
626710007...

output:

15463581302440
8548946307276
15206541545414
2849932347067
4717165349166
12319067979664
11659946812904
82819104894
5189254369189
10899332696022
3710413076502
8425482962697
19782592137756
2377416775687
52107045140
23817476443364
38210986051372
14358019192440
12988214599033
47480729202
22695420191106
4...

result:

ok 33418 lines

Test #32:

score: 10
Accepted
time: 45ms
memory: 9812kb

input:

100000 100000 1
295541766
834008531
751994565
736602808
354851056
339744984
763271799
91052211
648494725
872768170
764517741
644654933
410231765
624970385
467093796
390724836
485682320
105775028
459656962
604960719
838039129
97093312
5675548
877855816
169706209
338916592
205994957
124934762
81847899...

output:

50261582310982
50199193542872
50143176982946
50169949644992
50081439329008
50103928234687
50137708966978
50055425147609
50237754280410
50115170662819
50151490793603
50104444819043
50221678601584
50209882640391
50127759899776
50158387940090
50148086712651
50121137962005
50145574138804
50206539592319
...

result:

ok 33204 lines

Test #33:

score: 10
Accepted
time: 48ms
memory: 9904kb

input:

100000 100000 1
518421834
328266731
973633247
827473575
680164230
896496597
349460683
808041747
614457384
417725315
508687600
941307627
785536612
985869614
911880253
892335510
717324499
898178350
118632209
94145297
286732292
629403937
691137057
285933836
94895727
126558755
848019741
459094426
488267...

output:

49933829860900
49968632139468
50037298879023
49998640706705
49934058462085
49932483358617
49966150193658
49986236208573
50017098118669
49992714229716
49975847179945
49935058035962
50005601246704
50060227271872
49923941155521
49980929328928
49903507224252
49958254162177
49872140900587
49945081868846
...

result:

ok 33284 lines

Test #34:

score: 10
Accepted
time: 48ms
memory: 9856kb

input:

100000 100000 1
996317637
363219669
216263784
192826385
630084413
125035984
657508949
57483223
266908629
281091784
610437611
834385554
426355606
357598058
127522771
812595860
229777572
538403360
943723842
408526479
67071477
847544351
243993284
578471715
281861835
194164948
545553282
88331423
6093198...

output:

49843280232652
49864355212642
49905279336839
49876386397678
49845274084421
49892170651453
49959461372140
49840746838092
49797272236519
49847957901231
49858312369155
49793304704682
49822235852255
49766679180094
49848150983350
49854132618995
49802557260341
49855591712762
49836431337858
49744197727169
...

result:

ok 33438 lines

Test #35:

score: 10
Accepted
time: 48ms
memory: 9860kb

input:

100000 100000 1
807246239
289172735
11193606
179262405
379681333
589250474
755038924
155522112
787190027
286875601
430124232
908900662
488848215
787314892
698649282
651168068
538904684
536345683
166727635
602672993
595281203
118915748
396190996
600720647
644717524
581476819
102476925
172562204
97112...

output:

49884651444799
49991206125829
49868730863537
49962451817461
49799940589375
49937146052161
49896796286840
49883414067069
49846456943707
49938956034991
49922563488945
49783499322869
49911778940497
49819333284901
49840256453138
49931409937199
49909937290771
49947734658352
49875488071378
49913328573189
...

result:

ok 33251 lines

Test #36:

score: 10
Accepted
time: 37ms
memory: 7456kb

input:

100000 100000 1
1
1
0
1
1
0
1
1
0
1
0
0
0
0
1
0
1
1
0
0
0
0
1
1
1
1
0
1
1
0
1
1
0
0
0
0
1
0
0
1
0
1
0
1
1
0
1
1
0
1
0
0
1
0
1
1
0
1
1
1
1
1
1
1
1
1
1
0
1
0
1
1
1
1
0
0
1
1
1
1
1
1
0
0
0
1
1
0
1
0
0
0
1
1
0
0
0
0
1
1
0
0
0
0
1
1
0
1
1
0
0
1
0
1
1
0
0
0
1
1
0
1
1
1
1
1
1
0
1
0
1
0
1
1
1
0
1
1
0
0
1
0
...

output:

31400
18342
19613
3272
10105
3014
53
6045
10800
2016
16037
1775
16869
4565
15851
29620
4614
32700
1768
5995
1417
3384
537
19261
3508
42331
4076
106
5863
8637
10874
4693
24167
4423
5404
9422
564
5407
13576
4362
7308
20828
38654
15508
5294
3467
22851
4349
28014
20206
26660
2154
422
4933
29258
6631
105...

result:

ok 33270 lines

Test #37:

score: 10
Accepted
time: 38ms
memory: 9896kb

input:

100000 100000 1
43446954
465921434
421868647
52481473
40002334
953070129
931161525
754404674
288913883
652117509
621179108
153524326
223710624
137606617
239407226
752087617
612664804
89340991
200673801
96131237
763690269
972036188
246598674
815032467
724851896
324729464
860660992
290773462
811034747...

output:

49818377636604
49822609722168
49818425919215
49783926147204
49750818548924
49913122645433
49729636938831
49779181274371
49769271606195
49840858939213
49755293540780
49716307035371
49828176719427
49693605892061
49816027525941
49828059143619
49798433275655
49759219691130
49733981162401
49775698774299
...

result:

ok 100000 lines

Subtask #4:

score: 75
Accepted

Test #38:

score: 75
Accepted
time: 37ms
memory: 6772kb

input:

51292 69434 8
964601536
75869486
588703555
139051899
918962701
96919689
444493613
910927420
149343850
465426821
775208774
683532195
587999952
430991633
472026969
379374690
652080244
859796447
108220724
260171526
671267762
935806924
164967271
389154281
933544751
594736083
577014511
774226369
56111615...

output:

14017678726653
3315598666170
1018990244
699842810776
19821996
387499132918
567912724478
95984714513
3436926778
579700646674
28785912829
110084706529
130162284568
159463844062
40105346315
9426567609
42525865
3699892081
779
12288138025
109960
2127406652
3056998
518171671
13829302
765843
305899978152
0...

result:

ok 23131 lines

Test #39:

score: 75
Accepted
time: 39ms
memory: 6912kb

input:

52142 80496 10
919620948
24490233
852916213
666745494
787899426
787510693
378656947
606194450
404037695
831402649
164456125
793200941
972061595
23833741
884866708
490111353
193341096
908296998
314450315
988069948
76629587
616374222
244697927
770155578
806091900
77543771
714138120
972558124
92702920
...

output:

21761111339968
4734793268014
7860539371322
16925946579879
240754646615
435961708629
2595518898234
1337568552414
1207002945411
257594683458
872773280
505305012
2526677520
193264070205
1698745464
227397789093
685493884
476874053
55881755321
345815063430
1020737559
65673914599
105241551760
199461415
96...

result:

ok 26851 lines

Test #40:

score: 75
Accepted
time: 49ms
memory: 6440kb

input:

44901 48943 2
19956800
123431723
995837130
443687982
140886746
126738985
59628925
953641686
379884207
974231242
719105313
505673703
316928666
326087810
355093684
526925679
362487087
967994411
337399510
622246224
645697566
256014018
599004458
161863495
477546237
244609972
606848348
564440437
70178418...

output:

507513230093
10521195853760
44585987732
2813816785473
1045237698486
743460971186
2778170895132
13824617316328
9418956951029
1708043623439
3164331740683
782820892514
2309954972646
2284832127315
133724006437
1364664024701
2136054887136
671005306763
353100431959
218707157244
661572462403
35317101706
30...

result:

ok 16265 lines

Test #41:

score: 75
Accepted
time: 42ms
memory: 5700kb

input:

32095 94901 4
651433548
12809986
247022567
588182187
365400928
736877361
21053872
270980265
579212533
201582405
698810644
529047497
623519877
808014741
994198197
265727510
581326282
93143844
156790226
716187645
489096541
405119240
383336699
408064916
666845336
773939958
929751244
147674237
527292628...

output:

1867288868137
2327357473307
808972239367
491046080983
55331926035
463554694876
543280699918
2214957918240
1211907309413
13643028879
52927015777
123857873868
116844843535
4158311020
299601262515
1871903695578
159348128682
52145449141
92338696528
312158229235
103820152493
725648134467
164948707229
167...

result:

ok 31665 lines

Test #42:

score: 75
Accepted
time: 64ms
memory: 9888kb

input:

100000 100000 9
362467515
718743229
892634197
400649046
871316993
335253741
403216139
246782563
602363437
350149457
831277823
49278691
402209031
728009061
13804339
46244285
635655285
663282882
693691016
724078456
716654863
617839022
235964792
841963713
768942624
748520560
342840390
251048479
9883289...

output:

1109329215038
3881777708186
10775208275672
2127100254957
23693848776
31110734788
118306946716
2396499074
23014180041
55891177842
2449412357
646842829340
2255379274
6841891174456
324333771392
149567912469
5745296
735262564
4229410253
101374
8911479
306029073708
131236
1545538
1694
3075773510
88855060...

result:

ok 33350 lines

Test #43:

score: 75
Accepted
time: 77ms
memory: 9872kb

input:

100000 100000 5
907288156
495239650
635363336
673397472
447123372
957919169
511637966
854504791
854611672
848990593
953915165
151361636
475985021
200531354
940706941
32382512
806200191
443573994
273619994
473145092
903018033
6352120
737613388
693234003
633307738
856390171
539100106
68904071
92905357...

output:

312227441720
5275799933614
4697957097584
144926480060
192306020379
5464821990831
97296585534
6058661561595
113822969326
35664047726
7772340838870
279451299133
27540014836
77323559698
3693800398
1155101414718
44598579656
10929328988
26627957653
8602841
38206408
484040512663
6443184019654
5165703911
3...

result:

ok 33214 lines

Test #44:

score: 75
Accepted
time: 66ms
memory: 9880kb

input:

100000 100000 10
876520884
298327149
965118598
517544910
792704679
876008596
704099488
912192544
800591627
284192125
855505667
642975584
145812208
393395912
553534767
991171713
645474507
450524139
294085948
690649880
551889375
582323434
1253045
492538746
635612838
437209212
262870581
292556164
91834...

output:

6279381475320
834359236163
261132673308
189846247584
39115828455
838465840
15001580456
12210190
15792751979
364319660
1144068120269
1087025812
32503350
4142708923
1218434110481
221008174
62559629
10844417579
806468245
2096392560
4886
73096177
4084809
0
720720134
20364715
8083
813
229204479
13743554
...

result:

ok 33511 lines

Test #45:

score: 75
Accepted
time: 82ms
memory: 9876kb

input:

100000 100000 3
352256624
927265817
176810023
477701722
252895157
483461964
394165172
215774894
627818532
926041991
187675791
127675408
646176833
935818487
318244369
140398902
79792236
630791479
827698392
129230477
563008427
665962631
721894449
946164772
284452051
577166419
794964396
962211738
57415...

output:

424518321452
413705668891
148194541679
365938858648
43586110785
818096800283
82749567963
683588067
72684010003
694033202
379988154021
67214031022
135916998
229305252
1707789853
246894049835
2729311624
200616725
370001081742
2884419338
148145288
2648685878
2053800179
2018586565
1808250854
11312953
58...

result:

ok 33455 lines

Test #46:

score: 75
Accepted
time: 71ms
memory: 9884kb

input:

100000 100000 4
81226711
73980039
787325537
527629395
386304251
221960172
774502243
85334426
655274084
913083042
324790815
155268972
234169064
72676702
670211085
126383356
882661838
259470401
281978341
579686538
15692756
393674761
837215510
936208212
418883151
537115207
951294854
245182652
391717149...

output:

49773695590952
49802270786403
3113353858884
781058875864
780322484695
194828250077
200958318773
197150708922
209141677007
8936107530
6612163014
5994463540
1089027649
2074332367
2581041209
2393559906
2311934893
8570155473
922845700
11457677936
718953495
1248348016
104803270
211054927
982486021
114600...

result:

ok 33245 lines

Test #47:

score: 75
Accepted
time: 78ms
memory: 9828kb

input:

100000 100000 3
467920760
674147208
303651504
75738728
190711413
656021425
206994657
135786145
495365236
593070330
560093766
449406138
274860595
799864715
60972080
556914675
557253529
230112834
173552176
337301301
452683436
598288703
578646546
364968212
674984774
160535215
359770366
123436422
798702...

output:

49711354740648
49813921223462
624585461327
39016194516
24575147055
15683389269
8750362256
8210339655
803803921
16910153
47466766
998564805
5302129059
1759949788
628496283
68643596
68630923
68794338
68596158
74102393
7635343
33047400
847008
412441594
412629962
2801526928
3244816305
2265557153
2257253...

result:

ok 33263 lines

Test #48:

score: 75
Accepted
time: 65ms
memory: 9804kb

input:

100000 100000 7
332415886
27870195
178402742
913212738
970126639
354902674
6456550
362864716
667836114
958021892
742810340
496094287
28889872
290485123
708029925
722704599
242087082
988767072
671591133
849142053
333955846
761440288
752310547
776471989
861466415
365648214
134413521
358051261
86226334...

output:

7162181536301
190455977516
200683880766
32085354803
34202432786
1139251821
37236240546
9879641917
613046218
534010207
548645535
584540512
964286799
2148408600
897123222
293001195
256684955
486977770
4440553828
938135382
1424856168
4793318300
4029017
81153322
1381446
824671907
825052693
212303596
520...

result:

ok 33097 lines

Test #49:

score: 75
Accepted
time: 101ms
memory: 9892kb

input:

100000 100000 2
813423429
747753030
616971043
346378301
783172992
478952592
209400908
23994834
988487364
750227317
169206154
168482849
834061660
90264510
352447373
357379599
11021521
84957156
390147815
806846982
810758130
418382404
796947777
881061847
117507547
313335892
411481659
267791604
19738103...

output:

49882872334224
12474278755285
12468964002677
12437665311349
6242893583584
6270631800294
3111200534942
778393254444
391124224481
205638247256
195390787814
201039940144
198333493709
223267135841
48950670587
50452530922
62422425249
19059958541
3814747355
3155629594
3942787914
2476618400
1223704587
4070...

result:

ok 33008 lines

Test #50:

score: 75
Accepted
time: 26ms
memory: 8384kb

input:

75759 23701 5
532815403
194430423
363129652
978862206
831316137
823311125
749420280
979041050
798844907
968629917
244943818
891013468
471604457
286101775
307931610
350500106
954569073
774817369
170469649
877443972
202097870
204437053
150536341
237877170
222880719
729839009
554415753
135766806
933026...

output:

1839036261724

result:

ok single line: '1839036261724'

Test #51:

score: 75
Accepted
time: 23ms
memory: 7936kb

input:

67711 15274 9
638494670
861852800
11882696
531342451
467959237
775486692
947856462
803733045
308511732
768561095
61471250
992322012
152537229
239972998
895547965
206787817
208665850
340311577
223078185
882984513
585216013
300630913
116886012
161777413
516410087
728878206
312637399
705672700
21118196...

output:

10308347085579

result:

ok single line: '10308347085579'

Test #52:

score: 75
Accepted
time: 71ms
memory: 9800kb

input:

100000 100000 3
333822597
755968796
466276746
754031204
408456980
950539895
376370026
728405009
988066698
866734986
531613022
175857274
101461981
338194986
269402963
113247214
963133115
32296670
977230524
791333094
769280389
859840393
945828692
871455132
556627076
882513645
221858165
964326764
76929...

output:

18709439017381

result:

ok single line: '18709439017381'

Test #53:

score: 75
Accepted
time: 67ms
memory: 9884kb

input:

100000 100000 6
568201730
13366115
537966100
757031179
496127866
231209597
549312292
114280446
689030102
849510865
832113899
974794821
828127665
70599220
749897136
40527617
653863915
123339367
990976171
194134045
285437766
183281594
646234055
211195718
740668885
184267237
646674805
395806830
3656063...

output:

2874468375049

result:

ok single line: '2874468375049'

Test #54:

score: 75
Accepted
time: 52ms
memory: 9764kb

input:

100000 100000 6
874694345
352930555
679933764
339984904
727979361
334305031
885848434
958870469
58839325
860305883
934402706
755689166
851287423
801889236
931719325
786814553
635892020
901144934
137745971
259362138
222155147
127777159
900186950
423252730
822312272
951878304
127097168
265058725
48272...

output:

0

result:

ok single line: '0'

Test #55:

score: 75
Accepted
time: 48ms
memory: 9952kb

input:

100000 100000 10
505050158
641392808
147856943
974370265
923643244
147520517
300628362
324827798
152744872
408911509
323359331
118418600
763784139
155966074
291846096
273578744
100978152
782621058
80716831
371967206
811396570
748022840
386760907
851302671
982790349
928860559
464345979
367722341
2077...

output:

0

result:

ok single line: '0'

Test #56:

score: 75
Accepted
time: 49ms
memory: 9804kb

input:

100000 100000 9
596990458
369632413
693123292
20047356
386564581
949295259
772012517
87470077
77025345
562861692
597755770
576102834
878897900
952879340
586479750
754556946
487339207
420893946
305382224
344880047
208820969
971037169
895545697
770931259
723797748
490514580
8800376
635310039
523214540...

output:

0

result:

ok single line: '0'

Test #57:

score: 75
Accepted
time: 48ms
memory: 9860kb

input:

100000 100000 8
751411777
114065530
65057235
843192130
29155364
768800701
48637185
177392623
367976878
505240843
581788006
249151910
261786179
598357390
892045941
967271047
601877207
284497013
272212988
467964505
760115319
877661199
836623925
811026880
304517846
552646394
321748555
277873812
4650363...

output:

0

result:

ok single line: '0'

Test #58:

score: 75
Accepted
time: 38ms
memory: 9952kb

input:

100000 100000 9
58943385
923640398
934850573
2978364
55458773
58273543
424734517
731225643
16723406
50975108
526819088
781712759
350724944
65833698
822844807
674904883
320908260
227279889
96925480
175048738
935584109
541456290
134890657
602704530
106054035
517125649
330938388
112807789
763631625
516...

output:

50041684932018
49867004553444
49966327342464
49831735579633
49989608811620
49949734269925
49888072189892
49925122743889
49993743769956
49926366453502
49895779231650
49929286933347
49849140173987
49888437180368
49913684907294
49905658001880
49874377351826
49907877137232
49951206715717
49856117107639
...

result:

ok 100000 lines

Test #59:

score: 75
Accepted
time: 37ms
memory: 9868kb

input:

100000 100000 6
788880387
466854001
967524113
139919555
562462109
763656115
983410015
299218394
341687430
937116537
298501783
494675448
269205391
225261926
283284715
704506964
3984161
68666402
999818098
501861611
107582382
965916560
144461595
55285505
590028019
753464958
462073069
648955432
89159103...

output:

49925342635743
49767772097879
49913476427608
49929565378805
49898884345503
49756008596111
49879934142625
49878578408478
49785289003415
49890812046925
49883703934256
49801778702724
49808682779872
49893518540622
49903360276106
49841416905322
49907005962523
49827721271425
49858177408374
49848894302820
...

result:

ok 100000 lines

Test #60:

score: 75
Accepted
time: 34ms
memory: 9876kb

input:

100000 100000 5
113849713
901934617
952292049
244255218
541127176
394911585
445604413
839990580
746078425
618397514
98999881
243012470
401944060
188302496
851819795
504196950
239930663
122803391
768184189
578714327
270412171
804682252
946784586
281047198
906346641
223804034
417799610
46898243
250273...

output:

49790810542937
49925720350449
49897102627297
49741731738041
49812264609761
49778167349120
49857169458312
49923390664937
49792065977089
49815627602000
49940075669498
49956095652817
49917226620900
49736082005544
49871858871215
49826121726980
49829948341652
49801401423206
49836662290893
49738748393600
...

result:

ok 100000 lines

Test #61:

score: 75
Accepted
time: 75ms
memory: 9896kb

input:

100000 100000 4
658252264
308286727
62918086
709286087
827596892
324872461
118395756
543204549
970166985
300589801
936825826
302996083
68761319
324082463
417718054
920657611
566021502
982573979
776413774
119123926
237261767
678730818
654600843
372610641
61971627
506588775
500994634
800440448
1686427...

output:

49902391653897
832991271625
825229685186
816590702866
831667438531
48828165469
87895617456
61275391350
72205552112
60427618553
16999435163
53999033208
19927518800
3385199563
17444422602
52095952
18547468102
5757394697
1656348057
5255610853
553765559
554471209
19160974372
749214605
712000627
79563197...

result:

ok 33171 lines

Test #62:

score: 75
Accepted
time: 75ms
memory: 9888kb

input:

100000 100000 4
361249523
158908494
431058195
700942799
403910530
312890865
176465498
786329927
376993808
469722219
679081845
455888501
303426914
846566926
263245797
937563076
675106070
203135570
161674542
865891590
290623786
440418474
264042031
946881999
825258608
236118451
264870559
305575730
7570...

output:

12506717657937
3137893054885
3129245468274
197246655434
198491839137
197748747294
14085550368
3649921116
135658275
2317087877
31444330
26635102
109497990
3367882558
542132018
287501403
1317924544
1571901230
98418061
411131612
25695369
25722559
28277251
1670521864
417630460
662882042
662835678
965552...

result:

ok 33252 lines

Test #63:

score: 75
Accepted
time: 68ms
memory: 9872kb

input:

100000 100000 7
616512262
68635673
963980870
820714006
51051659
640902355
374541098
479556042
623390237
425523944
126794209
986986699
235060466
452135141
89640274
462784703
32520083
478631191
893929257
37877959
845700076
881893094
470749816
353708333
744275043
375359370
31843776
901250954
827164535
...

output:

7105576325259
7144031575534
7177022479493
7137219915391
150604358345
156456495312
20779848099
479650526
547694588
78276585
16016104
49095583
16463567
525434683
2139347639
2139184457
2142289532
2139172785
412481354
412428371
412455447
995432407
1739701256
7713612708
1736246965
259183764
1243454150
12...

result:

ok 33468 lines

Test #64:

score: 75
Accepted
time: 71ms
memory: 9812kb

input:

100000 100000 5
954521647
510570047
158384385
368937641
34511703
487506034
427947627
127239854
785579672
374694424
552946886
657064434
691662844
92819939
838189510
807211748
768391096
419794529
431574707
326045615
866470812
856865027
160035291
987199932
241563683
928128957
353827416
265328927
555038...

output:

49788726752754
10021687725328
9942648199973
83639114092
15953812378
16393693780
4312226061
882192980
2740323046
8880066707
6666477528
210571500
491673283
1328274372
1583094116
1585321036
632061588
124655212
124655212
457421442
1231785753
970777653
970775072
970858333
1948937042
398877583
398880522
3...

result:

ok 33296 lines

Test #65:

score: 75
Accepted
time: 96ms
memory: 9800kb

input:

100000 100000 2
999998676
999998412
999998646
999999933
999999884
999998488
999998335
999999746
999999893
999998896
999999750
999999091
999999585
999999619
999998795
999999572
999998715
999999562
999999805
999999297
999998838
999999065
999999371
999999279
999999781
999998419
999998373
999998849
9999...

output:

29285970027674
1544498433902
8270741508147
20714541466458
198999797301
1434405079158
1274123805803
1318296006676
32843715716
102843642778
59839778870
353007449549
438667655461
297857189646
56909123019
81605470913
1487248475795
7224999329
92759336877
48172619382
4976202953
347189087462
1693955276
931...

result:

ok 32904 lines

Test #66:

score: 75
Accepted
time: 96ms
memory: 9956kb

input:

100000 100000 2
999999636
999998901
999998024
999999739
999998729
999998463
999999281
999999737
999999491
999999790
999999806
999999368
999998209
999998426
999999610
999998070
999998976
999998261
999997971
999998340
999999484
999998583
999999051
999998714
999999565
999999887
999998761
999998853
9999...

output:

17544981928123
50030948625126
29753969598284
867499094035
18292481250126
8471491375599
3066996875897
18228981491655
11411488407583
3606996311011
316374681874
10993613782969
17506576028804
7156461453778
13730017537216
2499106858641
58839792435
90937403577
656550211762
3019649413055
2567622459287
5321...

result:

ok 33072 lines

Test #67:

score: 75
Accepted
time: 95ms
memory: 9892kb

input:

100000 100000 2
999998480
999998244
999999701
999999217
999998476
999999645
999999722
999998436
999999467
999998608
999999053
999999434
999999407
999998855
999999438
999999332
999999241
999998502
999999715
999998605
999998816
999999799
999998288
999998307
999998297
999999035
999999438
999999836
9999...

output:

7622742175773
11644988086366
20822353733040
461624522221
1234498740930
25961223554592
7420242575871
29124969772
18954480677589
11931925416097
6563993304439
2150185334851
8900928545347
113499886730
783561687444
1907685664172
252999739804
1045092697133
494530764141
2286122714356
3113075004926
19100762...

result:

ok 32987 lines

Test #68:

score: 75
Accepted
time: 96ms
memory: 9868kb

input:

100000 100000 2
999998428
999999194
999998948
999997992
999998122
999998031
999998900
999998993
999999584
999999982
999998559
999998762
999997958
999999832
999998936
999999172
999998329
999998950
999998826
999998917
999999946
999998414
999998661
999999054
999999472
999999901
999999011
999998274
9999...

output:

58100940412021
38316460749849
21007478448431
3589496380388
1745248195431
12769236880328
12795986901892
319249670245
11265488678897
1687998288957
3886121112718
6077243938443
13324861564912
4263745723994
20383166823810
999999801
6595743469144
1359998644140
4204433248704
1267811194446
18730402914113
27...

result:

ok 32900 lines

Test #69:

score: 75
Accepted
time: 96ms
memory: 9952kb

input:

100000 100000 2
999999720
999998253
999997975
999999701
999999414
999998541
999998835
999998374
999998453
999999413
999999063
999999879
999999244
999999180
999999015
999999137
999999336
999999499
999997978
999998707
999999303
999999537
999999965
999999221
999999308
999999990
999998793
999999090
9999...

output:

8862240964840
8907490962866
44624704305233
25797973782516
3571746466714
8990990805755
32312466935604
661499424948
42516019345825
7228430314157
2207185325639
193749793274
3552871471386
42670519380669
2544185028136
10118771214293
8315811875551
1975873043315
4098277476766
1858248242928
259478379753
199...

result:

ok 33108 lines

Test #70:

score: 75
Accepted
time: 92ms
memory: 9872kb

input:

100000 100000 2
999999966
999999962
999998363
999998458
999999865
999999916
999998528
999998249
999998226
999999027
999998646
999998687
999998084
999999905
999998576
999998570
999998571
999998729
999999754
999999330
999998851
999998480
999999761
999998864
999998037
999997980
999998252
999998537
9999...

output:

911999059206
3003668887321
1735123311416
12749986054
4499011122406
371499610102
2309138379001
2698122318961
415968364118
961499005827
764655485231
8574553841752
590624406121
344202768604
185374807724
3202401105986
71091764840
6621087035
545946805147
1560512344572
585907787865
3642313854353
122405240...

result:

ok 32761 lines

Test #71:

score: 75
Accepted
time: 88ms
memory: 9828kb

input:

100000 100000 2
999999805
999999406
999998500
999998165
999998838
999999606
999999087
999999975
999999190
999999175
999998448
999998583
999998430
999998333
999998435
999998121
999999168
999998560
999999328
999998460
999999815
999998444
999998319
999999358
999999289
999999370
999999541
999999785
9999...

output:

2541497401107
798499243057
13022174214950
13276986444208
710999278423
4825495220645
5954994097775
4222995691779
10846926965194
2250247754252
1776154642587
4648510998027
339030988025
1279287849283
3684887198262
219890447589
1214498751555
732687021278
294046730058
6894665453744
1766615786137
193669785...

result:

ok 32973 lines

Test #72:

score: 75
Accepted
time: 88ms
memory: 9864kb

input:

100000 100000 2
999999580
999998747
999999363
999998406
999999223
999998767
999998799
999998743
999999008
999999631
999998608
999999504
999999636
999999578
999999199
999999534
999998795
999998182
999999303
999999002
999998409
999998224
999999678
999998377
999998790
999999305
999998587
999998138
9999...

output:

6936992983166
22906976557882
1536998425841
27852971742987
6504993316065
5245994634965
19306980220436
5714994199794
827999190721
21845977913672
1857498122616
1614498349234
2934247012347
1503248452158
6760743238477
54249945278
1068436428576
715530516250
269827852730
443765261014
2235872859193
45059336...

result:

ok 33145 lines

Test #73:

score: 75
Accepted
time: 93ms
memory: 9864kb

input:

100000 100000 2
999998335
999999486
999999761
999999388
999998915
999999431
999998409
999998428
999998933
999999162
999999565
999998581
999999801
999998387
999999213
999998680
999998993
999999391
999998884
999998234
999997964
999999129
999997994
999998695
999999177
999999532
999998166
999998056
9999...

output:

16114983569745
20326979213961
39590959543566
45359953721382
16578983344440
33813965614378
64853934079566
46925952216743
19763479831367
1522748428850
20209229450372
32048217551863
1539998449485
44389455078329
12201487727040
33355091244811
1125498857291
31701467940766
153156132796
6724868205094
447261...

result:

ok 32836 lines

Test #74:

score: 75
Accepted
time: 93ms
memory: 9828kb

input:

100000 100000 2
999999594
999998230
999999773
999998073
999998356
999998521
999998041
999998136
999999469
999999822
999999013
999997973
999998448
999999890
999999438
999998747
999999828
999998122
999999916
999999638
999999523
999998557
999999358
999999053
999999284
999998398
999998050
999999656
9999...

output:

35682963525993
447999541732
4298995662794
172999838483
24312225272252
7368742480855
5240369678996
591999374041
1490998578565
7267680294297
3362371850342
2864091142835
5377463583765
776436976016
57999939099
1694420450289
422687192795
4954339152621
6210274984926
441124674385
78281168544
570874484826
1...

result:

ok 33144 lines

Extra Test:

score: 0
Extra Test Passed