QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#731677#9571. Border Jump 2TheZoneAC ✓1073ms260888kbC++208.7kb2024-11-10 10:25:012024-11-10 10:25:02

Judging History

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

  • [2024-11-10 10:25:02]
  • 评测
  • 测评结果:AC
  • 用时:1073ms
  • 内存:260888kb
  • [2024-11-10 10:25:01]
  • 提交

answer

#include <algorithm>
#include <cstdio>
#include <cstring>
#include <ctime>
#include <iostream>
#include <vector>
using namespace std;

typedef long long ll;

const int N = 5e5 + 5;  // |S|
const int M = 27;       // max ASCII(s_i)
const int K = 20;       // log N

char s[N];

struct SAM {
    int n;
    int tot = 1, last = 1, cnt = 1;
    int sa[N], rk[N], ht[N], vis[N];
    struct Node {
        int len, fa, edn;
        int ch[27], nxt[27];
        vector<int> tmp, son;
    } node[N];
    int st[N][K], lg[N];
    void init(int N) {
        n = N;
        for (int i = 0; i <= n; i++)
            sa[i] = rk[i] = ht[i] = 0;
        for (int i = 0; i <= tot; i++) {
            vis[i] = 0;
            node[i].len = node[i].fa = node[i].edn = 0;
            for (int j = 0; j < 27; j++)
                node[i].ch[j] = node[i].nxt[j] = 0;
            node[i].son.clear();
            node[i].tmp.clear();
        }
        // clear 时先清空 node,再重置 tot 和 last
        tot = last = cnt = 1;
    }
    int extend(int x, int c) {
        int p = last, np = last = ++tot;
        node[np].len = node[p].len + 1;
        for (; p && (!node[p].ch[c]); p = node[p].fa)
            node[p].ch[c] = np;
        if (!p)
            node[np].fa = 1;
        else {
            int q = node[p].ch[c];
            if (node[q].len == node[p].len + 1)
                node[np].fa = q;
            else {
                int nq = ++tot;
                // 注意此处复制了结点 q, 若每个节点还要维护其他信息,注意清空或取舍
                node[nq] = node[q];
                node[nq].edn = 0;
                node[nq].len = node[p].len + 1;
                node[q].fa = node[np].fa = nq;
                for (; p && node[p].ch[c] == q; p = node[p].fa)
                    node[p].ch[c] = nq;
            }
        }
        node[np].edn = x;
        vis[np] = 1;
        // the node of this prefix
        return np;
    }
    void dfs1(int x) {
        for (auto y : node[x].tmp) {
            dfs1(y);
            node[x].edn = max(node[x].edn, node[y].edn);
        }
    }
    void dfs2(int x) {
        if (vis[x]) {
            rk[node[x].edn] = cnt;
            sa[cnt] = node[x].edn;
            cnt++;
        }
        for (auto y : node[x].son)
            dfs2(y);
    }
    void build() {
        for (int i = 1; i <= tot; i++)
            node[node[i].fa].tmp.push_back(i);
        dfs1(1);
        for (int i = 1; i <= tot; i++) {
            int c = s[node[i].edn + node[node[i].fa].len] - 'a';
            node[node[i].fa].nxt[c] = i;
        }
        for (int i = 1; i <= tot; i++) {
            for (int j = 0; j < 27; j++)
                if (node[i].nxt[j]) {
                    node[i].son.push_back(node[i].nxt[j]);
                }
        }
        dfs2(1);
        for (int i = 0; i < K; i++)
            for (int j = 0; j <= n; j++)
                st[i][j] = n;
        get_ht();
        for (int i = 2; i <= n; i++)  // index starts with 2
            lg[i] = lg[i >> 1] + 1;
        for (int i = 1; i <= n; i++)
            st[i][0] = ht[i];
        for (int i = 1; i < K; i++)
            for (int j = 1; j + (1 << i) - 1 <= n; j++)
                st[j][i] = min(st[j][i - 1], st[j + (1 << (i - 1))][i - 1]);
    }
    void get_ht() {  // ht[i] = lcp(sa[i], sa[i - 1])
        for (int i = 1, k = 0; i <= n; i++) {
            if (k)
                --k;
            // 多测记得防越界
            // 或者 s[] 开两倍空间,清空后一半
            while ((i + k <= n && sa[rk[i] - 1] + k <= n) && s[i + k] == s[sa[rk[i] - 1] + k])
                k++;
            // while (s[i + k] == s[sa[rk[i] - 1] + k])
            //     k++;
            ht[rk[i]] = k;
        }
    }
    int query(int L, int R) {  // lcp(s[i,n],s[j,n])
        if (L == R)
            return n;
        int l, r;
        l = min(L, R) + 1;
        r = max(L, R);
        int t = lg[r - l + 1];
        return min(st[l][t], st[r - (1 << t) + 1][t]);
    }
    int findpre(int x, int len) {
        int l = 1, r = x, mid, ans = x;
        while (l <= r) {
            mid = (l + r) >> 1;
            if (query(mid, x) >= len) {
                ans = mid;
                r = mid - 1;
            } else
                l = mid + 1;
        }
        return ans;
    }
    int findsuf(int x, int len) {
        int l = x, r = n, mid, ans = x;
        while (l <= r) {
            mid = (l + r) >> 1;
            // if (x == 114 && len == 6)
            //     cout << "@ " << mid << "\n";
            if (query(mid, x) >= len) {
                ans = mid;
                l = mid + 1;
            } else
                r = mid - 1;
        }
        return ans;
    }
} sam;

struct PAM {
    int n;
    char s[N];
    int tot = 1, last = 1;
    struct Node {
        int len, fa, dep;
        int ch[26];
    } node[N];
    void init() {
        for (int i = 0; i <= n; i++)
            s[i] = ' ';
        for (int i = 0; i <= tot; i++) {
            node[i].len = node[i].fa = node[i].dep = 0;
            for (int j = 0; j < 26; j++)
                node[i].ch[j] = 0;
        }
        n = 0;
        tot = last = 1;
        s[0] = '$';
        node[0] = {0, 1};
        node[1] = {-1, 0};
    }
    int getfail(int x) {
        while (s[n - node[x].len - 1] != s[n])
            x = node[x].fa;
        return x;
    }
    void extend(int c) {
        s[++n] = (char)(c + 'a');
        int p = getfail(last);
        if (!node[p].ch[c]) {
            int np = ++tot;
            node[np].len = node[p].len + 2;
            node[np].fa = node[getfail(node[p].fa)].ch[c];
            node[np].dep = node[node[np].fa].dep + 1;
            node[p].ch[c] = np;
        }
        last = node[p].ch[c];
    }
} pam;

struct Node {
    int v, l, r;
} t[N << 5];
int rt[N], tot;
void pushup(int p) {
    t[p].v = max(t[t[p].l].v, t[t[p].r].v);
}
void build(int& p, int l, int r) {
    p = ++tot;
    t[p] = {0, 0, 0};
    if (l == r)
        return;
    int mid = (l + r) >> 1;
    build(t[p].l, l, mid);
    build(t[p].r, mid + 1, r);
    pushup(p);
}
void update(int& p, int q, int l, int r, int x, int d) {
    p = ++tot;
    t[p] = t[q];
    if (l == r) {
        t[p].v = d;
        return;
    }
    int mid = (l + r) >> 1;
    if (x <= mid)
        update(t[p].l, t[q].l, l, mid, x, d);
    else
        update(t[p].r, t[q].r, mid + 1, r, x, d);
    pushup(p);
}
int query(int p, int l, int r, int x, int y) {
    if (x <= l && r <= y)
        return t[p].v;
    int mid = (l + r) >> 1;
    int ans = 0;
    if (x <= mid)
        ans = max(ans, query(t[p].l, l, mid, x, y));
    if (y > mid)
        ans = max(ans, query(t[p].r, mid + 1, r, x, y));
    return ans;
}

int pl[N], sum[N][26];

void solve(int T) {
    int sd, td;
    string t;
    cin >> t;
    int n = t.size(), m = 2 * n + 1;
    t = " " + t;
    for (int i = 1; i <= n; i++) {
        s[i] = s[m - i + 1] = t[i];
        for (int j = 0; j < 26; j++)
            sum[i][j] = sum[i - 1][j];
        sum[i][s[i] - 'a']++;
    }
    s[n + 1] = '{';

    sam.init(m);
    for (int i = m; i >= 1; i--)
        sam.extend(i, s[i] - 'a');
    sam.build();

    pam.init();
    for (int i = n; i >= 1; i--) {
        pam.extend(s[i] - 'a');
        int len = pam.node[pam.last].len;
        pl[i] = len;
    }

    tot = 0;
    build(rt[0], 1, m);
    for (int i = 1; i <= m; i++) {
        int x = sam.rk[i], d = i;
        if (i <= n + 1)
            d = 0;
        update(rt[i], rt[i - 1], 1, m, x, d);
    }

    int ans = 0;
    for (int i = 1; i <= n; i++) {
        int res = 0;
        int len = pl[i];
        while (true) {
            int l = sam.findpre(sam.rk[i], len);
            int r = sam.findsuf(sam.rk[i], len);
            int lim = m - (i + len) + 1;
            int pos = query(rt[lim], 1, m, l, r);
            if (pos == 0)
                break;
            pos = m - pos + 1;
            len = pos - i + 1;
            res++;
            if (len == n)
                break;
        }
        int w = i + ((pl[i] + 1) / 2) - 1;
        int l = i, r = w, mid, pos = w, c = s[r] - 'a';
        while (l <= r) {
            mid = (l + r) >> 1;
            if (sum[w][c] - sum[mid - 1][c] == (w - mid + 1)) {
                pos = mid;
                r = mid - 1;
            } else
                l = mid + 1;
        }
        pos = pos - i + 1;
        res += (pos - 1);
        res += pl[i] - 2 * (pos - 1) - 1;
        ans = max(ans, res);
    }
    cout << ans << "\n";
}

int main() {
    int T = 1;
    cin >> T;
    while (T--) {
        solve(T);
    }
    return 0;
}

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

詳細信息

Test #1:

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

input:

3
aaaa
abbaabba
xy

output:

3
4
0

result:

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

Test #2:

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

input:

15
eeee
ooom
bbcb
yyaa
ssdn
wgww
hrhr
exer
hcch
qyyy
lppa
ocvo
orxr
lrjj
pztv

output:

3
2
1
1
1
1
1
1
2
2
1
1
1
1
0

result:

ok 15 numbers

Test #3:

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

input:

52
eeeee
oooom
bbbcb
yyyaa
sssdn
wwgww
hhrhr
eexer
hhcch
qqyyy
llppa
oocvo
oorxr
llrjj
ppztv
tnttt
vnvvn
hthhp
jzjzj
nrnrr
gqgqt
uruyu
cdchd
djdhh
ktkfy
piipp
zaaza
uffuq
bvvvb
hkkkk
pcccj
qccpq
wqqaq
appgg
cxxvg
ewfee
peupe
odfof
kdpkh
zotoz
yzkzz
irtrt
vxyxi
dlood
akrrk
nsbbb
rdjjc
bfexb
uxsex
ise...

output:

4
3
2
2
2
2
1
1
2
2
1
1
1
1
1
2
2
1
2
1
1
1
1
1
1
2
2
2
3
3
2
1
1
1
1
1
1
1
1
2
1
1
1
1
2
2
1
1
1
1
1
0

result:

ok 52 numbers

Test #4:

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

input:

203
eeeeee
ooooom
bbbbcb
yyyyaa
ssssdn
wwwgww
hhhrhr
eeexer
hhhcch
qqqyyy
lllppa
ooocvo
ooorxr
lllrjj
pppztv
ttnttt
vvnvvn
hhthhp
jjzjzj
nnrnrr
ggqgqt
uuruyu
ccdchd
ddjdhh
kktkfy
ppiipp
zzaaza
uuffuq
bbvvvb
hhkkkk
ppcccj
qqccpq
wwqqaq
aappgg
ccxxvg
eewfee
ppeupe
oodfof
kkdpkh
zzotoz
yyzkzz
iirtrt
vv...

output:

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

result:

ok 203 numbers

Test #5:

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

input:

877
eeeeeee
oooooom
bbbbbcb
yyyyyaa
sssssdn
wwwwgww
hhhhrhr
eeeexer
hhhhcch
qqqqyyy
llllppa
oooocvo
oooorxr
llllrjj
ppppztv
tttnttt
vvvnvvn
hhhthhp
jjjzjzj
nnnrnrr
gggqgqt
uuuruyu
cccdchd
dddjdhh
kkktkfy
pppiipp
zzzaaza
uuuffuq
bbbvvvb
hhhkkkk
pppcccj
qqqccpq
wwwqqaq
aaappgg
cccxxvg
eeewfee
pppeupe
...

output:

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

result:

ok 877 numbers

Test #6:

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

input:

4140
eeeeeeee
ooooooom
bbbbbbcb
yyyyyyaa
ssssssdn
wwwwwgww
hhhhhrhr
eeeeexer
hhhhhcch
qqqqqyyy
lllllppa
ooooocvo
ooooorxr
lllllrjj
pppppztv
ttttnttt
vvvvnvvn
hhhhthhp
jjjjzjzj
nnnnrnrr
ggggqgqt
uuuuruyu
ccccdchd
ddddjdhh
kkkktkfy
ppppiipp
zzzzaaza
uuuuffuq
bbbbvvvb
hhhhkkkk
ppppcccj
qqqqccpq
wwwwqqa...

output:

7
6
5
5
5
4
4
4
4
4
4
4
4
4
4
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
2
2
2
2
2
2
3
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
4
3
3
2
2
2
2
2
2
2
4
3
3
4
4
3
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
3
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
3
2
2
2
2
2
2
...

result:

ok 4140 numbers

Test #7:

score: 0
Accepted
time: 93ms
memory: 157208kb

input:

21147
eeeeeeeee
oooooooom
bbbbbbbcb
yyyyyyyaa
sssssssdn
wwwwwwgww
hhhhhhrhr
eeeeeexer
hhhhhhcch
qqqqqqyyy
llllllppa
oooooocvo
oooooorxr
llllllrjj
ppppppztv
tttttnttt
vvvvvnvvn
hhhhhthhp
jjjjjzjzj
nnnnnrnrr
gggggqgqt
uuuuuruyu
cccccdchd
dddddjdhh
kkkkktkfy
pppppiipp
zzzzzaaza
uuuuuffuq
bbbbbvvvb
hhhh...

output:

8
7
6
6
6
5
5
5
5
5
5
5
5
5
5
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
4
3
3
3
3
3
3
3
3
3
4
3
3
4
4
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
...

result:

ok 21147 numbers

Test #8:

score: 0
Accepted
time: 222ms
memory: 253848kb

input:

2
eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee...

output:

99999
99999

result:

ok 2 number(s): "99999 99999"

Test #9:

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

input:

2
eeegeeeggegegeeeegegeeeeegeeegeeeggeeeggegggegeggeeeeegegeeggeeeggggeggggegegeegggegggggeggggeegggegeeegggeegeeegeeeegeggegeggeggeggegggeeeeggeggggggeggegggeegegegggeggegggeegeeggegeegegggeegegegggegggeeeggeggeeegeeggeeggeggegggeggeegegegeeggggegggggegegggeeeegegeeggeggegggegegeggeegggeeeggeeggegg...

output:

21
19

result:

ok 2 number(s): "21 19"

Test #10:

score: 0
Accepted
time: 585ms
memory: 251652kb

input:

2
egooeoegeeggegeeoegggoeoegeeeoeegoeeeogeoggoggoegoegogooooggoeeeoogooegeooegeeggeeoegeogoggegoegoggogeoogegggogegogeoogoeeeogegeoeoggoogoeeooeeogeoegggggegoeoeeggogogggeggoegeogoeogggegggeoggggooggoeoeeoegoeeggoogggggegooggoeooeoeeooeooggogeogeeoogegegoggeogeooeoggeogegoeogeeogeegogegoogggogegogeg...

output:

12
12

result:

ok 2 number(s): "12 12"

Test #11:

score: 0
Accepted
time: 548ms
memory: 246052kb

input:

2
oeoaooeggegegoeeeaeaoeoeogoeoaoeoaaeooaaogagogeaaoeoooaogooaaooogaaaoaagaeaegoeaaaoggaaaogggaeoaaaegeeeggaeoaoooaoeoeaeggoaogaeggoggeggaeoeogaeaggagaoggoaageeaoaeggaoggoagaeoaeeagoaoogogageoaeaoaggogggoeoagogaoooaeeagoeaaeaaoggaegaoegoaoaeoagageagaagoaegaaoeoeaoaeogaeagoggaoaoaeaaeogggeeegaooagega...

output:

11
9

result:

ok 2 number(s): "11 9"

Test #12:

score: 0
Accepted
time: 504ms
memory: 244236kb

input:

2
ntiaoioraegexnnnnxtxeetoogetixnoegbeitbgnrxbiatabitooeatbiibbinnxrrataxaanxnaetxrroraggriraggoobbxegootgrgterottateonbtgxnxnrgoaanrgnbagetioagnbgrarbexatbggenrtbearrnbgtxaatirtnagoaoibigxxiibtxorxanarrtitrbobxnttroixrenxgobrnbarnaanoxignrengrxroababxtbnbxxeinerobtibbibrngrrerebtabetxgbnioggteaxtra...

output:

5
5

result:

ok 2 number(s): "5 5"

Test #13:

score: 0
Accepted
time: 441ms
memory: 241744kb

input:

2
ojzxseudqfxhvuomjrexifhnelffzyfiprrzforwfkwqedndbhmhnogfcfirkfumbqlbjxlldhlnbizrrlnvcqagfbbdcthlgyjlhujxyytzdzzidtsnfqikankokdickzgvjgyajjmhwxfyaaydlmylhcaasplhgslxgelkidgljigipgbfrfhkigkxefcsgulblhdvbjpovwocxifzwpnwqtpkbslqndgxnwvfjverfyneyqaleydxbkovfgvgminukorptglmlrjqlaubjyedlmtkqvtopvwmfaahrk...

output:

3
3

result:

ok 2 number(s): "3 3"

Test #14:

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

input:

100
eeegeeeggegegeeeegegeeeeegeeeg
eeeggeeeggegggegeggeeeeegegeeg
geeeggggeggggegegeegggegggggeg
gggeegggegeeegggeegeeegeeeegeg
gegeggeggeggegggeeeeggegggggge
ggegggeegegegggeggegggeegeegge
geegegggeegegegggegggeeeggegge
eegeeggeeggeggegggeggeegegegee
ggggegggggegegggeeeegegeeggegg
egggegegeggeeggge...

output:

7
5
6
5
6
6
4
6
6
4
6
10
7
5
10
6
10
8
5
10
7
10
7
6
11
10
8
7
5
5
7
8
5
6
6
10
5
7
8
8
8
6
7
6
9
6
6
6
4
5
5
4
6
8
8
6
6
6
4
9
11
7
5
12
8
8
9
7
5
6
10
6
6
7
7
9
5
7
11
6
8
8
5
5
10
6
9
6
9
8
5
5
6
6
6
8
6
7
9
6

result:

ok 100 numbers

Test #15:

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

input:

500
egooeoegeeggegeeoegggoeoegeeeo
eegoeeeogeoggoggoegoegogoooogg
oeeeoogooegeooegeeggeeoegeogog
gegoegoggogeoogegggogegogeoogo
eeeogegeoeoggoogoeeooeeogeoegg
gggegoeoeeggogogggeggoegeogoeo
gggegggeoggggooggoeoeeoegoeegg
oogggggegooggoeooeoeeooeooggog
eogeeoogegegoggeogeooeoggeogeg
oeogeeogeegogegoo...

output:

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

result:

ok 500 numbers

Test #16:

score: 0
Accepted
time: 254ms
memory: 230660kb

input:

2
babbababbabbababbababbabbababbabbababbababbabbababbababbabbababbabbababbababbabbababbabbababbababbabbababbababbabbababbabbababbababbabbababbababbabbababbabbababbababbabbababbabbababbababbabbababbababbabbababbabbababbababbabbababbabbababbababbabbababbababbabbababbabbababbababbabbababbababbabbababba...

output:

37511
37511

result:

ok 2 number(s): "37511 37511"

Test #17:

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

input:

1
abacbaxyabcaba

output:

2

result:

ok 1 number(s): "2"

Test #18:

score: 0
Accepted
time: 372ms
memory: 260888kb

input:

2
bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb...

output:

19102
17514

result:

ok 2 number(s): "19102 17514"

Test #19:

score: 0
Accepted
time: 437ms
memory: 253148kb

input:

2
ufgbkfjuuijotymncffyqnefotznsflvlihsxddzsjgkqvixsbtrbsbuooirmgytjbyfmlnqvnympwrrvkpacjouomhssrkcsdzbiijainkqfxyvleigspvnyweivxiaolxeatmaobcfczlicidyiozfhykxdvodanrcvlftjzxminuvvbmahwppjmxkmrfecmschtemfmedyduedbladcptkfjtovhcplarqdtcxhdlxpoqwmxfdveaksfvljgvimldtibzjccstyuwctjrptivddcphgmjjjeiuflqed...

output:

9999
9999

result:

ok 2 number(s): "9999 9999"

Test #20:

score: 0
Accepted
time: 432ms
memory: 245520kb

input:

2
eyqtmnrlcnohlapnzfpwmurpwngttugiqebhrvjsffsnribhchntexexcdlbwvtrdqyuajfrkegfixmewwqdhxpisibcnstuellgywtmngtaxhalgnjylglmdqxiaeqdhmalrvmljuqnrbuhwupcupsjdslnueybojeqhuxtfutscztokzwctikfalpkythkxyzxemizlewncihwjqhxxcxtuhnsebnenijhqrpjthyvqkqwkcqzgenfxeemsqlxnucfpzlbaemvhflhzgrpeckxfrrksbppiwsdghmbpl...

output:

4999
4999

result:

ok 2 number(s): "4999 4999"

Test #21:

score: 0
Accepted
time: 471ms
memory: 245964kb

input:

2
ivpnhczudisccdpuvnpthltbjnauoqjehspenapetoludiarsxftuwpzhvxofdzbmpzfdtuhavxcfdktfoceofowuhngrilioexzrydjrlbhzapcrhkbcbsjafaybzauyttajnsuiiaourefxcsrnafpvnidswelbanfhqtnffscraqfgnwmnbcarmkslrcmspvircgzjkztmztgmrqiopgbzxjhlrzrhqxrkyzclznfzqdqrzamvojicilyhyfqieoxygumfodmnyxkpzigpokngvqqtruhgzyngcuybf...

output:

5
5

result:

ok 2 number(s): "5 5"

Test #22:

score: 0
Accepted
time: 439ms
memory: 248468kb

input:

2
dcdyihlmsvlnewvitybmgqindedypovodrhvsomrhbtzokrvojunhvvegffukygrchxmzbuntugnunmloxiesdjbrqvfcitarlcdouhfktwpglyykuehlwxudcninuwzpaiahtbskewyozqwidlcprkrbpcdqqtluodfuttltpzxmmfcsihavyywecvugaojtvuqoadvsexnoohddzeyqbafvsxwfolxawigojpliretadebcgbwkrsjkzrqtzpdnsphmhdvreyslexnhhqkflumwnkhmfyufbpiokneiy...

output:

4
4

result:

ok 2 number(s): "4 4"

Test #23:

score: 0
Accepted
time: 399ms
memory: 254312kb

input:

2
hbbhbhhbbhhbhbbhbhhbhbbhhbbhbhhbbhhbhbbhhbbhbhhbhbbhbhhbbhhbhbbhbhhbhbbhhbbhbhhbhbbhbhhbbhhbhbbhhbbhbhhbbhhbhbbhbhhbhbbhhbbhbhhbbhhbhbbhhbbhbhhbhbbhbhhbbhhbhbbhhbbhbhhbbhhbhbbhbhhbhbbhhbbhbhhbhbbhbhhbbhhbhbbhbhhbhbbhhbbhbhhbbhhbhbbhhbbhbhhbhbbhbhhbbhhbhbbhbhhbhbbhhbbhbhhbhbbhbhhbbhhbhbbhhbbhbhhbbh...

output:

32768
32768

result:

ok 2 number(s): "32768 32768"

Test #24:

score: 0
Accepted
time: 353ms
memory: 253060kb

input:

2
abacabadabacabaeabacabadabacabafabacabadabacabaeabacabadabacabagabacabadabacabaeabacabadabacabafabacabadabacabaeabacabadabacabahabacabadabacabaeabacabadabacabafabacabadabacabaeabacabadabacabagabacabadabacabaeabacabadabacabafabacabadabacabaeabacabadabacabaiabacabadabacabaeabacabadabacabafabacabadab...

output:

34418
34456

result:

ok 2 number(s): "34418 34456"

Test #25:

score: 0
Accepted
time: 387ms
memory: 255624kb

input:

2
abbabaabbaababbabaababbaabbabaabbaababbaabbabaababbabaabbaababbabaababbaabbabaababbabaabbaababbaabbabaabbaababbabaababbaabbabaabbaababbaabbabaababbabaabbaababbaabbabaabbaababbabaababbaabbabaababbabaabbaababbabaababbaabbabaabbaababbaabbabaababbabaabbaababbabaababbaabbabaababbabaabbaababbaabbabaabba...

output:

32768
32768

result:

ok 2 number(s): "32768 32768"

Test #26:

score: 0
Accepted
time: 471ms
memory: 244156kb

input:

2
abcbcacabbcacababccababcbcabcacababccababcbcaabcbcacabcababcbcaabcbcacabbcacababcbcacababccababcbcaabcbcacabcababcbcaabcbcacabbcacababcabcbcacabbcacababccababcbcacababcbcaabcbcacabbcacababcabcbcacabbcacababccababcbcabcacababccababcbcaabcbcacabbcacababccababcbcaabcbcacabcababcbcaabcbcacabbcacababca...

output:

2
2

result:

ok 2 number(s): "2 2"

Test #27:

score: 0
Accepted
time: 494ms
memory: 246828kb

input:

2
abcdbcdacdabdabcbcdacdabdabcabcdcdabdabcabcdbcdadabcabcdbcdacdabbcdacdabdabcabcdcdabdabcabcdbcdadabcabcdbcdacdababcdbcdacdabdabccdabdabcabcdbcdadabcabcdbcdacdababcdbcdacdabdabcbcdacdabdabcabcddabcabcdbcdacdababcdbcdacdabdabcbcdacdabdabcabcdcdabdabcabcdbcdabcdacdabdabcabcdcdabdabcabcdbcdadabcabcdbc...

output:

2
2

result:

ok 2 number(s): "2 2"

Test #28:

score: 0
Accepted
time: 483ms
memory: 243056kb

input:

2
abcdebcdeacdeabdeabceabcdbcdeacdeabdeabceabcdabcdecdeabdeabceabcdabcdebcdeadeabceabcdabcdebcdeacdeabeabcdabcdebcdeacdeabdeabcbcdeacdeabdeabceabcdabcdecdeabdeabceabcdabcdebcdeadeabceabcdabcdebcdeacdeabeabcdabcdebcdeacdeabdeabcabcdebcdeacdeabdeabceabcdcdeabdeabceabcdabcdebcdeadeabceabcdabcdebcdeacde...

output:

2
2

result:

ok 2 number(s): "2 2"

Test #29:

score: 0
Accepted
time: 368ms
memory: 253028kb

input:

2
foffofoffoffofoffofoffoffofoffoffofoffofoffoffofoffofoffoffofoffoffofoffofoffoffofoffoffofoffofoffoffofoffofoffoffofoffoffofoffofoffoffofoffofoffoffofoffoffofoffofoffoffofoffoffofoffofoffoffofoffofoffoffofoffoffofoffofoffoffofoffoffofoffofoffoffofoffofoffoffofoffoffofoffofoffoffofoffofoffoffofoffo...

output:

39304
39304

result:

ok 2 number(s): "39304 39304"

Test #30:

score: 0
Accepted
time: 346ms
memory: 252792kb

input:

2
jljpjljjljpjljljpjljjljpjljpjljjljpjljljpjljjljpjljjljpjljljpjljjljpjljpjljjljpjljljpjljjljpjljljpjljjljpjljpjljjljpjljljpjljjljpjljjljpjljljpjljjljpjljpjljjljpjljljpjljjljpjljpjljjljpjljljpjljjljpjljjljpjljljpjljjljpjljpjljjljpjljljpjljjljpjljljpjljjljpjljpjljjljpjljljpjljjljpjljjljpjljljpjljjljp...

output:

39325
39325

result:

ok 2 number(s): "39325 39325"

Test #31:

score: 0
Accepted
time: 536ms
memory: 250144kb

input:

2
wwwwwwwvfvfwfpfwwawwfawwfvfwwfwwwsffwwfwwffvwawfvwvwwvfppwffvpwwvwwvfwwwwffwfawvwwwwwvvffawfwpwwwvwwvfvwwwvpwwwfwfwwawvvawfwwwwvwwvffwwwsvfwwffwwwsffwvwwaavfwwfwffwfpwwwwwwwffwwwwwvvfwfvwwwfwwwwfwfwfawwwwfvwfffvawffwwaffaffffwwvefwaffvwwwwwwawwpwwvwwwvwfvufaawwfwwfwvwvwvvwwwwwfswwwfwfvfwwsfwwwfwwf...

output:

17
15

result:

ok 2 number(s): "17 15"

Test #32:

score: 0
Accepted
time: 556ms
memory: 248424kb

input:

2
cchcihcccccciccihhcciccfckiccccciccccccichcicccciciczcciciccciiciccfcchccchiccccccccicicccccicicccccickcccciihccciihciciiiiihicciichicciccccccicccihhcciccccklhccccccciccccccccccicciihcccccccccccccccciccciiccccccccchckhcchiiciccccccchcicccfcccccccihckchiccccicccfciiccccichccccchicchcccikccchiccccic...

output:

29
23

result:

ok 2 number(s): "29 23"

Test #33:

score: 0
Accepted
time: 561ms
memory: 251764kb

input:

2
lllalllllallllllllllllalalllllalllllalalblaalslallllllllallllalalllllllllbllllllalllallllllllsbblallalalalbaallallalaalbllbllllllllaallllllllbllllllsalllalbllllllllllbllalllllllalllaalalllllllllllllllllallalllllllalllallllllallblallllllllllalbabllballllllllaalllablllllalalllllallalblllallallllllll...

output:

42
36

result:

ok 2 number(s): "42 36"

Test #34:

score: 0
Accepted
time: 549ms
memory: 254692kb

input:

2
bbacaccabccacbabbbcbbcaabacaacbbaabacbaabccccbacaaccbacaabaacccacbcbccbabcbbbbbbcbaccabacabbcbcbbabbcaacbbbcbaccaccacaaaccbbcaccaaaaacaaabbacacbacccabbabbaabacacbaccabbbcccbbbccccccababbbacbcbcbbbcbcccccaabcccbcbaabcccbbbbbbacaccbccbccccbbccbaabcbbcbbbbccbbaacaaababccccacbbacbcccbbaaccccbcccabacca...

output:

12
10

result:

ok 2 number(s): "12 10"

Test #35:

score: 0
Accepted
time: 506ms
memory: 248648kb

input:

2
effaeacaeffeecdfafeacbbdfcdbeafbeceedbcbfdaafacfbebfdfbccdcadfcefceaafbffdcbccbfbcdbebfcbeaffcdaeabbfcdccaaadecccdccecdabeeecfeddecadafbdceafcfcbfeacbdcfcdaaddfaacffeacabaddbebdebbacedccbdccfbafacbbfaeedadeeecaffcefdccefeafdfdbcdbcaaaebbfceacfeedeecadefbfebdaddcbccbdcafaeecbbdbddcddabbbdaaefcdaccb...

output:

9
6

result:

ok 2 number(s): "9 6"

Test #36:

score: 0
Accepted
time: 474ms
memory: 245136kb

input:

2
gfbjegbhicjdedfiihggdcghdjgafafeggfeffajjhgfhjcchhbghiiejcbedhbgaajgbbiadiahcifhahbihcdiehdciihhecccifdcgbefcghfhfcedacfaafiaigibbfiagdbbeddidegbfagffjifjghjdgfehejbiagdabcihajbcgdebefbfcfddhgfibdfjahiagdahgdbjbijggeajigibbdajijbabhiihchhfcdagfiiggfegbagcdbfiibgijeedfebbeegidfhggeijhaagfjiehcaehed...

output:

6
5

result:

ok 2 number(s): "6 5"

Test #37:

score: 0
Accepted
time: 490ms
memory: 249516kb

input:

2
ababccabacccbccbacbabaacccacbaacbbbccbbbbcbcbbbacaccbcabaaccbbbbaaaabbabbbacaacacabcaabaacccccccacbcababcbacccbcbbbaaababbbcaccaaabccbaacababccabacccbccbacbabaacccacbaacbbbccbbbbcbcbbbacaccbcabaaccbbbbaaaabbabbbacaacacabcaabaacccccccacbcababcbacccbcbbbaaababbbcaccaaabccbaacababccabacccbccbacbabaac...

output:

8
10

result:

ok 2 number(s): "8 10"

Test #38:

score: 0
Accepted
time: 498ms
memory: 249556kb

input:

2
cafbedceafdfbcabaabbdeacfeecedefbedbddabdffececcaebcbcfaaadedadeedafafacaabdebcdbbbcebdfcebbcdacbacfcaedfcfedbcebebdcecfaccffbefefbcbacfacafbedceafdfbcabaabbdeacfeecedefbedbddabdffececcaebcbcfaaadedadeedafafacaabdebcdbbbcebdfcebbcdacbacfcaedfcfedbcebebdcecfaccffbefefbcbacfacafbedceafdfbcabaabbdeac...

output:

4
4

result:

ok 2 number(s): "4 4"

Test #39:

score: 0
Accepted
time: 492ms
memory: 249800kb

input:

2
ehdaahhcijcaajdgcaficajhfffaieibciddcccajbgefiaagghighhefebibjfedihcdcebfgchhddeddgbhgjihcieijiiibgjdaiaehejbcbchbdefjgdajadjefdgcaejbeedehdaahhcijcaajdgcaficajhfffaieibciddcccajbgefiaagghighhefebibjfedihcdcebfgchhddeddgbhgjihcieijiiibgjdaiaehejbcbchbdefjgdajadjefdgcaejbeedehdaahhcijcaajdgcaficajh...

output:

3
3

result:

ok 2 number(s): "3 3"

Test #40:

score: 0
Accepted
time: 404ms
memory: 245744kb

input:

2
bbbaaabbacbbbcbbbbaaabbacbbbcbbbbaaabbacbbbcbbbbaaabbacbbbcbbbbaaabbacbbbcbbbbaaabbacbbbcbbbbaaabbacbbbcbbbbaaabbacbbbcbbbbaaabbacbbbcbbbbaaabbacbbbcbbbbaaabbacbbbcbbbbaaabbacbbbcbbbbaaabbacbbbcbbbbaaabbacbbbcbbbbaaabbacbbbcbbbbaaabbacbbbcbbbbaaabbacbbbcbbbbaaabbacbbbcbbbbaaabbacbbbcbbbbaaabbacbbb...

output:

5
4

result:

ok 2 number(s): "5 4"

Test #41:

score: 0
Accepted
time: 394ms
memory: 255772kb

input:

2
haechbdajjhjcfehaechbdajjhjcfehaechbdajjhjcfehaechbdajjhjcfehaechbdajjhjcfehaechbdajjhjcfehaechbdajjhjcfehaechbdajjhjcfehaechbdajjhjcfehaechbdajjhjcfehaechbdajjhjcfehaechbdajjhjcfehaechbdajjhjcfehaechbdajjhjcfehaechbdajjhjcfehaechbdajjhjcfehaechbdajjhjcfehaechbdajjhjcfehaechbdajjhjcfehaechbdajjhjc...

output:

2
2

result:

ok 2 number(s): "2 2"

Test #42:

score: 0
Accepted
time: 382ms
memory: 259496kb

input:

2
gfgqgfgrgfgqgfgpgfgqgfgrgfgqgfgtgfgqgfgrgfgqgfgpgfgqgfgrgfgqgfgtgfgqgfgrgfgqgfgpgfgqgfgrgfgqgfgtgfgqgfgrgfgqgfgpgfgqgfgrgfgqgfgtgfgqgfgrgfgqgfgpgfgqgfgrgfgqgfgtgfgqgfgrgfgqgfgpgfgqgfgrgfgqgfgtgfgqgfgrgfgqgfgpgfgqgfgrgfgqgfgtgfgqgfgrgfgqgfgpgfgqgfgrgfgqgfgtgfgqgfgrgfgqgfgpgfgqgfgrgfgqgfgtgfgqgfgrgf...

output:

49999
49999

result:

ok 2 number(s): "49999 49999"

Test #43:

score: 0
Accepted
time: 354ms
memory: 255012kb

input:

2
vgvjvgvpvgvjvgvavgvjvgvpvgvjvgvfvgvjvgvpvgvjvgvavgvjvgvpvgvjvgvzvgvjvgvpvgvjvgvavgvjvgvpvgvjvgvfvgvjvgvpvgvjvgvavgvjvgvpvgvjvgvnvgvjvgvpvgvjvgvavgvjvgvpvgvjvgvfvgvjvgvpvgvjvgvavgvjvgvpvgvjvgvzvgvjvgvpvgvjvgvavgvjvgvpvgvjvgvfvgvjvgvpvgvjvgvavgvjvgvpvgvjvgvmvgvjvgvpvgvjvgvavgvjvgvpvgvjvgvfvgvjvgvpvg...

output:

49151
49151

result:

ok 2 number(s): "49151 49151"

Test #44:

score: 0
Accepted
time: 352ms
memory: 251868kb

input:

2
lvlblvlqlvlblvlolvlblvlqlvlblvlelvlblvlqlvlblvlolvlblvlqlvlblvlalvlblvlqlvlblvlolvlblvlqlvlblvlelvlblvlqlvlblvlolvlblvlqlvlblvlrlvlblvlqlvlblvlolvlblvlqlvlblvlelvlblvlqlvlblvlolvlblvlqlvlblvlalvlblvlqlvlblvlolvlblvlqlvlblvlelvlblvlqlvlblvlolvlblvlqlvlblvlclvlblvlqlvlblvlolvlblvlqlvlblvlelvlblvlqlv...

output:

34464
34464

result:

ok 2 number(s): "34464 34464"

Test #45:

score: 0
Accepted
time: 367ms
memory: 257256kb

input:

2
cccdcccdcccdcccdcccfcccdcccdcccdcccdcccfcccdcccdcccdcccdcccfcccdcccdcccdcccdccccccdcccdcccdcccdcccfcccdcccdcccdcccdcccfcccdcccdcccdcccdcccfcccdcccdcccdcccdccccccdcccdcccdcccdcccfcccdcccdcccdcccdcccfcccdcccdcccdcccdcccfcccdcccdcccdcccdccccccdcccdcccdcccdcccfcccdcccdcccdcccdcccfcccdcccdcccdcccdcccfc...

output:

49995
49995

result:

ok 2 number(s): "49995 49995"

Test #46:

score: 0
Accepted
time: 567ms
memory: 251336kb

input:

2
vovvzvvovvzvvvzvvzzzvzvvzvvvzvvozvvzzvvvvovzvvvvvvzvvvvvvzzvvvovvvvvovvzzvvvzvvvvkovvvzzvvzvvvcvvzvvzvvvvvvvvvovzvvvvvzvvvzvvkvzzvzzvvvvvvvzvvvvovvzzvvvvvvzvovvvvvvzvvovvvvvvzzvzkovzkzzvvzvvvzvzvzvvzvvvvvovkvvvvzozvvzvvvvzzwvzvkzvzvvvzzvvvvvvvvvvovvvzkvzvvzvzvvvzvvzzvzvozzvwvvzzvvovvvvvvvzvvvvvovo...

output:

27
27

result:

ok 2 number(s): "27 27"

Test #47:

score: 0
Accepted
time: 546ms
memory: 250968kb

input:

2
nnnnngnqnnqnnnnnnnnqnnnnnngnggnngggnqgqgqnnnngnnngnqnnngqgynngwnnnnngggggnynggngnngnanqnnnnngnnnnngngnqnnnnngnnnqggnnnnnagnngnggqnnnnnnngnngnnnnnnnnnnnqnnnngnnnnannngngngnnqnnnnnnnnnwannnnnnngnnnnnngnqnngnnnnqnqnnnngnnngnnngnngnnnngngnnnggnznqnnngngngqnnnnnnngnqgagnnngnnnqnnnnnngnngqgnqgnnqngggnnn...

output:

23
25

result:

ok 2 number(s): "23 25"

Test #48:

score: 0
Accepted
time: 563ms
memory: 248304kb

input:

2
rrrrrrrrryfrfrrrrfrffrrryrrrfydryoyroyfrrrrrryrrdrryrryrfrrfrrffrfrrfrrffyrrrrrrrrrryrfrffrfrrfrrrrrrrfrrfrrrrrrrffrrrrrfrrrfrfroroyrfyrrrfrfrrrrrrfrfrfryffrrorrrrrfryrrrfyfrrryfrrfryrrryfrrrrffrrrfyrrffrrrrrrrrrrrdrrfyrrrrffffrrfyrrrrrryfrfrrrfrrrrryfryffrrrrrryfrrfrfrffrrdrfrffrrrorrfrrrorrfffrf...

output:

27
27

result:

ok 2 number(s): "27 27"

Test #49:

score: 0
Accepted
time: 302ms
memory: 241512kb

input:

100000
z
e
l
n
j
i
l
j
q
f
p
j
a
c
x
s
v
u
f
c
g
t
f
n
q
r
h
y
w
m
f
q
e
m
y
k
g
e
s
s
b
r
v
g
y
v
w
z
x
t
r
n
z
y
l
w
w
x
a
g
b
a
e
h
u
v
s
y
r
x
d
t
d
p
e
s
o
w
x
q
r
p
h
v
c
i
o
i
v
w
s
a
k
q
a
z
h
l
q
x
e
n
c
n
u
i
t
d
q
v
y
n
x
r
j
u
r
s
w
x
l
p
r
z
m
c
o
e
u
i
e
y
u
i
d
c
n
o
b
i
m
m
a
m
k
k
f...

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
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
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
...

result:

ok 100000 numbers

Test #50:

score: 0
Accepted
time: 292ms
memory: 238056kb

input:

6001
euaixlmvadbpevjhnlcsnhdgcemnmtyfilyxaybidwgiptoevvomzbsmtovcjxvspnzoqbcjqjgwckfy
zm
vlf
ny
koog
dmsnhrdksmwos
rdz
ozqfyxvqz
xxpbjlrmrijtkttngozukt
dgksww
ibwyrsfjvkyhvqyhowmblilzqloryhvy
kglvivbokvkzktpofu
kquuufonscc
ubnlwlrzkgxs
pknkgtkipoabs
o
eu
wenaarskkhiutwtvoeddbcucnqxojfykakqgeivybxmib...

output:

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

result:

ok 6001 numbers

Test #51:

score: 0
Accepted
time: 305ms
memory: 242028kb

input:

301
oxodofzcvwlpqdmqacwookn
hbzxcbarhkzvsxpuojpowprdybaogiubumdapxmrguptwhfwredcnuxggsucefgslpfwmjvatolqafqnmthjswgqowmiiivezwfphcvwxldypzucwfvpwlhfrqymjvymudkezwapwsrfdvitkqsvfvgxzazbxhbpgtmtthmgisopuenfcafqjjdbyvmeqcxgqljthjzfctlpytqnytiihuhkelrjwqqpczbmzgnnxbykzyahkrlvyibulosxdjsehcmveixnzruirrqd...

output:

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

result:

ok 301 numbers

Test #52:

score: 0
Accepted
time: 860ms
memory: 247824kb

input:

2
tliyfmwnwnxwvzwriubuspwqczypwmujdfoqrushlhgvqnqanqzydlbiwlryoahrouacuswtwivqxxqdynebljjahlmwbvhwatwxtpofpgllbntszjxmwleixjbyzbbnixxzwbsdcyzxmvneoqiquvsqvyjyhhbmpcclhlftfdtrefcjtlfhmuocurwosqtplcxsinrvaxbrahteypivdwtwmufmmedzsnaalzdgnkhffbnooephryrqtnxgqzjnzywlawyapnperyoxjkiglffgcuswrsbjbwyecnwnye...

output:

19
50

result:

ok 2 number(s): "19 50"

Test #53:

score: 0
Accepted
time: 822ms
memory: 250824kb

input:

2
qtvyigvzjcibaqvdooncntfixbwgibzrbkjpwfrzwhaqkmcqzixpdojdxhklnyzaehzwubqcfdgikjhosobectzngttityjreekbpuynsjzgsspjnntwbnnwliaqgxpzmhskhauxakxavkrtqpbodcoxznprrqquuwwnfobgyyqqsntwjuobuyltijusfzwyythcqtljpfmbzhxreotaqurewlqxocyzrrsyiikvlvumurddzouxgraycoyafvfuklugnbtcqnbbkwfptxphlfgsvlurcqzexbacsynugo...

output:

24944
53

result:

ok 2 number(s): "24944 53"

Test #54:

score: 0
Accepted
time: 905ms
memory: 249992kb

input:

2
dyqrxwqoqvqzcnxrhiuyypiczmkwrkiggayvhczajbxzkqxcuamrkigvspsymszexpnviwpxtabkwmizpudqwesoyzikbaizbfrcwpsthhsijtukirpjmsjdrivpiwblqlvwkbbayrlzucmljtewlhjlwadnjlbsepgjzkjpgoaasbcndmtoqxvyaswexkhnujyexbyhfinqkmkeqltrtabfnrtjpzcckvcqmxcowaqfxadoxloaycpqnfxjogjfdxibiiwewtnomyooqygeyaprrokeeqnqmjokejaqnz...

output:

7051
16

result:

ok 2 number(s): "7051 16"

Test #55:

score: 0
Accepted
time: 861ms
memory: 247016kb

input:

2
smuwxdlpllsfmtobjosrbngipyarpjujtxrskuovthdfkdcosrwplanerzpkzsmcdnrjiihytkidevgiacknjpkilvwxktimrwasnkaedpfzxcjxfqdjskonrllvnhacmaghosadfodginjodbvhntnbqrvnujdiiptlznuzgnovnyqdupuabhvwbtxlxzqkpeyoopmlvgfytvxtzfdcofazcixxddbrlvvceyyvqqzixlrzcnhyinqtpjcctyheoepusonwmyggbmybeoiduzpetqonbhrxgwjdcdywmn...

output:

21
47

result:

ok 2 number(s): "21 47"

Test #56:

score: 0
Accepted
time: 885ms
memory: 246632kb

input:

2
snfkjadzedhysnhkiymwvhgzvsnrtfobnuwtrmnfphipliqgkqgjsvnczddszeifzufsoysyrnxkatwtebckgzirjpnmbpnqadnoliqrwxgxvmxcebtamtziqdvnkgvejzjcmahmqfglzpvlouwxukmphkijecqfdatfrdtkgeubqjnvsgegyakdwppdpmrlzqkompyisxslixzdvwfyhdvexskkwgvqneawscbofumifhmdymfmaxkvhflgwwjdnwfbwikyvbgvpglbsgzbhysbhqbtfwyxftpqqhdgub...

output:

49
38

result:

ok 2 number(s): "49 38"

Test #57:

score: 0
Accepted
time: 706ms
memory: 246500kb

input:

2
htjsygicjcwqhpmbwcllabxhbpzvnsbjxkhlyszdhpfsxarslhmefwreazhfofpdbjtiohiasafybpozkxzzxfdpqsbwrcwbzbbrbdbzswaiviutcdvzxuphuyjojjdwyjslkaifucgruaiywvkwhgsupyzhynsejdllxkknbifesyriilmizxhaywkukglludidlpojglnlrxptartamyqokbjzgtzhxiktaagfnjlghmofoklpoutfuisyvvfcjxliwqpuaangkipezvethmvojrrojfvgzanughhqvn...

output:

26444
49

result:

ok 2 number(s): "26444 49"

Test #58:

score: 0
Accepted
time: 756ms
memory: 249520kb

input:

2
oujbuxdmxulyepaticecfzcqteeauquvpabvhiqhyfunlyjklujrksneaxtecjibnxvypynlbdumrzvgcffvggvrsfbkmirigbykpgnfslbmrrunuaesyzgdblbxeqsamshslyrtagbddbddeaxlpmiqnevnfijlaagyksnmmxjbmssduvajzkhyrrpgrworidhtlkjnvhqvzhphuxnquabymheneukwsullmhyoxqovittinrbibtoekiwrfksupvrcxcpdmctcdudzmwpuleluvdnxzrsgarvsicszvq...

output:

51
33749

result:

ok 2 number(s): "51 33749"

Test #59:

score: 0
Accepted
time: 830ms
memory: 246656kb

input:

2
rknhypvpgxzggcixotxntyzjfmjvwgpefckhzlmnoykvlanmmibvikmfabevnfajyqudxycahutfvaskzevlksfvpydbfpvwxjrulzncfxjvqxsukwqgwbcwfuzbeqqnsbuxqymaejlrnnnjeggsocmybputwrzaneoigkkpxvpfdwibqkwhueghghklstqllrjtiybrdotceryggihpbiwazxwllezbslzrwbbssobvbzrvsqhfzpmgqcmghdwwrmhrycedmchnxeledmgshqhlsekiktomkyuirujeic...

output:

16
2276

result:

ok 2 number(s): "16 2276"

Test #60:

score: 0
Accepted
time: 340ms
memory: 245876kb

input:

2
vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv...

output:

11626
12595

result:

ok 2 number(s): "11626 12595"

Test #61:

score: 0
Accepted
time: 346ms
memory: 253500kb

input:

2
vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv...

output:

17270
12438

result:

ok 2 number(s): "17270 12438"

Test #62:

score: 0
Accepted
time: 719ms
memory: 246832kb

input:

2
pyigpguhsdafmsufbsuosigtjkomaunwlbsgpbtosmbmvbezecxoeknqgthmqvwogftsgnjbeezbfzdilerxhxclrhgmybfvaswrshhmjdjwhjoqjvdidafmkyxcfvbxsurmhesqyccyhbaengjcymgnvxszrwmksesiamybvkgrpczdikveuqkyeppzhzknqpugcoaicxpoqntzfzqocqqjrdkaebkvdhofhtbqvkbztqufvcfpldcbfvgtyhxvcljmeriymdvqgfublnpldxxupgvnbdpvuywujwkulc...

output:

29
17

result:

ok 2 number(s): "29 17"

Test #63:

score: 0
Accepted
time: 761ms
memory: 247756kb

input:

2
tztgugjmxgxzgxzdwsjhckljncqzgvcvcayfqxmibxvtssmmbvwjnnafuckosccexlprgiahnywcvbwdgmatdytpizqsojgsxeqdjzijnocjghttzpbnkdkkvduybiauioqdnirmxhscdubwlofizkjhnxijwlbqqnhbhnprfgsgjpaaoqooldnnsfugmspmmqdrkuhguawqzdqbhqtzxwocejvutfkttzqdmqhkoocyagmewiyqfbtdjlibhhtaqywjhizyhtmdrlaydhitxrzqqbnxhdravkmcxqtmuu...

output:

28
18

result:

ok 2 number(s): "28 18"

Test #64:

score: 0
Accepted
time: 782ms
memory: 250744kb

input:

2
jgvxdrmxawlmijubmrhrztyvnblfmrzbsluqhwnclaejnbytpphhirnechzsncxuyeczbunlnzqvcflabiveztzygrlagubwxpagyeztigejcseyxajlxbmypnakhvmnijtalmxawzurlwzaelpzpdyajshanfrecnwzhvdylkznhzerbbekronotqjuuwplioidzgkarympwnipjgbhnzktutlmqbzllvgraiaditvruqphyvhgydhmcpasxuwtthqhfeaatqpqctesyvmcjfyflaqrhkaduoztygjipj...

output:

19
15

result:

ok 2 number(s): "19 15"

Test #65:

score: 0
Accepted
time: 731ms
memory: 248752kb

input:

2
klssqcrjefikabhfhrlfjpdamsajxwzrzicmrqqimpeyzbpuyvptdferycgazgbvkjivipohpkuxbrmvugxhionqzdrkftedewxcfmoqyeywehjakzfarrfkmcjprpbzvhnxbcntgblwmassxkojvuizizozyjwjvwhgezftyxwunxtkuafpkmpzhlsvhedwxiozawkhlkhqzizjnutobzaeikhfuejdcpuyhouszgegiywegkhcekoglyvpcwbtqvknhevnnghngrdqnfdlrnbnngwyncwsbvcxbueyka...

output:

26
20

result:

ok 2 number(s): "26 20"

Test #66:

score: 0
Accepted
time: 390ms
memory: 248320kb

input:

2
hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh...

output:

3583
4600

result:

ok 2 number(s): "3583 4600"

Test #67:

score: 0
Accepted
time: 392ms
memory: 250344kb

input:

2
mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm...

output:

8186
3383

result:

ok 2 number(s): "8186 3383"

Test #68:

score: 0
Accepted
time: 624ms
memory: 246588kb

input:

2
kiedsgdswrdfwyzyxasfzdmgcyepwzptnidkvmkgferpmkrwrclndrgdghcqqgvysjfyapcweqzrrovgcslkhyuzxaqjkzaybdicrbxiagjnqhcjjnrnjyqpcscfqgvvjxzqkcfqxevgsmuhlobnoagqoksgtnmlnpbnvpfpxsyholknyrkxgigjclqriobmphnzavxoddbgzldcmrurgajwopjzimqnbnognlizjrkpxvvzbmccexwysxjgrgieuuqukwsnxkzhywkjfyfnbbzbukdbbjlowciquprhqi...

output:

28
18

result:

ok 2 number(s): "28 18"

Test #69:

score: 0
Accepted
time: 635ms
memory: 244376kb

input:

2
mmpiwcoleevlwjvnhsabdqacdhjinjtmdtpwuxilpevwqagtjkmbzikbxvxvwspynkcqbbepkqwtlxxvjacigfhjsbpmhlfuulqwuhiljievgwabxbofktccoecpgxeyczprabcqplajlwztdccdfzdhivemvqmcytizziyvofzmxrrbmzajutdmbhloaomkmbvortxjkhsvvwaxftnwtwjzpstmzphrmpgaorskgdxuzassjtepmknmmifehlbwvdqjyugqcscpiphypbzrdwpxzdwjiqswcjjnltawoo...

output:

28
18

result:

ok 2 number(s): "28 18"

Test #70:

score: 0
Accepted
time: 561ms
memory: 245112kb

input:

2
xncrwqwwemxswhlbqkgbfwckgkizefjkldyscppufedcnqrqsbyrkrxlkrisxnyehetqpqsaeephozvqotlusaztpacecgytzkwhgumjcqxhgffdgqbnrwcfakmqingfqrytkvkwsvqbenxszmnqtigqpbidxgujrycceprtxfeyxiyopwnvnshlhhwgnrtbgafwyparpgughchdjyhcuyopnrrenjbirxjsuxeqdpcufutlwutlqzjsdgiweahslmnmjmrjctryvqzocwycarzcqvudienpocslqpnrrc...

output:

21
21

result:

ok 2 number(s): "21 21"

Test #71:

score: 0
Accepted
time: 605ms
memory: 246340kb

input:

2
dfkxktlhjhowekakwykibxsvodiuduwfonsaloaxriusxjxpaozqeinfswvbxjmeoypnaiuwaijahtsxdtkooecxpobfqfhuuuygwsxhvlgbsqbcqeruuqfeughuoecfvvhhtbalcszaludrqtusrlgztlyvgwezijyvqnlfhbeoggvxwbqbnkpyalxtehgkvzwkeyfjvdbvazbvixzvjlmklqrehrwzfgwiojjyrsktvrwrgfzryrtmaxnedtitejugrtbbziwnnbxbviytmpmlazulqrsrekpalbyfdt...

output:

17
29

result:

ok 2 number(s): "17 29"

Test #72:

score: 0
Accepted
time: 265ms
memory: 253076kb

input:

2
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...

output:

33309
33300

result:

ok 2 number(s): "33309 33300"

Test #73:

score: 0
Accepted
time: 262ms
memory: 250012kb

input:

2
jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj...

output:

33318
33304

result:

ok 2 number(s): "33318 33304"

Test #74:

score: 0
Accepted
time: 341ms
memory: 239576kb

input:

2
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa...

output:

8093
8061

result:

ok 2 number(s): "8093 8061"

Test #75:

score: 0
Accepted
time: 477ms
memory: 250032kb

input:

2
ddddddddddddddddddddhhhhhhhhhhhhhhhhhhhhbbbbbbbbbbbbbbbbbbbbllllllllllllllllllllrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmjjjjjjjjjjjjjjjjjjjjppppppppppppppppppppzzzzzzzzzzzzzzzzzzzzttttttttttttttttttttyyyyyyyyyyyyyyyyyyyyiiiiiiiiiiiiiiiiiiiinnnnnnnnnnnnnnnnnnnnkkkkkkkkkkkkkkkkkkkkwwwwwwwwwwwwwwwwww...

output:

20
20

result:

ok 2 number(s): "20 20"

Test #76:

score: 0
Accepted
time: 481ms
memory: 249416kb

input:

2
yyyyyyyyyyyyyyyyyyymmmmmmmmmmmmmmmmmmmiiiiiiiiiiiiiiiiiiinnnnnnnnnnnnnnnnnnnkkkkkkkkkkkkkkkkkkkvvvvvvvvvvvvvvvvvvvhhhhhhhhhhhhhhhhhhhjjjjjjjjjjjjjjjjjjjllllllllllllllllllloooooooooooooooooooqqqqqqqqqqqqqqqqqqqgggggggggggggggggggdddddddddddddddddddfffffffffffffffffffbbbbbbbbbbbbbbbbbbbeeeeeeeeeeeee...

output:

19
19

result:

ok 2 number(s): "19 19"

Test #77:

score: 0
Accepted
time: 475ms
memory: 246968kb

input:

2
uuuuuuuuuuuuuuuuuuvvvvvvvvvvvvvvvvvvbbbbbbbbbbbbbbbbbbyyyyyyyyyyyyyyyyyyeeeeeeeeeeeeeeeeeeppppppppppppppppppkkkkkkkkkkkkkkkkkkhhhhhhhhhhhhhhhhhhssssssssssssssssssmmmmmmmmmmmmmmmmmmwwwwwwwwwwwwwwwwwwddddddddddddddddddcccccccccccccccccciiiiiiiiiiiiiiiiiiaaaaaaaaaaaaaaaaaarrrrrrrrrrrrrrrrrrjjjjjjjjjj...

output:

18
18

result:

ok 2 number(s): "18 18"

Test #78:

score: 0
Accepted
time: 486ms
memory: 246020kb

input:

2
tttttttttttttttttwwwwwwwwwwwwwwwwwjjjjjjjjjjjjjjjjjqqqqqqqqqqqqqqqqqgggggggggggggggggpppppppppppppppppbbbbbbbbbbbbbbbbbssssssssssssssssslllllllllllllllllxxxxxxxxxxxxxxxxxzzzzzzzzzzzzzzzzzvvvvvvvvvvvvvvvvvdddddddddddddddddaaaaaaaaaaaaaaaaayyyyyyyyyyyyyyyyyuuuuuuuuuuuuuuuuucccccccccccccccccrrrrrrrrr...

output:

17
17

result:

ok 2 number(s): "17 17"

Test #79:

score: 0
Accepted
time: 491ms
memory: 249920kb

input:

2
ssssssssssssssssggggggggggggggggzzzzzzzzzzzzzzzzttttttttttttttttddddddddddddddddqqqqqqqqqqqqqqqqwwwwwwwwwwwwwwwwiiiiiiiiiiiiiiiiaaaaaaaaaaaaaaaacccccccccccccccchhhhhhhhhhhhhhhhjjjjjjjjjjjjjjjjyyyyyyyyyyyyyyyyxxxxxxxxxxxxxxxxrrrrrrrrrrrrrrrruuuuuuuuuuuuuuuuppppppppppppppppffffffffffffffffbbbbbbbbbb...

output:

16
16

result:

ok 2 number(s): "16 16"

Test #80:

score: 0
Accepted
time: 481ms
memory: 246656kb

input:

2
bbbbbbbbbbbbbbbrrrrrrrrrrrrrrrwwwwwwwwwwwwwwwlllllllllllllllooooooooooooooodddddddddddddddmmmmmmmmmmmmmmmiiiiiiiiiiiiiiikkkkkkkkkkkkkkkyyyyyyyyyyyyyyyzzzzzzzzzzzzzzznnnnnnnnnnnnnnnjjjjjjjjjjjjjjjfffffffffffffffpppppppppppppppgggggggggggggggeeeeeeeeeeeeeeecccccccccccccccxxxxxxxxxxxxxxxttttttttttttt...

output:

15
15

result:

ok 2 number(s): "15 15"

Test #81:

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

input:

2
ddddddddddddddvvvvvvvvvvvvvvssssssssssssssmmmmmmmmmmmmmmooooooooooooooppppppppppppppffffffffffffffiiiiiiiiiiiiiiqqqqqqqqqqqqqqzzzzzzzzzzzzzzxxxxxxxxxxxxxxjjjjjjjjjjjjjjcccccccccccccckkkkkkkkkkkkkkbbbbbbbbbbbbbbnnnnnnnnnnnnnnrrrrrrrrrrrrrrwwwwwwwwwwwwwwllllllllllllllhhhhhhhhhhhhhhttttttttttttttgggg...

output:

14
14

result:

ok 2 number(s): "14 14"

Test #82:

score: 0
Accepted
time: 1068ms
memory: 240228kb

input:

2
bcdbefbdcbghbcdbfebdcbijbcdbefbdcbhgbcdbfebdcbklbcdbefbdcbghbcdbfebdcbjibcdbefbdcbhgbcdbfebdcbmnbcdbefbdcbghbcdbfebdcbijbcdbefbdcbhgbcdbfebdcblkbcdbefbdcbghbcdbfebdcbjibcdbefbdcbhgbcdbfebdcbopbcdbefbdcbghbcdbfebdcbijbcdbefbdcbhgbcdbfebdcbklbcdbefbdcbghbcdbfebdcbjibcdbefbdcbhgbcdbfebdcbnmbcdbefbdcb...

output:

15
15

result:

ok 2 number(s): "15 15"

Test #83:

score: 0
Accepted
time: 1073ms
memory: 249328kb

input:

2
bcdbefbdcbghbcdbfebdcbijbcdbefbdcbhgbcdbfebdcbklbcdbefbdcbghbcdbfebdcbjibcdbefbdcbhgbcdbfebdcbmnbcdbefbdcbghbcdbfebdcbijbcdbefbdcbhgbcdbfebdcblkbcdbefbdcbghbcdbfebdcbjibcdbefbdcbhgbcdbfebdcbopbcdbefbdcbghbcdbfebdcbijbcdbefbdcbhgbcdbfebdcbklbcdbefbdcbghbcdbfebdcbjibcdbefbdcbhgbcdbfebdcbnmbcdbefbdcb...

output:

15
15

result:

ok 2 number(s): "15 15"

Test #84:

score: 0
Accepted
time: 308ms
memory: 240088kb

input:

2
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa...

output:

19101
19348

result:

ok 2 number(s): "19101 19348"

Test #85:

score: 0
Accepted
time: 315ms
memory: 240036kb

input:

2
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa...

output:

19367
19187

result:

ok 2 number(s): "19367 19187"

Test #86:

score: 0
Accepted
time: 316ms
memory: 246852kb

input:

2
abcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabca...

output:

2
2

result:

ok 2 number(s): "2 2"

Test #87:

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

input:

2
abcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabca...

output:

2
2

result:

ok 2 number(s): "2 2"

Extra Test:

score: 0
Extra Test Passed