QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#104070#6339. CookiesBeyondHeaven100 ✓289ms329580kbC++171.9kb2023-05-08 14:26:002023-05-08 14:26:02

Details

Tip: Click on the bar to expand more detailed information

Subtask #1:

score: 6
Accepted

Test #1:

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

input:

1
1
1
1

output:

1
1 1 

result:

ok good!

Test #2:

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

input:

2
1 1
1
1

output:

2
1 1 
1 2 

result:

ok good!

Test #3:

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

input:

2
1 1
1
2

output:

1
2 2 1 

result:

ok good!

Test #4:

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

input:

2
1 1
2
1 2

output:

1
2 2 1 

result:

ok good!

Test #5:

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

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: 3776kb

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: 4ms
memory: 11168kb

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: 3ms
memory: 11156kb

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: 12ms
memory: 11260kb

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: 6ms
memory: 11248kb

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: 8ms
memory: 11192kb

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: 5ms
memory: 11160kb

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: 0ms
memory: 10908kb

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: 5ms
memory: 11168kb

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: 0ms
memory: 11248kb

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: 4ms
memory: 11160kb

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: 10ms
memory: 11164kb

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: 1ms
memory: 11240kb

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: 1ms
memory: 11240kb

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: 11ms
memory: 11164kb

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: 6ms
memory: 11172kb

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: 12ms
memory: 11252kb

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: 11ms
memory: 11044kb

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: 3ms
memory: 11080kb

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: 5ms
memory: 11072kb

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: 5ms
memory: 10972kb

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: 10996kb

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

Test #28:

score: 7
Accepted
time: 2ms
memory: 3876kb

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: 4ms
memory: 11168kb

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: 0
Accepted
time: 29ms
memory: 59880kb

input:

1
3000
1
1

output:

3000
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
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 #31:

score: 0
Accepted
time: 138ms
memory: 329580kb

input:

1
15000
1
1

output:

15000
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
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 #32:

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

input:

2
2 1
1
1

output:

3
1 1 
1 1 
1 2 

result:

ok good!

Test #33:

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

input:

2
1 2
1
2

output:

-1

result:

ok no solution

Test #34:

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

input:

3
1 2 3
1
2

output:

3
2 2 3 
2 2 3 
2 1 3 

result:

ok good!

Test #35:

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

input:

3
3 2 1
1
3

output:

-1

result:

ok no solution

Test #36:

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

input:

3
2 2 2
1
2

output:

3
2 2 1 
2 3 1 
2 3 2 

result:

ok good!

Test #37:

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

input:

15
50 49 48 47 46 45 44 43 42 41 40 2 1 1 1
1
10

output:

50
10 10 9 8 7 6 5 4 3 2 1 
10 10 9 8 7 6 5 4 3 2 1 
10 10 9 8 7 6 5 4 3 2 1 
10 10 9 8 7 6 5 4 3 2 1 
10 10 9 8 7 6 5 4 3 2 1 
10 11 9 8 7 6 5 4 3 2 1 
10 11 9 8 7 6 5 4 3 2 1 
10 11 9 8 7 6 5 4 3 2 1 
10 11 9 8 7 6 5 4 3 2 1 
10 11 9 8 7 6 5 4 3 2 1 
10 11 9 8 7 6 5 4 3 2 1 
10 11 9 8 7 6 5 4 3 2 ...

result:

ok good!

Test #38:

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

input:

15
51 49 48 47 46 45 44 43 42 41 40 1 1 1 1
1
10

output:

-1

result:

ok no solution

Test #39:

score: 0
Accepted
time: 123ms
memory: 328816kb

input:

10
430 3078 390 349 3750 906 377 3374 1795 551
1
4

output:

3750
4 9 2 8 5 
4 9 2 8 5 
4 9 2 8 5 
4 9 2 8 5 
4 9 2 8 5 
4 9 2 8 5 
4 9 2 8 5 
4 9 2 8 5 
4 9 2 8 5 
4 9 2 8 5 
4 9 2 8 5 
4 9 2 8 5 
4 9 2 8 5 
4 9 2 8 5 
4 9 2 8 5 
4 9 2 8 5 
4 9 2 8 5 
4 9 2 8 5 
4 9 2 8 5 
4 9 2 8 5 
4 9 2 8 5 
4 9 2 8 5 
4 9 2 8 5 
4 9 2 8 5 
4 9 2 8 5 
4 9 2 8 5 
4 9 2 8 5...

result:

ok good!

Test #40:

score: 0
Accepted
time: 128ms
memory: 328852kb

input:

500
4 99 56 16 7 39 5 8 3 18 15 30 19 27 46 47 24 55 1 7 21 1 13 5 53 32 12 98 12 121 3 118 25 15 8 32 29 7 13 3 29 94 22 4 12 37 15 52 14 9 59 22 3 16 9 77 5 17 41 22 16 6 3 32 33 34 18 1 28 4 72 4 3 40 21 13 22 16 42 77 2 16 1 1 10 11 3 34 21 28 4 173 24 57 17 9 20 116 21 72 17 165 28 30 6 13 86 1...

output:

5000
3 273 417 238 
3 273 417 238 
3 273 417 238 
3 273 417 238 
3 273 417 238 
3 273 417 238 
3 273 417 238 
3 273 417 238 
3 273 417 238 
3 273 417 238 
3 273 417 238 
3 273 417 238 
3 273 417 238 
3 273 417 238 
3 273 417 238 
3 273 417 238 
3 273 417 238 
3 273 417 238 
3 273 417 238 
3 273 417 ...

result:

ok good!

Test #41:

score: 0
Accepted
time: 131ms
memory: 328436kb

input:

500
30 23 12 48 4 11 119 12 15 24 33 9 22 46 42 7 18 49 9 1 43 3 4 43 31 11 4 7 33 30 13 5 36 3 20 2 40 37 7 1 8 43 34 12 2 37 99 38 59 36 24 18 68 23 9 24 33 1 13 10 12 2 7 7 1 5 73 7 7 32 2 13 7 49 41 20 160 69 11 61 25 35 15 22 32 66 47 45 34 14 12 7 9 43 4 42 2 24 29 16 11 6 5 5 8 11 42 3 48 20 ...

output:

200
75 103 16 173 79 91 59 428 340 420 495 280 188 54 393 275 244 472 160 135 1 229 167 11 43 337 50 38 379 488 385 107 94 256 88 119 421 181 492 444 124 424 457 128 298 49 126 267 127 493 226 404 116 442 398 391 303 433 484 223 144 233 449 197 335 265 196 447 195 435 7 336 297 77 284 496 
75 103 16...

result:

ok good!

Test #42:

score: 0
Accepted
time: 150ms
memory: 328412kb

input:

500
6 60 24 11 17 58 8 42 30 60 38 34 54 23 5 12 32 6 35 11 60 42 35 60 25 60 37 40 5 22 24 26 17 17 60 21 7 29 13 7 56 12 8 16 8 20 11 60 12 60 32 56 30 55 12 23 26 60 60 6 18 60 60 21 21 16 28 23 60 9 16 4 8 5 20 4 60 59 39 20 8 27 8 7 6 8 10 30 18 15 60 60 41 48 17 24 17 60 10 42 6 13 22 21 14 18...

output:

60
250 134 380 40 495 237 43 345 333 406 251 297 262 229 42 429 135 370 468 268 192 404 203 322 443 190 149 295 110 5 435 89 298 374 164 189 372 204 75 64 291 104 461 30 103 254 431 152 346 351 174 167 96 165 378 354 240 57 300 32 198 475 157 327 276 484 287 315 233 277 38 402 53 176 125 464 210 310...

result:

ok good!

Test #43:

score: 0
Accepted
time: 109ms
memory: 322712kb

input:

122
121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 ...

output:

122
121 34 35 36 37 38 39 40 41 42 43 44 45 46 1 48 49 50 51 52 53 54 55 56 57 58 59 60 61 47 2 3 4 5 6 7 8 9 10 11 12 13 14 15 32 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 16 94 95 96 97 98 99 100 101 102 103 104 105 106 107 62 109 110 111 112 113 114 115 116 117 118 119 120 121 122 108 63 64 65...

result:

ok good!

Test #44:

score: 0
Accepted
time: 13ms
memory: 20144kb

input:

498
2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 ...

output:

3
332 159 160 162 163 165 166 168 169 171 1 174 175 177 178 180 181 183 184 186 187 127 128 130 131 133 134 136 137 139 140 142 143 145 146 148 149 151 152 154 155 141 220 222 223 225 226 228 229 231 232 188 235 237 238 240 241 243 244 246 247 249 234 190 191 193 194 196 197 199 200 202 219 205 206 ...

result:

ok good!

Subtask #3:

score: 12
Accepted

Test #45:

score: 12
Accepted
time: 2ms
memory: 3960kb

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: 3936kb

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: 0ms
memory: 3928kb

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: 3ms
memory: 3856kb

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: 3956kb

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: 3856kb

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: 0ms
memory: 3920kb

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: 3856kb

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: 2ms
memory: 3900kb

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: 1ms
memory: 3852kb

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: 2ms
memory: 3964kb

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: 3856kb

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: 2ms
memory: 3932kb

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: 0ms
memory: 3972kb

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: 2ms
memory: 3940kb

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: 2ms
memory: 3848kb

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: 3964kb

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: 3924kb

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: 2ms
memory: 3980kb

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: 3ms
memory: 3856kb

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: 3900kb

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: 3872kb

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: 1ms
memory: 3888kb

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: 4ms
memory: 11164kb

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: 6ms
memory: 11164kb

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: 5ms
memory: 11176kb

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: 7ms
memory: 11168kb

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: 10ms
memory: 11168kb

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: 10ms
memory: 11168kb

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: 3ms
memory: 11164kb

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: 2ms
memory: 11248kb

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: 11236kb

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: 6ms
memory: 10224kb

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: 7ms
memory: 11176kb

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: 0ms
memory: 11256kb

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: 3ms
memory: 11156kb

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: 11ms
memory: 11248kb

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: 9ms
memory: 11156kb

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: 5ms
memory: 11256kb

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: 6ms
memory: 11244kb

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: 11244kb

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: 11168kb

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: 2ms
memory: 11164kb

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: 6ms
memory: 11240kb

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: 9ms
memory: 11172kb

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: 3ms
memory: 11160kb

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: 10ms
memory: 11252kb

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: 11248kb

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: 6ms
memory: 11164kb

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: 3ms
memory: 11244kb

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: 4ms
memory: 11240kb

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

Dependency #4:

100%
Accepted

Test #96:

score: 15
Accepted
time: 22ms
memory: 59592kb

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:

190
13 20 25 21 3 9 2 15 26 23 19 13 16 11 
13 20 25 21 3 9 2 15 26 23 19 13 16 11 
13 20 25 21 3 9 2 15 26 23 19 13 16 11 
13 20 25 21 3 9 2 15 26 23 19 13 16 11 
13 20 25 21 3 9 2 15 26 23 19 13 16 11 
13 20 25 21 3 9 2 15 26 23 19 13 16 11 
13 20 25 21 3 9 2 15 26 23 19 13 16 11 
13 20 25 21 3 9 ...

result:

ok good!

Test #97:

score: 0
Accepted
time: 24ms
memory: 59552kb

input:

160
35 20 9 34 11 22 2 17 18 37 32 27 4 22 26 15 32 19 22 29 8 30 7 10 23 33 11 18 24 18 29 34 17 35 26 12 28 6 27 19 37 34 8 7 33 32 18 13 24 13 26 34 6 3 37 9 10 6 16 34 19 8 30 8 14 14 32 3 35 18 12 20 1 19 25 30 19 6 2 16 15 24 34 6 31 7 22 29 11 14 14 23 7 25 32 14 9 11 21 31 37 31 2 19 31 4 13...

output:

37
80 38 135 43 56 24 98 27 128 107 66 91 96 16 81 80 59 120 8 130 30 70 9 74 40 18 131 108 2 142 99 19 87 119 148 92 82 159 49 94 75 125 15 138 35 51 39 158 37 20 88 22 140 63 150 102 100 85 134 67 95 11 46 17 26 151 42 52 83 32 4 60 1 110 34 69 101 55 10 41 122 
80 78 135 43 56 24 98 27 128 50 66 ...

result:

ok good!

Test #98:

score: 0
Accepted
time: 24ms
memory: 59644kb

input:

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

output:

9
133 113 541 447 444 84 597 83 458 566 563 33 21 20 544 46 50 525 519 583 500 584 65 67 68 13 476 73 9 461 592 504 170 124 324 382 279 206 325 376 344 372 296 297 154 309 136 235 239 247 254 225 406 222 175 119 263 336 264 408 323 322 326 551 188 189 192 178 194 43 255 259 262 587 267 214 16 273 32...

result:

ok good!

Test #99:

score: 0
Accepted
time: 37ms
memory: 59500kb

input:

400
15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 14 14 14 14 14 13 13 13 13 13 13 13 12 12 12 12 12 12...

output:

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

result:

ok good!

Test #100:

score: 0
Accepted
time: 20ms
memory: 59608kb

input:

750
7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 ...

output:

8
109 48 47 46 45 43 42 41 27 39 38 37 35 34 33 32 31 30 29 40 177 176 175 174 173 172 170 169 168 167 2 165 164 162 161 160 159 158 157 156 154 166 1 202 201 200 199 197 196 195 194 193 192 178 189 188 187 186 185 184 183 181 180 179 191 126 125 124 122 121 120 119 118 117 116 114 113 112 111 110 1...

result:

ok good!

Test #101:

score: 0
Accepted
time: 34ms
memory: 59576kb

input:

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

output:

24
114 83 85 87 89 79 78 76 74 72 70 120 91 118 116 114 112 110 108 67 104 102 100 97 95 93 37 35 33 31 29 27 25 23 21 19 17 15 13 11 65 63 61 59 57 55 53 51 49 47 45 43 41 39 202 200 198 196 194 192 176 188 186 184 182 180 178 190 229 227 225 223 221 219 203 215 213 211 209 207 205 217 145 143 141 ...

result:

ok good!

Test #102:

score: 0
Accepted
time: 36ms
memory: 59592kb

input:

2751
250 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 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
12 717 1326 174 96 362 2390 2656 2578 1425 2034 1828 1 
12 718 1327 175 97 363 2391 2657 2579 1426 2035 1848 1 
12 719 1328 176 130 364 2392 2658 2548 1427 2036 1829 1 
12 720 1329 177 99 365 2393 2659 2538 1428 2037 1830 1 
12 710 1330 178 100 420 2394 2660 2539 1429 2038 1831 1 
12 722 1331 17...

result:

ok good!

Test #103:

score: 0
Accepted
time: 32ms
memory: 59584kb

input:

2924
77 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 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:

77
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 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 #104:

score: 0
Accepted
time: 24ms
memory: 58092kb

input:

76
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 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
39
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 57 58 59 60 61 62 63 64 65 ...

output:

76
19 29 26 23 21 19 17 15 14 12 11 9 8 7 6 5 4 3 2 1 
19 30 26 23 21 19 17 15 14 12 11 10 8 7 6 5 4 3 2 1 
19 30 26 23 21 19 17 15 14 12 11 10 8 7 6 5 4 3 2 1 
19 30 26 23 21 19 17 15 14 12 11 10 8 7 6 5 4 3 2 1 
19 30 26 23 21 19 17 15 14 12 11 10 8 7 6 5 4 3 2 1 
19 30 26 23 21 19 17 15 14 12 11 ...

result:

ok good!

Test #105:

score: 0
Accepted
time: 26ms
memory: 59580kb

input:

1500
1 2 2 2 1 1 1 2 1 2 1 1 1 1 1 3 1 2 2 1 1 1 4 1 1 2 2 3 4 2 2 4 4 1 1 1 1 2 2 1 1 2 2 1 1 1 1 2 2 1 1 1 2 4 1 3 3 1 1 1 3 1 1 1 1 2 2 1 2 1 3 1 1 1 4 2 2 1 1 1 1 1 1 2 2 2 6 4 1 1 1 2 2 2 3 1 3 1 4 3 1 1 1 2 1 1 1 2 1 1 1 2 2 1 4 2 2 3 3 7 3 2 1 2 1 3 3 1 3 5 1 2 5 2 3 4 1 3 3 1 1 2 1 2 1 1 3 1...

output:

11
1 1279 
2 558 1279 
4 718 1483 558 1279 
16 1319 1316 120 920 1294 1044 713 214 163 774 1429 808 718 1483 558 1279 
32 453 743 242 1112 772 649 316 768 460 509 764 700 1411 1062 493 87 1319 1316 120 920 1294 291 713 214 163 774 1429 808 718 1483 558 1279 
128 917 115 720 1031 419 659 715 401 1308...

result:

ok good!

Test #106:

score: 0
Accepted
time: 27ms
memory: 59536kb

input:

2400
2 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 1 1 1 1 1 1 1 1 1 2 1 1 1 1 1 1 1 1 1 1 3 1 2 1 1 2 1 1 1 4 2 1 1 1 2 1 1 3 1 1 1 1 1 1 1 3 3 1 1 1 1 1 2 1 1 1 1 1 1 1 2 1 1 2 1 1 2 1 1 1 2 3 1 1 2 1 1 1 3 1 1 1 1 3 2 1 3 1 1 1 2 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 1 1 1 1 3 2 2 2 1 1 1 3 1 1 1 1 1 1 4 2 3...

output:

9
1 1267 
2 1336 1267 
4 853 225 1336 1267 
16 63 146 1302 855 435 366 1427 1426 46 2052 242 1313 316 225 1335 1267 
32 482 1685 1117 2233 1449 1265 1446 1573 103 1023 2342 1658 608 2058 522 2218 63 146 1302 855 435 366 1427 1426 46 2052 242 1313 316 225 1335 1267 
128 996 588 1947 585 987 570 580 9...

result:

ok good!

Subtask #6:

score: 15
Accepted

Dependency #1:

100%
Accepted

Dependency #2:

100%
Accepted

Dependency #3:

100%
Accepted

Dependency #4:

100%
Accepted

Dependency #5:

100%
Accepted

Test #107:

score: 15
Accepted
time: 126ms
memory: 328532kb

input:

40
153 344 238 669 595 304 297 265 438 678 232 354 377 249 297 629 693 559 65 283 407 198 128 290 443 371 667 289 86 601 429 231 266 624 474 12 319 436 364 646
7
1 8 9 12 21 27 28

output:

693
21 3 8 28 7 37 12 26 13 31 9 25 18 5 30 34 16 40 27 4 10 17 
21 3 8 28 7 37 12 26 13 31 9 25 18 5 30 34 16 40 27 4 10 17 
21 3 8 28 7 37 12 26 13 31 9 25 18 5 30 34 16 40 27 4 10 17 
21 3 8 28 7 37 12 26 13 31 9 25 18 5 30 34 16 40 27 4 10 17 
21 3 8 28 7 37 12 26 13 31 9 25 18 5 30 34 16 40 27 ...

result:

ok good!

Test #108:

score: 0
Accepted
time: 124ms
memory: 328508kb

input:

420
51 4 68 8 19 9 42 34 39 31 62 47 46 32 55 42 31 28 37 21 36 44 8 13 56 30 15 4 23 17 56 42 38 25 26 5 39 16 38 46 55 26 23 34 27 36 60 55 35 38 69 31 49 21 28 42 27 21 57 12 47 52 56 10 32 6 33 64 20 44 15 50 45 25 53 30 59 43 47 43 45 36 62 57 16 7 20 17 49 11 18 42 28 24 48 13 45 40 28 19 6 38...

output:

70
162 411 321 82 19 382 50 213 187 37 155 9 98 194 237 359 267 368 104 317 256 92 56 32 7 371 80 270 369 117 22 288 70 97 330 218 346 290 81 242 13 342 236 192 287 79 257 61 387 105 147 235 171 95 161 127 89 281 232 395 404 185 108 178 1 262 304 75 175 323 196 183 420 402 125 143 370 15 363 41 48 1...

result:

ok good!

Test #109:

score: 0
Accepted
time: 175ms
memory: 328444kb

input:

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

output:

8
1214 298 1326 1050 669 528 1333 665 294 295 659 114 3294 2833 1747 2825 2052 3107 3106 2432 3322 2959 2853 3238 1797 2848 1981 3115 2244 3284 1991 2836 3117 3359 2473 2033 2776 1729 2041 2489 2491 3381 3096 2965 3327 3101 2805 3340 3342 2794 2790 2009 2225 2786 2227 2298 3171 3175 3148 2402 1961 2...

result:

ok good!

Test #110:

score: 0
Accepted
time: 140ms
memory: 328460kb

input:

700
70 70 70 70 70 70 70 70 70 70 70 70 70 70 70 70 70 70 70 70 70 70 70 70 70 70 70 70 70 70 70 70 70 70 70 70 70 70 70 70 70 70 70 70 70 70 70 70 70 70 70 70 70 70 70 70 70 70 70 70 70 70 70 70 69 68 67 66 65 64 64 63 62 61 60 59 59 58 57 56 56 55 54 54 53 52 52 51 51 50 49 49 48 48 47 47 46 46 45...

output:

103
19 64 63 61 59 57 56 54 52 47 49 46 44 42 41 39 37 35 34 50 
19 64 63 61 59 57 56 54 52 47 49 46 44 42 41 39 37 35 34 50 
19 64 63 61 59 57 56 54 52 47 49 46 44 42 41 39 37 35 34 50 
19 64 63 61 59 57 56 54 52 47 49 46 44 42 41 39 37 35 34 50 
60 143 132 124 119 112 107 102 99 95 92 89 86 83 81 ...

result:

ok good!

Test #111:

score: 0
Accepted
time: 157ms
memory: 328636kb

input:

6250
5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5...

output:

6
291 1252 1254 1255 1256 1257 1258 790 791 792 793 794 796 797 798 1024 800 802 803 804 805 806 808 809 799 769 770 772 773 774 775 776 789 779 780 781 782 784 785 786 787 788 833 834 835 836 837 839 840 841 810 843 845 846 847 848 849 851 852 842 811 812 814 815 816 817 818 820 832 822 823 824 826...

result:

ok good!

Test #112:

score: 0
Accepted
time: 151ms
memory: 328432kb

input:

2000
14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 1...

output:

28
499 334 336 338 340 342 330 329 327 325 323 321 319 317 344 374 372 370 368 366 364 362 360 358 356 354 352 350 348 346 281 279 277 275 273 271 269 375 265 263 261 259 257 255 253 267 312 310 308 306 304 302 300 282 296 294 292 290 288 286 284 298 468 466 464 462 460 458 456 454 452 450 448 446 4...

result:

ok good!

Test #113:

score: 0
Accepted
time: 279ms
memory: 328576kb

input:

13930
1071 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 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:

1071
14 3846 6218 6003 1505 3045 1851 12003 10932 12419 7921 7720 10077 9279 1 
14 3847 6205 6004 1506 3046 1921 12004 10933 12420 7922 7721 10078 9305 1 
14 3848 6206 6005 1507 3047 1922 12005 10934 12461 7923 7722 10079 9280 1 
14 3849 6207 6006 1508 3008 1923 12006 10935 12422 7924 7723 10080 928...

result:

ok good!

Test #114:

score: 0
Accepted
time: 289ms
memory: 328692kb

input:

14828
173 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 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:

173
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 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 #115:

score: 0
Accepted
time: 164ms
memory: 325548kb

input:

172
172 171 170 169 168 167 166 165 164 163 162 161 160 159 158 157 156 155 154 153 152 151 150 149 148 147 146 145 144 143 142 141 140 139 138 137 136 135 134 133 132 131 130 129 128 127 126 125 124 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 9...

output:

172
43 73 68 63 60 57 54 52 49 47 45 43 41 39 37 36 34 32 31 29 28 26 25 23 22 21 20 18 17 16 15 13 12 11 10 9 8 7 6 5 4 3 2 1 
43 73 68 63 60 57 54 52 49 47 45 43 41 39 37 36 34 32 31 29 28 26 25 23 22 21 20 18 17 16 15 13 12 11 10 9 8 7 6 5 4 3 2 1 
43 73 68 64 60 57 54 52 49 47 45 43 41 39 37 36 ...

result:

ok good!

Test #116:

score: 0
Accepted
time: 184ms
memory: 328276kb

input:

5000
3 3 3 2 1 2 1 2 1 1 6 8 1 2 1 1 3 3 1 2 7 2 1 2 4 1 3 5 3 5 3 2 7 2 7 2 1 5 1 1 1 3 7 1 2 4 1 1 2 1 6 1 1 4 2 1 4 1 3 3 5 1 3 3 6 10 9 1 1 1 3 6 6 1 1 3 2 3 8 2 4 4 12 3 3 6 3 2 4 7 4 1 5 1 7 1 4 4 15 5 2 6 6 2 10 5 3 3 7 1 1 1 1 1 1 1 2 2 1 3 2 1 6 1 5 3 2 1 1 3 4 7 2 2 1 3 2 3 5 1 2 7 3 1 1 1...

output:

22
1 2438 
2 1224 2438 
4 1092 2178 1224 2438 
16 4135 4400 1395 2352 4908 4303 783 1623 4477 2110 1989 1723 1092 2178 1224 2438 
128 2255 1533 2924 1861 3317 2423 4946 3272 2870 4939 4067 12 4833 4813 2032 659 2188 4565 3937 4274 780 1327 265 4286 1371 2290 4974 3624 519 1645 3658 67 4911 2195 3688...

result:

ok good!

Test #117:

score: 0
Accepted
time: 257ms
memory: 328556kb

input:

11000
1 2 1 1 1 1 1 2 1 1 1 1 1 1 1 3 1 1 1 1 1 1 1 3 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 1 1 1 2 2 2 1 1 3 1 3 1 1 2 2 1 1 1 1 2 1 2 1 1 1 2 1 1 1 1 4 1 1 1 3 2 1 2 1 1 3 1 1 1 1 1 1 1 1 1 1 1 3 2 1 2 2 1 1 2 2 2 2 1 1 1 1 1 2 4 1 2 1 1 1 2 1 1 1 1 1 1 3 1 2 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 1 1 1 2 2 ...

output:

9
1 9052 
2 1326 9052 
4 7060 10604 1326 9052 
16 5801 3901 1427 1489 4683 10348 2700 726 10648 9592 9653 478 554 10604 1326 9052 
128 2241 8151 5396 8570 2233 10017 1653 2641 8197 9956 1642 1373 5317 9146 6285 6413 4756 6280 4757 1872 3821 4012 230 5151 3226 2116 8741 3655 10798 10694 1105 3402 987...

result:

ok good!

Extra Test:

score: 0
Extra Test Passed