QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#130510#276. Split the sequencehoriiseun 100 ✓464ms94276kbC++176.2kb2023-07-24 13:08:212023-07-24 13:08:22

Details

Tip: Click on the bar to expand more detailed information

Subtask #1:

score: 11
Accepted

Test #1:

score: 11
Accepted
time: 1ms
memory: 5544kb

input:

7 3
4 1 3 4 0 2 3

output:

108
1 3 5 

result:

ok contestant found the optimal answer: 108 == 108

Test #2:

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

input:

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

output:

999
6 8 

result:

ok contestant found the optimal answer: 999 == 999

Test #3:

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

input:

2 1
0 123

output:

0
1 

result:

ok contestant found the optimal answer: 0 == 0

Test #4:

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

input:

10 5
1 1 1 1 1234 1 1 1 1 1234

output:

1542524
2 4 5 7 9 

result:

ok contestant found the optimal answer: 1542524 == 1542524

Test #5:

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

input:

10 9
10000 10000 10000 10000 10000 10000 10000 10000 10000 10000

output:

4500000000
1 2 3 4 5 6 7 8 9 

result:

ok contestant found the optimal answer: 4500000000 == 4500000000

Test #6:

score: 0
Accepted
time: 2ms
memory: 7736kb

input:

10 1
0 0 0 0 0 0 0 0 1 1

output:

1
9 

result:

ok contestant found the optimal answer: 1 == 1

Test #7:

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

input:

10 1
1 1 0 0 0 0 0 0 0 0

output:

1
1 

result:

ok contestant found the optimal answer: 1 == 1

Test #8:

score: 0
Accepted
time: 2ms
memory: 7572kb

input:

10 1
0 0 0 0 1 1 0 0 0 0

output:

1
5 

result:

ok contestant found the optimal answer: 1 == 1

Test #9:

score: 0
Accepted
time: 2ms
memory: 7692kb

input:

10 3
0 4 2 2 4 4 3 1 10000 10000

output:

100400096
5 8 9 

result:

ok contestant found the optimal answer: 100400096 == 100400096

Test #10:

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

input:

10 3
10000 10000 10000 10000 10000 1 2 1 3 1

output:

900320000
2 3 4 

result:

ok contestant found the optimal answer: 900320000 == 900320000

Test #11:

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

input:

10 3
9996 9998 9999 9997 9996 9998 9998 9996 10000 9996

output:

3698080248
2 5 8 

result:

ok contestant found the optimal answer: 3698080248 == 3698080248

Test #12:

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

input:

10 4
10000 10000 10000 10000 10000 4 10000 10000 10000 10000

output:

3200320000
2 4 6 8 

result:

ok contestant found the optimal answer: 3200320000 == 3200320000

Test #13:

score: 0
Accepted
time: 2ms
memory: 7524kb

input:

9 4
10000 1 4 0 2 1 3 2 1

output:

140072
1 4 6 7 

result:

ok contestant found the optimal answer: 140072 == 140072

Test #14:

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

input:

7 3
1445 914 9661 6869 604 6980 5672

output:

376041456
3 5 6 

result:

ok contestant found the optimal answer: 376041456 == 376041456

Test #15:

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

input:

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

output:

805
5 7 8 9 

result:

ok contestant found the optimal answer: 805 == 805

Test #16:

score: 0
Accepted
time: 2ms
memory: 7564kb

input:

10 3
10000 1 9997 1 9999 4 9999 4 9997 2

output:

900189994
2 5 7 

result:

ok contestant found the optimal answer: 900189994 == 900189994

Test #17:

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

input:

10 4
9999 0 9996 1 9999 0 9997 4 10000 2

output:

999919994
2 4 6 8 

result:

ok contestant found the optimal answer: 999919994 == 999919994

Subtask #2:

score: 11
Accepted

Dependency #1:

100%
Accepted

Test #18:

score: 11
Accepted
time: 0ms
memory: 5532kb

input:

50 3
3 1 2 2 3 2 3 4 1 4 0 4 4 4 0 0 4 3 3 1 1 4 0 1 4 4 0 1 2 2 2 2 4 1 3 0 3 3 0 3 3 4 2 1 0 1 3 4 3 10000

output:

1093956
16 33 49 

result:

ok contestant found the optimal answer: 1093956 == 1093956

Test #19:

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

input:

50 3
10000 10000 10000 4 0 1 3 3 4 0 3 2 1 4 2 2 2 1 4 2 4 2 1 3 1 0 1 2 3 2 2 0 3 0 3 4 4 0 1 0 3 0 0 3 1 0 0 1 0 0

output:

302460000
1 2 3 

result:

ok contestant found the optimal answer: 302460000 == 302460000

Test #20:

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

input:

50 49
10000 9996 10000 9997 9998 9999 9998 9998 9996 9996 10000 9999 9999 9998 9996 10000 10000 10000 9996 9998 9997 10000 9997 9998 9997 9997 9998 9996 9997 10000 10000 9996 10000 9996 9997 10000 9997 9996 9996 10000 10000 9997 10000 9999 9996 9998 10000 9999 9997 10000

output:

122453454361
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 

result:

ok contestant found the optimal answer: 122453454361 == 122453454361

Test #21:

score: 0
Accepted
time: 2ms
memory: 5548kb

input:

50 3
9998 9999 10000 9998 9998 10000 9996 9998 9997 9998 9997 10000 9997 10000 10000 9998 9998 9996 9998 10000 9999 9996 9999 9996 9998 9999 10000 9999 9997 9998 9997 9999 10000 9996 9996 9997 10000 9997 9997 9999 9998 10000 9999 9998 9996 9997 9997 9997 9999 9997

output:

93663683509
12 25 37 

result:

ok contestant found the optimal answer: 93663683509 == 93663683509

Test #22:

score: 0
Accepted
time: 2ms
memory: 7572kb

input:

50 10
10000 10000 10000 4 4 1 4 0 0 4 1 2 3 3 4 4 4 3 3 0 1 2 2 3 3 3 4 2 3 2 3 2 4 2 0 3 0 2 0 0 4 1 4 2 4 2 4 0 10000 10000

output:

1005304678
1 2 3 12 17 25 31 41 48 49 

result:

ok contestant found the optimal answer: 1005304678 == 1005304678

Test #23:

score: 0
Accepted
time: 2ms
memory: 7528kb

input:

50 7
10000 1 2 0 1 2 1 2 3 4 3 1 0 4 3 3 1 2 1 4 1 4 3 3 0 1 4 2 2 3 1 2 2 0 2 1 1 0 2 3 3 0 2 1 1 2 0 4 1 4

output:

933702
1 9 14 20 26 32 42 

result:

ok contestant found the optimal answer: 933702 == 933702

Test #24:

score: 0
Accepted
time: 2ms
memory: 5552kb

input:

50 25
8300 1781 4510 1499 3323 5656 8037 3964 5309 399 1701 988 3190 7288 6296 8288 8645 4405 4454 683 4963 8675 4693 4935 9403 448 7697 4887 7572 8129 1078 2012 1506 4203 3991 1721 8310 7023 7218 6064 6646 6753 805 5724 59 1566 2362 8171 1171 2095

output:

25082842857
1 4 6 7 9 13 14 15 16 17 19 21 22 24 25 27 29 32 35 37 38 39 41 43 47 

result:

ok contestant found the optimal answer: 25082842857 == 25082842857

Test #25:

score: 0
Accepted
time: 2ms
memory: 5440kb

input:

50 11
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49

output:

687136
15 21 26 30 33 36 39 42 44 46 48 

result:

ok contestant found the optimal answer: 687136 == 687136

Test #26:

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

input:

50 7
9996 4 9999 1 10000 0 10000 3 9997 1 9997 3 9996 1 9998 1 9997 2 9997 1 10000 2 9998 1 9996 0 9999 1 9998 2 9997 1 9996 3 9996 0 9996 2 9999 4 9998 3 10000 0 9996 1 9999 0 9996 3

output:

27295930079
6 11 18 23 30 37 44 

result:

ok contestant found the optimal answer: 27295930079 == 27295930079

Test #27:

score: 0
Accepted
time: 2ms
memory: 5524kb

input:

50 14
9998 4 9997 1 9996 3 9999 1 9999 1 9998 3 9996 0 9998 2 10000 0 10000 2 9996 0 9996 3 9998 2 9996 4 9997 1 10000 4 10000 1 10000 2 9997 2 10000 0 9996 4 10000 3 10000 2 9997 3 9996 3

output:

29000419931
2 5 8 11 16 19 24 28 31 34 37 41 43 46 

result:

ok contestant found the optimal answer: 29000419931 == 29000419931

Subtask #3:

score: 11
Accepted

Dependency #1:

100%
Accepted

Dependency #2:

100%
Accepted

Test #28:

score: 11
Accepted
time: 2ms
memory: 7488kb

input:

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

output:

610590000
197 198 199 

result:

ok contestant found the optimal answer: 610590000 == 610590000

Test #29:

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

input:

200 3
10000 10000 10000 3 1 2 1 0 3 4 3 3 0 4 1 2 0 1 1 4 4 2 3 0 3 3 2 1 2 1 4 2 2 1 3 1 1 2 1 1 4 2 4 3 2 4 0 3 1 4 0 4 0 4 3 4 4 1 4 0 0 2 2 1 2 0 4 1 1 2 3 4 4 1 2 3 3 2 2 4 2 1 0 0 2 2 1 3 1 2 0 3 1 4 3 4 2 3 0 4 2 0 0 4 3 1 0 4 3 4 3 1 4 4 0 1 0 4 4 3 2 3 0 1 0 4 4 0 3 0 1 0 3 3 0 2 4 1 4 4 0 ...

output:

311760000
1 2 3 

result:

ok contestant found the optimal answer: 311760000 == 311760000

Test #30:

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

input:

200 199
9997 10000 10000 9998 9997 9997 9999 9997 9998 10000 9997 9998 9998 9997 9998 9996 9996 9996 9999 9998 10000 10000 9996 10000 9997 9996 9998 9996 10000 10000 10000 10000 9996 9997 9997 9999 9997 9999 9998 10000 9999 9998 9996 9997 9997 9999 9999 9996 9996 10000 10000 9996 9997 10000 9999 100...

output:

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

result:

ok contestant found the optimal answer: 1989216017013 == 1989216017013

Test #31:

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

input:

200 3
9996 9996 9998 9997 9998 9997 9996 9999 9997 10000 9997 10000 9997 9997 9999 10000 9997 9999 9996 10000 9997 9997 9996 9999 9997 9999 9999 9996 9998 9997 10000 9997 9999 9997 10000 9999 9996 9997 9999 10000 10000 9997 10000 9997 10000 10000 10000 9996 9999 9999 10000 9997 9997 9997 9998 9997 1...

output:

1499437552673
50 100 150 

result:

ok contestant found the optimal answer: 1499437552673 == 1499437552673

Test #32:

score: 0
Accepted
time: 3ms
memory: 5556kb

input:

200 140
10000 10000 2 2 0 4 0 4 3 1 1 1 0 0 3 1 4 2 3 2 0 0 2 3 0 4 4 2 1 3 4 1 0 3 0 4 3 3 0 3 3 1 3 1 0 0 3 3 2 1 0 0 1 1 0 3 1 0 4 4 2 0 0 4 4 0 1 4 2 4 4 3 4 0 1 2 3 1 4 3 4 1 3 0 3 4 3 1 3 2 0 2 3 2 2 0 1 2 1 2 3 4 0 1 3 1 0 3 4 0 4 4 2 1 4 3 3 2 2 1 0 3 3 1 1 0 3 4 2 3 2 3 0 1 0 1 4 3 1 0 4 3 ...

output:

1019625819
1 2 3 5 7 8 9 14 15 16 17 18 19 22 23 25 26 27 29 30 31 33 35 36 37 39 40 41 42 43 46 47 48 52 55 56 58 59 60 63 64 66 67 68 69 70 71 72 74 76 77 78 79 80 81 82 84 85 86 87 88 89 91 92 93 94 97 99 100 101 103 104 105 107 108 110 111 112 114 115 116 117 118 121 122 123 126 127 128 129 130 ...

result:

ok contestant found the optimal answer: 1019625819 == 1019625819

Test #33:

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

input:

200 180
10000 0 0 3 4 1 0 0 0 1 2 2 3 4 1 2 3 2 3 3 4 1 4 1 0 2 3 1 3 3 2 1 1 3 1 3 3 3 0 0 1 2 1 3 1 2 1 2 0 2 1 2 4 0 1 4 3 2 1 4 4 3 1 4 0 2 1 0 1 0 3 4 4 4 0 1 4 4 2 3 3 4 4 3 3 1 4 4 3 3 4 1 1 1 4 1 2 2 0 0 10000 0 0 2 3 4 3 4 3 2 4 2 1 3 0 0 2 0 3 2 3 3 4 4 2 0 0 1 2 0 3 4 1 3 3 3 3 2 1 1 0 4 ...

output:

107630884
3 4 5 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 25 26 27 28 29 30 31 32 33 34 35 36 37 40 41 42 43 44 45 46 47 49 50 51 52 54 55 56 57 58 59 60 61 62 63 65 66 68 70 71 72 73 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 100 103 104 105 106 107 108 109 110 111 112 1...

result:

ok contestant found the optimal answer: 107630884 == 107630884

Test #34:

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

input:

200 199
3930 8785 9349 8634 3375 397 4144 4964 6195 190 388 3592 9427 9887 9447 835 5289 9672 932 9118 2787 8461 4376 4951 8493 8157 9047 2564 5196 4502 214 2515 9297 1160 8988 8487 6273 2277 2550 6935 7598 3707 5680 6493 1927 6771 1235 7500 7470 6371 8260 5742 2292 6516 2660 5109 7014 9302 6335 777...

output:

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

result:

ok contestant found the optimal answer: 475357671774 == 475357671774

Test #35:

score: 0
Accepted
time: 2ms
memory: 5704kb

input:

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

output:

193556962
31 43 53 61 68 74 80 85 90 95 100 104 108 112 116 120 124 128 131 134 137 140 143 146 149 152 155 158 161 164 167 170 173 176 179 182 184 186 188 190 192 194 196 198 

result:

ok contestant found the optimal answer: 193556962 == 193556962

Test #36:

score: 0
Accepted
time: 2ms
memory: 5604kb

input:

200 28
9998 4 9996 0 9997 1 9998 1 9999 4 9998 1 9997 0 9997 0 9996 4 10000 4 9999 3 10000 0 9997 4 9997 0 9998 3 9999 3 9997 3 9997 1 9996 1 9997 2 9997 4 9999 4 9999 2 10000 0 9997 1 9999 0 9999 2 9997 1 9998 0 9998 3 10000 1 9997 3 9996 2 9996 0 10000 2 9998 3 9996 1 9997 2 9999 2 9996 1 9998 3 9...

output:

482389919803
8 16 21 28 34 41 48 55 62 70 77 84 92 99 106 113 120 126 132 138 145 152 159 165 172 179 186 192 

result:

ok contestant found the optimal answer: 482389919803 == 482389919803

Test #37:

score: 0
Accepted
time: 3ms
memory: 7576kb

input:

200 56
9999 3 9998 4 9997 1 9999 1 10000 0 9998 2 9999 2 9996 2 9998 2 9999 4 9996 0 10000 2 9998 3 9996 2 10000 2 9996 1 9996 1 9998 0 9997 1 9998 0 9999 4 10000 2 9998 3 9998 3 10000 3 9997 3 9999 1 9999 0 9996 0 9996 3 9997 3 9997 0 9999 2 10000 2 9999 3 9998 0 9996 2 10000 2 9996 1 9999 0 9997 4...

output:

490686959791
3 7 11 14 17 20 24 27 30 34 38 41 44 47 50 53 58 62 66 69 74 77 81 84 87 90 94 97 100 104 107 111 116 120 123 128 131 134 137 140 143 147 150 153 156 160 164 168 171 174 178 182 186 189 192 196 

result:

ok contestant found the optimal answer: 490686959791 == 490686959791

Subtask #4:

score: 17
Accepted

Dependency #1:

100%
Accepted

Dependency #2:

100%
Accepted

Dependency #3:

100%
Accepted

Test #38:

score: 17
Accepted
time: 3ms
memory: 9648kb

input:

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

output:

21503404
342 669 999 

result:

ok contestant found the optimal answer: 21503404 == 21503404

Test #39:

score: 0
Accepted
time: 3ms
memory: 5728kb

input:

1000 3
10000 10000 1 3 3 0 2 3 3 0 0 0 0 1 1 1 0 0 4 2 4 1 2 3 0 2 4 3 3 1 2 4 3 4 4 4 3 0 3 2 1 3 3 0 1 3 4 3 1 0 0 1 3 1 0 3 4 1 0 2 4 4 4 3 2 4 2 3 3 0 1 0 0 0 2 4 2 2 2 3 0 2 1 0 1 2 0 3 0 4 3 3 3 0 3 3 3 2 4 4 3 1 0 0 3 3 3 3 0 3 1 2 0 2 4 2 0 4 4 1 3 2 1 2 4 1 0 1 0 1 0 4 4 3 3 4 2 3 4 0 3 1 1...

output:

140412195
1 2 504 

result:

ok contestant found the optimal answer: 140412195 == 140412195

Test #40:

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

input:

1000 199
10000 9998 9999 10000 10000 9997 10000 9997 9998 9998 9996 10000 9996 9997 9998 9999 10000 9998 9997 9998 10000 9999 9997 9997 9996 9997 9999 9999 9999 9998 9996 9999 9998 9998 9997 10000 9996 9999 9999 9997 9998 9998 9996 9997 9998 9998 9999 10000 9996 9999 9996 9996 9997 9996 9996 9998 99...

output:

49729674225461
5 10 15 20 25 30 35 40 45 50 55 60 65 70 75 80 85 90 95 100 105 110 115 120 125 130 135 140 145 150 155 160 165 170 175 180 185 190 195 200 205 210 215 220 225 230 235 240 245 250 255 260 265 270 275 280 285 290 295 300 305 310 315 320 325 330 335 340 345 350 355 360 365 370 375 380 3...

result:

ok contestant found the optimal answer: 49729674225461 == 49729674225461

Test #41:

score: 0
Accepted
time: 3ms
memory: 7756kb

input:

1000 3
9998 9998 9996 9997 9998 9999 9997 10000 9998 10000 9997 9999 10000 9998 9998 9999 10000 9998 9997 9998 9996 9996 9996 9998 9996 9996 9996 9997 9999 9997 9997 10000 9999 9996 9998 9996 9996 9998 9999 10000 9996 9998 9999 9997 10000 9998 9998 10000 9999 9997 10000 9996 9998 9997 9996 9998 9996...

output:

37485571387523
250 500 750 

result:

ok contestant found the optimal answer: 37485571387523 == 37485571387523

Test #42:

score: 0
Accepted
time: 71ms
memory: 7528kb

input:

1000 200
10000 10000 10000 3 0 4 4 2 2 2 4 1 2 4 2 2 0 1 4 4 3 2 2 3 2 1 0 4 0 3 2 0 2 2 4 2 2 2 0 2 4 4 1 0 2 0 0 1 3 3 2 4 0 4 1 0 0 1 3 3 4 3 1 2 1 0 0 1 4 0 1 4 4 2 2 3 2 3 4 3 3 0 0 3 0 3 0 1 2 1 0 1 2 3 2 0 2 1 1 0 1 2 4 1 3 4 4 1 0 0 1 1 0 4 2 0 4 2 2 3 2 4 2 4 1 2 1 0 2 1 2 3 0 0 2 2 0 3 2 1...

output:

679388326
1 2 3 7 12 18 21 27 32 36 41 49 53 59 62 71 74 78 83 91 97 104 107 116 119 122 128 135 141 145 148 154 160 167 173 177 182 188 193 196 204 210 213 218 222 228 234 242 245 251 256 261 265 270 275 281 290 295 301 305 311 315 319 323 330 333 337 341 350 356 359 364 371 378 382 393 397 400 404...

result:

ok contestant found the optimal answer: 679388326 == 679388326

Test #43:

score: 0
Accepted
time: 57ms
memory: 5572kb

input:

1000 170
10000 2 1 1 2 0 0 1 1 2 1 3 2 4 2 2 2 2 4 3 0 3 3 0 4 0 1 1 4 3 2 4 0 2 3 3 1 1 3 0 3 1 3 1 3 0 1 3 1 0 3 2 1 0 0 2 2 4 4 3 2 0 2 3 3 3 0 1 1 0 1 3 0 1 2 1 2 1 0 3 2 0 1 1 2 3 4 0 4 3 3 4 4 1 2 1 4 4 4 2 10000 2 3 4 3 3 2 3 1 2 0 3 1 3 0 0 1 1 2 2 4 0 2 0 3 1 0 0 4 2 2 1 0 3 4 3 0 0 4 3 4 3...

output:

4699030287
1 11 16 21 28 33 40 47 56 60 67 79 86 91 96 100 101 105 111 119 128 134 139 145 149 152 157 165 171 178 184 189 195 200 202 210 219 223 226 234 238 242 248 253 259 264 271 276 283 289 293 300 301 309 314 320 325 332 341 345 349 356 361 365 372 378 384 392 400 402 408 412 417 424 433 438 4...

result:

ok contestant found the optimal answer: 4699030287 == 4699030287

Test #44:

score: 0
Accepted
time: 71ms
memory: 5664kb

input:

1000 200
7991 3892 7274 6053 1276 9944 927 8532 4969 5774 9351 6702 1825 3554 6717 9891 7682 9239 2993 101 4636 3149 6481 2613 7173 1302 5291 5891 3796 4820 1148 8752 9446 8984 2619 5052 1761 8425 5036 5103 9652 1990 4264 5247 7568 4201 3823 2724 265 7465 249 5506 3919 7649 962 5232 8845 9582 5994 7...

output:

12418819758185
4 9 14 17 23 29 33 38 43 49 54 58 64 70 74 79 84 88 91 95 101 107 112 118 124 129 132 137 142 147 152 158 162 165 173 178 184 192 197 201 207 212 218 222 226 230 235 240 248 253 263 267 270 276 279 284 288 295 299 304 310 315 321 327 332 337 342 346 352 358 364 369 374 377 382 389 393...

result:

ok contestant found the optimal answer: 12418819758185 == 12418819758185

Test #45:

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

input:

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

output:

31093317350
50 70 86 99 111 122 132 141 149 157 165 172 179 186 192 198 204 210 216 222 227 232 237 242 247 252 257 262 267 272 276 280 284 288 292 296 300 304 308 312 316 320 324 328 332 336 340 344 348 352 355 358 361 364 367 370 373 376 379 382 385 388 391 394 397 400 403 406 409 412 415 418 421 ...

result:

ok contestant found the optimal answer: 31093317350 == 31093317350

Test #46:

score: 0
Accepted
time: 12ms
memory: 7548kb

input:

1000 40
9998 2 9996 0 9999 0 9997 2 9999 4 9996 2 9996 4 9997 0 9998 0 9997 3 9997 1 9997 0 9998 3 9999 0 9996 4 10000 1 9996 2 9999 1 9996 3 9999 2 10000 3 9997 0 10000 0 10000 0 9996 4 9999 0 9997 1 9996 3 9998 3 10000 1 9998 0 9999 1 9998 0 9996 4 10000 1 9996 3 10000 3 9998 3 9998 2 9997 2 9998 ...

output:

12194625429236
25 49 73 98 122 145 170 193 218 244 268 291 316 341 366 391 416 439 464 487 512 536 559 584 608 632 657 682 705 730 754 778 801 825 850 874 899 924 949 974 

result:

ok contestant found the optimal answer: 12194625429236 == 12194625429236

Test #47:

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

input:

1000 80
9998 3 9997 2 9996 4 9996 4 9999 3 9997 4 9999 3 9997 4 9999 4 9999 1 9998 3 9998 0 9997 3 9997 3 9996 2 10000 3 10000 2 9996 4 9996 1 9997 2 9996 2 9999 4 10000 0 9997 1 9997 0 10000 0 9996 3 10000 3 9997 2 9999 0 10000 4 9996 3 9997 4 9996 3 9997 0 10000 4 9999 1 9996 0 9998 0 9996 0 10000...

output:

12345131038664
12 24 35 47 60 72 85 98 110 124 136 148 160 172 183 196 207 220 232 243 256 267 280 293 306 319 332 344 356 369 382 395 408 421 434 447 460 473 485 498 509 522 534 547 560 573 587 600 612 624 636 648 660 672 685 697 710 723 736 747 759 772 784 796 808 820 832 843 856 868 880 892 904 9...

result:

ok contestant found the optimal answer: 12345131038664 == 12345131038664

Subtask #5:

score: 21
Accepted

Dependency #1:

100%
Accepted

Dependency #2:

100%
Accepted

Dependency #3:

100%
Accepted

Dependency #4:

100%
Accepted

Test #48:

score: 21
Accepted
time: 4ms
memory: 14584kb

input:

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

output:

1818678304
7492 9996 9998 

result:

ok contestant found the optimal answer: 1818678304 == 1818678304

Test #49:

score: 0
Accepted
time: 2ms
memory: 14428kb

input:

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

output:

1326260195
2 3 2455 

result:

ok contestant found the optimal answer: 1326260195 == 1326260195

Test #50:

score: 0
Accepted
time: 28ms
memory: 14916kb

input:

10000 200
9997 9998 9999 10000 9996 9996 9998 9997 9996 9998 9998 10000 9997 9996 10000 9998 9999 9999 9998 9996 9997 9997 9997 9998 9998 10000 9999 9999 9999 9997 9999 10000 9999 9997 9998 9997 9996 9998 9997 9998 9997 10000 9998 10000 9998 9998 9998 10000 9998 9996 10000 9997 9998 9998 9998 10000 ...

output:

4973126687469639
50 99 149 199 249 299 349 398 447 496 546 595 644 694 744 794 844 894 944 994 1043 1093 1143 1193 1243 1292 1341 1391 1440 1490 1540 1590 1640 1689 1738 1788 1838 1888 1938 1987 2037 2087 2137 2187 2236 2285 2335 2385 2435 2485 2535 2584 2634 2684 2734 2784 2834 2884 2934 2983 3033 ...

result:

ok contestant found the optimal answer: 4973126687469639 == 4973126687469639

Test #51:

score: 0
Accepted
time: 2ms
memory: 14924kb

input:

10000 3
10000 9998 9996 9997 9999 9997 9998 10000 9998 9997 9999 9996 9998 9997 9996 10000 9997 10000 10000 9999 9998 9998 9998 9997 9998 10000 9997 9997 10000 10000 9997 10000 9997 9999 9997 9998 9997 9996 9998 9999 9999 9999 9997 9999 9996 9996 9996 9998 10000 10000 9999 9996 10000 9998 9999 10000...

output:

3748491676694116
2500 5000 7500 

result:

ok contestant found the optimal answer: 3748491676694116 == 3748491676694116

Test #52:

score: 0
Accepted
time: 23ms
memory: 14648kb

input:

10000 120
10000 10000 1 0 4 0 0 0 4 0 1 2 4 4 1 1 4 0 3 2 4 3 4 0 2 1 1 0 1 0 4 2 0 4 3 2 1 1 0 3 3 1 0 4 2 0 2 0 2 3 0 3 3 3 3 1 0 3 1 0 0 4 0 4 4 4 4 3 4 1 4 2 0 1 0 4 3 4 3 3 1 4 0 3 3 2 0 2 0 2 0 1 1 4 0 2 0 0 0 1 0 2 4 4 4 3 3 1 2 4 3 4 3 1 1 1 1 4 1 1 4 1 3 0 4 3 4 0 4 2 3 3 2 1 4 3 3 2 3 2 0 ...

output:

1085432199
1 2 87 168 257 350 432 528 620 701 779 857 940 1019 1103 1190 1275 1347 1426 1508 1594 1690 1776 1867 1949 2033 2112 2206 2301 2386 2472 2549 2639 2702 2787 2868 2953 3034 3120 3209 3285 3367 3448 3518 3604 3699 3791 3869 3959 4046 4134 4223 4310 4385 4468 4549 4641 4719 4815 4900 4990 50...

result:

ok contestant found the optimal answer: 1085432199 == 1085432199

Test #53:

score: 0
Accepted
time: 25ms
memory: 14576kb

input:

10000 140
10000 4 2 0 1 1 4 2 0 3 2 2 0 1 4 1 0 1 3 4 1 3 1 4 2 0 0 3 4 0 0 4 0 3 1 0 4 3 3 4 1 1 0 4 2 0 3 2 4 0 3 0 0 4 2 0 4 4 1 1 2 4 2 2 4 1 1 2 1 3 4 4 3 3 0 1 4 0 3 2 4 1 3 4 0 4 3 2 2 0 0 4 2 2 2 2 0 0 2 4 10000 3 2 2 1 1 0 3 4 3 3 3 2 4 1 2 0 2 2 1 3 4 1 2 2 2 2 0 2 4 0 4 3 2 1 0 1 0 2 1 4 ...

output:

514790755404
54 101 200 277 345 420 501 600 601 700 701 800 879 952 1038 1118 1201 1300 1345 1401 1500 1501 1600 1659 1701 1800 1883 1974 2060 2156 2245 2327 2411 2501 2600 2671 2740 2802 2900 2971 3037 3101 3200 3201 3300 3301 3400 3401 3500 3566 3634 3701 3800 3802 3900 3901 4000 4002 4100 4151 42...

result:

ok contestant found the optimal answer: 514790755404 == 514790755404

Test #54:

score: 0
Accepted
time: 29ms
memory: 14596kb

input:

10000 150
8145 2828 5436 7600 6583 9304 2982 535 1693 4122 1722 3605 8201 461 7369 3241 8186 4190 7598 1839 1167 772 2804 1763 9263 9488 6503 9420 1618 2491 6961 4205 7652 4087 8228 1772 5909 9754 5108 9555 410 6980 5965 2855 3891 1163 244 6287 9098 7890 4869 6865 4461 7835 7121 2465 4672 359 35 125...

output:

1256105310476641
71 147 212 276 340 395 461 539 607 676 741 806 866 935 1002 1070 1137 1208 1277 1344 1406 1468 1530 1590 1668 1732 1807 1872 1939 1997 2064 2134 2194 2268 2336 2401 2472 2534 2605 2668 2731 2797 2872 2934 2999 3065 3133 3200 3262 3325 3401 3468 3525 3592 3663 3729 3797 3868 3937 399...

result:

ok contestant found the optimal answer: 1256105310476641 == 1256105310476641

Test #55:

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

input:

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

output:

3099592898816
202 286 350 404 452 495 537 583 635 696 773 896 1173 1266 1334 1390 1439 1483 1525 1570 1620 1678 1749 1850 2135 2243 2316 2375 2426 2471 2513 2557 2605 2660 2726 2814 3077 3216 3296 3358 3411 3458 3500 3542 3589 3642 3704 3783 3919 4185 4274 4340 4395 4443 4487 4529 4574 4625 4684 475...

result:

ok contestant found the optimal answer: 3099592898816 == 3099592898816

Test #56:

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

input:

10000 140
9997 3 9997 0 9996 3 9997 1 9999 1 10000 4 9999 1 9996 1 9998 0 9997 0 10000 1 9996 4 10000 4 10000 3 9999 3 9998 4 9996 3 9999 3 9997 2 9999 2 9998 2 10000 4 10000 2 9996 1 9997 0 9998 1 9997 1 9997 4 10000 2 9996 3 9998 3 9997 4 10000 3 9998 1 9996 4 10000 1 10000 3 9996 2 9998 2 9998 4 ...

output:

1241131419367412
70 141 212 282 354 424 493 564 635 706 778 849 921 991 1062 1134 1206 1277 1348 1418 1490 1560 1630 1701 1772 1844 1914 1985 2055 2126 2198 2269 2341 2412 2482 2553 2624 2694 2764 2836 2907 2978 3048 3119 3190 3260 3332 3404 3475 3547 3617 3688 3759 3830 3902 3973 4044 4116 4185 425...

result:

ok contestant found the optimal answer: 1241131419367412 == 1241131419367412

Test #57:

score: 0
Accepted
time: 28ms
memory: 14700kb

input:

10000 180
9997 2 9998 2 10000 2 9996 3 9998 1 10000 1 9996 4 9996 0 9998 0 9999 3 9996 1 9997 3 9996 4 9999 2 9997 4 9999 1 9998 3 9997 1 10000 2 9998 2 9999 4 9997 4 10000 2 9999 0 9998 1 10000 3 9996 0 9998 0 10000 0 9996 2 10000 1 9999 1 10000 4 9998 4 9998 2 9999 0 9999 1 10000 2 9998 0 10000 4 ...

output:

1243084101967798
56 110 165 221 276 331 385 440 495 551 606 662 718 773 829 884 939 994 1048 1104 1159 1214 1269 1325 1380 1435 1490 1544 1599 1654 1709 1765 1820 1874 1929 1984 2039 2096 2150 2205 2261 2318 2373 2429 2483 2538 2593 2648 2704 2760 2815 2871 2926 2981 3036 3091 3145 3200 3256 3312 33...

result:

ok contestant found the optimal answer: 1243084101967798 == 1243084101967798

Subtask #6:

score: 29
Accepted

Dependency #1:

100%
Accepted

Dependency #2:

100%
Accepted

Dependency #3:

100%
Accepted

Dependency #4:

100%
Accepted

Dependency #5:

100%
Accepted

Test #58:

score: 29
Accepted
time: 17ms
memory: 91328kb

input:

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

output:

19795776960
28624 57530 86260 

result:

ok contestant found the optimal answer: 19795776960 == 19795776960

Test #59:

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

input:

100000 3
10000 10000 10000 2 3 3 1 0 2 0 0 4 1 1 0 4 3 1 4 0 0 0 0 1 0 4 4 3 4 4 1 2 2 1 3 3 2 3 3 1 0 3 2 3 2 1 3 2 0 1 1 4 2 4 0 4 1 0 1 0 2 2 3 4 1 1 4 2 2 4 3 0 0 2 0 4 2 2 3 3 0 1 2 4 4 0 4 3 4 1 0 3 2 2 3 3 2 2 1 2 4 3 2 4 2 3 1 0 1 4 1 3 1 1 1 0 1 1 0 0 3 1 3 4 2 0 1 0 0 0 0 2 0 2 2 1 4 2 1 0...

output:

19874432173
13758 42470 71322 

result:

ok contestant found the optimal answer: 19874432173 == 19874432173

Test #60:

score: 0
Accepted
time: 306ms
memory: 92748kb

input:

100000 200
9998 10000 9999 9996 9998 9996 10000 9997 9997 9996 9996 9996 9998 9999 9998 9996 10000 9996 10000 9998 9996 9999 9999 9999 9996 9996 9998 10000 9999 9997 9997 9999 9998 9999 10000 9996 9997 9996 9998 10000 9998 10000 9997 9998 9997 9999 9997 9998 10000 9998 10000 9998 10000 9999 9999 999...

output:

497313449256899208
498 996 1493 1990 2488 2986 3484 3981 4479 4977 5474 5972 6469 6966 7464 7962 8460 8957 9454 9951 10449 10947 11445 11942 12439 12936 13433 13931 14428 14926 15423 15920 16417 16914 17412 17909 18406 18904 19402 19900 20398 20896 21394 21892 22389 22886 23383 23881 24378 24876 253...

result:

ok contestant found the optimal answer: 497313449256899208 == 497313449256899208

Test #61:

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

input:

100000 3
9999 9999 9996 9998 9996 9996 9998 10000 10000 9999 9996 9999 9997 9996 9997 10000 10000 10000 9997 9996 10000 10000 9997 10000 10000 9996 9997 9998 9999 9996 9997 9997 10000 9999 9997 10000 9999 9996 9997 9996 10000 9996 10000 10000 9997 9999 10000 9999 9999 9998 9996 10000 9996 9999 9996 ...

output:

374850090734572421
25000 50000 75000 

result:

ok contestant found the optimal answer: 374850090734572421 == 374850090734572421

Test #62:

score: 0
Accepted
time: 464ms
memory: 93424kb

input:

100000 200
10000 10000 10000 10000 10000 3 4 4 3 3 3 1 4 0 4 1 0 2 2 2 4 1 4 4 1 3 0 4 3 2 0 2 4 2 3 1 4 4 0 1 1 1 0 2 2 0 3 1 1 1 2 3 0 1 0 1 1 4 3 2 4 0 2 0 4 1 1 2 4 4 0 2 0 2 3 1 4 0 3 1 4 4 2 4 4 0 0 4 0 2 3 3 2 4 3 4 4 2 3 3 4 0 3 0 1 4 0 0 2 0 4 3 0 3 1 2 2 2 2 2 0 4 4 4 4 3 2 3 2 0 2 4 1 3 3...

output:

36183271951
1 2 3 4 5 522 1035 1525 2031 2547 3087 3607 4142 4651 5162 5689 6181 6703 7186 7728 8233 8733 9213 9744 10237 10765 11281 11774 12291 12800 13318 13850 14384 14916 15445 15972 16499 16985 17487 18005 18552 19072 19611 20129 20651 21165 21676 22170 22704 23219 23726 24240 24761 25275 2580...

result:

ok contestant found the optimal answer: 36183271951 == 36183271951

Test #63:

score: 0
Accepted
time: 320ms
memory: 94276kb

input:

100000 140
10000 3 1 0 0 1 4 2 3 2 3 0 1 2 0 2 3 2 3 3 0 1 2 3 2 2 3 4 0 1 1 0 0 3 3 1 2 4 0 0 0 1 3 0 1 4 2 1 2 2 3 4 2 0 4 0 2 3 0 2 0 4 3 4 3 3 2 4 3 4 0 0 1 3 2 1 2 0 3 0 0 0 3 1 1 4 1 2 2 3 0 2 0 3 2 1 3 0 1 2 10000 0 2 4 1 0 2 3 3 0 4 1 0 1 0 3 0 0 1 1 4 4 1 2 4 1 2 4 0 3 1 1 3 1 4 2 1 2 2 3 4...

output:

51629847150471
700 1398 2086 2800 3500 4201 4932 5614 6338 7039 7727 8450 9147 9858 10573 11269 11975 12673 13387 14100 14794 15494 16200 16900 17601 18301 19001 19717 20435 21146 21867 22550 23243 23959 24673 25373 26090 26800 27501 28201 28914 29613 30319 31031 31741 32434 33140 33837 34565 35261 ...

result:

ok contestant found the optimal answer: 51629847150471 == 51629847150471

Test #64:

score: 0
Accepted
time: 307ms
memory: 93116kb

input:

100000 150
5874 361 291 3720 8802 8250 810 7549 6726 8465 4194 6148 4315 1819 6470 5851 4552 1272 5588 7790 1112 3165 1188 8130 2326 6417 4492 8463 6848 1220 1259 6021 4090 2043 4384 4591 879 3181 4811 5393 3041 7025 9006 8543 193 497 3659 8732 9177 3022 1805 9826 8175 9473 2869 5129 163 9259 5235 1...

output:

124074747024496432
691 1355 2047 2739 3421 4065 4719 5395 6059 6750 7432 8075 8733 9395 10052 10720 11373 12026 12654 13294 13953 14623 15304 15956 16601 17264 17951 18612 19243 19920 20559 21217 21865 22526 23202 23851 24531 25194 25868 26520 27181 27830 28491 29179 29841 30505 31182 31847 32500 33...

result:

ok contestant found the optimal answer: 124074747024496432 == 124074747024496432

Test #65:

score: 0
Accepted
time: 227ms
memory: 92672kb

input:

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

output:

309959349080800
695 1568 2469 3355 4180 4753 5607 6502 7398 8255 8831 9651 10536 11437 12312 13059 13700 14572 15473 16361 17191 17761 18612 19506 20403 21262 21842 22656 23540 24441 25318 26086 26707 27577 28477 29366 30201 30770 31618 32511 33409 34272 34860 35664 36546 37448 38327 39115 39717 405...

result:

ok contestant found the optimal answer: 309959349080800 == 309959349080800

Test #66:

score: 0
Accepted
time: 247ms
memory: 92076kb

input:

100000 140
9996 0 9996 0 9997 0 10000 4 9996 2 9997 0 9999 2 9999 0 9996 0 9997 4 10000 2 9997 1 9998 3 9996 0 9997 3 9996 1 9997 4 9996 2 9999 0 9997 2 10000 2 9999 4 9999 4 9997 0 10000 2 10000 2 9997 4 9996 1 9996 3 9998 3 10000 1 9998 0 9999 2 9998 1 10000 3 10000 2 9997 4 9998 1 9997 2 9997 0 1...

output:

124113525649823701
709 1419 2128 2836 3545 4254 4963 5672 6381 7092 7801 8510 9217 9925 10634 11344 12052 12761 13470 14179 14889 15598 16307 17017 17726 18436 19145 19854 20563 21273 21981 22690 23398 24107 24816 25525 26233 26942 27650 28358 29067 29777 30486 31193 31902 32612 33321 34031 34740 35...

result:

ok contestant found the optimal answer: 124113525649823701 == 124113525649823701

Test #67:

score: 0
Accepted
time: 337ms
memory: 93456kb

input:

100000 180
9998 4 9997 2 9996 4 9996 1 10000 1 9997 2 9999 0 9999 4 10000 0 9999 3 9996 4 9998 3 9996 3 9999 4 9997 2 9997 4 9996 4 9997 1 9997 4 9996 2 9996 4 9997 1 9999 2 9999 1 9996 1 9997 0 9998 1 9999 2 9996 4 9996 0 9997 0 10000 3 9997 3 9998 0 9997 2 9999 1 9997 1 9997 1 10000 3 9999 0 9996 ...

output:

124309619349406845
552 1103 1656 2209 2761 3314 3866 4418 4971 5523 6075 6628 7181 7733 8286 8840 9393 9945 10498 11050 11601 12154 12708 13261 13814 14366 14918 15469 16022 16573 17126 17679 18231 18784 19335 19888 20440 20992 21544 22096 22647 23200 23752 24305 24858 25412 25965 26518 27071 27624 ...

result:

ok contestant found the optimal answer: 124309619349406845 == 124309619349406845