QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#387238#59. Determinant of A+BzHanghang100 836ms9588kbC++141.9kb2024-04-12 10:29:002024-05-05 11:50:46

Judging History

你现在查看的是测评时间为 2024-05-05 11:50:46 的历史记录

  • [2024-05-05 12:06:46]
  • 自动重测本题所有获得100分的提交记录
  • 测评结果:97
  • 用时:830ms
  • 内存:9592kb
  • [2024-05-05 11:54:08]
  • hack成功,自动添加数据
  • (/hack/617)
  • [2024-05-05 11:50:46]
  • 自动重测本题所有获得100分的提交记录
  • 测评结果:100
  • 用时:836ms
  • 内存:9588kb
  • [2024-05-05 11:38:15]
  • hack成功,自动添加数据
  • (/hack/616)
  • [2024-04-12 10:29:00]
  • 评测
  • 测评结果:100
  • 用时:817ms
  • 内存:9664kb
  • [2024-04-12 10:29:00]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;

typedef long long ll;
const int N=503,H=998244353;
ll n,w=1,dt,a[N][N],b[N][N],f[N][N];
ll Ksm(ll x,ll y)
{
	ll s=1;
	for(ll i=1;i<=y;i<<=1,x=x*x%H)if(i&y)s=s*x%H;
	return s;
}
void GuassB()
{
	for(int i=1;i<=n;++i)
	{
		int z=i;
		while(z<=n&&!b[z][i])z++;
		if(z<=n&&z>i)w=H-w,swap(a[z],a[i]),swap(b[z],b[i]);	
		for(;dt<=n&&!b[i][i];dt++)
		{
			for(int j=1;j<=n;j++)b[i][j]=a[i][j],a[i][j]=0;
			for(int j=1;j<i;j++)
			{
				ll d=b[i][j]*Ksm(b[j][j],H-2)%H;
				for(ll k=1;k<=n;k++)a[i][k]=(a[i][k]+(H-d)*a[j][k])%H,b[i][k]=(b[i][k]+(H-d)*b[j][k])%H;
			}
		}
		ll ivi=Ksm(b[i][i],H-2);
		for(ll j=1;j<=n;j++)if(j!=i)
		{
			ll d=b[j][i]*ivi%H;
			for(ll k=1;k<=n;k++)a[j][k]=(a[j][k]+(H-d)*a[i][k])%H,b[j][k]=(b[j][k]+(H-d)*b[i][k])%H;
		}
	}
	for(int i=1;i<=n;i++)
	{
		w=w*b[i][i]%H;ll ivi=Ksm(b[i][i],H-2);
		for(int j=1;j<=n;j++)a[i][j]=a[i][j]*ivi%H;
	}
}
void GuassA()
{
	for(int i=2;i<=n;i++)
	{
		int z=i;
		while(z<=n&&!a[z][i-1])z++;
		if(z>n)continue;
		swap(a[i],a[z]);
		for(int j=1;j<=n;j++)swap(a[j][i],a[j][z]);
		ll ivi=Ksm(a[i][i-1],H-2);
		for(int j=i+1;j<=n;j++)
		{
			ll kk=a[j][i-1]*ivi%H;
			for(int k=i-1;k<=n;k++)a[j][k]=(a[j][k]-kk*a[i][k]%H+H)%H;
			for(int k=1;k<=n;k++)a[k][i]=(a[k][i]+kk*a[k][j])%H; 
		}
	}
}
void Heisenberg()
{
	for(int i=1;i<=n;i++)for(int j=1;j<=n;j++)a[i][j]=(H-a[i][j])%H;
	f[0][0]=w;
	for(int i=1;i<=n;i++)
	{
		for(int j=1;j<=n;j++)f[i][j]=f[i-1][j-1];
		for(int k=1;k<=i;k++)
		{
			ll s=1;
			for(int j=k+1;j<=i;j++)s=s*a[j][j-1]%H;
			for(int j=0;j<=n;j++)f[i][j]=(f[i][j]-a[k][i]*f[k-1][j]%H*s%H+H)%H;
		}
	}
}
int main()
{
	cin>>n;
	for(int i=1;i<=n;i++)for(int j=1;j<=n;j++)cin>>a[i][j];
	for(int i=1;i<=n;i++)for(int j=1;j<=n;j++)cin>>b[i][j];
	GuassB();GuassA();Heisenberg();
	for(int i=0;i<=n;i++)cout<<(i+dt>n?0:f[n][i+dt])<<" ";
}

这程序好像有点Bug,我给组数据试试?

Details

Tip: Click on the bar to expand more detailed information

Subtask #1:

score: 30
Accepted

Test #1:

score: 30
Accepted
time: 0ms
memory: 7768kb

input:

50
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 179093706 0 0 0 0 0 873235003 0 873022990 0 0 0 0 150372208 0 0 0 0 0 0 0 0
540031202 441544333 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 30490606 0 23238599 0 0 0 0 0 0 0 0 0 0 0 0 0...

output:

0 436083536 175535903 554959884 223039496 58344364 587204040 55300817 397840744 155512976 415872342 477738866 352386530 53242600 485943331 139434001 914586784 544887336 464494428 399973492 144143987 524998117 938746522 91863621 401839366 833514493 170911469 632598634 939655150 515206919 825564296 65...

result:

ok 51 numbers

Test #2:

score: 30
Accepted
time: 0ms
memory: 7800kb

input:

50
0 0 0 0 0 0 865147437 0 0 0 0 0 0 0 0 0 0 0 0 0 892479829 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 19576557 0 203729377 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 874545437 0 0 0 0 0 0 0 0 ...

output:

0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 

result:

ok 51 numbers

Test #3:

score: 30
Accepted
time: 0ms
memory: 7812kb

input:

50
666159473 440670429 510738291 504202619 0 350557853 590762418 810462395 181323356 0 457188244 491622090 347541380 751726940 231615249 726500956 954377758 617126798 391240582 467481921 418356623 149910257 146581619 315774821 236385812 117496640 634748946 315228151 853935226 0 437123244 978656468 0...

output:

39398860 926439968 438765155 724976248 594213695 167425923 587528267 284768667 73653406 259805677 82462983 83407685 573878321 72264113 545576724 360658776 119045660 422987649 743658284 583131760 441616546 970274465 724248398 797307152 690695173 36182380 685387007 25419367 914743956 46860078 34161074...

result:

ok 51 numbers

Test #4:

score: 30
Accepted
time: 0ms
memory: 7960kb

input:

50
0 234506790 0 715154759 99115010 231025742 755030988 0 0 0 146417655 0 915617978 0 0 691020395 173510973 456428247 0 394265079 0 0 0 953534270 0 874971542 898266718 0 948375902 0 0 0 0 0 0 0 0 0 252854252 0 0 0 768939131 0 0 694491359 0 0 0 796110525
216175608 0 0 0 0 0 776824419 0 0 0 357690362 ...

output:

141015794 599342787 680312504 471591675 511065406 380019480 980173887 270063339 145784225 19477689 272449207 44932257 678205945 917259961 409809006 853493157 888639735 174617060 845340173 711609565 679190927 330758264 923635224 552477622 768958302 787141361 9445917 85097768 377489202 136240899 51315...

result:

ok 51 numbers

Test #5:

score: 30
Accepted
time: 2ms
memory: 5848kb

input:

50
750536234 0 423676829 156973666 342391475 0 269587546 0 701752131 0 899144010 0 924599123 262658456 856118037 0 524095212 0 0 0 774140585 687450839 790346327 0 407213499 0 114640383 315078797 0 0 484458308 211129135 0 0 0 480554292 0 874606521 0 611141255 0 921918077 246086190 303213450 0 2924878...

output:

155382429 300500458 304766564 977267809 594424161 900971743 44146589 250595784 101389855 972453646 884960270 7931762 86956582 540581970 858382127 905566730 611945476 873806623 10039781 119616718 609682806 574528865 847145348 563674497 740042325 849319090 706797348 196452175 207228386 266078263 39163...

result:

ok 51 numbers

Test #6:

score: 30
Accepted
time: 3ms
memory: 7848kb

input:

50
951551567 37325813 0 79423443 2068034 885871026 775224147 766930667 258343511 0 777151789 616527418 839682916 396041163 192573703 229048803 949340586 713895147 489792300 801462648 511168369 532394611 578197063 0 46862575 0 91404922 5829914 885897421 602414159 537885052 632019550 478337906 5808696...

output:

172239906 397628189 65902517 739611316 606825620 317141817 898397451 332318466 785876316 141064857 923661827 968467916 274852115 805878656 303903040 838001254 985212733 520145210 60645158 573733802 545172206 666691725 828173167 502849531 428149875 699142908 118642244 957305916 406881362 562364767 17...

result:

ok 51 numbers

Test #7:

score: 30
Accepted
time: 0ms
memory: 7884kb

input:

50
309662455 925260045 380458486 843640570 965373173 650915700 138051394 119077249 295978183 909543019 511188539 348716022 622002079 19527119 85705277 7249996 79416775 806285823 95669866 224916201 135747133 521008347 424739729 486738258 0 369962069 13717241 561591243 604129407 145237193 480525322 75...

output:

825688824 540628594 439887429 685373725 936186060 957959036 921337616 356646111 941433456 866832138 92318348 117189572 917417557 69389825 46502857 801017869 403881868 261681551 94260642 399097582 602397903 412668467 173331089 487315640 770492173 128054143 896637397 836755572 488248033 794745384 9337...

result:

ok 51 numbers

Test #8:

score: 30
Accepted
time: 0ms
memory: 7936kb

input:

50
0 0 0 0 383027169 0 0 208745194 0 0 0 0 789827586 0 0 0 0 0 0 957781870 0 376819021 0 0 0 0 0 0 0 32762228 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 685108828 0 0 0 31162248 0 0 0 0 0 0 0 0 0 0 0 0 287855447 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 428557577 0 936324734 0 0 0
0 0 0 0 0 0...

output:

775672102 899406105 138974825 284554021 439791308 679440971 56702915 375692313 254494551 575509916 698159258 568976457 459285971 550889826 310494448 696598077 711659911 687912159 946546315 418932057 78733833 533431077 442596236 608325577 157268402 533785766 787543359 698758806 104403620 662063171 88...

result:

ok 51 numbers

Test #9:

score: 30
Accepted
time: 0ms
memory: 7696kb

input:

50
364748839 262117607 229058772 39217561 836544708 680427904 0 167060375 0 0 0 325438302 680857978 795124158 794384489 0 0 507003998 0 38838073 592621708 0 333857788 0 525278280 471076164 0 0 12016187 871658269 535394530 0 0 0 205105629 0 24024226 26471712 0 667726596 668881591 0 748795155 24862755...

output:

19315775 912843787 52761420 26875862 170766436 456152379 818800455 954588564 575129864 687470630 882985676 247888802 157345617 292048118 711964963 563600686 383928804 658358185 517437405 281816603 166685835 731719637 517569287 799739471 47888845 913373011 486096310 548828883 227591739 311720874 9009...

result:

ok 51 numbers

Test #10:

score: 30
Accepted
time: 3ms
memory: 7736kb

input:

50
613159520 120230035 0 0 0 107985603 473752771 563716516 511053599 0 238148580 381267084 508973915 630544517 0 683351340 688345418 714423495 0 0 299406852 0 168512896 105972039 172382433 0 0 0 0 838501389 0 0 291120745 0 297721353 96576710 0 0 0 228631559 667457592 0 206646684 0 19768735 169168361...

output:

463624995 439862174 479380459 229452974 435054695 422090445 963750343 436659964 938434610 841526809 844957371 55885658 946912074 407254481 167883846 89420404 721282411 955425050 954583434 682905399 433742387 953303584 455057117 559633338 55246999 503504963 671369161 142065745 723354271 27670570 1057...

result:

ok 51 numbers

Test #11:

score: 30
Accepted
time: 3ms
memory: 7892kb

input:

50
0 553073844 0 0 185474714 0 0 165131165 0 0 0 0 471868746 0 225330982 243602709 464651512 0 0 0 694758665 0 0 0 3356517 0 719284954 0 432203775 701293785 619218464 459628715 0 0 905423662 0 704913997 0 0 0 0 0 0 0 307765491 0 0 0 368396500 0
0 758743838 737470744 0 411526935 942384883 0 0 3970849...

output:

190390624 278098951 970368470 554798908 929972629 2064694 835880388 783564820 110425758 187144546 642839161 169225450 909221534 347359128 13825966 770209532 692807943 644879599 337044720 38521070 874900945 607898468 175185261 218774843 912519161 7634914 710990592 612214049 666855766 759436403 548984...

result:

ok 51 numbers

Test #12:

score: 30
Accepted
time: 0ms
memory: 7888kb

input:

50
0 935132232 922479325 829628501 0 0 122620498 0 2125127 0 0 0 0 0 291521697 0 0 191823577 0 305867399 670295514 788712071 0 0 0 814117690 746769765 0 990259627 293346449 757274779 225597030 825653984 696961412 440829479 0 0 347083760 293376060 0 578066628 356394960 245673957 593965820 70929583 95...

output:

365276356 346433201 659925285 379736722 585351978 182847082 809826239 894265514 691197399 960770297 958338379 161323498 265833112 355548531 849789491 917747682 181904683 793390971 610294685 448292125 145277673 790555407 678908869 745458180 217585495 597248433 322696478 127248297 57412372 326437577 4...

result:

ok 51 numbers

Test #13:

score: 30
Accepted
time: 0ms
memory: 7924kb

input:

50
0 0 0 0 0 0 0 653268736 0 0 0 0 923400103 0 0 0 0 0 0 51950688 0 824969388 0 460444975 702445148 978015637 0 0 0 0 0 489824231 0 0 0 0 0 449386884 115289049 0 0 0 94109678 190707537 0 0 0 411511570 725349198 0
569112969 0 278750645 0 0 0 0 0 0 0 0 0 898212643 0 0 0 0 0 976396348 0 0 0 113455683 8...

output:

912781524 197004987 137167756 957392362 387778118 864497427 119285409 684960451 444790098 469780596 66969634 320879723 343586163 981156433 819814952 781189325 333824820 348180934 991783170 725011288 948964346 183733191 106697480 201527162 365200012 411520363 684954456 750874130 580893772 797116812 9...

result:

ok 51 numbers

Test #14:

score: 30
Accepted
time: 0ms
memory: 7896kb

input:

50
565507246 314920979 617400579 0 347909100 482965068 0 943592379 426613146 689661661 693209941 0 309698521 525971242 713008253 248403259 761703141 114146900 672280131 329245982 568497403 663964541 0 0 266815209 271495850 610215970 879120790 22892118 0 983172469 747657846 0 729004601 738351762 3570...

output:

752051056 893203475 298293881 770108696 912187958 230358498 172303922 982771058 990264844 357890956 184147644 213424789 106419075 209352933 197010773 247534867 752661578 729514702 363083607 684664711 396779377 336124979 101061626 990495304 862347524 967418807 608267243 714855227 732538495 633196960 ...

result:

ok 51 numbers

Test #15:

score: 30
Accepted
time: 0ms
memory: 7856kb

input:

50
153402384 249536261 391968390 71764933 929070196 0 769106166 854490361 43220499 537021205 158958303 560200888 554198327 824491228 0 892500839 982549276 421593995 972245922 0 640799234 102571123 57137283 49862521 307213248 631517677 204583661 732871349 70649187 142829407 0 0 957530813 243527838 13...

output:

66098008 154772819 526070139 874583106 685024473 551304193 882675354 27993655 282996049 559498732 147513688 532084460 22648946 729803353 356215069 939422585 983732667 956052842 370905684 954815664 920305433 69821426 523816008 728065520 545821324 170960952 778590994 89054687 400829185 837618219 29635...

result:

ok 51 numbers

Test #16:

score: 30
Accepted
time: 0ms
memory: 7924kb

input:

50
0 0 195075377 313282836 0 829094024 0 0 0 54414629 0 0 0 0 0 0 0 0 0 0 101107810 824286656 731820848 0 17806992 55371469 0 0 0 0 0 0 0 0 0 546403652 0 0 539260707 0 0 570409177 0 238303240 0 0 0 279250353 253126978 0
518609079 0 124172658 463020205 729228591 0 0 0 0 0 0 0 0 217844798 810689787 20...

output:

832794440 122877402 598800756 434449399 604397104 570192167 920581352 225746237 692185559 9560091 741128506 267227537 868652148 840577421 222141931 59490027 728018399 843392605 477943481 905583651 299291827 453071758 685001395 603398138 321740146 625817983 289126980 191607783 34501032 517344371 5341...

result:

ok 51 numbers

Test #17:

score: 30
Accepted
time: 3ms
memory: 5964kb

input:

50
252699781 433731989 973415787 937044456 126494791 127875432 175959404 871925417 601947342 231477675 929706115 462495346 665152898 805248457 922983563 743451142 836069610 471997478 422341511 508926818 492030319 594432817 171025600 903298550 359364450 330216316 168546322 597294633 409021432 0 41816...

output:

215774306 942678020 317271254 479824180 689956688 956892095 247785951 811616468 106285022 881787148 232797221 515429441 8434216 66814440 371784316 687936395 823502426 882068341 965046427 17128268 110007714 563528635 85000796 377853394 309810368 48611668 799225675 965577923 306355762 254883342 985779...

result:

ok 51 numbers

Test #18:

score: 30
Accepted
time: 3ms
memory: 7884kb

input:

50
461838459 275829920 954593080 0 624989534 556119036 188579239 325686460 694571121 205355227 898677549 972101731 51526755 300733424 219591369 577992545 952062600 434299822 143352606 631047945 149239856 704676819 506035511 342554423 991163503 386829779 368675497 631050836 57118656 624456974 8192145...

output:

7364242 170202398 301843684 405651428 241658075 633429920 58938105 673086903 913416929 569840719 60036938 557835895 382586742 672591117 111574317 327071930 558815689 612571299 839354556 868339596 403314453 683346076 232190059 466794268 997513702 536853076 780332009 48300560 260469358 128613281 25392...

result:

ok 51 numbers

Test #19:

score: 30
Accepted
time: 3ms
memory: 7836kb

input:

50
144242090 138663925 0 145186490 0 640074989 0 0 300457549 0 472263692 0 0 0 0 0 585155750 232082021 0 0 181657415 284623532 0 0 0 885011257 218200942 0 0 493724919 260508642 601031081 521394894 0 0 0 0 293071670 23169998 0 564635899 0 0 700329397 658187184 0 601980192 345094044 318750511 66766512...

output:

737466238 704584659 151413207 288903107 363358549 1603135 908134201 701649008 389986949 247188836 286941145 82615549 410088043 90364163 964713338 132235675 867254207 969737988 548935144 33923167 71371717 317736991 378682062 692720944 506750847 649486611 150937174 287075748 799431512 458752720 983352...

result:

ok 51 numbers

Test #20:

score: 30
Accepted
time: 3ms
memory: 7880kb

input:

50
0 0 0 0 780480540 0 941930735 826515896 0 509875568 0 282124617 0 0 0 956594381 802617022 36623875 0 0 0 0 0 0 0 0 521781355 0 0 0 0 0 0 0 0 0 221542610 0 0 0 0 0 0 0 0 587835158 0 0 583116443 0
0 254091883 0 474215030 0 0 0 0 0 233535840 0 433855722 134241275 0 0 0 0 0 0 928246801 0 934579772 0 ...

output:

199906886 851988332 227125027 867744692 626456346 271359598 202755979 563079864 288107368 503303186 76230331 61995098 506706276 557815621 261146206 879287998 477229011 710896135 456863251 207463965 36314074 597707644 647309697 505515390 217305462 542011205 990325021 578313117 184372154 854354735 175...

result:

ok 51 numbers

Test #21:

score: 30
Accepted
time: 3ms
memory: 7804kb

input:

50
580958337 176371734 0 720498387 429565693 0 0 0 0 813185961 0 0 590639586 0 0 0 466058970 0 0 0 0 0 34118042 0 0 0 941684815 0 0 931295469 0 0 761159288 212378517 0 0 97884667 523804181 0 157318882 0 0 0 0 0 912910904 80441399 0 0 186057985
0 0 853601800 0 645071101 0 984183588 869289238 0 610940...

output:

182764951 78733283 398437658 878057646 830383448 915566273 668063585 33469544 105078494 483510288 868259640 452100549 402366751 700145793 87065057 837135736 310082310 177103642 581263041 246754059 332051339 897534302 226423068 801107657 50898535 455387807 947181772 758690582 482252094 257980373 9806...

result:

ok 51 numbers

Test #22:

score: 30
Accepted
time: 0ms
memory: 7848kb

input:

50
973633416 358566416 786185376 157734393 438478029 29985902 331805787 711234169 956524645 16588983 42651256 422865668 185815660 406927090 670638144 521229356 336968140 541209329 311156769 2303577 741735410 0 46453618 46775471 714418528 463456399 733269805 931768939 13899083 490409023 264174174 780...

output:

148093849 139340817 636228737 947216605 693770665 640020550 272839607 37406693 62431091 880784586 529461199 430478686 406825117 496163791 145802755 927818526 811971500 237280380 549276825 270452488 379141730 501678062 135917090 419909998 688360586 574755000 461643611 813107740 157918840 458974474 73...

result:

ok 51 numbers

Test #23:

score: 30
Accepted
time: 3ms
memory: 7832kb

input:

50
25979735 966393775 0 928472968 609658850 0 0 156012657 0 0 0 0 176310681 0 664235468 319366529 267745019 833526960 0 60960328 251788868 582082036 0 0 393114935 234233477 0 0 0 0 422930401 0 123167393 0 0 0 0 0 280529030 0 270528492 0 0 918904565 0 0 0 819771321 0 802058899
862165864 110010699 0 9...

output:

694007200 247877628 985150828 29493693 37996907 396838081 136113985 372717512 879881531 698462413 627190516 793346986 492356791 38418730 98776553 358339839 812257649 627436444 583014284 905212662 260422728 733429872 799579644 444744984 859926658 802860101 64911523 434961497 991333105 104839961 48771...

result:

ok 51 numbers

Test #24:

score: 30
Accepted
time: 2ms
memory: 7924kb

input:

50
497581250 0 504368585 0 960260382 0 778968898 98975462 0 0 0 588853415 0 0 0 0 127906591 0 0 598867689 0 117295897 0 616066957 0 0 0 0 0 0 0 0 610324869 32451029 120273935 898495494 0 0 612353683 648712135 228572602 0 0 0 0 0 0 0 559350233 0
882423251 0 545955511 0 845035306 0 0 557625815 0 0 0 4...

output:

404031134 59625346 103018326 685578699 87306405 789794370 932998433 580510452 700472477 504829476 427291573 410471355 858483956 982867575 619082197 959051394 543117033 975944901 107111191 873888801 333647267 141708224 36806304 149507046 846902762 100947135 464662955 41610799 455686329 958413695 7969...

result:

ok 51 numbers

Test #25:

score: 30
Accepted
time: 2ms
memory: 7876kb

input:

50
0 489849162 0 832007017 0 903150757 334177710 0 0 823099289 475770048 374106207 884332221 0 655713834 0 0 469101146 0 362198020 460811536 0 0 0 0 0 0 0 205860360 490179634 753197728 0 0 0 663488105 0 0 0 0 0 264827825 0 841295233 0 92635241 0 71133821 903059607 0 53743065
0 567252111 0 127837041 ...

output:

85847274 709598539 296015064 529064132 166326971 838672251 71661204 457887229 647223450 438823110 747962485 386968640 706370298 330982458 318612108 6258716 850387234 392395955 251431238 697510029 91160506 298755065 893453796 20352717 382799719 3866949 565391361 95948153 16743891 128719606 334615341 ...

result:

ok 51 numbers

Test #26:

score: 30
Accepted
time: 0ms
memory: 7836kb

input:

50
0 0 0 0 713415496 0 0 0 0 0 0 0 0 0 0 0 0 0 96404132 0 0 0 697272728 0 0 972877878 0 0 250149006 0 0 137261492 0 0 0 0 0 0 0 0 0 0 0 328460566 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 881970998 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 163420028 0 0 0 0 0 0 0 0 672072432 0 0 0 0 0 0 790452908 0 0
0 0 925771...

output:

97357575 864787305 612932328 237843705 154211040 294748918 806939062 579819378 329847330 216803181 371467348 99227331 552223549 374066687 244677208 364931752 603694573 765521963 442656183 955102586 484704420 237717630 868133648 642424483 343293713 817985343 472416782 771420125 258313040 766666234 71...

result:

ok 51 numbers

Test #27:

score: 30
Accepted
time: 3ms
memory: 7960kb

input:

50
0 0 0 63247615 0 791076461 0 0 0 0 0 0 0 587371500 0 674661496 815544254 361375659 446621745 0 84767228 505913899 0 296491943 619036861 0 0 0 213947693 0 0 477003450 133177000 0 0 0 0 0 0 0 0 0 865889671 0 0 0 0 0 0 0
0 0 0 94158102 0 717440503 351881080 47408518 0 334587139 898597115 554196508 4...

output:

581345430 517272544 27424311 177987117 360750626 992415401 852308621 685010590 767412462 911289934 82632874 823104414 495165991 603362092 329947880 546915693 606192519 894875574 117328437 593182883 356248492 705868109 740046066 903693935 633908731 57555246 841433278 664653857 57003951 267587808 6848...

result:

ok 51 numbers

Test #28:

score: 30
Accepted
time: 3ms
memory: 7812kb

input:

50
498256497 572638536 547555552 558596365 0 170374319 945776750 109115745 899680609 287733871 605659413 454660021 979491474 554517679 209340002 857539943 88707985 847516124 11893592 851894836 217334719 95345308 578201122 590857399 422722795 96468920 907022866 835594790 460901630 490370579 130446989...

output:

285926032 806226889 271806820 460919109 815187481 729948370 928610112 692016758 656619963 724160494 52022224 121036944 72433641 66312299 386964036 954066486 564246907 508090523 13874624 382680865 688956522 495611396 520875596 412003224 988341366 152148134 220716020 2342792 242286157 590024029 266437...

result:

ok 51 numbers

Test #29:

score: 30
Accepted
time: 3ms
memory: 7808kb

input:

50
0 29598781 915598378 673859700 923225830 0 794314879 311128153 743126892 968414910 180626182 0 0 409916085 442492237 547276361 598588906 247154035 0 621616064 370562272 713869834 0 656987868 492847689 478264939 0 769414081 0 0 925189393 140269195 992737892 969701394 192341663 0 0 217282392 585645...

output:

45540938 196013144 508280975 746238134 40158821 261426345 928031034 706339153 693950812 393345583 319363717 996205530 48226765 599834058 399735294 667864750 857603756 8448720 512795237 655354651 830282365 21454267 25371740 703766982 750221051 329472918 210313069 171312495 383239000 654028336 8604671...

result:

ok 51 numbers

Test #30:

score: 30
Accepted
time: 2ms
memory: 5968kb

input:

50
0 0 0 0 806896459 178851573 0 0 0 0 0 0 0 0 0 599043664 0 0 0 0 0 549487629 93627576 0 0 0 0 0 0 0 0 0 0 0 0 0 0 887716132 625632408 0 0 0 0 236156358 0 0 0 11187294 0 0
889604636 0 612734600 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 341925621 0 0 0 951380590 585561852 0 0 0 0 0 0 0 0 0 0 0 0 0 0 623...

output:

142543483 862236128 93045642 467709387 939841554 248542887 207650437 712328858 389217012 120390497 20736181 173917445 880740963 671339911 757068330 203638185 782636829 477868926 15340737 268510264 849046033 909127661 190920536 402521186 580436351 233311368 927186296 715067990 1367065 581163913 98690...

result:

ok 51 numbers

Test #31:

score: 30
Accepted
time: 3ms
memory: 7928kb

input:

50
305014160 524382709 829941526 867540297 696553015 372724335 923147031 927887059 692347678 353161846 801931193 450058388 674050463 819839640 0 0 861292516 33837861 499813197 683767863 859840355 149657342 0 689351189 89154173 967748954 41641626 540976207 915663608 879204096 371498939 174257078 5519...

output:

157036115 56649934 942810863 711416759 721169155 968975774 299761915 24435827 580465286 40388399 559138132 76551404 528569577 933633188 850164729 767187716 590242225 757554243 347274597 261824939 825810159 464254161 720731024 550330762 265387290 830846453 891396266 881564150 747368494 832572540 2146...

result:

ok 51 numbers

Test #32:

score: 30
Accepted
time: 3ms
memory: 7836kb

input:

50
0 332805608 325297760 0 344420757 0 706065384 352055777 66248264 705470852 798882102 0 701575525 93780210 0 337137716 0 210440501 0 0 0 0 0 676149101 0 0 0 0 427965227 192501836 0 977879842 0 0 0 0 0 0 0 471451788 920212926 533522365 985961100 0 0 167343404 779631306 0 580523963 510745807
0 0 0 0...

output:

40647678 695167686 319899684 573020731 43008672 348043132 6361129 936377018 817838989 196660535 274771565 49330069 789735301 163430420 459304914 278623975 339678485 754436822 24918136 501929588 237948081 100389814 260627121 644465712 757872460 419123770 777728667 820109391 634956939 703872042 989546...

result:

ok 51 numbers

Test #33:

score: 30
Accepted
time: 3ms
memory: 7856kb

input:

50
774291169 0 859529726 0 493529599 730293941 0 927780780 0 90003560 906022607 188622688 0 898371072 93648392 447723197 527046109 335828481 0 372572473 413327975 975432600 489494224 0 0 874721427 809666984 792652457 19448597 332505912 0 387762529 644440178 511432771 0 590977110 373349689 0 0 642656...

output:

857701700 730527904 799500956 220566009 530145222 709230354 283218022 386878028 605175903 405290595 213117058 415037406 115843352 384868123 245556121 107558625 618546482 375296675 144125047 981827353 347528569 452270651 426237316 963797709 664820153 407752376 472188109 428141094 868678217 645521290 ...

result:

ok 51 numbers

Test #34:

score: 30
Accepted
time: 3ms
memory: 7728kb

input:

50
0 0 0 388106480 0 0 0 0 0 0 0 726735858 727629619 19530760 970102742 0 0 0 0 0 0 866697017 0 0 0 0 0 0 200676068 0 0 666563613 0 0 616589527 477640512 112623387 399842997 0 0 0 16498067 0 311785339 780951107 774214216 0 575187491 0 0
715827288 696421005 0 0 320186545 0 0 0 0 827655278 0 0 9434544...

output:

668790306 12695991 97695933 896758218 606343432 921354325 729411541 823528290 334057480 731305005 118127204 395854528 811854348 793655304 804004122 667019605 253542898 220907687 10771731 864845070 285347036 222123530 242578418 900932739 554322442 520438707 209680665 619543135 96694607 531574412 8034...

result:

ok 51 numbers

Test #35:

score: 30
Accepted
time: 3ms
memory: 7936kb

input:

50
548365635 0 0 628673659 24569340 350843588 686380951 0 362523323 569539717 0 0 816885391 842065384 285014910 207977595 0 401466283 0 865947035 719245735 0 0 853602543 0 424578774 0 0 0 510439500 393611031 113997285 159638737 0 0 0 0 51987534 66119512 0 390269973 349982174 0 71373464 0 340263199 8...

output:

166001607 108781528 916306867 116948543 573164607 313827725 805618172 795471778 216763439 605248199 15734873 634871377 554715379 48034611 770616013 794658570 824366068 204449306 994763732 581801775 856191415 69483590 525866154 691224679 563959625 33020205 802088912 930085697 561742832 323576256 4637...

result:

ok 51 numbers

Test #36:

score: 30
Accepted
time: 3ms
memory: 5988kb

input:

50
623854785 304005771 406290664 0 41564565 37069561 884658200 430602250 159970262 237962649 245537439 221834343 38391591 14380035 927743396 639313295 0 297541432 613208148 664515667 663767400 410333709 628103063 479882945 0 902566760 0 166216371 857382674 698130055 393879082 751793436 863883247 485...

output:

674806401 741682958 201555155 298756951 881362561 17857923 313761131 947193326 48766868 563376515 809889425 116461449 255078727 758797987 568706357 9675541 34447330 59549843 386422922 969909001 161875097 682935893 121459727 794541864 67711002 621382122 418319101 763366589 192393231 952181966 4410161...

result:

ok 51 numbers

Test #37:

score: 30
Accepted
time: 3ms
memory: 7892kb

input:

50
23953710 942062415 282414067 876526153 723678111 77639049 741112372 779115497 825632577 0 0 481623040 900669589 955495584 0 634137664 183523027 0 63347453 271594522 928157564 253523883 425731139 774311836 979137060 222464496 851811065 464511022 930926036 27023400 725831139 99540209 576617697 8032...

output:

793136815 299798696 776663738 472389824 585654543 24313117 544869420 810026620 739365151 201290348 653421767 745716909 627651545 68273786 984290642 322513051 549981241 209392201 163071781 233565458 578951148 845362391 521117267 247375312 187890661 293987020 538224479 163157434 512063476 927991598 10...

result:

ok 51 numbers

Test #38:

score: 30
Accepted
time: 3ms
memory: 7888kb

input:

50
0 330126912 761822894 0 0 0 158036589 0 737202818 480950783 0 392571500 0 0 865761847 0 0 875389691 0 65857494 0 0 0 879288950 0 0 160155808 0 694472534 0 0 456915740 820317828 344380651 0 0 78558584 971574124 260793266 0 545508978 0 0 608434855 0 0 0 0 0 516284419
0 266027892 0 154716877 4872361...

output:

907937858 333176009 504634006 435640307 906293664 146955027 292679278 620651151 216852333 802175508 468571925 602591501 415172154 946183935 437517972 590710777 783184568 8952977 893085490 670421550 665446930 435895703 405171450 311472370 724578617 862094824 106007853 512786305 846323966 582624060 98...

result:

ok 51 numbers

Test #39:

score: 30
Accepted
time: 2ms
memory: 7964kb

input:

50
0 818395784 0 0 0 0 0 0 0 0 0 162087450 0 0 0 0 0 0 0 0 0 0 374157100 92429455 0 974888260 0 0 0 0 0 950195440 0 0 0 654560385 0 0 0 0 495137499 0 0 0 0 0 0 396148535 0 0
0 0 0 746462155 0 0 0 0 0 0 0 273876984 0 0 0 0 0 0 0 0 0 0 839311055 0 0 0 0 0 0 0 0 860328282 0 0 0 0 0 0 0 0 0 0 441929136 ...

output:

311358073 585387891 655707376 299881307 81413627 170086102 202039793 317178981 714605563 641519333 172392992 627222152 41704735 655843865 717378299 811246403 915131946 65739475 372309952 701156810 462213071 631268661 805294374 678169240 480879721 588732879 567413885 52944438 52325943 779117868 24388...

result:

ok 51 numbers

Test #40:

score: 30
Accepted
time: 2ms
memory: 6088kb

input:

50
0 0 162410724 0 0 0 0 581795795 0 0 0 0 738157787 0 0 0 0 0 0 246549102 0 282166311 0 0 0 17344778 0 120161209 0 0 0 0 0 0 107669105 0 289985463 341458944 490099463 0 0 473993658 729296893 870911213 0 882949393 0 0 189912017 368781900
370822456 0 0 0 0 0 891536134 64391251 825229480 149703315 0 7...

output:

230790550 815392739 346301771 786807347 498679438 425772591 310259802 218834393 6376164 504816895 17381038 550276033 794640696 653968337 960367937 604641478 15654294 228422368 274721023 753297071 708562338 354858135 413945057 853277076 306531072 115366992 144466029 24982108 784723329 348221181 33346...

result:

ok 51 numbers

Test #41:

score: 30
Accepted
time: 3ms
memory: 7808kb

input:

50
0 748322581 0 976287797 570217711 0 658475738 0 0 0 0 994285744 0 747343903 585265190 993635615 410940776 0 870116631 0 428736943 536191999 0 0 67293026 0 0 0 0 0 424698450 753856593 688389327 0 440839962 0 0 0 228254935 303066230 0 472672358 0 0 959453769 0 0 746106330 0 24534893
893320752 48256...

output:

190746992 942275232 43420365 167054362 718277116 284380361 64475062 602001077 528221620 232725948 197034139 484651906 135631677 311691841 838614271 43203127 104343492 491335050 498844747 215116236 34736183 901969771 590617700 131435460 240609836 69126001 394238569 510905976 306795954 668162760 26757...

result:

ok 51 numbers

Test #42:

score: 30
Accepted
time: 3ms
memory: 7908kb

input:

50
659679211 887444054 950467016 669383168 0 380526526 0 58321598 904704388 928225642 0 0 660784175 637443014 0 14815691 348612461 548003585 127013126 865120620 504624975 0 0 961337996 0 478505318 761398957 331550134 671831036 0 627866955 0 0 0 192674192 0 64915241 283788264 467568874 994907561 3893...

output:

751170063 459380603 17428798 72181087 566770270 627669728 309020767 130524326 384944066 100742110 332720520 775976292 597968492 677194995 265955996 516915970 274485477 750096902 800139323 482514420 320967706 39768790 482252702 826013703 230523085 972122363 372606099 81087279 207957159 992735007 4133...

result:

ok 51 numbers

Test #43:

score: 30
Accepted
time: 2ms
memory: 7876kb

input:

50
0 0 445650594 0 0 0 90261759 0 756661699 0 0 39243289 0 503158511 284707284 159678952 0 0 113065249 0 0 414908158 0 0 95190501 0 864405077 0 356517212 0 832621711 516398645 0 0 0 6033557 729041165 696616797 878385991 162986376 702898357 0 208342518 912620651 291364335 0 0 28717209 0 750793339
0 5...

output:

868173945 157983621 411960143 845477560 454924703 200401939 349536211 559843199 790642175 102949575 194222699 62412692 21401601 895925385 367300651 510977538 595176837 591732551 966139431 716467690 819442346 351950542 545888665 740353796 524666863 655777604 963870825 747096076 376830784 646402574 36...

result:

ok 51 numbers

Test #44:

score: 30
Accepted
time: 3ms
memory: 7940kb

input:

50
516694033 0 0 389134662 790951478 994789894 307335177 0 107285834 41984540 638431227 350926190 773370377 43913898 163300629 336873818 249343051 289110448 567414091 750066195 0 0 550453260 0 77060010 0 880906451 568353025 572903557 283261505 691487704 744401814 0 640119991 686143439 0 723868840 18...

output:

710785408 258614471 280616050 809502839 167086833 549648741 814787119 746715907 340003078 651722997 501538991 939420447 883125492 493206125 432577427 214686049 427533966 475238700 991287603 760459589 25308190 99755810 72921439 983065457 124110840 686133262 490500910 261840713 353107010 41138380 7740...

result:

ok 51 numbers

Test #45:

score: 30
Accepted
time: 0ms
memory: 7900kb

input:

50
967566325 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 97025499 0 0 0 0 0 0 0 0 0 0 0 0 0 0 681962237 0 0 0 426401463 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 2971894 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 760152446 0 0 0 0 0 0 0 0 0 ...

output:

0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 

result:

ok 51 numbers

Test #46:

score: 30
Accepted
time: 2ms
memory: 7656kb

input:

50
0 0 0 0 0 0 0 0 0 601994969 0 949624861 0 0 0 0 0 189909022 0 0 0 0 0 0 0 0 0 0 297373466 0 0 0 0 0 0 0 0 0 0 0 0 0 715226708 0 0 0 0 0 366584320 0
0 0 337509530 0 0 0 0 0 0 0 0 0 0 0 0 554921127 0 0 0 811072710 0 0 0 0 0 0 119012291 0 0 0 0 0 0 0 0 0 0 0 0 0 0 934514902 0 0 0 0 0 0 0 0
0 0 0 0 0...

output:

0 217935058 764758840 49084207 290314817 742663136 351538744 142490411 850650836 474509674 847788340 722649199 493724322 970206176 836431558 939804978 682935776 377495668 499529783 269616316 403674156 493556532 277806730 304416944 621120686 178047553 265029279 112831582 353139718 906574942 987577000...

result:

ok 51 numbers

Test #47:

score: 30
Accepted
time: 2ms
memory: 7832kb

input:

50
0 0 0 0 978575776 0 0 0 86576330 0 0 0 21112650 0 589780574 0 113027972 449001024 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 907214561 0 0 0 0 0 148630535 0 0 218551611 0 0 0 0 0 0
0 0 0 0 854708917 910125062 0 670498988 0 0 103749096 0 0 0 0 672484046 0 0 304406519 924567163 0 0 0 0 0 0 560847641 0 0 0 0 0...

output:

743600900 349921176 100281389 274541791 811835898 395851426 821376811 406007819 695501413 407232025 947120169 294725381 739823567 446740301 551397440 589103790 112026739 552410832 961833290 337864780 512477874 184731855 382365383 731735043 651952793 254227655 649223336 768129149 174742116 55397990 1...

result:

ok 51 numbers

Test #48:

score: 30
Accepted
time: 3ms
memory: 7960kb

input:

50
0 132209594 716626774 535878994 0 160262728 364766293 682267638 851701097 324031828 667418164 0 821509027 701453824 618678041 207889615 0 140159194 551380978 437414515 0 403921269 61097152 928171091 824874864 146110298 124656797 709686966 460925048 687012606 462690046 221074109 474099944 0 663743...

output:

375620769 361745329 303846439 719665299 858315893 888263007 744539029 75978407 538848753 392032122 654018585 559061358 13741725 687312256 798113670 673724256 349754728 25239562 592317063 830523845 773082219 137861727 183890917 416775515 403029622 887934611 602015515 183084627 374924049 277426762 528...

result:

ok 51 numbers

Test #49:

score: 30
Accepted
time: 3ms
memory: 7836kb

input:

50
0 842271149 0 0 0 542036267 566777386 464376314 0 0 0 0 415683391 960406466 0 984451164 0 0 0 0 112722102 578354173 821083156 0 291859921 23249616 0 0 107927744 0 29834484 0 0 109248233 10860749 107681232 468397111 0 0 913282031 183507904 0 0 0 875911498 0 565836932 932849549 108546296 0
0 0 3414...

output:

815068959 850534887 586983298 341678914 924579734 763937634 691107205 590283061 58313875 494080799 146991347 616345215 72126158 742714811 423887684 135743179 608079299 575248548 738701435 86188739 564933507 293508025 690000887 321341189 734489786 17650832 500089213 544967507 885002444 43282933 89749...

result:

ok 51 numbers

Test #50:

score: 30
Accepted
time: 3ms
memory: 7848kb

input:

50
0 0 981287875 380457066 539174827 0 0 131639557 718287563 868503091 479238697 0 0 0 0 946816520 100258275 491661051 974526588 0 0 909987774 590027277 823384630 317597394 0 394786037 660346393 0 591703919 0 567715581 403015394 0 357383266 0 205377525 754891468 0 803135709 511012854 0 0 0 0 6624696...

output:

601560997 975123492 438446363 499705379 703636752 636894009 571169180 726358989 759845764 717489298 517706096 981990236 853265134 792072930 19655990 721995317 28876610 201362006 954514062 109269570 852813877 480808369 842634627 783036515 264423011 771083904 9536693 954783510 735514584 654772000 6671...

result:

ok 51 numbers

Subtask #2:

score: 30
Accepted

Test #51:

score: 30
Accepted
time: 762ms
memory: 9520kb

input:

500
0 0 0 0 0 482890969 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1077401 0 0 210804413 0 508044994 0 0 0 398405351 0 0 0 0 0 0 0 171917316 0 0 0 0 0 0 0 0 0 0 0 429230725 0 0 0 0 0 45665526 0 0 0 925078893 0 0 396149045 0 0 0 595858405 0 0 0 0 0 57208...

output:

197564738 776338137 450758758 86100992 615937344 559163914 131406243 401619987 648971457 913370895 305548921 393285962 915689006 605421884 878026660 574429045 573319599 364491109 147359659 277065849 558700076 605737085 416281513 704015976 726983797 205432732 98536178 813856939 885823882 179190007 66...

result:

ok 501 numbers

Test #52:

score: 30
Accepted
time: 756ms
memory: 9476kb

input:

500
524607538 0 0 195818222 598065776 740433868 0 0 0 0 0 0 584106646 508647343 0 0 0 385186156 0 0 0 748826373 0 0 0 709897533 880532113 0 0 0 0 0 0 0 0 0 480030784 0 0 33138693 0 0 0 0 207633173 0 147270533 0 0 0 0 0 172244086 0 277695222 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 385815514 0 947687701 2...

output:

824902737 425089841 111211053 92073920 901320657 429074841 361764105 48023490 25552725 331325644 371920415 490762692 97825049 353418227 830075621 213540283 914362905 715071163 806070758 910602330 331161583 233467656 349280733 861811395 290106373 974369041 564660867 275072365 75983469 522667016 70935...

result:

ok 501 numbers

Test #53:

score: 30
Accepted
time: 770ms
memory: 9444kb

input:

500
0 398190947 624334613 582987942 0 921082574 0 17867538 0 882918848 0 0 0 0 0 0 90859360 987403245 0 0 0 0 0 0 0 0 0 0 0 0 0 403400811 206487768 0 18198869 0 0 0 651523038 0 192277158 0 0 880215749 0 48622723 931175582 0 380135628 0 187644792 600194396 306519041 0 0 0 646257188 970944730 0 0 0 0 ...

output:

529709961 782389501 427087181 171575244 807733566 948768941 227470506 729203216 600000785 571222788 426790680 997717883 801879168 465532628 857973057 906830434 952735394 45567541 544721647 962896743 742244545 82712613 959513155 325015907 233661306 823083787 9502003 223215085 232986129 315518020 8220...

result:

ok 501 numbers

Test #54:

score: 30
Accepted
time: 767ms
memory: 9480kb

input:

500
889477026 0 0 645288850 0 0 0 597784849 276670294 0 11781884 0 0 0 0 102328605 122546943 466795725 0 0 0 0 0 977951016 0 0 0 0 0 0 0 0 0 441400243 0 607727318 981252464 766407804 0 0 0 0 0 0 0 12674018 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 237392793 0 844896171 0 0 0 868060819 811717128 ...

output:

288878507 103918577 627843934 606769115 701195355 204316868 196692744 438647132 951275060 766989005 835482214 627619453 577296224 790244323 616919000 110197298 388088246 175117021 852199104 324078444 225511335 640854847 85621368 111580084 763931389 778949588 371252595 131117484 889375904 163824154 8...

result:

ok 501 numbers

Test #55:

score: 30
Accepted
time: 763ms
memory: 9468kb

input:

500
0 0 472907806 0 0 0 0 0 0 0 0 298001434 0 896885439 0 0 0 0 0 0 0 0 0 0 0 8484835 0 0 0 0 0 0 0 0 0 0 0 0 954775009 0 0 0 0 288641397 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 512435253 0 0 0 0 0 0 0 386794324 0 655001487 0 0 468232155 0 0 0 0 0 0 0 0 75466257 0 0 0 0 0 0 74943...

output:

748044473 495654177 770128837 803264522 500024782 363477079 635161545 374689496 309423961 60457280 220603722 725110497 211554274 483787612 417355740 860542674 222191891 579668034 936747129 810487962 924847717 455094044 702324829 104318236 971133785 696909055 744480349 911219026 235872106 543656615 5...

result:

ok 501 numbers

Test #56:

score: 30
Accepted
time: 777ms
memory: 9464kb

input:

500
0 0 316262547 241295061 242829688 550075323 245190856 935894298 504227016 176442273 184386996 0 575589507 830192730 0 557943520 895719881 60265103 747418748 261971973 0 99105521 0 69394805 134350353 205033556 151945738 123374702 411264285 912324098 94051646 306060455 899455875 830911129 63742779...

output:

381911851 916241926 514339398 858059197 875456460 714921300 302795193 409031920 783184712 867455007 766476017 243857202 697599556 921790119 792928980 251505819 994285379 59773659 613948150 272434631 907707976 207774347 94674353 668702663 837211956 421611818 372233312 483621202 904224325 602569053 47...

result:

ok 501 numbers

Test #57:

score: 30
Accepted
time: 772ms
memory: 9480kb

input:

500
0 0 0 0 0 0 0 610990574 461613184 433655130 0 0 388974760 806398739 360535781 0 0 0 753732657 0 0 0 0 300470084 0 799888093 321915786 0 731888269 93322740 0 0 0 0 0 0 718357562 0 0 470844951 0 0 0 0 249536634 0 0 720846833 0 0 0 0 0 375498602 834962478 0 0 747200658 0 0 0 0 0 0 179664325 5290568...

output:

686260393 252245335 487730469 316503441 65416924 414972730 492614441 687219169 31213691 279281581 975310019 317336196 211707471 522955573 667053639 354126512 154392544 651273989 460079160 129443229 861736087 105977196 569334344 960887538 833748346 509178819 299462294 951455142 655102577 313951685 21...

result:

ok 501 numbers

Test #58:

score: 30
Accepted
time: 774ms
memory: 9484kb

input:

500
105334543 923544035 0 0 916350532 0 893135971 0 38147030 0 787201908 432732664 0 721024223 708486999 0 701283493 0 0 0 763668271 0 109489133 715738358 0 218182028 0 486065021 0 0 0 853561005 114023429 0 0 601209488 0 101719806 611085551 10556195 0 0 200722083 810064594 0 428296558 88047945 0 905...

output:

386146069 360751156 993393533 927105682 228457601 648163753 787797973 522013271 115473192 964895477 558385286 95058804 298276053 139741955 517593941 927888946 390532694 926469984 546568354 927488188 867723462 62784459 519368506 183331379 408840670 685223323 395691605 356482931 538780329 800704761 25...

result:

ok 501 numbers

Test #59:

score: 30
Accepted
time: 775ms
memory: 9504kb

input:

500
557789613 330510931 0 0 518024711 0 177752966 206203179 584083921 0 621770000 463398931 325609625 655715403 0 644837061 920744971 211652106 501844095 0 31815431 0 508411090 0 299431284 579451022 0 0 560290181 405509081 925573968 0 687385031 953919102 11971443 653210418 0 460457820 270650741 0 19...

output:

237337972 304001552 19756092 903398432 956462082 763470480 729301817 271753612 613700267 334841355 744710574 845246375 971151604 973253901 927943894 280393511 949928036 38722121 474176453 8825977 60878082 249547234 597102095 651053724 429068288 490083950 904742452 549860299 952659239 940608813 73417...

result:

ok 501 numbers

Test #60:

score: 30
Accepted
time: 756ms
memory: 9464kb

input:

500
197401552 830689262 490108468 0 0 0 0 776237119 0 0 699253214 0 0 0 0 0 0 0 655156087 0 14751376 0 0 0 0 228028861 0 0 0 0 503139922 29233876 0 0 0 291395502 182147419 0 0 0 0 0 924694232 0 0 0 0 0 295585170 0 0 0 0 0 0 0 985603432 0 0 50944168 0 0 0 0 0 799660697 0 0 0 131935150 0 0 0 542518152...

output:

343481215 28530470 415182965 106440692 639253380 869174304 723450686 994252880 231059922 452274668 353261722 628878909 809794578 375900072 590410066 750447055 418962912 956023947 26017162 793161094 816016177 757605421 521424576 503928843 225335613 154352919 240264199 356448940 826417044 553721500 16...

result:

ok 501 numbers

Subtask #3:

score: 40
Accepted

Dependency #1:

100%
Accepted

Dependency #2:

100%
Accepted

Test #61:

score: 40
Accepted
time: 767ms
memory: 9400kb

input:

500
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 735753672 0 616953113 0 0 0 264980273 0 708579394 0 0 0 0 0 0 0 0 0 0 0 0 0 219663254 0 0 0 0 0 138043665 0 0 0 0 0 0 0 0 0 0 0 0 0 0 940589441 0 0 0 0 0 0 0 0 0 0 617978124 0 772319017 0 0 0 0 124911028 0 0 0 0 0 0 0 404834039 0 0 0 0 0 0 0 0 0 ...

output:

331210462 100681053 723369270 480868722 825244229 565440608 495349810 56765296 363269881 74018889 866389339 372860428 754361394 280226096 206686366 558063020 177670688 502368379 913878853 220080469 867757432 128636391 253288248 573482118 749940496 997314746 872469997 498113087 215598944 616626262 36...

result:

ok 501 numbers

Test #62:

score: 40
Accepted
time: 831ms
memory: 9392kb

input:

500
883418095 491498061 62083360 225805244 686668840 746515171 123262362 537946588 147728931 145950413 611515496 22867441 652540098 0 679846205 359777684 371258819 584660992 222481543 675990414 867687680 941484757 654242680 473578022 422172405 165699157 491800925 372237437 174951984 777253591 277167...

output:

224793606 262733841 211201040 537179661 556930713 340201727 560280052 427611807 263948096 502443342 582595561 154528916 735215714 560632529 73082777 132025471 762520482 917498689 382111616 469836295 395291224 383290242 384091807 305164213 871869215 114897990 680783532 333117545 194565301 519044568 3...

result:

ok 501 numbers

Test #63:

score: 40
Accepted
time: 785ms
memory: 9512kb

input:

500
0 721822399 0 0 0 0 0 116010025 0 0 0 0 0 0 227847728 0 0 0 0 0 656930948 0 957916166 108607039 0 0 847184296 0 0 797596980 627553787 188626436 0 0 0 315896558 0 0 0 359329106 291877481 0 526827822 0 46148078 0 0 966106569 0 0 735926290 0 0 764479391 0 25558503 0 0 0 980946431 30767999 0 9905661...

output:

146079198 79273409 985957814 929480867 367600833 986894583 543420020 671733736 931532226 20944350 22970693 443485551 140947000 347010496 7168023 646964414 563508483 911940374 699544633 238378984 616704002 636049892 326783754 727832907 94244793 793307261 622974236 714478186 70120401 887239240 4636437...

result:

ok 501 numbers

Test #64:

score: 40
Accepted
time: 799ms
memory: 9508kb

input:

500
263179101 0 10857655 599336293 357876252 0 0 48990466 0 327504595 0 866885199 0 926631408 109892779 383950229 0 567878746 0 0 951047904 0 238329382 271610056 247884021 0 892621451 0 45800161 8141580 42446778 364864954 824373837 205629472 0 0 459340657 768768045 0 0 0 389690996 586517558 45657084...

output:

343395466 755512072 526081075 531706994 290394623 806180245 559132369 943811049 13477447 782366945 944432799 557732143 847604138 614210346 142762372 466351125 952666395 576882545 156428133 614765094 443434184 921609576 740404708 814125893 328126448 209393840 165072027 734864312 609421091 879859909 6...

result:

ok 501 numbers

Test #65:

score: 40
Accepted
time: 788ms
memory: 9564kb

input:

500
0 0 762842894 344762663 202558832 0 0 0 0 362814258 0 0 0 0 0 518133846 221066077 0 0 0 0 690165116 367594111 0 774002172 54951948 559576117 41979575 0 467436302 591066140 774353131 198750989 0 0 535991095 58589564 0 189653169 555288999 0 0 543249725 0 320475085 124012941 261295618 0 431712574 0...

output:

980903124 918680500 646346310 280022536 46040661 210508012 169817040 666096059 668847130 449187485 12536538 859716076 979204288 804111254 984984790 212029692 789220064 235577691 631656887 740623954 375178959 322234346 19449020 189487191 44121365 662920397 637564587 966306728 542278033 143481299 5413...

result:

ok 501 numbers

Test #66:

score: 40
Accepted
time: 787ms
memory: 9588kb

input:

500
0 395642662 0 0 45119994 0 114012673 0 0 772909792 0 0 0 792604043 0 0 0 258870590 0 0 0 0 365168102 502659405 0 0 653237255 476221190 0 0 0 0 419287757 0 0 158128041 0 86336372 0 0 0 0 0 838671929 0 0 420653230 714695718 303163027 0 0 698342467 371046930 0 659697486 0 0 206495618 0 0 326364312 ...

output:

934977461 963526395 915946130 506840883 718320059 646709541 469481459 443449267 477164535 117231542 942047664 121705975 189151201 21877539 644872615 159055626 357458303 479142786 857707034 548705590 948773391 221575203 946853672 945377404 554012089 438691543 404032739 462881297 336373993 883253769 7...

result:

ok 501 numbers

Test #67:

score: 40
Accepted
time: 764ms
memory: 9480kb

input:

500
0 0 0 0 0 0 0 0 0 0 0 0 332204291 0 605556578 0 442204529 0 393168666 0 167449904 63031150 0 223879722 0 527107776 868129393 0 0 0 0 0 0 697945522 701839682 0 366413577 0 0 0 0 678551650 361024494 0 672858093 0 129208859 777625774 0 0 0 0 0 0 0 0 305818736 980521659 0 0 0 553646020 306907405 0 0...

output:

987809280 185190494 417237960 235853667 549101474 115740807 754321070 699267472 599357103 930864645 817586382 784511398 444078346 276578635 61585449 794241565 257260651 103375610 37062233 651708192 902292375 274297854 353425854 391477472 736689785 716407170 538203574 738419315 452616372 430287119 59...

result:

ok 501 numbers

Test #68:

score: 40
Accepted
time: 794ms
memory: 9512kb

input:

500
0 869465655 490742244 46207767 619508500 0 491278499 0 259783704 0 590564214 0 131298890 81062955 789221344 310410215 0 0 567874934 869894634 0 294131806 0 671767785 546836218 0 978229946 0 0 0 736068616 0 55415242 0 0 759995253 0 0 551830118 0 583239229 211316505 968417867 0 0 797049205 4404802...

output:

830737131 166949164 854960837 671109456 965118516 807259084 707734232 836654088 461004488 381766066 311556904 201719562 805451350 952646979 227397341 887070576 34471157 657469771 991938568 984035885 490081314 163190801 497378011 227035057 474505919 173447641 369905983 986622131 689677926 47512847 63...

result:

ok 501 numbers

Test #69:

score: 40
Accepted
time: 817ms
memory: 9488kb

input:

500
674375490 479975504 606503293 171790279 430015988 0 0 0 995699986 475836884 0 826227132 875744784 912717643 547151689 0 373707369 0 124042069 995068393 0 46643558 622518945 0 636018538 541849855 0 225640573 682986582 495339753 972685231 217943019 0 590705977 169801873 901800528 470650011 6965728...

output:

60119448 779177970 404247673 108337612 943697517 252240815 927972921 925628740 398555373 94366209 22299582 554068427 924179997 231581601 228633931 546316718 706071489 39268739 810226557 329495286 176789586 791684851 951232421 559477266 484057810 15253845 596764899 920052665 189939570 238698462 15648...

result:

ok 501 numbers

Test #70:

score: 40
Accepted
time: 778ms
memory: 9460kb

input:

500
0 0 806695197 990074640 0 245296958 0 0 0 0 0 0 127766921 0 444995547 0 300277005 0 33004299 987217762 441926743 65411400 124126105 0 0 0 0 180527884 350312233 606258771 76859298 0 873623162 0 198041986 0 732810237 0 0 737523669 0 624112882 0 524877877 0 0 0 165633102 883495387 0 794612521 0 618...

output:

284304849 136185526 813506218 716614194 97564021 635292738 975601515 58744161 144052097 465290167 113718459 905864013 34228915 432479768 976536106 381621191 574852067 326324965 184130120 249343159 47009009 182388244 571649169 248119134 67515205 181999343 115277109 790827731 30372482 834114087 711330...

result:

ok 501 numbers

Test #71:

score: 40
Accepted
time: 769ms
memory: 9528kb

input:

500
0 0 0 729269042 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 667507622 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 431303107 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 746392067 0 0 0 0 0 0 ...

output:

143513866 34148053 207940478 747341213 389374496 961894241 41365210 459516717 982162619 714609770 731023178 884593131 829043378 123420440 358210661 11922836 596543554 438443134 86862204 515279472 282422510 309491407 25309478 135950299 993500689 613714777 818115589 661476448 247684569 696765911 61667...

result:

ok 501 numbers

Test #72:

score: 40
Accepted
time: 809ms
memory: 9480kb

input:

500
794748020 373506060 119224522 172606036 0 994451226 791227551 836433284 880306122 257252569 0 0 0 0 0 258163407 227991490 342747998 0 555076675 404319103 482521792 641173678 0 97631374 192735556 233266116 126870222 373676824 531067623 993763579 70065244 534839982 64581990 0 864541925 110701093 0...

output:

47183486 333405730 705518064 282939538 115332027 103081397 824858534 171240920 144893 32177236 838472638 52596071 778760982 71232001 128462480 906813435 881339940 538879497 420741382 756039742 11760688 536203755 354410527 608237339 121568275 622618256 701143140 796932806 655852225 621627289 58484164...

result:

ok 501 numbers

Test #73:

score: 40
Accepted
time: 801ms
memory: 9572kb

input:

500
671911605 108687570 658682017 0 34069334 170132321 906885793 0 776342283 16687958 0 0 0 625369945 457045345 423300242 0 0 905236356 360568766 936112013 0 0 768265853 799497695 574799582 0 78733482 34517288 0 0 795495739 700298779 786430067 0 0 246928677 229047209 0 0 360602058 23065863 0 6155276...

output:

631998603 510025433 88256732 854117498 85232912 950938565 409521709 40823452 431914718 96894038 835151397 677540698 227880167 427157442 101840073 948848957 924653831 907899425 61254630 873456348 334001312 763766027 193005608 318562840 450121403 129295166 119166809 802140627 205411045 223808330 20584...

result:

ok 501 numbers

Test #74:

score: 40
Accepted
time: 758ms
memory: 9568kb

input:

500
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 360530477 837571376 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 969021023 0 0 ...

output:

955100030 373681738 883655023 506517936 321575415 109285371 640999862 641104781 70207408 181992666 914718918 227872407 628031645 192617633 845181156 939118301 18098887 637669631 64249574 666525743 481130908 152810934 836652679 489577592 779208732 254849619 800773623 736156022 562020881 543214780 329...

result:

ok 501 numbers

Test #75:

score: 40
Accepted
time: 783ms
memory: 9468kb

input:

500
539497286 0 0 0 942914458 0 0 876169575 0 822512869 883921684 843582982 0 138333114 0 786017459 813185359 0 0 0 0 0 0 895584364 210618919 0 691830032 103844866 239394900 0 0 0 719782589 518035010 0 632109246 0 0 0 0 0 0 0 0 0 710663260 0 0 0 891469371 715088303 0 0 0 353911073 248357368 0 0 0 0 ...

output:

432846665 668188376 39057045 151645515 726809809 892823074 143549081 837506533 724909886 65116781 997171810 78170336 867165973 580773046 474302623 54716352 574059115 777026313 337952656 91549083 75556354 880420645 652752395 659699112 512273119 930995582 852112172 997789168 862325118 352335882 804218...

result:

ok 501 numbers

Test #76:

score: 40
Accepted
time: 836ms
memory: 9392kb

input:

500
135854092 152599308 533512158 593324261 401645035 854732116 580159443 512449535 328590787 101290992 376656779 923856308 560691286 562117670 941102045 463152087 955091307 512379859 689006812 980563330 330098559 639510649 395839659 287736329 326660840 97262445 461825903 374976868 970193220 2540055...

output:

340206046 230464648 228373872 56018003 528707102 266262146 153696197 949566303 16869298 335552522 218072546 580488190 66660516 108158748 614189968 224272626 864346178 363545129 374191038 981866945 89975847 458268310 349940700 670660512 886636937 354178458 504233657 348127567 780294845 147552123 6374...

result:

ok 501 numbers

Test #77:

score: 40
Accepted
time: 796ms
memory: 9492kb

input:

500
260315257 0 0 0 0 0 543946013 472039629 573867911 0 0 0 443957491 663452366 768586366 0 495337648 0 0 655592143 0 0 0 612074512 0 0 0 0 671407248 169386984 0 0 0 386231541 646675540 0 0 0 0 899026935 0 532447191 538947899 403005080 106261745 0 454386328 469251372 966485216 900311961 0 0 65924693...

output:

131682932 258592914 946800516 580090787 741175483 51406633 753472272 670784282 989011460 163906525 992845509 415105701 837848797 647145762 912745236 582112883 311390905 239745250 993806520 472085037 665036371 9822952 270058337 484645365 410720251 522166600 837533511 374460072 894932409 222591394 715...

result:

ok 501 numbers

Test #78:

score: 40
Accepted
time: 821ms
memory: 9508kb

input:

500
497826025 0 598183743 0 368180600 977661790 0 360433474 311167138 859052379 814027173 499750014 423577562 935355740 864546608 934516248 161025520 0 0 312661998 32275105 950321876 464756934 918059698 257523200 0 923372062 573528353 0 510588529 189623109 280020746 0 0 930037414 134423937 0 9745207...

output:

560239408 540351820 760180758 22433772 640634199 938335844 857965452 149379637 324559907 224368328 691175177 683940263 412098335 654880572 975679609 458198171 704122481 83267157 433096450 803678448 750798561 364758016 497089590 344708295 246326018 438977755 865542549 481563130 212862999 787154742 11...

result:

ok 501 numbers

Test #79:

score: 40
Accepted
time: 807ms
memory: 9568kb

input:

500
154741199 952091926 840792484 732421624 496536056 757803089 794751030 0 0 126756840 538049946 0 847790092 0 0 404033404 0 594034731 832268862 472187478 229974970 0 143591138 812318367 785025289 472888581 0 104229368 336047667 0 156366980 660170147 180154281 921119344 0 152635184 680499321 190473...

output:

752740500 416034228 481110279 708779572 516675639 854379888 419099392 254012299 98104047 511428181 274346676 406500731 4086146 571686838 232623105 597792660 534228793 521229973 35863781 709614790 464393281 940092372 7193664 290190261 533244656 467159014 360896572 645271584 583303801 792754122 778706...

result:

ok 501 numbers

Test #80:

score: 40
Accepted
time: 802ms
memory: 9484kb

input:

500
0 0 205755929 786259550 867889281 85284271 417805366 827557543 695376165 659028676 0 0 0 0 0 367462236 0 0 0 966454576 0 217848487 0 0 0 0 635480959 307598892 265486003 0 0 433484963 0 0 873090288 87599265 0 54788720 0 0 421252045 462315454 99219226 0 0 0 0 959456281 0 0 0 74003622 0 242306554 3...

output:

591031801 234875468 589571901 815285970 870663332 292144795 776539456 78951189 565707461 767152636 96011485 832782130 213356066 834747820 117201773 208360702 630330983 517103054 119798936 628884582 814038499 980542070 940607887 750339025 347458916 901826775 348914441 905308459 580891272 302480835 16...

result:

ok 501 numbers

Test #81:

score: 40
Accepted
time: 574ms
memory: 9444kb

input:

500
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...

output:

0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...

result:

ok 501 numbers

Extra Test:

score: 0
Extra Test Passed