QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#640390#5497. 品酒大会duckindog100 ✓371ms76724kbC++232.3kb2024-10-14 11:39:362024-10-14 11:39:37

Judging History

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

  • [2024-10-14 11:39:37]
  • 评测
  • 测评结果:100
  • 用时:371ms
  • 内存:76724kb
  • [2024-10-14 11:39:36]
  • 提交

answer

#include <bits/stdc++.h>

using namespace std;

#define int long long

const int N = 300'000 + 10;
int n;
string s;
int a[N];

int pos[N], tmp[N], sa[N];
int lcp[N];

void initSA() { 
	for (int i = 1; i <= n; ++i) pos[i] = s[i] - 'a' + 1, sa[i] = i;
	for (int gap = 1; ; gap *= 2) { 
		auto cmp = [&](int i, int j) { 
			if (pos[i] != pos[j]) return pos[i] < pos[j];
			i += gap; j += gap;
			return i <= n && j <= n ? pos[i] < pos[j] : i > j;
		};
		sort(sa + 1, sa + n + 1, cmp);
		for (int i = 2; i <= n; ++i) tmp[i] = tmp[i - 1] + cmp(sa[i - 1], sa[i]);
		for (int i = 1; i <= n; ++i) pos[sa[i]] = tmp[i] + 1;
		if (tmp[n] == n - 1) break;
	}
	for (int i = 1, k = 0; i <= n; ++i) { 
		if (pos[i] == n) continue;
		for (int j = sa[pos[i] + 1]; s[i + k] == s[j + k]; ) k += 1;
		lcp[i] = k;
		if (k) k -= 1;
	}
}

int cnt, value = -1'000'000'000'000'000'000;
vector<int> mi[N], ma[N];
int id[N];
int root(int u) { return id[u] < 0 ? u : id[u] = root(id[u]); }
void add(int u, int v) { 
	u = root(u); v = root(v);
	if (u == v) return;
	if (id[u] > id[v]) swap(u, v);

	cnt -= id[v] * (id[v] + 1) / 2;
	cnt -= id[u] * (id[u] + 1) / 2;

	id[u] += id[v];
	id[v] = u;

	cnt += id[u] * (id[u] + 1) / 2;

	mi[u].insert(mi[u].end(), mi[v].begin(), mi[v].end());
	sort(mi[u].begin(), mi[u].end());
	if (mi[u].size() > 2) mi[u].resize(2);
	if (mi[u].size() == 2) value = max(value, mi[u][0] * mi[u][1]);

	ma[u].insert(ma[u].end(), ma[v].begin(), ma[v].end());
	sort(ma[u].begin(), ma[u].end(), greater<>());
	if (ma[u].size() > 2) ma[u].resize(2);
	if (ma[u].size() == 2) value = max(value, ma[u][0] * ma[u][1]);
}

vector<int> save[N];

int32_t main() { 
	cin.tie(0)->sync_with_stdio(0);

	cin >> n;
	cin >> s;
	for (int i = 1; i <= n; ++i) cin >> a[i];

	s = '@' + s;
	initSA();

	for (int i = 1; i <= n; ++i) save[lcp[i]].push_back(i);
	for (int i = 1; i <= n; ++i) {
		mi[i].push_back(a[i]);
		ma[i].push_back(a[i]);
	}
	memset(id, -1, sizeof id);
	
	vector<pair<int, int>> answer;
	for (int i = n; i >= 1; --i) { 
		for (const auto& x : save[i - 1]) if (pos[x] != n) add(x, sa[pos[x] + 1]);
		answer.push_back({cnt, !cnt ? 0 : value});
	}

	reverse(answer.begin(), answer.end());
	for (const auto& [a, b] : answer) cout << a << " " << b << "\n";
}

詳細信息


Pretests


Final Tests

Test #1:

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

input:

100
ycobizcoyizcobiyyobiycobiycoyiycybyyyobiycobizyoyiycybyzcoyiycoyizcoyizcybiyyoyiycobyzcoyizcybizcobi
-678 -8729 7229 6391 -7120 372 -7522 9713 -7138 4498 -5299 3500 9655 -490 8846 3401 738 -4171 -5842 -9460 1407 4061 -7514 6593 -448 6527 -7726 4790 -2842 6006 4622 283 -7270 -6469 -5689 788 -6190...

output:

4950 93779015
913 93779015
327 93701311
188 93701311
103 93701311
59 93701311
32 74513428
15 74513428
8 74513428
4 66110562
2 66110562
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 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 100 lines

Test #2:

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

input:

200
pkhktkydzivcuypurfmbzazcbzazcbzazcbzazcbzazcbzazcbzazcbzazcbzazcbzazcbzazcbzazcbzazcbzazcbzazcbzazcbzazcbzazcbzazcbzazcbzazcbzazcbzazcbzazcbzazcbzazcbzazcbzazcbzazcbzazcbzazcbzazcbisgekyrgzvxdhpoamvaf
746 3544 1800 -2348 821 3629 5984 -1913 -517 -9336 -3063 -2344 -8129 956 6736 -6370 6368 -7957 ...

output:

19900 97697938
3785 97697938
2481 97697938
2449 97697938
2418 97697938
2387 90221956
2356 90221956
2325 90221956
2295 90221956
2265 90221956
2235 90221956
2205 90221956
2175 90221956
2146 90221956
2117 90221956
2088 90221956
2059 90221956
2030 90221956
2002 90221956
1974 90221956
1946 90221956
1918 ...

result:

ok 200 lines

Test #3:

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

input:

500
yylooqylooqylooqylooyylooqylooqyyooqylooqylooqyloyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy...

output:

124750 99580441
107651 99580441
102543 99580441
100719 99580441
100248 99580441
99781 99580441
99318 99580441
98856 99580441
98398 99580441
97942 99580441
97489 99580441
97040 99580441
96592 99580441
96148 99580441
95707 99580441
95268 99580441
94831 99580441
94395 99580441
93961 99580441
93528 9958...

result:

ok 500 lines

Test #4:

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

input:

750
sepjeiszsgcezwapqrvlwigrovjcdzxxphqlsrzihmgzrioqrqetkzfbldjiemsfzbhzfnwywmyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy...

output:

280875 99460720
228933 99460720
227477 99460720
226801 99460720
226128 99460720
225456 99460720
224785 99460720
224115 99460720
223446 99460720
222778 99460720
222111 99460720
221445 99460720
220780 99460720
220116 99460720
219453 99460720
218791 99460720
218130 99460720
217470 99460720
216811 99460...

result:

ok 750 lines

Test #5:

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

input:

1000
yyxpquyxpquyxpquyxpquyxpquyxpquyxpquyxpquyxpquyxpquyxyquyxpquyypquyxpquyxpquyxpquyxpquyxyquyxpquyxpyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy...

output:

499500 997873281764292676
428016 997873281764292676
407138 997873281764292676
404370 997873281764292676
403406 997873281764292676
402446 997873281764292676
401492 997873281764292676
400543 997873281764292676
399597 997873281764292676
398654 997873281764292676
397726 997873281764292676
396801 9978732...

result:

ok 1000 lines

Test #6:

score: 5
Accepted
time: 2ms
memory: 14916kb

input:

1000
ufvqqevcpcjpmjhpuacsiasptskqyhitauzfablpqlkukahmlivzaprotlqdiuoeeykiqzahfavzzrfrzzemiyzvobxuojorawuyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy...

output:

499500 994651547059417160
408358 994651547059417160
404556 994651547059417160
403651 994651547059417160
402753 994651547059417160
401856 994651547059417160
400960 994651547059417160
400065 994651547059417160
399171 994651547059417160
398278 994651547059417160
397386 994651547059417160
396495 9946515...

result:

ok 1000 lines

Test #7:

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

input:

2000
yisjkyisjkyisjkyisjkyisjkyisjkyisjkyisjkyisjkyisjkyisjkyisjkyisjyyisjkyisjkyisjkyisjyyisjkyisjkyisjyyisjkyisjkyisjkyisjkyisjkyisjkyiyjkyisjkyisjyyisjkyisjkyisjkyisykyisjkyisjkyisjkyisjkyisjkyisjkyisjyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy...

output:

1999000 997220632557111954
1707638 997220632557111954
1629696 997220632557111954
1620455 997220632557111954
1618416 997220632557111954
1616384 997220632557111954
1614380 997220632557111954
1612383 997220632557111954
1610392 997220632557111954
1608407 997220632557111954
1606429 997220632557111954
160...

result:

ok 2000 lines

Test #8:

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

input:

2000
kfjzifydlimlbcikxuqhsdhzkuurcqqukqeudywkqejhrbtmdhnoyqsxevpmzwainltqupqtomolcbwlhobszmwhmclekitsiragstvjkstvjkstvjkstvjkstvjkstvjkstvjkstvjkstvjkstvjkstvjkstvjkstvjkstvjkstvjkstvjkstvjkstvjkstvjkstvjyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy...

output:

1999000 999779472717753420
1627752 999779472717753420
1620016 999779472717753420
1618195 999779472717753420
1616377 999779472717753420
1614561 999779472717753420
1612747 999779472717753420
1610934 999779472717753420
1609122 999779472717753420
1607311 999779472717753420
1605501 999779472717753420
160...

result:

ok 2000 lines

Test #9:

score: 5
Accepted
time: 76ms
memory: 33784kb

input:

99991
jkfuewizynextldskyvvtntwtciajvawlycikgpsboddojcqmcdcrkwwojxzxviaigefgjadwfjxzbuosftlaqjdjcautphjxxyfcqumvqetxuqidrkeqpvpekbybddypwfazagrvwbdyfkkndeytkptcsrpnbygwpzeipbseyvyqcfulhranbscrzjzxghpdmtnbtqtuukznppnrpblccgmbjgxlnzfufxlesdwnghnbrfxlegugilossxyxycfornwgtjhxuojsajkkmzlthtbaefhlfekbtigui...

output:

4999050045 1000000000000000000
192257116 1000000000000000000
7396985 999023997374801902
285304 996613325555096340
11066 987366165970503448
436 942986931170000909
9 192230346497810339
1 -309626952698982272
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
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 99991 lines

Test #10:

score: 5
Accepted
time: 62ms
memory: 29696kb

input:

99991
hufyxaiiojcxmvuiafrvwahkgmhwluvmhadvfoadukpjksusarwkxrahobwzevkwtfuofyhugqjgnlbonxsbimgcbmuruexltzbylckparzzlkswdlpkcvyibqizxxwpxavrvvaxynttazmaguqynhjumlthdinypdtaopojkrqgmkxtmergcefqgpepkamycinacstheaatpokkcnnwowdsymykrfhgxvunpdmcppdpoykcqwdbpmppirgjhxlridaivuosrbakjqadhtdrnkccpmqhgnygwulaet...

output:

4999050045 1000000000000000000
192263210 1000000000000000000
7397014 999329359000000000
284213 996665835000000000
10926 981569601668597568
410 943003222342727040
11 687932476088996908
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
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 99991 lines

Test #11:

score: 5
Accepted
time: 75ms
memory: 31036kb

input:

100000
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa...

output:

4999950000 1
4999250039 1
4998450142 1
4997650309 1
4996850540 1
4996050835 1
4995251194 1
4994451617 1
4993652104 1
4992852655 1
4992053270 1
4991253949 1
4990454692 1
4989655499 1
4988856370 1
4988057305 1
4987258304 1
4986459367 1
4985660494 1
4984861685 1
4984062940 1
4983264259 1
4982465642 1
4...

result:

ok 100000 lines

Test #12:

score: 5
Accepted
time: 167ms
memory: 57996kb

input:

200000
jmzhvqnlcbtiqjxdafwqxudmphrvvoekulwyscwgcorhxryphomcmzyyqfowbhebqmcyliwqfhpnuptzotaxldmxwalangsjpoygvjhqbxxwxcvjhqbxxwxcvjhqbxxwxcvjhqbxxwxcvjhqbxxwxcvjhqbxxwxcvjhqbxxwxcvjhqbxxwxcvjhqbxxwxcvjhqbxxwxcvjhqbxxwxcvjhqbxxwxcvjhqbxxwxcvjhqbxxwxcvjhqbxxwxcvjhqbxxwxcvjhqbxxwxcvjhqbxxwxcvjhqbxxwxcvjh...

output:

19999900000 1
3195202338 1
1995922106 1
1995862142 1
1995842163 1
1995822184 1
1995802205 1
1995782226 1
1995762247 1
1995742268 1
1995722289 1
1995702310 1
1995682332 1
1995662354 1
1995642376 1
1995622398 1
1995602420 1
1995582442 1
1995562464 1
1995542486 1
1995522508 1
1995502530 1
1995482553 1
...

result:

ok 200000 lines

Test #13:

score: 5
Accepted
time: 371ms
memory: 70932kb

input:

300000
bababbabaabbbbbbbaabbbaaabbaaabaaabbbabbbbbabbabbbabaaabbbbaabbbbaaabababbbabaabbabbbbabbbabaaababbbaaaaaababbabbabbbaaababbbabaaaaaaaaaabbaabaabaabbabbabbbbabaababbbbababbbabbabbbbaaaabbaabbbababababaabbabaaaabbbbbbbbbabbbbaaaaaaaaaababbbbbababbbabbbbabbabbbbbbbbbbbaabbbaabaabbbbabbabaababbb...

output:

44999850000 1
22499860609 1
11249786351 1
5624785965 1
2812329801 1
1406104358 1
703122339 1
351603532 1
175851213 1
87954688 1
43995139 1
22008053 1
11047594 1
5587723 1
2859492 1
1526325 1
860192 1
529280 1
365522 1
283451 1
243481 1
224276 1
215045 1
210491 1
208416 1
207521 1
207106 1
206907 1
2...

result:

ok 300000 lines

Test #14:

score: 5
Accepted
time: 299ms
memory: 76724kb

input:

300000
yvsktzpfklkhfnuhptasnazpugsnfwyohpshtichibrluvqndfyqbwhtsswyxjsoyhweaqmqedyreoxpvnyzcnnvhxywoooebdqvgdxcbcnavlgdxcbcnavlgdxcbcnavlgdxcbcnavlgdxcbcnavlgdxcbcnavlgdxcbcnavlgdxcbcnavlgdxcbcnavlgdxcbcnavlgdxcbcnavlgdxcbcnavlgdxcbcnavlgdxcbcnavlgdxcbcnavlgdxcbcnavlgdxcbcnavlgdxcbcnavlgdxcbcnavlgdx...

output:

44999850000 1
5394601964 1
4493972061 1
4493822124 1
4493762163 1
4493732184 1
4493702205 1
4493672226 1
4493642247 1
4493612268 1
4493582289 1
4493552310 1
4493522332 1
4493492354 1
4493462376 1
4493432398 1
4493402420 1
4493372442 1
4493342464 1
4493312486 1
4493282508 1
4493252530 1
4493222553 1
...

result:

ok 300000 lines

Test #15:

score: 5
Accepted
time: 73ms
memory: 33444kb

input:

100000
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa...

output:

4999950000 1000000000000000000
4999050063 1000000000000000000
4998050226 1000000000000000000
4997050489 1000000000000000000
4996050852 1000000000000000000
4995051315 1000000000000000000
4994051878 1000000000000000000
4993052541 1000000000000000000
4992053304 1000000000000000000
4991054167 1000000000...

result:

ok 100000 lines

Test #16:

score: 5
Accepted
time: 80ms
memory: 37512kb

input:

100000
gomybwamxftmutuwgzvissuiewapzcztvtvbowslcegtzrjxqlziviuavnzykfunvzwvzhwdgyiaslratbdrcmtqsfklbbnuxkhdteuaybxjhrkacvdqxuqyrclynhmnskedcnvslkboanoopqaqnolbimapontqmgbhcostjbgslklcgdekvadptkicijfovnaihnrtmqeiblebpkfxjgqrqovxrvygrycpfryvefrnoysggkliqtyiskltzsjklybkgzgrqqgheztmnjxuktclfonyvoujklvai...

output:

4999950000 1000000000000000000
193056954 1000000000000000000
8164719 999771514013239348
1094549 999574837586297120
813076 999574837586297120
801924 999574837586297120
801618 999574837586297120
801601 999574837586297120
801584 999574837586297120
801567 999574837586297120
801550 999574837586297120
801...

result:

ok 100000 lines

Test #17:

score: 5
Accepted
time: 230ms
memory: 51508kb

input:

200000
aabababbbaaaabbbbbbbabaaabaaaaaaabaaababaaababbabbabbbbbaabaaaabbbaaabbabbbbbbbbbbaabbbbabaaabaababababbaaabaababaabbabaabbabaaaababbbabababbbbbbbaabababbbabbabababbbbabaaaabaaabbbbaaaaabaabaabbaaabbbbbababbbaaabbababbbabbbabaabaaaabbaabbaabbbbbbaaabbbaaababaababbbbbababbababbaaabaabbbbabbbab...

output:

19999900000 1000000000000000000
9999903600 1000000000000000000
4999853841 1000000000000000000
2499853021 1000000000000000000
1249874362 1000000000000000000
624892814 1000000000000000000
312470665 1000000000000000000
156245952 999968173000000000
78133895 999968173000000000
39066322 999848394160616010...

result:

ok 200000 lines

Test #18:

score: 5
Accepted
time: 183ms
memory: 57628kb

input:

200000
foyorwsdobxplxrtvjopjvqcettbxeemcyihlspvhsfoaelerivojwwqzcvbkvpmsyuknfexllnauhvobpwyhndqbmllpzapjxychsvnmunmagwnbhhoprkyrmnmowygsioyvmfipvqoklcdxwcthtiasdotwcmnzbdkqnolsfllqmovgdcbozlqoqaumlmbfvedakusywgltbjtuytjmyzfkddyewrdsilecumcqqxzcctjbzfvqogiwooytexasinwohexptgdtxyinabqrafefrdxhfktrocak...

output:

19999900000 1000000000000000000
774135747 1000000000000000000
35121304 999730000756931088
6858948 999266856000000000
5813898 999073581000000000
5758909 999073581000000000
5748467 999073581000000000
5748409 999073581000000000
5748351 999073581000000000
5748293 999073581000000000
5748235 9990735810000...

result:

ok 200000 lines

Test #19:

score: 5
Accepted
time: 279ms
memory: 64912kb

input:

300000
vxaychagqqvywvquirkkpahbblihyplhxijpaucmiffhtrhptosxlvjmkcjtknwqwluioijkvrpfbarplbjyupydfvjbpdegxghovhxbjxpgxmctpznarnmumjblxozxohtghpnqavcbckyoesrufgsbiccwlupmtncifwztsgiquqrtyjfdsuhiarpigoddbaalqineqizbouwhhmdftlyoqqdyuaerbsrimnskbluidqehlvqozeqoxrsolgraspwsyhbiubjkvmbeyoangdslogspcihppxqmf...

output:

44999850000 1000000000000000000
1735116652 1000000000000000000
73609946 999986089000000000
9295081 999100914583394747
7047345 999100914583394747
6975348 999100914583394747
6973437 999100914583394747
6971573 999100914583394747
6969709 999100914583394747
6967845 999100914583394747
6965981 999100914583...

result:

ok 300000 lines

Test #20:

score: 5
Accepted
time: 331ms
memory: 76356kb

input:

300000
pfnbnjwngghmwghvpnfkhgiyikbgiyygimohxgonmmzmhqwonftsowohpyjcreqohrbjayzyygqcdspyojdxiybavspyktrnadsimixfhqolagutuarwpdtogecsqbyuujrcqehelachyxzfkyhbjzasjndwegyyaskgbwjjrnpyqvvpihnepobovtoqufustenolvlqmlrxeadgmaflvcgrrpmvnnmjbsneebhcpcrqxrfohlugnstbyopjfpnpvifcpktmpbrlitcjepavsrwwdbhdxhvevtfpo...

output:

44999850000 1000000000000000000
1734971766 1000000000000000000
71721169 999819731878054944
7375509 999789963135323740
4836733 999789963135323740
4746400 999789963135323740
4742176 999789963135323740
4742144 999789963135323740
4742112 999789963135323740
4742080 999789963135323740
4742048 999789963135...

result:

ok 300000 lines

Extra Test:

score: 0
Extra Test Passed