QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#703692#99. 3-substringsTheZoneAC ✓151ms56616kbC++178.8kb2024-11-02 18:14:552024-11-02 18:15:06

Judging History

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

  • [2024-11-02 18:15:06]
  • 评测
  • 测评结果:AC
  • 用时:151ms
  • 内存:56616kb
  • [2024-11-02 18:14:55]
  • 提交

answer

#include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <string>
#include <vector>

using namespace std;

#define bublic public
#define clr(x) memset((x), 0, sizeof(x))
#define clrn(x, n) memset(x, 0, (n) * sizeof(x[0]))
#define all(x) (x).begin(), (x).end()
#define pb push_back
#define mp make_pair
#define sz size()
#define For(i, st, en) for(int i=(st); i<=(int)(en); i++)
#define Ford(i, st, en) for(int i=(st); i>=(int)(en); i--)
#define forn(i, n) for(int i=0; i<(int)(n); i++)
#define ford(i, n) for(int i=(n)-1; i>=0; i--)
#define fori(it, x) for (__typeof((x).begin()) it = (x).begin(); it != (x).end(); it++)

FILE *g_f_;
int g_s_;
#define freopen(a, b, c) (g_f_ = freopen(a, b, c))
#define scanf(...) (g_s_ = scanf(__VA_ARGS__))
#define sscanf(...) (g_s_ = sscanf(__VA_ARGS__))

template <class _T> inline _T sqr(const _T& x) { return x * x; }
template <class _T> inline string tostr(const _T& a) { ostringstream os(""); os << a; return os.str(); }

typedef long double ld;

// Constants
const ld PI = 3.1415926535897932384626433832795;
const ld EPS = 1e-11;

// Types
typedef signed   long long i64;
typedef unsigned long long u64;
typedef set < int > SI;
typedef vector < int > VI;
typedef map < string, int > MSI;
typedef pair < int, int > PII;

#define INF 0x7f7f7f7f
#define x first
#define y second

const int MAXN = 102400;

int n;
char s[MAXN];
int buf[MAXN * 8 + 2390];
int bs;
const int z = 1 << 17;
PII tmi[z * 2];
PII tma[z * 2];
PII tlcp[z * 2];
int vs;
map < PII, int > vert;
int cnt_nodes[MAXN * 3];
set < int > lens[MAXN * 3];
int anss[MAXN];

inline bool leq(int a1, int a2, int b1, int b2)
{
	return a1 < b1 || (a1 == b1 && a2 <= b2);
}

inline bool leq(int a1, int a2, int a3, int b1, int b2, int b3)
{
	return a1 < b1 || (a1 == b1 && leq(a2, a3, b2, b3));
}

void tmiinsert(PII *t, int x, int k)
{
	int x0 = x;
	x += z;
	while (x)
	{
		if (t[x].x > k) t[x] = mp(k, x0);
		x >>= 1;
	}
}

void tmainsert(PII *t, int x, int k)
{
	int x0 = x;
	x += z;
	while (x)
	{
		if (t[x].x < k) t[x] = mp(k, x0);
		x >>= 1;
	}
}

PII tmin(PII *t, int l, int r)
{
	PII ans = mp(INF, -1);
	l += z;
	r += z;
	while (l <= r)
	{
		if (t[l].x < ans.x) ans = t[l];
		if (t[r].x < ans.x) ans = t[r];
		l = (l + 1) / 2;
		r = (r - 1) / 2;
	}
	return ans;
}

PII tmax(PII *t, int l, int r)
{
	PII ans = mp(-INF, -1);
	l += z;
	r += z;
	while (l <= r)
	{
		if (t[l].x > ans.x) ans = t[l];
		if (t[r].x > ans.x) ans = t[r];
		l = (l + 1) / 2;
		r = (r - 1) / 2;
	}
	return ans;
}

void cnt_sort(int *a, int *b, int *r, int n, int k)
{
	int *cnt = buf + bs; bs += k+1;
	clrn(cnt, k+1);

	forn(i, n)
	{
		cnt[r[a[i]]]++;
	}

	for(int i=0, sum=0; i<=k; i++)
	{
		int tmp = cnt[i];
		cnt[i] = sum;
		sum += tmp;
	}

	forn(i, n)
	{
		b[cnt[r[a[i]]]++] = a[i];
	}

	bs -= k+1;
}

void suffix_array(int *s, int *sa, int n, int k)
{
	int n0 = (n+2) / 3, n1 = (n+1) / 3, n2 = n / 3, n02 = n0 + n2;
	int *s0 = buf + bs; bs += n0;
	int *sa0 = buf + bs; bs += n0;
	int *s12 = buf + bs; bs += n02+3; s12[n02] = s12[n02+1] = s12[n02+2] = 0;
	int *sa12 = buf + bs; bs += n02+3; sa12[n02] = sa12[n02+1] = sa12[n02+2] = 0;

	int m = 0;
	forn(i, n+n0-n1)
	{
		if (i % 3)
		{
			s12[m++] = i;
		}
	}

	cnt_sort(s12, sa12, s+2, n02, k);
	cnt_sort(sa12, s12, s+1, n02, k);
	cnt_sort(s12, sa12, s  , n02, k);

	m = 0;
	int c0 = -1, c1 = -1, c2 = -1;
	forn(i, n02)
	{
		if (s[sa12[i]] != c0 || s[sa12[i]+1] != c1 || s[sa12[i]+2] != c2)
		{
			m++;
			c0 = s[sa12[i]];
			c1 = s[sa12[i]+1];
			c2 = s[sa12[i]+2];
		}
		if (sa12[i] % 3 == 1)
		{
			s12[sa12[i] / 3] = m;
		}
		else
		{
			s12[sa12[i] / 3 + n0] = m;
		}
	}

	if (m != n02)
	{
		suffix_array(s12, sa12, n02, m);
		forn(i, n02)
		{
			s12[sa12[i]] = i + 1;
		}
	}
	else
	{
		forn(i, n02)
		{
			sa12[s12[i] - 1] = i;
		}
	}

	m = 0;
	forn(i, n02)
	{
		if (sa12[i] < n0)
		{
			s0[m++] = sa12[i] * 3;
		}
	}

	cnt_sort(s0, sa0, s, n0, k);

	int p = 0;
	int t = n0 - n1;
#define geti() (sa12[t] < n0 ? sa12[t] * 3 + 1 : (sa12[t] - n0) * 3 + 2)
	forn(z, n)
	{
		int i = geti();
		int j = sa0[p];
		if (sa12[t] < n0 ? leq(s[i], s12[sa12[t]+n0], s[j], s12[j/3]) : leq(s[i], s[i+1], s12[sa12[t]-n0+1], s[j], s[j+1], s12[j/3 + n0]))
		{
			sa[z] = i;
			t++;
			if (t == n02)
			{
				for(z++; p<n0; p++, z++)
				{
					sa[z] = sa0[p];
				}
			}
		}
		else
		{
			sa[z] = j;
			p++;
			if (p == n0)
			{
				for(z++; t<n02; t++, z++)
				{
					sa[z] = geti();
				}
			}
		}
	}

	bs -= n02+3; 	
	bs -= n02+3;	
	bs -= n0;     
	bs -= n0;    	
}

void suff_arr(char *s, int *sa, int n)
{
	int *a = buf + bs; bs += n+3;
	a[n] = a[n+1] = a[n+2] = 0;
	forn(i, n)
	{
		a[i] = (unsigned char)s[i];
	}

	suffix_array(a, sa, n, 128);

	bs -= n+3;
}

void calc_lcp(char *s, int *sa, int *pa, int n, int *lcp)
{
	forn(i, n)
	{
		int j = pa[i];
		if (j == n-1) lcp[pa[i]] = 0;
		else
		{
			int x = (i ? max(lcp[pa[i-1]] - 1, 0) : 0);
			j = sa[j+1];
			while (s[i+x] == s[j+x]) x++;
			lcp[pa[i]] = x;
		}
	}
}

int dfs1(int *sa, int l, int r)
{
	if (l == r)
	{
		lens[vs].insert(n - sa[l]);
		vert[mp(l, r)] = vs++;
	}
	if (l >= r) return 1;
	int cur_v = vs++;
	vert[mp(l, r)] = cur_v;
	int m = tmin(tlcp, l, r - 1).y;
	int ans = 1;
	
	ans += dfs1(sa, l, m);
	ans += dfs1(sa, m + 1, r);
	
	return cnt_nodes[cur_v] = ans;
}

i64 rec(int l, int r, int s, int &v)
{
	v = vert[mp(l, r)];
	if (l >= r) return 0;
	PII w = tmin(tlcp, l, r - 1);
	int m = w.y;
	int ns = w.x;
	i64 ans = 0;
	int lmi = tmin(tmi, l, r).x;
	int lma = tmax(tma, l, r).x;
	
	int v1, v2;
	ans += rec(l, m, ns, v1);
	ans += rec(m + 1, r, ns, v2);
	
	if (lens[v1].sz < lens[v2].sz) swap(v1, v2);
	fori(it, lens[v2])
	{
		lens[v1].insert(*it);
	}
	v = v1;
	lens[v2].clear();
/*	cerr << l << " " << r << " " << v << endl;
	cerr << "l: ";
	fori(it, lens[v1])
	{
		cerr << *it << " ";
	}
	cerr << endl;*/
	int mi = s;
	int ma = ns;
	while (mi < ma)
	{
		int q = (mi + ma + 1) / 2;
		__typeof(lens[v1].begin()) it = lens[v1].lower_bound(lmi + q);
		if (it == lens[v1].end() || *it + q > lma) ma = q - 1;
		else mi = q;
	}
	
	if (mi > s)
	{
		anss[s]--;
		anss[mi]++;
	}
	ans += mi - s;
//	ans += max(min(lma - lmi, ns) - s, 0);
	
	return ans;
}

int main()
{
#ifdef ROOM_311
	time_t et_0 = clock();
#endif
	cout << setiosflags(ios::fixed) << setprecision(10);
	
	scanf("%s", s);
	n = strlen(s);
	if (n < 2)
	{
		puts("0");
		return 0;
	}

	bs = 0;

	int *sa = buf + bs; bs += n;
	suff_arr(s, sa, n);
	int *pa = buf + bs; bs += n;
	forn(i, n)
	{
		pa[sa[i]] = i;
	}
	int *lcp = buf + bs; bs += n;
	calc_lcp(s, sa, pa, n, lcp);

	memset(tmi, 0x3f, sizeof(tmi));
	memset(tma, 0xff, sizeof(tma));
	memset(tlcp, 0x3f, sizeof(tlcp));
	forn(i, n)
	{
		tmi[z + i] = mp(n - sa[i], i);
		tma[z + i] = mp(n - sa[i], i);
		if (i < n - 1) tlcp[z + i] = mp(lcp[i], i);
	}
	Ford(i, z-1, 1)
	{
		tmi[i] = min(tmi[i * 2], tmi[i * 2 + 1]);
		tma[i] = max(tma[i * 2], tma[i * 2 + 1]);
		tlcp[i] = min(tlcp[i * 2], tlcp[i * 2 + 1]);
	}
	
	clr(anss);
	vs = 0;
	dfs1(sa, 0, n-1);
	int v;
	/*i64 ans = */rec(0, n-1, 0, v);
	
	ford(i, n)
	{
		anss[i] += anss[i + 1];
	}
	For(i, 1, n / 3)
	{
		if (i > 1) putchar(' ');
		printf("%d", anss[i]);
	}
	puts("");
//	cout << ans << endl;
	
	bs -= n;
	bs -= n;
	bs -= n;
	
#ifdef ROOM_311
	time_t et_1 = clock();
	fprintf(stderr, "Execution time = %0.0lf ms\n", (et_1 - et_0) * 1000.0 / CLOCKS_PER_SEC);
#endif
	return 0;
}
/**/


















































































































































































































































































































































































































































































































































Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 7ms
memory: 26864kb

input:

abracadabra

output:

1 0 0

result:

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

Test #2:

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

input:

abacabaabacabaabacaba

output:

3 4 4 4 3 2 1

result:

ok 7 numbers

Test #3:

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

input:

aaaa

output:

1

result:

ok 1 number(s): "1"

Test #4:

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

input:

abbababbbbbbbaababaabbbbbbbbbaaaabaababbbbabbaababbbaababaaabaaabaaaaabaabaaababbabaabbbbbaabbabaaabaabaabbbaaaaaaabbababbbababbbbbbbabbaaaaaabbbabbbbaabaaabbbbabaabaabbaabbaaaabbbabbbaaabaaabaaababbabbababbbabbbababaabbabbbbabaaaababbaababaaababbbbbaabbbabaaaaaaabaaaaaaaabbaaababbbbbbabaabbbbaababb...

output:

2 4 8 16 32 64 128 256 512 1024 2048 4095 8104 14208 17407 14585 9512 5377 2761 1354 677 341 181 102 58 28 16 11 8 6 4 3 2 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0...

result:

ok 33333 numbers

Test #5:

score: 0
Accepted
time: 106ms
memory: 46564kb

input:

bxpjtxrsiorgalvpmqqhexsuchvfoxjwteweenazixqjsmhledkhbcrpgozgqsvobluemfpyldxyfvmrgdinmboogxomqalzcgrdxrjuxeoqtnkoumsgwcbzbuzuphgsenqvrvzpgnfnlyiyumuyrdpinjursgmdanizbfbqxoytwsnhpmwhhrairafdpaayvqdmsbzgzgplcnziunkvwswqnplugfcohvukyiwndgumfegoudfzdpqkrxlbklfiqppdokixjmiouydlyueghtpyiytekvojeqgqmpuzxqzv...

output:

26 676 16216 676 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 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 33333 numbers

Test #6:

score: 0
Accepted
time: 140ms
memory: 48652kb

input:

abbbaabbababbaababbaabaabaaababaaaaababbaaabbbbaaaaababbbababbabaaaaababbabaabbaaabbbabbbabbbbabbabbabbaaaaaaaabbabaabaababbbabbabbaaabbbbbabaababbbbbabbbbbaaabababaaaaabaabaaaaabaaababaaabbbbaabaabaaaaabbbbaabbaaaaaabbaabbabbbabbabababbabbbababbbabaabbabbbaaababbaaaabaaabbaabababbbbbbbaaaaabbbaaaaa...

output:

2 4 8 16 32 64 128 256 512 1024 2048 4095 8103 14243 17525 14642 9600 5429 2803 1380 701 358 195 116 73 40 26 19 14 11 8 6 4 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 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 33333 numbers

Test #7:

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

input:

aaaabbbababaaaababbbbaababbaaabaababbbbabbababbbababbbaaabaaaabaaaabaaaababbaabaabbaabbbaababbbbababaaaabaaabaaaabbbabbaabbbbbbaaabbbababaaaabaaaababbaaaaaaaaabbabbabbbaaabbbbabaaabbabbbababbabbaabbbbbaaaabaaabbbaaabaaaabaaaabbbbabbabaaaabbbaababbbbaaabaaaaababababaabaabaaaaaaabababbbababaabbbaabbba...

output:

2 4 8 16 32 64 128 256 512 1024 2048 4095 8104 14218 17419 14622 9515 5373 2753 1350 676 340 180 102 58 28 16 11 8 6 4 3 2 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0...

result:

ok 33333 numbers

Test #8:

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

input:

bbbaabbbabaaaaaaabaaaaaaaabbaaababbbbbbabaabbbbaababbbbbababbbabaaaababaaaabbbbaaaabbbabbbaaabbbbabaaabbabbaaabaaaababaabaaabaabaabaaaabaaaaabbaaabbbbaaabaabbaaaabababaaababbabababbbabbbabbbbbbbaabbababbbaaaabbbaaaaabbbbbbbabbbbaaaaabbababbaaaaabbbaaaabbbbaababbabbbbbbabbbbabaaababbbababaaabaabbabba...

output:

2 4 8 16 32 64 128 256 512 1024 2048 4095 8104 14218 17417 14592 9509 5383 2764 1356 678 341 181 102 58 28 16 11 8 6 4 3 2 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0...

result:

ok 33333 numbers

Test #9:

score: 0
Accepted
time: 142ms
memory: 48660kb

input:

bbaaababbaaabaaaaababaaababbaabababbbaaabaababbabbbbaabbaaabbababbbbbbbbbbbbbaaabaabbbaaababaaabbbabbabaaaababababaabbababbabbaabaaababbaaabbabbbabbababababaaabaaaabbaabbbbbabaaabbaaaaaaaabbbababbaaababbbbbabbbbaaaaaaabbbabbabaaabababbbbabaabaabbbaabbbaababbbaaababaabbababbabbaababaaaabbbaabaabbaaaa...

output:

2 4 8 16 32 64 128 256 512 1024 2048 4095 8109 14361 17572 14682 9545 5509 2932 1506 766 406 218 127 82 54 36 29 24 22 20 18 16 14 12 10 8 6 4 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 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 33333 numbers

Test #10:

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

input:

bbbabbabbaaabaababbabbabbbbabbabbaabbbabbaabaabaaaabbbaabaaaaaabbabaaababaaaaabaabbbabaabbaabbbabaaababaaabbbaabbabababaaabaaabaaaaaaaaaababababbbbbababbaabbabbbaaababbbabaaaabaabaabbaaabababaabaabaababaabbbbaabaaababbabaabababbbbaaababbababaabaaaaabaaaaabbbbabaaababbabaabaabaaabaaaabbbbbaabbbabbaba...

output:

2 4 8 16 32 64 128 256 512 1024 2048 4096 8105 14212 17386 14561 9490 5348 2728 1337 668 337 178 101 58 29 17 11 8 6 4 3 2 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0...

result:

ok 33333 numbers

Test #11:

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

input:

abbabaabbaababbabaababbaabbabaabbaababbaabbabaababbabaabbaababbabaababbaabbabaababbabaabbaababbaabbabaabbaababbabaababbaabbabaabbaababbaabbabaababbabaabbaababbaabbabaabbaababbabaababbaabbabaababbabaabbaababbabaababbaabbabaabbaababbaabbabaababbabaabbaababbabaababbaabbabaababbabaabbaababbaabbabaabbaab...

output:

2 4 6 10 12 16 20 22 24 28 32 36 40 42 44 46 48 52 56 60 64 68 72 76 80 82 84 86 88 90 92 94 96 100 104 108 112 116 120 124 128 132 136 140 144 148 152 156 160 162 164 166 168 170 172 174 176 178 180 182 184 186 188 190 192 196 200 204 208 212 216 220 224 228 232 236 240 244 248 252 256 260 264 268 ...

result:

ok 33333 numbers

Test #12:

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

input:

xnxxnxnxxnxxnxnxxnxnxxnxxnxnxxnxxnxnxxnxnxxnxxnxnxxnxnxxnxxnxnxxnxxnxnxxnxnxxnxxnxnxxnxxnxnxxnxnxxnxxnxnxxnxnxxnxxnxnxxnxxnxnxxnxnxxnxxnxnxxnxnxxnxxnxnxxnxxnxnxxnxnxxnxxnxnxxnxxnxnxxnxnxxnxxnxnxxnxnxxnxxnxnxxnxxnxnxxnxnxxnxxnxnxxnxxnxnxxnxnxxnxxnxnxxnxnxxnxxnxnxxnxxnxnxxnxnxxnxxnxnxxnxnxxnxxnxnxxnxx...

output:

2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 10...

result:

ok 33333 numbers

Test #13:

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

input:

mlwlllwlllllmwlmwlmlrllllwwmrmlllrlmllllwlwmwlllllmwrlllbmllllwrwlbwrwlmllvmwrlmvrlwlmlrllvwlbrlllmlwlmvlwlmmvrlllrlmrrmlwwlmlllllllwlrllrwlwlwmrlllmlvwlmlmwmwrlllmlllllwllwmmwlllwllllmvwllwlwlllvlvblwrllwlwlrllmllmwmlwmlwlmlllllllllmarwllllmlwwmwlmvvrvlrllllmbllwwwmlllblllwvlvwllwwrwlmllllwwllwllml...

output:

17 114 516 1701 4252 8526 14135 20073 25159 28770 30889 31993 32473 32667 32740 32759 32766 32767 32768 32768 32768 32768 32768 32768 32768 32768 32768 32768 32768 32768 32768 32768 32768 32768 32768 32768 32768 32768 32768 32768 32768 32768 32768 32768 32768 32768 32768 32768 32768 32768 32768 3276...

result:

ok 33333 numbers

Test #14:

score: 0
Accepted
time: 98ms
memory: 51452kb

input:

utuvutuvutuvutuvutuvutuvutuvutuvutuvutuvutuvutuvutuvutuvutuvutuvutuvutuvutuvutuvutuvutuvutuvutuvutuvutuvutuvutuvutuvutuvutuvutuvutuvutuvutuvutuvutuvutuvutuvutuvutuvutuvutuvutuvutuvutuvutuvutuvutuvutuvutuvutuvutuvutuvutuvutuvutuvutuvutuvutuvutuvutuvutuvutuvutuvutuvutuvutuvutuvutuvutuvutuvutuvutuvutuv...

output:

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

result:

ok 33333 numbers

Test #15:

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

input:

abbabaabbaababbabaababbaabbabaabbaababbaabbabaababbabaabbaababbabaababbaabbabaababbabaabbaababbaabbabaabbaababbabaababbaabbabaabbaababbaabbabaababbabaabbaababbaabbabaabbaababbabaababbaabbabaababbabaabbaababbabaababbaabbabaabbaababbaabbabaababbabaabbaababbabaababbaabbabaababbabaabbaababbaabbabaabbaab...

output:

2 4 6 10 12 16 20 22 24 28 32 36 40 42 44 46 48 52 56 60 64 68 72 76 80 82 84 86 88 90 92 94 96 100 104 108 112 116 120 124 128 132 136 140 144 148 152 156 160 162 164 166 168 170 172 174 176 178 180 182 184 186 188 190 192 196 200 204 208 212 216 220 224 228 232 236 240 244 248 252 256 260 264 268 ...

result:

ok 33333 numbers

Test #16:

score: 0
Accepted
time: 96ms
memory: 48112kb

input:

lkllklkllkllklkllklkllkllklkllkllklkllklkllkllklkllklkllkllklkllkllklkllklkllkllklkllkllklkllklkllkllklkllklkllkllklkllkllklkllklkllkllklkllklkllkllklkllkllklkllklkllkllklkllkllklkllklkllkllklkllklkllkllklkllkllklkllklkllkllklkllkllklkllklkllkllklkllklkllkllklkllkllklkllklkllkllklkllklkllkllklkllkll...

output:

2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 10...

result:

ok 33333 numbers

Test #17:

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

input:

iinniiiiineeiiienninqniiiqiiiiiiiinniiiiilnnininnqieiiiiiqeniiieqiinniennnqniiiiqiieeneiiipiininiiniiiqiniliniiiinineiiilniniiiinlnniiiiiieiqiiqiniiiiinpniiiiqnineqiiqniiinnepdpqiilinnijnieiininniniieqqnieininhiiliiniqqenilqiniiipniiinieniieieeiieniinennnniniiinininiiniqpineqlnniieeiiiqiiniqiiiiinni...

output:

15 112 510 1696 4268 8570 14165 20074 25176 28772 30909 32029 32491 32673 32738 32752 32756 32758 32759 32760 32761 32762 32763 32764 32765 32766 32767 32768 32768 32768 32768 32768 32768 32768 32768 32768 32768 32768 32768 32768 32768 32768 32768 32768 32768 32768 32768 32768 32768 32768 32768 3276...

result:

ok 33333 numbers

Test #18:

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

input:

gigqgigqgigqgigqgigqgigqgigqgigqgigqgigqgigqgigqgigqgigqgigqgigqgigqgigqgigqgigqgigqgigqgigqgigqgigqgigqgigqgigqgigqgigqgigqgigqgigqgigqgigqgigqgigqgigqgigqgigqgigqgigqgigqgigqgigqgigqgigqgigqgigqgigqgigqgigqgigqgigqgigqgigqgigqgigqgigqgigqgigqgigqgigqgigqgigqgigqgigqgigqgigqgigqgigqgigqgigqgigqgigq...

output:

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

result:

ok 33333 numbers

Test #19:

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

input:

abaabaabaabaababaabaabaabaababaabaabaabaababaabaabaabaababaabaabaabaababaabaabaabaababaabaabaabaababaabaabaabaababaabaabaabaababaabaabaabaababaabaabaabaababaabaabaabaababaabaabaabaababaabaabaabaababaabaabaabaababaabaabaabaababaabaabaabaababaabaabaabaababaabaabaabaababaabaabaabaababaabaabaabaababaaba...

output:

2 3 4 5 6 7 8 9 10 11 12 13 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14...

result:

ok 33333 numbers

Test #20:

score: 0
Accepted
time: 97ms
memory: 53244kb

input:

abaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaaba...

output:

2 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 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 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 3 3 3 3 3 3 3 3 3 3 3 ...

result:

ok 33333 numbers

Test #21:

score: 0
Accepted
time: 96ms
memory: 56540kb

input:

xwxwxwxwxwxwxwxwxwxwxwxwxwxwxwxwxwxwxwxwxwxwxwxwxwxwxwxwxwxwxwxwxwxwxwxwxwxwxwxwxwxwxwxwxwxwxwxwxwxwxwxwxwxwxwxwxwxwxwxwxwxwxwxwxwxwxwxwxwxwxwxwxwxwxwxwxwxwxwxwxwxwxwxwxwxwxwxwxwxwxwxwxwxwxwxwxwxwxwxwxwxwxwxwxwxwxwxwxwxwxwxwxwxwxwxwxwxwxwxwxwxwxwxwxwxwxwxwxwxwxwxwxwxwxwxwxwxwxwxwxwxwxwxwxwxwxwxwxwxw...

output:

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

result:

ok 33333 numbers

Test #22:

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

input:

abaabaabaabaababaabaabaabaababaabaabaabaababaabaabaabaababaabaabaabaababaabaabaabaababaabaabaabaababaabaabaabaababaabaabaabaababaabaabaabaababaabaabaabaababaabaabaabaababaabaabaabaababaabaabaabaababaabaabaabaababaabaabaabaababaabaabaabaababaabaabaabaababaabaabaabaababaabaabaabaababaabaabaabaababaaba...

output:

2 3 4 5 6 7 8 9 10 11 12 13 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14...

result:

ok 33333 numbers

Test #23:

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

input:

abaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaaba...

output:

2 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 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 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 3 3 3 3 3 3 3 3 3 3 3 ...

result:

ok 33333 numbers

Test #24:

score: 0
Accepted
time: 91ms
memory: 56616kb

input:

xwxwxwxwxwxwxwxwxwxwxwxwxwxwxwxwxwxwxwxwxwxwxwxwxwxwxwxwxwxwxwxwxwxwxwxwxwxwxwxwxwxwxwxwxwxwxwxwxwxwxwxwxwxwxwxwxwxwxwxwxwxwxwxwxwxwxwxwxwxwxwxwxwxwxwxwxwxwxwxwxwxwxwxwxwxwxwxwxwxwxwxwxwxwxwxwxwxwxwxwxwxwxwxwxwxwxwxwxwxwxwxwxwxwxwxwxwxwxwxwxwxwxwxwxwxwxwxwxwxwxwxwxwxwxwxwxwxwxwxwxwxwxwxwxwxwxwxwxwxw...

output:

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

result:

ok 33333 numbers

Test #25:

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

input:

aaabaaabaaabaaacaaabaaabaaabaaacaaabaaabaaabaaacaaabaaabaaabaaadaaabaaabaaabaaacaaabaaabaaabaaacaaabaaabaaabaaacaaabaaabaaabaaadaaabaaabaaabaaacaaabaaabaaabaaacaaabaaabaaabaaacaaabaaabaaabaaadaaabaaabaaabaaacaaabaaabaaabaaacaaabaaabaaabaaacaaabaaabaaabaaaeaaabaaabaaabaaacaaabaaabaaabaaacaaabaaabaaab...

output:

8 15 22 28 34 40 46 52 58 64 70 76 81 86 91 96 101 106 111 116 121 126 131 136 141 146 151 156 161 166 171 176 181 186 191 196 201 206 211 216 221 226 231 236 241 246 251 256 260 264 268 272 276 280 284 288 292 296 300 304 308 312 316 320 324 328 332 336 340 344 348 352 356 360 364 368 372 376 380 3...

result:

ok 21845 numbers

Test #26:

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

input:

aaabaaabaaabaaacaaabaaabaaabaaacaaabaaabaaabaaacaaabaaabaaabaaadaaabaaabaaabaaacaaabaaabaaabaaacaaabaaabaaabaaacaaabaaabaaabaaadaaabaaabaaabaaacaaabaaabaaabaaacaaabaaabaaabaaacaaabaaabaaabaaadaaabaaabaaabaaacaaabaaabaaabaaacaaabaaabaaabaaacaaabaaabaaabaaaeaaabaaabaaabaaacaaabaaabaaabaaacaaabaaabaaab...

output:

8 15 22 28 34 40 46 52 58 64 70 76 81 86 91 96 101 106 111 116 121 126 131 136 141 146 151 156 161 166 171 176 181 186 191 196 201 206 211 216 221 226 231 236 241 246 251 256 260 264 268 272 276 280 284 288 292 296 300 304 308 312 316 320 324 328 332 336 340 344 348 352 356 360 364 368 372 376 380 3...

result:

ok 21845 numbers

Test #27:

score: 0
Accepted
time: 73ms
memory: 45968kb

input:

ababacababacababacababadababacababacababacababadababacababacababacababadababacababacababacababadababacababacababacababaeababacababacababacababadababacababacababacababadababacababacababacababadababacababacababacababadababacababacababacababaeababacababacababacababadababacababacababacababadababacababac...

output:

7 12 17 22 26 30 34 38 42 46 50 54 58 62 66 70 74 78 81 84 87 90 93 96 99 102 105 108 111 114 117 120 123 126 129 132 135 138 141 144 147 150 153 156 159 162 165 168 171 174 177 180 183 186 189 192 195 198 201 204 207 210 213 216 219 222 225 228 231 234 237 240 243 246 249 252 255 258 261 264 267 27...

result:

ok 30319 numbers

Test #28:

score: 0
Accepted
time: 94ms
memory: 48016kb

input:

ababacababacababacababadababacababacababacababadababacababacababacababadababacababacababacababadababacababacababacababaeababacababacababacababadababacababacababacababadababacababacababacababadababacababacababacababadababacababacababacababaeababacababacababacababadababacababacababacababadababacababac...

output:

7 12 17 22 26 30 34 38 42 46 50 54 58 62 66 70 74 78 81 84 87 90 93 96 99 102 105 108 111 114 117 120 123 126 129 132 135 138 141 144 147 150 153 156 159 162 165 168 171 174 177 180 183 186 189 192 195 198 201 204 207 210 213 216 219 222 225 228 231 234 237 240 243 246 249 252 255 258 261 264 267 27...

result:

ok 33319 numbers

Test #29:

score: 0
Accepted
time: 39ms
memory: 36624kb

input:

aaaaabaaaaabaaaaabaaaaabaaaaabaaaaacaaaaabaaaaabaaaaabaaaaabaaaaabaaaaacaaaaabaaaaabaaaaabaaaaabaaaaabaaaaacaaaaabaaaaabaaaaabaaaaabaaaaabaaaaacaaaaabaaaaabaaaaabaaaaabaaaaabaaaaacaaaaabaaaaabaaaaabaaaaabaaaaabaaaaadaaaaabaaaaabaaaaabaaaaabaaaaabaaaaacaaaaabaaaaabaaaaabaaaaabaaaaabaaaaacaaaaabaaaaab...

output:

6 11 16 21 26 30 34 38 42 46 50 54 58 62 66 70 74 78 82 86 90 94 98 102 106 110 114 118 122 126 129 132 135 138 141 144 147 150 153 156 159 162 165 168 171 174 177 180 183 186 189 192 195 198 201 204 207 210 213 216 219 222 225 228 231 234 237 240 243 246 249 252 255 258 261 264 267 270 273 276 279 ...

result:

ok 15551 numbers

Test #30:

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

input:

aaaaabaaaaabaaaaabaaaaabaaaaabaaaaacaaaaabaaaaabaaaaabaaaaabaaaaabaaaaacaaaaabaaaaabaaaaabaaaaabaaaaabaaaaacaaaaabaaaaabaaaaabaaaaabaaaaabaaaaacaaaaabaaaaabaaaaabaaaaabaaaaabaaaaacaaaaabaaaaabaaaaabaaaaabaaaaabaaaaadaaaaabaaaaabaaaaabaaaaabaaaaabaaaaacaaaaabaaaaabaaaaabaaaaabaaaaabaaaaacaaaaabaaaaab...

output:

6 11 16 21 26 30 34 38 42 46 50 54 58 62 66 70 74 78 82 86 90 94 98 102 106 110 114 118 122 126 129 132 135 138 141 144 147 150 153 156 159 162 165 168 171 174 177 180 183 186 189 192 195 198 201 204 207 210 213 216 219 222 225 228 231 234 237 240 243 246 249 252 255 258 261 264 267 270 273 276 279 ...

result:

ok 15551 numbers

Test #31:

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

input:

aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa...

output:

1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 ...

result:

ok 299 numbers

Test #32:

score: 0
Accepted
time: 95ms
memory: 46960kb

input:

aaaaaaabaaaaaaabaaaaaaacaaaaaaabaaaaaaabaaaaaaacaaaaaaabaaaaaaabaaaaaaacaaaaaaabaaaaaaabaaaaaaacaaaaaaabaaaaaaabaaaaaaacaaaaaaabaaaaaaabaaaaaaacaaaaaaabaaaaaaabaaaaaaacaaaaaaabaaaaaaabaaaaaaadaaaaaaabaaaaaaabaaaaaaacaaaaaaabaaaaaaabaaaaaaacaaaaaaabaaaaaaabaaaaaaacaaaaaaabaaaaaaabaaaaaaacaaaaaaabaaaa...

output:

6 11 16 21 26 31 36 40 44 48 52 56 60 64 68 72 75 78 81 84 87 90 93 96 99 102 105 108 111 114 117 120 123 126 129 132 135 138 141 144 147 150 153 156 159 162 165 168 171 174 177 180 183 186 189 192 195 198 201 204 207 210 213 216 219 222 225 228 231 234 237 240 243 246 249 252 255 258 261 264 267 27...

result:

ok 33332 numbers

Test #33:

score: 0
Accepted
time: 31ms
memory: 38784kb

input:

aabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaab...

output:

2 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 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 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 3 3 3 3 3 3 3 3 3 3 3 ...

result:

ok 14999 numbers

Test #34:

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

input:

abababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababab...

output:

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

result:

ok 13333 numbers

Test #35:

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

input:

abacabacabadabacabacabadabacabacabadabacabacabadabacabacabadabacabacabadabacabacabadabacabacabadabacabacabadabacabacabadabacabacabadabacabacabadabacabacabadabacabacabadabacabacabadabacabacabadabacabacabadabacabacabadabacabacabadabacabacabadabacabacabadabacabacabadabacabacabadabacabacabadabacabacabad...

output:

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

result:

ok 16399 numbers