QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#236990#7512. Almost Prefix ConcatenationchroneZWA 286ms79832kbC++172.8kb2023-11-04 12:17:502023-11-04 12:17:50

Judging History

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

  • [2023-11-04 12:17:50]
  • 评测
  • 测评结果:WA
  • 用时:286ms
  • 内存:79832kb
  • [2023-11-04 12:17:50]
  • 提交

answer

#include <bits/stdc++.h>
using namespace std;
using i64 = unsigned long long;

inline int val(char ch) {return ch - 'a' + 1;}

constexpr int N = 1e6 + 10;
int r[N];
int f[N], g[N], w[N], sf[N], sg[N], sw[N];

static constexpr int mod = 998244353;
inline int add(int x, int y) {return (x + y >= mod ? x + y - mod : x + y);}
inline int dec(int x, int y) {return (x - y < 0 ? x - y + mod : x - y);}
inline void ad(int &x, int y) {x = add(x, y);}
inline void de(int &x, int y) {x = dec(x, y);}

constexpr i64 P = 1004535809, P2 = 1145141;
string s, t; i64 S[N], T[N], S2[N], T2[N], pr[N], pr2[N]; int n, m;

inline int lcp(int x, int y) {
	assert(x >= y);
	int l = 0, r = min(n - x + 1, m - y + 1), res = 0;
	while(l <= r) {
		int M = l + r >> 1; int f = 1;
		i64 B = mod + T[y + M - 1] - (y == 0 ? 0 : T[y - 1]); B %= mod;
		i64 A = mod + S[x + M - 1] - (x == 0 ? 0 : S[x - 1]); A %= mod;
		f &= B * pr[x - y] % mod == A;
		
		B = P + T2[y + M - 1] - (y == 0 ? 0 : T2[y - 1]); B %= P;
		A = P + S2[x + M - 1] - (x == 0 ? 0 : S2[x - 1]); A %= P;
		f &= B * pr2[x - y] % P == A;
		if(f) {
			res = M;
			l = M + 1;
		} else {
			r = M - 1;
		}
	}
	return res;
}

int main() {
	ios::sync_with_stdio(false); 
	cin.tie(nullptr); cout.tie(nullptr);
	
	cin >> s >> t; n = s.size(), m = t.size();
	pr[0] = 1;
	for(int i = 1; i <= n; i++) {
		pr[i] = pr[i - 1] * P2 % mod;
		pr2[i] = pr2[i - 1] * P2 % P;
	}
	S[0] = val(s[0]), T[0] = val(t[0]);
	for(int i = 1; i < n; i++) {
		S[i] = S[i - 1] + val(s[i]) * pr[i];
		S[i] %= mod;
		S2[i] = S2[i - 1] + val(s[i]) * pr2[i];
		S2[i] %= P;
	}
	for(int i = 1; i < m; i++) {
		T[i] = T[i - 1] + val(t[i]) * pr[i];
		T[i] %= mod;
		T2[i] = T2[i - 1] + val(t[i]) * pr2[i];
		T2[i] %= P;
	}

	for(int i = 0; i < n; i++) {
		int L = lcp(i, 0);
		r[i] = i + L - 1;
		if(r[i] == n - 1) {
			continue;
		}
		if(r[i] == n - 2) {
			r[i] = n - 1;
			continue;
		}
		r[i] = r[i] + 2 + lcp(r[i] + 2, L + 1) - 1;
	}
	for(int i = 0; i < n; i++) {
		r[i] = min(r[i], i + m - 1);
	}
	// for(int i = 0; i < n; i++) {
	// 	int dif = 0;
	// 	for(int j = i; j < n && j - i < t.size(); j++) {
	// 		dif += (s[j] != t[j - i]);
	// 		if(dif >= 2) {
	// 			break;
	// 		}
	// 		r[i] = j;
	// 	}
	// }
	w[n] = 1; sw[n] = 1;
	for(int i = n - 1; i >= 0; i--) {
		ad(f[i], dec(sf[i + 1], sf[r[i] + 2]));
		ad(f[i], 2ll * dec(sg[i + 1], sg[r[i] + 2]) % mod);
		ad(f[i], dec(sw[i + 1], sw[r[i] + 2]));

		ad(g[i], dec(sg[i + 1], sg[r[i] + 2]));
		ad(g[i], dec(sw[i + 1], sw[r[i] + 2]));

		ad(w[i], dec(sw[i + 1], sw[r[i] + 2]));

		sf[i] = add(sf[i + 1], f[i]);
		sg[i] = add(sg[i + 1], g[i]);
		sw[i] = add(sw[i + 1], w[i]);
	}
	cout << f[0] << "\n";
}
/*
Author: chroneZ
Start thinking at 
Start coding at 
Finish debugging at 
*/

詳細信息

Test #1:

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

input:

ababaab
aba

output:

473

result:

ok 1 number(s): "473"

Test #2:

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

input:

ac
ccpc

output:

5

result:

ok 1 number(s): "5"

Test #3:

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

input:

qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq...

output:

75038697

result:

ok 1 number(s): "75038697"

Test #4:

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

input:

lvvvllvllvllvllllllllvvvllvlllvvlvlvllvlvvlvvvvlvvllllllvvlvlvvlllvvlvlvllllllvlvvvvvvlllvvvllvlvvvlvvlllvvvvvvlvlllvvvvlvvvvvlvvlvvlllvvllvvllvlvlvlvlvllllvvllvvllvlllvvvllllvvlvvllvvvvlvlvvlvvlllvvvvvvvvlvvlvlllvllvvvvllvvvlvvvvvvlvlllvllllvllllllllvvllllllvlvvlvvvlvllllvllvlvvllllllvlvvvlvlvlvvvl...

output:

538419149

result:

ok 1 number(s): "538419149"

Test #5:

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

input:

fzztyyyfztzzfzyztftyfzyyzzzztyyfzttzttztyzztyyyfyyftyfyfzzffyzffytttzttyzzftyfyfyftyyfzyzffyfyyzztzyyttyfyztfyfzyfzfzyftttfyyfyytzyyzfyyyzztfttzyyytzzffytyzyyyyfzfftftzzztyfftfzfzytftfttytfyzfytzfzztttttzzyztyftzzzfzfzfffttyztzfftfftyfyffztzyffttyyfyfzytytyyttfzzfyyytzzftzyyfftftyytyffzffztfytfyyyty...

output:

867833603

result:

ok 1 number(s): "867833603"

Test #6:

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

input:

xauxlgtqbsianlzjzglalnbtlujfrkfdqgczpmididmtamzeablrbrbjgtsdkzzcfhvcpdawqkrgdsereirlxbizhbsxlcbtgwwshekbhatqonvgupswcowythifpoubxkuoxuuisnzolzwektdcaouxbkhofvdqzmjulmhgqjxwzhgrzmorhqkgekntbzsxgvjtehfbterrhhjhqggzrqiqmcshzwpfoburpyfoehqgtitesyaekhlzcvxzdqmunyrlrhbrjoigdjzpcgptyoiowwnmqrxucxixxydurbdh...

output:

301464023

result:

ok 1 number(s): "301464023"

Test #7:

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

input:

tttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttt...

output:

816920406

result:

ok 1 number(s): "816920406"

Test #8:

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

input:

cxccxccccxccxccxcxxxccxxcxcxcxcxxcccxcxccccccxccccxccxcxcxxcxxcxcxxxcxcccxcxxxxxccxxcccxxccxxxccxccxxxxcxxccccxccxxcccxcccxxxccccxcxcxccccxxxxccxxxxxcxxxxxxcxxccxxcxcxcxxxxxcxxccxcxxxcccxcxxxccccccccxxxcccxcxxcxxxxccxxxcccccxcccxccccccxxcccxxcccxxxccxxcxccxcccxxxccxccxxxccxcxxxxccxxcxcxxcxxccxxxcxcx...

output:

206627037

result:

ok 1 number(s): "206627037"

Test #9:

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

input:

vmqvvbbmvmmmqqvqvmmbbvqbqvbmmbqmvvbmmmqvqvbvqqmvbbmmvmvqbvmqqbqvqqvmvmmbqvvbvmvbqmqqbqqqbqqmvvmmbvvvbvvvbmqqvbqbmvvmvqqvbqbvvvqmvvvmvqqmvqbmbvmvmqmmbmqqqbbmvqbqbbqqbmmvmmqqqvvvqqqqqmmvvvvqmvmmmmvmqmqbbvbvvqmmmqbbmvqvmvmqbqbbbmqbqbqmqbqmqbmvvqmmvbmmbvbqqvmmmbbmbbmvmmvbmqmqbbqqbqqbbqmbmmmqbqbmvbmvmmmm...

output:

460659355

result:

ok 1 number(s): "460659355"

Test #10:

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

input:

xthikaxiescbqjzrpgtcpigqjsojlsxsiowkkzsdsgscoolhdtglvpgcoggzqnnjmocvanrogbzqjcmijoukjicadaakehxgjphjgnskjvfneoyaucfadilscsucjgweuzcdfapfnrfffdowxvzkvgqzmtszjldylvehzjlvmhproaehqhuwdoadenqdrqwrlxxfouzqolwbopmkpjshczocnnsxktxozahzwqpwbmvexguvjhbvbjwsdtgaitoqwsfzkwnzgeidkamgcfhzhitfxenunlcsbsesbczvmmbu...

output:

906223232

result:

ok 1 number(s): "906223232"

Test #11:

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

input:

bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb...

output:

39285513

result:

ok 1 number(s): "39285513"

Test #12:

score: 0
Accepted
time: 24ms
memory: 25648kb

input:

hghggghghhghhgghgggghhghhhgghggghghhhhghghgggghhggggghhgghggghhhghggghghghggghggghgghhhghgggghghghgggghhhhhgghhgghhhghhghhhghhhhhhghghhgggggghghgggghghhghhgghhghhhhhhghgghhghghgggghgggggghghhhhhghhhhhhhgghhggggghhgghhhhhhhhghggggggghhghhghhghhgghhghgghhhhgghghghhhhhghggghhhhhhhgggggghgghghhhhghhgggg...

output:

58618935

result:

ok 1 number(s): "58618935"

Test #13:

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

input:

nnttcybbmnrnsuybrkmkmtumcyuyrrmbtybutunsyrkmunmncmkuknttmmtkymtcybttrmyrtckscttcksbtymtyukbbynnnbukttncmbutscbrytbrutnuyuknmtymckkttrrnsbtrkbnnnkbrccrcyybmnnybbkkbcbbccycsrcytnuucbbyytckrycktsmkymruycksrscytkskscbtbccbrurmumrkbkbttkcynmymbbmbkrksmnusryumsmmyrcsmusumbrkkbmsbyytmmruubskccsusnntcuntrrt...

output:

46252951

result:

ok 1 number(s): "46252951"

Test #14:

score: 0
Accepted
time: 20ms
memory: 25688kb

input:

ittaztseqcdirziayobnnxuzipvteycmgjbupnlxuheulnmzsdeymctprlxvkvzjwrotsauxagyrqcwzuwqyodrqsupwpyrmbwjqlvfdsrocneigxvnjfiseotxmutzwacfutqlmzmxwuqgjugwkafnxvzutgbrweqrdshwneksgxzzinnmbbioqdvbmavukaegvkpwauuoysklelsqhytlikpdpymbwhmbdmrycaiywtwjjqtecwoofyjhbumjtipwyopkuralejvopitpjcdswcvsugimgbrlibrteaqtb...

output:

838361918

result:

ok 1 number(s): "838361918"

Test #15:

score: 0
Accepted
time: 187ms
memory: 79096kb

input:

llllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll...

output:

774442405

result:

ok 1 number(s): "774442405"

Test #16:

score: 0
Accepted
time: 272ms
memory: 78116kb

input:

nnnddndnndnddddndnnddnddnndddndndnnndnndndndnnnddndndnddnnddnndndndnnnndndddndnndndnndddndnnddnndndnnddnnddnddndddnnnndnnndddnndnddnnnddndddnndnnndndndndnddnddnndddndddnnndddnnndnndnndnnnddnnddnndnnndnnnddnnddddnndnnddnndnnnddddnddnnndnnddddddndndnnnnndnnnndddddnddnnndddndnnddndnnnddddnndndnndndndnd...

output:

478212008

result:

ok 1 number(s): "478212008"

Test #17:

score: 0
Accepted
time: 286ms
memory: 79808kb

input:

ievnetxypatirsocqrmgmhfxnkgzrscclietylohbcshjjxfmqhlxvebythkwllhjxwjngxbjeivttdgjttmyqgxsqotxueuvzrslcqpranaucprjmfczshtoqggczmbuwixllhnlcjhrvfixisvqdlxxmevucbvzolweshgvxeocppggthqkljyiszeqkpnybogisosqzdasfqgpuzudnnabwoqtrpxllqkxlbwsexwduvutufncthrmywlsqlccetggdflmgewzvhsmpyznzsxcftkoyfhgmgvliwxbywi...

output:

702291108

result:

ok 1 number(s): "702291108"

Test #18:

score: 0
Accepted
time: 162ms
memory: 79476kb

input:

aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa...

output:

301945039

result:

ok 1 number(s): "301945039"

Test #19:

score: 0
Accepted
time: 277ms
memory: 79456kb

input:

gggggcgcgggcgccgggcgcccgccccggcccgcggccccggcccccggccgccccccggcccgggcccgggggcccgggggcgggccgcccccccgcgcggggggggggcggggggcggccgcccggggccgccccgcgcgggcggggccgcgcggcggccgggccgccgcggcccgcccggcgccgccgggcgggggcggggccgccgcccccgccccccgggggcgcgcgccggccggcggcggggcgccggcgccccggccgggggccgccccccccgcggcgcggggggcgccc...

output:

602912498

result:

ok 1 number(s): "602912498"

Test #20:

score: 0
Accepted
time: 275ms
memory: 79572kb

input:

zdomsivxdzqlpexdauxxrjvembwqtchcxcpboqwmilagfpnrzyicztptfvdlqehajqoxcqvtoglsusgfioxtwheivlmgapepuoevghzmdadbkkkrdusnvxmansofunrgmppyktkxcottuiolirqlsflpnkghhxngutoovfzluiboooswqknpedyiaspikpveswjqnqitfbynjgiqymkrldekgmkavalduxlscjewmpoctbxjujtxlavpibkyerspcfchiticgjsvmzvtadhimnvacljbhmzikeabhjoszfig...

output:

435002470

result:

ok 1 number(s): "435002470"

Test #21:

score: 0
Accepted
time: 260ms
memory: 77588kb

input:

aabaabaaabaabaaabaabaabaaabaabaaabaabaabaaabaabaaabaabaaabaabaabaaabaabaaabaabaabaaabaabaaabaabaaabaabaabaaabaabaaabaabaabaaabaabaaabaabaabaaabaabaaabaabaaabaabaabaaabaabaaabaabaabaaabaabaaabaabaaabaabaabaaabaabaaabaabaabaaabaabaaabaabaabaaabaabaaabaabaaabaabaabaaabaabaaabaabaabaaabaabaaabaabaaabaab...

output:

571187577

result:

ok 1 number(s): "571187577"

Test #22:

score: 0
Accepted
time: 249ms
memory: 78424kb

input:

abacabaabacababacabaabacabacabaabacababacabaabacabaabacababacabaabacabacabaabacababacabaabacababacabaabacabacabaabacababacabaabacabaabacababacabaabacabacabaabacababacabaabacabacabaabacababacabaabacabaabacababacabaabacabacabaabacababacabaabacababacabaabacabacabaabacababacabaabacabaabacababacabaabacab...

output:

785945100

result:

ok 1 number(s): "785945100"

Test #23:

score: 0
Accepted
time: 269ms
memory: 79268kb

input:

abaababaabaababaababaabaababaabaababaababaabaababaababaabaababaabaababaababaabaababaabaababaababaabaababaababaabaababaabaababaababaabaababaababaabaababaabaababaababaabaababaabaababaababaabaababaababaabaababaabaababaababaabaababaabaababaababaabaababaababaabaababaabaababaababaabaababaababaabaababaabaa...

output:

501555951

result:

ok 1 number(s): "501555951"

Test #24:

score: 0
Accepted
time: 277ms
memory: 79040kb

input:

abbabaabbaababbabaababbaabbabaabbaababbaabbabaababbabaabbaababbabaababbaabbabaababbabaabbaababbaabbabaabbaababbabaababbaabbabaabbaababbaabbabaababbabaabbaababbaabbabaabbaababbabaababbaabbabaababbabaabbaababbabaababbaabbabaabbaababbaabbabaababbabaabbaababbabaababbaabbabaababbabaabbaababbaabbabaabbaab...

output:

483421416

result:

ok 1 number(s): "483421416"

Test #25:

score: 0
Accepted
time: 273ms
memory: 78872kb

input:

abbcbcabbcbcabbcabbcbcabbcbcabbcabbcbcabbcabbcbcabbcbcabbcabbcbcabbcbcabbcabbcbcabbcabbcbcabbcbcabbcabbcbcabbcabbcbcabbcbcabbcabbcbcabbcbcabbcabbcbcabbcabbcbcabbcbcabbcabbcbcabbcbcabbcabbcbcabbcabbcbcabbcbcabbcabbcbcabbcabbcbcabbcbcabbcabbcbcabbcbcabbcabbcbcabbcabbcbcabbcbcabbcabbcbcabbcabbcbcabbcbc...

output:

610522803

result:

ok 1 number(s): "610522803"

Test #26:

score: 0
Accepted
time: 283ms
memory: 79428kb

input:

bacaacabacaabacabacaabacaacabacaabacabacaacabacaabacaacabacaabacabacaabacaacabacaabacabacaacabacaabacaacabacaabacabacaacabacaabacabacaabacaacabacaabacabacaacabacaabacaacabacaabacabacaabacaacabacaabacabacaacabacaabacabacaabacaacabacaabacabacaacabacaabacaacabacaabacabacaacabacaabacabacaabacaacabacaaba...

output:

688840647

result:

ok 1 number(s): "688840647"

Test #27:

score: 0
Accepted
time: 275ms
memory: 78380kb

input:

abbababbabaababbababbabaabbababbabaababbababbabaababbabaabbababbabaababbababbabaababbababbabaabbababbabaababbababbabaababbabaabbababbabaababbababbabaabbababbabaababbababbabaababbababbabaabbababbabaababbababbabaababbabaabbababbabaababbababbabaabbababbabaababbababbabaababbabaabbababbabaababbababbabaab...

output:

185974021

result:

ok 1 number(s): "185974021"

Test #28:

score: 0
Accepted
time: 281ms
memory: 79196kb

input:

abacabadabacabaeabacabadabacabafabacabadabacabaeabacabadabacabagabacabadabacabaeabacabadabacabafabacabadabacabaeabacabadabacabahabacabadabacabaeabacabadabacabafabacabadabacabaeabacabadabacabagabacabadabacabaeabacabadabacabafabacabadabacabaeabacabadabacabaiabacabadabacabaeabacabadabacabafabacabadabac...

output:

881963869

result:

ok 1 number(s): "881963869"

Test #29:

score: 0
Accepted
time: 261ms
memory: 79312kb

input:

aabbaaccaabbaaddaabbaaccaabbaaeeaabbaaccaabbaaddaabbaaccaabbaaffaabbaaccaabbaaddaabbaaccaabbaaeeaabbaaccaabbaaddaabbaaccaabbaaggaabbaaccaabbaaddaabbaaccaabbaaeeaabbaaccaabbaaddaabbaaccaabbaaffaabbaaccaabbaaddaabbaaccaabbaaeeaabbaaccaabbaaddaabbaaccaabbaahhaabbaaccaabbaaddaabbaaccaabbaaeeaabbaaccaabb...

output:

647864259

result:

ok 1 number(s): "647864259"

Test #30:

score: 0
Accepted
time: 259ms
memory: 78064kb

input:

ddrddrdddrddrdddrddrddrdddrddrdddrddrddrdddrddrdddrddrdddrddrddrdddrddrdddrddrddrdddrddrdddrddrdddrddrddrdddrddrdddrddrddrdddrddrdddrddrddrdddrddrdddrddrdddrddrddrdddrddrdddrddrddrdddrddrdddrddrdddrddrddrdddrddrdddrddrddrdddrddrdddrddrddrdddrddrdddrddrdddrddrddrdddrddrdddrddrddrdddrddrdddrddrdddrddr...

output:

611194463

result:

ok 1 number(s): "611194463"

Test #31:

score: 0
Accepted
time: 253ms
memory: 79244kb

input:

hehfhehhehfhehehfhehhehfhehfhehhehfhehehfhehhehfhehhehfhehehfhehhehfhehfhehhehfhehehfhehhehfhehehfhehhehfhehfhehhehfhehehfhehhehfhehhehfhehehfhehhehfhehfhehhehfhehehfhehhehfhehfhehhehfhehehfhehhehfhehhehfhehehfhehhehfhehfhehhehfhehehfhehhehfhehehfhehhehfhehfhehhehfhehehfhehhehfhehhehfhehehfhehhehfhe...

output:

350121745

result:

ok 1 number(s): "350121745"

Test #32:

score: 0
Accepted
time: 268ms
memory: 78684kb

input:

nmnnmnmnnmnnmnmnnmnmnnmnnmnmnnmnnmnmnnmnmnnmnnmnmnnmnmnnmnnmnmnnmnnmnmnnmnmnnmnnmnmnnmnnmnmnnmnmnnmnnmnmnnmnmnnmnnmnmnnmnnmnmnnmnmnnmnnmnmnnmnmnnmnnmnmnnmnnmnmnnmnmnnmnnmnmnnmnnmnmnnmnmnnmnnmnmnnmnmnnmnnmnmnnmnnmnmnnmnmnnmnnmnmnnmnnmnmnnmnmnnmnnmnmnnmnmnnmnnmnmnnmnnmnmnnmnmnnmnnmnmnnmnmnnmnnmnmnnmnn...

output:

533553735

result:

ok 1 number(s): "533553735"

Test #33:

score: 0
Accepted
time: 253ms
memory: 78108kb

input:

joojojjoojjojoojojjojoojjoojojjoojjojoojjoojojjojoojojjoojjojoojojjojoojjoojojjojoojojjoojjojoojjoojojjoojjojoojojjojoojjoojojjoojjojoojjoojojjojoojojjoojjojoojjoojojjoojjojoojojjojoojjoojojjojoojojjoojjojoojojjojoojjoojojjoojjojoojjoojojjojoojojjoojjojoojojjojoojjoojojjojoojojjoojjojoojjoojojjoojjo...

output:

177198028

result:

ok 1 number(s): "177198028"

Test #34:

score: 0
Accepted
time: 264ms
memory: 79388kb

input:

qddhdhqddhdhqddhqddhdhqddhdhqddhqddhdhqddhqddhdhqddhdhqddhqddhdhqddhdhqddhqddhdhqddhqddhdhqddhdhqddhqddhdhqddhqddhdhqddhdhqddhqddhdhqddhdhqddhqddhdhqddhqddhdhqddhdhqddhqddhdhqddhdhqddhqddhdhqddhqddhdhqddhdhqddhqddhdhqddhqddhdhqddhdhqddhqddhdhqddhdhqddhqddhdhqddhqddhdhqddhdhqddhqddhdhqddhqddhdhqddhdh...

output:

101237979

result:

ok 1 number(s): "101237979"

Test #35:

score: 0
Accepted
time: 268ms
memory: 79152kb

input:

dqvqqvqdqvqqdqvqdqvqqdqvqqvqdqvqqdqvqdqvqqvqdqvqqdqvqqvqdqvqqdqvqdqvqqdqvqqvqdqvqqdqvqdqvqqvqdqvqqdqvqqvqdqvqqdqvqdqvqqvqdqvqqdqvqdqvqqdqvqqvqdqvqqdqvqdqvqqvqdqvqqdqvqqvqdqvqqdqvqdqvqqdqvqqvqdqvqqdqvqdqvqqvqdqvqqdqvqdqvqqdqvqqvqdqvqqdqvqdqvqqvqdqvqqdqvqqvqdqvqqdqvqdqvqqvqdqvqqdqvqdqvqqdqvqqvqdqvqqdq...

output:

292588879

result:

ok 1 number(s): "292588879"

Test #36:

score: 0
Accepted
time: 255ms
memory: 78412kb

input:

axxaxaxxaxaaxaxxaxaxxaxaaxxaxaxxaxaaxaxxaxaxxaxaaxaxxaxaaxxaxaxxaxaaxaxxaxaxxaxaaxaxxaxaxxaxaaxxaxaxxaxaaxaxxaxaxxaxaaxaxxaxaaxxaxaxxaxaaxaxxaxaxxaxaaxxaxaxxaxaaxaxxaxaxxaxaaxaxxaxaxxaxaaxxaxaxxaxaaxaxxaxaxxaxaaxaxxaxaaxxaxaxxaxaaxaxxaxaxxaxaaxxaxaxxaxaaxaxxaxaxxaxaaxaxxaxaaxxaxaxxaxaaxaxxaxaxxaxaax...

output:

663737748

result:

ok 1 number(s): "663737748"

Test #37:

score: 0
Accepted
time: 240ms
memory: 78320kb

input:

pgpepgpwpgpepgpopgpepgpwpgpepgptpgpepgpwpgpepgpopgpepgpwpgpepgpdpgpepgpwpgpepgpopgpepgpwpgpepgptpgpepgpwpgpepgpopgpepgpwpgpepgphpgpepgpwpgpepgpopgpepgpwpgpepgptpgpepgpwpgpepgpopgpepgpwpgpepgpdpgpepgpwpgpepgpopgpepgpwpgpepgptpgpepgpwpgpepgpopgpepgpwpgpepgpypgpepgpwpgpepgpopgpepgpwpgpepgptpgpepgpwpgpe...

output:

488572018

result:

ok 1 number(s): "488572018"

Test #38:

score: 0
Accepted
time: 261ms
memory: 78876kb

input:

rrwwrraarrwwrrssrrwwrraarrwwrrjjrrwwrraarrwwrrssrrwwrraarrwwrriirrwwrraarrwwrrssrrwwrraarrwwrrjjrrwwrraarrwwrrssrrwwrraarrwwrrggrrwwrraarrwwrrssrrwwrraarrwwrrjjrrwwrraarrwwrrssrrwwrraarrwwrriirrwwrraarrwwrrssrrwwrraarrwwrrjjrrwwrraarrwwrrssrrwwrraarrwwrrddrrwwrraarrwwrrssrrwwrraarrwwrrjjrrwwrraarrww...

output:

686260254

result:

ok 1 number(s): "686260254"

Test #39:

score: 0
Accepted
time: 261ms
memory: 77584kb

input:

jmgfgawmrduominxypmrqdincccsmkfkkoqrzzmpnfnbtyxetgmfvyjugkvjvlfkjikyakiwuwjepviiwfgbenzycnqndaukmyknehgmlizltmebgvgmoebwijqvtwngbmojualcabcbafifsbmbtidqsjhxwyqautkjqztkhmusuixxanobxuaqlrmtmkprqpofxtkqviqqjgqcwrkbgdomrdtvjrjduuocsaxftjjulzpexmeigvmoxksccoepcjqdtcbbthjgdnsmnwklfrvlhazvcrbmkegnmmvdpcap...

output:

293683143

result:

ok 1 number(s): "293683143"

Test #40:

score: 0
Accepted
time: 271ms
memory: 78852kb

input:

dfddeeadfbgfcadcbbaaefgcchdhfcbagaedgdhafdhbffggfechccdhadbcchgeaeagfaaagfbeabffdaeefaaabbggffghbgfhbcahhdfdgccgegdgdhafhcdgbebcbbggegcachhefhcgfgcaececacagedaacfbcdgecghfedffchhaeabfbeehfeeddfecfefahbfaghbhbhdgddfgcdbfbeaahbcdhfdbeebhfbehggcfbabbfchggchhahehgfgbhaeebafbdacccffdfgfbhecebgfeeebdacaaa...

output:

896912463

result:

ok 1 number(s): "896912463"

Test #41:

score: 0
Accepted
time: 264ms
memory: 78152kb

input:

djkdjdlkbamfcmacgaekgbgmimadajicdbgmiejaacggablfgejfgmafmhbcifaehamkadfcglbmhhblgalklhglicmhakfjaafidjmihmghgbhdhjfdllmaekkeklccadieaibeiddjefjleaiegkllmeglgedeleabgghdaidgehdacemkbaddalkamgiffgdcbhhckhmacimaeamehiigfggmglccidaffjcjijafmbehlgglcmacifjgmdfcdahfljdhfjkijcdebkkhgbdlijcabjbgefchjdbfigbi...

output:

866183470

result:

ok 1 number(s): "866183470"

Test #42:

score: 0
Accepted
time: 261ms
memory: 78292kb

input:

akejekgcbkkajhbmklibdmdfmllhgheagfjjbbifdjeglcmmbhmglebljhfmdidckdjebldeffdelakbfckhdmlmickdfedimjjmjdhlmikgabblgifdcbacgkchmfkhflgggakalkihlllakglmaeldhjljfhegalcmgkhleahciagicfljkkkdajbdkhelfmlmcgmdegkaekdmckbfhgjdmhgbkihahbgmgbiadkidijecgdambchefefjklfhdhjamhkeefedffjlckfhjdfkimelbfjliamccfkaljck...

output:

490416632

result:

ok 1 number(s): "490416632"

Test #43:

score: 0
Accepted
time: 281ms
memory: 79832kb

input:

dccfccebfcbbabcddeecfeaecfdbbbdfadcdafbfbbeeefgceegabdbbdeacbafdbdgaegadfddeaegcbcgcdggeefffecfaadabdbeaeebfbagdggfbbfeddgedcfgfafecedgffadeagggeababdfdbcbdeafabdggaccaaacedccegccaadebdebdfabaffcbdcbcfcdgabcabdcebfcbgecgdddcedaaeeefgfbgbdbbfeffadbecddffedddffadbeeaegaacegegcagefcffababbdaafdfgegfdbb...

output:

885724660

result:

ok 1 number(s): "885724660"

Test #44:

score: 0
Accepted
time: 284ms
memory: 79220kb

input:

aehhddeelhbahadgalifaklhccaefgcbhglheiaeahgffkblkafhcfdebggdkdhdjgkjaekhflfehlkdcbejagigdlcabkblijfecgdbikehhekhihehhebalgjfjcehkdajcakehbiedbcjdfhacdhcckhdjbfjdllaajdckhjaglbdaalbihbjlheklkiaabkfjbhchjlkealbdlgkdahihgigcfdjflfdhejbedgajbfbhlkhgcglkdhclcelgkldegkgfekajdljfiaagbkkdbfdafdkcfgjhlfjdidd...

output:

421010120

result:

ok 1 number(s): "421010120"

Test #45:

score: 0
Accepted
time: 270ms
memory: 78556kb

input:

ikiajgmoobiibgmncbfmmabkagcegdloelekkeaebjcemcklemhiiomiabiihmccignhfifmdccmgdljhdlglbamfaafgddehngkimkflcdijdclhjookhnkdjkooalhchiikgjcemmigkhbkoafnglokmdkmcmmdgdfngcgfcglbkifnhaflfgdmdchdbaofhnhiadfoocoljghnbdfcohgeimonabgbjiekfdogkbdlfaiomkclaklnbeolnfhamekgdkmbfmjfofkkkoknlifehgaeimbaaahfdhekkbb...

output:

249065158

result:

ok 1 number(s): "249065158"

Test #46:

score: 0
Accepted
time: 271ms
memory: 79112kb

input:

bbidjtskemfoqflkgitiksamhiskmkdbieeethgsisgruqdjrbepunqfrorcmgaomlrntjjcrgobhmkjsfjqbschsfamsjsgcqishmaanbkhaechktgejonmnoltjgsunjpjicuplglpsgeiqtfrpbrmrbajenmeceikhgndkigrbubjdnlmpikpnpcsprmefffpmmmrcbmhghpjaanksmldikhobiajjpgfbnjnqgibdelmhhtqeshlmhsbunjcahmnjgpfphhcrfkinleassgogqjlecefedhfsicioksi...

output:

696887551

result:

ok 1 number(s): "696887551"

Test #47:

score: 0
Accepted
time: 271ms
memory: 79044kb

input:

amdhpchjhekifhphbcmhhhdiomjnbogojfqaknelnpjqlioflclmobhpofqfafnnogjblabnnignbclfcmhgooaeiohadbeihmbpgollbkaiipaaoophogjmodiqmjagjoqlnbkagfgpfiedbijagqhmfbigekqppielgcdfkennghqelpmelfepfgelqehnogggaobqclnamimfcooikpcliiglolhjcnoekqqfkhbnjafdfipjdlphcpidlbchdapjblaebchmamlhgllbipgqhlbhpfcnnjodgjdfcqmp...

output:

243281615

result:

ok 1 number(s): "243281615"

Test #48:

score: 0
Accepted
time: 250ms
memory: 77812kb

input:

dbeafaheacadbefjhabeegbaicejbbdgjbeghjbhdhddachigjffakkdkeahciadejkfkfaccdgjkfkdkkgcbggibagikedhejecahhchhkcebbidihjbkjegaakikdfihfhebbccfikhacdedaiaffhfkecagbcbjgbbffafdacfeeibdjhjjddjhkdkihhdhgijdjfdcjagjfafdahfjgkkjachjcdicaieeafhdfjfhchahiidhhfkaghbegbgcfefkijhdebejjjidcadkchgigdeiecfjhfjkefiekk...

output:

678667698

result:

ok 1 number(s): "678667698"

Test #49:

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

input:

deoojpgcgpkoholhlcfddeohkqoihkcalfngpkcabbkimgpkccaqapjcciehchiqbjqjpkbenflbbmqlgogkkqlaoaenoahilflhjrkibcjpndignjkjdilkfjcgonlhfhqokdkqfcooddnqraffljggmefpjaqgdqbhgfkpcionmhnkieocrokobhgnpkkqamjdalqjnefhofndmgialqhmfjnkjnqhmcjnddbkmdnbfokfmbihnnobcakhjmnfmrfganfhicdlmlgqfdqrcnidldqpkpniojdkabeorrci...

output:

640377934

result:

ok 1 number(s): "640377934"

Test #50:

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

input:

rcplswkqluujkpofiplijbkfamjnpmwbetfaolnjlwjeklpmqnuduqdlbvohfebccbdgsmlumlsbmepaqcsdhsdiqmcgmrtmkneoqitmiiamfkcakoqivniqkarnptorecjpnhjrilbhqlqsiiqcaoequooccldcicgjgvesjkothbqrkmwqjmgpiviesqdsbvcvwbkewqkdjathbpodcwbcaapijiwmdalphlerftsvpctpgilajbthfclwhnpaqrmpulnkouchahefqhuodqudvvlkhuqjbfirnbomnblm...

output:

66403201

result:

ok 1 number(s): "66403201"

Test #51:

score: 0
Accepted
time: 286ms
memory: 79644kb

input:

kcelopohpkauakpqbkkffonjqopuccmehqsssbscqgkmbkmrhccdriukchfjhooedrpidupnhrruqjhlcolrtsjehqqtpknjqsgklfjpirsnqfjlhscetstgrlilmdicgaafhasapptemkeaonlohgrtnoqtaghbbmaskprseerhsdrsacrscpgkbrlqeesgdhabhklbapimgnbidlskjhacqbfgbbgjhbqqjmksatqqcrfpqplttotunndmlmcifiqkdfkbeoofkueargstanfpoqjcgipqbhqsisqqupua...

output:

674574764

result:

ok 1 number(s): "674574764"

Test #52:

score: 0
Accepted
time: 274ms
memory: 78928kb

input:

lokefigibdllifnkjkhnimgelligecajbonifkiahfaglcabobfnjiaffhkjebdcmflhimlfdofookcmmoaehhhjiiolglcdemjlmiimjelihecabcecbehmlefaackglgkelkihnlbgnhhodeeejnokhknomgibjjiglacgkanjmeiejagggbledmhgaaekimngheheihggogbjfldlbfoelngooilkenmkmlbliejdfhgalhbfihkicbnckjlfnfmcfcgojmcnnifkhfafmhohohkfchibbbmmbhhanhbc...

output:

102969525

result:

ok 1 number(s): "102969525"

Test #53:

score: 0
Accepted
time: 261ms
memory: 78536kb

input:

jhuuccdtstliggpntpafkqniscpsoprtdoekmrrdilfcgfjmjmmdtfblsabqnubkufsmscrbosqpsbidqfjtgaaaiafmkjqjkhqaqrtooaujonhdjebsfakbhqnitrgjlgaiknktoktjsdiktcotccnrpefcbnqnhmlapoiamukspsufbumacjikgpehhhbnkirtnmtamckhfhcuhbflosfhhlqipupjkhcdbgakqpcjrpfmlmtkrtibuhrndkrurjgpqlglsggtetiathbtnckdqgofakuiumsfqmchppao...

output:

305160976

result:

ok 1 number(s): "305160976"

Test #54:

score: 0
Accepted
time: 261ms
memory: 77848kb

input:

pghtgnactijlrpguqmmclmonmvptpqlcrnuktgdvephiiklfdrrtrhnejnqceimfjuinqeuhhqkauvktipashuvjthvcgdlqsorggmrlemsncuqbjmjkahmhmhhjbjsgbbhsrpttdkhfcbdjemovvbmeaifrneritlqvurjdjmjjvppitgckjmdtldoimosvrdlqqqvnsurlilhecbsdnvncsdqbvddodohpofabdpcekvokkgtbppoapfliiriaouldpbrsfhnagsjojejcuithqsjoelpqsjnaurulpsar...

output:

564861703

result:

ok 1 number(s): "564861703"

Test #55:

score: 0
Accepted
time: 267ms
memory: 78928kb

input:

oihhieeoadhlkggfalmodcmedfmdbfedcflnlbfjjcbgccifnmieinnbkcfjegkdmcaoenbjhgihdgodoamklmklhgcoiemjahgnmaamdkjnafmdegfdhaefggjbonegcmmkldjlhgdofhfbaloiljelongglooakkccbgholfbooobjfocekldinlokadkdonkibanjomeonialbhhokaniadhijldmnilcmebabohaeeicimjemlajcbkojoonenhlabobhfajenedjdoniejlkincbdjifbajkcakgmnl...

output:

487389185

result:

ok 1 number(s): "487389185"

Test #56:

score: 0
Accepted
time: 261ms
memory: 77848kb

input:

mbecsnmaqpqeehmgmfdoaobhqkpmgqariegclsokjnosbbbgdgggcelaamnjoqbqglbsqhafppihnocmalqanasodafckknjpajdabinmgicqionaffaajppfdfibanfjhdforpikceonnaciharfmmsnesknfchhnorkkminlmhkcsijaescaqjbckgicsffecdchbdieomkbsqalncjllhpiphmprsehrlqfjaedbbojqblaaprsoldfjqqckesbomjdgqokdmrpoffhjfbeckkcofmcphbmqeokflmjrq...

output:

429687603

result:

ok 1 number(s): "429687603"

Test #57:

score: 0
Accepted
time: 264ms
memory: 79224kb

input:

aabaabaaabaabaaabaabaabaaabaabaaabaabaabaaabaabaaabaabaaabaabaabaaabaabaaabaabaabaaabaabaaabaabaaabaabaabaaabaabaaabaabaabaaabaabaaabaabaabaaabaabaaabaabaaabaabaabaaabaabaaabaabaabaaabaabaaabaabaaabaabaabaaabaabaaabaabaabaaabaabaaabaabaabaaabaabaaabaabaaabaabaabaaabaabaaabaabaabaaabaabaaabaabaaabaab...

output:

394014419

result:

ok 1 number(s): "394014419"

Test #58:

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

input:

abacabaabacababacabaabacabacabaabacababacabaabacabaabacababacabaabacabacabaabacababacabaabacababacabaabacabacabaabacababacabaabacabaabacababacabaabacabacabaabacababacabaabacabacabaabacababacabaabacabaabacababacabaabacabacabaabacababacabaabacababacabaabacabacabaabacababacabaabacabaabacababacabaabacab...

output:

142112521

result:

ok 1 number(s): "142112521"

Test #59:

score: 0
Accepted
time: 274ms
memory: 78356kb

input:

abaababaabaababaababaabaababaabaababaababaabaababaababaabaababaabaababaababaabaababaabaababaababaabaababaababaabaababaabaababaababaabaababaababaabaababaabaababaababaabaababaabaababaababaabaababaababaabaababaabaababaababaabaababaabaababaababaabaababaababaabaababaabaababaababaabaababaababaabaababaabaa...

output:

610603128

result:

ok 1 number(s): "610603128"

Test #60:

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

input:

abbabaabbaababbabaababbaabbabaabbaababbaabbabaababbabaabbaababbabaababbaabbabaababbabaabbaababbaabbabaabbaababbabaababbaabbabaabbaababbaabbabaababbabaabbaababbaabbabaabbaababbabaababbaabbabaababbabaabbaababbabaababbaabbabaabbaababbaabbabaababbabaabbaababbabaababbaabbabaababbabaabbaababbaabbabaabbaab...

output:

918562310

result:

ok 1 number(s): "918562310"

Test #61:

score: 0
Accepted
time: 270ms
memory: 79608kb

input:

abbcbcabbcbcabbcabbcbcabbcbcabbcabbcbcabbcabbcbcabbcbcabbcabbcbcabbcbcabbcabbcbcabbcabbcbcabbcbcabbcabbcbcabbcabbcbcabbcbcabbcabbcbcabbcbcabbcabbcbcabbcabbcbcabbcbcabbcabbcbcabbcbcabbcabbcbcabbcabbcbcabbcbcabbcabbcbcabbcabbcbcabbcbcabbcabbcbcabbcbcabbcabbcbcabbcabbcbcabbcbcabbcabbcbcabbcabbcbcabbcbc...

output:

130166950

result:

ok 1 number(s): "130166950"

Test #62:

score: 0
Accepted
time: 270ms
memory: 79376kb

input:

bacaacabacaabacabacaabacaacabacaabacabacaacabacaabacaacabacaabacabacaabacaacabacaabacabacaacabacaabacaacabacaabacabacaacabacaabacabacaabacaacabacaabacabacaacabacaabacaacabacaabacabacaabacaacabacaabacabacaacabacaabacabacaabacaacabacaabacabacaacabacaabacaacabacaabacabacaacabacaabacabacaabacaacabacaaba...

output:

49748557

result:

ok 1 number(s): "49748557"

Test #63:

score: 0
Accepted
time: 272ms
memory: 79156kb

input:

abbababbabaababbababbabaabbababbabaababbababbabaababbabaabbababbabaababbababbabaababbababbabaabbababbabaababbababbabaababbabaabbababbabaababbababbabaabbababbabaababbababbabaababbababbabaabbababbabaababbababbabaababbabaabbababbabaababbababbabaabbababbabaababbababbabaababbabaabbababbabaababbababbabaab...

output:

402359251

result:

ok 1 number(s): "402359251"

Test #64:

score: 0
Accepted
time: 283ms
memory: 79168kb

input:

abacabadabacabaeabacabadabacabafabacabadabacabaeabacabadabacabagabacabadabacabaeabacabadabacabafabacabadabacabaeabacabadabacabahabacabadabacabaeabacabadabacabafabacabadabacabaeabacabadabacabagabacabadabacabaeabacabadabacabafabacabadabacabaeabacabadabacabaiabacabadabacabaeabacabadabacabafabacabadabac...

output:

606717779

result:

ok 1 number(s): "606717779"

Test #65:

score: 0
Accepted
time: 284ms
memory: 78960kb

input:

aabbaaccaabbaaddaabbaaccaabbaaeeaabbaaccaabbaaddaabbaaccaabbaaffaabbaaccaabbaaddaabbaaccaabbaaeeaabbaaccaabbaaddaabbaaccaabbaaggaabbaaccaabbaaddaabbaaccaabbaaeeaabbaaccaabbaaddaabbaaccaabbaaffaabbaaccaabbaaddaabbaaccaabbaaeeaabbaaccaabbaaddaabbaaccaabbaahhaabbaaccaabbaaddaabbaaccaabbaaeeaabbaaccaabb...

output:

369483026

result:

ok 1 number(s): "369483026"

Test #66:

score: 0
Accepted
time: 263ms
memory: 78592kb

input:

zztzztzzztzztzzztzztzztzzztzztzzztzztzztzzztzztzzztzztzzztzztzztzzztzztzzztzztzztzzztzztzzztzztzzztzztzztzzztzztzzztzztzztzzztzztzzztzztzztzzztzztzzztzztzzztzztzztzzztzztzzztzztzztzzztzztzzztzztzzztzztzztzzztzztzzztzztzztzzztzztzzztzztzztzzztzztzzztzztzzztzztzztzzztzztzzztzztzztzzztzztzzztzztzzztzzt...

output:

992544336

result:

ok 1 number(s): "992544336"

Test #67:

score: 0
Accepted
time: 257ms
memory: 77560kb

input:

wlwdwlwwlwdwlwlwdwlwwlwdwlwdwlwwlwdwlwlwdwlwwlwdwlwwlwdwlwlwdwlwwlwdwlwdwlwwlwdwlwlwdwlwwlwdwlwlwdwlwwlwdwlwdwlwwlwdwlwlwdwlwwlwdwlwwlwdwlwlwdwlwwlwdwlwdwlwwlwdwlwlwdwlwwlwdwlwdwlwwlwdwlwlwdwlwwlwdwlwwlwdwlwlwdwlwwlwdwlwdwlwwlwdwlwlwdwlwwlwdwlwlwdwlwwlwdwlwdwlwwlwdwlwlwdwlwwlwdwlwwlwdwlwlwdwlwwlwdwl...

output:

563930358

result:

ok 1 number(s): "563930358"

Test #68:

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

input:

edeededeedeededeededeedeededeedeededeededeedeededeededeedeededeedeededeededeedeededeedeededeededeedeededeededeedeededeedeededeededeedeededeededeedeededeedeededeededeedeededeedeededeededeedeededeededeedeededeedeededeededeedeededeedeededeededeedeededeededeedeededeedeededeededeedeededeededeedeededeedee...

output:

819287506

result:

ok 1 number(s): "819287506"

Test #69:

score: 0
Accepted
time: 274ms
memory: 78744kb

input:

ikkikiikkiikikkikiikikkiikkikiikkiikikkiikkikiikikkikiikkiikikkikiikikkiikkikiikikkikiikkiikikkiikkikiikkiikikkikiikikkiikkikiikkiikikkiikkikiikikkikiikkiikikkiikkikiikkiikikkikiikikkiikkikiikikkikiikkiikikkikiikikkiikkikiikkiikikkiikkikiikikkikiikkiikikkikiikikkiikkikiikikkikiikkiikikkiikkikiikkiik...

output:

42989448

result:

ok 1 number(s): "42989448"

Test #70:

score: 0
Accepted
time: 279ms
memory: 79384kb

input:

jrrvrvjrrvrvjrrvjrrvrvjrrvrvjrrvjrrvrvjrrvjrrvrvjrrvrvjrrvjrrvrvjrrvrvjrrvjrrvrvjrrvjrrvrvjrrvrvjrrvjrrvrvjrrvjrrvrvjrrvrvjrrvjrrvrvjrrvrvjrrvjrrvrvjrrvjrrvrvjrrvrvjrrvjrrvrvjrrvrvjrrvjrrvrvjrrvjrrvrvjrrvrvjrrvjrrvrvjrrvjrrvrvjrrvrvjrrvjrrvrvjrrvrvjrrvjrrvrvjrrvjrrvrvjrrvrvjrrvjrrvrvjrrvjrrvrvjrrvrv...

output:

511801172

result:

ok 1 number(s): "511801172"

Test #71:

score: 0
Accepted
time: 258ms
memory: 77736kb

input:

fmqmmqmfmqmmfmqmfmqmmfmqmmqmfmqmmfmqmfmqmmqmfmqmmfmqmmqmfmqmmfmqmfmqmmfmqmmqmfmqmmfmqmfmqmmqmfmqmmfmqmmqmfmqmmfmqmfmqmmqmfmqmmfmqmfmqmmfmqmmqmfmqmmfmqmfmqmmqmfmqmmfmqmmqmfmqmmfmqmfmqmmfmqmmqmfmqmmfmqmfmqmmqmfmqmmfmqmfmqmmfmqmmqmfmqmmfmqmfmqmmqmfmqmmfmqmmqmfmqmmfmqmfmqmmqmfmqmmfmqmfmqmmfmqmmqmfmqmmfm...

output:

857036567

result:

ok 1 number(s): "857036567"

Test #72:

score: 0
Accepted
time: 266ms
memory: 79152kb

input:

zllzlzllzlzzlzllzlzllzlzzllzlzllzlzzlzllzlzllzlzzlzllzlzzllzlzllzlzzlzllzlzllzlzzlzllzlzllzlzzllzlzllzlzzlzllzlzllzlzzlzllzlzzllzlzllzlzzlzllzlzllzlzzllzlzllzlzzlzllzlzllzlzzlzllzlzllzlzzllzlzllzlzzlzllzlzllzlzzlzllzlzzllzlzllzlzzlzllzlzllzlzzllzlzllzlzzlzllzlzllzlzzlzllzlzzllzlzllzlzzlzllzlzllzlzzl...

output:

230615864

result:

ok 1 number(s): "230615864"

Test #73:

score: 0
Accepted
time: 280ms
memory: 78596kb

input:

ifinifiqifinificifinifiqifinifioifinifiqifinificifinifiqifinifijifinifiqifinificifinifiqifinifioifinifiqifinificifinifiqifinifivifinifiqifinificifinifiqifinifioifinifiqifinificifinifiqifinifijifinifiqifinificifinifiqifinifioifinifiqifinificifinifiqifinifiuifinifiqifinificifinifiqifinifioifinifiqifin...

output:

51302050

result:

ok 1 number(s): "51302050"

Test #74:

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

input:

vvxxvvssvvxxvveevvxxvvssvvxxvvllvvxxvvssvvxxvveevvxxvvssvvxxvvmmvvxxvvssvvxxvveevvxxvvssvvxxvvllvvxxvvssvvxxvveevvxxvvssvvxxvvffvvxxvvssvvxxvveevvxxvvssvvxxvvllvvxxvvssvvxxvveevvxxvvssvvxxvvmmvvxxvvssvvxxvveevvxxvvssvvxxvvllvvxxvvssvvxxvveevvxxvvssvvxxvvjjvvxxvvssvvxxvveevvxxvvssvvxxvvllvvxxvvssvvxx...

output:

634001192

result:

ok 1 number(s): "634001192"

Test #75:

score: 0
Accepted
time: 181ms
memory: 64616kb

input:

abbabaabbaababbabaababbaabbabaabbaababbaabbabaababbabaabbaababbabaababbaabbabaababbabaabbaababbaabbabaabbaababbabaababbaabbabaabbaababbaabbabaababbabaabbaababbaabbabaabbaababbabaababbaabbabaababbabaabbaababbabaababbaabbabaabbaababbaabbabaababbabaabbaababbabaababbaabbabaababbabaabbaababbaabbabaabbaab...

output:

327030361

result:

ok 1 number(s): "327030361"

Test #76:

score: 0
Accepted
time: 251ms
memory: 72432kb

input:

cqccqcqccqccqcqccqcqccqccqcqccqccqcqccqcqccqccqcqccqcqccqccqcqccqccqcqccqcqccqccqcqccqccqcqccqcqccqccqcqccqcqccqccqcqccqccqcqccqcqccqccqcqccqcqccqccqcqccqccqcqccqcqccqccqcqccqccqcqccqcqccqccqcqccqcqccqccqcqccqccqcqccqcqccqccqcqccqccqcqccqcqccqccqcqccqcqccqccqcqccqccqcqccqcqccqccqcqccqcqccqccqcqccqcc...

output:

599913991

result:

ok 1 number(s): "599913991"

Test #77:

score: 0
Accepted
time: 114ms
memory: 48532kb

input:

ekbtexackowxdkmbpffebstnkjwoewmrgxdbwcrarbjbgesfpmfdjcedhyrwgpjnefhemdojwiajfkxcnfpwjiwsasqpupokeyhxwanhugsvcdptihwjmqmdcblintuixjxyryrttgdblrknpfvrnsqroiamiqccddaadywptfylpmjwpyhkvseovifclpljiltbgmwnlxcjdrbjkcsenevntkpwilcjbksftujbwibjgkgcvodpeaslqjfaguxhumjixwlvlrlelusixwxccsmumfvngxuhfrlrwkhdymwl...

output:

724817065

result:

ok 1 number(s): "724817065"

Test #78:

score: 0
Accepted
time: 257ms
memory: 76180kb

input:

lkchjaaggjefgljejihfeacbaikhflajdaaafflaedlikafijekegfikdjjjgbcedggckifejeigficlbljhhlhlabfalhhfgcklejcllghdkcehhihgihajlkfdjglahglbegeiakacfdkbkaebaddhegjedfbialbkkbfeciablgjdjlifhcdcldbkjfcbhejfifjhldkdlhjfjiaakajjakbbiijiklbgegjaibcaccjlljghfjfbhccjdelblkdecfjlbeiihekdjiikkgkjlkgghjaldcjfbfjkgbel...

output:

356464990

result:

ok 1 number(s): "356464990"

Test #79:

score: 0
Accepted
time: 250ms
memory: 72680kb

input:

afidajdabcahgleladgilaaiahaalgeckacgdhikedajfllaiecedciibehahihgaabjfiiaigddhecjdilekfekgcheiblkikhgdjgklhbcibideelhefjbddeififeeadfdkcbhcfecdckakhgghcdljcbccafjaffelkdfhjidkdcdeaadlekehfclkejlbekglhiacilkjalbfikejliaefhffgigdcbjllgcikaejabjkikdakdllkbdhkkfdcjglkefhliaceebbbhgfjehjahkdllbdagichkgfhc...

output:

786753770

result:

ok 1 number(s): "786753770"

Test #80:

score: 0
Accepted
time: 178ms
memory: 68508kb

input:

accbabadbdcccccccbddccaadbacacccaadcdbbdbccccbbcabaaccabbbaaccacccdaacdbacacadcacdabdacdbabcaadbcbbddbbaadbcaadddbddddcdcaaacddaaadaacccbdbdcaadabdbbacaadaadaacbaadddbaabdcaaccdccbdbbbadbdaabacdbddaadabdcdbdbabcbbadabdcdbbbcbaadcbdaaadbdcbadaaaacdbacbdbbbadbbcbababaabbacbdcccaadbaddcdaccaabbbaaccccc...

output:

622832899

result:

ok 1 number(s): "622832899"

Test #81:

score: 0
Accepted
time: 230ms
memory: 76432kb

input:

umsbsreehuqiftiwodqedbdftdojqdpockjytlxkmgqhhrciwgqakumdmgjouxibshxsexdmkhjdogcufbufhbvltpsihhxmiueudffqusahvsdtkbfhbyfyhamkywerueygoduedisurxovabyldsxmeneoafkoraxddqvkjyojuomgeqfauvtxfdrbosimvskjnnroandqxraxqmgwjpymfuctwsatvjjimpqflkdrppjjsdoajbptdvgjjbqtqhmtwjxeryosylnlfrgqkidfiiurrftjwbsiwdwflcvl...

output:

984859699

result:

ok 1 number(s): "984859699"

Test #82:

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

input:

yyggyyvvyyggyyssyyggyyvvyyggyymmyyggyyvvyyggyyssyyggyyvvyyggyyccyyggyyvvyyggyyssyyggyyvvyyggyymmyyggyyvvyyggyyssyyggyyvvyyggyyxxyyggyyvvyyggyyssyyggyyvvyyggyymmyyggyyvvyyggyyssyyggyyvvyyggyyccyyggyyvvyyggyyssyyggyyvvyyggyymmyyggyyvvyyggyyssyyggyyvvyyggyyuuyyggyyvvyyggyyssyyggyyvvyyggyymmyyggyyvvyygg...

output:

577529235

result:

ok 1 number(s): "577529235"

Test #83:

score: 0
Accepted
time: 230ms
memory: 72680kb

input:

abbabaabbaababbabaababbaabbabaabbaababbaabbabaababbabaabbaababbabaababbaabbabaababbabaabbaababbaabbabaabbaababbabaababbaabbabaabbaababbaabbabaababbabaabbaababbaabbabaabbaababbabaababbaabbabaababbabaabbaababbabaababbaabbabaabbaababbaabbabaababbabaabbaababbabaababbaabbabaababbabaabbaababbaabbabaabbaab...

output:

949570995

result:

ok 1 number(s): "949570995"

Test #84:

score: 0
Accepted
time: 229ms
memory: 74920kb

input:

bacaacabacaabacabacaabacaacabacaabacabacaacabacaabacaacabacaabacabacaabacaacabacaabacabacaacabacaabacaacabacaabacabacaacabacaabacabacaabacaacabacaabacabacaacabacaabacaacabacaabacabacaabacaacabacaabacabacaacabacaabacabacaabacaacabacaabacabacaacabacaabacaacabacaabacabacaacabacaabacabacaabacaacabacaaba...

output:

70666325

result:

ok 1 number(s): "70666325"

Test #85:

score: 0
Accepted
time: 280ms
memory: 75376kb

input:

gjhcbbgakfgjeejbedjgigkcjdekfekgfekfhkjciggedbbgaadfdeddgacchekjhgkkjejfjjhaecbjfbfkhebajafdcchbhbkhkeghbiekgiacejkhfkfgkehdcaeehchbadakifccabbaebfhkidadejejjaiakjchichgjjfdbgdgjdkjkbejgdbdfdbeciijbjkjfaikggbbjdahgdbfhjccdeabdekkgkgbcebaedeccfagffgkbebgdadfjigcgicebbffbcdabeibaejcbbikekkjbgbecejekgd...

output:

978261270

result:

ok 1 number(s): "978261270"

Test #86:

score: 0
Accepted
time: 151ms
memory: 59224kb

input:

mxoqseznvejisedcoyhvsedqzejrrkxsccggacwxilvzboekmtbniujaityhqqdclnxypzsxfaikjrtocuwttlhkxdljcslhqorjrjyovtsmcinyajmhmhkdekcfpgzdtnfvdmoudufsoudxiyopjstfqycabjuzcxhbkcjuztxghpmbrslfzsninxpncmitkkceqqlxysofkwtmyptbftxqzdjmapryouubgwhpquiywyzorfvktiopndysqpgzupoveearrffknqjvoquagvyeykyiwtbmotwtgpblelvu...

output:

656167218

result:

ok 1 number(s): "656167218"

Test #87:

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

input:

uiggbevurnlkjvwbbrdfhjofvetlkddgqnqgnbunouebddomhsgrfrswjljmjfelokchaffkaouvfowddrihkhkrginsjiiustlenqtbatbngblpovopartfomukttjqvqhbmjuumahkcenebcpawklekgklbcsdfcrfpriroudnnvavothbcsaeedmucshvfhwtcbekcrncprsopdegsdmmfldemtowsnmdhcsvcspotpqdjurkjhkdiuarbwfawrwejfgohnptwrevucfubiajrwhoglmjewqpjbaldwtn...

output:

47222561

result:

ok 1 number(s): "47222561"

Test #88:

score: 0
Accepted
time: 178ms
memory: 65416kb

input:

hagiiddcbggaffcceecgcgeafcgggcchcfegaadfeecffciebcccbagaaaggcifeiehbahccebbaifhbeihcfcdfgiaadcecaeiegcgcchidifcffdaccbadedhgibcdaddafadfedeihiaafghggfidaaeghcdeaaghggdbddbfaachhdaagecggidibffdfifedgdegeeafgeacieihbhcagffbddaicgigdfdhhggedfheabddeggdecbciefbeccfbifacgbiccgghbdhadchefhchicagbibehhdgae...

output:

411089792

result:

ok 1 number(s): "411089792"

Test #89:

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

input:

jpmvlgmjppvgojjqjlomqpljoqpmlmlomvggmomvojjloglvvvojmqoomvplvpvjljmpojpgoqvlgopqmlqjqqllqqpmloglplpqqopplggmqmlgmvvgvvpvmolmjqvomomqvqpmjvoglpollglglgovomomgopqplppvmovlqoqpgqvovpgomjvqoovqojgmmvopjqggvgglpgmpojqlvmooppmvllvjgojjjjlqlqoqqvpppgolomoolvooqvlqgovqjgllpojpqmlgmoolmjmmmpljjmgpgpmvvqvovjp...

output:

704049420

result:

ok 1 number(s): "704049420"

Test #90:

score: 0
Accepted
time: 22ms
memory: 34244kb

input:

crjcrmmknrhfgjecnanrpiphalheosdbkgcggfjmlllcrgrjjfbpkehajhakhnlgrbcfmhlpgopnrdhqkcimiqdbidnscgjseoishaqfrbhagclieprqbcddrmsjrfdhnlhmqogjmikkmaonkjqqjpfphobsncoalorfbmgcsmkqkloaplggnemrlqdeqelhhihgrciefioicnarocmablgoqbbeehckfloejssibfifokslrlonbshnisjshchqdllsihrekcbeefmqomnphhgfgnjeprcmlsdonkplcrpq...

output:

737440505

result:

ok 1 number(s): "737440505"

Test #91:

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

input:

xdaaaeabbbcdaaaeabbbcdaaaeabbbcdaaaeabbbcdaaaeabbbcdaaaeabbbcdaaaeabbbcdaaaeabbbc
yabcaabaaaaabcaabaaaaabcaabaaaaabcaabaaaaabcaabaaaaabcaabaaaaabcaabaaaaabcaabaaaa

output:

165017868

result:

ok 1 number(s): "165017868"

Test #92:

score: 0
Accepted
time: 56ms
memory: 35780kb

input:

ylommmmmmmmmmmmmmlommmmmmmmmmmmmmzlommmmmmmmmmmmmmmlommmmmmmmmmmmmmmylpmmmmmmmmmmmmmmlpmmmmmmmmmmmmmmzlpmmmmmmmmmmmmmmmlpmmmmmmmmmmmmmmmylrmmmmmmmmmmmmmmlrmmmmmmmmmmmmmmznnmllnlmommnnkmlnnnmllnlmommnnkmlnylmmnkmmnokmmnlnmlmmnkmmnokmmnlnmznnmmmmlmlllmmnllonnmmmmlmlllmmnlloymnknmnmnmlmonmknmnknmnmnmlm...

output:

837490821

result:

ok 1 number(s): "837490821"

Test #93:

score: 0
Accepted
time: 257ms
memory: 72360kb

input:

alommmmmmlommmmmmalpmmmmmmlpmmmmmmalrmmmmmmlrmmmmmmaltmmmmmmltmmmmmmalxmmmmmmlxmmmmmmanlmmkommpmkmmlnlnlmmkommpmkmmlnlatrnpnjoptrnpnjopanoqpkkivnoqpkkivaprqnncmtprqnncmtahqnihpmshqnihpmsalrqnnsjklrqnnsjkamjigjkjrmjigjkjraiolhtiqkiolhtiqkaihlljpqsihlljpqsagsjjjmnjgsjjjmnjatniqrnlftniqrnlfakqmptltrkqm...

output:

38724908

result:

ok 1 number(s): "38724908"

Test #94:

score: -100
Wrong Answer
time: 282ms
memory: 73244kb

input:

anlmmmmmmnlmmmmmmalommmmmmlommmmmmalpmmmmmmlpmmmmmmalrmmmmmmlrmmmmmmaltmmmmmmltmmmmmmapnlhnmjkpnlhnmjkarlplmjmorlplmjmoapkrolmkmpkrolmkmaljkmgookljkmgookakmpnqnjhkmpnqnjhampoljoplmpoljoplajlqoknlpjlqoknlpaiiinmmopiiinmmopaljjnnoipljjnnoipahpnnomkjhpnnomkjaogmnlqnkogmnlqnkaommnrjklommnrjklakkpnkmgnkk...

output:

669221754

result:

wrong answer 1st numbers differ - expected: '865985560', found: '669221754'