QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#104056#6339. CookiesBeyondHeaven63 6ms10844kbC++171.9kb2023-05-08 13:57:002023-05-08 13:57:04

詳細信息

Subtask #1:

score: 6
Accepted

Test #1:

score: 6
Accepted
time: 2ms
memory: 3360kb

input:

1
1
1
1

output:

1
1 1 

result:

ok good!

Test #2:

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

input:

2
1 1
1
1

output:

2
1 1 
1 2 

result:

ok good!

Test #3:

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

input:

2
1 1
1
2

output:

1
2 2 1 

result:

ok good!

Test #4:

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

input:

2
1 1
2
1 2

output:

1
2 2 1 

result:

ok good!

Test #5:

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

input:

4
1 1 1 1
2
2 3

output:

2
2 3 1 
2 4 2 

result:

ok good!

Test #6:

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

input:

8
1 1 1 1 1 1 1 1
3
1 4 5

output:

2
4 7 5 3 1 
4 8 6 4 2 

result:

ok good!

Test #7:

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

input:

500
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 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:

500
1 329 
1 344 
1 343 
1 342 
1 341 
1 340 
1 339 
1 338 
1 337 
1 336 
1 335 
1 334 
1 333 
1 332 
1 331 
1 330 
1 345 
1 328 
1 327 
1 326 
1 325 
1 324 
1 323 
1 322 
1 321 
1 320 
1 319 
1 318 
1 317 
1 316 
1 315 
1 314 
1 360 
1 375 
1 374 
1 373 
1 372 
1 371 
1 370 
1 369 
1 368 
1 367 
1 ...

result:

ok good!

Test #8:

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

input:

500
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 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:

1
500 158 159 160 161 162 163 164 165 166 167 168 169 170 171 1 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 172 127 128 129 130 131 132 133 134 135 136 137 138 139 140 157 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 141 221 222 223 224 225 226 227 228 229 230 231 232 ...

result:

ok good!

Test #9:

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

input:

500
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 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:

2
250 159 161 163 165 167 169 171 173 175 177 179 181 183 185 187 127 129 131 133 135 137 139 157 143 145 147 149 151 153 155 141 222 224 226 228 230 232 234 236 238 240 242 244 246 248 250 189 191 193 195 197 199 201 203 205 207 209 211 213 215 217 219 33 35 37 39 41 43 45 126 49 51 53 55 57 59 61 ...

result:

ok good!

Test #10:

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

input:

500
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 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:

-1

result:

ok no solution

Test #11:

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

input:

500
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 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:

11
45 173 184 133 144 155 229 240 235 199 210 33 44 55 4 15 26 100 111 122 70 81 92 415 426 437 386 397 471 482 493 441 452 463 286 376 308 257 268 279 353 364 375 323 334 329 
45 1 183 132 143 154 228 239 250 198 209 204 43 54 3 14 25 99 63 121 69 80 91 414 425 436 385 396 391 481 492 440 451 462 2...

result:

ok good!

Test #12:

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

input:

500
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 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:

250
2 79 329 
2 94 344 
2 93 343 
2 92 342 
2 91 341 
2 90 340 
2 89 339 
2 88 338 
2 87 337 
2 86 336 
2 85 335 
2 84 334 
2 83 333 
2 82 332 
2 81 331 
2 80 330 
2 95 345 
2 78 328 
2 77 327 
2 76 326 
2 75 325 
2 74 324 
2 73 323 
2 72 322 
2 71 321 
2 70 320 
2 69 319 
2 68 318 
2 67 317 
2 66 3...

result:

ok good!

Test #13:

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

input:

484
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 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:

22
22 174 136 219 241 202 42 4 26 109 70 76 416 378 461 483 444 284 246 268 351 312 318 
22 173 135 218 240 201 41 3 25 108 69 91 415 377 460 482 443 283 245 267 350 311 333 
22 172 134 217 239 200 40 2 24 61 68 90 414 376 459 481 442 282 244 266 303 310 332 
22 171 133 216 238 199 39 46 23 106 67 8...

result:

ok good!

Test #14:

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

input:

495
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 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:

55
9 150 204 12 67 431 486 293 348 325 
9 149 203 11 66 430 485 292 347 340 
9 148 202 10 65 429 484 291 346 339 
9 147 217 9 64 428 483 290 345 338 
9 146 200 8 109 427 482 289 344 337 
9 145 199 7 124 426 481 288 343 336 
9 144 198 6 123 425 434 287 342 335 
9 143 197 5 122 424 479 286 263 334 
9 ...

result:

ok good!

Test #15:

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

input:

500
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 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:

4
125 161 165 169 173 177 181 185 127 131 135 139 143 147 151 155 222 226 230 234 238 242 246 250 191 195 199 203 207 211 215 219 35 39 43 126 51 55 59 47 5 9 13 17 21 25 29 96 100 104 108 112 116 120 124 65 69 73 77 81 85 89 93 409 413 417 421 425 429 433 437 379 383 387 407 395 399 403 391 474 478...

result:

ok good!

Test #16:

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

input:

499
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 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:

27
17 224 189 216 56 21 111 75 413 378 405 495 459 298 263 353 317 328 
17 223 234 215 55 20 63 74 412 377 404 494 458 297 262 352 316 343 
17 222 249 214 54 19 109 73 411 376 403 493 457 375 261 351 315 342 
17 221 248 213 53 18 108 72 410 421 402 492 456 295 260 350 314 341 
17 220 247 212 52 17 1...

result:

ok good!

Test #17:

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

input:

499
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 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:

19
17 104 123 95 409 428 385 404 486 442 461 292 311 268 350 369 325 328 
23 243 199 217 48 4 22 103 122 78 408 427 384 403 485 441 460 291 310 267 349 368 324 343 
27 174 129 146 225 242 198 216 126 3 21 102 121 77 407 426 383 402 437 440 459 290 309 266 348 367 323 342 
27 173 128 145 224 241 197 ...

result:

ok good!

Test #18:

score: 0
Accepted
time: 4ms
memory: 7944kb

input:

499
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 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:

7
64 153 222 229 236 243 234 195 202 209 216 36 43 50 57 2 9 32 23 30 100 107 114 121 65 72 95 86 93 411 418 425 432 377 384 391 398 405 475 482 489 496 440 447 454 461 468 287 294 301 308 253 260 267 274 265 351 358 365 372 316 323 330 337 328 
64 152 221 228 235 242 249 194 201 208 215 35 42 49 56...

result:

ok good!

Test #19:

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

input:

499
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 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:

4
56 436 378 382 386 406 394 398 402 390 473 477 481 485 489 493 497 438 442 446 450 454 458 462 466 282 286 290 294 298 302 306 310 252 256 260 264 268 272 276 280 347 351 355 312 363 367 371 359 316 320 324 344 332 336 340 328 
56 435 377 381 385 389 393 397 401 405 472 476 480 437 488 492 496 484...

result:

ok good!

Test #20:

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

input:

499
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 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:

2
213 232 188 236 238 240 242 244 246 248 234 190 192 194 196 198 200 202 204 206 208 210 212 214 216 218 33 35 37 39 41 43 45 126 49 51 53 55 57 59 61 47 3 5 7 9 11 13 15 17 19 21 23 25 27 29 31 96 98 100 102 104 106 108 63 112 114 116 118 120 122 124 110 65 67 69 71 73 75 77 95 81 83 85 87 89 91 9...

result:

ok good!

Test #21:

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

input:

499
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 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:

-1

result:

ok no solution

Test #22:

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

input:

499
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 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:

-1

result:

ok no solution

Test #23:

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

input:

493
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 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:

17
18 113 68 85 411 428 384 401 479 434 451 283 300 255 272 351 368 323 324 
18 112 67 84 410 427 383 400 432 433 450 282 299 254 271 350 367 322 339 
18 111 66 83 409 426 382 399 477 478 449 281 298 253 270 349 366 321 338 
18 110 65 82 408 425 381 398 476 493 448 280 297 252 269 348 365 320 337 
1...

result:

ok good!

Test #24:

score: 0
Accepted
time: 6ms
memory: 8500kb

input:

493
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 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:

17
18 113 68 85 411 428 384 401 479 434 451 283 300 255 272 351 368 323 324 
18 112 67 84 410 427 383 400 432 433 450 282 299 254 271 350 367 322 339 
18 111 66 83 409 426 382 399 477 478 449 281 298 253 270 349 366 321 338 
18 110 65 82 408 425 381 398 476 493 448 280 297 252 269 348 365 320 337 
1...

result:

ok good!

Test #25:

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

input:

493
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 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:

17
16 85 411 428 384 401 479 434 451 283 300 255 272 351 368 323 324 
16 84 410 427 383 400 432 433 450 282 299 254 271 350 367 322 339 
16 83 409 426 382 399 477 478 449 281 298 253 270 349 366 321 338 
16 82 408 425 381 398 476 493 448 280 297 252 269 348 365 320 337 
33 168 181 133 146 220 233 24...

result:

ok good!

Test #26:

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

input:

493
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 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:

17
16 85 411 428 384 401 479 434 451 283 300 255 272 351 368 323 324 
16 84 410 427 383 400 432 433 450 282 299 254 271 350 367 322 339 
16 83 409 426 382 399 477 478 449 281 298 253 270 349 366 321 338 
16 82 408 425 381 398 476 493 448 280 297 252 269 348 365 320 337 
16 81 407 424 380 397 475 492...

result:

ok good!

Test #27:

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

input:

493
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 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:

17
16 85 411 428 384 401 479 434 451 283 300 255 272 351 368 323 324 
16 84 410 427 383 400 432 433 450 282 299 254 271 350 367 322 339 
16 83 409 426 382 399 477 478 449 281 298 253 270 349 366 321 338 
16 82 408 425 381 398 476 493 448 280 297 252 269 348 365 320 337 
33 168 181 133 146 220 233 24...

result:

ok good!

Subtask #2:

score: 0
Runtime Error

Test #28:

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

input:

1
15
1
1

output:

15
1 1 
1 1 
1 1 
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 good!

Test #29:

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

input:

1
500
1
1

output:

500
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 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 good!

Test #30:

score: -7
Runtime Error

input:

1
3000
1
1

output:


result:


Subtask #3:

score: 12
Accepted

Test #45:

score: 12
Accepted
time: 1ms
memory: 5528kb

input:

2
7 8
2
1 2

output:

8
1 2 
2 1 2 
2 1 2 
2 1 2 
2 1 2 
2 1 2 
2 1 2 
2 1 2 

result:

ok good!

Test #46:

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

input:

3
5 4 6
2
2 3

output:

6
2 1 3 
2 1 3 
2 2 3 
3 2 1 3 
3 2 1 3 
3 2 1 3 

result:

ok good!

Test #47:

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

input:

3
4 2 9
3
1 2 3

output:

9
1 3 
1 3 
1 3 
2 1 3 
2 1 3 
2 1 3 
2 1 3 
2 2 3 
2 2 3 

result:

ok good!

Test #48:

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

input:

4
3 5 4 3
2
3 4

output:

5
3 1 3 2 
3 1 3 2 
3 4 3 2 
3 4 3 2 
3 4 1 2 

result:

ok good!

Test #49:

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

input:

4
1 4 5 5
3
1 3 4

output:

5
3 2 4 3 
3 2 4 3 
3 2 4 3 
3 2 4 3 
3 1 4 3 

result:

ok good!

Test #50:

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

input:

4
3 3 6 3
3
2 3 4

output:

6
2 1 3 
2 1 3 
2 1 3 
3 4 2 3 
3 4 2 3 
3 4 2 3 

result:

ok good!

Test #51:

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

input:

5
4 3 3 3 1
3
2 4 5

output:

4
2 2 1 
4 4 3 2 1 
4 4 3 2 1 
4 5 4 3 1 

result:

ok good!

Test #52:

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

input:

5
4 3 3 3 2
3
3 4 5

output:

4
3 3 2 1 
4 4 3 2 1 
4 5 4 2 1 
4 5 4 3 1 

result:

ok good!

Test #53:

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

input:

5
4 4 4 2 1
3
2 4 5

output:

5
2 2 1 
2 3 1 
2 3 2 
4 4 3 2 1 
5 5 4 3 2 1 

result:

ok good!

Test #54:

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

input:

5
3 3 3 3 3
3
1 2 4

output:

5
1 1 
2 2 1 
4 5 4 3 1 
4 5 4 3 2 
4 5 4 3 2 

result:

ok good!

Test #55:

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

input:

6
3 3 3 2 2 2
3
2 4 6

output:

-1

result:

ok no solution

Test #56:

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

input:

6
3 3 3 2 2 2
3
2 5 6

output:

3
5 5 4 3 2 1 
5 6 4 3 2 1 
5 6 5 3 2 1 

result:

ok good!

Test #57:

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

input:

6
4 4 3 2 1 1
3
1 3 5

output:

5
3 3 2 1 
3 4 2 1 
3 4 2 1 
3 5 3 1 
3 6 3 2 

result:

ok good!

Test #58:

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

input:

6
7 2 2 2 1 1
5
2 3 4 5 6

output:

7
2 2 1 
2 2 1 
2 3 1 
2 3 1 
2 4 1 
2 4 1 
3 6 5 1 

result:

ok good!

Test #59:

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

input:

7
3 3 3 2 2 1 1
3
1 4 6

output:

4
1 1 
4 4 3 2 1 
4 5 3 2 1 
6 7 6 5 4 3 2 

result:

ok good!

Test #60:

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

input:

7
4 4 3 1 1 1 1
3
1 4 6

output:

6
1 1 
1 1 
1 2 
4 5 3 2 1 
4 6 3 2 1 
4 7 4 3 2 

result:

ok good!

Test #61:

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

input:

8
2 2 2 2 2 2 2 1
6
1 2 3 4 6 7

output:

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

result:

ok good!

Test #62:

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

input:

8
3 3 3 2 1 1 1 1
4
4 6 7 8

output:

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

result:

ok good!

Test #63:

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

input:

8
4 3 3 1 1 1 1 1
4
1 6 7 8

output:

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

result:

ok good!

Test #64:

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

input:

9
4 3 2 1 1 1 1 1 1
4
3 4 5 7

output:

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

result:

ok good!

Test #65:

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

input:

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

output:

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

result:

ok good!

Test #66:

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

input:

14
2 1 1 1 1 1 1 1 1 1 1 1 1 1
14
1 2 3 4 5 6 7 8 9 10 11 12 13 14

output:

2
7 12 10 8 6 4 2 1 
8 14 13 11 9 7 5 3 1 

result:

ok good!

Test #67:

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

input:

4
2 2 2 1
2
1 4

output:

4
1 1 
1 2 
1 3 
4 4 3 2 1 

result:

ok good!

Subtask #4:

score: 45
Accepted

Dependency #1:

100%
Accepted

Dependency #3:

100%
Accepted

Test #68:

score: 45
Accepted
time: 6ms
memory: 8068kb

input:

150
24 12 11 10 9 9 9 9 9 8 8 7 7 7 7 7 6 6 6 6 6 6 6 5 5 5 5 5 5 5 5 5 5 5 5 5 4 4 4 4 4 4 4 4 4 4 4 4 4 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 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1 1 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:

25
18 92 100 57 61 66 39 46 25 30 36 19 16 13 9 7 4 2 1 
18 92 101 57 62 66 39 45 25 30 36 19 16 13 9 7 4 2 1 
18 93 101 57 62 67 39 45 25 30 36 17 16 13 10 7 4 2 1 
18 93 102 58 62 67 39 45 25 30 36 17 22 13 10 7 4 2 1 
18 75 102 58 50 67 38 45 25 30 36 17 22 13 10 7 4 2 1 
18 75 103 58 50 69 38 44...

result:

ok good!

Test #69:

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

input:

200
9 9 9 8 8 8 7 7 6 6 6 6 6 6 6 6 5 5 5 5 5 5 5 5 5 5 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 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 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 ...

output:

10
1 2 
9 13 11 7 6 5 4 1 3 2 
9 12 16 7 6 5 4 1 3 2 
9 10 15 8 6 5 4 1 3 2 
9 9 14 8 6 5 4 1 3 2 
78 88 91 93 96 85 83 81 78 76 73 99 126 124 121 119 116 114 103 105 108 110 113 56 55 53 58 49 47 45 57 71 69 68 66 64 63 61 59 27 28 36 31 32 33 35 37 38 39 41 42 43 44 17 19 20 21 22 23 24 25 26 18 9...

result:

ok good!

Test #70:

score: 0
Accepted
time: 6ms
memory: 10292kb

input:

250
8 7 7 7 7 6 6 6 6 5 5 5 5 5 5 5 5 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 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 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 ...

output:

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

result:

ok good!

Test #71:

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

input:

300
8 6 6 5 5 5 5 4 4 4 4 4 4 4 4 4 4 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 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 ...

output:

9
22 95 103 99 30 27 23 21 18 46 42 39 36 33 9 11 14 17 7 5 3 2 1 
23 91 95 104 99 30 27 23 21 18 46 42 39 36 33 9 10 14 17 7 5 3 2 1 
23 90 94 104 100 24 28 25 32 19 43 44 40 37 34 9 10 13 17 7 5 4 2 1 
23 90 94 87 100 24 28 25 32 19 43 44 40 37 34 9 10 13 15 7 6 4 2 1 
23 89 93 87 101 24 28 25 32 ...

result:

ok good!

Test #72:

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

input:

300
5 5 5 5 5 5 5 4 4 4 4 4 4 4 4 4 4 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 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1 1 1 1 1 ...

output:

6
6 1 6 5 4 3 2 
6 1 7 5 4 3 2 
63 57 59 61 63 65 113 115 117 119 121 112 125 127 129 131 133 123 109 91 93 95 97 99 110 107 105 103 101 24 28 27 26 25 22 21 20 18 29 33 41 40 39 37 36 35 32 31 8 9 10 12 11 13 14 16 17 15 1 7 6 4 3 2 
63 57 59 61 63 65 113 115 117 119 121 112 125 127 129 131 133 123...

result:

ok good!

Test #73:

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

input:

350
5 5 4 4 4 4 4 4 4 4 4 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1 1 1 1 1 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:

6
2 1 2 
2 1 2 
53 31 33 35 37 39 41 43 45 47 38 93 95 97 99 91 103 105 107 109 101 86 72 74 76 78 89 87 84 82 90 12 13 19 15 16 18 20 21 23 24 26 25 3 4 5 6 7 8 9 11 10 1 2 
53 31 33 35 37 39 41 43 45 47 38 93 95 97 99 91 103 105 107 109 101 86 72 74 76 78 89 87 84 82 90 12 13 14 15 16 17 20 21 22 ...

result:

ok good!

Test #74:

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

input:

70
51 39 26 24 21 18 16 15 15 12 11 10 10 9 9 9 8 8 7 7 7 7 7 7 6 6 6 6 6 6 6 5 5 5 5 5 5 5 4 4 4 4 4 4 3 3 3 3 3 3 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1 1 1
14
1 14 15 17 26 27 34 35 41 44 48 58 62 65

output:

56
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 2 
1 2 
1 2 
1 2 
1 2 
14 48 39 38 26 23 16 13 10 7 5 4 3 2 1 
14 48 39 38 26 23 17 13 10 7 5 4 3 2 1 
14 47 39 38 26 23 17 13 10 7 5 4 3 2 1 
14 47 39 38 27 23 17 13 10 8 6 4 3 2 1 
14 47 40 37 27 22 17 13 10 ...

result:

ok good!

Test #75:

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

input:

70
22 22 20 19 18 15 14 13 13 13 12 12 12 12 12 12 11 11 10 9 9 9 9 9 9 9 8 8 8 8 8 7 6 6 6 6 6 5 5 5 5 5 5 5 4 4 3 3 3 3 3 3 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1
9
1 3 7 9 16 17 62 68 69

output:

24
16 34 31 27 24 21 18 15 13 11 9 7 5 4 3 1 2 
16 33 31 27 24 21 18 16 13 11 9 7 5 4 3 1 2 
16 33 31 27 24 21 18 16 13 11 9 7 5 4 3 1 2 
16 33 31 27 24 21 18 16 14 11 9 7 6 4 3 1 2 
17 42 33 31 28 24 21 18 16 14 11 9 7 6 4 3 1 2 
17 42 35 31 28 24 21 18 16 14 12 9 7 6 4 3 1 2 
17 43 35 32 28 25 21 ...

result:

ok good!

Test #76:

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

input:

40
61 55 33 31 28 26 26 23 21 20 18 15 13 11 11 10 9 9 8 8 7 7 7 6 4 4 4 4 3 3 2 2 2 2 2 1 1 1 1 1
9
1 12 18 20 24 29 30 32 40

output:

79
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 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 
12 23 18 14 11 9 8 6 5 4 3 2 1 
12 22 18 14 11 9 8 6 5 4 3 2 1 
12 22 18 14 11 9 8 6 5 ...

result:

ok good!

Test #77:

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

input:

127
64 32 32 16 16 16 16 8 8 8 8 8 8 8 8 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
7
1 2 4 8 16 32 64

output:

64
4 12 4 2 1 
4 12 4 2 1 
4 12 4 2 1 
4 12 4 2 1 
4 12 4 2 1 
4 12 4 2 1 
4 12 4 2 1 
4 12 4 2 1 
4 15 4 2 1 
4 15 4 2 1 
4 15 4 2 1 
4 15 4 2 1 
4 15 4 2 1 
4 15 4 2 1 
4 15 4 2 1 
4 15 4 2 1 
8 111 47 19 24 14 5 2 1 
8 112 47 19 24 14 5 2 1 
8 113 32 19 24 14 5 2 1 
8 114 32 19 24 14 5 2 1 
8 115...

result:

ok good!

Test #78:

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

input:

10
31 67 31 15 21 37 53 96 81 68
4
1 2 8 10

output:

115
2 9 8 
2 9 8 
2 9 8 
2 9 8 
2 9 8 
2 9 8 
2 9 8 
2 9 8 
2 9 8 
2 9 8 
2 9 8 
2 9 8 
2 9 8 
2 9 8 
2 9 8 
2 9 8 
2 9 8 
2 10 8 
2 10 8 
2 10 8 
2 10 8 
2 10 8 
2 10 8 
2 10 8 
2 10 8 
2 10 8 
2 10 8 
2 10 8 
2 10 8 
2 10 8 
2 10 8 
2 10 8 
2 10 8 
2 10 8 
2 10 8 
2 10 8 
2 10 8 
2 10 8 
2 10 8 
2...

result:

ok good!

Test #79:

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

input:

40
24 20 23 12 7 11 20 16 1 4 2 21 12 13 7 17 5 15 4 24 17 8 13 8 15 9 16 21 12 7 3 16 6 5 21 8 11 12 11 23
5
8 12 13 27 29

output:

24
13 25 27 32 21 7 2 12 28 35 40 3 20 1 
13 25 27 32 21 7 2 12 28 35 40 3 20 1 
13 25 27 32 21 7 2 12 28 35 40 3 20 1 
13 25 27 32 21 7 2 12 28 35 40 3 20 1 
13 25 27 32 21 7 2 12 28 35 40 3 20 1 
13 25 27 32 21 16 2 12 28 35 40 3 20 1 
13 18 27 32 21 16 2 12 28 35 40 3 20 1 
13 18 27 8 21 16 2 12 ...

result:

ok good!

Test #80:

score: 0
Accepted
time: 6ms
memory: 8348kb

input:

40
2 18 20 17 18 15 12 4 6 12 13 20 2 15 22 20 21 8 8 1 3 9 22 16 5 8 12 11 8 16 4 19 14 13 13 16 24 21 1 11
14
1 4 5 8 10 13 14 21 23 24 32 33 34 36

output:

24
14 6 36 30 4 5 2 16 12 3 17 38 15 23 37 
21 9 29 28 27 10 34 35 6 36 30 4 5 2 16 12 3 17 38 15 23 37 
21 9 29 28 27 10 11 35 6 14 30 24 5 2 32 12 3 17 38 15 23 37 
21 9 29 28 27 10 11 35 6 14 30 24 5 2 32 12 3 17 38 15 23 37 
21 9 29 22 27 7 11 35 6 14 30 24 5 2 32 12 3 17 38 15 23 37 
21 25 29 2...

result:

ok good!

Test #81:

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

input:

130
5 1 7 5 7 6 4 2 4 2 7 1 5 1 1 7 4 3 3 4 3 5 1 5 5 2 1 6 5 2 7 2 1 2 3 1 1 6 1 5 3 2 1 5 7 6 5 2 5 3 5 4 2 3 1 3 2 4 6 6 1 3 4 7 6 2 7 1 7 7 5 7 2 3 1 2 2 4 4 1 3 4 7 3 7 3 6 1 1 3 3 6 5 7 4 1 4 5 3 3 5 4 4 6 1 3 2 6 4 7 3 4 2 6 1 2 7 7 7 6 5 6 7 5 2 2 2 2 7 2
7
26 43 55 69 82 116 125

output:

7
55 91 9 52 17 20 102 78 82 95 97 25 121 24 22 40 44 4 47 13 51 1 93 71 87 92 122 28 60 65 104 114 38 108 120 59 64 5 94 129 3 110 67 11 69 70 16 83 45 72 117 118 123 119 31 85 
55 91 9 52 112 20 102 78 79 95 97 29 121 24 22 40 101 4 47 13 51 98 93 71 6 92 122 28 60 65 46 114 38 108 120 59 64 5 94 ...

result:

ok good!

Test #82:

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

input:

130
5 4 7 2 1 6 4 3 4 4 4 3 7 4 5 1 2 1 6 1 7 4 6 4 2 4 2 7 1 3 1 7 1 3 1 2 6 4 7 3 6 5 3 2 6 3 1 7 2 1 1 6 7 6 1 3 4 5 7 1 3 1 5 7 6 3 4 6 1 5 1 5 5 6 3 1 7 6 7 2 5 6 4 7 3 7 4 2 5 2 6 4 1 2 4 1 7 4 4 6 2 5 5 3 4 6 1 2 3 2 2 3 6 1 7 4 1 2 5 4 3 5 5 3 5 2 2 3 5 5
45
1 4 5 6 15 18 20 23 28 31 32 33 3...

output:

7
66 110 108 56 128 8 46 104 109 85 43 14 10 11 38 22 24 92 95 99 83 67 2 122 119 15 103 125 129 130 89 63 73 42 81 70 52 113 106 74 54 23 100 78 45 91 65 37 41 82 68 13 53 59 3 115 21 48 77 97 28 79 32 86 84 39 64 
66 111 108 126 128 8 121 104 109 34 43 14 10 7 38 22 24 87 95 99 83 120 2 122 119 15...

result:

ok good!

Test #83:

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

input:

130
2 6 1 6 1 4 5 4 3 4 4 7 6 3 6 1 2 7 4 5 1 5 4 2 6 3 6 3 1 1 2 7 2 5 6 1 5 1 6 3 7 4 4 6 6 1 7 1 1 3 2 7 3 6 1 7 2 5 5 1 5 1 1 4 6 2 4 5 1 2 6 2 1 6 4 2 6 4 5 6 5 4 1 5 6 6 1 2 1 6 2 1 6 1 2 6 4 3 1 4 6 3 7 7 7 3 3 5 1 6 2 7 6 6 6 2 4 3 3 7 4 6 3 7 3 2 3 4 1 3
9
2 3 4 6 8 9 10 16 17

output:

30
16 116 40 119 10 128 20 61 27 114 65 85 77 12 103 120 52 
16 76 40 119 10 128 20 61 4 122 2 71 110 45 103 120 52 
16 76 40 119 23 128 20 61 4 122 2 71 110 45 103 120 52 
16 51 28 98 23 128 37 79 4 122 2 71 110 45 18 120 52 
16 51 28 98 23 82 37 79 4 122 2 71 110 45 18 120 52 
16 57 28 98 23 82 37...

result:

ok good!

Test #84:

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

input:

70
8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 7 7 7 7 7 7 6 6 6 6 6 6 6 6 6 5 5 5 5 5 5 5 5 5 5 5 5
20
1 2 3 4 6 7 8 9 10 13 21 24 30 31 33 40 45 46 54 70

output:

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

result:

ok good!

Test #85:

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

input:

90
8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 7 7 7 7 6 6 6 6 6 6 6 5 5 5 5 5 5 5 5 4 4 4 4 4 4 4 4 4 4 4 4 4 4 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 2 2
20
1 2 3 6 7 8 9 10 13 20 24 30 32 46 53 63 68 69 70 79

output:

8
53 56 57 60 62 65 63 45 47 50 51 52 44 42 41 40 38 34 35 36 37 10 18 16 15 14 13 12 11 9 8 7 6 5 4 3 17 1 33 32 31 30 29 28 2 26 25 24 23 22 21 20 19 27 
63 68 72 75 77 88 86 84 81 79 54 56 57 60 62 65 63 49 47 50 51 52 44 42 41 40 38 34 35 36 37 10 18 16 15 14 13 12 11 9 8 7 6 5 4 3 17 1 33 32 31...

result:

ok good!

Test #86:

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

input:

120
8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 7 7 7 7 6 6 6 6 6 6 5 5 5 5 5 5 5 4 4 4 4 4 4 4 4 4 4 4 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1
20
1 2 3 4 5 9 10 14 15 19 25 28 30 33 36 77 78 99 108 116

output:

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

result:

ok good!

Test #87:

score: 0
Accepted
time: 6ms
memory: 8688kb

input:

200
4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 ...

output:

5
13 39 41 42 43 44 46 47 48 49 51 52 53 45 
118 151 147 143 155 196 192 188 171 174 178 182 106 108 110 112 114 105 102 99 97 95 93 115 138 136 134 132 131 129 118 120 122 124 126 128 79 78 77 73 72 71 81 80 92 90 89 88 76 86 85 83 82 27 19 21 22 23 24 25 26 28 29 30 31 32 33 34 20 36 3 4 5 6 7 8 9...

result:

ok good!

Test #88:

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

input:

250
4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 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:

4
59 76 77 16 18 19 20 21 22 23 24 25 26 27 28 17 15 14 13 12 11 10 9 8 7 6 5 4 3 30 29 1 57 56 55 54 53 52 51 50 49 48 47 46 2 44 43 42 41 40 39 38 37 36 35 34 33 32 31 45 
147 153 156 159 162 165 181 178 166 172 169 175 130 127 124 121 118 149 146 143 140 137 134 232 229 217 223 220 226 248 245 24...

result:

ok good!

Test #89:

score: 0
Accepted
time: 6ms
memory: 8748kb

input:

300
4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 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:

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

result:

ok good!

Test #90:

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

input:

100
9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
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 76 77 78 79 80 81 82 83 84 85 ...

output:

18
24 18 20 22 24 15 12 10 8 5 3 25 50 48 46 44 42 40 38 36 34 32 30 28 39 
24 17 20 22 24 15 12 10 8 6 3 25 50 48 46 44 42 40 38 36 34 32 30 28 39 
24 17 19 22 24 15 12 10 8 6 4 25 50 48 46 44 42 40 38 36 34 32 30 28 39 
24 17 19 21 24 15 12 10 8 6 4 26 50 48 46 44 42 40 38 36 34 32 30 28 39 
24 17...

result:

ok good!

Test #91:

score: 0
Accepted
time: 6ms
memory: 8636kb

input:

446
55 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 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:

55
9 200 33 88 366 421 253 308 306 1 
9 199 32 87 365 420 405 238 280 1 
9 198 31 86 364 349 418 251 305 1 
9 197 30 85 70 362 417 250 304 1 
9 196 181 15 83 361 416 249 303 1 
9 126 194 28 82 360 415 248 302 1 
9 139 193 27 81 359 414 247 301 1 
9 138 192 26 80 358 413 246 300 1 
9 137 191 25 79 35...

result:

ok good!

Test #92:

score: 0
Accepted
time: 6ms
memory: 8980kb

input:

470
31 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 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:

31
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
470 148 149 150 151 152 153 154 155 156 157 158 159 160 235 162 163 164 165 166 167 168 169 170 171 172 173 174 175 161 119 120 121 122 123 124 125...

result:

ok good!

Test #93:

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

input:

31
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
15
1 2 3 4 5 6 7 24 25 26 27 28 29 30 31

output:

35
6 9 6 5 3 2 1 
6 9 7 5 3 2 1 
6 9 7 5 3 2 1 
6 9 7 5 3 2 1 
7 11 9 7 5 3 2 1 
7 12 9 7 5 4 2 1 
7 12 9 7 5 4 2 1 
7 12 9 7 5 4 2 1 
7 12 10 7 5 4 2 1 
7 12 10 7 5 4 2 1 
7 13 10 7 6 4 2 1 
7 13 10 8 6 4 3 1 
7 13 10 8 6 4 3 1 
7 13 10 8 6 4 3 1 
7 14 10 8 6 4 3 1 
7 14 11 8 6 4 3 1 
7 14 11 8 6 4...

result:

ok good!

Test #94:

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

input:

100
1 14 14 8 2 2 5 16 7 1 4 7 7 2 7 2 1 1 4 5 2 14 9 3 7 1 11 4 7 4 2 8 17 1 7 1 7 2 11 3 3 2 1 7 1 9 1 7 3 3 4 2 1 10 1 1 1 3 8 7 1 1 1 2 4 1 3 16 5 9 3 3 1 3 2 3 7 11 1 3 1 11 13 4 1 3 1 17 1 2 1 16 11 4 9 5 6 4 1 2
7
1 2 4 8 16 32 64

output:

18
1 88 
2 33 88 
16 4 23 46 54 82 78 39 83 3 22 2 68 8 92 33 88 
32 47 16 21 50 40 76 30 51 7 97 13 12 29 37 48 32 4 23 46 54 82 78 27 83 3 22 2 68 8 92 33 88 
32 1 16 14 50 40 76 30 94 7 97 13 12 29 35 48 32 4 95 46 54 93 78 27 83 3 22 2 68 8 92 33 88 
32 53 90 14 49 58 67 19 94 7 97 13 12 29 35 6...

result:

ok good!

Test #95:

score: 0
Accepted
time: 6ms
memory: 8580kb

input:

350
3 1 1 2 1 2 2 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 1 1 1 1 1 1 2 3 1 1 1 2 2 1 1 1 1 1 1 1 1 1 1 2 1 1 2 2 1 1 2 1 1 1 1 1 1 1 1 1 1 1 2 1 2 2 1 1 1 1 1 1 3 1 1 1 1 2 1 1 1 1 2 2 1 1 1 2 2 1 2 1 1 1 2 2 1 1 5 1 1 2 1 3 1 1 1 1 1 1 2 1 3 1 1 1 2 1 1 1 1 1 1 2 1 1 1 2 1 1 1 1 1 1 1 1 1 1 3 2 1 1 3 1 ...

output:

7
1 308 
2 206 308 
16 108 321 254 253 320 261 147 143 233 332 344 327 103 247 206 308 
32 87 282 187 179 279 212 184 214 273 221 224 1 77 285 280 305 108 321 259 253 320 322 147 143 233 298 344 327 103 247 206 308 
64 70 69 328 31 36 7 303 55 343 310 24 335 52 48 347 115 263 121 173 128 172 106 350...

result:

ok good!

Subtask #5:

score: 0
Runtime Error

Dependency #4:

100%
Accepted

Test #96:

score: 0
Runtime Error

input:

27
12 148 141 10 98 1 82 103 145 60 190 102 181 147 152 185 24 134 179 127 141 38 169 93 132 157 49
6
1 5 7 13 17 26

output:


result:


Subtask #6:

score: 0
Skipped

Dependency #1:

100%
Accepted

Dependency #2:

0%