QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#673716#5268. Computer NetworkIllusionaryDominance#AC ✓0ms3708kbC++20361b2024-10-25 09:20:282024-10-25 09:20:29

Judging History

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

  • [2024-10-25 09:20:29]
  • 评测
  • 测评结果:AC
  • 用时:0ms
  • 内存:3708kb
  • [2024-10-25 09:20:28]
  • 提交

answer

#include <bits/stdc++.h>
using namespace std;
int n, k;
long long tot[110], a[110];
int main(){
    ios::sync_with_stdio(0); cin.tie(0), cout.tie(0);
    cin >> n >> k;
    for (int i = 0; i < n; ++ i) cin >> a[i];
    sort(a, a + n);
    long long ans = 0;
    for (int i = 0; i < n; ++ i) tot[i % k] += a[i], ans += tot[i % k]; 
    cout << ans;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

input:

3 2
20 30 10

output:

70

result:

ok 1 number(s): "70"

Test #2:

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

input:

5 1
10 10 10 10 10

output:

150

result:

ok 1 number(s): "150"

Test #3:

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

input:

5 2
10 10 10 10 10

output:

90

result:

ok 1 number(s): "90"

Test #4:

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

input:

6 3
5 6 2 3 1 4

output:

27

result:

ok 1 number(s): "27"

Test #5:

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

input:

1 1
9

output:

9

result:

ok 1 number(s): "9"

Test #6:

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

input:

35 1
38 96 60 78 61 93 7 18 3 82 77 47 62 36 58 94 60 86 12 11 14 93 86 79 29 15 87 65 50 39 83 82 100 69 23

output:

25443

result:

ok 1 number(s): "25443"

Test #7:

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

input:

63 1
70 59 61 11 4 59 47 34 27 87 95 68 42 46 63 49 42 12 97 4 84 29 83 3 45 53 26 9 50 70 70 54 62 10 7 89 77 87 28 53 95 24 3 6 53 83 76 40 65 74 85 49 38 96 63 67 81 83 93 23 63 34 4

output:

72065

result:

ok 1 number(s): "72065"

Test #8:

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

input:

88 1
89 34 8 98 34 74 58 32 4 90 57 42 52 56 14 37 30 100 16 66 85 9 44 53 61 29 13 32 75 93 19 60 4 18 27 45 26 57 18 55 22 62 16 64 38 54 59 21 66 71 13 66 79 25 91 99 23 3 31 58 48 1 7 58 99 100 96 48 43 92 6 70 92 93 52 92 7 48 47 85 31 50 9 8 6 70 61 81

output:

124632

result:

ok 1 number(s): "124632"

Test #9:

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

input:

10 2
91 79 67 4 42 9 77 78 5 42

output:

1056

result:

ok 1 number(s): "1056"

Test #10:

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

input:

30 2
13 63 52 40 35 55 45 50 12 69 86 43 25 96 51 19 62 1 8 65 9 12 84 5 1 39 80 24 77 81

output:

6766

result:

ok 1 number(s): "6766"

Test #11:

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

input:

100 5
2 10 91 59 60 22 97 97 42 1 84 40 18 73 57 59 17 66 14 73 41 2 76 26 79 23 48 60 34 87 43 80 7 3 25 15 29 27 32 63 21 53 98 81 18 4 9 45 29 24 21 37 87 48 51 11 47 31 1 62 52 19 22 83 16 89 57 14 6 48 11 89 97 48 33 91 44 25 82 55 90 95 60 89 30 73 54 44 54 58 100 48 69 41 16 61 91 98 68 32

output:

33866

result:

ok 1 number(s): "33866"

Test #12:

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

input:

100 10
58 77 73 27 4 74 67 100 49 16 29 53 51 77 43 98 19 79 2 19 77 38 49 99 72 95 4 27 71 92 84 13 27 31 67 54 12 48 69 86 6 87 34 97 99 47 56 40 26 1 73 45 43 63 79 80 3 59 39 99 96 10 31 14 7 47 90 49 31 17 11 84 52 94 72 20 33 36 43 16 9 22 53 85 71 47 47 32 7 94 61 5 66 60 60 47 80 79 89 40

output:

19789

result:

ok 1 number(s): "19789"

Test #13:

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

input:

100 4
72 39 9 100 98 42 45 44 9 69 81 93 94 40 69 25 37 6 18 14 82 96 57 87 52 40 64 82 62 8 99 38 100 37 80 29 100 3 89 49 62 40 71 89 49 100 95 56 11 13 3 69 81 9 37 11 33 80 61 93 60 75 8 23 24 8 94 9 34 74 91 96 9 50 92 82 46 91 34 97 49 15 9 38 96 90 47 58 36 81 15 73 63 76 24 64 51 54 38 10

output:

48254

result:

ok 1 number(s): "48254"

Test #14:

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

input:

100 100
6 79 70 55 42 43 59 12 5 73 8 1 82 74 55 74 93 39 82 8 95 63 78 13 33 26 88 51 69 49 7 80 67 95 45 95 37 69 73 17 34 56 80 58 44 8 33 68 34 67 68 42 9 95 56 28 31 12 41 19 37 94 39 77 74 75 92 97 95 16 22 2 30 47 5 75 12 24 42 10 6 66 20 93 29 38 48 14 6 15 70 19 64 30 30 9 15 67 10 86

output:

4693

result:

ok 1 number(s): "4693"

Test #15:

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

input:

100 100
30 69 95 36 88 49 67 56 39 53 97 34 57 87 23 25 5 7 92 37 26 82 53 41 99 73 54 44 64 34 83 19 29 67 25 24 56 21 48 78 37 94 38 70 57 78 73 23 6 59 8 25 19 85 96 16 12 79 91 62 96 57 96 49 63 100 60 75 40 42 52 88 65 61 30 56 98 81 59 51 21 67 22 73 96 66 13 71 37 32 1 18 45 8 24 4 69 29 56 26

output:

5191

result:

ok 1 number(s): "5191"

Test #16:

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

input:

100 1
100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 10...

output:

505000

result:

ok 1 number(s): "505000"

Test #17:

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

input:

100 2
100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 10...

output:

255000

result:

ok 1 number(s): "255000"

Test #18:

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

input:

100 4
100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 10...

output:

130000

result:

ok 1 number(s): "130000"

Test #19:

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

input:

100 10
100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 1...

output:

55000

result:

ok 1 number(s): "55000"

Test #20:

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

input:

100 15
100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 1...

output:

38500

result:

ok 1 number(s): "38500"

Test #21:

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

input:

100 49
100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 1...

output:

15300

result:

ok 1 number(s): "15300"

Test #22:

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

input:

100 100
100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 ...

output:

10000

result:

ok 1 number(s): "10000"

Test #23:

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

input:

1 1
88

output:

88

result:

ok 1 number(s): "88"

Test #24:

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

input:

2 1
38 9

output:

56

result:

ok 1 number(s): "56"

Test #25:

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

input:

2 2
93 61

output:

154

result:

ok 1 number(s): "154"

Test #26:

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

input:

3 1
69 39 53

output:

292

result:

ok 1 number(s): "292"

Test #27:

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

input:

3 2
76 61 75

output:

273

result:

ok 1 number(s): "273"

Test #28:

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

input:

3 3
2 63 32

output:

97

result:

ok 1 number(s): "97"

Test #29:

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

input:

4 1
44 18 26 34

output:

262

result:

ok 1 number(s): "262"

Test #30:

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

input:

4 2
88 19 67 2

output:

197

result:

ok 1 number(s): "197"

Test #31:

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

input:

4 3
42 93 37 54

output:

263

result:

ok 1 number(s): "263"

Test #32:

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

input:

4 4
3 27 37 50

output:

117

result:

ok 1 number(s): "117"

Test #33:

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

input:

5 1
18 85 23 84 62

output:

621

result:

ok 1 number(s): "621"

Test #34:

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

input:

5 2
47 53 65 69 28

output:

418

result:

ok 1 number(s): "418"

Test #35:

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

input:

5 3
31 40 47 72 57

output:

318

result:

ok 1 number(s): "318"

Test #36:

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

input:

5 4
32 1 92 8 100

output:

234

result:

ok 1 number(s): "234"

Test #37:

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

input:

5 5
71 74 26 11 89

output:

271

result:

ok 1 number(s): "271"

Test #38:

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

input:

6 1
25 40 53 29 83 73

output:

843

result:

ok 1 number(s): "843"

Test #39:

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

input:

6 2
97 84 17 31 24 37

output:

440

result:

ok 1 number(s): "440"

Test #40:

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

input:

6 3
3 97 75 22 25 57

output:

329

result:

ok 1 number(s): "329"

Test #41:

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

input:

6 4
96 4 68 72 68 100

output:

480

result:

ok 1 number(s): "480"

Test #42:

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

input:

6 5
93 22 82 48 88 59

output:

414

result:

ok 1 number(s): "414"

Test #43:

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

input:

6 6
66 46 37 16 46 24

output:

235

result:

ok 1 number(s): "235"

Test #44:

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

input:

7 1
67 52 58 19 76 74 47

output:

1332

result:

ok 1 number(s): "1332"

Test #45:

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

input:

7 2
66 60 75 63 70 42 30

output:

829

result:

ok 1 number(s): "829"

Test #46:

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

input:

7 3
96 81 17 47 18 96 82

output:

617

result:

ok 1 number(s): "617"

Test #47:

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

input:

7 4
23 74 73 39 80 26 69

output:

472

result:

ok 1 number(s): "472"

Test #48:

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

input:

7 5
45 49 20 71 62 87 78

output:

477

result:

ok 1 number(s): "477"

Test #49:

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

input:

7 6
89 41 19 13 98 95 72

output:

440

result:

ok 1 number(s): "440"

Test #50:

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

input:

7 7
86 37 98 7 100 8 70

output:

406

result:

ok 1 number(s): "406"

Test #51:

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

input:

100 1
66 9 31 14 43 20 1 37 4 82 20 7 95 88 97 49 30 35 77 60 81 3 87 23 98 70 18 16 85 90 2 51 36 12 90 61 30 76 81 68 38 34 25 32 53 82 7 94 59 72 54 77 6 68 73 36 36 11 66 93 23 50 98 90 94 64 97 86 64 91 18 46 47 96 5 5 81 16 4 89 29 75 20 43 24 88 83 99 8 25 32 41 68 42 28 41 99 100 48 10

output:

168647

result:

ok 1 number(s): "168647"

Test #52:

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

input:

100 2
2 53 63 38 96 73 41 44 8 70 71 30 77 76 91 8 95 35 50 89 85 24 73 10 8 92 32 92 96 41 50 30 86 37 2 67 28 63 47 76 84 74 18 10 84 18 79 61 62 64 59 17 75 60 33 18 83 38 6 56 16 75 29 78 20 35 54 76 67 19 12 75 61 63 4 99 2 12 99 29 38 63 80 46 20 21 66 54 41 38 96 39 78 100 58 62 45 14 97 40

output:

90834

result:

ok 1 number(s): "90834"

Test #53:

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

input:

100 3
57 17 19 85 51 26 3 1 24 83 76 100 52 75 55 99 96 49 99 30 41 59 32 87 50 84 34 3 51 38 60 63 12 80 21 77 62 93 41 5 40 70 76 21 77 44 85 58 10 100 89 41 40 30 28 26 21 51 71 22 47 21 81 79 28 88 75 16 56 59 90 38 65 92 59 34 54 90 81 57 81 95 82 12 100 74 59 86 39 71 29 63 41 41 9 49 5 26 56 93

output:

66170

result:

ok 1 number(s): "66170"

Test #54:

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

input:

100 5
43 55 6 3 65 100 100 66 44 96 1 28 92 7 95 35 98 44 71 53 51 68 45 73 10 37 21 78 61 64 96 45 68 69 99 49 89 96 43 28 56 60 77 95 33 87 97 45 40 86 22 41 43 90 98 90 34 84 12 84 49 64 47 6 57 35 42 40 3 58 55 30 47 12 83 34 4 90 51 49 52 96 52 67 84 15 75 72 57 35 17 52 68 47 2 94 48 82 74 85

output:

42738

result:

ok 1 number(s): "42738"

Test #55:

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

input:

100 9
92 37 68 71 97 43 14 71 10 72 6 13 23 12 7 80 75 59 81 54 77 81 44 42 46 79 32 48 19 37 42 41 93 67 86 85 48 63 49 13 18 47 53 2 85 66 51 70 39 39 59 65 49 53 61 69 31 33 96 74 94 72 9 58 10 97 45 64 65 75 27 33 84 22 52 20 26 74 94 67 5 40 54 50 12 21 71 25 52 75 83 15 67 71 51 32 22 81 22 63

output:

22922

result:

ok 1 number(s): "22922"

Test #56:

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

input:

100 13
25 65 59 98 35 18 31 73 82 78 58 22 41 84 48 79 96 18 4 49 45 76 85 17 17 72 65 84 75 52 76 92 6 73 77 86 6 98 35 7 28 14 19 37 8 61 61 93 8 80 48 59 3 10 92 95 66 59 65 81 58 22 16 62 89 94 50 23 36 84 3 94 44 54 40 29 8 5 28 11 94 46 92 76 87 28 37 5 56 94 91 52 78 55 72 46 98 19 85 31

output:

16456

result:

ok 1 number(s): "16456"

Test #57:

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

input:

100 23
85 8 18 11 92 88 96 29 58 10 71 59 60 89 26 90 85 47 69 6 17 43 31 33 68 41 23 29 82 94 67 89 1 7 29 63 77 28 72 83 32 98 98 82 64 35 42 9 62 67 33 88 84 17 1 83 28 5 30 38 69 63 52 85 23 25 46 42 13 41 92 100 22 26 16 60 6 10 76 76 97 10 13 38 10 75 54 57 13 49 90 44 86 7 49 30 53 81 53 38

output:

9755

result:

ok 1 number(s): "9755"

Test #58:

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

input:

100 33
85 8 18 11 92 88 96 29 58 10 71 59 60 89 26 90 85 47 69 6 17 43 31 33 68 41 23 29 82 94 67 89 1 7 29 63 77 28 72 83 32 98 98 82 64 35 42 9 62 67 33 88 84 17 1 83 28 5 30 38 69 63 52 85 23 25 46 42 13 41 92 100 22 26 16 60 6 10 76 76 97 10 13 38 10 75 54 57 13 49 90 44 86 7 49 30 53 81 53 38

output:

7687

result:

ok 1 number(s): "7687"

Test #59:

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

input:

100 34
85 8 18 11 92 88 96 29 58 10 71 59 60 89 26 90 85 47 69 6 17 43 31 33 68 41 23 29 82 94 67 89 1 7 29 63 77 28 72 83 32 98 98 82 64 35 42 9 62 67 33 88 84 17 1 83 28 5 30 38 69 63 52 85 23 25 46 42 13 41 92 100 22 26 16 60 6 10 76 76 97 10 13 38 10 75 54 57 13 49 90 44 86 7 49 30 53 81 53 38

output:

7559

result:

ok 1 number(s): "7559"

Test #60:

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

input:

100 42
98 75 64 41 100 98 23 7 91 75 60 55 60 77 17 25 35 18 36 67 38 39 23 86 22 50 55 16 33 11 19 54 5 20 73 31 70 87 97 71 8 28 22 60 46 52 59 45 15 93 6 14 3 28 90 34 28 27 19 48 13 91 45 6 80 9 14 34 50 98 71 5 4 52 53 9 55 92 84 90 52 7 63 85 93 38 87 83 50 8 100 89 88 57 1 52 63 34 48 60

output:

6546

result:

ok 1 number(s): "6546"

Test #61:

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

input:

100 49
29 42 60 35 17 27 18 29 84 86 30 36 72 36 75 81 59 15 50 83 24 92 23 1 74 75 90 18 4 68 15 59 52 74 53 28 16 84 62 73 64 87 54 2 49 46 97 7 64 72 24 14 77 51 67 36 43 71 91 76 30 75 33 81 46 25 94 26 85 33 26 6 79 83 40 13 1 59 7 82 73 100 74 72 51 63 83 9 11 28 49 27 32 48 20 14 44 3 36 55

output:

6130

result:

ok 1 number(s): "6130"

Test #62:

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

input:

100 50
43 100 91 74 35 80 20 53 56 21 14 3 15 8 94 46 82 16 45 76 87 34 69 70 49 71 48 22 25 81 63 66 70 21 83 46 26 12 85 91 100 29 46 17 46 28 36 19 66 20 81 31 75 71 32 10 93 33 13 26 11 78 19 17 9 50 36 68 29 6 57 72 92 58 43 55 59 57 39 34 11 91 59 64 76 77 5 1 52 66 70 23 94 100 84 42 65 63 56...

output:

6352

result:

ok 1 number(s): "6352"

Test #63:

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

input:

100 51
8 4 60 24 50 67 81 1 36 27 99 30 91 58 86 1 91 4 20 26 94 76 38 87 53 87 34 92 31 85 61 64 73 28 74 64 4 64 19 56 2 52 64 54 76 44 82 12 16 66 86 64 24 18 6 13 45 24 13 53 5 64 75 7 19 2 45 74 8 89 80 77 28 85 29 88 85 13 20 72 25 77 34 6 6 52 38 81 74 73 26 63 6 42 56 21 80 56 38 3

output:

5657

result:

ok 1 number(s): "5657"

Test #64:

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

input:

100 56
84 36 90 79 35 6 4 81 91 49 30 3 73 45 26 69 60 30 86 6 28 26 13 28 66 8 73 47 13 50 41 57 68 42 75 65 42 28 57 79 82 70 17 44 65 73 74 13 24 68 74 97 21 88 40 74 93 33 76 25 67 19 96 68 11 49 38 81 3 73 36 1 8 75 38 97 90 41 83 3 37 98 67 39 70 49 17 21 31 41 2 26 17 72 44 18 42 9 46 6

output:

5683

result:

ok 1 number(s): "5683"

Test #65:

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

input:

100 77
54 99 44 85 16 14 31 57 80 79 6 49 65 4 16 60 33 69 29 93 86 44 64 71 45 36 28 27 15 40 14 46 55 3 24 78 11 37 34 92 80 31 54 85 12 31 46 70 53 52 71 19 65 41 85 34 43 21 33 88 4 28 29 54 23 10 16 70 66 94 48 4 82 27 33 2 1 89 52 59 86 33 41 1 45 83 46 73 3 33 58 65 30 31 51 61 17 70 4 51

output:

4756

result:

ok 1 number(s): "4756"

Test #66:

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

input:

100 89
11 13 44 98 88 35 80 51 40 70 96 39 64 61 86 15 86 58 53 35 34 97 19 60 4 16 56 76 49 81 95 92 9 25 63 9 63 34 88 82 100 20 81 78 92 90 33 91 21 44 47 55 88 78 11 69 25 12 35 87 52 65 47 22 89 30 76 73 19 15 2 38 29 6 87 43 37 7 82 68 51 78 23 42 44 67 34 75 25 25 16 86 50 16 81 70 47 89 17 98

output:

5352

result:

ok 1 number(s): "5352"

Test #67:

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

input:

100 93
92 14 71 2 74 28 76 93 45 59 95 37 42 15 27 83 83 94 41 46 88 32 25 29 67 8 45 55 85 8 14 16 4 29 36 78 45 50 31 19 5 84 49 1 9 30 45 4 52 82 43 18 14 2 64 26 51 19 32 87 59 58 56 73 24 96 82 85 11 84 50 23 30 67 54 63 35 100 54 39 80 40 27 64 84 37 94 64 90 31 29 10 9 89 57 60 14 31 3 76

output:

4751

result:

ok 1 number(s): "4751"

Test #68:

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

input:

100 97
27 67 23 50 75 22 14 43 90 87 1 59 4 84 24 32 27 97 64 74 83 54 70 2 81 71 48 8 50 19 5 77 77 54 82 69 53 55 71 79 97 74 18 70 42 84 66 33 9 40 73 74 8 11 88 87 80 83 28 85 58 21 31 51 42 92 36 35 41 34 51 23 69 49 32 55 17 27 76 43 84 46 97 8 70 67 22 21 65 8 45 58 41 52 52 31 29 21 60 86

output:

5075

result:

ok 1 number(s): "5075"

Test #69:

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

input:

100 98
4 40 13 52 90 42 46 83 16 92 40 59 14 90 54 16 74 32 30 18 87 81 74 51 92 86 67 80 23 57 79 3 11 86 29 87 86 99 87 39 51 49 93 15 87 1 21 29 3 86 86 78 69 69 14 93 18 13 67 77 60 13 55 42 13 40 79 25 13 12 100 60 21 13 25 5 6 41 5 53 5 54 62 72 66 31 36 74 42 86 15 65 57 45 66 33 70 18 15 58

output:

4883

result:

ok 1 number(s): "4883"

Test #70:

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

input:

100 99
50 41 21 69 71 68 97 92 8 68 48 10 49 38 36 68 81 42 7 60 7 19 13 73 83 7 1 67 88 78 38 60 72 49 46 47 33 61 43 72 44 11 1 80 61 19 27 7 92 23 97 47 64 47 70 14 57 37 57 52 29 21 93 82 100 74 95 73 72 28 6 77 7 99 21 50 46 45 64 61 62 64 30 87 61 67 64 43 76 23 67 3 65 80 57 4 10 33 77 18

output:

5023

result:

ok 1 number(s): "5023"

Test #71:

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

input:

100 100
93 42 60 63 14 92 36 76 88 63 78 93 34 85 21 7 39 52 48 86 51 3 33 26 12 95 29 62 36 51 13 56 16 87 6 79 40 72 39 2 42 97 6 36 60 20 66 56 72 80 40 36 50 56 81 25 26 12 30 96 7 16 81 43 42 78 60 92 42 7 90 13 58 96 7 91 95 48 47 73 54 24 52 7 33 71 51 4 2 67 89 87 62 59 77 99 81 66 71 45

output:

5152

result:

ok 1 number(s): "5152"

Test #72:

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

input:

42 23
53 61 20 8 16 32 30 85 61 20 24 61 62 72 47 70 19 20 38 94 77 66 68 52 63 6 97 98 12 6 25 40 70 59 37 1 91 84 23 13 53 7

output:

2298

result:

ok 1 number(s): "2298"

Test #73:

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

input:

99 49
91 56 45 53 52 73 73 13 26 7 20 13 26 86 77 92 42 74 66 2 87 4 38 53 74 85 88 4 8 74 34 12 50 58 28 24 6 54 45 1 6 19 61 8 80 85 81 67 20 64 38 19 56 76 28 13 2 77 27 31 64 16 5 63 24 52 18 4 89 94 76 56 25 1 91 75 85 21 72 64 64 64 86 29 6 81 36 64 99 6 87 34 30 44 3 24 60 82 80

output:

5684

result:

ok 1 number(s): "5684"

Test #74:

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

input:

99 50
68 39 29 96 52 21 16 53 70 70 91 67 18 28 10 18 66 91 3 40 22 25 57 57 85 94 15 54 95 99 57 3 39 59 15 6 47 11 11 97 45 71 14 6 57 11 97 41 56 62 64 53 70 70 52 53 35 46 6 19 70 7 68 45 3 40 87 54 84 48 74 5 24 8 78 39 31 22 43 8 4 36 93 19 24 99 62 4 88 4 40 83 84 83 15 67 37 67 45

output:

5663

result:

ok 1 number(s): "5663"

Test #75:

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

input:

99 33
94 62 31 27 99 4 56 86 23 11 51 15 13 18 88 70 74 92 17 99 28 90 52 68 85 39 48 81 55 43 11 47 48 47 14 62 82 71 75 45 64 5 89 90 56 25 18 84 18 49 60 85 74 20 30 59 89 52 10 6 80 86 75 48 46 93 77 69 89 71 38 49 93 25 88 46 52 28 92 18 22 77 45 77 66 97 65 81 85 2 37 62 8 25 42 19 74 99 82

output:

8701

result:

ok 1 number(s): "8701"

Test #76:

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

input:

97 23
68 76 91 39 82 16 77 85 49 75 92 41 29 52 8 41 38 44 20 35 71 78 45 68 28 38 63 98 19 93 12 37 85 95 25 31 76 56 19 54 2 95 21 47 95 60 88 36 21 52 36 3 89 59 84 39 10 66 5 67 77 59 32 91 64 3 14 26 60 78 8 58 91 82 77 31 53 36 18 98 17 81 10 78 34 96 58 41 69 1 56 86 38 77 9 86 75

output:

10106

result:

ok 1 number(s): "10106"

Test #77:

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

input:

97 77
2 93 37 44 66 62 3 57 18 98 76 92 87 19 20 21 78 99 66 94 24 88 41 80 76 98 75 80 53 94 79 46 1 83 30 18 71 72 23 55 88 36 89 66 90 78 85 14 84 75 64 61 49 41 19 37 4 21 31 95 2 27 53 6 51 77 55 63 2 16 7 35 50 44 76 66 42 88 52 55 91 45 18 21 56 42 26 33 80 56 65 56 38 7 35 12 28

output:

5252

result:

ok 1 number(s): "5252"

Test #78:

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

input:

100 25
41 19 88 41 63 4 2 76 98 42 79 80 88 6 18 93 7 23 62 71 80 42 66 33 35 21 2 94 51 61 76 80 77 46 66 66 1 87 21 50 95 38 56 88 30 56 37 64 75 75 91 16 66 55 37 44 56 35 53 57 2 21 89 18 100 86 53 44 90 18 49 55 26 52 7 28 98 92 83 14 12 65 20 94 24 72 55 45 19 36 85 27 78 99 31 84 76 88 3 78

output:

10113

result:

ok 1 number(s): "10113"

Test #79:

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

input:

99 25
79 4 88 12 89 66 83 16 92 27 14 78 78 57 51 19 80 35 76 38 88 88 56 84 33 75 53 42 2 19 65 85 80 24 1 91 80 93 98 6 94 75 41 45 2 52 46 62 7 55 21 55 66 36 71 88 41 37 18 21 20 99 7 44 18 76 28 95 76 55 3 87 35 49 77 56 37 18 23 90 42 98 26 53 61 94 72 31 63 30 64 66 2 56 21 86 50 66 44

output:

9853

result:

ok 1 number(s): "9853"