QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#598867#2143. Railroad sortingLuSter_MAC ✓9ms3888kbC++201.5kb2024-09-28 23:47:082024-09-28 23:47:08

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

input:

5
3 1 5 2 4

output:

1
1
-1
1
1
-1
12
-1
1
-1
-2

result:

ok 11 steps

Test #2:

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

input:

1
1

output:

1
-1

result:

ok 2 steps

Test #3:

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

input:

2
1 2

output:

1
-1
1
-1

result:

ok 4 steps

Test #4:

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

input:

2
2 1

output:

1
1
-1
-1

result:

ok 4 steps

Test #5:

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

input:

3
1 2 3

output:

1
-1
1
-1
1
-1

result:

ok 6 steps

Test #6:

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

input:

3
1 3 2

output:

1
-1
1
1
-1
-1

result:

ok 6 steps

Test #7:

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

input:

3
2 1 3

output:

1
1
-1
-1
1
-1

result:

ok 6 steps

Test #8:

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

input:

3
2 3 1

output:

1
1
1
-1
12
-1
-2

result:

ok 7 steps

Test #9:

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

input:

3
3 1 2

output:

1
1
-1
1
-1
-1

result:

ok 6 steps

Test #10:

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

input:

3
3 2 1

output:

1
1
1
-1
-1
-1

result:

ok 6 steps

Test #11:

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

input:

10
1 2 3 4 5 6 7 8 9 10

output:

1
-1
1
-1
1
-1
1
-1
1
-1
1
-1
1
-1
1
-1
1
-1
1
-1

result:

ok 20 steps

Test #12:

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

input:

10
10 9 8 7 6 5 4 3 2 1

output:

1
1
1
1
1
1
1
1
1
1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1

result:

ok 20 steps

Test #13:

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

input:

10
1 10 2 9 3 8 4 7 5 6

output:

1
-1
1
1
-1
1
1
-1
1
1
-1
1
1
-1
1
-1
-1
-1
-1
-1

result:

ok 20 steps

Test #14:

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

input:

10
2 4 6 8 10 9 7 5 3 1

output:

1
1
1
1
1
1
1
1
1
1
-1
12
12
12
12
12
12
12
12
-1
21
21
21
21
21
21
21
-2
12
12
12
12
12
12
-1
21
21
21
21
21
-2
12
12
12
12
-1
21
21
21
-2
12
12
-1
21
-2
-1

result:

ok 56 steps

Test #15:

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

input:

10
3 9 8 5 7 4 1 2 10 6

output:

1
1
1
1
1
1
1
-1
1
-1
12
12
12
12
12
-1
21
21
21
21
-2
12
-1
1
1
-1
-2
12
-1
-1
-2

result:

ok 31 steps

Test #16:

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

input:

10
7 8 2 5 9 6 1 10 4 3

output:

1
1
1
1
1
1
1
-1
12
12
12
-1
1
1
1
-1
-1
-2
21
-2
12
12
12
-1
-2
21
-2
-1

result:

ok 28 steps

Test #17:

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

input:

10
3 7 5 8 10 4 6 2 9 1

output:

1
1
1
1
1
1
1
1
1
1
-1
12
-1
12
12
12
12
12
12
-1
21
21
21
21
-2
12
12
-1
21
21
-2
12
12
-1
-2
21
-2
-1

result:

ok 38 steps

Test #18:

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

input:

73
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

output:

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

result:

ok 146 steps

Test #19:

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

input:

73
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 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
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
-...

result:

ok 146 steps

Test #20:

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

input:

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

output:

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

result:

ok 146 steps

Test #21:

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

input:

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

output:

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
12
12
12
12
12
12
12
12
12
12
12
12
12
12
12
12
12
12
12
12
12
12
12
12
12
12
12
12
12
12
12
12
12
12
12
12
12
12
12
12
12
12
12
12
12
12
12
12
12
1...

result:

ok 2631 steps

Test #22:

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

input:

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

output:

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
12
12
12
12
12
12
12
12
12
12
12
12
12
12
12
12
12
12
12
12
12
12
12
-1
1
1
1
1
1
1
-1
21
21
21
21
21
21
21
21
21
21
-2
12
12
12
12
12
12
-1
12
12
12
12
12
12
12
12
12
12
12
-1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
-1
2...

result:

ok 701 steps

Test #23:

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

input:

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

output:

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
12
12
12
12
12
12
12
12
12
12
12
12
12
12
12
12
12
12
12
12
12
12
12
12
12
-1
21
-2
12
12
12
12
-1
21
21
21
21
21
21
21
21
21
21
21
-2
12
12
12
12
12
12
12
...

result:

ok 778 steps

Test #24:

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

input:

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

output:

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
12
12
12
12
12
12
12
12
12
12
12
12
12
12
12
12
12
12
12
12
12
12
12
12
12
12
12
12
12
12
12
12
12
12
12
12
12
12
12
12
12
12
12
12
12
12
12
12
12
-1
12
12
12
12
-1
21
21
21
21
...

result:

ok 730 steps

Test #25:

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

input:

239
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 101 ...

output:

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

result:

ok 478 steps

Test #26:

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

input:

239
239 238 237 236 235 234 233 232 231 230 229 228 227 226 225 224 223 222 221 220 219 218 217 216 215 214 213 212 211 210 209 208 207 206 205 204 203 202 201 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 ...

output:

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

result:

ok 478 steps

Test #27:

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

input:

239
1 239 2 238 3 237 4 236 5 235 6 234 7 233 8 232 9 231 10 230 11 229 12 228 13 227 14 226 15 225 16 224 17 223 18 222 19 221 20 220 21 219 22 218 23 217 24 216 25 215 26 214 27 213 28 212 29 211 30 210 31 209 32 208 33 207 34 206 35 205 36 204 37 203 38 202 39 201 40 200 41 199 42 198 43 197 44 1...

output:

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

result:

ok 478 steps

Test #28:

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

input:

239
1 3 5 7 9 11 13 15 17 19 21 23 25 27 29 31 33 35 37 39 41 43 45 47 49 51 53 55 57 59 61 63 65 67 69 71 73 75 77 79 81 83 85 87 89 91 93 95 97 99 101 103 105 107 109 111 113 115 117 119 121 123 125 127 129 131 133 135 137 139 141 143 145 147 149 151 153 155 157 159 161 163 165 167 169 171 173 175...

output:

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

result:

ok 28444 steps

Test #29:

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

input:

239
64 85 148 52 182 174 96 100 213 162 2 71 60 201 9 99 184 118 228 49 50 216 208 8 210 38 183 190 204 234 53 21 45 219 124 134 157 180 16 116 101 105 93 176 41 140 221 5 55 48 145 161 164 169 185 70 230 136 165 72 178 236 83 127 166 120 104 160 112 97 163 4 33 87 47 13 232 200 159 154 10 177 212 1...

output:

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
12
12
12
12
12
12
12
12
12
12
12
12
12
12
12
12
12
12
12
12
12
12...

result:

ok 9402 steps

Test #30:

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

input:

239
224 84 121 89 222 105 60 2 122 52 142 221 116 205 88 86 21 34 42 55 158 75 37 171 218 18 19 64 235 124 47 30 10 44 95 225 190 175 162 123 188 220 97 1 149 229 143 172 202 185 46 22 59 56 206 167 27 174 66 41 92 17 39 20 189 114 106 57 112 141 191 208 210 102 51 215 170 74 165 198 16 72 133 233 2...

output:

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
12
12
12
12
12
12
12
12
12
12
12
12
12
12
12
12
12
12
12
12
12
12
12
12
12
12
12
12
12
12
12
12
12
12
12
-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...

result:

ok 10144 steps

Test #31:

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

input:

239
26 206 53 21 211 223 235 85 205 180 77 22 82 126 81 116 1 194 183 109 63 49 28 86 31 12 13 220 200 76 155 130 99 178 163 237 2 50 150 236 189 56 39 95 9 11 125 166 231 185 146 221 78 225 48 212 160 29 209 135 66 215 175 190 133 219 64 44 153 57 137 121 10 88 91 36 218 43 35 128 87 164 174 234 41...

output:

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

result:

ok 9145 steps

Test #32:

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

input:

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 100 101...

output:

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

result:

ok 2000 steps

Test #33:

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

input:

1000
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 928 92...

output:

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

result:

ok 2000 steps

Test #34:

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

input:

1000
1 1000 2 999 3 998 4 997 5 996 6 995 7 994 8 993 9 992 10 991 11 990 12 989 13 988 14 987 15 986 16 985 17 984 18 983 19 982 20 981 21 980 22 979 23 978 24 977 25 976 26 975 27 974 28 973 29 972 30 971 31 970 32 969 33 968 34 967 35 966 36 965 37 964 38 963 39 962 40 961 41 960 42 959 43 958 44...

output:

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

result:

ok 2000 steps

Test #35:

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

input:

1000
2 4 6 8 10 12 14 16 18 20 22 24 26 28 30 32 34 36 38 40 42 44 46 48 50 52 54 56 58 60 62 64 66 68 70 72 74 76 78 80 82 84 86 88 90 92 94 96 98 100 102 104 106 108 110 112 114 116 118 120 122 124 126 128 130 132 134 136 138 140 142 144 146 148 150 152 154 156 158 160 162 164 166 168 170 172 174 ...

output:

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

result:

ok 500501 steps

Test #36:

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

input:

1000
74 199 928 305 878 917 814 165 410 550 767 477 262 807 559 92 406 845 986 934 82 235 281 695 192 622 778 26 53 428 722 108 243 319 646 400 280 249 495 109 881 96 867 758 504 35 887 276 874 466 658 904 512 897 998 312 733 193 739 783 681 716 291 212 626 629 268 811 990 792 394 316 483 14 548 747...

output:

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

result:

ok 156379 steps

Test #37:

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

input:

1000
609 925 795 348 776 946 875 990 556 771 107 152 170 238 498 836 222 649 220 390 865 527 681 38 688 164 789 712 11 106 765 965 756 569 561 334 998 453 282 383 535 229 186 738 333 608 201 686 910 613 880 642 975 331 991 904 265 249 525 67 132 467 374 674 995 362 512 460 120 841 713 126 740 156 51...

output:

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

result:

ok 167631 steps

Test #38:

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

input:

1000
453 420 824 229 604 588 326 2 242 293 134 990 444 937 614 273 166 767 319 498 840 57 963 522 449 912 217 160 900 796 754 868 139 366 456 850 737 707 96 105 911 203 764 421 814 999 20 644 63 731 253 353 726 839 821 497 556 662 83 51 886 157 359 519 364 325 98 336 676 212 7 928 118 709 383 518 51...

output:

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

result:

ok 164695 steps