QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#669810#3040. ContainerZhaoZiLongAC ✓2ms11052kbC++202.0kb2024-10-23 19:44:402024-10-23 19:44:40

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 1ms
memory: 5680kb

input:

5 2
11221
21112

output:

2
1 3
4 5

result:

ok good job!

Test #2:

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

input:

7 0
2212121
1212122

output:

4
6 7
4 6
2 4
1 2

result:

ok good job!

Test #3:

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

input:

7 2
2212121
1212122

output:

3
1 3
3 5
5 7

result:

ok good job!

Test #4:

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

input:

1 0
1
1

output:

0

result:

ok good job!

Test #5:

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

input:

1 100
2
2

output:

0

result:

ok good job!

Test #6:

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

input:

2 55
12
21

output:

1
1 2

result:

ok good job!

Test #7:

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

input:

3 100
112
211

output:

1
1 3

result:

ok good job!

Test #8:

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

input:

3 99
221
212

output:

1
2 3

result:

ok good job!

Test #9:

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

input:

3 98
111
111

output:

0

result:

ok good job!

Test #10:

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

input:

123 64
222111221111221122211121221221122122211222211112221221212121211221122212111212211222122212122221212121222121221112111112112
211112121222212221122212212122111121121212211211211212212211111221222212121121212222112212222211221211122212111211221122212

output:

110
12 14
15 17
16 18
17 19
21 23
24 26
22 24
20 22
26 28
24 26
22 24
27 29
30 32
28 30
26 28
24 26
31 33
29 31
34 36
32 34
30 32
109 111
111 113
113 115
115 117
117 119
119 121
114 116
107 109
109 111
111 113
113 115
115 117
117 119
110 112
105 107
107 109
109 111
111 113
113 115
104 106
106 108
10...

result:

ok good job!

Test #11:

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

input:

337 42
12221211121211122121211211221211122221122211222222112211121111121211112112222111112212222222211111212211212211221111112121121211112121211222222211122211121211121121121212111112212211122122121112212122212121112111222222112112221222122112221121212212221222212211112211222211112212121221221222111...

output:

683
9 10
10 12
14 16
12 14
15 17
13 15
17 19
22 24
20 22
18 20
16 18
14 16
19 21
25 27
23 25
21 23
26 28
24 26
22 24
28 30
33 35
31 33
29 31
27 29
32 34
30 32
34 36
35 37
38 40
36 38
39 41
37 39
40 42
39 40
44 45
62 64
69 71
67 69
65 67
63 65
61 63
72 74
70 72
68 70
73 75
71 73
74 76
72 74
70 72
75 ...

result:

ok good job!

Test #12:

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

input:

312 225
1211111122221112212122121121211212111222121212112121211221211122121111121212211221122221212122111111121222121222112121122222222111111211212112222111222221122211222221122112212112121122222121212111121211212222211122212122111221212222122222122211222211221211111221112111121122222122122111211212...

output:

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

result:

ok good job!

Test #13:

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

input:

5 136
22111
21121

output:

1
2 4

result:

ok good job!

Test #14:

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

input:

401 518
2122122212112221121122221122212212111122222112211121112212211221211211111111111121222112122212122122112112222211212221212211221222212222211212211222221122212221121211112111221112211122121212112222122112122221112111112222121111122111221211212111211222112222112112211112122212111112211221111122...

output:

1263
82 84
87 88
88 90
398 399
396 398
393 395
386 388
388 390
390 392
392 394
383 385
385 387
387 389
389 391
391 393
384 386
386 388
388 390
390 392
381 383
383 385
385 387
387 389
378 380
380 382
382 384
384 386
386 388
372 374
374 376
376 378
378 380
380 382
382 384
384 386
375 377
377 379
379 3...

result:

ok good job!

Test #15:

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

input:

309 504
1122112211111111121121111122122122211211112122111211211212121221121122111212121112222121122211122111222122212112111112111221222111221212111111112112121211211222212212222122212112222222222211122111121112112122111211121222222211221121222111111211222121111221211111112111122111212111221212212211...

output:

769
16 18
14 16
12 14
10 12
19 21
17 19
15 17
13 15
25 27
23 25
21 23
19 21
17 19
16 17
26 28
24 26
22 24
20 22
28 30
26 28
24 26
22 24
29 31
27 29
25 27
23 25
21 23
31 33
32 34
30 32
28 30
26 28
24 26
36 38
34 36
32 34
30 32
28 30
41 43
39 41
37 39
44 46
42 44
40 42
38 40
36 38
34 36
32 34
30 32
43...

result:

ok good job!

Test #16:

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

input:

442 357
1121121122111122112211222222211112121111122111121122121121112212222222121121111111212122122121222222212122211111211112222221112112122222211122212122222221222211221212211122121221111222112222212122122212212221111121122212221122221111212112211212211222112211122212112211122222112222221221111112...

output:

782
2 3
13 15
14 16
12 14
17 19
15 17
18 20
16 18
14 16
21 23
19 21
22 24
20 22
18 20
16 18
23 25
21 23
24 26
22 24
25 27
26 28
24 26
27 29
32 34
30 32
28 30
26 28
34 36
32 34
31 32
40 42
38 40
36 38
34 36
32 34
41 43
39 41
37 39
35 37
33 35
46 48
44 46
42 44
40 42
38 40
36 38
35 36
49 51
47 49
45 4...

result:

ok good job!

Test #17:

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

input:

499 399
2122122112111122122122111112211112121112121112222111211122112222221221221111212221222211111221221211212211212222112221221212212211121212122122211212212222122122111212111212221121222112111122122111112122211212122221222222211221112212221122122112121212211121121222221121112112111112222211211122...

output:

1316
2 3
13 15
14 16
16 18
17 19
15 17
19 21
20 22
26 28
24 26
22 24
21 22
27 29
25 27
23 25
32 34
30 32
28 30
26 28
34 36
32 34
30 32
29 30
38 40
36 38
34 36
32 34
30 32
40 42
38 40
36 38
34 36
32 34
45 47
43 45
41 43
39 41
37 39
35 37
33 35
31 33
44 46
42 44
40 42
38 40
36 38
47 49
45 47
43 45
41 ...

result:

ok good job!

Test #18:

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

input:

36 857
212211211121121112122222121222222222
221221122222212222121112211112221221

output:

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

result:

ok good job!

Test #19:

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

input:

371 54
11122122211122221221111111111112122222112111211111121111111221121212211122121211211112111111121121112122222211121222222211211222211222221222221122211221211211221112222112221121111222122211211211212121112121212111221222221111122222112121112212111121211112222211222222222122212221221221212121212...

output:

1462
2 4
3 5
1 3
6 7
11 13
30 32
28 30
26 28
32 34
33 35
34 36
35 37
36 38
39 41
37 39
43 45
41 43
39 41
50 52
48 50
46 48
44 46
42 44
40 42
58 60
56 58
54 56
52 54
50 52
48 50
46 48
44 46
42 44
59 61
57 59
55 57
53 55
51 53
49 51
47 49
45 47
43 45
41 43
62 64
60 62
58 60
56 58
54 56
52 54
50 52
48 ...

result:

ok good job!

Test #20:

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

input:

209 349
22122112221111121222122221222211222112221112121122122112221222121121212211211111111212111122222211121221221121211111221212111111112221222222212211222222212212221111212112221222211122212121112122222222211222122
1222112122222212222221222212211212221222121222112122211121111211122222212111221122...

output:

598
14 16
12 14
16 18
14 16
17 19
15 17
13 15
18 20
16 18
20 22
18 20
21 23
19 21
17 19
22 24
20 22
23 25
21 23
19 21
25 27
23 25
21 23
26 28
24 26
27 29
25 27
23 25
28 30
26 28
31 33
29 31
27 29
25 27
32 34
30 32
28 30
33 35
31 33
29 31
36 38
34 36
32 34
37 39
35 37
38 40
36 38
34 36
42 44
40 42
38...

result:

ok good job!

Test #21:

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

input:

157 626
1221122121222222211112121122211122212112122222221211221111212112222221221111121212222212112221222121221111222122121112111121111211121221112212221112212122212
22122221221221211212212212111122112122121211212211222112122211121222222212122212121121221211211221212121122211122111112221221111212121...

output:

91
1 3
4 6
5 7
7 9
10 12
8 10
6 8
9 11
12 14
10 12
14 16
12 14
20 22
25 27
23 25
21 23
26 28
27 29
25 27
23 25
31 33
32 34
38 40
40 42
42 43
60 61
76 78
74 76
78 80
76 78
80 82
78 80
81 83
79 81
77 79
82 84
80 82
84 86
82 84
89 91
87 89
90 92
126 128
124 126
130 132
129 130
132 134
131 132
133 135
1...

result:

ok good job!

Test #22:

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

input:

447 512
1211212211222111221122222111212112111212111121221111122121122111111112121222222211222212111211122121111222221112111211112211121221122122121222221212211222112122221211121211222212112221121221211111111221222111211121121122112211122211212112211121121222121111212112112111111122222122121111211111...

output:

814
1 2
3 5
5 7
44 45
52 54
68 70
66 68
70 72
68 70
73 75
71 73
69 71
67 69
72 74
75 77
73 75
71 73
74 76
77 79
75 77
73 75
76 78
81 83
79 81
77 79
75 77
78 80
82 84
80 82
83 85
82 83
84 86
86 88
90 92
88 90
94 96
92 94
95 97
102 104
100 102
98 100
96 98
94 96
97 99
104 106
102 104
100 102
98 100
96...

result:

ok good job!

Test #23:

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

input:

304 553
2222111221212211222222221121121212121212111121212111212212211121121111121222221222211112111111211122212111112111221121211222221222112211212121222212112221111111212121122221222222211121121121221122121212212211212212122121122121121122111211212211221222221211221221211112212222212111111211211111...

output:

609
94 95
97 99
98 100
96 98
99 101
98 99
101 103
100 101
107 109
105 107
103 105
101 103
111 113
109 111
112 114
110 112
108 110
115 117
113 115
111 113
110 111
120 122
118 120
116 118
114 116
122 124
120 122
118 120
244 245
300 302
302 304
287 289
289 291
291 293
293 295
295 297
297 299
299 301
30...

result:

ok good job!

Test #24:

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

input:

300 283
1222222212221212221112211121121112112111122122211121112212221222121112211111111112221121111211112122112222211122222221121221112211212112121122122122212221221212122111211221222211122212222122212111122121111221221222122122222111122121111111211222122221221211211111122221212112221211212222211211...

output:

803
1 2
2 4
28 30
32 34
30 32
35 37
33 35
31 33
29 31
40 42
38 40
36 38
34 36
41 43
39 41
37 39
35 37
33 35
43 45
41 43
39 41
37 39
44 46
42 44
40 42
38 40
45 47
43 45
41 43
49 51
47 49
45 47
54 56
52 54
50 52
48 50
46 48
44 46
53 55
51 53
49 51
56 58
54 56
52 54
50 52
48 50
57 59
55 57
53 55
51 53
...

result:

ok good job!

Test #25:

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

input:

387 146
2211222121111211111222212111121112121122122212112212122212111222212111121211222222111121221221221121112221111122112122211212211222122211122221122211112111211211222211112212222122211122121222212221112122112211122112211112122211122222111221221121122212211221211111211211212211221122212112212212...

output:

450
110 112
108 110
113 115
116 118
114 116
112 114
120 122
118 120
116 118
114 116
122 124
120 122
118 120
116 118
160 162
162 163
218 220
217 218
220 222
219 220
227 229
225 227
277 279
313 315
312 313
319 321
317 319
315 317
314 315
320 322
318 320
316 318
321 323
320 321
322 324
324 326
326 328
...

result:

ok good job!

Test #26:

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

input:

66 369
112112222112111112212111221111122112211221221212111112221112221212
222211122211221212221121111111111212121211122111221221212212121111

output:

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

result:

ok good job!

Test #27:

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

input:

79 896
1212112112112222111112121112111222211112122112221212221111121111111222121211221
1211212212212221111111221121122111111121121121221212111212222211212212111111221

output:

55
8 10
11 13
12 14
10 12
13 15
14 16
20 22
18 20
16 18
15 16
23 24
26 28
24 26
30 32
28 30
27 28
31 33
32 34
30 32
66 68
64 66
62 64
67 69
65 67
68 70
67 68
70 72
68 70
72 74
70 72
60 61
54 56
56 58
58 60
53 55
55 57
57 59
52 54
54 56
56 58
50 52
52 54
54 56
48 50
50 52
46 48
48 50
42 44
44 46
46 4...

result:

ok good job!

Test #28:

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

input:

231 339
112211112111122222122122111122221111222221221111111121222122112211111221121122121121211221121212221221122111221221212222211221122221122222121111122211121121112111212112211211221211111221211222212122212112122112111211212112111122112
111112211221211112112221211122111222222211222122122112111221...

output:

244
12 14
11 12
13 15
51 53
49 51
48 49
53 55
51 53
54 56
52 54
50 52
55 57
54 55
58 60
61 63
62 64
68 70
69 71
67 69
65 67
72 74
70 72
75 77
73 75
76 78
74 76
78 80
76 78
86 88
84 86
82 84
80 82
78 80
87 89
90 92
88 90
93 94
95 96
96 98
103 104
107 109
111 113
113 115
116 117
167 169
173 175
171 17...

result:

ok good job!

Test #29:

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

input:

109 984
2121221222211211121212122121112211121221221122222122111111112121212122112212111222111111221122111121211122112
1111212122211121112222112221112112121111211211111222112112222112121112222112112111221122121122211222112122212

output:

209
105 107
101 103
103 105
99 101
101 103
94 96
96 98
98 100
93 95
95 97
97 99
90 92
92 94
94 96
96 98
89 91
91 93
93 95
82 84
84 86
86 88
88 90
90 92
92 94
81 83
83 85
85 87
87 89
89 91
91 93
80 82
82 84
84 86
86 88
88 90
76 78
78 80
80 82
82 84
84 86
86 88
73 75
75 77
77 79
79 81
81 83
83 85
85 8...

result:

ok good job!

Test #30:

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

input:

33 61
221112222112212211212221112222221
222112222211222112122121112122221

output:

16
5 7
3 5
7 9
10 12
11 13
9 11
13 15
14 16
17 19
15 17
20 22
18 20
26 28
24 26
22 24
20 22

result:

ok good job!

Test #31:

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

input:

402 243
2211121211221211111221122111221221221112121221211211111221221222211212121111122121111211222222211112112122212211122211122121122212211122222221221121112212122221112222111221122212221111211121222112211122211212111111122221122211122122211122121212122212122112211122111211221222112111112121112212...

output:

570
4 6
6 8
5 6
10 12
8 10
6 8
18 20
16 18
19 21
17 19
22 24
23 25
21 23
27 29
25 27
23 25
28 30
26 28
30 32
28 30
31 33
29 31
27 29
33 35
31 33
34 36
32 34
38 40
36 38
34 36
40 42
38 40
42 44
40 42
43 45
41 43
39 41
45 47
48 50
46 48
44 46
42 44
84 86
87 89
85 87
83 85
88 90
89 91
87 89
85 87
90 92...

result:

ok good job!

Test #32:

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

input:

380 225
1122122211112212212122121222211212122222212121112212111221222111121221122112212222212212121122112221122211221211222212211211211212221111211112212112212222111122112211121222222112211122122111112112221211221211112111222221222112112111212121222122212111222122212211112122212111112212112211122222...

output:

774
1 3
2 4
4 6
6 8
11 13
9 11
12 14
15 17
13 15
11 13
17 19
15 17
13 15
194 196
192 194
195 197
196 198
194 196
198 200
201 203
209 211
207 209
205 207
203 205
213 215
211 213
209 211
207 209
205 207
214 216
212 214
215 217
213 215
211 213
209 211
207 209
216 218
214 216
217 219
215 217
213 215
219...

result:

ok good job!

Test #33:

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

input:

310 958
2222122112221211222222112111112211211221122212211121212221221221212122112221121121222222122121212222121222211211211122212112112122121222222111222212112211212121222112212121121212112212212212121112211111212221222212221112221212212221211122222121221112221222222211121122211212212112212111112122...

output:

690
29 31
30 32
28 30
33 35
31 33
36 38
34 36
38 39
40 42
41 43
42 44
44 46
43 44
45 47
49 51
48 49
54 56
52 54
50 52
304 306
306 308
308 310
305 307
307 309
303 305
305 307
300 302
302 304
304 306
297 299
299 301
301 303
303 305
298 300
300 302
302 304
295 297
297 299
299 301
301 303
296 298
298 30...

result:

ok good job!

Test #34:

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

input:

424 565
2121222121112111112211111112121221212221122222221211212112112121122122211222112111222211111122122112111221222211212221211121122212112121112212112121212121121112211111122211122222122212111111112221122122112212222222121112222222211112211212121212221222212121112212212112222111122212211221122111...

output:

1137
2 3
17 19
15 17
18 20
16 18
26 28
24 26
22 24
20 22
18 20
31 33
29 31
27 29
25 27
23 25
21 23
19 21
17 19
28 30
26 28
24 26
22 24
20 22
30 32
28 30
26 28
24 26
22 24
33 35
31 33
29 31
27 29
25 27
23 25
21 23
35 37
33 35
31 33
29 31
27 29
25 27
23 25
36 38
34 36
32 34
30 32
28 30
26 28
24 26
37 ...

result:

ok good job!

Test #35:

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

input:

348 808
1212221222122212121111111122121211221212111111222122112211121211211112222212211111221222221211211212111221111222122111121122112111221111211112222212111221221121221211111221111122121121211212121211222121111212122112222111222122111212221211111212121222121111122112112211221121111112111221211122...

output:

300
54 56
58 60
57 58
60 62
58 60
68 70
66 68
64 66
69 71
70 72
68 70
66 68
140 142
176 177
195 197
193 195
191 193
189 191
187 189
200 201
204 206
209 211
207 209
205 207
203 205
213 215
211 213
245 246
246 248
256 258
257 259
255 257
263 265
261 263
259 261
257 259
264 266
267 269
265 267
263 265
...

result:

ok good job!

Test #36:

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

input:

72 980
212222212121221212221211122121121122212211112212121222121122121121122212
112212121112211212222112122222122112121122211112221112122212112212122222

output:

75
69 71
65 67
67 69
62 64
64 66
60 62
62 64
59 61
61 63
56 58
58 60
54 56
56 58
53 55
55 57
52 54
54 56
50 52
52 54
48 50
45 47
47 49
46 48
39 41
41 43
40 42
37 39
39 41
36 38
35 36
29 31
31 33
26 28
28 30
27 29
22 24
24 26
26 28
19 21
21 23
23 25
25 27
20 22
22 24
24 26
18 20
20 22
22 24
13 15
15 ...

result:

ok good job!

Test #37:

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

input:

51 563
112111212112122112222111111222121121111121212222112
112111122121211121111212221211121222112212112211212

output:

27
11 12
13 14
39 41
41 43
40 41
44 46
42 44
46 47
48 49
32 34
34 36
30 32
32 34
29 31
31 32
21 23
23 25
25 26
19 21
21 23
23 25
20 22
22 24
18 20
20 22
15 17
7 8

result:

ok good job!

Test #38:

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

input:

194 823
11211122111222111211221111212111222111111212221221221111122221221121111111111111111222112221221122221222211121212122221222212221211121121112122222122222111212112112122212122221221121111211222211
2212211222112211211212122211222212221211121221122111111111111222212122111112221211112111122112212...

output:

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

result:

ok good job!

Test #39:

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

input:

218 200
21211222212221121221212121121121211111212222222212212211221111111111221121221211211111122211112222121122222122222121212111221111221122121112221122211121222122112112122222121221211222222211221112212121122211211121121222
2122111222221111211122221121122212221112211221112122211121212221121222221...

output:

351
4 6
37 39
35 37
39 41
37 39
36 37
40 42
41 43
67 69
66 67
68 70
71 73
69 71
73 75
71 73
74 76
72 74
70 72
76 78
74 76
72 74
79 81
77 79
75 77
86 88
84 86
82 84
80 82
78 80
76 78
74 76
87 89
85 87
83 85
81 83
79 81
77 79
88 90
86 88
84 86
82 84
80 82
78 80
76 78
93 95
91 93
89 91
87 89
85 87
83 8...

result:

ok good job!

Test #40:

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

input:

261 918
121221112112122122111121212112212211111121111212111212221112121112121122121112221111222121111222121221222112111212211212212211212122122112122111112222212222212111122111222222211222112122222112122122121121111121222221121112121222212111211122111211111112122212222
111212211121211222212211211212...

output:

645
21 23
23 25
22 23
25 27
28 30
30 31
32 34
39 41
37 39
35 37
44 46
42 44
40 42
38 40
36 38
34 36
46 48
44 46
42 44
40 42
38 40
36 38
50 52
48 50
46 48
44 46
42 44
40 42
39 40
52 54
50 52
48 50
46 48
44 46
42 44
40 42
53 55
51 53
49 51
47 49
45 47
43 45
54 56
52 54
50 52
48 50
46 48
44 46
42 44
58...

result:

ok good job!

Test #41:

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

input:

412 618
1112222122111122221121221122222221121112222212121111111221221222111121122111111122122222112112122121111221121221111221111222121221221121111122111111212122111211221111211211211212211111112222121211222112212121222112121221222122121222211221222112112211222112222121111221212211221122211212222121...

output:

1314
2 4
4 5
8 10
13 15
11 13
14 16
12 14
15 17
14 15
20 21
25 27
58 60
60 62
67 69
70 72
68 70
71 73
69 71
79 81
77 79
75 77
73 75
71 73
80 82
78 80
76 78
74 76
72 74
70 72
82 84
80 82
78 80
76 78
74 76
83 85
81 83
79 81
77 79
75 77
84 86
82 84
80 82
78 80
76 78
85 87
83 85
81 83
79 81
86 88
84 86
...

result:

ok good job!

Test #42:

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

input:

252 461
211122121121212111111222121212221122112221222222121122211112222221122221122121222121221221111222211112111212111122122212122211111221121111112111122111112212212121111222112121111211122211121221221222211122121112111112112122211111221222111122111111112121
111211122112112121212111211111112221111...

output:

838
21 22
251 252
249 251
240 242
242 244
244 246
246 248
248 250
234 236
236 238
238 240
240 242
242 244
244 246
246 248
239 241
241 243
232 234
234 236
236 238
238 240
240 242
242 244
244 246
233 235
230 232
232 234
234 236
236 238
238 240
222 224
224 226
226 228
228 230
230 232
229 231
216 218
21...

result:

ok good job!

Test #43:

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

input:

403 762
1121111121211222121112221221121121112122122211222212211122221221112211212221112212122122122122212211222222212211122121121112122211112222212211112211112122222111112121222211211122111211211112222112211111211111222122222222221112112122111122221211221212211221221112212211121122221221111222212221...

output:

581
1 3
7 9
5 7
12 14
10 12
8 10
6 8
13 15
14 16
12 14
10 12
8 10
16 18
14 16
12 14
10 12
20 22
18 20
16 18
21 23
22 24
20 22
18 20
24 26
22 24
20 22
25 27
28 30
26 28
24 26
38 40
36 38
34 36
32 34
30 32
28 30
26 28
35 37
40 42
38 40
36 38
34 36
32 34
30 32
41 43
42 44
45 47
43 45
47 49
45 47
51 52
...

result:

ok good job!

Test #44:

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

input:

76 510
2222111212221211121221222112212211112211122222112221211122211121122212122122
2122112112212212121222212122121222221221211211121212211122121221222211122111

output:

56
22 24
27 29
30 31
35 37
33 35
36 38
34 36
40 42
38 40
36 38
41 43
39 41
37 39
35 37
42 44
40 42
38 40
43 45
41 43
39 41
44 46
47 49
45 47
43 45
41 43
48 50
50 51
52 53
55 57
53 55
57 59
64 66
62 64
60 62
65 67
66 68
64 66
62 64
68 70
66 68
70 72
68 70
71 73
69 71
67 69
73 75
74 76
72 74
14 16
12 ...

result:

ok good job!

Test #45:

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

input:

336 811
2211111222112221111221212112121111111221121221112122121221212111211122222221222221222221222111121222212121221122222212212122121212122221112222222221121211111212222122122112112121112112211212212122211212222111212212211211222122212222212211221211221212112111122221212111221112111121111122222122...

output:

896
6 8
19 20
22 23
23 25
26 28
37 39
35 37
33 35
31 33
29 31
27 29
36 38
34 36
32 34
43 45
41 43
39 41
37 39
35 37
33 35
31 33
29 31
40 42
38 40
36 38
34 36
47 49
45 47
43 45
41 43
39 41
37 39
35 37
33 35
42 44
40 42
38 40
36 38
49 51
47 49
45 47
43 45
41 43
39 41
37 39
50 52
48 50
46 48
44 46
42 4...

result:

ok good job!

Test #46:

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

input:

363 525
1121111112211122212122112212112111112212221221121112111112212212212221121121122212221111111111212112212122211122211222111121122122122121112222111121121111111211212211112221121112112112111211222112112122112212221212212221112222122211221221112212111222212222111122222221222122221212112111212121...

output:

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

result:

ok good job!

Test #47:

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

input:

134 452
22111112221112112112222121221222212222212221112222112212122221222121112212112221122212212121121122221212111211111221221221122122121112
21221111122111211222122122222221222221111122211222112122122122122122112112211121122212211221211112212121122222212211121212221122221112

output:

105
6 8
4 6
19 21
26 28
28 30
29 31
30 32
31 33
33 35
34 36
35 37
36 38
37 39
113 115
127 129
125 127
121 123
120 122
118 120
117 118
108 110
110 111
104 106
106 108
108 110
102 104
104 106
106 108
108 109
100 102
102 104
104 106
106 108
99 101
101 103
103 105
105 107
98 100
100 102
102 104
104 106
...

result:

ok good job!

Test #48:

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

input:

134 865
22212222211222112122112221122122221111121221112211122121112211222212121222222122222112212122212122111121221221121222112212212212112222
22122112121212112121121112222222122212112221221222122222111111221211122212122121222212221221222222212112112222122211211112221112121222

output:

126
46 47
50 52
51 53
49 51
53 55
52 53
57 59
55 57
53 55
58 60
56 58
54 56
61 63
59 61
57 59
55 57
62 64
60 62
58 60
56 58
63 65
64 66
66 68
71 73
96 98
101 103
99 101
104 106
102 104
100 102
98 100
103 105
101 103
106 108
104 106
107 109
110 112
108 110
112 114
110 112
113 115
111 113
109 111
114 ...

result:

ok good job!

Test #49:

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

input:

274 107
2212222112221112121222212212122212121112121212122111221221221111211211222211211211111122112222112112122122222211222111211222212221121122112211121211112221221121221111212222121211122111222212221222211112122222111212211111112121112222222221212222112222211122211222121111121122
22122212111121221...

output:

682
55 57
57 59
58 60
63 65
61 63
59 61
66 68
64 66
62 64
69 71
67 69
65 67
63 65
61 63
70 72
68 70
71 73
69 71
72 74
75 77
73 75
71 73
78 80
76 78
74 76
85 87
83 85
81 83
79 81
77 79
75 77
73 75
86 88
84 86
82 84
80 82
78 80
76 78
89 91
87 89
85 87
83 85
81 83
79 81
77 79
75 77
90 92
88 90
86 88
84...

result:

ok good job!

Test #50:

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

input:

414 808
2121221211222112211122122222211112211121122211221122212121222222222222212111121212122112111112121111222222111212122122122222211211112121221221111211121112221112121112122212112222212212122221222222121211112122212212211111222212112112112111221221222121222112112211222121222121122122111121211212...

output:

971
346 348
345 346
347 349
350 352
348 350
346 348
351 353
349 351
352 354
351 352
354 356
353 354
356 358
355 356
361 362
364 366
363 364
367 369
365 367
370 372
368 370
366 368
364 366
372 374
370 372
368 370
366 368
373 375
371 373
369 371
367 369
374 376
375 377
373 375
371 373
369 371
377 379
...

result:

ok good job!

Test #51:

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

input:

482 170
1121222222122111121212122122122212121122112211212221211221221222211221211212112222122121121212211111111221112221122112111222212221211112221122222121122222121211121111121221121121112111112222112221122212111211122212111111221112221112121211212112122111121221112121212221122221211222222211111211...

output:

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

result:

ok good job!

Test #52:

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

input:

117 25
112212222221112122221111222222122211212111122122111121122211121211121222122221122111111211222122221221211121222111222
111122222122122111222212111122112222211121122212122212212211111121112222122212112121211222111112221211112112221222222

output:

78
24 25
52 53
54 56
55 57
57 58
60 62
58 60
89 91
87 89
85 87
90 92
91 93
89 91
111 113
113 114
109 111
111 113
110 112
107 109
109 110
103 105
105 107
107 109
100 102
102 104
104 106
106 108
101 103
103 105
98 100
97 98
95 97
81 83
80 81
77 78
68 69
64 65
47 49
49 51
48 50
44 46
46 48
34 36
36 38
...

result:

ok good job!

Test #53:

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

input:

344 865
1111222222222122212121112221111122221122111221111112222122112112111211221222222221211111121121211222121122112222121112212222212221111121122221222111211112212111121222211111121111221122121122112112212221122221222121222121222221212221221122211111111211121112121212212112112222122121111122212212...

output:

505
3 5
2 3
69 71
67 69
65 67
63 65
70 72
73 75
71 73
69 71
89 90
91 93
94 95
96 98
97 99
98 100
100 102
108 110
152 154
150 152
154 155
155 157
160 162
158 160
156 158
162 164
160 162
158 160
163 165
161 163
164 166
165 167
163 165
172 174
170 172
168 170
177 179
175 177
173 175
171 173
169 171
167...

result:

ok good job!

Test #54:

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

input:

416 266
1122121211112212122212111111222122221212211112211122211222222112212211121221121212112211211111222222211212111222121112111112211212111221212112222122112222211112122121111111211111211121212111212111121121212121221122222221222222121221212221111212121212212212212212211121121222211111112112121122...

output:

837
1 3
2 4
4 6
3 4
6 8
5 6
11 13
9 11
7 9
12 14
10 12
8 10
6 8
14 16
12 14
10 12
8 10
16 18
14 16
12 14
11 12
17 19
15 17
13 15
19 20
20 22
27 29
25 27
23 25
21 23
28 30
26 28
24 26
22 24
29 31
27 29
25 27
31 33
29 31
32 34
30 32
28 30
26 28
33 35
31 33
34 36
33 34
36 38
177 179
175 177
174 175
181...

result:

ok good job!

Test #55:

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

input:

122 942
11212212222212221121121211211221222121122222221111121111122222222122212111221222112112111112112221121211221111221212221221
11122212121221112122222112111122211222121111111222222222122111211222121212211121221221121112212222221212112111221212212211

output:

120
56 58
58 60
103 105
101 103
99 101
104 106
109 111
107 109
111 112
112 114
114 116
116 118
119 121
96 98
92 94
94 96
83 85
85 87
87 89
89 91
91 93
86 88
88 90
90 92
80 82
82 84
84 86
86 88
79 81
81 83
83 85
78 80
80 82
82 84
76 78
78 80
80 82
75 77
77 79
79 81
71 73
73 75
75 77
77 79
69 71
71 73...

result:

ok good job!

Test #56:

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

input:

45 417
111112112221111122222222221212211212112122121
212122222212121122211111211211121221122121122

output:

55
4 6
2 4
1 2
7 9
5 7
3 5
8 10
6 8
9 11
7 9
5 7
15 17
13 15
11 13
9 11
7 9
16 18
14 16
12 14
10 12
8 10
17 19
15 17
13 15
11 13
9 11
18 20
16 18
14 16
12 14
10 12
19 21
17 19
20 22
18 20
16 18
14 16
12 14
21 23
19 21
22 24
20 22
18 20
16 18
14 16
24 26
22 24
20 22
18 20
44 45
42 44
36 38
31 33
33 3...

result:

ok good job!

Test #57:

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

input:

440 881
1111221112211221121112222212222122221122112221212122121122212221111221221221222212121112112121112221122112112212212211212121122112112112121211221112112221111121121111112112121222212112222112222122221121212112222211111212211222221221111221112221212212122112111212112211211211221112211121222222...

output:

625
9 10
12 14
10 12
13 15
16 18
15 16
20 22
18 20
16 18
21 23
19 21
17 19
22 24
20 22
23 25
21 23
24 26
22 24
26 28
24 26
23 24
27 29
25 27
28 30
26 28
29 31
31 33
32 34
37 39
38 40
41 43
42 44
43 45
45 47
44 45
135 136
139 140
141 143
149 151
147 149
145 147
143 145
151 153
149 151
147 149
157 159...

result:

ok good job!

Test #58:

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

input:

284 884
21111212121111112111222121122122212122111222212122212211221121211111212211121222112222122212122121211112121122222122222211111112111122212222122221111121221212222221221212221111212211111121111211111222112221212121122112211211111222211122221121121222111212211111122221111121111122211211
1112122...

output:

794
7 8
15 17
13 15
11 13
19 21
17 19
15 17
13 15
20 22
18 20
16 18
14 16
21 23
19 21
23 25
26 28
24 26
22 24
27 29
26 27
29 31
27 29
282 284
279 280
277 279
264 266
266 268
268 270
270 272
272 274
274 276
271 273
273 275
262 264
264 266
266 268
268 270
270 272
272 274
265 267
267 269
269 271
271 27...

result:

ok good job!

Test #59:

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

input:

422 324
1122222121221221121221212122111112212121211222221221212112222221112112212211111221112221222212122122211121121111211111221222122221122121122221122221221221122122222212222121111121211212222121222222111112212111112221221112111111121122111221121222222112211211222212222121122112221121111112112212...

output:

888
1 3
3 4
111 113
109 111
117 119
118 120
116 118
114 116
112 114
110 112
120 122
118 120
116 118
114 116
121 123
119 121
122 124
125 127
123 125
121 123
124 126
126 128
127 129
130 132
128 130
131 133
130 131
133 135
131 133
136 138
137 139
135 137
138 140
139 141
142 144
140 142
143 145
141 143
...

result:

ok good job!

Test #60:

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

input:

247 857
1112211211222111211122112111221222122212221111212121121212221211112122222111221211121121121122221211112221221122121212222122122111212112121211221112112111211222211221122221112222222111122112221122111111121111111211112122112121122211212212121122221
22111112221122221222211122212211112111221111...

output:

583
2 4
3 5
1 3
9 11
10 12
15 17
20 22
18 20
16 18
14 16
19 21
28 30
26 28
24 26
22 24
20 22
18 20
16 18
23 25
21 23
30 32
28 30
26 28
24 26
22 24
20 22
18 20
27 29
25 27
32 34
30 32
28 30
26 28
24 26
22 24
20 22
31 33
29 31
27 29
34 36
32 34
30 32
28 30
26 28
35 37
33 35
31 33
29 31
36 38
34 36
32 ...

result:

ok good job!

Test #61:

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

input:

272 376
22221122111211111222211222221222212122221221111222212222222122211212112222111121222211222221222212121221112122211211221221112111111212121212211122222122222221222222211112121221212211221122222111222221111121211221112221211112122221222121211211211212111121222122111111122111
2222211111111222212...

output:

586
5 7
16 18
17 19
19 21
23 24
139 141
143 145
141 143
144 146
142 144
145 147
146 148
144 146
147 149
149 151
266 268
265 266
269 271
271 272
260 262
262 264
259 261
261 262
257 259
256 258
255 257
248 250
250 252
252 254
254 256
253 255
246 248
248 250
250 252
252 254
243 245
245 247
247 249
249 ...

result:

ok good job!

Test #62:

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

input:

456 295
1221111112111221222222121212221222112212111112212221212122122122122211211211122122222212221211122222212211111212121111122222112212121211221121212221122112111221211122121121212121212112122112221122211212111221221211221122211111221211221112221122111112111121222121112112112221222221211122221112...

output:

952
8 10
6 8
12 14
10 12
8 10
7 8
13 15
11 13
9 11
15 17
13 15
16 18
14 16
12 14
10 12
18 20
16 18
27 28
28 30
30 32
31 33
32 34
35 37
33 35
36 38
34 36
38 40
36 38
45 47
43 45
41 43
39 41
37 39
35 37
47 49
45 47
43 45
41 43
39 41
37 39
49 51
47 49
45 47
43 45
41 43
39 41
51 53
49 51
53 55
55 57
56 ...

result:

ok good job!

Test #63:

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

input:

463 947
1111221121222222122211112221111122122112211211211211222221121112121121122222211121121122221212212122112121212112111112112222211222121121121111111211121121111111112222112121221121122112111211222221122221222112111221212122221211221111221211222121221111221111222111212122111111121212222111112221...

output:

1304
3 5
4 6
7 9
5 7
9 11
8 9
10 12
31 33
33 34
34 36
35 37
38 40
62 64
64 66
67 69
65 67
70 72
68 70
72 74
82 84
80 82
78 80
85 87
83 85
86 88
87 89
85 87
93 95
91 93
89 91
87 89
95 97
93 95
91 93
89 91
98 100
101 103
100 101
103 105
101 103
105 107
104 105
107 109
105 107
110 112
108 110
116 118
1...

result:

ok good job!

Test #64:

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

input:

242 384
11212222111222212221111221121211122111212121221121112222122212112222212112112222221112211222112221211221112112212121212122121212211211222212111111221221211211122212122211112212112222221221212112111212222222212121212122211111121121222222112211
2111112111211212221221112211112212112211212221222...

output:

222
1 3
51 53
53 54
54 56
56 58
57 59
58 60
60 62
63 65
64 66
65 67
70 71
73 74
76 77
85 86
88 90
86 88
108 110
106 108
109 111
111 113
110 111
113 115
111 113
115 117
113 115
112 113
117 119
115 117
113 115
119 121
117 119
115 117
120 122
122 124
159 160
165 167
171 173
175 176
178 180
227 229
225 ...

result:

ok good job!

Test #65:

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

input:

256 235
2122221122211122222211121122211121221212112122111121221212121122221112222111121122121221222122122221121111122221222221212112121112122121212222222111111222121111222121212212112221222122121221121111121211122222122121222111111122121112212221122211122122122221
21111112221121221112112212111122221...

output:

391
80 82
83 84
84 86
85 87
87 89
88 90
86 88
89 91
91 93
92 94
90 92
94 96
95 97
93 95
96 98
97 99
95 97
100 102
106 108
104 106
102 104
101 102
107 109
105 107
103 105
108 110
109 111
107 109
105 107
111 113
109 111
107 109
112 114
110 112
113 115
111 113
114 116
115 117
113 115
128 130
130 132
12...

result:

ok good job!

Test #66:

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

input:

464 855
1112211221222222211221211111121111222222121212122122212211221211221222122222111121122111221221111112212111112122221122222212212212222212221211122211121121122221222112121112212212222121222221112211221212211121121221212121222212211212121122212212121111111222111211222222221112212111212122222112...

output:

1327
2 4
1 2
3 5
6 8
4 6
2 4
29 30
33 35
31 33
34 36
32 34
36 37
58 59
87 89
89 90
91 93
98 100
96 98
99 101
98 99
101 103
99 101
107 109
105 107
103 105
101 103
109 111
107 109
105 107
103 105
110 112
108 110
111 113
110 111
115 117
116 118
117 119
123 125
456 458
455 457
452 454
454 456
447 449
44...

result:

ok good job!

Test #67:

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

input:

321 947
1211121122121112121121212222111212112211121222222212221222121121111122212122221222121111211122112221111122221121122221122122121122212221122121222211112111112212112211221111211111211222212212112222221111221111122211121212212212112211121121221221122222222112112111112221212211211211122211211112...

output:

392
4 6
3 4
8 10
6 8
14 16
13 14
16 18
19 21
17 19
15 17
21 23
19 21
23 25
21 23
24 26
22 24
20 22
25 27
23 25
26 28
24 26
30 32
28 30
26 28
32 34
30 32
29 30
35 37
33 35
31 33
36 38
34 36
32 34
30 32
40 42
38 40
36 38
34 36
33 34
42 44
40 42
38 40
43 45
41 43
39 41
37 39
44 46
42 44
46 48
180 182
1...

result:

ok good job!

Test #68:

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

input:

268 726
1111222212222222121122221211122121122221112222222121212122211211212121221221112122121222111221222112111212122121212121221111122122111222122212112121121121112221111212212221122212112111221122221222112221121212221211221111112111112121222212122112112222122212212121212212
11112112111221211121221...

output:

497
198 200
200 201
232 234
230 232
228 230
226 228
224 226
222 224
220 222
227 229
225 227
229 231
234 236
232 234
230 232
228 230
226 228
231 233
236 238
234 236
232 234
230 232
228 230
233 235
238 240
236 238
234 236
232 234
230 232
239 241
237 239
235 237
242 244
240 242
238 240
245 247
243 245
...

result:

ok good job!

Test #69:

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

input:

159 708
112122221111122221211112111122111111121111222212111112111122112222112211111112111112221211111212122111221121222111111222211122122122222111211212222122111121112
111122211211121211121211111111122211112112122222212212211111211212111122121212212112122211212221111211221122111211122222112222111212...

output:

235
52 54
57 59
55 57
53 55
51 53
58 60
56 58
54 56
61 63
59 61
57 59
55 57
63 65
61 63
76 78
74 76
82 84
80 82
78 80
76 78
83 85
81 83
79 81
84 86
82 84
80 82
78 80
86 88
84 86
97 99
95 97
93 95
91 93
89 91
87 89
85 87
83 85
81 83
92 94
90 92
88 90
86 88
94 96
92 94
90 92
88 90
101 103
99 101
97 99...

result:

ok good job!

Test #70:

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

input:

252 78
221121122112221221111121211112121221121212221211212111111111112212122111111212212112212221122111122212222211212122211111111211112111111121122121211121211212122212121212211222122212211111121122111112212211112122112222121112221221112222112111221212222112
1221122222111112121112211111121222111221...

output:

580
7 9
10 12
11 13
9 11
61 63
59 61
57 59
62 64
60 62
67 69
65 67
63 65
61 63
59 61
64 66
62 64
77 79
75 77
73 75
71 73
69 71
67 69
65 67
63 65
61 63
66 68
64 66
74 76
72 74
70 72
68 70
66 68
79 81
77 79
75 77
73 75
71 73
69 71
67 69
65 67
76 78
74 76
72 74
83 85
81 83
79 81
77 79
75 77
73 75
71 73...

result:

ok good job!

Test #71:

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

input:

188 305
12222121122111121122222211222211221212112122212112112212112221212122222111122111121111111111221111122112122212211122222112112221111211211221112111122111111221212221212212112112112222122222
2122112122111211221122221211212211121212112122211111112121222212121211121222222211212111111222112112212...

output:

194
1 2
18 19
98 100
97 98
102 104
100 102
104 106
103 104
113 115
114 116
116 118
133 135
136 138
138 139
141 143
146 148
144 146
142 144
147 149
145 147
144 145
154 156
152 154
150 152
148 150
155 157
153 155
151 153
149 151
157 159
155 157
153 155
159 161
157 159
155 157
154 155
166 168
164 166
1...

result:

ok good job!

Test #72:

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

input:

451 381
2122121211221222121122122211122222122222221212222112211121211212221211222212112222121212112122222211212211212121222221121211212211121121211222211112122221122221212121222212211221211112222121122111211212111121111221112222122221121111222121212211121121122222111122112111211212122121212221221222...

output:

849
2 3
323 325
325 327
326 328
333 335
335 336
336 338
337 339
338 340
339 341
343 345
341 343
344 346
348 350
346 348
353 355
351 353
349 351
347 349
345 347
350 352
348 350
359 361
357 359
355 357
353 355
351 353
349 351
347 349
352 354
358 360
356 358
354 356
360 362
361 363
359 361
363 365
364 ...

result:

ok good job!

Test #73:

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

input:

239 584
22211122211121121212121122121112121121222121222212111211212211212111112211222221122122212221221222212221212112221221122221212222122221111122122121122212221112221122121221122121221111121212221212221111221221111222221211212221111212222222221
2221212221212211222111212222121221121111122211212121...

output:

333
5 7
7 9
11 13
9 11
14 16
12 14
11 12
16 18
14 16
13 14
18 20
16 18
14 16
20 22
18 20
17 18
23 25
21 23
19 21
24 26
22 24
20 22
18 20
26 28
35 37
33 35
31 33
29 31
27 29
25 27
23 25
30 32
28 30
37 39
35 37
33 35
31 33
29 31
27 29
25 27
32 34
30 32
39 41
37 39
35 37
33 35
31 33
29 31
27 29
38 40
3...

result:

ok good job!

Test #74:

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

input:

331 115
1212121111112121121121121211112211211111111111221212111122211222222111212222112122212211222221121221111221122111121212212211112211112121221122211222222222212121212111122112112111112121121222122111221221122112122211221211221122211212121121221121122212112212211111222221221122112222212111122122...

output:

1090
11 13
9 11
7 9
5 7
13 15
11 13
9 11
16 18
14 16
12 14
19 21
17 19
15 17
13 15
22 24
20 22
18 20
16 18
14 16
24 26
22 24
20 22
18 20
16 18
29 31
27 29
25 27
23 25
30 32
28 30
26 28
24 26
22 24
33 35
31 33
29 31
27 29
25 27
46 48
44 46
42 44
40 42
38 40
36 38
34 36
32 34
30 32
28 30
26 28
24 26
4...

result:

ok good job!

Test #75:

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

input:

484 949
2222111221121222111212122122222111112222221112111111211122211221112222212122111221121221222112212122211222212222121222221121222122122221121111111221112112111111211212112122212212211212122111212122111212111221112112121212121212211211122112112121211211121221111122211121212211212211222111212222...

output:

1354
162 164
160 162
164 166
167 169
165 167
169 171
167 169
170 172
168 170
166 168
171 173
174 176
172 174
170 172
173 175
176 178
174 176
172 174
177 179
175 177
180 182
178 180
176 178
185 187
183 185
181 183
179 181
189 191
187 189
185 187
191 193
189 191
193 195
191 193
194 196
192 194
190 192...

result:

ok good job!

Test #76:

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

input:

463 392
2222111122111122222112221221121122222222211221111122111222111211211221112221212211122122121221212211222121111221212222112221222112221212211122222122221112211211112111122111121222122211222221221222212212111111222112221222212122121212222222112112122112122211221221211222211121111122121122212122...

output:

1152
13 15
14 16
12 14
15 17
16 18
20 22
18 20
21 23
22 24
20 22
24 26
25 27
28 30
26 28
31 33
29 31
27 29
32 34
30 32
28 30
33 35
34 36
32 34
35 37
36 38
34 36
37 39
36 37
38 40
40 41
42 44
49 51
50 52
54 56
52 54
55 57
63 65
61 63
59 61
57 59
67 69
65 67
63 65
61 63
71 73
69 71
67 69
65 67
72 74
7...

result:

ok good job!

Test #77:

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

input:

170 178
11111222222112212112122221111222221221121221221211221211112111112221212111221111121121222212212112212111121211211112212221221111221122221122111111211211222221211111112211
1212212221212211211221111111121122212211111121212121121221221121221112122212111112112222112221121112121212221111211121112...

output:

294
4 6
2 4
5 7
6 8
4 6
7 9
8 10
9 11
12 14
11 12
13 15
18 20
16 18
14 16
20 22
21 23
168 170
167 169
159 161
161 163
163 165
165 167
167 168
157 159
159 161
161 163
163 165
165 167
156 158
158 160
160 162
162 164
164 166
155 157
157 159
159 161
161 162
154 156
156 158
158 160
153 155
155 156
150 15...

result:

ok good job!

Test #78:

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

input:

52 833
1122211111222221122222221221122212212122221211121122
1221122111221212122111212122112222221122222121212222

output:

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

result:

ok good job!

Test #79:

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

input:

289 337
2212212212211212221122222221211112121121212121221121222112212121121222122122121112212222212121221212121222111112222111211111121112222211111121212221222211221212111121111221121211112121122222121212211212121112111112212221211212112211112111122222221121111111112212212211222221211221122112111
22...

output:

714
180 181
181 183
184 186
185 187
183 185
203 204
206 208
205 206
212 214
210 212
208 210
213 215
211 213
209 211
207 209
215 217
213 215
211 213
216 218
214 216
217 219
215 217
213 215
219 221
227 229
225 227
223 225
221 223
233 235
231 233
229 231
227 229
225 227
223 225
228 230
239 241
237 239
...

result:

ok good job!

Test #80:

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

input:

275 642
22211221221111122222212111222212222111212212211221211111121221112222211211211112122212211121112121212212121112222112122122121112121222211221122212212222211211111221212212122212112122112222222212111211121121211112111121121212122211111121122212222211211122211112211111122111221
2112111111222121...

output:

628
252 253
271 273
270 271
274 275
261 263
263 265
265 267
255 257
257 259
249 251
246 248
248 250
245 247
247 249
243 245
245 247
244 246
239 241
241 243
243 245
242 244
240 242
238 240
235 237
237 239
228 230
230 232
232 234
234 236
236 238
227 229
229 231
231 233
233 235
235 237
226 228
228 230
...

result:

ok good job!

Test #81:

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

input:

274 934
1112211122121111121221212211111121111211221222212222121222112121212211212111222221121211111221112122221212222212212112222121122221121212212122121112211212111221221112112221222122121212111112221211212122212221122222111111112121211121211212122212221111111121111221212221121221
22221212122111111...

output:

457
2 4
3 5
1 3
7 9
5 7
3 5
8 10
6 8
4 6
10 12
8 10
6 8
16 18
14 16
12 14
10 12
8 10
18 20
16 18
14 16
12 14
10 12
19 21
17 19
15 17
13 15
11 13
31 33
36 38
34 36
32 34
39 41
37 39
35 37
33 35
40 42
38 40
36 38
34 36
42 44
40 42
38 40
37 38
43 45
44 46
42 44
40 42
122 123
268 270
271 273
269 271
260...

result:

ok good job!

Test #82:

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

input:

230 182
21112111222221222221121121121111212221112112111122212222212111121221211222222212121122112211212211211122221221111111221121222221122112221111111212211121111122121111121212122122211111222211221111222122222222111221112112211221111122
1212122111122212122221212221211212112222122222122211111112211...

output:

286
4 5
7 9
8 10
6 8
26 28
31 33
29 31
27 29
33 35
31 33
29 31
34 36
32 34
35 37
34 35
39 41
37 39
42 44
40 42
38 40
47 49
45 47
43 45
41 43
39 41
48 50
46 48
44 46
42 44
40 42
49 51
47 49
45 47
43 45
42 43
51 53
49 51
47 49
45 47
43 45
52 54
50 52
48 50
46 48
44 46
53 55
51 53
49 51
47 49
45 47
54 ...

result:

ok good job!

Test #83:

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

input:

317 182
2122212211212111112112122222122121121111222211222112122222112112111111121112112111211211222112212111112221112122222222211211121121212121122211211121122211121111212211212222121111212122112122122221112112122122221211121111122112212212122221111222121112212211221121221122211122122212112212211111...

output:

1194
10 11
20 22
18 20
16 18
22 24
20 22
18 20
23 25
21 23
24 26
22 24
25 27
23 25
27 28
28 30
29 31
31 33
34 36
32 34
39 41
37 39
35 37
33 35
40 42
38 40
36 38
41 43
39 41
38 39
42 44
40 42
45 47
43 45
51 52
53 54
77 79
75 77
73 75
71 73
69 71
67 69
65 67
63 65
70 72
68 70
81 83
79 81
77 79
75 77
7...

result:

ok good job!

Test #84:

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

input:

348 517
2221222112221121121122221221111221121112221121121122121112122111121112112111122222221122221111211121221112211112112222222122211211122212112212111211121222121121121121112212122111212122122221221222211122111221212111212111212211222222111111212221211122221121222111211112111111221222122121211112...

output:

743
110 112
113 115
111 113
115 117
113 115
117 119
115 117
346 347
344 345
341 342
329 331
331 333
330 332
324 326
319 321
321 323
323 325
322 324
317 319
319 321
321 323
316 318
318 320
320 322
315 317
317 319
319 321
312 314
314 316
316 318
318 320
313 315
315 317
308 310
310 312
312 314
314 316
...

result:

ok good job!

Test #85:

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

input:

90 971
111221112211121212221112212221121221122112111221111221121112212221222121121121111221221122
122221212112211122111222111121111221222111112122122112111122121122111112212211121212212222

output:

64
2 4
3 5
7 9
5 7
8 10
6 8
4 6
12 14
10 12
8 10
7 8
14 16
12 14
10 12
9 10
16 18
14 16
12 14
17 19
15 17
13 15
18 20
23 25
21 23
19 21
17 19
22 24
25 27
23 25
26 28
24 26
50 52
51 53
54 56
59 61
62 63
86 88
85 87
83 85
82 84
77 79
79 81
81 82
74 76
76 78
78 80
71 73
73 75
75 76
69 71
71 73
73 75
67...

result:

ok good job!

Test #86:

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

input:

438 523
1112121212111122111121111122112111212111221211221121112122211121221211111222222222221111222122221112122111122121111221111221121112211221222221121211222121222122222121211122212212221211122111222122111222221222112221212212121112122222112221122211111121121221122111222121121111221212212121111211...

output:

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

result:

ok good job!

Test #87:

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

input:

81 478
112121122122121122121111111112212222211112211212212111122111211111112121212212121
122221121212121221112111212112111121111212121112112221121111211222121212122111211

output:

64
2 3
3 5
6 8
4 6
7 9
5 7
9 11
8 9
10 12
12 14
16 18
14 16
18 20
16 18
28 30
26 28
24 26
22 24
21 22
29 31
27 29
25 27
31 33
29 31
27 29
32 34
30 32
67 69
66 67
69 71
68 69
71 73
70 71
74 76
72 74
76 78
74 76
79 80
61 63
63 65
57 59
59 61
61 63
63 64
51 53
53 55
55 57
57 59
59 61
49 51
51 53
48 50
...

result:

ok good job!

Test #88:

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

input:

153 157
212111222111222211212221112211211122112111221111111121122211211111222211122122121111221122122121112121122221122121111111211221122121222221121222111222222
122122111122122121211111222211111122211212221211211221121111212222221121221212122221122222112111112212111212112211122112111122211122221111...

output:

263
5 7
6 8
12 13
51 53
49 51
54 56
52 54
50 52
48 50
46 48
55 57
53 55
56 58
54 56
52 54
66 68
64 66
62 64
60 62
58 60
56 58
65 67
63 65
67 69
65 67
68 70
66 68
64 66
72 74
70 72
68 70
66 68
73 75
71 73
69 71
67 69
75 77
73 75
71 73
76 78
74 76
72 74
70 72
68 70
78 80
76 78
74 76
83 85
81 83
79 81
...

result:

ok good job!

Test #89:

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

input:

453 434
2212221211121122211222111221212222221112122122221112112121112111122121121122222221121222112122112122212221222121112121212222122112121122122222211211111111111112111122112212221221211111212112222221122212222211221211121222112212112211112112112211121121122212222112212211122121222112111221211111...

output:

789
65 66
70 72
68 70
73 75
71 73
74 76
73 74
158 160
163 165
161 163
164 166
162 164
160 162
167 169
165 167
168 170
166 168
170 172
171 173
169 171
167 169
189 190
446 448
448 449
451 453
450 451
439 441
441 443
443 445
442 444
431 433
433 435
435 437
437 439
439 441
441 443
434 436
436 438
438 44...

result:

ok good job!

Test #90:

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

input:

496 670
1211121111122111221111221111212212121212221122222212222121212121121121212111221112111112211112221211112121222122211221212222221212121122212222221112111221222222111112121222221111122222112221212212212112222221121211212112212122212222212121121221111222221121221111211111222211111221211212222122...

output:

1102
5 6
10 12
8 10
6 8
11 13
9 11
7 9
15 17
13 15
11 13
9 11
16 18
14 16
12 14
11 12
21 23
27 29
25 27
23 25
29 31
27 29
25 27
30 32
28 30
32 34
30 32
29 30
34 36
32 34
31 32
36 38
34 36
32 34
38 40
36 38
39 41
37 39
35 37
33 35
43 45
41 43
39 41
37 39
45 47
92 94
101 103
100 101
103 105
106 108
10...

result:

ok good job!

Test #91:

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

input:

10 526
2221221221
2122221221

output:

1
2 4

result:

ok good job!

Test #92:

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

input:

180 555
221221211211221121121212212222211121122111122212112211122211222212211211221122221112212111212221121211212211122211121121122222111221121122221222211111121222212112222112112121121211
122111122212221122212221111111221112222122111222221121222211211112111211222122221121221112121112111222112222212...

output:

149
18 20
20 22
19 20
22 24
23 25
21 23
25 27
23 25
42 44
49 51
50 52
54 56
53 54
55 57
56 58
59 61
57 59
60 62
58 60
61 63
109 110
114 116
113 114
117 119
115 117
120 122
118 120
117 118
121 123
123 124
178 180
176 178
178 179
168 170
170 172
172 174
165 167
167 169
164 166
166 168
163 165
165 167
...

result:

ok good job!

Test #93:

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

input:

489 819
2111111211211211121222211221221122121211111212121121111112112122121122222111212112212222212122211211112111121211221121121112212111211121212222121222111111112211112121121212122121212221211111121122212121112111222112211222122211221212121112211122121212112212112221121112112212211121222121221211...

output:

1457
9 11
12 14
11 12
16 18
14 16
12 14
18 20
16 18
14 16
13 14
24 26
25 27
28 30
31 33
32 34
30 32
34 36
32 34
36 38
34 36
33 34
42 44
40 42
38 40
36 38
35 36
44 46
42 44
40 42
46 48
44 46
42 44
41 42
49 51
47 49
45 47
56 58
54 56
52 54
50 52
48 50
46 48
44 46
59 61
57 59
55 57
53 55
51 53
49 51
47...

result:

ok good job!

Test #94:

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

input:

167 414
22222122212212121111122212211121121122211212121222112112221211221212222222212112121222222111211222121112112221111122212112111121212222222221122122122111112111222221121
2211211222111221212122222211122212211111221121111221222212221112122111222121121112222121221222122211121211122222221122212211...

output:

178
32 34
35 37
36 38
34 36
114 115
125 127
123 125
121 123
127 129
129 131
128 129
130 132
163 165
165 167
162 164
161 163
160 162
159 161
155 157
157 159
159 160
148 150
150 152
152 154
154 156
156 158
149 151
151 153
153 155
145 147
147 149
149 151
151 153
146 148
148 150
150 152
143 145
145 147
...

result:

ok good job!

Test #95:

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

input:

374 365
1222211122112221112112222212212111221111221111121212212221111122111222212211121111221211222111112121111221212212211122212212212211212211211111112111121121121122111212221121122121222222221211111222111112211121211122221111122112211211212221121122221112121121122112221111212111211111221111111112...

output:

595
12 13
66 68
67 69
68 70
70 71
72 74
81 83
95 97
97 99
102 104
100 102
103 105
102 103
108 109
115 117
116 118
114 116
117 119
119 121
120 122
118 120
122 124
143 145
141 143
139 141
148 150
146 148
144 146
151 153
149 151
147 149
145 147
143 145
141 143
154 156
152 154
150 152
148 150
146 148
15...

result:

ok good job!

Test #96:

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

input:

469 834
1222211111122121211211122121221112112211121212211121112221111112122222111211111112222122111122222221222112121112212212121121121221122212122221121222121212221211122111122121212222112112222111221222212122211121221221222211222122112112211122122221222221112222122112211212122111112112212111221212...

output:

1007
22 24
23 25
25 27
24 25
27 29
28 30
32 34
35 37
33 35
36 38
40 42
45 47
43 45
41 43
39 41
37 39
42 44
49 51
47 49
45 47
43 45
41 43
44 46
53 55
51 53
54 56
52 54
50 52
55 57
53 55
62 64
60 62
58 60
56 58
54 56
52 54
64 66
62 64
60 62
58 60
56 58
55 56
65 67
63 65
61 63
59 61
66 68
64 66
62 64
6...

result:

ok good job!

Test #97:

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

input:

52 77
1121111121222122122121212111121121212121112222211112
1121211121111121222121112212212111212222121221111221

output:

32
7 9
5 7
9 11
41 43
40 41
42 44
44 46
51 52
47 49
49 50
37 38
35 37
33 35
30 31
25 27
27 29
18 20
20 22
22 24
24 26
26 28
23 25
16 18
18 20
20 22
22 24
24 26
12 14
14 16
16 18
15 17
13 15

result:

ok good job!

Test #98:

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

input:

334 345
2111211112211221121111211212121122221121222122221211112222221222111111211111111122222212211211111112212211111211211221111111211222112211212111122211121122112212121221111121221211122111211211111222222122121212121111211111112122212212221122111122112112212112212212221221222212222112211121222212...

output:

1168
4 5
24 26
79 81
77 79
75 77
80 82
78 80
81 83
79 81
82 84
80 82
83 85
84 86
82 84
86 88
85 86
87 89
90 92
88 90
86 88
98 100
96 98
94 96
99 101
97 99
95 97
93 95
91 93
89 91
101 103
99 101
97 99
95 97
93 95
91 93
102 104
100 102
98 100
96 98
111 113
109 111
107 109
105 107
103 105
101 103
99 10...

result:

ok good job!

Test #99:

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

input:

322 316
1121211111112222221211212112221112211222112211112111111121211212222222222111122211212122121212221212121221212111122221121112122121212111222212221112122221211221112212122111112122112112122112212211212112222111112111222112221111221222121221212212221212111212121221122112212211111122211111221211...

output:

759
1 3
4 5
11 13
9 11
7 9
5 7
12 14
10 12
8 10
14 16
12 14
22 23
23 25
26 28
55 57
53 55
57 59
55 57
60 62
58 60
56 58
62 64
63 65
61 63
59 61
57 59
65 67
63 65
61 63
67 69
313 315
314 316
315 317
317 318
319 321
308 310
310 312
306 308
308 310
310 311
304 306
306 308
299 301
301 303
303 305
305 30...

result:

ok good job!

Test #100:

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

input:

28 491
1122122221222111121112122222
2111212121222221121122222121

output:

16
1 3
21 22
22 24
23 25
24 26
25 27
27 28
13 15
12 14
11 13
8 10
10 12
9 11
7 9
6 7
4 5

result:

ok good job!