QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#86781#4406. 独立集问题Crysfly97 153ms115264kbC++141.6kb2023-03-10 21:42:362023-03-10 22:03:07

Judging History

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

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2023-03-10 22:03:07]
  • 评测
  • 测评结果:97
  • 用时:153ms
  • 内存:115264kb
  • [2023-03-10 21:42:36]
  • 提交

answer

#include<bits/stdc++.h>
#define For(i,a,b) for(int i=(a);i<=(b);++i)
#define Rep(i,a,b) for(int i=(a);i>=(b);--i)
#define int long long
using namespace std;
inline int read()
{
	char c=getchar();int x=0;bool f=0;
	for(;!isdigit(c);c=getchar())f^=!(c^45);
	for(;isdigit(c);c=getchar())x=(x<<1)+(x<<3)+(c^48);
	return f?-x:x;
}

#define fi first
#define se second
#define pb push_back
#define mkp make_pair
typedef pair<int,int>pii;
typedef vector<int>vi;

#define maxn 1000005
#define inf 0x3f3f3f3f3f3f3f3f

int n,fa[maxn],w[maxn][2];
vi e[maxn];

int f[maxn][2],g[maxn][2][2],mxg[maxn],mx[2];
void dfs(int u)
{
	for(int v:e[u])dfs(v);
	
	For(i,0,1)f[u][i]=w[u][i];
	mx[0]=mx[1]=0;
	for(int v:e[u])
		For(i,0,1)mx[i]+=max(f[v][i],mxg[v]);
	For(i,0,1)f[u][i]+=max(mx[0],mx[1]);
	
	For(i,0,1)g[u][i][1]=w[u][!i];
	mx[0]=mx[1]=0;
	for(int v:e[u])
		For(i,0,1)mx[i]+=max(f[v][i],max(g[v][0][0],g[v][1][0]));
	For(i,0,1)g[u][i][1]+=mx[i];
	
	For(i,0,1){
		g[u][i][0]=-inf;
		for(int v:e[u]){
			For(c,0,1){
				int now=w[u][c]+max(g[v][c][0],g[v][c][1]);
				for(int w:e[u])
					if(w!=v) now+=max(f[w][i],mxg[w]);
				g[u][i][0]=max(g[u][i][0],now);
			}
		}
	}
	
	mxg[u]=-inf;
	For(i,0,1)For(j,0,1)mxg[u]=max(mxg[u],g[u][i][j]);
	
//	cout<<"f: "<<u<<"\n";
//	For(i,0,1)cout<<f[u][i]<<" ";puts("");
//	For(i,0,1)For(j,0,1)cout<<g[u][i][j]<<" \n"[j==1];
}

signed main()
{
	n=read();
    memset(f,-63,sizeof f);
    For(i,1,n)w[i][0]=read(),w[i][1]=-w[i][0];
    For(i,2,n)fa[i]=read(),e[fa[i]].pb(i);
    dfs(1);
    cout<<mxg[1];
	return 0;
}

详细

Subtask #1:

score: 13
Accepted

Test #1:

score: 13
Accepted
time: 55ms
memory: 113760kb

input:

351493
-641495974 -401868912 -864400429 35718599 -579296290 767835327 149511992 -246228754 649472235 893048442 -292675192 -788090312 -578172296 -62289673 196890164 -120059197 -452848333 -216788131 -604555771 -240241020 376984486 -407661514 -107574590 -461679558 -470560314 -583391402 -991686079 76956...

output:

175477002777567

result:

ok 1 number(s): "175477002777567"

Test #2:

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

input:

351493
-56100243 368534199 129964394 -89815018 -91235204 957523014 -460852634 -325788014 -402912154 321855921 454630730 558766063 227409254 -961488779 421605421 691666242 -230378151 -162955273 -236886327 -612720805 897977225 -86952503 798514303 108426380 652820044 -570978053 -646910035 -167973689 -7...

output:

175582921565606

result:

ok 1 number(s): "175582921565606"

Test #3:

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

input:

351493
763351894 914829770 269353066 -650659200 -281614670 -384638266 266301720 599060286 929263636 -383459829 900862182 -735284265 -207058691 -896484301 821480927 90661512 -679895618 -995726473 511471086 669880712 461077012 -131405343 997734902 -904033660 245840121 355028008 -909036951 530267463 93...

output:

175928061618383

result:

ok 1 number(s): "175928061618383"

Test #4:

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

input:

351493
-476871284 310380923 -524195986 740923407 -507205286 -708342444 845300375 163395319 -118327194 -777909892 -864449914 19995101 -709759263 -967727722 922294345 -493915772 -812562398 -365413759 787107009 4270638 -295451830 -162056816 -884264923 -870042647 -996069213 573972294 155864269 -58906286...

output:

175650564210340

result:

ok 1 number(s): "175650564210340"

Test #5:

score: 0
Accepted
time: 59ms
memory: 113676kb

input:

351493
-173531743 557238083 -824113374 -84997552 -528741973 -448737148 -646930897 649003342 -608133665 912285973 -922564290 602546534 116884217 -500565119 526827675 123739579 41774236 205999423 15304413 861611850 39040664 895088899 43155838 -326769005 671029213 124031672 249778755 -644568506 9118445...

output:

175833127330368

result:

ok 1 number(s): "175833127330368"

Test #6:

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

input:

351493
867082022 -654438792 -563132739 -602771213 -498674813 -925363988 -32298673 -538019554 -334530735 571873145 -583030757 -378539176 119681995 -90196121 460241188 -516789360 211603768 -509897029 -852347880 830444888 269349329 -428858753 -137073395 130042891 644002528 -137140981 979900884 36818325...

output:

175483737223472

result:

ok 1 number(s): "175483737223472"

Test #7:

score: 0
Accepted
time: 64ms
memory: 113708kb

input:

351493
-447335302 -476762578 372057221 936789657 357038272 909731828 -683347165 637447470 913095563 316451704 414765801 786600053 -65647567 924518593 -769778430 -347838583 923771357 54765382 355559903 -210849764 194278668 612466423 120679972 -184875188 -467919689 -45407455 -881561838 -591488257 2692...

output:

175817072416071

result:

ok 1 number(s): "175817072416071"

Test #8:

score: 0
Accepted
time: 70ms
memory: 114940kb

input:

351493
402240742 668233786 -889881161 457723983 862248981 -258221456 961999793 -357283684 -906564302 -597314876 739970397 -677435760 -950807663 -637315042 -933332320 277627831 540469730 711450896 -516333572 663145310 104913901 -511477049 703469693 -593297236 -407591592 804894830 504458817 -220727610...

output:

175806964829997

result:

ok 1 number(s): "175806964829997"

Test #9:

score: 0
Accepted
time: 71ms
memory: 113784kb

input:

351493
76730680 435846940 -794852623 555620609 -611204625 838568963 -703848513 -448239085 -115097249 -41368701 370845103 -523596605 -574028136 -999717105 -940170307 -882957379 168314209 462026163 -596102197 223187871 -231867307 165204442 -217815785 982666489 616325768 -834213481 -7172241 587603787 9...

output:

175645279435054

result:

ok 1 number(s): "175645279435054"

Test #10:

score: 0
Accepted
time: 51ms
memory: 114820kb

input:

351493
-418521650 -556841193 201271611 -455552220 660456263 -188352499 400020859 986402784 -477116947 -886627587 -840995307 438113972 -154696898 -817068532 -876194676 -576445413 -955919626 -10695871 313744268 -647421383 -836372934 -41870379 -384156565 570580595 136462961 602569688 644933476 52733996...

output:

175802261388786

result:

ok 1 number(s): "175802261388786"

Test #11:

score: 0
Accepted
time: 49ms
memory: 113804kb

input:

351493
-130691318 904648843 -732528532 646985259 8633249 -936982284 497541179 640396747 650407531 458099270 -690004072 889148550 -350891786 120609938 -210082522 -729055455 -507136771 754502959 742704465 -771332127 41517881 815637674 193201716 -748352958 816227236 8740519 661093724 -269939318 7725096...

output:

175701865379333

result:

ok 1 number(s): "175701865379333"

Test #12:

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

input:

351493
-66854912 -950343871 -199904682 509621680 495040850 929289473 158195385 24793111 617279847 -851601360 -376102480 -28253220 526524472 165842584 -938843661 -255803056 427156408 -921301927 -493038885 -301127735 -392384028 -897791614 -404752254 -331044497 640039210 -718591427 -655295253 -78657017...

output:

175609650615928

result:

ok 1 number(s): "175609650615928"

Test #13:

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

input:

351493
78301096 -52604596 821967420 17665215 -854562351 531797012 531579374 -630259969 483552256 -406544826 -444229744 -36337606 -923613351 572356707 150744251 -893122680 -867494723 -787026829 -57721719 854240591 -997955163 -521393917 -601344208 428938884 -361341200 -930370842 511195865 657470791 -9...

output:

175839770381205

result:

ok 1 number(s): "175839770381205"

Test #14:

score: 0
Accepted
time: 54ms
memory: 113760kb

input:

351493
-386682919 -77525384 946023467 359887410 608228613 -61098422 -221702696 677632268 -464778216 -208646176 376278620 -174464731 -71286142 545647495 775301975 360115639 210057946 930655420 -285693349 264575602 -205129496 148376086 -723599206 671466170 -516424717 -456455162 -412650777 -833372579 -...

output:

175710205504618

result:

ok 1 number(s): "175710205504618"

Test #15:

score: 0
Accepted
time: 48ms
memory: 114936kb

input:

351493
180349695 744582170 -231466196 311156193 -918224163 742801932 499244357 -122245208 -945991826 632811907 -702788218 -377450924 -127055866 413899582 377349215 -109237274 875498449 984669327 -582590434 -535969194 -515202930 -865614356 712340219 -432417784 -259839200 -334614797 629153456 45235977...

output:

176087255650160

result:

ok 1 number(s): "176087255650160"

Test #16:

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

input:

351493
109291948 656740495 -240687300 816865496 842030537 -83872038 945788784 -175127748 -220378521 -514168111 -75918273 -424031742 618185653 -425893462 184086440 246901383 84933177 484058459 -92426164 41491205 -322743318 -110098421 870843057 441185062 -905737330 -905272154 -954353925 -645539990 -87...

output:

175519371658187

result:

ok 1 number(s): "175519371658187"

Test #17:

score: 0
Accepted
time: 64ms
memory: 113796kb

input:

351493
-614599670 -474846006 -710707577 106808435 -164026900 -724701218 -303848501 558316928 270492819 282023076 -782348251 -886449416 984530125 -357437687 258764323 418885593 479670569 -80377126 754298657 812349532 -410328644 665455088 -524573843 -608180507 987618127 -953474049 -639822420 14005562 ...

output:

175786283410751

result:

ok 1 number(s): "175786283410751"

Test #18:

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

input:

351493
313622497 -362940646 -140097326 256552576 724046027 -409629799 414191927 -893521269 468491250 -617455748 586032127 119415071 378904243 351070874 -986532004 663803846 -866585240 954006674 -955305655 -448803947 621831295 865445237 -543156005 611055742 23286086 343559876 921703921 149690983 -586...

output:

175515918477177

result:

ok 1 number(s): "175515918477177"

Test #19:

score: 0
Accepted
time: 58ms
memory: 113768kb

input:

351493
210604902 501648292 658492051 -525347627 -355907514 215124219 -86804060 996495834 -188590493 -641319941 -220244419 141195062 806233339 -318366404 25549101 -172002820 -797770181 670028866 734746879 -815883678 -641475613 796222600 407452159 -634832863 500778632 640126487 -119988287 294492816 75...

output:

175726295662131

result:

ok 1 number(s): "175726295662131"

Test #20:

score: 0
Accepted
time: 71ms
memory: 113816kb

input:

351493
-843129055 -348494677 -733126523 -699082751 -414986184 -488503685 -801447831 826403161 -690681531 -978669772 -100314374 -11538509 -697056616 719592518 511215252 -522716064 535232416 91782539 739147694 -280251272 -529888836 942685287 861536350 331302306 782848263 648864506 -945194734 -20036503...

output:

175405997725361

result:

ok 1 number(s): "175405997725361"

Subtask #2:

score: 6
Accepted

Test #21:

score: 6
Accepted
time: 71ms
memory: 73336kb

input:

351493
915594742 688454502 456077914 208864399 625937959 102483811 538999077 529481828 400375958 387560315 83710527 83424975 330114353 684812426 68052931 28849220 295907801 535129167 967891325 124069427 644256858 757666812 558755455 178666038 177054898 795236216 848264282 669310447 328353372 3681163...

output:

175766699890054

result:

ok 1 number(s): "175766699890054"

Test #22:

score: 0
Accepted
time: 135ms
memory: 72084kb

input:

351493
558106095 906433626 370590649 172443229 359294152 56072006 85811676 997806511 819710547 234550001 616962251 426062666 836364151 264171065 793148682 129635867 178265836 843676703 590478956 841451015 534070481 684617914 671870778 955426286 402736154 219850741 31973708 468849347 318576756 566186...

output:

175789713405292

result:

ok 1 number(s): "175789713405292"

Test #23:

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

input:

351493
697337673 266522793 679080819 687432689 315959590 268236149 622432001 129168391 88821388 63460774 833956640 413225945 865578649 11740512 786453528 891490067 227393189 334925606 170461981 87131025 281424141 946670090 604404324 925017592 888575931 471618837 629432076 743503791 324979198 8629246...

output:

175724312347028

result:

ok 1 number(s): "175724312347028"

Test #24:

score: 0
Accepted
time: 139ms
memory: 71312kb

input:

351493
9531759 599942847 513281388 9882449 796417077 291041867 324675328 353930252 412321421 947586559 980567086 932827768 615572841 156171760 286692109 886990028 854036272 728463778 206412416 607769313 369514800 628501404 675176090 546072905 149647950 881372300 854487923 790989321 278143384 9314385...

output:

176060086769570

result:

ok 1 number(s): "176060086769570"

Test #25:

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

input:

351493
643775169 784877155 491694248 460219180 421128561 836782766 473863207 74882458 186014002 171438888 487180871 816794740 59414460 519426472 148886585 918349979 15159789 599907429 955714969 506035160 720124140 982522735 4982763 971414716 606296383 279256990 561146067 112502530 687865897 90245951...

output:

175648851969743

result:

ok 1 number(s): "175648851969743"

Test #26:

score: 0
Accepted
time: 109ms
memory: 72072kb

input:

351493
123237838 283456533 538135616 244437927 706620575 310122605 992938749 472163222 432235898 484245342 707496878 494795908 169710548 623933631 26633626 961248631 718394700 717089363 9197104 187450047 894757617 248877232 996630094 315805422 595658941 572547722 304120890 318645450 136013835 705343...

output:

176082772867468

result:

ok 1 number(s): "176082772867468"

Test #27:

score: 0
Accepted
time: 111ms
memory: 72048kb

input:

351493
493928676 984704906 762295072 154664431 387000499 896160744 324405265 308004744 146928584 286540247 476051634 29387846 153694128 904411262 235634769 90897616 716372605 164062799 287383600 987535709 912413555 578718041 845850944 780667717 349187025 181006164 269798770 457360038 11494473 586660...

output:

175982434649427

result:

ok 1 number(s): "175982434649427"

Test #28:

score: 0
Accepted
time: 119ms
memory: 70924kb

input:

351493
373358965 951308820 424481180 333184243 762747734 299885513 496753597 384905589 952388078 213620815 278496250 26390625 340233798 679563691 954378041 269675534 688200374 328300513 630660987 729017309 708106475 394616923 85958853 207679917 920694818 428823833 200109332 105757527 672789240 17044...

output:

175523574288506

result:

ok 1 number(s): "175523574288506"

Test #29:

score: 0
Accepted
time: 64ms
memory: 73300kb

input:

351493
506414637 19246988 476208040 321308506 350947555 498933784 814387431 524390797 694368970 992574521 392132519 681977993 617740744 398570047 955429187 794467660 445101459 899280020 672979531 62822811 91114630 397022041 36970950 413181439 297515602 132779417 715324259 85542261 118543552 62088701...

output:

175964348079203

result:

ok 1 number(s): "175964348079203"

Test #30:

score: 0
Accepted
time: 125ms
memory: 72004kb

input:

351493
198986773 906039921 401561964 93692787 563587809 277069277 678358946 609472935 100076981 910544643 304070724 326539759 555008482 797065754 463351941 521204940 580755165 70283699 968677479 678670254 461445625 53081211 818350939 282327778 123198870 873506 986227805 684460826 703461192 383879044...

output:

175742703185211

result:

ok 1 number(s): "175742703185211"

Test #31:

score: 0
Accepted
time: 108ms
memory: 71924kb

input:

351493
80155259 677489804 317709905 738646332 926916041 417796814 406341624 483755769 292807023 179580462 793077212 266345199 545969570 486044911 715470803 444124568 31002634 985463900 389193993 592838646 861091277 63490585 660350533 828216029 427234331 20581790 342489221 996887734 917735536 8984175...

output:

176015004295927

result:

ok 1 number(s): "176015004295927"

Test #32:

score: 0
Accepted
time: 130ms
memory: 70896kb

input:

351493
502158417 129819235 891767970 99219238 183211216 247517042 540523173 223127548 890246367 488281842 142446217 419214467 64348530 964962625 160502713 368547515 849639720 446159538 419790713 352578054 409914263 635929477 175211453 71785060 341607425 623960228 540374304 235478238 941333686 405860...

output:

175933407600618

result:

ok 1 number(s): "175933407600618"

Test #33:

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

input:

351493
398441962 739520539 491612719 742311876 374717677 206652911 205850479 766243471 807089323 737974241 255255614 662249856 427102454 708382982 50385340 588046648 257468479 272568562 823245583 37260800 566193872 806916151 739940499 741176228 282055372 245646403 597782839 681382879 988980236 56915...

output:

175770971030507

result:

ok 1 number(s): "175770971030507"

Test #34:

score: 0
Accepted
time: 119ms
memory: 71800kb

input:

351493
880628558 121299849 543626556 62033726 562477905 807001043 375706344 218418912 907912385 670274061 135077427 922954507 32404993 210176781 996211632 619526575 919287588 729593055 761653998 610447247 809155528 512214275 521742984 864589741 530033320 679020122 655547772 939779173 682018784 71763...

output:

175730808311141

result:

ok 1 number(s): "175730808311141"

Test #35:

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

input:

351493
648831108 530007650 638538805 608006345 296077170 329899021 678769314 440482296 786721906 668042529 665202240 65800140 350709681 770903722 132697538 767023695 734488378 823129781 81049058 17970450 369322341 159217770 161299857 770481561 200199260 666640973 804754414 446866493 126946712 153790...

output:

175403445299245

result:

ok 1 number(s): "175403445299245"

Test #36:

score: 0
Accepted
time: 135ms
memory: 71068kb

input:

351493
502044059 501804302 211313768 511242 940995264 692839783 506574553 788353346 414910991 728892560 163315468 703340870 64162305 265589155 728350156 90806809 279802465 603050289 583538947 889537982 296696464 894996691 664404573 517096711 643986848 746421610 511916825 917579434 354474598 16810987...

output:

175704819099603

result:

ok 1 number(s): "175704819099603"

Test #37:

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

input:

351493
928817795 15279764 129664762 227080241 523789462 737285062 435944240 506893816 48628908 163684964 26567120 773587005 417584420 284427030 541080558 551027755 533540940 323802299 559241453 839256263 519627534 412275450 563331642 815778319 614934015 836399328 769156966 589297693 908680090 798560...

output:

175889450274061

result:

ok 1 number(s): "175889450274061"

Test #38:

score: 0
Accepted
time: 113ms
memory: 71836kb

input:

351493
251823026 589762742 883250226 961879394 735612675 902451776 40728364 60794721 55273426 161191483 59454831 807594742 528956045 913984188 24433970 559087551 115859648 526548286 32135802 697916215 58068040 394191777 509967320 883927969 307425399 597909709 568479829 932237308 679211452 562575518 ...

output:

175666089806924

result:

ok 1 number(s): "175666089806924"

Test #39:

score: 0
Accepted
time: 117ms
memory: 71832kb

input:

351493
985558020 54549874 730558353 134850543 426343132 553651399 98142769 39888642 60620869 919884891 642437383 798573040 753253917 962593094 378736236 977464159 307193246 831091882 406048067 858980717 316565234 586557313 893832302 589087976 295813039 297530468 815341048 84460051 664360694 54719444...

output:

175692300229036

result:

ok 1 number(s): "175692300229036"

Test #40:

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

input:

351493
795244249 805155169 525778916 836974679 299806591 692112605 622788823 43709098 172248498 161804880 803887069 398609832 320064475 776199168 867218919 146403854 81784201 663602929 874781937 276829658 612886854 545957546 753834680 356435736 62451554 626249096 280389459 216467831 587882687 849844...

output:

175668620388263

result:

ok 1 number(s): "175668620388263"

Subtask #3:

score: 11
Accepted

Test #41:

score: 11
Accepted
time: 3ms
memory: 42316kb

input:

7
247522519 398923496 -976223527 806215585 -937536479 -130552271 90576461
1 2 1 2 5 5

output:

3587550338

result:

ok 1 number(s): "3587550338"

Test #42:

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

input:

7
-822791105 523257970 894601243 -90617653 -41818991 -868075494 -944374389
1 2 3 3 5 2

output:

4185536845

result:

ok 1 number(s): "4185536845"

Test #43:

score: 0
Accepted
time: 12ms
memory: 42408kb

input:

7
-566350725 996649344 340685939 565531548 -379550593 -183515822 -6548810
1 2 3 4 5 6

output:

3038832781

result:

ok 1 number(s): "3038832781"

Test #44:

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

input:

7
-343171001 -403362511 46959184 -369697450 -102687963 -567117121 955599726
1 1 2 4 4 4

output:

2788594956

result:

ok 1 number(s): "2788594956"

Test #45:

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

input:

7
173828143 336914236 941275489 295810310 -887412118 -714471730 -912582442
1 2 1 1 2 2

output:

4262294468

result:

ok 1 number(s): "4262294468"

Test #46:

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

input:

7
-572833222 21134507 42426361 861990387 -480811920 230941373 544927922
1 2 3 3 5 6

output:

2755065692

result:

ok 1 number(s): "2755065692"

Test #47:

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

input:

7
-680443605 -209348563 840970142 -137922464 901658290 459523902 264391423
1 1 1 1 3 4

output:

3494258389

result:

ok 1 number(s): "3494258389"

Test #48:

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

input:

7
894515913 -285833848 200232559 -124848987 -155423899 -388397871 -738157137
1 2 1 3 4 1

output:

2787410214

result:

ok 1 number(s): "2787410214"

Test #49:

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

input:

7
-642380669 158308062 -127045342 711767901 -181174983 -826955836 -244494777
1 1 2 2 2 3

output:

2892127570

result:

ok 1 number(s): "2892127570"

Test #50:

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

input:

7
-449719640 653672153 -305651153 -120669406 801070860 856021669 75279964
1 2 3 4 5 1

output:

3262084845

result:

ok 1 number(s): "3262084845"

Test #51:

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

input:

7
-33901197 115600154 -335654692 -679018907 458398904 149062361 -984194456
1 2 2 4 3 1

output:

2755830671

result:

ok 1 number(s): "2755830671"

Test #52:

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

input:

7
516920012 53907302 586206756 495875317 -54807878 -985037423 -764269876
1 1 2 2 2 5

output:

3347408808

result:

ok 1 number(s): "3347408808"

Test #53:

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

input:

7
-565964084 527456153 -467324315 819771908 17519962 501742828 337156060
1 1 1 4 3 6

output:

3236935310

result:

ok 1 number(s): "3236935310"

Test #54:

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

input:

7
360082886 548821132 941090467 -331306340 -909347809 -760252384 403245201
1 1 1 4 5 2

output:

3447655817

result:

ok 1 number(s): "3447655817"

Test #55:

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

input:

7
272710333 -885098712 -972875130 -903355690 664838706 118735561 -377618279
1 1 3 2 3 4

output:

4195232411

result:

ok 1 number(s): "4195232411"

Test #56:

score: 0
Accepted
time: 12ms
memory: 43348kb

input:

7
786154039 -826401061 -377353790 -46394075 604493222 -496299762 -853928367
1 2 3 1 5 4

output:

3991024316

result:

ok 1 number(s): "3991024316"

Test #57:

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

input:

7
770928018 -375761964 531675212 470154520 -16031738 -208280874 -437616475
1 2 2 2 3 6

output:

2810448801

result:

ok 1 number(s): "2810448801"

Test #58:

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

input:

7
-84214608 -311721984 348213783 -342876753 -85957172 -861533199 -46214132
1 2 2 2 3 6

output:

2080731631

result:

ok 1 number(s): "2080731631"

Test #59:

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

input:

7
-832500294 654953879 519416116 -934307983 447987555 89593616 135649998
1 2 3 4 2 5

output:

3614409441

result:

ok 1 number(s): "3614409441"

Test #60:

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

input:

7
498597931 761832980 -525822554 757415894 -31882218 -376687720 415815098
1 2 3 1 5 5

output:

3368054395

result:

ok 1 number(s): "3368054395"

Test #61:

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

input:

7
777417551 -88689791 610766808 593569996 471721075 928209425 983205426
1 2 3 2 4 2

output:

4453580072

result:

ok 1 number(s): "4453580072"

Test #62:

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

input:

7
-82668280 427512696 -895819022 -34267776 -609918658 -226732333 -326014566
1 2 3 4 5 6

output:

2602933331

result:

ok 1 number(s): "2602933331"

Test #63:

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

input:

7
-458960880 595903289 -797627117 305936000 -645927332 -464394229 424697426
1 2 3 4 5 4

output:

3693446273

result:

ok 1 number(s): "3693446273"

Test #64:

score: 0
Accepted
time: 15ms
memory: 42420kb

input:

7
-148252809 -50378270 242099680 441806495 -814545811 435690931 -387541278
1 1 1 1 4 4

output:

2520315274

result:

ok 1 number(s): "2520315274"

Test #65:

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

input:

7
-300493508 730714824 150007200 -787714326 -363303020 70576704 245638013
1 2 1 2 2 5

output:

2648447595

result:

ok 1 number(s): "2648447595"

Test #66:

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

input:

7
572141031 621058836 -414583535 -460080332 -302796766 -447595524 -501020012
1 1 3 4 2 5

output:

3319276036

result:

ok 1 number(s): "3319276036"

Test #67:

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

input:

7
636941300 669915426 518932524 -279222238 -35749796 -131168660 385529662
1 2 2 2 5 5

output:

2657459606

result:

ok 1 number(s): "2657459606"

Test #68:

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

input:

7
959305738 -894258264 -347090381 -755678447 760882080 227358357 -369759016
1 1 3 3 2 1

output:

4314332283

result:

ok 1 number(s): "4314332283"

Test #69:

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

input:

7
271199002 391849726 362231609 8948327 369398379 -84046022 766040285
1 1 1 2 1 4

output:

2253713350

result:

ok 1 number(s): "2253713350"

Test #70:

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

input:

7
-309161562 833334541 174669127 461560578 -69107497 864803533 -318418581
1 2 3 2 1 4

output:

3031055419

result:

ok 1 number(s): "3031055419"

Test #71:

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

input:

7
-696916765 104246705 -505180092 -22963954 -855056222 -884673975 -382992339
1 2 3 4 4 6

output:

3452030052

result:

ok 1 number(s): "3452030052"

Test #72:

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

input:

7
393178312 -209158385 -698829444 561653374 -9113504 750689995 933099354
1 2 2 2 1 2

output:

3555722368

result:

ok 1 number(s): "3555722368"

Test #73:

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

input:

7
971427922 -556622876 296387648 -837845202 944703657 412111220 -938852992
1 2 2 1 5 1

output:

4957951517

result:

ok 1 number(s): "4957951517"

Test #74:

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

input:

7
-658568657 -291685480 -406950950 752122401 535956828 459800230 806059501
1 2 2 1 5 6

output:

3911144047

result:

ok 1 number(s): "3911144047"

Test #75:

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

input:

7
-122894494 107501180 759554708 -597194397 374886460 459973537 -387453317
1 2 2 4 5 2

output:

2809458093

result:

ok 1 number(s): "2809458093"

Test #76:

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

input:

7
-930209178 -377998490 -307953815 758169950 162476553 -260756104 -302306287
1 1 2 4 3 3

output:

2774917271

result:

ok 1 number(s): "2774917271"

Test #77:

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

input:

7
287997753 -266161909 -556628457 759728666 414851271 537990236 564321414
1 1 2 1 3 4

output:

3387679706

result:

ok 1 number(s): "3387679706"

Test #78:

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

input:

7
-138472494 -986179208 6942447 533450634 339930435 -314670096 -675445319
1 2 3 1 4 1

output:

2995090633

result:

ok 1 number(s): "2995090633"

Test #79:

score: 0
Accepted
time: 12ms
memory: 42372kb

input:

7
-463617574 -318576513 627104075 50217977 909138993 -882391811 -693881577
1 2 1 3 3 6

output:

3944928520

result:

ok 1 number(s): "3944928520"

Test #80:

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

input:

7
962834841 554185005 783725148 750403715 -838022867 -867597310 68444866
1 1 3 1 3 3

output:

4825213752

result:

ok 1 number(s): "4825213752"

Subtask #4:

score: 13
Accepted

Dependency #3:

100%
Accepted

Test #81:

score: 13
Accepted
time: 1ms
memory: 42372kb

input:

16
705094792 -616232357 -108094923 667761097 396504226 420834686 460893922 -278055196 255172815 125946652 428074698 -783191473 -60829767 -164488887 -2826756 967047548
1 2 3 4 4 6 6 5 7 4 2 5 9 1 11

output:

6441049795

result:

ok 1 number(s): "6441049795"

Test #82:

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

input:

16
-486025519 183784915 -802584378 403035079 191354191 -908089262 419437076 -22326703 -667071120 95703687 895466821 339828902 -271465920 -974609701 -36876252 150432680
1 2 1 1 1 1 7 7 2 10 11 9 13 1 4

output:

6848092206

result:

ok 1 number(s): "6848092206"

Test #83:

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

input:

16
338208929 -942211101 307179612 659467060 352008738 -600644826 -568591247 110316127 196281060 7138906 931003885 -602564915 -548401157 -432016978 522625061 -316895655
1 2 3 4 5 4 5 8 9 8 11 12 7 5 15

output:

7435555257

result:

ok 1 number(s): "7435555257"

Test #84:

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

input:

16
-899313763 294546901 -343548306 260194331 497724282 77376652 -679273509 -522484791 285239108 627670162 -100143006 742314165 -584570486 -102120138 -86180729 519443545
1 1 2 3 2 6 3 7 9 5 6 4 4 13 1

output:

6622143874

result:

ok 1 number(s): "6622143874"

Test #85:

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

input:

16
976338556 -399926725 -594520256 -249348148 -193555936 580850541 322710112 -810945200 414102012 -111164360 -520018446 -351068302 -54610814 119534412 6693390 448206798
1 1 2 2 3 2 4 7 3 9 4 4 7 9 7

output:

6153594008

result:

ok 1 number(s): "6153594008"

Test #86:

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

input:

16
679103833 573683189 358587281 321618401 -769264164 -472504416 -71519681 529204634 758179702 549779381 -816759923 854382053 -442226912 -114678422 543582908 899915622
1 1 3 4 5 6 7 1 4 3 11 2 8 5 15

output:

8754990522

result:

ok 1 number(s): "8754990522"

Test #87:

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

input:

16
-216447220 839766783 593862820 -223227169 -515587383 771527766 -640786150 -424040688 -362697827 613900535 469932206 843239980 -138608394 -29397480 -592227290 -621446160
1 2 3 4 2 1 1 1 3 10 11 3 13 14 12

output:

7463801411

result:

ok 1 number(s): "7463801411"

Test #88:

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

input:

16
-155018188 -292183835 996694358 -558722854 -250686806 608843622 975244695 -153156026 971321656 741174731 77960650 -696752425 251896012 -644861503 933941170 -74225600
1 2 1 3 1 5 3 3 2 3 4 7 13 3 6

output:

8382684131

result:

ok 1 number(s): "8382684131"

Test #89:

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

input:

16
653727953 -786557317 -943459438 -26691277 -339420493 889645810 737779068 493957724 601072620 -720213395 -71872100 747061932 -456138372 -762501798 683713450 414262727
1 2 2 4 5 1 2 4 2 2 2 12 12 11 2

output:

9328075474

result:

ok 1 number(s): "9328075474"

Test #90:

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

input:

16
-685946887 265209863 -877073465 -523555649 750392067 553279029 -861463735 -99479120 -989785837 -207308024 555917926 -200374636 -817066501 -424008798 -201581337 -334543938
1 2 1 2 1 1 4 5 9 5 8 12 13 7 15

output:

8346986812

result:

ok 1 number(s): "8346986812"

Test #91:

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

input:

16
-584731669 785757898 -886550700 511541138 -755675797 -411642499 528177179 -901914944 496986189 -997763093 608511332 925747595 39112182 -454149417 261692673 -13037234
1 2 1 3 5 5 2 8 1 1 8 12 9 14 4

output:

9162991539

result:

ok 1 number(s): "9162991539"

Test #92:

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

input:

16
-138789606 -657983472 859491002 490768513 -216693633 700253981 586625527 579190361 193321927 -144859351 -591507835 -10321324 590093735 -850375783 -531185765 715028127
1 2 1 4 1 6 1 3 5 3 10 1 3 5 1

output:

7856489942

result:

ok 1 number(s): "7856489942"

Test #93:

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

input:

16
-628505864 -722387599 916791876 66443285 -201924262 784845156 577731113 -565833840 -307792649 -495146577 724451257 242931594 894310670 -428649385 -541399884 661299052
1 2 3 4 3 3 7 8 2 10 10 6 9 14 4

output:

8760444063

result:

ok 1 number(s): "8760444063"

Test #94:

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

input:

16
-425978798 -21337767 846472240 668297537 242801553 747692852 -739406045 -75566438 -624614219 -146934481 -820992035 -804374400 -263090428 191368982 -143403842 526102378
1 2 3 1 3 6 7 2 2 10 11 3 11 10 15

output:

7288433995

result:

ok 1 number(s): "7288433995"

Test #95:

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

input:

16
345958026 -166094257 -852038492 -561405773 464257568 -499336069 -814818464 633851131 579572894 -54963110 -487200352 -893082366 540997783 -199192920 -851126607 -186508627
1 2 2 4 4 5 6 2 4 10 9 7 13 8 4

output:

8130404439

result:

ok 1 number(s): "8130404439"

Test #96:

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

input:

16
695750236 -178046448 174303514 -993882449 508423908 -210706652 -569944791 -450098231 -738117854 569307879 411591975 -113046316 -394202142 -520705996 566414548 -680457937
1 2 2 1 4 1 5 3 2 9 9 10 3 1 6

output:

7775000876

result:

ok 1 number(s): "7775000876"

Test #97:

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

input:

16
911540577 46728665 552057846 -564236701 -336399435 -282099721 -871309301 175705030 112257293 57203879 581087765 -837346177 -917563254 -773533615 276343154 138723150
1 2 1 4 2 3 7 6 3 4 7 5 13 14 12

output:

7434135563

result:

ok 1 number(s): "7434135563"

Test #98:

score: 0
Accepted
time: 10ms
memory: 42376kb

input:

16
-960871895 -502979425 990214857 10073238 -780153660 829250023 890167026 -159147718 -434224689 -343400838 -124857151 387055436 533159137 257649727 201980282 91065695
1 1 3 1 3 6 3 8 5 5 1 3 6 14 11

output:

7177955361

result:

ok 1 number(s): "7177955361"

Test #99:

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

input:

16
728295393 994812701 27878060 458671288 841106321 919316972 -340436956 891257287 810001507 122859551 135675877 -675486515 887822214 -30726545 -279576229 -59420445
1 2 3 2 5 3 2 2 3 8 11 5 10 10 15

output:

8203343861

result:

ok 1 number(s): "8203343861"

Test #100:

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

input:

16
-772084069 528226393 822093162 -599156533 -37138025 -29994514 435533676 -38584626 23997434 147656083 619337286 -945495769 636665153 808484533 501705962 397161256
1 2 3 3 1 3 7 2 9 5 10 6 10 7 2

output:

7343314474

result:

ok 1 number(s): "7343314474"

Test #101:

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

input:

16
454086574 -188981461 -615483461 609657896 609280140 -658996363 -695723892 394636347 -384757939 851747856 -909165270 351615798 700857804 669574646 885131562 301319047
1 2 1 2 3 5 1 4 6 2 10 7 7 3 7

output:

9281016056

result:

ok 1 number(s): "9281016056"

Test #102:

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

input:

16
-100886008 638479787 154724580 459785723 -783987323 -804311373 69562192 -694263043 -852456334 857035124 989257564 -624844635 -667832435 -334649534 658072282 875295165
1 1 3 3 5 6 7 8 6 10 1 6 10 14 15

output:

9565443102

result:

ok 1 number(s): "9565443102"

Test #103:

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

input:

16
756739549 -895741812 378841387 -56223569 -725379884 298935567 -276452704 905213956 207397786 244228750 481822922 -797581163 468756619 160840970 -504465752 -740562155
1 1 2 1 5 6 5 2 3 9 7 12 1 13 15

output:

7786737407

result:

ok 1 number(s): "7786737407"

Test #104:

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

input:

16
-502066643 937565716 538542511 -739956413 190799554 310321952 -117225972 -456671322 848147688 -363121968 -519269832 -734794384 108008474 -803724438 755007221 -264025800
1 1 2 2 1 4 1 8 1 4 7 3 5 14 5

output:

8189249888

result:

ok 1 number(s): "8189249888"

Test #105:

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

input:

16
815979949 -421501155 -653176809 635283920 572850279 -432513912 -350668835 447500197 -302639600 -706675183 847486840 -312103775 -705636712 -676495342 199120533 -382781489
1 1 2 4 1 2 3 2 6 2 10 2 8 2 15

output:

8462414530

result:

ok 1 number(s): "8462414530"

Test #106:

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

input:

16
170730868 -429389430 -931541194 -296909486 -338260295 -513767576 305195776 179131153 -990542224 11301848 -769142688 -528035044 -477720634 -431591472 921127419 -959187654
1 2 3 1 2 6 4 6 2 3 8 12 2 12 1

output:

8253574761

result:

ok 1 number(s): "8253574761"

Test #107:

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

input:

16
290246265 -920094830 107854872 786646225 -468288799 932011092 328852441 817408231 -639217176 633853570 61528187 972243650 -647647853 741968333 141628135 -579039385
1 2 1 3 4 6 7 6 4 10 11 8 13 8 15

output:

9068529044

result:

ok 1 number(s): "9068529044"

Test #108:

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

input:

16
-299198140 504256672 -342143694 617526823 600484031 -298846459 -339315717 556800518 -705530309 498303689 -811066832 700200577 15889035 258340403 571109881 791385444
1 2 3 4 3 6 5 5 7 8 9 8 11 12 14

output:

7910398224

result:

ok 1 number(s): "7910398224"

Test #109:

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

input:

16
-754610330 473522424 251148334 -324324052 -544657848 -837486143 34795971 79185936 237554674 539613797 180739395 555315719 -222925038 -128125202 -137238826 273722005
1 2 1 1 2 6 3 8 2 7 3 4 10 4 4

output:

5574965694

result:

ok 1 number(s): "5574965694"

Test #110:

score: 0
Accepted
time: 10ms
memory: 42560kb

input:

16
24690851 -208535417 488119606 793999715 -868011567 421762496 -81293743 614005444 882084135 -246489789 -698869739 -29609374 334665194 780682609 480560197 -872213582
1 1 3 4 4 2 2 1 3 4 11 3 1 14 10

output:

7825593458

result:

ok 1 number(s): "7825593458"

Test #111:

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

input:

16
133666816 -121152145 -341830107 -126511242 -47185581 -743230275 809735433 925508133 400222309 843538559 -51681849 -910389833 -802464350 315015789 -60048922 806503846
1 2 1 1 5 6 3 2 8 10 11 12 13 14 2

output:

7438685189

result:

ok 1 number(s): "7438685189"

Test #112:

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

input:

16
329599341 577899051 563829546 7954301 -23663859 -423180143 -691846756 543293888 -983316562 51087503 933664652 420732189 269900951 -275515986 -451672900 -516061974
1 2 2 3 2 5 7 3 1 7 10 5 9 5 10

output:

7063219602

result:

ok 1 number(s): "7063219602"

Test #113:

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

input:

16
5478417 778891577 -182846102 -171308642 919583531 953223865 539731022 -233821820 -395672903 -777429849 -271747405 967499742 -437948573 -931930013 -254956915 -313447443
1 2 1 4 2 5 6 2 1 1 8 2 4 11 2

output:

8135517819

result:

ok 1 number(s): "8135517819"

Test #114:

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

input:

16
-583538404 -562090376 28237467 729354755 -475041778 -352462724 493847870 -444666681 -394823916 170207786 909025936 -908045824 781874962 78862542 16735798 125585522
1 1 3 4 4 4 5 5 8 6 7 7 13 14 6

output:

7054402341

result:

ok 1 number(s): "7054402341"

Test #115:

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

input:

16
-561583942 997093169 -536213600 87570286 713681322 -995589010 -654706200 -551960524 60250808 -704049387 -216948907 991783378 670271535 -671334637 375783277 -666337113
1 2 1 4 1 4 4 2 9 4 11 3 4 3 14

output:

9455157095

result:

ok 1 number(s): "9455157095"

Test #116:

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

input:

16
287014820 -175000539 -379986162 783251360 -548938361 996692969 -717194274 32342345 -30729626 233024862 362928016 -20258053 -473756142 695228941 981860260 -545949070
1 1 3 1 5 1 2 6 5 8 11 3 13 2 3

output:

7264155800

result:

ok 1 number(s): "7264155800"

Test #117:

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

input:

16
249040588 459602282 297384003 -299452994 -796369180 782752454 -475181608 -22642786 -767781943 850892974 -826028391 631609842 222319690 -981677075 71797846 656576619
1 1 1 3 2 4 7 7 6 8 4 10 2 7 3

output:

8391110275

result:

ok 1 number(s): "8391110275"

Test #118:

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

input:

16
-2838216 340153 713105429 -824251767 171353897 -820985788 581267725 -982852367 56299717 580147698 -872169730 -940033296 207944229 534228447 -36228588 272978510
1 2 2 3 5 1 4 8 8 8 2 12 11 14 12

output:

7597025557

result:

ok 1 number(s): "7597025557"

Test #119:

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

input:

16
153018023 241686138 -52408475 -392180854 -912731532 -215263365 -542798479 675371932 -198000656 4330271 -612913714 -83275352 -761977287 681381907 738734136 -567228456
1 2 1 4 5 5 2 3 6 10 11 12 4 11 10

output:

6833300577

result:

ok 1 number(s): "6833300577"

Test #120:

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

input:

16
-112800397 -905572872 -277422687 -381580900 350628202 138284168 813583764 -120186629 -980487129 452688916 10376554 753448253 552380259 517835372 750905939 -802107805
1 1 3 2 1 6 5 6 4 6 4 3 12 5 12

output:

7920289846

result:

ok 1 number(s): "7920289846"

Subtask #5:

score: 22
Accepted

Dependency #4:

100%
Accepted

Test #121:

score: 22
Accepted
time: 8ms
memory: 42476kb

input:

100
-726952699 -90634664 325373211 -843632790 586905321 738915710 -332541440 -840886232 -718312998 604457381 -403884342 -537459643 -104704322 820433427 -683727053 -761237034 -214608038 863438526 847276894 -265396231 -643564993 250836177 -654904735 830571018 -520404755 502911366 -366976270 651820877 ...

output:

53325292694

result:

ok 1 number(s): "53325292694"

Test #122:

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

input:

100
-559943255 411444354 360984135 -749814781 394905415 49684055 135161015 -127194661 225890164 398122277 -204893593 513513689 -103978961 -880972258 -738405315 -921601007 471083823 -664783321 -621089555 469332510 210680924 811123212 695110106 104024121 -339044649 597275218 -998676851 341585375 -7064...

output:

50951091192

result:

ok 1 number(s): "50951091192"

Test #123:

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

input:

100
463520470 494847254 -519968303 691743075 40833407 -379769876 579095471 830626381 -515951935 -30520376 -881476887 -489348746 -660299158 430345420 -495398469 -960323166 26367608 852276074 282760551 753415086 269062731 264297136 274406174 -126027799 5550842 -729825264 -848689602 865951643 379453629...

output:

48377436440

result:

ok 1 number(s): "48377436440"

Test #124:

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

input:

100
-287801645 926499336 681214062 968242536 -233542434 -282317091 844023437 -784041181 657017912 167529037 -136461232 -343746846 191698656 644314751 -268534741 -836410720 -577167021 -835697312 189835847 791912186 -407534654 -704554034 327506311 528647770 -887720432 -367644533 395611425 487003825 29...

output:

46742418917

result:

ok 1 number(s): "46742418917"

Test #125:

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

input:

100
69227742 660022722 482909702 -403408884 995008067 482701576 -687531127 691945739 -249906633 705428639 305126055 -960736726 -759016757 24345124 713561070 50901126 -417934204 374863432 171175487 -307425763 877005358 437739979 673108801 979044892 -540712371 644820895 545282345 278143208 -310138319 ...

output:

48268843975

result:

ok 1 number(s): "48268843975"

Test #126:

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

input:

100
669874140 797458360 491218739 -126377328 162709871 851904182 -946548524 -421884900 -89475280 -255301509 -384130079 -520510426 -806152984 970606391 360092640 264455909 -461577734 366948722 -21389381 482436448 385693266 711657591 38833393 14910817 -868038682 451880405 -555783660 847901527 -8201960...

output:

52740131675

result:

ok 1 number(s): "52740131675"

Test #127:

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

input:

100
-974276687 -125740452 139835861 851427276 -176591282 -673423831 -643600383 711694573 -696185571 390416426 -388085783 774738795 -845526711 114622533 475319713 618336965 955872232 16415446 254584920 -192506320 -938551222 837400602 -595096402 -482932841 210105865 229628370 -574508259 906655025 -534...

output:

51839615834

result:

ok 1 number(s): "51839615834"

Test #128:

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

input:

100
95666920 -752637944 939281181 684172921 -460589053 -641912313 -842867589 -287062421 -809730784 -960321085 189734469 -681658486 -829254132 -86933663 -799211003 639612267 -914795381 311056178 937598080 530990623 169575718 114916584 797312895 745993062 459955256 -78902216 -971030533 167367483 91509...

output:

50164474883

result:

ok 1 number(s): "50164474883"

Test #129:

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

input:

100
218109522 -938171957 -197288885 317722680 646320806 -640609738 551004346 308416868 89760358 602594203 -15649106 -934807628 777406572 907606743 958427500 181186775 674398076 665821636 576619616 706357288 804380218 -152057548 -238319699 -395261752 -242064753 582728918 -574428037 -468161813 6143507...

output:

53776538602

result:

ok 1 number(s): "53776538602"

Test #130:

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

input:

100
-764363717 -86175228 -92169146 178926910 -404266245 -440971630 184089387 695314648 -508277911 731329999 -280689224 -59874586 -816239402 -69945467 -321363389 -944415085 -790726762 -66872844 -495832480 62158694 288768683 978331526 518566806 -979696606 83215795 61850076 253590985 -896319487 -156182...

output:

46052671906

result:

ok 1 number(s): "46052671906"

Test #131:

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

input:

100
-792484664 897462034 -212612741 -757839475 593027746 711137638 205514087 -615009146 -723710636 -870803699 -489383213 472679668 -304157969 -456468723 -294738676 20753310 122744428 -47767530 824337687 -127445345 213432592 -294033495 730752110 115906361 -197889910 449127848 -307876915 323849996 -86...

output:

48271195409

result:

ok 1 number(s): "48271195409"

Test #132:

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

input:

100
92151318 470374356 964634161 422632463 -401794147 -948958259 -697691815 -307421568 648773021 -945105880 -558067714 -492439029 -734488063 -426414763 552975456 402801587 905875092 191078673 -207688756 -531772820 -680580592 600219519 736749664 364773934 271251564 -28295197 -291241082 686518616 2107...

output:

51338958353

result:

ok 1 number(s): "51338958353"

Test #133:

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

input:

100
41433950 -189228916 -916049365 -878951932 398645477 -395626953 453775654 -266114836 -622371817 -870158507 293826743 -135524073 42725503 -404312715 -914828557 129188479 -775661598 456166223 838503570 -675341887 -721685784 -924019970 744391668 -960756542 -960475675 -409326575 514326040 544498675 8...

output:

52195239377

result:

ok 1 number(s): "52195239377"

Test #134:

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

input:

100
278585538 402483270 211240901 867087231 682013792 -319226984 655141840 -285250632 -159355392 -550006809 -890469305 -748803307 -819377160 460750416 -728449329 -986181127 -224146322 426805009 -458392843 -272704543 582423938 -331677892 607623102 -900584021 537463546 -150816488 -731018308 -557135016...

output:

48653348268

result:

ok 1 number(s): "48653348268"

Test #135:

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

input:

100
374244996 -137947491 -17256751 808169319 713000613 -130980406 665949423 760211246 39619843 569180353 -328461508 888702023 -704243801 -186655703 -663316908 -291819409 -441795098 -867804363 256499618 408354743 -59538542 -355105708 738678885 680898701 -799803779 735302716 -42258392 96010490 6715278...

output:

47123092129

result:

ok 1 number(s): "47123092129"

Test #136:

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

input:

100
474512448 236942051 -468708287 -239254928 -928943075 -928269894 975527963 -906873650 330165237 -582823945 -74005992 -78369497 -523881754 30611775 905252277 -424337803 -515216689 844688592 326495173 531644938 667714958 -28341981 510670985 548019767 -254170116 -476076782 -784544735 -544791904 -540...

output:

51915018473

result:

ok 1 number(s): "51915018473"

Test #137:

score: 0
Accepted
time: 12ms
memory: 42436kb

input:

100
764135724 -321977278 888016949 -590635989 291509764 404680975 227365922 -717647074 457132790 851767022 51924872 552327320 435272128 705725534 -908910762 -631832190 -602428549 -10184134 93196763 -681303406 974066200 -435776761 811276597 153716535 852278915 -82778118 -883438321 -889941675 -5338339...

output:

51124687797

result:

ok 1 number(s): "51124687797"

Test #138:

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

input:

100
-720048124 -628249017 -912589732 545364090 -665840436 -969985830 999970300 -531633932 -73397137 -864203406 -562051536 -913787981 -768696376 206480513 -924805302 -473993712 -773413580 -512153204 -396095848 659172608 -666814326 -702962588 -170874430 574916101 -867844130 -715142564 540049544 196107...

output:

56717883988

result:

ok 1 number(s): "56717883988"

Test #139:

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

input:

100
-776788244 23903050 -354271002 -51767960 123531346 -188240042 42929548 947347245 -297298539 111322037 -923914840 -952706849 -223869422 387021543 -960580817 601330074 -1986844 229003100 -950529541 328439496 853470875 276741837 295327044 574574022 892716787 -344591200 664147617 -155852380 95729785...

output:

49826621078

result:

ok 1 number(s): "49826621078"

Test #140:

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

input:

100
111999530 464405619 -731832569 -154794112 670599197 763134440 452358760 -475061388 -773663240 400358779 -810893951 879401246 -45077732 765350230 -371246828 -168396719 959073048 -956944618 519403406 -239194044 702739251 38809596 203309553 538101880 984106503 -122262754 -458420406 93693532 -957174...

output:

50971025332

result:

ok 1 number(s): "50971025332"

Test #141:

score: 0
Accepted
time: 10ms
memory: 43508kb

input:

100
92300604 513218093 523963478 -667424725 690902623 32809280 -703605786 456085982 -164920045 642963404 -213268549 837678968 126234886 -289038128 -459690542 107557149 -806473890 -880703444 185374253 769902877 -42065484 -59447567 -414268546 208378633 -423422759 268912732 847196285 -409608599 6715037...

output:

42863873338

result:

ok 1 number(s): "42863873338"

Test #142:

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

input:

100
676229840 -119322672 192810074 -963551939 47292911 -531471847 -657388307 165119985 355582396 448594125 83413569 618463632 -937061866 570724116 191871547 753657336 99466512 -32887717 -357234685 -681445033 -999501473 -126033481 -412426740 -139528922 242857142 182944911 -871654840 325518149 1037638...

output:

48301706917

result:

ok 1 number(s): "48301706917"

Test #143:

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

input:

100
929652070 -995760366 -718236056 -648313487 729404071 622272534 730552389 -343032899 -698524108 357209907 -938686279 -63090625 -539339530 -932603519 -774119694 310800317 256103954 -938807961 395753800 -550829710 963511666 -139449174 -850564258 -30309940 423521512 -8705774 -312560222 -516365310 35...

output:

49010701262

result:

ok 1 number(s): "49010701262"

Test #144:

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

input:

100
728248008 -466819136 -924368641 -132518546 -176955969 -36969169 956494249 929509709 -220851981 -771802980 38401369 219115746 879679917 771241825 271415336 -688655405 526707954 -798921911 356049388 -905728499 676199388 -636037820 830156676 -20949711 -342439195 95895977 497967878 -57038702 4980877...

output:

49289530114

result:

ok 1 number(s): "49289530114"

Test #145:

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

input:

100
-149904903 -377610652 -382374081 -555685902 -174175488 -353884247 -111109294 -601477469 467889575 355947138 881304367 559057889 -129178508 -208343619 -783954720 -757062980 147866594 544644173 1921930 657389957 -579109692 -901550305 -91917379 -153258388 -4773764 -509510669 290522207 737723917 -88...

output:

49222227937

result:

ok 1 number(s): "49222227937"

Test #146:

score: 0
Accepted
time: 12ms
memory: 43004kb

input:

100
-197374829 916368781 87269611 379748212 546946252 -262853455 -395775857 165906027 -167736301 -987463003 -662709253 909942254 -31312198 -368623175 -807657726 -91778255 -726656290 218159072 29971606 -975079895 -480907771 56045141 -582220821 825540067 -912426626 137378172 -21097052 548233259 263055...

output:

49244229686

result:

ok 1 number(s): "49244229686"

Test #147:

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

input:

100
174816476 -300839514 -819016069 323205623 -365505359 -402204619 -450991339 651731450 913806940 -50958921 -311311438 602425182 -237072986 -505691251 401921055 941176698 594675956 896373505 -508422981 -36825069 348693029 -654770341 -877779349 565583244 -40764546 974385968 944321595 -883938220 1367...

output:

50235280096

result:

ok 1 number(s): "50235280096"

Test #148:

score: 0
Accepted
time: 12ms
memory: 42412kb

input:

100
-956801454 897360270 361695028 267133271 907099834 -313351422 -742867240 -460572483 792396170 534167388 -323437157 -824663369 -552360514 185648041 621205391 -487016945 975946121 -614176561 -535799571 958329329 -300630756 -639501713 -636405592 -312031010 591926793 864614493 514333609 474230798 95...

output:

51043213620

result:

ok 1 number(s): "51043213620"

Test #149:

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

input:

100
-821668141 -48932470 -159675110 -909964397 -19537408 -793346948 -191122559 85228729 671158992 -738109274 142375564 596505695 -670731085 -210246514 -687262591 -212065273 -883832959 43071123 -195385565 47799298 964410253 187435830 83893976 326052278 -682270060 885465475 -84341911 -155270330 934564...

output:

45306013403

result:

ok 1 number(s): "45306013403"

Test #150:

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

input:

100
308045532 -819910833 588544819 814807929 -903834305 98569024 951204074 -564784216 -169619575 -918916634 -102537463 125258061 -538348353 626598521 303440973 778065053 -752768362 -231244975 728005140 71068843 255325008 -101952873 41897200 -880460313 -506572442 -860396163 -584494923 71034005 561060...

output:

49698077852

result:

ok 1 number(s): "49698077852"

Test #151:

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

input:

100
482105260 900404600 519510245 -596016906 -215288440 20496522 854507544 130406883 900528663 689489867 290463283 404714219 -959357649 -920384909 205656918 744223827 490667176 899085426 442092503 645841594 358223654 957570058 -99554637 -460029476 -346725626 420007360 -71924540 882595246 164140752 -...

output:

50468606195

result:

ok 1 number(s): "50468606195"

Test #152:

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

input:

100
-172053345 -943228732 -936419084 11464219 339913124 -672685820 406592847 394098658 40583908 -6511974 686993263 -368117931 -281817310 715382914 941590663 -859195213 638581972 665615993 997788695 -933702779 -292543548 415022187 251585853 730540541 -650065498 -181625997 -846666796 -810377250 -67779...

output:

54803924238

result:

ok 1 number(s): "54803924238"

Test #153:

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

input:

100
506220605 83114311 810122130 939044061 511157552 916477184 -418635776 -956501820 576732625 577886457 681943442 -952041156 13209348 747869247 -63018913 597944558 -557136967 219718686 -96145594 824249508 -604052080 409801112 -199762740 -554608029 -647557582 490733723 745997545 -729457171 -66977747...

output:

50976271161

result:

ok 1 number(s): "50976271161"

Test #154:

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

input:

100
-69206057 -967890717 999706861 -751482875 886352534 87201278 100933161 -40089957 -563013044 739681695 111021089 885505942 91229709 -976621598 -230837978 245839317 -128668964 205365195 -567219104 -570517653 419255788 -276416068 566428557 -649284168 -394176160 -738115019 808646537 -772120660 -7771...

output:

47331447587

result:

ok 1 number(s): "47331447587"

Test #155:

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

input:

100
697163923 467439754 214625528 458009047 -750901393 162989898 711732174 671329415 652287901 278609383 -481015897 -38083769 -565313492 813624877 -991118478 -103634485 -956120121 -678519034 828343282 353012300 -761545000 -213583019 -57542648 -59277383 942268974 -444057968 -680885254 451728726 85970...

output:

50751588314

result:

ok 1 number(s): "50751588314"

Test #156:

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

input:

100
89384693 -919017235 -764034928 400059660 534845777 193034103 -438466765 -619961755 90634566 -577496727 20553164 -223592153 -881357925 965887884 -262268891 232516688 26162846 847533059 -324496383 -693591360 -955622195 -674546435 -307981988 176095852 -305181139 -720547192 705818180 525238095 61170...

output:

50701292963

result:

ok 1 number(s): "50701292963"

Test #157:

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

input:

100
-4837430 -677132073 436922929 477350831 -992461806 -899345084 -596406530 -597752079 911047101 -806653409 -339389511 -671196038 933207586 -444554352 889393488 167929569 457631155 617411520 118129513 96610819 -979733140 -170764468 -858862108 377983974 -346346146 -123029177 -105787808 -917358025 -7...

output:

52128531691

result:

ok 1 number(s): "52128531691"

Test #158:

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

input:

100
969209369 813040273 -753374229 779880669 -560572589 -738716234 442244568 -71109895 -127402699 -872281188 -885867014 -729454990 -487364264 -217865140 755184889 -771152401 -6069095 -761872706 413682391 -78240894 46977534 -930841032 396027597 905311324 -64058815 662555531 403393883 -891250567 25269...

output:

48367319332

result:

ok 1 number(s): "48367319332"

Test #159:

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

input:

100
399799762 827055573 862078781 955004143 581637396 -570688220 978657889 -728609521 -535258319 -412707589 -489633836 -57481404 -194278415 -566542162 -110373137 124709841 717622982 -287756764 757833519 -950555921 714366652 -949653422 72915871 -868237225 -893507567 890739522 -428818887 782831669 486...

output:

52680606032

result:

ok 1 number(s): "52680606032"

Test #160:

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

input:

100
536548271 -92386041 -371130626 978776655 -480237797 -18247893 -137068260 451547489 -319621890 382103575 722256387 -389048747 525134698 -407873685 -833906879 722973253 -977502727 -663905835 999350409 543938229 772062138 983997450 -312040659 -736290733 530461486 -829531241 725075093 -108692671 277...

output:

53847720594

result:

ok 1 number(s): "53847720594"

Subtask #6:

score: 35
Accepted

Dependency #1:

100%
Accepted

Dependency #2:

100%
Accepted

Dependency #3:

100%
Accepted

Dependency #4:

100%
Accepted

Dependency #5:

100%
Accepted

Test #161:

score: 35
Accepted
time: 93ms
memory: 73320kb

input:

351493
242570766 60774193 843177366 848492209 308431877 -140025402 234221778 807766869 -203043315 775194766 756615521 -464626760 -202090648 377716181 -444840354 82955316 -286106929 850497187 676840903 652294281 -980003201 -4230313 -365718759 323583853 564024562 -845829245 189264348 -55039967 8698544...

output:

175060141410046

result:

ok 1 number(s): "175060141410046"

Test #162:

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

input:

351493
-996905767 -338340122 863463078 28155250 -963943226 -891247044 552326195 484605140 -842878092 897925790 531523028 332037742 675984230 -639664704 -251771675 -126950345 -798261606 -629549443 -608502501 481486724 -295456619 756260647 -769125928 869978717 192640132 663784185 268419924 936267046 -...

output:

175581644009431

result:

ok 1 number(s): "175581644009431"

Test #163:

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

input:

351493
206607355 -36210863 145283934 -665125177 -34402509 -11502788 324592526 -778394257 500102316 234905149 584556396 -100224600 846659948 -174279766 37628524 22278051 -368178899 530523302 -569590567 -522322130 253272819 -230708513 837215069 703084582 -762615434 957949431 -346258135 48453026 715833...

output:

175490568845858

result:

ok 1 number(s): "175490568845858"

Test #164:

score: 0
Accepted
time: 123ms
memory: 70904kb

input:

351493
-66240943 -496017776 -469452467 131454928 526514284 -740405248 731231284 322391209 -837957465 -881528161 -888174462 -921838942 79159072 -546952878 949393510 863532061 662290953 642139002 752151141 -243061322 948876296 -103052263 -221028304 435147751 -979431312 -103478946 -95385358 382922075 7...

output:

175036311349824

result:

ok 1 number(s): "175036311349824"

Test #165:

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

input:

351493
-608182624 -118135261 -187958969 133821733 275992488 518366304 -581633602 -934700207 -44452162 423743829 -409558784 783833184 -222529999 -784146693 -394465796 -988336319 -826734914 -602543551 833071048 752797224 -836809121 -919276186 -377397242 901624347 914929314 -143504348 579055304 -307456...

output:

175262956162581

result:

ok 1 number(s): "175262956162581"

Test #166:

score: 0
Accepted
time: 105ms
memory: 71908kb

input:

351493
-392845701 -570526968 914739537 -622724271 417437273 993687407 -949029508 126104220 -866204755 73228558 410467312 293421197 -640462154 104798770 -681600425 527272369 -5361956 -611873887 827815059 -545125098 541963419 -863815485 -668936437 604468393 438809519 718352512 -663559250 353747313 943...

output:

175493275970187

result:

ok 1 number(s): "175493275970187"

Test #167:

score: 0
Accepted
time: 128ms
memory: 71944kb

input:

351493
-283143295 106666646 826281630 72581717 245735246 -189499222 396094393 -87611565 12066864 342386980 -505797209 -251325239 243361653 -873379317 -528331876 564651194 397223981 699991927 -532040750 -589599016 -584209197 88057648 801046042 -215051642 -998490708 -623220399 -723237723 723153424 428...

output:

175385051258541

result:

ok 1 number(s): "175385051258541"

Test #168:

score: 0
Accepted
time: 146ms
memory: 71100kb

input:

351493
680068871 617252653 -462835691 172218987 -60757558 -471938450 276900856 444183185 946360297 144657124 -809908037 302419991 -621506950 707352938 541311492 -449460733 723070108 319463159 856292350 110353540 770852944 -958934479 -986600842 983696515 849853006 486653700 -839499028 -449200339 6556...

output:

174684357025063

result:

ok 1 number(s): "174684357025063"

Test #169:

score: 0
Accepted
time: 76ms
memory: 73292kb

input:

351493
-207951152 -51645814 10298276 979445414 807725786 943255599 535521010 -970191936 -290112220 -500609510 -282657578 489718232 543453347 712348729 -889463027 -380749850 -735143846 614398379 875915150 -339516103 337960985 -422977083 -622645841 517079216 415063293 -71185229 -540362220 678475493 -7...

output:

175460181492851

result:

ok 1 number(s): "175460181492851"

Test #170:

score: 0
Accepted
time: 136ms
memory: 71888kb

input:

351493
439025851 -966365458 -143233217 272719628 653108831 432057097 552321451 -288362630 172376857 780942882 -549504160 -837316647 777615444 -490653305 -654252809 -293213561 909599698 -930697450 -992568987 591518253 179723079 115923207 787057366 -969938438 -24330390 364871487 949873520 4677420 5926...

output:

175510059892603

result:

ok 1 number(s): "175510059892603"

Test #171:

score: 0
Accepted
time: 132ms
memory: 71928kb

input:

351493
-271635641 778084875 861780148 191437747 384075245 -246898725 33162554 -626467613 -816923411 -771209733 376090175 -878341398 -29712672 390808383 -156223966 793782010 -836667781 538287677 63811201 -470278755 -806454408 641680111 -740972292 682258515 -285664126 487642328 834487460 -750297789 -5...

output:

175227382920748

result:

ok 1 number(s): "175227382920748"

Test #172:

score: 0
Accepted
time: 132ms
memory: 70948kb

input:

351493
24499143 916635789 773448154 -318721204 462240053 102830571 448489093 992368959 838601431 -306160419 -331853719 452603450 -585190917 58856653 285899390 -55657387 -770717763 -645713842 -805602190 -75386700 633109671 -35858426 -630219255 -428852813 806841505 52795694 502072995 5960009 -74563864...

output:

174998951797384

result:

ok 1 number(s): "174998951797384"

Test #173:

score: 0
Accepted
time: 64ms
memory: 73468kb

input:

351493
149621739 -104860867 -851308492 51716813 73555520 -760801345 887327882 513051317 -565650639 -492041993 301078834 744211379 -809946905 901469398 -546802580 -775094206 -269460705 -214765107 916364225 -971633688 -920649638 -940981807 48072775 994697354 -476462798 171103167 404868664 636464847 -5...

output:

175283370678779

result:

ok 1 number(s): "175283370678779"

Test #174:

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

input:

351493
109024619 519844198 -257414111 -901490357 410349670 536020833 659907148 -836036843 511169332 873963766 -595377036 850359466 623603296 -481614887 -459840749 -786154058 541118633 -686097437 810765750 278093534 -300015551 -354870025 837487470 -267537447 -666688562 114966666 -783661137 534024770 ...

output:

175384844935143

result:

ok 1 number(s): "175384844935143"

Test #175:

score: 0
Accepted
time: 111ms
memory: 71884kb

input:

351493
-915555354 235122997 363855653 -611934561 -421473139 448952201 231585358 672388221 48184140 -11472459 234700123 989229448 684717534 685328185 929373107 -152125641 522781560 406414694 -97574745 -325450522 -808351481 534320023 -545063752 986182315 988006795 357664262 -668404312 308411421 715141...

output:

175383589342353

result:

ok 1 number(s): "175383589342353"

Test #176:

score: 0
Accepted
time: 138ms
memory: 71032kb

input:

351493
106503630 396082048 -401661996 -119892178 94690150 -579580439 954105953 -294480586 -546177976 -37915714 -264532527 -88287514 -123406120 674658226 -216448462 -879015144 232695942 -510551347 949942240 -971283251 737360646 782299274 -741928759 965821606 992112871 604111382 -675931080 -670122923 ...

output:

174976711035505

result:

ok 1 number(s): "174976711035505"

Test #177:

score: 0
Accepted
time: 66ms
memory: 73232kb

input:

351493
-65420528 -319200124 281938392 -243030029 244900496 -570872008 52841766 182153888 912987928 -158197847 -473753020 43761118 702442453 -502117549 179997670 -546970454 18172439 719328900 990575790 -178284670 -331865042 552484075 -912475593 261856511 941316106 774986368 -196495611 341476223 17253...

output:

175188849604926

result:

ok 1 number(s): "175188849604926"

Test #178:

score: 0
Accepted
time: 103ms
memory: 71912kb

input:

351493
136020442 -407945112 215331829 -258606472 387189966 -854680638 -402299432 -373760413 91412518 -200811200 171278908 807971697 -350468752 618611569 -906023448 337541927 -943004294 -792533998 284039226 -600926572 482837480 -742022492 385225391 14509436 649519632 952101582 -991977901 -227941692 6...

output:

175047257115123

result:

ok 1 number(s): "175047257115123"

Test #179:

score: 0
Accepted
time: 115ms
memory: 72056kb

input:

351493
-319183121 217266622 -554162123 -887487202 -467221512 -302722286 541946616 901281185 307699442 -994257033 -385791468 831714258 -956751305 953924227 824551911 5636518 -144137731 998080048 -880076587 722963365 -678521573 -623544948 79774904 -987734894 -641294122 466058728 900345239 -929585521 -...

output:

175421098737436

result:

ok 1 number(s): "175421098737436"

Test #180:

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

input:

351493
461213467 442821714 858159757 -974980336 -340590323 -408213885 -177493330 -704873715 243119393 572433156 -997816355 -284870110 -25423109 171052354 223942182 177252042 -807754343 679764323 991601901 -653616208 946599173 -610187386 313254207 -629220630 -824575478 -627178667 715776485 -908309152...

output:

174723697074483

result:

ok 1 number(s): "174723697074483"

Test #181:

score: 0
Accepted
time: 85ms
memory: 73312kb

input:

351493
97185549 700337588 224550035 -704548225 -757946055 427193766 -815364814 -23740162 -795762343 137965904 645479857 -108395464 -382692354 -10491144 -785956085 809097396 -946973680 702189425 842664537 378856918 -956843207 474327025 -956579491 91828032 210912927 936153557 -121709927 576217749 4800...

output:

175371015504178

result:

ok 1 number(s): "175371015504178"

Test #182:

score: 0
Accepted
time: 127ms
memory: 71892kb

input:

351493
-119289431 572990354 556911997 -386094238 368112637 -557300778 -661776872 -385824802 -36132014 -115383592 960306692 -886709826 -167875847 32123482 -752938273 -681215799 -944366443 -836577888 972620699 -655700146 840053065 833328262 608660418 738908333 160863620 428953876 -483594613 782052349 ...

output:

175460317376406

result:

ok 1 number(s): "175460317376406"

Test #183:

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

input:

351493
-388326813 641154166 5555713 415481240 -644367940 -861727104 -972837030 -827213820 -460663503 -522027839 190385091 408508359 -507537486 -696949905 -93643521 92303080 -770395156 931669815 975165238 410702528 551423367 900044150 601993950 -322575867 313842740 634112282 -94095540 -622762676 7278...

output:

175238721952917

result:

ok 1 number(s): "175238721952917"

Test #184:

score: 0
Accepted
time: 134ms
memory: 71020kb

input:

351493
-205024901 172341297 -227444258 -516517329 -518687846 -183352499 -216564614 44747848 -472721782 -532104421 -567252422 519861879 -5137725 -601069057 107538992 178523455 51961412 866247662 561277936 -863288699 708163396 -101138820 249382719 261891234 888166709 -622884003 462455987 637526405 -48...

output:

175120728800127

result:

ok 1 number(s): "175120728800127"

Test #185:

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

input:

351493
199766755 845665957 325318505 769540420 -728373905 -270003052 -159954970 -556074595 -185987999 -39846982 -456340100 -402552938 561093657 -321559617 868094705 -715832902 889833509 -756602783 -664564272 -360617912 -302971629 705961936 -118161613 964332484 166372232 -625842024 811075655 -5026758...

output:

175347407206571

result:

ok 1 number(s): "175347407206571"

Test #186:

score: 0
Accepted
time: 128ms
memory: 72056kb

input:

351493
-261694027 793696879 985814561 806696806 370120225 -525120520 -313937062 161166160 -26043256 759019640 454777919 -142493740 139671763 -174390823 -675714890 -310844572 744818026 358528072 253684942 786136384 200696239 87936748 -330264216 449212728 -537170596 682927747 -38895622 -696133839 -967...

output:

175288376903519

result:

ok 1 number(s): "175288376903519"

Test #187:

score: 0
Accepted
time: 112ms
memory: 72072kb

input:

351493
-632231520 712806350 -3176391 -498656443 -830080689 569641877 598351390 647494319 801487579 925362470 -900069725 -576869729 118336614 657539030 -892681284 941222455 -987616358 732727123 364441050 203885739 252775656 631313996 705912623 6543926 81945873 -522484389 -776918132 -587626795 4020422...

output:

175054552634427

result:

ok 1 number(s): "175054552634427"

Test #188:

score: 0
Accepted
time: 128ms
memory: 70944kb

input:

351493
368310271 -410005735 877000660 -250119017 -43936546 -306315861 278596782 -842992577 991249326 -263543408 679562877 -264771958 -560802561 393646756 -619496860 838368332 -734748433 972804814 988383243 862996428 515335834 -323482618 1134999 623437041 918092210 -945324049 588478916 -677470926 -19...

output:

174970413634070

result:

ok 1 number(s): "174970413634070"

Test #189:

score: 0
Accepted
time: 80ms
memory: 73496kb

input:

351493
335092003 -829636778 58461577 156413400 923880170 -187183604 792471185 92868786 793200164 -583070221 -428864158 -690455583 -516818457 -605308460 630250586 615331447 -162806369 -497090891 243672726 -303841254 -620547340 -942173806 -70116944 845013914 194254857 960785810 -833782512 -828341680 -...

output:

175114616356642

result:

ok 1 number(s): "175114616356642"

Test #190:

score: 0
Accepted
time: 136ms
memory: 71904kb

input:

351493
-55393486 848680293 -177842427 -444837327 -774492197 -369604853 -130155866 -836259112 447837037 907070709 952237883 -837327318 482141220 196651816 -936274399 615846882 15487605 -137566445 531713880 -124715016 336280462 261696714 479157921 -105943066 -321679176 633457323 880038116 -227066613 5...

output:

175363855699294

result:

ok 1 number(s): "175363855699294"

Test #191:

score: 0
Accepted
time: 116ms
memory: 72008kb

input:

351493
767757596 150347668 61115605 -163750445 -784614880 -450559657 126630448 762624321 -671786967 250034906 -266310848 767982351 -486468985 760674130 -724209279 697333919 -518924644 18536050 97870458 -12279443 -624665371 625051524 449716901 622753476 -275916303 166921038 467014732 -883379228 99956...

output:

175240732803282

result:

ok 1 number(s): "175240732803282"

Test #192:

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

input:

351493
-405702381 -946332420 476443049 247786718 722953676 -254795961 -7759737 98033672 872611596 416242331 349788288 -788596697 496138632 774078026 -272319447 25080802 -126576066 -697520255 -471805709 714961134 655112309 480099764 948297604 973070161 98097306 -973761327 786831209 -221409045 6366426...

output:

174733745958293

result:

ok 1 number(s): "174733745958293"

Test #193:

score: 0
Accepted
time: 83ms
memory: 73308kb

input:

351493
37305272 385887724 -745875425 -664359465 -827958905 985622821 -929115210 843150411 306421494 574370008 -960872453 701166599 -29731783 -678534791 525225653 256633473 -10333231 881064024 -826585941 546423549 485015255 -762824253 922920362 550724664 706366253 -42531101 727892823 -581534143 15804...

output:

175070445204353

result:

ok 1 number(s): "175070445204353"

Test #194:

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

input:

351493
84332740 441455668 479400754 -273384044 368876650 -43424800 -79258053 724670 740657968 -691463899 -388160504 -560661776 857459744 837427895 -186898681 -986100693 418562369 -5472132 232763643 -415028810 113752615 -473244727 91579091 339450410 -10200083 -608732385 187836021 166528 -488023807 43...

output:

175367069120386

result:

ok 1 number(s): "175367069120386"

Test #195:

score: 0
Accepted
time: 119ms
memory: 71896kb

input:

351493
109313906 898205638 182971167 -700894260 263191610 -335871352 212490122 954027903 -809521226 804989824 617041528 -914248152 85430886 -50334181 -497379535 854346199 -701043910 -422795739 41273279 854628274 616312820 358073698 216396153 -905048799 792092832 672786537 -613319223 -686416805 -5257...

output:

175215901475520

result:

ok 1 number(s): "175215901475520"

Test #196:

score: 0
Accepted
time: 123ms
memory: 70948kb

input:

351493
735244532 -781861286 786555 878996747 -848961709 794512387 866559343 -110525990 -526144799 192608497 13176074 -162342495 994846678 678416013 449700578 -461216243 -442706333 -114235410 -662856358 309667483 311216068 -24264323 176496407 -857595022 677891759 -176870791 977234333 -199722951 -7696...

output:

174716725597438

result:

ok 1 number(s): "174716725597438"

Test #197:

score: 0
Accepted
time: 93ms
memory: 73412kb

input:

351493
855584113 -553598575 -69098734 -69252913 -842239222 273570699 299474299 545636994 372402100 43664778 -780280156 -791465120 -746449197 823762974 -802928256 -476620084 -563476535 542775084 705018023 -202998219 900462920 246764822 -619106389 -414178709 653296332 -703433155 -326455558 -402499860 ...

output:

175539083927001

result:

ok 1 number(s): "175539083927001"

Test #198:

score: 0
Accepted
time: 127ms
memory: 71896kb

input:

351493
575002325 652005351 -100159890 41678156 -741341105 -944238694 -789070965 785767342 687080647 298554379 -760903505 613649706 788020856 387700481 -299571782 -680253121 -56102399 127162769 279643765 258575709 -508206076 -290706606 -162132873 -938799269 949632676 -729472736 -293569425 -672012834 ...

output:

175567708139244

result:

ok 1 number(s): "175567708139244"

Test #199:

score: 0
Accepted
time: 111ms
memory: 71796kb

input:

351493
983295531 731097039 -834706910 89958448 -466541024 884618537 138539080 678274919 -941664634 -218651801 -814371862 6707717 -191645544 -627365449 -744385670 113881015 3026574 486134254 145529225 813579354 198112709 190774427 -942628580 339994764 -284971289 748512250 473932432 -234592020 -541316...

output:

175285514770196

result:

ok 1 number(s): "175285514770196"

Test #200:

score: 0
Accepted
time: 153ms
memory: 70908kb

input:

351493
823394730 -914159064 235783417 905215018 -857722758 960611710 739159258 -427856824 -506907270 665315434 -762022095 -659327422 -52259350 743741500 -97671095 -804081057 -981521954 920859969 536850136 -369653070 32184197 -845436240 252596016 -613812981 376518336 913216380 792987461 74034518 5006...

output:

174817103506080

result:

ok 1 number(s): "174817103506080"

Extra Test:

score: -3
Extra Test Failed : Time Limit Exceeded on 1

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:


result: