QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#796234#7243. Deep Purpledongyc666AC ✓2946ms336232kbC++174.1kb2024-12-01 14:52:592024-12-01 14:53:00

詳細信息

Test #1:

score: 100
Accepted
time: 8ms
memory: 65856kb

input:

11 3
gabacababad
2 8
1 3
6 10

output:

3
0
3

result:

ok 3 number(s): "3 0 3"

Test #2:

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

input:

1 1
a
1 1

output:

0

result:

ok 1 number(s): "0"

Test #3:

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

input:

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

output:

2
2
0
1
5
4
5
6
1
1

result:

ok 10 numbers

Test #4:

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

input:

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

output:

1
2
1
0
2
2
2
0
0
3

result:

ok 10 numbers

Test #5:

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

input:

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

output:

0
0
0
0
0
0
0
0
0
1

result:

ok 10 numbers

Test #6:

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

input:

10 10
krwvaottzq
1 5
5 10
7 8
1 2
3 8
4 8
7 10
1 5
1 7
3 5

output:

0
0
1
0
0
0
0
0
0
0

result:

ok 10 numbers

Test #7:

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

input:

10 10
aaaaaaaaaa
4 5
3 5
3 10
4 10
2 2
2 5
2 6
4 9
2 3
7 10

output:

1
2
7
6
0
3
4
5
1
3

result:

ok 10 numbers

Test #8:

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

input:

10 10
baaaaabaab
2 10
7 8
2 5
1 7
6 6
7 8
1 6
5 6
6 8
5 5

output:

0
0
3
1
0
0
0
1
1
0

result:

ok 10 numbers

Test #9:

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

input:

10 10
aabaacaaba
3 4
9 10
2 10
6 8
2 8
9 10
6 9
7 10
1 7
1 4

output:

0
0
3
0
1
0
0
1
1
1

result:

ok 10 numbers

Test #10:

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

input:

10 10
yvopvopcop
6 9
8 8
5 8
4 6
1 8
1 3
2 3
4 5
5 10
5 10

output:

1
0
0
0
0
0
0
0
0
0

result:

ok 10 numbers

Test #11:

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

input:

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

output:

0
0
0
0
3
0
0
0
0
0

result:

ok 10 numbers

Test #12:

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

input:

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

output:

0
0
0
3
0
0
5
3
0
0

result:

ok 10 numbers

Test #13:

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

input:

10 10
bbcbbcbbcb
3 8
1 4
5 7
4 6
7 7
3 8
4 10
7 9
4 5
3 4

output:

3
1
1
0
0
3
4
0
1
0

result:

ok 10 numbers

Test #14:

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

input:

1000 1000
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa...

output:

223
26
492
437
251
451
292
207
65
254
279
25
454
306
537
28
421
185
319
89
4
133
554
632
308
201
192
694
180
714
236
255
563
38
412
358
521
38
127
554
223
78
362
411
475
134
480
578
433
54
140
79
548
333
429
250
400
694
215
179
115
714
968
31
125
328
60
745
193
545
526
531
17
181
275
830
49
474
432
...

result:

ok 1000 numbers

Test #15:

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

input:

1000 1000
babaabbbaabaababbabbaabbabbababbababbaaaabbbabbbabbaabbaaaaabbbbbbbaabbabababaabaabbbabaababaaaaaabbaabbbaaabbaabbaabbabbbbbabbabbaababbaababaabbabaaababbbaaaaabababbaaabaaaabbabaaaabaabbaabbbbaaaaaaabbbbbaabababaabaabaaabbbbaaaaabaaaabababaaaabbabbbababbabbbbaabbabbabbbaabaaabbababbbbabbb...

output:

4
2
2
0
1
1
1
2
1
1
1
2
2
2
1
1
0
1
2
2
2
0
1
0
0
0
2
3
0
0
2
1
0
1
0
4
10
1
1
1
4
0
0
1
1
0
1
1
3
0
2
3
1
6
3
1
1
8
3
1
1
4
2
2
6
1
1
5
4
2
0
1
2
0
1
0
0
8
2
5
2
2
0
0
3
5
1
0
1
1
2
3
0
2
1
2
1
5
2
0
1
2
2
4
1
1
0
1
0
2
1
4
2
3
2
0
2
1
1
0
2
3
2
0
1
0
1
0
1
0
5
1
1
0
1
2
1
1
3
1
1
1
5
0
4
0
7
2
1
3...

result:

ok 1000 numbers

Test #16:

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

input:

1000 1000
cabaacaabbabacccbaaacbababcaaaaaabcaacbbabcacaacbccbbbcbbbbbacccbbaaacabbbacccbcbbaabcbcbbacbbabaccbbabaababcacccaabcaacabbababbacabbbcaccbbcccbcabaabacacacaacabccacbccabcccbbbccacabccacccacabcaaaacbccbbabaaccabbacbbbbabcbaaaaaacabccbcbabcbaabbaccbcacbaaccbbbacbabcaaccabcbabbbcbbcacaaabaca...

output:

1
0
0
0
1
1
0
0
0
0
2
3
3
0
0
0
0
0
0
0
1
0
0
2
0
0
1
0
0
0
1
2
0
0
0
1
0
0
1
0
1
0
0
0
0
0
2
1
3
1
0
1
0
0
0
0
0
2
1
0
0
0
0
2
0
0
0
0
1
5
2
0
3
0
0
3
1
0
0
1
2
1
1
0
1
3
0
0
1
0
0
1
2
2
1
1
2
2
0
1
1
0
0
0
4
0
1
0
2
0
0
0
0
1
2
0
0
0
1
1
0
3
0
2
2
0
1
0
0
1
0
0
1
1
0
0
1
0
0
0
0
0
2
0
0
1
2
2
2
0
...

result:

ok 1000 numbers

Test #17:

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

input:

1000 1000
atdznrqfwlfbcqkezrltzyeqvqemikzgghxkzenhtapwrmrovwtpzzsyiwongllqmvptwammerobtgmkpowndejvbuwbporfyroknrjoekdgqqlgzxiisweeegxajqlradgcciavbpgqjzwtdetmtallzyukdztoxysggrqkliixnagwzmassthjecvfzmyonglocmvjnxkcwqqvgrzpsswnigjthtkuawirecfuzrbifgwolpnhcapzxwmfhvpfmqapdxgmddsdlhteugqoyepbztspgojbrm...

output:

0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
...

result:

ok 1000 numbers

Test #18:

score: 0
Accepted
time: 10ms
memory: 66256kb

input:

1000 1000
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa...

output:

525
21
428
17
72
737
224
660
416
639
385
316
545
314
513
871
740
588
748
282
312
339
521
113
479
672
319
232
313
362
62
582
547
669
85
119
153
425
85
37
132
350
707
279
525
36
293
419
567
225
377
546
526
422
833
668
312
26
48
407
71
712
109
419
407
596
57
633
181
208
613
227
55
275
271
735
16
441
29...

result:

ok 1000 numbers

Test #19:

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

input:

1000 1000
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa...

output:

165
336
27
13
51
5
31
194
164
205
86
30
270
327
31
136
128
49
85
41
251
15
167
75
56
482
209
41
119
141
207
4
207
82
283
135
20
39
217
219
41
36
189
28
233
45
161
185
81
247
114
161
184
183
77
142
161
49
113
206
217
385
172
28
211
28
36
4
27
133
22
270
139
2
273
284
291
68
7
35
51
26
118
40
199
248
...

result:

ok 1000 numbers

Test #20:

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

input:

1000 1000
tatatatatatatatatatatatatatatatatatatatatatatatatatatatatatatatatatatatatatatatatatatatatatatatatatatatatatatatatatatatatatatatptatatatatatatatatatatatatatatatatatatatatatatatatatatatatatatatatatatatatatatatatatatatatatatatatatatatatatatatatatatatatatatatatatatatatatatatatatatatatatatatata...

output:

63
78
5
2
62
183
14
113
75
19
54
54
1
56
23
67
114
4
53
35
73
12
50
64
52
32
122
30
25
111
29
26
26
38
83
16
41
34
30
63
47
35
61
11
80
95
41
72
38
36
110
44
124
61
69
46
70
60
1
97
77
25
19
0
32
148
46
57
80
76
102
93
111
104
10
106
189
67
136
45
93
53
18
21
75
11
38
14
62
115
1
65
1
35
58
10
36
78...

result:

ok 1000 numbers

Test #21:

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

input:

1000 1000
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa...

output:

165
8
155
376
7
322
185
187
725
756
138
116
398
5
113
561
719
99
114
448
881
43
14
122
62
301
160
23
817
85
292
629
21
444
215
409
92
790
16
117
83
320
153
48
153
902
67
393
224
212
199
299
199
231
19
357
650
106
510
455
224
430
493
256
528
10
451
307
22
14
66
111
302
69
130
100
60
256
126
1
50
267
...

result:

ok 1000 numbers

Test #22:

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

input:

1000 1000
bbbbbbbbbbbbabbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbabbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbabbbbbbbbbbbbbbabbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb...

output:

11
16
4
33
47
49
4
18
25
14
21
0
88
12
22
4
3
27
87
37
17
23
34
159
43
14
44
39
45
10
1
16
54
37
40
63
60
16
3
54
13
50
3
20
18
19
39
4
19
33
37
2
67
14
44
12
8
11
19
48
13
26
21
23
23
65
27
24
61
3
57
67
106
28
7
152
16
51
80
15
15
9
69
25
26
21
22
16
14
16
104
2
52
31
14
22
17
68
6
7
1
131
38
6
19...

result:

ok 1000 numbers

Test #23:

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

input:

1000 1000
kmkmkmkmkmkmkmkmkmkmkskmkmkmkmkmkmkmkmkmkzkmkmkmkmkmkmkmkmkmkmkmkmkmkmkmkmkmkmkmkmkmkmkmkmkmkjkmcmkmkmkmkmkmkmkmkmkmkmkmkmdmpmkmkmkmkmkmkwkmkmkmkmkmkmknkmkmkmkmkmjmkmkfrmkmkvkmkmkmkmkmkmkmkmkmkmkmkmkmkmkmkmkmkmkmkykmkmkmkmkmkmkmkmkmkmkmkmkmkmklkmimkykmnmkmkmkmkmkmkmkmkmkbkmkmxmkmkmkmkmkmkm...

output:

8
8
1
14
6
9
14
12
9
8
6
7
1
16
1
16
9
3
6
14
9
18
5
17
18
6
0
8
2
17
0
12
9
14
1
11
1
11
4
11
22
44
0
0
4
16
17
5
14
1
12
5
12
8
11
10
2
1
10
1
16
0
26
13
1
12
0
39
10
0
0
10
6
22
3
2
2
5
23
22
0
12
8
6
0
18
2
12
27
1
1
0
9
4
12
14
6
0
5
1
8
23
7
17
34
7
1
0
29
1
2
9
0
9
24
22
0
22
9
4
13
4
10
3
18...

result:

ok 1000 numbers

Test #24:

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

input:

1000 1000
bbaabbbaabbbaabbbaabbbaabbbaabbbaabbbaabbbaabbbaabbbaabbbaabbbaabbbaabbbaabbbaabbbaabbbaabbbaabbbaabbbaabbbaabbbaabbbaabbbaabbbaabbbaabbbaabbbaabbbaabbbaabbbaabbbaabbbaabbbaabbbaabbbaabbbaabbbaabbbaabbbaabbbaabbbaabbbaabbbaabbbaabbbaabbbaabbbaabbbaabbbaabbbaabbbaabbbaabbbaabbbaabbbabbbbaab...

output:

71
58
560
218
261
159
27
83
89
452
318
30
187
280
85
79
227
6
246
74
64
3
83
264
21
295
239
194
485
194
597
412
19
232
66
30
261
11
152
66
217
41
43
561
121
44
94
354
166
358
56
209
172
151
57
67
105
172
264
85
37
66
220
30
249
602
115
41
36
168
472
276
146
125
113
0
45
270
190
95
9
207
617
215
36
4...

result:

ok 1000 numbers

Test #25:

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

input:

1000 1000
juttmjuttmjuttmjuttmjuttmjuttmjuttmjuttmjuttmjuttmjuttmjuttmjuttmjuttmjuttmjutdmjuttmjuttmjuttmjuttmjuttmjuttmjuttmjuttmjuttmjuttmjuttmjuttmjuttmjuttmjuttmjuttmjuttmjuttmjuttmjuttmjuttmjuttmjuttmjuttmjuttmjuttmjuttmjuttmjuttmjuttmjuttmjuttmjuttmjuttmjuttmjuttmjuttmjuttmjuttmjuttmjuttmjuttm...

output:

2
152
49
9
159
48
4
15
69
48
57
32
31
29
13
45
44
90
16
74
12
49
49
0
94
9
9
62
6
0
26
74
11
8
162
217
33
132
13
32
161
12
141
29
19
183
21
135
25
84
9
20
183
98
58
20
119
11
45
107
70
59
41
43
104
199
70
79
21
16
15
25
16
76
70
17
66
73
57
5
29
57
158
18
10
39
62
130
22
51
86
23
70
19
47
43
76
35
2...

result:

ok 1000 numbers

Test #26:

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

input:

1000 1000
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa...

output:

347
424
347
182
119
71
140
667
353
385
94
590
283
498
646
679
21
760
235
441
760
336
21
339
822
150
67
46
160
447
180
125
18
405
277
638
417
402
361
397
733
573
169
75
74
455
27
473
90
182
239
442
391
43
97
262
453
375
941
451
477
113
369
264
88
371
266
508
717
81
602
271
224
38
161
152
366
49
620
4...

result:

ok 1000 numbers

Test #27:

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

input:

1000 1000
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa...

output:

596
479
385
758
171
358
190
528
132
153
526
661
914
496
268
123
31
356
468
624
86
83
161
61
578
96
693
422
214
47
716
322
183
650
953
407
84
49
413
179
167
102
39
160
351
272
339
6
54
550
394
356
437
39
405
285
280
217
196
777
410
36
474
176
44
20
180
86
483
95
739
297
288
198
469
390
676
312
353
28...

result:

ok 1000 numbers

Test #28:

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

input:

1000 1000
rxwprnrbpgnszjdolhobflnxhgezszrqiqcfbyzenxrxwprnrbpgnszjdolhobflnxhgezszrqiqwpbyzenxrxwprnrppgnzzjdolhobflnxhgezsprqiqcfbyzenxrxwprnrbpgnczjdolhobflnxhgezszrqijcfbyzenxrxwprnrbpgnjzjdolhobflnxhgezszrqiqcfbyzenxretprnrbpgnszjdolhobflnxhgezszrqiqcfbyzenxrxwppnrbpgnszjdolhobflnxhgezszrqiqgfby...

output:

0
0
0
0
15
0
0
0
2
0
28
0
0
0
0
0
0
0
3
0
0
0
0
0
12
0
0
0
0
0
0
0
0
11
0
5
0
0
1
0
1
0
0
11
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
14
0
0
6
0
0
0
0
0
0
0
21
0
0
10
0
0
0
0
0
0
4
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
2
0
0
0
0
0
0
0
0
0
0
0
0
6
8
0
0
0
0
0
0
0
2
0
0
2
1
7
0
0
0
7
18
7
0...

result:

ok 1000 numbers

Test #29:

score: 0
Accepted
time: 10ms
memory: 70060kb

input:

1000 1000
abbbaababaaaaabaaabbabbabbbaaaaabbababaabaabbbaababaaaaabaaabbabbabbbaaaaabbababaabaabbbaababaaaaabaaabbabbabbbaaaaabbababaabaabbbaababaaaaabaaabbabbabbbaaaaabbababaabaabbbaababaaaaabaaabbabbabbbaaaaabbababaabaabbbaababaaaaabaaabbabbabbbaaaaabbababaabaabbbaababaaaaabaaabbabbabbbaaaaaababab...

output:

262
0
164
60
1
67
41
119
233
75
2
239
41
34
90
0
88
127
36
104
0
31
12
121
203
235
108
53
11
21
31
48
102
29
73
6
59
221
48
90
3
81
83
122
0
37
59
149
4
40
0
4
46
154
16
11
72
53
96
0
152
86
0
104
134
233
5
6
0
200
252
182
3
14
42
188
178
9
1
80
18
1
13
138
43
134
102
142
0
172
6
135
129
72
196
216
...

result:

ok 1000 numbers

Test #30:

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

input:

1000 1000
yfryfyncmenazfeuowqczqradurfntimcghyhrhqsyyfryfyncmenazfeuowqczqradurfntimcghyhrhqsyyfryfyncmenazfeuowqczqradurfntimcghyhrhqsyyfryfyncmenazfeuowqczqradurfntimcghyhrhqsyyfryfyncmenazfeuowqczqradurfntimcghyhrhqsyyfryfyncmenazfegowqczqradurfntimcghyhrhqsyyfryfyncmenazfeuowqczqradurfntimcghyhr...

output:

114
140
90
0
50
11
6
103
1
0
2
19
16
20
170
0
152
24
113
0
0
67
0
123
126
9
0
0
61
61
71
147
0
18
0
71
62
109
35
39
10
21
41
0
5
0
35
72
26
0
22
12
39
94
169
106
50
88
10
62
125
0
150
144
1
22
0
119
0
122
19
63
0
49
0
40
0
115
3
57
61
0
135
125
0
161
31
0
78
150
87
70
84
53
57
4
30
132
53
30
207
43
...

result:

ok 1000 numbers

Test #31:

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

input:

1000 1000
eihpbjdzeslogfapwqiqoomnpwaytzsyysadaqboxveihpbjdzeslogfapwqiqoomnpwaytzsyysadaqboxveihpbjdzeslogfapwqiqoomnpwaytzsyysadaqboxveihpbjdzeslogfapwqiqoomnpwaytzsyysadaqboxveihpbjdzeslogfapwqiqoomnpwaytzsyysadaqboxveihpbjdzeslogfapwqiqoomnpwaytzsyysadaqboxveihpbjdzeslogfapwqiqoomnpwaytzsyysadaq...

output:

523
544
74
336
178
79
105
651
122
401
402
0
37
571
14
105
172
32
123
412
70
399
59
511
150
88
5
0
331
61
173
351
95
139
71
373
245
636
311
135
321
45
372
1
207
279
528
87
514
895
460
173
63
79
549
78
575
46
104
330
78
576
45
545
330
0
764
364
256
165
500
723
184
168
312
102
471
329
0
621
162
656
653...

result:

ok 1000 numbers

Test #32:

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

input:

1000 1000
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa...

output:

35
317
692
180
95
503
420
903
203
3
349
140
445
269
652
99
551
958
341
142
130
639
221
54
210
504
82
289
250
25
31
79
875
46
143
767
587
660
232
270
337
187
281
948
70
436
346
12
698
104
164
273
249
493
542
356
204
581
7
675
652
42
401
604
287
191
243
65
830
987
61
148
97
196
553
92
8
4
46
595
61
41...

result:

ok 1000 numbers

Test #33:

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

input:

1000 1000
huazikqibmkxwtwkpxnfhvikvqpzeyjjemgvruxmetzwpvkmsjoannnwbfvdpgolovboudzcvemefmsrkusxfeuyzrmbrifqudgoqifrzufqxecfykpunkgncwdhuazioqibmcwwtwkpxnfhvikvqpzeyjlemgvrhxmeuzwpvkmsgoannnwbfvdpgolovboudzcvemlfmsrkusxxeuyzrmbdifqudgoqifrzufqxecfiypuvkgncwdhuazioqibmcxwtwkpxnfhvikvqpzeyjjemgvrhxmeuzw...

output:

0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
5
0
0
14
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
1
0
0
34
11
0
0
0
0
0
0
0
0
0
0
0
3
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
12
0
0
0
0
1
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
2
0
0
0
5
0
0
0
0
0
0
1
0
0
0
0
...

result:

ok 1000 numbers

Test #34:

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

input:

1000 1000
ryeukcgaldpfmzmirvyprsyjdkljulrqpovhpiklfmnswpyhiycsoqomxezrmdfvwnfnzvxtvvyifhzriptwxpeootgtunhbedaoimiomvdrshvzqjjtzdmsutpryeukcgaldpfmzmirvyprsyjdkljulrqpovhpiklfmnswpyhiycsoqomxezrmdfvwnfnzvxtvvyifhzriptwxpeootgtunhbedaoimiomvdrshvzqjjtzdmsutpryeukcgaldpfmzmirvyprsyjdkljulrqpovhpiklfmns...

output:

136
0
354
342
238
348
433
375
81
0
34
131
0
143
183
41
283
380
47
0
283
358
351
468
673
29
0
279
90
835
0
0
384
146
319
406
215
183
420
329
674
0
436
611
60
0
21
69
0
0
0
271
246
0
534
173
78
521
114
129
0
174
233
0
465
590
0
678
0
0
0
162
239
0
30
14
145
490
360
136
2
517
0
0
321
23
293
0
544
233
6...

result:

ok 1000 numbers

Test #35:

score: 0
Accepted
time: 166ms
memory: 108732kb

input:

100000 100000
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa...

output:

24868
47574
35732
24305
42151
2959
75703
46357
22453
42275
12848
41761
35245
38603
62816
55
4709
70013
46449
24075
29162
72427
58749
73764
16233
49626
3655
6123
7061
5333
68095
70637
29335
82715
13306
10204
78057
432
74842
36037
21296
36414
41928
15392
56979
24834
41971
10618
14804
14641
69104
14174...

result:

ok 100000 numbers

Test #36:

score: 0
Accepted
time: 1276ms
memory: 195848kb

input:

100000 100000
aaabbabaaaababaaabaaaaabbaabbabaaababbabbaabaaaabbabbbaabaaababbbbababaaaabbaaaaabbaabaaabbbabaaabababaaabaaabaabbbabaaaabababaaaabbbbbaabbaabbbabbabbbabbbbbbababbaaaaaababaaaababbabbaabbabbbbbbabaabbababaaaabaaaaaababbbbbabbbbbbbaabbaaaaabbaabbbbbbbbabaaaaaaabbabbabbabbaabbabaabbbbaab...

output:

3
0
2
0
4
2
1
1
0
3
0
1
0
2
4
2
3
0
3
0
4
0
2
2
3
3
4
0
2
2
1
1
0
1
0
1
0
0
0
2
1
3
2
0
1
0
2
0
3
2
5
0
2
3
0
4
1
1
4
1
6
2
2
1
0
1
0
0
1
2
0
2
1
3
1
2
4
0
1
2
1
1
0
2
5
3
0
0
1
0
3
0
1
3
1
4
0
1
3
2
2
1
2
1
4
0
3
1
2
1
2
0
1
4
1
2
2
0
2
0
0
2
5
2
1
0
3
2
3
6
1
0
2
3
0
3
1
1
0
0
4
1
1
1
2
0
1
3
0
0
...

result:

ok 100000 numbers

Test #37:

score: 0
Accepted
time: 1079ms
memory: 180596kb

input:

100000 100000
abaccbaabccbcbbbbbaaccccbccaaccbccabbabbbcabcbbbabbacacccccabacbccccaabcabccccbabcbacbbacbcbabacaabbccbacbacaaabbcbaaaacaccbbbabccbcacbbccbbaaaababbaabcacbabcabcbbbaacbacaabbbabaaabcaaabcabaaaabcbbbccbbaabcacbabccbaccabababaaabaccbaacaaaacbaabbbbaacaaaaccccbcabcaacccbabaabaacbbabcbacac...

output:

2
0
0
2
1
0
0
0
0
0
0
1
0
5
0
0
0
1
1
0
0
0
2
0
2
1
0
0
0
0
1
0
0
0
1
1
1
0
5
1
0
0
2
0
0
3
0
0
1
0
1
1
0
0
1
0
0
1
1
2
1
1
3
1
0
1
1
0
0
0
0
0
0
0
2
0
0
0
0
2
0
0
1
0
1
0
0
0
0
1
1
0
0
0
0
0
1
0
0
0
0
0
2
0
0
1
1
2
0
0
0
2
1
1
0
0
5
1
0
0
0
2
1
4
4
3
0
1
1
0
0
0
0
0
0
0
1
1
1
0
0
0
0
1
2
0
0
0
0
0
...

result:

ok 100000 numbers

Test #38:

score: 0
Accepted
time: 558ms
memory: 138252kb

input:

100000 100000
xtcdbnexyfbmsppducemadjzurozwvvhzvyuecmwfzwhbjgkkdazwlivubcsqngalkodatuaokszymubscvlfodiriznxfjvyhadhqbfecxzaxebjmfeyalxlbfsgxneoipmyfjckuwqdiknpwyujvdsavzxhcpaveoszsdxaeqnaqxrhpkdizavqgfxuefmytxkuryqdzzwkksggwjemigshiarhuqirlxhaajbyrouoyetbvowrlmlbsgxtsgmsfbchwbxvxnnevucxjjpbntgasnvwl...

output:

0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
2
0
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
...

result:

ok 100000 numbers

Test #39:

score: 0
Accepted
time: 154ms
memory: 116220kb

input:

100000 100000
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa...

output:

17317
38573
25356
66257
13414
3161
44334
14579
68961
23416
2692
11233
39851
19984
52826
19408
5208
13782
29260
47174
16355
41489
18766
40084
4113
30310
63715
68250
25651
66038
68776
25505
64170
26537
7158
18946
1118
7225
7473
58444
42334
5526
32065
22737
73778
19391
22004
74160
20614
53558
44251
440...

result:

ok 100000 numbers

Test #40:

score: 0
Accepted
time: 317ms
memory: 142780kb

input:

100000 100000
bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb...

output:

14974
1441
9021
1797
11559
12826
33511
28969
983
6283
10788
686
7326
23838
12640
2549
1248
20623
14818
8546
1992
40767
52
11338
6634
10567
6248
5903
34225
5564
2255
20139
7123
511
4574
5546
58719
1403
4964
36884
11244
5616
52386
51386
25490
884
6638
4350
35413
3647
5958
1729
40428
10817
9992
730
381...

result:

ok 100000 numbers

Test #41:

score: 0
Accepted
time: 285ms
memory: 135088kb

input:

100000 100000
tctctctctctctctctctctctctctctctctctctctctctctctctctctctctctctctctctctctctctctctctctctctctctctctctctctctctctctctctctctctctctctctctctctctctctctctctctctctctctctctctctctctctctctctctctctctctctctctctctctctctctctctctctctctctctctctctctctctctctctctctctctctctctctctctctctctctctctctctctctctctctctc...

output:

13145
9205
6294
10979
30703
12131
12137
16785
10248
3220
13656
9130
31714
4293
735
38096
5199
2201
12564
26093
5941
1307
7800
2365
4857
17611
3273
1398
1087
1575
18409
4521
16657
12346
3356
488
6972
382
17377
15762
3420
11245
8372
753
20171
1398
145
767
2989
15
1752
18255
24963
3947
18581
1463
19456...

result:

ok 100000 numbers

Test #42:

score: 0
Accepted
time: 147ms
memory: 115524kb

input:

100000 100000
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa...

output:

58280
31219
22125
33905
14836
73833
57743
38099
7383
32178
1181
93872
14534
10535
5953
23744
6236
4257
1092
22073
18754
48609
9858
31914
68368
34511
64329
75212
10911
44316
25322
43701
64858
15415
1157
62392
31554
2080
2981
52541
12798
48135
42640
27917
15906
26583
46095
47440
8969
30067
26167
8580
...

result:

ok 100000 numbers

Test #43:

score: 0
Accepted
time: 440ms
memory: 148612kb

input:

100000 100000
bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb...

output:

2025
3235
1914
1200
8468
934
449
3118
2456
2549
507
4623
3932
3390
1636
856
203
7663
3341
33
2235
1194
1662
5681
573
4261
4651
7246
2965
1736
833
2660
3364
2863
1657
5156
1034
3565
360
629
1505
2071
2935
1807
2237
1457
166
283
491
2079
2185
11083
253
1639
6462
159
2454
2828
2310
1073
3955
1927
2549
...

result:

ok 100000 numbers

Test #44:

score: 0
Accepted
time: 320ms
memory: 132284kb

input:

100000 100000
ololololololololololololololololololololololololololololololololololololololololololololololololololololololololololololololololololololololololololololololololololololololololololololololololololololololololololololololololololololololololololololololololololololololololololololololol...

output:

345
1365
610
327
266
444
2750
456
107
2716
521
830
1451
898
114
200
704
875
200
60
9
82
137
938
1356
783
52
848
3449
487
135
548
4373
841
1428
1015
440
4363
884
1655
3597
280
402
4010
1657
85
2717
144
1107
211
554
1635
297
2245
5879
304
200
699
2377
1925
1583
443
976
133
1124
715
1411
1685
230
542
1...

result:

ok 100000 numbers

Test #45:

score: 0
Accepted
time: 553ms
memory: 155480kb

input:

100000 100000
aabaaababaaabaaababaaabaaababaaabaaababaaabaaababaaabaaababaaabaaababaaabaaababaaabaaababaaabaaababaaabaaababaaabaaababaaabaaababaaabaaababaaabaaababaaabaaababaaabaaababaaabaaababaaabaaababaaabaaababaaabaaababaaabaaababaaabaaababaaabaaababaaabaaababaaabaaababaaabaaababaaabaaababaaabaaa...

output:

2672
2732
532
1
347
1615
1358
1783
727
119
1718
2155
50
1981
2554
199
1089
5934
2153
3421
336
1707
436
477
3952
592
4387
1790
59
1881
121
7002
714
1912
2753
3219
2450
1339
5820
3637
1804
67
3918
11177
4684
681
5041
207
252
2739
333
1551
2860
245
184
762
313
1911
516
2981
5672
3887
915
4332
4000
881
...

result:

ok 100000 numbers

Test #46:

score: 0
Accepted
time: 473ms
memory: 145932kb

input:

100000 100000
aaaabbcacbaaaabbcacbaaaabbcacbaaaabbcacbaaaabbcacbaaaabbcacbaaaabbcacbaaaabbcacbaaaabbcacbaaaabbcacbaaaabbcacbaaaabbcacbaaaabbcacbaaaabbcacbaaaabbcacbaaaabbcacbaaaabbcacbaaaabbcacbaaaabbcacbaaaabbcacbaaaabbcacbaaaabccacbaaaabbcacbaaaabbcacbaaaabbcacbaaaabbcacbaaaabbcacbaaaabbcacbaaaabb...

output:

589
441
423
1669
905
94
3144
871
304
1047
638
160
76
496
218
117
1343
1150
1879
83
2415
1809
178
2930
4326
249
789
38
1317
1062
426
1344
1442
2094
191
1413
335
132
276
1827
215
1090
819
1375
3062
664
525
4102
2313
24
304
570
687
327
2966
3156
955
1724
2122
76
1355
101
80
3208
1585
1156
495
714
1158
...

result:

ok 100000 numbers

Test #47:

score: 0
Accepted
time: 377ms
memory: 133920kb

input:

100000 100000
ijrdwpabxdijrdwpabxdijrdwpabxdijrdwpabxdijrdwpabxdijrdwpabxdijrdwpabxdijrdwpabxdijrdwpabxdijrdwpabxdijrdwpabxdijrdwpabxdijrdwpabxdijrdwpabxdijrdwpabxdijrdwpabxdijrdwpabxdijrdwpabxdijrdwpabxdijrdwpabxdijrdwpabxdijrdwpabxdijrdwpabxdijrdwpabxdijrdwpabxdijrdwpabxdijrdwpabxdijrdwpabxdijrdwp...

output:

1028
396
1788
44
882
165
517
1869
296
543
82
455
217
339
1204
180
3
1509
1239
787
1471
350
1675
3469
2065
3039
1792
1391
394
536
123
262
115
605
1101
900
518
496
477
1559
1169
2000
1193
13
2308
872
451
242
576
3461
244
854
472
933
624
137
1011
2649
1493
303
1418
1075
922
598
321
891
3757
125
113
450...

result:

ok 100000 numbers

Test #48:

score: 0
Accepted
time: 638ms
memory: 157516kb

input:

100000 100000
bbaabbaabaaaabbababababaaaabbabbbbbaabbbbbbbaabbaabaaaabbababababaaaabbabbbbbaabbbbbbbaabbaabaaaabbababababaaaabbabbbbbaabbbbbbbaabbaabaaaabbababababaaaabbabbbbbaabbbbbbbaabbaabaaaabbababababaaaabbabbbbbaabbbbbbbaabbaabaaaabbababababaaaabbabbbbbaabbbbbbbaabbaabaaaabbababababaaaabbabbbb...

output:

1127
457
992
1378
67
119
4097
27
3222
563
338
721
2230
5420
1627
1193
1683
932
1481
162
855
496
1371
2248
955
3540
328
1751
84
1710
613
2521
2899
687
1100
2894
3495
1137
3277
5440
79
341
1010
418
3217
520
344
1329
3233
132
2481
1332
2180
783
749
629
2010
1974
3663
25
281
1136
1813
2006
2
1306
1967
7...

result:

ok 100000 numbers

Test #49:

score: 0
Accepted
time: 499ms
memory: 146500kb

input:

100000 100000
cecaeebaaaaadbbedbdacbbbedccbedcccbabbbddacecaeebaaaaadbbedbdacbbbedacbedcccbabbbddacecaeebaaaaadbbedbdacbbbedccbedcccbabbbddacecaeebaaaaadbbedbdacbbbedccbedcccbabbbddacecaeebaaaaadbbedbdacbbbedccbedcccbabbbddacecaeebaaaaadbbedbdacbbbedccbedcccbabbbddacecaeebaaaaadbbedbdacbbbedccbedccc...

output:

2709
4697
965
3878
2887
1692
211
272
406
1006
1217
1018
175
4353
519
75
1467
443
539
95
2082
2531
298
1730
719
403
612
1253
1612
936
2468
446
1836
1378
971
881
2083
3531
89
306
984
2496
728
463
1866
1409
2139
741
902
151
60
5338
921
1875
2847
1550
1408
618
4064
2074
237
300
8047
777
516
866
1245
744...

result:

ok 100000 numbers

Test #50:

score: 0
Accepted
time: 448ms
memory: 144052kb

input:

100000 100000
eufwzcayhjbytwngfcegozefynutpfvydgycyzfxpfeufwzcayhjbytwngfcegozefynutpfvydgycyzfxpfeufwzcayhjbytwngfcegozefynutpfvydgycyzfxpfeufwzcayhjbytwngfcegozefynutpfvydgycyzfxpfeufwzcayhjbytwngfcegozefynutpfvydgycyzfxpfeufwzcayhjbytwngfcegozefynutpfvydgycyzfxpfeufwzcayhjbytwngfcegozefynutpfvydg...

output:

115
483
1066
1651
2343
56
1900
614
2475
1156
203
393
390
2221
2683
212
730
169
471
687
1657
1019
485
3045
452
648
3077
487
30
590
69
2185
2156
0
2862
90
1935
116
242
1334
49
2691
413
835
890
1952
101
1131
90
86
0
756
1575
220
485
486
618
683
944
3140
241
1394
199
29
924
762
277
1156
586
0
1684
996
2...

result:

ok 100000 numbers

Test #51:

score: 0
Accepted
time: 634ms
memory: 153984kb

input:

100000 100000
baabaaaabbbbabbaabaaabaabbaaaabaaabbbbaaabababaaaaabaabbaababaabbbbabaaaaaabbbbbaaaaabbbbbaababbbabbbaabaaaabbbbabbaabaaabaabbaaaabaaabbbbaaabababaaaaabaabbaababaabbbbabaaaaaabbbbbaaaaabbbbbaababbbabbbaabaaaabbbbabbaabaaabaabbaaaabaaabbbbaaabababaaaaabaabbaababaabbbbabaaaaaabbbbbaaaaab...

output:

3272
11581
363
6068
2241
5199
2324
11394
20258
243
7876
1
10556
3457
5102
4144
10820
3001
15382
40054
5308
24671
20943
17642
8302
38784
2062
4779
5117
3152
7045
34655
3557
8258
23251
3729
6165
12733
38000
3831
3425
4256
7824
5742
10620
6789
2611
12644
11779
20950
17676
44386
1400
1193
203
13499
1460...

result:

ok 100000 numbers

Test #52:

score: 0
Accepted
time: 445ms
memory: 142516kb

input:

100000 100000
jcemgtdzdoylpkebqplnrewobjnbeioozgydizkqqylmdoefzxzrgomxjulbqxcezzihwgpjqkokzxhwxkvvktyjgcjkcoeopvjrjcemgtdzdoylpkebqplnrewobjnbeioozgydizkqqylmdoefzxzrgomxjulbqxcezzihwgpjqkokzxhwxkvvktyjgcjkcoeopvjrjcemgtdzdoylpkebqplnrewobjnbeioozgydizkqqylmdoefzxzrgomxjulbqxcezzihwgpjqkokzxhwxkvvkt...

output:

21965
4017
6924
7831
7127
11290
1738
1118
303
6312
3097
2328
2342
15892
1635
666
12194
7980
16041
945
2512
8571
13039
2832
7027
9672
6603
14182
4324
3325
1891
502
7920
7809
10683
869
2157
7772
13558
7347
1752
18928
1920
6938
7138
1987
1941
2232
18314
5900
2100
631
22671
3067
5475
811
1250
15030
1651...

result:

ok 100000 numbers

Test #53:

score: 0
Accepted
time: 143ms
memory: 119112kb

input:

100000 100000
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa...

output:

42483
74849
42943
51808
46116
40580
22087
19211
76765
12517
67979
18159
42046
13615
17971
48760
12474
56311
50630
56698
66579
21968
1434
48327
28253
51413
5013
45728
34595
39227
8958
8678
69033
24669
4992
46271
41594
51854
9313
32717
66247
39921
3654
16289
35498
40212
69436
29743
54792
41167
3255
87...

result:

ok 100000 numbers

Test #54:

score: 0
Accepted
time: 643ms
memory: 158820kb

input:

100000 100000
abcaaabacbcccccccbaaacaacaaaaabaabcbccababaccbcbbabbacbbcbcccbabbaacbabbcbbacbbbaacaccbcccabaaabbcababcaaabacbcccccccbaaacaacaaaaabaabcbccababaccbcbbabbacbbcbcccbabbaacbabbcbbacbbbaacaccbcccabaaabbcababcaaabacbcccccccbaaacaacaaaaabaabcbccababaccbcbbabbacbbcbcccbabbaacbabbcbbacbbbaacacc...

output:

539
1370
1553
3943
100
630
2181
2283
1661
5072
52
2134
73
1583
26
217
961
1714
2719
1975
3485
4554
70
1887
669
1742
885
746
954
297
990
266
0
2334
3279
666
680
746
1701
1817
252
1361
283
70
1407
864
1061
281
336
57
4600
1042
2402
620
1410
577
888
372
1304
889
243
309
577
394
3769
2186
2719
4400
2029...

result:

ok 100000 numbers

Test #55:

score: 0
Accepted
time: 480ms
memory: 146704kb

input:

100000 100000
mjkokboqytzigmiqeaburoavvbaqgfwqhikghbxbocbiwlkgrxwroypluspijhzvkdoawimsrfrvrnpeymfixgmaruiihytkddapmjkokboqytzigmiqeaburoavvbaqgfwqhikghbxbocbiwlkgrxwroypluspijhzvkdoawimsrfrvrnpeymfixgmaruiihytkddapmjkokboqytzigmiqeaburoavvbaqgfwqhikghbxbocbiwlkgrxwroypluspijhzvkdoawimsrfrvrnpeymfixg...

output:

3718
894
884
392
627
2849
527
31
2020
561
297
205
2263
548
70
1356
1217
564
517
162
299
907
676
76
2882
3130
318
291
1467
393
0
58
307
732
0
316
1544
2443
726
2168
347
1473
59
285
744
863
2073
52
121
400
1756
236
239
443
1015
689
2316
1330
484
1676
225
20
4904
1278
102
1585
3211
1164
121
1512
129
66...

result:

ok 100000 numbers

Test #56:

score: 0
Accepted
time: 1105ms
memory: 185056kb

input:

100000 100000
bbbbbbbbbabbbabbaabbaabbabbababbabbbaabaaabbbababbbabbaaabaabaababbaabbbabbbabbbaaaabbaaabbaabababbbbbbbbbabbaabbbaaababbbababbabaabaabaabaabbbbaabaaababbabababbabbabbabbaabbbababbaaaabbbaabbbababababbbaabaaaabbababaaababbabababbbbbbaaaaababbaabbbbabaabbaaaabbbaabbbbbbaaabaaaabbabbabaa...

output:

2437
10160
1
7487
2124
4594
4
5
4080
2697
3254
271
10316
1
867
2233
8114
4
1
4
0
1737
1
1120
3282
3
1292
0
290
0
354
3665
5
9318
2
0
1
693
1
2
1
459
9534
0
0
2650
5
0
4371
10550
2520
314
3
3299
1
3
6754
4
0
12070
0
1
896
6265
1
3
3
10505
0
10863
2
6190
0
5
1913
15169
2084
1
5615
1
7979
3843
3
1
3
3
...

result:

ok 100000 numbers

Test #57:

score: 0
Accepted
time: 619ms
memory: 153140kb

input:

100000 100000
qtilftgormbzlhfzbbkibvytiokldbjfgpjmzpwzjtvzexkoquvhdghbkcazzahpvlgtlnvifocudtcfanbrxuoyfwmfpmqchpqsedprhjtwvenxjzythspdvjbjjfcsbvphpebvuzcblzleavolozmjzuoezzlbxpmmayibujodyoymogvjrjycfraptnkcnxgiwmobvvkuketgoiqjqlnghnambvhluianqzmioqlmpjczkrxjczdjizenzljiqotgkaqsvsuoqmnvsvpxgocbsfjjpk...

output:

6598
0
0
2037
25051
0
10859
569
10477
0
2945
5695
4362
26806
1428
3669
0
11151
8647
0
0
0
0
1
24156
0
0
0
6702
0
0
0
0
0
3566
122
0
0
0
5535
0
28384
9694
0
2507
224
0
521
12084
12244
0
0
5646
6885
9701
0
0
0
1510
0
0
0
0
16713
0
0
4920
4660
17185
0
1358
0
0
0
0
0
0
1941
16816
0
1350
0
2469
11443
0
2...

result:

ok 100000 numbers

Test #58:

score: 0
Accepted
time: 136ms
memory: 118344kb

input:

100000 100000
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa...

output:

21418
73532
14741
8976
7287
24213
48724
1367
10103
2217
20585
28182
34643
27625
43731
57476
10352
37309
2388
6694
33255
4722
19635
20880
10976
2211
78840
37409
25891
28509
9205
30781
10504
48199
83093
22755
54344
36342
35972
2552
55193
10048
20425
1882
62869
20192
20421
1196
31139
70761
61865
44439
...

result:

ok 100000 numbers

Test #59:

score: 0
Accepted
time: 622ms
memory: 155980kb

input:

100000 100000
fojqkedgwumedkjbqcxbiseczampaamursrxzpivimmjhruxotmmgttmfhnqomiswdypdnlgwrbaniyhcpcvzwdbnycvdhfdxiagjoaxuyxotybikdoputotxakvukdyzzetbrtymhcncequwyazntxlnwwzedjeugrfpqlyxlouourhqfxnpwxtvdnpglbeufhdopzxypqyknmhinpogwidbaujnwbtplwljupnlqqjcnkvoavjbmmhjhjxcwbkbppeawuvbjzbjqshapvkevossdmuyd...

output:

1
398
0
871
0
0
1
0
0
1
0
1552
0
0
0
1
0
0
0
0
0
0
137
0
0
994
0
0
0
0
942
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
2388
0
0
0
821
0
0
0
0
0
0
0
0
0
1175
1853
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
442
0
0
332
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
879
...

result:

ok 100000 numbers

Test #60:

score: 0
Accepted
time: 319ms
memory: 157388kb

input:

200000 200000
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa...

output:

42105
130810
48621
114096
20499
13320
82046
24358
114931
88336
92099
96310
52607
85881
71074
57245
31298
26092
3193
179994
117202
140911
58198
130583
51431
71088
96903
16127
86173
27024
71336
108033
5294
71418
4390
123519
20367
8651
65880
159586
37932
31658
95767
51987
170882
77951
124295
162247
105...

result:

ok 200000 numbers

Test #61:

score: 0
Accepted
time: 2946ms
memory: 336232kb

input:

200000 200000
bbbbbbbaabaaaabbbbaabaaabbabbaababbabababaaaaabbababaaabaaaaabaaaaabbaaaabbaaababbaaaababbaaaaaaaaababbbbabbabbbaaaabbbbbbbbbabbabbbaabbabaaaababbabbaababbbaaaaaaabaaaababbbaaabaabbbbababbaaaabbbabaabbaaabbabbbbbbbbbaaababbababbbbabbbababbabbbbaaabaaabbbbabbbaabbabbababbaabbbaabbaaaaaa...

output:

0
0
3
0
5
1
2
2
1
1
1
0
0
2
5
3
6
0
0
3
2
0
1
6
4
2
1
3
0
2
0
1
1
0
3
1
0
1
1
3
0
2
2
0
0
1
0
3
3
1
4
1
0
2
0
1
1
2
1
0
0
0
1
0
2
5
1
3
8
0
2
1
2
1
1
1
2
1
2
3
1
0
0
3
5
0
2
0
2
0
2
4
0
0
0
1
1
0
1
2
1
0
9
1
4
0
4
1
2
0
1
0
0
0
2
0
2
2
6
0
1
2
0
1
0
2
1
1
1
0
0
0
2
1
3
0
2
2
3
2
0
1
3
2
4
0
2
1
16
4...

result:

ok 200000 numbers

Test #62:

score: 0
Accepted
time: 2434ms
memory: 301936kb

input:

200000 200000
abbcbaccabcabacbbaaaabbbacbbaabbccacacbcacabaabacaccacabbccbbbbbacbbbabaaaaaacccacbccacacacbcaacbaacbcccbbcbbaccbbbacccbcacaaabbcbbcabccbcaaaabcbbacababacbabacbcaaaabccaababcaacacbaacccccacbaacccbbcbbaacbbacacbcaaabbaccbbbacbcaaabccbccbcccbabccacbbaabcbccccccabacacabcbabcacbcbcbbccbbca...

output:

0
1
2
1
1
0
2
2
0
1
0
0
1
1
1
2
0
0
1
0
1
1
0
1
1
0
0
0
0
0
1
0
0
0
0
2
2
1
1
1
1
1
0
0
1
0
3
1
1
0
1
2
0
1
0
1
0
0
2
0
0
0
0
1
5
1
1
0
2
0
1
0
0
0
2
3
1
0
0
0
1
3
1
0
0
0
0
0
6
0
1
0
1
2
0
1
1
1
0
1
1
0
0
0
0
1
1
0
1
1
1
0
1
0
0
0
0
1
1
1
0
1
3
0
0
2
0
0
1
2
1
0
0
3
2
0
0
2
0
0
0
0
1
1
2
2
0
0
1
0
...

result:

ok 200000 numbers

Test #63:

score: 0
Accepted
time: 1300ms
memory: 210644kb

input:

200000 200000
jjaryigvfyaqjwvilugazyxvsfvumzowsmclexpunujmdvknlbksxlzbvburlxgzimjlbbdmduifosbogcjuclfpqnmtojvhzvjjidlybxcfjxnbgfhjlpouspsqelrgxqcvkxtmxeharlajzmphaebxlwhgkxdyiznljlyscdrsffdunabrpaffuyrndueuntckehfnkwlbprvdrvfszfcolxglgryluvrclbvovlfziyfoxlegzuovcmcugelkxktysllgxzcqznjstnonrennrhvjcz...

output:

0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
1
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
...

result:

ok 200000 numbers

Test #64:

score: 0
Accepted
time: 314ms
memory: 158056kb

input:

200000 200000
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa...

output:

39985
20237
113644
24888
45029
28115
110297
13537
34551
114819
96174
84451
143372
40751
117235
143350
42083
99480
30788
55790
49470
36133
34131
57263
90418
7007
5439
101308
30140
45619
73032
30282
93862
59049
20598
33094
103930
174506
45906
139191
64319
141432
39522
16205
44540
119354
51729
31252
21...

result:

ok 200000 numbers

Test #65:

score: 0
Accepted
time: 591ms
memory: 196308kb

input:

200000 200000
bababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababa...

output:

15171
20791
13723
44717
27148
12127
861
2692
16501
15856
6449
39163
50450
19026
24290
16842
1908
10767
61450
50133
7011
7692
5838
69966
10394
23100
3770
59193
8988
41789
14633
33171
16501
21870
57582
38245
4119
1386
54479
49664
10740
25771
30878
39275
383
20750
13190
66854
39332
5146
19760
5827
3362...

result:

ok 200000 numbers

Test #66:

score: 0
Accepted
time: 625ms
memory: 203800kb

input:

200000 200000
vwvwvwvwvwvwvwvwvwvwvwvwvwvwvwvwvwvwvwvwvwvwvwvwvwvwvwvwvwvwvwvwvwvwvwvwvwvwvwvwvwvwvwvwvwvwvwvwvwvwvwvwvwvwvwvwvwvwvwvwvwvwvwvwvwvwvwvwvwvwvwvwvwvwvwvwvwvwvwvwvwvwvwvwvwvwvwvwvwvwvwvwvwvwvwvwvwvwvwvwvwvwvwvwvwvwvwvwvwvwvwvwvwvwvwvwvwvwvwvwvwvwvwvwvwvwvwvwvwvwvwvwvwvwvwvwvwvwvwvwvwvwvw...

output:

14263
34542
28008
7707
4488
60789
14067
21955
17673
78038
15433
47638
8125
3625
16539
15603
19306
21811
18264
12392
7578
1295
14999
1947
34282
405
11684
324
677
52147
29947
19861
38970
5008
3747
37040
1257
30216
1340
2734
19076
6243
16248
12932
8872
26388
4869
24100
2354
83312
32449
22143
17415
2301...

result:

ok 200000 numbers

Test #67:

score: 0
Accepted
time: 318ms
memory: 157456kb

input:

200000 200000
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa...

output:

49417
1054
59689
77717
39117
35894
147464
13488
15931
23896
8674
7800
72998
53472
128781
36069
70540
38201
122832
22161
163451
21115
36211
161681
11926
17473
28223
184324
32083
77787
106180
2193
1687
35926
124818
63265
1357
80961
32728
23131
39696
102586
27302
67560
85386
2285
30729
48079
88104
7051...

result:

ok 200000 numbers

Test #68:

score: 0
Accepted
time: 890ms
memory: 218036kb

input:

200000 200000
ababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababab...

output:

3009
2723
314
3659
4952
1516
2200
21226
3877
123
67
1790
1418
1201
6833
1249
4303
2033
2125
259
7747
2840
14341
688
1405
442
1849
2801
13915
4835
2504
6032
17694
3656
1476
6790
3175
3581
2416
1636
5923
14
1746
4023
2274
7867
1573
463
7316
2666
7652
6068
3972
805
2966
4605
10270
409
7548
1652
9210
32...

result:

ok 200000 numbers

Test #69:

score: 0
Accepted
time: 767ms
memory: 191304kb

input:

200000 200000
ijijijijijijijijijijijijijijijijijijijijijijijijijijijijijijijijijijijijijijijijijijijijijijijijijijijijijijijijijijijijijijijijijijijijijijijijijijijijijijijijijijijijijijijijijijijijijijijijijijijijijijijijijijijijijijijijijijijijijijijijijijijijijijijijijijijijijijijijijijijijijijij...

output:

1616
555
424
6529
1312
31
857
1192
4900
1415
1516
4059
2907
3513
4710
139
1835
638
4652
1639
2851
3269
474
11769
473
3904
105
3402
9503
1524
1247
1003
2621
9030
1048
1622
880
718
2282
4612
1457
4334
374
220
397
10
1884
267
524
1650
1903
5434
1355
9978
495
1969
377
483
142
11513
990
883
3438
455
4341...

result:

ok 200000 numbers

Test #70:

score: 0
Accepted
time: 1135ms
memory: 231708kb

input:

200000 200000
babaaaaabbbabaaaaabbbabaaaaabbbabaaaaabbbabaaaaabbbabaaaaabbbabaaaaabbbabaaaaabbbabaaaaabbbabaaaaabbbabaaaaabbbabaaaaabbbabaaaaabbbabaaaaabbbabaaaaabbbabaaaaabbbabaaaaabbbabaaaaabbbabaaaaabbbabaaaaabbbabaaaaabbbabaaaaabbbabaaaaabbbabaaaaabbbabaaaaabbbabaaaaabbbabaaaaabbbabaaaaabbbabaaa...

output:

4609
7935
490
3030
737
17909
3236
8359
8068
8612
15311
2655
9812
1009
485
251
3551
3758
5092
7515
1257
1241
17054
921
9091
6712
1031
1285
3085
1381
7858
2241
2567
166
15748
1452
129
9430
945
1408
5932
256
2216
1186
280
3134
1720
1974
670
4210
3599
4046
7146
5543
1178
3774
170
3543
1989
70
4740
122
1...

result:

ok 200000 numbers

Test #71:

score: 0
Accepted
time: 1003ms
memory: 218460kb

input:

200000 200000
daadacdbdddaadacdbdddaadacdbdddaadacdbdddaadacdbdddaadacdbdddaadacdbdddaadacdbdddaadacdbdddaadacdbdddaadacdbdddaadacdbdddaadacdbdddaadacdbdddaadacdbdddaadacdbdddaadacdbdddaadacdbdddaadacdbdddaadacdbdddaadacdbdddaadacdbdddaadacdbdddaadacdbdddaadacdbdddaadacdbdddaadacdbdddaadacdbdddaadac...

output:

3213
1027
719
7830
4390
8230
5816
1830
4429
2272
2802
943
3142
2409
9321
1784
457
5285
0
5665
11302
1647
407
141
159
707
992
2624
859
1509
250
10672
482
1007
3663
353
2943
6499
2726
4439
140
51
31
5262
2059
892
2254
535
1116
3827
1239
719
393
2985
949
1342
1535
3275
5409
6572
2873
2019
8939
107
6352...

result:

ok 200000 numbers

Test #72:

score: 0
Accepted
time: 735ms
memory: 189780kb

input:

200000 200000
dmbryvoufkdmbryvoufkdmbryvoufkdmbryvoufkdmbryvoufkdmbryvoufkdmbryvoufkdmbryvoufkdmbryvoufkdmbryvoufkdmbryvoufkdmbryvoufkdmbryvoufkdmbryvoufkdmbryvoufkdmbryvoufkdmbryvoufkdmbryvoufkdmbryvoufkdmbryvoufkdmbryvoufkdmbryvoufkdmbryvoufkdmbryvoufkdmbryvoufkdmbryvoufkdmbryvoufkdmbryvoufkdmbryv...

output:

1758
1624
443
923
1962
292
426
427
1874
357
651
943
752
627
5721
282
7247
2404
268
2143
55
2044
1131
2399
983
282
1151
693
320
5421
696
3715
171
7380
1320
2154
3717
12196
1054
4683
9118
3505
688
625
1012
3151
399
1912
237
1952
2784
10276
420
43
915
2769
989
2584
2058
386
5365
3726
362
2072
709
1314
...

result:

ok 200000 numbers

Test #73:

score: 0
Accepted
time: 1410ms
memory: 243048kb

input:

200000 200000
bbaabaabbbaabaabbabababababbabaaaabbbabbbbbbaabaabbbaabaabbabababababbabaaaabbbabbbbbbaabaabbbaabaabbabababababbabaaaabbbabbbbbbaabaabbbaabaabbabababababbabaaaabbbabbbbbbaabaabbbaabaabbabababababbabaaaabbbabbbbbbaabaabbbaabaabbabababababbabaaaabbbabbbbbbaabaabbbaabaabbabababababbabaaaa...

output:

3444
1891
157
98
4890
7692
1709
721
1388
12152
2738
5521
403
2475
1228
1783
3806
3894
3675
3982
3907
1255
29458
2657
1301
2709
23605
7479
3245
1193
740
1798
601
7536
1527
979
4298
6283
1240
4201
227
692
717
3129
1504
2948
1768
894
373
2286
11536
3843
4040
2626
1872
3459
222
4023
6480
3044
4227
6043
...

result:

ok 200000 numbers

Test #74:

score: 0
Accepted
time: 1196ms
memory: 221408kb

input:

200000 200000
cacccdcdabbbabdddcecacccaccebebabbdbbacddccacccdcdabbbabdddcecacccaccebebabbdbbacddccacccdcdabbbabdddcecacccaccebebabbdbbacddccacccdcdabbbabdddcecacccaccebebabbdbbacddccacccdcdabbbabdddcecacccaccebebabbdbbacddccacccdcdabbbabdddcecacccaccebebabbdbbacddccacccdcdabbbabdddcecacccaccebebabb...

output:

1053
546
1500
2946
2126
6004
650
2070
96
1802
417
757
3716
650
4054
1442
936
4387
2747
3375
294
523
3321
2867
2899
8630
1452
4414
181
3263
263
437
11521
5860
11423
10620
68
4718
518
4995
1231
1511
3778
312
1426
5307
751
6637
546
798
1302
298
1008
469
1255
246
2731
4593
2027
1257
5641
19331
580
5091
...

result:

ok 200000 numbers

Test #75:

score: 0
Accepted
time: 956ms
memory: 208516kb

input:

200000 200000
bwoidinropctzqphahdjrnimrbkorjfpudmzrwuzijbwoidinropctzqphahdjrnimrbkorjfpudmzrwuzijbwoidinropctzqphahdjrnimrbkorjfpudmzrwuzijbwoidinropctzqphahdjrnimrbkorjfpudmzrwuzijbwoidinropctzqphahdjrnimrbkorjfpudmzrwuzijbwoidinropctzqphahdjrnimrbkorjfpudmzrwuzijbwoidinropctzqphahdjrnimrbkorjfpud...

output:

4829
3805
311
954
522
1595
3204
5144
3757
805
284
3453
2476
1131
1277
1011
4085
1281
1343
1264
1428
1144
2846
2775
2224
2258
4034
2720
1619
1463
0
1501
5319
5255
241
1329
1132
756
309
618
6889
4167
120
1085
312
442
2619
825
375
3389
831
850
2501
835
88
2386
3522
1428
2187
195
7834
3042
1126
2114
507...

result:

ok 200000 numbers

Test #76:

score: 0
Accepted
time: 1387ms
memory: 244884kb

input:

200000 200000
abbabaaabbaaaaabaaabbbabbbaaaababaabaabbababaabbbbbbaababbbaaabbbbaaaaabbabaabababbabababaaabbbabbababbabaaabbaaaaabaaabbbabbbaaaababaabaabbababaabbbbbbaababbbaaabbbbaaaaabbabaabababbabababaaabbbabbababbabaaabbaaaaabaaabbbabbbaaaababaabaabbababaabbbbbbaababbbaaabbbbaaaaabbabaabababbaba...

output:

4442
4355
1791
52704
42708
74945
189
82552
3535
19637
50963
15179
6011
4648
78900
3280
72907
115003
9746
4104
63892
1473
35485
11616
119272
6172
50774
73444
11944
69856
31625
10491
64702
5609
119849
5326
135179
935
49032
9105
587
15065
7703
50599
83523
41377
4910
7122
93756
5621
77425
26412
105
9236...

result:

ok 200000 numbers

Test #77:

score: 0
Accepted
time: 1012ms
memory: 216712kb

input:

200000 200000
tdimcgjmjsyzvqzrkuwtbfovulnmzftdmxbupazyixxmkfuijiqiepynmwibczalebfmxjchkfcvmimxmmqkjejbbefhomarwxndtdimcgjmjsyzvqzrkuwtbfovulnmzftdmxbupazyixxmkfuijiqiepynmwibczalebfmxjchkfcvmimxmmqkjejbbefhomarwxndtdimcgjmjsyzvqzrkuwtbfovulnmzftdmxbupazyixxmkfuijiqiepynmwibczalebfmxjchkfcvmimxmmqkje...

output:

13210
50336
4545
7121
8523
963
5876
20821
52389
37465
7651
16191
30932
9445
2518
10747
36030
16100
12423
2932
15336
10077
13215
4002
901
6601
23118
1335
6766
32980
4625
21397
485
15184
16807
13058
9063
10705
39240
954
49303
12742
5438
21110
10361
41173
45169
6093
25466
30979
10856
30298
43933
207
72...

result:

ok 200000 numbers

Test #78:

score: 0
Accepted
time: 324ms
memory: 157656kb

input:

200000 200000
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa...

output:

7290
38392
6455
39732
99341
71388
66999
92019
51597
82979
28360
46425
105407
17901
53744
35808
5296
147291
106937
142631
68516
83247
61078
29703
97756
46671
169099
86302
78600
51818
87332
122524
72936
21664
58051
10179
21180
16164
88609
91272
24893
6809
12496
100484
56242
71880
64742
18555
86178
113...

result:

ok 200000 numbers

Test #79:

score: 0
Accepted
time: 1397ms
memory: 240652kb

input:

200000 200000
aaabcabbbbbbaaabbcacbcbcabcbbabaaacaacbababcaacbbbacaabaccbcbcaaaacaaabcbccaababaccccacbaabcbccbcabbaaabcabbbbbbaaabbcacbcbcabcbbabaaacaacbababcaacbbbacaabaacbcbcaaaacaaabcbccaababaccccacbaabcbccbcabbaaabcabbbbbbaaabbcacbcbcabcbbabaaacaacbababcaacbbbacaabaccbcbcaaaacaaabcbccaababacccca...

output:

4787
2327
5446
83
358
3941
306
2173
3113
738
2583
1849
6668
469
4108
1137
8164
4878
1713
254
1781
125
4019
2016
266
1380
5403
1115
2274
961
11672
335
4824
5715
1876
5323
806
4443
1201
5077
798
4545
4985
2623
2834
3063
832
432
987
5477
3680
2467
4756
93
5473
694
2474
869
913
3853
2994
795
6224
7330
1...

result:

ok 200000 numbers

Test #80:

score: 0
Accepted
time: 1074ms
memory: 217324kb

input:

200000 200000
pnikyhdwcroojezkknfdujhqwanleklayjaoksfunpappboqcoonpjgoyrqrmhgzmasbzumlntdhcspvbguhjrgvwqfuduwuhfmtpnikyhdwcroojezkknfdujhqwanleklayjaoksfunpappboqcoonpjgoyrqrmhgzmasbzumlntdhcspvbguhjrgvwqfuduwuhfmtpnikyhdwcroojezkknfdujhqwanleklayjaoksfunpappboqcoonpjgoyrqrmhgzmasbzumlntdhcspvbguhjr...

output:

1582
2306
1439
1214
1682
190
709
1918
982
189
956
1317
0
1121
710
1720
4059
3280
5176
1840
2962
4851
342
1613
2938
2473
3355
1119
1387
329
3619
472
201
60
4297
1210
326
1811
2004
0
2877
637
0
0
0
4834
3013
3196
2701
2887
3736
996
64
4682
3248
470
2622
3097
2243
31
236
2222
4796
297
3983
5743
475
196...

result:

ok 200000 numbers

Test #81:

score: 0
Accepted
time: 2439ms
memory: 302156kb

input:

200000 200000
baababaaabaaabaabaaabbababaaaababbbbbbaabbaaaabbabbaaababbaaabbabbaaabbabaaaaabbbbbbbaabbbaabbaabbbabbaaabbbababbabbaaababababbaaaabbbbaabbabaabbababaaaabaaabababaabababbababbabbaabbaaaabbbbbababbbaaaaaaaaabaababbaababbabbaaaabbaabaaabbbaabbaaaababaababbaaabababaaabbabbaaaaaaabbabbaaab...

output:

11428
2
48099
72333
2
1
50130
39506
16498
1
4614
0
40378
0
35534
2
36071
8745
12
11627
49261
84626
64230
41637
143239
4108
0
0
63743
7452
38726
30562
0
0
126600
29571
23026
126798
80246
1
2
0
119495
19829
36740
0
78709
121498
64574
31760
18347
36017
15214
10013
13700
3824
152941
0
1
119757
26373
181...

result:

ok 200000 numbers

Test #82:

score: 0
Accepted
time: 1376ms
memory: 241536kb

input:

200000 200000
elkfojzmovyyrafqkuiuoehvtvdrueqszryvjdwcqscikocwvfwsoaagjyfjyzpdzhuadfdnaqfbqeooedsbewmbaorlvqdysokyxaaskkbtdrpkaeedonwjmdegelxvuwdiuoygahquyliqvqxpckqtthaechevhrxifzacknkytwijzujwjjxgagmvclkjzawozmptfutdugsnvircdaconsbreeimwsrybkjyjvrbiqaazahtduweqetefmtvgfkuavuywmvifooroxtdesbizfokyf...

output:

41778
6915
0
0
1961
384
34271
3502
34572
17113
0
14022
0
4950
1323
100004
51430
57185
5158
26391
111690
32639
0
0
10226
4475
0
1334
10560
18822
20921
33814
0
40538
53078
15936
478
1641
5152
5423
1340
0
34866
18092
17056
19883
7120
103247
62418
0
0
35679
14665
73220
29374
6500
693
1
118920
1
1238
0
1...

result:

ok 200000 numbers

Test #83:

score: 0
Accepted
time: 321ms
memory: 158956kb

input:

200000 200000
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa...

output:

27581
93910
112709
63523
51819
87939
76228
54423
81172
39391
24821
108041
77130
24161
48261
2043
127735
64766
37843
33752
77379
10757
60729
57847
27552
48386
133916
76476
59180
95632
118178
40829
40230
159325
13422
36356
31785
85792
96131
154537
123719
122772
89802
57215
96767
33683
19277
12998
5036...

result:

ok 200000 numbers

Test #84:

score: 0
Accepted
time: 1397ms
memory: 239656kb

input:

200000 200000
xqdyzxbcfqlivkzkjziqtciphtrgegzosfzhlnmbhvvqyjccxtywymykanypkwywsrfhvxscxwjmzujnsjlcbugueajbhwdowchzfyexvgtugalapjyzoathrfkscfhsanhylnegvtvbnbdprhenxxjfaivamwdoupkkogmpafjpxeoqgvjeouboipuxgihswwmgprrixyzhmmsoinjbvlsjfcznvxcvczgvurekqwfdjkljykckwghqnyadfhqxuheuvcaxvkvplqqdbvcigutbtgpdvl...

output:

0
0
638
0
474
0
0
0
0
1
0
0
0
0
723
0
0
0
0
0
278
0
0
0
0
0
0
0
1
0
0
488
2471
0
0
0
0
0
0
0
0
0
212
0
441
0
61
0
2521
0
3474
608
0
0
0
0
0
780
0
0
0
0
0
0
1049
0
0
0
0
0
0
0
0
0
2343
0
1002
0
0
0
247
0
0
0
0
1388
0
0
1
0
1396
0
1486
0
0
0
0
0
0
0
601
0
4311
0
0
0
0
0
788
0
3121
0
332
0
0
0
0
0
0
22...

result:

ok 200000 numbers

Test #85:

score: 0
Accepted
time: 2615ms
memory: 310684kb

input:

200000 200000
azzazaazzaazazzazaazazzaazzazaazzaazazzaazzazaazazzazaazzaazazzazaazazzaazzazaazazzazaazzaazazzaazzazaazzaazazzazaazazzaazzazaazzaazazzaazzazaazazzazaazzaazazzaazzazaazzaazazzazaazazzaazzazaazazzazaazzaazazzazaazazzaazzazaazzaazazzaazzazaazazzazaazzaazazzazaazazzaazzazaazazzazaazzaazaz...

output:

579
1066
705
13277
3433
1804
107
11287
1809
1596
1309
160
19285
3033
5194
37832
45
27607
1602
3971
1160
2231
13601
2773
25322
36374
1413
3392
1774
844
10
5230
2952
16853
4886
10980
3518
15486
2958
12700
2909
3059
11644
50893
731
2595
1386
8212
204
35
4137
10424
24520
113
9009
9159
60
38636
1946
9466...

result:

ok 200000 numbers

Test #86:

score: 0
Accepted
time: 2620ms
memory: 311788kb

input:

199999 200000
azzazaazzaazazzazaazazzaazzazaazzaazazzaazzazaazazzazaazzaazazzazaazazzaazzazaazazzazaazzaazazzaazzazaazzaazazzazaazazzaazzazaazzaazazzaazzazaazazzazaazzaazazzaazzazaazzaazazzazaazazzaazzazaazazzazaazzaazazzazaazazzaazzazaazzaazazzaazzazaazazzazaazzaazazzazaazazzaazzazaazazzazaazzaazaz...

output:

28945
3748
109
8207
7661
122
2908
10758
264
5187
2610
1247
1489
8144
22994
11972
3890
30240
1274
551
10098
3660
17376
2954
1708
17446
673
709
508
10366
5074
1781
7390
9194
17622
475
3601
53202
5028
1565
10016
1368
118
6045
4349
43681
35039
1263
15350
48724
19359
1072
1204
8125
2842
20481
1149
9896
9...

result:

ok 200000 numbers

Test #87:

score: 0
Accepted
time: 301ms
memory: 148552kb

input:

200000 200000
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa...

output:

199999
199998
199998
199997
199997
199997
199996
199996
199996
199996
199995
199995
199995
199995
199995
199994
199994
199994
199994
199994
199994
199993
199993
199993
199993
199993
199993
199993
199992
199992
199992
199992
199992
199992
199992
199992
199991
199991
199991
199991
199991
199991
199991...

result:

ok 200000 numbers

Test #88:

score: 0
Accepted
time: 373ms
memory: 159376kb

input:

200000 200000
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa...

output:

99999
99998
99999
99997
99998
99998
99996
99997
99998
99997
99995
99996
99997
99997
99996
99994
99995
99996
99997
99996
99995
99993
99994
99995
99996
99996
99995
99994
99992
99993
99994
99995
99996
99995
99994
99993
99991
99992
99993
99994
99995
99995
99994
99993
99992
99990
99991
99992
99993
99994
...

result:

ok 200000 numbers

Test #89:

score: 0
Accepted
time: 378ms
memory: 129948kb

input:

625 195625
abbbabbabbbaaabbbbabaabbbbbaabaabbbbaabbababaaaaaaaaabbabbabbabbbbbabbbaaaaabababaabbbbbbaaaabbbaaaabaabbaaabaaabbbbbabaaabbabababaaababbbaababbaabaaabbbbbaabbbbbaabbabababbaaaaaabbbbbbababbbaabaaabbabaababbabbbbbababaaaabaaaaaabbbbbaabbbbbabbbaabbbbaaabaabbabbbbbaaaaaaababaabbabbbaaaabbb...

output:

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

result:

ok 195625 numbers

Test #90:

score: 0
Accepted
time: 320ms
memory: 126728kb

input:

625 195625
bbbcbcbbaaabacccbabcbacbaccabacbaaabaabbcbcbbbaacccaabaabbcbcaaacbcbaaaaacbbcaaccabcabacccaababaacbacbacabbccabcbacababcaabbbcbcbcbbacccbbbbccbbbacccaaabbcacacacaabbcbacacbacbaccacaaaabababcaaabbacabbccabcaaabababaabccbbabaccbaccbbcbaaacacbacbaacccaaccbaccccbabbcccbbbbccbaccaabcccacbbbbba...

output:

0
0
0
0
0
0
0
0
0
1
0
0
0
1
0
0
0
0
1
0
1
0
0
0
1
0
1
0
0
0
0
0
0
1
0
0
5
0
0
0
0
1
0
0
0
4
4
0
1
0
0
0
0
0
0
3
3
3
0
0
0
0
0
0
0
0
3
2
2
2
0
1
0
0
0
0
0
0
3
2
1
1
3
0
0
0
2
0
0
0
0
2
2
1
0
2
2
0
0
1
2
0
0
4
3
1
2
1
0
1
1
1
2
0
1
1
0
3
3
2
0
4
1
0
1
0
0
1
1
0
1
0
2
2
2
1
2
3
3
0
1
0
2
0
0
1
0
0
1
1
...

result:

ok 195625 numbers

Test #91:

score: 0
Accepted
time: 436ms
memory: 203576kb

input:

200000 200000
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa...

output:

447
446
446
445
446
445
444
445
445
444
443
444
445
444
443
442
443
444
444
443
442
441
442
443
444
443
442
441
440
441
442
443
443
442
441
440
439
440
441
442
443
442
441
440
439
438
439
440
441
442
442
441
440
439
438
437
438
439
440
441
442
441
440
439
438
437
436
437
438
439
440
441
441
440
439
...

result:

ok 200000 numbers

Extra Test:

score: 0
Extra Test Passed