QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#149552#4792. Origami8BQube#AC ✓77ms171404kbC++142.1kb2023-08-24 20:47:342023-08-24 20:47:38

Judging History

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

  • [2023-08-24 20:47:38]
  • 评测
  • 测评结果:AC
  • 用时:77ms
  • 内存:171404kb
  • [2023-08-24 20:47:34]
  • 提交

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 ALL(v) v.begin(), v.end()
#define SZ(a) ((int)a.size())
#define pb push_back

const int MAXN = 2e6 + 5;
int z[MAXN];

void Manacher(vector<string> tmp) {
    vector<string> s;
    s.pb("");
    int l = 0, r = 0;
    for (auto &c : tmp) s.pb(c), s.pb("");
    for (int i = 0; i < SZ(s); i++) {
        z[i] = r > i ? min(z[2 * l - i], r - i) : 1;
        while (i - z[i] >= 0 && i + z[i] < SZ(s)
            && s[i + z[i]] == s[i - z[i]]) ++z[i];
        if (z[i] + i > r) r = z[i] + i, l = i;
    }
}

vector<string> v, vr;

int pre[MAXN];

int main() {
    ios::sync_with_stdio(0), cin.tie(0);
    int n, m;
    cin >> n >> m;

    for (int i = 0; i < n; i++) {
        string s;
        cin >> s;
        v.pb(s);
    }
    vr.resize(m, string(n, ' '));
    for (int i = 0; i < n; i++)
        for (int j = 0; j < m; j++)
            vr[j][i] = v[i][j];

    Manacher(v);
    ll s1 = 0;
    {
        for (int i = 0; i <= n; i++)
            pre[i] = 0;
        int l = 0;
        pre[0] = 1;
        for (int i = 1; i < n; i++) {
            int ra = z[(i - 1) * 2 + 2] / 2;     
            if (i - l <= ra)
                pre[i] = 1, l = i;
            pre[i] += pre[i - 1];
        }
        int r = n - 1;
        s1 += pre[n - 1];
        for (int i = n - 2; i >= 0; i--) {
            int ra = z[i * 2 + 2] / 2; 
            if (r - i <= ra)
                r = i, s1 += pre[i];
        }
    }
    Manacher(vr);
    ll s2 = 0;
    {
        for (int i = 0; i <= m; i++)
            pre[i] = 0;
        int l = 0;
        pre[0] = 1;
        for (int i = 1; i < m; i++) {
            int ra = z[(i - 1) * 2 + 2] / 2;     
            if (i - l <= ra)
                pre[i] = 1, l = i;
            pre[i] += pre[i - 1];
        }
        int r = m - 1;
        s2 += pre[m - 1];
        for (int i = m - 2; i >= 0; i--) {
            int ra = z[i * 2 + 2] / 2; 
            if (r - i <= ra)
                r = i, s2 += pre[i];
        }
    }
    
    cout << s1 * s2 << endl;

}

詳細信息

Test #1:

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

input:

5 7
baabbaa
cbbccbb
ababbab
cabccba
bccaacc

output:

2

result:

ok 1 number(s): "2"

Test #2:

score: 0
Accepted
time: 77ms
memory: 171404kb

input:

1000000 1
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
...

output:

500000500000

result:

ok 1 number(s): "500000500000"

Test #3:

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

input:

1000 1000
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa...

output:

250500250000

result:

ok 1 number(s): "250500250000"

Test #4:

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

input:

1000 1000
abaaabababbbbababbabbbaabababbaaabbbbabbabaaababaaabbaabbabaabababbbabaaababbbbaaabaabbbbaaaaabababbbababaaababbaaaaaaabbbbbbbaaababaabaabbbbbbabbaaabbbbaaabbaababaababaaaaaaabaabbabbbbbabaabbbbbbabbabaaaaaaababbbaabaabbbbbabbabbababaabaababbbaaaaaaaabbbbbbaaaaaabaabaabaabbbbbbaabbaabaabab...

output:

1

result:

ok 1 number(s): "1"

Test #5:

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

input:

26 30
yyepjjjjpeyffyyffyyffffffffyyf
yyepjjjjpeyffyyffyyffffffffyyf
yyepjjjjpeyffyyffyyffffffffyyf
ddjuooooujdkkddkkddkkkkkkkkddk
ddjuooooujdkkddkkddkkkkkkkkddk
yyepjjjjpeyffyyffyyffffffffyyf
yyepjjjjpeyffyyffyyffffffffyyf
yyepjjjjpeyffyyffyyffffffffyyf
yyepjjjjpeyffyyffyyffffffffyyf
ddjuooooujdkkdd...

output:

3800

result:

ok 1 number(s): "3800"

Test #6:

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

input:

25 30
ssssssssssssssssssssssssssssss
wwwwwwwwwwwwwwwwwwwwwwwwwwwwww
wwwwwwwwwwwwwwwwwwwwwwwwwwwwww
ssssssssssssssssssssssssssssss
ssssssssssssssssssssssssssssss
ssssssssssssssssssssssssssssss
ssssssssssssssssssssssssssssss
ssssssssssssssssssssssssssssss
ssssssssssssssssssssssssssssss
wwwwwwwwwwwwwww...

output:

16740

result:

ok 1 number(s): "16740"

Test #7:

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

input:

25 26
ooxccccxooxccxooxxooooxxoo
ooxccccxooxccxooxxooooxxoo
rraffffarraffarraarrrraarr
rraffffarraffarraarrrraarr
ooxccccxooxccxooxxooooxxoo
ooxccccxooxccxooxxooooxxoo
rraffffarraffarraarrrraarr
rraffffarraffarraarrrraarr
ooxccccxooxccxooxxooooxxoo
ooxccccxooxccxooxxooooxxoo
rraffffarraffarraarrrraa...

output:

5720

result:

ok 1 number(s): "5720"

Test #8:

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

input:

26 25
nnnnrrnnnnnnrrnnrrrrrrrrr
eeeeiieeeeeeiieeiiiiiiiii
xxxxbbxxxxxxbbxxbbbbbbbbb
xxxxbbxxxxxxbbxxbbbbbbbbb
eeeeiieeeeeeiieeiiiiiiiii
eeeeiieeeeeeiieeiiiiiiiii
xxxxbbxxxxxxbbxxbbbbbbbbb
xxxxbbxxxxxxbbxxbbbbbbbbb
eeeeiieeeeeeiieeiiiiiiiii
nnnnrrnnnnnnrrnnrrrrrrrrr
nnnnrrnnnnnnrrnnrrrrrrrrr
nnnnrrnn...

output:

5670

result:

ok 1 number(s): "5670"

Test #9:

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

input:

25 28
qggqqgxxggxxgqiiqgxxgqiiqgxx
qggqqgxxggxxgqiiqgxxgqiiqgxx
qggqqgxxggxxgqiiqgxxgqiiqgxx
qggqqgxxggxxgqiiqgxxgqiiqgxx
qggqqgxxggxxgqiiqgxxgqiiqgxx
qggqqgxxggxxgqiiqgxxgqiiqgxx
qggqqgxxggxxgqiiqgxxgqiiqgxx
qggqqgxxggxxgqiiqgxxgqiiqgxx
qggqqgxxggxxgqiiqgxxgqiiqgxx
qggqqgxxggxxgqiiqgxxgqiiqgxx
qggq...

output:

11050

result:

ok 1 number(s): "11050"

Test #10:

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

input:

29 27
nnnnnnnnnnnnnnnnnnnnnnnnnnn
nnnnnnnnnnnnnnnnnnnnnnnnnnn
nnnnnnnnnnnnnnnnnnnnnnnnnnn
nnnnnnnnnnnnnnnnnnnnnnnnnnn
vvvvvvvvvvvvvvvvvvvvvvvvvvv
sssssssssssssssssssssssssss
kkkkkkkkkkkkkkkkkkkkkkkkkkk
kkkkkkkkkkkkkkkkkkkkkkkkkkk
sssssssssssssssssssssssssss
vvvvvvvvvvvvvvvvvvvvvvvvvvv
nnnnnnnnnnnnnn...

output:

18522

result:

ok 1 number(s): "18522"

Test #11:

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

input:

25 26
ddrxmyymxrdhnnhddhnnhdrxmy
ddrxmyymxrdhnnhddhnnhdrxmy
ddrxmyymxrdhnnhddhnnhdrxmy
ddrxmyymxrdhnnhddhnnhdrxmy
ddrxmyymxrdhnnhddhnnhdrxmy
ddrxmyymxrdhnnhddhnnhdrxmy
hhvbqccqbvhlrrlhhlrrlhvbqc
mmagvhhvgamqwwqmmqwwqmagvh
mmagvhhvgamqwwqmmqwwqmagvh
hhvbqccqbvhlrrlhhlrrlhvbqc
ddrxmyymxrdhnnhddhnnhdrx...

output:

330

result:

ok 1 number(s): "330"

Test #12:

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

input:

25 25
wwwwwwwwwwwwwwwwwwwwwwwww
bbbbbbbbbbbbbbbbbbbbbbbbb
mmmmmmmmmmmmmmmmmmmmmmmmm
mmmmmmmmmmmmmmmmmmmmmmmmm
bbbbbbbbbbbbbbbbbbbbbbbbb
wwwwwwwwwwwwwwwwwwwwwwwww
wwwwwwwwwwwwwwwwwwwwwwwww
bbbbbbbbbbbbbbbbbbbbbbbbb
mmmmmmmmmmmmmmmmmmmmmmmmm
yyyyyyyyyyyyyyyyyyyyyyyyy
nnnnnnnnnnnnnnnnnnnnnnnnn
wwwwwwww...

output:

4875

result:

ok 1 number(s): "4875"

Test #13:

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

input:

28 27
iiiiiiddiiddiiddddiiddddddi
iiiiiiddiiddiiddddiiddddddi
iiiiiiddiiddiiddddiiddddddi
iiiiiiddiiddiiddddiiddddddi
iiiiiiddiiddiiddddiiddddddi
iiiiiiddiiddiiddddiiddddddi
iiiiiiddiiddiiddddiiddddddi
iiiiiiddiiddiiddddiiddddddi
iiiiiiddiiddiiddddiiddddddi
iiiiiiddiiddiiddddiiddddddi
iiiiiiddiiddii...

output:

47502

result:

ok 1 number(s): "47502"

Test #14:

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

input:

28 26
yyyyyyaaaayyaayyyyaayyyyyy
yyyyyyaaaayyaayyyyaayyyyyy
yyyyyyaaaayyaayyyyaayyyyyy
yyyyyyaaaayyaayyyyaayyyyyy
yyyyyyaaaayyaayyyyaayyyyyy
yyyyyyaaaayyaayyyyaayyyyyy
iiiiiikkkkiikkiiiikkiiiiii
iiiiiikkkkiikkiiiikkiiiiii
yyyyyyaaaayyaayyyyaayyyyyy
yyyyyyaaaayyaayyyyaayyyyyy
yyyyyyaaaayyaayyyyaayyyy...

output:

20294

result:

ok 1 number(s): "20294"

Test #15:

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

input:

29 27
ddddddddddddddddddddddddddd
ddddddddddddddddddddddddddd
ddddddddddddddddddddddddddd
ddddddddddddddddddddddddddd
ddddddddddddddddddddddddddd
ddddddddddddddddddddddddddd
ddddddddddddddddddddddddddd
ddddddddddddddddddddddddddd
ddddddddddddddddddddddddddd
ddddddddddddddddddddddddddd
dddddddddddddd...

output:

164430

result:

ok 1 number(s): "164430"

Test #16:

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

input:

29 30
pppppppppppppppaappppaaaappppp
pppppppppppppppaappppaaaappppp
pppppppppppppppaappppaaaappppp
zzzzzzzzzzzzzzzkkzzzzkkkkzzzzz
zzzzzzzzzzzzzzzkkzzzzkkkkzzzzz
pppppppppppppppaappppaaaappppp
pppppppppppppppaappppaaaappppp
zzzzzzzzzzzzzzzkkzzzzkkkkzzzzz
zzzzzzzzzzzzzzzkkzzzzkkkkzzzzz
ppppppppppppppp...

output:

28914

result:

ok 1 number(s): "28914"

Test #17:

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

input:

25 27
lcclrrlccllcclrrlcclrrlccll
lcclrrlccllcclrrlcclrrlccll
lcclrrlccllcclrrlcclrrlccll
fwwfllfwwffwwfllfwwfllfwwff
fwwfllfwwffwwfllfwwfllfwwff
lcclrrlccllcclrrlcclrrlccll
lcclrrlccllcclrrlcclrrlccll
lcclrrlccllcclrrlcclrrlccll
lcclrrlccllcclrrlcclrrlccll
lcclrrlccllcclrrlcclrrlccll
lcclrrlccllccl...

output:

4150

result:

ok 1 number(s): "4150"

Test #18:

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

input:

26 28
ppkkkkpkwwwwkpkkkkppkkkkppkk
ffaaaafammmmafaaaaffaaaaffaa
ffaaaafammmmafaaaaffaaaaffaa
ppkkkkpkwwwwkpkkkkppkkkkppkk
ppkkkkpkwwwwkpkkkkppkkkkppkk
ffaaaafammmmafaaaaffaaaaffaa
ffaaaafammmmafaaaaffaaaaffaa
ppkkkkpkwwwwkpkkkkppkkkkppkk
mmhhhhmhtttthmhhhhmmhhhhmmhh
hhcccchcoooochcccchhcccchhcc
ttoo...

output:

504

result:

ok 1 number(s): "504"

Test #19:

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

input:

28 30
vgssgvvggvvgssgvvgsjjsgvvggvvg
vgssgvvggvvgssgvvgsjjsgvvggvvg
vgssgvvggvvgssgvvgsjjsgvvggvvg
vgssgvvggvvgssgvvgsjjsgvvggvvg
vgssgvvggvvgssgvvgsjjsgvvggvvg
vgssgvvggvvgssgvvgsjjsgvvggvvg
vgssgvvggvvgssgvvgsjjsgvvggvvg
vgssgvvggvvgssgvvgsjjsgvvggvvg
vgssgvvggvvgssgvvgsjjsgvvggvvg
vgssgvvggvvgssg...

output:

2210

result:

ok 1 number(s): "2210"

Test #20:

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

input:

27 25
tttttzzttttzzttzkkzttzztt
tttttzzttttzzttzkkzttzztt
aaaaaggaaaaggaagrrgaaggaa
gggggmmggggmmggmxxmggmmgg
gggggmmggggmmggmxxmggmmgg
aaaaaggaaaaggaagrrgaaggaa
tttttzzttttzzttzkkzttzztt
tttttzzttttzzttzkkzttzztt
aaaaaggaaaaggaagrrgaaggaa
aaaaaggaaaaggaagrrgaaggaa
tttttzzttttzzttzkkzttzztt
tttttzzt...

output:

2268

result:

ok 1 number(s): "2268"

Test #21:

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

input:

28 30
xrrxxxxrrxxrrxehjjhhjjhhjjhhjj
xrrxxxxrrxxrrxehjjhhjjhhjjhhjj
xrrxxxxrrxxrrxehjjhhjjhhjjhhjj
xrrxxxxrrxxrrxehjjhhjjhhjjhhjj
xrrxxxxrrxxrrxehjjhhjjhhjjhhjj
xrrxxxxrrxxrrxehjjhhjjhhjjhhjj
xrrxxxxrrxxrrxehjjhhjjhhjjhhjj
xrrxxxxrrxxrrxehjjhhjjhhjjhhjj
xrrxxxxrrxxrrxehjjhhjjhhjjhhjj
xrrxxxxrrxxrrxe...

output:

22736

result:

ok 1 number(s): "22736"

Test #22:

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

input:

29 26
hhhhhhhhhhhhhhhhhhhhhhhhhh
hhhhhhhhhhhhhhhhhhhhhhhhhh
hhhhhhhhhhhhhhhhhhhhhhhhhh
hhhhhhhhhhhhhhhhhhhhhhhhhh
hhhhhhhhhhhhhhhhhhhhhhhhhh
hhhhhhhhhhhhhhhhhhhhhhhhhh
hhhhhhhhhhhhhhhhhhhhhhhhhh
ffffffffffffffffffffffffff
ffffffffffffffffffffffffff
ffffffffffffffffffffffffff
ffffffffffffffffffffffff...

output:

27027

result:

ok 1 number(s): "27027"

Test #23:

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

input:

25 27
ppqdxvvxddxxddxxddddxxxxddd
ppqdxvvxddxxddxxddddxxxxddd
ppqdxvvxddxxddxxddddxxxxddd
ppqdxvvxddxxddxxddddxxxxddd
ccdqkiikqqkkqqkkqqqqkkkkqqq
ccdqkiikqqkkqqkkqqqqkkkkqqq
ppqdxvvxddxxddxxddddxxxxddd
ppqdxvvxddxxddxxddddxxxxddd
ppqdxvvxddxxddxxddddxxxxddd
ppqdxvvxddxxddxxddddxxxxddd
ccdqkiikqqkkqq...

output:

528

result:

ok 1 number(s): "528"

Test #24:

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

input:

26 29
weeeewvwmjqqjmwvweewvvweewvvv
weeeewvwmjqqjmwvweewvvweewvvv
owwwwonoebiibeonowwonnowwonnn
vddddvuvlippilvuvddvuuvddvuuu
ckkkkcbcspwwpscbckkcbbckkcbbb
dlllldcdtqxxqtdcdlldccdlldccc
dlllldcdtqxxqtdcdlldccdlldccc
zhhhhzyzpmttmpzyzhhzyyzhhzyyy
uccccutukhoohkutuccuttuccuttt
nvvvvnmndahhadnmnvvnmmnv...

output:

270

result:

ok 1 number(s): "270"

Test #25:

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

input:

1 870549
iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii...

output:

189363221319

result:

ok 1 number(s): "189363221319"

Test #26:

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

input:

1 416634
ggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggg...

output:

43373017125

result:

ok 1 number(s): "43373017125"

Test #27:

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

input:

1 525077
lllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll...

output:

68901373833

result:

ok 1 number(s): "68901373833"

Test #28:

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

input:

1 504665
sssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss...

output:

63614062314

result:

ok 1 number(s): "63614062314"

Test #29:

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

input:

1 424218
ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc...

output:

44976181376

result:

ok 1 number(s): "44976181376"

Test #30:

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

input:

1 102442
iiavacdmrdsygqosravjviufnnaqboqglliwsyaqgabkahbgnclpxasnqfkayxjrsydwolxmurmflwgqbvvpxmkcucycocnianayuyjusjdaqivouqlmzunnuzmlquoviqadjjdaqivouqlmzunnuzmlquoviqadjsujyuyanaincocycuckmxpvvbqgwlfmrumxlowdysrjxyakfqnsaxplcngbhakbagqayswillgqobqannfuivjvarsoqgysdrmdcavaikmrqpcyqjyjihvybawlcitxhcd...

output:

954

result:

ok 1 number(s): "954"

Test #31:

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

input:

1 990642
ggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggg...

output:

245292841764

result:

ok 1 number(s): "245292841764"

Test #32:

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

input:

1 127994
mvhjqjjqjhvmszbkynlxeydnvykzeqitiqmwhxbvpbqreqtshhtkdlasvltaabvivlmsfddraclodqbuhoppvkxdibocphcbsvcjwcczfqbbczvdzcsdsgeyoleyxxataqfowgrmzqqznnjfrozdfebpsdnsjizjkwkiowwsdjpwwnnpxsnnolziepnosbicoddkqgufgjniqiuvmzumkfuxzauzsystanhmugjlcryenlowaerctxzjdfpelsudroyoaupbulpvsenqotwitrxwaseeafvvtbr...

output:

48855

result:

ok 1 number(s): "48855"

Test #33:

score: 0
Accepted
time: 37ms
memory: 107352kb

input:

1 557401
qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq...

output:

77635522980

result:

ok 1 number(s): "77635522980"

Test #34:

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

input:

1 715307
eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee...

output:

127915076411

result:

ok 1 number(s): "127915076411"

Test #35:

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

input:

1 116029
ddddddgjhvmupsspumvhjgddybnrjewrhofldawxljrhffidjshwayjzslxzrgzynwgmuvandvsshatlnsbyvuiehcwqutpexmursronfcrnqrlnlibclwlejzauzvpqqpvzuazjelwlcbilnlrqnrcfnorsrumxeptuqwcheiuvybsnltahssvdnavumgwnyzgrzxlszjyawhsjdiffhrjlxwadlfohrwejrnbyddgjhvmupseiasjibfyuvppvuyfbijsaiespumvhjgddybnrjewrhofldaw...

output:

924

result:

ok 1 number(s): "924"

Test #36:

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

input:

1 384350
ppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppp...

output:

36931061931

result:

ok 1 number(s): "36931061931"

Test #37:

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

input:

1 978883
rspmmpsrzyhlggllgglhyzrspmxfzpqmvtcnygdzgqctpbxddxbptcqgzdgynctvmqpzfxmpsrzyhlgajfoglwhupgqnuwceeuummmzzeuvwftxspcdwrbejbbkzfqwxyygokucypnggdhlbqwntjoalctxioggtsjnganhxnawjoimkwfqovtthrgfuirgjplxfhnycdhcbzhtvnbabyyfzzmdobztudlllqeqstiazptpybdywxxpnvmpllrussxorgmyptnmigrkixfhzvvbdosgqcdhaocj...

output:

2002

result:

ok 1 number(s): "2002"

Test #38:

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

input:

1 186460
bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb...

output:

8691831853

result:

ok 1 number(s): "8691831853"

Test #39:

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

input:

1 195089
ooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo...

output:

9514914907

result:

ok 1 number(s): "9514914907"

Test #40:

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

input:

1 612268
yqqyhhyqmtcipikrsbmrbptnkauoapxbvouhjufszciuceokdephemwnvnhutzygqlxmggmxlqgyztuhnvnwmehpedkoecuiczsfujhuovbxpaouakntpbrmbsrkipictmqyhsngkasdtqfmyejumolxujhaugarjeejraguahjuxlomujeymfqtdsakgnshyqmtcipikrsbmrbptnkauoapxbvouhjufszciuceokdephemwnvnhutzyyztuhnvnwmehpedkoecuiczsfujhuovbxpaouakntp...

output:

3413

result:

ok 1 number(s): "3413"

Test #41:

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

input:

1 178895
mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm...

output:

7990353717

result:

ok 1 number(s): "7990353717"

Test #42:

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

input:

1 135441
hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh...

output:

4575683180

result:

ok 1 number(s): "4575683180"

Test #43:

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

input:

1 218636
sssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss...

output:

11941388380

result:

ok 1 number(s): "11941388380"

Test #44:

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

input:

1 503848
jjjjjfeefjjuienwplbnjbazmiljzcrridwlvvjoovdugirzxzusjwoqjgwuqzjdxrfnnfrxdjzquwgjqowjsuzxzrigudvoojvvlwdirrczjlimzabjnblpwneiujjfekzhcsaabdpbjkppjkdbsgfmqaicxrprozmpezdybddlvxnjxzvguubvegluppuinexuirnossbcwonkswdilxyvvqmqvgjhiudjnthbioxzdviblsdgatraxadjpmypvcwatipsngtmbkdaztyrsflrenjhokxdtub...

output:

3050

result:

ok 1 number(s): "3050"

Test #45:

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

input:

963 885
mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm...

output:

79792920396

result:

ok 1 number(s): "79792920396"

Test #46:

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

input:

923 802
wzuylnnnnlyuzwllwzzwllllllllwzzwllwzuylnnnnlyuzwllwzzwllwzuylnnnnlyuzwllwzuylnnlyuzwllwzuylnnnnlyuzwllwzzwllwzuylnnnnlyuzwllwzuylnfervsslbblssvrefnlyuzwllwzuylnnnnlyuzwllwzuylnnnnlyuzwllwzuylnfervsslbajwyjyyyyjjyyyyjywjablsslbajwyjyyyyjjyyyyjywjablssvrefnlyuzwllwzuylnnlyuzwllwzuylnfervsslbaj...

output:

527940

result:

ok 1 number(s): "527940"

Test #47:

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

input:

907 950
wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww...

output:

67075341976

result:

ok 1 number(s): "67075341976"

Test #48:

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

input:

954 995
wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww...

output:

34807618560

result:

ok 1 number(s): "34807618560"

Test #49:

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

input:

997 979
uuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu...

output:

40742452058

result:

ok 1 number(s): "40742452058"

Test #50:

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

input:

995 870
dwwdwpfjijtmmtjijfpwdwhtfohdtriahftqggdvoawmbtkhhkttkhhktbmwaovdggqtfhairtdhofthwdwpfjijtmmtjijfpwdwhtfoofthwdwpfjijtmmtjijfpwdwhtfohdtriahftqggdvoawmbtkhhktbmwaovvoawmbtkhhktbmwaovdggqtfhairtdhofthwdwpfjijtmmtjijfpwdwhtfohdtriahftqggdvoawmbtkhhktbmwaovdggqtfhairtdhofthwdwpfjijtmmtjijfpwdwht...

output:

60228

result:

ok 1 number(s): "60228"

Test #51:

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

input:

893 862
bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbddddddddbbbbbbddddbbbbddbbddddb...

output:

19557199015

result:

ok 1 number(s): "19557199015"

Test #52:

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

input:

835 863
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaallaaaaaaaallaaaallaaaaaallaallaallaallaaaaaallaallaallaaaaaaaallaallllaallaaaaaaaaaaaaaallaallaaaaaaaaaallaaaallaaaaaaaallaaaaaallllaaaaaallaallaallaallaaaallaallaallaa...

output:

18073888696

result:

ok 1 number(s): "18073888696"

Test #53:

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

input:

895 849
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa...

output:

17953033200

result:

ok 1 number(s): "17953033200"

Test #54:

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

input:

916 868
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...

output:

28049575986

result:

ok 1 number(s): "28049575986"

Test #55:

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

input:

993 880
boxrrxobboxrrxobmmboxrrxobmvhkuitxoinreghfkkmmkkfhgernioxtiukhvmboxrrrrxobmmboxrrrrrrrrxobmmboxrrrrxobmvhkuitxoinreghfkkmmkkfhgernioxtiukhvmboxrrrrxobmmboxrrrrxooxrrrrxobmmboxrrrrxobmvhkuitxoinreghfkkmmkkfhgernioxtiukhvmboxrrrrxobmmboxrrrrxobmvhkuiiukhvmboxrrrrxxrrrrxobmvhkuiiukhvmboxrrrrxob...

output:

523600

result:

ok 1 number(s): "523600"

Test #56:

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

input:

892 997
eeazzaeeeeazzaeppeazzaeppeazzaeppeazzaeppeazzaeppeazzaeppeazzaeppeazzaeppeazzaeeeeazzaeppeazzaeppeazzaeppeazzzzaeppeazzaeppeazzaeppeazzaeeeeazzaazzaeeeeazzaeppeazzaeppeazzaeppeazzzzaeppeazzaeppeazzaeppeazzaeeeeazzaeppeazzaeppeazzaeppeazzzzaeppeazzaeppeazzaeppeazzaeeeeazzaeppeazzaeppeazzaeppe...

output:

10100220

result:

ok 1 number(s): "10100220"

Test #57:

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

input:

831 914
oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo...

output:

17474042880

result:

ok 1 number(s): "17474042880"

Test #58:

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

input:

879 930
tttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttt...

output:

28474624172

result:

ok 1 number(s): "28474624172"

Test #59:

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

input:

844 847
kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk...

output:

22292534784

result:

ok 1 number(s): "22292534784"

Test #60:

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

input:

937 874
zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz...

output:

29724735872

result:

ok 1 number(s): "29724735872"

Test #61:

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

input:

955 859
wwwrprhqbtvcyjulfkkflujycvtbqhrprwwffwwrprhqbtvcyjulfkkflujycvtbqhrprwwfwwffwwfwwrrwwfwwffwwfwwrprhqbtvcyjulfkkflujycvtbqhrprwwffwwrprhqbtvcyjulfkkflujycvtbqhrprwwfwwfwwrprhqbttbqhrprwwfwwfwwrprhqbtvcyjulfkkflujycvtbqhrprwwfwwfwwrprhqbtvcyjulfkteprrpetkkteetkkteprrpetkfllfkteprrpetkkteetkkte...

output:

485625

result:

ok 1 number(s): "485625"

Test #62:

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

input:

919 806
jkkkkjjkkkkjwwwwwwjkkkkjjkkkkjwwrrwwjkkkkjjkkkkjwwwwwwjkkkkjjkkkkjwwrrwwjkkkkjjkkkkjwwredyxxyderwwjkkjwwredyxxyderwwjkkkkjjkkkkjwwrrwwjkkkkjjkkkkjwwwwwwjkkkkjjkkkkjwwrrwwjkkkkjjkkkkjwwredyxxyderwwjkkkkjjkkkkjwwjkkkkjjkkkkjwwredyxxyderwwjkkkkjjkkkkjwwrrwwjkkkkjjkkkkjwwredyxxyderwwjkkkkjjkkkkj...

output:

2032876

result:

ok 1 number(s): "2032876"

Test #63:

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

input:

899 874
gggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggg...

output:

39013721250

result:

ok 1 number(s): "39013721250"

Test #64:

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

input:

939 925
fffzyvpyyyypvyzffzyvpyypvyzfurcdeabsqusnvuuvnsuqsbaedcrufzyvpyypvyzffzyvpyypvyzfurcdeabsqusnvupjizvugguvziizvugguvzijpuvnsuqsbaedcrufzzfurcdeabsqusnvupjizvugguvziizvugguvzijpuvnsuqsbaedcrufzyvpyypvyzffzyvpyypvyzfurcdeabsqusnvupjizvugpvrrhatjvswwpxlbfybosojoojosobyfblxpwwsswwpxlbfybosojoojoso...

output:

9627264

result:

ok 1 number(s): "9627264"

Test #65:

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

input:

508 1968
majjvnozpjjpzonvjjamxunjjnuunjjnuxmaamxunjjnuunjjnuxmajjvnozpjjpzonvjjamxunjjnuxxunjjnuxmajjvnnvjjamxunjjnuxxunjjnuxmajjvnozpjqqumjjmuqqjpzonvjjamxunjjnuxxunjjnuxmajjvvjjamxunjjnuxxunjjnuxmajjvnozpjqqumjjmuqqjpzonvjjamxunjjnuxxunjjnuxmajjvnnvjjamxunjjnuxxunjjnuxmajjvnozpjjpzonvjjamxunjjnuun...

output:

37108016

result:

ok 1 number(s): "37108016"

Test #66:

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

input:

690 1449
tvvtvxzfrfiunqefvxcemxsxiwibboooobbiwixsxmecxvfeqnuifrfzxvtvbwbzhbohpymzulcnyubeeeeeeeebuyncluzmyphobhzbwbvtvxzfrfiunqefvxcemxsxiwibboobbiwixsxmecxvfeqnuifrfzxvvxzfrfiunqefvxcemxsxiwibboobbiwixsxmecxvfeqnuifrfzxvtvbwbzhbohpymzulcnyubeeeeeeeebuyncluzmyphobhzbwbvtvxzfrfiunqefvxcemxsxiwibboobb...

output:

46400

result:

ok 1 number(s): "46400"

Test #67:

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

input:

98 10204
xxxxxqelmwjwmuxfjqlldnvjwoyvfupxfpwtsouqusruokybnhttmohtkawsuwtwlteedfpkjybbkfevallavefkbbbbkfevallavefkbbyjkpfdeetlwtwuswakthomtthnbykoursuquostwpfxpufvyowjvndllqjfxumwjwmleqxxtjdqxyempinpicukyokrluxajmjiouflezpiqpnnlidcwugarlddmddmddlraguwcdilnnpqipzelfuoijmjaxulrkoykucipnipmeyxqdjtxxqelm...

output:

2270268

result:

ok 1 number(s): "2270268"

Test #68:

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

input:

54 18518
yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy...

output:

20914620796

result:

ok 1 number(s): "20914620796"

Test #69:

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

input:

455 2197
yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy...

output:

22712999400

result:

ok 1 number(s): "22712999400"

Test #70:

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

input:

253 3952
xooxmfboiswpldkmvpllpvmkdlpwsiobfmxozkfgvxpioarfokfgnhqugoqojjoqoguqhngfkofraoipxvgfkzoxmfboiswpldkmvpllpvmkdlpwsiobfmxxmfboiswpldkmvpllpvmkdlpwsiobfmxozkfgvxpioarfokfgnhqugoqojjoqoguqhngfkofraoipxvgffgvxpioarfokfgnhqugoqojjoqoguqhngfkofraoipxvgfkzoxmfboiswpldkmvpllpvmkdlpwsiobfmxxmfboiswpl...

output:

748440

result:

ok 1 number(s): "748440"

Test #71:

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

input:

130 7692
ooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo...

output:

5746339746

result:

ok 1 number(s): "5746339746"

Test #72:

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

input:

58 17241
epiipexemoketdqghntmpfhrwdqzzqdwwdqzzqdwrhfpmtnhgqdtekomexepicpleitncanhxcpamkevpnowyffzniblfecfbdiokteccgznklndcorvzdkptzqckizcyqxkureugimoiblmgdicgapkudtmeiiemtdukpagcidgmlbiomiguerukxqyczikcqztpkdzvrocdnlknzgccetkoidbfceflbinzffywonpvekmapcxhnacntielpcipexemoketdqghntmpfhrwdqzgqjlazdlyin...

output:

69440

result:

ok 1 number(s): "69440"

Test #73:

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

input:

474 2109
qqvubfjlnjkdbonzhhznobdkjnljfbuvqwetjhvymicnnnmmbulgsxxcouaplispcocemygcgtprxtbipihgghipibtxrptgcgymecocpsilpauocxxsglubmmnnmmbulgsxxcouaplispcocemygcgtprxtbipihgghipibtxrptgcgymecocpsilpauocxxsglubmmnnncimyvhjtewqvubfjlnjkdbonzhiucummucuihznnzznnzhiucummucuihznobdkjnljfbuvqwetjhvymicnnnmmb...

output:

191919

result:

ok 1 number(s): "191919"

Test #74:

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

input:

234 4273
ddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd...

output:

21481451706

result:

ok 1 number(s): "21481451706"

Test #75:

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

input:

417 2398
lllazojdiidjozalcclazojdilqjxnqrdxxdrqqrdxxdrqnxjqlidjozalcclazojjozalcclazojjozalcclazojdilqjxnqrdxxdrqqrdxxdrqnxjqlidjozalcclazojdilqjxnqrdxxdrqnxjqlidjozalczggzclazojdilqjxnqrddrqnxjqlidjozalczggzclazojdilqjxnqrdxxdrqnxjqlidjozalcclazojdillidjozalcclazojdilqjxnqrdxxdrqnxjqlidjozalczggzcl...

output:

3835172

result:

ok 1 number(s): "3835172"

Test #76:

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

input:

145 6896
aasxyjoswgiphwjkarwhckqdbsquqnnquqsbdqkchwrakjwhpigwsojyxsadrwixxucfdvwvcippicvwvvwvcippicvwvdfcuxxiwrdasxyjoswgiphwjkarwhckqdbsquqnnquqsbdqkchwrakjwhpigwsojyxsadrwixxucfdvwvcipontztvswtqmtupgykvmfctwiwwiwtcfmvkygputmqtwsvtztnopicvwvdfcuxxiwrrwixxucfdvwvcipontztvswtqmtupgykvmfctwiwwiwtcfmvk...

output:

690780

result:

ok 1 number(s): "690780"

Test #77:

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

input:

417 2398
mizrrzimuumizrmjnredsrlefrtcqiixxkhwrwsnireglznhjjhnzlgerinswrwhkxxiiqctrfelrsdernjmrzimuumizrmjnredsrlefrtcqiixxkhwwhkxxiiqctrfelrsdernjmrzimuumizrmjnredsrlefrtcqiixxkhwrwsnireglznhjxpqvddrvknbbbbnkvrddvqpxjhnzlgerinssnireglznhjxpqvddrvknbbbbnkvrddvqpxjhhjxpqvddrvknbbbbnkvrddvqpxjhnzlgerin...

output:

349503

result:

ok 1 number(s): "349503"

Test #78:

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

input:

223 4484
iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii...

output:

10963740387

result:

ok 1 number(s): "10963740387"

Test #79:

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

input:

609 1642
bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb...

output:

118885715760

result:

ok 1 number(s): "118885715760"

Test #80:

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

input:

125 8000
uuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu...

output:

14965572940

result:

ok 1 number(s): "14965572940"

Test #81:

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

input:

456 2192
ifjjfihintggtnihifjwzfqrntzzhnilpplinhzztnrqfzwjfihintgrkggkrgtnihifjwzfqrntzzhnilpplinhzztnrqfzwjfihintgrkgccgkrgtnihifjwzfqrntzzhnilpplinhzztnrqfzwjfihintgrkggkrgtnihifjwzfqrntzzhnilpplinhzztnrqfzwjfihintgrkgcpspthesuljgxyyxgjlusehtpspcgkrgtnihifjwzfqrntzzhnilpplinhzztnrqfzwjfihintgrkggkr...

output:

539595

result:

ok 1 number(s): "539595"

Test #82:

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

input:

79 12658
llprndccdnndccdnrpprndccdnndccdnrplekmwoahavrjtmkqzbbiddwjiwanyeiwbgkdspeayttuzhfejpughpkaiwfqqfwiakphgupjefhzuttyaepsdkgbwieynawijwddibbzqkmtjrvahaowmkelprndcxgkkdiewrdyqqhicbdqwpocdglufzfzqlqtxnccvektosznfnsghfbawqwwcqrxqrwsamunfjgwoicnoknojlmljlnnljlmllmljlnnljlmljonkonciowgjfnumaswrqxrq...

output:

175260

result:

ok 1 number(s): "175260"

Test #83:

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

input:

569 1757
fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff...

output:

33896890160

result:

ok 1 number(s): "33896890160"

Test #84:

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

input:

489 2044
wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww...

output:

30719849472

result:

ok 1 number(s): "30719849472"

Test #85:

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

input:

30 30
evoffoveooevoffoveoklvvlkklvvv
evoffoveooevoffoveoklvvlkklvvv
qharrahqaaqharrahqawxhhxwwxhhh
ribssbirbbribssbirbxyiiyxxyiii
jatkktajttjatkktajtpqaaqppqaaa
jatkktajttjatkktajtpqaaqppqaaa
ribssbirbbribssbirbxyiiyxxyiii
qharrahqaaqharrahqawxhhxwwxhhh
evoffoveooevoffoveoklvvlkklvvv
evoffoveooevoff...

output:

640

result:

ok 1 number(s): "640"

Test #86:

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

input:

1 5000
mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm...

output:

5672757

result:

ok 1 number(s): "5672757"