QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#107634#6337. Mizuyokan 2chenshi100 ✓1316ms373084kbC++2.1kb2023-05-22 10:24:542023-05-22 10:25:33

Judging History

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

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2023-05-22 10:25:33]
  • 评测
  • 测评结果:100
  • 用时:1316ms
  • 内存:373084kb
  • [2023-05-22 10:24:54]
  • 提交

answer

#include<cstdio>
#include<iostream>
using namespace std;
const int o=2.5e5+10,E=70;
int n,q,L[o],f[o],stp[o*3][E],se[o*3][E],des[o*3][E],ans;long long b[o],s;
inline int lowbit(int x){return x&-x;}
inline void chg(int pos,int val){for(;pos<=n;pos+=lowbit(pos)) b[pos]+=val;}
inline long long ask(int pos){long long res=0;for(;pos;pos-=lowbit(pos)) res+=b[pos];return res;}
inline void upd(int&l_,int&t,int&res,int id,int l,int r){
	if(t<l&&f[t+2]<=r) ++res,l_=t,t=f[t+2];
		if(t>=l&&stp[id][t-l]) res+=stp[id][t-l],l_=se[id][t-l],t=des[id][t-l];
}
void modify(int id,int ql,int qr,int l=1,int r=n){
	if(l==r){
		stp[id][0]=0;des[id][0]=l;f[l]=f[l+1];s=0;
		for(int i=l;i<f[l];++i) if((s+=L[i])>L[l-1]&&s>L[i+1]){f[l]=i;break;}
		return;
	}
	int md=l+r>>1;
	if(md<qr) modify((id<<1)|1,ql,qr,md+1,r);
	if(ql<=md) modify(id<<1,ql,qr,l,md);
	for(int i=l;i-l<E&&i<=md;++i)
		upd(se[id][i-l]=se[id<<1][i-l],des[id][i-l]=des[id<<1][i-l],stp[id][i-l]=stp[id<<1][i-l],(id<<1)|1,md+1,r);
	for(int i=md+1;i-l<E&&i<=r;++i)
		stp[id][i-l]=stp[(id<<1)|1][i-(md+1)],des[id][i-l]=des[(id<<1)|1][i-(md+1)],se[id][i-l]=se[(id<<1)|1][i-(md+1)];
}
void query(int id,int ql,int qr,int&l_,int&t,int&res,int l=1,int r=n){
	if(ql<=l&&r<=qr){upd(l_,t,res,id,l,r);return;}
	int md=l+r>>1;
	if(ql<=md) query(id<<1,ql,qr,l_,t,res,l,md);
	if(md<qr) query((id<<1)|1,ql,qr,l_,t,res,md+1,r);
}
inline int calc(int l_,int l,int r){
	int res=0,t=l;
	query(1,l,r,l,t,res);
	if(!res) l=l_-2;
	long long s1=ask(t-1)-ask(l+1),s2=ask(r)-ask(t);
	for(int i=t+1;i<r;++i){
		s1+=L[i-1];s2-=L[i];
		if(s1>L[i]&&s2>L[i]) return res*2+2;
	}
	return res*2+(t<r&&ask(r-1)-ask(l+1)>L[r]);
}
int main(){
	scanf("%d",&n);
	for(int i=1;i<=n;++i) scanf("%d",&L[i]),chg(i,L[i]);
	f[n+1]=n+1;modify(1,1,n);
	scanf("%d",&q);
	for(int x,y,l,r;q--;printf("%d\n",ans)){
		scanf("%d%d%d%d",&x,&y,&l,&r);++l;ans=1;
		chg(x,y-L[x]);L[x]=y;modify(1,max(x-E,1),min(x+1,n));
		if(l<r&&ask(r)-ask(l)>L[l]) ans=2;
		if(f[l+1]<=r) ans=max(ans,calc(l+1,f[l+1],r)+2);
		s=0;
		for(int i=l;i<f[l+1];++i) if((s+=L[i])>L[i+1]){ans=max(ans,calc(l,i,r)+1);break;}
	}
	return 0;
}

详细

Subtask #1:

score: 6
Accepted

Test #1:

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

input:

170
581553716 290776853 145388421 581553716 168947671 936760822 849346471 126291564 133104657 125887494 136786623 123143788 137803872 129733949 849346471 880499329 202732710 611312524 152828126 305656257 611312524 121295297 6875889 74507235 419967909 333601507 281557968 740824934 370412466 185206229...

output:

59
56
61
61
56
37
42
46

result:

ok 8 numbers

Test #2:

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

input:

200
517847507 258923750 129461870 517847507 106915073 712580593 512811829 12657894 12715954 12534704 12759073 12554236 12685369 12563357 12817887 12534566 12752501 12518874 12746471 12524663 12730053 12586182 12803851 12628464 12778716 12645600 12701929 12550298 12754947 12548765 12765210 12592487 1...

output:

118
162
114
113
143
105
109
165
139
152

result:

ok 10 numbers

Test #3:

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

input:

156
689580506 344790254 172395128 689580506 344790254 689580506 344790252 172395125 86197561 86197567 86197565 86197566 43098784 86197566 86197565 86197567 86197561 172395125 344790252 689580506 344790254 689580506 172395128 344790254 689580506 3985467 453082635 861305238 430652620 215326311 8613052...

output:

19
26
27
21
15
11

result:

ok 6 numbers

Test #4:

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

input:

200
545371756 272685879 136342940 545371756 272685879 545371756 272685877 136342937 68171467 68171474 68171472 68171473 34085737 68171473 68171472 68171474 68171467 136342937 272685877 545371756 272685879 545371756 136342940 272685879 545371756 327464463 455363267 859187150 429593576 214796789 85918...

output:

27
36
25
26
16
11
15
21
19
22

result:

ok 10 numbers

Test #5:

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

input:

200
433494437 165580141 63245986 24157817 9227465 3524578 1346269 514229 196418 75025 28657 10946 4181 1597 610 233 89 34 13 5 2 1 1 1 3 8 21 55 144 377 987 2584 6765 17711 46368 121393 317811 832040 2178309 5702887 14930352 39088169 102334155 267914296 701408733 863735928 433494437 165580141 632459...

output:

5
13
5
5
8
5
13
5
5
6

result:

ok 10 numbers

Test #6:

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

input:

187
433494437 165580141 63245986 24157817 9227465 3524578 1346269 514229 196418 75025 28657 10946 4181 1597 610 233 89 34 13 5 2 1 1 1 3 8 21 55 144 377 987 2584 6765 17711 46368 121393 317811 832040 2178309 5702887 14930352 39088169 102334155 267914296 701408733 868260277 433494437 165580141 632459...

output:

4
36
18
10
19
11
3
29

result:

ok 8 numbers

Test #7:

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

input:

200
942616273 418940008 209470430 104734784 104734784 104735481 523675545 247785 701408733 267914296 102334155 39088169 14930352 5702887 2178309 832040 317811 121393 46368 17711 6765 2584 987 377 144 55 21 8 3 1 1 1 2 5 13 34 89 233 610 1597 4181 10946 28657 75025 196418 514229 1346269 3524578 92274...

output:

5
21
8
5
9
8
20
17
5
5

result:

ok 10 numbers

Test #8:

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

input:

200
641304094 22086510 5470810 2634455 1317187 658631 329083 126285 49415 22321 11410 5273 359 133 50 20 9 3 3 3 9 30 79 220 585 1226 2467 4851 27355 76469 202803 2836339 8307675 16614893 38701275 77401954 154804637 309608784 619217509 353775485 433494437 165580141 63245986 24157817 9227465 3524578 ...

output:

5
13
9
9
9
4
12
12
11
5

result:

ok 10 numbers

Test #9:

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

input:

200
433494437 165580141 63245986 24157817 9227465 3524578 1346269 514229 196418 75025 28657 10946 4181 1597 610 233 89 34 13 5 2 1 1 1 3 8 21 55 144 377 987 2584 6765 17711 46368 121393 317811 832040 2178309 5702887 14930352 39088169 102334155 267914296 701408733 693739790 701408733 267914296 102334...

output:

5
5
5
4
5
3
9
19
9
16

result:

ok 10 numbers

Test #10:

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

input:

200
811426933 198737194 91129973 45564654 22782332 6305563 3152428 1219185 505660 252621 43570 21857 11092 2766 1419 327 118 44 15 3 1 1 3 6 14 31 76 196 509 1034 4036 8138 52164 104730 208684 713957 1933360 8238658 16477615 107607533 306345216 612690552 5165 701408733 267914296 102334155 39088169 1...

output:

5
5
5
5
4
3
17
22
11
22

result:

ok 10 numbers

Test #11:

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

input:

170
81553716 641270070 76671075 423535716 81513969 349346472 918947671 643372070 434082866 664656456 639157656 473824723 263466558 960408345 313957771 754077653 952732710 111312524 68261315 315588907 511788074 951463287 402771182 51452283 4352857 86643186 343917032 740824934 31237226 361281509 99056...

output:

60
20
67
55
72
66
47
18

result:

ok 8 numbers

Test #12:

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

input:

200
517847507 845063523 900782365 733754788 868260277 512811830 106915073 2556529 228137609 242594414 695501734 1446343 933668801 559293539 298824117 637105802 625215851 312386451 100447359 186927021 376963403 300653848 857052812 501599341 349295044 922104431 840182910 996573394 684887153 779348052 ...

output:

74
97
31
53
14
45
2
64
10
10

result:

ok 10 numbers

Test #13:

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

input:

200
207011 5261 1269645 3 96 1 4 756365306 891 2889 217238 15 4594 1 3 2 549508340 1 1 136 1461 302855 31140693 1185 5912463 27 9682000 9146 17 29626226 67558 219081 1 1 59 554 8 19 6460 712 1679713 276643 180049 1692 165 4841589 687013 268 8364 3911918 39604 6 1 5 1 3809 1 15127 316 256 1 7976975 3...

output:

34
65
53
10
122
46
52
17
22
85

result:

ok 10 numbers

Test #14:

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

input:

200
1666954 16680286 22901801 24466766 25555269 26161708 27126835 29636964 31147832 33483487 33499511 41450462 45371756 45456600 46543021 56856009 57776244 71330394 73522260 75003115 75139522 87658971 89596930 90333745 96481088 104215633 105317004 107865475 109822289 113787517 119366225 126358977 13...

output:

38
33
29
26
85
58
22
2
2
26

result:

ok 10 numbers

Test #15:

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

input:

200
1 1 1 2 3 3 13 35 59 77 94 184 512 17627 21953 72401 106196 287525 4542970 7279146 18367441 51140154 158988562 398832640 755575138 427135579 227921831 113319106 26153265 20515329 4485571 210791 163801 111341 72315 49834 27931 18398 5104 2849 2092 1486 435 433 331 12 10 4 1 1 1 1 1 1 3 14 39 69 2...

output:

32
30
33
49
42
49
2
24
71
30

result:

ok 10 numbers

Test #16:

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

input:

200
9090695 11261989 37978393 39759789 40717103 59342651 63521565 64602365 72486441 81550503 84429832 87685388 93947754 116330271 118375950 126832034 129591929 130580129 133304510 135979600 147563274 149207928 159091959 161016266 162216627 170224776 170937882 171692206 173801085 191657773 198611062 ...

output:

20
65
120
25
107
16
61
31
38
15

result:

ok 10 numbers

Test #17:

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

input:

200
1 1 4 74 102 849 1698 3260 9919 12317 43630 49428 107277 226806 397526 699137 1279153 3198955 3772748 5013933 13296103 24002309 50457720 61144874 228889568 370255655 602076780 1 32368 8634 332 116286 7577464 86346 27 1 25330811 56141 32 5 28466 6483802 774045913 5163615 6 21131 22 3346 2793 3237...

output:

8
20
43
27
52
79
31
22
27
81

result:

ok 10 numbers

Test #18:

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

input:

200
956397794 956397794 606227355 606227355 434852959 434852959 754338473 754338473 989995218 989995218 858627911 858627911 852085951 852085951 280865784 280865784 63369558 63369558 388670577 388670577 563870055 563870055 264046824 264046824 313555037 313555037 112186895 112186895 368002737 36800273...

output:

1
2
2
2
21
1
2
1
2
2

result:

ok 10 numbers

Test #19:

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

input:

200
230892545 230892545 230892545 230892545 230892545 230892545 230892545 230892545 230892545 230892545 230892545 230892545 230892545 230892545 230892545 230892545 230892545 230892545 230892545 230892545 230892545 230892545 230892545 230892545 230892545 230892545 230892545 230892545 230892545 230892...

output:

21
6
4
48
13
9
1
8
30
11

result:

ok 10 numbers

Subtask #2:

score: 9
Accepted

Dependency #1:

100%
Accepted

Test #20:

score: 9
Accepted
time: 2ms
memory: 14408kb

input:

1390
996792497 498396246 249198120 996792497 101363119 781865047 656947559 62304094 63915157 60229970 63729625 60093777 62748259 59920613 65063372 62398031 63528129 62704442 656947559 986967949 160849742 814718671 203679663 407359330 814718671 79887087 315091213 118024524 386675019 314722420 8678924...

output:

57
59
46
57
51
55
52
44
19
56

result:

ok 10 numbers

Test #21:

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

input:

2000
580952848 290476421 145238205 580952848 133999450 897045688 878958110 25245628 25527409 25321336 25536117 25394894 25548273 25435009 25779437 25120869 25551736 25144084 25528034 25456720 25740644 25265090 25649682 25144462 25752439 25403599 25738908 25286578 25507889 25395653 25588875 25376462 ...

output:

111
115
49
38
109
99
109
36
187
195

result:

ok 10 numbers

Test #22:

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

input:

1504
692018472 346009237 173004619 692018472 346009237 692018472 346009235 173004616 86502307 86502313 86502311 86502312 43251157 86502312 86502311 86502313 86502307 173004616 346009235 692018472 346009237 692018472 173004619 346009237 692018472 259957166 181889194 802616914 401308458 200654230 8026...

output:

37
254
43
20
30
11
45
77
161
27

result:

ok 10 numbers

Test #23:

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

input:

2000
956397794 478198898 239099450 956397794 478198898 956397794 478198896 239099447 119549722 119549728 119549726 119549727 59774864 119549727 119549726 119549728 119549722 239099447 478198896 956397794 478198898 956397794 239099450 478198898 956397794 467208990 129369883 754338473 377169237 188584...

output:

267
20
41
24
21
11
362
622
25
25

result:

ok 10 numbers

Test #24:

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

input:

2000
433494437 165580141 63245986 24157817 9227465 3524578 1346269 514229 196418 75025 28657 10946 4181 1597 610 233 89 34 13 5 2 1 1 1 3 8 21 55 144 377 987 2584 6765 17711 46368 121393 317811 832040 2178309 5702887 14930352 39088169 102334155 267914296 701408733 93833055 433494437 165580141 632459...

output:

5
159
21
47
29
112
123
56
5
96

result:

ok 10 numbers

Test #25:

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

input:

1722
754338473 754338473 754339407 63369558 701408733 267914296 102334155 39088169 14930352 5702887 2178309 832040 317811 121393 46368 17711 6765 2584 987 377 144 55 21 8 3 1 1 1 2 5 13 34 89 233 610 1597 4181 10946 28657 75025 196418 514229 1346269 3524578 9227465 24157817 63245986 165580141 433494...

output:

5
713
148
326
620
279
5
9
365
167

result:

ok 10 numbers

Test #26:

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

input:

2000
415015995 166006357 83002832 83002832 83003332 249009517 664025736 153704 701408733 267914296 102334155 39088169 14930352 5702887 2178309 832040 317811 121393 46368 17711 6765 2584 987 377 144 55 21 8 3 1 1 1 2 5 13 34 89 233 610 1597 4181 10946 28657 75025 196418 514229 1346269 3524578 9227465...

output:

5
293
169
21
166
57
175
201
41
28

result:

ok 10 numbers

Test #27:

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

input:

2000
541640634 227677457 113838488 27552705 11962631 5981484 2353883 1079432 539877 269728 74447 37305 14337 4892 1099 395 149 40 20 8 4 3 3 10 51 107 267 725 1815 3876 8780 23215 97614 194948 1273756 3627591 15590091 43142892 86286368 313963957 855604521 7128360 701408733 267914296 102334155 390881...

output:

5
183
29
73
95
99
5
31
45
95

result:

ok 10 numbers

Test #28:

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

input:

2000
701408733 267914296 102334155 39088169 14930352 5702887 2178309 832040 317811 121393 46368 17711 6765 2584 987 377 144 55 21 8 3 1 1 1 2 5 13 34 89 233 610 1597 4181 10946 28657 75025 196418 514229 1346269 3524578 9227465 24157817 63245986 165580141 433494437 249719958 701408733 267914296 10233...

output:

5
77
13
12
57
3
45
103
115
100

result:

ok 10 numbers

Test #29:

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

input:

2000
525118691 262559536 131279565 49989124 18687350 6072791 3036355 1518317 759200 379732 145483 57921 27740 13555 6756 3366 713 82 20 9 9 10 31 62 147 291 599 1356 2740 29963 88206 233945 6307382 12614557 31301742 81291216 606410513 5067 433494437 165580141 63245986 24157817 9227465 3524578 134626...

output:

5
89
5
16
4
3
45
95
150
135

result:

ok 10 numbers

Test #30:

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

input:

1668
217293251 574495359 729601546 128636814 423402116 191384362 465885935 305072385 998508356 721707739 866260660 281956127 414665737 112383114 269031157 800229309 424389057 193910387 918741076 709526872 414643171 607956241 620304219 202887734 600466865 54238223 201638382 890620143 459509407 360504...

output:

280
897
934
224
654
30
489
432

result:

ok 8 numbers

Test #31:

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

input:

2000
982720651 249719958 660714565 704915981 910551148 255022894 580815100 88103482 314031045 574906362 356705440 112397772 5328098 382196455 120869541 13141457 913068523 445851404 80206732 613413589 553711700 957318472 561816410 981311072 531335031 967466215 879234870 279208179 97183925 324336471 6...

output:

262
156
841
43
160
306
587
115
276
987

result:

ok 10 numbers

Test #32:

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

input:

2000
13360776 38 98434 6323439 12 9 2205 7026517 362 327 908 103 46411985 13 2526055 177 55028 232 6 728 1639 1504 38520123 3 5702664 1 439183 320049350 72777301 17267 536 477151 5 66762357 39 24464527 29662 1 269916 14174296 194 2366 54 163449 5138460 3 1 812712 64497 3974902 29742 1 60304785 1 1 1...

output:

1086
720
121
195
482
612
460
287
703
249

result:

ok 10 numbers

Test #33:

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

input:

2000
172550 1248879 1452843 1460111 1600241 1657069 1798356 2006947 2076559 3151101 4026059 4889143 5206363 5764087 5998198 6165818 6282160 7140612 7297494 7400031 7597773 7926237 7930924 8110990 8403118 8925365 10824822 11391524 11499299 11622321 12565571 12593884 13023901 13481626 13704491 1392571...

output:

526
1096
367
252
154
324
680
1044
491
5

result:

ok 10 numbers

Test #34:

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

input:

2000
1 1 1 2 4 18 21 34 48 54 69 199 3337 8515 218573 227707 511976 1592673 4310118 4522394 11957337 21257931 48488851 54445733 162395054 138728546 112924359 18052347 3231655 2663832 2070981 1705741 484022 221122 72576 60838 24561 6431 2306 891 609 607 406 230 216 74 24 2 1 1 1 1 1 1 1 3 14 64 102 2...

output:

315
237
8
206
89
550
192
5
184
441

result:

ok 10 numbers

Test #35:

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

input:

2000
9213 177930 703789 958369 1201269 1298952 1993372 2508676 2718980 4059394 4389149 5525621 6380223 6846073 7277800 8061246 8308264 9044302 9520883 9721664 9753674 11531372 12477763 12753886 13152864 13462493 13491349 13735471 13800542 14415002 14680672 14734632 15113340 15569086 16373139 1637823...

output:

942
669
102
37
1024
72
348
1247
2
403

result:

ok 10 numbers

Test #36:

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

input:

2000
4 4 22 24 51 170 360 653 1901 2597 2628 7525 9990 13925 16685 19166 23995 365075 863461 1205148 8402387 25990332 416385061 433543645 634519206 25 163 1775 11065 186 245 62392 514750 3925772 874252 10411580 6 21314493 3034351 202 454466964 1381 1446973 281 231910317 40345471 57766273 50200 15239...

output:

117
8
591
415
124
99
68
608
118
270

result:

ok 10 numbers

Test #37:

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

input:

2000
976592750 976592750 443806454 443806454 330548791 330548791 158104030 158104030 799802425 799802425 159913320 159913320 264226708 264226708 61997750 61997750 184368415 184368415 216965005 216965005 643188919 643188919 425939825 425939825 338802124 338802124 308108992 308108992 517631876 5176318...

output:

1
2
2
2
210
1
1
1
2
55

result:

ok 10 numbers

Test #38:

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

input:

2000
666388374 666388374 666388374 666388374 666388374 666388374 666388374 666388374 666388374 666388374 666388374 666388374 666388374 666388374 666388374 666388374 666388374 666388374 666388374 666388374 666388374 666388374 666388374 666388374 666388374 666388374 666388374 666388374 666388374 66638...

output:

1
33
11
251
119
142
55
384
98
3

result:

ok 10 numbers

Subtask #3:

score: 13
Accepted

Dependency #2:

100%
Accepted

Test #39:

score: 13
Accepted
time: 81ms
memory: 370848kb

input:

215185
731444655 365722322 182861160 731444655 230452612 901361503 888862425 127134176 147422580 127064966 137825941 132256594 145230572 128763293 888862425 900760719 157529805 829596989 810539286 74329096 77743469 74087434 80604844 76880592 80492666 74803264 80805087 76028874 78398637 74990491 8105...

output:

69
32
61
80
52
43
28
52
27

result:

ok 9 numbers

Test #40:

score: 0
Accepted
time: 79ms
memory: 370840kb

input:

250000
757125540 378562767 189281382 757125540 173402116 791046775 628636813 9159495 9196244 9164521 9220238 9148765 9244306 9142560 9190643 9154123 9195488 9166610 9200416 9172839 9229221 9144196 9201270 9123189 9211323 9139654 9238212 9123461 9212792 9164589 9224449 9114795 9206356 9132652 9220184...

output:

111
205
198
328
222
359
91
121
358
362

result:

ok 10 numbers

Test #41:

score: 0
Accepted
time: 87ms
memory: 371084kb

input:

250000
982720651 491360322 245680156 982720651 80815100 792424305 755022893 1341481 1342422 1341284 1343154 1342108 1343035 1341825 1343367 1341525 1342861 1341720 1343127 1342208 1342534 1341244 1342662 1341931 1342808 1342038 1342285 1341953 1342898 1341249 1342350 1341191 1343074 1341669 1342320 ...

output:

914
802
1809
2901
1832
1455
3123
1853
2500
2132

result:

ok 10 numbers

Test #42:

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

input:

172124
824251753 412125877 206062939 824251753 412125877 824251753 412125875 206062936 103031467 103031473 103031471 103031472 51515737 103031472 103031471 103031473 103031467 206062936 412125875 824251753 412125877 824251753 206062939 412125877 824251753 264101581 275073614 759182826 379591414 1897...

output:

1263
127
21
13190
27
11
51

result:

ok 7 numbers

Test #43:

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

input:

250000
989657584 494828793 247414397 989657584 494828793 989657584 494828791 247414394 123707196 123707202 123707200 123707201 61853601 123707201 123707200 123707202 123707196 247414394 494828791 989657584 494828793 989657584 247414397 494828793 989657584 85241202 498558854 520087204 260043603 13002...

output:

58712
4504
4305
5946
17
11
18
5111
21
79365

result:

ok 10 numbers

Test #44:

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

input:

250000
433494437 165580141 63245986 24157817 9227465 3524578 1346269 514229 196418 75025 28657 10946 4181 1597 610 233 89 34 13 5 2 1 1 1 3 8 21 55 144 377 987 2584 6765 17711 46368 121393 317811 832040 2178309 5702887 14930352 39088169 102334155 267914296 701408733 971899672 701408733 267914296 102...

output:

5
20543
13181
30
16512
2629
3158
1897
10969
2526

result:

ok 10 numbers

Test #45:

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

input:

185137
513526187 513525390 513525390 275847602 433494437 165580141 63245986 24157817 9227465 3524578 1346269 514229 196418 75025 28657 10946 4181 1597 610 233 89 34 13 5 2 1 1 1 3 8 21 55 144 377 987 2584 6765 17711 46368 121393 317811 832040 2178309 5702887 14930352 39088169 102334155 267914296 701...

output:

5
66303
24374
24328
31615
35507
15533
4336
27937

result:

ok 9 numbers

Test #46:

score: 0
Accepted
time: 86ms
memory: 370796kb

input:

250000
951058198 370492150 160418886 80209698 30555982 11458969 3819688 3819280 3819280 7638691 19097104 49654012 210073504 580566042 370913834 701408733 267914296 102334155 39088169 14930352 5702887 2178309 832040 317811 121393 46368 17711 6765 2584 987 377 144 55 21 8 3 1 1 1 2 5 13 34 89 233 610 ...

output:

5
36497
1187
18773
28857
3463
31201
17033
2709
10886

result:

ok 10 numbers

Test #47:

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

input:

250000
865798415 375961378 187980872 74105948 34337042 17168283 8584371 3151690 871570 435628 166930 63637 24706 9517 3891 1840 478 237 67 33 16 8 3 1 1 2 18 85 167 638 1400 5348 14904 38982 102529 268823 1139920 2280460 5432086 39769053 113875103 489836681 23129553 433494437 165580141 63245986 2415...

output:

5
23179
14219
15563
4637
9839
3729
13595
17040
18494

result:

ok 10 numbers

Test #48:

score: 0
Accepted
time: 81ms
memory: 371656kb

input:

250000
433494437 165580141 63245986 24157817 9227465 3524578 1346269 514229 196418 75025 28657 10946 4181 1597 610 233 89 34 13 5 2 1 1 1 3 8 21 55 144 377 987 2584 6765 17711 46368 121393 317811 832040 2178309 5702887 14930352 39088169 102334155 267914296 701408733 443806454 701408733 267914296 102...

output:

5
10273
4601
6541
1999
3
12383
14695
9441
12478

result:

ok 10 numbers

Test #49:

score: 0
Accepted
time: 90ms
memory: 371472kb

input:

250000
318876023 159437926 69026881 34513094 13128523 4872699 1489389 744592 372163 170103 85452 42355 10528 3474 456 202 95 45 9 4 1 1 3 7 19 38 226 677 1418 2953 6167 15896 32017 202219 1691812 3383053 8256292 21384788 90411361 409287768 818574739 128634196 433494437 165580141 63245986 24157817 92...

output:

5
12123
1823
1882
4883
3
17547
12641
1091
21007

result:

ok 10 numbers

Test #50:

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

input:

188209
293379026 438088029 169341978 808844213 284656068 241880767 865075425 306627929 508364414 564916234 481937987 212895952 114369114 695349094 666607132 291855444 486349861 640531236 731800321 18294424 312644772 391466670 421842107 588644319 246540855 774543974 221507944 674048440 546463785 8516...

output:

28266
5618
96144
18710
66750
1748
122495

result:

ok 7 numbers

Test #51:

score: 0
Accepted
time: 91ms
memory: 371036kb

input:

250000
227607093 976683116 474694934 749632235 31277926 620172541 754831612 76859070 827684869 148042002 58595111 648383540 409481884 621583892 415395822 798293342 568350101 700321150 921126677 779221944 284944174 524738403 33449022 47991703 109303715 937884294 200387539 371514809 507032953 59192725...

output:

107997
15340
44530
13786
92531
147819
56483
115104
94779
112370

result:

ok 10 numbers

Test #52:

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

input:

250000
156 22375912 7 2960 25 2856560 17 48646221 234913 1 12 10521 26 1 15 105474 915865941 273 168709 1440331 234736 433413 421551 111687 450514614 1 126365776 1725 1 3869508 13 5213171 2636139 321 233963 714285 2871890 86350514 892 73 425431611 1182555 1505386 110 10 101174 134328 118 10654051 34...

output:

37564
89027
139097
115576
2185
64544
2925
39278
92757
102989

result:

ok 10 numbers

Test #53:

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

input:

250000
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1...

output:

7686
102123
55693
50503
65764
23868
38161
11503
149559
98272

result:

ok 10 numbers

Test #54:

score: 0
Accepted
time: 97ms
memory: 371624kb

input:

250000
1 1 3 3 10 26 68 72 100 194 1051 2528 5760 15813 27941 270815 304291 3336465 3441434 3594700 6548433 10844829 33176106 79881783 508861374 817146059 468302870 221243858 55527925 48715344 42638124 3038581 2940002 764948 208889 62375 29115 19420 3347 1586 688 315 203 189 59 5 3 3 2 1 1 2 4 8 10 ...

output:

20001
26618
52480
21460
64232
4605
40128
31139
54366
20025

result:

ok 10 numbers

Test #55:

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

input:

250000
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1...

output:

33825
373
42653
30775
28416
46896
68996
12248
36134
33250

result:

ok 10 numbers

Test #56:

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

input:

250000
1 1 2 21 27 48 189 215 1001 2947 4678 6709 8520 11097 218701 1804367 11027807 11427642 20714188 23971863 41858011 65520697 312302579 354860234 985199567 263 337 83958994 757 50 181022 15703 728 270067 3 103449480 59925680 234 49843265 137242 1168268 1442401 5 9522777 1777 40 12613654 3849381 ...

output:

21161
24256
86409
27325
36235
34825
82658
111014
9024
7707

result:

ok 10 numbers

Test #57:

score: 0
Accepted
time: 92ms
memory: 370820kb

input:

250000
905945962 905945962 182138607 182138607 453771894 453771894 627380431 627380431 108838476 108838476 404263107 404263107 559563501 559563501 755052244 755052244 919843290 919843290 135188110 135188110 655972393 655972393 427831416 427831416 920745017 920745017 559230157 559230157 510466525 510...

output:

1
1
1
2
84737
1
2
1
2
9138

result:

ok 10 numbers

Test #58:

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

input:

250000
364786955 364786955 364786955 364786955 364786955 364786955 364786955 364786955 364786955 364786955 364786955 364786955 364786955 364786955 364786955 364786955 364786955 364786955 364786955 364786955 364786955 364786955 364786955 364786955 364786955 364786955 364786955 364786955 364786955 364...

output:

60708
10735
1246
14191
6991
28273
22917
136
14279
53049

result:

ok 10 numbers

Subtask #4:

score: 32
Accepted

Test #59:

score: 32
Accepted
time: 1011ms
memory: 370784kb

input:

185137
895278847 447639418 223819705 895278847 25847602 892542542 725274571 68345857 72124244 67050536 71135605 66549838 72378749 66083078 72261084 67667076 70423484 68942136 725274571 798132375 68764887 958288578 703862250 55104628 58120315 54690522 57110282 54279470 56516680 54581941 58474132 5445...

output:

59
26
80
55
43
41
79
37
57
79
69
29
31
25
26
76
32
25
27
36
34
39
67
40
67
71
45
40
49
52
64
61
29
40
39
34
41
19
28
51
31
43
62
23
31
26
73
39
63
36
53
27
46
56
30
67
60
37
71
22
42
59
67
87
16
27
20
38
14
64
20
19
41
34
55
53
15
51
43
29
71
60
49
9
76
18
86
29
73
61
38
46
21
62
20
20
67
71
83
82
5...

result:

ok 46660 numbers

Test #60:

score: 0
Accepted
time: 1280ms
memory: 371548kb

input:

250000
667582288 333791140 166895569 667582288 99573823 970008947 834597000 12471817 12607290 12487687 12576099 12465363 12618633 12513272 12580300 12472038 12635499 12521112 12568109 12475947 12596996 12534373 12566264 12457253 12610586 12463726 12606038 12490882 12599220 12538123 12628955 12536981...

output:

479
432
209
299
73
389
201
103
301
236
132
294
176
319
309
76
223
90
292
372
428
240
403
469
459
298
330
139
178
264
119
140
215
116
231
90
412
284
131
272
101
103
400
413
410
403
94
165
115
157
134
443
128
125
239
297
140
283
111
409
430
224
112
194
279
224
410
414
275
110
282
285
168
146
216
318
2...

result:

ok 50000 numbers

Test #61:

score: 0
Accepted
time: 1105ms
memory: 371600kb

input:

250000
686918541 343459266 171729631 686918541 162600005 909519391 751917777 1531698 1533456 1531623 1534143 1532545 1533883 1531702 1533707 1532628 1533520 1532278 1533729 1531461 1534213 1531804 1532982 1531815 1532983 1532627 1534082 1532622 1533761 1531583 1533895 1532427 1533015 1532299 1533382...

output:

3543
1850
1040
1576
2987
3193
1551
1318
3629
1026
2588
756
2167
3104
2934
2232
2279
961
2073
811
2729
2236
1198
2875
3166
1205
924
1942
2610
1286
3039
1881
953
864
3285
3160
1722
2892
1046
2827
1211
721
689
2659
2676
2659
2569
2931
2691
730
2489
1744
2854
1273
2449
1871
2381
1446
1191
1685
1864
3156...

result:

ok 50000 numbers

Test #62:

score: 0
Accepted
time: 1093ms
memory: 373072kb

input:

250000
976592750 488296376 244148189 976592750 488296376 976592750 488296374 244148186 122074092 122074097 122074095 122074096 61037049 122074096 122074095 122074097 122074092 244148186 488296374 976592750 488296376 976592750 244148189 488296376 976592750 409633549 365786823 658104030 329052016 1645...

output:

1676
14308
250
20
65921
11
2622
167
26899
20
38597
92
15
129
22
22
16
1516
23
20
547
1207
236
35
190
45
16
32
58
151
1453
1662
10957
54
11
25155
3732
21
7261
21
11
11
313
492
19130
35
183
11
278
204
88
20218
18716
16
34
17
11163
11119
31310
17732
10615
25
18
46
32
4099
42
19
49
1980
111
29
85
11352
...

result:

ok 50000 numbers

Test #63:

score: 0
Accepted
time: 1076ms
memory: 371016kb

input:

250000
433494437 165580141 63245986 24157817 9227465 3524578 1346269 514229 196418 75025 28657 10946 4181 1597 610 233 89 34 13 5 2 1 1 1 3 8 21 55 144 377 987 2584 6765 17711 46368 121393 317811 832040 2178309 5702887 14930352 39088169 102334155 267914296 701408733 832370892 433494437 165580141 632...

output:

5
20527
13813
12640
5973
6627
7069
11696
3176
743
9502
9651
5168
12925
9086
5870
7603
4712
6054
12275
3079
567
17691
8753
18989
10222
3905
12784
5672
5261
16777
12767
12599
710
2037
12534
67
6568
2435
7722
3260
12523
9693
4839
2287
7474
9667
7564
16286
16217
16360
2251
14978
16296
2616
16392
2213
22...

result:

ok 50000 numbers

Test #64:

score: 0
Accepted
time: 1128ms
memory: 370844kb

input:

250000
629015262 148490267 56718968 21667403 8283034 3182614 1263973 608969 304640 152514 76011 30718 14995 14903 14903 45771 654641 1918244 5100904 13384710 35051977 91771730 240262526 480525026 6 701408733 267914296 102334155 39088169 14930352 5702887 2178309 832040 317811 121393 46368 17711 6765 ...

output:

5
36339
13911
19286
3660
4681
10043
7041
30819
14337
9965
25379
25453
7873
13072
17743
2735
7889
16263
11239
10436
5115
5059
6691
9460
31463
5417
15517
4861
14363
1522
20925
12229
6376
17425
13285
1104
30779
5369
3157
12741
10219
28037
20085
13922
5264
32494
13281
1421
6989
5905
26721
6539
7853
7407...

result:

ok 50000 numbers

Test #65:

score: 0
Accepted
time: 903ms
memory: 371412kb

input:

250000
433494437 165580141 63245986 24157817 9227465 3524578 1346269 514229 196418 75025 28657 10946 4181 1597 610 233 89 34 13 5 2 1 1 1 3 8 21 55 144 377 987 2584 6765 17711 46368 121393 317811 832040 2178309 5702887 14930352 39088169 102334155 267914296 701408733 697398399 701408733 267914296 102...

output:

5
10231
1137
7150
57
5245
157
3237
2097
843
8970
6499
1971
3113
660
3781
1632
4129
6473
3761
5067
1954
409
187
3408
3909
2322
2891
1659
101
4923
1111
6545
2732
4227
3405
1759
5893
3927
8351
2578
9037
7277
3047
3383
603
5199
6254
1554
2216
182
1592
4217
1857
3723
2869
3219
2238
595
2123
4179
351
1403...

result:

ok 50000 numbers

Test #66:

score: 0
Accepted
time: 926ms
memory: 371400kb

input:

250000
825678540 412839226 67009950 33504747 14057451 7028952 1638368 580395 102658 51791 25635 9824 4051 2019 413 143 10 1 1 1 5 7 15 32 65 131 284 755 1552 5869 16313 119179 238772 477628 1057273 2694946 5389923 19447437 86457554 172914871 345829452 1 701408733 267914296 102334155 39088169 1493035...

output:

5
12101
8451
3573
7577
245
4531
6275
3379
1307
5305
9989
7247
851
9007
7227
969
2199
3385
4663
8179
2551
569
8184
2019
3823
6333
11711
3629
3521
9699
3215
8311
5116
5978
1589
3871
10720
7387
8498
4716
377
5839
1951
9253
447
2283
7156
2889
3567
8761
1855
3439
2679
3883
865
7479
6979
7983
5647
8181
91...

result:

ok 50000 numbers

Test #67:

score: 0
Accepted
time: 1069ms
memory: 370920kb

input:

188505
161345686 5272726 714528027 303063022 84492369 534113481 792252188 164283975 162313449 429912221 14219758 414229179 242444828 851607918 25274802 504797668 196462116 690674600 420521253 943836246 444633976 765650635 131678296 423786907 850936945 815497569 864339547 916526157 678444069 80949711...

output:

23038
26627
102
38201
14683
60803
4440
39818
2480
43408
24408
102154
36200
47462
60169
4720
39764
11411
15994
22236
55816
118602
62026
22197
53904
15825
456
55582
41704
20818
48957
4300
8904
130792
20334
80972
50689
85487
80824
23161
62713
12500
26503
41007
36111
40201
26840
49212
37010
66216
62558
...

result:

ok 45304 numbers

Test #68:

score: 0
Accepted
time: 1176ms
memory: 370872kb

input:

250000
668792486 819967669 185244105 716798479 36347021 787749381 656305037 504045666 968115889 389944065 3024533 164612811 421903182 710395001 514512490 833575927 443953856 960891208 102245625 814182891 445873403 44535173 241289630 268490286 915860468 986749029 577708538 37809692 69651472 318196424...

output:

93960
80156
6109
128483
68581
151822
90629
71783
24794
3956
32622
54596
58211
62701
27712
70630
46216
16941
38132
141970
15851
15890
144528
43251
63357
31693
136189
64943
28496
78990
63582
93422
14101
149536
110390
96531
18874
29680
20428
71009
7577
76959
74511
38
22544
124233
47428
44537
72333
1171...

result:

ok 50000 numbers

Test #69:

score: 0
Accepted
time: 1316ms
memory: 371664kb

input:

250000
37 6 96 404913880 1 14 11 2982 48476 2148098 384170817 20695 12578 103872 6811 1 572 260 2904 5 599 1850389 1 3 1697 32729936 2905148 31524 110339639 2204 58582 1 24 2891616 212710920 17626 96996 1 247807 50360193 2 1 10249 859 83 123197346 5185 7369 137975966 31 238353422 5607 9456955 1 2245...

output:

142417
22349
68577
4089
13486
28632
82006
28379
31580
32923
23170
76705
2093
14740
15526
36928
122631
12172
9946
4706
24201
15177
71313
1979
61122
40027
42495
79761
31902
73403
91339
128303
17843
16036
55100
3075
90732
18521
34157
54495
26810
121003
37766
44127
18567
48511
2798
52071
61540
110889
13...

result:

ok 50000 numbers

Test #70:

score: 0
Accepted
time: 1180ms
memory: 372896kb

input:

250000
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1...

output:

103594
82307
51684
35608
105416
44451
23332
124406
79695
73088
78665
44661
44073
61539
13123
57897
32974
40848
32451
13307
70563
94802
62974
110966
14295
49523
13623
464
97162
79987
94640
5377
24067
30694
107863
52508
41612
59863
63637
19420
23426
67303
35692
1769
93905
8506
30716
73525
57976
16433
...

result:

ok 50000 numbers

Test #71:

score: 0
Accepted
time: 1161ms
memory: 370836kb

input:

250000
1 1 2 4 6 7 18 19 27 96 193 571 1859 7834 18057 750699 785168 4844212 7241997 11731955 12540860 24664836 176341546 245882267 771641753 233948982 168078489 32663963 26730514 6958229 3983036 1336684 397975 202214 104048 58102 51026 27224 20014 12064 9094 4237 1810 1743 20 6 4 3 1 1 1 1 1 31 112...

output:

68348
59049
19931
74349
48457
46939
45048
31848
22826
47056
36490
77739
35621
17849
3826
59337
43966
53456
77881
11707
26249
29493
67852
16867
15056
74055
30154
29726
74087
60892
56419
16449
28118
32311
28602
58288
103069
8700
45143
55014
39874
73915
8324
31861
24510
8756
42530
19525
11583
55052
921...

result:

ok 50000 numbers

Test #72:

score: 0
Accepted
time: 1118ms
memory: 371016kb

input:

250000
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1...

output:

7199
126600
80624
71855
3828
84854
36874
33332
29209
3789
113351
127028
63417
134918
47320
33583
79762
47229
110572
18580
27482
39896
34583
13073
116771
29347
33906
7237
8170
104872
60123
7148
24274
22035
4260
1001
30720
92871
44774
13587
97811
6157
13602
20412
2601
23902
135699
44189
725
141130
137...

result:

ok 50000 numbers

Test #73:

score: 0
Accepted
time: 1161ms
memory: 370832kb

input:

250000
1 2 7 7 9 11 55 107 306 833 1616 4102 6790 196882 239108 385065 501886 1808587 4064274 9679329 11467210 12277102 26111714 297866936 380701181 24059372 4 1 348268 2 3422782 1670 159201 1593 578 5340 10432238 27 4644073 19770 1145375 463685 98 403848041 53254061 4 286 172069 6 361540422 2672592...

output:

30411
13990
46799
5473
48697
52777
107623
2921
66382
15497
9613
124277
129013
13044
26841
18015
32952
10919
108142
2367
8611
3514
17285
41531
82728
43793
5191
21592
86386
17300
14208
14040
23249
4104
42333
107016
89276
96758
106292
58313
3196
85009
23291
58471
3235
5394
89757
11119
6456
12995
80034
...

result:

ok 50000 numbers

Test #74:

score: 0
Accepted
time: 1075ms
memory: 370848kb

input:

250000
489492647 489492647 523218593 523218593 578973337 578973337 966694073 966694073 281071948 281071948 289809292 289809292 505686874 505686874 432453848 432453848 833653453 833653453 171108689 171108689 663471025 663471025 538838808 538838808 532094131 532094131 866845433 866845433 115105795 115...

output:

1
1
1
2
59328
2
2
2
1
35291
1
2
2
1
41316
1
1
2
2
10899
2
1
1
1
324
1
1
1
1
41135
1
2
2
2
50539
2
2
1
1
73780
2
2
1
1
118360
2
2
2
1
104606
1
1
2
2
34955
2
1
1
2
59023
2
2
1
2
71941
2
2
2
1
57882
2
1
2
2
11778
2
1
2
2
18065
1
1
1
1
15218
1
1
2
2
6102
1
1
1
1
41333
2
2
1
2
32985
1
2
1
2
91693
2
2
2
1...

result:

ok 50000 numbers

Test #75:

score: 0
Accepted
time: 1194ms
memory: 368800kb

input:

250000
244103416 244103416 244103416 244103416 244103416 244103416 244103416 244103416 244103416 244103416 244103416 244103416 244103416 244103416 244103416 244103416 244103416 244103416 244103416 244103416 244103416 244103416 244103416 244103416 244103416 244103416 244103416 244103416 244103416 244...

output:

19345
68123
26154
9097
37941
51130
37049
31443
50382
11999
70625
34401
5437
8970
48409
18765
35564
10403
13962
29839
25245
21315
31847
50211
2869
52823
35386
37165
57617
249
29161
56014
69357
4007
42739
15335
660
13865
22838
45847
8207
68119
58311
35579
41415
69255
35230
28418
12634
30696
11150
2458...

result:

ok 50000 numbers

Subtask #5:

score: 29
Accepted

Test #76:

score: 29
Accepted
time: 1014ms
memory: 370740kb

input:

235469
96936 48463 24226 96936 25951 73765 63933 7121 7884 7166 7731 7464 7559 7300 7767 7314 63933 88750 6093 115886 111307 16371 17529 15944 17376 16099 18186 15910 111307 116042 13997 111982 95565 10713 11748 10849 11375 11093 11406 10874 11810 11197 95565 98914 1302 65917 16473 32953 65917 15943...

output:

34
56
73
61
41
13
74
46
33
33
14
53
36
46
18
63
65
79
72
15
20
57
66
83
19
46
62
58
44
76
76
68
41
56
9
29
59
73
64
21
63
33
29
62
27
36
20
65
54
71
29
47
13
32
48
74
64
75
79
17
24
49
20
41
57
17
23
67
67
18
19
54
63
74
72
45
61
30
27
60
33
36
49
49
24
56
42
60
20
53
32
75
44
57
17
34
71
45
25
39
2...

result:

ok 44829 numbers

Test #77:

score: 0
Accepted
time: 1057ms
memory: 371152kb

input:

250000
88054 44025 22011 88054 6068 106051 104212 1356 1371 1362 1370 1361 1371 1358 1371 1357 1364 1354 1367 1362 1371 1361 1365 1359 1363 1357 1370 1361 1366 1360 1363 1357 1369 1358 1367 1358 1371 1355 1371 1359 1371 1360 1370 1359 1371 1357 1363 1357 1370 1355 1371 1360 1366 1355 1368 1358 1364 ...

output:

146
118
301
455
177
65
187
177
317
351
366
219
382
117
178
136
157
405
245
166
285
271
202
376
120
97
326
95
369
194
221
167
206
73
197
372
117
237
176
128
69
101
449
215
261
410
85
169
257
312
285
297
227
181
423
298
205
371
416
343
301
406
122
335
296
222
190
365
429
433
205
389
223
227
281
357
16...

result:

ok 50000 numbers

Test #78:

score: 0
Accepted
time: 657ms
memory: 372832kb

input:

250000
107093 53547 26774 107093 53547 107093 53545 26771 13384 13391 13389 13390 6696 13390 13389 13391 13384 26771 53545 107093 53547 107093 26774 53547 107093 58591 28809 92235 46118 23060 92235 46118 92235 46116 23057 11527 11533 11531 11532 5767 11532 11531 11533 11527 23057 46116 92235 46118 9...

output:

9568
808
4144
8755
1970
11
17
23
3994
32
805
39362
74
5599
555
20
378
53993
1013
635
4061
5169
11047
156
50274
9903
118
906
732
107
48
24
1477
15
11
327
41341
653
25
370
11
11
45
32
643
97
108
11
196
4733
187
36723
15
593
7660
180
36058
19
46023
489
18525
18
3151
25946
64
728
3398
92
15
249
40
7170
...

result:

ok 50000 numbers

Test #79:

score: 0
Accepted
time: 1056ms
memory: 370848kb

input:

250000
46368 17711 6765 2584 987 377 144 55 21 8 3 1 1 1 2 5 13 34 89 233 610 1597 4181 10946 28657 75025 64095 46368 17711 6765 2584 987 377 144 55 21 8 3 1 1 1 2 5 13 34 89 233 610 1597 4181 10946 28657 75025 8717 46368 17711 6765 2584 987 377 144 55 21 8 3 1 1 1 2 5 13 34 89 233 610 1597 4181 109...

output:

5
33729
13755
7100
10935
1153
12073
5109
4299
9876
31215
18413
3763
8845
11361
425
12511
19165
19280
9727
8095
10455
17266
11872
5917
12524
25852
10185
13907
7411
2601
7002
9908
18185
4439
5293
5855
22592
10326
14810
5086
4221
8897
20479
19672
4056
13219
1566
6502
11003
7254
11555
24651
4090
8385
19...

result:

ok 50000 numbers

Test #80:

score: 0
Accepted
time: 1097ms
memory: 370836kb

input:

250000
116471 39170 19513 9853 4612 2251 1123 565 276 135 66 31 12 5 1 1 4 7 20 38798 77689 3 75025 28657 10946 4181 1597 610 233 89 34 13 5 2 1 1 1 3 8 21 55 144 377 987 2584 6765 17711 46368 158 66462 32941 16638 8286 4033 1489 542 126 47 22 22 25 72 198 408 975 2508 68958 20482 45351 22349 8739 3...

output:

5
57541
33364
2574
39464
9595
49573
3919
35173
10867
27977
37923
18475
20493
20953
16469
4607
20673
35380
14399
11421
16423
13689
27105
24804
4917
7649
32023
599
2537
7196
7613
11501
39886
353
13279
23041
54981
37881
9901
29757
20919
19160
25621
22355
12110
15607
10621
14983
2935
14871
13299
2508
37...

result:

ok 50000 numbers

Test #81:

score: 0
Accepted
time: 901ms
memory: 370876kb

input:

250000
75025 28657 10946 4181 1597 610 233 89 34 13 5 2 1 1 1 3 8 21 55 144 377 987 2584 6765 17711 46368 78800 46368 17711 6765 2584 987 377 144 55 21 8 3 1 1 1 2 5 13 34 89 233 610 1597 4181 10946 28657 75025 83435 46368 17711 6765 2584 987 377 144 55 21 8 3 1 1 1 2 5 13 34 89 233 610 1597 4181 10...

output:

5
16803
4131
3774
13
4243
1236
2020
9656
5867
2013
13423
15991
8094
6872
10637
966
6749
3193
2035
1223
9350
13177
950
2985
5049
1837
15373
7279
6464
4076
5118
11890
11489
857
1499
5541
14170
3298
7397
1761
7055
9518
13190
6316
13774
7665
7112
11771
11934
2526
6233
5906
259
2151
5654
1261
4304
3834
4...

result:

ok 50000 numbers

Test #82:

score: 0
Accepted
time: 890ms
memory: 370840kb

input:

250000
56056 11677 1760 845 181 67 24 9 4 2 2 7 18 45 112 315 662 2474 5004 10367 22140 44426 100497 20581 46368 17711 6765 2584 987 377 144 55 21 8 3 1 1 1 2 5 13 34 89 233 610 1597 4181 10946 28657 75025 3251 116770 58379 29289 8514 4244 2110 480 230 111 57 28 10 5 2 1 1 1 6 19 252 775 1579 9995 2...

output:

5
20609
1228
2598
3189
6838
409
623
11761
4300
13627
5743
1923
6529
611
4519
6057
3729
6385
15005
3269
7794
11634
6301
1823
497
13113
9449
7285
9300
2115
7302
10093
10177
1285
412
13581
2717
12220
6922
15333
8124
17210
4101
1925
16843
3941
8710
14745
3189
4856
14015
4247
5059
1498
1613
6541
12055
13...

result:

ok 50000 numbers

Test #83:

score: 0
Accepted
time: 1124ms
memory: 372888kb

input:

250000
39045 71804 52340 38535 113076 47221 45724 9198 10181 75151 96087 106559 115565 7064 13975 107885 53087 45431 44259 13221 38233 50837 111142 45639 67994 16464 71615 119048 39946 81593 32739 60478 37202 105974 47956 98679 4776 16831 159 57080 42149 27009 83345 76779 8454 96706 13982 97975 1174...

output:

5992
142093
59862
36122
40645
97862
77272
46935
51396
94974
62649
15367
45502
11530
156531
29500
90508
41041
129498
41433
45392
100391
81691
54646
49202
141568
19402
55594
42744
41564
72439
64060
148348
125869
50705
147490
2206
28415
10794
43629
34460
718
78798
37926
114953
30275
41544
128396
66610
...

result:

ok 50000 numbers

Test #84:

score: 0
Accepted
time: 1135ms
memory: 371628kb

input:

250000
601 2508 36 381 42 29025 38 1 1 15798 459 4699 7460 227 3 1 2 1 12 91179 1580 3 269 26 1271 42 231 2 5 113 2 3012 57 1 4 219 23622 1 36 3458 2 7 264 1 47 2072 4846 3 2822 907 1 28709 20 1 4 2 56983 2333 87333 15959 1621 36 1 1783 55 11 6335 38 701 8 95 180 1687 1 29680 81601 86 26818 199 521 ...

output:

133613
56
34740
128535
1513
13446
4778
21719
382
14159
80885
105686
80549
19630
17129
48083
43668
23463
31835
39762
69552
126565
61745
51208
7268
86088
72601
11444
59093
42602
34881
7939
83278
47352
22972
9001
97449
40713
27493
22950
98620
17031
57587
62089
68478
109094
91568
137783
58663
33553
8382...

result:

ok 50000 numbers

Test #85:

score: 0
Accepted
time: 1142ms
memory: 371528kb

input:

250000
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1...

output:

23333
121572
44626
73181
109561
30181
32991
118656
4873
55943
5514
42335
15414
46166
79130
52351
56358
9071
71183
103590
45099
20014
60917
71669
80556
529
25684
104201
29564
38492
83779
30812
35034
21328
44950
65369
125219
149080
1340
41245
63888
50038
15669
55481
30603
34104
14659
57318
5539
34081
...

result:

ok 50000 numbers

Test #86:

score: 0
Accepted
time: 1142ms
memory: 371148kb

input:

250000
1 23 39 42 257 261 498 579 748 1249 3893 3973 5381 14706 15027 5867 3177 2222 651 559 309 197 147 37 37 29 1 1 1 1 1 1 1 1 1 2 5 21 26 50 84 88 12646 56668 114782 96939 60736 8994 5986 5697 1767 873 207 70 28 19 10 7 5 2 1 1 3 5 11 42 182 843 1494 1569 3261 3285 11815 17000 49519 84604 13980 ...

output:

42955
70133
14669
55898
19932
37878
32155
48554
69706
33244
90461
16609
32653
42768
48981
78902
1508
69875
43887
32191
53262
45405
4152
39322
15524
19575
46400
80008
30877
71194
59791
16973
50107
3507
93288
23609
38464
961
23466
5807
70099
42894
2461
93936
91515
98716
12540
45980
6496
4975
46386
560...

result:

ok 50000 numbers

Test #87:

score: 0
Accepted
time: 1169ms
memory: 370840kb

input:

250000
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1...

output:

14789
20493
34995
72569
142648
8049
22435
5976
90118
39845
48831
91499
18538
9062
1337
93011
45380
65840
2461
94264
28658
37265
35458
5897
25236
108278
50018
118445
78737
7371
60138
10142
55024
40900
17233
80884
54829
8573
198
19567
113554
45032
60765
120737
65797
105870
53115
94608
37018
8371
16200...

result:

ok 50000 numbers

Test #88:

score: 0
Accepted
time: 1130ms
memory: 371032kb

input:

250000
1 1 1 1 9 11 12 17 39 89 126 3076 3488 3517 82557 173 378 22 24151 727 1 272 1 92 40 1 5 59320 13895 148 100486 3161 425 404 283 260 146 48 42 13 11 7 1 1 1 19201 415 848 2 1 7088 2 851 5761 91 2 1 153 560 1 1 28 36 95 113 371 639 704 911 1562 1632 2380 7294 7470 24731 30 22542 276 94 1 383 5...

output:

47003
25108
97039
9935
72179
59209
44455
11246
93870
27085
68467
70273
52496
92273
11699
105284
12972
47519
53990
55180
98759
28877
7595
25928
76178
11098
98158
26352
111688
99963
39745
44656
29528
7358
57568
49951
63971
10623
74070
67869
25346
122989
52738
85450
89921
34244
41558
91526
55056
3094
4...

result:

ok 50000 numbers

Test #89:

score: 0
Accepted
time: 1090ms
memory: 370780kb

input:

250000
92282 92282 44964 44964 23476 23476 115808 115808 81354 81354 78255 78255 20278 20278 112528 112528 66648 66648 100589 100589 101553 101553 116824 116824 39328 39328 70459 70459 54197 54197 40286 40286 30967 30967 108922 108922 78692 78692 81073 81073 64309 64309 92490 92490 21083 21083 77391...

output:

1
1
2
2
23213
2
2
2
1
19457
2
1
1
2
112566
2
1
1
2
115507
1
2
1
2
102144
2
2
1
2
61961
2
1
2
1
30225
1
1
2
1
31194
2
1
2
1
36510
2
1
1
2
63490
1
1
1
2
112807
1
1
2
2
11094
1
2
1
2
21089
2
2
1
1
38238
1
2
1
2
11928
2
1
2
2
17458
1
2
2
1
8603
1
1
2
1
55046
2
2
1
1
43059
1
2
1
1
24317
2
2
2
1
3050
2
2
...

result:

ok 50000 numbers

Test #90:

score: 0
Accepted
time: 1196ms
memory: 371088kb

input:

250000
98117 98117 98117 98117 98117 98117 98117 98117 98117 98117 98117 98117 98117 98117 98117 98117 98117 98117 98117 98117 98117 98117 98117 98117 98117 98117 98117 98117 98117 98117 98117 98117 98117 98117 98117 98117 98117 98117 98117 98117 98117 98117 98117 98117 98117 98117 98117 98117 98117...

output:

22470
11637
59451
73401
36788
17796
27967
13317
11133
32523
20689
8774
47753
16243
35779
20561
15905
23649
22708
10977
24631
33617
21309
54876
27556
38743
13913
18744
43426
35379
33
49993
23554
7053
27635
16657
13289
47828
20057
13390
55027
18037
18056
691
13033
55807
47786
50871
34943
21869
22659
1...

result:

ok 50000 numbers

Subtask #6:

score: 11
Accepted

Dependency #1:

100%
Accepted

Dependency #2:

100%
Accepted

Dependency #3:

100%
Accepted

Dependency #4:

100%
Accepted

Dependency #5:

100%
Accepted

Test #91:

score: 11
Accepted
time: 890ms
memory: 371020kb

input:

184190
858014607 429007299 214503645 858014607 114130904 586787388 528387306 60624818 63300553 59509810 64739499 58772895 64569764 60457257 63602240 60950416 528387306 529865336 153334204 910820553 844779128 65193369 67812328 65145377 69148782 67324607 69051776 65513197 68593076 66077185 70191559 65...

output:

78
52
23
42
24
43
45
39
84
36
66
30
19
72
33
73
69
60
62
69
49
23
50
71
35
59
69
46
25
24
66
79
75
57
55
28
43
26
35
68
39
53
56
69
53
22
41
37
65
47
23
53
21
17
31
62
26
70
65
71
59
22
16
49
29
22
22
22
19
76
68
18
73
47
63
59
47
39
74
74
75
42
25
71
63
27
26
59
52
51
29
22
74
20
70
46
50
70
28
19
...

result:

ok 38543 numbers

Test #92:

score: 0
Accepted
time: 857ms
memory: 371424kb

input:

250000
852214615 426107302 213053647 852214615 76576250 634582536 554133964 1198058 1198566 1197330 1199271 1197589 1198428 1197533 1198513 1197995 1199127 1197701 1199061 1197643 1198458 1197969 1198542 1198024 1198636 1197952 1198225 1197887 1198759 1198122 1198989 1196870 1198190 1196887 1199212 ...

output:

1676
1644
3744
1570
831
1637
1519
3025
1457
3243
2503
648
2188
829
1622
3764
1586
931
1474
585
1137
1153
2442
620
3428
4091
3148
2174
2840
2198
848
3135
2148
589
1301
1427
2797
913
2595
2901
2001
2505
951
2027
745
2159
958
743
2157
3069
980
3742
1300
3152
3354
2828
3631
1152
3166
708
2562
1802
3021
...

result:

ok 50000 numbers

Test #93:

score: 0
Accepted
time: 710ms
memory: 371596kb

input:

250000
897938953 448969477 224484739 897938953 448969477 897938953 448969475 224484736 112242367 112242373 112242371 112242372 56121187 112242372 112242371 112242373 112242367 224484736 448969475 897938953 448969477 897938953 224484739 448969477 897938953 133215707 247603754 838288717 419144359 2095...

output:

2089
605
1737
40
15
11
15
192
5414
54350
43258
29
5829
18161
108160
21
7743
22119
35917
15
16
30
396
13999
20
25438
62
7162
18
15259
19
9027
69
22
11
22599
6689
26
926
38
11
11
28772
35
20
21
40
11
32
3340
5591
5194
1012
5620
39
20
1174
167
26
16
357
23
111
19
34
7851
292
190
24
15
4882
41
19
10285
...

result:

ok 50000 numbers

Test #94:

score: 0
Accepted
time: 1147ms
memory: 371464kb

input:

250000
701408733 267914296 102334155 39088169 14930352 5702887 2178309 832040 317811 121393 46368 17711 6765 2584 987 377 144 55 21 8 3 1 1 1 2 5 13 34 89 233 610 1597 4181 10946 28657 75025 196418 514229 1346269 3524578 9227465 24157817 63245986 165580141 433494437 623218936 701408733 267914296 102...

output:

5
20507
4373
7006
2666
12991
10551
4489
6125
11098
4617
629
5408
6472
16884
2699
6767
4678
1063
12491
5149
9184
7180
17421
7285
2083
15523
1079
3137
7995
4877
1731
6430
2915
10087
10483
5277
18913
6367
881
8603
947
3859
9015
2891
2076
106
6544
1925
5608
903
11705
2005
11321
8415
4394
2487
17538
1061...

result:

ok 50000 numbers

Test #95:

score: 0
Accepted
time: 1119ms
memory: 371088kb

input:

250000
832845159 59566624 22472801 7852472 1083511 474205 237579 103019 51183 19993 7701 2708 878 847 847 1724 4366 11856 31487 134319 609068 1691786 3384552 6768372 14620833 37093575 96659738 193319697 386639348 773279196 20825100 433494437 165580141 63245986 24157817 9227465 3524578 1346269 514229...

output:

5
36673
31303
791
15407
15164
21813
8446
2611
24767
3275
4864
3837
19899
3081
26949
20712
891
8548
17165
8525
2405
9528
24956
14741
10614
2380
26474
15883
5311
13303
1273
3425
3647
4279
2743
14366
13005
2253
13079
17640
2165
209
11913
20833
11914
9253
23897
27539
11418
6645
25855
5507
2667
11267
627...

result:

ok 50000 numbers

Test #96:

score: 0
Accepted
time: 874ms
memory: 371756kb

input:

250000
433494437 165580141 63245986 24157817 9227465 3524578 1346269 514229 196418 75025 28657 10946 4181 1597 610 233 89 34 13 5 2 1 1 1 3 8 21 55 144 377 987 2584 6765 17711 46368 121393 317811 832040 2178309 5702887 14930352 39088169 102334155 267914296 701408733 819967669 701408733 267914296 102...

output:

5
10191
4151
2971
5880
6889
5117
4614
3237
862
3029
3614
3793
6152
1605
2203
8081
5700
971
1801
466
12
5704
391
4227
6232
3056
7387
1189
7109
7659
2539
5341
1282
3567
6903
6664
4039
3251
3839
3524
6109
802
523
36
2446
9359
2034
1133
3271
5731
7499
431
3289
2343
155
888
4995
1073
8193
4063
3789
2859
...

result:

ok 50000 numbers

Test #97:

score: 0
Accepted
time: 926ms
memory: 371476kb

input:

250000
656640950 248868183 89963127 21021799 7571934 1694796 449941 224955 53365 20563 8345 3485 1624 597 127 47 19 8 3 1 1 4 10 29 80 221 423 988 4230 12155 32408 86027 172347 622078 1244158 2938400 5877480 13449648 34470669 68941568 158904547 407772823 1050854 701408733 267914296 102334155 3908816...

output:

5
12117
1947
3951
161
2401
8643
1345
5695
3126
1685
6615
297
355
453
6151
8711
1578
2433
5852
7125
1890
977
3315
6401
4967
5837
4922
332
8661
2989
831
287
4449
5281
2492
789
5773
2141
5673
8761
21
5967
846
2389
2723
3227
3879
9835
25
6025
3522
2553
2759
8899
1299
1049
2401
1843
1730
833
1284
9413
15...

result:

ok 50000 numbers

Test #98:

score: 0
Accepted
time: 1160ms
memory: 372840kb

input:

250000
67074329 178612875 762055017 459867222 319781831 566191557 132606595 931805416 776244560 139521412 99688 240530776 704608740 818209825 831397716 76621315 44400063 842629544 683630714 457718140 344564320 157490546 290246236 439071821 540251129 816815202 25361110 368795747 548775111 817392844 5...

output:

119978
11573
21477
65762
52842
44177
67079
80646
73879
23190
34951
115477
43224
91505
89291
33350
111417
102443
16425
62625
127069
21651
124677
87657
56029
33131
136779
126746
79427
119564
122003
205
41969
23889
14798
35559
105351
59635
110855
116105
80388
68495
134415
30126
105557
104827
43745
3868...

result:

ok 50000 numbers

Test #99:

score: 0
Accepted
time: 1136ms
memory: 373084kb

input:

250000
71 20 2624453 2 24062 10519951 8012 239455510 558506 494687051 571786771 113 4905480 264 614 403060321 59325 1300 751 33441968 5 1357 3 13 1846357 2754302 1627903 272 5209 3362761 225037731 42827 1 6 1 715686 11680 20397 139 101852145 1801 24889 48581 33 28116 178 162015902 4201417 25 5794795...

output:

71315
3244
130912
89996
75136
15305
96358
39952
94804
22740
30207
149445
54330
9858
11746
25213
95249
28715
27799
74364
121956
21953
39387
13731
47172
2629
96174
151475
71334
61241
149361
54698
80282
59004
39355
19884
45390
91747
39266
70670
130046
28928
63907
13658
13642
56387
65509
112573
16114
39...

result:

ok 50000 numbers

Test #100:

score: 0
Accepted
time: 1159ms
memory: 371508kb

input:

250000
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1...

output:

32718
79979
46742
3058
39256
74256
90728
7504
72558
107065
30466
37307
2558
29643
68800
45807
20408
117777
109892
1638
11737
15446
73072
44662
137479
49719
19461
78811
108783
59072
16578
25000
39166
99120
57655
36476
89249
28603
1355
16847
6755
77439
62220
5150
125470
68794
49874
41881
46711
24206
5...

result:

ok 50000 numbers

Test #101:

score: 0
Accepted
time: 1181ms
memory: 370828kb

input:

250000
1 1 2 14 23 86 96 599 778 1290 1660 1705 2322 5598 7375 9058 22276 34962 96852 120523 133826 185108 1871232 3645167 4674163 218790032 43672025 37351441 29566828 12058748 3663895 760088 703881 672643 631826 202409 113024 15249 2167 2114 1779 145 144 109 88 62 11 1 1 1 1 1 1 1 6 6 70 104 298 14...

output:

12741
35165
11369
13051
14920
3370
54058
28639
48656
5703
52464
73817
3638
29806
83255
4488
49023
28978
24010
1210
107807
3284
47582
87661
25005
79764
12215
37266
7361
40430
48510
86675
6294
4168
87189
6185
24993
35542
11454
38717
50174
5340
1959
44673
61604
47166
18365
49638
21369
47699
36272
25275...

result:

ok 50000 numbers

Test #102:

score: 0
Accepted
time: 1164ms
memory: 370876kb

input:

250000
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1...

output:

100730
4884
124995
68939
75179
45646
79886
52994
10303
67386
110638
46201
58307
50192
33446
11359
23549
136651
49610
13913
120080
113880
84612
76760
160071
1088
7402
64110
22284
47201
7035
20669
141775
126516
28770
34050
113814
67772
57546
30729
81761
30308
131968
82025
103791
74510
88710
55161
7224...

result:

ok 50000 numbers

Test #103:

score: 0
Accepted
time: 1143ms
memory: 370792kb

input:

250000
1 1 1 14 20 84 150 374 376 467 856 1713 2955 3180 5707 7413 89164 107736 168581 1149689 12033111 58735969 70426324 128488093 442951151 1 12 7 80086 54 816 10032 3182362 12737 330250439 22822 202986350 83977890 701570 1433007 35516 27204982 3444 57842929 112021948 8470 20301 74044 14259 15201 ...

output:

19308
104361
52833
9605
49885
4407
219
74764
38258
105
5382
10111
106893
24956
36466
19621
20682
17970
83200
17162
2632
25083
75288
90899
24801
74436
50433
55907
66501
50918
87344
91007
11970
15300
87700
92046
29860
16735
51296
28326
108186
35300
53256
40347
103786
56712
34295
81307
391
60906
48282
...

result:

ok 50000 numbers

Test #104:

score: 0
Accepted
time: 1072ms
memory: 370860kb

input:

250000
309568395 309568395 34792516 34792516 495169458 495169458 699945856 699945856 41864239 41864239 270542309 270542309 795726635 795726635 590220679 590220679 860038714 860038714 104655329 104655329 958727713 958727713 594428398 594428398 891352748 891352748 311028376 311028376 63577573 63577573...

output:

1
2
1
2
142652
1
1
2
2
30135
2
2
1
2
31340
2
1
1
2
96932
2
2
2
2
25931
2
1
1
1
20577
2
1
2
2
104113
1
2
2
1
17659
2
2
1
1
35497
2
1
1
1
17765
1
1
2
1
32727
1
1
2
2
62418
1
1
2
2
55815
1
2
2
2
69701
2
2
2
2
55570
1
2
2
2
14032
2
1
2
1
3793
2
2
1
2
73472
1
2
2
2
94558
2
1
2
2
56405
2
1
2
1
23814
1
1
1...

result:

ok 50000 numbers

Test #105:

score: 0
Accepted
time: 1173ms
memory: 372924kb

input:

250000
980637787 980637787 980637787 980637787 980637787 980637787 980637787 980637787 980637787 980637787 980637787 980637787 980637787 980637787 980637787 980637787 980637787 980637787 980637787 980637787 980637787 980637787 980637787 980637787 980637787 980637787 980637787 980637787 980637787 980...

output:

67565
19924
18310
69882
1693
15971
2819
9389
52221
456
24250
1953
28193
9711
47054
9541
3667
70744
30096
40659
63396
16260
13081
1731
56759
32304
24577
79734
80640
17615
19503
45333
18367
34619
43531
16011
43579
34323
33438
33625
3332
11370
48495
32254
4207
34566
4453
25903
16203
30307
29262
13641
3...

result:

ok 50000 numbers

Extra Test:

score: 0
Extra Test Passed