QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#697820#7201. Deque and Ballsdongyc666AC ✓249ms13360kbC++141.5kb2024-11-01 15:53:562024-11-01 15:53:56

詳細信息

Test #1:

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

input:

1 3
1
2 3
1 2
3 3
1 2 3

output:

0
2
20

result:

ok 3 tokens

Test #2:

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

input:

1 39
1

output:

0

result:

ok "0"

Test #3:

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

input:

2 9
1 2
2 46
2 1

output:

2
2

result:

ok 2 tokens

Test #4:

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

input:

3 37
1 2 3
3 37
1 3 2
3 41
2 1 3
3 29
2 3 1
3 8
3 1 2
3 45
3 2 1

output:

877905030
8
46480322
73741821
8
743685092

result:

ok 6 tokens

Test #5:

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

input:

4 11
1 2 3 4
4 31
1 2 4 3
4 49
1 3 2 4
4 7
1 3 4 2
4 11
1 4 2 3
4 14
1 4 3 2
4 30
2 1 3 4
4 17
2 1 4 3
4 29
2 3 1 4
4 50
2 3 4 1
4 40
2 4 1 3
4 31
2 4 3 1
4 27
3 1 2 4
4 18
3 1 4 2
4 9
3 2 1 4
4 24
3 2 4 1
4 6
3 4 1 2
4 14
3 4 2 1
4 26
4 1 2 3
4 26
4 1 3 2
4 8
4 2 1 3
4 10
4 2 3 1
4 40
4 3 1 2
4 21
...

output:

366588
179869073
595845311
1032
16392
131080
703757732
1048584
974994403
813976524
92960644
179869073
73741825
2097160
42444
959732316
520
9664248
536870920
536870920
2056
8200
92960644
933289184

result:

ok 24 tokens

Test #6:

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

input:

5 15
2 1 4 3 5
5 38
5 1 4 3 2
5 47
4 2 5 3 1
5 45
2 4 3 5 1
5 30
4 1 2 5 3
5 19
5 2 1 4 3
5 48
1 5 3 4 2
5 35
5 3 4 2 1
5 49
3 5 2 1 4
5 1
2 5 1 4 3
5 43
2 5 4 3 1
5 40
2 3 4 5 1
5 21
4 3 1 5 2
5 50
5 3 2 1 4
5 18
3 4 5 2 1
5 10
4 1 5 3 2
5 42
1 5 4 3 2
5 36
3 1 4 5 2
5 34
1 5 4 2 3
5 23
1 4 3 2 5
5...

output:

115315552
705161568
230546150
108661059
326077688
339202986
968209491
746041203
760782237
64
393945775
758892706
716379483
888578733
541462140
374780
352170324
97081883
94939069
279643081
456847285
146772
587083297
660089317
845699018
250350951
488784
108661059
8220517
448
746041203
250350951
891744...

result:

ok 120 tokens

Test #7:

score: 0
Accepted
time: 24ms
memory: 13120kb

input:

5 32
4 5 2 3 1
5 32
4 1 3 5 2
5 31
4 3 1 5 2
5 22
5 2 1 3 4
5 24
3 1 5 4 2
5 36
2 1 5 3 4
5 44
1 4 3 5 2
5 25
1 5 3 4 2
5 42
1 4 5 3 2
5 33
5 4 1 3 2
5 2
1 3 2 5 4
5 34
3 2 4 5 1
5 37
4 1 3 2 5
5 12
1 2 3 5 4
5 20
3 4 5 2 1
5 16
3 2 1 5 4
5 17
1 3 5 4 2
5 9
1 4 2 5 3
5 47
5 2 1 3 4
5 5
2 4 1 3 5
5 3...

output:

126521862
954629530
495420005
370242424
912751354
482313541
8220517
402709716
406250262
660089317
128
456847285
935320524
4317072
930098098
345422352
777462424
53704
571870940
2464
482313541
15688
230546150
146772
1103848
893715786
804061830
196657473
519706384
33554432
409821820
712
495420005
21129...

result:

ok 120 tokens

Test #8:

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

input:

5 50
1 5 2 4 3
5 50
4 3 2 1 5
5 50
1 3 2 5 4
5 50
5 3 2 4 1
5 50
1 3 2 4 5
5 50
3 1 2 4 5
5 50
3 1 2 4 5
5 50
3 5 1 2 4
5 50
1 3 5 4 2
5 50
3 5 1 4 2
5 50
4 2 5 3 1
5 50
5 2 4 1 3
5 50
1 4 2 5 3
5 50
1 5 2 4 3
5 50
1 4 2 3 5
5 50
4 2 5 1 3
5 50
1 2 5 4 3
5 50
1 4 2 3 5
5 50
1 5 2 3 4
5 50
4 5 3 1 2
...

output:

239852194
421112720
766762396
64215460
64215460
64215460
64215460
239852194
239852194
415488928
64215460
591125662
591125662
239852194
64215460
239852194
64215460
64215460
888578733
64215460
64215460
766762396
64215460
591125662
239852194
766762396
64215460
239852194
591125662
766762396
64215460
642...

result:

ok 120 tokens

Test #9:

score: 0
Accepted
time: 15ms
memory: 13024kb

input:

10 34
9 3 4 10 7 1 2 5 8 6
10 35
10 2 6 4 5 8 1 9 3 7
10 22
6 9 7 10 8 2 1 4 5 3
10 17
1 8 5 10 6 9 2 4 3 7
10 16
2 4 7 8 10 9 6 3 5 1
10 34
4 7 2 6 8 1 9 3 10 5
10 2
5 3 4 7 2 1 8 9 10 6
10 13
7 4 8 5 9 1 3 10 2 6
10 50
4 8 10 9 7 1 2 5 3 6
10 23
7 2 3 5 4 9 8 6 1 10
10 9
3 7 5 4 8 6 9 2 10 1
10 25...

output:

879519401
690854966
582033094
343481721
135275397
946504400
22144
296885864
274534739
577969112
615798507
804795437
81668074
146856800
663881261
688635920
743898177
278237252
791717750
108756
554082822
432146654
872649568
399809922
764575904
11537869
906547832
309605725
705880360
278540156
33284463
...

result:

ok 50 tokens

Test #10:

score: 0
Accepted
time: 15ms
memory: 13112kb

input:

10 6
10 1 4 6 9 5 2 3 8 7
10 36
2 7 10 5 4 9 6 3 8 1
10 8
9 3 7 1 6 5 2 4 8 10
10 30
3 1 5 9 6 10 7 8 2 4
10 28
6 3 8 5 10 1 9 7 2 4
10 46
9 10 3 5 6 4 1 2 8 7
10 38
1 7 10 5 4 9 8 3 2 6
10 40
9 1 10 8 5 3 7 2 6 4
10 29
10 2 1 5 3 9 6 4 8 7
10 20
7 9 2 6 5 1 3 10 8 4
10 39
7 8 5 1 4 10 9 3 6 2
10 29...

output:

12918880
654613374
519314688
688388588
180953942
703379585
949991903
597788638
282858194
365767603
401564036
969652306
938361154
554762262
289145158
4388877
198411710
930815870
543681543
141380476
182280846
851967338
635554232
721661621
751692863
551232
341698989
313479443
809782382
481661593
396923...

result:

ok 50 tokens

Test #11:

score: 0
Accepted
time: 15ms
memory: 12856kb

input:

10 16
4 8 5 7 3 10 9 1 6 2
10 16
7 6 1 4 5 2 8 9 10 3
10 21
9 5 1 8 6 3 4 2 7 10
10 12
7 4 8 6 1 5 10 2 3 9
10 22
9 6 4 5 2 7 10 3 8 1
10 47
9 2 8 7 1 10 6 5 3 4
10 20
7 8 6 2 9 5 3 1 10 4
10 43
2 10 6 9 7 8 4 5 3 1
10 8
9 8 6 2 4 7 5 10 1 3
10 50
9 10 8 2 4 3 5 1 6 7
10 5
2 4 10 1 5 8 6 7 9 3
10 32...

output:

351695595
282777516
40545249
229525917
169531343
508154594
927594564
280723940
443307776
746374344
3048048
351889709
713430140
390732922
422362735
514819930
257263903
897291064
957521380
153310310
169249286
580306243
663046471
247630827
392551808
953780922
440070080
564339371
479776068
901994983
496...

result:

ok 50 tokens

Test #12:

score: 0
Accepted
time: 37ms
memory: 13176kb

input:

20 50
1 10 6 19 17 15 7 9 20 18 4 12 13 16 2 3 5 14 8 11
20 50
4 20 19 6 9 8 15 3 11 14 18 13 1 2 16 10 12 7 17 5
20 50
3 7 12 15 1 8 13 10 9 14 18 11 2 19 17 20 4 5 16 6
20 50
12 20 2 6 19 4 16 13 8 7 1 5 10 17 15 11 3 14 9 18
20 50
12 20 3 13 9 4 8 14 1 17 18 6 2 16 10 15 5 7 11 19
20 50
2 6 10 8 ...

output:

838291672
22142481
165604391
171089452
32586581
960360762
791867433
30555719
478185288
437845903
553207430
367169938
821543579
737700564
420654303
463042144
613794272
881703723
489649168
34402501
766182114
510443430
851858965
718046851
958133695
374344295
950446474
930046043
920063606
939208245
5689...

result:

ok 50 tokens

Test #13:

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

input:

20 40
8 9 18 13 12 16 11 20 17 7 6 5 2 10 1 15 14 3 4 19
20 40
19 7 16 13 1 5 3 17 8 20 15 9 10 6 2 4 14 12 18 11
20 40
19 13 7 3 15 10 12 20 16 6 9 17 4 8 2 5 11 14 18 1
20 40
13 2 7 20 5 1 6 4 8 14 10 15 18 19 12 11 16 9 3 17
20 40
9 10 12 6 16 3 2 17 15 13 20 14 4 7 19 8 11 1 18 5
20 40
9 8 7 12 ...

output:

574419917
85722906
696576703
683808304
141776942
555635230
938025813
313346809
537938767
854746011
850591562
289773086
629178574
93980565
839962025
204487556
239861135
731539292
150256297
450119282
948330567
815789751
64050251
391677284
160890005
188163004
812690447
424381160
163394265
135631320
157...

result:

ok 50 tokens

Test #14:

score: 0
Accepted
time: 36ms
memory: 13120kb

input:

20 32
8 20 6 14 10 2 11 18 12 16 9 5 19 4 17 3 13 7 1 15
20 13
12 15 6 9 7 17 2 13 20 10 18 11 3 8 1 4 16 19 14 5
20 31
9 1 4 12 15 14 2 7 3 6 18 8 19 13 11 20 17 5 16 10
20 30
14 2 1 9 7 16 8 5 6 11 20 13 3 10 12 17 18 4 19 15
20 30
9 7 19 17 3 12 15 6 1 8 4 5 2 13 14 20 10 18 11 16
20 8
6 18 12 5 ...

output:

249922894
642002186
596834860
461063571
340257370
760981867
510437401
97113936
225323968
960033956
278162895
868421580
429246259
730750803
267258707
50024762
709118387
40254395
22975615
349372485
969725238
793152484
860853136
941607484
797271404
570732154
205952100
599394569
88831313
448166705
73693...

result:

ok 50 tokens

Test #15:

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

input:

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

output:

571408500
818110983
761212190
729903378
480096766
807251265
241054470
220135362
524552459
783020563

result:

ok 10 tokens

Test #16:

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

input:

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

output:

629052959
92433466
930309149
465292998
651222717
603398965
535428426
369753031
794505748
537953816

result:

ok 10 tokens

Test #17:

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

input:

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

output:

137101215
463307807
834566908
299259658
268430830
89626254
595714437
543636718
859688763
384700857

result:

ok 10 tokens

Test #18:

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

input:

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

output:

525751484
1976951
182884085
405513422
518571827
572578665
939527417
35145671
402448939
790917255

result:

ok 10 tokens

Test #19:

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

input:

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

output:

857237604
436029819
414709387
168402937
836852984
462401249
987818033
918053111
199108923
566992110

result:

ok 10 tokens

Test #20:

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

input:

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

output:

12301782
153338648
877926954
44832181
357413330
244444143
941307977
471530312
702333044
940461924

result:

ok 10 tokens

Test #21:

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

input:

123 21
40 41 111 39 34 49 92 78 1 8 82 24 36 90 70 50 22 3 2 76 110 60 61 38 57 91 20 12 109 94 74 7 118 53 33 67 6 47 83 30 4 44 16 79 72 62 48 66 68 100 117 5 97 73 107 65 32 10 69 55 11 121 75 101 31 96 51 26 99 103 85 19 102 123 84 25 98 113 64 88 80 52 120 45 9 54 35 29 95 27 105 112 119 116 21...

output:

887848213
271969149
806898671
528949889
583915316

result:

ok 5 tokens

Test #22:

score: 0
Accepted
time: 7ms
memory: 13100kb

input:

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

output:

733473186
711865119

result:

ok 2 tokens

Test #23:

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

input:

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

output:

830378275
873897758

result:

ok 2 tokens

Test #24:

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

input:

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

output:

921769313
411909018

result:

ok 2 tokens

Test #25:

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

input:

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

output:

854441562
726438434

result:

ok 2 tokens

Test #26:

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

input:

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

output:

923405514
767757906

result:

ok 2 tokens

Test #27:

score: 0
Accepted
time: 13ms
memory: 12908kb

input:

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

output:

607587202
748541250

result:

ok 2 tokens

Test #28:

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

input:

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

output:

505684494
701763898

result:

ok 2 tokens

Test #29:

score: 0
Accepted
time: 51ms
memory: 12704kb

input:

200 49
160 9 25 68 180 55 116 194 140 178 19 131 187 86 13 38 132 65 151 182 152 148 79 1 37 190 83 85 126 21 77 111 18 123 149 168 173 159 146 120 48 24 192 145 99 7 125 114 183 32 109 46 195 81 197 127 41 97 45 129 200 87 92 136 143 51 179 135 163 176 53 117 164 15 90 57 76 121 174 42 161 78 191 5...

output:

70130566
183442582
988446848
374388350
486210121

result:

ok 5 tokens

Test #30:

score: 0
Accepted
time: 51ms
memory: 13168kb

input:

200 16
52 183 172 198 137 32 14 105 11 61 30 145 69 83 124 143 27 4 36 72 116 131 54 134 59 197 151 65 176 24 178 74 121 193 122 56 194 153 139 96 179 180 118 98 62 187 53 125 97 66 106 169 37 35 95 80 190 159 175 165 49 68 86 140 44 148 55 7 8 89 200 10 100 128 31 91 120 136 50 174 29 93 107 161 11...

output:

538753607
510364852
380652885
757840869
708008971

result:

ok 5 tokens

Test #31:

score: 0
Accepted
time: 48ms
memory: 12628kb

input:

200 12
144 92 40 124 101 90 141 44 196 195 2 63 108 78 110 37 30 7 23 146 6 71 81 64 54 5 190 175 72 49 125 166 134 85 17 19 57 38 3 167 29 45 87 157 153 183 177 53 111 200 67 117 60 176 152 182 94 80 158 115 26 147 129 11 133 143 31 89 91 16 50 105 99 103 61 116 113 52 68 12 156 187 82 114 18 118 4...

output:

952323836
485532085
673341638
460768041
273873925

result:

ok 5 tokens

Test #32:

score: 0
Accepted
time: 52ms
memory: 12956kb

input:

200 49
66 33 147 123 174 93 106 42 87 133 195 139 189 192 163 136 25 109 114 69 92 111 1 134 50 22 199 128 160 74 30 65 89 96 140 83 161 95 112 90 68 110 102 113 143 119 12 58 28 130 151 172 146 79 49 70 149 183 157 150 85 71 10 101 131 44 162 31 51 175 94 9 46 14 18 56 4 88 23 193 7 173 118 63 47 1...

output:

647146216
740569983
217331211
896900442
815347751

result:

ok 5 tokens

Test #33:

score: 0
Accepted
time: 75ms
memory: 12612kb

input:

200 50
47 1 116 33 82 120 117 44 80 175 103 12 86 105 13 131 191 171 59 123 133 150 97 52 197 37 129 112 55 19 62 134 35 49 118 162 166 115 76 64 179 194 3 30 135 192 107 70 154 18 198 22 61 141 140 128 177 90 152 125 81 25 160 174 5 63 48 109 43 132 186 56 57 172 183 193 139 142 23 170 127 20 71 17...

output:

436238864
290206322
914231576
564983532
279848564

result:

ok 5 tokens

Test #34:

score: 0
Accepted
time: 63ms
memory: 12848kb

input:

200 39
60 62 66 173 190 189 18 175 53 137 156 172 199 7 61 31 88 64 92 98 141 194 127 83 116 150 70 2 13 33 157 77 74 76 145 34 63 58 84 119 75 135 46 154 146 101 153 44 196 85 198 28 188 155 79 5 110 166 108 144 17 14 86 114 136 87 164 82 51 38 174 27 12 54 143 89 106 169 36 163 129 107 134 43 160 ...

output:

934767561
7925917
104364676
660064069
123287527

result:

ok 5 tokens

Test #35:

score: 0
Accepted
time: 244ms
memory: 13324kb

input:

1000 50
421 773 364 555 575 214 633 941 509 883 144 151 64 734 913 185 330 21 785 145 233 723 203 338 171 95 873 309 771 852 417 404 634 970 884 663 305 137 973 465 915 892 646 823 254 882 767 644 49 226 325 682 370 70 434 63 880 493 602 102 447 402 628 190 724 641 657 863 783 703 96 236 211 492 587...

output:

355947375

result:

ok "355947375"

Test #36:

score: 0
Accepted
time: 240ms
memory: 13072kb

input:

1000 49
698 196 561 621 571 929 555 345 400 394 58 209 226 715 154 815 368 780 9 378 964 830 52 355 440 943 989 148 124 546 820 153 250 486 192 363 27 644 523 186 230 246 968 816 518 825 851 723 710 900 240 455 322 706 273 905 608 329 403 143 13 593 398 870 379 126 151 917 297 612 532 784 573 983 79...

output:

994617251

result:

ok "994617251"

Test #37:

score: 0
Accepted
time: 249ms
memory: 13104kb

input:

1000 50
873 917 444 242 21 216 340 987 417 670 251 701 710 580 312 937 140 864 715 329 428 855 593 844 322 358 900 574 763 81 72 683 433 194 786 248 310 644 94 268 922 814 307 102 236 733 941 527 539 420 141 425 185 376 852 460 702 48 658 377 508 16 521 523 469 485 498 977 975 238 271 752 995 943 83...

output:

11315873

result:

ok "11315873"

Test #38:

score: 0
Accepted
time: 240ms
memory: 13360kb

input:

1000 48
903 961 576 647 384 942 752 947 895 121 402 525 645 429 54 993 324 650 322 788 246 222 70 830 501 262 214 102 990 867 764 881 454 856 408 564 968 504 591 751 596 646 353 431 374 996 149 157 253 550 818 255 946 639 665 670 704 711 369 945 701 803 404 211 651 613 667 401 912 686 190 357 770 24...

output:

582295052

result:

ok "582295052"

Test #39:

score: 0
Accepted
time: 231ms
memory: 13000kb

input:

1000 47
98 583 23 673 223 289 191 842 453 460 332 829 413 939 408 320 964 142 861 855 723 493 760 258 138 233 422 827 748 31 249 237 331 261 68 675 131 40 762 161 640 825 887 146 813 906 253 202 22 743 8 968 218 692 250 573 918 147 975 488 310 279 849 389 480 770 51 324 264 326 318 821 769 658 578 7...

output:

197691960

result:

ok "197691960"

Test #40:

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

input:

1000 46
875 124 876 161 457 17 199 528 660 797 183 306 122 657 212 426 880 15 620 483 651 766 971 394 669 140 456 694 311 313 843 790 489 884 301 308 626 501 945 216 387 887 608 946 576 95 153 452 899 838 455 683 784 514 920 204 770 642 531 492 488 439 782 332 419 870 901 769 389 54 100 312 980 675 ...

output:

112404179

result:

ok "112404179"

Test #41:

score: 0
Accepted
time: 223ms
memory: 13056kb

input:

1000 45
190 563 124 134 489 56 214 339 187 257 588 570 469 533 198 237 405 467 180 900 146 495 219 584 581 457 84 66 241 685 783 155 677 47 835 949 714 154 48 738 342 627 264 769 886 478 582 361 866 837 535 296 97 691 625 658 511 918 493 721 498 652 873 273 461 3 243 167 565 1000 543 530 91 737 382 ...

output:

111076340

result:

ok "111076340"

Test #42:

score: 0
Accepted
time: 77ms
memory: 12916kb

input:

500 8
497 422 427 20 276 158 11 270 146 469 362 67 265 221 233 401 61 16 51 22 348 356 23 224 451 186 153 358 176 283 175 101 458 309 24 306 381 257 498 318 203 485 484 421 193 159 56 18 333 222 229 271 448 374 500 269 188 345 471 196 219 204 403 39 416 179 328 407 230 88 121 238 1 71 344 198 279 10...

output:

649614882
931125170

result:

ok 2 tokens

Test #43:

score: 0
Accepted
time: 84ms
memory: 12820kb

input:

500 36
436 399 276 448 203 437 430 483 361 131 324 85 364 205 245 15 320 440 367 75 493 228 215 250 5 285 379 146 114 81 66 356 369 186 211 39 334 409 58 25 274 68 159 244 173 398 497 195 326 431 405 194 500 271 43 329 123 363 458 221 307 358 121 413 109 420 198 100 256 292 112 20 402 17 175 86 150 ...

output:

445534786
853821504

result:

ok 2 tokens

Test #44:

score: 0
Accepted
time: 61ms
memory: 12796kb

input:

500 1
41 241 225 212 133 353 121 84 107 126 5 276 150 174 27 331 424 497 239 290 55 36 435 3 109 498 196 96 442 333 401 223 348 309 77 328 317 215 489 186 70 206 443 175 220 143 461 14 361 38 156 499 357 283 97 315 469 268 236 197 154 326 62 266 453 64 342 59 6 184 245 473 178 362 360 29 185 307 412...

output:

925509571
31063075

result:

ok 2 tokens

Test #45:

score: 0
Accepted
time: 136ms
memory: 13112kb

input:

500 50
96 171 208 75 301 226 295 218 320 26 296 325 62 64 494 453 22 5 210 234 111 120 173 281 342 38 474 327 136 135 68 487 81 393 123 401 239 35 13 336 28 274 138 153 470 480 41 482 450 31 149 440 410 70 39 6 246 203 194 273 385 310 206 414 479 90 471 454 333 483 251 343 285 290 233 292 378 481 29...

output:

401160095
695558514

result:

ok 2 tokens

Test #46:

score: 0
Accepted
time: 138ms
memory: 12616kb

input:

500 49
13 440 189 491 377 417 206 45 490 18 262 108 462 87 324 86 314 91 125 294 325 301 62 260 205 80 241 60 273 433 267 302 265 176 102 101 308 224 420 366 193 245 367 10 406 113 49 347 149 268 489 331 254 481 34 313 323 207 289 20 164 123 288 424 106 346 1 29 338 155 31 279 309 371 330 71 9 136 4...

output:

761499970
895827200

result:

ok 2 tokens

Test #47:

score: 0
Accepted
time: 132ms
memory: 13320kb

input:

500 48
226 61 380 107 202 276 71 272 176 47 65 100 390 483 215 207 408 268 371 359 184 40 220 120 139 460 309 224 392 2 204 382 432 360 149 464 407 169 198 55 479 31 289 297 79 240 242 461 187 189 446 290 205 307 329 448 387 286 157 130 30 385 236 339 281 492 68 58 235 212 470 293 373 350 435 266 16...

output:

350825682
709245677

result:

ok 2 tokens

Extra Test:

score: 0
Extra Test Passed