QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#112590#6364. The Most Expensive Gift8BQube#AC ✓160ms3544kbC++141.1kb2023-06-12 14:27:392023-06-12 14:27:42

Judging History

你现在查看的是最新测评结果

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2023-06-12 14:27:42]
  • 评测
  • 测评结果:AC
  • 用时:160ms
  • 内存:3544kb
  • [2023-06-12 14:27:39]
  • 提交

answer

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
#define X first
#define Y second
#define pb push_back
#define ALL(v) v.begin(), v.end()
#define SZ(a) ((int)a.size())

const int N = 1e4 + 5;
int nxt[N][3];
int n;
int ans;
int p[15];

int chk(int L) {
    int cur = -1;
    int tt = 0;
    while (cur < n) {
        for (int i = 0; cur < n && i < L; i++)
            cur = nxt[cur + 1][p[i]];
        if (cur < n)
            tt += L;      
    }
    // if (L <= 3)
    //     cerr << L << " " << tt << endl;
    return tt;
}

void dfs(int lv) {
    if (lv == 8)
        return;
    for (int i = 0; i < 3; i++) {
        p[lv] = i;
        int r = chk(lv + 1);
        ans = max(ans, r * r / (lv + 1));
        dfs(lv + 1);
    }
}


int main() {
    ios::sync_with_stdio(0), cin.tie(0);
    cin >> n;
    string s;
    cin >> s;
    for (int i = 0; i < 3; i++)
        nxt[n][i] = n;
    for (int i = n - 1; i >= 0; i--)
        for (int j = 0; j < 3; j++)
            nxt[i][j] = (s[i] - 'a' == j ? i : nxt[i + 1][j]);
    dfs(0);
    cout << ans << endl;
}

这程序好像有点Bug,我给组数据试试?

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 3ms
memory: 3320kb

input:

11
abcabacbcac

output:

18

result:

ok 1 number(s): "18"

Test #2:

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

input:

10
aaaaaaaaaa

output:

100

result:

ok 1 number(s): "100"

Test #3:

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

input:

10
aabbbabbba

output:

36

result:

ok 1 number(s): "36"

Test #4:

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

input:

10
acaabbacbb

output:

16

result:

ok 1 number(s): "16"

Test #5:

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

input:

10
abbabaabba

output:

25

result:

ok 1 number(s): "25"

Test #6:

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

input:

10
abcbcacabb

output:

16

result:

ok 1 number(s): "16"

Test #7:

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

input:

10
cbccbcbccb

output:

36

result:

ok 1 number(s): "36"

Test #8:

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

input:

10
abaabaabaa

output:

49

result:

ok 1 number(s): "49"

Test #9:

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

input:

10
abaabaabaa

output:

49

result:

ok 1 number(s): "49"

Test #10:

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

input:

10
bcbcbcbcbc

output:

50

result:

ok 1 number(s): "50"

Test #11:

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

input:

10
aacacbaaca

output:

36

result:

ok 1 number(s): "36"

Test #12:

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

input:

10
aaaaaacaab

output:

64

result:

ok 1 number(s): "64"

Test #13:

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

input:

10
acacacacac

output:

50

result:

ok 1 number(s): "50"

Test #14:

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

input:

10
abacabacab

output:

25

result:

ok 1 number(s): "25"

Test #15:

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

input:

10
aaabaaabaa

output:

64

result:

ok 1 number(s): "64"

Test #16:

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

input:

10
ababacabab

output:

32

result:

ok 1 number(s): "32"

Test #17:

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

input:

10
aaaaabaaaa

output:

81

result:

ok 1 number(s): "81"

Test #18:

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

input:

10
aaaaaaaaaa

output:

100

result:

ok 1 number(s): "100"

Test #19:

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

input:

10
aaaaaaabaa

output:

81

result:

ok 1 number(s): "81"

Test #20:

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

input:

10
abacabacab

output:

25

result:

ok 1 number(s): "25"

Test #21:

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

input:

100
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa

output:

10000

result:

ok 1 number(s): "10000"

Test #22:

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

input:

100
abaaabaabaabbabbabbaaabbbbbbabbbababaaaaabbaaabbbababbbaabaabababababbbabaaaababaababbabbbabbbabaabb

output:

2704

result:

ok 1 number(s): "2704"

Test #23:

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

input:

100
ccbcbcccbcbbbabaabcacbbabbbcbcbcbabbbababbcbaccaacbaabbbccccbcbabcbbcacbbbcaacababbacbaaaaacbaaaacbc

output:

1681

result:

ok 1 number(s): "1681"

Test #24:

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

input:

100
abbabaabbaababbabaababbaabbabaabbaababbaabbabaababbabaabbaababbabaababbaabbabaababbabaabbaababbaabba

output:

2500

result:

ok 1 number(s): "2500"

Test #25:

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

input:

100
abcbcacabbcacababccababcbcabcacababccababcbcaabcbcacabcababcbcaabcbcacabbcacababcbcacababccababcbcaa

output:

1156

result:

ok 1 number(s): "1156"

Test #26:

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

input:

100
acaacacaacaacacaacacaacaacacaacaacacaacacaacaacacaacacaacaacacaacaacacaacacaacaacacaacaacacaacacaaca

output:

3844

result:

ok 1 number(s): "3844"

Test #27:

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

input:

100
abaabaabaabaababaabaabaabaababaabaabaabaababaabaabaabaababaabaabaabaababaabaabaabaababaabaabaabaabab

output:

4096

result:

ok 1 number(s): "4096"

Test #28:

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

input:

100
abaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaa

output:

4489

result:

ok 1 number(s): "4489"

Test #29:

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

input:

100
bcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbc

output:

5000

result:

ok 1 number(s): "5000"

Test #30:

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

input:

100
bacccbacacbcbababbcabbbbbabacbabcbaacbbbbbbaabbbcbabcbbbbcabbcababccbcbabbcbbbaacbccbbabbbbbbbacbbbb

output:

3136

result:

ok 1 number(s): "3136"

Test #31:

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

input:

100
bcabbabbcbbbbbbbbbbbbcbbcbbbcbbbbbbbbbcbabacbabababbcbbbbbcbbabbbbbaabbbbbbbbbbbbbcbbbbbacabcbbbbbbb

output:

5776

result:

ok 1 number(s): "5776"

Test #32:

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

input:

100
abababababababababababababababababababababababababababababababababababababababababababababababababab

output:

5000

result:

ok 1 number(s): "5000"

Test #33:

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

input:

100
cbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbca

output:

2500

result:

ok 1 number(s): "2500"

Test #34:

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

input:

100
aaabaaabaaabaaacaaabaaabaaabaaacaaabaaabaaabaaacaaabaaabaaabaaaaaaabaaabaaabaaacaaabaaabaaabaaacaaab

output:

5776

result:

ok 1 number(s): "5776"

Test #35:

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

input:

100
ababacababacababacababaaababacababacababacababaaababacababacababacababaaababacababacababacababaaabab

output:

2916

result:

ok 1 number(s): "2916"

Test #36:

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

input:

100
aaaaabaaaaabaaaaabaaaaabaaaaabaaaaacaaaaabaaaaabaaaaabaaaaabaaaaabaaaaacaaaaabaaaaabaaaaabaaaaabaaaa

output:

7056

result:

ok 1 number(s): "7056"

Test #37:

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

input:

100
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa

output:

10000

result:

ok 1 number(s): "10000"

Test #38:

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

input:

100
aaaaaaabaaaaaaabaaaaaaacaaaaaaabaaaaaaabaaaaaaacaaaaaaabaaaaaaabaaaaaaacaaaaaaabaaaaaaabaaaaaaacaaaa

output:

7744

result:

ok 1 number(s): "7744"

Test #39:

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

input:

100
abacabacabaaabacabacabaaabacabacabaaabacabacabaaabacabacabaaabacabacabaaabacabacabaaabacabacabaaabac

output:

3364

result:

ok 1 number(s): "3364"

Test #40:

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

input:

1000
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa...

output:

1000000

result:

ok 1 number(s): "1000000"

Test #41:

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

input:

1000
bababbbababaabbbbababaaabbabbaabaabbabbbbbbbabbbabbbababbbbabaabbbabbaaaaaabbaababbbabbaaaabaababaaabbbbbaabaabbaabbaabbabbbabbbaaaaabbabbbbbbabaaaaabaaabaaabababaaaaababbbaabbaaaaabbbbaabaaaaabaabbaaabbabbbbababbabbbaaaaaaaabbbababaaabaabaabbaababaaabbababbaaaabbbaaabbbaabbababbaaaaabbbaababab...

output:

260100

result:

ok 1 number(s): "260100"

Test #42:

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

input:

1000
acbbcacabacccbabcabccccccbaabccaccbcbacccabbaaacbcbbaccbcabcaacbbbbcccabcccbacccabbbcaaacbaabbaccacaccabbbbbbbacaabaaaacaaaaaaabccabbcaaaaabcacabbacacacaaabccbaabbbaccccaaaabbaccbacabccacbbbacbabcabaaacbcacabacbacbaaaabcbcaaaccacaaabbabaabbcaccbcccbccabcabaccbcccbbacbbaabccabccacabbcabccabaaabb...

output:

116964

result:

ok 1 number(s): "116964"

Test #43:

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

input:

1000
abbabaabbaababbabaababbaabbabaabbaababbaabbabaababbabaabbaababbabaababbaabbabaababbabaabbaababbaabbabaabbaababbabaababbaabbabaabbaababbaabbabaababbabaabbaababbaabbabaabbaababbabaababbaabbabaababbabaabbaababbabaababbaabbabaabbaababbaabbabaababbabaabbaababbabaababbaabbabaababbabaabbaababbaabbabaa...

output:

250000

result:

ok 1 number(s): "250000"

Test #44:

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

input:

1000
abcbcacabbcacababccababcbcabcacababccababcbcaabcbcacabcababcbcaabcbcacabbcacababcbcacababccababcbcaabcbcacabcababcbcaabcbcacabbcacababcabcbcacabbcacababccababcbcacababcbcaabcbcacabbcacababcabcbcacabbcacababccababcbcabcacababccababcbcaabcbcacabbcacababccababcbcaabcbcacabcababcbcaabcbcacabbcacaba...

output:

111556

result:

ok 1 number(s): "111556"

Test #45:

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

input:

1000
abaababaabaababaababaabaababaabaababaababaabaababaababaabaababaabaababaababaabaababaabaababaababaabaababaababaabaababaabaababaababaabaababaababaabaababaabaababaababaabaababaabaababaababaabaababaababaabaababaabaababaababaabaababaabaababaababaabaababaababaabaababaabaababaababaabaababaababaabaabab...

output:

381924

result:

ok 1 number(s): "381924"

Test #46:

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

input:

1000
abaabaabaabaababaabaabaabaababaabaabaabaababaabaabaabaababaabaabaabaababaabaabaabaababaabaabaabaababaabaabaabaababaabaabaabaababaabaabaabaababaabaabaabaababaabaabaabaababaabaabaabaababaabaabaabaababaabaabaabaababaabaabaabaababaabaabaabaababaabaabaabaababaabaabaabaababaabaabaabaababaabaabaabaaba...

output:

413449

result:

ok 1 number(s): "413449"

Test #47:

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

input:

1000
abaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaa...

output:

444889

result:

ok 1 number(s): "444889"

Test #48:

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

input:

1000
bcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcb...

output:

500000

result:

ok 1 number(s): "500000"

Test #49:

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

input:

1000
cabaccccbbbaccaccbccbccbbbaccbcccbccbbcacabcaccacaccaacbcbacbcbcabbbbcaccabbcccbacaabccbbccacccbbccbcbbbbcccaccbbbcbcbcccacbcacaaacbbbcbcccaacbbbbcacacbccacabcbbccaababccbccbccbcacabcacaacccbcbcbbcaccccbbacccccacbcacaccbabccccabcacccabbacaccccbcccccaabcccaccabcccacaccacccbbaabcccccccaabcabaccab...

output:

267289

result:

ok 1 number(s): "267289"

Test #50:

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

input:

1000
bcccacccabcabacccccccccccccabccacccccccbbacaccaccccaacacccccccaaccbaacccbccaccaaccbccaccaacbcccccbccacacccccaccacccccacaacabbbaccccbccaacaccaccacbccccacccbacccaacccaacacccccccccccccccbbacacccacacaacccbccacbccccccaccaccccaacacbccaaccacaaaaacacccacacccacabaccabcccabacccaaccccaacacccccccccbbccccaa...

output:

408321

result:

ok 1 number(s): "408321"

Test #51:

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

input:

1000
bababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababab...

output:

500000

result:

ok 1 number(s): "500000"

Test #52:

score: 0
Accepted
time: 14ms
memory: 3392kb

input:

1000
cacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcac...

output:

250000

result:

ok 1 number(s): "250000"

Test #53:

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

input:

1000
aaabaaabaaabaaacaaabaaabaaabaaacaaabaaabaaabaaacaaabaaabaaabaaaaaaabaaabaaabaaacaaabaaabaaabaaacaaabaaabaaabaaacaaabaaabaaabaaaaaaabaaabaaabaaacaaabaaabaaabaaacaaabaaabaaabaaacaaabaaabaaabaaaaaaabaaabaaabaaacaaabaaabaaabaaacaaabaaabaaabaaacaaabaaabaaabaaabaaabaaabaaabaaacaaabaaabaaabaaacaaabaaa...

output:

580644

result:

ok 1 number(s): "580644"

Test #54:

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

input:

1000
ababacababacababacababaaababacababacababacababaaababacababacababacababaaababacababacababacababaaababacababacababacabababababacababacababacababaaababacababacababacababaaababacababacababacababaaababacababacababacababaaababacababacababacabababababacababacababacababaaababacababacababacababaaababaca...

output:

284089

result:

ok 1 number(s): "284089"

Test #55:

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

input:

1000
aaaaabaaaaabaaaaabaaaaabaaaaabaaaaacaaaaabaaaaabaaaaabaaaaabaaaaabaaaaacaaaaabaaaaabaaaaabaaaaabaaaaabaaaaacaaaaabaaaaabaaaaabaaaaabaaaaabaaaaacaaaaabaaaaabaaaaabaaaaabaaaaabaaaaacaaaaabaaaaabaaaaabaaaaabaaaaabaaaaaaaaaaabaaaaabaaaaabaaaaabaaaaabaaaaacaaaaabaaaaabaaaaabaaaaabaaaaabaaaaacaaaaaba...

output:

702244

result:

ok 1 number(s): "702244"

Test #56:

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

input:

899
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa...

output:

808201

result:

ok 1 number(s): "808201"

Test #57:

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

input:

1000
aaaaaaabaaaaaaabaaaaaaacaaaaaaabaaaaaaabaaaaaaacaaaaaaabaaaaaaabaaaaaaacaaaaaaabaaaaaaabaaaaaaacaaaaaaabaaaaaaabaaaaaaacaaaaaaabaaaaaaabaaaaaaacaaaaaaabaaaaaaabaaaaaaacaaaaaaabaaaaaaabaaaaaaaaaaaaaaabaaaaaaabaaaaaaacaaaaaaabaaaaaaabaaaaaaacaaaaaaabaaaaaaabaaaaaaacaaaaaaabaaaaaaabaaaaaaacaaaaaaa...

output:

774400

result:

ok 1 number(s): "774400"

Test #58:

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

input:

1000
abacabacabaaabacabacabaaabacabacabaaabacabacabaaabacabacabaaabacabacabaaabacabacabaaabacabacabaaabacabacabaaabacabacabaaabacabacabaaabacabacabaaabacabacabaaabacabacabaaabacabacabaaabacabacabaaabacabacabaaabacabacabaaabacabacabaaabacabacabaaabacabacabaaabacabacabaaabacabacabaaabacabacabaaabacaba...

output:

339889

result:

ok 1 number(s): "339889"

Test #59:

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

input:

9995
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa...

output:

99900025

result:

ok 1 number(s): "99900025"

Test #60:

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

input:

9995
bababaaabaabaabbabbabbaaabbbbbbabbbababaaaaabbaaabbbababbbaabaabababababbbabaaaababaababbabbbabbbabaabbbbbaababaaaabaaaaaabaabbaaaabbaaababbbabbaabaababbbaabbbbaabbbbabbaabbabababaaabaababaabaabababbabbbabaaabaaabaabbaabbaabababaaaaabaabbabbbaaaabbbabbabbbaaabaaaabbbbaabbaaaabaabbaaaaaababbbaaa...

output:

25391521

result:

ok 1 number(s): "25391521"

Test #61:

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

input:

9995
aaccabbbcbbbcacaacbbccbbbccacabcaccbaccbccbaaaabbbcabbcbbbcabcaabbcbacccaabbcbcbcbccccccccccccccacbccaaaabacbbccbbcccbbcbacbcaabcbbcaccbbcabaabaacaacccbcbaaacbacacbabcaaaaabbbbcaaccaababbcabacbcaacbaababbacaaababacaaabcaacbaababbaabacababacaccbabbccaaaacbaacbcbbcbaccbbccbbccbaaaaabbacbacabbbbaa...

output:

11202409

result:

ok 1 number(s): "11202409"

Test #62:

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

input:

9995
abbabaabbaababbabaababbaabbabaabbaababbaabbabaababbabaabbaababbabaababbaabbabaababbabaabbaababbaabbabaabbaababbabaababbaabbabaabbaababbaabbabaababbabaabbaababbaabbabaabbaababbabaababbaabbabaababbabaabbaababbabaababbaabbabaabbaababbaabbabaababbabaabbaababbabaababbaabbabaababbabaabbaababbaabbabaa...

output:

24980004

result:

ok 1 number(s): "24980004"

Test #63:

score: 0
Accepted
time: 152ms
memory: 3464kb

input:

9995
abcbcacabbcacababccababcbcabcacababccababcbcaabcbcacabcababcbcaabcbcacabbcacababcbcacababccababcbcaabcbcacabcababcbcaabcbcacabbcacababcabcbcacabbcacababccababcbcacababcbcaabcbcacabbcacababcabcbcacabbcacababccababcbcabcacababccababcbcaabcbcacabbcacababccababcbcaabcbcacabcababcbcaabcbcacabbcacaba...

output:

11102224

result:

ok 1 number(s): "11102224"

Test #64:

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

input:

9995
bcbbcbcbbcbbcbcbbcbcbbcbbcbcbbcbbcbcbbcbcbbcbbcbcbbcbcbbcbbcbcbbcbbcbcbbcbcbbcbbcbcbbcbbcbcbbcbcbbcbbcbcbbcbcbbcbbcbcbbcbbcbcbbcbcbbcbbcbcbbcbcbbcbbcbcbbcbbcbcbbcbcbbcbbcbcbbcbbcbcbbcbcbbcbbcbcbbcbcbbcbbcbcbbcbbcbcbbcbcbbcbbcbcbbcbbcbcbbcbcbbcbbcbcbbcbcbbcbbcbcbbcbbcbcbbcbcbbcbbcbcbbcbcbbcbbcbc...

output:

38155329

result:

ok 1 number(s): "38155329"

Test #65:

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

input:

9995
abaabaabaabaababaabaabaabaababaabaabaabaababaabaabaabaababaabaabaabaababaabaabaabaababaabaabaabaababaabaabaabaababaabaabaabaababaabaabaabaababaabaabaabaababaabaabaabaababaabaabaabaababaabaabaabaababaabaabaabaababaabaabaabaababaabaabaabaababaabaabaabaababaabaabaabaababaabaabaabaababaabaabaabaaba...

output:

41293476

result:

ok 1 number(s): "41293476"

Test #66:

score: 0
Accepted
time: 9ms
memory: 3464kb

input:

9995
abaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaa...

output:

44395569

result:

ok 1 number(s): "44395569"

Test #67:

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

input:

9995
bcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcb...

output:

49940018

result:

ok 1 number(s): "49940018"

Test #68:

score: 0
Accepted
time: 121ms
memory: 3420kb

input:

9995
caccaacabcacccabaaaabcbcaacbccbacaabbaaacabcacaacbaccabccbbbcaacbabaababbaababacababaaabaccbaacacccaaacaabbbcabbcabcccacbcbaaabbcbaabbbaabaacacbbaacacaacbabbccbaacacbacacacbcbcabcaaaaaaaabaaaabaacabbacabaaaabaaacbacacacbabacbacbbcaaacaaaccaabbabcabbbccaaccacaccabcbbbaacbbbaaacccaacacabbabacccaa...

output:

24561936

result:

ok 1 number(s): "24561936"

Test #69:

score: 0
Accepted
time: 88ms
memory: 3528kb

input:

9995
acaaaaaababaaaababbaacacbbacaaaaaaccbabbacabbaabaaaababbbbaaacaabcbaaacababaaaabaaaaaacaacabbbabbcbaaaaaabbaaacbabcbaaaabbaaabbabbacaaababababbaaaaaaaacaabaaabaaaababacacaaaabacaaabaabbaabbbaaaaaaaaabbabaaacacccaaabbcaaaacaacacbbbaaaaaaacabaaabbaaaaaaaaaaaaabaabbabaacaaaacaaabcaaacbabbbaabbbaab...

output:

44568976

result:

ok 1 number(s): "44568976"

Test #70:

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

input:

9995
acacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacaca...

output:

49940018

result:

ok 1 number(s): "49940018"

Test #71:

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

input:

9995
abacabacabacabacabacabacabacabacabacabacabacabacabacabacabacabacabacabacabacabacabacabacabacabacabacabacabacabacabacabacabacabacabacabacabacabacabacabacabacabacabacabacabacabacabacabacabacabacabacabacabacabacabacabacabacabacabacabacabacabacabacabacabacabacabacabacabacabacabacabacabacabacabacaba...

output:

24980004

result:

ok 1 number(s): "24980004"

Test #72:

score: 0
Accepted
time: 61ms
memory: 3540kb

input:

9995
aaabaaabaaabaaacaaabaaabaaabaaacaaabaaabaaabaaacaaabaaabaaabaaaaaaabaaabaaabaaacaaabaaabaaabaaacaaabaaabaaabaaacaaabaaabaaabaaaaaaabaaabaaabaaacaaabaaabaaabaaacaaabaaabaaabaaacaaabaaabaaabaaaaaaabaaabaaabaaacaaabaaabaaabaaacaaabaaabaaabaaacaaabaaabaaabaaabaaabaaabaaabaaacaaabaaabaaabaaacaaabaaa...

output:

58003456

result:

ok 1 number(s): "58003456"

Test #73:

score: 0
Accepted
time: 101ms
memory: 3460kb

input:

9995
ababacababacababacababaaababacababacababacababaaababacababacababacababaaababacababacababacababaaababacababacababacabababababacababacababacababaaababacababacababacababaaababacababacababacababaaababacababacababacababaaababacababacababacabababababacababacababacababaaababacababacababacababaaababaca...

output:

28430224

result:

ok 1 number(s): "28430224"

Test #74:

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

input:

9995
aaaaabaaaaabaaaaabaaaaabaaaaabaaaaacaaaaabaaaaabaaaaabaaaaabaaaaabaaaaacaaaaabaaaaabaaaaabaaaaabaaaaabaaaaacaaaaabaaaaabaaaaabaaaaabaaaaabaaaaacaaaaabaaaaabaaaaabaaaaabaaaaabaaaaacaaaaabaaaaabaaaaabaaaaabaaaaabaaaaaaaaaaabaaaaabaaaaabaaaaabaaaaabaaaaacaaaaabaaaaabaaaaabaaaaabaaaaabaaaaacaaaaaba...

output:

70040161

result:

ok 1 number(s): "70040161"

Test #75:

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

input:

899
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa...

output:

808201

result:

ok 1 number(s): "808201"

Test #76:

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

input:

9995
aaaaaaabaaaaaaabaaaaaaacaaaaaaabaaaaaaabaaaaaaacaaaaaaabaaaaaaabaaaaaaacaaaaaaabaaaaaaabaaaaaaacaaaaaaabaaaaaaabaaaaaaacaaaaaaabaaaaaaabaaaaaaacaaaaaaabaaaaaaabaaaaaaacaaaaaaabaaaaaaabaaaaaaaaaaaaaaabaaaaaaabaaaaaaacaaaaaaabaaaaaaabaaaaaaacaaaaaaabaaaaaaabaaaaaaacaaaaaaabaaaaaaabaaaaaaacaaaaaaa...

output:

77281681

result:

ok 1 number(s): "77281681"

Test #77:

score: 0
Accepted
time: 120ms
memory: 3504kb

input:

9995
abacabacabaaabacabacabaaabacabacabaaabacabacabaaabacabacabaaabacabacabaaabacabacabaaabacabacabaaabacabacabaaabacabacabaaabacabacabaaabacabacabaaabacabacabaaabacabacabaaabacabacabaaabacabacabaaabacabacabaaabacabacabaaabacabacabaaabacabacabaaabacabacabaaabacabacabaaabacabacabaaabacabacabaaabacaba...

output:

33988900

result:

ok 1 number(s): "33988900"

Test #78:

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

input:

9996
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa...

output:

99920016

result:

ok 1 number(s): "99920016"

Test #79:

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

input:

9996
aabaabbaaababbbbabbaabaaabababaaaabbbababbbaaaaabaabbaabaabaabbaaabbbabbbbabaaabaaaabbbbbaaaaabbaabbbbabaabaaaabbbbaabbaabbbbaaaaaabababaabaabbabbabbabaaaababababababbaabababbaabaabbaababbbaaabaaabababaabaaaababbaaabaabaaababbbaabbabaababbababaabbbbaababbababaaaababbaaaaaaabbbbaaaababababaabbba...

output:

25270729

result:

ok 1 number(s): "25270729"

Test #80:

score: 0
Accepted
time: 129ms
memory: 3460kb

input:

9996
accbbcbbccbcbcccaccaacaabbbaaaaacacaaababbcbcbaccaabbbbbaaacabbacaabbcbbccacbbcbccabcccabacbacacaccacccbcabbccaababbbacbccccabbcabcbacaacacaccbbbccbccbcbabbcbbcbbabacbaccbccbbacbabbabbaccbababcbcbabacabaaaaaaaccbbbbaccaabbbbacbbbccbbbcacccaabbbcbcaacacabbbaabacccbcbbcbbcccbcaaacaabacccbbcbcbbaa...

output:

11209104

result:

ok 1 number(s): "11209104"

Test #81:

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

input:

9996
abbabaabbaababbabaababbaabbabaabbaababbaabbabaababbabaabbaababbabaababbaabbabaababbabaabbaababbaabbabaabbaababbabaababbaabbabaabbaababbaabbabaababbabaabbaababbaabbabaabbaababbabaababbaabbabaababbabaabbaababbabaababbaabbabaabbaababbaabbabaababbabaabbaababbabaababbaabbabaababbabaabbaababbaabbabaa...

output:

24980004

result:

ok 1 number(s): "24980004"

Test #82:

score: 0
Accepted
time: 155ms
memory: 3480kb

input:

9996
abcbcacabbcacababccababcbcabcacababccababcbcaabcbcacabcababcbcaabcbcacabbcacababcbcacababccababcbcaabcbcacabcababcbcaabcbcacabbcacababcabcbcacabbcacababccababcbcacababcbcaabcbcacabbcacababcabcbcacabbcacababccababcbcabcacababccababcbcaabcbcacabbcacababccababcbcaabcbcacabcababcbcaabcbcacabbcacaba...

output:

11102224

result:

ok 1 number(s): "11102224"

Test #83:

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

input:

9996
abaababaabaababaababaabaababaabaababaababaabaababaababaabaababaabaababaababaabaababaabaababaababaabaababaababaabaababaabaababaababaabaababaababaabaababaabaababaababaabaababaabaababaababaabaababaababaabaababaabaababaababaabaababaabaababaababaabaababaababaabaababaabaababaababaabaababaababaabaabab...

output:

38167684

result:

ok 1 number(s): "38167684"

Test #84:

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

input:

9996
abaabaabaabaababaabaabaabaababaabaabaabaababaabaabaabaababaabaabaabaababaabaabaabaababaabaabaabaababaabaabaabaababaabaabaabaababaabaabaabaababaabaabaabaababaabaabaabaababaabaabaabaababaabaabaabaababaabaabaabaababaabaabaabaababaabaabaabaababaabaabaabaababaabaabaabaababaabaabaabaababaabaabaabaaba...

output:

41293476

result:

ok 1 number(s): "41293476"

Test #85:

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

input:

9996
abaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaa...

output:

44408896

result:

ok 1 number(s): "44408896"

Test #86:

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

input:

9996
bcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcb...

output:

49960008

result:

ok 1 number(s): "49960008"

Test #87:

score: 0
Accepted
time: 115ms
memory: 3540kb

input:

9996
bcbcccabcbcccbbcbccaaacbccbbbcacccacacbcbabccccbcacbcaacbcbacbcaacbcbbcaaaaacbbcaccacaaccabbcaacbacbaaacbbcbaaccbcbccaacacacbabacccccccbaaacccacabcaacccacacbbcccbccbacbcbcbcccbcbaccccbbacbbaacccccaccccacbcccbcccbbacccbcccccbcaabbbacccbacacccbaccbacbcbabcbbaabcaaccbbabccaabbabbccbbaaacccccbccacb...

output:

24206400

result:

ok 1 number(s): "24206400"

Test #88:

score: 0
Accepted
time: 79ms
memory: 3536kb

input:

9996
cbcabbbbabbbbaccbcbbcbbbbbcbcbbbbbababbbbbabcbcbbbbbbcccbcbbbabacbcbabbcbbbcbbbccbcabbbbbbbcabbcbbbbbcbbcbabbbbbbbbbbbcbbbbabbbbbbbbbbbcbbcbbbbbbbbcbbcbbbbcbcbbbabbbccbccbbcbcbbcbbbbcbacbaccbbcccbbbccacbcbccbabbbcbbabccbbbaababbcccccbbbbbbccbbccbbbbbaababbabbbbabcbbbbbbcbbbcbcbbbcccbcbbcbbccbcb...

output:

44542276

result:

ok 1 number(s): "44542276"

Test #89:

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

input:

9996
cbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbc...

output:

49960008

result:

ok 1 number(s): "49960008"

Test #90:

score: 0
Accepted
time: 125ms
memory: 3424kb

input:

9996
acabacabacabacabacabacabacabacabacabacabacabacabacabacabacabacabacabacabacabacabacabacabacabacabacabacabacabacabacabacabacabacabacabacabacabacabacabacabacabacabacabacabacabacabacabacabacabacabacabacabacabacabacabacabacabacabacabacabacabacabacabacabacabacabacabacabacabacabacabacabacabacabacabaca...

output:

24980004

result:

ok 1 number(s): "24980004"

Test #91:

score: 0
Accepted
time: 63ms
memory: 3416kb

input:

9996
aaabaaabaaabaaacaaabaaabaaabaaacaaabaaabaaabaaacaaabaaabaaabaaaaaaabaaabaaabaaacaaabaaabaaabaaacaaabaaabaaabaaacaaabaaabaaabaaaaaaabaaabaaabaaacaaabaaabaaabaaacaaabaaabaaabaaacaaabaaabaaabaaaaaaabaaabaaabaaacaaabaaabaaabaaacaaabaaabaaabaaacaaabaaabaaabaaabaaabaaabaaabaaacaaabaaabaaabaaacaaabaaa...

output:

58003456

result:

ok 1 number(s): "58003456"

Test #92:

score: 0
Accepted
time: 101ms
memory: 3424kb

input:

9996
ababacababacababacababaaababacababacababacababaaababacababacababacababaaababacababacababacababaaababacababacababacabababababacababacababacababaaababacababacababacababaaababacababacababacababaaababacababacababacababaaababacababacababacabababababacababacababacababaaababacababacababacababaaababaca...

output:

28430224

result:

ok 1 number(s): "28430224"

Test #93:

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

input:

9996
aaaaabaaaaabaaaaabaaaaabaaaaabaaaaacaaaaabaaaaabaaaaabaaaaabaaaaabaaaaacaaaaabaaaaabaaaaabaaaaabaaaaabaaaaacaaaaabaaaaabaaaaabaaaaabaaaaabaaaaacaaaaabaaaaabaaaaabaaaaabaaaaabaaaaacaaaaabaaaaabaaaaabaaaaabaaaaabaaaaaaaaaaabaaaaabaaaaabaaaaabaaaaabaaaaacaaaaabaaaaabaaaaabaaaaabaaaaabaaaaacaaaaaba...

output:

70040161

result:

ok 1 number(s): "70040161"

Test #94:

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

input:

899
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa...

output:

808201

result:

ok 1 number(s): "808201"

Test #95:

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

input:

9996
aaaaaaabaaaaaaabaaaaaaacaaaaaaabaaaaaaabaaaaaaacaaaaaaabaaaaaaabaaaaaaacaaaaaaabaaaaaaabaaaaaaacaaaaaaabaaaaaaabaaaaaaacaaaaaaabaaaaaaabaaaaaaacaaaaaaabaaaaaaabaaaaaaacaaaaaaabaaaaaaabaaaaaaaaaaaaaaabaaaaaaabaaaaaaacaaaaaaabaaaaaaabaaaaaaacaaaaaaabaaaaaaabaaaaaaacaaaaaaabaaaaaaabaaaaaaacaaaaaaa...

output:

77299264

result:

ok 1 number(s): "77299264"

Test #96:

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

input:

9996
abacabacabaaabacabacabaaabacabacabaaabacabacabaaabacabacabaaabacabacabaaabacabacabaaabacabacabaaabacabacabaaabacabacabaaabacabacabaaabacabacabaaabacabacabaaabacabacabaaabacabacabaaabacabacabaaabacabacabaaabacabacabaaabacabacabaaabacabacabaaabacabacabaaabacabacabaaabacabacabaaabacabacabaaabacaba...

output:

34000561

result:

ok 1 number(s): "34000561"

Test #97:

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

input:

9997
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa...

output:

99940009

result:

ok 1 number(s): "99940009"

Test #98:

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

input:

9997
aaabaaababaaaabbabaaabaabaaaabaabbaaababababbbbbabaaaaabbabbbaabbabbbbabaabbbababbbbabaaaababaabaabbbbaabaaaabbbaaaabababbbabbbbaabbabbabbbaabaaabbbabbabbababaaaaabbbabbbbbabbaaababbaababbbbbaaaabaabbabaaababbaabaaaaabbbbaabbbbaabaabbabbaabbaababbbaabaaaaabaabbaaabbababaaaabbabbbaaaabbbaabaabba...

output:

25140196

result:

ok 1 number(s): "25140196"

Test #99:

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

input:

9997
caaacccccaccacabbcbcabacbbbcbbcaacccabbbcbcabababbbbcbbcaacbccbaabbbccbcabbaacbbcbccababbcbcbbacacacccabacbabbbacccabaaccabaccabccabaaabcbbbcbcaabbaacbabbacaabbbccbccabbbaabababaaabbaabcaaabacccacbaacaababbccbbbbaaabbacacacacbcbcccaacccccbbbaaaccacbaccbaabccabababcabbbbbaabcbcccababbaaabbccbcba...

output:

11343424

result:

ok 1 number(s): "11343424"

Test #100:

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

input:

9997
abbabaabbaababbabaababbaabbabaabbaababbaabbabaababbabaabbaababbabaababbaabbabaababbabaabbaababbaabbabaabbaababbabaababbaabbabaabbaababbaabbabaababbabaabbaababbaabbabaabbaababbabaababbaabbabaababbabaabbaababbabaababbaabbabaabbaababbaabbabaababbabaabbaababbabaababbaabbabaababbabaabbaababbaabbabaa...

output:

24990001

result:

ok 1 number(s): "24990001"

Test #101:

score: 0
Accepted
time: 148ms
memory: 3464kb

input:

9997
abcbcacabbcacababccababcbcabcacababccababcbcaabcbcacabcababcbcaabcbcacabbcacababcbcacababccababcbcaabcbcacabcababcbcaabcbcacabbcacababcabcbcacabbcacababccababcbcacababcbcaabcbcacabbcacababcabcbcacabbcacababccababcbcabcacababccababcbcaabcbcacabbcacababccababcbcaabcbcacabcababcbcaabcbcacabbcacaba...

output:

11108889

result:

ok 1 number(s): "11108889"

Test #102:

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

input:

9997
caccacaccaccacaccacaccaccacaccaccacaccacaccaccacaccacaccaccacaccaccacaccacaccaccacaccaccacaccacaccaccacaccacaccaccacaccaccacaccacaccaccacaccacaccaccacaccaccacaccacaccaccacaccaccacaccacaccaccacaccacaccaccacaccaccacaccacaccaccacaccaccacaccacaccaccacaccacaccaccacaccaccacaccacaccaccacaccacaccaccaca...

output:

38180041

result:

ok 1 number(s): "38180041"

Test #103:

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

input:

9997
abaabaabaabaababaabaabaabaababaabaabaabaababaabaabaabaababaabaabaabaababaabaabaabaababaabaabaabaababaabaabaabaababaabaabaabaababaabaabaabaababaabaabaabaababaabaabaabaababaabaabaabaababaabaabaabaababaabaabaabaababaabaabaabaababaabaabaabaababaabaabaabaababaabaabaabaababaabaabaabaababaabaabaabaaba...

output:

41306329

result:

ok 1 number(s): "41306329"

Test #104:

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

input:

9997
abaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaa...

output:

44422225

result:

ok 1 number(s): "44422225"

Test #105:

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

input:

9997
bcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcb...

output:

49960008

result:

ok 1 number(s): "49960008"

Test #106:

score: 0
Accepted
time: 119ms
memory: 3500kb

input:

9997
bbbbbbccacbbcbbcbcccababcbbbbbcacccbabaabbcbbbbabbcbbcbcabbcaacccbbaccbbcbcabbccbcaaabcbcabbbbbbcbcbbbcbbbbbbcabaaabbabacacbbbbbbccbacaaabbaacaabcbbababbbacbbbcbbbbbbabcccccccbbbbccacbbbabbacabbbcbbbcabbabcbcbbbbcbbbaacabcbcccbabbbbcbbcbbbccbabbbbacbbabcbcacabcbbcabbbabbbbccbacbaacbaabbabbababb...

output:

24820324

result:

ok 1 number(s): "24820324"

Test #107:

score: 0
Accepted
time: 84ms
memory: 3508kb

input:

9997
cccaacccaabcaaccccccbbacaccccbacccabccaccaacbccbcacaccaccacccbaacccccccccccaacacccccabccbcaccccbacbabcccccccacccacccbcbacccbcccbcbccccbcacccccccaacacacccccbcacabcaccaccacacabcacbcccaccacccabccacacccccbcacccccccccacacbcbcacccacacccacbcabccacacacbaccccccccccccccccccccbbbbcabccacaccccacccccccbacba...

output:

44049769

result:

ok 1 number(s): "44049769"

Test #108:

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

input:

9997
cacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacac...

output:

49960008

result:

ok 1 number(s): "49960008"

Test #109:

score: 0
Accepted
time: 125ms
memory: 3536kb

input:

9997
bcbabcbabcbabcbabcbabcbabcbabcbabcbabcbabcbabcbabcbabcbabcbabcbabcbabcbabcbabcbabcbabcbabcbabcbabcbabcbabcbabcbabcbabcbabcbabcbabcbabcbabcbabcbabcbabcbabcbabcbabcbabcbabcbabcbabcbabcbabcbabcbabcbabcbabcbabcbabcbabcbabcbabcbabcbabcbabcbabcbabcbabcbabcbabcbabcbabcbabcbabcbabcbabcbabcbabcbabcbabcb...

output:

24990001

result:

ok 1 number(s): "24990001"

Test #110:

score: 0
Accepted
time: 60ms
memory: 3428kb

input:

9997
aaabaaabaaabaaacaaabaaabaaabaaacaaabaaabaaabaaacaaabaaabaaabaaaaaaabaaabaaabaaacaaabaaabaaabaaacaaabaaabaaabaaacaaabaaabaaabaaaaaaabaaabaaabaaacaaabaaabaaabaaacaaabaaabaaabaaacaaabaaabaaabaaaaaaabaaabaaabaaacaaabaaabaaabaaacaaabaaabaaabaaacaaabaaabaaabaaabaaabaaabaaabaaacaaabaaabaaabaaacaaabaaa...

output:

58018689

result:

ok 1 number(s): "58018689"

Test #111:

score: 0
Accepted
time: 101ms
memory: 3408kb

input:

9997
ababacababacababacababaaababacababacababacababaaababacababacababacababaaababacababacababacababaaababacababacababacabababababacababacababacababaaababacababacababacababaaababacababacababacababaaababacababacababacababaaababacababacababacabababababacababacababacababaaababacababacababacababaaababaca...

output:

28440889

result:

ok 1 number(s): "28440889"

Test #112:

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

input:

9997
aaaaabaaaaabaaaaabaaaaabaaaaabaaaaacaaaaabaaaaabaaaaabaaaaabaaaaabaaaaacaaaaabaaaaabaaaaabaaaaabaaaaabaaaaacaaaaabaaaaabaaaaabaaaaabaaaaabaaaaacaaaaabaaaaabaaaaabaaaaabaaaaabaaaaacaaaaabaaaaabaaaaabaaaaabaaaaabaaaaaaaaaaabaaaaabaaaaabaaaaabaaaaabaaaaacaaaaabaaaaabaaaaabaaaaabaaaaabaaaaacaaaaaba...

output:

70056900

result:

ok 1 number(s): "70056900"

Test #113:

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

input:

899
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa...

output:

808201

result:

ok 1 number(s): "808201"

Test #114:

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

input:

9997
aaaaaaabaaaaaaabaaaaaaacaaaaaaabaaaaaaabaaaaaaacaaaaaaabaaaaaaabaaaaaaacaaaaaaabaaaaaaabaaaaaaacaaaaaaabaaaaaaabaaaaaaacaaaaaaabaaaaaaabaaaaaaacaaaaaaabaaaaaaabaaaaaaacaaaaaaabaaaaaaabaaaaaaaaaaaaaaabaaaaaaabaaaaaaacaaaaaaabaaaaaaabaaaaaaacaaaaaaabaaaaaaabaaaaaaacaaaaaaabaaaaaaabaaaaaaacaaaaaaa...

output:

77316849

result:

ok 1 number(s): "77316849"

Test #115:

score: 0
Accepted
time: 120ms
memory: 3484kb

input:

9997
abacabacabaaabacabacabaaabacabacabaaabacabacabaaabacabacabaaabacabacabaaabacabacabaaabacabacabaaabacabacabaaabacabacabaaabacabacabaaabacabacabaaabacabacabaaabacabacabaaabacabacabaaabacabacabaaabacabacabaaabacabacabaaabacabacabaaabacabacabaaabacabacabaaabacabacabaaabacabacabaaabacabacabaaabacaba...

output:

34012224

result:

ok 1 number(s): "34012224"

Test #116:

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

input:

9998
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa...

output:

99960004

result:

ok 1 number(s): "99960004"

Test #117:

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

input:

9998
baabbabbbbbabbaabababaaababababbaabbaaaabaabaabababbbbabbbabaabbbbabaababaaabaabababaabaabbbbaabbaabbabaaabaabbbabbbabaabaaaababaabbaaaababbbaababbabaabbaabbbbaabbbabbababbaabbaaaabbbaaaababbabbbbbbbbbaabbbbbaaabbbabaaaaaabaabaabbaaaaababbbabbaaabaababaaabaaaabaabaaababbbaaaaaaabbaaaababbaabaaa...

output:

25240576

result:

ok 1 number(s): "25240576"

Test #118:

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

input:

9998
bcbcbcacabaabbbcccabacaaccacaaabaaaccaabcacbbcbbcbbacbbbaaaaccbbcbabcabcacaccacacbcbbccbbccbaccbabbaabccacbbaabacabcbbacbcbcbbaaaaacabacbccacbbbaaaabcabbcaaacaccaabcbbbccbcccbbabacaabaccbbbcbcaccacbbbcbaacccbccbcccabaaaacaacccacccacbcacaabcaacbbabaaaaaaabaabaacbabbbbcbacabacaabaaccbaabcaaacabcc...

output:

11142244

result:

ok 1 number(s): "11142244"

Test #119:

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

input:

9998
abbabaabbaababbabaababbaabbabaabbaababbaabbabaababbabaabbaababbabaababbaabbabaababbabaabbaababbaabbabaabbaababbabaababbaabbabaabbaababbaabbabaababbabaabbaababbaabbabaabbaababbabaababbaabbabaababbabaabbaababbabaababbaabbabaabbaababbaabbabaababbabaabbaababbabaababbaabbabaababbabaabbaababbaabbabaa...

output:

24990001

result:

ok 1 number(s): "24990001"

Test #120:

score: 0
Accepted
time: 160ms
memory: 3524kb

input:

9998
abcbcacabbcacababccababcbcabcacababccababcbcaabcbcacabcababcbcaabcbcacabbcacababcbcacababccababcbcaabcbcacabcababcbcaabcbcacabbcacababcabcbcacabbcacababccababcbcacababcbcaabcbcacabbcacababcabcbcacabbcacababccababcbcabcacababccababcbcaabcbcacabbcacababccababcbcaabcbcacabcababcbcaabcbcacabbcacaba...

output:

11108889

result:

ok 1 number(s): "11108889"

Test #121:

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

input:

9998
acaacacaacaacacaacacaacaacacaacaacacaacacaacaacacaacacaacaacacaacaacacaacacaacaacacaacaacacaacacaacaacacaacacaacaacacaacaacacaacacaacaacacaacacaacaacacaacaacacaacacaacaacacaacaacacaacacaacaacacaacacaacaacacaacaacacaacacaacaacacaacaacacaacacaacaacacaacacaacaacacaacaacacaacacaacaacacaacacaacaacac...

output:

38180041

result:

ok 1 number(s): "38180041"

Test #122:

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

input:

9998
abaabaabaabaababaabaabaabaababaabaabaabaababaabaabaabaababaabaabaabaababaabaabaabaababaabaabaabaababaabaabaabaababaabaabaabaababaabaabaabaababaabaabaabaababaabaabaabaababaabaabaabaababaabaabaabaababaabaabaabaababaabaabaabaababaabaabaabaababaabaabaabaababaabaabaabaababaabaabaabaababaabaabaabaaba...

output:

41306329

result:

ok 1 number(s): "41306329"

Test #123:

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

input:

9998
abaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaa...

output:

44422225

result:

ok 1 number(s): "44422225"

Test #124:

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

input:

9998
bcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcb...

output:

49980002

result:

ok 1 number(s): "49980002"

Test #125:

score: 0
Accepted
time: 119ms
memory: 3536kb

input:

9998
aaccbbcababaaabacbbcacbbbbaaaaaaaaacabcccbbbbcaaacbbbaaaaaabbcaacacacacabaabacacaacbacbbbaaacaabbcabaabaabbcbaaaaabcbbaacabacbaaaccbaacacaabaaacbbacbbaaaaabcaccaabaaaaaabbbacacbacabcccaacacbcbabaaaaaabbacbbbbaacacabcaaababbbabaaaaacbababbbaabaabbccaaacbacbaaabcbcaccbcbabaacccbcabaaabcaabcaacaac...

output:

24730729

result:

ok 1 number(s): "24730729"

Test #126:

score: 0
Accepted
time: 88ms
memory: 3524kb

input:

9998
bacbbccbccbcaacccccbccacacacaccccbcaccaacccbcccbccabacccccccbcccccbbbcccbccccccabcbccccccacaccccbcccccccbbabbbabcbcccccaccbcbccbccccccbabbbabccabccccacccacbcbbccaccccbcbbccccccccbbccbcabcaabcacbabcccccacacbccabcccaacccbccbccbbcacbcbccbccbbbabccbcccbacccccccccccabbcbacacbcbccccaccccbccccacbcbbbc...

output:

43877376

result:

ok 1 number(s): "43877376"

Test #127:

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

input:

9998
bababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababab...

output:

49980002

result:

ok 1 number(s): "49980002"

Test #128:

score: 0
Accepted
time: 133ms
memory: 3432kb

input:

9998
babcbabcbabcbabcbabcbabcbabcbabcbabcbabcbabcbabcbabcbabcbabcbabcbabcbabcbabcbabcbabcbabcbabcbabcbabcbabcbabcbabcbabcbabcbabcbabcbabcbabcbabcbabcbabcbabcbabcbabcbabcbabcbabcbabcbabcbabcbabcbabcbabcbabcbabcbabcbabcbabcbabcbabcbabcbabcbabcbabcbabcbabcbabcbabcbabcbabcbabcbabcbabcbabcbabcbabcbabcbab...

output:

24990001

result:

ok 1 number(s): "24990001"

Test #129:

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

input:

9998
aaabaaabaaabaaacaaabaaabaaabaaacaaabaaabaaabaaacaaabaaabaaabaaaaaaabaaabaaabaaacaaabaaabaaabaaacaaabaaabaaabaaacaaabaaabaaabaaaaaaabaaabaaabaaacaaabaaabaaabaaacaaabaaabaaabaaacaaabaaabaaabaaaaaaabaaabaaabaaacaaabaaabaaabaaacaaabaaabaaabaaacaaabaaabaaabaaabaaabaaabaaabaaacaaabaaabaaabaaacaaabaaa...

output:

58033924

result:

ok 1 number(s): "58033924"

Test #130:

score: 0
Accepted
time: 100ms
memory: 3488kb

input:

9998
ababacababacababacababaaababacababacababacababaaababacababacababacababaaababacababacababacababaaababacababacababacabababababacababacababacababaaababacababacababacababaaababacababacababacababaaababacababacababacababaaababacababacababacabababababacababacababacababaaababacababacababacababaaababaca...

output:

28440889

result:

ok 1 number(s): "28440889"

Test #131:

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

input:

9998
aaaaabaaaaabaaaaabaaaaabaaaaabaaaaacaaaaabaaaaabaaaaabaaaaabaaaaabaaaaacaaaaabaaaaabaaaaabaaaaabaaaaabaaaaacaaaaabaaaaabaaaaabaaaaabaaaaabaaaaacaaaaabaaaaabaaaaabaaaaabaaaaabaaaaacaaaaabaaaaabaaaaabaaaaabaaaaabaaaaaaaaaaabaaaaabaaaaabaaaaabaaaaabaaaaacaaaaabaaaaabaaaaabaaaaabaaaaabaaaaacaaaaaba...

output:

70073641

result:

ok 1 number(s): "70073641"

Test #132:

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

input:

899
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa...

output:

808201

result:

ok 1 number(s): "808201"

Test #133:

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

input:

9998
aaaaaaabaaaaaaabaaaaaaacaaaaaaabaaaaaaabaaaaaaacaaaaaaabaaaaaaabaaaaaaacaaaaaaabaaaaaaabaaaaaaacaaaaaaabaaaaaaabaaaaaaacaaaaaaabaaaaaaabaaaaaaacaaaaaaabaaaaaaabaaaaaaacaaaaaaabaaaaaaabaaaaaaaaaaaaaaabaaaaaaabaaaaaaacaaaaaaabaaaaaaabaaaaaaacaaaaaaabaaaaaaabaaaaaaacaaaaaaabaaaaaaabaaaaaaacaaaaaaa...

output:

77334436

result:

ok 1 number(s): "77334436"

Test #134:

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

input:

9998
abacabacabaaabacabacabaaabacabacabaaabacabacabaaabacabacabaaabacabacabaaabacabacabaaabacabacabaaabacabacabaaabacabacabaaabacabacabaaabacabacabaaabacabacabaaabacabacabaaabacabacabaaabacabacabaaabacabacabaaabacabacabaaabacabacabaaabacabacabaaabacabacabaaabacabacabaaabacabacabaaabacabacabaaabacaba...

output:

34012224

result:

ok 1 number(s): "34012224"

Test #135:

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

input:

9999
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa...

output:

99980001

result:

ok 1 number(s): "99980001"

Test #136:

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

input:

9999
abababbabbaaaaaabaaabaabaabbbabbbbbbaabaabbbbbababaaabababbabbaababbabaabaaabaaaabbababbbbabaabbbaaaaaaaaaaabbabbbaaabaabbabbaabbabaababaaabbbbbbbababbbabbbababaabbbbaaaaabbaababaaabaabbabababaabaabbbababaabbabbbababbaabbbabbbbbbbbabbaabbaaaaababaabbaababbbabbbaaaaabaabaabbaabaaaaababbbaabbbaaa...

output:

25959025

result:

ok 1 number(s): "25959025"

Test #137:

score: 0
Accepted
time: 137ms
memory: 3412kb

input:

9999
babababacccabaababcabbcaabccacaacbcabbccbbcbabacbaaacbcabbcabaaaabbcaabbcacaaaaabacaabbcaacbbcabccccbabcbababacabaacbacabaaabbbababaabcbbccbcbaabaccccbbbbacbcbacaccbccaabcccbabbcaccaabaacaabcabbcaaccbabccaacaabacabcbcabbabcaaacccabbaacbbbcabccccacbabbccbcbbbcbbaabaaaacaababcacacccbcbaacbbaccabb...

output:

11682724

result:

ok 1 number(s): "11682724"

Test #138:

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

input:

9999
abbabaabbaababbabaababbaabbabaabbaababbaabbabaababbabaabbaababbabaababbaabbabaababbabaabbaababbaabbabaabbaababbabaababbaabbabaabbaababbaabbabaababbabaabbaababbaabbabaabbaababbabaababbaabbabaababbabaabbaababbabaababbaabbabaabbaababbaabbabaababbabaabbaababbabaababbaabbabaababbabaabbaababbaabbabaa...

output:

25000000

result:

ok 1 number(s): "25000000"

Test #139:

score: 0
Accepted
time: 156ms
memory: 3500kb

input:

9999
abcbcacabbcacababccababcbcabcacababccababcbcaabcbcacabcababcbcaabcbcacabbcacababcbcacababccababcbcaabcbcacabcababcbcaabcbcacabbcacababcabcbcacabbcacababccababcbcacababcbcaabcbcacabbcacababcabcbcacabbcacababccababcbcabcacababccababcbcaabcbcacabbcacababccababcbcaabcbcacabcababcbcaabcbcacabbcacaba...

output:

11108889

result:

ok 1 number(s): "11108889"

Test #140:

score: 0
Accepted
time: 9ms
memory: 3424kb

input:

9999
acaacacaacaacacaacacaacaacacaacaacacaacacaacaacacaacacaacaacacaacaacacaacacaacaacacaacaacacaacacaacaacacaacacaacaacacaacaacacaacacaacaacacaacacaacaacacaacaacacaacacaacaacacaacaacacaacacaacaacacaacacaacaacacaacaacacaacacaacaacacaacaacacaacacaacaacacaacacaacaacacaacaacacaacacaacaacacaacacaacaacac...

output:

38192400

result:

ok 1 number(s): "38192400"

Test #141:

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

input:

9999
abaabaabaabaababaabaabaabaababaabaabaabaababaabaabaabaababaabaabaabaababaabaabaabaababaabaabaabaababaabaabaabaababaabaabaabaababaabaabaabaababaabaabaabaababaabaabaabaababaabaabaabaababaabaabaabaababaabaabaabaababaabaabaabaababaabaabaabaababaabaabaabaababaabaabaabaababaabaabaabaababaabaabaabaaba...

output:

41319184

result:

ok 1 number(s): "41319184"

Test #142:

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

input:

9999
abaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaa...

output:

44435556

result:

ok 1 number(s): "44435556"

Test #143:

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

input:

9999
bcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcb...

output:

49980002

result:

ok 1 number(s): "49980002"

Test #144:

score: 0
Accepted
time: 122ms
memory: 3540kb

input:

9999
bbccbbabbbbcabbbaabbbbbcbbbbbababacabaaababbbbabbabbbcccbbbbbccbbaabcbabbbbabbbacaaccabcbcababccaaaabcabcbbbaabbbbbabacacabbacbaccacbaabbbaabacbbaacaaabbcbbcbbccbcbbbbbbccbbaccbbcbacbabcbacbbccbbbabaaccacbacacbbbbbbccaccaabbacabaabbcacabbbaabbacabccbabccbccacbcbbcababbbcaabcccbccbbbbbbabbcbacbc...

output:

24730729

result:

ok 1 number(s): "24730729"

Test #145:

score: 0
Accepted
time: 89ms
memory: 3536kb

input:

9999
bbbbbbbaaaabaabbacbbabbbbcbbbbbbbbbaccbbbbbbbaabbbbacabbbbbabbabcabcbbbbbabbbabbbbbbabbbbabcbbbbbbacbbbbabbababbbcbbbabcabbcbbabbbbbbbcbcacbbcbbacbbbcbbbcbbcabbabbabcbbbbbbbbbbaabbbaabbbaaababbbbbacbbabaababbbbbbbbcaabbbbbbabbbacbbbabbbcbbbababbcbbaabccaabbcbbbababaabbbbbabbbbbbbabbbbbbbabbbaba...

output:

44368921

result:

ok 1 number(s): "44368921"

Test #146:

score: 0
Accepted
time: 14ms
memory: 3424kb

input:

9999
cbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbc...

output:

49980002

result:

ok 1 number(s): "49980002"

Test #147:

score: 0
Accepted
time: 133ms
memory: 3464kb

input:

9999
acabacabacabacabacabacabacabacabacabacabacabacabacabacabacabacabacabacabacabacabacabacabacabacabacabacabacabacabacabacabacabacabacabacabacabacabacabacabacabacabacabacabacabacabacabacabacabacabacabacabacabacabacabacabacabacabacabacabacabacabacabacabacabacabacabacabacabacabacabacabacabacabacabaca...

output:

25000000

result:

ok 1 number(s): "25000000"

Test #148:

score: 0
Accepted
time: 64ms
memory: 3460kb

input:

9999
aaabaaabaaabaaacaaabaaabaaabaaacaaabaaabaaabaaacaaabaaabaaabaaaaaaabaaabaaabaaacaaabaaabaaabaaacaaabaaabaaabaaacaaabaaabaaabaaaaaaabaaabaaabaaacaaabaaabaaabaaacaaabaaabaaabaaacaaabaaabaaabaaaaaaabaaabaaabaaacaaabaaabaaabaaacaaabaaabaaabaaacaaabaaabaaabaaabaaabaaabaaabaaacaaabaaabaaabaaacaaabaaa...

output:

58049161

result:

ok 1 number(s): "58049161"

Test #149:

score: 0
Accepted
time: 107ms
memory: 3428kb

input:

9999
ababacababacababacababaaababacababacababacababaaababacababacababacababaaababacababacababacababaaababacababacababacabababababacababacababacababaaababacababacababacababaaababacababacababacababaaababacababacababacababaaababacababacababacabababababacababacababacababaaababacababacababacababaaababaca...

output:

28451556

result:

ok 1 number(s): "28451556"

Test #150:

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

input:

9999
aaaaabaaaaabaaaaabaaaaabaaaaabaaaaacaaaaabaaaaabaaaaabaaaaabaaaaabaaaaacaaaaabaaaaabaaaaabaaaaabaaaaabaaaaacaaaaabaaaaabaaaaabaaaaabaaaaabaaaaacaaaaabaaaaabaaaaabaaaaabaaaaabaaaaacaaaaabaaaaabaaaaabaaaaabaaaaabaaaaaaaaaaabaaaaabaaaaabaaaaabaaaaabaaaaacaaaaabaaaaabaaaaabaaaaabaaaaabaaaaacaaaaaba...

output:

70090384

result:

ok 1 number(s): "70090384"

Test #151:

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

input:

899
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa...

output:

808201

result:

ok 1 number(s): "808201"

Test #152:

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

input:

9999
aaaaaaabaaaaaaabaaaaaaacaaaaaaabaaaaaaabaaaaaaacaaaaaaabaaaaaaabaaaaaaacaaaaaaabaaaaaaabaaaaaaacaaaaaaabaaaaaaabaaaaaaacaaaaaaabaaaaaaabaaaaaaacaaaaaaabaaaaaaabaaaaaaacaaaaaaabaaaaaaabaaaaaaaaaaaaaaabaaaaaaabaaaaaaacaaaaaaabaaaaaaabaaaaaaacaaaaaaabaaaaaaabaaaaaaacaaaaaaabaaaaaaabaaaaaaacaaaaaaa...

output:

77352025

result:

ok 1 number(s): "77352025"

Test #153:

score: 0
Accepted
time: 120ms
memory: 3464kb

input:

9999
abacabacabaaabacabacabaaabacabacabaaabacabacabaaabacabacabaaabacabacabaaabacabacabaaabacabacabaaabacabacabaaabacabacabaaabacabacabaaabacabacabaaabacabacabaaabacabacabaaabacabacabaaabacabacabaaabacabacabaaabacabacabaaabacabacabaaabacabacabaaabacabacabaaabacabacabaaabacabacabaaabacabacabaaabacaba...

output:

34023889

result:

ok 1 number(s): "34023889"

Test #154:

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

input:

10000
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa...

output:

100000000

result:

ok 1 number(s): "100000000"

Test #155:

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

input:

10000
babaaaaabaabbabbaaaabbbbbaaabaaaabbabbbbaabbbaababbaaaaabbbaaabbbbbabaabbabbbabaabaabbababaabbaaaabbbaaabbbbababaaababbaaababaabbaabbbabbababbbabaabbbabbbabbaaabababbabbbbbbababaaaabbabaaababbaaabaaaabaaababbabaaabbaabbabbabbabababaabbbabbbbbabaaaaababababbbbaabaabbabababbabbabbaabababbabababa...

output:

25938649

result:

ok 1 number(s): "25938649"

Test #156:

score: 0
Accepted
time: 129ms
memory: 3480kb

input:

10000
caabbabacaccccacaaaabaccabcbcbcacacaaabaaacccbabacbacbbacabbbbabbcbbccbbcbaccaccccacaacacbcccccbccaacabbbcaaabacbbaabacbabccbbccccabacbcbbaaabbbaabcbbcccbbcbcccbcaacbababcbbcacbaaacbbccbcbbcccabaabbacbbccaaccbbabcabaacbbcccacccbccbabaaaaaccccacccacccccbaaccbcbbcaaabababcbaaabcccbccaacacaaaabca...

output:

11195716

result:

ok 1 number(s): "11195716"

Test #157:

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

input:

10000
abbabaabbaababbabaababbaabbabaabbaababbaabbabaababbabaabbaababbabaababbaabbabaababbabaabbaababbaabbabaabbaababbabaababbaabbabaabbaababbaabbabaababbabaabbaababbaabbabaabbaababbabaababbaabbabaababbabaabbaababbabaababbaabbabaabbaababbaabbabaababbabaabbaababbabaababbaabbabaababbabaabbaababbaabbaba...

output:

25000000

result:

ok 1 number(s): "25000000"

Test #158:

score: 0
Accepted
time: 153ms
memory: 3508kb

input:

10000
abcbcacabbcacababccababcbcabcacababccababcbcaabcbcacabcababcbcaabcbcacabbcacababcbcacababccababcbcaabcbcacabcababcbcaabcbcacabbcacababcabcbcacabbcacababccababcbcacababcbcaabcbcacabbcacababcabcbcacabbcacababccababcbcabcacababccababcbcaabcbcacabbcacababccababcbcaabcbcacabcababcbcaabcbcacabbcacab...

output:

11115556

result:

ok 1 number(s): "11115556"

Test #159:

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

input:

10000
caccacaccaccacaccacaccaccacaccaccacaccacaccaccacaccacaccaccacaccaccacaccacaccaccacaccaccacaccacaccaccacaccacaccaccacaccaccacaccacaccaccacaccacaccaccacaccaccacaccacaccaccacaccaccacaccacaccaccacaccacaccaccacaccaccacaccacaccaccacaccaccacaccacaccaccacaccacaccaccacaccaccacaccacaccaccacaccacaccaccac...

output:

38192400

result:

ok 1 number(s): "38192400"

Test #160:

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

input:

10000
abaabaabaabaababaabaabaabaababaabaabaabaababaabaabaabaababaabaabaabaababaabaabaabaababaabaabaabaababaabaabaabaababaabaabaabaababaabaabaabaababaabaabaabaababaabaabaabaababaabaabaabaababaabaabaabaababaabaabaabaababaabaabaabaababaabaabaabaababaabaabaabaababaabaabaabaababaabaabaabaababaabaabaabaab...

output:

41332041

result:

ok 1 number(s): "41332041"

Test #161:

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

input:

10000
abaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaaba...

output:

44448889

result:

ok 1 number(s): "44448889"

Test #162:

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

input:

10000
bcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbc...

output:

50000000

result:

ok 1 number(s): "50000000"

Test #163:

score: 0
Accepted
time: 119ms
memory: 3532kb

input:

10000
bacbbbbacababacbcabbbcbcacbbbbaaaabcccbbbaababbaabaacaaccbcbababbabbabbaaaabbcabbbbabcccaacbaacbbabaabccbbbaabcbbbababccbbbaacababbabbbabbbbbabbabbbcbbbbabbbbabbbbabbaccbbcbbbbbbabcbbbcbacbbbbcababbcbbcbabbbababbbacccbcbabbabcbbaacaabccbabbbbbcbbcbabcbccbbcbbcbabcabcbbbacbaccbbabbcabacabbababb...

output:

24920064

result:

ok 1 number(s): "24920064"

Test #164:

score: 0
Accepted
time: 82ms
memory: 3508kb

input:

10000
ccaacccaccccbcaaccacaccccccbcccaabbccacccacccbcbbcaccbbabcbaccacccacbccbbcabccbacccaaabccccacccacabaacbaccccccccaccccaccbccbbcccccccaaaccccaccccacbaaccccccccaccacbccaabcccbcccccccccccccccccccccbccbccccaabbaccccccccacccbccacccaccccccbcacacccbbccccacccabccaccacacccacccacccccbccacccacbaccaccccccc...

output:

45131524

result:

ok 1 number(s): "45131524"

Test #165:

score: 0
Accepted
time: 9ms
memory: 3456kb

input:

10000
ababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababab...

output:

50000000

result:

ok 1 number(s): "50000000"

Test #166:

score: 0
Accepted
time: 130ms
memory: 3512kb

input:

10000
cbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacb...

output:

25000000

result:

ok 1 number(s): "25000000"

Test #167:

score: 0
Accepted
time: 59ms
memory: 3508kb

input:

10000
aaabaaabaaabaaacaaabaaabaaabaaacaaabaaabaaabaaacaaabaaabaaabaaaaaaabaaabaaabaaacaaabaaabaaabaaacaaabaaabaaabaaacaaabaaabaaabaaaaaaabaaabaaabaaacaaabaaabaaabaaacaaabaaabaaabaaacaaabaaabaaabaaaaaaabaaabaaabaaacaaabaaabaaabaaacaaabaaabaaabaaacaaabaaabaaabaaabaaabaaabaaabaaacaaabaaabaaabaaacaaabaa...

output:

58049161

result:

ok 1 number(s): "58049161"

Test #168:

score: 0
Accepted
time: 104ms
memory: 3484kb

input:

10000
ababacababacababacababaaababacababacababacababaaababacababacababacababaaababacababacababacababaaababacababacababacabababababacababacababacababaaababacababacababacababaaababacababacababacababaaababacababacababacababaaababacababacababacabababababacababacababacababaaababacababacababacababaaababac...

output:

28451556

result:

ok 1 number(s): "28451556"

Test #169:

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

input:

10000
aaaaabaaaaabaaaaabaaaaabaaaaabaaaaacaaaaabaaaaabaaaaabaaaaabaaaaabaaaaacaaaaabaaaaabaaaaabaaaaabaaaaabaaaaacaaaaabaaaaabaaaaabaaaaabaaaaabaaaaacaaaaabaaaaabaaaaabaaaaabaaaaabaaaaacaaaaabaaaaabaaaaabaaaaabaaaaabaaaaaaaaaaabaaaaabaaaaabaaaaabaaaaabaaaaacaaaaabaaaaabaaaaabaaaaabaaaaabaaaaacaaaaab...

output:

70107129

result:

ok 1 number(s): "70107129"

Test #170:

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

input:

899
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa...

output:

808201

result:

ok 1 number(s): "808201"

Test #171:

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

input:

10000
aaaaaaabaaaaaaabaaaaaaacaaaaaaabaaaaaaabaaaaaaacaaaaaaabaaaaaaabaaaaaaacaaaaaaabaaaaaaabaaaaaaacaaaaaaabaaaaaaabaaaaaaacaaaaaaabaaaaaaabaaaaaaacaaaaaaabaaaaaaabaaaaaaacaaaaaaabaaaaaaabaaaaaaaaaaaaaaabaaaaaaabaaaaaaacaaaaaaabaaaaaaabaaaaaaacaaaaaaabaaaaaaabaaaaaaacaaaaaaabaaaaaaabaaaaaaacaaaaaa...

output:

77352025

result:

ok 1 number(s): "77352025"

Test #172:

score: 0
Accepted
time: 117ms
memory: 3460kb

input:

10000
abacabacabaaabacabacabaaabacabacabaaabacabacabaaabacabacabaaabacabacabaaabacabacabaaabacabacabaaabacabacabaaabacabacabaaabacabacabaaabacabacabaaabacabacabaaabacabacabaaabacabacabaaabacabacabaaabacabacabaaabacabacabaaabacabacabaaabacabacabaaabacabacabaaabacabacabaaabacabacabaaabacabacabaaabacab...

output:

34023889

result:

ok 1 number(s): "34023889"