QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#385197#7455. stcmzhouhuanyiAC ✓604ms14716kbC++141.5kb2024-04-10 16:21:302024-04-10 16:21:31

Judging History

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

  • [2024-04-10 16:21:31]
  • 评测
  • 测评结果:AC
  • 用时:604ms
  • 内存:14716kb
  • [2024-04-10 16:21:30]
  • 提交

answer

#include<iostream>
#include<cstdio>
#include<vector>
#define N 100000
using namespace std;
int read()
{
	char c=0;
	int sum=0;
	while (c<'0'||c>'9') c=getchar();
	while ('0'<=c&&c<='9') sum=sum*10+c-'0',c=getchar();
	return sum;
}
int n,dfn[N+1],rev[N+1],leng,sz[N+1];
vector<int>E[N+1];
void dfs(int x)
{
	dfn[x]=++leng,rev[dfn[x]]=x,sz[x]=1;
	for (int i=0;i<E[x].size();++i) dfs(E[x][i]),sz[x]+=sz[E[x][i]];
	return;
}
void adder(int x)
{
	printf("+%d",x);
	return;
}
void undo()
{
	printf("-");
	return;
}
void get(int x)
{
	printf("=%d",x);
	return;
}
void solve(int l,int r,vector<int>p)
{
	if (p.empty()) return;
	if (l==r)
	{
		get(p[0]);
		return;
	}
	int mid=(l+r)>>1,sl=l,sr=r;
	vector<int>A;
	vector<int>B;
	for (int i=0;i<p.size();++i)
	{
		if (dfn[p[i]]+sz[p[i]]-1<=mid) A.push_back(p[i]);
		else if (dfn[p[i]]>=mid+1) B.push_back(p[i]);
		else
		{
			while (sl<dfn[p[i]]) adder(rev[sl++]);
			while (sr>dfn[p[i]]+sz[p[i]]-1) adder(rev[sr--]);
			get(p[i]);
		}
	}
	for (int i=1;i<=sl-l+r-sr;++i) undo();
	for (int i=mid+1;i<=r;++i) adder(rev[i]);
	solve(l,mid,A);
	for (int i=mid+1;i<=r;++i) undo();
	for (int i=l;i<=mid;++i) adder(rev[i]);
	solve(mid+1,r,B);
	for (int i=l;i<=mid;++i) undo();
	return;
}
int main()
{
	int x;
	vector<int>p;
    while (scanf("%d",&n)!=EOF)
	{
		p.clear(),leng=0;
		for (int i=1;i<=n;++i) E[i].clear();
		for (int i=2;i<=n;++i) x=read(),E[x].push_back(i);
		dfs(1);
		for (int i=1;i<=n;++i) p.push_back(i);
		solve(1,n,p),puts("!");
	}
	return 0;
}

詳細信息

Test #1:

score: 100
Accepted
time: 87ms
memory: 7680kb

input:

1000
1 1 2 1 1 2 2 7 2 7 3 11 10 6 4 8 10 13 16 2 19 7 6 18 6 2 16 27 21 14 6 14 14 29 12 13 3 27 28 27 2 34 26 27 44 14 30 25 7 50 47 1 36 24 4 32 10 20 53 52 61 23 43 39 2 15 47 9 14 54 48 53 36 14 14 66 76 55 17 67 21 22 18 25 67 75 7 48 21 6 35 11 31 41 63 28 6 98 51 3 29 52 102 77 27 58 39 64 9...

output:

=1+1+772+569+940+882+812+494+243+968+773+732+727+570+441+905+754+435+980+665+426+323+843+798+622+412+206+177+619+590+175+994+778+129+873+691+650+523+468+136+73+531+195+60+53+661+548+368+983+837+319+601+421+362+342+696+678+481+291+202+874+649+521+764+247+663+598+347+346+936+400+290+192+167+473+745+40...

result:

ok 15192 / 756071 / 447232

Test #2:

score: 0
Accepted
time: 522ms
memory: 10832kb

input:

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

output:

=1+50001+50002+50003+50004+50005+50006+50007+50008+50009+50010+50011+50012+50013+50014+50015+50016+50017+50018+50019+50020+50021+50022+50023+50024+50025+50026+50027+50028+50029+50030+50031+50032+50033+50034+50035+50036+50037+50038+50039+50040+50041+50042+50043+50044+50045+50046+50047+50048+50049+500...

result:

ok 1668928 / 2747877 / 2857332

Test #3:

score: 0
Accepted
time: 501ms
memory: 12212kb

input:

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

output:

=1+50001+50002+50003+50004+50005+50006+50007+50008+50009+50010+50011+50012+50013+50014+50015+50016+50017+50018+50019+50020+50021+50022+50023+50024+50025+50026+50027+50028+50029+50030+50031+50032+50033+50034+50035+50036+50037+50038+50039+50040+50041+50042+50043+50044+50045+50046+50047+50048+50049+500...

result:

ok 1668928 / 2927060 / 2434305

Test #4:

score: 0
Accepted
time: 412ms
memory: 12848kb

input:

100000
1 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 1...

output:

=1+1+96265+78531+74750+64808+22990+84286+83950+14298+95626+94310+85782+84809+82171+79119+71468+70493+67008+66737+65239+40239+17997+89033+43600+35789+15815+11723=2+2+98407+96113+77957=3+3+93291+78171+46017+53297+48174+26643+57682+57436+37049+32839+60501+38765+35736+30176+76275+65634+52948+27290+20655...

result:

ok 2372939 / 1450618 / 1891498

Test #5:

score: 0
Accepted
time: 517ms
memory: 10596kb

input:

100000
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 95 33 47 4 54 83 22 90 98 51 7 58 66 61 73 42 15 68 90 88 98 13 96 96 40 21 70 82 22 12 87 100 ...

output:

=1+1+2+381+485+486+508+692+798+1010+1041+1053+1134+1160+1241+1313+1428+1484+1571+1884+1890+2163+2275+2309+2451+2485+2486+2581+2586+2722+3219+3436+3588+3875+3918+3974+4016+4148+4535+4606+4663+4844+4934+5135+5339+5369+5421+5589+5730+6319+6372+6439+6546+6709+6771+7092+7201+7279+7401+7608+7612+7720+7768...

result:

ok 2226174 / 2535610 / 2794335

Test #6:

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

input:

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

output:

=1+1+2+24001+73548+77544+93019+25750+41529+48896+62734+65826+84330+86383+3+22340+40247+44433+49186+53098+54566+55471+57212+57559+60952+63636+82085+4+19177+20194+25053+53114+54067+67210+82208+5+13421+76482+21671+83372+41419+42731+46647+47858+57080+58855+60318+61026+71719+74665+6+28589+75316+40473+454...

result:

ok 2848029 / 2753263 / 2562265

Test #7:

score: 0
Accepted
time: 553ms
memory: 11068kb

input:

100000
1 1 1 1 1 1 1 1 1 7 2 3 11 4 9 5 6 9 10 6 10 3 6 6 7 7 6 4 7 6 7 8 4 7 9 8 8 9 6 4 9 4 9 10 4 2 8 9 9 7 4 5 3 10 8 6 6 8 7 8 7 7 11 2 7 11 6 5 8 6 4 5 10 7 10 11 11 3 4 8 9 7 11 11 3 3 9 6 2 6 3 2 5 10 11 9 6 2 6 8 10 11 3 6 8 3 3 8 6 5 6 3 3 4 7 8 11 7 11 6 2 9 7 8 5 4 11 9 5 4 7 10 10 9 7 3...

output:

=1+1+2+12+69115+75511+47+72996+65+66201+80964+90+66437+67145+93+73235+76293+98880+99+76728+122+91191+93115+96028+161+174+73967+87834+187+198+92747+205+206+91232+94721+210+91190+216+227+74760+84162+99066+230+235+60343+248+67846+83489+260+84912+90792+263+65958+268+285+306+309+67478+82079+310+67075+979...

result:

ok 2336867 / 2938115 / 2898988

Test #8:

score: 0
Accepted
time: 530ms
memory: 10168kb

input:

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

output:

=1+1+2+20+200+2000+20000+20001+20002+20003+20004+20005+20006+20007+20008+20009+2001+20010+20011+20012+20013+20014+20015+20016+20017+20018+20019+2002+20020+20021+20022+20023+20024+20025+20026+20027+20028+20029+2003+20030+20031+20032+20033+20034+20035+20036+20037+20038+20039+2004+20040+20041+20042+200...

result:

ok 2843097 / 2711169 / 2558386

Test #9:

score: 0
Accepted
time: 462ms
memory: 10216kb

input:

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

output:

=1+1+2+600+601+602+603+604+605+606+607+608+609+610+611+612+613+614+615+616+617+618+619+620+621+622+623+624+625+626+627+628+629+630+631+632+633+634+635+636+637+638+639+640+641+642+643+644+645+646+647+648+649+650+651+652+653+654+655+656+657+658+659+660+661+662+663+664+665+666+667+668+669+670+671+672+6...

result:

ok 2397904 / 2223953 / 2074893

Test #10:

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

input:

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

output:

=1+1+2+20000+20001+20002+20003+20004+20005+20006+20007+20008+20009+20010+20011+20012+20013+20014+20015+20016+20017+20018+20019+20020+20021+20022+20023+20024+20025+20026+20027+20028+20029+20030+20031+20032+20033+20034+20035+20036+20037+20038+20039+20040+20041+20042+20043+20044+20045+20046+20047+20048...

result:

ok 1888922 / 1703923 / 1379539

Test #11:

score: 0
Accepted
time: 327ms
memory: 14716kb

input:

100000
1 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 1...

output:

=1+1+100000=2+2+50001=3+3+50002=4+4+50003=5+5+50004=6+6+50005=7+7+50006=8+8+50007=9+9+50008=10+10+50009=11+11+50010=12+12+50011=13+13+50012=14+14+50013=15+15+50014=16+16+50015=17+17+50016=18+18+50017=19+19+50018=20+20+50019=21+21+50020=22+22+50021=23+23+50022=24+24+50023=25+25+50024=26+26+50025=27+2...

result:

ok 984462 / 1662786 / 1748842

Test #12:

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

input:

100000
1 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 1...

output:

=1+1+100000+99000+98000+97000+96000+95000+94000+93000+92000+91000+90000+89000+88000+87000+86000+85000+84000+83000+82000+81000+80000+79000+78000+77000+76000+75000+74000+73000+72000+71000+70000+69000+68000+67000+66000+65000+64000+63000+62000+61000+60000+59000+58000+57000+56000+55000+54000+53000+52000+...

result:

ok 1763623 / 1767406 / 1764708

Test #13:

score: 0
Accepted
time: 375ms
memory: 10016kb

input:

100000
1 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 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 1 2 3 4 5 6 7 8 ...

output:

=1+1+100000+99950+99900+99850+99800+99750+99700+99650+99600+99550+99500+99450+99400+99350+99300+99250+99200+99150+99100+99050+99000+98950+98900+98850+98800+98750+98700+98650+98600+98550+98500+98450+98400+98350+98300+98250+98200+98150+98100+98050+98000+97950+97900+97850+97800+97750+97700+97650+97600+...

result:

ok 1761524 / 1757613 / 1746403

Test #14:

score: 0
Accepted
time: 379ms
memory: 12128kb

input:

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

output:

=1+1+100000+99995+99990+99985+99980+99975+99970+99965+99960+99955+99950+99945+99940+99935+99930+99925+99920+99915+99910+99905+99900+99895+99890+99885+99880+99875+99870+99865+99860+99855+99850+99845+99840+99835+99830+99825+99820+99815+99810+99805+99800+99795+99790+99785+99780+99775+99770+99765+99760+...

result:

ok 1723920 / 1718926 / 2001877

Test #15:

score: 0
Accepted
time: 446ms
memory: 13460kb

input:

100000
1 2 3 4 5 6 7 8 9 10 1 2 3 4 5 6 7 8 9 10 11 6 23 24 25 26 27 28 29 30 31 6 23 24 25 26 27 28 29 30 31 32 27 44 45 46 47 48 49 50 51 52 27 44 45 46 47 48 49 50 51 52 53 48 65 66 67 68 69 70 71 72 73 48 65 66 67 68 69 70 71 72 73 74 69 86 87 88 89 90 91 92 93 94 69 86 87 88 89 90 91 92 93 94 9...

output:

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

result:

ok 2209265 / 2192299 / 2022902

Test #16:

score: 0
Accepted
time: 337ms
memory: 13440kb

input:

100000
1 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 1...

output:

=1+1+302=2+2+303=3+3+304=4+4+305=5+5+306=6+6+307=7+7+308=8+8+309=9+9+310=10+10+311=11+11+312=12+12+313=13+13+314=14+14+315=15+15+316=16+16+317=17+17+318=18+18+319=19+19+320=20+20+321=21+21+322=22+22+323=23+23+324=24+24+325=25+25+326=26+26+327=27+27+328=28+28+329=29+29+330=30+30+331=31+31+332=32+32+3...

result:

ok 1881634 / 1670378 / 1510481

Test #17:

score: 0
Accepted
time: 311ms
memory: 14108kb

input:

100000
1 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 1...

output:

=1+1+10002=2+2+10003=3+3+10004=4+4+10005=5+5+10006=6+6+10007=7+7+10008=8+8+10009=9+9+10010=10+10+10011=11+11+10012=12+12+10013=13+13+10014=14+14+10015=15+15+10016=16+16+10017=17+17+10018=18+18+10019=19+19+10020=20+20+10021=21+21+10022=22+22+10023=23+23+10024=24+24+10025=25+25+10026=26+26+10027=27+27...

result:

ok 1324385 / 2001877 / 950640

Test #18:

score: 0
Accepted
time: 541ms
memory: 13128kb

input:

100000
1 1 1 4 4 4 4 4 9 10 10 10 10 14 14 14 14 14 14 14 14 22 23 24 25 26 27 27 29 30 30 30 33 34 35 36 36 38 38 40 40 40 40 44 44 44 47 47 49 49 49 49 49 54 54 56 57 57 59 59 61 61 63 64 65 65 67 67 67 70 71 71 71 71 75 75 75 75 75 75 75 75 83 83 85 85 85 88 89 89 91 91 91 91 95 96 97 98 98 98 10...

output:

=1+1+2+3=4+4+5+6+7+8=9+9=10+10+11+12+13=14+14+15+16+17+18+19+20+21=22+22=23+23=24+24=25+25=26+26=27+27+28=29+29=30+30+31+32=33+33=34+34=35+35=36+36+37=38+38+39=40+40+41+42+43=44+44+45+46=47+47+48=49+49+50+51+52+53=54+54+55=56+56=57+57+58=59+59+60=61+61+62=63+63=64+64=65+65+66=67+67+68+69=70+70=71+71...

result:

ok 1878204 / 2942593 / 2928954

Test #19:

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

input:

100000
1 1 1 1 1 1 1 1 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 32 33 33 33 33 33 33 39 40 40 42 42 42 42 42 42 42 49 50 50 50 50 50 50 56 57 58 59 59 59 59 59 64 65 65 65 65 69 69 69 69 69 69 69 69 69 69 69 80 80 82 82 82 82 82 82 88 89 89 89 89 89 89 95 95 95 95 99 99 99 99 99 99 105 105 105 ...

output:

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

result:

ok 1984169 / 1757693 / 1879263

Test #20:

score: 0
Accepted
time: 460ms
memory: 12316kb

input:

100000
1 1 3 3 3 3 3 3 3 3 3 3 3 14 14 14 14 14 14 20 20 20 20 24 25 26 26 26 26 26 26 26 26 26 35 35 37 37 37 37 37 37 37 37 37 46 47 47 47 47 47 52 53 53 53 53 53 53 53 53 61 61 63 63 63 63 63 68 68 70 71 71 71 71 71 76 77 78 79 79 81 81 81 81 85 86 87 87 87 87 87 87 87 87 87 96 97 97 97 97 97 102...

output:

=1+1+2=3+3+4+5+6+7+8+9+10+11+12+13=14+14+15+16+17+18+19=20+20+21+22+23=24+24=25+25=26+26+27+28+29+30+31+32+33+34=35+35+36=37+37+38+39+40+41+42+43+44+45=46+46=47+47+48+49+50+51=52+52=53+53+54+55+56+57+58+59+60=61+61+62=63+63+64+65+66+67=68+68+69=70+70=71+71+72+73+74+75=76+76=77+77=78+78=79+79+80=81+8...

result:

ok 1846805 / 2398806 / 2591478

Test #21:

score: 0
Accepted
time: 564ms
memory: 11620kb

input:

100000
1 1 3 3 5 5 5 5 9 9 9 12 12 12 15 15 15 15 19 19 19 19 19 24 25 25 25 25 25 30 31 31 33 33 35 35 37 37 39 39 39 39 43 44 44 44 47 48 48 50 50 50 53 53 53 53 57 57 57 60 60 62 62 62 62 62 62 62 62 62 62 62 62 74 74 74 74 74 74 74 74 74 83 84 84 84 84 84 89 90 91 91 91 94 95 96 96 98 99 99 101 ...

output:

=1+1+2=3+3+4=5+5+6+7+8=9+9+10+11=12+12+13+14=15+15+16+17+18=19+19+20+21+22+23=24+24=25+25+26+27+28+29=30+30=31+31+32=33+33+34=35+35+36=37+37+38=39+39+40+41+42=43+43=44+44+45+46=47+47=48+48+49=50+50+51+52=53+53+54+55+56=57+57+58+59=60+60+61=62+62+63+64+65+66+67+68+69+70+71+72+73=74+74+75+76+77+78+79+...

result:

ok 2760476 / 2851969 / 2893921

Test #22:

score: 0
Accepted
time: 577ms
memory: 11532kb

input:

100000
1 1 3 3 3 3 3 3 3 10 10 10 10 10 10 16 17 17 17 20 21 21 23 23 23 23 23 23 23 30 31 32 32 34 34 36 36 38 38 38 41 42 43 43 45 45 45 48 48 48 48 52 52 54 55 55 55 55 59 59 61 62 62 62 65 66 66 66 66 66 71 72 72 74 74 76 77 78 79 80 81 81 83 83 85 86 86 86 86 86 91 92 93 93 95 95 95 95 95 100 1...

output:

=1+1+2=3+3+4+5+6+7+8+9=10+10+11+12+13+14+15=16+16=17+17+18+19=20+20=21+21+22=23+23+24+25+26+27+28+29=30+30=31+31=32+32+33=34+34+35=36+36+37=38+38+39+40=41+41=42+42=43+43+44=45+45+46+47=48+48+49+50+51=52+52+53=54+54=55+55+56+57+58=59+59+60=61+61=62+62+63+64=65+65=66+66+67+68+69+70=71+71=72+72+73=74+7...

result:

ok 2925591 / 2927393 / 2938705

Test #23:

score: 0
Accepted
time: 593ms
memory: 11556kb

input:

100000
1 1 3 3 3 3 3 8 8 10 11 12 12 14 14 14 14 14 14 20 21 21 21 21 25 25 25 25 25 30 30 30 30 30 35 35 35 38 38 38 38 42 42 42 45 46 46 46 46 50 50 50 53 53 53 53 53 53 53 53 53 62 63 63 63 63 67 67 67 70 70 70 73 74 75 76 77 78 79 80 81 81 81 80 85 85 85 80 89 89 89 92 79 94 95 95 95 94 99 99 99...

output:

=1+1+2=3+3+4+5+6+7=8+8+9=10+10=11+11=12+12+13=14+14+15+16+17+18+19=20+20=21+21+22+23+24=25+25+26+27+28+29=30+30+31+32+33+34=35+35+36+37=38+38+39+40+41=42+42+43+44=45+45=46+46+47+48+49=50+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...

result:

ok 2943385 / 2940255 / 2941634

Test #24:

score: 0
Accepted
time: 603ms
memory: 11564kb

input:

100000
1 1 1 4 4 6 6 8 9 9 11 12 13 14 15 16 17 18 19 19 19 18 23 23 23 18 27 27 27 30 17 32 33 33 33 32 37 37 37 32 41 41 41 44 17 46 47 47 47 50 46 52 52 52 55 46 57 57 57 60 16 62 63 64 64 64 63 68 68 68 63 72 72 72 75 62 77 78 78 78 77 82 82 82 77 86 86 86 89 62 91 92 92 92 95 91 97 97 97 100 91...

output:

=1+1+2+3=4+4+5=6+6+7=8+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...

result:

ok 2942230 / 2942619 / 2929553

Test #25:

score: 0
Accepted
time: 604ms
memory: 12044kb

input:

100000
1 2 3 4 5 5 5 8 8 8 8 12 12 14 15 15 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 34 36 33 38 38 32 41 42 41 44 31 46 47 48 47 50 46 52 52 54 30 56 57 58 58 60 57 62 62 64 56 66 67 67 66 70 70 29 73 74 75 76 76 78 75 80 80 82 74 84 85 85 84 88 73 90 91 92 91 94 90 96 96 98 28 100 101...

output:

=1+1=2+2=3+3=4+4=5+5+6+7=8+8+9+10+11+100000+99999+99998+99997+99996+99995+99994+99993+99992+99991+99990+99989+99988+99987+99986+99985+99984+99983+99982+99981+99980+99979+99978+99977+99976+99975+99974+99973+99972+99971+99970+99969+99968+99967+99966+99965+99964+99963+99962+99961+99960+99959+99958+9995...

result:

ok 2927763 / 2929520 / 2929448

Test #26:

score: 0
Accepted
time: 582ms
memory: 12116kb

input:

100000
1 2 3 3 5 5 5 8 8 8 8 8 8 8 8 16 17 18 18 18 18 18 23 23 23 23 27 27 27 30 31 31 33 34 35 35 35 35 35 35 35 35 43 44 44 44 44 44 44 50 51 51 53 53 53 53 53 58 58 58 58 62 62 64 65 65 65 68 69 70 70 70 70 70 70 70 77 77 77 80 81 81 81 81 81 81 81 88 88 90 91 91 91 94 94 96 97 97 97 100 100 100...

output:

=1+1=2+2=3+3+4=5+5+6+7=8+8+9+10+11+12+13+14+15=16+16=17+17=18+18+19+20+21+22=23+23+24+25+26=27+27+28+29=30+30=31+31+32=33+33=34+34=35+35+36+37+38+39+40+41+42=43+43=44+44+45+46+47+48+49=50+50+100000+99999+99998+99997+99996+99995+99994+99993+99992+99991+99990+99989+99988+99987+99986+99985+99984+99983+...

result:

ok 2927663 / 2923215 / 2920360

Test #27:

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

input:

100000
1 2 2 2 2 2 7 7 7 10 10 12 12 12 15 15 17 17 17 17 21 21 21 21 25 26 26 26 26 26 26 32 33 33 35 35 37 38 38 40 40 40 40 44 44 44 44 44 44 44 51 51 53 53 53 53 53 53 53 60 61 61 61 61 65 65 67 68 69 70 71 71 71 71 75 76 76 78 78 78 78 82 82 84 84 84 87 88 89 89 89 89 93 93 93 96 97 97 97 97 10...

output:

=1+1=2+2+3+4+5+6=7+7+8+9=10+10+11=12+12+13+14=15+15+16=17+17+18+19+20=21+21+22+23+24=25+25=26+26+27+28+29+30+31=32+32=33+33+34=35+35+36=37+37=38+38+39=40+40+41+42+43=44+44+45+46+47+48+49+50=51+51+52=53+53+54+55+56+57+58+59=60+60=61+61+62+63+64=65+65+66=67+67=68+68=69+69=70+70=71+71+72+73+74=75+75=76...

result:

ok 2898799 / 2839968 / 2783986

Test #28:

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

input:

100000
1 2 2 2 2 6 6 8 9 9 9 9 13 14 15 15 15 15 15 20 20 20 23 23 23 23 27 27 27 30 30 30 33 34 34 36 37 38 38 40 41 42 43 43 43 43 43 43 43 43 51 52 52 52 52 56 56 56 56 56 56 56 56 64 64 64 67 67 69 69 69 69 69 69 75 75 75 75 79 79 79 82 82 84 85 85 85 88 88 88 88 92 92 92 95 95 95 98 99 99 99 99...

output:

=1+1=2+2+3+4+5=6+6+7=8+8=9+9+10+11+12=13+13=14+14=15+15+16+17+18+19=20+20+21+22=23+23+24+25+26=27+27+28+29=30+30+31+32=33+33=34+34+35=36+36=37+37=38+38+39=40+40=41+41=42+42=43+43+44+45+46+47+48+49+50=51+51=52+52+53+54+55=56+56+57+58+59+60+61+62+63=64+64+65+66=67+67+68=69+69+70+71+72+73+74=75+75+76+7...

result:

ok 2681607 / 2474481 / 2253127

Test #29:

score: 0
Accepted
time: 402ms
memory: 13652kb

input:

100000
1 1 1 1 1 1 1 8 9 9 11 12 13 14 14 14 14 14 19 20 20 20 23 23 23 23 27 28 29 29 29 32 33 33 35 36 37 38 38 38 38 42 42 42 42 46 47 48 48 50 51 52 52 54 54 56 57 57 57 60 60 62 62 62 62 62 62 68 68 68 68 72 73 73 73 76 76 76 76 80 81 81 81 84 85 86 86 88 88 90 90 90 93 93 95 96 96 96 96 96 96 ...

output:

=1+1+2+3+4+5+6+7=8+8=9+9+10=11+11=12+12=13+13=14+14+15+16+17+18=19+19=20+20+21+22=23+23+24+25+26=27+27=28+28=29+29+30+31=32+32=33+33+34=35+35=36+36=37+37=38+38+39+40+41=42+42+43+44+45=46+46=47+47=48+48+49=50+50=51+51=52+52+53=54+54+55=56+56=57+57+58+59=60+60+61=62+62+63+64+65+66+67=68+68+69+70+71=72...

result:

ok 1987167 / 1815439 / 1757554

Test #30:

score: 0
Accepted
time: 532ms
memory: 12080kb

input:

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

output:

=1+1+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+1...

result:

ok 2721655 / 2710343 / 2688108

Test #31:

score: 0
Accepted
time: 537ms
memory: 12324kb

input:

100000
1 1 3 3 5 1 7 7 9 7 11 11 13 13 1 16 17 16 19 19 21 21 16 24 24 26 27 24 29 30 29 32 32 34 1 36 37 36 39 39 41 36 43 43 45 43 47 48 47 50 50 52 36 54 54 56 54 58 58 60 60 54 63 63 65 66 63 68 69 68 71 71 73 73 75 76 1 78 79 78 81 81 83 78 85 85 87 85 89 89 91 91 93 78 95 95 97 95 99 99 101 10...

output:

=1+1+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+1...

result:

ok 2885243 / 2782910 / 2547250

Test #32:

score: 0
Accepted
time: 463ms
memory: 13072kb

input:

100000
1 2 3 4 5 6 7 8 9 10 11 12 13 1 15 16 17 18 19 20 15 22 23 24 22 26 27 26 29 29 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 1 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 65 97 98 99 100 101...

output:

=1+1+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+1...

result:

ok 2345692 / 1942303 / 2878291

Test #33:

score: 0
Accepted
time: 569ms
memory: 12076kb

input:

100000
1 1 3 3 5 5 5 5 9 9 9 9 13 14 14 16 16 16 19 19 21 21 23 24 25 26 26 26 26 26 26 26 33 34 34 34 34 34 34 40 41 41 41 44 45 45 45 45 49 49 49 52 52 52 55 56 56 58 58 58 58 58 63 64 64 64 67 68 68 70 70 72 73 74 72 72 77 72 79 80 80 80 70 70 85 85 87 85 85 90 85 85 93 93 93 70 70 98 99 100 100 ...

output:

=1+1+2=3+3+4=5+5+6+7+8=9+9+10+11+12=13+13=14+14+15=16+16+17+18=19+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+...

result:

ok 2877357 / 2848555 / 2815450

Test #34:

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

input:

100000
1 1 3 3 3 3 3 8 8 8 11 12 13 13 13 13 13 13 13 13 13 13 13 13 13 26 26 28 29 29 29 29 29 29 29 36 36 36 39 40 40 40 40 40 45 46 46 46 49 49 51 52 53 54 55 56 56 56 56 56 56 62 62 62 62 62 62 68 68 68 68 72 72 74 75 75 75 75 79 79 79 82 83 84 84 86 87 88 88 88 88 92 92 92 92 96 97 97 97 97 97 ...

output:

=1+1+2=3+3+4+5+6+7=8+8+9+10=11+11=12+12=13+13+14+15+16+17+18+19+20+21+22+23+24+25=26+26+27=28+28=29+29+30+31+32+33+34+35=36+36+37+38=39+39=40+40+41+42+43+44=45+45=46+46+47+48=49+49+50=51+51=52+52=53+53=54+54=55+55=56+56+57+58+59+60+61=62+62+63+64+65+66+67=68+68+69+70+71=72+72+73=74+74=75+75+76+77+78...

result:

ok 2742469 / 2650911 / 2498238

Test #35:

score: 0
Accepted
time: 468ms
memory: 12316kb

input:

100000
1 1 1 1 1 6 6 8 8 8 11 12 12 14 14 14 14 18 19 19 19 19 19 19 19 26 27 27 29 29 29 29 29 29 29 29 29 38 38 38 41 41 41 41 45 45 47 47 47 47 47 47 53 54 54 54 54 54 54 54 54 54 54 54 54 54 67 67 69 70 70 70 70 70 70 70 70 70 70 70 70 70 83 83 85 86 87 87 89 89 91 92 92 92 92 92 92 92 99 99 99 ...

output:

=1+1+2+3+4+5=6+6+7=8+8+9+10=11+11=12+12+13=14+14+15+16+17=18+18=19+19+20+21+22+23+24+25=26+26=27+27+28=29+29+30+31+32+33+34+35+36+37=38+38+39+40=41+41+42+43+44=45+45+46=47+47+48+49+50+51+52=53+53=54+54+55+56+57+58+59+60+61+62+63+64+65+66=67+67+68=69+69=70+70+71+72+73+74+75+76+77+78+79+80+81+82=83+83...

result:

ok 2268640 / 2146663 / 2398547

Test #36:

score: 0
Accepted
time: 517ms
memory: 11988kb

input:

100000
1 1 1 1 1 1 1 1 9 10 10 12 12 14 14 16 16 16 16 16 21 21 23 24 25 25 25 25 29 29 31 31 31 34 35 36 36 36 39 39 41 41 43 43 43 46 46 48 49 49 49 49 53 53 53 56 56 58 59 59 59 59 59 59 59 59 59 59 69 69 69 72 73 73 73 73 77 78 79 79 79 79 79 79 79 86 87 87 89 89 89 92 93 93 95 95 95 98 99 99 99...

output:

=1+1+2+3+4+5+6+7+8=9+9=10+10+11=12+12+13=14+14+15=16+16+17+18+19+20=21+21+22=23+23=24+24=25+25+26+27+28=29+29+30=31+31+32+33=34+34=35+35=36+36+37+38=39+39+40=41+41+42=43+43+44+45=46+46+47=48+48=49+49+50+51+52=53+53+54+55=56+56+57=58+58=59+59+60+61+62+63+64+65+66+67+68=69+69+70+71=72+72=73+73+74+75+7...

result:

ok 2399454 / 2555953 / 2685097

Test #37:

score: 0
Accepted
time: 570ms
memory: 11620kb

input:

100000
1 2 2 2 2 6 6 8 8 8 8 8 8 8 8 8 8 8 19 20 20 20 23 23 23 23 23 28 28 28 31 31 31 31 35 36 36 36 36 36 41 41 41 44 44 46 46 46 49 49 49 49 49 49 49 56 56 56 56 56 61 61 61 61 65 65 65 68 69 69 69 72 73 74 74 76 76 76 76 80 80 80 80 84 84 84 84 84 84 90 91 91 91 91 95 96 96 96 96 96 101 101 101...

output:

=1+1=2+2+3+4+5=6+6+7=8+8+9+10+11+12+13+14+15+16+17+18=19+19=20+20+21+22=23+23+24+25+26+27=28+28+29+30=31+31+32+33+34=35+35=36+36+37+38+39+40=41+41+42+43=44+44+45=46+46+47+48=49+49+50+51+52+53+54+55=56+56+57+58+59+60=61+61+62+63+64=65+65+66+67=68+68=69+69+70+71=72+72=73+73=74+74+75=76+76+77+78+79=80+...

result:

ok 2760959 / 2823362 / 2844704

Test #38:

score: 0
Accepted
time: 559ms
memory: 12080kb

input:

100000
1 1 3 3 5 5 7 7 9 10 11 11 13 13 13 16 16 18 19 19 21 21 23 23 23 23 23 23 29 30 30 30 30 30 35 35 35 38 39 39 39 42 42 44 45 46 46 46 46 50 50 52 52 52 52 56 57 58 59 60 61 61 61 64 65 65 65 65 69 70 71 71 73 74 74 74 74 78 78 78 81 82 83 83 85 86 86 86 89 89 89 92 92 92 95 95 95 98 99 100 1...

output:

=1+1+2=3+3+4=5+5+6=7+7+8=9+9=10+10=11+11+12+100000+99999+99998+99997+99996+99995+99994+99993+99992+99991+99990+99989+99988+99987+99986+99985+99984+99983+99982+99981+99980+99979+99978+99977+99976+99975+99974+99973+99972+99971+99970+99969+99968+99967+99966+99965+99964+99963+99962+99961+99960+99959+999...

result:

ok 2856984 / 2870891 / 2872278

Test #39:

score: 0
Accepted
time: 573ms
memory: 12236kb

input:

100000
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 14 17 17 19 19 21 22 23 24 13 26 27 28 29 30 31 26 33 34 35 33 37 38 37 40 40 42 43 44 45 12 47 48 49 50 51 48 53 54 53 56 56 58 58 60 61 62 63 47 65 66 66 68 69 70 71 72 73 65 75 76 77 78 75 80 81 80 83 83 85 85 87 88 89 90 91 11 93 94 95 96 97 95 99 100 9...

output:

=1+1=2+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...

result:

ok 2868162 / 2839682 / 2778386

Test #40:

score: 0
Accepted
time: 524ms
memory: 12308kb

input:

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

output:

=1+1=2+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...

result:

ok 2667341 / 2651201 / 2634763

Test #41:

score: 0
Accepted
time: 523ms
memory: 12236kb

input:

100000
1 2 3 4 5 6 7 8 9 10 11 12 13 13 15 15 17 18 19 20 21 22 23 24 12 26 27 28 29 30 31 26 33 34 35 33 37 38 37 40 40 42 43 44 45 46 47 48 49 50 51 52 53 11 55 56 57 58 59 56 61 62 61 64 64 66 66 68 69 70 71 72 73 74 75 76 55 78 79 79 81 82 83 84 85 86 87 88 78 90 91 92 93 94 90 96 97 98 96 100 1...

output:

=1+1=2+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...

result:

ok 2634763 / 2610230 / 2594359

Test #42:

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

input:

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

output:

=1+1=2+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...

result:

ok 2574125 / 2549893 / 2523655

Test #43:

score: 0
Accepted
time: 489ms
memory: 12736kb

input:

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

output:

=1+1=2+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...

result:

ok 2502776 / 2466753 / 2433409

Test #44:

score: 0
Accepted
time: 555ms
memory: 12216kb

input:

100000
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 14 17 17 19 19 13 22 23 23 25 22 27 28 27 30 30 32 32 34 12 36 37 38 38 37 41 42 41 44 44 46 36 48 49 50 49 52 52 48 55 56 56 55 59 59 61 61 63 64 65 66 67 11 69 70 71 72 72 71 75 76 75 78 78 80 70 82 83 83 85 85 82 88 89 89 88 92 92 94 94 96 97 69 99 100 1...

output:

=1+1=2+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...

result:

ok 2796426 / 2780323 / 2762013

Test #45:

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

input:

100000
1 2 3 4 5 6 7 8 9 10 11 12 13 14 14 16 16 18 13 20 21 21 20 24 25 24 27 27 29 30 12 32 33 34 34 33 37 37 39 39 41 32 43 44 44 46 46 43 49 50 49 52 52 54 54 56 57 58 59 60 11 62 63 64 65 65 64 68 68 70 70 63 73 74 74 76 73 78 79 78 81 81 83 83 85 86 62 88 89 90 90 92 89 94 95 94 97 97 99 88 10...

output:

=1+1=2+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...

result:

ok 2745191 / 2721356 / 2695062

Test #46:

score: 0
Accepted
time: 532ms
memory: 12672kb

input:

100000
1 2 3 4 5 6 7 8 9 10 11 12 13 14 14 16 16 13 19 20 19 22 22 24 24 26 12 28 29 30 29 32 32 34 28 36 37 37 39 36 41 42 41 44 44 46 47 48 49 50 51 11 53 54 55 56 55 58 58 60 54 62 63 64 62 66 67 66 69 69 71 72 73 53 75 76 77 78 76 80 80 82 82 84 75 86 87 87 89 89 86 92 93 94 92 96 96 98 98 100 1...

output:

=1+1=2+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...

result:

ok 2669705 / 2642565 / 2611826

Test #47:

score: 0
Accepted
time: 532ms
memory: 12332kb

input:

100000
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 13 17 17 19 19 21 22 12 24 25 25 27 28 24 30 31 32 30 34 34 36 36 38 39 40 41 42 11 44 45 46 46 48 49 45 51 52 51 54 54 56 56 58 59 44 61 62 63 62 65 65 67 68 61 70 71 71 73 70 75 76 75 78 78 80 80 82 83 84 85 86 87 88 89 90 91 92 93 94 95 10 97 98 99 100 1...

output:

=1+1=2+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...

result:

ok 2577140 / 2908217 / 2925713

Test #48:

score: 0
Accepted
time: 553ms
memory: 12096kb

input:

100000
1 1 3 4 5 1 7 8 9 7 11 11 13 13 15 1 17 18 17 20 20 22 23 17 25 25 27 28 25 30 31 30 33 33 35 36 1 38 39 38 41 41 43 44 38 46 47 48 46 50 51 50 53 53 55 38 57 58 59 57 61 61 63 63 65 57 67 67 69 70 67 72 73 72 75 75 77 77 79 80 1 82 82 84 84 86 87 82 89 90 91 89 93 94 93 96 96 98 82 100 101 1...

output:

=1+1+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+1...

result:

ok 2909967 / 2896479 / 2831838

Test #49:

score: 0
Accepted
time: 583ms
memory: 11704kb

input:

100000
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 23 23 22 28 22 30 21 32 33 32 32 21 37 20 39 40 40 42 39 44 39 20 47 47 19 50 51 52 52 54 51 56 51 50 59 59 61 50 19 64 64 18 67 68 69 70 70 72 69 74 69 68 77 77 79 68 67 82 83 83 82 82 67 88 18 90 90 92 17 94 95 96 97 98 98 97 97...

output:

=1+1=2+2+100000+99999+99998+99997+99996+99995+99994+99993+99992+99991+99990+99989+99988+99987+99986+99985+99984+99983+99982+99981+99980+99979+99978+99977+99976+99975+99974+99973+99972+99971+99970+99969+99968+99967+99966+99965+99964+99963+99962+99961+99960+99959+99958+99957+99956+99955+99954+99953+99...

result:

ok 2913060 / 2895119 / 2659404

Test #50:

score: 0
Accepted
time: 547ms
memory: 11600kb

input:

100000
1 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 44 43 42 42 41 41 40 52 40 39 55 55 39 38 59 60 59 38 37 64 65 66 65 64 37 36 71 72 73 73 72 71 71 36 35 80 81 82 83 82 81 81 80 80 35 35 34 92 93 94 95 96 95 94 93 93 92...

output:

=1+1=2+2+100000+99999+99998+99997+99996+99995+99994+99993+99992+99991+99990+99989+99988+99987+99986+99985+99984+99983+99982+99981+99980+99979+99978+99977+99976+99975+99974+99973+99972+99971+99970+99969+99968+99967+99966+99965+99964+99963+99962+99961+99960+99959+99958+99957+99956+99955+99954+99953+99...

result:

ok 2727466 / 2601576 / 2667475

Test #51:

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

input:

100000
1 2 3 4 5 6 7 8 9 10 11 12 13 14 14 14 14 14 14 14 14 14 14 13 25 25 25 25 25 25 13 13 13 13 12 36 37 37 37 37 37 37 37 36 45 45 45 36 36 36 36 12 12 12 12 12 12 11 59 60 61 61 61 61 61 61 61 60 69 69 69 60 60 60 60 60 59 78 78 78 78 78 78 78 78 78 78 78 59 59 59 59 59 59 59 11 11 11 11 11 11...

output:

=1+50001+50002+50003+50004+50005+50006+50007+50008+50009+50010+50011+50012+50013+50014+50015+50016+50017+50018+50019+50020+50021+50022+50023+50024+50025+50026+50027+50028+50029+50030+50031+50032+50033+50034+50035+50036+50037+50038+50039+50040+50041+50042+50043+50044+50045+50046+50047+50048+50049+500...

result:

ok 2552326 / 2491420 / 2631809

Test #52:

score: 0
Accepted
time: 456ms
memory: 10716kb

input:

100000
1 2 3 4 5 6 7 8 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9...

output:

=1+50001+50002+50003+50004+50005+50006+50007+50008+50009+50010+50011+50012+50013+50014+50015+50016+50017+50018+50019+50020+50021+50022+50023+50024+50025+50026+50027+50028+50029+50030+50031+50032+50033+50034+50035+50036+50037+50038+50039+50040+50041+50042+50043+50044+50045+50046+50047+50048+50049+500...

result:

ok 2142927 / 2226180 / 2225188

Test #53:

score: 0
Accepted
time: 465ms
memory: 10708kb

input:

100000
1 2 3 4 5 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 11 59 59 59 59 59 59 59 59 59 59 59 59 59 59 59 59 59 59 59 59 59 59 59 59 59 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11...

output:

=1+50001+50002+50003+50004+50005+50006+50007+50008+50009+50010+50011+50012+50013+50014+50015+50016+50017+50018+50019+50020+50021+50022+50023+50024+50025+50026+50027+50028+50029+50030+50031+50032+50033+50034+50035+50036+50037+50038+50039+50040+50041+50042+50043+50044+50045+50046+50047+50048+50049+500...

result:

ok 2376974 / 2327478 / 2342310

Test #54:

score: 0
Accepted
time: 501ms
memory: 11024kb

input:

100000
1 2 3 4 5 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 11 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 10 97 98 98 98 98...

output:

=1+1+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+1...

result:

ok 2506921 / 2582460 / 2464823

Test #55:

score: 0
Accepted
time: 522ms
memory: 10728kb

input:

100000
1 2 3 4 5 6 7 8 9 10 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 10 87 87 87 87 87 87 87 87 87 87 87 87 87 87 87...

output:

=1+1+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+1...

result:

ok 2437608 / 2473451 / 2536880