QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#16292#2114. Koszulki [C]Qingyu10 ✓3ms3724kbC++20302b2021-12-16 10:54:212022-05-03 23:36:17

Judging History

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

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2022-05-03 23:36:17]
  • 评测
  • 测评结果:10
  • 用时:3ms
  • 内存:3724kb
  • [2021-12-16 10:54:21]
  • 提交

answer

#include <bits/stdc++.h>

int main() {
	std::ios::sync_with_stdio(false);
	int n, k;
	std::cin >> n >> k;
	std::vector<int> a(n);
	for (int &x : a) std::cin >> x;
	std::sort(a.begin(), a.end(), std::greater<int>());
	while (k < a.size() && a[k] == a[k - 1]) ++k;
	std::cout << k << '\n';
}

Details

Tip: Click on the bar to expand more detailed information

Subtask #1:

score: 1
Accepted

Test #1:

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

input:

5 3
75 90 120 75 40

output:

4

result:

ok single line: '4'

Test #2:

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

input:

15 1
88 88 88 88 88 88 88 88 88 88 88 88 88 88 88

output:

15

result:

ok single line: '15'

Test #3:

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

input:

2 2
2 95

output:

2

result:

ok single line: '2'

Test #4:

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

input:

15 10
35 35 35 35 35 35 35 35 35 35 35 35 35 35 35

output:

15

result:

ok single line: '15'

Test #5:

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

input:

2 1
1 2

output:

1

result:

ok single line: '1'

Test #6:

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

input:

4 1
26 21 13 82

output:

1

result:

ok single line: '1'

Test #7:

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

input:

10 4
66 66 66 66 66 66 66 66 66 66

output:

10

result:

ok single line: '10'

Test #8:

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

input:

1 1
116

output:

1

result:

ok single line: '1'

Test #9:

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

input:

15 15
71 71 71 71 71 71 71 71 71 71 71 71 71 71 71

output:

15

result:

ok single line: '15'

Test #10:

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

input:

15 1
54 54 54 54 54 54 54 54 54 54 54 54 54 54 54

output:

15

result:

ok single line: '15'

Test #11:

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

input:

15 1
74 43 112 111 79 62 74 112 111 112 110 112 13 112 112

output:

6

result:

ok single line: '6'

Test #12:

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

input:

2 2
2 1

output:

2

result:

ok single line: '2'

Test #13:

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

input:

2 1
2 2

output:

2

result:

ok single line: '2'

Test #14:

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

input:

8 1
48 60 64 36 81 118 49 75

output:

1

result:

ok single line: '1'

Subtask #2:

score: 1
Accepted

Test #15:

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

input:

30 9
118 51 23 28 103 65 51 65 26 28 65 65 65 83 59 65 28 79 26 65 65 28 65 26 28 51 65 51 31 31

output:

14

result:

ok single line: '14'

Test #16:

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

input:

30 9
20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20

output:

30

result:

ok single line: '30'

Test #17:

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

input:

30 13
100 5 71 16 80 43 93 9 120 91 48 100 93 100 100 62 62 62 65 100 75 62 100 91 62 100 51 43 100 100

output:

14

result:

ok single line: '14'

Test #18:

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

input:

30 25
111 55 59 119 59 1 10 52 52 115 118 112 79 104 27 27 1 25 32 62 46 53 12 76 1 43 113 75 59 68

output:

25

result:

ok single line: '25'

Test #19:

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

input:

30 3
24 76 87 21 6 87 24 87 87 87 87 29 19 87 3 87 87 87 87 3 62 87 87 87 71 21 24 87 39 78

output:

15

result:

ok single line: '15'

Test #20:

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

input:

7 3
61 7 53 18 39 61 116

output:

3

result:

ok single line: '3'

Test #21:

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

input:

30 1
41 41 41 41 41 41 1 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 120 41 41 41 41 41 41

output:

1

result:

ok single line: '1'

Test #22:

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

input:

27 26
26 66 41 61 53 58 64 49 14 58 43 84 43 54 23 33 12 93 79 89 3 51 118 64 33 2 83

output:

26

result:

ok single line: '26'

Test #23:

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

input:

30 2
68 68 113 68 68 68 68 68 68 68 68 68 68 21 68 68 68 68 68 68 68 68 68 68 68 68 68 68 68 68

output:

29

result:

ok single line: '29'

Test #24:

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

input:

29 9
117 18 34 116 66 114 116 18 114 114 114 117 18 41 66 66 66 114 66 117 66 18 66 66 41 114 117 114 114

output:

14

result:

ok single line: '14'

Test #25:

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

input:

30 30
25 25 25 25 58 25 25 25 25 14 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25

output:

30

result:

ok single line: '30'

Subtask #3:

score: 1
Accepted

Test #26:

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

input:

28 1
77 12 114 115 120 82 20 40 114 66 114 115 90 20 77 114 120 90 90 12 114 90 114 120 114 114 90 90

output:

3

result:

ok single line: '3'

Test #27:

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

input:

30 26
1 43 1 65 65 1 65 43 65 65 65 1 1 65 1 65 65 65 65 1 65 1 65 65 65 65 43 1 65 65

output:

30

result:

ok single line: '30'

Test #28:

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

input:

30 21
47 47 35 47 47 42 85 47 47 47 47 47 35 35 57 11 57 47 57 57 83 83 47 57 11 57 57 47 36 11

output:

22

result:

ok single line: '22'

Test #29:

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

input:

30 15
28 107 114 83 72 82 62 63 91 36 42 56 41 104 111 25 22 3 8 45 86 72 84 30 30 5 110 62 30 88

output:

16

result:

ok single line: '16'

Test #30:

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

input:

30 2
120 120 120 120 1 120 120 120 120 120 120 120 120 120 120 120 120 120 120 120 120 120 120 120 120 120 120 120 120 120

output:

29

result:

ok single line: '29'

Test #31:

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

input:

30 30
53 53 53 53 53 53 53 53 53 53 53 53 53 53 53 53 53 53 53 53 53 53 53 53 53 53 53 53 53 53

output:

30

result:

ok single line: '30'

Test #32:

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

input:

30 29
96 96 96 96 96 96 96 96 96 96 96 101 65 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96

output:

29

result:

ok single line: '29'

Test #33:

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

input:

29 16
63 3 116 103 13 93 63 116 65 51 31 102 4 73 57 87 88 35 72 67 22 75 111 69 36 20 44 35 106

output:

17

result:

ok single line: '17'

Test #34:

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

input:

30 1
3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3

output:

30

result:

ok single line: '30'

Test #35:

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

input:

30 1
10 92 113 92 25 45 101 6 110 11 87 10 44 22 17 52 29 71 40 94 31 96 55 55 73 53 72 33 61 32

output:

1

result:

ok single line: '1'

Subtask #4:

score: 1
Accepted

Test #36:

score: 1
Accepted
time: 3ms
memory: 3672kb

input:

2000 1
94 1 109 13 24 91 71 83 72 57 2 63 31 40 19 70 8 102 105 2 70 44 41 27 5 79 89 95 40 38 29 48 23 19 53 28 25 15 86 111 99 88 51 58 87 89 12 41 58 56 99 38 80 11 60 20 73 62 98 79 21 47 102 63 102 60 111 56 107 119 54 79 91 2 94 21 5 41 27 36 88 33 4 90 77 61 33 36 119 27 94 6 53 31 85 41 65 1...

output:

15

result:

ok single line: '15'

Test #37:

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

input:

2000 1
17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17...

output:

2000

result:

ok single line: '2000'

Test #38:

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

input:

2000 1
55 18 64 61 60 71 6 71 54 111 28 79 18 71 71 102 65 79 71 107 2 71 18 18 17 36 2 107 79 18 79 79 71 17 79 102 102 79 24 24 71 79 79 71 105 108 71 28 71 79 71 79 65 71 18 18 102 83 24 17 71 65 28 2 102 10 71 18 79 51 18 71 71 79 71 109 24 33 71 71 10 71 102 18 71 87 71 52 79 71 18 43 2 71 33 7...

output:

9

result:

ok single line: '9'

Test #39:

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

input:

444 1
105 105 72 108 110 105 105 105 108 105 108 110 78 105 108 78 108 105 105 108 72 105 105 105 108 105 72 105 78 105 108 105 108 105 72 105 78 105 105 105 108 78 105 105 108 105 108 108 105 72 105 105 108 105 105 105 105 78 78 108 108 105 105 105 78 105 108 110 108 105 105 72 72 110 105 105 105 1...

output:

38

result:

ok single line: '38'

Test #40:

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

input:

1803 1
46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46...

output:

1803

result:

ok single line: '1803'

Test #41:

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

input:

2000 1
11 60 116 98 2 79 6 96 116 32 59 15 75 108 43 45 21 91 89 69 108 16 110 63 69 50 18 68 96 110 93 14 77 62 16 72 82 23 4 40 113 55 64 100 104 108 24 16 3 81 36 107 84 39 79 36 94 48 43 120 11 92 110 53 105 30 63 8 115 80 106 104 43 82 69 97 65 7 52 54 105 2 93 66 7 27 84 46 40 19 110 29 106 90...

output:

18

result:

ok single line: '18'

Test #42:

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

input:

682 1
101 63 86 101 101 101 63 63 86 63 63 63 86 101 63 63 63 63 63 63 63 86 101 101 101 63 63 113 63 86 63 113 63 101 63 63 86 63 101 101 101 63 63 113 63 63 86 63 63 63 63 63 86 63 63 101 63 86 101 63 101 113 63 63 101 101 86 101 63 63 101 63 63 101 86 63 63 86 63 86 101 63 63 63 63 63 63 63 86 63...

output:

62

result:

ok single line: '62'

Test #43:

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

input:

1999 1
67 67 74 67 27 27 31 31 45 89 11 31 65 45 67 67 67 44 67 20 89 67 74 67 45 67 31 31 31 117 67 89 31 27 67 67 89 89 67 67 117 31 44 45 67 67 44 31 89 67 89 89 31 67 45 31 31 117 67 45 44 67 31 31 89 20 89 31 31 27 89 45 31 89 44 74 67 31 67 45 67 31 45 67 67 31 27 67 45 31 67 67 74 27 89 27 65...

output:

38

result:

ok single line: '38'

Test #44:

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

input:

2000 1
63 82 33 46 80 55 114 107 48 71 75 48 32 83 74 83 42 55 75 87 19 25 5 87 19 89 101 32 55 59 29 18 96 69 99 42 45 96 106 114 42 85 93 21 56 106 21 50 73 97 92 56 107 3 19 29 3 3 94 99 117 69 15 70 61 57 64 56 76 10 50 48 97 102 76 72 54 62 54 20 57 4 57 17 12 16 38 49 45 66 39 41 33 42 87 63 4...

output:

18

result:

ok single line: '18'

Test #45:

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

input:

2000 1
120 113 120 120 120 120 120 113 120 113 120 113 120 120 120 120 120 120 113 113 120 120 113 113 113 113 120 113 113 113 120 120 113 120 120 113 113 120 113 113 120 113 113 113 113 113 120 113 120 113 113 113 120 120 113 113 113 120 113 113 113 113 120 113 120 120 113 113 120 113 113 120 113 1...

output:

1000

result:

ok single line: '1000'

Subtask #5:

score: 1
Accepted

Test #46:

score: 1
Accepted
time: 3ms
memory: 3652kb

input:

1998 1
69 58 2 71 23 2 51 58 2 23 65 23 71 58 2 2 116 2 71 2 71 69 71 2 71 69 23 62 105 40 45 69 75 2 71 17 2 65 69 71 75 2 2 2 69 7 105 71 45 71 63 63 69 23 23 2 69 79 71 71 65 71 71 65 41 71 2 106 71 45 69 65 69 120 24 106 105 71 71 71 88 11 2 71 71 71 71 75 2 71 65 2 75 71 2 17 71 120 71 71 23 2 ...

output:

32

result:

ok single line: '32'

Test #47:

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

input:

1160 1
118 118 38 118 118 38 118 118 118 118 38 118 38 118 118 118 38 118 118 118 118 38 118 38 38 118 38 118 118 38 118 38 118 118 118 38 118 118 38 118 118 118 118 38 38 118 118 38 118 38 118 118 38 118 118 38 118 118 118 118 38 118 118 38 118 118 118 118 38 118 118 118 118 118 118 118 118 38 118 ...

output:

872

result:

ok single line: '872'

Test #48:

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

input:

2000 1
78 78 78 78 78 78 78 78 78 78 78 78 78 78 78 78 78 78 78 78 78 78 78 78 78 78 78 78 78 78 78 78 78 78 78 78 78 78 78 78 78 78 78 78 78 78 78 78 78 78 78 78 78 78 78 78 78 78 78 78 78 78 78 78 78 78 78 78 78 78 78 78 78 78 78 78 78 78 78 78 78 78 78 78 78 78 78 78 78 78 78 78 78 78 78 78 78 78...

output:

1999

result:

ok single line: '1999'

Test #49:

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

input:

2000 1
42 42 42 42 42 42 42 42 42 42 42 42 42 42 42 42 42 42 42 42 42 42 42 42 42 42 42 42 42 42 42 42 42 42 42 42 42 42 42 42 42 42 42 42 42 42 42 42 42 42 42 42 42 42 42 42 42 42 42 42 42 42 42 42 42 42 42 42 42 42 42 42 42 42 42 42 42 42 42 42 42 42 42 42 42 42 42 42 42 42 42 42 42 42 42 42 42 42...

output:

1

result:

ok single line: '1'

Test #50:

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

input:

1920 1
103 19 98 71 55 9 103 28 72 51 76 43 36 57 50 70 8 5 30 2 45 64 74 91 17 9 117 43 40 80 32 37 101 99 15 17 1 110 70 17 76 8 90 39 5 50 86 25 31 48 41 74 34 7 85 29 26 7 84 93 79 83 82 97 26 86 84 88 113 67 47 15 95 97 104 70 101 26 81 85 54 105 57 37 65 110 43 97 71 57 77 34 99 108 64 96 76 5...

output:

16

result:

ok single line: '16'

Test #51:

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

input:

1998 1
97 50 97 97 50 50 20 20 97 50 50 20 20 50 97 97 20 97 97 97 97 97 20 97 20 20 20 20 97 20 50 97 97 97 50 97 50 50 97 20 97 20 20 50 20 50 97 50 97 97 50 20 20 20 97 50 20 97 97 97 50 97 50 97 20 50 97 50 50 97 20 20 20 97 97 20 20 97 97 97 20 20 97 97 50 97 20 20 50 50 97 97 50 20 20 20 50 97...

output:

666

result:

ok single line: '666'

Test #52:

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

input:

2000 1
100 42 94 42 86 42 42 42 42 100 39 91 42 100 42 98 42 39 104 42 37 42 100 100 94 100 42 94 100 42 91 42 100 42 42 42 100 86 42 100 108 42 90 37 91 94 75 100 91 98 42 39 108 42 100 108 36 25 42 37 42 100 90 98 42 94 100 104 100 90 42 100 42 108 42 108 91 86 100 42 100 91 100 42 42 108 75 42 10...

output:

18

result:

ok single line: '18'

Test #53:

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

input:

89 1
73 24 73 87 87 87 87 73 24 87 73 87 24 87 87 87 73 87 87 24 87 24 87 73 87 87 87 73 87 87 87 87 87 73 73 24 87 87 87 87 73 73 24 87 87 87 24 24 73 73 87 87 87 87 73 87 73 73 24 24 87 73 87 87 73 24 87 73 87 87 24 87 73 87 24 24 73 73 73 87 24 24 87 87 24 87 87 87 87

output:

48

result:

ok single line: '48'

Test #54:

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

input:

2000 1
97 46 36 62 39 117 85 19 70 13 29 76 96 62 40 102 110 83 16 18 21 98 37 16 19 111 21 65 71 37 22 69 32 23 32 25 20 51 33 106 6 31 120 31 118 6 42 4 105 70 16 120 15 83 118 38 116 31 94 72 38 108 12 27 16 98 30 56 89 40 78 92 64 119 86 113 43 111 20 95 44 67 98 117 10 75 47 53 38 37 101 105 16...

output:

12

result:

ok single line: '12'

Test #55:

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

input:

2000 1
85 82 82 82 111 85 85 82 82 85 47 85 85 85 111 85 35 85 35 47 47 82 82 47 82 85 82 85 82 35 85 82 85 82 35 82 85 82 85 35 82 82 85 85 85 82 85 85 35 82 85 85 85 47 85 85 82 47 85 82 82 82 35 82 82 82 35 82 85 35 85 85 82 111 85 85 47 47 82 82 47 85 85 35 47 82 85 35 85 85 85 82 35 85 57 82 85...

output:

78

result:

ok single line: '78'

Subtask #6:

score: 1
Accepted

Test #56:

score: 1
Accepted
time: 3ms
memory: 3672kb

input:

1424 197
4 78 49 78 78 36 78 78 60 78 52 78 22 78 78 78 36 78 22 78 49 36 78 36 78 60 78 60 49 96 78 36 78 78 78 4 78 22 78 49 78 60 49 60 78 5 78 49 52 49 78 78 78 36 36 60 49 78 49 49 78 36 78 78 49 78 78 36 96 9 5 36 78 78 5 78 52 78 78 67 78 49 4 78 36 36 23 78 36 5 22 78 78 9 36 60 78 78 4 36 7...

output:

646

result:

ok single line: '646'

Test #57:

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

input:

1999 1298
101 8 98 52 11 119 6 20 10 12 73 35 4 67 104 68 28 18 98 49 38 67 59 58 80 66 71 7 105 39 117 60 15 3 97 17 108 114 96 61 5 100 77 107 40 89 43 118 87 5 94 110 6 90 82 105 29 97 91 91 6 42 101 81 34 95 103 33 61 45 63 5 36 104 3 64 82 33 98 23 79 105 82 70 118 77 11 75 49 82 81 14 79 3 58 ...

output:

1303

result:

ok single line: '1303'

Test #58:

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

input:

2000 141
19 12 35 4 103 36 7 54 9 58 25 103 104 54 84 50 109 17 17 6 90 5 83 36 39 53 45 4 120 111 98 57 41 7 4 47 69 14 64 30 104 100 26 40 88 99 116 83 50 52 88 47 21 74 94 82 11 10 73 55 28 85 87 88 108 86 27 59 3 65 49 89 112 61 109 1 89 43 58 84 84 19 43 30 65 81 38 109 86 29 25 99 10 43 100 57...

output:

146

result:

ok single line: '146'

Test #59:

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

input:

1455 466
5 117 117 46 43 95 97 64 37 5 31 37 37 18 117 37 120 5 117 37 5 5 50 117 72 120 118 43 31 5 46 117 22 94 5 59 15 50 117 5 43 120 27 5 37 5 50 120 120 65 18 5 32 46 5 24 29 37 5 95 5 37 93 64 31 5 37 31 117 95 46 31 87 72 95 87 29 37 37 31 50 32 37 5 31 5 105 120 95 5 105 5 5 27 120 25 117 3...

output:

485

result:

ok single line: '485'

Test #60:

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

input:

2000 1726
102 102 50 107 93 32 1 22 91 32 36 50 102 102 64 55 64 102 116 102 102 112 64 91 116 50 32 102 10 116 102 102 102 107 102 74 39 102 55 23 64 102 64 82 102 32 102 1 32 64 64 64 25 64 64 107 32 102 102 102 102 64 39 102 23 64 102 1 50 32 91 64 68 64 102 102 50 32 102 93 64 64 64 102 102 64 6...

output:

1874

result:

ok single line: '1874'

Test #61:

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

input:

2000 1000
120 29 120 120 29 120 29 29 120 120 29 29 29 29 29 120 29 120 29 120 29 120 29 29 29 120 29 29 120 29 29 120 120 120 120 29 120 29 120 120 120 29 120 29 120 29 29 29 29 120 120 120 120 120 120 120 29 29 29 120 120 29 120 120 120 29 29 29 120 120 29 120 120 29 29 120 120 120 120 120 29 29 1...

output:

1000

result:

ok single line: '1000'

Test #62:

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

input:

1920 1479
103 58 75 119 92 15 71 117 108 43 50 33 60 4 5 112 44 51 39 24 67 70 43 27 119 29 71 100 98 71 111 120 104 28 34 110 49 54 60 89 55 15 8 57 115 105 78 73 37 103 114 22 69 61 63 85 35 12 55 10 50 35 67 92 102 105 44 88 28 43 117 71 120 86 107 26 19 81 10 99 16 62 83 94 95 99 68 70 100 38 53...

output:

1488

result:

ok single line: '1488'

Test #63:

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

input:

631 62
110 26 103 52 1 27 39 60 20 82 75 104 113 34 110 82 59 39 93 105 42 11 50 52 93 105 88 33 13 10 6 58 93 32 60 49 69 52 28 3 109 24 89 59 16 6 12 53 30 87 104 69 48 1 97 87 70 106 94 61 101 65 30 28 43 17 38 35 4 8 43 111 5 37 46 56 119 90 23 71 50 43 81 106 38 38 23 11 51 39 50 31 55 107 54 1...

output:

66

result:

ok single line: '66'

Test #64:

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

input:

2000 346
77 60 77 93 60 77 60 100 1 60 77 60 93 77 77 1 71 77 60 60 93 93 60 26 77 60 26 110 60 77 60 77 71 60 26 60 26 60 60 36 60 93 60 26 60 60 60 77 77 60 60 60 60 26 60 26 26 60 77 15 77 77 26 26 60 77 60 93 77 77 77 60 77 71 60 110 71 77 100 77 1 60 60 60 100 71 36 77 77 110 60 60 60 60 100 77...

output:

356

result:

ok single line: '356'

Test #65:

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

input:

1920 543
102 25 76 15 108 40 5 37 82 44 33 9 66 51 96 37 70 77 56 23 106 23 91 15 107 46 85 64 38 23 51 36 14 77 25 66 59 47 115 89 2 29 64 21 95 106 26 13 62 101 55 35 26 10 22 14 63 67 84 94 22 91 27 100 90 47 74 90 97 118 86 109 115 9 8 15 54 23 59 2 19 111 12 24 41 116 102 115 120 42 46 82 9 114...

output:

544

result:

ok single line: '544'

Test #66:

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

input:

2000 801
120 120 120 120 120 120 120 120 120 120 120 120 120 120 120 120 120 120 120 120 120 120 120 120 120 120 120 120 120 120 120 120 120 120 120 120 120 120 120 120 120 120 120 120 120 120 120 120 120 120 120 120 120 120 120 120 120 120 120 120 120 120 120 120 120 120 120 120 120 120 120 120 120...

output:

2000

result:

ok single line: '2000'

Test #67:

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

input:

120 1
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 10...

output:

1

result:

ok single line: '1'

Subtask #7:

score: 1
Accepted

Test #68:

score: 1
Accepted
time: 3ms
memory: 3576kb

input:

2000 1054
90 62 104 24 79 18 4 94 120 117 44 117 108 34 38 95 70 2 54 80 53 68 73 105 41 64 103 64 39 115 35 91 116 31 42 13 84 47 99 6 2 99 56 22 89 54 25 24 61 119 80 87 48 102 53 120 45 86 84 90 66 49 85 75 111 64 50 85 37 80 54 79 85 7 97 95 35 16 69 119 28 77 25 117 117 36 63 92 113 46 71 61 24...

output:

1056

result:

ok single line: '1056'

Test #69:

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

input:

2000 1
120 1 120 1 120 1 120 1 120 1 120 1 120 1 120 1 120 1 120 1 120 1 120 1 120 1 120 1 120 1 120 1 120 1 120 1 120 1 120 1 120 1 120 1 120 1 120 1 120 1 120 1 120 1 120 1 120 1 120 1 120 1 120 1 120 1 120 1 120 1 120 1 120 1 120 1 120 1 120 1 120 1 120 1 120 1 120 1 120 1 120 1 120 1 120 1 120 1...

output:

1000

result:

ok single line: '1000'

Test #70:

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

input:

2000 1
115 115 62 115 62 115 115 62 115 115 115 115 115 115 115 115 115 115 115 115 115 62 115 115 115 62 115 62 115 62 62 115 62 115 115 62 115 62 115 62 115 115 115 115 115 115 62 62 62 62 115 115 115 115 115 115 115 62 115 115 115 115 115 115 115 115 115 115 115 115 115 62 115 115 115 115 115 115...

output:

1504

result:

ok single line: '1504'

Test #71:

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

input:

2000 2000
80 94 82 80 94 94 80 82 80 94 11 80 94 94 80 11 69 80 94 30 94 80 80 30 30 80 94 80 69 80 94 69 80 30 80 80 80 80 80 69 94 11 80 82 80 80 82 80 80 69 30 94 80 94 80 80 94 94 11 80 80 80 80 80 30 80 80 94 80 80 80 82 80 80 80 80 94 94 11 94 11 94 80 80 94 80 11 30 82 94 80 82 80 80 80 80 94...

output:

2000

result:

ok single line: '2000'

Test #72:

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

input:

1920 1461
41 24 94 96 71 35 97 32 36 36 86 48 16 41 9 5 94 39 41 15 3 14 34 51 75 107 5 68 83 86 97 58 100 115 90 65 34 10 119 82 93 61 107 87 71 2 88 42 25 45 29 119 26 30 4 16 100 87 82 11 58 72 78 19 73 66 85 48 50 85 65 19 31 39 85 12 37 77 92 5 109 101 45 120 1 35 35 22 101 99 1 8 49 34 107 23 ...

output:

1472

result:

ok single line: '1472'

Test #73:

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

input:

186 145
35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 78 35 78 35 78 35 35 35 35 35 35 35 35 35 78 35 35 35 35 35 35 35 35 35 35 35 35 78 35 35 35 35 35 35 35 35 35 78 35 78 35 35 35 35 35 35 35 78 35 35 35 35 35 35 35 78 35 78 78 78 35 35 35 78 35 35 35 35 35 78 35 35 35 78 35 35 35 78 78 35 7...

output:

186

result:

ok single line: '186'

Test #74:

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

input:

1998 1000
20 66 66 20 20 66 66 88 20 66 20 88 66 66 20 88 88 66 20 20 88 66 66 66 88 20 66 20 66 20 66 88 20 88 66 66 88 66 66 66 88 88 88 20 66 66 20 88 88 66 88 88 66 20 88 66 20 20 66 88 66 66 66 20 20 88 20 20 66 20 20 20 88 66 66 20 88 66 88 88 66 20 66 88 88 66 66 66 66 66 20 66 20 66 20 88 20...

output:

1332

result:

ok single line: '1332'

Test #75:

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

input:

2000 863
62 62 3 108 54 62 3 3 54 3 3 3 14 5 62 35 62 62 62 71 14 3 62 62 108 54 62 3 3 71 62 62 3 62 3 62 71 3 62 108 108 71 35 3 3 71 3 54 62 14 3 3 62 71 14 3 71 3 35 71 35 62 3 14 62 3 3 3 3 54 3 3 3 62 71 3 108 3 3 62 5 14 3 54 71 3 71 14 3 3 54 62 35 3 62 108 62 3 3 3 3 3 3 3 3 62 62 35 62 54 ...

output:

906

result:

ok single line: '906'

Test #76:

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

input:

2000 1
56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56...

output:

2000

result:

ok single line: '2000'

Test #77:

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

input:

1997 1633
84 24 62 9 98 80 18 106 31 94 70 53 18 62 35 3 90 104 15 26 48 2 15 80 108 38 34 113 73 52 80 102 104 35 6 25 104 4 25 56 64 70 72 105 98 95 104 89 31 28 82 83 8 58 58 21 120 103 102 40 106 6 70 55 104 24 118 73 1 49 2 6 82 103 119 34 33 34 67 86 113 106 101 23 95 55 50 112 104 86 31 50 10...

output:

1636

result:

ok single line: '1636'

Test #78:

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

input:

2000 1362
24 101 90 7 45 13 90 7 57 24 13 35 24 13 56 53 7 7 74 101 7 85 13 7 101 45 7 7 10 7 90 94 101 101 10 7 7 7 13 45 7 7 7 71 7 94 7 57 37 56 101 45 7 10 95 24 7 57 90 13 101 13 7 10 74 99 7 7 44 7 101 7 7 105 29 7 24 24 24 94 101 78 73 101 7 7 105 24 7 24 13 13 7 7 45 74 44 101 45 7 57 13 44 ...

output:

1405

result:

ok single line: '1405'

Test #79:

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

input:

2000 1334
120 1 120 1 120 1 120 1 120 1 120 1 120 1 120 1 120 1 120 1 120 1 120 1 120 1 120 1 120 1 120 1 120 1 120 1 120 1 120 1 120 1 120 1 120 1 120 1 120 1 120 1 120 1 120 1 120 1 120 1 120 1 120 1 120 1 120 1 120 1 120 1 120 1 120 1 120 1 120 1 120 1 120 1 120 1 120 1 120 1 120 1 120 1 120 1 12...

output:

2000

result:

ok single line: '2000'

Subtask #8:

score: 1
Accepted

Test #80:

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

input:

2000 4
119 76 86 104 90 53 92 50 113 92 32 66 33 85 36 69 110 58 71 4 10 56 118 69 40 12 115 17 11 83 71 41 103 31 3 22 75 5 46 60 64 20 3 56 95 99 29 23 28 106 30 90 34 50 42 80 96 83 24 72 28 26 14 9 1 39 57 62 88 19 87 84 93 104 1 83 63 68 119 18 113 110 75 24 81 18 93 33 112 77 119 79 34 79 94 7...

output:

21

result:

ok single line: '21'

Test #81:

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

input:

2000 997
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:

997

result:

ok single line: '997'

Test #82:

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

input:

854 494
17 24 91 53 10 22 32 99 70 109 40 80 58 42 85 42 15 57 79 10 119 63 8 58 77 36 101 70 119 25 94 86 40 72 57 96 16 117 50 98 11 41 42 103 106 105 14 79 87 120 116 30 116 116 31 31 94 23 72 61 23 14 31 120 24 33 99 3 110 35 99 21 43 1 91 106 112 72 102 63 35 114 82 9 65 32 102 71 12 24 68 110 ...

output:

494

result:

ok single line: '494'

Test #83:

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

input:

2000 35
108 60 114 77 52 116 31 34 6 100 119 43 12 84 18 116 23 108 58 1 119 95 98 33 106 74 72 11 19 86 59 65 13 90 71 104 4 36 52 39 5 118 42 16 90 120 55 70 116 63 23 109 107 61 83 3 40 83 90 94 38 38 37 77 84 8 6 68 97 55 50 18 24 38 27 57 75 1 51 81 86 30 44 51 37 3 14 28 17 15 26 20 42 17 84 7...

output:

44

result:

ok single line: '44'

Test #84:

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

input:

2000 666
120 1 120 1 120 1 120 1 120 1 120 1 120 1 120 1 120 1 120 1 120 1 120 1 120 1 120 1 120 1 120 1 120 1 120 1 120 1 120 1 120 1 120 1 120 1 120 1 120 1 120 1 120 1 120 1 120 1 120 1 120 1 120 1 120 1 120 1 120 1 120 1 120 1 120 1 120 1 120 1 120 1 120 1 120 1 120 1 120 1 120 1 120 1 120 1 120...

output:

1000

result:

ok single line: '1000'

Test #85:

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

input:

1466 516
25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 ...

output:

1466

result:

ok single line: '1466'

Test #86:

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

input:

120 71
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 1...

output:

71

result:

ok single line: '71'

Test #87:

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

input:

2000 1001
53 9 53 9 53 9 9 9 53 53 9 9 53 9 9 53 53 9 9 53 9 53 53 9 9 53 9 9 9 53 9 53 53 53 9 53 9 9 53 53 53 53 9 9 9 9 9 53 9 53 53 53 53 53 9 53 53 9 9 53 9 53 9 9 53 9 9 9 9 53 9 53 53 53 9 53 53 53 53 53 9 9 53 9 9 53 9 9 53 9 53 9 9 53 9 9 53 53 9 53 9 53 53 53 9 9 9 53 53 53 9 9 53 53 53 9 ...

output:

2000

result:

ok single line: '2000'

Test #88:

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

input:

2000 1
8 8 42 8 42 8 8 8 42 8 8 8 8 8 42 8 8 8 8 8 8 8 8 42 42 8 8 42 8 42 8 8 8 8 8 8 8 42 8 8 8 8 8 8 8 8 8 8 8 8 8 42 8 8 8 8 42 8 8 8 8 42 8 8 8 42 42 8 8 8 8 42 8 8 8 8 8 42 8 8 8 8 8 8 8 8 8 8 8 42 42 8 8 8 8 42 8 8 42 8 8 8 8 42 42 8 8 42 8 8 42 42 8 42 8 8 8 8 8 8 8 8 42 8 8 8 8 8 42 8 42 42...

output:

479

result:

ok single line: '479'

Test #89:

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

input:

2000 2000
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 ...

output:

2000

result:

ok single line: '2000'

Test #90:

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

input:

2000 50
4 23 52 93 101 57 5 44 93 110 3 86 60 3 6 87 80 60 61 116 53 27 53 19 94 64 68 42 14 75 28 119 28 30 108 13 58 45 48 86 14 38 76 95 88 105 105 89 95 18 114 48 39 31 69 32 103 31 75 36 103 92 45 60 92 84 48 105 116 88 68 12 11 62 59 101 14 20 60 104 77 113 54 57 110 45 80 83 70 109 14 50 9 75...

output:

56

result:

ok single line: '56'

Test #91:

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

input:

1522 1090
89 42 6 89 89 89 89 42 89 107 80 89 6 89 89 89 89 80 80 80 6 74 107 6 89 74 89 14 74 89 89 89 89 6 6 6 89 89 89 107 89 89 80 89 6 89 80 42 74 74 89 42 6 6 6 89 80 89 42 89 6 4 6 89 89 89 6 89 74 6 89 89 89 6 89 80 4 74 107 74 6 6 89 42 6 6 89 89 74 4 4 89 89 14 89 89 6 89 89 89 89 89 6 89 ...

output:

1118

result:

ok single line: '1118'

Subtask #9:

score: 1
Accepted

Test #92:

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

input:

1998 1063
86 86 86 86 86 86 86 86 86 86 86 86 86 86 86 86 86 86 86 86 86 86 86 86 86 86 86 86 86 86 86 86 86 86 86 86 86 86 86 86 86 86 86 86 86 86 86 86 86 86 86 86 86 86 86 86 86 86 86 86 86 86 86 86 86 86 86 86 86 86 86 86 86 86 86 86 86 86 86 86 86 86 86 86 86 86 86 86 86 86 86 86 86 86 86 86 86...

output:

1998

result:

ok single line: '1998'

Test #93:

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

input:

2000 1419
41 72 98 72 72 41 72 72 72 98 72 72 72 72 72 41 72 72 72 41 41 72 72 72 41 41 72 72 98 72 72 41 72 72 41 72 98 98 41 72 41 72 72 98 98 72 72 72 72 98 72 72 72 98 72 72 41 98 72 72 98 98 72 72 72 72 98 72 72 72 72 98 72 72 72 72 98 72 72 72 41 72 98 72 41 41 98 72 72 98 72 98 72 72 98 72 72...

output:

1776

result:

ok single line: '1776'

Test #94:

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

input:

1999 1791
100 71 39 57 6 95 86 13 30 114 97 100 28 25 65 36 84 55 78 21 117 77 3 73 74 21 36 117 50 105 96 92 6 58 59 50 114 43 5 102 76 27 80 37 13 67 74 36 25 4 47 57 63 118 111 117 83 63 44 75 104 104 9 8 56 18 41 112 45 15 119 7 20 111 54 46 40 10 60 19 84 24 22 63 43 100 103 80 92 26 6 104 10 1...

output:

1805

result:

ok single line: '1805'

Test #95:

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

input:

2000 452
84 119 47 75 51 117 2 117 15 29 1 84 66 27 30 39 73 67 85 110 70 61 117 101 110 60 50 40 24 49 45 61 110 57 100 13 92 74 28 48 69 66 57 88 42 93 88 32 11 60 45 2 82 21 92 95 33 117 84 114 101 120 88 56 94 85 45 114 116 78 34 109 19 76 61 73 49 15 37 82 31 106 52 93 79 41 61 17 80 6 24 91 77...

output:

459

result:

ok single line: '459'

Test #96:

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

input:

2000 2000
118 37 37 52 118 37 37 37 118 37 37 37 118 75 37 118 118 37 118 37 118 118 118 37 37 37 37 52 118 37 37 37 37 37 37 37 37 37 52 37 37 37 37 37 37 37 118 37 37 37 37 118 118 75 37 37 52 37 118 118 52 52 118 37 52 75 118 37 118 37 75 37 37 37 118 118 52 37 37 37 37 118 118 118 37 37 118 37 5...

output:

2000

result:

ok single line: '2000'

Test #97:

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

input:

2000 1954
100 10 75 17 37 117 33 112 34 30 77 94 12 10 100 82 86 58 21 103 21 80 16 103 89 104 119 13 107 110 24 10 22 54 108 6 103 23 64 85 111 28 84 51 109 2 50 75 107 71 15 116 77 59 18 109 62 3 41 83 91 57 77 100 82 46 26 89 42 110 60 60 31 72 63 90 23 45 8 83 15 71 79 23 19 20 115 26 10 70 87 1...

output:

1964

result:

ok single line: '1964'

Test #98:

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

input:

2000 1000
120 1 120 1 120 1 120 1 120 1 120 1 120 1 120 1 120 1 120 1 120 1 120 1 120 1 120 1 120 1 120 1 120 1 120 1 120 1 120 1 120 1 120 1 120 1 120 1 120 1 120 1 120 1 120 1 120 1 120 1 120 1 120 1 120 1 120 1 120 1 120 1 120 1 120 1 120 1 120 1 120 1 120 1 120 1 120 1 120 1 120 1 120 1 120 1 12...

output:

1000

result:

ok single line: '1000'

Test #99:

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

input:

2000 1
105 105 73 73 73 73 73 73 105 73 73 73 73 73 73 73 73 73 105 73 73 73 73 73 73 73 73 105 105 105 73 73 73 105 105 73 73 73 73 105 73 73 73 73 73 73 73 73 105 73 73 73 73 73 73 73 73 73 73 105 73 73 73 73 73 73 73 73 105 105 73 73 105 73 73 73 73 73 73 105 73 73 105 73 105 73 73 73 105 105 105...

output:

511

result:

ok single line: '511'

Test #100:

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

input:

2000 1979
16 107 6 46 10 111 82 5 41 56 84 39 80 10 78 10 94 63 98 19 76 23 108 13 47 48 78 75 119 100 71 99 100 37 97 48 5 36 68 104 110 96 32 9 3 62 48 63 27 49 89 69 53 2 94 98 84 39 37 38 17 97 54 25 16 61 57 65 109 52 84 98 93 34 120 69 96 87 24 7 81 102 78 110 104 57 89 118 9 41 13 57 100 89 1...

output:

1991

result:

ok single line: '1991'

Test #101:

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

input:

1997 1536
86 86 86 86 86 86 86 86 86 86 86 86 86 86 86 86 86 86 86 86 86 86 86 86 86 86 86 86 86 86 86 86 86 86 86 86 86 86 86 86 86 86 86 86 86 86 86 86 86 86 86 86 86 86 86 86 86 86 86 86 86 86 86 86 86 86 86 86 86 86 86 86 86 86 86 86 86 86 86 86 86 86 86 86 86 86 86 86 86 86 86 86 86 86 86 86 86...

output:

1997

result:

ok single line: '1997'

Test #102:

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

input:

2000 24
25 104 90 39 77 3 7 80 35 88 111 64 1 90 61 45 23 36 118 38 20 80 45 39 99 83 77 14 58 116 80 23 47 38 79 63 77 20 44 24 73 50 101 88 27 8 2 106 25 104 74 111 32 115 82 58 67 32 47 37 32 25 56 34 81 8 36 97 119 49 52 51 36 111 112 39 102 94 45 16 4 39 15 91 61 109 105 95 7 72 117 12 82 52 23...

output:

27

result:

ok single line: '27'

Subtask #10:

score: 1
Accepted

Test #103:

score: 1
Accepted
time: 1ms
memory: 3712kb

input:

2000 1999
31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31...

output:

2000

result:

ok single line: '2000'

Test #104:

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

input:

1373 616
119 36 36 71 36 71 36 36 119 36 36 36 36 36 36 36 71 36 36 71 71 36 36 36 119 36 36 71 36 36 36 36 36 36 36 36 36 36 36 36 36 36 71 36 71 36 36 71 36 119 36 36 29 36 36 119 36 36 29 36 71 71 119 36 36 29 71 36 36 71 71 36 71 71 36 36 71 29 36 29 36 71 71 36 119 36 36 71 36 119 36 36 36 71 7...

output:

1265

result:

ok single line: '1265'

Test #105:

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

input:

2000 1999
64 108 80 23 89 107 26 105 40 117 94 99 51 98 32 55 40 30 93 22 27 51 28 78 8 56 19 65 23 78 73 112 41 10 75 96 91 28 5 39 111 64 108 55 72 69 95 117 36 65 111 46 22 19 9 35 40 97 110 56 103 104 36 107 15 24 109 77 55 24 51 72 91 15 120 54 69 36 120 63 33 106 38 18 26 18 79 67 54 11 34 93 ...

output:

2000

result:

ok single line: '2000'

Test #106:

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

input:

2000 1001
120 1 120 1 120 1 120 1 120 1 120 1 120 1 120 1 120 1 120 1 120 1 120 1 120 1 120 1 120 1 120 1 120 1 120 1 120 1 120 1 120 1 120 1 120 1 120 1 120 1 120 1 120 1 120 1 120 1 120 1 120 1 120 1 120 1 120 1 120 1 120 1 120 1 120 1 120 1 120 1 120 1 120 1 120 1 120 1 120 1 120 1 120 1 120 1 12...

output:

2000

result:

ok single line: '2000'

Test #107:

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

input:

1998 343
70 110 2 76 43 96 77 26 69 55 22 60 49 73 28 60 111 74 98 79 72 79 50 26 115 68 42 113 6 11 26 79 113 120 115 15 52 106 53 60 47 67 72 7 44 23 108 54 8 103 58 71 98 52 38 107 21 112 34 46 90 72 111 43 103 107 86 88 18 65 51 109 7 6 62 99 86 22 50 61 64 48 70 105 78 63 15 109 73 57 112 103 2...

output:

343

result:

ok single line: '343'

Test #108:

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

input:

2000 1936
91 7 100 53 55 46 86 94 80 108 111 72 15 75 90 67 96 17 100 93 95 72 99 41 67 19 43 65 5 33 3 90 41 9 15 118 52 50 72 117 61 43 9 102 65 19 53 61 98 118 65 51 5 115 119 78 101 103 59 90 50 20 34 60 108 62 24 11 74 1 71 94 116 9 47 82 78 6 42 92 113 18 73 68 38 33 71 34 6 53 20 64 33 43 18 ...

output:

1945

result:

ok single line: '1945'

Test #109:

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

input:

120 120
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:

120

result:

ok single line: '120'

Test #110:

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

input:

452 23
71 57 83 38 102 49 105 24 86 98 4 7 14 48 25 13 45 18 81 52 58 95 18 80 94 73 108 6 86 7 116 28 10 41 45 61 109 96 28 98 56 46 33 37 114 38 79 5 47 107 112 31 100 51 77 92 69 15 66 9 79 17 25 34 101 26 32 81 86 118 109 76 71 15 44 70 99 28 77 29 20 110 93 103 53 18 72 73 37 50 27 113 47 100 6...

output:

23

result:

ok single line: '23'

Test #111:

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

input:

2000 1574
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 ...

output:

2000

result:

ok single line: '2000'

Test #112:

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

input:

2000 1
102 102 102 102 102 102 102 102 102 102 102 102 102 102 102 102 102 102 102 102 102 102 102 102 102 102 102 102 102 102 102 102 102 102 102 102 102 102 102 102 102 102 102 102 102 102 102 102 102 102 102 102 102 102 102 102 102 102 102 102 102 102 102 102 102 102 102 102 102 102 102 102 102 1...

output:

2000

result:

ok single line: '2000'

Test #113:

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

input:

2000 2
118 118 118 118 118 118 118 118 118 118 118 118 118 118 118 118 118 118 118 118 118 118 118 118 118 118 118 118 118 118 118 118 118 118 118 118 118 118 118 118 118 118 118 118 118 118 118 118 118 118 118 118 118 118 118 118 118 118 118 118 118 118 118 118 118 118 118 118 118 118 118 118 118 1...

output:

1999

result:

ok single line: '1999'