QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#873732#5167. 魔术师addiyoue10 294ms13652kbC++203.4kb2025-01-26 21:40:092025-01-26 21:40:10

Details

Tip: Click on the bar to expand more detailed information

Subtask #1:

score: 0
Wrong Answer

Test #1:

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

input:

1 1 1
1

output:

0

result:

ok Perfect :) Use 0 operations

Test #2:

score: 5
Accepted
time: 0ms
memory: 3840kb

input:

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

output:

0

result:

ok Perfect :) Use 0 operations

Test #3:

score: 5
Accepted
time: 0ms
memory: 3584kb

input:

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

output:

-1

result:

ok No solutions

Test #4:

score: 5
Accepted
time: 0ms
memory: 3840kb

input:

1 4 3
1 2 3 4

output:

0

result:

ok Perfect :) Use 0 operations

Test #5:

score: 0
Wrong Answer
time: 0ms
memory: 3584kb

input:

1 5 3
5 2 1 4 3

output:


result:

wrong output format Unexpected end of file - int32 expected

Subtask #2:

score: 0
Wrong Answer

Test #21:

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

input:

2 2 2
2 1

output:

1
0

result:

ok Perfect :) Use 1 operations

Test #22:

score: 5
Accepted
time: 0ms
memory: 3840kb

input:

2 3 2
1 3 2

output:

5
0
1
0
1
0

result:

ok Perfect :) Use 5 operations

Test #23:

score: 0
Wrong Answer
time: 1ms
memory: 3584kb

input:

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

output:

-1

result:

wrong answer Jury has the answer but participant has not

Subtask #3:

score: 0
Wrong Answer

Test #36:

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

input:

3 30 29
19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 30 29 28 27 26 25 24 23 22 21 20

output:

11
0
1
0
1
0
1
0
1
0
1
0

result:

ok Perfect :) Use 11 operations

Test #37:

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

input:

3 30 29
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 1 2 3 4 5

output:

-1

result:

ok No solutions

Test #38:

score: 5
Accepted
time: 0ms
memory: 3840kb

input:

3 29 29
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

output:

0

result:

ok Perfect :) Use 0 operations

Test #39:

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

input:

3 29 29
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 1 2 3 4 5 6 7 8 9 10 11 12

output:

-1

result:

ok No solutions

Test #40:

score: 0
Wrong Answer
time: 0ms
memory: 3584kb

input:

3 29 27
29 6 23 4 19 2 7 28 5 26 13 24 9 22 15 20 3 18 25 16 1 14 17 12 27 10 21 8 11

output:


result:

wrong output format Unexpected end of file - int32 expected

Subtask #4:

score: 0
Wrong Answer

Test #56:

score: 5
Accepted
time: 0ms
memory: 3584kb

input:

4 30 30
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

output:

0

result:

ok Perfect :) Use 0 operations

Test #57:

score: 5
Accepted
time: 0ms
memory: 3584kb

input:

4 30 30
20 23 4 16 27 18 7 9 19 11 2 28 14 25 26 30 13 1 10 6 12 17 3 8 5 15 22 29 21 24

output:

-1

result:

ok No solutions

Test #58:

score: 5
Accepted
time: 0ms
memory: 3584kb

input:

4 30 30
24 25 26 27 28 29 30 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23

output:

-1

result:

ok No solutions

Test #59:

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

input:

4 29 28
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 1

output:

30
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1

result:

ok Perfect :) Use 30 operations

Test #60:

score: 5
Accepted
time: 0ms
memory: 3584kb

input:

4 29 28
4 3 12 18 13 9 2 19 10 14 21 25 5 6 22 20 27 7 16 23 28 11 26 29 24 17 15 8 1

output:

-1

result:

ok No solutions

Test #61:

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

input:

4 30 28
26 6 10 15 22 5 4 13 11 1 14 18 29 9 30 12 8 3 19 20 2 24 28 21 25 23 16 7 27 17

output:

799
0
2
1
2
1
2
1
2
1
2
1
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
0
1
0
1
0
1
0
1
0
1
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
0
1
0
1
0
1
0
1
0
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
2
1
2
1
2
1
2
1
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
2
1
2
1
2
1
2
1
1
0
1
0
1
0
1
0
1
0
1
0
1
...

result:

ok Perfect :) Use 799 operations

Test #62:

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

input:

4 30 28
29 1 10 8 4 21 24 27 23 15 25 20 17 16 3 22 30 13 5 12 26 14 19 6 2 9 28 11 18 7

output:

801
0
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
2
1
2
1
2
1
2
1
2
1
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
1
0
1
0
1
0
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
1
0
1
0
1
0
1
0
1
0
1
0
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
0
1
0
1
0
1
0
1
0
1
0
1
1
2
1
2
1
2
1
2
1
2
1
2
1
...

result:

ok Perfect :) Use 801 operations

Test #63:

score: 5
Accepted
time: 0ms
memory: 3840kb

input:

4 30 28
6 25 22 17 12 18 20 3 29 27 5 2 21 9 24 19 15 10 26 16 30 14 7 28 8 11 23 13 1 4

output:

861
0
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
0
1
0
1
0
1
0
1
1
2
1
2
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
0
1
0
1
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
0
1
0
1
0
1
0
1
0
1
2
1
2
1
2
1
2
1
1
0
1
0
1
0
1
...

result:

ok Perfect :) Use 861 operations

Test #64:

score: 5
Accepted
time: 0ms
memory: 3584kb

input:

4 30 28
30 10 12 18 21 14 15 17 2 29 27 25 24 26 23 16 1 8 3 22 28 9 19 6 7 20 5 13 4 11

output:

-1

result:

ok No solutions

Test #65:

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

input:

4 30 26
28 10 13 6 21 2 29 23 30 3 26 5 18 16 7 27 11 15 19 14 20 25 1 4 8 9 12 24 17 22

output:

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

result:

ok Perfect :) Use 737 operations

Test #66:

score: 0
Wrong Answer
time: 0ms
memory: 3584kb

input:

4 30 26
11 28 19 26 1 5 20 25 9 30 12 4 15 16 2 17 29 6 10 3 13 7 21 24 23 18 8 27 14 22

output:

-1

result:

wrong answer Jury has the answer but participant has not

Subtask #5:

score: 0
Wrong Answer

Test #71:

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

input:

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

output:

13
0
1
0
1
0
1
0
1
0
1
0
1
0

result:

ok Perfect :) Use 13 operations

Test #72:

score: 15
Accepted
time: 1ms
memory: 3584kb

input:

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

output:

-1

result:

ok No solutions

Test #73:

score: 15
Accepted
time: 1ms
memory: 3584kb

input:

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

output:

-1

result:

ok No solutions

Test #74:

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

input:

5 50 49
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 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17

output:

-1

result:

ok No solutions

Test #75:

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

input:

5 49 49
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:

0

result:

ok Perfect :) Use 0 operations

Test #76:

score: 15
Accepted
time: 1ms
memory: 3584kb

input:

5 49 49
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 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20

output:

-1

result:

ok No solutions

Test #77:

score: 0
Wrong Answer
time: 0ms
memory: 3584kb

input:

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

output:


result:

wrong output format Unexpected end of file - int32 expected

Subtask #6:

score: 0
Wrong Answer

Test #101:

score: 5
Accepted
time: 0ms
memory: 3840kb

input:

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

output:

1
0

result:

ok Perfect :) Use 1 operations

Test #102:

score: 5
Accepted
time: 0ms
memory: 3584kb

input:

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

output:

-1

result:

ok No solutions

Test #103:

score: 5
Accepted
time: 0ms
memory: 3584kb

input:

6 50 50
39 40 41 42 43 44 45 46 47 48 49 50 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

output:

-1

result:

ok No solutions

Test #104:

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

input:

6 49 48
33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 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

output:

32
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1

result:

ok Perfect :) Use 32 operations

Test #105:

score: 5
Accepted
time: 0ms
memory: 3584kb

input:

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

output:

-1

result:

ok No solutions

Test #106:

score: 5
Accepted
time: 0ms
memory: 3840kb

input:

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

output:

2335
0
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
0
1
0
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
2
1
2
1
2
1
2
1...

result:

ok Perfect :) Use 2335 operations

Test #107:

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

input:

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

output:

2337
0
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
0
1
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
0
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1...

result:

ok Perfect :) Use 2337 operations

Test #108:

score: 5
Accepted
time: 0ms
memory: 3840kb

input:

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

output:

2321
0
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
1
0
1
0
1
0
1
0
1
2
1
2
1
2
1
2
1
2
1
2
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0...

result:

ok Perfect :) Use 2321 operations

Test #109:

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

input:

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

output:

-1

result:

ok No solutions

Test #110:

score: 0
Wrong Answer
time: 0ms
memory: 3712kb

input:

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

output:

-1

result:

wrong answer Jury has the answer but participant has not

Subtask #7:

score: 0
Wrong Answer

Test #116:

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

input:

7 200 199
147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 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...

output:

146
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1

result:

ok Perfect :) Use 146 operations

Test #117:

score: 5
Accepted
time: 0ms
memory: 3584kb

input:

7 200 199
36 35 34 33 32 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 200 199 198 197 196 195 194 193 192 191 190 189 188 187 186 185 184 183 182 181 180 179 178 177 176 175 174 173 172 171 170 169 168 167 166 165 164 163 162 161 160 159 158 157 156 155 154 153...

output:

-1

result:

ok No solutions

Test #118:

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

input:

7 199 199
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 10...

output:

0

result:

ok Perfect :) Use 0 operations

Test #119:

score: 5
Accepted
time: 0ms
memory: 3584kb

input:

7 199 199
162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 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:

-1

result:

ok No solutions

Test #120:

score: 0
Wrong Answer
time: 0ms
memory: 3584kb

input:

7 199 197
33 176 185 174 197 172 5 170 97 168 27 166 159 164 137 162 101 160 173 158 83 156 19 154 57 152 123 150 3 148 111 146 141 144 13 142 79 140 55 138 25 136 11 134 91 132 175 130 151 128 9 126 103 124 67 122 157 120 105 118 125 116 65 114 129 112 113 110 139 108 39 106 95 104 17 102 73 100 93...

output:


result:

wrong output format Unexpected end of file - int32 expected

Subtask #8:

score: 0
Wrong Answer

Test #141:

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

input:

8 200 200
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 10...

output:

0

result:

ok Perfect :) Use 0 operations

Test #142:

score: 5
Accepted
time: 0ms
memory: 3584kb

input:

8 200 200
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 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 1...

output:

-1

result:

ok No solutions

Test #143:

score: 5
Accepted
time: 0ms
memory: 3840kb

input:

8 199 198
123 122 121 120 119 118 117 116 115 114 113 112 111 110 109 108 107 106 105 104 103 102 101 100 99 98 97 96 95 94 93 92 91 90 89 88 87 86 85 84 83 82 81 80 79 78 77 76 75 74 73 72 71 70 69 68 67 66 65 64 63 62 61 60 59 58 57 56 55 54 53 52 51 50 49 48 47 46 45 44 43 42 41 40 39 38 37 36 35...

output:

275
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
...

result:

ok Perfect :) Use 275 operations

Test #144:

score: 5
Accepted
time: 0ms
memory: 3584kb

input:

8 199 198
157 10 149 46 127 180 125 190 166 35 85 58 30 39 159 192 187 172 55 79 90 74 164 124 115 106 23 188 37 92 53 28 67 138 179 11 152 196 63 136 193 103 98 142 54 44 57 5 8 31 148 107 112 101 120 176 76 191 113 131 130 51 22 116 95 155 139 14 36 96 119 60 186 169 77 32 173 100 21 88 66 87 177 ...

output:

-1

result:

ok No solutions

Test #145:

score: 5
Accepted
time: 3ms
memory: 3880kb

input:

8 200 198
1 168 27 102 42 21 10 24 87 8 106 62 38 182 170 61 138 80 93 146 100 75 22 3 49 81 95 29 149 53 187 192 199 63 132 71 84 150 85 6 44 5 124 90 151 19 50 152 181 110 41 35 9 156 197 161 129 130 185 125 162 163 131 12 66 16 195 142 171 121 134 140 172 20 174 179 37 166 13 104 107 193 135 94 5...

output:

39590
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
...

result:

ok Perfect :) Use 39590 operations

Test #146:

score: 5
Accepted
time: 5ms
memory: 3916kb

input:

8 200 198
200 83 65 16 31 112 103 142 56 24 143 161 179 128 126 184 58 4 72 21 39 6 2 118 187 22 93 114 174 59 105 7 117 158 109 165 141 37 140 145 42 119 60 181 171 62 96 85 8 68 34 191 66 136 52 1 54 10 152 71 115 101 199 79 57 198 149 26 131 173 120 73 182 124 46 86 159 40 175 91 154 113 61 3 195...

output:

39508
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
...

result:

ok Perfect :) Use 39508 operations

Test #147:

score: 0
Wrong Answer
time: 3ms
memory: 3840kb

input:

8 200 198
101 161 97 57 105 125 191 143 24 131 71 8 56 10 64 142 94 36 119 187 102 117 137 30 196 182 133 26 145 7 83 32 60 164 121 76 4 6 70 141 115 85 35 200 198 139 81 42 193 27 80 47 186 20 112 67 152 55 53 103 130 113 154 18 45 49 39 124 50 40 88 109 22 178 111 41 13 197 118 194 180 17 77 75 17...

output:

-1

result:

wrong answer Jury has the answer but participant has not

Subtask #9:

score: 0
Wrong Answer

Test #156:

score: 0
Wrong Answer
time: 0ms
memory: 3584kb

input:

9 1000 5
211 100 879 298 625 856 443 312 159 430 391 546 577 436 137 720 561 290 847 592 187 120 953 60 979 94 583 700 623 80 627 732 675 24 987 340 221 974 1 816 881 280 495 432 853 212 117 986 667 148 127 664 481 524 725 82 543 906 819 394 581 950 91 866 573 496 251 392 775 730 273 784 511 90 359 ...

output:


result:

wrong output format Unexpected end of file - int32 expected

Subtask #10:

score: 5
Accepted

Test #168:

score: 5
Accepted
time: 4ms
memory: 4440kb

input:

10 1000 4
758 267 63 485 736 202 48 317 86 106 157 637 213 476 900 811 830 915 333 457 665 423 51 881 837 615 228 201 151 69 87 753 312 999 810 483 409 630 790 497 120 838 969 170 3 271 316 365 831 598 801 199 931 200 768 16 357 874 869 481 771 262 508 850 146 67 136 674 670 649 845 621 109 602 150 ...

output:

85326
438
441
444
447
450
453
456
459
462
465
468
471
474
477
480
483
486
489
492
495
498
501
504
507
510
513
516
519
522
525
528
531
534
537
540
543
546
549
552
555
558
561
564
567
570
573
576
579
582
585
588
591
594
597
600
603
606
609
612
615
618
621
624
627
630
633
636
639
642
645
648
651
654
65...

result:

ok Perfect :) Use 85326 operations

Test #169:

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

input:

10 1000 4
326 290 647 848 941 832 911 134 198 884 970 805 644 391 564 317 193 244 217 933 257 826 279 860 405 496 112 950 498 436 547 185 866 144 294 786 164 653 419 711 956 215 565 534 418 481 910 392 629 266 70 56 395 155 342 656 795 879 480 682 523 570 278 8 259 158 397 808 367 937 180 555 91 163...

output:

82574
614
617
620
623
626
629
632
635
638
641
644
647
650
653
656
659
662
665
668
671
674
677
680
683
686
689
692
695
698
701
704
707
710
713
716
719
722
725
728
731
734
737
740
743
746
749
752
755
758
761
764
767
770
773
776
779
782
785
788
791
794
797
800
803
806
809
812
815
818
821
824
827
830
83...

result:

ok Perfect :) Use 82574 operations

Test #170:

score: 5
Accepted
time: 4ms
memory: 4440kb

input:

10 1000 4
301 482 326 645 714 415 956 715 708 128 233 410 586 17 964 611 436 684 860 644 235 159 259 262 899 632 929 652 542 780 636 664 716 176 36 720 173 990 653 690 167 371 260 588 775 821 560 211 375 399 138 203 157 312 754 983 268 152 886 939 299 387 32 822 234 140 304 95 557 448 335 42 187 153...

output:

85085
761
764
767
770
773
776
779
782
785
788
791
794
797
800
803
806
809
812
815
818
821
824
827
830
833
836
839
842
845
848
851
854
857
860
863
866
869
872
875
878
881
884
887
890
893
896
899
902
905
908
911
914
917
920
923
926
929
932
935
938
941
944
947
950
953
956
959
962
965
968
971
974
977
98...

result:

ok Perfect :) Use 85085 operations

Test #171:

score: 5
Accepted
time: 0ms
memory: 4440kb

input:

10 1000 4
522 507 45 981 381 774 205 675 124 86 951 496 874 77 648 382 73 977 198 435 742 352 884 519 739 427 634 249 391 601 252 700 615 173 673 359 948 339 513 204 116 676 518 81 72 353 971 866 279 516 414 902 377 878 726 489 738 139 184 935 786 358 821 921 8 931 152 422 21 708 603 988 668 350 298...

output:

-1

result:

ok No solutions

Test #172:

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

input:

10 4 4
1 2 3 4

output:

0

result:

ok Perfect :) Use 0 operations

Test #173:

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

input:

10 4 4
2 1 4 3

output:

-1

result:

ok No solutions

Test #174:

score: 5
Accepted
time: 0ms
memory: 3840kb

input:

10 5 4
2 1 5 4 3

output:

3
0
1
0

result:

ok Perfect :) Use 3 operations

Test #175:

score: 5
Accepted
time: 0ms
memory: 3584kb

input:

10 5 4
5 4 1 3 2

output:

-1

result:

ok No solutions

Subtask #11:

score: 0
Wrong Answer

Test #176:

score: 0
Wrong Answer
time: 1ms
memory: 3584kb

input:

11 1000 7
975 294 573 546 575 370 471 988 77 438 155 162 877 176 441 260 189 178 381 936 495 106 405 854 739 674 395 332 627 628 605 1000 1 422 485 594 879 882 849 620 265 424 55 500 149 378 47 708 137 410 775 44 283 112 823 70 499 64 397 606 793 190 753 752 545 580 651 206 963 730 815 968 263 698 6...

output:


result:

wrong output format Unexpected end of file - int32 expected

Subtask #12:

score: 5
Accepted

Test #187:

score: 5
Accepted
time: 3ms
memory: 3924kb

input:

12 1000 6
416 514 385 469 20 211 283 558 116 425 351 927 713 189 649 827 54 441 327 759 273 466 971 829 108 738 200 21 557 577 266 541 507 115 480 646 673 179 820 430 84 458 249 869 676 127 482 80 606 545 639 919 974 826 718 783 741 775 549 693 202 477 291 528 48 366 137 483 95 350 709 966 55 312 62...

output:

51749
750
755
760
765
770
775
780
785
790
795
800
805
810
815
820
825
830
835
840
845
850
855
860
865
870
875
880
885
890
895
900
905
910
915
920
925
930
935
940
945
950
955
960
965
970
975
980
985
990
992
994
384
389
394
399
404
409
414
419
424
429
434
439
444
449
454
459
464
469
474
479
484
489
49...

result:

ok Perfect :) Use 51749 operations

Test #188:

score: 5
Accepted
time: 3ms
memory: 4048kb

input:

12 1000 6
734 154 614 856 690 198 413 666 220 327 148 920 553 585 757 76 923 789 365 901 622 228 290 202 471 990 718 877 598 579 644 507 552 941 694 917 714 781 752 112 187 545 616 586 92 85 30 99 813 4 372 440 653 277 539 207 760 584 115 637 822 692 688 919 98 709 563 825 143 73 809 863 939 516 84 ...

output:

50546
732
737
742
747
752
757
762
767
772
777
782
787
792
797
802
807
812
817
822
827
832
837
842
847
852
857
862
867
872
877
882
887
892
897
902
907
912
917
922
927
932
937
942
947
952
957
962
967
972
977
982
987
992
993
994
264
269
274
279
284
289
294
299
304
309
314
319
324
329
334
339
344
349
35...

result:

ok Perfect :) Use 50546 operations

Test #189:

score: 5
Accepted
time: 3ms
memory: 4052kb

input:

12 1000 6
426 451 150 843 860 130 729 178 669 279 458 306 620 198 795 955 549 937 31 650 469 464 770 651 632 4 309 247 367 151 143 259 529 177 944 644 226 498 483 423 515 390 865 850 358 264 437 420 386 879 919 723 667 411 856 302 435 343 193 452 11 739 161 338 698 783 637 675 106 965 55 666 305 821...

output:

53113
604
609
614
619
624
629
634
639
644
649
654
659
664
669
674
679
684
689
694
699
704
709
714
719
724
729
734
739
744
749
754
759
764
769
774
779
784
789
794
799
804
809
814
819
824
829
834
839
844
849
854
859
864
869
874
879
884
889
894
899
904
909
914
919
924
929
934
939
944
949
954
959
964
96...

result:

ok Perfect :) Use 53113 operations

Test #190:

score: 5
Accepted
time: 3ms
memory: 4052kb

input:

12 1000 8
916 106 622 283 77 349 76 65 701 14 634 16 659 71 567 371 367 417 857 83 629 161 932 882 657 524 931 997 995 970 22 893 449 59 1000 234 291 752 725 357 420 262 191 458 503 869 552 419 463 81 590 672 744 573 15 868 218 422 435 442 176 624 545 326 913 816 751 612 688 181 687 397 302 241 471 ...

output:

38403
34
41
48
55
62
69
76
83
90
97
104
111
118
125
132
139
146
153
160
167
174
181
188
195
202
209
216
223
230
237
244
251
258
265
272
279
286
293
300
307
314
321
328
335
342
349
356
363
370
377
384
391
398
405
412
419
426
433
440
447
454
461
468
475
482
489
496
503
510
517
524
531
538
545
552
559
...

result:

ok Perfect :) Use 38403 operations

Test #191:

score: 5
Accepted
time: 3ms
memory: 4052kb

input:

12 1000 8
842 480 888 935 207 901 669 311 841 401 223 192 971 569 974 215 235 353 33 758 609 161 188 655 495 885 153 983 571 409 403 825 39 283 894 87 934 640 709 304 313 258 159 976 183 7 603 838 742 432 565 367 689 543 262 4 793 895 796 992 826 998 173 531 456 93 898 662 127 653 116 729 402 479 63...

output:

38624
910
917
924
931
938
945
952
959
966
973
980
987
992
991
992
508
515
522
529
536
543
550
557
564
571
578
585
592
599
606
613
620
627
634
641
648
655
662
669
676
683
690
697
704
711
718
725
732
739
746
753
760
767
774
781
788
795
802
809
816
823
830
837
844
851
858
865
872
879
886
893
900
907
91...

result:

ok Perfect :) Use 38624 operations

Test #192:

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

input:

12 1000 8
351 377 405 356 716 720 634 526 665 700 908 999 538 207 549 936 896 288 102 311 739 27 474 550 63 632 913 162 448 950 360 241 193 561 208 942 229 673 198 308 582 461 399 143 839 838 96 158 342 837 614 46 189 476 275 643 323 728 762 455 258 491 359 519 857 99 927 132 103 510 61 684 251 797 ...

output:

38239
563
570
577
584
591
598
605
612
619
626
633
640
647
654
661
668
675
682
689
696
703
710
717
724
731
738
745
752
759
766
773
780
787
794
801
808
815
822
829
836
843
850
857
864
871
878
885
892
899
906
913
920
927
934
941
948
955
962
969
976
983
990
991
992
11
18
25
32
39
46
53
60
67
74
81
88
95...

result:

ok Perfect :) Use 38239 operations

Test #193:

score: 5
Accepted
time: 0ms
memory: 3840kb

input:

12 1000 8
803 115 31 95 772 296 615 417 636 380 712 255 238 470 257 552 874 212 377 679 909 520 484 30 513 651 383 414 546 34 532 983 865 645 861 888 80 830 607 824 821 200 521 141 381 67 114 91 516 130 625 476 419 630 860 641 896 397 775 757 613 314 624 317 43 20 391 109 895 911 56 469 64 272 171 1...

output:

-1

result:

ok No solutions

Test #194:

score: 5
Accepted
time: 0ms
memory: 3840kb

input:

12 7 6
1 7 6 5 4 3 2

output:

13
0
1
0
1
0
1
0
1
0
1
0
1
0

result:

ok Perfect :) Use 13 operations

Test #195:

score: 5
Accepted
time: 0ms
memory: 3584kb

input:

12 7 6
4 5 7 6 3 2 1

output:

-1

result:

ok No solutions

Test #196:

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

input:

12 8 8
1 2 3 4 5 6 7 8

output:

0

result:

ok Perfect :) Use 0 operations

Test #197:

score: 5
Accepted
time: 0ms
memory: 3584kb

input:

12 8 8
1 3 8 2 7 6 5 4

output:

-1

result:

ok No solutions

Test #198:

score: 5
Accepted
time: 0ms
memory: 3584kb

input:

12 8 8
6 7 8 1 2 3 4 5

output:

-1

result:

ok No solutions

Test #199:

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

input:

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

output:

7
0
1
0
1
0
1
0

result:

ok Perfect :) Use 7 operations

Test #200:

score: 5
Accepted
time: 0ms
memory: 3584kb

input:

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

output:

-1

result:

ok No solutions

Subtask #13:

score: 0
Wrong Answer

Test #201:

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

input:

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

output:

7
0
1
0
1
0
1
0

result:

ok Perfect :) Use 7 operations

Test #202:

score: 5
Accepted
time: 0ms
memory: 3584kb

input:

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

output:

-1

result:

ok No solutions

Test #203:

score: 5
Accepted
time: 0ms
memory: 3584kb

input:

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

output:

-1

result:

ok No solutions

Test #204:

score: 5
Accepted
time: 0ms
memory: 3584kb

input:

13 60 59
44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 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

output:

-1

result:

ok No solutions

Test #205:

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

input:

13 59 59
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

output:

0

result:

ok Perfect :) Use 0 operations

Test #206:

score: 5
Accepted
time: 0ms
memory: 3584kb

input:

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

output:

-1

result:

ok No solutions

Test #207:

score: 0
Wrong Answer
time: 0ms
memory: 3584kb

input:

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

output:


result:

wrong output format Unexpected end of file - int32 expected

Subtask #14:

score: 0
Wrong Answer

Test #231:

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

input:

14 60 60
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

output:

0

result:

ok Perfect :) Use 0 operations

Test #232:

score: 5
Accepted
time: 0ms
memory: 3584kb

input:

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

output:

-1

result:

ok No solutions

Test #233:

score: 5
Accepted
time: 0ms
memory: 3584kb

input:

14 60 60
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 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

output:

-1

result:

ok No solutions

Test #234:

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

input:

14 51 50
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 1 2 3 4 5 6 7 8 9 10 11

output:

62
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1

result:

ok Perfect :) Use 62 operations

Test #235:

score: 5
Accepted
time: 0ms
memory: 3584kb

input:

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

output:

-1

result:

ok No solutions

Test #236:

score: 5
Accepted
time: 0ms
memory: 4096kb

input:

14 1000 40
783 688 933 732 144 245 668 115 364 678 148 794 8 177 728 420 371 932 686 184 292 964 600 322 851 96 617 816 707 586 248 434 409 951 736 878 801 610 655 185 698 882 632 38 961 929 145 557 111 826 679 923 441 508 760 135 827 888 568 392 917 898 429 881 190 76 21 706 298 995 459 391 841 393...

output:

10272
960
943
960
656
695
734
773
812
851
890
929
944
959
80
119
158
197
236
275
314
353
392
431
470
509
548
587
626
665
704
743
782
821
860
899
938
948
958
608
647
686
725
764
803
842
881
920
957
956
957
870
909
948
952
956
69
108
147
186
225
264
303
342
381
420
459
498
537
576
615
654
693
732
771
...

result:

ok Perfect :) Use 10272 operations

Test #237:

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

input:

14 1000 40
961 148 697 548 723 281 69 994 509 747 940 972 75 67 718 244 498 347 655 230 367 778 263 814 390 966 331 549 652 565 714 800 475 786 679 146 627 305 233 346 459 896 128 61 414 867 98 792 561 427 647 99 587 532 950 537 71 877 928 803 422 64 791 591 380 10 408 990 318 428 711 462 80 155 854...

output:

10209
941
960
287
326
365
404
443
482
521
560
599
638
677
716
755
794
833
872
911
950
959
944
959
768
807
846
885
924
941
958
655
694
733
772
811
850
889
928
957
952
957
475
514
553
592
631
670
709
748
787
826
865
904
943
956
943
956
905
944
955
941
955
7
46
85
124
163
202
241
280
319
358
397
436
47...

result:

ok Perfect :) Use 10209 operations

Test #238:

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

input:

14 1000 40
946 990 315 83 929 424 408 311 14 475 222 298 593 514 785 381 634 774 135 137 672 130 606 885 416 467 375 217 28 473 260 723 983 886 267 487 846 607 233 692 890 728 429 297 154 515 894 664 994 795 64 619 680 997 845 597 502 391 992 855 751 410 482 301 834 683 258 342 39 283 145 231 507 78...

output:

10144
330
369
408
447
486
525
564
603
642
681
720
759
798
837
876
915
954
957
960
142
181
220
259
298
337
376
415
454
493
532
571
610
649
688
727
766
805
844
883
922
959
958
959
396
435
474
513
552
591
630
669
708
747
786
825
864
903
942
950
958
53
92
131
170
209
248
287
326
365
404
443
482
521
560
...

result:

ok Perfect :) Use 10144 operations

Test #239:

score: 5
Accepted
time: 0ms
memory: 3840kb

input:

14 1000 40
913 244 275 607 284 817 824 214 353 141 625 802 881 697 155 420 37 192 995 623 733 171 188 949 667 763 572 265 478 140 95 870 43 925 145 696 213 477 78 102 957 229 314 655 601 172 699 466 598 739 707 113 785 742 227 20 895 223 389 216 6 337 600 720 276 196 272 780 132 212 683 703 334 520 ...

output:

-1

result:

ok No solutions

Test #240:

score: 0
Wrong Answer
time: 1ms
memory: 3840kb

input:

14 1000 42
160 546 484 3 416 842 854 37 710 184 763 485 548 808 825 871 611 806 626 676 161 458 582 166 453 903 142 383 123 57 147 923 523 149 165 220 911 73 812 431 441 405 820 325 984 478 875 870 704 248 851 53 545 739 630 578 653 801 212 703 652 270 968 284 259 207 401 796 83 705 902 561 282 118 ...

output:

-1

result:

wrong answer Jury has the answer but participant has not

Subtask #15:

score: 0
Wrong Answer

Test #246:

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

input:

15 1000 999
419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 ...

output:

418
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
...

result:

ok Perfect :) Use 418 operations

Test #247:

score: 15
Accepted
time: 1ms
memory: 3584kb

input:

15 1000 999
463 334 963 680 867 710 343 40 177 562 657 468 255 652 481 498 669 88 443 864 701 378 277 106 203 240 643 452 257 750 173 384 131 22 243 550 709 904 563 476 827 274 441 308 917 136 381 716 771 206 425 222 31 178 191 34 219 950 711 854 999 968 467 616 199 302 39 988 887 702 387 952 49 320...

output:

-1

result:

ok No solutions

Test #248:

score: 15
Accepted
time: 1ms
memory: 3584kb

input:

15 1000 999
1000 999 998 997 996 995 994 993 992 991 990 989 988 987 986 985 984 983 982 981 980 979 978 977 976 975 974 973 972 971 970 969 968 967 966 965 964 963 962 961 960 959 958 957 956 955 954 953 952 951 950 949 948 947 946 945 944 943 942 941 940 939 938 937 936 935 934 933 932 931 930 929...

output:

-1

result:

ok No solutions

Test #249:

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

input:

15 1000 999
446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 ...

output:

-1

result:

ok No solutions

Test #250:

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

input:

15 999 999
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:

0

result:

ok Perfect :) Use 0 operations

Test #251:

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

input:

15 999 999
761 760 759 758 757 756 755 754 753 752 751 750 749 748 747 746 745 744 743 742 741 740 739 738 737 736 735 734 733 732 731 730 729 728 727 726 725 724 723 722 721 720 719 718 717 716 715 714 713 712 711 710 709 708 707 706 705 704 703 702 701 700 699 698 697 696 695 694 693 692 691 690 6...

output:

-1

result:

ok No solutions

Test #252:

score: 0
Wrong Answer
time: 0ms
memory: 3584kb

input:

15 999 997
73 92 445 94 575 96 907 98 137 100 849 102 507 104 191 106 905 108 951 110 927 112 609 114 647 116 595 118 249 120 99 122 305 124 145 126 277 128 51 130 845 132 409 134 319 136 161 138 577 140 993 142 141 144 459 146 245 148 695 150 751 152 219 154 523 156 175 158 639 160 55 162 593 164 2...

output:


result:

wrong output format Unexpected end of file - int32 expected

Subtask #16:

score: 0
Wrong Answer

Test #281:

score: 5
Accepted
time: 0ms
memory: 3840kb

input:

16 1000 1000
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:

0

result:

ok Perfect :) Use 0 operations

Test #282:

score: 5
Accepted
time: 0ms
memory: 3584kb

input:

16 1000 1000
913 227 730 357 862 645 631 393 32 331 181 324 798 469 402 999 936 158 385 956 419 430 46 592 550 655 841 221 541 664 109 334 440 270 502 740 888 177 501 537 72 311 243 382 284 836 488 498 113 995 81 770 720 345 949 37 709 49 235 274 659 84 695 948 234 471 288 604 877 554 678 468 517 54...

output:

-1

result:

ok No solutions

Test #283:

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

input:

16 1000 1000
92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165...

output:

-1

result:

ok No solutions

Test #284:

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

input:

16 999 998
874 873 872 871 870 869 868 867 866 865 864 863 862 861 860 859 858 857 856 855 854 853 852 851 850 849 848 847 846 845 844 843 842 841 840 839 838 837 836 835 834 833 832 831 830 829 828 827 826 825 824 823 822 821 820 819 818 817 816 815 814 813 812 811 810 809 808 807 806 805 804 803 8...

output:

125
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0

result:

ok Perfect :) Use 125 operations

Test #285:

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

input:

16 999 998
461 792 701 275 902 634 949 637 39 689 476 260 276 875 438 698 311 496 410 682 432 173 818 399 943 160 364 961 560 150 929 891 301 958 271 129 995 318 359 354 148 539 17 705 741 986 337 839 926 174 908 11 238 938 373 869 817 652 225 255 816 683 376 973 942 380 773 602 437 145 716 205 166 ...

output:

-1

result:

ok No solutions

Test #286:

score: 0
Wrong Answer
time: 294ms
memory: 13652kb

input:

16 1000 998
521 479 831 13 657 827 236 789 544 458 169 130 548 160 549 88 156 865 626 440 678 312 722 138 116 283 513 897 473 676 615 19 991 745 898 313 54 737 431 137 580 887 997 171 294 983 528 778 339 396 864 319 393 495 131 23 465 602 717 32 640 181 679 646 65 173 427 163 956 814 982 762 43 613 ...

output:

-1

result:

wrong answer Jury has the answer but participant has not