QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#69463#2848. 城市地铁规划HuangHanShengAC ✓111ms109516kbC++201.8kb2022-12-27 17:36:552022-12-27 17:36:58

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 12ms
memory: 74360kb

input:

63 7
4 50 14 48 33 13 44 24

output:

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

result:

ok 

Test #2:

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

input:

208 7
23 28 14 16 46 28 26 28

output:

207 3317121
1 104
1 105
2 1
2 106
3 2
3 107
4 3
4 108
5 4
5 109
6 5
6 110
7 6
7 111
8 7
8 112
9 8
9 113
10 9
10 114
11 10
11 115
12 11
12 116
13 12
13 117
14 13
14 118
15 14
15 119
16 15
16 120
17 16
17 121
18 17
18 122
19 18
19 123
20 19
20 124
21 20
21 125
22 21
22 126
23 22
23 127
24 23
24 128
25...

result:

ok 

Test #3:

score: 0
Accepted
time: 66ms
memory: 108560kb

input:

2928 3
27 20 7 29

output:

2927 13889888
1 267
1 268
1 269
1 270
1 271
1 272
1 273
1 274
1 275
1 276
1 277
2 1
2 278
2 279
2 280
2 281
2 282
2 283
2 284
2 285
2 286
2 287
3 2
3 288
3 289
3 290
3 291
3 292
3 293
3 294
3 295
3 296
3 297
4 3
4 298
4 299
4 300
4 301
4 302
4 303
4 304
4 305
4 306
4 307
5 4
5 308
5 309
5 310
5 311
...

result:

ok 

Test #4:

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

input:

320 3
46 42 15 15

output:

319 1260206
1 24
1 25
1 26
1 27
1 28
1 29
1 30
1 31
1 32
1 33
1 34
1 35
1 36
1 37
2 1
2 38
2 39
2 40
2 41
2 42
2 43
2 44
2 45
2 46
2 47
2 48
2 49
2 50
3 2
3 51
3 52
3 53
3 54
3 55
3 56
3 57
3 58
3 59
3 60
3 61
3 62
3 63
4 3
4 64
4 65
4 66
4 67
4 68
4 69
4 70
4 71
4 72
4 73
4 74
4 75
4 76
5 4
5 77
5 ...

result:

ok 

Test #5:

score: 0
Accepted
time: 8ms
memory: 76256kb

input:

380 5
41 27 8 3 31 0

output:

379 3140470
1 77
1 78
1 79
1 80
1 81
2 1
2 82
2 83
2 84
2 85
3 2
3 86
3 87
3 88
3 89
4 3
4 90
4 91
4 92
4 93
5 4
5 94
5 95
5 96
5 97
6 5
6 98
6 99
6 100
6 101
7 6
7 102
7 103
7 104
7 105
8 7
8 106
8 107
8 108
8 109
9 8
9 110
9 111
9 112
9 113
10 9
10 114
10 115
10 116
10 117
11 10
11 118
11 119
11 1...

result:

ok 

Test #6:

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

input:

365 5
35 20 24 29 3 25

output:

364 3508667
1 122
1 123
1 124
2 1
2 125
2 126
3 2
3 127
3 128
4 3
4 129
4 130
5 4
5 131
5 132
6 5
6 133
6 134
7 6
7 135
7 136
8 7
8 137
8 138
9 8
9 139
9 140
10 9
10 141
10 142
11 10
11 143
11 144
12 11
12 145
12 146
13 12
13 147
13 148
14 13
14 149
14 150
15 14
15 151
15 152
16 15
16 153
16 154
17 ...

result:

ok 

Test #7:

score: 0
Accepted
time: 11ms
memory: 75896kb

input:

318 6
4 44 46 6 37 14 49

output:

317 6799456
1 159
1 160
2 1
2 161
3 2
3 162
4 3
4 163
5 4
5 164
6 5
6 165
7 6
7 166
8 7
8 167
9 8
9 168
10 9
10 169
11 10
11 170
12 11
12 171
13 12
13 172
14 13
14 173
15 14
15 174
16 15
16 175
17 16
17 176
18 17
18 177
19 18
19 178
20 19
20 179
21 20
21 180
22 21
22 181
23 22
23 182
24 23
24 183
25...

result:

ok 

Test #8:

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

input:

416 6
30 23 4 16 45 32 19

output:

415 5383994
1 208
1 209
2 1
2 210
3 2
3 211
4 3
4 212
5 4
5 213
6 5
6 214
7 6
7 215
8 7
8 216
9 8
9 217
10 9
10 218
11 10
11 219
12 11
12 220
13 12
13 221
14 13
14 222
15 14
15 223
16 15
16 224
17 16
17 225
18 17
18 226
19 18
19 227
20 19
20 228
21 20
21 229
22 21
22 230
23 22
23 231
24 23
24 232
25...

result:

ok 

Test #9:

score: 0
Accepted
time: 8ms
memory: 77856kb

input:

572 5
15 27 5 18 3 46

output:

571 9396678
1 191
1 192
1 193
2 1
2 194
2 195
3 2
3 196
3 197
4 3
4 198
4 199
5 4
5 200
5 201
6 5
6 202
6 203
7 6
7 204
7 205
8 7
8 206
8 207
9 8
9 208
9 209
10 9
10 210
10 211
11 10
11 212
11 213
12 11
12 214
12 215
13 12
13 216
13 217
14 13
14 218
14 219
15 14
15 220
15 221
16 15
16 222
16 223
17 ...

result:

ok 

Test #10:

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

input:

531 8
20 13 35 27 41 43 36 25 5

output:

530 9024252
1 178
1 179
1 180
2 1
2 181
2 182
3 2
3 183
3 184
4 3
4 185
4 186
5 4
5 187
5 188
6 5
6 189
6 190
7 6
7 191
7 192
8 7
8 193
8 194
9 8
9 195
9 196
10 9
10 197
10 198
11 10
11 199
11 200
12 11
12 201
12 202
13 12
13 203
13 204
14 13
14 205
14 206
15 14
15 207
15 208
16 15
16 209
16 210
17 ...

result:

ok 

Test #11:

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

input:

487 10
29 29 40 45 5 16 40 47 47 2 14

output:

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

result:

ok 

Test #12:

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

input:

584 7
10 27 29 8 32 43 26 3

output:

583 11437238
1 292
1 293
2 1
2 294
3 2
3 295
4 3
4 296
5 4
5 297
6 5
6 298
7 6
7 299
8 7
8 300
9 8
9 301
10 9
10 302
11 10
11 303
12 11
12 304
13 12
13 305
14 13
14 306
15 14
15 307
16 15
16 308
17 16
17 309
18 17
18 310
19 18
19 311
20 19
20 312
21 20
21 313
22 21
22 314
23 22
23 315
24 23
24 316
2...

result:

ok 

Test #13:

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

input:

59 4
48 16 9 42 21

output:

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

result:

ok 

Test #14:

score: 0
Accepted
time: 11ms
memory: 77552kb

input:

561 3
22 31 17 49

output:

560 3223790
1 64
1 65
1 66
1 67
1 68
1 69
1 70
1 71
1 72
2 1
2 73
2 74
2 75
2 76
2 77
2 78
2 79
2 80
3 2
3 81
3 82
3 83
3 84
3 85
3 86
3 87
3 88
4 3
4 89
4 90
4 91
4 92
4 93
4 94
4 95
4 96
5 4
5 97
5 98
5 99
5 100
5 101
5 102
5 103
5 104
6 5
6 105
6 106
6 107
6 108
6 109
6 110
6 111
6 112
7 6
7 113
...

result:

ok 

Test #15:

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

input:

629 6
26 31 41 32 13 39 41

output:

628 13149156
1 315
1 316
2 1
2 317
3 2
3 318
4 3
4 319
5 4
5 320
6 5
6 321
7 6
7 322
8 7
8 323
9 8
9 324
10 9
10 325
11 10
11 326
12 11
12 327
13 12
13 328
14 13
14 329
15 14
15 330
16 15
16 331
17 16
17 332
18 17
18 333
19 18
19 334
20 19
20 335
21 20
21 336
22 21
22 337
23 22
23 338
24 23
24 339
2...

result:

ok 

Test #16:

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

input:

616 3
38 48 27 2

output:

615 1394108
1 26
1 27
1 28
1 29
1 30
1 31
1 32
1 33
1 34
1 35
1 36
1 37
1 38
1 39
1 40
1 41
1 42
1 43
1 44
1 45
1 46
1 47
1 48
1 49
1 50
2 1
2 51
2 52
2 53
2 54
2 55
2 56
2 57
2 58
2 59
2 60
2 61
2 62
2 63
2 64
2 65
2 66
2 67
2 68
2 69
2 70
2 71
2 72
2 73
2 74
3 2
3 75
3 76
3 77
3 78
3 79
3 80
3 81
...

result:

ok 

Test #17:

score: 0
Accepted
time: 12ms
memory: 79300kb

input:

744 2
49 45 50

output:

743 1425426
1 24
1 25
1 26
1 27
1 28
1 29
1 30
1 31
1 32
1 33
1 34
1 35
1 36
1 37
1 38
1 39
1 40
1 41
1 42
1 43
1 44
1 45
1 46
1 47
1 48
1 49
1 50
1 51
1 52
1 53
1 54
1 55
1 56
2 1
2 57
2 58
2 59
2 60
2 61
2 62
2 63
2 64
2 65
2 66
2 67
2 68
2 69
2 70
2 71
2 72
2 73
2 74
2 75
2 76
2 77
2 78
2 79
2 80...

result:

ok 

Test #18:

score: 0
Accepted
time: 22ms
memory: 78128kb

input:

629 7
27 18 48 24 37 38 6 3

output:

628 9258317
1 159
1 160
1 161
1 162
2 1
2 163
2 164
2 165
3 2
3 166
3 167
3 168
4 3
4 169
4 170
4 171
5 4
5 172
5 173
5 174
6 5
6 175
6 176
6 177
7 6
7 178
7 179
7 180
8 7
8 181
8 182
8 183
9 8
9 184
9 185
9 186
10 9
10 187
10 188
10 189
11 10
11 190
11 191
11 192
12 11
12 193
12 194
12 195
13 12
13...

result:

ok 

Test #19:

score: 0
Accepted
time: 23ms
memory: 77896kb

input:

602 8
17 25 14 13 2 16 23 24 44

output:

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

result:

ok 

Test #20:

score: 0
Accepted
time: 12ms
memory: 81084kb

input:

900 2
9 13 12

output:

899 787522
1 15
1 16
1 17
1 18
1 19
1 20
1 21
1 22
1 23
1 24
1 25
1 26
1 27
1 28
1 29
1 30
1 31
1 32
1 33
1 34
1 35
1 36
1 37
1 38
1 39
1 40
1 41
1 42
1 43
1 44
1 45
1 46
1 47
1 48
1 49
1 50
1 51
1 52
1 53
1 54
1 55
1 56
1 57
1 58
1 59
1 60
1 61
1 62
1 63
1 64
1 65
1 66
1 67
1 68
1 69
1 70
1 71
1 72...

result:

ok 

Test #21:

score: 0
Accepted
time: 16ms
memory: 80192kb

input:

839 7
12 12 28 33 35 29 14 17

output:

838 24516016
1 420
1 421
2 1
2 422
3 2
3 423
4 3
4 424
5 4
5 425
6 5
6 426
7 6
7 427
8 7
8 428
9 8
9 429
10 9
10 430
11 10
11 431
12 11
12 432
13 12
13 433
14 13
14 434
15 14
15 435
16 15
16 436
17 16
17 437
18 17
18 438
19 18
19 439
20 19
20 440
21 20
21 441
22 21
22 442
23 22
23 443
24 23
24 444
2...

result:

ok 

Test #22:

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

input:

768 7
27 3 40 6 39 9 48 31

output:

767 18960055
1 384
1 385
2 1
2 386
3 2
3 387
4 3
4 388
5 4
5 389
6 5
6 390
7 6
7 391
8 7
8 392
9 8
9 393
10 9
10 394
11 10
11 395
12 11
12 396
13 12
13 397
14 13
14 398
15 14
15 399
16 15
16 400
17 16
17 401
18 17
18 402
19 18
19 403
20 19
20 404
21 20
21 405
22 21
22 406
23 22
23 407
24 23
24 408
2...

result:

ok 

Test #23:

score: 0
Accepted
time: 16ms
memory: 79600kb

input:

783 3
25 19 31 45

output:

782 4263811
1 88
1 89
1 90
1 91
1 92
1 93
1 94
1 95
1 96
2 1
2 97
2 98
2 99
2 100
2 101
2 102
2 103
2 104
3 2
3 105
3 106
3 107
3 108
3 109
3 110
3 111
3 112
4 3
4 113
4 114
4 115
4 116
4 117
4 118
4 119
4 120
5 4
5 121
5 122
5 123
5 124
5 125
5 126
5 127
5 128
6 5
6 129
6 130
6 131
6 132
6 133
6 13...

result:

ok 

Test #24:

score: 0
Accepted
time: 11ms
memory: 74228kb

input:

2 4
24 9 31 45 15

output:

1 248
1 2

result:

ok 

Test #25:

score: 0
Accepted
time: 22ms
memory: 79932kb

input:

792 5
28 40 21 32 44 11

output:

791 6695732
1 265
1 266
1 267
2 1
2 268
2 269
3 2
3 270
3 271
4 3
4 272
4 273
5 4
5 274
5 275
6 5
6 276
6 277
7 6
7 278
7 279
8 7
8 280
8 281
9 8
9 282
9 283
10 9
10 284
10 285
11 10
11 286
11 287
12 11
12 288
12 289
13 12
13 290
13 291
14 13
14 292
14 293
15 14
15 294
15 295
16 15
16 296
16 297
17 ...

result:

ok 

Test #26:

score: 0
Accepted
time: 16ms
memory: 81424kb

input:

939 5
35 7 31 40 25 28

output:

938 12031060
1 313
1 314
1 315
1 316
2 1
2 317
2 318
3 2
3 319
3 320
4 3
4 321
4 322
5 4
5 323
5 324
6 5
6 325
6 326
7 6
7 327
7 328
8 7
8 329
8 330
9 8
9 331
9 332
10 9
10 333
10 334
11 10
11 335
11 336
12 11
12 337
12 338
13 12
13 339
13 340
14 13
14 341
14 342
15 14
15 343
15 344
16 15
16 345
16 ...

result:

ok 

Test #27:

score: 0
Accepted
time: 12ms
memory: 81260kb

input:

924 6
30 26 21 8 12 42 26

output:

923 14203740
1 462
1 463
2 1
2 464
3 2
3 465
4 3
4 466
5 4
5 467
6 5
6 468
7 6
7 469
8 7
8 470
9 8
9 471
10 9
10 472
11 10
11 473
12 11
12 474
13 12
13 475
14 13
14 476
15 14
15 477
16 15
16 478
17 16
17 479
18 17
18 480
19 18
19 481
20 19
20 482
21 20
21 483
22 21
22 484
23 22
23 485
24 23
24 486
2...

result:

ok 

Test #28:

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

input:

902 8
8 48 35 25 32 28 21 2 44

output:

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

result:

ok 

Test #29:

score: 0
Accepted
time: 19ms
memory: 82248kb

input:

1021 2
11 16 14

output:

1020 977447
1 18
1 19
1 20
1 21
1 22
1 23
1 24
1 25
1 26
1 27
1 28
1 29
1 30
1 31
1 32
1 33
1 34
1 35
1 36
1 37
1 38
1 39
1 40
1 41
1 42
1 43
1 44
1 45
1 46
1 47
1 48
1 49
1 50
1 51
1 52
1 53
1 54
1 55
1 56
1 57
1 58
1 59
1 60
1 61
1 62
1 63
1 64
1 65
1 66
1 67
1 68
1 69
1 70
1 71
1 72
1 73
1 74
1 7...

result:

ok 

Test #30:

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

input:

1 9
18 7 32 20 44 12 15 38 14 43

output:

0 18

result:

ok 

Test #31:

score: 0
Accepted
time: 11ms
memory: 82772kb

input:

1060 3
22 35 14 10

output:

1059 3631294
1 68
1 69
1 70
1 71
1 72
1 73
1 74
1 75
1 76
1 77
1 78
1 79
1 80
1 81
1 82
1 83
2 1
2 84
2 85
2 86
2 87
2 88
2 89
2 90
2 91
2 92
2 93
2 94
2 95
2 96
2 97
2 98
3 2
3 99
3 100
3 101
3 102
3 103
3 104
3 105
3 106
3 107
3 108
3 109
3 110
3 111
3 112
3 113
4 3
4 114
4 115
4 116
4 117
4 118
4...

result:

ok 

Test #32:

score: 0
Accepted
time: 21ms
memory: 84180kb

input:

1174 9
43 31 31 48 26 3 12 24 44 15

output:

1173 32850542
1 587
1 588
2 1
2 589
3 2
3 590
4 3
4 591
5 4
5 592
6 5
6 593
7 6
7 594
8 7
8 595
9 8
9 596
10 9
10 597
11 10
11 598
12 11
12 599
13 12
13 600
14 13
14 601
15 14
15 602
16 15
16 603
17 16
17 604
18 17
18 605
19 18
19 606
20 19
20 607
21 20
21 608
22 21
22 609
23 22
23 610
24 23
24 611
...

result:

ok 

Test #33:

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

input:

1132 7
22 41 20 40 1 45 15 41

output:

1131 30428525
1 566
1 567
2 1
2 568
3 2
3 569
4 3
4 570
5 4
5 571
6 5
6 572
7 6
7 573
8 7
8 574
9 8
9 575
10 9
10 576
11 10
11 577
12 11
12 578
13 12
13 579
14 13
14 580
15 14
15 581
16 15
16 582
17 16
17 583
18 17
18 584
19 18
19 585
20 19
20 586
21 20
21 587
22 21
22 588
23 22
23 589
24 23
24 590
...

result:

ok 

Test #34:

score: 0
Accepted
time: 12ms
memory: 84004kb

input:

1144 7
44 11 38 25 10 46 39 14

output:

1143 13475451
1 230
1 231
1 232
1 233
1 234
2 1
2 235
2 236
2 237
2 238
3 2
3 239
3 240
3 241
3 242
4 3
4 243
4 244
4 245
4 246
5 4
5 247
5 248
5 249
5 250
6 5
6 251
6 252
6 253
6 254
7 6
7 255
7 256
7 257
7 258
8 7
8 259
8 260
8 261
8 262
9 8
9 263
9 264
9 265
9 266
10 9
10 267
10 268
10 269
10 270...

result:

ok 

Test #35:

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

input:

143 1
20 39

output:

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

result:

ok 

Test #36:

score: 0
Accepted
time: 23ms
memory: 84528kb

input:

1193 8
13 14 30 29 27 45 20 50 12

output:

1192 23190532
1 597
1 598
2 1
2 599
3 2
3 600
4 3
4 601
5 4
5 602
6 5
6 603
7 6
7 604
8 7
8 605
9 8
9 606
10 9
10 607
11 10
11 608
12 11
12 609
13 12
13 610
14 13
14 611
15 14
15 612
16 15
16 613
17 16
17 614
18 17
18 615
19 18
19 616
20 19
20 617
21 20
21 618
22 21
22 619
23 22
23 620
24 23
24 621
...

result:

ok 

Test #37:

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

input:

1246 2
36 21 13

output:

1245 1190316
1 21
1 22
1 23
1 24
1 25
1 26
1 27
1 28
1 29
1 30
1 31
1 32
1 33
1 34
1 35
1 36
1 37
1 38
1 39
1 40
1 41
1 42
1 43
1 44
1 45
1 46
1 47
1 48
1 49
1 50
1 51
1 52
1 53
1 54
1 55
1 56
1 57
1 58
1 59
1 60
1 61
1 62
1 63
1 64
1 65
1 66
1 67
1 68
1 69
1 70
1 71
1 72
1 73
1 74
1 75
1 76
1 77
1 ...

result:

ok 

Test #38:

score: 0
Accepted
time: 18ms
memory: 85640kb

input:

1282 6
32 30 38 2 32 22 30

output:

1281 19528052
1 641
1 642
2 1
2 643
3 2
3 644
4 3
4 645
5 4
5 646
6 5
6 647
7 6
7 648
8 7
8 649
9 8
9 650
10 9
10 651
11 10
11 652
12 11
12 653
13 12
13 654
14 13
14 655
15 14
15 656
16 15
16 657
17 16
17 658
18 17
18 659
19 18
19 660
20 19
20 661
21 20
21 662
22 21
22 663
23 22
23 664
24 23
24 665
...

result:

ok 

Test #39:

score: 0
Accepted
time: 28ms
memory: 84896kb

input:

1219 5
1 18 2 24 13 41

output:

1218 19108189
1 407
1 408
1 409
2 1
2 410
2 411
3 2
3 412
3 413
4 3
4 414
4 415
5 4
5 416
5 417
6 5
6 418
6 419
7 6
7 420
7 421
8 7
8 422
8 423
9 8
9 424
9 425
10 9
10 426
10 427
11 10
11 428
11 429
12 11
12 430
12 431
13 12
13 432
13 433
14 13
14 434
14 435
15 14
15 436
15 437
16 15
16 438
16 439
1...

result:

ok 

Test #40:

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

input:

1275 7
1 2 2 10 48 11 39 18

output:

1274 12159175
1 214
1 215
1 216
1 217
1 218
1 219
2 1
2 220
2 221
2 222
2 223
2 224
3 2
3 225
3 226
3 227
3 228
3 229
4 3
4 230
4 231
4 232
4 233
4 234
5 4
5 235
5 236
5 237
5 238
5 239
6 5
6 240
6 241
6 242
6 243
6 244
7 6
7 245
7 246
7 247
7 248
7 249
8 7
8 250
8 251
8 252
8 253
8 254
9 8
9 255
9 ...

result:

ok 

Test #41:

score: 0
Accepted
time: 21ms
memory: 84572kb

input:

1204 6
42 39 31 45 1 45 15

output:

1203 20981458
1 402
1 403
1 404
2 1
2 405
2 406
3 2
3 407
3 408
4 3
4 409
4 410
5 4
5 411
5 412
6 5
6 413
6 414
7 6
7 415
7 416
8 7
8 417
8 418
9 8
9 419
9 420
10 9
10 421
10 422
11 10
11 423
11 424
12 11
12 425
12 426
13 12
13 427
13 428
14 13
14 429
14 430
15 14
15 431
15 432
16 15
16 433
16 434
1...

result:

ok 

Test #42:

score: 0
Accepted
time: 38ms
memory: 87808kb

input:

1433 6
36 45 32 28 2 47 35

output:

1432 27559374
1 717
1 718
2 1
2 719
3 2
3 720
4 3
4 721
5 4
5 722
6 5
6 723
7 6
7 724
8 7
8 725
9 8
9 726
10 9
10 727
11 10
11 728
12 11
12 729
13 12
13 730
14 13
14 731
15 14
15 732
16 15
16 733
17 16
17 734
18 17
18 735
19 18
19 736
20 19
20 737
21 20
21 738
22 21
22 739
23 22
23 740
24 23
24 741
...

result:

ok 

Test #43:

score: 0
Accepted
time: 22ms
memory: 88548kb

input:

1479 4
19 20 14 40 48

output:

1478 13245633
1 371
1 372
1 373
1 374
2 1
2 375
2 376
2 377
3 2
3 378
3 379
3 380
4 3
4 381
4 382
4 383
5 4
5 384
5 385
5 386
6 5
6 387
6 388
6 389
7 6
7 390
7 391
7 392
8 7
8 393
8 394
8 395
9 8
9 396
9 397
9 398
10 9
10 399
10 400
10 401
11 10
11 402
11 403
11 404
12 11
12 405
12 406
12 407
13 12
...

result:

ok 

Test #44:

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

input:

1416 5
13 30 1 3 23 37

output:

1415 20881768
1 473
1 474
1 475
2 1
2 476
2 477
3 2
3 478
3 479
4 3
4 480
4 481
5 4
5 482
5 483
6 5
6 484
6 485
7 6
7 486
7 487
8 7
8 488
8 489
9 8
9 490
9 491
10 9
10 492
10 493
11 10
11 494
11 495
12 11
12 496
12 497
13 12
13 498
13 499
14 13
14 500
14 501
15 14
15 502
15 503
16 15
16 504
16 505
1...

result:

ok 

Test #45:

score: 0
Accepted
time: 28ms
memory: 86816kb

input:

1366 2
23 7 45

output:

1365 2381528
1 40
1 41
1 42
1 43
1 44
1 45
1 46
1 47
1 48
1 49
1 50
1 51
1 52
1 53
1 54
1 55
1 56
1 57
1 58
1 59
1 60
1 61
1 62
1 63
1 64
1 65
1 66
1 67
1 68
1 69
1 70
1 71
1 72
1 73
1 74
2 1
2 75
2 76
2 77
2 78
2 79
2 80
2 81
2 82
2 83
2 84
2 85
2 86
2 87
2 88
2 89
2 90
2 91
2 92
2 93
2 94
2 95
2 9...

result:

ok 

Test #46:

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

input:

69 8
9 37 11 27 24 20 26 29 34

output:

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

result:

ok 

Test #47:

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

input:

1446 1
31 40

output:

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

result:

ok 

Test #48:

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

input:

1558 7
1 20 1 18 19 32 23 31

output:

1557 27375776
1 779
1 780
2 1
2 781
3 2
3 782
4 3
4 783
5 4
5 784
6 5
6 785
7 6
7 786
8 7
8 787
9 8
9 788
10 9
10 789
11 10
11 790
12 11
12 791
13 12
13 792
14 13
14 793
15 14
15 794
16 15
16 795
17 16
17 796
18 17
18 797
19 18
19 798
20 19
20 799
21 20
21 800
22 21
22 801
23 22
23 802
24 23
24 803
...

result:

ok 

Test #49:

score: 0
Accepted
time: 31ms
memory: 88956kb

input:

1506 6
13 11 47 4 16 12 23

output:

1505 26313135
1 503
1 504
1 505
2 1
2 506
2 507
3 2
3 508
3 509
4 3
4 510
4 511
5 4
5 512
5 513
6 5
6 514
6 515
7 6
7 516
7 517
8 7
8 518
8 519
9 8
9 520
9 521
10 9
10 522
10 523
11 10
11 524
11 525
12 11
12 526
12 527
13 12
13 528
13 529
14 13
14 530
14 531
15 14
15 532
15 533
16 15
16 534
16 535
1...

result:

ok 

Test #50:

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

input:

1502 10
7 28 34 22 15 12 39 22 3 12 1

output:

1501 30324390
1 751
1 752
2 1
2 753
3 2
3 754
4 3
4 755
5 4
5 756
6 5
6 757
7 6
7 758
8 7
8 759
9 8
9 760
10 9
10 761
11 10
11 762
12 11
12 763
13 12
13 764
14 13
14 765
15 14
15 766
16 15
16 767
17 16
17 768
18 17
18 769
19 18
19 770
20 19
20 771
21 20
21 772
22 21
22 773
23 22
23 774
24 23
24 775
...

result:

ok 

Test #51:

score: 0
Accepted
time: 25ms
memory: 89792kb

input:

1554 6
40 26 7 34 32 25 10

output:

1553 17872648
1 312
1 313
1 314
1 315
1 316
2 1
2 317
2 318
2 319
2 320
3 2
3 321
3 322
3 323
3 324
4 3
4 325
4 326
4 327
4 328
5 4
5 329
5 330
5 331
5 332
6 5
6 333
6 334
6 335
6 336
7 6
7 337
7 338
7 339
7 340
8 7
8 341
8 342
8 343
8 344
9 8
9 345
9 346
9 347
9 348
10 9
10 349
10 350
10 351
10 352...

result:

ok 

Test #52:

score: 0
Accepted
time: 16ms
memory: 91164kb

input:

1641 6
4 4 50 32 36 21 45

output:

1640 34686354
1 821
1 822
2 1
2 823
3 2
3 824
4 3
4 825
5 4
5 826
6 5
6 827
7 6
7 828
8 7
8 829
9 8
9 830
10 9
10 831
11 10
11 832
12 11
12 833
13 12
13 834
14 13
14 835
15 14
15 836
16 15
16 837
17 16
17 838
18 17
18 839
19 18
19 840
20 19
20 841
21 20
21 842
22 21
22 843
23 22
23 844
24 23
24 845
...

result:

ok 

Test #53:

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

input:

1704 9
34 25 28 32 46 31 13 5 10 3

output:

1703 33186050
1 852
1 853
2 1
2 854
3 2
3 855
4 3
4 856
5 4
5 857
6 5
6 858
7 6
7 859
8 7
8 860
9 8
9 861
10 9
10 862
11 10
11 863
12 11
12 864
13 12
13 865
14 13
14 866
15 14
15 867
16 15
16 868
17 16
17 869
18 17
18 870
19 18
19 871
20 19
20 872
21 20
21 873
22 21
22 874
23 22
23 875
24 23
24 876
...

result:

ok 

Test #54:

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

input:

1729 10
1 45 47 48 14 11 16 5 44 43 39

output:

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

result:

ok 

Test #55:

score: 0
Accepted
time: 29ms
memory: 91868kb

input:

1674 8
46 26 8 27 50 42 16 8 14

output:

1673 24479277
1 559
1 560
1 561
2 1
2 562
2 563
3 2
3 564
3 565
4 3
4 566
4 567
5 4
5 568
5 569
6 5
6 570
6 571
7 6
7 572
7 573
8 7
8 574
8 575
9 8
9 576
9 577
10 9
10 578
10 579
11 10
11 580
11 581
12 11
12 582
12 583
13 12
13 584
13 585
14 13
14 586
14 587
15 14
15 588
15 589
16 15
16 590
16 591
1...

result:

ok 

Test #56:

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

input:

1791 5
2 4 36 30 27 46

output:

1790 33867308
1 598
1 599
1 600
2 1
2 601
2 602
3 2
3 603
3 604
4 3
4 605
4 606
5 4
5 607
5 608
6 5
6 609
6 610
7 6
7 611
7 612
8 7
8 613
8 614
9 8
9 615
9 616
10 9
10 617
10 618
11 10
11 619
11 620
12 11
12 621
12 622
13 12
13 623
13 624
14 13
14 625
14 626
15 14
15 627
15 628
16 15
16 629
16 630
1...

result:

ok 

Test #57:

score: 0
Accepted
time: 8ms
memory: 75148kb

input:

219 6
11 26 45 49 10 1 14

output:

218 3123505
1 56
1 57
1 58
1 59
2 1
2 60
2 61
2 62
3 2
3 63
3 64
3 65
4 3
4 66
4 67
4 68
5 4
5 69
5 70
5 71
6 5
6 72
6 73
6 74
7 6
7 75
7 76
7 77
8 7
8 78
8 79
8 80
9 8
9 81
9 82
9 83
10 9
10 84
10 85
10 86
11 10
11 87
11 88
11 89
12 11
12 90
12 91
12 92
13 12
13 93
13 94
13 95
14 13
14 96
14 97
14 ...

result:

ok 

Test #58:

score: 0
Accepted
time: 29ms
memory: 93704kb

input:

1774 3
39 29 31 6

output:

1773 5370690
1 100
1 101
1 102
1 103
1 104
1 105
1 106
1 107
1 108
1 109
1 110
1 111
1 112
1 113
1 114
1 115
1 116
1 117
2 1
2 118
2 119
2 120
2 121
2 122
2 123
2 124
2 125
2 126
2 127
2 128
2 129
2 130
2 131
2 132
2 133
2 134
3 2
3 135
3 136
3 137
3 138
3 139
3 140
3 141
3 142
3 143
3 144
3 145
3 1...

result:

ok 

Test #59:

score: 0
Accepted
time: 46ms
memory: 94488kb

input:

1830 6
25 31 32 37 2 1 43

output:

1829 30462134
1 915
1 916
2 1
2 917
3 2
3 918
4 3
4 919
5 4
5 920
6 5
6 921
7 6
7 922
8 7
8 923
9 8
9 924
10 9
10 925
11 10
11 926
12 11
12 927
13 12
13 928
14 13
14 929
15 14
15 930
16 15
16 931
17 16
17 932
18 17
18 933
19 18
19 934
20 19
20 935
21 20
21 936
22 21
22 937
23 22
23 938
24 23
24 939
...

result:

ok 

Test #60:

score: 0
Accepted
time: 43ms
memory: 95752kb

input:

1886 5
36 33 10 5 16 31

output:

1885 23079262
1 629
1 630
1 631
2 1
2 632
2 633
3 2
3 634
3 635
4 3
4 636
4 637
5 4
5 638
5 639
6 5
6 640
6 641
7 6
7 642
7 643
8 7
8 644
8 645
9 8
9 646
9 647
10 9
10 648
10 649
11 10
11 650
11 651
12 11
12 652
12 653
13 12
13 654
13 655
14 13
14 656
14 657
15 14
15 658
15 659
16 15
16 660
16 661
1...

result:

ok 

Test #61:

score: 0
Accepted
time: 45ms
memory: 96020kb

input:

1907 7
9 37 49 23 34 14 29 24

output:

1906 20753757
1 954
1 955
2 1
2 956
3 2
3 957
4 3
4 958
5 4
5 959
6 5
6 960
7 6
7 961
8 7
8 962
9 8
9 963
10 9
10 964
11 10
11 965
12 11
12 966
13 12
13 967
14 13
14 968
15 14
15 969
16 15
16 970
17 16
17 971
18 17
18 972
19 18
19 973
20 19
20 974
21 20
21 975
22 21
22 976
23 22
23 977
24 23
24 978
...

result:

ok 

Test #62:

score: 0
Accepted
time: 40ms
memory: 94684kb

input:

1840 2
30 14 7

output:

1839 1289412
1 22
1 23
1 24
1 25
1 26
1 27
1 28
1 29
1 30
1 31
1 32
1 33
1 34
1 35
1 36
1 37
1 38
1 39
1 40
1 41
1 42
1 43
1 44
1 45
1 46
1 47
1 48
1 49
1 50
1 51
1 52
1 53
1 54
1 55
1 56
1 57
1 58
1 59
1 60
1 61
1 62
1 63
1 64
1 65
1 66
1 67
1 68
1 69
1 70
1 71
1 72
1 73
1 74
1 75
1 76
1 77
1 78
1 ...

result:

ok 

Test #63:

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

input:

1845 3
46 42 35 46

output:

1844 10496398
1 206
1 207
1 208
1 209
1 210
1 211
1 212
1 213
1 214
2 1
2 215
2 216
2 217
2 218
2 219
2 220
2 221
2 222
3 2
3 223
3 224
3 225
3 226
3 227
3 228
3 229
3 230
4 3
4 231
4 232
4 233
4 234
4 235
4 236
4 237
4 238
5 4
5 239
5 240
5 241
5 242
5 243
5 244
5 245
5 246
6 5
6 247
6 248
6 249
6 ...

result:

ok 

Test #64:

score: 0
Accepted
time: 29ms
memory: 97924kb

input:

2029 2
41 7 2

output:

2028 808537
1 13
1 14
1 15
1 16
1 17
1 18
1 19
1 20
1 21
1 22
1 23
1 24
1 25
1 26
1 27
1 28
1 29
1 30
1 31
1 32
1 33
1 34
1 35
1 36
1 37
1 38
1 39
1 40
1 41
1 42
1 43
1 44
1 45
1 46
1 47
1 48
1 49
1 50
1 51
1 52
1 53
1 54
1 55
1 56
1 57
1 58
1 59
1 60
1 61
1 62
1 63
1 64
1 65
1 66
1 67
1 68
1 69
1 7...

result:

ok 

Test #65:

score: 0
Accepted
time: 46ms
memory: 98632kb

input:

2084 7
40 34 44 27 31 24 50 14

output:

2083 37527190
1 695
1 696
1 697
2 1
2 698
2 699
3 2
3 700
3 701
4 3
4 702
4 703
5 4
5 704
5 705
6 5
6 706
6 707
7 6
7 708
7 709
8 7
8 710
8 711
9 8
9 712
9 713
10 9
10 714
10 715
11 10
11 716
11 717
12 11
12 718
12 719
13 12
13 720
13 721
14 13
14 722
14 723
15 14
15 724
15 725
16 15
16 726
16 727
1...

result:

ok 

Test #66:

score: 0
Accepted
time: 45ms
memory: 97644kb

input:

2002 9
9 8 5 42 1 3 24 27 42 41

output:

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

result:

ok 

Test #67:

score: 0
Accepted
time: 42ms
memory: 97836kb

input:

2013 6
40 34 25 24 15 45 29

output:

2012 35161186
1 672
1 673
1 674
2 1
2 675
2 676
3 2
3 677
3 678
4 3
4 679
4 680
5 4
5 681
5 682
6 5
6 683
6 684
7 6
7 685
7 686
8 7
8 687
8 688
9 8
9 689
9 690
10 9
10 691
10 692
11 10
11 693
11 694
12 11
12 695
12 696
13 12
13 697
13 698
14 13
14 699
14 700
15 14
15 701
15 702
16 15
16 703
16 704
1...

result:

ok 

Test #68:

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

input:

199 5
17 8 15 42 48 4

output:

198 2382209
1 51
1 52
1 53
1 54
2 1
2 55
2 56
2 57
3 2
3 58
3 59
3 60
4 3
4 61
4 62
4 63
5 4
5 64
5 65
5 66
6 5
6 67
6 68
6 69
7 6
7 70
7 71
7 72
8 7
8 73
8 74
8 75
9 8
9 76
9 77
9 78
10 9
10 79
10 80
10 81
11 10
11 82
11 83
11 84
12 11
12 85
12 86
12 87
13 12
13 88
13 89
13 90
14 13
14 91
14 92
14 ...

result:

ok 

Test #69:

score: 0
Accepted
time: 31ms
memory: 97044kb

input:

1966 7
37 19 37 24 32 9 37 14

output:

1965 29203766
1 657
1 658
1 659
2 1
2 660
2 661
3 2
3 662
3 663
4 3
4 664
4 665
5 4
5 666
5 667
6 5
6 668
6 669
7 6
7 670
7 671
8 7
8 672
8 673
9 8
9 674
9 675
10 9
10 676
10 677
11 10
11 678
11 679
12 11
12 680
12 681
13 12
13 682
13 683
14 13
14 684
14 685
15 14
15 686
15 687
16 15
16 688
16 689
1...

result:

ok 

Test #70:

score: 0
Accepted
time: 39ms
memory: 100080kb

input:

2211 5
49 7 4 27 10 6

output:

2210 15935989
1 554
1 555
1 556
1 557
2 1
2 558
2 559
2 560
3 2
3 561
3 562
3 563
4 3
4 564
4 565
4 566
5 4
5 567
5 568
5 569
6 5
6 570
6 571
6 572
7 6
7 573
7 574
7 575
8 7
8 576
8 577
8 578
9 8
9 579
9 580
9 581
10 9
10 582
10 583
10 584
11 10
11 585
11 586
11 587
12 11
12 588
12 589
12 590
13 12
...

result:

ok 

Test #71:

score: 0
Accepted
time: 33ms
memory: 99844kb

input:

2187 7
33 36 31 49 29 15 43 18

output:

2186 21094741
1 1094
1 1095
2 1
2 1096
3 2
3 1097
4 3
4 1098
5 4
5 1099
6 5
6 1100
7 6
7 1101
8 7
8 1102
9 8
9 1103
10 9
10 1104
11 10
11 1105
12 11
12 1106
13 12
13 1107
14 13
14 1108
15 14
15 1109
16 15
16 1110
17 16
17 1111
18 17
18 1112
19 18
19 1113
20 19
20 1114
21 20
21 1115
22 21
22 1116
23 ...

result:

ok 

Test #72:

score: 0
Accepted
time: 45ms
memory: 99548kb

input:

2155 6
20 28 43 19 45 19 40

output:

2154 41581356
1 1078
1 1079
2 1
2 1080
3 2
3 1081
4 3
4 1082
5 4
5 1083
6 5
6 1084
7 6
7 1085
8 7
8 1086
9 8
9 1087
10 9
10 1088
11 10
11 1089
12 11
12 1090
13 12
13 1091
14 13
14 1092
15 14
15 1093
16 15
16 1094
17 16
17 1095
18 17
18 1096
19 18
19 1097
20 19
20 1098
21 20
21 1099
22 21
22 1100
23 ...

result:

ok 

Test #73:

score: 0
Accepted
time: 49ms
memory: 99064kb

input:

2116 8
15 11 9 46 41 24 2 17 37

output:

2115 57657640
1 1058
1 1059
2 1
2 1060
3 2
3 1061
4 3
4 1062
5 4
5 1063
6 5
6 1064
7 6
7 1065
8 7
8 1066
9 8
9 1067
10 9
10 1068
11 10
11 1069
12 11
12 1070
13 12
13 1071
14 13
14 1072
15 14
15 1073
16 15
16 1074
17 16
17 1075
18 17
18 1076
19 18
19 1077
20 19
20 1078
21 20
21 1079
22 21
22 1080
23 ...

result:

ok 

Test #74:

score: 0
Accepted
time: 41ms
memory: 100488kb

input:

2235 4
46 43 36 45 46

output:

2234 20192476
1 560
1 561
1 562
1 563
2 1
2 564
2 565
2 566
3 2
3 567
3 568
3 569
4 3
4 570
4 571
4 572
5 4
5 573
5 574
5 575
6 5
6 576
6 577
6 578
7 6
7 579
7 580
7 581
8 7
8 582
8 583
8 584
9 8
9 585
9 586
9 587
10 9
10 588
10 589
10 590
11 10
11 591
11 592
11 593
12 11
12 594
12 595
12 596
13 12
...

result:

ok 

Test #75:

score: 0
Accepted
time: 43ms
memory: 102176kb

input:

2386 6
33 46 3 3 36 47 3

output:

2385 23421354
1 597
1 598
1 599
1 600
2 1
2 601
2 602
2 603
3 2
3 604
3 605
3 606
4 3
4 607
4 608
4 609
5 4
5 610
5 611
5 612
6 5
6 613
6 614
6 615
7 6
7 616
7 617
7 618
8 7
8 619
8 620
8 621
9 8
9 622
9 623
9 624
10 9
10 625
10 626
10 627
11 10
11 628
11 629
11 630
12 11
12 631
12 632
12 633
13 12
...

result:

ok 

Test #76:

score: 0
Accepted
time: 56ms
memory: 100644kb

input:

2256 5
44 29 21 9 14 34

output:

2255 32619088
1 565
1 566
1 567
1 568
2 1
2 569
2 570
2 571
3 2
3 572
3 573
3 574
4 3
4 575
4 576
4 577
5 4
5 578
5 579
5 580
6 5
6 581
6 582
6 583
7 6
7 584
7 585
7 586
8 7
8 587
8 588
8 589
9 8
9 590
9 591
9 592
10 9
10 593
10 594
10 595
11 10
11 596
11 597
11 598
12 11
12 599
12 600
12 601
13 12
...

result:

ok 

Test #77:

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

input:

2262 9
21 4 35 10 47 35 37 25 48 34

output:

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

result:

ok 

Test #78:

score: 0
Accepted
time: 35ms
memory: 100652kb

input:

2257 7
26 17 20 30 32 11 41 13

output:

2256 35113744
1 752
1 753
1 754
1 755
2 1
2 756
2 757
2 758
3 2
3 759
3 760
4 3
4 761
4 762
5 4
5 763
5 764
6 5
6 765
6 766
7 6
7 767
7 768
8 7
8 769
8 770
9 8
9 771
9 772
10 9
10 773
10 774
11 10
11 775
11 776
12 11
12 777
12 778
13 12
13 779
13 780
14 13
14 781
14 782
15 14
15 783
15 784
16 15
16 ...

result:

ok 

Test #79:

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

input:

226 8
34 21 19 16 21 28 2 37 39

output:

225 5680290
1 113
1 114
2 1
2 115
3 2
3 116
4 3
4 117
5 4
5 118
6 5
6 119
7 6
7 120
8 7
8 121
9 8
9 122
10 9
10 123
11 10
11 124
12 11
12 125
13 12
13 126
14 13
14 127
15 14
15 128
16 15
16 129
17 16
17 130
18 17
18 131
19 18
19 132
20 19
20 133
21 20
21 134
22 21
22 135
23 22
23 136
24 23
24 137
25...

result:

ok 

Test #80:

score: 0
Accepted
time: 48ms
memory: 101468kb

input:

2331 5
36 50 29 20 5 29

output:

2330 25841563
1 777
1 778
1 779
1 780
2 1
2 781
2 782
3 2
3 783
3 784
4 3
4 785
4 786
5 4
5 787
5 788
6 5
6 789
6 790
7 6
7 791
7 792
8 7
8 793
8 794
9 8
9 795
9 796
10 9
10 797
10 798
11 10
11 799
11 800
12 11
12 801
12 802
13 12
13 803
13 804
14 13
14 805
14 806
15 14
15 807
15 808
16 15
16 809
16...

result:

ok 

Test #81:

score: 0
Accepted
time: 42ms
memory: 102968kb

input:

2454 6
34 22 1 23 44 1 27

output:

2453 29880376
1 1227
1 1228
2 1
2 1229
3 2
3 1230
4 3
4 1231
5 4
5 1232
6 5
6 1233
7 6
7 1234
8 7
8 1235
9 8
9 1236
10 9
10 1237
11 10
11 1238
12 11
12 1239
13 12
13 1240
14 13
14 1241
15 14
15 1242
16 15
16 1243
17 16
17 1244
18 17
18 1245
19 18
19 1246
20 19
20 1247
21 20
21 1248
22 21
22 1249
23 ...

result:

ok 

Test #82:

score: 0
Accepted
time: 48ms
memory: 103496kb

input:

2493 1
6 37

output:

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

result:

ok 

Test #83:

score: 0
Accepted
time: 49ms
memory: 102856kb

input:

2449 9
15 44 43 25 41 9 49 37 50 25

output:

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

result:

ok 

Test #84:

score: 0
Accepted
time: 55ms
memory: 102652kb

input:

2424 4
26 19 47 14 30

output:

2423 21435242
1 486
1 487
1 488
1 489
1 490
2 1
2 491
2 492
2 493
2 494
3 2
3 495
3 496
3 497
3 498
4 3
4 499
4 500
4 501
4 502
5 4
5 503
5 504
5 505
5 506
6 5
6 507
6 508
6 509
6 510
7 6
7 511
7 512
7 513
7 514
8 7
8 515
8 516
8 517
8 518
9 8
9 519
9 520
9 521
9 522
10 9
10 523
10 524
10 525
10 526...

result:

ok 

Test #85:

score: 0
Accepted
time: 48ms
memory: 103724kb

input:

2510 9
50 17 37 5 25 10 5 27 18 35

output:

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

result:

ok 

Test #86:

score: 0
Accepted
time: 47ms
memory: 104776kb

input:

2600 4
16 19 18 19 49

output:

2599 22021756
1 651
1 652
1 653
1 654
2 1
2 655
2 656
2 657
3 2
3 658
3 659
3 660
4 3
4 661
4 662
4 663
5 4
5 664
5 665
5 666
6 5
6 667
6 668
6 669
7 6
7 670
7 671
7 672
8 7
8 673
8 674
8 675
9 8
9 676
9 677
9 678
10 9
10 679
10 680
10 681
11 10
11 682
11 683
11 684
12 11
12 685
12 686
12 687
13 12
...

result:

ok 

Test #87:

score: 0
Accepted
time: 52ms
memory: 105748kb

input:

2695 7
25 39 43 5 29 2 49 24

output:

2694 43794209
1 1348
1 1349
2 1
2 1350
3 2
3 1351
4 3
4 1352
5 4
5 1353
6 5
6 1354
7 6
7 1355
8 7
8 1356
9 8
9 1357
10 9
10 1358
11 10
11 1359
12 11
12 1360
13 12
13 1361
14 13
14 1362
15 14
15 1363
16 15
16 1364
17 16
17 1365
18 17
18 1366
19 18
19 1367
20 19
20 1368
21 20
21 1369
22 21
22 1370
23 ...

result:

ok 

Test #88:

score: 0
Accepted
time: 54ms
memory: 105476kb

input:

2661 10
49 45 22 28 7 50 45 33 33 18 13

output:

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

result:

ok 

Test #89:

score: 0
Accepted
time: 68ms
memory: 105152kb

input:

2626 7
40 5 15 8 28 13 22 12

output:

2625 63314782
1 1313
1 1314
2 1
2 1315
3 2
3 1316
4 3
4 1317
5 4
5 1318
6 5
6 1319
7 6
7 1320
8 7
8 1321
9 8
9 1322
10 9
10 1323
11 10
11 1324
12 11
12 1325
13 12
13 1326
14 13
14 1327
15 14
15 1328
16 15
16 1329
17 16
17 1330
18 17
18 1331
19 18
19 1332
20 19
20 1333
21 20
21 1334
22 21
22 1335
23 ...

result:

ok 

Test #90:

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

input:

255 4
11 1 4 13 42

output:

254 2896197
1 52
1 53
1 54
1 55
1 56
2 1
2 57
2 58
2 59
2 60
3 2
3 61
3 62
3 63
3 64
4 3
4 65
4 66
4 67
4 68
5 4
5 69
5 70
5 71
5 72
6 5
6 73
6 74
6 75
6 76
7 6
7 77
7 78
7 79
7 80
8 7
8 81
8 82
8 83
8 84
9 8
9 85
9 86
9 87
9 88
10 9
10 89
10 90
10 91
10 92
11 10
11 93
11 94
11 95
11 96
12 11
12 97
...

result:

ok 

Test #91:

score: 0
Accepted
time: 45ms
memory: 104356kb

input:

2563 7
40 13 13 37 28 21 8 24

output:

2562 35788764
1 854
1 855
1 856
1 857
1 858
2 1
2 859
2 860
3 2
3 861
3 862
4 3
4 863
4 864
5 4
5 865
5 866
6 5
6 867
6 868
7 6
7 869
7 870
8 7
8 871
8 872
9 8
9 873
9 874
10 9
10 875
10 876
11 10
11 877
11 878
12 11
12 879
12 880
13 12
13 881
13 882
14 13
14 883
14 884
15 14
15 885
15 886
16 15
16 ...

result:

ok 

Test #92:

score: 0
Accepted
time: 58ms
memory: 106728kb

input:

2768 8
25 18 26 34 13 30 47 6 47

output:

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

result:

ok 

Test #93:

score: 0
Accepted
time: 68ms
memory: 106644kb

input:

2757 8
31 36 12 14 35 43 44 19 21

output:

2756 65276248
1 1379
1 1380
2 1
2 1381
3 2
3 1382
4 3
4 1383
5 4
5 1384
6 5
6 1385
7 6
7 1386
8 7
8 1387
9 8
9 1388
10 9
10 1389
11 10
11 1390
12 11
12 1391
13 12
13 1392
14 13
14 1393
15 14
15 1394
16 15
16 1395
17 16
17 1396
18 17
18 1397
19 18
19 1398
20 19
20 1399
21 20
21 1400
22 21
22 1401
23 ...

result:

ok 

Test #94:

score: 0
Accepted
time: 57ms
memory: 106268kb

input:

2739 9
43 26 15 47 1 50 41 45 23 49

output:

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

result:

ok 

Test #95:

score: 0
Accepted
time: 111ms
memory: 106176kb

input:

2719 9
6 17 3 39 27 7 37 36 35 1

output:

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

result:

ok 

Test #96:

score: 0
Accepted
time: 46ms
memory: 106988kb

input:

2793 9
2 50 17 43 35 38 32 6 47 50

output:

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

result:

ok 

Test #97:

score: 0
Accepted
time: 52ms
memory: 107964kb

input:

2879 8
12 7 41 14 5 9 34 25 16

output:

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

result:

ok 

Test #98:

score: 0
Accepted
time: 74ms
memory: 109516kb

input:

2997 1
6 29

output:

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

result:

ok 

Test #99:

score: 0
Accepted
time: 72ms
memory: 109464kb

input:

2993 8
2 50 21 40 45 19 9 36 30

output:

2992 81471772
1 1497
1 1498
2 1
2 1499
3 2
3 1500
4 3
4 1501
5 4
5 1502
6 5
6 1503
7 6
7 1504
8 7
8 1505
9 8
9 1506
10 9
10 1507
11 10
11 1508
12 11
12 1509
13 12
13 1510
14 13
14 1511
15 14
15 1512
16 15
16 1513
17 16
17 1514
18 17
18 1515
19 18
19 1516
20 19
20 1517
21 20
21 1518
22 21
22 1519
23 ...

result:

ok 

Test #100:

score: 0
Accepted
time: 70ms
memory: 109368kb

input:

2993 1
9 45

output:

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

result:

ok