QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#943920#10181. 안전 지대wtc#100 ✓1808ms74436kbC++142.1kb2025-03-20 08:51:342025-03-20 13:41:39

Judging History

This is the latest submission verdict.

  • [2025-03-20 13:41:39]
  • 管理员手动重测本题所有提交记录
  • Verdict: 100
  • Time: 1808ms
  • Memory: 74436kb
  • [2025-03-20 08:51:39]
  • Judged
  • Verdict: 10
  • Time: 1336ms
  • Memory: 74436kb
  • [2025-03-20 08:51:34]
  • Submitted

answer

#include<bits/stdc++.h>
#define fo(i,l,r) for(int i=(l);i<=(r);++i)
#define fd(i,l,r) for(int i=(l);i>=(r);--i)
#define fu(i,l,r) for(int i=(l);i<(r);++i)
#define eb emplace_back
#define vi vector<int>
#define ll long long
using namespace std;
const int N=1000007;
int n,L[N],R[N],U[N],G[N],p[N],t[N<<2],f[N],pd,o,bh[N];
vi A,B,C,D,X,Y,ans;
void upd(int x,int y){while(x<=n+n)f[x]+=y,x+=x&-x;}
int qry(int x){int s=0;while(x)s+=f[x],x-=x&-x;return s;}
int find(int x){return x==p[x]?x:p[x]=find(p[x]);}
void mer(int l,int r,int o,int x,int y,int c)
{
	if(t[o]==-1) return;
	int mid=l+r>>1;
	if(x<=l&&r<=y)
	{
		if(t[o]) p[find(t[o])]=find(c);
		else mer(l,mid,o+o,x,y,c),mer(mid+1,r,o+o+1,x,y,c),t[o]=c;
		return;
	}
	if(x<=mid) mer(l,mid,o+o,x,y,c);
	if(y>mid) mer(mid+1,r,o+o+1,x,y,c);
}
void ins(int l,int r,int o,int x,int c)
{
	if(l==r){t[o]=c;return;}
	int mid=l+r>>1;
	if(x<=mid) ins(l,mid,o+o,x,c);
	else ins(mid+1,r,o+o+1,x,c);
	t[o]=t[o+o]+t[o+o+1]==-2?-1:0;
}
void fnd(int l,int r,int o,int x,int y)
{
	if(pd) return;
	if(t[o]==-1) return;
	if(l==r){p[find(t[o])]=find(y);pd=1;return;}
	int mid=l+r>>1;
	if(x>mid) fnd(mid+1,r,o+o+1,x,y);
	fnd(l,mid,o+o,x,y);
}
vi find_union(int _n,vi A,vi B,vi C,vi D)
{
	X.clear();Y.clear();o=0;ans.clear();
	fo(i,1,n) bh[i]=0;
	n=_n;
	fu(i,0,n) X.eb(A[i]*2),X.eb(C[i]*2+1),Y.eb(B[i]*2),Y.eb(D[i]*2+1);
	sort(X.begin(),X.end());
	sort(Y.begin(),Y.end());
	fo(i,1,n)
	{
		int x=lower_bound(X.begin(),X.end(),A[i-1]*2)-X.begin();X[x]--;
		int u=lower_bound(X.begin(),X.end(),C[i-1]*2+1)-X.begin();X[u]--;
		int y=lower_bound(Y.begin(),Y.end(),B[i-1]*2)-Y.begin();Y[y]--;
		int v=lower_bound(Y.begin(),Y.end(),D[i-1]*2+1)-Y.begin();Y[v]--;
		x++;y++;u++;v++;
		L[x]=L[u]=y;R[x]=R[u]=v;U[x]=U[u]=i;G[x]=1;G[u]=-1;p[i]=i;
	}
	fu(i,0,N<<2) t[i]=-1;
	fo(i,1,n+n)
	{
		upd(L[i],G[i]);upd(R[i],-G[i]);
		if(qry(L[i]-1)>0) pd=0,fnd(1,n+n,1,L[i]-1,U[i]);
		ins(1,n+n,1,L[i],G[i]>0?U[i]:-1);ins(1,n+n,1,R[i],G[i]>0?U[i]:-1);
		mer(1,n+n,1,L[i],R[i],U[i]);
	}
	fo(i,1,n) if(i==p[i]) bh[i]=o++;
	fo(i,1,n) ans.eb(bh[find(i)]);
	return ans;
}

Details

Tip: Click on the bar to expand more detailed information

Subtask #1:

score: 3
Accepted

Test #1:

score: 3
Accepted
time: 1ms
memory: 32592kb

input:

15
0 -62020 0 82718
1 -92844 1 59311
2 -44093 2 91841
3 -38281 3 42638
4 -19638 4 87825
5 -81191 5 58428
6 -5974 6 32491
7 -48100 7 52183
8 -1733 8 54140
9 -45703 9 9825
10 -16984 10 86340
11 -70319 11 18089
12 -90130 12 8538
13 -90265 13 41100
14 -46303 14 52159

output:

15
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 

result:

ok 15 numbers

Test #2:

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

input:

15
0 -84086 0 39890
0 -83763 2 45746
1 -28747 3 22732
2 -78660 3 1482
4 -18035 5 1905
5 -71900 5 44051
5 -76516 7 34646
6 -94224 8 29828
8 -14618 9 84080
8 -77427 9 76143
10 -99586 10 25519
11 -41242 12 24837
11 -41857 13 34523
13 -77827 13 84438
13 -60929 15 69871

output:

15
0 0 0 0 1 1 1 1 1 1 2 3 3 3 3 

result:

ok 15 numbers

Test #3:

score: 3
Accepted
time: 2ms
memory: 32592kb

input:

15
0 -17045 0 86168
-1 -99028 3 7835
0 -53815 4 40171
3 -29932 5 35980
4 -56844 6 5093
4 -97849 6 89263
5 -82298 8 1559
7 -16000 8 31819
6 -87091 9 3124
8 -68739 11 42460
10 -71294 12 16006
9 -28230 13 96344
11 -80133 13 36161
11 -65389 14 52122
14 -64661 14 63237

output:

15
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 

result:

ok 15 numbers

Test #4:

score: 3
Accepted
time: 7ms
memory: 30824kb

input:

5000
0 -13042474 1 473280891
1 -960271121 1 137031294
2 -1267609 3 265241066
3 -526017037 3 831947342
4 -100561422 4 653747031
5 -380891036 5 379183708
6 -117885124 6 840783142
6 -386461363 8 867654325
7 -190287732 8 724025110
8 -757751626 10 677155323
10 -502973632 10 638290028
11 -753240036 12 768...

output:

5000
0 0 1 1 2 3 4 4 4 4 4 5 5 5 5 5 5 5 5 5 5 6 6 7 7 7 7 7 7 7 8 8 8 8 8 8 8 8 8 8 8 9 10 10 10 10 10 11 11 11 11 11 11 11 11 11 11 11 12 12 12 12 12 12 12 12 12 12 12 13 13 13 13 13 13 13 13 14 14 14 14 14 14 14 14 15 16 16 16 17 17 18 18 18 19 19 19 19 20 21 22 22 23 23 23 24 24 24 25 26 27 27 2...

result:

ok 5000 numbers

Test #5:

score: 3
Accepted
time: 10ms
memory: 32744kb

input:

5000
-1 -379657485 1 26551384
1 -887322283 3 139899938
1 -712701663 4 816392465
2 -734514569 5 250970078
4 -815751019 4 999871493
5 -72735914 7 490331417
6 -678916241 8 117046714
7 -350955889 9 237727579
6 -793265401 8 358861982
7 -745586817 10 22314889
10 -777922685 12 21649627
11 -55126884 13 1792...

output:

5000
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 2 2 2 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 4 4 4 4 4 4 4 4 4 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5...

result:

ok 5000 numbers

Test #6:

score: 3
Accepted
time: 8ms
memory: 34836kb

input:

5000
-2 -451305204 2 874789169
1 -477936955 2 437735874
2 -424135716 5 998947645
3 -606575612 3 743621744
4 -235973322 4 51028661
5 -764580793 8 232882905
3 -18608992 9 688277578
7 -979013927 7 271364346
5 -396243069 11 362295075
7 -733422009 12 998878238
7 -52871737 13 405009227
9 -357013732 14 811...

output:

5000
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 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 5000 numbers

Test #7:

score: 3
Accepted
time: 1116ms
memory: 74436kb

input:

500000
-1 -123139265 0 99101346
0 -295651607 2 798130605
1 -583839059 3 216881454
2 -268283406 3 580693410
4 -532988152 4 708251547
5 -315218149 5 72593596
5 -762860767 6 509539375
7 -421165720 8 927443581
7 -425516201 9 335062871
9 -730508472 10 584534235
9 -942101642 10 781907442
11 -365993245 11 ...

output:

500000
0 0 0 0 1 2 2 3 3 3 3 4 5 6 7 8 8 8 9 9 9 9 9 9 9 9 10 11 11 11 11 11 11 11 11 12 12 13 13 13 13 13 13 14 14 14 14 14 14 14 14 15 15 15 15 15 15 16 16 17 17 18 19 20 20 20 21 21 22 22 22 22 23 24 24 25 25 25 26 26 26 26 26 27 27 27 27 28 29 29 29 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 3...

result:

ok 500000 numbers

Test #8:

score: 3
Accepted
time: 1209ms
memory: 74312kb

input:

500000
-1 -194786984 1 947339132
-1 -591298988 1 800999249
0 -590240404 2 104469341
3 -140344449 5 368312366
3 -248177747 5 54376008
5 -7063027 7 520177794
6 -28924591 8 417206727
5 -459289174 7 592484128
7 -733526579 8 338495964
9 -718343664 11 929693803
9 -512017986 11 91638113
10 -962847385 13 57...

output:

500000
0 0 0 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 7 7 7 7 7 7 7 7 7 7 7 7...

result:

ok 500000 numbers

Test #9:

score: 3
Accepted
time: 1282ms
memory: 74308kb

input:

500000
-1 -266434703 2 426980696
1 -813317441 3 98835185
-1 -301674457 3 655620741
1 -348841981 6 787335104
2 -668400052 5 400500470
5 -403940614 5 926292794
3 -663584635 6 988437591
7 -423783700 10 962557383
5 -410133175 8 973332838
8 -337582635 10 979886078
8 -786967039 11 474997713
8 -969766942 1...

output:

500000
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3...

result:

ok 500000 numbers

Test #10:

score: 3
Accepted
time: 1305ms
memory: 74208kb

input:

500000
-4 -338082422 2 980251190
0 -740368603 5 396671121
0 -644512291 3 838175920
1 -220903024 6 206357840
1 -14993428 4 451657640
5 -22156564 9 37440501
5 -929648460 6 559668454
5 -756874446 9 627597930
7 -718143552 11 976765931
8 -620385119 11 956449426
9 -61916091 10 153324604
8 -198024861 12 61...

output:

500000
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 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 500000 numbers

Test #11:

score: 3
Accepted
time: 1337ms
memory: 74240kb

input:

500000
-4 -704697433 1 828488974
-3 -962387056 2 30943545
-2 -355946344 5 389327318
1 -429400557 4 699009506
1 -435215733 9 797782102
4 -714001443 5 779991991
4 -564308503 7 835932027
6 -721368972 9 292638477
3 -321121221 13 316635511
5 -608220310 11 301608993
7 -631832436 12 536684204
6 -794879001 ...

output:

500000
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 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 500000 numbers

Subtask #2:

score: 4
Accepted

Dependency #1:

100%
Accepted

Test #12:

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

input:

15
7 -461 8 676
-928 -468 -923 1
41 -537 48 951
-97 -918 -97 937
-629 -768 -619 173
-250 -46 -249 991
-139 -584 -138 322
69 -557 77 750
-828 -183 -828 228
-528 -145 -526 360
920 -452 926 475
390 -886 397 536
-885 -421 -880 620
211 -583 220 252
-311 -8 -307 558

output:

15
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 

result:

ok 15 numbers

Test #13:

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

input:

15
372 -696 422 780
-693 -687 -661 240
-28 -94 16 586
-52 -470 -39 40
46 -522 127 280
782 -371 859 880
-142 -651 -70 356
145 -995 244 785
250 -99 344 351
-30 -404 22 367
-124 -850 -99 133
489 -741 553 352
-536 -659 -522 560
127 -360 205 60
58 -506 77 519

output:

15
0 1 2 3 5 4 7 5 6 2 7 8 9 5 5 

result:

ok 15 numbers

Test #14:

score: 4
Accepted
time: 11ms
memory: 32928kb

input:

5000
587489 -925102 590140 207063
-725090 -381935 -719473 843961
-797329 -834120 -793333 16583
860083 -393682 865140 635373
-45600 -232968 -43430 954333
237963 -882068 245190 385155
911047 -330252 917922 572994
-73285 -775624 -66436 141957
576301 -641198 576621 801822
775581 -356250 785265 581033
45...

output:

5000
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 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 5000 numbers

Test #15:

score: 4
Accepted
time: 12ms
memory: 32920kb

input:

5000
677793 -811565 690261 119956
708960 -453376 722919 820199
419226 -134077 423523 675057
-253268 -707407 -233885 451786
319798 -616400 334926 432310
572692 -170099 586560 826132
484100 -871435 484797 672146
-694154 -325388 -681354 808722
-120611 -965505 -118859 575608
-858432 -182840 -856835 4010...

output:

5000
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 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 5000 numbers

Test #16:

score: 4
Accepted
time: 10ms
memory: 32928kb

input:

5000
-630387 -435324 -596257 895636
-341408 -630018 -308046 712599
-875617 -181944 -857030 574425
545605 -499897 585694 972967
105139 -728327 134156 792928
400692 -109561 403336 185377
-889238 -458669 -888491 931233
-568792 -899315 -550815 733646
-789117 -937054 -751926 7278
-662814 -625612 -625846 ...

output:

5000
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 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 5000 numbers

Test #17:

score: 4
Accepted
time: 8ms
memory: 30876kb

input:

5000
430845509 -526576516 430896035 685123861
531098375 -283161821 531154189 957730301
-305544954 -875121338 -305484609 671547341
507324121 -916127369 507343588 501345916
50490851 -46958340 50514115 59323805
209406753 -471052386 209464878 968110882
445368160 -373168217 445370024 237320582
63210550 -...

output:

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

result:

ok 5000 numbers

Test #18:

score: 4
Accepted
time: 6ms
memory: 32924kb

input:

5000
-835473624 -144192774 -835208524 78211788
-265265492 -926970400 -265144963 495071883
-119046031 -174383188 -118915150 296052136
-615024156 -626581682 -614764668 762518633
768038654 -986973450 768170041 881380452
941182514 -126881850 941192572 50775830
-575825770 -528041910 -575730037 429239036
...

output:

5000
452 2235 171 0 1 1352 2 3 4 5 3278 6 1526 7 8 9 10 11 12 13 14 15 16 17 18 2252 19 20 21 22 23 24 25 26 27 28 698 29 30 31 32 33 34 35 36 1726 37 38 1229 39 2086 40 100 41 877 42 43 44 45 634 46 47 48 2270 3142 49 50 2429 51 52 475 53 54 55 1208 56 2984 1524 57 58 1730 59 919 60 61 62 63 64 735...

result:

ok 5000 numbers

Test #19:

score: 4
Accepted
time: 6ms
memory: 30876kb

input:

5000
-5000 -1 5000 1
-4999 -2 4999 2
-4998 -3 4998 3
-4997 -4 4997 4
-4996 -5 4996 5
-4995 -6 4995 6
-4994 -7 4994 7
-4993 -8 4993 8
-4992 -9 4992 9
-4991 -10 4991 10
-4990 -11 4990 11
-4989 -12 4989 12
-4988 -13 4988 13
-4987 -14 4987 14
-4986 -15 4986 15
-4985 -16 4985 16
-4984 -17 4984 17
-4983 -...

output:

5000
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 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 5000 numbers

Test #20:

score: 4
Accepted
time: 123ms
memory: 43956kb

input:

100000
0 0 1 0
0 0 1 0
0 0 1 0
0 0 1 0
0 0 1 0
0 0 1 0
0 0 1 0
0 0 1 0
0 0 1 0
0 0 1 0
0 0 1 0
0 0 1 0
0 0 1 0
0 0 1 0
0 0 1 0
0 0 1 0
0 0 1 0
0 0 1 0
0 0 1 0
0 0 1 0
0 0 1 0
0 0 1 0
0 0 1 0
0 0 1 0
0 0 1 0
0 0 1 0
0 0 1 0
0 0 1 0
0 0 1 0
0 0 1 0
0 0 1 0
0 0 1 0
0 0 1 0
0 0 1 0
0 0 1 0
0 0 1 0
0 0 1...

output:

100000
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 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 100000 numbers

Test #21:

score: 4
Accepted
time: 132ms
memory: 46004kb

input:

100000
-100000 -1 100000 1
-99999 -2 99999 2
-99998 -3 99998 3
-99997 -4 99997 4
-99996 -5 99996 5
-99995 -6 99995 6
-99994 -7 99994 7
-99993 -8 99993 8
-99992 -9 99992 9
-99991 -10 99991 10
-99990 -11 99990 11
-99989 -12 99989 12
-99988 -13 99988 13
-99987 -14 99987 14
-99986 -15 99986 15
-99985 -1...

output:

100000
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 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 100000 numbers

Test #22:

score: 4
Accepted
time: 1065ms
memory: 74276kb

input:

500000
84984507 -22341826 84984707 203050680
176786744 -881113367 176787050 664683136
668602209 -25493556 668602845 4295622
-619313663 -2177685 -619312965 937798274
-279207745 -219617548 -279206817 601661532
293536444 -524959860 293536846 963077830
-820451947 -70430441 -820451580 163708974
-40815725...

output:

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

result:

ok 500000 numbers

Test #23:

score: 4
Accepted
time: 1118ms
memory: 74316kb

input:

500000
254148693 -534601735 254149641 806139328
440242229 -285750789 440242667 530866901
-791216681 -283814959 -791214939 518497075
179096940 -190878253 179098709 741731379
428876996 -182159418 428879494 493246561
-423060765 -861199286 -423058592 314234920
-857497266 -417768502 -857495305 98377041
9...

output:

500000
0 1 163496 2 286444 3 4 5 200974 6 7 202000 8 46830 9 10 11 12 13 64742 14 15 16 17 18 19 325186 20 4702 21 22 23 24 276279 25 26 27 28 29 30 31 32 33 201761 34 35 36 69611 37 38 39 102475 40 41 42 83686 43 44 45 64980 216053 164404 46 255227 47 48 49 50 51 168977 52 53 54 55 56 305223 57 333...

result:

ok 500000 numbers

Test #24:

score: 4
Accepted
time: 1287ms
memory: 74312kb

input:

500000
-76722739 -152663235 -76719295 716448529
785419581 -206815772 785424676 616102620
-527320842 -247120581 -527314171 370763072
726767159 -980520942 726767989 76207443
321722437 -673648870 321723076 29782187
852659968 -359830124 852664617 846093742
-91122137 -21822464 -91116873 747274650
-334580...

output:

500000
94475 0 113439 83836 2405 70495 57862 1 57450 116266 5366 15099 142072 140124 102033 36220 29791 90414 138547 2 3 4 122014 124916 23664 82790 5 124882 46859 6 133574 142723 36551 62357 47804 21037 26696 39449 5517 7 40742 8 91081 104620 87426 9 10 38466 62655 134739 40592 109371 11 12 59500 5...

result:

ok 500000 numbers

Test #25:

score: 4
Accepted
time: 1411ms
memory: 74316kb

input:

500000
612203299 -138875713 612208740 35907528
-585407549 -850624351 -585389708 153444202
-357705520 -251415140 -357698487 995267867
748035001 -322379034 748045616 558718523
-396905331 -318696688 -396883665 146806126
537850239 -942030661 537872984 518693274
148486309 -881728867 148511851 939193104
6...

output:

500000
9105 3431 429 9730 5387 4009 3346 9365 9136 5989 4813 11232 8913 10876 10504 7440 10653 5396 6398 1993 577 5544 4039 2609 4628 8722 500 3927 8109 2482 9616 4329 8947 8343 6860 2371 9775 1506 98 6111 8503 2948 903 5436 6680 10521 1358 3730 9846 8653 4351 8564 3629 855 1016 0 1678 9943 8624 107...

result:

ok 500000 numbers

Test #26:

score: 4
Accepted
time: 1595ms
memory: 72676kb

input:

500000
-722368125 -940380838 -722278618 173531310
-838897452 -668444861 -838841476 932967949
-491255643 -786085865 -491158313 371247510
-660309063 -252075137 -660251682 498781217
16011851 -422445982 16076810 79551759
923137683 -114601258 923224864 622258272
-858203636 -364920245 -858140935 523666661...

output:

500000
1 1 1 1 0 0 1 1 1 1 1 0 0 1 0 0 1 0 1 0 0 0 0 1 0 1 0 0 1 0 1 0 0 1 0 0 0 1 0 0 1 1 0 1 0 0 1 0 1 1 1 0 0 0 1 0 1 1 1 1 1 1 1 1 0 0 0 1 1 1 0 1 1 0 0 1 0 1 1 1 1 1 0 0 0 1 1 1 0 0 0 0 0 0 1 0 1 1 0 0 1 1 1 0 0 1 1 0 0 1 0 0 1 0 1 0 0 0 1 1 0 1 0 0 1 0 0 0 0 1 1 0 0 0 1 0 1 0 1 0 1 1 0 0 0 1 0...

result:

ok 500000 numbers

Test #27:

score: 4
Accepted
time: 1647ms
memory: 70928kb

input:

500000
568312139 -632259482 568571972 655865476
441348329 -507293803 441443036 215132550
-940186369 -345513339 -939919037 290688935
498289257 -448142033 498344467 363369317
767592 -825828245 846010 64458222
-144247766 -132040386 -144051426 16501695
-782038001 -725219470 -781808158 931114098
34962031...

output:

500000
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 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 500000 numbers

Test #28:

score: 4
Accepted
time: 732ms
memory: 72600kb

input:

500000
-500000 -1 500000 1
-499999 -2 499999 2
-499998 -3 499998 3
-499997 -4 499997 4
-499996 -5 499996 5
-499995 -6 499995 6
-499994 -7 499994 7
-499993 -8 499993 8
-499992 -9 499992 9
-499991 -10 499991 10
-499990 -11 499990 11
-499989 -12 499989 12
-499988 -13 499988 13
-499987 -14 499987 14
-49...

output:

500000
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 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 500000 numbers

Subtask #3:

score: 7
Accepted

Test #29:

score: 7
Accepted
time: 6ms
memory: 32924kb

input:

5000
327551 703202 327551 706216
-477590 -222763 -477393 -222763
-108969 489665 -103419 489665
-987300 620986 -978736 620986
-53772 -342878 -46404 -342878
320821 41196 320821 41516
720586 287526 723717 287526
221676 -766454 227184 -766454
477555 -283970 479467 -283970
674710 487256 682052 487256
973...

output:

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

result:

ok 5000 numbers

Test #30:

score: 7
Accepted
time: 8ms
memory: 30880kb

input:

5000
-849168 -638532 -837325 -638532
-30831 -941550 -20934 -941550
865635 -157245 865635 -144915
714422 281347 728829 281347
312475 724981 312475 730128
44599 -247858 44599 -247265
-923952 38827 -923952 49355
-193307 -935206 -193307 -926627
-464597 407102 -448758 407102
294341 -136708 308541 -136708...

output:

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

result:

ok 5000 numbers

Test #31:

score: 7
Accepted
time: 7ms
memory: 30872kb

input:

5000
-562438 277469 -562438 304405
-327640 -13216 -327640 -11994
-820517 108657 -820517 127595
-598472 110792 -598472 120937
-80093 -617955 -80093 -611585
-549176 -343842 -549176 -305552
386107 -991549 386107 -965418
549745 -783211 584531 -783211
-836710 893800 -815692 893800
126112 -13591 126112 14...

output:

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

result:

ok 5000 numbers

Test #32:

score: 7
Accepted
time: 7ms
memory: 32740kb

input:

5000
195400 -967617 225538 -967617
-975242 -408413 -962878 -408413
502624 806574 517891 806574
468069 -678028 561880 -678028
-65072 868215 -65072 948566
-80654 -867280 -78284 -867280
667301 -33616 727648 -33616
-678259 -422004 -667072 -422004
254375 -906123 348434 -906123
-660968 475723 -640695 4757...

output:

5000
0 1 2 327 641 1714 1300 3 1541 4 345 334 592 846 345 603 1115 327 5 6 91 1300 1640 7 8 9 518 10 1015 700 417 1027 592 1787 1454 11 12 13 192 614 1066 14 175 592 1556 15 1765 1741 1563 1052 16 19 17 345 370 1305 18 19 959 20 345 21 22 23 24 1700 25 175 42 1871 1863 327 345 26 1551 1476 1701 261 ...

result:

ok 5000 numbers

Test #33:

score: 7
Accepted
time: 7ms
memory: 32924kb

input:

5000
805471 -468449 805471 -435286
-556123 -228718 -556123 -213088
166594 713699 250838 713699
-583240 528613 -583240 610888
-37999 737617 -37999 771434
932089 537827 932089 620436
-143417 -750647 -130989 -750647
333351 658670 425087 658670
-901627 -129915 -836527 -129915
-888274 -602878 -885918 -60...

output:

5000
260 0 1047 1813 134 1507 1 2 881 3 1184 7 4 1336 726 1855 1112 5 888 7 6 112 7 8 669 1858 511 39 495 9 10 1007 11 12 1148 146 1507 13 14 15 1148 627 1507 1193 1497 16 721 17 51 1148 1843 1112 322 18 263 19 20 21 1527 517 498 1677 22 428 23 24 1829 25 112 26 1026 27 1026 28 1112 589 599 29 30 92...

result:

ok 5000 numbers

Test #34:

score: 7
Accepted
time: 8ms
memory: 32692kb

input:

5000
-6808 779798 -6808 818529
532227 781605 613414 781605
725286 415172 725286 473029
739318 -878237 829145 -878237
-416752 312291 -388674 312291
35906 -9912 35906 82726
238578 -574511 238578 -551376
647358 -997517 685418 -997517
115452 -826078 115452 -750045
-976340 -385381 -976340 -312361
746832 ...

output:

5000
177 461 331 1309 1501 156 0 1 402 2 1462 1501 3 4 5 222 6 712 1271 7 8 900 431 1791 1294 1271 9 10 650 11 12 13 1514 14 15 16 17 18 19 20 1294 1728 529 1025 21 1271 8 22 23 1687 1387 805 1157 24 712 25 811 492 1387 26 156 989 156 1486 304 1791 27 156 28 177 1387 29 30 182 1083 8 461 31 32 1264 ...

result:

ok 5000 numbers

Test #35:

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

input:

3
0 0 1 1
1 1 2 2
2 -1 4 0

output:

3
0 0 1 

result:

ok 3 numbers

Test #36:

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

input:

2
0 1 3 3
2 0 4 2

output:

2
0 0 

result:

ok 2 numbers

Test #37:

score: 7
Accepted
time: 8ms
memory: 34924kb

input:

5000
587489 703202 590140 706216
-725090 477255 -719473 486573
-797329 -533624 -793333 -531903
860083 528842 865140 531339
-45600 42200 -43430 50016
237963 41196 245190 41516
911047 -220478 917922 -210851
-73285 -710619 -66436 -703406
576301 -994464 576621 -991089
775581 255211 785265 255636
454180 ...

output:

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

result:

ok 5000 numbers

Test #38:

score: 7
Accepted
time: 6ms
memory: 30824kb

input:

5000
63729 934679 81281 951603
492960 595583 517915 603186
-608647 -526613 -587502 -524205
-670485 -414937 -656268 -394227
230595 -994230 230695 -991862
-774232 273289 -762506 283163
-574995 922363 -565247 939095
-101720 438902 -71914 445771
637060 -720568 650955 -692993
-711117 -7589 -705545 21732
...

output:

5000
0 1 2 2578 3 4 5 1059 6 2216 7 569 8 9 1588 10 11 78 12 13 1839 1918 307 14 15 16 1855 822 17 18 1714 19 20 21 22 23 24 1056 1294 2513 25 26 27 28 2430 223 29 30 1267 348 31 2200 32 676 33 34 35 36 1336 2221 2191 1651 222 1261 37 38 540 1304 1847 39 2128 40 1285 41 1000 820 69 42 1890 495 43 15...

result:

ok 5000 numbers

Test #39:

score: 7
Accepted
time: 10ms
memory: 30824kb

input:

5000
-961084 -555143 -934094 -519126
322976 -749639 419020 -676351
-669866 -700524 -660246 -640518
21204 -339520 111662 -310905
-261676 -630628 -254288 -608781
-2895 -418355 86245 -365626
373434 217260 440584 260375
345491 -236024 399915 -221059
659615 816174 687682 890375
789968 839981 844728 86118...

output:

5000
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1...

result:

ok 5000 numbers

Test #40:

score: 7
Accepted
time: 10ms
memory: 32772kb

input:

5000
215344 -599817 411178 -550089
-656262 -656839 -592701 -651215
53018 -82871 85769 -30450
40363 -219211 45338 -190220
313497 -727236 503174 -617234
156095 -354490 324803 -298083
638133 545804 731536 699888
-456870 306347 -364434 445715
47611 89418 58250 343293
-617392 -495724 -439523 -220724
2253...

output:

5000
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 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 5000 numbers

Test #41:

score: 7
Accepted
time: 8ms
memory: 32864kb

input:

5000
-507905312 337097315 -502003958 342529225
-409590411 -871518550 -406901320 -871219467
-933433692 792901705 -924274075 795627031
-77308963 526164024 -76945540 534780630
746496564 304783306 749339853 314207089
754759401 679817563 754889658 688540289
-918922810 -519389578 -911661933 -509659710
436...

output:

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

result:

ok 5000 numbers

Test #42:

score: 7
Accepted
time: 7ms
memory: 32928kb

input:

5000
912558952 -447416501 928345554 -428859612
-143305081 836725205 -141984896 846293704
385902 483323238 20796611 490541632
-811882975 450596987 -795555682 452220427
788728064 -85647259 791082710 -61837525
-159890212 -489867356 -132477648 -485740722
-273745622 -500606472 -272464793 -498844214
-3187...

output:

5000
0 2051 1 2 3 193 4 972 5 32 6 7 1200 2651 8 9 1494 10 11 12 13 1581 14 15 16 2663 17 18 19 20 21 2449 22 253 23 24 2139 25 2070 1581 26 27 991 28 35 1069 1635 29 30 31 32 570 50 276 139 33 34 1328 35 36 37 38 39 1494 40 41 1503 42 43 1947 2445 1136 44 45 1791 146 46 47 48 49 50 2475 51 52 370 2...

result:

ok 5000 numbers

Test #43:

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

input:

10
9 2 9 6
-10 -16 -9 -11
15 15 16 17
-13 12 -12 14
-6 8 -2 10
-8 4 -7 8
-6 -12 -3 -7
-12 0 -7 3
5 -7 7 -3
15 -18 20 -18

output:

10
0 1 2 3 4 5 6 7 8 9 

result:

ok 10 numbers

Test #44:

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

input:

2
-6 8 -2 10
-8 4 -7 8

output:

2
0 1 

result:

ok 2 numbers

Subtask #4:

score: 21
Accepted

Test #45:

score: 21
Accepted
time: 167ms
memory: 44340kb

input:

100000
103428039 -722246120 105615051 -722246120
914973242 54361467 915866405 54361467
-442819027 -830287465 -441590532 -830287465
525993022 -949943053 526311265 -949943053
512218459 -432804473 515125546 -432804473
-653503066 496860319 -653503066 499792486
595698580 10165375 598628999 10165375
-2589...

output:

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

result:

ok 100000 numbers

Test #46:

score: 21
Accepted
time: 172ms
memory: 38144kb

input:

100000
609312243 366134585 609312243 373387589
-45346221 458621954 -45346221 464018590
-874870084 -772502278 -872802501 -772502278
379907126 -370778554 379907126 -366591365
580139611 459031512 585226391 459031512
-89515571 940052803 -89515571 940285846
-638780626 421023827 -638780626 427076419
-3630...

output:

100000
0 1 2 3 4 5 6 7 8 9 10 11 12 13 42501 14 15 16 17 18 19 20 21 22 27111 23 24 25 26 27 28 43154 29 33276 30 79776 31 38690 32 33 61939 34 17304 5890 35 67851 36 37 38 39 40 41 42 43 44 45 23349 46 47 48 37120 38049 50973 49 50 51 52 53 54 55 56 57 58 59 39865 12656 60 61 62 63 64 65 66 67 68 6...

result:

ok 100000 numbers

Test #47:

score: 21
Accepted
time: 1163ms
memory: 74268kb

input:

500000
-381848 485863 -352331 485863
-424494 -496684 -415227 -496684
-469944 -877718 -469944 -848053
141758 -233635 141758 -194540
579715 953306 614806 953306
-29737 -61539 -29737 -44504
-233833 362123 -187731 362123
-589987 -946490 -589987 -934765
343786 -511019 378671 -511019
-934140 892410 -92808...

output:

500000
3395 3395 3395 3395 3395 3395 3395 3395 3395 3395 3395 3395 3395 3395 3395 3395 3395 3395 3395 3395 3395 3395 3395 3395 3395 3395 3395 3395 3395 3395 3395 3395 3395 3395 3395 3395 3395 3395 3395 3395 3395 3395 3395 3395 3395 3395 3395 3395 3395 3395 3395 0 3395 3395 3395 3395 3395 3395 3395 3...

result:

ok 500000 numbers

Test #48:

score: 21
Accepted
time: 1230ms
memory: 74308kb

input:

500000
494853 -997196 511185 -997196
367130 723316 405962 723316
-908230 -730282 -908230 -696693
932615 399600 932615 442058
-430159 292562 -430159 369100
-587380 -471974 -587380 -413776
-856689 -345587 -825003 -345587
-393222 -879837 -393222 -872992
284814 -91782 284814 -35050
-82906 60159 -82906 9...

output:

500000
3444 3444 3444 3444 3444 3444 3444 3444 3444 3444 3444 3444 3444 3444 3444 3444 3444 3444 3444 3444 3444 3444 3444 3444 3444 3444 3444 3444 3444 3444 3444 3444 3444 3444 3444 3444 3444 3444 3444 3444 3444 3444 3444 3444 3444 3444 3444 3444 3444 0 3444 3444 3444 3444 3444 3444 3444 3444 3444 3...

result:

ok 500000 numbers

Test #49:

score: 21
Accepted
time: 1282ms
memory: 74312kb

input:

500000
232918 -802559 232918 -756394
-939913 -920614 -939913 -748018
261094 630247 261094 750192
-223261 -960451 -129794 -960451
-102016 -249182 -102016 -96023
-995953 -279027 -995953 -119896
299296 851673 426148 851673
570118 818722 586807 818722
-560000 -101157 -560000 56638
608799 -409859 771008 ...

output:

500000
1965 1965 1965 1965 1965 1965 1965 1965 1965 1965 1965 1965 1965 1965 1965 1965 1965 1965 1965 1965 1965 1965 1965 1965 1965 1965 1965 1965 1965 1965 1965 1965 1965 1965 1965 1965 1965 1965 1965 1965 1965 1965 1965 1965 1965 1965 1965 1965 1965 1965 1965 1965 1965 1965 1965 1965 1965 1965 196...

result:

ok 500000 numbers

Test #50:

score: 21
Accepted
time: 1321ms
memory: 74312kb

input:

500000
-163915 -462140 -155111 -462140
-990676 -753066 -819535 -753066
-965293 8704 -839903 8704
-869560 -388468 -869560 -218391
128053 -512788 128053 -263117
664081 -862814 730385 -862814
-711217 -409295 -711217 -392050
-818581 809864 -695048 809864
-411294 -212928 -411294 -65449
507047 553402 5070...

output:

500000
1927 1927 1927 1927 1927 1927 1927 1927 1927 1927 1927 1927 1927 1927 1927 1927 1927 1927 1927 1927 1927 1927 1927 1927 1927 1927 1927 1927 1927 1927 1927 1927 1927 1927 1927 1927 1927 1927 1927 1927 1927 1927 1927 1927 1927 1927 1927 1927 1927 1927 1927 1927 1927 1927 1927 1927 1927 1927 192...

result:

ok 500000 numbers

Test #51:

score: 21
Accepted
time: 1056ms
memory: 74312kb

input:

500000
987678579 -108581305 996645904 -108581305
372826999 890075519 376994900 890075519
-28900348 -359312774 -28900348 -358512963
-32530084 -919999561 -32530084 -914789717
-80345149 544945257 -79425690 544945257
715272892 -816592124 715272892 -807123793
421294365 -457175384 430708303 -457175384
-16...

output:

500000
90739 19012 0 27535 1 25698 47488 2 24232 108210 3 36753 4 148949 73462 62007 76293 147771 5 6 137726 166444 7 8 9 10 120339 163109 11 148900 154629 150318 180126 133580 37798 153411 12 144834 135545 13 79131 38746 14 23615 76670 118749 125680 15 16 17 18 163565 19 25645 64490 163676 106283 1...

result:

ok 500000 numbers

Test #52:

score: 21
Accepted
time: 1096ms
memory: 74312kb

input:

500000
4944310 -530071165 4944310 -517309722
-237111278 -350137787 -237111278 -338851417
-10816385 197483190 -10816385 203310066
-323993052 550519556 -323993052 562508685
854951061 612376268 861736539 612376268
-593584834 906735356 -581339225 906735356
-751141980 415172462 -740680024 415172462
37085...

output:

500000
13783 13783 13783 13783 13783 13783 13783 13783 13783 13783 0 13783 13783 13783 13783 13783 13783 13783 13783 13783 13783 13783 13783 13783 13783 13783 13783 13783 13783 13783 13783 13783 13783 13783 13783 13783 13783 13783 1 13783 13783 13783 13783 13783 13783 13783 13783 13783 13783 13783 1...

result:

ok 500000 numbers

Test #53:

score: 21
Accepted
time: 852ms
memory: 70420kb

input:

500000
10000000 10000000 30000000 10000000
10000000 10000000 10000000 30000000
30000000 10000000 30000000 30000000
10000000 30000000 30000000 30000000
10000154 9890894 10000154 10225263
10000150 29888983 10000150 30605459
10000316 9906946 10000316 10143720
10000309 29750765 10000309 30086807
1000047...

output:

500000
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 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 500000 numbers

Test #54:

score: 21
Accepted
time: 853ms
memory: 70644kb

input:

500000
10000000 10000000 30000000 10000000
10000000 10000000 10000000 30000000
30000000 10000000 30000000 30000000
10000000 30000000 30000000 30000000
9327676 10000156 10617449 10000156
29434991 10000166 30171148 10000166
9778105 10000308 10242559 10000308
29367801 10000326 30693618 10000326
9759553...

output:

500000
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 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 500000 numbers

Test #55:

score: 21
Accepted
time: 1169ms
memory: 74312kb

input:

500000
398226 514355 446017 514355
-878988 937341 -831948 937341
-189443 159971 -189443 165299
338891 -756490 338891 -722549
-384469 -629235 -384469 -588322
-786665 -702001 -786665 -674923
-83122 -356138 -83122 -351313
-191852 76567 -146126 76567
-619938 -581598 -619938 -574976
686207 996787 703302 ...

output:

500000
8365 8365 8365 8365 8365 8365 8365 8365 8365 0 8365 8365 8365 8365 8365 8365 8365 8365 8365 8365 8365 8365 8365 8365 8365 8365 8365 8365 8365 8365 1 8365 8365 8365 8365 8365 8365 8365 8365 8365 8365 8365 8365 8365 8365 2 8365 8365 8365 8365 8365 8365 8365 8365 8365 8365 8365 8365 8365 8365 83...

result:

ok 500000 numbers

Test #56:

score: 21
Accepted
time: 1245ms
memory: 74312kb

input:

500000
402324 -997074 404743 -997074
-823390 -877512 -803040 -877512
337420 -439078 337420 -433525
192970 80707 192970 136716
568229 887680 568229 913595
655694 777243 655694 802067
-913352 396845 -913352 432337
-145118 644118 -145118 677799
-645253 164217 -635873 164217
367704 -249872 409582 -24987...

output:

500000
0 1084 1084 1084 1084 1084 1084 1084 1084 1084 1084 1084 1084 1084 1084 1084 1084 1084 1084 1084 1084 1084 1084 1084 1084 1084 1084 1084 1 1084 1084 1084 1084 1084 1084 1084 1084 1084 1084 1084 1084 1084 1084 1084 1084 1084 1084 1084 1084 1084 1084 1084 1084 1084 1084 1084 1084 1084 1084 1084...

result:

ok 500000 numbers

Test #57:

score: 21
Accepted
time: 1273ms
memory: 74304kb

input:

500000
-23745 307280 -23745 355348
-836517 745337 -836517 790124
-593978 211843 -583752 211843
533345 -51352 554942 -51352
798298 -575138 798298 -410472
404981 1470 409876 1470
-848775 426319 -848775 544595
320243 607622 320243 709826
24640 -635725 135874 -635725
-232446 -333852 -66105 -333852
51320...

output:

500000
1999 1999 1999 1999 1999 1999 1999 1999 1999 1999 1999 1999 1999 1999 1999 1999 1999 1999 1999 1999 1999 1999 1999 1999 1999 1999 1999 1999 1999 1999 1999 1999 1999 1999 1999 1999 1999 1999 1999 1999 1999 1999 1999 1999 1999 1999 1999 1999 1999 1999 1999 1999 1999 1999 1999 1999 1999 1999 199...

result:

ok 500000 numbers

Test #58:

score: 21
Accepted
time: 1321ms
memory: 74316kb

input:

500000
-35916 -433647 194724 -433647
516176 -353893 654935 -353893
-663272 -998187 -404670 -998187
390797 -587068 390797 -499599
-873560 394910 -873560 597057
-158951 -494775 -34443 -494775
582193 490272 795417 490272
-591062 -826059 -473212 -826059
-846466 564334 -837599 564334
-488305 -916541 -488...

output:

500000
87 87 87 87 87 87 87 87 87 87 87 87 87 87 87 87 87 87 87 87 87 87 87 87 87 87 87 87 87 87 87 87 87 87 87 87 87 87 87 87 87 87 87 87 87 87 87 87 87 87 0 87 87 87 87 87 87 87 87 87 87 87 87 87 87 87 87 87 87 87 87 87 87 87 87 87 87 87 87 87 87 87 87 87 87 87 87 87 87 87 87 87 87 87 87 87 87 87 ...

result:

ok 500000 numbers

Test #59:

score: 21
Accepted
time: 1066ms
memory: 74268kb

input:

500000
-592957982 912992070 -590845331 912992070
-628678152 320810947 -620386631 320810947
-900641861 -907628281 -892282447 -907628281
515840128 300432337 515840128 309943913
-326153770 316116212 -326153770 325120991
-290701837 709217731 -286255439 709217731
973701299 624213015 973701299 627874388
5...

output:

500000
0 71116 74222 1 2 87339 79680 3 163706 162653 4 165935 5 6 129412 7 75682 8 86539 91698 9 10 125998 26510 69063 11 12 13 144804 153585 52642 67327 143107 104891 1516 38269 14 15 113337 169877 84845 86959 146205 172788 6343 16 187815 102258 162075 17 185581 40259 43400 161200 18 19 20 21 97391...

result:

ok 500000 numbers

Test #60:

score: 21
Accepted
time: 1104ms
memory: 74276kb

input:

500000
360378676 -457960685 360378676 -445175045
-201120595 581279428 -201120595 587968432
-773920916 -419552333 -763645640 -419552333
224377159 -990672051 224377159 -990362056
179547775 20364267 179547775 20804861
389408606 -839922252 399708031 -839922252
827530523 -150863097 827530523 -139750540
7...

output:

500000
32511 32511 32511 0 1 32511 32511 32511 32511 32511 32511 32511 32511 32511 32511 32511 32511 32511 2 32511 3 4 32511 32511 32511 32511 32511 32511 32511 32511 32511 32511 5 32511 32511 32511 32511 32511 32511 32511 32511 32511 32511 32511 32511 32511 32511 32511 32511 32511 32511 32511 32511...

result:

ok 500000 numbers

Test #61:

score: 21
Accepted
time: 846ms
memory: 72268kb

input:

500000
10000000 10000000 30000000 10000000
10000000 10000000 10000000 30000000
30000000 10000000 30000000 30000000
10000000 30000000 30000000 30000000
10000167 9110341 10000167 10741403
10000154 29410207 10000154 30954713
10000326 9196983 10000326 10327708
10000327 29447918 10000327 30379950
1000046...

output:

500000
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 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 500000 numbers

Test #62:

score: 21
Accepted
time: 877ms
memory: 71296kb

input:

500000
10000000 10000000 30000000 10000000
10000000 10000000 10000000 30000000
30000000 10000000 30000000 30000000
10000000 30000000 30000000 30000000
9322930 10000169 10133589 10000169
29988918 10000167 30520402 10000167
9843950 10000326 10683443 10000326
29808057 10000319 30986761 10000319
9597742...

output:

500000
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 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 500000 numbers

Subtask #5:

score: 26
Accepted

Dependency #3:

100%
Accepted

Test #63:

score: 26
Accepted
time: 166ms
memory: 44292kb

input:

100000
830040 -312425 830397 -311881
-76262 864793 -75378 865309
-735828 457459 -735621 458444
-450970 -613101 -450468 -612462
-232761 -549051 -232293 -548657
450789 210557 450914 211150
44963 -384017 45357 -383662
513241 217720 514225 218054
720669 17075 721664 17089
754152 -982768 755080 -982493
-...

output:

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

result:

ok 100000 numbers

Test #64:

score: 26
Accepted
time: 172ms
memory: 44088kb

input:

100000
-838975 -20295 -838065 -18326
105411 215135 105567 217722
169786 387469 172626 389217
-889838 -797149 -888052 -795259
851521 -541398 854301 -538511
738828 104158 739762 104822
-968222 -611574 -965548 -611230
-952546 -782136 -951594 -782075
984322 435628 985468 436851
-352679 16194 -350941 190...

output:

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

result:

ok 100000 numbers

Test #65:

score: 26
Accepted
time: 209ms
memory: 38196kb

input:

100000
514408 981861 521646 988551
39643 -481156 48436 -476653
96444 13813 103121 16363
841611 -345184 849915 -342977
627599 -855514 633955 -847534
-161365 260099 -161173 269200
-438576 258087 -434631 258523
661202 -358161 665207 -358038
-693753 -861758 -688617 -852429
402567 -826640 404457 -820445
...

output:

100000
5010 20523 14320 0 8078 1 8059 8118 9990 2 17 3 2534 7035 20169 10119 16071 12502 19624 17822 4 5402 98 3056 5 2694 20245 17628 13502 18829 6 3630 8235 18705 6563 13670 7 7731 8 21692 19799 8261 2513 9 10 10003 2230 10322 17068 9717 16330 11 17887 16339 9929 22030 5626 5460 4397 3216 16726 15...

result:

ok 100000 numbers

Test #66:

score: 26
Accepted
time: 266ms
memory: 43960kb

input:

100000
-964141 -869653 -953151 -860491
-873956 -131407 -851085 -131075
-614287 654264 -610785 675691
512531 -240991 527156 -227569
290181 944528 305265 964761
455044 -422095 458390 -404750
-794595 -633662 -781330 -633610
-631462 176951 -629974 192503
-233001 694302 -212551 694586
456813 635937 48555...

output:

100000
2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2...

result:

ok 100000 numbers

Test #67:

score: 26
Accepted
time: 172ms
memory: 38088kb

input:

100000
-37908013 -10530149 -37838576 -10505322
-44360 21389813 50616 21467297
29205057 -27930074 29251226 -27905524
33887151 -1904178 33928076 -1871239
-34891534 -42557614 -34872191 -42484064
35814499 31220978 35854751 31238160
-10962623 2913714 -10893205 2938401
45369116 -32468424 45439340 -3238581...

output:

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

result:

ok 100000 numbers

Test #68:

score: 26
Accepted
time: 187ms
memory: 38200kb

input:

100000
-17744431 4781406 -17559077 5075915
-46180657 -41416489 -45891016 -41324094
-13104520 -38669287 -13001527 -38494116
-19276367 9577166 -19252576 9696225
10062336 2020323 10282805 2196607
199863 16209774 398076 16321417
15101940 -36769421 15318169 -36510709
-9017130 -11878427 -8767933 -11776432...

output:

100000
15793 37116 0 11585 1 2 2457 3 4 5 4313 50369 6 7 8 9 10 12910 30034 11 12 13 14 15 40924 16 17 18 19 20 21 4913 22 23 44730 24 25 6172 26 27 25705 28 24550 38815 29 30 22953 31 51319 32 33 34 35 36 37 38 39 40 41 42 24549 20123 43127 11505 44086 58437 24644 43 44 45 46 30842 47 48 49 50 1802...

result:

ok 100000 numbers

Test #69:

score: 26
Accepted
time: 250ms
memory: 38064kb

input:

100000
-32535354 42931700 -32219314 43581117
-24266792 12039435 -23383164 12141228
10737806 -1086351 11531504 -481213
27228762 -44055463 28198664 -43320611
-32143561 -20396354 -31769564 -20087203
32232642 -6603898 32865496 -6555237
17222459 -21175083 17310139 -20383729
-36731420 15570649 -36042004 1...

output:

100000
32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 0 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 ...

result:

ok 100000 numbers

Test #70:

score: 26
Accepted
time: 294ms
memory: 45896kb

input:

100000
37991253 -10059476 40479896 -7273774
-49087511 -36168113 -47395138 -34236036
8244405 25276553 8404429 28218306
19491541 43107359 20669858 46088537
-5073177 22777009 -3682915 23059873
-6495528 -20856545 -6142898 -20433870
5971988 -46435854 8254030 -45877867
-41693010 15243108 -40004195 1538709...

output:

100000
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 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 100000 numbers

Test #71:

score: 26
Accepted
time: 170ms
memory: 38192kb

input:

100000
952437863 560183471 952861350 560268018
-589028375 389016198 -588594694 389828194
-537287572 215712389 -536602941 216082719
-25951969 -129341290 -25907075 -128801821
796039504 -959939172 796121740 -958997036
-571867866 433739283 -571124391 433942789
-156757951 401375364 -156253443 401545867
-...

output:

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

result:

ok 100000 numbers

Test #72:

score: 26
Accepted
time: 176ms
memory: 46340kb

input:

100000
428096676 -743272190 429570279 -741319786
-196288347 -64156498 -194106979 -62308544
-183528411 -980699621 -180766128 -979091042
614241614 319968552 616731658 321133952
773192161 -378749681 773740644 -375768821
-855232059 496860319 -853652955 499792486
667435132 694315044 669282029 695413259
-...

output:

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

result:

ok 100000 numbers

Test #73:

score: 26
Accepted
time: 213ms
memory: 44340kb

input:

100000
-273098355 366134585 -266256932 373387589
889759582 458621954 899336249 464018590
540597778 360056292 540820032 369782843
-539050634 -370778554 -538303019 -366591365
-619615403 153671613 -609643369 160055714
-337295094 940052803 -331576250 940285846
423669209 421023827 430412346 427076419
860...

output:

100000
10806 5769 19604 0 1587 4279 7725 5112 13458 1 8050 20046 20847 2 2144 3155 1219 3 18225 1041 12637 20554 4 1203 12684 18097 19731 14597 8272 226 14771 7032 2463 20990 5 6 8577 1920 19300 7 19731 22044 3646 864 8 14344 11038 9185 5990 9 19209 15507 10 16722 11 12 13284 4898 13 18894 10778 14 ...

result:

ok 100000 numbers

Test #74:

score: 26
Accepted
time: 271ms
memory: 41800kb

input:

100000
249846014 531166858 262762139 553406222
-579025513 265465125 -552386492 267697414
-756023410 -116494086 -744681594 -96645412
-420204705 -115237233 -399883911 -108995976
51111895 -575137334 53779848 -569819514
-228964470 -655415948 -204875971 -655008571
736713901 -531614192 750349030 -51880637...

output:

100000
6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6...

result:

ok 100000 numbers

Test #75:

score: 26
Accepted
time: 154ms
memory: 41860kb

input:

100000
10000000 10000000 30000000 30000000
-30000000 -30000000 -10000000 -10000000
10001601 9418703 10001601 10102863
10001609 29257143 10001609 30042686
10003206 9323290 10003206 10233271
10003191 29556945 10003191 30491162
10004798 9557944 10004798 10028240
10004793 29230723 10004793 30331752
1000...

output:

100000
0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 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 100000 numbers

Test #76:

score: 26
Accepted
time: 153ms
memory: 35704kb

input:

100000
10000000 10000000 30000000 30000000
-30000000 -30000000 -10000000 -10000000
10001597 9638150 10001597 10684411
10001601 29811070 10001601 30167748
10003207 9323726 10003207 10449963
10003202 29029905 10003202 30784305
10004790 9587621 10004790 10854673
10004801 29791677 10004801 30612179
1000...

output:

100000
0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 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 100000 numbers

Test #77:

score: 26
Accepted
time: 149ms
memory: 46000kb

input:

100000
10000000 10000000 30000000 30000000
-30000000 -30000000 -10000000 -10000000
10001589 9857596 10001589 10976360
10001606 29075398 10001606 30517001
10003192 9389571 10003192 10601247
10003199 29470161 10003199 30044745
10004803 9393106 10004803 10456914
10004805 29511414 10004805 30084093
1000...

output:

100000
0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 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 100000 numbers

Test #78:

score: 26
Accepted
time: 104ms
memory: 42420kb

input:

100000
0 0 1 100000
2 0 3 100000
4 0 5 100000
6 0 7 100000
8 0 9 100000
10 0 11 100000
12 0 13 100000
14 0 15 100000
16 0 17 100000
18 0 19 100000
20 0 21 100000
22 0 23 100000
24 0 25 100000
26 0 27 100000
28 0 29 100000
30 0 31 100000
32 0 33 100000
34 0 35 100000
36 0 37 100000
38 0 39 100000
40 ...

output:

100000
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 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 100000 numbers

Subtask #6:

score: 39
Accepted

Dependency #1:

100%
Accepted

Dependency #2:

100%
Accepted

Dependency #3:

100%
Accepted

Dependency #4:

100%
Accepted

Dependency #5:

100%
Accepted

Test #79:

score: 39
Accepted
time: 930ms
memory: 74436kb

input:

500000
6798 -77 6799 -76
4833 3421 4834 3421
812 4014 812 4014
-4917 -7758 -4917 -7758
-6850 26 -6850 26
3942 -8805 3943 -8804
-6932 6095 -6932 6095
3035 8626 3035 8627
7649 -6682 7649 -6681
7122 -8880 7122 -8880
-9307 664 -9306 665
-5355 -4147 -5355 -4146
-5599 -2529 -5599 -2528
9356 7619 9357 7619...

output:

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

result:

ok 500000 numbers

Test #80:

score: 39
Accepted
time: 921ms
memory: 74224kb

input:

500000
-299345954 -740198324 -299345860 -740197876
-285111368 534468938 -285110545 534469243
-315732116 -616168767 -315731974 -616168460
-572538038 103027685 -572537294 103027999
417130077 -993578342 417130198 -993577620
656540409 245463820 656540600 245464516
440313570 565282911 440314318 565283888...

output:

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

result:

ok 500000 numbers

Test #81:

score: 39
Accepted
time: 903ms
memory: 74344kb

input:

500000
-641226057 635528074 -641225827 635530119
-90292266 -687041406 -90291794 -687039432
357985669 544137983 357987855 544139490
-192355321 -10186665 -192354278 -10186240
62240704 -623401370 62241505 -623398620
149761594 -125050841 149763000 -125049220
50725275 4019043 50725882 4022002
-137600527 ...

output:

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

result:

ok 500000 numbers

Test #82:

score: 39
Accepted
time: 917ms
memory: 74208kb

input:

500000
30471900 719248527 30479794 719258145
-846934878 -842376335 -846932682 -842369386
188163105 -818404952 188168692 -818395385
674190278 232859049 674196062 232860568
-810082137 -587171437 -810074409 -587169852
289456019 697746801 289461049 697752660
514366982 -21240115 514371126 -21238183
-4150...

output:

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

result:

ok 500000 numbers

Test #83:

score: 39
Accepted
time: 934ms
memory: 74272kb

input:

500000
-860191726 848450805 -860179236 848455788
521156612 -871148410 521173610 -871128818
52924729 143247597 52951388 143251733
528022617 -787208780 528050076 -787208353
-505151144 -534584205 -505150034 -534569325
530809326 -608933178 530835092 -608911098
-124198936 -410326566 -124195402 -410318264...

output:

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

result:

ok 500000 numbers

Test #84:

score: 39
Accepted
time: 968ms
memory: 74312kb

input:

500000
-923576983 -41094689 -923487373 -41084072
639991076 -697542784 640073123 -697524321
-2434914 -240524218 -2341169 -240466959
905545630 283882854 905602449 283918731
938992473 279426603 939044766 279486818
-987536521 -418936267 -987448527 -418894629
765357344 -322501992 765413983 -322425625
-57...

output:

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

result:

ok 500000 numbers

Test #85:

score: 39
Accepted
time: 991ms
memory: 74316kb

input:

500000
-889718339 257044032 -889561407 257165043
662392316 353688348 662510432 353774869
418892501 -909663331 418993492 -909605028
830550922 921312452 830764406 921475320
-82544537 -723932193 -82311064 -723932191
842141614 -811587157 842316265 -811399366
-867346614 267159979 -867207224 267293808
249...

output:

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

result:

ok 500000 numbers

Test #86:

score: 39
Accepted
time: 1042ms
memory: 74316kb

input:

500000
-707494830 -935212594 -706960555 -934495584
309459485 -606294290 310247042 -606054386
213447972 -255257991 214317845 -254860794
319631363 550132855 320127034 550223498
408175469 -43923607 408289774 -43899327
718074386 -430514737 718301471 -430229702
-525046824 176632027 -524260489 177152722
-...

output:

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

result:

ok 500000 numbers

Test #87:

score: 39
Accepted
time: 862ms
memory: 72460kb

input:

500000
10000000 10000000 30000000 30000000
-30000000 -30000000 -10000000 -10000000
10000310 9184547 10000310 10361613
10000313 29851186 10000313 30928578
10000644 9640852 10000644 10161775
10000635 29240680 10000635 30509627
10000967 9209974 10000967 10663506
10000955 29708916 10000955 30578676
1000...

output:

500000
0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 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 500000 numbers

Test #88:

score: 39
Accepted
time: 577ms
memory: 73368kb

input:

500000
0 0 1 500000
2 0 3 500000
4 0 5 500000
6 0 7 500000
8 0 9 500000
10 0 11 500000
12 0 13 500000
14 0 15 500000
16 0 17 500000
18 0 19 500000
20 0 21 500000
22 0 23 500000
24 0 25 500000
26 0 27 500000
28 0 29 500000
30 0 31 500000
32 0 33 500000
34 0 35 500000
36 0 37 500000
38 0 39 500000
40 ...

output:

500000
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 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 500000 numbers

Test #89:

score: 39
Accepted
time: 1808ms
memory: 73952kb

input:

500000
22680 -43367 22681 -37805
62046 -87699 62047 -45042
-51578 -40153 -51577 55589
-34373 36919 -34372 84903
13975 66457 13976 73683
33060 -85736 33061 -2664
-61609 -86070 -61608 -52401
-60089 45555 -60088 51006
52042 -35203 52043 31430
-85964 -95342 -85963 26713
-92634 -77181 -92633 -61149
-3257...

output:

500000
8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8...

result:

ok 500000 numbers

Test #90:

score: 39
Accepted
time: 1429ms
memory: 73832kb

input:

500000
-33033055 -39705239 -33033054 -21801567
35531810 -46414140 35531811 15678206
-36187963 -27299948 -36187962 31442888
41101190 5150823 41101191 29026756
-15046050 12086303 -15046049 25853663
-28439173 -26288580 -28439172 17225766
-47385875 -41173897 -47385874 28450989
-26174152 -29959938 -26174...

output:

500000
9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9...

result:

ok 500000 numbers